@finqu/cool 1.2.29 → 2.0.2

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 (221) hide show
  1. package/README.md +694 -1
  2. package/dist/css/cool.css +26902 -14322
  3. package/dist/css/cool.css.map +1 -154
  4. package/dist/css/cool.min.css +2 -7
  5. package/dist/css/cool.min.css.map +1 -1
  6. package/dist/js/cool.bundle.js +16191 -5588
  7. package/dist/js/cool.bundle.js.map +1 -1
  8. package/dist/js/cool.bundle.min.js +13 -8
  9. package/dist/js/cool.bundle.min.js.map +1 -1
  10. package/dist/js/cool.esm.js +4722 -4812
  11. package/dist/js/cool.esm.js.map +1 -1
  12. package/dist/js/cool.esm.min.js +4 -9
  13. package/dist/js/cool.esm.min.js.map +1 -1
  14. package/dist/js/cool.js +5143 -5240
  15. package/dist/js/cool.js.map +1 -1
  16. package/dist/js/cool.min.js +4 -9
  17. package/dist/js/cool.min.js.map +1 -1
  18. package/package.json +125 -60
  19. package/scss/LISENCE +1 -1
  20. package/scss/_badge.scss +134 -102
  21. package/scss/_button-group.scss +80 -129
  22. package/scss/_buttons.scss +257 -201
  23. package/scss/_dark.scss +637 -0
  24. package/scss/_dialog.scss +314 -123
  25. package/scss/_dropdown.scss +165 -233
  26. package/scss/_forms.scss +555 -200
  27. package/scss/_frame.scss +945 -624
  28. package/scss/_grid.scss +215 -35
  29. package/scss/_input-group.scss +326 -285
  30. package/scss/_list-group.scss +127 -82
  31. package/scss/_media.scss +439 -0
  32. package/scss/_navbar.scss +116 -284
  33. package/scss/_notification.scss +111 -9
  34. package/scss/_pagination.scss +82 -88
  35. package/scss/_popover.scss +61 -167
  36. package/scss/_reboot.scss +306 -284
  37. package/scss/_root.scss +848 -15
  38. package/scss/_section.scss +735 -977
  39. package/scss/_select.scss +559 -187
  40. package/scss/_tables.scss +471 -595
  41. package/scss/_tabs.scss +50 -178
  42. package/scss/_toast.scss +242 -147
  43. package/scss/_tooltip.scss +130 -101
  44. package/scss/_typography.scss +166 -0
  45. package/scss/_variables.scss +1154 -748
  46. package/scss/cool.scss +64 -32
  47. package/scss/utilities/_align.scss +51 -41
  48. package/scss/utilities/_animation.scss +165 -0
  49. package/scss/utilities/_background.scss +72 -14
  50. package/scss/utilities/_borders.scss +205 -146
  51. package/scss/utilities/_collapse.scss +20 -25
  52. package/scss/utilities/_cursor.scss +160 -22
  53. package/scss/utilities/_display.scss +116 -16
  54. package/scss/utilities/_embed.scss +89 -78
  55. package/scss/utilities/_fill.scss +79 -0
  56. package/scss/utilities/_filters.scss +233 -0
  57. package/scss/utilities/_flex.scss +216 -52
  58. package/scss/utilities/_grid.scss +136 -0
  59. package/scss/utilities/_opacity.scss +131 -0
  60. package/scss/utilities/_overflow.scss +242 -6
  61. package/scss/utilities/_perfect-scrollbar.scss +147 -141
  62. package/scss/utilities/_pointer-events.scss +125 -0
  63. package/scss/utilities/_position.scss +130 -30
  64. package/scss/utilities/_screen-readers.scss +95 -0
  65. package/scss/utilities/_shadows.scss +195 -0
  66. package/scss/utilities/_sizing.scss +288 -32
  67. package/scss/utilities/_spacing.scss +168 -92
  68. package/scss/utilities/_stroke.scss +124 -0
  69. package/scss/utilities/_text.scss +420 -99
  70. package/scss/utilities/_transform.scss +232 -0
  71. package/scss/utilities/_transitions.scss +147 -0
  72. package/scss/utilities/_user-select.scss +89 -10
  73. package/scss/utilities/_visibility.scss +62 -6
  74. package/scss/utilities/_z-index.scss +169 -0
  75. package/.babelrc.js +0 -20
  76. package/.browserslistrc +0 -13
  77. package/build/.eslintrc.json +0 -10
  78. package/build/banner.js +0 -14
  79. package/build/build-plugins.js +0 -92
  80. package/build/rollup.config.js +0 -46
  81. package/dist/css/cool-grid.css +0 -4390
  82. package/dist/css/cool-grid.css.map +0 -30
  83. package/dist/css/cool-grid.min.css +0 -7
  84. package/dist/css/cool-grid.min.css.map +0 -1
  85. package/dist/css/cool-reboot.css +0 -286
  86. package/dist/css/cool-reboot.css.map +0 -62
  87. package/dist/css/cool-reboot.min.css +0 -7
  88. package/dist/css/cool-reboot.min.css.map +0 -1
  89. package/html/index.html +0 -2703
  90. package/js/dist/collapse.js +0 -5535
  91. package/js/dist/collapse.js.map +0 -1
  92. package/js/dist/common.js +0 -21996
  93. package/js/dist/common.js.map +0 -1
  94. package/js/dist/cooldropdown.js +0 -467
  95. package/js/dist/cooldropdown.js.map +0 -1
  96. package/js/dist/coolpopover.js +0 -391
  97. package/js/dist/coolpopover.js.map +0 -1
  98. package/js/dist/coolsectiontabs.js +0 -256
  99. package/js/dist/coolsectiontabs.js.map +0 -1
  100. package/js/dist/coolselect.js +0 -796
  101. package/js/dist/coolselect.js.map +0 -1
  102. package/js/dist/cooltooltip.js +0 -360
  103. package/js/dist/cooltooltip.js.map +0 -1
  104. package/js/dist/coolui.js +0 -73
  105. package/js/dist/coolui.js.map +0 -1
  106. package/js/dist/dropdown.js +0 -27421
  107. package/js/dist/dropdown.js.map +0 -1
  108. package/js/dist/popover.js +0 -9472
  109. package/js/dist/popover.js.map +0 -1
  110. package/js/dist/sectiontabs.js +0 -4483
  111. package/js/dist/sectiontabs.js.map +0 -1
  112. package/js/dist/select.js +0 -37080
  113. package/js/dist/select.js.map +0 -1
  114. package/js/dist/tooltip.js +0 -8786
  115. package/js/dist/tooltip.js.map +0 -1
  116. package/js/index.esm.js +0 -21
  117. package/js/index.umd.js +0 -21
  118. package/js/src/abstract-ui-component.js +0 -81
  119. package/js/src/collapse.js +0 -286
  120. package/js/src/common.js +0 -296
  121. package/js/src/dialog.js +0 -579
  122. package/js/src/dropdown.js +0 -525
  123. package/js/src/popover.js +0 -632
  124. package/js/src/section-tabs.js +0 -215
  125. package/js/src/select.js +0 -1342
  126. package/js/src/toast.js +0 -581
  127. package/js/src/tooltip.js +0 -591
  128. package/js/src/util/animate-css.js +0 -22
  129. package/js/src/util/index.js +0 -122
  130. package/js/src/util/perfect-scrollbar.js +0 -1316
  131. package/less/alert.less +0 -345
  132. package/less/badge.less +0 -38
  133. package/less/bootstrap-noconflict.less +0 -23
  134. package/less/bootstrap.less +0 -23
  135. package/less/button-group.less +0 -153
  136. package/less/buttons.less +0 -287
  137. package/less/dialog-noconflict.less +0 -174
  138. package/less/dialog.less +0 -203
  139. package/less/dropdown.less +0 -209
  140. package/less/forms.less +0 -770
  141. package/less/images.less +0 -242
  142. package/less/input-group.less +0 -163
  143. package/less/list-group.less +0 -73
  144. package/less/mixins/aspect-ratio.less +0 -23
  145. package/less/mixins/border-radius.less +0 -24
  146. package/less/mixins/box-shadow.less +0 -4
  147. package/less/mixins/buttons.less +0 -17
  148. package/less/mixins/caret.less +0 -51
  149. package/less/mixins/clearfix.less +0 -10
  150. package/less/mixins/gradients.less +0 -34
  151. package/less/mixins/nav-divider.less +0 -7
  152. package/less/mixins/object-fit.less +0 -13
  153. package/less/mixins/reset-text.less +0 -16
  154. package/less/mixins.less +0 -11
  155. package/less/package.json +0 -11
  156. package/less/pagination.less +0 -69
  157. package/less/popover.less +0 -143
  158. package/less/project.sublime-workspace +0 -774
  159. package/less/reboot.less +0 -235
  160. package/less/section.less +0 -793
  161. package/less/select.less +0 -150
  162. package/less/tables.less +0 -737
  163. package/less/tabs.less +0 -162
  164. package/less/tooltip.less +0 -87
  165. package/less/type.less +0 -71
  166. package/less/utilities/align.less +0 -27
  167. package/less/utilities/animate.less +0 -3512
  168. package/less/utilities/background.less +0 -70
  169. package/less/utilities/borders.less +0 -16
  170. package/less/utilities/color.less +0 -70
  171. package/less/utilities/cursor.less +0 -8
  172. package/less/utilities/display.less +0 -38
  173. package/less/utilities/embed.less +0 -61
  174. package/less/utilities/flex.less +0 -76
  175. package/less/utilities/jquery-ui.less +0 -116
  176. package/less/utilities/lazyload.less +0 -29
  177. package/less/utilities/overflow.less +0 -11
  178. package/less/utilities/pace.less +0 -25
  179. package/less/utilities/placeholder.less +0 -60
  180. package/less/utilities/position.less +0 -42
  181. package/less/utilities/scrollbar.less +0 -152
  182. package/less/utilities/spacing.less +0 -197
  183. package/less/utilities/text.less +0 -68
  184. package/less/utilities/transform.less +0 -7
  185. package/less/utilities.less +0 -21
  186. package/less/variables.less +0 -343
  187. package/scss/_alert.scss +0 -102
  188. package/scss/_custom-forms.scss +0 -444
  189. package/scss/_functions.scss +0 -124
  190. package/scss/_images.scss +0 -361
  191. package/scss/_mixins.scss +0 -34
  192. package/scss/_type.scss +0 -129
  193. package/scss/_utilities.scss +0 -23
  194. package/scss/cool-grid.scss +0 -29
  195. package/scss/cool-reboot.scss +0 -11
  196. package/scss/mixins/_alert-variant.scss +0 -20
  197. package/scss/mixins/_aspect-ratio.scss +0 -29
  198. package/scss/mixins/_background-variant.scss +0 -25
  199. package/scss/mixins/_badge-variant.scss +0 -36
  200. package/scss/mixins/_breakpoints.scss +0 -102
  201. package/scss/mixins/_buttons.scss +0 -104
  202. package/scss/mixins/_caret.scss +0 -80
  203. package/scss/mixins/_clearfix.scss +0 -10
  204. package/scss/mixins/_float.scss +0 -14
  205. package/scss/mixins/_forms.scss +0 -67
  206. package/scss/mixins/_gradients.scss +0 -40
  207. package/scss/mixins/_grid-framework.scss +0 -72
  208. package/scss/mixins/_grid.scss +0 -60
  209. package/scss/mixins/_nav-divider.scss +0 -9
  210. package/scss/mixins/_notification-variant.scss +0 -7
  211. package/scss/mixins/_object-fit.scss +0 -16
  212. package/scss/mixins/_reset-text.scss +0 -19
  213. package/scss/mixins/_text-emphasis.scss +0 -21
  214. package/scss/mixins/_text-hide.scss +0 -10
  215. package/scss/mixins/_text-truncate.scss +0 -81
  216. package/scss/mixins/_visibility.scss +0 -7
  217. package/scss/project.sublime-workspace +0 -491
  218. package/scss/utilities/_animate.scss +0 -3512
  219. package/scss/utilities/_clearfix.scss +0 -6
  220. package/scss/utilities/_lazyload.scss +0 -31
  221. package/scss/utilities/_placeholder.scss +0 -77
@@ -1,12 +1,7 @@
1
1
  /*!
2
- * Cool UI v1.2.29 (https://finqu.fi)
3
- * Copyright 2011-2021 Finqu Oy
4
- * Licensed under the ISC license - (http://opensource.org/licenses/ISC)
2
+ * Cool v2.0.2 (https://github.com/finqu/cool#readme)
3
+ * Copyright 2020-2026 Finqu Oy
4
+ * Licensed under ISC
5
5
  */
