!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,customClass:"",target:"body",animation:!0,allowOutsideClick:!0,allowEscapeKey:!0,allowEnterKey:!0,showConfirmButton:!0,showCancelButton:!1,preConfirm:null,confirmButtonText:"OK",confirmButtonColor:"#3085d6",confirmButtonClass:null,cancelButtonText:"Cancel",cancelButtonColor:"#aaa",cancelButtonClass:null,buttonsStyling:!0,reverseButtons:!1,focusCancel:!1,showCloseButton:!1,showLoaderOnConfirm:!1,imageUrl:null,imageWidth:null,imageHeight:null,imageClass:null,timer:null,width:500,padding:20,background:"#fff",input:null,inputPlaceholder:"",inputValue:"",inputOptions:{},inputAutoTrim:!0,inputClass:null,inputAttributes:{},inputValidator:null,progressSteps:[],currentProgressStep:null,progressStepsDistance:"40px",onOpen:null,onClose:null},t="swal2-",n=function(e){var n={};for(var o in e)n[e[o]]=t+e[o];return n},o=n(["container","shown","iosfix","modal","overlay","fade","show","hide","noanimation","close","title","content","spacer","confirm","cancel","icon","image","input","file","range","select","radio","checkbox","textarea","inputerror","validationerror","progresssteps","activeprogressstep","progresscircle","progressline","loading","styled"]),r=n(["success","warning","info","question","error"]),i=function(e,t){e=String(e).replace(/[^0-9a-f]/gi,""),e.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);r=Math.round(Math.min(Math.max(0,r+r*t),255)).toString(16),n+=("00"+r).substr(r.length)}return n},a={previousWindowKeyDown:null,previousActiveElement:null,previousBodyPadding:null},l=function(e){if("undefined"==typeof document)return void console.error("SweetAlert2 requires document to initialize");var t=document.createElement("div");t.className=o.container,t.innerHTML=s;var n=document.querySelector(e.target);n||(console.warn("SweetAlert2: Can't find the target \""+e.target+'"'),n=document.body),n.appendChild(t);var r=c(),i=A(r,o.input),a=A(r,o.file),l=r.querySelector("."+o.range+" input"),u=r.querySelector("."+o.range+" output"),d=A(r,o.select),p=r.querySelector("."+o.checkbox+" input"),f=A(r,o.textarea);return i.oninput=function(){X.resetValidationError()},i.onkeydown=function(t){setTimeout(function(){13===t.keyCode&&e.allowEnterKey&&(t.stopPropagation(),X.clickConfirm())},0)},a.onchange=function(){X.resetValidationError()},l.oninput=function(){X.resetValidationError(),u.value=l.value},l.onchange=function(){X.resetValidationError(),l.previousSibling.value=l.value},d.onchange=function(){X.resetValidationError()},p.onchange=function(){X.resetValidationError()},f.oninput=function(){X.resetValidationError()},r},s=('\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').replace(/(^|\n)\s*/g,""),u=function(){return document.body.querySelector("."+o.container)},c=function(){return u()?u().querySelector("."+o.modal):null},d=function(){var e=c();return e.querySelectorAll("."+o.icon)},p=function(e){return u()?u().querySelector("."+e):null},f=function(){return p(o.title)},m=function(){return p(o.content)},v=function(){return p(o.image)},h=function(){return p(o.spacer)},y=function(){return p(o.progresssteps)},g=function(){return p(o.validationerror)},b=function(){return p(o.confirm)},w=function(){return p(o.cancel)},C=function(){return p(o.close)},k=function(e){var n=[b(),w()];return e&&n.reverse(),n.concat(Array.prototype.slice.call(c().querySelectorAll("button:not([class^="+t+"]), input:not([type=hidden]), textarea, select")))},x=function(e,t){return!!e.classList&&e.classList.contains(t)},S=function(e){if(e.focus(),"file"!==e.type){var t=e.value;e.value="",e.value=t}},E=function(e,t){if(e&&t){var n=t.split(/\s+/).filter(Boolean);n.forEach(function(t){e.classList.add(t)})}},B=function(e,t){if(e&&t){var n=t.split(/\s+/).filter(Boolean);n.forEach(function(t){e.classList.remove(t)})}},A=function(e,t){for(var n=0;n"),t.text||t.html){if("object"===j(t.html))if(s.innerHTML="",0 in t.html)for(var k=0;k in t.html;k++)s.appendChild(t.html[k].cloneNode(!0));else s.appendChild(t.html.cloneNode(!0));else t.html?s.innerHTML=t.html:t.text&&(s.textContent=t.text);P(s)}else T(s);t.showCloseButton?P(g):T(g),n.className=o.modal,t.customClass&&E(n,t.customClass);var x=y(),S=parseInt(null===t.currentProgressStep?X.getQueueStep():t.currentProgressStep,10);t.progressSteps.length?(P(x),L(x),S>=t.progressSteps.length&&console.warn("SweetAlert2: 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(E(r,o.progresscircle),r.innerHTML=e,n===S&&E(r,o.activeprogressstep),x.appendChild(r),n!==t.progressSteps.length-1){var i=document.createElement("li");E(i,o.progressline),i.style.width=t.progressStepsDistance,x.appendChild(i)}})):T(x);for(var A=d(),M=0;Mwindow.innerHeight&&(a.previousBodyPadding=document.body.style.paddingRight,document.body.style.paddingRight=I()+"px")},Y=function(){null!==a.previousBodyPadding&&(document.body.style.paddingRight=a.previousBodyPadding,a.previousBodyPadding=null)},Z=function(){var e=/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream;if(e&&!x(document.body,o.iosfix)){var t=document.body.scrollTop;document.body.style.top=t*-1+"px",E(document.body,o.iosfix)}},J=function(){if(x(document.body,o.iosfix)){var e=parseInt(document.body.style.top,10);B(document.body,o.iosfix),document.body.style.top="",document.body.scrollTop=e*-1}},X=function e(){for(var t=arguments.length,n=Array(t),r=0;r