@syncfusion/ej2-ribbon 32.1.19 → 32.2.3

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.
Files changed (197) hide show
  1. package/.eslintrc.json +263 -0
  2. package/README.md +1 -1
  3. package/aceconfig.js +17 -0
  4. package/dist/ej2-ribbon.umd.min.js +9 -0
  5. package/dist/global/ej2-ribbon.min.js +9 -0
  6. package/dist/global/index.d.ts +9 -0
  7. package/package.json +8 -8
  8. package/styles/bds-lite.css +8 -0
  9. package/styles/bds-lite.scss +1 -1
  10. package/styles/bds.css +12 -0
  11. package/styles/bds.scss +2 -2
  12. package/styles/bootstrap-dark-lite.scss +1 -1
  13. package/styles/bootstrap-dark.scss +2 -2
  14. package/styles/bootstrap-lite.scss +1 -1
  15. package/styles/bootstrap.scss +2 -2
  16. package/styles/bootstrap4-lite.scss +1 -1
  17. package/styles/bootstrap4.scss +2 -2
  18. package/styles/bootstrap5-dark-lite.scss +1 -1
  19. package/styles/bootstrap5-dark.scss +2 -2
  20. package/styles/bootstrap5-lite.scss +1 -1
  21. package/styles/bootstrap5.3-lite.css +168 -0
  22. package/styles/bootstrap5.3-lite.scss +1 -1
  23. package/styles/bootstrap5.3.css +252 -0
  24. package/styles/bootstrap5.3.scss +2 -2
  25. package/styles/bootstrap5.scss +2 -2
  26. package/styles/fabric-dark-lite.scss +1 -1
  27. package/styles/fabric-dark.scss +2 -2
  28. package/styles/fabric-lite.scss +1 -1
  29. package/styles/fabric.scss +2 -2
  30. package/styles/fluent-dark-lite.scss +1 -1
  31. package/styles/fluent-dark.scss +2 -2
  32. package/styles/fluent-lite.scss +1 -1
  33. package/styles/fluent.scss +2 -2
  34. package/styles/fluent2-lite.css +172 -0
  35. package/styles/fluent2-lite.scss +1 -1
  36. package/styles/fluent2.css +258 -0
  37. package/styles/fluent2.scss +2 -2
  38. package/styles/highcontrast-light-lite.scss +1 -1
  39. package/styles/highcontrast-light.scss +2 -2
  40. package/styles/highcontrast-lite.scss +1 -1
  41. package/styles/highcontrast.scss +2 -2
  42. package/styles/material-dark-lite.scss +1 -1
  43. package/styles/material-dark.scss +2 -2
  44. package/styles/material-lite.scss +1 -1
  45. package/styles/material.scss +2 -2
  46. package/styles/material3-dark-lite.css +164 -0
  47. package/styles/material3-dark-lite.scss +1 -1
  48. package/styles/material3-dark.css +246 -0
  49. package/styles/material3-dark.scss +2 -2
  50. package/styles/material3-lite.css +168 -0
  51. package/styles/material3-lite.scss +1 -1
  52. package/styles/material3.css +252 -0
  53. package/styles/material3.scss +2 -2
  54. package/styles/ribbon/_all.bds.scss +2 -0
  55. package/styles/ribbon/_all.bootstrap-dark.scss +2 -0
  56. package/styles/ribbon/_all.bootstrap.scss +2 -0
  57. package/styles/ribbon/_all.bootstrap4.scss +2 -0
  58. package/styles/ribbon/_all.bootstrap5-dark.scss +2 -0
  59. package/styles/ribbon/_all.bootstrap5.3.scss +2 -0
  60. package/styles/ribbon/_all.bootstrap5.scss +2 -0
  61. package/styles/ribbon/_all.fabric-dark.scss +2 -0
  62. package/styles/ribbon/_all.fabric.scss +2 -0
  63. package/styles/ribbon/_all.fluent-dark.scss +2 -0
  64. package/styles/ribbon/_all.fluent.scss +2 -0
  65. package/styles/ribbon/_all.fluent2.scss +2 -0
  66. package/styles/ribbon/_all.highcontrast-light.scss +2 -0
  67. package/styles/ribbon/_all.highcontrast.scss +2 -0
  68. package/styles/ribbon/_all.material-dark.scss +2 -0
  69. package/styles/ribbon/_all.material.scss +2 -0
  70. package/styles/ribbon/_all.material3-dark.scss +2 -0
  71. package/styles/ribbon/_all.material3.scss +2 -0
  72. package/styles/ribbon/_all.tailwind-dark.scss +2 -0
  73. package/styles/ribbon/_all.tailwind.scss +2 -0
  74. package/styles/ribbon/_all.tailwind3.scss +2 -0
  75. package/styles/ribbon/_bigger.bds.scss +3 -0
  76. package/styles/ribbon/_bigger.bootstrap-dark.scss +3 -0
  77. package/styles/ribbon/_bigger.bootstrap.scss +3 -0
  78. package/styles/ribbon/_bigger.bootstrap4.scss +3 -0
  79. package/styles/ribbon/_bigger.bootstrap5-dark.scss +3 -0
  80. package/styles/ribbon/_bigger.bootstrap5.3.scss +3 -0
  81. package/styles/ribbon/_bigger.bootstrap5.scss +3 -0
  82. package/styles/ribbon/_bigger.fabric-dark.scss +3 -0
  83. package/styles/ribbon/_bigger.fabric.scss +3 -0
  84. package/styles/ribbon/_bigger.fluent-dark.scss +3 -0
  85. package/styles/ribbon/_bigger.fluent.scss +3 -0
  86. package/styles/ribbon/_bigger.fluent2.scss +3 -0
  87. package/styles/ribbon/_bigger.highcontrast-light.scss +3 -0
  88. package/styles/ribbon/_bigger.highcontrast.scss +3 -0
  89. package/styles/ribbon/_bigger.material-dark.scss +3 -0
  90. package/styles/ribbon/_bigger.material.scss +3 -0
  91. package/styles/ribbon/_bigger.material3-dark.scss +3 -0
  92. package/styles/ribbon/_bigger.material3.scss +3 -0
  93. package/styles/ribbon/_bigger.scss +0 -1
  94. package/styles/ribbon/_bigger.tailwind-dark.scss +3 -0
  95. package/styles/ribbon/_bigger.tailwind.scss +3 -0
  96. package/styles/ribbon/_bigger.tailwind3.scss +3 -0
  97. package/styles/ribbon/_layout.bds.scss +3 -0
  98. package/styles/ribbon/_layout.bootstrap-dark.scss +3 -0
  99. package/styles/ribbon/_layout.bootstrap.scss +3 -0
  100. package/styles/ribbon/_layout.bootstrap4.scss +3 -0
  101. package/styles/ribbon/_layout.bootstrap5-dark.scss +3 -0
  102. package/styles/ribbon/_layout.bootstrap5.3.scss +3 -0
  103. package/styles/ribbon/_layout.bootstrap5.scss +3 -0
  104. package/styles/ribbon/_layout.fabric-dark.scss +3 -0
  105. package/styles/ribbon/_layout.fabric.scss +3 -0
  106. package/styles/ribbon/_layout.fluent-dark.scss +3 -0
  107. package/styles/ribbon/_layout.fluent.scss +3 -0
  108. package/styles/ribbon/_layout.fluent2.scss +3 -0
  109. package/styles/ribbon/_layout.highcontrast-light.scss +3 -0
  110. package/styles/ribbon/_layout.highcontrast.scss +3 -0
  111. package/styles/ribbon/_layout.material-dark.scss +3 -0
  112. package/styles/ribbon/_layout.material.scss +3 -0
  113. package/styles/ribbon/_layout.material3-dark.scss +3 -0
  114. package/styles/ribbon/_layout.material3.scss +3 -0
  115. package/styles/ribbon/_layout.scss +0 -1
  116. package/styles/ribbon/_layout.tailwind-dark.scss +3 -0
  117. package/styles/ribbon/_layout.tailwind.scss +3 -0
  118. package/styles/ribbon/_layout.tailwind3.scss +3 -0
  119. package/styles/ribbon/_theme-variables.bds.scss +1 -0
  120. package/styles/ribbon/_theme-variables.bootstrap-dark.scss +1 -0
  121. package/styles/ribbon/_theme-variables.bootstrap.scss +1 -0
  122. package/styles/ribbon/_theme-variables.bootstrap4.scss +1 -0
  123. package/styles/ribbon/_theme-variables.bootstrap5-dark.scss +1 -0
  124. package/styles/ribbon/_theme-variables.bootstrap5.3.scss +1 -0
  125. package/styles/ribbon/_theme-variables.bootstrap5.scss +1 -0
  126. package/styles/ribbon/_theme-variables.fabric-dark.scss +1 -0
  127. package/styles/ribbon/_theme-variables.fabric.scss +1 -0
  128. package/styles/ribbon/_theme-variables.fluent-dark.scss +1 -0
  129. package/styles/ribbon/_theme-variables.fluent.scss +1 -0
  130. package/styles/ribbon/_theme-variables.fluent2.scss +1 -0
  131. package/styles/ribbon/_theme-variables.highcontrast-light.scss +1 -0
  132. package/styles/ribbon/_theme-variables.highcontrast.scss +1 -0
  133. package/styles/ribbon/_theme-variables.material-dark.scss +1 -0
  134. package/styles/ribbon/_theme-variables.material.scss +1 -0
  135. package/styles/ribbon/_theme-variables.material3-dark.scss +1 -0
  136. package/styles/ribbon/_theme-variables.material3.scss +1 -0
  137. package/styles/ribbon/_theme-variables.tailwind-dark.scss +1 -0
  138. package/styles/ribbon/_theme-variables.tailwind.scss +1 -0
  139. package/styles/ribbon/_theme.bds.scss +4 -0
  140. package/styles/ribbon/_theme.bootstrap-dark.scss +4 -0
  141. package/styles/ribbon/_theme.bootstrap.scss +4 -0
  142. package/styles/ribbon/_theme.bootstrap4.scss +4 -0
  143. package/styles/ribbon/_theme.bootstrap5-dark.scss +4 -0
  144. package/styles/ribbon/_theme.bootstrap5.3.scss +4 -0
  145. package/styles/ribbon/_theme.bootstrap5.scss +4 -0
  146. package/styles/ribbon/_theme.fabric-dark.scss +4 -0
  147. package/styles/ribbon/_theme.fabric.scss +4 -0
  148. package/styles/ribbon/_theme.fluent-dark.scss +4 -0
  149. package/styles/ribbon/_theme.fluent.scss +4 -0
  150. package/styles/ribbon/_theme.fluent2.scss +4 -0
  151. package/styles/ribbon/_theme.highcontrast-light.scss +4 -0
  152. package/styles/ribbon/_theme.highcontrast.scss +4 -0
  153. package/styles/ribbon/_theme.material-dark.scss +4 -0
  154. package/styles/ribbon/_theme.material.scss +4 -0
  155. package/styles/ribbon/_theme.material3-dark.scss +4 -0
  156. package/styles/ribbon/_theme.material3.scss +4 -0
  157. package/styles/ribbon/_theme.scss +0 -1
  158. package/styles/ribbon/_theme.tailwind-dark.scss +4 -0
  159. package/styles/ribbon/_theme.tailwind.scss +4 -0
  160. package/styles/ribbon/_theme.tailwind3.scss +4 -0
  161. package/styles/ribbon/bds.css +12 -0
  162. package/styles/ribbon/bds.scss +2 -2
  163. package/styles/ribbon/bootstrap-dark.scss +2 -2
  164. package/styles/ribbon/bootstrap.scss +2 -2
  165. package/styles/ribbon/bootstrap4.scss +2 -2
  166. package/styles/ribbon/bootstrap5-dark.scss +2 -2
  167. package/styles/ribbon/bootstrap5.3.css +252 -0
  168. package/styles/ribbon/bootstrap5.3.scss +2 -2
  169. package/styles/ribbon/bootstrap5.scss +2 -2
  170. package/styles/ribbon/fabric-dark.scss +2 -2
  171. package/styles/ribbon/fabric.scss +2 -2
  172. package/styles/ribbon/fluent-dark.scss +2 -2
  173. package/styles/ribbon/fluent.scss +2 -2
  174. package/styles/ribbon/fluent2.css +258 -0
  175. package/styles/ribbon/fluent2.scss +2 -2
  176. package/styles/ribbon/highcontrast-light.scss +2 -2
  177. package/styles/ribbon/highcontrast.scss +2 -2
  178. package/styles/ribbon/material-dark.scss +2 -2
  179. package/styles/ribbon/material.scss +2 -2
  180. package/styles/ribbon/material3-dark.css +246 -0
  181. package/styles/ribbon/material3-dark.scss +2 -2
  182. package/styles/ribbon/material3.css +252 -0
  183. package/styles/ribbon/material3.scss +2 -2
  184. package/styles/ribbon/tailwind-dark.scss +2 -2
  185. package/styles/ribbon/tailwind.scss +2 -2
  186. package/styles/ribbon/tailwind3.css +222 -0
  187. package/styles/ribbon/tailwind3.scss +2 -2
  188. package/styles/tailwind-dark-lite.scss +1 -1
  189. package/styles/tailwind-dark.scss +2 -2
  190. package/styles/tailwind-lite.scss +1 -1
  191. package/styles/tailwind.scss +2 -2
  192. package/styles/tailwind3-lite.css +148 -0
  193. package/styles/tailwind3-lite.scss +1 -1
  194. package/styles/tailwind3.css +222 -0
  195. package/styles/tailwind3.scss +2 -2
  196. package/tslint.json +111 -0
  197. /package/styles/ribbon/{_theme-variables.scss → _theme-variables.tailwind3.scss} +0 -0
