!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";var e={title:"",titleText:"",text:"",html:"",type:null,toast:!1,customClass:"",target:"body",backdrop:!0,animation:!0,allowOutsideClick:!0,allowEscapeKey:!0,allowEnterKey:!0,showConfirmButton:!0,showCancelButton:!1,preConfirm:null,confirmButtonText:"OK",confirmButtonAriaLabel:"",confirmButtonColor:"#3085d6",confirmButtonClass:null,cancelButtonText:"Cancel",cancelButtonAriaLabel:"",cancelButtonColor:"#aaa",cancelButtonClass:null,buttonsStyling:!0,reverseButtons:!1,focusConfirm:!0,focusCancel:!1,showCloseButton:!1,closeButtonAriaLabel:"Close this dialog",showLoaderOnConfirm:!1,imageUrl:null,imageWidth:null,imageHeight:null,imageAlt:"",imageClass:null,timer:null,width:500,padding:20,background:"#fff",input:null,inputPlaceholder:"",inputValue:"",inputOptions:{},inputAutoTrim:!0,inputClass:null,inputAttributes:{},inputValidator:null,grow:!1,position:"center",progressSteps:[],currentProgressStep:null,progressStepsDistance:"40px",onBeforeOpen:null,onOpen:null,onClose:null,useRejections:!1,expectRejections:!1},t=["useRejections","expectRejections"],n=function(e){var t={};for(var n in e)t[e[n]]="swal2-"+e[n];return t},o=n(["container","shown","iosfix","popup","modal","no-backdrop","toast","toast-shown","overlay","fade","show","hide","noanimation","close","title","content","contentwrapper","buttonswrapper","confirm","cancel","icon","image","input","has-input","file","range","select","radio","checkbox","textarea","inputerror","validationerror","progresssteps","activeprogressstep","progresscircle","progressline","loading","styled","top","top-left","top-right","center","center-left","center-right","bottom","bottom-left","bottom-right","grow-row","grow-column","grow-fullscreen"]),r=n(["success","warning","info","question","error"]),i=function(e,t){(e=String(e).replace(/[^0-9a-f]/gi,"")).length<6&&(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]),t=t||0;for(var n="#",o=0;o<3;o++){var r=parseInt(e.substr(2*o,2),16);n+=("00"+(r=Math.round(Math.min(Math.max(0,r+r*t),255)).toString(16))).substr(r.length)}return n},a=function(e){console.warn("SweetAlert2: "+e)},s=function(e){console.error("SweetAlert2: "+e)},l=[],u=function(e){-1===l.indexOf(e)&&(l.push(e),a(e))},c={previousActiveElement:null,previousBodyPadding:null},d=function(e){var t=f();t&&(t.parentNode.removeChild(t),T(document.body,o["no-backdrop"]),T(document.body,o["has-input"]),T(document.body,o["toast-shown"]));{if("undefined"!=typeof document){var n=document.createElement("div");n.className=o.container,n.innerHTML=p;("string"==typeof e.target?document.querySelector(e.target):e.target).appendChild(n);var r=m(),i=q(r,o.input),a=q(r,o.file),l=r.querySelector("."+o.range+" input"),u=r.querySelector("."+o.range+" output"),c=q(r,o.select),d=r.querySelector("."+o.checkbox+" input"),b=q(r,o.textarea);r.setAttribute("aria-live",e.toast?"polite":"assertive");var h=function(){Q.isVisible()&&Q.resetValidationError()};return i.oninput=h,a.onchange=h,c.onchange=h,d.onchange=h,b.oninput=h,l.oninput=function(){h(),u.value=l.value},l.onchange=function(){h(),l.previousSibling.value=l.value},r}s("SweetAlert2 requires document to initialize")}},p=('\n \n').replace(/(^|\n)\s*/g,""),f=function(){return document.body.querySelector("."+o.container)},m=function(){return f()?f().querySelector("."+o.popup):null},b=function(e){return f()?f().querySelector("."+e):null},h=function(){return b(o.title)},g=function(){return b(o.content)},v=function(){return b(o.image)},y=function(){return b(o.progresssteps)},w=function(){return b(o.validationerror)},C=function(){return b(o.confirm)},x=function(){return b(o.cancel)},k=function(){return b(o.buttonswrapper)},S=function(){return b(o.close)},A=function(){var e=Array.from(m().querySelectorAll('[tabindex]:not([tabindex="-1"]):not([tabindex="0"])')).sort(function(e,t){return e=parseInt(e.getAttribute("tabindex")),t=parseInt(t.getAttribute("tabindex")),e>t?1:e"),t.backdrop||L(document.body,o["no-backdrop"]),t.text||t.html){if("object"===M(t.html))if(B.innerHTML="",0 in t.html)for(var j=0;j in t.html;j++)B.appendChild(t.html[j].cloneNode(!0));else B.appendChild(t.html.cloneNode(!0));else t.html?B.innerHTML=t.html:t.text&&(B.textContent=t.text);O(B)}else V(B);if(t.position in o&&L(w,o[t.position]),t.grow&&"string"==typeof t.grow){var H="grow-"+t.grow;H in o&&L(w,o[H])}t.showCloseButton?(N.setAttribute("aria-label",t.closeButtonAriaLabel),O(N)):V(N),n.className=o.popup,t.toast?(L(document.body,o["toast-shown"]),L(n,o.toast)):L(n,o.modal),t.customClass&&L(n,t.customClass);var R=y(),I=parseInt(null===t.currentProgressStep?Q.getQueueStep():t.currentProgressStep,10);t.progressSteps.length?(O(R),function(e){for(;e.firstChild;)e.removeChild(e.firstChild)}(R),I>=t.progressSteps.length&&a("Invalid currentProgressStep parameter, it should be less than progressSteps.length (currentProgressStep like JS arrays starts from 0)"),t.progressSteps.forEach(function(e,n){var r=document.createElement("li");if(L(r,o.progresscircle),r.innerHTML=e,n===I&&L(r,o.activeprogressstep),R.appendChild(r),n!==t.progressSteps.length-1){var i=document.createElement("li");L(i,o.progressline),i.style.width=t.progressStepsDistance,R.appendChild(i)}})):V(R);for(var D=m().querySelectorAll("."+o.icon),U=0;Uwindow.innerHeight&&(c.previousBodyPadding=document.body.style.paddingRight,document.body.style.paddingRight=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")},Z=function(){if(/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream&&!P(document.body,o.iosfix)){var e=document.body.scrollTop;document.body.style.top=-1*e+"px",L(document.body,o.iosfix)}},Q=function e(){for(var t=arguments.length,n=Array(t),r=0;r