/* * Copyright (c) Ascensio System SIA 2018. All rights reserved * * http://www.onlyoffice.com * * Version: 0.0.0 (build:0) */ function onDropDownKeyDown(e){var t=$(this),n=t.parent(),r=jQuery.Event("keydown.before.bs.dropdown"),i=jQuery.Event("keydown.after.bs.dropdown");n.trigger(r),n.hasClass("no-stop-propagate")?(arguments.length>1&&arguments[1]instanceof KeyboardEvent&&(e=arguments[1]),/^(38|40|27|13|9|37|39)$/.test(e.keyCode)&&!e.ctrlKey&&!e.altKey&&(patchDropDownKeyDownAdditional.call(this,e),/(37|39)/.test(e.keyCode)||(e.preventDefault(),e.stopPropagation()))):(patchDropDownKeyDown.call(this,e),e.preventDefault(),e.stopPropagation()),n.trigger(i)}function patchDropDownKeyDown(e){if(!/(38|40|27|37|39)/.test(e.keyCode))return;var t=$(this);e.preventDefault(),e.stopPropagation();if(t.is(".disabled, :disabled"))return;var n=getParent(t),r=n.hasClass("open")||n.hasClass("over");if(!r||r&&e.keyCode==27){if(e.which==27){i=$("[role=menu] li.dropdown-submenu.over:visible",n);if(i.size())return i.eq(i.size()-1).removeClass("over"),!1;n.hasClass("dropdown-submenu")&&n.hasClass("over")?(n.removeClass("over"),n.find("> a").focus()):n.find("[data-toggle=dropdown]").focus()}return r?t.click():undefined}var i=$("> [role=menu] > li:not(.divider):not(.disabled):visible",n).find("> a");if(!i.length)return;var s=i.index(i.filter(":focus"));if(e.keyCode==39){if(s<0)return;var o=i.eq(s).parent();o.hasClass("dropdown-submenu")&&!o.hasClass("over")&&(o.mouseenter(),o.addClass("focused-submenu"),_.delay(function(){var e=$("> [role=menu]",o),t=e.find("> li:not(.divider):not(.disabled):visible > a"),n=0;if(e.find("> .menu-scroll").length>0){var r=e.scrollTop();for(var i=0;ir){n=i;break}}t.length>0&&t.eq(n).focus()},250))}else e.keyCode==37?n.hasClass("dropdown-submenu")&&n.hasClass("over")&&(n.removeClass("over"),n.find("> a").focus()):(e.keyCode==38?s>0?s--:t.hasClass("no-cyclic")?s=0:s=i.length-1:e.keyCode==40&&(s [role=menu] > li:not(.divider):not(.disabled):visible",n).find("> a");if(!i.length)return;var s=i.index(i.filter(".focus"));e.keyCode==38?s>0?s--:t.hasClass("no-cyclic")?s=0:s=i.length-1:e.keyCode==40&&(s2;e==null&&(e=[]);if(p&&e.reduce===p)return r&&(t=x.bind(t,r)),i?e.reduce(t,n):e.reduce(t);T(e,function(e,s,o){i?n=t.call(r,n,e,s,o):(n=e,i=!0)});if(!i)throw new TypeError(N);return n},x.reduceRight=x.foldr=function(e,t,n,r){var i=arguments.length>2;e==null&&(e=[]);if(d&&e.reduceRight===d)return r&&(t=x.bind(t,r)),i?e.reduceRight(t,n):e.reduceRight(t);var s=e.length;if(s!==+s){var o=x.keys(e);s=o.length}T(e,function(u,a,f){a=o?o[--s]:--s,i?n=t.call(r,n,e[a],a,f):(n=e[a],i=!0)});if(!i)throw new TypeError(N);return n},x.find=x.detect=function(e,t,n){var r;return C(e,function(e,i,s){if(t.call(n,e,i,s))return r=e,!0}),r},x.filter=x.select=function(e,t,n){var r=[];return e==null?r:v&&e.filter===v?e.filter(t,n):(T(e,function(e,i,s){t.call(n,e,i,s)&&r.push(e)}),r)},x.reject=function(e,t,n){return x.filter(e,function(e,r,i){return!t.call(n,e,r,i)},n)},x.every=x.all=function(e,t,r){t||(t=x.identity);var i=!0;return e==null?i:m&&e.every===m?e.every(t,r):(T(e,function(e,s,o){if(!(i=i&&t.call(r,e,s,o)))return n}),!!i)};var C=x.some=x.any=function(e,t,r){t||(t=x.identity);var i=!1;return e==null?i:g&&e.some===g?e.some(t,r):(T(e,function(e,s,o){if(i||(i=t.call(r,e,s,o)))return n}),!!i)};x.contains=x.include=function(e,t){return e==null?!1:y&&e.indexOf===y?e.indexOf(t)!=-1:C(e,function(e){return e===t})},x.invoke=function(e,t){var n=u.call(arguments,2),r=x.isFunction(t);return x.map(e,function(e){return(r?t:e[t]).apply(e,n)})},x.pluck=function(e,t){return x.map(e,function(e){return e[t]})},x.where=function(e,t,n){return x.isEmpty(t)?n?void 0:[]:x[n?"find":"filter"](e,function(e){for(var n in t)if(t[n]!==e[n])return!1;return!0})},x.findWhere=function(e,t){return x.where(e,t,!0)},x.max=function(e,t,n){if(!t&&x.isArray(e)&&e[0]===+e[0]&&e.length<65535)return Math.max.apply(Math,e);if(!t&&x.isEmpty(e))return-Infinity;var r={computed:-Infinity,value:-Infinity};return T(e,function(e,i,s){var o=t?t.call(n,e,i,s):e;o>r.computed&&(r={value:e,computed:o})}),r.value},x.min=function(e,t,n){if(!t&&x.isArray(e)&&e[0]===+e[0]&&e.length<65535)return Math.min.apply(Math,e);if(!t&&x.isEmpty(e))return Infinity;var r={computed:Infinity,value:Infinity};return T(e,function(e,i,s){var o=t?t.call(n,e,i,s):e;or||n===void 0)return 1;if(n>>1;n.call(r,e[u])=0})})},x.difference=function(e){var t=a.apply(r,u.call(arguments,1));return x.filter(e,function(e){return!x.contains(t,e)})},x.zip=function(){var e=x.max(x.pluck(arguments,"length").concat(0)),t=new Array(e);for(var n=0;n=0;n--)t=[e[n].apply(this,t)];return t[0]}},x.after=function(e,t){return function(){if(--e<1)return t.apply(this,arguments)}},x.keys=E||function(e){if(e!==Object(e))throw new TypeError("Invalid object");var t=[];for(var n in e)x.has(e,n)&&t.push(n);return t},x.values=function(e){var t=x.keys(e),n=t.length,r=new Array(n);for(var i=0;i":">",'"':""","'":"'"}};_.unescape=x.invert(_.escape);var D={escape:new RegExp("["+x.keys(_.escape).join("")+"]","g"),unescape:new RegExp("("+x.keys(_.unescape).join("|")+")","g")};x.each(["escape","unescape"],function(e){x[e]=function(t){return t==null?"":(""+t).replace(D[e],function(t){return _[e][t]})}}),x.result=function(e,t){if(e==null)return void 0;var n=e[t];return x.isFunction(n)?n.call(e):n},x.mixin=function(e){T(x.functions(e),function(t){var n=x[t]=e[t];x.prototype[t]=function(){var e=[this._wrapped];return o.apply(e,arguments),F.call(this,n.apply(x,e))}})};var P=0;x.uniqueId=function(e){var t=++P+"";return e?e+t:t},x.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var H=/(.)^/,B={"'":"'","\\":"\\","\r":"r","\n":"n"," ":"t","\u2028":"u2028","\u2029":"u2029"},j=/\\|'|\r|\n|\t|\u2028|\u2029/g;x.template=function(e,t,n){var r;n=x.defaults({},n,x.templateSettings);var i=new RegExp([(n.escape||H).source,(n.interpolate||H).source,(n.evaluate||H).source].join("|")+"|$","g"),s=0,o="__p+='";e.replace(i,function(t,n,r,i,u){return o+=e.slice(s,u).replace(j,function(e){return"\\"+B[e]}),n&&(o+="'+\n((__t=("+n+"))==null?'':_.escape(__t))+\n'"),r&&(o+="'+\n((__t=("+r+"))==null?'':__t)+\n'"),i&&(o+="';\n"+i+"\n__p+='"),s=u+t.length,t}),o+="';\n",n.variable||(o="with(obj||{}){\n"+o+"}\n"),o="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+o+"return __p;\n";try{r=new Function(n.variable||"obj","_",o)}catch(u){throw u.source=o,u}if(t)return r(t,x);var a=function(e){return r.call(this,e,x)};return a.source="function("+(n.variable||"obj")+"){\n"+o+"}",a},x.chain=function(e){return x(e).chain()};var F=function(e){return this._chain?x(e).chain():e};x.mixin(x),T(["pop","push","reverse","shift","sort","splice","unshift"],function(e){var t=r[e];x.prototype[e]=function(){var n=this._wrapped;return t.apply(n,arguments),(e=="shift"||e=="splice")&&n.length===0&&delete n[0],F.call(this,n)}}),T(["concat","join","slice"],function(e){var t=r[e];x.prototype[e]=function(){return F.call(this,t.apply(this._wrapped,arguments))}}),x.extend(x.prototype,{chain:function(){return this._chain=!0,this},value:function(){return this._wrapped}})}).call(this),define("underscore",function(e){return function(){var t,n;return t||e._}}(this)),function(e,t){typeof module=="object"&&typeof module.exports=="object"?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}(typeof window!="undefined"?window:this,function(window,noGlobal){function isArrayLike(e){var t=!!e&&"length"in e&&e.length,n=jQuery.type(e);return n==="function"||jQuery.isWindow(e)?!1:n==="array"||t===0||typeof t=="number"&&t>0&&t-1 in e}function winnow(e,t,n){if(jQuery.isFunction(t))return jQuery.grep(e,function(e,r){return!!t.call(e,r,e)!==n});if(t.nodeType)return jQuery.grep(e,function(e){return e===t!==n});if(typeof t=="string"){if(risSimple.test(t))return jQuery.filter(t,e,n);t=jQuery.filter(t,e)}return jQuery.grep(e,function(e){return indexOf.call(t,e)>-1!==n})}function sibling(e,t){while((e=e[t])&&e.nodeType!==1);return e}function createOptions(e){var t={};return jQuery.each(e.match(rnotwhite)||[],function(e,n){t[n]=!0}),t}function completed(){document.removeEventListener("DOMContentLoaded",completed),window.removeEventListener("load",completed),jQuery.ready()}function Data(){this.expando=jQuery.expando+Data.uid++}function dataAttr(e,t,n){var r;if(n===undefined&&e.nodeType===1){r="data-"+t.replace(rmultiDash,"-$&").toLowerCase(),n=e.getAttribute(r);if(typeof n=="string"){try{n=n==="true"?!0:n==="false"?!1:n==="null"?null:+n+""===n?+n:rbrace.test(n)?jQuery.parseJSON(n):n}catch(i){}dataUser.set(e,t,n)}else n=undefined}return n}function adjustCSS(e,t,n,r){var i,s=1,o=20,u=r?function(){return r.cur()}:function(){return jQuery.css(e,t,"")},a=u(),f=n&&n[3]||(jQuery.cssNumber[t]?"":"px"),l=(jQuery.cssNumber[t]||f!=="px"&&+a)&&rcssNum.exec(jQuery.css(e,t));if(l&&l[3]!==f){f=f||l[3],n=n||[],l=+a||1;do s=s||".5",l/=s,jQuery.style(e,t,l+f);while(s!==(s=u()/a)&&s!==1&&--o)}return n&&(l=+l||+a||0,i=n[1]?l+(n[1]+1)*n[2]:+n[2],r&&(r.unit=f,r.start=l,r.end=i)),i}function getAll(e,t){var n=typeof e.getElementsByTagName!="undefined"?e.getElementsByTagName(t||"*"):typeof e.querySelectorAll!="undefined"?e.querySelectorAll(t||"*"):[];return t===undefined||t&&jQuery.nodeName(e,t)?jQuery.merge([e],n):n}function setGlobalEval(e,t){var n=0,r=e.length;for(;n-1){i&&i.push(s);continue}f=jQuery.contains(s.ownerDocument,s),o=getAll(c.appendChild(s),"script"),f&&setGlobalEval(o);if(n){l=0;while(s=o[l++])rscriptType.test(s.type||"")&&n.push(s)}}return c}function returnTrue(){return!0}function returnFalse(){return!1}function safeActiveElement(){try{return document.activeElement}catch(e){}}function on(e,t,n,r,i,s){var o,u;if(typeof t=="object"){typeof n!="string"&&(r=r||n,n=undefined);for(u in t)on(e,u,n,r,t[u],s);return e}r==null&&i==null?(i=n,r=n=undefined):i==null&&(typeof n=="string"?(i=r,r=undefined):(i=r,r=n,n=undefined));if(i===!1)i=returnFalse;else if(!i)return e;return s===1&&(o=i,i=function(e){return jQuery().off(e),o.apply(this,arguments)},i.guid=o.guid||(o.guid=jQuery.guid++)),e.each(function(){jQuery.event.add(this,t,i,r,n)})}function manipulationTarget(e,t){return jQuery.nodeName(e,"table")&&jQuery.nodeName(t.nodeType!==11?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}function disableScript(e){return e.type=(e.getAttribute("type")!==null)+"/"+e.type,e}function restoreScript(e){var t=rscriptTypeMasked.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function cloneCopyEvent(e,t){var n,r,i,s,o,u,a,f;if(t.nodeType!==1)return;if(dataPriv.hasData(e)){s=dataPriv.access(e),o=dataPriv.set(t,s),f=s.events;if(f){delete o.handle,o.events={};for(i in f)for(n=0,r=f[i].length;n1&&typeof p=="string"&&!support.checkClone&&rchecked.test(p))return e.each(function(i){var s=e.eq(i);d&&(t[0]=p.call(this,i,s.html())),domManip(s,t,n,r)});if(c){i=buildFragment(t,e[0].ownerDocument,!1,e,r),s=i.firstChild,i.childNodes.length===1&&(i=s);if(s||r){o=jQuery.map(getAll(i,"script"),disableScript),u=o.length;for(;l")).appendTo(t.documentElement),t=iframe[0].contentDocument,t.write(),t.close(),n=actualDisplay(e,t),iframe.detach();elemdisplay[e]=n}return n}function curCSS(e,t,n){var r,i,s,o,u=e.style;return n=n||getStyles(e),o=n?n.getPropertyValue(t)||n[t]:undefined,(o===""||o===undefined)&&!jQuery.contains(e.ownerDocument,e)&&(o=jQuery.style(e,t)),n&&!support.pixelMarginRight()&&rnumnonpx.test(o)&&rmargin.test(t)&&(r=u.width,i=u.minWidth,s=u.maxWidth,u.minWidth=u.maxWidth=u.width=o,o=n.width,u.width=r,u.minWidth=i,u.maxWidth=s),o!==undefined?o+"":o}function addGetHookIf(e,t){return{get:function(){if(e()){delete this.get;return}return(this.get=t).apply(this,arguments)}}}function vendorPropName(e){if(e in emptyStyle)return e;var t=e[0].toUpperCase()+e.slice(1),n=cssPrefixes.length;while(n--){e=cssPrefixes[n]+t;if(e in emptyStyle)return e}}function setPositiveNumber(e,t,n){var r=rcssNum.exec(t);return r?Math.max(0,r[2]-(n||0))+(r[3]||"px"):t}function augmentWidthOrHeight(e,t,n,r,i){var s=n===(r?"border":"content")?4:t==="width"?1:0,o=0;for(;s<4;s+=2)n==="margin"&&(o+=jQuery.css(e,n+cssExpand[s],!0,i)),r?(n==="content"&&(o-=jQuery.css(e,"padding"+cssExpand[s],!0,i)),n!=="margin"&&(o-=jQuery.css(e,"border"+cssExpand[s]+"Width",!0,i))):(o+=jQuery.css(e,"padding"+cssExpand[s],!0,i),n!=="padding"&&(o+=jQuery.css(e,"border"+cssExpand[s]+"Width",!0,i)));return o}function getWidthOrHeight(e,t,n){var r=!0,i=t==="width"?e.offsetWidth:e.offsetHeight,s=getStyles(e),o=jQuery.css(e,"boxSizing",!1,s)==="border-box";document.msFullscreenElement&&window.top!==window&&e.getClientRects().length&&(i=Math.round(e.getBoundingClientRect()[t]*100));if(i<=0||i==null){i=curCSS(e,t,s);if(i<0||i==null)i=e.style[t];if(rnumnonpx.test(i))return i;r=o&&(support.boxSizingReliable()||i===e.style[t]),i=parseFloat(i)||0}return i+augmentWidthOrHeight(e,t,n||(o?"border":"content"),r,s)+"px"}function showHide(e,t){var n,r,i,s=[],o=0,u=e.length;for(;o=0&&n=0},isPlainObject:function(e){var t;if(jQuery.type(e)!=="object"||e.nodeType||jQuery.isWindow(e))return!1;if(e.constructor&&!hasOwn.call(e,"constructor")&&!hasOwn.call(e.constructor.prototype||{},"isPrototypeOf"))return!1;for(t in e);return t===undefined||hasOwn.call(e,t)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},type:function(e){return e==null?e+"":typeof e=="object"||typeof e=="function"?class2type[toString.call(e)]||"object":typeof e},globalEval:function(code){var script,indirect=eval;code=jQuery.trim(code),code&&(code.indexOf("use strict")===1?(script=document.createElement("script"),script.text=code,document.head.appendChild(script).parentNode.removeChild(script)):indirect(code))},camelCase:function(e){return e.replace(rmsPrefix,"ms-").replace(rdashAlpha,fcamelCase)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t){var n,r=0;if(isArrayLike(e)){n=e.length;for(;rr.cacheLength&&delete t[e.shift()],t[n+" "]=i}var e=[];return t}function ut(e){return e[w]=!0,e}function at(e){var t=p.createElement("div");try{return!!e(t)}catch(n){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function ft(e,t){var n=e.split("|"),i=n.length;while(i--)r.attrHandle[n[i]]=t}function lt(e,t){var n=t&&e,r=n&&e.nodeType===1&&t.nodeType===1&&(~t.sourceIndex||L)-(~e.sourceIndex||L);if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function ct(e){return function(t){var n=t.nodeName.toLowerCase();return n==="input"&&t.type===e}}function ht(e){return function(t){var n=t.nodeName.toLowerCase();return(n==="input"||n==="button")&&t.type===e}}function pt(e){return ut(function(t){return t=+t,ut(function(n,r){var i,s=e([],n.length,t),o=s.length;while(o--)n[i=s[o]]&&(n[i]=!(r[i]=n[i]))})})}function dt(e){return e&&typeof e.getElementsByTagName!="undefined"&&e}function vt(){}function mt(e){var t=0,n=e.length,r="";for(;t1?function(t,n,r){var i=e.length;while(i--)if(!e[i](t,n,r))return!1;return!0}:e[0]}function bt(e,t,n){var r=0,i=t.length;for(;r-1&&(s[f]=!(o[f]=c))}}else g=wt(g===o?g.splice(d,g.length):g),i?i(null,o,g,a):D.apply(o,g)})}function St(e){var t,n,i,s=e.length,o=r.relative[e[0].type],u=o||r.relative[" "],a=o?1:0,l=gt(function(e){return e===t},u,!0),c=gt(function(e){return H(t,e)>-1},u,!0),h=[function(e,n,r){var i=!o&&(r||n!==f)||((t=n).nodeType?l(e,n,r):c(e,n,r));return t=null,i}];for(;a1&&yt(h),a>1&&mt(e.slice(0,a-1).concat({value:e[a-2].type===" "?"*":""})).replace(U,"$1"),n,a0,i=e.length>0,s=function(s,o,u,a,l){var c,d,m,g=0,y="0",b=s&&[],w=[],E=f,x=s||i&&r.find.TAG("*",l),T=S+=E==null?1:Math.random()||.1,N=x.length;l&&(f=o===p||o||l);for(;y!==N&&(c=x[y])!=null;y++){if(i&&c){d=0,!o&&c.ownerDocument!==p&&(h(c),u=!v);while(m=e[d++])if(m(c,o||p,u)){a.push(c);break}l&&(S=T)}n&&((c=!m&&c)&&g--,s&&b.push(c))}g+=y;if(n&&y!==g){d=0;while(m=t[d++])m(b,w,o,u);if(s){if(g>0)while(y--)!b[y]&&!w[y]&&(w[y]=M.call(a));w=wt(w)}D.apply(a,w),l&&!s&&w.length>0&&g+t.length>1&&st.uniqueSort(a)}return l&&(S=T,f=E),b};return n?ut(s):s}var t,n,r,i,s,o,u,a,f,l,c,h,p,d,v,m,g,y,b,w="sizzle"+1*new Date,E=e.document,S=0,x=0,T=ot(),N=ot(),C=ot(),k=function(e,t){return e===t&&(c=!0),0},L=1<<31,A={}.hasOwnProperty,O=[],M=O.pop,_=O.push,D=O.push,P=O.slice,H=function(e,t){var n=0,r=e.length;for(;n+~]|"+j+")"+j+"*"),X=new RegExp("="+j+"*([^\\]'\"]*?)"+j+"*\\]","g"),V=new RegExp(q),$=new RegExp("^"+F+"$"),J={ID:new RegExp("^#("+F+")"),CLASS:new RegExp("^\\.("+F+")"),TAG:new RegExp("^("+F+"|[*])"),ATTR:new RegExp("^"+I),PSEUDO:new RegExp("^"+q),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+j+"*(even|odd|(([+-]|)(\\d*)n|)"+j+"*(?:([+-]|)"+j+"*(\\d+)|))"+j+"*\\)|)","i"),bool:new RegExp("^(?:"+B+")$","i"),needsContext:new RegExp("^"+j+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+j+"*((?:-\\d)?\\d*)"+j+"*\\)|)(?=[^-]|$)","i")},K=/^(?:input|select|textarea|button)$/i,Q=/^h\d$/i,G=/^[^{]+\{\s*\[native \w/,Y=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,Z=/[+~]/,et=/'|\\/g,tt=new RegExp("\\\\([\\da-f]{1,6}"+j+"?|("+j+")|.)","ig"),nt=function(e,t,n){var r="0x"+t-65536;return r!==r||n?t:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,r&1023|56320)},rt=function(){h()};try{D.apply(O=P.call(E.childNodes),E.childNodes),O[E.childNodes.length].nodeType}catch(it){D={apply:O.length?function(e,t){_.apply(e,P.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}n=st.support={},s=st.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?t.nodeName!=="HTML":!1},h=st.setDocument=function(e){var t,i,o=e?e.ownerDocument||e:E;if(o===p||o.nodeType!==9||!o.documentElement)return p;p=o,d=p.documentElement,v=!s(p),(i=p.defaultView)&&i.top!==i&&(i.addEventListener?i.addEventListener("unload",rt,!1):i.attachEvent&&i.attachEvent("onunload",rt)),n.attributes=at(function(e){return e.className="i",!e.getAttribute("className")}),n.getElementsByTagName=at(function(e){return e.appendChild(p.createComment("")),!e.getElementsByTagName("*").length}),n.getElementsByClassName=G.test(p.getElementsByClassName),n.getById=at(function(e){return d.appendChild(e).id=w,!p.getElementsByName||!p.getElementsByName(w).length}),n.getById?(r.find.ID=function(e,t){if(typeof t.getElementById!="undefined"&&v){var n=t.getElementById(e);return n?[n]:[]}},r.filter.ID=function(e){var t=e.replace(tt,nt);return function(e){return e.getAttribute("id")===t}}):(delete r.find.ID,r.filter.ID=function(e){var t=e.replace(tt,nt);return function(e){var n=typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id");return n&&n.value===t}}),r.find.TAG=n.getElementsByTagName?function(e,t){if(typeof t.getElementsByTagName!="undefined")return t.getElementsByTagName(e);if(n.qsa)return t.querySelectorAll(e)}:function(e,t){var n,r=[],i=0,s=t.getElementsByTagName(e);if(e==="*"){while(n=s[i++])n.nodeType===1&&r.push(n);return r}return s},r.find.CLASS=n.getElementsByClassName&&function(e,t){if(typeof t.getElementsByClassName!="undefined"&&v)return t.getElementsByClassName(e)},g=[],m=[];if(n.qsa=G.test(p.querySelectorAll))at(function(e){d.appendChild(e).innerHTML=""+"",e.querySelectorAll("[msallowcapture^='']").length&&m.push("[*^$]="+j+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||m.push("\\["+j+"*(?:value|"+B+")"),e.querySelectorAll("[id~="+w+"-]").length||m.push("~="),e.querySelectorAll(":checked").length||m.push(":checked"),e.querySelectorAll("a#"+w+"+*").length||m.push(".#.+[+~]")}),at(function(e){var t=p.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&m.push("name"+j+"*[*^$|!~]?="),e.querySelectorAll(":enabled").length||m.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),m.push(",.*:")});return(n.matchesSelector=G.test(y=d.matches||d.webkitMatchesSelector||d.mozMatchesSelector||d.oMatchesSelector||d.msMatchesSelector))&&at(function(e){n.disconnectedMatch=y.call(e,"div"),y.call(e,"[s!='']:x"),g.push("!=",q)}),m=m.length&&new RegExp(m.join("|")),g=g.length&&new RegExp(g.join("|")),t=G.test(d.compareDocumentPosition),b=t||G.test(d.contains)?function(e,t){var n=e.nodeType===9?e.documentElement:e,r=t&&t.parentNode;return e===r||!!r&&r.nodeType===1&&!!(n.contains?n.contains(r):e.compareDocumentPosition&&e.compareDocumentPosition(r)&16)}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},k=t?function(e,t){if(e===t)return c=!0,0;var r=!e.compareDocumentPosition-!t.compareDocumentPosition;return r?r:(r=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1,r&1||!n.sortDetached&&t.compareDocumentPosition(e)===r?e===p||e.ownerDocument===E&&b(E,e)?-1:t===p||t.ownerDocument===E&&b(E,t)?1:l?H(l,e)-H(l,t):0:r&4?-1:1)}:function(e,t){if(e===t)return c=!0,0;var n,r=0,i=e.parentNode,s=t.parentNode,o=[e],u=[t];if(!i||!s)return e===p?-1:t===p?1:i?-1:s?1:l?H(l,e)-H(l,t):0;if(i===s)return lt(e,t);n=e;while(n=n.parentNode)o.unshift(n);n=t;while(n=n.parentNode)u.unshift(n);while(o[r]===u[r])r++;return r?lt(o[r],u[r]):o[r]===E?-1:u[r]===E?1:0},p},st.matches=function(e,t){return st(e,null,null,t)},st.matchesSelector=function(e,t){(e.ownerDocument||e)!==p&&h(e),t=t.replace(X,"='$1']");if(n.matchesSelector&&v&&!C[t+" "]&&(!g||!g.test(t))&&(!m||!m.test(t)))try{var r=y.call(e,t);if(r||n.disconnectedMatch||e.document&&e.document.nodeType!==11)return r}catch(i){}return st(t,p,null,[e]).length>0},st.contains=function(e,t){return(e.ownerDocument||e)!==p&&h(e),b(e,t)},st.attr=function(e,t){(e.ownerDocument||e)!==p&&h(e);var i=r.attrHandle[t.toLowerCase()],s=i&&A.call(r.attrHandle,t.toLowerCase())?i(e,t,!v):undefined;return s!==undefined?s:n.attributes||!v?e.getAttribute(t):(s=e.getAttributeNode(t))&&s.specified?s.value:null},st.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},st.uniqueSort=function(e){var t,r=[],i=0,s=0;c=!n.detectDuplicates,l=!n.sortStable&&e.slice(0),e.sort(k);if(c){while(t=e[s++])t===e[s]&&(i=r.push(s));while(i--)e.splice(r[i],1)}return l=null,e},i=st.getText=function(e){var t,n="",r=0,s=e.nodeType;if(!s)while(t=e[r++])n+=i(t);else if(s===1||s===9||s===11){if(typeof e.textContent=="string")return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=i(e)}else if(s===3||s===4)return e.nodeValue;return n},r=st.selectors={cacheLength:50,createPseudo:ut,match:J,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(tt,nt),e[3]=(e[3]||e[4]||e[5]||"").replace(tt,nt),e[2]==="~="&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),e[1].slice(0,3)==="nth"?(e[3]||st.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*(e[3]==="even"||e[3]==="odd")),e[5]=+(e[7]+e[8]||e[3]==="odd")):e[3]&&st.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return J.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&V.test(n)&&(t=o(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(tt,nt).toLowerCase();return e==="*"?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=T[e+" "];return t||(t=new RegExp("(^|"+j+")"+e+"("+j+"|$)"))&&T(e,function(e){return t.test(typeof e.className=="string"&&e.className||typeof e.getAttribute!="undefined"&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var i=st.attr(r,e);return i==null?t==="!=":t?(i+="",t==="="?i===n:t==="!="?i!==n:t==="^="?n&&i.indexOf(n)===0:t==="*="?n&&i.indexOf(n)>-1:t==="$="?n&&i.slice(-n.length)===n:t==="~="?(" "+i.replace(R," ")+" ").indexOf(n)>-1:t==="|="?i===n||i.slice(0,n.length+1)===n+"-":!1):!0}},CHILD:function(e,t,n,r,i){var s=e.slice(0,3)!=="nth",o=e.slice(-4)!=="last",u=t==="of-type";return r===1&&i===0?function(e){return!!e.parentNode}:function(t,n,a){var f,l,c,h,p,d,v=s!==o?"nextSibling":"previousSibling",m=t.parentNode,g=u&&t.nodeName.toLowerCase(),y=!a&&!u,b=!1;if(m){if(s){while(v){h=t;while(h=h[v])if(u?h.nodeName.toLowerCase()===g:h.nodeType===1)return!1;d=v=e==="only"&&!d&&"nextSibling"}return!0}d=[o?m.firstChild:m.lastChild];if(o&&y){h=m,c=h[w]||(h[w]={}),l=c[h.uniqueID]||(c[h.uniqueID]={}),f=l[e]||[],p=f[0]===S&&f[1],b=p&&f[2],h=p&&m.childNodes[p];while(h=++p&&h&&h[v]||(b=p=0)||d.pop())if(h.nodeType===1&&++b&&h===t){l[e]=[S,p,b];break}}else{y&&(h=t,c=h[w]||(h[w]={}),l=c[h.uniqueID]||(c[h.uniqueID]={}),f=l[e]||[],p=f[0]===S&&f[1],b=p);if(b===!1)while(h=++p&&h&&h[v]||(b=p=0)||d.pop())if((u?h.nodeName.toLowerCase()===g:h.nodeType===1)&&++b){y&&(c=h[w]||(h[w]={}),l=c[h.uniqueID]||(c[h.uniqueID]={}),l[e]=[S,b]);if(h===t)break}}return b-=i,b===r||b%r===0&&b/r>=0}}},PSEUDO:function(e,t){var n,i=r.pseudos[e]||r.setFilters[e.toLowerCase()]||st.error("unsupported pseudo: "+e);return i[w]?i(t):i.length>1?(n=[e,e,"",t],r.setFilters.hasOwnProperty(e.toLowerCase())?ut(function(e,n){var r,s=i(e,t),o=s.length;while(o--)r=H(e,s[o]),e[r]=!(n[r]=s[o])}):function(e){return i(e,0,n)}):i}},pseudos:{not:ut(function(e){var t=[],n=[],r=u(e.replace(U,"$1"));return r[w]?ut(function(e,t,n,i){var s,o=r(e,null,i,[]),u=e.length;while(u--)if(s=o[u])e[u]=!(t[u]=s)}):function(e,i,s){return t[0]=e,r(t,null,s,n),t[0]=null,!n.pop()}}),has:ut(function(e){return function(t){return st(e,t).length>0}}),contains:ut(function(e){return e=e.replace(tt,nt),function(t){return(t.textContent||t.innerText||i(t)).indexOf(e)>-1}}),lang:ut(function(e){return $.test(e||"")||st.error("unsupported lang: "+e),e=e.replace(tt,nt).toLowerCase(),function(t){var n;do if(n=v?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return n=n.toLowerCase(),n===e||n.indexOf(e+"-")===0;while((t=t.parentNode)&&t.nodeType===1);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===d},focus:function(e){return e===p.activeElement&&(!p.hasFocus||p.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return t==="input"&&!!e.checked||t==="option"&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!r.pseudos.empty(e)},header:function(e){return Q.test(e.nodeName)},input:function(e){return K.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return t==="input"&&e.type==="button"||t==="button"},text:function(e){var t;return e.nodeName.toLowerCase()==="input"&&e.type==="text"&&((t=e.getAttribute("type"))==null||t.toLowerCase()==="text")},first:pt(function(){return[0]}),last:pt(function(e,t){return[t-1]}),eq:pt(function(e,t,n){return[n<0?n+t:n]}),even:pt(function(e,t){var n=0;for(;n=0;)e.push(r);return e}),gt:pt(function(e,t,n){var r=n<0?n+t:n;for(;++r2&&(l=f[0]).type==="ID"&&n.getById&&t.nodeType===9&&v&&r.relative[f[1].type]){t=(r.find.ID(l.matches[0].replace(tt,nt),t)||[])[0];if(!t)return i;p&&(t=t.parentNode),e=e.slice(f.shift().value.length)}a=J.needsContext.test(e)?0:f.length;while(a--){l=f[a];if(r.relative[c=l.type])break;if(h=r.find[c])if(s=h(l.matches[0].replace(tt,nt),Z.test(f[0].type)&&dt(t.parentNode)||t)){f.splice(a,1),e=s.length&&mt(f);if(!e)return D.apply(i,s),i;break}}}return(p||u(e,d))(s,t,!v,i,!t||Z.test(e)&&dt(t.parentNode)||t),i},n.sortStable=w.split("").sort(k).join("")===w,n.detectDuplicates=!!c,h(),n.sortDetached=at(function(e){return e.compareDocumentPosition(p.createElement("div"))&1}),at(function(e){return e.innerHTML="",e.firstChild.getAttribute("href")==="#"})||ft("type|href|height|width",function(e,t,n){if(!n)return e.getAttribute(t,t.toLowerCase()==="type"?1:2)}),(!n.attributes||!at(function(e){return e.innerHTML="",e.firstChild.setAttribute("value",""),e.firstChild.getAttribute("value")===""}))&&ft("value",function(e,t,n){if(!n&&e.nodeName.toLowerCase()==="input")return e.defaultValue}),at(function(e){return e.getAttribute("disabled")==null})||ft(B,function(e,t,n){var r;if(!n)return e[t]===!0?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null}),st}(window);jQuery.find=Sizzle,jQuery.expr=Sizzle.selectors,jQuery.expr[":"]=jQuery.expr.pseudos,jQuery.uniqueSort=jQuery.unique=Sizzle.uniqueSort,jQuery.text=Sizzle.getText,jQuery.isXMLDoc=Sizzle.isXML,jQuery.contains=Sizzle.contains;var dir=function(e,t,n){var r=[],i=n!==undefined;while((e=e[t])&&e.nodeType!==9)if(e.nodeType===1){if(i&&jQuery(e).is(n))break;r.push(e)}return r},siblings=function(e,t){var n=[];for(;e;e=e.nextSibling)e.nodeType===1&&e!==t&&n.push(e);return n},rneedsContext=jQuery.expr.match.needsContext,rsingleTag=/^<([\w-]+)\s*\/?>(?:<\/\1>|)$/,risSimple=/^.[^:#\[\.,]*$/;jQuery.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),t.length===1&&r.nodeType===1?jQuery.find.matchesSelector(r,e)?[r]:[]:jQuery.find.matches(e,jQuery.grep(t,function(e){return e.nodeType===1}))},jQuery.fn.extend({find:function(e){var t,n=this.length,r=[],i=this;if(typeof e!="string")return this.pushStack(jQuery(e).filter(function(){for(t=0;t1?jQuery.unique(r):r),r.selector=this.selector?this.selector+" "+e:e,r},filter:function(e){return this.pushStack(winnow(this,e||[],!1))},not:function(e){return this.pushStack(winnow(this,e||[],!0))},is:function(e){return!!winnow(this,typeof e=="string"&&rneedsContext.test(e)?jQuery(e):e||[],!1).length}});var rootjQuery,rquickExpr=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,init=jQuery.fn.init=function(e,t,n){var r,i;if(!e)return this;n=n||rootjQuery;if(typeof e=="string"){e[0]==="<"&&e[e.length-1]===">"&&e.length>=3?r=[null,e,null]:r=rquickExpr.exec(e);if(r&&(r[1]||!t)){if(r[1]){t=t instanceof jQuery?t[0]:t,jQuery.merge(this,jQuery.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:document,!0));if(rsingleTag.test(r[1])&&jQuery.isPlainObject(t))for(r in t)jQuery.isFunction(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return i=document.getElementById(r[2]),i&&i.parentNode&&(this.length=1,this[0]=i),this.context=document,this.selector=e,this}return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e)}return e.nodeType?(this.context=this[0]=e,this.length=1,this):jQuery.isFunction(e)?n.ready!==undefined?n.ready(e):e(jQuery):(e.selector!==undefined&&(this.selector=e.selector,this.context=e.context),jQuery.makeArray(e,this))};init.prototype=jQuery.fn,rootjQuery=jQuery(document);var rparentsprev=/^(?:parents|prev(?:Until|All))/,guaranteedUnique={children:!0,contents:!0,next:!0,prev:!0};jQuery.fn.extend({has:function(e){var t=jQuery(e,this),n=t.length;return this.filter(function(){var e=0;for(;e-1:n.nodeType===1&&jQuery.find.matchesSelector(n,e))){s.push(n);break}return this.pushStack(s.length>1?jQuery.uniqueSort(s):s)},index:function(e){return e?typeof e=="string"?indexOf.call(jQuery(e),this[0]):indexOf.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(jQuery.uniqueSort(jQuery.merge(this.get(),jQuery(e,t))))},addBack:function(e){return this.add(e==null?this.prevObject:this.prevObject.filter(e))}}),jQuery.each({parent:function(e){var t=e.parentNode;return t&&t.nodeType!==11?t:null},parents:function(e){return dir(e,"parentNode")},parentsUntil:function(e,t,n){return dir(e,"parentNode",n)},next:function(e){return sibling(e,"nextSibling")},prev:function(e){return sibling(e,"previousSibling")},nextAll:function(e){return dir(e,"nextSibling")},prevAll:function(e){return dir(e,"previousSibling")},nextUntil:function(e,t,n){return dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return dir(e,"previousSibling",n)},siblings:function(e){return siblings((e.parentNode||{}).firstChild,e)},children:function(e){return siblings(e.firstChild)},contents:function(e){return e.contentDocument||jQuery.merge([],e.childNodes)}},function(e,t){jQuery.fn[e]=function(n,r){var i=jQuery.map(this,t,n);return e.slice(-5)!=="Until"&&(r=n),r&&typeof r=="string"&&(i=jQuery.filter(r,i)),this.length>1&&(guaranteedUnique[e]||jQuery.uniqueSort(i),rparentsprev.test(e)&&i.reverse()),this.pushStack(i)}});var rnotwhite=/\S+/g;jQuery.Callbacks=function(e){e=typeof e=="string"?createOptions(e):jQuery.extend({},e);var t,n,r,i,s=[],o=[],u=-1,a=function(){i=e.once,r=t=!0;for(;o.length;u=-1){n=o.shift();while(++u-1)s.splice(n,1),n<=u&&u--}),this},has:function(e){return e?jQuery.inArray(e,s)>-1:s.length>0},empty:function(){return s&&(s=[]),this},disable:function(){return i=o=[],s=n="",this},disabled:function(){return!s},lock:function(){return i=o=[],n||(s=n=""),this},locked:function(){return!!i},fireWith:function(e,n){return i||(n=n||[],n=[e,n.slice?n.slice():n],o.push(n),t||a()),this},fire:function(){return f.fireWith(this,arguments),this},fired:function(){return!!r}};return f},jQuery.extend({Deferred:function(e){var t=[["resolve","done",jQuery.Callbacks("once memory"),"resolved"],["reject","fail",jQuery.Callbacks("once memory"),"rejected"],["notify","progress",jQuery.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return jQuery.Deferred(function(n){jQuery.each(t,function(t,s){var o=jQuery.isFunction(e[t])&&e[t];i[s[1]](function(){var e=o&&o.apply(this,arguments);e&&jQuery.isFunction(e.promise)?e.promise().progress(n.notify).done(n.resolve).fail(n.reject):n[s[0]+"With"](this===r?n.promise():this,o?[e]:arguments)})}),e=null}).promise()},promise:function(e){return e!=null?jQuery.extend(e,r):r}},i={};return r.pipe=r.then,jQuery.each(t,function(e,s){var o=s[2],u=s[3];r[s[1]]=o.add,u&&o.add(function(){n=u},t[e^1][2].disable,t[2][2].lock),i[s[0]]=function(){return i[s[0]+"With"](this===i?r:this,arguments),this},i[s[0]+"With"]=o.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t=0,n=slice.call(arguments),r=n.length,i=r!==1||e&&jQuery.isFunction(e.promise)?r:0,s=i===1?e:jQuery.Deferred(),o=function(e,t,n){return function(r){t[e]=this,n[e]=arguments.length>1?slice.call(arguments):r,n===u?s.notifyWith(t,n):--i||s.resolveWith(t,n)}},u,a,f;if(r>1){u=new Array(r),a=new Array(r),f=new Array(r);for(;t0)return;readyList.resolveWith(document,[jQuery]),jQuery.fn.triggerHandler&&(jQuery(document).triggerHandler("ready"),jQuery(document).off("ready"))}}),jQuery.ready.promise=function(e){return readyList||(readyList=jQuery.Deferred(),document.readyState==="complete"||document.readyState!=="loading"&&!document.documentElement.doScroll?window.setTimeout(jQuery.ready):(document.addEventListener("DOMContentLoaded",completed),window.addEventListener("load",completed))),readyList.promise(e)},jQuery.ready.promise();var access=function(e,t,n,r,i,s,o){var u=0,a=e.length,f=n==null;if(jQuery.type(n)==="object"){i=!0;for(u in n)access(e,t,u,n[u],!0,s,o)}else if(r!==undefined){i=!0,jQuery.isFunction(r)||(o=!0),f&&(o?(t.call(e,r),t=null):(f=t,t=function(e,t,n){return f.call(jQuery(e),n)}));if(t)for(;u-1&&n!==undefined&&dataUser.set(this,e,t)})},null,t,arguments.length>1,null,!0)},removeData:function(e){return this.each(function(){dataUser.remove(this,e)})}}),jQuery.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=dataPriv.get(e,t),n&&(!r||jQuery.isArray(n)?r=dataPriv.access(e,t,jQuery.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=jQuery.queue(e,t),r=n.length,i=n.shift(),s=jQuery._queueHooks(e,t),o=function(){jQuery.dequeue(e,t)};i==="inprogress"&&(i=n.shift(),r--),i&&(t==="fx"&&n.unshift("inprogress"),delete s.stop,i.call(e,o,s)),!r&&s&&s.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return dataPriv.get(e,n)||dataPriv.access(e,n,{empty:jQuery.Callbacks("once memory").add(function(){dataPriv.remove(e,[t+"queue",n])})})}}),jQuery.fn.extend({queue:function(e,t){var n=2;return typeof e!="string"&&(t=e,e="fx",n--),arguments.length",""],thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};wrapMap.optgroup=wrapMap.option,wrapMap.tbody=wrapMap.tfoot=wrapMap.colgroup=wrapMap.caption=wrapMap.thead,wrapMap.th=wrapMap.td;var rhtml=/<|&#?\w+;/;(function(){var e=document.createDocumentFragment(),t=e.appendChild(document.createElement("div")),n=document.createElement("input");n.setAttribute("type","radio"),n.setAttribute("checked","checked"),n.setAttribute("name","t"),t.appendChild(n),support.checkClone=t.cloneNode(!0).cloneNode(!0).lastChild.checked,t.innerHTML="",support.noCloneChecked=!!t.cloneNode(!0).lastChild.defaultValue})();var rkeyEvent=/^key/,rmouseEvent=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,rtypenamespace=/^([^.]*)(?:\.(.+)|)/;jQuery.event={global:{},add:function(e,t,n,r,i){var s,o,u,a,f,l,c,h,p,d,v,m=dataPriv.get(e);if(!m)return;n.handler&&(s=n,n=s.handler,i=s.selector),n.guid||(n.guid=jQuery.guid++),(a=m.events)||(a=m.events={}),(o=m.handle)||(o=m.handle=function(t){return typeof jQuery!="undefined"&&jQuery.event.triggered!==t.type?jQuery.event.dispatch.apply(e,arguments):undefined}),t=(t||"").match(rnotwhite)||[""],f=t.length;while(f--){u=rtypenamespace.exec(t[f])||[],p=v=u[1],d=(u[2]||"").split(".").sort();if(!p)continue;c=jQuery.event.special[p]||{},p=(i?c.delegateType:c.bindType)||p,c=jQuery.event.special[p]||{},l=jQuery.extend({type:p,origType:v,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&jQuery.expr.match.needsContext.test(i),namespace:d.join(".")},s),(h=a[p])||(h=a[p]=[],h.delegateCount=0,(!c.setup||c.setup.call(e,r,d,o)===!1)&&e.addEventListener&&e.addEventListener(p,o)),c.add&&(c.add.call(e,l),l.handler.guid||(l.handler.guid=n.guid)),i?h.splice(h.delegateCount++,0,l):h.push(l),jQuery.event.global[p]=!0}},remove:function(e,t,n,r,i){var s,o,u,a,f,l,c,h,p,d,v,m=dataPriv.hasData(e)&&dataPriv.get(e);if(!m||!(a=m.events))return;t=(t||"").match(rnotwhite)||[""],f=t.length;while(f--){u=rtypenamespace.exec(t[f])||[],p=v=u[1],d=(u[2]||"").split(".").sort();if(!p){for(p in a)jQuery.event.remove(e,p+t[f],n,r,!0);continue}c=jQuery.event.special[p]||{},p=(r?c.delegateType:c.bindType)||p,h=a[p]||[],u=u[2]&&new RegExp("(^|\\.)"+d.join("\\.(?:.*\\.|)")+"(\\.|$)"),o=s=h.length;while(s--)l=h[s],(i||v===l.origType)&&(!n||n.guid===l.guid)&&(!u||u.test(l.namespace))&&(!r||r===l.selector||r==="**"&&l.selector)&&(h.splice(s,1),l.selector&&h.delegateCount--,c.remove&&c.remove.call(e,l));o&&!h.length&&((!c.teardown||c.teardown.call(e,d,m.handle)===!1)&&jQuery.removeEvent(e,p,m.handle),delete a[p])}jQuery.isEmptyObject(a)&&dataPriv.remove(e,"handle events")},dispatch:function(e){e=jQuery.event.fix(e);var t,n,r,i,s,o=[],u=slice.call(arguments),a=(dataPriv.get(this,"events")||{})[e.type]||[],f=jQuery.event.special[e.type]||{};u[0]=e,e.delegateTarget=this;if(f.preDispatch&&f.preDispatch.call(this,e)===!1)return;o=jQuery.event.handlers.call(this,e,a),t=0;while((i=o[t++])&&!e.isPropagationStopped()){e.currentTarget=i.elem,n=0;while((s=i.handlers[n++])&&!e.isImmediatePropagationStopped())if(!e.rnamespace||e.rnamespace.test(s.namespace))e.handleObj=s,e.data=s.data,r=((jQuery.event.special[s.origType]||{}).handle||s.handler).apply(i.elem,u),r!==undefined&&(e.result=r)===!1&&(e.preventDefault(),e.stopPropagation())}return f.postDispatch&&f.postDispatch.call(this,e),e.result},handlers:function(e,t){var n,r,i,s,o=[],u=t.delegateCount,a=e.target;if(u&&a.nodeType&&(e.type!=="click"||isNaN(e.button)||e.button<1))for(;a!==this;a=a.parentNode||this)if(a.nodeType===1&&(a.disabled!==!0||e.type!=="click")){r=[];for(n=0;n-1:jQuery.find(i,this,null,[a]).length),r[i]&&r.push(s);r.length&&o.push({elem:a,handlers:r})}return u]*)\/>/gi,rnoInnerhtml=/\s*$/g;jQuery.extend({htmlPrefilter:function(e){return e.replace(rxhtmlTag,"<$1>")},clone:function(e,t,n){var r,i,s,o,u=e.cloneNode(!0),a=jQuery.contains(e.ownerDocument,e);if(!support.noCloneChecked&&(e.nodeType===1||e.nodeType===11)&&!jQuery.isXMLDoc(e)){o=getAll(u),s=getAll(e);for(r=0,i=s.length;r0&&setGlobalEval(o,!a&&getAll(e,"script")),u},cleanData:function(e){var t,n,r,i=jQuery.event.special,s=0;for(;(n=e[s])!==undefined;s++)if(acceptData(n)){if(t=n[dataPriv.expando]){if(t.events)for(r in t.events)i[r]?jQuery.event.remove(n,r):jQuery.removeEvent(n,r,t.handle);n[dataPriv.expando]=undefined}n[dataUser.expando]&&(n[dataUser.expando]=undefined)}}}),jQuery.fn.extend({domManip:domManip,detach:function(e){return remove(this,e,!0)},remove:function(e){return remove(this,e)},text:function(e){return access(this,function(e){return e===undefined?jQuery.text(this):this.empty().each(function(){if(this.nodeType===1||this.nodeType===11||this.nodeType===9)this.textContent=e})},null,e,arguments.length)},append:function(){return domManip(this,arguments,function(e){if(this.nodeType===1||this.nodeType===11||this.nodeType===9){var t=manipulationTarget(this,e);t.appendChild(e)}})},prepend:function(){return domManip(this,arguments,function(e){if(this.nodeType===1||this.nodeType===11||this.nodeType===9){var t=manipulationTarget(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return domManip(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return domManip(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},empty:function(){var e,t=0;for(;(e=this[t])!=null;t++)e.nodeType===1&&(jQuery.cleanData(getAll(e,!1)),e.textContent="");return this},clone:function(e,t){return e=e==null?!1:e,t=t==null?e:t,this.map(function(){return jQuery.clone(this,e,t)})},html:function(e){return access(this,function(e){var t=this[0]||{},n=0,r=this.length;if(e===undefined&&t.nodeType===1)return t.innerHTML;if(typeof e=="string"&&!rnoInnerhtml.test(e)&&!wrapMap[(rtagName.exec(e)||["",""])[1].toLowerCase()]){e=jQuery.htmlPrefilter(e);try{for(;n1)},show:function(){return showHide(this,!0)},hide:function(){return showHide(this)},toggle:function(e){return typeof e=="boolean"?e?this.show():this.hide():this.each(function(){isHidden(this)?jQuery(this).show():jQuery(this).hide()})}}),jQuery.Tween=Tween,Tween.prototype={constructor:Tween,init:function(e,t,n,r,i,s){this.elem=e,this.prop=n,this.easing=i||jQuery.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=s||(jQuery.cssNumber[n]?"":"px")},cur:function(){var e=Tween.propHooks[this.prop];return e&&e.get?e.get(this):Tween.propHooks._default.get(this)},run:function(e){var t,n=Tween.propHooks[this.prop];return this.options.duration?this.pos=t=jQuery.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):Tween.propHooks._default.set(this),this}},Tween.prototype.init.prototype=Tween.prototype,Tween.propHooks={_default:{get:function(e){var t;return e.elem.nodeType!==1||e.elem[e.prop]!=null&&e.elem.style[e.prop]==null?e.elem[e.prop]:(t=jQuery.css(e.elem,e.prop,""),!t||t==="auto"?0:t)},set:function(e){jQuery.fx.step[e.prop]?jQuery.fx.step[e.prop](e):e.elem.nodeType!==1||e.elem.style[jQuery.cssProps[e.prop]]==null&&!jQuery.cssHooks[e.prop]?e.elem[e.prop]=e.now:jQuery.style(e.elem,e.prop,e.now+e.unit)}}},Tween.propHooks.scrollTop=Tween.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},jQuery.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},jQuery.fx=Tween.prototype.init,jQuery.fx.step={};var fxNow,timerId,rfxtypes=/^(?:toggle|show|hide)$/,rrun=/queueHooks$/;jQuery.Animation=jQuery.extend(Animation,{tweeners:{"*":[function(e,t){var n=this.createTween(e,t);return adjustCSS(n.elem,e,rcssNum.exec(t),n),n}]},tweener:function(e,t){jQuery.isFunction(e)?(t=e,e=["*"]):e=e.match(rnotwhite);var n,r=0,i=e.length;for(;r1)},removeAttr:function(e){return this.each(function(){jQuery.removeAttr(this,e)})}}),jQuery.extend({attr:function(e,t,n){var r,i,s=e.nodeType;if(s===3||s===8||s===2)return;if(typeof e.getAttribute=="undefined")return jQuery.prop(e,t,n);if(s!==1||!jQuery.isXMLDoc(e))t=t.toLowerCase(),i=jQuery.attrHooks[t]||(jQuery.expr.match.bool.test(t)?boolHook:undefined);if(n!==undefined){if(n===null){jQuery.removeAttr(e,t);return}return i&&"set"in i&&(r=i.set(e,n,t))!==undefined?r:(e.setAttribute(t,n+""),n)}return i&&"get"in i&&(r=i.get(e,t))!==null?r:(r=jQuery.find.attr(e,t),r==null?undefined:r)},attrHooks:{type:{set:function(e,t){if(!support.radioValue&&t==="radio"&&jQuery.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,r,i=0,s=t&&t.match(rnotwhite);if(s&&e.nodeType===1)while(n=s[i++])r=jQuery.propFix[n]||n,jQuery.expr.match.bool.test(n)&&(e[r]=!1),e.removeAttribute(n)}}),boolHook={set:function(e,t,n){return t===!1?jQuery.removeAttr(e,n):e.setAttribute(n,n),n}},jQuery.each(jQuery.expr.match.bool.source.match(/\w+/g),function(e,t){var n=attrHandle[t]||jQuery.find.attr;attrHandle[t]=function(e,t,r){var i,s;return r||(s=attrHandle[t],attrHandle[t]=i,i=n(e,t,r)!=null?t.toLowerCase():null,attrHandle[t]=s),i}});var rfocusable=/^(?:input|select|textarea|button)$/i,rclickable=/^(?:a|area)$/i;jQuery.fn.extend({prop:function(e,t){return access(this,jQuery.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each(function(){delete this[jQuery.propFix[e]||e]})}}),jQuery.extend({prop:function(e,t,n){var r,i,s=e.nodeType;if(s===3||s===8||s===2)return;if(s!==1||!jQuery.isXMLDoc(e))t=jQuery.propFix[t]||t,i=jQuery.propHooks[t];return n!==undefined?i&&"set"in i&&(r=i.set(e,n,t))!==undefined?r:e[t]=n:i&&"get"in i&&(r=i.get(e,t))!==null?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=jQuery.find.attr(e,"tabindex");return t?parseInt(t,10):rfocusable.test(e.nodeName)||rclickable.test(e.nodeName)&&e.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),support.optSelected||(jQuery.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),jQuery.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){jQuery.propFix[this.toLowerCase()]=this});var rclass=/[\t\r\n\f]/g;jQuery.fn.extend({addClass:function(e){var t,n,r,i,s,o,u,a=0;if(jQuery.isFunction(e))return this.each(function(t){jQuery(this).addClass(e.call(this,t,getClass(this)))});if(typeof e=="string"&&e){t=e.match(rnotwhite)||[];while(n=this[a++]){i=getClass(n),r=n.nodeType===1&&(" "+i+" ").replace(rclass," ");if(r){o=0;while(s=t[o++])r.indexOf(" "+s+" ")<0&&(r+=s+" ");u=jQuery.trim(r),i!==u&&n.setAttribute("class",u)}}}return this},removeClass:function(e){var t,n,r,i,s,o,u,a=0;if(jQuery.isFunction(e))return this.each(function(t){jQuery(this).removeClass(e.call(this,t,getClass(this)))});if(!arguments.length)return this.attr("class","");if(typeof e=="string"&&e){t=e.match(rnotwhite)||[];while(n=this[a++]){i=getClass(n),r=n.nodeType===1&&(" "+i+" ").replace(rclass," ");if(r){o=0;while(s=t[o++])while(r.indexOf(" "+s+" ")>-1)r=r.replace(" "+s+" "," ");u=jQuery.trim(r),i!==u&&n.setAttribute("class",u)}}}return this},toggleClass:function(e,t){var n=typeof e;return typeof t=="boolean"&&n==="string"?t?this.addClass(e):this.removeClass(e):jQuery.isFunction(e)?this.each(function(n){jQuery(this).toggleClass(e.call(this,n,getClass(this),t),t)}):this.each(function(){var t,r,i,s;if(n==="string"){r=0,i=jQuery(this),s=e.match(rnotwhite)||[];while(t=s[r++])i.hasClass(t)?i.removeClass(t):i.addClass(t)}else if(e===undefined||n==="boolean")t=getClass(this),t&&dataPriv.set(this,"__className__",t),this.setAttribute&&this.setAttribute("class",t||e===!1?"":dataPriv.get(this,"__className__")||"")})},hasClass:function(e){var t,n,r=0;t=" "+e+" ";while(n=this[r++])if(n.nodeType===1&&(" "+getClass(n)+" ").replace(rclass," ").indexOf(t)>-1)return!0;return!1}});var rreturn=/\r/g,rspaces=/[\x20\t\r\n\f]+/g;jQuery.fn.extend({val:function(e){var t,n,r,i=this[0];if(!arguments.length){if(i)return t=jQuery.valHooks[i.type]||jQuery.valHooks[i.nodeName.toLowerCase()],t&&"get"in t&&(n=t.get(i,"value"))!==undefined?n:(n=i.value,typeof n=="string"?n.replace(rreturn,""):n==null?"":n);return}return r=jQuery.isFunction(e),this.each(function(n){var i;if(this.nodeType!==1)return;r?i=e.call(this,n,jQuery(this).val()):i=e,i==null?i="":typeof i=="number"?i+="":jQuery.isArray(i)&&(i=jQuery.map(i,function(e){return e==null?"":e+""})),t=jQuery.valHooks[this.type]||jQuery.valHooks[this.nodeName.toLowerCase()];if(!t||!("set"in t)||t.set(this,i,"value")===undefined)this.value=i})}}),jQuery.extend({valHooks:{option:{get:function(e){var t=jQuery.find.attr(e,"value");return t!=null?t:jQuery.trim(jQuery.text(e)).replace(rspaces," ")}},select:{get:function(e){var t,n,r=e.options,i=e.selectedIndex,s=e.type==="select-one"||i<0,o=s?null:[],u=s?i+1:r.length,a=i<0?u:s?i:0;for(;a-1)n=!0}return n||(e.selectedIndex=-1),s}}}}),jQuery.each(["radio","checkbox"],function(){jQuery.valHooks[this]={set:function(e,t){if(jQuery.isArray(t))return e.checked=jQuery.inArray(jQuery(e).val(),t)>-1}},support.checkOn||(jQuery.valHooks[this].get=function(e){return e.getAttribute("value")===null?"on":e.value})});var rfocusMorph=/^(?:focusinfocus|focusoutblur)$/;jQuery.extend(jQuery.event,{trigger:function(e,t,n,r){var i,s,o,u,a,f,l,c=[n||document],h=hasOwn.call(e,"type")?e.type:e,p=hasOwn.call(e,"namespace")?e.namespace.split("."):[];s=o=n=n||document;if(n.nodeType===3||n.nodeType===8)return;if(rfocusMorph.test(h+jQuery.event.triggered))return;h.indexOf(".")>-1&&(p=h.split("."),h=p.shift(),p.sort()),a=h.indexOf(":")<0&&"on"+h,e=e[jQuery.expando]?e:new jQuery.Event(h,typeof e=="object"&&e),e.isTrigger=r?2:3,e.namespace=p.join("."),e.rnamespace=e.namespace?new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,e.result=undefined,e.target||(e.target=n),t=t==null?[e]:jQuery.makeArray(t,[e]),l=jQuery.event.special[h]||{};if(!r&&l.trigger&&l.trigger.apply(n,t)===!1)return;if(!r&&!l.noBubble&&!jQuery.isWindow(n)){u=l.delegateType||h,rfocusMorph.test(u+h)||(s=s.parentNode);for(;s;s=s.parentNode)c.push(s),o=s;o===(n.ownerDocument||document)&&c.push(o.defaultView||o.parentWindow||window)}i=0;while((s=c[i++])&&!e.isPropagationStopped())e.type=i>1?u:l.bindType||h,f=(dataPriv.get(s,"events")||{})[e.type]&&dataPriv.get(s,"handle"),f&&f.apply(s,t),f=a&&s[a],f&&f.apply&&acceptData(s)&&(e.result=f.apply(s,t),e.result===!1&&e.preventDefault());return e.type=h,!r&&!e.isDefaultPrevented()&&(!l._default||l._default.apply(c.pop(),t)===!1)&&acceptData(n)&&a&&jQuery.isFunction(n[h])&&!jQuery.isWindow(n)&&(o=n[a],o&&(n[a]=null),jQuery.event.triggered=h,n[h](),jQuery.event.triggered=undefined,o&&(n[a]=o)),e.result},simulate:function(e,t,n){var r=jQuery.extend(new jQuery.Event,n,{type:e,isSimulated:!0});jQuery.event.trigger(r,null,t),r.isDefaultPrevented()&&n.preventDefault()}}),jQuery.fn.extend({trigger:function(e,t){return this.each(function(){jQuery.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];if(n)return jQuery.event.trigger(e,t,n,!0)}}),jQuery.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(e,t){jQuery.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}}),jQuery.fn.extend({hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),support.focusin="onfocusin"in window,support.focusin||jQuery.each({focus:"focusin",blur:"focusout"},function(e,t){var n=function(e){jQuery.event.simulate(t,e.target,jQuery.event.fix(e))};jQuery.event.special[t]={setup:function(){var r=this.ownerDocument||this,i=dataPriv.access(r,t);i||r.addEventListener(e,n,!0),dataPriv.access(r,t,(i||0)+1)},teardown:function(){var r=this.ownerDocument||this,i=dataPriv.access(r,t)-1;i?dataPriv.access(r,t,i):(r.removeEventListener(e,n,!0),dataPriv.remove(r,t))}}});var location=window.location,nonce=jQuery.now(),rquery=/\?/;jQuery.parseJSON=function(e){return JSON.parse(e+"")},jQuery.parseXML=function(e){var t;if(!e||typeof e!="string")return null;try{t=(new window.DOMParser).parseFromString(e,"text/xml")}catch(n){t=undefined}return(!t||t.getElementsByTagName("parsererror").length)&&jQuery.error("Invalid XML: "+e),t};var rhash=/#.*$/,rts=/([?&])_=[^&]*/,rheaders=/^(.*?):[ \t]*([^\r\n]*)$/mg,rlocalProtocol=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,rnoContent=/^(?:GET|HEAD)$/,rprotocol=/^\/\//,prefilters={},transports={},allTypes="*/".concat("*"),originAnchor=document.createElement("a");originAnchor.href=location.href,jQuery.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:location.href,type:"GET",isLocal:rlocalProtocol.test(location.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":allTypes,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":jQuery.parseJSON,"text xml":jQuery.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?ajaxExtend(ajaxExtend(e,jQuery.ajaxSettings),t):ajaxExtend(jQuery.ajaxSettings,e)},ajaxPrefilter:addToPrefiltersOrTransports(prefilters),ajaxTransport:addToPrefiltersOrTransports(transports),ajax:function(e,t){function S(e,t,s,u){var f,m,g,b,E,S=t;if(y===2)return;y=2,o&&window.clearTimeout(o),n=undefined,i=u||"",w.readyState=e>0?4:0,f=e>=200&&e<300||e===304,s&&(b=ajaxHandleResponses(l,w,s)),b=ajaxConvert(l,b,w,f);if(f)l.ifModified&&(E=w.getResponseHeader("Last-Modified"),E&&(jQuery.lastModified[r]=E),E=w.getResponseHeader("etag"),E&&(jQuery.etag[r]=E)),e===204||l.type==="HEAD"?S="nocontent":e===304?S="notmodified":(S=b.state,m=b.data,g=b.error,f=!g);else{g=S;if(e||!S)S="error",e<0&&(e=0)}w.status=e,w.statusText=(t||S)+"",f?p.resolveWith(c,[m,S,w]):p.rejectWith(c,[w,S,g]),w.statusCode(v),v=undefined,a&&h.trigger(f?"ajaxSuccess":"ajaxError",[w,l,f?m:g]),d.fireWith(c,[w,S]),a&&(h.trigger("ajaxComplete",[w,l]),--jQuery.active||jQuery.event.trigger("ajaxStop"))}typeof e=="object"&&(t=e,e=undefined),t=t||{};var n,r,i,s,o,u,a,f,l=jQuery.ajaxSetup({},t),c=l.context||l,h=l.context&&(c.nodeType||c.jquery)?jQuery(c):jQuery.event,p=jQuery.Deferred(),d=jQuery.Callbacks("once memory"),v=l.statusCode||{},m={},g={},y=0,b="canceled",w={readyState:0,getResponseHeader:function(e){var t;if(y===2){if(!s){s={};while(t=rheaders.exec(i))s[t[1].toLowerCase()]=t[2]}t=s[e.toLowerCase()]}return t==null?null:t},getAllResponseHeaders:function(){return y===2?i:null},setRequestHeader:function(e,t){var n=e.toLowerCase();return y||(e=g[n]=g[n]||e,m[e]=t),this},overrideMimeType:function(e){return y||(l.mimeType=e),this},statusCode:function(e){var t;if(e)if(y<2)for(t in e)v[t]=[v[t],e[t]];else w.always(e[w.status]);return this},abort:function(e){var t=e||b;return n&&n.abort(t),S(0,t),this}};p.promise(w).complete=d.add,w.success=w.done,w.error=w.fail,l.url=((e||l.url||location.href)+"").replace(rhash,"").replace(rprotocol,location.protocol+"//"),l.type=t.method||t.type||l.method||l.type,l.dataTypes=jQuery.trim(l.dataType||"*").toLowerCase().match(rnotwhite)||[""];if(l.crossDomain==null){u=document.createElement("a");try{u.href=l.url,u.href=u.href,l.crossDomain=originAnchor.protocol+"//"+originAnchor.host!=u.protocol+"//"+u.host}catch(E){l.crossDomain=!0}}l.data&&l.processData&&typeof l.data!="string"&&(l.data=jQuery.param(l.data,l.traditional)),inspectPrefiltersOrTransports(prefilters,l,t,w);if(y===2)return w;a=jQuery.event&&l.global,a&&jQuery.active++===0&&jQuery.event.trigger("ajaxStart"),l.type=l.type.toUpperCase(),l.hasContent=!rnoContent.test(l.type),r=l.url,l.hasContent||(l.data&&(r=l.url+=(rquery.test(r)?"&":"?")+l.data,delete l.data),l.cache===!1&&(l.url=rts.test(r)?r.replace(rts,"$1_="+nonce++):r+(rquery.test(r)?"&":"?")+"_="+nonce++)),l.ifModified&&(jQuery.lastModified[r]&&w.setRequestHeader("If-Modified-Since",jQuery.lastModified[r]),jQuery.etag[r]&&w.setRequestHeader("If-None-Match",jQuery.etag[r])),(l.data&&l.hasContent&&l.contentType!==!1||t.contentType)&&w.setRequestHeader("Content-Type",l.contentType),w.setRequestHeader("Accept",l.dataTypes[0]&&l.accepts[l.dataTypes[0]]?l.accepts[l.dataTypes[0]]+(l.dataTypes[0]!=="*"?", "+allTypes+"; q=0.01":""):l.accepts["*"]);for(f in l.headers)w.setRequestHeader(f,l.headers[f]);if(!l.beforeSend||l.beforeSend.call(c,w,l)!==!1&&y!==2){b="abort";for(f in{success:1,error:1,complete:1})w[f](l[f]);n=inspectPrefiltersOrTransports(transports,l,t,w);if(!n)S(-1,"No Transport");else{w.readyState=1,a&&h.trigger("ajaxSend",[w,l]);if(y===2)return w;l.async&&l.timeout>0&&(o=window.setTimeout(function(){w.abort("timeout")},l.timeout));try{y=1,n.send(m,S)}catch(E){if(!(y<2))throw E;S(-1,E)}}return w}return w.abort()},getJSON:function(e,t,n){return jQuery.get(e,t,n,"json")},getScript:function(e,t){return jQuery.get(e,undefined,t,"script")}}),jQuery.each(["get","post"],function(e,t){jQuery[t]=function(e,n,r,i){return jQuery.isFunction(n)&&(i=i||r,r=n,n=undefined),jQuery.ajax(jQuery.extend({url:e,type:t,dataType:i,data:n,success:r},jQuery.isPlainObject(e)&&e))}}),jQuery._evalUrl=function(e){return jQuery.ajax({url:e,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})},jQuery.fn.extend({wrapAll:function(e){var t;return jQuery.isFunction(e)?this.each(function(t){jQuery(this).wrapAll(e.call(this,t))}):(this[0]&&(t=jQuery(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstElementChild)e=e.firstElementChild;return e}).append(this)),this)},wrapInner:function(e){return jQuery.isFunction(e)?this.each(function(t){jQuery(this).wrapInner(e.call(this,t))}):this.each(function(){var t=jQuery(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=jQuery.isFunction(e);return this.each(function(n){jQuery(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){jQuery.nodeName(this,"body")||jQuery(this).replaceWith(this.childNodes)}).end()}}),jQuery.expr.filters.hidden=function(e){return!jQuery.expr.filters.visible(e)},jQuery.expr.filters.visible=function(e){return e.offsetWidth>0||e.offsetHeight>0||e.getClientRects().length>0};var r20=/%20/g,rbracket=/\[\]$/,rCRLF=/\r?\n/g,rsubmitterTypes=/^(?:submit|button|image|reset|file)$/i,rsubmittable=/^(?:input|select|textarea|keygen)/i;jQuery.param=function(e,t){var n,r=[],i=function(e,t){t=jQuery.isFunction(t)?t():t==null?"":t,r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};t===undefined&&(t=jQuery.ajaxSettings&&jQuery.ajaxSettings.traditional);if(jQuery.isArray(e)||e.jquery&&!jQuery.isPlainObject(e))jQuery.each(e,function(){i(this.name,this.value)});else for(n in e)buildParams(n,e[n],t,i);return r.join("&").replace(r20,"+")},jQuery.fn.extend({serialize:function(){return jQuery.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=jQuery.prop(this,"elements");return e?jQuery.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!jQuery(this).is(":disabled")&&rsubmittable.test(this.nodeName)&&!rsubmitterTypes.test(e)&&(this.checked||!rcheckableType.test(e))}).map(function(e,t){var n=jQuery(this).val();return n==null?null:jQuery.isArray(n)?jQuery.map(n,function(e){return{name:t.name,value:e.replace(rCRLF,"\r\n")}}):{name:t.name,value:n.replace(rCRLF,"\r\n")}}).get()}}),jQuery.ajaxSettings.xhr=function(){try{return new window.XMLHttpRequest}catch(e){}};var xhrSuccessStatus={0:200,1223:204},xhrSupported=jQuery.ajaxSettings.xhr();support.cors=!!xhrSupported&&"withCredentials"in xhrSupported,support.ajax=xhrSupported=!!xhrSupported,jQuery.ajaxTransport(function(e){var t,n;if(support.cors||xhrSupported&&!e.crossDomain)return{send:function(r,i){var s,o=e.xhr();o.open(e.type,e.url,e.async,e.username,e.password);if(e.xhrFields)for(s in e.xhrFields)o[s]=e.xhrFields[s];e.mimeType&&o.overrideMimeType&&o.overrideMimeType(e.mimeType),!e.crossDomain&&!r["X-Requested-With"]&&(r["X-Requested-With"]="XMLHttpRequest");for(s in r)o.setRequestHeader(s,r[s]);t=function(e){return function(){t&&(t=n=o.onload=o.onerror=o.onabort=o.onreadystatechange=null,e==="abort"?o.abort():e==="error"?typeof o.status!="number"?i(0,"error"):i(o.status,o.statusText):i(xhrSuccessStatus[o.status]||o.status,o.statusText,(o.responseType||"text")!=="text"||typeof o.responseText!="string"?{binary:o.response}:{text:o.responseText},o.getAllResponseHeaders()))}},o.onload=t(),n=o.onerror=t("error"),o.onabort!==undefined?o.onabort=n:o.onreadystatechange=function(){o.readyState===4&&window.setTimeout(function(){t&&n()})},t=t("abort");try{o.send(e.hasContent&&e.data||null)}catch(u){if(t)throw u}},abort:function(){t&&t()}}}),jQuery.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return jQuery.globalEval(e),e}}}),jQuery.ajaxPrefilter("script",function(e){e.cache===undefined&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),jQuery.ajaxTransport("script",function(e){if(e.crossDomain){var t,n;return{send:function(r,i){t=jQuery("")},trackEvent:function(t,n,r){if(typeof t!="undefined"&&Object.prototype.toString.apply(t)!=="[object String]")throw"Analytics: invalid action type.";if(typeof n!="undefined"&&Object.prototype.toString.apply(n)!=="[object String]")throw"Analytics: invalid label type.";if(typeof r!="undefined"&&(Object.prototype.toString.apply(r)!=="[object Number]"||!isFinite(r)))throw"Analytics: invalid value type.";if(typeof _gaq=="undefined")return;if(e==="undefined")throw"Analytics is not initialized.";_gaq.push(["_trackEvent",e,t,n,r])}}},define("analytics",["jquery"],function(){});if(Common===undefined)var Common={};Common.Gateway=new function(){var e=this,t=$(e),n={init:function(e){t.trigger("init",e)},openDocument:function(e){t.trigger("opendocument",e)},showMessage:function(e){t.trigger("showmessage",e)},applyEditRights:function(e){t.trigger("applyeditrights",e)},processSaveResult:function(e){t.trigger("processsaveresult",e)},processRightsChange:function(e){t.trigger("processrightschange",e)},refreshHistory:function(e){t.trigger("refreshhistory",e)},setHistoryData:function(e){t.trigger("sethistorydata",e)},setEmailAddresses:function(e){t.trigger("setemailaddresses",e)},processMailMerge:function(e){t.trigger("processmailmerge",e)},downloadAs:function(){t.trigger("downloadas")},processMouse:function(e){t.trigger("processmouse",e)},internalCommand:function(e){t.trigger("internalcommand",e)},resetFocus:function(e){t.trigger("resetfocus",e)}},r=function(e){window.parent&&window.JSON&&(e.frameEditorId=window.frameEditorId,window.parent.postMessage(window.JSON.stringify(e),"*"))},i=function(e){var t=e.data;if(Object.prototype.toString.apply(t)!=="[object String]"||!window.JSON)return;var r,i;try{r=window.JSON.parse(t)}catch(s){r=""}r&&(i=n[r.command],i&&i.call(this,r.data))},s=function(e){i(e)};return window.attachEvent?window.attachEvent("onmessage",s):window.addEventListener("message",s,!1),{ready:function(){r({event:"onReady"})},requestEditRights:function(){r({event:"onRequestEditRights"})},requestHistory:function(){r({event:"onRequestHistory"})},requestHistoryData:function(e){r({event:"onRequestHistoryData",data:e})},requestRestore:function(e,t){r({event:"onRequestRestore",data:{version:e,url:t}})},requestEmailAddresses:function(){r({event:"onRequestEmailAddresses"})},requestStartMailMerge:function(){r({event:"onRequestStartMailMerge"})},requestHistoryClose:function(e){r({event:"onRequestHistoryClose"})},reportError:function(e,t){r({event:"onError",data:{errorCode:e,errorDescription:t}})},sendInfo:function(e){r({event:"onInfo",data:e})},setDocumentModified:function(e){r({event:"onDocumentStateChange",data:e})},internalMessage:function(e,t){r({event:"onInternalMessage",data:{type:e,data:t}})},updateVersion:function(){r({event:"onOutdatedVersion"})},downloadAs:function(e){r({event:"onDownloadAs",data:e})},collaborativeChanges:function(){r({event:"onCollaborativeChanges"})},requestRename:function(e){r({event:"onRequestRename",data:e})},metaChange:function(e){r({event:"onMetaChange",data:e})},on:function(n,r){var i=function(t,n){r.call(e,n)};t.on(n,i)}}},define("gateway",["jquery"],function(){});if(Common===undefined)var Common={};Common.Locale=new function(){var l10n={},_createXMLHTTPObject=function(){var e;try{e=new ActiveXObject("Msxml2.XMLHTTP")}catch(t){try{e=new ActiveXObject("Microsoft.XMLHTTP")}catch(n){e=!1}}return!e&&typeof XMLHttpRequest!="undefined"&&(e=new XMLHttpRequest),e},_applyLocalization=function(){try{for(var e in l10n){var t=e.split(".");if(t&&t.length>2){var n=window;for(var r=0;r/im,a=/]*>\s*([\s\S]+)\s*<\/body>/im,f=typeof location!="undefined"&&location.href,l=f&&location.protocol&&location.protocol.replace(/\:/,""),c=f&&location.hostname,h=f&&(location.port||undefined),p={},d=e.config&&e.config()||{};t={version:"2.0.10",strip:function(e){if(e){e=e.replace(u,"");var t=e.match(a);t&&(e=t[1])}else e="";return e},jsEscape:function(e){return e.replace(/(['\\])/g,"\\$1").replace(/[\f]/g,"\\f").replace(/[\b]/g,"\\b").replace(/[\n]/g,"\\n").replace(/[\t]/g,"\\t").replace(/[\r]/g,"\\r").replace(/[\u2028]/g,"\\u2028").replace(/[\u2029]/g,"\\u2029")},createXhr:d.createXhr||function(){var e,t,n;if(typeof XMLHttpRequest!="undefined")return new XMLHttpRequest;if(typeof ActiveXObject!="undefined")for(t=0;t<3;t+=1){n=o[t];try{e=new ActiveXObject(n)}catch(r){}if(e){o=[n];break}}return e},parseName:function(e){var t,n,r,i=!1,s=e.indexOf("."),o=e.indexOf("./")===0||e.indexOf("../")===0;return s!==-1&&(!o||s>1)?(t=e.substring(0,s),n=e.substring(s+1,e.length)):t=e,r=n||t,s=r.indexOf("!"),s!==-1&&(i=r.substring(s+1)==="strip",r=r.substring(0,s),n?n=r:t=r),{moduleName:t,ext:n,strip:i}},xdRegExp:/^((\w+)\:)?\/\/([^\/\\]+)/,useXhr:function(e,n,r,i){var s,o,u,a=t.xdRegExp.exec(e);return a?(s=a[2],o=a[3],o=o.split(":"),u=o[1],o=o[0],(!s||s===n)&&(!o||o.toLowerCase()===r.toLowerCase())&&(!u&&!o||u===i)):!0},finishLoad:function(e,n,r,i){r=n?t.strip(r):r,d.isBuild&&(p[e]=r),i(r)},load:function(e,n,r,i){if(i.isBuild&&!i.inlineText){r();return}d.isBuild=i.isBuild;var s=t.parseName(e),o=s.moduleName+(s.ext?"."+s.ext:""),u=n.toUrl(o),a=d.useXhr||t.useXhr;if(u.indexOf("empty:")===0){r();return}!f||a(u,l,c,h)?t.get(u,function(n){t.finishLoad(e,s.strip,n,r)},function(e){r.error&&r.error(e)}):n([o],function(e){t.finishLoad(s.moduleName+"."+s.ext,s.strip,e,r)})},write:function(e,n,r,i){if(p.hasOwnProperty(n)){var s=t.jsEscape(p[n]);r.asModule(e+"!"+n,"define(function () { return '"+s+"';});\n")}},writeFile:function(e,n,r,i,s){var o=t.parseName(n),u=o.ext?"."+o.ext:"",a=o.moduleName+u,f=r.toUrl(o.moduleName+u)+".js";t.load(a,r,function(n){var r=function(e){return i(f,e)};r.asModule=function(e,t){return i.asModule(e,f,t)},t.write(e,a,r,s)},s)}};if(d.env==="node"||!d.env&&typeof process!="undefined"&&process.versions&&!!process.versions.node&&!process.versions["node-webkit"])n=require.nodeRequire("fs"),t.get=function(e,t,r){try{var i=n.readFileSync(e,"utf8");i.indexOf("")===0&&(i=i.substring(1)),t(i)}catch(s){r(s)}};else if(d.env==="xhr"||!d.env&&t.createXhr())t.get=function(e,n,r,i){var s=t.createXhr(),o;s.open("GET",e,!0);if(i)for(o in i)i.hasOwnProperty(o)&&s.setRequestHeader(o.toLowerCase(),i[o]);d.onXhr&&d.onXhr(s,e),s.onreadystatechange=function(t){var i,o;s.readyState===4&&(i=s.status,i>399&&i<600?(o=new Error(e+" HTTP status: "+i),o.xhr=s,r(o)):n(s.responseText),d.onXhrComplete&&d.onXhrComplete(s,e))},s.send(null)};else if(d.env==="rhino"||!d.env&&typeof Packages!="undefined"&&typeof java!="undefined")t.get=function(e,t){var n,r,i="utf-8",s=new java.io.File(e),o=java.lang.System.getProperty("line.separator"),u=new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(s),i)),a="";try{n=new java.lang.StringBuffer,r=u.readLine(),r&&r.length()&&r.charAt(0)===65279&&(r=r.substring(1)),r!==null&&n.append(r);while((r=u.readLine())!==null)n.append(o),n.append(r);a=String(n.toString())}finally{u.close()}t(a)};else if(d.env==="xpconnect"||!d.env&&typeof Components!="undefined"&&Components.classes&&Components.interfaces)r=Components.classes,i=Components.interfaces,Components.utils["import"]("resource://gre/modules/FileUtils.jsm"),s="@mozilla.org/windows-registry-key;1"in r,t.get=function(e,t){var n,o,u,a={};s&&(e=e.replace(/\//g,"\\")),u=new FileUtils.File(e);try{n=r["@mozilla.org/network/file-input-stream;1"].createInstance(i.nsIFileInputStream),n.init(u,1,0,!1),o=r["@mozilla.org/intl/converter-input-stream;1"].createInstance(i.nsIConverterInputStream),o.init(n,"utf-8",n.available(),i.nsIConverterInputStream.DEFAULT_REPLACEMENT_CHARACTER),o.readString(n.available(),a),o.close(),n.close(),t(a.value)}catch(f){throw new Error((u&&u.path||"")+": "+f)}};return t}),define("text!common/main/lib/template/Header.template",[],function(){return'
\n \n
<%= headerCaption %>
\n
<%= documentCaption %>
\n
<%= textBack %>
\n
'});if(Common===undefined)var Common={};define("common/main/lib/component/BaseView",["backbone"],function(e){"use strict";Common.UI=_.extend(Common.UI||{},{Keys:{BACKSPACE:8,TAB:9,RETURN:13,SHIFT:16,CTRL:17,ALT:18,ESC:27,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46,HOME:36,END:35,SPACE:32,PAGEUP:33,PAGEDOWN:34,INSERT:45,NUM_PLUS:107,NUM_MINUS:109,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,EQUALITY:187,MINUS:189},BaseView:e.View.extend({isSuspendEvents:!1,initialize:function(e){this.options=this.options?_({}).extend(this.options,e):e},setVisible:function(e){return this[e?"show":"hide"]()},isVisible:function(){return $(this.el).is(":visible")},suspendEvents:function(){this.isSuspendEvents=!0},resumeEvents:function(){this.isSuspendEvents=!1}}),getId:function(e){return _.uniqueId(e||"asc-gen")}})});if(Common===undefined)var Common={};define("common/main/lib/component/Window",["common/main/lib/component/BaseView"],function(){"use strict";Common.UI.Window=Common.UI.BaseView.extend(_.extend(function(){function n(){var e=$(".modals-mask");return e.length==0&&(e=$("
").appendTo(document.body).hide(),e.attr("counter",0)),e}function r(e){if(!this.isLocked()&&this.isVisible()&&this.initConfig.enableKeyEvents)switch(e.keyCode){case Common.UI.Keys.ESC:if($(".asc-loadmask").length<1)return e.preventDefault(),e.stopPropagation(),this.initConfig.closable!==!1&&(this.initConfig.toolclose=="hide"?this.hide():this.close()),!1;break;case Common.UI.Keys.RETURN:if(this.$window.find(".btn.primary").length&&$(".asc-loadmask").length<1&&(this.initConfig.onprimary||this.onPrimary).call(this)===!1)return e.preventDefault(),!1}}function i(){if(window.innerHeight==undefined)var e=document.documentElement.offsetWidth,t=document.documentElement.offsetHeight;else e=Common.Utils.innerWidth(),t=Common.Utils.innerHeight();if(this.initConfig.height=="auto"){var n=parseInt(this.$window.find(".body").css("height"));this.initConfig.header&&(n+=parseInt(this.$window.find(".header").css("height")))}else n=this.initConfig.height;var r=this.initConfig.width=="auto"?parseInt(this.$window.find(".body").css("width")):this.initConfig.width,i=Math.floor((parseInt(t)-parseInt(n))/2*.9),s=Math.floor((parseInt(e)-parseInt(r))/2);this.$window.css("left",s),this.$window.css("top",i)}function s(e){return{"-webkit-transition":"0.3s opacity","-moz-transition":"0.3s opacity","-ms-transition":"0.3s opacity","-o-transition":"0.3s opacity",opacity:e}}function o(e){if($(e.target).hasClass("close"))return;Common.UI.Menu.Manager.hideAll();var t=e instanceof jQuery.Event?Common.Utils.zoom():1;this.dragging.enabled=!0,this.dragging.initx=e.pageX*t-parseInt(this.$window.css("left")),this.dragging.inity=e.pageY*t-parseInt(this.$window.css("top"));if(window.innerHeight==undefined)var n=document.documentElement.offsetWidth,r=document.documentElement.offsetHeight;else n=Common.Utils.innerWidth(),r=Common.Utils.innerHeight();this.dragging.maxx=n-parseInt(this.$window.css("width")),this.dragging.maxy=r-parseInt(this.$window.css("height")),$(document).on("mousemove",this.binding.drag),$(document).on("mouseup",this.binding.dragStop),this.fireEvent("drag",[this,"start"])}function u(){$(document).off("mousemove",this.binding.drag),$(document).off("mouseup",this.binding.dragStop),this.dragging.enabled=!1,this.fireEvent("drag",[this,"end"])}function a(e){if(this.dragging.enabled){var t=e instanceof jQuery.Event?Common.Utils.zoom():1,n=e.pageX*t-this.dragging.initx,r=e.pageY*t-this.dragging.inity;n<0?n=0:n>this.dragging.maxx&&(n=this.dragging.maxx),r<0?r=0:r>this.dragging.maxy&&(r=this.dragging.maxy),this.$window.css({left:n,top:r})}}function f(e){Common.UI.Menu.Manager.hideAll();var t=$(e.target),n=parseInt(this.$window.css("left")),r=parseInt(this.$window.css("top"));this.resizing.enabled=!0,this.resizing.initpage_x=e.pageX*Common.Utils.zoom(),this.resizing.initpage_y=e.pageY*Common.Utils.zoom(),this.resizing.initx=this.resizing.initpage_x-n,this.resizing.inity=this.resizing.initpage_y-r,this.resizing.initw=parseInt(this.$window.css("width")),this.resizing.inith=parseInt(this.$window.css("height")),this.resizing.type=[t.hasClass("left")?-1:t.hasClass("right")?1:0,t.hasClass("top")?-1:t.hasClass("bottom")?1:0];var i=window.innerHeight==undefined?document.documentElement.offsetWidth:Common.Utils.innerWidth(),s=window.innerHeight==undefined?document.documentElement.offsetHeight:Common.Utils.innerHeight(),o=this.initConfig.maxwidth?this.initConfig.maxwidth:i,u=this.initConfig.maxheight?this.initConfig.maxheight:s;this.resizing.type[0]>0?(this.resizing.maxx=Math.min(i,n+o),this.resizing.minx=n+this.initConfig.minwidth):this.resizing.type[0]<0&&(this.resizing.maxx=n+this.resizing.initw-this.initConfig.minwidth,this.resizing.minx=Math.max(0,n+this.resizing.initw-o)),this.resizing.type[1]>0?(this.resizing.maxy=Math.min(s,r+u),this.resizing.miny=r+this.initConfig.minheight):this.resizing.type[1]<0&&(this.resizing.maxy=r+this.resizing.inith-this.initConfig.minheight,this.resizing.miny=Math.max(0,r+this.resizing.inith-u)),$(document.body).css("cursor",t.css("cursor")),this.$window.find(".resize-border").addClass("resizing"),this.$window.find(".header").addClass("resizing"),$(document).on("mousemove",this.binding.resize),$(document).on("mouseup",this.binding.resizeStop),this.fireEvent("resize",[this,"start"])}function l(e){if(this.resizing.enabled){var t=!1,n=e instanceof jQuery.Event?Common.Utils.zoom():1,r=e.pageX*n,i=e.pageY*n;this.resizing.type[0]&&rthis.resizing.minx&&(this.resizing.type[0]<0&&this.$window.css({left:r-this.resizing.initx}),this.setWidth(this.resizing.initw+(r-this.resizing.initpage_x)*this.resizing.type[0]),t=!0),this.resizing.type[1]&&ithis.resizing.miny&&(this.resizing.type[1]<0&&this.$window.css({top:i-this.resizing.inity}),this.setHeight(this.resizing.inith+(i-this.resizing.initpage_y)*this.resizing.type[1]),t=!0),t&&this.fireEvent("resizing")}}function c(){$(document).off("mousemove",this.binding.resize),$(document).off("mouseup",this.binding.resizeStop),$(document.body).css("cursor","auto"),this.$window.find(".resize-border").removeClass("resizing"),this.$window.find(".header").removeClass("resizing"),this.resizing.enabled=!1,this.fireEvent("resize",[this,"end"])}var e={closable:!0,header:!0,modal:!0,width:"auto",height:"auto",title:"Title",alias:"Window",cls:"",toolclose:"close",maxwidth:undefined,maxheight:undefined,minwidth:0,minheight:0,enableKeyEvents:!0},t='
<%= cls?" "+cls:"" %>" id="<%= id %>" style="width:<%= width %>px;"><% if (header==true) { %>
<% if (closable!==false) %>
<% %><%= title %>
<% } %>
<%= tpl %>
';return Common.UI.alert=function(e){function u(t){var n=t.getChild(".info-box"),r=t.getChild(".info-box span"),i=t.getChild(".footer"),s=t.getChild(".header"),o=t.getChild(".body"),u=t.getChild(".icon"),a=t.getChild(".info-box .dont-show-checkbox");e.dontshow||o.css("padding-bottom","10px"),e.maxwidth&&e.width=="auto"&&r.position().left+r.width()+parseInt(n.css("padding-right"))>e.maxwidth&&(e.width=e.maxwidth),e.width=="auto"?(n.height(Math.max(r.height()+(a.length>0?a.height()+parseInt(a.css("margin-top")):0),u.height())),o.height(parseInt(n.css("height"))+parseInt(i.css("height"))),t.setSize(r.position().left+r.width()+parseInt(n.css("padding-right")),parseInt(o.css("height"))+parseInt(s.css("height")))):(r.css("white-space","normal"),t.setWidth(e.width),n.height(Math.max(r.height()+(a.length>0?a.height()+parseInt(a.css("margin-top")):0),u.height())),o.height(parseInt(n.css("height"))+parseInt(i.css("height"))),t.setHeight(parseInt(o.css("height"))+parseInt(s.css("height")))),r.height() .body").css("height"));this.initConfig.header&&(i+=parseInt(this.$window.find("> .header").css("height"))),this.$window.height(i)}else this.$window.css("height",this.initConfig.height);this.initConfig.resizable&&this.setResizable(this.initConfig.resizable);var s=this;return Common.NotificationCenter.on("window:close",function(){s.$window&&s.isVisible()&&s.close()}),this.fireEvent("render:after",this),this},show:function(e,t){if(this.initConfig.modal){var r=n();if(this.options.animate!==!1){var o=r.css("opacity");r.css("opacity",0),r.attr("counter",parseInt(r.attr("counter"))+1),r.show(),setTimeout(function(){r.css(s(o))},1)}else r.attr("counter",parseInt(r.attr("counter"))+1),r.show();Common.NotificationCenter.trigger("modal:show",this),this.$lastmodal=$(".asc-window.modal:not(.dethrone):visible").first().addClass("dethrone")}this.$window?this.$window.is(":visible")||(this.$window.css({opacity:0}),this.$window.show()):(this.render(),_.isNumber(e)&&_.isNumber(t)?(this.$window.css("left",Math.floor(e)),this.$window.css("top",Math.floor(t))):i.call(this)),$(document).on("keydown."+this.cid,this.binding.keydown);var u=this;setTimeout(function(){u.fireEvent("animate:before",u)},10),this.options.animate!==!1?(this.$window.css({"-webkit-transform":"scale(0.8)","-moz-transform":"scale(0.8)","-ms-transform":"scale(0.8)","-o-transform":"scale(0.8)",opacity:0}),setTimeout(function(){u.$window.css({"-webkit-transition":"0.2s opacity, 0.2s -webkit-transform","-webkit-transform":"scale(1)","-moz-transition":"0.2s opacity, 0.2s -moz-transform","-moz-transform":"scale(1)","-ms-transition":"0.2s opacity, 0.2s -ms-transform","-ms-transform":"scale(1)","-o-transition":"0.2s opacity, 0.2s -o-transform","-o-transform":"scale(1)",opacity:"1"})},1),setTimeout(function(){u.$window.addClass("notransform"),u.fireEvent("show",u)},this.initConfig.modal?1e3:350)):(this.$window.css({opacity:1}),this.$window.addClass("notransform"),this.fireEvent("show",this)),Common.NotificationCenter.trigger("window:show")},close:function(e){$(document).off("keydown."+this.cid),this.initConfig.header&&this.$window.find(".header").off("mousedown",this.binding.dragStart);if(this.initConfig.modal){var t=n(),r=!0;t.attr("counter",parseInt(t.attr("counter"))-1),this.$lastmodal.size()>0&&(this.$lastmodal.removeClass("dethrone"),r=!this.$lastmodal.hasClass("modal")||!this.$lastmodal.is(":visible"));if(r)if(this.options.animate!==!1){var i=t.css("opacity");t.css(s(0)),setTimeout(function(){t.css("opacity",i),parseInt(t.attr("counter"))<1&&(t.hide(),t.attr("counter",0))},300)}else parseInt(t.attr("counter"))<1&&(t.hide(),t.attr("counter",0));Common.NotificationCenter.trigger("modal:close",this)}this.$window.remove(),e!==!0&&this.fireEvent("close",this)},hide:function(){$(document).off("keydown."+this.cid);if(this.$window){if(this.initConfig.modal){var e=n(),t=!0;e.attr("counter",parseInt(e.attr("counter"))-1),this.$lastmodal.size()>0&&(this.$lastmodal.removeClass("dethrone"),t=!this.$lastmodal.hasClass("modal")||!this.$lastmodal.is(":visible"));if(t)if(this.options.animate!==!1){var r=e.css("opacity");e.css(s(0)),setTimeout(function(){e.css("opacity",r),parseInt(e.attr("counter"))<1&&(e.hide(),e.attr("counter",0))},300)}else parseInt(e.attr("counter"))<1&&(e.hide(),e.attr("counter",0));Common.NotificationCenter.trigger("modal:hide",this)}this.$window.hide(),this.$window.removeClass("notransform"),this.fireEvent("hide",this)}},isLocked:function(){return this.$window.hasClass("dethrone")||!this.options.modal&&this.$window.parent().find(".asc-window.modal:visible").length},getChild:function(e){return e?this.$window.find(e):this.$window},setWidth:function(e){if(e>=0){var t=parseInt(this.$window.css("min-width"));e=0){var t=parseInt(this.$window.css("min-height"));e .header").css("height"))),this.$window.find("> .body").css("height",e)}},getHeight:function(){return parseInt(this.$window.css("height"))},setSize:function(e,t){this.setWidth(e),this.setHeight(t)},getSize:function(){return[this.getWidth(),this.getHeight()]},setTitle:function(e){this.$window.find("> .header > .title").text(e)},getTitle:function(){return this.$window.find("> .header > .title").text()},isVisible:function(){return this.$window&&this.$window.is(":visible")},setResizable:function(e,t,n){if(e!==this.resizable){if(e){var r='
'+'
'+'
'+'
'+'
'+'
'+'
'+'
';this.initConfig.header&&(r+='
'),this.$window.append(_.template(r)),this.binding.resize=_.bind(l,this),this.binding.resizeStop=_.bind(c,this),this.binding.resizeStart=_.bind(f,this),t&&t.length>1&&(this.initConfig.minwidth=t[0]),t&&t.length>1&&(this.initConfig.minheight=t[1]),n&&n.length>1&&(this.initConfig.maxwidth=n[0]),n&&n.length>1&&(this.initConfig.maxheight=n[1]),this.$window.find(".resize-border").on("mousedown",this.binding.resizeStart)}else this.$window.find(".resize-border").remove();this.resizable=e}},onPrimary:function(){},cancelButtonText:"Cancel",okButtonText:"OK",yesButtonText:"Yes",noButtonText:"No",closeButtonText:"Close",textWarning:"Warning",textError:"Error",textConfirmation:"Confirmation",textInformation:"Information",textDontShow:"Don't show this message again"}}(),Common.UI.Window||{}))}),define("common/main/lib/view/RenameDialog",["common/main/lib/component/Window"],function(){"use strict";Common.Views.RenameDialog=Common.UI.Window.extend(_.extend({options:{width:330,header:!1,cls:"modal-dlg",filename:""},initialize:function(e){_.extend(this.options,e||{}),this.template=['
','
',"","
",'
',"
",'"].join(""),this.options.tpl=_.template(this.template,this.options),Common.UI.Window.prototype.initialize.call(this,this.options)},render:function(){Common.UI.Window.prototype.render.call(this);var e=this;e.inputName=new Common.UI.InputField({el:$("#id-dlg-newname"),style:"width: 100%;",validateOnBlur:!1,validation:function(t){return/[\t*\+:\"<>?|\\\\/]/gim.test(t)?e.txtInvalidName+'*+:"<>?|/':!0}});var t=this.getChild();t.find(".btn").on("click",_.bind(this.onBtnClick,this)),e.inputNameEl=t.find("input"),e.inputNameEl.on("keypress",_.bind(this.onKeyPress,this))},show:function(){Common.UI.Window.prototype.show.apply(this,arguments);var e=this;_.delay(function(){e.inputName.setValue(e.options.filename),e.inputNameEl.focus().select()},100)},onKeyPress:function(e){e.keyCode==Common.UI.Keys.RETURN&&this._handleInput("ok")},onBtnClick:function(e){this._handleInput(e.currentTarget.attributes.result.value)},_handleInput:function(e){if(this.options.handler){if(e=="ok"&&this.inputName.checkValidate()!==!0){this.inputNameEl.focus();return}this.options.handler.call(this,e,this.inputName.getValue())}this.close()},textName:"File name",cancelButtonText:"Cancel",okButtonText:"Ok",txtInvalidName:"The file name cannot contain any of the following characters: "},Common.Views.RenameDialog||{}))});if(Common===undefined)var Common={};Common.Views=Common.Views||{},define("common/main/lib/view/Header",["backbone","text!common/main/lib/template/Header.template","core","common/main/lib/view/RenameDialog"],function(e,t){"use strict";Common.Views.Header=e.View.extend(_.extend({options:{branding:{},headerCaption:"Default Caption",documentCaption:"",canBack:!1},el:"#header",template:_.template(t),events:{"click #header-logo":function(e){var t=!this.branding||!this.branding.logo||!this.branding.logo.url?"http://www.onlyoffice.com":this.branding.logo.url,n=window.open(t);n&&n.focus()}},initialize:function(e){this.options=this.options?_({}).extend(this.options,e):e,this.headerCaption=this.options.headerCaption,this.documentCaption=this.options.documentCaption,this.canBack=this.options.canBack,this.branding=this.options.customization,this.isModified=!1},render:function(){$(this.el).html(this.template({headerCaption:this.headerCaption,documentCaption:Common.Utils.String.htmlEncode(this.documentCaption),canBack:this.canBack,textBack:this.textBack}));var e=(new Common.UI.MenuItem({caption:this.openNewTabText})).on("click",function(e,t){Common.NotificationCenter.trigger("goback",!0),Common.component.Analytics.trackEvent("Back to Folder")});this.gotoDocsMenu=new Common.UI.Menu({style:"min-width: 100px;",items:[e]})},setVisible:function(e){e?this.show():this.hide()},setBranding:function(e){var t;this.branding=e,e&&e.logo&&e.logo.image&&(t=$("#header-logo"),t&&(t.html(''),t.css({"background-image":"none",width:"auto"})))},setHeaderCaption:function(e){this.headerCaption=e;var t=$("#header-caption > div");return t&&t.html(e),e},getHeaderCaption:function(){return this.headerCaption},setDocumentCaption:function(e,t){t!==undefined&&(this.isModified=t),this.documentCaption=e,e||(e=""),this.isModified&&(e+="*");var n=$("#header-documentcaption div");return n&&n.html(Common.Utils.String.htmlEncode(e)),e},getDocumentCaption:function(){return this.documentCaption},setCanBack:function(e){this.canBack=e;var t=$("#header-back");t&&(t.off("mouseup"),t.css("display",e?"table-cell":"none"),e&&t.on("mouseup",_.bind(this.onBackClick,this)))},getCanBack:function(){return this.canBack},onBackClick:function(e){if(e.which==3){Common.UI.Menu.Manager.hideAll();var t=this,n=[e.pageX*Common.Utils.zoom(),e.pageY*Common.Utils.zoom()],r=$(this.el).find(Common.Utils.String.format("#menu-container-{0}",this.gotoDocsMenu.id));this.gotoDocsMenu.rendered||(r.length<1&&(r=$(Common.Utils.String.format('',this.gotoDocsMenu.id)),$(this.el).append(r)),this.gotoDocsMenu.render(r),this.gotoDocsMenu.cmpEl.attr({tabindex:"-1"})),_.delay(function(){r.css({left:n[0]-t.gotoDocsMenu.cmpEl.width(),top:n[1]+3}),t.gotoDocsMenu.show()},10)}else Common.NotificationCenter.trigger("goback",e.which==2),Common.component.Analytics.trackEvent("Back to Folder")},setCanRename:function(e){var t=$("#header-documentcaption div");if(e){var n=this;t.tooltip({title:n.txtRename,placement:"cursor"}),t.on("click",function(e){(new Common.Views.RenameDialog({filename:n.documentCaption,handler:function(e,t){e=="ok"&&!_.isEmpty(t.trim())&&n.documentCaption!==t.trim()&&Common.Gateway.requestRename(t),Common.NotificationCenter.trigger("edit:complete",n)}})).show(t.position().left-1,20)})}else{var r=t.data("bs.tooltip");r&&(r.options.title="",r.setContent()),t.off("click")}t.css("cursor",e?"pointer":"default"),t.toggleClass("renamed",e)},textBack:"Go to Documents",openNewTabText:"Open in New Tab",txtRename:"Rename"},Common.Views.Header||{}))}),define("presentationeditor/main/app/model/Pages",["backbone"],function(e){"use strict";PE.Models=PE.Models||{},PE.Models.Pages=e.Model.extend({defaults:{current:0,count:0}})}),define("presentationeditor/main/app/view/DocumentPreview",["jquery","underscore","backbone","common/main/lib/component/BaseView","presentationeditor/main/app/model/Pages"],function(){"use strict";function e(e,t,n){var r=e.get("current"),i=e.get("count");$("#preview-label-slides").text(Common.Utils.String.format(this.slideIndexText,r
','
','
','','','','
',"
",'
','','","
",'
','
','','
','',"
","
"].join(""),this.pages=new PE.Models.Pages({current:1,count:1}),this.pages.on("change",_.bind(e,this))},render:function(){var e=$(this.el),t=this;e.html(_.template(this.template,{scope:this})),this.btnPrev=new Common.UI.Button({el:$("#btn-preview-prev",this.el),hint:this.txtPrev,hintAnchor:"top"}),this.btnPrev.on("click",_.bind(function(){this.api&&this.api.DemonstrationPrevSlide()},this)),this.btnNext=new Common.UI.Button({el:$("#btn-preview-next",this.el),hint:this.txtNext,hintAnchor:"top"}),this.btnNext.on("click",_.bind(function(){this.api&&this.api.DemonstrationNextSlide()},this)),this.btnPlay=new Common.UI.Button({el:$("#btn-preview-play",this.el),hint:this.txtPlay,hintAnchor:"top"}),this.btnPlay.on("click",_.bind(function(e){var t=$(".btn-icon",this.btnPlay.cmpEl);t.hasClass("btn-pause")?(t.removeClass("btn-pause"),this.btnPlay.updateHint(this.txtPlay),this.api&&this.api.DemonstrationPause()):(t.addClass("btn-pause"),this.btnPlay.updateHint(this.txtPause),this.api&&this.api.DemonstrationPlay())},this)),this.btnClose=new Common.UI.Button({el:$("#btn-preview-close",this.el),hint:this.txtClose,hintAnchor:"top"}),this.btnClose.on("click",_.bind(function(){this.api&&this.api.EndDemonstration()},this)),this.btnFullScreen=new Common.UI.Button({el:$("#btn-preview-fullscreen",this.el),hint:this.txtFullScreen,hintAnchor:"top"}),this.btnFullScreen.on("click",_.bind(function(e){this.toggleFullScreen()},this)),this.txtGoToPage=(new Common.UI.InputField({el:$("#preview-goto-page"),allowBlank:!0,validateOnChange:!0,style:"width: 60px;",maskExp:/[0-9]/,validation:function(e){if(/(^[0-9]+$)/.test(e)){e=parseInt(e);if(undefined!==e&&e>0&&e<=t.pages.get("count"))return!0}return t.txtPageNumInvalid}})).on("keypress:after",function(e,n){if(n.keyCode===Common.UI.Keys.RETURN){var r=t.$el.find("#preview-goto-box"),i=r.find("input[type=text]"),s=parseInt(i.val());return!s||s-->t.pages.get("count")||s<0?(i.select(),!1):(r.focus(),r.parent().removeClass("open"),t.api.DemonstrationGoToSlide(s),t.api.asc_enableKeyEvents(!0),!1)}}).on("keyup:after",function(e,n){if(n.keyCode===Common.UI.Keys.ESC){var r=t.$el.find("#preview-goto-box");return r.focus(),r.parent().removeClass("open"),t.api.asc_enableKeyEvents(!0),!1}});var n=this.$el.find("#preview-goto-box");n.on("click",function(){return!1}),n.parent().on("show.bs.dropdown",function(){var e=t.txtGoToPage.$el.find("input");_.defer(function(){e.focus(),e.select()},100)}),n.parent().on("hide.bs.dropdown",function(){var e=t.$el.find("#preview-goto-box");t.api&&e&&(e.focus(),e.parent().removeClass("open"),t.api.asc_enableKeyEvents(!0))}),$(document).on("webkitfullscreenchange mozfullscreenchange fullscreenchange MSFullscreenChange",function(){var e=document.fullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement||document.msFullscreenElement;t.btnFullScreen.cmpEl.toggleClass("fullscreen",e!==undefined&&e!==null),Common.Utils.isIE?(t.btnFullScreen.updateHint(e?"":t.txtFullScreen),t.btnPrev.updateHint(e?"":t.txtPrev),t.btnPlay.updateHint(e?"":$(".btn-icon",t.btnPlay.cmpEl).hasClass("btn-pause")?t.txtPause:t.txtPlay),t.btnNext.updateHint(e?"":t.txtNext),t.btnClose.updateHint(e?"":t.txtClose)):t.btnFullScreen.updateHint(e?t.txtExitFullScreen:t.txtFullScreen)}),Common.Utils.isIE&&e.find(".preview-controls").css("opacity","0.4"),this.separatorFullScreen=e.find(".separator.fullscreen")},show:function(){var e=PE.getController("Toolbar").getView("Toolbar");e._state.hasCollaborativeChanges&&(e._state.hasCollaborativeChanges=!1,e.synchTooltip&&e.synchTooltip.hide(),e.needShowSynchTip=!0),Common.UI.BaseView.prototype.show.call(this,arguments);var t=$(".btn-icon",this.btnPlay.cmpEl);t.hasClass("btn-pause")||(t.addClass("btn-pause"),this.btnPlay.updateHint(this.txtPause)),$("#viewport-vbox-layout").css("z-index","0"),this.fireEvent("editcomplete",this)},hide:function(){Common.UI.BaseView.prototype.hide.call(this,arguments),$("#viewport-vbox-layout").css("z-index","auto"),Common.NotificationCenter.trigger("layout:changed","preview");var e=PE.getController("Toolbar").getView("Toolbar");e.needShowSynchTip&&(e.needShowSynchTip=!1,e.onCollaborativeChanges()),this.fireEvent("editcomplete",this)},setApi:function(e){return this.api=e,this.api&&(this.api.asc_registerCallback("asc_onCountPages",_.bind(this.onCountSlides,this)),this.api.asc_registerCallback("asc_onEndDemonstration",_.bind(this.onEndDemonstration,this)),this.api.asc_registerCallback("asc_onDemonstrationSlideChanged",_.bind(this.onDemonstrationSlideChanged,this)),this.api.DemonstrationEndShowMessage(this.txtFinalMessage)),this},setMode:function(e){this.mode=e;if(this.mode.isDesktopApp||Common.Utils.isIE11)this.btnFullScreen.setVisible(!1),this.separatorFullScreen.hide(),$(document).off("webkitfullscreenchange mozfullscreenchange fullscreenchange MSFullscreenChange");return this},onCountSlides:function(e){this.pages.set("count",e)},onDemonstrationSlideChanged:function(e){this.pages.set("current",e+1);if(this.api&&_.isNumber(e)){var t=this.api.getCountPages();t!==this.pages.get("count")&&this.pages.set("count",t),this.btnPrev.setDisabled(e<=0),this.btnNext.setDisabled(e>=t-1),this.txtGoToPage.setValue(e+1),this.txtGoToPage.checkValidate()}},onEndDemonstration:function(){this.hide(),this.fullScreenCancel()},toggleFullScreen:function(){!document.fullscreenElement&&!document.msFullscreenElement&&!document.mozFullScreenElement&&!document.webkitFullscreenElement?this.fullScreen(document.documentElement):this.fullScreenCancel()},fullScreen:function(e){if(this.mode.isDesktopApp||Common.Utils.isIE11)return;e&&(e.requestFullscreen?e.requestFullscreen():e.webkitRequestFullscreen?e.webkitRequestFullscreen():e.mozRequestFullScreen?e.mozRequestFullScreen():e.msRequestFullscreen&&e.msRequestFullscreen())},fullScreenCancel:function(){if(this.mode.isDesktopApp||Common.Utils.isIE11)return;document.cancelFullScreen?document.cancelFullScreen():document.webkitCancelFullScreen?document.webkitCancelFullScreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.msExitFullscreen&&document.msExitFullscreen()},txtPrev:"Previous Slide",txtNext:"Next Slide",txtClose:"Close Slideshow",goToSlideText:"Go to Slide",slideIndexText:"Slide {0} of {1}",txtPlay:"Start Presentation",txtPause:"Pause Presentation",txtFinalMessage:"The end of slide preview. Click to exit.",txtPageNumInvalid:"Slide number invalid",txtFullScreen:"Full Screen",txtExitFullScreen:"Exit Full Screen"},PE.Views.DocumentPreview||{}))}),define("text!presentationeditor/main/app/template/Viewport.template",[],function(){return'
\n \n
\n \n
\n
\n
\n
\n \n \n
\n
\n
\n
\n
\n
\n
\n'});if(Common===undefined)var Common={};define("common/main/lib/component/Layout",["backbone"],function(){"use strict";var e=function(e){this.box=null,this.panels=[],this.splitters=[],_.extend(this,e||{})},t=function(){return{width:null,height:null,resize:!1,stretch:!1,rely:!1}};_.extend(e.prototype,Backbone.Events,{initialize:function(e){this.$parent=this.box.parent(),this.resize={eventMove:_.bind(this.resizeMove,this),eventStop:_.bind(this.resizeStop,this)};var n,r,i=!1;e.items.forEach(function(e){e.el instanceof HTMLElement&&(e.el=$(e.el)),n=_.extend(new t,e),n.stretch&&(i=!0,n.rely=!1,n.resize=!1),this.panels.push(n),n.resize&&(r={isresizer:!0,minpos:n.resize.min||0,maxpos:n.resize.max||0,fmin:n.resize.fmin,fmax:n.resize.fmax,behaviour:n.behaviour,index:this.splitters.length},i?(n.resize.el=r.el=n.el.before('
').prev(),this.panels.splice(this.panels.length-1,0,r)):(n.resize.el=r.el=n.el.after('
').next(),this.panels.push(r)),this.splitters.push({resizer:r}),n.resize.hidden&&r.el.hide())},this),this.freeze=e.freeze,this.freeze&&this.freezePanels(this.freeze)},doLayout:function(){},getElementHeight:function(e){return parseInt(e.css("height"))},getElementWidth:function(e){return parseInt(e.css("width"))},onSelectStart:function(e){return e.preventDefault&&e.preventDefault(),!1},addHandler:function(e,t,n){e.addEventListener?e.addEventListener(t,n):e.attachEvent?e.attachEvent("on"+t,n):e["on"+t]=n},removeHandler:function(e,t,n){e.removeEventListener?e.removeEventListener(t,n):e.detachEvent?e.detachEvent("on"+t,n):e["on"+t]=null},clearSelection:function(){if(window.getSelection){var e=window.getSelection();e.empty?e.empty():e.removeAllRanges&&e.removeAllRanges()}else document.selection&&document.selection.empty()},resizeStart:function(e){this.clearSelection(),this.addHandler(window.document,"selectstart",this.onSelectStart),$(document).on({mousemove:this.resize.eventMove,mouseup:this.resize.eventStop}),Common.NotificationCenter.on({"frame:mousemove":this.resize.eventMove,"frame:mouseup":this.resize.eventStop});var t=e.data.panel;this.resize.type=e.data.type,this.resize.$el=t.el,this.resize.min=t.minpos,this.resize.fmin=t.fmin,this.resize.fmax=t.fmax,this.resize.behaviour=t.behaviour,this.resize.$el.addClass("move"),e.data.type=="vertical"?(this.resize.height=parseInt(this.resize.$el.css("height")),this.resize.max=(t.maxpos>0?t.maxpos:this.resize.$el.parent().height()+t.maxpos)-this.resize.height,this.resize.inity=e.pageY*Common.Utils.zoom()-parseInt(e.currentTarget.style.top)):e.data.type=="horizontal"&&(this.resize.width=parseInt(this.resize.$el.css("width")),this.resize.max=(t.maxpos>0?t.maxpos:this.resize.$el.parent().height()+t.maxpos)-this.resize.width,this.resize.initx=e.pageX*Common.Utils.zoom()-parseInt(e.currentTarget.style.left)),Common.NotificationCenter.trigger("layout:resizestart")},resizeMove:function(e){var t=e instanceof jQuery.Event?Common.Utils.zoom():1;if(this.resize.type=="vertical")var n="top",r=e.pageY*t-this.resize.inity;else this.resize.type=="horizontal"&&(n="left",r=e.pageX*t-this.resize.initx);this.resize.fmin&&this.resize.fmax?!(rthis.resize.fmax())&&(this.resize.$el[0].style[n]=r+"px"):!(rthis.resize.max)&&(this.resize.$el[0].style[n]=r+"px")},resizeStop:function(e){this.removeHandler(window.document,"selectstart",this.onSelectStart),$(document).off({mousemove:this.resize.eventMove,mouseup:this.resize.eventStop}),Common.NotificationCenter.off({"frame:mousemove":this.resize.eventMove,"frame:mouseup":this.resize.eventStop});if(!this.resize.$el)return;var t=e instanceof jQuery.Event?Common.Utils.zoom():1;if(this.resize.type=="vertical")var n="height",r=e.pageY*t-this.resize.inity;else this.resize.type=="horizontal"&&(n="width",r=e.pageX*t-this.resize.initx);this.resize.fmin&&this.resize.fmax?(rthis.resize.fmax()&&(r=this.resize.fmax())):(rthis.resize.max&&(r=this.resize.max));var i=null,s=null,o=0;this.resize.$el.hasClass("after")?(i=this.resize.$el.prev(),s=this.resize.$el.next(),o=parseInt(i.css(n))):(i=this.resize.$el.next(),s=this.resize.$el.next(),o=parseInt(i.css(n)),r=i.parent()[n]()-(r+this.resize[n])),this.resize.type=="vertical"&&(r-=i.position().top),this.resize.type=="horizontal"&&(r-=i.position().left),i.css(n,r+"px"),this.resize.behaviour&&s.css(n,parseInt(s.css(n))-(r-o)),this.resize.$el.removeClass("move"),delete this.resize.$el,this.resize.value!=r&&(this.doLayout(),this.trigger("layout:resizedrag",this)),Common.NotificationCenter.trigger("layout:resizestop")},freezePanels:function(e){this.panels.forEach(function(t){!t.stretch&&t.resize&&$(t.resize.el).css("cursor",e?"default":"")}),this.freeze=e},setResizeValue:function(e,t){if(e>=this.splitters.length)return;var n=null,r=null,i=0,s=this.splitters[e].resizer,o="height";ts.fmax()&&(t=s.fmax()),s.el.hasClass("after")?(n=s.el.prev(),r=s.el.next(),i=parseInt(n.css(o))):(n=s.el.next(),t=n.parent()[o]()-(t+s[o]),r=s.el.next(),i=parseInt(n.css(o))),t-=n.position().top,n.css(o,t+"px"),s.behaviour&&r.css(o,parseInt(r.css(o))-(t-i)),s.value!=t&&this.doLayout()}}),!Common.UI&&(Common.UI={}),Common.UI.VBoxLayout=function(t){e.apply(this,arguments),this.initialize.apply(this,arguments)},Common.UI.VBoxLayout.prototype=_.extend(new e,{initialize:function(t){e.prototype.initialize.call(this,t),this.panels.forEach(function(e){!e.stretch&&!e.height&&(e.height=this.getElementHeight(e.el)),e.isresizer&&e.el.on("mousedown",{type:"vertical",panel:e},_.bind(this.resizeStart,this))},this),this.doLayout.call(this)},doLayout:function(){var e=0,t,n;this.panels.forEach(function(r){r.stretch?t=r:(n=r.el.is(":visible"),n&&(e+=r.rely!==!0?r.height:this.getElementHeight(r.el)),r.resize&&r.resize.autohide!==!1&&r.resize.el&&(n?(r.resize.el.show(),t&&(e+=r.resize.height)):(r.resize.el.hide(),t&&(e-=r.resize.height))))},this),t&&(t.height=this.$parent.height()-e),e=0,this.panels.forEach(function(t){t.el.is(":visible")&&(n={top:e},t.rely!==!0&&(n.height=t.height),t.el.css(n),e+=this.getElementHeight(t.el))},this)}}),Common.UI.HBoxLayout=function(t){e.apply(this,arguments),this.initialize.apply(this,arguments)},Common.UI.HBoxLayout.prototype=_.extend(new e,{initialize:function(t){e.prototype.initialize.call(this,t),this.panels.forEach(function(e){!e.stretch&&!e.width&&(e.width=this.getElementWidth(e.el)),e.isresizer&&e.el.on("mousedown",{type:"horizontal",panel:e},_.bind(this.resizeStart,this))},this),this.doLayout.call(this)},doLayout:function(e){var t=0,n,r;this.panels.forEach(function(e){e.stretch?n=e:(r=e.el.is(":visible"),r&&(t+=e.rely!==!0?e.width:this.getElementWidth(e.el)),e.resize&&e.resize.autohide!==!1&&e.resize.el&&(r?(e.resize.el.show(),n&&(t-=e.resize.width)):(e.resize.el.hide(),n&&(t-=e.resize.width))))},this),n&&(n.width=this.$parent.width()-t),t=0,this.panels.forEach(function(e){e.el.is(":visible")&&(r={left:t},e.rely!==!0&&(r.width=e.width),e.el.css(r),t+=this.getElementWidth(e.el))},this)}}),Common.UI.VBoxLayout.prototype.constructor=Common.UI.VBoxLayout,Common.UI.HBoxLayout.prototype.constructor=Common.UI.HBoxLayout}),define("presentationeditor/main/app/view/Viewport",["text!presentationeditor/main/app/template/Viewport.template","jquery","underscore","backbone","common/main/lib/component/BaseView","common/main/lib/component/Layout"],function(e,t,n,r){"use strict";PE.Views.Viewport=r.View.extend({el:"#viewport",template:n.template(e),events:{},initialize:function(){},render:function(){var e=t(this.el);e.html(this.template({})),Common.Utils.isSafari?(t("body").addClass("safari"),t("body").mousewheel(function(e){e.preventDefault(),e.stopPropagation()})):Common.Utils.isChrome&&t("body").addClass("chrome");var n=t("#viewport-vbox-layout",e),r=n.find(" > .layout-item");return this.vlayout=new Common.UI.VBoxLayout({box:n,items:[{el:r[0],rely:!0},{el:r[1],rely:!0},{el:r[2],stretch:!0},{el:r[3],height:25}]}),n=t("#viewport-hbox-layout",e),r=n.find(" > .layout-item"),this.hlayout=new Common.UI.HBoxLayout({box:n,items:[{el:r[0],rely:!0,resize:{hidden:!0,autohide:!1,min:300,max:600}},{el:r[1],stretch:!0},{el:t(r[2]).hide(),rely:!0}]}),this},applyEditorMode:function(){var e=this,t=PE.getController("Toolbar").getView("Toolbar"),n=PE.getController("RightMenu").getView("RightMenu"),r=PE.getController("Statusbar").getView("Statusbar");e._toolbar=t.render(this.mode),e._rightMenu=n.render();var i=Common.localStorage.getItem("pe-hidden-status");i!==null&&parseInt(i)==1&&r.setVisible(!1)},setMode:function(e,t){e.isDisconnected?(n.isUndefined(this.mode)&&(this.mode={}),this.mode.canCoAuthoring=!1):this.mode=e}})}),define("presentationeditor/main/app/controller/Viewport",["core","common/main/lib/view/Header","presentationeditor/main/app/view/DocumentPreview","presentationeditor/main/app/view/Viewport"],function(e){"use strict";PE.Controllers.Viewport=Backbone.Controller.extend({models:[],collections:[],views:["Viewport","Common.Views.Header","DocumentPreview"],initialize:function(){this.addListeners({Viewport:{}})},setApi:function(e){this.api=e},onLaunch:function(){this.viewport=this.createView("Viewport").render(),this.header=this.createView("Common.Views.Header",{headerCaption:"Presentation Editor"}).render(),this.docPreview=this.createView("DocumentPreview",{}).render(),Common.NotificationCenter.on("layout:changed",_.bind(this.onLayoutChanged,this)),$(window).on("resize",_.bind(this.onWindowResize,this));var e=$("#left-menu");this.viewport.hlayout.on("layout:resizedrag",function(){this.api.Resize(),Common.localStorage.setItem("pe-mainmenu-width",e.width())},this)},onLayoutChanged:function(e){switch(e){default:this.viewport.vlayout.doLayout();case"rightmenu":this.viewport.hlayout.doLayout();break;case"leftmenu":var t=this.viewport.hlayout.items[0];t.resize.el&&(t.el.width()>40?t.resize.el.show():t.resize.el.hide()),this.viewport.hlayout.doLayout();break;case"header":case"toolbar":case"status":this.viewport.vlayout.doLayout()}this.api.Resize()},onWindowResize:function(e){this.onLayoutChanged("window"),Common.NotificationCenter.trigger("window:resize")}})});if(Common===undefined)var Common={};Common.Utils===undefined&&(Common.Utils={}),Common.Utils=_.extend(new function(){var e=navigator.userAgent.toLowerCase(),t=function(t){return t.test(e)},n=document.compatMode=="CSS1Compat",r=function(t,n){var r;return t&&(r=n.exec(e))?parseFloat(r[1]):0},i=document.documentMode,s=t(/opera/),o=s&&t(/version\/10\.5/),u=t(/\bchrome\b/),a=t(/webkit/),f=!u&&t(/safari/),l=f&&t(/applewebkit\/4/),c=f&&t(/version\/3/),h=f&&t(/version\/4/),p=f&&t(/version\/5\.0/),d=f&&t(/version\/5/),v=!s&&(t(/msie/)||t(/trident/)),m=v&&(t(/msie 7/)&&i!=8&&i!=9&&i!=10||i==7),g=v&&(t(/msie 8/)&&i!=7&&i!=9&&i!=10||i==8),y=v&&(t(/msie 9/)&&i!=7&&i!=8&&i!=10||i==9),b=v&&(t(/msie 10/)&&i!=7&&i!=8&&i!=9||i==10),w=v&&(t(/trident\/7\.0/)&&i!=7&&i!=8&&i!=9&&i!=10||i==11),E=v&&t(/msie 6/),S=!a&&!v&&t(/gecko/),x=S&&t(/rv:1\.9/),T=S&&t(/rv:2\.0/),N=S&&t(/rv:5\./),C=S&&t(/rv:10\./),k=x&&t(/rv:1\.9\.0/),L=x&&t(/rv:1\.9\.1/),A=x&&t(/rv:1\.9\.2/),O=t(/windows|win32/),M=t(/macintosh|mac os x/),_=t(/linux/),D=r(!0,/\bchrome\/(\d+\.\d+)/),P=r(!0,/\bfirefox\/(\d+\.\d+)/),H=r(v,/msie (\d+\.\d+)/),B=r(s,/version\/(\d+\.\d+)/),j=r(f,/version\/(\d+\.\d+)/),F=r(a,/webkit\/(\d+\.\d+)/),I=/^https/i.test(window.location.protocol),q=/^(mailto:)?([a-z0-9'\._-]+@[a-z0-9\.-]+\.[a-z0-9]{2,4})([a-яё0-9\._%+-=\? :&]*)/i,R=/^(((https?)|(ftps?)):\/\/)?([\-\wа-яё]*:?[\-\wа-яё]*@)?(((1[0-9]{2}|2[0-4][0-9]|25[0-5]|[1-9][0-9]|[0-9])\.){3}(1[0-9]{2}|2[0-4][0-9]|25[0-5]|[1-9][0-9]|[0-9]))(:\d+)?(\/[%\-\wа-яё]*(\.[\wа-яё]{2,})?(([\wа-яё\-\.\?\\\/+@&#;:`~=%!,\(\)]*)(\.[\wа-яё]{2,})?)*)*\/?/i,U=/^(((https?)|(ftps?)):\/\/)?([\-\wа-яё]*:?[\-\wа-яё]*@)?(([\-\wа-яё]+\.)+[\wа-яё\-]{2,}(:\d+)?(\/[%\-\wа-яё]*(\.[\wа-яё]{2,})?(([\wа-яё\-\.\?\\\/+@&#;:`'~=%!,\(\)]*)(\.[\wа-яё]{2,})?)*)*\/?)/i,z=/^(((https?)|(ftps?)):\/\/)([\-\wа-яё]*:?[\-\wа-яё]*@)?(([\-\wа-яё]+)(:\d+)?(\/[%\-\wа-яё]*(\.[\wа-яё]{2,})?(([\wа-яё\-\.\?\\\/+@&#;:`'~=%!,\(\)]*)(\.[\wа-яё]{2,})?)*)*\/?)/i,W=/(mailto:)?([a-z0-9'\._-]+@[a-z0-9\.-]+\.[a-z0-9]{2,4})([a-яё0-9\._%+-=\?:&]*)/ig,X=/(((https?)|(ftps?)):\/\/([\-\wа-яё]*:?[\-\wа-яё]*@)?)(((1[0-9]{2}|2[0-4][0-9]|25[0-5]|[1-9][0-9]|[0-9])\.){3}(1[0-9]{2}|2[0-4][0-9]|25[0-5]|[1-9][0-9]|[0-9]))(:\d+)?(\/[%\-\wа-яё]*(\.[\wа-яё]{2,})?(([\wа-яё\-\.\?\\\/+@&#;:`~=%!,\(\)]*)(\.[\wа-яё]{2,})?)*)*\/?/ig,V=/((((https?)|(ftps?)):\/\/([\-\wа-яё]*:?[\-\wа-яё]*@)?)|(([\-\wа-яё]*:?[\-\wа-яё]*@)?www\.))((([\-\wа-яё]+\.)+[\wа-яё\-]{2,}|([\-\wа-яё]+))(:\d+)?(\/[%\-\wа-яё]*(\.[\wа-яё]{2,})?(([\wа-яё\-\.\?\\\/+@&#;:`~=%!,\(\)]*)(\.[\wа-яё]{2,})?)*)*\/?)/ig,J={Paragraph:0,Table:1,Image:2,Header:3,TextArt:4,Shape:5,Slide:6,Chart:7,MailMerge:8},K=/android|avantgo|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od|ad)|iris|kindle|lge |maemo|midp|mmp|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(navigator.userAgent||navigator.vendor||window.opera),Q=this,G=function(){Q.zoom=1;if(u&&!s&&!K&&document&&document.firstElementChild&&document.body)if(window.devicePixelRatio>.1){if(window.devicePixelRatio<1.99){var e=1;Q.zoom=window.devicePixelRatio/e}else{var e=2;Q.zoom=window.devicePixelRatio/e}document.firstElementChild.style.zoom=1/Q.zoom}else document.firstElementChild.style.zoom="normal";Q.innerWidth=window.innerWidth*Q.zoom,Q.innerHeight=window.innerHeight*Q.zoom};return Q.zoom=1,Q.innerWidth=window.innerWidth,Q.innerHeight=window.innerHeight,G(),$(window).on("resize",G),{userAgent:e,isStrict:n,isIEQuirks:v&&!n&&(E||m||g||y),isOpera:s,isOpera10_5:o,isWebKit:a,isChrome:u,isSafari:f,isSafari3:c,isSafari4:h,isSafari5:d,isSafari5_0:p,isSafari2:l,isIE:v,isIE6:E,isIE7:m,isIE7m:E||m,isIE7p:v&&!E,isIE8:g,isIE8m:E||m||g,isIE8p:v&&!E&&!m,isIE9:y,isIE9m:E||m||g||y,isIE9p:v&&!(E||m||g),isIE10:b,isIE10m:E||m||g||y||b,isIE10p:v&&!(E||m||g||y),isIE11:w,isIE11m:E||m||g||y||b||w,isIE11p:v&&!(E||m||g||y||b),isGecko:S,isGecko3:x,isGecko4:T,isGecko5:N,isGecko10:C,isFF3_0:k,isFF3_5:L,isFF3_6:A,isFF4:4<=P&&P<5,isFF5:5<=P&&P<6,isFF10:10<=P&&P<11,isLinux:_,isWindows:O,isMac:M,chromeVersion:D,firefoxVersion:P,ieVersion:H,operaVersion:B,safariVersion:j,webKitVersion:F,isSecure:I,emailRe:q,ipRe:R,hostnameRe:U,localRe:z,emailStrongRe:W,ipStrongRe:X,hostnameStrongRe:V,documentSettingsType:J,zoom:function(){return Q.zoom},innerWidth:function(){return Q.innerWidth},innerHeight:function(){return Q.innerHeight}}},Common.Utils||{}),Common.Utils.ThemeColor=new function(){return{ThemeValues:[6,15,7,16,0,1,2,3,4,5],setColors:function(e,t){var n,r,i;if(t&&t.length>0){var s=[];for(n=0;n>16),n.put_g((t&65280)>>8),n.put_b(t&255),n.put_a(255),e.effectId!==undefined&&n.put_value(e.effectId),n},colorValue2EffectId:function(e){if(typeof e=="object"&&e.effectValue!==undefined&&this.effectcolors)for(var t=0;t255?255:t,n=n<0||isNaN(n)?0:n>255?255:n,r=r<0||isNaN(r)?0:r>255?255:r;var l=function(e){return t==e.r&&n==e.g&&r==e.b},c=function(){return"rgb("+t+", "+n+", "+r+")"},h=function(e){return e===undefined&&(e=1),"rgba("+t+", "+n+", "+r+", "+e+")"},p=function(){var e=t.toString(16),i=n.toString(16),s=r.toString(16);return e.length==1&&(e="0"+e),i.length==1&&(i="0"+i),s.length==1&&(s="0"+s),"#"+e+i+s},d=function(){var e={h:0,s:0,b:0},i=Math.min(t,n,r),s=Math.max(t,n,r),o=s-i;return e.b=s,e.s=s!=0?255*o/s:0,e.s!=0?t==s?e.h=0+(n-r)/o:n==s?e.h=2+(r-t)/o:e.h=4+(t-n)/o:e.h=0,e.h*=60,e.h<0&&(e.h+=360),e.s*=100/255,e.b*=100/255,e.h=parseInt(e.h),e.s=parseInt(e.s),e.b=parseInt(e.b),e};return{r:t,g:n,b:r,isEqual:l,toRGB:c,toRGBA:h,toHex:p,toHSB:d}},Common.Utils.String=new function(){return{format:function(e){var t=_.toArray(arguments).slice(1);return e.replace(/\{(\d+)\}/g,function(e,n){return t[n]})},htmlEncode:function(e){return _.escape(e)},htmlDecode:function(e){return _.unescape(e)},ellipsis:function(e,t,n){if(e&&e.length>t){if(n){var r=e.substr(0,t-2),i=Math.max(r.lastIndexOf(" "),r.lastIndexOf("."),r.lastIndexOf("!"),r.lastIndexOf("?"));if(i!==-1&&i>=t-15)return r.substr(0,i)+"..."}return e.substr(0,t-3)+"..."}return e},platformKey:function(e,t,n){return _.isEmpty(t)&&(t=" ({0})"),Common.Utils.isMac?(_.isFunction(n)&&(e=n.call(this,e)),Common.Utils.String.format(t,e.replace(/\+(?=\S)/g,"").replace(/Ctrl|ctrl/g,"⌘").replace(/Alt|alt/g,"⌥").replace(/Shift|shift/g,"⇧"))):Common.Utils.String.format(t,e)}}},Common.Utils.isBrowserSupported=function(){return!(Common.Utils.ieVersion!=0&&Common.Utils.ieVersion<9||Common.Utils.safariVersion!=0&&Common.Utils.safariVersion<5||Common.Utils.firefoxVersion!=0&&Common.Utils.firefoxVersion<4||Common.Utils.chromeVersion!=0&&Common.Utils.chromeVersion<7||Common.Utils.operaVersion!=0&&Common.Utils.operaVersion<10.5)},Common.Utils.showBrowserRestriction=function(){var e=window.DE?"Document":window.SSE?"Spreadsheet":window.PE?"Presentation":"that",t=document.createElement("div");t.innerHTML='
Your browser is not supported.
Sorry, '+e+" Editor is currently only supported in the latest versions of the Chrome, Firefox, Safari or Internet Explorer web browsers.
"+"
"+"
"+'
'+"
",document.body.appendChild(t),$("#loading-mask").hide().remove(),$("#viewport").hide().remove()},Common.Utils.applyCustomization=function(e,t){for(var n in e){var r;if(!!t[n]){r=$(t[n]);if(r.length){var i=e[n];i===!1||i.visible===!1?r.hide():(!i.text||r.text(i.text),i.visible===!1&&r.hide())}}}},Common.Utils.applyCustomizationPlugins=function(plugins){if(!plugins||plugins.length<1)return;var _createXMLHTTPObject=function(){var e;try{e=new ActiveXObject("Msxml2.XMLHTTP")}catch(t){try{e=new ActiveXObject("Microsoft.XMLHTTP")}catch(n){e=!1}}return!e&&typeof XMLHttpRequest!="undefined"&&(e=new XMLHttpRequest),e},_getPluginCode=function(url){if(!url)return"";try{var xhrObj=_createXMLHTTPObject();xhrObj&&url&&(xhrObj.open("GET",url,!1),xhrObj.send(""),xhrObj.status==200&&eval(xhrObj.responseText))}catch(e){}return null};plugins.forEach(function(e){e&&_getPluginCode(e)})},Common.Utils.fillUserInfo=function(e,t,n){var r=e||{};return!r.id&&(r.id="uid-"+Date.now()),_.isEmpty(r.name)?(_.isEmpty(r.firstname)&&_.isEmpty(r.lastname)&&(r.firstname=n),_.isEmpty(r.firstname)?r.fullname=r.lastname:_.isEmpty(r.lastname)?r.fullname=r.firstname:r.fullname=/^ru/.test(t)?r.lastname+" "+r.firstname:r.firstname+" "+r.lastname):r.fullname=r.name,r},String.prototype.strongMatch=function(e){if(e&&e instanceof RegExp){var t=this.toString().match(e);return!!(t&&t.length>0&&t[0].length==this.length)}return!1},define("common/main/lib/util/utils",function(){}),$(document).off("keydown.bs.dropdown.data-api").on("keydown.bs.dropdown.data-api","[data-toggle=dropdown], [role=menu]",onDropDownKeyDown),function(){function n(e){(e.which==1||e.which==undefined)&&clearMenus(/form-control/.test(e.target.className))}var e=$._data($(document).get(0),"events"),t;e&&e.click&&e.click.every(function(e,n,r){return/click/.test(e.type)&&!e.selector&&/bs\..+\.dropdown/.test(e.namespace)&&(t=e.handler),!t}),!t||$(document).off("click.bs.dropdown.data-api",t).on("click.bs.dropdown.data-api",n)}(),define("common/main/lib/extend/Bootstrap",function(){});if(Common===undefined)var Common={};define("common/main/lib/component/ToggleManager",["common/main/lib/component/BaseView"],function(){"use strict";function t(t,n){var r,i,s;if(n){r=e[t.toggleGroup];for(i=0,s=r.length;i tabindex="-1" type="menuitem" <% }; if(!_.isUndefined(options.stopPropagation)) { %> data-stopPropagation="true" <% }; %> >',"<% if (!_.isEmpty(iconCls)) { %>",'',"<% } %>","<%= caption %>",""].join("")),initialize:function(e){Common.UI.BaseView.prototype.initialize.call(this,e);var t=this,n=$(this.el);this.id=t.options.id||Common.UI.getId(),this.cls=t.options.cls,this.style=t.options.style,this.caption=t.options.caption,this.menu=t.options.menu||null,this.checkable=t.options.checkable,this.checked=t.options.checked,t.allowDepress=t.options.allowDepress,this.disabled=t.options.disabled,this.value=t.options.value,this.toggleGroup=t.options.toggleGroup,this.template=t.options.template||this.template,this.iconCls=t.options.iconCls,this.rendered=!1,this.menu!==null&&!(this.menu instanceof Common.UI.Menu)&&(this.menu=new Common.UI.Menu(_.extend({},t.options.menu))),t.options.el&&this.render()},render:function(){var e=this,t=$(this.el);e.trigger("render:before",e);if(e.caption==="--")t.addClass("divider");else if(!this.rendered){t.off("click"),Common.UI.ToggleManager.unregister(e),$(this.el).html(this.template({id:e.id,caption:e.caption,iconCls:e.iconCls,style:e.style,options:e.options})),e.menu&&(t.addClass("dropdown-submenu"),e.menu.render($(this.el)),t.mouseenter(_.bind(e.menu.alignPosition,e.menu)),t.focusout(_.bind(e.onBlurItem,e)),t.hover(_.bind(e.onHoverItem,e),_.bind(e.onUnHoverItem,e)));var n=t.children(":first");this.checkable&&n&&(n.toggleClass("checkable",this.checkable),n.toggleClass("checked",this.checked),_.isEmpty(this.iconCls)||n.css("background-image","none")),this.disabled&&$(this.el).toggleClass("disabled",this.disabled),t.on("click",_.bind(this.onItemClick,this)),t.on("mousedown",_.bind(this.onItemMouseDown,this)),Common.UI.ToggleManager.register(e)}return e.cmpEl=$(this.el),e.rendered=!0,e.trigger("render:after",e),this},setCaption:function(e,t){this.caption=e,this.rendered&&(this.cmpEl.find("a").contents().last()[0].textContent=t?e:Common.Utils.String.htmlEncode(e))},setChecked:function(e,t){this.toggle(e,t)},isChecked:function(){return this.checked},setDisabled:function(e){this.disabled=!!e,this.rendered&&this.cmpEl.toggleClass("disabled",this.disabled)},isDisabled:function(){return this.disabled},toggle:function(e,t){var n=e===undefined?!this.checked:!!e;if(this.checkable){this.checked=n;if(this.rendered){var r=this.cmpEl.children(":first");r&&(r.toggleClass("checked",this.checked),_.isEmpty(this.iconCls)||r.css("background-image","none"))}t||this.trigger("toggle",this,n)}},onItemMouseDown:function(e){if(e.which!=1)return e.preventDefault(),e.stopPropagation(),!1},onItemClick:function(e){if(!(e.which==1||e.which===undefined&&!this.menu))return!1;!this.disabled&&(this.allowDepress||!this.checked||!this.toggleGroup)&&!this.menu&&this.setChecked(!this.checked);if(this.menu){if(e.target.id==this.id)return!1;this.menu.isOver||this.cmpEl.removeClass("over");return}if(!!this.disabled)return!1;this.trigger("click",this,e)},onHoverItem:function(e){this._doHover(e)},onUnHoverItem:function(e){this._doUnHover(e)},onBlurItem:function(e){this._doUnHover(e)},_doHover:function(e){var t=this;t.menu&&!t.disabled&&(clearTimeout(t.hideMenuTimer),t.cmpEl.trigger("show.bs.dropdown"),t.expandMenuTimer=_.delay(function(){t.cmpEl.addClass("over"),t.cmpEl.trigger("shown.bs.dropdown")},200))},_doUnHover:function(e){var t=this;if(t.cmpEl.hasClass("dropdown-submenu")&&t.cmpEl.hasClass("over")&&(e&&e.relatedTarget&&t.cmpEl.find(e.relatedTarget).length>0||t.cmpEl.hasClass("focused-submenu"))){t.cmpEl.removeClass("focused-submenu");return}if(t.menu&&!t.disabled){clearTimeout(t.expandMenuTimer),t.hideMenuTimer=_.delay(function(){t.menu.isOver||t.cmpEl.removeClass("over")},200);if(e&&e.type!=="focusout"){var n=t.cmpEl.children(":focus");n.length>0&&(n.blur(),t.cmpEl.closest("ul").focus())}}}}),Common.UI.MenuItemSeparator=function(e){return e=e||{},e.caption="--",new Common.UI.MenuItem(e)}}),function(e){typeof define=="function"&&define.amd?define("jmousewheel",["jquery"],e):typeof exports=="object"?module.exports=e:e(jQuery)}(function(e){function a(t){var n=t||window.event,o=r.call(arguments,1),u=0,a=0,c=0,h=0;t=e.event.fix(n),t.type="mousewheel","detail"in n&&(c=n.detail*-1),"wheelDelta"in n&&(c=n.wheelDelta),"wheelDeltaY"in n&&(c=n.wheelDeltaY),"wheelDeltaX"in n&&(a=n.wheelDeltaX*-1),"axis"in n&&n.axis===n.HORIZONTAL_AXIS&&(a=c*-1,c=0),u=c===0?a:c,"deltaY"in n&&(c=n.deltaY*-1,u=c),"deltaX"in n&&(a=n.deltaX,c===0&&(u=a*-1));if(c===0&&a===0)return;if(n.deltaMode===1){var p=e.data(this,"mousewheel-line-height");u*=p,c*=p,a*=p}else if(n.deltaMode===2){var d=e.data(this,"mousewheel-page-height");u*=d,c*=d,a*=d}h=Math.max(Math.abs(c),Math.abs(a));if(!s||h=1?"floor":"ceil"](u/s),a=Math[a>=1?"floor":"ceil"](a/s),c=Math[c>=1?"floor":"ceil"](c/s),t.deltaX=a,t.deltaY=c,t.deltaFactor=s,t.deltaMode=0,o.unshift(t,u,a,c),i&&clearTimeout(i),i=setTimeout(f,200),(e.event.dispatch||e.event.handle).apply(this,o)}function f(){s=null}function l(e,t){return u.settings.adjustOldDeltas&&e.type==="mousewheel"&&t%120===0}var t=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],n="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],r=Array.prototype.slice,i,s;if(e.event.fixHooks)for(var o=t.length;o;)e.event.fixHooks[t[--o]]=e.event.mouseHooks;var u=e.event.special.mousewheel={version:"3.1.9",setup:function(){if(this.addEventListener)for(var t=n.length;t;)this.addEventListener(n[--t],a,!1);else this.onmousewheel=a;e.data(this,"mousewheel-line-height",u.getLineHeight(this)),e.data(this,"mousewheel-page-height",u.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var e=n.length;e;)this.removeEventListener(n[--e],a,!1);else this.onmousewheel=null},getLineHeight:function(t){return parseInt(e(t)["offsetParent"in e.fn?"offsetParent":"parent"]().css("fontSize"),10)},getPageHeight:function(t){return e(t).height()},settings:{adjustOldDeltas:!0}};e.fn.extend({mousewheel:function(e){return e?this.bind("mousewheel",e):this.trigger("mousewheel")},unmousewheel:function(e){return this.unbind("mousewheel",e)}})}),function(e){"use strict";typeof define=="function"&&define.amd?define("perfectscrollbar",["jquery"],e):typeof exports=="object"?e(require("jquery")):e(jQuery)}(function(e){"use strict";var t={wheelSpeed:10,wheelPropagation:!1,minScrollbarLength:null,useBothWheelAxes:!1,useKeyboard:!0,suppressScrollX:!1,suppressScrollY:!1,scrollXMarginOffset:0,scrollYMarginOffset:0,includePadding:!1,includeMargin:!0},n=function(){var e=0;return function(){var t=e;return e+=1,".perfect-scrollbar-"+t}}();e.fn.perfectScrollbar=function(r,i){return this.each(function(){var s=e.extend(!0,{},t),o=e(this);typeof r=="object"?e.extend(!0,s,r):i=r;if(i==="update")return o.data("perfect-scrollbar-update")&&o.data("perfect-scrollbar-update")(),o;if(i==="destroy")return o.data("perfect-scrollbar-destroy")&&o.data("perfect-scrollbar-destroy")(),o;if(o.data("perfect-scrollbar"))return o.data("perfect-scrollbar");o.addClass("ps-container");var u=e("
").appendTo(o),a=e("
").appendTo(o),f=e("
").appendTo(u),l=e("
").appendTo(a),c,h,p,d,v,m,g,y,b=parseInt(u.css("bottom"),10),w,E,S=parseInt(a.css("right"),10),x,T=n(),N=function(e,t){var n=e+t,r=x-w;n<0?E=0:n>r?E=r:E=n;var i=parseInt(E*(m-d)/(x-w),10);o.scrollTop(i),u.css({bottom:b-i})},C=function(e,t){var n=e+t,r=p-g;n<0?y=0:n>r?y=r:y=n;var i=parseInt(y*(v-p)/(p-g),10);o.scrollLeft(i),a.css({right:S-i})},k=function(e){return s.minScrollbarLength&&(e=Math.max(e,s.minScrollbarLength)),e},L=function(){u.css({left:o.scrollLeft(),bottom:b-o.scrollTop(),width:p,display:c?"inherit":"none"}),a.hasClass("in-scrolling")?a.css({right:S-o.scrollLeft(),height:x,display:h?"inherit":"none"}):a.css({top:o.scrollTop(),right:S-o.scrollLeft(),height:x,display:h?"inherit":"none"}),f.css({left:y,width:g}),l.css({top:E,height:w})},A=function(){p=s.includePadding?o.innerWidth():o.width(),d=s.includePadding?o.innerHeight():o.height(),x=d-(s.includeMargin?parseInt(a.css("margin-top"))+parseInt(a.css("margin-bottom")):0),v=o.prop("scrollWidth"),m=o.prop("scrollHeight"),!s.suppressScrollX&&p+s.scrollXMarginOffset=x-w&&(E=x-w),y>=p-g&&(y=p-g),L(),s.onChange&&s.onChange(this)},O=function(){var t,n;f.bind("mousedown"+T,function(e){n=e.pageX,t=f.position().left,u.addClass("in-scrolling"),e.stopPropagation(),e.preventDefault()}),e(document).bind("mousemove"+T,function(e){u.hasClass("in-scrolling")&&(C(t,e.pageX-n),e.stopPropagation(),e.preventDefault())}),e(document).bind("mouseup"+T,function(e){u.hasClass("in-scrolling")&&u.removeClass("in-scrolling")}),t=n=null},M=function(){var t,n;l.bind("mousedown"+T,function(e){n=e.pageY,t=l.position().top,a.addClass("in-scrolling");var r=parseInt(a.css("margin-top")),i=a[0].getBoundingClientRect();a.css({position:"fixed",left:i.left,top:i.top-r}),e.stopPropagation(),e.preventDefault()}),e(document).bind("mousemove"+T,function(e){a.hasClass("in-scrolling")&&(N(t,e.pageY-n),e.stopPropagation(),e.preventDefault())}),e(document).bind("mouseup"+T,function(e){a.hasClass("in-scrolling")&&(a.removeClass("in-scrolling"),a.css({position:"",left:"",top:""}),L())}),t=n=null},_=function(e,t){var n=o.scrollTop();if(e===0){if(!h)return!1;if(n===0&&t>0||n>=m-d&&t<0)return!s.wheelPropagation}var r=o.scrollLeft();if(t===0){if(!c)return!1;if(r===0&&e<0||r>=v-p&&e>0)return!s.wheelPropagation}return!0},D=function(){s.wheelSpeed/=10;var t=!1;o.bind("mousewheel"+T,function(n,r,i,u){var a=n.deltaX*n.deltaFactor||i,f=n.deltaY*n.deltaFactor||u;if(n&&n.target&&(n.target.type==="textarea"||n.target.type==="input")){n.stopImmediatePropagation(),n.preventDefault();var l=e(n.target).scrollTop(),p=0;n.originalEvent?n.originalEvent.wheelDelta?p=n.originalEvent.wheelDelta:n.originalEvent.deltaY?p=-n.originalEvent.deltaY*40:n.originalEvent.detail&&(p=n.originalEvent.detail):p=n.wheelDelta!==undefined?n.wheelDelta:n.deltaY,e(n.target).scrollTop(l-p);return}t=!1,s.useBothWheelAxes?h&&!c?(f?o.scrollTop(o.scrollTop()-f*s.wheelSpeed):o.scrollTop(o.scrollTop()+a*s.wheelSpeed),t=!0):c&&!h&&(a?o.scrollLeft(o.scrollLeft()+a*s.wheelSpeed):o.scrollLeft(o.scrollLeft()-f*s.wheelSpeed),t=!0):(o.scrollTop(o.scrollTop()-f*s.wheelSpeed),o.scrollLeft(o.scrollLeft()+a*s.wheelSpeed)),A(),t=t||_(a,f),t&&(n.stopPropagation(),n.preventDefault())}),o.bind("MozMousePixelScroll"+T,function(e){t&&e.preventDefault()})},P=function(){var t=!1;o.bind("mouseenter"+T,function(e){t=!0}),o.bind("mouseleave"+T,function(e){t=!1});var n=!1;e(document).bind("keydown"+T,function(r){if(!t||e(document.activeElement).is(":input,[contenteditable]"))return;var i=0,s=0;switch(r.which){case 37:i=-30;break;case 38:s=30;break;case 39:i=30;break;case 40:s=-30;break;case 33:s=90;break;case 32:case 34:s=-90;break;case 35:s=-d;break;case 36:s=d;break;default:return}o.scrollTop(o.scrollTop()-s),o.scrollLeft(o.scrollLeft()+i),n=_(i,s),n&&r.preventDefault()})},H=function(){var e=function(e){e.stopPropagation()};l.bind("click"+T,e),a.bind("click"+T,function(e){var t=parseInt(w/2,10),n=e.pageY-a.offset().top-t,r=x-w,i=n/r;i<0?i=0:i>1&&(i=1),o.scrollTop((m-d)*i)}),f.bind("click"+T,e),u.bind("click"+T,function(e){var t=parseInt(g/2,10),n=e.pageX-u.offset().left-t,r=p-g,i=n/r;i<0?i=0:i>1&&(i=1),o.scrollLeft((v-p)*i)})},B=function(){var t=function(e,t){o.scrollTop(o.scrollTop()-t),o.scrollLeft(o.scrollLeft()-e),A()},n={},r=0,i={},s=null,u=!1;e(window).bind("touchstart"+T,function(e){u=!0}),e(window).bind("touchend"+T,function(e){u=!1}),o.bind("touchstart"+T,function(e){var t=e.originalEvent.targetTouches[0];n.pageX=t.pageX,n.pageY=t.pageY,r=(new Date).getTime(),s!==null&&clearInterval(s),e.stopPropagation()}),o.bind("touchmove"+T,function(e){if(!u&&e.originalEvent.targetTouches.length===1){var s=e.originalEvent.targetTouches[0],o={};o.pageX=s.pageX,o.pageY=s.pageY;var a=o.pageX-n.pageX,f=o.pageY-n.pageY;t(a,f),n=o;var l=(new Date).getTime(),c=l-r;c>0&&(i.x=a/c,i.y=f/c,r=l),e.preventDefault()}}),o.bind("touchend"+T,function(e){clearInterval(s),s=setInterval(function(){if(Math.abs(i.x)<.01&&Math.abs(i.y)<.01){clearInterval(s);return}t(i.x*30,i.y*30),i.x*=.8,i.y*=.8},10)})},j=function(){o.bind("scroll"+T,function(e){A()})},F=function(){o.unbind(T),e(window).unbind(T),e(document).unbind(T),o.data("perfect-scrollbar",null),o.data("perfect-scrollbar-update",null),o.data("perfect-scrollbar-destroy",null),f.remove(),l.remove(),u.remove(),a.remove(),f=l=p=d=v=m=g=y=b=w=E=S=null},I=function(t){o.addClass("ie").addClass("ie"+t);var n=function(){var t=function(){e(this).addClass("hover")},n=function(){e(this).removeClass("hover")};o.bind("mouseenter"+T,t).bind("mouseleave"+T,n),u.bind("mouseenter"+T,t).bind("mouseleave"+T,n),a.bind("mouseenter"+T,t).bind("mouseleave"+T,n),f.bind("mouseenter"+T,t).bind("mouseleave"+T,n),l.bind("mouseenter"+T,t).bind("mouseleave"+T,n)},r=function(){L=function(){f.css({left:y+o.scrollLeft(),bottom:b,width:g}),l.css({top:E+o.scrollTop(),right:S,height:w}),f.hide().show(),l.hide().show()}};t===6&&(n(),r())},q="ontouchstart"in window||window.DocumentTouch&&document instanceof window.DocumentTouch,R=function(){var e=navigator.userAgent.toLowerCase().match(/(msie) ([\w.]+)/);e&&e[1]==="msie"&&I(parseInt(e[2],10)),A(),j(),O(),M(),H(),q&&B(),o.mousewheel&&D(),s.useKeyboard&&P(),o.data("perfect-scrollbar",o),o.data("perfect-scrollbar-update",A),o.data("perfect-scrollbar-destroy",F)};return R(),o})}});if(Common===undefined)var Common={};define("common/main/lib/component/Scroller",["jmousewheel","perfectscrollbar","common/main/lib/component/BaseView"],function(){"use strict";Common.UI.Scroller=function(){var e;return _.extend(Common.UI.BaseView.extend({options:{wheelSpeed:20,wheelPropagation:!1,minScrollbarLength:null,useBothWheelAxes:!1,useKeyboard:!0,suppressScrollX:!1,suppressScrollY:!1,scrollXMarginOffset:5,scrollYMarginOffset:5,includePadding:!0,includeMargin:!0,alwaysVisibleX:!1,alwaysVisibleY:!1},initialize:function(e){Common.UI.BaseView.prototype.initialize.call(this,e),this.options.el&&this.render()},render:function(){var e=this;return e.cmpEl=$(this.el),e.rendered||(e.cmpEl.perfectScrollbar(_.extend({},e.options)),e.rendered=!0,this.setAlwaysVisibleX(e.options.alwaysVisibleX),this.setAlwaysVisibleY(e.options.alwaysVisibleY)),this},remove:function(){this.destroy(),Backbone.View.prototype.remove.call(this)},update:function(t){var n=this.options;t?(this.destroy(),n=_.extend(this.options,t),this.cmpEl.perfectScrollbar(n)):this.cmpEl.perfectScrollbar("update"),this.setAlwaysVisibleX(n.alwaysVisibleX),this.setAlwaysVisibleY(n.alwaysVisibleY);var r=function(t){e=!0;var n=function(t){$(document).unbind("mouseup",n),_.delay(function(){e=!1},10)};$(document).mouseup(n)};$(".ps-scrollbar-x-rail, .ps-scrollbar-y-rail, .ps-scrollbar-x, .ps-scrollbar-y",this.cmpEl).off("mousedown",r).on("mousedown",r)},destroy:function(){this.cmpEl.perfectScrollbar("destroy")},scrollLeft:function(e){this.cmpEl.scrollLeft(e),this.update()},scrollTop:function(e){this.cmpEl.scrollTop(e),this.update()},getScrollTop:function(){return this.cmpEl.scrollTop()},getScrollLeft:function(){return this.cmpEl.scrollLeft()},setAlwaysVisibleX:function(e){e?($(this.el).find(".ps-scrollbar-x-rail").addClass("always-visible-x"),$(this.el).find(".ps-scrollbar-x").addClass("always-visible-x")):($(this.el).find(".ps-scrollbar-x-rail").removeClass("always-visible-x"),$(this.el).find(".ps-scrollbar-x").addClass("always-visible-x"))},setAlwaysVisibleY:function(e){e?($(this.el).find(".ps-scrollbar-y-rail").addClass("always-visible-y"),$(this.el).find(".ps-scrollbar-y").addClass("always-visible-y")):($(this.el).find(".ps-scrollbar-y-rail").removeClass("always-visible-y"),$(this.el).find(".ps-scrollbar-y").addClass("always-visible-y"))}}),{isMouseCapture:function(){return e}})}()});if(Common===undefined)var Common={};define("common/main/lib/component/Menu",["common/main/lib/extend/Bootstrap","common/main/lib/component/BaseView","common/main/lib/component/MenuItem","common/main/lib/component/Scroller"],function(){"use strict";Common.UI.Menu=function(){var e=function(){var e=[],t={};return{register:function(n){t[n.id]=n,n.on("show:after",function(t){e.push(t)}).on("hide:after",function(t){var n=e.indexOf(t);n>-1&&e.splice(n,1)})},unregister:function(n){var r=e.indexOf(n);delete t[n.id],r>-1&&e.splice(r,1),n.off("show:after").off("hide:after")},hideAll:function(){return Common.NotificationCenter.trigger("menumanager:hideall"),e&&e.length>0?(_.each(e,function(e){e&&e.hide()}),!0):!1}}}();return _.extend(Common.UI.BaseView.extend({options:{cls:"",style:"",itemTemplate:null,items:[],menuAlign:"tl-bl",menuAlignEl:null,offset:[0,0],cyclic:!0},template:_.template([''].join("")),initialize:function(t){Common.UI.BaseView.prototype.initialize.call(this,t);var n=this;this.id=this.options.id||Common.UI.getId(),this.itemTemplate=this.options.itemTemplate||Common.UI.MenuItem.prototype.template,this.rendered=!1,this.items=[],this.offset=[0,0],this.menuAlign=this.options.menuAlign,this.menuAlignEl=this.options.menuAlignEl,this.options.cyclic||(this.options.cls+=" no-cyclic"),_.each(this.options.items,function(e){e instanceof Common.UI.MenuItem?n.items.push(e):n.items.push(new Common.UI.MenuItem(_.extend({tagName:"li",template:n.itemTemplate},e)))}),this.options.el&&this.render(),e.register(this)},remove:function(){e.unregister(this),Common.UI.BaseView.prototype.remove.call(this)},render:function(e){var t=this;this.trigger("render:before",this),this.cmpEl=$(this.el),e?(this.setElement(e,!1),t.rendered||(this.cmpEl=$(this.template({options:t.options})),e.append(this.cmpEl))):t.rendered||(this.cmpEl=this.template({options:t.options}),$(this.el).append(this.cmpEl));var n=this.cmpEl.parent(),r=n.attr("role")==="menu"?n:n.find("[role=menu]");return r&&(t.rendered||_.each(t.items||[],function(e){r.append(e.render().el),e.on("click",_.bind(t.onItemClick,t)),e.on("toggle",_.bind(t.onItemToggle,t))}),r.css({"max-height":t.options.maxHeight||"none",position:"fixed",right:"auto",left:-1e3,top:-1e3}),this.parentEl=r.parent(),this.parentEl.on("show.bs.dropdown",_.bind(t.onBeforeShowMenu,t)),this.parentEl.on("shown.bs.dropdown",_.bind(t.onAfterShowMenu,t)),this.parentEl.on("hide.bs.dropdown",_.bind(t.onBeforeHideMenu,t)),this.parentEl.on("hidden.bs.dropdown",_.bind(t.onAfterHideMenu,t)),this.parentEl.on("keydown.after.bs.dropdown",_.bind(t.onAfterKeydownMenu,t)),r.on("scroll",_.bind(t.onScroll,t)),r.hover(function(e){t.isOver=!0},function(e){t.isOver=!1})),this.rendered=!0,this.trigger("render:after",this),this},isVisible:function(){return this.rendered&&this.cmpEl.is(":visible")},show:function(){this.rendered&&this.parentEl&&!this.parentEl.hasClass("open")&&this.cmpEl.dropdown("toggle")},hide:function(){this.rendered&&this.parentEl&&(this.parentEl.hasClass("open")?this.cmpEl.dropdown("toggle"):this.parentEl.hasClass("over")&&this.parentEl.removeClass("over"))},insertItem:function(e,t){var n=this,r=this.cmpEl;t instanceof Common.UI.MenuItem||(t=new Common.UI.MenuItem(_.extend({tagName:"li",template:n.itemTemplate},t))),e<0||e>=n.items.length?n.items.push(t):n.items.splice(e,0,t);if(this.rendered){var i=r.attr("role")==="menu"?r:r.find("[role=menu]");i&&(e<0?i.append(t.render().el):e===0?i.prepend(t.render().el):$("li:nth-child("+(e+1)+")",i).before(t.render().el),t.on("click",_.bind(n.onItemClick,n)),t.on("toggle",_.bind(n.onItemToggle,n)))}},doLayout:function(){if(this.options.maxHeight>0){if(!this.rendered){this.mustLayout=!0;return}var e=this,t=this.cmpEl,n=t.attr("role")==="menu"?t:t.find("[role=menu]");if(!n.is(":visible")){var r=[n.css("left"),n.css("top")];n.css({left:"-1000px",top:"-1000px",display:"block"})}var i=n.find("li");if(i.height()*i.length>this.options.maxHeight){var s='';n.prepend(s),s='',n.append(s),n.css({"box-shadow":"none","overflow-y":"hidden","padding-top":"18px"}),n.find("> li:last-of-type").css("margin-bottom",18);var o=function(e,t,n){e.addEventListener?e.addEventListener(t,n,!1):e.attachEvent("on"+t,n)},u=/Firefox/i.test(navigator.userAgent)?"DOMMouseScroll":"mousewheel";o(n[0],u,_.bind(this.onMouseWheel,this)),n.find(".menu-scroll").on("click",_.bind(this.onScrollClick,this))}r&&n.css({display:"",left:r[0],top:r[1]})}},addItem:function(e){this.insertItem(-1,e)},removeItem:function(e){var t=this,n=t.items.indexOf(e);n>-1&&(t.items.splice(n,1),e.off("click").off("toggle"),e.remove())},removeItems:function(e,t){if(e>this.items.length-1)return;e+t>this.items.length&&(t=this.items.length-e);for(var n=e;n ul > .menu-scroll").length){var t=this.$el.find("li .checked")[0];if(t){var n=t.offsetTop-this.options.maxHeight/2;this.scrollMenu(n<0?0:n)}}},onBeforeHideMenu:function(e){this.trigger("hide:before",this,e),Common.UI.Scroller.isMouseCapture()&&e.preventDefault()},onAfterHideMenu:function(e,t){this.trigger("hide:after",this,e,t),Common.NotificationCenter.trigger("menu:hide",this,t)},onAfterKeydownMenu:function(e){if(e.keyCode==Common.UI.Keys.RETURN){var t=$(e.target).closest("li");t.length<=0&&(t=$(e.target).parent().find("li .dataview")),t.length>0&&t.click(),t.hasClass("dropdown-submenu")||Common.UI.Menu.Manager.hideAll(),$(e.currentTarget).closest("li").hasClass("dropdown-submenu")&&e.stopPropagation()}else e.keyCode==Common.UI.Keys.UP||e.keyCode==Common.UI.Keys.DOWN?this.fromKeyDown=!0:e.keyCode==Common.UI.Keys.ESC},onScroll:function(e,t){if(this.fromKeyDown){var n=this.cmpEl.attr("role")==="menu"?this.cmpEl:this.cmpEl.find("[role=menu]");n.find(".menu-scroll.top").css("top",n.scrollTop()+"px"),n.find(".menu-scroll.bottom").css("bottom",-n.scrollTop()+"px")}},onItemClick:function(e,t){e.menu||(this.isOver=!1);if(e.options.stopPropagation){t.stopPropagation();var n=this;_.delay(function(){n.$el.parent().parent().find("[data-toggle=dropdown]").focus()},10);return}this.trigger("item:click",this,e,t)},onItemToggle:function(e,t,n){this.trigger("item:toggle",this,e,t,n)},onScrollClick:function(e){return this.scrollMenu(/top/.test(e.currentTarget.className)),!1},onMouseWheel:function(e){this.scrollMenu((e.detail&&-e.detail||e.wheelDelta)>0)},scrollMenu:function(e){this.fromKeyDown=!1;var t=this.cmpEl.attr("role")==="menu"?this.cmpEl:this.cmpEl.find("[role=menu]"),n=typeof e=="boolean"?t.scrollTop()+(e?-20:20):e;t.scrollTop(n),t.find(".menu-scroll.top").css("top",t.scrollTop()+"px"),t.find(".menu-scroll.bottom").css("bottom",-t.scrollTop()+"px")},setOffset:function(e,t){this.offset[0]=_.isUndefined(e)?this.offset[0]:e,this.offset[1]=_.isUndefined(t)?this.offset[1]:t,this.alignPosition()},getOffset:function(){return this.offset},alignPosition:function(){var e=this.cmpEl.attr("role")==="menu"?this.cmpEl:this.cmpEl.find("[role=menu]"),t=this.menuAlignEl||e.parent(),n=this.menuAlign.match(/^([a-z]+)-([a-z]+)/),r=t.offset(),i=Common.Utils.innerWidth(),s=Common.Utils.innerHeight()-10,o=e.outerWidth(),u=e.outerHeight(),a=t.outerWidth(),f=t.outerHeight(),l={tl:[0,0],bl:[0,u],tr:[o,0],br:[o,u]},c={tl:[0,0],tr:[a,0],bl:[0,f],br:[a,f]},h=r.left-l[n[1]][0]+c[n[2]][0]+this.offset[0],p=r.top-l[n[1]][1]+c[n[2]][1]+this.offset[1];h+o>i&&(t.is("li.dropdown-submenu")?h=r.left-o+2:h=i-o),p+u>s&&(p=s-u),p<0&&(p=0),this.options.additionalAlign?this.options.additionalAlign.call(this,e,h,p):e.css({left:h,top:p})}}),{Manager:function(){return e}()})}()});if(Common===undefined)var Common={};define("common/main/lib/view/CopyWarningDialog",["common/main/lib/component/Window"],function(){"use strict";Common.Views.CopyWarningDialog=Common.UI.Window.extend(_.extend({options:{width:500,height:325,cls:"modal-dlg copy-warning"},initialize:function(e){_.extend(this.options,{title:this.textTitle},e||{}),this.template=['
','

'+this.textMsg+"

",'
',"
",'

'+Common.Utils.String.platformKey("Ctrl+C","{0}")+"

",'

'+this.textToCopy+"

","
","
",'

'+Common.Utils.String.platformKey("Ctrl+X","{0}")+"

",'

'+this.textToCut+"

","
","
",'

'+Common.Utils.String.platformKey("Ctrl+V","{0}")+"

",'

'+this.textToPaste+"

","
","
",'
',"
",'
','"].join(""),this.options.tpl=_.template(this.template,this.options),Common.UI.Window.prototype.initialize.call(this,this.options)},render:function(){Common.UI.Window.prototype.render.call(this),this.chDontShow=new Common.UI.CheckBox({el:$("#copy-warning-checkbox"),labelText:this.textDontShow}),this.getChild().find(".btn").on("click",_.bind(this.onBtnClick,this)),this.autoSize()},autoSize:function(){var e=this.getChild(".box"),t=this.getChild(".footer"),n=this.getChild(".header"),r=this.getChild(".body");r.height(parseInt(e.height())+parseInt(t.css("height"))),this.setHeight(parseInt(r.css("height"))+parseInt(n.css("height")))},onBtnClick:function(e){this.options.handler&&this.options.handler.call(this,this.chDontShow.getValue()=="checked"),this.close()},onKeyPress:function(e){e.keyCode==Common.UI.Keys.RETURN&&(this.options.handler&&this.options.handler.call(this,this.chDontShow.getValue()=="checked"),this.close())},getSettings:function(){return this.chDontShow.getValue()=="checked"},textTitle:"Copy, Cut and Paste Actions",textMsg:"Copy, cut and paste actions using the editor toolbar buttons and context menu actions will be performed within this editor tab only.

.To copy or paste to or from applications outside the editor tab use the following keyboard combinations:",textToCopy:"for Copy",textToPaste:"for Paste",textToCut:"for Cut",textDontShow:"Don't show this message again"},Common.Views.CopyWarningDialog||{}))}),function(e){var t=e.fn.tooltip;t.prototype=e.fn.tooltip.Constructor.prototype,e.extend(e.fn.tooltip.Constructor.DEFAULTS,{container:"body",delay:{show:500},arrow:!1});var n=function(e,t){this.init("tooltip",e,t)};n.prototype=e.extend({},e.fn.tooltip.Constructor.prototype,{constructor:n,init:function(){t.prototype.init.apply(this,arguments),this.options.placement=="cursor"&&/hover/.exec(this.options.trigger)&&this.$element.on("mousemove.tooltip",this.options.selector,e.proxy(this.mousemove,this)),this.options.zIndex&&this.tip().css("z-index",this.options.zIndex);var n=this;Common.NotificationCenter.on({"layout:changed":function(e){!n.options.hideonclick&&n.tip().is(":visible")&&n.hide()}})},mousemove:function(e){this.targetXY=[e.clientX*Common.Utils.zoom(),e.clientY*Common.Utils.zoom()]},leave:function(e){t.prototype.leave.apply(this,arguments),this.dontShow=undefined},show:function(n){if(this.hasContent()&&this.enabled&&!this.dontShow){if(!this.$element.is(":visible")&&this.$element.closest("[role=menu]").length>0)return;var r=this.tip(),i=typeof this.options.placement=="function"?this.options.placement.call(this,r[0],this.$element[0]):this.options.placement;this.options.arrow===!1&&r.addClass("arrow-free"),this.options.cls&&r.addClass(this.options.cls);var s=/^([a-zA-Z]+)-?([a-zA-Z]*)$/.exec(i);if(!n&&!s[2].length)t.prototype.show.apply(this,arguments);else{var o=e.Event("show.bs.tooltip");this.$element.trigger(o);if(o.isDefaultPrevented())return;this.setContent(),this.options.animation&&r.addClass("fade"),r.detach().css({top:0,left:0,display:"block"}),this.options.container?r.appendTo(this.options.container):r.insertAfter(this.$element);if(typeof n=="object"){var u={top:n[1]+15,left:n[0]+18},a=Common.Utils.innerWidth();u.left+r.width()>a&&(u.left=a-r.width()-30),r.offset(u).addClass("in")}else{var f=this.getPosition(),l=r[0].offsetWidth,c=r[0].offsetHeight;switch(s[1]){case"bottom":u={top:f.top+f.height+10};break;case"top":u={top:f.top-c-10}}switch(s[2]){case"left":u.left=f.left,this.$element.outerWidth()<=18&&(u.left-=4);break;case"right":u.left=f.left+f.width-l,this.$element.outerWidth()<=18&&(u.left+=4)}this.applyPlacement(u,s[1]),this.moveArrow(),r.addClass(s[1]).addClass(s[0])}this.$element.trigger("shown.bs.tooltip")}var h=this;clearTimeout(h.timeout),h.timeout=setTimeout(function(){h.hoverState=="in"&&h.hide(),h.dontShow=!1},5e3)}},moveArrow:function(){var e=this.tip().find(".tooltip-arrow, .arrow"),t=10;switch(this.options.placement){case"top-left":case"bottom-left":e.css("left",t);break;case"top-right":case"bottom-right":e.css("right",t)}},enter:function(t){if(t.type!=="mouseenter")return;var n=e(t.target);if(n.is("[role=menu]")||n.parentsUntil(t.currentTarget,"[role=menu]").length&&t.target!==t.currentTarget||this.tip().is(":visible"))return;var r=t instanceof this.constructor?t:e(t.currentTarget)[this.type](this.getDelegateOptions()).data("bs.tooltip");clearTimeout(r.timeout),r.hoverState="in",!r.options.delay||!r.options.delay.show?r.show():r.timeout=setTimeout(function(){r.hoverState=="in"&&r.show(r.options.placement=="cursor"?r.targetXY:undefined)},r.options.delay.show)},replaceArrow:function(e,n,r){this.options.arrow===!1?this.arrow().hide():t.prototype.replaceArrow.apply(this,arguments)},getCalculatedOffset:function(e,n,r,i){var s=t.prototype.getCalculatedOffset.apply(this,arguments);if(this.options.offset>0||this.options.offset<0)switch(/(bottom|top)/.exec(e)[1]){case"bottom":s.top+=this.options.offset;break;case"top":s.top-=this.options.offset}return s}});var r=e.fn.tooltip;e.fn.tooltip=function(t){return this.each(function(){var r=e(this),i=r.data("bs.tooltip"),s=typeof t=="object"&&t;i||r.data("bs.tooltip",i=new n(this,s)),typeof t=="string"&&i[t]()})},e.fn.tooltip.Constructor=n,e.fn.tooltip.noConflict=function(){return e.fn.tooltip=r,this}}(window.jQuery),define("tip",function(){}),define("common/main/lib/component/Tooltip",["tip","backbone"],function(){"use strict";var e=function(e){this.$element=this.placement=undefined,this.init.call(this,e)};_.extend(e.prototype,Backbone.Events,{init:function(e){this.$element=e.owner instanceof Backbone.View?e.owner.$el:$(e.owner),this.placement=e.placement,this.$element.data("bs.tooltip")&&this.$element.removeData("bs.tooltip"),this.$element.tooltip({title:e.title,trigger:"manual",placement:e.placement,offset:e.offset,cls:e.cls,html:e.html,hideonclick:e.hideonclick});if(e.hideonclick){var t=this.$element.data("bs.tooltip");t&&t.tip().on("click",function(){t.hide()})}this.$element.on("shown.bs.tooltip",_.bind(this.onTipShown,this)),this.$element.on("hidden.bs.tooltip",_.bind(this.onTipHidden,this))},show:function(e){this.getBSTip().show(e)},hide:function(e){this.getBSTip().hide(e)},setTitle:function(e){var t=this.getBSTip();t&&(t.options.title=e)},updateTitle:function(){var e=this.getBSTip();e.$tip.find(".tooltip-inner")[e.options.html?"html":"text"](e.options.title)},getBSTip:function(){return this.$element.data("bs.tooltip")},onTipShown:function(){this.trigger("tooltip:show",this)},onTipHidden:function(){this.trigger("tooltip:hide",this)},isVisible:function(){return this.getBSTip().tip().is(":visible")}}),Common.UI=Common.UI||{},Common.UI.Tooltip=e});if(Common===undefined)var Common={};define("common/main/lib/component/InputField",["common/main/lib/component/BaseView","common/main/lib/component/Tooltip"],function(){"use strict";Common.UI.InputField=Common.UI.BaseView.extend(function(){return{options:{id:null,cls:"",style:"",value:"",type:"text",name:"",validation:null,allowBlank:!0,placeHolder:"",blankError:null,spellcheck:!1,maskExp:"",validateOnChange:!1,validateOnBlur:!0,disabled:!1},template:_.template(['
',"",'',"
"].join("")),initialize:function(e){Common.UI.BaseView.prototype.initialize.call(this,e);var t=this,n=$(this.el);this.id=t.options.id||Common.UI.getId(),this.cls=t.options.cls,this.style=t.options.style,this.value=t.options.value,this.type=t.options.type,this.name=t.options.name,this.validation=t.options.validation,this.allowBlank=t.options.allowBlank,this.placeHolder=t.options.placeHolder,this.template=t.options.template||t.template,this.editable=t.options.editable||!0,this.disabled=t.options.disabled,this.spellcheck=t.options.spellcheck,this.blankError=t.options.blankError||"This field is required",this.validateOnChange=t.options.validateOnChange,this.validateOnBlur=t.options.validateOnBlur,this.maxLength=t.options.maxLength,t.rendered=t.options.rendered||!1,t.options.el&&t.render()},render:function(e){var t=this;t.rendered?this.cmpEl=$(this.el):(this.cmpEl=$(this.template({id:this.id,cls:this.cls,style:this.style,value:this.value,type:this.type,name:this.name,placeHolder:this.placeHolder,spellcheck:this.spellcheck,scope:t})),e?(this.setElement(e,!1),e.html(this.cmpEl)):$(this.el).html(this.cmpEl));if(!t.rendered){var n=this.cmpEl;this._input=this.cmpEl.find("input").andSelf().filter("input"),this.editable&&(this._input.on("blur",_.bind(this.onInputChanged,this)),this._input.on("keypress",_.bind(this.onKeyPress,this)),this._input.on("keyup",_.bind(this.onKeyUp,this)),this.validateOnChange&&this._input.on("input",_.bind(this.onInputChanging,this)),this.maxLength&&this._input.attr("maxlength",this.maxLength)),this.setEditable(this.editable),this.disabled&&this.setDisabled(this.disabled);if(this._input.closest(".asc-window").length>0)var r=function(){var e=n.find(".input-error").data("bs.tooltip");e&&e.tip().remove(),Common.NotificationCenter.off({"modal:close":r})};Common.NotificationCenter.on({"modal:close":r})}return t.rendered=!0,this},_doChange:function(e,t){if(t&&t.synthetic)return;var n=$(e.target).val(),r=this.value;this.trigger("changed:before",this,n,r,e);if(e.isDefaultPrevented())return;this.value=n,this.validateOnBlur&&this.checkValidate(),this.trigger("changed:after",this,n,r,e)},onInputChanged:function(e,t){this._doChange(e,t)},onInputChanging:function(e,t){var n=$(e.target).val(),r=this.value;if(e.isDefaultPrevented())return;this.value=n,this.validateOnBlur&&this.checkValidate(),this.trigger("changing",this,n,r,e)},onKeyPress:function(e){this.trigger("keypress:before",this,e);if(e.isDefaultPrevented())return;if(e.keyCode===Common.UI.Keys.RETURN)this._doChange(e);else if(this.options.maskExp&&!_.isEmpty(this.options.maskExp.source)){var t=String.fromCharCode(e.which);!this.options.maskExp.test(t)&&!e.ctrlKey&&e.keyCode!==Common.UI.Keys.DELETE&&e.keyCode!==Common.UI.Keys.BACKSPACE&&e.keyCode!==Common.UI.Keys.LEFT&&e.keyCode!==Common.UI.Keys.RIGHT&&e.keyCode!==Common.UI.Keys.HOME&&e.keyCode!==Common.UI.Keys.END&&e.keyCode!==Common.UI.Keys.ESC&&e.keyCode!==Common.UI.Keys.INSERT&&(e.preventDefault(),e.stopPropagation())}this.trigger("keypress:after",this,e)},onKeyUp:function(e){this.trigger("keyup:before",this,e);if(e.isDefaultPrevented())return;this.trigger("keyup:after",this,e)},setEditable:function(e){var t=this._input;this.editable=e,e&&t?(t.removeAttr("readonly"),t.removeAttr("data-can-copy")):(t.attr("readonly","readonly"),t.attr("data-can-copy",!1))},isEditable:function(){return this.editable},setDisabled:function(e){this.disabled=e,$(this.el).toggleClass("disabled",e),e?this._input.attr("disabled",!0):this._input.removeAttr("disabled")},isDisabled:function(){return this.disabled},setValue:function(e){this.value=e,this.rendered&&this._input.val(e)},getValue:function(){return this.value},focus:function(){this._input.focus()},checkValidate:function(){var e=this,t=[];!e.allowBlank&&_.isEmpty(e.value)&&t.push(e.blankError);if(_.isFunction(e.validation)){var n=e.validation.call(e,e.value);n!==!0&&(t=_.flatten(t.concat(n)))}if(!_.isEmpty(t)){if(e.cmpEl.hasClass("error")){var r=e.cmpEl.find(".input-error").data("bs.tooltip");return r&&(r.options.title=t.join("\n"),r.setContent()),t}e.cmpEl.addClass("error");var i=e.cmpEl.find(".input-error"),s=i.closest(".asc-window"),r=i.data("bs.tooltip");return r&&r.tip().remove(),i.attr("data-toggle","tooltip"),i.removeData("bs.tooltip"),i.tooltip({title:t.join("\n"),placement:"cursor"}),s.length>0&&i.data("bs.tooltip").tip().css("z-index",parseInt(s.css("z-index"))+10),t}return e.cmpEl.removeClass("error"),!0},showError:function(e){var t=this;if(!_.isEmpty(e)){t.cmpEl.addClass("error");var n=t.cmpEl.find(".input-error"),r=n.closest(".asc-window"),i=n.data("bs.tooltip");i&&i.tip().remove(),n.attr("data-toggle","tooltip"),n.removeData("bs.tooltip"),n.tooltip({title:e.join("\n"),placement:"cursor"}),r.length>0&&n.data("bs.tooltip").tip().css("z-index",parseInt(r.css("z-index"))+10)}else t.cmpEl.removeClass("error")}}}())});if(Common===undefined)var Common={};define("common/main/lib/component/ComboBox",["common/main/lib/component/BaseView","common/main/lib/component/Scroller"],function(){"use strict";Common.UI.ComboBoxModel=Backbone.Model.extend({defaults:function(){return{id:Common.UI.getId(),value:null,displayValue:null}}}),Common.UI.ComboBoxStore=Backbone.Collection.extend({model:Common.UI.ComboBoxModel}),Common.UI.ComboBox=Common.UI.BaseView.extend(function(){return{options:{id:null,cls:"",style:"",hint:!1,editable:!0,disabled:!1,menuCls:"",menuStyle:"",displayField:"displayValue",valueField:"value",scrollAlwaysVisible:!1},template:_.template(['','','','",""].join("")),initialize:function(e){Common.UI.BaseView.prototype.initialize.call(this,e);var t=this,n=$(this.el);this.id=t.options.id||Common.UI.getId(),this.cls=t.options.cls,this.style=t.options.style,this.menuCls=t.options.menuCls,this.menuStyle=t.options.menuStyle,this.template=t.options.template||t.template,this.itemsTemplate=t.options.itemsTemplate,this.hint=t.options.hint,this.editable=t.options.editable,this.disabled=t.options.disabled,this.store=t.options.store||new Common.UI.ComboBoxStore,this.displayField=t.options.displayField,this.valueField=t.options.valueField,this.scrollAlwaysVisible=t.options.scrollAlwaysVisible,t.rendered=t.options.rendered||!1,this.lastValue=null,t.store.add(t.options.data),t.options.el&&t.render()},render:function(e){var t=this;if(!t.rendered){var n=this.store.toJSON();this.cmpEl=$(this.template({id:this.id,cls:this.cls,style:this.style,menuCls:this.menuCls,menuStyle:this.menuStyle,items:n,scope:t})),this.itemsTemplate&&this.cmpEl.find("ul").append($(this.itemsTemplate({items:n,scope:t}))),e?(this.setElement(e,!1),e.html(this.cmpEl)):$(this.el).html(this.cmpEl)}else this.cmpEl=$(this.el);if(!t.rendered){var r=this.cmpEl;this._input=r.find("input"),this._button=r.find(".btn"),r.on("click","a",_.bind(this.itemClicked,this)),r.on("mousedown","a",_.bind(this.itemMouseDown,this)),this.editable?(r.on("change","input",_.bind(this.onInputChanged,this)),r.on("keydown","input",_.bind(this.onInputKeyDown,this)),r.on("focusin","input",_.bind(this.onInputFocusIn,this)),r.on("click",".form-control",_.bind(this.onEditableInputClick,this))):(r.on("click",".form-control",_.bind(this.onInputClick,this)),this._input.attr("readonly","readonly"),this._input.attr("data-can-copy",!1)),t.options.hint&&(r.attr("data-toggle","tooltip"),r.tooltip({title:t.options.hint,placement:t.options.hintAnchor||"cursor"})),r.on("show.bs.dropdown",_.bind(t.onBeforeShowMenu,t)),r.on("shown.bs.dropdown",_.bind(t.onAfterShowMenu,t)),r.on("hide.bs.dropdown",_.bind(t.onBeforeHideMenu,t)),r.on("hidden.bs.dropdown",_.bind(t.onAfterHideMenu,t)),r.on("keydown.after.bs.dropdown",_.bind(t.onAfterKeydownMenu,t)),Common.NotificationCenter.on("menumanager:hideall",_.bind(t.closeMenu,t)),this.setDefaultSelection(),this.listenTo(this.store,"reset",this.onResetItems)}return t.rendered=!0,t.disabled&&t.setDisabled(t.disabled),this},setData:function(e){this.store.reset([]),this.store.add(e),this.setRawValue(""),this.onResetItems()},openMenu:function(e){var t=this;this.scroller||(this.scroller=new Common.UI.Scroller(_.extend({el:$(".dropdown-menu",this.cmpEl),minScrollbarLength:40,scrollYMarginOffset:30,includePadding:!0,alwaysVisibleY:this.scrollAlwaysVisible},this.options.scroller))),_.delay(function(){t.cmpEl.addClass("open")},e||0)},closeMenu:function(){this.cmpEl.removeClass("open")},isMenuOpen:function(){return this.cmpEl.hasClass("open")},onBeforeShowMenu:function(e){this.scroller||(this.scroller=new Common.UI.Scroller(_.extend({el:$(".dropdown-menu",this.cmpEl),minScrollbarLength:40,scrollYMarginOffset:30,includePadding:!0,alwaysVisibleY:this.scrollAlwaysVisible},this.options.scroller))),Common.NotificationCenter.trigger("menu:show"),this.trigger("show:before",this,e);if(this.options.hint){var t=this.cmpEl.data("bs.tooltip");t&&(t.dontShow===undefined&&(t.dontShow=!0),t.hide())}},onAfterShowMenu:function(e){var t=$(this.el).find("ul"),n=t.find("> li.selected");if(n.length){var r=n.position().top,i=n.height(),s=t.height();(r<0||r+i>s)&&t.scrollTop(t.scrollTop()+r+i-s/2)}this.scroller&&this.scroller.update({alwaysVisibleY:this.scrollAlwaysVisible}),this.trigger("show:after",this,e)},onBeforeHideMenu:function(e){this.trigger("hide:before",this,e),Common.UI.Scroller.isMouseCapture()&&e.preventDefault()},onAfterHideMenu:function(e,t){this.cmpEl.find(".dropdown-toggle").blur(),this.trigger("hide:after",this,e,t),Common.NotificationCenter.trigger("menu:hide",this,t)},onAfterKeydownMenu:function(e){if(e.keyCode==Common.UI.Keys.RETURN){$(e.target).click();var t=this;return this.rendered&&(Common.Utils.isIE?this._input.trigger("change",{onkeydown:!0}):this._input.blur()),!1}if(e.keyCode==Common.UI.Keys.ESC&&this.isMenuOpen())return this.closeMenu(),this.onAfterHideMenu(e),!1},onInputKeyDown:function(e){var t=this;e.keyCode==Common.UI.Keys.ESC?(this.closeMenu(),this.onAfterHideMenu(e)):e.keyCode==Common.UI.Keys.UP||e.keyCode==Common.UI.Keys.DOWN?(this.isMenuOpen()||this.openMenu(),_.delay(function(){t._skipInputChange=!0,t.cmpEl.find("ul li:first a").focus()},10)):e.keyCode==Common.UI.Keys.RETURN&&$(e.target).val()===t.lastValue?this._input.trigger("change",{reapply:!0}):t._skipInputChange=!1},onInputFocusIn:function(e){this.trigger("combo:focusin",this,e)},onInputChanged:function(e,t){if(t&&t.synthetic)return;if(this._skipInputChange){this._skipInputChange=!1;return}var n=$(e.target).val(),r={};if(this.lastValue===n&&(!t||!t.reapply)){t&&t.onkeydown&&this.trigger("combo:blur",this,e);return}r[this.valueField]=n,this.trigger("changed:before",this,r,e);if(e.isDefaultPrevented())return;var i;this._selectedItem=this.store.findWhere((i={},i[this.displayField]=n,i)),this._selectedItem&&(r=this._selectedItem.toJSON(),$(".selected",$(this.el)).removeClass("selected"),$("#"+this._selectedItem.get("id"),$(this.el)).addClass("selected")),this.trigger("changed:after",this,r,e)},onInputClick:function(e){this._button&&this._button.dropdown("toggle"),e.preventDefault(),e.stopPropagation()},onEditableInputClick:function(e){if(this.options.hint){var t=this.cmpEl.data("bs.tooltip");t&&(t.dontShow===undefined&&(t.dontShow=!0),t.hide())}this.isMenuOpen()&&e.which==1&&e.stopPropagation()},setDefaultSelection:function(){if(!this.rendered)return;var e=this._input.val(),t;e&&(this._selectedItem=this.store.findWhere((t={},t[this.displayField]=e,t)),this._selectedItem&&($(".selected",$(this.el)).removeClass("selected"),$("#"+this._selectedItem.get("id"),$(this.el)).addClass("selected")))},setDisabled:function(e){this.disabled=e;if(!this.rendered)return;e?this._input.attr("disabled",!0):this._input.removeAttr("disabled"),this.cmpEl.toggleClass("disabled",e),this._button.toggleClass("disabled",e)},isDisabled:function(){return this.disabled},setRawValue:function(e){this.rendered&&(this._input.val(e).trigger("change",{synthetic:!0}),this.lastValue=e!==null&&e!==undefined?e.toString():e)},getRawValue:function(){return this.rendered?this._input.val():null},setValue:function(e,t){if(!this.rendered)return;var n;this._selectedItem=this.store.findWhere((n={},n[this.valueField]=e,n)),$(".selected",$(this.el)).removeClass("selected"),this._selectedItem?(this.setRawValue(this._selectedItem.get(this.displayField)),$("#"+this._selectedItem.get("id"),$(this.el)).addClass("selected")):this.setRawValue(t!==undefined?t:e)},getValue:function(){return this.rendered?this._selectedItem&&!_.isUndefined(this._selectedItem.get(this.valueField))?this._selectedItem.get(this.valueField):this._input.val():null},getDisplayValue:function(e){return Common.Utils.String.htmlEncode(e[this.displayField])},getSelectedRecord:function(){return this.rendered?this._selectedItem&&!_.isUndefined(this._selectedItem.get(this.valueField))?_.extend({},this._selectedItem.toJSON()):null:null},selectRecord:function(e){if(!this.rendered||!e)return;this._selectedItem=e,$(".selected",$(this.el)).removeClass("selected"),this.setRawValue(this._selectedItem.get(this.displayField)),$("#"+this._selectedItem.get("id"),$(this.el)).addClass("selected")},itemClicked:function(e){var t=$(e.target).closest("li");this._selectedItem=this.store.findWhere({id:t.attr("id")}),this._selectedItem&&(this.lastValue=this._selectedItem.get(this.displayField),this._input.val(this.lastValue).trigger("change",{synthetic:!0}),$(".selected",$(this.el)).removeClass("selected"),t.addClass("selected"),this.trigger("selected",this,_.extend({},this._selectedItem.toJSON()),e),e.preventDefault()),this._isMouseDownMenu=!1},itemMouseDown:function(e){if(e.which!=1)return e.preventDefault(),e.stopPropagation(),!1;this._isMouseDownMenu=!0},onResetItems:function(){this.itemsTemplate?$(this.el).find("ul").html($(this.itemsTemplate({items:this.store.toJSON(),scope:this}))):$(this.el).find("ul").html(_.template(["<% _.each(items, function(item) { %>",'
  • <%= scope.getDisplayValue(item) %>
  • ',"<% }); %>"].join(""),{items:this.store.toJSON(),scope:this})),_.isUndefined(this.scroller)||(this.scroller.destroy(),delete this.scroller),this.scroller=new Common.UI.Scroller(_.extend({el:$(".dropdown-menu",this.cmpEl),minScrollbarLength:40,scrollYMarginOffset:30,includePadding:!0,alwaysVisibleY:this.scrollAlwaysVisible},this.options.scroller))}}}())});if(Common===undefined)var Common={};define("common/main/lib/component/RadioBox",["common/main/lib/component/BaseView","underscore"],function(e,t){"use strict";Common.UI.RadioBox=Common.UI.BaseView.extend({options:{labelText:""},disabled:!1,rendered:!1,template:t.template(''),initialize:function(e){Common.UI.BaseView.prototype.initialize.call(this,e);var n=this,r=$(this.el);this.name=this.options.name||Common.UI.getId(),this.render(),this.options.disabled&&this.setDisabled(this.options.disabled),this.options.checked!==undefined&&this.setValue(this.options.checked,!0),this.$radio.on("click",t.bind(this.onItemCheck,this))},render:function(){var e=$(this.el);return e.html(this.template({labelText:this.options.labelText,name:this.name})),this.$radio=e.find("input[type=button]"),this.rendered=!0,this},setDisabled:function(e){e!==this.disabled&&(this.$radio.toggleClass("disabled",e),e?this.$radio.attr({disabled:e}):this.$radio.removeAttr("disabled")),this.disabled=e},isDisabled:function(){return this.disabled},onItemCheck:function(e){this.disabled||this.setValue(!0)},setRawValue:function(e){var e=e===!0||e==="true"||e==="1"||e===1;$("input[type=button][name="+this.name+"]").removeClass("checked"),this.$radio.toggleClass("checked",e)},setValue:function(e,t){if(this.rendered){var n=this.$radio.hasClass("checked");this.setRawValue(e),t!==!0&&n!==e&&this.trigger("change",this,this.$radio.hasClass("checked"))}else this.options.checked=e},getValue:function(){return this.$radio.hasClass("checked")}})});if(Common===undefined)var Common={};var c_oHyperlinkType={InternalLink:0,WebLink:1};define("presentationeditor/main/app/view/HyperlinkSettingsDialog",["common/main/lib/util/utils","common/main/lib/component/InputField","common/main/lib/component/ComboBox","common/main/lib/component/RadioBox","common/main/lib/component/Window"],function(){"use strict";PE.Views.HyperlinkSettingsDialog=Common.UI.Window.extend(_.extend({options:{width:350,style:"min-width: 230px;",cls:"modal-dlg",id:"window-hyperlink-settings"},initialize:function(e){_.extend(this.options,{title:this.textTitle},e||{}),this.template=['
    ','
    ','","
    ",'','",'",'
    ','","
    ",'','
    ','","
    ",'',"
    ",'"].join(""),this.options.tpl=_.template(this.template,this.options),this.slides=this.options.slides,this.api=this.options.api,Common.UI.Window.prototype.initialize.call(this,this.options)},render:function(){Common.UI.Window.prototype.render.call(this);var e=this,t=this.getChild();e._arrTypeSrc=[{displayValue:e.textInternalLink,value:c_oHyperlinkType.InternalLink},{displayValue:e.textExternalLink,value:c_oHyperlinkType.WebLink}],e.cmbLinkType=new Common.UI.ComboBox({el:$("#id-dlg-hyperlink-type"),cls:"input-group-nr",style:"width: 100%;",menuStyle:"min-width: 318px;",editable:!1,data:this._arrTypeSrc}),e.cmbLinkType.setValue(e._arrTypeSrc[1].value),e.cmbLinkType.on("selected",_.bind(function(e,t){this.ShowHideElem(t.value)},e)),e.inputUrl=new Common.UI.InputField({el:$("#id-dlg-hyperlink-url"),allowBlank:!1,blankError:e.txtEmpty,validateOnBlur:!1,style:"width: 100%;",validation:function(t){var n=e.api.asc_getUrlType($.trim(t));return e.isEmail=n==2,n>0?!0:e.txtNotUrl}}),e.inputDisplay=(new Common.UI.InputField({el:$("#id-dlg-hyperlink-display"),allowBlank:!0,validateOnBlur:!1,style:"width: 100%;"})).on("changed:after",function(){e.isTextChanged=!0}),e.inputTip=new Common.UI.InputField({el:$("#id-dlg-hyperlink-tip"),style:"width: 100%;",maxLength:Asc.c_oAscMaxTooltipLength}),e.radioNext=new Common.UI.RadioBox({el:$("#id-dlg-hyperlink-radio-next"),labelText:this.txtNext,name:"asc-radio-slide",checked:!0}),e.radioPrev=new Common.UI.RadioBox({el:$("#id-dlg-hyperlink-radio-prev"),labelText:this.txtPrev,name:"asc-radio-slide"}),e.radioFirst=new Common.UI.RadioBox({el:$("#id-dlg-hyperlink-radio-first"),labelText:this.txtFirst,name:"asc-radio-slide"}),e.radioLast=new Common.UI.RadioBox({el:$("#id-dlg-hyperlink-radio-last"),labelText:this.txtLast,name:"asc-radio-slide"}),e.radioSlide=new Common.UI.RadioBox({el:$("#id-dlg-hyperlink-radio-slide"),labelText:this.txtSlide,name:"asc-radio-slide"}),e.cmbSlides=new Common.UI.ComboBox({el:$("#id-dlg-hyperlink-slide"),cls:"input-group-nr",style:"width: 50px;",menuStyle:"min-width: 50px; max-height: 200px;",editable:!1,data:this.slides}),e.cmbSlides.setValue(0),e.cmbSlides.on("selected",_.bind(function(t,n){e.radioSlide.setValue(!0)},e)),t.find(".dlg-btn").on("click",_.bind(this.onBtnClick,this)),t.find("input").on("keypress",_.bind(this.onKeyPress,this)),e.externalPanel=t.find("#id-external-link"),e.internalPanel=t.find("#id-internal-link")},setSettings:function(e){if(e){var t=this,n=t.parseUrl(e.get_Value());t.cmbLinkType.setValue(n),t.ShowHideElem(n),e.get_Text()!==null?(t.inputDisplay.setValue(e.get_Text()),t.inputDisplay.setDisabled(!1)):(this.inputDisplay.setValue(this.textDefault),this.inputDisplay.setDisabled(!0)),this.isTextChanged=!1,this.inputTip.setValue(e.get_ToolTip()),n==c_oHyperlinkType.WebLink&&t.inputUrl.cmpEl.find("input").focus()}},getSettings:function(){var e=this,t=new Asc.CHyperlinkProperty,n="";if(e.cmbLinkType.getValue()==c_oHyperlinkType.InternalLink){var r="ppaction://hlink",i="",s=e.inputTip.getValue();this.radioSlide.getValue()?(r=r+"sldjumpslide"+this.cmbSlides.getValue(),i=this.txtSlide+" "+(this.cmbSlides.getValue()+1)):this.radioFirst.getValue()?(r+="showjump?jump=firstslide",i=this.txtFirst):this.radioLast.getValue()?(r+="showjump?jump=lastslide",i=this.txtLast):this.radioNext.getValue()?(r+="showjump?jump=nextslide",i=this.txtNext):this.radioPrev.getValue()&&(r+="showjump?jump=previousslide",i=this.txtPrev),t.put_Value(r),t.put_ToolTip(_.isEmpty(s)?i:s),n=i}else{var r=$.trim(e.inputUrl.getValue());/(((^https?)|(^ftp)):\/\/)|(^mailto:)/i.test(r)||(r=(e.isEmail?"mailto:":"http://")+r),r=r.replace(new RegExp("%20","g")," "),t.put_Value(r),t.put_ToolTip(e.inputTip.getValue()),n=r}return!e.inputDisplay.isDisabled()&&(e.isTextChanged||_.isEmpty(e.inputDisplay.getValue()))?(_.isEmpty(e.inputDisplay.getValue())&&e.inputDisplay.setValue(n),t.put_Text(e.inputDisplay.getValue())):t.put_Text(null),t},onBtnClick:function(e){e.currentTarget&&e.currentTarget.attributes.result&&this._handleInput(e.currentTarget.attributes.result.value)},onKeyPress:function(e){if(e.keyCode==Common.UI.Keys.RETURN)return this._handleInput("ok"),!1},_handleInput:function(e){if(this.options.handler){if(e=="ok"){var t=this.cmbLinkType.getValue()==c_oHyperlinkType.WebLink?this.inputUrl.checkValidate():!0,n=this.inputDisplay.checkValidate();if(t!==!0){this.inputUrl.cmpEl.find("input").focus();return}if(n!==!0){this.inputDisplay.cmpEl.find("input").focus();return}}this.options.handler.call(this,this,e)}this.close()},ShowHideElem:function(e){this.externalPanel.toggleClass("hidden",e!==c_oHyperlinkType.WebLink),this.internalPanel.toggleClass("hidden",e!==c_oHyperlinkType.InternalLink)},parseUrl:function(e){if(e===null||e===undefined||e=="")return c_oHyperlinkType.WebLink;var t=e.indexOf("ppaction://hlink");if(0==t){if(e=="ppaction://hlinkshowjump?jump=firstslide")this.radioFirst.setValue(!0);else if(e=="ppaction://hlinkshowjump?jump=lastslide")this.radioLast.setValue(!0);else if(e=="ppaction://hlinkshowjump?jump=nextslide")this.radioNext.setValue(!0);else if(e=="ppaction://hlinkshowjump?jump=previousslide")this.radioPrev.setValue(!0);else{this.radioSlide.setValue(!0);var n="ppaction://hlinksldjumpslide",r=e.indexOf(n);if(0==r){var i=parseInt(e.substring(n.length));i>=0&&i\r\n
    \r\n \r\n \r\n \r\n \r\n \r\n \r\n
    \r\n \r\n
    \r\n
    \r\n \r\n
    \r\n
    \r\n \r\n
    \r\n
    \r\n
    \r\n
    \r\n
    \r\n
    \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
    \r\n \r\n
    \r\n
    \r\n
    \r\n
    \r\n
    \r\n
    \r\n
    \r\n
    \r\n
    \r\n
    \r\n
    \r\n
    \r\n
    \r\n \r\n
    \r\n
    \r\n
    \r\n
    \r\n
    \r\n
    \r\n
    \r\n
    \r\n
    \r\n
    \r\n
    \r\n
    \r\n \r\n
    \r\n
    \r\n
    \r\n \r\n
    \r\n
    \r\n
    \r\n
    \r\n
    \r\n
    \r\n \r\n
    \r\n
    \r\n
    \r\n
    \r\n
    \r\n \r\n \r\n \r\n
    \r\n
    \r\n
    '}),define("common/main/lib/view/AdvancedSettingsWindow",["common/main/lib/component/Window"],function(){"use strict";Common.Views.AdvancedSettingsWindow=Common.UI.Window.extend(_.extend({initialize:function(e){var t={};_.extend(t,{height:200,header:!0,cls:"advanced-settings-dlg",toggleGroup:"advanced-settings-group",contentTemplate:"",items:[]},e),this.template=e.template||['
    ','",'
    ','
    '+t.contentTemplate+"
    ","
    ",'
    ','"].join(""),t.tpl=_.template(this.template,t),this.handler=t.handler,this.toggleGroup=t.toggleGroup,this.contentWidth=t.contentWidth,this.storageName=t.storageName,Common.UI.Window.prototype.initialize.call(this,t)},render:function(){Common.UI.Window.prototype.render.call(this);var e=this,t=this.getChild();t.find(".dlg-btn").on("click",_.bind(this.onDlgBtnClick,this)),this.btnsCategory=[],_.each(t.find(".btn-category"),function(t,n){var r=$(t),i=new Common.UI.Button({el:r,enableToggle:!0,toggleGroup:e.toggleGroup,allowDepress:!1,contentTarget:r.attr("content-target")});i.on("click",_.bind(e.onCategoryClick,e)),e.btnsCategory.push(i)});var n=t.find(".content-panel");n.width(this.contentWidth),t.width(t.find(".menu-panel").width()+n.outerWidth()+2),this.content_panels=t.find(".settings-panel"),this.btnsCategory.length>0&&this.btnsCategory[0].toggle(!0,!0)},setHeight:function(e){Common.UI.Window.prototype.setHeight.call(this,e);var t=this.getChild(),n=t.find(".body > .box");n.css("height",e-85)},onDlgBtnClick:function(e){var t=e.currentTarget.attributes.result.value;if(this.handler&&this.handler.call(this,t,t=="ok"?this.getSettings():undefined))return;this.close()},onCategoryClick:function(e,t){this.content_panels.filter(".active").removeClass("active"),$("#"+e.options.contentTarget).addClass("active")},getSettings:function(){return},onPrimary:function(){if(this.handler&&this.handler.call(this,"ok",this.getSettings()))return;return this.close(),!1},setActiveCategory:function(e){if(this.btnsCategory.length<1)return;var t=this.btnsCategory[e>=0&&e
    ',initialize:function(e){Common.UI.BaseView.prototype.initialize.call(this,e);var t=this,n=$(this.el);n.addClass("spinner"),n.on("mousedown",".spinner-up",_.bind(this.onMouseDown,this,!0)),n.on("mousedown",".spinner-down",_.bind(this.onMouseDown,this,!1)),n.on("mouseup",".spinner-up",_.bind(this.onMouseUp,this,!0)),n.on("mouseup",".spinner-down",_.bind(this.onMouseUp,this,!1)),n.on("mouseover",".spinner-up, .spinner-down",_.bind(this.onMouseOver,this)),n.on("mouseout",".spinner-up, .spinner-down",_.bind(this.onMouseOut,this)),n.on("keydown",".form-control",_.bind(this.onKeyDown,this)),n.on("keyup",".form-control",_.bind(this.onKeyUp,this)),n.on("blur",".form-control",_.bind(this.onBlur,this)),n.on("input",".form-control",_.bind(this.onInput,this)),this.options.allowDecimal||n.on("keypress",".form-control",_.bind(this.onKeyPress,this)),this.switches={count:1,enabled:!0,fromKeyDown:!1},this.options.speed==="medium"?this.switches.speed=300:this.options.speed==="fast"?this.switches.speed=100:this.switches.speed=500,this.render(),this.options.disabled&&this.setDisabled(this.options.disabled),this.options.value!==undefined&&(this.value=this.options.value),this.setRawValue(this.value),this.options.width&&$(this.el).width(this.options.width),this.options.defaultValue===undefined&&(this.options.defaultValue=this.options.minValue),this.oldValue=this.options.minValue,this.lastValue=null},render:function(){var e=$(this.el);return e.html(this.template),this.$input=e.find(".form-control"),this.rendered=!0,this.options.tabindex!=undefined&&this.$input.attr("tabindex",this.options.tabindex),this},setDisabled:function(e){var t=$(this.el);e!==this.disabled&&(t.find("button").toggleClass("disabled",e),t.toggleClass("disabled",e),e?this.$input.attr({disabled:e}):this.$input.removeAttr("disabled")),this.disabled=e},isDisabled:function(){return this.disabled},setDefaultUnit:function(e){if(this.options.defaultUnit!=e){var t=this.options.defaultUnit;this.options.defaultUnit=e,this.setMinValue(this._recalcUnits(this.options.minValue,t)),this.setMaxValue(this._recalcUnits(this.options.maxValue,t)),this.setValue(this._recalcUnits(this.getNumberValue(),t),!0)}},setMinValue:function(e){this.options.minValue=e},setMaxValue:function(e){this.options.maxValue=e},setStep:function(e){this.options.step=e},getNumberValue:function(){return this.options.allowAuto&&this.value==this.options.autoText?-1:parseFloat(this.value)},getUnitValue:function(){return this.options.defaultUnit},getValue:function(){return this.value},setRawValue:function(e){this.$input&&this.$input.val(e)},getRawValue:function(){return this.$input.val()},setValue:function(e,t){var n=!1;this._fromKeyDown=!1,this.lastValue=this.value;if(typeof e=="undefined"||e==="")this.value="";else if(this.options.allowAuto&&(Math.abs(parseFloat(e)+1)<1e-4||e==this.options.autoText))this.value=this.options.autoText;else{var r=this._add(parseFloat(e),0,this.options.allowDecimal?3:0);if(typeof e=="undefined"||isNaN(r))r=this.oldValue,n=!0;var i=this.options.defaultUnit;if(typeof e.match!="undefined"){var s=e.match(/(px|em|%|en|ex|pt|"|cm|mm|pc|s|ms|см|мм|пт|сек|мс)$/i);null!==s&&s[0]!=="undefined"&&(i=s[0].toLowerCase())}this.options.defaultUnit!==i&&!n&&(r=this._recalcUnits(r,i)),r>this.options.maxValue&&(r=this.options.maxValue,n=!0),r<%= labelText %>'),initialize:function(e){Common.UI.BaseView.prototype.initialize.call(this,e);var n=this,r=$(this.el);this.render(),this.options.disabled&&this.setDisabled(this.options.disabled),this.options.value!==undefined&&this.setValue(this.options.value,!0),this.$chk.on("click",t.bind(this.onItemCheck,this))},render:function(){var e=$(this.el);return e.html(this.template({labelText:this.options.labelText})),this.$chk=e.find("input[type=button]"),this.$label=e.find("label"),this.rendered=!0,this},setDisabled:function(e){e=e===!0,e!==this.disabled&&(this.$label.toggleClass("disabled",e),e?this.$chk.attr({disabled:e}):this.$chk.removeAttr("disabled")),this.disabled=e},isDisabled:function(){return this.disabled},onItemCheck:function(e){this.disabled||(this.indeterminate?(this.indeterminate=!1,this.setValue(!1)):this.setValue(!this.checked))},setRawValue:function(e){this.checked=e===!0||e==="true"||e==="1"||e===1||e==="checked",this.indeterminate=e==="indeterminate",this.$chk.toggleClass("checked",this.checked),this.$chk.toggleClass("indeterminate",this.indeterminate),this.value=this.indeterminate?"indeterminate":this.checked?"checked":"unchecked"},setValue:function(e,t){this.rendered?(this.lastValue=this.value,this.setRawValue(e),t!==!0&&this.lastValue!==e&&this.trigger("change",this,this.value,this.lastValue)):this.options.value=e},getValue:function(){return this.value},isChecked:function(){return this.checked},setCaption:function(e){this.$label.find("span").text(e)}})});if(Common===undefined)var Common={};define("common/main/lib/component/DataView",["common/main/lib/component/BaseView","common/main/lib/component/Scroller"],function(){"use strict";Common.UI.DataViewGroupModel=Backbone.Model.extend({defaults:function(){return{id:Common.UI.getId(),caption:"",inline:!1,headername:undefined}}}),Common.UI.DataViewGroupStore=Backbone.Collection.extend({model:Common.UI.DataViewGroupModel}),Common.UI.DataViewModel=Backbone.Model.extend({defaults:function(){return{id:Common.UI.getId(),selected:!1,allowSelected:!0,value:null,disabled:!1}}}),Common.UI.DataViewStore=Backbone.Collection.extend({model:Common.UI.DataViewModel}),Common.UI.DataViewItem=Common.UI.BaseView.extend({options:{},template:_.template(['
    <%= value %>
    '].join("")),initialize:function(e){Common.UI.BaseView.prototype.initialize.call(this,e);var t=this;t.template=t.options.template||t.template,t.listenTo(t.model,"change",t.render),t.listenTo(t.model,"change:selected",t.onSelectChange),t.listenTo(t.model,"remove",t.remove)},render:function(){if(_.isUndefined(this.model.id))return this;var e=$(this.el);return e.html(this.template(this.model.toJSON())),e.addClass("item"),e.toggleClass("selected",this.model.get("selected")&&this.model.get("allowSelected")),e.off("click").on("click",_.bind(this.onClick,this)),e.off("dblclick").on("dblclick",_.bind(this.onDblClick,this)),e.off("contextmenu").on("contextmenu",_.bind(this.onContextMenu,this)),e.toggleClass("disabled",this.model.get("disabled")),_.isUndefined(this.model.get("cls"))||e.addClass(this.model.get("cls")),this.trigger("change",this,this.model),this},remove:function(){this.stopListening(this.model),this.trigger("remove",this,this.model),Common.UI.BaseView.prototype.remove.call(this)},onClick:function(e){if(this.model.get("disabled"))return!1;this.trigger("click",this,this.model,e)},onDblClick:function(e){if(this.model.get("disabled"))return!1;this.trigger("dblclick",this,this.model,e)},onContextMenu:function(e){this.trigger("contextmenu",this,this.model,e)},onSelectChange:function(e,t){this.trigger("select",this,e,t)}}),Common.UI.DataView=Common.UI.BaseView.extend({options:{multiSelect:!1,handleSelect:!0,enableKeyEvents:!0,keyMoveDirection:"both",restoreHeight:0,emptyText:"",listenStoreEvents:!0,allowScrollbar:!0,showLast:!0,useBSKeydown:!1},template:_.template(['
    ',"<% _.each(groups, function(group) { %>","<% if (group.headername !== undefined) { %>",'
    <%= group.headername %>
    ',"<% } %>",'
    ',"<% if (!_.isEmpty(group.caption)) { %>",'
    ',"<%= group.caption %>","
    ","<% } %>",'
    ',"
    ","
    ","<% }); %>","
    "].join("")),initialize:function(e){Common.UI.BaseView.prototype.initialize.call(this,e);var t=this;t.template=t.options.template||t.template,t.store=t.options.store||new Common.UI.DataViewStore,t.groups=t.options.groups||null,t.itemTemplate=t.options.itemTemplate||null,t.multiSelect=t.options.multiSelect,t.handleSelect=t.options.handleSelect,t.parentMenu=t.options.parentMenu,t.enableKeyEvents=t.options.enableKeyEvents,t.useBSKeydown=t.options.useBSKeydown,t.showLast=t.options.showLast,t.style=t.options.style||"",t.emptyText=t.options.emptyText||"",t.listenStoreEvents=t.options.listenStoreEvents!==undefined?t.options.listenStoreEvents:!0,t.allowScrollbar=t.options.allowScrollbar!==undefined?t.options.allowScrollbar:!0,t.rendered=!1,t.dataViewItems=[],t.options.keyMoveDirection=="vertical"?t.moveKeys=[Common.UI.Keys.UP,Common.UI.Keys.DOWN]:t.options.keyMoveDirection=="horizontal"?t.moveKeys=[Common.UI.Keys.LEFT,Common.UI.Keys.RIGHT]:t.moveKeys=[Common.UI.Keys.UP,Common.UI.Keys.DOWN,Common.UI.Keys.LEFT,Common.UI.Keys.RIGHT],t.options.el&&t.render()},render:function(e){var t=this;this.trigger("render:before",this),this.cmpEl=$(this.el),e?(this.setElement(e,!1),this.cmpEl=$(this.template({groups:t.groups?t.groups.toJSON():null,style:t.style})),e.html(this.cmpEl)):this.cmpEl.html(this.template({groups:t.groups?t.groups.toJSON():null,style:t.style})),this.rendered||(this.listenStoreEvents&&(this.listenTo(this.store,"add",this.onAddItem),this.listenTo(this.store,"reset",this.onResetItems)),this.onResetItems(),this.parentMenu&&(this.cmpEl.closest("li").css("height","100%"),this.cmpEl.css("height","100%"),this.parentMenu.on("show:after",_.bind(this.alignPosition,this))),this.enableKeyEvents&&this.parentMenu&&this.handleSelect&&(t.showLast||this.parentMenu.on("show:before",function(e){t.deselectAll()}),this.parentMenu.on("show:after",function(e){t.showLast&&t.showLastSelected(),Common.NotificationCenter.trigger("dataview:focus"),_.delay(function(){e.cmpEl.find(".dataview").focus()},10)}).on("hide:after",function(){Common.NotificationCenter.trigger("dataview:blur")}))),_.isUndefined(this.scroller)&&this.allowScrollbar&&(this.scroller=new Common.UI.Scroller({el:$(this.el).find(".inner").andSelf().filter(".inner"),useKeyboard:this.enableKeyEvents&&!this.handleSelect,minScrollbarLength:40,wheelSpeed:10}));var n=this.cmpEl.closest(".asc-window");return n.length>0&&(this.tipZIndex=parseInt(n.css("z-index"))+10),this.rendered=!0,this.cmpEl.on("click",function(e){if(/dataview/.test(e.target.className))return!1}),this.trigger("render:after",this),this},setStore:function(e){e&&(this.stopListening(this.store),this.store=e,this.listenStoreEvents&&(this.listenTo(this.store,"add",this.onAddItem),this.listenTo(this.store,"reset",this.onResetItems)))},selectRecord:function(e,t){if(!this.handleSelect)return;t&&this.suspendEvents(),this.multiSelect?e&&e.set({selected:!e.get("selected")}):(_.each(this.store.where({selected:!0}),function(e){e.set({selected:!1})}),e&&e.set({selected:!0})),t&&this.resumeEvents()},selectByIndex:function(e,t){this.store.length>0&&e>-1&&e0){var s=this.groups.findWhere({id:e.get("group")});s&&(i=i.find("#"+s.id+" "+".group-items-container"))}if(i){n&&n.at==0?i.prepend(r.render().el):i.append(r.render().el),i.find(".empty-text").remove(),this.dataViewItems.push(r);if(e.get("tip")){var o=$(r.el);o.attr("data-toggle","tooltip"),o.tooltip({title:e.get("tip"),placement:"cursor",zIndex:this.tipZIndex})}this.listenTo(r,"change",this.onChangeItem),this.listenTo(r,"remove",this.onRemoveItem),this.listenTo(r,"click",this.onClickItem),this.listenTo(r,"dblclick",this.onDblClickItem),this.listenTo(r,"select",this.onSelectItem),this.listenTo(r,"contextmenu",this.onContextMenuItem),this.isSuspendEvents||this.trigger("item:add",this,r,e)}}},onResetItems:function(){_.each(this.dataViewItems,function(e){var t=e.$el.data("bs.tooltip");t&&t.tip().remove()},this),$(this.el).html(this.template({groups:this.groups?this.groups.toJSON():null,style:this.style})),_.isUndefined(this.scroller)||(this.scroller.destroy(),delete this.scroller),this.store.length<1&&this.emptyText.length>0&&$(this.el).find(".inner").andSelf().filter(".inner").append('
    '+this.emptyText+"
    "),_.each(this.dataViewItems,function(e){this.stopListening(e),e.stopListening(e.model)},this),this.dataViewItems=[],this.store.each(this.onAddItem,this),this.allowScrollbar&&(this.scroller=new Common.UI.Scroller({el:$(this.el).find(".inner").andSelf().filter(".inner"),useKeyboard:this.enableKeyEvents&&!this.handleSelect,minScrollbarLength:40,wheelSpeed:10})),this.attachKeyEvents(),this.lastSelectedRec=null,this._layoutParams=undefined},onChangeItem:function(e,t){this.isSuspendEvents||this.trigger("item:change",this,e,t)},onRemoveItem:function(e,t){this.stopListening(e),e.stopListening();if(this.store.length<1&&this.emptyText.length>0){var n=$(this.el).find(".inner").andSelf().filter(".inner");n.find(".empty-text").length<=0&&n.append('
    '+this.emptyText+"
    ")}for(var r=0;r=0&&this.dataViewItems.length>r?$(this.dataViewItems[r].el):t.find("#"+e.get("id"));if(i.length<=0)return;var s=i.offset().top;if(sn+t.height())this.scroller&&this.allowScrollbar?this.scroller.scrollTop(t.scrollTop()+s-n,0):t.scrollTop(t.scrollTop()+s-n)},onKeyDown:function(e,t){if(this.disabled)return;t===undefined&&(t=e);if(_.indexOf(this.moveKeys,t.keyCode)>-1||t.keyCode==Common.UI.Keys.RETURN){t.preventDefault(),t.stopPropagation();var n=this.getSelectedRec()[0];this.lastSelectedRec===null&&(this.lastSelectedRec=n);if(t.keyCode==Common.UI.Keys.RETURN)this.lastSelectedRec=null,this.selectedBeforeHideRec&&(n=this.selectedBeforeHideRec),this.trigger("item:click",this,this,n,e),this.trigger("item:select",this,this,n,e),this.trigger("entervalue",this,n,e),this.parentMenu&&this.parentMenu.hide();else{var r=_.indexOf(this.store.models,n);if(r<0)if(t.keyCode==Common.UI.Keys.LEFT){var i=$(e.target).closest(".dropdown-submenu.over");i.length>0?(i.removeClass("over"),i.find("> a").focus()):r=0}else r=0;else if(this.options.keyMoveDirection=="both"){this._layoutParams===undefined&&this.fillIndexesArray();var s=this.dataViewItems[r].topIdx,o=this.dataViewItems[r].leftIdx;r=undefined;if(t.keyCode==Common.UI.Keys.LEFT)while(r===undefined){o--;if(o<0){var i=$(e.target).closest(".dropdown-submenu.over");if(i.length>0){i.removeClass("over"),i.find("> a").focus();break}o=this._layoutParams.columns-1}r=this._layoutParams.itemsIndexes[s][o]}else if(t.keyCode==Common.UI.Keys.RIGHT)while(r===undefined)o++,o>this._layoutParams.columns-1&&(o=0),r=this._layoutParams.itemsIndexes[s][o];else if(t.keyCode==Common.UI.Keys.UP)while(r===undefined)s--,s<0&&(s=this._layoutParams.rows-1),r=this._layoutParams.itemsIndexes[s][o];else while(r===undefined)s++,s>this._layoutParams.rows-1&&(s=0),r=this._layoutParams.itemsIndexes[s][o]}else r=t.keyCode==Common.UI.Keys.UP||t.keyCode==Common.UI.Keys.LEFT?Math.max(0,r-1):Math.min(this.store.length-1,r+1);r!==undefined&&r>=0&&(n=this.store.at(r)),n&&(this._fromKeyDown=!0,this.selectRecord(n),this._fromKeyDown=!1,this.scrollToRecord(n))}}else this.trigger("item:keydown",this,n,e)},attachKeyEvents:function(){if(this.enableKeyEvents&&this.handleSelect){var e=$(this.el).find(".inner").andSelf().filter(".inner");e.addClass("canfocused"),e.attr("tabindex","0"),e.on(this.parentMenu&&this.useBSKeydown?"dataview:keydown":"keydown",_.bind(this.onKeyDown,this))}},showLastSelected:function(){if(this.lastSelectedRec)this.selectRecord(this.lastSelectedRec,!0),this.scrollToRecord(this.lastSelectedRec),this.lastSelectedRec=null;else{var e=this.getSelectedRec()[0];e&&this.scrollToRecord(e)}},setDisabled:function(e){this.disabled=e,$(this.el).find(".inner").andSelf().filter(".inner").toggleClass("disabled",e)},isDisabled:function(){return this.disabled},setEmptyText:function(e){this.emptyText=e},alignPosition:function(){var e=this.parentMenu.cmpEl.attr("role")==="menu"?this.parentMenu.cmpEl:this.parentMenu.cmpEl.find("[role=menu]"),t=$(this.el).find(".inner").andSelf().filter(".inner"),n=Common.Utils.innerHeight(),r=e.outerHeight(),i=parseInt(e.css("top"));r>n?(t.css("max-height",n-parseInt(e.css("padding-top"))-parseInt(e.css("padding-bottom"))-5+"px"),this.allowScrollbar&&this.scroller.update({minScrollbarLength:40})):t.height()n&&e.css("top",0),this.allowScrollbar&&this.scroller.update({minScrollbarLength:40}))},fillIndexesArray:function(){if(this.dataViewItems.length<=0)return;this._layoutParams={itemsIndexes:[],columns:0,rows:0};var e=$(this.dataViewItems[0].el),t=e.outerWidth()+parseInt(e.css("margin-left"))+parseInt(e.css("margin-right")),n=this.$el.offset().left,r=-1,i=0,s=0;for(var o=0;or&&(r=u,this._layoutParams.itemsIndexes.push([]),i=this._layoutParams.itemsIndexes.length-1),this._layoutParams.itemsIndexes[i][s]=o,this.dataViewItems[o].topIdx=i,this.dataViewItems[o].leftIdx=s,this._layoutParams.columns<%= value %>
    ')},template:_.template(['
    '].join("")),onResetItems:function(){this.innerEl=null,Common.UI.DataView.prototype.onResetItems.call(this)},onAddItem:function(e,t){var n=new Common.UI.DataViewItem({template:this.itemTemplate,model:e});this.innerEl||(this.innerEl=$(this.el).find(".inner"),this.innerEl.find(".empty-text").remove());if(n&&this.innerEl){if(this.options.simpleAddMode)this.innerEl.append(n.render().el);else{var r=_.indexOf(this.store.models,e),i=this.innerEl.find("> div");r>0?$(i.get(r-1)).after(n.render().el):i.length>0?$(i[r]).before(n.render().el):this.innerEl.append(n.render().el)}this.dataViewItems.push(n),this.listenTo(n,"change",this.onChangeItem),this.listenTo(n,"remove",this.onRemoveItem),this.listenTo(n,"click",this.onClickItem),this.listenTo(n,"dblclick",this.onDblClickItem),this.listenTo(n,"select",this.onSelectItem),this.isSuspendEvents||this.trigger("item:add",this,n,e)}}}}())}),define("presentationeditor/main/app/view/ParagraphSettingsAdvanced",["text!presentationeditor/main/app/template/ParagraphSettingsAdvanced.template","common/main/lib/view/AdvancedSettingsWindow","common/main/lib/component/MetricSpinner","common/main/lib/component/CheckBox","common/main/lib/component/RadioBox","common/main/lib/component/ListView"],function(e){"use strict";PE.Views.ParagraphSettingsAdvanced=Common.Views.AdvancedSettingsWindow.extend(_.extend({options:{contentWidth:320,height:394,toggleGroup:"paragraph-adv-settings-group",storageName:"pe-para-settings-adv-category"},initialize:function(t){_.extend(this.options,{title:this.textTitle,items:[{panelId:"id-adv-paragraph-indents",panelCaption:this.strParagraphIndents},{panelId:"id-adv-paragraph-font",panelCaption:this.strParagraphFont},{panelId:"id-adv-paragraph-tabs",panelCaption:this.strTabs}],contentTemplate:_.template(e)({scope:this})},t),Common.Views.AdvancedSettingsWindow.prototype.initialize.call(this,this.options),this._changedProps=null,this.checkGroup=0,this._noApply=!0,this._tabListChanged=!1,this.spinners=[],this.api=this.options.api,this._originalProps=new Asc.asc_CParagraphProperty(this.options.paragraphProps)},render:function(){Common.Views.AdvancedSettingsWindow.prototype.render.call(this);var e=this;this.numFirstLine=new Common.UI.MetricSpinner({el:$("#paragraphadv-spin-first-line"),step:.1,width:85,defaultUnit:"cm",defaultValue:0,value:"0 cm",maxValue:55.87,minValue:-55.87}),this.numFirstLine.on("change",_.bind(function(e,t,n,r){this._changedProps&&((this._changedProps.get_Ind()===null||this._changedProps.get_Ind()===undefined)&&this._changedProps.put_Ind(new Asc.asc_CParagraphInd),this._changedProps.get_Ind().put_FirstLine(Common.Utils.Metric.fnRecalcToMM(e.getNumberValue())))},this)),this.spinners.push(this.numFirstLine),this.numIndentsLeft=new Common.UI.MetricSpinner({el:$("#paragraphadv-spin-indent-left"),step:.1,width:85,defaultUnit:"cm",defaultValue:0,value:"0 cm",maxValue:55.87,minValue:0}),this.numIndentsLeft.on("change",_.bind(function(e,t,n,r){var i=e.getNumberValue();this._changedProps&&((this._changedProps.get_Ind()===null||this._changedProps.get_Ind()===undefined)&&this._changedProps.put_Ind(new Asc.asc_CParagraphInd),this._changedProps.get_Ind().put_Left(Common.Utils.Metric.fnRecalcToMM(i))),this.numFirstLine.setMinValue(-i),this.numFirstLine.getNumberValue()<-i&&this.numFirstLine.setValue(-i)},this)),this.spinners.push(this.numIndentsLeft),this.numIndentsRight=new Common.UI.MetricSpinner({el:$("#paragraphadv-spin-indent-right"),step:.1,width:85,defaultUnit:"cm",defaultValue:0,value:"0 cm",maxValue:55.87,minValue:0}),this.numIndentsRight.on("change",_.bind(function(e,t,n,r){this._changedProps&&((this._changedProps.get_Ind()===null||this._changedProps.get_Ind()===undefined)&&this._changedProps.put_Ind(new Asc.asc_CParagraphInd),this._changedProps.get_Ind().put_Right(Common.Utils.Metric.fnRecalcToMM(e.getNumberValue())))},this)),this.spinners.push(this.numIndentsRight),this.chStrike=new Common.UI.CheckBox({el:$("#paragraphadv-checkbox-strike"),labelText:this.strStrike}),this.chStrike.on("change",_.bind(this.onStrikeChange,this)),this.chDoubleStrike=new Common.UI.CheckBox({el:$("#paragraphadv-checkbox-double-strike"),labelText:this.strDoubleStrike}),this.chDoubleStrike.on("change",_.bind(this.onDoubleStrikeChange,this)),this.chSuperscript=new Common.UI.CheckBox({el:$("#paragraphadv-checkbox-superscript"),labelText:this.strSuperscript}),this.chSuperscript.on("change",_.bind(this.onSuperscriptChange,this)),this.chSubscript=new Common.UI.CheckBox({el:$("#paragraphadv-checkbox-subscript"),labelText:this.strSubscript}),this.chSubscript.on("change",_.bind(this.onSubscriptChange,this)),this.chSmallCaps=new Common.UI.CheckBox({el:$("#paragraphadv-checkbox-small-caps"),labelText:this.strSmallCaps}),this.chSmallCaps.on("change",_.bind(this.onSmallCapsChange,this)),this.chAllCaps=new Common.UI.CheckBox({el:$("#paragraphadv-checkbox-all-caps"),labelText:this.strAllCaps}),this.chAllCaps.on("change",_.bind(this.onAllCapsChange,this)),this.numSpacing=new Common.UI.MetricSpinner({el:$("#paragraphadv-spin-spacing"),step:.01,width:100,defaultUnit:"cm",defaultValue:0,value:"0 cm",maxValue:55.87,minValue:-55.87}),this.numSpacing.on("change",_.bind(function(e,t,n,r){this._changedProps&&this._changedProps.put_TextSpacing(Common.Utils.Metric.fnRecalcToMM(e.getNumberValue()));if(this.api&&!this._noApply){var i=this._originalProps?this._originalProps:new Asc.asc_CParagraphProperty;i.put_TextSpacing(Common.Utils.Metric.fnRecalcToMM(e.getNumberValue())),this.api.SetDrawImagePlaceParagraph("paragraphadv-font-img",i)}},this)),this.spinners.push(this.numSpacing),this.numTab=new Common.UI.MetricSpinner({el:$("#paraadv-spin-tab"),step:.1,width:180,defaultUnit:"cm",value:"1.25 cm",maxValue:55.87,minValue:0}),this.spinners.push(this.numTab),this.numDefaultTab=new Common.UI.MetricSpinner({el:$("#paraadv-spin-default-tab"),step:.1,width:107,defaultUnit:"cm",value:"1.25 cm",maxValue:55.87,minValue:0}),this.numDefaultTab.on("change",_.bind(function(e,t,n,r){this._changedProps&&this._changedProps.put_DefaultTab(parseFloat(Common.Utils.Metric.fnRecalcToMM(e.getNumberValue()).toFixed(1)))},this)),this.spinners.push(this.numDefaultTab),this.tabList=new Common.UI.ListView({el:$("#paraadv-list-tabs"),emptyText:this.noTabs,store:new Common.UI.DataViewStore}),this.tabList.store.comparator=function(e){return e.get("tabPos")},this.tabList.on("item:select",_.bind(this.onSelectTab,this));var t=function(){e._noApply||(e._tabListChanged=!0)};this.listenTo(this.tabList.store,"add",t),this.listenTo(this.tabList.store,"remove",t),this.listenTo(this.tabList.store,"reset",t),this.radioLeft=new Common.UI.RadioBox({el:$("#paragraphadv-radio-left"),labelText:this.textTabLeft,name:"asc-radio-tab",checked:!0}),this.radioCenter=new Common.UI.RadioBox({el:$("#paragraphadv-radio-center"),labelText:this.textTabCenter,name:"asc-radio-tab"}),this.radioRight=new Common.UI.RadioBox({el:$("#paragraphadv-radio-right"),labelText:this.textTabRight,name:"asc-radio-tab"}),this.btnAddTab=new Common.UI.Button({el:$("#paraadv-button-add-tab")}),this.btnAddTab.on("click",_.bind(this.addTab,this)),this.btnRemoveTab=new Common.UI.Button({el:$("#paraadv-button-remove-tab")}),this.btnRemoveTab.on("click",_.bind(this.removeTab,this)),this.btnRemoveAll=new Common.UI.Button({el:$("#paraadv-button-remove-all")}),this.btnRemoveAll.on("click",_.bind(this.removeAllTabs,this)),this.afterRender()},getSettings:function(){return this._tabListChanged&&((this._changedProps.get_Tabs()===null||this._changedProps.get_Tabs()===undefined)&&this._changedProps.put_Tabs(new Asc.asc_CParagraphTabs),this.tabList.store.each(function(e,t){var n=new Asc.asc_CParagraphTab(Common.Utils.Metric.fnRecalcToMM(e.get("tabPos")),e.get("tabAlign"));this._changedProps.get_Tabs().add_Tab(n)},this)),{paragraphProps:this._changedProps}},_setDefaults:function(e){if(e){this._originalProps=new Asc.asc_CParagraphProperty(e),this.numIndentsLeft.setValue(e.get_Ind()!==null&&e.get_Ind().get_Left()!==null?Common.Utils.Metric.fnRecalcFromMM(e.get_Ind().get_Left()):"",!0),this.numFirstLine.setMinValue(-this.numIndentsLeft.getNumberValue()),this.numFirstLine.setValue(e.get_Ind()!==null&&e.get_Ind().get_FirstLine()!==null?Common.Utils.Metric.fnRecalcFromMM(e.get_Ind().get_FirstLine()):"",!0),this.numIndentsRight.setValue(e.get_Ind()!==null&&e.get_Ind().get_Right()!==null?Common.Utils.Metric.fnRecalcFromMM(e.get_Ind().get_Right()):"",!0),this._noApply=!0,this.chStrike.setValue(e.get_Strikeout()!==null&&e.get_Strikeout()!==undefined?e.get_Strikeout():"indeterminate",!0),this.chDoubleStrike.setValue(e.get_DStrikeout()!==null&&e.get_DStrikeout()!==undefined?e.get_DStrikeout():"indeterminate",!0),this.chSubscript.setValue(e.get_Subscript()!==null&&e.get_Subscript()!==undefined?e.get_Subscript():"indeterminate",!0),this.chSuperscript.setValue(e.get_Superscript()!==null&&e.get_Superscript()!==undefined?e.get_Superscript():"indeterminate",!0),this.chSmallCaps.setValue(e.get_SmallCaps()!==null&&e.get_SmallCaps()!==undefined?e.get_SmallCaps():"indeterminate",!0),this.chAllCaps.setValue(e.get_AllCaps()!==null&&e.get_AllCaps()!==undefined?e.get_AllCaps():"indeterminate",!0),this.numSpacing.setValue(e.get_TextSpacing()!==null&&e.get_TextSpacing()!==undefined?Common.Utils.Metric.fnRecalcFromMM(e.get_TextSpacing()):"",!0),this.api.SetDrawImagePlaceParagraph("paragraphadv-font-img",this._originalProps),this.numDefaultTab.setValue(e.get_DefaultTab()!==null&&e.get_DefaultTab()!==undefined?Common.Utils.Metric.fnRecalcFromMM(parseFloat(e.get_DefaultTab().toFixed(1))):"",!0);var t=this.tabList.store,n=e.get_Tabs();if(n){var r=[],i=n.get_Count();for(var s=0;s0){var r=this.tabList.store,i=_.indexOf(r.models,n[0]);r.remove(n[0]),i>r.length-1&&(i=r.length-1),r.length>0&&(this.tabList.selectByIndex(i),this.tabList.scrollToRecord(r.at(i)))}},removeAllTabs:function(e,t){this.tabList.store.reset()},onSelectTab:function(e,t,n){var r={},i=_.isFunction(n.toJSON);if(i){if(!n.get("selected"))return;r=n.toJSON()}else r=n;this.numTab.setValue(r.tabPos),r.tabAlign==1?this.radioLeft.setValue(!0):r.tabAlign==3?this.radioCenter.setValue(!0):this.radioRight.setValue(!0)},textTitle:"Paragraph - Advanced Settings",strIndentsFirstLine:"First line",strIndentsLeftText:"Left",strIndentsRightText:"Right",strParagraphIndents:"Indents & Placement",strParagraphFont:"Font",cancelButtonText:"Cancel",okButtonText:"Ok",textEffects:"Effects",textCharacterSpacing:"Character Spacing",strDoubleStrike:"Double strikethrough",strStrike:"Strikethrough",strSuperscript:"Superscript",strSubscript:"Subscript",strSmallCaps:"Small caps",strAllCaps:"All caps",strTabs:"Tab",textSet:"Specify",textRemove:"Remove",textRemoveAll:"Remove All",textTabLeft:"Left",textTabRight:"Right",textTabCenter:"Center",textAlign:"Alignment",textTabPosition:"Tab Position",textDefault:"Default Tab",noTabs:"The specified tabs will appear in this field"},PE.Views.ParagraphSettingsAdvanced||{}))}),define("text!presentationeditor/main/app/template/ShapeSettingsAdvanced.template",[],function(){return'
    \r\n
    \r\n \r\n \r\n \r\n \r\n \r\n \r\n
    \r\n \r\n
    \r\n
    \r\n
    \r\n
    \r\n \r\n
    \r\n
    \r\n
    \r\n
    \r\n
    \r\n
    \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
    \r\n \r\n
    \r\n \r\n
    \r\n
    \r\n \r\n
    \r\n
    \r\n
    \r\n
    \r\n
    \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
    \r\n \r\n
    \r\n \r\n
    \r\n
    \r\n \r\n
    \r\n
    \r\n \r\n
    \r\n
    \r\n \r\n
    \r\n
    \r\n
    \r\n
    \r\n
    \r\n
    \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
    \r\n \r\n
    \r\n
    \r\n \r\n
    \r\n
    \r\n \r\n
    \r\n
    \r\n \r\n
    \r\n
    \r\n
    \r\n
    \r\n
    \r\n
    \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
    \r\n \r\n
    \r\n
    \r\n \r\n \r\n
    \r\n \r\n
    \r\n
    \r\n
    '}),define("presentationeditor/main/app/view/ShapeSettingsAdvanced",["text!presentationeditor/main/app/template/ShapeSettingsAdvanced.template","common/main/lib/view/AdvancedSettingsWindow","common/main/lib/component/ComboBox","common/main/lib/component/MetricSpinner"],function(e){"use strict";PE.Views.ShapeSettingsAdvanced=Common.Views.AdvancedSettingsWindow.extend(_.extend({options:{contentWidth:300,height:342,toggleGroup:"shape-adv-settings-group",sizeOriginal:{width:0,height:0},sizeMax:{width:55.88,height:55.88},properties:null,storageName:"pe-shape-settings-adv-category"},initialize:function(t){_.extend(this.options,{title:this.textTitle,items:[{panelId:"id-adv-shape-width",panelCaption:this.textSize},{panelId:"id-adv-shape-shape",panelCaption:this.textWeightArrows},{panelId:"id-adv-shape-margins",panelCaption:this.strMargins},{panelId:"id-adv-shape-alttext",panelCaption:this.textAlt}],contentTemplate:_.template(e)({scope:this})},t),Common.Views.AdvancedSettingsWindow.prototype.initialize.call(this,this.options),this.spinners=[],this.Margins=undefined,this._nRatio=1,this._originalProps=this.options.shapeProps,this._changedProps=null},render:function(){Common.Views.AdvancedSettingsWindow.prototype.render.call(this);var e=this;this.spnWidth=new Common.UI.MetricSpinner({el:$("#shape-advanced-spin-width"),step:.1,width:100,defaultUnit:"cm",value:"3 cm",maxValue:55.88,minValue:0}),this.spnWidth.on("change",_.bind(function(e,t,n,r){if(this.btnRatio.pressed){var i=e.getNumberValue(),s=i/this._nRatio;s>this.sizeMax.height&&(s=this.sizeMax.height,i=s*this._nRatio,this.spnWidth.setValue(i,!0)),this.spnHeight.setValue(s,!0)}this._changedProps&&(this._changedProps.put_Width(Common.Utils.Metric.fnRecalcToMM(e.getNumberValue())),this._changedProps.put_Height(Common.Utils.Metric.fnRecalcToMM(this.spnHeight.getNumberValue())))},this)),this.spinners.push(this.spnWidth),this.spnHeight=new Common.UI.MetricSpinner({el:$("#shape-advanced-spin-height"),step:.1,width:100,defaultUnit:"cm",value:"3 cm",maxValue:55.88,minValue:0}),this.spnHeight.on("change",_.bind(function(e,t,n,r){var i=e.getNumberValue(),s=null;this.btnRatio.pressed&&(s=i*this._nRatio,s>this.sizeMax.width&&(s=this.sizeMax.width,i=s/this._nRatio,this.spnHeight.setValue(i,!0)),this.spnWidth.setValue(s,!0)),this._changedProps&&(this._changedProps.put_Height(Common.Utils.Metric.fnRecalcToMM(e.getNumberValue())),this._changedProps.put_Width(Common.Utils.Metric.fnRecalcToMM(this.spnWidth.getNumberValue())))},this)),this.spinners.push(this.spnHeight),this.btnRatio=new Common.UI.Button({cls:"btn-toolbar",iconCls:"advanced-btn-ratio",style:"margin-bottom: 1px;",enableToggle:!0,hint:this.textKeepRatio}),this.btnRatio.render($("#shape-advanced-button-ratio")),this.btnRatio.on("click",_.bind(function(e,t){e.pressed&&this.spnHeight.getNumberValue()>0&&(this._nRatio=this.spnWidth.getNumberValue()/this.spnHeight.getNumberValue()),this._changedProps&&this._changedProps.asc_putLockAspect(e.pressed)},this)),this.spnMarginTop=new Common.UI.MetricSpinner({el:$("#shape-margin-top"),step:.1,width:100,defaultUnit:"cm",value:"0 cm",maxValue:55.87,minValue:0}),this.spnMarginTop.on("change",_.bind(function(e,t,n,r){this._changedProps&&((this._changedProps.get_paddings()===null||this._changedProps.get_paddings()===undefined)&&this._changedProps.put_paddings(new Asc.asc_CPaddings),this._changedProps.get_paddings().put_Top(Common.Utils.Metric.fnRecalcToMM(e.getNumberValue())))},this)),this.spinners.push(this.spnMarginTop),this.spnMarginBottom=new Common.UI.MetricSpinner({el:$("#shape-margin-bottom"),step:.1,width:100,defaultUnit:"cm",value:"0 cm",maxValue:55.87,minValue:0}),this.spnMarginBottom.on("change",_.bind(function(e,t,n,r){this._changedProps&&((this._changedProps.get_paddings()===null||this._changedProps.get_paddings()===undefined)&&this._changedProps.put_paddings(new Asc.asc_CPaddings),this._changedProps.get_paddings().put_Bottom(Common.Utils.Metric.fnRecalcToMM(e.getNumberValue())))},this)),this.spinners.push(this.spnMarginBottom),this.spnMarginLeft=new Common.UI.MetricSpinner({el:$("#shape-margin-left"),step:.1,width:100,defaultUnit:"cm",value:"0.19 cm",maxValue:9.34,minValue:0}),this.spnMarginLeft.on("change",_.bind(function(e,t,n,r){this._changedProps&&((this._changedProps.get_paddings()===null||this._changedProps.get_paddings()===undefined)&&this._changedProps.put_paddings(new Asc.asc_CPaddings),this._changedProps.get_paddings().put_Left(Common.Utils.Metric.fnRecalcToMM(e.getNumberValue())))},this)),this.spinners.push(this.spnMarginLeft),this.spnMarginRight=new Common.UI.MetricSpinner({el:$("#shape-margin-right"),step:.1,width:100,defaultUnit:"cm",value:"0.19 cm",maxValue:9.34,minValue:0}),this.spnMarginRight.on("change",_.bind(function(e,t,n,r){this._changedProps&&((this._changedProps.get_paddings()===null||this._changedProps.get_paddings()===undefined)&&this._changedProps.put_paddings(new Asc.asc_CPaddings),this._changedProps.get_paddings().put_Right(Common.Utils.Metric.fnRecalcToMM(e.getNumberValue())))},this)),this.spinners.push(this.spnMarginRight),this._arrCapType=[{displayValue:this.textFlat,value:Asc.c_oAscLineCapType.Flat},{displayValue:this.textRound,value:Asc.c_oAscLineCapType.Round},{displayValue:this.textSquare,value:Asc.c_oAscLineCapType.Square}],this.cmbCapType=new Common.UI.ComboBox({el:$("#shape-advanced-cap-type"),cls:"input-group-nr",menuStyle:"min-width: 100px;",editable:!1,data:this._arrCapType}),this.cmbCapType.setValue(Asc.c_oAscLineCapType.Flat),this.cmbCapType.on("selected",_.bind(function(e,t){this._changedProps&&(this._changedProps.get_stroke()===null&&this._changedProps.put_stroke(new Asc.asc_CStroke),this._changedProps.get_stroke().put_linecap(t.value))},this)),this._arrJoinType=[{displayValue:this.textRound,value:Asc.c_oAscLineJoinType.Round},{displayValue:this.textBevel,value:Asc.c_oAscLineJoinType.Bevel},{displayValue:this.textMiter,value:Asc.c_oAscLineJoinType.Miter}],this.cmbJoinType=new Common.UI.ComboBox({el:$("#shape-advanced-join-type"),cls:"input-group-nr",menuStyle:"min-width: 100px;",editable:!1,data:this._arrJoinType}),this.cmbJoinType.setValue(Asc.c_oAscLineJoinType.Round),this.cmbJoinType.on("selected",_.bind(function(e,t){this._changedProps&&(this._changedProps.get_stroke()===null&&this._changedProps.put_stroke(new Asc.asc_CStroke),this._changedProps.get_stroke().put_linejoin(t.value))},this));var t=[],n=[];for(var r=0;r<6;r++)t.push({value:r,offsetx:80*r+10,offsety:0});t[0].type=Asc.c_oAscLineBeginType.None,t[1].type=Asc.c_oAscLineBeginType.Triangle,t[2].type=Asc.c_oAscLineBeginType.Arrow,t[3].type=Asc.c_oAscLineBeginType.Stealth,t[4].type=Asc.c_oAscLineBeginType.Diamond,t[5].type=Asc.c_oAscLineBeginType.Oval;for(r=0;r<9;r++)n.push({value:r,offsetx:90,offsety:20*(r+1)});n[0].type=Asc.c_oAscLineBeginSize.small_small,n[1].type=Asc.c_oAscLineBeginSize.small_mid,n[2].type=Asc.c_oAscLineBeginSize.small_large,n[3].type=Asc.c_oAscLineBeginSize.mid_small,n[4].type=Asc.c_oAscLineBeginSize.mid_mid,n[5].type=Asc.c_oAscLineBeginSize.mid_large,n[6].type=Asc.c_oAscLineBeginSize.large_small,n[7].type=Asc.c_oAscLineBeginSize.large_mid,n[8].type=Asc.c_oAscLineBeginSize.large_large,this.btnBeginStyle=new Common.UI.ComboBox({el:$("#shape-advanced-begin-style"),template:_.template(['"].join(""))}),this.btnBeginStyleMenu=(new Common.UI.Menu({style:"min-width: 105px;",items:[{template:_.template('
    ')}]})).render($("#shape-advanced-begin-style")),this.mnuBeginStylePicker=new Common.UI.DataView({el:$("#shape-advanced-menu-begin-style"),parentMenu:this.btnBeginStyleMenu,store:new Common.UI.DataViewStore(t),itemTemplate:_.template('
    ')}),this.mnuBeginStylePicker.on("item:click",_.bind(this.onSelectBeginStyle,this)),this._selectStyleItem(this.btnBeginStyle,null),this.btnBeginSize=new Common.UI.ComboBox({el:$("#shape-advanced-begin-size"),template:_.template(['"].join(""))}),this.btnBeginSizeMenu=(new Common.UI.Menu({style:"min-width: 160px;",items:[{template:_.template('
    ')}]})).render($("#shape-advanced-begin-size")),this.mnuBeginSizePicker=new Common.UI.DataView({el:$("#shape-advanced-menu-begin-size"),parentMenu:this.btnBeginSizeMenu,store:new Common.UI.DataViewStore(n),itemTemplate:_.template('
    ')}),this.mnuBeginSizePicker.on("item:click",_.bind(this.onSelectBeginSize,this)),this._selectStyleItem(this.btnBeginSize,null);for(r=0;r','
    ','
    ','',"
    "].join(""))}),this.btnEndStyleMenu=(new Common.UI.Menu({style:"min-width: 105px;",items:[{template:_.template('
    ')}]})).render($("#shape-advanced-end-style")),this.mnuEndStylePicker=new Common.UI.DataView({el:$("#shape-advanced-menu-end-style"),parentMenu:this.btnEndStyleMenu,store:new Common.UI.DataViewStore(t),itemTemplate:_.template('
    ')}),this.mnuEndStylePicker.on("item:click",_.bind(this.onSelectEndStyle,this)),this._selectStyleItem(this.btnEndStyle,null),this.btnEndSize=new Common.UI.ComboBox({el:$("#shape-advanced-end-size"),template:_.template(['"].join(""))}),this.btnEndSizeMenu=(new Common.UI.Menu({style:"min-width: 160px;",items:[{template:_.template('
    ')}]})).render($("#shape-advanced-end-size")),this.mnuEndSizePicker=new Common.UI.DataView({el:$("#shape-advanced-menu-end-size"),parentMenu:this.btnEndSizeMenu,store:new Common.UI.DataViewStore(n),itemTemplate:_.template('
    ')}),this.mnuEndSizePicker.on("item:click",_.bind(this.onSelectEndSize,this)),this._selectStyleItem(this.btnEndSize,null),this.inputAltTitle=(new Common.UI.InputField({el:$("#shape-advanced-alt-title"),allowBlank:!0,validateOnBlur:!1,style:"width: 100%;"})).on("changed:after",function(){e.isAltTitleChanged=!0}),this.textareaAltDescription=this.$window.find("textarea"),this.textareaAltDescription.keydown(function(t){t.keyCode==Common.UI.Keys.RETURN&&t.stopPropagation(),e.isAltDescChanged=!0}),this.afterRender()},afterRender:function(){this.updateMetricUnit(),this._setDefaults(this._originalProps);if(this.storageName){var e=Common.localStorage.getItem(this.storageName);this.setActiveCategory(e!==null?parseInt(e):0)}},_setDefaults:function(e){if(e){this.spnWidth.setValue(Common.Utils.Metric.fnRecalcFromMM(e.get_Width()).toFixed(2),!0),this.spnHeight.setValue(Common.Utils.Metric.fnRecalcFromMM(e.get_Height()).toFixed(2),!0),e.get_Height()>0&&(this._nRatio=e.get_Width()/e.get_Height());var t=e.asc_getLockAspect();this.btnRatio.toggle(t),this._setShapeDefaults(e);var n=e.get_paddings();if(n){var r=n.get_Left();this.spnMarginLeft.setValue(null!==r&&undefined!==r?Common.Utils.Metric.fnRecalcFromMM(r):"",!0),r=n.get_Top(),this.spnMarginTop.setValue(null!==r&&undefined!==r?Common.Utils.Metric.fnRecalcFromMM(r):"",!0),r=n.get_Right(),this.spnMarginRight.setValue(null!==r&&undefined!==r?Common.Utils.Metric.fnRecalcFromMM(r):"",!0),r=n.get_Bottom(),this.spnMarginBottom.setValue(null!==r&&undefined!==r?Common.Utils.Metric.fnRecalcFromMM(r):"",!0)}this.btnsCategory[2].setDisabled(null===n),t=e.asc_getTitle(),this.inputAltTitle.setValue(t?t:""),t=e.asc_getDescription(),this.textareaAltDescription.val(t?t:""),this._changedProps=new Asc.asc_CShapeProperty}},getSettings:function(){return this.isAltTitleChanged&&this._changedProps.asc_putTitle(this.inputAltTitle.getValue()),this.isAltDescChanged&&this._changedProps.asc_putDescription(this.textareaAltDescription.val()),Common.localStorage.setItem("pe-settings-shaperatio",this.btnRatio.pressed?1:0),{shapeProps:this._changedProps}},_setShapeDefaults:function(e){if(e){var t=e.get_stroke();if(t){var n=t.get_linejoin();for(var r=0;r0?(t.store.each(function(e){e.set({offsetx:n.get("value")*80+10})},this),e.setDisabled(!1),r!==null?(t.selectByIndex(r,!0),this._selectStyleItem(e,t.store.at(r))):this._selectStyleItem(e,null)):(this._selectStyleItem(e,null),e.setDisabled(!0))},_selectStyleItem:function(e,t){var n=$(e.el).find(".form-control");n.css("background-position",(t?-t.get("offsetx")+20+"px":"0")+" "+(t?"-"+t.get("offsety")+"px":"-30px"))},onSelectBeginStyle:function(e,t,n){this._changedProps&&(this._changedProps.get_stroke()===null&&this._changedProps.put_stroke(new Asc.asc_CStroke),this._changedProps.get_stroke().put_linebeginstyle(n.get("type")));if(this._beginSizeIdx===null||this._beginSizeIdx===undefined)this._beginSizeIdx=4;this._updateSizeArr(this.btnBeginSize,this.mnuBeginSizePicker,n,this._beginSizeIdx),this._selectStyleItem(this.btnBeginStyle,n)},onSelectBeginSize:function(e,t,n){this._changedProps&&(this._changedProps.get_stroke()===null&&this._changedProps.put_stroke(new Asc.asc_CStroke),this._changedProps.get_stroke().put_linebeginsize(n.get("type"))),this._beginSizeIdx=n.get("value"),this._selectStyleItem(this.btnBeginSize,n)},onSelectEndStyle:function(e,t,n){this._changedProps&&(this._changedProps.get_stroke()===null&&this._changedProps.put_stroke(new Asc.asc_CStroke),this._changedProps.get_stroke().put_lineendstyle(n.get("type")));if(this._endSizeIdx===null||this._endSizeIdx===undefined)this._endSizeIdx=4;this._updateSizeArr(this.btnEndSize,this.mnuEndSizePicker,n,this._endSizeIdx),this._selectStyleItem(this.btnEndStyle,n)},onSelectEndSize:function(e,t,n){this._changedProps&&(this._changedProps.get_stroke()===null&&this._changedProps.put_stroke(new Asc.asc_CStroke),this._changedProps.get_stroke().put_lineendsize(n.get("type"))),this._endSizeIdx=n.get("value"),this._selectStyleItem(this.btnEndSize,n)},textRound:"Round",textMiter:"Miter",textSquare:"Square",textFlat:"Flat",textBevel:"Bevel",textTitle:"Shape - Advanced Settings",cancelButtonText:"Cancel",okButtonText:"Ok",txtNone:"None",textWeightArrows:"Weights & Arrows",textArrows:"Arrows",textLineStyle:"Line Style",textCapType:"Cap Type",textJoinType:"Join Type",textBeginStyle:"Begin Style",textBeginSize:"Begin Size",textEndStyle:"End Style",textEndSize:"End Size",textSize:"Size",textWidth:"Width",textHeight:"Height",textKeepRatio:"Constant Proportions",textTop:"Top",textLeft:"Left",textBottom:"Bottom",textRight:"Right",strMargins:"Text Padding",textAlt:"Alternative Text",textAltTitle:"Title",textAltDescription:"Description",textAltTip:"The alternative text-based representation of the visual object information, which will be read to the people with vision or cognitive impairments to help them better understand what information there is in the image, autoshape, chart or table."},PE.Views.ShapeSettingsAdvanced||{}))}),define("text!presentationeditor/main/app/template/TableSettingsAdvanced.template",[],function(){return'
    \r\n
    \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
    \r\n \r\n
    \r\n
    \r\n
    \r\n \r\n
    \r\n
    \r\n \r\n
    \r\n
    \r\n \r\n
    \r\n
    \r\n \r\n
    \r\n
    \r\n \r\n
    \r\n \r\n
    \r\n
    \r\n \r\n
    \r\n
    \r\n \r\n
    \r\n
    \r\n \r\n
    \r\n
    \r\n
    \r\n
    \r\n
    \r\n
    \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
    \r\n \r\n
    \r\n
    \r\n \r\n \r\n
    \r\n \r\n
    \r\n
    \r\n
    '}),define("presentationeditor/main/app/view/TableSettingsAdvanced",["text!presentationeditor/main/app/template/TableSettingsAdvanced.template","common/main/lib/view/AdvancedSettingsWindow","common/main/lib/component/MetricSpinner"],function(e){"use strict";PE.Views.TableSettingsAdvanced=Common.Views.AdvancedSettingsWindow.extend(_.extend({options:{alias:"TableSettingsAdvanced",contentWidth:280,height:385,storageName:"pe-table-settings-adv-category"},initialize:function(t){_.extend(this.options,{title:this.textTitle,items:[{panelId:"id-adv-table-cell-props",panelCaption:this.textWidthSpaces},{panelId:"id-adv-table-alttext",panelCaption:this.textAlt}],contentTemplate:_.template(e)({scope:this})},t),Common.Views.AdvancedSettingsWindow.prototype.initialize.call(this,this.options),this.spinners=[],this._changedProps=null,this._allTable=!1,this.TableMargins={Left:.19,Right:.19,Top:0,Bottom:0},this.CellMargins={Left:.19,Right:.19,Top:null,Bottom:null,Flag:0},this._initialMarginsDefault=!1,this._originalProps=new Asc.CTableProp(this.options.tableProps)},render:function(){Common.Views.AdvancedSettingsWindow.prototype.render.call(this);var e=this;this._marginsChange=function(e,t,n,r,i,s){i=="table"?this.TableMargins[s]=e.getNumberValue():this.CellMargins[s]=e.getNumberValue()},this.spnTableMarginTop=new Common.UI.MetricSpinner({el:$("#tableadv-number-margin-table-top"),step:.1,width:85,defaultUnit:"cm",value:"0 cm",maxValue:55.87,minValue:0}),this.spnTableMarginTop.on("change",_.bind(function(e,t,n,r){this._marginsChange(e,t,n,r,"table","Top"),this._changedProps&&(this._changedProps.get_DefaultMargins()===undefined&&this._changedProps.put_DefaultMargins(new Asc.asc_CPaddings),this._changedProps.get_DefaultMargins().put_Top(this.TableMargins.Top!==null?Common.Utils.Metric.fnRecalcToMM(this.TableMargins.Top):null),this.TableMargins.isChanged=!0)},this)),this.spinners.push(this.spnTableMarginTop),this.spnTableMarginBottom=new Common.UI.MetricSpinner({el:$("#tableadv-number-margin-table-bottom"),step:.1,width:85,defaultUnit:"cm",value:"0 cm",maxValue:55.87,minValue:0}),this.spnTableMarginBottom.on("change",_.bind(function(e,t,n,r){this._marginsChange(e,t,n,r,"table","Bottom"),this._changedProps&&(this._changedProps.get_DefaultMargins()===undefined&&this._changedProps.put_DefaultMargins(new Asc.asc_CPaddings),this._changedProps.get_DefaultMargins().put_Bottom(this.TableMargins.Bottom!==null?Common.Utils.Metric.fnRecalcToMM(this.TableMargins.Bottom):null),this.TableMargins.isChanged=!0)},this)),this.spinners.push(this.spnTableMarginBottom),this.spnTableMarginLeft=new Common.UI.MetricSpinner({el:$("#tableadv-number-margin-table-left"),step:.1,width:85,defaultUnit:"cm",value:"0.19 cm",maxValue:9.34,minValue:0}),this.spnTableMarginLeft.on("change",_.bind(function(e,t,n,r){this._marginsChange(e,t,n,r,"table","Left"),this._changedProps&&(this._changedProps.get_DefaultMargins()===undefined&&this._changedProps.put_DefaultMargins(new Asc.asc_CPaddings),this._changedProps.get_DefaultMargins().put_Left(this.TableMargins.Left!==null?Common.Utils.Metric.fnRecalcToMM(this.TableMargins.Left):null),this.TableMargins.isChanged=!0)},this)),this.spinners.push(this.spnTableMarginLeft),this.spnTableMarginRight=new Common.UI.MetricSpinner({el:$("#tableadv-number-margin-table-right"),step:.1,width:85,defaultUnit:"cm",value:"0.19 cm",maxValue:9.34,minValue:0}),this.spnTableMarginRight.on("change",_.bind(function(e,t,n,r){this._marginsChange(e,t,n,r,"table","Right"),this._changedProps&&(this._changedProps.get_DefaultMargins()===undefined&&this._changedProps.put_DefaultMargins(new Asc.asc_CPaddings),this._changedProps.get_DefaultMargins().put_Right(this.TableMargins.Right!==null?Common.Utils.Metric.fnRecalcToMM(this.TableMargins.Right):null),this.TableMargins.isChanged=!0)},this)),this.spinners.push(this.spnTableMarginRight);var t=function(){e.CellMargins.Flag=="indeterminate"?e._changedProps.get_CellMargins().put_Flag(1):e.CellMargins.Flag=="checked"?e._changedProps.get_CellMargins().put_Flag(0):e._changedProps.get_CellMargins().put_Flag(2)};this.chCellMargins=new Common.UI.CheckBox({el:$("#tableadv-checkbox-margins"),value:!0,labelText:this.textCheckMargins}),this.chCellMargins.on("change",_.bind(function(e,n,r,i){r=="checked"&&this._originalProps&&this._originalProps.get_CellMargins().get_Flag()==1&&e.setValue("indeterminate",!0),this.fillMargins.call(this,e.getValue()),this.CellMargins.Flag=e.getValue(),this._changedProps&&(this._changedProps.get_CellMargins()===undefined&&this._changedProps.put_CellMargins(new Asc.CMargins),this._changedProps.get_CellMargins().put_Left(this.CellMargins.Left!==null?Common.Utils.Metric.fnRecalcToMM(this.CellMargins.Left):null),this._changedProps.get_CellMargins().put_Top(this.CellMargins.Top!==null?Common.Utils.Metric.fnRecalcToMM(this.CellMargins.Top):null),this._changedProps.get_CellMargins().put_Bottom(this.CellMargins.Bottom!==null?Common.Utils.Metric.fnRecalcToMM(this.CellMargins.Bottom):null),this._changedProps.get_CellMargins().put_Right(this.CellMargins.Right!==null?Common.Utils.Metric.fnRecalcToMM(this.CellMargins.Right):null),t())},this)),this.spnMarginTop=new Common.UI.MetricSpinner({el:$("#tableadv-number-margin-top"),step:.1,width:85,defaultUnit:"cm",value:"0 cm",maxValue:55.87,minValue:0}),this.spnMarginTop.on("change",_.bind(function(e,n,r,i){this._marginsChange(e,n,r,i,"cell","Top"),this._changedProps&&(this._changedProps.get_CellMargins()===undefined&&this._changedProps.put_CellMargins(new Asc.CMargins),this._changedProps.get_CellMargins().put_Top(this.CellMargins.Top!==null?Common.Utils.Metric.fnRecalcToMM(this.CellMargins.Top):null),t())},this)),this.spinners.push(this.spnMarginTop),this.spnMarginBottom=new Common.UI.MetricSpinner({el:$("#tableadv-number-margin-bottom"),step:.1,width:85,defaultUnit:"cm",value:"0 cm",maxValue:55.87,minValue:0}),this.spnMarginBottom.on("change",_.bind(function(e,n,r,i){this._marginsChange(e,n,r,i,"cell","Bottom"),this._changedProps&&(this._changedProps.get_CellMargins()===undefined&&this._changedProps.put_CellMargins(new Asc.CMargins),this._changedProps.get_CellMargins().put_Bottom(this.CellMargins.Bottom!==null?Common.Utils.Metric.fnRecalcToMM(this.CellMargins.Bottom):null),t())},this)),this.spinners.push(this.spnMarginBottom),this.spnMarginLeft=new Common.UI.MetricSpinner({el:$("#tableadv-number-margin-left"),step:.1,width:85,defaultUnit:"cm",value:"0.19 cm",maxValue:9.34,minValue:0}),this.spnMarginLeft.on("change",_.bind(function(e,n,r,i){this._marginsChange(e,n,r,i,"cell","Left"),this._changedProps&&(this._changedProps.get_CellMargins()===undefined&&this._changedProps.put_CellMargins(new Asc.CMargins),this._changedProps.get_CellMargins().put_Left(this.CellMargins.Left!==null?Common.Utils.Metric.fnRecalcToMM(this.CellMargins.Left):null),t())},this)),this.spinners.push(this.spnMarginLeft),this.spnMarginRight=new Common.UI.MetricSpinner({el:$("#tableadv-number-margin-right"),step:.1,width:85,defaultUnit:"cm",value:"0.19 cm",maxValue:9.34,minValue:0}),this.spnMarginRight.on("change",_.bind(function(e,n,r,i){this._marginsChange(e,n,r,i,"cell","Right"),this._changedProps&&(this._changedProps.get_CellMargins()===undefined&&this._changedProps.put_CellMargins(new Asc.CMargins),this._changedProps.get_CellMargins().put_Right(this.CellMargins.Right!==null?Common.Utils.Metric.fnRecalcToMM(this.CellMargins.Right):null),t())},this)),this.spinners.push(this.spnMarginRight),this.inputAltTitle=(new Common.UI.InputField({el:$("#tableadv-alt-title"),allowBlank:!0,validateOnBlur:!1,style:"width: 100%;"})).on("changed:after",function(){e.isAltTitleChanged=!0}),this.textareaAltDescription=this.$window.find("textarea"),this.textareaAltDescription.keydown(function(t){t.keyCode==Common.UI.Keys.RETURN&&t.stopPropagation(),e.isAltDescChanged=!0}),this.afterRender()},afterRender:function(){this.updateMetricUnit(),this._setDefaults(this._originalProps);if(this.storageName){var e=Common.localStorage.getItem(this.storageName);this.setActiveCategory(e!==null?parseInt(e):0)}},getSettings:function(){return this.isAltTitleChanged&&this._changedProps.put_TableCaption(this.inputAltTitle.getValue()),this.isAltDescChanged&&this._changedProps.put_TableDescription(this.textareaAltDescription.val()),{tableProps:this._changedProps}},_setDefaults:function(e){if(e){this._allTable=!e.get_CellSelect();var t=e.get_DefaultMargins();t&&(this.TableMargins={Left:t.get_Left()!==null?Common.Utils.Metric.fnRecalcFromMM(t.get_Left()):null,Right:t.get_Right()!==null?Common.Utils.Metric.fnRecalcFromMM(t.get_Right()):null,Top:t.get_Top()!==null?Common.Utils.Metric.fnRecalcFromMM(t.get_Top()):null,Bottom:t.get_Bottom()!==null?Common.Utils.Metric.fnRecalcFromMM(t.get_Bottom()):null}),t=e.get_CellMargins();var n=undefined;t&&(this.CellMargins={Left:t.get_Left()!==null?Common.Utils.Metric.fnRecalcFromMM(t.get_Left()):null,Right:t.get_Right()!==null?Common.Utils.Metric.fnRecalcFromMM(t.get_Right()):null,Top:t.get_Top()!==null?Common.Utils.Metric.fnRecalcFromMM(t.get_Top()):null,Bottom:t.get_Bottom()!==null?Common.Utils.Metric.fnRecalcFromMM(t.get_Bottom()):null},n=t.get_Flag(),this.CellMargins.Flag=n==1?"indeterminate":n==0?"checked":"unchecked",this.chCellMargins.setValue(this.CellMargins.Flag,!0)),n===0&&(this.CellMargins.Left===null&&(this.CellMargins.Left=this.TableMargins.Left),this.CellMargins.Top===null&&(this.CellMargins.Top=this.TableMargins.Top),this.CellMargins.Right===null&&(this.CellMargins.Right=this.TableMargins.Right),this.CellMargins.Bottom===null&&(this.CellMargins.Bottom=this.TableMargins.Bottom)),this.fillMargins(this.CellMargins.Flag);var r=e.get_TableCaption();this.inputAltTitle.setValue(r?r:""),r=e.get_TableDescription(),this.textareaAltDescription.val(r?r:""),this._changedProps=new Asc.CTableProp}},fillMargins:function(e){this._initialMarginsDefault&&e=="unchecked"&&(this.CellMargins.Left===null&&(this.CellMargins.Left=0),this.CellMargins.Top===null&&(this.CellMargins.Top=0),this.CellMargins.Right===null&&(this.CellMargins.Right=0),this.CellMargins.Bottom===null&&(this.CellMargins.Bottom=0)),this.spnMarginLeft.setValue(this.CellMargins.Left!==null?this.CellMargins.Left:"",!0),this.spnMarginTop.setValue(this.CellMargins.Top!==null?this.CellMargins.Top:"",!0),this.spnMarginRight.setValue(this.CellMargins.Right!==null?this.CellMargins.Right:"",!0),this.spnMarginBottom.setValue(this.CellMargins.Bottom!==null?this.CellMargins.Bottom:"",!0);var t=e=="checked";this.spnMarginTop.setDisabled(t),this.spnMarginBottom.setDisabled(t),this.spnMarginLeft.setDisabled(t),this.spnMarginRight.setDisabled(t),this.spnTableMarginLeft.setValue(this.TableMargins.Left!==null?this.TableMargins.Left:"",!0),this.spnTableMarginTop.setValue(this.TableMargins.Top!==null?this.TableMargins.Top:"",!0),this.spnTableMarginRight.setValue(this.TableMargins.Right!==null?this.TableMargins.Right:"",!0),this.spnTableMarginBottom.setValue(this.TableMargins.Bottom!==null?this.TableMargins.Bottom:"",!0)},updateMetricUnit:function(){if(this.spinners)for(var e=0;e
    ',r.id)),e(n.el).append(f)),r.render(f),r.cmpEl.attr({tabindex:"-1"})),f.css({left:a[0],top:a[1]}),r.show(),t.isFunction(r.options.initMenu)&&(r.options.initMenu(i),r.alignPosition()),t.delay(function(){r.cmpEl.focus()},10),n.currentMenu=r}},s=function(e){if(!e||!t.isArray(e))return;var r={},i=null;return t.each(e,function(e,s){var o=e.get_ObjectType(),u=e.get_ObjectValue();Asc.c_oAscTypeSelectElement.Image==o?(i=n.pictureMenu,r.imgProps={},r.imgProps.value=u,r.imgProps.locked=u?u.get_Locked():!1):Asc.c_oAscTypeSelectElement.Table==o?(i=n.tableMenu,r.tableProps={},r.tableProps.value=u,r.tableProps.locked=u?u.get_Locked():!1):Asc.c_oAscTypeSelectElement.Hyperlink==o?(r.hyperProps={},r.hyperProps.value=u):Asc.c_oAscTypeSelectElement.Shape==o?(i=n.pictureMenu,r.shapeProps={},r.shapeProps.value=u,r.shapeProps.locked=u?u.get_Locked():!1,u.get_FromChart()&&(r.shapeProps.isChart=!0)):Asc.c_oAscTypeSelectElement.Chart==o?(i=n.pictureMenu,r.chartProps={},r.chartProps.value=u,r.chartProps.locked=u?u.get_Locked():!1):Asc.c_oAscTypeSelectElement.Slide==o?(r.slideProps={},r.slideProps.value=u,r.slideProps.locked=u?u.get_LockDelete():!1):Asc.c_oAscTypeSelectElement.Paragraph==o?(r.paraProps={},r.paraProps.value=u,r.paraProps.locked=u?u.get_Locked():!1,(r.shapeProps&&r.shapeProps.value||r.chartProps&&r.chartProps.value)&&t.isUndefined(r.tableProps)&&(i=n.textMenu)):Asc.c_oAscTypeSelectElement.Math==o&&(r.mathProps={},r.mathProps.value=u,n._currentMathObj=u)}),i===null&&(t.isUndefined(r.paraProps)?t.isUndefined(r.slideProps)||(i=n.slideMenu):i=n.textMenu),{menu_to_show:i,menu_props:r}},o=function(e,t,r){if(n.api&&n.mode.isEdit){var o=s(n.api.getSelectedElements());o&&i(o.menu_to_show,o.menu_props,e,t,r)}},u=function(e){t.delay(function(){e.get_Type()==Asc.c_oAscContextMenuTypes.Thumbnails?i.call(n,n.slideMenu,{isSlideSelect:e.get_IsSlideSelect(),fromThumbs:!0},e):o.call(n,e)},10)},a=function(e){if(n.mode.isEdit&&n.currentMenu&&n.currentMenu.isVisible())if(n.api.asc_getCurrentFocusObject()===0)n.slideMenu===n.currentMenu&&(n.currentMenu.options.initMenu({isSlideSelect:n.slideMenu.items[2].isVisible(),fromThumbs:!0}),n.currentMenu.alignPosition());else{var t=s(e);t&&t.menu_to_show===n.currentMenu&&(n.currentMenu.options.initMenu(t.menu_props),n.currentMenu.alignPosition())}},f=function(e){if(n.api){var r=t.isUndefined(e.originalEvent)?e.wheelDelta:e.originalEvent.wheelDelta;t.isUndefined(r)&&(r=e.deltaY),(e.ctrlKey||e.metaKey)&&!e.altKey&&(r<0?n.api.zoomOut():r>0&&n.api.zoomIn(),e.preventDefault(),e.stopPropagation())}},l=function(t){if(n.api){var r=t.keyCode;if((t.ctrlKey||t.metaKey)&&!t.shiftKey&&!t.altKey){if(r===Common.UI.Keys.NUM_PLUS||r===Common.UI.Keys.EQUALITY||Common.Utils.isOpera&&r==43)return n.api.zoomIn(),t.preventDefault(),t.stopPropagation(),!1;if(r===Common.UI.Keys.NUM_MINUS||r===Common.UI.Keys.MINUS||Common.Utils.isOpera&&r==45)return n.api.zoomOut(),t.preventDefault(),t.stopPropagation(),!1}n.currentMenu&&n.currentMenu.isVisible()&&(r==Common.UI.Keys.UP||r==Common.UI.Keys.DOWN)&&e("ul.dropdown-menu",n.currentMenu.el).focus()}},c=function(){n._Height=n.cmpEl.height(),n._Width=n.cmpEl.width(),n._BodyWidth=e("body").width(),n.slideNumDiv&&(n.slideNumDiv.remove(),n.slideNumDiv=undefined)},h=function(t){var r=n.cmpEl;if(r){r.on("contextmenu",function(e){return e.preventDefault(),e.stopPropagation(),!1}),r.on("click",function(e){e.target.localName=="canvas"&&r.focus()}),r.on("mousedown",function(e){e.target.localName=="canvas"&&Common.UI.Menu.Manager.hideAll()});var i=function(e,t,n){e.addEventListener?e.addEventListener(t,n,!1):e.attachEvent("on"+t,n)},s=/Firefox/i.test(navigator.userAgent)?"DOMMouseScroll":"mousewheel";i(n.el,s,f)}e(document).on("mousewheel",f),e(document).on("keydown",l),e(window).on("resize",c);var o=PE.getController("Viewport").getView("Viewport");o.hlayout.on("layout:resizedrag",c)},p=function(e){if(r){var t=r.findUser(e);if(t)return t.get("username")}return n.guestText},d={toolTip:new Common.UI.Tooltip({owner:this,html:!0,title:"
    Press Ctrl and click link"}),strTip:"",isHidden:!0,isVisible:!1},v=!0,m=function(e,t,r){v===!0&&(v=new Common.UI.Tooltip({owner:e.currentTarget,title:n.tipIsLocked}),v.show())},g=function(){if(typeof v=="object"){v.hide(),v=undefined;for(var e=0;e0&&window.open(e)},w=function(){d.isHidden=!0,n.usertips.length>0&&(typeof v=="object"&&(v.hide(),v=!0),t.each(n.usertips,function(e){e.remove()})),n.usertips=[],n.usertipcount=0},E=function(){d.isHidden&&d.isVisible&&(d.isVisible=!1,d.toolTip.hide())},S=function(r){t.isUndefined(n._XY)&&(n._XY=[n.cmpEl.offset().left-e(window).scrollLeft(),n.cmpEl.offset().top-e(window).scrollTop()],n._Width=n.cmpEl.width(),n._Height=n.cmpEl.height(),n._BodyWidth=e("body").width());if(r){var i,s;if(r.get_Type()==1){var o=r.get_Hyperlink(),u=!1;if(o){d.isHidden=!1,s=t.isEmpty(o.get_ToolTip())?o.get_Value():o.get_ToolTip(),s=Common.Utils.String.htmlEncode(s);if(d.tipLength!==s.length||d.strTip.indexOf(s)<0)d.toolTip.setTitle(s+"
    "+n.txtPressLink+""),d.tipLength=s.length,d.strTip=s,u=!0;i=[r.get_X(),r.get_Y()],i[1]+=n._XY[1]-15,i[0]+=n._XY[0]+5;if(!d.isVisible||u)d.isVisible=!0,d.toolTip.show([-1e4,-1e4]);u&&(d.tipHeight=d.toolTip.getBSTip().$tip.height(),d.tipWidth=d.toolTip.getBSTip().$tip.width()),i[1]-=d.tipHeight,i[0]+d.tipWidth>n._BodyWidth&&(i[0]=n._BodyWidth-d.tipWidth),d.toolTip.getBSTip().$tip.css({top:i[1]+"px",left:i[0]+"px"})}}else if(r.get_Type()==2&&n.mode.isEdit){var a;n.usertipcount>=n.usertips.length&&(a=e(document.createElement("div")),a.addClass("username-tip"),a.css({height:n._TtHeight+"px",position:"absolute",zIndex:"900",visibility:"visible"}),e(document.body).append(a),v&&(a.on("mouseover",m),a.on("mouseout",y)),n.usertips.push(a)),a=n.usertips[n.usertipcount],n.usertipcount++,s=p(r.get_UserId()),i=[r.get_X()+n._XY[0],r.get_Y()+n._XY[1]],i[0]=n._BodyWidth-i[0],i[1]-=r.get_LockedObjectType()==2?n._TtHeight:0,i[1]>n._XY[1]&&i[1]+n._TtHeight0&&t.each(s,function(e,s){e.menu?t.each(e.menu.items,function(e){e.on("click",t.bind(n.equationCallback,n,e.options.equationProps))}):e.on("click",t.bind(n.equationCallback,n,e.options.equationProps)),i.insertItem(r,e),r++}),s.length},this.clearEquationMenu=function(e,r){var i=e?n.textMenu:n.tableMenu;for(var s=r;s0&&n.addComment()};var D="command+f5,ctrl+f5";O[D]=function(e){var t=!1;e.preventDefault(),e.stopPropagation();if(n.slidesCount>0){var r=PE.getController("Viewport").getView("DocumentPreview");if(r&&!r.isVisible()&&n.api){r.show();var i=function(){if(t)return;t=!0,Common.NotificationCenter.off("window:resize",i),n.api.StartDemonstration("presentation-preview",0)};!n.mode.isDesktopApp&&!Common.Utils.isIE11?(Common.NotificationCenter.on("window:resize",i),n.fullScreen(document.documentElement),setTimeout(function(){i()},100)):i()}}},Common.util.Shortcuts.delegateShortcuts({shortcuts:O});var P=function(e){n.slidesCount=e},H=function(e){n.currentMenu&&n.currentMenu.isVisible()&&n._isFromSlideMenu!==!0&&n._isFromSlideMenu!==e&&n.currentMenu.hide(),n._isFromSlideMenu=e};this.setApi=function(e){return n.api=e,n.api&&(n.api.asc_registerCallback("asc_onContextMenu",t.bind(u,n)),n.api.asc_registerCallback("asc_onMouseMoveStart",t.bind(w,n)),n.api.asc_registerCallback("asc_onMouseMoveEnd",t.bind(E,n)),n.api.asc_registerCallback("asc_onPaintSlideNum",t.bind(C,n)),n.api.asc_registerCallback("asc_onEndPaintSlideNum",t.bind(k,n)),n.api.asc_registerCallback("asc_onCountPages",t.bind(P,n)),n.api.asc_registerCallback("asc_onCurrentPage",t.bind(H,n)),n.slidesCount=n.api.getCountPages(),n.api.asc_registerCallback("asc_onHyperlinkClick",t.bind(b,n)),n.api.asc_registerCallback("asc_onMouseMove",t.bind(S,n)),n.mode.isEdit===!0&&(n.api.asc_registerCallback("asc_onDialogAddHyperlink",t.bind(N,n)),n.api.asc_registerCallback("asc_doubleClickOnChart",A)),n.api.asc_registerCallback("asc_onCoAuthoringDisconnect",t.bind(L,n)),Common.NotificationCenter.on("api:disconnect",t.bind(L,n)),n.api.asc_registerCallback("asc_onShowForeignCursorLabel",t.bind(x,n)),n.api.asc_registerCallback("asc_onHideForeignCursorLabel",t.bind(T,n)),n.api.asc_registerCallback("asc_onFocusObject",t.bind(a,n))),n},this.mode={},this.setMode=function(e){n.api&&e.isEdit&&(n.api.asc_registerCallback("asc_onDialogAddHyperlink",t.bind(N,n)),n.api.asc_registerCallback("asc_doubleClickOnChart",A)),n.mode=e,n.mode.canCoAuthoring&&n.mode.isEdit&&n.mode.canComments?Common.util.Shortcuts.resumeEvents(M):Common.util.Shortcuts.suspendEvents(M),n.editorConfig={user:e.user}},n.on("render:after",h,n)},render:function(){return this.fireEvent("render:before",this),this.cmpEl=e(this.el),this.fireEvent("render:after",this),this},focus:function(){var e=this;t.defer(function(){e.cmpEl.focus()},50)},addHyperlink:function(e){var t,n=this;if(n.api){var r=[];for(var i=0;i0){var n=t.dataViewItems,r=e(n[0].el),i=r.outerWidth()+parseInt(r.css("margin-left"))+parseInt(r.css("margin-right")),s=Math.floor(t.cmpEl.width()/i),o=0,u=0;for(var a=0;au?u=l:f.css({height:u}),o++,o>s-1&&(o=0,u=0)}t._needRecalcSlideLayout=!1}},createDelayedElements:function(){var n=this,r=(new Common.UI.MenuItem({caption:n.txtDeleteSlide})).on("click",function(e){n.api&&(n._isFromSlideMenu=!0,n.api.DeleteSlide(),n.fireEvent("editcomplete",n),Common.component.Analytics.trackEvent("DocumentHolder","Delete Slide"))}),i=new Common.UI.MenuItem({caption:n.txtChangeLayout,menu:new Common.UI.Menu({menuAlign:"tl-tr",items:[{template:t.template('')}]})}),s=(new Common.UI.MenuItem({caption:n.txtPreview})).on("click",function(e){var r=PE.getController("Viewport").getView("DocumentPreview"),i=!1;if(r&&n.api){r.show();var s=function(){if(i)return;i=!0,Common.NotificationCenter.off("window:resize",s);var e=n.api.getCurrentPage();n.api.StartDemonstration("presentation-preview",t.isNumber(e)?e:0),Common.component.Analytics.trackEvent("DocumentHolder","Preview")};!n.mode.isDesktopApp&&!Common.Utils.isIE11?(Common.NotificationCenter.on("window:resize",s),n.fullScreen(document.documentElement),setTimeout(function(){s()},100)):s()}}),o=(new Common.UI.MenuItem({caption:n.txtSelectAll})).on("click",function(e){n.api&&(n.api.SelectAllSlides(),n.fireEvent("editcomplete",n),Common.component.Analytics.trackEvent("DocumentHolder","Select All Slides"))}),u=(new Common.UI.MenuItem({caption:n.textPaste,value:"paste"})).on("click",t.bind(n.onCutCopyPaste,n)),a=(new Common.UI.MenuItem({caption:n.textSlideSettings,value:null})).on("click",function(e){PE.getController("RightMenu").onDoubleClickOnObject(e.options.value)});n.slideMenu=(new Common.UI.Menu({initMenu:function(e){u.setVisible(e.fromThumbs!==!0),n.slideMenu.items[1].setVisible(e.fromThumbs===!0),n.slideMenu.items[2].setVisible(e.isSlideSelect===!0),r.setVisible(e.isSlideSelect===!0),n.slideMenu.items[4].setVisible(e.isSlideSelect===!0||e.fromThumbs!==!0),i.setVisible(e.isSlideSelect===!0||e.fromThumbs!==!0),a.setVisible(e.fromThumbs!==!0),a.options.value=null;for(var f=7;f<11;f++)n.slideMenu.items[f].setVisible(e.fromThumbs===!0);var l=n.api.getSelectedElements(),c=!1,h=!1,p=!1;l&&t.isArray(l)&&t.each(l,function(e,t){if(Asc.c_oAscTypeSelectElement.Slide==e.get_ObjectType()){var n=e.get_ObjectValue();return c=n.get_LockDelete(),h=n.get_LockRemove(),p=n.get_LockLayout(),a.options.value=e,!1}});for(var f=0;f<3;f++)n.slideMenu.items[f].setDisabled(c);s.setDisabled(n.slidesCount<1),o.setDisabled(c||n.slidesCount<2),r.setDisabled(h||c),i.setDisabled(p||c)},items:[u,(new Common.UI.MenuItem({caption:n.txtNewSlide})).on("click",function(e){n.api&&(n._isFromSlideMenu=!0,n.api.AddSlide(),n.fireEvent("editcomplete",n),Common.component.Analytics.trackEvent("DocumentHolder","Add Slide"))}),(new Common.UI.MenuItem({caption:n.txtDuplicateSlide})).on("click",function(e){n.api&&(n._isFromSlideMenu=!0,n.api.DublicateSlide(),n.fireEvent("editcomplete",n),Common.component.Analytics.trackEvent("DocumentHolder","Dublicate Hyperlink"))}),r,{caption:"--"},i,a,{caption:"--"},o,{caption:"--"},s]})).on("hide:after",function(e,t,r){if(n.suppressEditComplete){n.suppressEditComplete=!1;return}r||n.fireEvent("editcomplete",n),n.currentMenu=null}).on("render:after",function(r){n.slideLayoutMenu=(new Common.UI.DataView({el:e("#id-docholder-menu-changeslide"),parentMenu:i.menu,showLast:!1,restoreHeight:300,style:"max-height: 300px;",store:PE.getCollection("SlideLayouts"),itemTemplate:t.template(['
    ','
    ','
    <%= title %>
    ',"
    "].join(""))})).on("item:click",function(e,t,r,i){n.api&&(n.api.ChangeLayout(r.get("data").idx),i.type!=="click"&&n.slideMenu.hide(),n.fireEvent("editcomplete",n),Common.component.Analytics.trackEvent("DocumentHolder","Change Layout"))}),n.slideMenu&&i.menu.on("show:after",function(e){n.onSlidePickerShowAfter(n.slideLayoutMenu),n.slideLayoutMenu.scroller.update({alwaysVisibleY:!0}),n.slideLayoutMenu.scroller.scrollTop(0)}),n.slideLayoutMenu._needRecalcSlideLayout=!0,n.listenTo(PE.getCollection("SlideLayouts"),"reset",function(){n.slideLayoutMenu._needRecalcSlideLayout=!0})});var f=(new Common.UI.MenuItem({caption:n.mergeCellsText})).on("click",function(e){n.api&&n.api.MergeCells()}),l=(new Common.UI.MenuItem({caption:n.splitCellsText})).on("click",function(e){n.api&&(new Common.Views.InsertTableDialog({handler:function(e,t){e=="ok"&&(n.api&&n.api.SplitCell(t.columns,t.rows),n.fireEvent("editcomplete",n),Common.component.Analytics.trackEvent("DocumentHolder","Table Split"))}})).show()}),c=new Common.UI.MenuItem({caption:n.cellAlignText,menu:function(){function e(e,t){if(n.api){var r=new Asc.CTableProp;r.put_CellsVAlign(e.value),n.api.tblApply(r)}n.fireEvent("editcomplete",n),Common.component.Analytics.trackEvent("DocumentHolder","Table Cell Align")}return new Common.UI.Menu({menuAlign:"tl-tr",items:[n.menuTableCellTop=(new Common.UI.MenuItem({caption:n.topCellText,checkable:!0,toggleGroup:"popuptablecellalign",value:Asc.c_oAscVertAlignJc.Top})).on("click",t.bind(e,n)),n.menuTableCellCenter=(new Common.UI.MenuItem({caption:n.centerCellText,checkable:!0,toggleGroup:"popuptablecellalign",value:Asc.c_oAscVertAlignJc.Center})).on("click",t.bind(e,n)),n.menuTableCellBottom=(new Common.UI.MenuItem({caption:n.bottomCellText,checkable:!0,toggleGroup:"popuptablecellalign",value:Asc.c_oAscVertAlignJc.Bottom})).on("click",t.bind(e,n))]})}()}),h=(new Common.UI.MenuItem({caption:n.advancedTableText})).on("click",function(e){if(n.api){var t=n.api.getSelectedElements();if(t&&t.length>0){var r,i;for(var s=t.length-1;s>=0;s--){r=t[s].get_ObjectType(),i=t[s].get_ObjectValue();if(Asc.c_oAscTypeSelectElement.Table==r){(new PE.Views.TableSettingsAdvanced({tableProps:i,handler:function(e,t){e=="ok"&&n.api&&n.api.tblApply(t.tableProps),n.fireEvent("editcomplete",n),Common.component.Analytics.trackEvent("DocumentHolder","Table Settings Advanced")}})).show();break}}}}}),p=(new Common.UI.MenuItem({caption:n.advancedImageText})).on("click",function(e){if(n.api){var t=n.api.getSelectedElements();if(t&&t.length>0){var r,i;for(var s=t.length-1;s>=0;s--){r=t[s].get_ObjectType(),i=t[s].get_ObjectValue();if(Asc.c_oAscTypeSelectElement.Image==r){var o;B.isDisabled()||(o=n.api.get_OriginalSizeImage(),o&&(o={width:o.get_ImageWidth(),height:o.get_ImageHeight()})),(new PE.Views.ImageSettingsAdvanced({imageProps:i,sizeOriginal:o,handler:function(e,t){e=="ok"&&n.api&&n.api.ImgApply(t.imageProps),n.fireEvent("editcomplete",n),Common.component.Analytics.trackEvent("DocumentHolder","Image Settings Advanced")}})).show();break}}}}}),d=(new Common.UI.MenuItem({caption:n.advancedShapeText})).on("click",function(e){if(n.api){var t=n.api.getSelectedElements();if(t&&t.length>0){var r,i;for(var s=t.length-1;s>=0;s--){r=t[s].get_ObjectType(),i=t[s].get_ObjectValue();if(Asc.c_oAscTypeSelectElement.Shape==r){(new PE.Views.ShapeSettingsAdvanced({shapeProps:i,handler:function(e,t){e=="ok"&&n.api&&n.api.ShapeApply(t.shapeProps),n.fireEvent("editcomplete",n),Common.component.Analytics.trackEvent("DocumentHolder","Image Shape Advanced")}})).show();break}}}}}),v=(new Common.UI.MenuItem({caption:n.advancedParagraphText})).on("click",function(e){if(n.api){var t=n.api.getSelectedElements();if(t&&t.length>0){var r,i;for(var s=t.length-1;s>=0;s--){r=t[s].get_ObjectType(),i=t[s].get_ObjectValue();if(Asc.c_oAscTypeSelectElement.Paragraph==r){(new PE.Views.ParagraphSettingsAdvanced({paragraphProps:i,api:n.api,handler:function(e,t){e=="ok"&&n.api&&n.api.paraApply(t.paragraphProps),n.fireEvent("editcomplete",n),Common.component.Analytics.trackEvent("DocumentHolder","Image Paragraph Advanced")}})).show();break}}}}}),m=new Common.UI.MenuItem({caption:"--"}),g=(new Common.UI.MenuItem({caption:n.hyperlinkText})).on("click",t.bind(n.addHyperlink,n)),y=(new Common.UI.MenuItem({caption:n.editHyperlinkText})).on("click",t.bind(n.editHyperlink,n)),b=(new Common.UI.MenuItem({caption:n.removeHyperlinkText})).on("click",function(e){n.api&&n.api.remove_Hyperlink(),n.fireEvent("editcomplete",n),Common.component.Analytics.trackEvent("DocumentHolder","Remove Hyperlink")}),w=new Common.UI.MenuItem({caption:n.hyperlinkText,menu:new Common.UI.Menu({menuAlign:"tl-tr",items:[y,b]})}),E=(new Common.UI.MenuItem({caption:n.hyperlinkText})).on("click",t.bind(n.addHyperlink,n)),S=(new Common.UI.MenuItem({caption:n.editHyperlinkText})).on("click",t.bind(n.editHyperlink,n)),x=(new Common.UI.MenuItem({caption:n.removeHyperlinkText})).on("click",function(e){n.api&&n.api.remove_Hyperlink(),n.fireEvent("editcomplete",n),Common.component.Analytics.trackEvent("DocumentHolder","Remove Hyperlink Table")}),T=new Common.UI.MenuItem({caption:n.hyperlinkText,menu:new Common.UI.Menu({menuAlign:"tl-tr",items:[S,x]})}),N=new Common.UI.MenuItem({caption:"--"}),C=(new Common.UI.MenuItem({caption:this.txtGroup,iconCls:"mnu-group"})).on("click",function(e){n.api&&n.api.groupShapes(),n.fireEvent("editcomplete",this),Common.component.Analytics.trackEvent("DocumentHolder","Group Image")}),k=(new Common.UI.MenuItem({caption:this.txtUngroup,iconCls:"mnu-ungroup"})).on("click",function(e){n.api&&n.api.unGroupShapes(),n.fireEvent("editcomplete",this),Common.component.Analytics.trackEvent("DocumentHolder","Ungroup Image")}),L=new Common.UI.MenuItem({caption:n.txtArrange,menu:new Common.UI.Menu({menuAlign:"tl-tr",items:[(new Common.UI.MenuItem({caption:this.textArrangeFront,iconCls:"mnu-arrange-front"})).on("click",function(e){n.api&&n.api.shapes_bringToFront(),n.fireEvent("editcomplete",n),Common.component.Analytics.trackEvent("DocumentHolder","Bring To Front")}),(new Common.UI.MenuItem({caption:this.textArrangeBack,iconCls:"mnu-arrange-back"})).on("click",function(e){n.api&&n.api.shapes_bringToBack(),n.fireEvent("editcomplete",n),Common.component.Analytics.trackEvent("DocumentHolder","Bring To Back")}),(new Common.UI.MenuItem({caption:this.textArrangeForward,iconCls:"mnu-arrange-forward"})).on("click",function(e){n.api&&n.api.shapes_bringForward(),n.fireEvent("editcomplete",n),Common.component.Analytics.trackEvent("DocumentHolder","Send Forward")}),(new Common.UI.MenuItem({caption:this.textArrangeBackward,iconCls:"mnu-arrange-backward"})).on("click",function(e){n.api&&n.api.shapes_bringBackward(),n.fireEvent("editcomplete",n),Common.component.Analytics.trackEvent("DocumentHolder","Send Backward")}),{caption:"--"},C,k]})}),A=new Common.UI.MenuItem({caption:n.txtAlign,menu:function(){function e(e){n.api&&n.api.put_ShapesAlign(e.value),n.fireEvent("editcomplete",n),Common.component.Analytics.trackEvent("DocumentHolder","Image Shape Align")}return new Common.UI.Menu({menuAlign:"tl-tr",items:[(new Common.UI.MenuItem({caption:n.textShapeAlignLeft,iconCls:"mnu-shape-align-left",value:Asc.c_oAscAlignShapeType.ALIGN_LEFT})).on("click",t.bind(e,n)),(new Common.UI.MenuItem({caption:n.textShapeAlignCenter,iconCls:"mnu-shape-align-center",value:Asc.c_oAscAlignShapeType.ALIGN_CENTER})).on("click",t.bind(e,n)),(new Common.UI.MenuItem({caption:n.textShapeAlignRight,iconCls:"mnu-shape-align-right",value:Asc.c_oAscAlignShapeType.ALIGN_RIGHT})).on("click",t.bind(e,n)),(new Common.UI.MenuItem({caption:n.textShapeAlignTop,iconCls:"mnu-shape-align-top",value:Asc.c_oAscAlignShapeType.ALIGN_TOP})).on("click",t.bind(e,n)),(new Common.UI.MenuItem({caption:n.textShapeAlignMiddle,iconCls:"mnu-shape-align-middle",value:Asc.c_oAscAlignShapeType.ALIGN_MIDDLE})).on("click",t.bind(e,n)),(new Common.UI.MenuItem({caption:n.textShapeAlignBottom,iconCls:"mnu-shape-align-bottom",value:Asc.c_oAscAlignShapeType.ALIGN_BOTTOM})).on("click",t.bind(e,n)),{caption:"--"},(new Common.UI.MenuItem({caption:n.txtDistribHor,iconCls:"mnu-distrib-hor"})).on("click",function(e){n.api&&n.api.DistributeHorizontally(),n.fireEvent("editcomplete",n),Common.component.Analytics.trackEvent("DocumentHolder","Distribute Horizontally")}),(new Common.UI.MenuItem({caption:n.txtDistribVert,iconCls:"mnu-distrib-vert"})).on("click",function(e){n.api&&n.api.DistributeVertically(),n.fireEvent("editcomplete",n),Common.component.Analytics.trackEvent("DocumentHolder","Distribute Vertically")})]})}()}),O=(new Common.UI.MenuItem({caption:n.editChartText})).on("click",t.bind(n.editChartClick,n)),M=new Common.UI.MenuItem({caption:n.vertAlignText,menu:function(){function e(e){if(n.api){var t=new Asc.asc_CShapeProperty;t.put_VerticalTextAlign(e.value),n.api.ShapeApply(t)}n.fireEvent("editcomplete",n),Common.component.Analytics.trackEvent("DocumentHolder","Text Vertical Align")}return new Common.UI.Menu({menuAlign:"tl-tr",items:[n.menuParagraphTop=(new Common.UI.MenuItem({caption:n.topCellText,checkable:!0,toggleGroup:"popupparagraphvalign",value:Asc.c_oAscVAlign.Top})).on("click",t.bind(e,n)),n.menuParagraphCenter=(new Common.UI.MenuItem({caption:n.centerCellText,checkable:!0,toggleGroup:"popupparagraphvalign",value:Asc.c_oAscVAlign.Center})).on("click",t.bind(e,n)),n.menuParagraphBottom=(new Common.UI.MenuItem({caption:n.bottomCellText,checkable:!0,toggleGroup:"popupparagraphvalign",value:Asc.c_oAscVAlign.Bottom})).on("click",t.bind(e,n))]})}()}),D=function(e,t){if(n.api){var r=new Asc.asc_CShapeProperty;r.put_Vert(e.options.direction),n.api.ShapeApply(r)}n.fireEvent("editcomplete",n),Common.component.Analytics.trackEvent("DocumentHolder","Text Direction")},P=new Common.UI.MenuItem({caption:n.directionText,menu:new Common.UI.Menu({menuAlign:"tl-tr",items:[n.menuParagraphDirectH=(new Common.UI.MenuItem({caption:n.directHText,iconCls:"mnu-direct-horiz",checkable:!0,checked:!1,toggleGroup:"popupparagraphdirect",direction:Asc.c_oAscVertDrawingText.normal})).on("click",t.bind(D,n)),n.menuParagraphDirect90=(new Common.UI.MenuItem({caption:n.direct90Text,iconCls:"mnu-direct-rdown",checkable:!0,checked:!1,toggleGroup:"popupparagraphdirect",direction:Asc.c_oAscVertDrawingText.vert})).on("click",t.bind(D,n)),n.menuParagraphDirect270=(new Common.UI.MenuItem({caption:n.direct270Text,iconCls:"mnu-direct-rup",checkable:!0,checked:!1,toggleGroup:"popupparagraphdirect",direction:Asc.c_oAscVertDrawingText.vert270})).on("click",t.bind(D,n))]})}),H=new Common.UI.MenuItem({caption:"--"}),B=(new Common.UI.MenuItem({caption:n.originalSizeText})).on("click",function(e){if(n.api){var t=n.api.get_OriginalSizeImage();if(t){var r=new Asc.asc_CImgProperty;r.put_Width(t.get_ImageWidth()),r.put_Height(t.get_ImageHeight()),n.api.ImgApply(r)}n.fireEvent("editcomplete",n),Common.component.Analytics.trackEvent("DocumentHolder","Set Image Original Size")}}),j=(new Common.UI.MenuItem({caption:n.addCommentText})).on("click",t.bind(n.addComment,n));j.hide();var F=(new Common.UI.MenuItem({caption:n.addCommentText})).on("click",t.bind(n.addComment,n));F.hide();var I=new Common.UI.MenuItem({caption:"--"});I.hide();var q=(new Common.UI.MenuItem({caption:n.addCommentText})).on("click",t.bind(n.addComment,n));q.hide();var R=(new Common.UI.MenuItem({caption:n.textCopy,value:"copy"})).on("click",t.bind(n.onCutCopyPaste,n)),U=(new Common.UI.MenuItem({caption:n.textPaste,value:"paste"})).on("click",t.bind(n.onCutCopyPaste,n)),z=(new Common.UI.MenuItem({caption:n.textCut,value:"cut"})).on("click",t.bind(n.onCutCopyPaste,n)),W=(new Common.UI.MenuItem({caption:n.textCopy,value:"copy"})).on("click",t.bind(n.onCutCopyPaste,n)),X=(new Common.UI.MenuItem({caption:n.textPaste,value:"paste"})).on("click",t.bind(n.onCutCopyPaste,n)),V=(new Common.UI.MenuItem({caption:n.textCut,value:"cut"})).on("click",t.bind(n.onCutCopyPaste,n)),J=(new Common.UI.MenuItem({caption:n.textCopy,value:"copy"})).on("click",t.bind(n.onCutCopyPaste,n)),K=(new Common.UI.MenuItem({caption:n.textPaste,value:"paste"})).on("click",t.bind(n.onCutCopyPaste,n)),Q=(new Common.UI.MenuItem({caption:n.textCut,value:"cut"})).on("click",t.bind(n.onCutCopyPaste,n)),G=new Common.UI.MenuItem({caption:"--"}),Y=new Common.UI.MenuItem({caption:"--"});n.textMenu=(new Common.UI.Menu({initMenu:function(e){var r=e.shapeProps&&!t.isNull(e.shapeProps.value),i=e.chartProps&&!t.isNull(e.chartProps.value),s=e.paraProps!==undefined&&e.paraProps.locked||e.slideProps!==undefined&&e.slideProps.locked||r&&e.shapeProps.locked,o=e.mathProps&&e.mathProps.value;n._currentParaObjDisabled=s,M.setVisible(r&&!i&&!o),P.setVisible(r&&!i&&!o);if(r||i){var u=e.shapeProps.value.get_VerticalTextAlign();n.menuParagraphTop.setChecked(u==Asc.c_oAscVAlign.Top),n.menuParagraphCenter.setChecked(u==Asc.c_oAscVAlign.Center),n.menuParagraphBottom.setChecked(u==Asc.c_oAscVAlign.Bottom);var a=e.shapeProps.value.get_Vert();n.menuParagraphDirectH.setChecked(a==Asc.c_oAscVertDrawingText.normal),n.menuParagraphDirect90.setChecked(a==Asc.c_oAscVertDrawingText.vert),n.menuParagraphDirect270.setChecked(a==Asc.c_oAscVertDrawingText.vert270)}M.setDisabled(s),P.setDisabled(s);var f=null;n.api&&(f=n.api.can_AddHyperlink()),g.setVisible(e.hyperProps===undefined&&f!==!1),w.setVisible(e.hyperProps!==undefined),y.hyperProps=e.hyperProps,f!==!1&&(g.hyperProps={},g.hyperProps.value=new Asc.CHyperlinkProperty,g.hyperProps.value.put_Text(f)),j.setVisible(!i&&n.api.can_AddQuotedComment()!==!1&&n.mode.canCoAuthoring&&n.mode.canComments),m.setVisible(j.isVisible()||g.isVisible()||w.isVisible()),g.setDisabled(s),w.setDisabled(s),j.setDisabled(s),v.setDisabled(s),z.setDisabled(s),U.setDisabled(s);var l=0;o?l=n.addEquationMenu(!0,4):n.clearEquationMenu(!0,4),G.setVisible(o&&l>0)},items:[z,R,U,G,{caption:"--"},M,P,v,m,j,g,w]})).on("hide:after",function(e,t,r){if(n.suppressEditComplete){n.suppressEditComplete=!1;return}r||n.fireEvent("editcomplete",n),n.currentMenu=null}),n.tableMenu=(new Common.UI.Menu({initMenu:function(e){if(t.isUndefined(e.tableProps))return;var r=e.mathProps&&e.mathProps.value;for(var i=4;i<14;i++)n.tableMenu.items[i].setVisible(!r);var s=e.slideProps!==undefined&&e.slideProps.locked;n.menuTableCellTop.setChecked(e.tableProps.value.get_CellsVAlign()==Asc.c_oAscVertAlignJc.Top),n.menuTableCellCenter.setChecked(e.tableProps.value.get_CellsVAlign()==Asc.c_oAscVertAlignJc.Center),n.menuTableCellBottom.setChecked(e.tableProps.value.get_CellsVAlign()==Asc.c_oAscVertAlignJc.Bottom),n.api&&(f.setDisabled(e.tableProps.locked||s||!n.api.CheckBeforeMergeCells()),l.setDisabled(e.tableProps.locked||s||!n.api.CheckBeforeSplitCells())),n.tableMenu.items[5].setDisabled(e.tableProps.locked||s),n.tableMenu.items[6].setDisabled(e.tableProps.locked||s),c.setDisabled(e.tableProps.locked||s),h.setDisabled(e.tableProps.locked||s),Q.setDisabled(e.tableProps.locked||s),K.setDisabled(e.tableProps.locked||s);var o=null;n.api&&(o=n.api.can_AddHyperlink()),E.setVisible(!t.isUndefined(e.paraProps)&&t.isUndefined(e.hyperProps)&&o!==!1),T.setVisible(!t.isUndefined(e.paraProps)&&!t.isUndefined(e.hyperProps)),S.hyperProps=e.hyperProps,o!==!1&&(E.hyperProps={},E.hyperProps.value=new Asc.CHyperlinkProperty,E.hyperProps.value.put_Text(o)),t.isUndefined(e.paraProps)||(E.setDisabled(e.paraProps.locked||s),T.setDisabled(e.paraProps.locked||s),n._currentParaObjDisabled=e.paraProps.locked||s),F.setVisible(n.api.can_AddQuotedComment()!==!1&&n.mode.canCoAuthoring&&n.mode.canComments),F.setDisabled(!t.isUndefined(e.paraProps)&&e.paraProps.locked||s),N.setVisible(E.isVisible()||T.isVisible()||F.isVisible());var u=0;r?(u=n.addEquationMenu(!1,4),N.setVisible(N.isVisible()&&u>0)):n.clearEquationMenu(!1,4)},items:[Q,J,K,{caption:"--"},new Common.UI.MenuItem({caption:n.selectText,menu:new Common.UI.Menu({menuAlign:"tl-tr",items:[(new Common.UI.MenuItem({caption:n.rowText})).on("click",function(){n.api&&n.api.selectRow()}),(new Common.UI.MenuItem({caption:n.columnText})).on("click",function(){n.api&&n.api.selectColumn()}),(new Common.UI.MenuItem({caption:n.cellText})).on("click",function(){n.api&&n.api.selectCell()}),(new Common.UI.MenuItem({caption:n.tableText})).on("click",function(){n.api&&n.api.selectTable()})]})}),{caption:n.insertText,menu:new Common.UI.Menu({menuAlign:"tl-tr",style:"width: 100px",items:[(new Common.UI.MenuItem({caption:n.insertColumnLeftText})).on("click",function(e){n.api&&n.api.addColumnLeft()}),(new Common.UI.MenuItem({caption:n.insertColumnRightText})).on("click",function(e){n.api&&n.api.addColumnRight()}),(new Common.UI.MenuItem({caption:n.insertRowAboveText})).on("click",function(e){n.api&&n.api.addRowAbove()}),(new Common.UI.MenuItem({caption:n.insertRowBelowText})).on("click",function(e){n.api&&n.api.addRowBelow()})]})},new Common.UI.MenuItem({caption:n.deleteText,menu:new Common.UI.Menu({menuAlign:"tl-tr",items:[(new Common.UI.MenuItem({caption:n.rowText})).on("click",function(){n.api&&n.api.remRow()}),(new Common.UI.MenuItem({caption:n.columnText})).on("click",function(){n.api&&n.api.remColumn()}),(new Common.UI.MenuItem({caption:n.tableText})).on("click",function(){n.api&&n.api.remTable()})]})}),{caption:"--"},f,l,{caption:"--"},c,{caption:"--"},h,N,F,E,T]})).on("hide:after",function(e,t,r){if(n.suppressEditComplete){n.suppressEditComplete=!1;return}r||n.fireEvent("editcomplete",n),n.currentMenu=null}),n.pictureMenu=(new Common.UI.Menu({initMenu:function(e){n.api&&(k.setDisabled(!n.api.canUnGroup()),C.setDisabled(!n.api.canGroup()));var r=e.imgProps!==undefined&&e.imgProps.locked,i=e.shapeProps!==undefined&&e.shapeProps.locked,s=e.chartProps!==undefined&&e.chartProps.locked,o=r||i||s||e.slideProps!==undefined&&e.slideProps.locked;B.setVisible(t.isUndefined(e.shapeProps)&&t.isUndefined(e.chartProps)),B.isVisible()&&B.setDisabled(o||t.isNull(e.imgProps.value.get_ImageUrl())||t.isUndefined(e.imgProps.value.get_ImageUrl())),p.setVisible(t.isUndefined(e.shapeProps)&&t.isUndefined(e.chartProps)),d.setVisible(t.isUndefined(e.imgProps)&&t.isUndefined(e.chartProps)),O.setVisible(t.isUndefined(e.imgProps)&&!t.isUndefined(e.chartProps)&&(t.isUndefined(e.shapeProps)||e.shapeProps.isChart)),H.setVisible(p.isVisible()||d.isVisible()||O.isVisible()),q.setVisible(n.api.can_AddQuotedComment()!==!1&&n.mode.canCoAuthoring&&n.mode.canComments),I.setVisible(q.isVisible()),q.setDisabled(o),A.setDisabled(o),p.setDisabled(o),d.setDisabled(o),O.isVisible()&&O.setDisabled(o),V.setDisabled(o),X.setDisabled(o)},items:[V,W,X,{caption:"--"},L,A,H,B,p,d,O,I,q]})).on("hide:after",function(e,t,r){if(n.suppressEditComplete){n.suppressEditComplete=!1;return}r||n.fireEvent("editcomplete",n),n.currentMenu=null});var Z=e("#id_buttonNextPage");Z.attr("data-toggle","tooltip"),Z.tooltip({title:n.textNextPage+Common.Utils.String.platformKey("PgDn"),placement:"top-right"});var et=e("#id_buttonPrevPage");et.attr("data-toggle","tooltip"),et.tooltip({title:n.textPrevPage+Common.Utils.String.platformKey("PgUp"),placement:"top-right"})},insertRowAboveText:"Row Above",insertRowBelowText:"Row Below",insertColumnLeftText:"Column Left",insertColumnRightText:"Column Right",deleteText:"Delete",deleteRowText:"Delete Row",deleteColumnText:"Delete Column",deleteTableText:"Delete Table",mergeCellsText:"Merge Cells",splitCellsText:"Split Cell...",splitCellTitleText:"Split Cell",originalSizeText:"Default Size",advancedImageText:"Image Advanced Settings",hyperlinkText:"Hyperlink",editHyperlinkText:"Edit Hyperlink",removeHyperlinkText:"Remove Hyperlink",txtPressLink:"Press CTRL and click link",selectText:"Select",insertRowText:"Insert Row",insertColumnText:"Insert Column",rowText:"Row",columnText:"Column",cellText:"Cell",tableText:"Table",aboveText:"Above",belowText:"Below",advancedTableText:"Table Advanced Settings",txtSelectAll:"Select All",txtNewSlide:"New Slide",txtDuplicateSlide:"Duplicate Slide",txtDeleteSlide:"Delete Slide",txtBackground:"Background",txtChangeLayout:"Change Layout",txtPreview:"Start slideshow",textShapeAlignLeft:"Align Left",textShapeAlignRight:"Align Right",textShapeAlignCenter:"Align Center",textShapeAlignTop:"Align Top",textShapeAlignBottom:"Align Bottom",textShapeAlignMiddle:"Align Middle",textArrangeFront:"Bring To Front",textArrangeBack:"Send To Back",textArrangeForward:"Bring Forward",textArrangeBackward:"Send Backward",txtGroup:"Group",txtUngroup:"Ungroup",txtArrange:"Arrange",txtAlign:"Align",txtDistribHor:"Distribute Horizontally",txtDistribVert:"Distribute Vertically",txtSlide:"Slide",topCellText:"Align Top",centerCellText:"Align Center",bottomCellText:"Align Bottom",cellAlignText:"Cell Vertical Alignment",advancedShapeText:"Shape Advanced Settings",addCommentText:"Add Comment",editChartText:"Edit Data",vertAlignText:"Vertical Alignment",advancedParagraphText:"Text Advanced Settings",tipIsLocked:"This element is currently being edited by another user.",textNextPage:"Next Slide",textPrevPage:"Previous Slide",insertText:"Insert",textCopy:"Copy",textPaste:"Paste",textCut:"Cut",textSlideSettings:"Slide Settings",directionText:"Text Direction",directHText:"Horizontal",direct90Text:"Rotate at 90°",direct270Text:"Rotate at 270°",txtRemoveAccentChar:"Remove accent character",txtBorderProps:"Borders property",txtHideTop:"Hide top border",txtHideBottom:"Hide bottom border",txtHideLeft:"Hide left border",txtHideRight:"Hide right border",txtHideHor:"Hide horizontal line",txtHideVer:"Hide vertical line",txtHideLT:"Hide left top line",txtHideLB:"Hide left bottom line",txtAddTop:"Add top border",txtAddBottom:"Add bottom border",txtAddLeft:"Add left border",txtAddRight:"Add right border",txtAddHor:"Add horizontal line",txtAddVer:"Add vertical line",txtAddLT:"Add left top line",txtAddLB:"Add left bottom line",txtRemoveBar:"Remove bar",txtOverbar:"Bar over text",txtUnderbar:"Bar under text",txtRemScripts:"Remove scripts",txtRemSubscript:"Remove subscript",txtRemSuperscript:"Remove superscript",txtScriptsAfter:"Scripts after text",txtScriptsBefore:"Scripts before text",txtFractionStacked:"Change to stacked fraction",txtFractionSkewed:"Change to skewed fraction",txtFractionLinear:"Change to linear fraction",txtRemFractionBar:"Remove fraction bar",txtAddFractionBar:"Add fraction bar",txtRemLimit:"Remove limit",txtLimitOver:"Limit over text",txtLimitUnder:"Limit under text",txtHidePlaceholder:"Hide placeholder",txtShowPlaceholder:"Show placeholder",txtMatrixAlign:"Matrix alignment",txtColumnAlign:"Column alignment",txtTop:"Top",txtBottom:"Bottom",txtInsertEqBefore:"Insert equation before",txtInsertEqAfter:"Insert equation after",txtDeleteEq:"Delete equation",txtLimitChange:"Change limits location",txtHideTopLimit:"Hide top limit",txtShowTopLimit:"Show top limit",txtHideBottomLimit:"Hide bottom limit",txtShowBottomLimit:"Show bottom limit",txtInsertArgBefore:"Insert argument before",txtInsertArgAfter:"Insert argument after",txtDeleteArg:"Delete argument",txtHideOpenBracket:"Hide opening bracket",txtShowOpenBracket:"Show opening bracket",txtHideCloseBracket:"Hide closing bracket",txtShowCloseBracket:"Show closing bracket",txtStretchBrackets:"Stretch brackets",txtMatchBrackets:"Match brackets to argument height",txtGroupCharOver:"Char over text",txtGroupCharUnder:"Char under text",txtDeleteGroupChar:"Delete char",txtHideDegree:"Hide degree",txtShowDegree:"Show degree",txtIncreaseArg:"Increase argument size",txtDecreaseArg:"Decrease argument size",txtInsertBreak:"Insert manual break",txtDeleteBreak:"Delete manual break",txtAlignToChar:"Align to character",txtDeleteRadical:"Delete radical",txtDeleteChars:"Delete enclosing characters",txtDeleteCharsAndSeparators:"Delete enclosing characters and separators",alignmentText:"Alignment",leftText:"Left",rightText:"Right",centerText:"Center"},PE.Views.DocumentHolder||{}))});var c_paragraphLinerule={LINERULE_LEAST:0,LINERULE_AUTO:1,LINERULE_EXACT:2},c_tableBorder={BORDER_VERTICAL_LEFT:0,BORDER_HORIZONTAL_TOP:1,BORDER_VERTICAL_RIGHT:2,BORDER_HORIZONTAL_BOTTOM:3,BORDER_VERTICAL_CENTER:4,BORDER_HORIZONTAL_CENTER:5,BORDER_INNER:6,BORDER_OUTER:7,BORDER_ALL:8,BORDER_NONE:9,BORDER_ALL_TABLE:10,BORDER_NONE_TABLE:11,BORDER_INNER_TABLE:12,BORDER_OUTER_TABLE:13};define("presentationeditor/main/app/controller/DocumentHolder",["core","presentationeditor/main/app/view/DocumentHolder"],function(){"use strict";PE.Controllers.DocumentHolder=Backbone.Controller.extend({models:[],collections:[],views:["DocumentHolder"],initialize:function(){},onLaunch:function(){this.documentHolder=this.createView("DocumentHolder").render(),this.documentHolder.el.tabIndex=-1},setApi:function(e){this.api=e},createDelayedElements:function(){var e=this.getApplication().getController("Common.Controllers.ExternalDiagramEditor").getView("Common.Views.ExternalDiagramEditor");e&&(e.on("internalmessage",_.bind(function(t,n){var r=n.data.command,i=n.data.data;this.api&&(e.isEditMode()?this.api.asc_editChartDrawingObject(i):this.api.asc_addChartDrawingObject(i))},this)),e.on("hide",_.bind(function(e,t){this.documentHolder.fireEvent("editcomplete",this.documentHolder),this.api&&(this.api.asc_onCloseChartFrame(),this.api.asc_enableKeyEvents(!0))},this)))}})}),define("common/main/lib/view/ImageFromUrlDialog",["common/main/lib/component/Window"],function(){"use strict";Common.Views.ImageFromUrlDialog=Common.UI.Window.extend(_.extend({options:{width:330,header:!1,cls:"modal-dlg"},initialize:function(e){_.extend(this.options,e||{}),this.template=['
    ','
    ',"","
    ",'
    ',"
    ",'"].join(""),this.options.tpl=_.template(this.template,this.options),Common.UI.Window.prototype.initialize.call(this,this.options)},render:function(){Common.UI.Window.prototype.render.call(this);var e=this;e.inputUrl=new Common.UI.InputField({el:$("#id-dlg-url"),allowBlank:!1,blankError:e.txtEmpty,style:"width: 100%;",validateOnBlur:!1,validation:function(t){return/((^https?)|(^ftp)):\/\/.+/i.test(t)?!0:e.txtNotUrl}});var t=this.getChild();t.find(".btn").on("click",_.bind(this.onBtnClick,this)),t.find("input").on("keypress",_.bind(this.onKeyPress,this))},show:function(){Common.UI.Window.prototype.show.apply(this,arguments);var e=this;_.delay(function(){e.getChild("input").focus()},500)},onKeyPress:function(e){e.keyCode==Common.UI.Keys.RETURN&&this._handleInput("ok")},onBtnClick:function(e){this._handleInput(e.currentTarget.attributes.result.value)},_handleInput:function(e){if(this.options.handler){if(e=="ok"&&this.inputUrl.checkValidate()!==!0){this.inputUrl.cmpEl.find("input").focus();return}this.options.handler.call(this,e,this.inputUrl.getValue())}this.close()},textUrl:"Paste an image URL:",cancelButtonText:"Cancel",okButtonText:"Ok",txtEmpty:"This field is required",txtNotUrl:'This field should be a URL in the format "http://www.example.com"'},Common.Views.ImageFromUrlDialog||{}))});if(Common===undefined)var Common={};define("common/main/lib/view/InsertTableDialog",["common/main/lib/component/Window"],function(){"use strict";Common.Views.InsertTableDialog=Common.UI.Window.extend(_.extend({options:{width:230,height:170,header:!1,style:"min-width: 230px;",cls:"modal-dlg"},initialize:function(e){_.extend(this.options,e||{}),this.template=['
    ',"

    "+this.txtTitle+"

    ",'
    ','
    ',"
    ",'
    ','
    ',"
    ","
    ",'"].join(""),this.options.tpl=_.template(this.template,this.options),Common.UI.Window.prototype.initialize.call(this,this.options)},render:function(){Common.UI.Window.prototype.render.call(this);var e=this.getChild();e.find(".dlg-btn").on("click",_.bind(this.onBtnClick,this)),this.udColumns=new Common.UI.MetricSpinner({el:e.find(".columns-val"),step:1,width:64,value:2,defaultUnit:"",maxValue:63,minValue:1,allowDecimal:!1}),this.udRows=new Common.UI.MetricSpinner({el:e.find(".rows-val"),step:1,width:64,value:2,defaultUnit:"",maxValue:100,minValue:1,allowDecimal:!1})},onBtnClick:function(e){this.options.handler&&this.options.handler.call(this,e.currentTarget.attributes.result.value,{columns:this.udColumns.getValue(),rows:this.udRows.getValue()}),this.close()},onPrimary:function(){return this.options.handler&&this.options.handler.call(this,"ok",{columns:this.udColumns.getValue(),rows:this.udRows.getValue()}),this.close(),!1},txtTitle:"Table size",txtColumns:"Number of Columns",txtRows:"Number of Rows",textInvalidRowsCols:"You need to specify valid rows and columns count.",cancelButtonText:"Cancel",okButtonText:"Ok",txtMinText:"The minimum value for this field is {0}",txtMaxText:"The maximum value for this field is {0}"},Common.Views.InsertTableDialog||{}))});if(Common===undefined)var Common={};define("common/main/lib/util/define",[],function(){"use strict";Common.define={},Common.define.c_oAscMathMainType={Symbol:0,Fraction:1,Script:2,Radical:3,Integral:4,LargeOperator:5,Bracket:6,Function:7,Accent:8,LimitLog:9,Operator:10,Matrix:11},Common.define.c_oAscMathType={Symbol_pm:0,Symbol_infinity:1,Symbol_equals:2,Symbol_neq:3,Symbol_about:4,Symbol_times:5,Symbol_div:6,Symbol_factorial:7,Symbol_propto:8,Symbol_less:9,Symbol_ll:10,Symbol_greater:11,Symbol_gg:12,Symbol_leq:13,Symbol_geq:14,Symbol_mp:15,Symbol_cong:16,Symbol_approx:17,Symbol_equiv:18,Symbol_forall:19,Symbol_additional:20,Symbol_partial:21,Symbol_sqrt:22,Symbol_cbrt:23,Symbol_qdrt:24,Symbol_cup:25,Symbol_cap:26,Symbol_emptyset:27,Symbol_percent:28,Symbol_degree:29,Symbol_fahrenheit:30,Symbol_celsius:31,Symbol_inc:32,Symbol_nabla:33,Symbol_exists:34,Symbol_notexists:35,Symbol_in:36,Symbol_ni:37,Symbol_leftarrow:38,Symbol_uparrow:39,Symbol_rightarrow:40,Symbol_downarrow:41,Symbol_leftrightarrow:42,Symbol_therefore:43,Symbol_plus:44,Symbol_minus:45,Symbol_not:46,Symbol_ast:47,Symbol_bullet:48,Symbol_vdots:49,Symbol_cdots:50,Symbol_rddots:51,Symbol_ddots:52,Symbol_aleph:53,Symbol_beth:54,Symbol_QED:55,Symbol_alpha:65536,Symbol_beta:65537,Symbol_gamma:65538,Symbol_delta:65539,Symbol_varepsilon:65540,Symbol_epsilon:65541,Symbol_zeta:65542,Symbol_eta:65543,Symbol_theta:65544,Symbol_vartheta:65545,Symbol_iota:65546,Symbol_kappa:65547,Symbol_lambda:65548,Symbol_mu:65549,Symbol_nu:65550,Symbol_xsi:65551,Symbol_o:65552,Symbol_pi:65553,Symbol_varpi:65554,Symbol_rho:65555,Symbol_varrho:65556,Symbol_sigma:65557,Symbol_varsigma:65558,Symbol_tau:65559,Symbol_upsilon:65560,Symbol_varphi:65561,Symbol_phi:65562,Symbol_chi:65563,Symbol_psi:65564,Symbol_omega:65565,Symbol_Alpha:131072,Symbol_Beta:131073,Symbol_Gamma:131074,Symbol_Delta:131075,Symbol_Epsilon:131076,Symbol_Zeta:131077,Symbol_Eta:131078,Symbol_Theta:131079,Symbol_Iota:131080,Symbol_Kappa:131081,Symbol_Lambda:131082,Symbol_Mu:131083,Symbol_Nu:131084,Symbol_Xsi:131085,Symbol_O:131086,Symbol_Pi:131087,Symbol_Rho:131088,Symbol_Sigma:131089,Symbol_Tau:131090,Symbol_Upsilon:131091,Symbol_Phi:131092,Symbol_Chi:131093,Symbol_Psi:131094,Symbol_Omega:131095,FractionVertical:16777216,FractionDiagonal:16777217,FractionHorizontal:16777218,FractionSmall:16777219,FractionDifferential_1:16842752,FractionDifferential_2:16842753,FractionDifferential_3:16842754,FractionDifferential_4:16842755,FractionPi_2:16842756,ScriptSup:33554432,ScriptSub:33554433,ScriptSubSup:33554434,ScriptSubSupLeft:33554435,ScriptCustom_1:33619968,ScriptCustom_2:33619969,ScriptCustom_3:33619970,ScriptCustom_4:33619971,RadicalSqrt:50331648,RadicalRoot_n:50331649,RadicalRoot_2:50331650,RadicalRoot_3:50331651,RadicalCustom_1:50397184,RadicalCustom_2:50397185,Integral:67108864,IntegralSubSup:67108865,IntegralCenterSubSup:67108866,IntegralDouble:67108867,IntegralDoubleSubSup:67108868,IntegralDoubleCenterSubSup:67108869,IntegralTriple:67108870,IntegralTripleSubSup:67108871,IntegralTripleCenterSubSup:67108872,IntegralOriented:67174400,IntegralOrientedSubSup:67174401,IntegralOrientedCenterSubSup:67174402,IntegralOrientedDouble:67174403,IntegralOrientedDoubleSubSup:67174404,IntegralOrientedDoubleCenterSubSup:67174405,IntegralOrientedTriple:67174406,IntegralOrientedTripleSubSup:67174407,IntegralOrientedTripleCenterSubSup:67174408,Integral_dx:67239936,Integral_dy:67239937,Integral_dtheta:67239938,LargeOperator_Sum:83886080,LargeOperator_Sum_CenterSubSup:83886081,LargeOperator_Sum_SubSup:83886082,LargeOperator_Sum_CenterSub:83886083,LargeOperator_Sum_Sub:83886084,LargeOperator_Prod:83951616,LargeOperator_Prod_CenterSubSup:83951617,LargeOperator_Prod_SubSup:83951618,LargeOperator_Prod_CenterSub:83951619,LargeOperator_Prod_Sub:83951620,LargeOperator_CoProd:83951621,LargeOperator_CoProd_CenterSubSup:83951622,LargeOperator_CoProd_SubSup:83951623,LargeOperator_CoProd_CenterSub:83951624,LargeOperator_CoProd_Sub:83951625,LargeOperator_Union:84017152,LargeOperator_Union_CenterSubSup:84017153,LargeOperator_Union_SubSup:84017154,LargeOperator_Union_CenterSub:84017155,LargeOperator_Union_Sub:84017156,LargeOperator_Intersection:84017157,LargeOperator_Intersection_CenterSubSup:84017158,LargeOperator_Intersection_SubSup:84017159,LargeOperator_Intersection_CenterSub:84017160,LargeOperator_Intersection_Sub:84017161,LargeOperator_Disjunction:84082688,LargeOperator_Disjunction_CenterSubSup:84082689,LargeOperator_Disjunction_SubSup:84082690,LargeOperator_Disjunction_CenterSub:84082691,LargeOperator_Disjunction_Sub:84082692,LargeOperator_Conjunction:84082693,LargeOperator_Conjunction_CenterSubSup:84082694,LargeOperator_Conjunction_SubSup:84082695,LargeOperator_Conjunction_CenterSub:84082696,LargeOperator_Conjunction_Sub:84082697,LargeOperator_Custom_1:84148224,LargeOperator_Custom_2:84148225,LargeOperator_Custom_3:84148226,LargeOperator_Custom_4:84148227,LargeOperator_Custom_5:84148228,Bracket_Round:100663296,Bracket_Square:100663297,Bracket_Curve:100663298,Bracket_Angle:100663299,Bracket_LowLim:100663300,Bracket_UppLim:100663301,Bracket_Line:100663302,Bracket_LineDouble:100663303,Bracket_Square_OpenOpen:100663304,Bracket_Square_CloseClose:100663305,Bracket_Square_CloseOpen:100663306,Bracket_SquareDouble:100663307,Bracket_Round_Delimiter_2:100728832,Bracket_Curve_Delimiter_2:100728833,Bracket_Angle_Delimiter_2:100728834,Bracket_Angle_Delimiter_3:100728835,Bracket_Round_OpenNone:100794368,Bracket_Round_NoneOpen:100794369,Bracket_Square_OpenNone:100794370,Bracket_Square_NoneOpen:100794371,Bracket_Curve_OpenNone:100794372,Bracket_Curve_NoneOpen:100794373,Bracket_Angle_OpenNone:100794374,Bracket_Angle_NoneOpen:100794375,Bracket_LowLim_OpenNone:100794376,Bracket_LowLim_NoneNone:100794377,Bracket_UppLim_OpenNone:100794378,Bracket_UppLim_NoneOpen:100794379,Bracket_Line_OpenNone:100794380,Bracket_Line_NoneOpen:100794381,Bracket_LineDouble_OpenNone:100794382,Bracket_LineDouble_NoneOpen:100794383,Bracket_SquareDouble_OpenNone:100794384,Bracket_SquareDouble_NoneOpen:100794385,Bracket_Custom_1:100859904,Bracket_Custom_2:100859905,Bracket_Custom_3:100859906,Bracket_Custom_4:100859907,Bracket_Custom_5:100925440,Bracket_Custom_6:100925441,Bracket_Custom_7:100925442,Function_Sin:117440512,Function_Cos:117440513,Function_Tan:117440514,Function_Csc:117440515,Function_Sec:117440516,Function_Cot:117440517,Function_1_Sin:117506048,Function_1_Cos:117506049,Function_1_Tan:117506050,Function_1_Csc:117506051,Function_1_Sec:117506052,Function_1_Cot:117506053,Function_Sinh:117571584,Function_Cosh:117571585,Function_Tanh:117571586,Function_Csch:117571587,Function_Sech:117571588,Function_Coth:117571589,Function_1_Sinh:117637120,Function_1_Cosh:117637121,Function_1_Tanh:117637122,Function_1_Csch:117637123,Function_1_Sech:117637124,Function_1_Coth:117637125,Function_Custom_1:117702656,Function_Custom_2:117702657,Function_Custom_3:117702658,Accent_Dot:134217728,Accent_DDot:134217729,Accent_DDDot:134217730,Accent_Hat:134217731,Accent_Check:134217732,Accent_Accent:134217733,Accent_Grave:134217734,Accent_Smile:134217735,Accent_Tilde:134217736,Accent_Bar:134217737,Accent_DoubleBar:134217738,Accent_CurveBracketTop:134217739,Accent_CurveBracketBot:134217740,Accent_GroupTop:134217741,Accent_GroupBot:134217742,Accent_ArrowL:134217743,Accent_ArrowR:134217744,Accent_ArrowD:134217745,Accent_HarpoonL:134217746,Accent_HarpoonR:134217747,Accent_BorderBox:134283264,Accent_BorderBoxCustom:134283265,Accent_BarTop:134348800,Accent_BarBot:134348801,Accent_Custom_1:134414336,Accent_Custom_2:134414337,Accent_Custom_3:134414338,LimitLog_LogBase:150994944,LimitLog_Log:150994945,LimitLog_Lim:150994946,LimitLog_Min:150994947,LimitLog_Max:150994948,LimitLog_Ln:150994949,LimitLog_Custom_1:151060480,LimitLog_Custom_2:151060481,Operator_ColonEquals:167772160,Operator_EqualsEquals:167772161,Operator_PlusEquals:167772162,Operator_MinusEquals:167772163,Operator_Definition:167772164,Operator_UnitOfMeasure:167772165,Operator_DeltaEquals:167772166,Operator_ArrowL_Top:167837696,Operator_ArrowR_Top:167837697,Operator_ArrowL_Bot:167837698,Operator_ArrowR_Bot:167837699,Operator_DoubleArrowL_Top:167837700,Operator_DoubleArrowR_Top:167837701,Operator_DoubleArrowL_Bot:167837702,Operator_DoubleArrowR_Bot:167837703,Operator_ArrowD_Top:167837704,Operator_ArrowD_Bot:167837705,Operator_DoubleArrowD_Top:167837706,Operator_DoubleArrowD_Bot:167837707,Operator_Custom_1:167903232,Operator_Custom_2:167903233,Matrix_1_2:184549376,Matrix_2_1:184549377,Matrix_1_3:184549378,Matrix_3_1:184549379,Matrix_2_2:184549380,Matrix_2_3:184549381,Matrix_3_2:184549382,Matrix_3_3:184549383,Matrix_Dots_Center:184614912,Matrix_Dots_Baseline:184614913,Matrix_Dots_Vertical:184614914,Matrix_Dots_Diagonal:184614915,Matrix_Identity_2:184680448,Matrix_Identity_2_NoZeros:184680449,Matrix_Identity_3:184680450,Matrix_Identity_3_NoZeros:184680451,Matrix_2_2_RoundBracket:184745984,Matrix_2_2_SquareBracket:184745985,Matrix_2_2_LineBracket:184745986,Matrix_2_2_DLineBracket:184745987,Matrix_Flat_Round:184811520,Matrix_Flat_Square:184811521}}),define("text!presentationeditor/main/app/template/Toolbar.template",[],function(){return'
    \n\n\n\n
    \n
    \n
    \n \n \n
    \n
    \n
    \n
    \n
    \n \n \n
    \n
    \n
    \n
    \n
    \n \n \n
    \n
    \n
    \n
    \n
    \n \n \n
    \n
    \n
    \n
    \n \n \n \n \n
    \n
    \n
    \n
    \n
    \n \n \n \n \n \n
    \n
    \n
    \n
    \n
    \n \n \n
    \n
    \n
    \n
    \n
    \n \n \n \n \n \n \n
    \n
    \n
    \n
    \n
    \n \n
    \n
    \n
    \n
    \n
    \n
    \n \n
    \n
    \n
    \n
    \n\n\n\n
    \n
    \n
    \n \n
    \n
    \n \n
    \n
    \n
    \n
    \n
    \n \n
    \n
    \n
    \n
    \n \n
    \n
    \n \n
    \n
    \n
    \n
    \n
    \n \n
    \n
    \n \n
    \n
    \n
    \n
    \n
    \n \n \n
    \n
    \n \n \n
    \n
    \n
    \n
    \n
    \n \n \n
    \n
    \n \n \n \n \n \n \n \n
    \n
    \n
    \n
    \n
    \n \n \n \n \n
    \n
    \n \n \n \n
    \n
    \n
    \n
    \n
    \n \n \n \n \n
    \n
    \n \n \n \n
    \n
    \n
    \n
    \n
    \n \n
    \n
    \n \n
    \n
    \n
    \n
    \n
    \n \n
    \n
    \n \n
    \n
    \n
    \n
    \n \n
    \n
    \n \n
    \n
    \n
    \n
    \n
    \n
    \n \n
    \n
    \n \n
    \n
    \n
    \n
    '});if(Common===undefined)var Common={};Common.Models=Common.Models||{},define("common/main/lib/model/Font",["backbone"],function(e){"use strict";Common.Models.Font=e.Model.extend({defaults:function(){return{id:Common.UI.getId(),name:null,cloneid:null,imgidx:0,type:0}}})});if(Common===undefined)var Common={};Common.Collections=Common.Collections||{},define("common/main/lib/collection/Fonts",["backbone","common/main/lib/model/Font"],function(e){"use strict";Common.Collections.Fonts=e.Collection.extend({model:Common.Models.Font,comparator:function(e,t){var n=e.get("name").toLowerCase(),r=t.get("name").toLowerCase();return n==r?0:n",'","<% } else if (split == false) {%>",'
    ','","
    ","<% } else { %>",'
    ','",'","
    ","<% } %>"].join("")),initialize:function(e){Common.UI.BaseView.prototype.initialize.call(this,e);var t=this;t.id=t.options.id||Common.UI.getId(),t.hint=t.options.hint,t.enableToggle=t.options.enableToggle,t.allowDepress=t.options.allowDepress,t.cls=t.options.cls,t.iconCls=t.options.iconCls,t.menu=t.options.menu,t.split=t.options.split,t.toggleGroup=t.options.toggleGroup,t.disabled=t.options.disabled,t.pressed=t.options.pressed,t.caption=t.options.caption,t.template=t.options.template||t.template,t.style=t.options.style,t.rendered=!1,t.options.el&&t.render()},render:function(e){var t=this;t.trigger("render:before",t),t.cmpEl=$(t.el),e&&(t.setElement(e,!1),t.rendered||(t.cmpEl=$(this.template({id:t.id,cls:t.cls,iconCls:t.iconCls,menu:t.menu,split:t.split,disabled:t.disabled,pressed:t.pressed,caption:t.caption,style:t.style})),t.menu&&_.isObject(t.menu)&&_.isFunction(t.menu.render)&&t.menu.render(t.cmpEl),e.html(t.cmpEl)));if(!t.rendered){var n=t.cmpEl,r=n.hasClass("btn-group"),i=n.hasClass("split");if(t.options.hint){var s=t.cmpEl.closest(".asc-window");t.cmpEl.attr("data-toggle","tooltip"),t.cmpEl.tooltip({title:t.options.hint,placement:t.options.hintAnchor||"cursor"}),s.length>0&&t.cmpEl.data("bs.tooltip").tip().css("z-index",parseInt(s.css("z-index"))+10)}_.isString(t.toggleGroup)&&(t.enableToggle=!0);var o=function(e){if(!t.disabled&&e.which==1){t.doToggle();if(t.options.hint){var n=t.cmpEl.data("bs.tooltip");n&&(n.dontShow===undefined&&(n.dontShow=!0),n.hide())}t.trigger("click",t,e)}},u=function(e,r){if(!e){var s=!1;_.each($("button",n),function(e){if($(e).is(":hover"))return s=!0,!1}),s||(n.removeClass("over"),$("button",n).removeClass("over"))}if(!e&&t.enableToggle&&t.allowDepress&&t.pressed)return;if(e&&!i&&t.enableToggle&&t.allowDepress&&!t.pressed){r.preventDefault();return}$("button:first",n).toggleClass("active",e),$("[data-toggle^=dropdown]",n).toggleClass("active",e),n.toggleClass("active",e)},a=function(e){if(!t.disabled&&e.which==1&&i){if(t.options.hint){var r=t.cmpEl.data("bs.tooltip");r&&(r.dontShow===undefined&&(r.dontShow=!0),r.hide())}var s=n.hasClass("open");u(!s,e)}},f=function(e,t){i?u(t,e):(n.toggleClass("active",t),$("button",n).toggleClass("active",t))},l=function(e){u(!0,e),$(document).on("mouseup",c)},c=function(e){u(!1,e),$(document).off("mouseup",c)},h=function(e,n){t.cmpEl.find(".dropdown-toggle").blur(),t.cmpEl.hasClass("active")!==t.pressed&&t.cmpEl.trigger("button.internal.active",[t.pressed])};r?(i&&($("[data-toggle^=dropdown]",n).on("mousedown",_.bind(a,this)),$("button",n).on("mousedown",_.bind(l,this))),n.on("hide.bs.dropdown",_.bind(u,t,!1)),n.on("show.bs.dropdown",_.bind(u,t,!0)),n.on("hidden.bs.dropdown",_.bind(h,t)),$("button:first",n).on("click",o)):n.on("click",o),n.on("button.internal.active",_.bind(f,t)),n.on("mouseover",function(e){t.disabled||(t.cmpEl.addClass("over"),t.trigger("mouseover",t,e))}),n.on("mouseout",function(e){t.disabled||(t.cmpEl.removeClass("over"),t.trigger("mouseout",t,e))}),Common.UI.ToggleManager.register(t)}return t.rendered=!0,t.pressed&&t.toggle(t.pressed,!0),t.disabled&&t.setDisabled(!(t.disabled=!1)),t.trigger("render:after",t),this},doToggle:function(){var e=this;e.enableToggle&&(e.allowDepress!==!1||!e.pressed)&&e.toggle()},toggle:function(e,t){var n=e===undefined?!this.pressed:!!e;this.pressed=n,this.cmpEl&&this.cmpEl.trigger("button.internal.active",[n]),t||this.trigger("toggle",this,n)},isActive:function(){return this.enableToggle?this.pressed:this.cmpEl.hasClass("active")},setDisabled:function(e){if(this.rendered&&this.disabled!=e){var t=this.cmpEl,n=t.hasClass("btn-group"),r=this;e=e===!0;if(e!==t.hasClass("disabled")){var i=function(t){t.toggleClass("disabled",e),r.options.allowMouseEventsOnDisabled||(e?t.attr({disabled:e}):t.removeAttr("disabled"))};i(t),n&&i(t.children("button"))}if(e||!Common.Utils.isGecko){var s=this.cmpEl.data("bs.tooltip");s&&(e&&s.hide(),!Common.Utils.isGecko&&(s.enabled=!e))}}this.disabled=e},isDisabled:function(){return this.disabled},setIconCls:function(e){var t=$(this.el).find("span.btn-icon"),n=this.iconCls;this.iconCls=e,t.removeClass(n),t.addClass(e||"")},setVisible:function(e){this.cmpEl&&this.cmpEl.toggleClass("hidden",!e)},updateHint:function(e){this.options.hint=e;if(!this.rendered)return;var t=this.cmpEl,n=t.closest(".asc-window");t.data("bs.tooltip")&&t.removeData("bs.tooltip"),t.attr("data-toggle","tooltip"),t.tooltip({title:e,placement:this.options.hintAnchor||"cursor"}),n.length>0&&t.data("bs.tooltip").tip().css("z-index",parseInt(n.css("z-index"))+10)},setCaption:function(e){if(this.caption!=e){this.caption=e;if(this.rendered){var t=this.cmpEl.find("button:first > .caption").andSelf().filter("button > .caption");t.length>0?t.text(e):this.cmpEl.find("button:first").andSelf().filter("button").text(e)}}},setMenu:function(e){e&&_.isObject(e)&&_.isFunction(e.render)&&(this.menu=e,this.rendered&&this.menu.render(this.cmpEl))}})});if(Common===undefined)var Common={};define("common/main/lib/component/ColorPalette",["common/main/lib/component/BaseView"],function(){"use strict";Common.UI.ColorPalette=Common.UI.BaseView.extend({options:{allowReselect:!0,cls:"",style:""},template:_.template(['
    ',"<% _.each(colors, function(color, index) { %>",'',"<% }) %>","
    "].join("")),initialize:function(e){Common.UI.BaseView.prototype.initialize.call(this,e);var t=this;this.id=t.options.id,this.cls=t.options.cls,this.style=t.options.style,this.colors=t.options.colors||[],this.value=t.options.value,t.options.el&&t.render()},render:function(e){var t=this;t.rendered?this.cmpEl=$(this.el):(this.cmpEl=$(this.template({id:this.id,cls:this.cls,style:this.style,colors:this.colors})),e?(this.setElement(e,!1),e.html(this.cmpEl)):$(this.el).html(this.cmpEl));if(!t.rendered){var n=this.cmpEl;n.on("click","span.color-item",_.bind(this.itemClick,this))}return t.rendered=!0,this},itemClick:function(e){var t=$(e.target);this.select(t.attr("data-color"))},select:function(e,t){if(this.value!=e){var n=this;$("span.color-item",this.cmpEl).removeClass("selected"),this.value=e,e&&/#?[a-fA-F0-9]{6}/.test(e)&&(e=/#?([a-fA-F0-9]{6})/.exec(e)[1].toUpperCase(),$("span[data-color="+e+"]",this.cmpEl).addClass("selected"),t||n.trigger("select",n,this.value))}}})}),define("text!common/main/lib/template/ExtendedColorDialog.template",[],function(){return'
    \r\n
    \r\n
    \r\n
    \r\n
    \r\n \r\n
    \r\n
    \r\n \r\n
    \r\n
    \r\n \r\n
    \r\n
    \r\n
    \r\n \r\n
    \r\n
    \r\n
    \r\n \r\n
    \r\n
    \r\n
    \r\n \r\n \r\n
    \r\n
    \r\n
    \r\n\r\n'});if(Common===undefined)var Common={};define("common/main/lib/component/HSBColorPicker",["common/main/lib/component/BaseView","common/main/lib/util/utils"],function(){"use strict";Common.UI.HSBColorPicker=Common.UI.BaseView.extend({template:_.template('
    <% if (this.showCurrentColor) { %>
    <% } %>
    <% if (this.changeSaturation) { %>
    <% } %>
    <% if (this.allowEmptyColor) { %>
    <%= this.textNoColor %>
    <% } %>
    '),color:"#ff0000",options:{allowEmptyColor:!1,changeSaturation:!0,showCurrentColor:!0},initialize:function(e){Common.UI.BaseView.prototype.initialize.call(this,e);var t=this,n=$(this.el),r,i,s,o,u,a,f,l,c=0,h=100,p=100;t.allowEmptyColor=t.options.allowEmptyColor,t.changeSaturation=t.options.changeSaturation,t.showCurrentColor=t.options.showCurrentColor;var d=function(e,n){var r=new Common.Utils.RGBColor("hsb("+e.h+","+e.s+","+e.b+")"),i=r.toHex();t.color=n?"transparent":i,v(),t.trigger("changecolor",t,t.color)},v=function(){u.length>0&&a.length>0&&(t.color=="transparent"?a.show():(u.css("background-color",t.color),a.hide())),s.length>0&&s.css("background-color",(new Common.Utils.RGBColor("hsb("+c+", 100, 100)")).toHex()),f.length>0&&(f[0].innerHTML=t.color=="transparent"?t.textNoColor:t.color.toUpperCase()),r.length>0&&i.length>0&&(r.css("left",h+"%"),r.css("top",100-p+"%"),i.css("top",parseInt(c*100/360)+"%"))},m=function(e,t,n){if(r.length>0&&s.length>0){var i=[Math.max(0,Math.min(100,parseInt((e.pageX*Common.Utils.zoom()-s.offset().left)/s.width()*100))),Math.max(0,Math.min(100,parseInt((e.pageY*Common.Utils.zoom()-s.offset().top)/s.height()*100)))];r.css("left",i[0]+"%"),r.css("top",i[1]+"%"),h=i[0],p=100-i[1],d({h:c,s:h,b:p})}},g=function(e,t,n){if(i&&o){var r=Math.max(0,Math.min(100,parseInt((e.pageY*Common.Utils.zoom()-o.offset().top)/o.height()*100)));i.css("top",r+"%"),c=parseInt(360*r/100),d({h:c,s:h,b:p})}},y=function(e,t,n){$(document).on("mouseup",b),$(document).on("mousemove",m)},b=function(e,t,n){$(document).off("mouseup",b),$(document).off("mousemove",m),m(e,t,n)},w=function(e,t,n){$(document).on("mouseup",E),$(document).on("mousemove",g),g(e,t,n)},E=function(e,t,n){$(document).off("mouseup",E),$(document).off("mousemove",g)},S=function(e){var n=(new Common.util.RGBColor(t.color)).toHSB();d(n,!0)},x=function(e){var n=$(t.el),d;n&&(r=n.find(".cnt-hb-arrow"),i=n.find(".cnt-sat-arrow"),s=n.find(".cnt-hb"),o=n.find(".cnt-sat"),u=n.find(".color-value"),f=n.find(".color-text"),l=n.find(".empty-color"),u.length>0&&(a=u.find(".transparent-color")),s.length>0&&(s.off("mousedown"),s.on("mousedown",y)),o.length>0&&(o.off("mousedown"),o.on("mousedown",w)),l.length>0&&(l.off("click"),l.on("click",S)),t.color=="transparent"?d={h:0,s:100,b:100}:d=(new Common.Utils.RGBColor(t.color)).toHSB(),c=d.h,h=d.s,p=d.b,c==h&&c==p&&c==0&&(h=100),v())};t.setColor=function(e){if(t.color==e)return;var n;e=="transparent"?n={h:0,s:100,b:100}:n=(new Common.Utils.RGBColor(e)).toHSB(),c=n.h,h=n.s,p=n.b,c==h&&c==p&&c==0&&(h=100),t.color=e,v()},t.getColor=function(){return t.color},t.on("render:after",x),t.render()},render:function(){return $(this.el).html(this.template()),this.trigger("render:after",this),this},textNoColor:"No Color"})});if(Common===undefined)var Common={};define("common/main/lib/component/MaskedField",["common/main/lib/component/BaseView"],function(){"use strict";Common.UI.MaskedField=Common.UI.BaseView.extend({options:{maskExp:"",maxLength:999},initialize:function(e){Common.UI.BaseView.prototype.initialize.call(this,e);var t=this,n=$(this.el);n.addClass("masked-field user-select"),n.attr("maxlength",t.options.maxLength),n.on("keypress",function(e){var r=String.fromCharCode(e.which);!t.options.maskExp.test(r)&&!e.ctrlKey&&e.keyCode!==Common.UI.Keys.DELETE&&e.keyCode!==Common.UI.Keys.BACKSPACE&&e.keyCode!==Common.UI.Keys.LEFT&&e.keyCode!==Common.UI.Keys.RIGHT&&e.keyCode!==Common.UI.Keys.HOME&&e.keyCode!==Common.UI.Keys.END&&e.keyCode!==Common.UI.Keys.ESC&&e.keyCode!==Common.UI.Keys.INSERT&&e.keyCode!==Common.UI.Keys.TAB&&(e.keyCode==Common.UI.Keys.RETURN&&t.trigger("changed",t,n.val()),e.preventDefault(),e.stopPropagation())}),n.on("input",function(e){t.trigger("change",t,n.val())}),n.on("blur",function(e){t.trigger("changed",t,n.val())})},render:function(){return this},setValue:function(e){this.options.maskExp.test(e)&&e.length<=this.options.maxLength&&$(this.el).val(e)},getValue:function(){$(this.el).val()}})});if(Common===undefined)var Common={};define("common/main/lib/view/ExtendedColorDialog",["text!common/main/lib/template/ExtendedColorDialog.template","common/main/lib/component/HSBColorPicker","common/main/lib/component/MetricSpinner","common/main/lib/component/MaskedField","common/main/lib/component/Window"],function(e){"use strict";Common.UI.ExtendedColorDialog=Common.UI.Window.extend(_.extend({tpl:_.template(e),options:{},rendered:!1,initialize:function(e){Common.UI.Window.prototype.initialize.call(this,{cls:"extended-color-dlg",tpl:this.tpl({txtNew:this.textNew,txtCurrent:this.textCurrent,txtAdd:this.addButtonText,txtCancel:this.cancelButtonText}),header:!1,width:340,height:272}),this.hexRe=/\s*#?([0-9a-fA-F][0-9a-fA-F]?)([0-9a-fA-F][0-9a-fA-F]?)([0-9a-fA-F][0-9a-fA-F]?)\s*/},render:function(){function t(t){e.trigger("onmodalresult",parseInt(t.currentTarget.attributes.result.value)),e.close(!0)}var e=this;return Common.UI.Window.prototype.render.call(this),this.colorsPicker=new Common.UI.HSBColorPicker({el:$("#id-hsb-colorpicker"),showCurrentColor:!1}),this.colorsPicker.on("changecolor",_.bind(this.onChangeColor,this)),this.colorNew=$("#field-new-color"),this.colorSaved=$("#field-start-color"),this.spinR=new Common.UI.MetricSpinner({el:$("#extended-spin-r"),step:1,width:63,value:"0",defaultUnit:"",maxValue:255,minValue:0,tabindex:1,maskExp:/[0-9]/,allowDecimal:!1}),this.spinG=new Common.UI.MetricSpinner({el:$("#extended-spin-g"),step:1,width:63,value:"0",defaultUnit:"",maxValue:255,minValue:0,tabindex:2,maskExp:/[0-9]/,allowDecimal:!1}),this.spinB=new Common.UI.MetricSpinner({el:$("#extended-spin-b"),step:1,width:63,value:"0",defaultUnit:"",maxValue:255,minValue:0,tabindex:3,maskExp:/[0-9]/,allowDecimal:!1}),this.textColor=new Common.UI.MaskedField({el:$("#extended-text-color"),width:55,maskExp:/[a-fA-F0-9]/,maxLength:6}),this.spinR.on("change",_.bind(this.showColor,this,null,!0)).on("changing",_.bind(this.onChangingRGB,this,1)),this.spinG.on("change",_.bind(this.showColor,this,null,!0)).on("changing",_.bind(this.onChangingRGB,this,2)),this.spinB.on("change",_.bind(this.showColor,this,null,!0)).on("changing",_.bind(this.onChangingRGB,this,3)),this.textColor.on("change",_.bind(this.onChangeMaskedField,this)),this.textColor.on("changed",_.bind(this.onChangedMaskedField,this)),this.textColor.$el.attr("tabindex",4),this.spinR.$el.find("input").attr("maxlength",3),this.spinG.$el.find("input").attr("maxlength",3),this.spinB.$el.find("input").attr("maxlength",3),this.on("close",function(){e.trigger("onmodalresult",0)}),$(this)[0].getChild(".footer .dlg-btn").on("click",t),this.rendered=!0,this.color!==undefined&&this.setColor(this.color),this},onChangeColor:function(e,t){this.colorNew.css({"background-color":t}),this.stopevents=!0;var n=t.match(this.hexRe);this.spinR.setValue(parseInt(n[1],16)),this.spinG.setValue(parseInt(n[2],16)),this.spinB.setValue(parseInt(n[3],16)),this.textColor.setValue((n[1]+n[2]+n[3]).toUpperCase()),this.stopevents=!1},showColor:function(e,t){if(!this.stopevents){var n=this.spinR.getNumberValue(),r=n==null||n<0?0:n>255?255:n;t&&this.spinR.setValue(r,!0),r=r.toString(16),n=this.spinG.getNumberValue();var i=n==null||n<0?0:n>255?255:n;t&&this.spinG.setValue(i,!0),i=i.toString(16),n=this.spinB.getNumberValue();var s=n==null||n<0?0:n>255?255:n;t&&this.spinB.setValue(s,!0),s=s.toString(16);var o=(r.length==1?"0"+r:r)+(i.length==1?"0"+i:i)+(s.length==1?"0"+s:s);this.colorsPicker.setColor("#"+o),e!="hex"&&this.textColor.setValue(o.toUpperCase()),this.colorNew.css("background-color","#"+o)}},onChangingRGB:function(e,t,n,r){if(!this.stopevents){var i,s,o,u;n=_.isEmpty(n)||isNaN(parseInt(n))?parseInt(t.getValue()):parseInt(n);switch(e){case 1:i=(n==null||isNaN(n)||n<0?0:n>255?255:n).toString(16),u=this.spinG.getNumberValue(),s=(u==null||u<0?0:u>255?255:u).toString(16),u=this.spinB.getNumberValue(),o=(u==null||u<0?0:u>255?255:u).toString(16);break;case 2:u=this.spinR.getNumberValue(),i=(u==null||u<0?0:u>255?255:u).toString(16),s=(n==null||isNaN(n)||n<0?0:n>255?255:n).toString(16),u=this.spinB.getNumberValue(),o=(u==null||u<0?0:u>255?255:u).toString(16);break;case 3:u=this.spinR.getNumberValue(),i=(u==null||u<0?0:u>255?255:u).toString(16),u=this.spinG.getNumberValue(),s=(u==null||u<0?0:u>255?255:u).toString(16),o=(n==null||isNaN(n)||n<0?0:n>255?255:n).toString(16)}var a=(i.length==1?"0"+i:i)+(s.length==1?"0"+s:s)+(o.length==1?"0"+o:o);this.colorsPicker.setColor("#"+a),this.textColor.setValue(a.toUpperCase()),this.colorNew.css("background-color","#"+a)}},onChangeMaskedField:function(e,t){t=/^[a-fA-F0-9]{0,6}$/.test(t)?t:"000000",t="000000"+t;var n=t.match(/([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})$/i);this.stopevents=!0,this.spinR.setValue(parseInt(n[1],16)),this.spinG.setValue(parseInt(n[2],16)),this.spinB.setValue(parseInt(n[3],16)),this.stopevents=!1,this.rendered&&this.showColor("hex")},onChangedMaskedField:function(e,t){var n=this;(!/^[a-fA-F0-9]{0,6}$/.test(t)||_.isEmpty(t))&&e.setValue("000000"),this.rendered&&this.showColor("",!0)},getColor:function(){var e=/#?([a-fA-F0-9]{6})/.exec(this.colorsPicker.getColor());return e?e[1]:null},setColor:function(e){function r(){e=="transparent"?t.colorSaved.addClass("color-transparent"):(t.colorSaved.removeClass("color-transparent"),t.colorSaved.css("background-color","#"+e)),t.colorNew.css("background-color","#"+n)}var t=this;if(this.rendered!==!0){this.color=e;return}var n=/#?([a-fA-F0-9]{6})/.test(e)?e:"ff0000";t.colorsPicker.setColor("#"+n),r(),t.stopevents=!0;var i=t.hexRe.exec(n);t.spinR.setValue(parseInt(i[1],16)),t.spinG.setValue(parseInt(i[2],16)),t.spinB.setValue(parseInt(i[3],16)),t.textColor.setValue((i[1]+i[2]+i[3]).toUpperCase()),t.stopevents=!1},show:function(){Common.UI.Window.prototype.show.apply(this,arguments);var e=this;_.delay(function(){e.getChild("#extended-text-color").focus()},50)},cancelButtonText:"Cancel",addButtonText:"Add",textNew:"New",textCurrent:"Current",textRGBErr:"The entered value is incorrect.
    Please enter a numeric value between 0 and 255.",textHexErr:"The entered value is incorrect.
    Please enter a value between 000000 and FFFFFF."},Common.UI.ExtendedColorDialog||{}))});if(Common===undefined)var Common={};define("common/main/lib/component/ThemeColorPalette",["common/main/lib/component/BaseView","common/main/lib/view/ExtendedColorDialog"],function(){"use strict";Common.UI.ThemeColorPalette=Common.UI.BaseView.extend(_.extend({options:{dynamiccolors:10,standardcolors:10,themecolors:10,effects:5,allowReselect:!0,transparent:!1,value:"000000"},template:_.template('
    <% var me = this; %><% $(colors).each(function(num, item) { %><% if (me.isBlankSeparator(item)) { %>
    <% } else if (me.isSeparator(item)) { %>
    <% } else if (me.isColor(item)) { %>  <% } else if (me.isTransparent(item)) { %> <% } else if (me.isEffect(item)) { %> <% } else if (me.isCaption(item)) { %>
    <%=item%>
    <% } %><% }); %>
    <% if (me.options.dynamiccolors!==undefined) { %>
    <% for (var i=0; i <% } %><% } %>
    '),colorRe:/(?:^|\s)color-(.{6})(?:\s|$)/,selectedCls:"selected",initialize:function(e){Common.UI.BaseView.prototype.initialize.call(this,e);var t=this,n=$(this.el);this.colors=t.options.colors||this.generateColorData(t.options.themecolors,t.options.effects,t.options.standardcolors,t.options.transparent),n.addClass("theme-colorpalette"),this.render(),this.options.updateColorsArr&&this.updateColors(this.options.updateColorsArr[0],this.options.updateColorsArr[1]),this.options.value&&this.select(this.options.value,!0),this.updateCustomColors(),n.closest(".btn-group").on("show.bs.dropdown",_.bind(this.updateCustomColors,this)),n.closest(".dropdown-submenu").on("show.bs.dropdown",_.bind(this.updateCustomColors,this)),n.on("click",_.bind(this.handleClick,this))},render:function(){return $(this.el).html(this.template({colors:this.colors})),this},isBlankSeparator:function(e){return typeof e=="string"&&e=="-"},isSeparator:function(e){return typeof e=="string"&&e=="--"},isColor:function(e){return typeof e=="string"&&/[0-9A-F]{6}/.test(e)},isTransparent:function(e){return typeof e=="string"&&e=="transparent"},isCaption:function(e){return typeof e=="string"&&e!="-"&&e!="--"&&!/[0-9A-F]{6}|transparent/.test(e)},isEffect:function(e){return typeof e=="object"&&e.effectId!==undefined},getColor:function(){return this.value},updateCustomColors:function(){var e=$(this.el);if(e){var t=Common.localStorage.getItem("asc."+Common.localStorage.getId()+".colors.custom");t=t?t.split(","):[];var n=-1,r,i=t.lengththis.options.dynamiccolors&&n.shift(),Common.localStorage.setItem(t,n.join().toUpperCase())},addNewColor:function(e){var t=this,n=new Common.UI.ExtendedColorDialog({});n.on("onmodalresult",function(e){t._isdlgopen=!1,e==1&&(t.setCustomColor(n.getColor()),t.fireEvent("select",t,n.getColor()))}),t._isdlgopen=!0,n.setColor(t.value!==undefined&&t.value!==!1?t.value:e!==undefined?e:"000000"),n.show()},isDialogOpen:function(){return this._isdlgopen==1},select:function(e,t){var n=$(this.el);n.find("a."+this.selectedCls).removeClass(this.selectedCls);if(typeof e=="object"){var r;e.effectId!==undefined?(r=n.find('a[effectid="'+e.effectId+'"]').first(),r.length>0?(r.addClass(this.selectedCls),this.value=r[0].className.match(this.colorRe)[1].toUpperCase()):this.value=!1):e.effectValue!==undefined&&(r=n.find('a[effectvalue="'+e.effectValue+'"].color-'+e.color.toUpperCase()).first(),r.length>0?(r.addClass(this.selectedCls),this.value=r[0].className.match(this.colorRe)[1].toUpperCase()):this.value=!1)}else{/#?[a-fA-F0-9]{6}/.test(e)&&(e=/#?([a-fA-F0-9]{6})/.exec(e)[1].toUpperCase(),this.value=e);if(/^[a-fA-F0-9]{6}|transparent$/.test(e)&&_.indexOf(this.colors,e)>=0){_.indexOf(this.colors,this.value)<0&&(this.value=!1);if(e!=this.value||this.options.allowReselect)e=="transparent"?n.find("a.color-transparent").addClass(this.selectedCls):n.find("a.palette-color.color-"+e).first().addClass(this.selectedCls),this.value=e,t!==!0&&this.fireEvent("select",this,e)}else{var i=n.find("#"+e).first();i.length==0&&(i=n.find('a[color="'+e+'"]').first()),i.length>0&&(i.addClass(this.selectedCls),this.value=e.toUpperCase())}}},updateColors:function(e,t,n){if(e===undefined||t===undefined)return;var r=this,i=$(this.el);r.aColorElements===undefined&&(r.aColorElements=i.find("a.palette-color")),r.aEffectElements===undefined&&(r.aEffectElements=i.find("a.palette-color-effect"));var s,o=0,u=0;for(var a=0;a=t.length)continue;s=$(r.aColorElements[o]),s.removeClass("color-"+r.colors[a]),r.colors[a]=t[o].toUpperCase(),s.addClass("color-"+r.colors[a]),s.css({background:"#"+r.colors[a]}),s.find("span").first().css({background:"#"+r.colors[a]}),o++}else if(typeof r.colors[a]=="object"&&r.colors[a].effectId!==undefined){if(u>=e.length)continue;s=$(r.aEffectElements[u]),e[u].color=e[u].color.toUpperCase(),r.colors[a].color!==e[u].color&&(s.removeClass("color-"+r.colors[a].color),s.addClass("color-"+e[u].color),s.css({background:"#"+e[u].color}),s.find("span").first().css({background:"#"+e[u].color})),r.colors[a].effectId!==e[u].effectId&&s.attr("effectid",""+e[u].effectId),r.colors[a].effectValue!==e[u].effectValue&&s.attr("effectvalue",""+e[u].effectValue),r.colors[a]=e[u],u++}if(n)this.select(n,!0);else{var f=$(this.el).find("a."+this.selectedCls);f.length&&f.hasClass("palette-color-effect")&&(this.value=f[0].className.match(this.colorRe)[1].toUpperCase())}this.options.updateColorsArr=undefined},clearSelection:function(e){$(this.el).find("a."+this.selectedCls).removeClass(this.selectedCls),this.value=undefined},generateColorData:function(e,t,n,r){var i=[],s=e>0&&t>0?e*t:0;if(e>0){i=[this.textThemeColors,"-"];for(var o=0;o0&&i.push("-");for(var o=0;o','
    0x0
    ','
    ','
    ','
    ','
    ',"
    ","
    "].join("")),initialize:function(c){Common.UI.BaseView.prototype.initialize.call(this,c),e=this,t=$(this.el),e.itemSize=e.options.itemSize,e.minRows=e.options.minRows,e.minColumns=e.options.minColumns,e.maxRows=e.options.maxRows,e.maxColumns=e.options.maxColumns,this.render(),t&&(n=t.find(".dimension-picker-mousecatcher"),r=t.find(".dimension-picker-unhighlighted"),i=t.find(".dimension-picker-highlighted"),s=t.find(".dimension-picker-status"),t.css({width:e.minColumns+"em"}),n.css("z-index",1),n.width(e.maxColumns+"em").height(e.maxRows+"em"),r.width(e.minColumns+"em").height(e.minRows+"em"),s.html(o+" x "+u),s.width(r.width())),n.on("mousemove",a),i.on("mousemove",a),r.on("mousemove",a),n.on("mouseleave",f),i.on("mouseleave",f),r.on("mouseleave",f),n.on("click",l),i.on("click",l),r.on("click",l)},render:function(){return $(this.el).html(this.template()),this},setTableSize:function(n,a,f){n>this.maxColumns&&(n=this.maxColumns),a>this.maxRows&&(a=this.maxRows);if(o!=n||u!=a)o=n,u=a,i.width(o+"em").height(u+"em"),r.width((oe.maxColumns?e.maxColumns:o+1)+"em").height((ue.maxRows?e.maxRows:u+1)+"em"),t.width(r.width()),s.html(o+" x "+u),s.width(r.width()),e.trigger("change",e,o,u,f)},getColumnsCount:function(){return o},getRowsCount:function(){return u}}}())});if(Common===undefined)var Common={};var FONT_TYPE_RECENT=4;define("common/main/lib/component/ComboBoxFonts",["common/main/lib/component/ComboBox"],function(){"use strict";Common.UI.ComboBoxFonts=Common.UI.ComboBox.extend(function(){var e=302,t=Asc.FONT_THUMBNAIL_HEIGHT||26,n=window.devicePixelRatio>1,r=document.createElement("canvas"),i=r.getContext("2d"),s="../../../../sdkjs/common/Images/fonts_thumbnail.png",o="../../../../sdkjs/common/Images/fonts_thumbnail@2x.png",u=36;return typeof window["AscDesktopEditor"]=="object"&&(s=window.AscDesktopEditor.getFontsSprite(),o=window.AscDesktopEditor.getFontsSprite(!0)),r.height=n?t*2:t,r.width=n?e*2:e,{template:_.template(['
    ','','
    ','','","
    "].join("")),initialize:function(e){Common.UI.ComboBox.prototype.initialize.call(this,_.extend(e,{displayField:"name",scroller:{alwaysVisibleY:!0,onChange:this.updateVisibleFontsTiles.bind(this)}})),this.recent=_.isNumber(e.recent)?e.recent:3,Common.NotificationCenter.on("fonts:change",_.bind(this.onApiChangeFont,this)),Common.NotificationCenter.on("fonts:load",_.bind(this.fillFonts,this))},render:function(e){var t=null;return _.isUndefined(this._input)||(t=this._input.val()),Common.UI.ComboBox.prototype.render.call(this,e),this.setRawValue(t),this._input.on("keyup",_.bind(this.onInputKeyUp,this)),this._input.on("keydown",_.bind(this.onInputKeyDown,this)),this},onAfterKeydownMenu:function(e){var t=this;if(e.keyCode==Common.UI.Keys.RETURN)return $(e.target).closest("input").length?this.lastValue!==this._input.val()&&this._input.trigger("change"):($(e.target).click(),this.rendered&&(Common.Utils.isIE?this._input.trigger("change",{onkeydown:!0}):this._input.blur())),!1;if(e.keyCode==Common.UI.Keys.ESC&&this.isMenuOpen())return this._input.val(this.lastValue),setTimeout(function(){t.closeMenu(),t.onAfterHideMenu(e)},10),!1;(e.keyCode==Common.UI.Keys.HOME||e.keyCode==Common.UI.Keys.END||e.keyCode==Common.UI.Keys.BACKSPACE)&&this.isMenuOpen()&&(t._input.focus(),setTimeout(function(){t._input[0].selectionStart=t._input[0].selectionEnd=e.keyCode==Common.UI.Keys.HOME?0:t._input[0].value.length},10)),this.updateVisibleFontsTiles()},onInputKeyUp:function(e){if(e.keyCode!=Common.UI.Keys.RETURN&&e.keyCode!==Common.UI.Keys.SHIFT&&e.keyCode!==Common.UI.Keys.CTRL&&e.keyCode!==Common.UI.Keys.ALT&&e.keyCode!==Common.UI.Keys.LEFT&&e.keyCode!==Common.UI.Keys.RIGHT&&e.keyCode!==Common.UI.Keys.HOME&&e.keyCode!==Common.UI.Keys.END&&e.keyCode!==Common.UI.Keys.ESC&&e.keyCode!==Common.UI.Keys.INSERT&&e.keyCode!==Common.UI.Keys.TAB){e.stopPropagation(),this.selectCandidate(e.keyCode==Common.UI.Keys.DELETE||e.keyCode==Common.UI.Keys.BACKSPACE);if(this._selectedItem){var t=this;t._timerSelection===undefined&&(t._timerSelection=setInterval(function(){if(new Date-t._inInputKeyDown<100||!t._selectedItem)return;clearInterval(t._timerSelection),t._timerSelection=undefined;var e=t._input[0],n=t._selectedItem.get(t.displayField),r=e.value;if(t.rendered)if(document.selection)document.selection.createRange().text=n;else if(e.selectionStart||e.selectionStart=="0")e.value=n,e.selectionStart=r.length,e.selectionEnd=n.length},10))}}},onInputKeyDown:function(e){this._inInputKeyDown=new Date;var t=this;e.keyCode==Common.UI.Keys.ESC?(this._input.val(this.lastValue),setTimeout(function(){t.closeMenu(),t.onAfterHideMenu(e)},10)):e.keyCode!=Common.UI.Keys.RETURN&&e.keyCode!=Common.UI.Keys.CTRL&&e.keyCode!=Common.UI.Keys.SHIFT&&e.keyCode!=Common.UI.Keys.ALT&&(!this.isMenuOpen()&&!e.ctrlKey&&this.openMenu(),e.keyCode==Common.UI.Keys.UP||e.keyCode==Common.UI.Keys.DOWN?_.delay(function(){var n=e.keyCode==Common.UI.Keys.DOWN?t.cmpEl.find("ul li.selected").nextAll("li:not(.divider)"):t.cmpEl.find("ul li.selected").prevAll("li:not(.divider)");n=n.length>0?n.eq(0):e.keyCode==Common.UI.Keys.DOWN?t.cmpEl.find("ul li:not(.divider):first"):t.cmpEl.find("ul li:not(.divider):last"),n=n.find("a"),t._skipInputChange=!0,n.focus(),t.updateVisibleFontsTiles()},10):t._skipInputChange=!1)},onInputChanged:function(e,t){if(t&&t.synthetic)return;if(this._skipInputChange){this._skipInputChange=!1;return}if(this._isMouseDownMenu){this._isMouseDownMenu=!1;return}var n=$(e.target).val(),r={};if(this.lastValue===n){t&&t.onkeydown&&this.trigger("combo:blur",this,e);return}r[this.valueField]=n,r[this.displayField]=n,this.trigger("changed:before",this,r,e);if(e.isDefaultPrevented())return;this._selectedItem?(r[this.valueField]=this._selectedItem.get(this.displayField),this.setRawValue(r[this.valueField]),this.trigger("selected",this,_.extend({},this._selectedItem.toJSON()),e),this.addItemToRecent(this._selectedItem),this.closeMenu()):(this.setRawValue(r[this.valueField]),r.isNewFont=!0,this.trigger("selected",this,r,e),this.closeMenu()),this.trigger("changed:after",this,r,e)},getImageUri:function(s){if(s.cloneid){var o=$(this.el).find("ul > li#"+s.cloneid+" img");return o!=null?o[0].src:undefined}return n?(i.clearRect(0,0,e*2,t*2),i.drawImage(this.spriteThumbs,0,-Asc.FONT_THUMBNAIL_HEIGHT*2*s.imgidx)):(i.clearRect(0,0,e,t),i.drawImage(this.spriteThumbs,0,-Asc.FONT_THUMBNAIL_HEIGHT*s.imgidx)),r.toDataURL()},getImageWidth:function(){return e},getImageHeight:function(){return t},getListItemHeight:function(){return u},loadSprite:function(e){e&&(this.spriteThumbs=new Image,this.spriteThumbs.onload=e,this.spriteThumbs.src=window.devicePixelRatio>1?o:s)},fillFonts:function(e,t){var n=this;this.loadSprite(function(){n.store.set(e.toJSON()),n.rendered=!1,n.render($(n.el)),n._fontsArray=n.store.toJSON(),n.recent>0&&(n.store.on("add",n.onInsertItem,n),n.store.on("remove",n.onRemoveItem,n))})},onApiChangeFont:function(e){var t=_.isFunction(e.get_Name)?e.get_Name():e.asc_getName();if(this.getRawValue()!==t){var n=this.store.findWhere({name:t});$(".selected",$(this.el)).removeClass("selected");if(n){this.setRawValue(n.get(this.displayField));var r=$("#"+n.get("id"),$(this.el)),i=$("ul.dropdown-menu",this.cmpEl);r&&i&&(r.addClass("selected"),this.recent<=0&&i.scrollTop(r.offset().top-i.offset().top))}else this.setRawValue(t)}},itemClicked:function(e){var t=$(e.target).closest("li"),n=this.store.findWhere({id:t.attr("id")});this.addItemToRecent(n),Common.UI.ComboBox.prototype.itemClicked.apply(this,arguments)},onInsertItem:function(e){$(this.el).find("ul").prepend(_.template(['
  • ','',"
  • "].join(""),{item:e.attributes,scope:this}))},onRemoveItem:function(e,t,n){$(this.el).find("ul > li#"+e.id).remove()},onBeforeShowMenu:function(e){Common.UI.ComboBox.prototype.onBeforeShowMenu.apply(this,arguments);if(!this.getSelectedRecord()&&!!this.getRawValue()){var t=this.store.where({name:this.getRawValue()});t&&t.length&&this.selectRecord(t[t.length-1])}},onAfterShowMenu:function(e){this.recent>0?(this.scroller&&!this._scrollerIsInited&&(this.scroller.update(),this._scrollerIsInited=!0),$(this.el).find("ul").scrollTop(0),this.trigger("show:after",this,e)):Common.UI.ComboBox.prototype.onAfterShowMenu.apply(this,arguments),this.flushVisibleFontsTiles(),this.updateVisibleFontsTiles(null,0)},onAfterHideMenu:function(e){this.lastValue!==this._input.val()&&this._input.val(this.lastValue),Common.UI.ComboBox.prototype.onAfterHideMenu.apply(this,arguments)},addItemToRecent:function(e){if(e.get("type")!=FONT_TYPE_RECENT&&!this.store.findWhere({name:e.get("name"),type:FONT_TYPE_RECENT})){var t=this.store.where({type:FONT_TYPE_RECENT});t.length0&&s.length>0){i.addClass("selected");var o=i.position().top,u=s.scrollTop();o!=0&&s.scrollTop(u+o)}}},updateVisibleFontsTiles:function(r,i){var s=this,o=0,a=s.store.length,f=0;s.tiles||(s.tiles=[]);if(a!==s.tiles.length)for(o=s.tiles.length;o=0;--e)this.tiles[e]&&(this.tiles[e].parentNode.removeChild(this.tiles[e]),this.tiles[e]=null)}}}())});if(Common===undefined)var Common={};define("common/main/lib/component/ComboDataView",["common/main/lib/component/BaseView","common/main/lib/component/DataView"],function(){"use strict";Common.UI.ComboDataView=Common.UI.BaseView.extend({options:{id:null,cls:"",style:"",hint:!1,itemWidth:80,itemHeight:40,menuMaxHeight:300,enableKeyEvents:!1,beforeOpenHandler:null,additionalMenuItems:null,showLast:!0},template:_.template(['
    ','
    ','
    ',"
    "].join("")),initialize:function(e){Common.UI.BaseView.prototype.initialize.call(this,e),this.id=this.options.id||Common.UI.getId(),this.cls=this.options.cls,this.style=this.options.style,this.hint=this.options.hint,this.store=this.options.store||new Common.UI.DataViewStore,this.itemWidth=this.options.itemWidth,this.itemHeight=this.options.itemHeight,this.menuMaxHeight=this.options.menuMaxHeight,this.beforeOpenHandler=this.options.beforeOpenHandler,this.showLast=this.options.showLast,this.rootWidth=0,this.rootHeight=0,this.rendered=!1,this.needFillComboView=!1,this.fieldPicker=new Common.UI.DataView({cls:"field-picker",allowScrollbar:!1,itemTemplate:_.template(['
    ','','<% if (typeof title !== "undefined") {%>','<%= title %>',"<% } %>","
    "].join(""))}),this.openButton=new Common.UI.Button({cls:"open-menu",menu:new Common.UI.Menu({menuAlign:"tl-tl",offset:[0,3],items:[{template:_.template('')}]})}),this.options.additionalMenuItems!=null&&(this.openButton.menu.items=this.openButton.menu.items.concat(this.options.additionalMenuItems)),this.menuPicker=new Common.UI.DataView({cls:"menu-picker",parentMenu:this.openButton.menu,restoreHeight:this.menuMaxHeight,style:"max-height: "+this.menuMaxHeight+"px;",enableKeyEvents:this.options.enableKeyEvents,itemTemplate:_.template(['
    ','','<% if (typeof title !== "undefined") {%>','<%= title %>',"<% } %>","
    "].join(""))}),setInterval(_.bind(this.checkSize,this),500),this.options.el&&this.render()},render:function(e){if(!this.rendered){var t=this;t.trigger("render:before",t),t.cmpEl=$(t.el);var n=t.template({id:t.id,cls:t.cls,style:t.style});e?(t.setElement(e,!1),t.cmpEl=$(n),e.html(t.cmpEl)):t.cmpEl.html(n),t.rootWidth=t.cmpEl.width(),t.rootHeight=t.cmpEl.height(),t.fieldPicker.render($(".view",t.cmpEl)),t.openButton.render($(".button",t.cmpEl)),t.menuPicker.render($(".menu-picker-container",t.cmpEl)),t.openButton.menu.cmpEl&&t.openButton.menu.cmpEl&&(t.openButton.menu.menuAlignEl=t.cmpEl,t.openButton.menu.cmpEl.css("min-width",t.itemWidth),t.openButton.menu.on("show:before",_.bind(t.onBeforeShowMenu,t)),t.openButton.menu.on("show:after",_.bind(t.onAfterShowMenu,t)),t.openButton.cmpEl.on("hide.bs.dropdown",_.bind(t.onBeforeHideMenu,t)),t.openButton.cmpEl.on("hidden.bs.dropdown",_.bind(t.onAfterHideMenu,t))),t.options.hint&&(t.cmpEl.attr("data-toggle","tooltip"),t.cmpEl.tooltip({title:t.options.hint,placement:t.options.hintAnchor||"cursor"})),t.fieldPicker.on("item:select",_.bind(t.onFieldPickerSelect,t)),t.menuPicker.on("item:select",_.bind(t.onMenuPickerSelect,t)),t.fieldPicker.on("item:click",_.bind(t.onFieldPickerClick,t)),t.menuPicker.on("item:click",_.bind(t.onMenuPickerClick,t)),t.fieldPicker.on("item:contextmenu",_.bind(t.onPickerItemContextMenu,t)),t.menuPicker.on("item:contextmenu",_.bind(t.onPickerItemContextMenu,t)),t.fieldPicker.el.addEventListener("contextmenu",_.bind(t.onPickerComboContextMenu,t),!1),t.menuPicker.el.addEventListener("contextmenu",_.bind(t.onPickerComboContextMenu,t),!1),t.onResize(),t.rendered=!0,t.trigger("render:after",t)}return this},checkSize:function(){if(this.cmpEl&&this.cmpEl.is(":visible")){var e=this,t=this.cmpEl.width(),n=this.cmpEl.height();if(this.rootWidth!=t||this.rootHeight!=n)this.rootWidth=t,this.rootHeight=n,setTimeout(function(){e.openButton.menu.cmpEl.outerWidth(),e.rootWidth=e.cmpEl.width()},10),this.onResize()}},onResize:function(){if(this.openButton){var e=$("button",this.openButton.cmpEl);e&&e.css({width:$(".button",this.cmpEl).width(),height:$(".button",this.cmpEl).height()}),this.openButton.menu.hide();var t=this.menuPicker;if(t){var n=t.getSelectedRec();n&&(n=n[0],this.fillComboView(n||t.store.at(0),!!n,!0)),t.onResize()}}this.isSuspendEvents||this.trigger("resize",this)},onBeforeShowMenu:function(e){var t=this;if(_.isFunction(t.beforeOpenHandler))t.beforeOpenHandler(t,e);else if(t.openButton.menu.cmpEl){var n=0;try{var r=$($(".dropdown-menu .dataview.inner .style",t.cmpEl)[0]);n=r?parseInt(r.css("margin-left"))+parseInt(r.css("margin-right")):0}catch(e){}t.openButton.menu.cmpEl.css({width:Math.round((t.cmpEl.width()+n*t.fieldPicker.store.length)/t.itemWidth-.2)*(t.itemWidth+n),"min-height":this.cmpEl.height()})}if(t.options.hint){var i=t.cmpEl.data("bs.tooltip");i&&(i.dontShow===undefined&&(i.dontShow=!0),i.hide())}this.menuPicker.selectedBeforeHideRec=null},onBeforeHideMenu:function(e){this.trigger("hide:before",this,e),Common.UI.Scroller.isMouseCapture()&&e.preventDefault();if(this.isStylesNotClosable)return!1},onAfterShowMenu:function(e){var t=this;t.menuPicker.scroller&&t.menuPicker.scroller.update({includePadding:!0,suppressScrollX:!0,alwaysVisibleY:!0})},onAfterHideMenu:function(e,t){this.menuPicker.selectedBeforeHideRec=this.menuPicker.getSelectedRec()[0],this.showLast?this.menuPicker.showLastSelected():this.menuPicker.deselectAll(),this.trigger("hide:after",this,e,t)},onFieldPickerSelect:function(e,t,n){},onMenuPickerSelect:function(e,t,n,r){this.needFillComboView=this.disabled;if(this.disabled||r===!0)return;this.fillComboView(n,!1),n&&!this.isSuspendEvents&&this.trigger("select",this,n)},onFieldPickerClick:function(e,t,n){if(this.disabled)return;this.isSuspendEvents||this.trigger("click",this,n);if(this.options.hint){var r=this.cmpEl.data("bs.tooltip");r&&(r.dontShow===undefined&&(r.dontShow=!0),r.hide())}this.showLast||this.fieldPicker.deselectAll()},onMenuPickerClick:function(e,t,n){if(this.disabled)return;this.isSuspendEvents||this.trigger("click",this,n)},onPickerItemContextMenu:function(e,t,n,r){if(this.disabled)return;return this.isSuspendEvents||this.trigger("contextmenu",this,n,r),r.preventDefault(),r.stopPropagation(),!1},onPickerComboContextMenu:function(e){if(this.disabled)return;this.isSuspendEvents||this.trigger("contextmenu",this,undefined,e)},setDisabled:function(e){this.disabled=e;if(!this.rendered)return;this.cmpEl.toggleClass("disabled",e),$("button",this.openButton.cmpEl).toggleClass("disabled",e),this.fieldPicker.setDisabled(e);if(this.needFillComboView&&!e){var t=this.menuPicker;if(t){var n=t.getSelectedRec();n&&(n=n[0],this.fillComboView(n||t.store.at(0),!1))}}},isDisabled:function(){return this.disabled},fillComboView:function(e,t,n){if(!_.isUndefined(e)&&e instanceof Backbone.Model){this.needFillComboView=!1;var r=this,i=r.menuPicker.store,s=$(r.fieldPicker.el);if(i){if(n||!r.fieldPicker.store.findWhere({id:e.get("id")})){if(r.itemMarginLeft===undefined){var o=$($(this.menuPicker.el).find(".inner > div:not(.grouped-data):not(.ps-scrollbar-x-rail):not(.ps-scrollbar-y-rail)")[0]);o.length>0&&(r.itemMarginLeft=parseInt(o.css("margin-left")),r.itemMarginRight=parseInt(o.css("margin-right")),r.itemPaddingLeft=parseInt(o.css("padding-left")),r.itemPaddingRight=parseInt(o.css("padding-right")),r.itemBorderLeft=parseInt(o.css("border-left-width")),r.itemBorderRight=parseInt(o.css("border-right-width")))}r.fieldPicker.store.reset([]);var u=i.indexOf(e),a=i.length,f=Math.floor(s.width()/(r.itemWidth+(r.itemMarginLeft||0)+(r.itemMarginRight||0)+(r.itemPaddingLeft||0)+(r.itemPaddingRight||0)+(r.itemBorderLeft||0)+(r.itemBorderRight||0))),l=[];s.height()/r.itemHeight>2&&(f*=Math.floor(s.height()/r.itemHeight));if(u<0)return;u=Math.floor(u/f)*f,a-u1?e/2:e)},setItemHeight:function(e){this.itemHeight!=e&&(this.itemHeight=window.devicePixelRatio>1?e/2:e)},removeTips:function(){var e=this.menuPicker;_.each(e.dataViewItems,function(e){var t=e.$el.data("bs.tooltip");t&&t.tip().remove()},e)}})});if(Common===undefined)var Common={};define("common/main/lib/component/SynchronizeTip",["common/main/lib/component/BaseView"],function(){"use strict";Common.UI.SynchronizeTip=Common.UI.BaseView.extend(_.extend(function(){var e;return{options:{target:$(document.body),text:"",placement:"right"},template:_.template(['
    ','
    ','
    ',"
    ",'
    <%= scope.text %>
    ','
    ',"
    ",'',"
    ","
    "].join("")),initialize:function(e){this.textSynchronize+=Common.Utils.String.platformKey("Ctrl+S"),Common.UI.BaseView.prototype.initialize.call(this,e),this.target=this.options.target,this.text=_.isEmpty(this.options.text)?this.textSynchronize:this.options.text,this.placement=this.options.placement},render:function(){return e=$(this.template({scope:this})),e.find(".close").on("click",_.bind(function(){this.trigger("closeclick")},this)),e.find(".show-link label").on("click",_.bind(function(){this.trigger("dontshowclick")},this)),$(document.body).append(e),this.applyPlacement(),this},show:function(){e?(this.applyPlacement(),e.show()):this.render()},hide:function(){e&&e.hide()},applyPlacement:function(){var t=this.target.offset();this.placement=="top"?e.css({bottom:Common.Utils.innerHeight()-t.top+"px",right:Common.Utils.innerWidth()-t.left-this.target.width()/2+"px"}):e.css({top:t.top+this.target.height()/2+"px",left:t.left+this.target.width()+"px"})},textDontShow:"Don't show this message again",textSynchronize:"The document has been changed by another user.
    Please click to save your changes and reload the updates."}}(),Common.UI.SynchronizeTip||{}))}),define("presentationeditor/main/app/view/Toolbar",["backbone","text!presentationeditor/main/app/template/Toolbar.template","common/main/lib/collection/Fonts","common/main/lib/component/Button","common/main/lib/component/ComboBox","common/main/lib/component/DataView","common/main/lib/component/ColorPalette","common/main/lib/component/ThemeColorPalette","common/main/lib/component/Menu","common/main/lib/component/DimensionPicker","common/main/lib/component/Window","common/main/lib/component/ComboBoxFonts","common/main/lib/component/ComboDataView","common/main/lib/component/SynchronizeTip"],function(e,t){"use strict";PE.enumLock={paragraphLock:"para-lock",shapeLock:"shape-lock",slideLock:"slide-lock",slideDeleted:"slide-deleted",noSlides:"no-slides",lostConnect:"disconnect",incIndentLock:"can-inc-indent",decIndentLock:"can-dec-indent",hyperlinkLock:"can-hyperlink",undoLock:"can-undo",redoLock:"can-redo",docPropsLock:"doc-props-lock",themeLock:"theme-lock",menuFileOpen:"menu-file-open",noParagraphSelected:"no-paragraph",noObjectSelected:"no-object",disableOnStart:"on-start",cantPrint:"cant-print",noTextSelected:"no-text",inEquation:"in-equation"},PE.Views.Toolbar=e.View.extend(_.extend({el:"#toolbar",template:_.template(t),events:{},initialize:function(){var e=this;e.paragraphControls=[],e.shapeControls=[],e.slideOnlyControls=[],e.synchTooltip=undefined,e.schemeNames=[e.txtScheme1,e.txtScheme2,e.txtScheme3,e.txtScheme4,e.txtScheme5,e.txtScheme6,e.txtScheme7,e.txtScheme8,e.txtScheme9,e.txtScheme10,e.txtScheme11,e.txtScheme12,e.txtScheme13,e.txtScheme14,e.txtScheme15,e.txtScheme16,e.txtScheme17,e.txtScheme18,e.txtScheme19,e.txtScheme20,e.txtScheme21],e._state={hasCollaborativeChanges:undefined},e.btnSaveCls="btn-save",e.btnSaveTip=this.tipSave+Common.Utils.String.platformKey("Ctrl+S");var t=PE.enumLock;e.btnNewDocument=new Common.UI.Button({id:"id-toolbar-btn-newdocument",cls:"btn-toolbar",iconCls:"btn-newdocument",lock:[t.slideDeleted,t.paragraphLock,t.lostConnect,t.noSlides]}),e.paragraphControls.push(e.btnNewDocument),e.btnOpenDocument=new Common.UI.Button({id:"id-toolbar-btn-opendocument",cls:"btn-toolbar",iconCls:"btn-opendocument",lock:[t.slideDeleted,t.paragraphLock,t.lostConnect,t.noSlides]}),e.paragraphControls.push(e.btnOpenDocument),e.btnAddSlide=new Common.UI.Button({id:"id-toolbar-button-add-slide",cls:"btn-toolbar",iconCls:"btn-addslide",split:!0,lock:[t.menuFileOpen,t.slideDeleted,t.lostConnect,t.disableOnStart],menu:!0}),e.slideOnlyControls.push(e.btnAddSlide),e.btnChangeSlide=new Common.UI.Button({id:"id-toolbar-button-change-slide",cls:"btn-toolbar",iconCls:"btn-changeslide",lock:[t.menuFileOpen,t.slideDeleted,t.slideLock,t.lostConnect,t.noSlides,t.disableOnStart],menu:!0}),e.slideOnlyControls.push(e.btnChangeSlide),e.btnPreview=new Common.UI.Button({id:"id-toolbar-button-preview",cls:"btn-toolbar",iconCls:"btn-preview",lock:[t.menuFileOpen,t.slideDeleted,t.noSlides,t.disableOnStart],split:!0,menu:new Common.UI.Menu({items:[{caption:this.textShowBegin,value:0},{caption:this.textShowCurrent,value:1},{caption:"--"},e.mnuShowSettings=new Common.UI.MenuItem({caption:this.textShowSettings,value:2,lock:[t.lostConnect]})]})}),e.slideOnlyControls.push(e.btnPreview),e.btnPrint=new Common.UI.Button({id:"id-toolbar-btn-print",cls:"btn-toolbar",iconCls:"btn-print",lock:[t.slideDeleted,t.noSlides,t.cantPrint]}),e.paragraphControls.push(e.btnPrint),e.btnSave=new Common.UI.Button({id:"id-toolbar-btn-save",cls:"btn-toolbar",iconCls:e.btnSaveCls,lock:[t.lostConnect]}),e.btnUndo=new Common.UI.Button({id:"id-toolbar-btn-undo",cls:"btn-toolbar",iconCls:"btn-undo",lock:[t.undoLock,t.slideDeleted,t.lostConnect,t.disableOnStart]}),e.slideOnlyControls.push(e.btnUndo),e.btnRedo=new Common.UI.Button({id:"id-toolbar-btn-redo",cls:"btn-toolbar",iconCls:"btn-redo",lock:[t.redoLock,t.slideDeleted,t.lostConnect,t.disableOnStart]}),e.slideOnlyControls.push(e.btnRedo),e.btnCopy=new Common.UI.Button({id:"id-toolbar-btn-copy",cls:"btn-toolbar",iconCls:"btn-copy",lock:[t.slideDeleted,t.lostConnect,t.noSlides,t.disableOnStart]}),e.slideOnlyControls.push(e.btnCopy),e.btnPaste=new Common.UI.Button({id:"id-toolbar-btn-paste",cls:"btn-toolbar",iconCls:"btn-paste",lock:[t.slideDeleted,t.paragraphLock,t.lostConnect,t.noSlides]}),e.paragraphControls.push(e.btnPaste),e.cmbFontName=new Common.UI.ComboBoxFonts({cls:"input-group-nr",menuCls:"scrollable-menu",menuStyle:"min-width: 325px;",hint:e.tipFontName,lock:[t.slideDeleted,t.paragraphLock,t.lostConnect,t.noSlides,t.noTextSelected,t.shapeLock],store:new Common.Collections.Fonts}),e.paragraphControls.push(e.cmbFontName),e.cmbFontSize=new Common.UI.ComboBox({cls:"input-group-nr",menuStyle:"min-width: 55px;",hint:e.tipFontSize,lock:[t.slideDeleted,t.paragraphLock,t.lostConnect,t.noSlides,t.noTextSelected,t.shapeLock],data:[{value:8,displayValue:"8"},{value:9,displayValue:"9"},{value:10,displayValue:"10"},{value:11,displayValue:"11"},{value:12,displayValue:"12"},{value:14,displayValue:"14"},{value:16,displayValue:"16"},{value:18,displayValue:"18"},{value:20,displayValue:"20"},{value:22,displayValue:"22"},{value:24,displayValue:"24"},{value:26,displayValue:"26"},{value:28,displayValue:"28"},{value:36,displayValue:"36"},{value:48,displayValue:"48"},{value:72,displayValue:"72"}]}),e.paragraphControls.push(e.cmbFontSize),e.btnBold=new Common.UI.Button({id:"id-toolbar-btn-bold",cls:"btn-toolbar",iconCls:"btn-bold",lock:[t.slideDeleted,t.paragraphLock,t.lostConnect,t.noSlides,t.noTextSelected,t.shapeLock],enableToggle:!0}),e.paragraphControls.push(e.btnBold),e.btnItalic=new Common.UI.Button({id:"id-toolbar-btn-italic",cls:"btn-toolbar",iconCls:"btn-italic",lock:[t.slideDeleted,t.paragraphLock,t.lostConnect,t.noSlides,t.noTextSelected,t.shapeLock],enableToggle:!0}),e.paragraphControls.push(e.btnItalic),e.btnUnderline=new Common.UI.Button({id:"id-toolbar-btn-underline",cls:"btn-toolbar",iconCls:"btn-underline",lock:[t.slideDeleted,t.paragraphLock,t.lostConnect,t.noSlides,t.noTextSelected,t.shapeLock],enableToggle:!0}),e.paragraphControls.push(e.btnUnderline),e.btnStrikeout=new Common.UI.Button({id:"id-toolbar-btn-strikeout",cls:"btn-toolbar",iconCls:"btn-strikeout",lock:[t.slideDeleted,t.paragraphLock,t.lostConnect,t.noSlides,t.noTextSelected,t.shapeLock],enableToggle:!0}),e.paragraphControls.push(e.btnStrikeout),e.btnSuperscript=new Common.UI.Button({id:"id-toolbar-btn-superscript",cls:"btn-toolbar",iconCls:"btn-superscript",lock:[t.slideDeleted,t.paragraphLock,t.lostConnect,t.noSlides,t.noTextSelected,t.shapeLock,t.inEquation],enableToggle:!0,toggleGroup:"superscriptGroup"}),e.paragraphControls.push(e.btnSuperscript),e.btnSubscript=new Common.UI.Button({id:"id-toolbar-btn-subscript",cls:"btn-toolbar",iconCls:"btn-subscript",lock:[t.slideDeleted,t.paragraphLock,t.lostConnect,t.noSlides,t.noTextSelected,t.shapeLock,t.inEquation],enableToggle:!0,toggleGroup:"superscriptGroup"}),e.paragraphControls.push(e.btnSubscript),e.btnFontColor=(new Common.UI.Button({id:"id-toolbar-btn-fontcolor",cls:"btn-toolbar",iconCls:"btn-fontcolor",lock:[t.slideDeleted,t.paragraphLock,t.lostConnect,t.noSlides,t.noTextSelected,t.shapeLock],split:!0,menu:new Common.UI.Menu({items:[{template:_.template('
    ')},{template:_.template('
    '+e.textNewColor+"")}]})})).on("render:after",function(t){var n=$('
    ');$("button:first-child",t.cmpEl).append(n),n.css("background-color",t.currentColor||"transparent"),e.mnuFontColorPicker=new Common.UI.ThemeColorPalette({el:$("#id-toolbar-menu-fontcolor")})}),e.paragraphControls.push(e.btnFontColor),e.btnClearStyle=new Common.UI.Button({id:"id-toolbar-btn-clearstyle",cls:"btn-toolbar",iconCls:"btn-clearstyle",lock:[t.slideDeleted,t.paragraphLock,t.lostConnect,t.noSlides,t.noParagraphSelected]}),e.paragraphControls.push(e.btnClearStyle),e.btnCopyStyle=new Common.UI.Button({id:"id-toolbar-btn-copystyle",cls:"btn-toolbar",iconCls:"btn-copystyle",lock:[t.slideDeleted,t.lostConnect,t.noSlides,t.noParagraphSelected,t.disableOnStart],enableToggle:!0}),e.slideOnlyControls.push(e.btnCopyStyle),e.btnMarkers=new Common.UI.Button({id:"id-toolbar-btn-markers",cls:"btn-toolbar",iconCls:"btn-setmarkers",lock:[t.slideDeleted,t.paragraphLock,t.lostConnect,t.noSlides,t.noParagraphSelected],enableToggle:!0,toggleGroup:"markersGroup",split:!0,menu:!0}),e.paragraphControls.push(e.btnMarkers),e.btnNumbers=new Common.UI.Button({id:"id-toolbar-btn-numbering",cls:"btn-toolbar",iconCls:"btn-numbering",lock:[t.slideDeleted,t.paragraphLock,t.lostConnect,t.noSlides,t.noParagraphSelected],enableToggle:!0,toggleGroup:"markersGroup",split:!0,menu:!0}),e.paragraphControls.push(e.btnNumbers);var n=function(e){var t={};for(var r in e)t[r]=typeof e[r]=="object"?n(e[r]):e[r];return t};return this.mnuMarkersPicker={conf:{index:0},selectByIndex:function(e){this.conf.index=e}},this.mnuNumbersPicker=n(this.mnuMarkersPicker),e.btnHorizontalAlign=new Common.UI.Button({id:"id-toolbar-btn-halign",cls:"btn-toolbar",iconCls:"btn-align-left",icls:"btn-align-left",lock:[t.slideDeleted,t.paragraphLock,t.lostConnect,t.noSlides,t.noParagraphSelected],menu:new Common.UI.Menu({items:[{caption:e.textAlignLeft+Common.Utils.String.platformKey("Ctrl+L"),iconCls:"mnu-align-left",icls:"btn-align-left",checkable:!0,toggleGroup:"halignGroup",checked:!0,value:1},{caption:e.textAlignCenter+Common.Utils.String.platformKey("Ctrl+E"),iconCls:"mnu-align-center",icls:"btn-align-center",checkable:!0,toggleGroup:"halignGroup",value:2},{caption:e.textAlignRight+Common.Utils.String.platformKey("Ctrl+R"),iconCls:"mnu-align-right",icls:"btn-align-right",checkable:!0,toggleGroup:"halignGroup",value:0},{caption:e.textAlignJust+Common.Utils.String.platformKey("Ctrl+J"),iconCls:"mnu-align-just",icls:"btn-align-just",checkable:!0,toggleGroup:"halignGroup",value:3}]})}),e.paragraphControls.push(e.btnHorizontalAlign),e.btnVerticalAlign=new Common.UI.Button({id:"id-toolbar-btn-valign",cls:"btn-toolbar",lock:[t.slideDeleted,t.paragraphLock,t.lostConnect,t.noSlides,t.noParagraphSelected],iconCls:"btn-align-middle",icls:"btn-align-middle",menu:new Common.UI.Menu({items:[{caption:e.textAlignTop,iconCls:"mnu-align-top",icls:"btn-align-top",checkable:!0,toggleGroup:"valignGroup",value:Asc.c_oAscVAlign.Top},{caption:e.textAlignMiddle,iconCls:"mnu-align-middle",icls:"btn-align-middle",checkable:!0,toggleGroup:"valignGroup",value:Asc.c_oAscVAlign.Center,checked:!0},{caption:e.textAlignBottom,iconCls:"mnu-align-bottom",icls:"btn-align-bottom",checkable:!0,toggleGroup:"valignGroup",value:Asc.c_oAscVAlign.Bottom}]})}),e.paragraphControls.push(e.btnVerticalAlign),e.btnDecLeftOffset=new Common.UI.Button({id:"id-toolbar-btn-decoffset",cls:"btn-toolbar",iconCls:"btn-decoffset",lock:[t.decIndentLock,t.slideDeleted,t.paragraphLock,t.lostConnect,t.noSlides,t.noParagraphSelected]}),e.paragraphControls.push(e.btnDecLeftOffset),e.btnIncLeftOffset=new Common.UI.Button({id:"id-toolbar-btn-incoffset",cls:"btn-toolbar",iconCls:"btn-incoffset",lock:[t.incIndentLock,t.slideDeleted,t.paragraphLock,t.lostConnect,t.noSlides,t.noParagraphSelected]}),e.paragraphControls.push(e.btnIncLeftOffset),e.btnLineSpace=new Common.UI.Button({id:"id-toolbar-btn-linespace",cls:"btn-toolbar",iconCls:"btn-linespace",lock:[t.slideDeleted,t.paragraphLock,t.lostConnect,t.noSlides,t.noParagraphSelected],menu:new Common.UI.Menu({style:"min-width: 60px;",items:[{caption:"1.0",value:1,checkable:!0,toggleGroup:"linesize"},{caption:"1.15",value:1.15,checkable:!0,toggleGroup:"linesize"},{caption:"1.5",value:1.5,checkable:!0,toggleGroup:"linesize"},{caption:"2.0",value:2,checkable:!0,toggleGroup:"linesize"},{caption:"2.5",value:2.5,checkable:!0,toggleGroup:"linesize"},{caption:"3.0",value:3,checkable:!0,toggleGroup:"linesize"}]})}),e.paragraphControls.push(e.btnLineSpace),e.btnInsertTable=(new Common.UI.Button({id:"id-toolbar-btn-inserttable",cls:"btn-toolbar",iconCls:"btn-inserttable",lock:[t.slideDeleted,t.lostConnect,t.noSlides,t.disableOnStart],menu:new Common.UI.Menu({items:[{template:_.template('
    ')},{caption:e.mniCustomTable,value:"custom"}]})})).on("render:after",function(t){e.mnuTablePicker=new Common.UI.DimensionPicker({el:$("#id-toolbar-menu-tablepicker"),minRows:8,minColumns:10,maxRows:8,maxColumns:10})}),e.slideOnlyControls.push(e.btnInsertTable),e.btnInsertImage=new Common.UI.Button({id:"id-toolbar-btn-insertimage",cls:"btn-toolbar",iconCls:"btn-insertimage",lock:[t.slideDeleted,t.lostConnect,t.noSlides,t.disableOnStart],menu:new Common.UI.Menu({items:[{caption:e.mniImageFromFile,value:"file"},{caption:e.mniImageFromUrl,value:"url"}]})}),e.slideOnlyControls.push(e.btnInsertImage),e.btnInsertChart=(new Common.UI.Button({id:"id-toolbar-btn-insertchart",cls:"btn-toolbar",iconCls:"btn-insertchart",lock:[t.slideDeleted,t.lostConnect,t.noSlides,t.disableOnStart],menu:new Common.UI.Menu({style:"width: 435px;",items:[{template:_.template('')}]})})).on("render:after",function(t){e.mnuInsertChartPicker=new Common.UI.DataView({el:$("#id-toolbar-menu-insertchart"),parentMenu:t.menu,showLast:!1,restoreHeight:421,groups:new Common.UI.DataViewGroupStore([{id:"menu-chart-group-bar",caption:e.textColumn,headername:e.textCharts},{id:"menu-chart-group-line",caption:e.textLine},{id:"menu-chart-group-pie",caption:e.textPie},{id:"menu-chart-group-hbar",caption:e.textBar},{id:"menu-chart-group-area",caption:e.textArea,inline:!0},{id:"menu-chart-group-scatter",caption:e.textPoint,inline:!0},{id:"menu-chart-group-stock",caption:e.textStock,inline:!0}]),store:new Common.UI.DataViewStore([{group:"menu-chart-group-bar",type:Asc.c_oAscChartTypeSettings.barNormal,allowSelected:!0,iconCls:"column-normal",selected:!0},{group:"menu-chart-group-bar",type:Asc.c_oAscChartTypeSettings.barStacked,allowSelected:!0,iconCls:"column-stack"},{group:"menu-chart-group-bar",type:Asc.c_oAscChartTypeSettings.barStackedPer,allowSelected:!0,iconCls:"column-pstack"},{group:"menu-chart-group-bar",type:Asc.c_oAscChartTypeSettings.barNormal3d,allowSelected:!0,iconCls:"column-3d-normal"},{group:"menu-chart-group-bar",type:Asc.c_oAscChartTypeSettings.barStacked3d,allowSelected:!0,iconCls:"column-3d-stack"},{group:"menu-chart-group-bar",type:Asc.c_oAscChartTypeSettings.barStackedPer3d,allowSelected:!0,iconCls:"column-3d-pstack"},{group:"menu-chart-group-bar",type:Asc.c_oAscChartTypeSettings.barNormal3dPerspective,allowSelected:!0,iconCls:"column-3d-normal-per"},{group:"menu-chart-group-line",type:Asc.c_oAscChartTypeSettings.lineNormal,allowSelected:!0,iconCls:"line-normal"},{group:"menu-chart-group-line",type:Asc.c_oAscChartTypeSettings.lineStacked,allowSelected:!0,iconCls:"line-stack"},{group:"menu-chart-group-line",type:Asc.c_oAscChartTypeSettings.lineStackedPer,allowSelected:!0,iconCls:"line-pstack"},{group:"menu-chart-group-line",type:Asc.c_oAscChartTypeSettings.line3d,allowSelected:!0,iconCls:"line-3d"},{group:"menu-chart-group-pie",type:Asc.c_oAscChartTypeSettings.pie,allowSelected:!0,iconCls:"pie-normal"},{group:"menu-chart-group-pie",type:Asc.c_oAscChartTypeSettings.doughnut,allowSelected:!0,iconCls:"pie-doughnut"},{group:"menu-chart-group-pie",type:Asc.c_oAscChartTypeSettings.pie3d,allowSelected:!0,iconCls:"pie-3d-normal"},{group:"menu-chart-group-hbar",type:Asc.c_oAscChartTypeSettings.hBarNormal,allowSelected:!0,iconCls:"bar-normal"},{group:"menu-chart-group-hbar",type:Asc.c_oAscChartTypeSettings.hBarStacked,allowSelected:!0,iconCls:"bar-stack"},{group:"menu-chart-group-hbar",type:Asc.c_oAscChartTypeSettings.hBarStackedPer,allowSelected:!0,iconCls:"bar-pstack"},{group:"menu-chart-group-hbar",type:Asc.c_oAscChartTypeSettings.hBarNormal3d,allowSelected:!0,iconCls:"bar-3d-normal"},{group:"menu-chart-group-hbar",type:Asc.c_oAscChartTypeSettings.hBarStacked3d,allowSelected:!0,iconCls:"bar-3d-stack"},{group:"menu-chart-group-hbar",type:Asc.c_oAscChartTypeSettings.hBarStackedPer3d,allowSelected:!0,iconCls:"bar-3d-pstack"},{group:"menu-chart-group-area",type:Asc.c_oAscChartTypeSettings.areaNormal,allowSelected:!0,iconCls:"area-normal"},{group:"menu-chart-group-area",type:Asc.c_oAscChartTypeSettings.areaStacked,allowSelected:!0,iconCls:"area-stack"},{group:"menu-chart-group-area",type:Asc.c_oAscChartTypeSettings.areaStackedPer,allowSelected:!0,iconCls:"area-pstack"},{group:"menu-chart-group-scatter",type:Asc.c_oAscChartTypeSettings.scatter,allowSelected:!0,iconCls:"point-normal"},{group:"menu-chart-group-stock",type:Asc.c_oAscChartTypeSettings.stock,allowSelected:!0,iconCls:"stock-normal"}]),itemTemplate:_.template('
    ')})}),e.slideOnlyControls.push(e.btnInsertChart),e.btnInsertText=new Common.UI.Button({id:"id-toolbar-btn-inserttext",cls:"btn-toolbar",iconCls:"btn-inserttext",lock:[t.slideDeleted,t.lostConnect,t.noSlides,t.disableOnStart],enableToggle:!0,split:!0,menu:new Common.UI.Menu({items:[{caption:this.textInsText,value:"text"},this.mnuInsertTextArt=new Common.UI.MenuItem({caption:this.textInsTextArt,value:"art",menu:new Common.UI.Menu({menuAlign:"tl-tr",cls:"menu-shapes",items:[{template:_.template('
    ')}]})})]})}),e.slideOnlyControls.push(e.btnInsertText),this.btnInsertEquation=new Common.UI.Button({id:"id-toolbar-btn-insertequation",cls:"btn-toolbar",iconCls:"btn-insertequation",lock:[t.slideDeleted,t.lostConnect,t.noSlides,t.disableOnStart],split:!0,menu:new Common.UI.Menu({cls:"menu-shapes"})}),this.slideOnlyControls.push(this.btnInsertEquation),e.btnInsertHyperlink=new Common.UI.Button({id:"id-toolbar-btn-inserthyperlink",cls:"btn-toolbar",iconCls:"btn-inserthyperlink",lock:[t.hyperlinkLock,t.slideDeleted,t.paragraphLock,t.lostConnect,t.noSlides,t.noParagraphSelected]}),e.paragraphControls.push(e.btnInsertHyperlink),e.btnInsertShape=new Common.UI.Button({id:"id-toolbar-btn-insertshape",cls:"btn-toolbar",iconCls:"btn-insertshape",lock:[t.slideDeleted,t.lostConnect,t.noSlides,t.disableOnStart],enableToggle:!0,menu:new Common.UI.Menu({cls:"menu-shapes"})}),e.slideOnlyControls.push(e.btnInsertShape),e.btnColorSchemas=new Common.UI.Button({id:"id-toolbar-btn-colorschemas",cls:"btn-toolbar",iconCls:"btn-colorschemas",lock:[t.themeLock,t.slideDeleted,t.lostConnect,t.noSlides,t.disableOnStart],menu:(new Common.UI.Menu({items:[],maxHeight:600,restoreHeight:600})).on("show:before",function(e){this.scroller=new Common.UI.Scroller({el:$(this.el).find(".dropdown-menu "),useKeyboard:this.enableKeyEvents&&!this.handleSelect,minScrollbarLength:40,alwaysVisibleY:!0})}).on("show:after",function(e,t){var n=$(this.el).find(".dropdown-menu "),r=Common.Utils.innerHeight(),i=n.outerHeight(),s=parseInt(n.css("top"));i>r?(n.css("max-height",r-parseInt(n.css("padding-top"))-parseInt(n.css("padding-bottom"))-5+"px"),this.scroller.update({minScrollbarLength:40})):n.height()r&&n.css("top",0),this.scroller.update({minScrollbarLength:40}))})}),e.slideOnlyControls.push(e.btnColorSchemas),e.btnHide=new Common.UI.Button({id:"id-toolbar-btn-hidebars",cls:"btn-toolbar",iconCls:"btn-hidebars",lock:[t.menuFileOpen,t.slideDeleted,t.disableOnStart],menu:!0}),e.slideOnlyControls.push(e.btnHide),this.btnFitPage={conf:{checked:!1},setChecked:function(e){this.conf.checked=e},isChecked:function(){return this.conf.checked}},this.btnFitWidth=n(this.btnFitPage),this.mnuZoom={options:{value:100}},e.btnAdvSettings=new Common.UI.Button({id:"id-toolbar-btn-settings",cls:"btn-toolbar",iconCls:"btn-settings",lock:[t.slideDeleted,t.disableOnStart]}),e.slideOnlyControls.push(e.btnAdvSettings),e.btnShapeAlign=new Common.UI.Button({id:"id-toolbar-btn-shape-align",cls:"btn-toolbar",iconCls:"btn-align-shape",lock:[t.slideDeleted,t.shapeLock,t.lostConnect,t.noSlides,t.noObjectSelected,t.disableOnStart],menu:new Common.UI.Menu({items:[{caption:e.textShapeAlignLeft,iconCls:"mnu-shape-align-left",value:Asc.c_oAscAlignShapeType.ALIGN_LEFT},{caption:e.textShapeAlignCenter,iconCls:"mnu-shape-align-center",value:Asc.c_oAscAlignShapeType.ALIGN_CENTER},{caption:e.textShapeAlignRight,iconCls:"mnu-shape-align-right",value:Asc.c_oAscAlignShapeType.ALIGN_RIGHT},{caption:e.textShapeAlignTop,iconCls:"mnu-shape-align-top",value:Asc.c_oAscAlignShapeType.ALIGN_TOP},{caption:e.textShapeAlignMiddle,iconCls:"mnu-shape-align-middle",value:Asc.c_oAscAlignShapeType.ALIGN_MIDDLE},{caption:e.textShapeAlignBottom,iconCls:"mnu-shape-align-bottom",value:Asc.c_oAscAlignShapeType.ALIGN_BOTTOM},{caption:"--"},{caption:e.txtDistribHor,iconCls:"mnu-distrib-hor",value:6},{caption:e.txtDistribVert,iconCls:"mnu-distrib-vert",value:7}]})}),e.shapeControls.push(e.btnShapeAlign),e.slideOnlyControls.push(e.btnShapeAlign),e.btnShapeArrange=new Common.UI.Button({id:"id-toolbar-btn-shape-arrange",cls:"btn-toolbar",iconCls:"btn-arrange-shape",lock:[t.slideDeleted,t.lostConnect,t.noSlides,t.noObjectSelected,t.disableOnStart],menu:new Common.UI.Menu({items:[{caption:e.textArrangeFront,iconCls:"mnu-arrange-front",value:1},{caption:e.textArrangeBack,iconCls:"mnu-arrange-back",value:2},{caption:e.textArrangeForward,iconCls:"mnu-arrange-forward",value:3},{caption:e.textArrangeBackward,iconCls:"mnu-arrange-backward",value:4},{caption:"--"},e.mnuGroupShapes=new Common.UI.MenuItem({caption:e.txtGroup,iconCls:"mnu-group",value:5}),e.mnuUnGroupShapes=new Common.UI.MenuItem({caption:e.txtUngroup,iconCls:"mnu-ungroup",value:6})]})}),e.slideOnlyControls.push(e.btnShapeArrange),e.btnSlideSize=new Common.UI.Button({id:"id-toolbar-btn-slide-size",cls:"btn-toolbar",iconCls:"btn-slidesize",lock:[t.docPropsLock,t.slideDeleted,t.lostConnect,t.noSlides,t.disableOnStart],menu:new Common.UI.Menu({items:[{caption:e.mniSlideStandard,checkable:!0,toggleGroup:"slidesize",value:0},{caption:e.mniSlideWide,checkable:!0,toggleGroup:"slidesize",value:1},{caption:"--"},{caption:e.mniSlideAdvanced,value:"advanced"}]})}),e.slideOnlyControls.push(e.btnSlideSize),e.listTheme=new Common.UI.ComboDataView({cls:"combo-styles",itemWidth:85,enableKeyEvents:!0,itemHeight:38,hint:this.tipSlideTheme,lock:[t.themeLock,t.lostConnect,t.noSlides],beforeOpenHandler:function(e){var t=this,n=t.openButton.menu,r=6;if(n.cmpEl){var i=$(t.cmpEl.find(".dataview.inner .style").get(0)).parent(),s=-1,o=i.is(":visible")?parseInt(i.css("width")):t.itemWidth+parseInt(i.css("padding-left"))+parseInt(i.css("padding-right"))+parseInt(i.css("border-left-width"))+parseInt(i.css("border-right-width")),u=t.menuPicker.store.length>=r?r:t.menuPicker.store.length,a=Math.min(t.menuPicker.store.length,Math.round($(".dataview",$(t.fieldPicker.el)).width()/(s+o)+.5));a=a','
    ',"
    "].join("")),e.listTheme.menuPicker.itemTemplate=_.template(['
    ','
    ',"
    "].join("")),this.lockControls=[this.btnNewDocument,this.btnOpenDocument,this.btnAddSlide,this.btnChangeSlide,this.btnSave,this.btnCopy,this.btnPaste,this.btnUndo,this.btnRedo,this.cmbFontName,this.cmbFontSize,this.btnBold,this.btnItalic,this.btnUnderline,this.btnStrikeout,this.btnSuperscript,this.btnSubscript,this.btnFontColor,this.btnClearStyle,this.btnCopyStyle,this.btnMarkers,this.btnNumbers,this.btnDecLeftOffset,this.btnIncLeftOffset,this.btnLineSpace,this.btnHorizontalAlign,this.btnVerticalAlign,this.btnShapeArrange,this.btnShapeAlign,this.btnInsertTable,this.btnInsertImage,this.btnInsertChart,this.btnInsertText,this.btnInsertEquation,this.btnInsertHyperlink,this.btnInsertShape,this.btnColorSchemas,this.btnSlideSize,this.listTheme,this.mnuShowSettings],_.each([e.btnSave].concat(e.paragraphControls),function(e){_.isFunction(e.setDisabled)&&e.setDisabled(!0)}),this.lockToolbar(PE.enumLock.disableOnStart,!0,{array:e.slideOnlyControls.concat(e.shapeControls)}),this},lockToolbar:function(e,t,n){function i(e,n){if(_.contains(e.options.lock,n)){var r=e.keepState.indexOf(n);t?r<0&&e.keepState.push(n):r<0||e.keepState.splice(r,1)}}!n&&(n={});var r=n.array||this.lockControls;n.merge&&(r=_.union(this.lockControls,r)),_.each(r,function(t){_.isFunction(t.setDisabled)&&(!t.keepState&&(t.keepState=[]),n.clear&&n.clear.length>0&&t.keepState.length>0&&(t.keepState=_.difference(t.keepState,n.clear)),_.isArray(e)?_.each(e,function(e){i(t,e)}):i(t,e),t.keepState.length>0?!t.isDisabled()&&t.setDisabled(!0):t.isDisabled()&&t.setDisabled(!1))})},render:function(e){var t=this,n=$(this.el);this.trigger("render:before",this);var r=Common.localStorage.getItem("pe-compact-toolbar"),i=!!(r!==null&&parseInt(r)==1||r===null&&e.customization&&e.customization.compactToolbar);return n.html(this.template({isCompactView:i})),t.rendererComponents(i?"short":"full"),t.isCompactView=i,this.trigger("render:after",this),this},rendererComponents:function(e){var t=e==="short"?"short":"full",n=function(e,t){var n=$(e),r=n.get(0);r&&t&&(t.rendered?(t.el=document.getElementById(t.id),r.appendChild(document.getElementById(t.id))):t.render(n))};n("#id-toolbar-"+t+"-placeholder-field-fontname",this.cmbFontName),n("#id-toolbar-"+t+"-placeholder-field-fontsize",this.cmbFontSize),n("#id-toolbar-"+t+"-placeholder-btn-newdocument",this.btnNewDocument),n("#id-toolbar-"+t+"-placeholder-btn-opendocument",this.btnOpenDocument),n("#id-toolbar-"+t+"-placeholder-btn-addslide",this.btnAddSlide),e==="short"?$("button",this.btnAddSlide.cmpEl).removeClass("large"):$("button",this.btnAddSlide.cmpEl).addClass("large"),n("#id-toolbar-"+t+"-placeholder-btn-changeslide",this.btnChangeSlide),n("#id-toolbar-"+t+"-placeholder-btn-preview",this.btnPreview),n("#id-toolbar-"+t+"-placeholder-btn-print",this.btnPrint),n("#id-toolbar-"+t+"-placeholder-btn-save",this.btnSave),n("#id-toolbar-"+t+"-placeholder-btn-undo",this.btnUndo),n("#id-toolbar-"+t+"-placeholder-btn-redo",this.btnRedo),n("#id-toolbar-"+t+"-placeholder-btn-copy",this.btnCopy),n("#id-toolbar-"+t+"-placeholder-btn-paste",this.btnPaste),n("#id-toolbar-"+t+"-placeholder-btn-bold",this.btnBold),n("#id-toolbar-"+t+"-placeholder-btn-italic",this.btnItalic),n("#id-toolbar-"+t+"-placeholder-btn-underline",this.btnUnderline),n("#id-toolbar-"+t+"-placeholder-btn-strikeout",this.btnStrikeout),n("#id-toolbar-"+t+"-placeholder-btn-superscript",this.btnSuperscript),n("#id-toolbar-"+t+"-placeholder-btn-subscript",this.btnSubscript),n("#id-toolbar-"+t+"-placeholder-btn-fontcolor",this.btnFontColor),n("#id-toolbar-"+t+"-placeholder-btn-clearstyle",this.btnClearStyle),n("#id-toolbar-"+t+"-placeholder-btn-copystyle",this.btnCopyStyle),n("#id-toolbar-"+t+"-placeholder-btn-markers",this.btnMarkers),n("#id-toolbar-"+t+"-placeholder-btn-numbering",this.btnNumbers),n("#id-toolbar-"+t+"-placeholder-btn-incoffset",this.btnIncLeftOffset),n("#id-toolbar-"+t+"-placeholder-btn-decoffset",this.btnDecLeftOffset),n("#id-toolbar-"+t+"-placeholder-btn-halign",this.btnHorizontalAlign),n("#id-toolbar-"+t+"-placeholder-btn-valign",this.btnVerticalAlign),n("#id-toolbar-"+t+"-placeholder-btn-linespace",this.btnLineSpace),n("#id-toolbar-"+t+"-placeholder-btn-arrange-shape",this.btnShapeArrange),n("#id-toolbar-"+t+"-placeholder-btn-align-shape",this.btnShapeAlign),n("#id-toolbar-"+t+"-placeholder-btn-insertshape",this.btnInsertShape),n("#id-toolbar-"+t+"-placeholder-btn-inserttext",this.btnInsertText),n("#id-toolbar-"+t+"-placeholder-btn-insertequation",this.btnInsertEquation),n("#id-toolbar-"+t+"-placeholder-btn-inserthyperlink",this.btnInsertHyperlink),n("#id-toolbar-"+t+"-placeholder-btn-inserttable",this.btnInsertTable),n("#id-toolbar-"+t+"-placeholder-btn-insertimage",this.btnInsertImage),n("#id-toolbar-"+t+"-placeholder-btn-insertchart",this.btnInsertChart),n("#id-toolbar-"+t+"-placeholder-btn-colorschemas",this.btnColorSchemas),n("#id-toolbar-"+t+"-placeholder-btn-slidesize",this.btnSlideSize),n("#id-toolbar-full-placeholder-field-styles",this.listTheme),n("#id-toolbar-"+t+"-placeholder-btn-hidebars",this.btnHide),n("#id-toolbar-"+t+"-placeholder-btn-settings",this.btnAdvSettings),n("#id-toolbar-full-placeholder-field-styles",this.listTheme)},createDelayedElements:function(){this.btnNewDocument.updateHint(this.tipNewDocument),this.btnOpenDocument.updateHint(this.tipOpenDocument),this.btnAddSlide.updateHint(this.tipAddSlide+Common.Utils.String.platformKey("Ctrl+M")),this.btnChangeSlide.updateHint(this.tipChangeSlide),this.btnPreview.updateHint(this.tipPreview),this.btnPrint.updateHint(this.tipPrint+Common.Utils.String.platformKey("Ctrl+P")),this.btnSave.updateHint(this.btnSaveTip),this.btnUndo.updateHint(this.tipUndo+Common.Utils.String.platformKey("Ctrl+Z")),this.btnRedo.updateHint(this.tipRedo+Common.Utils.String.platformKey("Ctrl+Y")),this.btnCopy.updateHint(this.tipCopy+Common.Utils.String.platformKey("Ctrl+C")),this.btnPaste.updateHint(this.tipPaste+Common.Utils.String.platformKey("Ctrl+V")),this.btnBold.updateHint(this.textBold+Common.Utils.String.platformKey("Ctrl+B")),this.btnItalic.updateHint(this.textItalic+Common.Utils.String.platformKey("Ctrl+I")),this.btnUnderline.updateHint(this.textUnderline+Common.Utils.String.platformKey("Ctrl+U")),this.btnStrikeout.updateHint(this.textStrikeout),this.btnSuperscript.updateHint(this.textSuperscript),this.btnSubscript.updateHint(this.textSubscript),this.btnFontColor.updateHint(this.tipFontColor),this.btnClearStyle.updateHint(this.tipClearStyle),this.btnCopyStyle.updateHint(this.tipCopyStyle+Common.Utils.String.platformKey("Ctrl+Shift+C")),this.btnMarkers.updateHint(this.tipMarkers),this.btnNumbers.updateHint(this.tipNumbers),this.btnHorizontalAlign.updateHint(this.tipHAligh),this.btnVerticalAlign.updateHint(this.tipVAligh),this.btnDecLeftOffset.updateHint(this.tipDecPrLeft+Common.Utils.String.platformKey("Ctrl+Shift+M")),this.btnIncLeftOffset.updateHint(this.tipIncPrLeft),this.btnLineSpace.updateHint(this.tipLineSpace),this.btnInsertTable.updateHint(this.tipInsertTable),this.btnInsertImage.updateHint(this.tipInsertImage),this.btnInsertChart.updateHint(this.tipInsertChart),this.btnInsertText.updateHint(this.tipInsertText),this.btnInsertEquation.updateHint(this.tipInsertEquation),this.btnInsertHyperlink.updateHint(this.tipInsertHyperlink+Common.Utils.String.platformKey("Ctrl+K")),this.btnInsertShape.updateHint(this.tipInsertShape),this.btnColorSchemas.updateHint(this.tipColorSchemas),this.btnHide.updateHint(this.tipViewSettings),this.btnAdvSettings.updateHint(this.tipAdvSettings),this.btnShapeAlign.updateHint(this.tipShapeAlign),this.btnShapeArrange.updateHint(this.tipShapeArrange),this.btnSlideSize.updateHint(this.tipSlideSize);var e=this;this.btnHide.setMenu(new Common.UI.Menu({cls:"pull-right",style:"min-width: 180px;",items:[this.mnuitemCompactToolbar=new Common.UI.MenuItem({caption:this.textCompactView,checkable:!0}),this.mnuitemHideTitleBar=new Common.UI.MenuItem({caption:this.textHideTitleBar,checkable:!0}),this.mnuitemHideStatusBar=new Common.UI.MenuItem({caption:this.textHideStatusBar,checkable:!0}),this.mnuitemHideRulers=new Common.UI.MenuItem({caption:this.textHideLines,checkable:!0}),{caption:"--"},this.btnFitPage=new Common.UI.MenuItem({caption:this.textFitPage,checkable:!0,checked:this.btnFitPage.isChecked()}),this.btnFitWidth=new Common.UI.MenuItem({caption:this.textFitWidth,checkable:!0,checked:this.btnFitWidth.isChecked()}),this.mnuZoom=new Common.UI.MenuItem({template:_.template(['"].join("")),stopPropagation:!0,value:this.mnuZoom.options.value})]})),(this.mode.isDesktopApp||this.mode.canBrandingExt&&this.mode.customization&&this.mode.customization.header===!1)&&this.mnuitemHideTitleBar.hide(),this.mode.canBrandingExt&&this.mode.customization&&this.mode.customization.statusBar===!1&&this.mnuitemHideStatusBar.hide(),this.mnuZoomOut=new Common.UI.Button({el:$("#id-menu-zoom-out"),cls:"btn-toolbar"}),this.mnuZoomIn=new Common.UI.Button({el:$("#id-menu-zoom-in"),cls:"btn-toolbar"}),this.btnMarkers.setMenu(new Common.UI.Menu({items:[{template:_.template('')}]})),this.btnNumbers.setMenu(new Common.UI.Menu({items:[{template:_.template('')}]})),this.btnAddSlide.setMenu(new Common.UI.Menu({items:[{template:_.template('')}]})),this.btnChangeSlide.setMenu(new Common.UI.Menu({items:[{template:_.template('')}]}));var t=this.mnuMarkersPicker.conf;this.mnuMarkersPicker=new Common.UI.DataView({el:$("#id-toolbar-menu-markers"),parentMenu:this.btnMarkers.menu,restoreHeight:92,allowScrollbar:!1,store:new Common.UI.DataViewStore([{offsety:0,data:{type:0,subtype:-1}},{offsety:38,data:{type:0,subtype:1}},{offsety:76,data:{type:0,subtype:2}},{offsety:114,data:{type:0,subtype:3}},{offsety:152,data:{type:0,subtype:4}},{offsety:190,data:{type:0,subtype:5}},{offsety:228,data:{type:0,subtype:6}},{offsety:266,data:{type:0,subtype:7}}]),itemTemplate:_.template('
    ')}),t&&this.mnuMarkersPicker.selectByIndex(t.index,!0),t=this.mnuNumbersPicker.conf,this.mnuNumbersPicker=new Common.UI.DataView({el:$("#id-toolbar-menu-numbering"),parentMenu:this.btnNumbers.menu,restoreHeight:164,allowScrollbar:!1,store:new Common.UI.DataViewStore([{offsety:0,data:{type:1,subtype:-1}},{offsety:296,data:{type:1,subtype:4}},{offsety:370,data:{type:1,subtype:5}},{offsety:444,data:{type:1,subtype:6}},{offsety:74,data:{type:1,subtype:1}},{offsety:148,data:{type:1,subtype:2}},{offsety:222,data:{type:1,subtype:3}},{offsety:518,data:{type:1,subtype:7}}]),itemTemplate:_.template('
    ')}),t&&this.mnuNumbersPicker.selectByIndex(t.index,!0),this.mnuAddSlidePicker=new Common.UI.DataView({el:$("#id-toolbar-menu-addslide"),parentMenu:this.btnAddSlide.menu,showLast:!1,restoreHeight:300,style:"max-height: 300px;",store:PE.getCollection("SlideLayouts"),itemTemplate:_.template(['
    ','
    ','
    <%= title %>
    ',"
    "].join(""))}),this.btnAddSlide.menu&&this.btnAddSlide.menu.on("show:after",function(){e.onSlidePickerShowAfter(e.mnuAddSlidePicker),e.mnuAddSlidePicker.scroller.update({alwaysVisibleY:!0}),e.mnuAddSlidePicker.scroller.scrollTop(0)}),this.mnuAddSlidePicker._needRecalcSlideLayout=!0;var n=function(t){e.mnuChangeSlidePicker=new Common.UI.DataView({el:$("#id-toolbar-menu-changeslide"),parentMenu:e.btnChangeSlide.menu,showLast:!1,restoreHeight:300,style:"max-height: 300px;",store:PE.getCollection("SlideLayouts"),itemTemplate:_.template(['
    ','
    ','
    <%= title %>
    ',"
    "].join(""))}),e.btnChangeSlide.menu&&e.btnChangeSlide.menu.on("show:after",function(){e.onSlidePickerShowAfter(e.mnuChangeSlidePicker),e.mnuChangeSlidePicker.scroller.update({alwaysVisibleY:!0}),e.mnuChangeSlidePicker.scroller.scrollTop(0)}),e.mnuChangeSlidePicker._needRecalcSlideLayout=!0};this.btnChangeSlide.rendered?n(this.btnChangeSlide):this.btnChangeSlide.on("render:after",n),this.listenTo(PE.getCollection("SlideLayouts"),"reset",function(){e.mnuAddSlidePicker._needRecalcSlideLayout=!0,e.mnuChangeSlidePicker&&(e.mnuChangeSlidePicker._needRecalcSlideLayout=!0)});var r=this.mode,i=Common.localStorage.getItem("pe-compact-toolbar"),s=!!(i!==null&&parseInt(i)==1||i===null&&r.customization&&r.customization.compactToolbar);i=Common.localStorage.getItem("pe-hidden-title");var o=i!==null&&parseInt(i)==1;i=Common.localStorage.getItem("pe-hidden-status");var u=i!==null&&parseInt(i)==1;i=Common.localStorage.getItem("pe-hidden-rulers");var a=i!==null&&parseInt(i)==1;this.mnuitemCompactToolbar.setChecked(s,!0),this.mnuitemCompactToolbar.on("toggle",_.bind(this.changeViewMode,this)),this.mnuitemHideTitleBar.setChecked(o,!0),this.mnuitemHideStatusBar.setChecked(u,!0),this.mnuitemHideRulers.setChecked(a,!0),this.lockToolbar(PE.enumLock.disableOnStart,!1,{array:this.slideOnlyControls.concat(this.shapeControls)});var f=Common.localStorage.getItem("pe-hide-synch");this.showSynchTip=!f||parseInt(f)!=1,this.needShowSynchTip=!1,this.needShowSynchTip&&(this.needShowSynchTip=!1,this.onCollaborativeChanges())},setApi:function(e){return this.api=e,this.api&&(this.api.asc_registerCallback("asc_onSendThemeColorSchemes",_.bind(this.onSendThemeColorSchemes,this)),this.api.asc_registerCallback("asc_onCollaborativeChanges",_.bind(this.onCollaborativeChanges,this)),this.api.asc_registerCallback("asc_onAuthParticipantsChanged",_.bind(this.onApiUsersChanged,this)),this.api.asc_registerCallback("asc_onParticipantsChanged",_.bind(this.onApiUsersChanged,this))),this},setMode:function(e){e.isDisconnected&&this.lockToolbar(PE.enumLock.lostConnect,!0),this.mode=e;if(!e.nativeApp){var t=$(".toolbar-group-native");t&&t.hide()}e.isDesktopApp&&$(".toolbar-group-native").hide(),this.lockToolbar(PE.enumLock.cantPrint,!e.canPrint||e.disableDownload,{array:[this.btnPrint]})},changeViewMode:function(e,t){var n=this,r=$("#id-toolbar-full"),i=$("#id-toolbar-short");n.isCompactView=t,r&&i&&(t?(i.css({display:"table"}),r.css({display:"none"}),i.parent().css({height:"41px"}),this.rendererComponents("short")):(i.css({display:"none"}),r.css({display:"table"}),i.parent().css({height:"67px"}),this.rendererComponents("full"),_.defer(function(){var e=n.listTheme.rendered;n.listTheme.menuPicker.store.length>0&&e&&n.listTheme.fillComboView(n.listTheme.menuPicker.getSelectedRec(),!0),n.btnInsertEquation.rendered&&PE.getController("Toolbar").fillEquations()},100)),this.fireEvent("changecompact",[this,t]))},onSendThemeColorSchemes:function(e){var t=this,n=t.btnColorSchemas.menu;if(n){n&&n.items.length>0&&_.each(n.items,function(e){e.remove()}),n==null&&(n=(new Common.UI.Menu({maxHeight:600,restoreHeight:600})).on("render:after",function(e){this.scroller=new Common.UI.Scroller({el:$(this.el).find(".dropdown-menu "),useKeyboard:this.enableKeyEvents&&!this.handleSelect,minScrollbarLength:40})})),n.items=[];var r=_.template(['','',"<% _.each(options.colors, function(color) { %>",'',"<% }) %>","",'<%= caption %>',""].join(""));_.each(e,function(e,i){var s=e.get_colors(),o=[];for(var u=2;u<7;u++){var a="#"+Common.Utils.ThemeColor.getHexColor(s[u].get_r(),s[u].get_g(),s[u].get_b());o.push(a)}i==21?n.addItem({caption:"--"}):n.addItem({template:r,cls:"color-schemas-menu",colors:o,caption:i<21?t.schemeNames[i]||e.get_name():e.get_name(),value:i})},this)}},onCollaborativeChanges:function(){if(this._state.hasCollaborativeChanges)return;if(!this.btnSave.rendered){this.needShowSynchTip=!0;return}var e=PE.getController("Viewport").getView("DocumentPreview");if(e&&e.isVisible()){this.needShowSynchTip=!0;return}this._state.hasCollaborativeChanges=!0;var t=$(".btn-icon",this.btnSave.cmpEl);t.removeClass(this.btnSaveCls),t.addClass("btn-synch"),this.showSynchTip?(this.btnSave.updateHint(""),this.synchTooltip===undefined&&this.createSynchTip(),this.synchTooltip.show()):this.btnSave.updateHint(this.tipSynchronize+Common.Utils.String.platformKey("Ctrl+S")),this.btnSave.setDisabled(!1),Common.Gateway.collaborativeChanges()},createSynchTip:function(){this.synchTooltip=new Common.UI.SynchronizeTip({target:$("#id-toolbar-btn-save")}),this.synchTooltip.on("dontshowclick",function(){this.showSynchTip=!1,this.synchTooltip.hide(),this.btnSave.updateHint(this.tipSynchronize+Common.Utils.String.platformKey("Ctrl+S")),Common.localStorage.setItem("pe-hide-synch",1)},this),this.synchTooltip.on("closeclick",function(){this.synchTooltip.hide(),this.btnSave.updateHint(this.tipSynchronize+Common.Utils.String.platformKey("Ctrl+S"))},this)},synchronizeChanges:function(){if(this.btnSave.rendered){var e=$(".btn-icon",this.btnSave.cmpEl);e.hasClass("btn-synch")&&(e.removeClass("btn-synch"),e.addClass(this.btnSaveCls),this.synchTooltip&&this.synchTooltip.hide(),this.btnSave.updateHint(this.btnSaveTip),this.btnSave.setDisabled(!this.mode.forcesave),this._state.hasCollaborativeChanges=!1)}},onApiUsersChanged:function(e){var t=[];_.each(e,function(e){e.asc_getView()||t.push(e)});var n=_.size(t),r=n>1?"btn-save-coauth":"btn-save";if(r!==this.btnSaveCls&&this.btnSave.rendered){this.btnSaveTip=(n>1?this.tipSaveCoauth:this.tipSave)+Common.Utils.String.platformKey("Ctrl+S");var i=$(".btn-icon",this.btnSave.cmpEl);i.hasClass("btn-synch")||(i.removeClass(this.btnSaveCls),i.addClass(r),this.btnSave.updateHint(this.btnSaveTip)),this.btnSaveCls=r}},onSlidePickerShowAfter:function(e){if(!e._needRecalcSlideLayout)return;if(e.cmpEl&&e.dataViewItems.length>0){var t=e.dataViewItems,n=$(t[0].el),r=n.outerWidth()+parseInt(n.css("margin-left"))+parseInt(n.css("margin-right")),i=Math.floor(e.cmpEl.width()/r),s=0,o=0;for(var u=0;uo?o=f:a.css({height:o}),s++,s>i-1&&(s=0,o=0)}e._needRecalcSlideLayout=!1}},textBold:"Bold",textItalic:"Italic",textUnderline:"Underline",textStrikeout:"Strikeout",textSuperscript:"Superscript",textSubscript:"Subscript",tipFontName:"Font Name",tipFontSize:"Font Size",tipCopy:"Copy",tipPaste:"Paste",tipUndo:"Undo",tipRedo:"Redo",tipPrint:"Print",tipSave:"Save",tipFontColor:"Font color",tipMarkers:"Bullets",tipNumbers:"Numbering",tipBack:"Back",tipClearStyle:"Clear Style",tipCopyStyle:"Copy Style",textTitleError:"Error",tipHAligh:"Horizontal Align",tipVAligh:"Vertical Align",textAlignTop:"Align text to the top",textAlignMiddle:"Align text to the middle",textAlignBottom:"Align text to the bottom",textAlignLeft:"Left align text",textAlignRight:"Right align text",textAlignCenter:"Center text",textAlignJust:"Justify",tipDecPrLeft:"Decrease Indent",tipIncPrLeft:"Increase Indent",tipLineSpace:"Line Spacing",tipInsertTable:"Insert Table",tipInsertImage:"Insert Picture",mniImageFromFile:"Picture from file",mniImageFromUrl:"Picture from url",mniCustomTable:"Insert Custom Table",tipInsertHyperlink:"Add Hyperlink",tipInsertText:"Insert Text",tipInsertShape:"Insert Autoshape",tipPreview:"Start Slideshow",tipAddSlide:"Add Slide",tipNewDocument:"New Document",tipOpenDocument:"Open Document",tipShapeAlign:"Align Shape",tipShapeArrange:"Arrange Shape",textShapeAlignLeft:"Align Left",textShapeAlignRight:"Align Right",textShapeAlignCenter:"Align Center",textShapeAlignTop:"Align Top",textShapeAlignBottom:"Align Bottom",textShapeAlignMiddle:"Align Middle",textArrangeFront:"Bring To Front",textArrangeBack:"Send To Back",textArrangeForward:"Bring Forward",textArrangeBackward:"Send Backward",txtGroup:"Group",txtUngroup:"Ungroup",txtDistribHor:"Distribute Horizontally",txtDistribVert:"Distribute Vertically",tipChangeSlide:"Change Slide Layout",textOK:"OK",textCancel:"Cancel",tipColorSchemas:"Change Color Scheme",textNewColor:"Add New Custom Color",mniSlideStandard:"Standard (4:3)",mniSlideWide:"Widescreen (16:9)",mniSlideAdvanced:"Advanced Settings",tipSlideSize:"Select Slide Size",tipViewSettings:"View Settings",tipAdvSettings:"Advanced Settings",textCompactView:"View Compact Toolbar",textHideTitleBar:"Hide Title Bar",textHideStatusBar:"Hide Status Bar",textHideLines:"Hide Rulers",textFitPage:"Fit to Slide",textFitWidth:"Fit to Width",textZoom:"Zoom",tipInsertChart:"Insert Chart",textLine:"Line",textColumn:"Column",textBar:"Bar",textArea:"Area",textPie:"Pie",textPoint:"XY (Scatter)",textStock:"Stock",tipSynchronize:"The document has been changed by another user. Please click to save your changes and reload the updates.",txtScheme1:"Office",txtScheme2:"Grayscale",txtScheme3:"Apex",txtScheme4:"Aspect",txtScheme5:"Civic",txtScheme6:"Concourse",txtScheme7:"Equity",txtScheme8:"Flow",txtScheme9:"Foundry",txtScheme10:"Median",txtScheme11:"Metro",txtScheme12:"Module",txtScheme13:"Opulent",txtScheme14:"Oriel",txtScheme15:"Origin",txtScheme16:"Paper",txtScheme17:"Solstice",txtScheme18:"Technic",txtScheme19:"Trek",txtScheme20:"Urban",txtScheme21:"Verve",tipSlideTheme:"Slide Theme",tipSaveCoauth:"Save your changes for the other users to see them.",textInsText:"Insert text box",textInsTextArt:"Insert Text Art",textShowBegin:"Show from Beginning",textShowCurrent:"Show from Current slide",textShowSettings:"Show Settings",tipInsertEquation:"Insert Equation",textCharts:"Charts",tipChangeChart:"Change Chart Type"},PE.Views.Toolbar||{}))}),define("presentationeditor/main/app/view/SlideSizeSettings",["common/main/lib/component/Window","common/main/lib/component/ComboBox"],function(){"use strict";PE.Views.SlideSizeSettings=Common.UI.Window.extend(_.extend({options:{width:250,header:!0,style:"min-width: 250px;",cls:"modal-dlg",id:"window-slide-size-settings"},initialize:function(e){_.extend(this.options,{title:this.textTitle},e||{}),this.template=['
    ','
    ','","
    ",'
    ','',"",'",'","","
    ','",'
    ',"
    ','",'
    ',"
    ",'
    ','","
    ",'
    ',"
    ",'
    ','"].join(""),this.options.tpl=_.template(this.template,this.options),this.spinners=[],this._noApply=!1,Common.UI.Window.prototype.initialize.call(this,this.options)},render:function(){Common.UI.Window.prototype.render.call(this),this.cmbSlideSize=new Common.UI.ComboBox({el:$("#slide-size-combo"),cls:"input-group-nr",style:"width: 100%;",menuStyle:"min-width: 218px;",editable:!1,data:[{value:0,displayValue:this.txtStandard,size:[254,190.5]},{value:1,displayValue:this.txtWidescreen1,size:[254,143]},{value:2,displayValue:this.txtWidescreen2,size:[254,158.7]},{value:3,displayValue:this.txtLetter,size:[254,190.5]},{value:4,displayValue:this.txtLedger,size:[338.3,253.7]},{value:5,displayValue:this.txtA3,size:[355.6,266.7]},{value:6,displayValue:this.txtA4,size:[275,190.5]},{value:7,displayValue:this.txtB4,size:[300.7,225.5]},{value:8,displayValue:this.txtB5,size:[199.1,149.3]},{value:9,displayValue:this.txt35,size:[285.7,190.5]},{value:10,displayValue:this.txtOverhead,size:[254,190.5]},{value:11,displayValue:this.txtBanner,size:[203.2,25.4]},{value:-1,displayValue:this.txtCustom,size:[]}]}),this.cmbSlideSize.setValue(0),this.cmbSlideSize.on("selected",_.bind(function(e,t){this._noApply=!0;if(!(t.value<0)){var n=t.size[0],r=t.size[1],i=this.cmbSlideOrientation.getValue(),s=i==0&&n>r||i==1&&r>n;this.spnWidth.setValue(Common.Utils.Metric.fnRecalcFromMM(s?r:n),!0),this.spnHeight.setValue(Common.Utils.Metric.fnRecalcFromMM(s?n:r),!0)}this._noApply=!1},this)),this.spnWidth=new Common.UI.MetricSpinner({el:$("#slide-size-spin-width"),step:.1,width:98,defaultUnit:"cm",value:"25.4 cm",maxValue:55.88,minValue:0}),this.spinners.push(this.spnWidth),this.spnWidth.on("change",_.bind(function(e,t,n,r){if(!this._noApply){this.cmbSlideSize.getValue()>-1&&this.cmbSlideSize.setValue(-1);var i=this.spnWidth.getNumberValue(),s=this.spnHeight.getNumberValue();this.cmbSlideOrientation.setValue(s>i?0:1)}},this)),this.spnHeight=new Common.UI.MetricSpinner({el:$("#slide-size-spin-height"),step:.1,width:98,defaultUnit:"cm",value:"19.05 cm",maxValue:55.88,minValue:0}),this.spinners.push(this.spnHeight),this.spnHeight.on("change",_.bind(function(e,t,n,r){if(!this._noApply){this.cmbSlideSize.getValue()>-1&&this.cmbSlideSize.setValue(-1);var i=this.spnWidth.getNumberValue(),s=this.spnHeight.getNumberValue();this.cmbSlideOrientation.setValue(s>i?0:1)}},this)),this.cmbSlideOrientation=new Common.UI.ComboBox({el:$("#slide-orientation-combo"),cls:"input-group-nr",style:"width: 100%;",menuStyle:"min-width: 218px;",editable:!1,data:[{value:0,displayValue:this.strPortrait},{value:1,displayValue:this.strLandscape}]}),this.cmbSlideOrientation.setValue(1),this.cmbSlideOrientation.on("selected",_.bind(function(e,t){this._noApply=!0;var n=this.spnWidth.getNumberValue(),r=this.spnHeight.getNumberValue();if(t.value==0&&n>r||t.value==1&&r>n)this.spnWidth.setValue(r,!0),this.spnHeight.setValue(n,!0);this._noApply=!1},this));var e=this.getChild();e.find(".dlg-btn").on("click",_.bind(this.onBtnClick,this)),e.find("input").on("keypress",_.bind(this.onKeyPress,this)),this.updateMetricUnit()},_handleInput:function(e){this.options.handler&&this.options.handler.call(this,this,e),this.close()},onBtnClick:function(e){this._handleInput(e.currentTarget.attributes.result.value)},onKeyPress:function(e){e.keyCode==Common.UI.Keys.RETURN&&this._handleInput("ok")},setSettings:function(e,t,n){this.spnWidth.setValue(Common.Utils.Metric.fnRecalcFromMM(t),!0),this.spnHeight.setValue(Common.Utils.Metric.fnRecalcFromMM(n),!0),this.cmbSlideSize.setValue(e),this.cmbSlideOrientation.setValue(n>t?0:1)},getSettings:function(){var e=[this.cmbSlideSize.getValue(),Common.Utils.Metric.fnRecalcToMM(this.spnWidth.getNumberValue()),Common.Utils.Metric.fnRecalcToMM(this.spnHeight.getNumberValue())];return e},updateMetricUnit:function(){if(this.spinners)for(var e=0;e','
    ',"
    ",'
    ','"].join(""),this.options.tpl=_.template(this.template,this.options),this.spinners=[],this._noApply=!1,Common.UI.Window.prototype.initialize.call(this,this.options)},render:function(){Common.UI.Window.prototype.render.call(this),this.chLoop=new Common.UI.CheckBox({el:$("#slideshow-checkbox-loop"),labelText:this.textLoop});var e=this.getChild();e.find(".dlg-btn").on("click",_.bind(this.onBtnClick,this)),e.find("input").on("keypress",_.bind(this.onKeyPress,this))},_handleInput:function(e){this.options.handler&&this.options.handler.call(this,this,e),this.close()},onBtnClick:function(e){this._handleInput(e.currentTarget.attributes.result.value)},onKeyPress:function(e){e.keyCode==Common.UI.Keys.RETURN&&this._handleInput("ok")},setSettings:function(e){this.chLoop.setValue(e)},getSettings:function(){return this.chLoop.getValue()=="checked"},textTitle:"Show Settings",textLoop:"Loop continuously until 'Esc' is pressed",cancelButtonText:"Cancel",okButtonText:"Ok"},PE.Views.SlideshowSettings||{}))}),define("presentationeditor/main/app/controller/Toolbar",["core","common/main/lib/component/Window","common/main/lib/view/CopyWarningDialog","common/main/lib/view/ImageFromUrlDialog","common/main/lib/view/InsertTableDialog","common/main/lib/util/define","presentationeditor/main/app/view/Toolbar","presentationeditor/main/app/view/HyperlinkSettingsDialog","presentationeditor/main/app/view/SlideSizeSettings","presentationeditor/main/app/view/SlideshowSettings"],function(){"use strict";PE.Controllers.Toolbar=Backbone.Controller.extend(_.extend({models:[],collections:[],views:["Toolbar"],initialize:function(){this._state={activated:!1,themeId:undefined,bullets:{type:undefined,subtype:undefined},prcontrolsdisable:undefined,slidecontrolsdisable:undefined,slidelayoutdisable:undefined,shapecontrolsdisable:undefined,no_paragraph:undefined,no_text:undefined,no_object:undefined,clrtext:undefined,linespace:undefined,pralign:undefined,valign:undefined,vtextalign:undefined,can_undo:undefined,can_redo:undefined,bold:undefined,italic:undefined,strike:undefined,underline:undefined,can_group:undefined,can_ungroup:undefined,lock_doc:undefined,changeslide_inited:!1,no_slides:undefined,can_increase:undefined,can_decrease:undefined,can_hyper:undefined,zoom_type:undefined,zoom_percent:undefined,fontsize:undefined,in_equation:undefined,in_chart:!1},this._isAddingShape=!1,this.slideSizeArr=[[254,190.5],[254,143],[254,158.7],[254,190.5],[338.3,253.7],[355.6,266.7],[275,190.5],[300.7,225.5],[199.1,149.3],[285.7,190.5],[254,190.5],[203.2,25.4]],this.currentPageSize={type:-1,width:0,height:0},this.flg={},this.diagramEditor=null,this.editMode=!0,this.addListeners({Toolbar:{changecompact:this.onChangeCompactView}});var e=this,t=function(t){var n=$(t.target),r=n.closest("#editor_sdk"),i=n.closest("button").attr("id");i===undefined&&(i=n.closest(".btn-group").attr("id")),n.attr("id")!="editor_sdk"&&r.length<=0&&(e.toolbar.btnInsertText.pressed&&i!=e.toolbar.btnInsertText.id||e.toolbar.btnInsertShape.pressed&&i!=e.toolbar.btnInsertShape.id?(e._isAddingShape=!1,e._addAutoshape(!1),e.toolbar.btnInsertShape.toggle(!1,!0),e.toolbar.btnInsertText.toggle(!1,!0),Common.NotificationCenter.trigger("edit:complete",e.toolbar)):e.toolbar.btnInsertShape.pressed&&i==e.toolbar.btnInsertShape.id&&_.defer(function(){e.api.StartAddShape("",!1),Common.NotificationCenter.trigger("edit:complete",e.toolbar)},100))};this.onApiEndAddShape=function(){this.toolbar.fireEvent("insertshape",this.toolbar),this.toolbar.btnInsertShape.pressed&&this.toolbar.btnInsertShape.toggle(!1,!0),this.toolbar.btnInsertText.pressed&&this.toolbar.btnInsertText.toggle(!1,!0),$(document.body).off("mouseup",t)},this._addAutoshape=function(e,n){this.api&&(e?(this.api.StartAddShape(n,!0),$(document.body).on("mouseup",t)):(this.api.StartAddShape("",!1),$(document.body).off("mouseup",t)))}},onLaunch:function(){this.toolbar=this.createView("Toolbar")},onToolbarAfterRender:function(e){e.btnNewDocument.on("click",_.bind(this.onNewDocument,this)),e.btnOpenDocument.on("click",_.bind(this.onOpenDocument,this)),e.btnAddSlide.on("click",_.bind(this.onBtnAddSlide,this)),e.mnuAddSlidePicker.on("item:click",_.bind(this.onAddSlide,this)),e.mnuChangeSlidePicker&&e.mnuChangeSlidePicker.on("item:click",_.bind(this.onChangeSlide,this)),e.btnPreview.on("click",_.bind(this.onPreviewBtnClick,this)),e.btnPreview.menu.on("item:click",_.bind(this.onPreviewItemClick,this)),e.btnPrint.on("click",_.bind(this.onPrint,this)),e.btnSave.on("click",_.bind(this.onSave,this)),e.btnUndo.on("click",_.bind(this.onUndo,this)),e.btnRedo.on("click",_.bind(this.onRedo,this)),e.btnCopy.on("click",_.bind(this.onCopyPaste,this,!0)),e.btnPaste.on("click",_.bind(this.onCopyPaste,this,!1)),e.btnBold.on("click",_.bind(this.onBold,this)),e.btnItalic.on("click",_.bind(this.onItalic,this)),e.btnUnderline.on("click",_.bind(this.onUnderline,this)),e.btnStrikeout.on("click",_.bind(this.onStrikeout,this)),e.btnSuperscript.on("click",_.bind(this.onSuperscript,this)),e.btnSubscript.on("click",_.bind(this.onSubscript,this)),e.btnHorizontalAlign.menu.on("item:click",_.bind(this.onMenuHorizontalAlignSelect,this)),e.btnVerticalAlign.menu.on("item:click",_.bind(this.onMenuVerticalAlignSelect,this)),e.btnDecLeftOffset.on("click",_.bind(this.onDecOffset,this)),e.btnIncLeftOffset.on("click",_.bind(this.onIncOffset,this)),e.btnMarkers.on("click",_.bind(this.onMarkers,this)),e.btnNumbers.on("click",_.bind(this.onNumbers,this)),e.cmbFontName.on("selected",_.bind(this.onFontNameSelect,this)),e.cmbFontName.on("show:after",_.bind(this.onComboOpen,this,!0)),e.cmbFontName.on("hide:after",_.bind(this.onHideMenus,this)),e.cmbFontName.on("combo:blur",_.bind(this.onComboBlur,this)),e.cmbFontName.on("combo:focusin",_.bind(this.onComboOpen,this,!1)),e.cmbFontSize.on("selected",_.bind(this.onFontSizeSelect,this)),e.cmbFontSize.on("changed:before",_.bind(this.onFontSizeChanged,this,!0)),e.cmbFontSize.on("changed:after",_.bind(this.onFontSizeChanged,this,!1)),e.cmbFontSize.on("show:after",_.bind(this.onComboOpen,this,!0)),e.cmbFontSize.on("hide:after",_.bind(this.onHideMenus,this)),e.cmbFontSize.on("combo:blur",_.bind(this.onComboBlur,this)),e.cmbFontSize.on("combo:focusin",_.bind(this.onComboOpen,this,!1)),e.mnuMarkersPicker.on("item:click",_.bind(this.onSelectBullets,this,e.btnMarkers)),e.mnuNumbersPicker.on("item:click",_.bind(this.onSelectBullets,this,e.btnNumbers)),e.btnFontColor.on("click",_.bind(this.onBtnFontColor,this)),e.mnuFontColorPicker.on("select",_.bind(this.onSelectFontColor,this)),$("#id-toolbar-menu-new-fontcolor").on("click",_.bind(this.onNewFontColor,this)),e.btnLineSpace.menu.on("item:toggle",_.bind(this.onLineSpaceToggle,this)),e.btnShapeAlign.menu.on("item:click",_.bind(this.onShapeAlign,this)),e.btnShapeArrange.menu.on("item:click",_.bind(this.onShapeArrange,this)),e.btnInsertHyperlink.on("click",_.bind(this.onHyperlinkClick,this)),e.mnuTablePicker.on("select",_.bind(this.onTablePickerSelect,this)),e.btnInsertTable.menu.on("item:click",_.bind(this.onInsertTableClick,this)),e.btnInsertImage.menu.on("item:click",_.bind(this.onInsertImageClick,this)),e.btnInsertText.on("click",_.bind(this.onBtnInsertTextClick,this)),e.btnInsertText.menu.on("item:click",_.bind(this.onInsertTextClick,this)),e.btnInsertShape.menu.on("hide:after",_.bind(this.onInsertShapeHide,this)),e.btnClearStyle.on("click",_.bind(this.onClearStyleClick,this)),e.btnCopyStyle.on("toggle",_.bind(this.onCopyStyleToggle,this)),e.btnAdvSettings.on("click",_.bind(this.onAdvSettingsClick,this)),e.btnColorSchemas.menu.on("item:click",_.bind(this.onColorSchemaClick,this)),e.btnSlideSize.menu.on("item:click",_.bind(this.onSlideSize,this)),e.mnuInsertChartPicker.on("item:click",_.bind(this.onSelectChart,this)),e.listTheme.on("click",_.bind(this.onListThemeSelect,this)),e.mnuitemHideTitleBar.on("toggle",_.bind(this.onHideTitleBar,this)),e.mnuitemHideStatusBar.on("toggle",_.bind(this.onHideStatusBar,this)),e.mnuitemHideRulers.on("toggle",_.bind(this.onHideRulers,this)),e.btnFitPage.on("toggle",_.bind(this.onZoomToPageToggle,this)),e.btnFitWidth.on("toggle",_.bind(this.onZoomToWidthToggle,this)),e.mnuZoomIn.on("click",_.bind(this.onZoomInClick,this)),e.mnuZoomOut.on("click",_.bind(this.onZoomOutClick,this)),e.btnInsertEquation.on("click",_.bind(this.onInsertEquationClick,this))},setApi:function(e){this.api=e,this.toolbar.setApi(e),this.api.asc_registerCallback("asc_onFontSize",_.bind(this.onApiFontSize,this)),this.api.asc_registerCallback("asc_onBold",_.bind(this.onApiBold,this)),this.api.asc_registerCallback("asc_onItalic",_.bind(this.onApiItalic,this)),this.api.asc_registerCallback("asc_onUnderline",_.bind(this.onApiUnderline,this)),this.api.asc_registerCallback("asc_onStrikeout",_.bind(this.onApiStrikeout,this)),this.api.asc_registerCallback("asc_onVerticalAlign",_.bind(this.onApiVerticalAlign,this)),this.api.asc_registerCallback("asc_onCanUndo",_.bind(this.onApiCanRevert,this,"undo")),this.api.asc_registerCallback("asc_onCanRedo",_.bind(this.onApiCanRevert,this,"redo")),this.api.asc_registerCallback("asc_onPaintFormatChanged",_.bind(this.onApiStyleChange,this)),this.api.asc_registerCallback("asc_onListType",_.bind(this.onApiBullets,this)),this.api.asc_registerCallback("asc_canIncreaseIndent",_.bind(this.onApiCanIncreaseIndent,this)),this.api.asc_registerCallback("asc_canDecreaseIndent",_.bind(this.onApiCanDecreaseIndent,this)),this.api.asc_registerCallback("asc_onLineSpacing",_.bind(this.onApiLineSpacing,this)),this.api.asc_registerCallback("asc_onPrAlign",_.bind(this.onApiParagraphAlign,this)),this.api.asc_registerCallback("asc_onVerticalTextAlign",_.bind(this.onApiVerticalTextAlign,this)),this.api.asc_registerCallback("asc_onCanAddHyperlink",_.bind(this.onApiCanAddHyperlink,this)),this.api.asc_registerCallback("asc_onTextColor",_.bind(this.onApiTextColor,this)),this.api.asc_registerCallback("asc_onUpdateThemeIndex",_.bind(this.onApiUpdateThemeIndex,this)),this.api.asc_registerCallback("asc_onEndAddShape",_.bind(this.onApiEndAddShape,this)),this.api.asc_registerCallback("asc_onCanGroup",_.bind(this.onApiCanGroup,this)),this.api.asc_registerCallback("asc_onCanUnGroup",_.bind(this.onApiCanUnGroup,this)),this.api.asc_registerCallback("asc_onPresentationSize",_.bind(this.onApiPageSize,this)),this.api.asc_registerCallback("asc_onCoAuthoringDisconnect",_.bind(this.onApiCoAuthoringDisconnect,this,!0)),Common.NotificationCenter.on("api:disconnect",_.bind(this.onApiCoAuthoringDisconnect,this)),this.api.asc_registerCallback("asc_onZoomChange",_.bind(this.onApiZoomChange,this)),this.api.asc_registerCallback("asc_onFocusObject",_.bind(this.onApiFocusObject,this)),this.api.asc_registerCallback("asc_onLockDocumentProps",_.bind(this.onApiLockDocumentProps,this)),this.api.asc_registerCallback("asc_onUnLockDocumentProps",_.bind(this.onApiUnLockDocumentProps,this)),this.api.asc_registerCallback("asc_onLockDocumentTheme",_.bind(this.onApiLockDocumentTheme,this)),this.api.asc_registerCallback("asc_onUnLockDocumentTheme",_.bind(this.onApiUnLockDocumentTheme,this)),this.api.asc_registerCallback("asc_onInitEditorStyles",_.bind(this.onApiInitEditorStyles,this)),this.api.asc_registerCallback("asc_onCountPages",_.bind(this.onApiCountPages,this)),this.api.asc_registerCallback("asc_onMathTypes",_.bind(this.onMathTypes,this)),this.onSetupCopyStyleButton()},onChangeCompactView:function(e,t){Common.localStorage.setItem("pe-compact-toolbar",t?1:0),!t&&!this._state.changeslide_inited&&this.toolbar.mnuChangeSlidePicker.on("item:click",_.bind(this.onChangeSlide,this)),this._state.changeslide_inited=!0,Common.NotificationCenter.trigger("layout:changed","toolbar"),Common.NotificationCenter.trigger("edit:complete",this.toolbar)},onApiFontSize:function(e){this._state.fontsize!==e&&(this.toolbar.cmbFontSize.setValue(e),this._state.fontsize=e)},onApiBold:function(e){this._state.bold!==e&&(this.toolbar.btnBold.toggle(e===!0,!0),this._state.bold=e)},onApiItalic:function(e){this._state.italic!==e&&(this.toolbar.btnItalic.toggle(e===!0,!0),this._state.italic=e)},onApiUnderline:function(e){this._state.underline!==e&&(this.toolbar.btnUnderline.toggle(e===!0,!0),this._state.underline=e)},onApiStrikeout:function(e){this._state.strike!==e&&(this.toolbar.btnStrikeout.toggle(e===!0,!0),this._state.strike=e)},onApiVerticalAlign:function(e){this._state.valign!==e&&(this.toolbar.btnSuperscript.toggle(e==1,!0),this.toolbar.btnSubscript.toggle(e==2,!0),this._state.valign=e)},onApiCanRevert:function(e,t){e=="undo"?this._state.can_undo!==t&&(this.toolbar.lockToolbar(PE.enumLock.undoLock,!t,{array:[this.toolbar.btnUndo]}),this._state.activated&&(this._state.can_undo=t)):this._state.can_redo!==t&&(this.toolbar.lockToolbar(PE.enumLock.redoLock,!t,{array:[this.toolbar.btnRedo]}),this._state.activated&&(this._state.can_redo=t))},onApiCanIncreaseIndent:function(e){this._state.can_increase!==e&&(this.toolbar.lockToolbar(PE.enumLock.incIndentLock,!e,{array:[this.toolbar.btnIncLeftOffset]}),this._state.activated&&(this._state.can_increase=e))},onApiCanDecreaseIndent:function(e){this._state.can_decrease!==e&&(this.toolbar.lockToolbar(PE.enumLock.decIndentLock,!e,{array:[this.toolbar.btnDecLeftOffset]}),this._state.activated&&(this._state.can_decrease=e))},onApiBullets:function(e){if(this._state.bullets.type!=e.get_ListType()||this._state.bullets.subtype!=e.get_ListSubType()){this._state.bullets.type=e.get_ListType(),this._state.bullets.subtype=e.get_ListSubType(),this._clearBullets();switch(this._state.bullets.type){case 0:this.toolbar.btnMarkers.toggle(!0,!0),this.toolbar.mnuMarkersPicker.selectByIndex(this._state.bullets.subtype,!0);break;case 1:var t=0;switch(this._state.bullets.subtype){case 1:t=4;break;case 2:t=5;break;case 3:t=6;break;case 4:t=1;break;case 5:t=2;break;case 6:t=3;break;case 7:t=7}this.toolbar.btnNumbers.toggle(!0,!0),this.toolbar.mnuNumbersPicker.selectByIndex(t,!0)}}},onApiParagraphAlign:function(e){if(this._state.pralign!==e){this._state.pralign=e;var t=-1,n,r=this.toolbar.btnHorizontalAlign;switch(e){case 0:t=2,n="btn-align-right";break;case 1:t=0,n="btn-align-left";break;case 2:t=1,n="btn-align-center";break;case 3:t=3,n="btn-align-just";break;default:t=-255,n="btn-align-left"}t<0?t==-255&&this._clearChecked(r.menu):r.menu.items[t].setChecked(!0);if(r.rendered){var i=$(".btn-icon",r.cmpEl);i&&(i.removeClass(r.options.icls),r.options.icls=n,i.addClass(r.options.icls))}}},onApiVerticalTextAlign:function(e){if(this._state.vtextalign!==e){this._state.vtextalign=e;var t=-1,n="",r=this.toolbar.btnVerticalAlign;switch(e){case Asc.c_oAscVAlign.Top:t=0,n="btn-align-top";break;case Asc.c_oAscVAlign.Center:t=1,n="btn-align-middle";break;case Asc.c_oAscVAlign.Bottom:t=2,n="btn-align-bottom";break;default:t=-255,n="btn-align-middle"}t<0?t==-255&&this._clearChecked(r.menu):r.menu.items[t].setChecked(!0);if(r.rendered){var i=$(".btn-icon",r.cmpEl);i&&(i.removeClass(r.options.icls),r.options.icls=n,i.addClass(r.options.icls))}}},onApiLineSpacing:function(e){var t=e.get_Line()===null||e.get_LineRule()===null||e.get_LineRule()!=1?-1:e.get_Line();if(this._state.linespace!==t){this._state.linespace=t;var n=this.toolbar.btnLineSpace.menu;_.each(n.items,function(e){e.setChecked(!1,!0)});if(t<0)return;Math.abs(t-1)<1e-4?n.items[0].setChecked(!0,!0):Math.abs(t-1.15)<1e-4?n.items[1].setChecked(!0,!0):Math.abs(t-1.5)<1e-4?n.items[2].setChecked(!0,!0):Math.abs(t-2)<1e-4?n.items[3].setChecked(!0,!0):Math.abs(t-2.5)<1e-4?n.items[4].setChecked(!0,!0):Math.abs(t-3)<1e-4&&n.items[5].setChecked(!0,!0)}},onApiCanAddHyperlink:function(e){this._state.can_hyper!==e&&this.editMode&&(this.toolbar.lockToolbar(PE.enumLock.hyperlinkLock,!e,{array:[this.toolbar.btnInsertHyperlink]}),this._state.activated&&(this._state.can_hyper=e))},onApiPageSize:function(e,t){if(Math.abs(this.currentPageSize.width-e)>.001||Math.abs(this.currentPageSize.height-t)>.001){this.currentPageSize.width=e,this.currentPageSize.height=t,this.currentPageSize.type=-1;var n=t>e;for(var r=0;r0?e:undefined,t.menuPicker.selectRecord(r),t.resumeEvents()}}},onApiCanGroup:function(e){this._state.can_group!==e&&(this.toolbar.mnuGroupShapes.setDisabled(!e),this._state.activated&&(this._state.can_group=e))},onApiCanUnGroup:function(e){this._state.can_ungroup!==e&&(this.toolbar.mnuUnGroupShapes.setDisabled(!e),this._state.activated&&(this._state.can_ungroup=e))},onApiLockDocumentProps:function(){this._state.lock_doc!==!0&&(this.toolbar.lockToolbar(PE.enumLock.docPropsLock,!0,{array:[this.toolbar.btnSlideSize]}),this._state.activated&&(this._state.lock_doc=!0))},onApiUnLockDocumentProps:function(){this._state.lock_doc!==!1&&(this.toolbar.lockToolbar(PE.enumLock.docPropsLock,!1,{array:[this.toolbar.btnSlideSize]}),this._state.activated&&(this._state.lock_doc=!1))},onApiLockDocumentTheme:function(){this.toolbar.lockToolbar(PE.enumLock.themeLock,!0,{array:[this.toolbar.btnColorSchemas,this.toolbar.listTheme]})},onApiUnLockDocumentTheme:function(){this.toolbar.lockToolbar(PE.enumLock.themeLock,!1,{array:[this.toolbar.btnColorSchemas,this.toolbar.listTheme]})},onApiCoAuthoringDisconnect:function(e){this.toolbar.setMode({isDisconnected:!0,disableDownload:!!e}),this.editMode=!1},onApiZoomChange:function(e,t){this._state.zoom_type!==t&&(this.toolbar.btnFitPage.setChecked(t==2,!0),this.toolbar.btnFitWidth.setChecked(t==1,!0),this._state.zoom_type=t),this._state.zoom_percent!==e&&($(".menu-zoom .zoom",this.toolbar.el).html(e+"%"),this._state.zoom_percent=e),this.toolbar.mnuZoom.options.value=e},onApiInitEditorStyles:function(e){e&&this._onInitEditorThemes(e[0],e[1])},onNewDocument:function(e,t){this.api&&this.api.OpenNewDocument(),Common.NotificationCenter.trigger("edit:complete",this.toolbar),Common.component.Analytics.trackEvent("ToolBar","New Document")},onOpenDocument:function(e,t){this.api&&this.api.LoadDocumentFromDisk(),Common.NotificationCenter.trigger("edit:complete",this.toolbar),Common.component.Analytics.trackEvent("ToolBar","Open Document")},onAddSlide:function(e,t,n){this.api&&(this.api.AddSlide(n.get("data").idx),Common.NotificationCenter.trigger("edit:complete",this.toolbar),Common.component.Analytics.trackEvent("ToolBar","Add Slide"))},onBtnAddSlide:function(){this.api.AddSlide(),Common.NotificationCenter.trigger("edit:complete",this.toolbar),Common.component.Analytics.trackEvent("ToolBar","Add Slide")},onChangeSlide:function(e,t,n){this.api&&(this.api.ChangeLayout(n.get("data").idx),Common.NotificationCenter.trigger("edit:complete",this.toolbar),Common.component.Analytics.trackEvent("ToolBar","Change Layout"))},onPreview:function(e){var t=PE.getController("Viewport").getView("DocumentPreview"),n=this,r=!1;if(t&&n.api){t.show();var i=function(){if(r)return;r=!0,Common.NotificationCenter.off("window:resize",i),n.api.StartDemonstration("presentation-preview",_.isNumber(e)?e:0),Common.component.Analytics.trackEvent("ToolBar","Preview")};!n.toolbar.mode.isDesktopApp&&!Common.Utils.isIE11?(Common.NotificationCenter.on("window:resize",i),n.fullScreen(document.documentElement),setTimeout(function(){i()},100)):i()}},fullScreen:function(e){e&&(e.requestFullscreen?e.requestFullscreen():e.webkitRequestFullscreen?e.webkitRequestFullscreen():e.mozRequestFullScreen?e.mozRequestFullScreen():e.msRequestFullscreen&&e.msRequestFullscreen())},onPreviewBtnClick:function(e,t){this.onPreview(this.api.getCurrentPage())},onPreviewItemClick:function(e,t){switch(t.value){case 0:this.onPreview(0);break;case 1:this.onPreview(this.api.getCurrentPage());break;case 2:var n,r=this,i=r.api.getSelectedElements(),s=!1;if(i&&_.isArray(i))for(var o=0;o300?300:i<1?1:Math.floor((i+.4)*2)/2,t.setRawValue(i),this._state.fontsize=undefined,this.api&&this.api.put_TextPrFontSize(i),Common.NotificationCenter.trigger("edit:complete",this.toolbar)},onSelectBullets:function(e,t,n,r){var i={},s=_.isFunction(r.toJSON);if(s){if(!r.get("selected"))return;i=r.toJSON()}else i=r;e&&e.toggle(i.data.subtype>-1,!0),this.api&&this.api.put_ListType(i.data.type,i.data.subtype),Common.NotificationCenter.trigger("edit:complete",this.toolbar),Common.component.Analytics.trackEvent("ToolBar","List Type")},onLineSpaceToggle:function(e,t,n,r){!n||(this._state.linespace=undefined,this.api&&this.api.put_PrLineSpacing(c_paragraphLinerule.LINERULE_AUTO,t.value),Common.NotificationCenter.trigger("edit:complete",this.toolbar),Common.component.Analytics.trackEvent("ToolBar","Line Spacing"))},onShapeAlign:function(e,t){this.api&&(t.value<6?(this.api.put_ShapesAlign(t.value),Common.component.Analytics.trackEvent("ToolBar","Shape Align")):t.value==6?(this.api.DistributeHorizontally(),Common.component.Analytics.trackEvent("ToolBar","Distribute")):(this.api.DistributeVertically(),Common.component.Analytics.trackEvent("ToolBar","Distribute")),Common.NotificationCenter.trigger("edit:complete",this.toolbar))},onShapeArrange:function(e,t){if(this.api){switch(t.value){case 1:this.api.shapes_bringToFront(),Common.component.Analytics.trackEvent("ToolBar","Shape Arrange");break;case 2:this.api.shapes_bringToBack(),Common.component.Analytics.trackEvent("ToolBar","Shape Arrange");break;case 3:this.api.shapes_bringForward(),Common.component.Analytics.trackEvent("ToolBar","Shape Arrange");break;case 4:this.api.shapes_bringBackward(),Common.component.Analytics.trackEvent("ToolBar","Shape Arrange");break;case 5:this.api.groupShapes(),Common.component.Analytics.trackEvent("ToolBar","Shape Group");break;case 6:this.api.unGroupShapes(),Common.component.Analytics.trackEvent("ToolBar","Shape UnGroup")}Common.NotificationCenter.trigger("edit:complete",this.toolbar)}},onHyperlinkClick:function(e){var t=this,n,r,i;if(t.api){var s=function(e,n){n=="ok"&&(r=e.getSettings(),i!==!1?t.api.add_Hyperlink(r):t.api.change_Hyperlink(r)),Common.NotificationCenter.trigger("edit:complete",t.toolbar)};i=t.api.can_AddHyperlink();if(i!==!1){var o=[];for(var u=0;uthis.currentPageSize.width;this.currentPageSize={type:t.value,width:this.slideSizeArr[t.value][n?1:0],height:this.slideSizeArr[t.value][n?0:1]},this.api&&this.api.changeSlideSize(this.slideSizeArr[t.value][n?1:0],this.slideSizeArr[t.value][n?0:1]),Common.NotificationCenter.trigger("edit:complete",this.toolbar),Common.component.Analytics.trackEvent("ToolBar","Slide Size")}else{var r,i,s=this,o=function(e,t){t=="ok"&&(i=e.getSettings(),s.currentPageSize={type:i[0],width:i[1],height:i[2]},s.toolbar.btnSlideSize.menu.items[0].setChecked(i[0]==0),s.toolbar.btnSlideSize.menu.items[1].setChecked(i[0]==1),s.api&&s.api.changeSlideSize(i[1],i[2])),Common.NotificationCenter.trigger("edit:complete",s.toolbar)};r=new PE.Views.SlideSizeSettings({handler:o}),r.show(),r.setSettings(s.currentPageSize.type,s.currentPageSize.width,s.currentPageSize.height),Common.component.Analytics.trackEvent("ToolBar","Slide Size")}},onSelectChart:function(e,t,n){var r=this,i=n.get("type"),s=!1,o=r.api.getSelectedElements();if(o&&_.isArray(o))for(var u=0;u
    ')}]})});e.toolbar.btnInsertShape.menu.addItem(i);var s=new Common.UI.DataView({el:$("#id-toolbar-menu-shapegroup"+n),store:r.get("groupStore"),parentMenu:i.menu,showLast:!1,itemTemplate:_.template('
    ')});s.on("item:click",function(t,n,r,i){e.api&&(e._addAutoshape(!0,r.get("data").shapeType),e._isAddingShape=!0,e.toolbar.btnInsertText.pressed&&e.toolbar.btnInsertText.toggle(!1,!0),i.type!=="click"&&e.toolbar.btnInsertShape.menu.hide(),Common.NotificationCenter.trigger("edit:complete",e.toolbar,e.toolbar.btnInsertShape),Common.component.Analytics.trackEvent("ToolBar","Add Shape"))})}},fillTextArt:function(){var e=this;if(this.toolbar.mnuTextArtPicker){var t=this.getApplication().getCollection("Common.Collections.TextArt").models,n=this.toolbar.mnuTextArtPicker.store.length;if(n>0&&n==t.length){var r=this.toolbar.mnuTextArtPicker.store.models;_.each(t,function(e,t){r[t].set("imageUrl",e.get("imageUrl"))})}else this.toolbar.mnuTextArtPicker.store.reset(t)}else this.toolbar.mnuTextArtPicker=new Common.UI.DataView({el:$("#id-toolbar-menu-insart"),store:this.getApplication().getCollection("Common.Collections.TextArt"),parentMenu:this.toolbar.mnuInsertTextArt.menu,showLast:!1,itemTemplate:_.template('
    ')}),this.toolbar.mnuTextArtPicker.on("item:click",function(t,n,r,i){e.api&&(e.toolbar.fireEvent("inserttextart",e.toolbar),e.api.AddTextArt(r.get("data")),e.toolbar.btnInsertShape.pressed&&e.toolbar.btnInsertShape.toggle(!1,!0),i.type!=="click"&&e.toolbar.btnInsertText.menu.hide(),Common.NotificationCenter.trigger("edit:complete",e.toolbar,e.toolbar.btnInsertText),Common.component.Analytics.trackEvent("ToolBar","Add Text Art"))})},fillEquations:function(){if(!this.toolbar.btnInsertEquation.rendered||this.toolbar.btnInsertEquation.menu.items.length>0)return;var e=this,t=this.getApplication().getCollection("EquationGroups");e.equationPickers=[],e.toolbar.btnInsertEquation.menu.removeAll();for(var n=0;n
    ')}]})});e.toolbar.btnInsertEquation.menu.addItem(i);var s=new Common.UI.DataView({el:$("#id-toolbar-menu-equationgroup"+n),store:r.get("groupStore"),parentMenu:i.menu,showLast:!1,itemTemplate:_.template('
    ')});r.get("groupHeight").length&&(e.equationPickers.push(s),e.toolbar.btnInsertEquation.menu.on("show:after",function(){if(e.equationPickers.length){var t=$(this.el).find(".over").find(".menu-shape");if(t.length)for(var n=0;n0&&n.toolbar.listTheme.rendered&&(n.toolbar.listTheme.fillComboView(n.toolbar.listTheme.menuPicker.store.at(0),!0),Common.NotificationCenter.trigger("edit:complete",this)),window.styles_loaded=!0},onHideMenus:function(e){Common.NotificationCenter.trigger("edit:complete",this.toolbar)},onSetupCopyStyleButton:function(){this.modeAlwaysSetStyle=!1;var e={kOff:0,kOn:1,kMultiple:2},t=this;Common.NotificationCenter.on({"edit:complete":function(){t.api&&t.modeAlwaysSetStyle&&(t.api.SetPaintFormat(e.kOff),t.toolbar.btnCopyStyle.toggle(!1,!0),t.modeAlwaysSetStyle=!1)}}),$(t.toolbar.btnCopyStyle.cmpEl).dblclick(function(){t.api&&(t.modeAlwaysSetStyle=!0,t.toolbar.btnCopyStyle.toggle(!0,!0),t.api.SetPaintFormat(e.kMultiple))})},activateControls:function(){this.onApiPageSize(this.api.get_PresentationWidth(),this.api.get_PresentationHeight()),this.toolbar.lockToolbar(PE.enumLock.disableOnStart,!1,{array:this.toolbar.slideOnlyControls.concat(this.toolbar.shapeControls)}),this._state.activated=!0},DisableToolbar:function(e){var t=$(".toolbar-mask");if(e&&t.length>0||!e&&t.length==0)return;var n=this.toolbar;n.$el.find(".toolbar").toggleClass("masked",e),this.toolbar.lockToolbar(PE.enumLock.menuFileOpen,e,{array:[n.btnAddSlide,n.btnChangeSlide,n.btnPreview,n.btnHide]});if(e){t=$("
    ").appendTo(n.$el);var r=n.isCompactView?150:n.mode.nativeApp?190:145;t.css("left",r+"px"),t.css("right",(n.isCompactView?0:45)+"px"),Common.util.Shortcuts.suspendEvents("command+k, ctrl+k, alt+h, command+f5, ctrl+f5")}else t.remove(),Common.util.Shortcuts.resumeEvents("command+k, ctrl+k, alt+h, command+f5, ctrl+f5")},createDelayedElements:function(){this.toolbar.createDelayedElements(),this.onToolbarAfterRender(this.toolbar)},textEmptyImgUrl:"You need to specify image URL.",textWarning:"Warning",textFontSizeErr:"The entered value must be more than 0",confirmAddFontName:"The font you are going to save is not available on the current device.
    The text style will be displayed using one of the device fonts, the saved font will be used when it is available.
    Do you want to continue?",textSymbols:"Symbols",textFraction:"Fraction",textScript:"Script",textRadical:"Radical",textIntegral:"Integral",textLargeOperator:"Large Operator",textBracket:"Bracket",textFunction:"Function",textAccent:"Accent",textLimitAndLog:"Limit And Log",textOperator:"Operator",textMatrix:"Matrix",txtSymbol_pm:"Plus Minus",txtSymbol_infinity:"Infinity",txtSymbol_equals:"Equal",txtSymbol_neq:"Not Equal To",txtSymbol_about:"Approximately",txtSymbol_times:"Multiplication Sign",txtSymbol_div:"Division Sign",txtSymbol_factorial:"Factorial",txtSymbol_propto:"Proportional To",txtSymbol_less:"Less Than",txtSymbol_ll:"Much Less Than",txtSymbol_greater:"Greater Than",txtSymbol_gg:"Much Greater Than",txtSymbol_leq:"Less Than or Equal To",txtSymbol_geq:"Greater Than or Equal To",txtSymbol_mp:"Minus Plus",txtSymbol_cong:"Approximately Equal To",txtSymbol_approx:"Almost Equal To",txtSymbol_equiv:"Identical To",txtSymbol_forall:"For All",txtSymbol_additional:"Complement",txtSymbol_partial:"Partial Differential",txtSymbol_sqrt:"Radical Sign",txtSymbol_cbrt:"Cube Root",txtSymbol_qdrt:"Fourth Root",txtSymbol_cup:"Union",txtSymbol_cap:"Intersection",txtSymbol_emptyset:"Empty Set",txtSymbol_percent:"Percentage",txtSymbol_degree:"Degrees",txtSymbol_fahrenheit:"Degrees Fahrenheit",txtSymbol_celsius:"Degrees Celsius",txtSymbol_inc:"Increment",txtSymbol_nabla:"Nabla",txtSymbol_exists:"There Exist",txtSymbol_notexists:"There Does Not Exist",txtSymbol_in:"Element Of",txtSymbol_ni:"Contains as Member",txtSymbol_leftarrow:"Left Arrow",txtSymbol_uparrow:"Up Arrow",txtSymbol_rightarrow:"Right Arrow",txtSymbol_downarrow:"Down Arrow",txtSymbol_leftrightarrow:"Left-Right Arrow",txtSymbol_therefore:"Therefore",txtSymbol_plus:"Plus",txtSymbol_minus:"Minus",txtSymbol_not:"Not Sign",txtSymbol_ast:"Asterisk Operator",txtSymbol_bullet:"Bulet Operator",txtSymbol_vdots:"Vertical Ellipsis",txtSymbol_cdots:"Midline Horizontal Ellipsis",txtSymbol_rddots:"Up Right Diagonal Ellipsis",txtSymbol_ddots:"Down Right Diagonal Ellipsis",txtSymbol_aleph:"Alef",txtSymbol_beth:"Bet",txtSymbol_qed:"End of Proof",txtSymbol_alpha:"Alpha",txtSymbol_beta:"Beta",txtSymbol_gamma:"Gamma",txtSymbol_delta:"Delta",txtSymbol_varepsilon:"Epsilon Variant",txtSymbol_epsilon:"Epsilon",txtSymbol_zeta:"Zeta",txtSymbol_eta:"Eta",txtSymbol_theta:"Theta",txtSymbol_vartheta:"Theta Variant",txtSymbol_iota:"Iota",txtSymbol_kappa:"Kappa",txtSymbol_lambda:"Lambda",txtSymbol_mu:"Mu",txtSymbol_nu:"Nu",txtSymbol_xsi:"Xi",txtSymbol_o:"Omicron",txtSymbol_pi:"Pi",txtSymbol_varpi:"Pi Variant",txtSymbol_rho:"Rho",txtSymbol_varrho:"Rho Variant",txtSymbol_sigma:"Sigma",txtSymbol_varsigma:"Sigma Variant",txtSymbol_tau:"Tau",txtSymbol_upsilon:"Upsilon",txtSymbol_varphi:"Phi Variant",txtSymbol_phi:"Phi",txtSymbol_chi:"Chi",txtSymbol_psi:"Psi",txtSymbol_omega:"Omega",txtFractionVertical:"Stacked Fraction",txtFractionDiagonal:"Skewed Fraction",txtFractionHorizontal:"Linear Fraction",txtFractionSmall:"Small Fraction",txtFractionDifferential_1:"Differential",txtFractionDifferential_2:"Differential",txtFractionDifferential_3:"Differential",txtFractionDifferential_4:"Differential",txtFractionPi_2:"Pi Over 2",txtScriptSup:"Superscript",txtScriptSub:"Subscript",txtScriptSubSup:"Subscript-Superscript",txtScriptSubSupLeft:"Left Subscript-Superscript",txtScriptCustom_1:"Script",txtScriptCustom_2:"Script",txtScriptCustom_3:"Script",txtScriptCustom_4:"Script",txtRadicalSqrt:"Square Root",txtRadicalRoot_n:"Radical With Degree",txtRadicalRoot_2:"Square Root With Degree",txtRadicalRoot_3:"Cubic Root",txtRadicalCustom_1:"Radical",txtRadicalCustom_2:"Radical",txtIntegral:"Integral",txtIntegralSubSup:"Integral",txtIntegralCenterSubSup:"Integral",txtIntegralDouble:"Double Integral",txtIntegralDoubleSubSup:"Double Integral",txtIntegralDoubleCenterSubSup:"Double Integral",txtIntegralTriple:"Triple Integral",txtIntegralTripleSubSup:"Triple Integral",txtIntegralTripleCenterSubSup:"Triple Integral",txtIntegralOriented:"Contour Integral",txtIntegralOrientedSubSup:"Contour Integral",txtIntegralOrientedCenterSubSup:"Contour Integral",txtIntegralOrientedDouble:"Surface Integral",txtIntegralOrientedDoubleSubSup:"Surface Integral",txtIntegralOrientedDoubleCenterSubSup:"Surface Integral",txtIntegralOrientedTriple:"Volume Integral",txtIntegralOrientedTripleSubSup:"Volume Integral",txtIntegralOrientedTripleCenterSubSup:"Volume Integral",txtIntegral_dx:"Differential x",txtIntegral_dy:"Differential y",txtIntegral_dtheta:"Differential theta",txtLargeOperator_Sum:"Summation",txtLargeOperator_Sum_CenterSubSup:"Summation",txtLargeOperator_Sum_SubSup:"Summation",txtLargeOperator_Sum_CenterSub:"Summation",txtLargeOperator_Sum_Sub:"Summation",txtLargeOperator_Prod:"Product",txtLargeOperator_Prod_CenterSubSup:"Product",txtLargeOperator_Prod_SubSup:"Product",txtLargeOperator_Prod_CenterSub:"Product",txtLargeOperator_Prod_Sub:"Product",txtLargeOperator_CoProd:"Co-Product",txtLargeOperator_CoProd_CenterSubSup:"Co-Product",txtLargeOperator_CoProd_SubSup:"Co-Product",txtLargeOperator_CoProd_CenterSub:"Co-Product",txtLargeOperator_CoProd_Sub:"Co-Product",txtLargeOperator_Union:"Union",txtLargeOperator_Union_CenterSubSup:"Union",txtLargeOperator_Union_SubSup:"Union",txtLargeOperator_Union_CenterSub:"Union",txtLargeOperator_Union_Sub:"Union",txtLargeOperator_Intersection:"Intersection",txtLargeOperator_Intersection_CenterSubSup:"Intersection",txtLargeOperator_Intersection_SubSup:"Intersection",txtLargeOperator_Intersection_CenterSub:"Intersection",txtLargeOperator_Intersection_Sub:"Intersection",txtLargeOperator_Disjunction:"Vee",txtLargeOperator_Disjunction_CenterSubSup:"Vee",txtLargeOperator_Disjunction_SubSup:"Vee",txtLargeOperator_Disjunction_CenterSub:"Vee",txtLargeOperator_Disjunction_Sub:"Vee",txtLargeOperator_Conjunction:"Wedge",txtLargeOperator_Conjunction_CenterSubSup:"Wedge",txtLargeOperator_Conjunction_SubSup:"Wedge",txtLargeOperator_Conjunction_CenterSub:"Wedge",txtLargeOperator_Conjunction_Sub:"Wedge",txtLargeOperator_Custom_1:"Summation",txtLargeOperator_Custom_2:"Summation",txtLargeOperator_Custom_3:"Summation",txtLargeOperator_Custom_4:"Product",txtLargeOperator_Custom_5:"Union",txtBracket_Round:"Brackets",txtBracket_Square:"Brackets",txtBracket_Curve:"Brackets",txtBracket_Angle:"Brackets",txtBracket_LowLim:"Brackets",txtBracket_UppLim:"Brackets",txtBracket_Line:"Brackets",txtBracket_LineDouble:"Brackets",txtBracket_Square_OpenOpen:"Brackets",txtBracket_Square_CloseClose:"Brackets",txtBracket_Square_CloseOpen:"Brackets",txtBracket_SquareDouble:"Brackets",txtBracket_Round_Delimiter_2:"Brackets with Separators",txtBracket_Curve_Delimiter_2:"Brackets with Separators",txtBracket_Angle_Delimiter_2:"Brackets with Separators",txtBracket_Angle_Delimiter_3:"Brackets with Separators",txtBracket_Round_OpenNone:"Single Bracket",txtBracket_Round_NoneOpen:"Single Bracket",txtBracket_Square_OpenNone:"Single Bracket",txtBracket_Square_NoneOpen:"Single Bracket",txtBracket_Curve_OpenNone:"Single Bracket",txtBracket_Curve_NoneOpen:"Single Bracket",txtBracket_Angle_OpenNone:"Single Bracket",txtBracket_Angle_NoneOpen:"Single Bracket",txtBracket_LowLim_OpenNone:"Single Bracket",txtBracket_LowLim_NoneNone:"Single Bracket",txtBracket_UppLim_OpenNone:"Single Bracket",txtBracket_UppLim_NoneOpen:"Single Bracket",txtBracket_Line_OpenNone:"Single Bracket",txtBracket_Line_NoneOpen:"Single Bracket",txtBracket_LineDouble_OpenNone:"Single Bracket",txtBracket_LineDouble_NoneOpen:"Single Bracket",txtBracket_SquareDouble_OpenNone:"Single Bracket",txtBracket_SquareDouble_NoneOpen:"Single Bracket",txtBracket_Custom_1:"Case (Two Conditions)",txtBracket_Custom_2:"Cases (Three Conditions)",txtBracket_Custom_3:"Stack Object",txtBracket_Custom_4:"Stack Object",txtBracket_Custom_5:"Cases Example",txtBracket_Custom_6:"Binomial Coefficient",txtBracket_Custom_7:"Binomial Coefficient",txtFunction_Sin:"Sine Function",txtFunction_Cos:"Cosine Function",txtFunction_Tan:"Tangent Function",txtFunction_Csc:"Cosecant Function",txtFunction_Sec:"Secant Function",txtFunction_Cot:"Cotangent Function",txtFunction_1_Sin:"Inverse Sine Function",txtFunction_1_Cos:"Inverse Cosine Function",txtFunction_1_Tan:"Inverse Tangent Function",txtFunction_1_Csc:"Inverse Cosecant Function",txtFunction_1_Sec:"Inverse Secant Function",txtFunction_1_Cot:"Inverse Cotangent Function",txtFunction_Sinh:"Hyperbolic Sine Function",txtFunction_Cosh:"Hyperbolic Cosine Function",txtFunction_Tanh:"Hyperbolic Tangent Function",txtFunction_Csch:"Hyperbolic Cosecant Function",txtFunction_Sech:"Hyperbolic Secant Function",txtFunction_Coth:"Hyperbolic Cotangent Function",txtFunction_1_Sinh:"Hyperbolic Inverse Sine Function",txtFunction_1_Cosh:"Hyperbolic Inverse Cosine Function",txtFunction_1_Tanh:"Hyperbolic Inverse Tangent Function",txtFunction_1_Csch:"Hyperbolic Inverse Cosecant Function",txtFunction_1_Sech:"Hyperbolic Inverse Secant Function",txtFunction_1_Coth:"Hyperbolic Inverse Cotangent Function",txtFunction_Custom_1:"Sine theta",txtFunction_Custom_2:"Cos 2x",txtFunction_Custom_3:"Tangent formula",txtAccent_Dot:"Dot",txtAccent_DDot:"Double Dot",txtAccent_DDDot:"Triple Dot",txtAccent_Hat:"Hat",txtAccent_Check:"Check",txtAccent_Accent:"Acute",txtAccent_Grave:"Grave",txtAccent_Smile:"Breve",txtAccent_Tilde:"Tilde",txtAccent_Bar:"Bar",txtAccent_DoubleBar:"Double Overbar",txtAccent_CurveBracketTop:"Overbrace",txtAccent_CurveBracketBot:"Underbrace",txtAccent_GroupTop:"Grouping Character Above",txtAccent_GroupBot:"Grouping Character Below",txtAccent_ArrowL:"Leftwards Arrow Above",txtAccent_ArrowR:"Rightwards Arrow Above",txtAccent_ArrowD:"Right-Left Arrow Above",txtAccent_HarpoonL:"Leftwards Harpoon Above",txtAccent_HarpoonR:"Rightwards Harpoon Above",txtAccent_BorderBox:"Boxed Formula (With Placeholder)",txtAccent_BorderBoxCustom:"Boxed Formula (Example)",txtAccent_BarTop:"Overbar",txtAccent_BarBot:"Underbar",txtAccent_Custom_1:"Vector A",txtAccent_Custom_2:"ABC With Overbar",txtAccent_Custom_3:"x XOR y With Overbar",txtLimitLog_LogBase:"Logarithm",txtLimitLog_Log:"Logarithm",txtLimitLog_Lim:"Limit",txtLimitLog_Min:"Minimum",txtLimitLog_Max:"Maximum",txtLimitLog_Ln:"Natural Logarithm",txtLimitLog_Custom_1:"Limit Example",txtLimitLog_Custom_2:"Maximum Example",txtOperator_ColonEquals:"Colon Equal",txtOperator_EqualsEquals:"Equal Equal",txtOperator_PlusEquals:"Plus Equal",txtOperator_MinusEquals:"Minus Equal",txtOperator_Definition:"Equal to By Definition",txtOperator_UnitOfMeasure:"Measured By",txtOperator_DeltaEquals:"Delta Equal To",txtOperator_ArrowL_Top:"Leftwards Arrow Above",txtOperator_ArrowR_Top:"Rightwards Arrow Above",txtOperator_ArrowL_Bot:"Leftwards Arrow Below",txtOperator_ArrowR_Bot:"Rightwards Arrow Below",txtOperator_DoubleArrowL_Top:"Leftwards Arrow Above",txtOperator_DoubleArrowR_Top:"Rightwards Arrow Above",txtOperator_DoubleArrowL_Bot:"Leftwards Arrow Below",txtOperator_DoubleArrowR_Bot:"Rightwards Arrow Below",txtOperator_ArrowD_Top:"Right-Left Arrow Above",txtOperator_ArrowD_Bot:"Right-Left Arrow Above",txtOperator_DoubleArrowD_Top:"Right-Left Arrow Below",txtOperator_DoubleArrowD_Bot:"Right-Left Arrow Below",txtOperator_Custom_1:"Yileds",txtOperator_Custom_2:"Delta Yields",txtMatrix_1_2:"1x2 Empty Matrix",txtMatrix_2_1:"2x1 Empty Matrix",txtMatrix_1_3:"1x3 Empty Matrix",txtMatrix_3_1:"3x1 Empty Matrix",txtMatrix_2_2:"2x2 Empty Matrix",txtMatrix_2_3:"2x3 Empty Matrix",txtMatrix_3_2:"3x2 Empty Matrix",txtMatrix_3_3:"3x3 Empty Matrix",txtMatrix_Dots_Center:"Midline Dots",txtMatrix_Dots_Baseline:"Baseline Dots",txtMatrix_Dots_Vertical:"Vertical Dots",txtMatrix_Dots_Diagonal:"Diagonal Dots",txtMatrix_Identity_2:"2x2 Identity Matrix",txtMatrix_Identity_2_NoZeros:"3x3 Identity Matrix",txtMatrix_Identity_3:"3x3 Identity Matrix",txtMatrix_Identity_3_NoZeros:"3x3 Identity Matrix",txtMatrix_2_2_RoundBracket:"Empty Matrix with Brackets",txtMatrix_2_2_SquareBracket:"Empty Matrix with Brackets",txtMatrix_2_2_LineBracket:"Empty Matrix with Brackets",txtMatrix_2_2_DLineBracket:"Empty Matrix with Brackets",txtMatrix_Flat_Round:"Sparse Matrix",txtMatrix_Flat_Square:"Sparse Matrix"},PE.Controllers.Toolbar||{}))}),define("text!presentationeditor/main/app/template/StatusBar.template",[],function(){return'\r\n
    \r\n
    \r\n \r\n \r\n \r\n
    \r\n \r\n ')}]})});e.btnChangeShape.menu.addItem(u);var a=new Common.UI.DataView({el:t("#id-shape-menu-shapegroup"+s),store:o.get("groupStore"),parentMenu:u.menu,showLast:!1,itemTemplate:n.template('
    ')});a.on("item:click",function(t,n,r,i){e.api&&(e.api.ChangeShapeType(r.get("data").shapeType),e.fireEvent("editcomplete",e)),i.type!=="click"&&e.btnChangeShape.menu.hide()})}},UpdateThemeColors:function(){this.btnBackColor||(this.btnBackColor=new Common.UI.ColorButton({style:"width:45px;",menu:new Common.UI.Menu({items:[{template:n.template('
    ')},{template:n.template(''+this.textNewColor+"")}]})}),this.btnBackColor.render(t("#shape-back-color-btn")),this.btnBackColor.setColor("transparent"),this.fillControls.push(this.btnBackColor),this.colorsBack=new Common.UI.ThemeColorPalette({el:t("#shape-back-color-menu"),value:"transparent",transparent:!0}),this.colorsBack.on("select",n.bind(this.onColorsBackSelect,this)),t(this.el).on("click","#shape-back-color-new",n.bind(this.addNewColor,this,this.colorsBack,this.btnBackColor)),this.btnFGColor=new Common.UI.ColorButton({style:"width:45px;",menu:new Common.UI.Menu({items:[{template:n.template('
    ')},{template:n.template(''+this.textNewColor+"")}]})}),this.btnFGColor.render(t("#shape-foreground-color-btn")),this.btnFGColor.setColor("000000"),this.fillControls.push(this.btnFGColor),this.colorsFG=new Common.UI.ThemeColorPalette({el:t("#shape-foreground-color-menu"),value:"000000"}),this.colorsFG.on("select",n.bind(this.onColorsFGSelect,this)),t(this.el).on("click","#shape-foreground-color-new",n.bind(this.addNewColor,this,this.colorsFG,this.btnFGColor)),this.btnBGColor=new Common.UI.ColorButton({style:"width:45px;",menu:new Common.UI.Menu({items:[{template:n.template('
    ')},{template:n.template(''+this.textNewColor+"")}]})}),this.btnBGColor.render(t("#shape-background-color-btn")),this.btnBGColor.setColor("ffffff"),this.fillControls.push(this.btnBGColor),this.colorsBG=new Common.UI.ThemeColorPalette({el:t("#shape-background-color-menu"),value:"ffffff"}),this.colorsBG.on("select",n.bind(this.onColorsBGSelect,this)),t(this.el).on("click","#shape-background-color-new",n.bind(this.addNewColor,this,this.colorsBG,this.btnBGColor)),this.btnGradColor=new Common.UI.ColorButton({style:"width:45px;",menu:new Common.UI.Menu({items:[{template:n.template('
    ')},{template:n.template(''+this.textNewColor+"")}]})}),this.btnGradColor.render(t("#shape-gradient-color-btn")),this.btnGradColor.setColor("000000"),this.fillControls.push(this.btnGradColor),this.colorsGrad=new Common.UI.ThemeColorPalette({el:t("#shape-gradient-color-menu"),value:"000000"}),this.colorsGrad.on("select",n.bind(this.onColorsGradientSelect,this)),t(this.el).on("click","#shape-gradient-color-new",n.bind(this.addNewColor,this,this.colorsGrad,this.btnGradColor)),this.btnBorderColor=new Common.UI.ColorButton({style:"width:45px;",menu:new Common.UI.Menu({items:[{template:n.template('
    ')},{template:n.template(''+this.textNewColor+"")}]})}),this.btnBorderColor.render(t("#shape-border-color-btn")),this.btnBorderColor.setColor("000000"),this.lockedControls.push(this.btnBorderColor),this.colorsBorder=new Common.UI.ThemeColorPalette({el:t("#shape-border-color-menu"),value:"000000"}),this.colorsBorder.on("select",n.bind(this.onColorsBorderSelect,this)),t(this.el).on("click","#shape-border-color-new",n.bind(this.addNewColor,this,this.colorsBorder,this.btnBorderColor))),this.colorsBorder.updateColors(Common.Utils.ThemeColor.getEffectColors(),Common.Utils.ThemeColor.getStandartColors()),this.colorsBack.updateColors(Common.Utils.ThemeColor.getEffectColors(),Common.Utils.ThemeColor.getStandartColors()),this.colorsFG.updateColors(Common.Utils.ThemeColor.getEffectColors(),Common.Utils.ThemeColor.getStandartColors()),this.colorsBG.updateColors(Common.Utils.ThemeColor.getEffectColors(),Common.Utils.ThemeColor.getStandartColors()),this.colorsGrad.updateColors(Common.Utils.ThemeColor.getEffectColors(),Common.Utils.ThemeColor.getStandartColors())},_pt2mm:function(e){return e*25.4/72},_mm2pt:function(e){return e*72/25.4},disableFillPanels:function(e){this._state.DisabledFillPanels!==e&&(this._state.DisabledFillPanels=e,n.each(this.fillControls,function(t){t.setDisabled(e)}),this.lblTransparencyStart.toggleClass("disabled",e),this.lblTransparencyEnd.toggleClass("disabled",e))},ShowHideElem:function(e){this.FillColorContainer.toggleClass("settings-hidden",e!==Asc.c_oAscFill.FILL_TYPE_SOLID),this.FillImageContainer.toggleClass("settings-hidden",e!==Asc.c_oAscFill.FILL_TYPE_BLIP),this.FillPatternContainer.toggleClass("settings-hidden",e!==Asc.c_oAscFill.FILL_TYPE_PATT),this.FillGradientContainer.toggleClass("settings-hidden",e!==Asc.c_oAscFill.FILL_TYPE_GRAD),this.TransparencyContainer.toggleClass("settings-hidden",e===Asc.c_oAscFill.FILL_TYPE_NOFILL||e===null)},setLocked:function(e){this._locked=e},disableControls:function(e,t){if(this._initSettings)return;this.disableFillPanels(e||t),this._state.DisabledControls!==e&&(this._state.DisabledControls=e,n.each(this.lockedControls,function(t){t.setDisabled(e)}),this.linkAdvanced.toggleClass("disabled",e))},hideShapeOnlySettings:function(e){this._state.HideShapeOnlySettings!==e&&(this._state.HideShapeOnlySettings=e,this.ShapeOnlySettings.toggleClass("hidden",e==1))},hideChangeTypeSettings:function(e){this._state.HideChangeTypeSettings!==e&&(this._state.HideChangeTypeSettings=e,this.CanChangeType.toggleClass("hidden",e==1))},txtNoBorders:"No Line",strStroke:"Stroke",strColor:"Color",strSize:"Size",strChange:"Change Autoshape",strFill:"Fill",textColor:"Color Fill",textImageTexture:"Picture or Texture",textTexture:"From Texture",textFromUrl:"From URL",textFromFile:"From File",textStretch:"Stretch",textTile:"Tile",txtCanvas:"Canvas",txtCarton:"Carton",txtDarkFabric:"Dark Fabric",txtGrain:"Grain",txtGranite:"Granite",txtGreyPaper:"Grey Paper",txtKnit:"Knit",txtLeather:"Leather",txtBrownPaper:"Brown Paper",txtPapyrus:"Papyrus",txtWood:"Wood",textNewColor:"Add New Custom Color",textAdvanced:"Show advanced settings",strTransparency:"Opacity",textNoFill:"No Fill",textSelectTexture:"Select",textGradientFill:"Gradient Fill",textPatternFill:"Pattern",strBackground:"Background color",strForeground:"Foreground color",strPattern:"Pattern",textEmptyPattern:"No Pattern",textLinear:"Linear",textRadial:"Radial",textDirection:"Direction",textStyle:"Style",textGradient:"Gradient",textBorderSizeErr:"The entered value is incorrect.
    Please enter a value between 0 pt and 1584 pt.",strType:"Type"},PE.Views.ShapeSettings||{}))}),define("text!presentationeditor/main/app/template/SlideSettings.template",[],function(){return'\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
    \r\n \r\n
    \r\n
    \r\n
    \r\n
    \r\n
    \r\n
    \r\n
    \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
    \r\n \r\n \r\n \r\n
    \r\n
    \r\n
    \r\n
    \r\n
    \r\n
    \r\n
    \r\n \r\n
    \r\n
    \r\n
    \r\n
    \r\n \r\n
    \r\n
    \r\n \r\n
    \r\n
    \r\n
    \r\n \r\n
    \r\n
    \r\n
    \r\n
    \r\n
    \r\n
    \r\n \r\n
    \r\n
    \r\n
    \r\n \r\n
    \r\n
    \r\n
    \r\n \r\n
    \r\n
    \r\n
    \r\n
    \r\n
    \r\n
    \r\n \r\n
    \r\n
    \r\n
    \r\n
    \r\n
    \r\n
    \r\n \r\n
    \r\n
    \r\n \r\n
    \r\n
    \r\n
    \r\n
    \r\n
    \r\n
    \r\n
    \r\n
    \r\n
    \r\n
    \r\n
    \r\n
    \r\n \r\n
    '}),define("presentationeditor/main/app/view/SlideSettings",["text!presentationeditor/main/app/template/SlideSettings.template","jquery","underscore","backbone","common/main/lib/component/ComboBox","common/main/lib/component/MetricSpinner","common/main/lib/component/ThemeColorPalette","common/main/lib/component/ColorButton","common/main/lib/component/ComboDataView","common/main/lib/component/MultiSliderGradient","common/main/lib/view/ImageFromUrlDialog"],function(e,t,n,r){"use strict";PE.Views.SlideSettings=r.View.extend(n.extend({el:"#id-slide-settings",template:n.template(e),events:{},options:{alias:"SlideSettings"},initialize:function(){this._initSettings=!0,this._originalProps=null,this._noApply=!0,this._sendUndoPoint=!0,this._sliderChanged=!1,this.FillItems=[],this._stateDisabled={background:!0,effects:!0,timing:!0},this._state={FillType:undefined,SlideColor:"ffffff",BlipFillType:Asc.c_oAscFillBlipType.STRETCH,FGColor:"000000",BGColor:"ffffff",GradColor:"000000",GradFillType:Asc.c_oAscFillGradType.GRAD_LINEAR},this.OriginalFillType=undefined,this.SlideColor={Value:1,Color:"ffffff"},this.BlipFillType=Asc.c_oAscFillBlipType.STRETCH,this.Effect=Asc.c_oAscSlideTransitionTypes.None,this.EffectType=undefined,this.GradFillType=Asc.c_oAscFillGradType.GRAD_LINEAR,this.GradColor={values:[0,100],colors:["000000","ffffff"],currentIdx:0},this.GradRadialDirectionIdx=0,this.GradLinearDirectionType=0,this.PatternFillType=0,this.FGColor={Value:1,Color:"000000"},this.BGColor={Value:1,Color:"ffffff"},this.textureNames=[this.txtCanvas,this.txtCarton,this.txtDarkFabric,this.txtGrain,this.txtGranite,this.txtGreyPaper,this.txtKnit,this.txtLeather,this.txtBrownPaper,this.txtPapyrus,this.txtWood],this.render(),this._arrFillSrc=[{displayValue:this.textColor,value:Asc.c_oAscFill.FILL_TYPE_SOLID},{displayValue:this.textGradientFill,value:Asc.c_oAscFill.FILL_TYPE_GRAD},{displayValue:this.textImageTexture,value:Asc.c_oAscFill.FILL_TYPE_BLIP},{displayValue:this.textPatternFill,value:Asc.c_oAscFill.FILL_TYPE_PATT},{displayValue:this.textNoFill,value:Asc.c_oAscFill.FILL_TYPE_NOFILL}],this.cmbFillSrc=new Common.UI.ComboBox({el:t("#slide-combo-fill-src"),cls:"input-group-nr",style:"width: 100%;",menuStyle:"min-width: 190px;",editable:!1,data:this._arrFillSrc,disabled:!0}),this.cmbFillSrc.setValue(""),this.cmbFillSrc.on("selected",n.bind(this.onFillSrcSelect,this)),this.FillColorContainer=t("#slide-panel-color-fill"),this.FillImageContainer=t("#slide-panel-image-fill"),this.FillPatternContainer=t("#slide-panel-pattern-fill"),this.FillGradientContainer=t("#slide-panel-gradient-fill"),this._arrEffectName=[{displayValue:this.textNone,value:Asc.c_oAscSlideTransitionTypes.None},{displayValue:this.textFade,value:Asc.c_oAscSlideTransitionTypes.Fade},{displayValue:this.textPush,value:Asc.c_oAscSlideTransitionTypes.Push},{displayValue:this.textWipe,value:Asc.c_oAscSlideTransitionTypes.Wipe},{displayValue:this.textSplit,value:Asc.c_oAscSlideTransitionTypes.Split},{displayValue:this.textUnCover,value:Asc.c_oAscSlideTransitionTypes.UnCover},{displayValue:this.textCover,value:Asc.c_oAscSlideTransitionTypes.Cover},{displayValue:this.textClock,value:Asc.c_oAscSlideTransitionTypes.Clock},{displayValue:this.textZoom,value:Asc.c_oAscSlideTransitionTypes.Zoom}],this.cmbEffectName=new Common.UI.ComboBox({el:t("#slide-combo-effect-name"),cls:"input-group-nr",style:"width: 100%;",menuStyle:"min-width: 190px;",editable:!1,data:this._arrEffectName,disabled:!0}),this.cmbEffectName.setValue(""),this.cmbEffectName.on("selected",n.bind(this.onEffectNameSelect,this)),this._arrEffectType=[{displayValue:this.textSmoothly,value:Asc.c_oAscSlideTransitionParams.Fade_Smoothly},{displayValue:this.textBlack,value:Asc.c_oAscSlideTransitionParams.Fade_Through_Black},{displayValue:this.textLeft,value:Asc.c_oAscSlideTransitionParams.Param_Left},{displayValue:this.textTop,value:Asc.c_oAscSlideTransitionParams.Param_Top},{displayValue:this.textRight,value:Asc.c_oAscSlideTransitionParams.Param_Right},{displayValue:this.textBottom,value:Asc.c_oAscSlideTransitionParams.Param_Bottom},{displayValue:this.textTopLeft,value:Asc.c_oAscSlideTransitionParams.Param_TopLeft},{displayValue:this.textTopRight,value:Asc.c_oAscSlideTransitionParams.Param_TopRight},{displayValue:this.textBottomLeft,value:Asc.c_oAscSlideTransitionParams.Param_BottomLeft},{displayValue:this.textBottomRight,value:Asc.c_oAscSlideTransitionParams.Param_BottomRight},{displayValue:this.textVerticalIn,value:Asc.c_oAscSlideTransitionParams.Split_VerticalIn},{displayValue:this.textVerticalOut,value:Asc.c_oAscSlideTransitionParams.Split_VerticalOut},{displayValue:this.textHorizontalIn,value:Asc.c_oAscSlideTransitionParams.Split_HorizontalIn},{displayValue:this.textHorizontalOut,value:Asc.c_oAscSlideTransitionParams.Split_HorizontalOut},{displayValue:this.textClockwise,value:Asc.c_oAscSlideTransitionParams.Clock_Clockwise},{displayValue:this.textCounterclockwise,value:Asc.c_oAscSlideTransitionParams.Clock_Counterclockwise},{displayValue:this.textWedge,value:Asc.c_oAscSlideTransitionParams.Clock_Wedge},{displayValue:this.textZoomIn,value:Asc.c_oAscSlideTransitionParams.Zoom_In},{displayValue:this.textZoomOut,value:Asc.c_oAscSlideTransitionParams.Zoom_Out},{displayValue:this.textZoomRotate,value:Asc.c_oAscSlideTransitionParams.Zoom_AndRotate}],this.cmbEffectType=new Common.UI.ComboBox({el:t("#slide-combo-effect-type"),cls:"input-group-nr",style:"width: 100%;",menuStyle:"min-width: 190px;",editable:!1,data:this._arrEffectType,disabled:!0}),this.cmbEffectType.setValue(""),this.cmbEffectType.on("selected",n.bind(this.onEffectTypeSelect,this)),this.numDuration=new Common.UI.MetricSpinner({el:t("#slide-spin-duration"),step:1,width:65,value:"",defaultUnit:this.textSec,maxValue:300,minValue:0,disabled:!0}),this.numDuration.on("change",n.bind(this.onDurationChange,this)),this.numDelay=new Common.UI.MetricSpinner({el:t("#slide-spin-delay"),step:1,width:70,value:"",defaultUnit:this.textSec,maxValue:300,minValue:0,disabled:!0}),this.numDelay.on("change",n.bind(this.onDelayChange,this)),this.chStartOnClick=new Common.UI.CheckBox({el:t("#slide-checkbox-start-click"),labelText:this.strStartOnClick,disabled:!0}),this.chStartOnClick.on("change",n.bind(this.onStartOnClickChange,this)),this.chDelay=new Common.UI.CheckBox({el:t("#slide-checkbox-delay"),labelText:this.strDelay,disabled:!0}),this.chDelay.on("change",n.bind(this.onCheckDelayChange,this)),this.btnPreview=new Common.UI.Button({el:t("#slide-button-preview"),disabled:!0}),this.btnPreview.on("click",n.bind(function(e){this.api&&this.api.SlideTransitionPlay(),this.fireEvent("editcomplete",this)},this)),this.btnApplyToAll=new Common.UI.Button({el:t("#slide-button-apply-all"),disabled:!0}),this.btnApplyToAll.on("click",n.bind(function(e){this.api&&this.api.SlideTimingApplyToAll(),this.fireEvent("editcomplete",this)},this))},render:function(){var e=t(this.el);e.html(this.template({scope:this}))},setApi:function(e){return this.api=e,this.api&&(this.api.SetInterfaceDrawImagePlaceSlide("slide-texture-img"),this.api.asc_registerCallback("asc_onInitStandartTextures",n.bind(this.onInitStandartTextures,this))),this},onFillSrcSelect:function(e,t){this.ShowHideElem(t.value);switch(t.value){case Asc.c_oAscFill.FILL_TYPE_SOLID:this._state.FillType=Asc.c_oAscFill.FILL_TYPE_SOLID;if(!this._noApply){var n=new Asc.CAscSlideProps,r=new Asc.asc_CShapeFill;r.put_type(Asc.c_oAscFill.FILL_TYPE_SOLID),r.put_fill(new Asc.asc_CFillSolid),r.get_fill().put_color(Common.Utils.ThemeColor.getRgbColor(this.SlideColor.Color=="transparent"?{color:"4f81bd",effectId:24}:this.SlideColor.Color)),n.put_background(r),this.api.SetSlideProps(n)}break;case Asc.c_oAscFill.FILL_TYPE_GRAD:this._state.FillType=Asc.c_oAscFill.FILL_TYPE_GRAD;if(!this._noApply){var n=new Asc.CAscSlideProps,r=new Asc.asc_CShapeFill;r.put_type(Asc.c_oAscFill.FILL_TYPE_GRAD),r.put_fill(new Asc.asc_CFillGrad),r.get_fill().put_grad_type(this.GradFillType),this.GradFillType==Asc.c_oAscFillGradType.GRAD_LINEAR&&(r.get_fill().put_linear_angle(this.GradLinearDirectionType*6e4),r.get_fill().put_linear_scale(!0));if(this.OriginalFillType!==Asc.c_oAscFill.FILL_TYPE_GRAD){var i=Common.Utils.ThemeColor.getRgbColor(this.GradColor.colors[0]).get_color().get_hex(),s=Common.Utils.ThemeColor.getRgbColor(this.GradColor.colors[1]).get_color().get_hex();i==="ffffff"&&s==="ffffff"?i={color:"4f81bd",effectId:24}:i=this.GradColor.colors[0],r.get_fill().put_positions([this.GradColor.values[0]*1e3,this.GradColor.values[1]*1e3]),r.get_fill().put_colors([Common.Utils.ThemeColor.getRgbColor(i),Common.Utils.ThemeColor.getRgbColor(this.GradColor.colors[1])])}n.put_background(r),this.api.SetSlideProps(n)}break;case Asc.c_oAscFill.FILL_TYPE_BLIP:this._state.FillType=Asc.c_oAscFill.FILL_TYPE_BLIP;break;case Asc.c_oAscFill.FILL_TYPE_PATT:this._state.FillType=Asc.c_oAscFill.FILL_TYPE_PATT;if(!this._noApply){var n=new Asc.CAscSlideProps,r=new Asc.asc_CShapeFill;r.put_type(Asc.c_oAscFill.FILL_TYPE_PATT),r.put_fill(new Asc.asc_CFillHatch),r.get_fill().put_pattern_type(this.PatternFillType);var o=Common.Utils.ThemeColor.getRgbColor(this.FGColor.Color).get_color().get_hex(),u=Common.Utils.ThemeColor.getRgbColor(this.BGColor.Color).get_color().get_hex();u==="ffffff"&&o==="ffffff"?o={color:"4f81bd",effectId:24}:o=this.FGColor.Color,r.get_fill().put_color_fg(Common.Utils.ThemeColor.getRgbColor(o)),r.get_fill().put_color_bg(Common.Utils.ThemeColor.getRgbColor(this.BGColor.Color)),n.put_background(r),this.api.SetSlideProps(n)}break;case Asc.c_oAscFill.FILL_TYPE_NOFILL:this._state.FillType=Asc.c_oAscFill.FILL_TYPE_NOFILL;if(!this._noApply){var n=new Asc.CAscSlideProps,r=new Asc.asc_CShapeFill;r.put_type(Asc.c_oAscFill.FILL_TYPE_NOFILL),r.put_fill(null),n.put_background(r),this.api.SetSlideProps(n)}}this.fireEvent("editcomplete",this)},onColorsBackSelect:function(e,t){this.btnBackColor.setColor(t),this.SlideColor={Value:1,Color:t};if(this.api&&!this._noApply){var n=new Asc.CAscSlideProps,r=new Asc.asc_CShapeFill;this.SlideColor.Color=="transparent"?(r.put_type(Asc.c_oAscFill.FILL_TYPE_NOFILL),r.put_fill(null)):(r.put_type(Asc.c_oAscFill.FILL_TYPE_SOLID),r.put_fill(new Asc.asc_CFillSolid),r.get_fill().put_color(Common.Utils.ThemeColor.getRgbColor(this.SlideColor.Color))),n.put_background(r),this.api.SetSlideProps(n)}this.fireEvent("editcomplete",this)},addNewColor:function(e,t){e.addNewColor(typeof t.color=="object"?t.color.color:t.color)},onPatternSelect:function(e,t){if(this.api&&!this._noApply){this.PatternFillType=t.get("type");var n=new Asc.CAscSlideProps,r=new Asc.asc_CShapeFill;r.put_type(Asc.c_oAscFill.FILL_TYPE_PATT),r.put_fill(new Asc.asc_CFillHatch),r.get_fill().put_pattern_type(this.PatternFillType),this.OriginalFillType!==Asc.c_oAscFill.FILL_TYPE_PATT&&(r.get_fill().put_color_fg(Common.Utils.ThemeColor.getRgbColor(this.FGColor.Color)),r.get_fill().put_color_bg(Common.Utils.ThemeColor.getRgbColor(this.BGColor.Color))),n.put_background(r),this.api.SetSlideProps(n)}this.fireEvent("editcomplete",this)},onColorsFGSelect:function(e,t){this.btnFGColor.setColor(t),this.FGColor={Value:1,Color:t};if(this.api&&!this._noApply){var n=new Asc.CAscSlideProps,r=new Asc.asc_CShapeFill;r.put_type(Asc.c_oAscFill.FILL_TYPE_PATT),r.put_fill(new Asc.asc_CFillHatch),r.get_fill().put_color_fg(Common.Utils.ThemeColor.getRgbColor(this.FGColor.Color)),this.OriginalFillType!==Asc.c_oAscFill.FILL_TYPE_PATT&&(r.get_fill().put_pattern_type(this.PatternFillType),r.get_fill().put_color_bg(Common.Utils.ThemeColor.getRgbColor(this.BGColor.Color))),n.put_background(r),this.api.SetSlideProps(n)}this.fireEvent("editcomplete",this)},onColorsBGSelect:function(e,t){this.btnBGColor.setColor(t),this.BGColor={Value:1,Color:t};if(this.api&&!this._noApply){var n=new Asc.CAscSlideProps,r=new Asc.asc_CShapeFill;r.put_type(Asc.c_oAscFill.FILL_TYPE_PATT),r.put_fill(new Asc.asc_CFillHatch),this.OriginalFillType!==Asc.c_oAscFill.FILL_TYPE_PATT&&(r.get_fill().put_pattern_type(this.PatternFillType),r.get_fill().put_color_fg(Common.Utils.ThemeColor.getRgbColor(this.FGColor.Color))),r.get_fill().put_color_bg(Common.Utils.ThemeColor.getRgbColor(this.BGColor.Color)),n.put_background(r),this.api.SetSlideProps(n)}this.fireEvent("editcomplete",this)},onFillTypeSelect:function(e,t){this.BlipFillType=t.value;if(this.api&&this._fromTextureCmb!==!0&&this.OriginalFillType==Asc.c_oAscFill.FILL_TYPE_BLIP){var n=new Asc.CAscSlideProps,r=new Asc.asc_CShapeFill;r.put_type(Asc.c_oAscFill.FILL_TYPE_BLIP),r.put_fill(new Asc.asc_CFillBlip),r.get_fill().put_type(this.BlipFillType),n.put_background(r),this.api.SetSlideProps(n)}this.fireEvent("editcomplete",this)},onGradTypeSelect:function(e,t){this.GradFillType=t.value;if(this.GradFillType==Asc.c_oAscFillGradType.GRAD_LINEAR){this.mnuDirectionPicker.store.reset(this._viewDataLinear),this.mnuDirectionPicker.cmpEl.width(175),this.mnuDirectionPicker.restoreHeight=174;var t=this.mnuDirectionPicker.store.findWhere({type:this.GradLinearDirectionType});this.mnuDirectionPicker.selectRecord(t,!0),t?this.btnDirection.setIconCls("item-gradient "+t.get("iconcls")):this.btnDirection.setIconCls("")}else this.GradFillType==Asc.c_oAscFillGradType.GRAD_PATH&&(this.mnuDirectionPicker.store.reset(this._viewDataRadial),this.mnuDirectionPicker.cmpEl.width(60),this.mnuDirectionPicker.restoreHeight=58,this.mnuDirectionPicker.selectByIndex(this.GradRadialDirectionIdx,!0),this.GradRadialDirectionIdx>=0?this.btnDirection.setIconCls("item-gradient "+this._viewDataRadial[this.GradRadialDirectionIdx].iconcls):this.btnDirection.setIconCls(""));if(this.api&&!this._noApply){var n=new Asc.CAscSlideProps,r=new Asc.asc_CShapeFill;r.put_type(Asc.c_oAscFill.FILL_TYPE_GRAD),r.put_fill(new Asc.asc_CFillGrad),r.get_fill().put_grad_type(this.GradFillType),this.GradFillType==Asc.c_oAscFillGradType.GRAD_LINEAR&&(r.get_fill().put_linear_angle(this.GradLinearDirectionType*6e4),r.get_fill().put_linear_scale(!0)),n.put_background(r),this.api.SetSlideProps(n)}this.fireEvent("editcomplete",this)},onSelectGradient:function(e,t,r,i){if(this._noApply)return;var s={},o=n.isFunction(i.toJSON);if(o){if(!i.get("selected"))return;s=i.toJSON()}else s=i;this.btnDirection.setIconCls("item-gradient "+s.iconcls),this.GradFillType==Asc.c_oAscFillGradType.GRAD_LINEAR?this.GradLinearDirectionType=s.type:this.GradRadialDirectionIdx=0;if(this.api&&this.GradFillType==Asc.c_oAscFillGradType.GRAD_LINEAR){var u=new Asc.CAscSlideProps,a=new Asc.asc_CShapeFill;a.put_type(Asc.c_oAscFill.FILL_TYPE_GRAD),a.put_fill(new Asc.asc_CFillGrad),a.get_fill().put_grad_type(this.GradFillType),a.get_fill().put_linear_angle(s.type*6e4),a.get_fill().put_linear_scale(!0),u.put_background(a),this.api.SetSlideProps(u)}this.fireEvent("editcomplete",this)},onColorsGradientSelect:function(e,t){this.btnGradColor.setColor(t),this.GradColor.colors[this.GradColor.currentIdx]=t,this.sldrGradient.setColorValue(Common.Utils.String.format("#{0}",typeof t=="object"?t.color:t));if(this.api&&!this._noApply){var n=new Asc.CAscSlideProps,r=new Asc.asc_CShapeFill;r.put_type(Asc.c_oAscFill.FILL_TYPE_GRAD),r.put_fill(new Asc.asc_CFillGrad),r.get_fill().put_grad_type(this.GradFillType),r.get_fill().put_colors([Common.Utils.ThemeColor.getRgbColor(this.GradColor.colors[0]),Common.Utils.ThemeColor.getRgbColor(this.GradColor.colors[1])]),this.OriginalFillType!==Asc.c_oAscFill.FILL_TYPE_GRAD&&(this.GradFillType==Asc.c_oAscFillGradType.GRAD_LINEAR&&(r.get_fill().put_linear_angle(this.GradLinearDirectionType*6e4),r.get_fill().put_linear_scale(!0)),r.get_fill().put_positions([this.GradColor.values[0]*1e3,this.GradColor.values[1]*1e3])),n.put_background(r),this.api.SetSlideProps(n)}this.fireEvent("editcomplete",this)},onGradientChange:function(e,t,r){this.GradColor.values=e.getValues(),this._sliderChanged=!0,this.api&&!this._noApply&&this._sendUndoPoint&&(this.api.setStartPointHistory(),this._sendUndoPoint=!1,this.updateslider=setInterval(n.bind(this._gradientApplyFunc,this),100))},onGradientChangeComplete:function(e,t,n){clearInterval(this.updateslider),this._sliderChanged=!0,this.api.setEndPointHistory(),this._gradientApplyFunc(),this._sendUndoPoint=!0},_gradientApplyFunc:function(){if(this._sliderChanged){var e=new Asc.CAscSlideProps,t=new Asc.asc_CShapeFill;t.put_type(Asc.c_oAscFill.FILL_TYPE_GRAD),t.put_fill(new Asc.asc_CFillGrad),t.get_fill().put_grad_type(this.GradFillType),t.get_fill().put_positions([this.GradColor.values[0]*1e3,this.GradColor.values[1]*1e3]),this.OriginalFillType!==Asc.c_oAscFill.FILL_TYPE_GRAD&&(this.GradFillType==Asc.c_oAscFillGradType.GRAD_LINEAR&&(t.get_fill().put_linear_angle(this.GradLinearDirectionType*6e4),t.get_fill().put_linear_scale(!0)),t.get_fill().put_colors([Common.Utils.ThemeColor.getRgbColor(this.GradColor.colors[0]),Common.Utils.ThemeColor.getRgbColor(this.GradColor.colors[1])])),e.put_background(t),this.api.SetSlideProps(e),this._sliderChanged=!1}},insertFromUrl:function(){var e=this;(new Common.Views.ImageFromUrlDialog({handler:function(t,r){if(t=="ok"&&e.api){var i=r.replace(/ /g,"");if(!n.isEmpty(i)&&e.BlipFillType!==null){var s=new Asc.CAscSlideProps,o=new Asc.asc_CShapeFill;o.put_type(Asc.c_oAscFill.FILL_TYPE_BLIP),o.put_fill(new Asc.asc_CFillBlip),o.get_fill().put_type(e.BlipFillType),o.get_fill().put_url(i),s.put_background(o),e.api.SetSlideProps(s)}}e.fireEvent("editcomplete",e)}})).show()},createDelayedControls:function(){var e=this;this.cmbPattern=new Common.UI.ComboDataView({itemWidth:28,itemHeight:28,menuMaxHeight:300,enableKeyEvents:!0,cls:"combo-pattern"}),this.cmbPattern.menuPicker.itemTemplate=this.cmbPattern.fieldPicker.itemTemplate=n.template(['
    ','',"
    "].join("")),this.cmbPattern.render(t("#slide-combo-pattern")),this.cmbPattern.openButton.menu.cmpEl.css({"min-width":178,"max-width":178}),this.cmbPattern.on("click",n.bind(this.onPatternSelect,this)),this.FillItems.push(this.cmbPattern),this.btnInsertFromFile=new Common.UI.Button({el:t("#slide-button-from-file")}),this.btnInsertFromFile.on("click",n.bind(function(e){this.api&&this.api.ChangeSlideImageFromFile(),this.fireEvent("editcomplete",this)},this)),this.FillItems.push(this.btnInsertFromFile),this.btnInsertFromUrl=new Common.UI.Button({el:t("#slide-button-from-url")}),this.btnInsertFromUrl.on("click",n.bind(this.insertFromUrl,this)),this.FillItems.push(this.btnInsertFromUrl),this._arrFillType=[{displayValue:this.textStretch,value:Asc.c_oAscFillBlipType.STRETCH},{displayValue:this.textTile,value:Asc.c_oAscFillBlipType.TILE}],this.cmbFillType=new Common.UI.ComboBox({el:t("#slide-combo-fill-type"),cls:"input-group-nr",menuStyle:"min-width: 90px;",editable:!1,data:this._arrFillType}),this.cmbFillType.setValue(this._arrFillType[0].value),this.cmbFillType.on("selected",n.bind(this.onFillTypeSelect,this)),this.FillItems.push(this.cmbFillType),this._arrGradType=[{displayValue:this.textLinear,value:Asc.c_oAscFillGradType.GRAD_LINEAR},{displayValue:this.textRadial,value:Asc.c_oAscFillGradType.GRAD_PATH}],this.cmbGradType=new Common.UI.ComboBox({el:t("#slide-combo-grad-type"),cls:"input-group-nr",menuStyle:"min-width: 90px;",editable:!1,data:this._arrGradType}),this.cmbGradType.setValue(this._arrGradType[0].value),this.cmbGradType.on("selected",n.bind(this.onGradTypeSelect,this)),this.FillItems.push(this.cmbGradType),this._viewDataLinear=[{offsetx:0,offsety:0,type:45,subtype:-1,iconcls:"gradient-left-top"},{offsetx:50,offsety:0,type:90,subtype:4,iconcls:"gradient-top"},{offsetx:100,offsety:0,type:135,subtype:5,iconcls:"gradient-right-top"},{offsetx:0,offsety:50,type:0,subtype:6,iconcls:"gradient-left",cls:"item-gradient-separator",selected:!0},{offsetx:100,offsety:50,type:180,subtype:1,iconcls:"gradient-right"},{offsetx:0,offsety:100,type:315,subtype:2,iconcls:"gradient-left-bottom"},{offsetx:50,offsety:100,type:270,subtype:3,iconcls:"gradient-bottom"},{offsetx:100,offsety:100,type:225,subtype:7,iconcls:"gradient-right-bottom"}],this._viewDataRadial=[{offsetx:100,offsety:150,type:2,subtype:5,iconcls:"gradient-radial-center"}],this.btnDirection=new Common.UI.Button({cls:"btn-large-dataview",iconCls:"item-gradient gradient-left",menu:new Common.UI.Menu({style:"min-width: 60px;",menuAlign:"tr-br",items:[{template:n.template('
    ')}]})}),this.btnDirection.on("render:after",function(r){e.mnuDirectionPicker=new Common.UI.DataView({el:t("#id-slide-menu-direction"),parentMenu:r.menu,restoreHeight:174,store:new Common.UI.DataViewStore(e._viewDataLinear),itemTemplate:n.template('
    ')})}),this.btnDirection.render(t("#slide-button-direction")),this.mnuDirectionPicker.on("item:click",n.bind(this.onSelectGradient,this,this.btnDirection)),this.FillItems.push(this.btnDirection),this.sldrGradient=new Common.UI.MultiSliderGradient({el:t("#slide-slider-gradient"),width:125,minValue:0,maxValue:100,values:[0,100]}),this.sldrGradient.on("change",n.bind(this.onGradientChange,this)),this.sldrGradient.on("changecomplete",n.bind(this.onGradientChangeComplete,this)),this.sldrGradient.on("thumbclick",function(t,n){e.GradColor.currentIdx=n;var r=e.GradColor.colors[e.GradColor.currentIdx];e.btnGradColor.setColor(r),e.colorsGrad.select(r,!1)}),this.sldrGradient.on("thumbdblclick",function(t){e.btnGradColor.cmpEl.find("button").dropdown("toggle")}),this.FillItems.push(this.sldrGradient)},createDelayedElements:function(){this.createDelayedControls();var e=[0,1,3,2,4,53,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,22,23,24,25,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,49,50,51,52];this.patternViewData=[];for(var t=0;t<13;t++)for(var n=0;n<4;n++){var r=t*4+n;this.patternViewData[r]={offsetx:n*28,offsety:t*28,type:e[r]}}this.patternViewData.splice(this.patternViewData.length-2,2);for(var t=0;t0&&(this.cmbPattern.fillComboView(this.cmbPattern.menuPicker.store.at(0),!0),this.PatternFillType=this.patternViewData[0].type),this.UpdateThemeColors(),this._initSettings=!1},onInitStandartTextures:function(e){var r=this;if(e&&e.length>0){this.btnTexture||(this.btnTexture=new Common.UI.ComboBox({el:t("#slide-combo-fill-texture"),template:n.template(['"].join(""))}),this.textureMenu=new Common.UI.Menu({items:[{template:n.template('
    ')}]}),this.textureMenu.render(t("#slide-combo-fill-texture")),this.FillItems.push(this.btnTexture));var i=[];n.each(e,function(e){i.push({imageUrl:e.get_image(),name:r.textureNames[e.get_id()],type:e.get_id(),selected:!1})});var s=new Common.UI.DataView({el:t("#id-slide-menu-texture"),restoreHeight:174,parentMenu:r.textureMenu,showLast:!1,store:new Common.UI.DataViewStore(i),itemTemplate:n.template('
    ')});s.on("item:click",n.bind(this.onSelectTexture,this))}},onSelectTexture:function(e,n,r){this._fromTextureCmb=!0,this.cmbFillType.setValue(this._arrFillType[1].value),this._fromTextureCmb=!1;if(this.api){var i=new Asc.CAscSlideProps,s=new Asc.asc_CShapeFill;s.put_type(Asc.c_oAscFill.FILL_TYPE_BLIP),s.put_fill(new Asc.asc_CFillBlip),s.get_fill().put_type(Asc.c_oAscFillBlipType.TILE),s.get_fill().put_texture_id(r.get("type")),i.put_background(s),this.api.SetSlideProps(i)}t(this.btnTexture.el).find(".form-control").prop("innerHTML",r.get("name")),this.fireEvent("editcomplete",this)},fillEffectTypeCombo:function(e){var t=[];switch(e){case Asc.c_oAscSlideTransitionTypes.Fade:t.push(this._arrEffectType[0],this._arrEffectType[1]);break;case Asc.c_oAscSlideTransitionTypes.Push:t=this._arrEffectType.slice(2,6);break;case Asc.c_oAscSlideTransitionTypes.Wipe:t=this._arrEffectType.slice(2,10);break;case Asc.c_oAscSlideTransitionTypes.Split:t=this._arrEffectType.slice(10,14);break;case Asc.c_oAscSlideTransitionTypes.UnCover:t=this._arrEffectType.slice(2,10);break;case Asc.c_oAscSlideTransitionTypes.Cover:t=this._arrEffectType.slice(2,10);break;case Asc.c_oAscSlideTransitionTypes.Clock:t=this._arrEffectType.slice(14,17);break;case Asc.c_oAscSlideTransitionTypes.Zoom:t=this._arrEffectType.slice(17)}t.length>0?(this.cmbEffectType.store.reset(t),this.cmbEffectType.setValue(t[0].value),this.EffectType=t[0].value):(this.cmbEffectType.store.reset(),this.EffectType=undefined),this.cmbEffectType.setDisabled(t.length<1||this._stateDisabled.effects),this.numDuration.setDisabled(t.length<1||this._stateDisabled.effects),this.btnPreview.setDisabled(t.length<1||this._stateDisabled.effects)},onEffectNameSelect:function(e,t){var n=t.value;this.Effect!==n&&(this.Effect!==Asc.c_oAscSlideTransitionTypes.Wipe&&this.Effect!==Asc.c_oAscSlideTransitionTypes.UnCover&&this.Effect!==Asc.c_oAscSlideTransitionTypes.Cover||n!==Asc.c_oAscSlideTransitionTypes.Wipe&&n!==Asc.c_oAscSlideTransitionTypes.UnCover&&n!==Asc.c_oAscSlideTransitionTypes.Cover)&&this.fillEffectTypeCombo(n),this.Effect=n;if(this.api&&!this._noApply){var r=new Asc.CAscSlideProps,i=new Asc.CAscSlideTiming;i.put_TransitionType(n),i.put_TransitionOption(this.EffectType),r.put_timing(i),this.api.SetSlideProps(r)}this.fireEvent("editcomplete",this)},onEffectTypeSelect:function(e,t){this.EffectType=t.value;if(this.api&&!this._noApply){var n=new Asc.CAscSlideProps,r=new Asc.CAscSlideTiming;r.put_TransitionType(this.Effect),r.put_TransitionOption(this.EffectType),n.put_timing(r),this.api.SetSlideProps(n)}this.fireEvent("editcomplete",this)},onDurationChange:function(e,t,n,r){if(this.api&&!this._noApply){var i=new Asc.CAscSlideProps,s=new Asc.CAscSlideTiming;s.put_TransitionDuration(e.getNumberValue()*1e3),i.put_timing(s),this.api.SetSlideProps(i)}this.fireEvent("editcomplete",this)},onDelayChange:function(e,t,n,r){if(this.api&&!this._noApply){var i=new Asc.CAscSlideProps,s=new Asc.CAscSlideTiming;s.put_SlideAdvanceDuration(e.getNumberValue()*1e3),i.put_timing(s),this.api.SetSlideProps(i)}this.fireEvent("editcomplete",this)},onStartOnClickChange:function(e,t,n,r){if(this.api&&!this._noApply){var i=new Asc.CAscSlideProps,s=new Asc.CAscSlideTiming;s.put_SlideAdvanceOnMouseClick(e.getValue()=="checked"),i.put_timing(s),this.api.SetSlideProps(i)}this.fireEvent("editcomplete",this)},onCheckDelayChange:function(e,t,n,r){this.numDelay.setDisabled(e.getValue()!=="checked");if(this.api&&!this._noApply){var i=new Asc.CAscSlideProps,s=new Asc.CAscSlideTiming;s.put_SlideAdvanceAfter(e.getValue()=="checked"),i.put_timing(s),this.api.SetSlideProps(i)}this.fireEvent("editcomplete",this)},UpdateThemeColors:function(){this.btnBackColor||(this.btnBackColor=new Common.UI.ColorButton({style:"width:45px;",disabled:!0,menu:new Common.UI.Menu({items:[{template:n.template('
    ')},{template:n.template(''+this.textNewColor+"")}]})}),this.btnBackColor.render(t("#slide-back-color-btn")),this.btnBackColor.setColor("ffffff"),this.FillItems.push(this.btnBackColor),this.colorsBack=new Common.UI.ThemeColorPalette({el:t("#slide-back-color-menu"),value:"ffffff",transparent:!0}),this.colorsBack.on("select",n.bind(this.onColorsBackSelect,this)),t(this.el).on("click","#slide-back-color-new",n.bind(this.addNewColor,this,this.colorsBack,this.btnBackColor)),this.btnFGColor=new Common.UI.ColorButton({style:"width:45px;",menu:new Common.UI.Menu({items:[{template:n.template('
    ')},{template:n.template(''+this.textNewColor+"")}]})}),this.btnFGColor.render(t("#slide-foreground-color-btn")),this.btnFGColor.setColor("000000"),this.FillItems.push(this.btnFGColor),this.colorsFG=new Common.UI.ThemeColorPalette({el:t("#slide-foreground-color-menu"),value:"000000"}),this.colorsFG.on("select",n.bind(this.onColorsFGSelect,this)),t(this.el).on("click","#slide-foreground-color-new",n.bind(this.addNewColor,this,this.colorsFG,this.btnFGColor)),this.btnBGColor=new Common.UI.ColorButton({style:"width:45px;",menu:new Common.UI.Menu({items:[{template:n.template('
    ')},{template:n.template(''+this.textNewColor+"")}]})}),this.btnBGColor.render(t("#slide-background-color-btn")),this.btnBGColor.setColor("ffffff"),this.FillItems.push(this.btnBGColor),this.colorsBG=new Common.UI.ThemeColorPalette({el:t("#slide-background-color-menu"),value:"ffffff"}),this.colorsBG.on("select",n.bind(this.onColorsBGSelect,this)),t(this.el).on("click","#slide-background-color-new",n.bind(this.addNewColor,this,this.colorsBG,this.btnBGColor)),this.btnGradColor=new Common.UI.ColorButton({style:"width:45px;",menu:new Common.UI.Menu({items:[{template:n.template('
    ')},{template:n.template(''+this.textNewColor+"")}]})}),this.btnGradColor.render(t("#slide-gradient-color-btn")),this.btnGradColor.setColor("000000"),this.FillItems.push(this.btnGradColor),this.colorsGrad=new Common.UI.ThemeColorPalette({el:t("#slide-gradient-color-menu"),value:"000000"}),this.colorsGrad.on("select",n.bind(this.onColorsGradientSelect,this)),t(this.el).on("click","#slide-gradient-color-new",n.bind(this.addNewColor,this,this.colorsGrad,this.btnGradColor))),this.colorsBack.updateColors(Common.Utils.ThemeColor.getEffectColors(),Common.Utils.ThemeColor.getStandartColors()),this.colorsFG.updateColors(Common.Utils.ThemeColor.getEffectColors(),Common.Utils.ThemeColor.getStandartColors()),this.colorsBG.updateColors(Common.Utils.ThemeColor.getEffectColors(),Common.Utils.ThemeColor.getStandartColors()),this.colorsGrad.updateColors(Common.Utils.ThemeColor.getEffectColors(),Common.Utils.ThemeColor.getStandartColors())},ShowHideElem:function(e){this.FillColorContainer.toggleClass("settings-hidden",e!==Asc.c_oAscFill.FILL_TYPE_SOLID),this.FillImageContainer.toggleClass("settings-hidden",e!==Asc.c_oAscFill.FILL_TYPE_BLIP),this.FillPatternContainer.toggleClass("settings-hidden",e!==Asc.c_oAscFill.FILL_TYPE_PATT),this.FillGradientContainer.toggleClass("settings-hidden",e!==Asc.c_oAscFill.FILL_TYPE_GRAD)},ChangeSettings:function(e){this._initSettings&&this.createDelayedElements();if(e){this._originalProps=e,this._noApply=!0;var n=null,r=e.get_background(),i=r.get_type(),s=null;if(r===null||i===null||i==Asc.c_oAscFill.FILL_TYPE_NOFILL)this.OriginalFillType=Asc.c_oAscFill.FILL_TYPE_NOFILL;else if(i==Asc.c_oAscFill.FILL_TYPE_SOLID)r=r.get_fill(),s=r.get_color(),s?s.get_type()==Asc.c_oAscColor.COLOR_TYPE_SCHEME?this.SlideColor={Value:1,Color:{color:Common.Utils.ThemeColor.getHexColor(s.get_r(),s.get_g(),s.get_b()),effectValue:s.get_value()}}:this.SlideColor={Value:1,Color:Common.Utils.ThemeColor.getHexColor(s.get_r(),s.get_g(),s.get_b())}:this.SlideColor={Value:0,Color:"transparent"},this.OriginalFillType=Asc.c_oAscFill.FILL_TYPE_SOLID,this.FGColor=this.SlideColor.Color!=="transparent"?{Value:1,Color:Common.Utils.ThemeColor.colorValue2EffectId(this.SlideColor.Color)}:{Value:1,Color:"000000"},this.BGColor={Value:1,Color:"ffffff"},this.GradColor.colors[0]=this.SlideColor.Color!=="transparent"?Common.Utils.ThemeColor.colorValue2EffectId(this.SlideColor.Color):"000000",this.GradColor.colors[1]="ffffff";else if(i==Asc.c_oAscFill.FILL_TYPE_BLIP)r=r.get_fill(),this.BlipFillType=r.get_type(),this._state.BlipFillType!==this.BlipFillType&&(this.BlipFillType==Asc.c_oAscFillBlipType.STRETCH||this.BlipFillType==Asc.c_oAscFillBlipType.TILE?this.cmbFillType.setValue(this.BlipFillType):this.cmbFillType.setValue(""),this._state.BlipFillType=this.BlipFillType),this.OriginalFillType=Asc.c_oAscFill.FILL_TYPE_BLIP;else if(i==Asc.c_oAscFill.FILL_TYPE_PATT){r=r.get_fill(),this.PatternFillType=r.get_pattern_type();if(this._state.PatternFillType!==this.PatternFillType){this.cmbPattern.suspendEvents();var n=this.cmbPattern.menuPicker.store.findWhere({type:this.PatternFillType});this.cmbPattern.menuPicker.selectRecord(n),this.cmbPattern.resumeEvents(),this._state.PatternFillType=this.PatternFillType}s=r.get_color_fg(),s?s.get_type()==Asc.c_oAscColor.COLOR_TYPE_SCHEME?this.FGColor={Value:1,Color:{color:Common.Utils.ThemeColor.getHexColor(s.get_r(),s.get_g(),s.get_b()),effectValue:s.get_value()}}:this.FGColor={Value:1,Color:Common.Utils.ThemeColor.getHexColor(s.get_r(),s.get_g(),s.get_b())}:this.FGColor={Value:1,Color:"000000"},s=r.get_color_bg(),s?s.get_type()==Asc.c_oAscColor.COLOR_TYPE_SCHEME?this.BGColor={Value:1,Color:{color:Common.Utils.ThemeColor.getHexColor(s.get_r(),s.get_g(),s.get_b()),effectValue:s.get_value()}}:this.BGColor={Value:1,Color:Common.Utils.ThemeColor.getHexColor(s.get_r(),s.get_g(),s.get_b())}:this.BGColor={Value:1,Color:"ffffff"},this.OriginalFillType=Asc.c_oAscFill.FILL_TYPE_PATT,this.SlideColor={Value:1,Color:Common.Utils.ThemeColor.colorValue2EffectId(this.FGColor.Color)},this.GradColor.colors[0]=Common.Utils.ThemeColor.colorValue2EffectId(this.FGColor.Color),this.GradColor.colors[1]="ffffff"}else if(i==Asc.c_oAscFill.FILL_TYPE_GRAD){r=r.get_fill();var o=r.get_grad_type();if(this._state.GradFillType!==o||this.GradFillType!==o)this.GradFillType=o,n=undefined,this.GradFillType==Asc.c_oAscFillGradType.GRAD_LINEAR||this.GradFillType==Asc.c_oAscFillGradType.GRAD_PATH?(this.cmbGradType.setValue(this.GradFillType),n=this.cmbGradType.store.findWhere({value:this.GradFillType}),this.onGradTypeSelect(this.cmbGradType,n.attributes)):(this.cmbGradType.setValue(""),this.btnDirection.setIconCls("")),this._state.GradFillType=this.GradFillType;if(this.GradFillType==Asc.c_oAscFillGradType.GRAD_LINEAR){var u=Math.floor(r.get_linear_angle()/6e4);if(Math.abs(this.GradLinearDirectionType-u)>.001){this.GradLinearDirectionType=u;var a=this.mnuDirectionPicker.store.findWhere({type:u});this.mnuDirectionPicker.selectRecord(a,!0),a?this.btnDirection.setIconCls("item-gradient "+a.get("iconcls")):this.btnDirection.setIconCls("")}}var f=r.get_colors();f&&f.length>0&&(s=f[0],s?s.get_type()==Asc.c_oAscColor.COLOR_TYPE_SCHEME?(this.GradColor.colors[0]={color:Common.Utils.ThemeColor.getHexColor(s.get_r(),s.get_g(),s.get_b()),effectValue:s.get_value()},Common.Utils.ThemeColor.colorValue2EffectId(this.GradColor.colors[0])):this.GradColor.colors[0]=Common.Utils.ThemeColor.getHexColor(s.get_r(),s.get_g(),s.get_b()):this.GradColor.colors[0]="000000",s=f[1],s?s.get_type()==Asc.c_oAscColor.COLOR_TYPE_SCHEME?(this.GradColor.colors[1]={color:Common.Utils.ThemeColor.getHexColor(s.get_r(),s.get_g(),s.get_b()),effectValue:s.get_value()},Common.Utils.ThemeColor.colorValue2EffectId(this.GradColor.colors[1])):this.GradColor.colors[1]=Common.Utils.ThemeColor.getHexColor(s.get_r(),s.get_g(),s.get_b()):this.GradColor.colors[1]="ffffff");var l=r.get_positions();if(l&&l.length>0){var c=l[0];c!==null&&(c/=1e3,this.GradColor.values[0]=c),c=l[1],c!==null&&(c/=1e3,this.GradColor.values[1]=c)}this.sldrGradient.setColorValue(Common.Utils.String.format("#{0}",typeof this.GradColor.colors[0]=="object"?this.GradColor.colors[0].color:this.GradColor.colors[0]),0),this.sldrGradient.setColorValue(Common.Utils.String.format("#{0}",typeof this.GradColor.colors[1]=="object"?this.GradColor.colors[1].color:this.GradColor.colors[1]),1),this.sldrGradient.setValue(0,this.GradColor.values[0]),this.sldrGradient.setValue(1,this.GradColor.values[1]),this.OriginalFillType=Asc.c_oAscFill.FILL_TYPE_GRAD,this.FGColor={Value:1,Color:this.GradColor.colors[0]},this.BGColor={Value:1,Color:"ffffff"},this.SlideColor={Value:1,Color:this.GradColor.colors[0]}}this._state.FillType!==this.OriginalFillType&&(this.cmbFillSrc.setValue(this.OriginalFillType),this._state.FillType=this.OriginalFillType,this.ShowHideElem(this.OriginalFillType)),t(this.btnTexture.el).find(".form-control").prop("innerHTML",this.textSelectTexture);var h=typeof this.SlideColor.Color,p=typeof this._state.SlideColor;if(h!==p||h=="object"&&(this.SlideColor.Color.effectValue!==this._state.SlideColor.effectValue||this._state.SlideColor.color.indexOf(this.SlideColor.Color.color)<0)||h!="object"&&this._state.SlideColor.indexOf(this.SlideColor.Color)<0){this.btnBackColor.setColor(this.SlideColor.Color);if(typeof this.SlideColor.Color=="object"){var d=!1;for(var v=0;v<10;v++)if(Common.Utils.ThemeColor.ThemeValues[v]==this.SlideColor.Color.effectValue){this.colorsBack.select(this.SlideColor.Color,!0),d=!0;break}d||this.colorsBack.clearSelection()}else this.colorsBack.select(this.SlideColor.Color,!0);this._state.SlideColor=this.SlideColor.Color}var m=e.get_timing();if(m){var u=m.get_TransitionType(),g=!1;if(this._state.Effect!==u){var y=this.cmbEffectName.store.findWhere({value:u});y?(g=!0,this.cmbEffectName.setValue(y.get("value"))):this.cmbEffectName.setValue(""),this.fillEffectTypeCombo(g?u:undefined),this.Effect=u,this._state.Effect=u}u=m.get_TransitionOption();if(this._state.EffectType!==u||g)g=!1,y=this.cmbEffectType.store.findWhere({value:u}),y?(g=!0,this.cmbEffectType.setValue(y.get("value"))):this.cmbEffectType.setValue(""),this._state.EffectType=u;u=m.get_TransitionDuration();if(Math.abs(this._state.Duration-u)>.001||(this._state.Duration===null||u===null)&&this._state.Duration!==u||(this._state.Duration===undefined||u===undefined)&&this._state.Duration!==u)this.numDuration.setValue(u!==null&&u!==undefined?u/1e3:"",!0),this._state.Duration=u;u=m.get_SlideAdvanceDuration();if(Math.abs(this._state.Delay-u)>.001||(this._state.Delay===null||u===null)&&this._state.Delay!==u||(this._state.Delay===undefined||u===undefined)&&this._state.Delay!==u)this.numDelay.setValue(u!==null&&u!==undefined?u/1e3:"",!0),this._state.Delay=u;u=m.get_SlideAdvanceOnMouseClick(),this._state.OnMouseClick!==u&&(this.chStartOnClick.setValue(u!==null&&u!==undefined?u:"indeterminate",!0),this._state.OnMouseClick=u),u=m.get_SlideAdvanceAfter(),this._state.AdvanceAfter!==u&&(this.chDelay.setValue(u!==null&&u!==undefined?u:"indeterminate",!0),this.numDelay.setDisabled(this.chDelay.getValue()!=="checked"),this._state.AdvanceAfter=u)}h=typeof this.FGColor.Color,p=typeof this._state.FGColor;if(h!==p||h=="object"&&(this.FGColor.Color.effectValue!==this._state.FGColor.effectValue||this._state.FGColor.color.indexOf(this.FGColor.Color.color)<0)||h!="object"&&this._state.FGColor.indexOf(this.FGColor.Color)<0){this.btnFGColor.setColor(this.FGColor.Color);if(typeof this.FGColor.Color=="object"){var d=!1;for(var v=0;v<10;v++)if(Common.Utils.ThemeColor.ThemeValues[v]==this.FGColor.Color.effectValue){this.colorsFG.select(this.FGColor.Color,!0),d=!0;break}d||this.colorsFG.clearSelection()}else this.colorsFG.select(this.FGColor.Color,!0);this._state.FGColor=this.FGColor.Color}h=typeof this.BGColor.Color,p=typeof this._state.BGColor;if(h!==p||h=="object"&&(this.BGColor.Color.effectValue!==this._state.BGColor.effectValue||this._state.BGColor.color.indexOf(this.BGColor.Color.color)<0)||h!="object"&&this._state.BGColor.indexOf(this.BGColor.Color)<0){this.btnBGColor.setColor(this.BGColor.Color);if(typeof this.BGColor.Color=="object"){var d=!1;for(var v=0;v<10;v++)if(Common.Utils.ThemeColor.ThemeValues[v]==this.BGColor.Color.effectValue){this.colorsBG.select(this.BGColor.Color,!0),d=!0;break}d||this.colorsBG.clearSelection()}else this.colorsBG.select(this.BGColor.Color,!0);this._state.BGColor=this.BGColor.Color}s=this.GradColor.colors[this.GradColor.currentIdx],h=typeof s,p=typeof this._state.GradColor;if(h!==p||h=="object"&&(s.effectValue!==this._state.GradColor.effectValue||this._state.GradColor.color.indexOf(s.color)<0)||h!="object"&&this._state.GradColor.indexOf(s)<0){this.btnGradColor.setColor(s);if(typeof s=="object"){var d=!1;for(var v=0;v<10;v++)if(Common.Utils.ThemeColor.ThemeValues[v]==s.effectValue){this.colorsGrad.select(s,!0),d=!0;break}d||this.colorsGrad.clearSelection()}else this.colorsGrad.select(s,!0);this._state.GradColor=s}this._noApply=!1}},SetSlideDisabled:function(e,t,n){if(this._initSettings)return;if(e!==this._stateDisabled.background){this.cmbFillSrc.setDisabled(e);for(var r=0;r\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
    \r\n \r\n \r\n \r\n \r\n
    \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
    \r\n \r\n \r\n \r\n \r\n
    \r\n
    \r\n
    \r\n
    \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
    \r\n \r\n \r\n \r\n
    \r\n
    \r\n
    \r\n
    \r\n
    \r\n
    \r\n
    \r\n \r\n
    \r\n
    \r\n
    \r\n
    \r\n \r\n
    \r\n
    \r\n \r\n
    \r\n
    \r\n
    \r\n \r\n
    \r\n
    \r\n
    \r\n
    \r\n
    \r\n
    \r\n \r\n
    \r\n
    \r\n
    \r\n \r\n
    \r\n
    \r\n
    \r\n \r\n
    \r\n
    \r\n
    \r\n
    \r\n
    \r\n \r\n \r\n \r\n \r\n
    \r\n \r\n
    \r\n \r\n
    \r\n \r\n
    \r\n
    \r\n
    \r\n \r\n \r\n \r\n \r\n
    \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
    \r\n \r\n
    \r\n
    \r\n
    \r\n \r\n
    \r\n
    \r\n \r\n \r\n \r\n \r\n
    \r\n \r\n
    \r\n
    \r\n \r\n \r\n \r\n \r\n
    \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
    \r\n \r\n \r\n \r\n'}),define("presentationeditor/main/app/view/TextArtSettings",["text!presentationeditor/main/app/template/TextArtSettings.template","jquery","underscore","backbone","common/main/lib/component/ComboBox","common/main/lib/component/ComboBorderSize","common/main/lib/component/MetricSpinner","common/main/lib/component/ThemeColorPalette","common/main/lib/component/ColorButton","common/main/lib/component/ComboDataView","common/main/lib/component/Slider","common/main/lib/component/MultiSliderGradient","common/main/lib/view/ImageFromUrlDialog"],function(e,t,n,r){"use strict";PE.Views.TextArtSettings=r.View.extend(n.extend({el:"#id-textart-settings",template:n.template(e),events:{},options:{alias:"TextArtSettings"},initialize:function(){this._initSettings=!0,this._noApply=!0,this.shapeprops=null,this._sendUndoPoint=!0,this._sliderChanged=!1,this.txtPt=Common.Utils.Metric.getMetricName(Common.Utils.Metric.c_MetricUnits.pt),this._state={Transparency:null,FillType:Asc.c_oAscFill.FILL_TYPE_SOLID,ShapeColor:"transparent",BlipFillType:Asc.c_oAscFillBlipType.STRETCH,StrokeType:Asc.c_oAscStrokeType.STROKE_COLOR,StrokeWidth:this._pt2mm(1),StrokeColor:"000000",StrokeBorderType:Asc.c_oDashType.solid,FGColor:"000000",BGColor:"ffffff",GradColor:"000000",GradFillType:Asc.c_oAscFillGradType.GRAD_LINEAR,FormId:null,DisabledControls:!1},this.lockedControls=[],this._locked=!1,this.OriginalFillType=Asc.c_oAscFill.FILL_TYPE_SOLID,this.ShapeColor={Value:1,Color:"transparent"},this.BlipFillType=Asc.c_oAscFillBlipType.STRETCH,this.GradFillType=Asc.c_oAscFillGradType.GRAD_LINEAR,this.GradColor={values:[0,100],colors:["000000","ffffff"],currentIdx:0},this.GradRadialDirectionIdx=0,this.GradLinearDirectionType=0,this.PatternFillType=0,this.FGColor={Value:1,Color:"000000"},this.BGColor={Value:1,Color:"ffffff"},this.BorderColor={Value:1,Color:"transparent"},this.BorderSize=0,this.BorderType=Asc.c_oDashType.solid,this.textureNames=[this.txtCanvas,this.txtCarton,this.txtDarkFabric,this.txtGrain,this.txtGranite,this.txtGreyPaper,this.txtKnit,this.txtLeather,this.txtBrownPaper,this.txtPapyrus,this.txtWood],this.render(),this.FillColorContainer=t("#textart-panel-color-fill"),this.FillImageContainer=t("#textart-panel-image-fill"),this.FillPatternContainer=t("#textart-panel-pattern-fill"),this.FillGradientContainer=t("#textart-panel-gradient-fill"),this.TransparencyContainer=t("#textart-panel-transparent-fill")},render:function(){var e=t(this.el);e.html(this.template({scope:this}))},setApi:function(e){return this.api=e,this.api&&(this.api.SetInterfaceDrawImagePlaceTextArt("textart-texture-img"),this.api.asc_registerCallback("asc_onInitStandartTextures",n.bind(this.onInitStandartTextures,this))),this},onFillSrcSelect:function(e,t){this.ShowHideElem(t.value);switch(t.value){case Asc.c_oAscFill.FILL_TYPE_SOLID:this._state.FillType=Asc.c_oAscFill.FILL_TYPE_SOLID;if(!this._noApply){var n=new Asc.asc_TextArtProperties,r=new Asc.asc_CShapeFill;r.put_type(Asc.c_oAscFill.FILL_TYPE_SOLID),r.put_fill(new Asc.asc_CFillSolid),r.get_fill().put_color(Common.Utils.ThemeColor.getRgbColor(this.ShapeColor.Color=="transparent"?{color:"4f81bd",effectId:24}:this.ShapeColor.Color)),n.asc_putFill(r),this.shapeprops.put_TextArtProperties(n),this.api.ShapeApply(this.shapeprops)}break;case Asc.c_oAscFill.FILL_TYPE_GRAD:this._state.FillType=Asc.c_oAscFill.FILL_TYPE_GRAD;if(!this._noApply){var n=new Asc.asc_TextArtProperties,r=new Asc.asc_CShapeFill;r.put_type(Asc.c_oAscFill.FILL_TYPE_GRAD),r.put_fill(new Asc.asc_CFillGrad),r.get_fill().put_grad_type(this.GradFillType),this.GradFillType==Asc.c_oAscFillGradType.GRAD_LINEAR&&(r.get_fill().put_linear_angle(this.GradLinearDirectionType*6e4),r.get_fill().put_linear_scale(!0));if(this.OriginalFillType!==Asc.c_oAscFill.FILL_TYPE_GRAD){var i=Common.Utils.ThemeColor.getRgbColor(this.GradColor.colors[0]).get_color().get_hex(),s=Common.Utils.ThemeColor.getRgbColor(this.GradColor.colors[1]).get_color().get_hex();i==="ffffff"&&s==="ffffff"?i={color:"4f81bd",effectId:24}:i=this.GradColor.colors[0],r.get_fill().put_positions([this.GradColor.values[0]*1e3,this.GradColor.values[1]*1e3]),r.get_fill().put_colors([Common.Utils.ThemeColor.getRgbColor(i),Common.Utils.ThemeColor.getRgbColor(this.GradColor.colors[1])])}n.asc_putFill(r),this.shapeprops.put_TextArtProperties(n),this.api.ShapeApply(this.shapeprops)}break;case Asc.c_oAscFill.FILL_TYPE_BLIP:this._state.FillType=Asc.c_oAscFill.FILL_TYPE_BLIP;break;case Asc.c_oAscFill.FILL_TYPE_PATT:this._state.FillType=Asc.c_oAscFill.FILL_TYPE_PATT;if(!this._noApply){var n=new Asc.asc_TextArtProperties,r=new Asc.asc_CShapeFill;r.put_type(Asc.c_oAscFill.FILL_TYPE_PATT),r.put_fill(new Asc.asc_CFillHatch),r.get_fill().put_pattern_type(this.PatternFillType);var o=Common.Utils.ThemeColor.getRgbColor(this.FGColor.Color).get_color().get_hex(),u=Common.Utils.ThemeColor.getRgbColor(this.BGColor.Color).get_color().get_hex();u==="ffffff"&&o==="ffffff"?o={color:"4f81bd",effectId:24}:o=this.FGColor.Color,r.get_fill().put_color_fg(Common.Utils.ThemeColor.getRgbColor(o)),r.get_fill().put_color_bg(Common.Utils.ThemeColor.getRgbColor(this.BGColor.Color)),n.asc_putFill(r),this.shapeprops.put_TextArtProperties(n),this.api.ShapeApply(this.shapeprops)}break;case Asc.c_oAscFill.FILL_TYPE_NOFILL:this._state.FillType=Asc.c_oAscFill.FILL_TYPE_NOFILL;if(!this._noApply){var n=new Asc.asc_TextArtProperties,r=new Asc.asc_CShapeFill;r.put_type(Asc.c_oAscFill.FILL_TYPE_NOFILL),r.put_fill(null),n.asc_putFill(r),this.shapeprops.put_TextArtProperties(n),this.api.ShapeApply(this.shapeprops)}}this.fireEvent("editcomplete",this)},onColorsBackSelect:function(e,t){this.btnBackColor.setColor(t),this.ShapeColor={Value:1,Color:t};if(this.api&&!this._noApply){var n=new Asc.asc_TextArtProperties,r=new Asc.asc_CShapeFill;this.ShapeColor.Color=="transparent"?(r.put_type(Asc.c_oAscFill.FILL_TYPE_NOFILL),r.put_fill(null)):(r.put_type(Asc.c_oAscFill.FILL_TYPE_SOLID),r.put_fill(new Asc.asc_CFillSolid),r.get_fill().put_color(Common.Utils.ThemeColor.getRgbColor(this.ShapeColor.Color))),n.asc_putFill(r),this.shapeprops.put_TextArtProperties(n),this.api.ShapeApply(this.shapeprops)}this.fireEvent("editcomplete",this)},addNewColor:function(e,t){e.addNewColor(typeof t.color=="object"?t.color.color:t.color)},onPatternSelect:function(e,t){if(this.api&&!this._noApply){this.PatternFillType=t.get("type");var n=new Asc.asc_TextArtProperties,r=new Asc.asc_CShapeFill;r.put_type(Asc.c_oAscFill.FILL_TYPE_PATT),r.put_fill(new Asc.asc_CFillHatch),r.get_fill().put_pattern_type(this.PatternFillType),this.OriginalFillType!==Asc.c_oAscFill.FILL_TYPE_PATT&&(r.get_fill().put_color_fg(Common.Utils.ThemeColor.getRgbColor(this.FGColor.Color)),r.get_fill().put_color_bg(Common.Utils.ThemeColor.getRgbColor(this.BGColor.Color))),n.asc_putFill(r),this.shapeprops.put_TextArtProperties(n),this.api.ShapeApply(this.shapeprops)}this.fireEvent("editcomplete",this)},onColorsFGSelect:function(e,t){this.btnFGColor.setColor(t),this.FGColor={Value:1,Color:t};if(this.api&&!this._noApply){var n=new Asc.asc_TextArtProperties,r=new Asc.asc_CShapeFill;r.put_type(Asc.c_oAscFill.FILL_TYPE_PATT),r.put_fill(new Asc.asc_CFillHatch),r.get_fill().put_color_fg(Common.Utils.ThemeColor.getRgbColor(this.FGColor.Color)),this.OriginalFillType!==Asc.c_oAscFill.FILL_TYPE_PATT&&(r.get_fill().put_pattern_type(this.PatternFillType),r.get_fill().put_color_bg(Common.Utils.ThemeColor.getRgbColor(this.BGColor.Color))),n.asc_putFill(r),this.shapeprops.put_TextArtProperties(n),this.api.ShapeApply(this.shapeprops)}this.fireEvent("editcomplete",this)},onColorsBGSelect:function(e,t){this.btnBGColor.setColor(t),this.BGColor={Value:1,Color:t};if(this.api&&!this._noApply){var n=new Asc.asc_TextArtProperties,r=new Asc.asc_CShapeFill;r.put_type(Asc.c_oAscFill.FILL_TYPE_PATT),r.put_fill(new Asc.asc_CFillHatch),this.OriginalFillType!==Asc.c_oAscFill.FILL_TYPE_PATT&&(r.get_fill().put_pattern_type(this.PatternFillType),r.get_fill().put_color_fg(Common.Utils.ThemeColor.getRgbColor(this.FGColor.Color))),r.get_fill().put_color_bg(Common.Utils.ThemeColor.getRgbColor(this.BGColor.Color)),n.asc_putFill(r),this.shapeprops.put_TextArtProperties(n),this.api.ShapeApply(this.shapeprops)}this.fireEvent("editcomplete",this)},onFillTypeSelect:function(e,t){this.BlipFillType=t.value;if(this.api&&this._fromTextureCmb!==!0&&this.OriginalFillType==Asc.c_oAscFill.FILL_TYPE_BLIP){var n=new Asc.asc_TextArtProperties,r=new Asc.asc_CShapeFill;r.put_type(Asc.c_oAscFill.FILL_TYPE_BLIP),r.put_fill(new Asc.asc_CFillBlip),r.get_fill().put_type(this.BlipFillType),n.asc_putFill(r),this.shapeprops.put_TextArtProperties(n),this.api.ShapeApply(this.shapeprops)}this.fireEvent("editcomplete",this)},onNumTransparencyChange:function(e,t,n,r){this.sldrTransparency.setValue(e.getNumberValue(),!0);if(this.api){var i=e.getNumberValue(),s=new Asc.asc_TextArtProperties,o=new Asc.asc_CShapeFill;o.put_transparent(i*2.55),s.asc_putFill(o),this.shapeprops.put_TextArtProperties(s),this.api.ShapeApply(this.shapeprops)}this.fireEvent("editcomplete",this)},onTransparencyChange:function(e,t,r){this._sliderChanged=t,this.numTransparency.setValue(t,!0),this._sendUndoPoint&&(this.api.setStartPointHistory(),this._sendUndoPoint=!1,this.updateslider=setInterval(n.bind(this._transparencyApplyFunc,this),100))},onTransparencyChangeComplete:function(e,t,n){clearInterval(this.updateslider),this._sliderChanged=t,this.api.setEndPointHistory(),this._transparencyApplyFunc(),this._sendUndoPoint=!0},_transparencyApplyFunc:function(){if(this._sliderChanged!==undefined){var e=new Asc.asc_TextArtProperties,t=new Asc.asc_CShapeFill;t.put_transparent(this._sliderChanged*2.55),e.asc_putFill(t),this.shapeprops.put_TextArtProperties(e),this.api.ShapeApply(this.shapeprops),this._sliderChanged=undefined}},onGradTypeSelect:function(e,t){this.GradFillType=t.value;if(this.GradFillType==Asc.c_oAscFillGradType.GRAD_LINEAR){this.mnuDirectionPicker.store.reset(this._viewDataLinear),this.mnuDirectionPicker.cmpEl.width(175),this.mnuDirectionPicker.restoreHeight=174;var t=this.mnuDirectionPicker.store.findWhere({type:this.GradLinearDirectionType});this.mnuDirectionPicker.selectRecord(t,!0),t?this.btnDirection.setIconCls("item-gradient "+t.get("iconcls")):this.btnDirection.setIconCls("")}else this.GradFillType==Asc.c_oAscFillGradType.GRAD_PATH&&(this.mnuDirectionPicker.store.reset(this._viewDataRadial),this.mnuDirectionPicker.cmpEl.width(60),this.mnuDirectionPicker.restoreHeight=58,this.mnuDirectionPicker.selectByIndex(this.GradRadialDirectionIdx,!0),this.GradRadialDirectionIdx>=0?this.btnDirection.setIconCls("item-gradient "+this._viewDataRadial[this.GradRadialDirectionIdx].iconcls):this.btnDirection.setIconCls(""));if(this.api&&!this._noApply){var n=new Asc.asc_TextArtProperties,r=new Asc.asc_CShapeFill;r.put_type(Asc.c_oAscFill.FILL_TYPE_GRAD),r.put_fill(new Asc.asc_CFillGrad),r.get_fill().put_grad_type(this.GradFillType),this.GradFillType==Asc.c_oAscFillGradType.GRAD_LINEAR&&(r.get_fill().put_linear_angle(this.GradLinearDirectionType*6e4),r.get_fill().put_linear_scale(!0)),n.asc_putFill(r),this.shapeprops.put_TextArtProperties(n),this.api.ShapeApply(this.shapeprops)}this.fireEvent("editcomplete",this)},onSelectGradient:function(e,t,r,i){if(this._noApply)return;var s={},o=n.isFunction(i.toJSON);if(o){if(!i.get("selected"))return;s=i.toJSON()}else s=i;this.btnDirection.setIconCls("item-gradient "+s.iconcls),this.GradFillType==Asc.c_oAscFillGradType.GRAD_LINEAR?this.GradLinearDirectionType=s.type:this.GradRadialDirectionIdx=0;if(this.api&&this.GradFillType==Asc.c_oAscFillGradType.GRAD_LINEAR){var u=new Asc.asc_TextArtProperties,a=new Asc.asc_CShapeFill;a.put_type(Asc.c_oAscFill.FILL_TYPE_GRAD),a.put_fill(new Asc.asc_CFillGrad),a.get_fill().put_grad_type(this.GradFillType),a.get_fill().put_linear_angle(s.type*6e4),a.get_fill().put_linear_scale(!0),u.asc_putFill(a),this.shapeprops.put_TextArtProperties(u),this.api.ShapeApply(this.shapeprops)}this.fireEvent("editcomplete",this)},onColorsGradientSelect:function(e,t){this.btnGradColor.setColor(t),this.GradColor.colors[this.GradColor.currentIdx]=t,this.sldrGradient.setColorValue(Common.Utils.String.format("#{0}",typeof t=="object"?t.color:t));if(this.api&&!this._noApply){var n=new Asc.asc_TextArtProperties,r=new Asc.asc_CShapeFill;r.put_type(Asc.c_oAscFill.FILL_TYPE_GRAD),r.put_fill(new Asc.asc_CFillGrad),r.get_fill().put_grad_type(this.GradFillType),r.get_fill().put_colors([Common.Utils.ThemeColor.getRgbColor(this.GradColor.colors[0]),Common.Utils.ThemeColor.getRgbColor(this.GradColor.colors[1])]),this.OriginalFillType!==Asc.c_oAscFill.FILL_TYPE_GRAD&&(this.GradFillType==Asc.c_oAscFillGradType.GRAD_LINEAR&&(r.get_fill().put_linear_angle(this.GradLinearDirectionType*6e4),r.get_fill().put_linear_scale(!0)),r.get_fill().put_positions([this.GradColor.values[0]*1e3,this.GradColor.values[1]*1e3])),n.asc_putFill(r),this.shapeprops.put_TextArtProperties(n),this.api.ShapeApply(this.shapeprops)}this.fireEvent("editcomplete",this)},onGradientChange:function(e,t,r){this.GradColor.values=e.getValues(),this._sliderChanged=!0,this.api&&!this._noApply&&this._sendUndoPoint&&(this.api.setStartPointHistory(),this._sendUndoPoint=!1,this.updateslider=setInterval(n.bind(this._gradientApplyFunc,this),100))},onGradientChangeComplete:function(e,t,n){clearInterval(this.updateslider),this._sliderChanged=!0,this.api.setEndPointHistory(),this._gradientApplyFunc(),this._sendUndoPoint=!0},_gradientApplyFunc:function(){if(this._sliderChanged){var e=new Asc.asc_TextArtProperties,t=new Asc.asc_CShapeFill;t.put_type(Asc.c_oAscFill.FILL_TYPE_GRAD),t.put_fill(new Asc.asc_CFillGrad),t.get_fill().put_grad_type(this.GradFillType),t.get_fill().put_positions([this.GradColor.values[0]*1e3,this.GradColor.values[1]*1e3]),this.OriginalFillType!==Asc.c_oAscFill.FILL_TYPE_GRAD&&(this.GradFillType==Asc.c_oAscFillGradType.GRAD_LINEAR&&(t.get_fill().put_linear_angle(this.GradLinearDirectionType*6e4),t.get_fill().put_linear_scale(!0)),t.get_fill().put_colors([Common.Utils.ThemeColor.getRgbColor(this.GradColor.colors[0]),Common.Utils.ThemeColor.getRgbColor(this.GradColor.colors[1])])),e.asc_putFill(t),this.shapeprops.put_TextArtProperties(e),this.api.ShapeApply(this.shapeprops),this._sliderChanged=!1}},applyBorderSize:function(e){e=parseFloat(e),e=isNaN(e)?0:Math.max(0,Math.min(1584,e)),this.BorderSize=e;if(this.api&&!this._noApply){var t=new Asc.asc_TextArtProperties,n=new Asc.asc_CStroke;this.BorderSize<.01?(n.put_type(Asc.c_oAscStrokeType.STROKE_NONE),this._state.StrokeType=this._state.StrokeWidth=-1):(n.put_type(Asc.c_oAscStrokeType.STROKE_COLOR),this.BorderColor.Color=="transparent"||this.BorderColor.Color.color=="transparent"?n.put_color(Common.Utils.ThemeColor.getRgbColor({color:"000000",effectId:29})):(this._state.StrokeType==Asc.c_oAscStrokeType.STROKE_NONE||this._state.StrokeType===null)&&n.put_color(Common.Utils.ThemeColor.getRgbColor(Common.Utils.ThemeColor.colorValue2EffectId(this.BorderColor.Color))),n.asc_putPrstDash(this.BorderType),n.put_width(this._pt2mm(this.BorderSize))),t.asc_putLine(n),this.shapeprops.put_TextArtProperties(t),this.api.ShapeApply(this.shapeprops)}this.fireEvent("editcomplete",this)},onComboBlur:function(){this.fireEvent("editcomplete",this)},onBorderSizeChanged:function(e,t,r,i){var s=this;if(e){var o=parseFloat(r.value),u=new RegExp("^\\s*(\\d*(\\.|,)?\\d+)\\s*("+s.txtPt+")?\\s*$");if(!u.exec(r.value)||o<0||o>1584)this._state.StrokeType=this._state.StrokeWidth=-1,Common.UI.error({msg:this.textBorderSizeErr,callback:function(){n.defer(function(e){s.fireEvent("editcomplete",s)})}})}else this.applyBorderSize(r.value)},onBorderSizeSelect:function(e,t){this.applyBorderSize(t.value)},onBorderTypeSelect:function(e,t){this.BorderType=t.value;if(this.api&&!this._noApply){var n=new Asc.asc_TextArtProperties,r=new Asc.asc_CStroke;this.BorderSize<.01?r.put_type(Asc.c_oAscStrokeType.STROKE_NONE):(r.put_type(Asc.c_oAscStrokeType.STROKE_COLOR),r.put_color(Common.Utils.ThemeColor.getRgbColor(this.BorderColor.Color)),r.put_width(this._pt2mm(this.BorderSize)),r.asc_putPrstDash(this.BorderType)),n.asc_putLine(r),this.shapeprops.put_TextArtProperties(n),this.api.ShapeApply(this.shapeprops)}this.fireEvent("editcomplete",this)},onColorsBorderSelect:function(e,t){this.btnBorderColor.setColor(t),this.BorderColor={Value:1,Color:t};if(this.api&&this.BorderSize>0&&!this._noApply){var n=new Asc.asc_TextArtProperties,r=new Asc.asc_CStroke;this.BorderSize<.01?r.put_type(Asc.c_oAscStrokeType.STROKE_NONE):(r.put_type(Asc.c_oAscStrokeType.STROKE_COLOR),r.put_color(Common.Utils.ThemeColor.getRgbColor(this.BorderColor.Color)),r.put_width(this._pt2mm(this.BorderSize)),r.asc_putPrstDash(this.BorderType)),n.asc_putLine(r),this.shapeprops.put_TextArtProperties(n),this.api.ShapeApply(this.shapeprops)}this.fireEvent("editcomplete",this)},insertFromUrl:function(){var e=this;(new Common.Views.ImageFromUrlDialog({handler:function(t,r){if(t=="ok"&&e.api){var i=r.replace(/ /g,"");if(!n.isEmpty(i)&&e.BlipFillType!==null){var s=new Asc.asc_TextArtProperties,o=new Asc.asc_CShapeFill;o.put_type(Asc.c_oAscFill.FILL_TYPE_BLIP),o.put_fill(new Asc.asc_CFillBlip),o.get_fill().put_type(e.BlipFillType),o.get_fill().put_url(i),s.asc_putFill(o),e.shapeprops.put_TextArtProperties(s),e.api.ShapeApply(e.shapeprops)}}e.fireEvent("editcomplete",e)}})).show()},ChangeSettings:function(e){this.shapeprops==null&&(this.shapeprops=new Asc.asc_CShapeProperty),this._initSettings&&this.createDelayedElements();if(e&&e.get_TextArtProperties()){var r=e.get_TextArtProperties();this._noApply=!0,this.disableControls(this._locked);var i=null,s=r.asc_getFill(),o=s?s.get_type():null,u=null;if(s){var a=s.get_transparent();if(Math.abs(this._state.Transparency-a)>.001||Math.abs(this.numTransparency.getNumberValue()-a)>.001||(this._state.Transparency===null||a===null)&&(this._state.Transparency!==a||this.numTransparency.getNumberValue()!==a))a!==undefined&&(this.sldrTransparency.setValue(a===null?100:a/255*100,!0),this.numTransparency.setValue(this.sldrTransparency.getValue(),!0)),this._state.Transparency=a}if(s===null||s===undefined||o===null)this.OriginalFillType=null;else if(o==Asc.c_oAscFill.FILL_TYPE_NOFILL)this.OriginalFillType=Asc.c_oAscFill.FILL_TYPE_NOFILL;else if(o==Asc.c_oAscFill.FILL_TYPE_SOLID)s=s.get_fill(),u=s.get_color(),u?u.get_type()==Asc.c_oAscColor.COLOR_TYPE_SCHEME?this.ShapeColor={Value:1,Color:{color:Common.Utils.ThemeColor.getHexColor(u.get_r(),u.get_g(),u.get_b()),effectValue:u.get_value()}}:this.ShapeColor={Value:1,Color:Common.Utils.ThemeColor.getHexColor(u.get_r(),u.get_g(),u.get_b())}:this.ShapeColor={Value:0,Color:"transparent"},this.OriginalFillType=Asc.c_oAscFill.FILL_TYPE_SOLID,this.FGColor=this.ShapeColor.Color!=="transparent"?{Value:1,Color:Common.Utils.ThemeColor.colorValue2EffectId(this.ShapeColor.Color)}:{Value:1,Color:"000000"},this.BGColor={Value:1,Color:"ffffff"},this.GradColor.colors[0]=this.ShapeColor.Color!=="transparent"?Common.Utils.ThemeColor.colorValue2EffectId(this.ShapeColor.Color):"000000",this.GradColor.colors[1]="ffffff";else if(o==Asc.c_oAscFill.FILL_TYPE_BLIP)s=s.get_fill(),this.BlipFillType=s.get_type(),this._state.BlipFillType!==this.BlipFillType&&(this.BlipFillType==Asc.c_oAscFillBlipType.STRETCH||this.BlipFillType==Asc.c_oAscFillBlipType.TILE?this.cmbFillType.setValue(this.BlipFillType):this.cmbFillType.setValue(""),this._state.BlipFillType=this.BlipFillType),this.OriginalFillType=Asc.c_oAscFill.FILL_TYPE_BLIP;else if(o==Asc.c_oAscFill.FILL_TYPE_PATT){s=s.get_fill(),this.PatternFillType=s.get_pattern_type();if(this._state.PatternFillType!==this.PatternFillType){this.cmbPattern.suspendEvents();var i=this.cmbPattern.menuPicker.store.findWhere({type:this.PatternFillType});this.cmbPattern.menuPicker.selectRecord(i),this.cmbPattern.resumeEvents(),this._state.PatternFillType=this.PatternFillType}u=s.get_color_fg(),u?u.get_type()==Asc.c_oAscColor.COLOR_TYPE_SCHEME?this.FGColor={Value:1,Color:{color:Common.Utils.ThemeColor.getHexColor(u.get_r(),u.get_g(),u.get_b()),effectValue:u.get_value()}}:this.FGColor={Value:1,Color:Common.Utils.ThemeColor.getHexColor(u.get_r(),u.get_g(),u.get_b())}:this.FGColor={Value:1,Color:"000000"},u=s.get_color_bg(),u?u.get_type()==Asc.c_oAscColor.COLOR_TYPE_SCHEME?this.BGColor={Value:1,Color:{color:Common.Utils.ThemeColor.getHexColor(u.get_r(),u.get_g(),u.get_b()),effectValue:u.get_value()}}:this.BGColor={Value:1,Color:Common.Utils.ThemeColor.getHexColor(u.get_r(),u.get_g(),u.get_b())}:this.BGColor={Value:1,Color:"ffffff"},this.OriginalFillType=Asc.c_oAscFill.FILL_TYPE_PATT,this.ShapeColor={Value:1,Color:Common.Utils.ThemeColor.colorValue2EffectId(this.FGColor.Color)},this.GradColor.colors[0]=Common.Utils.ThemeColor.colorValue2EffectId(this.FGColor.Color),this.GradColor.colors[1]="ffffff"}else if(o==Asc.c_oAscFill.FILL_TYPE_GRAD){s=s.get_fill();var f=s.get_grad_type();if(this._state.GradFillType!==f||this.GradFillType!==f)this.GradFillType=f,i=undefined,this.GradFillType==Asc.c_oAscFillGradType.GRAD_LINEAR||this.GradFillType==Asc.c_oAscFillGradType.GRAD_PATH?(this.cmbGradType.setValue(this.GradFillType),i=this.cmbGradType.store.findWhere({value:this.GradFillType}),this.onGradTypeSelect(this.cmbGradType,i.attributes)):(this.cmbGradType.setValue(""),this.btnDirection.setIconCls("")),this._state.GradFillType=this.GradFillType;if(this.GradFillType==Asc.c_oAscFillGradType.GRAD_LINEAR){var l=Math.floor(s.get_linear_angle()/6e4);if(Math.abs(this.GradLinearDirectionType-l)>.001){this.GradLinearDirectionType=l;var c=this.mnuDirectionPicker.store.findWhere({type:l});this.mnuDirectionPicker.selectRecord(c,!0),c?this.btnDirection.setIconCls("item-gradient "+c.get("iconcls")):this.btnDirection.setIconCls("")}}var h=s.get_colors();h&&h.length>0&&(u=h[0],u?u.get_type()==Asc.c_oAscColor.COLOR_TYPE_SCHEME?(this.GradColor.colors[0]={color:Common.Utils.ThemeColor.getHexColor(u.get_r(),u.get_g(),u.get_b()),effectValue:u.get_value()},Common.Utils.ThemeColor.colorValue2EffectId(this.GradColor.colors[0])):this.GradColor.colors[0]=Common.Utils.ThemeColor.getHexColor(u.get_r(),u.get_g(),u.get_b()):this.GradColor.colors[0]="000000",u=h[1],u?u.get_type()==Asc.c_oAscColor.COLOR_TYPE_SCHEME?(this.GradColor.colors[1]={color:Common.Utils.ThemeColor.getHexColor(u.get_r(),u.get_g(),u.get_b()),effectValue:u.get_value()},Common.Utils.ThemeColor.colorValue2EffectId(this.GradColor.colors[1])):this.GradColor.colors[1]=Common.Utils.ThemeColor.getHexColor(u.get_r(),u.get_g(),u.get_b()):this.GradColor.colors[1]="ffffff");var p=s.get_positions();if(p&&p.length>0){var d=p[0];d!==null&&(d/=1e3,this.GradColor.values[0]=d),d=p[1],d!==null&&(d/=1e3,this.GradColor.values[1]=d)}this.sldrGradient.setColorValue(Common.Utils.String.format("#{0}",typeof this.GradColor.colors[0]=="object"?this.GradColor.colors[0].color:this.GradColor.colors[0]),0),this.sldrGradient.setColorValue(Common.Utils.String.format("#{0}",typeof this.GradColor.colors[1]=="object"?this.GradColor.colors[1].color:this.GradColor.colors[1]),1),this.sldrGradient.setValue(0,this.GradColor.values[0]),this.sldrGradient.setValue(1,this.GradColor.values[1]),this.OriginalFillType=Asc.c_oAscFill.FILL_TYPE_GRAD,this.FGColor={Value:1,Color:this.GradColor.colors[0]},this.BGColor={Value:1,Color:"ffffff"},this.ShapeColor={Value:1,Color:this.GradColor.colors[0]}}this._state.FillType!==this.OriginalFillType&&(this.cmbFillSrc.setValue(this.OriginalFillType===null?"":this.OriginalFillType),this._state.FillType=this.OriginalFillType,this.ShowHideElem(this.OriginalFillType)),t(this.btnTexture.el).find(".form-control").prop("innerHTML",this.textSelectTexture);var v=typeof this.ShapeColor.Color,m=typeof this._state.ShapeColor;if(v!==m||v=="object"&&(this.ShapeColor.Color.effectValue!==this._state.ShapeColor.effectValue||this._state.ShapeColor.color.indexOf(this.ShapeColor.Color.color)<0)||v!="object"&&this._state.ShapeColor.indexOf(this.ShapeColor.Color)<0){this.btnBackColor.setColor(this.ShapeColor.Color);if(typeof this.ShapeColor.Color=="object"){var g=!1;for(var y=0;y<10;y++)if(Common.Utils.ThemeColor.ThemeValues[y]==this.ShapeColor.Color.effectValue){this.colorsBack.select(this.ShapeColor.Color,!0),g=!0;break}g||this.colorsBack.clearSelection()}else this.colorsBack.select(this.ShapeColor.Color,!0);this._state.ShapeColor=this.ShapeColor.Color}var b=r.asc_getLine(),w=b?b.get_type():null,E;b?(w==Asc.c_oAscStrokeType.STROKE_COLOR?(u=b.get_color(),u?u.get_type()==Asc.c_oAscColor.COLOR_TYPE_SCHEME?this.BorderColor={Value:1,Color:{color:Common.Utils.ThemeColor.getHexColor(u.get_r(),u.get_g(),u.get_b()),effectValue:u.get_value()}}:this.BorderColor={Value:1,Color:Common.Utils.ThemeColor.getHexColor(u.get_r(),u.get_g(),u.get_b())}:this.BorderColor={Value:1,Color:"transparent"}):this.BorderColor={Value:1,Color:"transparent"},E=b.asc_getPrstDash()):this.BorderColor={Value:0,Color:"transparent"},v=typeof this.BorderColor.Color,m=typeof this._state.StrokeColor;if(v!==m||v=="object"&&(this.BorderColor.Color.effectValue!==this._state.StrokeColor.effectValue||this._state.StrokeColor.color.indexOf(this.BorderColor.Color.color)<0)||v!="object"&&(this._state.StrokeColor.indexOf(this.BorderColor.Color)<0||typeof this.btnBorderColor.color=="object")){this.btnBorderColor.setColor(this.BorderColor.Color);if(typeof this.BorderColor.Color=="object"){var g=!1;for(var y=0;y<10;y++)if(Common.Utils.ThemeColor.ThemeValues[y]==this.BorderColor.Color.effectValue){this.colorsBorder.select(this.BorderColor.Color,!0),g=!0;break}g||this.colorsBorder.clearSelection()}else this.colorsBorder.select(this.BorderColor.Color,!0);this._state.StrokeColor=this.BorderColor.Color}if(this._state.StrokeType!==w||w==Asc.c_oAscStrokeType.STROKE_COLOR){if(w==Asc.c_oAscStrokeType.STROKE_COLOR){var S=b.get_width(),x=Math.abs(this._state.StrokeWidth-S)<.001&&!(new RegExp(this.txtPt+"\\s*$")).test(this.cmbBorderSize.getRawValue());if(Math.abs(this._state.StrokeWidth-S)>.001||x||(this._state.StrokeWidth===null||S===null)&&this._state.StrokeWidth!==S){this._state.StrokeWidth=S,S!==null&&(S=this._mm2pt(S));var T=S===null?S:n.find(this.cmbBorderSize.store.models,function(e){if(Se.attributes.value-.01)return!0});T?this.cmbBorderSize.selectRecord(T):this.cmbBorderSize.setValue(S!==null?parseFloat(S.toFixed(2))+" "+this.txtPt:""),this.BorderSize=S}}else w==Asc.c_oAscStrokeType.STROKE_NONE?(this._state.StrokeWidth=0,this.BorderSize=this.cmbBorderSize.store.at(0).get("value"),this.cmbBorderSize.setValue(this.BorderSize)):(this._state.StrokeWidth=null,this.BorderSize=-1,this.cmbBorderSize.setValue(null));this._state.StrokeType=w}this._state.StrokeBorderType!==E&&(this.BorderType=this._state.StrokeBorderType=E,this.cmbBorderType.setValue(E)),v=typeof this.FGColor.Color,m=typeof this._state.FGColor;if(v!==m||v=="object"&&(this.FGColor.Color.effectValue!==this._state.FGColor.effectValue||this._state.FGColor.color.indexOf(this.FGColor.Color.color)<0)||v!="object"&&this._state.FGColor.indexOf(this.FGColor.Color)<0){this.btnFGColor.setColor(this.FGColor.Color);if(typeof this.FGColor.Color=="object"){var g=!1;for(var y=0;y<10;y++)if(Common.Utils.ThemeColor.ThemeValues[y]==this.FGColor.Color.effectValue){this.colorsFG.select(this.FGColor.Color,!0),g=!0;break}g||this.colorsFG.clearSelection()}else this.colorsFG.select(this.FGColor.Color,!0);this._state.FGColor=this.FGColor.Color}v=typeof this.BGColor.Color,m=typeof this._state.BGColor;if(v!==m||v=="object"&&(this.BGColor.Color.effectValue!==this._state.BGColor.effectValue||this._state.BGColor.color.indexOf(this.BGColor.Color.color)<0)||v!="object"&&this._state.BGColor.indexOf(this.BGColor.Color)<0){this.btnBGColor.setColor(this.BGColor.Color);if(typeof this.BGColor.Color=="object"){var g=!1;for(var y=0;y<10;y++)if(Common.Utils.ThemeColor.ThemeValues[y]==this.BGColor.Color.effectValue){this.colorsBG.select(this.BGColor.Color,!0),g=!0;break}g||this.colorsBG.clearSelection()}else this.colorsBG.select(this.BGColor.Color,!0);this._state.BGColor=this.BGColor.Color}u=this.GradColor.colors[this.GradColor.currentIdx],v=typeof u,m=typeof this._state.GradColor;if(v!==m||v=="object"&&(u.effectValue!==this._state.GradColor.effectValue||this._state.GradColor.color.indexOf(u.color)<0)||v!="object"&&this._state.GradColor.indexOf(u)<0){this.btnGradColor.setColor(u);if(typeof u=="object"){var g=!1;for(var y=0;y<10;y++)if(Common.Utils.ThemeColor.ThemeValues[y]==u.effectValue){this.colorsGrad.select(u,!0),g=!0;break}g||this.colorsGrad.clearSelection()}else this.colorsGrad.select(u,!0);this._state.GradColor=u}var N=r.asc_getForm();if(this._state.FormId!==N){this.cmbTransform.suspendEvents();var i=this.cmbTransform.menuPicker.store.findWhere({type:N});this.cmbTransform.menuPicker.selectRecord(i),this.cmbTransform.resumeEvents(),this._state.FormId=N}this._noApply=!1}},createDelayedControls:function(){var e=this;this._arrFillSrc=[{displayValue:this.textColor,value:Asc.c_oAscFill.FILL_TYPE_SOLID},{displayValue:this.textGradientFill,value:Asc.c_oAscFill.FILL_TYPE_GRAD},{displayValue:this.textImageTexture,value:Asc.c_oAscFill.FILL_TYPE_BLIP},{displayValue:this.textPatternFill,value:Asc.c_oAscFill.FILL_TYPE_PATT},{displayValue:this.textNoFill,value:Asc.c_oAscFill.FILL_TYPE_NOFILL}],this.cmbFillSrc=new Common.UI.ComboBox({el:t("#textart-combo-fill-src"),cls:"input-group-nr",style:"width: 100%;",menuStyle:"min-width: 190px;",editable:!1,data:this._arrFillSrc}),this.cmbFillSrc.setValue(this._arrFillSrc[0].value),this.cmbFillSrc.on("selected",n.bind(this.onFillSrcSelect,this)),this.lockedControls.push(this.cmbFillSrc),this.cmbPattern=new Common.UI.ComboDataView({itemWidth:28,itemHeight:28,menuMaxHeight:300,enableKeyEvents:!0,cls:"combo-pattern"}),this.cmbPattern.menuPicker.itemTemplate=this.cmbPattern.fieldPicker.itemTemplate=n.template(['
    ','',"
    "].join("")),this.cmbPattern.render(t("#textart-combo-pattern")),this.cmbPattern.openButton.menu.cmpEl.css({"min-width":178,"max-width":178}),this.cmbPattern.on("click",n.bind(this.onPatternSelect,this)),this.cmbPattern.openButton.menu.on("show:after",function(){e.cmbPattern.menuPicker.scroller.update({alwaysVisibleY:!0})}),this.lockedControls.push(this.cmbPattern),this.btnInsertFromFile=new Common.UI.Button({el:t("#textart-button-from-file")}),this.lockedControls.push(this.btnInsertFromFile),this.btnInsertFromUrl=new Common.UI.Button({el:t("#textart-button-from-url")}),this.lockedControls.push(this.btnInsertFromUrl),this.btnInsertFromFile.on("click",n.bind(function(e){this.api&&this.api.ChangeArtImageFromFile(),this.fireEvent("editcomplete",this)},this)),this.btnInsertFromUrl.on("click",n.bind(this.insertFromUrl,this)),this._arrFillType=[{displayValue:this.textStretch,value:Asc.c_oAscFillBlipType.STRETCH},{displayValue:this.textTile,value:Asc.c_oAscFillBlipType.TILE}],this.cmbFillType=new Common.UI.ComboBox({el:t("#textart-combo-fill-type"),cls:"input-group-nr",menuStyle:"min-width: 90px;",editable:!1,data:this._arrFillType}),this.cmbFillType.setValue(this._arrFillType[0].value),this.cmbFillType.on("selected",n.bind(this.onFillTypeSelect,this)),this.lockedControls.push(this.cmbFillType),this.numTransparency=new Common.UI.MetricSpinner({el:t("#textart-spin-transparency"),step:1,width:62,value:"100 %",defaultUnit:"%",maxValue:100,minValue:0}),this.numTransparency.on("change",n.bind(this.onNumTransparencyChange,this)),this.lockedControls.push(this.numTransparency),this.sldrTransparency=new Common.UI.SingleSlider({el:t("#textart-slider-transparency"),width:75,minValue:0,maxValue:100,value:100}),this.sldrTransparency.on("change",n.bind(this.onTransparencyChange,this)),this.sldrTransparency.on("changecomplete",n.bind(this.onTransparencyChangeComplete,this)),this.lockedControls.push(this.sldrTransparency),this.lblTransparencyStart=t(this.el).find("#textart-lbl-transparency-start"),this.lblTransparencyEnd=t(this.el).find("#textart-lbl-transparency-end"),this._arrGradType=[{displayValue:this.textLinear,value:Asc.c_oAscFillGradType.GRAD_LINEAR},{displayValue:this.textRadial,value:Asc.c_oAscFillGradType.GRAD_PATH}],this.cmbGradType=new Common.UI.ComboBox({el:t("#textart-combo-grad-type"),cls:"input-group-nr",menuStyle:"min-width: 90px;",editable:!1,data:this._arrGradType}),this.cmbGradType.setValue(this._arrGradType[0].value),this.cmbGradType.on("selected",n.bind(this.onGradTypeSelect,this)),this.lockedControls.push(this.cmbGradType),this._viewDataLinear=[{offsetx:0,offsety:0,type:45,subtype:-1,iconcls:"gradient-left-top"},{offsetx:50,offsety:0,type:90,subtype:4,iconcls:"gradient-top"},{offsetx:100,offsety:0,type:135,subtype:5,iconcls:"gradient-right-top"},{offsetx:0,offsety:50,type:0,subtype:6,iconcls:"gradient-left",cls:"item-gradient-separator",selected:!0},{offsetx:100,offsety:50,type:180,subtype:1,iconcls:"gradient-right"},{offsetx:0,offsety:100,type:315,subtype:2,iconcls:"gradient-left-bottom"},{offsetx:50,offsety:100,type:270,subtype:3,iconcls:"gradient-bottom"},{offsetx:100,offsety:100,type:225,subtype:7,iconcls:"gradient-right-bottom"}],this._viewDataRadial=[{offsetx:100,offsety:150,type:2,subtype:5,iconcls:"gradient-radial-center"}],this.btnDirection=new Common.UI.Button({cls:"btn-large-dataview",iconCls:"item-gradient gradient-left",menu:new Common.UI.Menu({style:"min-width: 60px;",menuAlign:"tr-br",items:[{template:n.template('
    ')}]})}),this.btnDirection.on("render:after",function(r){e.mnuDirectionPicker=new Common.UI.DataView({el:t("#id-textart-menu-direction"),parentMenu:r.menu,restoreHeight:174,store:new Common.UI.DataViewStore(e._viewDataLinear),itemTemplate:n.template('
    ')})}),this.btnDirection.render(t("#textart-button-direction")),this.mnuDirectionPicker.on("item:click",n.bind(this.onSelectGradient,this,this.btnDirection)),this.lockedControls.push(this.btnDirection),this.sldrGradient=new Common.UI.MultiSliderGradient({el:t("#textart-slider-gradient"),width:125,minValue:0,maxValue:100,values:[0,100]}),this.sldrGradient.on("change",n.bind(this.onGradientChange,this)),this.sldrGradient.on("changecomplete",n.bind(this.onGradientChangeComplete,this)),this.sldrGradient.on("thumbclick",function(t,n){e.GradColor.currentIdx=n;var r=e.GradColor.colors[e.GradColor.currentIdx];e.btnGradColor.setColor(r),e.colorsGrad.select(r,!1)}),this.sldrGradient.on("thumbdblclick",function(t){e.btnGradColor.cmpEl.find("button").dropdown("toggle")}),this.lockedControls.push(this.sldrGradient),this.cmbBorderSize=(new Common.UI.ComboBorderSizeEditable({el:t("#textart-combo-border-size"),style:"width: 93px;",txtNoBorders:this.txtNoBorders})).on("selected",n.bind(this.onBorderSizeSelect,this)).on("changed:before",n.bind(this.onBorderSizeChanged,this,!0)).on("changed:after",n.bind(this.onBorderSizeChanged,this,!1)).on("combo:blur",n.bind(this.onComboBlur,this,!1)),this.BorderSize=this.cmbBorderSize.store.at(2).get("value"),this.cmbBorderSize.setValue(this.BorderSize),this.lockedControls.push(this.cmbBorderSize),this.cmbBorderType=(new Common.UI.ComboBorderType({el:t("#textart-combo-border-type"),style:"width: 93px;",menuStyle:"min-width: 93px;"})).on("selected",n.bind(this.onBorderTypeSelect,this)).on("combo:blur",n.bind(this.onComboBlur,this,!1)),this.BorderType=Asc.c_oDashType.solid,this.cmbBorderType.setValue(this.BorderType),this.lockedControls.push(this.cmbBorderType),this.cmbTransform=new Common.UI.ComboDataView({itemWidth:50,itemHeight:50,menuMaxHeight:300,enableKeyEvents:!0,cls:"combo-textart"}),this.cmbTransform.render(t("#textart-combo-transform")),this.cmbTransform.openButton.menu.cmpEl.css({"min-width":178,"max-width":178}),this.cmbTransform.on("click",n.bind(this.onTransformSelect,this)),this.cmbTransform.openButton.menu.on("show:after",function(){e.cmbTransform.menuPicker.scroller.update({alwaysVisibleY:!0})}),this.lockedControls.push(this.cmbTransform)},createDelayedElements:function(){this.createDelayedControls();var e=[0,1,3,2,4,53,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,22,23,24,25,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,49,50,51,52];this.patternViewData=[];for(var t=0;t<13;t++)for(var n=0;n<4;n++){var r=t*4+n;this.patternViewData[r]={offsetx:n*28,offsety:t*28,type:e[r]}}this.patternViewData.splice(this.patternViewData.length-2,2);for(var t=0;t0&&(this.cmbPattern.fillComboView(this.cmbPattern.menuPicker.store.at(0),!0),this.PatternFillType=this.patternViewData[0].type),this.UpdateThemeColors(),this.fillTransform(this.api.asc_getPropertyEditorTextArts()),this._initSettings=!1},onInitStandartTextures:function(e){var r=this;if(e&&e.length>0){this.btnTexture||(this.btnTexture=new Common.UI.ComboBox({el:t("#textart-combo-fill-texture"),template:n.template(['"].join(""))}),this.textureMenu=new Common.UI.Menu({items:[{template:n.template('
    ')}]}),this.textureMenu.render(t("#textart-combo-fill-texture")),this.lockedControls.push(this.btnTexture));var i=[];n.each(e,function(e){i.push({imageUrl:e.get_image(),name:r.textureNames[e.get_id()],type:e.get_id(),selected:!1})});var s=new Common.UI.DataView({el:t("#id-textart-menu-texture"),restoreHeight:174,parentMenu:r.textureMenu,showLast:!1,store:new Common.UI.DataViewStore(i),itemTemplate:n.template('
    ')});s.on("item:click",n.bind(this.onSelectTexture,this))}},onSelectTexture:function(e,n,r){this._fromTextureCmb=!0,this.cmbFillType.setValue(this._arrFillType[1].value),this._fromTextureCmb=!1;if(this.api){var i=new Asc.asc_TextArtProperties,s=new Asc.asc_CShapeFill;s.put_type(Asc.c_oAscFill.FILL_TYPE_BLIP),s.put_fill(new Asc.asc_CFillBlip),s.get_fill().put_type(Asc.c_oAscFillBlipType.TILE),s.get_fill().put_texture_id(r.get("type")),i.asc_putFill(s),this.shapeprops.put_TextArtProperties(i),this.api.ShapeApply(this.shapeprops)}t(this.btnTexture.el).find(".form-control").prop("innerHTML",r.get("name")),this.fireEvent("editcomplete",this)},fillTextArt:function(){var e=this;this.cmbTextArt||(this.cmbTextArt=new Common.UI.ComboDataView({itemWidth:50,itemHeight:50,menuMaxHeight:300,enableKeyEvents:!0,showLast:!1,cls:"combo-textart"}),this.cmbTextArt.render(t("#textart-combo-template")),this.cmbTextArt.openButton.menu.cmpEl.css({"min-width":178,"max-width":178}),this.cmbTextArt.on("click",n.bind(this.onTextArtSelect,this)),this.cmbTextArt.openButton.menu.on("show:after",function(){e.cmbTextArt.menuPicker.scroller.update({alwaysVisibleY:!0})}),this.lockedControls.push(this.cmbTextArt));var r=this.application.getCollection("Common.Collections.TextArt").models,i=this.cmbTextArt.menuPicker.store.length;if(i>0&&i==r.length){var s=this.cmbTextArt.menuPicker.store.models;n.each(r,function(e,t){s[t].set("imageUrl",e.get("imageUrl"))})}else this.cmbTextArt.menuPicker.store.reset(r),this.cmbTextArt.menuPicker.store.length>0&&this.cmbTextArt.fillComboView(this.cmbTextArt.menuPicker.store.at(0))},onTextArtSelect:function(e,t){if(this.api&&!this._noApply){var n=new Asc.asc_TextArtProperties;n.asc_putStyle(t.get("data")),this.shapeprops.put_TextArtProperties(n),this.api.ShapeApply(this.shapeprops)}this.fireEvent("editcomplete",this)},fillTransform:function(e){if(e&&e.length>1&&e[1]){var t=this,r=[],i=e[1];for(var s=0;s0&&n.each(o,function(e){r.push({imageUrl:e.Image,type:e.Type,selected:!1})})}this.cmbTransform.menuPicker.store.add(r),this.cmbTransform.menuPicker.store.length>0&&this.cmbTransform.fillComboView(this.cmbTransform.menuPicker.store.at(0),!0)}},onTransformSelect:function(e,t){if(this.api&&!this._noApply){var n=new Asc.asc_TextArtProperties;n.asc_putForm(t.get("type")),this.shapeprops.put_TextArtProperties(n),this.api.ShapeApply(this.shapeprops)}this.fireEvent("editcomplete",this)},UpdateThemeColors:function(){this.btnBackColor||(this.btnBackColor=new Common.UI.ColorButton({style:"width:45px;",menu:new Common.UI.Menu({items:[{template:n.template('
    ')},{template:n.template(''+this.textNewColor+"")}]})}),this.btnBackColor.render(t("#textart-back-color-btn")),this.btnBackColor.setColor("transparent"),this.lockedControls.push(this.btnBackColor),this.colorsBack=new Common.UI.ThemeColorPalette({el:t("#textart-back-color-menu"),value:"transparent",transparent:!0}),this.colorsBack.on("select",n.bind(this.onColorsBackSelect,this)),t(this.el).on("click","#textart-back-color-new",n.bind(this.addNewColor,this,this.colorsBack,this.btnBackColor)),this.btnFGColor=new Common.UI.ColorButton({style:"width:45px;",menu:new Common.UI.Menu({items:[{template:n.template('
    ')},{template:n.template(''+this.textNewColor+"")}]})}),this.btnFGColor.render(t("#textart-foreground-color-btn")),this.btnFGColor.setColor("000000"),this.lockedControls.push(this.btnFGColor),this.colorsFG=new Common.UI.ThemeColorPalette({el:t("#textart-foreground-color-menu"),value:"000000"}),this.colorsFG.on("select",n.bind(this.onColorsFGSelect,this)),t(this.el).on("click","#textart-foreground-color-new",n.bind(this.addNewColor,this,this.colorsFG,this.btnFGColor)),this.btnBGColor=new Common.UI.ColorButton({style:"width:45px;",menu:new Common.UI.Menu({items:[{template:n.template('
    ')},{template:n.template(''+this.textNewColor+"")}]})}),this.btnBGColor.render(t("#textart-background-color-btn")),this.btnBGColor.setColor("ffffff"),this.lockedControls.push(this.btnBGColor),this.colorsBG=new Common.UI.ThemeColorPalette({el:t("#textart-background-color-menu"),value:"ffffff"}),this.colorsBG.on("select",n.bind(this.onColorsBGSelect,this)),t(this.el).on("click","#textart-background-color-new",n.bind(this.addNewColor,this,this.colorsBG,this.btnBGColor)),this.btnGradColor=new Common.UI.ColorButton({style:"width:45px;",menu:new Common.UI.Menu({items:[{template:n.template('
    ')},{template:n.template(''+this.textNewColor+"")}]})}),this.btnGradColor.render(t("#textart-gradient-color-btn")),this.btnGradColor.setColor("000000"),this.lockedControls.push(this.btnGradColor),this.colorsGrad=new Common.UI.ThemeColorPalette({el:t("#textart-gradient-color-menu"),value:"000000"}),this.colorsGrad.on("select",n.bind(this.onColorsGradientSelect,this)),t(this.el).on("click","#textart-gradient-color-new",n.bind(this.addNewColor,this,this.colorsGrad,this.btnGradColor)),this.btnBorderColor=new Common.UI.ColorButton({style:"width:45px;",menu:new Common.UI.Menu({items:[{template:n.template('
    ')},{template:n.template(''+this.textNewColor+"")}]})}),this.btnBorderColor.render(t("#textart-border-color-btn")),this.btnBorderColor.setColor("000000"),this.lockedControls.push(this.btnBorderColor),this.colorsBorder=new Common.UI.ThemeColorPalette({el:t("#textart-border-color-menu"),value:"000000"}),this.colorsBorder.on("select",n.bind(this.onColorsBorderSelect,this)),t(this.el).on("click","#textart-border-color-new",n.bind(this.addNewColor,this,this.colorsBorder,this.btnBorderColor))),this.colorsBorder.updateColors(Common.Utils.ThemeColor.getEffectColors(),Common.Utils.ThemeColor.getStandartColors()),this.colorsBack.updateColors(Common.Utils.ThemeColor.getEffectColors(),Common.Utils.ThemeColor.getStandartColors()),this.colorsFG.updateColors(Common.Utils.ThemeColor.getEffectColors(),Common.Utils.ThemeColor.getStandartColors()),this.colorsBG.updateColors(Common.Utils.ThemeColor.getEffectColors(),Common.Utils.ThemeColor.getStandartColors()),this.colorsGrad.updateColors(Common.Utils.ThemeColor.getEffectColors(),Common.Utils.ThemeColor.getStandartColors())},_pt2mm:function(e){return e*25.4/72},_mm2pt:function(e){return e*72/25.4},ShowHideElem:function(e){this.FillColorContainer.toggleClass("settings-hidden",e!==Asc.c_oAscFill.FILL_TYPE_SOLID),this.FillImageContainer.toggleClass("settings-hidden",e!==Asc.c_oAscFill.FILL_TYPE_BLIP),this.FillPatternContainer.toggleClass("settings-hidden",e!==Asc.c_oAscFill.FILL_TYPE_PATT),this.FillGradientContainer.toggleClass("settings-hidden",e!==Asc.c_oAscFill.FILL_TYPE_GRAD),this.TransparencyContainer.toggleClass("settings-hidden",e===Asc.c_oAscFill.FILL_TYPE_NOFILL||e===null)},setLocked:function(e){this._locked=e},disableControls:function(e){if(this._initSettings)return;this._state.DisabledControls!==e&&(this._state.DisabledControls=e,n.each(this.lockedControls,function(t){t.setDisabled(e)}))},txtNoBorders:"No Line",strStroke:"Stroke",strColor:"Color",strSize:"Size",strFill:"Fill",textColor:"Color Fill",textImageTexture:"Picture or Texture",textTexture:"From Texture",textFromUrl:"From URL",textFromFile:"From File",textStretch:"Stretch",textTile:"Tile",txtCanvas:"Canvas",txtCarton:"Carton",txtDarkFabric:"Dark Fabric",txtGrain:"Grain",txtGranite:"Granite",txtGreyPaper:"Grey Paper",txtKnit:"Knit",txtLeather:"Leather",txtBrownPaper:"Brown Paper",txtPapyrus:"Papyrus",txtWood:"Wood",textNewColor:"Add New Custom Color",strTransparency:"Opacity",textNoFill:"No Fill",textSelectTexture:"Select",textGradientFill:"Gradient Fill",textPatternFill:"Pattern",strBackground:"Background color",strForeground:"Foreground color",strPattern:"Pattern",textEmptyPattern:"No Pattern",textLinear:"Linear",textRadial:"Radial",textDirection:"Direction",textStyle:"Style",textGradient:"Gradient",textBorderSizeErr:"The entered value is incorrect.
    Please enter a value between 0 pt and 1584 pt.",textTransform:"Transform",textTemplate:"Template",strType:"Type"},PE.Views.TextArtSettings||{}))});var SCALE_MIN=40,MENU_SCALE_PART=260;define("presentationeditor/main/app/view/RightMenu",["text!presentationeditor/main/app/template/RightMenu.template","jquery","underscore","backbone","common/main/lib/component/Button","common/main/lib/component/MetricSpinner","common/main/lib/component/CheckBox","presentationeditor/main/app/view/ParagraphSettings","presentationeditor/main/app/view/ImageSettings","presentationeditor/main/app/view/ChartSettings","presentationeditor/main/app/view/TableSettings","presentationeditor/main/app/view/ShapeSettings","presentationeditor/main/app/view/SlideSettings","presentationeditor/main/app/view/TextArtSettings","common/main/lib/component/Scroller"],function(e,t,n,r){"use strict";PE.Views.RightMenu=r.View.extend(n.extend({el:"#right-menu",template:n.template(e),events:{},initialize:function(){return this.minimizedMode=!0,this.btnText=new Common.UI.Button({hint:this.txtParagraphSettings,asctype:Common.Utils.documentSettingsType.Paragraph,enableToggle:!0,disabled:!0,toggleGroup:"tabpanelbtnsGroup",allowMouseEventsOnDisabled:!0}),this.btnTable=new Common.UI.Button({hint:this.txtTableSettings,asctype:Common.Utils.documentSettingsType.Table,enableToggle:!0,disabled:!0,toggleGroup:"tabpanelbtnsGroup",allowMouseEventsOnDisabled:!0}),this.btnImage=new Common.UI.Button({hint:this.txtImageSettings,asctype:Common.Utils.documentSettingsType.Image,enableToggle:!0,disabled:!0,toggleGroup:"tabpanelbtnsGroup",allowMouseEventsOnDisabled:!0}),this.btnSlide=new Common.UI.Button({hint:this.txtSlideSettings,asctype:Common.Utils.documentSettingsType.Slide,enableToggle:!0,disabled:!0,toggleGroup:"tabpanelbtnsGroup",allowMouseEventsOnDisabled:!0}),this.btnChart=new Common.UI.Button({hint:this.txtChartSettings,asctype:Common.Utils.documentSettingsType.Chart,enableToggle:!0,disabled:!0,toggleGroup:"tabpanelbtnsGroup",allowMouseEventsOnDisabled:!0}),this.btnShape=new Common.UI.Button({hint:this.txtShapeSettings,asctype:Common.Utils.documentSettingsType.Shape,enableToggle:!0,disabled:!0,toggleGroup:"tabpanelbtnsGroup",allowMouseEventsOnDisabled:!0}),this.btnTextArt=new Common.UI.Button({hint:this.txtTextArtSettings,asctype:Common.Utils.documentSettingsType.TextArt,enableToggle:!0,disabled:!0,toggleGroup:"tabpanelbtnsGroup",allowMouseEventsOnDisabled:!0}),this._settings=[],this._settings[Common.Utils.documentSettingsType.Paragraph]={panel:"id-paragraph-settings",btn:this.btnText},this._settings[Common.Utils.documentSettingsType.Table]={panel:"id-table-settings",btn:this.btnTable},this._settings[Common.Utils.documentSettingsType.Image]={panel:"id-image-settings",btn:this.btnImage},this._settings[Common.Utils.documentSettingsType.Slide]={panel:"id-slide-settings",btn:this.btnSlide},this._settings[Common.Utils.documentSettingsType.Shape]={panel:"id-shape-settings",btn:this.btnShape},this._settings[Common.Utils.documentSettingsType.Chart]={panel:"id-chart-settings",btn:this.btnChart},this._settings[Common.Utils.documentSettingsType.TextArt]={panel:"id-textart-settings",btn:this.btnTextArt},this},render:function(){var e=t(this.el);this.trigger("render:before",this);var r=Common.localStorage.getItem("pe-hide-right-settings");return r=r===null||parseInt(r)==0,e.css("width",(r?MENU_SCALE_PART:SCALE_MIN)+"px"),e.show(),e.html(this.template({})),this.btnText.el=t("#id-right-menu-text"),this.btnText.render(),this.btnTable.el=t("#id-right-menu-table"),this.btnTable.render(),this.btnImage.el=t("#id-right-menu-image"),this.btnImage.render(),this.btnSlide.el=t("#id-right-menu-slide"),this.btnSlide.render(),this.btnChart.el=t("#id-right-menu-chart"),this.btnChart.render(),this.btnShape.el=t("#id-right-menu-shape"),this.btnShape.render(),this.btnTextArt.el=t("#id-right-menu-textart"),this.btnTextArt.render(),this.btnText.on("click",n.bind(this.onBtnMenuClick,this)),this.btnTable.on("click",n.bind(this.onBtnMenuClick,this)),this.btnImage.on("click",n.bind(this.onBtnMenuClick,this)),this.btnSlide.on("click",n.bind(this.onBtnMenuClick,this)),this.btnChart.on("click",n.bind(this.onBtnMenuClick,this)),this.btnShape.on("click",n.bind(this.onBtnMenuClick,this)),this.btnTextArt.on("click",n.bind(this.onBtnMenuClick,this)),this.paragraphSettings=new PE.Views.ParagraphSettings,this.slideSettings=new PE.Views.SlideSettings,this.imageSettings=new PE.Views.ImageSettings,this.chartSettings=new PE.Views.ChartSettings,this.tableSettings=new PE.Views.TableSettings,this.shapeSettings=new PE.Views.ShapeSettings,this.textartSettings=new PE.Views.TextArtSettings,n.isUndefined(this.scroller)&&(this.scroller=new Common.UI.Scroller({el:t(this.el).find(".right-panel"),suppressScrollX:!0,useKeyboard:!1})),r&&(t("#id-slide-settings").parent().css("display","inline-block"),t("#id-slide-settings").addClass("active")),this.trigger("render:after",this),this},setApi:function(e){this.api=e;var t=function(){this.fireEvent("editcomplete",this)};this.paragraphSettings.setApi(e).on("editcomplete",n.bind(t,this)),this.slideSettings.setApi(e).on("editcomplete",n.bind(t,this)),this.imageSettings.setApi(e).on("editcomplete",n.bind(t,this)),this.chartSettings.setApi(e).on("editcomplete",n.bind(t,this)),this.tableSettings.setApi(e).on("editcomplete",n.bind(t,this)),this.shapeSettings.setApi(e).on("editcomplete",n.bind(t,this)),this.textartSettings.setApi(e).on("editcomplete",n.bind(t,this))},setMode:function(e){},onBtnMenuClick:function(e,n){var r=t("#"+this._settings[e.options.asctype].panel),i=r.parent();e.pressed?(this.minimizedMode&&(t(this.el).width(MENU_SCALE_PART),i.css("display","inline-block"),this.minimizedMode=!1,Common.localStorage.setItem("pe-hide-right-settings",0)),i.find("> .active").removeClass("active"),r.addClass("active"),this.scroller&&this.scroller.scrollTop(0),this._settings[Common.Utils.documentSettingsType.Slide].isCurrent=e.options.asctype==Common.Utils.documentSettingsType.Slide):(i.css("display","none"),t(this.el).width(SCALE_MIN),this.minimizedMode=!0,Common.localStorage.setItem("pe-hide-right-settings",1)),this.fireEvent("rightmenuclick",[this,e.options.asctype,this.minimizedMode])},SetActivePane:function(e,n){if(this.minimizedMode&&n!==!0||this._settings[e]===undefined)return;if(this.minimizedMode)this._settings[e].btn.toggle(!0,!1),this._settings[e].btn.trigger("click",this._settings[e].btn);else{var r=t("#"+this._settings[e].panel);r.hasClass("active")||(r.parent().find("> .active").removeClass("active"),r.addClass("active"),this.scroller&&this.scroller.update()),this._settings[e].btn.isActive()||this._settings[e].btn.toggle(!0,!1)}},GetActivePane:function(){return this.minimizedMode?null:this.$el.find(".settings-panel.active")[0].id},SetDisabled:function(e,n,r){if(r)this.slideSettings.SetSlideDisabled(n,n,n),this.paragraphSettings.disableControls(n),this.shapeSettings.disableControls(n),this.tableSettings.disableControls(n),this.imageSettings.disableControls(n),this.chartSettings.disableControls(n);else{var i=t("#"+e);n!==i.hasClass("disabled")&&(i.toggleClass("disabled",n),n?i.attr({disabled:n}):i.removeAttr("disabled"))}},clearSelection:function(){var e=t(".right-panel");e.find("> .active").removeClass("active"),this._settings.forEach(function(e){e.btn.isActive()&&e.btn.toggle(!1,!0)}),e.css("display","none"),t(this.el).width(SCALE_MIN),this.minimizedMode=!0,Common.NotificationCenter.trigger("layout:changed","rightmenu")},txtParagraphSettings:"Text Settings",txtImageSettings:"Image Settings",txtTableSettings:"Table Settings",txtShapeSettings:"Shape Settings",txtTextArtSettings:"Text Art Settings",txtSlideSettings:"Slide Settings",txtChartSettings:"Chart Settings"},PE.Views.RightMenu||{}))}),define("presentationeditor/main/app/controller/RightMenu",["core","presentationeditor/main/app/view/RightMenu"],function(){"use strict";PE.Controllers.RightMenu=Backbone.Controller.extend({models:[],collections:[],views:["RightMenu"],initialize:function(){this.editMode=!0,this._state={no_slides:undefined},this.addListeners({RightMenu:{rightmenuclick:this.onRightMenuClick}})},onLaunch:function(){this.rightmenu=this.createView("RightMenu"),this.rightmenu.on("render:after",_.bind(this.onRightMenuAfterRender,this))},onRightMenuAfterRender:function(e){e.shapeSettings.application=e.textartSettings.application=this.getApplication(),this._settings=[],this._settings[Common.Utils.documentSettingsType.Paragraph]={panelId:"id-paragraph-settings",panel:e.paragraphSettings,btn:e.btnText,hidden:1,locked:!1},this._settings[Common.Utils.documentSettingsType.Table]={panelId:"id-table-settings",panel:e.tableSettings,btn:e.btnTable,hidden:1,locked:!1},this._settings[Common.Utils.documentSettingsType.Image]={panelId:"id-image-settings",panel:e.imageSettings,btn:e.btnImage,hidden:1,locked:!1},this._settings[Common.Utils.documentSettingsType.Slide]={panelId:"id-slide-settings",panel:e.slideSettings,btn:e.btnSlide,hidden:1,locked:!1},this._settings[Common.Utils.documentSettingsType.Shape]={panelId:"id-shape-settings",panel:e.shapeSettings,btn:e.btnShape,hidden:1,locked:!1},this._settings[Common.Utils.documentSettingsType.TextArt]={panelId:"id-textart-settings",panel:e.textartSettings,btn:e.btnTextArt,hidden:1,locked:!1},this._settings[Common.Utils.documentSettingsType.Chart]={panelId:"id-chart-settings",panel:e.chartSettings,btn:e.btnChart,hidden:1,locked:!1}},setApi:function(e){this.api=e,this.api.asc_registerCallback("asc_onCountPages",_.bind(this.onApiCountPages,this)),this.api.asc_registerCallback("asc_onCoAuthoringDisconnect",_.bind(this.onCoAuthoringDisconnect,this)),Common.NotificationCenter.on("api:disconnect",_.bind(this.onCoAuthoringDisconnect,this))},setMode:function(e){this.editMode=e.isEdit},onRightMenuClick:function(e,t,n){if(!n&&this.editMode){var r=this._settings[t].panel,i=this._settings[t].props;i&&r&&r.ChangeSettings.call(r,i)}Common.NotificationCenter.trigger("layout:changed","rightmenu"),this.rightmenu.fireEvent("editcomplete",this.rightmenu)},onFocusObject:function(e,t){if(!this.editMode)return;var n=!0;for(var r=0;r0?0:1;for(r=0;r=this._settings.length||this._settings[s]===undefined)continue;var o=e[r].get_ObjectValue();this._settings[s].props=o,this._settings[s].hidden=0,s==Common.Utils.documentSettingsType.Slide?(this._settings[s].locked=o.get_LockDelete(),this._settings[s].lockedBackground=o.get_LockBackground(),this._settings[s].lockedEffects=o.get_LockTranzition(),this._settings[s].lockedTiming=o.get_LockTiming()):(this._settings[s].locked=o.get_Locked(),s==Common.Utils.documentSettingsType.Shape&&o.asc_getTextArtProperties()&&(this._settings[Common.Utils.documentSettingsType.TextArt].props=o,this._settings[Common.Utils.documentSettingsType.TextArt].hidden=0,this._settings[Common.Utils.documentSettingsType.TextArt].locked=o.get_Locked()))}if(this._settings[Common.Utils.documentSettingsType.Slide].locked)for(r=0;r-1?h=f:a>=0?h=a:u>=0?h=u:h=Common.Utils.documentSettingsType.Slide,h!==undefined&&(this.rightmenu.SetActivePane(h,t),this._settings[h].panel.ChangeSettings.call(this._settings[h].panel,this._settings[h].props))}this._settings[Common.Utils.documentSettingsType.Image].needShow=!1,this._settings[Common.Utils.documentSettingsType.Chart].needShow=!1,this._settings[Common.Utils.documentSettingsType.Shape].needShow=!1},onCoAuthoringDisconnect:function(){this.rightmenu&&this.rightmenu.SetDisabled("",!0,!0),this.setMode({isEdit:!1})},onInsertTable:function(){this._settings[Common.Utils.documentSettingsType.Table].needShow=!0},onInsertImage:function(){this._settings[Common.Utils.documentSettingsType.Image].needShow=!0},onInsertChart:function(){this._settings[Common.Utils.documentSettingsType.Chart].needShow=!0},onInsertShape:function(){this._settings[Common.Utils.documentSettingsType.Shape].needShow=!0},onInsertTextArt:function(){this._settings[Common.Utils.documentSettingsType.TextArt].needShow=!0},UpdateThemeColors:function(){this.rightmenu.slideSettings.UpdateThemeColors(),this.rightmenu.tableSettings.UpdateThemeColors(),this.rightmenu.shapeSettings.UpdateThemeColors(),this.rightmenu.textartSettings.UpdateThemeColors()},updateMetricUnit:function(){this.rightmenu.paragraphSettings.updateMetricUnit(),this.rightmenu.chartSettings.updateMetricUnit(),this.rightmenu.imageSettings.updateMetricUnit()},fillTextArt:function(){this.rightmenu.textartSettings.fillTextArt()},createDelayedElements:function(){if(this.editMode&&this.api){this.api.asc_registerCallback("asc_doubleClickOnObject",_.bind(this.onDoubleClickOnObject,this)),this.rightmenu.shapeSettings.createDelayedElements();var e=this.api.getSelectedElements();if(e.length>0){var t=Common.localStorage.getItem("pe-hide-right-settings");t=t===null||parseInt(t)==0,this.onFocusObject(e,t)}}},onDoubleClickOnObject:function(e){if(!this.editMode)return;var t=e.get_ObjectType(),n=this.getDocumentSettingsType(t);if(n===undefined||n>=this._settings.length||this._settings[n]===undefined)return;n!==Common.Utils.documentSettingsType.Paragraph&&(this.rightmenu.SetActivePane(n,!0),this._settings[n].panel.ChangeSettings.call(this._settings[n].panel,this._settings[n].props))},onApiCountPages:function(e){this._state.no_slides!==e<=0&&this.editMode&&(this._state.no_slides=e<=0,this._state.no_slides&&!this.rightmenu.minimizedMode&&this.rightmenu.clearSelection(),this._settings[Common.Utils.documentSettingsType.Slide].btn.setDisabled(this._state.no_slides))},getDocumentSettingsType:function(e){switch(e){case Asc.c_oAscTypeSelectElement.Paragraph:return Common.Utils.documentSettingsType.Paragraph;case Asc.c_oAscTypeSelectElement.Table:return Common.Utils.documentSettingsType.Table;case Asc.c_oAscTypeSelectElement.Image:return Common.Utils.documentSettingsType.Image;case Asc.c_oAscTypeSelectElement.Shape:return Common.Utils.documentSettingsType.Shape;case Asc.c_oAscTypeSelectElement.Slide:return Common.Utils.documentSettingsType.Slide;case Asc.c_oAscTypeSelectElement.Chart:return Common.Utils.documentSettingsType.Chart}}})}),function(e){function l(e,t){var n=e.length;while(n--)if(e[n]===t)return n;return-1}function c(e,t){if(e.length!=t.length)return!1;for(var n=0;n0;for(o in r)if(!r[o]&&l(i.mods,+o)>-1||r[o]&&l(i.mods,+o)==-1)c=!1;if(i.mods.length==0&&!r[16]&&!r[18]&&!r[17]&&!r[91]||c)if(f===!0||i.locked||i.method(e,i)===!1)e.preventDefault?e.preventDefault():e.returnValue=!1,e.stopPropagation&&e.stopPropagation(),e.cancelBubble&&(e.cancelBubble=!0)}}}function v(e){var t=e.keyCode,n,i=l(a,t);i>=0&&a.splice(i,1);if(t==93||t==224)t=91;if(t in r){r[t]=!1;for(n in s)s[n]==t&&(g[n]=!1)}}function m(){for(t in r)r[t]=!1;for(t in s)g[t]=!1}function g(e,t,r){var i,s;i=N(e),r===undefined&&(r=t,t="all");for(var o=0;o1&&(s=C(e),e=[e[e.length-1]]),e=e[0],e=u(e),e in n||(n[e]=[]),n[e].push({shortcut:i[o],scope:t,method:r,key:i[o],mods:s})}function y(e,t){var r,i,s=[],o,a,f;r=N(e);for(a=0;a1&&(s=C(i),e=i[i.length-1]),e=u(e),t===undefined&&(t=x());if(!n[e])return;for(o in n[e])f=n[e][o],f.scope===t&&c(f.mods,s)&&(n[e][o]={})}}function b(e){return typeof e=="string"&&(e=u(e)),l(a,e)!=-1}function w(){return a.slice(0)}function E(e){var t=(e.target||e.srcElement).tagName;return t!="INPUT"&&t!="SELECT"&&t!="TEXTAREA"}function S(e){i=e||"all"}function x(){return i||"all"}function T(e){var t,r,i;for(t in n){r=n[t];for(i=0;i1&&(o=C(s),e=s[s.length-1]),e=u(e),t===undefined&&(t=x());if(n[e])for(a in n[e])f=n[e][a],f.scope===t&&c(f.mods,o)&&(n[e][a][r]=i)}}function M(e,t){e?O(e,t,"locked",!0):f=!0}function _(e,t){e?O(e,t,"locked",!1):f=!1}var t,n={},r={16:!1,18:!1,17:!1,91:!1},i="all",s={"⇧":16,shift:16,"⌥":18,alt:18,option:18,"⌃":17,ctrl:17,control:17,"⌘":91,command:91},o={backspace:8,tab:9,clear:12,enter:13,"return":13,esc:27,escape:27,space:32,left:37,up:38,right:39,down:40,del:46,"delete":46,home:36,end:35,pageup:33,pagedown:34,",":188,".":190,"/":191,"`":192,"-":189,"=":187,";":186,"'":222,"[":219,"]":221,"\\":220},u=function(e){return o[e]||e.toUpperCase().charCodeAt(0)},a=[],f;for(t=1;t<20;t++)o["f"+t]=111+t;var h={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey"};for(t in s)g[t]=!1;k(document,"keydown",function(e){d(e)}),k(document,"keyup",v),k(window,"focus",m);var L=e.key;e.key=g,e.key.setScope=S,e.key.getScope=x,e.key.deleteScope=T,e.key.filter=E,e.key.isPressed=b,e.key.getPressedKeyCodes=w,e.key.noConflict=A,e.key.unbind=y,e.key.suspend=M,e.key.resume=_,typeof module!="undefined"&&(module.exports=key)}(this),define("keymaster",function(){});if(Common===undefined)var Common={};Common.util=Common.util||{},define("common/main/lib/util/Shortcuts",["backbone","keymaster"],function(e){"use strict";var t=function(e){return this.cid=_.uniqueId("shortcuts"),this.initialize.apply(this,arguments),this};_.extend(t.prototype,e.Events,{initialize:function(){window.key.filter=function(e){return!0},Common.NotificationCenter.on({"modal:show":function(e){window.key.suspend()},"modal:close":function(e){window.key.resume()},"modal:hide":function(e){window.key.resume()}})},delegateShortcuts:function(e){if(!e||!e.shortcuts)return;this.removeShortcuts(e);var t,n,r,i,s,o,u=[];for(s in e.shortcuts){t=e.shortcuts[s];if(!_.isFunction(t)){r=e[t];if(!r)throw new Error("Method "+t+" does not exist")}else r=t;n=s.match(/^(\S+)\s*(.*)$/),o=n[1],i=n[2].length?n[2]:"all",r=_.bind(r,this),u.push(window.key(o,i,r))}},removeShortcuts:function(e){if(!e||!e.shortcuts)return;var t,n,r,i,s=[];for(r in e.shortcuts)t=r.match(/^(\S+)\s*(.*)$/),i=t[1],n=t[2].length?t[2]:"all",window.key.unbind(i,n)},suspendEvents:function(e,t){window.key.suspend(e,t)},resumeEvents:function(e,t){window.key.resume(e,t)}}),t.extend=e.View.extend,Common.util.Shortcuts=new t}),define("text!presentationeditor/main/app/template/LeftMenu.template",[],function(){return'
    \r\n
    \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
    \r\n
    \r\n \r\n