@@ -1,2 +1,11 @@
1
+ /*!
2
+ * filename: ej2-ribbon.min.js
3
+ * version : 32.2.3
4
+ * Copyright Syncfusion Inc. 2001 - 2025. All rights reserved.
5
+ * Use of this code is subject to the terms of our license.
6
+ * A copy of the current license can be obtained at any time by e-mailing
7
+ * licensing@syncfusion.com. Any infringement will be prosecuted under
8
+ * applicable laws.
9
+ */
1
10
  this.ej=this.ej||{},this.ej.ribbon=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 b(e,o){t.getComponent(e,o).destroy()}function h(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;return a||(a=(n.group.enableGroupOverflow?t.getComponent(s.querySelector("#"+n.group.id+Fe),r.DropDownButton):o.overflowDDB).target.querySelector("#"+n.item.id)),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?He+"_"+r.id:He});if(t.element.append(n),r.title){var s=t.createElement("div",{innerHTML:r.title,className:Ge});n.appendChild(s)}var a=t.createElement("div",{className:We});if(n.appendChild(a),r.iconCss){var l=t.createElement("div",{className:r.iconCss+" "+Ne});a.appendChild(l)}if(r.content){var p=t.createElement("div",{innerHTML:r.content,className:ze});a.appendChild(p)}t.setProperties({content:n,cssClass:r.cssClass?r.cssClass+" "+Ae:Ae})}function v(e,t){function o(e){g(e,i,t.tooltipData)}var i=new a.Tooltip({target:"."+je,beforeRender:o.bind(this),windowCollision:!0});i.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 w=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)}}(),T=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 w(o,e),o.prototype.setProperties=function(t,o){e.prototype.setProperties.call(this,t,o)},T([t.Property("")],o.prototype,"content",void 0),T([t.Property("")],o.prototype,"cssClass",void 0),T([t.Property("")],o.prototype,"iconCss",void 0),T([t.Property(!1)],o.prototype,"isToggle",void 0),T([t.Property(!1)],o.prototype,"isPrimary",void 0),T([t.Property({})],o.prototype,"htmlAttributes",void 0),T([t.Event()],o.prototype,"created",void 0),T([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},L=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),P=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)}}(),_=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},E=function(e){function o(){return null!==e&&e.apply(this,arguments)||this}return P(o,e),o.prototype.setProperties=function(t,o){e.prototype.setProperties.call(this,t,o)},_([t.Property(10)],o.prototype,"columns",void 0),_([t.Property("")],o.prototype,"cssClass",void 0),_([t.Property("")],o.prototype,"label",void 0),_([t.Property(!0)],o.prototype,"enableOpacity",void 0),_([t.Property("Palette")],o.prototype,"mode",void 0),_([t.Property(!0)],o.prototype,"modeSwitcher",void 0),_([t.Property(!1)],o.prototype,"noColor",void 0),_([t.Property(null)],o.prototype,"presetColors",void 0),_([t.Property(!0)],o.prototype,"showButtons",void 0),_([t.Property("#008000ff")],o.prototype,"value",void 0),_([t.Property({})],o.prototype,"htmlAttributes",void 0),_([t.Event()],o.prototype,"beforeClose",void 0),_([t.Event()],o.prototype,"beforeOpen",void 0),_([t.Event()],o.prototype,"beforeTileRender",void 0),_([t.Event()],o.prototype,"created",void 0),_([t.Event()],o.prototype,"change",void 0),_([t.Event()],o.prototype,"open",void 0),_([t.Event()],o.prototype,"select",void 0),o}(t.ChildProperty),D=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)}}(),R=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},x=function(e){function o(){return null!==e&&e.apply(this,arguments)||this}return D(o,e),o.prototype.setProperties=function(t,o){e.prototype.setProperties.call(this,t,o)},R([t.Property(!1)],o.prototype,"allowFiltering",void 0),R([t.Property(!0)],o.prototype,"autofill",void 0),R([t.Property("")],o.prototype,"cssClass",void 0),R([t.Property("")],o.prototype,"label",void 0),R([t.Property([])],o.prototype,"dataSource",void 0),R([t.Complex({text:null,value:null,iconCss:null,groupBy:null},i.FieldSettings)],o.prototype,"fields",void 0),R([t.Property("Contains")],o.prototype,"filterType",void 0),R([t.Property(null)],o.prototype,"footerTemplate",void 0),R([t.Property(null)],o.prototype,"groupTemplate",void 0),R([t.Property(null)],o.prototype,"headerTemplate",void 0),R([t.Property(null)],o.prototype,"index",void 0),R([t.Property(null)],o.prototype,"itemTemplate",void 0),R([t.Property("No records found")],o.prototype,"noRecordsTemplate",void 0),R([t.Property(null)],o.prototype,"placeholder",void 0),R([t.Property("300px")],o.prototype,"popupHeight",void 0),R([t.Property("100%")],o.prototype,"popupWidth",void 0),R([t.Property(!0)],o.prototype,"showClearButton",void 0),R([t.Property("None")],o.prototype,"sortOrder",void 0),R([t.Property(null)],o.prototype,"text",void 0),R([t.Property(null)],o.prototype,"value",void 0),R([t.Property("150px")],o.prototype,"width",void 0),R([t.Property({})],o.prototype,"htmlAttributes",void 0),R([t.Event()],o.prototype,"beforeOpen",void 0),R([t.Event()],o.prototype,"change",void 0),R([t.Event()],o.prototype,"close",void 0),R([t.Event()],o.prototype,"created",void 0),R([t.Event()],o.prototype,"filtering",void 0),R([t.Event()],o.prototype,"open",void 0),R([t.Event()],o.prototype,"select",void 0),o}(t.ChildProperty),M=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 M(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),F=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)}}(),K=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 F(o,e),o.prototype.setProperties=function(t,o){e.prototype.setProperties.call(this,t,o)},K([t.Property("")],o.prototype,"content",void 0),K([t.Property("")],o.prototype,"iconCss",void 0),K([t.Property("")],o.prototype,"keyTip",void 0),K([t.Complex({},W)],o.prototype,"ribbonTooltipSettings",void 0),K([t.Property(!1)],o.prototype,"selected",void 0),K([t.Property({})],o.prototype,"htmlAttributes",void 0),K([t.Event()],o.prototype,"beforeClick",void 0),K([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({},L)],i.prototype,"checkBoxSettings",void 0),se([t.Complex({},E)],i.prototype,"colorPickerSettings",void 0),se([t.Complex({},x)],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},be=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),he=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 he(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([],be)],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),we=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)}}(),Te=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 we(o,e),Te([t.Property("")],o.prototype,"text",void 0),Te([t.Property("")],o.prototype,"id",void 0),Te([t.Property("")],o.prototype,"keyTip",void 0),Te([t.Property("")],o.prototype,"content",void 0),Te([t.Property("")],o.prototype,"iconCss",void 0),Te([t.Property(!1)],o.prototype,"separator",void 0),Te([t.Property(!1)],o.prototype,"isFooter",void 0),Te([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},Le=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),Pe=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},Ee=function(e){function o(){return null!==e&&e.apply(this,arguments)||this}return Pe(o,e),o.prototype.setProperties=function(t,o){e.prototype.setProperties.call(this,t,o)},_e([t.Property(!1)],o.prototype,"visible",void 0),_e([t.Property(!1)],o.prototype,"isSelected",void 0),_e([t.Collection([],fe)],o.prototype,"tabs",void 0),o}(t.ChildProperty),De="e-ribbon-control",Re="e-ribbon-popup-control",xe="e-ribbon-hide",Me="e-ribbon-item",qe="e-ribbon-row",Ae="e-ribbon-tooltip",je="e-ribbon-tooltip-target",Ge="e-ribbon-tooltip-title",ze="e-ribbon-tooltip-content",Ne="e-ribbon-tooltip-icon",He="e-ribbon-tooltip-container",We="e-ribbon-text-container",Fe="_sim_grp_overflow",Ke=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:("e-ribbon-vertical-center e-ribbon-control "+(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&&(s.htmlAttributes.id&&delete s.htmlAttributes.id,C(r,s.htmlAttributes)),r.onclick=function(e){s.clicked&&s.clicked.call(i,e)},s.content?r.setAttribute("aria-label",s.content):r.setAttribute("aria-label","button")},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+" "+Re}),s.onclick=function(t){e.buttonSettings.clicked&&e.buttonSettings.clicked.call(r,t),i.element.classList.contains("e-active")&&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!==Re}),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){var i=t.getComponent(o,n.Button);i.disabled||i.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=("e-ribbon-vertical-center e-ribbon-control "+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}(),Ue=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;r.htmlAttributes&&r.htmlAttributes.id&&delete r.htmlAttributes.id,new n.CheckBox({locale:this.parent.locale,enableRtl:this.parent.enableRtl,enablePersistence:this.parent.enablePersistence,checked:r.checked,cssClass:(De+" "+(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+" "+Re,a.dataBind(),a.change=function(t){e.checkBoxSettings.change&&e.checkBoxSettings.change.call(r,t),i.element.classList.contains("e-active")&&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!==Re}),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){var i=t.getComponent(o,n.CheckBox);i.disabled||i.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);r&&(e.cssClass&&(e.cssClass=(De+" "+e.cssClass).trim()),delete e.change,t.getComponent(r,n.CheckBox).setProperties(e))}},e}(),Ve=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:(De+" "+(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("e-ribbon-open"),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("e-ribbon-open"),n.open&&n.open.call(i)},select:n.select},r);n.htmlAttributes&&(n.htmlAttributes.id&&delete n.htmlAttributes.id,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("e-ribbon-hover"):e.classList.remove("e-ribbon-hover")},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+" "+Re});var c,u=p.splitBtn;p.beforeClose=function(t){c=t.event?t.event.target:null,p.element.parentElement.classList.remove("e-ribbon-open"),e.colorPickerSettings.beforeClose&&e.colorPickerSettings.beforeClose.call(r)},u.close=function(){c&&!c.closest(".e-ribbon-group-overflow-ddb")&&i.element.classList.contains("e-active")&&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!==Re}),a.setProperties({cssClass:l.join(" ")}),a.splitBtn.close=null,a.beforeClose=function(){a.element.parentElement.classList.remove("e-ribbon-open"),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.disabled||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);r&&(e.cssClass&&(e.cssClass=(De+" "+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}(),Xe=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;n.htmlAttributes&&n.htmlAttributes.id&&delete n.htmlAttributes.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:(De+" "+(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+" "+Re}),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.element.classList.contains("e-active")&&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!==Re}),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);n&&(e.cssClass&&(e.cssClass=(De+" "+e.cssClass).trim()),delete e.close,t.getComponent(n,i.ComboBox).setProperties(e))}},e}(),Ye=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=("e-ribbon-vertical-center e-ribbon-control "+(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?" e-vertical":""),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&&(s.htmlAttributes.id&&delete s.htmlAttributes.id,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+" "+Re,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.element.classList.contains("e-active")&&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!==Re}),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+"_overflow_dropdown"});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:"e-vertical e-ribbon-group-overflow-ddb",iconPosition:"Top",content:o,beforeClose:function(e){e.cancel=!t.isNullOrUndefined(e.event&&t.closest(e.event.target,"."+Re))}},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(a=0;a<s.length;a++)s[parseInt(a.toString(),10)].closest(".e-input-focus")&&(o=s[parseInt(a.toString(),10)]);if(o)for(var 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+"_overflow_dropdown");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){var t=this.getDropDownObj(e);t&&(t.disabled||t.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=(De+" e-ribbon-vertical-center "+o.cssClass).trim(),o.cssClass=n.item.activeSize===e.RibbonItemSize.Large?("e-vertical "+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("e-vertical"):s=s.filter(function(e){return"e-vertical"!==e}),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}(),Ze=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=("e-ribbon-vertical-center e-ribbon-control "+(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?" e-vertical":""),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("e-ribbon-open"),a.close&&a.close.call(n)},created:a.created,open:function(){p.wrapper.classList.add("e-ribbon-open"),a.open&&a.open.call(n)},select:a.select,click:function(e){a.click&&a.click.call(n,e)}},s);a.htmlAttributes&&(a.htmlAttributes.id&&delete a.htmlAttributes.id,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("e-ribbon-hover")},this),t.EventHandler.add(u,"mouseleave",function(){u.classList.remove("e-ribbon-hover")},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+" "+Re,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.beforeOpen=function(t){e.splitButtonSettings.beforeOpen&&e.splitButtonSettings.beforeOpen.call(n,t)},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.element.classList.contains("e-active")&&i.toggle()},a.close=function(t){e.splitButtonSettings.close&&e.splitButtonSettings.close.call(n,t),a.wrapper.classList.remove("e-ribbon-open"),u&&!u.closest(".e-ribbon-group-overflow-ddb")&&i.element.classList.contains("e-active")&&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!==Re}),s.cssClass=a.join(" "),s.dataBind(),s.beforeOpen=function(t){e.splitButtonSettings.beforeOpen&&e.splitButtonSettings.beforeOpen.call(i,t)},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("e-ribbon-open")}},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){var t=this.getSplitButtonObj(e);t&&(t.disabled||t.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=(De+" e-ribbon-vertical-center "+o.cssClass).trim(),o.cssClass=n.item.activeSize===e.RibbonItemSize.Large?("e-vertical "+o.cssClass).trim():o.cssClass,a.cssClass=o.cssClass),delete o.beforeOpen,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("e-vertical"):s=s.filter(function(e){return"e-vertical"!==e}),n.cssClass=s.join(" "),n.setProperties({iconPosition:i.activeSize===e.RibbonItemSize.Large?"Top":"Left"}),this.setContent(i,n)},o}(),Je=function(){function o(e){this.grpBtnIndex=0,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+"_grpbtn",className:"e-btn-group"});i.appendChild(l);for(h=0;h<a.items.length;h++)if(a.items[parseInt(h.toString(),10)].iconCss){var p=this.parent.createElement("button",{id:o.id+"_grpbtn"+h,className:"e-ribbon-group-button"});l.appendChild(p),new n.Button({iconCss:a.items[parseInt(h.toString(),10)].iconCss,disabled:o.disabled,enableRtl:this.parent.enableRtl,content:o.activeSize===e.RibbonItemSize.Small?"":a.items[parseInt(h.toString(),10)].content,iconPosition:o.activeSize===e.RibbonItemSize.Large?"Top":"Left"},p),a.items[parseInt(h.toString(),10)].htmlAttributes&&C(p,a.items[parseInt(h.toString(),10)].htmlAttributes),a.items[parseInt(h.toString(),10)].content?(p.classList.add("e-ribbon-group-button-content"),p.setAttribute("aria-label",a.items[parseInt(h.toString(),10)].content)):p.setAttribute("aria-label","groupbuttonitem");b=i.querySelector("#"+o.id+"_grpbtn"+h);a.selection===e.RibbonGroupButtonSelection.Single?l.classList.add("e-ribbon-single-selection"):l.classList.add("e-ribbon-multiple-selection"),a.items[parseInt(h.toString(),10)].selected&&(a.selection===e.RibbonGroupButtonSelection.Multiple?b.classList.add("e-active"):this.count<1&&(b.classList.add("e-active"),this.count++),this.grpBtnIndex=h),a.items[parseInt(h.toString(),10)].ribbonTooltipSettings&&y(a.items[parseInt(h.toString(),10)].ribbonTooltipSettings)&&(p.classList.add(je),this.parent.tooltipData.push({id:p.id,data:a.items[parseInt(h.toString(),10)].ribbonTooltipSettings})),t.EventHandler.add(b,"click",this.groupButtonClicked.bind(this,h,o,a),this)}if("Simplified"===this.parent.activeLayout){var c=void 0,u=0,d=0,b=this.parent.createElement("button",{id:o.id});i.appendChild(b);for(var h=0;h<a.items.length;h++)o.groupButtonSettings.items[parseInt(h.toString(),10)].selected&&!this.isSelected&&a.selection===e.RibbonGroupButtonSelection.Single?(c=o.groupButtonSettings.items[parseInt(h.toString(),10)].iconCss,this.isSelected=!0):o.groupButtonSettings.items[parseInt(h.toString(),10)].selected&&a.selection===e.RibbonGroupButtonSelection.Multiple&&(c=1===++u?o.groupButtonSettings.items[parseInt(h.toString(),10)].iconCss:null);for(;d<o.groupButtonSettings.items.length&&!this.isSelected&&!c;)o.groupButtonSettings.items[parseInt(d.toString(),10)].iconCss&&(c=o.groupButtonSettings.items[parseInt(d.toString(),10)].iconCss,this.isSelected=!0),d++;var m=new r.DropDownButton({iconCss:c,target:l,enableRtl:this.parent.enableRtl,cssClass:"e-ribbon-dropdown-group-button",disabled:o.disabled},b);if(a.header){var f=m.dropDown;this.addGroupButtonHeader(o.id,a,f.element)}b.onclick=b.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=document.querySelector("#"+i.id),u=0;u<n.items.length;u++)document.querySelector("#"+i.id+"_grpbtn"+u)&&document.querySelector("#"+i.id+"_grpbtn"+u).classList.contains("e-active")&&a.push(n.items[parseInt(u.toString(),10)]);document.querySelector("#"+i.id+"_grpbtn"+o).classList.contains("e-active")||l.push(n.items[parseInt(o.toString(),10)]);var d={cancel:!1,previousItems:a,selectingItems:l};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+"_grpbtn").classList.contains("e-ribbon-multiple-selection")&&(document.querySelector("#"+i.id+"_grpbtn").classList.remove("e-ribbon-multiple-selection"),document.querySelector("#"+i.id+"_grpbtn").classList.add("e-ribbon-single-selection"));for(u=0;u<n.items.length;u++)document.querySelector("#"+i.id+"_grpbtn"+u)&&document.querySelector("#"+i.id+"_grpbtn"+u).classList.contains("e-active")&&(document.querySelector("#"+i.id+"_grpbtn"+u).classList.remove("e-active"),n.items[parseInt(u.toString(),10)].setProperties({selected:!1},!0));document.querySelector("#"+i.id+"_grpbtn"+o).classList.toggle("e-active"),n.items[parseInt(o.toString(),10)].setProperties({selected:!0},!0),document.querySelector("#"+i.id+"_grpbtn"+o).classList.contains("e-active")&&"Simplified"===this.parent.activeLayout&&(this.grpBtnIndex=o,(s=t.getComponent(c,r.DropDownButton)).setProperties({iconCss:n.items[parseInt(o.toString(),10)].iconCss}))}else{document.querySelector("#"+i.id+"_grpbtn").classList.contains("e-ribbon-single-selection")&&(document.querySelector("#"+i.id+"_grpbtn").classList.remove("e-ribbon-single-selection"),document.querySelector("#"+i.id+"_grpbtn").classList.add("e-ribbon-multiple-selection")),document.querySelector("#"+i.id+"_grpbtn"+o).classList.toggle("e-active"),document.querySelector("#"+i.id+"_grpbtn"+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 b=0,h=0;h<n.items.length;h++)document.querySelector("#"+i.id+"_grpbtn"+h)&&document.querySelector("#"+i.id+"_grpbtn"+h).classList.contains("e-active")&&"Simplified"===this.parent.activeLayout&&h!==o&&(this.isSelected=!0,b++);if("Simplified"===this.parent.activeLayout){var m=null,f=0;if(s=t.getComponent(c,r.DropDownButton),this.isSelected){if(1===b&&!document.querySelector("#"+i.id+"_grpbtn"+o).classList.contains("e-active"))for(h=0;h<n.items.length;h++)document.querySelector("#"+i.id+"_grpbtn"+h)&&document.querySelector("#"+i.id+"_grpbtn"+h).classList.contains("e-active")&&(m=n.items[parseInt(h.toString(),10)].iconCss)}else document.querySelector("#"+i.id+"_grpbtn"+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++;s.setProperties({iconCss:m}),this.grpBtnIndex=o}this.isSelected=!1}document.querySelector("#"+i.id+"_grpbtn"+o).classList.contains("e-active")&&p.push(n.items[parseInt(o.toString(),10)]);var y={previousItems:a,selectedItems:p};n.items[parseInt(o.toString(),10)].click&&n.items[parseInt(o.toString(),10)].click.call(this,y),"Simplified"===this.parent.activeLayout&&c&&(s=t.getComponent(c,r.DropDownButton)).toggle()}},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+"_grpbtn"),u=this.parent.createElement("button",{id:o.id});i.appendChild(u);for(var d=0;d<s.items.length;d++)document.querySelector("#"+o.id+"_grpbtn"+d)&&(document.querySelector("#"+o.id+"_grpbtn"+d).classList.contains("e-active")&&s.selection===e.RibbonGroupButtonSelection.Single?a=s.items[parseInt(d.toString(),10)].iconCss:document.querySelector("#"+o.id+"_grpbtn"+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++;m=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=m.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 h=i.querySelector("#"+o.id),m=t.getComponent(h,r.DropDownButton);i.appendChild(m.target),h&&(m.destroy(),t.remove(h))}},o.prototype.handleFocusState=function(e,t){if(t.querySelector("#"+e.id).classList.contains("e-active")){var o=document.querySelector("#"+e.id+"_grpbtn").querySelector(".e-ribbon-group-button.e-active");o?o.focus():document.querySelector("#"+e.id+"_grpbtn0").focus()}},o.prototype.addGroupButtonHeader=function(e,t,o){var i=this.parent.createElement("div",{className:"e-ribbon-groupbutton-header",id:e+"_header",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("e-ribbon-group-button-overflow-popup")&&(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<a.items.length?document.querySelector("#"+o.id+"_grpbtn"+this.grpBtnIndex).focus():(this.grpBtnIndex=0,document.querySelector("#"+o.id+"_grpbtn"+this.grpBtnIndex).focus()):0===this.grpBtnIndex?(this.grpBtnIndex=a.items.length-1,document.querySelector("#"+o.id+"_grpbtn"+this.grpBtnIndex).focus()):(this.grpBtnIndex--,document.querySelector("#"+o.id+"_grpbtn"+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+"_grpbtn"+this.grpBtnIndex).focus()):(this.grpBtnIndex--,document.querySelector("#"+o.id+"_grpbtn"+this.grpBtnIndex).focus()):++this.grpBtnIndex<a.items.length?document.querySelector("#"+o.id+"_grpbtn"+this.grpBtnIndex).focus():(this.grpBtnIndex=0,document.querySelector("#"+o.id+"_grpbtn"+this.grpBtnIndex).focus()))},o.prototype.addOverFlowEvents=function(e,o,i){var n=this,s=e.groupButtonSettings,a=!0,l=o.querySelector("#"+e.id);if(l){var p=t.getComponent(l,r.DropDownButton);p.setProperties({cssClass:p.cssClass+" e-ribbon-group-button-overflow-popup",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("e-ribbon-group-button-overflow-popup")&&i.element.classList.contains("e-active")&&i.toggle()}}var d=o.querySelector("#"+e.id+"_grpbtn");"Classic"===this.parent.activeLayout&&d&&(d.onclick=function(){i.element.classList.contains("e-active")&&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-ribbon-group-button-overflow-popup"!==e}),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++)(r="Classic"===this.parent.activeLayout?o.querySelector("#"+i.id+"_grpbtn"+a):document.querySelector("#"+i.id+"_grpbtn"+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}(),Qe=function(){function e(e){this.count=0,this.isAdded=!1,this.galleryItemsIndex=0,this.registeredTemplate={},this.parent=e;var o="viewContainerRef";t.setValue("registeredTemplate",this.registeredTemplate,this),t.setValue(o,this.parent[""+o],this)}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"});n.setAttribute("aria-label","gallerydropdownbutton"),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=this,u=0;u<e.groups.length&&"break"!==function(a){var c=!1;r=p.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&&(c=!0),e.groups[parseInt(a.toString(),10)].cssClass&&r.classList.add(e.groups[parseInt(a.toString(),10)].cssClass);for(var u=0;u<e.groups[parseInt(a.toString(),10)].items.length&&"break"!==function(i){n=p.parent.createElement("li",{className:"e-ribbon-gallery-item",id:(t?"popup_":"")+r.id+"_gallery"+i,attrs:{tabindex:"0"}});var u={name:"beforeItemRender",item:e.groups[parseInt(a.toString(),10)].items[parseInt(i.toString(),10)]};if(e.beforeItemRender&&e.beforeItemRender.call(p,u),r.appendChild(n),e.selectedItemIndex&&e.selectedItemIndex===p.count?n.classList.add("e-ribbon-gallery-selected"):e.selectedItemIndex||0!==p.count||(n.classList.add("e-ribbon-gallery-selected"),e.selectedItemIndex=p.count),p.count=p.count+1,n.onclick=function(i){s.setActiveState(i.currentTarget,e,o,!0,i,t)},n.onkeydown=function(i){"Enter"!==i.key&&" "!==i.key||s.setActiveState(i.currentTarget,e,o,!0,i,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","Simplified"===p.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=p.parent.createElement("span",{className:"e-ribbon-gallery-icons "+e.groups[parseInt(a.toString(),10)].items[parseInt(i.toString(),10)].iconCss});n.appendChild(d),"Simplified"!==p.parent.activeLayout||t||d.classList.add("e-hidden")}e.groups[parseInt(a.toString(),10)].items[parseInt(i.toString(),10)].content&&n.appendChild(p.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&&p.createGalleryTemplate(n,e,o,e.groups[parseInt(a.toString(),10)].items[parseInt(i.toString(),10)]),e.popupTemplate&&t&&p.createGalleryPopupTemplate(n,e,o,e.groups[parseInt(a.toString(),10)].items[parseInt(i.toString(),10)]),!t&&!c&&e.itemCount===p.count)return l.appendChild(r),p.isAdded=!0,"break"}(u);u++);if(p.isAdded&&!t)return"break";if(t?i.appendChild(r):l.appendChild(r),t&&e.groups[parseInt(a.toString(),10)].header){var d=p.parent.createElement("div",{className:"e-ribbon-gallery-header",innerHTML:e.groups[parseInt(a.toString(),10)].header});i.insertBefore(d,r)}}(u);u++);this.count=0,this.isAdded=!1,this.parent.isReact&&(this.parent.portals=this.parent.portals.concat(this.portals),this.parent.renderReactTemplates(),this.portals=void 0)},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(!(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 b=parseFloat(u.marginLeft)+parseFloat(u.marginRight);t.isNullOrUndefined(b)||(s+=b)}}n++}if(a)break}s>0&&(o.style.width=s+"px")},e.prototype.setWrapperStyle=function(e,t){"auto"!==e.width&&t.forEach(function(e){e.style.flexFlow="wrap"})},e.prototype.checkAvailableHeight=function(e){for(var o=e.querySelectorAll(".e-ribbon-gallery-wrapper"),i=0;i<o.length;i++){var r=0,n=0,s=!1,a=o[parseInt(i.toString(),10)],l=a.id.replace(/_galleryWrapper/g,""),p=a.offsetHeight,u=c(this.parent.tabs,l);if(u){this.setWrapperWidth(u.item.gallerySettings.itemCount,a,u.item.gallerySettings,l);for(var d=0;d<u.item.gallerySettings.groups.length;d++)for(var b=0;b<u.item.gallerySettings.groups[parseInt(d.toString(),10)].items.length;b++){var h=a.querySelector("#"+l+"_galleryContainer"+d+"_gallery"+b);if(h)if("Classic"===this.parent.activeLayout)if(h.classList.contains("e-hidden")&&h.classList.remove("e-hidden"),s)h.remove();else{var m=0,f=window.getComputedStyle(h);if(f){var y=parseFloat(f.marginTop)+parseFloat(f.marginBottom);t.isNullOrUndefined(y)||(m+=y)}r++,u.item.gallerySettings.itemCount===r?(r=0,p>=h.offsetHeight+m?p-=h.offsetHeight+m:(s=!0,h.remove())):p<h.offsetHeight+m&&(s=!0,h.remove())}else++n>u.item.gallerySettings.itemCount&&h.classList.add("e-hidden")}}}},e.prototype.checkCollision=function(e,o,i){void 0===i&&(i=0);var r=0,n=0;if(o){var s=window.innerWidth,a=0===i?s:Math.abs(s-(s-i)),l=window.getComputedStyle(o);l&&(r=parseFloat(l.paddingLeft)+parseFloat(l.paddingRight),t.isNullOrUndefined(r)||(a-=r));var p=o.querySelectorAll(".e-ribbon-gallery-container");this.setWrapperStyle(e,p);for(var c=!1,u=0;u<p.length;u++){for(var d=0,b=0;b<p[parseInt(u.toString(),10)].querySelectorAll(".e-ribbon-gallery-item").length;b++){var h=window.getComputedStyle(p[parseInt(u.toString(),10)].querySelectorAll(".e-ribbon-gallery-item")[parseInt(b.toString(),10)]);if(h&&(n=parseFloat(h.marginLeft)+parseFloat(h.marginRight),t.isNullOrUndefined(n)||(d+=n)),d+=Math.round(parseFloat(h.width)),a<=d&&"auto"===e.width||"auto"!==e.width&&a<=parseInt(e.width.toString(),10)&&a<=d){o.style.width=d+Math.abs(r-n)-Math.round(parseFloat(h.width))+"px",c=!0;break}}if(c){p.forEach(function(e){e.style.flexFlow="wrap"}),"auto"===e.height&&this.setGalleryPopupHeight(o,parseFloat(l.height),parseFloat(l.top));break}}c||("auto"===e.width?(p.forEach(function(e){e.style.flexFlow="nowrap"}),o.style.width="auto"):o.style.width=e.width.toString(),"auto"===e.height&&this.setGalleryPopupHeight(o,parseFloat(l.height),parseFloat(l.top)))}},e.prototype.setGalleryPopupHeight=function(e,t,o){window.innerHeight<t||window.innerHeight<Math.round(t+o)?e.style.height=window.innerHeight-o+"px":e.style.height="auto"},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+"_container"),i=c(this.parent.tabs,t);if(o){var r=o.querySelectorAll(".e-ribbon-gallery-icons"),n=o.querySelectorAll(".e-ribbon-gallery-container");if(r.length)for(a=0;a<r.length;a++)"Simplified"===e?r[parseInt(a.toString(),10)].classList.add("e-hidden"):r[parseInt(a.toString(),10)].classList.remove("e-hidden");if(n.length&&i)for(var s=0;s<i.item.gallerySettings.groups.length;s++)for(var a=0;a<n.length;a++)i.item.gallerySettings.groups[parseInt(s.toString(),10)].itemHeight&&"auto"!==i.item.gallerySettings.groups[parseInt(s.toString(),10)].itemHeight&&t+"_galleryContainer"+s===n[parseInt(a.toString(),10)].id&&(n[parseInt(a.toString(),10)].style.flexFlow="Simplified"===e?"nowrap":"wrap");var l=this.parent.tabObj.element.querySelector("#"+this.parent.tabs[this.parent.selectedTab].id+"_content");l&&this.checkAvailableHeight(l)}},e.prototype.addOverFlowEvents=function(e,o){var i=this;if(o.closest(".e-ribbon-overflow-target")){var n=this.parent.createElement("button",{id:e.id});o.appendChild(n),o.querySelector(".e-ribbon-gallery-wrapper").classList.contains("e-disabled")&&n.classList.add("e-disabled"),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 s=o.querySelector("#"+e.id+"_popupButton");s&&s.classList.add("e-hidden");var l=c(this.parent.tabs,e.id),p=l&&l.group.groupIconCss?l.group.groupIconCss:"",u=l&&l.group.header?l.group.header:"";if(!p)for(var d=0;d<e.gallerySettings.groups.length;d++){for(var b=0;b<e.gallerySettings.groups[parseInt(d.toString(),10)].items.length;b++)if(e.gallerySettings.groups[parseInt(d.toString(),10)].items[parseInt(b.toString(),10)].iconCss){p=e.gallerySettings.groups[parseInt(d.toString(),10)].items[parseInt(b.toString(),10)].iconCss;break}if(p)break}var h=document.querySelector("#"+e.id+"_galleryPopup"),m=t.getComponent(h,a.Popup),f=document.querySelector("#"+e.id+"_galleryPopup .e-ribbon-popup-container"),y=new r.DropDownButton({iconCss:p,content:u,target:f,enableRtl:this.parent.enableRtl,cssClass:"e-ribbon-gallery-dropdown",disabled:e.disabled,open:function(){var t=f.querySelectorAll(".e-ribbon-gallery-container");i.setWrapperStyle(m,t),i.setFoucsToFirstItem(f,!0,e.id)},beforeClose:function(t){i.popupEvents(t.event,e.gallerySettings,"popupClose",!1)&&(t.cancel=!0)}},n);"auto"!==m.width&&(y.dropDown.width=t.formatUnit(m.width)),"auto"!==m.height&&(y.dropDown.height=t.formatUnit(m.height),y.dropDown.element.style.height=m.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,n){var s,a,l=document.querySelector("#"+o+"_container"),p=Array.prototype.slice.call(l.querySelectorAll(".e-ribbon-gallery-selected")),c=document.querySelector("#"+o+"_popupContainer"),u=Array.prototype.slice.call(c.querySelectorAll(".e-ribbon-gallery-selected"));u.length&&(p=p.concat(u));for(g=0;g<t.groups.length;g++)for(var d=0;d<t.groups[parseInt(g.toString(),10)].items.length;d++)p[0].id===o+"_galleryContainer"+g+"_gallery"+d&&(s=t.groups[parseInt(g.toString(),10)].items[parseInt(d.toString(),10)]),e.id===(n?"popup_":"")+o+"_galleryContainer"+g+"_gallery"+d&&(a=t.groups[parseInt(g.toString(),10)].items[parseInt(d.toString(),10)]);var b,h=document.getElementById(e.id),m={cancel:!1,name:"beforeSelect",previousItem:s,currentItem:a,isInteracted:i,event:r};if(t.beforeSelect&&t.beforeSelect.call(this,m),!m.cancel){for(g=0;g<p.length;g++)p[parseInt(g.toString(),10)].classList.remove("e-ribbon-gallery-selected");h.id.startsWith("popup_")?document.getElementById(h.id.slice(6))&&(b=document.getElementById(h.id.slice(6))):b=document.getElementById("popup_"+e.id),b&&b.classList.add("e-ribbon-gallery-selected"),h.classList.add("e-ribbon-gallery-selected");for(var f={previousItem:s,currentItem:a,name:"select",isInteracted:i,event:r},y=document.querySelectorAll("#"+o+"_popupContainer .e-ribbon-gallery-item"),g=0;g<y.length;g++)if(y[parseInt(g.toString(),10)].id===e.id){t.selectedItemIndex=g;break}t.select&&t.select.call(this,f)}},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();t.offsetWidth>s.left&&this.checkCollision(e,t,s.left);var 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){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!==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||"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,null,null,this.parent),e)},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,null,null,this.parent),e)},e}(),$e=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)}}(),et=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},tt=function(i){function g(e,t){return C.Inject(Ke,Ue,Ye,Ze,Xe,Je),i.call(this,e,t)||this}$e(g,i),C=g,g.prototype.render=function(){this.initialize()},g.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"}},g.prototype.getPersistData=function(){return this.addOnPersist(["activeLayout"])},g.prototype.getModuleName=function(){return"ribbon"},g.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},g.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("e-rtl"),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},g.prototype.wireEvents=function(){this.resizeListener=this.resizeHandler.bind(this),t.EventHandler.add(window,"resize",this.resizeListener),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)},g.prototype.wireKeyboardEvent=function(){this.keyboardModuleRibbon=new t.KeyboardEvents(this.element,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"})},g.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+"_content"),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(l=0;l<a.length;l++)a[parseInt(l.toString(),10)].closest(".e-input-focus")&&(t=a[parseInt(l.toString(),10)]);if(t)for(var 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");)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)}},g.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(".e-ribbon-group-container");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(".e-ribbon-group-container"),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 i&&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(".e-ribbon-group-container")).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(".e-ribbon-group-container")).querySelector(".e-ribbon-launcher-icon"))&&i.querySelector(".e-ribbon-launcher-icon").focus(),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(u=o[this.currentControlIndex].closest(".e-ribbon-item");u&&u.classList.contains("e-disabled");)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(var u=o[this.currentControlIndex].closest(".e-ribbon-item");u&&u.classList.contains("e-disabled");)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()))},g.prototype.resizeHandler=function(){var e=this.tabObj.element.querySelector("#"+this.tabs[this.selectedTab].id+"_content");if(t.isNullOrUndefined(e)||this.checkOverflow(this.selectedTab,e),this.scrollModule){var o=this.tabObj.element.querySelector(".e-hscroll-bar");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"),n=document.querySelectorAll(".e-ribbon .e-colorpicker-wrapper.e-ribbon-control.e-ribbon-open .e-colorpicker, .e-ribbon-group-overflow-ddb .e-colorpicker-wrapper.e-ribbon-control.e-ribbon-open .e-colorpicker");i.forEach(function(e){var o=t.getInstance(e,r.DropDownButton);o&&o.toggle()}),n.forEach(function(e){var o=t.getInstance(e,s.ColorPicker);o&&(o.toggle(),o.refresh())})}var l=document.querySelector(".e-ribbon-gallery-popup.e-popup-open");l&&t.getComponent(l,a.Popup).hide(),this.ribbonKeyTipModule&&this.enableKeyTips&&this.ribbonKeyTipModule.removeKeytip()},g.prototype.mouseEventHandler=function(){this.ribbonKeyTipModule&&this.enableKeyTips&&this.ribbonKeyTipModule.removeKeytip()},g.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(l=0;l<n.length;l++)t.getInstance(n[parseInt(l.toString(),10)],r.DropDownButton).toggle();this.ribbonKeyTipModule.removeKeytip()}else if(this.isKeytipOpen)this.ribbonKeyTipModule.removeKeytip();else{var s=document.querySelector(".e-ribbon-backstage-popup");s&&s.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 a=document.querySelectorAll(".e-ribbon-keytip");if(a){for(var l=0;l<a.length;l++)if(a[parseInt(l.toString(),10)].innerHTML.toLowerCase()===i){o=!0,this.ribbonKeyTipModule.keytipPress(i);break}o||this.checkKeyTipPresent(i,this.keysPress.length)}}}},g.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}}},g.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)}},g.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[parseInt(e.toString(),10)][""+i]).length){for(var n=this.keyTipElements[parseInt(e.toString(),10)][""+i],s=0;s<Object.keys(this.keyTipElements[parseInt(e.toString(),10)][""+i]).length;s++)n[parseInt(s.toString(),10)].id===o&&(r=!0);r||this.keyTipElements[parseInt(e.toString(),10)][""+i].push({id:o,type:i,keyTip:t})}else this.keyTipElements[parseInt(e.toString(),10)][""+i].push({id:o,type:i,keyTip:t})}},g.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("--fileMenuWidth","0px"),this.element.style.setProperty("--helpTemplateWidth","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"]("e-ribbon-minimize")},g.prototype.minimize=function(e){var t=this;if(e!==this.isMinimized){var o={cancel:!1};this.trigger(e?"ribbonCollapsing":"ribbonExpanding",o,function(o){o.cancel||(t.setProperties({isMinimized:e},!0),t.element.classList.toggle("e-ribbon-minimize",t.isMinimized),t.tabObj.element.querySelector(".e-content").style.display=e?"none":"block",e||t.refreshLayout())})}},g.prototype.toggleLayout=function(e){this.setProperties({activeLayout:"Simplified"===this.activeLayout?"Classic":"Simplified"},!0),this.switchLayout();var t={activeLayout:this.activeLayout,event:e};this.trigger("ribbonLayoutSwitched",t)},g.prototype.tabCreated=function(){this.hideLayoutSwitcher||this.addExpandCollapse(),this.renderInitialTab(this.selectedTab)},g.prototype.ribbonTabSelected=function(e){e.preventFocus=!0,this.isAddRemove=!1;var o=e.selectedItem.getAttribute("data-id"),i=l(this.tabs,function(e){return e.id===o});i=-1===i?this.selectedTab:i;var r=this.tabObj.items[parseInt(i.toString(),10)].content;if(!r.querySelector(".e-ribbon-group")&&0!==this.tabs[parseInt(i.toString(),10)].groups.length){var n=this.createGroups(this.tabs[parseInt(i.toString(),10)].groups,i);t.append(n,r)}var s=this.isContextualTab(o);this.updateSelectedState(o);var a={previousIndex:this.selectedTab,selectedIndex:i,isContextual:s};if(this.setProperties({selectedTab:i},!0),this.calculateHiddenElementsWidth(i),this.isUpdateItems){for(var p=0;p<this.itemsModel.length;p++){var c=this.itemsModel[parseInt(p.toString(),10)];this.selectedTab===this.targetTabs[c.id]&&(this.updateItem(c),this.itemsModel.splice(p,1),p--)}0===this.itemsModel.length&&(this.isUpdateItems=!1)}if(this.ribbonGalleryModule&&this.ribbonGalleryModule.checkAvailableHeight(e.selectedContent.firstChild),this.checkOverflow(i,r),"Simplified"===this.activeLayout&&this.overflowDDB){var u=this.overflowDDB.target,d=u.querySelector(".e-ribbon-active");d&&d.classList.remove("e-ribbon-active");var b=u.querySelector("#"+o+"_overflow");b?(b.classList.add("e-ribbon-active"),this.overflowDDB.element.classList.remove(xe),this.checkOverflowHiddenItems(!1,i)):this.overflowDDB.element.classList.add(xe)}this.trigger("tabSelected",a)},g.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)}},g.prototype.checkOverflow=function(e,t){var i=t.closest(".e-content"),r=i.offsetWidth<t.offsetWidth;if(r&&!this.scrollModule){if("Classic"===this.activeLayout){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(".e-content")))}else if(!r)if(this.destroyScroll(),"Classic"===this.activeLayout){var 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()},g.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},g.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+"_container"),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+"_container");if(d){var b=d.querySelector("#"+u.id);d.setAttribute("data-medium-width",i.offsetWidth.toString()),u.setProperties({activeSize:e.RibbonItemSize.Small},!0),this.setItemSize(b,u)}}}},g.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+"_container"),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+"_container");if(d){var b=d.getAttribute("data-medium-width"),h=b?parseInt(b,10):null;if(h&&o.offsetWidth>h){d.removeAttribute("data-medium-width");var m=d.querySelector("#"+u.id);u.setProperties({activeSize:e.RibbonItemSize.Medium},!0),this.setItemSize(m,u)}}}}},g.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+"_container"),u=l.collections.length;u>=1&&o.offsetWidth<i.offsetWidth;u--)for(var d=l.collections[parseInt((u-1).toString(),10)],b=p.querySelector("#"+d.id),h=d.items.length;h>=1&&o.offsetWidth<i.offsetWidth;h--){var m=d.items[h-1],f=b.querySelector("#"+m.id+"_container");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 w=0;w<I.length;w++)I[parseInt(w.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 T=f.querySelector("#"+m.id);m.setProperties({activeSize:e.RibbonItemSize.Medium},!0),this.setItemSize(T,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("."+Me)||p.classList.add("e-ribbon-emptyCollection");var k=p.querySelectorAll("."+Me);k&&!l.enableGroupOverflow&&this.checkEmptyCollection(k)&&p.classList.add("e-ribbon-emptyCollection"),this.checkOverflowHiddenItems(l.enableGroupOverflow,r,l.id)}},g.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},g.prototype.updatePopupItems=function(o,i,n,s){var a=this,l=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),p=l.dropDown,c=(n&&s)===this.enableRtl;p&&(p.setProperties({position:{X:c?"left":"right",Y:s?"top":"bottom"}},!0),s?l.beforeOpen=function(t){c&&(o.type===e.RibbonItemType.Gallery&&a.ribbonGalleryModule&&a.ribbonGalleryModule.checkCollision(p,p.element),p.element.style.setProperty("visibility","hidden"),p.element.style.setProperty("display","block"),p.setProperties({offsetX:-1*p.element.offsetWidth}),p.element.style.removeProperty("display"),p.element.style.removeProperty("visibility")),o.splitButtonSettings.beforeOpen&&o.splitButtonSettings.beforeOpen.call(a,t),o.dropDownSettings.beforeOpen&&o.dropDownSettings.beforeOpen.call(a,t)}:(p.setProperties({offsetX:0},!0),l.beforeOpen=null))},g.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 b=o.querySelector("#"+c.id+Fe);b&&(d=(u=t.getInstance(b,r.DropDownButton)).target)}else u=this.overflowDDB,d=this.overflowDDB?this.overflowDDB.target:null;for(var h=0;h<c.collections.length&&l;h++)for(var m=c.collections[parseInt(h.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+"_container")),(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,w=0;g.classList.contains("e-hidden")&&(g.classList.remove("e-hidden"),S.classList.contains("e-hide-group")&&(C=!0,w=this.checkWidthDifference(g,S)),v=g.offsetWidth+w,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 T=o.querySelector("#"+c.id),k=T.querySelector("."+Me);if(T.classList.contains("e-ribbon-emptyCollection")&&null!==k){var O=T.querySelectorAll("."+Me);O&&(this.checkEmptyCollection(O)||T.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+"_container");B&&1===B.childElementCount&&B.remove();var L=d.querySelector("#"+this.tabs[parseInt(n.toString(),10)].id+"_overflow");L&&0===L.childElementCount&&(L.remove(),this.overflowDDB.element.classList.add(xe))}}for(p=0;p<a.length;p++)this.checkOverflowHiddenItems(a[parseInt(p.toString(),10)].enableGroupOverflow,n,a[parseInt(p.toString(),10)].id);this.overflowDDB&&0===this.overflowDDB.target.childElementCount&&(this.removeOverflowButton(this.overflowDDB),this.overflowDDB=null)},g.prototype.checkOverflowHiddenItems=function(e,o,i){if(e){var n=document.querySelector("#"+i+Fe);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+"_overflow");if(d){for(var b=0;b<d.children.length;b++){u=!0;for(var h=d.children[parseInt(b.toString(),10)],m=h.querySelectorAll(".e-ribbon-item"),f=0;f<m.length;f++)if(!m[parseInt(f.toString(),10)].classList.contains("e-hidden")){u=!1;break}h.classList[u?"add":"remove"]("e-hide-group"),h.classList.contains("e-hide-group")||h.classList.contains("e-hidden")||(c=!1)}this.overflowDDB.element.classList[c?"add":"remove"](xe)}}},g.prototype.createOverflowPopup=function(e,o,i,n,s,a,l,p){var c,u,b=d(this.tabs,n),h=this.tabObj.items[parseInt(o.toString(),10)].content.querySelector("#"+n);if(i){var m=l.querySelector("#"+n+Fe);m?c=t.getInstance(m,r.DropDownButton):((c=this.addOverflowButton(n+Fe,i)).element.classList.add("e-ribbon-group-of-btn"),l.appendChild(c.element)),this.addKeyTip(o,"0"+(b.groupIndex+1),c.element.id,"grpofbtn"),u=c.target;var f=c.target;if(!f.querySelector("#"+n+Fe+"_header")&&b.group.overflowHeader){var y=this.createElement("div",{className:"e-ribbon-overflow-header",id:n+Fe+"_header",innerHTML:b.group.overflowHeader});f.append(y)}h&&(h.classList.contains("e-disabled")&&f.classList.add("e-disabled"),h.classList.contains("e-hidden")&&f.classList.add("e-hidden"),h.classList.contains("e-hide-group")&&f.classList.add("e-hide-group")),p?f.insertBefore(a,f.querySelector("."+Me)):f.append(a)}else{if(this.overflowDDB){this.overflowDDB.element.classList.remove(xe);var g=this.overflowDDB.target,v=g.querySelector("#"+this.tabs[parseInt(o.toString(),10)].id+"_overflow");if(v){var S=g.querySelector("#"+n+"_container");S||(S=b.group.overflowHeader?this.createGroupContainer(n,b.group.overflowHeader):this.createGroupContainer(n,s),h&&(h.classList.contains("e-disabled")&&S.classList.add("e-disabled"),h.classList.contains("e-hidden")&&S.classList.add("e-hidden"),h.classList.contains("e-hide-group")&&S.classList.add("e-hide-group")),v.append(S)),p?S.insertBefore(a,S.querySelector("."+Me)):S.append(a)}else this.createOfTabContainer(n,s,a,o)}else this.overflowDDB=this.addOverflowButton(this.tabObj.element.id+"_sim_ovrl_overflow",i),this.tabObj.element.insertBefore(this.overflowDDB.element,this.collapseButton),this.overflowDDB.element.classList.add("e-ribbon-overall-of-btn"),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")},g.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);break;case"GroupButton":this.ribbonGroupButtonModule.addOverFlowEvents(e,t,o)}},g.prototype.createOfTabContainer=function(e,t,o,i){var r=this.createElement("div",{id:this.tabs[parseInt(i.toString(),10)].id+"_overflow",className:"e-ribbon-of-tab"});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("e-ribbon-active");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"))},g.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},g.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},g.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)},g.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))},g.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 "+qe,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+"_container"),c=s?n.querySelector("#"+l.id+"_shrink_container"+o):u(l.id,p,o,r),d=o;d<=r;d++){var b=l.items[parseInt(d.toString(),10)];if(b.displayOptions&e.DisplayMode.Classic){var h=n.querySelector("#"+b.id+"_container");c.appendChild(h),b.setProperties({activeSize:e.RibbonItemSize.Medium},!0),b.type===e.RibbonItemType.GroupButton&&"Classic"===a.activeLayout?a.setItemSize(h.querySelector("#"+b.id+"_grpbtn"),b):a.setItemSize(h.querySelector("#"+b.id),b)}}},b=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 b=l.collections[parseInt(d.toString(),10)],h=n.querySelector("#"+b.id);c.appendChild(h),b.items[0].setProperties({activeSize:e.RibbonItemSize.Medium},!0),b.items[0].type===e.RibbonItemType.GroupButton&&"Classic"===a.activeLayout?a.setItemSize(h.querySelector("#"+b.items[0].id+"_grpbtn"),b.items[0]):a.setItemSize(h.querySelector("#"+b.items[0].id),b.items[0])}};if(l.orientation===e.ItemOrientation.Column){for(m=l.collections.length-1;m>0;m--)if((f=(m=this.checkClassicCollection(l.collections,m,!1))-1)>=0&&p(l.collections[parseInt(m.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)])?b(y,m):b(f,m),m=y,!s&&r.offsetWidth>n.offsetWidth)return!0}else m=f}else if(this.checkValidCollectionLength(l.collections))for(var h=l.collections[0],m=h.items.length-1;m>0;m--){var f=(m=this.checkClassicItem(h.items,m,!1))-1;if(f>=0&&c(h.items[parseInt(m.toString(),10)]))if((f=this.checkClassicItem(h.items,f,!1))>=0&&c(h.items[parseInt(f.toString(),10)])){var y=f-1;if(y>=0&&(y=this.checkClassicItem(h.items,y,!1)),y>=0&&c(h.items[parseInt(y.toString(),10)])?d(y,m):d(f,m),m=y,!s&&r.offsetWidth>n.offsetWidth)return!0}else m=f}return!1},g.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)},b=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+"_grpbtn")),a.setItemSize(i,o.items[0])}};d(r),p&&d(p),d(l)},h=function(e){s||n.querySelector("#"+e).setAttribute("data-medium-width",n.offsetWidth.toString())};if(p===e.ItemOrientation.Column){if(c.length>0)for(C=c.length-1;C>=0;C--){var m=parseInt(c[parseInt(C.toString(),10)].getAttribute("data-start"),10),f=parseInt(c[parseInt(C.toString(),10)].getAttribute("data-end"),10),y=this.checkClassicCollection(l.collections,m+1,!1);if(u(l.collections[parseInt(m.toString(),10)].items[0])&&u(l.collections[parseInt(y.toString(),10)].items[0])&&(f===y?b(C,m,f):u(l.collections[parseInt(f.toString(),10)].items[0])&&b(C,m,f,y),!s&&r.offsetWidth>n.offsetWidth))return!0}for(C=l.collections.length-1;C>=0;C--){for(var g=l.collections[parseInt(C.toString(),10)],v=[],S=0;S<g.items.length;S++)g.items[parseInt(S.toString(),10)].displayOptions&e.DisplayMode.Classic&&v.push(S);if(v.length>1&&u(g.items[v[0]])&&u(g.items[v[1]])&&(2===v.length?(h(g.id),d(C,v[0],v[1])):u(g.items[v[2]])&&(h(g.id),d(C,v[0],v[2],v[1])),!s&&r.offsetWidth>n.offsetWidth))return!0}}else if(this.checkValidCollectionLength(l.collections)){if(c.length>0)for(C=c.length-1;C>=0;C--){var I=c[parseInt(C.toString(),10)],m=parseInt(I.getAttribute("data-start"),10),f=parseInt(I.getAttribute("data-end"),10),g=l.collections[0],y=this.checkClassicItem(g.items,m+1,!1);if(u(l.collections[0].items[parseInt(m.toString(),10)])&&u(l.collections[0].items[parseInt(y.toString(),10)])&&(f===y?(h(I.id),d(0,m,f)):u(l.collections[0].items[parseInt(f.toString(),10)])&&(h(I.id),d(0,m,f,y)),!s&&r.offsetWidth>n.offsetWidth))return!0}}else for(var C=l.collections.length-1;C>=0;C--)for(y=(g=l.collections[parseInt(C.toString(),10)]).items.length-1;y>=0;y--)if(!((y=this.checkClassicItem(g.items,y,!1))<0)){var w=g.items[parseInt(y.toString(),10)];if(u(w)&&(h(w.type!==e.RibbonItemType.GroupButton?w.id:w.id+"_grpbtn"),d(C,y,y),!s&&r.offsetWidth>n.offsetWidth))return!0}return!1},g.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},g.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(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+"_grpbtn")),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+"_grpbtn")),l.setItemSize(a,r[parseInt(o.toString(),10)].items[0])}};if(c===e.ItemOrientation.Row){if(!this.checkValidCollectionLength(p.collections))for(I=0;I<p.collections.length;I++)for(var h=p.collections[parseInt(I.toString(),10)],m=0;m<h.items.length;m++)if((m=this.checkClassicItem(h.items,m,!0))!==h.items.length){var f=h.items[parseInt(m.toString(),10)];if(function(t){return t.allowedSizes&e.RibbonItemSize.Medium&&t.activeSize===e.RibbonItemSize.Small}(f)){var y=n.querySelector("#"+f.id);if("GroupButton"===f.type&&(y=n.querySelector("#"+f.id+"_grpbtn")),(g=(w=y.getAttribute("data-medium-width"))?parseInt(w,10):null)&&(s||r.offsetWidth>g))d(I,m,y),s&&!a||y.removeAttribute("data-medium-width");else if(g)return!0}}}else for(I=0;I<p.collections.length;I++)if(p.collections[parseInt(I.toString(),10)].items.length>1){for(var h=p.collections[parseInt(I.toString(),10)],g=(w=(y=n.querySelector("#"+h.id)).getAttribute("data-medium-width"))?parseInt(w,10):null,v=[],S=0;S<h.items.length;S++)h.items[parseInt(S.toString(),10)].displayOptions&e.DisplayMode.Classic&&v.push(S);if(v.length>1&&g&&(s||r.offsetWidth>g))d(I,v[0],y),d(I,v[1],y),3===v.length&&d(I,v[2],y),s&&!a||y.removeAttribute("data-medium-width");else if(g)return!0}if(u.length>0)for(var I=0;I<u.length;I++){var C=u[parseInt(I.toString(),10)],w=C.getAttribute("data-medium-width");if((g=w?parseInt(w,10):null)&&(s||r.offsetWidth>g)){var T=parseInt(C.getAttribute("data-start"),10),k=parseInt(C.getAttribute("data-end"),10);if(c===e.ItemOrientation.Row){var h=p.collections[0],m=this.checkClassicItem(h.items,T+1,!0);d(0,T,C),d(0,m,C),m!==k&&d(0,k,C)}else{var O=this.checkClassicCollection(p.collections,T+1,!0);b(T),b(O),O!==k&&b(k)}s&&!a||C.removeAttribute("data-medium-width")}else if(g)return!0}return!1},g.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 b=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+"_container"),r=i.querySelector("#"+o.id);o.setProperties({activeSize:e.RibbonItemSize.Large},!0),o.type===e.RibbonItemType.GroupButton&&(r=i.querySelector("#"+o.id+"_grpbtn")),p.setItemSize(r,o),s.insertAdjacentElement("beforebegin",i)}};d(i),c&&d(c),d(n),a&&!l||t.remove(s)},h=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+"_grpbtn")),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?b(v,S,f):b(v,S,f,C)}else{var w=this.checkClassicCollection(c.collections,v+1,!0);w===S?h(v,S,f):h(v,S,f,w)}a&&!l||f.removeAttribute("data-large-width")}else if(g)return!0}return!1},g.prototype.handleContentSize=function(e,t){var o=e.closest(".e-ribbon-group-content");t?o.classList.add("e-ribbon-content-height"):o.classList.remove("e-ribbon-content-height")},g.prototype.setItemSize=function(o,i){if(o){var r=o.closest("."+Me);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("e-ribbon-content-height","e-ribbon-large-item","e-ribbon-medium-item","e-ribbon-small-item"),i.activeSize===e.RibbonItemSize.Large?r.classList.add("e-ribbon-large-item","e-ribbon-content-height"):r.classList.add(i.activeSize===e.RibbonItemSize.Medium?"e-ribbon-medium-item":"e-ribbon-small-item")}},g.prototype.createOverflowDropdown=function(o,i,n){var s=this.getGroupResizeOrder(!0,o);if(0!==s.length)for(var a=this,p=0;p<s.length&&i.offsetWidth<n.offsetWidth;p++)!function(p){var c=s[parseInt(p.toString(),10)],u=a.tabObj.element.querySelector("#"+c.id);u.setAttribute("data-expanded-width",n.offsetWidth.toString());var d=u.querySelector("#"+c.id+"_container"),b=a.createElement("div",{className:"e-ribbon-group-overflow e-ribbon-large-item",id:c.id+"_overflow_container"});u.insertBefore(b,d);var h=l(a.tabs[parseInt(o.toString(),10)].groups,function(e){return e.id===c.id}),m=a.tabs[parseInt(o.toString(),10)];a.checkSmallToMedium(o,m,h,i,n,!0,!1),a.checkMediumToLarge(o,m,h,i,n,!0,!1);var f=a.ribbonDropDownModule.createOverFlowDropDown(c.id,c.header,c.groupIconCss,d,b,a.enableRtl);if(c.keyTip){w=c.id+"_overflow_dropdown";a.addKeyTip(o,c.keyTip,w,"grpoverflow")}a.tabs[parseInt(o.toString(),10)].groups[parseInt(h.toString(),10)].setProperties({isCollapsed:!0},!0);for(var y=0;y<c.collections.length;y++)for(var g=c.collections[parseInt(y.toString(),10)],v=d.querySelector("#"+g.id),S=0;S<g.items.length;S++){var I=g.items[parseInt(S.toString(),10)],C=v.querySelector("#"+I.id+"_container");null!==C&&(a.handleContentSize(C),a.addOverflowEvents(I,C,f));var w=document.querySelector("#"+c.id+"_overflow_dropdown"),T=t.getInstance(w,r.DropDownButton);if(T&&T.target&&a.keyTipElements[parseInt(o.toString(),10)]){if(I.type===e.RibbonItemType.GroupButton)for(var k=0;k<I.groupButtonSettings.items.length;k++)I.groupButtonSettings.items[parseInt(k.toString(),10)].keyTip&&a.addKeyTip(o,I.groupButtonSettings.items[parseInt(k.toString(),10)].keyTip,I.id+"_grpbtn"+k,"grpoverflowpopup");I.keyTip&&a.addKeyTip(o,I.keyTip,I.id,"grpoverflowpopup")}}}(p)},g.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=this,s=0;s<r.length;s++){var a=function(s){var a=r[parseInt(s.toString(),10)],p=n.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};n.removeDropdown(a.id);var u=l(n.tabs[parseInt(i.toString(),10)].groups,function(e){return e.id===a.id});n.tabs[parseInt(i.toString(),10)].groups[parseInt(u.toString(),10)].setProperties({isCollapsed:!1},!0);var d=n.tabs[parseInt(i.toString(),10)];n.checkLargeToMedium(i,d,u,e,t,!0),n.checkMediumToSmall(i,d,u,e,t,!0);for(var b=0;b<a.collections.length;b++)for(var h=a.collections[parseInt(b.toString(),10)],m=p.querySelector("#"+h.id),f=0;f<h.items.length;f++){var y=h.items[parseInt(f.toString(),10)],g=m.querySelector("#"+y.id+"_container");null!==g&&(n.handleContentSize(g,!0),n.removeOverflowEvent(y,g))}}(s);if("object"==typeof a)return a.value;if("break"===a)break}return!1},g.prototype.removeDropdown=function(e){var o=this.tabObj.element.querySelector("#"+e+"_overflow_dropdown");if(o){var i=o.parentElement;this.ribbonDropDownModule.removeOverFlowDropDown(o),t.remove(i)}},g.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},g.prototype.destroyScroll=function(){this.scrollModule&&(this.scrollModule.destroy(),this.scrollModule=null)},g.prototype.clearOverflowDropDown=function(e){var t=this.tabObj.element.querySelector("#"+this.tabs[parseInt(e.toString(),10)].id+"_content");if(t){var o=t.closest(".e-content");"Simplified"===this.activeLayout?this.removeSimplfiedOverflow(t,o,e,!0):this.removeOverflowDropdown(t,o,!0,e)}},g.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},g.prototype.ribbonTabSelecting=function(e){var o=this;this.currentControlIndex=0;var i=e.selectingItem?e.selectingItem.getAttribute("data-id"):null,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(".e-ribbon-group")&&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)}}})},g.prototype.createTabItems=function(e){for(var t=this,o=[],i=this,r=0;r<e.length;r++)!function(r){var n=e[parseInt(r.toString(),10)],s=i.createElement("span",{innerHTML:n.header,id:n.id+"_header"}),a=l(i.tabs,function(e){return e.id===n.id});n.keyTip&&(i.keyTipElements[parseInt(a.toString(),10)]||(i.keyTipElements[parseInt(a.toString(),10)]={}),i.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=i.createElement("div",{className:p.cssClass,id:n.id+"_content"});c.classList.add("e-ribbon-tab-item"),p.content=c,o.push(p)}(r);return o},g.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("e-ribbon-simplified-mode");var r=this.tabObj.element.querySelector("#"+this.tabs[this.selectedTab].id+"_content");this.ribbonGalleryModule&&this.ribbonGalleryModule.checkAvailableHeight(r),this.checkOverflow(this.selectedTab,r)},g.prototype.addOverflowButton=function(e,o){var i=this,n=this.createElement("button",{id:e}),s=this.createElement("div",{className:"e-ribbon-overflow-target",attrs:{tabindex:"0"}}),a=this.cssClass?" "+this.cssClass:"",l=new r.DropDownButton({iconCss:"e-icons e-more-horizontal-1",cssClass:"e-caret-hide e-ribbon-group-overflow-ddb"+a,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,"."+Re):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.element=null,e.cancel=!0)})}},n);this.element.classList.add("e-ribbon-overflow"),v(s,this),o||(this.keyTipElements.overflowbtn=[],this.keyTipElements.overflowbtn.push({id:e,type:"overflowbtn",keyTip:"00"}));var p;return n.onkeydown=n.onclick=function(){i.itemIndex=-1,p=!n.classList.contains("e-ribbon-overall-of-btn")},s.onkeydown=function(e){return i.upDownKeyHandler(e,s,p),i},l},g.prototype.upDownKeyHandler=function(e,o,i){var r,s,a,l=(r=i?o.getElementsByClassName("e-ribbon-item"):o.querySelector(".e-ribbon-of-tab.e-ribbon-active").getElementsByClassName("e-ribbon-item"))[!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)!this.itemIndex&&0!==this.itemIndex||this.itemIndex<0||this.itemIndex===r.length-1?(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")):this.itemIndex<r.length-1&&this.itemIndex>=0&&(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&&(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=r[this.itemIndex].querySelector(".e-control");c&&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="",b=r[parseInt(u.toString(),10)]?r[parseInt(u.toString(),10)].querySelector(".e-control"):null;if(b&&(d=b.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 h=r[parseInt(u.toString(),10)].querySelector(".e-control");h&&h.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)},g.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")},g.prototype.removeOverflowButton=function(e){if(e){var t=e.element;S(e.target),e.destroy(),t.remove()}},g.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)}},g.prototype.createGroupContainer=function(e,t){var o=this.createElement("div",{className:"e-ribbon-of-group-container",id:e+"_container"}),i=this.createElement("div",{className:"e-ribbon-overflow-header",id:e+"_header",innerHTML:t});return o.append(i),o},g.prototype.addExpandCollapse=function(){var e=this;this.collapseButton=this.createElement("span",{className:"e-ribbon-collapse-btn e-icons e-drop-icon",id:this.tabObj.element.id+"_collapsebutton",attrs:{tabindex:"0",type:"button","aria-label":"Layout Switcher",role:"button"}}),this.collapseButton.onclick=function(t){e.toggleLayout(t)},this.collapseButton.onkeydown=function(t){"Enter"===t.key&&e.toggleLayout(t)},this.element.classList.add("e-ribbon-collapsible"),"Simplified"===this.activeLayout&&this.collapseButton.classList.add("e-ribbon-expand-btn"),this.tabObj.element.appendChild(this.collapseButton),this.layoutSwitcherKeyTip&&(this.keyTipElements.collapse=[],this.keyTipElements.collapse.push({id:this.collapseButton.id,type:"collapse",keyTip:this.layoutSwitcherKeyTip}))},g.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("e-ribbon-collapsible"),t.remove(this.tabObj.element.querySelector(".e-ribbon-collapse-btn")),this.collapseButton=null},g.prototype.reRenderTabs=function(e){this.destroyScroll(),this.checkID(this.tabs,"tab",this.element.id);for(var o=0,i=Object.keys(e);o<i.length;o++){for(var r=i[o],n=parseInt(r,10),s=e[parseInt(n.toString(),10)],a=!1,l=0;l<this.tabObj.items.length;l++)if(this.tabs[parseInt(n.toString(),10)].id===this.tabObj.items[parseInt(l.toString(),10)].id){a=!0;break}if(!a){this.destroyTabItems(this.tabsInternal),this.tabsInternal=this.tabs.slice(),this.validateItemSize();T=this.createTabItems(this.tabs);this.selectedTab>=this.tabs.length&&(this.selectedTab=this.tabs.length-1),this.tabObj.setProperties({items:T,selectedItem:this.selectedTab});break}var p=this.tabs[parseInt(n.toString(),10)].groups,c=this.tabObj.element,u=this.tabs[parseInt(n.toString(),10)];u.setProperties(s,!0),this.setProperties({groups:this.checkID(u.groups,"group",u.id)},!0),this.validateItemSize();var d=this.tabObj.items[parseInt(n.toString(),10)].content;if(p&&(s.header&&(this.tabObj.items[parseInt(n.toString(),10)].header.text.innerText=u.header),s.cssClass&&(this.tabObj.items[parseInt(n.toString(),10)].cssClass&&(d.classList.remove(this.tabObj.items[parseInt(n.toString(),10)].cssClass),c.querySelector(".e-active").classList.remove(this.tabObj.items[parseInt(n.toString(),10)].cssClass)),d.classList.add(u.cssClass),c.querySelector(".e-active").classList.add(u.cssClass)),s.groups)){for(var b=0,h=p;b<h.length;b++){for(var m=h[b],f=m.isCollapsed?d.querySelector("#"+m.id+"_overflow_dropdown"):null,y=0,g=m.collections;y<g.length;y++)for(var v=0,S=g[y].items;v<S.length;v++){var I=S[v],C=f?this.ribbonDropDownModule.getDDBItemElement(f,I.id):d.querySelector("#"+I.id);C&&this.destroyFunction(I,C)}f&&this.ribbonDropDownModule.removeOverFlowDropDown(f)}d.querySelectorAll(".e-ribbon-group").forEach(function(e){e.remove()});var w=this.createGroups(u.groups,n);t.append(w,d)}}if(this.tabsInternal!==this.tabs){this.tabsInternal=this.tabs;var T=this.createTabItems(this.tabs);this.selectedTab>=this.tabs.length&&(this.selectedTab=this.tabs.length-1),this.tabObj.setProperties({items:T,selectedItem:this.selectedTab})}var k=this.tabObj.element.querySelector("#"+this.tabs[this.selectedTab].id+"_content");this.checkOverflow(this.selectedTab,k)},g.prototype.switchLayout=function(){this.currentControlIndex=0,this.destroyScroll(),this.collapseButton.classList.toggle("e-ribbon-expand-btn","Simplified"===this.activeLayout),this.element.classList.toggle("e-ribbon-simplified-mode","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+"_content"),l=a.closest(".e-content");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),b=(C=d.querySelector("#"+c.id+"_container")).querySelectorAll(".e-ribbon-shrink"),h=0;h<b.length;h++)b[parseInt(h.toString(),10)].remove();(T=C.querySelector("#"+c.id+"_header")).remove(),(w=C.querySelector("#"+c.id+"_content")).classList.replace(qe,"e-ribbon-column"),w.classList.remove("e-ribbon-content-height");for(k=0;k<c.collections.length;k++){P=c.collections[parseInt(k.toString(),10)];(_=C.querySelector("#"+P.id)).classList.replace(qe,"e-ribbon-column");for(E=0;E<P.items.length;E++){for(var m=P.items,f=P.items[parseInt(E.toString(),10)],y=!0;y&&f.displayOptions===e.DisplayMode.Classic;){E++;var g=C.querySelector("#"+f.id+"_container"),v=g.querySelector("#"+f.id);this.destroyFunction(f,v),g.remove(),E<m.length?f=m[parseInt(E.toString(),10)]:y=!1}if(!y)break;var S=f.allowedSizes===e.RibbonItemSize.Large||f.allowedSizes&e.RibbonItemSize.Medium?e.RibbonItemSize.Medium:e.RibbonItemSize.Small;S=!(f.displayOptions&e.DisplayMode.Simplified)&&f.displayOptions&e.DisplayMode.Overflow?e.RibbonItemSize.Medium:S;R=void 0;if(f.displayOptions&e.DisplayMode.Classic){if(R=C.querySelector("#"+f.id+"_container"),f.displayOptions===(e.DisplayMode.Classic|e.DisplayMode.Overflow)&&(this.createOverflowPopup(f,i,c.enableGroupOverflow,c.id,c.header,R,C),f.type!==e.RibbonItemType.DropDown&&f.type!==e.RibbonItemType.SplitButton&&f.type!==e.RibbonItemType.GroupButton&&f.type!==e.RibbonItemType.Gallery||this.updatePopupItems(f,R,c.enableGroupOverflow,!0)),f.type===e.RibbonItemType.GroupButton&&this.ribbonGroupButtonModule.switchGroupButton(f,R),f.setProperties({activeSize:S},!0),R){v=R.querySelector("#"+f.id);this.setItemSize(v,f)}}else R=this.createItems([f],u,c.id,c.header,c.enableGroupOverflow,i,C)[0],f.displayOptions&e.DisplayMode.Simplified&&_.append(R);f.type===e.RibbonItemType.Gallery&&this.ribbonGalleryModule.switchGalleryItems(this.activeLayout,f.id)}}c.enableGroupOverflow||d.querySelector("."+Me)||d.classList.add("e-ribbon-emptyCollection")}else{this.element.classList.remove("e-ribbon-overflow");for(var I=0;I<s.length;I++){var c=s[parseInt(I.toString(),10)],u=s[parseInt(I.toString(),10)].orientation,C=l.querySelector("#"+c.id+"_container"),w=C.querySelector("#"+c.id+"_content"),T=this.createElement("div",{className:"e-ribbon-group-header",id:c.id+"_header",innerHTML:c.header});C.appendChild(T),"Row"===u&&w.classList.replace("e-ribbon-column",qe),w.classList.add("e-ribbon-content-height");for(var k=0;k<c.collections.length;k++){var O=void 0,B=void 0;if(c.enableGroupOverflow){var L=C.querySelector("#"+c.id+Fe);L&&(B=(O=t.getInstance(L,r.DropDownButton)).target)}else(O=this.overflowDDB)&&(B=this.overflowDDB.target);var P=c.collections[parseInt(k.toString(),10)],_=C.querySelector("#"+P.id);"Column"===u&&_.classList.replace("e-ribbon-column",qe);for(var E=0;E<P.items.length;E++){for(var m=P.items,f=P.items[parseInt(E.toString(),10)],y=!0;y&&!(f.displayOptions&e.DisplayMode.Classic);){E++;R=void 0;if((f.displayOptions&e.DisplayMode.Simplified||f.displayOptions&e.DisplayMode.Overflow)&&null!==(R=f.displayOptions&e.DisplayMode.Simplified?C.querySelector("#"+f.id+"_container"):B.querySelector("#"+f.id+"_container"))){var D=R.querySelector("#"+f.id);this.destroyFunction(f,D),R.remove()}E<m.length?f=m[parseInt(E.toString(),10)]:y=!1}if(!y)break;if(f.displayOptions&(e.DisplayMode.Simplified|e.DisplayMode.Overflow))!(R=C.querySelector("#"+f.id+"_container"))&&B&&(R=B.querySelector("#"+f.id+"_container"),f.type!==e.RibbonItemType.DropDown&&f.type!==e.RibbonItemType.SplitButton&&f.type!==e.RibbonItemType.GroupButton&&f.type!==e.RibbonItemType.Gallery||this.updatePopupItems(f,R,c.enableGroupOverflow,!1),this.removeOverflowEvent(f,R)),f.type===e.RibbonItemType.GroupButton&&this.ribbonGroupButtonModule.switchGroupButton(f,R),R&&_.append(R);else{var R=this.createItems([f],u,c.id,c.header,c.enableGroupOverflow,i)[0];_.append(R)}v=C.querySelector("#"+f.id);f.type===e.RibbonItemType.GroupButton&&(v=C.querySelector("#"+f.id+"_grpbtn"));var x=f.allowedSizes&e.RibbonItemSize.Large?e.RibbonItemSize.Large:f.allowedSizes&e.RibbonItemSize.Medium?e.RibbonItemSize.Medium:e.RibbonItemSize.Small;f.setProperties({activeSize:x},!0),this.setItemSize(v,f),f.type===e.RibbonItemType.Gallery&&this.ribbonGalleryModule.switchGalleryItems(this.activeLayout,f.id)}c.enableGroupOverflow&&O&&(0===B.childElementCount||1===B.childElementCount&&this.isHeaderVisible(B,c.id))&&this.removeOverflowButton(O)}}}this.selectedTab===i&&this.checkOverflow(i,a)}}"Classic"===this.activeLayout&&(this.removeOverflowButton(this.overflowDDB),this.overflowDDB=null)},g.prototype.createLauncherIcon=function(e,o,i){var r=this,n=this.createElement("div",{className:"e-ribbon-launcher-icon "+(this.launcherIconCss?this.launcherIconCss:"e-icons e-launcher"),id:e+"_launcher",attrs:{tabindex:"0",type:"button","aria-label":"Launcher Icon",role:"button"}});o.appendChild(n),o.classList.add("e-ribbon-launcher"),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")},g.prototype.launcherIconClicked=function(e){var t={groupId:e};this.trigger("launcherIconClick",t)},g.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("e-ribbon-group"),i.push(a);var l=this.createElement("div",{className:n.cssClass,id:n.id+"_container"});l.classList.add("e-ribbon-group-container"),a.appendChild(l);var p=this.createElement("div",{className:"Simplified"===this.activeLayout?"e-ribbon-group-content":"e-ribbon-group-content e-ribbon-content-height",id:n.id+"_content"});if(p.classList.add("Column"===s||"Simplified"===this.activeLayout?"e-ribbon-column":qe),l.appendChild(p),"Classic"===this.activeLayout){var c=this.createElement("div",{className:"e-ribbon-group-header",id:n.id+"_header",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,b=0;b<u.length;b++)if(d)for(var h=0;h<u[parseInt(b.toString(),10)].children.length;h++)if(!u[parseInt(b.toString(),10)].children[parseInt(h.toString(),10)].classList.contains("e-hidden")){d=!1;break}d&&a.classList.add("e-hide-group"),"Simplified"!==this.activeLayout||n.enableGroupOverflow||a.querySelector("."+Me)||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},g.prototype.updateGroupProps=function(e,t,o){-1!==t[e].indexOf(o.id)&&("hiddenGroups"===e?o.classList.add("e-hidden"):o.classList.add("e-disabled"))},g.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)}},g.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("e-ribbon-collection"),u.classList.add("Column"!==o||"Simplified"===this.activeLayout?"e-ribbon-column":qe),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},g.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)}},g.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 b=this.createElement("div",{className:u.cssClass,id:u.id+"_container"});if((l=b.classList).add.apply(l,[Me].concat(u.disabled?["e-disabled"]:[])),u.ribbonTooltipSettings&&y(u.ribbonTooltipSettings)&&(b.classList.add(je),this.tooltipData.push({id:b.id,data:u.ribbonTooltipSettings})),u.type===e.RibbonItemType.GroupButton)for(var h=0;h<u.groupButtonSettings.items.length;h++)this.keyTipElements[parseInt(s.toString(),10)]&&u.groupButtonSettings.items[parseInt(h.toString(),10)].keyTip&&this.addKeyTip(s,u.groupButtonSettings.items[parseInt(h.toString(),10)].keyTip,u.id+"_grpbtn"+h,"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?b.classList.add("e-ribbon-large-item","e-ribbon-content-height"):b.classList.add(m&e.RibbonItemSize.Medium?"e-ribbon-medium-item":"e-ribbon-small-item"));var f=this.initialPropsData[parseInt(s.toString(),10)];if(f&&f.hiddenItems&&f.hiddenItems.length&&-1!==f.hiddenItems.indexOf(u.id)&&b.classList.add("e-hidden"),this.createRibbonItem(u,b),"Simplified"!==this.activeLayout||u.displayOptions!==e.DisplayMode.Overflow&&u.displayOptions!==(e.DisplayMode.Classic|e.DisplayMode.Overflow)?p.push(b):(this.createOverflowPopup(u,s,n,i,r,b,a),u.type!==e.RibbonItemType.DropDown&&u.type!==e.RibbonItemType.SplitButton&&u.type!==e.RibbonItemType.GroupButton&&u.type!==e.RibbonItemType.Gallery||this.updatePopupItems(u,b,n,!0)),"Column"===o&&2===c)break}return p},g.prototype.createHelpPaneTemplate=function(){if(this.helpPaneTemplate){this.clearTemplate(["helpPaneTemplate"]),this.ribbonTempEle=this.createElement("div",{className:"e-ribbon-help-template",id:this.element.id+"_helppanetemplate"});var e=p(this.helpPaneTemplate);t.append(e({},this,"helpPaneTemplate","helpPaneTemplate",this.isStringTemplate),this.ribbonTempEle);var o=this.tabObj.element;o.querySelector(".e-toolbar").after(this.ribbonTempEle),o.style.setProperty("--helpTemplateWidth",this.ribbonTempEle.offsetWidth+"px"),this.renderReactTemplates()}},g.prototype.createTemplateContent=function(e,t){var o=this.createElement("div",{className:e.cssClass?"e-ribbon-template "+e.cssClass:"e-ribbon-template",id:e.id,attrs:{tabindex:"-1"}});e.disabled&&(o.classList.add("e-disabled"),o.setAttribute("disabled","")),t.appendChild(o),this.renderItemTemplate(e,o)},g.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()},g.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},g.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},g.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(".e-ribbon-group"))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+"_overflow_dropdown"):null:(u=(c=p.enableGroupOverflow?s.querySelector("#"+p.id+Fe):null)?t.getComponent(c,r.DropDownButton):this.overflowDDB)&&(I(u.target,o),u.setProperties(o));for(var d=0,b=p.collections;d<b.length;d++)for(var m=0,f=b[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+"_grpbtn"):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++)h(w=g.querySelector("#"+y.id+"_grpbtn"+S),"btn",o);else if("group-btn"===v&&"Simplified"===this.activeLayout){h(g,"dropdown-btn",o);for(var C=0;C<y.groupButtonSettings.items.length;C++){var w=document.querySelector("#"+y.id+"_grpbtn"+C);h(w,"btn",o)}}else h(g,v,o);else t.isNullOrUndefined(o.enableRtl)||g.classList.toggle("e-rtl",o.enableRtl)}}}}},g.prototype.removeLauncherIcon=function(e,o,i){var r=e+"_container",n=o?this.ribbonDropDownModule.getDDBItemElement(o,r):i.querySelector("#"+r);if(n){n.classList.remove("e-ribbon-launcher");var s=n.querySelector("#"+e+"_launcher");t.remove(s)}},g.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+"_overflow_dropdown"):null,p.showLauncherIcon&&this.removeLauncherIcon(p.id,c,s)):u=(c=p.enableGroupOverflow?s.querySelector("#"+p.id+Fe):null)?t.getComponent(c,r.DropDownButton):this.overflowDDB;for(var d=0,b=p.collections;d<b.length;d++)for(var h=0,m=b[d].items;h<m.length;h++){var f=m[h],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+"_grpbtn"):s.querySelector("#"+f.id+"_grpbtn")),f.type===e.RibbonItemType.Gallery&&(y=s.querySelector("#"+f.id+"_container"))):(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+"_container"):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)},g.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(n=0;n<e.groupButtonSettings.items.length;n++){var i=t.querySelector("#"+e.id+"_grpbtn"+n);i&&b(i,"btn")}else this.ribbonGroupButtonModule.destroyDropDown(e);for(var r=this,n=0;n<e.groupButtonSettings.items.length;n++)!function(t){if(e.groupButtonSettings.items[parseInt(t.toString(),10)].ribbonTooltipSettings){var o=e.id+"_grpbtn"+t,i=l(r.tooltipData,function(e){return e.id===o});-1!==i&&r.tooltipData.splice(i,1)}}(n)}else if("gallery"===o)if(t.closest(".e-ribbon-overflow-target")){b(t,"dropdown-btn"),(c=Array.prototype.slice.call(document.querySelectorAll("#"+e.id+"_galleryPopup"))).concat(Array.prototype.slice.call(document.querySelectorAll("#"+e.id+"-popup")));for(n=0;n<c.length;n++)c[parseInt(n.toString(),10)].remove();(p=document.querySelector("#"+e.id+"_popupButton"))&&p.remove();var s=document.querySelector("#"+e.id+"_galleryWrapper");s&&s.remove()}else{var a=t.querySelectorAll(".e-ribbon-gallery-item"),p=t.parentElement.querySelector("#"+e.id+"_popupButton");p&&p.remove();for(n=0;n<a.length;n++)a[parseInt(n.toString(),10)].remove();for(var c=document.querySelectorAll("#"+e.id+"_galleryPopup"),n=0;n<c.length;n++)c[parseInt(n.toString(),10)].remove()}else"template"!==o&&b(t,o);if(e.ribbonTooltipSettings){var u=l(this.tooltipData,function(t){return t.id===e.id+"_container"});-1!==u&&this.tooltipData.splice(u,1)}"GroupButton"===e.type&&this.ribbonGroupButtonModule.destroyDropDown(e)},g.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"}},g.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+"_content"),o=t.closest(".e-content"),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)},g.prototype.refreshLayout=function(){this.resizeHandler()},g.prototype.selectTab=function(e){var t=this.tabObj.getItemIndex(e);this.setProperties({selectedTab:t})},g.prototype.showTab=function(e,t){void 0===t&&(t=!1),this.showHideTab(e,!1,t)},g.prototype.hideTab=function(e,t){void 0===t&&(t=!1),this.showHideTab(e,!0,t)},g.prototype.showHideTab=function(e,t,o){var i=this.tabObj.getItemIndex(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){for(var p=!0,c=this,s=0;s<r.tabs.length;s++)!function(e){var t=l(c.tabs,function(t){return t.id===r.tabs[parseInt(e.toString(),10)].id});-1!==t&&(n.querySelectorAll(".e-toolbar-item")[parseInt(t.toString(),10)].classList.contains("e-hidden")||(p=!1))}(s);p?r.setProperties({visible:!1},!0):r.setProperties({visible:!0},!0)}}},g.prototype.enableTab=function(e){this.enableDisableTab(e,!0)},g.prototype.disableTab=function(e){this.enableDisableTab(e,!1)},g.prototype.enableDisableTab=function(e,t){var o=l(this.tabs,function(t){return t.id===e});if(-1!==o){var i=this.tabObj.items[parseInt(o.toString(),10)].content;this.tabObj.element.querySelector("#"+e+"_header").classList[t?"remove":"add"]("e-disabled"),i.classList[t?"remove":"add"]("e-disabled"),this.tabObj.enableTab(o,t)}},g.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)},g.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+"_overflow_dropdown"):null,c=0,u=a.collections;c<u.length;c++)for(var d=0,b=u[c].items;d<b.length;d++){var h=b[d],m=p?this.ribbonDropDownModule.getDDBItemElement(p,h.id):i.querySelector("#"+h.id);h.type===e.RibbonItemType.GroupButton&&"Classic"===this.activeLayout&&(m=p?this.ribbonDropDownModule.getDDBItemElement(p,h.id+"_grpbtn"):i.querySelector("#"+h.id+"_grpbtn")),m&&this.destroyFunction(h,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)}},g.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()}},g.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+Fe):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 b=u[c];this.removeItemElement(n,b,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 h=a.target.querySelector("#"+i.group.id+"_container");h&&1===h.childElementCount&&h.remove();var m=a.target.querySelector("#"+this.tabs[parseInt(i.tabIndex.toString(),10)].id+"_overflow");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()}},g.prototype.isHeaderVisible=function(e,t){return!!e.querySelector("#"+t+Fe+"_header")},g.prototype.hideGroup=function(e){this.showHideGroup(e,!0)},g.prototype.showGroup=function(e){this.showHideGroup(e,!1)},g.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+"_overflow");if(n.group.enableGroupOverflow){var p=s.querySelector("#"+e+Fe);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+"_container");c&&(o?c.classList.add("e-hidden"):c.classList.remove("e-hidden"))}}this.selectedTab===n.tabIndex&&this.refreshLayout()}},g.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))},g.prototype.checkHiddenElements=function(e,t,o){if("Simplified"===this.activeLayout){var i=this.hiddenElements[parseInt(o.toString(),10)];i||(this.hiddenElements[parseInt(o.toString(),10)]={},i=this.hiddenElements[parseInt(o.toString(),10)]),i&&(i[""+e]||(i[""+e]=[]),i[""+e].length?-1===i[""+e].indexOf(t)&&i[""+e].push(t):i[""+e].push(t))}},g.prototype.updateItemsSimplifiedWidth=function(e,t){var o=this.hiddenElements[parseInt(e.toString(),10)];if(o&&o[""+t]&&o[""+t].length)for(var i,r=this,n=0;n<o[""+t].length;n++)!function(n){var s,a=r.tabObj.items[parseInt(e.toString(),10)].content,l=void 0,p=!1,c=0;if(s="hideGroup"===t||"showGroup"===t?a.querySelector("#"+o[""+t][parseInt(n.toString(),10)]):a.querySelector("#"+o[""+t][parseInt(n.toString(),10)]+"_container")){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=r.checkWidthDifference(s,l)),r.calculateOverflowItemsWidth(s.offsetWidth+c,!0,e),r.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!==r.hiddenGroups.indexOf(l.id)&&r.hiddenGroups.splice(r.hiddenGroups.indexOf(l.id),1);else if(-1!==r.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")}),r.hiddenGroups.splice(r.hiddenGroups.indexOf(l.id),1)}r.calculateOverflowItemsWidth(s.offsetWidth+c,!1,e),r.calculateMediumDataWidth(s.offsetWidth+c,e,!1)}p&&(l.classList.add("e-hide-group"),l.classList.add("e-ribbon-emptyCollection"))}var b=o[""+t].indexOf(o[""+t][parseInt(n.toString(),10)]);-1!==b&&(o[""+t].splice(b,1),n--),i=n}(n),n=i},g.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},g.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)])}},g.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+"_content"),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+"_overflow"),p=0;p<a.length;p++){var c=a[parseInt(p.toString(),10)].closest("#"+this.tabs[parseInt(o.toString(),10)].id+"_overflow");l&&c&&l.id===c.id&&a[parseInt(p.toString(),10)].hasAttribute("data-medium-width")&&s.push(a[parseInt(p.toString(),10)])}for(var u=n.querySelectorAll(".e-ribbon-group-of-btn"),p=0;p<u.length;p++)for(var a=t.getInstance(u[parseInt(p.toString(),10)],r.DropDownButton).target.querySelectorAll(".e-ribbon-item"),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 b=parseInt(s[parseInt(p.toString(),10)].getAttribute("data-medium-width"),10);s[parseInt(p.toString(),10)].setAttribute("data-medium-width",i?(b-e).toString():(b+e).toString())}}},g.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+Fe);if(p&&(l=t.getInstance(p,r.DropDownButton)),l)for(var c=(b=l.target).querySelectorAll(".e-ribbon-item"),u=0;u<c.length;u++)(m=parseInt(c[parseInt(u.toString(),10)].getAttribute("data-simplified-width"),10))&&c[parseInt(u.toString(),10)].setAttribute("data-simplified-width",o?(m-e).toString():(m+e).toString())}}if(this.overflowDDB)for(var d=document.querySelector("#"+this.tabs[parseInt(i.toString(),10)].id+"_overflow"),b=this.overflowDDB.target,c=b.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+"_overflow");if(d&&h&&d.id===h.id){var m=parseInt(c[parseInt(s.toString(),10)].getAttribute("data-simplified-width"),10);m&&c[parseInt(s.toString(),10)].setAttribute("data-simplified-width",o?(m-e).toString():(m+e).toString())}}},g.prototype.disableGroup=function(e){this.enableDisableGroup(e,!0)},g.prototype.enableGroup=function(e){this.enableDisableGroup(e,!1)},g.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+"_overflow");if(n.group.enableGroupOverflow){var p=s.querySelector("#"+e+Fe);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+"_container");c&&(o?c.classList.add("e-disabled"):c.classList.remove("e-disabled"))}}}},g.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+"_content").append(c)}this.selectedTab===r.tabIndex&&this.refreshLayout()}},g.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+Fe):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 b=i.group,h=b.collections.slice();h.splice(i.collectionIndex,1),b.setProperties({collections:h},!0),this.selectedTab===i.tabIndex&&this.refreshLayout()}},g.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+"_container");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 b=o?a.querySelector("#"+o):null;b?b.closest("."+Me).insertAdjacentElement(i?"afterend":"beforebegin",d):d&&a.querySelector("#"+e).append(d)}this.selectedTab===r.tabIndex&&this.refreshLayout()}},g.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+Fe):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()}},g.prototype.hideItem=function(e){this.showHideItem(e,!0)},g.prototype.showItem=function(e){this.showHideItem(e,!1)},g.prototype.showHideItem=function(e,o){var i=c(this.tabs,e);if(i){var r;if(r="GroupButton"===i.item.type?f(this,e+"_grpbtn",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)}},g.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)])}},g.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 b=c(this.tabs,u.id);d=f(this,u.id+"_grpbtn",b)}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 h=s.querySelectorAll("."+Me);h&&(i=this.checkEmptyCollection(h),s.classList[i?"add":"remove"]("e-ribbon-emptyCollection"))}},g.prototype.checkOverflowItems=function(e,o,i,n,s){var a;if(i){var l=o.querySelector("#"+s+Fe);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+"_overflow");if(p){var c=p.querySelector("#"+s+"_container");c&&(e?c.classList.add("e-hide-group"):c.classList.remove("e-hide-group"))}}},g.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+"_overflow_dropdown"):null,b=0,h=u.collections;b<h.length;b++)for(var m=0,f=h[b].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+"_grpbtn"):n.querySelector("#"+y.id+"_grpbtn")),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+"_header").innerText=v.header)}}},g.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+"_container");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+Fe):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,b=n.group.collections;u<b.length;u++)for(var h=0,m=b[u].items;h<m.length;h++){var f=m[h];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+"_container");g&&1===g.childElementCount&&g.remove();var v=a.target.querySelector("#"+this.tabs[parseInt(n.tabIndex.toString(),10)].id+"_overflow");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=c.querySelector(".e-ribbon-group-content");I.classList.add("Column"===S.orientation||"Simplified"===this.activeLayout?"e-ribbon-column":qe);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 w=p.querySelector("#"+S.id+"_overflow_dropdown"),T=t.getInstance(w,r.DropDownButton).target.querySelector("#"+o.id+"_header");T&&(T.innerText=S.header)}}else p.querySelector(".e-ribbon-group-header").innerText=S.header;else(T=a.target.querySelector("#"+o.id+"_header"))&&(T.innerText=S.header)}}},g.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+Fe):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 b=d[c];this.removeItemElement(s,b,p)}}var h=n.collection;if(h.setProperties(o,!0),h.setProperties({items:this.checkID(h.items,"item",h.id)},!0),this.validateItemSize(),""!==s.innerHTML&&o.items){var m=s.querySelector("#"+n.group.id+"_container"),f=this.createItems(h.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(h.cssClass)}},g.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+"_container"),p=null,u=null,d=void 0,b=void 0;if(""!==s.innerHTML){if(this.activeLayout===e.RibbonLayout.Simplified&&(b=(d=n.group.enableGroupOverflow?s.querySelector("#"+n.group.id+Fe):null)?t.getComponent(d,r.DropDownButton):this.overflowDDB),this.activeLayout===e.RibbonLayout.Simplified&&n.item.displayOptions===e.DisplayMode.Overflow){if(p=b.target.querySelector("#"+i+"_container"),u=b.target.querySelector("#"+i),o.displayOptions&&o.displayOptions!==e.DisplayMode.Overflow){var h=l.querySelector("#"+n.collection.id);h&&h.appendChild(p)}}else p=l.querySelector("#"+i+"_container"),u=s.querySelector("#"+i),p||(p=b?b.target.querySelector("#"+i+"_container"):l.querySelector("#"+i+"_container")),u||(u=b?b.target.querySelector("#"+i):s.querySelector("#"+i)),"Gallery"===n.item.type&&(u||(u=s.querySelector("#"+i+"_galleryWrapper"))),"GroupButton"===n.item.type&&this.activeLayout===e.RibbonLayout.Classic&&(u=s.querySelector("#"+i+"_grpbtn")),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){f.ribbonTooltipSettings&&y(f.ribbonTooltipSettings)&&(p.classList.add(je),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("e-ribbon-large-item","e-ribbon-content-height"):g&e.RibbonItemSize.Medium?p.classList.add("e-ribbon-medium-item"):p.classList.add("e-ribbon-small-item"),this.createRibbonItem(f,p),"Gallery"===n.item.type&&document.querySelector("#"+i+"_container").closest(".e-ribbon-overflow-target")&&o.displayOptions!==e.DisplayMode.Overflow&&this.createOverflowPopup(n.item,n.tabIndex,n.group.enableGroupOverflow,n.group.id,n.group.header,p,l),"Simplified"===this.activeLayout&&n.group.enableGroupOverflow&&b&&(0===b.target.childElementCount||1===b.target.childElementCount&&this.isHeaderVisible(b.target,n.group.id))&&this.removeOverflowButton(b),this.selectedTab===n.tabIndex&&this.refreshLayout(),o.cssClass&&p.classList.add(f.cssClass),!f.disabled&&p.classList.contains("e-disabled")&&p.classList.remove("e-disabled"),this.enableDisableItem(f.id,f.disabled)}}else this.isUpdateItems=!0,this.itemsModel.push(o),this.targetTabs[o.id]=n.tabIndex}},g.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+"_grpbtn"):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+"_container").remove():r.closest("#"+o.id+"_container").remove())},g.prototype.enableItem=function(e){this.enableDisableItem(e,!1)},g.prototype.disableItem=function(e){this.enableDisableItem(e,!0)},g.prototype.getItem=function(e){return c(this.tabs,e).item},g.prototype.enableDisableItem=function(e,o){var i=!1,r=!1,n=c(this.tabs,e);if(n){n.item.setProperties({disabled:o},!0);var s;if("GroupButton"===n.item.type?s=f(this,e+"_grpbtn",n):"Gallery"===n.item.type?(s=document.querySelector("#"+e))?r=!0:s=document.querySelector("#"+e+"_galleryWrapper"):s=f(this,e,n),s){var a=t.closest(s,".e-ribbon-item"),l=this.getItemModuleName(n.item);if(i=o?!a.classList.contains("e-disabled"):a.classList.contains("e-disabled"),"template"!==l){if(i)if("group-btn"===l&&"Simplified"===this.activeLayout){m(s,"dropdown-btn",o);for(p=0;p<n.item.groupButtonSettings.items.length;p++)m(u=document.querySelector("#"+e+"_grpbtn"+p),"btn",o)}else if("group-btn"===l&&"Classic"===this.activeLayout)for(var p=0;p<n.item.groupButtonSettings.items.length;p++){var u=s.querySelector("#"+e+"_grpbtn"+p);m(u,"btn",o)}else"gallery"===l?(s.classList.toggle("e-disabled",o),document.getElementById(e+"_popupButton").classList.toggle("e-disabled",o),r&&document.getElementById(e+"_galleryWrapper").classList.toggle("e-disabled",o)):m(s,l,o)}else s.classList.toggle("e-disabled",o),s.toggleAttribute("disabled",o);a.classList.toggle("e-disabled",n.item.disabled)}}},g.prototype.unwireEvents=function(){t.EventHandler.remove(window,"resize",this.resizeListener),t.EventHandler.remove(document.body,"keydown",this.keytipActionHandler),t.EventHandler.remove(document,"mousedown",this.mouseEventHandler),t.EventHandler.remove(document,"scroll",this.mouseEventHandler)},g.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("--fileMenuWidth"),this.element.style.removeProperty("--helpTemplateWidth"),this.element.style.removeProperty("width"),this.cssClass&&t.removeClass([this.element],this.cssClass.split(" ")),this.element.classList.remove("e-rtl","e-ribbon-simplified-mode","e-ribbon-overflow","e-ribbon-collapsible","e-ribbon-minimize","e-rbn"),this.unwireEvents()},g.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("e-ribbon-minimize",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("e-rtl",this.enableRtl),this.updateCommonProperty({enableRtl:e.enableRtl}),this.scrollModule&&this.scrollModule.setProperties({enableRtl:e.enableRtl});break;case"launcherIconCss":for(f=0;f<this.tabs.length;f++){var l=this.tabObj.items[parseInt(f.toString(),10)].content,p=this.tabs[parseInt(f.toString(),10)];if(l.querySelector(".e-ribbon-group"))for(var c=0,u=p.groups;c<u.length;c++){var d=u[c];if(d.showLauncherIcon){var b="e-ribbon-launcher-icon "+(this.launcherIconCss||"e-icons e-launcher");if(d.isCollapsed){var h=l.querySelector("#"+d.id+"_overflow_dropdown");t.getComponent(h,r.DropDownButton).target.querySelector("#"+d.id+"_launcher").className=b}else(h=l.querySelector("#"+d.id+"_launcher")).className=b}}}break;case"selectedTab":var m=this.tabObj.element.querySelectorAll(".e-toolbar-item")[parseInt(e.selectedTab.toString(),10)];m.classList.contains("e-hidden")||m.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(var f=0;f<this.contextualTabs.length;f++)e.contextualTabs[parseInt(f.toString(),10)]&&this.ribbonContextualTabModule.updateContextualTabs(e.contextualTabs[parseInt(f.toString(),10)],this.contextualTabs[parseInt(f.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("--helpTemplateWidth","0px")),this.helpPaneTemplate&&this.createHelpPaneTemplate(),this.tabObj.tbObj.refreshOverflow();break;case"hideLayoutSwitcher":this.hideLayoutSwitcher?this.removeExpandCollapse():this.addExpandCollapse()}};var C;return et([t.Property("Classic")],g.prototype,"activeLayout",void 0),et([t.Property("")],g.prototype,"cssClass",void 0),et([t.Property(!1)],g.prototype,"enableKeyTips",void 0),et([t.Property("")],g.prototype,"layoutSwitcherKeyTip",void 0),et([t.Complex({},ve)],g.prototype,"fileMenu",void 0),et([t.Complex({},Le)],g.prototype,"backStageMenu",void 0),et([t.Property("")],g.prototype,"launcherIconCss",void 0),et([t.Property(!1)],g.prototype,"isMinimized",void 0),et([t.Property("en-us")],g.prototype,"locale",void 0),et([t.Property(0)],g.prototype,"selectedTab",void 0),et([t.Complex({},o.TabAnimationSettings)],g.prototype,"tabAnimation",void 0),et([t.Collection([],fe)],g.prototype,"tabs",void 0),et([t.Collection([],Ee)],g.prototype,"contextualTabs",void 0),et([t.Property("100%")],g.prototype,"width",void 0),et([t.Property("")],g.prototype,"helpPaneTemplate",void 0),et([t.Property(!1)],g.prototype,"hideLayoutSwitcher",void 0),et([t.Event()],g.prototype,"tabSelecting",void 0),et([t.Event()],g.prototype,"tabSelected",void 0),et([t.Event()],g.prototype,"ribbonExpanding",void 0),et([t.Event()],g.prototype,"ribbonCollapsing",void 0),et([t.Event()],g.prototype,"ribbonLayoutSwitched",void 0),et([t.Event()],g.prototype,"launcherIconClick",void 0),et([t.Event()],g.prototype,"created",void 0),et([t.Event()],g.prototype,"overflowPopupOpen",void 0),et([t.Event()],g.prototype,"overflowPopupClose",void 0),g=C=et([t.NotifyPropertyChanges],g)}(t.Component),ot=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("--fileMenuWidth",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(je),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+"_filemenulist"});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)}var i=!!e.element.closest(".e-ribbon-menu.e-popup-open"),r=!!e.element.closest(".e-ribbon-file-menu.e-popup-open"),n=!!document.querySelector(".e-ribbon-file-menu.e-popup-open"),s=r||i&&n;!e.element.classList.contains("e-menu-caret-icon")&&s&&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("--fileMenuWidth",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("--fileMenuWidth"),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(je),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}(),it=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)}}(),rt=function(e){function i(t){var o=e.call(this)||this;return o.parent=t,o}return it(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+"_backstage"});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:"e-ribbon-backstage",created:function(){i.style.setProperty("--fileMenuWidth",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("e-ribbon-backstage-open");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.menuIndex=0,o.isCloseBtn=!1),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(je),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)];o.iconCss||this.popupHTMLElement.querySelector("#"+o.id).classList.add("e-blankicon")}},i.prototype.createBackStagePopup=function(e){var o=this;this.popupHTMLElement=this.parent.createElement("div",{id:this.parent.element.id+"_backstagepopup",className:"e-ribbon-backstage-popup"});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.hideBackstage(),t.EventHandler.add(this.popupHTMLElement,"keyup",function(e){"Escape"===e.code&&o.hideBackstage(),o.handleNavigation(e)},this)},i.prototype.handleNavigation=function(e){var t=this.popupHTMLElement.querySelector(".e-ribbon-close-btn"),o=this.popupHTMLElement.querySelectorAll(".e-menu-item"),i="ArrowUp"===e.key,r="ArrowDown"===e.key;if(i||r){i&&this.menuIndex>0||r&&this.menuIndex<o.length-1&&!this.isCloseBtn?this.menuIndex=i?this.menuIndex-1:this.menuIndex+1:t&&!this.isCloseBtn?(t.focus(),this.isCloseBtn=!0):(this.menuIndex=i?o.length-1:0,this.isCloseBtn=!1);for(var n=0;n<o.length;n++)o[parseInt(n.toString(),10)].classList.remove("e-focused");this.isCloseBtn||(i&&o[this.menuIndex].classList.contains("e-separator")?this.menuIndex--:r&&o[this.menuIndex].classList.contains("e-separator")&&this.menuIndex++,o[this.menuIndex].classList.add("e-focused"),o[this.menuIndex].focus())}},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:"e-ribbon-backstage-wrapper"}),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:"e-icons e-arrow-left",enableRtl:this.parent.enableRtl},r),this.menuWrapper.append(r),r.onclick=function(){i.popupHTMLElement.classList.remove("e-ribbon-backstage-open"),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:"e-ribbon-backstage-items-wrapper"}),this.menuWrapper.append(this.itemsWrapperEle));var s;t?(s=this.parent.createElement("ul",{id:this.parent.element.id+"_footermenulist"}),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:"e-ribbon-backstage-menu",items:this.cloneFooterMenuItem(e.items),select:this.menuSelect.bind(this,e)},s):this.menuCtrl=new o.Menu({orientation:"Vertical",enableRtl:this.parent.enableRtl,cssClass:"e-ribbon-backstage-menu",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){this.clearTemplate(["backstageContent"]),this.backstageContentEle?(this.backstageContentEle.innerHTML="",this.backstageContentEle.id=e+"_content"):this.backstageContentEle=this.parent.createElement("div",{id:e+"_content",className:"e-ribbon-backstage-content"});var i=p(o);return t.append(i({},this,"backstageContent","backstageContent",this.parent.isStringTemplate),this.backstageContentEle),o&&this.popupHTMLElement.append(this.backstageContentEle),this.renderReactTemplates(),i},i.prototype.createBackStageTemplate=function(e){this.clearTemplate(["backstageTemplate"]),this.backstageTempEle=this.parent.createElement("div",{id:this.parent.element.id+"_backstage_template",className:"e-ribbon-backstage-template"});var o=p(e);return t.append(o({},this,"backstageTemplate","backstageTemplate",this.parent.isStringTemplate),this.backstageTempEle),this.popupHTMLElement.append(this.backstageTempEle),this.renderReactTemplates(),o},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,this.menuIndex=o;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("--fileMenuWidth",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("--fileMenuWidth"),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(je),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(s=0;s<e.length;s++)(a=e[parseInt(s.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);for(var r=[].concat(this.menuCtrl.items,this.footerMenuCtrl.items),n=this.parent.backStageMenu,s=0;s<n.items.length;s++)for(var a=n.items[parseInt(s.toString(),10)],l=0;l<r.length;l++){var p=r[parseInt(l.toString(),10)];if(a.text===p.text){p.content=a.content;break}}this.parent.backStageMenu.setProperties({items:r},!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("e-ribbon-backstage-open")&&this.popupEle.element.classList.remove("e-ribbon-backstage-open"),this.popupEle.hide()},i}(t.Component),nt=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("e-ribbon-contextual-tab"),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(r=0;r<o.tabs.length;r++)e.visible?this.parent.showTab(o.tabs[parseInt(r.toString(),10)].id,!0):this.parent.hideTab(o.tabs[parseInt(r.toString(),10)].id,!0);if(!t.isNullOrUndefined(e.isSelected))if(e.isSelected&&o.visible)this.parent.selectTab(o.tabs[0].id);else for(var i=this.parent.tabObj.element,r=0;r<this.parent.tabs.length;r++){var n=i.querySelectorAll(".e-toolbar-item")[parseInt(r.toString(),10)];if(!n.classList.contains("e-hidden")&&!n.classList.contains("e-disable")){this.parent.selectTab(this.parent.tabs[parseInt(r.toString(),10)].id);break}}if(e.tabs)for(var s=this,a=0,l=Object.keys(e.tabs);a<l.length;a++)!function(e){var t=parseInt(e,10),i=s.parent.tabs.filter(function(e){return e.id===o.tabs[parseInt(t.toString(),10)].id})[0];s.parent.updateTab(i)}(l[a])},e}(),st=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(i=0;i<this.parent.tabs.length;i++)this.parent.keyTipElements[parseInt(i.toString(),10)]&&(t=this.parent.keyTipElements[parseInt(i.toString(),10)][""+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)for(var o=this.parent.keyTipElements[this.parent.selectedTab].popupitem,i=0;i<Object.keys(this.parent.keyTipElements[this.parent.selectedTab].popupitem).length;i++)this.createKeyTipElement(o[parseInt(i.toString(),10)].id,o[parseInt(i.toString(),10)].keyTip,"popupitem","left","top",!1,!0)}else if("backstageMenu"===e){if(this.parent.keyTipElements.backstageMenu)for(var r=this.parent.keyTipElements.backstageMenu,i=0;i<Object.keys(this.parent.keyTipElements.backstageMenu).length;i++)this.createKeyTipElement(r[parseInt(i.toString(),10)].id,r[parseInt(i.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(i=0;i<Object.keys(this.parent.keyTipElements[this.parent.selectedTab].launcher).length;i++)t=this.parent.keyTipElements[this.parent.selectedTab].launcher,this.createKeyTipElement(t[parseInt(i.toString(),10)].id,t[parseInt(i.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(i=0;i<Object.keys(this.parent.keyTipElements[this.parent.selectedTab].launcher).length;i++)t=this.parent.keyTipElements[this.parent.selectedTab].launcher,this.createKeyTipElement(t[parseInt(i.toString(),10)].id,t[parseInt(i.toString(),10)].keyTip,"launcher");if(this.parent.keyTipElements[this.parent.selectedTab].grpoverflow)for(i=0;i<Object.keys(this.parent.keyTipElements[this.parent.selectedTab].grpoverflow).length;i++)t=this.parent.keyTipElements[this.parent.selectedTab].grpoverflow,this.createKeyTipElement(t[parseInt(i.toString(),10)].id,t[parseInt(i.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(i=0;i<Object.keys(this.parent.keyTipElements[this.parent.selectedTab].grpofbtn).length;i++)t=this.parent.keyTipElements[this.parent.selectedTab].grpofbtn,this.createKeyTipElement(t[parseInt(i.toString(),10)].id,t[parseInt(i.toString(),10)].keyTip,"grpofbtn")}}},e.prototype.calculateItemPosition=function(e,t,o){void 0===t&&(t=!1);var i,r,n=this.parent.keyTipElements[parseInt(this.parent.selectedTab.toString(),10)][""+e];if(n)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;-1!==n[parseInt(s.toString(),10)].id.indexOf("_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+"_header")),p&&(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:p.closest(".e-colorpicker-wrapper")&&(l=(p=p.closest(".e-colorpicker-wrapper")).closest(".e-ribbon-item").id)),(p&&p.offsetParent||n&&s)&&(s&&c||!s)){var u=this.parent.createElement("div",{className:"e-ribbon-keytip",id:e+"_keytip",attrs:{role:"dialog","aria-label":"ribbon-keytip"}});document.body.append(u),new a.Popup(u,{relateTo:"#"+(n?e+"_header":l||e),content:t,collision:{X:"fit",Y:"flip"},targetType:"relative",position:{X:i,Y:r},enableRtl:this.parent.enableRtl,actionOnScroll:"hide"}).show(),this.calculateKeyTipPosition(p,u,o,r),this.parent.isKeytipOpen=!0}},e.prototype.calculateKeyTipPosition=function(e,t,o,i){var r=e.getBoundingClientRect();"backstageMenu"===o?(t.style.top=r.top+t.offsetHeight/2+"px",t.style.left=r.left+e.offsetWidth/5+"px"):"popupitem"!==o&&(t.style.left=r.left+(r.width-t.offsetWidth)/2+"px"),"filemenu"===o||"backstage"===o?t.style.top=r.top+(e.offsetHeight-e.offsetHeight/3+t.offsetHeight/6)+"px":"item"===o&&"top"===i&&(t.style.top=r.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<Object.keys(n).length&&!this.isKeytipPresent;s++)if(e.toUpperCase()===n[parseInt(s.toString(),10)].keyTip&&(document.querySelector("#"+n[parseInt(s.toString(),10)].id+"_keytip")||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(-1!==n[parseInt(s.toString(),10)].id.indexOf("_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;t?-1===n[parseInt(s.toString(),10)].id.indexOf("_launcher")&&-1===n[parseInt(s.toString(),10)].id.indexOf("_sim_grp_overflow")&&-1===n[parseInt(s.toString(),10)].id.indexOf("_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)):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;switch(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+"_sim_ovrl_overflow-popup")&&document.querySelector("#"+l).closest("#"+this.parent.tabObj.element.id+"_sim_ovrl_overflow-popup").classList.contains("e-popup-close")&&document.querySelector("#"+this.parent.tabObj.element.id+"_sim_ovrl_overflow").click():document.querySelector("#"+l).closest("#"+e.group.id+"_overflow_dropdown-popup")&&document.querySelector("#"+l).closest("#"+e.group.id+"_overflow_dropdown-popup").classList.contains("e-popup-close")&&document.querySelector("#"+e.group.id+"_overflow_dropdown").click()),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);this.isInteractableElement(p)&&setTimeout(function(){p.focus()},100);break;case"gallery":var c=document.querySelector("#"+l);this.isInteractableElement(c)&&c.click();break;case"template":var u=document.querySelector("#"+l);this.isInteractableElement(u)&&u.focus();break;case"group-btn":var d=document.querySelector("#"+l);if(this.isInteractableElement(d)){t.getInstance(d,r.DropDownButton).toggle();for(var b=0;b<e.item.groupButtonSettings.items.length;b++)e.item.groupButtonSettings.items[parseInt(b.toString(),10)].keyTip&&this.createKeyTipElement(l+"_grpbtn"+b,e.item.groupButtonSettings.items[parseInt(b.toString(),10)].keyTip,"item")}}}},e.prototype.isInteractableElement=function(e){return e&&!e.closest(".e-ribbon-item").classList.contains("e-disabled")},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+"_keytip")||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+"_keytip")||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=this,s=0;s<i.length;s++)!function(s){var a=i[parseInt(s.toString(),10)];if("Escape"===e&&n.parent.keyTipElements&&n.parent.keyTipElements[n.parent.selectedTab]){for(d=0;d<Object.keys(n.parent.keyTipElements[n.parent.selectedTab]).length;d++){var p=Object.keys(n.parent.keyTipElements[parseInt(n.parent.selectedTab.toString(),10)])[parseInt(d.toString(),10)];if(-1!==(b=l(n.parent.keyTipElements[parseInt(n.parent.selectedTab.toString(),10)][""+p],function(e){return e.id+"_keytip"===i[parseInt(s.toString(),10)].id}))){if("item"===p&&!n.isKeytipPopupOpen||"grpoverflow"===p&&"Classic"===n.parent.activeLayout){n.createKeytip("tab"),e="",r=!0;break}if(n.isKeytipPopupOpen&&("popupitem"===p&&"Simplified"===n.parent.activeLayout||"grpoverflowpopup"===p&&"Classic"===n.parent.activeLayout)){n.createKeytip("item"),e="",r=!0;break}}}for(var c=0;c<Object.keys(n.parent.keyTipElements).length;c++)if(n.parent.keyTipElements[parseInt(c.toString(),10)]){for(var u=n.parent.keyTipElements[parseInt(c.toString(),10)].tab,d=0;d<Object.keys(u).length;d++)if(a.id===u[0].id+"_keytip"&&document.querySelector("#"+u[0].id+"_header").closest(".e-toolbar-pop")){n.parent.tabObj.element.querySelector(".e-nav-active").click(),setTimeout(function(){o.createKeytip("tab")},600),e="",r=!0;break}if(r)break}if(!r&&n.parent.keyTipElements.backstageMenu){var b=l(n.parent.keyTipElements.backstageMenu,function(e){return e.id+"_keytip"===i[parseInt(s.toString(),10)].id});-1!==b&&(n.createKeytip("tab"),e="",r=!0)}}a&&t.remove(a)}(s);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}();return tt.Inject(Ke,Ye,Ze,Ue,Ve,Xe,Je,ot,rt,st,nt,Qe),e.BACKSTAGE_CLOSE_ICON="e-icons e-arrow-left",e.BackStageMenu=Le,e.BackstageBackButton=Ce,e.BackstageItem=ke,e.COLLAPSE_BUTTON_ID="_collapsebutton",e.COLLECTION_ID="_collection",e.CONTAINER_ID="_container",e.CONTENT_ID="_content",e.DISABLED_CSS="e-disabled",e.DROPDOWNBUTTON="e-dropdown-btn",e.DROPDOWNBUTTON_HIDE="e-caret-hide",e.DROPDOWN_ID="_dropdown",e.EXPAND_COLLAPSE_ICON="e-icons e-drop-icon",e.FileMenuSettings=ve,e.GROUPOF_BUTTON_ID=Fe,e.GROUP_ID="_group",e.HEADER_ID="_header",e.HIDE_CSS=xe,e.HORIZONTAL_SCROLLBAR="e-hscroll-bar",e.ITEM_ID="_item",e.ITEM_VERTICAL_CENTER="e-ribbon-vertical-center",e.LAUNCHER_ID="_launcher",e.OVERFLOW_ICON="e-icons e-more-horizontal-1",e.OVERFLOW_ID="_overflow",e.OVRLOF_BUTTON_ID="_sim_ovrl_overflow",e.RIBBON_BACKSTAGE="e-ribbon-backstage",e.RIBBON_BACKSTAGE_CONTENT="e-ribbon-backstage-content",e.RIBBON_BACKSTAGE_ITEMS_WRAPPER="e-ribbon-backstage-items-wrapper",e.RIBBON_BACKSTAGE_MENU="e-ribbon-backstage-menu",e.RIBBON_BACKSTAGE_MENU_ID="_backstage",e.RIBBON_BACKSTAGE_MENU_WRAPPER="e-ribbon-backstage-wrapper",e.RIBBON_BACKSTAGE_OPEN="e-ribbon-backstage-open",e.RIBBON_BACKSTAGE_POPUP="e-ribbon-backstage-popup",e.RIBBON_BACKSTAGE_POPUP_ID="_backstagepopup",e.RIBBON_BACKSTAGE_TEMPLATE="e-ribbon-backstage-template",e.RIBBON_BACKSTAGE_TEXT_MENU="e-blankicon",e.RIBBON_COLLAPSE_BUTTON="e-ribbon-collapse-btn",e.RIBBON_COLLAPSIBLE="e-ribbon-collapsible",e.RIBBON_COLLECTION="e-ribbon-collection",e.RIBBON_COLUMN="e-ribbon-column",e.RIBBON_CONTENT_HEIGHT="e-ribbon-content-height",e.RIBBON_CONTEXTUAL_TAB="e-ribbon-contextual-tab",e.RIBBON_CONTROL=De,e.RIBBON_EXPAND_BUTTON="e-ribbon-expand-btn",e.RIBBON_FILE_MENU_ID="_filemenu",e.RIBBON_FILE_MENU_LIST="_filemenulist",e.RIBBON_FILE_MENU_WIDTH="--fileMenuWidth",e.RIBBON_FOOTER_MENU_LIST="_footermenulist",e.RIBBON_GROUP="e-ribbon-group",e.RIBBON_GROUP_BUTTON="e-ribbon-group-button",e.RIBBON_GROUP_BUTTON_CONTENT="e-ribbon-group-button-content",e.RIBBON_GROUP_BUTTON_ID="_grpbtn",e.RIBBON_GROUP_BUTTON_OVERFLOW_POPUP="e-ribbon-group-button-overflow-popup",e.RIBBON_GROUP_CONTAINER="e-ribbon-group-container",e.RIBBON_GROUP_CONTENT="e-ribbon-group-content",e.RIBBON_GROUP_HEADER="e-ribbon-group-header",e.RIBBON_GROUP_OF_BUTTON="e-ribbon-group-of-btn",e.RIBBON_GROUP_OVERFLOW="e-ribbon-group-overflow",e.RIBBON_GROUP_OVERFLOW_DDB="e-ribbon-group-overflow-ddb",e.RIBBON_HELP_PANE_TEMPLATE_ID="_helppanetemplate",e.RIBBON_HELP_PANE_TEMPLATE_WIDTH="--helpTemplateWidth",e.RIBBON_HELP_TEMPLATE="e-ribbon-help-template",e.RIBBON_HOVER="e-ribbon-hover",e.RIBBON_ITEM=Me,e.RIBBON_KEYTIP="e-ribbon-keytip",e.RIBBON_KEYTIP_ID="_keytip",e.RIBBON_LARGE_ITEM="e-ribbon-large-item",e.RIBBON_LAUNCHER="e-ribbon-launcher",e.RIBBON_LAUNCHER_ICON="e-icons e-launcher",e.RIBBON_LAUNCHER_ICON_ELE="e-ribbon-launcher-icon",e.RIBBON_MEDIUM_ITEM="e-ribbon-medium-item",e.RIBBON_MENU_LIST="_menulist",e.RIBBON_MINIMIZE="e-ribbon-minimize",e.RIBBON_MULTIPLE_BUTTON_SELECTION="e-ribbon-multiple-selection",e.RIBBON_OF_GROUP_CONTAINER="e-ribbon-of-group-container",e.RIBBON_OF_TAB_CONTAINER="e-ribbon-of-tab",e.RIBBON_OVERALL_OF_BUTTON="e-ribbon-overall-of-btn",e.RIBBON_OVERFLOW="e-ribbon-overflow",e.RIBBON_OVERFLOW_HEADER="e-ribbon-overflow-header",e.RIBBON_OVERFLOW_TARGET="e-ribbon-overflow-target",e.RIBBON_POPUP_CONTROL=Re,e.RIBBON_POPUP_OPEN="e-ribbon-open",e.RIBBON_ROW=qe,e.RIBBON_SELECTED_CONTENT="e-ribbon-selected-content",e.RIBBON_SIMPLIFIED_MODE="e-ribbon-simplified-mode",e.RIBBON_SINGLE_BUTTON_SELECTION="e-ribbon-single-selection",e.RIBBON_SMALL_ITEM="e-ribbon-small-item",e.RIBBON_TAB="e-ribbon-tab",e.RIBBON_TAB_ACTIVE="e-ribbon-active",e.RIBBON_TAB_ITEM="e-ribbon-tab-item",e.RIBBON_TEMPLATE="e-ribbon-template",e.RIBBON_TEXT_CONTAINER=We,e.RIBBON_TOOLTIP=Ae,e.RIBBON_TOOLTIP_CONTAINER=He,e.RIBBON_TOOLTIP_CONTENT=ze,e.RIBBON_TOOLTIP_ICON=Ne,e.RIBBON_TOOLTIP_TARGET=je,e.RIBBON_TOOLTIP_TITLE=Ge,e.RTL_CSS="e-rtl",e.Ribbon=tt,e.RibbonBackstage=rt,e.RibbonButton=Ke,e.RibbonButtonSettings=k,e.RibbonCheckBox=Ue,e.RibbonCheckBoxSettings=L,e.RibbonCollection=ce,e.RibbonColorPicker=Ve,e.RibbonColorPickerSettings=E,e.RibbonComboBox=Xe,e.RibbonComboBoxSettings=x,e.RibbonContextualTab=nt,e.RibbonContextualTabSettings=Ee,e.RibbonDropDown=Ye,e.RibbonDropDownSettings=A,e.RibbonFileMenu=ot,e.RibbonGallery=Qe,e.RibbonGalleryGroup=te,e.RibbonGalleryItem=Q,e.RibbonGallerySettings=re,e.RibbonGroup=be,e.RibbonGroupButton=Je,e.RibbonGroupButtonItem=U,e.RibbonGroupButtonSettings=Y,e.RibbonItem=ae,e.RibbonKeyTip=st,e.RibbonSplitButton=Ze,e.RibbonSplitButtonSettings=z,e.RibbonTab=fe,e.RibbonTooltip=W,e.SPACE=" ",e.TAB_CONTENT="e-content",e.TAB_ID="_tab",e.VERTICAL_DDB="e-vertical",e.createTooltip=v,e.destroyControl=b,e.destroyTooltip=S,e.getCollection=u,e.getGroup=d,e.getIndex=l,e.getItem=c,e.getItemElement=f,e.getTemplateFunction=p,e.isTooltipPresent=y,e.setCustomAttributes=C,e.setToolTipContent=g,e.updateCommonProperty=h,e.updateControlDisabled=m,e.updateTooltipProp=I,e}({},ej.base,ej.navigations,ej.dropdowns,ej.splitbuttons,ej.buttons,ej.inputs,ej.popups),this.ejs=ej;
2
11
  //# sourceMappingURL=ej2-ribbon.min.js.map