6
- import"jquery";
7
- /*!
8
- * perfect-scrollbar v1.4.0
9
- * (c) 2018 Hyunje Jun
10
- * @license MIT
11
- */function get(t){return getComputedStyle(t)}function set(t,e){for(var o in e){var i=e[o];"number"==typeof i&&(i+="px"),t.style[o]=i}return t}function div(t){var e=document.createElement("div");return e.className=t,e}var elMatches="undefined"!=typeof Element&&(Element.prototype.matches||Element.prototype.webkitMatchesSelector||Element.prototype.mozMatchesSelector||Element.prototype.msMatchesSelector);function matches(t,e){if(!elMatches)throw new Error("No element matching method supported");return elMatches.call(t,e)}function remove(t){t.remove?t.remove():t.parentNode&&t.parentNode.removeChild(t)}function queryChildren(t,e){return Array.prototype.filter.call(t.children,function(t){return matches(t,e)})}var cls={main:"ps",element:{thumb:function(t){return"ps__thumb-"+t},rail:function(t){return"ps__rail-"+t},consuming:"ps__child--consume"},state:{focus:"ps--focus",clicking:"ps--clicking",active:function(t){return"ps--active-"+t},scrolling:function(t){return"ps--scrolling-"+t}}},scrollingClassTimeout={x:null,y:null};function addScrollingClass(t,e){var o=t.element.classList,i=cls.state.scrolling(e);o.contains(i)?clearTimeout(scrollingClassTimeout[e]):o.add(i)}function removeScrollingClass(t,e){scrollingClassTimeout[e]=setTimeout(function(){return t.isAlive&&t.element.classList.remove(cls.state.scrolling(e))},t.settings.scrollingThreshold)}function setScrollingClassInstantly(t,e){addScrollingClass(t,e),removeScrollingClass(t,e)}var EventElement=function(t){this.element=t,this.handlers={}},prototypeAccessors={isEmpty:{configurable:!0}};EventElement.prototype.bind=function(t,e){void 0===this.handlers[t]&&(this.handlers[t]=[]),this.handlers[t].push(e),this.element.addEventListener(t,e,!1)},EventElement.prototype.unbind=function(t,e){var o=this;this.handlers[t]=this.handlers[t].filter(function(i){return!(!e||i===e)||(o.element.removeEventListener(t,i,!1),!1)})},EventElement.prototype.unbindAll=function(){for(var t in this.handlers)this.unbind(t)},prototypeAccessors.isEmpty.get=function(){var t=this;return Object.keys(this.handlers).every(function(e){return 0===t.handlers[e].length})},Object.defineProperties(EventElement.prototype,prototypeAccessors);var EventManager=function(){this.eventElements=[]};function createEvent(t){if("function"==typeof window.CustomEvent)return new CustomEvent(t);var e=document.createEvent("CustomEvent");return e.initCustomEvent(t,!1,!1,void 0),e}EventManager.prototype.eventElement=function(t){var e=this.eventElements.filter(function(e){return e.element===t})[0];return e||(e=new EventElement(t),this.eventElements.push(e)),e},EventManager.prototype.bind=function(t,e,o){this.eventElement(t).bind(e,o)},EventManager.prototype.unbind=function(t,e,o){var i=this.eventElement(t);i.unbind(e,o),i.isEmpty&&this.eventElements.splice(this.eventElements.indexOf(i),1)},EventManager.prototype.unbindAll=function(){this.eventElements.forEach(function(t){return t.unbindAll()}),this.eventElements=[]},EventManager.prototype.once=function(t,e,o){var i=this.eventElement(t);i.bind(e,function t(n){i.unbind(e,t),o(n)})};var processScrollDiff=function(t,e,o,i,n){var s;if(void 0===i&&(i=!0),void 0===n&&(n=!1),"top"===e)s=["contentHeight","containerHeight","scrollTop","y","up","down"];else{if("left"!==e)throw new Error("A proper axis should be provided");s=["contentWidth","containerWidth","scrollLeft","x","left","right"]}processScrollDiff$1(t,o,s,i,n)};function processScrollDiff$1(t,e,o,i,n){var s=o[0],a=o[1],l=o[2],r=o[3],h=o[4],c=o[5];void 0===i&&(i=!0),void 0===n&&(n=!1);var d=t.element;t.reach[r]=null,d[l]<1&&(t.reach[r]="start"),d[l]>t[s]-t[a]-1&&(t.reach[r]="end"),e&&(d.dispatchEvent(createEvent("ps-scroll-"+r)),e<0?d.dispatchEvent(createEvent("ps-scroll-"+h)):e>0&&d.dispatchEvent(createEvent("ps-scroll-"+c)),i&&setScrollingClassInstantly(t,r)),t.reach[r]&&(e||n)&&d.dispatchEvent(createEvent("ps-"+r+"-reach-"+t.reach[r]))}function toInt(t){return parseInt(t,10)||0}function isEditable(t){return matches(t,"input,[contenteditable]")||matches(t,"select,[contenteditable]")||matches(t,"textarea,[contenteditable]")||matches(t,"button,[contenteditable]")}function outerWidth(t){var e=get(t);return toInt(e.width)+toInt(e.paddingLeft)+toInt(e.paddingRight)+toInt(e.borderLeftWidth)+toInt(e.borderRightWidth)}var env={isWebKit:"undefined"!=typeof document&&"WebkitAppearance"in document.documentElement.style,supportsTouch:"undefined"!=typeof window&&("ontouchstart"in window||window.DocumentTouch&&document instanceof window.DocumentTouch),supportsIePointer:"undefined"!=typeof navigator&&navigator.msMaxTouchPoints,isChrome:"undefined"!=typeof navigator&&/Chrome/i.test(navigator&&navigator.userAgent)},updateGeometry=function(t){var e=t.element,o=Math.floor(e.scrollTop);t.containerWidth=e.clientWidth,t.containerHeight=e.clientHeight,t.contentWidth=e.scrollWidth,t.contentHeight=e.scrollHeight,e.contains(t.scrollbarXRail)||(queryChildren(e,cls.element.rail("x")).forEach(function(t){return remove(t)}),e.appendChild(t.scrollbarXRail)),e.contains(t.scrollbarYRail)||(queryChildren(e,cls.element.rail("y")).forEach(function(t){return remove(t)}),e.appendChild(t.scrollbarYRail)),!t.settings.suppressScrollX&&t.containerWidth+t.settings.scrollXMarginOffset<t.contentWidth?(t.scrollbarXActive=!0,t.railXWidth=t.containerWidth-t.railXMarginWidth,t.railXRatio=t.containerWidth/t.railXWidth,t.scrollbarXWidth=getThumbSize(t,toInt(t.railXWidth*t.containerWidth/t.contentWidth)),t.scrollbarXLeft=toInt((t.negativeScrollAdjustment+e.scrollLeft)*(t.railXWidth-t.scrollbarXWidth)/(t.contentWidth-t.containerWidth))):t.scrollbarXActive=!1,!t.settings.suppressScrollY&&t.containerHeight+t.settings.scrollYMarginOffset<t.contentHeight?(t.scrollbarYActive=!0,t.railYHeight=t.containerHeight-t.railYMarginHeight,t.railYRatio=t.containerHeight/t.railYHeight,t.scrollbarYHeight=getThumbSize(t,toInt(t.railYHeight*t.containerHeight/t.contentHeight)),t.scrollbarYTop=toInt(o*(t.railYHeight-t.scrollbarYHeight)/(t.contentHeight-t.containerHeight))):t.scrollbarYActive=!1,t.scrollbarXLeft>=t.railXWidth-t.scrollbarXWidth&&(t.scrollbarXLeft=t.railXWidth-t.scrollbarXWidth),t.scrollbarYTop>=t.railYHeight-t.scrollbarYHeight&&(t.scrollbarYTop=t.railYHeight-t.scrollbarYHeight),updateCss(e,t),t.scrollbarXActive?e.classList.add(cls.state.active("x")):(e.classList.remove(cls.state.active("x")),t.scrollbarXWidth=0,t.scrollbarXLeft=0,e.scrollLeft=0),t.scrollbarYActive?e.classList.add(cls.state.active("y")):(e.classList.remove(cls.state.active("y")),t.scrollbarYHeight=0,t.scrollbarYTop=0,e.scrollTop=0)};function getThumbSize(t,e){return t.settings.minScrollbarLength&&(e=Math.max(e,t.settings.minScrollbarLength)),t.settings.maxScrollbarLength&&(e=Math.min(e,t.settings.maxScrollbarLength)),e}function updateCss(t,e){var o={width:e.railXWidth},i=Math.floor(t.scrollTop);e.isRtl?o.left=e.negativeScrollAdjustment+t.scrollLeft+e.containerWidth-e.contentWidth:o.left=t.scrollLeft,e.isScrollbarXUsingBottom?o.bottom=e.scrollbarXBottom-i:o.top=e.scrollbarXTop+i,set(e.scrollbarXRail,o);var n={top:i,height:e.railYHeight};e.isScrollbarYUsingRight?e.isRtl?n.right=e.contentWidth-(e.negativeScrollAdjustment+t.scrollLeft)-e.scrollbarYRight-e.scrollbarYOuterWidth:n.right=e.scrollbarYRight-t.scrollLeft:e.isRtl?n.left=e.negativeScrollAdjustment+t.scrollLeft+2*e.containerWidth-e.contentWidth-e.scrollbarYLeft-e.scrollbarYOuterWidth:n.left=e.scrollbarYLeft+t.scrollLeft,set(e.scrollbarYRail,n),set(e.scrollbarX,{left:e.scrollbarXLeft,width:e.scrollbarXWidth-e.railBorderXWidth}),set(e.scrollbarY,{top:e.scrollbarYTop,height:e.scrollbarYHeight-e.railBorderYWidth})}var clickRail=function(t){t.event.bind(t.scrollbarY,"mousedown",function(t){return t.stopPropagation()}),t.event.bind(t.scrollbarYRail,"mousedown",function(e){var o=e.pageY-window.pageYOffset-t.scrollbarYRail.getBoundingClientRect().top>t.scrollbarYTop?1:-1;t.element.scrollTop+=o*t.containerHeight,updateGeometry(t),e.stopPropagation()}),t.event.bind(t.scrollbarX,"mousedown",function(t){return t.stopPropagation()}),t.event.bind(t.scrollbarXRail,"mousedown",function(e){var o=e.pageX-window.pageXOffset-t.scrollbarXRail.getBoundingClientRect().left>t.scrollbarXLeft?1:-1;t.element.scrollLeft+=o*t.containerWidth,updateGeometry(t),e.stopPropagation()})},dragThumb=function(t){bindMouseScrollHandler(t,["containerWidth","contentWidth","pageX","railXWidth","scrollbarX","scrollbarXWidth","scrollLeft","x","scrollbarXRail"]),bindMouseScrollHandler(t,["containerHeight","contentHeight","pageY","railYHeight","scrollbarY","scrollbarYHeight","scrollTop","y","scrollbarYRail"])};function bindMouseScrollHandler(t,e){var o=e[0],i=e[1],n=e[2],s=e[3],a=e[4],l=e[5],r=e[6],h=e[7],c=e[8],d=t.element,p=null,u=null,f=null;function g(e){d[r]=p+f*(e[n]-u),addScrollingClass(t,h),updateGeometry(t),e.stopPropagation(),e.preventDefault()}function m(){removeScrollingClass(t,h),t[c].classList.remove(cls.state.clicking),t.event.unbind(t.ownerDocument,"mousemove",g)}t.event.bind(t[a],"mousedown",function(e){p=d[r],u=e[n],f=(t[i]-t[o])/(t[s]-t[l]),t.event.bind(t.ownerDocument,"mousemove",g),t.event.once(t.ownerDocument,"mouseup",m),t[c].classList.add(cls.state.clicking),e.stopPropagation(),e.preventDefault()})}var keyboard=function(t){var e=t.element;t.event.bind(t.ownerDocument,"keydown",function(o){if(!(o.isDefaultPrevented&&o.isDefaultPrevented()||o.defaultPrevented)&&(matches(e,":hover")||matches(t.scrollbarX,":focus")||matches(t.scrollbarY,":focus"))){var i=document.activeElement?document.activeElement:t.ownerDocument.activeElement;if(i){if("IFRAME"===i.tagName)i=i.contentDocument.activeElement;else for(;i.shadowRoot;)i=i.shadowRoot.activeElement;if(isEditable(i))return}var n=0,s=0;switch(o.which){case 37:n=o.metaKey?-t.contentWidth:o.altKey?-t.containerWidth:-30;break;case 38:s=o.metaKey?t.contentHeight:o.altKey?t.containerHeight:30;break;case 39:n=o.metaKey?t.contentWidth:o.altKey?t.containerWidth:30;break;case 40:s=o.metaKey?-t.contentHeight:o.altKey?-t.containerHeight:-30;break;case 32:s=o.shiftKey?t.containerHeight:-t.containerHeight;break;case 33:s=t.containerHeight;break;case 34:s=-t.containerHeight;break;case 36:s=t.contentHeight;break;case 35:s=-t.contentHeight;break;default:return}t.settings.suppressScrollX&&0!==n||t.settings.suppressScrollY&&0!==s||(e.scrollTop-=s,e.scrollLeft+=n,updateGeometry(t),function(o,i){var n=Math.floor(e.scrollTop);if(0===o){if(!t.scrollbarYActive)return!1;if(0===n&&i>0||n>=t.contentHeight-t.containerHeight&&i<0)return!t.settings.wheelPropagation}var s=e.scrollLeft;if(0===i){if(!t.scrollbarXActive)return!1;if(0===s&&o<0||s>=t.contentWidth-t.containerWidth&&o>0)return!t.settings.wheelPropagation}return!0}(n,s)&&o.preventDefault())}})},wheel=function(t){var e=t.element;function o(o){var i=function(t){var e=t.deltaX,o=-1*t.deltaY;return void 0!==e&&void 0!==o||(e=-1*t.wheelDeltaX/6,o=t.wheelDeltaY/6),t.deltaMode&&1===t.deltaMode&&(e*=10,o*=10),e!=e&&o!=o&&(e=0,o=t.wheelDelta),t.shiftKey?[-o,-e]:[e,o]}(o),n=i[0],s=i[1];if(!function(t,o,i){if(!env.isWebKit&&e.querySelector("select:focus"))return!0;if(!e.contains(t))return!1;for(var n=t;n&&n!==e;){if(n.classList.contains(cls.element.consuming))return!0;var s=get(n);if([s.overflow,s.overflowX,s.overflowY].join("").match(/(scroll|auto)/)){var a=n.scrollHeight-n.clientHeight;if(a>0&&!(0===n.scrollTop&&i>0||n.scrollTop===a&&i<0))return!0;var l=n.scrollWidth-n.clientWidth;if(l>0&&!(0===n.scrollLeft&&o<0||n.scrollLeft===l&&o>0))return!0}n=n.parentNode}return!1}(o.target,n,s)){var a=!1;t.settings.useBothWheelAxes?t.scrollbarYActive&&!t.scrollbarXActive?(s?e.scrollTop-=s*t.settings.wheelSpeed:e.scrollTop+=n*t.settings.wheelSpeed,a=!0):t.scrollbarXActive&&!t.scrollbarYActive&&(n?e.scrollLeft+=n*t.settings.wheelSpeed:e.scrollLeft-=s*t.settings.wheelSpeed,a=!0):(e.scrollTop-=s*t.settings.wheelSpeed,e.scrollLeft+=n*t.settings.wheelSpeed),updateGeometry(t),(a=a||function(o,i){var n=Math.floor(e.scrollTop),s=0===e.scrollTop,a=n+e.offsetHeight===e.scrollHeight,l=0===e.scrollLeft,r=e.scrollLeft+e.offsetWidth===e.scrollWidth;return!(Math.abs(i)>Math.abs(o)?s||a:l||r)||!t.settings.wheelPropagation}(n,s))&&!o.ctrlKey&&(o.stopPropagation(),o.preventDefault())}}void 0!==window.onwheel?t.event.bind(e,"wheel",o):void 0!==window.onmousewheel&&t.event.bind(e,"mousewheel",o)},touch=function(t){if(env.supportsTouch||env.supportsIePointer){var e=t.element,o={},i=0,n={},s=null;env.supportsTouch?(t.event.bind(e,"touchstart",h),t.event.bind(e,"touchmove",c),t.event.bind(e,"touchend",d)):env.supportsIePointer&&(window.PointerEvent?(t.event.bind(e,"pointerdown",h),t.event.bind(e,"pointermove",c),t.event.bind(e,"pointerup",d)):window.MSPointerEvent&&(t.event.bind(e,"MSPointerDown",h),t.event.bind(e,"MSPointerMove",c),t.event.bind(e,"MSPointerUp",d)))}function a(o,i){e.scrollTop-=i,e.scrollLeft-=o,updateGeometry(t)}function l(t){return t.targetTouches?t.targetTouches[0]:t}function r(t){return(!t.pointerType||"pen"!==t.pointerType||0!==t.buttons)&&(!(!t.targetTouches||1!==t.targetTouches.length)||!(!t.pointerType||"mouse"===t.pointerType||t.pointerType===t.MSPOINTER_TYPE_MOUSE))}function h(t){if(r(t)){var e=l(t);o.pageX=e.pageX,o.pageY=e.pageY,i=(new Date).getTime(),null!==s&&clearInterval(s)}}function c(s){if(r(s)){var h=l(s),c={pageX:h.pageX,pageY:h.pageY},d=c.pageX-o.pageX,p=c.pageY-o.pageY;if(function(t,o,i){if(!e.contains(t))return!1;for(var n=t;n&&n!==e;){if(n.classList.contains(cls.element.consuming))return!0;var s=get(n);if([s.overflow,s.overflowX,s.overflowY].join("").match(/(scroll|auto)/)){var a=n.scrollHeight-n.clientHeight;if(a>0&&!(0===n.scrollTop&&i>0||n.scrollTop===a&&i<0))return!0;var l=n.scrollLeft-n.clientWidth;if(l>0&&!(0===n.scrollLeft&&o<0||n.scrollLeft===l&&o>0))return!0}n=n.parentNode}return!1}(s.target,d,p))return;a(d,p),o=c;var u=(new Date).getTime(),f=u-i;f>0&&(n.x=d/f,n.y=p/f,i=u),function(o,i){var n=Math.floor(e.scrollTop),s=e.scrollLeft,a=Math.abs(o),l=Math.abs(i);if(l>a){if(i<0&&n===t.contentHeight-t.containerHeight||i>0&&0===n)return 0===window.scrollY&&i>0&&env.isChrome}else if(a>l&&(o<0&&s===t.contentWidth-t.containerWidth||o>0&&0===s))return!0;return!0}(d,p)&&s.preventDefault()}}function d(){t.settings.swipeEasing&&(clearInterval(s),s=setInterval(function(){t.isInitialized?clearInterval(s):n.x||n.y?Math.abs(n.x)<.01&&Math.abs(n.y)<.01?clearInterval(s):(a(30*n.x,30*n.y),n.x*=.8,n.y*=.8):clearInterval(s)},10))}},defaultSettings=function(){return{handlers:["click-rail","drag-thumb","keyboard","wheel","touch"],maxScrollbarLength:null,minScrollbarLength:null,scrollingThreshold:1e3,scrollXMarginOffset:0,scrollYMarginOffset:0,suppressScrollX:!1,suppressScrollY:!1,swipeEasing:!0,useBothWheelAxes:!1,wheelPropagation:!0,wheelSpeed:1}},handlers={"click-rail":clickRail,"drag-thumb":dragThumb,keyboard:keyboard,wheel:wheel,touch:touch},PerfectScrollbar=function(t,e){var o=this;if(void 0===e&&(e={}),"string"==typeof t&&(t=document.querySelector(t)),!t||!t.nodeName)throw new Error("no element is specified to initialize PerfectScrollbar");for(var i in this.element=t,t.classList.add(cls.main),this.settings=defaultSettings(),e)o.settings[i]=e[i];this.containerWidth=null,this.containerHeight=null,this.contentWidth=null,this.contentHeight=null;var n,s,a=function(){return t.classList.add(cls.state.focus)},l=function(){return t.classList.remove(cls.state.focus)};this.isRtl="rtl"===get(t).direction,this.isNegativeScroll=(s=t.scrollLeft,t.scrollLeft=-1,n=t.scrollLeft<0,t.scrollLeft=s,n),this.negativeScrollAdjustment=this.isNegativeScroll?t.scrollWidth-t.clientWidth:0,this.event=new EventManager,this.ownerDocument=t.ownerDocument||document,this.scrollbarXRail=div(cls.element.rail("x")),t.appendChild(this.scrollbarXRail),this.scrollbarX=div(cls.element.thumb("x")),this.scrollbarXRail.appendChild(this.scrollbarX),this.scrollbarX.setAttribute("tabindex",0),this.event.bind(this.scrollbarX,"focus",a),this.event.bind(this.scrollbarX,"blur",l),this.scrollbarXActive=null,this.scrollbarXWidth=null,this.scrollbarXLeft=null;var r=get(this.scrollbarXRail);this.scrollbarXBottom=parseInt(r.bottom,10),isNaN(this.scrollbarXBottom)?(this.isScrollbarXUsingBottom=!1,this.scrollbarXTop=toInt(r.top)):this.isScrollbarXUsingBottom=!0,this.railBorderXWidth=toInt(r.borderLeftWidth)+toInt(r.borderRightWidth),set(this.scrollbarXRail,{display:"block"}),this.railXMarginWidth=toInt(r.marginLeft)+toInt(r.marginRight),set(this.scrollbarXRail,{display:""}),this.railXWidth=null,this.railXRatio=null,this.scrollbarYRail=div(cls.element.rail("y")),t.appendChild(this.scrollbarYRail),this.scrollbarY=div(cls.element.thumb("y")),this.scrollbarYRail.appendChild(this.scrollbarY),this.scrollbarY.setAttribute("tabindex",0),this.event.bind(this.scrollbarY,"focus",a),this.event.bind(this.scrollbarY,"blur",l),this.scrollbarYActive=null,this.scrollbarYHeight=null,this.scrollbarYTop=null;var h=get(this.scrollbarYRail);this.scrollbarYRight=parseInt(h.right,10),isNaN(this.scrollbarYRight)?(this.isScrollbarYUsingRight=!1,this.scrollbarYLeft=toInt(h.left)):this.isScrollbarYUsingRight=!0,this.scrollbarYOuterWidth=this.isRtl?outerWidth(this.scrollbarY):null,this.railBorderYWidth=toInt(h.borderTopWidth)+toInt(h.borderBottomWidth),set(this.scrollbarYRail,{display:"block"}),this.railYMarginHeight=toInt(h.marginTop)+toInt(h.marginBottom),set(this.scrollbarYRail,{display:""}),this.railYHeight=null,this.railYRatio=null,this.reach={x:t.scrollLeft<=0?"start":t.scrollLeft>=this.contentWidth-this.containerWidth?"end":null,y:t.scrollTop<=0?"start":t.scrollTop>=this.contentHeight-this.containerHeight?"end":null},this.isAlive=!0,this.settings.handlers.forEach(function(t){return handlers[t](o)}),this.lastScrollTop=Math.floor(t.scrollTop),this.lastScrollLeft=t.scrollLeft,this.event.bind(this.element,"scroll",function(t){return o.onScroll(t)}),updateGeometry(this)};PerfectScrollbar.prototype.update=function(){this.isAlive&&(this.negativeScrollAdjustment=this.isNegativeScroll?this.element.scrollWidth-this.element.clientWidth:0,set(this.scrollbarXRail,{display:"block"}),set(this.scrollbarYRail,{display:"block"}),this.railXMarginWidth=toInt(get(this.scrollbarXRail).marginLeft)+toInt(get(this.scrollbarXRail).marginRight),this.railYMarginHeight=toInt(get(this.scrollbarYRail).marginTop)+toInt(get(this.scrollbarYRail).marginBottom),set(this.scrollbarXRail,{display:"none"}),set(this.scrollbarYRail,{display:"none"}),updateGeometry(this),processScrollDiff(this,"top",0,!1,!0),processScrollDiff(this,"left",0,!1,!0),set(this.scrollbarXRail,{display:""}),set(this.scrollbarYRail,{display:""}))},PerfectScrollbar.prototype.onScroll=function(t){this.isAlive&&(updateGeometry(this),processScrollDiff(this,"top",this.element.scrollTop-this.lastScrollTop),processScrollDiff(this,"left",this.element.scrollLeft-this.lastScrollLeft),this.lastScrollTop=Math.floor(this.element.scrollTop),this.lastScrollLeft=this.element.scrollLeft)},PerfectScrollbar.prototype.destroy=function(){this.isAlive&&(this.event.unbindAll(),remove(this.scrollbarX),remove(this.scrollbarY),remove(this.scrollbarXRail),remove(this.scrollbarYRail),this.removePsClasses(),this.element=null,this.scrollbarX=null,this.scrollbarY=null,this.scrollbarXRail=null,this.scrollbarYRail=null,this.isAlive=!1)},PerfectScrollbar.prototype.removePsClasses=function(){this.element.className=this.element.className.split(" ").filter(function(t){return!t.match(/^ps([-_].+|)$/)}).join(" ")},$.fn.extend({animateCss:function(t,e){var o="webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend";this.addClass("animated "+t).one(o,function(o){$(this).removeClass("animated "+t),e&&e()}).children().on(o,function(t){t.stopPropagation()})}}),window.Cool=window.Cool||{},window.Cool.settings=window.Cool.settings||{};var Common=function(){function t(){}return t.refresh=function(){$(".form-label-group").each(function(t,e){$(e).find("input, select").val()?$(e).addClass("label-on-top"):$(e).removeClass("label-on-top")})},t.initialize=function(t){t=t||{},window.Cool.settings=t,$('[data-toggle="popover"]').coolPopover(t.popover),$('[data-toggle="select"]').coolSelect(t.select),$('[data-toggle="dropdown"]').coolDropdown(t.dropdown),$('[data-toggle="tooltip"]').coolTooltip(t.tooltip),$('[data-toggle="collapse"]').coolCollapse(t.collapse),$('[data-toggle="section-tabs"]').coolSectionTabs(t.sectionTabs),$("body").coolToast(t.toast),$("body").coolDialog(t.dialog),$("html").addClass("dom-ready"),$(document).on("focus",".form-control",function(){if(!$(this).hasClass("disabled")&&$(this).not(":disabled")&&!$(this).attr("readonly")){var t=$(this).closest(".input-group");t.hasClass("input-group-focus")||t.addClass("input-group-focus")}}),$(document).on("blur",".form-control",function(){if(!$(this).hasClass("disabled")&&$(this).not(":disabled")&&!$(this).attr("readonly")){var t=$(this).closest(".input-group");t.hasClass("input-group-focus")&&t.removeClass("input-group-focus")}}),$(document).on("blur input change",".form-label-group",function(){$(this).find("input, select").val()?$(this).addClass("label-on-top"):$(this).removeClass("label-on-top")}),$(".form-label-group").each(function(t,e){$(e).find("input, select").val()?$(e).addClass("label-on-top"):$(e).removeClass("label-on-top")}),$.each($(".table"),function(){$(this).find("[data-table-link], [data-table-btn]").length&&!$(this).hasClass("table-hover")&&$(this).addClass("table-hover")}),$(document).on("click","[data-table-link] .table-link-exclude, [data-table-link] input, [data-table-link] button, [data-table-link] a, [data-table-link] label, [data-table-link] .td-col-select",function(t){t.stopPropagation()}),$(document).on("click","[data-table-link]",function(t){var e=$(this).parents("table, .table"),o=$(this).data("tableLink");e.hasClass("bulk-actions-active")||(t.ctrlKey||t.metaKey?window.open(o,"_blank"):window.location.href=o)}),$(document).on("click","[data-table-btn] .table-btn-exclude, [data-table-btn] input, [data-table-btn] button, [data-table-btn] a, [data-table-btn] label, [data-table-btn] .td-col-select",function(t){t.stopPropagation()}),$(document).on("click","[data-table-btn]",function(t){var e=$(this).parents("table, .table"),o=$(this).data("tableButton");(o||(o=e.find("button")[0]))&&(e.hasClass("bulk-actions-active")||$(o).click())}),$(document).on("click",".btn-group-toggle .btn > input",function(t){t.stopPropagation()}),$(document).on("click",".btn-group-toggle .btn",function(){$(this).find("input").trigger("click"),$(this).parent().find("input").trigger("change")}),$(document).on("change",".btn-group-toggle .btn > input",function(){$(this).is(":checked")?$(this).parent().addClass("active"):$(this).parent().removeClass("active")}),$("select").on("change",function(){$(this).blur()}),$(".tab-toggler").on("click",function(t){t.stopPropagation(),$(this).parent().toggleClass("open")}),$(document).on("click",function(){$(".tabs-container").removeClass("open")}),$(".sidebar-left-toggler").on("click",function(t){t.stopPropagation(),$(this).toggleClass("open"),$("body").toggleClass("sidebar-left-open")}),$(".sidebar-right-toggler").on("click",function(t){t.stopPropagation(),$(this).toggleClass("open"),$("body").toggleClass("sidebar-right-open")}),$(".sidebar-content .ps__thumb-y").mousedown(function(){$(this).parent().parent().addClass("ps-mousedown-scroll")}),$(document).mouseup(function(){$(".sidebar-content").hasClass("ps-mousedown-scroll")&&$(".sidebar-content").removeClass("ps-mousedown-scroll")});var e=$(".sidebar-left").find(".sidebar-content");if(e.length){var o=new PerfectScrollbar(e[0],{wheelSpeed:2,wheelPropagation:!0,minScrollbarLength:20,suppressScrollX:!0});e.find('[data-toggle="collapse"]').on("click",function(t){if($(this).data("breakpoint")&&window.matchMedia("(min-width: "+$(this).data("breakpoint")+"px)").matches){var e=$(this).next().find("li").first().children("a").first();e&&(window.location.href=e.attr("href"))}else setTimeout(function(){o.update()},300)})}var i=$(document).find(".sidebar-tab");i.length&&($.each(i,function(t,e){var o=$(e).find(".tab-content");new PerfectScrollbar(o[0],{wheelSpeed:2,wheelPropagation:!0,minScrollbarLength:20,suppressScrollX:!0})}),$('[name="sidebar-tab-select"]').on("click",function(){var t=$(this).val(),e=$("#sidebar-tab-"+t);i.not(e).removeClass("active"),e.addClass("active"),$('[name="sidebar-tab-select"]').not($(this)).removeClass("active"),$(this).addClass("active"),e[0]==i.first()[0]?i.not(e).find(".tab-content").css({transform:"translate3d(100%, 0px, 0px)"}):e[0]==i.last()[0]?i.not(e).find(".tab-content").css({transform:"translate3d(-100%, 0px, 0px)"}):(i.first().not(e).find(".tab-content").css({transform:"translate3d(-100%, 0px, 0px)"}),i.last().not(e).find(".tab-content").css({transform:"translate3d(100%, 0px, 0px)"})),e.find(".tab-content").css({transform:"none"})}))},t}();function _inheritsLoose(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}window.Cool.initialize=Common.initialize,window.Cool.refresh=Common.refresh;var debounce=function(t,e,o){var i;return function(){var n=this,s=arguments,a=o&&!i;clearTimeout(i),i=setTimeout(function(){i=null,o||t.apply(n,s)},e),a&&t.apply(n,s)}},touchEvents=function(){var t=!1;return("ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch)&&(t=!0),t};$.event.special.destroyed={remove:function(t){t.handler&&t.handler()}};var AbstractUIComponent=function(){function t(){}var e=t.prototype;return e.onInit=function(){var t=this.opts.onInit;"function"==typeof t&&t.call(this)},e.onUpdate=function(){var t=this.opts.onUpdate;"function"==typeof t&&t.call(this)},e.onDestroy=function(){var t=this.opts.onDestroy;"function"==typeof t&&t.call(this)},e.onShow=function(){var t=this.opts.onShow;"function"==typeof t&&t.call(this)},e.onClose=function(){var t=this.opts.onClose;"function"==typeof t&&t.call(this)},e.onReset=function(){var t=this.opts.onReset;"function"==typeof t&&t.call(this)},e.log=function(){var t;this.debug&&("function"==typeof this.debug?this.debug.apply(this,arguments):(t=console).log.apply(t,arguments))},t}(),NAME="coolPopover",DATA_KEY="plugin_coolPopover",Popover=function(t){function e(e,o){var i;return(i=t.call(this)||this).opts={},window.Cool.settings.popover?$.extend(!0,i.opts,$.fn[NAME].defaults,window.Cool.settings.popover,o):$.extend(!0,i.opts,$.fn[NAME].defaults,o),i.el=e,i.debug=i.opts.debug,i.init(),i}_inheritsLoose(e,t);var o=e.prototype;return o.init=function(){this.buildCache(),this.bindEvents(),this.onInit()},o.destroy=function(){this.unbindEvents(),this.$el.removeData(DATA_KEY),this.onDestroy()},o.update=function(){this.buildCache(),this.onUpdate()},o.buildCache=function(){this.$el=$(this.el),this.$container=this.$el.data("container")?$(this.$el.data("container")):$(this.opts.container),this.containerAutoDetect=this.$el.data("containerAutoDetect")?this.$el.data("containerAutoDetect"):this.opts.containerAutoDetect,this.id="popover-"+this.generateUUID(),this.animation=this.$el.data("animation")?this.$el.data("animation"):this.opts.animation,this.animationIn=this.$el.data("animationIn")?this.$el.data("animationIn"):this.opts.animationIn,this.animationOut=this.$el.data("animationOut")?this.$el.data("animationOut"):this.opts.animationOut,this.animationSpeed=this.$el.data("animationSpeed")?this.$el.data("animationSpeed"):this.opts.animationSpeed,this.trigger=this.$el.data("trigger")?this.$el.data("trigger"):this.opts.trigger,this.placement=this.$el.data("placement")?this.$el.data("placement"):this.opts.placement,this.placementChanged=!1,this.title=this.$el.data("title")?this.$el.data("title"):this.opts.title,this.content=this.$el.data("content")?this.$el.data("content"):this.opts.content,this.containerAutoDetect&&(this.$container=this.$el.offsetParent())},o.bindEvents=function(){var t=this;"click"===this.trigger?this.$el.on("click."+NAME,function(){t.$popover?t.close():t.show()}):"hover"===this.trigger?(this.$el.on("mouseenter."+NAME,function(){t.show()}),this.$el.on("mouseleave."+NAME,debounce(function(){t.popupHasFocus||t.close()},500))):"focus"===this.trigger&&(this.$el.on("focusin."+NAME,function(){t.show()}),this.$el.on("focusout."+NAME,function(){t.close()})),$(window).on("resize",debounce(function(){t.$popover&&(t.setPosition(),t.onUpdate())},250))},o.unbindEvents=function(){this.$el.off("."+NAME)},o.generateUUID=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var e=16*Math.random()|0;return("x"==t?e:3&e|8).toString(16)})},o.buildPopover=function(){var t,e=this;t="function"==typeof this.content?this.content():this.content,this.$popover=$('\n \t\t<div class="popover" role="tooltip" id="'+this.id+'">\n\n\t\t\t <div class="arrow"></div>\n\n\t\t\t <h3 class="popover-header">'+this.title+'</h3>\n\n\t\t\t <div class="popover-body">'+t+"</div>\n\n\t\t\t</div>\n \t"),this.$container.append(this.$popover),this.$container.find("#"+this.id).on("mouseenter",function(){e.popupHasFocus=!0}),this.$container.find("#"+this.id).on("mouseleave",function(){e.popupHasFocus=!1,e.close()}),this.$arrow=!!this.$popover.find(".arrow")&&this.$popover.find(".arrow"),this.log(this.$el),this.log(this.$container),this.log(this.$popover),this.log(this.$arrow),this.log("Id: "+this.id),this.log("Trigger: "+this.trigger),this.log("Placement: "+this.placement),this.log("Animation: "+this.animation),this.log("Animation in: "+this.animationIn),this.log("Animation out: "+this.animationOut),this.log("Animation speed: "+this.animationSpeed),this.log("Title: "+this.title),this.log("Content: "+this.content)},o.setPosition=function(t){null==t&&(t=this.placement),this.$popover.addClass("popover-"+t);var e,o,i,n=this.$container.innerWidth(),s=this.$container.innerHeight(),a=this.$popover.outerWidth(!0),l=this.$popover.outerHeight(!0),r=this.$el.outerWidth(),h=this.$el.outerHeight(),c=this.$el.position().left,d=this.$el.position().top,p=this.$arrow.outerWidth(!0),u=this.$arrow.outerHeight(!0);"top"===t?(o=Math.round(c-(a-r)/2),i=Math.round(d-l),e=Math.round(a/2-p/2),this.$arrow.css({left:e+"px"})):"right"===t?(o=Math.round(c+r),i=Math.round(d-(l-h)/2),e=Math.round(l/2-u/2),this.$arrow.css({top:e+"px"})):"bottom"===t?(o=Math.round(c-(a-r)/2),i=Math.round(d+h),e=Math.round(a/2-p/2),this.$arrow.css({left:e+"px"})):"left"===t&&(o=Math.round(c-a),i=Math.round(d-(l-h)/2),e=Math.round(l/2-u/2),this.$arrow.css({top:e+"px"})),this.$popover.css({position:"absolute",top:"0px",left:"0px",transform:"translate3d("+o+"px, "+i+"px, 0px)","will-change":"transform"});var f=0,g={left:this.$popover.position().left,top:this.$popover.position().top,right:n-(this.$popover.position().left+a),bottom:s-(this.$popover.position().top+l)},m={left:!1,top:!1,right:!1,bottom:!1};if(g.right<0&&(m.right=!0,f++,this.log("Popover overflowing from right")),g.left<0&&(m.left=!0,f++,this.log("Popover overflowing from left")),g.bottom<0&&(m.bottom=!0,f++,this.log("Popover overflowing from bottom")),g.top<0&&(m.top=!0,f++,this.log("Popover overflowing from top")),f>0){if(!this.placementChanged&&m.left&&g.right>a?(this.log("Changing popover placement to right"),this.placementChanged=!0,this.$popover.removeClass("popover-"+t),this.$arrow.removeAttr("style"),this.setPosition("right")):!this.placementChanged&&m.top&&g.top>l?(this.log("Changing popover placement to bottom"),this.placementChanged=!0,this.$popover.removeClass("popover-"+t),this.$arrow.removeAttr("style"),this.setPosition("bottom")):!this.placementChanged&&m.right&&g.left>a?(this.log("Changing popover placement to left"),this.placementChanged=!0,this.$popover.removeClass("popover-"+t),this.$arrow.removeAttr("style"),this.setPosition("left")):!this.placementChanged&&m.bottom&&g.top>l?(this.log("Changing popover placement to top"),this.placementChanged=!0,this.$popover.removeClass("popover-"+t),this.$arrow.removeAttr("style"),this.setPosition("top")):this.placementChanged||"top"===t&&"bottom"===t||!m.left&&!m.right?this.fixPopoverPosition=!0:g.top>g.bottom?(this.log("Changing popover placement to top"),this.placementChanged=!0,this.$popover.removeClass("popover-"+t),this.$arrow.removeAttr("style"),this.setPosition("top")):(this.log("Changing popover placement to bottom"),this.placementChanged=!0,this.$popover.removeClass("popover-"+t),this.$arrow.removeAttr("style"),this.setPosition("bottom")),this.fixPopoverPosition){if(this.log("Adjusting popover size or position in order to popover fit in the container"),m.left){this.log("Popover overflowing from left");var $=Math.abs(g.left);c>=o+$&&["top","bottom"].indexOf(t)<0?(this.log("Popover adjusting width"),a-=$,o+=$):(this.log("Popover adjusting position x"),o+=$,e-=$)}if(m.top){this.log("Popover overflowing from top");var v=Math.abs(g.top);this.log("Popover adjusting position y"),i+=v,e-=v}if(m.right){this.log("Popover overflowing from right");var b=Math.abs(g.right);c<=o-b&&["top","bottom"].indexOf(t)<0?(this.log("Popover adjusting width"),a-=b):(this.log("Popover adjusting position x"),o-=b,e+=b)}if(m.bottom){this.log("Popover overflowing from bottom");var w=Math.abs(g.bottom);this.log("Popover adjusting position y"),i-=w,e+=w}"top"===t?this.$arrow.css({left:e+"px"}):"right"===t?this.$arrow.css({top:e+"px"}):"bottom"===t?this.$arrow.css({left:e+"px"}):"left"===t&&this.$arrow.css({top:e+"px"}),this.$popover.css({width:a,transform:"translate3d("+o+"px, "+i+"px, 0px)"}),this.fixPopoverPosition=!1,this.log("Popover placement changed: "+this.placementChanged),this.log("Popover container inner width: "+n+"px"),this.log("Popover container inner height: "+s+"px"),this.log("Popover trigger width: "+r+"px"),this.log("Popover trigger height: "+h+"px"),this.log("popover trigger position x: "+c+"px"),this.log("Popover trigger position Y: "+d+"px"),this.log("Popover width: "+a+"px"),this.log("Popover height: "+l+"px"),this.log("Popover position x: "+o+"px"),this.log("Popover position y: "+i+"px"),this.log("Popover position left: "+g.left+"px"),this.log("Popover position top: "+g.top+"px"),this.log("Popover position right: "+g.right+"px"),this.log("Popover position bottom: "+g.bottom+"px")}}else this.log("Popover placement changed: "+this.placementChanged),this.log("Popover container inner width: "+n+"px"),this.log("Popover container inner height: "+s+"px"),this.log("Popover trigger width: "+r+"px"),this.log("Popover trigger height: "+h+"px"),this.log("popover trigger position x: "+c+"px"),this.log("Popover trigger position Y: "+d+"px"),this.log("Popover width: "+a+"px"),this.log("Popover height: "+l+"px"),this.log("Popover position x: "+o+"px"),this.log("Popover position y: "+i+"px"),this.log("Popover position left: "+g.left+"px"),this.log("Popover position top: "+g.top+"px"),this.log("Popover position right: "+g.right+"px"),this.log("Popover position bottom: "+g.bottom+"px")},o.show=function(){this.$popover||(this.buildPopover(),this.setPosition(),this.animation?(this.$popover.addClass(this.animationSpeed),this.$popover.animateCss(this.animationIn),this.$popover.addClass("show"),this.$popover.attr("id",this.id),this.$el.attr("data-popover",this.id)):(this.$popover.addClass("show"),this.$popover.attr("id",this.id),this.$el.attr("data-popover",this.id)),this.onShow())},o.close=function(){var t=this;this.$popover&&(this.animation&&!this.$popover.hasClass("animated")?this.$popover.animateCss(this.animationOut,function(){t.$popover.remove(),t.$el.removeAttr("data-popover"),t.$popover=null,t.placementChanged=!1,t.onClose()}):(this.$popover.remove(),this.$el.removeAttr("data-popover"),this.$popover=null,this.placementChanged=!1,this.onClose()))},e._jQueryInterface=function(t){return this.each(function(){var o=$(this).data(DATA_KEY);if(o||(o=new e(this,"object"==typeof t&&t),$(this).data(DATA_KEY,o)),"string"==typeof t){if(void 0===o[t])throw new TypeError('No method named "'+t+'"');o[t]()}})},e}(AbstractUIComponent);if("undefined"!=typeof $){var JQUERY_NO_CONFLICT=$.fn[NAME];$.fn[NAME]=Popover._jQueryInterface,$.fn[NAME].Constructor=Popover,$.fn[NAME].noConflict=function(){return $.fn[NAME]=JQUERY_NO_CONFLICT,Popover._jQueryInterface},$.fn[NAME].defaults={container:".content-inner",containerAutoDetect:!1,trigger:"focus",placement:"bottom",animation:!0,animationIn:"fadeIn",animationOut:"fadeOut",animationSpeed:"fastest",title:"",content:"",onInit:null,onUpdate:null,onDestroy:null,onShow:null,onClose:null,debug:!1}}var NAME$1="coolSelect",DATA_KEY$1="plugin_coolSelect",Select=function(t){function e(e,o){var i;return(i=t.call(this)||this).opts={},window.Cool.settings.select?$.extend(!0,i.opts,$.fn[NAME$1].defaults,window.Cool.settings.select,o):$.extend(!0,i.opts,$.fn[NAME$1].defaults,o),i.el=e,i.debug=i.opts.debug,i.init(),i}_inheritsLoose(e,t);var o=e.prototype;return o.init=function(){var t=this;this.buildCache().then(function(){t.buildScroll(),t.bindEvents(),t.data[t.name].length>0&&t.setData(),t.onInit()})},o.destroy=function(){this.unbindEvents(),this.$el.removeData(DATA_KEY$1),this.onDestroy()},o.update=function(){this.buildCache(),this.bindEvents(),this.onUpdate()},o.reset=function(){this.data={},this.data[this.name]=[],this.items=[],this.$select.find(".select-item").remove(),this.$selectItems=[],this.$selectIconContainer.html(this.selectIconDefault),this.$selectHeader.removeClass("select-placeholder"),0==this.data[this.name].length&&this.dynamicTitle&&this.dynamicTitleDefault&&0!==this.dynamicTitleDefault&&0==this.$selectTitle.text().trim()&&(this.$selectItems.length>0||this.searchApi)&&this.$selectTitle.html(this.dynamicTitleDefault),0==this.$selectItems.length&&!this.searchApi&&this.dynamicTitle&&this.dynamicTitleEmptyDefault&&0!==this.dynamicTitleEmptyDefault&&(this.$selectHeader.addClass("select-placeholder"),this.$selectIconContainer.addClass("d-none"),this.$selectTitle.html(this.dynamicTitleEmptyDefault)),this.showSearch&&(this.searchData=[],this.$searchInput.val(""),this.searchString="",this.search.call(this))},o.buildCache=function(){var t=this;return new Promise(function(e,o){var i=t;if(t.$el=$(t.el),t.$container=t.$el.parent(),t.$selectHeader=t.$el.find(".select-header"),t.$selectTitle=t.$el.find(".select-title"),t.$selectIconContainer=t.$selectHeader.find(".select-icon"),t.selectIconDefault=t.$selectHeader.find(".select-icon")?t.$selectHeader.find(".select-icon").html():'<i class="'+(t.opts.faPro?"fal":"fas")+'fa-angle-down icon"></i>',t.name=t.$el.data("name")?t.$el.data("name"):t.opts.name,t.scrollContentHeight=t.$el.data("scrollContentHeight")?t.$el.data("scrollContentHeight"):t.opts.scrollContentHeight,t.items=t.$el.data("items")?t.$el.data("items"):t.opts.items,t.data={},t.data[t.name]=[],t.searchData=[],t.searchApi=t.$el.data("searchApi")?t.$el.data("searchApi"):t.opts.searchApi,t.searchRequest=null,t.type=t.$el.data("type")?t.$el.data("type"):t.opts.type,t.contentOpen=!1,t.searchPlaceholder=t.$el.data("search-placeholder")?t.$el.data("search-placeholder"):t.opts.searchPlaceholder,t.btnCloseText=t.$el.data("btn-close-text")?t.$el.data("btn-close-text"):t.opts.btnCloseText,t.labelTemplate=t.opts.labelTemplate,t.confirmCheck=t.opts.confirmCheck,t.confirmUncheck=t.opts.confirmUncheck,t.preventUncheck=t.opts.preventUncheck,t.dynamicTitle=t.$el.data("dynamicTitle")?t.$el.data("dynamicTitle"):t.opts.dynamicTitle,t.dynamicTitleDefault=t.$el.data("dynamicTitleDefault")?t.$el.data("dynamicTitleDefault"):t.opts.dynamicTitleDefault,t.dynamicTitleEmptyDefault=t.$el.data("dynamicTitleEmptyDefault")?t.$el.data("dynamicTitleEmptyDefault"):t.opts.dynamicTitleEmptyDefault,t.allowNoneOnRadioSelect=t.$el.data("allowNoneOnRadioSelect")?t.$el.data("allowNoneOnRadioSelect"):t.opts.allowNoneOnRadioSelect,t.showValidStateIcon=t.$el.data("showValidStateIcon")?t.$el.data("showValidStateIcon"):t.opts.showValidStateIcon,t.itemsToExclude=t.$el.data("itemsToExclude")?t.$el.data("itemsToExclude").replace(/\s/g,"").split(","):t.opts.itemsToExclude,t.primaryKeyword=t.$el.data("primaryKeyword")?t.$el.data("primaryKeyword"):t.opts.primaryKeyword,t.preventClose=!1,t.itemsToExclude.length>0&&(t.itemsToExclude=t.itemsToExclude.map(String)),t.opts.setData&&(t.data=t.opts.setData),t.$el.data("setData")&&""!=t.$el.data("setData")&&(t.data=t.$el.data("setData")),!Array.isArray(t.data[t.name])&&""!==t.data[t.name]&&t.data[t.name].length>0){var n=t.data[t.name].toString().trim().split(",");t.data[t.name]=n}t.data[t.name].length>0&&(t.data[t.name]=t.data[t.name].map(String)),t.data[t.name].length>0&&t.itemsToExclude.length>0&&(t.data[t.name]=t.data[t.name].filter(function(t){return t[i.primaryKeyword]?-1===i.itemsToExclude.indexOf(t[i.primaryKeyword].toString()):-1===i.itemsToExclude.indexOf(t.toString())})),t.items.length>0&&t.itemsToExclude.length>0&&(t.items=t.items.filter(function(t){return t[i.primaryKeyword]?-1===i.itemsToExclude.indexOf(t[i.primaryKeyword].toString()):-1===i.itemsToExclude.indexOf(t.toString())})),t.$el.find(".select-search").length?t.showSearch=!0:t.showSearch=t.$el.data("showSearch")?t.$el.data("showSearch"):t.opts.showSearch,t.$el.find(".select-footer").length?t.showFooter=!0:t.showFooter=t.$el.data("showFooter")?t.$el.data("showFooter"):t.opts.showFooter,t.$select=t.$el.find(".select-content"),new Promise(function(e,o){if(t.$select.length){var n=t.$select.find(".select-item");n.length>0&&t.itemsToExclude.length>0&&$.each(n,function(t,e){var o=$(e).find(":input").val();i.itemsToExclude.indexOf(o)>-1&&$(e).remove()}),e()}else{var s=t._renderItemList(t.items);t.$select=$('\n <div class="select-content">\n\n '+t._renderSearch()+'\n\n <div class="select-scrollable-content"></div>\n\n '+t._renderFooter()+"\n\n </div>\n "),t.$el.append(t.$select),t.$select.find(".select-scrollable-content").append(s),e()}}).then(function(){t.$scrollableContent=!!t.$select.find(".select-scrollable-content")&&t.$select.find(".select-scrollable-content"),t.$selectItems=t.$select.find(".select-item"),t.$selectHeader.removeClass("select-placeholder"),0==t.data[t.name].length&&t.dynamicTitle&&t.dynamicTitleDefault&&0!==t.dynamicTitleDefault&&0==t.$selectTitle.text().trim()&&(t.$selectItems.length>0||t.searchApi)&&t.$selectTitle.html(t.dynamicTitleDefault),0==t.$selectItems.length&&!t.searchApi&&t.dynamicTitle&&t.dynamicTitleEmptyDefault&&0!==t.dynamicTitleEmptyDefault&&(t.$selectHeader.addClass("select-placeholder"),t.$selectIconContainer.addClass("d-none"),t.$selectTitle.html(t.dynamicTitleEmptyDefault)),t.showSearch&&(t.$searchContainer=t.$select.find(".select-search"),t.$searchInput=t.$select.find('[name="select-search"]'),t.$searchIconContainer=t.$select.find(".select-search-icon"),t.$clearSearchButton=t.$select.find("[data-clear-search]"),t.$searchInput[0].tabIndex=-1),t.showFooter&&(t.$footerContainer=t.$select.find(".select-footer"),t.$closeButton=t.$select.find("[data-select-close]"),t.$closeButton[0].tabIndex=-1),t.buildSearchData(),t.log(t.$el),t.log(t.$select),t.log(t.$scrollableContent),t.log("Name: "+t.name),t.log("Show search: "+t.showSearch),t.log("Show footer: "+t.showFooter),t.log("Scroll content height: "+t.scrollContentHeight+"px"),t.log(t.items),t.log(t.searchData),e()})})},o.buildScroll=function(){if(this.$scrollableContent.length>0){var t=this.scrollContentHeight;this.showSearch&&(t-=this.$searchContainer.outerHeight(!0)||0),this.showFooter&&(t-=this.$footerContainer.outerHeight(!0)||0),this.$scrollableContent.css({"max-height":t-parseInt(this.$scrollableContent.css("marginTop"),10)-parseInt(this.$scrollableContent.css("marginBottom"),10)+"px"}),touchEvents()?this.$scrollableContent.css({"overflow-y":"auto"}):(this.$scrollableContent.addClass("ps-dark"),this.scroll=new PerfectScrollbar(this.$scrollableContent[0],{wheelSpeed:1,wheelPropagation:!1,minScrollbarLength:20,scrollYMarginOffset:-1,suppressScrollY:!0,suppressScrollX:!0}),this.$scrollableContent.find('[tabindex="0"]').attr("tabindex",-1),this.$scrollableContent[0].offsetHeight<this.$scrollableContent[0].scrollHeight&&(this.$scrollableContent.addClass("ps-show-rail-y"),this.scroll.settings.suppressScrollY=!1))}},o.buildSearchData=function(){var t=this;return new Promise(function(e,o){t.searchData=[];var i=t.$select.find("[data-label]");$.each(i,function(e,o){t.searchData.push({id:e,val:$(o).text().trim()})}),e()})},o.bindEvents=function(){var t=this,e=this;this.$selectHeader.on("click."+NAME$1,function(){t.contentOpen?t.close():(t.$selectItems.length>0||t.searchApi)&&t.show()}),this.$el.on("change."+NAME$1,'input[type="checkbox"]',function(){var t=this,o=$(this).val();e.preventClose=!0,"function"==typeof e.confirmCheck&&t.checked?(t.checked=!1,e.confirmCheck(function(i){"confirmed"==i&&(-1===e.data[e.name].indexOf(o)&&e.data[e.name].push(o),t.checked=!0,e.onSelect(t)),setTimeout(function(){e.preventClose=!1},600)},t)):t.checked?(-1===e.data[e.name].indexOf(o)&&e.data[e.name].push(o),e.onSelect(t),setTimeout(function(){e.preventClose=!1},600)):"function"!=typeof e.confirmUncheck||t.checked?t.checked||e.preventUncheck?!t.checked&&e.preventUncheck&&(t.checked=!0,setTimeout(function(){e.preventClose=!1},600)):(e.data[e.name]=e.data[e.name].filter(function(t){return t!=o}),e.onSelect(t),setTimeout(function(){e.preventClose=!1},600)):(t.checked=!0,e.confirmUncheck(function(i){"confirmed"==i&&(e.data[e.name]=e.data[e.name].filter(function(t){return t!=o}),t.checked=!1,e.onSelect(t)),setTimeout(function(){e.preventClose=!1},600)},t))}),this.$el.on("change."+NAME$1,'input[type="radio"]',function(){var t=$(this).val();this.checked?(e.data[e.name]=[t],e.$select.find('input[type="radio"]').not($(this)).prop("checked",!1),e.$select.find('input[type="radio"]').not($(this)).removeClass("checked")):e.data[e.name]=[]}),this.$el.on("click."+NAME$1,'input[type="radio"]',function(){$(this).hasClass("checked")&&e.allowNoneOnRadioSelect?(e.data[e.name]=[],$(this).prop("checked",!1),$(this).removeClass("checked"),e.dynamicTitle&&e.$selectTitle.html(e.dynamicTitleDefault)):($(this).addClass("checked"),e.dynamicTitle&&e.$selectTitle.html($(this).parent().find("[data-label]").text())),e.onSelect(this)}),this.scroll&&(this.$scrollableContent.find(".ps__thumb-y").mousedown(function(){e.$scrollableContent.addClass("ps-mousedown-scroll")}),$(document).mouseup(function(){e.$scrollableContent.hasClass("ps-mousedown-scroll")&&e.$scrollableContent.removeClass("ps-mousedown-scroll")})),this.showSearch&&(this.$searchInput.on("keydown."+NAME$1,debounce(function(){e.searchString=$(this).val().trim(),e.search.call(e)},250)),this.$searchInput.on("focusin."+NAME$1,function(){e.$searchContainer.addClass("focused")}),this.$searchInput.on("focusout."+NAME$1,function(){e.$searchContainer.removeClass("focused")}),this.$searchContainer.on("click."+NAME$1,"[data-clear-search]",function(){e.searchString.length&&(e.$searchInput.val(""),e.searchString="",e.search.call(e))})),this.showFooter&&this.$closeButton.on("click."+NAME$1,function(){t.close()}),$(document).on("touchstart click",function(t){e.$el.is(t.target)||e.$el.has(t.target).length||!e.contentOpen||e.preventClose||e.close.call(e)})},o.unbindEvents=function(){this.$el.off("."+NAME$1)},o.getData=function(t){return t?this.data[t]:this.data},o.setData=function(){var t=this,e=this.opts.faPro?"fal":"fas";if(this.showValidStateIcon?this.$selectIconContainer.html('<i class="'+e+' fa-check text-success icon"></i>'):this.$selectIconContainer.html(this.selectIconDefault),this.searchApi.length){var o=this.searchApi,i=this.data[this.name].length,n=0;this.data[this.name].forEach(function(t){o+=encodeURIComponent("#"+t),++n!==i&&(o+="+")}),$.ajax({method:"GET",url:o}).done(function(e){var o=e.map(function(e){return e.id=e[t.primaryKeyword].toString(),e}),i=o.map(function(t){return t.id.toString()});t.data[t.name]=t.data[t.name].filter(function(t){return i.indexOf(t.toString())>-1}),0==t.data[t.name].length&&t.$selectIconContainer.html(t.selectIconDefault),o=o.filter(function(e){return t.data[t.name].indexOf(e.id)>-1&&-1===t.itemsToExclude.indexOf(e.id)&&0!=e.id});var n=t._renderItemList(o);$.when(t.$scrollableContent.append(n)).then(function(){var e=t.$scrollableContent.find(":input");if(t.$scrollableContent[0].offsetHeight<t.$scrollableContent[0].scrollHeight?(t.scroll.update(),t.scroll.settings.suppressScrollY=!1,t.$scrollableContent.addClass("ps-show-rail-y")):(t.scroll.update(),t.scroll.settings.suppressScrollY=!0,t.$scrollableContent.removeClass("ps-show-rail-y")),t.$scrollableContent.find(':input[type="checkbox"]').length?t.type="checkbox":t.$scrollableContent.find(':input[type="radio"]').length&&(t.type="radio"),"checkbox"==t.type)t.data[t.name].forEach(function(o){var i=e.filter(function(){return this.value==o});i.prop("checked",!0),t.onSelect(i[0])});else if("radio"==t.type){var o=e.filter(function(){return this.value==t.data[t.name][0]});o.prop("checked",!0),o.addClass("checked"),t.dynamicTitle&&t.$selectTitle.html(o.parent().find("[data-label]").text()),t.onSelect(o[0])}})})}else{var s=this.$scrollableContent.find(":input"),a=s.length>0?s.map(function(){return this.value.toString()}).get():[];if(this.data[this.name]=this.data[this.name].filter(function(t){return a.indexOf(t.toString())>-1}),0==this.data[this.name].length&&this.$selectIconContainer.html(this.selectIconDefault),this.$scrollableContent.find(':input[type="checkbox"]').length?this.type="checkbox":this.$scrollableContent.find(':input[type="radio"]').length&&(this.type="radio"),"checkbox"==this.type)this.data[this.name].forEach(function(e){var o=s.filter(function(){return this.value==e});o.prop("checked",!0),t.onSelect(o[0])});else if("radio"==this.type){var l=s.filter(function(){return this.value==t.data[t.name][0]});l.prop("checked",!0),l.addClass("checked"),this.dynamicTitle&&this.$selectTitle.html(l.parent().find("[data-label]").text()),this.onSelect(l[0])}}},o.search=function(){var t=this,e=this.opts.faPro?"fal":"fas";if(this.searchString.length)if(this.searchApi.length)this.$scrollableContent.find("input:not(:checked)").parents(".select-item").not(".static-item").remove(),null!==this.searchRequest&&this.searchRequest.abort(),this.searchRequest=$.ajax({method:"GET",url:this.searchApi+this.searchString}).done(function(e){t.searchRequest=null;var o=e.map(function(e){return e.id=e[t.primaryKeyword].toString(),e});o=o.filter(function(e){return-1===t.data[t.name].indexOf(e.id)&&-1===t.itemsToExclude.indexOf(e.id)&&0!=e.id});var i=t._renderItemList(o);$.when(t.$scrollableContent.append(i)).then(function(){var e=t.opts.faPro?"fal":"fas";t.$searchIconContainer.html('<i class="'+e+' fa-times icon"></i>'),t.$searchIconContainer.attr("data-clear-search","true"),t.$scrollableContent[0].offsetHeight<t.$scrollableContent[0].scrollHeight?(t.scroll.update(),t.scroll.settings.suppressScrollY=!1,t.$scrollableContent.addClass("ps-show-rail-y")):(t.scroll.update(),t.scroll.settings.suppressScrollY=!0,t.$scrollableContent.removeClass("ps-show-rail-y"))})});else{var o=this.searchData.filter(function(e){return e.val.toLocaleLowerCase().indexOf(t.searchString.toLocaleLowerCase())>-1});this.$selectItems.removeClass("d-none"),this.$selectItems.removeClass("visible"),o.forEach(function(e){$(t.$selectItems[e.id]).addClass("visible")}),this.$selectItems.not(".visible").addClass("d-none"),this.$searchIconContainer.html('<i class="'+e+' fa-times icon"></i>'),this.$searchIconContainer.attr("data-clear-search","true")}else this.searchApi.length?(this.$scrollableContent.find("input:not(:checked)").parents(".select-item").not(".static-item").remove(),this.$searchIconContainer.html('<i class="'+e+' fa-search icon"></i>'),this.$searchIconContainer.attr("data-clear-search","")):(this.$selectItems.removeClass("d-none"),this.$selectItems.removeClass("visible"),this.$searchIconContainer.html('<i class="'+e+' fa-search icon"></i>'),this.$searchIconContainer.attr("data-clear-search",""));this.scroll&&this.scroll.update(),this.onUpdate()},o.show=function(){var t=this;if(!this.$el.hasClass("show")){var e=$(".select.show"),o=1,i=this.opts.faPro?"fal":"fas";e.length&&(o=parseInt(e.first().css("z-index"),10)+2),this.$el.css({"max-height":this.scrollContentHeight+this.$selectHeader.outerHeight(!0)+"px"}),this.$el.addClass("show"),e.length||(o=parseInt(this.$el.css("z-index"),10)+1),this.$el.css({"z-index":o}),this.scroll&&this.$scrollableContent.length&&this.$scrollableContent[0].offsetHeight<this.$scrollableContent[0].scrollHeight&&(this.$scrollableContent[0].scrollTop=1,this.$scrollableContent[0].scrollTop=0),this.$selectIconContainer.html('<i class="'+i+' fa-angle-up icon"></i>'),setTimeout(function(){t.$el[0].scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})},300),this.contentOpen=!0,this.onShow()}},o.close=function(){if(!this.preventClose){var t=this,e=this.opts.faPro?"fal":"fas";this.$el.css("max-height",""),this.$el.removeClass("show"),setTimeout(function(){t.$el.removeAttr("style")},300),this.data[this.name].length>0&&this.showValidStateIcon?this.$selectIconContainer.html('<i class="'+e+' fa-check text-success icon"></i>'):this.$selectIconContainer.html(this.selectIconDefault),this.contentOpen=!1,this.onClose()}},o.onSelect=function(t){var e=this,o=this.opts.onSelect,i=$(t).parents(".select-item").data();this.searchApi.length&&!$.isEmptyObject(i)&&($(t).length&&t.checked?this.items.push(i):this.items=$.grep(this.items,function(t){return t[e.primaryKeyword]!=i.id})),"function"==typeof o&&o.call(t,i,this)},o.appendItems=function(t,e){var o=this;return new Promise(function(e,i){var n=o;if(!$.isArray(t)){var s=[];s.push(t),t=s}(t=t.filter(function(t){return-1===n.itemsToExclude.indexOf(t[n.primaryKeyword].toString())})).forEach(function(t){o.items.push(t)});var a=o._renderItemList(t);o.$scrollableContent.prepend(a),o.$selectItems=o.$select.find(".select-item"),o.buildSearchData().then(function(){if(o.$selectItems.length>0)if(o.$select.find(':input[type="checkbox"]').length?o.type="checkbox":o.$select.find(':input[type="radio"]').length&&(o.type="radio"),"checkbox"==o.type)t.forEach(function(t){var e=o.$select.find(":input").filter(function(){return this.value==t.id}),i=e.val().toString();e.prop("checked",!0),-1===o.data[o.name].indexOf(i)&&o.data[o.name].push(i),o.onSelect(e[0])});else if("radio"==o.type){var i=t[0],n=o.$select.find(":input").filter(function(){return this.value==i.id}),s=n.val().toString();n.prop("checked",!0),n.addClass("checked"),-1===o.data[o.name].indexOf(s)&&(o.data[o.name]=[s]),o.dynamicTitle&&o.$selectTitle.html(n.parent().find("[data-label]").text()),o.$select.find('input[type="radio"]').not(n).prop("checked",!1),o.$select.find('input[type="radio"]').not(n).removeClass("checked"),o.onSelect(n[0])}0==o.data[o.name].length&&o.dynamicTitle&&o.dynamicTitleDefault&&0!==o.dynamicTitleDefault&&0==o.$selectTitle.text().trim()&&(o.$selectItems.length>0||o.searchApi)&&o.$selectTitle.html(o.dynamicTitleDefault),o.$selectHeader.attr("style")&&o.$selectHeader.removeAttr("style"),o.$selectIconContainer.hasClass("d-none")&&o.$selectIconContainer.removeClass("d-none"),e()})})},o.deselectItems=function(t){var e=this;return new Promise(function(o,i){t.forEach(function(t){var o=e.$select.find(":input").filter(function(){return this.value==t});o[0].checked&&o.trigger("click")}),0==e.data[e.name].length&&e.$selectIconContainer.html(e.selectIconDefault)})},o.getItem=function(t,e){var o=$.grep(this.items,function(o){return o[t]==e})[0];return o||null},o.getSelectedItems=function(t){var e=[],o=[],i=this.data[this.name];return $.isArray(i)?e=i:e.push(i),e=e.map(String),this.items.length>0?(o=$.grep(this.items,function(t){return e.indexOf(t.id.toString())>-1}),t&&(o=o.map(function(e){return e[t]}).filter(function(t){return null!=t}))):o=e,o},o.getSelectedItem=function(t){var e=[],o=[],i=this.data[this.name];return $.isArray(i)?e=i:e.push(i),e=e.map(String),this.items.length>0?(o=$.grep(this.items,function(t){return e.indexOf(t.id.toString())>-1}),t&&(o=o.map(function(e){return e[t]}).filter(function(t){return null!=t}))):o=e,null==o[0]?null:o[0]},o._renderItemList=function(t){for(var e=[],o=0;o<t.length;++o){var i=t[o],n="";"function"==typeof this.labelTemplate?n=this.labelTemplate(i):i.name?n=i.name:i.label?n=i.label:i.value&&(n=i.value),e.push($('\n\n <div class="select-item">\n\n <div class="select-item-'+this.type+'">\n\n <div class="styled-'+this.type+'">\n\n <input type="'+this.type+'" id="select-'+this.name+"-"+t[o].id+'" value="'+t[o].id+'" tabindex="-1">\n\n <label for="select-'+this.name+"-"+t[o].id+'">\n\n <span class="radio-inner">\n <svg viewBox="0 0 18 18">\n <polyline points="1.5 6 4.5 9 10.5 1"></polyline>\n </svg>\n </span>\n\n <span class="'+this.type+'-label"'+("function"!=typeof this.labelTemplate?" data-label":"")+">\n "+n+"\n </span>\n\n </label>\n\n </div>\n\n </div>\n\n </div>\n\n ").data(i))}return e},o._renderSearch=function(){if(this.showSearch){var t=this.opts.faPro?"fal":"fas";return'\n\n <div class="select-search">\n\n <div class="select-search-input">\n\n <input type="text" name="select-search" value="" placeholder="'+this.searchPlaceholder+'" tabindex="-1">\n\n </div>\n\n <div class="select-search-icon">\n\n <i class="'+t+' fa-search icon"></i>\n\n </div>\n\n </div>\n\n '}return""},o._renderFooter=function(){return this.showFooter?'\n\n <div class="select-footer">\n\n <button class="btn btn-block btn-light btn-sm" type="button" tabindex="-1" data-select-close >\n '+this.btnCloseText+"\n </button>\n\n </div>\n\n ":""},e._jQueryInterface=function(t){return this.each(function(){var o=$(this).data(DATA_KEY$1);if(o||(o=new e(this,"object"==typeof t&&t),$(this).data(DATA_KEY$1,o)),"string"==typeof t){if(void 0===o[t])throw new TypeError('No method named "'+t+'"');o[t]()}})},e}(AbstractUIComponent);if("undefined"!=typeof $){var JQUERY_NO_CONFLICT$1=$.fn[NAME$1];$.fn[NAME$1]=Select._jQueryInterface,$.fn[NAME$1].Constructor=Select,$.fn[NAME$1].noConflict=function(){return $.fn[NAME$1]=JQUERY_NO_CONFLICT$1,Select._jQueryInterface},$.fn[NAME$1].defaults={name:"",type:"checkbox",labelTemplate:null,confirmCheck:null,confirmUncheck:null,setData:null,scrollContentHeight:100,faPro:!1,items:[],showSearch:!1,showFooter:!1,searchApi:!1,onInit:null,onUpdate:null,onDestroy:null,onShow:null,onClose:null,onReset:null,onSearch:null,onSelect:null,buildScroll:null,searchPlaceholder:null,btnCloseText:null,debug:!1,dynamicTitle:!1,dynamicTitleDefault:"",dynamicTitleEmptyDefault:"",allowNoneOnRadioSelect:!0,preventUncheck:!1,showValidStateIcon:!0,itemsToExclude:[],primaryKeyword:"id"}}var NAME$2="coolDropdown",DATA_KEY$2="plugin_coolDropdown",Dropdown=function(t){function e(e,o){var i;return(i=t.call(this)||this).opts={},window.Cool.settings.dropdown?$.extend(!0,i.opts,$.fn[NAME$2].defaults,window.Cool.settings.dropdown,o):$.extend(!0,i.opts,$.fn[NAME$2].defaults,o),i.el=e,i.debug=i.opts.debug,i.init(),i}_inheritsLoose(e,t);var o=e.prototype;return o.init=function(){var t=this;$.when(this.buildCache()).then(function(){t.buildScroll(),t.bindEvents(),t.onInit()})},o.destroy=function(){this.unbindEvents(),this.$el.removeData(DATA_KEY$2),this.onDestroy()},o.update=function(){this.buildCache(),this.onUpdate()},o.buildCache=function(){var t=this;if(this.$el=$(this.el),this.$el.addClass("dropdown-trigger"),this.$container=this.$el.parent(".dropdown"),this.id="dropdown-"+this.generateUUID(),this.animation=this.$el.data("animation")?this.$el.data("animation"):this.opts.animation,this.animationIn=this.$el.data("animationIn")?this.$el.data("animationIn"):this.opts.animationIn,this.animationOut=this.$el.data("animationOut")?this.$el.data("animationOut"):this.opts.animationOut,this.animationSpeed=this.$el.data("animationSpeed")?this.$el.data("animationSpeed"):this.opts.animationSpeed,this.offset=this.$el.data("offset")?this.$el.data("offset"):this.opts.offset,this.minWidth=this.$el.data("minWidth")?this.$el.data("minWidth"):this.opts.minWidth,this.scroll=this.$el.data("scroll")?this.$el.data("scroll"):this.opts.scroll,this.scrollContentHeight=this.$el.data("scrollContentHeight")?this.$el.data("scrollContentHeight"):this.opts.scrollContentHeight,this.positionObserver=this.$el.attr("data-position-observer")?JSON.parse(this.$el.attr("data-position-observer")):this.opts.positionObserver,this.closeOnItemClick=this.$el.data("closeOnItemClick")?this.$el.data("closeOnItemClick"):this.opts.closeOnItemClick,this.content=this.$el.data("content")?this.$el.data("content"):this.opts.content,this.contentOpen=!1,this.$container.hasClass("dropup")?this.placement="top":this.$container.hasClass("dropright")?this.placement="right":this.$container.hasClass("dropbottom")?this.placement="bottom":this.placement="left","function"!=typeof this.content)return this.$dropdown=!!this.$el.next(".dropdown-menu")&&this.$el.next(".dropdown-menu"),this.$dropdown.hasClass("dropdown-menu-right")?this.align="end":this.align="start",this.$scrollableContent=!!this.$dropdown.find(".dropdown-scrollable-content")&&this.$dropdown.find(".dropdown-scrollable-content"),this.$dropdownItem=this.$dropdown.find(".dropdown-item"),this.minWidth&&this.$dropdown.css("min-width",this.minWidth+"px"),this.log(this.$el),this.log(this.$container),this.log(this.$dropdown),this.log(this.$scrollableContent),this.log("Id: "+this.id),this.log("Animation: "+this.animation),this.log("Animation in: "+this.animationIn),this.log("Animation out: "+this.animationOut),this.log("Animation speed: "+this.animationSpeed),this.log("Offset: "+this.offset),this.log("Min width: "+this.minWidth),this.log("Content: "+this.opts.content),this.log("Scroll: "+this.scroll),this.log("Scroll content height: "+this.scrollContentHeight+"px"),!0;var e="end"===this.opts.align?" dropdown-menu-right":"";this.$dropdown=$('\n <div class="dropdown-menu'+e+'" id="'+this.id+'">\n '+this.content()+"\n </div>\n "),$.when(this.$el.after(this.$dropdown)).then(function(){return t.$scrollableContent=!!t.$dropdown.find(".dropdown-scrollable-content")&&t.$dropdown.find(".dropdown-scrollable-content"),t.$dropdown.hasClass("dropdown-menu-right")?t.align="end":t.align="start",t.$dropdownItem=t.$dropdown.find(".dropdown-item"),t.minWidth&&t.$dropdown.css("min-width",t.minWidth+"px"),t.log(t.$el),t.log(t.$container),t.log(t.$dropdown),t.log(t.$scrollableContent),t.log("Id: "+t.id),t.log("Animation: "+t.animation),t.log("Animation in: "+t.animationIn),t.log("Animation out: "+t.animationOut),t.log("Animation speed: "+t.animationSpeed),t.log("Offset: "+t.offset),t.log("Min width: "+t.minWidth),t.log("Content: "+t.content),t.log("Scroll: "+t.scroll),t.log("Scroll content height: "+t.scrollContentHeight+"px"),!0})},o.buildScroll=function(){this.opts.scroll&&this.$scrollableContent.length&&(this.$scrollableContent.css({"max-height":this.scrollContentHeight+"px"}),touchEvents()?this.$scrollableContent.css({"overflow-y":"auto"}):(this.$scrollableContent.css({"overflow-y":"auto"}),this.scroll=new PerfectScrollbar(this.$scrollableContent[0],{wheelSpeed:1,wheelPropagation:!1,minScrollbarLength:20}),this.$scrollableContent.addClass("ps-show-rail-y")))},o.bindEvents=function(){var t=this,e=this;this.$el.on("click."+NAME$2,function(){t.contentOpen?t.close():t.show()}),this.$dropdownItem.on("click."+NAME$2,function(){e.closeOnItemClick&&e.close(),e.onItemClick(this)}),$(document).on("touchstart click",function(e){t.$el.is(e.target)||t.$dropdown.is(e.target)||0!==t.$dropdown.has(e.target).length||!t.contentOpen||t.close()}),$(window).on("resize",debounce(function(){t.setPosition(),t.onUpdate()},250))},o.unbindEvents=function(){this.$el.off("."+NAME$2)},o.generateUUID=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var e=16*Math.random()|0;return("x"==t?e:3&e|8).toString(16)})},o.setPosition=function(t){"undefined"!=typeof str&&null!==str||(t=this.placement);var e=this.$dropdown.outerWidth(!0),o=this.$dropdown.outerHeight(!0),i=this.$el.outerWidth(!0),n=this.$el.outerHeight(!0),s=this.$el.position().left,a=this.$el.position().top,l=0,r=0,h=0,c=0;if("top"===t?(l="end"===this.align?i-e:s,r=a-o):"right"===t?(l=s+i,r=a):"bottom"===t?(l="end"===this.align?i-e:s,r=a+n):"left"===t&&(l=s-e,r=a),this.offset){var d=this.offset.split(",");h=d[0],c=d[1],l+=parseInt(h,10),r+=parseInt(c,10)}if(this.positionObserver&&this.$container.length>0){for(var p=this.$container.parent(),u=0;"hidden"!==p.css("overflow-x")&&"hidden"!==p.css("overflow")&&"body"!==(p.prop("tagName")||"").toLowerCase()&&u<100;){if(!(p=p.parent()).get(0))return;++u}if(!p.get(0))return;var f=p.get(0).getBoundingClientRect(),g=this.$container.get(0).getBoundingClientRect();f.width<e?(this.$dropdown.css("max-width",f.width),e=f.width):this.$dropdown.css("max-width",""),f.height<o?(this.$dropdown.css("max-height",f.height),o=f.height):this.$dropdown.css("max-height","");var m=Math.max(Math.abs(f.y-g.y),0),$=Math.max(Math.abs(f.x-g.x),0),v=p.get(0).scrollWidth-(g.x+g.width),b=p.get(0).scrollHeight-(g.y+("dropbottom"===t?g.height:0));$<e&&l<s&&(l=s,a+n>r&&(r=a+n+(c>0?c:0))),v<e&&l+e>s+i&&(l=s+i-e,a+n>r&&(r=a+n+(c>0?c:0))),r<a&&m<o&&(r=a+n+c),r>=a&&b<o&&(r=l>=s+i||s>=l+e?a-(o-b):a-o-c)}this.$dropdown.css({position:"absolute",top:"0px",left:"0px",transform:"translate3d("+Math.round(l)+"px, "+Math.round(r)+"px, 0px)","will-change":"transform"}),this.log("Dropdown trigger width: "+i+"px"),this.log("Dropdown trigger height: "+n+"px"),this.log("Dropdown trigger position x: "+s+"px"),this.log("Dropdown trigger position Y: "+a+"px"),this.log("Dropdown width: "+e+"px"),this.log("Dropdown height: "+o+"px"),this.log("Dropdown position x: "+l+"px"),this.log("Dropdown position y: "+r+"px")},o.show=function(){this.$dropdown&&!this.$dropdown.hasClass("show")&&(this.setPosition(),this.animation?(this.$dropdown.attr("x-placement",this.placement+"-"+this.align),this.$dropdown.addClass(this.animationSpeed),this.$dropdown.animateCss(this.animationIn),this.$dropdown.addClass("show"),this.$dropdown.attr("id",this.id),this.$el.attr("data-dropdown",this.id)):(this.$dropdown.attr("x-placement",this.placement+"-"+this.align),this.$dropdown.addClass("show"),this.$dropdown.attr("id",this.id),this.$el.attr("data-dropdown",this.id)),this.opts.scroll&&this.scroll&&this.$scrollableContent.length&&(this.$scrollableContent[0].scrollTop=1,this.$scrollableContent[0].scrollTop=0),this.contentOpen=!0,this.onShow())},o.close=function(){var t=this;this.$dropdown&&(this.animation&&!this.$dropdown.hasClass("animated")?this.$dropdown.animateCss(this.animationOut,function(){t.$dropdown.removeClass("show"),t.$el.removeAttr("data-dropdown")}):(this.$dropdown.removeClass("show"),this.$el.removeAttr("data-dropdown")),this.contentOpen=!1,this.onClose())},o.onItemClick=function(t){var e=this.opts.onItemClick;"function"==typeof e&&e.call(t)},e._jQueryInterface=function(t){return this.each(function(){var o=$(this).data(DATA_KEY$2);if(o||(o=new e(this,"object"==typeof t&&t),$(this).data(DATA_KEY$2,o)),"string"==typeof t){if(void 0===o[t])throw new TypeError('No method named "'+t+'"');o[t]()}})},e}(AbstractUIComponent);if("undefined"!=typeof $){var JQUERY_NO_CONFLICT$2=$.fn[NAME$2];$.fn[NAME$2]=Dropdown._jQueryInterface,$.fn[NAME$2].Constructor=Dropdown,$.fn[NAME$2].noConflict=function(){return $.fn[NAME$2]=JQUERY_NO_CONFLICT$2,Dropdown._jQueryInterface},$.fn[NAME$2].defaults={animation:!0,animationIn:"zoomIn",animationOut:"zoomOut",animationSpeed:"fastest",offset:null,minWidth:null,align:"start",closeOnItemClick:!0,positionObserver:!0,content:!1,scroll:!0,scrollContentHeight:100,onInit:null,onUpdate:null,onDestroy:null,onShow:null,onClose:null,onItemClick:null,debug:!1}}var NAME$3="coolTooltip",DATA_KEY$3="plugin_coolTooltip",Tooltip=function(t){function e(e,o){var i;return(i=t.call(this)||this).opts={},window.Cool.settings.tooltip?$.extend(!0,i.opts,$.fn[NAME$3].defaults,window.Cool.settings.tooltip,o):$.extend(!0,i.opts,$.fn[NAME$3].defaults,o),i.el=e,i.debug=i.opts.debug,i.init(),i}_inheritsLoose(e,t);var o=e.prototype;return o.init=function(){this.buildCache(),this.bindEvents(),this.onInit()},o.destroy=function(){this.unbindEvents(),this.$el.removeData(DATA_KEY$3),this.onDestroy()},o.update=function(){this.buildCache(),this.onUpdate()},o.buildCache=function(){this.$el=$(this.el),this.$container=this.$el.data("container")?$(this.$el.data("container")):$(this.opts.container),this.id="tooltip-"+this.generateUUID(),this.animation=this.$el.data("animation")?this.$el.data("animation"):this.opts.animation,this.animationIn=this.$el.data("animationIn")?this.$el.data("animationIn"):this.opts.animationIn,this.animationOut=this.$el.data("animationOut")?this.$el.data("animationOut"):this.opts.animationOut,this.animationSpeed=this.$el.data("animationSpeed")?this.$el.data("animationSpeed"):this.opts.animationSpeed,this.placement=this.$el.data("placement")?this.$el.data("placement"):this.opts.placement,this.placementChanged=!1,this.content=this.$el.data("content")?this.$el.data("content"):this.opts.content,this.trigger=this.$el.data("trigger")?this.$el.data("trigger"):this.opts.trigger},o.bindEvents=function(){var t=this;"auto"===this.trigger&&(this.$el.on("mouseenter."+NAME$3,function(){t.show()}),this.$el.on("mouseleave."+NAME$3,function(){t.close()}),this.$el.on("blur."+NAME$3,function(){t.close()})),this.$el.on("destroyed."+NAME$3,function(){t.close()}),$(window).on("resize",debounce(function(){t.$tooltip&&(t.setPosition(),t.onUpdate())},250))},o.unbindEvents=function(){this.$el.off("."+NAME$3)},o.generateUUID=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var e=16*Math.random()|0;return("x"==t?e:3&e|8).toString(16)})},o.buildTooltip=function(){this.$tooltip=$('\n\n <div class="tooltip" role="tooltip" id="'+this.id+'">\n\n <div class="arrow"></div>\n\n <div class="tooltip-inner">'+this.content+"</div>\n\n </div>\n\n "),this.$container.append(this.$tooltip),this.$arrow=this.$tooltip.find(".arrow"),this.log(this.$el),this.log(this.$container),this.log(this.$tooltip),this.log(this.$arrow),this.log("Id: "+this.id),this.log("Animation: "+this.animation),this.log("Animation in: "+this.animationIn),this.log("Animation out: "+this.animationOut),this.log("Animation speed: "+this.animationSpeed),this.log("Placement: "+this.placement),this.log("Content: "+this.content),this.log("Trigger: "+this.trigger)},o.setPosition=function(t){null==t&&(t=this.placement),this.$tooltip.addClass("tooltip-"+t);var e,o,i,n=this.$container.innerWidth(),s=this.$container.innerHeight(),a=this.$tooltip.outerWidth(!0),l=this.$tooltip.outerHeight(!0),r=this.$el.outerWidth(),h=this.$el.outerHeight(),c=this.$el.offset().left,d=this.$el.offset().top,p=this.$arrow.outerWidth(!0),u=this.$arrow.outerHeight(!0);"top"===t?(o=Math.round(c-(a-r)/2),i=Math.round(d-l),e=Math.round(a/2-p/2),this.$arrow.css({left:e+"px"})):"right"===t?(o=Math.round(c+r),i=Math.round(d-(l-h)/2),e=Math.round(l/2-u/2),this.$arrow.css({top:e+"px"})):"bottom"===t?(o=Math.round(c-(a-r)/2),i=Math.round(d+h),e=Math.round(a/2-p/2),this.$arrow.css({left:e+"px"})):"left"===t&&(o=Math.round(c-a),i=Math.round(d-(l-h)/2),e=Math.round(l/2-u/2),this.$arrow.css({top:e+"px"})),this.$tooltip.css({position:"absolute",top:"0px",left:"0px",transform:"translate3d("+o+"px, "+i+"px, 0px)","will-change":"transform"});var f=0,g={left:this.$tooltip.position().left,top:this.$tooltip.position().top,right:n-(this.$tooltip.position().left+a),bottom:s-(this.$tooltip.position().top+l)},m={left:!1,top:!1,right:!1,bottom:!1};if(g.right<0&&(m.right=!0,f++,this.log("Tooltip overflowing from right")),g.left<0&&(m.left=!0,f++,this.log("Tooltip overflowing from left")),g.bottom<0&&(m.bottom=!0,f++,this.log("Tooltip overflowing from bottom")),g.top<0&&(m.top=!0,f++,this.log("Tooltip overflowing from top")),f>0){if(!this.placementChanged&&m.left&&g.right>a?(this.log("Changing tooltip placement to right"),this.placementChanged=!0,this.$tooltip.removeClass("tooltip-"+t),this.$arrow.removeAttr("style"),this.setPosition("right")):!this.placementChanged&&m.top&&g.top>l?(this.log("Changing tooltip placement to bottom"),this.placementChanged=!0,this.$tooltip.removeClass("tooltip-"+t),this.$arrow.removeAttr("style"),this.setPosition("bottom")):!this.placementChanged&&m.right&&g.left>a?(this.log("Changing tooltip placement to left"),this.placementChanged=!0,this.$tooltip.removeClass("tooltip-"+t),this.$arrow.removeAttr("style"),this.setPosition("left")):!this.placementChanged&&m.bottom&&g.top>l?(this.log("Changing tooltip placement to top"),this.placementChanged=!0,this.$tooltip.removeClass("tooltip-"+t),this.$arrow.removeAttr("style"),this.setPosition("top")):this.placementChanged||"top"===t&&"bottom"===t||!m.left&&!m.right?this.fixTooltipPosition=!0:g.top>g.bottom?(this.log("Changing tooltip placement to top"),this.placementChanged=!0,this.$tooltip.removeClass("tooltip-"+t),this.$arrow.removeAttr("style"),this.setPosition("top")):(this.log("Changing tooltip placement to bottom"),this.placementChanged=!0,this.$tooltip.removeClass("tooltip-"+t),this.$arrow.removeAttr("style"),this.setPosition("bottom")),this.fixTooltipPosition){if(this.log("Adjusting tooltip size or position in order to tooltip fit in the container"),m.left){this.log("Tooltip overflowing from left");var $=Math.abs(g.left);c>=o+$&&["top","bottom"].indexOf(t)<0?(this.log("Tooltip adjusting width"),a-=$,o+=$):(this.log("Tooltip adjusting position x"),o+=$,e-=$)}if(m.top){this.log("Tooltip overflowing from top");var v=Math.abs(g.top);this.log("Tooltip adjusting position y"),i+=v,e-=v}if(m.right){this.log("Tooltip overflowing from right");var b=Math.abs(g.right);c<=o-b&&["top","bottom"].indexOf(t)<0?(this.log("Tooltip adjusting width"),a-=b):(this.log("Tooltip adjusting position x"),o-=b,e+=b)}if(m.bottom){this.log("Tooltip overflowing from bottom");var w=Math.abs(g.bottom);this.log("Tooltip adjusting position y"),i-=w,e+=w}"top"===t?this.$arrow.css({left:e+"px"}):"right"===t?this.$arrow.css({top:e+"px"}):"bottom"===t?this.$arrow.css({left:e+"px"}):"left"===t&&this.$arrow.css({top:e+"px"}),this.$tooltip.css({width:a,transform:"translate3d("+o+"px, "+i+"px, 0px)"}),this.fixTooltipPosition=!1,this.log("Tooltip placement changed: "+this.placementChanged),this.log("Tooltip container inner width: "+n+"px"),this.log("Tooltip container inner height: "+s+"px"),this.log("Tooltip trigger width: "+r+"px"),this.log("Tooltip trigger height: "+h+"px"),this.log("Tooltip trigger position x: "+c+"px"),this.log("Tooltip trigger position Y: "+d+"px"),this.log("Tooltip width: "+a+"px"),this.log("Tooltip height: "+l+"px"),this.log("Tooltip position x: "+o+"px"),this.log("Tooltip position y: "+i+"px"),this.log("Tooltip position left: "+g.left+"px"),this.log("Tooltip position top: "+g.top+"px"),this.log("Tooltip position right: "+g.right+"px"),this.log("Tooltip position bottom: "+g.bottom+"px")}}else this.log("Tooltip placement changed: "+this.placementChanged),this.log("Tooltip container inner width: "+n+"px"),this.log("Tooltip container inner height: "+s+"px"),this.log("Tooltip trigger width: "+r+"px"),this.log("Tooltip trigger height: "+h+"px"),this.log("Tooltip trigger position x: "+c+"px"),this.log("Tooltip trigger position Y: "+d+"px"),this.log("Tooltip width: "+a+"px"),this.log("Tooltip height: "+l+"px"),this.log("Tooltip position x: "+o+"px"),this.log("Tooltip position y: "+i+"px"),this.log("Tooltip position left: "+g.left+"px"),this.log("Tooltip position top: "+g.top+"px"),this.log("Tooltip position right: "+g.right+"px"),this.log("Tooltip position bottom: "+g.bottom+"px")},o.show=function(){this.$tooltip||(this.buildTooltip(),this.setPosition(),this.animation?(this.$tooltip.addClass(this.animationSpeed),this.$tooltip.animateCss(this.animationIn),this.$tooltip.addClass("show"),this.$tooltip.attr("id",this.id),this.$el.attr("data-tooltip",this.id)):(this.$tooltip.addClass("show"),this.$tooltip.attr("id",this.id),this.$el.attr("data-tooltip",this.id)),this.onShow())},o.close=function(){var t=this;this.$tooltip&&(this.animation&&!this.$tooltip.hasClass("animated")?this.$tooltip.animateCss(this.animationOut,function(){t.$tooltip.remove(),t.$el.removeAttr("data-tooltip"),t.$tooltip=null,t.placementChanged=!1,t.onClose()}):(this.$tooltip.remove(),this.$el.removeAttr("data-tooltip"),this.$tooltip=null,this.placementChanged=!1,this.onClose()))},e._jQueryInterface=function(t){return this.each(function(){var o=$(this).data(DATA_KEY$3);if(o||(o=new e(this,"object"==typeof t&&t),$(this).data(DATA_KEY$3,o)),"string"==typeof t){if(void 0===o[t])throw new TypeError('No method named "'+t+'"');o[t]()}})},e}(AbstractUIComponent);if("undefined"!=typeof $){var JQUERY_NO_CONFLICT$3=$.fn[NAME$3];$.fn[NAME$3]=Tooltip._jQueryInterface,$.fn[NAME$3].Constructor=Tooltip,$.fn[NAME$3].noConflict=function(){return $.fn[NAME$3]=JQUERY_NO_CONFLICT$3,Tooltip._jQueryInterface},$.fn[NAME$3].defaults={container:"body",animation:!1,animationIn:"fadeIn",animationOut:"fadeOut",animationSpeed:"fastest",placement:"bottom",content:"",trigger:"auto",onInit:null,onUpdate:null,onDestroy:null,onShow:null,onClose:null,debug:!1}}var NAME$4="coolSectionTabs",DATA_KEY$4="plugin_coolSectionTabs",SectionTabs=function(t){function e(e,o){var i;return(i=t.call(this)||this).opts={},window.Cool.settings.sectionTabs?$.extend(!0,i.opts,$.fn[NAME$4].defaults,window.Cool.settings.sectionTabs,o):$.extend(!0,i.opts,$.fn[NAME$4].defaults,o),i.el=e,i.debug=i.opts.debug,i.init(),i}_inheritsLoose(e,t);var o=e.prototype;return o.init=function(){this.buildCache(),this.bindEvents(),this.checkForChanges(),this.onInit()},o.destroy=function(){this.unbindEvents(),this.$el.removeData(DATA_KEY$4),this.onDestroy()},o.update=function(){this.buildCache(),this.onUpdate()},o.buildCache=function(){this.$el=$(this.el),this.$dropdownContainer=this.$el.find(".dropdown-container"),this.$dropdownList=this.$el.find(".dropdown-list"),this.tabsCount=this.$el.find("> .tab-item").length,this.tabs=this.$el.find("> .tab-item:visible"),$.each(this.tabs,function(t,e){$(e).data("width",$(e).outerWidth(!0))}),this.log(this.$el),this.log(this.$dropdownContainer),this.log(this.$dropdownList),this.log(this.tabsCount)},o.bindEvents=function(){var t=this;$(window).on("resize",debounce(function(){t.checkForChanges()},250))},o.unbindEvents=function(){this.$el.off("."+this._name)},o.moveToList=function(t){var e=$(t);e.find(".tab-item-action").removeClass("dropdown-item"),e.insertBefore(this.$dropdownContainer),this.checkForChanges()},o.moveToDropdown=function(t){var e=$(t),o=e.find(".tab-item-action");o.hasClass("dropdown-item")||o.addClass("dropdown-item"),e.appendTo(this.$dropdownList),this.checkForChanges()},o.overflowStatus=function(){return this.$el[0].offsetWidth<this.$el[0].scrollWidth},o.checkForChanges=function(){var t=this.$dropdownList.children(),e=this.$el.find("> .tab-item").not(this.$dropdownContainer),o=this.$el.find("> .tab-item:visible"),i=0;$.each(o,function(t,e){i+=$(e).outerWidth(!0)});var n=this.$el[0].offsetWidth-i;t.length>0?this.$dropdownContainer.hasClass("visible")||this.$dropdownContainer.addClass("visible"):this.$dropdownContainer.hasClass("visible")&&this.$dropdownContainer.removeClass("visible"),1==this.overflowStatus()?e.length>0&&this.moveToDropdown(e.last()):t.length>0&&n>t.last().data("width")&&this.moveToList(t.last())},e._jQueryInterface=function(t){return this.each(function(){var o=$(this).data(DATA_KEY$4);if(o||(o=new e(this,"object"==typeof t&&t),$(this).data(DATA_KEY$4,o)),"string"==typeof t){if(void 0===o[t])throw new TypeError('No method named "'+t+'"');o[t]()}})},e}(AbstractUIComponent);if("undefined"!=typeof $){var JQUERY_NO_CONFLICT$4=$.fn[NAME$4];$.fn[NAME$4]=SectionTabs._jQueryInterface,$.fn[NAME$4].Constructor=SectionTabs,$.fn[NAME$4].noConflict=function(){return $.fn[NAME$4]=JQUERY_NO_CONFLICT$4,SectionTabs._jQueryInterface},$.fn[NAME$4].defaults={onInit:null,onUpdate:null,onDestroy:null,debug:!1}}var NAME$5="coolCollapse",DATA_KEY$5="plugin_coolCollapse",Collapse=function(t){function e(e,o){var i;return(i=t.call(this)||this).opts={},window.Cool.settings.collapse?$.extend(!0,i.opts,$.fn[NAME$5].defaults,window.Cool.settings.dialog,o):$.extend(!0,i.opts,$.fn[NAME$5].defaults,o),i.el=e,i.debug=i.opts.debug,i.init(),i}_inheritsLoose(e,t);var o=e.prototype;return o.init=function(){this.buildCache(),this.bindEvents(),this.onInit()},o.destroy=function(){this.unbindEvents(),this.$el.removeData(DATA_KEY$5),this.onDestroy()},o.update=function(){this.buildCache(),this.onUpdate()},o.buildCache=function(){this.$el=$(this.el),this.$target=this.$el.data("target")?$(document).find(this.$el.data("target")):$(document).find(this.opts.target),this.breakpoint=this.$el.data("breakpoint"),this.expanded="true"==this.$el.attr("aria-expanded"),this.transitionendEvent=this.whichTransitionEvent(),this.$target.length?(this.targetHeight=this.$target.height(),this.$container=this.$target.closest(".section-collapse"),this.$indicator=$(document).find('[data-collapse-indicator="'+this.$el.data("target")+'"]')):(this.$target=$(this.$el).parent().find(".collapse"),this.targetHeight=this.$target.height(),this.$container=this.$target.closest(".section-collapse"),this.$indicator=$(this.$el).parent().find("[data-collapse-indicator]")),this.expanded&&this.$target.css("height","auto"),this.log(this.$el),this.log(this.$target),this.log(this.$container),this.log(this.$indicator),this.log("Expanded: "+this.expanded),this.log("Target height: "+this.targetHeight+"px")},o.bindEvents=function(){var t=this;this.$el.on("click."+this.name,function(e){t.breakpoint&&window.matchMedia("(min-width: "+t.breakpoint+"px)").matches||(t.expanded?t.close():t.show())}),$(window).on("resize",debounce(function(){t.$target.length&&(t.targetHeight=t.$target.height(),t.log("Target height: "+t.targetHeight+"px"))},250))},o.unbindEvents=function(){this.$el.off("."+this.name)},o.whichTransitionEvent=function(){var t=document.createElement("text-transition"),e={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",transition:"transitionend"};for(var o in e)if(void 0!==t.style[o])return e[o]},o.show=function(){var t=this;this.targetHeight!==this.$target.height()&&(this.targetHeight=this.$target.height()),this.$target.removeClass("collapse show"),this.$target.addClass("collapsing"),this.$el.is("button")&&this.$el.attr("disabled",!0),this.$container.length&&this.$container.addClass("show"),this.$target.css("height"),this.$target.css("height",this.targetHeight),this.$indicator.length&&this.$indicator.addClass("show"),this.$target.on(this.transitionendEvent,function(e){$(e.target).is(this)&&(t.$target.removeClass("collapsing"),t.$el.is("button")&&t.$el.attr("disabled",!1),t.$target.removeAttr("style"),t.$target.addClass("collapse show"),t.$el.attr("aria-expanded",!0),t.$target.css("height","auto"),t.expanded=!0,$(this).off(t.transitionendEvent))}),this.onShow()},o.close=function(){var t=this,e=this;this.$target.removeClass("collapse show"),this.$target.addClass("collapsing"),this.$el.is("button")&&this.$el.attr("disabled",!0),this.$container.length&&this.$container.removeClass("show"),this.$target.css("height",this.$target.height()),setTimeout(function(){t.$target.css("height",0)},10),this.$indicator.length&&this.$indicator.hasClass("show")&&this.$indicator.removeClass("show"),this.$target.on(this.transitionendEvent,function(t){$(t.target).is(this)&&(e.$target.removeClass("collapsing"),e.$el.is("button")&&e.$el.attr("disabled",!1),e.$target.removeAttr("style"),e.$target.addClass("collapse"),e.$el.attr("aria-expanded",!1),e.expanded=!1,e.targetHeight!==e.$target.height()&&(e.targetHeight=e.$target.height()),$(this).off(e.transitionendEvent))}),this.onClose()},e._jQueryInterface=function(t){return this.each(function(){var o=$(this).data(DATA_KEY$5);if(o||(o=new e(this,"object"==typeof t&&t),$(this).data(DATA_KEY$5,o)),"string"==typeof t){if(void 0===o[t])throw new TypeError('No method named "'+t+'"');o[t]()}})},e}(AbstractUIComponent);if("undefined"!=typeof $){var JQUERY_NO_CONFLICT$5=$.fn[NAME$5];$.fn[NAME$5]=Collapse._jQueryInterface,$.fn[NAME$5].Constructor=Collapse,$.fn[NAME$5].noConflict=function(){return $.fn[NAME$5]=JQUERY_NO_CONFLICT$5,Collapse._jQueryInterface},$.fn[NAME$5].defaults={target:null,onInit:null,onUpdate:null,onDestroy:null,onShow:null,onClose:null,debug:!1}}var NAME$6="coolToast",DATA_KEY$6="plugin_coolToast",Toast=function(){function t(t,e){this.settings={},window.Cool.settings.toast?$.extend(!0,this.settings,$.fn[NAME$6].defaults,window.Cool.settings.toast,e):$.extend(!0,this.settings,$.fn[NAME$6].defaults,e),this.container=t,this.$container=$(this.container),this.debug=this.settings.debug,this.faPro=this.settings.faPro,this.toasts=[],this.queue=[],this.processingQueue=!1,this.onInitialize=this.settings.onInitialize,this.onDestroy=this.settings.onDestroy}var e=t.prototype;return e.addQueue=function(t){if(this.queue.push(t),!this.processingQueue)return this.processQueue()},e.processQueue=function(){if(this.processingQueue&&this.queue.shift(),this.queue.length)return this.processingQueue=!0,this.show(this.queue[0]);this.processingQueue=!1},e.init=function(t){var e={};$.extend(!0,e,this.settings,t);var o=this.buildToast(e);return this.addQueue(o),this.onInit(o),o},e.destroy=function(){this.$container.removeData(DATA_KEY$6),this.onDestroy()},e.buildToast=function(t){var e={uuid:"toast-"+this.generateUUID(),placement:t.placement,placementX:t.placementX,placementY:t.placementY,offset:t.offset,animation:t.animation,animationIn:t.animationIn,animationOut:t.animationOut,animationSpeed:t.animationSpeed,dismiss:t.dismiss,size:t.size,header:t.header,theme:t.theme,title:t.title,content:t.content,template:t.template,maxBodyHeight:t.maxBodyHeight,onInit:t.onInit,onShow:t.onShow,onClose:t.onClose};return"function"==typeof e.content?e.$el=$(e.template()):e.$el=$(this._renderTemplate(e)),e.$inner=e.$el.find(".toast-inner"),e.$closeBtn=e.$el.find("[data-toast-close]"),this.log(e),this.toasts.push(e),e},e.bindEvents=function(t){var e=this,o=this;t.$el.on("click","[data-toast-close]",function(){t.$el&&o.close(t)}),$(window).on("resize",debounce(function(){t.$el&&e.setPosition(t)},250))},e.generateUUID=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var e=16*Math.random()|0;return("x"==t?e:3&e|8).toString(16)})},e.setPosition=function(t,e,o,i){if(null==o&&(o=t.placementY),null==i&&(i=t.placementX),i&&o||(e=t.placement),t.offset){var n=t.offset.split(",");parseInt(n[0],10),parseInt(n[1],10)}var s,a,l=t.$el.outerWidth(!0),r=t.$el.outerHeight(!0);e?"top-left"===e?(s=0,a=0,t.offset?(s+=offsetX,a+=offsetY):(s+=30,a+=30)):"top-center"===e?(s=this.$container.width()/2-l/2,a=0,this.log(this.$container.width),t.offset?(s+=offsetX,a+=offsetY):a+=30):"top-right"===e?(s=this.$container.width()-l,a=0,t.offset?(s+=-offsetX,a+=offsetY):(s+=-30,a+=30)):"center-left"===e?(s=0,a=this.$container.height()/2-r/2,t.offset?(s+=offsetX,a+=offsetY):s+=30):"center-center"===e?(s=this.$container.width()/2-l/2,a=this.$container.height()/2-r/2,t.offset&&(s+=offsetX,a+=offsetY)):"center-right"===e?(s=this.$container.width()-l,a=this.$container.height()/2-r/2,t.offset?(s+=-offsetX,a+=offsetY):s+=-30):"bottom-left"===e?(s=0,a=this.$container.height()-r,t.offset?(s+=offsetX,a+=-offsetY):(s+=30,a+=-30)):"bottom-center"===e?(s=this.$container.width()/2-l/2,a=this.$container.height()-r,t.offset?(s+=offsetX,a+=-offsetY):a+=-30):"bottom-right"===e&&(s=this.$container.width()-l,a=this.$container.height()-r,t.offset?(s+=-offsetX,a+=-offsetY):(s+=-30,a+=-30)):(s=i,a=o),t.$el.css({position:"absolute",top:"0px",left:"0px",transform:"translate3d("+s+"px, "+a+"px, 0px)","will-change":"transform"}),this.log("Toast width: "+l+"px"),this.log("Toast height: "+r+"px"),this.log("Toast position Y: "+s+"px"),this.log("Toast position x: "+a+"px")},e.show=function(t){var e=this;this.$container.append(t.$el),this.bindEvents(t),this.setPosition(t),t.animation?(t.$el.addClass("show"),t.$inner.addClass(t.animationSpeed),t.$inner.animateCss(t.animationIn)):t.$el.addClass("show"),t.dismiss&&setTimeout(function(){e.close(t)},1e3*t.dismiss),this.onShow(t)},e.close=function(t){var e=this;t.animation&&!t.$inner.hasClass("animated")?(t.$el.removeClass("show"),t.$inner.animateCss(t.animationOut,function(){t.$el.remove(),e.toasts=$.grep(e.toasts,function(e){return e.uuid!=t.uuid}),e.processQueue(),e.onClose(t)})):(t.$el.remove(),this.toasts=$.grep(this.toasts,function(e){return e.uuid!=t.uuid}),this.processQueue(),this.onClose(t))},e.onInitialize=function(){var t=this.onInitialize;"function"==typeof t&&t.call(this.container)},e.onDestroy=function(){var t=this.onDestroy;"function"==typeof t&&t.call(this.container)},e.onInit=function(t){var e=t.onInit;"function"==typeof e&&e.call(t)},e.onShow=function(t){var e=t.onShow;"function"==typeof e&&e.call(t)},e.onClose=function(t){var e=t.onClose;"function"==typeof e&&e.call(t)},e.log=function(){var t;this.debug&&("function"==typeof this.debug?this.debug.apply(this,arguments):(t=console).log.apply(t,arguments))},e._renderTemplate=function(t){var e,o=this.faPro?"far":"fas",i="",n="",s="";return i="function"==typeof t.content?t.content():t.content,t.header?n='\n <div class="toast-header">\n\n <span>'+t.title+'</span>\n\n <button type="button" data-toast-close>\n <i class="'+o+' fa-times icon"></i>\n </button>\n\n </div>\n ':s='\n <button type="button" data-toast-close>\n\n <i class="'+o+' fa-times icon"></i>\n\n </button>\n ',e='\n <div class="toast-body">\n\n <span>'+i+"</span>\n "+s+"\n\n </div>\n ",'\n <div class="toast toast-'+t.size+" toast-"+t.theme+'" role="alert" id="'+t.uuid+'">\n\n <div class="toast-inner">\n\n '+n+"\n "+e+"\n\n </div>\n\n </div>\n "},t._jQueryInterface=function(e){return this.each(function(){var o=$(this).data(DATA_KEY$6);if(o||(o=new t(this,"object"==typeof e&&e),$(this).data(DATA_KEY$6,o)),"string"==typeof e){if(void 0===o[e])throw new TypeError('No method named "'+e+'"');o[e]()}})},t}();if("undefined"!=typeof $){var _$$fn$NAME$defaults,JQUERY_NO_CONFLICT$6=$.fn[NAME$6];$.fn[NAME$6]=Toast._jQueryInterface,$.fn[NAME$6].Constructor=Toast,$.fn[NAME$6].noConflict=function(){return $.fn[NAME$6]=JQUERY_NO_CONFLICT$6,Toast._jQueryInterface},$.fn[NAME$6].defaults=((_$$fn$NAME$defaults={title:"",content:"",template:"",theme:"dark",placement:"bottom-center",placementX:null,placementY:null,animation:!0,animationIn:"slideInUp",animationOut:"slideOutDown",animationSpeed:"faster",offset:null,size:null,dismiss:3,header:!1,faPro:!1,debug:!1,onInitialize:null,onDestroy:null,onInit:null}).onDestroy=null,_$$fn$NAME$defaults.onShow=null,_$$fn$NAME$defaults.onClose=null,_$$fn$NAME$defaults)}var NAME$7="coolDialog",DATA_KEY$7="plugin_coolDialog",Dialog=function(){function t(t,e){this.settings={},window.Cool.settings.dialog?$.extend(!0,this.settings,$.fn[NAME$7].defaults,window.Cool.settings.dialog,e):$.extend(!0,this.settings,$.fn[NAME$7].defaults,e),this.container=t,this.$container=$(this.container),this.debug=this.settings.debug,this.faPro=this.settings.faPro,this.dialogs=[],this.onInitialize=this.settings.onInitialize,this.onDestroy=this.settings.onDestroy}var e=t.prototype;return e.init=function(t){var e={};$.extend(!0,e,this.settings,t);var o=this.buildDialog(e);return this.show(o),this.bindEvents(o),this.onInit(o),o},e.destroy=function(){this.$container.removeData(DATA_KEY$7),this.onDestroy()},e.buildDialog=function(t){var e=this,o={uuid:"dialog-"+this.generateUUID(),title:t.title,template:t.template,body:t.body,footer:t.footer,size:t.size,classes:t.classes,centered:t.centered,backdrop:t.backdrop,preventScroll:t.preventScroll,closeBtn:t.closeBtn,animation:t.animation,animationIn:t.animationIn,animationOut:t.animationOut,animationSpeed:t.animationSpeed,callbacks:t.callbacks,maxBodyHeight:t.maxBodyHeight,overflowVisible:t.overflowVisible,actions:t.actions,onInit:t.onInit,onShow:t.onShow,onClose:t.onClose};return null==o.maxBodyHeight&&(o.maxBodyHeight=window.innerHeight-200),"function"==typeof o.template?o.$el=$(o.template()):o.$el=$(this._renderTemplate(o)),o.show=function(){e.show(o)},o.close=function(){e.close(o)},this.log(o),this.dialogs.push(o),o},e.bindEvents=function(t){var e=this;t.$el.on("click","[data-dialog-close]",function(o){t.$el.trigger("dialog.close"),"function"==typeof t.callbacks.close?t.callbacks.close.call(e,function(){e.close(t)},t):e.close(t)}),t.$el.on("click","[data-dialog-remove]",function(o){t.$el.trigger("dialog.remove"),"function"==typeof t.callbacks.remove&&t.callbacks.remove.call(e,function(){e.close(t)},t)}),t.$el.on("click","[data-dialog-confirm]",debounce(function(o){t.$el.trigger("dialog.close"),"function"==typeof t.callbacks.confirm?t.callbacks.confirm.call(e,function(){e.close(t)},t):e.close(t)}))},e.generateUUID=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var e=16*Math.random()|0;return("x"==t?e:3&e|8).toString(16)})},e.show=function(t){var e=this;if(this.$container.hasClass("has-dialogs")||this.$container.addClass("has-dialogs"),t.preventScroll&&!this.$container.hasClass("dialog-prevent-scroll")&&this.$container.addClass("dialog-prevent-scroll"),this.dialogs.length>1){var o=$(this.dialogs).eq(-2)[0].$el,i=parseInt(o.css("z-index"),10)+1;t.$el.css("z-index",i),o.css({transition:"opacity 0.3s",opacity:0,visibility:"visible"})}if(t.backdrop&&$(".dialog-backdrop").length<1){this.$container.append('<div class="dialog-backdrop"></div>');var n=setInterval(function(){0==e.dialogs.length&&$(".dialog-backdrop").length&&($(".dialog-backdrop").remove(),clearInterval(n))},100)}this.$container.append(t.$el),t.animation&&t.$el.find(".dialog-content").addClass(t.animationSpeed).animateCss(t.animationIn),this.onShow(t)},e.close=function(t){var e=this,o=null;this.dialogs.length>1&&(o=$(this.dialogs).eq(-2)[0].$el),0===$('.dialog[data-dialog-backdrop="true"]').length&&$(".dialog-backdrop").length&&$(".dialog-backdrop").remove(),t.animation?t.$el.find(".dialog-content").animateCss(t.animationOut,function(){t.$el.remove(),e.dialogs=$.grep(e.dialogs,function(e){return e.uuid!=t.uuid}),0==e.dialogs.length?(e.$container.removeClass("has-dialogs"),e.$container.hasClass("dialog-prevent-scroll")&&e.$container.removeClass("dialog-prevent-scroll")):o&&o.css("opacity",1)}):(t.$el.remove(),this.dialogs=$.grep(this.dialogs,function(e){return e.uuid!=t.uuid}),0==this.dialogs.length?(this.$container.removeClass("has-dialogs"),this.$container.hasClass("dialog-prevent-scroll")&&this.$container.removeClass("dialog-prevent-scroll")):o&&o.css("opacity",1)),this.onClose(t)},e.onInitialize=function(){var t=this.onInitialize;"function"==typeof t&&t.call(this.container)},e.onDestroy=function(){var t=this.onDestroy;"function"==typeof t&&t.call(this.container)},e.onInit=function(t){var e=t.onInit;"function"==typeof e&&e.call(t)},e.onShow=function(t){var e=t.onShow;"function"==typeof e&&e.call(t)},e.onClose=function(t){var e=t.onClose;"function"==typeof e&&e.call(t)},e.log=function(){var t;this.debug&&("function"==typeof this.debug?this.debug.apply(this,arguments):(t=console).log.apply(t,arguments))},e._renderFooter=function(t){var e="";if("function"==typeof t.footer)e=t.footer();else if(""!==t.footer&&!1!==t.footer&&!0!==t.footer)e=t.footer;else{if(!0!==t.footer)return e;var o="",i="",n="";t.actions.close.visible&&(o='\n <button type="button" class="btn '+(t.actions.close.primary?"btn-primary":"btn-secondary")+(t.actions.close.classes?" "+t.actions.close.classes:"")+'"'+(t.actions.close.attrs?" "+t.actions.close.attrs:"")+" data-dialog-close>\n "+t.actions.close.content+"\n </button>\n "),t.actions.remove.visible&&(i='\n <button type="button" class="btn '+"btn-remove"+(t.actions.remove.classes?" "+t.actions.remove.classes:"")+'"'+(t.actions.remove.attrs?" "+t.actions.remove.attrs:"")+" data-dialog-remove>\n "+t.actions.remove.content+"\n </button>\n "),t.actions.confirm.visible&&(n='\n <button type="button" class="btn '+(t.actions.confirm.primary?"btn-primary":"btn-secondary")+(t.actions.confirm.classes?" "+t.actions.confirm.classes:"")+'"'+(t.actions.confirm.attrs?" "+t.actions.confirm.attrs:"")+" data-dialog-confirm>\n "+t.actions.confirm.content+"\n </button>\n "),e="\n "+i+'\n <div class="spacer"></div>\n '+o+"\n "+n+"\n "}if(e)return'\n <div class="dialog-footer">\n '+e+"\n </div>\n "},e._renderTemplate=function(t){var e=this.faPro?"far":"fas",o=t.classes?" "+t.classes:"",i=t.centered?" dialog-centered":"",n=t.size?" dialog-"+t.size:"",s=t.overflowVisible?" dialog-overflow-visible":"",a=' data-dialog-uuid="'+t.uuid+'"',l=t.backdrop?' data-dialog-backdrop="true"':' data-dialog-backdrop="false"',r=t.title,h=t.closeBtn?'<button type="button" data-dialog-close><i class="'+e+' fa-times icon"></i></button>':"",c=t.maxBodyHeight?' style="max-height: '+t.maxBodyHeight+'px"':"",d=this._renderFooter(t);return'\n <div class="dialog'+o+i+n+s+'"'+a+l+'>\n\n <div class="dialog-container">\n\n <div class="dialog-content">\n\n <div class="dialog-header">\n\n <span class="dialog-title">\n '+r+"\n </span>\n\n "+h+'\n\n </div>\n\n <div class="dialog-body"'+c+">\n\n "+("function"==typeof t.body?t.body():t.body)+"\n\n </div>\n\n "+d+"\n\n </div>\n\n </div>\n\n </div>\n "},t._jQueryInterface=function(e){var o=$(this).data(DATA_KEY$7);if(o||(o=new t(this,"object"==typeof e&&e),$(this).data(DATA_KEY$7,o)),"string"==typeof e){if(void 0===o[e])throw new TypeError('No method named "'+e+'"');o[e]()}},t}();if("undefined"!=typeof $){var _$$fn$NAME$defaults$1,JQUERY_NO_CONFLICT$7=$.fn[NAME$7];$.fn[NAME$7]=Dialog._jQueryInterface,$.fn[NAME$7].Constructor=Dialog,$.fn[NAME$7].noConflict=function(){return $.fn[NAME$7]=JQUERY_NO_CONFLICT$7,Dialog._jQueryInterface},$.fn[NAME$7].defaults=((_$$fn$NAME$defaults$1={title:"",template:"",body:"",footer:!0,size:"",classes:"",centered:!0,backdrop:!0,preventScroll:!0,closeBtn:!0,animation:!0,animationIn:"zoomIn",animationOut:"fadeOut",animationSpeed:"fastest",callbacks:{},maxBodyHeight:null,overflowVisible:!1,faPro:!1,debug:!0,onInitialize:null,onDestroy:null,onInit:null}).onDestroy=null,_$$fn$NAME$defaults$1.onShow=null,_$$fn$NAME$defaults$1.onClose=null,_$$fn$NAME$defaults$1.actions={close:{primary:!1,visible:!0,content:"Close",classes:"",attrs:""},remove:{primary:!1,visible:!0,content:"Remove",classes:"",attrs:""},confirm:{primary:!0,visible:!0,content:"Confirm",classes:"",attrs:""}},_$$fn$NAME$defaults$1)}var index_esm={Common:Common,Popover:Popover,Select:Select,Dropdown:Dropdown,Tooltip:Tooltip,SectionTabs:SectionTabs,Collapse:Collapse,Toast:Toast,Dialog:Dialog};export default index_esm;
6
+ const _instanceMap=new WeakMap;class Component{static instances=[];static initializeElement(t,e={}){const i="string"==typeof t?document.querySelector(t):t;if(!i)return!1;const s=`plugin_${this.NAME}`;let n=_instanceMap.has(i)&&_instanceMap.get(i)[s];if(!n&&"undefined"!=typeof $&&$.fn&&(n=$(i).data(s)),!n){const t=new this(i,e);return _instanceMap.has(i)||_instanceMap.set(i,{}),_instanceMap.get(i)[s]=t,"undefined"!=typeof $&&$.fn&&$(i).data(s,t),this.instances.push(t),t}return!1}static initializeElements(t,e={}){return document.querySelectorAll(t).forEach(t=>{this.initializeElement(t,e)}),this.instances}static getInstance(t){const e=`plugin_${this.NAME}`,i=_instanceMap.get(t);if(i&&i[e])return i[e];if("undefined"!=typeof $&&$.fn&&$(t).data(e)){const i=$(t).data(e);return _instanceMap.has(t)||_instanceMap.set(t,{}),_instanceMap.get(t)[e]=i,i}return null}static removeInstance(t){const e=`plugin_${this.NAME}`,i=_instanceMap.get(t);i&&(delete i[e],0===Object.keys(i).length&&_instanceMap.delete(t)),"undefined"!=typeof $&&$.fn&&$(t).removeData(e)}onInit(){let t=this.opts.onInit;"function"==typeof t&&t.call(this)}onUpdate(){let t=this.opts.onUpdate;"function"==typeof t&&t.call(this)}onDestroy(){let t=this.opts.onDestroy;"function"==typeof t&&t.call(this)}onShow(){let t=this.opts.onShow;"function"==typeof t&&t.call(this)}onClose(){let t=this.opts.onClose;"function"==typeof t&&t.call(this)}onReset(){let t=this.opts.onReset;"function"==typeof t&&t.call(this)}}class ResizeManager{constructor(){this.callbacks=new WeakMap,this.observer=null,this.rafId=null,this.windowCallbacks=new Set,this.isWindowListening=!1}observe(t,e){this.observer||(this.observer=new ResizeObserver(t=>{this.rafId&&cancelAnimationFrame(this.rafId),this.rafId=requestAnimationFrame(()=>{t.forEach(t=>{const e=this.callbacks.get(t.target);e&&e(t)})})})),this.callbacks.set(t,e),this.observer.observe(t),this.windowCallbacks.add(e),this.isWindowListening||this.startWindowListening()}unobserve(t){if(this.observer){this.observer.unobserve(t);const e=this.callbacks.get(t);e&&this.windowCallbacks.delete(e),this.callbacks.delete(t),0===this.windowCallbacks.size&&this.stopWindowListening()}}startWindowListening(){this.isWindowListening=!0,window.addEventListener("resize",this.handleWindowResize,{passive:!0})}stopWindowListening(){this.isWindowListening=!1,window.removeEventListener("resize",this.handleWindowResize)}handleWindowResize=()=>{this.rafId&&cancelAnimationFrame(this.rafId),this.rafId=requestAnimationFrame(()=>{this.windowCallbacks.forEach(t=>{t({target:window,contentRect:{width:window.innerWidth,height:window.innerHeight}})})})};disconnect(){this.observer&&(this.observer.disconnect(),this.callbacks=new WeakMap),this.rafId&&(cancelAnimationFrame(this.rafId),this.rafId=null),this.windowCallbacks.clear(),this.stopWindowListening()}}class ScrollManager{constructor(){this.callbacks=new Map,this.rafId=null,this.isListening=!1}add(t,e){this.callbacks.set(t,e),this.isListening||this.startListening()}remove(t){this.callbacks.delete(t),0===this.callbacks.size&&this.stopListening()}startListening(){this.isListening=!0;const t=document.querySelector(".site-main .content");t?(this.scrollElement=t,this.scrollElement.addEventListener("scroll",this.handleScroll,{passive:!0})):(this.scrollElement=window,window.addEventListener("scroll",this.handleScroll,{passive:!0}))}stopListening(){this.isListening=!1,this.scrollElement&&(this.scrollElement.removeEventListener("scroll",this.handleScroll),this.scrollElement=null),this.rafId&&(cancelAnimationFrame(this.rafId),this.rafId=null)}handleScroll=()=>{this.rafId&&cancelAnimationFrame(this.rafId),this.rafId=requestAnimationFrame(()=>{this.callbacks.forEach(t=>t())})}}const resizeManager=new ResizeManager,scrollManager=new ScrollManager,debounce=function(t,e,i){let s;return function(){let i=this,n=arguments;clearTimeout(s),s=setTimeout(function(){s=null,t.apply(i,n)},e)}},touchEvents=function(){let t=!1;return("ontouchstart"in window||navigator.maxTouchPoints>0)&&(t=!0),t},generateUUID=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){let e=16*Math.random()|0;return("x"===t?e:3&e|8).toString(16)})},escapeHtml=function(t){const e=document.createTextNode(t),i=document.createElement("p");return i.appendChild(e),i.innerHTML},playAnimation=function(t,e){const i=t&&t.jquery?t[0]:t;return i?new Promise(t=>{const s=["animation",e];i.classList.add(...s),i.addEventListener("animationend",function e(n){n.stopPropagation(),i.classList.remove(...s),i.removeEventListener("animationend",e),t()},{once:!0})}):Promise.resolve()},escapeChar=t=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;","=":"&#x3D;"}[t]),escape=t=>{if("string"!=typeof t){if(null===t)return"";if(!t)return String(t);t=String(t)}return/[&<>"'`=]/.test(t)?t.replace(/[&<>"'`=]/g,escapeChar):t};function deepMerge(t,...e){for(const i of e)if(i&&"object"==typeof i)for(const e of Object.keys(i)){const s=i[e],n=t[e];s&&"object"==typeof s&&!Array.isArray(s)&&n&&"object"==typeof n&&!Array.isArray(n)?t[e]=deepMerge({},n,s):t[e]=s}return t}class Section extends Component{static NAME="coolSection";static DEFAULTS={observeSections:!0,initFormControls:!0,initTableHandlers:!0,initButtonGroups:!0,initTabs:!0,onInit:null,onDestroy:null};constructor(t){super(),this.opts=deepMerge({},Section.DEFAULTS,window.Cool?.settings?.section||{},t||{}),this._eventHandlers=[],this._updateTimeout=null,this._rafId=null,this.init()}init(){this.opts.observeSections&&this.initializeSectionObserver(),this.opts.initFormControls&&this.initializeFormControls(),this.opts.initTableHandlers&&this.initializeTableHandlers(),this.opts.initButtonGroups&&this.initializeButtonGroups(),this.opts.initTabs&&this.initializeTabs(),this.onInit()}destroy(){this.destroySectionObserver(),this.unbindEvents(),this._updateTimeout&&clearTimeout(this._updateTimeout),this._rafId&&cancelAnimationFrame(this._rafId),this.onDestroy()}_addEventListener(t,e,i,s){t.addEventListener(e,i,s),this._eventHandlers.push({element:t,event:e,handler:i,options:s})}initializeSectionObserver(){this._isUpdating=!1,this.sectionObserver=new MutationObserver(t=>{if(this._isUpdating)return;t.every(t=>{if("attributes"===t.type&&"class"===t.attributeName){const e=t.target,i=t.oldValue?t.oldValue.split(" "):[],s=Array.from(e.classList);return[...s.filter(t=>!i.includes(t)),...i.filter(t=>!s.includes(t))].every(t=>"is-last-visible"===t||"is-last-visible-row"===t||"is-last-visible-cell"===t)}return!1})||(this._updateTimeout&&clearTimeout(this._updateTimeout),this._updateTimeout=setTimeout(()=>{this._rafId&&cancelAnimationFrame(this._rafId),this._rafId=requestAnimationFrame(()=>{this.updateLastVisibleElements()})},50))}),this.sectionObserver.observe(document.body,{attributes:!0,childList:!0,subtree:!0,attributeFilter:["class","style","hidden"],attributeOldValue:!0,subtreeFilter:t=>t.classList&&(t.classList.contains("section")||t.classList.contains("select")||"TABLE"===t.nodeName||"TR"===t.nodeName||"TD"===t.nodeName||"TH"===t.nodeName)}),this.updateLastVisibleElements()}updateLastVisibleElements(){this._isUpdating=!0;const t={sections:[],tables:[],rows:[]};document.querySelectorAll(".section").forEach(e=>{const i=this.getVisibleChildren(e);i.length&&t.sections.push({section:e,lastVisible:i[i.length-1]})}),document.querySelectorAll("table").forEach(e=>{const i=e.querySelector("tbody")||e,s=this.getVisibleElements(i.querySelectorAll("tr"));s.length&&t.tables.push({tbody:i,lastVisibleRow:s[s.length-1]})}),document.querySelectorAll("table tr").forEach(e=>{const i=this.getVisibleElements(e.querySelectorAll("td, th"));i.length&&t.rows.push({row:e,lastVisibleCell:i[i.length-1]})}),requestAnimationFrame(()=>{document.querySelectorAll(".is-last-visible, .is-last-visible-row, .is-last-visible-cell").forEach(t=>{t.classList.remove("is-last-visible","is-last-visible-row","is-last-visible-cell")}),t.sections.forEach(({lastVisible:t})=>{t.classList.add("is-last-visible")}),t.tables.forEach(({lastVisibleRow:t})=>{t.classList.add("is-last-visible-row")}),t.rows.forEach(({lastVisibleCell:t})=>{t.classList.add("is-last-visible-cell")}),setTimeout(()=>{this._isUpdating=!1},0)})}getVisibleChildren(t){return Array.from(t.children).filter(t=>this.isElementVisible(t))}getVisibleElements(t){return Array.from(t).filter(t=>this.isElementVisible(t))}isElementVisible(t){return t._computedStyle&&!t._styleInvalidated||(t._computedStyle=window.getComputedStyle(t),t._styleInvalidated=!1),!t.classList.contains("d-none")&&!t.classList.contains("d-md-none")&&null!==t.offsetParent&&t.offsetHeight>0&&"none"!==t._computedStyle.display}destroySectionObserver(){this.sectionObserver&&(this.sectionObserver.disconnect(),this.sectionObserver=null),this._updateTimeout&&(clearTimeout(this._updateTimeout),this._updateTimeout=null),this._rafId&&(cancelAnimationFrame(this._rafId),this._rafId=null)}initializeFormControls(){this._addEventListener(document,"focusin",t=>{const e=t.target.closest(".form-control");if(e&&!e.disabled&&!e.readOnly){const t=e.closest(".input-group");t?.classList.add("input-group-focus")}}),this._addEventListener(document,"focusout",t=>{const e=t.target.closest(".form-control");if(e&&!e.disabled&&!e.readOnly){const t=e.closest(".input-group");t?.classList.remove("input-group-focus")}});const t=t=>{const e=t.querySelector("input, select"),i=!!e?.value;t.classList.toggle("label-on-top",i)};this._addEventListener(document,"input",e=>{const i=e.target.closest(".form-label-group");i&&t(i)}),this._addEventListener(document,"change",e=>{const i=e.target.closest(".form-label-group");i&&t(i),e.target.matches("select")&&e.target.blur()}),document.querySelectorAll(".form-label-group").forEach(t)}initializeTableHandlers(){document.querySelectorAll(".table").forEach(t=>{t.querySelector("[data-table-link], [data-table-btn]")&&!t.classList.contains("table-hover")&&t.classList.add("table-hover")}),this._addEventListener(document,"click",t=>{if(t.target.closest("[data-table-link] .table-link-exclude, [data-table-link] input, [data-table-link] button, [data-table-link] a, [data-table-link] label, [data-table-link] .td-col-select"))return void t.stopPropagation();const e=t.target.closest("[data-table-link]");if(e){const i=e.closest("table, .table"),s=e.dataset.tableLink;if(i?.classList.contains("bulk-actions-active"))return;t.ctrlKey||t.metaKey?window.open(s,"_blank"):window.location.href=s}if(t.target.closest("[data-table-btn] .table-btn-exclude, [data-table-btn] input, [data-table-btn] button, [data-table-btn] a, [data-table-btn] label, [data-table-btn] .td-col-select"))return void t.stopPropagation();const i=t.target.closest("[data-table-btn]");if(i){const t=i.closest("tr, .tr"),e=i.querySelector("button");if(!e||t?.classList.contains("bulk-actions-active"))return;e.click()}})}initializeButtonGroups(){this._addEventListener(document,"click",t=>{const e=t.target.closest(".btn-group-toggle .btn");if(e&&!t.target.matches("input")){const t=e.querySelector("input");t&&(t.click(),t.dispatchEvent(new Event("change",{bubbles:!0})))}t.target.matches(".btn-group-toggle .btn > input")&&t.stopPropagation()}),this._addEventListener(document,"change",t=>{if(t.target.matches('.btn-group-toggle .btn > input[type="radio"]')){const e=t.target.parentElement.closest(".btn-group-toggle");e&&e.querySelectorAll(".btn").forEach(t=>{t.classList.toggle("active",t.querySelector("input")?.checked)})}else if(t.target.matches('.btn-group-toggle .btn > input[type="checkbox"]')){t.target.parentElement.classList.toggle("active",t.target.checked)}})}initializeTabs(){this._addEventListener(document,"click",t=>{const e=t.target.closest(".tabs .tab-item");if(e){t.stopPropagation();e.closest(".tabs").querySelectorAll(".tab-item").forEach(t=>t.classList.remove("active")),e.classList.add("active")}})}unbindEvents(){this._eventHandlers.forEach(({element:t,event:e,handler:i,options:s})=>{t.removeEventListener(e,i,s)}),this._eventHandlers=[]}refresh(){document.querySelectorAll(".form-label-group").forEach(t=>{const e=t.querySelector("input, select"),i=e?.value;t.classList.toggle("label-on-top",!!i)})}}let PerfectScrollbar$2=null;try{PerfectScrollbar$2=require("perfect-scrollbar"),PerfectScrollbar$2&&PerfectScrollbar$2.default&&(PerfectScrollbar$2=PerfectScrollbar$2.default)}catch(t){}"undefined"!=typeof window&&PerfectScrollbar$2&&!window.PerfectScrollbar&&(window.PerfectScrollbar=PerfectScrollbar$2);class Sidebar extends Component{static NAME="coolSidebar";static DEFAULTS={floating:!0,breakpoint:1046,wheelSpeed:2,wheelPropagation:!0,minScrollbarLength:20,suppressScrollX:!0,onInit:null,onDestroy:null,onShow:null,onClose:null};static _jQueryInterface(t){const e=$(this);let i=e.data(`plugin_${Sidebar.NAME}`);i||(i=new Sidebar(this,"object"==typeof t&&t),e.data(`plugin_${Sidebar.NAME}`,i)),"string"==typeof t&&i[t]()}static _jQueryInit(){if("undefined"==typeof $||!$.fn)return;const t=$.fn[Sidebar.NAME];$.fn[Sidebar.NAME]=Sidebar._jQueryInterface,$.fn[Sidebar.NAME].Constructor=Sidebar,$.fn[Sidebar.NAME].defaults=Sidebar.DEFAULTS||{},$.fn[Sidebar.NAME].noConflict=()=>($.fn[Sidebar.NAME]=t,Sidebar._jQueryInterface)}constructor(t,e){super(),this.opts=deepMerge({},Sidebar.DEFAULTS,window.Cool?.settings?.sidebar||{},e||{}),this.el=t,t&&t.jquery&&(this.el=t[0]),this.init()}init(){this.buildCache(),this.bindEvents(),this.initializeScrollbars(),this.initializeTabs(),this.onInit()}destroy(){this.unbindEvents(),this.destroyScrollbars(),this.onDestroy()}buildCache(){this.content=this.el.querySelector(".sidebar-content"),this.toggler=document.querySelector(".sidebar-left-toggler"),this.isFloating=this.el.classList.contains("sidebar-floating"),this.isOpen=document.body.classList.contains("sidebar-left-open"),this.tabs=Array.from(this.el.querySelectorAll(".sidebar-tab")),this.tabSelectors=Array.from(document.querySelectorAll('[name="sidebar-tab-select"]'))}bindEvents(){if(this._toggleHandler=t=>{const e=t.target.closest(".sidebar-left-toggler");e&&this.handleToggle(t,e)},this._mousedownHandler=t=>{if(t.target.matches(".sidebar-content .ps__thumb-y")){const e=t.target.closest(".sidebar-content");e?.classList.add("ps-mousedown-scroll"),this.mousedownScrollbar=!0}},this._mouseupHandler=()=>{this.mousedownScrollbar&&(document.querySelectorAll(".sidebar-content.ps-mousedown-scroll").forEach(t=>t.classList.remove("ps-mousedown-scroll")),this.mousedownScrollbar=!1)},this._tabSelectHandler=t=>{t.target.matches('[name="sidebar-tab-select"]')&&this.switchTab(t.target.value)},this._collapseClickHandler=t=>{const e=t.target.closest('[data-toggle="collapse"]');if(!e)return;const i=e.dataset.breakpoint;if(i&&window.matchMedia(`(min-width: ${i}px)`).matches){let i=e.nextElementSibling?.querySelector("li a")||e.parentElement.nextElementSibling?.querySelector("li a");i&&(t.metaKey||t.ctrlKey?window.open(i.href,"_blank").focus():window.location.href=i.href)}else setTimeout(()=>this.scrollbar?.update(),300)},window.ResizeObserver)this.resizeObserver=new ResizeObserver(t=>{this.rafId&&cancelAnimationFrame(this.rafId),this.rafId=requestAnimationFrame(()=>{window.innerWidth>this.opts.breakpoint&&this.removeBackdrop()})}),this.resizeObserver.observe(document.body);else{let t;this._resizeHandler=()=>{clearTimeout(t);const e=performance.now();!this.lastResizeTime||e-this.lastResizeTime>100?(window.innerWidth>this.opts.breakpoint&&this.removeBackdrop(),this.lastResizeTime=e):t=setTimeout(()=>{window.innerWidth>this.opts.breakpoint&&this.removeBackdrop()},16)},window.addEventListener("resize",this._resizeHandler,{passive:!0})}document.addEventListener("click",this._toggleHandler),document.addEventListener("click",this._tabSelectHandler),document.addEventListener("mousedown",this._mousedownHandler),document.addEventListener("mouseup",this._mouseupHandler),this.content&&this.content.addEventListener("click",this._collapseClickHandler)}unbindEvents(){document.removeEventListener("click",this._toggleHandler),document.removeEventListener("click",this._tabSelectHandler),document.removeEventListener("mousedown",this._mousedownHandler),document.removeEventListener("mouseup",this._mouseupHandler),this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null),this.rafId&&(cancelAnimationFrame(this.rafId),this.rafId=null),this._resizeHandler&&(window.removeEventListener("resize",this._resizeHandler),this._resizeHandler=null),this.content&&this.content.removeEventListener("click",this._collapseClickHandler)}initializeScrollbars(){this.content&&(PerfectScrollbar$2?this.scrollbar=new PerfectScrollbar$2(this.content,{wheelSpeed:this.opts.wheelSpeed,wheelPropagation:this.opts.wheelPropagation,minScrollbarLength:this.opts.minScrollbarLength,suppressScrollX:this.opts.suppressScrollX}):this.content.style.overflowY="auto")}initializeTabs(){this.tabScrollbars=new Map,this.tabs.forEach(t=>{const e=t.querySelector(".tab-content");if(e)if(PerfectScrollbar$2){const i=new PerfectScrollbar$2(e,{wheelSpeed:this.opts.wheelSpeed,wheelPropagation:this.opts.wheelPropagation,minScrollbarLength:this.opts.minScrollbarLength,suppressScrollX:this.opts.suppressScrollX});this.tabScrollbars.set(t,i)}else e.style.overflowY="auto"})}destroyScrollbars(){this.scrollbar&&(this.scrollbar.destroy(),this.scrollbar=null),this.tabScrollbars.forEach(t=>t.destroy()),this.tabScrollbars.clear()}toggleWithTransition(t){const e=document.documentElement;e.classList.add("sidebar-transitioning"),"open"===t?(document.body.classList.add("sidebar-left-open"),this.isFloating&&window.innerWidth<=this.opts.breakpoint&&this.createBackdrop()):(document.body.classList.remove("sidebar-left-open"),this.removeBackdrop()),setTimeout(()=>{e.classList.remove("sidebar-transitioning")},330)}createBackdrop(){if(document.querySelector(".sidebar-backdrop"))return;const t=document.createElement("div");t.className="sidebar-backdrop",t.addEventListener("click",()=>{this.toggleWithTransition("close"),this.toggler&&(this.toggler.classList.remove("open"),null!==this.toggler.ariaExpanded&&(this.toggler.ariaExpanded="false"))});const e=document.querySelector(".site-main");e&&(e.appendChild(t),requestAnimationFrame(()=>{t.classList.add("show")}))}removeBackdrop(){const t=document.querySelector(".sidebar-backdrop");t&&(t.classList.remove("show"),t.addEventListener("transitionend",()=>{t.remove()},{once:!0}),setTimeout(()=>{t?.remove()},330))}handleToggle(t,e){if(t.stopPropagation(),!e)return;null!==e.ariaExpanded&&(e.ariaExpanded="true"!==e.ariaExpanded),e.classList.toggle("open");const i=document.body.classList.contains("sidebar-left-open");this.toggleWithTransition(i?"close":"open"),i?this.onClose():this.onShow()}switchTab(t){const e=document.getElementById(`sidebar-tab-${t}`);if(!e)return;const i=this.tabs;i.forEach(t=>{if(t.classList.toggle("active",t===e),t!==e){const s=t.querySelector(".tab-content");if(s)if(t===i[0])s.style.transform="translate3d(100%, 0px, 0px)";else if(t===i[i.length-1])s.style.transform="translate3d(-100%, 0px, 0px)";else{const n=i.indexOf(t)<i.indexOf(e);s.style.transform=`translate3d(${n?"-100%":"100%"}, 0px, 0px)`}}});const s=e.querySelector(".tab-content");s&&(s.style.transform="none"),this.tabSelectors.forEach(e=>{e.classList.toggle("active",e.value===t)})}toggle(){const t=document.body.classList.contains("sidebar-left-open");this.toggleWithTransition(t?"close":"open")}open(){document.body.classList.contains("sidebar-left-open")||this.toggleWithTransition("open")}close(){document.body.classList.contains("sidebar-left-open")&&this.toggleWithTransition("close")}}Sidebar._jQueryInit();class Popover extends Component{static NAME="coolPopover";static DEFAULTS={container:"body",containerAutoDetect:!1,trigger:"focus",placement:"bottom",align:"center",offset:null,collisionDetection:!0,title:"",content:"",onInit:null,onUpdate:null,onDestroy:null,onShow:null,onClose:null};static _jQueryInterface(t){return this.each(function(){const e=$(this);let i=e.data(`plugin_${Popover.NAME}`);i||(i=new Popover(this,"object"==typeof t&&t),e.data(`plugin_${Popover.NAME}`,i)),"string"==typeof t&&i[t]()})}static _jQueryInit(){if("undefined"==typeof $||!$.fn)return;const t=$.fn[Popover.NAME];$.fn[Popover.NAME]=Popover._jQueryInterface,$.fn[Popover.NAME].Constructor=Popover,$.fn[Popover.NAME].defaults=Popover.DEFAULTS||{},$.fn[Popover.NAME].noConflict=()=>($.fn[Popover.NAME]=t,Popover._jQueryInterface)}constructor(t,e){super(),this.opts=deepMerge({},Popover.DEFAULTS,window.Cool?.settings?.popover||{},e||{}),this.el=t,this.init()}init(){this.buildCache(),this.bindEvents(),this.onInit()}destroy(){this.unbindEvents(),this.popoverEl&&(this.popoverEl.remove(),this.popoverEl=null),this.constructor.removeInstance(this.el),this.onDestroy()}update(){this.buildCache(),this.popoverEl&&this.setPosition(),this.onUpdate()}buildCache(){this.containerEl=this.el.dataset.container?document.querySelector(this.el.dataset.container):document.querySelector(this.opts.container),this.containerAutoDetect=void 0!==this.el.dataset.containerAutoDetect?this.el.dataset.containerAutoDetect:void 0!==this.el.dataset.containerautodetect?this.el.dataset.containerautodetect:this.opts.containerAutoDetect,this.id="popover-"+generateUUID(),this.trigger=this.el.dataset.trigger||this.opts.trigger,this.placement=this.el.dataset.placement||this.opts.placement,this.align=this.el.dataset.align||this.opts.align,this.title=this.el.dataset.title||this.opts.title,this.content=this.el.dataset.content||this.opts.content,this.offset=this.el.dataset.offset||this.opts.offset,this.collisionDetection="false"!==(this.el.dataset.collisionDetection||this.el.dataset.collisiondetection)&&(this.el.dataset.collisionDetection||this.el.dataset.collisiondetection||this.opts.collisionDetection),this.containerAutoDetect&&(this.containerEl=this.el.offsetParent||document.body)}bindEvents(){"click"===this.trigger?(this._clickHandler=()=>{this.popoverEl?this.close():this.show()},this.el.addEventListener("click",this._clickHandler)):"hover"===this.trigger?(this._mouseenterHandler=()=>{clearTimeout(this.hoverTimeout),this.show()},this._mouseleaveHandler=()=>{this.hoverTimeout=setTimeout(()=>{this.popupHasFocus||this.close()},100)},this.el.addEventListener("mouseenter",this._mouseenterHandler),this.el.addEventListener("mouseleave",this._mouseleaveHandler)):"focus"===this.trigger&&(this._focusinHandler=()=>this.show(),this._focusoutHandler=()=>this.close(),this.el.addEventListener("focusin",this._focusinHandler),this.el.addEventListener("focusout",this._focusoutHandler)),window.ResizeObserver&&(this._resizeCallback=()=>{this.popoverEl&&this.popoverEl.classList.contains("show")&&requestAnimationFrame(()=>{this.setPosition()})},resizeManager.observe(this.el,this._resizeCallback))}unbindEvents(){this._clickHandler&&this.el.removeEventListener("click",this._clickHandler),this._mouseenterHandler&&this.el.removeEventListener("mouseenter",this._mouseenterHandler),this._mouseleaveHandler&&this.el.removeEventListener("mouseleave",this._mouseleaveHandler),this._focusinHandler&&this.el.removeEventListener("focusin",this._focusinHandler),this._focusoutHandler&&this.el.removeEventListener("focusout",this._focusoutHandler),this._resizeCallback&&(resizeManager.unobserve(this.el),this._resizeCallback=null)}buildPopover(){let t;t="function"==typeof this.content?this.content():this.content,this.popoverEl=document.createElement("div"),this.popoverEl.className="popover",this.popoverEl.setAttribute("role","tooltip"),this.popoverEl.id=this.id,this.popoverEl.innerHTML=`\n <h3 class="popover-header">${this.title}</h3>\n <div class="popover-body">${t}</div>\n `,this.containerEl.appendChild(this.popoverEl),this.popoverEl.addEventListener("mouseenter",()=>{this.popupHasFocus=!0,"hover"===this.trigger&&this.hoverTimeout&&clearTimeout(this.hoverTimeout)}),this.popoverEl.addEventListener("mouseleave",()=>{this.popupHasFocus=!1,"hover"===this.trigger&&(this.hoverTimeout=setTimeout(()=>{this.close()},100))})}setPosition(t){null==t&&(t=this.placement);const e=window.innerWidth,i=window.innerHeight,s=this.popoverEl.offsetWidth,n=this.popoverEl.offsetHeight,o=this.el.offsetWidth,l=this.el.offsetHeight;let a,r;const c=this.containerEl.getBoundingClientRect(),h=c.left+window.scrollX,d=c.top+window.scrollY,p=this.el.getBoundingClientRect(),u=p.left+window.scrollX,m=p.top+window.scrollY;a=u-h,r=m-d;let f=0,b=0,g=0,y=0;if(this.offset){const t=this.offset.split(",");g=parseInt(t[0],10)||0,y=parseInt(t[1],10)||0}const E=getComputedStyle(this.popoverEl),w=parseInt(E.getPropertyValue("--cool-popover-spacer"))||8,v=(t,e=this.align)=>{let i=0,c=0;switch(t){case"top":i="end"===e?a+o-s:"center"===e?a+(o-s)/2:a,c=r-n-w;break;case"bottom":i="end"===e?a+o-s:"center"===e?a+(o-s)/2:a,c=r+l+w;break;case"left":i=a-s-w,c="end"===e?r+l-n:"center"===e?r+(l-n)/2:r;break;case"right":i=a+o+w,c="end"===e?r+l-n:"center"===e?r+(l-n)/2:r}return{x:i+g,y:c+y}};let C=t,S=this.align,_=v(t);if(this.collisionDetection){const o=5,l=t=>{const l={top:!1,bottom:!1,left:!1,right:!1},a=h+t.x,r=d+t.y,c=a+s,p=r+n;return l.top=r<o,l.bottom=p>i-o,l.left=a<o,l.right=c>e-o,l},a=l(_);"bottom"===t&&a.bottom&&!a.top?(C="top",_=v("top",S)):"top"===t&&a.top&&!a.bottom?(C="bottom",_=v("bottom",S)):"right"===t&&a.right&&!a.left?(C="left",_=v("left",S)):"left"===t&&a.left&&!a.right&&(C="right",_=v("right",S));const r=l(_);"top"!==C&&"bottom"!==C||("end"===S&&r.left&&!r.right?(S="start",_=v(C,S)):"start"===S&&r.right&&!r.left&&(S="end",_=v(C,S)));const c=l(_);c.left?_.x+=o-(h+_.x):c.right&&(_.x-=h+_.x+s-(e-o)),c.top?_.y+=o-(d+_.y):c.bottom&&(_.y-=d+_.y+n-(i-o))}f=_.x,b=_.y,Object.assign(this.popoverEl.style,{transform:`translate3d(${Math.round(f)}px, ${Math.round(b)}px, 0px)`,willChange:"transform"}),this.popoverEl.setAttribute("x-placement",C+"-"+S)}show(){this.popoverEl||(this.buildPopover(),this.setPosition(),this.popoverEl.classList.add("show"),this.el.setAttribute("data-popover",this.id),this.onShow())}close(){this.popoverEl&&(this.popoverEl.remove(),this.el.removeAttribute("data-popover"),this.popoverEl=null,this.onClose())}}Popover._jQueryInit();let PerfectScrollbar$1=null;try{PerfectScrollbar$1=require("perfect-scrollbar"),PerfectScrollbar$1&&PerfectScrollbar$1.default&&(PerfectScrollbar$1=PerfectScrollbar$1.default)}catch(t){}"undefined"!=typeof window&&PerfectScrollbar$1&&!window.PerfectScrollbar&&(window.PerfectScrollbar=PerfectScrollbar$1);const _itemDataMap=new WeakMap;function _outerHeight(t){if(!t)return 0;const e=getComputedStyle(t);return t.offsetHeight+parseInt(e.marginTop,10)+parseInt(e.marginBottom,10)}class Select extends Component{static NAME="coolSelect";static DEFAULTS={name:"",type:"checkbox",labelTemplate:null,confirmCheck:null,confirmUncheck:null,setData:null,scrollContentHeight:300,useNativeScroll:!1,contentWidth:null,faPro:!1,items:[],showSearch:!1,showFooter:!1,searchApi:!1,onInit:null,onUpdate:null,onDestroy:null,onShow:null,onClose:null,onReset:null,onSearch:null,onSelect:null,buildScroll:null,searchPlaceholder:null,btnCloseText:null,dynamicTitle:!1,dynamicTitleDefault:"",dynamicTitleEmptyDefault:"",allowNoneOnRadioSelect:!0,preventUncheck:!1,showValidStateIcon:!0,itemsToExclude:[],primaryKeyword:"id",position:"absolute",scrollEl:".content",useChips:!1};static _jQueryInterface(t){return this.each(function(){const e=$(this);let i=e.data(`plugin_${Select.NAME}`);i||(i=new Select(this,"object"==typeof t&&t),e.data(`plugin_${Select.NAME}`,i)),"string"==typeof t&&i[t]()})}static _jQueryInit(){if("undefined"==typeof $||!$.fn)return;const t=$.fn[Select.NAME];$.fn[Select.NAME]=Select._jQueryInterface,$.fn[Select.NAME].Constructor=Select,$.fn[Select.NAME].defaults=Select.DEFAULTS||{},$.fn[Select.NAME].noConflict=()=>($.fn[Select.NAME]=t,Select._jQueryInterface)}constructor(t,e){super(),this.opts=deepMerge({},Select.DEFAULTS,window.Cool?.settings?.select||{},e||{}),this.el=t,this.useChips=!1,this.cachedTitle="",this.lastSearchQuery="",this._resizeCallback=null,this._scrollCallback=null,this.init()}init(){this.buildCache(),this.buildScroll(),this.bindEvents(),this.onInit()}destroy(){this.unbindEvents(),this.constructor.removeInstance(this.el),this.onDestroy()}update(){this.buildCache(),this.bindEvents();let t=Promise.resolve();return this.searchApi&&this.searchApi.length&&(t=this._performInitialSearch()),t.then(()=>{this.onUpdate()})}reset(){this.data={},this.data[this.name]=[],this.items=[],this.selectEl.querySelectorAll(".select-item").forEach(t=>t.remove()),this.selectItems=[],this.selectIconContainerEl&&(this.selectIconContainerEl.innerHTML=this.selectIconDefault),this.selectHeaderEl.classList.remove("select-placeholder"),"function"==typeof this.dynamicTitle?this.selectTitleEl.textContent=this.dynamicTitle.call(this):(0==this.data[this.name].length&&this.dynamicTitle&&this.dynamicTitleDefault&&0!==this.dynamicTitleDefault&&0==this.selectTitleEl.textContent.trim()&&(this.selectItems.length>0||this.searchApi)&&(this.selectTitleEl.textContent=this.dynamicTitleDefault),0==this.selectItems.length&&!this.searchApi&&this.dynamicTitle&&this.dynamicTitleEmptyDefault&&0!==this.dynamicTitleEmptyDefault&&(this.selectHeaderEl.classList.add("select-placeholder"),this.selectIconContainerEl&&this.selectIconContainerEl.classList.add("d-none"),this.selectTitleEl.textContent=this.dynamicTitleEmptyDefault)),this.showSearch&&(this.searchData=[],this.searchInputEl.value="",this.searchString="",this.search.call(this))}buildCache(){if(this.containerEl=this.el.parentElement,this.selectHeaderEl=this.el.querySelector(".select-header"),this.selectTitleEl=this.el.querySelector(".select-title"),this.cachedTitle=this.selectTitleEl?this.selectTitleEl.textContent:"",this.selectIconContainerEl=this.selectHeaderEl?this.selectHeaderEl.querySelector(".select-icon"):null,this.searchIconContainerEl=this.el.querySelector(".select-search-icon"),this.selectIconDefault=this.selectIconContainerEl?this.selectIconContainerEl.innerHTML:'<i class="'+(this.opts.faPro?"fal":"fas")+'fa-angle-down icon"></i>',this.name=this.el.dataset.name||this.opts.name,this.scroll=null,this.scrollContentHeight=this.el.dataset.scrollContentHeight||this.el.dataset.scrollcontentheight||this.opts.scrollContentHeight,this.useNativeScroll=this.el.dataset.useNativeScroll||this.el.dataset.usenativescroll||this.opts.useNativeScroll,this.contentWidth=this.el.dataset.contentWidth||this.el.dataset.contentwidth||this.opts.contentWidth,this.items=this.el.dataset.items?JSON.parse(this.el.dataset.items):this.opts.items,this.data={},this.data[this.name]=[],this.searchData=[],this.searchApi=this.el.dataset.searchApi||this.el.dataset.searchapi||this.opts.searchApi,this.searchRequest=null,this.type=this.el.dataset.type||this.opts.type,this.contentOpen=this.el.classList.contains("show"),this.searchPlaceholder=this.el.dataset.searchPlaceholder||this.opts.searchPlaceholder,this.btnCloseText=this.el.dataset.btnCloseText||this.opts.btnCloseText,this.labelTemplate=this.opts.labelTemplate,this.confirmCheck=this.opts.confirmCheck,this.confirmUncheck=this.opts.confirmUncheck,this.preventUncheck=this.el.dataset.preventUncheck||this.el.dataset.preventuncheck||this.opts.preventUncheck,this.dynamicTitle=this.el.dataset.dynamicTitle||this.el.dataset.dynamictitle||this.opts.dynamicTitle,this.dynamicTitleDefault=this.el.dataset.dynamicTitleDefault||this.el.dataset.dynamictitledefault||this.opts.dynamicTitleDefault,this.dynamicTitleEmptyDefault=this.el.dataset.dynamicTitleEmptyDefault||this.el.dataset.dynamictitleemptydefault||this.opts.dynamicTitleEmptyDefault,this.allowNoneOnRadioSelect=this.el.dataset.allowNoneOnRadioSelect||this.el.dataset.allowneonradioselect||this.opts.allowNoneOnRadioSelect,this.showValidStateIcon=this.el.dataset.showValidStateIcon||this.el.dataset.showvalidstateicon||this.opts.showValidStateIcon,this.itemsToExclude=this.el.dataset.itemsToExclude||this.el.dataset.itemstoexclude?(this.el.dataset.itemsToExclude||this.el.dataset.itemstoexclude).replace(/\s/g,"").split(","):this.opts.itemsToExclude,this.primaryKeyword=this.el.dataset.primaryKeyword||this.el.dataset.primarykeyword||this.opts.primaryKeyword,this.useChips=this.el.dataset.useChips||this.el.dataset.usechips||this.opts.useChips,this.position=this.el.dataset.position||this.opts.position,this.useChips&&(this.showValidStateIcon=!1),this.preventClose=!1,this.itemsToExclude.length>0&&(this.itemsToExclude=this.itemsToExclude.map(String)),this.opts.setData&&(this.data=this.opts.setData),(this.el.dataset.setData||this.el.dataset.setdata)&&""!=(this.el.dataset.setData||this.el.dataset.setdata))try{this.data=JSON.parse(this.el.dataset.setData||this.el.dataset.setdata)}catch(t){this.data=this.el.dataset.setData||this.el.dataset.setdata}if(!Array.isArray(this.data[this.name])&&""!==this.data[this.name]&&this.data[this.name].length>0){const t=this.data[this.name].toString().trim().split(",");this.data[this.name]=t}if(this.data[this.name].length>0&&!this.useChips&&(this.data[this.name]=this.data[this.name].map(String)),this.data[this.name].length>0&&this.itemsToExclude.length>0&&(this.data[this.name]=this.data[this.name].filter(t=>t[this.primaryKeyword]?-1===this.itemsToExclude.indexOf(t[this.primaryKeyword].toString()):-1===this.itemsToExclude.indexOf(t.toString()))),this.data&&this.useChips&&this._renderChips(),this.items.length>0&&this.itemsToExclude.length>0&&(this.items=this.items.filter(t=>t[this.primaryKeyword]?-1===this.itemsToExclude.indexOf(t[this.primaryKeyword].toString()):-1===this.itemsToExclude.indexOf(t.toString()))),this.el.querySelector(".select-search")?this.showSearch=!0:this.showSearch=this.el.dataset.showSearch||this.el.dataset.showsearch||this.opts.showSearch,this.el.querySelector(".select-footer")?this.showFooter=!0:this.showFooter=this.el.dataset.showFooter||this.el.dataset.showfooter||this.opts.showFooter,this.selectEl=this.el.querySelector(".select-content"),this.selectEl){const t=this.selectEl.querySelectorAll(".select-item");t.length>0&&this.itemsToExclude.length>0&&t.forEach(t=>{const e=t.querySelector("input");e&&this.itemsToExclude.indexOf(e.value)>-1&&t.remove()})}else{let t=this._renderItemList(this.items);const e=document.createElement("div");e.innerHTML=`\n <div class="select-content">\n ${this._renderSearch()}\n <div class="select-scrollable-content"></div>\n ${this._renderFooter()}\n </div>\n `,this.selectEl=e.firstElementChild,this.el.appendChild(this.selectEl);const i=this.selectEl.querySelector(".select-scrollable-content");t.forEach(t=>i.appendChild(t))}if(this.data[this.name].length>0){const t=this.useChips?this.data[this.name].map(t=>t[this.primaryKeyword].toString()):this.data[this.name].map(String);if(this.selectEl.querySelectorAll("input").forEach(e=>{t.includes(e.value)&&(e.checked=!0,"radio"===this.type&&e.classList.add("checked"))}),this.useChips)this._renderChips();else if("radio"===this.type&&"function"!=typeof this.dynamicTitle){const t=this.selectEl.querySelector("input:checked");if(t){const e=t.parentElement.querySelector("[data-label]");e&&(this.selectTitleEl.textContent=e.textContent)}}}this.scrollableContentEl=this.selectEl.querySelector(".select-scrollable-content")||null,this.selectItems=Array.from(this.selectEl.querySelectorAll(".select-item")),this.selectHeaderEl.classList.remove("select-placeholder"),this.searchApi&&this.searchApi.length&&this._performInitialSearch(),"function"==typeof this.dynamicTitle?this.selectTitleEl.textContent=this.dynamicTitle.call(this):(0==this.data[this.name].length&&this.dynamicTitle&&this.dynamicTitleDefault&&0!==this.dynamicTitleDefault&&0==this.selectTitleEl.textContent.trim()&&(this.selectItems.length>0||this.searchApi)&&(this.selectTitleEl.textContent=this.dynamicTitleDefault),0==this.selectItems.length&&!this.searchApi&&this.dynamicTitle&&this.dynamicTitleEmptyDefault&&0!==this.dynamicTitleEmptyDefault&&(this.selectHeaderEl.classList.add("select-placeholder"),this.selectIconContainerEl&&this.selectIconContainerEl.classList.add("d-none"),this.selectTitleEl.textContent=this.dynamicTitleEmptyDefault)),this.showSearch&&(this.searchContainerEl=this.selectEl.querySelector(".select-search"),this.searchInputEl=this.selectEl.querySelector('[name="select-search"]'),this.clearSearchButtonEl=this.selectEl.querySelector("[data-clear-search]"),this.searchInputEl&&(this.searchInputEl.tabIndex=-1)),this.showFooter&&(this.footerContainerEl=this.selectEl.querySelector(".select-footer"),this.closeButtonEl=this.selectEl.querySelector("[data-select-close]"),this.closeButtonEl&&(this.closeButtonEl.tabIndex=-1)),this.buildSearchData()}_updateScrollbarVisibility(){if(this.scroll&&this.scrollableContentEl){const t=this.scrollableContentEl;t.scrollHeight>t.clientHeight?(this.scroll.settings.suppressScrollY=!1,this.scrollableContentEl.classList.add("ps-show-rail-y")):(this.scroll.settings.suppressScrollY=!0,this.scrollableContentEl.classList.remove("ps-show-rail-y")),this.scroll.update()}}_performInitialSearch(){return this.isSearchApiEnabled()?(this._showSpinner(),fetch(this.searchApi).then(t=>t.json()).then(t=>{let e=t.filter(t=>-1===this.itemsToExclude.indexOf(t[this.primaryKeyword].toString())&&0!=t[this.primaryKeyword]);this.useChips&&this.data[this.name].length>0&&(this.data[this.name].forEach(t=>{const i=e.find(e=>e[this.primaryKeyword].toString()===t[this.primaryKeyword].toString());i&&(t.label=i.label||i.name||i.value)}),this.selectTitleEl.innerHTML="",this.data[this.name].forEach(t=>{const e=document.createElement("span");e.className="chip",e.dataset.value=t[this.primaryKeyword],e.innerHTML=`<span class="chip-title">${escape(t.label)}</span>`,e.addEventListener("click",e=>{e.stopPropagation();const i=this.selectEl.querySelector(`input[value="${t[this.primaryKeyword]}"]`);i&&(i.checked=!1,i.dispatchEvent(new Event("change",{bubbles:!0})))}),this.selectTitleEl.appendChild(e)}));let i=this._renderItemList(e);this.scrollableContentEl.innerHTML="",i.forEach(t=>this.scrollableContentEl.appendChild(t)),this.data[this.name].length>0&&this.data[this.name].forEach(t=>{const e=this.useChips?t[this.primaryKeyword].toString():t.toString(),i=this.scrollableContentEl.querySelector(`input[value="${e}"]`);i&&(i.checked=!0,"radio"===this.type&&i.classList.add("checked"))}),this._updateScrollbarVisibility(),this._hideSpinner(),this.useChips&&this.data[this.name].length>0&&this._renderChips(),this.contentOpen&&this._recalculateContentHeight()}).catch(t=>{this._hideSpinner(),this.scrollableContentEl.innerHTML='<div class="p-3 text-danger">Error loading items</div>'})):Promise.resolve()}buildScroll(){if(this.scrollableContentEl){let t=this.scrollContentHeight;this.showSearch&&this.searchContainerEl&&(t-=_outerHeight(this.searchContainerEl)||0),this.showFooter&&this.footerContainerEl&&(t-=_outerHeight(this.footerContainerEl)||0);const e=(parseInt(getComputedStyle(this.scrollableContentEl).marginTop,10)||0)+(parseInt(getComputedStyle(this.scrollableContentEl).marginBottom,10)||0),i=this.scrollableContentEl.scrollHeight,s=Math.min(i,t+e);this.scrollableContentEl.style.maxHeight=s+"px",touchEvents()?this.scrollableContentEl.style.overflowY="auto":(!1===this.useNativeScroll&&PerfectScrollbar$1?(this.scrollableContentEl.classList.add("ps-dark"),this.scroll=new PerfectScrollbar$1(this.scrollableContentEl,{wheelSpeed:1,wheelPropagation:!1,minScrollbarLength:20,scrollYMarginOffset:-1,suppressScrollY:!0,suppressScrollX:!0}),setTimeout(()=>{this._updateScrollbarVisibility()},0)):this.scrollableContentEl.style.overflowY="auto",this.scrollableContentEl.querySelectorAll('[tabindex="0"]').forEach(t=>{t.tabIndex=-1}))}}buildSearchData(){this.searchData=[];this.selectEl.querySelectorAll("[data-label]").forEach((t,e)=>{this.searchData.push({id:e,val:t.textContent.trim()})})}bindEvents(){if(this._headerClickHandler=()=>{this.contentOpen?this.close():(this.selectItems.length>0||this.searchApi)&&this.show()},this.selectHeaderEl.addEventListener("click",this._headerClickHandler),this._checkboxChangeHandler=t=>{if(!t.target.matches('input[type="checkbox"]'))return;const e=t.target,i=e.value,s=600;if(this.preventClose=!0,"function"==typeof this.confirmCheck&&e.checked)e.checked=!1,this.confirmCheck(t=>{if("confirmed"==t){if(this.useChips){if(!this.data[this.name].find(t=>t[this.primaryKeyword]===i)){const t=e.parentElement.querySelector("[data-label]");this.data[this.name].push({[this.primaryKeyword]:i,label:t?t.textContent:i})}}else-1===this.data[this.name].indexOf(i)&&this.data[this.name].push(i);e.checked=!0,this.onSelect(e)}setTimeout(()=>{this.preventClose=!1},s)},e);else if(e.checked){if(this.useChips){if(!this.data[this.name].find(t=>t[this.primaryKeyword]===i)){const t=e.parentElement.querySelector("[data-label]");this.data[this.name].push({[this.primaryKeyword]:i,label:t?t.textContent:i})}}else-1===this.data[this.name].indexOf(i)&&this.data[this.name].push(i);this.onSelect(e),setTimeout(()=>{this.preventClose=!1},s)}else"function"!=typeof this.confirmUncheck||e.checked?e.checked||this.preventUncheck?!e.checked&&this.preventUncheck&&(e.checked=!0,setTimeout(()=>{this.preventClose=!1},s)):(this.useChips?this.data[this.name]=this.data[this.name].filter(t=>t[this.primaryKeyword]!=i):this.data[this.name]=this.data[this.name].filter(t=>t!=i),this.onSelect(e),setTimeout(()=>{this.preventClose=!1},s)):(e.checked=!0,this.confirmUncheck(t=>{"confirmed"==t&&(this.useChips?this.data[this.name]=this.data[this.name].filter(t=>t[this.primaryKeyword]!=i):this.data[this.name]=this.data[this.name].filter(t=>t!=i),e.checked=!1,this.onSelect(e)),setTimeout(()=>{this.preventClose=!1},s)},e))},this.el.addEventListener("change",this._checkboxChangeHandler),this._radioChangeHandler=t=>{if(!t.target.matches('input[type="radio"]'))return;const e=t.target,i=e.value;if(e.checked){if(this.useChips){const t=e.parentElement.querySelector("[data-label]");this.data[this.name]=[{[this.primaryKeyword]:i,label:t?t.textContent:i}]}else this.data[this.name]=[i];this.data[this.name]=[i],this.selectEl.querySelectorAll('input[type="radio"]').forEach(t=>{t!==e&&(t.checked=!1,t.classList.remove("checked"))})}else this.data[this.name]=[]},this.el.addEventListener("change",this._radioChangeHandler),this._radioClickHandler=t=>{if(!t.target.matches('input[type="radio"]'))return;const e=t.target;if(e.classList.contains("checked")&&this.allowNoneOnRadioSelect&&!this.preventUncheck)this.data[this.name]=[],e.checked=!1,e.classList.remove("checked"),this.dynamicTitle&&"function"!=typeof this.dynamicTitle&&(this.selectTitleEl.textContent=this.dynamicTitleDefault);else if(e.classList.add("checked"),this.dynamicTitle&&"function"!=typeof this.dynamicTitle){const t=e.parentElement.querySelector("[data-label]");this.selectTitleEl.textContent=escape(t?t.textContent:"")}"function"==typeof this.dynamicTitle&&(this.selectTitleEl.textContent=this.dynamicTitle.call(e)),this.onSelect(e)},this.el.addEventListener("click",this._radioClickHandler),this.scroll){const t=this.scrollableContentEl?this.scrollableContentEl.querySelector(".ps__thumb-y"):null;t&&(this._thumbMousedownHandler=()=>{this.scrollableContentEl.classList.add("ps-mousedown-scroll")},t.addEventListener("mousedown",this._thumbMousedownHandler)),this._documentMouseupHandler=()=>{this.scrollableContentEl&&this.scrollableContentEl.classList.contains("ps-mousedown-scroll")&&this.scrollableContentEl.classList.remove("ps-mousedown-scroll")},document.addEventListener("mouseup",this._documentMouseupHandler)}this.showSearch&&(this._searchKeydownHandler=debounce(()=>{this.searchString=this.searchInputEl.value.trim(),this.search.call(this)},250),this.searchInputEl.addEventListener("keydown",this._searchKeydownHandler),this._searchFocusinHandler=()=>{this.searchContainerEl.classList.add("focused")},this.searchInputEl.addEventListener("focusin",this._searchFocusinHandler),this._searchFocusoutHandler=()=>{this.searchContainerEl.classList.remove("focused")},this.searchInputEl.addEventListener("focusout",this._searchFocusoutHandler),this._clearSearchHandler=t=>{t.target.closest("[data-clear-search]")&&this.searchString.length&&(this.searchInputEl.value="",this.searchString="",this.search.call(this))},this.searchContainerEl.addEventListener("click",this._clearSearchHandler)),this.showFooter&&this.closeButtonEl&&(this._footerCloseHandler=()=>{this.close()},this.closeButtonEl.addEventListener("click",this._footerCloseHandler)),this._documentClickHandler=t=>{this.el.contains(t.target)||!this.contentOpen||this.preventClose||this.close.call(this)},document.addEventListener("touchstart",this._documentClickHandler),document.addEventListener("click",this._documentClickHandler),"fixed"===this.position&&(this._scrollCallback=()=>{this.el&&this.el.classList.contains("show")&&requestAnimationFrame(()=>{const t=this.el.querySelector(".select-content"),e=this.containerEl.getBoundingClientRect();t&&Object.assign(t.style,{top:e.top+"px",left:e.left+"px",width:this.contentWidth?`var(--cool-select-content-width, ${this.contentWidth}px)`:this.containerEl.offsetWidth+"px"})})},window.ResizeObserver&&(this._resizeCallback=()=>{this.el&&this.el.classList.contains("show")&&requestAnimationFrame(()=>{const t=this.el.querySelector(".select-content"),e=this.containerEl.getBoundingClientRect();t&&Object.assign(t.style,{top:e.top+"px",left:e.left+"px",width:this.contentWidth?`var(--cool-select-content-width, ${this.contentWidth}px)`:this.containerEl.offsetWidth+"px"})})},resizeManager.observe(document.body,this._resizeCallback)))}unbindEvents(){if(this._headerClickHandler&&(this.selectHeaderEl.removeEventListener("click",this._headerClickHandler),this._headerClickHandler=null),this._checkboxChangeHandler&&(this.el.removeEventListener("change",this._checkboxChangeHandler),this._checkboxChangeHandler=null),this._radioChangeHandler&&(this.el.removeEventListener("change",this._radioChangeHandler),this._radioChangeHandler=null),this._radioClickHandler&&(this.el.removeEventListener("click",this._radioClickHandler),this._radioClickHandler=null),this._thumbMousedownHandler){const t=this.scrollableContentEl?this.scrollableContentEl.querySelector(".ps__thumb-y"):null;t&&t.removeEventListener("mousedown",this._thumbMousedownHandler),this._thumbMousedownHandler=null}this._documentMouseupHandler&&(document.removeEventListener("mouseup",this._documentMouseupHandler),this._documentMouseupHandler=null),this._searchKeydownHandler&&(this.searchInputEl.removeEventListener("keydown",this._searchKeydownHandler),this._searchKeydownHandler=null),this._searchFocusinHandler&&(this.searchInputEl.removeEventListener("focusin",this._searchFocusinHandler),this._searchFocusinHandler=null),this._searchFocusoutHandler&&(this.searchInputEl.removeEventListener("focusout",this._searchFocusoutHandler),this._searchFocusoutHandler=null),this._clearSearchHandler&&this.searchContainerEl&&(this.searchContainerEl.removeEventListener("click",this._clearSearchHandler),this._clearSearchHandler=null),this._footerCloseHandler&&this.closeButtonEl&&(this.closeButtonEl.removeEventListener("click",this._footerCloseHandler),this._footerCloseHandler=null),this._documentClickHandler&&(document.removeEventListener("touchstart",this._documentClickHandler),document.removeEventListener("click",this._documentClickHandler),this._documentClickHandler=null),"fixed"===this.position&&(this._scrollCallback&&(scrollManager.remove(`select-${this.name}`),this._scrollCallback=null),this._resizeCallback&&(resizeManager.unobserve(document.body),this._resizeCallback=null))}getData(t){return t?this.data[t]:this.data}setData(){let t=this.opts.faPro?"fal":"fas";if(this.showValidStateIcon?this.selectIconContainerEl&&(this.selectIconContainerEl.innerHTML=`<i class="${t} fa-check text-success icon"></i>`):this.selectIconContainerEl&&(this.selectIconContainerEl.innerHTML=this.selectIconDefault),this.useChips&&(this.selectTitleEl.innerHTML=""),this.searchApi.length){let t=this.searchApi,e=this.data[this.name].length,i=0;this.data[this.name].forEach(s=>{t+=encodeURIComponent("#"+s),i++,i!==e&&(t+="+")}),fetch(t).then(t=>t.json()).then(t=>{let e=t.map(t=>t.id.toString());this.data[this.name]=this.data[this.name].filter(t=>this.useObjects?e.indexOf(t[this.primaryKeyword].toString())>-1:e.indexOf(t.toString())>-1),0==this.data[this.name].length&&this.selectIconContainerEl&&(this.selectIconContainerEl.innerHTML=this.selectIconDefault);const i=t.filter(t=>this.useObjects?this.data[this.name].findIndex(e=>e[this.primaryKeyword]==t.id)>-1&&-1===this.itemsToExclude.indexOf(t.id)&&0!=t.id:this.data[this.name].indexOf(t.id)>-1&&-1===this.itemsToExclude.indexOf(t.id)&&0!=t.id);this._renderItemList(i).forEach(t=>this.scrollableContentEl.appendChild(t));let s=Array.from(this.scrollableContentEl.querySelectorAll("input"));if(this._updateScrollbarVisibility(),this.scrollableContentEl.querySelector('input[type="checkbox"]')?this.type="checkbox":this.scrollableContentEl.querySelector('input[type="radio"]')&&(this.type="radio"),"checkbox"==this.type)this.data[this.name].forEach(t=>{let e=this.useObjects?t[this.primaryKeyword].toString():t.toString(),i=s.find(t=>t.value==e);i&&(i.checked=!0,this.useChips&&this._renderChips(),this.onSelect(i))});else if("radio"==this.type){const t=this.data[this.name][0];let e=s.find(e=>e.value==t);if(e){if(e.checked=!0,e.classList.add("checked"),this.useChips)this._renderChips();else if(this.dynamicTitle&&"function"!=typeof this.dynamicTitle){const t=e.parentElement.querySelector("[data-label]");t&&(this.selectTitleEl.textContent=t.textContent)}this.onSelect(e)}}"function"==typeof this.dynamicTitle&&(this.selectTitleEl.textContent=this.dynamicTitle.call(this))})}else{let t=Array.from(this.scrollableContentEl.querySelectorAll("input")),e=t.map(t=>t.value.toString());if(this.data[this.name]=this.data[this.name].filter(t=>e.indexOf(t.toString())>-1),0==this.data[this.name].length&&this.selectIconContainerEl&&(this.selectIconContainerEl.innerHTML=this.selectIconDefault),this.scrollableContentEl.querySelector('input[type="checkbox"]')?this.type="checkbox":this.scrollableContentEl.querySelector('input[type="radio"]')&&(this.type="radio"),"checkbox"==this.type)this.data[this.name].forEach(e=>{let i=t.find(t=>t.value==e);i&&(i.checked=!0,this.useChips&&this._renderChips(),this.onSelect(i))});else if("radio"==this.type){let e=t.find(t=>t.value==this.data[this.name][0]);if(e){if(e.checked=!0,e.classList.add("checked"),this.useChips)this._renderChips();else if(this.dynamicTitle&&"function"!=typeof this.dynamicTitle){const t=e.parentElement.querySelector("[data-label]");t&&(this.selectTitleEl.textContent=t.textContent)}this.onSelect(e)}}"function"==typeof this.dynamicTitle&&(this.selectTitleEl.textContent=this.dynamicTitle.call(this))}}_renderChips(){this.selectTitleEl.innerHTML="",0!==this.data[this.name].length?(this.data[this.name].forEach(t=>{const e=this.useChips?t[this.primaryKeyword]:t,i=this.selectEl?this.selectEl.querySelector(`input[value="${e}"]`):null,s=i?i.parentElement.querySelector("[data-label]"):null,n=s?s.textContent:t.label||t.name||t.value||e,o=document.createElement("span");o.className="chip",o.dataset.value=e,o.innerHTML=`<span class="chip-title">${escape(n)}</span>`,o.addEventListener("click",i=>{i.stopPropagation();const s=this.selectEl.querySelector(`input[value="${e}"]`);s?(s.checked=!1,s.dispatchEvent(new Event("change",{bubbles:!0}))):(this.useChips?this.data[this.name]=this.data[this.name].filter(t=>t[this.primaryKeyword].toString()!==e.toString()):this.data[this.name]=this.data[this.name].filter(t=>t.toString()!==e.toString()),this.searchApi.length&&(this.items=this.items.filter(t=>t[this.primaryKeyword].toString()!==e.toString())),this._renderChips(),"function"==typeof this.opts.onSelect&&this.opts.onSelect.call(this,t,this,!1))}),this.selectTitleEl.appendChild(o)}),this.contentOpen&&setTimeout(()=>{this._updateScrollbarVisibility()},0)):this.dynamicTitle&&this.dynamicTitleDefault?this.selectTitleEl.textContent=this.dynamicTitleDefault:this.selectTitleEl.textContent=this.cachedTitle}search(){let t=this.opts.faPro?"fal":"fas";if(this.searchString.length)if(this.isSearchApiEnabled()){if(this.searchString===this.lastSearchQuery)return;this.lastSearchQuery=this.searchString,this._showSpinner(),this._searchAbortController&&this._searchAbortController.abort(),clearTimeout(this._searchDebounceTimer),this._searchDebounceTimer=setTimeout(()=>{this._searchAbortController=new AbortController,fetch(this.searchApi+this.searchString,{signal:this._searchAbortController.signal}).then(t=>t.json()).then(e=>{this._searchAbortController=null,this.scrollableContentEl.querySelectorAll("input:not(:checked)").forEach(t=>{const e=t.closest(".select-item");e&&!e.classList.contains("static-item")&&e.remove()});const i=e.filter(t=>this.useObjects?-1===this.data[this.name].findIndex(e=>e[this.primaryKeyword]==t.id)&&-1===this.itemsToExclude.indexOf(t.id)&&0!=t.id:-1===this.data[this.name].indexOf(t.id)&&-1===this.itemsToExclude.indexOf(t.id)&&0!=t.id);this._renderItemList(i).forEach(t=>this.scrollableContentEl.appendChild(t)),this.searchIconContainerEl.innerHTML=`<i class="${t} fa-times icon"></i>`,this.searchIconContainerEl.setAttribute("data-clear-search","true"),this._updateScrollbarVisibility(),this.contentOpen&&this._recalculateContentHeight()}).catch(t=>{"AbortError"!==t.name&&this._hideSpinner()})},300)}else{const e=this.searchString.toLowerCase();let i=this.searchData.filter(t=>t.val.toLowerCase().indexOf(e)>-1);this.selectItems.forEach(t=>{t.classList.remove("d-none"),t.classList.remove("visible")}),i.forEach(t=>{this.selectItems[t.id]&&this.selectItems[t.id].classList.add("visible")}),this.selectItems.filter(t=>!t.classList.contains("visible")).forEach(t=>t.classList.add("d-none")),this.searchIconContainerEl.innerHTML=`<i class="${t} fa-times icon"></i>`,this.searchIconContainerEl.setAttribute("data-clear-search","true")}else this.lastSearchQuery="",this.isSearchApiEnabled()?(this.scrollableContentEl.querySelectorAll("input:not(:checked)").forEach(t=>{const e=t.closest(".select-item");e&&!e.classList.contains("static-item")&&e.remove()}),this._hideSpinner(),this.searchIconContainerEl.setAttribute("data-clear-search",""),this._performInitialSearch()):(this.selectItems.forEach(t=>{t.classList.remove("d-none"),t.classList.remove("visible")}),this.searchIconContainerEl.innerHTML=`<i class="${t} fa-search icon"></i>`,this.searchIconContainerEl.setAttribute("data-clear-search",""));this.scroll&&this.scroll.update(),this.onUpdate()}_recalculateContentHeight(){const t=this.el.querySelector(".select-content"),e=_outerHeight(this.selectHeaderEl),i=this.scrollContentHeight,s=window.innerHeight,n=window.scrollY;let o=i,l=0,a=0;if(this.searchContainerEl&&(l=_outerHeight(this.searchContainerEl)||0),this.footerContainerEl&&(a=_outerHeight(this.footerContainerEl)||0),this.scrollableContentEl){const t=this.scrollableContentEl.scrollHeight,e=this.scrollableContentEl.clientHeight;o=Math.min(Math.max(t,e)+l+a,i)}let r=this.el.classList.contains("select-dropup"),c=0,h=o;const d=parseInt(getComputedStyle(t).marginBottom||0,10),p=parseInt(getComputedStyle(t).marginTop||0,10);if("fixed"===this.position){const t=this.containerEl.getBoundingClientRect().top,i=s-t-e-50,n=t-50;r?(h=Math.min(o,n),c=t-h-d):(h=Math.min(o,i),c=t+e+p)}else{const t=this.containerEl.getBoundingClientRect().top+n,i=s-(t-n)-e-50,l=t-n-50;r?(h=Math.min(o,l),c=-h-d):(h=Math.min(o,i),c=e+p)}const u=h-l-a;t.style.height=h+"px",this.scrollableContentEl&&(this.scrollableContentEl.style.maxHeight=u+"px"),t.style.top=c+"px",this.scroll&&setTimeout(()=>{this._updateScrollbarVisibility()},0)}show(){if(this.el.classList.contains("show"))return;let t=0,e=0;if("fixed"===this.position){const i=this.containerEl.getBoundingClientRect();t=i.top,e=i.left}const i=document.querySelectorAll(".select.show");let s=1,n=this.opts.faPro?"fal":"fas";i.length&&(s=parseInt(getComputedStyle(i[0]).zIndex,10)+2),this.el.classList.add("show"),i.length||(s=parseInt(getComputedStyle(this.el).zIndex,10)+1);const o=this.el.querySelector(".select-content"),l=_outerHeight(this.selectHeaderEl),a=this.scrollContentHeight,r=window.innerHeight,c=window.scrollY;let h=a,d=0,p=0;if(this.searchContainerEl&&(d=_outerHeight(this.searchContainerEl)||0),this.footerContainerEl&&(p=_outerHeight(this.footerContainerEl)||0),this.scrollableContentEl){const t=this.scrollableContentEl.scrollHeight,e=this.scrollableContentEl.clientHeight;h=Math.min(Math.max(t,e)+d+p,a)}let u=!1,m=0,f=h;const b=parseInt(getComputedStyle(o).marginBottom||0,10),g=parseInt(getComputedStyle(o).marginTop||0,10);if("fixed"===this.position){const e=r-t-l-50,i=t-50;u=e<h&&i>e,u?(f=Math.min(h,i),m=t-f-b):(f=Math.min(h,e),m=t+l+g)}else{const t=this.containerEl.getBoundingClientRect().top+c,e=r-(t-c)-l-50,i=t-c-50;u=e<h&&i>e,u?(f=Math.min(h,i),m=-f-b):(f=Math.min(h,e),m=l+g)}const y=f-d-p;o.style.height=f+"px",this.scrollableContentEl&&(this.scrollableContentEl.style.maxHeight=y+"px"),this.el.classList.toggle("select-dropup",u),this.el.classList.toggle("select-dropdown",!u);const E=o.offsetWidth;Object.assign(o.style,{zIndex:s,position:"fixed"===this.position?"fixed":"absolute"});const w=this.containerEl.offsetWidth;"fixed"===this.position?Object.assign(o.style,{top:m+"px",left:e+"px",width:this.contentWidth?`var(--cool-select-content-width, ${this.contentWidth}px)`:w+"px"}):Object.assign(o.style,{top:m+"px",width:this.contentWidth?`var(--cool-select-content-width, ${this.contentWidth}px)`:E>w?"var(--cool-select-content-width, auto)":w+"px"}),o.style.minWidth=w+"px",this.scrollableContentEl&&this.scrollableContentEl.offsetHeight<this.scrollableContentEl.scrollHeight&&(this.scrollableContentEl.scrollTop=1,this.scrollableContentEl.scrollTop=0),u?this.selectIconContainerEl&&(this.selectIconContainerEl.innerHTML=`<i class="${n} fa-angle-down icon"></i>`):this.selectIconContainerEl&&(this.selectIconContainerEl.innerHTML=`<i class="${n} fa-angle-up icon"></i>`),setTimeout(()=>{this.el.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"}),this.scroll&&this._updateScrollbarVisibility()},300),this.contentOpen=!0,"fixed"===this.position&&this._scrollCallback&&scrollManager.add(`select-${this.name}`,this._scrollCallback),this.onShow()}close(){if(!this.preventClose){let t=this.opts.faPro?"fal":"fas";this.el.classList.remove("show"),this.el.classList.remove("select-dropup","select-dropdown"),setTimeout(()=>{this.el.removeAttribute("style")},300),this.data[this.name].length>0&&this.showValidStateIcon?this.selectIconContainerEl&&(this.selectIconContainerEl.innerHTML=`<i class="${t} fa-check text-success icon"></i>`):this.selectIconContainerEl&&(this.selectIconContainerEl.innerHTML=this.selectIconDefault),this.contentOpen=!1,"fixed"===this.position&&this._scrollCallback&&scrollManager.remove(`select-${this.name}`),this.onClose()}}onSelect(t){const e=t.closest(".select-item"),i=e&&_itemDataMap.get(e)||{},s=t.value;if(this.searchApi.length&&Object.keys(i).length>0)if(t.checked)if(this.items.push(i),this.useChips){if(!this.data[this.name].find(t=>t[this.primaryKeyword].toString()===s.toString())){const e=t.parentElement.querySelector("[data-label]");this.data[this.name].push({[this.primaryKeyword]:s,label:e?e.textContent:s})}}else-1===this.data[this.name].indexOf(s)&&this.data[this.name].push(s);else this.items=this.items.filter(t=>t[this.primaryKeyword].toString()!==s.toString()),this.useChips?this.data[this.name]=this.data[this.name].filter(t=>t[this.primaryKeyword].toString()!==s.toString()):this.data[this.name]=this.data[this.name].filter(t=>t.toString()!==s.toString());this.useChips&&this._renderChips(),"function"==typeof this.opts.onSelect&&this.opts.onSelect.call(t,i,this,t.checked)}getItem(t,e){let i=this.items.filter(i=>i[t]==e)[0];return i||null}getSelectedItems(t){let e=[],i=[],s=this.data[this.name];return Array.isArray(s)?e=s:e.push(s),e=this.useChips?e.map(t=>t[this.primaryKeyword].toString()):e.map(String),this.items.length>0?(i=this.items.filter(t=>e.indexOf(t.id.toString())>-1),t&&(i=i.map(e=>e[t]).filter(t=>null!=t))):i=e,i}getSelectedItem(t){return this.getSelectedItems(t)[0]}_renderItemList(t){if(!t||!t.length)return[];const e=this.data[this.name].map(t=>this.useChips?t[this.primaryKeyword].toString():t.toString()),i=[];for(let s=0;s<t.length;++s){const n=t[s];let o="";"function"==typeof this.labelTemplate?o=this.labelTemplate(n):n.name?o=n.name:n.label?o=n.label:n.value&&(o=n.value);const l=this.useChips?n[this.primaryKeyword]:n.id,a=e.indexOf(l.toString())>-1,r=document.createElement("div");r.innerHTML=this._getItemTemplate(n,s,o,a).trim();const c=r.firstElementChild;_itemDataMap.set(c,n),i.push(c)}return i}_getItemTemplate(t,e,i,s){return`\n <div class="select-item">\n <div class="select-item-${this.type}">\n <div class="form-check">\n <input type="${this.type}"\n id="select-${this.name}-${t.id}"\n value="${t.id}"\n tabindex="-1"\n ${s?"checked":""}>\n <label for="select-${this.name}-${t.id}">\n <span class="form-check-icon">\n <svg viewBox="0 0 18 18">\n <polyline points="1.5 6 4.5 9 10.5 1"></polyline>\n </svg>\n </span>\n <span class="form-check-label"${"function"!=typeof this.labelTemplate?" data-label":""}>\n ${"function"!=typeof this.labelTemplate?escape(i):i}\n </span>\n </label>\n </div>\n </div>\n </div>`}_renderSearch(){if(this.showSearch){const t=this.opts.faPro?"fal":"fas";return`\n\n <div class="select-search">\n\n <div class="select-search-input">\n\n <input type="text" name="select-search" value="" placeholder="${this.searchPlaceholder}" tabindex="-1">\n\n </div>\n\n <div class="select-search-icon">\n\n <i class="${t} fa-search icon"></i>\n\n </div>\n\n </div>\n\n `}return""}_renderFooter(){return this.showFooter?`\n\n <div class="select-footer">\n\n <button class="btn btn-block btn-light btn-sm" type="button" tabindex="-1" data-select-close >\n ${this.btnCloseText}\n </button>\n\n </div>\n\n `:""}isSearchApiEnabled(){return this.searchApi&&this.searchApi.length}_showSpinner(){let t=this.opts.faPro?"fal":"fas";this.searchIconContainerEl.innerHTML=`<i class="${t} fa-spinner-third fa-spin icon"></i>`}_hideSpinner(){let t=this.opts.faPro?"fal":"fas";this.searchIconContainerEl.innerHTML=`<i class="${t} fa-search icon"></i>`}selectItem(t){const e=this.selectEl.querySelector(`input[value="${t}"]`);if(e){if("radio"===this.type)if(this.selectEl.querySelectorAll('input[type="radio"]').forEach(t=>{t.checked=!1,t.classList.remove("checked")}),this.useChips){const i=e.parentElement.querySelector("[data-label]");this.data[this.name]=[{[this.primaryKeyword]:t,label:i?i.textContent:t}]}else this.data[this.name]=[t];else if(this.useChips){if(!this.data[this.name].find(e=>e[this.primaryKeyword].toString()===t.toString())){const i=e.parentElement.querySelector("[data-label]");this.data[this.name].push({[this.primaryKeyword]:t,label:i?i.textContent:t})}}else-1===this.data[this.name].indexOf(t)&&this.data[this.name].push(t);return e.checked=!0,e.classList.add("checked"),e.dispatchEvent(new Event("change",{bubbles:!0})),!0}return!1}clear(){const t=Array.from(this.selectEl.querySelectorAll("input:checked"));this.selectEl.querySelectorAll("input").forEach(t=>{t.checked=!1,t.classList.remove("checked")}),this.data[this.name]=[],this.useChips?this._renderChips():this.dynamicTitle&&"function"!=typeof this.dynamicTitle&&(this.selectTitleEl.textContent=this.dynamicTitleDefault||this.cachedTitle),this.showValidStateIcon&&this.selectIconContainerEl&&(this.selectIconContainerEl.innerHTML=this.selectIconDefault),t.forEach(t=>{const e=t.closest(".select-item"),i=e&&_itemDataMap.get(e)||{};"function"==typeof this.opts.onSelect&&this.opts.onSelect.call(t,i,this,!1)})}}Select._jQueryInit();let PerfectScrollbar=null;try{PerfectScrollbar=require("perfect-scrollbar"),PerfectScrollbar&&PerfectScrollbar.default&&(PerfectScrollbar=PerfectScrollbar.default)}catch(t){}"undefined"!=typeof window&&PerfectScrollbar&&!window.PerfectScrollbar&&(window.PerfectScrollbar=PerfectScrollbar);class Dropdown extends Component{static NAME="coolDropdown";static DEFAULTS={animation:!0,animationIn:"zoomIn",animationOut:"zoomOut",animationSpeed:"fastest",offset:null,minWidth:null,closeOnItemClick:!0,positionObserver:!0,content:!1,scroll:!0,scrollContentHeight:100,onInit:null,onUpdate:null,onDestroy:null,onShow:null,onClose:null,onItemClick:null,position:"absolute",placement:"bottom",align:"start"};static _jQueryInterface(t){return this.each(function(){const e=$(this);let i=e.data(`plugin_${Dropdown.NAME}`);i||(i=new Dropdown(this,"object"==typeof t&&t),e.data(`plugin_${Dropdown.NAME}`,i)),"string"==typeof t&&i[t]()})}static _jQueryInit(){if("undefined"==typeof $||!$.fn)return;const t=$.fn[Dropdown.NAME];$.fn[Dropdown.NAME]=Dropdown._jQueryInterface,$.fn[Dropdown.NAME].Constructor=Dropdown,$.fn[Dropdown.NAME].defaults=Dropdown.DEFAULTS||{},$.fn[Dropdown.NAME].noConflict=()=>($.fn[Dropdown.NAME]=t,Dropdown._jQueryInterface)}constructor(t,e){super(),this.opts=deepMerge({},Dropdown.DEFAULTS,window.Cool?.settings?.dropdown||{},e||{}),this.el=t,this._resizeCallback=null,this._scrollCallback=null,this.init()}setupResizeHandling(){if(window.ResizeObserver)this._resizeCallback=()=>{this.contentOpen&&(this.rafId&&cancelAnimationFrame(this.rafId),this.rafId=requestAnimationFrame(()=>{this.setPosition(),this.onUpdate()}))},resizeManager.observe(this.el,this._resizeCallback),resizeManager.observe(document.body,this._resizeCallback),this.containerEl&&resizeManager.observe(this.containerEl,this._resizeCallback);else{let t;this.resizeHandler=()=>{if(!this.contentOpen)return;clearTimeout(t);const e=performance.now();!this.lastResizeTime||e-this.lastResizeTime>100?(this.setPosition(),this.onUpdate(),this.lastResizeTime=e):t=setTimeout(()=>{this.setPosition(),this.onUpdate()},16)},window.addEventListener("resize",this.resizeHandler,{passive:!0})}}setupScrollHandling(){if("fixed"===this.position){this._scrollCallback=()=>{this.contentOpen&&this.dropdownEl.classList.contains("show")&&(this.rafId&&cancelAnimationFrame(this.rafId),this.rafId=requestAnimationFrame(()=>{this.setPosition(),this.onUpdate()}))},scrollManager.add(`dropdown-${this.id}`,this._scrollCallback);let t=this.el.parentElement;for(this.scrollableParents=[];t&&t!==document.body;){const e=getComputedStyle(t).overflowY;if("scroll"===e||"auto"===e){const e=()=>this._scrollCallback();t.addEventListener("scroll",e,{passive:!0}),this.scrollableParents.push({element:t,handler:e})}t=t.parentElement}}}setupVisibilityDetection(){window.IntersectionObserver&&(this.intersectionObserver=new IntersectionObserver(t=>{t.forEach(t=>{!t.isIntersecting&&this.contentOpen&&(this.rafId&&cancelAnimationFrame(this.rafId),this.rafId=requestAnimationFrame(()=>{this.setPosition()}))})},{threshold:.1,rootMargin:"50px"}),this.intersectionObserver.observe(this.el))}init(){this.buildCache().then(()=>{this.buildScroll(),this.setupVisibilityDetection(),this.bindEvents(),this.onInit()}).catch(()=>{})}destroy(){this.unbindEvents(),this.scroll&&"function"==typeof this.scroll.destroy&&(this.scroll.destroy(),this.scroll=null),this.dropdownEl&&this.dropdownEl.remove(),this.constructor.removeInstance(this.el),this.onDestroy()}update(){const t=this.scrollableContentEl&&this.scrollableContentEl.classList.contains("ps-dark");this.scroll&&"function"==typeof this.scroll.destroy&&(this.scroll.destroy(),this.scroll=null),this.unbindEvents(),this.buildCache().then(()=>{t&&this.scrollableContentEl&&this.scrollableContentEl.classList.add("ps-dark"),this.buildScroll(),this.setupVisibilityDetection(),this.bindEvents(),this.onUpdate()}).catch(()=>{})}buildCache(){return new Promise((t,e)=>{this.el.classList.add("dropdown-trigger"),this.containerEl=this.el.closest(".dropdown")||this.el.parentElement,this.id="dropdown-"+generateUUID(),this.animation=this.el.dataset.animation||this.opts.animation,this.animationIn=this.el.dataset.animationIn||this.el.dataset.animationin||this.opts.animationIn,this.animationOut=this.el.dataset.animationOut||this.el.dataset.animationout||this.opts.animationOut,this.animationSpeed=this.el.dataset.animationSpeed||this.el.dataset.animationspeed||this.opts.animationSpeed,this.position=this.el.dataset.position||this.opts.position,this.placement=this.el.dataset.placement||this.opts.placement,this.align=this.el.dataset.align||this.opts.align,this.offset=this.el.dataset.offset||this.opts.offset,this.minWidth=this.el.dataset.minWidth||this.el.dataset.minwidth||this.opts.minWidth,this.scroll=this.el.dataset.scroll||this.opts.scroll,this.scrollContentHeight=this.el.dataset.scrollContentHeight||this.opts.scrollContentHeight,this.positionObserver=this.el.hasAttribute("data-position-observer")?JSON.parse(this.el.getAttribute("data-position-observer")):this.opts.positionObserver,this.closeOnItemClick=this.el.dataset.closeOnItemClick||this.el.dataset.closeonitemclick||this.opts.closeOnItemClick,this.preventClose=this.el.dataset.preventClose||this.el.dataset.preventclose||!1,this.content=this.el.dataset.content||this.opts.content,this.contentOpen=!1,this.containerEl.classList.contains("dropup")?this.placement="top":this.containerEl.classList.contains("dropright")?this.placement="right":this.containerEl.classList.contains("dropbottom")?this.placement="bottom":this.containerEl.classList.contains("dropleft")&&(this.placement="left");const i=this.containerEl.querySelector(".dropdown-menu");if("fixed"===this.position&&i){this.dropdownEl=i.cloneNode(!0),this.dropdownEl.id=this.id,this.dropdownEl.classList.remove("show"),this.align=i.classList.contains("dropdown-menu-right")?"end":this.align,document.body.appendChild(this.dropdownEl),i.remove();return this.dropdownEl.querySelectorAll(".dropdown").forEach(t=>{const e=t.querySelector('[data-toggle="dropdown"]'),i=t.querySelector(".dropdown-menu");e&&i&&!Dropdown.getInstance(e)&&new Dropdown(e,{position:"absolute",closeOnItemClick:!1,positionObserver:!0,onShow:()=>{const t=parseInt(getComputedStyle(this.dropdownEl).zIndex||9999,10);i.style.zIndex=t+1}})}),this.dropdownItems=Array.from(this.dropdownEl.querySelectorAll("a, button, .dropdown-item")).filter(t=>t.closest(".dropdown-menu")===this.dropdownEl),this.scrollableContentEl=this.dropdownEl.querySelector(".dropdown-scrollable-content"),this.minWidth&&(this.dropdownEl.style.minWidth=this.minWidth+"px"),t()}if("function"==typeof this.content){let e="end"===this.opts.align?" dropdown-menu-right":"";const i=document.createElement("div");return i.innerHTML=`<div class="dropdown-menu${e}" id="${this.id}">${this.content()}</div>`,this.dropdownEl=i.firstElementChild,"fixed"===this.position?document.body.appendChild(this.dropdownEl):this.el.insertAdjacentElement("afterend",this.dropdownEl),this.scrollableContentEl=this.dropdownEl.querySelector(".dropdown-scrollable-content")||null,this.align=this.dropdownEl.classList.contains("dropdown-menu-right")?"end":this.align,this.dropdownItems=Array.from(this.dropdownEl.querySelectorAll("a, button, .dropdown-item")).filter(t=>t.closest(".dropdown-menu")===this.dropdownEl),this.minWidth&&(this.dropdownEl.style.minWidth=this.minWidth+"px"),t()}return this.dropdownEl=this.containerEl.querySelector(".dropdown-menu")||null,this.dropdownEl?(this.align=this.dropdownEl.classList.contains("dropdown-menu-right")?"end":this.align,this.scrollableContentEl=this.dropdownEl.querySelector(".dropdown-scrollable-content")||null,this.dropdownItems=Array.from(this.dropdownEl.querySelectorAll("a, button, .dropdown-item")).filter(t=>t.closest(".dropdown-menu")===this.dropdownEl),this.minWidth&&(this.dropdownEl.style.minWidth=this.minWidth+"px"),t()):e()})}buildScroll(){this.opts.scroll&&this.scrollableContentEl&&(this.scrollableContentEl.style.maxHeight=this.scrollContentHeight+"px",touchEvents()?this.scrollableContentEl.style.overflowY="auto":PerfectScrollbar?this.scroll=new PerfectScrollbar(this.scrollableContentEl,{wheelSpeed:1,wheelPropagation:!1,minScrollbarLength:20,suppressScrollX:!0,scrollYMarginOffset:2}):this.scrollableContentEl.style.overflowY="auto")}bindEvents(){this._triggerClickHandler=()=>{this.contentOpen?this.close():this.show()},this.el.addEventListener("click",this._triggerClickHandler),"fixed"===this.position?(this._dropdownItemHandler=t=>{const e=t.target.closest("a, button, .dropdown-item");e&&e.closest(".dropdown-menu")===this.dropdownEl&&(e.classList.contains("dropdown-trigger")||e.dataset.toggle||(this.closeOnItemClick&&this.close(),this.onItemClick(e,t)))},this.dropdownEl.addEventListener("click",this._dropdownItemHandler)):(this._itemHandlers=[],this.dropdownItems.forEach(t=>{const e=e=>{t.classList.contains("dropdown-trigger")||t.dataset.toggle||(this.closeOnItemClick&&this.close(),this.onItemClick(t,e))};t.addEventListener("click",e),this._itemHandlers.push({el:t,handler:e})})),this._documentClickHandler=t=>{if(!this.contentOpen)return;const e=this.el===t.target||this.el.contains(t.target)||this.dropdownEl===t.target||this.dropdownEl.contains(t.target),i=this.dropdownEl.contains(t.target)&&t.target.closest('[data-toggle="dropdown"]');e||i||this.close()},document.addEventListener("click",this._documentClickHandler,{passive:!0}),document.addEventListener("touchstart",this._documentClickHandler,{passive:!0}),this.setupResizeHandling(),this.setupScrollHandling()}unbindEvents(){this._triggerClickHandler&&(this.el.removeEventListener("click",this._triggerClickHandler),this._triggerClickHandler=null),this._dropdownItemHandler&&this.dropdownEl&&(this.dropdownEl.removeEventListener("click",this._dropdownItemHandler),this._dropdownItemHandler=null),this._itemHandlers&&(this._itemHandlers.forEach(({el:t,handler:e})=>{t.removeEventListener("click",e)}),this._itemHandlers=null),this._resizeCallback&&(resizeManager.unobserve(this.el),resizeManager.unobserve(document.body),this.containerEl&&resizeManager.unobserve(this.containerEl),this._resizeCallback=null),this.rafId&&(cancelAnimationFrame(this.rafId),this.rafId=null),this._scrollCallback&&(scrollManager.remove(`dropdown-${this.id}`),this._scrollCallback=null),this.scrollableParents&&(this.scrollableParents.forEach(({element:t,handler:e})=>{t.removeEventListener("scroll",e)}),this.scrollableParents=[]),this.resizeHandler&&(window.removeEventListener("resize",this.resizeHandler),this.resizeHandler=null),this.intersectionObserver&&(this.intersectionObserver.disconnect(),this.intersectionObserver=null),this._documentClickHandler&&(document.removeEventListener("click",this._documentClickHandler),document.removeEventListener("touchstart",this._documentClickHandler),this._documentClickHandler=null)}setPosition(t){null==t&&(t=this.placement);const e=this.el.getBoundingClientRect(),i=window.innerWidth,s=window.innerHeight,n=!this.dropdownEl.classList.contains("show")&&0===this.dropdownEl.offsetWidth;n&&(this.dropdownEl.style.display="block",this.dropdownEl.style.visibility="hidden");let o,l,a=this.dropdownEl.offsetWidth,r=this.dropdownEl.offsetHeight,c=this.el.offsetWidth,h=this.el.offsetHeight;if("fixed"===this.position)o=e.left+window.scrollX,l=e.top+window.scrollY;else{const t=this.dropdownEl.offsetParent||document.body,i=t.getBoundingClientRect();o=e.left-i.left+t.scrollLeft,l=e.top-i.top+t.scrollTop}let d=0,p=0,u=0,m=0;if(this.offset){const t=this.offset.split(",");u=parseInt(t[0],10)||0,m=parseInt(t[1],10)||0}const f=parseInt(getComputedStyle(document.documentElement).getPropertyValue("--cool-dropdown-spacer"))||2,b=(t,e=this.align)=>{let i=0,s=0;switch(t){case"top":i="end"===e?o+c-a:o,s=l-r-f;break;case"bottom":i="end"===e?o+c-a:o,s=l+h+f;break;case"left":i=o-a-f,s=l;break;case"right":i=o+c+f,s=l}return{x:i+u,y:s+m}};let g=t,y=this.align,E=b(t);if(this.positionObserver){const n=5,c=t=>{const c={top:!1,bottom:!1,left:!1,right:!1};if("fixed"===this.position)c.top=t.y<n,c.bottom=t.y+r>s-n,c.left=t.x<n,c.right=t.x+a>i-n;else{const h=e.left+(t.x-o),d=e.top+(t.y-l),p=h+a,u=d+r;c.top=d<n,c.bottom=u>s-n,c.left=h<n,c.right=p>i-n}return c},h=c(E);"bottom"===t&&h.bottom&&!h.top?(g="top",E=b("top",y)):"top"===t&&h.top&&!h.bottom?(g="bottom",E=b("bottom",y)):"right"===t&&h.right&&!h.left?(g="left",E=b("left",y)):"left"===t&&h.left&&!h.right&&(g="right",E=b("right",y));const d=c(E);if("top"!==g&&"bottom"!==g||("end"===y&&d.left&&!d.right?(y="start",E=b(g,y)):"start"===y&&d.right&&!d.left&&(y="end",E=b(g,y))),this.containerEl.classList.remove("dropup","dropbottom","dropleft","dropright"),"top"===g?this.containerEl.classList.add("dropup"):"left"===g?this.containerEl.classList.add("dropleft"):"right"===g?this.containerEl.classList.add("dropright"):this.containerEl.classList.add("dropbottom"),this.dropdownEl.setAttribute("x-placement",g+"-"+y),"fixed"===this.position)E.x=Math.max(n,Math.min(E.x,i-a-n)),E.y=Math.max(n,Math.min(E.y,s-r-n));else{const t=e.left+(E.x-o),c=e.top+(E.y-l);t<n?E.x+=n-t:t+a>i-n&&(E.x-=t+a-i+n),c<n?E.y+=n-c:c+r>s-n&&(E.y-=c+r-s+n)}}if(d=E.x,p=E.y,n&&(this.dropdownEl.style.display="",this.dropdownEl.style.visibility=""),"fixed"===this.position)Object.assign(this.dropdownEl.style,{position:"fixed",top:Math.round(p)+"px",left:Math.round(d)+"px",right:"auto",bottom:"auto",transform:"none",willChange:"auto",zIndex:"9999"});else{const t=this.el.closest(".dropdown, .dropup, .dropleft, .dropright");if(t){const i=t.getBoundingClientRect();let s=e.left-i.left,n=e.top-i.top;switch(g){case"bottom":n+=h+f,"end"===y&&(s=s+c-a);break;case"top":n-=r+f,"end"===y&&(s=s+c-a);break;case"left":s-=a+f;break;case"right":s+=c+f}s+=u,n+=m,Object.assign(this.dropdownEl.style,{position:"absolute",top:Math.round(n)+"px",left:Math.round(s)+"px",right:"auto",bottom:"auto",transform:"none",willChange:"auto"})}}}show(){if(this.dropdownEl&&!this.dropdownEl.classList.contains("show")){if(this.setPosition(),this.animation?(this.dropdownEl.setAttribute("x-placement",this.placement+"-"+this.align),this.dropdownEl.classList.add(this.animationSpeed),playAnimation(this.dropdownEl,this.animationIn),this.dropdownEl.classList.add("show"),this.dropdownEl.id=this.id,this.el.setAttribute("data-dropdown",this.id)):(this.dropdownEl.setAttribute("x-placement",this.placement+"-"+this.align),this.dropdownEl.classList.add("show"),this.dropdownEl.id=this.id,this.el.setAttribute("data-dropdown",this.id)),this.opts.scroll&&this.scroll&&this.scrollableContentEl)if(this.scrollableContentEl.offsetHeight,this.animation){const t=getComputedStyle(this.dropdownEl).animationDuration,e=t?1e3*parseFloat(t):300;setTimeout(()=>{this.scroll&&"function"==typeof this.scroll.update&&this.scroll.update()},e)}else requestAnimationFrame(()=>{this.scroll&&"function"==typeof this.scroll.update&&this.scroll.update()});this.contentOpen=!0,this.onShow()}}close(){this.dropdownEl&&!this.preventClose&&(this.animation&&!this.dropdownEl.classList.contains("animation")?playAnimation(this.dropdownEl,this.animationOut).then(()=>{this.dropdownEl.classList.remove("show"),this.el.removeAttribute("data-dropdown")}):(this.dropdownEl.classList.remove("show"),this.el.removeAttribute("data-dropdown")),this.contentOpen=!1,this.onClose())}onItemClick(t,e){let i=this.opts.onItemClick;"function"==typeof i&&i.call(t,e,this)}}Dropdown._jQueryInit();class Tooltip extends Component{static NAME="coolTooltip";static DEFAULTS={container:"body",animation:!1,animationIn:"fadeIn",animationOut:"fadeOut",animationSpeed:"fastest",placement:"bottom",content:"",trigger:"auto",onInit:null,onUpdate:null,onDestroy:null,onShow:null,onClose:null};static _jQueryInterface(t){return this.each(function(){const e=$(this);let i=e.data(`plugin_${Tooltip.NAME}`);i||(i=new Tooltip(this,"object"==typeof t&&t),e.data(`plugin_${Tooltip.NAME}`,i)),"string"==typeof t&&i[t]()})}static _jQueryInit(){if("undefined"==typeof $||!$.fn)return;const t=$.fn[Tooltip.NAME];$.fn[Tooltip.NAME]=Tooltip._jQueryInterface,$.fn[Tooltip.NAME].Constructor=Tooltip,$.fn[Tooltip.NAME].defaults=Tooltip.DEFAULTS||{},$.fn[Tooltip.NAME].noConflict=()=>($.fn[Tooltip.NAME]=t,Tooltip._jQueryInterface)}constructor(t,e){super(),this.opts=deepMerge({},Tooltip.DEFAULTS,window.Cool?.settings?.tooltip||{},e||{}),this.el=t,this.init()}init(){this.buildCache(),this.bindEvents(),this.onInit()}destroy(){this.unbindEvents(),this.tooltipEl&&(this.tooltipEl.remove(),this.tooltipEl=null),this.constructor.removeInstance(this.el),this.onDestroy()}update(){this.buildCache(),this.tooltipEl&&this.setPosition(),this.onUpdate()}buildCache(){this.containerEl=this.el.dataset.container?document.querySelector(this.el.dataset.container):document.querySelector(this.opts.container),this.id="tooltip-"+generateUUID(),this.animation=void 0!==this.el.dataset.animation?this.el.dataset.animation:this.opts.animation,this.animationIn=this.el.dataset.animationIn||this.el.dataset.animationin||this.opts.animationIn,this.animationOut=this.el.dataset.animationOut||this.el.dataset.animationout||this.opts.animationOut,this.animationSpeed=this.el.dataset.animationSpeed||this.el.dataset.animationspeed||this.opts.animationSpeed,this.placement=this.el.dataset.placement||this.opts.placement,this.placementChanged=!1,this.content=this.el.dataset.content||this.opts.content,this.trigger=this.el.dataset.trigger||this.opts.trigger}bindEvents(){"auto"===this.trigger&&(this._mouseenterHandler=()=>this.show(),this._mouseleaveHandler=()=>this.close(),this._blurHandler=()=>this.close(),this._clickHandler=()=>this.close(),this.el.addEventListener("mouseenter",this._mouseenterHandler),this.el.addEventListener("mouseleave",this._mouseleaveHandler),this.el.addEventListener("blur",this._blurHandler),this.el.addEventListener("click",this._clickHandler)),window.ResizeObserver&&(this._resizeCallback=()=>{this.tooltipEl&&this.tooltipEl.classList.contains("show")&&requestAnimationFrame(()=>{this.setPosition()})},resizeManager.observe(this.el,this._resizeCallback))}unbindEvents(){this._mouseenterHandler&&(this.el.removeEventListener("mouseenter",this._mouseenterHandler),this.el.removeEventListener("mouseleave",this._mouseleaveHandler),this.el.removeEventListener("blur",this._blurHandler),this.el.removeEventListener("click",this._clickHandler)),this._resizeCallback&&(resizeManager.unobserve(this.el),this._resizeCallback=null)}buildTooltip(){this.tooltipEl=document.createElement("div"),this.tooltipEl.className="tooltip",this.tooltipEl.setAttribute("role","tooltip"),this.tooltipEl.id=this.id,this.tooltipEl.innerHTML=`\n <div class="arrow"></div>\n <div class="tooltip-inner">${this.content}</div>\n `,this.containerEl.appendChild(this.tooltipEl),this.arrowEl=this.tooltipEl.querySelector(".arrow")}setPosition(t){null==t&&(t=this.placement),this.tooltipEl.classList.add("tooltip-"+t);const e=this.containerEl.clientWidth,i=this.containerEl.clientHeight,s=this.tooltipEl.offsetWidth,n=this.tooltipEl.offsetHeight,o=this.el.getBoundingClientRect(),l=this.el.offsetWidth,a=this.el.offsetHeight,r=o.left+window.scrollX,c=o.top+window.scrollY,h=this.arrowEl.offsetWidth,d=this.arrowEl.offsetHeight;let p,u,m;"top"===t?(u=Math.round(r-(s-l)/2),m=Math.round(c-n),p=Math.round(s/2-h/2),this.arrowEl.style.left=p+"px"):"right"===t?(u=Math.round(r+l),m=Math.round(c-(n-a)/2),p=Math.round(n/2-d/2),this.arrowEl.style.top=p+"px"):"bottom"===t?(u=Math.round(r-(s-l)/2),m=Math.round(c+a),p=Math.round(s/2-h/2),this.arrowEl.style.left=p+"px"):"left"===t&&(u=Math.round(r-s),m=Math.round(c-(n-a)/2),p=Math.round(n/2-d/2),this.arrowEl.style.top=p+"px"),Object.assign(this.tooltipEl.style,{position:"absolute",top:"0px",left:"0px",transform:`translate3d(${u}px, ${m}px, 0px)`,willChange:"transform"});let f=0;const b={left:this.tooltipEl.offsetLeft,top:this.tooltipEl.offsetTop,right:e-(this.tooltipEl.offsetLeft+s),bottom:i-(this.tooltipEl.offsetTop+n)};let g={left:!1,top:!1,right:!1,bottom:!1};if(b.right<0&&(g.right=!0,f++),b.left<0&&(g.left=!0,f++),b.bottom<0&&(g.bottom=!0,f++),b.top<0&&(g.top=!0,f++),f>0&&(!this.placementChanged&&g.left&&b.right>s?(this.placementChanged=!0,this.tooltipEl.classList.remove("tooltip-"+t),this.arrowEl.removeAttribute("style"),this.setPosition("right")):!this.placementChanged&&g.top&&b.top>n?(this.placementChanged=!0,this.tooltipEl.classList.remove("tooltip-"+t),this.arrowEl.removeAttribute("style"),this.setPosition("bottom")):!this.placementChanged&&g.right&&b.left>s?(this.placementChanged=!0,this.tooltipEl.classList.remove("tooltip-"+t),this.arrowEl.removeAttribute("style"),this.setPosition("left")):!this.placementChanged&&g.bottom&&b.top>n?(this.placementChanged=!0,this.tooltipEl.classList.remove("tooltip-"+t),this.arrowEl.removeAttribute("style"),this.setPosition("top")):this.placementChanged||"top"===t&&"bottom"===t||!g.left&&!g.right?this.fixTooltipPosition=!0:b.top>b.bottom?(this.placementChanged=!0,this.tooltipEl.classList.remove("tooltip-"+t),this.arrowEl.removeAttribute("style"),this.setPosition("top")):(this.placementChanged=!0,this.tooltipEl.classList.remove("tooltip-"+t),this.arrowEl.removeAttribute("style"),this.setPosition("bottom")),this.fixTooltipPosition)){if(g.left){let e=Math.abs(b.left);r>=u+e&&["top","bottom"].indexOf(t)<0?u+=e:(u+=e,p-=e)}if(g.top){let t=Math.abs(b.top);m+=t,p-=t}if(g.right){let e=Math.abs(b.right);r<=u-e&&["top","bottom"].indexOf(t)<0||(u-=e,p+=e)}if(g.bottom){let t=Math.abs(b.bottom);m-=t,p+=t}"top"===t||"bottom"===t?this.arrowEl.style.left=p+"px":this.arrowEl.style.top=p+"px",Object.assign(this.tooltipEl.style,{width:s+"px",transform:`translate3d(${u}px, ${m}px, 0px)`}),this.fixTooltipPosition=!1}}show(){this.tooltipEl||(this.buildTooltip(),this.setPosition(),this.animation?(this.tooltipEl.classList.add(this.animationSpeed),playAnimation(this.tooltipEl,this.animationIn),this.tooltipEl.classList.add("show"),this.tooltipEl.id=this.id,this.el.setAttribute("data-tooltip",this.id)):(this.tooltipEl.classList.add("show"),this.tooltipEl.id=this.id,this.el.setAttribute("data-tooltip",this.id)),this.onShow())}close(){this.tooltipEl&&(this.animation&&!this.tooltipEl.classList.contains("animation")?playAnimation(this.tooltipEl,this.animationOut).then(()=>{this.tooltipEl&&(this.tooltipEl.remove(),this.el.removeAttribute("data-tooltip"),this.tooltipEl=null,this.placementChanged=!1),this.onClose()}):(this.tooltipEl.remove(),this.el.removeAttribute("data-tooltip"),this.tooltipEl=null,this.placementChanged=!1,this.onClose()))}}Tooltip._jQueryInit();class Collapse extends Component{static NAME="coolCollapse";static DEFAULTS={target:null,onInit:null,onUpdate:null,onDestroy:null,onShow:null,onClose:null};static _jQueryInterface(t){return this.each(function(){const e=$(this);let i=e.data(`plugin_${Collapse.NAME}`);i||(i=new Collapse(this,"object"==typeof t&&t),e.data(`plugin_${Collapse.NAME}`,i)),"string"==typeof t&&i[t]()})}static _jQueryInit(){if("undefined"==typeof $||!$.fn)return;const t=$.fn[Collapse.NAME];$.fn[Collapse.NAME]=Collapse._jQueryInterface,$.fn[Collapse.NAME].Constructor=Collapse,$.fn[Collapse.NAME].defaults=Collapse.DEFAULTS||{},$.fn[Collapse.NAME].noConflict=()=>($.fn[Collapse.NAME]=t,Collapse._jQueryInterface)}constructor(t,e){super(),this.opts=deepMerge({},Collapse.DEFAULTS,window.Cool?.settings?.collapse||{},e||{}),this.el=t,this.init()}init(){this.buildCache(),this.bindEvents(),this.onInit()}destroy(){this.unbindEvents(),this.constructor.removeInstance(this.el),this.onDestroy()}update(){this.buildCache(),this.onUpdate()}buildCache(){const t=this.el.dataset.target||this.opts.target;if(this.target=t?document.querySelector(t):this.el.parentElement?.querySelector(".collapse"),this.breakpoint=this.el.dataset.breakpoint,this.expanded="true"===this.el.getAttribute("aria-expanded"),this.target){this.container=this.target.closest(".section-collapse");const t=this.el.dataset.target?`[data-collapse-indicator="${this.el.dataset.target}"]`:null;this.indicator=t?document.querySelector(t):this.el.parentElement?.querySelector("[data-collapse-indicator]")}}bindEvents(){this._clickHandler=t=>{this.breakpoint&&window.matchMedia(`(min-width: ${this.breakpoint}px)`).matches||(t.preventDefault(),this.toggle())},this.el.addEventListener("click",this._clickHandler)}unbindEvents(){this._clickHandler&&this.el.removeEventListener("click",this._clickHandler)}toggle(){this.expanded?this.close():this.show()}show(){this.expanded||(this.target.classList.add("show"),this.container&&this.container.classList.add("show"),this.indicator&&this.indicator.classList.add("show"),this.el.setAttribute("aria-expanded","true"),this.expanded=!0,this.onShow())}close(){this.expanded&&(this.target.classList.remove("show"),this.container&&this.container.classList.remove("show"),this.indicator&&this.indicator.classList.remove("show"),this.el.setAttribute("aria-expanded","false"),this.expanded=!1,this.onClose())}}Collapse._jQueryInit();class SectionTabs extends Component{static NAME="coolSectionTabs";static DEFAULTS={onInit:null,onUpdate:null,onDestroy:null};static _jQueryInterface(t){return this.each(function(){const e=$(this);let i=e.data(`plugin_${SectionTabs.NAME}`);i||(i=new SectionTabs(this,"object"==typeof t&&t),e.data(`plugin_${SectionTabs.NAME}`,i)),"string"==typeof t&&i[t]()})}static _jQueryInit(){if("undefined"==typeof $||!$.fn)return;const t=$.fn[SectionTabs.NAME];$.fn[SectionTabs.NAME]=SectionTabs._jQueryInterface,$.fn[SectionTabs.NAME].Constructor=SectionTabs,$.fn[SectionTabs.NAME].defaults=SectionTabs.DEFAULTS||{},$.fn[SectionTabs.NAME].noConflict=()=>($.fn[SectionTabs.NAME]=t,SectionTabs._jQueryInterface)}constructor(t,e){super(),this.opts=deepMerge({},SectionTabs.DEFAULTS,window.Cool?.settings?.sectionTabs||{},e||{}),this.el=t,this._tabsCache=new WeakMap,this._resizeObserver=null,this._isProcessing=!1,this._rafId=null,this.init()}init(){this.buildCache(),this.bindEvents(),this._rafId=requestAnimationFrame(()=>{this.dropdownContainer&&this.dropdownContainer.classList.add("js-ready"),this.el.classList.add("js-initialized"),this.checkForChanges(),this.onInit()})}destroy(){this.unbindEvents(),this._rafId&&cancelAnimationFrame(this._rafId),this._resizeObserver&&(this._resizeObserver.disconnect(),this._resizeObserver=null),this.constructor.removeInstance(this.el),this.onDestroy()}update(){this.buildCache(),this.onUpdate()}buildCache(){const t=this.el.closest(".section-tabs");this.dropdownContainer=t?t.querySelector(".dropdown-container"):this.el.querySelector(".dropdown-container"),this.dropdownList=t?t.querySelector(".dropdown-list"):this.el.querySelector(".dropdown-list")}bindEvents(){const t=this.el.closest(".section-tabs"),e=(t?t.closest(".section-header"):null)||t||this.el;window.ResizeObserver?(this._resizeObserver=new ResizeObserver(t=>{this._isProcessing||(this._isProcessing=!0,this._rafId&&cancelAnimationFrame(this._rafId),this._rafId=requestAnimationFrame(()=>{this.checkForChanges(),this._isProcessing=!1}))}),this._resizeObserver.observe(e)):(this._resizeHandler=debounce(()=>{this.checkForChanges()},50),window.addEventListener("resize",this._resizeHandler,{passive:!0}))}unbindEvents(){this._resizeObserver&&this._resizeObserver.disconnect(),this._resizeHandler&&window.removeEventListener("resize",this._resizeHandler)}moveToList(t){const e=t.getAttribute("data-uuid"),i=this.el.querySelector(`:scope > .tab-item[data-related-dropdown-item="${e}"]`);i&&(i.removeAttribute("data-related-dropdown-item"),t.remove())}moveToDropdown(t){if(t.hasAttribute("data-related-dropdown-item"))return;if(!this.dropdownList)return;const e=crypto.randomUUID(),i=t.cloneNode(!0),s=i.querySelector(".tab-item-action");s&&s.classList.add("dropdown-item"),i.setAttribute("data-uuid",e),this.dropdownList.appendChild(i),t.setAttribute("data-related-dropdown-item",e)}getTabDimensions(t){if(this._tabsCache.has(t)){return this._tabsCache.get(t)}const e=t.classList.contains("invisible");e&&t.classList.remove("invisible");const i=this.el.closest(".section-tabs")||this.el,s=i.style.overflow;i.style.overflow="visible",i.offsetHeight;const n=t.offsetWidth,o=n+(parseInt(getComputedStyle(t).marginLeft,10)||0)+(parseInt(getComputedStyle(t).marginRight,10)||0);i.style.overflow=s,e&&t.classList.add("invisible");const l={width:n,totalWidth:o};return this._tabsCache.set(t,l),l}availableSpace(){const t=this.el.closest(".section-tabs"),e=t?t.closest(".section-header"):null;let i,s,n;if(e){const o=getComputedStyle(e);if("column"===o.flexDirection){const e=t||this.el,o=getComputedStyle(e);i=e.offsetWidth,s=parseInt(o.paddingLeft,10)||0,n=parseInt(o.paddingRight,10)||0}else{i=e.offsetWidth,s=parseInt(o.paddingLeft,10)||0,n=parseInt(o.paddingRight,10)||0;const t=e.querySelector(".section-search");if(t){i-=t.offsetWidth;i-=parseInt(o.gap,10)||0}}}else{const e=t||this.el,o=getComputedStyle(e);i=e.offsetWidth,s=parseInt(o.paddingLeft,10)||0,n=parseInt(o.paddingRight,10)||0}return i-s-n-(this.dropdownContainer?this.dropdownContainer.classList.contains("visible")?this.dropdownContainer.offsetWidth:40:0)}checkForChanges(){if(!this.dropdownList)return;this._tabsCache=new WeakMap;const t=Array.from(this.el.querySelectorAll(":scope > .tab-item")),e=Array.from(this.dropdownList.children),i=this.availableSpace(),s=parseInt(getComputedStyle(this.el).gap,10)||0;if(window.innerWidth<768&&i<200)return t.forEach(t=>{t.classList.remove("invisible"),t.removeAttribute("data-related-dropdown-item")}),void(this.dropdownContainer&&this.dropdownContainer.classList.remove("visible"));let n=0,o=[],l=[];for(let e=0;e<t.length;e++){const a=t[e],{totalWidth:r}=this.getTabDimensions(a),c=n+r+(e>0?s:0);if(c<=i){n=c,o.push(a);const t=a.getAttribute("data-related-dropdown-item");if(t){const e=this.dropdownList.querySelector(`[data-uuid="${t}"]`);e&&this.moveToList(e)}}else l.push(a)}if(l.forEach((t,e)=>{t.hasAttribute("data-related-dropdown-item")||this.moveToDropdown(t)}),e.length>0&&0===l.length){const t=i-n;for(let i=e.length-1;i>=0;i--){const l=e[i],a=l.getAttribute("data-uuid"),r=this.el.querySelector(`[data-related-dropdown-item="${a}"]`);if(r){const{totalWidth:e}=this.getTabDimensions(r),i=e+(n>0?s:0);if(!(i<=t))break;this.moveToList(l),o.push(r),n+=i}}}t.forEach(t=>{o.includes(t)?t.classList.remove("invisible"):t.classList.add("invisible")});const a=this.dropdownList&&this.dropdownList.children.length>0;this.dropdownContainer&&this.dropdownContainer.classList.toggle("visible",a)}}SectionTabs._jQueryInit();class Toast extends Component{static NAME="coolToast";static DEFAULTS={title:"",content:"",icon:"",action:null,template:"",placement:"top-right",animation:!0,animationIn:null,animationOut:null,animationSpeed:"faster",offsetX:null,offsetY:null,dismiss:3,header:!1,maxVisible:3,onInitialize:null,onDestroy:null,onInit:null,onShow:null,onClose:null,onClick:null};static _jQueryInterface(t){const e=$(this);let i=e.data(`plugin_${Toast.NAME}`);i||(i=new Toast(this,"object"==typeof t&&t),e.data(`plugin_${Toast.NAME}`,i)),"string"==typeof t&&i[t]()}static _jQueryInit(){if("undefined"==typeof $||!$.fn)return;const t=$.fn[Toast.NAME];$.fn[Toast.NAME]=Toast._jQueryInterface,$.fn[Toast.NAME].Constructor=Toast,$.fn[Toast.NAME].defaults=Toast.DEFAULTS||{},$.fn[Toast.NAME].noConflict=()=>($.fn[Toast.NAME]=t,Toast._jQueryInterface)}constructor(t,e){super(),this.settings=deepMerge({},Toast.DEFAULTS,window.Cool?.settings?.toast||{},e||{}),this.container="string"==typeof t?document.querySelector(t):t,t&&t.jquery&&(this.container=t[0]),this.containers=new Map,this.onInitialize=this.settings.onInitialize,this.onDestroy=this.settings.onDestroy}_getContainer(t,e,i,s){if(this.containers.has(t))return this.containers.get(t);const n=document.createElement("div");n.className="toast-container",n.setAttribute("data-placement",t),null!=e&&n.style.setProperty("--_toast-offset-x","number"==typeof e?`${e}px`:e),null!=i&&n.style.setProperty("--_toast-offset-y","number"==typeof i?`${i}px`:i),null!=s&&n.style.setProperty("--_toast-max-visible",String(s)),this.container.appendChild(n),n.addEventListener("mouseenter",()=>{this._pauseTimers(o)}),n.addEventListener("mouseleave",()=>{this._resumeTimers(o)});const o={el:n,toasts:[],queue:[]};return this.containers.set(t,o),o}_cleanupContainer(t){const e=this.containers.get(t);e&&0===e.toasts.length&&0===e.queue.length&&(e.el.remove(),this.containers.delete(t))}_updateStack(t){const e=t.toasts,i=parseInt(t.el.style.getPropertyValue("--_toast-max-visible")||this.settings.maxVisible,10);for(let t=0;t<e.length;t++){const s=e[t],n=e.length-1-t;s.el.style.setProperty("--_toast-index",String(n));const o=s.el.offsetHeight;s.el.style.setProperty("--_toast-collapse-height",`${o}px`),n>=i?s.el.setAttribute("data-toast-hidden","true"):s.el.removeAttribute("data-toast-hidden")}}_pauseTimers(t){const e=Date.now();for(const i of t.toasts)i._dismissTimer&&(clearTimeout(i._dismissTimer),i._dismissTimer=null,i._dismissRemaining=Math.max(0,(i._dismissEnd||e)-e))}_resumeTimers(t){for(const e of t.toasts)null!=e._dismissRemaining&&e._dismissRemaining>0&&this._startDismissTimer(e,e._dismissRemaining),e._dismissRemaining=null}_startDismissTimer(t,e){t._dismissEnd=Date.now()+e,t._dismissTimer=setTimeout(()=>{t._dismissTimer=null,t._dismissRemaining=null,this.close(t)},e)}init(t){const e=deepMerge({},this.settings,t||{}),i=this._buildToast(e),s=this._getContainer(i.placement,e.offsetX,e.offsetY,e.maxVisible);return s.toasts.push(i),i._containerEntry=s,this._showToast(i,s),this.onInit(i),i}destroy(){for(const[,t]of this.containers){const e=[...t.toasts];for(const i of e)this._removeToast(i,t,!1);t.queue.length=0}for(const[,t]of this.containers)t.el.remove();this.containers.clear(),this.onDestroy()}_buildToast(t){let e=t.animationIn,i=t.animationOut;if(!e||!i){const s=t.placement.startsWith("top-");e||(e=s?"slideInDown":"slideInUp"),i||(i=s?"slideOutUp":"slideOutDown")}const s={uuid:"toast-"+generateUUID(),placement:t.placement,animation:t.animation,animationIn:e,animationOut:i,animationSpeed:t.animationSpeed,dismiss:t.dismiss,title:t.title,content:t.content,icon:t.icon,action:t.action,template:t.template,maxBodyHeight:t.maxBodyHeight,onInit:t.onInit,onShow:t.onShow,onClose:t.onClose,onClick:t.onClick,_dismissTimer:null,_dismissEnd:null,_dismissRemaining:null,_containerEntry:null};let n;n="function"==typeof s.template?s.template(s):this._renderTemplate(s);const o=document.createElement("div");return o.innerHTML=n.trim(),s.el=o.firstElementChild,s.innerEl=s.el.querySelector(".toast-inner"),s.closeBtn=s.el.querySelector("[data-toast-close]"),s}_showToast(t,e){e.el.appendChild(t.el),t._closeHandler=e=>{if(e.target.closest("[data-toast-close]"))return e.preventDefault(),e.stopPropagation(),void this.close(t);if("function"==typeof t.onClick&&t.onClick.call(t,e),t.action){const e="object"==typeof t.action?t.action.uri:t.action;e&&(window.location.href=e)}this.close(t)},t.el.addEventListener("click",t._closeHandler),this._updateStack(e),t.el.offsetHeight,t.el.classList.add("show"),requestAnimationFrame(()=>{t.animation&&(t.innerEl.classList.add(t.animationSpeed),playAnimation(t.innerEl,t.animationIn))}),t.dismiss&&this._startDismissTimer(t,1e3*t.dismiss),this.onShow(t)}close(t){const e=t._containerEntry;e&&(t._dismissTimer&&(clearTimeout(t._dismissTimer),t._dismissTimer=null),t.animation&&t.innerEl&&!t.innerEl.classList.contains("animation")?playAnimation(t.innerEl,t.animationOut).then(()=>{this._removeToast(t,e,!0)}):this._removeToast(t,e,!0))}_removeToast(t,e,i){if(t.el&&t.el.parentNode&&t.el.remove(),t._closeHandler&&(t.el.removeEventListener("click",t._closeHandler),t._closeHandler=null),e.toasts=e.toasts.filter(e=>e.uuid!==t.uuid),this._updateStack(e),i&&e.queue.length>0){const t=parseInt(e.el.style.getPropertyValue("--_toast-max-visible")||this.settings.maxVisible,10);if(e.toasts.length<t){const t=e.queue.shift();e.toasts.push(t),t._containerEntry=e,this._showToast(t,e)}}this._cleanupContainer(t.placement),this.onClose(t)}onInitialize(){const t=this.onInitialize;"function"==typeof t&&t.call(this.container)}onDestroy(){const t=this.onDestroy;"function"==typeof t&&t.call(this.container)}onInit(t){const e=t.onInit;"function"==typeof e&&e.call(t)}onShow(t){const e=t.onShow;"function"==typeof e&&e.call(t)}onClose(t){const e=t.onClose;"function"==typeof e&&e.call(t)}_renderTemplate(t){let e="",i="",s="",n="",o="";e="function"==typeof t.content?t.content():t.content,t.icon&&(o="string"==typeof t.icon&&t.icon.trimStart().startsWith("<")?`<div class="toast-icon">${t.icon}</div>`:`<div class="toast-icon"><img src="${t.icon}" alt=""></div>`),o||t.title?i=`\n <div class="toast-header">\n ${o}\n\n <span class="mr-auto">${t.title}</span>\n\n <button type="button" data-toast-close>\n <svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="icon"><path d="M18 6 6 18"/><path d="m6 6 12 12"/></svg>\n </button>\n\n </div>\n `:n='\n <button type="button" data-toast-close>\n <svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="icon"><path d="M18 6 6 18"/><path d="m6 6 12 12"/></svg>\n </button>\n ',s=`\n <div class="toast-body"><div>${e}</div>${n}</div>\n `;const l=t.action?' role="button" style="cursor: pointer;"':"";return`\n <div class="toast${t.action?" toast-actionable":""}" role="alert" id="${t.uuid}"${l}>\n\n <div class="toast-inner">\n\n ${i}\n ${s}\n\n </div>\n\n </div>\n `}}Toast._jQueryInit();class Dialog extends Component{static NAME="coolDialog";static DEFAULTS={title:"",template:"",body:"",footer:!0,header:!0,size:"",classes:"",centered:!0,backdrop:!0,preventScroll:!0,closeBtn:!0,animation:!0,animationIn:"zoomIn",animationOut:"fadeOut",animationSpeed:"fastest",maxBodyHeight:null,overflowVisible:!1,onInitialize:null,onDestroy:null,onInit:null,onShow:null,onClose:null,callbacks:{},actions:{}};static _jQueryInterface(t){const e=$(this);let i=e.data(`plugin_${Dialog.NAME}`);i||(i=new Dialog(this,"object"==typeof t&&t),e.data(`plugin_${Dialog.NAME}`,i)),"string"==typeof t&&i[t]()}static _jQueryInit(){if("undefined"==typeof $||!$.fn)return;const t=$.fn[Dialog.NAME];$.fn[Dialog.NAME]=Dialog._jQueryInterface,$.fn[Dialog.NAME].Constructor=Dialog,$.fn[Dialog.NAME].defaults=Dialog.DEFAULTS||{},$.fn[Dialog.NAME].noConflict=()=>($.fn[Dialog.NAME]=t,Dialog._jQueryInterface)}constructor(t,e){super(),this.settings=deepMerge({},Dialog.DEFAULTS,window.Cool?.settings?.dialog||{},e||{}),this.container="string"==typeof t?document.querySelector(t):t,t&&t.jquery&&(this.container=t[0]),this.dialogs=[],this.onInitialize=this.settings.onInitialize,this.onDestroy=this.settings.onDestroy}init(t){let e=deepMerge({},this.settings,t||{});t&&t.actions&&(e.actions=t.actions||{}),t&&t.callbacks&&(e.callbacks=t.callbacks||{}),e.callbacks&&"object"==typeof e.callbacks&&Object.keys(e.callbacks).forEach(t=>{Object.prototype.hasOwnProperty.call(e.actions,t)?"object"!=typeof e.actions[t]||Object.prototype.hasOwnProperty.call(e.actions[t],"content")||this.settings.actions&&this.settings.actions[t]&&"object"==typeof this.settings.actions[t]&&Object.prototype.hasOwnProperty.call(this.settings.actions[t],"content")&&(e.actions[t].content=this.settings.actions[t].content):this.settings.actions&&this.settings.actions[t]?e.actions[t]=deepMerge({},this.settings.actions[t]):e.actions[t]={}});const i=this.buildDialog(e);return this.show(i),this.bindEvents(i),this.onInit(i),i}destroy(){this.onDestroy()}buildDialog(t){const e=this,i={uuid:"dialog-"+generateUUID(),title:t.title,template:t.template,body:t.body,footer:t.footer,header:t.header,size:t.size,classes:t.classes,centered:t.centered,backdrop:t.backdrop,preventScroll:t.preventScroll,closeBtn:t.closeBtn,animation:t.animation,animationIn:t.animationIn,animationOut:t.animationOut,animationSpeed:t.animationSpeed,callbacks:t.callbacks,maxBodyHeight:t.maxBodyHeight,overflowVisible:t.overflowVisible,actions:t.actions,actionInProgress:!1,actionThreshold:300,onInit:t.onInit,onShow:t.onShow,onClose:t.onClose};let s;null==i.maxBodyHeight&&"full"!==i.size&&(i.maxBodyHeight=window.innerHeight-200),s="function"==typeof i.template?i.template():this._renderTemplate(i);const n=document.createElement("div");return n.innerHTML=s.trim(),i.el=n.firstElementChild,"undefined"!=typeof $&&$.fn&&(i.$el=$(i.el)),i.show=function(){e.show(i)},i.close=function(){e.close(i)},this.dialogs.push(i),i}bindEvents(t){const e=this;if(t._actionHandler=i=>{const s=i.target.closest("[data-dialog-action], [data-dialog-confirm], [data-dialog-close], [data-dialog-remove]");if(!s)return;if(i.preventDefault(),t.actionInProgress)return void i.stopPropagation();t.actionInProgress=!0;const n=["confirm","close","remove"];let o=s.dataset.dialogAction;if(!o)for(const t of n)if(s.hasAttribute(`data-dialog-${t}`)){o=t;break}const l=t.actions[o]||{};t.el.dispatchEvent(new CustomEvent(`dialog.${o}`,{bubbles:!0}));const a="function"==typeof l.callback?l.callback:"function"==typeof t.callbacks[o]?t.callbacks[o]:null,r=(e=!1)=>{e?t.actionInProgress=!1:setTimeout(()=>{t.actionInProgress=!1},t.actionThreshold)};if("function"==typeof a)try{const i=a.call(e,function(){n.includes(o)&&e.close(t),r()},t);i&&"function"==typeof i.then?i.then(t=>{!1===t&&r()}).catch(()=>{r()}):r()}catch(t){r()}else n.includes(o)?(e.close(t),r()):r()},t.el.addEventListener("click",t._actionHandler),null!==t.maxBodyHeight&&"full"!==t.size){const e=()=>(t.maxBodyHeight=window.innerHeight-200,t.maxBodyHeight);if(window.ResizeObserver)t.resizeObserver=new ResizeObserver(()=>{t.rafId&&cancelAnimationFrame(t.rafId),t.rafId=requestAnimationFrame(()=>{const i=e(),s=t.el.querySelector(".dialog-body");s&&s.style.setProperty("--cool-dialog-body-height",i+"px")})}),t.resizeObserver.observe(document.body);else{let i,s=window.orientation;t.resizeHandler=()=>{clearTimeout(i);const n=performance.now(),o=window.orientation!==s;if(o&&(s=window.orientation),!t.lastResizeTime||n-t.lastResizeTime>100||o){const i=e(),s=t.el.querySelector(".dialog-body");s&&s.style.setProperty("--cool-dialog-body-height",i+"px"),t.lastResizeTime=n}else i=setTimeout(()=>{const i=e(),s=t.el.querySelector(".dialog-body");s&&s.style.setProperty("--cool-dialog-body-height",i+"px")},16)},window.addEventListener("resize",t.resizeHandler,{passive:!0}),window.addEventListener("orientationchange",t.resizeHandler,{passive:!0})}}}show(t){if(this.container.classList.contains("has-dialogs")||this.container.classList.add("has-dialogs"),t.preventScroll&&!this.container.classList.contains("dialog-prevent-scroll")&&this.container.classList.add("dialog-prevent-scroll"),this.dialogs.length>1){let e=this.dialogs[this.dialogs.length-2].el,i=parseInt(getComputedStyle(e).zIndex,10)||0;i+=1,t.el.style.zIndex=i,Object.assign(e.style,{transition:"opacity 0.3s",opacity:"0",visibility:"visible"})}if(t.backdrop&&!this.container.querySelector(".dialog-backdrop")){const t=document.createElement("div");t.className="dialog-backdrop",this.container.appendChild(t);let e=setInterval(()=>{const t=this.container.querySelector(".dialog-backdrop");0==this.dialogs.length&&t&&(t.remove(),clearInterval(e))},100)}if(this.container.appendChild(t.el),t.animation){const e=t.el.querySelector(".dialog-content");playAnimation(e,t.animationIn)}this.onShow(t)}close(t){let e=null;t.resizeObserver&&(t.resizeObserver.disconnect(),t.resizeObserver=null),t.rafId&&(cancelAnimationFrame(t.rafId),t.rafId=null),t.resizeHandler&&(window.removeEventListener("resize",t.resizeHandler),window.removeEventListener("orientationchange",t.resizeHandler),t.resizeHandler=null),t._actionHandler&&(t.el.removeEventListener("click",t._actionHandler),t._actionHandler=null),this.dialogs.length>1&&(e=this.dialogs[this.dialogs.length-2].el);const i=this.container.querySelectorAll('.dialog[data-dialog-backdrop="true"]'),s=this.container.querySelector(".dialog-backdrop");0===i.length&&s&&s.remove();const n=()=>{t.el.remove(),this.dialogs=this.dialogs.filter(e=>e.uuid!==t.uuid),0==this.dialogs.length?(this.container.classList.remove("has-dialogs"),this.container.classList.remove("dialog-prevent-scroll")):e&&(e.style.opacity="1")};if(t.animation){const e=t.el.querySelector(".dialog-content");playAnimation(e,t.animationOut).then(()=>{n()})}else n();this.onClose(t)}onInitialize(){let t=this.onInitialize;"function"==typeof t&&t.call(this.container)}onDestroy(){let t=this.onDestroy;"function"==typeof t&&t.call(this.container)}onInit(t){let e=t.onInit;"function"==typeof e&&e.call(t)}onShow(t){let e=t.onShow;"function"==typeof e&&e.call(t)}onClose(t){let e=t.onClose;"function"==typeof e&&e.call(t)}_renderFooter(t){if("function"==typeof t.footer)return t.footer();if(""!==t.footer&&!1!==t.footer&&!0!==t.footer)return t.footer;if(!0===t.footer){if(!t.actions||"object"!=typeof t.actions)return"";const e=Object.entries(t.actions).filter(([,t])=>!1!==t&&(void 0===t.visible||!!t.visible)).map(([t,e],i)=>({key:t,action:e,idx:i}));e.sort((t,i)=>{if(2===e.length&&e.some(t=>"close"===t.key)&&e.some(t=>"remove"===t.key)){if("close"===t.key)return-1;if("close"===i.key)return 1;if("remove"===t.key)return 1;if("remove"===i.key)return-1}return"remove"===t.key?-1:"remove"===i.key||"confirm"===t.key?1:"confirm"===i.key?-1:t.idx-i.idx});const i=e.map(({key:t,action:e})=>{let i=e.style?e.style:e.primary?"btn-primary":"btn-secondary";"remove"===t&&(i="btn-remove"),"confirm"!==t||"undefined"!==e.primary&&!1===e.primary||(i="btn-primary");let s=e.content||t.charAt(0).toUpperCase()+t.slice(1);return`\n <button type="button" class="btn ${i}${e.classes?" "+e.classes:""}"${e.attrs?" "+e.attrs:""} data-dialog-action="${t}"${["confirm","close","remove"].includes(t)?` data-dialog-${t}`:""}>\n ${s}\n </button>\n `});let s="";return s=i.length>2?`\n ${i[0]}\n <div class="spacer"></div>\n ${i[1]}\n ${i.slice(2).join("\n")}\n `:i.join("\n"),`\n <div class="dialog-footer">\n ${s}\n </div>\n `}return""}_renderHeader(t){let e="";const i='\n <button type="button" data-dialog-action="close" class="dialog-header-close">\n <svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="icon"><path d="M18 6 6 18"/><path d="m6 6 12 12"/></svg>\n </button>\n ';return e="function"==typeof t.header?t.header():""!==t.header&&!1!==t.header&&!0!==t.header?t.header:!0===t.header?`\n <div class="dialog-header">\n <span class="dialog-title">\n ${escapeHtml(t.title)}\n </span>\n ${i}\n </div>\n `:`<div class="dialog-header">${i}</div>`,e}_renderTemplate(t){const e=t.classes?" "+t.classes:"",i=t.centered?" dialog-centered":"",s=t.size?" dialog-"+t.size:"",n=t.overflowVisible?" dialog-overflow-visible":"",o=' data-dialog-uuid="'+t.uuid+'"',l=t.backdrop?' data-dialog-backdrop="true"':' data-dialog-backdrop="false"',a=t.maxBodyHeight?' style="--cool-dialog-body-height: '+t.maxBodyHeight+'px"':"",r="function"==typeof t.body?t.body():t.body,c=this._renderFooter(t);return`\n <div class="dialog${e}${i}${s}${n}"${o}${l}>\n\n <div class="dialog-container">\n\n <div class="dialog-content">\n\n ${this._renderHeader(t)}\n\n <div class="dialog-body"${a}>\n\n ${r}\n\n </div>\n\n ${c}\n\n </div>\n\n </div>\n\n </div>\n `}}Dialog._jQueryInit();class ThemeSwitcher extends Component{static NAME="coolThemeSwitcher";static DEFAULTS={theme:"auto",storageKey:"cool-theme",target:null,onInit:null,onUpdate:null,onDestroy:null};static _jQueryInterface(t){return this.each(function(){const e=$(this);let i=e.data(`plugin_${ThemeSwitcher.NAME}`);i||(i=new ThemeSwitcher(this,"object"==typeof t&&t),e.data(`plugin_${ThemeSwitcher.NAME}`,i)),"string"==typeof t&&i[t]()})}static _jQueryInit(){if("undefined"==typeof $||!$.fn)return;const t=$.fn[ThemeSwitcher.NAME];$.fn[ThemeSwitcher.NAME]=ThemeSwitcher._jQueryInterface,$.fn[ThemeSwitcher.NAME].Constructor=ThemeSwitcher,$.fn[ThemeSwitcher.NAME].defaults=ThemeSwitcher.DEFAULTS||{},$.fn[ThemeSwitcher.NAME].noConflict=()=>($.fn[ThemeSwitcher.NAME]=t,ThemeSwitcher._jQueryInterface)}constructor(t,e){super(),this.opts=deepMerge({},ThemeSwitcher.DEFAULTS,window.Cool?.settings?.themeSwitcher||{},e||{}),this.el=t,this.init()}init(){this.buildCache(),this.bindEvents();const t=this._getStoredTheme();if(t)this._applyTheme(t);else{const t=this.el.dataset.theme;t&&["light","dark","auto"].includes(t)?this._applyTheme(t):this._applyTheme(this.opts.theme)}this.onInit()}destroy(){this.unbindEvents(),this.constructor.removeInstance(this.el),this.onDestroy()}update(){this.buildCache(),this.onUpdate()}buildCache(){this.target=this.opts.target?"string"==typeof this.opts.target?document.querySelector(this.opts.target):this.opts.target:document.documentElement,this._mediaQuery=window.matchMedia("(prefers-color-scheme: dark)")}bindEvents(){this._clickHandler=t=>{t.preventDefault();const e=this.el.dataset.theme;e&&["light","dark","auto"].includes(e)?this.setTheme(e):this.toggle()},this._mediaChangeHandler=()=>{"auto"===this._currentTheme&&this._dispatchEvent()},this.el.addEventListener("click",this._clickHandler),this._mediaQuery.addEventListener("change",this._mediaChangeHandler)}unbindEvents(){this._clickHandler&&this.el.removeEventListener("click",this._clickHandler),this._mediaChangeHandler&&this._mediaQuery&&this._mediaQuery.removeEventListener("change",this._mediaChangeHandler)}setTheme(t){["light","dark","auto"].includes(t)&&this._applyTheme(t)}getTheme(){return this._currentTheme||"auto"}getResolvedTheme(){return"dark"===this._currentTheme?"dark":"light"===this._currentTheme?"light":this._mediaQuery.matches?"dark":"light"}toggle(){const t=this.getTheme(),e=["light","dark","auto"],i=(e.indexOf(t)+1)%e.length;this.setTheme(e[i])}_applyTheme(t){this._currentTheme=t,this.target.classList.remove("dark","light"),"dark"===t?this.target.classList.add("dark"):"light"===t&&this.target.classList.add("light"),this.el.setAttribute("data-active-theme",t),this._storeTheme(t),this._dispatchEvent()}_dispatchEvent(){const t=new CustomEvent("cool.theme.change",{bubbles:!0,detail:{theme:this.getTheme(),resolvedTheme:this.getResolvedTheme()}});this.target.dispatchEvent(t)}_getStoredTheme(){try{return localStorage.getItem(this.opts.storageKey)}catch{return null}}_storeTheme(t){try{localStorage.setItem(this.opts.storageKey,t)}catch{}}}ThemeSwitcher._jQueryInit(),window.Cool=window.Cool||{},window.Cool.settings=window.Cool.settings||{};class Common{static _sidebarInstance=null;static _sectionInstance=null;static _toastInstance=null;static refresh(){this._sectionInstance&&this._sectionInstance.refresh&&this._sectionInstance.refresh(),Popover.initializeElements('[data-toggle="popover"]',window.Cool.settings.popover),Select.initializeElements('[data-toggle="select"]',window.Cool.settings.select),Dropdown.initializeElements('[data-toggle="dropdown"]',window.Cool.settings.dropdown),Tooltip.initializeElements('[data-toggle="tooltip"]',window.Cool.settings.tooltip),Collapse.initializeElements('[data-toggle="collapse"]',window.Cool.settings.collapse),SectionTabs.initializeElements('[data-toggle="section-tabs"]',window.Cool.settings.sectionTabs),ThemeSwitcher.initializeElements('[data-toggle="theme-switcher"]',window.Cool.settings.themeSwitcher)}static initialize(t={}){window.Cool.settings=t,this._sectionInstance||(this._sectionInstance=new Section(t.section)),Popover.initializeElements('[data-toggle="popover"]',t.popover),Select.initializeElements('[data-toggle="select"]',t.select),Dropdown.initializeElements('[data-toggle="dropdown"]',t.dropdown),Tooltip.initializeElements('[data-toggle="tooltip"]',t.tooltip),Collapse.initializeElements('[data-toggle="collapse"]',t.collapse),SectionTabs.initializeElements('[data-toggle="section-tabs"]',t.sectionTabs),ThemeSwitcher.initializeElements('[data-toggle="theme-switcher"]',t.themeSwitcher);const e=document.querySelector(".sidebar-left");e&&(this._sidebarInstance=Sidebar.initializeElement(e,t.sidebar)||Sidebar.getInstance(e)),this._toastInstance=Toast.initializeElement(document.body,t.toast)||Toast.getInstance(document.body),window.Cool.toast=this._toastInstance,Dialog.initializeElement(document.body,t.dialog)}static initComponent(t){if(!t)return;const e=Array.isArray(t)?t:[t],i=[],s=[];e.forEach(t=>{const e="string"==typeof t?document.querySelector(t):t;if(!e)return;const i=e.querySelectorAll("[data-toggle]");(e.hasAttribute("data-toggle")?[e,...Array.from(i)]:Array.from(i)).forEach(t=>{s.push(t)})});const n=[],o=[];s.forEach(t=>{const e=t.getBoundingClientRect();e.top<window.innerHeight&&e.bottom>0?n.push(t):o.push(t)});const l=[...n,...o];let a=0;const r=()=>{l.slice(a,a+10).forEach(t=>{let e=null;switch(t.getAttribute("data-toggle")){case"popover":e=Popover.initializeElement(t,window.Cool.settings.popover);break;case"select":e=Select.initializeElement(t,window.Cool.settings.select);break;case"dropdown":e=Dropdown.initializeElement(t,window.Cool.settings.dropdown);break;case"tooltip":e=Tooltip.initializeElement(t,window.Cool.settings.tooltip);break;case"collapse":e=Collapse.initializeElement(t,window.Cool.settings.collapse);break;case"section-tabs":e=SectionTabs.initializeElement(t,window.Cool.settings.sectionTabs);break;case"theme-switcher":e=ThemeSwitcher.initializeElement(t,window.Cool.settings.themeSwitcher)}e&&i.push(e)}),a+=10,a<l.length&&("requestIdleCallback"in window?requestIdleCallback(r,{timeout:50}):setTimeout(r,0))};return n.length>0?r():"requestIdleCallback"in window?requestIdleCallback(r,{timeout:100}):r(),i}static destroy(){this._sidebarInstance&&(this._sidebarInstance.destroy(),this._sidebarInstance=null),this._sectionInstance&&(this._sectionInstance.destroy(),this._sectionInstance=null)}static observeResize(t,e){if(t&&"function"==typeof e)return resizeManager.observe(t,e)}static unobserveResize(t){t&&resizeManager.unobserve(t)}static addScrollListener(t,e){t&&"function"==typeof e&&scrollManager.add(t,e)}static removeScrollListener(t){t&&scrollManager.remove(t)}static getSidebar(){return this._sidebarInstance}static getSection(){return this._sectionInstance}static getToast(){return this._toastInstance}static initjQuery(){Popover._jQueryInit(),Select._jQueryInit(),Dropdown._jQueryInit(),Tooltip._jQueryInit(),Collapse._jQueryInit(),SectionTabs._jQueryInit(),Toast._jQueryInit(),Dialog._jQueryInit(),Sidebar._jQueryInit(),ThemeSwitcher._jQueryInit()}}function initjQuery(){Popover._jQueryInit(),Select._jQueryInit(),Dropdown._jQueryInit(),Tooltip._jQueryInit(),SectionTabs._jQueryInit(),Collapse._jQueryInit(),Toast._jQueryInit(),Dialog._jQueryInit(),Sidebar._jQueryInit(),ThemeSwitcher._jQueryInit()}window.Cool.initialize=Common.initialize.bind(Common),window.Cool.initComponent=Common.initComponent.bind(Common),window.Cool.refresh=Common.refresh.bind(Common),window.Cool.destroy=Common.destroy.bind(Common),window.Cool.observeResize=Common.observeResize.bind(Common),window.Cool.unobserveResize=Common.unobserveResize.bind(Common),window.Cool.addScrollListener=Common.addScrollListener.bind(Common),window.Cool.removeScrollListener=Common.removeScrollListener.bind(Common),window.Cool.getSidebar=Common.getSidebar.bind(Common),window.Cool.getSection=Common.getSection.bind(Common),window.Cool.getToast=Common.getToast.bind(Common),window.Cool.initjQuery=Common.initjQuery.bind(Common);const index_esm={Common:Common,Sidebar:Sidebar,Popover:Popover,Select:Select,Dropdown:Dropdown,Tooltip:Tooltip,SectionTabs:SectionTabs,Collapse:Collapse,Toast:Toast,Dialog:Dialog,ThemeSwitcher:ThemeSwitcher,initjQuery:initjQuery};export{Collapse,Common,Dialog,Dropdown,Popover,SectionTabs,Select,Sidebar,ThemeSwitcher,Toast,Tooltip,index_esm as default,initjQuery};
12
7
  //# sourceMappingURL=cool.esm.min.js.map