!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.Sweetalert2=t()}(this,function(){"use strict";function V(e){return(V="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){for(var n=0;n\n
\n \n
\n \n
\n
\n ?\n
\n
\n !\n
\n
\n i\n
\n
\n
\n \n
\n
\n
\n \n

\n \n
\n
\n
\n \n \n
\n \n \n
\n \n
\n \n \n
\n
\n
\n \n \n
\n
\n
\n \n').replace(/(^|\n)\s*/g,""),Y=function(e){var t=v();if(t&&(t.parentNode.removeChild(t),U([document.documentElement,document.body],[I["no-backdrop"],I["toast-shown"],I["has-column"]])),!O()){var n=document.createElement("div");n.className=I.container,n.innerHTML=M;var o="string"==typeof e.target?document.querySelector(e.target):e.target;o.appendChild(n);var i,r=y(),a=k(),s=_(a,I.input),c=_(a,I.file),u=a.querySelector(".".concat(I.range," input")),l=a.querySelector(".".concat(I.range," output")),d=_(a,I.select),p=a.querySelector(".".concat(I.checkbox," input")),f=_(a,I.textarea);r.setAttribute("role",e.toast?"alert":"dialog"),r.setAttribute("aria-live",e.toast?"polite":"assertive"),e.toast||r.setAttribute("aria-modal","true"),"rtl"===window.getComputedStyle(o).direction&&D(v(),I.rtl);var m=function(e){Pe.isVisible()&&i!==e.target.value&&Pe.resetValidationMessage(),i=e.target.value};return s.oninput=m,c.onchange=m,d.onchange=m,p.onchange=m,f.oninput=m,u.oninput=function(e){m(e),l.value=u.value},u.onchange=function(e){m(e),u.nextSibling.value=u.value},r}H("SweetAlert2 requires document to initialize")},$=function(e,t){if(!e)return W(t);if(e instanceof HTMLElement)t.appendChild(e);else if("object"===V(e))if(t.innerHTML="",0 in e)for(var n=0;n in e;n++)t.appendChild(e[n].cloneNode(!0));else t.appendChild(e.cloneNode(!0));else e&&(t.innerHTML=e);z(t)},J=function(){if(O())return!1;var e=document.createElement("div"),t={WebkitAnimation:"webkitAnimationEnd",OAnimation:"oAnimationEnd oanimationend",animation:"animationend"};for(var n in t)if(t.hasOwnProperty(n)&&void 0!==e.style[n])return t[n];return!1}(),X=function(e){var t=L(),n=S(),o=P();if(e.showConfirmButton||e.showCancelButton?z(t):W(t),e.showCancelButton?o.style.display="inline-block":W(o),e.showConfirmButton?n.style.removeProperty("display"):W(n),n.innerHTML=e.confirmButtonText,o.innerHTML=e.cancelButtonText,n.setAttribute("aria-label",e.confirmButtonAriaLabel),o.setAttribute("aria-label",e.cancelButtonAriaLabel),n.className=I.confirm,D(n,e.confirmButtonClass),o.className=I.cancel,D(o,e.cancelButtonClass),e.buttonsStyling){D([n,o],I.styled),e.confirmButtonColor&&(n.style.backgroundColor=e.confirmButtonColor),e.cancelButtonColor&&(o.style.backgroundColor=e.cancelButtonColor);var i=window.getComputedStyle(n).getPropertyValue("background-color");n.style.borderLeftColor=i,n.style.borderRightColor=i}else U([n,o],I.styled),n.style.backgroundColor=n.style.borderLeftColor=n.style.borderRightColor="",o.style.backgroundColor=o.style.borderLeftColor=o.style.borderRightColor=""},G=function(e){var t=k().querySelector("#"+I.content);e.html?$(e.html,t):e.text?(t.textContent=e.text,z(t)):W(t)},ee=function(e){for(var t=w(),n=0;n=i.progressSteps.length&&q("Invalid currentProgressStep parameter, it should be less than progressSteps.length (currentProgressStep like JS arrays starts from 0)"),i.progressSteps.forEach(function(e,t){var n=document.createElement("li");if(D(n,I.progresscircle),n.innerHTML=e,t===a&&D(n,I.activeprogressstep),r.appendChild(n),t!==i.progressSteps.length-1){var o=document.createElement("li");D(o,I.progressline),i.progressStepsDistance&&(o.style.width=i.progressStepsDistance),r.appendChild(o)}})):W(r)},oe=function(e){var t=C();e.titleText?t.innerText=e.titleText:e.title&&("string"==typeof e.title&&(e.title=e.title.split("\n").join("
")),$(e.title,t))};var ie=[],re=function(){var e=y();e||Pe.fire(""),e=y();var t=L(),n=S(),o=P();z(t),z(n),D([e,t],I.loading),n.disabled=!0,o.disabled=!0,e.setAttribute("data-loading",!0),e.setAttribute("aria-busy",!0),e.focus()},ae={},se={title:"",titleText:"",text:"",html:"",footer:"",type:null,toast:!1,customClass:"",customContainerClass:"",target:"body",backdrop:!0,animation:!0,heightAuto:!0,allowOutsideClick:!0,allowEscapeKey:!0,allowEnterKey:!0,stopKeydownPropagation:!0,keydownListenerCapture:!1,showConfirmButton:!0,showCancelButton:!1,preConfirm:null,confirmButtonText:"OK",confirmButtonAriaLabel:"",confirmButtonColor:null,confirmButtonClass:"",cancelButtonText:"Cancel",cancelButtonAriaLabel:"",cancelButtonColor:null,cancelButtonClass:"",buttonsStyling:!0,reverseButtons:!1,focusConfirm:!0,focusCancel:!1,showCloseButton:!1,closeButtonAriaLabel:"Close this dialog",showLoaderOnConfirm:!1,imageUrl:null,imageWidth:null,imageHeight:null,imageAlt:"",imageClass:"",timer:null,width:null,padding:null,background:null,input:null,inputPlaceholder:"",inputValue:"",inputOptions:{},inputAutoTrim:!0,inputClass:"",inputAttributes:{},inputValidator:null,validationMessage:null,grow:!1,position:"center",progressSteps:[],currentProgressStep:null,progressStepsDistance:null,onBeforeOpen:null,onAfterClose:null,onOpen:null,onClose:null},ce=[],ue=["allowOutsideClick","allowEnterKey","backdrop","focusConfirm","focusCancel","heightAuto","keydownListenerCapture"],le=function(e){return se.hasOwnProperty(e)},de=function(e){return-1!==ce.indexOf(e)},pe=Object.freeze({isValidParameter:le,isUpdatableParameter:function(e){return-1!==["title","titleText","text","html","type","showConfirmButton","showCancelButton","confirmButtonText","confirmButtonAriaLabel","confirmButtonColor","confirmButtonClass","cancelButtonText","cancelButtonAriaLabel","cancelButtonColor","cancelButtonClass","buttonsStyling","reverseButtons","imageUrl","imageWidth","imageHeigth","imageAlt","imageClass","progressSteps","currentProgressStep"].indexOf(e)},isDeprecatedParameter:de,argsToParams:function(n){var o={};switch(V(n[0])){case"object":s(o,n[0]);break;default:["title","html","type"].forEach(function(e,t){switch(V(n[t])){case"string":o[e]=n[t];break;case"undefined":break;default:H("Unexpected type of ".concat(e,'! Expected "string", got ').concat(V(n[t])))}})}return o},isVisible:function(){return!!y()},clickConfirm:function(){return S().click()},clickCancel:function(){return P().click()},getContainer:v,getPopup:y,getTitle:C,getContent:k,getImage:B,getIcons:w,getCloseButton:Z,getActions:L,getConfirmButton:S,getCancelButton:P,getFooter:F,getFocusableElements:Q,getValidationMessage:A,isLoading:function(){return y().hasAttribute("data-loading")},fire:function(){for(var e=arguments.length,t=new Array(e),n=0;nwindow.innerHeight&&(m.previousBodyPadding=parseInt(window.getComputedStyle(document.body).getPropertyValue("padding-right")),document.body.style.paddingRight=m.previousBodyPadding+function(){if("ontouchstart"in window||navigator.msMaxTouchPoints)return 0;var e=document.createElement("div");e.style.width="50px",e.style.height="50px",e.style.overflow="scroll",document.body.appendChild(e);var t=e.offsetWidth-e.clientWidth;return document.body.removeChild(e),t}()+"px")},he=function(){return!!window.MSInputMethodContext&&!!document.documentMode},ve=function(){var e=v(),t=y();e.style.removeProperty("align-items"),t.offsetTop<0&&(e.style.alignItems="flex-start")},be={swalPromiseResolve:new WeakMap};function ye(e){var t=v(),n=y(),o=fe.innerParams.get(this),i=be.swalPromiseResolve.get(this),r=o.onClose,a=o.onAfterClose;if(n){null!==r&&"function"==typeof r&&r(n),U(n,I.show),D(n,I.hide);var s=function(){T()?we(a):(new Promise(function(e){var t=window.scrollX,n=window.scrollY;ae.restoreFocusTimeout=setTimeout(function(){ae.previousActiveElement&&ae.previousActiveElement.focus?(ae.previousActiveElement.focus(),ae.previousActiveElement=null):document.body&&document.body.focus(),e()},100),void 0!==t&&void 0!==n&&window.scrollTo(t,n)}).then(function(){return we(a)}),ae.keydownTarget.removeEventListener("keydown",ae.keydownHandler,{capture:ae.keydownListenerCapture}),ae.keydownHandlerAdded=!1),t.parentNode&&t.parentNode.removeChild(t),U([document.documentElement,document.body],[I.shown,I["height-auto"],I["no-backdrop"],I["toast-shown"],I["toast-column"]]),E()&&(null!==m.previousBodyPadding&&(document.body.style.paddingRight=m.previousBodyPadding,m.previousBodyPadding=null),function(){if(g(document.body,I.iosfix)){var e=parseInt(document.body.style.top,10);U(document.body,I.iosfix),document.body.style.top="",document.body.scrollTop=-1*e}}(),"undefined"!=typeof window&&he()&&window.removeEventListener("resize",ve),p(document.body.children).forEach(function(e){e.hasAttribute("data-previous-aria-hidden")?(e.setAttribute("aria-hidden",e.getAttribute("data-previous-aria-hidden")),e.removeAttribute("data-previous-aria-hidden")):e.removeAttribute("aria-hidden")}))};J&&!g(n,I.noanimation)?n.addEventListener(J,function e(){n.removeEventListener(J,e),g(n,I.hide)&&s()}):s(),i(e||{})}}var we=function(e){null!==e&&"function"==typeof e&&setTimeout(function(){e()})};var Ce=function e(t,n){a(this,e);var o,i,r=n;this.running=!1,this.start=function(){return this.running||(this.running=!0,i=new Date,o=setTimeout(t,r)),r},this.stop=function(){return this.running&&(this.running=!1,clearTimeout(o),r-=new Date-i),r},this.increase=function(e){var t=this.running;return t&&this.stop(),r+=e,t&&this.start(),r},this.getTimerLeft=function(){return this.running&&(this.stop(),this.start()),r},this.isRunning=function(){return this.running},this.start()},ke={email:function(e,t){return/^[a-zA-Z0-9.+_-]+@[a-zA-Z0-9.-]+\.[a-zA-Z0-9-]{2,24}$/.test(e)?Promise.resolve():Promise.resolve(t||"Invalid email address")},url:function(e,t){return/^https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{2,256}\.[a-z]{2,63}\b([-a-zA-Z0-9@:%_+.~#?&//=]*)$/.test(e)?Promise.resolve():Promise.resolve(t||"Invalid URL")}};var Be=function(e){var t=v(),n=y();null!==e.onBeforeOpen&&"function"==typeof e.onBeforeOpen&&e.onBeforeOpen(n),e.animation?(D(n,I.show),D(t,I.fade),U(n,I.hide)):U(n,I.fade),z(n),t.style.overflowY="hidden",J&&!g(n,I.noanimation)?n.addEventListener(J,function e(){n.removeEventListener(J,e),t.style.overflowY="auto"}):t.style.overflowY="auto",D([document.documentElement,document.body,t],I.shown),e.heightAuto&&e.backdrop&&!e.toast&&D([document.documentElement,document.body],I["height-auto"]),E()&&(ge(),function(){if(/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream&&!g(document.body,I.iosfix)){var e=document.body.scrollTop;document.body.style.top=-1*e+"px",D(document.body,I.iosfix)}}(),"undefined"!=typeof window&&he()&&(ve(),window.addEventListener("resize",ve)),p(document.body.children).forEach(function(e){e===v()||function(e,t){if("function"==typeof e.contains)return e.contains(t)}(e,v())||(e.hasAttribute("aria-hidden")&&e.setAttribute("data-previous-aria-hidden",e.getAttribute("aria-hidden")),e.setAttribute("aria-hidden","true"))}),setTimeout(function(){t.scrollTop=0})),T()||ae.previousActiveElement||(ae.previousActiveElement=document.activeElement),null!==e.onOpen&&"function"==typeof e.onOpen&&setTimeout(function(){e.onOpen(n)})};var xe,Ae=Object.freeze({hideLoading:me,disableLoading:me,getInput:function(e){var t=fe.innerParams.get(this),n=fe.domCache.get(this);if(!(e=e||t.input))return null;switch(e){case"select":case"textarea":case"file":return _(n.content,I[e]);case"checkbox":return n.popup.querySelector(".".concat(I.checkbox," input"));case"radio":return n.popup.querySelector(".".concat(I.radio," input:checked"))||n.popup.querySelector(".".concat(I.radio," input:first-child"));case"range":return n.popup.querySelector(".".concat(I.range," input"));default:return _(n.content,I.input)}},close:ye,closePopup:ye,closeModal:ye,closeToast:ye,enableButtons:function(){var e=fe.domCache.get(this);e.confirmButton.disabled=!1,e.cancelButton.disabled=!1},disableButtons:function(){var e=fe.domCache.get(this);e.confirmButton.disabled=!0,e.cancelButton.disabled=!0},enableConfirmButton:function(){fe.domCache.get(this).confirmButton.disabled=!1},disableConfirmButton:function(){fe.domCache.get(this).confirmButton.disabled=!0},enableInput:function(){var e=this.getInput();if(!e)return!1;if("radio"===e.type)for(var t=e.parentNode.parentNode.querySelectorAll("input"),n=0;n