/**
 * Bundled by jsDelivr using Rollup v2.79.1 and Terser v5.19.0.
 * Original file: /npm/metismenu@3.0.7/dist/metisMenu.esm.js
 *
 * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
 */
import e from "../../jquery/jquery.esm.js";
/*!
* metismenu https://github.com/onokumus/metismenu#readme
* A collapsible jQuery menu plugin
* @version 3.0.7
* @author Osman Nuri Okumus <onokumus@gmail.com> (https://github.com/onokumus)
* @license: MIT
*/const t=(e=>{const t="transitionend",n={TRANSITION_END:"mmTransitionEnd",triggerTransitionEnd(n){e(n).trigger(t)},supportsTransitionEnd:()=>Boolean(t)};function i(t){let i=!1;return e(this).one(n.TRANSITION_END,(()=>{i=!0})),setTimeout((()=>{i||n.triggerTransitionEnd(this)}),t),this}return e.fn.mmEmulateTransitionEnd=i,e.event.special[n.TRANSITION_END]={bindType:t,delegateType:t,handle(t){if(e(t.target).is(this))return t.handleObj.handler.apply(this,arguments)}},n})(e),n="metisMenu",i="metisMenu",r=`.${i}`,s=e.fn[n],a={toggle:!0,preventDefault:!0,triggerElement:"a",parentTrigger:"li",subMenu:"ul"},o={SHOW:`show${r}`,SHOWN:`shown${r}`,HIDE:`hide${r}`,HIDDEN:`hidden${r}`,CLICK_DATA_API:`click${r}.data-api`},g="metismenu",h="mm-active",l="mm-show",d="mm-collapse",c="mm-collapsing";class f{constructor(e,t){this.element=e,this.config={...a,...t},this.transitioning=null,this.init()}init(){const t=this,n=this.config,i=e(this.element);i.addClass(g),i.find(`${n.parentTrigger}.${h}`).children(n.triggerElement).attr("aria-expanded","true"),i.find(`${n.parentTrigger}.${h}`).parents(n.parentTrigger).addClass(h),i.find(`${n.parentTrigger}.${h}`).parents(n.parentTrigger).children(n.triggerElement).attr("aria-expanded","true"),i.find(`${n.parentTrigger}.${h}`).has(n.subMenu).children(n.subMenu).addClass(`${d} ${l}`),i.find(n.parentTrigger).not(`.${h}`).has(n.subMenu).children(n.subMenu).addClass(d),i.find(n.parentTrigger).children(n.triggerElement).on(o.CLICK_DATA_API,(function(i){const r=e(this);if("true"===r.attr("aria-disabled"))return;n.preventDefault&&"#"===r.attr("href")&&i.preventDefault();const s=r.parent(n.parentTrigger),a=s.siblings(n.parentTrigger),o=a.children(n.triggerElement);s.hasClass(h)?(r.attr("aria-expanded","false"),t.removeActive(s)):(r.attr("aria-expanded","true"),t.setActive(s),n.toggle&&(t.removeActive(a),o.attr("aria-expanded","false"))),n.onTransitionStart&&n.onTransitionStart(i)}))}setActive(t){e(t).addClass(h);const n=e(t).children(this.config.subMenu);n.length>0&&!n.hasClass(l)&&this.show(n)}removeActive(t){e(t).removeClass(h);const n=e(t).children(`${this.config.subMenu}.${l}`);n.length>0&&this.hide(n)}show(n){if(this.transitioning||e(n).hasClass(c))return;const i=e(n),r=e.Event(o.SHOW);if(i.trigger(r),r.isDefaultPrevented())return;if(i.parent(this.config.parentTrigger).addClass(h),this.config.toggle){const e=i.parent(this.config.parentTrigger).siblings().children(`${this.config.subMenu}.${l}`);this.hide(e)}i.removeClass(d).addClass(c).height(0),this.setTransitioning(!0);i.height(n[0].scrollHeight).one(t.TRANSITION_END,(()=>{this.config&&this.element&&(i.removeClass(c).addClass(`${d} ${l}`).height(""),this.setTransitioning(!1),i.trigger(o.SHOWN))})).mmEmulateTransitionEnd(350)}hide(n){if(this.transitioning||!e(n).hasClass(l))return;const i=e(n),r=e.Event(o.HIDE);if(i.trigger(r),r.isDefaultPrevented())return;i.parent(this.config.parentTrigger).removeClass(h),i.height(i.height())[0].offsetHeight,i.addClass(c).removeClass(d).removeClass(l),this.setTransitioning(!0);const s=()=>{this.config&&this.element&&(this.transitioning&&this.config.onTransitionEnd&&this.config.onTransitionEnd(),this.setTransitioning(!1),i.trigger(o.HIDDEN),i.removeClass(c).addClass(d))};0===i.height()||"none"===i.css("display")?s():i.height(0).one(t.TRANSITION_END,s).mmEmulateTransitionEnd(350)}setTransitioning(e){this.transitioning=e}dispose(){e.removeData(this.element,i),e(this.element).find(this.config.parentTrigger).children(this.config.triggerElement).off(o.CLICK_DATA_API),this.transitioning=null,this.config=null,this.element=null}static jQueryInterface(t){return this.each((function(){const n=e(this);let r=n.data(i);const s={...a,...n.data(),..."object"==typeof t&&t?t:{}};if(r||(r=new f(this,s),n.data(i,r)),"string"==typeof t){if(void 0===r[t])throw new Error(`No method named "${t}"`);r[t]()}}))}}e.fn[n]=f.jQueryInterface,e.fn[n].Constructor=f,e.fn[n].noConflict=()=>(e.fn[n]=s,f.jQueryInterface);export{f as default};
//# sourceMappingURL=/sm/3d67c3bfd0a936f3dd1aad572eddc40c83977d86c69b8e9eba0d66dd7ad42ef9.map
