@syncfusion/ej2-ribbon 25.2.3 → 25.2.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,11 +1,11 @@
1
1
  /*!
2
2
  * filename: ej2-ribbon.umd.min.js
3
- * version : 25.2.3
3
+ * version : 25.2.5
4
4
  * Copyright Syncfusion Inc. 2001 - 2023. All rights reserved.
5
5
  * Use of this code is subject to the terms of our license.
6
6
  * A copy of the current license can be obtained at any time by e-mailing
7
7
  * licensing@syncfusion.com. Any infringement will be prosecuted under
8
8
  * applicable laws.
9
9
  */
10
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@syncfusion/ej2-base"),require("@syncfusion/ej2-navigations"),require("@syncfusion/ej2-dropdowns"),require("@syncfusion/ej2-splitbuttons"),require("@syncfusion/ej2-buttons"),require("@syncfusion/ej2-inputs"),require("@syncfusion/ej2-popups")):"function"==typeof define&&define.amd?define(["exports","@syncfusion/ej2-base","@syncfusion/ej2-navigations","@syncfusion/ej2-dropdowns","@syncfusion/ej2-splitbuttons","@syncfusion/ej2-buttons","@syncfusion/ej2-inputs","@syncfusion/ej2-popups"],t):t(e.ej={},e.ej2Base,e.ej2Navigations,e.ej2Dropdowns,e.ej2Splitbuttons,e.ej2Buttons,e.ej2Inputs,e.ej2Popups)}(this,function(e,t,o,i,r,n,s,a){"use strict";function l(e,t){for(var o=0;o<e.length;o++)if(t(e[parseInt(o.toString(),10)],o))return o;return-1}function p(e){if("string"==typeof e){var o="";try{var i=t.select(e);o=i?"SCRIPT"===i.tagName?i.innerHTML:i.outerHTML:e}catch(t){o=e}return t.compile(o)}return t.compile(e)}function c(e,t,o){for(var i=0;i<e.length;i++)for(var r=e[parseInt(i.toString(),10)],n=0;n<r.groups.length;n++)for(var s=r.groups[parseInt(n.toString(),10)],a=0;a<s.collections.length;a++)for(var l=s.collections[parseInt(a.toString(),10)],p=0;p<l.items.length;p++){var c=l.items[parseInt(p.toString(),10)];if(t&&c.id===t||o&&c.type===o)return{item:c,collection:l,group:s,tabIndex:i,groupIndex:n,collectionIndex:a,itemIndex:p}}return null}function u(e,t){for(var o=0;o<e.length;o++)for(var i=e[parseInt(o.toString(),10)],r=0;r<i.groups.length;r++)for(var n=i.groups[parseInt(r.toString(),10)],s=0;s<n.collections.length;s++){var a=n.collections[parseInt(s.toString(),10)];if(a.id===t)return{collection:a,group:n,tabIndex:o,groupIndex:r,collectionIndex:s}}return null}function d(e,t){for(var o=0;o<e.length;o++)for(var i=e[parseInt(o.toString(),10)],r=0;r<i.groups.length;r++){var n=i.groups[parseInt(r.toString(),10)];if(n.id===t)return{group:n,tabIndex:o,groupIndex:r}}return null}function h(e,o){t.getComponent(e,o).destroy()}function b(e,o,i){t.getComponent(e,o).setProperties(i)}function m(e,o,i){t.getComponent(e,o).setProperties("combobox"===o?{enabled:!i}:{disabled:i})}function f(o,i,n){if(!n&&!(n=c(o.tabs,i)))return null;var s=o.tabObj.items[n.tabIndex].content;if(""===s.innerHTML)return null;if(o.activeLayout===e.RibbonLayout.Classic)return n.item.displayOptions&e.DisplayMode.Classic?(s=n.group.isCollapsed?o.ribbonDropDownModule.getOverflowDropDownPopup(n,s):s).querySelector("#"+i):null;var a=n.item.displayOptions&e.DisplayMode.Simplified?s.querySelector("#"+n.item.id):null;if(!a){a=(n.group.enableGroupOverflow?t.getComponent(s.querySelector("#"+n.group.id+Yt),r.DropDownButton):o.overflowDDB).target.querySelector("#"+n.item.id)}return a}function y(e){return!!(e.content||e.iconCss||e.title||e.id||e.cssClass)}function g(e,t,o){var i=e.target.getAttribute("id"),r=o.filter(function(e){return e.id===i})[0].data,n=t.createElement("div",{id:r.id?qt+"_"+r.id:qt});if(t.element.append(n),r.title){var s=t.createElement("div",{innerHTML:r.title,className:xt});n.appendChild(s)}var a=t.createElement("div",{className:At});if(n.appendChild(a),r.iconCss){var l=t.createElement("div",{className:r.iconCss+" "+_t});a.appendChild(l)}if(r.content){var p=t.createElement("div",{innerHTML:r.content,className:Mt});a.appendChild(p)}t.setProperties({content:n,cssClass:r.cssClass?r.cssClass+" "+Dt:Dt})}function v(e,t){var o=new a.Tooltip({target:"."+Rt,beforeRender:function(e){g(e,o,t.tooltipData)}.bind(this),windowCollision:!0});o.appendTo(e)}function S(e){t.getComponent(e,a.Tooltip).destroy()}function I(e,o){t.getComponent(e,a.Tooltip).setProperties(o)}function C(e,o){for(var i in o)if("class"===i){var r=o.class.replace(/\s+/g," ").trim();r&&t.addClass([e],r.split(" "))}else if("style"===i){var n=""+(e.getAttribute("style")||"")+o[""+i];e.setAttribute(""+i,n)}else e.setAttribute(i,o[""+i])}!function(e){e.Classic="Classic",e.Simplified="Simplified"}(e.RibbonLayout||(e.RibbonLayout={})),function(e){e.Row="Row",e.Column="Column"}(e.ItemOrientation||(e.ItemOrientation={})),function(e){e[e.Large=4]="Large",e[e.Medium=2]="Medium",e[e.Small=1]="Small"}(e.RibbonItemSize||(e.RibbonItemSize={})),function(e){e[e.Classic=4]="Classic",e[e.Simplified=2]="Simplified",e[e.Overflow=1]="Overflow",e[e.Auto=7]="Auto"}(e.DisplayMode||(e.DisplayMode={})),function(e){e.Button="Button",e.CheckBox="CheckBox",e.ColorPicker="ColorPicker",e.ComboBox="ComboBox",e.DropDown="DropDown",e.SplitButton="SplitButton",e.GroupButton="GroupButton",e.Gallery="Gallery",e.Template="Template"}(e.RibbonItemType||(e.RibbonItemType={})),function(e){e.Single="Single",e.Multiple="Multiple"}(e.RibbonGroupButtonSelection||(e.RibbonGroupButtonSelection={}));var T=function(){var e=function(t,o){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(t,o)};return function(t,o){function i(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(i.prototype=o.prototype,new i)}}(),w=function(e,t,o,i){var r,n=arguments.length,s=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(n<3?r(s):n>3?r(t,o,s):r(t,o))||s);return n>3&&s&&Object.defineProperty(t,o,s),s},k=function(e){function o(){return null!==e&&e.apply(this,arguments)||this}return T(o,e),o.prototype.setProperties=function(t,o){e.prototype.setProperties.call(this,t,o)},w([t.Property("")],o.prototype,"content",void 0),w([t.Property("")],o.prototype,"cssClass",void 0),w([t.Property("")],o.prototype,"iconCss",void 0),w([t.Property(!1)],o.prototype,"isToggle",void 0),w([t.Property(!1)],o.prototype,"isPrimary",void 0),w([t.Property({})],o.prototype,"htmlAttributes",void 0),w([t.Event()],o.prototype,"created",void 0),w([t.Event()],o.prototype,"clicked",void 0),o}(t.ChildProperty),O=function(){var e=function(t,o){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(t,o)};return function(t,o){function i(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(i.prototype=o.prototype,new i)}}(),B=function(e,t,o,i){var r,n=arguments.length,s=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(n<3?r(s):n>3?r(t,o,s):r(t,o))||s);return n>3&&s&&Object.defineProperty(t,o,s),s},P=function(e){function o(){return null!==e&&e.apply(this,arguments)||this}return O(o,e),o.prototype.setProperties=function(t,o){e.prototype.setProperties.call(this,t,o)},B([t.Property(!1)],o.prototype,"checked",void 0),B([t.Property("")],o.prototype,"cssClass",void 0),B([t.Property("")],o.prototype,"label",void 0),B([t.Property("After")],o.prototype,"labelPosition",void 0),B([t.Property({})],o.prototype,"htmlAttributes",void 0),B([t.Event()],o.prototype,"created",void 0),B([t.Event()],o.prototype,"change",void 0),o}(t.ChildProperty),L=function(){var e=function(t,o){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(t,o)};return function(t,o){function i(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(i.prototype=o.prototype,new i)}}(),E=function(e,t,o,i){var r,n=arguments.length,s=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(n<3?r(s):n>3?r(t,o,s):r(t,o))||s);return n>3&&s&&Object.defineProperty(t,o,s),s},D=function(e){function o(){return null!==e&&e.apply(this,arguments)||this}return L(o,e),o.prototype.setProperties=function(t,o){e.prototype.setProperties.call(this,t,o)},E([t.Property(10)],o.prototype,"columns",void 0),E([t.Property("")],o.prototype,"cssClass",void 0),E([t.Property("")],o.prototype,"label",void 0),E([t.Property(!0)],o.prototype,"enableOpacity",void 0),E([t.Property("Palette")],o.prototype,"mode",void 0),E([t.Property(!0)],o.prototype,"modeSwitcher",void 0),E([t.Property(!1)],o.prototype,"noColor",void 0),E([t.Property(null)],o.prototype,"presetColors",void 0),E([t.Property(!0)],o.prototype,"showButtons",void 0),E([t.Property("#008000ff")],o.prototype,"value",void 0),E([t.Property({})],o.prototype,"htmlAttributes",void 0),E([t.Event()],o.prototype,"beforeClose",void 0),E([t.Event()],o.prototype,"beforeOpen",void 0),E([t.Event()],o.prototype,"beforeTileRender",void 0),E([t.Event()],o.prototype,"created",void 0),E([t.Event()],o.prototype,"change",void 0),E([t.Event()],o.prototype,"open",void 0),E([t.Event()],o.prototype,"select",void 0),o}(t.ChildProperty),R=function(){var e=function(t,o){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(t,o)};return function(t,o){function i(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(i.prototype=o.prototype,new i)}}(),x=function(e,t,o,i){var r,n=arguments.length,s=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(n<3?r(s):n>3?r(t,o,s):r(t,o))||s);return n>3&&s&&Object.defineProperty(t,o,s),s},M=function(e){function o(){return null!==e&&e.apply(this,arguments)||this}return R(o,e),o.prototype.setProperties=function(t,o){e.prototype.setProperties.call(this,t,o)},x([t.Property(!1)],o.prototype,"allowFiltering",void 0),x([t.Property(!0)],o.prototype,"autofill",void 0),x([t.Property("")],o.prototype,"cssClass",void 0),x([t.Property("")],o.prototype,"label",void 0),x([t.Property([])],o.prototype,"dataSource",void 0),x([t.Complex({text:null,value:null,iconCss:null,groupBy:null},i.FieldSettings)],o.prototype,"fields",void 0),x([t.Property("Contains")],o.prototype,"filterType",void 0),x([t.Property(null)],o.prototype,"footerTemplate",void 0),x([t.Property(null)],o.prototype,"groupTemplate",void 0),x([t.Property(null)],o.prototype,"headerTemplate",void 0),x([t.Property(null)],o.prototype,"index",void 0),x([t.Property(null)],o.prototype,"itemTemplate",void 0),x([t.Property("No records found")],o.prototype,"noRecordsTemplate",void 0),x([t.Property(null)],o.prototype,"placeholder",void 0),x([t.Property("300px")],o.prototype,"popupHeight",void 0),x([t.Property("100%")],o.prototype,"popupWidth",void 0),x([t.Property(!0)],o.prototype,"showClearButton",void 0),x([t.Property("None")],o.prototype,"sortOrder",void 0),x([t.Property(null)],o.prototype,"text",void 0),x([t.Property(null)],o.prototype,"value",void 0),x([t.Property("150px")],o.prototype,"width",void 0),x([t.Property({})],o.prototype,"htmlAttributes",void 0),x([t.Event()],o.prototype,"beforeOpen",void 0),x([t.Event()],o.prototype,"change",void 0),x([t.Event()],o.prototype,"close",void 0),x([t.Event()],o.prototype,"created",void 0),x([t.Event()],o.prototype,"filtering",void 0),x([t.Event()],o.prototype,"open",void 0),x([t.Event()],o.prototype,"select",void 0),o}(t.ChildProperty),_=function(){var e=function(t,o){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(t,o)};return function(t,o){function i(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(i.prototype=o.prototype,new i)}}(),q=function(e,t,o,i){var r,n=arguments.length,s=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(n<3?r(s):n>3?r(t,o,s):r(t,o))||s);return n>3&&s&&Object.defineProperty(t,o,s),s},A=function(e){function o(){return null!==e&&e.apply(this,arguments)||this}return _(o,e),o.prototype.setProperties=function(t,o){e.prototype.setProperties.call(this,t,o)},q([t.Property("")],o.prototype,"closeActionEvents",void 0),q([t.Property("")],o.prototype,"content",void 0),q([t.Property("")],o.prototype,"cssClass",void 0),q([t.Property("")],o.prototype,"iconCss",void 0),q([t.Collection([],r.Item)],o.prototype,"items",void 0),q([t.Property("")],o.prototype,"target",void 0),q([t.Property(!1)],o.prototype,"createPopupOnClick",void 0),q([t.Property({})],o.prototype,"htmlAttributes",void 0),q([t.Event()],o.prototype,"beforeClose",void 0),q([t.Event()],o.prototype,"beforeItemRender",void 0),q([t.Event()],o.prototype,"beforeOpen",void 0),q([t.Event()],o.prototype,"close",void 0),q([t.Event()],o.prototype,"created",void 0),q([t.Event()],o.prototype,"open",void 0),q([t.Event()],o.prototype,"select",void 0),o}(t.ChildProperty),j=function(){var e=function(t,o){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(t,o)};return function(t,o){function i(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(i.prototype=o.prototype,new i)}}(),G=function(e,t,o,i){var r,n=arguments.length,s=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(n<3?r(s):n>3?r(t,o,s):r(t,o))||s);return n>3&&s&&Object.defineProperty(t,o,s),s},z=function(e){function o(){return null!==e&&e.apply(this,arguments)||this}return j(o,e),o.prototype.setProperties=function(t,o){e.prototype.setProperties.call(this,t,o)},G([t.Property("")],o.prototype,"closeActionEvents",void 0),G([t.Property("")],o.prototype,"content",void 0),G([t.Property("")],o.prototype,"cssClass",void 0),G([t.Property("")],o.prototype,"iconCss",void 0),G([t.Collection([],r.Item)],o.prototype,"items",void 0),G([t.Property("")],o.prototype,"target",void 0),G([t.Property({})],o.prototype,"htmlAttributes",void 0),G([t.Event()],o.prototype,"beforeClose",void 0),G([t.Event()],o.prototype,"beforeItemRender",void 0),G([t.Event()],o.prototype,"beforeOpen",void 0),G([t.Event()],o.prototype,"close",void 0),G([t.Event()],o.prototype,"click",void 0),G([t.Event()],o.prototype,"created",void 0),G([t.Event()],o.prototype,"open",void 0),G([t.Event()],o.prototype,"select",void 0),o}(t.ChildProperty),N=function(){var e=function(t,o){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(t,o)};return function(t,o){function i(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(i.prototype=o.prototype,new i)}}(),H=function(e,t,o,i){var r,n=arguments.length,s=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(n<3?r(s):n>3?r(t,o,s):r(t,o))||s);return n>3&&s&&Object.defineProperty(t,o,s),s},W=function(e){function o(){return null!==e&&e.apply(this,arguments)||this}return N(o,e),H([t.Property("")],o.prototype,"cssClass",void 0),H([t.Property("")],o.prototype,"id",void 0),H([t.Property("")],o.prototype,"title",void 0),H([t.Property("")],o.prototype,"content",void 0),H([t.Property("")],o.prototype,"iconCss",void 0),o}(t.ChildProperty),K=function(){var e=function(t,o){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(t,o)};return function(t,o){function i(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(i.prototype=o.prototype,new i)}}(),F=function(e,t,o,i){var r,n=arguments.length,s=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(n<3?r(s):n>3?r(t,o,s):r(t,o))||s);return n>3&&s&&Object.defineProperty(t,o,s),s},U=function(e){function o(){return null!==e&&e.apply(this,arguments)||this}return K(o,e),o.prototype.setProperties=function(t,o){e.prototype.setProperties.call(this,t,o)},F([t.Property("")],o.prototype,"content",void 0),F([t.Property("")],o.prototype,"iconCss",void 0),F([t.Property("")],o.prototype,"keyTip",void 0),F([t.Complex({},W)],o.prototype,"ribbonTooltipSettings",void 0),F([t.Property(!1)],o.prototype,"selected",void 0),F([t.Property({})],o.prototype,"htmlAttributes",void 0),F([t.Event()],o.prototype,"beforeClick",void 0),F([t.Event()],o.prototype,"click",void 0),o}(t.ChildProperty),V=function(){var e=function(t,o){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(t,o)};return function(t,o){function i(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(i.prototype=o.prototype,new i)}}(),X=function(e,t,o,i){var r,n=arguments.length,s=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(n<3?r(s):n>3?r(t,o,s):r(t,o))||s);return n>3&&s&&Object.defineProperty(t,o,s),s},Y=function(e){function o(){return null!==e&&e.apply(this,arguments)||this}return V(o,e),X([t.Property("")],o.prototype,"header",void 0),X([t.Property("Single")],o.prototype,"selection",void 0),X([t.Collection([],U)],o.prototype,"items",void 0),o}(t.ChildProperty),Z=function(){var e=function(t,o){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(t,o)};return function(t,o){function i(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(i.prototype=o.prototype,new i)}}(),J=function(e,t,o,i){var r,n=arguments.length,s=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(n<3?r(s):n>3?r(t,o,s):r(t,o))||s);return n>3&&s&&Object.defineProperty(t,o,s),s},Q=function(e){function o(){return null!==e&&e.apply(this,arguments)||this}return Z(o,e),J([t.Property("")],o.prototype,"content",void 0),J([t.Property("")],o.prototype,"iconCss",void 0),J([t.Property({})],o.prototype,"htmlAttributes",void 0),J([t.Property("")],o.prototype,"cssClass",void 0),J([t.Property(!1)],o.prototype,"disabled",void 0),o}(t.ChildProperty),$=function(){var e=function(t,o){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(t,o)};return function(t,o){function i(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(i.prototype=o.prototype,new i)}}(),ee=function(e,t,o,i){var r,n=arguments.length,s=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(n<3?r(s):n>3?r(t,o,s):r(t,o))||s);return n>3&&s&&Object.defineProperty(t,o,s),s},te=function(e){function o(){return null!==e&&e.apply(this,arguments)||this}return $(o,e),ee([t.Collection([],Q)],o.prototype,"items",void 0),ee([t.Property("")],o.prototype,"header",void 0),ee([t.Property("auto")],o.prototype,"itemWidth",void 0),ee([t.Property("auto")],o.prototype,"itemHeight",void 0),ee([t.Property("")],o.prototype,"cssClass",void 0),o}(t.ChildProperty),oe=function(){var e=function(t,o){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(t,o)};return function(t,o){function i(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(i.prototype=o.prototype,new i)}}(),ie=function(e,t,o,i){var r,n=arguments.length,s=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(n<3?r(s):n>3?r(t,o,s):r(t,o))||s);return n>3&&s&&Object.defineProperty(t,o,s),s},re=function(e){function o(){return null!==e&&e.apply(this,arguments)||this}return oe(o,e),ie([t.Collection([],te)],o.prototype,"groups",void 0),ie([t.Property(3)],o.prototype,"itemCount",void 0),ie([t.Property(null)],o.prototype,"selectedItemIndex",void 0),ie([t.Property("auto")],o.prototype,"popupHeight",void 0),ie([t.Property("auto")],o.prototype,"popupWidth",void 0),ie([t.Property("")],o.prototype,"template",void 0),ie([t.Property("")],o.prototype,"popupTemplate",void 0),ie([t.Event()],o.prototype,"popupOpen",void 0),ie([t.Event()],o.prototype,"popupClose",void 0),ie([t.Event()],o.prototype,"itemHover",void 0),ie([t.Event()],o.prototype,"beforeItemRender",void 0),ie([t.Event()],o.prototype,"beforeSelect",void 0),ie([t.Event()],o.prototype,"select",void 0),o}(t.ChildProperty),ne=function(){var e=function(t,o){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(t,o)};return function(t,o){function i(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(i.prototype=o.prototype,new i)}}(),se=function(e,t,o,i){var r,n=arguments.length,s=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(n<3?r(s):n>3?r(t,o,s):r(t,o))||s);return n>3&&s&&Object.defineProperty(t,o,s),s},ae=function(o){function i(){return null!==o&&o.apply(this,arguments)||this}return ne(i,o),i.prototype.setProperties=function(e,t){o.prototype.setProperties.call(this,e,t)},se([t.Property("")],i.prototype,"keyTip",void 0),se([t.Property(e.RibbonItemSize.Medium)],i.prototype,"activeSize",void 0),se([t.Property(e.RibbonItemSize.Small|e.RibbonItemSize.Medium|e.RibbonItemSize.Large)],i.prototype,"allowedSizes",void 0),se([t.Property("")],i.prototype,"id",void 0),se([t.Property("")],i.prototype,"cssClass",void 0),se([t.Property(!1)],i.prototype,"disabled",void 0),se([t.Property("")],i.prototype,"itemTemplate",void 0),se([t.Property("Button")],i.prototype,"type",void 0),se([t.Property(e.DisplayMode.Auto)],i.prototype,"displayOptions",void 0),se([t.Complex({},W)],i.prototype,"ribbonTooltipSettings",void 0),se([t.Complex({},k)],i.prototype,"buttonSettings",void 0),se([t.Complex({},A)],i.prototype,"dropDownSettings",void 0),se([t.Complex({},P)],i.prototype,"checkBoxSettings",void 0),se([t.Complex({},D)],i.prototype,"colorPickerSettings",void 0),se([t.Complex({},M)],i.prototype,"comboBoxSettings",void 0),se([t.Complex({},z)],i.prototype,"splitButtonSettings",void 0),se([t.Complex({},Y)],i.prototype,"groupButtonSettings",void 0),se([t.Complex({},re)],i.prototype,"gallerySettings",void 0),i}(t.ChildProperty),le=function(){var e=function(t,o){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(t,o)};return function(t,o){function i(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(i.prototype=o.prototype,new i)}}(),pe=function(e,t,o,i){var r,n=arguments.length,s=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(n<3?r(s):n>3?r(t,o,s):r(t,o))||s);return n>3&&s&&Object.defineProperty(t,o,s),s},ce=function(e){function o(){return null!==e&&e.apply(this,arguments)||this}return le(o,e),o.prototype.setProperties=function(t,o){e.prototype.setProperties.call(this,t,o)},pe([t.Property("")],o.prototype,"id",void 0),pe([t.Property("")],o.prototype,"cssClass",void 0),pe([t.Collection([],ae)],o.prototype,"items",void 0),o}(t.ChildProperty),ue=function(){var e=function(t,o){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(t,o)};return function(t,o){function i(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(i.prototype=o.prototype,new i)}}(),de=function(e,t,o,i){var r,n=arguments.length,s=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(n<3?r(s):n>3?r(t,o,s):r(t,o))||s);return n>3&&s&&Object.defineProperty(t,o,s),s},he=function(e){function o(){return null!==e&&e.apply(this,arguments)||this}return ue(o,e),o.prototype.setProperties=function(t,o){e.prototype.setProperties.call(this,t,o)},de([t.Property("")],o.prototype,"keyTip",void 0),de([t.Property("")],o.prototype,"launcherIconKeyTip",void 0),de([t.Collection([],ce)],o.prototype,"collections",void 0),de([t.Property("")],o.prototype,"cssClass",void 0),de([t.Property("")],o.prototype,"id",void 0),de([t.Property(!1)],o.prototype,"isCollapsed",void 0),de([t.Property(!0)],o.prototype,"isCollapsible",void 0),de([t.Property(!1)],o.prototype,"enableGroupOverflow",void 0),de([t.Property("")],o.prototype,"groupIconCss",void 0),de([t.Property("")],o.prototype,"header",void 0),de([t.Property("Column")],o.prototype,"orientation",void 0),de([t.Property("")],o.prototype,"overflowHeader",void 0),de([t.Property(0)],o.prototype,"priority",void 0),de([t.Property(!1)],o.prototype,"showLauncherIcon",void 0),o}(t.ChildProperty),be=function(){var e=function(t,o){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(t,o)};return function(t,o){function i(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(i.prototype=o.prototype,new i)}}(),me=function(e,t,o,i){var r,n=arguments.length,s=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(n<3?r(s):n>3?r(t,o,s):r(t,o))||s);return n>3&&s&&Object.defineProperty(t,o,s),s},fe=function(e){function o(){return null!==e&&e.apply(this,arguments)||this}return be(o,e),o.prototype.setProperties=function(t,o){e.prototype.setProperties.call(this,t,o)},me([t.Property("")],o.prototype,"keyTip",void 0),me([t.Property("")],o.prototype,"id",void 0),me([t.Property("")],o.prototype,"cssClass",void 0),me([t.Collection([],he)],o.prototype,"groups",void 0),me([t.Property("")],o.prototype,"header",void 0),o}(t.ChildProperty),ye=function(){var e=function(t,o){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(t,o)};return function(t,o){function i(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(i.prototype=o.prototype,new i)}}(),ge=function(e,t,o,i){var r,n=arguments.length,s=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(n<3?r(s):n>3?r(t,o,s):r(t,o))||s);return n>3&&s&&Object.defineProperty(t,o,s),s},ve=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ye(i,e),i.prototype.setProperties=function(t,o){e.prototype.setProperties.call(this,t,o)},ge([t.Property("File")],i.prototype,"text",void 0),ge([t.Property(!1)],i.prototype,"visible",void 0),ge([t.Collection([],o.MenuItem)],i.prototype,"menuItems",void 0),ge([t.Property(!1)],i.prototype,"showItemOnClick",void 0),ge([t.Complex({},o.MenuAnimationSettings)],i.prototype,"animationSettings",void 0),ge([t.Property("")],i.prototype,"itemTemplate",void 0),ge([t.Property("")],i.prototype,"popupTemplate",void 0),ge([t.Complex({},W)],i.prototype,"ribbonTooltipSettings",void 0),ge([t.Event()],i.prototype,"beforeClose",void 0),ge([t.Event()],i.prototype,"beforeOpen",void 0),ge([t.Event()],i.prototype,"beforeItemRender",void 0),ge([t.Event()],i.prototype,"close",void 0),ge([t.Event()],i.prototype,"open",void 0),ge([t.Event()],i.prototype,"select",void 0),ge([t.Property("")],i.prototype,"keyTip",void 0),i}(t.ChildProperty),Se=function(){var e=function(t,o){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(t,o)};return function(t,o){function i(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(i.prototype=o.prototype,new i)}}(),Ie=function(e,t,o,i){var r,n=arguments.length,s=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(n<3?r(s):n>3?r(t,o,s):r(t,o))||s);return n>3&&s&&Object.defineProperty(t,o,s),s},Ce=function(e){function o(){return null!==e&&e.apply(this,arguments)||this}return Se(o,e),Ie([t.Property("")],o.prototype,"text",void 0),Ie([t.Property("")],o.prototype,"iconCss",void 0),Ie([t.Property(!0)],o.prototype,"visible",void 0),o}(t.ChildProperty),Te=function(){var e=function(t,o){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(t,o)};return function(t,o){function i(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(i.prototype=o.prototype,new i)}}(),we=function(e,t,o,i){var r,n=arguments.length,s=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(n<3?r(s):n>3?r(t,o,s):r(t,o))||s);return n>3&&s&&Object.defineProperty(t,o,s),s},ke=function(e){function o(){return null!==e&&e.apply(this,arguments)||this}return Te(o,e),we([t.Property("")],o.prototype,"text",void 0),we([t.Property("")],o.prototype,"id",void 0),we([t.Property("")],o.prototype,"keyTip",void 0),we([t.Property("")],o.prototype,"content",void 0),we([t.Property("")],o.prototype,"iconCss",void 0),we([t.Property(!1)],o.prototype,"separator",void 0),we([t.Property(!1)],o.prototype,"isFooter",void 0),we([t.Event()],o.prototype,"backStageItemClick",void 0),o}(t.ChildProperty),Oe=function(){var e=function(t,o){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(t,o)};return function(t,o){function i(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(i.prototype=o.prototype,new i)}}(),Be=function(e,t,o,i){var r,n=arguments.length,s=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(n<3?r(s):n>3?r(t,o,s):r(t,o))||s);return n>3&&s&&Object.defineProperty(t,o,s),s},Pe=function(e){function o(){return null!==e&&e.apply(this,arguments)||this}return Oe(o,e),o.prototype.setProperties=function(t,o){e.prototype.setProperties.call(this,t,o)},Be([t.Property("File")],o.prototype,"text",void 0),Be([t.Property("")],o.prototype,"keyTip",void 0),Be([t.Property(!1)],o.prototype,"visible",void 0),Be([t.Property("auto")],o.prototype,"height",void 0),Be([t.Property("auto")],o.prototype,"width",void 0),Be([t.Property(null)],o.prototype,"target",void 0),Be([t.Complex({},Ce)],o.prototype,"backButton",void 0),Be([t.Collection([],ke)],o.prototype,"items",void 0),Be([t.Property("")],o.prototype,"template",void 0),Be([t.Complex({},W)],o.prototype,"ribbonTooltipSettings",void 0),o}(t.ChildProperty),Le=function(){var e=function(t,o){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(t,o)};return function(t,o){function i(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(i.prototype=o.prototype,new i)}}(),Ee=function(e,t,o,i){var r,n=arguments.length,s=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(n<3?r(s):n>3?r(t,o,s):r(t,o))||s);return n>3&&s&&Object.defineProperty(t,o,s),s},De=function(e){function o(){return null!==e&&e.apply(this,arguments)||this}return Le(o,e),o.prototype.setProperties=function(t,o){e.prototype.setProperties.call(this,t,o)},Ee([t.Property(!1)],o.prototype,"visible",void 0),Ee([t.Property(!1)],o.prototype,"isSelected",void 0),Ee([t.Collection([],fe)],o.prototype,"tabs",void 0),o}(t.ChildProperty),Re="e-ribbon-vertical-center",xe="e-icons e-drop-icon",Me="e-icons e-arrow-left",_e="e-icons e-more-horizontal-1",qe="e-vertical",Ae="e-disabled",je="e-rtl",Ge="e-ribbon-hover",ze="e-ribbon-control",Ne="e-ribbon-popup-control",He="e-ribbon-open",We="e-ribbon-keytip",Ke="e-hscroll-bar",Fe="e-ribbon-hide",Ue="e-ribbon-contextual-tab",Ve="e-ribbon-active",Xe="e-ribbon-tab-item",Ye="e-ribbon-collapse-btn",Ze="e-ribbon-expand-btn",Je="e-ribbon-collapsible",Qe="e-ribbon-overall-of-btn",$e="e-ribbon-group-of-btn",et="e-ribbon-overflow-target",tt="e-ribbon-overflow",ot="e-content",it="e-ribbon-minimize",rt="e-ribbon-group",nt="e-ribbon-single-selection",st="e-ribbon-multiple-selection",at="e-ribbon-group-button",lt="e-ribbon-group-button-overflow-popup",pt="e-ribbon-group-button-content",ct="e-ribbon-group-container",ut="e-ribbon-of-tab",dt="e-ribbon-of-group-container",ht="e-ribbon-group-content",bt="e-ribbon-group-header",mt="e-ribbon-overflow-header",ft="e-ribbon-group-overflow",yt="e-ribbon-group-overflow-ddb",gt="e-ribbon-launcher",vt="e-ribbon-launcher-icon",St="e-icons e-launcher",It="e-ribbon-collection",Ct="e-ribbon-item",Tt="e-ribbon-row",wt="e-ribbon-column",kt="e-ribbon-large-item",Ot="e-ribbon-medium-item",Bt="e-ribbon-small-item",Pt="e-ribbon-content-height",Lt="e-ribbon-template",Et="e-ribbon-help-template",Dt="e-ribbon-tooltip",Rt="e-ribbon-tooltip-target",xt="e-ribbon-tooltip-title",Mt="e-ribbon-tooltip-content",_t="e-ribbon-tooltip-icon",qt="e-ribbon-tooltip-container",At="e-ribbon-text-container",jt="e-ribbon-simplified-mode",Gt="e-ribbon-backstage-popup",zt="e-ribbon-backstage-open",Nt="e-ribbon-backstage-content",Ht="e-ribbon-backstage",Wt="e-ribbon-backstage-menu",Kt="e-ribbon-backstage-template",Ft="e-ribbon-backstage-wrapper",Ut="e-ribbon-backstage-items-wrapper",Vt="_collapsebutton",Xt="_sim_ovrl_overflow",Yt="_sim_grp_overflow",Zt="_header",Jt="_launcher",Qt="_content",$t="_container",eo="_overflow",to="_dropdown",oo="_backstage",io="_backstagepopup",ro="_filemenulist",no="_footermenulist",so="_helppanetemplate",ao="_grpbtn",lo="_keytip",po="--fileMenuWidth",co="--helpTemplateWidth",uo=function(){function o(e){this.parent=e}return o.prototype.getModuleName=function(){return"ribbonButton"},o.prototype.destroy=function(){this.parent=null},o.prototype.createButton=function(t,o){var i=this,r=this.parent.createElement("button",{id:t.id});o.appendChild(r);var s=t.buttonSettings;new n.Button({locale:this.parent.locale,enableRtl:this.parent.enableRtl,enablePersistence:this.parent.enablePersistence,iconPosition:t.activeSize===e.RibbonItemSize.Large?"Top":"Left",iconCss:s.iconCss,disabled:t.disabled,cssClass:(Re+" "+ze+" "+(s.cssClass?s.cssClass:"")).trim(),content:t.activeSize===e.RibbonItemSize.Small?"":s.content,isPrimary:s.isPrimary,isToggle:s.isToggle,created:s.created},r),s.htmlAttributes&&C(r,s.htmlAttributes),r.onclick=function(e){s.clicked&&s.clicked.call(i,e)},r.setAttribute("aria-label",s.content)},o.prototype.addOverFlowEvents=function(e,o,i){var r=this,s=o.querySelector("#"+e.id);s.setAttribute("data-control",e.type.toString());var a=t.getComponent(s,n.Button);a.setProperties({cssClass:a.cssClass+" "+Ne}),s.onclick=function(t){e.buttonSettings.clicked&&e.buttonSettings.clicked.call(r,t),i.toggle()}},o.prototype.removeOverFlowEvents=function(e,o){var i=this,r=o.querySelector("#"+e.id),s=t.getComponent(r,n.Button),a=s.cssClass.split(" ");a=a.filter(function(e){return e!==Ne}),s.setProperties({cssClass:a.join(" ")}),r.onclick=function(t){e.buttonSettings.clicked&&e.buttonSettings.clicked.call(i,t)}},o.prototype.click=function(e){var o=f(this.parent,e);if(o){t.getComponent(o,n.Button).click()}},o.prototype.updateButton=function(o,i){var r=c(this.parent.tabs,i);if(r){t.merge(r.item.buttonSettings,o);var s=f(this.parent,i,r);if(s){var a=t.getComponent(s,n.Button);o.isToggle&&s.classList.add("e-active"),o.cssClass&&(o.cssClass=(Re+" "+ze+" "+o.cssClass).trim()),o.content&&(o.content=r.item.activeSize===e.RibbonItemSize.Small?"":o.content,s.setAttribute("aria-label",o.content)),delete o.clicked,a.setProperties(o)}}},o.prototype.updateButtonSize=function(o,i){t.getComponent(o,n.Button).setProperties({iconPosition:i.activeSize===e.RibbonItemSize.Large?"Top":"Left",content:i.activeSize===e.RibbonItemSize.Small?"":i.buttonSettings.content})},o}(),ho=function(){function e(e){this.parent=e}return e.prototype.getModuleName=function(){return"ribbonCheckBox"},e.prototype.destroy=function(){this.parent=null},e.prototype.createCheckBox=function(e,t){var o=this,i=this.parent.createElement("input",{id:e.id});t.appendChild(i);var r=e.checkBoxSettings;new n.CheckBox({locale:this.parent.locale,enableRtl:this.parent.enableRtl,enablePersistence:this.parent.enablePersistence,checked:r.checked,cssClass:(ze+" "+(r.cssClass?r.cssClass:"")).trim(),label:r.label,labelPosition:r.labelPosition,disabled:e.disabled,created:r.created,htmlAttributes:r.htmlAttributes,change:function(e){r.change&&r.change.call(o,e)}},i)},e.prototype.addOverFlowEvents=function(e,o,i){var r=this,s=o.querySelector("#"+e.id);s.setAttribute("data-control",e.type.toString());var a=t.getComponent(s,n.CheckBox);a.cssClass=a.cssClass+" "+Ne,a.dataBind(),a.change=function(t){e.checkBoxSettings.change&&e.checkBoxSettings.change.call(r,t),i.toggle()}},e.prototype.removeOverFlowEvents=function(e,o){var i=this,r=o.querySelector("#"+e.id),s=t.getComponent(r,n.CheckBox),a=s.cssClass.split(" ");a=a.filter(function(e){return e!==Ne}),s.cssClass=a.join(" "),s.dataBind(),s.change=function(t){e.checkBoxSettings.change&&e.checkBoxSettings.change.call(i,t)}},e.prototype.click=function(e){var o=f(this.parent,e);if(o){t.getComponent(o,n.CheckBox).click()}},e.prototype.updateCheckBox=function(e,o){var i=c(this.parent.tabs,o);if(i){t.merge(i.item.checkBoxSettings,e);var r=f(this.parent,o,i);if(r){e.cssClass&&(e.cssClass=(ze+" "+e.cssClass).trim()),delete e.change;t.getComponent(r,n.CheckBox).setProperties(e)}}},e}(),bo=function(){function e(e){this.parent=e}return e.prototype.getModuleName=function(){return"ribbonColorPicker"},e.prototype.destroy=function(){this.parent=null},e.prototype.createColorPicker=function(e,o){var i=this,r=this.parent.createElement("input",{id:e.id});o.appendChild(r);var n=e.colorPickerSettings,a=new s.ColorPicker({locale:this.parent.locale,enableRtl:this.parent.enableRtl,enablePersistence:this.parent.enablePersistence,columns:n.columns,cssClass:(ze+" "+(n.cssClass?n.cssClass:"")).trim(),disabled:e.disabled,enableOpacity:n.enableOpacity,mode:n.mode,modeSwitcher:n.modeSwitcher,noColor:n.noColor,presetColors:n.presetColors,showButtons:n.showButtons,value:n.value,beforeClose:function(){a.element.parentElement.classList.remove(He),n.beforeClose&&n.beforeClose.call(i)},beforeOpen:n.beforeOpen,beforeTileRender:n.beforeTileRender,created:n.created,change:function(e){n.value=e.value.toString(),n.change&&n.change.call(i,e)},open:function(){a.element.parentElement.classList.add(He),n.open&&n.open.call(i)},select:n.select},r);n.htmlAttributes&&C(r,n.htmlAttributes);var l=a.element.parentElement;t.EventHandler.add(l,"mouseenter",this.toggleWrapperHover.bind(this,l,!0),this),t.EventHandler.add(l,"mouseleave",this.toggleWrapperHover.bind(this,l,!1),this)},e.prototype.toggleWrapperHover=function(e,t){t?e.classList.add(Ge):e.classList.remove(Ge)},e.prototype.addOverFlowEvents=function(e,o,i){var r=this,n=e.colorPickerSettings;if(n.label&&"Simplified"===this.parent.activeLayout){var a=this.parent.createElement("div",{className:"e-ribbon-colorpicker-label",id:e.id+"_label",innerHTML:n.label});o.insertBefore(a,o.firstChild)}var l=o.querySelector("#"+e.id);l.setAttribute("data-control",e.type.toString());var p=t.getComponent(l,s.ColorPicker);p.setProperties({cssClass:p.cssClass+" "+Ne});var c,u=p.splitBtn;p.beforeClose=function(t){c=t.event?t.event.target:null,p.element.parentElement.classList.remove(He),e.colorPickerSettings.beforeClose&&e.colorPickerSettings.beforeClose.call(r)},u.close=function(){c&&!c.closest(".e-ribbon-group-overflow-ddb")&&i.toggle()}},e.prototype.removeOverFlowEvents=function(e,o){var i=this;if(e.colorPickerSettings.label){var r=o.querySelector("#"+e.id+"_label");r&&r.remove()}var n=o.querySelector("#"+e.id),a=t.getComponent(n,s.ColorPicker),l=a.cssClass.split(" ");l=l.filter(function(e){return e!==Ne}),a.setProperties({cssClass:l.join(" ")});a.splitBtn.close=null,a.beforeClose=function(){a.element.parentElement.classList.remove(He),e.colorPickerSettings.beforeClose&&e.colorPickerSettings.beforeClose.call(i)}},e.prototype.getColorPickerObj=function(e){var o=f(this.parent,e);return o?t.getComponent(o,s.ColorPicker):null},e.prototype.getValue=function(e,t,o){var i=this.getColorPickerObj(e);return i?i.getValue(t,o):""},e.prototype.toggle=function(e){var t=this.getColorPickerObj(e);t&&t.toggle()},e.prototype.updateColorPicker=function(e,o){var i=c(this.parent.tabs,o);if(i){t.merge(i.item.checkBoxSettings,e);var r=f(this.parent,o,i);if(r){e.cssClass&&(e.cssClass=(ze+" "+e.cssClass).trim()),delete e.beforeClose,delete e.open;t.getComponent(r,s.ColorPicker).setProperties(e)}}},e.prototype.unwireColorPickerEvents=function(e){var o=t.getComponent(e,s.ColorPicker).element.parentElement;t.EventHandler.remove(o,"mouseenter",this.toggleWrapperHover),t.EventHandler.remove(o,"mouseleave",this.toggleWrapperHover)},e}(),mo=function(){function e(e){this.parent=e}return e.prototype.getModuleName=function(){return"ribbonComboBox"},e.prototype.destroy=function(){this.parent=null},e.prototype.createComboBox=function(e,t){var o=this,r=this.parent.createElement("input",{id:e.id});t.appendChild(r);var n=e.comboBoxSettings;new i.ComboBox({locale:this.parent.locale,enableRtl:this.parent.enableRtl,enablePersistence:this.parent.enablePersistence,allowCustom:!1,floatLabelType:"Never",ignoreAccent:!0,ignoreCase:!0,allowFiltering:n.allowFiltering,autofill:n.autofill,cssClass:(ze+" "+(n.cssClass?n.cssClass:"")).trim(),dataSource:n.dataSource,enabled:!e.disabled,fields:n.fields,filterType:n.filterType,footerTemplate:n.footerTemplate,groupTemplate:n.groupTemplate,headerTemplate:n.headerTemplate,index:n.index,itemTemplate:n.itemTemplate,noRecordsTemplate:n.noRecordsTemplate,placeholder:n.placeholder,popupHeight:n.popupHeight,popupWidth:n.popupWidth,showClearButton:n.showClearButton,sortOrder:n.sortOrder,text:n.text,value:n.value,width:n.width,beforeOpen:n.beforeOpen,open:n.open,htmlAttributes:n.htmlAttributes,close:function(e){n.close&&n.close.call(o,e)},filtering:n.filtering,change:n.change,select:n.select,created:n.created},r)},e.prototype.addOverFlowEvents=function(e,o,r){var n=this,s=e.comboBoxSettings;if(s.label&&"Simplified"===this.parent.activeLayout){var a=this.parent.createElement("div",{className:"e-ribbon-combobox-label",id:e.id+"_label",innerHTML:s.label});o.insertBefore(a,o.firstChild)}var l=o.querySelector("#"+e.id);l.setAttribute("data-control",e.type.toString());var p=t.getComponent(l,i.ComboBox);p.setProperties({cssClass:p.cssClass+" "+Ne}),p.close=function(t){var o=t.event?t.event.target:null;e.comboBoxSettings.close&&e.comboBoxSettings.close.call(n,t),o&&!o.closest(".e-ribbon-group-overflow-ddb")&&r.toggle()}},e.prototype.removeOverFlowEvents=function(e,o){var r=this;if(e.comboBoxSettings.label){var n=o.querySelector("#"+e.id+"_label");n&&n.remove()}var s=o.querySelector("#"+e.id),a=t.getComponent(s,i.ComboBox),l=a.cssClass.split(" ");l=l.filter(function(e){return e!==Ne}),a.setProperties({cssClass:l.join(" ")}),a.close=function(t){e.comboBoxSettings.close&&e.comboBoxSettings.close.call(r,t)}},e.prototype.getComboBoxObj=function(e){var o=f(this.parent,e);return o?t.getComponent(o,i.ComboBox):null},e.prototype.filter=function(e,t,o,i){this.getComboBoxObj(e).filter(t,o,i)},e.prototype.hidePopup=function(e){var t=this.getComboBoxObj(e);t&&t.hidePopup()},e.prototype.showPopup=function(e){var t=this.getComboBoxObj(e);t&&t.showPopup()},e.prototype.updateComboBox=function(e,o){var r=c(this.parent.tabs,o);if(r){t.merge(r.item.comboBoxSettings,e);var n=f(this.parent,o,r);if(n){e.cssClass&&(e.cssClass=(ze+" "+e.cssClass).trim()),delete e.close;t.getComponent(n,i.ComboBox).setProperties(e)}}},e}(),fo=function(){function o(e){this.parent=e}return o.prototype.getModuleName=function(){return"ribbonDropDown"},o.prototype.destroy=function(){this.parent=null},o.prototype.createDropDown=function(t,o){var i=this,n=this.parent.createElement("button",{id:t.id});o.appendChild(n);var s=t.dropDownSettings,a=(Re+" "+ze+" "+(s.cssClass?s.cssClass:"")).trim();new r.DropDownButton({locale:this.parent.locale,enableRtl:this.parent.enableRtl,enablePersistence:this.parent.enablePersistence,iconPosition:t.activeSize===e.RibbonItemSize.Large?"Top":"Left",closeActionEvents:s.closeActionEvents,content:t.activeSize===e.RibbonItemSize.Small?"":s.content,cssClass:a+(t.activeSize===e.RibbonItemSize.Large?" "+qe:""),disabled:t.disabled,iconCss:s.iconCss,items:s.items,target:s.target,createPopupOnClick:s.createPopupOnClick,beforeClose:function(e){s.beforeClose&&s.beforeClose.call(i,e)},beforeItemRender:s.beforeItemRender,beforeOpen:s.beforeOpen,close:function(e){s.close&&s.close.call(i,e)},created:s.created,open:s.open,select:s.select}).appendTo(n),s.htmlAttributes&&C(n,s.htmlAttributes)},o.prototype.addOverFlowEvents=function(e,o,i){var n=this,s=o.querySelector("#"+e.id);s.setAttribute("data-control",e.type.toString());var a=t.getComponent(s,r.DropDownButton);a.cssClass=a.cssClass+" "+Ne,a.dataBind();var l;a.beforeClose=function(t){e.dropDownSettings.beforeClose&&e.dropDownSettings.beforeClose.call(n,t),l=t.event?t.event.target:null},a.close=function(t){e.dropDownSettings.close&&e.dropDownSettings.close.call(n,t),l&&!l.closest(".e-ribbon-group-overflow-ddb")&&i.toggle()}},o.prototype.removeOverFlowEvents=function(e,o){var i=this,n=o.querySelector("#"+e.id),s=t.getComponent(n,r.DropDownButton),a=s.cssClass.split(" ");a=a.filter(function(e){return e!==Ne}),s.cssClass=a.join(" "),s.dataBind(),s.close=function(t){e.dropDownSettings.close&&e.dropDownSettings.close.call(i,t)},s.beforeClose=function(t){e.dropDownSettings.beforeClose&&e.dropDownSettings.beforeClose.call(i,t)}},o.prototype.createOverFlowDropDown=function(e,o,i,n,s,a){var l=this;this.enableRtl=a;var p=this.parent.createElement("button",{id:e+eo+to});n.setAttribute("tabindex","0"),s.appendChild(p);var c=new r.DropDownButton({iconCss:i,target:n,locale:this.parent.locale,enableRtl:this.parent.enableRtl,enablePersistence:this.parent.enablePersistence,cssClass:qe+" "+yt,iconPosition:"Top",content:o,beforeClose:function(e){e.cancel=!t.isNullOrUndefined(e.event&&t.closest(e.event.target,"."+Ne))}},p);return v(n,this.parent),p.onclick=p.onkeydown=function(){l.itemIndex=0},n.onkeydown=function(e){l.keyActionHandler(e,n)},c},o.prototype.keyActionHandler=function(e,t){var o,i=Array.prototype.slice.call(t.querySelectorAll(".e-control")),r=Array.prototype.slice.call(t.querySelectorAll(".e-ribbon-template")),n=i.concat(r),s=t.querySelectorAll(".e-combobox");if(s)for(var a=0;a<s.length;a++)s[parseInt(a.toString(),10)].closest(".e-input-focus")&&(o=s[parseInt(a.toString(),10)]);if(o)for(a=0;a<n.length;a++)n[parseInt(a.toString(),10)].classList.contains("e-combobox")&&n[parseInt(a.toString(),10)].closest(".e-input-focus")&&(this.itemIndex=a);(e.target.classList.contains("e-control")||e.target.classList.contains("e-ribbon-template")||e.target.classList.contains("e-ribbon-launcher-icon")||e.target.classList.contains("e-ribbon-last-item")||e.target.classList.contains("e-ribbon-first-item"))&&(("ArrowRight"===e.key||!e.shiftKey&&"Tab"===e.key)&&this.handleNavigation(e,!this.enableRtl,n),("ArrowLeft"===e.key||e.shiftKey&&"Tab"===e.key)&&this.handleNavigation(e,this.enableRtl,n))},o.prototype.handleNavigation=function(e,t,o){if(o[0].classList.contains("e-ribbon-first-item")||o[0].classList.add("e-ribbon-first-item"),o[o.length-1].classList.contains("e-ribbon-last-item")||o[o.length-1].classList.add("e-ribbon-last-item"),t){if(0===this.itemIndex&&o[parseInt(this.itemIndex.toString(),10)].classList.contains("e-ribbon-first-item")&&this.updateItemIndex(e,o,!0),e.target.classList.contains("e-combobox")||e.target.classList.contains("e-ribbon-last-item")||e.target.classList.contains("e-ribbon-group-container")||!e.target.classList.contains("e-ribbon-first-item")&&0===this.itemIndex||!e.target.classList.contains("e-control")&&!e.target.classList.contains("e-ribbon-template")||(this.itemIndex++,this.updateItemIndex(e,o,!0)),e.target.classList.contains("e-ribbon-last-item")){this.focusLauncherIcon(e,o)||(this.itemIndex=0,this.updateItemIndex(e,o,!0))}e.target.classList.contains("e-ribbon-launcher-icon")&&(this.itemIndex=0,this.updateItemIndex(e,o,!0))}else{if(e.target.classList.contains("e-combobox")||0===this.itemIndex||(this.itemIndex--,this.updateItemIndex(e,o,!1)),e.target.classList.contains("e-ribbon-first-item")){this.focusLauncherIcon(e,o)||(this.itemIndex=o.length-1,this.updateItemIndex(e,o,!1))}e.target.classList.contains("e-ribbon-launcher-icon")&&(this.itemIndex=o.length-1,this.updateItemIndex(e,o,!1))}e.target.classList.contains("e-combobox")&&"Tab"===e.key&&(t?this.itemIndex<o.length-1&&this.itemIndex++:this.itemIndex>0&&this.itemIndex--)},o.prototype.focusLauncherIcon=function(e,t){var o,i=t[parseInt(this.itemIndex.toString(),10)].closest(".e-ribbon-group-container");return i&&(o=i.querySelector(".e-ribbon-launcher-icon")),!!o&&("Tab"===e.key&&e.preventDefault(),i.querySelector(".e-ribbon-launcher-icon").focus(),!0)},o.prototype.updateItemIndex=function(e,t,o){for(var i=t[this.itemIndex].closest(".e-ribbon-item");i&&i.classList.contains("e-disabled");){if(o)if(this.itemIndex<t.length-1)this.itemIndex++;else{if(this.focusLauncherIcon(e,t))break;this.itemIndex=0}else if(this.itemIndex>0)this.itemIndex--;else{if(this.focusLauncherIcon(e,t))break;this.itemIndex=t.length-1}i=t[this.itemIndex].closest(".e-ribbon-item")}"Tab"===e.key&&e.preventDefault(),t[parseInt(this.itemIndex.toString(),10)].focus()},o.prototype.removeOverFlowDropDown=function(e){var o=t.getComponent(e,r.DropDownButton);t.getComponent(o.target,a.Tooltip).destroy(),e.parentElement.parentElement.insertBefore(o.target,e.parentElement),o.destroy(),t.remove(e)},o.prototype.getDDBItemElement=function(e,o){return t.getComponent(e,r.DropDownButton).dropDown.element.querySelector("#"+o)},o.prototype.getOverflowDropDownPopup=function(e,o){var i=o.querySelector("#"+this.parent.tabs[e.tabIndex].groups[e.groupIndex].id+eo+to);return t.getComponent(i,r.DropDownButton).dropDown.element},o.prototype.getDropDownObj=function(e){var o=f(this.parent,e);return o?t.getComponent(o,r.DropDownButton):null},o.prototype.addItems=function(e,t,o){this.getDropDownObj(e).addItems(t,o)},o.prototype.removeItems=function(e,t,o){this.getDropDownObj(e).removeItems(t,o)},o.prototype.toggle=function(e){this.getDropDownObj(e).toggle()},o.prototype.updateDropDown=function(o,i){var n=c(this.parent.tabs,i);if(n){t.merge(n.item.dropDownSettings,o);var s=f(this.parent,i,n);if(s){var a=t.getComponent(s,r.DropDownButton);o.cssClass&&(o.cssClass=(ze+" "+Re+" "+o.cssClass).trim(),o.cssClass=n.item.activeSize===e.RibbonItemSize.Large?(qe+" "+o.cssClass).trim():o.cssClass,a.cssClass=o.cssClass),delete o.close,delete o.beforeClose,o.content&&(o.content=n.item.activeSize===e.RibbonItemSize.Small?"":o.content),a.setProperties(o)}}},o.prototype.updateDropDownSize=function(o,i){var n=t.getComponent(o,r.DropDownButton),s=n.cssClass.split(" ");i.activeSize===e.RibbonItemSize.Large?s.push(qe):s=s.filter(function(e){return e!==qe}),n.cssClass=s.join(" "),n.setProperties({iconPosition:i.activeSize===e.RibbonItemSize.Large?"Top":"Left"}),n.setProperties({content:i.activeSize===e.RibbonItemSize.Small?"":i.dropDownSettings.content})},o}(),yo=function(){function o(e){this.parent=e}return o.prototype.getModuleName=function(){return"ribbonSplitButton"},o.prototype.destroy=function(){this.parent=null},o.prototype.createSplitButton=function(o,i){var n=this,s=this.parent.createElement("button",{id:o.id});i.appendChild(s);var a=o.splitButtonSettings,l=(Re+" "+ze+" "+(a.cssClass?a.cssClass:"")).trim(),p=new r.SplitButton({locale:this.parent.locale,enableRtl:this.parent.enableRtl,enablePersistence:this.parent.enablePersistence,iconPosition:o.activeSize===e.RibbonItemSize.Large?"Top":"Left",closeActionEvents:a.closeActionEvents,cssClass:l+(o.activeSize===e.RibbonItemSize.Large?" "+qe:""),disabled:o.disabled,iconCss:a.iconCss,items:a.items,target:a.target,beforeClose:function(e){a.beforeClose&&a.beforeClose.call(n,e)},beforeItemRender:a.beforeItemRender,beforeOpen:a.beforeOpen,close:function(){p.wrapper.classList.remove(He),a.close&&a.close.call(n)},created:a.created,open:function(){p.wrapper.classList.add(He),a.open&&a.open.call(n)},select:a.select,click:function(e){a.click&&a.click.call(n,e)}},s);a.htmlAttributes&&C(s,a.htmlAttributes);var c=s.parentElement.querySelector(".e-dropdown-btn");c.onkeydown=function(e){"Enter"===e.key&&(e.stopImmediatePropagation(),c.click())},this.setContent(o,p);var u=p.wrapper;t.EventHandler.add(u,"mouseenter",function(){u.classList.add(Ge)},this),t.EventHandler.add(u,"mouseleave",function(){u.classList.remove(Ge)},this)},o.prototype.addOverFlowEvents=function(e,o,i){var n=this,s=o.querySelector("#"+e.id);s.setAttribute("data-control",e.type.toString());var a=t.getComponent(s,r.SplitButton);a.cssClass=a.cssClass+" "+Ne,a.dataBind();var l=s.parentElement.querySelector(".e-dropdown-btn"),p=l.getAttribute("id"),c=document.querySelector("#"+p+"-popup");l.onkeydown=function(e){"Enter"===e.key&&(e.stopImmediatePropagation(),l.click())},c.onkeydown=function(e){"Enter"===e.key&&(e.preventDefault(),a.wrapper.classList.remove("e-ribbon-open"),c.querySelector(".e-focused").click())};var u;a.beforeClose=function(t){e.splitButtonSettings.beforeClose&&e.splitButtonSettings.beforeClose.call(n,t),u=t.event?t.event.target:null},a.click=function(t){e.splitButtonSettings.click&&e.splitButtonSettings.click.call(n,t),i.toggle()},a.close=function(t){e.splitButtonSettings.close&&e.splitButtonSettings.close.call(n,t),a.wrapper.classList.remove(He),u&&!u.closest(".e-ribbon-group-overflow-ddb")&&i.toggle()}},o.prototype.removeOverFlowEvents=function(e,o){var i=this,n=o.querySelector("#"+e.id),s=t.getComponent(n,r.SplitButton),a=s.cssClass.split(" ");a=a.filter(function(e){return e!==Ne}),s.cssClass=a.join(" "),s.dataBind(),s.beforeClose=function(t){e.splitButtonSettings.beforeClose&&e.splitButtonSettings.beforeClose.call(i,t)},s.click=function(t){e.splitButtonSettings.click&&e.splitButtonSettings.click.call(i,t)},s.close=function(t){e.splitButtonSettings.close&&e.splitButtonSettings.close.call(i,t),s.wrapper.classList.remove(He)}},o.prototype.setContent=function(t,o){o.primaryBtnObj.setProperties({content:t.activeSize===e.RibbonItemSize.Medium?t.splitButtonSettings.content:""}),o.secondaryBtnObj.setProperties({content:t.activeSize===e.RibbonItemSize.Large?t.splitButtonSettings.content:""})},o.prototype.getSplitButtonObj=function(e){var o=f(this.parent,e);return t.getComponent(o,r.SplitButton)},o.prototype.addItems=function(e,t,o){this.getSplitButtonObj(e).addItems(t,o)},o.prototype.removeItems=function(e,t,o){this.getSplitButtonObj(e).removeItems(t,o)},o.prototype.toggle=function(e){this.getSplitButtonObj(e).toggle()},o.prototype.updateSplitButton=function(o,i){var n=c(this.parent.tabs,i);if(n){t.merge(n.item.splitButtonSettings,o);var s=f(this.parent,i,n);if(s){var a=t.getComponent(s,r.SplitButton);o.cssClass&&(o.cssClass=(ze+" "+Re+" "+o.cssClass).trim(),o.cssClass=n.item.activeSize===e.RibbonItemSize.Large?(qe+" "+o.cssClass).trim():o.cssClass,a.cssClass=o.cssClass),delete o.open,delete o.click,delete o.close,delete o.beforeClose,a.setProperties(o),o.content&&this.setContent(n.item,a)}}},o.prototype.updateSplitButtonSize=function(o,i){var n=t.getComponent(o,r.SplitButton),s=n.cssClass.split(" ");i.activeSize===e.RibbonItemSize.Large?s.push(qe):s=s.filter(function(e){return e!==qe}),n.cssClass=s.join(" "),n.setProperties({iconPosition:i.activeSize===e.RibbonItemSize.Large?"Top":"Left"}),this.setContent(i,n)},o}(),go=function(){function o(e){this.parent=e,this.isSelected=!1}return o.prototype.getModuleName=function(){return"ribbonGroupButton"},o.prototype.destroy=function(){this.parent=null},o.prototype.createGroupButton=function(o,i){var s=this,a=o.groupButtonSettings;this.count=0;var l=this.parent.createElement("div",{id:o.id+ao,className:"e-btn-group"});i.appendChild(l);for(var p=0;p<a.items.length;p++)if(a.items[parseInt(p.toString(),10)].iconCss){var c=this.parent.createElement("button",{id:o.id+ao+p,className:at});l.appendChild(c),new n.Button({iconCss:a.items[parseInt(p.toString(),10)].iconCss,disabled:o.disabled,enableRtl:this.parent.enableRtl,content:o.activeSize===e.RibbonItemSize.Small?"":a.items[parseInt(p.toString(),10)].content,iconPosition:o.activeSize===e.RibbonItemSize.Large?"Top":"Left"},c),a.items[parseInt(p.toString(),10)].htmlAttributes&&C(c,a.items[parseInt(p.toString(),10)].htmlAttributes),a.items[parseInt(p.toString(),10)].content&&c.classList.add(pt);var u=i.querySelector("#"+o.id+ao+p);a.selection===e.RibbonGroupButtonSelection.Single?l.classList.add(nt):l.classList.add(st),a.items[parseInt(p.toString(),10)].selected&&(a.selection===e.RibbonGroupButtonSelection.Multiple?u.classList.add("e-active"):this.count<1&&(u.classList.add("e-active"),this.count++)),a.items[parseInt(p.toString(),10)].ribbonTooltipSettings&&y(a.items[parseInt(p.toString(),10)].ribbonTooltipSettings)&&(c.classList.add(Rt),this.parent.tooltipData.push({id:c.id,data:a.items[parseInt(p.toString(),10)].ribbonTooltipSettings})),t.EventHandler.add(u,"click",this.groupButtonClicked.bind(this,p,o,a),this)}if("Simplified"===this.parent.activeLayout){var d=void 0,h=0,b=0;u=this.parent.createElement("button",{id:o.id});i.appendChild(u);for(p=0;p<a.items.length;p++)o.groupButtonSettings.items[parseInt(p.toString(),10)].selected&&!this.isSelected&&a.selection===e.RibbonGroupButtonSelection.Single?(d=o.groupButtonSettings.items[parseInt(p.toString(),10)].iconCss,this.isSelected=!0):o.groupButtonSettings.items[parseInt(p.toString(),10)].selected&&a.selection===e.RibbonGroupButtonSelection.Multiple&&(d=1===++h?o.groupButtonSettings.items[parseInt(p.toString(),10)].iconCss:null);for(;b<o.groupButtonSettings.items.length&&!this.isSelected&&!d;)o.groupButtonSettings.items[parseInt(b.toString(),10)].iconCss&&(d=o.groupButtonSettings.items[parseInt(b.toString(),10)].iconCss,this.isSelected=!0),b++;var m=new r.DropDownButton({iconCss:d,target:l,enableRtl:this.parent.enableRtl,cssClass:"e-ribbon-dropdown-group-button",disabled:o.disabled},u);if(a.header){var f=m.dropDown;this.addGroupButtonHeader(o.id,a,f.element)}u.onclick=u.onkeydown=function(){s.handleFocusState(o,i)},l.onkeydown=function(e){"Simplified"===s.parent.activeLayout&&s.handleGroupButtonNavigation(e,o)},v(l,this.parent),this.isSelected=!1}},o.prototype.groupButtonClicked=function(o,i,n){for(var s,a,l=[],p=[],c=[],u=0;u<n.items.length;u++)document.querySelector("#"+i.id+ao+u)&&document.querySelector("#"+i.id+ao+u).classList.contains("e-active")&&l.push(n.items[parseInt(u.toString(),10)]);document.querySelector("#"+i.id+ao+o).classList.contains("e-active")||p.push(n.items[parseInt(o.toString(),10)]);var d={cancel:!1,previousItems:l,selectingItems:p};if(n.items[parseInt(o.toString(),10)].beforeClick&&n.items[parseInt(o.toString(),10)].beforeClick.call(this,d),!d.cancel){if(n.selection===e.RibbonGroupButtonSelection.Single){document.querySelector("#"+i.id+ao).classList.contains(st)&&(document.querySelector("#"+i.id+ao).classList.remove(st),document.querySelector("#"+i.id+ao).classList.add(nt));for(u=0;u<n.items.length;u++)document.querySelector("#"+i.id+ao+u)&&document.querySelector("#"+i.id+ao+u).classList.contains("e-active")&&(document.querySelector("#"+i.id+ao+u).classList.remove("e-active"),n.items[parseInt(u.toString(),10)].setProperties({selected:!1},!0));document.querySelector("#"+i.id+ao+o).classList.toggle("e-active"),n.items[parseInt(o.toString(),10)].setProperties({selected:!0},!0),document.querySelector("#"+i.id+ao+o).classList.contains("e-active")&&"Simplified"===this.parent.activeLayout&&(this.grpBtnIndex=o,s=document.querySelector("#"+i.id),(a=t.getComponent(s,r.DropDownButton)).setProperties({iconCss:n.items[parseInt(o.toString(),10)].iconCss}))}else{document.querySelector("#"+i.id+ao).classList.contains(nt)&&(document.querySelector("#"+i.id+ao).classList.remove(nt),document.querySelector("#"+i.id+ao).classList.add(st)),document.querySelector("#"+i.id+ao+o).classList.toggle("e-active"),document.querySelector("#"+i.id+ao+o).classList.contains("e-active")?n.items[parseInt(o.toString(),10)].setProperties({selected:!0},!0):n.items[parseInt(o.toString(),10)].setProperties({selected:!1},!0);for(var h=0,b=0;b<n.items.length;b++)document.querySelector("#"+i.id+ao+b)&&document.querySelector("#"+i.id+ao+b).classList.contains("e-active")&&"Simplified"===this.parent.activeLayout&&b!==o&&(this.isSelected=!0,h++);if("Simplified"===this.parent.activeLayout){var m=null,f=0;if(s=document.querySelector("#"+i.id),a=t.getComponent(s,r.DropDownButton),this.isSelected){if(1===h&&!document.querySelector("#"+i.id+ao+o).classList.contains("e-active"))for(b=0;b<n.items.length;b++)document.querySelector("#"+i.id+ao+b)&&document.querySelector("#"+i.id+ao+b).classList.contains("e-active")&&(m=n.items[parseInt(b.toString(),10)].iconCss)}else document.querySelector("#"+i.id+ao+o).classList.contains("e-active")&&(m=n.items[parseInt(o.toString(),10)].iconCss);for(;f<n.items.length&&!m;)n.items[parseInt(f.toString(),10)].iconCss&&(m=n.items[parseInt(f.toString(),10)].iconCss),f++;a.setProperties({iconCss:m}),this.grpBtnIndex=o}this.isSelected=!1}document.querySelector("#"+i.id+ao+o).classList.contains("e-active")&&c.push(n.items[parseInt(o.toString(),10)]);var y={previousItems:l,selectedItems:c};n.items[parseInt(o.toString(),10)].click&&n.items[parseInt(o.toString(),10)].click.call(this,y)}},o.prototype.switchGroupButton=function(o,i){var n=this,s=o.groupButtonSettings,a=null,l=0,p=0;if("Simplified"===this.parent.activeLayout){var c=i.querySelector("#"+o.id+ao),u=this.parent.createElement("button",{id:o.id});i.appendChild(u);for(var d=0;d<s.items.length;d++)document.querySelector("#"+o.id+ao+d)&&(document.querySelector("#"+o.id+ao+d).classList.contains("e-active")&&s.selection===e.RibbonGroupButtonSelection.Single?a=s.items[parseInt(d.toString(),10)].iconCss:document.querySelector("#"+o.id+ao+d).classList.contains("e-active")&&s.selection===e.RibbonGroupButtonSelection.Multiple&&(1===++l?a=s.items[parseInt(d.toString(),10)].iconCss:l>1&&(a=null)));for(;p<s.items.length&&!a;)s.items[parseInt(p.toString(),10)].iconCss&&(a=s.items[parseInt(p.toString(),10)].iconCss),p++;var h=new r.DropDownButton({iconCss:a,target:c,enableRtl:this.parent.enableRtl,cssClass:"e-ribbon-dropdown-group-button",disabled:o.disabled},u);if(s.header){var b=h.dropDown;this.addGroupButtonHeader(o.id,s,b.element)}u.onclick=u.onkeydown=function(){n.handleFocusState(o,i)},c.onkeydown=function(e){"Simplified"===n.parent.activeLayout&&n.handleGroupButtonNavigation(e,o)},v(c,this.parent)}else{var m=i.querySelector("#"+o.id);h=t.getComponent(m,r.DropDownButton);i.appendChild(h.target),m&&(h.destroy(),t.remove(m))}},o.prototype.handleFocusState=function(e,t){if(t.querySelector("#"+e.id).classList.contains("e-active")){var o=document.querySelector("#"+e.id+"_grpbtn").querySelector("."+at+".e-active");o?o.focus():document.querySelector("#"+e.id+ao+0).focus(),this.grpBtnIndex=0}},o.prototype.addGroupButtonHeader=function(e,t,o){var i=this.parent.createElement("div",{className:"e-ribbon-groupbutton-header",id:e+Zt,innerHTML:t.header});o.insertBefore(i,o.firstChild)},o.prototype.handleGroupButtonNavigation=function(e,o){var i=document.querySelector("#"+o.id),n=t.getComponent(i,r.DropDownButton).target,s=!1;"Simplified"===this.parent.activeLayout&&n.closest(".e-ribbon-dropdown-group-button").classList.contains(lt)&&(s=!0),"Tab"===e.key&&e.preventDefault();var a=o.groupButtonSettings;"ArrowRight"===e.key&&!s||"ArrowDown"===e.key&&s?!this.parent.enableRtl||"ArrowDown"===e.key&&s?(this.grpBtnIndex++,this.grpBtnIndex<a.items.length?document.querySelector("#"+o.id+ao+this.grpBtnIndex).focus():(this.grpBtnIndex=0,document.querySelector("#"+o.id+ao+this.grpBtnIndex).focus())):0===this.grpBtnIndex?(this.grpBtnIndex=a.items.length-1,document.querySelector("#"+o.id+ao+this.grpBtnIndex).focus()):(this.grpBtnIndex--,document.querySelector("#"+o.id+ao+this.grpBtnIndex).focus()):("ArrowLeft"===e.key&&!s||"ArrowUp"===e.key&&s)&&(!this.parent.enableRtl||"ArrowUp"===e.key&&s?0===this.grpBtnIndex?(this.grpBtnIndex=a.items.length-1,document.querySelector("#"+o.id+ao+this.grpBtnIndex).focus()):(this.grpBtnIndex--,document.querySelector("#"+o.id+ao+this.grpBtnIndex).focus()):(this.grpBtnIndex++,this.grpBtnIndex<a.items.length?document.querySelector("#"+o.id+ao+this.grpBtnIndex).focus():(this.grpBtnIndex=0,document.querySelector("#"+o.id+ao+this.grpBtnIndex).focus())))},o.prototype.addOverFlowEvents=function(e,o,i){var n=this,s=e.groupButtonSettings,a=!0,l=o.querySelector("#"+e.id),p=t.getComponent(l,r.DropDownButton);p.setProperties({cssClass:p.cssClass+" "+lt,content:s.header?s.header:""});var c=p.target;if(c.children.length){for(var u=0;u<c.children.length;u++)if(s.items[parseInt(u.toString(),10)].content){a=!1;break}a&&c.classList.add("e-icon-btn")}c.onclick=function(){"Simplified"===n.parent.activeLayout&&c.closest(".e-ribbon-dropdown-group-button").classList.contains(lt)&&(p.toggle(),i.toggle())}},o.prototype.removeOverFlowEvents=function(e,o){var i=o.querySelector("#"+e.id);if(i){var n=t.getComponent(i,r.DropDownButton),s=n.target;s.classList.contains("e-icon-btn")&&s.classList.remove("e-icon-btn");var a=n.cssClass.split(" ");a=a.filter(function(e){return e!==lt}),n.setProperties({cssClass:a.join(" "),content:""})}},o.prototype.destroyDropDown=function(e){var o=document.querySelector("#"+e.id);if(o){var i=t.getComponent(o,r.DropDownButton);t.getComponent(i.target,a.Tooltip).destroy(),i.destroy(),t.remove(o)}},o.prototype.updateGroupButtonSize=function(o,i){for(var r,s=i.groupButtonSettings,a=0;a<s.items.length;a++)if(r="Classic"===this.parent.activeLayout?o.querySelector("#"+i.id+ao+a):document.querySelector("#"+i.id+ao+a)){t.getComponent(r,n.Button).setProperties({iconPosition:i.activeSize===e.RibbonItemSize.Large?"Top":"Left",content:i.activeSize===e.RibbonItemSize.Small?"":s.items[parseInt(a.toString(),10)].content})}},o}(),vo=function(){function e(e){this.count=0,this.isAdded=!1,this.galleryItemsIndex=0,this.parent=e}return e.prototype.getModuleName=function(){return"ribbonGallery"},e.prototype.destroy=function(){this.parent=null},e.prototype.createGallery=function(e,o){var i=this,r=e.gallerySettings;this.renderGalleryItems(r,!1,e.id,o);var n=this.parent.createElement("button",{id:e.id+"_popupButton",className:"e-ribbon-gallery-button e-icons e-drop-icon"});o.appendChild(n),this.createPopup(e,n),n.onclick=function(o){var n=document.querySelector("#"+e.id+"_galleryPopup");if(n){var s=t.getComponent(n,a.Popup);n.classList.contains("e-popup-close")?i.showPopup(s,n,o,r,e.id):i.hidePopup(s,n,o,r,e.id)}},document.onclick=function(e){for(var o,r,n=document.querySelectorAll(".e-ribbon-gallery-popup.e-popup-open"),s=0;s<n.length;s++){var l=t.getComponent(n[parseInt(s.toString(),10)],a.Popup);if(!e.target.classList.contains("e-ribbon-gallery-button")){o=n[parseInt(s.toString(),10)].id.replace(/_galleryPopup/g,""),r=c(i.parent.tabs,o),i.hidePopup(l,n[parseInt(s.toString(),10)],e,r.item.gallerySettings,o);break}if(o=n[parseInt(s.toString(),10)].id.replace(/_galleryPopup/g,""),e.target.id.replace(/_popupButton/g,"")!==o){r=c(i.parent.tabs,o),i.hidePopup(l,n[parseInt(s.toString(),10)],e,r.item.gallerySettings,o);break}}}},e.prototype.renderGalleryItems=function(e,t,o,i){var r,n,s=this,a=c(this.parent.tabs,o);a&&a.group&&(a.group.isCollapsible=!1);var l=this.parent.createElement("div",{className:"e-ribbon-gallery-wrapper",id:o+"_galleryWrapper"});t||i.appendChild(l);for(var p=function(a){var p=!1;r=u.parent.createElement("ol",{className:"e-ribbon-gallery-container",id:o+"_galleryContainer"+a}),e.groups[parseInt(a.toString(),10)].itemHeight&&"auto"!==e.groups[parseInt(a.toString(),10)].itemHeight&&(p=!0),e.groups[parseInt(a.toString(),10)].cssClass&&r.classList.add(e.groups[parseInt(a.toString(),10)].cssClass);for(var c=function(i){n=u.parent.createElement("li",{className:"e-ribbon-gallery-item",id:r.id+"_gallery"+i,attrs:{tabindex:"0"}});var c={name:"beforeItemRender",item:e.groups[parseInt(a.toString(),10)].items[parseInt(i.toString(),10)]};if(e.beforeItemRender&&e.beforeItemRender.call(u,c),r.appendChild(n),e.selectedItemIndex&&e.selectedItemIndex===u.count?n.classList.add("e-ribbon-gallery-selected"):e.selectedItemIndex||0!==u.count||(n.classList.add("e-ribbon-gallery-selected"),e.selectedItemIndex=u.count),u.count=u.count+1,n.onclick=function(t){s.setActiveState(t.currentTarget,e,o,!0,t)},n.onkeydown=function(t){"Enter"!==t.key&&" "!==t.key||s.setActiveState(t.currentTarget,e,o,!0,t)},n.onmouseover=function(t){var o={event:t,name:"itemHover",item:e.groups[parseInt(a.toString(),10)].items[parseInt(i.toString(),10)]};e.itemHover&&e.itemHover.call(s,o)},e.groups[parseInt(a.toString(),10)].itemWidth&&"auto"!==e.groups[parseInt(a.toString(),10)].itemWidth&&(n.style.width=e.groups[parseInt(a.toString(),10)].itemWidth+"px"),e.groups[parseInt(a.toString(),10)].itemHeight&&"auto"!==e.groups[parseInt(a.toString(),10)].itemHeight&&(n.style.height=e.groups[parseInt(a.toString(),10)].itemHeight+"px",n.style.paddingTop="0px",n.style.paddingBottom="0px","Simplified"===u.parent.activeLayout||t||(r.style.flexFlow="wrap")),!e.template&&!e.popupTemplate||e.template&&!e.popupTemplate&&t||e.popupTemplate&&!e.template&&!t){if(e.groups[parseInt(a.toString(),10)].items[parseInt(i.toString(),10)].htmlAttributes&&C(n,e.groups[parseInt(a.toString(),10)].items[parseInt(i.toString(),10)].htmlAttributes),e.groups[parseInt(a.toString(),10)].items[parseInt(i.toString(),10)].iconCss){var d=u.parent.createElement("span",{className:"e-ribbon-gallery-icons "+e.groups[parseInt(a.toString(),10)].items[parseInt(i.toString(),10)].iconCss});n.appendChild(d),"Simplified"!==u.parent.activeLayout||t||d.classList.add("e-hidden")}e.groups[parseInt(a.toString(),10)].items[parseInt(i.toString(),10)].content&&n.appendChild(u.parent.createElement("span",{innerHTML:e.groups[parseInt(a.toString(),10)].items[parseInt(i.toString(),10)].content,className:"e-ribbon-gallery-text"})),e.groups[parseInt(a.toString(),10)].items[parseInt(i.toString(),10)].disabled&&n.classList.add("e-disabled"),e.groups[parseInt(a.toString(),10)].items[parseInt(i.toString(),10)].cssClass&&n.classList.add(e.groups[parseInt(a.toString(),10)].items[parseInt(i.toString(),10)].cssClass)}if(e.template&&!t&&u.createGalleryTemplate(n,e,o,e.groups[parseInt(a.toString(),10)].items[parseInt(i.toString(),10)]),e.popupTemplate&&t&&u.createGalleryPopupTemplate(n,e,o,e.groups[parseInt(a.toString(),10)].items[parseInt(i.toString(),10)]),!t&&!p&&e.itemCount===u.count)return l.appendChild(r),u.isAdded=!0,"break"},d=0;d<e.groups[parseInt(a.toString(),10)].items.length;d++){if("break"===c(d))break}if(u.isAdded&&!t)return"break";if(t?i.appendChild(r):l.appendChild(r),t&&e.groups[parseInt(a.toString(),10)].header){var h=u.parent.createElement("div",{className:"e-ribbon-gallery-header",innerHTML:e.groups[parseInt(a.toString(),10)].header});i.insertBefore(h,r)}},u=this,d=0;d<e.groups.length;d++){if("break"===p(d))break}this.count=0,this.isAdded=!1},e.prototype.setWrapperWidth=function(e,o,i,r){for(var n=1,s=0,a=!1,l=0;l<i.groups.length;l++){for(var p=0;p<i.groups[parseInt(l.toString(),10)].items.length;p++)if(i.groups[parseInt(l.toString(),10)].itemHeight&&"auto"!==i.groups[parseInt(l.toString(),10)].itemHeight){if(!(e>=n)){a=!0;break}var c=o.querySelector("#"+r+"_galleryContainer"+l+"_gallery"+p);if(c){s+=c.offsetWidth;var u=window.getComputedStyle(c);if(u){var d=parseFloat(u.paddingLeft)+parseFloat(u.paddingRight);t.isNullOrUndefined(d)||(s+=d);var h=parseFloat(u.marginLeft)+parseFloat(u.marginRight);t.isNullOrUndefined(h)||(s+=h)}}n++}if(a)break}s>0&&(o.style.width=s+"px")},e.prototype.checkAvailableHeight=function(e,o){for(var i=o.querySelectorAll(".e-ribbon-gallery-wrapper"),r=0;r<i.length;r++){var n=!1,s=0,a=i[parseInt(r.toString(),10)],l=a.offsetHeight,p=a.id.replace(/_galleryWrapper/g,""),u=c(this.parent.tabs,p);if(u){this.setWrapperWidth(u.item.gallerySettings.itemCount,a,u.item.gallerySettings,p);for(var d=0;d<u.item.gallerySettings.groups.length;d++)if(u.item.gallerySettings.groups[parseInt(d.toString(),10)].itemHeight&&"auto"!==u.item.gallerySettings.groups[parseInt(d.toString(),10)].itemHeight)for(var h=0;h<u.item.gallerySettings.groups[parseInt(d.toString(),10)].items.length;h++){var b=a.querySelector("#"+p+"_galleryContainer"+d+"_gallery"+h);if(b)if(s++,n)b.remove();else{if(1===s){var m=0,f=window.getComputedStyle(b);if(f){var y=parseFloat(f.paddingTop)+parseFloat(f.paddingBottom);t.isNullOrUndefined(y)||(m+=y);var g=parseFloat(f.marginTop)+parseFloat(f.marginBottom);t.isNullOrUndefined(g)||(m+=g)}l>b.offsetHeight+m?l-=b.offsetHeight+m:(n=!0,b.remove())}s===u.item.gallerySettings.itemCount&&(s=0)}}}}},e.prototype.checkCollision=function(e,o){var i=0,r=0;if(o){var n=window.innerWidth,s=window.getComputedStyle(o);s&&(i=parseFloat(s.paddingLeft)+parseFloat(s.paddingRight),t.isNullOrUndefined(i)||(n-=i));var a=o.querySelectorAll(".e-ribbon-gallery-container");"auto"!==e.width&&a.forEach(function(e){e.style.flexFlow="wrap"});for(var l=!1,p=0;p<a.length;p++){for(var c=0,u=0;u<a[parseInt(p.toString(),10)].querySelectorAll(".e-ribbon-gallery-item").length;u++){var d=window.getComputedStyle(a[parseInt(p.toString(),10)].querySelectorAll(".e-ribbon-gallery-item")[parseInt(u.toString(),10)]);if(d&&(r=parseFloat(d.marginLeft)+parseFloat(d.marginRight),t.isNullOrUndefined(r)||(c+=r)),c+=a[parseInt(p.toString(),10)].querySelectorAll(".e-ribbon-gallery-item")[parseInt(u.toString(),10)].offsetWidth,n<=c&&"auto"===e.width||"auto"!==e.width&&n<=parseInt(e.width.toString(),10)&&n<=c){o.style.width=c+Math.abs(i-r)-a[parseInt(p.toString(),10)].querySelectorAll(".e-ribbon-gallery-item")[parseInt(u.toString(),10)].offsetWidth+"px",l=!0;break}}if(l){a.forEach(function(e){e.style.flexFlow="wrap"});break}}l||("auto"===e.width?(a.forEach(function(e){e.style.flexFlow="nowrap"}),o.style.width="auto"):o.style.width=e.width.toString())}},e.prototype.createPopup=function(e,t){var o=this.parent.createElement("div",{className:"e-ribbon-popup-container",id:e.id+"_popupContainer"});this.renderGalleryItems(e.gallerySettings,!0,e.id,o);var i=this.parent.createElement("div",{className:"e-ribbon-gallery-popup",id:e.id+"_galleryPopup"});document.body.append(i);new a.Popup(i,{relateTo:t,content:o,collision:{X:"fit",Y:"flip"},actionOnScroll:"hide",targetType:"relative",position:{X:"left",Y:"bottom"},enableRtl:this.parent.enableRtl,width:e.gallerySettings.popupWidth,height:e.gallerySettings.popupHeight}).hide()},e.prototype.switchGalleryItems=function(e,t){var o=this.parent.element.querySelector("#"+t+$t),i=0,r=c(this.parent.tabs,t);if(o){var n=o.querySelector(".e-ribbon-gallery-wrapper"),s=o.querySelectorAll(".e-ribbon-gallery-icons"),a=o.querySelectorAll(".e-ribbon-gallery-container");if(s.length)for(var l=0;l<s.length;l++)"Simplified"===e?s[parseInt(l.toString(),10)].classList.add("e-hidden"):s[parseInt(l.toString(),10)].classList.remove("e-hidden");if(a.length&&r)for(var p=0;p<r.item.gallerySettings.groups.length;p++)for(l=0;l<a.length;l++)r.item.gallerySettings.groups[parseInt(p.toString(),10)].itemHeight&&"auto"!==r.item.gallerySettings.groups[parseInt(p.toString(),10)].itemHeight&&t+"_galleryContainer"+p===a[parseInt(l.toString(),10)].id&&(a[parseInt(l.toString(),10)].style.flexFlow="Simplified"===e?"nowrap":"wrap");if(n)for(p=0;p<r.item.gallerySettings.groups.length;p++)for(l=0;l<r.item.gallerySettings.groups[parseInt(p.toString(),10)].items.length;l++)if(++i>r.item.gallerySettings.itemCount){var u=n.querySelector("#"+t+"_galleryContainer"+p+"_gallery"+l);u&&("Simplified"===e?u.classList.add("e-hidden"):u.classList.remove("e-hidden"))}}},e.prototype.addOverFlowEvents=function(e,o,i){var n=this;if(o.closest(".e-ribbon-overflow-target")){var s=this.parent.createElement("button",{id:e.id});o.appendChild(s),o.querySelector(".e-ribbon-gallery-wrapper").classList.add("e-hidden"),o.querySelectorAll(".e-ribbon-gallery-container").forEach(function(e){e.classList.add("e-hidden")});var l=o.querySelector("#"+e.id+"_popupButton");l&&l.classList.add("e-hidden");var p=c(this.parent.tabs,e.id),u=p&&p.group.groupIconCss?p.group.groupIconCss:"",d=p&&p.group.header?p.group.header:"";if(!u)for(var h=0;h<e.gallerySettings.groups.length;h++){for(var b=0;b<e.gallerySettings.groups[parseInt(h.toString(),10)].items.length;b++)if(e.gallerySettings.groups[parseInt(h.toString(),10)].items[parseInt(b.toString(),10)].iconCss){u=e.gallerySettings.groups[parseInt(h.toString(),10)].items[parseInt(b.toString(),10)].iconCss;break}if(u)break}var m=document.querySelector("#"+e.id+"_galleryPopup"),f=t.getComponent(m,a.Popup),y=document.querySelector("#"+e.id+"_galleryPopup .e-ribbon-popup-container"),g=new r.DropDownButton({iconCss:u,content:d,target:y,enableRtl:this.parent.enableRtl,cssClass:"e-ribbon-gallery-dropdown",disabled:e.disabled,open:function(){n.setFoucsToFirstItem(y,!0,e.id),n.checkCollision(g.dropDown,g.dropDown.element)},beforeClose:function(t){n.popupEvents(t.event,e.gallerySettings,"popupClose",!1)&&(t.cancel=!0)}},s);"auto"!==f.width&&(g.dropDown.width=t.formatUnit(f.width)),"auto"!==f.height&&(g.dropDown.height=t.formatUnit(f.height),g.dropDown.element.style.height=f.height.toString())}},e.prototype.removeOverFlowEvents=function(e,o){var i=o.querySelector("#"+e.id+"_popupButton");i&&i.classList.remove("e-hidden"),o.querySelector(".e-ribbon-gallery-wrapper").classList.remove("e-hidden"),o.querySelectorAll(".e-ribbon-gallery-container").forEach(function(e){e.classList.remove("e-hidden")});var n=document.querySelector("#"+e.id);if(n){var s=document.querySelector("#"+e.id+"_galleryPopup"),a=t.getComponent(n,r.DropDownButton);s.appendChild(a.target),a.destroy(),t.remove(n)}},e.prototype.setActiveState=function(e,t,o,i,r){var n,s,a=document.querySelector("#"+o+$t),l=Array.prototype.slice.call(a.querySelectorAll(".e-ribbon-gallery-selected")),p=document.querySelector("#"+o+"_popupContainer"),c=Array.prototype.slice.call(p.querySelectorAll(".e-ribbon-gallery-selected"));c.length&&(l=l.concat(c));for(var u=0;u<t.groups.length;u++)for(var d=0;d<t.groups[parseInt(u.toString(),10)].items.length;d++)l[0].id===o+"_galleryContainer"+u+"_gallery"+d&&(n=t.groups[parseInt(u.toString(),10)].items[parseInt(d.toString(),10)]),e.id===o+"_galleryContainer"+u+"_gallery"+d&&(s=t.groups[parseInt(u.toString(),10)].items[parseInt(d.toString(),10)]);var h=document.querySelectorAll("#"+e.id),b={cancel:!1,name:"beforeSelect",previousItem:n,currentItem:s,isInteracted:i,event:r};if(t.beforeSelect&&t.beforeSelect.call(this,b),!b.cancel){for(u=0;u<l.length;u++)l[parseInt(u.toString(),10)].classList.remove("e-ribbon-gallery-selected");for(u=0;u<h.length;u++)h[parseInt(u.toString(),10)].classList.add("e-ribbon-gallery-selected");var m={previousItem:n,currentItem:s,name:"select",isInteracted:i,event:r},f=document.querySelectorAll("#"+o+"_popupContainer .e-ribbon-gallery-item");for(u=0;u<f.length;u++)if(f[parseInt(u.toString(),10)].id===e.id){t.selectedItemIndex=u;break}t.select&&t.select.call(this,m)}},e.prototype.popupEvents=function(e,t,o,i){var r={cancel:!1,event:e,name:o};return i&&t.popupOpen?t.popupOpen.call(this,r):!i&&t.popupClose&&t.popupClose.call(this,r),!!r.cancel},e.prototype.showPopup=function(e,t,o,i,r){if(!this.popupEvents(o,i,"popupOpen",!0)){e.show(),this.checkCollision(e,t);var n=document.querySelector("#"+r+"_popupButton");n.classList.add("e-gallery-button-active");var s=n.getBoundingClientRect(),a=Math.abs(t.offsetWidth-s.left)+n.offsetWidth;t.style.left=a+"px",t.style.top=t.getBoundingClientRect().top+2+"px",this.setFoucsToFirstItem(t,!1,r,e,i)}},e.prototype.hidePopup=function(e,t,o,i,r){if(!this.popupEvents(o,i,"popupClose",!1)){e.hide();document.querySelector("#"+r+"_popupButton").classList.remove("e-gallery-button-active")}},e.prototype.showGalleryPopup=function(e){var o=c(this.parent.tabs,e),i=document.querySelector("#"+e+"_galleryPopup"),r=t.getComponent(i,a.Popup);this.showPopup(r,i,null,o.item.gallerySettings,e)},e.prototype.hideGalleryPopup=function(e){var o=c(this.parent.tabs,e),i=document.querySelector("#"+e+"_galleryPopup"),r=t.getComponent(i,a.Popup);this.hidePopup(r,i,null,o.item.gallerySettings,e)},e.prototype.setFoucsToFirstItem=function(e,t,o,i,r){var n=this;e.querySelectorAll(".e-ribbon-gallery-item")[0].focus(),this.galleryItemsIndex=0,e.onkeydown=function(s){n.handleGalleryPopupNavigation(s,e,t,o,i,r)}},e.prototype.handleGalleryPopupNavigation=function(e,t,o,i,r,n){var s=t.querySelectorAll(".e-ribbon-gallery-item");s&&("Home"===e.key?(this.galleryItemsIndex=0,s[this.galleryItemsIndex].focus()):"End"===e.key?(this.galleryItemsIndex=s.length-1,s[this.galleryItemsIndex].focus()):"ArrowRight"===e.key||"ArrowDown"===e.key?(this.galleryItemsIndex++,this.galleryItemsIndex!==s.length?s&&s[this.galleryItemsIndex]&&s[this.galleryItemsIndex].focus():(this.galleryItemsIndex=0,s[this.galleryItemsIndex].focus())):"ArrowLeft"===e.key||"ArrowUp"===e.key?0!==this.galleryItemsIndex?(this.galleryItemsIndex--,s&&s[this.galleryItemsIndex]&&s[this.galleryItemsIndex].focus()):(this.galleryItemsIndex=s.length-1,s[this.galleryItemsIndex].focus()):"Enter"===e.key||"Space"===e.code?s[this.galleryItemsIndex].click():"Escape"!==e.key||o||this.hidePopup(r,t,e,n,i))},e.prototype.createGalleryTemplate=function(e,o,i,r){e.classList.add("e-ribbon-gallery-template");var n="ribbon"+i+"galleryTemplate";this.parent.clearTemplate([n]);var s=p(o.template);r.disabled&&e.classList.add("e-disabled"),r.cssClass&&e.classList.add(r.cssClass),t.append(s({items:r},this,n,i+"galleryTemplate",this.parent.isStringTemplate),e),this.parent.renderReactTemplates()},e.prototype.createGalleryPopupTemplate=function(e,o,i,r){e.classList.add("e-ribbon-gallery-popup-template");var n="ribbon"+i+"galleryPopupTemplate";this.parent.clearTemplate([n]);var s=p(o.popupTemplate);r.disabled&&e.classList.add("e-disabled"),r.cssClass&&e.classList.add(r.cssClass),t.append(s({items:r},this,n,i+"galleryPopupTemplate",this.parent.isStringTemplate),e),this.parent.renderReactTemplates()},e}(),So=function(){var e=function(t,o){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(t,o)};return function(t,o){function i(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(i.prototype=o.prototype,new i)}}(),Io=function(e,t,o,i){var r,n=arguments.length,s=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(n<3?r(s):n>3?r(t,o,s):r(t,o))||s);return n>3&&s&&Object.defineProperty(t,o,s),s},Co=function(i){function s(e,t){return g.Inject(uo,ho,fo,yo,mo,go),i.call(this,e,t)||this}So(s,i),g=s,s.prototype.render=function(){this.initialize()},s.prototype.preRender=function(){this.keysPress="",this.idIndex=0,this.tooltipData=[],this.initialPropsData={},this.hiddenElements={},this.keyTipElements={},this.hiddenGroups=[],this.itemsModel=[],this.targetTabs={},this.isAddRemove=!1,this.isUpdateItems=!1,this.keyConfigs={leftarrow:"leftarrow",rightarrow:"rightarrow",tab:"tab",shiftTab:"shift+tab"}},s.prototype.getPersistData=function(){return this.addOnPersist(["activeLayout"])},s.prototype.getModuleName=function(){return"ribbon"},s.prototype.requiredModules=function(){var t=[];t.push({member:"ribbonButton",args:[this],name:"RibbonButton"},{member:"ribbonDropDown",args:[this],name:"RibbonDropDown"},{member:"ribbonSplitButton",args:[this],name:"RibbonSplitButton"},{member:"ribbonCheckBox",args:[this],name:"RibbonCheckBox"},{member:"ribbonComboBox",args:[this],name:"RibbonComboBox"},{member:"ribbonGroupButton",args:[this],name:"RibbonGroupButton"});var o=c(this.tabs,null,e.RibbonItemType.ColorPicker),i=c(this.tabs,null,e.RibbonItemType.Gallery);return o&&t.push({member:"ribbonColorPicker",args:[this],name:"RibbonColorPicker"}),i&&t.push({member:"ribbonGallery",args:[this],name:"RibbonGallery"}),(this.backStageMenu.visible||this.backStageMenu.items.length)&&t.push({member:"ribbonBackstage",args:[this],name:"RibbonBackstage"}),(this.fileMenu.visible||this.fileMenu.menuItems.length)&&t.push({member:"ribbonFileMenu",args:[this],name:"RibbonFileMenu"}),this.contextualTabs.length&&t.push({member:"ribbonContextualTab",args:[this],name:"RibbonContextualTab"}),this.enableKeyTips&&t.push({member:"ribbonKeyTip",args:[this],name:"RibbonKeyTip"}),t},s.prototype.initialize=function(){this.element.id=this.element.id||t.getUniqueID("e-"+this.getModuleName()),t.addClass([this.element],["e-rbn"].concat(this.cssClass?this.cssClass.split(" "):[])),this.enableRtl&&this.element.classList.add(je),this.element.style.width=t.formatUnit(this.width),this.renderTabs(),this.ribbonContextualTabModule&&this.ribbonContextualTabModule.addContextualTabs(),this.ribbonFileMenuModule&&this.ribbonFileMenuModule.createFileMenu(this.fileMenu),this.ribbonBackstageModule&&this.ribbonBackstageModule.createBackStage(this.backStageMenu),this.createHelpPaneTemplate();this.tabObj.tbObj.refreshOverflow(),this.addTabOverflowKeyTip(),v(this.element,this),this.isKeytipOpen=!1,this.wireEvents(),this.wireKeyboardEvent(),this.currentControlIndex=0},s.prototype.wireEvents=function(){t.EventHandler.add(window,"resize",this.resizeHandler,this),t.EventHandler.add(document.body,"keydown",this.keytipActionHandler,this),t.EventHandler.add(document,"mousedown",this.mouseEventHandler,this),t.EventHandler.add(document,"scroll",this.mouseEventHandler,this)},s.prototype.wireKeyboardEvent=function(){this.keyboardModuleRibbon=new t.KeyboardEvents(this.element,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"})},s.prototype.keyActionHandler=function(e){"Tab"!==e.key||e.target.classList.contains("e-tab-wrap")||e.target.classList.contains("e-combobox")||e.preventDefault();var t,o=this.tabObj.element.querySelector("#"+this.tabs[this.selectedTab].id+Qt),i=Array.prototype.slice.call(o.querySelectorAll(".e-control")),r=Array.prototype.slice.call(o.querySelectorAll(".e-ribbon-template")),n=Array.prototype.slice.call(o.querySelectorAll(".e-ribbon-gallery-item")),s=i.concat(r,n),a=o.querySelectorAll(".e-combobox");if(a)for(var l=0;l<a.length;l++)a[parseInt(l.toString(),10)].closest(".e-input-focus")&&(t=a[parseInt(l.toString(),10)]);if(t)for(l=0;l<s.length;l++)s[parseInt(l.toString(),10)].classList.contains("e-combobox")&&s[parseInt(l.toString(),10)].closest(".e-input-focus")&&(this.currentControlIndex=l);if(0===this.currentControlIndex)for(var p=s[this.currentControlIndex].closest(".e-ribbon-item");p&&p.classList.contains("e-disabled");)this.currentControlIndex++,p=s[this.currentControlIndex].closest(".e-ribbon-item");if(e.target.classList.contains("e-control")||e.target.classList.contains("e-ribbon-launcher-icon")||e.target.classList.contains("e-ribbon-collapse-btn")||e.target.classList.contains("e-ribbon-last-item")||e.target.classList.contains("e-ribbon-first-item")||e.target.classList.contains("e-ribbon-group-of-btn")||e.target.classList.contains("e-ribbon-overall-of-btn")||e.target.classList.contains("e-ribbon-template")||e.target.classList.contains("e-ribbon-gallery-item"))switch(e.action){case"rightarrow":this.handleNavigation(e,!this.enableRtl,s);break;case"leftarrow":this.handleNavigation(e,this.enableRtl,s);break;case"tab":e.target.classList.contains("e-combobox")&&this.currentControlIndex<s.length-1&&this.currentControlIndex++;break;case"shiftTab":e.target.classList.contains("e-combobox")?this.currentControlIndex>0&&this.currentControlIndex--:(this.tabObj.element.querySelector(".e-toolbar-item.e-active").querySelector(".e-tab-wrap").focus(),this.currentControlIndex=0)}},s.prototype.handleNavigation=function(e,t,o){var i,r;if(t?this.currentControlIndex<o.length-1&&o[this.currentControlIndex+1].classList.contains("e-colorpicker")&&this.currentControlIndex++:this.currentControlIndex>0&&o[this.currentControlIndex-1].classList.contains("e-colorpicker")&&this.currentControlIndex--,!t&&this.currentControlIndex>0||t&&this.currentControlIndex<o.length-1){if(!e.target.classList.contains("e-combobox")&&(e.target.classList.contains("e-control")||e.target.classList.contains("e-ribbon-template")||e.target.classList.contains("e-ribbon-gallery-item"))&&!e.target.classList.contains("e-ribbon-last-item")){if(t)this.currentControlIndex++;else{var n=o[parseInt(this.currentControlIndex.toString(),10)].closest("."+ct);n&&(r=n.getAttribute("id")),this.currentControlIndex--}for(var s=o[this.currentControlIndex].closest(".e-ribbon-item");s&&s.classList.contains("e-disabled");){if((t&&this.currentControlIndex===o.length-1||!t&&0===this.currentControlIndex)&&o[this.currentControlIndex].closest(".e-ribbon-item").classList.contains("e-disabled")){this.tabObj.element.querySelector(".e-ribbon-collapse-btn").focus();break}t?this.currentControlIndex++:this.currentControlIndex--,s=o[this.currentControlIndex].closest(".e-ribbon-item")}if(o[parseInt(this.currentControlIndex.toString(),10)].focus(),"Classic"===this.activeLayout){if(i=o[parseInt(this.currentControlIndex.toString(),10)].closest("."+ct),t){var a=void 0;if(i&&(a=i.querySelector(".e-ribbon-launcher-icon")),a){var l=i.querySelectorAll(".e-ribbon-item"),p=l[l.length-1].querySelector(".e-control");p&&p.classList.add("e-ribbon-last-item")}}else if(i){if(r!==i.getAttribute("id")){(a=i.querySelector(".e-ribbon-launcher-icon"))&&o[parseInt((this.currentControlIndex+1).toString(),10)].classList.add("e-ribbon-first-item")}}}else o[parseInt(this.currentControlIndex.toString(),10)].classList.contains("e-ribbon-first-item")?o[parseInt(this.currentControlIndex.toString(),10)].classList.remove("e-ribbon-first-item"):o[parseInt(this.currentControlIndex.toString(),10)].classList.contains("e-ribbon-last-item")&&o[parseInt(this.currentControlIndex.toString(),10)].classList.remove("e-ribbon-last-item")}}else if("Classic"===this.activeLayout&&this.tabObj.element.querySelector(".e-ribbon-collapse-btn").focus(),"Simplified"===this.activeLayout){var c=this.tabObj.element.querySelector(".e-ribbon-overall-of-btn");t&&c&&!c.classList.contains("e-ribbon-hide")?c.focus():this.tabObj.element.querySelector(".e-ribbon-collapse-btn").focus()}if(e.target.classList.contains("e-ribbon-last-item")&&(t?(i=o[parseInt(this.currentControlIndex.toString(),10)].closest("."+ct)).querySelector(".e-ribbon-launcher-icon").focus():(this.currentControlIndex--,o[parseInt(this.currentControlIndex.toString(),10)].focus())),!t&&e.target.classList.contains("e-ribbon-first-item")){(a=(i=o[parseInt((this.currentControlIndex-1).toString(),10)].closest("."+ct)).querySelector(".e-ribbon-launcher-icon"))&&i.querySelector(".e-ribbon-launcher-icon").focus()}if(e.target.classList.contains("e-ribbon-launcher-icon")&&(t?(this.currentControlIndex++,o[parseInt(this.currentControlIndex.toString(),10)].focus(),o[parseInt((this.currentControlIndex-1).toString(),10)].classList.contains("e-ribbon-last-item")&&o[parseInt((this.currentControlIndex-1).toString(),10)].classList.remove("e-ribbon-last-item")):(this.currentControlIndex,o[parseInt(this.currentControlIndex.toString(),10)].focus())),e.target.classList.contains("e-ribbon-collapse-btn"))if(t){this.currentControlIndex=0;for(var u=o[this.currentControlIndex].closest(".e-ribbon-item");u&&u.classList.contains("e-disabled");)this.currentControlIndex++,u=o[this.currentControlIndex].closest(".e-ribbon-item");o[parseInt(this.currentControlIndex.toString(),10)].focus()}else{if((c=this.tabObj.element.querySelector(".e-ribbon-overall-of-btn"))&&!c.classList.contains("e-ribbon-hide"))c.focus();else{this.currentControlIndex=o.length-1;for(u=o[this.currentControlIndex].closest(".e-ribbon-item");u&&u.classList.contains("e-disabled");)this.currentControlIndex--,u=o[this.currentControlIndex].closest(".e-ribbon-item");o[parseInt(this.currentControlIndex.toString(),10)].focus()}}"Simplified"===this.activeLayout&&e.target.classList.contains("e-ribbon-overall-of-btn")&&(t?this.tabObj.element.querySelector(".e-ribbon-collapse-btn").focus():(this.currentControlIndex=o.length-1,o[parseInt(this.currentControlIndex.toString(),10)].focus()))},s.prototype.resizeHandler=function(){var e=this.tabObj.element.querySelector("#"+this.tabs[this.selectedTab].id+Qt);if(this.checkOverflow(this.selectedTab,e),this.scrollModule){var o=this.tabObj.element.querySelector("."+Ke);this.scrollModule.scrollStep=o.offsetWidth}if("Simplified"===this.activeLayout){var i=document.querySelectorAll(".e-ribbon .e-dropdown-btn.e-active, .e-ribbon-group-overflow-ddb .e-dropdown-btn.e-active");if(i.length)for(var n=0;n<i.length;n++){t.getInstance(i[parseInt(n.toString(),10)],r.DropDownButton).toggle()}}var s=document.querySelector(".e-ribbon-gallery-popup.e-popup-open");if(s){t.getComponent(s,a.Popup).hide()}this.ribbonKeyTipModule&&this.enableKeyTips&&this.ribbonKeyTipModule.removeKeytip()},s.prototype.mouseEventHandler=function(e){this.ribbonKeyTipModule&&this.enableKeyTips&&this.ribbonKeyTipModule.removeKeytip()},s.prototype.keytipActionHandler=function(e){if(this.enableKeyTips){var o=!1,i=e.key;if(e.altKey&&"Meta"===e.key){var n=document.querySelectorAll(".e-ribbon .e-dropdown-btn.e-active, .e-ribbon-group-overflow-ddb .e-dropdown-btn.e-active");if(n.length){for(var s=0;s<n.length;s++){t.getInstance(n[parseInt(s.toString(),10)],r.DropDownButton).toggle()}this.ribbonKeyTipModule.removeKeytip()}else if(this.isKeytipOpen)this.ribbonKeyTipModule.removeKeytip();else{var a=document.querySelector(".e-ribbon-backstage-popup");a&&a.classList.contains("e-popup-open")&&this.ribbonBackstageModule.hideBackstage(),this.ribbonKeyTipModule.createKeytip("tab")}}else if("Escape"===e.key||"Tab"===e.key||"ArrowLeft"===e.key||"ArrowUp"===e.key||"ArrowRight"===e.key||"ArrowDown"===e.key)this.ribbonKeyTipModule.removeKeytip(e.key);else{var l=document.querySelectorAll(".e-ribbon-keytip");if(l){for(s=0;s<l.length;s++){if(l[parseInt(s.toString(),10)].innerHTML.toLowerCase()===i){o=!0,this.ribbonKeyTipModule.keytipPress(i);break}}o||this.checkKeyTipPresent(i,this.keysPress.length)}}}},s.prototype.checkKeyTipPresent=function(e,t){for(var o=document.querySelectorAll(".e-ribbon-keytip"),i=0;i<o.length;i++){var r=o[parseInt(i.toString(),10)];if(r.innerHTML.length>1&&r.innerHTML[parseInt(t.toString(),10)].toLowerCase()===e){this.keysPress+=e,this.ribbonKeyTipModule.keytipPress(this.keysPress),this.removeKeytip(this.keysPress);break}}},s.prototype.removeKeytip=function(e){for(var o=document.querySelectorAll(".e-ribbon-keytip"),i=0;i<o.length;i++){var r=o[parseInt(i.toString(),10)];r.innerHTML[0].toLowerCase()!==e&&""!==e&&t.remove(r)}},s.prototype.addKeyTip=function(e,t,o,i){if(this.keyTipElements&&this.keyTipElements[parseInt(e.toString(),10)]){var r=!1;if(this.keyTipElements[parseInt(e.toString(),10)][i]||(this.keyTipElements[parseInt(e.toString(),10)][i]=[]),Object.keys(this.keyTipElements[e][i]).length){for(var n=this.keyTipElements[e][i],s=0;s<Object.keys(this.keyTipElements[e][i]).length;s++)n[parseInt(s.toString(),10)].id===o&&(r=!0);r||this.keyTipElements[e][i].push({id:o,type:i,keyTip:t})}else this.keyTipElements[e][i].push({id:o,type:i,keyTip:t})}},s.prototype.renderTabs=function(){this.tabsInternal=this.tabs.slice(),this.tabsInternal=this.checkID(this.tabsInternal,"tab",this.element.id),this.setProperties({tabs:this.tabsInternal},!0);var e=this.createElement("div",{id:this.element.id+"_tab"});this.element.appendChild(e),this.validateItemSize();var i=this.createTabItems(this.tabs);this.tabObj=new o.Tab({cssClass:"e-ribbon-tab",selectedItem:this.selectedTab,overflowMode:"Popup",width:this.width,items:i,enableRtl:this.enableRtl,created:this.tabCreated.bind(this),selected:this.ribbonTabSelected.bind(this),selecting:this.ribbonTabSelecting.bind(this),animation:this.tabAnimation}),this.tabObj.appendTo(e),this.element.style.setProperty(po,"0px"),this.element.style.setProperty(co,"0px");var r=e.querySelector(".e-toolbar");t.getComponent(r,o.Toolbar).setProperties({width:"calc(100% - var(--fileMenuWidth) - var(--helpTemplateWidth))"}),this.element.classList[this.isMinimized?"add":"remove"](it)},s.prototype.minimize=function(e){var t=this;if(e!==this.isMinimized){this.trigger(e?"ribbonCollapsing":"ribbonExpanding",{cancel:!1},function(o){o.cancel||(t.setProperties({isMinimized:e},!0),t.element.classList.toggle(it,t.isMinimized),t.tabObj.element.querySelector(".e-content").style.display=e?"none":"block",e||t.refreshLayout())})}},s.prototype.toggleLayout=function(){this.setProperties({activeLayout:"Simplified"===this.activeLayout?"Classic":"Simplified"},!0),this.switchLayout()},s.prototype.tabCreated=function(){this.hideLayoutSwitcher||this.addExpandCollapse(),this.renderInitialTab(this.selectedTab)},s.prototype.ribbonTabSelected=function(e){e.preventFocus=!0,this.isAddRemove=!1;var t=e.selectedItem.getAttribute("data-id"),o=l(this.tabs,function(e){return e.id===t});o=-1===o?this.selectedTab:o;var i=this.isContextualTab(t);this.updateSelectedState(t);var r={previousIndex:this.selectedTab,selectedIndex:o,isContextual:i};if(this.setProperties({selectedTab:o},!0),this.calculateHiddenElementsWidth(o),this.isUpdateItems){for(var n=0;n<this.itemsModel.length;n++){var s=this.itemsModel[parseInt(n.toString(),10)];this.selectedTab===this.targetTabs[s.id]&&(this.updateItem(s),this.itemsModel.splice(n,1),n--)}0===this.itemsModel.length&&(this.isUpdateItems=!1)}if(this.checkOverflow(o,e.selectedContent.firstChild),"Classic"===this.activeLayout&&this.ribbonGalleryModule&&this.ribbonGalleryModule.checkAvailableHeight(o,e.selectedContent.firstChild),"Simplified"===this.activeLayout&&this.overflowDDB){var a=this.overflowDDB.target,p=a.querySelector("."+Ve);p&&p.classList.remove(Ve);var c=a.querySelector("#"+t+eo);c?(c.classList.add(Ve),this.overflowDDB.element.classList.remove(Fe),this.checkOverflowHiddenItems(!1,o)):this.overflowDDB.element.classList.add(Fe)}this.trigger("tabSelected",r)},s.prototype.updateSelectedState=function(e){if(this.contextualTabs.length)for(var t=0;t<this.contextualTabs.length;t++){for(var o=!1,i=0;i<this.contextualTabs[parseInt(t.toString(),10)].tabs.length;i++)if(this.contextualTabs[parseInt(t.toString(),10)].tabs[parseInt(i.toString(),10)].id===e){o=!0;break}this.contextualTabs[parseInt(t.toString(),10)].setProperties({isSelected:o},!0)}},s.prototype.checkOverflow=function(e,t){var i=t.closest("."+ot),r=i.offsetWidth<t.offsetWidth;if(r&&!this.scrollModule){if("Classic"===this.activeLayout){var n=!1;!(n=this.checkGroupShrinking(e,i,t,!0))&&i.offsetWidth<t.offsetWidth&&(n=this.checkGroupShrinking(e,i,t,!1)),i.offsetWidth<t.offsetWidth&&this.createOverflowDropdown(e,i,t)}else this.checkSimplifiedItemShrinking(e,i,t),i.offsetWidth<t.offsetWidth&&this.createSimplfiedOverflow(i,t,e);i.offsetWidth<t.offsetWidth&&!this.scrollModule&&(this.scrollModule=new o.HScroll({enableRtl:this.enableRtl},this.tabObj.element.querySelector("."+ot)))}else if(!r)if(this.destroyScroll(),"Classic"===this.activeLayout){n=!1;!(n=this.removeOverflowDropdown(i,t,!1,e))&&i.offsetWidth>t.offsetWidth&&(n=this.checkGroupExpanding(e,i,t,!0)),!n&&i.offsetWidth>t.offsetWidth&&(n=this.checkGroupExpanding(e,i,t,!1))}else this.removeSimplfiedOverflow(i,t,e),i.offsetWidth>t.offsetWidth&&this.checkSimplifiedItemExpanding(e,i,t);this.addTabOverflowKeyTip()},s.prototype.addTabOverflowKeyTip=function(){var e=this.tabObj.element.querySelector("#_nav");e?(this.keyTipElements.taboverflow=[],this.keyTipElements.taboverflow.push({id:e.id,type:"taboverflow",keyTip:"00"})):delete this.keyTipElements.taboverflow},s.prototype.checkSimplifiedItemShrinking=function(t,o,i){for(var r=this.tabs[parseInt(t.toString(),10)],n=r.groups.length-1;n>=0;n--)for(var s=r.groups[parseInt(n.toString(),10)],a=o.querySelector("#"+s.id+$t),l=0;l<s.collections.length&&o.offsetWidth<i.offsetWidth;l++)for(var p=s.collections[parseInt(l.toString(),10)],c=p.items.length;c>=1&&o.offsetWidth<i.offsetWidth;c--){var u=p.items[c-1];if(u.allowedSizes&e.RibbonItemSize.Small&&u.allowedSizes&e.RibbonItemSize.Medium&&u.activeSize===e.RibbonItemSize.Medium&&u.displayOptions&e.DisplayMode.Simplified){var d=a.querySelector("#"+u.id+$t);if(d){var h=d.querySelector("#"+u.id);d.setAttribute("data-medium-width",i.offsetWidth.toString()),u.setProperties({activeSize:e.RibbonItemSize.Small},!0),this.setItemSize(h,u)}}}},s.prototype.checkSimplifiedItemExpanding=function(t,o,i){for(var r=this.tabs[parseInt(t.toString(),10)],n=r.groups.length-1;n>=0;n--)for(var s=r.groups[parseInt(n.toString(),10)],a=o.querySelector("#"+s.id+$t),l=0;l<s.collections.length&&o.offsetWidth>i.offsetWidth;l++)for(var p=s.collections[parseInt(l.toString(),10)],c=p.items.length;c>=1&&o.offsetWidth>i.offsetWidth;c--){var u=p.items[c-1];if(u.allowedSizes&e.RibbonItemSize.Small&&u.allowedSizes&e.RibbonItemSize.Medium&&u.activeSize===e.RibbonItemSize.Small&&u.displayOptions&e.DisplayMode.Simplified){var d=a.querySelector("#"+u.id+$t);if(d){var h=d.getAttribute("data-medium-width"),b=h?parseInt(h,10):null;if(b&&o.offsetWidth>b){d.removeAttribute("data-medium-width");var m=d.querySelector("#"+u.id);u.setProperties({activeSize:e.RibbonItemSize.Medium},!0),this.setItemSize(m,u)}}}}},s.prototype.createSimplfiedOverflow=function(o,i,r){for(var n=this.getGroupResizeOrder(!0,r),s=0;s<n.length&&o.offsetWidth<i.offsetWidth;s++){for(var a=!1,l=n[parseInt(s.toString(),10)],p=o.querySelector("#"+l.id),c=p.querySelector("#"+l.id+$t),u=l.collections.length;u>=1&&o.offsetWidth<i.offsetWidth;u--)for(var d=l.collections[parseInt((u-1).toString(),10)],h=p.querySelector("#"+d.id),b=d.items.length;b>=1&&o.offsetWidth<i.offsetWidth;b--){var m=d.items[b-1],f=h.querySelector("#"+m.id+$t);if((m.displayOptions===e.DisplayMode.Auto||m.displayOptions===(e.DisplayMode.Simplified|e.DisplayMode.Overflow))&&!t.isNullOrUndefined(f)){var y=!1,g=!1,v=!1,S=!1,I=void 0;if(p.classList.contains("e-hidden")||p.classList.contains("e-hide-group")){if((I=p.querySelectorAll(".e-ribbon-item.e-hidden")).length)for(var C=0;C<I.length;C++)I[parseInt(C.toString(),10)].classList.remove("e-hidden");p.classList.contains("e-hide-group")?(v=!0,p.classList.remove("e-hide-group"),p.classList.remove("e-ribbon-emptyCollection"),-1!==this.hiddenGroups.indexOf(p.id)&&this.hiddenGroups.splice(this.hiddenGroups.indexOf(p.id),1)):(y=!0,p.classList.remove("e-hidden")),a||(this.calculateOverflowItemsWidth(p.offsetWidth,!1,r),this.calculateMediumDataWidth(p.offsetWidth,r,!1),a=!0)}else f.classList.contains("e-hidden")&&(g=!0,f.classList.remove("e-hidden"),p.classList.contains("e-ribbon-emptyCollection")&&(S=!0,p.classList.remove("e-ribbon-emptyCollection")),this.calculateOverflowItemsWidth(f.offsetWidth,!1,r),this.calculateMediumDataWidth(f.offsetWidth,r,!1));if(f.setAttribute("data-simplified-width",i.offsetWidth.toString()),g&&f.classList.add("e-hidden"),I&&I.length)for(var T=0;T<I.length;T++)I[parseInt(T.toString(),10)].classList.add("e-hidden");if(y&&p.classList.add("e-hidden"),v&&(p.classList.add("e-hide-group"),p.classList.add("e-ribbon-emptyCollection")),S&&p.classList.add("e-ribbon-emptyCollection"),this.createOverflowPopup(m,r,l.enableGroupOverflow,l.id,l.header,f,c,!0),m.activeSize===e.RibbonItemSize.Small){var w=f.querySelector("#"+m.id);m.setProperties({activeSize:e.RibbonItemSize.Medium},!0),this.setItemSize(w,m)}m.type!==e.RibbonItemType.DropDown&&m.type!==e.RibbonItemType.SplitButton&&m.type!==e.RibbonItemType.GroupButton&&m.type!==e.RibbonItemType.Gallery||this.updatePopupItems(m,f,l.enableGroupOverflow,!0)}}l.enableGroupOverflow||p.querySelector("."+Ct)||p.classList.add("e-ribbon-emptyCollection");var k=p.querySelectorAll("."+Ct);k&&!l.enableGroupOverflow&&this.checkEmptyCollection(k)&&p.classList.add("e-ribbon-emptyCollection"),this.checkOverflowHiddenItems(l.enableGroupOverflow,r,l.id)}},s.prototype.checkEmptyCollection=function(e){for(var t=!0,o=0;o<e.length;o++)if(!e[parseInt(o.toString(),10)].classList.contains("e-hidden")){t=!1;break}return t},s.prototype.updatePopupItems=function(o,i,n,s){var a=t.getComponent(i.querySelector("#"+o.id),o.type===e.RibbonItemType.DropDown||o.type===e.RibbonItemType.Gallery||o.type===e.RibbonItemType.GroupButton?r.DropDownButton:r.SplitButton),l=a.dropDown,p=(n&&s)===this.enableRtl;l&&(l.setProperties({position:{X:p?"left":"right",Y:s?"top":"bottom"}},!0),s?a.beforeOpen=function(){p&&(l.element.style.setProperty("visibility","hidden"),l.element.style.setProperty("display","block"),l.setProperties({offsetX:-1*l.element.offsetWidth}),l.element.style.removeProperty("display"),l.element.style.removeProperty("visibility"))}:(l.setProperties({offsetX:0},!0),a.beforeOpen=null))},s.prototype.removeSimplfiedOverflow=function(o,i,n,s){void 0===s&&(s=!1);for(var a=this.getGroupResizeOrder(!1,n),l=!0,p=0;p<a.length&&l;p++){var c=a[parseInt(p.toString(),10)],u=void 0,d=void 0;if(c.enableGroupOverflow){var h=o.querySelector("#"+c.id+Yt);h&&(d=(u=t.getInstance(h,r.DropDownButton)).target)}else u=this.overflowDDB,d=this.overflowDDB?this.overflowDDB.target:null;for(var b=0;b<c.collections.length&&l;b++)for(var m=c.collections[parseInt(b.toString(),10)],f=0;f<m.items.length&&l&&!s&&o.offsetWidth>i.offsetWidth;f++){var y=m.items[parseInt(f.toString(),10)],g=void 0;if(d&&(g=d.querySelector("#"+y.id+$t)),(y.displayOptions===e.DisplayMode.Auto||y.displayOptions===(e.DisplayMode.Simplified|e.DisplayMode.Overflow))&&!t.isNullOrUndefined(g)){var v=parseInt(g.getAttribute("data-simplified-width"),10),S=o.querySelector("#"+c.id);if((g.classList.contains("e-hidden")||S.classList.contains("e-hidden"))&&(v=Math.abs(v-i.offsetWidth)),!s&&o.offsetWidth<v){l=!1;break}var I=o.querySelector("#"+m.id);if(y.type!==e.RibbonItemType.DropDown&&y.type!==e.RibbonItemType.SplitButton&&y.type!==e.RibbonItemType.GroupButton&&y.type!==e.RibbonItemType.Gallery||this.updatePopupItems(y,g,c.enableGroupOverflow,!1),I.append(g),g.classList.contains("e-hidden")||S.classList.contains("e-hidden")){g.setAttribute("data-simplified-width",v.toString());var C=!1,T=0;g.classList.contains("e-hidden")&&(g.classList.remove("e-hidden"),S.classList.contains("e-hide-group")&&(C=!0,T=this.checkWidthDifference(g,S)),v=g.offsetWidth+T,g.classList.add("e-hidden")),this.calculateOverflowItemsWidth(v,!0,n),this.calculateMediumDataWidth(v,n,!0),C&&(S.classList.add("e-hide-group"),S.classList.add("e-ribbon-emptyCollection"))}this.removeOverflowEvent(y,g),y.allowedSizes&e.RibbonItemSize.Small&&(y.setProperties({activeSize:e.RibbonItemSize.Small},!0),this.setItemSize(g.querySelector("#"+y.id),y));var w=o.querySelector("#"+c.id),k=w.querySelector("."+Ct);if(w.classList.contains("e-ribbon-emptyCollection")&&null!==k){var O=w.querySelectorAll("."+Ct);O&&(this.checkEmptyCollection(O)||w.classList.remove("e-ribbon-emptyCollection"))}}}if(u)if(c.enableGroupOverflow)(0===d.childElementCount||1===d.childElementCount&&this.isHeaderVisible(d,c.id))&&this.removeOverflowButton(u);else{var B=d.querySelector("#"+c.id+$t);B&&1===B.childElementCount&&B.remove();var P=d.querySelector("#"+this.tabs[parseInt(n.toString(),10)].id+eo);P&&0===P.childElementCount&&(P.remove(),this.overflowDDB.element.classList.add(Fe))}}for(p=0;p<a.length;p++)this.checkOverflowHiddenItems(a[parseInt(p.toString(),10)].enableGroupOverflow,n,a[parseInt(p.toString(),10)].id);if(this.overflowDDB){0===this.overflowDDB.target.childElementCount&&(this.removeOverflowButton(this.overflowDDB),this.overflowDDB=null)}},s.prototype.checkOverflowHiddenItems=function(e,o,i){if(e){var n=document.querySelector("#"+i+Yt);if(n){for(var s=t.getInstance(n,r.DropDownButton),a=s.target.querySelectorAll(".e-ribbon-item"),l=!0,p=0;p<a.length;p++)if(!a[parseInt(p.toString(),10)].classList.contains("e-hidden")){l=!1;break}s.element.classList[l?"add":"remove"]("e-hidden")}}else if(this.overflowDDB){var c=!0,u=void 0,d=this.overflowDDB.target.querySelector("#"+this.tabs[parseInt(o.toString(),10)].id+eo);if(d){for(var h=0;h<d.children.length;h++){u=!0;for(var b=d.children[parseInt(h.toString(),10)],m=b.querySelectorAll(".e-ribbon-item"),f=0;f<m.length;f++)if(!m[parseInt(f.toString(),10)].classList.contains("e-hidden")){u=!1;break}b.classList[u?"add":"remove"]("e-hide-group"),b.classList.contains("e-hide-group")||b.classList.contains("e-hidden")||(c=!1)}this.overflowDDB.element.classList[c?"add":"remove"](Fe)}}},s.prototype.createOverflowPopup=function(e,o,i,n,s,a,l,p){var c,u,h=d(this.tabs,n),b=this.tabObj.items[parseInt(o.toString(),10)].content.querySelector("#"+n);if(i){var m=l.querySelector("#"+n+Yt);m?c=t.getInstance(m,r.DropDownButton):((c=this.addOverflowButton(n+Yt,i)).element.classList.add($e),l.appendChild(c.element)),this.addKeyTip(o,"0"+(h.groupIndex+1),c.element.id,"grpofbtn"),u=c.target;var f=c.target;if(!f.querySelector("#"+n+Yt+Zt)&&h.group.overflowHeader){var y=this.createElement("div",{className:mt,id:n+Yt+Zt,innerHTML:h.group.overflowHeader});f.append(y)}b&&(b.classList.contains("e-disabled")&&f.classList.add("e-disabled"),b.classList.contains("e-hidden")&&f.classList.add("e-hidden"),b.classList.contains("e-hide-group")&&f.classList.add("e-hide-group")),p?f.insertBefore(a,f.querySelector("."+Ct)):f.append(a)}else{if(this.overflowDDB){this.overflowDDB.element.classList.remove(Fe);var g=this.overflowDDB.target,v=g.querySelector("#"+this.tabs[parseInt(o.toString(),10)].id+eo);if(v){var S=g.querySelector("#"+n+$t);S||(S=h.group.overflowHeader?this.createGroupContainer(n,h.group.overflowHeader):this.createGroupContainer(n,s),b&&(b.classList.contains("e-disabled")&&S.classList.add("e-disabled"),b.classList.contains("e-hidden")&&S.classList.add("e-hidden"),b.classList.contains("e-hide-group")&&S.classList.add("e-hide-group")),v.append(S)),p?S.insertBefore(a,S.querySelector("."+Ct)):S.append(a)}else this.createOfTabContainer(n,s,a,o)}else this.overflowDDB=this.addOverflowButton(this.tabObj.element.id+Xt,i),this.tabObj.element.insertBefore(this.overflowDDB.element,this.collapseButton),this.overflowDDB.element.classList.add(Qe),this.createOfTabContainer(n,s,a,o);c=this.overflowDDB,u=this.overflowDDB?this.overflowDDB.target:null}null!==a&&this.addOverflowEvents(e,a,c),u&&e.keyTip&&this.addKeyTip(o,e.keyTip,e.id,"popupitem")},s.prototype.addOverflowEvents=function(e,t,o){switch(e.type){case"Button":this.ribbonButtonModule.addOverFlowEvents(e,t,o);break;case"DropDown":this.ribbonDropDownModule.addOverFlowEvents(e,t,o);break;case"SplitButton":this.ribbonSplitButtonModule.addOverFlowEvents(e,t,o);break;case"CheckBox":this.ribbonCheckBoxModule.addOverFlowEvents(e,t,o);break;case"ColorPicker":this.ribbonColorPickerModule.addOverFlowEvents(e,t,o);break;case"ComboBox":this.ribbonComboBoxModule.addOverFlowEvents(e,t,o);break;case"Gallery":"Simplified"===this.activeLayout&&this.ribbonGalleryModule.addOverFlowEvents(e,t,o);break;case"GroupButton":if("Simplified"===this.activeLayout){this.ribbonGroupButtonModule.addOverFlowEvents(e,t,o);break}}},s.prototype.createOfTabContainer=function(e,t,o,i){var r=this.createElement("div",{id:this.tabs[parseInt(i.toString(),10)].id+eo,className:ut});this.overflowDDB.target.append(r);var n=d(this.tabs,e),s=n.group.overflowHeader?this.createGroupContainer(e,n.group.overflowHeader):this.createGroupContainer(e,t);s.append(o),r.append(s),i===this.selectedTab&&r.classList.add(Ve);var a=document.querySelector("#"+e);a&&(a.classList.contains("e-disabled")&&s.classList.add("e-disabled"),a.classList.contains("e-hidden")&&s.classList.add("e-hidden"),a.classList.contains("e-hide-group")&&s.classList.add("e-hide-group"))},s.prototype.checkGroupShrinking=function(e,t,o,i){for(var r=!0,n=!1,s=this.tabs[parseInt(e.toString(),10)],a=s.groups.length-1;r&&a>=0;a--)r=!(n=i?this.checkLargeToMedium(e,s,a,t,o):this.checkMediumToSmall(e,s,a,t,o))&&t.offsetWidth<o.offsetWidth;return n},s.prototype.checkValidCollectionLength=function(t){for(var o=0,i=0;i<t.length;i++){for(var r=t[parseInt(i.toString(),10)].items,n=0;n<r.length;n++)if(r[parseInt(n.toString(),10)].displayOptions&e.DisplayMode.Classic){o++;break}if(o>1)return!1}return 1===o},s.prototype.checkClassicCollection=function(t,o,i){for(var r=t[parseInt(o.toString(),10)].items,n=0;n<r.length;n++)if(r[parseInt(n.toString(),10)].displayOptions&e.DisplayMode.Classic)return o;return o=i?o+1:o-1,i?o===t.length?o:this.checkClassicCollection(t,o,i):o<0?o:this.checkClassicCollection(t,o,i)},s.prototype.checkClassicItem=function(t,o,i){return t[parseInt(o.toString(),10)].displayOptions&e.DisplayMode.Classic?o:(o=i?o+1:o-1,i?o===t.length?o:this.checkClassicItem(t,o,i):o<0?o:this.checkClassicItem(t,o,i))},s.prototype.checkLargeToMedium=function(t,o,i,r,n,s){var a=this;void 0===s&&(s=!1);var l=o.groups[parseInt(i.toString(),10)];if(l.isCollapsed&&!s)return!1;var p=function(e){return 1===e.items.length&&c(e.items[0])},c=function(t){return t.allowedSizes&e.RibbonItemSize.Medium&&t.activeSize===e.RibbonItemSize.Large},u=function(e,t,o,i){var r=a.createElement("div",{className:"e-ribbon-shrink "+Tt,id:e+"_shrink_container"+o,attrs:{"data-start":o.toString(),"data-end":i.toString()}});return t.parentElement.insertBefore(r,t),s||r.setAttribute("data-large-width",n.offsetWidth.toString()),r},d=function(o,r){for(var l=a.tabs[parseInt(t.toString(),10)].groups[parseInt(i.toString(),10)].collections[0],p=n.querySelector("#"+l.items[parseInt(o.toString(),10)].id+$t),c=s?n.querySelector("#"+l.id+"_shrink_container"+o):u(l.id,p,o,r),d=o;d<=r;d++){var h=l.items[parseInt(d.toString(),10)];if(h.displayOptions&e.DisplayMode.Classic){var b=n.querySelector("#"+h.id+$t);c.appendChild(b),h.setProperties({activeSize:e.RibbonItemSize.Medium},!0),h.type===e.RibbonItemType.GroupButton&&"Classic"===a.activeLayout?a.setItemSize(b.querySelector("#"+h.id+ao),h):a.setItemSize(b.querySelector("#"+h.id),h)}}},h=function(o,r){for(var l=a.tabs[parseInt(t.toString(),10)].groups[parseInt(i.toString(),10)],p=n.querySelector("#"+l.collections[parseInt(o.toString(),10)].id),c=s?n.querySelector("#"+l.id+"_shrink_container"+o):u(l.id,p,o,r),d=o;d<=r;d++){var h=l.collections[parseInt(d.toString(),10)],b=n.querySelector("#"+h.id);c.appendChild(b),h.items[0].setProperties({activeSize:e.RibbonItemSize.Medium},!0),h.items[0].type===e.RibbonItemType.GroupButton&&"Classic"===a.activeLayout?a.setItemSize(b.querySelector("#"+h.items[0].id+ao),h.items[0]):a.setItemSize(b.querySelector("#"+h.items[0].id),h.items[0])}};if(l.orientation===e.ItemOrientation.Column)for(var b=l.collections.length-1;b>0;b--){if((f=(b=this.checkClassicCollection(l.collections,b,!1))-1)>=0&&p(l.collections[parseInt(b.toString(),10)]))if((f=this.checkClassicCollection(l.collections,f,!1))>=0&&p(l.collections[parseInt(f.toString(),10)])){if((y=f-1)>=0&&(y=this.checkClassicCollection(l.collections,y,!1)),y>=0&&p(l.collections[parseInt(y.toString(),10)])?h(y,b):h(f,b),b=y,!s&&r.offsetWidth>n.offsetWidth)return!0}else b=f}else if(this.checkValidCollectionLength(l.collections)){var m=l.collections[0];for(b=m.items.length-1;b>0;b--){var f;if((f=(b=this.checkClassicItem(m.items,b,!1))-1)>=0&&c(m.items[parseInt(b.toString(),10)]))if((f=this.checkClassicItem(m.items,f,!1))>=0&&c(m.items[parseInt(f.toString(),10)])){var y;if((y=f-1)>=0&&(y=this.checkClassicItem(m.items,y,!1)),y>=0&&c(m.items[parseInt(y.toString(),10)])?d(y,b):d(f,b),b=y,!s&&r.offsetWidth>n.offsetWidth)return!0}else b=f}}return!1},s.prototype.checkMediumToSmall=function(t,o,i,r,n,s){var a=this;void 0===s&&(s=!1);var l=o.groups[parseInt(i.toString(),10)];if(l.isCollapsed&&!s)return!1;var p=l.orientation,c=n.querySelector("#"+l.id).querySelectorAll(".e-ribbon-shrink"),u=function(t){return t.allowedSizes&e.RibbonItemSize.Small&&t.activeSize===e.RibbonItemSize.Medium},d=function(o,r,s,l){void 0===l&&(l=null);var p=a.tabs[parseInt(t.toString(),10)].groups[parseInt(i.toString(),10)].collections[parseInt(o.toString(),10)],c=function(t){var o=p.items[parseInt(t.toString(),10)];if(o.displayOptions&e.DisplayMode.Classic){var i=n.querySelector("#"+o.id);o.setProperties({activeSize:e.RibbonItemSize.Small},!0),o.type===e.RibbonItemType.GroupButton&&(i=n.querySelector("#"+o.id+"_grpbtn")),a.setItemSize(i,o)}};c(r),l&&c(l),c(s)},h=function(o,r,l,p){void 0===p&&(p=null);var u=a.tabs[parseInt(t.toString(),10)].groups[parseInt(i.toString(),10)];s||c[parseInt(o.toString(),10)].setAttribute("data-medium-width",n.offsetWidth.toString());var d=function(t){var o=u.collections[parseInt(t.toString(),10)];if(o.items[0].displayOptions&e.DisplayMode.Classic){var i=n.querySelector("#"+o.items[0].id);o.items[0].setProperties({activeSize:e.RibbonItemSize.Small},!0),o.items[0].type===e.RibbonItemType.GroupButton&&(i=n.querySelector("#"+o.items[0].id+ao)),a.setItemSize(i,o.items[0])}};d(r),p&&d(p),d(l)},b=function(e){if(!s){n.querySelector("#"+e).setAttribute("data-medium-width",n.offsetWidth.toString())}};if(p===e.ItemOrientation.Column){if(c.length>0)for(var m=c.length-1;m>=0;m--){var f=parseInt(c[parseInt(m.toString(),10)].getAttribute("data-start"),10),y=parseInt(c[parseInt(m.toString(),10)].getAttribute("data-end"),10),g=this.checkClassicCollection(l.collections,f+1,!1);if(u(l.collections[parseInt(f.toString(),10)].items[0])&&u(l.collections[parseInt(g.toString(),10)].items[0])&&(y===g?h(m,f,y):u(l.collections[parseInt(y.toString(),10)].items[0])&&h(m,f,y,g),!s&&r.offsetWidth>n.offsetWidth))return!0}for(m=l.collections.length-1;m>=0;m--){for(var v=l.collections[parseInt(m.toString(),10)],S=[],I=0;I<v.items.length;I++)v.items[parseInt(I.toString(),10)].displayOptions&e.DisplayMode.Classic&&S.push(I);if(S.length>1&&u(v.items[S[0]])&&u(v.items[S[1]])&&(2===S.length?(b(v.id),d(m,S[0],S[1])):u(v.items[S[2]])&&(b(v.id),d(m,S[0],S[2],S[1])),!s&&r.offsetWidth>n.offsetWidth))return!0}}else if(this.checkValidCollectionLength(l.collections)){if(c.length>0)for(m=c.length-1;m>=0;m--){var C=c[parseInt(m.toString(),10)];f=parseInt(C.getAttribute("data-start"),10),y=parseInt(C.getAttribute("data-end"),10),v=l.collections[0],g=this.checkClassicItem(v.items,f+1,!1);if(u(l.collections[0].items[parseInt(f.toString(),10)])&&u(l.collections[0].items[parseInt(g.toString(),10)])&&(y===g?(b(C.id),d(0,f,y)):u(l.collections[0].items[parseInt(y.toString(),10)])&&(b(C.id),d(0,f,y,g)),!s&&r.offsetWidth>n.offsetWidth))return!0}}else for(m=l.collections.length-1;m>=0;m--)for(g=(v=l.collections[parseInt(m.toString(),10)]).items.length-1;g>=0;g--)if(!((g=this.checkClassicItem(v.items,g,!1))<0)){var T=v.items[parseInt(g.toString(),10)];if(u(T)&&(T.type!==e.RibbonItemType.GroupButton?b(T.id):b(T.id+ao),d(m,g,g),!s&&r.offsetWidth>n.offsetWidth))return!0}return!1},s.prototype.checkGroupExpanding=function(e,t,o,i){for(var r=!1,n=this.tabs[parseInt(e.toString(),10)],s=0;!r&&s<n.groups.length;s++)r=i?this.checkSmallToMedium(e,n,s,t,o,!1,!0):this.checkMediumToLarge(e,n,s,t,o,!1,!0);return r},s.prototype.checkSmallToMedium=function(t,o,i,r,n,s,a){var l=this,p=o.groups[parseInt(i.toString(),10)],c=p.orientation,u=n.querySelector("#"+p.id).querySelectorAll(".e-ribbon-shrink"),d=function(t){return t.allowedSizes&e.RibbonItemSize.Medium&&t.activeSize===e.RibbonItemSize.Small},h=function(o,r,n){var s=l.tabs[parseInt(t.toString(),10)].groups[parseInt(i.toString(),10)].collections[parseInt(o.toString(),10)].items[parseInt(r.toString(),10)];if(s.displayOptions&e.DisplayMode.Classic){var a=n.id===s.id?n:n.querySelector("#"+s.id);s.setProperties({activeSize:e.RibbonItemSize.Medium},!0),s.type===e.RibbonItemType.GroupButton&&(a=document.querySelector("#"+s.id+ao)),l.setItemSize(a,s)}},b=function(o){var r=l.tabs[parseInt(t.toString(),10)].groups[parseInt(i.toString(),10)].collections,s=r[parseInt(o.toString(),10)].items[0];if(s.displayOptions&e.DisplayMode.Classic){var a=n.querySelector("#"+r[parseInt(o.toString(),10)].items[0].id);r[parseInt(o.toString(),10)].items[0].setProperties({activeSize:e.RibbonItemSize.Medium},!0),s.type===e.RibbonItemType.GroupButton&&(a=n.querySelector("#"+r[parseInt(o.toString(),10)].items[0].id+ao)),l.setItemSize(a,r[parseInt(o.toString(),10)].items[0])}};if(c===e.ItemOrientation.Row){if(!this.checkValidCollectionLength(p.collections))for(var m=0;m<p.collections.length;m++)for(var f=p.collections[parseInt(m.toString(),10)],y=0;y<f.items.length;y++)if((y=this.checkClassicItem(f.items,y,!0))!==f.items.length){var g=f.items[parseInt(y.toString(),10)];if(d(g)){var v=n.querySelector("#"+g.id);"GroupButton"===g.type&&(v=n.querySelector("#"+g.id+ao));if((S=(T=v.getAttribute("data-medium-width"))?parseInt(T,10):null)&&(s||r.offsetWidth>S))h(m,y,v),s&&!a||v.removeAttribute("data-medium-width");else if(S)return!0}}}else for(m=0;m<p.collections.length;m++)if(p.collections[parseInt(m.toString(),10)].items.length>1){f=p.collections[parseInt(m.toString(),10)];for(var S=(T=(v=n.querySelector("#"+f.id)).getAttribute("data-medium-width"))?parseInt(T,10):null,I=[],C=0;C<f.items.length;C++)f.items[parseInt(C.toString(),10)].displayOptions&e.DisplayMode.Classic&&I.push(C);if(I.length>1&&S&&(s||r.offsetWidth>S))h(m,I[0],v),h(m,I[1],v),3===I.length&&h(m,I[2],v),s&&!a||v.removeAttribute("data-medium-width");else if(S)return!0}if(u.length>0)for(m=0;m<u.length;m++){var T,w=u[parseInt(m.toString(),10)];if((S=(T=w.getAttribute("data-medium-width"))?parseInt(T,10):null)&&(s||r.offsetWidth>S)){var k=parseInt(w.getAttribute("data-start"),10),O=parseInt(w.getAttribute("data-end"),10);if(c===e.ItemOrientation.Row){f=p.collections[0],y=this.checkClassicItem(f.items,k+1,!0);h(0,k,w),h(0,y,w),y!==O&&h(0,O,w)}else{var B=this.checkClassicCollection(p.collections,k+1,!0);b(k),b(B),B!==O&&b(O)}s&&!a||w.removeAttribute("data-medium-width")}else if(S)return!0}return!1},s.prototype.checkMediumToLarge=function(o,i,r,n,s,a,l){var p=this,c=i.groups[parseInt(r.toString(),10)],u=c.orientation,d=s.querySelector("#"+c.id).querySelectorAll(".e-ribbon-shrink");if(0===d.length)return!1;for(var h=function(i,n,s,c){var u=p.tabs[parseInt(o.toString(),10)].groups[parseInt(r.toString(),10)].collections[0].items,d=function(t){var o=u[parseInt(t.toString(),10)];if(o.displayOptions&e.DisplayMode.Classic){var i=s.querySelector("#"+o.id+$t),r=i.querySelector("#"+o.id);o.setProperties({activeSize:e.RibbonItemSize.Large},!0),o.type===e.RibbonItemType.GroupButton&&(r=i.querySelector("#"+o.id+ao)),p.setItemSize(r,o),s.insertAdjacentElement("beforebegin",i)}};d(i),c&&d(c),d(n),a&&!l||t.remove(s)},b=function(i,n,s,c){var u=p.tabs[parseInt(o.toString(),10)].groups[parseInt(r.toString(),10)].collections,d=function(t){var o=u[parseInt(t.toString(),10)];if(o.items[0].displayOptions&e.DisplayMode.Classic){var i=s.querySelector("#"+o.id),r=i.querySelector("#"+o.items[0].id);o.items[0].setProperties({activeSize:e.RibbonItemSize.Large},!0),o.items[0].type===e.RibbonItemType.GroupButton&&(r=i.querySelector("#"+o.items[0].id+ao)),p.setItemSize(r,o.items[0]),s.insertAdjacentElement("beforebegin",i)}};d(i),c&&d(c),d(n),a&&!l||t.remove(s)},m=0;m<d.length;m++){var f=d[parseInt(m.toString(),10)],y=f.getAttribute("data-large-width"),g=y?parseInt(y,10):null;if(g&&(a||n.offsetWidth>g)){var v=parseInt(f.getAttribute("data-start"),10),S=parseInt(f.getAttribute("data-end"),10);if(u===e.ItemOrientation.Row){var I=c.collections[0],C=this.checkClassicItem(I.items,v+1,!0);C===S?h(v,S,f):h(v,S,f,C)}else{var T=this.checkClassicCollection(c.collections,v+1,!0);T===S?b(v,S,f):b(v,S,f,T)}a&&!l||f.removeAttribute("data-large-width")}else if(g)return!0}return!1},s.prototype.handleContentSize=function(e,t){var o=e.closest("."+ht);t?o.classList.add(Pt):o.classList.remove(Pt)},s.prototype.setItemSize=function(o,i){if(o){var r=o.closest("."+Ct);i.type===e.RibbonItemType.Button?this.ribbonButtonModule.updateButtonSize(o,i):i.type===e.RibbonItemType.DropDown?this.ribbonDropDownModule.updateDropDownSize(o,i):i.type===e.RibbonItemType.SplitButton?this.ribbonSplitButtonModule.updateSplitButtonSize(o,i):i.type===e.RibbonItemType.Template?(t.remove(o),this.createTemplateContent(i,r)):i.type===e.RibbonItemType.GroupButton&&this.ribbonGroupButtonModule.updateGroupButtonSize(o,i),r.classList.remove(Pt,kt,Ot,Bt),i.activeSize===e.RibbonItemSize.Large?r.classList.add(kt,Pt):r.classList.add(i.activeSize===e.RibbonItemSize.Medium?Ot:Bt)}},s.prototype.createOverflowDropdown=function(o,i,n){var s=this.getGroupResizeOrder(!0,o);if(0!==s.length)for(var a=function(a){var c=s[parseInt(a.toString(),10)],u=p.tabObj.element.querySelector("#"+c.id);u.setAttribute("data-expanded-width",n.offsetWidth.toString());var d=u.querySelector("#"+c.id+$t),h=p.createElement("div",{className:ft+" "+kt,id:c.id+eo+$t});u.insertBefore(h,d);var b=l(p.tabs[parseInt(o.toString(),10)].groups,function(e){return e.id===c.id}),m=p.tabs[parseInt(o.toString(),10)];p.checkSmallToMedium(o,m,b,i,n,!0,!1),p.checkMediumToLarge(o,m,b,i,n,!0,!1);var f=p.ribbonDropDownModule.createOverFlowDropDown(c.id,c.header,c.groupIconCss,d,h,p.enableRtl);if(c.keyTip){var y=c.id+eo+to;p.addKeyTip(o,c.keyTip,y,"grpoverflow")}p.tabs[parseInt(o.toString(),10)].groups[parseInt(b.toString(),10)].setProperties({isCollapsed:!0},!0);for(var g=0;g<c.collections.length;g++)for(var v=c.collections[parseInt(g.toString(),10)],S=d.querySelector("#"+v.id),I=0;I<v.items.length;I++){var C=v.items[parseInt(I.toString(),10)],T=S.querySelector("#"+C.id+$t);null!==T&&(p.handleContentSize(T),p.addOverflowEvents(C,T,f));y=document.querySelector("#"+c.id+eo+to);var w=t.getInstance(y,r.DropDownButton);if(w){if(w.target&&p.keyTipElements[parseInt(o.toString(),10)]){if(C.type===e.RibbonItemType.GroupButton)for(var k=0;k<C.groupButtonSettings.items.length;k++)C.groupButtonSettings.items[parseInt(k.toString(),10)].keyTip&&p.addKeyTip(o,C.groupButtonSettings.items[parseInt(k.toString(),10)].keyTip,C.id+(ao+k),"grpoverflowpopup");C.keyTip&&p.addKeyTip(o,C.keyTip,C.id,"grpoverflowpopup")}}}},p=this,c=0;c<s.length&&i.offsetWidth<n.offsetWidth;c++)a(c)},s.prototype.removeOverflowDropdown=function(e,t,o,i){void 0===o&&(o=!1);var r=this.getGroupResizeOrder(!1,i);if(0===r.length)return!1;for(var n=function(n){var a=r[parseInt(n.toString(),10)],p=s.tabObj.element.querySelector("#"+a.id);if(!p)return"break";var c=parseInt(p.getAttribute("data-expanded-width"),10);if(!o&&e.offsetWidth<c)return{value:!0};s.removeDropdown(a.id);var u=l(s.tabs[parseInt(i.toString(),10)].groups,function(e){return e.id===a.id});s.tabs[parseInt(i.toString(),10)].groups[parseInt(u.toString(),10)].setProperties({isCollapsed:!1},!0);var d=s.tabs[parseInt(i.toString(),10)];s.checkLargeToMedium(i,d,u,e,t,!0),s.checkMediumToSmall(i,d,u,e,t,!0);for(var h=0;h<a.collections.length;h++)for(var b=a.collections[parseInt(h.toString(),10)],m=p.querySelector("#"+b.id),f=0;f<b.items.length;f++){var y=b.items[parseInt(f.toString(),10)],g=m.querySelector("#"+y.id+$t);null!==g&&(s.handleContentSize(g,!0),s.removeOverflowEvent(y,g))}},s=this,a=0;a<r.length;a++){var p=n(a);if("object"==typeof p)return p.value;if("break"===p)break}return!1},s.prototype.removeDropdown=function(e){var o=this.tabObj.element.querySelector("#"+e+eo+to);if(o){var i=o.parentElement;this.ribbonDropDownModule.removeOverFlowDropDown(o),t.remove(i)}},s.prototype.getGroupResizeOrder=function(e,o){var i=this,r=this.tabs[parseInt(o.toString(),10)].groups;return(r=r.filter(function(o){return"Classic"!==i.activeLayout||(t.isUndefined(o.isCollapsible)||o.isCollapsible)&&(e&&t.isUndefined(o.isCollapsed)||!t.isUndefined(o.isCollapsed)&&e!==o.isCollapsed)})).sort(function(e,t){return e.priority-t.priority}),e?r.reverse():r},s.prototype.destroyScroll=function(){this.scrollModule&&(this.scrollModule.destroy(),this.scrollModule=null)},s.prototype.clearOverflowDropDown=function(e){var t=this.tabObj.element.querySelector("#"+this.tabs[parseInt(e.toString(),10)].id+Qt);if(t){var o=t.closest("."+ot);"Simplified"===this.activeLayout?this.removeSimplfiedOverflow(t,o,e,!0):this.removeOverflowDropdown(t,o,!0,e)}},s.prototype.isContextualTab=function(e){var t=!1;if(this.contextualTabs.length)for(var o=0;o<this.contextualTabs.length;o++)for(var i=0;i<this.contextualTabs[parseInt(o.toString(),10)].tabs.length;i++)if(this.contextualTabs[parseInt(o.toString(),10)].tabs[parseInt(i.toString(),10)].id===e){t=!0;break}return t},s.prototype.ribbonTabSelecting=function(e){var o=this;this.currentControlIndex=0;var i=e.selectingItem.getAttribute("data-id"),r=e.previousItem.getAttribute("data-id"),n=l(this.tabs,function(e){return e.id===i}),s=this.isContextualTab(i),a=l(this.tabs,function(e){return e.id===r});n=-1===n?this.selectedTab:n;var p={cancel:e.cancel,isInteracted:e.isInteracted,previousIndex:a,selectedIndex:n,isContextual:s};this.trigger("tabSelecting",p,function(e){if(!e.cancel){o.destroyScroll(),o.isAddRemove||-1===a||o.clearOverflowDropDown(a);var i=o.tabObj.items[parseInt(n.toString(),10)].content;if(!i.querySelector("."+rt)&&0!==o.tabs[parseInt(n.toString(),10)].groups.length){var r=o.createGroups(o.tabs[parseInt(n.toString(),10)].groups,n);t.append(r,i)}}})},s.prototype.createTabItems=function(e){for(var t=this,o=[],i=function(i){var n=e[parseInt(i.toString(),10)],s=r.createElement("span",{innerHTML:n.header,id:n.id+Zt}),a=l(r.tabs,function(e){return e.id===n.id});n.keyTip&&(r.keyTipElements[parseInt(a.toString(),10)]||(r.keyTipElements[parseInt(a.toString(),10)]={}),r.addKeyTip(a,n.keyTip,n.id,"tab")),s.onclick=function(){t.minimize(!1)},s.ondblclick=function(){t.minimize(!0)};var p={header:{text:s},id:n.id,cssClass:n.cssClass},c=r.createElement("div",{className:p.cssClass,id:n.id+Qt});c.classList.add(Xe),p.content=c,o.push(p)},r=this,n=0;n<e.length;n++)i(n);return o},s.prototype.renderInitialTab=function(e){var o=this.createGroups(this.tabs[parseInt(e.toString(),10)].groups,e),i=this.tabObj.items[parseInt(e.toString(),10)].content;t.append(o,i),"Simplified"===this.activeLayout&&this.element.classList.add(jt);var r=this.tabObj.element.querySelector("#"+this.tabs[this.selectedTab].id+Qt);this.checkOverflow(this.selectedTab,r),"Classic"===this.activeLayout&&this.ribbonGalleryModule&&this.ribbonGalleryModule.checkAvailableHeight(this.selectedTab,r)},s.prototype.addOverflowButton=function(e,o){var i=this,n=this.createElement("button",{id:e}),s=this.createElement("div",{className:et,attrs:{tabindex:"0"}}),a=new r.DropDownButton({iconCss:_e,cssClass:"e-caret-hide "+yt,target:s,locale:this.locale,enableRtl:this.enableRtl,enablePersistence:this.enablePersistence,beforeOpen:function(e){var t={element:e.element,event:e.event,cancel:e.cancel};i.trigger("overflowPopupOpen",t,function(t){t.cancel&&(e.cancel=!0)})},beforeClose:function(e){var o=e.event?t.closest(e.event.target,"."+Ne):null,r=e.event?t.closest(e.event.target,".e-ribbon-group-button-overflow-popup"):null,n={element:e.element,event:e.event,cancel:e.cancel};i.trigger("overflowPopupClose",n,function(t){(o||t.cancel||r)&&(e.cancel=!0)})}},n);this.element.classList.add(tt),v(s,this),o||(this.keyTipElements.overflowbtn=[],this.keyTipElements.overflowbtn.push({id:e,type:"overflowbtn",keyTip:"00"}));var l;return n.onkeydown=n.onclick=function(){i.itemIndex=-1,l=!n.classList.contains("e-ribbon-overall-of-btn")},s.onkeydown=function(e){return i.upDownKeyHandler(e,s,l),i},a},s.prototype.upDownKeyHandler=function(e,o,i){var r;if(i)r=o.getElementsByClassName("e-ribbon-item");else{r=o.querySelector(".e-ribbon-of-tab.e-ribbon-active").getElementsByClassName("e-ribbon-item")}var s,a,l=r[!this.itemIndex||this.itemIndex<0?0:this.itemIndex].querySelector(".e-control"),p=l&&l.classList.contains("e-combobox")?r[!this.itemIndex||this.itemIndex<0?0:this.itemIndex].querySelector(".e-combobox"):null;if(null===p||"Tab"===e.key||this.itemIndex<0){if("ArrowDown"===e.key||!e.shiftKey&&"Tab"===e.key){if(!this.itemIndex&&0!==this.itemIndex||this.itemIndex<0||this.itemIndex===r.length-1){if(this.itemIndex=0,s=r[this.itemIndex].closest(".e-ribbon-item"),this.findDisabledItem(s,r,!0),p&&"Tab"===e.key){e.preventDefault();(c=r[this.itemIndex].querySelector(".e-control"))&&c.focus()}a=r[this.itemIndex].querySelector(".e-ribbon-template")}else this.itemIndex<r.length-1&&this.itemIndex>=0&&(this.itemIndex++,s=r[this.itemIndex].closest(".e-ribbon-item"),this.findDisabledItem(s,r,!0),a=r[this.itemIndex].querySelector(".e-ribbon-template"));a&&a.focus()}else if(("ArrowUp"===e.key||e.shiftKey&&"Tab"===e.key)&&(null===p||"Tab"===e.key)){if(this.itemIndex&&-1!==this.itemIndex)this.itemIndex<=r.length-1&&this.itemIndex>0&&(this.itemIndex--,s=r[this.itemIndex].closest(".e-ribbon-item"),this.findDisabledItem(s,r,!1),a=r[this.itemIndex].querySelector(".e-ribbon-template"));else{if(this.itemIndex=r.length-1,s=r[this.itemIndex].closest(".e-ribbon-item"),this.findDisabledItem(s,r,!1),p&&e.shiftKey&&"Tab"===e.key){e.preventDefault();var c;(c=r[this.itemIndex].querySelector(".e-control"))&&c.focus()}a=r[this.itemIndex].querySelector(".e-ribbon-template")}a&&a.focus()}o.setAttribute("index",this.itemIndex.toString())}var u=parseInt(o.getAttribute("index"),10),d="",h=r[parseInt(u.toString(),10)]?r[parseInt(u.toString(),10)].querySelector(".e-control"):null;if(h&&(d=h.getAttribute("data-control")),"ArrowDown"===e.key||"ArrowUp"===e.key||" "===e.key||"Tab"===e.key){if("ColorPicker"===d)"Tab"===e.key&&e.preventDefault(),r[parseInt(u.toString(),10)].querySelector(".e-split-colorpicker").focus();else{"Tab"===e.key&&e.preventDefault();var b=r[parseInt(u.toString(),10)].querySelector(".e-control");b&&b.focus()}if(" "===e.key&&"CheckBox"===d){var m=r[parseInt(u.toString(),10)].querySelector(".e-control"),f=t.getComponent(m,n.CheckBox);this.itemIndex=-1,f.click()}}"SplitButton"!==d||"ArrowRight"!==e.key&&"ArrowLeft"!==e.key||("ArrowRight"===e.key&&(this.enableRtl?r[parseInt(u.toString(),10)].querySelector(".e-control").focus():r[parseInt(u.toString(),10)].querySelector(".e-dropdown-btn").focus()),"ArrowLeft"===e.key&&(this.enableRtl?r[parseInt(u.toString(),10)].querySelector(".e-dropdown-btn").focus():r[parseInt(u.toString(),10)].querySelector(".e-control").focus())),"Enter"===e.key&&(this.itemIndex=-1)},s.prototype.findDisabledItem=function(e,t,o){for(;e&&e.classList.contains("e-disabled");)o?this.itemIndex===t.length-1&&t[this.itemIndex].closest(".e-ribbon-item").classList.contains("e-disabled")&&(this.itemIndex=-1):0===this.itemIndex&&t[this.itemIndex].closest(".e-ribbon-item").classList.contains("e-disabled")&&(this.itemIndex=t.length),o?this.itemIndex++:this.itemIndex--,e=t[this.itemIndex].closest(".e-ribbon-item")},s.prototype.removeOverflowButton=function(e){if(e){var t=e.element;S(e.target),e.destroy(),t.remove()}},s.prototype.removeOverflowEvent=function(e,t){if(t)switch(e.type){case"Button":this.ribbonButtonModule.removeOverFlowEvents(e,t);break;case"DropDown":this.ribbonDropDownModule.removeOverFlowEvents(e,t);break;case"SplitButton":this.ribbonSplitButtonModule.removeOverFlowEvents(e,t);break;case"CheckBox":this.ribbonCheckBoxModule.removeOverFlowEvents(e,t);break;case"ColorPicker":this.ribbonColorPickerModule.removeOverFlowEvents(e,t);break;case"ComboBox":this.ribbonComboBoxModule.removeOverFlowEvents(e,t);break;case"Gallery":this.ribbonGalleryModule.removeOverFlowEvents(e,t);break;case"GroupButton":this.ribbonGroupButtonModule.removeOverFlowEvents(e,t)}},s.prototype.createGroupContainer=function(e,t){var o=this.createElement("div",{className:dt,id:e+$t}),i=this.createElement("div",{className:mt,id:e+Zt,innerHTML:t});return o.append(i),o},s.prototype.addExpandCollapse=function(){var e=this;this.collapseButton=this.createElement("span",{className:Ye+" "+xe,id:this.tabObj.element.id+Vt,attrs:{tabindex:"0",type:"button","aria-label":"Layout Switcher",role:"button"}}),this.collapseButton.onclick=function(){e.toggleLayout()},this.collapseButton.onkeydown=function(t){"Enter"===t.key&&e.toggleLayout()},this.element.classList.add(Je),"Simplified"===this.activeLayout&&this.collapseButton.classList.add(Ze),this.tabObj.element.appendChild(this.collapseButton),this.layoutSwitcherKeyTip&&(this.keyTipElements.collapse=[],this.keyTipElements.collapse.push({id:this.collapseButton.id,type:"collapse",keyTip:this.layoutSwitcherKeyTip}))},s.prototype.removeExpandCollapse=function(){var e=this,o=l(this.tooltipData,function(t){return t.id===e.collapseButton.id});-1!==o&&this.tooltipData.splice(o,1),this.element.classList.remove(Je),t.remove(this.tabObj.element.querySelector("."+Ye)),this.collapseButton=null},s.prototype.reRenderTabs=function(e){this.destroyScroll(),this.checkID(this.tabs,"tab",this.element.id);for(var o in e){for(var i=parseInt(o,10),r=e[parseInt(i.toString(),10)],n=!1,s=0;s<this.tabObj.items.length;s++)if(this.tabs[parseInt(i.toString(),10)].id===this.tabObj.items[parseInt(s.toString(),10)].id){n=!0;break}if(!n){this.destroyTabItems(this.tabsInternal),this.tabsInternal=this.tabs.slice(),this.validateItemSize();var a=this.createTabItems(this.tabs);this.selectedTab>=this.tabs.length&&(this.selectedTab=this.tabs.length-1),this.tabObj.setProperties({items:a,selectedItem:this.selectedTab});break}var l=this.tabs[parseInt(i.toString(),10)].groups,p=this.tabObj.element,c=this.tabs[parseInt(i.toString(),10)];c.setProperties(r,!0),this.setProperties({groups:this.checkID(c.groups,"group",c.id)},!0),this.validateItemSize();var u=this.tabObj.items[parseInt(i.toString(),10)].content;if(l&&(r.header&&(this.tabObj.items[parseInt(i.toString(),10)].header.text.innerText=c.header),r.cssClass&&(this.tabObj.items[parseInt(i.toString(),10)].cssClass&&(u.classList.remove(this.tabObj.items[parseInt(i.toString(),10)].cssClass),p.querySelector(".e-active").classList.remove(this.tabObj.items[parseInt(i.toString(),10)].cssClass)),u.classList.add(c.cssClass),p.querySelector(".e-active").classList.add(c.cssClass)),r.groups)){for(var d=0,h=l;d<h.length;d++){for(var b=h[d],m=b.isCollapsed?u.querySelector("#"+b.id+eo+to):null,f=0,y=b.collections;f<y.length;f++)for(var g=0,v=y[f].items;g<v.length;g++){var S=v[g],I=m?this.ribbonDropDownModule.getDDBItemElement(m,S.id):u.querySelector("#"+S.id);I&&this.destroyFunction(S,I)}m&&this.ribbonDropDownModule.removeOverFlowDropDown(m)}u.querySelectorAll(".e-ribbon-group").forEach(function(e){e.remove()});var C=this.createGroups(c.groups,i);t.append(C,u)}}var T=this.tabObj.element.querySelector("#"+this.tabs[this.selectedTab].id+Qt);this.checkOverflow(this.selectedTab,T)},s.prototype.switchLayout=function(){this.currentControlIndex=0,this.destroyScroll(),this.collapseButton.classList.toggle(Ze,"Simplified"===this.activeLayout),this.element.classList.toggle(jt,"Simplified"===this.activeLayout);for(var o=0;o<=this.tabs.length-1;o++){var i=o;if(""!==this.tabObj.items[parseInt(i.toString(),10)].content.innerHTML){var n=this.tabs[parseInt(i.toString(),10)],s=this.tabs[parseInt(i.toString(),10)].groups,a=this.tabObj.element.querySelector("#"+this.tabs[parseInt(i.toString(),10)].id+Qt),l=a.closest("."+ot);if("Simplified"===this.activeLayout)for(var p=0;p<s.length;p++){var c=s[parseInt(p.toString(),10)],u=s[parseInt(p.toString(),10)].orientation;c.isCollapsed?(c.setProperties({isCollapsed:!1},!0),this.removeDropdown(c.id)):(this.checkSmallToMedium(i,n,p,l,a,!0,!1),this.checkMediumToLarge(i,n,p,l,a,!0,!1));for(var d=l.querySelector("#"+c.id),h=(O=d.querySelector("#"+c.id+$t)).querySelectorAll(".e-ribbon-shrink"),b=0;b<h.length;b++)h[parseInt(b.toString(),10)].remove();(P=O.querySelector("#"+c.id+Zt)).remove();(B=O.querySelector("#"+c.id+Qt)).classList.replace(Tt,wt),B.classList.remove(Pt);for(var m=0;m<c.collections.length;m++){var f=c.collections[parseInt(m.toString(),10)];(R=O.querySelector("#"+f.id)).classList.replace(Tt,wt);for(var y=0;y<f.items.length;y++){for(var g=f.items,v=f.items[parseInt(y.toString(),10)],S=!0;S&&v.displayOptions===e.DisplayMode.Classic;){y++;var I=O.querySelector("#"+v.id+$t),C=I.querySelector("#"+v.id);this.destroyFunction(v,C),I.remove(),y<g.length?v=g[parseInt(y.toString(),10)]:S=!1}if(!S)break;var T=v.allowedSizes===e.RibbonItemSize.Large||v.allowedSizes&e.RibbonItemSize.Medium?e.RibbonItemSize.Medium:e.RibbonItemSize.Small;T=!(v.displayOptions&e.DisplayMode.Simplified)&&v.displayOptions&e.DisplayMode.Overflow?e.RibbonItemSize.Medium:T;var w=void 0;if(v.displayOptions&e.DisplayMode.Classic){if(w=O.querySelector("#"+v.id+$t),v.displayOptions===(e.DisplayMode.Classic|e.DisplayMode.Overflow)&&(this.createOverflowPopup(v,i,c.enableGroupOverflow,c.id,c.header,w,O),v.type!==e.RibbonItemType.DropDown&&v.type!==e.RibbonItemType.SplitButton&&v.type!==e.RibbonItemType.GroupButton&&v.type!==e.RibbonItemType.Gallery||this.updatePopupItems(v,w,c.enableGroupOverflow,!0)),v.type===e.RibbonItemType.GroupButton&&this.ribbonGroupButtonModule.switchGroupButton(v,w),v.setProperties({activeSize:T},!0),w){C=w.querySelector("#"+v.id);this.setItemSize(C,v)}}else w=this.createItems([v],u,c.id,c.header,c.enableGroupOverflow,i,O)[0],v.displayOptions&e.DisplayMode.Simplified&&R.append(w);v.type===e.RibbonItemType.Gallery&&this.ribbonGalleryModule.switchGalleryItems(this.activeLayout,v.id)}}c.enableGroupOverflow||d.querySelector("."+Ct)||d.classList.add("e-ribbon-emptyCollection")}else{this.element.classList.remove(tt);for(var k=0;k<s.length;k++){c=s[parseInt(k.toString(),10)],u=s[parseInt(k.toString(),10)].orientation;var O,B=(O=l.querySelector("#"+c.id+$t)).querySelector("#"+c.id+Qt),P=this.createElement("div",{className:bt,id:c.id+Zt,innerHTML:c.header});O.appendChild(P),"Row"===u&&B.classList.replace(wt,Tt),B.classList.add(Pt);for(m=0;m<c.collections.length;m++){var L=void 0,E=void 0;if(c.enableGroupOverflow){var D=O.querySelector("#"+c.id+Yt);D&&(E=(L=t.getInstance(D,r.DropDownButton)).target)}else(L=this.overflowDDB)&&(E=this.overflowDDB.target);f=c.collections[parseInt(m.toString(),10)];var R=O.querySelector("#"+f.id);"Column"===u&&R.classList.replace(wt,Tt);for(y=0;y<f.items.length;y++){for(g=f.items,v=f.items[parseInt(y.toString(),10)],S=!0;S&&!(v.displayOptions&e.DisplayMode.Classic);){y++;w=void 0;if((v.displayOptions&e.DisplayMode.Simplified||v.displayOptions&e.DisplayMode.Overflow)&&null!==(w=v.displayOptions&e.DisplayMode.Simplified?O.querySelector("#"+v.id+$t):E.querySelector("#"+v.id+$t))){var x=w.querySelector("#"+v.id);this.destroyFunction(v,x),w.remove()}y<g.length?v=g[parseInt(y.toString(),10)]:S=!1}if(!S)break;if(v.displayOptions&(e.DisplayMode.Simplified|e.DisplayMode.Overflow)){!(w=O.querySelector("#"+v.id+$t))&&E&&(w=E.querySelector("#"+v.id+$t),v.type!==e.RibbonItemType.DropDown&&v.type!==e.RibbonItemType.SplitButton&&v.type!==e.RibbonItemType.GroupButton&&v.type!==e.RibbonItemType.Gallery||this.updatePopupItems(v,w,c.enableGroupOverflow,!1),this.removeOverflowEvent(v,w)),v.type===e.RibbonItemType.GroupButton&&this.ribbonGroupButtonModule.switchGroupButton(v,w),w&&R.append(w)}else{var w=this.createItems([v],u,c.id,c.header,c.enableGroupOverflow,i)[0];R.append(w)}C=O.querySelector("#"+v.id);v.type===e.RibbonItemType.GroupButton&&(C=O.querySelector("#"+v.id+ao));var M=v.allowedSizes&e.RibbonItemSize.Large?e.RibbonItemSize.Large:v.allowedSizes&e.RibbonItemSize.Medium?e.RibbonItemSize.Medium:e.RibbonItemSize.Small;v.setProperties({activeSize:M},!0),this.setItemSize(C,v),v.type===e.RibbonItemType.Gallery&&this.ribbonGalleryModule.switchGalleryItems(this.activeLayout,v.id)}c.enableGroupOverflow&&L&&(0===E.childElementCount||1===E.childElementCount&&this.isHeaderVisible(E,c.id))&&this.removeOverflowButton(L)}}}this.selectedTab===i&&this.checkOverflow(i,a)}}"Classic"===this.activeLayout&&(this.removeOverflowButton(this.overflowDDB),this.overflowDDB=null)},s.prototype.createLauncherIcon=function(e,o,i){var r=this,n=this.createElement("div",{className:vt+" "+(this.launcherIconCss?this.launcherIconCss:St),id:e+Jt,attrs:{tabindex:"0",type:"button","aria-label":"Launcher Icon",role:"button"}});o.appendChild(n),o.classList.add(gt),t.EventHandler.add(n,"click",this.launcherIconClicked.bind(this,e),this),t.EventHandler.add(n,"keydown",function(t){"Enter"===t.key&&r.launcherIconClicked(e)},this);var s=d(this.tabs,e);s.group.launcherIconKeyTip&&this.addKeyTip(i,s.group.launcherIconKeyTip,n.id,"launcher")},s.prototype.launcherIconClicked=function(e){var t={groupId:e};this.trigger("launcherIconClick",t)},s.prototype.createGroups=function(e,o){for(var i=[],r=0;r<e.length;r++){var n=e[parseInt(r.toString(),10)],s=n.orientation,a=this.createElement("div",{className:n.cssClass,id:n.id});a.classList.add(rt),i.push(a);var l=this.createElement("div",{className:n.cssClass,id:n.id+$t});l.classList.add(ct),a.appendChild(l);var p=this.createElement("div",{className:"Simplified"===this.activeLayout?ht:ht+" "+Pt,id:n.id+Qt});if(p.classList.add("Column"===s||"Simplified"===this.activeLayout?wt:Tt),l.appendChild(p),"Classic"===this.activeLayout){var c=this.createElement("div",{className:bt,id:n.id+Zt,innerHTML:n.header});l.appendChild(c)}n.showLauncherIcon&&this.createLauncherIcon(n.id,l,o);var u=this.createCollection(n.collections,n.orientation,n.id,n.header,n.enableGroupOverflow,o,l);t.append(u,p);for(var d=!0,h=0;h<u.length;h++)if(d)for(var b=0;b<u[parseInt(h.toString(),10)].children.length;b++)if(!u[parseInt(h.toString(),10)].children[parseInt(b.toString(),10)].classList.contains("e-hidden")){d=!1;break}d&&a.classList.add("e-hide-group"),"Simplified"!==this.activeLayout||n.enableGroupOverflow||a.querySelector("."+Ct)||a.classList.add("e-ribbon-emptyCollection");var m=this.initialPropsData[parseInt(o.toString(),10)];m&&(m.hiddenGroups&&m.hiddenGroups.length&&this.updateGroupProps("hiddenGroups",m,a),m.disabledGroups&&m.disabledGroups.length&&this.updateGroupProps("disabledGroups",m,a))}return this.initialPropsData[parseInt(o.toString(),10)]&&delete this.initialPropsData[parseInt(o.toString(),10)],i},s.prototype.updateGroupProps=function(e,t,o){-1!==t[e].indexOf(o.id)&&("hiddenGroups"===e?o.classList.add("e-hidden"):o.classList.add("e-disabled"))},s.prototype.validateItemSize=function(){for(var t=0;t<this.tabs.length;t++)for(var o=this.tabs[parseInt(t.toString(),10)].groups,i=0;i<o.length;i++)for(var r=o[parseInt(i.toString(),10)].collections,n=o[parseInt(i.toString(),10)].orientation,s=0;s<r.length;s++)for(var a=r[parseInt(s.toString(),10)].items,l=0;l<a.length;l++){var p=a[parseInt(l.toString(),10)];if(p.allowedSizes&&0!==p.allowedSizes||p.setProperties({allowedSizes:e.RibbonItemSize.Small|e.RibbonItemSize.Medium|e.RibbonItemSize.Large},!0),"ColorPicker"===p.type&&p.allowedSizes!==e.RibbonItemSize.Small)p.setProperties({allowedSizes:e.RibbonItemSize.Small},!0);else if("ComboBox"!==p.type&&"CheckBox"!==p.type||p.allowedSizes===e.RibbonItemSize.Medium){if(("Column"===n&&a.length>1||"Row"===n&&r.length>1)&&p.allowedSizes&e.RibbonItemSize.Large){var c=p.allowedSizes&(e.RibbonItemSize.Small|e.RibbonItemSize.Medium);c=c||e.RibbonItemSize.Medium,p.setProperties({allowedSizes:c},!0)}}else p.setProperties({allowedSizes:e.RibbonItemSize.Medium},!0);var u=p.allowedSizes&e.RibbonItemSize.Large?e.RibbonItemSize.Large:p.allowedSizes&e.RibbonItemSize.Medium?e.RibbonItemSize.Medium:e.RibbonItemSize.Small;p.setProperties({activeSize:u},!0)}},s.prototype.createCollection=function(e,o,i,r,n,s,a){for(var l=[],p=0;p<e.length;p++){var c=e[parseInt(p.toString(),10)],u=this.createElement("div",{className:c.cssClass,id:c.id});u.classList.add(It),u.classList.add("Column"!==o||"Simplified"===this.activeLayout?wt:Tt),l.push(u);var d=this.createItems(c.items,o,i,r,n,s,a);if(t.append(d,u),"Row"===o&&2===p)break}return l},s.prototype.createRibbonItem=function(e,t){switch(e.type){case"Button":this.ribbonButtonModule.createButton(e,t);break;case"DropDown":this.ribbonDropDownModule.createDropDown(e,t);break;case"SplitButton":this.ribbonSplitButtonModule.createSplitButton(e,t);break;case"CheckBox":this.ribbonCheckBoxModule.createCheckBox(e,t);break;case"ColorPicker":this.ribbonColorPickerModule.createColorPicker(e,t);break;case"ComboBox":this.ribbonComboBoxModule.createComboBox(e,t);break;case"Template":this.createTemplateContent(e,t);break;case"GroupButton":this.ribbonGroupButtonModule.createGroupButton(e,t);break;case"Gallery":this.ribbonGalleryModule.createGallery(e,t)}},s.prototype.createItems=function(t,o,i,r,n,s,a){for(var l,p=[],c=0;c<t.length;c++){for(var u=t[parseInt(c.toString(),10)],d=!0;d&&("Simplified"===this.activeLayout&&!(u.displayOptions&(e.DisplayMode.Simplified|e.DisplayMode.Overflow))||"Classic"===this.activeLayout&&!(u.displayOptions&e.DisplayMode.Classic));)++c<t.length?u=t[parseInt(c.toString(),10)]:d=!1;if(!d)break;var h=this.createElement("div",{className:u.cssClass,id:u.id+$t});if((l=h.classList).add.apply(l,[Ct].concat(u.disabled?[Ae]:[])),u.ribbonTooltipSettings&&y(u.ribbonTooltipSettings)&&(h.classList.add(Rt),this.tooltipData.push({id:h.id,data:u.ribbonTooltipSettings})),u.type===e.RibbonItemType.GroupButton)for(var b=0;b<u.groupButtonSettings.items.length;b++)this.keyTipElements[parseInt(s.toString(),10)]&&u.groupButtonSettings.items[parseInt(b.toString(),10)].keyTip&&this.addKeyTip(s,u.groupButtonSettings.items[parseInt(b.toString(),10)].keyTip,u.id+(ao+b),"item");u.keyTip&&(u.type===e.RibbonItemType.Gallery?this.addKeyTip(s,u.keyTip,u.id+"_popupButton","item"):this.addKeyTip(s,u.keyTip,u.id,"item"));var m=u.activeSize;u.type!==e.RibbonItemType.Gallery&&("Simplified"===this.activeLayout&&(m=u.allowedSizes===e.RibbonItemSize.Large||u.allowedSizes&e.RibbonItemSize.Medium||u.displayOptions===e.DisplayMode.Overflow?e.RibbonItemSize.Medium:e.RibbonItemSize.Small,u.setProperties({activeSize:m},!0)),m&e.RibbonItemSize.Large?h.classList.add(kt,Pt):h.classList.add(m&e.RibbonItemSize.Medium?Ot:Bt));var f=this.initialPropsData[parseInt(s.toString(),10)];if(f&&f.hiddenItems&&f.hiddenItems.length){-1!==f.hiddenItems.indexOf(u.id)&&h.classList.add("e-hidden")}if(this.createRibbonItem(u,h),"Simplified"!==this.activeLayout||u.displayOptions!==e.DisplayMode.Overflow&&u.displayOptions!==(e.DisplayMode.Classic|e.DisplayMode.Overflow)?p.push(h):(this.createOverflowPopup(u,s,n,i,r,h,a),u.type!==e.RibbonItemType.DropDown&&u.type!==e.RibbonItemType.SplitButton&&u.type!==e.RibbonItemType.GroupButton&&u.type!==e.RibbonItemType.Gallery||this.updatePopupItems(u,h,n,!0)),"Column"===o&&2===c)break}return p},s.prototype.createHelpPaneTemplate=function(){if(this.helpPaneTemplate){var e="helpPaneTemplate";this.clearTemplate([e]),this.ribbonTempEle=this.createElement("div",{className:Et,id:this.element.id+so});var o=p(this.helpPaneTemplate);t.append(o({},this,e,"helpPaneTemplate",this.isStringTemplate),this.ribbonTempEle);var i=this.tabObj.element;i.querySelector(".e-toolbar").after(this.ribbonTempEle),i.style.setProperty(co,this.ribbonTempEle.offsetWidth+"px"),this.renderReactTemplates()}},s.prototype.createTemplateContent=function(e,t){var o=this.createElement("div",{className:e.cssClass?Lt+" "+e.cssClass:Lt,id:e.id,attrs:{tabindex:"-1"}});e.disabled&&(o.classList.add(Ae),o.setAttribute("disabled","")),t.appendChild(o),this.renderItemTemplate(e,o)},s.prototype.renderItemTemplate=function(o,i){var r="ribbon"+o.id+"itemTemplate";this.clearTemplate([r]);var n=p(o.itemTemplate);t.append(n({activeSize:e.RibbonItemSize[o.activeSize]},this,r,o.id+"itemTemplate",this.isStringTemplate),i),this.renderReactTemplates()},s.prototype.checkID=function(e,t,o){for(var i="tab"===t?"_tab":"group"===t?"_group":"collection"===t?"_collection":"_item",r=0;r<e.length;r++){var n=e[parseInt(r.toString(),10)];switch(n.id||n.setProperties({id:o+i+this.idIndex++},!0),t){case"tab":n.setProperties({groups:this.checkID(n.groups,"group",n.id)},!0);break;case"group":n.setProperties({collections:this.checkID(n.collections,"collection",n.id)},!0);break;case"collection":n.setProperties({items:this.checkID(n.items,"item",n.id)},!0)}}return e},s.prototype.updateCommonProperty=function(o){this.tabObj.setProperties(o),this.ribbonFileMenuModule&&this.ribbonFileMenuModule.setCommonProperties(o),this.ribbonBackstageModule&&this.ribbonBackstageModule.setCommonProperties(o);for(var i=0;i<this.tabs.length;i++){var n=this.tabs[parseInt(i.toString(),10)],s=this.tabObj.items[parseInt(i.toString(),10)].content;if(s.querySelector("."+rt))for(var a=0,l=n.groups;a<l.length;a++){var p=l[a],c=void 0,u=void 0;this.activeLayout===e.RibbonLayout.Classic?c=p.isCollapsed?s.querySelector("#"+p.id+eo+to):null:(u=(c=p.enableGroupOverflow?s.querySelector("#"+p.id+Yt):null)?t.getComponent(c,r.DropDownButton):this.overflowDDB)&&(I(u.target,o),u.setProperties(o));for(var d=0,h=p.collections;d<h.length;d++)for(var m=0,f=h[d].items;m<f.length;m++){var y=f[m],g=null;if(this.activeLayout===e.RibbonLayout.Classic?y.displayOptions&e.DisplayMode.Classic&&(g=c?this.ribbonDropDownModule.getDDBItemElement(c,y.id):y.type===e.RibbonItemType.GroupButton?s.querySelector("#"+y.id+ao):s.querySelector("#"+y.id)):(g=y.displayOptions&e.DisplayMode.Simplified?s.querySelector("#"+y.id):null)||(g=u.target.querySelector("#"+y.id),"DropDown"===y.type&&this.updatePopupItems(y,u.target,p.enableGroupOverflow,!0)),g){var v=this.getItemModuleName(y);if("template"!==v)if("group-btn"===v&&"Classic"===this.activeLayout)for(var S=0;S<y.groupButtonSettings.items.length;S++){b(g.querySelector("#"+y.id+ao+S),"btn",o)}else if("group-btn"===v&&"Simplified"===this.activeLayout){b(g,"dropdown-btn",o);for(var C=0;C<y.groupButtonSettings.items.length;C++){b(document.querySelector("#"+y.id+ao+C),"btn",o)}}else b(g,v,o);else t.isNullOrUndefined(o.enableRtl)||g.classList.toggle(je,o.enableRtl)}}}}},s.prototype.removeLauncherIcon=function(e,o,i){var r=e+$t,n=o?this.ribbonDropDownModule.getDDBItemElement(o,r):i.querySelector("#"+r);if(n){n.classList.remove(gt);var s=n.querySelector("#"+e+Jt);t.remove(s)}},s.prototype.destroyTabItems=function(o){for(var i=0;i<o.length;i++)for(var n=o[parseInt(i.toString(),10)],s=this.tabObj.items[parseInt(i.toString(),10)].content,a=0,l=n.groups;a<l.length;a++){var p=l[a],c=void 0,u=void 0;this.activeLayout===e.RibbonLayout.Classic?(c=p.isCollapsed?s.querySelector("#"+p.id+eo+to):null,p.showLauncherIcon&&this.removeLauncherIcon(p.id,c,s)):u=(c=p.enableGroupOverflow?s.querySelector("#"+p.id+Yt):null)?t.getComponent(c,r.DropDownButton):this.overflowDDB;for(var d=0,h=p.collections;d<h.length;d++)for(var b=0,m=h[d].items;b<m.length;b++){var f=m[b],y=void 0;this.activeLayout===e.RibbonLayout.Classic?f.displayOptions&e.DisplayMode.Classic&&(y=c?this.ribbonDropDownModule.getDDBItemElement(c,f.id):s.querySelector("#"+f.id),f.type===e.RibbonItemType.GroupButton&&(y=c?this.ribbonDropDownModule.getDDBItemElement(c,f.id+ao):s.querySelector("#"+f.id+ao)),f.type===e.RibbonItemType.Gallery&&(y=s.querySelector("#"+f.id+$t))):(y=f.displayOptions&e.DisplayMode.Simplified?s.querySelector("#"+f.id):null,f.type===e.RibbonItemType.Gallery&&(y=f.displayOptions&e.DisplayMode.Simplified?s.querySelector("#"+f.id+$t):null),y||(y=u?u.target.querySelector("#"+f.id):null)),y&&this.destroyFunction(f,y)}this.activeLayout===e.RibbonLayout.Classic&&c?this.ribbonDropDownModule.removeOverFlowDropDown(c):this.activeLayout===e.RibbonLayout.Simplified&&p.enableGroupOverflow&&c&&this.removeOverflowButton(u)}this.overflowDDB&&(this.removeOverflowButton(this.overflowDDB),this.overflowDDB=null)},s.prototype.destroyFunction=function(e,t){var o=this.getItemModuleName(e);if("colorpicker"===o)this.ribbonColorPickerModule.unwireColorPickerEvents(t);else if("group-btn"===o){if("Classic"===this.activeLayout)for(var i=0;i<e.groupButtonSettings.items.length;i++){var r=t.querySelector("#"+e.id+ao+i);r&&h(r,"btn")}else this.ribbonGroupButtonModule.destroyDropDown(e);var n=function(t){if(e.groupButtonSettings.items[parseInt(t.toString(),10)].ribbonTooltipSettings){var o=e.id+ao+t,i=l(s.tooltipData,function(e){return e.id===o});-1!==i&&s.tooltipData.splice(i,1)}},s=this;for(i=0;i<e.groupButtonSettings.items.length;i++)n(i)}else if("gallery"===o)if(t.closest(".e-ribbon-overflow-target")){h(t,"dropdown-btn");(c=Array.prototype.slice.call(document.querySelectorAll("#"+e.id+"_galleryPopup"))).concat(Array.prototype.slice.call(document.querySelectorAll("#"+e.id+"-popup")));for(i=0;i<c.length;i++)c[parseInt(i.toString(),10)].remove()}else{var a=t.querySelectorAll(".e-ribbon-gallery-item"),p=t.querySelector("#"+e.id+"_popupButton");p&&p.remove();for(i=0;i<a.length;i++)a[parseInt(i.toString(),10)].remove();var c=document.querySelectorAll("#"+e.id+"_galleryPopup");for(i=0;i<c.length;i++)c[parseInt(i.toString(),10)].remove()}else"template"!==o&&h(t,o);if(e.ribbonTooltipSettings){var u=l(this.tooltipData,function(t){return t.id===e.id+$t});-1!==u&&this.tooltipData.splice(u,1)}"GroupButton"===e.type&&this.ribbonGroupButtonModule.destroyDropDown(e)},s.prototype.getItemModuleName=function(e){switch(e.type){case"Button":return"btn";case"DropDown":return"dropdown-btn";case"SplitButton":return"split-btn";case"CheckBox":return"checkbox";case"ColorPicker":return"colorpicker";case"ComboBox":return"combobox";case"GroupButton":return"group-btn";case"Gallery":return"gallery";default:return"template"}},s.prototype.clearOverflowResize=function(){this.destroyScroll(),this.clearOverflowDropDown(this.selectedTab);for(var e=this.tabs[this.selectedTab],t=this.tabObj.element.querySelector("#"+this.tabs[this.selectedTab].id+Qt),o=t.closest("."+ot),i=0;i<e.groups.length;i++)this.checkSmallToMedium(this.selectedTab,e,i,o,t,!0,!0),this.checkMediumToLarge(this.selectedTab,e,i,o,t,!0,!0)},s.prototype.refreshLayout=function(){this.resizeHandler()},s.prototype.selectTab=function(e){var t=l(this.tabs,function(t){return t.id===e});this.setProperties({selectedTab:t})},s.prototype.showTab=function(e,t){void 0===t&&(t=!1),this.showHideTab(e,!1,t)},s.prototype.hideTab=function(e,t){void 0===t&&(t=!1),this.showHideTab(e,!0,t)},s.prototype.showHideTab=function(e,t,o){var i=l(this.tabs,function(t){return t.id===e});if(-1!==i&&(this.tabObj.hideTab(i,t),o)){for(var r,n=this.tabObj.element,s=0;s<this.contextualTabs.length;s++)for(var a=0;a<this.contextualTabs[parseInt(s.toString(),10)].tabs.length;a++)e===this.contextualTabs[parseInt(s.toString(),10)].tabs[parseInt(a.toString(),10)].id&&(r=this.contextualTabs[parseInt(s.toString(),10)]);if(r){var p=!0,c=function(e){var t=l(u.tabs,function(t){return t.id===r.tabs[parseInt(e.toString(),10)].id});if(-1!==t){n.querySelectorAll(".e-toolbar-item")[parseInt(t.toString(),10)].classList.contains("e-hidden")||(p=!1)}},u=this;for(s=0;s<r.tabs.length;s++)c(s);p?r.setProperties({visible:!1},!0):r.setProperties({visible:!0},!0)}}},s.prototype.enableTab=function(e){this.enableDisableTab(e,!0)},s.prototype.disableTab=function(e){this.enableDisableTab(e,!1)},s.prototype.enableDisableTab=function(e,t){var o=l(this.tabs,function(t){return t.id===e});-1!==o&&this.tabObj.enableTab(o,t)},s.prototype.addTab=function(e,t,o){var i=t?l(this.tabs,function(e){return e.id===t}):-1;i=-1===i?this.tabs.length:i+(o?1:0),this.tabsInternal=this.tabs.slice(),this.tabsInternal.splice(i,0,e),this.setProperties({tabs:this.tabsInternal},!0),this.checkID([this.tabs[parseInt(i.toString(),10)]],"tab",this.element.id),this.tabsInternal=this.tabs.slice(),this.validateItemSize();var r=this.createTabItems([e]);this.tabObj.addTab(r,i)},s.prototype.removeTab=function(t){var o=l(this.tabs,function(e){return e.id===t});if(-1!==o){var i=this.tabObj.items[parseInt(o.toString(),10)].content,r=this.tabs[parseInt(o.toString(),10)].groups;if(r&&""!==i.innerHTML)for(var n=0,s=r;n<s.length;n++){for(var a=s[n],p=a.isCollapsed?i.querySelector("#"+a.id+eo+to):null,c=0,u=a.collections;c<u.length;c++)for(var d=0,h=u[c].items;d<h.length;d++){var b=h[d],m=p?this.ribbonDropDownModule.getDDBItemElement(p,b.id):i.querySelector("#"+b.id);b.type===e.RibbonItemType.GroupButton&&"Classic"===this.activeLayout&&(m=p?this.ribbonDropDownModule.getDDBItemElement(p,b.id+ao):i.querySelector("#"+b.id+ao)),m&&this.destroyFunction(b,m)}p&&this.ribbonDropDownModule.removeOverFlowDropDown(p)}o===this.selectedTab&&(this.isAddRemove=!0),this.tabsInternal=this.tabs.slice(),this.tabsInternal.splice(o,1),this.setProperties({tabs:this.tabsInternal},!0),this.tabObj.removeTab(o)}},s.prototype.addGroup=function(e,t,o,i){var r=l(this.tabs,function(t){return t.id===e});if(-1!==r){this.selectedTab===r&&this.clearOverflowResize();var n=this.tabs[parseInt(r.toString(),10)],s=n.groups.slice(),a=o?l(s,function(e){return e.id===o}):-1;a=-1===a?s.length:a+(i?1:0),s.splice(a,0,t),n.setProperties({groups:s},!0),this.checkID([n.groups[parseInt(a.toString(),10)]],"group",e),this.validateItemSize();var p=this.tabObj.items[parseInt(r.toString(),10)].content;if(""!==p.innerHTML){var c=this.createGroups([n.groups[parseInt(a.toString(),10)]],r)[0],u=o?p.querySelector("#"+o):null;u?u.insertAdjacentElement(i?"afterend":"beforebegin",c):p.append(c)}this.selectedTab===r&&this.refreshLayout()}},s.prototype.removeGroup=function(o){var i=d(this.tabs,o);if(i){this.selectedTab===i.tabIndex&&this.clearOverflowResize();var n=this.tabObj.items[i.tabIndex].content;if(""!==n.innerHTML){var s=void 0,a=void 0;i.group.showLauncherIcon&&this.removeLauncherIcon(i.group.id,null,n),this.activeLayout===e.RibbonLayout.Simplified&&(a=(s=i.group.enableGroupOverflow?n.querySelector("#"+i.group.id+Yt):null)?t.getComponent(s,r.DropDownButton):this.overflowDDB);for(var l=0,p=i.group.collections;l<p.length;l++)for(var c=0,u=p[l].items;c<u.length;c++){var h=u[c];this.removeItemElement(n,h,a)}if(this.activeLayout===e.RibbonLayout.Simplified)if(i.group.enableGroupOverflow)(0===a.target.childElementCount||1===a.target.childElementCount&&this.isHeaderVisible(a.target,i.group.id))&&this.removeOverflowButton(a);else{var b=a.target.querySelector("#"+i.group.id+$t);b&&1===b.childElementCount&&b.remove();var m=a.target.querySelector("#"+this.tabs[parseInt(i.tabIndex.toString(),10)].id+eo);m&&0===m.childElementCount&&m.remove()}var f=n.querySelector("#"+o);f&&f.remove()}var y=this.tabs[i.tabIndex].groups.slice();y.splice(i.groupIndex,1),this.tabs[i.tabIndex].setProperties({groups:y},!0),this.selectedTab===i.tabIndex&&this.refreshLayout()}},s.prototype.isHeaderVisible=function(e,t){return!!e.querySelector("#"+t+Yt+Zt)},s.prototype.hideGroup=function(e){this.showHideGroup(e,!0)},s.prototype.showGroup=function(e){this.showHideGroup(e,!1)},s.prototype.showHideGroup=function(e,o){var i,n=d(this.tabs,e);if(n){var s=this.tabObj.items[n.tabIndex].content,a=s.querySelector("#"+e);if(a?this.updateHiddenElements(n.tabIndex,o?"hideGroup":"showGroup",e,o,a):this.updateInitialProps(n.tabIndex,e,"hiddenGroups",o),this.overflowDDB){var l=this.overflowDDB.target.querySelector("#"+this.tabs[parseInt(n.tabIndex.toString(),10)].id+eo);if(n.group.enableGroupOverflow){var p=s.querySelector("#"+e+Yt);p&&(i=t.getInstance(p,r.DropDownButton).target),i&&(o?i.classList.add("e-hidden"):i.classList.remove("e-hidden"))}else if(l){var c=l.querySelector("#"+e+$t);c&&(o?c.classList.add("e-hidden"):c.classList.remove("e-hidden"))}}this.selectedTab===n.tabIndex&&this.refreshLayout()}},s.prototype.updateHiddenElements=function(e,t,o,i,r,n){i?r.classList.contains("e-hidden")||(this.checkHiddenElements(t,o,e),r.classList.add("e-hidden"),"hideItem"===t&&this.checkHiddenItems(n,i,e),this.calculateHiddenElementsWidth(e)):r.classList.contains("e-hidden")&&(this.checkHiddenElements(t,o,e),r.classList.remove("e-hidden"),this.calculateHiddenElementsWidth(e),"showItem"===t&&this.checkHiddenItems(n,i,e))},s.prototype.checkHiddenElements=function(e,t,o){if("Simplified"===this.activeLayout){var i=this.hiddenElements[parseInt(o.toString(),10)];if(i||(this.hiddenElements[parseInt(o.toString(),10)]={},i=this.hiddenElements[parseInt(o.toString(),10)]),i)if(i[e]||(i[e]=[]),i[e].length){-1===i[e].indexOf(t)&&i[e].push(t)}else i[e].push(t)}},s.prototype.updateItemsSimplifiedWidth=function(e,t){var o=this.hiddenElements[parseInt(e.toString(),10)];if(o&&o[t]&&o[t].length)for(var i,r=function(r){var s,a=n.tabObj.items[e].content,l=void 0,p=!1,c=0;if(s="hideGroup"===t||"showGroup"===t?a.querySelector("#"+o[t][r]):a.querySelector("#"+o[t][r]+$t)){if("hideGroup"===t||"hideItem"===t){var u=!1;s.classList.contains("e-hidden")&&(u=!0,s.classList.remove("e-hidden")),"hideItem"===t&&(l=s.closest(".e-ribbon-group")).classList.contains("e-hide-group")&&(p=!0,c=n.checkWidthDifference(s,l)),n.calculateOverflowItemsWidth(s.offsetWidth+c,!0,e),n.calculateMediumDataWidth(s.offsetWidth+c,e,!0),u&&s.classList.add("e-hidden")}else{if("showItem"===t)if((l=s.closest(".e-ribbon-group")).classList.contains("e-hide-group"))p=!0,l.classList.remove("e-hide-group"),l.classList.remove("e-ribbon-emptyCollection"),c=Math.abs(s.offsetWidth-l.offsetWidth),-1!==n.hiddenGroups.indexOf(l.id)&&n.hiddenGroups.splice(n.hiddenGroups.indexOf(l.id),1);else if(-1!==n.hiddenGroups.indexOf(l.id)){var d=l.querySelectorAll(".e-ribbon-item:not(.e-hidden)");d.forEach(function(e){e.id!==s.id&&e.classList.add("e-hidden")}),c=Math.abs(s.offsetWidth-l.offsetWidth),d.forEach(function(e){e.id!==s.id&&e.classList.remove("e-hidden")}),n.hiddenGroups.splice(n.hiddenGroups.indexOf(l.id),1)}n.calculateOverflowItemsWidth(s.offsetWidth+c,!1,e),n.calculateMediumDataWidth(s.offsetWidth+c,e,!1)}p&&(l.classList.add("e-hide-group"),l.classList.add("e-ribbon-emptyCollection"))}var h=o[t].indexOf(o[t][r]);-1!==h&&(o[t].splice(h,1),r--),i=r},n=this,s=0;s<o[t].length;s++)r(s),s=i},s.prototype.checkWidthDifference=function(e,t){var o=0;return t.classList.remove("e-hide-group"),t.classList.remove("e-ribbon-emptyCollection"),this.hiddenGroups.length?-1===this.hiddenGroups.indexOf(t.id)&&(this.hiddenGroups.push(t.id),o=Math.abs(e.offsetWidth-t.offsetWidth)):(this.hiddenGroups.push(t.id),o=Math.abs(e.offsetWidth-t.offsetWidth)),o},s.prototype.calculateHiddenElementsWidth=function(e){if(e===this.selectedTab&&"Simplified"===this.activeLayout){var t=this.hiddenElements[parseInt(e.toString(),10)];if(t)for(var o=0;o<Object.keys(t).length;o++)this.updateItemsSimplifiedWidth(e,Object.keys(t)[parseInt(o.toString(),10)])}},s.prototype.calculateMediumDataWidth=function(e,o,i){if(this.selectedTab===o&&"Simplified"===this.activeLayout){var n=this.tabObj.element.querySelector("#"+this.tabs[parseInt(o.toString(),10)].id+Qt),s=Array.prototype.slice.call(n.querySelectorAll(".e-ribbon-item"));if(this.overflowDDB)for(var a=this.overflowDDB.target.querySelectorAll(".e-ribbon-item"),l=document.querySelector("#"+this.tabs[parseInt(o.toString(),10)].id+eo),p=0;p<a.length;p++){var c=a[parseInt(p.toString(),10)].closest("#"+this.tabs[parseInt(o.toString(),10)].id+eo);l&&c&&l.id===c.id&&a[parseInt(p.toString(),10)].hasAttribute("data-medium-width")&&s.push(a[parseInt(p.toString(),10)])}var u=n.querySelectorAll(".e-ribbon-group-of-btn");for(p=0;p<u.length;p++){a=t.getInstance(u[parseInt(p.toString(),10)],r.DropDownButton).target.querySelectorAll(".e-ribbon-item");for(var d=0;d<a.length;d++)a[parseInt(d.toString(),10)].hasAttribute("data-medium-width")&&s.push(a[parseInt(d.toString(),10)])}for(p=0;p<s.length;p++)if(s[parseInt(p.toString(),10)].hasAttribute("data-medium-width")){var h=parseInt(s[parseInt(p.toString(),10)].getAttribute("data-medium-width"),10);s[parseInt(p.toString(),10)].setAttribute("data-medium-width",i?(h-e).toString():(h+e).toString())}}},s.prototype.calculateOverflowItemsWidth=function(e,o,i){if(this.selectedTab===i&&"Simplified"===this.activeLayout)for(var n=this.tabs[parseInt(i.toString(),10)].groups,s=0;s<n.length;s++){var a=n[parseInt(s.toString(),10)];if(a.enableGroupOverflow){var l=void 0,p=document.querySelector("#"+a.id).querySelector("#"+a.id+Yt);if(p&&(l=t.getInstance(p,r.DropDownButton)),l)for(var c=l.target.querySelectorAll(".e-ribbon-item"),u=0;u<c.length;u++){(b=parseInt(c[parseInt(u.toString(),10)].getAttribute("data-simplified-width"),10))&&c[parseInt(u.toString(),10)].setAttribute("data-simplified-width",o?(b-e).toString():(b+e).toString())}}}if(this.overflowDDB){var d=document.querySelector("#"+this.tabs[parseInt(i.toString(),10)].id+eo);for(c=this.overflowDDB.target.querySelectorAll(".e-ribbon-item"),s=0;s<c.length;s++){var h=c[parseInt(s.toString(),10)].closest("#"+this.tabs[parseInt(i.toString(),10)].id+eo);if(d&&h&&d.id===h.id){var b;(b=parseInt(c[parseInt(s.toString(),10)].getAttribute("data-simplified-width"),10))&&c[parseInt(s.toString(),10)].setAttribute("data-simplified-width",o?(b-e).toString():(b+e).toString())}}}},s.prototype.disableGroup=function(e){this.enableDisableGroup(e,!0)},s.prototype.enableGroup=function(e){this.enableDisableGroup(e,!1)},s.prototype.enableDisableGroup=function(e,o){var i,n=d(this.tabs,e);if(n){var s=this.tabObj.items[n.tabIndex].content,a=s.querySelector("#"+e);if(a?o?a.classList.add("e-disabled"):a.classList.remove("e-disabled"):this.updateInitialProps(n.tabIndex,e,"disabledGroups",o),this.overflowDDB){var l=this.overflowDDB.target.querySelector("#"+this.tabs[parseInt(n.tabIndex.toString(),10)].id+eo);if(n.group.enableGroupOverflow){var p=s.querySelector("#"+e+Yt);p&&(i=t.getInstance(p,r.DropDownButton).target),i&&(o?i.classList.add("e-disabled"):i.classList.remove("e-disabled"))}else if(l){var c=l.querySelector("#"+e+$t);c&&(o?c.classList.add("e-disabled"):c.classList.remove("e-disabled"))}}}},s.prototype.addCollection=function(e,t,o,i){var r=d(this.tabs,e);if(r&&("Row"!==r.group.orientation||3!==r.group.collections.length)){this.selectedTab===r.tabIndex&&this.clearOverflowResize();var n=r.group.collections.slice(),s=o?l(n,function(e){return e.id===o}):-1;s=-1===s?n.length:s+(i?1:0),n.splice(s,0,t),r.group.setProperties({collections:n},!0),this.checkID([r.group.collections[parseInt(s.toString(),10)]],"collection",e),this.validateItemSize();var a=this.tabObj.items[r.tabIndex].content;if(""!==a.innerHTML){var p=r.group.collections[parseInt(s.toString(),10)],c=this.createCollection([p],r.group.orientation,r.group.id,r.group.header,r.group.enableGroupOverflow,r.tabIndex)[0];r.group.isCollapsed&&(a=this.ribbonDropDownModule.getOverflowDropDownPopup(r,a));var u=o?a.querySelector("#"+o):null;u?u.insertAdjacentElement(i?"afterend":"beforebegin",c):a.querySelector("#"+e+Qt).append(c)}this.selectedTab===r.tabIndex&&this.refreshLayout()}},s.prototype.removeCollection=function(o){var i=u(this.tabs,o);if(i){this.selectedTab===i.tabIndex&&this.clearOverflowResize();var n=this.tabObj.items[i.tabIndex].content;if(""!==n.innerHTML){var s=void 0,a=void 0;this.activeLayout===e.RibbonLayout.Simplified&&(a=(s=i.group.enableGroupOverflow?n.querySelector("#"+i.group.id+Yt):null)?t.getComponent(s,r.DropDownButton):this.overflowDDB);for(var l=0,p=i.collection.items;l<p.length;l++){var c=p[l];this.removeItemElement(n,c,a)}var d=n.querySelector("#"+o);d&&d.remove()}var h=i.group,b=h.collections.slice();b.splice(i.collectionIndex,1),h.setProperties({collections:b},!0),this.selectedTab===i.tabIndex&&this.refreshLayout()}},s.prototype.addItem=function(e,t,o,i){var r=u(this.tabs,e);if(r&&("Column"!==r.group.orientation||3!==r.collection.items.length)){this.selectedTab===r.tabIndex&&this.clearOverflowResize();var n=r.collection.items.slice(),s=o?l(n,function(e){return e.id===o}):-1;s=-1===s?n.length:s+(i?1:0),n.splice(s,0,t),r.collection.setProperties({items:n},!0),this.checkID([r.collection.items[parseInt(s.toString(),10)]],"item",e),this.validateItemSize();var a=this.tabObj.items[r.tabIndex].content,p=a.querySelector("#"+r.group.id+$t);if(""!==a.innerHTML){var c=r.collection.items[parseInt(s.toString(),10)],d=this.createItems([c],r.group.orientation,r.group.id,r.group.header,r.group.enableGroupOverflow,r.tabIndex,p)[0];r.group.isCollapsed&&(a=this.ribbonDropDownModule.getOverflowDropDownPopup(r,a));var h=o?a.querySelector("#"+o):null;h?h.closest("."+Ct).insertAdjacentElement(i?"afterend":"beforebegin",d):d&&a.querySelector("#"+e).append(d)}this.selectedTab===r.tabIndex&&this.refreshLayout()}},s.prototype.removeItem=function(o){var i=c(this.tabs,o);if(i){this.selectedTab===i.tabIndex&&this.clearOverflowResize();var n=this.tabObj.items[i.tabIndex].content;if(""!==n.innerHTML){var s=void 0,a=void 0;this.activeLayout===e.RibbonLayout.Simplified&&(a=(s=i.group.enableGroupOverflow?n.querySelector("#"+i.group.id+Yt):null)?t.getComponent(s,r.DropDownButton):this.overflowDDB);var l=i.item;this.removeItemElement(n,l,a)}var p=i.collection,u=p.items;u.splice(i.itemIndex,1),p.setProperties({items:u},!0),this.selectedTab===i.tabIndex&&this.refreshLayout()}},s.prototype.hideItem=function(e){this.showHideItem(e,!0)},s.prototype.showItem=function(e){this.showHideItem(e,!1)},s.prototype.showHideItem=function(e,o){var i=c(this.tabs,e);if(i){var r;if(r="GroupButton"===i.item.type?f(this,e+ao,i):f(this,e,i)){var n=t.closest(r,".e-ribbon-item");this.updateHiddenElements(i.tabIndex,o?"hideItem":"showItem",e,o,n,i.group),this.selectedTab===i.tabIndex&&this.refreshLayout()}else this.updateInitialProps(i.tabIndex,e,"hiddenItems",o)}},s.prototype.updateInitialProps=function(e,t,o,i){var r=this.initialPropsData[parseInt(e.toString(),10)];if(r||(this.initialPropsData[parseInt(e.toString(),10)]={},r=this.initialPropsData[parseInt(e.toString(),10)]),r){r[o]||(r[o]=[]);var n=r[o].indexOf(t);i?-1===n&&r[o].push(t):(-1!==n&&r[o].splice(n,1),0===r[o].length&&delete r[o],0===Object.keys(r).length&&delete this.initialPropsData[parseInt(e.toString(),10)])}},s.prototype.checkHiddenItems=function(e,t,o){var i,r=!0,n=this.tabObj.items[parseInt(o.toString(),10)].content,s=n.querySelector("#"+e.id);if(t){for(var a=0;a<e.collections.length;a++)if(r)for(var l=e.collections[parseInt(a.toString(),10)],p=0;p<l.items.length;p++){var u=l.items[parseInt(p.toString(),10)],d=void 0;if("GroupButton"===u.type){var h=c(this.tabs,u.id);d=f(this,u.id+ao,h)}else d=f(this,u.id);if(!(d?d.closest(".e-ribbon-item"):null).classList.contains("e-hidden")){r=!1;break}}r&&(s.classList.add("e-hide-group"),this.checkOverflowItems(t,n,e.enableGroupOverflow,o,e.id))}else s.classList.remove("e-hide-group"),this.checkOverflowItems(t,n,e.enableGroupOverflow,o,e.id);if("Simplified"===this.activeLayout&&!e.enableGroupOverflow){var b=s.querySelectorAll("."+Ct);b&&(i=this.checkEmptyCollection(b),s.classList[i?"add":"remove"]("e-ribbon-emptyCollection"))}},s.prototype.checkOverflowItems=function(e,o,i,n,s){var a;if(i){var l=o.querySelector("#"+s+Yt);l&&(a=t.getInstance(l,r.DropDownButton).target),a&&(e?a.classList.add("e-hide-group"):a.classList.remove("e-hide-group"))}else if(this.overflowDDB){var p=this.overflowDDB.target.querySelector("#"+this.tabs[parseInt(n.toString(),10)].id+eo);if(p){var c=p.querySelector("#"+s+$t);c&&(e?c.classList.add("e-hide-group"):c.classList.remove("e-hide-group"))}}},s.prototype.updateTab=function(o){var i=o.id,r=l(this.tabs,function(e){return e.id===i});if(-1!==r){var n=this.tabObj.items[parseInt(r.toString(),10)].content,s=this.tabs[parseInt(r.toString(),10)].groups,a=this.tabObj.element;if(s&&""!==n.innerHTML&&(o.cssClass&&this.tabs[parseInt(r.toString(),10)].cssClass&&(n.classList.remove(this.tabs[parseInt(r.toString(),10)].cssClass),a.querySelector(".e-active").classList.remove(this.tabs[parseInt(r.toString(),10)].cssClass)),o.groups)){for(var p=0,c=s;p<c.length;p++){for(var u=c[p],d=u.isCollapsed?n.querySelector("#"+u.id+eo+to):null,h=0,b=u.collections;h<b.length;h++)for(var m=0,f=b[h].items;m<f.length;m++){var y=f[m],g=d?this.ribbonDropDownModule.getDDBItemElement(d,y.id):n.querySelector("#"+y.id);y.type===e.RibbonItemType.GroupButton&&"Classic"===this.activeLayout&&(g=d?this.ribbonDropDownModule.getDDBItemElement(d,y.id+ao):n.querySelector("#"+y.id+ao)),g&&this.destroyFunction(y,g)}d&&this.ribbonDropDownModule.removeOverFlowDropDown(d)}n.querySelectorAll(".e-ribbon-group").forEach(function(e){e.remove()})}r===this.selectedTab&&(this.isAddRemove=!0);var v=this.tabs[parseInt(r.toString(),10)];if(v.setProperties(o,!0),this.setProperties({groups:this.checkID(v.groups,"group",v.id)},!0),this.validateItemSize(),""===n.innerHTML){if(o.groups){var S=this.createGroups(v.groups,r);t.append(S,n)}this.selectedTab===r&&this.refreshLayout(),o.cssClass&&(n.classList.add(v.cssClass),a.querySelector(".e-active").classList.add(v.cssClass)),o.header&&(a.querySelector("#"+i+Zt).innerText=v.header)}}},s.prototype.updateGroup=function(o){var i=o.id,n=d(this.tabs,i);if(n){this.selectedTab===n.tabIndex&&this.clearOverflowResize();var s,a,l=this.tabObj.items[n.tabIndex].content,p=l.querySelector("#"+i),c=p.querySelector("#"+o.id+$t);if(""!==l.innerHTML){if(n.group.showLauncherIcon&&this.removeLauncherIcon(n.group.id,null,l),this.activeLayout===e.RibbonLayout.Simplified&&(a=(s=n.group.enableGroupOverflow?l.querySelector("#"+n.group.id+Yt):null)?t.getComponent(s,r.DropDownButton):this.overflowDDB),o.cssClass&&n.group.cssClass&&(p.classList.remove(n.group.cssClass),c&&c.classList.remove(n.group.cssClass)),(o.collections||o.orientation)&&(n.group.collections||n.group.orientation)){for(var u=0,h=n.group.collections;u<h.length;u++)for(var b=0,m=h[u].items;b<m.length;b++){var f=m[b];this.removeItemElement(l,f,a)}if(p.querySelectorAll(".e-ribbon-collection").forEach(function(e){e.remove()}),o.orientation){var y=(I=c.querySelector(".e-ribbon-group-content")).classList.value.match(/(e-ribbon-[column|row]+)/g);y&&t.removeClass([I],y)}}if(this.activeLayout===e.RibbonLayout.Simplified)if(n.group.enableGroupOverflow)(0===a.target.childElementCount||1===a.target.childElementCount&&this.isHeaderVisible(a.target,n.group.id))&&this.removeOverflowButton(a);else{var g=a.target.querySelector("#"+n.group.id+$t);g&&1===g.childElementCount&&g.remove();var v=a.target.querySelector("#"+this.tabs[parseInt(n.tabIndex.toString(),10)].id+eo);v&&0===v.childElementCount&&v.remove()}}var S=n.group;if(S.setProperties(o,!0),S.setProperties({collections:this.checkID(S.collections,"collection",S.id)},!0),this.validateItemSize(),""!==l.innerHTML){if(o.showLauncherIcon&&this.createLauncherIcon(S.id,c,n.tabIndex),o.collections||o.orientation){var I;(I=c.querySelector(".e-ribbon-group-content")).classList.add("Column"===S.orientation||"Simplified"===this.activeLayout?wt:Tt);var C=this.createCollection(S.collections,S.orientation,S.id,S.header,S.enableGroupOverflow,n.tabIndex,c);t.append(C,I)}if(this.selectedTab===n.tabIndex&&this.refreshLayout(),o.cssClass&&(p.classList.add(S.cssClass),c&&c.classList.add(S.cssClass)),o.header)if(this.activeLayout!==e.RibbonLayout.Simplified||o.enableGroupOverflow)if(this.activeLayout!==e.RibbonLayout.Classic||S.isCollapsed){if(this.activeLayout===e.RibbonLayout.Classic&&S.isCollapsed){var T=p.querySelector("#"+S.id+eo+to);(w=t.getInstance(T,r.DropDownButton).target.querySelector("#"+o.id+Zt))&&(w.innerText=S.header)}}else p.querySelector(".e-ribbon-group-header").innerText=S.header;else{var w;(w=a.target.querySelector("#"+o.id+Zt))&&(w.innerText=S.header)}}}},s.prototype.updateCollection=function(o){var i=o.id,n=u(this.tabs,i);if(n){this.selectedTab===n.tabIndex&&this.clearOverflowResize();var s=this.tabObj.items[n.tabIndex].content,a=s.querySelector("#"+i);if(""!==s.innerHTML){var l=void 0,p=void 0;if(this.activeLayout===e.RibbonLayout.Simplified&&(p=(l=n.group.enableGroupOverflow?s.querySelector("#"+n.group.id+Yt):null)?t.getComponent(l,r.DropDownButton):this.overflowDDB),o.cssClass&&n.collection.cssClass&&a.classList.remove(n.collection.cssClass),o.items&&n.collection.items)for(var c=0,d=n.collection.items;c<d.length;c++){var h=d[c];this.removeItemElement(s,h,p)}}var b=n.collection;if(b.setProperties(o,!0),b.setProperties({items:this.checkID(b.items,"item",b.id)},!0),this.validateItemSize(),""!==s.innerHTML&&o.items){var m=s.querySelector("#"+n.group.id+$t),f=this.createItems(b.items,n.group.orientation,n.group.id,n.group.header,n.group.enableGroupOverflow,n.tabIndex,m);t.append(f,a)}this.selectedTab===n.tabIndex&&this.refreshLayout(),o.cssClass&&a.classList.add(b.cssClass)}},s.prototype.updateItem=function(o){var i=o.id,n=c(this.tabs,i);if(n){this.selectedTab===n.tabIndex&&this.clearOverflowResize();var s=this.tabObj.items[n.tabIndex].content,a=s.querySelector("#"+n.group.id);if(a){var l=a.querySelector("#"+n.group.id+$t),p=null,u=null,d=void 0,h=void 0;if(""!==s.innerHTML){if(this.activeLayout===e.RibbonLayout.Simplified&&(h=(d=n.group.enableGroupOverflow?s.querySelector("#"+n.group.id+Yt):null)?t.getComponent(d,r.DropDownButton):this.overflowDDB),this.activeLayout===e.RibbonLayout.Simplified&&n.item.displayOptions===e.DisplayMode.Overflow){if(p=h.target.querySelector("#"+i+$t),u=h.target.querySelector("#"+i),o.displayOptions&&o.displayOptions!==e.DisplayMode.Overflow){var b=l.querySelector("#"+n.collection.id);b&&b.appendChild(p)}}else p=l.querySelector("#"+i+$t),u=s.querySelector("#"+i),"GroupButton"===n.item.type&&this.activeLayout===e.RibbonLayout.Classic&&(u=s.querySelector("#"+i+ao)),this.activeLayout===e.RibbonLayout.Simplified&&o.displayOptions===e.DisplayMode.Overflow&&(this.createOverflowPopup(n.item,n.tabIndex,n.group.enableGroupOverflow,n.group.id,n.group.header,p,l),n.item.type!==e.RibbonItemType.DropDown&&n.item.type!==e.RibbonItemType.SplitButton&&o.type!==e.RibbonItemType.GroupButton&&o.type!==e.RibbonItemType.Gallery||this.updatePopupItems(n.item,p,n.group.enableGroupOverflow,!0));o.cssClass&&n.item.cssClass&&p.classList.remove(n.item.cssClass),this.destroyFunction(n.item,u),u.remove();var m=p.classList.value.match(/(e-ribbon-[large|medium|small]+-item)/g);m&&t.removeClass([p],m)}var f=n.item;if(f.setProperties(o,!0),this.validateItemSize(),""!==s.innerHTML){p=this.activeLayout!==e.RibbonLayout.Simplified||f.displayOptions!==e.DisplayMode.Overflow?l.querySelector("#"+i+$t):h.target.querySelector("#"+i+$t),f.ribbonTooltipSettings&&y(f.ribbonTooltipSettings)&&(p.classList.add(Rt),this.tooltipData.push({id:p.id,data:f.ribbonTooltipSettings}));var g=f.activeSize;"Simplified"===this.activeLayout&&(g=f.allowedSizes===e.RibbonItemSize.Large||f.allowedSizes&e.RibbonItemSize.Medium||f.displayOptions===e.DisplayMode.Overflow?e.RibbonItemSize.Medium:e.RibbonItemSize.Small,f.setProperties({activeSize:g},!0)),g&e.RibbonItemSize.Large?p.classList.add(kt,Pt):g&e.RibbonItemSize.Medium?p.classList.add(Ot):p.classList.add(Bt),this.createRibbonItem(f,p),"Simplified"===this.activeLayout&&n.group.enableGroupOverflow&&(0===h.target.childElementCount||1===h.target.childElementCount&&this.isHeaderVisible(h.target,n.group.id))&&this.removeOverflowButton(h),this.selectedTab===n.tabIndex&&this.refreshLayout(),o.cssClass&&p.classList.add(f.cssClass),!f.disabled&&p.classList.contains(Ae)&&p.classList.remove(Ae),this.enableDisableItem(f.id,f.disabled)}}else this.isUpdateItems=!0,this.itemsModel.push(o),this.targetTabs[o.id]=n.tabIndex}},s.prototype.removeItemElement=function(t,o,i){var r=null;this.activeLayout===e.RibbonLayout.Classic?(r=o.displayOptions&e.DisplayMode.Classic?t.querySelector("#"+o.id):null,"GroupButton"===o.type&&(r=o.displayOptions&e.DisplayMode.Classic?t.querySelector("#"+o.id+ao):null)):(r=o.displayOptions&e.DisplayMode.Simplified?t.querySelector("#"+o.id):null)||(r=i.target.querySelector("#"+o.id)),r&&(this.destroyFunction(o,r),"GroupButton"===o.type&&this.activeLayout===e.RibbonLayout.Simplified?document.getElementById(o.id+$t).remove():r.closest("#"+o.id+$t).remove())},s.prototype.enableItem=function(e){this.enableDisableItem(e,!1)},s.prototype.disableItem=function(e){this.enableDisableItem(e,!0)},s.prototype.getItem=function(e){return c(this.tabs,e).item},s.prototype.enableDisableItem=function(e,o){var i=!1,r=c(this.tabs,e);if(r){r.item.setProperties({disabled:o},!0);var n;if(n="GroupButton"===r.item.type?f(this,e+ao,r):f(this,e,r)){var s=t.closest(n,".e-ribbon-item"),a=this.getItemModuleName(r.item);if(i=o?!s.classList.contains(Ae):s.classList.contains(Ae),"template"!==a){if(i)if("group-btn"===a&&"Simplified"===this.activeLayout){m(n,"dropdown-btn",o);for(var l=0;l<r.item.groupButtonSettings.items.length;l++){m(document.querySelector("#"+e+ao+l),"btn",o)}}else if("group-btn"===a&&"Classic"===this.activeLayout)for(l=0;l<r.item.groupButtonSettings.items.length;l++){m(n.querySelector("#"+e+ao+l),"btn",o)}else m(n,a,o)}else n.classList.toggle(Ae,o),n.toggleAttribute("disabled",o);s.classList.toggle(Ae,r.item.disabled)}}},s.prototype.unwireEvents=function(){t.EventHandler.remove(window,"resize",this.resizeHandler),t.EventHandler.remove(document.body,"keydown",this.keytipActionHandler),t.EventHandler.remove(document,"mousedown",this.mouseEventHandler),t.EventHandler.remove(document,"scroll",this.mouseEventHandler)},s.prototype.destroy=function(){this.keyboardModuleRibbon.destroy(),this.keyboardModuleRibbon=null,S(this.element),this.refreshing&&this.clearOverflowDropDown(this.selectedTab),this.destroyTabItems(this.tabs),this.hideLayoutSwitcher||this.removeExpandCollapse(),this.collapseButton=void 0,this.scrollModule&&(this.scrollModule.destroy(),this.scrollModule=null),this.ribbonTempEle&&(t.remove(this.ribbonTempEle),this.ribbonTempEle=null),i.prototype.destroy.call(this),this.tabObj.destroy(),this.tabObj=void 0,this.initialPropsData={},this.hiddenGroups=[],this.hiddenElements={},this.keyTipElements={},this.itemsModel=[],this.targetTabs={},t.remove(this.element.querySelector("#"+this.element.id+"_tab")),this.element.style.removeProperty(po),this.element.style.removeProperty(co),this.element.style.removeProperty("width"),this.cssClass&&t.removeClass([this.element],this.cssClass.split(" ")),this.element.classList.remove(je,jt,tt,Je,it,"e-rbn"),this.unwireEvents()},s.prototype.onPropertyChanged=function(e,o){for(var i,n,s=0,a=Object.keys(e);s<a.length;s++){switch(a[s]){case"activeLayout":this.switchLayout();break;case"cssClass":o.cssClass&&(i=this.element.classList).remove.apply(i,o.cssClass.split(" ")),e.cssClass&&(n=this.element.classList).add.apply(n,e.cssClass.split(" "));break;case"isMinimized":this.element.classList.toggle(it,this.isMinimized),this.tabObj.element.querySelector(".e-content").style.display=this.isMinimized?"none":"block",this.isMinimized||this.refreshLayout();break;case"locale":this.updateCommonProperty({locale:this.locale});break;case"enablePersistence":this.updateCommonProperty({enablePersistence:this.enablePersistence});break;case"enableRtl":this.element.classList.toggle(je,this.enableRtl),this.updateCommonProperty({enableRtl:e.enableRtl}),this.scrollModule&&this.scrollModule.setProperties({enableRtl:e.enableRtl});break;case"launcherIconCss":for(var l=0;l<this.tabs.length;l++){var p=this.tabObj.items[parseInt(l.toString(),10)].content,c=this.tabs[parseInt(l.toString(),10)];if(p.querySelector("."+rt))for(var u=0,d=c.groups;u<d.length;u++){var h=d[u];if(h.showLauncherIcon){var b=vt+" "+(this.launcherIconCss||St);if(h.isCollapsed){var m=p.querySelector("#"+h.id+eo+to);t.getComponent(m,r.DropDownButton).target.querySelector("#"+h.id+Jt).className=b}else{(m=p.querySelector("#"+h.id+Jt)).className=b}}}}break;case"selectedTab":var f=this.tabObj.element.querySelectorAll(".e-toolbar-item")[parseInt(e.selectedTab.toString(),10)];f.classList.contains("e-hidden")||f.classList.contains("e-disable")||this.tabObj.setProperties({selectedItem:e.selectedTab});break;case"tabAnimation":this.tabObj.setProperties({animation:e.tabAnimation});break;case"tabs":this.reRenderTabs(e.tabs);break;case"contextualTabs":for(l=0;l<this.contextualTabs.length;l++)e.contextualTabs[parseInt(l.toString(),10)]&&this.ribbonContextualTabModule.updateContextualTabs(e.contextualTabs[parseInt(l.toString(),10)],this.contextualTabs[parseInt(l.toString(),10)]);break;case"width":this.element.style.width=t.formatUnit(e.width),this.refreshLayout();break;case"fileMenu":this.ribbonFileMenuModule&&this.ribbonFileMenuModule.updateFileMenu(this.fileMenu);this.tabObj.tbObj.refreshOverflow();break;case"backStageMenu":this.ribbonBackstageModule&&this.ribbonBackstageModule.updateBackStageMenu(this.backStageMenu);this.tabObj.tbObj.refreshOverflow();break;case"helpPaneTemplate":this.ribbonTempEle&&(t.remove(this.ribbonTempEle),this.ribbonTempEle=null,this.tabObj.element.style.setProperty(co,"0px")),this.helpPaneTemplate&&this.createHelpPaneTemplate();this.tabObj.tbObj.refreshOverflow();break;case"hideLayoutSwitcher":this.hideLayoutSwitcher?this.removeExpandCollapse():this.addExpandCollapse()}}};var g;return Io([t.Property("Classic")],s.prototype,"activeLayout",void 0),Io([t.Property("")],s.prototype,"cssClass",void 0),Io([t.Property(!1)],s.prototype,"enableKeyTips",void 0),Io([t.Property("")],s.prototype,"layoutSwitcherKeyTip",void 0),Io([t.Complex({},ve)],s.prototype,"fileMenu",void 0),Io([t.Complex({},Pe)],s.prototype,"backStageMenu",void 0),Io([t.Property("")],s.prototype,"launcherIconCss",void 0),Io([t.Property(!1)],s.prototype,"isMinimized",void 0),Io([t.Property("en-us")],s.prototype,"locale",void 0),Io([t.Property(0)],s.prototype,"selectedTab",void 0),Io([t.Complex({},o.TabAnimationSettings)],s.prototype,"tabAnimation",void 0),Io([t.Collection([],fe)],s.prototype,"tabs",void 0),Io([t.Collection([],De)],s.prototype,"contextualTabs",void 0),Io([t.Property("100%")],s.prototype,"width",void 0),Io([t.Property("")],s.prototype,"helpPaneTemplate",void 0),Io([t.Property(!1)],s.prototype,"hideLayoutSwitcher",void 0),Io([t.Event()],s.prototype,"tabSelecting",void 0),Io([t.Event()],s.prototype,"tabSelected",void 0),Io([t.Event()],s.prototype,"ribbonExpanding",void 0),Io([t.Event()],s.prototype,"ribbonCollapsing",void 0),Io([t.Event()],s.prototype,"launcherIconClick",void 0),Io([t.Event()],s.prototype,"created",void 0),Io([t.Event()],s.prototype,"overflowPopupOpen",void 0),Io([t.Event()],s.prototype,"overflowPopupClose",void 0),s=g=Io([t.NotifyPropertyChanges],s)}(t.Component),To=function(){function e(e){this.parent=e}return e.prototype.getModuleName=function(){return"ribbonFileMenu"},e.prototype.destroy=function(){this.fileMenuDDB&&this.destroyDDB(),this.parent=null},e.prototype.createFileMenu=function(e){var t=this;if(e.visible){this.ddbElement=this.parent.createElement("button",{id:this.parent.element.id+"_filemenu"});var o=this.parent.tabObj.element,i=o.querySelector(".e-toolbar");o.insertBefore(this.ddbElement,i),this.fileMenuDDB=new r.DropDownButton({content:e.text,enableRtl:this.parent.enableRtl,cssClass:"e-ribbon-file-menu e-caret-hide",created:function(){o.style.setProperty(po,t.ddbElement.offsetWidth+"px")},beforeClose:this.ddbBeforeEvent.bind(this,!1),beforeOpen:this.ddbBeforeEvent.bind(this,!0),close:this.ddbAfterEvent.bind(this,!1),open:this.ddbAfterEvent.bind(this,!0)},this.ddbElement),this.parent.fileMenu.popupTemplate?this.fileMenuDDB.setProperties({target:this.parent.fileMenu.popupTemplate}):this.createRibbonMenu(e),this.parent.tabObj.refreshActiveTabBorder(),this.addFileMenuTooltip(e),this.addFileMenuKeytip()}},e.prototype.addFileMenuTooltip=function(e){y(e.ribbonTooltipSettings)&&(this.ddbElement.classList.add(Rt),this.parent.tooltipData.push({id:this.ddbElement.id,data:e.ribbonTooltipSettings}))},e.prototype.addFileMenuKeytip=function(){this.parent.fileMenu.keyTip&&(this.parent.keyTipElements.filemenu=[],this.parent.keyTipElements.filemenu.push({id:this.ddbElement.id,type:"filemenu",keyTip:this.parent.fileMenu.keyTip}))},e.prototype.ddbBeforeEvent=function(e,t){!e&&t.event&&t.event.target.closest(".e-ribbon-menu")&&(t.cancel=!0);var o=e?this.parent.fileMenu.beforeOpen:this.parent.fileMenu.beforeClose;if(o){var i={cancel:t.cancel,element:t.element,event:t.event};o.call(this,i),t.cancel=i.cancel}},e.prototype.ddbAfterEvent=function(e,t){(e?this.fileMenuDDB.target:this.fileMenuDDB.element).focus();var o=e?this.parent.fileMenu.open:this.parent.fileMenu.close;if(o){var i={element:t.element};o.call(this,i)}},e.prototype.cloneMenuItem=function(e){for(var t=[],o=0;o<e.length;o++){var i=e[parseInt(o.toString(),10)];t.push({iconCss:i.iconCss,id:i.id,separator:i.separator,text:i.text,url:i.url,items:this.cloneMenuItem(i.items)})}return t},e.prototype.createRibbonMenu=function(e){var i=this,r=this.parent.createElement("ul",{id:this.parent.element.id+ro});this.fileMenuDDB.setProperties({target:r}),this.menuctrl=new o.Menu({orientation:"Vertical",enableRtl:this.parent.enableRtl,cssClass:"e-ribbon-menu",animationSettings:e.animationSettings,items:this.cloneMenuItem(e.menuItems),showItemOnClick:e.showItemOnClick,template:e.itemTemplate,beforeClose:this.menuBeforeEvent.bind(this,!1),beforeOpen:this.menuBeforeEvent.bind(this,!0),beforeItemRender:this.beforeItemRender.bind(this),onClose:this.menuAfterEvent.bind(this,!1),onOpen:this.menuAfterEvent.bind(this,!0),select:this.menuSelect.bind(this)},r),t.EventHandler.add(r,"keydown",function(e){"Tab"===e.key&&i.fileMenuDDB.toggle()},this)},e.prototype.menuBeforeEvent=function(e,t){var o=e?this.parent.fileMenu.beforeOpen:this.parent.fileMenu.beforeClose;if(o){var i={cancel:t.cancel,element:t.element,event:t.event,items:t.items,parentItem:t.parentItem};o.call(this,i),t.cancel=i.cancel}},e.prototype.menuAfterEvent=function(e,t){var o=e?this.parent.fileMenu.open:this.parent.fileMenu.close;if(o){var i={element:t.element,items:t.items,parentItem:t.parentItem};o.call(this,i)}},e.prototype.beforeItemRender=function(e){var t=this.parent.fileMenu.beforeItemRender;if(t){var o={element:e.element,item:e.item};t.call(this,o)}},e.prototype.menuSelect=function(e){var t=this.parent.fileMenu.select;if(t){var o={element:e.element,item:e.item,event:e.event};t.call(this,o),e.element.classList.contains("e-menu-caret-icon")||this.fileMenuDDB.toggle()}},e.prototype.setCommonProperties=function(e){this.fileMenuDDB&&(this.fileMenuDDB.setProperties(e),this.menuctrl&&this.menuctrl.setProperties(e))},e.prototype.updateFileMenu=function(e){e.visible?this.fileMenuDDB?(e.text&&(this.fileMenuDDB.setProperties({content:e.text}),this.parent.tabObj.element.style.setProperty(po,this.ddbElement.offsetWidth+"px")),e.popupTemplate?(this.menuctrl&&this.destroyMenu(),this.fileMenuDDB.setProperties({target:e.popupTemplate})):this.menuctrl?this.menuctrl.setProperties({animationSettings:e.animationSettings,items:this.cloneMenuItem(e.menuItems),showItemOnClick:e.showItemOnClick,template:e.itemTemplate}):this.createRibbonMenu(e),this.removeFileMenuTooltip(),this.removeFileMenuKeytip(),this.addFileMenuTooltip(e),this.addFileMenuKeytip()):this.createFileMenu(e):this.fileMenuDDB&&this.destroyDDB(),this.parent.tabObj.refreshActiveTabBorder()},e.prototype.destroyMenu=function(){this.menuctrl&&(this.menuctrl.destroy(),this.menuctrl=null)},e.prototype.destroyDDB=function(){this.removeFileMenuTooltip(),this.removeFileMenuKeytip();this.parent.tabObj.element.style.removeProperty(po),this.destroyMenu(),this.fileMenuDDB.destroy(),this.fileMenuDDB=null,t.remove(this.ddbElement),this.ddbElement=null},e.prototype.removeFileMenuTooltip=function(){var e=this,t=l(this.parent.tooltipData,function(t){return t.id===e.ddbElement.id});-1!==t&&(this.ddbElement.classList.remove(Rt),this.parent.tooltipData.splice(t,1))},e.prototype.removeFileMenuKeytip=function(){var e=this;if(this.parent.keyTipElements.filemenu){var t=l(this.parent.keyTipElements.filemenu,function(t){return t.id===e.ddbElement.id});-1!==t&&this.parent.keyTipElements.filemenu.splice(t,1)}},e.prototype.addItems=function(e,t,o,i){o?this.menuctrl.insertAfter(e,t,i):this.menuctrl.insertBefore(e,t,i),this.parent.fileMenu.setProperties({menuItems:this.menuctrl.items},!0)},e.prototype.removeItems=function(e,t){this.menuctrl.removeItems(e,t),this.parent.fileMenu.setProperties({menuItems:this.menuctrl.items},!0)},e.prototype.enableItems=function(e,t){this.menuctrl.enableItems(e,!0,t),this.parent.fileMenu.setProperties({menuItems:this.menuctrl.items},!0)},e.prototype.disableItems=function(e,t){this.menuctrl.enableItems(e,!1,t),this.parent.fileMenu.setProperties({menuItems:this.menuctrl.items},!0)},e.prototype.setItem=function(e,t,o){this.menuctrl.setItem(e,t,o),this.menuctrl.refresh(),this.parent.fileMenu.setProperties({menuItems:this.menuctrl.items},!0)},e}(),wo=function(){var e=function(t,o){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(t,o)};return function(t,o){function i(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(i.prototype=o.prototype,new i)}}(),ko=function(e){function i(t){var o=e.call(this)||this;return o.parent=t,o}return wo(i,e),i.prototype.render=function(){},i.prototype.preRender=function(){},i.prototype.getPersistData=function(){return""},i.prototype.onPropertyChanged=function(){},i.prototype.getModuleName=function(){return"ribbonBackstage"},i.prototype.destroy=function(){this.backstageButton&&this.destroyDDB(),this.parent=null},i.prototype.createBackStage=function(e){var o=this;if(e.visible){this.backstageButtonEle=this.parent.createElement("button",{id:this.parent.element.id+oo});var i=this.parent.tabObj.element,r=i.querySelector(".e-toolbar");if(i.insertBefore(this.backstageButtonEle,r),this.backstageButton=new n.Button({content:e.text,enableRtl:this.parent.enableRtl,cssClass:Ht,created:function(){i.style.setProperty(po,o.backstageButtonEle.offsetWidth+"px")}},this.backstageButtonEle),this.createBackStagePopup(e),this.parent.backStageMenu.template)this.createBackStageTemplate(this.parent.backStageMenu.template);else{for(var s=0,a=0,l=0;l<e.items.length;l++){e.items[parseInt(l.toString(),10)].isFooter?s++:a++}a>0&&this.createBackstageMenu(e,!1),s>0&&this.createBackstageMenu(e,!0),this.menuCtrl&&this.checkMenuItems(this.menuCtrl.items),this.footerMenuCtrl&&this.checkMenuItems(this.footerMenuCtrl.items)}this.backstageButtonEle.onclick=function(t){t.stopPropagation(),o.showBackstage(),o.popupHTMLElement.classList.add(zt);var i=o.menuWrapper.querySelector(".e-menu-item.e-selected");i&&i.classList.remove("e-selected");for(var r=0;r<e.items.length;r++){var n=e.items[parseInt(r.toString(),10)];if(!n.isFooter&&o.menuCtrl.items[0].text===n.text){var s=o.popupHTMLElement.querySelector("#"+o.menuCtrl.items[0].id);s&&(s.classList.add("e-selected"),s.focus()),o.createBackStageContent(o.menuCtrl.items[0].id,n.content);break}}},this.parent.tabObj.refreshActiveTabBorder(),this.addBackStageMenuTooltip(e),this.addBackStageMenuKeyTip(e),t.EventHandler.add(document,"click",this.onClickEvent,this)}},i.prototype.onClickEvent=function(e){var t=e.target;this.popupHTMLElement.contains(t)||this.hideBackstage()},i.prototype.addBackStageMenuTooltip=function(e){y(e.ribbonTooltipSettings)&&(this.backstageButtonEle.classList.add(Rt),this.parent.tooltipData.push({id:this.backstageButtonEle.id,data:e.ribbonTooltipSettings}))},i.prototype.addBackStageMenuKeyTip=function(e){if(e.keyTip&&(this.parent.keyTipElements.backstage||(this.parent.keyTipElements.backstage=[]),this.parent.keyTipElements.backstage.push({id:this.backstageButtonEle.id,type:"backstage",keyTip:e.keyTip})),e.items&&e.items.length){this.parent.keyTipElements.backstageMenu||(this.parent.keyTipElements.backstageMenu=[]);for(var t=0;t<e.items.length;t++)e.items[parseInt(t.toString(),10)].keyTip&&this.parent.keyTipElements.backstageMenu.push({id:e.items[parseInt(t.toString(),10)].id,type:"backstageMenu",keyTip:e.items[parseInt(t.toString(),10)].keyTip})}},i.prototype.checkMenuItems=function(e){for(var t=0;t<e.length;t++){var o=e[parseInt(t.toString(),10)];if(!o.iconCss){this.popupHTMLElement.querySelector("#"+o.id).classList.add("e-blankicon")}}},i.prototype.createBackStagePopup=function(e){var t=this;this.popupHTMLElement=this.parent.createElement("div",{id:this.parent.element.id+io,className:Gt});e.target?(e.target instanceof HTMLElement?e.target:document.querySelector(e.target)).appendChild(this.popupHTMLElement):this.parent.element.appendChild(this.popupHTMLElement),this.popupEle=new a.Popup(this.popupHTMLElement,{height:e.height,width:e.width,relateTo:e.target||this.parent.element,enableRtl:this.parent.enableRtl}),this.parent.enableRtl&&this.updatePopupPositionOnRtl(this.parent.enableRtl),this.popupHTMLElement.onkeydown=function(e){"Escape"===e.code&&t.hideBackstage()},this.hideBackstage()},i.prototype.updatePopupPositionOnRtl=function(e){var t=this.popupHTMLElement.style;e?(t.right=t.left,t.left="unset"):(t.left=t.right,t.right="unset")},i.prototype.createBackstageMenu=function(e,t){var i=this;if(this.popupHTMLElement.querySelector("#"+this.parent.element.id+"_wrapper")||(this.menuWrapper=this.parent.createElement("div",{id:this.parent.element.id+"_wrapper",className:Ft}),this.popupHTMLElement.appendChild(this.menuWrapper)),e.backButton.visible&&!t){var r=this.parent.createElement("button",{id:this.parent.element.id+"_close",className:"e-ribbon-close-btn"});this.closeBtn=new n.Button({content:e.backButton.text,iconCss:e.backButton.iconCss?e.backButton.iconCss:Me,enableRtl:this.parent.enableRtl},r),this.menuWrapper.append(r),r.onclick=function(){i.popupHTMLElement.classList.remove(zt),i.hideBackstage(),i.isBackButtonClicked=!0}}this.popupHTMLElement.querySelector("#"+this.parent.element.id+"_itemswrapper")||(this.itemsWrapperEle=this.parent.createElement("div",{id:this.parent.element.id+"_itemswrapper",className:Ut}),this.menuWrapper.append(this.itemsWrapperEle));var s;t?(s=this.parent.createElement("ul",{id:this.parent.element.id+no}),this.itemsWrapperEle.appendChild(s)):(this.ulMenuElem=this.parent.createElement("ul",{id:this.parent.element.id+"_menulist"}),this.itemsWrapperEle.appendChild(this.ulMenuElem)),t?this.footerMenuCtrl=new o.Menu({orientation:"Vertical",enableRtl:this.parent.enableRtl,cssClass:Wt,items:this.cloneFooterMenuItem(e.items),select:this.menuSelect.bind(this,e)},s):this.menuCtrl=new o.Menu({orientation:"Vertical",enableRtl:this.parent.enableRtl,cssClass:Wt,items:this.cloneMenuItem(e.items),select:this.menuSelect.bind(this,e)},this.ulMenuElem)},i.prototype.cloneMenuItem=function(e){for(var t=[],o=0;o<e.length;o++){var i=e[parseInt(o.toString(),10)];i.isFooter||t.push({id:i.id,iconCss:i.iconCss,separator:i.separator,text:i.text})}return t},i.prototype.cloneFooterMenuItem=function(e){for(var t=[],o=0;o<e.length;o++){var i=e[parseInt(o.toString(),10)];i.isFooter&&t.push({id:i.id,iconCss:i.iconCss,separator:i.separator,text:i.text})}return t},i.prototype.createBackStageContent=function(e,o){var i="backstageContent";this.clearTemplate([i]),this.backstageContentEle?(this.backstageContentEle.innerHTML="",this.backstageContentEle.id=e+Qt):this.backstageContentEle=this.parent.createElement("div",{id:e+Qt,className:Nt});var r=p(o);return t.append(r({},this,i,"backstageContent",this.parent.isStringTemplate),this.backstageContentEle),o&&this.popupHTMLElement.append(this.backstageContentEle),this.renderReactTemplates(),r},i.prototype.createBackStageTemplate=function(e){var o="backstageTemplate";this.clearTemplate([o]),this.backstageTempEle=this.parent.createElement("div",{id:this.parent.element.id+oo+"_template",className:Kt});var i=p(e);return t.append(i({},this,o,"backstageTemplate",this.parent.isStringTemplate),this.backstageTempEle),this.popupHTMLElement.append(this.backstageTempEle),this.renderReactTemplates(),i},i.prototype.menuSelect=function(e,t){for(var o=0;o<e.items.length;o++){var i=e.items[parseInt(o.toString(),10)];if(i.text===t.item.text){this.contentItem=i;break}}this.createBackStageContent(t.item.id,this.contentItem.content);var r={cancel:!1,target:t.element,item:this.contentItem,isBackButton:this.isBackButtonClicked};this.contentItem.backStageItemClick&&this.contentItem.backStageItemClick.call(this,r)},i.prototype.setCommonProperties=function(e){this.backstageButton&&(this.backstageButton.setProperties(e),this.popupEle&&(this.popupEle.setProperties(e),this.popupHTMLElement&&this.updatePopupPositionOnRtl(e.enableRtl),this.menuCtrl&&(this.menuCtrl.setProperties(e),this.closeBtn&&this.closeBtn.setProperties(e)),this.footerMenuCtrl&&this.footerMenuCtrl.setProperties(e)))},i.prototype.updateBackStageMenu=function(e){if(e.visible)if(this.backstageButton){if(e.text&&(this.backstageButton.setProperties({content:e.text}),this.parent.tabObj.element.style.setProperty(po,this.backstageButtonEle.offsetWidth+"px")),this.popupEle&&this.popupEle.setProperties({height:e.height,width:e.width,target:e.target||this.parent.element}),e.template)this.backstageTempEle&&(t.remove(this.backstageTempEle),this.backstageTempEle=null),this.createBackStageTemplate(e.template);else if(this.menuCtrl&&this.menuCtrl.setProperties({items:this.cloneMenuItem(e.items)}),this.footerMenuCtrl)this.footerMenuCtrl.setProperties({items:this.cloneFooterMenuItem(e.items)});else{for(var o=0,i=0,r=0;r<e.items.length;r++){e.items[parseInt(r.toString(),10)].isFooter?o++:i++}i>0&&this.createBackstageMenu(e,!1),o>0&&this.createBackstageMenu(e,!0)}this.removeBackstageMenuTooltip(),this.removeBackstageMenuKeyTip(),this.addBackStageMenuTooltip(e),this.addBackStageMenuKeyTip(e)}else this.createBackStage(e);else this.backstageButton&&this.destroyDDB();this.parent.tabObj.refreshActiveTabBorder()},i.prototype.destroyMenu=function(){this.menuCtrl&&(this.menuCtrl.destroy(),this.menuCtrl=null)},i.prototype.destroyDDB=function(){this.removeBackstageMenuTooltip(),this.removeBackstageMenuKeyTip();this.parent.tabObj.element.style.removeProperty(po),this.destroyMenu(),this.backstageButton.destroy(),this.backstageButton=null,t.remove(this.backstageButtonEle),this.backstageButtonEle=null,t.EventHandler.remove(document,"click",this.onClickEvent)},i.prototype.removeBackstageMenuTooltip=function(){var e=this,t=l(this.parent.tooltipData,function(t){return t.id===e.backstageButtonEle.id});-1!==t&&(this.backstageButtonEle.classList.remove(Rt),this.parent.tooltipData.splice(t,1))},i.prototype.removeBackstageMenuKeyTip=function(){var e=this;if(this.parent.keyTipElements.backstage&&this.parent.keyTipElements.backstage.length){var t=l(this.parent.keyTipElements.backstage,function(t){return t.id===e.backstageButtonEle.id});-1!==t&&this.parent.keyTipElements.backstage.splice(t,1)}if(this.parent.keyTipElements.backstageMenu&&this.parent.keyTipElements.backstageMenu.length)for(var o=0;o<this.parent.keyTipElements.backstageMenu.length;o++)this.parent.keyTipElements.backstageMenu.splice(o,1),o--},i.prototype.addBackstageItems=function(e,t,o,i){for(var r=0;r<e.length;r++){(a=e[parseInt(r.toString(),10)]).isFooter?o?this.footerMenuCtrl.insertAfter(e,t,i):this.footerMenuCtrl.insertBefore(e,t,i):o?this.menuCtrl.insertAfter(e,t,i):this.menuCtrl.insertBefore(e,t,i)}var n=[].concat(this.menuCtrl.items,this.footerMenuCtrl.items),s=this.parent.backStageMenu;for(r=0;r<s.items.length;r++)for(var a=s.items[parseInt(r.toString(),10)],l=0;l<n.length;l++){var p=n[parseInt(l.toString(),10)];if(a.text===p.text){p.content=a.content;break}}this.parent.backStageMenu.setProperties({items:n},!0)},i.prototype.removeBackstageItems=function(e,t){this.menuCtrl.removeItems(e,t),this.footerMenuCtrl.removeItems(e,t);var o=[].concat(this.menuCtrl.items,this.footerMenuCtrl.items);this.parent.backStageMenu.setProperties({items:o},!0)},i.prototype.showBackstage=function(){this.popupEle.show()},i.prototype.hideBackstage=function(){this.popupEle.element.classList.contains(zt)&&this.popupEle.element.classList.remove(zt),this.popupEle.hide()},i}(t.Component),Oo=function(){function e(e){this.parent=e}return e.prototype.getModuleName=function(){return"ribbonContextualTab"},e.prototype.destroy=function(){this.parent=null},e.prototype.addContextualTabs=function(){for(var e=!1,t=0;t<this.parent.contextualTabs.length;t++)for(var o=0;o<this.parent.contextualTabs[parseInt(t.toString(),10)].tabs.length;o++){this.parent.addTab(this.parent.contextualTabs[parseInt(t.toString(),10)].tabs[parseInt(o.toString(),10)]);var i=this.parent.tabs.length-1,r=this.parent.tabObj.element.querySelectorAll(".e-toolbar-item")[parseInt(i.toString(),10)];r.classList.add(Ue),r.classList.add("e-hidden"),this.parent.contextualTabs[parseInt(t.toString(),10)].visible&&(this.parent.showTab(this.parent.contextualTabs[parseInt(t.toString(),10)].tabs[parseInt(o.toString(),10)].id,!0),this.parent.contextualTabs[parseInt(t.toString(),10)].isSelected&&!e&&(this.parent.selectTab(this.parent.contextualTabs[parseInt(t.toString(),10)].tabs[0].id),e=!0))}},e.prototype.updateContextualTabs=function(e,o){if(!t.isNullOrUndefined(e.visible))for(var i=0;i<o.tabs.length;i++)e.visible?this.parent.showTab(o.tabs[parseInt(i.toString(),10)].id,!0):this.parent.hideTab(o.tabs[parseInt(i.toString(),10)].id,!0);if(!t.isNullOrUndefined(e.isSelected))if(e.isSelected&&o.visible)this.parent.selectTab(o.tabs[0].id);else{var r=this.parent.tabObj.element;for(i=0;i<this.parent.tabs.length;i++){var n=r.querySelectorAll(".e-toolbar-item")[parseInt(i.toString(),10)];if(!n.classList.contains("e-hidden")&&!n.classList.contains("e-disable")){this.parent.selectTab(this.parent.tabs[parseInt(i.toString(),10)].id);break}}}if(e.tabs){var s=function(e){var t=parseInt(e,10),i=a.parent.tabs.filter(function(e){return e.id===o.tabs[parseInt(t.toString(),10)].id})[0];a.parent.updateTab(i)},a=this;for(var l in e.tabs)s(l)}},e}(),Bo=function(){function e(e){this.isKeytipPopupOpen=!1,this.parent=e}return e.prototype.getModuleName=function(){return"ribbonKeyTip"},e.prototype.destroy=function(){this.parent=null},e.prototype.createKeytip=function(e){if(this.parent.keyTipElements){var t=void 0;if("tab"===e){for(var o=0;o<this.parent.tabs.length;o++)this.parent.keyTipElements[parseInt(o.toString(),10)]&&(t=this.parent.keyTipElements[o][e],this.createKeyTipElement(t[0].id,t[0].keyTip,"tab","center","bottom",!0));this.parent.keyTipElements.filemenu&&(t=this.parent.keyTipElements.filemenu,this.createKeyTipElement(t[0].id,t[0].keyTip,"filemenu")),this.parent.keyTipElements.backstage&&(t=this.parent.keyTipElements.backstage,this.createKeyTipElement(t[0].id,t[0].keyTip,"backstage")),this.parent.keyTipElements.collapse&&(t=this.parent.keyTipElements.collapse,this.createKeyTipElement(t[0].id,t[0].keyTip,"collapse")),this.parent.keyTipElements.taboverflow&&(t=this.parent.keyTipElements.taboverflow,this.createKeyTipElement(t[0].id,t[0].keyTip,"taboverflow"))}else if("popupitem"===e){if(this.parent.keyTipElements[this.parent.selectedTab].popupitem){var i=this.parent.keyTipElements[this.parent.selectedTab].popupitem;for(o=0;o<Object.keys(this.parent.keyTipElements[this.parent.selectedTab].popupitem).length;o++)this.createKeyTipElement(i[parseInt(o.toString(),10)].id,i[parseInt(o.toString(),10)].keyTip,"popupitem","left","top",!1,!0)}}else if("backstageMenu"===e){if(this.parent.keyTipElements.backstageMenu){var r=this.parent.keyTipElements.backstageMenu;for(o=0;o<Object.keys(this.parent.keyTipElements.backstageMenu).length;o++)this.createKeyTipElement(r[parseInt(o.toString(),10)].id,r[parseInt(o.toString(),10)].keyTip,"backstageMenu","left","center")}}else if("grpoverflowpopup"===e&&"Classic"===this.parent.activeLayout){if(this.parent.keyTipElements[this.parent.selectedTab].grpoverflowpopup&&this.calculateItemPosition(e),this.parent.keyTipElements[this.parent.selectedTab].launcher)for(o=0;o<Object.keys(this.parent.keyTipElements[this.parent.selectedTab].launcher).length;o++)t=this.parent.keyTipElements[this.parent.selectedTab].launcher,this.createKeyTipElement(t[parseInt(o.toString(),10)].id,t[parseInt(o.toString(),10)].keyTip,"launcher","center","bottom",!1,!0)}else{if(this.calculateItemPosition(e),"Classic"===this.parent.activeLayout){if(this.parent.keyTipElements[this.parent.selectedTab].launcher)for(o=0;o<Object.keys(this.parent.keyTipElements[this.parent.selectedTab].launcher).length;o++)t=this.parent.keyTipElements[this.parent.selectedTab].launcher,this.createKeyTipElement(t[parseInt(o.toString(),10)].id,t[parseInt(o.toString(),10)].keyTip,"launcher");if(this.parent.keyTipElements[this.parent.selectedTab].grpoverflow)for(o=0;o<Object.keys(this.parent.keyTipElements[this.parent.selectedTab].grpoverflow).length;o++)t=this.parent.keyTipElements[this.parent.selectedTab].grpoverflow,this.createKeyTipElement(t[parseInt(o.toString(),10)].id,t[parseInt(o.toString(),10)].keyTip,"grpoverflow")}if("Simplified"===this.parent.activeLayout&&(this.parent.keyTipElements.overflowbtn&&(t=this.parent.keyTipElements.overflowbtn,this.createKeyTipElement(t[0].id,t[0].keyTip,"overflowbtn")),this.parent.keyTipElements[this.parent.selectedTab].grpofbtn))for(o=0;o<Object.keys(this.parent.keyTipElements[this.parent.selectedTab].grpofbtn).length;o++)t=this.parent.keyTipElements[this.parent.selectedTab].grpofbtn,this.createKeyTipElement(t[parseInt(o.toString(),10)].id,t[parseInt(o.toString(),10)].keyTip,"grpofbtn")}}},e.prototype.calculateItemPosition=function(e,t,o){void 0===t&&(t=!1);var i,r,n;if(n=this.parent.keyTipElements[parseInt(this.parent.selectedTab.toString(),10)][e])for(var s=0;s<Object.keys(this.parent.keyTipElements[parseInt(this.parent.selectedTab.toString(),10)][e]).length;s++)if(t&&n[parseInt(s.toString(),10)].keyTip===o||!t){var a=n[parseInt(s.toString(),10)].id;n[parseInt(s.toString(),10)].id.includes("_grpbtn")&&(a=n[parseInt(s.toString(),10)].id.replace(/_grpbtn\d+/,""));var l=c(this.parent.tabs,a);l&&"Column"===l.group.orientation&&l.collection.items.length>1&&"Simplified"!==this.parent.activeLayout?0===l.itemIndex?(i="center",r="top"):1===l.itemIndex?(i="center",r="center"):(i="center",r="bottom"):l&&"Row"===l.group.orientation&&l.group.collections.length>1&&"Simplified"!==this.parent.activeLayout&&(0===l.collectionIndex?(i="center",r="top"):(i="center",r="bottom")),"item"===e?this.createKeyTipElement(n[parseInt(s.toString(),10)].id,n[parseInt(s.toString(),10)].keyTip,e,i,r):this.createKeyTipElement(n[parseInt(s.toString(),10)].id,n[parseInt(s.toString(),10)].keyTip,e,i,r,!1,!0)}},e.prototype.createKeyTipElement=function(e,t,o,i,r,n,s){void 0===i&&(i="center"),void 0===r&&(r="bottom"),void 0===n&&(n=!1),void 0===s&&(s=!1);var l,p=document.querySelector("#"+e),c=!1;if(n&&(p=document.querySelector("#"+e+Zt)),p)if(p.closest(".e-ribbon-group-overflow-ddb")&&(c=!0),n&&s&&p.closest(".e-toolbar-pop")&&(c=!0),p.closest(".e-split-btn-wrapper")){l=p.closest(".e-split-btn-wrapper").closest(".e-ribbon-item").id}else p.closest(".e-colorpicker-wrapper")&&(l=(p=p.closest(".e-colorpicker-wrapper")).closest(".e-ribbon-item").id);if((p&&p.offsetParent||n&&s)&&(s&&c||!s)){var u=this.parent.createElement("div",{className:We,id:e+lo});document.body.append(u);new a.Popup(u,{relateTo:"#"+(n?e+Zt:l||e),content:t,collision:{X:"fit",Y:"flip"},targetType:"relative",position:{X:i,Y:r},enableRtl:this.parent.enableRtl}).show(),this.calculateKeyTipPosition(p,u,o,r,n&&s),this.parent.isKeytipOpen=!0}},e.prototype.calculateKeyTipPosition=function(e,t,o,i,r){void 0===r&&(r=!1);var n=e.getBoundingClientRect();"backstageMenu"===o?(t.style.top=n.top+t.offsetHeight/2+"px",t.style.left=n.left+e.offsetWidth/5+"px"):"popupitem"!==o&&(t.style.left=n.left+(n.width-t.offsetWidth)/2+"px"),"filemenu"===o||"backstage"===o?t.style.top=n.top+(e.offsetHeight-e.offsetHeight/3+t.offsetHeight/6)+"px":"item"===o&&"top"===i&&(t.style.top=n.top-e.offsetHeight/2+"px")},e.prototype.keytipPress=function(e,t){var o=this;void 0===t&&(t=!1),this.isKeytipPresent=!1;for(var i=0;i<Object.keys(this.parent.keyTipElements).length&&!this.isKeytipPresent;i++)if(this.parent.keyTipElements[parseInt(i.toString(),10)]){for(var r=0;r<Object.keys(this.parent.keyTipElements[parseInt(i.toString(),10)]).length&&!this.isKeytipPresent;r++)for(var n=this.parent.keyTipElements[parseInt(i.toString(),10)][Object.keys(this.parent.keyTipElements[parseInt(i.toString(),10)])[parseInt(r.toString(),10)]],s=0;s<n.length&&!this.isKeytipPresent;s++)if(e.toUpperCase()===n[parseInt(s.toString(),10)].keyTip){if(document.querySelector("#"+n[parseInt(s.toString(),10)].id+lo)||t)if(this.isKeytipPresent=!0,this.removeKeytip(),"tab"===n[parseInt(s.toString(),10)].type)i!==this.parent.selectedTab?(this.parent.tabObj.select(i),setTimeout(function(){var e=o.parent.tabObj.element.querySelector(".e-nav-active");e&&e.click(),o.createKeytip("item")},600)):this.createKeytip("item");else if("item"===n[parseInt(s.toString(),10)].type||"grpoverflowpopup"===n[parseInt(s.toString(),10)].type||"popupitem"===n[parseInt(s.toString(),10)].type)if(document.getElementById(n[parseInt(s.toString(),10)].id)&&document.getElementById(n[parseInt(s.toString(),10)].id).classList.contains("e-ribbon-group-button"))document.getElementById(n[parseInt(s.toString(),10)].id).click();else{var a=void 0;if(n[parseInt(s.toString(),10)].id.includes("_popupButton")){var l=n[parseInt(s.toString(),10)].id.replace(/_popupButton/g,"");a=c(this.parent.tabs,l)}else a=c(this.parent.tabs,n[parseInt(s.toString(),10)].id);(!t||t&&a.tabIndex===this.parent.selectedTab)&&this.clickItems(a,n,s,!1,t)}else if("grpoverflow"===n[parseInt(s.toString(),10)].type||"grpofbtn"===n[parseInt(s.toString(),10)].type||"launcher"===n[parseInt(s.toString(),10)].type){var p=document.querySelector("#"+n[parseInt(s.toString(),10)].id);if(this.removeKeytip(),p){var u=n[parseInt(s.toString(),10)].id;if(t){if(n[parseInt(s.toString(),10)].id.includes("_launcher")||n[parseInt(s.toString(),10)].id.includes("_sim_grp_overflow")||n[parseInt(s.toString(),10)].id.includes("_overflow_dropdown")){u=n[parseInt(s.toString(),10)].id.replace(/_launcher|_sim_grp_overflow|_overflow_dropdown/g,"");(a=d(this.parent.tabs,u)).tabIndex===this.parent.selectedTab&&this.clickItems(a,n,s,!0,t,p)}}else this.clickItems(null,n,s,!0,t,p)}}}}else this.parent.keyTipElements&&this.commonItemsKeyTipPress(e,Object.keys(this.parent.keyTipElements)[parseInt(i.toString(),10)],t)},e.prototype.clickItems=function(e,o,i,n,s,a){if(n)a.click(),"launcher"!==o[parseInt(i.toString(),10)].type&&(this.isKeytipPopupOpen=!0,"grpoverflow"===o[parseInt(i.toString(),10)].type?this.createKeytip("grpoverflowpopup"):this.createKeytip("popupitem"));else{var l=o[parseInt(i.toString(),10)].id;document.querySelector("#"+l)&&s&&("Simplified"===this.parent.activeLayout?document.querySelector("#"+l).closest("#"+e.group.id+"_sim_grp_overflow-popup")&&document.querySelector("#"+l).closest("#"+e.group.id+"_sim_grp_overflow-popup").classList.contains("e-popup-close")?document.querySelector("#"+e.group.id+"_sim_grp_overflow").click():document.querySelector("#"+l).closest("#"+this.parent.tabObj.element.id+Xt+"-popup")&&document.querySelector("#"+l).closest("#"+this.parent.tabObj.element.id+Xt+"-popup").classList.contains("e-popup-close")&&document.querySelector("#"+this.parent.tabObj.element.id+Xt).click():document.querySelector("#"+l).closest("#"+e.group.id+eo+to+"-popup")&&document.querySelector("#"+l).closest("#"+e.group.id+eo+to+"-popup").classList.contains("e-popup-close")&&document.querySelector("#"+e.group.id+eo+to).click());switch(this.parent.getItemModuleName(e.item)){case"btn":this.parent.ribbonButtonModule.click(l);break;case"dropdown-btn":this.parent.ribbonDropDownModule.toggle(l);break;case"split-btn":this.parent.ribbonSplitButtonModule.toggle(l);break;case"checkbox":this.parent.ribbonCheckBoxModule.click(l);break;case"colorpicker":this.parent.ribbonColorPickerModule.toggle(l);break;case"combobox":var p=document.querySelector("#"+l);setTimeout(function(){p.focus()},100);break;case"gallery":document.querySelector("#"+l).click();break;case"template":document.querySelector("#"+l).focus();break;case"group-btn":var c=document.querySelector("#"+l);if(c){t.getInstance(c,r.DropDownButton).toggle();for(var u=0;u<e.item.groupButtonSettings.items.length;u++)e.item.groupButtonSettings.items[parseInt(u.toString(),10)].keyTip&&this.createKeyTipElement(l+(ao+u),e.item.groupButtonSettings.items[parseInt(u.toString(),10)].keyTip,"item")}}}},e.prototype.commonItemsKeyTipPress=function(e,t,o){var i=this;if(this.parent.keyTipElements[t]){var r=!1,n=this.parent.keyTipElements[t],s=void 0;if(n)if("backstageMenu"===t){for(var a=0;a<Object.keys(this.parent.keyTipElements[t]).length;a++)if(n[parseInt(a.toString(),10)].keyTip===e.toUpperCase()&&(s=document.querySelector("#"+n[parseInt(a.toString(),10)].id),document.querySelector("#"+s.id+lo)||o)){r=!0,o&&document.querySelector(".e-ribbon-backstage-popup").classList.contains("e-popup-close")&&this.parent.tabObj.element.querySelector(".e-ribbon-backstage").click();break}}else n[0]&&n[0].keyTip===e.toUpperCase()&&(s=document.querySelector("#"+n[0].id),(document.querySelector("#"+n[0].id+lo)||o)&&(r=!0));r&&(this.removeKeytip(),this.isKeytipPresent=!0,s&&(s.click(),"backstage"===t?this.createKeytip("backstageMenu"):"overflowbtn"===t?(this.isKeytipPopupOpen=!0,this.createKeytip("popupitem")):"taboverflow"===t&&setTimeout(function(){for(var e=0;e<Object.keys(i.parent.keyTipElements).length;e++)if(i.parent.keyTipElements[parseInt(e.toString(),10)]){var t=i.parent.keyTipElements[parseInt(e.toString(),10)].tab;i.createKeyTipElement(t[0].id,t[0].keyTip,"tab","center","bottom",!0,!0)}},600)))}},e.prototype.removeKeytip=function(e){var o=this,i=document.querySelectorAll(".e-ribbon-keytip"),r=!1;this.parent.keysPress="";for(var n=function(n){var a=i[parseInt(n.toString(),10)];if("Escape"===e&&s.parent.keyTipElements&&s.parent.keyTipElements[s.parent.selectedTab]){for(var p=0;p<Object.keys(s.parent.keyTipElements[s.parent.selectedTab]).length;p++){var c=Object.keys(s.parent.keyTipElements[s.parent.selectedTab])[p];if(s.parent.keyTipElements[s.parent.selectedTab][c]){if(-1!==l(s.parent.keyTipElements[s.parent.selectedTab][c],function(e){return e.id+lo===i[parseInt(n.toString(),10)].id})){if("item"===c&&!s.isKeytipPopupOpen||"grpoverflow"===c&&"Classic"===s.parent.activeLayout){s.createKeytip("tab"),e="",r=!0;break}if(s.isKeytipPopupOpen&&("popupitem"===c&&"Simplified"===s.parent.activeLayout||"grpoverflowpopup"===c&&"Classic"===s.parent.activeLayout)){s.createKeytip("item"),e="",r=!0;break}}}}for(var u=0;u<Object.keys(s.parent.keyTipElements).length;u++)if(s.parent.keyTipElements[parseInt(u.toString(),10)]){var d=s.parent.keyTipElements[parseInt(u.toString(),10)].tab;for(p=0;p<d.length;p++)if(a.id===d[0].id+lo&&document.querySelector("#"+d[0].id+Zt).closest(".e-toolbar-pop")){s.parent.tabObj.element.querySelector(".e-nav-active").click(),setTimeout(function(){o.createKeytip("tab")},600),e="",r=!0;break}if(r)break}if(!r&&s.parent.keyTipElements.backstageMenu){-1!==l(s.parent.keyTipElements.backstageMenu,function(e){return e.id+lo===i[parseInt(n.toString(),10)].id})&&(s.createKeytip("tab"),e="",r=!0)}}a&&t.remove(a)},s=this,a=0;a<i.length;a++)n(a);this.isKeytipPopupOpen=!1,r||(this.parent.isKeytipOpen=!1)},e.prototype.showKeyTips=function(e){this.parent.enableKeyTips&&(e?this.keytipPress(e,!0):this.createKeytip("tab"))},e.prototype.hideKeyTips=function(){this.removeKeytip()},e}();e.Ribbon=Co,e.ITEM_VERTICAL_CENTER=Re,e.EXPAND_COLLAPSE_ICON=xe,e.BACKSTAGE_CLOSE_ICON=Me,e.OVERFLOW_ICON=_e,e.VERTICAL_DDB=qe,e.DISABLED_CSS=Ae,e.RTL_CSS=je,e.RIBBON_HOVER=Ge,e.RIBBON_CONTROL=ze,e.RIBBON_POPUP_CONTROL=Ne,e.RIBBON_POPUP_OPEN=He,e.RIBBON_KEYTIP=We,e.SPACE=" ",e.HORIZONTAL_SCROLLBAR=Ke,e.HIDE_CSS=Fe,e.RIBBON_TAB="e-ribbon-tab",e.RIBBON_CONTEXTUAL_TAB=Ue,e.RIBBON_TAB_ACTIVE=Ve,e.RIBBON_TAB_ITEM=Xe,e.RIBBON_COLLAPSE_BUTTON=Ye,e.RIBBON_EXPAND_BUTTON=Ze,e.RIBBON_COLLAPSIBLE=Je,e.RIBBON_OVERALL_OF_BUTTON=Qe,e.RIBBON_GROUP_OF_BUTTON=$e,e.RIBBON_OVERFLOW_TARGET=et,e.RIBBON_OVERFLOW=tt,e.TAB_CONTENT=ot,e.RIBBON_MINIMIZE=it,e.RIBBON_GROUP=rt,e.RIBBON_SINGLE_BUTTON_SELECTION=nt,e.RIBBON_MULTIPLE_BUTTON_SELECTION=st,e.RIBBON_GROUP_BUTTON=at,e.RIBBON_GROUP_BUTTON_OVERFLOW_POPUP=lt,e.RIBBON_GROUP_BUTTON_CONTENT=pt,e.RIBBON_GROUP_CONTAINER=ct,e.RIBBON_OF_TAB_CONTAINER=ut,e.RIBBON_OF_GROUP_CONTAINER=dt,e.RIBBON_GROUP_CONTENT=ht,e.RIBBON_GROUP_HEADER=bt,e.RIBBON_OVERFLOW_HEADER=mt,e.RIBBON_GROUP_OVERFLOW=ft,e.RIBBON_GROUP_OVERFLOW_DDB=yt,e.RIBBON_LAUNCHER=gt,e.RIBBON_LAUNCHER_ICON_ELE=vt,e.RIBBON_LAUNCHER_ICON=St,e.RIBBON_COLLECTION=It,e.RIBBON_ITEM=Ct,e.RIBBON_ROW=Tt,e.RIBBON_COLUMN=wt,e.RIBBON_LARGE_ITEM=kt,e.RIBBON_MEDIUM_ITEM=Ot,e.RIBBON_SMALL_ITEM=Bt,e.RIBBON_CONTENT_HEIGHT=Pt,e.DROPDOWNBUTTON="e-dropdown-btn",e.DROPDOWNBUTTON_HIDE="e-caret-hide",e.RIBBON_TEMPLATE=Lt,e.RIBBON_HELP_TEMPLATE=Et,e.RIBBON_TOOLTIP=Dt,e.RIBBON_TOOLTIP_TARGET=Rt,e.RIBBON_TOOLTIP_TITLE=xt,e.RIBBON_TOOLTIP_CONTENT=Mt,e.RIBBON_TOOLTIP_ICON=_t,e.RIBBON_TOOLTIP_CONTAINER=qt,e.RIBBON_TEXT_CONTAINER=At,e.RIBBON_SIMPLIFIED_MODE=jt,e.RIBBON_BACKSTAGE_POPUP=Gt,e.RIBBON_BACKSTAGE_OPEN=zt,e.RIBBON_BACKSTAGE_CONTENT=Nt,e.RIBBON_SELECTED_CONTENT="e-ribbon-selected-content",e.RIBBON_BACKSTAGE=Ht,e.RIBBON_BACKSTAGE_MENU=Wt,e.RIBBON_BACKSTAGE_TEMPLATE=Kt,e.RIBBON_BACKSTAGE_MENU_WRAPPER=Ft,e.RIBBON_BACKSTAGE_ITEMS_WRAPPER=Ut,e.RIBBON_BACKSTAGE_TEXT_MENU="e-blankicon",e.TAB_ID="_tab",e.GROUP_ID="_group",e.COLLECTION_ID="_collection",e.ITEM_ID="_item",e.COLLAPSE_BUTTON_ID=Vt,e.OVRLOF_BUTTON_ID=Xt,e.GROUPOF_BUTTON_ID=Yt,e.HEADER_ID=Zt,e.LAUNCHER_ID=Jt,e.CONTENT_ID=Qt,e.CONTAINER_ID=$t,e.OVERFLOW_ID=eo,e.DROPDOWN_ID=to,e.RIBBON_FILE_MENU_ID="_filemenu",e.RIBBON_BACKSTAGE_MENU_ID=oo,e.RIBBON_BACKSTAGE_POPUP_ID=io,e.RIBBON_FILE_MENU_LIST=ro,e.RIBBON_MENU_LIST="_menulist",e.RIBBON_FOOTER_MENU_LIST=no,e.RIBBON_HELP_PANE_TEMPLATE_ID=so,e.RIBBON_GROUP_BUTTON_ID=ao,e.RIBBON_KEYTIP_ID=lo,e.RIBBON_FILE_MENU_WIDTH=po,e.RIBBON_HELP_PANE_TEMPLATE_WIDTH=co,e.getIndex=l,e.getTemplateFunction=p,e.getItem=c,e.getCollection=u,e.getGroup=d,e.destroyControl=h,e.updateCommonProperty=b,e.updateControlDisabled=m,e.getItemElement=f,e.isTooltipPresent=y,e.setToolTipContent=g,e.createTooltip=v,e.destroyTooltip=S,e.updateTooltipProp=I,e.setCustomAttributes=C,e.RibbonTab=fe,e.RibbonGroup=he,e.RibbonCollection=ce,e.RibbonItem=ae,e.RibbonButtonSettings=k,e.RibbonCheckBoxSettings=P,e.RibbonColorPickerSettings=D,e.RibbonComboBoxSettings=M,e.RibbonDropDownSettings=A,e.RibbonSplitButtonSettings=z,e.FileMenuSettings=ve,e.BackStageMenu=Pe,e.BackstageBackButton=Ce,e.BackstageItem=ke,e.RibbonTooltip=W,e.RibbonGroupButtonSettings=Y,e.RibbonGroupButtonItem=U,e.RibbonContextualTabSettings=De,e.RibbonGalleryGroup=te,e.RibbonGalleryItem=Q,e.RibbonGallerySettings=re,e.RibbonButton=uo,e.RibbonCheckBox=ho,e.RibbonColorPicker=bo,e.RibbonComboBox=mo,e.RibbonDropDown=fo,e.RibbonSplitButton=yo,e.RibbonGroupButton=go,e.RibbonGallery=vo,e.RibbonFileMenu=To,e.RibbonBackstage=ko,e.RibbonContextualTab=Oo,e.RibbonKeyTip=Bo,Object.defineProperty(e,"__esModule",{value:!0})});
10
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@syncfusion/ej2-base"),require("@syncfusion/ej2-navigations"),require("@syncfusion/ej2-dropdowns"),require("@syncfusion/ej2-splitbuttons"),require("@syncfusion/ej2-buttons"),require("@syncfusion/ej2-inputs"),require("@syncfusion/ej2-popups")):"function"==typeof define&&define.amd?define(["exports","@syncfusion/ej2-base","@syncfusion/ej2-navigations","@syncfusion/ej2-dropdowns","@syncfusion/ej2-splitbuttons","@syncfusion/ej2-buttons","@syncfusion/ej2-inputs","@syncfusion/ej2-popups"],t):t(e.ej={},e.ej2Base,e.ej2Navigations,e.ej2Dropdowns,e.ej2Splitbuttons,e.ej2Buttons,e.ej2Inputs,e.ej2Popups)}(this,function(e,t,o,i,r,n,s,a){"use strict";function l(e,t){for(var o=0;o<e.length;o++)if(t(e[parseInt(o.toString(),10)],o))return o;return-1}function p(e){if("string"==typeof e){var o="";try{var i=t.select(e);o=i?"SCRIPT"===i.tagName?i.innerHTML:i.outerHTML:e}catch(t){o=e}return t.compile(o)}return t.compile(e)}function c(e,t,o){for(var i=0;i<e.length;i++)for(var r=e[parseInt(i.toString(),10)],n=0;n<r.groups.length;n++)for(var s=r.groups[parseInt(n.toString(),10)],a=0;a<s.collections.length;a++)for(var l=s.collections[parseInt(a.toString(),10)],p=0;p<l.items.length;p++){var c=l.items[parseInt(p.toString(),10)];if(t&&c.id===t||o&&c.type===o)return{item:c,collection:l,group:s,tabIndex:i,groupIndex:n,collectionIndex:a,itemIndex:p}}return null}function u(e,t){for(var o=0;o<e.length;o++)for(var i=e[parseInt(o.toString(),10)],r=0;r<i.groups.length;r++)for(var n=i.groups[parseInt(r.toString(),10)],s=0;s<n.collections.length;s++){var a=n.collections[parseInt(s.toString(),10)];if(a.id===t)return{collection:a,group:n,tabIndex:o,groupIndex:r,collectionIndex:s}}return null}function d(e,t){for(var o=0;o<e.length;o++)for(var i=e[parseInt(o.toString(),10)],r=0;r<i.groups.length;r++){var n=i.groups[parseInt(r.toString(),10)];if(n.id===t)return{group:n,tabIndex:o,groupIndex:r}}return null}function h(e,o){t.getComponent(e,o).destroy()}function b(e,o,i){t.getComponent(e,o).setProperties(i)}function m(e,o,i){t.getComponent(e,o).setProperties("combobox"===o?{enabled:!i}:{disabled:i})}function f(o,i,n){if(!n&&!(n=c(o.tabs,i)))return null;var s=o.tabObj.items[n.tabIndex].content;if(""===s.innerHTML)return null;if(o.activeLayout===e.RibbonLayout.Classic)return n.item.displayOptions&e.DisplayMode.Classic?(s=n.group.isCollapsed?o.ribbonDropDownModule.getOverflowDropDownPopup(n,s):s).querySelector("#"+i):null;var a=n.item.displayOptions&e.DisplayMode.Simplified?s.querySelector("#"+n.item.id):null;if(!a){a=(n.group.enableGroupOverflow?t.getComponent(s.querySelector("#"+n.group.id+Yt),r.DropDownButton):o.overflowDDB).target.querySelector("#"+n.item.id)}return a}function y(e){return!!(e.content||e.iconCss||e.title||e.id||e.cssClass)}function g(e,t,o){var i=e.target.getAttribute("id"),r=o.filter(function(e){return e.id===i})[0].data,n=t.createElement("div",{id:r.id?qt+"_"+r.id:qt});if(t.element.append(n),r.title){var s=t.createElement("div",{innerHTML:r.title,className:xt});n.appendChild(s)}var a=t.createElement("div",{className:At});if(n.appendChild(a),r.iconCss){var l=t.createElement("div",{className:r.iconCss+" "+_t});a.appendChild(l)}if(r.content){var p=t.createElement("div",{innerHTML:r.content,className:Mt});a.appendChild(p)}t.setProperties({content:n,cssClass:r.cssClass?r.cssClass+" "+Dt:Dt})}function v(e,t){var o=new a.Tooltip({target:"."+Rt,beforeRender:function(e){g(e,o,t.tooltipData)}.bind(this),windowCollision:!0});o.appendTo(e)}function S(e){t.getComponent(e,a.Tooltip).destroy()}function I(e,o){t.getComponent(e,a.Tooltip).setProperties(o)}function C(e,o){for(var i in o)if("class"===i){var r=o.class.replace(/\s+/g," ").trim();r&&t.addClass([e],r.split(" "))}else if("style"===i){var n=""+(e.getAttribute("style")||"")+o[""+i];e.setAttribute(""+i,n)}else e.setAttribute(i,o[""+i])}!function(e){e.Classic="Classic",e.Simplified="Simplified"}(e.RibbonLayout||(e.RibbonLayout={})),function(e){e.Row="Row",e.Column="Column"}(e.ItemOrientation||(e.ItemOrientation={})),function(e){e[e.Large=4]="Large",e[e.Medium=2]="Medium",e[e.Small=1]="Small"}(e.RibbonItemSize||(e.RibbonItemSize={})),function(e){e[e.Classic=4]="Classic",e[e.Simplified=2]="Simplified",e[e.Overflow=1]="Overflow",e[e.Auto=7]="Auto"}(e.DisplayMode||(e.DisplayMode={})),function(e){e.Button="Button",e.CheckBox="CheckBox",e.ColorPicker="ColorPicker",e.ComboBox="ComboBox",e.DropDown="DropDown",e.SplitButton="SplitButton",e.GroupButton="GroupButton",e.Gallery="Gallery",e.Template="Template"}(e.RibbonItemType||(e.RibbonItemType={})),function(e){e.Single="Single",e.Multiple="Multiple"}(e.RibbonGroupButtonSelection||(e.RibbonGroupButtonSelection={}));var T=function(){var e=function(t,o){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(t,o)};return function(t,o){function i(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(i.prototype=o.prototype,new i)}}(),w=function(e,t,o,i){var r,n=arguments.length,s=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(n<3?r(s):n>3?r(t,o,s):r(t,o))||s);return n>3&&s&&Object.defineProperty(t,o,s),s},k=function(e){function o(){return null!==e&&e.apply(this,arguments)||this}return T(o,e),o.prototype.setProperties=function(t,o){e.prototype.setProperties.call(this,t,o)},w([t.Property("")],o.prototype,"content",void 0),w([t.Property("")],o.prototype,"cssClass",void 0),w([t.Property("")],o.prototype,"iconCss",void 0),w([t.Property(!1)],o.prototype,"isToggle",void 0),w([t.Property(!1)],o.prototype,"isPrimary",void 0),w([t.Property({})],o.prototype,"htmlAttributes",void 0),w([t.Event()],o.prototype,"created",void 0),w([t.Event()],o.prototype,"clicked",void 0),o}(t.ChildProperty),O=function(){var e=function(t,o){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(t,o)};return function(t,o){function i(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(i.prototype=o.prototype,new i)}}(),B=function(e,t,o,i){var r,n=arguments.length,s=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(n<3?r(s):n>3?r(t,o,s):r(t,o))||s);return n>3&&s&&Object.defineProperty(t,o,s),s},P=function(e){function o(){return null!==e&&e.apply(this,arguments)||this}return O(o,e),o.prototype.setProperties=function(t,o){e.prototype.setProperties.call(this,t,o)},B([t.Property(!1)],o.prototype,"checked",void 0),B([t.Property("")],o.prototype,"cssClass",void 0),B([t.Property("")],o.prototype,"label",void 0),B([t.Property("After")],o.prototype,"labelPosition",void 0),B([t.Property({})],o.prototype,"htmlAttributes",void 0),B([t.Event()],o.prototype,"created",void 0),B([t.Event()],o.prototype,"change",void 0),o}(t.ChildProperty),L=function(){var e=function(t,o){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(t,o)};return function(t,o){function i(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(i.prototype=o.prototype,new i)}}(),E=function(e,t,o,i){var r,n=arguments.length,s=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(n<3?r(s):n>3?r(t,o,s):r(t,o))||s);return n>3&&s&&Object.defineProperty(t,o,s),s},D=function(e){function o(){return null!==e&&e.apply(this,arguments)||this}return L(o,e),o.prototype.setProperties=function(t,o){e.prototype.setProperties.call(this,t,o)},E([t.Property(10)],o.prototype,"columns",void 0),E([t.Property("")],o.prototype,"cssClass",void 0),E([t.Property("")],o.prototype,"label",void 0),E([t.Property(!0)],o.prototype,"enableOpacity",void 0),E([t.Property("Palette")],o.prototype,"mode",void 0),E([t.Property(!0)],o.prototype,"modeSwitcher",void 0),E([t.Property(!1)],o.prototype,"noColor",void 0),E([t.Property(null)],o.prototype,"presetColors",void 0),E([t.Property(!0)],o.prototype,"showButtons",void 0),E([t.Property("#008000ff")],o.prototype,"value",void 0),E([t.Property({})],o.prototype,"htmlAttributes",void 0),E([t.Event()],o.prototype,"beforeClose",void 0),E([t.Event()],o.prototype,"beforeOpen",void 0),E([t.Event()],o.prototype,"beforeTileRender",void 0),E([t.Event()],o.prototype,"created",void 0),E([t.Event()],o.prototype,"change",void 0),E([t.Event()],o.prototype,"open",void 0),E([t.Event()],o.prototype,"select",void 0),o}(t.ChildProperty),R=function(){var e=function(t,o){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(t,o)};return function(t,o){function i(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(i.prototype=o.prototype,new i)}}(),x=function(e,t,o,i){var r,n=arguments.length,s=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(n<3?r(s):n>3?r(t,o,s):r(t,o))||s);return n>3&&s&&Object.defineProperty(t,o,s),s},M=function(e){function o(){return null!==e&&e.apply(this,arguments)||this}return R(o,e),o.prototype.setProperties=function(t,o){e.prototype.setProperties.call(this,t,o)},x([t.Property(!1)],o.prototype,"allowFiltering",void 0),x([t.Property(!0)],o.prototype,"autofill",void 0),x([t.Property("")],o.prototype,"cssClass",void 0),x([t.Property("")],o.prototype,"label",void 0),x([t.Property([])],o.prototype,"dataSource",void 0),x([t.Complex({text:null,value:null,iconCss:null,groupBy:null},i.FieldSettings)],o.prototype,"fields",void 0),x([t.Property("Contains")],o.prototype,"filterType",void 0),x([t.Property(null)],o.prototype,"footerTemplate",void 0),x([t.Property(null)],o.prototype,"groupTemplate",void 0),x([t.Property(null)],o.prototype,"headerTemplate",void 0),x([t.Property(null)],o.prototype,"index",void 0),x([t.Property(null)],o.prototype,"itemTemplate",void 0),x([t.Property("No records found")],o.prototype,"noRecordsTemplate",void 0),x([t.Property(null)],o.prototype,"placeholder",void 0),x([t.Property("300px")],o.prototype,"popupHeight",void 0),x([t.Property("100%")],o.prototype,"popupWidth",void 0),x([t.Property(!0)],o.prototype,"showClearButton",void 0),x([t.Property("None")],o.prototype,"sortOrder",void 0),x([t.Property(null)],o.prototype,"text",void 0),x([t.Property(null)],o.prototype,"value",void 0),x([t.Property("150px")],o.prototype,"width",void 0),x([t.Property({})],o.prototype,"htmlAttributes",void 0),x([t.Event()],o.prototype,"beforeOpen",void 0),x([t.Event()],o.prototype,"change",void 0),x([t.Event()],o.prototype,"close",void 0),x([t.Event()],o.prototype,"created",void 0),x([t.Event()],o.prototype,"filtering",void 0),x([t.Event()],o.prototype,"open",void 0),x([t.Event()],o.prototype,"select",void 0),o}(t.ChildProperty),_=function(){var e=function(t,o){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(t,o)};return function(t,o){function i(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(i.prototype=o.prototype,new i)}}(),q=function(e,t,o,i){var r,n=arguments.length,s=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(n<3?r(s):n>3?r(t,o,s):r(t,o))||s);return n>3&&s&&Object.defineProperty(t,o,s),s},A=function(e){function o(){return null!==e&&e.apply(this,arguments)||this}return _(o,e),o.prototype.setProperties=function(t,o){e.prototype.setProperties.call(this,t,o)},q([t.Property("")],o.prototype,"closeActionEvents",void 0),q([t.Property("")],o.prototype,"content",void 0),q([t.Property("")],o.prototype,"cssClass",void 0),q([t.Property("")],o.prototype,"iconCss",void 0),q([t.Collection([],r.Item)],o.prototype,"items",void 0),q([t.Property("")],o.prototype,"target",void 0),q([t.Property(!1)],o.prototype,"createPopupOnClick",void 0),q([t.Property({})],o.prototype,"htmlAttributes",void 0),q([t.Event()],o.prototype,"beforeClose",void 0),q([t.Event()],o.prototype,"beforeItemRender",void 0),q([t.Event()],o.prototype,"beforeOpen",void 0),q([t.Event()],o.prototype,"close",void 0),q([t.Event()],o.prototype,"created",void 0),q([t.Event()],o.prototype,"open",void 0),q([t.Event()],o.prototype,"select",void 0),o}(t.ChildProperty),j=function(){var e=function(t,o){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(t,o)};return function(t,o){function i(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(i.prototype=o.prototype,new i)}}(),G=function(e,t,o,i){var r,n=arguments.length,s=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(n<3?r(s):n>3?r(t,o,s):r(t,o))||s);return n>3&&s&&Object.defineProperty(t,o,s),s},z=function(e){function o(){return null!==e&&e.apply(this,arguments)||this}return j(o,e),o.prototype.setProperties=function(t,o){e.prototype.setProperties.call(this,t,o)},G([t.Property("")],o.prototype,"closeActionEvents",void 0),G([t.Property("")],o.prototype,"content",void 0),G([t.Property("")],o.prototype,"cssClass",void 0),G([t.Property("")],o.prototype,"iconCss",void 0),G([t.Collection([],r.Item)],o.prototype,"items",void 0),G([t.Property("")],o.prototype,"target",void 0),G([t.Property({})],o.prototype,"htmlAttributes",void 0),G([t.Event()],o.prototype,"beforeClose",void 0),G([t.Event()],o.prototype,"beforeItemRender",void 0),G([t.Event()],o.prototype,"beforeOpen",void 0),G([t.Event()],o.prototype,"close",void 0),G([t.Event()],o.prototype,"click",void 0),G([t.Event()],o.prototype,"created",void 0),G([t.Event()],o.prototype,"open",void 0),G([t.Event()],o.prototype,"select",void 0),o}(t.ChildProperty),N=function(){var e=function(t,o){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(t,o)};return function(t,o){function i(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(i.prototype=o.prototype,new i)}}(),H=function(e,t,o,i){var r,n=arguments.length,s=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(n<3?r(s):n>3?r(t,o,s):r(t,o))||s);return n>3&&s&&Object.defineProperty(t,o,s),s},W=function(e){function o(){return null!==e&&e.apply(this,arguments)||this}return N(o,e),H([t.Property("")],o.prototype,"cssClass",void 0),H([t.Property("")],o.prototype,"id",void 0),H([t.Property("")],o.prototype,"title",void 0),H([t.Property("")],o.prototype,"content",void 0),H([t.Property("")],o.prototype,"iconCss",void 0),o}(t.ChildProperty),K=function(){var e=function(t,o){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(t,o)};return function(t,o){function i(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(i.prototype=o.prototype,new i)}}(),F=function(e,t,o,i){var r,n=arguments.length,s=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(n<3?r(s):n>3?r(t,o,s):r(t,o))||s);return n>3&&s&&Object.defineProperty(t,o,s),s},U=function(e){function o(){return null!==e&&e.apply(this,arguments)||this}return K(o,e),o.prototype.setProperties=function(t,o){e.prototype.setProperties.call(this,t,o)},F([t.Property("")],o.prototype,"content",void 0),F([t.Property("")],o.prototype,"iconCss",void 0),F([t.Property("")],o.prototype,"keyTip",void 0),F([t.Complex({},W)],o.prototype,"ribbonTooltipSettings",void 0),F([t.Property(!1)],o.prototype,"selected",void 0),F([t.Property({})],o.prototype,"htmlAttributes",void 0),F([t.Event()],o.prototype,"beforeClick",void 0),F([t.Event()],o.prototype,"click",void 0),o}(t.ChildProperty),V=function(){var e=function(t,o){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(t,o)};return function(t,o){function i(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(i.prototype=o.prototype,new i)}}(),X=function(e,t,o,i){var r,n=arguments.length,s=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(n<3?r(s):n>3?r(t,o,s):r(t,o))||s);return n>3&&s&&Object.defineProperty(t,o,s),s},Y=function(e){function o(){return null!==e&&e.apply(this,arguments)||this}return V(o,e),X([t.Property("")],o.prototype,"header",void 0),X([t.Property("Single")],o.prototype,"selection",void 0),X([t.Collection([],U)],o.prototype,"items",void 0),o}(t.ChildProperty),Z=function(){var e=function(t,o){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(t,o)};return function(t,o){function i(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(i.prototype=o.prototype,new i)}}(),J=function(e,t,o,i){var r,n=arguments.length,s=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(n<3?r(s):n>3?r(t,o,s):r(t,o))||s);return n>3&&s&&Object.defineProperty(t,o,s),s},Q=function(e){function o(){return null!==e&&e.apply(this,arguments)||this}return Z(o,e),J([t.Property("")],o.prototype,"content",void 0),J([t.Property("")],o.prototype,"iconCss",void 0),J([t.Property({})],o.prototype,"htmlAttributes",void 0),J([t.Property("")],o.prototype,"cssClass",void 0),J([t.Property(!1)],o.prototype,"disabled",void 0),o}(t.ChildProperty),$=function(){var e=function(t,o){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(t,o)};return function(t,o){function i(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(i.prototype=o.prototype,new i)}}(),ee=function(e,t,o,i){var r,n=arguments.length,s=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(n<3?r(s):n>3?r(t,o,s):r(t,o))||s);return n>3&&s&&Object.defineProperty(t,o,s),s},te=function(e){function o(){return null!==e&&e.apply(this,arguments)||this}return $(o,e),ee([t.Collection([],Q)],o.prototype,"items",void 0),ee([t.Property("")],o.prototype,"header",void 0),ee([t.Property("auto")],o.prototype,"itemWidth",void 0),ee([t.Property("auto")],o.prototype,"itemHeight",void 0),ee([t.Property("")],o.prototype,"cssClass",void 0),o}(t.ChildProperty),oe=function(){var e=function(t,o){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(t,o)};return function(t,o){function i(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(i.prototype=o.prototype,new i)}}(),ie=function(e,t,o,i){var r,n=arguments.length,s=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(n<3?r(s):n>3?r(t,o,s):r(t,o))||s);return n>3&&s&&Object.defineProperty(t,o,s),s},re=function(e){function o(){return null!==e&&e.apply(this,arguments)||this}return oe(o,e),ie([t.Collection([],te)],o.prototype,"groups",void 0),ie([t.Property(3)],o.prototype,"itemCount",void 0),ie([t.Property(null)],o.prototype,"selectedItemIndex",void 0),ie([t.Property("auto")],o.prototype,"popupHeight",void 0),ie([t.Property("auto")],o.prototype,"popupWidth",void 0),ie([t.Property("")],o.prototype,"template",void 0),ie([t.Property("")],o.prototype,"popupTemplate",void 0),ie([t.Event()],o.prototype,"popupOpen",void 0),ie([t.Event()],o.prototype,"popupClose",void 0),ie([t.Event()],o.prototype,"itemHover",void 0),ie([t.Event()],o.prototype,"beforeItemRender",void 0),ie([t.Event()],o.prototype,"beforeSelect",void 0),ie([t.Event()],o.prototype,"select",void 0),o}(t.ChildProperty),ne=function(){var e=function(t,o){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(t,o)};return function(t,o){function i(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(i.prototype=o.prototype,new i)}}(),se=function(e,t,o,i){var r,n=arguments.length,s=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(n<3?r(s):n>3?r(t,o,s):r(t,o))||s);return n>3&&s&&Object.defineProperty(t,o,s),s},ae=function(o){function i(){return null!==o&&o.apply(this,arguments)||this}return ne(i,o),i.prototype.setProperties=function(e,t){o.prototype.setProperties.call(this,e,t)},se([t.Property("")],i.prototype,"keyTip",void 0),se([t.Property(e.RibbonItemSize.Medium)],i.prototype,"activeSize",void 0),se([t.Property(e.RibbonItemSize.Small|e.RibbonItemSize.Medium|e.RibbonItemSize.Large)],i.prototype,"allowedSizes",void 0),se([t.Property("")],i.prototype,"id",void 0),se([t.Property("")],i.prototype,"cssClass",void 0),se([t.Property(!1)],i.prototype,"disabled",void 0),se([t.Property("")],i.prototype,"itemTemplate",void 0),se([t.Property("Button")],i.prototype,"type",void 0),se([t.Property(e.DisplayMode.Auto)],i.prototype,"displayOptions",void 0),se([t.Complex({},W)],i.prototype,"ribbonTooltipSettings",void 0),se([t.Complex({},k)],i.prototype,"buttonSettings",void 0),se([t.Complex({},A)],i.prototype,"dropDownSettings",void 0),se([t.Complex({},P)],i.prototype,"checkBoxSettings",void 0),se([t.Complex({},D)],i.prototype,"colorPickerSettings",void 0),se([t.Complex({},M)],i.prototype,"comboBoxSettings",void 0),se([t.Complex({},z)],i.prototype,"splitButtonSettings",void 0),se([t.Complex({},Y)],i.prototype,"groupButtonSettings",void 0),se([t.Complex({},re)],i.prototype,"gallerySettings",void 0),i}(t.ChildProperty),le=function(){var e=function(t,o){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(t,o)};return function(t,o){function i(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(i.prototype=o.prototype,new i)}}(),pe=function(e,t,o,i){var r,n=arguments.length,s=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(n<3?r(s):n>3?r(t,o,s):r(t,o))||s);return n>3&&s&&Object.defineProperty(t,o,s),s},ce=function(e){function o(){return null!==e&&e.apply(this,arguments)||this}return le(o,e),o.prototype.setProperties=function(t,o){e.prototype.setProperties.call(this,t,o)},pe([t.Property("")],o.prototype,"id",void 0),pe([t.Property("")],o.prototype,"cssClass",void 0),pe([t.Collection([],ae)],o.prototype,"items",void 0),o}(t.ChildProperty),ue=function(){var e=function(t,o){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(t,o)};return function(t,o){function i(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(i.prototype=o.prototype,new i)}}(),de=function(e,t,o,i){var r,n=arguments.length,s=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(n<3?r(s):n>3?r(t,o,s):r(t,o))||s);return n>3&&s&&Object.defineProperty(t,o,s),s},he=function(e){function o(){return null!==e&&e.apply(this,arguments)||this}return ue(o,e),o.prototype.setProperties=function(t,o){e.prototype.setProperties.call(this,t,o)},de([t.Property("")],o.prototype,"keyTip",void 0),de([t.Property("")],o.prototype,"launcherIconKeyTip",void 0),de([t.Collection([],ce)],o.prototype,"collections",void 0),de([t.Property("")],o.prototype,"cssClass",void 0),de([t.Property("")],o.prototype,"id",void 0),de([t.Property(!1)],o.prototype,"isCollapsed",void 0),de([t.Property(!0)],o.prototype,"isCollapsible",void 0),de([t.Property(!1)],o.prototype,"enableGroupOverflow",void 0),de([t.Property("")],o.prototype,"groupIconCss",void 0),de([t.Property("")],o.prototype,"header",void 0),de([t.Property("Column")],o.prototype,"orientation",void 0),de([t.Property("")],o.prototype,"overflowHeader",void 0),de([t.Property(0)],o.prototype,"priority",void 0),de([t.Property(!1)],o.prototype,"showLauncherIcon",void 0),o}(t.ChildProperty),be=function(){var e=function(t,o){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(t,o)};return function(t,o){function i(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(i.prototype=o.prototype,new i)}}(),me=function(e,t,o,i){var r,n=arguments.length,s=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(n<3?r(s):n>3?r(t,o,s):r(t,o))||s);return n>3&&s&&Object.defineProperty(t,o,s),s},fe=function(e){function o(){return null!==e&&e.apply(this,arguments)||this}return be(o,e),o.prototype.setProperties=function(t,o){e.prototype.setProperties.call(this,t,o)},me([t.Property("")],o.prototype,"keyTip",void 0),me([t.Property("")],o.prototype,"id",void 0),me([t.Property("")],o.prototype,"cssClass",void 0),me([t.Collection([],he)],o.prototype,"groups",void 0),me([t.Property("")],o.prototype,"header",void 0),o}(t.ChildProperty),ye=function(){var e=function(t,o){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(t,o)};return function(t,o){function i(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(i.prototype=o.prototype,new i)}}(),ge=function(e,t,o,i){var r,n=arguments.length,s=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(n<3?r(s):n>3?r(t,o,s):r(t,o))||s);return n>3&&s&&Object.defineProperty(t,o,s),s},ve=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ye(i,e),i.prototype.setProperties=function(t,o){e.prototype.setProperties.call(this,t,o)},ge([t.Property("File")],i.prototype,"text",void 0),ge([t.Property(!1)],i.prototype,"visible",void 0),ge([t.Collection([],o.MenuItem)],i.prototype,"menuItems",void 0),ge([t.Property(!1)],i.prototype,"showItemOnClick",void 0),ge([t.Complex({},o.MenuAnimationSettings)],i.prototype,"animationSettings",void 0),ge([t.Property("")],i.prototype,"itemTemplate",void 0),ge([t.Property("")],i.prototype,"popupTemplate",void 0),ge([t.Complex({},W)],i.prototype,"ribbonTooltipSettings",void 0),ge([t.Event()],i.prototype,"beforeClose",void 0),ge([t.Event()],i.prototype,"beforeOpen",void 0),ge([t.Event()],i.prototype,"beforeItemRender",void 0),ge([t.Event()],i.prototype,"close",void 0),ge([t.Event()],i.prototype,"open",void 0),ge([t.Event()],i.prototype,"select",void 0),ge([t.Property("")],i.prototype,"keyTip",void 0),i}(t.ChildProperty),Se=function(){var e=function(t,o){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(t,o)};return function(t,o){function i(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(i.prototype=o.prototype,new i)}}(),Ie=function(e,t,o,i){var r,n=arguments.length,s=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(n<3?r(s):n>3?r(t,o,s):r(t,o))||s);return n>3&&s&&Object.defineProperty(t,o,s),s},Ce=function(e){function o(){return null!==e&&e.apply(this,arguments)||this}return Se(o,e),Ie([t.Property("")],o.prototype,"text",void 0),Ie([t.Property("")],o.prototype,"iconCss",void 0),Ie([t.Property(!0)],o.prototype,"visible",void 0),o}(t.ChildProperty),Te=function(){var e=function(t,o){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(t,o)};return function(t,o){function i(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(i.prototype=o.prototype,new i)}}(),we=function(e,t,o,i){var r,n=arguments.length,s=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(n<3?r(s):n>3?r(t,o,s):r(t,o))||s);return n>3&&s&&Object.defineProperty(t,o,s),s},ke=function(e){function o(){return null!==e&&e.apply(this,arguments)||this}return Te(o,e),we([t.Property("")],o.prototype,"text",void 0),we([t.Property("")],o.prototype,"id",void 0),we([t.Property("")],o.prototype,"keyTip",void 0),we([t.Property("")],o.prototype,"content",void 0),we([t.Property("")],o.prototype,"iconCss",void 0),we([t.Property(!1)],o.prototype,"separator",void 0),we([t.Property(!1)],o.prototype,"isFooter",void 0),we([t.Event()],o.prototype,"backStageItemClick",void 0),o}(t.ChildProperty),Oe=function(){var e=function(t,o){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(t,o)};return function(t,o){function i(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(i.prototype=o.prototype,new i)}}(),Be=function(e,t,o,i){var r,n=arguments.length,s=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(n<3?r(s):n>3?r(t,o,s):r(t,o))||s);return n>3&&s&&Object.defineProperty(t,o,s),s},Pe=function(e){function o(){return null!==e&&e.apply(this,arguments)||this}return Oe(o,e),o.prototype.setProperties=function(t,o){e.prototype.setProperties.call(this,t,o)},Be([t.Property("File")],o.prototype,"text",void 0),Be([t.Property("")],o.prototype,"keyTip",void 0),Be([t.Property(!1)],o.prototype,"visible",void 0),Be([t.Property("auto")],o.prototype,"height",void 0),Be([t.Property("auto")],o.prototype,"width",void 0),Be([t.Property(null)],o.prototype,"target",void 0),Be([t.Complex({},Ce)],o.prototype,"backButton",void 0),Be([t.Collection([],ke)],o.prototype,"items",void 0),Be([t.Property("")],o.prototype,"template",void 0),Be([t.Complex({},W)],o.prototype,"ribbonTooltipSettings",void 0),o}(t.ChildProperty),Le=function(){var e=function(t,o){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(t,o)};return function(t,o){function i(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(i.prototype=o.prototype,new i)}}(),Ee=function(e,t,o,i){var r,n=arguments.length,s=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(n<3?r(s):n>3?r(t,o,s):r(t,o))||s);return n>3&&s&&Object.defineProperty(t,o,s),s},De=function(e){function o(){return null!==e&&e.apply(this,arguments)||this}return Le(o,e),o.prototype.setProperties=function(t,o){e.prototype.setProperties.call(this,t,o)},Ee([t.Property(!1)],o.prototype,"visible",void 0),Ee([t.Property(!1)],o.prototype,"isSelected",void 0),Ee([t.Collection([],fe)],o.prototype,"tabs",void 0),o}(t.ChildProperty),Re="e-ribbon-vertical-center",xe="e-icons e-drop-icon",Me="e-icons e-arrow-left",_e="e-icons e-more-horizontal-1",qe="e-vertical",Ae="e-disabled",je="e-rtl",Ge="e-ribbon-hover",ze="e-ribbon-control",Ne="e-ribbon-popup-control",He="e-ribbon-open",We="e-ribbon-keytip",Ke="e-hscroll-bar",Fe="e-ribbon-hide",Ue="e-ribbon-contextual-tab",Ve="e-ribbon-active",Xe="e-ribbon-tab-item",Ye="e-ribbon-collapse-btn",Ze="e-ribbon-expand-btn",Je="e-ribbon-collapsible",Qe="e-ribbon-overall-of-btn",$e="e-ribbon-group-of-btn",et="e-ribbon-overflow-target",tt="e-ribbon-overflow",ot="e-content",it="e-ribbon-minimize",rt="e-ribbon-group",nt="e-ribbon-single-selection",st="e-ribbon-multiple-selection",at="e-ribbon-group-button",lt="e-ribbon-group-button-overflow-popup",pt="e-ribbon-group-button-content",ct="e-ribbon-group-container",ut="e-ribbon-of-tab",dt="e-ribbon-of-group-container",ht="e-ribbon-group-content",bt="e-ribbon-group-header",mt="e-ribbon-overflow-header",ft="e-ribbon-group-overflow",yt="e-ribbon-group-overflow-ddb",gt="e-ribbon-launcher",vt="e-ribbon-launcher-icon",St="e-icons e-launcher",It="e-ribbon-collection",Ct="e-ribbon-item",Tt="e-ribbon-row",wt="e-ribbon-column",kt="e-ribbon-large-item",Ot="e-ribbon-medium-item",Bt="e-ribbon-small-item",Pt="e-ribbon-content-height",Lt="e-ribbon-template",Et="e-ribbon-help-template",Dt="e-ribbon-tooltip",Rt="e-ribbon-tooltip-target",xt="e-ribbon-tooltip-title",Mt="e-ribbon-tooltip-content",_t="e-ribbon-tooltip-icon",qt="e-ribbon-tooltip-container",At="e-ribbon-text-container",jt="e-ribbon-simplified-mode",Gt="e-ribbon-backstage-popup",zt="e-ribbon-backstage-open",Nt="e-ribbon-backstage-content",Ht="e-ribbon-backstage",Wt="e-ribbon-backstage-menu",Kt="e-ribbon-backstage-template",Ft="e-ribbon-backstage-wrapper",Ut="e-ribbon-backstage-items-wrapper",Vt="_collapsebutton",Xt="_sim_ovrl_overflow",Yt="_sim_grp_overflow",Zt="_header",Jt="_launcher",Qt="_content",$t="_container",eo="_overflow",to="_dropdown",oo="_backstage",io="_backstagepopup",ro="_filemenulist",no="_footermenulist",so="_helppanetemplate",ao="_grpbtn",lo="_keytip",po="--fileMenuWidth",co="--helpTemplateWidth",uo=function(){return(uo=Object.assign||function(e){for(var t,o=1,i=arguments.length;o<i;o++){t=arguments[o];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e}).apply(this,arguments)},ho=function(){function o(e){this.parent=e}return o.prototype.getModuleName=function(){return"ribbonButton"},o.prototype.destroy=function(){this.parent=null},o.prototype.createButton=function(t,o){var i=this,r=this.parent.createElement("button",{id:t.id});o.appendChild(r);var s=t.buttonSettings;if(new n.Button({locale:this.parent.locale,enableRtl:this.parent.enableRtl,enablePersistence:this.parent.enablePersistence,iconPosition:t.activeSize===e.RibbonItemSize.Large?"Top":"Left",iconCss:s.iconCss,disabled:t.disabled,cssClass:(Re+" "+ze+" "+(s.cssClass?s.cssClass:"")).trim(),content:t.activeSize===e.RibbonItemSize.Small?"":s.content,isPrimary:s.isPrimary,isToggle:s.isToggle,created:s.created},r),s.htmlAttributes){var a=uo({},s.htmlAttributes);a.id&&delete a.id,C(r,a)}r.onclick=function(e){s.clicked&&s.clicked.call(i,e)},r.setAttribute("aria-label",s.content)},o.prototype.addOverFlowEvents=function(e,o,i){var r=this,s=o.querySelector("#"+e.id);s.setAttribute("data-control",e.type.toString());var a=t.getComponent(s,n.Button);a.setProperties({cssClass:a.cssClass+" "+Ne}),s.onclick=function(t){e.buttonSettings.clicked&&e.buttonSettings.clicked.call(r,t),i.toggle()}},o.prototype.removeOverFlowEvents=function(e,o){var i=this,r=o.querySelector("#"+e.id),s=t.getComponent(r,n.Button),a=s.cssClass.split(" ");a=a.filter(function(e){return e!==Ne}),s.setProperties({cssClass:a.join(" ")}),r.onclick=function(t){e.buttonSettings.clicked&&e.buttonSettings.clicked.call(i,t)}},o.prototype.click=function(e){var o=f(this.parent,e);if(o){t.getComponent(o,n.Button).click()}},o.prototype.updateButton=function(o,i){var r=c(this.parent.tabs,i);if(r){t.merge(r.item.buttonSettings,o);var s=f(this.parent,i,r);if(s){var a=t.getComponent(s,n.Button);o.isToggle&&s.classList.add("e-active"),o.cssClass&&(o.cssClass=(Re+" "+ze+" "+o.cssClass).trim()),o.content&&(o.content=r.item.activeSize===e.RibbonItemSize.Small?"":o.content,s.setAttribute("aria-label",o.content)),delete o.clicked,a.setProperties(o)}}},o.prototype.updateButtonSize=function(o,i){t.getComponent(o,n.Button).setProperties({iconPosition:i.activeSize===e.RibbonItemSize.Large?"Top":"Left",content:i.activeSize===e.RibbonItemSize.Small?"":i.buttonSettings.content})},o}(),bo=function(){return(bo=Object.assign||function(e){for(var t,o=1,i=arguments.length;o<i;o++){t=arguments[o];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e}).apply(this,arguments)},mo=function(){function e(e){this.parent=e}return e.prototype.getModuleName=function(){return"ribbonCheckBox"},e.prototype.destroy=function(){this.parent=null},e.prototype.createCheckBox=function(e,t){var o=this,i=this.parent.createElement("input",{id:e.id});t.appendChild(i);var r=e.checkBoxSettings,s={};r.htmlAttributes&&(s=bo({},r.htmlAttributes)).id&&delete s.id,new n.CheckBox({locale:this.parent.locale,enableRtl:this.parent.enableRtl,enablePersistence:this.parent.enablePersistence,checked:r.checked,cssClass:(ze+" "+(r.cssClass?r.cssClass:"")).trim(),label:r.label,labelPosition:r.labelPosition,disabled:e.disabled,created:r.created,htmlAttributes:s,change:function(e){r.change&&r.change.call(o,e)}},i)},e.prototype.addOverFlowEvents=function(e,o,i){var r=this,s=o.querySelector("#"+e.id);s.setAttribute("data-control",e.type.toString());var a=t.getComponent(s,n.CheckBox);a.cssClass=a.cssClass+" "+Ne,a.dataBind(),a.change=function(t){e.checkBoxSettings.change&&e.checkBoxSettings.change.call(r,t),i.toggle()}},e.prototype.removeOverFlowEvents=function(e,o){var i=this,r=o.querySelector("#"+e.id),s=t.getComponent(r,n.CheckBox),a=s.cssClass.split(" ");a=a.filter(function(e){return e!==Ne}),s.cssClass=a.join(" "),s.dataBind(),s.change=function(t){e.checkBoxSettings.change&&e.checkBoxSettings.change.call(i,t)}},e.prototype.click=function(e){var o=f(this.parent,e);if(o){t.getComponent(o,n.CheckBox).click()}},e.prototype.updateCheckBox=function(e,o){var i=c(this.parent.tabs,o);if(i){t.merge(i.item.checkBoxSettings,e);var r=f(this.parent,o,i);if(r){e.cssClass&&(e.cssClass=(ze+" "+e.cssClass).trim()),delete e.change;t.getComponent(r,n.CheckBox).setProperties(e)}}},e}(),fo=function(){return(fo=Object.assign||function(e){for(var t,o=1,i=arguments.length;o<i;o++){t=arguments[o];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e}).apply(this,arguments)},yo=function(){function e(e){this.parent=e}return e.prototype.getModuleName=function(){return"ribbonColorPicker"},e.prototype.destroy=function(){this.parent=null},e.prototype.createColorPicker=function(e,o){var i=this,r=this.parent.createElement("input",{id:e.id});o.appendChild(r);var n=e.colorPickerSettings,a=new s.ColorPicker({locale:this.parent.locale,enableRtl:this.parent.enableRtl,enablePersistence:this.parent.enablePersistence,columns:n.columns,cssClass:(ze+" "+(n.cssClass?n.cssClass:"")).trim(),disabled:e.disabled,enableOpacity:n.enableOpacity,mode:n.mode,modeSwitcher:n.modeSwitcher,noColor:n.noColor,presetColors:n.presetColors,showButtons:n.showButtons,value:n.value,beforeClose:function(){a.element.parentElement.classList.remove(He),n.beforeClose&&n.beforeClose.call(i)},beforeOpen:n.beforeOpen,beforeTileRender:n.beforeTileRender,created:n.created,change:function(e){n.value=e.value.toString(),n.change&&n.change.call(i,e)},open:function(){a.element.parentElement.classList.add(He),n.open&&n.open.call(i)},select:n.select},r);if(n.htmlAttributes){var l=fo({},n.htmlAttributes);l.id&&delete l.id,C(r,l)}var p=a.element.parentElement;t.EventHandler.add(p,"mouseenter",this.toggleWrapperHover.bind(this,p,!0),this),t.EventHandler.add(p,"mouseleave",this.toggleWrapperHover.bind(this,p,!1),this)},e.prototype.toggleWrapperHover=function(e,t){t?e.classList.add(Ge):e.classList.remove(Ge)},e.prototype.addOverFlowEvents=function(e,o,i){var r=this,n=e.colorPickerSettings;if(n.label&&"Simplified"===this.parent.activeLayout){var a=this.parent.createElement("div",{className:"e-ribbon-colorpicker-label",id:e.id+"_label",innerHTML:n.label});o.insertBefore(a,o.firstChild)}var l=o.querySelector("#"+e.id);l.setAttribute("data-control",e.type.toString());var p=t.getComponent(l,s.ColorPicker);p.setProperties({cssClass:p.cssClass+" "+Ne});var c,u=p.splitBtn;p.beforeClose=function(t){c=t.event?t.event.target:null,p.element.parentElement.classList.remove(He),e.colorPickerSettings.beforeClose&&e.colorPickerSettings.beforeClose.call(r)},u.close=function(){c&&!c.closest(".e-ribbon-group-overflow-ddb")&&i.toggle()}},e.prototype.removeOverFlowEvents=function(e,o){var i=this;if(e.colorPickerSettings.label){var r=o.querySelector("#"+e.id+"_label");r&&r.remove()}var n=o.querySelector("#"+e.id),a=t.getComponent(n,s.ColorPicker),l=a.cssClass.split(" ");l=l.filter(function(e){return e!==Ne}),a.setProperties({cssClass:l.join(" ")});a.splitBtn.close=null,a.beforeClose=function(){a.element.parentElement.classList.remove(He),e.colorPickerSettings.beforeClose&&e.colorPickerSettings.beforeClose.call(i)}},e.prototype.getColorPickerObj=function(e){var o=f(this.parent,e);return o?t.getComponent(o,s.ColorPicker):null},e.prototype.getValue=function(e,t,o){var i=this.getColorPickerObj(e);return i?i.getValue(t,o):""},e.prototype.toggle=function(e){var t=this.getColorPickerObj(e);t&&t.toggle()},e.prototype.updateColorPicker=function(e,o){var i=c(this.parent.tabs,o);if(i){t.merge(i.item.checkBoxSettings,e);var r=f(this.parent,o,i);if(r){e.cssClass&&(e.cssClass=(ze+" "+e.cssClass).trim()),delete e.beforeClose,delete e.open;t.getComponent(r,s.ColorPicker).setProperties(e)}}},e.prototype.unwireColorPickerEvents=function(e){var o=t.getComponent(e,s.ColorPicker).element.parentElement;t.EventHandler.remove(o,"mouseenter",this.toggleWrapperHover),t.EventHandler.remove(o,"mouseleave",this.toggleWrapperHover)},e}(),go=function(){return(go=Object.assign||function(e){for(var t,o=1,i=arguments.length;o<i;o++){t=arguments[o];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e}).apply(this,arguments)},vo=function(){function e(e){this.parent=e}return e.prototype.getModuleName=function(){return"ribbonComboBox"},e.prototype.destroy=function(){this.parent=null},e.prototype.createComboBox=function(e,t){var o=this,r=this.parent.createElement("input",{id:e.id});t.appendChild(r);var n=e.comboBoxSettings,s={};n.htmlAttributes&&(s=go({},n.htmlAttributes)).id&&delete s.id,new i.ComboBox({locale:this.parent.locale,enableRtl:this.parent.enableRtl,enablePersistence:this.parent.enablePersistence,allowCustom:!1,floatLabelType:"Never",ignoreAccent:!0,ignoreCase:!0,allowFiltering:n.allowFiltering,autofill:n.autofill,cssClass:(ze+" "+(n.cssClass?n.cssClass:"")).trim(),dataSource:n.dataSource,enabled:!e.disabled,fields:n.fields,filterType:n.filterType,footerTemplate:n.footerTemplate,groupTemplate:n.groupTemplate,headerTemplate:n.headerTemplate,index:n.index,itemTemplate:n.itemTemplate,noRecordsTemplate:n.noRecordsTemplate,placeholder:n.placeholder,popupHeight:n.popupHeight,popupWidth:n.popupWidth,showClearButton:n.showClearButton,sortOrder:n.sortOrder,text:n.text,value:n.value,width:n.width,beforeOpen:n.beforeOpen,open:n.open,htmlAttributes:s,close:function(e){n.close&&n.close.call(o,e)},filtering:n.filtering,change:n.change,select:n.select,created:n.created},r)},e.prototype.addOverFlowEvents=function(e,o,r){var n=this,s=e.comboBoxSettings;if(s.label&&"Simplified"===this.parent.activeLayout){var a=this.parent.createElement("div",{className:"e-ribbon-combobox-label",id:e.id+"_label",innerHTML:s.label});o.insertBefore(a,o.firstChild)}var l=o.querySelector("#"+e.id);l.setAttribute("data-control",e.type.toString());var p=t.getComponent(l,i.ComboBox);p.setProperties({cssClass:p.cssClass+" "+Ne}),p.close=function(t){var o=t.event?t.event.target:null;e.comboBoxSettings.close&&e.comboBoxSettings.close.call(n,t),o&&!o.closest(".e-ribbon-group-overflow-ddb")&&r.toggle()}},e.prototype.removeOverFlowEvents=function(e,o){var r=this;if(e.comboBoxSettings.label){var n=o.querySelector("#"+e.id+"_label");n&&n.remove()}var s=o.querySelector("#"+e.id),a=t.getComponent(s,i.ComboBox),l=a.cssClass.split(" ");l=l.filter(function(e){return e!==Ne}),a.setProperties({cssClass:l.join(" ")}),a.close=function(t){e.comboBoxSettings.close&&e.comboBoxSettings.close.call(r,t)}},e.prototype.getComboBoxObj=function(e){var o=f(this.parent,e);return o?t.getComponent(o,i.ComboBox):null},e.prototype.filter=function(e,t,o,i){this.getComboBoxObj(e).filter(t,o,i)},e.prototype.hidePopup=function(e){var t=this.getComboBoxObj(e);t&&t.hidePopup()},e.prototype.showPopup=function(e){var t=this.getComboBoxObj(e);t&&t.showPopup()},e.prototype.updateComboBox=function(e,o){var r=c(this.parent.tabs,o);if(r){t.merge(r.item.comboBoxSettings,e);var n=f(this.parent,o,r);if(n){e.cssClass&&(e.cssClass=(ze+" "+e.cssClass).trim()),delete e.close;t.getComponent(n,i.ComboBox).setProperties(e)}}},e}(),So=function(){return(So=Object.assign||function(e){for(var t,o=1,i=arguments.length;o<i;o++){t=arguments[o];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e}).apply(this,arguments)},Io=function(){function o(e){this.parent=e}return o.prototype.getModuleName=function(){return"ribbonDropDown"},o.prototype.destroy=function(){this.parent=null},o.prototype.createDropDown=function(t,o){var i=this,n=this.parent.createElement("button",{id:t.id});o.appendChild(n);var s=t.dropDownSettings,a=(Re+" "+ze+" "+(s.cssClass?s.cssClass:"")).trim();if(new r.DropDownButton({locale:this.parent.locale,enableRtl:this.parent.enableRtl,enablePersistence:this.parent.enablePersistence,iconPosition:t.activeSize===e.RibbonItemSize.Large?"Top":"Left",closeActionEvents:s.closeActionEvents,content:t.activeSize===e.RibbonItemSize.Small?"":s.content,cssClass:a+(t.activeSize===e.RibbonItemSize.Large?" "+qe:""),disabled:t.disabled,iconCss:s.iconCss,items:s.items,target:s.target,createPopupOnClick:s.createPopupOnClick,beforeClose:function(e){s.beforeClose&&s.beforeClose.call(i,e)},beforeItemRender:s.beforeItemRender,beforeOpen:s.beforeOpen,close:function(e){s.close&&s.close.call(i,e)},created:s.created,open:s.open,select:s.select}).appendTo(n),s.htmlAttributes){var l=So({},s.htmlAttributes);l.id&&delete l.id,C(n,l)}},o.prototype.addOverFlowEvents=function(e,o,i){var n=this,s=o.querySelector("#"+e.id);s.setAttribute("data-control",e.type.toString());var a=t.getComponent(s,r.DropDownButton);a.cssClass=a.cssClass+" "+Ne,a.dataBind();var l;a.beforeClose=function(t){e.dropDownSettings.beforeClose&&e.dropDownSettings.beforeClose.call(n,t),l=t.event?t.event.target:null},a.close=function(t){e.dropDownSettings.close&&e.dropDownSettings.close.call(n,t),l&&!l.closest(".e-ribbon-group-overflow-ddb")&&i.toggle()}},o.prototype.removeOverFlowEvents=function(e,o){var i=this,n=o.querySelector("#"+e.id),s=t.getComponent(n,r.DropDownButton),a=s.cssClass.split(" ");a=a.filter(function(e){return e!==Ne}),s.cssClass=a.join(" "),s.dataBind(),s.close=function(t){e.dropDownSettings.close&&e.dropDownSettings.close.call(i,t)},s.beforeClose=function(t){e.dropDownSettings.beforeClose&&e.dropDownSettings.beforeClose.call(i,t)}},o.prototype.createOverFlowDropDown=function(e,o,i,n,s,a){var l=this;this.enableRtl=a;var p=this.parent.createElement("button",{id:e+eo+to});n.setAttribute("tabindex","0"),s.appendChild(p);var c=new r.DropDownButton({iconCss:i,target:n,locale:this.parent.locale,enableRtl:this.parent.enableRtl,enablePersistence:this.parent.enablePersistence,cssClass:qe+" "+yt,iconPosition:"Top",content:o,beforeClose:function(e){e.cancel=!t.isNullOrUndefined(e.event&&t.closest(e.event.target,"."+Ne))}},p);return v(n,this.parent),p.onclick=p.onkeydown=function(){l.itemIndex=0},n.onkeydown=function(e){l.keyActionHandler(e,n)},c},o.prototype.keyActionHandler=function(e,t){var o,i=Array.prototype.slice.call(t.querySelectorAll(".e-control")),r=Array.prototype.slice.call(t.querySelectorAll(".e-ribbon-template")),n=i.concat(r),s=t.querySelectorAll(".e-combobox");if(s)for(var a=0;a<s.length;a++)s[parseInt(a.toString(),10)].closest(".e-input-focus")&&(o=s[parseInt(a.toString(),10)]);if(o)for(a=0;a<n.length;a++)n[parseInt(a.toString(),10)].classList.contains("e-combobox")&&n[parseInt(a.toString(),10)].closest(".e-input-focus")&&(this.itemIndex=a);(e.target.classList.contains("e-control")||e.target.classList.contains("e-ribbon-template")||e.target.classList.contains("e-ribbon-launcher-icon")||e.target.classList.contains("e-ribbon-last-item")||e.target.classList.contains("e-ribbon-first-item"))&&(("ArrowRight"===e.key||!e.shiftKey&&"Tab"===e.key)&&this.handleNavigation(e,!this.enableRtl,n),("ArrowLeft"===e.key||e.shiftKey&&"Tab"===e.key)&&this.handleNavigation(e,this.enableRtl,n))},o.prototype.handleNavigation=function(e,t,o){if(o[0].classList.contains("e-ribbon-first-item")||o[0].classList.add("e-ribbon-first-item"),o[o.length-1].classList.contains("e-ribbon-last-item")||o[o.length-1].classList.add("e-ribbon-last-item"),t){if(0===this.itemIndex&&o[parseInt(this.itemIndex.toString(),10)].classList.contains("e-ribbon-first-item")&&this.updateItemIndex(e,o,!0),e.target.classList.contains("e-combobox")||e.target.classList.contains("e-ribbon-last-item")||e.target.classList.contains("e-ribbon-group-container")||!e.target.classList.contains("e-ribbon-first-item")&&0===this.itemIndex||!e.target.classList.contains("e-control")&&!e.target.classList.contains("e-ribbon-template")||(this.itemIndex++,this.updateItemIndex(e,o,!0)),e.target.classList.contains("e-ribbon-last-item")){this.focusLauncherIcon(e,o)||(this.itemIndex=0,this.updateItemIndex(e,o,!0))}e.target.classList.contains("e-ribbon-launcher-icon")&&(this.itemIndex=0,this.updateItemIndex(e,o,!0))}else{if(e.target.classList.contains("e-combobox")||0===this.itemIndex||(this.itemIndex--,this.updateItemIndex(e,o,!1)),e.target.classList.contains("e-ribbon-first-item")){this.focusLauncherIcon(e,o)||(this.itemIndex=o.length-1,this.updateItemIndex(e,o,!1))}e.target.classList.contains("e-ribbon-launcher-icon")&&(this.itemIndex=o.length-1,this.updateItemIndex(e,o,!1))}e.target.classList.contains("e-combobox")&&"Tab"===e.key&&(t?this.itemIndex<o.length-1&&this.itemIndex++:this.itemIndex>0&&this.itemIndex--)},o.prototype.focusLauncherIcon=function(e,t){var o,i=t[parseInt(this.itemIndex.toString(),10)].closest(".e-ribbon-group-container");return i&&(o=i.querySelector(".e-ribbon-launcher-icon")),!!o&&("Tab"===e.key&&e.preventDefault(),i.querySelector(".e-ribbon-launcher-icon").focus(),!0)},o.prototype.updateItemIndex=function(e,t,o){for(var i=t[this.itemIndex].closest(".e-ribbon-item");i&&i.classList.contains("e-disabled");){if(o)if(this.itemIndex<t.length-1)this.itemIndex++;else{if(this.focusLauncherIcon(e,t))break;this.itemIndex=0}else if(this.itemIndex>0)this.itemIndex--;else{if(this.focusLauncherIcon(e,t))break;this.itemIndex=t.length-1}i=t[this.itemIndex].closest(".e-ribbon-item")}"Tab"===e.key&&e.preventDefault(),t[parseInt(this.itemIndex.toString(),10)].focus()},o.prototype.removeOverFlowDropDown=function(e){var o=t.getComponent(e,r.DropDownButton);t.getComponent(o.target,a.Tooltip).destroy(),e.parentElement.parentElement.insertBefore(o.target,e.parentElement),o.destroy(),t.remove(e)},o.prototype.getDDBItemElement=function(e,o){return t.getComponent(e,r.DropDownButton).dropDown.element.querySelector("#"+o)},o.prototype.getOverflowDropDownPopup=function(e,o){var i=o.querySelector("#"+this.parent.tabs[e.tabIndex].groups[e.groupIndex].id+eo+to);return t.getComponent(i,r.DropDownButton).dropDown.element},o.prototype.getDropDownObj=function(e){var o=f(this.parent,e);return o?t.getComponent(o,r.DropDownButton):null},o.prototype.addItems=function(e,t,o){this.getDropDownObj(e).addItems(t,o)},o.prototype.removeItems=function(e,t,o){this.getDropDownObj(e).removeItems(t,o)},o.prototype.toggle=function(e){this.getDropDownObj(e).toggle()},o.prototype.updateDropDown=function(o,i){var n=c(this.parent.tabs,i);if(n){t.merge(n.item.dropDownSettings,o);var s=f(this.parent,i,n);if(s){var a=t.getComponent(s,r.DropDownButton);o.cssClass&&(o.cssClass=(ze+" "+Re+" "+o.cssClass).trim(),o.cssClass=n.item.activeSize===e.RibbonItemSize.Large?(qe+" "+o.cssClass).trim():o.cssClass,a.cssClass=o.cssClass),delete o.close,delete o.beforeClose,o.content&&(o.content=n.item.activeSize===e.RibbonItemSize.Small?"":o.content),a.setProperties(o)}}},o.prototype.updateDropDownSize=function(o,i){var n=t.getComponent(o,r.DropDownButton),s=n.cssClass.split(" ");i.activeSize===e.RibbonItemSize.Large?s.push(qe):s=s.filter(function(e){return e!==qe}),n.cssClass=s.join(" "),n.setProperties({iconPosition:i.activeSize===e.RibbonItemSize.Large?"Top":"Left"}),n.setProperties({content:i.activeSize===e.RibbonItemSize.Small?"":i.dropDownSettings.content})},o}(),Co=function(){return(Co=Object.assign||function(e){for(var t,o=1,i=arguments.length;o<i;o++){t=arguments[o];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e}).apply(this,arguments)},To=function(){function o(e){this.parent=e}return o.prototype.getModuleName=function(){return"ribbonSplitButton"},o.prototype.destroy=function(){this.parent=null},o.prototype.createSplitButton=function(o,i){var n=this,s=this.parent.createElement("button",{id:o.id});i.appendChild(s);var a=o.splitButtonSettings,l=(Re+" "+ze+" "+(a.cssClass?a.cssClass:"")).trim(),p=new r.SplitButton({locale:this.parent.locale,enableRtl:this.parent.enableRtl,enablePersistence:this.parent.enablePersistence,iconPosition:o.activeSize===e.RibbonItemSize.Large?"Top":"Left",closeActionEvents:a.closeActionEvents,cssClass:l+(o.activeSize===e.RibbonItemSize.Large?" "+qe:""),disabled:o.disabled,iconCss:a.iconCss,items:a.items,target:a.target,beforeClose:function(e){a.beforeClose&&a.beforeClose.call(n,e)},beforeItemRender:a.beforeItemRender,beforeOpen:a.beforeOpen,close:function(){p.wrapper.classList.remove(He),a.close&&a.close.call(n)},created:a.created,open:function(){p.wrapper.classList.add(He),a.open&&a.open.call(n)},select:a.select,click:function(e){a.click&&a.click.call(n,e)}},s);if(a.htmlAttributes){var c=Co({},a.htmlAttributes);c.id&&delete c.id,C(s,c)}var u=s.parentElement.querySelector(".e-dropdown-btn");u.onkeydown=function(e){"Enter"===e.key&&(e.stopImmediatePropagation(),u.click())},this.setContent(o,p);var d=p.wrapper;t.EventHandler.add(d,"mouseenter",function(){d.classList.add(Ge)},this),t.EventHandler.add(d,"mouseleave",function(){d.classList.remove(Ge)},this)},o.prototype.addOverFlowEvents=function(e,o,i){var n=this,s=o.querySelector("#"+e.id);s.setAttribute("data-control",e.type.toString());var a=t.getComponent(s,r.SplitButton);a.cssClass=a.cssClass+" "+Ne,a.dataBind();var l=s.parentElement.querySelector(".e-dropdown-btn"),p=l.getAttribute("id"),c=document.querySelector("#"+p+"-popup");l.onkeydown=function(e){"Enter"===e.key&&(e.stopImmediatePropagation(),l.click())},c.onkeydown=function(e){"Enter"===e.key&&(e.preventDefault(),a.wrapper.classList.remove("e-ribbon-open"),c.querySelector(".e-focused").click())};var u;a.beforeClose=function(t){e.splitButtonSettings.beforeClose&&e.splitButtonSettings.beforeClose.call(n,t),u=t.event?t.event.target:null},a.click=function(t){e.splitButtonSettings.click&&e.splitButtonSettings.click.call(n,t),i.toggle()},a.close=function(t){e.splitButtonSettings.close&&e.splitButtonSettings.close.call(n,t),a.wrapper.classList.remove(He),u&&!u.closest(".e-ribbon-group-overflow-ddb")&&i.toggle()}},o.prototype.removeOverFlowEvents=function(e,o){var i=this,n=o.querySelector("#"+e.id),s=t.getComponent(n,r.SplitButton),a=s.cssClass.split(" ");a=a.filter(function(e){return e!==Ne}),s.cssClass=a.join(" "),s.dataBind(),s.beforeClose=function(t){e.splitButtonSettings.beforeClose&&e.splitButtonSettings.beforeClose.call(i,t)},s.click=function(t){e.splitButtonSettings.click&&e.splitButtonSettings.click.call(i,t)},s.close=function(t){e.splitButtonSettings.close&&e.splitButtonSettings.close.call(i,t),s.wrapper.classList.remove(He)}},o.prototype.setContent=function(t,o){o.primaryBtnObj.setProperties({content:t.activeSize===e.RibbonItemSize.Medium?t.splitButtonSettings.content:""}),o.secondaryBtnObj.setProperties({content:t.activeSize===e.RibbonItemSize.Large?t.splitButtonSettings.content:""})},o.prototype.getSplitButtonObj=function(e){var o=f(this.parent,e);return t.getComponent(o,r.SplitButton)},o.prototype.addItems=function(e,t,o){this.getSplitButtonObj(e).addItems(t,o)},o.prototype.removeItems=function(e,t,o){this.getSplitButtonObj(e).removeItems(t,o)},o.prototype.toggle=function(e){this.getSplitButtonObj(e).toggle()},o.prototype.updateSplitButton=function(o,i){var n=c(this.parent.tabs,i);if(n){t.merge(n.item.splitButtonSettings,o);var s=f(this.parent,i,n);if(s){var a=t.getComponent(s,r.SplitButton);o.cssClass&&(o.cssClass=(ze+" "+Re+" "+o.cssClass).trim(),o.cssClass=n.item.activeSize===e.RibbonItemSize.Large?(qe+" "+o.cssClass).trim():o.cssClass,a.cssClass=o.cssClass),delete o.open,delete o.click,delete o.close,delete o.beforeClose,a.setProperties(o),o.content&&this.setContent(n.item,a)}}},o.prototype.updateSplitButtonSize=function(o,i){var n=t.getComponent(o,r.SplitButton),s=n.cssClass.split(" ");i.activeSize===e.RibbonItemSize.Large?s.push(qe):s=s.filter(function(e){return e!==qe}),n.cssClass=s.join(" "),n.setProperties({iconPosition:i.activeSize===e.RibbonItemSize.Large?"Top":"Left"}),this.setContent(i,n)},o}(),wo=function(){function o(e){this.parent=e,this.isSelected=!1}return o.prototype.getModuleName=function(){return"ribbonGroupButton"},o.prototype.destroy=function(){this.parent=null},o.prototype.createGroupButton=function(o,i){var s=this,a=o.groupButtonSettings;this.count=0;var l=this.parent.createElement("div",{id:o.id+ao,className:"e-btn-group"});i.appendChild(l);for(var p=0;p<a.items.length;p++)if(a.items[parseInt(p.toString(),10)].iconCss){var c=this.parent.createElement("button",{id:o.id+ao+p,className:at});l.appendChild(c),new n.Button({iconCss:a.items[parseInt(p.toString(),10)].iconCss,disabled:o.disabled,enableRtl:this.parent.enableRtl,content:o.activeSize===e.RibbonItemSize.Small?"":a.items[parseInt(p.toString(),10)].content,iconPosition:o.activeSize===e.RibbonItemSize.Large?"Top":"Left"},c),a.items[parseInt(p.toString(),10)].htmlAttributes&&C(c,a.items[parseInt(p.toString(),10)].htmlAttributes),a.items[parseInt(p.toString(),10)].content&&c.classList.add(pt);var u=i.querySelector("#"+o.id+ao+p);a.selection===e.RibbonGroupButtonSelection.Single?l.classList.add(nt):l.classList.add(st),a.items[parseInt(p.toString(),10)].selected&&(a.selection===e.RibbonGroupButtonSelection.Multiple?u.classList.add("e-active"):this.count<1&&(u.classList.add("e-active"),this.count++)),a.items[parseInt(p.toString(),10)].ribbonTooltipSettings&&y(a.items[parseInt(p.toString(),10)].ribbonTooltipSettings)&&(c.classList.add(Rt),this.parent.tooltipData.push({id:c.id,data:a.items[parseInt(p.toString(),10)].ribbonTooltipSettings})),t.EventHandler.add(u,"click",this.groupButtonClicked.bind(this,p,o,a),this)}if("Simplified"===this.parent.activeLayout){var d=void 0,h=0,b=0;u=this.parent.createElement("button",{id:o.id});i.appendChild(u);for(p=0;p<a.items.length;p++)o.groupButtonSettings.items[parseInt(p.toString(),10)].selected&&!this.isSelected&&a.selection===e.RibbonGroupButtonSelection.Single?(d=o.groupButtonSettings.items[parseInt(p.toString(),10)].iconCss,this.isSelected=!0):o.groupButtonSettings.items[parseInt(p.toString(),10)].selected&&a.selection===e.RibbonGroupButtonSelection.Multiple&&(d=1===++h?o.groupButtonSettings.items[parseInt(p.toString(),10)].iconCss:null);for(;b<o.groupButtonSettings.items.length&&!this.isSelected&&!d;)o.groupButtonSettings.items[parseInt(b.toString(),10)].iconCss&&(d=o.groupButtonSettings.items[parseInt(b.toString(),10)].iconCss,this.isSelected=!0),b++;var m=new r.DropDownButton({iconCss:d,target:l,enableRtl:this.parent.enableRtl,cssClass:"e-ribbon-dropdown-group-button",disabled:o.disabled},u);if(a.header){var f=m.dropDown;this.addGroupButtonHeader(o.id,a,f.element)}u.onclick=u.onkeydown=function(){s.handleFocusState(o,i)},l.onkeydown=function(e){"Simplified"===s.parent.activeLayout&&s.handleGroupButtonNavigation(e,o)},v(l,this.parent),this.isSelected=!1}},o.prototype.groupButtonClicked=function(o,i,n){for(var s,a,l=[],p=[],c=[],u=0;u<n.items.length;u++)document.querySelector("#"+i.id+ao+u)&&document.querySelector("#"+i.id+ao+u).classList.contains("e-active")&&l.push(n.items[parseInt(u.toString(),10)]);document.querySelector("#"+i.id+ao+o).classList.contains("e-active")||p.push(n.items[parseInt(o.toString(),10)]);var d={cancel:!1,previousItems:l,selectingItems:p};if(n.items[parseInt(o.toString(),10)].beforeClick&&n.items[parseInt(o.toString(),10)].beforeClick.call(this,d),!d.cancel){if(n.selection===e.RibbonGroupButtonSelection.Single){document.querySelector("#"+i.id+ao).classList.contains(st)&&(document.querySelector("#"+i.id+ao).classList.remove(st),document.querySelector("#"+i.id+ao).classList.add(nt));for(u=0;u<n.items.length;u++)document.querySelector("#"+i.id+ao+u)&&document.querySelector("#"+i.id+ao+u).classList.contains("e-active")&&(document.querySelector("#"+i.id+ao+u).classList.remove("e-active"),n.items[parseInt(u.toString(),10)].setProperties({selected:!1},!0));document.querySelector("#"+i.id+ao+o).classList.toggle("e-active"),n.items[parseInt(o.toString(),10)].setProperties({selected:!0},!0),document.querySelector("#"+i.id+ao+o).classList.contains("e-active")&&"Simplified"===this.parent.activeLayout&&(this.grpBtnIndex=o,s=document.querySelector("#"+i.id),(a=t.getComponent(s,r.DropDownButton)).setProperties({iconCss:n.items[parseInt(o.toString(),10)].iconCss}))}else{document.querySelector("#"+i.id+ao).classList.contains(nt)&&(document.querySelector("#"+i.id+ao).classList.remove(nt),document.querySelector("#"+i.id+ao).classList.add(st)),document.querySelector("#"+i.id+ao+o).classList.toggle("e-active"),document.querySelector("#"+i.id+ao+o).classList.contains("e-active")?n.items[parseInt(o.toString(),10)].setProperties({selected:!0},!0):n.items[parseInt(o.toString(),10)].setProperties({selected:!1},!0);for(var h=0,b=0;b<n.items.length;b++)document.querySelector("#"+i.id+ao+b)&&document.querySelector("#"+i.id+ao+b).classList.contains("e-active")&&"Simplified"===this.parent.activeLayout&&b!==o&&(this.isSelected=!0,h++);if("Simplified"===this.parent.activeLayout){var m=null,f=0;if(s=document.querySelector("#"+i.id),a=t.getComponent(s,r.DropDownButton),this.isSelected){if(1===h&&!document.querySelector("#"+i.id+ao+o).classList.contains("e-active"))for(b=0;b<n.items.length;b++)document.querySelector("#"+i.id+ao+b)&&document.querySelector("#"+i.id+ao+b).classList.contains("e-active")&&(m=n.items[parseInt(b.toString(),10)].iconCss)}else document.querySelector("#"+i.id+ao+o).classList.contains("e-active")&&(m=n.items[parseInt(o.toString(),10)].iconCss);for(;f<n.items.length&&!m;)n.items[parseInt(f.toString(),10)].iconCss&&(m=n.items[parseInt(f.toString(),10)].iconCss),f++;a.setProperties({iconCss:m}),this.grpBtnIndex=o}this.isSelected=!1}document.querySelector("#"+i.id+ao+o).classList.contains("e-active")&&c.push(n.items[parseInt(o.toString(),10)]);var y={previousItems:l,selectedItems:c};n.items[parseInt(o.toString(),10)].click&&n.items[parseInt(o.toString(),10)].click.call(this,y)}},o.prototype.switchGroupButton=function(o,i){var n=this,s=o.groupButtonSettings,a=null,l=0,p=0;if("Simplified"===this.parent.activeLayout){var c=i.querySelector("#"+o.id+ao),u=this.parent.createElement("button",{id:o.id});i.appendChild(u);for(var d=0;d<s.items.length;d++)document.querySelector("#"+o.id+ao+d)&&(document.querySelector("#"+o.id+ao+d).classList.contains("e-active")&&s.selection===e.RibbonGroupButtonSelection.Single?a=s.items[parseInt(d.toString(),10)].iconCss:document.querySelector("#"+o.id+ao+d).classList.contains("e-active")&&s.selection===e.RibbonGroupButtonSelection.Multiple&&(1===++l?a=s.items[parseInt(d.toString(),10)].iconCss:l>1&&(a=null)));for(;p<s.items.length&&!a;)s.items[parseInt(p.toString(),10)].iconCss&&(a=s.items[parseInt(p.toString(),10)].iconCss),p++;var h=new r.DropDownButton({iconCss:a,target:c,enableRtl:this.parent.enableRtl,cssClass:"e-ribbon-dropdown-group-button",disabled:o.disabled},u);if(s.header){var b=h.dropDown;this.addGroupButtonHeader(o.id,s,b.element)}u.onclick=u.onkeydown=function(){n.handleFocusState(o,i)},c.onkeydown=function(e){"Simplified"===n.parent.activeLayout&&n.handleGroupButtonNavigation(e,o)},v(c,this.parent)}else{var m=i.querySelector("#"+o.id);h=t.getComponent(m,r.DropDownButton);i.appendChild(h.target),m&&(h.destroy(),t.remove(m))}},o.prototype.handleFocusState=function(e,t){if(t.querySelector("#"+e.id).classList.contains("e-active")){var o=document.querySelector("#"+e.id+"_grpbtn").querySelector("."+at+".e-active");o?o.focus():document.querySelector("#"+e.id+ao+0).focus(),this.grpBtnIndex=0}},o.prototype.addGroupButtonHeader=function(e,t,o){var i=this.parent.createElement("div",{className:"e-ribbon-groupbutton-header",id:e+Zt,innerHTML:t.header});o.insertBefore(i,o.firstChild)},o.prototype.handleGroupButtonNavigation=function(e,o){var i=document.querySelector("#"+o.id),n=t.getComponent(i,r.DropDownButton).target,s=!1;"Simplified"===this.parent.activeLayout&&n.closest(".e-ribbon-dropdown-group-button").classList.contains(lt)&&(s=!0),"Tab"===e.key&&e.preventDefault();var a=o.groupButtonSettings;"ArrowRight"===e.key&&!s||"ArrowDown"===e.key&&s?!this.parent.enableRtl||"ArrowDown"===e.key&&s?(this.grpBtnIndex++,this.grpBtnIndex<a.items.length?document.querySelector("#"+o.id+ao+this.grpBtnIndex).focus():(this.grpBtnIndex=0,document.querySelector("#"+o.id+ao+this.grpBtnIndex).focus())):0===this.grpBtnIndex?(this.grpBtnIndex=a.items.length-1,document.querySelector("#"+o.id+ao+this.grpBtnIndex).focus()):(this.grpBtnIndex--,document.querySelector("#"+o.id+ao+this.grpBtnIndex).focus()):("ArrowLeft"===e.key&&!s||"ArrowUp"===e.key&&s)&&(!this.parent.enableRtl||"ArrowUp"===e.key&&s?0===this.grpBtnIndex?(this.grpBtnIndex=a.items.length-1,document.querySelector("#"+o.id+ao+this.grpBtnIndex).focus()):(this.grpBtnIndex--,document.querySelector("#"+o.id+ao+this.grpBtnIndex).focus()):(this.grpBtnIndex++,this.grpBtnIndex<a.items.length?document.querySelector("#"+o.id+ao+this.grpBtnIndex).focus():(this.grpBtnIndex=0,document.querySelector("#"+o.id+ao+this.grpBtnIndex).focus())))},o.prototype.addOverFlowEvents=function(e,o,i){var n=this,s=e.groupButtonSettings,a=!0,l=o.querySelector("#"+e.id),p=t.getComponent(l,r.DropDownButton);p.setProperties({cssClass:p.cssClass+" "+lt,content:s.header?s.header:""});var c=p.target;if(c.children.length){for(var u=0;u<c.children.length;u++)if(s.items[parseInt(u.toString(),10)].content){a=!1;break}a&&c.classList.add("e-icon-btn")}c.onclick=function(){"Simplified"===n.parent.activeLayout&&c.closest(".e-ribbon-dropdown-group-button").classList.contains(lt)&&(p.toggle(),i.toggle())}},o.prototype.removeOverFlowEvents=function(e,o){var i=o.querySelector("#"+e.id);if(i){var n=t.getComponent(i,r.DropDownButton),s=n.target;s.classList.contains("e-icon-btn")&&s.classList.remove("e-icon-btn");var a=n.cssClass.split(" ");a=a.filter(function(e){return e!==lt}),n.setProperties({cssClass:a.join(" "),content:""})}},o.prototype.destroyDropDown=function(e){var o=document.querySelector("#"+e.id);if(o){var i=t.getComponent(o,r.DropDownButton);t.getComponent(i.target,a.Tooltip).destroy(),i.destroy(),t.remove(o)}},o.prototype.updateGroupButtonSize=function(o,i){for(var r,s=i.groupButtonSettings,a=0;a<s.items.length;a++)if(r="Classic"===this.parent.activeLayout?o.querySelector("#"+i.id+ao+a):document.querySelector("#"+i.id+ao+a)){t.getComponent(r,n.Button).setProperties({iconPosition:i.activeSize===e.RibbonItemSize.Large?"Top":"Left",content:i.activeSize===e.RibbonItemSize.Small?"":s.items[parseInt(a.toString(),10)].content})}},o}(),ko=function(){function e(e){this.count=0,this.isAdded=!1,this.galleryItemsIndex=0,this.parent=e}return e.prototype.getModuleName=function(){return"ribbonGallery"},e.prototype.destroy=function(){this.parent=null},e.prototype.createGallery=function(e,o){var i=this,r=e.gallerySettings;this.renderGalleryItems(r,!1,e.id,o);var n=this.parent.createElement("button",{id:e.id+"_popupButton",className:"e-ribbon-gallery-button e-icons e-drop-icon"});o.appendChild(n),this.createPopup(e,n),n.onclick=function(o){var n=document.querySelector("#"+e.id+"_galleryPopup");if(n){var s=t.getComponent(n,a.Popup);n.classList.contains("e-popup-close")?i.showPopup(s,n,o,r,e.id):i.hidePopup(s,n,o,r,e.id)}},document.onclick=function(e){for(var o,r,n=document.querySelectorAll(".e-ribbon-gallery-popup.e-popup-open"),s=0;s<n.length;s++){var l=t.getComponent(n[parseInt(s.toString(),10)],a.Popup);if(!e.target.classList.contains("e-ribbon-gallery-button")){o=n[parseInt(s.toString(),10)].id.replace(/_galleryPopup/g,""),r=c(i.parent.tabs,o),i.hidePopup(l,n[parseInt(s.toString(),10)],e,r.item.gallerySettings,o);break}if(o=n[parseInt(s.toString(),10)].id.replace(/_galleryPopup/g,""),e.target.id.replace(/_popupButton/g,"")!==o){r=c(i.parent.tabs,o),i.hidePopup(l,n[parseInt(s.toString(),10)],e,r.item.gallerySettings,o);break}}}},e.prototype.renderGalleryItems=function(e,t,o,i){var r,n,s=this,a=c(this.parent.tabs,o);a&&a.group&&(a.group.isCollapsible=!1);var l=this.parent.createElement("div",{className:"e-ribbon-gallery-wrapper",id:o+"_galleryWrapper"});t||i.appendChild(l);for(var p=function(a){var p=!1;r=u.parent.createElement("ol",{className:"e-ribbon-gallery-container",id:o+"_galleryContainer"+a}),e.groups[parseInt(a.toString(),10)].itemHeight&&"auto"!==e.groups[parseInt(a.toString(),10)].itemHeight&&(p=!0),e.groups[parseInt(a.toString(),10)].cssClass&&r.classList.add(e.groups[parseInt(a.toString(),10)].cssClass);for(var c=function(i){n=u.parent.createElement("li",{className:"e-ribbon-gallery-item",id:r.id+"_gallery"+i,attrs:{tabindex:"0"}});var c={name:"beforeItemRender",item:e.groups[parseInt(a.toString(),10)].items[parseInt(i.toString(),10)]};if(e.beforeItemRender&&e.beforeItemRender.call(u,c),r.appendChild(n),e.selectedItemIndex&&e.selectedItemIndex===u.count?n.classList.add("e-ribbon-gallery-selected"):e.selectedItemIndex||0!==u.count||(n.classList.add("e-ribbon-gallery-selected"),e.selectedItemIndex=u.count),u.count=u.count+1,n.onclick=function(t){s.setActiveState(t.currentTarget,e,o,!0,t)},n.onkeydown=function(t){"Enter"!==t.key&&" "!==t.key||s.setActiveState(t.currentTarget,e,o,!0,t)},n.onmouseover=function(t){var o={event:t,name:"itemHover",item:e.groups[parseInt(a.toString(),10)].items[parseInt(i.toString(),10)]};e.itemHover&&e.itemHover.call(s,o)},e.groups[parseInt(a.toString(),10)].itemWidth&&"auto"!==e.groups[parseInt(a.toString(),10)].itemWidth&&(n.style.width=e.groups[parseInt(a.toString(),10)].itemWidth+"px"),e.groups[parseInt(a.toString(),10)].itemHeight&&"auto"!==e.groups[parseInt(a.toString(),10)].itemHeight&&(n.style.height=e.groups[parseInt(a.toString(),10)].itemHeight+"px",n.style.paddingTop="0px",n.style.paddingBottom="0px","Simplified"===u.parent.activeLayout||t||(r.style.flexFlow="wrap")),!e.template&&!e.popupTemplate||e.template&&!e.popupTemplate&&t||e.popupTemplate&&!e.template&&!t){if(e.groups[parseInt(a.toString(),10)].items[parseInt(i.toString(),10)].htmlAttributes&&C(n,e.groups[parseInt(a.toString(),10)].items[parseInt(i.toString(),10)].htmlAttributes),e.groups[parseInt(a.toString(),10)].items[parseInt(i.toString(),10)].iconCss){var d=u.parent.createElement("span",{className:"e-ribbon-gallery-icons "+e.groups[parseInt(a.toString(),10)].items[parseInt(i.toString(),10)].iconCss});n.appendChild(d),"Simplified"!==u.parent.activeLayout||t||d.classList.add("e-hidden")}e.groups[parseInt(a.toString(),10)].items[parseInt(i.toString(),10)].content&&n.appendChild(u.parent.createElement("span",{innerHTML:e.groups[parseInt(a.toString(),10)].items[parseInt(i.toString(),10)].content,className:"e-ribbon-gallery-text"})),e.groups[parseInt(a.toString(),10)].items[parseInt(i.toString(),10)].disabled&&n.classList.add("e-disabled"),e.groups[parseInt(a.toString(),10)].items[parseInt(i.toString(),10)].cssClass&&n.classList.add(e.groups[parseInt(a.toString(),10)].items[parseInt(i.toString(),10)].cssClass)}if(e.template&&!t&&u.createGalleryTemplate(n,e,o,e.groups[parseInt(a.toString(),10)].items[parseInt(i.toString(),10)]),e.popupTemplate&&t&&u.createGalleryPopupTemplate(n,e,o,e.groups[parseInt(a.toString(),10)].items[parseInt(i.toString(),10)]),!t&&!p&&e.itemCount===u.count)return l.appendChild(r),u.isAdded=!0,"break"},d=0;d<e.groups[parseInt(a.toString(),10)].items.length;d++){if("break"===c(d))break}if(u.isAdded&&!t)return"break";if(t?i.appendChild(r):l.appendChild(r),t&&e.groups[parseInt(a.toString(),10)].header){var h=u.parent.createElement("div",{className:"e-ribbon-gallery-header",innerHTML:e.groups[parseInt(a.toString(),10)].header});i.insertBefore(h,r)}},u=this,d=0;d<e.groups.length;d++){if("break"===p(d))break}this.count=0,this.isAdded=!1},e.prototype.setWrapperWidth=function(e,o,i,r){for(var n=1,s=0,a=!1,l=0;l<i.groups.length;l++){for(var p=0;p<i.groups[parseInt(l.toString(),10)].items.length;p++)if(i.groups[parseInt(l.toString(),10)].itemHeight&&"auto"!==i.groups[parseInt(l.toString(),10)].itemHeight){if(!(e>=n)){a=!0;break}var c=o.querySelector("#"+r+"_galleryContainer"+l+"_gallery"+p);if(c){s+=c.offsetWidth;var u=window.getComputedStyle(c);if(u){var d=parseFloat(u.paddingLeft)+parseFloat(u.paddingRight);t.isNullOrUndefined(d)||(s+=d);var h=parseFloat(u.marginLeft)+parseFloat(u.marginRight);t.isNullOrUndefined(h)||(s+=h)}}n++}if(a)break}s>0&&(o.style.width=s+"px")},e.prototype.checkAvailableHeight=function(e,o){for(var i=o.querySelectorAll(".e-ribbon-gallery-wrapper"),r=0;r<i.length;r++){var n=!1,s=0,a=i[parseInt(r.toString(),10)],l=a.offsetHeight,p=a.id.replace(/_galleryWrapper/g,""),u=c(this.parent.tabs,p);if(u){this.setWrapperWidth(u.item.gallerySettings.itemCount,a,u.item.gallerySettings,p);for(var d=0;d<u.item.gallerySettings.groups.length;d++)if(u.item.gallerySettings.groups[parseInt(d.toString(),10)].itemHeight&&"auto"!==u.item.gallerySettings.groups[parseInt(d.toString(),10)].itemHeight)for(var h=0;h<u.item.gallerySettings.groups[parseInt(d.toString(),10)].items.length;h++){var b=a.querySelector("#"+p+"_galleryContainer"+d+"_gallery"+h);if(b)if(s++,n)b.remove();else{if(1===s){var m=0,f=window.getComputedStyle(b);if(f){var y=parseFloat(f.paddingTop)+parseFloat(f.paddingBottom);t.isNullOrUndefined(y)||(m+=y);var g=parseFloat(f.marginTop)+parseFloat(f.marginBottom);t.isNullOrUndefined(g)||(m+=g)}l>b.offsetHeight+m?l-=b.offsetHeight+m:(n=!0,b.remove())}s===u.item.gallerySettings.itemCount&&(s=0)}}}}},e.prototype.checkCollision=function(e,o){var i=0,r=0;if(o){var n=window.innerWidth,s=window.getComputedStyle(o);s&&(i=parseFloat(s.paddingLeft)+parseFloat(s.paddingRight),t.isNullOrUndefined(i)||(n-=i));var a=o.querySelectorAll(".e-ribbon-gallery-container");"auto"!==e.width&&a.forEach(function(e){e.style.flexFlow="wrap"});for(var l=!1,p=0;p<a.length;p++){for(var c=0,u=0;u<a[parseInt(p.toString(),10)].querySelectorAll(".e-ribbon-gallery-item").length;u++){var d=window.getComputedStyle(a[parseInt(p.toString(),10)].querySelectorAll(".e-ribbon-gallery-item")[parseInt(u.toString(),10)]);if(d&&(r=parseFloat(d.marginLeft)+parseFloat(d.marginRight),t.isNullOrUndefined(r)||(c+=r)),c+=a[parseInt(p.toString(),10)].querySelectorAll(".e-ribbon-gallery-item")[parseInt(u.toString(),10)].offsetWidth,n<=c&&"auto"===e.width||"auto"!==e.width&&n<=parseInt(e.width.toString(),10)&&n<=c){o.style.width=c+Math.abs(i-r)-a[parseInt(p.toString(),10)].querySelectorAll(".e-ribbon-gallery-item")[parseInt(u.toString(),10)].offsetWidth+"px",l=!0;break}}if(l){a.forEach(function(e){e.style.flexFlow="wrap"});break}}l||("auto"===e.width?(a.forEach(function(e){e.style.flexFlow="nowrap"}),o.style.width="auto"):o.style.width=e.width.toString())}},e.prototype.createPopup=function(e,t){var o=this.parent.createElement("div",{className:"e-ribbon-popup-container",id:e.id+"_popupContainer"});this.renderGalleryItems(e.gallerySettings,!0,e.id,o);var i=this.parent.createElement("div",{className:"e-ribbon-gallery-popup",id:e.id+"_galleryPopup"});document.body.append(i);new a.Popup(i,{relateTo:t,content:o,collision:{X:"fit",Y:"flip"},actionOnScroll:"hide",targetType:"relative",position:{X:"left",Y:"bottom"},enableRtl:this.parent.enableRtl,width:e.gallerySettings.popupWidth,height:e.gallerySettings.popupHeight}).hide()},e.prototype.switchGalleryItems=function(e,t){var o=this.parent.element.querySelector("#"+t+$t),i=0,r=c(this.parent.tabs,t);if(o){var n=o.querySelector(".e-ribbon-gallery-wrapper"),s=o.querySelectorAll(".e-ribbon-gallery-icons"),a=o.querySelectorAll(".e-ribbon-gallery-container");if(s.length)for(var l=0;l<s.length;l++)"Simplified"===e?s[parseInt(l.toString(),10)].classList.add("e-hidden"):s[parseInt(l.toString(),10)].classList.remove("e-hidden");if(a.length&&r)for(var p=0;p<r.item.gallerySettings.groups.length;p++)for(l=0;l<a.length;l++)r.item.gallerySettings.groups[parseInt(p.toString(),10)].itemHeight&&"auto"!==r.item.gallerySettings.groups[parseInt(p.toString(),10)].itemHeight&&t+"_galleryContainer"+p===a[parseInt(l.toString(),10)].id&&(a[parseInt(l.toString(),10)].style.flexFlow="Simplified"===e?"nowrap":"wrap");if(n)for(p=0;p<r.item.gallerySettings.groups.length;p++)for(l=0;l<r.item.gallerySettings.groups[parseInt(p.toString(),10)].items.length;l++)if(++i>r.item.gallerySettings.itemCount){var u=n.querySelector("#"+t+"_galleryContainer"+p+"_gallery"+l);u&&("Simplified"===e?u.classList.add("e-hidden"):u.classList.remove("e-hidden"))}}},e.prototype.addOverFlowEvents=function(e,o,i){var n=this;if(o.closest(".e-ribbon-overflow-target")){var s=this.parent.createElement("button",{id:e.id});o.appendChild(s),o.querySelector(".e-ribbon-gallery-wrapper").classList.add("e-hidden"),o.querySelectorAll(".e-ribbon-gallery-container").forEach(function(e){e.classList.add("e-hidden")});var l=o.querySelector("#"+e.id+"_popupButton");l&&l.classList.add("e-hidden");var p=c(this.parent.tabs,e.id),u=p&&p.group.groupIconCss?p.group.groupIconCss:"",d=p&&p.group.header?p.group.header:"";if(!u)for(var h=0;h<e.gallerySettings.groups.length;h++){for(var b=0;b<e.gallerySettings.groups[parseInt(h.toString(),10)].items.length;b++)if(e.gallerySettings.groups[parseInt(h.toString(),10)].items[parseInt(b.toString(),10)].iconCss){u=e.gallerySettings.groups[parseInt(h.toString(),10)].items[parseInt(b.toString(),10)].iconCss;break}if(u)break}var m=document.querySelector("#"+e.id+"_galleryPopup"),f=t.getComponent(m,a.Popup),y=document.querySelector("#"+e.id+"_galleryPopup .e-ribbon-popup-container"),g=new r.DropDownButton({iconCss:u,content:d,target:y,enableRtl:this.parent.enableRtl,cssClass:"e-ribbon-gallery-dropdown",disabled:e.disabled,open:function(){n.setFoucsToFirstItem(y,!0,e.id),n.checkCollision(g.dropDown,g.dropDown.element)},beforeClose:function(t){n.popupEvents(t.event,e.gallerySettings,"popupClose",!1)&&(t.cancel=!0)}},s);"auto"!==f.width&&(g.dropDown.width=t.formatUnit(f.width)),"auto"!==f.height&&(g.dropDown.height=t.formatUnit(f.height),g.dropDown.element.style.height=f.height.toString())}},e.prototype.removeOverFlowEvents=function(e,o){var i=o.querySelector("#"+e.id+"_popupButton");i&&i.classList.remove("e-hidden"),o.querySelector(".e-ribbon-gallery-wrapper").classList.remove("e-hidden"),o.querySelectorAll(".e-ribbon-gallery-container").forEach(function(e){e.classList.remove("e-hidden")});var n=document.querySelector("#"+e.id);if(n){var s=document.querySelector("#"+e.id+"_galleryPopup"),a=t.getComponent(n,r.DropDownButton);s.appendChild(a.target),a.destroy(),t.remove(n)}},e.prototype.setActiveState=function(e,t,o,i,r){var n,s,a=document.querySelector("#"+o+$t),l=Array.prototype.slice.call(a.querySelectorAll(".e-ribbon-gallery-selected")),p=document.querySelector("#"+o+"_popupContainer"),c=Array.prototype.slice.call(p.querySelectorAll(".e-ribbon-gallery-selected"));c.length&&(l=l.concat(c));for(var u=0;u<t.groups.length;u++)for(var d=0;d<t.groups[parseInt(u.toString(),10)].items.length;d++)l[0].id===o+"_galleryContainer"+u+"_gallery"+d&&(n=t.groups[parseInt(u.toString(),10)].items[parseInt(d.toString(),10)]),e.id===o+"_galleryContainer"+u+"_gallery"+d&&(s=t.groups[parseInt(u.toString(),10)].items[parseInt(d.toString(),10)]);var h=document.querySelectorAll("#"+e.id),b={cancel:!1,name:"beforeSelect",previousItem:n,currentItem:s,isInteracted:i,event:r};if(t.beforeSelect&&t.beforeSelect.call(this,b),!b.cancel){for(u=0;u<l.length;u++)l[parseInt(u.toString(),10)].classList.remove("e-ribbon-gallery-selected");for(u=0;u<h.length;u++)h[parseInt(u.toString(),10)].classList.add("e-ribbon-gallery-selected");var m={previousItem:n,currentItem:s,name:"select",isInteracted:i,event:r},f=document.querySelectorAll("#"+o+"_popupContainer .e-ribbon-gallery-item");for(u=0;u<f.length;u++)if(f[parseInt(u.toString(),10)].id===e.id){t.selectedItemIndex=u;break}t.select&&t.select.call(this,m)}},e.prototype.popupEvents=function(e,t,o,i){var r={cancel:!1,event:e,name:o};return i&&t.popupOpen?t.popupOpen.call(this,r):!i&&t.popupClose&&t.popupClose.call(this,r),!!r.cancel},e.prototype.showPopup=function(e,t,o,i,r){if(!this.popupEvents(o,i,"popupOpen",!0)){e.show(),this.checkCollision(e,t);var n=document.querySelector("#"+r+"_popupButton");n.classList.add("e-gallery-button-active");var s=n.getBoundingClientRect(),a=Math.abs(t.offsetWidth-s.left)+n.offsetWidth;t.style.left=a+"px",t.style.top=t.getBoundingClientRect().top+2+"px",this.setFoucsToFirstItem(t,!1,r,e,i)}},e.prototype.hidePopup=function(e,t,o,i,r){if(!this.popupEvents(o,i,"popupClose",!1)){e.hide();document.querySelector("#"+r+"_popupButton").classList.remove("e-gallery-button-active")}},e.prototype.showGalleryPopup=function(e){var o=c(this.parent.tabs,e),i=document.querySelector("#"+e+"_galleryPopup"),r=t.getComponent(i,a.Popup);this.showPopup(r,i,null,o.item.gallerySettings,e)},e.prototype.hideGalleryPopup=function(e){var o=c(this.parent.tabs,e),i=document.querySelector("#"+e+"_galleryPopup"),r=t.getComponent(i,a.Popup);this.hidePopup(r,i,null,o.item.gallerySettings,e)},e.prototype.setFoucsToFirstItem=function(e,t,o,i,r){var n=this;e.querySelectorAll(".e-ribbon-gallery-item")[0].focus(),this.galleryItemsIndex=0,e.onkeydown=function(s){n.handleGalleryPopupNavigation(s,e,t,o,i,r)}},e.prototype.handleGalleryPopupNavigation=function(e,t,o,i,r,n){var s=t.querySelectorAll(".e-ribbon-gallery-item");s&&("Home"===e.key?(this.galleryItemsIndex=0,s[this.galleryItemsIndex].focus()):"End"===e.key?(this.galleryItemsIndex=s.length-1,s[this.galleryItemsIndex].focus()):"ArrowRight"===e.key||"ArrowDown"===e.key?(this.galleryItemsIndex++,this.galleryItemsIndex!==s.length?s&&s[this.galleryItemsIndex]&&s[this.galleryItemsIndex].focus():(this.galleryItemsIndex=0,s[this.galleryItemsIndex].focus())):"ArrowLeft"===e.key||"ArrowUp"===e.key?0!==this.galleryItemsIndex?(this.galleryItemsIndex--,s&&s[this.galleryItemsIndex]&&s[this.galleryItemsIndex].focus()):(this.galleryItemsIndex=s.length-1,s[this.galleryItemsIndex].focus()):"Enter"===e.key||"Space"===e.code?s[this.galleryItemsIndex].click():"Escape"!==e.key||o||this.hidePopup(r,t,e,n,i))},e.prototype.createGalleryTemplate=function(e,o,i,r){e.classList.add("e-ribbon-gallery-template");var n="ribbon"+i+"galleryTemplate";this.parent.clearTemplate([n]);var s=p(o.template);r.disabled&&e.classList.add("e-disabled"),r.cssClass&&e.classList.add(r.cssClass),t.append(s({items:r},this,n,i+"galleryTemplate",this.parent.isStringTemplate),e),this.parent.renderReactTemplates()},e.prototype.createGalleryPopupTemplate=function(e,o,i,r){e.classList.add("e-ribbon-gallery-popup-template");var n="ribbon"+i+"galleryPopupTemplate";this.parent.clearTemplate([n]);var s=p(o.popupTemplate);r.disabled&&e.classList.add("e-disabled"),r.cssClass&&e.classList.add(r.cssClass),t.append(s({items:r},this,n,i+"galleryPopupTemplate",this.parent.isStringTemplate),e),this.parent.renderReactTemplates()},e}(),Oo=function(){var e=function(t,o){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(t,o)};return function(t,o){function i(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(i.prototype=o.prototype,new i)}}(),Bo=function(e,t,o,i){var r,n=arguments.length,s=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(n<3?r(s):n>3?r(t,o,s):r(t,o))||s);return n>3&&s&&Object.defineProperty(t,o,s),s},Po=function(i){function s(e,t){return g.Inject(ho,mo,Io,To,vo,wo),i.call(this,e,t)||this}Oo(s,i),g=s,s.prototype.render=function(){this.initialize()},s.prototype.preRender=function(){this.keysPress="",this.idIndex=0,this.tooltipData=[],this.initialPropsData={},this.hiddenElements={},this.keyTipElements={},this.hiddenGroups=[],this.itemsModel=[],this.targetTabs={},this.isAddRemove=!1,this.isUpdateItems=!1,this.keyConfigs={leftarrow:"leftarrow",rightarrow:"rightarrow",tab:"tab",shiftTab:"shift+tab"}},s.prototype.getPersistData=function(){return this.addOnPersist(["activeLayout"])},s.prototype.getModuleName=function(){return"ribbon"},s.prototype.requiredModules=function(){var t=[];t.push({member:"ribbonButton",args:[this],name:"RibbonButton"},{member:"ribbonDropDown",args:[this],name:"RibbonDropDown"},{member:"ribbonSplitButton",args:[this],name:"RibbonSplitButton"},{member:"ribbonCheckBox",args:[this],name:"RibbonCheckBox"},{member:"ribbonComboBox",args:[this],name:"RibbonComboBox"},{member:"ribbonGroupButton",args:[this],name:"RibbonGroupButton"});var o=c(this.tabs,null,e.RibbonItemType.ColorPicker),i=c(this.tabs,null,e.RibbonItemType.Gallery);return o&&t.push({member:"ribbonColorPicker",args:[this],name:"RibbonColorPicker"}),i&&t.push({member:"ribbonGallery",args:[this],name:"RibbonGallery"}),(this.backStageMenu.visible||this.backStageMenu.items.length)&&t.push({member:"ribbonBackstage",args:[this],name:"RibbonBackstage"}),(this.fileMenu.visible||this.fileMenu.menuItems.length)&&t.push({member:"ribbonFileMenu",args:[this],name:"RibbonFileMenu"}),this.contextualTabs.length&&t.push({member:"ribbonContextualTab",args:[this],name:"RibbonContextualTab"}),this.enableKeyTips&&t.push({member:"ribbonKeyTip",args:[this],name:"RibbonKeyTip"}),t},s.prototype.initialize=function(){this.element.id=this.element.id||t.getUniqueID("e-"+this.getModuleName()),t.addClass([this.element],["e-rbn"].concat(this.cssClass?this.cssClass.split(" "):[])),this.enableRtl&&this.element.classList.add(je),this.element.style.width=t.formatUnit(this.width),this.renderTabs(),this.ribbonContextualTabModule&&this.ribbonContextualTabModule.addContextualTabs(),this.ribbonFileMenuModule&&this.ribbonFileMenuModule.createFileMenu(this.fileMenu),this.ribbonBackstageModule&&this.ribbonBackstageModule.createBackStage(this.backStageMenu),this.createHelpPaneTemplate();this.tabObj.tbObj.refreshOverflow(),this.addTabOverflowKeyTip(),v(this.element,this),this.isKeytipOpen=!1,this.wireEvents(),this.wireKeyboardEvent(),this.currentControlIndex=0},s.prototype.wireEvents=function(){t.EventHandler.add(window,"resize",this.resizeHandler,this),t.EventHandler.add(document.body,"keydown",this.keytipActionHandler,this),t.EventHandler.add(document,"mousedown",this.mouseEventHandler,this),t.EventHandler.add(document,"scroll",this.mouseEventHandler,this)},s.prototype.wireKeyboardEvent=function(){this.keyboardModuleRibbon=new t.KeyboardEvents(this.element,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"})},s.prototype.keyActionHandler=function(e){"Tab"!==e.key||e.target.classList.contains("e-tab-wrap")||e.target.classList.contains("e-combobox")||e.preventDefault();var t,o=this.tabObj.element.querySelector("#"+this.tabs[this.selectedTab].id+Qt),i=Array.prototype.slice.call(o.querySelectorAll(".e-control")),r=Array.prototype.slice.call(o.querySelectorAll(".e-ribbon-template")),n=Array.prototype.slice.call(o.querySelectorAll(".e-ribbon-gallery-item")),s=i.concat(r,n),a=o.querySelectorAll(".e-combobox");if(a)for(var l=0;l<a.length;l++)a[parseInt(l.toString(),10)].closest(".e-input-focus")&&(t=a[parseInt(l.toString(),10)]);if(t)for(l=0;l<s.length;l++)s[parseInt(l.toString(),10)].classList.contains("e-combobox")&&s[parseInt(l.toString(),10)].closest(".e-input-focus")&&(this.currentControlIndex=l);if(0===this.currentControlIndex)for(var p=s[this.currentControlIndex].closest(".e-ribbon-item");p&&p.classList.contains("e-disabled");)this.currentControlIndex++,p=s[this.currentControlIndex].closest(".e-ribbon-item");if(e.target.classList.contains("e-control")||e.target.classList.contains("e-ribbon-launcher-icon")||e.target.classList.contains("e-ribbon-collapse-btn")||e.target.classList.contains("e-ribbon-last-item")||e.target.classList.contains("e-ribbon-first-item")||e.target.classList.contains("e-ribbon-group-of-btn")||e.target.classList.contains("e-ribbon-overall-of-btn")||e.target.classList.contains("e-ribbon-template")||e.target.classList.contains("e-ribbon-gallery-item"))switch(e.action){case"rightarrow":this.handleNavigation(e,!this.enableRtl,s);break;case"leftarrow":this.handleNavigation(e,this.enableRtl,s);break;case"tab":e.target.classList.contains("e-combobox")&&this.currentControlIndex<s.length-1&&this.currentControlIndex++;break;case"shiftTab":e.target.classList.contains("e-combobox")?this.currentControlIndex>0&&this.currentControlIndex--:(this.tabObj.element.querySelector(".e-toolbar-item.e-active").querySelector(".e-tab-wrap").focus(),this.currentControlIndex=0)}},s.prototype.handleNavigation=function(e,t,o){var i,r;if(t?this.currentControlIndex<o.length-1&&o[this.currentControlIndex+1].classList.contains("e-colorpicker")&&this.currentControlIndex++:this.currentControlIndex>0&&o[this.currentControlIndex-1].classList.contains("e-colorpicker")&&this.currentControlIndex--,!t&&this.currentControlIndex>0||t&&this.currentControlIndex<o.length-1){if(!e.target.classList.contains("e-combobox")&&(e.target.classList.contains("e-control")||e.target.classList.contains("e-ribbon-template")||e.target.classList.contains("e-ribbon-gallery-item"))&&!e.target.classList.contains("e-ribbon-last-item")){if(t)this.currentControlIndex++;else{var n=o[parseInt(this.currentControlIndex.toString(),10)].closest("."+ct);n&&(r=n.getAttribute("id")),this.currentControlIndex--}for(var s=o[this.currentControlIndex].closest(".e-ribbon-item");s&&s.classList.contains("e-disabled");){if((t&&this.currentControlIndex===o.length-1||!t&&0===this.currentControlIndex)&&o[this.currentControlIndex].closest(".e-ribbon-item").classList.contains("e-disabled")){this.tabObj.element.querySelector(".e-ribbon-collapse-btn").focus();break}t?this.currentControlIndex++:this.currentControlIndex--,s=o[this.currentControlIndex].closest(".e-ribbon-item")}if(o[parseInt(this.currentControlIndex.toString(),10)].focus(),"Classic"===this.activeLayout){if(i=o[parseInt(this.currentControlIndex.toString(),10)].closest("."+ct),t){var a=void 0;if(i&&(a=i.querySelector(".e-ribbon-launcher-icon")),a){var l=i.querySelectorAll(".e-ribbon-item"),p=l[l.length-1].querySelector(".e-control");p&&p.classList.add("e-ribbon-last-item")}}else if(i){if(r!==i.getAttribute("id")){(a=i.querySelector(".e-ribbon-launcher-icon"))&&o[parseInt((this.currentControlIndex+1).toString(),10)].classList.add("e-ribbon-first-item")}}}else o[parseInt(this.currentControlIndex.toString(),10)].classList.contains("e-ribbon-first-item")?o[parseInt(this.currentControlIndex.toString(),10)].classList.remove("e-ribbon-first-item"):o[parseInt(this.currentControlIndex.toString(),10)].classList.contains("e-ribbon-last-item")&&o[parseInt(this.currentControlIndex.toString(),10)].classList.remove("e-ribbon-last-item")}}else if("Classic"===this.activeLayout&&this.tabObj.element.querySelector(".e-ribbon-collapse-btn").focus(),"Simplified"===this.activeLayout){var c=this.tabObj.element.querySelector(".e-ribbon-overall-of-btn");t&&c&&!c.classList.contains("e-ribbon-hide")?c.focus():this.tabObj.element.querySelector(".e-ribbon-collapse-btn").focus()}if(e.target.classList.contains("e-ribbon-last-item")&&(t?(i=o[parseInt(this.currentControlIndex.toString(),10)].closest("."+ct)).querySelector(".e-ribbon-launcher-icon").focus():(this.currentControlIndex--,o[parseInt(this.currentControlIndex.toString(),10)].focus())),!t&&e.target.classList.contains("e-ribbon-first-item")){(a=(i=o[parseInt((this.currentControlIndex-1).toString(),10)].closest("."+ct)).querySelector(".e-ribbon-launcher-icon"))&&i.querySelector(".e-ribbon-launcher-icon").focus()}if(e.target.classList.contains("e-ribbon-launcher-icon")&&(t?(this.currentControlIndex++,o[parseInt(this.currentControlIndex.toString(),10)].focus(),o[parseInt((this.currentControlIndex-1).toString(),10)].classList.contains("e-ribbon-last-item")&&o[parseInt((this.currentControlIndex-1).toString(),10)].classList.remove("e-ribbon-last-item")):(this.currentControlIndex,o[parseInt(this.currentControlIndex.toString(),10)].focus())),e.target.classList.contains("e-ribbon-collapse-btn"))if(t){this.currentControlIndex=0;for(var u=o[this.currentControlIndex].closest(".e-ribbon-item");u&&u.classList.contains("e-disabled");)this.currentControlIndex++,u=o[this.currentControlIndex].closest(".e-ribbon-item");o[parseInt(this.currentControlIndex.toString(),10)].focus()}else{if((c=this.tabObj.element.querySelector(".e-ribbon-overall-of-btn"))&&!c.classList.contains("e-ribbon-hide"))c.focus();else{this.currentControlIndex=o.length-1;for(u=o[this.currentControlIndex].closest(".e-ribbon-item");u&&u.classList.contains("e-disabled");)this.currentControlIndex--,u=o[this.currentControlIndex].closest(".e-ribbon-item");o[parseInt(this.currentControlIndex.toString(),10)].focus()}}"Simplified"===this.activeLayout&&e.target.classList.contains("e-ribbon-overall-of-btn")&&(t?this.tabObj.element.querySelector(".e-ribbon-collapse-btn").focus():(this.currentControlIndex=o.length-1,o[parseInt(this.currentControlIndex.toString(),10)].focus()))},s.prototype.resizeHandler=function(){var e=this.tabObj.element.querySelector("#"+this.tabs[this.selectedTab].id+Qt);if(this.checkOverflow(this.selectedTab,e),this.scrollModule){var o=this.tabObj.element.querySelector("."+Ke);this.scrollModule.scrollStep=o.offsetWidth}if("Simplified"===this.activeLayout){var i=document.querySelectorAll(".e-ribbon .e-dropdown-btn.e-active, .e-ribbon-group-overflow-ddb .e-dropdown-btn.e-active");if(i.length)for(var n=0;n<i.length;n++){t.getInstance(i[parseInt(n.toString(),10)],r.DropDownButton).toggle()}}var s=document.querySelector(".e-ribbon-gallery-popup.e-popup-open");if(s){t.getComponent(s,a.Popup).hide()}this.ribbonKeyTipModule&&this.enableKeyTips&&this.ribbonKeyTipModule.removeKeytip()},s.prototype.mouseEventHandler=function(e){this.ribbonKeyTipModule&&this.enableKeyTips&&this.ribbonKeyTipModule.removeKeytip()},s.prototype.keytipActionHandler=function(e){if(this.enableKeyTips){var o=!1,i=e.key;if(e.altKey&&"Meta"===e.key){var n=document.querySelectorAll(".e-ribbon .e-dropdown-btn.e-active, .e-ribbon-group-overflow-ddb .e-dropdown-btn.e-active");if(n.length){for(var s=0;s<n.length;s++){t.getInstance(n[parseInt(s.toString(),10)],r.DropDownButton).toggle()}this.ribbonKeyTipModule.removeKeytip()}else if(this.isKeytipOpen)this.ribbonKeyTipModule.removeKeytip();else{var a=document.querySelector(".e-ribbon-backstage-popup");a&&a.classList.contains("e-popup-open")&&this.ribbonBackstageModule.hideBackstage(),this.ribbonKeyTipModule.createKeytip("tab")}}else if("Escape"===e.key||"Tab"===e.key||"ArrowLeft"===e.key||"ArrowUp"===e.key||"ArrowRight"===e.key||"ArrowDown"===e.key)this.ribbonKeyTipModule.removeKeytip(e.key);else{var l=document.querySelectorAll(".e-ribbon-keytip");if(l){for(s=0;s<l.length;s++){if(l[parseInt(s.toString(),10)].innerHTML.toLowerCase()===i){o=!0,this.ribbonKeyTipModule.keytipPress(i);break}}o||this.checkKeyTipPresent(i,this.keysPress.length)}}}},s.prototype.checkKeyTipPresent=function(e,t){for(var o=document.querySelectorAll(".e-ribbon-keytip"),i=0;i<o.length;i++){var r=o[parseInt(i.toString(),10)];if(r.innerHTML.length>1&&r.innerHTML[parseInt(t.toString(),10)].toLowerCase()===e){this.keysPress+=e,this.ribbonKeyTipModule.keytipPress(this.keysPress),this.removeKeytip(this.keysPress);break}}},s.prototype.removeKeytip=function(e){for(var o=document.querySelectorAll(".e-ribbon-keytip"),i=0;i<o.length;i++){var r=o[parseInt(i.toString(),10)];r.innerHTML[0].toLowerCase()!==e&&""!==e&&t.remove(r)}},s.prototype.addKeyTip=function(e,t,o,i){if(this.keyTipElements&&this.keyTipElements[parseInt(e.toString(),10)]){var r=!1;if(this.keyTipElements[parseInt(e.toString(),10)][i]||(this.keyTipElements[parseInt(e.toString(),10)][i]=[]),Object.keys(this.keyTipElements[e][i]).length){for(var n=this.keyTipElements[e][i],s=0;s<Object.keys(this.keyTipElements[e][i]).length;s++)n[parseInt(s.toString(),10)].id===o&&(r=!0);r||this.keyTipElements[e][i].push({id:o,type:i,keyTip:t})}else this.keyTipElements[e][i].push({id:o,type:i,keyTip:t})}},s.prototype.renderTabs=function(){this.tabsInternal=this.tabs.slice(),this.tabsInternal=this.checkID(this.tabsInternal,"tab",this.element.id),this.setProperties({tabs:this.tabsInternal},!0);var e=this.createElement("div",{id:this.element.id+"_tab"});this.element.appendChild(e),this.validateItemSize();var i=this.createTabItems(this.tabs);this.tabObj=new o.Tab({cssClass:"e-ribbon-tab",selectedItem:this.selectedTab,overflowMode:"Popup",width:this.width,items:i,enableRtl:this.enableRtl,created:this.tabCreated.bind(this),selected:this.ribbonTabSelected.bind(this),selecting:this.ribbonTabSelecting.bind(this),animation:this.tabAnimation}),this.tabObj.appendTo(e),this.element.style.setProperty(po,"0px"),this.element.style.setProperty(co,"0px");var r=e.querySelector(".e-toolbar");t.getComponent(r,o.Toolbar).setProperties({width:"calc(100% - var(--fileMenuWidth) - var(--helpTemplateWidth))"}),this.element.classList[this.isMinimized?"add":"remove"](it)},s.prototype.minimize=function(e){var t=this;if(e!==this.isMinimized){this.trigger(e?"ribbonCollapsing":"ribbonExpanding",{cancel:!1},function(o){o.cancel||(t.setProperties({isMinimized:e},!0),t.element.classList.toggle(it,t.isMinimized),t.tabObj.element.querySelector(".e-content").style.display=e?"none":"block",e||t.refreshLayout())})}},s.prototype.toggleLayout=function(){this.setProperties({activeLayout:"Simplified"===this.activeLayout?"Classic":"Simplified"},!0),this.switchLayout()},s.prototype.tabCreated=function(){this.hideLayoutSwitcher||this.addExpandCollapse(),this.renderInitialTab(this.selectedTab)},s.prototype.ribbonTabSelected=function(e){e.preventFocus=!0,this.isAddRemove=!1;var t=e.selectedItem.getAttribute("data-id"),o=l(this.tabs,function(e){return e.id===t});o=-1===o?this.selectedTab:o;var i=this.isContextualTab(t);this.updateSelectedState(t);var r={previousIndex:this.selectedTab,selectedIndex:o,isContextual:i};if(this.setProperties({selectedTab:o},!0),this.calculateHiddenElementsWidth(o),this.isUpdateItems){for(var n=0;n<this.itemsModel.length;n++){var s=this.itemsModel[parseInt(n.toString(),10)];this.selectedTab===this.targetTabs[s.id]&&(this.updateItem(s),this.itemsModel.splice(n,1),n--)}0===this.itemsModel.length&&(this.isUpdateItems=!1)}if(this.checkOverflow(o,e.selectedContent.firstChild),"Classic"===this.activeLayout&&this.ribbonGalleryModule&&this.ribbonGalleryModule.checkAvailableHeight(o,e.selectedContent.firstChild),"Simplified"===this.activeLayout&&this.overflowDDB){var a=this.overflowDDB.target,p=a.querySelector("."+Ve);p&&p.classList.remove(Ve);var c=a.querySelector("#"+t+eo);c?(c.classList.add(Ve),this.overflowDDB.element.classList.remove(Fe),this.checkOverflowHiddenItems(!1,o)):this.overflowDDB.element.classList.add(Fe)}this.trigger("tabSelected",r)},s.prototype.updateSelectedState=function(e){if(this.contextualTabs.length)for(var t=0;t<this.contextualTabs.length;t++){for(var o=!1,i=0;i<this.contextualTabs[parseInt(t.toString(),10)].tabs.length;i++)if(this.contextualTabs[parseInt(t.toString(),10)].tabs[parseInt(i.toString(),10)].id===e){o=!0;break}this.contextualTabs[parseInt(t.toString(),10)].setProperties({isSelected:o},!0)}},s.prototype.checkOverflow=function(e,t){var i=t.closest("."+ot),r=i.offsetWidth<t.offsetWidth;if(r&&!this.scrollModule){if("Classic"===this.activeLayout){var n=!1;!(n=this.checkGroupShrinking(e,i,t,!0))&&i.offsetWidth<t.offsetWidth&&(n=this.checkGroupShrinking(e,i,t,!1)),i.offsetWidth<t.offsetWidth&&this.createOverflowDropdown(e,i,t)}else this.checkSimplifiedItemShrinking(e,i,t),i.offsetWidth<t.offsetWidth&&this.createSimplfiedOverflow(i,t,e);i.offsetWidth<t.offsetWidth&&!this.scrollModule&&(this.scrollModule=new o.HScroll({enableRtl:this.enableRtl},this.tabObj.element.querySelector("."+ot)))}else if(!r)if(this.destroyScroll(),"Classic"===this.activeLayout){n=!1;!(n=this.removeOverflowDropdown(i,t,!1,e))&&i.offsetWidth>t.offsetWidth&&(n=this.checkGroupExpanding(e,i,t,!0)),!n&&i.offsetWidth>t.offsetWidth&&(n=this.checkGroupExpanding(e,i,t,!1))}else this.removeSimplfiedOverflow(i,t,e),i.offsetWidth>t.offsetWidth&&this.checkSimplifiedItemExpanding(e,i,t);this.addTabOverflowKeyTip()},s.prototype.addTabOverflowKeyTip=function(){var e=this.tabObj.element.querySelector("#_nav");e?(this.keyTipElements.taboverflow=[],this.keyTipElements.taboverflow.push({id:e.id,type:"taboverflow",keyTip:"00"})):delete this.keyTipElements.taboverflow},s.prototype.checkSimplifiedItemShrinking=function(t,o,i){for(var r=this.tabs[parseInt(t.toString(),10)],n=r.groups.length-1;n>=0;n--)for(var s=r.groups[parseInt(n.toString(),10)],a=o.querySelector("#"+s.id+$t),l=0;l<s.collections.length&&o.offsetWidth<i.offsetWidth;l++)for(var p=s.collections[parseInt(l.toString(),10)],c=p.items.length;c>=1&&o.offsetWidth<i.offsetWidth;c--){var u=p.items[c-1];if(u.allowedSizes&e.RibbonItemSize.Small&&u.allowedSizes&e.RibbonItemSize.Medium&&u.activeSize===e.RibbonItemSize.Medium&&u.displayOptions&e.DisplayMode.Simplified){var d=a.querySelector("#"+u.id+$t);if(d){var h=d.querySelector("#"+u.id);d.setAttribute("data-medium-width",i.offsetWidth.toString()),u.setProperties({activeSize:e.RibbonItemSize.Small},!0),this.setItemSize(h,u)}}}},s.prototype.checkSimplifiedItemExpanding=function(t,o,i){for(var r=this.tabs[parseInt(t.toString(),10)],n=r.groups.length-1;n>=0;n--)for(var s=r.groups[parseInt(n.toString(),10)],a=o.querySelector("#"+s.id+$t),l=0;l<s.collections.length&&o.offsetWidth>i.offsetWidth;l++)for(var p=s.collections[parseInt(l.toString(),10)],c=p.items.length;c>=1&&o.offsetWidth>i.offsetWidth;c--){var u=p.items[c-1];if(u.allowedSizes&e.RibbonItemSize.Small&&u.allowedSizes&e.RibbonItemSize.Medium&&u.activeSize===e.RibbonItemSize.Small&&u.displayOptions&e.DisplayMode.Simplified){var d=a.querySelector("#"+u.id+$t);if(d){var h=d.getAttribute("data-medium-width"),b=h?parseInt(h,10):null;if(b&&o.offsetWidth>b){d.removeAttribute("data-medium-width");var m=d.querySelector("#"+u.id);u.setProperties({activeSize:e.RibbonItemSize.Medium},!0),this.setItemSize(m,u)}}}}},s.prototype.createSimplfiedOverflow=function(o,i,r){for(var n=this.getGroupResizeOrder(!0,r),s=0;s<n.length&&o.offsetWidth<i.offsetWidth;s++){for(var a=!1,l=n[parseInt(s.toString(),10)],p=o.querySelector("#"+l.id),c=p.querySelector("#"+l.id+$t),u=l.collections.length;u>=1&&o.offsetWidth<i.offsetWidth;u--)for(var d=l.collections[parseInt((u-1).toString(),10)],h=p.querySelector("#"+d.id),b=d.items.length;b>=1&&o.offsetWidth<i.offsetWidth;b--){var m=d.items[b-1],f=h.querySelector("#"+m.id+$t);if((m.displayOptions===e.DisplayMode.Auto||m.displayOptions===(e.DisplayMode.Simplified|e.DisplayMode.Overflow))&&!t.isNullOrUndefined(f)){var y=!1,g=!1,v=!1,S=!1,I=void 0;if(p.classList.contains("e-hidden")||p.classList.contains("e-hide-group")){if((I=p.querySelectorAll(".e-ribbon-item.e-hidden")).length)for(var C=0;C<I.length;C++)I[parseInt(C.toString(),10)].classList.remove("e-hidden");p.classList.contains("e-hide-group")?(v=!0,p.classList.remove("e-hide-group"),p.classList.remove("e-ribbon-emptyCollection"),-1!==this.hiddenGroups.indexOf(p.id)&&this.hiddenGroups.splice(this.hiddenGroups.indexOf(p.id),1)):(y=!0,p.classList.remove("e-hidden")),a||(this.calculateOverflowItemsWidth(p.offsetWidth,!1,r),this.calculateMediumDataWidth(p.offsetWidth,r,!1),a=!0)}else f.classList.contains("e-hidden")&&(g=!0,f.classList.remove("e-hidden"),p.classList.contains("e-ribbon-emptyCollection")&&(S=!0,p.classList.remove("e-ribbon-emptyCollection")),this.calculateOverflowItemsWidth(f.offsetWidth,!1,r),this.calculateMediumDataWidth(f.offsetWidth,r,!1));if(f.setAttribute("data-simplified-width",i.offsetWidth.toString()),g&&f.classList.add("e-hidden"),I&&I.length)for(var T=0;T<I.length;T++)I[parseInt(T.toString(),10)].classList.add("e-hidden");if(y&&p.classList.add("e-hidden"),v&&(p.classList.add("e-hide-group"),p.classList.add("e-ribbon-emptyCollection")),S&&p.classList.add("e-ribbon-emptyCollection"),this.createOverflowPopup(m,r,l.enableGroupOverflow,l.id,l.header,f,c,!0),m.activeSize===e.RibbonItemSize.Small){var w=f.querySelector("#"+m.id);m.setProperties({activeSize:e.RibbonItemSize.Medium},!0),this.setItemSize(w,m)}m.type!==e.RibbonItemType.DropDown&&m.type!==e.RibbonItemType.SplitButton&&m.type!==e.RibbonItemType.GroupButton&&m.type!==e.RibbonItemType.Gallery||this.updatePopupItems(m,f,l.enableGroupOverflow,!0)}}l.enableGroupOverflow||p.querySelector("."+Ct)||p.classList.add("e-ribbon-emptyCollection");var k=p.querySelectorAll("."+Ct);k&&!l.enableGroupOverflow&&this.checkEmptyCollection(k)&&p.classList.add("e-ribbon-emptyCollection"),this.checkOverflowHiddenItems(l.enableGroupOverflow,r,l.id)}},s.prototype.checkEmptyCollection=function(e){for(var t=!0,o=0;o<e.length;o++)if(!e[parseInt(o.toString(),10)].classList.contains("e-hidden")){t=!1;break}return t},s.prototype.updatePopupItems=function(o,i,n,s){var a=t.getComponent(i.querySelector("#"+o.id),o.type===e.RibbonItemType.DropDown||o.type===e.RibbonItemType.Gallery||o.type===e.RibbonItemType.GroupButton?r.DropDownButton:r.SplitButton),l=a.dropDown,p=(n&&s)===this.enableRtl;l&&(l.setProperties({position:{X:p?"left":"right",Y:s?"top":"bottom"}},!0),s?a.beforeOpen=function(){p&&(l.element.style.setProperty("visibility","hidden"),l.element.style.setProperty("display","block"),l.setProperties({offsetX:-1*l.element.offsetWidth}),l.element.style.removeProperty("display"),l.element.style.removeProperty("visibility"))}:(l.setProperties({offsetX:0},!0),a.beforeOpen=null))},s.prototype.removeSimplfiedOverflow=function(o,i,n,s){void 0===s&&(s=!1);for(var a=this.getGroupResizeOrder(!1,n),l=!0,p=0;p<a.length&&l;p++){var c=a[parseInt(p.toString(),10)],u=void 0,d=void 0;if(c.enableGroupOverflow){var h=o.querySelector("#"+c.id+Yt);h&&(d=(u=t.getInstance(h,r.DropDownButton)).target)}else u=this.overflowDDB,d=this.overflowDDB?this.overflowDDB.target:null;for(var b=0;b<c.collections.length&&l;b++)for(var m=c.collections[parseInt(b.toString(),10)],f=0;f<m.items.length&&l&&!s&&o.offsetWidth>i.offsetWidth;f++){var y=m.items[parseInt(f.toString(),10)],g=void 0;if(d&&(g=d.querySelector("#"+y.id+$t)),(y.displayOptions===e.DisplayMode.Auto||y.displayOptions===(e.DisplayMode.Simplified|e.DisplayMode.Overflow))&&!t.isNullOrUndefined(g)){var v=parseInt(g.getAttribute("data-simplified-width"),10),S=o.querySelector("#"+c.id);if((g.classList.contains("e-hidden")||S.classList.contains("e-hidden"))&&(v=Math.abs(v-i.offsetWidth)),!s&&o.offsetWidth<v){l=!1;break}var I=o.querySelector("#"+m.id);if(y.type!==e.RibbonItemType.DropDown&&y.type!==e.RibbonItemType.SplitButton&&y.type!==e.RibbonItemType.GroupButton&&y.type!==e.RibbonItemType.Gallery||this.updatePopupItems(y,g,c.enableGroupOverflow,!1),I.append(g),g.classList.contains("e-hidden")||S.classList.contains("e-hidden")){g.setAttribute("data-simplified-width",v.toString());var C=!1,T=0;g.classList.contains("e-hidden")&&(g.classList.remove("e-hidden"),S.classList.contains("e-hide-group")&&(C=!0,T=this.checkWidthDifference(g,S)),v=g.offsetWidth+T,g.classList.add("e-hidden")),this.calculateOverflowItemsWidth(v,!0,n),this.calculateMediumDataWidth(v,n,!0),C&&(S.classList.add("e-hide-group"),S.classList.add("e-ribbon-emptyCollection"))}this.removeOverflowEvent(y,g),y.allowedSizes&e.RibbonItemSize.Small&&(y.setProperties({activeSize:e.RibbonItemSize.Small},!0),this.setItemSize(g.querySelector("#"+y.id),y));var w=o.querySelector("#"+c.id),k=w.querySelector("."+Ct);if(w.classList.contains("e-ribbon-emptyCollection")&&null!==k){var O=w.querySelectorAll("."+Ct);O&&(this.checkEmptyCollection(O)||w.classList.remove("e-ribbon-emptyCollection"))}}}if(u)if(c.enableGroupOverflow)(0===d.childElementCount||1===d.childElementCount&&this.isHeaderVisible(d,c.id))&&this.removeOverflowButton(u);else{var B=d.querySelector("#"+c.id+$t);B&&1===B.childElementCount&&B.remove();var P=d.querySelector("#"+this.tabs[parseInt(n.toString(),10)].id+eo);P&&0===P.childElementCount&&(P.remove(),this.overflowDDB.element.classList.add(Fe))}}for(p=0;p<a.length;p++)this.checkOverflowHiddenItems(a[parseInt(p.toString(),10)].enableGroupOverflow,n,a[parseInt(p.toString(),10)].id);if(this.overflowDDB){0===this.overflowDDB.target.childElementCount&&(this.removeOverflowButton(this.overflowDDB),this.overflowDDB=null)}},s.prototype.checkOverflowHiddenItems=function(e,o,i){if(e){var n=document.querySelector("#"+i+Yt);if(n){for(var s=t.getInstance(n,r.DropDownButton),a=s.target.querySelectorAll(".e-ribbon-item"),l=!0,p=0;p<a.length;p++)if(!a[parseInt(p.toString(),10)].classList.contains("e-hidden")){l=!1;break}s.element.classList[l?"add":"remove"]("e-hidden")}}else if(this.overflowDDB){var c=!0,u=void 0,d=this.overflowDDB.target.querySelector("#"+this.tabs[parseInt(o.toString(),10)].id+eo);if(d){for(var h=0;h<d.children.length;h++){u=!0;for(var b=d.children[parseInt(h.toString(),10)],m=b.querySelectorAll(".e-ribbon-item"),f=0;f<m.length;f++)if(!m[parseInt(f.toString(),10)].classList.contains("e-hidden")){u=!1;break}b.classList[u?"add":"remove"]("e-hide-group"),b.classList.contains("e-hide-group")||b.classList.contains("e-hidden")||(c=!1)}this.overflowDDB.element.classList[c?"add":"remove"](Fe)}}},s.prototype.createOverflowPopup=function(e,o,i,n,s,a,l,p){var c,u,h=d(this.tabs,n),b=this.tabObj.items[parseInt(o.toString(),10)].content.querySelector("#"+n);if(i){var m=l.querySelector("#"+n+Yt);m?c=t.getInstance(m,r.DropDownButton):((c=this.addOverflowButton(n+Yt,i)).element.classList.add($e),l.appendChild(c.element)),this.addKeyTip(o,"0"+(h.groupIndex+1),c.element.id,"grpofbtn"),u=c.target;var f=c.target;if(!f.querySelector("#"+n+Yt+Zt)&&h.group.overflowHeader){var y=this.createElement("div",{className:mt,id:n+Yt+Zt,innerHTML:h.group.overflowHeader});f.append(y)}b&&(b.classList.contains("e-disabled")&&f.classList.add("e-disabled"),b.classList.contains("e-hidden")&&f.classList.add("e-hidden"),b.classList.contains("e-hide-group")&&f.classList.add("e-hide-group")),p?f.insertBefore(a,f.querySelector("."+Ct)):f.append(a)}else{if(this.overflowDDB){this.overflowDDB.element.classList.remove(Fe);var g=this.overflowDDB.target,v=g.querySelector("#"+this.tabs[parseInt(o.toString(),10)].id+eo);if(v){var S=g.querySelector("#"+n+$t);S||(S=h.group.overflowHeader?this.createGroupContainer(n,h.group.overflowHeader):this.createGroupContainer(n,s),b&&(b.classList.contains("e-disabled")&&S.classList.add("e-disabled"),b.classList.contains("e-hidden")&&S.classList.add("e-hidden"),b.classList.contains("e-hide-group")&&S.classList.add("e-hide-group")),v.append(S)),p?S.insertBefore(a,S.querySelector("."+Ct)):S.append(a)}else this.createOfTabContainer(n,s,a,o)}else this.overflowDDB=this.addOverflowButton(this.tabObj.element.id+Xt,i),this.tabObj.element.insertBefore(this.overflowDDB.element,this.collapseButton),this.overflowDDB.element.classList.add(Qe),this.createOfTabContainer(n,s,a,o);c=this.overflowDDB,u=this.overflowDDB?this.overflowDDB.target:null}null!==a&&this.addOverflowEvents(e,a,c),u&&e.keyTip&&this.addKeyTip(o,e.keyTip,e.id,"popupitem")},s.prototype.addOverflowEvents=function(e,t,o){switch(e.type){case"Button":this.ribbonButtonModule.addOverFlowEvents(e,t,o);break;case"DropDown":this.ribbonDropDownModule.addOverFlowEvents(e,t,o);break;case"SplitButton":this.ribbonSplitButtonModule.addOverFlowEvents(e,t,o);break;case"CheckBox":this.ribbonCheckBoxModule.addOverFlowEvents(e,t,o);break;case"ColorPicker":this.ribbonColorPickerModule.addOverFlowEvents(e,t,o);break;case"ComboBox":this.ribbonComboBoxModule.addOverFlowEvents(e,t,o);break;case"Gallery":"Simplified"===this.activeLayout&&this.ribbonGalleryModule.addOverFlowEvents(e,t,o);break;case"GroupButton":if("Simplified"===this.activeLayout){this.ribbonGroupButtonModule.addOverFlowEvents(e,t,o);break}}},s.prototype.createOfTabContainer=function(e,t,o,i){var r=this.createElement("div",{id:this.tabs[parseInt(i.toString(),10)].id+eo,className:ut});this.overflowDDB.target.append(r);var n=d(this.tabs,e),s=n.group.overflowHeader?this.createGroupContainer(e,n.group.overflowHeader):this.createGroupContainer(e,t);s.append(o),r.append(s),i===this.selectedTab&&r.classList.add(Ve);var a=document.querySelector("#"+e);a&&(a.classList.contains("e-disabled")&&s.classList.add("e-disabled"),a.classList.contains("e-hidden")&&s.classList.add("e-hidden"),a.classList.contains("e-hide-group")&&s.classList.add("e-hide-group"))},s.prototype.checkGroupShrinking=function(e,t,o,i){for(var r=!0,n=!1,s=this.tabs[parseInt(e.toString(),10)],a=s.groups.length-1;r&&a>=0;a--)r=!(n=i?this.checkLargeToMedium(e,s,a,t,o):this.checkMediumToSmall(e,s,a,t,o))&&t.offsetWidth<o.offsetWidth;return n},s.prototype.checkValidCollectionLength=function(t){for(var o=0,i=0;i<t.length;i++){for(var r=t[parseInt(i.toString(),10)].items,n=0;n<r.length;n++)if(r[parseInt(n.toString(),10)].displayOptions&e.DisplayMode.Classic){o++;break}if(o>1)return!1}return 1===o},s.prototype.checkClassicCollection=function(t,o,i){for(var r=t[parseInt(o.toString(),10)].items,n=0;n<r.length;n++)if(r[parseInt(n.toString(),10)].displayOptions&e.DisplayMode.Classic)return o;return o=i?o+1:o-1,i?o===t.length?o:this.checkClassicCollection(t,o,i):o<0?o:this.checkClassicCollection(t,o,i)},s.prototype.checkClassicItem=function(t,o,i){return t[parseInt(o.toString(),10)].displayOptions&e.DisplayMode.Classic?o:(o=i?o+1:o-1,i?o===t.length?o:this.checkClassicItem(t,o,i):o<0?o:this.checkClassicItem(t,o,i))},s.prototype.checkLargeToMedium=function(t,o,i,r,n,s){var a=this;void 0===s&&(s=!1);var l=o.groups[parseInt(i.toString(),10)];if(l.isCollapsed&&!s)return!1;var p=function(e){return 1===e.items.length&&c(e.items[0])},c=function(t){return t.allowedSizes&e.RibbonItemSize.Medium&&t.activeSize===e.RibbonItemSize.Large},u=function(e,t,o,i){var r=a.createElement("div",{className:"e-ribbon-shrink "+Tt,id:e+"_shrink_container"+o,attrs:{"data-start":o.toString(),"data-end":i.toString()}});return t.parentElement.insertBefore(r,t),s||r.setAttribute("data-large-width",n.offsetWidth.toString()),r},d=function(o,r){for(var l=a.tabs[parseInt(t.toString(),10)].groups[parseInt(i.toString(),10)].collections[0],p=n.querySelector("#"+l.items[parseInt(o.toString(),10)].id+$t),c=s?n.querySelector("#"+l.id+"_shrink_container"+o):u(l.id,p,o,r),d=o;d<=r;d++){var h=l.items[parseInt(d.toString(),10)];if(h.displayOptions&e.DisplayMode.Classic){var b=n.querySelector("#"+h.id+$t);c.appendChild(b),h.setProperties({activeSize:e.RibbonItemSize.Medium},!0),h.type===e.RibbonItemType.GroupButton&&"Classic"===a.activeLayout?a.setItemSize(b.querySelector("#"+h.id+ao),h):a.setItemSize(b.querySelector("#"+h.id),h)}}},h=function(o,r){for(var l=a.tabs[parseInt(t.toString(),10)].groups[parseInt(i.toString(),10)],p=n.querySelector("#"+l.collections[parseInt(o.toString(),10)].id),c=s?n.querySelector("#"+l.id+"_shrink_container"+o):u(l.id,p,o,r),d=o;d<=r;d++){var h=l.collections[parseInt(d.toString(),10)],b=n.querySelector("#"+h.id);c.appendChild(b),h.items[0].setProperties({activeSize:e.RibbonItemSize.Medium},!0),h.items[0].type===e.RibbonItemType.GroupButton&&"Classic"===a.activeLayout?a.setItemSize(b.querySelector("#"+h.items[0].id+ao),h.items[0]):a.setItemSize(b.querySelector("#"+h.items[0].id),h.items[0])}};if(l.orientation===e.ItemOrientation.Column)for(var b=l.collections.length-1;b>0;b--){if((f=(b=this.checkClassicCollection(l.collections,b,!1))-1)>=0&&p(l.collections[parseInt(b.toString(),10)]))if((f=this.checkClassicCollection(l.collections,f,!1))>=0&&p(l.collections[parseInt(f.toString(),10)])){if((y=f-1)>=0&&(y=this.checkClassicCollection(l.collections,y,!1)),y>=0&&p(l.collections[parseInt(y.toString(),10)])?h(y,b):h(f,b),b=y,!s&&r.offsetWidth>n.offsetWidth)return!0}else b=f}else if(this.checkValidCollectionLength(l.collections)){var m=l.collections[0];for(b=m.items.length-1;b>0;b--){var f;if((f=(b=this.checkClassicItem(m.items,b,!1))-1)>=0&&c(m.items[parseInt(b.toString(),10)]))if((f=this.checkClassicItem(m.items,f,!1))>=0&&c(m.items[parseInt(f.toString(),10)])){var y;if((y=f-1)>=0&&(y=this.checkClassicItem(m.items,y,!1)),y>=0&&c(m.items[parseInt(y.toString(),10)])?d(y,b):d(f,b),b=y,!s&&r.offsetWidth>n.offsetWidth)return!0}else b=f}}return!1},s.prototype.checkMediumToSmall=function(t,o,i,r,n,s){var a=this;void 0===s&&(s=!1);var l=o.groups[parseInt(i.toString(),10)];if(l.isCollapsed&&!s)return!1;var p=l.orientation,c=n.querySelector("#"+l.id).querySelectorAll(".e-ribbon-shrink"),u=function(t){return t.allowedSizes&e.RibbonItemSize.Small&&t.activeSize===e.RibbonItemSize.Medium},d=function(o,r,s,l){void 0===l&&(l=null);var p=a.tabs[parseInt(t.toString(),10)].groups[parseInt(i.toString(),10)].collections[parseInt(o.toString(),10)],c=function(t){var o=p.items[parseInt(t.toString(),10)];if(o.displayOptions&e.DisplayMode.Classic){var i=n.querySelector("#"+o.id);o.setProperties({activeSize:e.RibbonItemSize.Small},!0),o.type===e.RibbonItemType.GroupButton&&(i=n.querySelector("#"+o.id+"_grpbtn")),a.setItemSize(i,o)}};c(r),l&&c(l),c(s)},h=function(o,r,l,p){void 0===p&&(p=null);var u=a.tabs[parseInt(t.toString(),10)].groups[parseInt(i.toString(),10)];s||c[parseInt(o.toString(),10)].setAttribute("data-medium-width",n.offsetWidth.toString());var d=function(t){var o=u.collections[parseInt(t.toString(),10)];if(o.items[0].displayOptions&e.DisplayMode.Classic){var i=n.querySelector("#"+o.items[0].id);o.items[0].setProperties({activeSize:e.RibbonItemSize.Small},!0),o.items[0].type===e.RibbonItemType.GroupButton&&(i=n.querySelector("#"+o.items[0].id+ao)),a.setItemSize(i,o.items[0])}};d(r),p&&d(p),d(l)},b=function(e){if(!s){n.querySelector("#"+e).setAttribute("data-medium-width",n.offsetWidth.toString())}};if(p===e.ItemOrientation.Column){if(c.length>0)for(var m=c.length-1;m>=0;m--){var f=parseInt(c[parseInt(m.toString(),10)].getAttribute("data-start"),10),y=parseInt(c[parseInt(m.toString(),10)].getAttribute("data-end"),10),g=this.checkClassicCollection(l.collections,f+1,!1);if(u(l.collections[parseInt(f.toString(),10)].items[0])&&u(l.collections[parseInt(g.toString(),10)].items[0])&&(y===g?h(m,f,y):u(l.collections[parseInt(y.toString(),10)].items[0])&&h(m,f,y,g),!s&&r.offsetWidth>n.offsetWidth))return!0}for(m=l.collections.length-1;m>=0;m--){for(var v=l.collections[parseInt(m.toString(),10)],S=[],I=0;I<v.items.length;I++)v.items[parseInt(I.toString(),10)].displayOptions&e.DisplayMode.Classic&&S.push(I);if(S.length>1&&u(v.items[S[0]])&&u(v.items[S[1]])&&(2===S.length?(b(v.id),d(m,S[0],S[1])):u(v.items[S[2]])&&(b(v.id),d(m,S[0],S[2],S[1])),!s&&r.offsetWidth>n.offsetWidth))return!0}}else if(this.checkValidCollectionLength(l.collections)){if(c.length>0)for(m=c.length-1;m>=0;m--){var C=c[parseInt(m.toString(),10)];f=parseInt(C.getAttribute("data-start"),10),y=parseInt(C.getAttribute("data-end"),10),v=l.collections[0],g=this.checkClassicItem(v.items,f+1,!1);if(u(l.collections[0].items[parseInt(f.toString(),10)])&&u(l.collections[0].items[parseInt(g.toString(),10)])&&(y===g?(b(C.id),d(0,f,y)):u(l.collections[0].items[parseInt(y.toString(),10)])&&(b(C.id),d(0,f,y,g)),!s&&r.offsetWidth>n.offsetWidth))return!0}}else for(m=l.collections.length-1;m>=0;m--)for(g=(v=l.collections[parseInt(m.toString(),10)]).items.length-1;g>=0;g--)if(!((g=this.checkClassicItem(v.items,g,!1))<0)){var T=v.items[parseInt(g.toString(),10)];if(u(T)&&(T.type!==e.RibbonItemType.GroupButton?b(T.id):b(T.id+ao),d(m,g,g),!s&&r.offsetWidth>n.offsetWidth))return!0}return!1},s.prototype.checkGroupExpanding=function(e,t,o,i){for(var r=!1,n=this.tabs[parseInt(e.toString(),10)],s=0;!r&&s<n.groups.length;s++)r=i?this.checkSmallToMedium(e,n,s,t,o,!1,!0):this.checkMediumToLarge(e,n,s,t,o,!1,!0);return r},s.prototype.checkSmallToMedium=function(t,o,i,r,n,s,a){var l=this,p=o.groups[parseInt(i.toString(),10)],c=p.orientation,u=n.querySelector("#"+p.id).querySelectorAll(".e-ribbon-shrink"),d=function(t){return t.allowedSizes&e.RibbonItemSize.Medium&&t.activeSize===e.RibbonItemSize.Small},h=function(o,r,n){var s=l.tabs[parseInt(t.toString(),10)].groups[parseInt(i.toString(),10)].collections[parseInt(o.toString(),10)].items[parseInt(r.toString(),10)];if(s.displayOptions&e.DisplayMode.Classic){var a=n.id===s.id?n:n.querySelector("#"+s.id);s.setProperties({activeSize:e.RibbonItemSize.Medium},!0),s.type===e.RibbonItemType.GroupButton&&(a=document.querySelector("#"+s.id+ao)),l.setItemSize(a,s)}},b=function(o){var r=l.tabs[parseInt(t.toString(),10)].groups[parseInt(i.toString(),10)].collections,s=r[parseInt(o.toString(),10)].items[0];if(s.displayOptions&e.DisplayMode.Classic){var a=n.querySelector("#"+r[parseInt(o.toString(),10)].items[0].id);r[parseInt(o.toString(),10)].items[0].setProperties({activeSize:e.RibbonItemSize.Medium},!0),s.type===e.RibbonItemType.GroupButton&&(a=n.querySelector("#"+r[parseInt(o.toString(),10)].items[0].id+ao)),l.setItemSize(a,r[parseInt(o.toString(),10)].items[0])}};if(c===e.ItemOrientation.Row){if(!this.checkValidCollectionLength(p.collections))for(var m=0;m<p.collections.length;m++)for(var f=p.collections[parseInt(m.toString(),10)],y=0;y<f.items.length;y++)if((y=this.checkClassicItem(f.items,y,!0))!==f.items.length){var g=f.items[parseInt(y.toString(),10)];if(d(g)){var v=n.querySelector("#"+g.id);"GroupButton"===g.type&&(v=n.querySelector("#"+g.id+ao));if((S=(T=v.getAttribute("data-medium-width"))?parseInt(T,10):null)&&(s||r.offsetWidth>S))h(m,y,v),s&&!a||v.removeAttribute("data-medium-width");else if(S)return!0}}}else for(m=0;m<p.collections.length;m++)if(p.collections[parseInt(m.toString(),10)].items.length>1){f=p.collections[parseInt(m.toString(),10)];for(var S=(T=(v=n.querySelector("#"+f.id)).getAttribute("data-medium-width"))?parseInt(T,10):null,I=[],C=0;C<f.items.length;C++)f.items[parseInt(C.toString(),10)].displayOptions&e.DisplayMode.Classic&&I.push(C);if(I.length>1&&S&&(s||r.offsetWidth>S))h(m,I[0],v),h(m,I[1],v),3===I.length&&h(m,I[2],v),s&&!a||v.removeAttribute("data-medium-width");else if(S)return!0}if(u.length>0)for(m=0;m<u.length;m++){var T,w=u[parseInt(m.toString(),10)];if((S=(T=w.getAttribute("data-medium-width"))?parseInt(T,10):null)&&(s||r.offsetWidth>S)){var k=parseInt(w.getAttribute("data-start"),10),O=parseInt(w.getAttribute("data-end"),10);if(c===e.ItemOrientation.Row){f=p.collections[0],y=this.checkClassicItem(f.items,k+1,!0);h(0,k,w),h(0,y,w),y!==O&&h(0,O,w)}else{var B=this.checkClassicCollection(p.collections,k+1,!0);b(k),b(B),B!==O&&b(O)}s&&!a||w.removeAttribute("data-medium-width")}else if(S)return!0}return!1},s.prototype.checkMediumToLarge=function(o,i,r,n,s,a,l){var p=this,c=i.groups[parseInt(r.toString(),10)],u=c.orientation,d=s.querySelector("#"+c.id).querySelectorAll(".e-ribbon-shrink");if(0===d.length)return!1;for(var h=function(i,n,s,c){var u=p.tabs[parseInt(o.toString(),10)].groups[parseInt(r.toString(),10)].collections[0].items,d=function(t){var o=u[parseInt(t.toString(),10)];if(o.displayOptions&e.DisplayMode.Classic){var i=s.querySelector("#"+o.id+$t),r=i.querySelector("#"+o.id);o.setProperties({activeSize:e.RibbonItemSize.Large},!0),o.type===e.RibbonItemType.GroupButton&&(r=i.querySelector("#"+o.id+ao)),p.setItemSize(r,o),s.insertAdjacentElement("beforebegin",i)}};d(i),c&&d(c),d(n),a&&!l||t.remove(s)},b=function(i,n,s,c){var u=p.tabs[parseInt(o.toString(),10)].groups[parseInt(r.toString(),10)].collections,d=function(t){var o=u[parseInt(t.toString(),10)];if(o.items[0].displayOptions&e.DisplayMode.Classic){var i=s.querySelector("#"+o.id),r=i.querySelector("#"+o.items[0].id);o.items[0].setProperties({activeSize:e.RibbonItemSize.Large},!0),o.items[0].type===e.RibbonItemType.GroupButton&&(r=i.querySelector("#"+o.items[0].id+ao)),p.setItemSize(r,o.items[0]),s.insertAdjacentElement("beforebegin",i)}};d(i),c&&d(c),d(n),a&&!l||t.remove(s)},m=0;m<d.length;m++){var f=d[parseInt(m.toString(),10)],y=f.getAttribute("data-large-width"),g=y?parseInt(y,10):null;if(g&&(a||n.offsetWidth>g)){var v=parseInt(f.getAttribute("data-start"),10),S=parseInt(f.getAttribute("data-end"),10);if(u===e.ItemOrientation.Row){var I=c.collections[0],C=this.checkClassicItem(I.items,v+1,!0);C===S?h(v,S,f):h(v,S,f,C)}else{var T=this.checkClassicCollection(c.collections,v+1,!0);T===S?b(v,S,f):b(v,S,f,T)}a&&!l||f.removeAttribute("data-large-width")}else if(g)return!0}return!1},s.prototype.handleContentSize=function(e,t){var o=e.closest("."+ht);t?o.classList.add(Pt):o.classList.remove(Pt)},s.prototype.setItemSize=function(o,i){if(o){var r=o.closest("."+Ct);i.type===e.RibbonItemType.Button?this.ribbonButtonModule.updateButtonSize(o,i):i.type===e.RibbonItemType.DropDown?this.ribbonDropDownModule.updateDropDownSize(o,i):i.type===e.RibbonItemType.SplitButton?this.ribbonSplitButtonModule.updateSplitButtonSize(o,i):i.type===e.RibbonItemType.Template?(t.remove(o),this.createTemplateContent(i,r)):i.type===e.RibbonItemType.GroupButton&&this.ribbonGroupButtonModule.updateGroupButtonSize(o,i),r.classList.remove(Pt,kt,Ot,Bt),i.activeSize===e.RibbonItemSize.Large?r.classList.add(kt,Pt):r.classList.add(i.activeSize===e.RibbonItemSize.Medium?Ot:Bt)}},s.prototype.createOverflowDropdown=function(o,i,n){var s=this.getGroupResizeOrder(!0,o);if(0!==s.length)for(var a=function(a){var c=s[parseInt(a.toString(),10)],u=p.tabObj.element.querySelector("#"+c.id);u.setAttribute("data-expanded-width",n.offsetWidth.toString());var d=u.querySelector("#"+c.id+$t),h=p.createElement("div",{className:ft+" "+kt,id:c.id+eo+$t});u.insertBefore(h,d);var b=l(p.tabs[parseInt(o.toString(),10)].groups,function(e){return e.id===c.id}),m=p.tabs[parseInt(o.toString(),10)];p.checkSmallToMedium(o,m,b,i,n,!0,!1),p.checkMediumToLarge(o,m,b,i,n,!0,!1);var f=p.ribbonDropDownModule.createOverFlowDropDown(c.id,c.header,c.groupIconCss,d,h,p.enableRtl);if(c.keyTip){var y=c.id+eo+to;p.addKeyTip(o,c.keyTip,y,"grpoverflow")}p.tabs[parseInt(o.toString(),10)].groups[parseInt(b.toString(),10)].setProperties({isCollapsed:!0},!0);for(var g=0;g<c.collections.length;g++)for(var v=c.collections[parseInt(g.toString(),10)],S=d.querySelector("#"+v.id),I=0;I<v.items.length;I++){var C=v.items[parseInt(I.toString(),10)],T=S.querySelector("#"+C.id+$t);null!==T&&(p.handleContentSize(T),p.addOverflowEvents(C,T,f));y=document.querySelector("#"+c.id+eo+to);var w=t.getInstance(y,r.DropDownButton);if(w){if(w.target&&p.keyTipElements[parseInt(o.toString(),10)]){if(C.type===e.RibbonItemType.GroupButton)for(var k=0;k<C.groupButtonSettings.items.length;k++)C.groupButtonSettings.items[parseInt(k.toString(),10)].keyTip&&p.addKeyTip(o,C.groupButtonSettings.items[parseInt(k.toString(),10)].keyTip,C.id+(ao+k),"grpoverflowpopup");C.keyTip&&p.addKeyTip(o,C.keyTip,C.id,"grpoverflowpopup")}}}},p=this,c=0;c<s.length&&i.offsetWidth<n.offsetWidth;c++)a(c)},s.prototype.removeOverflowDropdown=function(e,t,o,i){void 0===o&&(o=!1);var r=this.getGroupResizeOrder(!1,i);if(0===r.length)return!1;for(var n=function(n){var a=r[parseInt(n.toString(),10)],p=s.tabObj.element.querySelector("#"+a.id);if(!p)return"break";var c=parseInt(p.getAttribute("data-expanded-width"),10);if(!o&&e.offsetWidth<c)return{value:!0};s.removeDropdown(a.id);var u=l(s.tabs[parseInt(i.toString(),10)].groups,function(e){return e.id===a.id});s.tabs[parseInt(i.toString(),10)].groups[parseInt(u.toString(),10)].setProperties({isCollapsed:!1},!0);var d=s.tabs[parseInt(i.toString(),10)];s.checkLargeToMedium(i,d,u,e,t,!0),s.checkMediumToSmall(i,d,u,e,t,!0);for(var h=0;h<a.collections.length;h++)for(var b=a.collections[parseInt(h.toString(),10)],m=p.querySelector("#"+b.id),f=0;f<b.items.length;f++){var y=b.items[parseInt(f.toString(),10)],g=m.querySelector("#"+y.id+$t);null!==g&&(s.handleContentSize(g,!0),s.removeOverflowEvent(y,g))}},s=this,a=0;a<r.length;a++){var p=n(a);if("object"==typeof p)return p.value;if("break"===p)break}return!1},s.prototype.removeDropdown=function(e){var o=this.tabObj.element.querySelector("#"+e+eo+to);if(o){var i=o.parentElement;this.ribbonDropDownModule.removeOverFlowDropDown(o),t.remove(i)}},s.prototype.getGroupResizeOrder=function(e,o){var i=this,r=this.tabs[parseInt(o.toString(),10)].groups;return(r=r.filter(function(o){return"Classic"!==i.activeLayout||(t.isUndefined(o.isCollapsible)||o.isCollapsible)&&(e&&t.isUndefined(o.isCollapsed)||!t.isUndefined(o.isCollapsed)&&e!==o.isCollapsed)})).sort(function(e,t){return e.priority-t.priority}),e?r.reverse():r},s.prototype.destroyScroll=function(){this.scrollModule&&(this.scrollModule.destroy(),this.scrollModule=null)},s.prototype.clearOverflowDropDown=function(e){var t=this.tabObj.element.querySelector("#"+this.tabs[parseInt(e.toString(),10)].id+Qt);if(t){var o=t.closest("."+ot);"Simplified"===this.activeLayout?this.removeSimplfiedOverflow(t,o,e,!0):this.removeOverflowDropdown(t,o,!0,e)}},s.prototype.isContextualTab=function(e){var t=!1;if(this.contextualTabs.length)for(var o=0;o<this.contextualTabs.length;o++)for(var i=0;i<this.contextualTabs[parseInt(o.toString(),10)].tabs.length;i++)if(this.contextualTabs[parseInt(o.toString(),10)].tabs[parseInt(i.toString(),10)].id===e){t=!0;break}return t},s.prototype.ribbonTabSelecting=function(e){var o=this;this.currentControlIndex=0;var i=e.selectingItem.getAttribute("data-id"),r=e.previousItem.getAttribute("data-id"),n=l(this.tabs,function(e){return e.id===i}),s=this.isContextualTab(i),a=l(this.tabs,function(e){return e.id===r});n=-1===n?this.selectedTab:n;var p={cancel:e.cancel,isInteracted:e.isInteracted,previousIndex:a,selectedIndex:n,isContextual:s};this.trigger("tabSelecting",p,function(e){if(!e.cancel){o.destroyScroll(),o.isAddRemove||-1===a||o.clearOverflowDropDown(a);var i=o.tabObj.items[parseInt(n.toString(),10)].content;if(!i.querySelector("."+rt)&&0!==o.tabs[parseInt(n.toString(),10)].groups.length){var r=o.createGroups(o.tabs[parseInt(n.toString(),10)].groups,n);t.append(r,i)}}})},s.prototype.createTabItems=function(e){for(var t=this,o=[],i=function(i){var n=e[parseInt(i.toString(),10)],s=r.createElement("span",{innerHTML:n.header,id:n.id+Zt}),a=l(r.tabs,function(e){return e.id===n.id});n.keyTip&&(r.keyTipElements[parseInt(a.toString(),10)]||(r.keyTipElements[parseInt(a.toString(),10)]={}),r.addKeyTip(a,n.keyTip,n.id,"tab")),s.onclick=function(){t.minimize(!1)},s.ondblclick=function(){t.minimize(!0)};var p={header:{text:s},id:n.id,cssClass:n.cssClass},c=r.createElement("div",{className:p.cssClass,id:n.id+Qt});c.classList.add(Xe),p.content=c,o.push(p)},r=this,n=0;n<e.length;n++)i(n);return o},s.prototype.renderInitialTab=function(e){var o=this.createGroups(this.tabs[parseInt(e.toString(),10)].groups,e),i=this.tabObj.items[parseInt(e.toString(),10)].content;t.append(o,i),"Simplified"===this.activeLayout&&this.element.classList.add(jt);var r=this.tabObj.element.querySelector("#"+this.tabs[this.selectedTab].id+Qt);this.checkOverflow(this.selectedTab,r),"Classic"===this.activeLayout&&this.ribbonGalleryModule&&this.ribbonGalleryModule.checkAvailableHeight(this.selectedTab,r)},s.prototype.addOverflowButton=function(e,o){var i=this,n=this.createElement("button",{id:e}),s=this.createElement("div",{className:et,attrs:{tabindex:"0"}}),a=new r.DropDownButton({iconCss:_e,cssClass:"e-caret-hide "+yt,target:s,locale:this.locale,enableRtl:this.enableRtl,enablePersistence:this.enablePersistence,beforeOpen:function(e){var t={element:e.element,event:e.event,cancel:e.cancel};i.trigger("overflowPopupOpen",t,function(t){t.cancel&&(e.cancel=!0)})},beforeClose:function(e){var o=e.event?t.closest(e.event.target,"."+Ne):null,r=e.event?t.closest(e.event.target,".e-ribbon-group-button-overflow-popup"):null,n={element:e.element,event:e.event,cancel:e.cancel};i.trigger("overflowPopupClose",n,function(t){(o||t.cancel||r)&&(e.cancel=!0)})}},n);this.element.classList.add(tt),v(s,this),o||(this.keyTipElements.overflowbtn=[],this.keyTipElements.overflowbtn.push({id:e,type:"overflowbtn",keyTip:"00"}));var l;return n.onkeydown=n.onclick=function(){i.itemIndex=-1,l=!n.classList.contains("e-ribbon-overall-of-btn")},s.onkeydown=function(e){return i.upDownKeyHandler(e,s,l),i},a},s.prototype.upDownKeyHandler=function(e,o,i){var r;if(i)r=o.getElementsByClassName("e-ribbon-item");else{r=o.querySelector(".e-ribbon-of-tab.e-ribbon-active").getElementsByClassName("e-ribbon-item")}var s,a,l=r[!this.itemIndex||this.itemIndex<0?0:this.itemIndex].querySelector(".e-control"),p=l&&l.classList.contains("e-combobox")?r[!this.itemIndex||this.itemIndex<0?0:this.itemIndex].querySelector(".e-combobox"):null;if(null===p||"Tab"===e.key||this.itemIndex<0){if("ArrowDown"===e.key||!e.shiftKey&&"Tab"===e.key){if(!this.itemIndex&&0!==this.itemIndex||this.itemIndex<0||this.itemIndex===r.length-1){if(this.itemIndex=0,s=r[this.itemIndex].closest(".e-ribbon-item"),this.findDisabledItem(s,r,!0),p&&"Tab"===e.key){e.preventDefault();(c=r[this.itemIndex].querySelector(".e-control"))&&c.focus()}a=r[this.itemIndex].querySelector(".e-ribbon-template")}else this.itemIndex<r.length-1&&this.itemIndex>=0&&(this.itemIndex++,s=r[this.itemIndex].closest(".e-ribbon-item"),this.findDisabledItem(s,r,!0),a=r[this.itemIndex].querySelector(".e-ribbon-template"));a&&a.focus()}else if(("ArrowUp"===e.key||e.shiftKey&&"Tab"===e.key)&&(null===p||"Tab"===e.key)){if(this.itemIndex&&-1!==this.itemIndex)this.itemIndex<=r.length-1&&this.itemIndex>0&&(this.itemIndex--,s=r[this.itemIndex].closest(".e-ribbon-item"),this.findDisabledItem(s,r,!1),a=r[this.itemIndex].querySelector(".e-ribbon-template"));else{if(this.itemIndex=r.length-1,s=r[this.itemIndex].closest(".e-ribbon-item"),this.findDisabledItem(s,r,!1),p&&e.shiftKey&&"Tab"===e.key){e.preventDefault();var c;(c=r[this.itemIndex].querySelector(".e-control"))&&c.focus()}a=r[this.itemIndex].querySelector(".e-ribbon-template")}a&&a.focus()}o.setAttribute("index",this.itemIndex.toString())}var u=parseInt(o.getAttribute("index"),10),d="",h=r[parseInt(u.toString(),10)]?r[parseInt(u.toString(),10)].querySelector(".e-control"):null;if(h&&(d=h.getAttribute("data-control")),"ArrowDown"===e.key||"ArrowUp"===e.key||" "===e.key||"Tab"===e.key){if("ColorPicker"===d)"Tab"===e.key&&e.preventDefault(),r[parseInt(u.toString(),10)].querySelector(".e-split-colorpicker").focus();else{"Tab"===e.key&&e.preventDefault();var b=r[parseInt(u.toString(),10)].querySelector(".e-control");b&&b.focus()}if(" "===e.key&&"CheckBox"===d){var m=r[parseInt(u.toString(),10)].querySelector(".e-control"),f=t.getComponent(m,n.CheckBox);this.itemIndex=-1,f.click()}}"SplitButton"!==d||"ArrowRight"!==e.key&&"ArrowLeft"!==e.key||("ArrowRight"===e.key&&(this.enableRtl?r[parseInt(u.toString(),10)].querySelector(".e-control").focus():r[parseInt(u.toString(),10)].querySelector(".e-dropdown-btn").focus()),"ArrowLeft"===e.key&&(this.enableRtl?r[parseInt(u.toString(),10)].querySelector(".e-dropdown-btn").focus():r[parseInt(u.toString(),10)].querySelector(".e-control").focus())),"Enter"===e.key&&(this.itemIndex=-1)},s.prototype.findDisabledItem=function(e,t,o){for(;e&&e.classList.contains("e-disabled");)o?this.itemIndex===t.length-1&&t[this.itemIndex].closest(".e-ribbon-item").classList.contains("e-disabled")&&(this.itemIndex=-1):0===this.itemIndex&&t[this.itemIndex].closest(".e-ribbon-item").classList.contains("e-disabled")&&(this.itemIndex=t.length),o?this.itemIndex++:this.itemIndex--,e=t[this.itemIndex].closest(".e-ribbon-item")},s.prototype.removeOverflowButton=function(e){if(e){var t=e.element;S(e.target),e.destroy(),t.remove()}},s.prototype.removeOverflowEvent=function(e,t){if(t)switch(e.type){case"Button":this.ribbonButtonModule.removeOverFlowEvents(e,t);break;case"DropDown":this.ribbonDropDownModule.removeOverFlowEvents(e,t);break;case"SplitButton":this.ribbonSplitButtonModule.removeOverFlowEvents(e,t);break;case"CheckBox":this.ribbonCheckBoxModule.removeOverFlowEvents(e,t);break;case"ColorPicker":this.ribbonColorPickerModule.removeOverFlowEvents(e,t);break;case"ComboBox":this.ribbonComboBoxModule.removeOverFlowEvents(e,t);break;case"Gallery":this.ribbonGalleryModule.removeOverFlowEvents(e,t);break;case"GroupButton":this.ribbonGroupButtonModule.removeOverFlowEvents(e,t)}},s.prototype.createGroupContainer=function(e,t){var o=this.createElement("div",{className:dt,id:e+$t}),i=this.createElement("div",{className:mt,id:e+Zt,innerHTML:t});return o.append(i),o},s.prototype.addExpandCollapse=function(){var e=this;this.collapseButton=this.createElement("span",{className:Ye+" "+xe,id:this.tabObj.element.id+Vt,attrs:{tabindex:"0",type:"button","aria-label":"Layout Switcher",role:"button"}}),this.collapseButton.onclick=function(){e.toggleLayout()},this.collapseButton.onkeydown=function(t){"Enter"===t.key&&e.toggleLayout()},this.element.classList.add(Je),"Simplified"===this.activeLayout&&this.collapseButton.classList.add(Ze),this.tabObj.element.appendChild(this.collapseButton),this.layoutSwitcherKeyTip&&(this.keyTipElements.collapse=[],this.keyTipElements.collapse.push({id:this.collapseButton.id,type:"collapse",keyTip:this.layoutSwitcherKeyTip}))},s.prototype.removeExpandCollapse=function(){var e=this,o=l(this.tooltipData,function(t){return t.id===e.collapseButton.id});-1!==o&&this.tooltipData.splice(o,1),this.element.classList.remove(Je),t.remove(this.tabObj.element.querySelector("."+Ye)),this.collapseButton=null},s.prototype.reRenderTabs=function(e){this.destroyScroll(),this.checkID(this.tabs,"tab",this.element.id);for(var o in e){for(var i=parseInt(o,10),r=e[parseInt(i.toString(),10)],n=!1,s=0;s<this.tabObj.items.length;s++)if(this.tabs[parseInt(i.toString(),10)].id===this.tabObj.items[parseInt(s.toString(),10)].id){n=!0;break}if(!n){this.destroyTabItems(this.tabsInternal),this.tabsInternal=this.tabs.slice(),this.validateItemSize();var a=this.createTabItems(this.tabs);this.selectedTab>=this.tabs.length&&(this.selectedTab=this.tabs.length-1),this.tabObj.setProperties({items:a,selectedItem:this.selectedTab});break}var l=this.tabs[parseInt(i.toString(),10)].groups,p=this.tabObj.element,c=this.tabs[parseInt(i.toString(),10)];c.setProperties(r,!0),this.setProperties({groups:this.checkID(c.groups,"group",c.id)},!0),this.validateItemSize();var u=this.tabObj.items[parseInt(i.toString(),10)].content;if(l&&(r.header&&(this.tabObj.items[parseInt(i.toString(),10)].header.text.innerText=c.header),r.cssClass&&(this.tabObj.items[parseInt(i.toString(),10)].cssClass&&(u.classList.remove(this.tabObj.items[parseInt(i.toString(),10)].cssClass),p.querySelector(".e-active").classList.remove(this.tabObj.items[parseInt(i.toString(),10)].cssClass)),u.classList.add(c.cssClass),p.querySelector(".e-active").classList.add(c.cssClass)),r.groups)){for(var d=0,h=l;d<h.length;d++){for(var b=h[d],m=b.isCollapsed?u.querySelector("#"+b.id+eo+to):null,f=0,y=b.collections;f<y.length;f++)for(var g=0,v=y[f].items;g<v.length;g++){var S=v[g],I=m?this.ribbonDropDownModule.getDDBItemElement(m,S.id):u.querySelector("#"+S.id);I&&this.destroyFunction(S,I)}m&&this.ribbonDropDownModule.removeOverFlowDropDown(m)}u.querySelectorAll(".e-ribbon-group").forEach(function(e){e.remove()});var C=this.createGroups(c.groups,i);t.append(C,u)}}var T=this.tabObj.element.querySelector("#"+this.tabs[this.selectedTab].id+Qt);this.checkOverflow(this.selectedTab,T)},s.prototype.switchLayout=function(){this.currentControlIndex=0,this.destroyScroll(),this.collapseButton.classList.toggle(Ze,"Simplified"===this.activeLayout),this.element.classList.toggle(jt,"Simplified"===this.activeLayout);for(var o=0;o<=this.tabs.length-1;o++){var i=o;if(""!==this.tabObj.items[parseInt(i.toString(),10)].content.innerHTML){var n=this.tabs[parseInt(i.toString(),10)],s=this.tabs[parseInt(i.toString(),10)].groups,a=this.tabObj.element.querySelector("#"+this.tabs[parseInt(i.toString(),10)].id+Qt),l=a.closest("."+ot);if("Simplified"===this.activeLayout)for(var p=0;p<s.length;p++){var c=s[parseInt(p.toString(),10)],u=s[parseInt(p.toString(),10)].orientation;c.isCollapsed?(c.setProperties({isCollapsed:!1},!0),this.removeDropdown(c.id)):(this.checkSmallToMedium(i,n,p,l,a,!0,!1),this.checkMediumToLarge(i,n,p,l,a,!0,!1));for(var d=l.querySelector("#"+c.id),h=(O=d.querySelector("#"+c.id+$t)).querySelectorAll(".e-ribbon-shrink"),b=0;b<h.length;b++)h[parseInt(b.toString(),10)].remove();(P=O.querySelector("#"+c.id+Zt)).remove();(B=O.querySelector("#"+c.id+Qt)).classList.replace(Tt,wt),B.classList.remove(Pt);for(var m=0;m<c.collections.length;m++){var f=c.collections[parseInt(m.toString(),10)];(R=O.querySelector("#"+f.id)).classList.replace(Tt,wt);for(var y=0;y<f.items.length;y++){for(var g=f.items,v=f.items[parseInt(y.toString(),10)],S=!0;S&&v.displayOptions===e.DisplayMode.Classic;){y++;var I=O.querySelector("#"+v.id+$t),C=I.querySelector("#"+v.id);this.destroyFunction(v,C),I.remove(),y<g.length?v=g[parseInt(y.toString(),10)]:S=!1}if(!S)break;var T=v.allowedSizes===e.RibbonItemSize.Large||v.allowedSizes&e.RibbonItemSize.Medium?e.RibbonItemSize.Medium:e.RibbonItemSize.Small;T=!(v.displayOptions&e.DisplayMode.Simplified)&&v.displayOptions&e.DisplayMode.Overflow?e.RibbonItemSize.Medium:T;var w=void 0;if(v.displayOptions&e.DisplayMode.Classic){if(w=O.querySelector("#"+v.id+$t),v.displayOptions===(e.DisplayMode.Classic|e.DisplayMode.Overflow)&&(this.createOverflowPopup(v,i,c.enableGroupOverflow,c.id,c.header,w,O),v.type!==e.RibbonItemType.DropDown&&v.type!==e.RibbonItemType.SplitButton&&v.type!==e.RibbonItemType.GroupButton&&v.type!==e.RibbonItemType.Gallery||this.updatePopupItems(v,w,c.enableGroupOverflow,!0)),v.type===e.RibbonItemType.GroupButton&&this.ribbonGroupButtonModule.switchGroupButton(v,w),v.setProperties({activeSize:T},!0),w){C=w.querySelector("#"+v.id);this.setItemSize(C,v)}}else w=this.createItems([v],u,c.id,c.header,c.enableGroupOverflow,i,O)[0],v.displayOptions&e.DisplayMode.Simplified&&R.append(w);v.type===e.RibbonItemType.Gallery&&this.ribbonGalleryModule.switchGalleryItems(this.activeLayout,v.id)}}c.enableGroupOverflow||d.querySelector("."+Ct)||d.classList.add("e-ribbon-emptyCollection")}else{this.element.classList.remove(tt);for(var k=0;k<s.length;k++){c=s[parseInt(k.toString(),10)],u=s[parseInt(k.toString(),10)].orientation;var O,B=(O=l.querySelector("#"+c.id+$t)).querySelector("#"+c.id+Qt),P=this.createElement("div",{className:bt,id:c.id+Zt,innerHTML:c.header});O.appendChild(P),"Row"===u&&B.classList.replace(wt,Tt),B.classList.add(Pt);for(m=0;m<c.collections.length;m++){var L=void 0,E=void 0;if(c.enableGroupOverflow){var D=O.querySelector("#"+c.id+Yt);D&&(E=(L=t.getInstance(D,r.DropDownButton)).target)}else(L=this.overflowDDB)&&(E=this.overflowDDB.target);f=c.collections[parseInt(m.toString(),10)];var R=O.querySelector("#"+f.id);"Column"===u&&R.classList.replace(wt,Tt);for(y=0;y<f.items.length;y++){for(g=f.items,v=f.items[parseInt(y.toString(),10)],S=!0;S&&!(v.displayOptions&e.DisplayMode.Classic);){y++;w=void 0;if((v.displayOptions&e.DisplayMode.Simplified||v.displayOptions&e.DisplayMode.Overflow)&&null!==(w=v.displayOptions&e.DisplayMode.Simplified?O.querySelector("#"+v.id+$t):E.querySelector("#"+v.id+$t))){var x=w.querySelector("#"+v.id);this.destroyFunction(v,x),w.remove()}y<g.length?v=g[parseInt(y.toString(),10)]:S=!1}if(!S)break;if(v.displayOptions&(e.DisplayMode.Simplified|e.DisplayMode.Overflow)){!(w=O.querySelector("#"+v.id+$t))&&E&&(w=E.querySelector("#"+v.id+$t),v.type!==e.RibbonItemType.DropDown&&v.type!==e.RibbonItemType.SplitButton&&v.type!==e.RibbonItemType.GroupButton&&v.type!==e.RibbonItemType.Gallery||this.updatePopupItems(v,w,c.enableGroupOverflow,!1),this.removeOverflowEvent(v,w)),v.type===e.RibbonItemType.GroupButton&&this.ribbonGroupButtonModule.switchGroupButton(v,w),w&&R.append(w)}else{var w=this.createItems([v],u,c.id,c.header,c.enableGroupOverflow,i)[0];R.append(w)}C=O.querySelector("#"+v.id);v.type===e.RibbonItemType.GroupButton&&(C=O.querySelector("#"+v.id+ao));var M=v.allowedSizes&e.RibbonItemSize.Large?e.RibbonItemSize.Large:v.allowedSizes&e.RibbonItemSize.Medium?e.RibbonItemSize.Medium:e.RibbonItemSize.Small;v.setProperties({activeSize:M},!0),this.setItemSize(C,v),v.type===e.RibbonItemType.Gallery&&this.ribbonGalleryModule.switchGalleryItems(this.activeLayout,v.id)}c.enableGroupOverflow&&L&&(0===E.childElementCount||1===E.childElementCount&&this.isHeaderVisible(E,c.id))&&this.removeOverflowButton(L)}}}this.selectedTab===i&&this.checkOverflow(i,a)}}"Classic"===this.activeLayout&&(this.removeOverflowButton(this.overflowDDB),this.overflowDDB=null)},s.prototype.createLauncherIcon=function(e,o,i){var r=this,n=this.createElement("div",{className:vt+" "+(this.launcherIconCss?this.launcherIconCss:St),id:e+Jt,attrs:{tabindex:"0",type:"button","aria-label":"Launcher Icon",role:"button"}});o.appendChild(n),o.classList.add(gt),t.EventHandler.add(n,"click",this.launcherIconClicked.bind(this,e),this),t.EventHandler.add(n,"keydown",function(t){"Enter"===t.key&&r.launcherIconClicked(e)},this);var s=d(this.tabs,e);s.group.launcherIconKeyTip&&this.addKeyTip(i,s.group.launcherIconKeyTip,n.id,"launcher")},s.prototype.launcherIconClicked=function(e){var t={groupId:e};this.trigger("launcherIconClick",t)},s.prototype.createGroups=function(e,o){for(var i=[],r=0;r<e.length;r++){var n=e[parseInt(r.toString(),10)],s=n.orientation,a=this.createElement("div",{className:n.cssClass,id:n.id});a.classList.add(rt),i.push(a);var l=this.createElement("div",{className:n.cssClass,id:n.id+$t});l.classList.add(ct),a.appendChild(l);var p=this.createElement("div",{className:"Simplified"===this.activeLayout?ht:ht+" "+Pt,id:n.id+Qt});if(p.classList.add("Column"===s||"Simplified"===this.activeLayout?wt:Tt),l.appendChild(p),"Classic"===this.activeLayout){var c=this.createElement("div",{className:bt,id:n.id+Zt,innerHTML:n.header});l.appendChild(c)}n.showLauncherIcon&&this.createLauncherIcon(n.id,l,o);var u=this.createCollection(n.collections,n.orientation,n.id,n.header,n.enableGroupOverflow,o,l);t.append(u,p);for(var d=!0,h=0;h<u.length;h++)if(d)for(var b=0;b<u[parseInt(h.toString(),10)].children.length;b++)if(!u[parseInt(h.toString(),10)].children[parseInt(b.toString(),10)].classList.contains("e-hidden")){d=!1;break}d&&a.classList.add("e-hide-group"),"Simplified"!==this.activeLayout||n.enableGroupOverflow||a.querySelector("."+Ct)||a.classList.add("e-ribbon-emptyCollection");var m=this.initialPropsData[parseInt(o.toString(),10)];m&&(m.hiddenGroups&&m.hiddenGroups.length&&this.updateGroupProps("hiddenGroups",m,a),m.disabledGroups&&m.disabledGroups.length&&this.updateGroupProps("disabledGroups",m,a))}return this.initialPropsData[parseInt(o.toString(),10)]&&delete this.initialPropsData[parseInt(o.toString(),10)],i},s.prototype.updateGroupProps=function(e,t,o){-1!==t[e].indexOf(o.id)&&("hiddenGroups"===e?o.classList.add("e-hidden"):o.classList.add("e-disabled"))},s.prototype.validateItemSize=function(){for(var t=0;t<this.tabs.length;t++)for(var o=this.tabs[parseInt(t.toString(),10)].groups,i=0;i<o.length;i++)for(var r=o[parseInt(i.toString(),10)].collections,n=o[parseInt(i.toString(),10)].orientation,s=0;s<r.length;s++)for(var a=r[parseInt(s.toString(),10)].items,l=0;l<a.length;l++){var p=a[parseInt(l.toString(),10)];if(p.allowedSizes&&0!==p.allowedSizes||p.setProperties({allowedSizes:e.RibbonItemSize.Small|e.RibbonItemSize.Medium|e.RibbonItemSize.Large},!0),"ColorPicker"===p.type&&p.allowedSizes!==e.RibbonItemSize.Small)p.setProperties({allowedSizes:e.RibbonItemSize.Small},!0);else if("ComboBox"!==p.type&&"CheckBox"!==p.type||p.allowedSizes===e.RibbonItemSize.Medium){if(("Column"===n&&a.length>1||"Row"===n&&r.length>1)&&p.allowedSizes&e.RibbonItemSize.Large){var c=p.allowedSizes&(e.RibbonItemSize.Small|e.RibbonItemSize.Medium);c=c||e.RibbonItemSize.Medium,p.setProperties({allowedSizes:c},!0)}}else p.setProperties({allowedSizes:e.RibbonItemSize.Medium},!0);var u=p.allowedSizes&e.RibbonItemSize.Large?e.RibbonItemSize.Large:p.allowedSizes&e.RibbonItemSize.Medium?e.RibbonItemSize.Medium:e.RibbonItemSize.Small;p.setProperties({activeSize:u},!0)}},s.prototype.createCollection=function(e,o,i,r,n,s,a){for(var l=[],p=0;p<e.length;p++){var c=e[parseInt(p.toString(),10)],u=this.createElement("div",{className:c.cssClass,id:c.id});u.classList.add(It),u.classList.add("Column"!==o||"Simplified"===this.activeLayout?wt:Tt),l.push(u);var d=this.createItems(c.items,o,i,r,n,s,a);if(t.append(d,u),"Row"===o&&2===p)break}return l},s.prototype.createRibbonItem=function(e,t){switch(e.type){case"Button":this.ribbonButtonModule.createButton(e,t);break;case"DropDown":this.ribbonDropDownModule.createDropDown(e,t);break;case"SplitButton":this.ribbonSplitButtonModule.createSplitButton(e,t);break;case"CheckBox":this.ribbonCheckBoxModule.createCheckBox(e,t);break;case"ColorPicker":this.ribbonColorPickerModule.createColorPicker(e,t);break;case"ComboBox":this.ribbonComboBoxModule.createComboBox(e,t);break;case"Template":this.createTemplateContent(e,t);break;case"GroupButton":this.ribbonGroupButtonModule.createGroupButton(e,t);break;case"Gallery":this.ribbonGalleryModule.createGallery(e,t)}},s.prototype.createItems=function(t,o,i,r,n,s,a){for(var l,p=[],c=0;c<t.length;c++){for(var u=t[parseInt(c.toString(),10)],d=!0;d&&("Simplified"===this.activeLayout&&!(u.displayOptions&(e.DisplayMode.Simplified|e.DisplayMode.Overflow))||"Classic"===this.activeLayout&&!(u.displayOptions&e.DisplayMode.Classic));)++c<t.length?u=t[parseInt(c.toString(),10)]:d=!1;if(!d)break;var h=this.createElement("div",{className:u.cssClass,id:u.id+$t});if((l=h.classList).add.apply(l,[Ct].concat(u.disabled?[Ae]:[])),u.ribbonTooltipSettings&&y(u.ribbonTooltipSettings)&&(h.classList.add(Rt),this.tooltipData.push({id:h.id,data:u.ribbonTooltipSettings})),u.type===e.RibbonItemType.GroupButton)for(var b=0;b<u.groupButtonSettings.items.length;b++)this.keyTipElements[parseInt(s.toString(),10)]&&u.groupButtonSettings.items[parseInt(b.toString(),10)].keyTip&&this.addKeyTip(s,u.groupButtonSettings.items[parseInt(b.toString(),10)].keyTip,u.id+(ao+b),"item");u.keyTip&&(u.type===e.RibbonItemType.Gallery?this.addKeyTip(s,u.keyTip,u.id+"_popupButton","item"):this.addKeyTip(s,u.keyTip,u.id,"item"));var m=u.activeSize;u.type!==e.RibbonItemType.Gallery&&("Simplified"===this.activeLayout&&(m=u.allowedSizes===e.RibbonItemSize.Large||u.allowedSizes&e.RibbonItemSize.Medium||u.displayOptions===e.DisplayMode.Overflow?e.RibbonItemSize.Medium:e.RibbonItemSize.Small,u.setProperties({activeSize:m},!0)),m&e.RibbonItemSize.Large?h.classList.add(kt,Pt):h.classList.add(m&e.RibbonItemSize.Medium?Ot:Bt));var f=this.initialPropsData[parseInt(s.toString(),10)];if(f&&f.hiddenItems&&f.hiddenItems.length){-1!==f.hiddenItems.indexOf(u.id)&&h.classList.add("e-hidden")}if(this.createRibbonItem(u,h),"Simplified"!==this.activeLayout||u.displayOptions!==e.DisplayMode.Overflow&&u.displayOptions!==(e.DisplayMode.Classic|e.DisplayMode.Overflow)?p.push(h):(this.createOverflowPopup(u,s,n,i,r,h,a),u.type!==e.RibbonItemType.DropDown&&u.type!==e.RibbonItemType.SplitButton&&u.type!==e.RibbonItemType.GroupButton&&u.type!==e.RibbonItemType.Gallery||this.updatePopupItems(u,h,n,!0)),"Column"===o&&2===c)break}return p},s.prototype.createHelpPaneTemplate=function(){if(this.helpPaneTemplate){var e="helpPaneTemplate";this.clearTemplate([e]),this.ribbonTempEle=this.createElement("div",{className:Et,id:this.element.id+so});var o=p(this.helpPaneTemplate);t.append(o({},this,e,"helpPaneTemplate",this.isStringTemplate),this.ribbonTempEle);var i=this.tabObj.element;i.querySelector(".e-toolbar").after(this.ribbonTempEle),i.style.setProperty(co,this.ribbonTempEle.offsetWidth+"px"),this.renderReactTemplates()}},s.prototype.createTemplateContent=function(e,t){var o=this.createElement("div",{className:e.cssClass?Lt+" "+e.cssClass:Lt,id:e.id,attrs:{tabindex:"-1"}});e.disabled&&(o.classList.add(Ae),o.setAttribute("disabled","")),t.appendChild(o),this.renderItemTemplate(e,o)},s.prototype.renderItemTemplate=function(o,i){var r="ribbon"+o.id+"itemTemplate";this.clearTemplate([r]);var n=p(o.itemTemplate);t.append(n({activeSize:e.RibbonItemSize[o.activeSize]},this,r,o.id+"itemTemplate",this.isStringTemplate),i),this.renderReactTemplates()},s.prototype.checkID=function(e,t,o){for(var i="tab"===t?"_tab":"group"===t?"_group":"collection"===t?"_collection":"_item",r=0;r<e.length;r++){var n=e[parseInt(r.toString(),10)];if(!n.id){var s=void 0;"item"===t&&(s=this.hasHtmlAtrrID(n)),n.setProperties({id:s||o+i+this.idIndex++},!0)}switch(t){case"tab":n.setProperties({groups:this.checkID(n.groups,"group",n.id)},!0);break;case"group":n.setProperties({collections:this.checkID(n.collections,"collection",n.id)},!0);break;case"collection":n.setProperties({items:this.checkID(n.items,"item",n.id)},!0)}}return e},s.prototype.hasHtmlAtrrID=function(e){var t="";return e.buttonSettings.htmlAttributes.id?t=e.buttonSettings.htmlAttributes.id:e.checkBoxSettings.htmlAttributes.id?t=e.checkBoxSettings.htmlAttributes.id:e.colorPickerSettings.htmlAttributes.id?t=e.colorPickerSettings.htmlAttributes.id:e.comboBoxSettings.htmlAttributes.id?t=e.comboBoxSettings.htmlAttributes.id:e.dropDownSettings.htmlAttributes.id?t=e.dropDownSettings.htmlAttributes.id:e.splitButtonSettings.htmlAttributes.id&&(t=e.splitButtonSettings.htmlAttributes.id),t},s.prototype.updateCommonProperty=function(o){this.tabObj.setProperties(o),this.ribbonFileMenuModule&&this.ribbonFileMenuModule.setCommonProperties(o),this.ribbonBackstageModule&&this.ribbonBackstageModule.setCommonProperties(o);for(var i=0;i<this.tabs.length;i++){var n=this.tabs[parseInt(i.toString(),10)],s=this.tabObj.items[parseInt(i.toString(),10)].content;if(s.querySelector("."+rt))for(var a=0,l=n.groups;a<l.length;a++){var p=l[a],c=void 0,u=void 0;this.activeLayout===e.RibbonLayout.Classic?c=p.isCollapsed?s.querySelector("#"+p.id+eo+to):null:(u=(c=p.enableGroupOverflow?s.querySelector("#"+p.id+Yt):null)?t.getComponent(c,r.DropDownButton):this.overflowDDB)&&(I(u.target,o),u.setProperties(o));for(var d=0,h=p.collections;d<h.length;d++)for(var m=0,f=h[d].items;m<f.length;m++){var y=f[m],g=null;if(this.activeLayout===e.RibbonLayout.Classic?y.displayOptions&e.DisplayMode.Classic&&(g=c?this.ribbonDropDownModule.getDDBItemElement(c,y.id):y.type===e.RibbonItemType.GroupButton?s.querySelector("#"+y.id+ao):s.querySelector("#"+y.id)):(g=y.displayOptions&e.DisplayMode.Simplified?s.querySelector("#"+y.id):null)||(g=u.target.querySelector("#"+y.id),"DropDown"===y.type&&this.updatePopupItems(y,u.target,p.enableGroupOverflow,!0)),g){var v=this.getItemModuleName(y);if("template"!==v)if("group-btn"===v&&"Classic"===this.activeLayout)for(var S=0;S<y.groupButtonSettings.items.length;S++){b(g.querySelector("#"+y.id+ao+S),"btn",o)}else if("group-btn"===v&&"Simplified"===this.activeLayout){b(g,"dropdown-btn",o);for(var C=0;C<y.groupButtonSettings.items.length;C++){b(document.querySelector("#"+y.id+ao+C),"btn",o)}}else b(g,v,o);else t.isNullOrUndefined(o.enableRtl)||g.classList.toggle(je,o.enableRtl)}}}}},s.prototype.removeLauncherIcon=function(e,o,i){var r=e+$t,n=o?this.ribbonDropDownModule.getDDBItemElement(o,r):i.querySelector("#"+r);if(n){n.classList.remove(gt);var s=n.querySelector("#"+e+Jt);t.remove(s)}},s.prototype.destroyTabItems=function(o){for(var i=0;i<o.length;i++)for(var n=o[parseInt(i.toString(),10)],s=this.tabObj.items[parseInt(i.toString(),10)].content,a=0,l=n.groups;a<l.length;a++){var p=l[a],c=void 0,u=void 0;this.activeLayout===e.RibbonLayout.Classic?(c=p.isCollapsed?s.querySelector("#"+p.id+eo+to):null,p.showLauncherIcon&&this.removeLauncherIcon(p.id,c,s)):u=(c=p.enableGroupOverflow?s.querySelector("#"+p.id+Yt):null)?t.getComponent(c,r.DropDownButton):this.overflowDDB;for(var d=0,h=p.collections;d<h.length;d++)for(var b=0,m=h[d].items;b<m.length;b++){var f=m[b],y=void 0;this.activeLayout===e.RibbonLayout.Classic?f.displayOptions&e.DisplayMode.Classic&&(y=c?this.ribbonDropDownModule.getDDBItemElement(c,f.id):s.querySelector("#"+f.id),f.type===e.RibbonItemType.GroupButton&&(y=c?this.ribbonDropDownModule.getDDBItemElement(c,f.id+ao):s.querySelector("#"+f.id+ao)),f.type===e.RibbonItemType.Gallery&&(y=s.querySelector("#"+f.id+$t))):(y=f.displayOptions&e.DisplayMode.Simplified?s.querySelector("#"+f.id):null,f.type===e.RibbonItemType.Gallery&&(y=f.displayOptions&e.DisplayMode.Simplified?s.querySelector("#"+f.id+$t):null),y||(y=u?u.target.querySelector("#"+f.id):null)),y&&this.destroyFunction(f,y)}this.activeLayout===e.RibbonLayout.Classic&&c?this.ribbonDropDownModule.removeOverFlowDropDown(c):this.activeLayout===e.RibbonLayout.Simplified&&p.enableGroupOverflow&&c&&this.removeOverflowButton(u)}this.overflowDDB&&(this.removeOverflowButton(this.overflowDDB),this.overflowDDB=null)},s.prototype.destroyFunction=function(e,t){var o=this.getItemModuleName(e);if("colorpicker"===o)this.ribbonColorPickerModule.unwireColorPickerEvents(t);else if("group-btn"===o){if("Classic"===this.activeLayout)for(var i=0;i<e.groupButtonSettings.items.length;i++){var r=t.querySelector("#"+e.id+ao+i);r&&h(r,"btn")}else this.ribbonGroupButtonModule.destroyDropDown(e);var n=function(t){if(e.groupButtonSettings.items[parseInt(t.toString(),10)].ribbonTooltipSettings){var o=e.id+ao+t,i=l(s.tooltipData,function(e){return e.id===o});-1!==i&&s.tooltipData.splice(i,1)}},s=this;for(i=0;i<e.groupButtonSettings.items.length;i++)n(i)}else if("gallery"===o)if(t.closest(".e-ribbon-overflow-target")){h(t,"dropdown-btn");(c=Array.prototype.slice.call(document.querySelectorAll("#"+e.id+"_galleryPopup"))).concat(Array.prototype.slice.call(document.querySelectorAll("#"+e.id+"-popup")));for(i=0;i<c.length;i++)c[parseInt(i.toString(),10)].remove()}else{var a=t.querySelectorAll(".e-ribbon-gallery-item"),p=t.querySelector("#"+e.id+"_popupButton");p&&p.remove();for(i=0;i<a.length;i++)a[parseInt(i.toString(),10)].remove();var c=document.querySelectorAll("#"+e.id+"_galleryPopup");for(i=0;i<c.length;i++)c[parseInt(i.toString(),10)].remove()}else"template"!==o&&h(t,o);if(e.ribbonTooltipSettings){var u=l(this.tooltipData,function(t){return t.id===e.id+$t});-1!==u&&this.tooltipData.splice(u,1)}"GroupButton"===e.type&&this.ribbonGroupButtonModule.destroyDropDown(e)},s.prototype.getItemModuleName=function(e){switch(e.type){case"Button":return"btn";case"DropDown":return"dropdown-btn";case"SplitButton":return"split-btn";case"CheckBox":return"checkbox";case"ColorPicker":return"colorpicker";case"ComboBox":return"combobox";case"GroupButton":return"group-btn";case"Gallery":return"gallery";default:return"template"}},s.prototype.clearOverflowResize=function(){this.destroyScroll(),this.clearOverflowDropDown(this.selectedTab);for(var e=this.tabs[this.selectedTab],t=this.tabObj.element.querySelector("#"+this.tabs[this.selectedTab].id+Qt),o=t.closest("."+ot),i=0;i<e.groups.length;i++)this.checkSmallToMedium(this.selectedTab,e,i,o,t,!0,!0),this.checkMediumToLarge(this.selectedTab,e,i,o,t,!0,!0)},s.prototype.refreshLayout=function(){this.resizeHandler()},s.prototype.selectTab=function(e){var t=l(this.tabs,function(t){return t.id===e});this.setProperties({selectedTab:t})},s.prototype.showTab=function(e,t){void 0===t&&(t=!1),this.showHideTab(e,!1,t)},s.prototype.hideTab=function(e,t){void 0===t&&(t=!1),this.showHideTab(e,!0,t)},s.prototype.showHideTab=function(e,t,o){var i=l(this.tabs,function(t){return t.id===e});if(-1!==i&&(this.tabObj.hideTab(i,t),o)){for(var r,n=this.tabObj.element,s=0;s<this.contextualTabs.length;s++)for(var a=0;a<this.contextualTabs[parseInt(s.toString(),10)].tabs.length;a++)e===this.contextualTabs[parseInt(s.toString(),10)].tabs[parseInt(a.toString(),10)].id&&(r=this.contextualTabs[parseInt(s.toString(),10)]);if(r){var p=!0,c=function(e){var t=l(u.tabs,function(t){return t.id===r.tabs[parseInt(e.toString(),10)].id});if(-1!==t){n.querySelectorAll(".e-toolbar-item")[parseInt(t.toString(),10)].classList.contains("e-hidden")||(p=!1)}},u=this;for(s=0;s<r.tabs.length;s++)c(s);p?r.setProperties({visible:!1},!0):r.setProperties({visible:!0},!0)}}},s.prototype.enableTab=function(e){this.enableDisableTab(e,!0)},s.prototype.disableTab=function(e){this.enableDisableTab(e,!1)},s.prototype.enableDisableTab=function(e,t){var o=l(this.tabs,function(t){return t.id===e});-1!==o&&this.tabObj.enableTab(o,t)},s.prototype.addTab=function(e,t,o){var i=t?l(this.tabs,function(e){return e.id===t}):-1;i=-1===i?this.tabs.length:i+(o?1:0),this.tabsInternal=this.tabs.slice(),this.tabsInternal.splice(i,0,e),this.setProperties({tabs:this.tabsInternal},!0),this.checkID([this.tabs[parseInt(i.toString(),10)]],"tab",this.element.id),this.tabsInternal=this.tabs.slice(),this.validateItemSize();var r=this.createTabItems([e]);this.tabObj.addTab(r,i)},s.prototype.removeTab=function(t){var o=l(this.tabs,function(e){return e.id===t});if(-1!==o){var i=this.tabObj.items[parseInt(o.toString(),10)].content,r=this.tabs[parseInt(o.toString(),10)].groups;if(r&&""!==i.innerHTML)for(var n=0,s=r;n<s.length;n++){for(var a=s[n],p=a.isCollapsed?i.querySelector("#"+a.id+eo+to):null,c=0,u=a.collections;c<u.length;c++)for(var d=0,h=u[c].items;d<h.length;d++){var b=h[d],m=p?this.ribbonDropDownModule.getDDBItemElement(p,b.id):i.querySelector("#"+b.id);b.type===e.RibbonItemType.GroupButton&&"Classic"===this.activeLayout&&(m=p?this.ribbonDropDownModule.getDDBItemElement(p,b.id+ao):i.querySelector("#"+b.id+ao)),m&&this.destroyFunction(b,m)}p&&this.ribbonDropDownModule.removeOverFlowDropDown(p)}o===this.selectedTab&&(this.isAddRemove=!0),this.tabsInternal=this.tabs.slice(),this.tabsInternal.splice(o,1),this.setProperties({tabs:this.tabsInternal},!0),this.tabObj.removeTab(o)}},s.prototype.addGroup=function(e,t,o,i){var r=l(this.tabs,function(t){return t.id===e});if(-1!==r){this.selectedTab===r&&this.clearOverflowResize();var n=this.tabs[parseInt(r.toString(),10)],s=n.groups.slice(),a=o?l(s,function(e){return e.id===o}):-1;a=-1===a?s.length:a+(i?1:0),s.splice(a,0,t),n.setProperties({groups:s},!0),this.checkID([n.groups[parseInt(a.toString(),10)]],"group",e),this.validateItemSize();var p=this.tabObj.items[parseInt(r.toString(),10)].content;if(""!==p.innerHTML){var c=this.createGroups([n.groups[parseInt(a.toString(),10)]],r)[0],u=o?p.querySelector("#"+o):null;u?u.insertAdjacentElement(i?"afterend":"beforebegin",c):p.append(c)}this.selectedTab===r&&this.refreshLayout()}},s.prototype.removeGroup=function(o){var i=d(this.tabs,o);if(i){this.selectedTab===i.tabIndex&&this.clearOverflowResize();var n=this.tabObj.items[i.tabIndex].content;if(""!==n.innerHTML){var s=void 0,a=void 0;i.group.showLauncherIcon&&this.removeLauncherIcon(i.group.id,null,n),this.activeLayout===e.RibbonLayout.Simplified&&(a=(s=i.group.enableGroupOverflow?n.querySelector("#"+i.group.id+Yt):null)?t.getComponent(s,r.DropDownButton):this.overflowDDB);for(var l=0,p=i.group.collections;l<p.length;l++)for(var c=0,u=p[l].items;c<u.length;c++){var h=u[c];this.removeItemElement(n,h,a)}if(this.activeLayout===e.RibbonLayout.Simplified)if(i.group.enableGroupOverflow)(0===a.target.childElementCount||1===a.target.childElementCount&&this.isHeaderVisible(a.target,i.group.id))&&this.removeOverflowButton(a);else{var b=a.target.querySelector("#"+i.group.id+$t);b&&1===b.childElementCount&&b.remove();var m=a.target.querySelector("#"+this.tabs[parseInt(i.tabIndex.toString(),10)].id+eo);m&&0===m.childElementCount&&m.remove()}var f=n.querySelector("#"+o);f&&f.remove()}var y=this.tabs[i.tabIndex].groups.slice();y.splice(i.groupIndex,1),this.tabs[i.tabIndex].setProperties({groups:y},!0),this.selectedTab===i.tabIndex&&this.refreshLayout()}},s.prototype.isHeaderVisible=function(e,t){return!!e.querySelector("#"+t+Yt+Zt)},s.prototype.hideGroup=function(e){this.showHideGroup(e,!0)},s.prototype.showGroup=function(e){this.showHideGroup(e,!1)},s.prototype.showHideGroup=function(e,o){var i,n=d(this.tabs,e);if(n){var s=this.tabObj.items[n.tabIndex].content,a=s.querySelector("#"+e);if(a?this.updateHiddenElements(n.tabIndex,o?"hideGroup":"showGroup",e,o,a):this.updateInitialProps(n.tabIndex,e,"hiddenGroups",o),this.overflowDDB){var l=this.overflowDDB.target.querySelector("#"+this.tabs[parseInt(n.tabIndex.toString(),10)].id+eo);if(n.group.enableGroupOverflow){var p=s.querySelector("#"+e+Yt);p&&(i=t.getInstance(p,r.DropDownButton).target),i&&(o?i.classList.add("e-hidden"):i.classList.remove("e-hidden"))}else if(l){var c=l.querySelector("#"+e+$t);c&&(o?c.classList.add("e-hidden"):c.classList.remove("e-hidden"))}}this.selectedTab===n.tabIndex&&this.refreshLayout()}},s.prototype.updateHiddenElements=function(e,t,o,i,r,n){i?r.classList.contains("e-hidden")||(this.checkHiddenElements(t,o,e),r.classList.add("e-hidden"),"hideItem"===t&&this.checkHiddenItems(n,i,e),this.calculateHiddenElementsWidth(e)):r.classList.contains("e-hidden")&&(this.checkHiddenElements(t,o,e),r.classList.remove("e-hidden"),this.calculateHiddenElementsWidth(e),"showItem"===t&&this.checkHiddenItems(n,i,e))},s.prototype.checkHiddenElements=function(e,t,o){if("Simplified"===this.activeLayout){var i=this.hiddenElements[parseInt(o.toString(),10)];if(i||(this.hiddenElements[parseInt(o.toString(),10)]={},i=this.hiddenElements[parseInt(o.toString(),10)]),i)if(i[e]||(i[e]=[]),i[e].length){-1===i[e].indexOf(t)&&i[e].push(t)}else i[e].push(t)}},s.prototype.updateItemsSimplifiedWidth=function(e,t){var o=this.hiddenElements[parseInt(e.toString(),10)];if(o&&o[t]&&o[t].length)for(var i,r=function(r){var s,a=n.tabObj.items[e].content,l=void 0,p=!1,c=0;if(s="hideGroup"===t||"showGroup"===t?a.querySelector("#"+o[t][r]):a.querySelector("#"+o[t][r]+$t)){if("hideGroup"===t||"hideItem"===t){var u=!1;s.classList.contains("e-hidden")&&(u=!0,s.classList.remove("e-hidden")),"hideItem"===t&&(l=s.closest(".e-ribbon-group")).classList.contains("e-hide-group")&&(p=!0,c=n.checkWidthDifference(s,l)),n.calculateOverflowItemsWidth(s.offsetWidth+c,!0,e),n.calculateMediumDataWidth(s.offsetWidth+c,e,!0),u&&s.classList.add("e-hidden")}else{if("showItem"===t)if((l=s.closest(".e-ribbon-group")).classList.contains("e-hide-group"))p=!0,l.classList.remove("e-hide-group"),l.classList.remove("e-ribbon-emptyCollection"),c=Math.abs(s.offsetWidth-l.offsetWidth),-1!==n.hiddenGroups.indexOf(l.id)&&n.hiddenGroups.splice(n.hiddenGroups.indexOf(l.id),1);else if(-1!==n.hiddenGroups.indexOf(l.id)){var d=l.querySelectorAll(".e-ribbon-item:not(.e-hidden)");d.forEach(function(e){e.id!==s.id&&e.classList.add("e-hidden")}),c=Math.abs(s.offsetWidth-l.offsetWidth),d.forEach(function(e){e.id!==s.id&&e.classList.remove("e-hidden")}),n.hiddenGroups.splice(n.hiddenGroups.indexOf(l.id),1)}n.calculateOverflowItemsWidth(s.offsetWidth+c,!1,e),n.calculateMediumDataWidth(s.offsetWidth+c,e,!1)}p&&(l.classList.add("e-hide-group"),l.classList.add("e-ribbon-emptyCollection"))}var h=o[t].indexOf(o[t][r]);-1!==h&&(o[t].splice(h,1),r--),i=r},n=this,s=0;s<o[t].length;s++)r(s),s=i},s.prototype.checkWidthDifference=function(e,t){var o=0;return t.classList.remove("e-hide-group"),t.classList.remove("e-ribbon-emptyCollection"),this.hiddenGroups.length?-1===this.hiddenGroups.indexOf(t.id)&&(this.hiddenGroups.push(t.id),o=Math.abs(e.offsetWidth-t.offsetWidth)):(this.hiddenGroups.push(t.id),o=Math.abs(e.offsetWidth-t.offsetWidth)),o},s.prototype.calculateHiddenElementsWidth=function(e){if(e===this.selectedTab&&"Simplified"===this.activeLayout){var t=this.hiddenElements[parseInt(e.toString(),10)];if(t)for(var o=0;o<Object.keys(t).length;o++)this.updateItemsSimplifiedWidth(e,Object.keys(t)[parseInt(o.toString(),10)])}},s.prototype.calculateMediumDataWidth=function(e,o,i){if(this.selectedTab===o&&"Simplified"===this.activeLayout){var n=this.tabObj.element.querySelector("#"+this.tabs[parseInt(o.toString(),10)].id+Qt),s=Array.prototype.slice.call(n.querySelectorAll(".e-ribbon-item"));if(this.overflowDDB)for(var a=this.overflowDDB.target.querySelectorAll(".e-ribbon-item"),l=document.querySelector("#"+this.tabs[parseInt(o.toString(),10)].id+eo),p=0;p<a.length;p++){var c=a[parseInt(p.toString(),10)].closest("#"+this.tabs[parseInt(o.toString(),10)].id+eo);l&&c&&l.id===c.id&&a[parseInt(p.toString(),10)].hasAttribute("data-medium-width")&&s.push(a[parseInt(p.toString(),10)])}var u=n.querySelectorAll(".e-ribbon-group-of-btn");for(p=0;p<u.length;p++){a=t.getInstance(u[parseInt(p.toString(),10)],r.DropDownButton).target.querySelectorAll(".e-ribbon-item");for(var d=0;d<a.length;d++)a[parseInt(d.toString(),10)].hasAttribute("data-medium-width")&&s.push(a[parseInt(d.toString(),10)])}for(p=0;p<s.length;p++)if(s[parseInt(p.toString(),10)].hasAttribute("data-medium-width")){var h=parseInt(s[parseInt(p.toString(),10)].getAttribute("data-medium-width"),10);s[parseInt(p.toString(),10)].setAttribute("data-medium-width",i?(h-e).toString():(h+e).toString())}}},s.prototype.calculateOverflowItemsWidth=function(e,o,i){if(this.selectedTab===i&&"Simplified"===this.activeLayout)for(var n=this.tabs[parseInt(i.toString(),10)].groups,s=0;s<n.length;s++){var a=n[parseInt(s.toString(),10)];if(a.enableGroupOverflow){var l=void 0,p=document.querySelector("#"+a.id).querySelector("#"+a.id+Yt);if(p&&(l=t.getInstance(p,r.DropDownButton)),l)for(var c=l.target.querySelectorAll(".e-ribbon-item"),u=0;u<c.length;u++){(b=parseInt(c[parseInt(u.toString(),10)].getAttribute("data-simplified-width"),10))&&c[parseInt(u.toString(),10)].setAttribute("data-simplified-width",o?(b-e).toString():(b+e).toString())}}}if(this.overflowDDB){var d=document.querySelector("#"+this.tabs[parseInt(i.toString(),10)].id+eo);for(c=this.overflowDDB.target.querySelectorAll(".e-ribbon-item"),s=0;s<c.length;s++){var h=c[parseInt(s.toString(),10)].closest("#"+this.tabs[parseInt(i.toString(),10)].id+eo);if(d&&h&&d.id===h.id){var b;(b=parseInt(c[parseInt(s.toString(),10)].getAttribute("data-simplified-width"),10))&&c[parseInt(s.toString(),10)].setAttribute("data-simplified-width",o?(b-e).toString():(b+e).toString())}}}},s.prototype.disableGroup=function(e){this.enableDisableGroup(e,!0)},s.prototype.enableGroup=function(e){this.enableDisableGroup(e,!1)},s.prototype.enableDisableGroup=function(e,o){var i,n=d(this.tabs,e);if(n){var s=this.tabObj.items[n.tabIndex].content,a=s.querySelector("#"+e);if(a?o?a.classList.add("e-disabled"):a.classList.remove("e-disabled"):this.updateInitialProps(n.tabIndex,e,"disabledGroups",o),this.overflowDDB){var l=this.overflowDDB.target.querySelector("#"+this.tabs[parseInt(n.tabIndex.toString(),10)].id+eo);if(n.group.enableGroupOverflow){var p=s.querySelector("#"+e+Yt);p&&(i=t.getInstance(p,r.DropDownButton).target),i&&(o?i.classList.add("e-disabled"):i.classList.remove("e-disabled"))}else if(l){var c=l.querySelector("#"+e+$t);c&&(o?c.classList.add("e-disabled"):c.classList.remove("e-disabled"))}}}},s.prototype.addCollection=function(e,t,o,i){var r=d(this.tabs,e);if(r&&("Row"!==r.group.orientation||3!==r.group.collections.length)){this.selectedTab===r.tabIndex&&this.clearOverflowResize();var n=r.group.collections.slice(),s=o?l(n,function(e){return e.id===o}):-1;s=-1===s?n.length:s+(i?1:0),n.splice(s,0,t),r.group.setProperties({collections:n},!0),this.checkID([r.group.collections[parseInt(s.toString(),10)]],"collection",e),this.validateItemSize();var a=this.tabObj.items[r.tabIndex].content;if(""!==a.innerHTML){var p=r.group.collections[parseInt(s.toString(),10)],c=this.createCollection([p],r.group.orientation,r.group.id,r.group.header,r.group.enableGroupOverflow,r.tabIndex)[0];r.group.isCollapsed&&(a=this.ribbonDropDownModule.getOverflowDropDownPopup(r,a));var u=o?a.querySelector("#"+o):null;u?u.insertAdjacentElement(i?"afterend":"beforebegin",c):a.querySelector("#"+e+Qt).append(c)}this.selectedTab===r.tabIndex&&this.refreshLayout()}},s.prototype.removeCollection=function(o){var i=u(this.tabs,o);if(i){this.selectedTab===i.tabIndex&&this.clearOverflowResize();var n=this.tabObj.items[i.tabIndex].content;if(""!==n.innerHTML){var s=void 0,a=void 0;this.activeLayout===e.RibbonLayout.Simplified&&(a=(s=i.group.enableGroupOverflow?n.querySelector("#"+i.group.id+Yt):null)?t.getComponent(s,r.DropDownButton):this.overflowDDB);for(var l=0,p=i.collection.items;l<p.length;l++){var c=p[l];this.removeItemElement(n,c,a)}var d=n.querySelector("#"+o);d&&d.remove()}var h=i.group,b=h.collections.slice();b.splice(i.collectionIndex,1),h.setProperties({collections:b},!0),this.selectedTab===i.tabIndex&&this.refreshLayout()}},s.prototype.addItem=function(e,t,o,i){var r=u(this.tabs,e);if(r&&("Column"!==r.group.orientation||3!==r.collection.items.length)){this.selectedTab===r.tabIndex&&this.clearOverflowResize();var n=r.collection.items.slice(),s=o?l(n,function(e){return e.id===o}):-1;s=-1===s?n.length:s+(i?1:0),n.splice(s,0,t),r.collection.setProperties({items:n},!0),this.checkID([r.collection.items[parseInt(s.toString(),10)]],"item",e),this.validateItemSize();var a=this.tabObj.items[r.tabIndex].content,p=a.querySelector("#"+r.group.id+$t);if(""!==a.innerHTML){var c=r.collection.items[parseInt(s.toString(),10)],d=this.createItems([c],r.group.orientation,r.group.id,r.group.header,r.group.enableGroupOverflow,r.tabIndex,p)[0];r.group.isCollapsed&&(a=this.ribbonDropDownModule.getOverflowDropDownPopup(r,a));var h=o?a.querySelector("#"+o):null;h?h.closest("."+Ct).insertAdjacentElement(i?"afterend":"beforebegin",d):d&&a.querySelector("#"+e).append(d)}this.selectedTab===r.tabIndex&&this.refreshLayout()}},s.prototype.removeItem=function(o){var i=c(this.tabs,o);if(i){this.selectedTab===i.tabIndex&&this.clearOverflowResize();var n=this.tabObj.items[i.tabIndex].content;if(""!==n.innerHTML){var s=void 0,a=void 0;this.activeLayout===e.RibbonLayout.Simplified&&(a=(s=i.group.enableGroupOverflow?n.querySelector("#"+i.group.id+Yt):null)?t.getComponent(s,r.DropDownButton):this.overflowDDB);var l=i.item;this.removeItemElement(n,l,a)}var p=i.collection,u=p.items;u.splice(i.itemIndex,1),p.setProperties({items:u},!0),this.selectedTab===i.tabIndex&&this.refreshLayout()}},s.prototype.hideItem=function(e){this.showHideItem(e,!0)},s.prototype.showItem=function(e){this.showHideItem(e,!1)},s.prototype.showHideItem=function(e,o){var i=c(this.tabs,e);if(i){var r;if(r="GroupButton"===i.item.type?f(this,e+ao,i):f(this,e,i)){var n=t.closest(r,".e-ribbon-item");this.updateHiddenElements(i.tabIndex,o?"hideItem":"showItem",e,o,n,i.group),this.selectedTab===i.tabIndex&&this.refreshLayout()}else this.updateInitialProps(i.tabIndex,e,"hiddenItems",o)}},s.prototype.updateInitialProps=function(e,t,o,i){var r=this.initialPropsData[parseInt(e.toString(),10)];if(r||(this.initialPropsData[parseInt(e.toString(),10)]={},r=this.initialPropsData[parseInt(e.toString(),10)]),r){r[o]||(r[o]=[]);var n=r[o].indexOf(t);i?-1===n&&r[o].push(t):(-1!==n&&r[o].splice(n,1),0===r[o].length&&delete r[o],0===Object.keys(r).length&&delete this.initialPropsData[parseInt(e.toString(),10)])}},s.prototype.checkHiddenItems=function(e,t,o){var i,r=!0,n=this.tabObj.items[parseInt(o.toString(),10)].content,s=n.querySelector("#"+e.id);if(t){for(var a=0;a<e.collections.length;a++)if(r)for(var l=e.collections[parseInt(a.toString(),10)],p=0;p<l.items.length;p++){var u=l.items[parseInt(p.toString(),10)],d=void 0;if("GroupButton"===u.type){var h=c(this.tabs,u.id);d=f(this,u.id+ao,h)}else d=f(this,u.id);if(!(d?d.closest(".e-ribbon-item"):null).classList.contains("e-hidden")){r=!1;break}}r&&(s.classList.add("e-hide-group"),this.checkOverflowItems(t,n,e.enableGroupOverflow,o,e.id))}else s.classList.remove("e-hide-group"),this.checkOverflowItems(t,n,e.enableGroupOverflow,o,e.id);if("Simplified"===this.activeLayout&&!e.enableGroupOverflow){var b=s.querySelectorAll("."+Ct);b&&(i=this.checkEmptyCollection(b),s.classList[i?"add":"remove"]("e-ribbon-emptyCollection"))}},s.prototype.checkOverflowItems=function(e,o,i,n,s){var a;if(i){var l=o.querySelector("#"+s+Yt);l&&(a=t.getInstance(l,r.DropDownButton).target),a&&(e?a.classList.add("e-hide-group"):a.classList.remove("e-hide-group"))}else if(this.overflowDDB){var p=this.overflowDDB.target.querySelector("#"+this.tabs[parseInt(n.toString(),10)].id+eo);if(p){var c=p.querySelector("#"+s+$t);c&&(e?c.classList.add("e-hide-group"):c.classList.remove("e-hide-group"))}}},s.prototype.updateTab=function(o){var i=o.id,r=l(this.tabs,function(e){return e.id===i});if(-1!==r){var n=this.tabObj.items[parseInt(r.toString(),10)].content,s=this.tabs[parseInt(r.toString(),10)].groups,a=this.tabObj.element;if(s&&""!==n.innerHTML&&(o.cssClass&&this.tabs[parseInt(r.toString(),10)].cssClass&&(n.classList.remove(this.tabs[parseInt(r.toString(),10)].cssClass),a.querySelector(".e-active").classList.remove(this.tabs[parseInt(r.toString(),10)].cssClass)),o.groups)){for(var p=0,c=s;p<c.length;p++){for(var u=c[p],d=u.isCollapsed?n.querySelector("#"+u.id+eo+to):null,h=0,b=u.collections;h<b.length;h++)for(var m=0,f=b[h].items;m<f.length;m++){var y=f[m],g=d?this.ribbonDropDownModule.getDDBItemElement(d,y.id):n.querySelector("#"+y.id);y.type===e.RibbonItemType.GroupButton&&"Classic"===this.activeLayout&&(g=d?this.ribbonDropDownModule.getDDBItemElement(d,y.id+ao):n.querySelector("#"+y.id+ao)),g&&this.destroyFunction(y,g)}d&&this.ribbonDropDownModule.removeOverFlowDropDown(d)}n.querySelectorAll(".e-ribbon-group").forEach(function(e){e.remove()})}r===this.selectedTab&&(this.isAddRemove=!0);var v=this.tabs[parseInt(r.toString(),10)];if(v.setProperties(o,!0),this.setProperties({groups:this.checkID(v.groups,"group",v.id)},!0),this.validateItemSize(),""===n.innerHTML){if(o.groups){var S=this.createGroups(v.groups,r);t.append(S,n)}this.selectedTab===r&&this.refreshLayout(),o.cssClass&&(n.classList.add(v.cssClass),a.querySelector(".e-active").classList.add(v.cssClass)),o.header&&(a.querySelector("#"+i+Zt).innerText=v.header)}}},s.prototype.updateGroup=function(o){var i=o.id,n=d(this.tabs,i);if(n){this.selectedTab===n.tabIndex&&this.clearOverflowResize();var s,a,l=this.tabObj.items[n.tabIndex].content,p=l.querySelector("#"+i),c=p.querySelector("#"+o.id+$t);if(""!==l.innerHTML){if(n.group.showLauncherIcon&&this.removeLauncherIcon(n.group.id,null,l),this.activeLayout===e.RibbonLayout.Simplified&&(a=(s=n.group.enableGroupOverflow?l.querySelector("#"+n.group.id+Yt):null)?t.getComponent(s,r.DropDownButton):this.overflowDDB),o.cssClass&&n.group.cssClass&&(p.classList.remove(n.group.cssClass),c&&c.classList.remove(n.group.cssClass)),(o.collections||o.orientation)&&(n.group.collections||n.group.orientation)){for(var u=0,h=n.group.collections;u<h.length;u++)for(var b=0,m=h[u].items;b<m.length;b++){var f=m[b];this.removeItemElement(l,f,a)}if(p.querySelectorAll(".e-ribbon-collection").forEach(function(e){e.remove()}),o.orientation){var y=(I=c.querySelector(".e-ribbon-group-content")).classList.value.match(/(e-ribbon-[column|row]+)/g);y&&t.removeClass([I],y)}}if(this.activeLayout===e.RibbonLayout.Simplified)if(n.group.enableGroupOverflow)(0===a.target.childElementCount||1===a.target.childElementCount&&this.isHeaderVisible(a.target,n.group.id))&&this.removeOverflowButton(a);else{var g=a.target.querySelector("#"+n.group.id+$t);g&&1===g.childElementCount&&g.remove();var v=a.target.querySelector("#"+this.tabs[parseInt(n.tabIndex.toString(),10)].id+eo);v&&0===v.childElementCount&&v.remove()}}var S=n.group;if(S.setProperties(o,!0),S.setProperties({collections:this.checkID(S.collections,"collection",S.id)},!0),this.validateItemSize(),""!==l.innerHTML){if(o.showLauncherIcon&&this.createLauncherIcon(S.id,c,n.tabIndex),o.collections||o.orientation){var I;(I=c.querySelector(".e-ribbon-group-content")).classList.add("Column"===S.orientation||"Simplified"===this.activeLayout?wt:Tt);var C=this.createCollection(S.collections,S.orientation,S.id,S.header,S.enableGroupOverflow,n.tabIndex,c);t.append(C,I)}if(this.selectedTab===n.tabIndex&&this.refreshLayout(),o.cssClass&&(p.classList.add(S.cssClass),c&&c.classList.add(S.cssClass)),o.header)if(this.activeLayout!==e.RibbonLayout.Simplified||o.enableGroupOverflow)if(this.activeLayout!==e.RibbonLayout.Classic||S.isCollapsed){if(this.activeLayout===e.RibbonLayout.Classic&&S.isCollapsed){var T=p.querySelector("#"+S.id+eo+to);(w=t.getInstance(T,r.DropDownButton).target.querySelector("#"+o.id+Zt))&&(w.innerText=S.header)}}else p.querySelector(".e-ribbon-group-header").innerText=S.header;else{var w;(w=a.target.querySelector("#"+o.id+Zt))&&(w.innerText=S.header)}}}},s.prototype.updateCollection=function(o){var i=o.id,n=u(this.tabs,i);if(n){this.selectedTab===n.tabIndex&&this.clearOverflowResize();var s=this.tabObj.items[n.tabIndex].content,a=s.querySelector("#"+i);if(""!==s.innerHTML){var l=void 0,p=void 0;if(this.activeLayout===e.RibbonLayout.Simplified&&(p=(l=n.group.enableGroupOverflow?s.querySelector("#"+n.group.id+Yt):null)?t.getComponent(l,r.DropDownButton):this.overflowDDB),o.cssClass&&n.collection.cssClass&&a.classList.remove(n.collection.cssClass),o.items&&n.collection.items)for(var c=0,d=n.collection.items;c<d.length;c++){var h=d[c];this.removeItemElement(s,h,p)}}var b=n.collection;if(b.setProperties(o,!0),b.setProperties({items:this.checkID(b.items,"item",b.id)},!0),this.validateItemSize(),""!==s.innerHTML&&o.items){var m=s.querySelector("#"+n.group.id+$t),f=this.createItems(b.items,n.group.orientation,n.group.id,n.group.header,n.group.enableGroupOverflow,n.tabIndex,m);t.append(f,a)}this.selectedTab===n.tabIndex&&this.refreshLayout(),o.cssClass&&a.classList.add(b.cssClass)}},s.prototype.updateItem=function(o){var i=o.id,n=c(this.tabs,i);if(n){this.selectedTab===n.tabIndex&&this.clearOverflowResize();var s=this.tabObj.items[n.tabIndex].content,a=s.querySelector("#"+n.group.id);if(a){var l=a.querySelector("#"+n.group.id+$t),p=null,u=null,d=void 0,h=void 0;if(""!==s.innerHTML){if(this.activeLayout===e.RibbonLayout.Simplified&&(h=(d=n.group.enableGroupOverflow?s.querySelector("#"+n.group.id+Yt):null)?t.getComponent(d,r.DropDownButton):this.overflowDDB),this.activeLayout===e.RibbonLayout.Simplified&&n.item.displayOptions===e.DisplayMode.Overflow){if(p=h.target.querySelector("#"+i+$t),u=h.target.querySelector("#"+i),o.displayOptions&&o.displayOptions!==e.DisplayMode.Overflow){var b=l.querySelector("#"+n.collection.id);b&&b.appendChild(p)}}else p=l.querySelector("#"+i+$t),u=s.querySelector("#"+i),"GroupButton"===n.item.type&&this.activeLayout===e.RibbonLayout.Classic&&(u=s.querySelector("#"+i+ao)),this.activeLayout===e.RibbonLayout.Simplified&&o.displayOptions===e.DisplayMode.Overflow&&(this.createOverflowPopup(n.item,n.tabIndex,n.group.enableGroupOverflow,n.group.id,n.group.header,p,l),n.item.type!==e.RibbonItemType.DropDown&&n.item.type!==e.RibbonItemType.SplitButton&&o.type!==e.RibbonItemType.GroupButton&&o.type!==e.RibbonItemType.Gallery||this.updatePopupItems(n.item,p,n.group.enableGroupOverflow,!0));o.cssClass&&n.item.cssClass&&p.classList.remove(n.item.cssClass),this.destroyFunction(n.item,u),u.remove();var m=p.classList.value.match(/(e-ribbon-[large|medium|small]+-item)/g);m&&t.removeClass([p],m)}var f=n.item;if(f.setProperties(o,!0),this.validateItemSize(),""!==s.innerHTML){p=this.activeLayout!==e.RibbonLayout.Simplified||f.displayOptions!==e.DisplayMode.Overflow?l.querySelector("#"+i+$t):h.target.querySelector("#"+i+$t),f.ribbonTooltipSettings&&y(f.ribbonTooltipSettings)&&(p.classList.add(Rt),this.tooltipData.push({id:p.id,data:f.ribbonTooltipSettings}));var g=f.activeSize;"Simplified"===this.activeLayout&&(g=f.allowedSizes===e.RibbonItemSize.Large||f.allowedSizes&e.RibbonItemSize.Medium||f.displayOptions===e.DisplayMode.Overflow?e.RibbonItemSize.Medium:e.RibbonItemSize.Small,f.setProperties({activeSize:g},!0)),g&e.RibbonItemSize.Large?p.classList.add(kt,Pt):g&e.RibbonItemSize.Medium?p.classList.add(Ot):p.classList.add(Bt),this.createRibbonItem(f,p),"Simplified"===this.activeLayout&&n.group.enableGroupOverflow&&(0===h.target.childElementCount||1===h.target.childElementCount&&this.isHeaderVisible(h.target,n.group.id))&&this.removeOverflowButton(h),this.selectedTab===n.tabIndex&&this.refreshLayout(),o.cssClass&&p.classList.add(f.cssClass),!f.disabled&&p.classList.contains(Ae)&&p.classList.remove(Ae),this.enableDisableItem(f.id,f.disabled)}}else this.isUpdateItems=!0,this.itemsModel.push(o),this.targetTabs[o.id]=n.tabIndex}},s.prototype.removeItemElement=function(t,o,i){var r=null;this.activeLayout===e.RibbonLayout.Classic?(r=o.displayOptions&e.DisplayMode.Classic?t.querySelector("#"+o.id):null,"GroupButton"===o.type&&(r=o.displayOptions&e.DisplayMode.Classic?t.querySelector("#"+o.id+ao):null)):(r=o.displayOptions&e.DisplayMode.Simplified?t.querySelector("#"+o.id):null)||(r=i.target.querySelector("#"+o.id)),r&&(this.destroyFunction(o,r),"GroupButton"===o.type&&this.activeLayout===e.RibbonLayout.Simplified?document.getElementById(o.id+$t).remove():r.closest("#"+o.id+$t).remove())},s.prototype.enableItem=function(e){this.enableDisableItem(e,!1)},s.prototype.disableItem=function(e){this.enableDisableItem(e,!0)},s.prototype.getItem=function(e){return c(this.tabs,e).item},s.prototype.enableDisableItem=function(e,o){var i=!1,r=c(this.tabs,e);if(r){r.item.setProperties({disabled:o},!0);var n;if(n="GroupButton"===r.item.type?f(this,e+ao,r):f(this,e,r)){var s=t.closest(n,".e-ribbon-item"),a=this.getItemModuleName(r.item);if(i=o?!s.classList.contains(Ae):s.classList.contains(Ae),"template"!==a){if(i)if("group-btn"===a&&"Simplified"===this.activeLayout){m(n,"dropdown-btn",o);for(var l=0;l<r.item.groupButtonSettings.items.length;l++){m(document.querySelector("#"+e+ao+l),"btn",o)}}else if("group-btn"===a&&"Classic"===this.activeLayout)for(l=0;l<r.item.groupButtonSettings.items.length;l++){m(n.querySelector("#"+e+ao+l),"btn",o)}else m(n,a,o)}else n.classList.toggle(Ae,o),n.toggleAttribute("disabled",o);s.classList.toggle(Ae,r.item.disabled)}}},s.prototype.unwireEvents=function(){t.EventHandler.remove(window,"resize",this.resizeHandler),t.EventHandler.remove(document.body,"keydown",this.keytipActionHandler),t.EventHandler.remove(document,"mousedown",this.mouseEventHandler),t.EventHandler.remove(document,"scroll",this.mouseEventHandler)},s.prototype.destroy=function(){this.keyboardModuleRibbon.destroy(),this.keyboardModuleRibbon=null,S(this.element),this.refreshing&&this.clearOverflowDropDown(this.selectedTab),this.destroyTabItems(this.tabs),this.hideLayoutSwitcher||this.removeExpandCollapse(),this.collapseButton=void 0,this.scrollModule&&(this.scrollModule.destroy(),this.scrollModule=null),this.ribbonTempEle&&(t.remove(this.ribbonTempEle),this.ribbonTempEle=null),i.prototype.destroy.call(this),this.tabObj.destroy(),this.tabObj=void 0,this.initialPropsData={},this.hiddenGroups=[],this.hiddenElements={},this.keyTipElements={},this.itemsModel=[],this.targetTabs={},t.remove(this.element.querySelector("#"+this.element.id+"_tab")),this.element.style.removeProperty(po),this.element.style.removeProperty(co),this.element.style.removeProperty("width"),this.cssClass&&t.removeClass([this.element],this.cssClass.split(" ")),this.element.classList.remove(je,jt,tt,Je,it,"e-rbn"),this.unwireEvents()},s.prototype.onPropertyChanged=function(e,o){for(var i,n,s=0,a=Object.keys(e);s<a.length;s++){switch(a[s]){case"activeLayout":this.switchLayout();break;case"cssClass":o.cssClass&&(i=this.element.classList).remove.apply(i,o.cssClass.split(" ")),e.cssClass&&(n=this.element.classList).add.apply(n,e.cssClass.split(" "));break;case"isMinimized":this.element.classList.toggle(it,this.isMinimized),this.tabObj.element.querySelector(".e-content").style.display=this.isMinimized?"none":"block",this.isMinimized||this.refreshLayout();break;case"locale":this.updateCommonProperty({locale:this.locale});break;case"enablePersistence":this.updateCommonProperty({enablePersistence:this.enablePersistence});break;case"enableRtl":this.element.classList.toggle(je,this.enableRtl),this.updateCommonProperty({enableRtl:e.enableRtl}),this.scrollModule&&this.scrollModule.setProperties({enableRtl:e.enableRtl});break;case"launcherIconCss":for(var l=0;l<this.tabs.length;l++){var p=this.tabObj.items[parseInt(l.toString(),10)].content,c=this.tabs[parseInt(l.toString(),10)];if(p.querySelector("."+rt))for(var u=0,d=c.groups;u<d.length;u++){var h=d[u];if(h.showLauncherIcon){var b=vt+" "+(this.launcherIconCss||St);if(h.isCollapsed){var m=p.querySelector("#"+h.id+eo+to);t.getComponent(m,r.DropDownButton).target.querySelector("#"+h.id+Jt).className=b}else{(m=p.querySelector("#"+h.id+Jt)).className=b}}}}break;case"selectedTab":var f=this.tabObj.element.querySelectorAll(".e-toolbar-item")[parseInt(e.selectedTab.toString(),10)];f.classList.contains("e-hidden")||f.classList.contains("e-disable")||this.tabObj.setProperties({selectedItem:e.selectedTab});break;case"tabAnimation":this.tabObj.setProperties({animation:e.tabAnimation});break;case"tabs":this.reRenderTabs(e.tabs);break;case"contextualTabs":for(l=0;l<this.contextualTabs.length;l++)e.contextualTabs[parseInt(l.toString(),10)]&&this.ribbonContextualTabModule.updateContextualTabs(e.contextualTabs[parseInt(l.toString(),10)],this.contextualTabs[parseInt(l.toString(),10)]);break;case"width":this.element.style.width=t.formatUnit(e.width),this.refreshLayout();break;case"fileMenu":this.ribbonFileMenuModule&&this.ribbonFileMenuModule.updateFileMenu(this.fileMenu);this.tabObj.tbObj.refreshOverflow();break;case"backStageMenu":this.ribbonBackstageModule&&this.ribbonBackstageModule.updateBackStageMenu(this.backStageMenu);this.tabObj.tbObj.refreshOverflow();break;case"helpPaneTemplate":this.ribbonTempEle&&(t.remove(this.ribbonTempEle),this.ribbonTempEle=null,this.tabObj.element.style.setProperty(co,"0px")),this.helpPaneTemplate&&this.createHelpPaneTemplate();this.tabObj.tbObj.refreshOverflow();break;case"hideLayoutSwitcher":this.hideLayoutSwitcher?this.removeExpandCollapse():this.addExpandCollapse()}}};var g;return Bo([t.Property("Classic")],s.prototype,"activeLayout",void 0),Bo([t.Property("")],s.prototype,"cssClass",void 0),Bo([t.Property(!1)],s.prototype,"enableKeyTips",void 0),Bo([t.Property("")],s.prototype,"layoutSwitcherKeyTip",void 0),Bo([t.Complex({},ve)],s.prototype,"fileMenu",void 0),Bo([t.Complex({},Pe)],s.prototype,"backStageMenu",void 0),Bo([t.Property("")],s.prototype,"launcherIconCss",void 0),Bo([t.Property(!1)],s.prototype,"isMinimized",void 0),Bo([t.Property("en-us")],s.prototype,"locale",void 0),Bo([t.Property(0)],s.prototype,"selectedTab",void 0),Bo([t.Complex({},o.TabAnimationSettings)],s.prototype,"tabAnimation",void 0),Bo([t.Collection([],fe)],s.prototype,"tabs",void 0),Bo([t.Collection([],De)],s.prototype,"contextualTabs",void 0),Bo([t.Property("100%")],s.prototype,"width",void 0),Bo([t.Property("")],s.prototype,"helpPaneTemplate",void 0),Bo([t.Property(!1)],s.prototype,"hideLayoutSwitcher",void 0),Bo([t.Event()],s.prototype,"tabSelecting",void 0),Bo([t.Event()],s.prototype,"tabSelected",void 0),Bo([t.Event()],s.prototype,"ribbonExpanding",void 0),Bo([t.Event()],s.prototype,"ribbonCollapsing",void 0),Bo([t.Event()],s.prototype,"launcherIconClick",void 0),Bo([t.Event()],s.prototype,"created",void 0),Bo([t.Event()],s.prototype,"overflowPopupOpen",void 0),Bo([t.Event()],s.prototype,"overflowPopupClose",void 0),s=g=Bo([t.NotifyPropertyChanges],s)}(t.Component),Lo=function(){function e(e){this.parent=e}return e.prototype.getModuleName=function(){return"ribbonFileMenu"},e.prototype.destroy=function(){this.fileMenuDDB&&this.destroyDDB(),this.parent=null},e.prototype.createFileMenu=function(e){var t=this;if(e.visible){this.ddbElement=this.parent.createElement("button",{id:this.parent.element.id+"_filemenu"});var o=this.parent.tabObj.element,i=o.querySelector(".e-toolbar");o.insertBefore(this.ddbElement,i),this.fileMenuDDB=new r.DropDownButton({content:e.text,enableRtl:this.parent.enableRtl,cssClass:"e-ribbon-file-menu e-caret-hide",created:function(){o.style.setProperty(po,t.ddbElement.offsetWidth+"px")},beforeClose:this.ddbBeforeEvent.bind(this,!1),beforeOpen:this.ddbBeforeEvent.bind(this,!0),close:this.ddbAfterEvent.bind(this,!1),open:this.ddbAfterEvent.bind(this,!0)},this.ddbElement),this.parent.fileMenu.popupTemplate?this.fileMenuDDB.setProperties({target:this.parent.fileMenu.popupTemplate}):this.createRibbonMenu(e),this.parent.tabObj.refreshActiveTabBorder(),this.addFileMenuTooltip(e),this.addFileMenuKeytip()}},e.prototype.addFileMenuTooltip=function(e){y(e.ribbonTooltipSettings)&&(this.ddbElement.classList.add(Rt),this.parent.tooltipData.push({id:this.ddbElement.id,data:e.ribbonTooltipSettings}))},e.prototype.addFileMenuKeytip=function(){this.parent.fileMenu.keyTip&&(this.parent.keyTipElements.filemenu=[],this.parent.keyTipElements.filemenu.push({id:this.ddbElement.id,type:"filemenu",keyTip:this.parent.fileMenu.keyTip}))},e.prototype.ddbBeforeEvent=function(e,t){!e&&t.event&&t.event.target.closest(".e-ribbon-menu")&&(t.cancel=!0);var o=e?this.parent.fileMenu.beforeOpen:this.parent.fileMenu.beforeClose;if(o){var i={cancel:t.cancel,element:t.element,event:t.event};o.call(this,i),t.cancel=i.cancel}},e.prototype.ddbAfterEvent=function(e,t){(e?this.fileMenuDDB.target:this.fileMenuDDB.element).focus();var o=e?this.parent.fileMenu.open:this.parent.fileMenu.close;if(o){var i={element:t.element};o.call(this,i)}},e.prototype.cloneMenuItem=function(e){for(var t=[],o=0;o<e.length;o++){var i=e[parseInt(o.toString(),10)];t.push({iconCss:i.iconCss,id:i.id,separator:i.separator,text:i.text,url:i.url,items:this.cloneMenuItem(i.items)})}return t},e.prototype.createRibbonMenu=function(e){var i=this,r=this.parent.createElement("ul",{id:this.parent.element.id+ro});this.fileMenuDDB.setProperties({target:r}),this.menuctrl=new o.Menu({orientation:"Vertical",enableRtl:this.parent.enableRtl,cssClass:"e-ribbon-menu",animationSettings:e.animationSettings,items:this.cloneMenuItem(e.menuItems),showItemOnClick:e.showItemOnClick,template:e.itemTemplate,beforeClose:this.menuBeforeEvent.bind(this,!1),beforeOpen:this.menuBeforeEvent.bind(this,!0),beforeItemRender:this.beforeItemRender.bind(this),onClose:this.menuAfterEvent.bind(this,!1),onOpen:this.menuAfterEvent.bind(this,!0),select:this.menuSelect.bind(this)},r),t.EventHandler.add(r,"keydown",function(e){"Tab"===e.key&&i.fileMenuDDB.toggle()},this)},e.prototype.menuBeforeEvent=function(e,t){var o=e?this.parent.fileMenu.beforeOpen:this.parent.fileMenu.beforeClose;if(o){var i={cancel:t.cancel,element:t.element,event:t.event,items:t.items,parentItem:t.parentItem};o.call(this,i),t.cancel=i.cancel}},e.prototype.menuAfterEvent=function(e,t){var o=e?this.parent.fileMenu.open:this.parent.fileMenu.close;if(o){var i={element:t.element,items:t.items,parentItem:t.parentItem};o.call(this,i)}},e.prototype.beforeItemRender=function(e){var t=this.parent.fileMenu.beforeItemRender;if(t){var o={element:e.element,item:e.item};t.call(this,o)}},e.prototype.menuSelect=function(e){var t=this.parent.fileMenu.select;if(t){var o={element:e.element,item:e.item,event:e.event};t.call(this,o),e.element.classList.contains("e-menu-caret-icon")||this.fileMenuDDB.toggle()}},e.prototype.setCommonProperties=function(e){this.fileMenuDDB&&(this.fileMenuDDB.setProperties(e),this.menuctrl&&this.menuctrl.setProperties(e))},e.prototype.updateFileMenu=function(e){e.visible?this.fileMenuDDB?(e.text&&(this.fileMenuDDB.setProperties({content:e.text}),this.parent.tabObj.element.style.setProperty(po,this.ddbElement.offsetWidth+"px")),e.popupTemplate?(this.menuctrl&&this.destroyMenu(),this.fileMenuDDB.setProperties({target:e.popupTemplate})):this.menuctrl?this.menuctrl.setProperties({animationSettings:e.animationSettings,items:this.cloneMenuItem(e.menuItems),showItemOnClick:e.showItemOnClick,template:e.itemTemplate}):this.createRibbonMenu(e),this.removeFileMenuTooltip(),this.removeFileMenuKeytip(),this.addFileMenuTooltip(e),this.addFileMenuKeytip()):this.createFileMenu(e):this.fileMenuDDB&&this.destroyDDB(),this.parent.tabObj.refreshActiveTabBorder()},e.prototype.destroyMenu=function(){this.menuctrl&&(this.menuctrl.destroy(),this.menuctrl=null)},e.prototype.destroyDDB=function(){this.removeFileMenuTooltip(),this.removeFileMenuKeytip();this.parent.tabObj.element.style.removeProperty(po),this.destroyMenu(),this.fileMenuDDB.destroy(),this.fileMenuDDB=null,t.remove(this.ddbElement),this.ddbElement=null},e.prototype.removeFileMenuTooltip=function(){var e=this,t=l(this.parent.tooltipData,function(t){return t.id===e.ddbElement.id});-1!==t&&(this.ddbElement.classList.remove(Rt),this.parent.tooltipData.splice(t,1))},e.prototype.removeFileMenuKeytip=function(){var e=this;if(this.parent.keyTipElements.filemenu){var t=l(this.parent.keyTipElements.filemenu,function(t){return t.id===e.ddbElement.id});-1!==t&&this.parent.keyTipElements.filemenu.splice(t,1)}},e.prototype.addItems=function(e,t,o,i){o?this.menuctrl.insertAfter(e,t,i):this.menuctrl.insertBefore(e,t,i),this.parent.fileMenu.setProperties({menuItems:this.menuctrl.items},!0)},e.prototype.removeItems=function(e,t){this.menuctrl.removeItems(e,t),this.parent.fileMenu.setProperties({menuItems:this.menuctrl.items},!0)},e.prototype.enableItems=function(e,t){this.menuctrl.enableItems(e,!0,t),this.parent.fileMenu.setProperties({menuItems:this.menuctrl.items},!0)},e.prototype.disableItems=function(e,t){this.menuctrl.enableItems(e,!1,t),this.parent.fileMenu.setProperties({menuItems:this.menuctrl.items},!0)},e.prototype.setItem=function(e,t,o){this.menuctrl.setItem(e,t,o),this.menuctrl.refresh(),this.parent.fileMenu.setProperties({menuItems:this.menuctrl.items},!0)},e}(),Eo=function(){var e=function(t,o){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(t,o)};return function(t,o){function i(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(i.prototype=o.prototype,new i)}}(),Do=function(e){function i(t){var o=e.call(this)||this;return o.parent=t,o}return Eo(i,e),i.prototype.render=function(){},i.prototype.preRender=function(){},i.prototype.getPersistData=function(){return""},i.prototype.onPropertyChanged=function(){},i.prototype.getModuleName=function(){return"ribbonBackstage"},i.prototype.destroy=function(){this.backstageButton&&this.destroyDDB(),this.parent=null},i.prototype.createBackStage=function(e){var o=this;if(e.visible){this.backstageButtonEle=this.parent.createElement("button",{id:this.parent.element.id+oo});var i=this.parent.tabObj.element,r=i.querySelector(".e-toolbar");if(i.insertBefore(this.backstageButtonEle,r),this.backstageButton=new n.Button({content:e.text,enableRtl:this.parent.enableRtl,cssClass:Ht,created:function(){i.style.setProperty(po,o.backstageButtonEle.offsetWidth+"px")}},this.backstageButtonEle),this.createBackStagePopup(e),this.parent.backStageMenu.template)this.createBackStageTemplate(this.parent.backStageMenu.template);else{for(var s=0,a=0,l=0;l<e.items.length;l++){e.items[parseInt(l.toString(),10)].isFooter?s++:a++}a>0&&this.createBackstageMenu(e,!1),s>0&&this.createBackstageMenu(e,!0),this.menuCtrl&&this.checkMenuItems(this.menuCtrl.items),this.footerMenuCtrl&&this.checkMenuItems(this.footerMenuCtrl.items)}this.backstageButtonEle.onclick=function(t){t.stopPropagation(),o.showBackstage(),o.popupHTMLElement.classList.add(zt);var i=o.menuWrapper.querySelector(".e-menu-item.e-selected");i&&i.classList.remove("e-selected");for(var r=0;r<e.items.length;r++){var n=e.items[parseInt(r.toString(),10)];if(!n.isFooter&&o.menuCtrl.items[0].text===n.text){var s=o.popupHTMLElement.querySelector("#"+o.menuCtrl.items[0].id);s&&(s.classList.add("e-selected"),s.focus()),o.createBackStageContent(o.menuCtrl.items[0].id,n.content);break}}},this.parent.tabObj.refreshActiveTabBorder(),this.addBackStageMenuTooltip(e),this.addBackStageMenuKeyTip(e),t.EventHandler.add(document,"click",this.onClickEvent,this)}},i.prototype.onClickEvent=function(e){var t=e.target;this.popupHTMLElement.contains(t)||this.hideBackstage()},i.prototype.addBackStageMenuTooltip=function(e){y(e.ribbonTooltipSettings)&&(this.backstageButtonEle.classList.add(Rt),this.parent.tooltipData.push({id:this.backstageButtonEle.id,data:e.ribbonTooltipSettings}))},i.prototype.addBackStageMenuKeyTip=function(e){if(e.keyTip&&(this.parent.keyTipElements.backstage||(this.parent.keyTipElements.backstage=[]),this.parent.keyTipElements.backstage.push({id:this.backstageButtonEle.id,type:"backstage",keyTip:e.keyTip})),e.items&&e.items.length){this.parent.keyTipElements.backstageMenu||(this.parent.keyTipElements.backstageMenu=[]);for(var t=0;t<e.items.length;t++)e.items[parseInt(t.toString(),10)].keyTip&&this.parent.keyTipElements.backstageMenu.push({id:e.items[parseInt(t.toString(),10)].id,type:"backstageMenu",keyTip:e.items[parseInt(t.toString(),10)].keyTip})}},i.prototype.checkMenuItems=function(e){for(var t=0;t<e.length;t++){var o=e[parseInt(t.toString(),10)];if(!o.iconCss){this.popupHTMLElement.querySelector("#"+o.id).classList.add("e-blankicon")}}},i.prototype.createBackStagePopup=function(e){var t=this;this.popupHTMLElement=this.parent.createElement("div",{id:this.parent.element.id+io,className:Gt});e.target?(e.target instanceof HTMLElement?e.target:document.querySelector(e.target)).appendChild(this.popupHTMLElement):this.parent.element.appendChild(this.popupHTMLElement),this.popupEle=new a.Popup(this.popupHTMLElement,{height:e.height,width:e.width,relateTo:e.target||this.parent.element,enableRtl:this.parent.enableRtl}),this.parent.enableRtl&&this.updatePopupPositionOnRtl(this.parent.enableRtl),this.popupHTMLElement.onkeydown=function(e){"Escape"===e.code&&t.hideBackstage()},this.hideBackstage()},i.prototype.updatePopupPositionOnRtl=function(e){var t=this.popupHTMLElement.style;e?(t.right=t.left,t.left="unset"):(t.left=t.right,t.right="unset")},i.prototype.createBackstageMenu=function(e,t){var i=this;if(this.popupHTMLElement.querySelector("#"+this.parent.element.id+"_wrapper")||(this.menuWrapper=this.parent.createElement("div",{id:this.parent.element.id+"_wrapper",className:Ft}),this.popupHTMLElement.appendChild(this.menuWrapper)),e.backButton.visible&&!t){var r=this.parent.createElement("button",{id:this.parent.element.id+"_close",className:"e-ribbon-close-btn"});this.closeBtn=new n.Button({content:e.backButton.text,iconCss:e.backButton.iconCss?e.backButton.iconCss:Me,enableRtl:this.parent.enableRtl},r),this.menuWrapper.append(r),r.onclick=function(){i.popupHTMLElement.classList.remove(zt),i.hideBackstage(),i.isBackButtonClicked=!0}}this.popupHTMLElement.querySelector("#"+this.parent.element.id+"_itemswrapper")||(this.itemsWrapperEle=this.parent.createElement("div",{id:this.parent.element.id+"_itemswrapper",className:Ut}),this.menuWrapper.append(this.itemsWrapperEle));var s;t?(s=this.parent.createElement("ul",{id:this.parent.element.id+no}),this.itemsWrapperEle.appendChild(s)):(this.ulMenuElem=this.parent.createElement("ul",{id:this.parent.element.id+"_menulist"}),this.itemsWrapperEle.appendChild(this.ulMenuElem)),t?this.footerMenuCtrl=new o.Menu({orientation:"Vertical",enableRtl:this.parent.enableRtl,cssClass:Wt,items:this.cloneFooterMenuItem(e.items),select:this.menuSelect.bind(this,e)},s):this.menuCtrl=new o.Menu({orientation:"Vertical",enableRtl:this.parent.enableRtl,cssClass:Wt,items:this.cloneMenuItem(e.items),select:this.menuSelect.bind(this,e)},this.ulMenuElem)},i.prototype.cloneMenuItem=function(e){for(var t=[],o=0;o<e.length;o++){var i=e[parseInt(o.toString(),10)];i.isFooter||t.push({id:i.id,iconCss:i.iconCss,separator:i.separator,text:i.text})}return t},i.prototype.cloneFooterMenuItem=function(e){for(var t=[],o=0;o<e.length;o++){var i=e[parseInt(o.toString(),10)];i.isFooter&&t.push({id:i.id,iconCss:i.iconCss,separator:i.separator,text:i.text})}return t},i.prototype.createBackStageContent=function(e,o){var i="backstageContent";this.clearTemplate([i]),this.backstageContentEle?(this.backstageContentEle.innerHTML="",this.backstageContentEle.id=e+Qt):this.backstageContentEle=this.parent.createElement("div",{id:e+Qt,className:Nt});var r=p(o);return t.append(r({},this,i,"backstageContent",this.parent.isStringTemplate),this.backstageContentEle),o&&this.popupHTMLElement.append(this.backstageContentEle),this.renderReactTemplates(),r},i.prototype.createBackStageTemplate=function(e){var o="backstageTemplate";this.clearTemplate([o]),this.backstageTempEle=this.parent.createElement("div",{id:this.parent.element.id+oo+"_template",className:Kt});var i=p(e);return t.append(i({},this,o,"backstageTemplate",this.parent.isStringTemplate),this.backstageTempEle),this.popupHTMLElement.append(this.backstageTempEle),this.renderReactTemplates(),i},i.prototype.menuSelect=function(e,t){for(var o=0;o<e.items.length;o++){var i=e.items[parseInt(o.toString(),10)];if(i.text===t.item.text){this.contentItem=i;break}}this.createBackStageContent(t.item.id,this.contentItem.content);var r={cancel:!1,target:t.element,item:this.contentItem,isBackButton:this.isBackButtonClicked};this.contentItem.backStageItemClick&&this.contentItem.backStageItemClick.call(this,r)},i.prototype.setCommonProperties=function(e){this.backstageButton&&(this.backstageButton.setProperties(e),this.popupEle&&(this.popupEle.setProperties(e),this.popupHTMLElement&&this.updatePopupPositionOnRtl(e.enableRtl),this.menuCtrl&&(this.menuCtrl.setProperties(e),this.closeBtn&&this.closeBtn.setProperties(e)),this.footerMenuCtrl&&this.footerMenuCtrl.setProperties(e)))},i.prototype.updateBackStageMenu=function(e){if(e.visible)if(this.backstageButton){if(e.text&&(this.backstageButton.setProperties({content:e.text}),this.parent.tabObj.element.style.setProperty(po,this.backstageButtonEle.offsetWidth+"px")),this.popupEle&&this.popupEle.setProperties({height:e.height,width:e.width,target:e.target||this.parent.element}),e.template)this.backstageTempEle&&(t.remove(this.backstageTempEle),this.backstageTempEle=null),this.createBackStageTemplate(e.template);else if(this.menuCtrl&&this.menuCtrl.setProperties({items:this.cloneMenuItem(e.items)}),this.footerMenuCtrl)this.footerMenuCtrl.setProperties({items:this.cloneFooterMenuItem(e.items)});else{for(var o=0,i=0,r=0;r<e.items.length;r++){e.items[parseInt(r.toString(),10)].isFooter?o++:i++}i>0&&this.createBackstageMenu(e,!1),o>0&&this.createBackstageMenu(e,!0)}this.removeBackstageMenuTooltip(),this.removeBackstageMenuKeyTip(),this.addBackStageMenuTooltip(e),this.addBackStageMenuKeyTip(e)}else this.createBackStage(e);else this.backstageButton&&this.destroyDDB();this.parent.tabObj.refreshActiveTabBorder()},i.prototype.destroyMenu=function(){this.menuCtrl&&(this.menuCtrl.destroy(),this.menuCtrl=null)},i.prototype.destroyDDB=function(){this.removeBackstageMenuTooltip(),this.removeBackstageMenuKeyTip();this.parent.tabObj.element.style.removeProperty(po),this.destroyMenu(),this.backstageButton.destroy(),this.backstageButton=null,t.remove(this.backstageButtonEle),this.backstageButtonEle=null,t.EventHandler.remove(document,"click",this.onClickEvent)},i.prototype.removeBackstageMenuTooltip=function(){var e=this,t=l(this.parent.tooltipData,function(t){return t.id===e.backstageButtonEle.id});-1!==t&&(this.backstageButtonEle.classList.remove(Rt),this.parent.tooltipData.splice(t,1))},i.prototype.removeBackstageMenuKeyTip=function(){var e=this;if(this.parent.keyTipElements.backstage&&this.parent.keyTipElements.backstage.length){var t=l(this.parent.keyTipElements.backstage,function(t){return t.id===e.backstageButtonEle.id});-1!==t&&this.parent.keyTipElements.backstage.splice(t,1)}if(this.parent.keyTipElements.backstageMenu&&this.parent.keyTipElements.backstageMenu.length)for(var o=0;o<this.parent.keyTipElements.backstageMenu.length;o++)this.parent.keyTipElements.backstageMenu.splice(o,1),o--},i.prototype.addBackstageItems=function(e,t,o,i){for(var r=0;r<e.length;r++){(a=e[parseInt(r.toString(),10)]).isFooter?o?this.footerMenuCtrl.insertAfter(e,t,i):this.footerMenuCtrl.insertBefore(e,t,i):o?this.menuCtrl.insertAfter(e,t,i):this.menuCtrl.insertBefore(e,t,i)}var n=[].concat(this.menuCtrl.items,this.footerMenuCtrl.items),s=this.parent.backStageMenu;for(r=0;r<s.items.length;r++)for(var a=s.items[parseInt(r.toString(),10)],l=0;l<n.length;l++){var p=n[parseInt(l.toString(),10)];if(a.text===p.text){p.content=a.content;break}}this.parent.backStageMenu.setProperties({items:n},!0)},i.prototype.removeBackstageItems=function(e,t){this.menuCtrl.removeItems(e,t),this.footerMenuCtrl.removeItems(e,t);var o=[].concat(this.menuCtrl.items,this.footerMenuCtrl.items);this.parent.backStageMenu.setProperties({items:o},!0)},i.prototype.showBackstage=function(){this.popupEle.show()},i.prototype.hideBackstage=function(){this.popupEle.element.classList.contains(zt)&&this.popupEle.element.classList.remove(zt),this.popupEle.hide()},i}(t.Component),Ro=function(){function e(e){this.parent=e}return e.prototype.getModuleName=function(){return"ribbonContextualTab"},e.prototype.destroy=function(){this.parent=null},e.prototype.addContextualTabs=function(){for(var e=!1,t=0;t<this.parent.contextualTabs.length;t++)for(var o=0;o<this.parent.contextualTabs[parseInt(t.toString(),10)].tabs.length;o++){this.parent.addTab(this.parent.contextualTabs[parseInt(t.toString(),10)].tabs[parseInt(o.toString(),10)]);var i=this.parent.tabs.length-1,r=this.parent.tabObj.element.querySelectorAll(".e-toolbar-item")[parseInt(i.toString(),10)];r.classList.add(Ue),r.classList.add("e-hidden"),this.parent.contextualTabs[parseInt(t.toString(),10)].visible&&(this.parent.showTab(this.parent.contextualTabs[parseInt(t.toString(),10)].tabs[parseInt(o.toString(),10)].id,!0),this.parent.contextualTabs[parseInt(t.toString(),10)].isSelected&&!e&&(this.parent.selectTab(this.parent.contextualTabs[parseInt(t.toString(),10)].tabs[0].id),e=!0))}},e.prototype.updateContextualTabs=function(e,o){if(!t.isNullOrUndefined(e.visible))for(var i=0;i<o.tabs.length;i++)e.visible?this.parent.showTab(o.tabs[parseInt(i.toString(),10)].id,!0):this.parent.hideTab(o.tabs[parseInt(i.toString(),10)].id,!0);if(!t.isNullOrUndefined(e.isSelected))if(e.isSelected&&o.visible)this.parent.selectTab(o.tabs[0].id);else{var r=this.parent.tabObj.element;for(i=0;i<this.parent.tabs.length;i++){var n=r.querySelectorAll(".e-toolbar-item")[parseInt(i.toString(),10)];if(!n.classList.contains("e-hidden")&&!n.classList.contains("e-disable")){this.parent.selectTab(this.parent.tabs[parseInt(i.toString(),10)].id);break}}}if(e.tabs){var s=function(e){var t=parseInt(e,10),i=a.parent.tabs.filter(function(e){return e.id===o.tabs[parseInt(t.toString(),10)].id})[0];a.parent.updateTab(i)},a=this;for(var l in e.tabs)s(l)}},e}(),xo=function(){function e(e){this.isKeytipPopupOpen=!1,this.parent=e}return e.prototype.getModuleName=function(){return"ribbonKeyTip"},e.prototype.destroy=function(){this.parent=null},e.prototype.createKeytip=function(e){if(this.parent.keyTipElements){var t=void 0;if("tab"===e){for(var o=0;o<this.parent.tabs.length;o++)this.parent.keyTipElements[parseInt(o.toString(),10)]&&(t=this.parent.keyTipElements[o][e],this.createKeyTipElement(t[0].id,t[0].keyTip,"tab","center","bottom",!0));this.parent.keyTipElements.filemenu&&(t=this.parent.keyTipElements.filemenu,this.createKeyTipElement(t[0].id,t[0].keyTip,"filemenu")),this.parent.keyTipElements.backstage&&(t=this.parent.keyTipElements.backstage,this.createKeyTipElement(t[0].id,t[0].keyTip,"backstage")),this.parent.keyTipElements.collapse&&(t=this.parent.keyTipElements.collapse,this.createKeyTipElement(t[0].id,t[0].keyTip,"collapse")),this.parent.keyTipElements.taboverflow&&(t=this.parent.keyTipElements.taboverflow,this.createKeyTipElement(t[0].id,t[0].keyTip,"taboverflow"))}else if("popupitem"===e){if(this.parent.keyTipElements[this.parent.selectedTab].popupitem){var i=this.parent.keyTipElements[this.parent.selectedTab].popupitem;for(o=0;o<Object.keys(this.parent.keyTipElements[this.parent.selectedTab].popupitem).length;o++)this.createKeyTipElement(i[parseInt(o.toString(),10)].id,i[parseInt(o.toString(),10)].keyTip,"popupitem","left","top",!1,!0)}}else if("backstageMenu"===e){if(this.parent.keyTipElements.backstageMenu){var r=this.parent.keyTipElements.backstageMenu;for(o=0;o<Object.keys(this.parent.keyTipElements.backstageMenu).length;o++)this.createKeyTipElement(r[parseInt(o.toString(),10)].id,r[parseInt(o.toString(),10)].keyTip,"backstageMenu","left","center")}}else if("grpoverflowpopup"===e&&"Classic"===this.parent.activeLayout){if(this.parent.keyTipElements[this.parent.selectedTab].grpoverflowpopup&&this.calculateItemPosition(e),this.parent.keyTipElements[this.parent.selectedTab].launcher)for(o=0;o<Object.keys(this.parent.keyTipElements[this.parent.selectedTab].launcher).length;o++)t=this.parent.keyTipElements[this.parent.selectedTab].launcher,this.createKeyTipElement(t[parseInt(o.toString(),10)].id,t[parseInt(o.toString(),10)].keyTip,"launcher","center","bottom",!1,!0)}else{if(this.calculateItemPosition(e),"Classic"===this.parent.activeLayout){if(this.parent.keyTipElements[this.parent.selectedTab].launcher)for(o=0;o<Object.keys(this.parent.keyTipElements[this.parent.selectedTab].launcher).length;o++)t=this.parent.keyTipElements[this.parent.selectedTab].launcher,this.createKeyTipElement(t[parseInt(o.toString(),10)].id,t[parseInt(o.toString(),10)].keyTip,"launcher");if(this.parent.keyTipElements[this.parent.selectedTab].grpoverflow)for(o=0;o<Object.keys(this.parent.keyTipElements[this.parent.selectedTab].grpoverflow).length;o++)t=this.parent.keyTipElements[this.parent.selectedTab].grpoverflow,this.createKeyTipElement(t[parseInt(o.toString(),10)].id,t[parseInt(o.toString(),10)].keyTip,"grpoverflow")}if("Simplified"===this.parent.activeLayout&&(this.parent.keyTipElements.overflowbtn&&(t=this.parent.keyTipElements.overflowbtn,this.createKeyTipElement(t[0].id,t[0].keyTip,"overflowbtn")),this.parent.keyTipElements[this.parent.selectedTab].grpofbtn))for(o=0;o<Object.keys(this.parent.keyTipElements[this.parent.selectedTab].grpofbtn).length;o++)t=this.parent.keyTipElements[this.parent.selectedTab].grpofbtn,this.createKeyTipElement(t[parseInt(o.toString(),10)].id,t[parseInt(o.toString(),10)].keyTip,"grpofbtn")}}},e.prototype.calculateItemPosition=function(e,t,o){void 0===t&&(t=!1);var i,r,n;if(n=this.parent.keyTipElements[parseInt(this.parent.selectedTab.toString(),10)][e])for(var s=0;s<Object.keys(this.parent.keyTipElements[parseInt(this.parent.selectedTab.toString(),10)][e]).length;s++)if(t&&n[parseInt(s.toString(),10)].keyTip===o||!t){var a=n[parseInt(s.toString(),10)].id;n[parseInt(s.toString(),10)].id.includes("_grpbtn")&&(a=n[parseInt(s.toString(),10)].id.replace(/_grpbtn\d+/,""));var l=c(this.parent.tabs,a);l&&"Column"===l.group.orientation&&l.collection.items.length>1&&"Simplified"!==this.parent.activeLayout?0===l.itemIndex?(i="center",r="top"):1===l.itemIndex?(i="center",r="center"):(i="center",r="bottom"):l&&"Row"===l.group.orientation&&l.group.collections.length>1&&"Simplified"!==this.parent.activeLayout&&(0===l.collectionIndex?(i="center",r="top"):(i="center",r="bottom")),"item"===e?this.createKeyTipElement(n[parseInt(s.toString(),10)].id,n[parseInt(s.toString(),10)].keyTip,e,i,r):this.createKeyTipElement(n[parseInt(s.toString(),10)].id,n[parseInt(s.toString(),10)].keyTip,e,i,r,!1,!0)}},e.prototype.createKeyTipElement=function(e,t,o,i,r,n,s){void 0===i&&(i="center"),void 0===r&&(r="bottom"),void 0===n&&(n=!1),void 0===s&&(s=!1);var l,p=document.querySelector("#"+e),c=!1;if(n&&(p=document.querySelector("#"+e+Zt)),p)if(p.closest(".e-ribbon-group-overflow-ddb")&&(c=!0),n&&s&&p.closest(".e-toolbar-pop")&&(c=!0),p.closest(".e-split-btn-wrapper")){l=p.closest(".e-split-btn-wrapper").closest(".e-ribbon-item").id}else p.closest(".e-colorpicker-wrapper")&&(l=(p=p.closest(".e-colorpicker-wrapper")).closest(".e-ribbon-item").id);if((p&&p.offsetParent||n&&s)&&(s&&c||!s)){var u=this.parent.createElement("div",{className:We,id:e+lo});document.body.append(u);new a.Popup(u,{relateTo:"#"+(n?e+Zt:l||e),content:t,collision:{X:"fit",Y:"flip"},targetType:"relative",position:{X:i,Y:r},enableRtl:this.parent.enableRtl}).show(),this.calculateKeyTipPosition(p,u,o,r,n&&s),this.parent.isKeytipOpen=!0}},e.prototype.calculateKeyTipPosition=function(e,t,o,i,r){void 0===r&&(r=!1);var n=e.getBoundingClientRect();"backstageMenu"===o?(t.style.top=n.top+t.offsetHeight/2+"px",t.style.left=n.left+e.offsetWidth/5+"px"):"popupitem"!==o&&(t.style.left=n.left+(n.width-t.offsetWidth)/2+"px"),"filemenu"===o||"backstage"===o?t.style.top=n.top+(e.offsetHeight-e.offsetHeight/3+t.offsetHeight/6)+"px":"item"===o&&"top"===i&&(t.style.top=n.top-e.offsetHeight/2+"px")},e.prototype.keytipPress=function(e,t){var o=this;void 0===t&&(t=!1),this.isKeytipPresent=!1;for(var i=0;i<Object.keys(this.parent.keyTipElements).length&&!this.isKeytipPresent;i++)if(this.parent.keyTipElements[parseInt(i.toString(),10)]){for(var r=0;r<Object.keys(this.parent.keyTipElements[parseInt(i.toString(),10)]).length&&!this.isKeytipPresent;r++)for(var n=this.parent.keyTipElements[parseInt(i.toString(),10)][Object.keys(this.parent.keyTipElements[parseInt(i.toString(),10)])[parseInt(r.toString(),10)]],s=0;s<n.length&&!this.isKeytipPresent;s++)if(e.toUpperCase()===n[parseInt(s.toString(),10)].keyTip){if(document.querySelector("#"+n[parseInt(s.toString(),10)].id+lo)||t)if(this.isKeytipPresent=!0,this.removeKeytip(),"tab"===n[parseInt(s.toString(),10)].type)i!==this.parent.selectedTab?(this.parent.tabObj.select(i),setTimeout(function(){var e=o.parent.tabObj.element.querySelector(".e-nav-active");e&&e.click(),o.createKeytip("item")},600)):this.createKeytip("item");else if("item"===n[parseInt(s.toString(),10)].type||"grpoverflowpopup"===n[parseInt(s.toString(),10)].type||"popupitem"===n[parseInt(s.toString(),10)].type)if(document.getElementById(n[parseInt(s.toString(),10)].id)&&document.getElementById(n[parseInt(s.toString(),10)].id).classList.contains("e-ribbon-group-button"))document.getElementById(n[parseInt(s.toString(),10)].id).click();else{var a=void 0;if(n[parseInt(s.toString(),10)].id.includes("_popupButton")){var l=n[parseInt(s.toString(),10)].id.replace(/_popupButton/g,"");a=c(this.parent.tabs,l)}else a=c(this.parent.tabs,n[parseInt(s.toString(),10)].id);(!t||t&&a.tabIndex===this.parent.selectedTab)&&this.clickItems(a,n,s,!1,t)}else if("grpoverflow"===n[parseInt(s.toString(),10)].type||"grpofbtn"===n[parseInt(s.toString(),10)].type||"launcher"===n[parseInt(s.toString(),10)].type){var p=document.querySelector("#"+n[parseInt(s.toString(),10)].id);if(this.removeKeytip(),p){var u=n[parseInt(s.toString(),10)].id;if(t){if(n[parseInt(s.toString(),10)].id.includes("_launcher")||n[parseInt(s.toString(),10)].id.includes("_sim_grp_overflow")||n[parseInt(s.toString(),10)].id.includes("_overflow_dropdown")){u=n[parseInt(s.toString(),10)].id.replace(/_launcher|_sim_grp_overflow|_overflow_dropdown/g,"");(a=d(this.parent.tabs,u)).tabIndex===this.parent.selectedTab&&this.clickItems(a,n,s,!0,t,p)}}else this.clickItems(null,n,s,!0,t,p)}}}}else this.parent.keyTipElements&&this.commonItemsKeyTipPress(e,Object.keys(this.parent.keyTipElements)[parseInt(i.toString(),10)],t)},e.prototype.clickItems=function(e,o,i,n,s,a){if(n)a.click(),"launcher"!==o[parseInt(i.toString(),10)].type&&(this.isKeytipPopupOpen=!0,"grpoverflow"===o[parseInt(i.toString(),10)].type?this.createKeytip("grpoverflowpopup"):this.createKeytip("popupitem"));else{var l=o[parseInt(i.toString(),10)].id;document.querySelector("#"+l)&&s&&("Simplified"===this.parent.activeLayout?document.querySelector("#"+l).closest("#"+e.group.id+"_sim_grp_overflow-popup")&&document.querySelector("#"+l).closest("#"+e.group.id+"_sim_grp_overflow-popup").classList.contains("e-popup-close")?document.querySelector("#"+e.group.id+"_sim_grp_overflow").click():document.querySelector("#"+l).closest("#"+this.parent.tabObj.element.id+Xt+"-popup")&&document.querySelector("#"+l).closest("#"+this.parent.tabObj.element.id+Xt+"-popup").classList.contains("e-popup-close")&&document.querySelector("#"+this.parent.tabObj.element.id+Xt).click():document.querySelector("#"+l).closest("#"+e.group.id+eo+to+"-popup")&&document.querySelector("#"+l).closest("#"+e.group.id+eo+to+"-popup").classList.contains("e-popup-close")&&document.querySelector("#"+e.group.id+eo+to).click());switch(this.parent.getItemModuleName(e.item)){case"btn":this.parent.ribbonButtonModule.click(l);break;case"dropdown-btn":this.parent.ribbonDropDownModule.toggle(l);break;case"split-btn":this.parent.ribbonSplitButtonModule.toggle(l);break;case"checkbox":this.parent.ribbonCheckBoxModule.click(l);break;case"colorpicker":this.parent.ribbonColorPickerModule.toggle(l);break;case"combobox":var p=document.querySelector("#"+l);setTimeout(function(){p.focus()},100);break;case"gallery":document.querySelector("#"+l).click();break;case"template":document.querySelector("#"+l).focus();break;case"group-btn":var c=document.querySelector("#"+l);if(c){t.getInstance(c,r.DropDownButton).toggle();for(var u=0;u<e.item.groupButtonSettings.items.length;u++)e.item.groupButtonSettings.items[parseInt(u.toString(),10)].keyTip&&this.createKeyTipElement(l+(ao+u),e.item.groupButtonSettings.items[parseInt(u.toString(),10)].keyTip,"item")}}}},e.prototype.commonItemsKeyTipPress=function(e,t,o){var i=this;if(this.parent.keyTipElements[t]){var r=!1,n=this.parent.keyTipElements[t],s=void 0;if(n)if("backstageMenu"===t){for(var a=0;a<Object.keys(this.parent.keyTipElements[t]).length;a++)if(n[parseInt(a.toString(),10)].keyTip===e.toUpperCase()&&(s=document.querySelector("#"+n[parseInt(a.toString(),10)].id),document.querySelector("#"+s.id+lo)||o)){r=!0,o&&document.querySelector(".e-ribbon-backstage-popup").classList.contains("e-popup-close")&&this.parent.tabObj.element.querySelector(".e-ribbon-backstage").click();break}}else n[0]&&n[0].keyTip===e.toUpperCase()&&(s=document.querySelector("#"+n[0].id),(document.querySelector("#"+n[0].id+lo)||o)&&(r=!0));r&&(this.removeKeytip(),this.isKeytipPresent=!0,s&&(s.click(),"backstage"===t?this.createKeytip("backstageMenu"):"overflowbtn"===t?(this.isKeytipPopupOpen=!0,this.createKeytip("popupitem")):"taboverflow"===t&&setTimeout(function(){for(var e=0;e<Object.keys(i.parent.keyTipElements).length;e++)if(i.parent.keyTipElements[parseInt(e.toString(),10)]){var t=i.parent.keyTipElements[parseInt(e.toString(),10)].tab;i.createKeyTipElement(t[0].id,t[0].keyTip,"tab","center","bottom",!0,!0)}},600)))}},e.prototype.removeKeytip=function(e){var o=this,i=document.querySelectorAll(".e-ribbon-keytip"),r=!1;this.parent.keysPress="";for(var n=function(n){var a=i[parseInt(n.toString(),10)];if("Escape"===e&&s.parent.keyTipElements&&s.parent.keyTipElements[s.parent.selectedTab]){for(var p=0;p<Object.keys(s.parent.keyTipElements[s.parent.selectedTab]).length;p++){var c=Object.keys(s.parent.keyTipElements[s.parent.selectedTab])[p];if(s.parent.keyTipElements[s.parent.selectedTab][c]){if(-1!==l(s.parent.keyTipElements[s.parent.selectedTab][c],function(e){return e.id+lo===i[parseInt(n.toString(),10)].id})){if("item"===c&&!s.isKeytipPopupOpen||"grpoverflow"===c&&"Classic"===s.parent.activeLayout){s.createKeytip("tab"),e="",r=!0;break}if(s.isKeytipPopupOpen&&("popupitem"===c&&"Simplified"===s.parent.activeLayout||"grpoverflowpopup"===c&&"Classic"===s.parent.activeLayout)){s.createKeytip("item"),e="",r=!0;break}}}}for(var u=0;u<Object.keys(s.parent.keyTipElements).length;u++)if(s.parent.keyTipElements[parseInt(u.toString(),10)]){var d=s.parent.keyTipElements[parseInt(u.toString(),10)].tab;for(p=0;p<d.length;p++)if(a.id===d[0].id+lo&&document.querySelector("#"+d[0].id+Zt).closest(".e-toolbar-pop")){s.parent.tabObj.element.querySelector(".e-nav-active").click(),setTimeout(function(){o.createKeytip("tab")},600),e="",r=!0;break}if(r)break}if(!r&&s.parent.keyTipElements.backstageMenu){-1!==l(s.parent.keyTipElements.backstageMenu,function(e){return e.id+lo===i[parseInt(n.toString(),10)].id})&&(s.createKeytip("tab"),e="",r=!0)}}a&&t.remove(a)},s=this,a=0;a<i.length;a++)n(a);this.isKeytipPopupOpen=!1,r||(this.parent.isKeytipOpen=!1)},e.prototype.showKeyTips=function(e){this.parent.enableKeyTips&&(e?this.keytipPress(e,!0):this.createKeytip("tab"))},e.prototype.hideKeyTips=function(){this.removeKeytip()},e}();e.Ribbon=Po,e.ITEM_VERTICAL_CENTER=Re,e.EXPAND_COLLAPSE_ICON=xe,e.BACKSTAGE_CLOSE_ICON=Me,e.OVERFLOW_ICON=_e,e.VERTICAL_DDB=qe,e.DISABLED_CSS=Ae,e.RTL_CSS=je,e.RIBBON_HOVER=Ge,e.RIBBON_CONTROL=ze,e.RIBBON_POPUP_CONTROL=Ne,e.RIBBON_POPUP_OPEN=He,e.RIBBON_KEYTIP=We,e.SPACE=" ",e.HORIZONTAL_SCROLLBAR=Ke,e.HIDE_CSS=Fe,e.RIBBON_TAB="e-ribbon-tab",e.RIBBON_CONTEXTUAL_TAB=Ue,e.RIBBON_TAB_ACTIVE=Ve,e.RIBBON_TAB_ITEM=Xe,e.RIBBON_COLLAPSE_BUTTON=Ye,e.RIBBON_EXPAND_BUTTON=Ze,e.RIBBON_COLLAPSIBLE=Je,e.RIBBON_OVERALL_OF_BUTTON=Qe,e.RIBBON_GROUP_OF_BUTTON=$e,e.RIBBON_OVERFLOW_TARGET=et,e.RIBBON_OVERFLOW=tt,e.TAB_CONTENT=ot,e.RIBBON_MINIMIZE=it,e.RIBBON_GROUP=rt,e.RIBBON_SINGLE_BUTTON_SELECTION=nt,e.RIBBON_MULTIPLE_BUTTON_SELECTION=st,e.RIBBON_GROUP_BUTTON=at,e.RIBBON_GROUP_BUTTON_OVERFLOW_POPUP=lt,e.RIBBON_GROUP_BUTTON_CONTENT=pt,e.RIBBON_GROUP_CONTAINER=ct,e.RIBBON_OF_TAB_CONTAINER=ut,e.RIBBON_OF_GROUP_CONTAINER=dt,e.RIBBON_GROUP_CONTENT=ht,e.RIBBON_GROUP_HEADER=bt,e.RIBBON_OVERFLOW_HEADER=mt,e.RIBBON_GROUP_OVERFLOW=ft,e.RIBBON_GROUP_OVERFLOW_DDB=yt,e.RIBBON_LAUNCHER=gt,e.RIBBON_LAUNCHER_ICON_ELE=vt,e.RIBBON_LAUNCHER_ICON=St,e.RIBBON_COLLECTION=It,e.RIBBON_ITEM=Ct,e.RIBBON_ROW=Tt,e.RIBBON_COLUMN=wt,e.RIBBON_LARGE_ITEM=kt,e.RIBBON_MEDIUM_ITEM=Ot,e.RIBBON_SMALL_ITEM=Bt,e.RIBBON_CONTENT_HEIGHT=Pt,e.DROPDOWNBUTTON="e-dropdown-btn",e.DROPDOWNBUTTON_HIDE="e-caret-hide",e.RIBBON_TEMPLATE=Lt,e.RIBBON_HELP_TEMPLATE=Et,e.RIBBON_TOOLTIP=Dt,e.RIBBON_TOOLTIP_TARGET=Rt,e.RIBBON_TOOLTIP_TITLE=xt,e.RIBBON_TOOLTIP_CONTENT=Mt,e.RIBBON_TOOLTIP_ICON=_t,e.RIBBON_TOOLTIP_CONTAINER=qt,e.RIBBON_TEXT_CONTAINER=At,e.RIBBON_SIMPLIFIED_MODE=jt,e.RIBBON_BACKSTAGE_POPUP=Gt,e.RIBBON_BACKSTAGE_OPEN=zt,e.RIBBON_BACKSTAGE_CONTENT=Nt,e.RIBBON_SELECTED_CONTENT="e-ribbon-selected-content",e.RIBBON_BACKSTAGE=Ht,e.RIBBON_BACKSTAGE_MENU=Wt,e.RIBBON_BACKSTAGE_TEMPLATE=Kt,e.RIBBON_BACKSTAGE_MENU_WRAPPER=Ft,e.RIBBON_BACKSTAGE_ITEMS_WRAPPER=Ut,e.RIBBON_BACKSTAGE_TEXT_MENU="e-blankicon",e.TAB_ID="_tab",e.GROUP_ID="_group",e.COLLECTION_ID="_collection",e.ITEM_ID="_item",e.COLLAPSE_BUTTON_ID=Vt,e.OVRLOF_BUTTON_ID=Xt,e.GROUPOF_BUTTON_ID=Yt,e.HEADER_ID=Zt,e.LAUNCHER_ID=Jt,e.CONTENT_ID=Qt,e.CONTAINER_ID=$t,e.OVERFLOW_ID=eo,e.DROPDOWN_ID=to,e.RIBBON_FILE_MENU_ID="_filemenu",e.RIBBON_BACKSTAGE_MENU_ID=oo,e.RIBBON_BACKSTAGE_POPUP_ID=io,e.RIBBON_FILE_MENU_LIST=ro,e.RIBBON_MENU_LIST="_menulist",e.RIBBON_FOOTER_MENU_LIST=no,e.RIBBON_HELP_PANE_TEMPLATE_ID=so,e.RIBBON_GROUP_BUTTON_ID=ao,e.RIBBON_KEYTIP_ID=lo,e.RIBBON_FILE_MENU_WIDTH=po,e.RIBBON_HELP_PANE_TEMPLATE_WIDTH=co,e.getIndex=l,e.getTemplateFunction=p,e.getItem=c,e.getCollection=u,e.getGroup=d,e.destroyControl=h,e.updateCommonProperty=b,e.updateControlDisabled=m,e.getItemElement=f,e.isTooltipPresent=y,e.setToolTipContent=g,e.createTooltip=v,e.destroyTooltip=S,e.updateTooltipProp=I,e.setCustomAttributes=C,e.RibbonTab=fe,e.RibbonGroup=he,e.RibbonCollection=ce,e.RibbonItem=ae,e.RibbonButtonSettings=k,e.RibbonCheckBoxSettings=P,e.RibbonColorPickerSettings=D,e.RibbonComboBoxSettings=M,e.RibbonDropDownSettings=A,e.RibbonSplitButtonSettings=z,e.FileMenuSettings=ve,e.BackStageMenu=Pe,e.BackstageBackButton=Ce,e.BackstageItem=ke,e.RibbonTooltip=W,e.RibbonGroupButtonSettings=Y,e.RibbonGroupButtonItem=U,e.RibbonContextualTabSettings=De,e.RibbonGalleryGroup=te,e.RibbonGalleryItem=Q,e.RibbonGallerySettings=re,e.RibbonButton=ho,e.RibbonCheckBox=mo,e.RibbonColorPicker=yo,e.RibbonComboBox=vo,e.RibbonDropDown=Io,e.RibbonSplitButton=To,e.RibbonGroupButton=wo,e.RibbonGallery=ko,e.RibbonFileMenu=Lo,e.RibbonBackstage=Do,e.RibbonContextualTab=Ro,e.RibbonKeyTip=xo,Object.defineProperty(e,"__esModule",{value:!0})});
11
11
  //# sourceMappingURL=ej2-ribbon.umd.min.js.map