/*! alertifyjs - v1.11.4 - Mohammad Younes (http://alertifyjs.com) */ !function(a){"use strict";function b(a,b){a.className+=" "+b}function c(a,b){for(var c=a.className.split(" "),d=b.split(" "),e=0;e-1&&c.splice(f,1)}a.className=c.join(" ")}function d(){return"rtl"===a.getComputedStyle(document.body).direction}function e(){return document.documentElement&&document.documentElement.scrollTop||document.body.scrollTop}function f(){return document.documentElement&&document.documentElement.scrollLeft||document.body.scrollLeft}function g(a){for(;a.lastChild;)a.removeChild(a.lastChild)}function h(a){if(null===a)return a;var b;if(Array.isArray(a)){b=[];for(var c=0;c0){for(var c=[],d=0;d=0?(c(document.body,Da.noOverflow),w(!1)):a>0&&document.body.className.indexOf(Da.noOverflow)<0&&(w(!0),b(document.body,Da.noOverflow))}function w(d){v.defaults.preventBodyShift&&(d&&document.documentElement.scrollHeight>document.documentElement.clientHeight?(Fa=xa,Ea=a.getComputedStyle(document.body).top,b(document.body,Da.fixed),document.body.style.top=-xa+"px"):d||(xa=Fa,document.body.style.top=Ea,c(document.body,Da.fixed),t()))}function x(a,d,e){"string"==typeof e&&c(a.elements.root,Da.prefix+e),b(a.elements.root,Da.prefix+d),za=a.elements.root.offsetWidth}function y(a){a.get("modal")?(c(a.elements.root,Da.modeless),a.isOpen()&&(pa(a),N(a),u())):(b(a.elements.root,Da.modeless),a.isOpen()&&(oa(a),N(a),u()))}function z(a){a.get("basic")?b(a.elements.root,Da.basic):c(a.elements.root,Da.basic)}function A(a){a.get("frameless")?b(a.elements.root,Da.frameless):c(a.elements.root,Da.frameless)}function B(a,b){for(var c=p.indexOf(b),d=c+1;d200&&(Ha=a.timeStamp)&&!Ga){var c=a.srcElement||a.target;return!0===b.get("closableByDimmer")&&c===b.elements.modal&&E(b),Ga=!1,!1}}function S(a,b){if(Date.now()-Ia>200&&(Ia=Date.now()))for(var c=0;c-1?(S(b,function(a){return a.key===c}),!1):void 0}function V(a){var b=p[p.length-1],c=a.keyCode;if(c===n.LEFT||c===n.RIGHT){for(var d=b.__internal.buttons,e=0;en.F1-1&&ya.indexOf(c)>-1)return a.preventDefault(),a.stopPropagation(),S(b,function(a){return a.key===c}),!1}function W(a,b){if(b)b.focus();else{var c=a.__internal.focus,d=c.element;switch(typeof c.element){case"number":a.__internal.buttons.length>c.element&&(d=!0===a.get("basic")?a.elements.reset[0]:a.__internal.buttons[c.element].element);break;case"string":d=a.elements.body.querySelector(c.element);break;case"function":d=c.element.call(a)}void 0!==d&&null!==d||0!==a.__internal.buttons.length||(d=a.elements.reset[0]),d&&d.focus&&(d.focus(),c.select&&d.select&&d.select())}}function X(a,b){if(!b)for(var c=p.length-1;c>-1;c-=1)if(p[c].isModal()){b=p[c];break}if(b&&b.isModal()){var d,e=a.srcElement||a.target,f=e===b.elements.reset[1]||0===b.__internal.buttons.length&&e===document.body;f&&(b.get("maximizable")?d=b.elements.commands.maximize:b.get("closable")&&(d=b.elements.commands.close)),void 0===d&&("number"==typeof b.__internal.focus.element?e===b.elements.reset[0]?d=b.elements.buttons.auxiliary.firstChild||b.elements.buttons.primary.firstChild:f&&(d=b.elements.reset[0]):e===b.elements.reset[0]&&(d=b.elements.buttons.primary.lastChild||b.elements.buttons.auxiliary.lastChild)),W(b,d)}}function Y(a,b){clearTimeout(b.__internal.timerIn),W(b),t(),Ja=!1,l("onfocus",b),r(b.elements.dialog,s.type,b.__internal.transitionInHandler),c(b.elements.root,Da.animationIn)}function Z(a,b){clearTimeout(b.__internal.timerOut),r(b.elements.dialog,s.type,b.__internal.transitionOutHandler),da(b),ja(b),b.isMaximized()&&!b.get("startMaximized")&&J(b),v.defaults.maintainFocus&&b.__internal.activeElement&&(b.__internal.activeElement.focus(),b.__internal.activeElement=null),"function"==typeof b.__internal.destroy&&b.__internal.destroy.apply(b)}function $(a,b){var c=a[Na]-La,d=a[Oa]-Ma;Qa&&(d-=document.body.scrollTop),b.style.left=c+"px",b.style.top=d+"px"}function _(a,b){var c=a[Na]-La,d=a[Oa]-Ma;Qa&&(d-=document.body.scrollTop),b.style.left=Math.min(Pa.maxLeft,Math.max(Pa.minLeft,c))+"px",b.style.top=Qa?Math.min(Pa.maxTop,Math.max(Pa.minTop,d))+"px":Math.max(Pa.minTop,d)+"px"}function aa(a,c){if(null===Sa&&!c.isMaximized()&&c.get("movable")){var d,e=0,f=0;if("touchstart"===a.type?(a.preventDefault(),d=a.targetTouches[0],Na="clientX",Oa="clientY"):0===a.button&&(d=a),d){var g=c.elements.dialog;if(b(g,Da.capture),g.style.left&&(e=parseInt(g.style.left,10)),g.style.top&&(f=parseInt(g.style.top,10)),La=d[Na]-e,Ma=d[Oa]-f,c.isModal()?Ma+=c.elements.modal.scrollTop:c.isPinned()&&(Ma-=document.body.scrollTop),c.get("moveBounded")){var h=g,i=-e,j=-f;do{i+=h.offsetLeft,j+=h.offsetTop}while(h=h.offsetParent);Pa={maxLeft:i,minLeft:-i,maxTop:document.documentElement.clientHeight-g.clientHeight-j,minTop:-j},Ra=_}else Pa=null,Ra=$;return l("onmove",c),Qa=!c.isModal()&&c.isPinned(),Ka=c,Ra(d,g),b(document.body,Da.noSelection),!1}}}function ba(a){if(Ka){var b;"touchmove"===a.type?(a.preventDefault(),b=a.targetTouches[0]):0===a.button&&(b=a),b&&Ra(b,Ka.elements.dialog)}}function ca(){if(Ka){var a=Ka;Ka=Pa=null,c(document.body,Da.noSelection),c(a.elements.dialog,Da.capture),l("onmoved",a)}}function da(a){Ka=null;var b=a.elements.dialog;b.style.left=b.style.top=""}function ea(a){a.get("movable")?(b(a.elements.root,Da.movable),a.isOpen()&&qa(a)):(da(a),c(a.elements.root,Da.movable),a.isOpen()&&ra(a))}function fa(a,b,c){var e=b,f=0,g=0;do{f+=e.offsetLeft,g+=e.offsetTop}while(e=e.offsetParent);var h,i;!0===c?(h=a.pageX,i=a.pageY):(h=a.clientX,i=a.clientY);var j=d();if(j&&(h=document.body.offsetWidth-h,isNaN(Ta)||(f=document.body.offsetWidth-f-b.offsetWidth)),b.style.height=i-g+Wa+"px",b.style.width=h-f+Wa+"px",!isNaN(Ta)){var k=.5*Math.abs(b.offsetWidth-Ua);j&&(k*=-1),b.offsetWidth>Ua?b.style.left=Ta+k+"px":b.offsetWidth>=Va&&(b.style.left=Ta-k+"px")}}function ga(a,c){if(!c.isMaximized()){var d;if("touchstart"===a.type?(a.preventDefault(),d=a.targetTouches[0]):0===a.button&&(d=a),d){l("onresize",c),Sa=c,Wa=c.elements.resizeHandle.offsetHeight/2;var e=c.elements.dialog;return b(e,Da.capture),Ta=parseInt(e.style.left,10),e.style.height=e.offsetHeight+"px",e.style.minHeight=c.elements.header.offsetHeight+c.elements.footer.offsetHeight+"px",e.style.width=(Ua=e.offsetWidth)+"px","none"!==e.style.maxWidth&&(e.style.minWidth=(Va=e.offsetWidth)+"px"),e.style.maxWidth="none",b(document.body,Da.noSelection),!1}}}function ha(a){if(Sa){var b;"touchmove"===a.type?(a.preventDefault(),b=a.targetTouches[0]):0===a.button&&(b=a),b&&fa(b,Sa.elements.dialog,!Sa.get("modal")&&!Sa.get("pinned"))}}function ia(){if(Sa){var a=Sa;Sa=null,c(document.body,Da.noSelection),c(a.elements.dialog,Da.capture),Ga=!0,l("onresized",a)}}function ja(a){Sa=null;var b=a.elements.dialog;"none"===b.style.maxWidth&&(b.style.maxWidth=b.style.minWidth=b.style.width=b.style.height=b.style.minHeight=b.style.left="",Ta=Number.Nan,Ua=Va=Wa=0)}function ka(a){a.get("resizable")?(b(a.elements.root,Da.resizable),a.isOpen()&&sa(a)):(ja(a),c(a.elements.root,Da.resizable),a.isOpen()&&ta(a))}function la(){for(var a=0;a-1&&a.navigator.userAgent.indexOf("Chrome")<0,Ca={dimmer:'
',modal:'
',dialog:'
',reset:'',commands:'
',header:'
',body:'
',content:'
',footer:'',buttons:{primary:'
',auxiliary:'
'},button:'',resizeHandle:'
'},Da={animationIn:"ajs-in",animationOut:"ajs-out",base:"alertify",basic:"ajs-basic",capture:"ajs-capture",closable:"ajs-closable",fixed:"ajs-fixed",frameless:"ajs-frameless",hidden:"ajs-hidden",maximize:"ajs-maximize",maximized:"ajs-maximized",maximizable:"ajs-maximizable",modeless:"ajs-modeless",movable:"ajs-movable",noSelection:"ajs-no-selection",noOverflow:"ajs-no-overflow",noPadding:"ajs-no-padding",pin:"ajs-pin",pinnable:"ajs-pinnable",prefix:"ajs-",resizable:"ajs-resizable",restore:"ajs-restore",shake:"ajs-shake",unpinned:"ajs-unpinned"},Ea="",Fa=0,Ga=!1,Ha=0,Ia=0,Ja=!1,Ka=null,La=0,Ma=0,Na="pageX",Oa="pageY",Pa=null,Qa=!1,Ra=null,Sa=null,Ta=Number.Nan,Ua=0,Va=0,Wa=0;return{__init:m,isOpen:function(){return this.__internal.isOpen},isModal:function(){return this.elements.root.className.indexOf(Da.modeless)<0},isMaximized:function(){return this.elements.root.className.indexOf(Da.maximized)>-1},isPinned:function(){return this.elements.root.className.indexOf(Da.unpinned)<0},maximize:function(){return this.isMaximized()||I(this),this},restore:function(){return this.isMaximized()&&J(this),this},pin:function(){return this.isPinned()||G(this),this},unpin:function(){return this.isPinned()&&H(this),this},bringToFront:function(){return B(null,this),this},moveTo:function(a,b){if(!isNaN(a)&&!isNaN(b)){l("onmove",this);var c=this.elements.dialog,e=c,f=0,g=0;c.style.left&&(f-=parseInt(c.style.left,10)),c.style.top&&(g-=parseInt(c.style.top,10));do{f+=e.offsetLeft,g+=e.offsetTop}while(e=e.offsetParent);var h=a-f,i=b-g;d()&&(h*=-1),c.style.left=h+"px",c.style.top=i+"px",l("onmoved",this)}return this},resizeTo:function(a,b){var c=parseFloat(a),d=parseFloat(b),e=/(\d*\.\d+|\d+)%/;if(!isNaN(c)&&!isNaN(d)&&!0===this.get("resizable")){l("onresize",this),(""+a).match(e)&&(c=c/100*document.documentElement.clientWidth),(""+b).match(e)&&(d=d/100*document.documentElement.clientHeight);var f=this.elements.dialog;"none"!==f.style.maxWidth&&(f.style.minWidth=(Va=f.offsetWidth)+"px"),f.style.maxWidth="none",f.style.minHeight=this.elements.header.offsetHeight+this.elements.footer.offsetHeight+"px",f.style.width=c+"px",f.style.height=d+"px",l("onresized",this)}return this},setting:function(a,b){var c=this,d=D(this,this.__internal.options,function(a,b,d){C(c,a,b,d)},a,b);if("get"===d.op)return d.found?d.value:void 0!==this.settings?D(this,this.settings,this.settingUpdated||function(){},a,b).value:void 0;if("set"===d.op){if(d.items.length>0)for(var e=this.settingUpdated||function(){},f=0;f0){var b=this;this.__internal.timer=setTimeout(function(){b.dismiss()},1e3*this.__internal.delay)}return this},setContent:function(c){if("string"==typeof c?(g(this.element),this.element.innerHTML=c):c instanceof a.HTMLElement&&this.element.firstChild!==c&&(g(this.element),this.element.appendChild(c)),this.__internal.closeButton){var d=document.createElement("span");b(d,n.close),d.setAttribute("data-close",!0),this.element.appendChild(d)}return this},dismissOthers:function(){return u.dismissAll(this),this}})}var k,l,m=[],n={base:"alertify-notifier",message:"ajs-message",top:"ajs-top",right:"ajs-right",bottom:"ajs-bottom",left:"ajs-left",center:"ajs-center",visible:"ajs-visible",hidden:"ajs-hidden",close:"ajs-close"};return{setting:function(a,b){if(d(this),void 0===b)return this.__internal[a];switch(a){case"position":this.__internal.position=b,h(this);break;case"delay":this.__internal.delay=b}return this},set:function(a,b){return this.setting(a,b),this},get:function(a){return this.setting(a)},create:function(a,b){d(this);var c=document.createElement("div");return c.className=n.message+("string"==typeof a&&""!==a?" ajs-"+a:""),i(c,b)},dismissAll:function(a){for(var b=m.slice(0),c=0;c