!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.Sweetalert2=e()}(this,function(){"use strict";function V(t){return(V="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function a(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(t,e){for(var n=0;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
\n
\n \n \n
\n
\n
\n \n').replace(/(^|\n)\s*/g,""),J=function(t){var e=v();if(e&&(e.parentNode.removeChild(e),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 t.target?document.querySelector(t.target):t.target;o.appendChild(n);var i,r=w(),a=B(),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",t.toast?"alert":"dialog"),r.setAttribute("aria-live",t.toast?"polite":"assertive"),t.toast||r.setAttribute("aria-modal","true"),"rtl"===window.getComputedStyle(o).direction&&D(v(),I.rtl);var m=function(t){Et.isVisible()&&i!==t.target.value&&Et.resetValidationMessage(),i=t.target.value};return s.oninput=m,c.onchange=m,d.onchange=m,p.onchange=m,f.oninput=m,u.oninput=function(t){m(t),l.value=u.value},u.onchange=function(t){m(t),u.nextSibling.value=u.value},r}H("SweetAlert2 requires document to initialize")},X=function(t,e){if(!t)return W(e);if(t instanceof HTMLElement)e.appendChild(t);else if("object"===V(t))if(e.innerHTML="",0 in t)for(var n=0;n in t;n++)e.appendChild(t[n].cloneNode(!0));else e.appendChild(t.cloneNode(!0));else t&&(e.innerHTML=t);z(e)},G=function(){if(O())return!1;var t=document.createElement("div"),e={WebkitAnimation:"webkitAnimationEnd",OAnimation:"oAnimationEnd oanimationend",animation:"animationend"};for(var n in e)if(e.hasOwnProperty(n)&&void 0!==t.style[n])return e[n];return!1}(),tt=function(t){var e=F(),n=S(),o=L();if(t.showConfirmButton||t.showCancelButton?z(e):W(e),t.showCancelButton?o.style.display="inline-block":W(o),t.showConfirmButton?n.style.removeProperty("display"):W(n),n.innerHTML=t.confirmButtonText,o.innerHTML=t.cancelButtonText,n.setAttribute("aria-label",t.confirmButtonAriaLabel),o.setAttribute("aria-label",t.cancelButtonAriaLabel),n.className=I.confirm,D(n,t.confirmButtonClass),t.customClass&&D(n,t.customClass.confirmButton),o.className=I.cancel,D(o,t.cancelButtonClass),t.customClass&&D(o,t.customClass.cancelButton),t.buttonsStyling){D([n,o],I.styled),t.confirmButtonColor&&(n.style.backgroundColor=t.confirmButtonColor),t.cancelButtonColor&&(o.style.backgroundColor=t.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=""},et=function(t){var e=B().querySelector("#"+I.content);t.html?X(t.html,e):t.text?(e.textContent=t.text,z(e)):W(e)},nt=function(t){for(var e=C(),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(t,e){var n=document.createElement("li");if(D(n,I["progress-step"]),n.innerHTML=t,e===a&&D(n,I["active-progress-step"]),r.appendChild(n),e!==i.progressSteps.length-1){var o=document.createElement("li");D(o,I["progress-step-line"]),i.progressStepsDistance&&(o.style.width=i.progressStepsDistance),r.appendChild(o)}})):W(r)},rt=function(t){var e=k();t.titleText?e.innerText=t.titleText:t.title&&("string"==typeof t.title&&(t.title=t.title.split("\n").join("
")),X(t.title,e))};var at=[],st=function(){var t=w();t||Et.fire(""),t=w();var e=F(),n=S(),o=L();z(e),z(n),D([t,e],I.loading),n.disabled=!0,o.disabled=!0,t.setAttribute("data-loading",!0),t.setAttribute("aria-busy",!0),t.focus()},ct={},ut={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,scrollbarPadding:!0},lt={customContainerClass:"customClass",confirmButtonClass:"customClass",cancelButtonClass:"customClass",imageClass:"customClass",inputClass:"customClass"},dt=["allowOutsideClick","allowEnterKey","backdrop","focusConfirm","focusCancel","heightAuto","keydownListenerCapture"],pt=function(t){return ut.hasOwnProperty(t)},ft=function(t){return lt[t]},mt=Object.freeze({isValidParameter:pt,isUpdatableParameter:function(t){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(t)},isDeprecatedParameter:ft,argsToParams:function(n){var o={};switch(V(n[0])){case"object":s(o,n[0]);break;default:["title","html","type"].forEach(function(t,e){switch(V(n[e])){case"string":o[t]=n[e];break;case"undefined":break;default:H("Unexpected type of ".concat(t,'! Expected "string", got ').concat(V(n[e])))}})}return o},isVisible:function(){return K(w())},clickConfirm:function(){return S()&&S().click()},clickCancel:function(){return L()&&L().click()},getContainer:v,getPopup:w,getTitle:k,getContent:B,getImage:x,getIcon:function(){var t=C().filter(function(t){return K(t)});return t.length?t[0]:null},getIcons:C,getCloseButton:Y,getActions:F,getConfirmButton:S,getCancelButton:L,getHeader:Z,getFooter:Q,getFocusableElements:$,getValidationMessage:P,isLoading:function(){return w().hasAttribute("data-loading")},fire:function(){for(var t=arguments.length,e=new Array(t),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 t=document.createElement("div");t.style.width="50px",t.style.height="50px",t.style.overflow="scroll",document.body.appendChild(t);var e=t.offsetWidth-t.clientWidth;return document.body.removeChild(t),e}()+"px")},bt=function(){return!!window.MSInputMethodContext&&!!document.documentMode},yt=function(){var t=v(),e=w();t.style.removeProperty("align-items"),e.offsetTop<0&&(t.style.alignItems="flex-start")},wt={swalPromiseResolve:new WeakMap};function Ct(t){var e=v(),n=w(),o=gt.innerParams.get(this),i=wt.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()?kt(a):(new Promise(function(t){var e=window.scrollX,n=window.scrollY;ct.restoreFocusTimeout=setTimeout(function(){ct.previousActiveElement&&ct.previousActiveElement.focus?(ct.previousActiveElement.focus(),ct.previousActiveElement=null):document.body&&document.body.focus(),t()},100),void 0!==e&&void 0!==n&&window.scrollTo(e,n)}).then(function(){return kt(a)}),ct.keydownTarget.removeEventListener("keydown",ct.keydownHandler,{capture:ct.keydownListenerCapture}),ct.keydownHandlerAdded=!1),e.parentNode&&e.parentNode.removeChild(e),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+"px",m.previousBodyPadding=null),function(){if(g(document.body,I.iosfix)){var t=parseInt(document.body.style.top,10);U(document.body,I.iosfix),document.body.style.top="",document.body.scrollTop=-1*t}}(),"undefined"!=typeof window&&bt()&&window.removeEventListener("resize",yt),p(document.body.children).forEach(function(t){t.hasAttribute("data-previous-aria-hidden")?(t.setAttribute("aria-hidden",t.getAttribute("data-previous-aria-hidden")),t.removeAttribute("data-previous-aria-hidden")):t.removeAttribute("aria-hidden")}))};G&&!g(n,I.noanimation)?n.addEventListener(G,function t(){n.removeEventListener(G,t),g(n,I.hide)&&s()}):s(),i(t||{})}}var kt=function(t){null!==t&&"function"==typeof t&&setTimeout(function(){t()})};var Bt=function t(e,n){a(this,t);var o,i,r=n;this.running=!1,this.start=function(){return this.running||(this.running=!0,i=new Date,o=setTimeout(e,r)),r},this.stop=function(){return this.running&&(this.running=!1,clearTimeout(o),r-=new Date-i),r},this.increase=function(t){var e=this.running;return e&&this.stop(),r+=t,e&&this.start(),r},this.getTimerLeft=function(){return this.running&&(this.stop(),this.start()),r},this.isRunning=function(){return this.running},this.start()},xt={email:function(t,e){return/^[a-zA-Z0-9.+_-]+@[a-zA-Z0-9.-]+\.[a-zA-Z0-9-]{2,24}$/.test(t)?Promise.resolve():Promise.resolve(e||"Invalid email address")},url:function(t,e){return/^https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{2,256}\.[a-z]{2,63}\b([-a-zA-Z0-9@:%_+.~#?&//=]*)$/.test(t)?Promise.resolve():Promise.resolve(e||"Invalid URL")}};var At=function(t){var e=v(),n=w();null!==t.onBeforeOpen&&"function"==typeof t.onBeforeOpen&&t.onBeforeOpen(n),t.animation?(D(n,I.show),D(e,I.fade),U(n,I.hide)):U(n,I.fade),z(n),e.style.overflowY="hidden",G&&!g(n,I.noanimation)?n.addEventListener(G,function t(){n.removeEventListener(G,t),e.style.overflowY="auto"}):e.style.overflowY="auto",D([document.documentElement,document.body,e],I.shown),t.heightAuto&&t.backdrop&&!t.toast&&D([document.documentElement,document.body],I["height-auto"]),E()&&(t.scrollbarPadding&&vt(),function(){if(/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream&&!g(document.body,I.iosfix)){var t=document.body.scrollTop;document.body.style.top=-1*t+"px",D(document.body,I.iosfix)}}(),"undefined"!=typeof window&&bt()&&(yt(),window.addEventListener("resize",yt)),p(document.body.children).forEach(function(t){t===v()||function(t,e){if("function"==typeof t.contains)return t.contains(e)}(t,v())||(t.hasAttribute("aria-hidden")&&t.setAttribute("data-previous-aria-hidden",t.getAttribute("aria-hidden")),t.setAttribute("aria-hidden","true"))}),setTimeout(function(){e.scrollTop=0})),T()||ct.previousActiveElement||(ct.previousActiveElement=document.activeElement),null!==t.onOpen&&"function"==typeof t.onOpen&&setTimeout(function(){t.onOpen(n)})};var Pt,St=Object.freeze({hideLoading:ht,disableLoading:ht,getInput:function(t){var e=gt.innerParams.get(this),n=gt.domCache.get(this);if(!(t=t||e.input))return null;switch(t){case"select":case"textarea":case"file":return _(n.content,I[t]);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:Ct,closePopup:Ct,closeModal:Ct,closeToast:Ct,enableButtons:function(){var t=gt.domCache.get(this);t.confirmButton.disabled=!1,t.cancelButton.disabled=!1},disableButtons:function(){var t=gt.domCache.get(this);t.confirmButton.disabled=!0,t.cancelButton.disabled=!0},enableConfirmButton:function(){gt.domCache.get(this).confirmButton.disabled=!1},disableConfirmButton:function(){gt.domCache.get(this).confirmButton.disabled=!0},enableInput:function(){var t=this.getInput();if(!t)return!1;if("radio"===t.type)for(var e=t.parentNode.parentNode.querySelectorAll("input"),n=0;n