!function(){"use strict";functione(e,t){for(varo=0;o<t.length;o++){varn=t[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"inn&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}functiont(e){returnfunction(e){if(Array.isArray(e))returno(e)}(e)||function(e){if("undefined"!=typeofSymbol&&Symbol.iteratorinObject(e))returnArray.from(e)}(e)||function(e,t){if(e){if("string"==typeofe)returno(e,t);varn=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?o(e,t):void0}}(e)||function(){thrownewTypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}functiono(e,t){(null==t||t>e.length)&&(t=e.length);for(varo=0,n=newArray(t);o<t;o++)n[o]=e[o];returnn}varn,i,a,r,l,s=(n=["a[href]","area[href]",'input:not([disabled]):not([type="hidden"]):not([aria-hidden])',"select:not([disabled]):not([aria-hidden])","textarea:not([disabled]):not([aria-hidden])","button:not([disabled]):not([aria-hidden])","iframe","object","embed","[contenteditable]",'[tabindex]:not([tabindex^="-"])'],i=function(){functiono(e){varn=e.targetModal,i=e.triggers,a=void0===i?[]:i,r=e.onShow,l=void0===r?function(){}:r,s=e.onClose,c=void0===s?function(){}:s,d=e.openTrigger,u=void0===d?"data-micromodal-trigger":d,f=e.closeTrigger,h=void0===f?"data-micromodal-close":f,g=e.openClass,v=void0===g?"is-open":g,m=e.disableScroll,b=void0!==m&&m,y=e.disableFocus,p=void0!==y&&y,w=e.awaitCloseAnimation,k=void0!==w&&w,E=e.awaitOpenAnimation,A=void0!==E&&E,L=e.debugMode,C=void0!==L&&L;!function(e,t){if(!(einstanceoft))thrownewTypeError("Cannot call a class as a function")}(this,o),this.modal=document.getElementById(n),this.config={debugMode:C,disableScroll:b,openTrigger:u,closeTrigger:h,openClass:v,onShow:l,onClose:c,awaitCloseAnimation:k,awaitOpenAnimation:A,disableFocus:p},a.length>0&&this.registerTriggers.apply(this,t(a)),this.onClick=this.onClick.bind(this),this.onKeydown=this.onKeydown.bind(this)}vari,a;returni=o,(a=[{key:"registerTriggers",value:function(){for(vare=this,t=arguments.length,o=newArray(t),n=0;n<t;n++)o[n]=arguments[n];o.filter(Boolean).forEach((function(t){t.addEventListener("click",(function(t){returne.showModal(t)}))}))}},{key:"showModal",value:function(){vare=this,t=arguments.length>0&&void0!==arguments[0]?arguments[0]:null;if(this.activeElement=document.activeElement,this.modal.setAttribute("aria-hidden","false"),this.modal.classList.add(this.config.openClass),this.scrollBehaviour("disable"),this.addEventListeners(),this.config.awaitOpenAnimation){varo=functiont(){e.modal.removeEventListener("animationend",t,!1),e.setFocusToFirstNode()};this.modal.addEventListener("animationend",o,!1)}elsethis.setFocusToFirstNode();this.config.onShow(this.modal,this.activeElement,t)}},{key:"closeModal",value:function(){vare=arguments.length>0&&void0!==arguments[0]?arguments[0]:null,t=this.modal;if(this.modal.setAttribute("aria-hidden","true"),this.removeEventListeners(),this.scrollBehaviour("enable"),this.activeElement&&this.activeElement.focus&&this.activeElement.focus(),this.config.onClose(this.modal,this.activeElement,e),this.config.awaitCloseAnimation){varo=this.config.openClass;this.modal.addEventListener("animationend",(functione(){t.classList.remove(o),t.removeEventListener("animationend",e,!1)}),!1)}elset.classList.remove(this.config.openClass)}},{key:"closeModalById",value:function(e){this.modal=document.getElementById(e),this.modal&&this.closeModal()}},{key:"scrollBehaviour",value:function(e){if(this.config.disableScroll){vart=document.querySelector("body");switch(e){case"enable":Object.assign(t.style,{overflow:""});break;case"disable":Object.assign(t.style,{overflow:"hidden"})}}}},{key:"addEventListeners",value:function(){this.modal.addEventListener("touchstart",this.onClick),this.modal.addEventListener("click",this.onClick),document.addEventListener("keydown",this.