!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t=t||self).Sweetalert2=e()}(this,(function(){"use strict";function t(e){return(t="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})(e)}function e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function n(t,e){for(var n=0;nt.clientHeight)}function at(t){var e=window.getComputedStyle(t),n=parseFloat(e.getPropertyValue("animation-duration")||"0"),o=parseFloat(e.getPropertyValue("transition-duration")||"0");return 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').replace(/(^|\n)\s*/g,""),vt=function(t,e){t.jquery?bt(e,t):R(e,t.toString())},bt=function(t,e){if(t.textContent="",0 in e)for(var n=0;n in e;n++)t.appendChild(e[n].cloneNode(!0));else t.appendChild(e.cloneNode(!0))},yt=function(){if(st())return!1;var t=document.createElement("div"),e={WebkitAnimation:"webkitAnimationEnd",OAnimation:"oAnimationEnd oanimationend",animation:"animationend"};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&void 0!==t.style[n])return e[n];return!1}();function wt(t,e,n){var o;it(t,n["show".concat((o=e).charAt(0).toUpperCase()+o.slice(1),"Button")],"inline-block"),R(t,n["".concat(e,"ButtonText")]),t.setAttribute("aria-label",n["".concat(e,"ButtonAriaLabel")]),t.className=K[e],D(t,n,"".concat(e,"Button")),pt(t,n["".concat(e,"ButtonClass")])}function Ct(t,e){t.placeholder&&!e.inputPlaceholder||(t.placeholder=e.inputPlaceholder)}var kt={promise:new WeakMap,innerParams:new WeakMap,domCache:new WeakMap},xt=["input","file","range","select","radio","checkbox","textarea"],Pt=function(t){var e=K[t]?K[t]:K.input;return mt(x(),e)},At={};function Bt(){return Z()&&Z().getAttribute("data-queue-step")}function St(t,e){var n,o,i,r;n=e,et(o=Q(),"width",n.width),et(o,"padding",n.padding),n.background&&(o.style.background=n.background),It(o,n),function(t,e){var n,o,i,r,a,c,s,u,l=Z();l&&(n=l,"string"==typeof(o=e.backdrop)?n.style.background=o:o||pt([document.documentElement,document.body],K["no-backdrop"]),!e.backdrop&&e.allowOutsideClick&&U('"allowOutsideClick" parameter requires `backdrop` parameter to be set to `true`'),i=l,(r=e.position)in K?pt(i,K[r]):(U('The "position" parameter is not valid, defaulting to "center"'),pt(i,K.center)),a=l,!(c=e.grow)||"string"!=typeof c||(s="grow-".concat(c))in K&&pt(a,K[s]),D(l,e,"container"),(u=document.body.getAttribute("data-swal2-queue-step"))&&(l.setAttribute("data-queue-step",u),document.body.removeAttribute("data-swal2-queue-step")))}(0,e),function(t,e){var n,o,i,r,a,c,s,u;D(T(),e,"header"),function(t,e){var n=A();if(!e.progressSteps||0===e.progressSteps.length)return ot(n),0;nt(n),n.textContent="";var o=parseInt(void 0===e.currentProgressStep?Bt():e.currentProgressStep);o>=e.progressSteps.length&&U("Invalid currentProgressStep parameter, it should be less than progressSteps.length (currentProgressStep like JS arrays starts from 0)"),e.progressSteps.forEach((function(t,i){var r,a,c,s,u,l=(r=t,a=document.createElement("li"),pt(a,K["progress-step"]),R(a,r),a);n.appendChild(l),i===o&&pt(l,K["active-progress-step"]),i!==e.progressSteps.length-1&&(s=e,u=document.createElement("li"),pt(u,K["progress-step-line"]),s.progressStepsDistance&&(u.style.width=s.progressStepsDistance),c=u,n.appendChild(c))}))}(0,e),n=t,o=e,(r=kt.innerParams.get(n))&&o.icon===r.icon&&C()?D(C(),o,"icon"):(Ot(),o.icon&&(-1!==Object.keys(Y).indexOf(o.icon)?(nt(i=b(".".concat(K.icon,".").concat(Y[o.icon]))),Lt(i,o),Tt(),D(i,o,"icon"),pt(i,o.showClass.icon)):_('Unknown icon! Expected "success", "error", "warning", "info" or "question", got "'.concat(o.icon,'"')))),function(t){var e=P();if(!t.imageUrl)return ot(e);nt(e,""),e.setAttribute("src",t.imageUrl),e.setAttribute("alt",t.imageAlt),et(e,"width",t.imageWidth),et(e,"height",t.imageHeight),e.className=K.image,D(e,t,"image")}(e),a=e,it(c=k(),a.title||a.titleText),a.title&<(a.title,c),a.titleText&&(c.innerText=a.titleText),D(c,a,"title"),s=e,R(u=q(),s.closeButtonHtml),D(u,s,"closeButton"),it(u,s.showCloseButton),u.setAttribute("aria-label",s.closeButtonAriaLabel)}(t,e),function(t,e){var n,o,i,r,a,c=x().querySelector("#".concat(K.content));e.html?(lt(e.html,c),nt(c,"block")):e.text?(c.textContent=e.text,nt(c,"block")):ot(c),n=t,o=e,i=x(),r=kt.innerParams.get(n),a=!r||o.input!==r.input,xt.forEach((function(t){var e=K[t],n=mt(i,e);(function(t,e){var n=X(x(),t);if(n)for(var o in function(t){for(var e=0;e\n \n
    \n
    \n '):"error"===e.icon?R(t,'\n \n \n \n \n '):R(t,jt({question:"?",warning:"!",info:"i"}[e.icon]))},jt=function(t){return'
    ').concat(t,"
    ")},qt=[],It=function(t,e){t.className="".concat(K.popup," ").concat(ht(t)?e.showClass.popup:""),e.toast?(pt([document.documentElement,document.body],K["toast-shown"]),pt(t,K.toast)):pt(t,K.modal),D(t,e,"popup"),"string"==typeof e.customClass&&pt(t,e.customClass),e.icon&&pt(t,K["icon-".concat(e.icon)])};function Vt(){var t=Q();t||ke.fire(),t=Q();var e=O(),n=S();nt(e),nt(n,"inline-block"),pt([t,e],K.loading),n.disabled=!0,t.setAttribute("data-loading",!0),t.setAttribute("aria-busy",!0),t.focus()}function Mt(){if(Nt.timeout)return function(){var t=j(),e=parseInt(window.getComputedStyle(t).width);t.style.removeProperty("transition"),t.style.width="100%";var n=parseInt(window.getComputedStyle(t).width),o=parseInt(e/n*100);t.style.removeProperty("transition"),t.style.width="".concat(o,"%")}(),Nt.timeout.stop()}function Rt(){if(Nt.timeout){var t=Nt.timeout.start();return ct(t),t}}function Ht(t){return Object.prototype.hasOwnProperty.call(Ut,t)}function Dt(t){return Ft[t]}var Nt={},Ut={title:"",titleText:"",text:"",html:"",footer:"",icon:void 0,iconHtml:void 0,toast:!1,animation:!0,showClass:{popup:"swal2-show",backdrop:"swal2-backdrop-show",icon:"swal2-icon-show"},hideClass:{popup:"swal2-hide",backdrop:"swal2-backdrop-hide",icon:"swal2-icon-hide"},customClass:void 0,target:"body",backdrop:!0,heightAuto:!0,allowOutsideClick:!0,allowEscapeKey:!0,allowEnterKey:!0,stopKeydownPropagation:!0,keydownListenerCapture:!1,showConfirmButton:!0,showCancelButton:!1,preConfirm:void 0,confirmButtonText:"OK",confirmButtonAriaLabel:"",confirmButtonColor:void 0,cancelButtonText:"Cancel",cancelButtonAriaLabel:"",cancelButtonColor:void 0,buttonsStyling:!0,reverseButtons:!1,focusConfirm:!0,focusCancel:!1,showCloseButton:!1,closeButtonHtml:"×",closeButtonAriaLabel:"Close this dialog",showLoaderOnConfirm:!1,imageUrl:void 0,imageWidth:void 0,imageHeight:void 0,imageAlt:"",timer:void 0,timerProgressBar:!1,width:void 0,padding:void 0,background:void 0,input:void 0,inputPlaceholder:"",inputValue:"",inputOptions:{},inputAutoTrim:!0,inputAttributes:{},inputValidator:void 0,validationMessage:void 0,grow:!1,position:"center",progressSteps:[],currentProgressStep:void 0,progressStepsDistance:void 0,onBeforeOpen:void 0,onOpen:void 0,onRender:void 0,onClose:void 0,onAfterClose:void 0,onDestroy:void 0,scrollbarPadding:!0},_t=["title","titleText","text","html","footer","icon","hideClass","customClass","allowOutsideClick","allowEscapeKey","showConfirmButton","showCancelButton","confirmButtonText","confirmButtonAriaLabel","confirmButtonColor","cancelButtonText","cancelButtonAriaLabel","cancelButtonColor","buttonsStyling","reverseButtons","showCloseButton","closeButtonHtml","closeButtonAriaLabel","imageUrl","imageWidth","imageHeight","imageAlt","progressSteps","currentProgressStep","onClose","onAfterClose","onDestroy"],Ft={animation:'showClass" and "hideClass'},zt=["allowOutsideClick","allowEnterKey","backdrop","focusConfirm","focusCancel","heightAuto","keydownListenerCapture"],Wt=Object.freeze({isValidParameter:Ht,isUpdatableParameter:function(t){return-1!==_t.indexOf(t)},isDeprecatedParameter:Dt,argsToParams:function(e){var n={};return"object"!==t(e[0])||g(e[0])?["title","html","icon"].forEach((function(o,i){var r=e[i];"string"==typeof r||g(r)?n[o]=r:void 0!==r&&_("Unexpected type of ".concat(o,'! Expected "string" or "Element", got ').concat(t(r)))})):i(n,e[0]),n},isVisible:function(){return ht(Q())},clickConfirm:Et,clickCancel:function(){return E()&&E().click()},getContainer:Z,getPopup:Q,getTitle:k,getContent:x,getHtmlContainer:function(){return y(K["html-container"])},getImage:P,getIcon:C,getIcons:w,getCloseButton:q,getActions:O,getConfirmButton:S,getCancelButton:E,getHeader:T,getFooter:L,getTimerProgressBar:j,getFocusableElements:I,getValidationMessage:B,isLoading:M,fire:function(){for(var t=arguments.length,e=new Array(t),n=0;nwindow.innerHeight-44&&(Z().style.paddingBottom="".concat(44,"px"))),"undefined"!=typeof window&&Yt()&&(Zt(),window.addEventListener("resize",Zt)),e&&"hidden"!==n&&null===J.previousBodyPadding&&document.body.scrollHeight>window.innerHeight&&(J.previousBodyPadding=parseInt(window.getComputedStyle(document.body).getPropertyValue("padding-right")),document.body.style.paddingRight="".concat(J.previousBodyPadding+function(){var t=document.createElement("div");t.className=K["scrollbar-measure"],document.body.appendChild(t);var e=t.getBoundingClientRect().width-t.clientWidth;return document.body.removeChild(t),e}(),"px")),setTimeout((function(){t.scrollTop=0}))},ue={select:function(t,e,n){function o(t,e,o){var i=document.createElement("option");i.value=o,R(i,e),n.inputValue.toString()===o.toString()&&(i.selected=!0),t.appendChild(i)}var i=mt(t,K.select);e.forEach((function(t){var e,n=t[0],r=t[1];Array.isArray(r)?((e=document.createElement("optgroup")).label=n,e.disabled=!1,i.appendChild(e),r.forEach((function(t){return o(e,t[1],t[0])}))):o(i,r,n)})),i.focus()},radio:function(t,e,n){var o=mt(t,K.radio);e.forEach((function(t){var e=t[0],i=t[1],r=document.createElement("input"),a=document.createElement("label");r.type="radio",r.name=K.radio,r.value=e,n.inputValue.toString()===e.toString()&&(r.checked=!0);var c=document.createElement("span");R(c,i),c.className=K.label,a.appendChild(r),a.appendChild(c),o.appendChild(a)}));var i=o.querySelectorAll("input");i.length&&i[0].focus()}},le=function e(n){var o=[];return"undefined"!=typeof Map&&n instanceof Map?n.forEach((function(n,i){var r=n;"object"===t(r)&&(r=e(r)),o.push([i,r])})):Object.keys(n).forEach((function(i){var r=n[i];"object"===t(r)&&(r=e(r)),o.push([i,r])})),o},de=function(t,e,n){e.showLoaderOnConfirm&&Vt(),e.preConfirm?(t.resetValidationMessage(),Promise.resolve().then((function(){return m(e.preConfirm(n,e.validationMessage))})).then((function(e){ht(B())||!1===e?t.hideLoading():re(t,void 0===e?n:e)}))):re(t,n)},pe=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Left","Right","Up","Down"],fe=["Escape","Esc"],me=function(t,e,n){if(!e.isComposing&&e.target&&t.getInput()&&e.target.outerHTML===t.getInput().outerHTML){if(-1!==["textarea","file"].indexOf(n.input))return;Et(),e.preventDefault()}},he=function(t){for(var e=t.target,n=I(),o=-1,i=0;i")),function(t){var e,n,o,i,r,a,c,s,u,l,d,p,f,m,h,g=!!(e=Z())&&(e.parentNode.removeChild(e),ft([document.documentElement,document.body],[K["no-backdrop"],K["toast-shown"],K["has-column"]]),!0);st()?_("SweetAlert2 requires document to initialize"):((n=document.createElement("div")).className=K.container,g&&pt(n,K["no-transition"]),R(n,gt),(o="string"==typeof(i=t.target)?document.querySelector(i):i).appendChild(n),r=t,(a=Q()).setAttribute("role",r.toast?"alert":"dialog"),a.setAttribute("aria-live",r.toast?"polite":"assertive"),r.toast||a.setAttribute("aria-modal","true"),c=o,"rtl"===window.getComputedStyle(c).direction&&pt(Z(),K.rtl),s=x(),u=mt(s,K.input),l=mt(s,K.file),d=s.querySelector(".".concat(K.range," input")),p=s.querySelector(".".concat(K.range," output")),f=mt(s,K.select),m=s.querySelector(".".concat(K.checkbox," input")),h=mt(s,K.textarea),u.oninput=ut,l.onchange=ut,f.onchange=ut,m.onchange=ut,h.oninput=ut,d.oninput=function(t){ut(t),p.value=d.value},d.onchange=function(t){ut(t),d.nextSibling.value=d.value})}(t)})(n),Object.freeze(n),Nt.timeout&&(Nt.timeout.stop(),delete Nt.timeout),clearTimeout(Nt.restoreFocusTimeout);var o=function(t){var e={popup:Q(),container:Z(),content:x(),actions:O(),confirmButton:S(),cancelButton:E(),closeButton:q(),validationMessage:B(),progressSteps:A()};return kt.domCache.set(t,e),e}(this);return St(this,n),kt.innerParams.set(this,n),function(e,n,o){return new Promise((function(i){var r=function(t){e.closePopup({dismiss:t})};Qt.swalPromiseResolve.set(e,i),n.confirmButton.onclick=function(){return function(t,e){t.disableButtons(),e.input?function(t,e){var n=function(t,e){var n=t.getInput();if(!n)return null;switch(e.input){case"checkbox":return function(t){return t.checked?1:0}(n);case"radio":return function(t){return t.checked?t.value:null}(n);case"file":return function(t){return t.files.length?null!==t.getAttribute("multiple")?t.files:t.files[0]:null}(n);default:return e.inputAutoTrim?n.value.trim():n.value}}(t,e);e.inputValidator?(t.disableInput(),Promise.resolve().then((function(){return m(e.inputValidator(n,e.validationMessage))})).then((function(o){t.enableButtons(),t.enableInput(),o?t.showValidationMessage(o):de(t,e,n)}))):t.getInput().checkValidity()?de(t,e,n):(t.enableButtons(),t.showValidationMessage(e.validationMessage))}(t,e):de(t,e,!0)}(e,o)},n.cancelButton.onclick=function(){return function(t,e){t.disableButtons(),e(W.cancel)}(e,r)},n.closeButton.onclick=function(){return r(W.close)},function(t,e,n){kt.innerParams.get(t).toast?function(t,e,n){e.popup.onclick=function(){var e=kt.innerParams.get(t);e.showConfirmButton||e.showCancelButton||e.showCloseButton||e.input||n(W.close)}}(t,e,n):(function(t){t.popup.onmousedown=function(){t.container.onmouseup=function(e){t.container.onmouseup=void 0,e.target===t.container&&(be=!0)}}}(e),function(t){t.container.onmousedown=function(){t.popup.onmouseup=function(e){t.popup.onmouseup=void 0,e.target!==t.popup&&!t.popup.contains(e.target)||(be=!0)}}}(e),function(t,e,n){e.container.onclick=function(o){var i=kt.innerParams.get(t);be?be=!1:o.target===e.container&&z(i.allowOutsideClick)&&n(W.backdrop)}}(t,e,n))}(e,n,r),function(t,e,n,o){e.keydownTarget&&e.keydownHandlerAdded&&(e.keydownTarget.removeEventListener("keydown",e.keydownHandler,{capture:e.keydownListenerCapture}),e.keydownHandlerAdded=!1),n.toast||(e.keydownHandler=function(e){return function(t,e,n){var o=kt.innerParams.get(t);o.stopKeydownPropagation&&e.stopPropagation(),"Enter"===e.key?me(t,e,o):"Tab"===e.key?he(e,o):-1!==pe.indexOf(e.key)?ge():-1!==fe.indexOf(e.key)&&ve(e,o,n)}(t,e,o)},e.keydownTarget=n.keydownListenerCapture?window:Q(),e.keydownListenerCapture=n.keydownListenerCapture,e.keydownTarget.addEventListener("keydown",e.keydownHandler,{capture:e.keydownListenerCapture}),e.keydownHandlerAdded=!0)}(e,Nt,o,r),o.toast&&(o.input||o.footer||o.showCloseButton)?pt(document.body,K["toast-column"]):ft(document.body,K["toast-column"]),function(e,n){"select"===n.input||"radio"===n.input?function(e,n){function o(t){return ue[n.input](i,le(t),n)}var i=x();f(n.inputOptions)||h(n.inputOptions)?(Vt(),m(n.inputOptions).then((function(t){e.hideLoading(),o(t)}))):"object"===t(n.inputOptions)?o(n.inputOptions):_("Unexpected type of inputOptions! Expected object, Map or Promise, got ".concat(t(n.inputOptions)))}(e,n):-1!==["text","email","number","tel","textarea"].indexOf(n.input)&&(f(n.inputValue)||h(n.inputValue))&&function(t,e){var n=t.getInput();ot(n),m(e.inputValue).then((function(o){n.value="number"===e.input?parseFloat(o)||0:"".concat(o),nt(n),n.focus(),t.hideLoading()})).catch((function(e){_("Error in inputValue promise: ".concat(e)),n.value="",nt(n),n.focus(),t.hideLoading()}))}(e,n)}(e,o),function(t){var e=Z(),n=Q();"function"==typeof t.onBeforeOpen&&t.onBeforeOpen(n);var o=window.getComputedStyle(document.body).overflowY;(function(t,e,n){pt(t,n.showClass.backdrop),nt(e),pt(e,n.showClass.popup),pt([document.documentElement,document.body],K.shown),n.heightAuto&&n.backdrop&&!n.toast&&pt([document.documentElement,document.body],K["height-auto"])})(e,n,t),function(t,e){yt&&at(e)?(t.style.overflowY="hidden",e.addEventListener(yt,ie)):t.style.overflowY="auto"}(e,n),V()&&(se(e,t.scrollbarPadding,o),d(document.body.children).forEach((function(t){t===Z()||function(t,e){if("function"==typeof t.contains)return t.contains(e)}(t,Z())||(t.hasAttribute("aria-hidden")&&t.setAttribute("data-previous-aria-hidden",t.getAttribute("aria-hidden")),t.setAttribute("aria-hidden","true"))}))),$()||Nt.previousActiveElement||(Nt.previousActiveElement=document.activeElement),"function"==typeof t.onOpen&&setTimeout((function(){return t.onOpen(n)})),ft(e,K["no-transition"])}(o),function(t,e,n){var o=j();ot(o),e.timer&&(t.timeout=new ne((function(){n("timer"),delete t.timeout}),e.timer),e.timerProgressBar&&(nt(o),setTimeout((function(){t.timeout.running&&ct(e.timer)}))))}(Nt,o,r),function(t,e){e.toast||(z(e.allowEnterKey)?e.focusCancel&&ht(t.cancelButton)?t.cancelButton.focus():e.focusConfirm&&ht(t.confirmButton)?t.confirmButton.focus():ae(0,-1,1):document.activeElement&&"function"==typeof document.activeElement.blur&&document.activeElement.blur())}(n,o),setTimeout((function(){n.container.scrollTop=0}))}))}(this,o,n)},update:function(t){var e=Q(),n=kt.innerParams.get(this);if(!e||H(e,n.hideClass.popup))return U("You're trying to update the closed or closing popup, that won't work. Use the update() method in preConfirm parameter or show a new popup.");var o={};Object.keys(t).forEach((function(e){ke.isUpdatableParameter(e)?o[e]=t[e]:U('Invalid parameter to update: "'.concat(e,'". Updatable params are listed here: https://github.com/sweetalert2/sweetalert2/blob/master/src/utils/params.js'))}));var r=i({},n,o);St(this,r),kt.innerParams.set(this,r),Object.defineProperties(this,{params:{value:i({},this.params,t),writable:!1,enumerable:!0}})},_destroy:function(){var t=kt.domCache.get(this),e=kt.innerParams.get(this);e&&(t.popup&&Nt.swalCloseEventFinishedCallback&&(Nt.swalCloseEventFinishedCallback(),delete Nt.swalCloseEventFinishedCallback),Nt.deferDisposalTimer&&(clearTimeout(Nt.deferDisposalTimer),delete Nt.deferDisposalTimer),"function"==typeof e.onDestroy&&e.onDestroy(),delete this.params,delete Nt.keydownHandler,delete Nt.keydownTarget,ye(kt),ye(Qt))}}),Ce=function(){function t(){if(e(this,t),"undefined"!=typeof window){"undefined"==typeof Promise&&_("This package requires a Promise library, please include a shim to enable it in this browser (See: https://github.com/sweetalert2/sweetalert2/wiki/Migration-from-SweetAlert-to-SweetAlert2#1-ie-support)"),ce=this;for(var n=arguments.length,o=new Array(n),i=0;i