diff --git a/src/Laravel/Resources/config.php b/src/Laravel/Resources/config.php index a3e05a48..91ea00b0 100644 --- a/src/Laravel/Resources/config.php +++ b/src/Laravel/Resources/config.php @@ -50,7 +50,7 @@ return array( | field of this option. */ 'root_script' => array( - 'cdn' => 'https://cdn.jsdelivr.net/npm/@flasher/flasher@1.3.1/dist/flasher.min.js', + 'cdn' => 'https://cdn.jsdelivr.net/npm/@flasher/flasher@1.3.2/dist/flasher.min.js', 'local' => '/vendor/flasher/flasher.min.js', ), @@ -70,7 +70,7 @@ return array( | the stylesheet file in the 'local' field of this option. */ 'styles' => array( - 'cdn' => 'https://cdn.jsdelivr.net/npm/@flasher/flasher@1.3.1/dist/flasher.min.css', + 'cdn' => 'https://cdn.jsdelivr.net/npm/@flasher/flasher@1.3.2/dist/flasher.min.css', 'local' => '/vendor/flasher/flasher.min.css', ), diff --git a/src/Noty/Laravel/Resources/config.php b/src/Noty/Laravel/Resources/config.php index 469c87a4..cee47277 100644 --- a/src/Noty/Laravel/Resources/config.php +++ b/src/Noty/Laravel/Resources/config.php @@ -8,7 +8,7 @@ return array( 'scripts' => array( 'cdn' => array( - 'https://cdn.jsdelivr.net/npm/@flasher/flasher-noty@1.3.1/dist/flasher-noty.min.js', + 'https://cdn.jsdelivr.net/npm/@flasher/flasher-noty@1.3.2/dist/flasher-noty.min.js', ), 'local' => array( '/vendor/flasher/flasher-noty.min.js', @@ -16,7 +16,7 @@ return array( ), 'styles' => array( 'cdn' => array( - 'https://cdn.jsdelivr.net/npm/@flasher/flasher-noty@1.3.1/dist/flasher-noty.min.css', + 'https://cdn.jsdelivr.net/npm/@flasher/flasher-noty@1.3.2/dist/flasher-noty.min.css', ), 'local' => array( '/vendor/flasher/flasher-noty.min.css', diff --git a/src/Noty/Prime/NotyPlugin.php b/src/Noty/Prime/NotyPlugin.php index 1948e95d..0bcbb3f1 100644 --- a/src/Noty/Prime/NotyPlugin.php +++ b/src/Noty/Prime/NotyPlugin.php @@ -18,7 +18,7 @@ class NotyPlugin extends Plugin { return array( 'cdn' => array( - 'https://cdn.jsdelivr.net/npm/@flasher/flasher-noty@1.3.1/dist/flasher-noty.min.js', + 'https://cdn.jsdelivr.net/npm/@flasher/flasher-noty@1.3.2/dist/flasher-noty.min.js', ), 'local' => array( '/vendor/flasher/flasher-noty.min.js', @@ -33,7 +33,7 @@ class NotyPlugin extends Plugin { return array( 'cdn' => array( - 'https://cdn.jsdelivr.net/npm/@flasher/flasher-noty@1.3.1/dist/flasher-noty.min.css', + 'https://cdn.jsdelivr.net/npm/@flasher/flasher-noty@1.3.2/dist/flasher-noty.min.css', ), 'local' => array( '/vendor/flasher/flasher-noty.min.css', diff --git a/src/Noty/Prime/Resources/assets/flasher-noty.min.js b/src/Noty/Prime/Resources/assets/flasher-noty.min.js index 94f8fbd5..8f3238d4 100644 --- a/src/Noty/Prime/Resources/assets/flasher-noty.min.js +++ b/src/Noty/Prime/Resources/assets/flasher-noty.min.js @@ -1 +1 @@ -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("@flasher/flasher")):"function"==typeof define&&define.amd?define(["@flasher/flasher"],e):((t="undefined"!=typeof globalThis?globalThis:t||self).flasher=t.flasher||{},t.flasher.noty=e(t.flasher))}(this,(function(t){"use strict";var e=function(){return e=Object.assign||function(t){for(var e,o=1,n=arguments.length;o0&&void 0!==arguments[0]?arguments[0]:"",e="noty_"+t+"_";return e+="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){var e=16*Math.random()|0;return("x"===t?e:3&e|8).toString(16)}))},e.outerHeight=function(t){var e=t.offsetHeight,o=window.getComputedStyle(t);return e+=parseInt(o.marginTop)+parseInt(o.marginBottom)},e.addListener=r,e.hasClass=s,e.addClass=function(t,e){var o=u(t),n=o+e;s(o,e)||(t.className=n.substring(1))},e.removeClass=function(t,e){var o=u(t),n=void 0;s(t,e)&&(n=o.replace(" "+e+" "," "),t.className=n.substring(1,n.length-1))},e.remove=a,e.classList=u,e.visibilityChangeFlow=function(){var t=void 0,e=void 0;function o(){i.PageHidden?setTimeout((function(){Object.keys(i.Store).forEach((function(t){i.Store.hasOwnProperty(t)&&i.Store[t].options.visibilityControl&&i.Store[t].stop()}))}),100):setTimeout((function(){Object.keys(i.Store).forEach((function(t){i.Store.hasOwnProperty(t)&&i.Store[t].options.visibilityControl&&i.Store[t].resume()})),i.queueRenderAll()}),100)}void 0!==document.hidden?(t="hidden",e="visibilitychange"):void 0!==document.msHidden?(t="msHidden",e="msvisibilitychange"):void 0!==document.webkitHidden&&(t="webkitHidden",e="webkitvisibilitychange"),e&&r(document,e,(function(){i.PageHidden=document[t],o()})),r(window,"blur",(function(){i.PageHidden=!0,o()})),r(window,"focus",(function(){i.PageHidden=!1,o()}))},e.createAudioElements=function(t){if(t.hasSound){var e=document.createElement("audio");t.options.sounds.sources.forEach((function(t){var o=document.createElement("source");o.src=t,o.type="audio/"+t.match(/\.([^.]+)$/)[1],e.appendChild(o)})),t.barDom?t.barDom.appendChild(e):document.querySelector("body").appendChild(e),e.volume=t.options.sounds.volume,t.soundPlayed||(e.play(),t.soundPlayed=!0),e.onended=function(){a(e)}}};var i=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e.default=t,e}(o(1));function r(t,e,o){var n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];e=e.split(" ");for(var i=0;i=0}function a(t){t.parentNode&&t.parentNode.removeChild(t)}function u(t){return(" "+(t&&t.className||"")+" ").replace(/\s+/gi," ")}e.animationEndEvents="webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend",e.deepExtend=function t(e){e=e||{};for(var o=1;o0&&void 0!==arguments[0]?arguments[0]:"global",e=0,o=a;return u.hasOwnProperty(t)&&(o=u[t].maxVisible,Object.keys(l).forEach((function(o){l[o].options.queue!==t||l[o].closed||e++}))),{current:e,maxVisible:o}},e.addToQueue=function(t){u.hasOwnProperty(t.options.queue)||(u[t.options.queue]={maxVisible:a,queue:[]}),u[t.options.queue].queue.push(t)},e.removeFromQueue=function(t){if(u.hasOwnProperty(t.options.queue)){var e=[];Object.keys(u[t.options.queue].queue).forEach((function(o){u[t.options.queue].queue[o].id!==t.id&&e.push(u[t.options.queue].queue[o])})),u[t.options.queue].queue=e}},e.queueRender=c,e.queueRenderAll=function(){Object.keys(u).forEach((function(t){c(t)}))},e.ghostFix=function(t){var e=n.generateID("ghost"),o=document.createElement("div");o.setAttribute("id",e),n.css(o,{height:n.outerHeight(t.barDom)+"px"}),t.barDom.insertAdjacentHTML("afterend",o.outerHTML),n.remove(t.barDom),o=document.getElementById(e),n.addClass(o,"noty_fix_effects_height"),n.addListener(o,n.animationEndEvents,(function(){n.remove(o)}))},e.build=function(t){!function(t){if(t.options.container)t.layoutDom=document.querySelector(t.options.container);else{var e="noty_layout__"+t.options.layout;t.layoutDom=document.querySelector("div#"+e),t.layoutDom||(t.layoutDom=document.createElement("div"),t.layoutDom.setAttribute("id",e),t.layoutDom.setAttribute("role","alert"),t.layoutDom.setAttribute("aria-live","polite"),n.addClass(t.layoutDom,"noty_layout"),document.querySelector("body").appendChild(t.layoutDom))}}(t);var e='
'+t.options.text+"
"+function(t){if(f(t)){var e=document.createElement("div");return n.addClass(e,"noty_buttons"),Object.keys(t.options.buttons).forEach((function(o){e.appendChild(t.options.buttons[o].dom)})),t.options.buttons.forEach((function(t){e.appendChild(t.dom)})),e.outerHTML}return""}(t)+'
';t.barDom=document.createElement("div"),t.barDom.setAttribute("id",t.id),n.addClass(t.barDom,"noty_bar noty_type__"+t.options.type+" noty_theme__"+t.options.theme),t.barDom.innerHTML=e,p(t,"onTemplate")},e.hasButtons=f,e.handleModal=function(t){var o,r;t.options.modal&&(0===i&&(o=document.querySelector("body"),r=document.createElement("div"),n.addClass(r,"noty_modal"),o.insertBefore(r,o.firstChild),n.addClass(r,"noty_modal_open"),n.addListener(r,n.animationEndEvents,(function(){n.removeClass(r,"noty_modal_open")}))),e.DocModalCount=i+=1)},e.handleModalClose=function(t){if(t.options.modal&&i>0&&(e.DocModalCount=i-=1,i<=0)){var o=document.querySelector(".noty_modal");o&&(n.removeClass(o,"noty_modal_open"),n.addClass(o,"noty_modal_close"),n.addListener(o,n.animationEndEvents,(function(){n.remove(o)})))}},e.queueClose=d,e.dequeueClose=h,e.fire=p,e.openFlow=function(t){p(t,"afterShow"),d(t),n.addListener(t.barDom,"mouseenter",(function(){h(t)})),n.addListener(t.barDom,"mouseleave",(function(){d(t)}))},e.closeFlow=function(t){delete l[t.id],t.closing=!1,p(t,"afterClose"),n.remove(t.barDom),0!==t.layoutDom.querySelectorAll(".noty_bar").length||t.options.container||n.remove(t.layoutDom),(n.inArray("docVisible",t.options.titleCount.conditions)||n.inArray("docHidden",t.options.titleCount.conditions))&&s.decrement(),c(t.options.queue)};var n=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e.default=t,e}(o(0));e.PageHidden=!1;var i=e.DocModalCount=0,r={originalTitle:null,count:0,changed:!1,timer:-1},s=e.docTitle={increment:function(){r.count++,s._update()},decrement:function(){r.count--,r.count<=0?s._clear():s._update()},_update:function(){var t=document.title;r.changed?document.title="("+r.count+") "+r.originalTitle:(r.originalTitle=t,document.title="("+r.count+") "+t,r.changed=!0)},_clear:function(){r.changed&&(r.count=0,document.title=r.originalTitle,r.changed=!1)}},a=e.DefaultMaxVisible=5,u=e.Queues={global:{maxVisible:a,queue:[]}},l=e.Store={};function c(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"global";if(u.hasOwnProperty(t)){var e=u[t].queue.shift();e&&e.show()}}function f(t){return!(!t.options.buttons||!Object.keys(t.options.buttons).length)}function d(t){t.options.timeout&&(t.options.progressBar&&t.progressDom&&n.css(t.progressDom,{transition:"width "+t.options.timeout+"ms linear",width:"0%"}),clearTimeout(t.closeTimer),t.closeTimer=setTimeout((function(){t.close()}),t.options.timeout))}function h(t){t.options.timeout&&t.closeTimer&&(clearTimeout(t.closeTimer),t.closeTimer=-1,t.options.progressBar&&t.progressDom&&n.css(t.progressDom,{transition:"width 0ms linear",width:"100%"}))}function p(t,e){t.listeners.hasOwnProperty(e)&&t.listeners[e].forEach((function(e){"function"==typeof e&&e.apply(t)}))}e.Defaults={type:"alert",layout:"topRight",theme:"mint",text:"",timeout:!1,progressBar:!0,closeWith:["click"],animation:{open:"noty_effects_open",close:"noty_effects_close"},id:!1,force:!1,killer:!1,queue:"global",container:!1,buttons:[],callbacks:{beforeShow:null,onShow:null,afterShow:null,onClose:null,afterClose:null,onClick:null,onHover:null,onTemplate:null},sounds:{sources:[],volume:1,conditions:[]},titleCount:{conditions:[]},modal:!1,visibilityControl:!1}},function(t,e,o){Object.defineProperty(e,"__esModule",{value:!0}),e.NotyButton=void 0;var n=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e.default=t,e}(o(0));e.NotyButton=function t(e,o,i){var r=this,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.dom=document.createElement("button"),this.dom.innerHTML=e,this.id=s.id=s.id||n.generateID("button"),this.cb=i,Object.keys(s).forEach((function(t){r.dom.setAttribute(t,s[t])})),n.addClass(this.dom,o||"noty_btn"),this}},function(t,e,o){Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t,e){for(var o=0;o0&&void 0!==arguments[0]?arguments[0]:"/service-worker.js";return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.subData={},this.workerPath=e,this.listeners={onPermissionGranted:[],onPermissionDenied:[],onSubscriptionSuccess:[],onSubscriptionCancel:[],onWorkerError:[],onWorkerSuccess:[],onWorkerNotSupported:[]},this}return n(t,[{key:"on",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){};return"function"==typeof e&&this.listeners.hasOwnProperty(t)&&this.listeners[t].push(e),this}},{key:"fire",value:function(t){var e=this,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];this.listeners.hasOwnProperty(t)&&this.listeners[t].forEach((function(t){"function"==typeof t&&t.apply(e,o)}))}},{key:"create",value:function(){console.log("NOT IMPLEMENTED YET")}},{key:"isSupported",value:function(){var t=!1;try{t=window.Notification||window.webkitNotifications||navigator.mozNotification||window.external&&void 0!==window.external.msIsSiteMode()}catch(t){}return t}},{key:"getPermissionStatus",value:function(){var t="default";if(window.Notification&&window.Notification.permissionLevel)t=window.Notification.permissionLevel;else if(window.webkitNotifications&&window.webkitNotifications.checkPermission)switch(window.webkitNotifications.checkPermission()){case 1:t="default";break;case 0:t="granted";break;default:t="denied"}else window.Notification&&window.Notification.permission?t=window.Notification.permission:navigator.mozNotification?t="granted":window.external&&void 0!==window.external.msIsSiteMode()&&(t=window.external.msIsSiteMode()?"granted":"default");return t.toString().toLowerCase()}},{key:"getEndpoint",value:function(t){var e=t.endpoint,o=t.subscriptionId;return o&&-1===e.indexOf(o)&&(e+="/"+o),e}},{key:"isSWRegistered",value:function(){try{return"activated"===navigator.serviceWorker.controller.state}catch(t){return!1}}},{key:"unregisterWorker",value:function(){var t=this;"serviceWorker"in navigator&&navigator.serviceWorker.getRegistrations().then((function(e){var o=!0,n=!1,i=void 0;try{for(var r,s=e[Symbol.iterator]();!(o=(r=s.next()).done);o=!0)r.value.unregister(),t.fire("onSubscriptionCancel")}catch(t){n=!0,i=t}finally{try{!o&&s.return&&s.return()}finally{if(n)throw i}}}))}},{key:"requestSubscription",value:function(){var t=this,e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],o=this,n=this.getPermissionStatus(),i=function(n){"granted"===n?(t.fire("onPermissionGranted"),"serviceWorker"in navigator?navigator.serviceWorker.register(t.workerPath).then((function(){navigator.serviceWorker.ready.then((function(t){o.fire("onWorkerSuccess"),t.pushManager.subscribe({userVisibleOnly:e}).then((function(t){var e=t.getKey("p256dh"),n=t.getKey("auth");o.subData={endpoint:o.getEndpoint(t),p256dh:e?window.btoa(String.fromCharCode.apply(null,new Uint8Array(e))):null,auth:n?window.btoa(String.fromCharCode.apply(null,new Uint8Array(n))):null},o.fire("onSubscriptionSuccess",[o.subData])})).catch((function(t){o.fire("onWorkerError",[t])}))}))})):o.fire("onWorkerNotSupported")):"denied"===n&&(t.fire("onPermissionDenied"),t.unregisterWorker())};"default"===n?window.Notification&&window.Notification.requestPermission?window.Notification.requestPermission(i):window.webkitNotifications&&window.webkitNotifications.checkPermission&&window.webkitNotifications.requestPermission(i):i(n)}}]),t}()},function(t,e,o){(function(e,n){var i;i=function(){function t(t){return"function"==typeof t}var i=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)},r=0,s=void 0,a=void 0,u=function(t,e){m[r]=t,m[r+1]=e,2===(r+=2)&&(a?a(v):_())},l="undefined"!=typeof window?window:void 0,c=l||{},f=c.MutationObserver||c.WebKitMutationObserver,d="undefined"==typeof self&&void 0!==e&&"[object process]"==={}.toString.call(e),h="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function p(){var t=setTimeout;return function(){return t(v,1)}}var m=new Array(1e3);function v(){for(var t=0;t0&&void 0!==arguments[0]?arguments[0]:{};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.options=a.deepExtend({},u.Defaults,e),u.Store[this.options.id]?u.Store[this.options.id]:(this.id=this.options.id||a.generateID("bar"),this.closeTimer=-1,this.barDom=null,this.layoutDom=null,this.progressDom=null,this.showing=!1,this.shown=!1,this.closed=!1,this.closing=!1,this.killable=this.options.timeout||this.options.closeWith.length>0,this.hasSound=this.options.sounds.sources.length>0,this.soundPlayed=!1,this.listeners={beforeShow:[],onShow:[],afterShow:[],onClose:[],afterClose:[],onClick:[],onHover:[],onTemplate:[]},this.promises={show:null,close:null},this.on("beforeShow",this.options.callbacks.beforeShow),this.on("onShow",this.options.callbacks.onShow),this.on("afterShow",this.options.callbacks.afterShow),this.on("onClose",this.options.callbacks.onClose),this.on("afterClose",this.options.callbacks.afterClose),this.on("onClick",this.options.callbacks.onClick),this.on("onHover",this.options.callbacks.onHover),this.on("onTemplate",this.options.callbacks.onTemplate),this)}return n(t,[{key:"on",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){};return"function"==typeof e&&this.listeners.hasOwnProperty(t)&&this.listeners[t].push(e),this}},{key:"show",value:function(){var e=this;if(this.showing||this.shown)return this;!0===this.options.killer?t.closeAll():"string"==typeof this.options.killer&&t.closeAll(this.options.killer);var o=u.getQueueCounts(this.options.queue);if(o.current>=o.maxVisible||u.PageHidden&&this.options.visibilityControl)return u.addToQueue(this),u.PageHidden&&this.hasSound&&a.inArray("docHidden",this.options.sounds.conditions)&&a.createAudioElements(this),u.PageHidden&&a.inArray("docHidden",this.options.titleCount.conditions)&&u.docTitle.increment(),this;if(u.Store[this.id]=this,u.fire(this,"beforeShow"),this.showing=!0,this.closing)return this.showing=!1,this;if(u.build(this),u.handleModal(this),this.options.force?this.layoutDom.insertBefore(this.barDom,this.layoutDom.firstChild):this.layoutDom.appendChild(this.barDom),this.hasSound&&!this.soundPlayed&&a.inArray("docVisible",this.options.sounds.conditions)&&a.createAudioElements(this),a.inArray("docVisible",this.options.titleCount.conditions)&&u.docTitle.increment(),this.shown=!0,this.closed=!1,u.hasButtons(this)&&Object.keys(this.options.buttons).forEach((function(t){var o=e.barDom.querySelector("#"+e.options.buttons[t].id);a.addListener(o,"click",(function(o){a.stopPropagation(o),e.options.buttons[t].cb(e)}))})),this.progressDom=this.barDom.querySelector(".noty_progressbar"),a.inArray("click",this.options.closeWith)&&(a.addClass(this.barDom,"noty_close_with_click"),a.addListener(this.barDom,"click",(function(t){a.stopPropagation(t),u.fire(e,"onClick"),e.close()}),!1)),a.addListener(this.barDom,"mouseenter",(function(){u.fire(e,"onHover")}),!1),this.options.timeout&&a.addClass(this.barDom,"noty_has_timeout"),this.options.progressBar&&a.addClass(this.barDom,"noty_has_progressbar"),a.inArray("button",this.options.closeWith)){a.addClass(this.barDom,"noty_close_with_button");var n=document.createElement("div");a.addClass(n,"noty_close_button"),n.innerHTML="×",this.barDom.appendChild(n),a.addListener(n,"click",(function(t){a.stopPropagation(t),e.close()}),!1)}return u.fire(this,"onShow"),null===this.options.animation.open?this.promises.show=new s.default((function(t){t()})):"function"==typeof this.options.animation.open?this.promises.show=new s.default(this.options.animation.open.bind(this)):(a.addClass(this.barDom,this.options.animation.open),this.promises.show=new s.default((function(t){a.addListener(e.barDom,a.animationEndEvents,(function(){a.removeClass(e.barDom,e.options.animation.open),t()}))}))),this.promises.show.then((function(){var t=e;setTimeout((function(){u.openFlow(t)}),100)})),this}},{key:"stop",value:function(){return u.dequeueClose(this),this}},{key:"resume",value:function(){return u.queueClose(this),this}},{key:"setTimeout",value:function(t){function e(e){return t.apply(this,arguments)}return e.toString=function(){return t.toString()},e}((function(t){if(this.stop(),this.options.timeout=t,this.barDom){this.options.timeout?a.addClass(this.barDom,"noty_has_timeout"):a.removeClass(this.barDom,"noty_has_timeout");var e=this;setTimeout((function(){e.resume()}),100)}return this}))},{key:"setText",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.barDom&&(this.barDom.querySelector(".noty_body").innerHTML=t),e&&(this.options.text=t),this}},{key:"setType",value:function(t){var e=this,o=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.barDom&&(a.classList(this.barDom).split(" ").forEach((function(t){"noty_type__"===t.substring(0,11)&&a.removeClass(e.barDom,t)})),a.addClass(this.barDom,"noty_type__"+t)),o&&(this.options.type=t),this}},{key:"setTheme",value:function(t){var e=this,o=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.barDom&&(a.classList(this.barDom).split(" ").forEach((function(t){"noty_theme__"===t.substring(0,12)&&a.removeClass(e.barDom,t)})),a.addClass(this.barDom,"noty_theme__"+t)),o&&(this.options.theme=t),this}},{key:"close",value:function(){var t=this;return this.closed?this:this.shown?(u.fire(this,"onClose"),this.closing=!0,null===this.options.animation.close||!1===this.options.animation.close?this.promises.close=new s.default((function(t){t()})):"function"==typeof this.options.animation.close?this.promises.close=new s.default(this.options.animation.close.bind(this)):(a.addClass(this.barDom,this.options.animation.close),this.promises.close=new s.default((function(e){a.addListener(t.barDom,a.animationEndEvents,(function(){t.options.force?a.remove(t.barDom):u.ghostFix(t),e()}))}))),this.promises.close.then((function(){u.closeFlow(t),u.handleModalClose(t)})),this.closed=!0,this):(u.removeFromQueue(this),this)}}],[{key:"closeAll",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return Object.keys(u.Store).forEach((function(e){t?u.Store[e].options.queue===t&&u.Store[e].killable&&u.Store[e].close():u.Store[e].killable&&u.Store[e].close()})),this}},{key:"clearQueue",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"global";return u.Queues.hasOwnProperty(t)&&(u.Queues[t].queue=[]),this}},{key:"overrideDefaults",value:function(t){return u.Defaults=a.deepExtend({},u.Defaults,t),this}},{key:"setMaxVisible",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:u.DefaultMaxVisible,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"global";return u.Queues.hasOwnProperty(e)||(u.Queues[e]={maxVisible:t,queue:[]}),u.Queues[e].maxVisible=t,this}},{key:"button",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,o=arguments[2],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return new l.NotyButton(t,e,o,n)}},{key:"version",value:function(){return"3.2.0-beta"}},{key:"Push",value:function(t){return new c.Push(t)}},{key:"Queues",get:function(){return u.Queues}},{key:"PageHidden",get:function(){return u.PageHidden}}]),t}();e.default=d,"undefined"!=typeof window&&a.visibilityChangeFlow(),t.exports=e.default},function(t,e){var o,n,i=t.exports={};function r(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function a(t){if(o===setTimeout)return setTimeout(t,0);if((o===r||!o)&&setTimeout)return o=setTimeout,setTimeout(t,0);try{return o(t,0)}catch(e){try{return o.call(null,t,0)}catch(e){return o.call(this,t,0)}}}!function(){try{o="function"==typeof setTimeout?setTimeout:r}catch(t){o=r}try{n="function"==typeof clearTimeout?clearTimeout:s}catch(t){n=s}}();var u,l=[],c=!1,f=-1;function d(){c&&u&&(c=!1,u.length?l=u.concat(l):f=-1,l.length&&h())}function h(){if(!c){var t=a(d);c=!0;for(var e=l.length;e;){for(u=l,l=[];++f1)for(var o=1;o0&&void 0!==arguments[0]?arguments[0]:"",e="noty_"+t+"_";return e+="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){var e=16*Math.random()|0;return("x"===t?e:3&e|8).toString(16)}))},e.outerHeight=function(t){var e=t.offsetHeight,o=window.getComputedStyle(t);return e+=parseInt(o.marginTop)+parseInt(o.marginBottom)},e.addListener=r,e.hasClass=s,e.addClass=function(t,e){var o=u(t),n=o+e;s(o,e)||(t.className=n.substring(1))},e.removeClass=function(t,e){var o=u(t),n=void 0;s(t,e)&&(n=o.replace(" "+e+" "," "),t.className=n.substring(1,n.length-1))},e.remove=a,e.classList=u,e.visibilityChangeFlow=function(){var t=void 0,e=void 0;function o(){i.PageHidden?setTimeout((function(){Object.keys(i.Store).forEach((function(t){i.Store.hasOwnProperty(t)&&i.Store[t].options.visibilityControl&&i.Store[t].stop()}))}),100):setTimeout((function(){Object.keys(i.Store).forEach((function(t){i.Store.hasOwnProperty(t)&&i.Store[t].options.visibilityControl&&i.Store[t].resume()})),i.queueRenderAll()}),100)}void 0!==document.hidden?(t="hidden",e="visibilitychange"):void 0!==document.msHidden?(t="msHidden",e="msvisibilitychange"):void 0!==document.webkitHidden&&(t="webkitHidden",e="webkitvisibilitychange"),e&&r(document,e,(function(){i.PageHidden=document[t],o()})),r(window,"blur",(function(){i.PageHidden=!0,o()})),r(window,"focus",(function(){i.PageHidden=!1,o()}))},e.createAudioElements=function(t){if(t.hasSound){var e=document.createElement("audio");t.options.sounds.sources.forEach((function(t){var o=document.createElement("source");o.src=t,o.type="audio/"+t.match(/\.([^.]+)$/)[1],e.appendChild(o)})),t.barDom?t.barDom.appendChild(e):document.querySelector("body").appendChild(e),e.volume=t.options.sounds.volume,t.soundPlayed||(e.play(),t.soundPlayed=!0),e.onended=function(){a(e)}}};var i=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e.default=t,e}(o(1));function r(t,e,o){var n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];e=e.split(" ");for(var i=0;i=0}function a(t){t.parentNode&&t.parentNode.removeChild(t)}function u(t){return(" "+(t&&t.className||"")+" ").replace(/\s+/gi," ")}e.animationEndEvents="webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend",e.deepExtend=function t(e){e=e||{};for(var o=1;o0&&void 0!==arguments[0]?arguments[0]:"global",e=0,o=a;return u.hasOwnProperty(t)&&(o=u[t].maxVisible,Object.keys(l).forEach((function(o){l[o].options.queue!==t||l[o].closed||e++}))),{current:e,maxVisible:o}},e.addToQueue=function(t){u.hasOwnProperty(t.options.queue)||(u[t.options.queue]={maxVisible:a,queue:[]}),u[t.options.queue].queue.push(t)},e.removeFromQueue=function(t){if(u.hasOwnProperty(t.options.queue)){var e=[];Object.keys(u[t.options.queue].queue).forEach((function(o){u[t.options.queue].queue[o].id!==t.id&&e.push(u[t.options.queue].queue[o])})),u[t.options.queue].queue=e}},e.queueRender=c,e.queueRenderAll=function(){Object.keys(u).forEach((function(t){c(t)}))},e.ghostFix=function(t){var e=n.generateID("ghost"),o=document.createElement("div");o.setAttribute("id",e),n.css(o,{height:n.outerHeight(t.barDom)+"px"}),t.barDom.insertAdjacentHTML("afterend",o.outerHTML),n.remove(t.barDom),o=document.getElementById(e),n.addClass(o,"noty_fix_effects_height"),n.addListener(o,n.animationEndEvents,(function(){n.remove(o)}))},e.build=function(t){!function(t){if(t.options.container)t.layoutDom=document.querySelector(t.options.container);else{var e="noty_layout__"+t.options.layout;t.layoutDom=document.querySelector("div#"+e),t.layoutDom||(t.layoutDom=document.createElement("div"),t.layoutDom.setAttribute("id",e),t.layoutDom.setAttribute("role","alert"),t.layoutDom.setAttribute("aria-live","polite"),n.addClass(t.layoutDom,"noty_layout"),document.querySelector("body").appendChild(t.layoutDom))}}(t);var e='
'+t.options.text+"
"+function(t){if(f(t)){var e=document.createElement("div");return n.addClass(e,"noty_buttons"),Object.keys(t.options.buttons).forEach((function(o){e.appendChild(t.options.buttons[o].dom)})),t.options.buttons.forEach((function(t){e.appendChild(t.dom)})),e.outerHTML}return""}(t)+'
';t.barDom=document.createElement("div"),t.barDom.setAttribute("id",t.id),n.addClass(t.barDom,"noty_bar noty_type__"+t.options.type+" noty_theme__"+t.options.theme),t.barDom.innerHTML=e,p(t,"onTemplate")},e.hasButtons=f,e.handleModal=function(t){var o,r;t.options.modal&&(0===i&&(o=document.querySelector("body"),r=document.createElement("div"),n.addClass(r,"noty_modal"),o.insertBefore(r,o.firstChild),n.addClass(r,"noty_modal_open"),n.addListener(r,n.animationEndEvents,(function(){n.removeClass(r,"noty_modal_open")}))),e.DocModalCount=i+=1)},e.handleModalClose=function(t){if(t.options.modal&&i>0&&(e.DocModalCount=i-=1,i<=0)){var o=document.querySelector(".noty_modal");o&&(n.removeClass(o,"noty_modal_open"),n.addClass(o,"noty_modal_close"),n.addListener(o,n.animationEndEvents,(function(){n.remove(o)})))}},e.queueClose=d,e.dequeueClose=h,e.fire=p,e.openFlow=function(t){p(t,"afterShow"),d(t),n.addListener(t.barDom,"mouseenter",(function(){h(t)})),n.addListener(t.barDom,"mouseleave",(function(){d(t)}))},e.closeFlow=function(t){delete l[t.id],t.closing=!1,p(t,"afterClose"),n.remove(t.barDom),0!==t.layoutDom.querySelectorAll(".noty_bar").length||t.options.container||n.remove(t.layoutDom),(n.inArray("docVisible",t.options.titleCount.conditions)||n.inArray("docHidden",t.options.titleCount.conditions))&&s.decrement(),c(t.options.queue)};var n=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e.default=t,e}(o(0));e.PageHidden=!1;var i=e.DocModalCount=0,r={originalTitle:null,count:0,changed:!1,timer:-1},s=e.docTitle={increment:function(){r.count++,s._update()},decrement:function(){r.count--,r.count<=0?s._clear():s._update()},_update:function(){var t=document.title;r.changed?document.title="("+r.count+") "+r.originalTitle:(r.originalTitle=t,document.title="("+r.count+") "+t,r.changed=!0)},_clear:function(){r.changed&&(r.count=0,document.title=r.originalTitle,r.changed=!1)}},a=e.DefaultMaxVisible=5,u=e.Queues={global:{maxVisible:a,queue:[]}},l=e.Store={};function c(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"global";if(u.hasOwnProperty(t)){var e=u[t].queue.shift();e&&e.show()}}function f(t){return!(!t.options.buttons||!Object.keys(t.options.buttons).length)}function d(t){t.options.timeout&&(t.options.progressBar&&t.progressDom&&n.css(t.progressDom,{transition:"width "+t.options.timeout+"ms linear",width:"0%"}),clearTimeout(t.closeTimer),t.closeTimer=setTimeout((function(){t.close()}),t.options.timeout))}function h(t){t.options.timeout&&t.closeTimer&&(clearTimeout(t.closeTimer),t.closeTimer=-1,t.options.progressBar&&t.progressDom&&n.css(t.progressDom,{transition:"width 0ms linear",width:"100%"}))}function p(t,e){t.listeners.hasOwnProperty(e)&&t.listeners[e].forEach((function(e){"function"==typeof e&&e.apply(t)}))}e.Defaults={type:"alert",layout:"topRight",theme:"mint",text:"",timeout:!1,progressBar:!0,closeWith:["click"],animation:{open:"noty_effects_open",close:"noty_effects_close"},id:!1,force:!1,killer:!1,queue:"global",container:!1,buttons:[],callbacks:{beforeShow:null,onShow:null,afterShow:null,onClose:null,afterClose:null,onClick:null,onHover:null,onTemplate:null},sounds:{sources:[],volume:1,conditions:[]},titleCount:{conditions:[]},modal:!1,visibilityControl:!1}},function(t,e,o){Object.defineProperty(e,"__esModule",{value:!0}),e.NotyButton=void 0;var n=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e.default=t,e}(o(0));e.NotyButton=function t(e,o,i){var r=this,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.dom=document.createElement("button"),this.dom.innerHTML=e,this.id=s.id=s.id||n.generateID("button"),this.cb=i,Object.keys(s).forEach((function(t){r.dom.setAttribute(t,s[t])})),n.addClass(this.dom,o||"noty_btn"),this}},function(t,e,o){Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t,e){for(var o=0;o0&&void 0!==arguments[0]?arguments[0]:"/service-worker.js";return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.subData={},this.workerPath=e,this.listeners={onPermissionGranted:[],onPermissionDenied:[],onSubscriptionSuccess:[],onSubscriptionCancel:[],onWorkerError:[],onWorkerSuccess:[],onWorkerNotSupported:[]},this}return n(t,[{key:"on",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){};return"function"==typeof e&&this.listeners.hasOwnProperty(t)&&this.listeners[t].push(e),this}},{key:"fire",value:function(t){var e=this,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];this.listeners.hasOwnProperty(t)&&this.listeners[t].forEach((function(t){"function"==typeof t&&t.apply(e,o)}))}},{key:"create",value:function(){console.log("NOT IMPLEMENTED YET")}},{key:"isSupported",value:function(){var t=!1;try{t=window.Notification||window.webkitNotifications||navigator.mozNotification||window.external&&void 0!==window.external.msIsSiteMode()}catch(t){}return t}},{key:"getPermissionStatus",value:function(){var t="default";if(window.Notification&&window.Notification.permissionLevel)t=window.Notification.permissionLevel;else if(window.webkitNotifications&&window.webkitNotifications.checkPermission)switch(window.webkitNotifications.checkPermission()){case 1:t="default";break;case 0:t="granted";break;default:t="denied"}else window.Notification&&window.Notification.permission?t=window.Notification.permission:navigator.mozNotification?t="granted":window.external&&void 0!==window.external.msIsSiteMode()&&(t=window.external.msIsSiteMode()?"granted":"default");return t.toString().toLowerCase()}},{key:"getEndpoint",value:function(t){var e=t.endpoint,o=t.subscriptionId;return o&&-1===e.indexOf(o)&&(e+="/"+o),e}},{key:"isSWRegistered",value:function(){try{return"activated"===navigator.serviceWorker.controller.state}catch(t){return!1}}},{key:"unregisterWorker",value:function(){var t=this;"serviceWorker"in navigator&&navigator.serviceWorker.getRegistrations().then((function(e){var o=!0,n=!1,i=void 0;try{for(var r,s=e[Symbol.iterator]();!(o=(r=s.next()).done);o=!0)r.value.unregister(),t.fire("onSubscriptionCancel")}catch(t){n=!0,i=t}finally{try{!o&&s.return&&s.return()}finally{if(n)throw i}}}))}},{key:"requestSubscription",value:function(){var t=this,e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],o=this,n=this.getPermissionStatus(),i=function(n){"granted"===n?(t.fire("onPermissionGranted"),"serviceWorker"in navigator?navigator.serviceWorker.register(t.workerPath).then((function(){navigator.serviceWorker.ready.then((function(t){o.fire("onWorkerSuccess"),t.pushManager.subscribe({userVisibleOnly:e}).then((function(t){var e=t.getKey("p256dh"),n=t.getKey("auth");o.subData={endpoint:o.getEndpoint(t),p256dh:e?window.btoa(String.fromCharCode.apply(null,new Uint8Array(e))):null,auth:n?window.btoa(String.fromCharCode.apply(null,new Uint8Array(n))):null},o.fire("onSubscriptionSuccess",[o.subData])})).catch((function(t){o.fire("onWorkerError",[t])}))}))})):o.fire("onWorkerNotSupported")):"denied"===n&&(t.fire("onPermissionDenied"),t.unregisterWorker())};"default"===n?window.Notification&&window.Notification.requestPermission?window.Notification.requestPermission(i):window.webkitNotifications&&window.webkitNotifications.checkPermission&&window.webkitNotifications.requestPermission(i):i(n)}}]),t}()},function(t,e,o){(function(e,n){var i;i=function(){function t(t){return"function"==typeof t}var i=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)},r=0,s=void 0,a=void 0,u=function(t,e){m[r]=t,m[r+1]=e,2===(r+=2)&&(a?a(v):_())},l="undefined"!=typeof window?window:void 0,c=l||{},f=c.MutationObserver||c.WebKitMutationObserver,d="undefined"==typeof self&&void 0!==e&&"[object process]"==={}.toString.call(e),h="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function p(){var t=setTimeout;return function(){return t(v,1)}}var m=new Array(1e3);function v(){for(var t=0;t0&&void 0!==arguments[0]?arguments[0]:{};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.options=a.deepExtend({},u.Defaults,e),u.Store[this.options.id]?u.Store[this.options.id]:(this.id=this.options.id||a.generateID("bar"),this.closeTimer=-1,this.barDom=null,this.layoutDom=null,this.progressDom=null,this.showing=!1,this.shown=!1,this.closed=!1,this.closing=!1,this.killable=this.options.timeout||this.options.closeWith.length>0,this.hasSound=this.options.sounds.sources.length>0,this.soundPlayed=!1,this.listeners={beforeShow:[],onShow:[],afterShow:[],onClose:[],afterClose:[],onClick:[],onHover:[],onTemplate:[]},this.promises={show:null,close:null},this.on("beforeShow",this.options.callbacks.beforeShow),this.on("onShow",this.options.callbacks.onShow),this.on("afterShow",this.options.callbacks.afterShow),this.on("onClose",this.options.callbacks.onClose),this.on("afterClose",this.options.callbacks.afterClose),this.on("onClick",this.options.callbacks.onClick),this.on("onHover",this.options.callbacks.onHover),this.on("onTemplate",this.options.callbacks.onTemplate),this)}return n(t,[{key:"on",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){};return"function"==typeof e&&this.listeners.hasOwnProperty(t)&&this.listeners[t].push(e),this}},{key:"show",value:function(){var e=this;if(this.showing||this.shown)return this;!0===this.options.killer?t.closeAll():"string"==typeof this.options.killer&&t.closeAll(this.options.killer);var o=u.getQueueCounts(this.options.queue);if(o.current>=o.maxVisible||u.PageHidden&&this.options.visibilityControl)return u.addToQueue(this),u.PageHidden&&this.hasSound&&a.inArray("docHidden",this.options.sounds.conditions)&&a.createAudioElements(this),u.PageHidden&&a.inArray("docHidden",this.options.titleCount.conditions)&&u.docTitle.increment(),this;if(u.Store[this.id]=this,u.fire(this,"beforeShow"),this.showing=!0,this.closing)return this.showing=!1,this;if(u.build(this),u.handleModal(this),this.options.force?this.layoutDom.insertBefore(this.barDom,this.layoutDom.firstChild):this.layoutDom.appendChild(this.barDom),this.hasSound&&!this.soundPlayed&&a.inArray("docVisible",this.options.sounds.conditions)&&a.createAudioElements(this),a.inArray("docVisible",this.options.titleCount.conditions)&&u.docTitle.increment(),this.shown=!0,this.closed=!1,u.hasButtons(this)&&Object.keys(this.options.buttons).forEach((function(t){var o=e.barDom.querySelector("#"+e.options.buttons[t].id);a.addListener(o,"click",(function(o){a.stopPropagation(o),e.options.buttons[t].cb(e)}))})),this.progressDom=this.barDom.querySelector(".noty_progressbar"),a.inArray("click",this.options.closeWith)&&(a.addClass(this.barDom,"noty_close_with_click"),a.addListener(this.barDom,"click",(function(t){a.stopPropagation(t),u.fire(e,"onClick"),e.close()}),!1)),a.addListener(this.barDom,"mouseenter",(function(){u.fire(e,"onHover")}),!1),this.options.timeout&&a.addClass(this.barDom,"noty_has_timeout"),this.options.progressBar&&a.addClass(this.barDom,"noty_has_progressbar"),a.inArray("button",this.options.closeWith)){a.addClass(this.barDom,"noty_close_with_button");var n=document.createElement("div");a.addClass(n,"noty_close_button"),n.innerHTML="×",this.barDom.appendChild(n),a.addListener(n,"click",(function(t){a.stopPropagation(t),e.close()}),!1)}return u.fire(this,"onShow"),null===this.options.animation.open?this.promises.show=new s.default((function(t){t()})):"function"==typeof this.options.animation.open?this.promises.show=new s.default(this.options.animation.open.bind(this)):(a.addClass(this.barDom,this.options.animation.open),this.promises.show=new s.default((function(t){a.addListener(e.barDom,a.animationEndEvents,(function(){a.removeClass(e.barDom,e.options.animation.open),t()}))}))),this.promises.show.then((function(){var t=e;setTimeout((function(){u.openFlow(t)}),100)})),this}},{key:"stop",value:function(){return u.dequeueClose(this),this}},{key:"resume",value:function(){return u.queueClose(this),this}},{key:"setTimeout",value:function(t){function e(e){return t.apply(this,arguments)}return e.toString=function(){return t.toString()},e}((function(t){if(this.stop(),this.options.timeout=t,this.barDom){this.options.timeout?a.addClass(this.barDom,"noty_has_timeout"):a.removeClass(this.barDom,"noty_has_timeout");var e=this;setTimeout((function(){e.resume()}),100)}return this}))},{key:"setText",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.barDom&&(this.barDom.querySelector(".noty_body").innerHTML=t),e&&(this.options.text=t),this}},{key:"setType",value:function(t){var e=this,o=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.barDom&&(a.classList(this.barDom).split(" ").forEach((function(t){"noty_type__"===t.substring(0,11)&&a.removeClass(e.barDom,t)})),a.addClass(this.barDom,"noty_type__"+t)),o&&(this.options.type=t),this}},{key:"setTheme",value:function(t){var e=this,o=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.barDom&&(a.classList(this.barDom).split(" ").forEach((function(t){"noty_theme__"===t.substring(0,12)&&a.removeClass(e.barDom,t)})),a.addClass(this.barDom,"noty_theme__"+t)),o&&(this.options.theme=t),this}},{key:"close",value:function(){var t=this;return this.closed?this:this.shown?(u.fire(this,"onClose"),this.closing=!0,null===this.options.animation.close||!1===this.options.animation.close?this.promises.close=new s.default((function(t){t()})):"function"==typeof this.options.animation.close?this.promises.close=new s.default(this.options.animation.close.bind(this)):(a.addClass(this.barDom,this.options.animation.close),this.promises.close=new s.default((function(e){a.addListener(t.barDom,a.animationEndEvents,(function(){t.options.force?a.remove(t.barDom):u.ghostFix(t),e()}))}))),this.promises.close.then((function(){u.closeFlow(t),u.handleModalClose(t)})),this.closed=!0,this):(u.removeFromQueue(this),this)}}],[{key:"closeAll",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return Object.keys(u.Store).forEach((function(e){t?u.Store[e].options.queue===t&&u.Store[e].killable&&u.Store[e].close():u.Store[e].killable&&u.Store[e].close()})),this}},{key:"clearQueue",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"global";return u.Queues.hasOwnProperty(t)&&(u.Queues[t].queue=[]),this}},{key:"overrideDefaults",value:function(t){return u.Defaults=a.deepExtend({},u.Defaults,t),this}},{key:"setMaxVisible",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:u.DefaultMaxVisible,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"global";return u.Queues.hasOwnProperty(e)||(u.Queues[e]={maxVisible:t,queue:[]}),u.Queues[e].maxVisible=t,this}},{key:"button",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,o=arguments[2],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return new l.NotyButton(t,e,o,n)}},{key:"version",value:function(){return"3.2.0-beta"}},{key:"Push",value:function(t){return new c.Push(t)}},{key:"Queues",get:function(){return u.Queues}},{key:"PageHidden",get:function(){return u.PageHidden}}]),t}();e.default=d,"undefined"!=typeof window&&a.visibilityChangeFlow(),t.exports=e.default},function(t,e){var o,n,i=t.exports={};function r(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function a(t){if(o===setTimeout)return setTimeout(t,0);if((o===r||!o)&&setTimeout)return o=setTimeout,setTimeout(t,0);try{return o(t,0)}catch(e){try{return o.call(null,t,0)}catch(e){return o.call(this,t,0)}}}!function(){try{o="function"==typeof setTimeout?setTimeout:r}catch(t){o=r}try{n="function"==typeof clearTimeout?clearTimeout:s}catch(t){n=s}}();var u,l=[],c=!1,f=-1;function d(){c&&u&&(c=!1,u.length?l=u.concat(l):f=-1,l.length&&h())}function h(){if(!c){var t=a(d);c=!0;for(var e=l.length;e;){for(u=l,l=[];++f1)for(var o=1;o array( 'cdn' => array( - 'https://cdn.jsdelivr.net/npm/@flasher/flasher-notyf@1.3.1/dist/flasher-notyf.min.js', + 'https://cdn.jsdelivr.net/npm/@flasher/flasher-notyf@1.3.2/dist/flasher-notyf.min.js', ), 'local' => array( '/vendor/flasher/flasher-notyf.min.js', @@ -16,7 +16,7 @@ return array( ), 'styles' => array( 'cdn' => array( - 'https://cdn.jsdelivr.net/npm/@flasher/flasher-notyf@1.3.1/dist/flasher-notyf.min.css', + 'https://cdn.jsdelivr.net/npm/@flasher/flasher-notyf@1.3.2/dist/flasher-notyf.min.css', ), 'local' => array( '/vendor/flasher/flasher-notyf.min.css', diff --git a/src/Notyf/Prime/NotyfPlugin.php b/src/Notyf/Prime/NotyfPlugin.php index 86382b07..5d5abcd9 100644 --- a/src/Notyf/Prime/NotyfPlugin.php +++ b/src/Notyf/Prime/NotyfPlugin.php @@ -18,7 +18,7 @@ class NotyfPlugin extends Plugin { return array( 'cdn' => array( - 'https://cdn.jsdelivr.net/npm/@flasher/flasher-notyf@1.3.1/dist/flasher-notyf.min.js', + 'https://cdn.jsdelivr.net/npm/@flasher/flasher-notyf@1.3.2/dist/flasher-notyf.min.js', ), 'local' => array( '/vendor/flasher/flasher-notyf.min.js', @@ -33,7 +33,7 @@ class NotyfPlugin extends Plugin { return array( 'cdn' => array( - 'https://cdn.jsdelivr.net/npm/@flasher/flasher-notyf@1.3.1/dist/flasher-notyf.min.css', + 'https://cdn.jsdelivr.net/npm/@flasher/flasher-notyf@1.3.2/dist/flasher-notyf.min.css', ), 'local' => array( '/vendor/flasher/flasher-notyf.min.css', diff --git a/src/Notyf/Prime/Resources/assets/flasher-notyf.min.js b/src/Notyf/Prime/Resources/assets/flasher-notyf.min.js index e3d7e5cf..e7e0a3a9 100644 --- a/src/Notyf/Prime/Resources/assets/flasher-notyf.min.js +++ b/src/Notyf/Prime/Resources/assets/flasher-notyf.min.js @@ -1 +1 @@ -!function(t,i){"object"==typeof exports&&"undefined"!=typeof module?module.exports=i(require("@flasher/flasher")):"function"==typeof define&&define.amd?define(["@flasher/flasher"],i):((t="undefined"!=typeof globalThis?globalThis:t||self).flasher=t.flasher||{},t.flasher.notyf=i(t.flasher))}(this,(function(t){"use strict";var i,e=function(){return e=Object.assign||function(t){for(var i,e=1,n=arguments.length;e array( 'cdn' => array( - 'https://cdn.jsdelivr.net/npm/@flasher/flasher-pnotify@1.3.1/dist/flasher-pnotify.min.js', + 'https://cdn.jsdelivr.net/npm/@flasher/flasher-pnotify@1.3.2/dist/flasher-pnotify.min.js', ), 'local' => array( '/vendor/flasher/flasher-pnotify.min.js', @@ -16,7 +16,7 @@ return array( ), 'styles' => array( 'cdn' => array( - 'https://cdn.jsdelivr.net/npm/@flasher/flasher-pnotify@1.3.1/dist/flasher-pnotify.min.css', + 'https://cdn.jsdelivr.net/npm/@flasher/flasher-pnotify@1.3.2/dist/flasher-pnotify.min.css', ), 'local' => array( '/vendor/flasher/flasher-pnotify.min.css', diff --git a/src/Pnotify/Prime/PnotifyPlugin.php b/src/Pnotify/Prime/PnotifyPlugin.php index d339521e..b13f2027 100644 --- a/src/Pnotify/Prime/PnotifyPlugin.php +++ b/src/Pnotify/Prime/PnotifyPlugin.php @@ -18,7 +18,7 @@ class PnotifyPlugin extends Plugin { return array( 'cdn' => array( - 'https://cdn.jsdelivr.net/npm/@flasher/flasher-pnotify@1.3.1/dist/flasher-pnotify.min.js', + 'https://cdn.jsdelivr.net/npm/@flasher/flasher-pnotify@1.3.2/dist/flasher-pnotify.min.js', ), 'local' => array( '/vendor/flasher/flasher-pnotify.min.js', @@ -33,7 +33,7 @@ class PnotifyPlugin extends Plugin { return array( 'cdn' => array( - 'https://cdn.jsdelivr.net/npm/@flasher/flasher-pnotify@1.3.1/dist/flasher-pnotify.min.css', + 'https://cdn.jsdelivr.net/npm/@flasher/flasher-pnotify@1.3.2/dist/flasher-pnotify.min.css', ), 'local' => array( '/vendor/flasher/flasher-pnotify.min.css', diff --git a/src/Pnotify/Prime/Resources/assets/flasher-pnotify.min.js b/src/Pnotify/Prime/Resources/assets/flasher-pnotify.min.js index 0d0086e0..a22d644f 100644 --- a/src/Pnotify/Prime/Resources/assets/flasher-pnotify.min.js +++ b/src/Pnotify/Prime/Resources/assets/flasher-pnotify.min.js @@ -1 +1 @@ -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("@flasher/flasher")):"function"==typeof define&&define.amd?define(["@flasher/flasher"],e):((t="undefined"!=typeof globalThis?globalThis:t||self).flasher=t.flasher||{},t.flasher.pnotify=e(t.flasher))}(this,(function(t){"use strict";var e=function(){return e=Object.assign||function(t){for(var e,n=1,i=arguments.length;nt.length)&&(e=t.length);for(var n=0,i=new Array(e);n0&&void 0!==arguments[0]?arguments[0]:null;i(this,t),this.a=e,this.e=this.n=null}return r(t,[{key:"m",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;this.e||(this.e=E(e.nodeName),this.t=e,this.h(t)),this.i(n)}},{key:"h",value:function(t){this.e.innerHTML=t,this.n=Array.from(this.e.childNodes)}},{key:"i",value:function(t){for(var e=0;eg.get(T)?(b.add(M),w(O)):(x.add(T),d--):(c(C,s),d--)}for(;d--;){var E=t[d];y.has(E.key)||c(E,s)}for(;h;)w(v[h-1]);return v}function ft(t,e){for(var n={},i={},o={$$scope:1},r=t.length;r--;){var s=t[r],a=e[r];if(a){for(var c in s)c in a||(i[c]=1);for(var l in a)o[l]||(n[l]=a[l],o[l]=1);t[r]=a}else for(var u in s)o[u]=1}for(var f in i)f in n||(n[f]=void 0);return n}function dt(t){return"object"===e(t)&&null!==t?t:{}}function ht(t){t&&t.c()}function pt(t,e,n){var i=t.$$,o=i.fragment,r=i.on_mount,s=i.on_destroy,a=i.after_update;o&&o.m(e,n),X((function(){var e=r.map(k).filter(w);s?s.push.apply(s,v(e)):b(e),t.$$.on_mount=[]})),a.forEach(X)}function mt(t,e){var n=t.$$;null!==n.fragment&&(b(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function vt(t,e){-1===t.$$.dirty[0]&&(B.push(t),Q(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<1&&void 0!==arguments[1]?arguments[1]:{},i=n.start,o=void 0===i?"oldest":i,r=n.dir,s=void 0===r?"newer":r,a=n.skipModuleHandled,c=void 0!==a&&a;if("head"===o||"newest"===o&&"top"===this.push||"oldest"===o&&"bottom"===this.push)e=this._noticeHead.next;else if("tail"===o||"newest"===o&&"bottom"===this.push||"oldest"===o&&"top"===this.push)e=this._noticeTail.prev;else{if(!this._noticeMap.has(o))throw new Error("Invalid start param.");e=this._noticeMap.get(o)}for(;e.notice;){var l=e.notice;if("prev"===s||"top"===this.push&&"newer"===s||"bottom"===this.push&&"older"===s)e=e.prev;else{if(!("next"===s||"top"===this.push&&"older"===s||"bottom"===this.push&&"newer"===s))throw new Error("Invalid dir param.");e=e.next}if(!(c&&l.getModuleHandled()||!1!==t(l)))break}}},{key:"close",value:function(t){this.forEach((function(e){return e.close(t,!1,!1)}))}},{key:"open",value:function(t){this.forEach((function(e){return e.open(t)}))}},{key:"openLast",value:function(){this.forEach((function(t){if(-1===["opening","open","waiting"].indexOf(t.getState()))return t.open(),!1}),{start:"newest",dir:"older"})}},{key:"swap",value:function(t,e){var n=this,i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return-1===["open","opening","closing"].indexOf(t.getState())?Promise.reject():(this._swapping=e,t.close(i,!1,o).then((function(){return e.open(i)})).finally((function(){n._swapping=!1})))}},{key:"on",value:function(t,e){var n=this;return t in this._callbacks||(this._callbacks[t]=[]),this._callbacks[t].push(e),function(){n._callbacks[t].splice(n._callbacks[t].indexOf(e),1)}}},{key:"fire",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e.stack=this,t in this._callbacks&&this._callbacks[t].forEach((function(t){return t(e)}))}},{key:"position",value:function(){var t=this;this.positioned&&this._length>0?(this.fire("beforePosition"),this._resetPositionData(),this.forEach((function(e){t._positionNotice(e)}),{start:"head",dir:"next",skipModuleHandled:!0}),this.fire("afterPosition")):(delete this._nextpos1,delete this._nextpos2)}},{key:"queuePosition",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;this._posTimer&&clearTimeout(this._posTimer),this._posTimer=setTimeout((function(){return t.position()}),e)}},{key:"_resetPositionData",value:function(){this._nextpos1=this.firstpos1,this._nextpos2=this.firstpos2,this._addpos2=0}},{key:"_positionNotice",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t===this._masking;if(this.positioned){var n=t.refs.elem;if(n&&(n.classList.contains("pnotify-in")||n.classList.contains("pnotify-initial")||e)){var i=[this.firstpos1,this.firstpos2,this._nextpos1,this._nextpos2,this._addpos2],o=i[0],r=i[1],s=i[2],a=i[3],c=i[4];n.getBoundingClientRect(),!this._animation||e||this._collapsingModalState?t._setMoveClass(""):t._setMoveClass("pnotify-move");var l,u=this.context===document.body?window.innerHeight:this.context.scrollHeight,f=this.context===document.body?window.innerWidth:this.context.scrollWidth;if(this.dir1){var d;switch(l={down:"top",up:"bottom",left:"right",right:"left"}[this.dir1],this.dir1){case"down":d=n.offsetTop;break;case"up":d=u-n.scrollHeight-n.offsetTop;break;case"left":d=f-n.scrollWidth-n.offsetLeft;break;case"right":d=n.offsetLeft}null==o&&(s=o=d)}if(this.dir1&&this.dir2){var h,p={down:"top",up:"bottom",left:"right",right:"left"}[this.dir2];switch(this.dir2){case"down":h=n.offsetTop;break;case"up":h=u-n.scrollHeight-n.offsetTop;break;case"left":h=f-n.scrollWidth-n.offsetLeft;break;case"right":h=n.offsetLeft}if(null==r&&(a=r=h),!e){var m=s+n.offsetHeight+this.spacing1,v=s+n.offsetWidth+this.spacing1;(("down"===this.dir1||"up"===this.dir1)&&m>u||("left"===this.dir1||"right"===this.dir1)&&v>f)&&(s=o,a+=c+this.spacing2,c=0)}switch(null!=a&&(n.style[p]="".concat(a,"px"),this._animation||n.style[p]),this.dir2){case"down":case"up":n.offsetHeight+(parseFloat(n.style.marginTop,10)||0)+(parseFloat(n.style.marginBottom,10)||0)>c&&(c=n.offsetHeight);break;case"left":case"right":n.offsetWidth+(parseFloat(n.style.marginLeft,10)||0)+(parseFloat(n.style.marginRight,10)||0)>c&&(c=n.offsetWidth)}}else if(this.dir1){var y,g;switch(this.dir1){case"down":case"up":g=["left","right"],y=this.context.scrollWidth/2-n.offsetWidth/2;break;case"left":case"right":g=["top","bottom"],y=u/2-n.offsetHeight/2}n.style[g[0]]="".concat(y,"px"),n.style[g[1]]="auto",this._animation||n.style[g[0]]}if(this.dir1)switch(null!=s&&(n.style[l]="".concat(s,"px"),this._animation||n.style[l]),this.dir1){case"down":case"up":s+=n.offsetHeight+this.spacing1;break;case"left":case"right":s+=n.offsetWidth+this.spacing1}else{var $=f/2-n.offsetWidth/2,_=u/2-n.offsetHeight/2;n.style.left="".concat($,"px"),n.style.top="".concat(_,"px"),this._animation||n.style.left}e||(this.firstpos1=o,this.firstpos2=r,this._nextpos1=s,this._nextpos2=a,this._addpos2=c)}}}},{key:"_addNotice",value:function(t){var e=this;this.fire("beforeAddNotice",{notice:t});var n=function(){if(e.fire("beforeOpenNotice",{notice:t}),t.getModuleHandled())e.fire("afterOpenNotice",{notice:t});else{if(e._openNotices++,("ish"!==e.modal||!e._overlayOpen)&&e.maxOpen!==1/0&&e._openNotices>e.maxOpen&&"close"===e.maxStrategy){var n=e._openNotices-e.maxOpen;e.forEach((function(t){if(-1!==["opening","open"].indexOf(t.getState()))return t.close(!1,!1,e.maxClosureCausesWait),t===e._leader&&e._setLeader(null),!!--n}))}!0===e.modal&&e._insertOverlay(),"ish"!==e.modal||e._leader&&-1!==["opening","open","closing"].indexOf(e._leader.getState())||e._setLeader(t),"ish"===e.modal&&e._overlayOpen&&t._preventTimerClose(!0),e.fire("afterOpenNotice",{notice:t})}},i={notice:t,prev:null,next:null,beforeOpenOff:t.on("pnotify:beforeOpen",n),afterCloseOff:t.on("pnotify:afterClose",(function(){if(e.fire("beforeCloseNotice",{notice:t}),t.getModuleHandled())e.fire("afterCloseNotice",{notice:t});else{if(e._openNotices--,"ish"===e.modal&&t===e._leader&&(e._setLeader(null),e._masking&&e._setMasking(null)),!e._swapping&&e.maxOpen!==1/0&&e._openNotices=e.maxOpen))return n=!0,!1};"wait"===e.maxStrategy?(e.forEach(i,{start:t,dir:"next"}),n||e.forEach(i,{start:t,dir:"prev"})):"close"===e.maxStrategy&&e.maxClosureCausesWait&&(e.forEach(i,{start:t,dir:"older"}),n||e.forEach(i,{start:t,dir:"newer"}))}e._openNotices<=0?(e._openNotices=0,e._resetPositionData(),e._overlayOpen&&!e._swapping&&e._removeOverlay()):e._collapsingModalState||e.queuePosition(0),e.fire("afterCloseNotice",{notice:t})}}))};if("top"===this.push?(i.next=this._noticeHead.next,i.prev=this._noticeHead,i.next.prev=i,i.prev.next=i):(i.prev=this._noticeTail.prev,i.next=this._noticeTail,i.prev.next=i,i.next.prev=i),this._noticeMap.set(t,i),this._length++,this._listener||(this._listener=function(){return e.position()},this.context.addEventListener("pnotify:position",this._listener)),-1!==["open","opening","closing"].indexOf(t.getState()))n();else if("ish"===this.modal&&this.modalishFlash&&this._shouldNoticeWait(t))var o=t.on("pnotify:mount",(function(){o(),t._setMasking(!0,!1,(function(){t._setMasking(!1)})),e._resetPositionData(),e._positionNotice(e._leader),window.requestAnimationFrame((function(){e._positionNotice(t,!0)}))}));this.fire("afterAddNotice",{notice:t})}},{key:"_removeNotice",value:function(t){if(this._noticeMap.has(t)){this.fire("beforeRemoveNotice",{notice:t});var e=this._noticeMap.get(t);this._leader===t&&this._setLeader(null),this._masking===t&&this._setMasking(null),e.prev.next=e.next,e.next.prev=e.prev,e.prev=null,e.next=null,e.beforeOpenOff(),e.beforeOpenOff=null,e.afterCloseOff(),e.afterCloseOff=null,this._noticeMap.delete(t),this._length--,!this._length&&this._listener&&(this.context.removeEventListener("pnotify:position",this._listener),this._listener=null),!this._length&&this._overlayOpen&&this._removeOverlay(),-1!==["open","opening","closing"].indexOf(t.getState())&&this._handleNoticeClosed(t),this.fire("afterRemoveNotice",{notice:t})}}},{key:"_setLeader",value:function(t){var e=this;if(this.fire("beforeSetLeader",{leader:t}),this._leaderOff&&(this._leaderOff(),this._leaderOff=null),this._leader=t,this._leader){var n,i=function(){var t=null;e._overlayOpen&&(e._collapsingModalState=!0,e.forEach((function(n){n._preventTimerClose(!1),n!==e._leader&&-1!==["opening","open"].indexOf(n.getState())&&(t||(t=n),n.close(n===t,!1,!0))}),{start:e._leader,dir:"next",skipModuleHandled:!0}),e._removeOverlay()),o&&(clearTimeout(o),o=null),e.forEach((function(n){if(n!==e._leader)return"waiting"===n.getState()||n===t?(e._setMasking(n,!!t),!1):void 0}),{start:e._leader,dir:"next",skipModuleHandled:!0})},o=null,r=function(){o&&(clearTimeout(o),o=null),o=setTimeout((function(){o=null,e._setMasking(null)}),750)};this._leaderOff=(n=[this._leader.on("mouseenter",i),this._leader.on("focusin",i),this._leader.on("mouseleave",r),this._leader.on("focusout",r)],function(){return n.map((function(t){return t()}))}),this.fire("afterSetLeader",{leader:t})}else this.fire("afterSetLeader",{leader:t})}},{key:"_setMasking",value:function(t,e){var n=this;if(this._masking){if(this._masking===t)return;this._masking._setMasking(!1,e)}if(this._maskingOff&&(this._maskingOff(),this._maskingOff=null),this._masking=t,this._masking){this._resetPositionData(),this._leader&&this._positionNotice(this._leader),this._masking._setMasking(!0,e),window.requestAnimationFrame((function(){n._masking&&n._positionNotice(n._masking)}));var i,o=function(){"ish"===n.modal&&(n._insertOverlay(),n._setMasking(null,!0),n.forEach((function(t){t._preventTimerClose(!0),"waiting"===t.getState()&&t.open()}),{start:n._leader,dir:"next",skipModuleHandled:!0}))};this._maskingOff=(i=[this._masking.on("mouseenter",o),this._masking.on("focusin",o)],function(){return i.map((function(t){return t()}))})}}},{key:"_shouldNoticeWait",value:function(t){return this._swapping!==t&&!("ish"===this.modal&&this._overlayOpen)&&this.maxOpen!==1/0&&this._openNotices>=this.maxOpen&&"wait"===this.maxStrategy}},{key:"_insertOverlay",value:function(){var t=this;this._overlay||(this._overlay=document.createElement("div"),this._overlay.classList.add("pnotify-modal-overlay"),this.dir1&&this._overlay.classList.add("pnotify-modal-overlay-".concat(this.dir1)),this.overlayClose&&this._overlay.classList.add("pnotify-modal-overlay-closes"),this.context!==document.body&&(this._overlay.style.height="".concat(this.context.scrollHeight,"px"),this._overlay.style.width="".concat(this.context.scrollWidth,"px")),this._overlay.addEventListener("click",(function(e){if(t.overlayClose){if(t.fire("overlayClose",{clickEvent:e}),e.defaultPrevented)return;t._leader&&t._setLeader(null),t.forEach((function(e){-1===["closed","closing","waiting"].indexOf(e.getState())&&(e.hide||t.overlayClosesPinned?e.close():e.hide||"ish"!==t.modal||(t._leader?e.close(!1,!1,!0):t._setLeader(e)))}),{skipModuleHandled:!0}),t._overlayOpen&&t._removeOverlay()}}))),this._overlay.parentNode!==this.context&&(this.fire("beforeAddOverlay"),this._overlay.classList.remove("pnotify-modal-overlay-in"),this._overlay=this.context.insertBefore(this._overlay,this.context.firstChild),this._overlayOpen=!0,this._overlayInserted=!0,window.requestAnimationFrame((function(){t._overlay.classList.add("pnotify-modal-overlay-in"),t.fire("afterAddOverlay")}))),this._collapsingModalState=!1}},{key:"_removeOverlay",value:function(){var t=this;this._overlay.parentNode&&(this.fire("beforeRemoveOverlay"),this._overlay.classList.remove("pnotify-modal-overlay-in"),this._overlayOpen=!1,setTimeout((function(){t._overlayInserted=!1,t._overlay.parentNode&&(t._overlay.parentNode.removeChild(t._overlay),t.fire("afterRemoveOverlay"))}),250),setTimeout((function(){t._collapsingModalState=!1}),400))}},{key:"notices",get:function(){var t=[];return this.forEach((function(e){return t.push(e)})),t}},{key:"length",get:function(){return this._length}},{key:"leader",get:function(){return this._leader}}]),t}(),$t=function(){for(var t=arguments.length,e=new Array(t),n=0;n1&&void 0!==arguments[1]?arguments[1]:[]));function n(e){F(t,e)}return function(t){for(var i=[],o=0;o1&&void 0!==arguments[1]?arguments[1]:{});"init"===t&&Array.from(a).forEach((function(t){var n=m(t,2),i=n[0];return n[1],"init"in i&&i.init(e)}));var n=f.elem||u&&u.context||document.body;if(!n)return o("pnotify:".concat(t),e),!0;var r=new Event("pnotify:".concat(t),{bubbles:"init"===t||"mount"===t,cancelable:t.startsWith("before")});return r.detail=e,n.dispatchEvent(r),!r.defaultPrevented}function Vt(){var t=u&&u.context||document.body;if(!t)throw new Error("No context to insert this notice into.");if(!f.elem)throw new Error("Trying to insert notice before element is available.");f.elem.parentNode!==t&&t.appendChild(f.elem)}function Xt(){f.elem&&f.elem.parentNode.removeChild(f.elem)}h=function(){Qt("mount"),B&&ue().catch((function(){}))},I().$$.on_mount.push(h),function(t){I().$$.before_update.push(t)}((function(){Qt("update"),"closed"!==Ct&&"waiting"!==Ct&&at!==qt&&(at?qt||ge():ye()),"closed"!==Ct&&"closing"!==Ct&&u&&!u._collapsingModalState&&u.queuePosition(),qt=at}));var Yt,Zt,te,ee,ne,ie,oe,re,se,ae,ce,le=e.open,ue=void 0===le?function(t){if("opening"===Ct)return Ft;if("open"===Ct)return at&&ge(),Promise.resolve();if(!Lt&&u&&u._shouldNoticeWait(i))return Ct="waiting",Promise.reject();if(!Qt("beforeOpen",{immediate:t}))return Promise.reject();var e,o;Ct="opening",n(28,Wt=!1),n(24,St="pnotify-initial pnotify-hidden");var r=new Promise((function(t,n){e=t,o=n}));Ft=r;var s=function(){at&&ge(),Ct="open",Qt("afterOpen",{immediate:t}),Ft=null,e()};return Rt?(s(),Promise.resolve()):(Vt(),window.requestAnimationFrame((function(){if("opening"!==Ct)return o(),void(Ft=null);u&&(n(0,u._animation=!1,u),"top"===u.push&&u._resetPositionData(),u._positionNotice(i),u.queuePosition(0),n(0,u._animation=!0,u)),pe(s,t)})),r)}:le,fe=e.close,de=void 0===fe?function(t,e,o){if("closing"===Ct)return Bt;if("closed"===Ct)return Promise.resolve();var r,s=function(){Qt("beforeDestroy")&&(u&&u._removeNotice(i),i.$destroy(),Qt("afterDestroy"))};if("waiting"===Ct)return o||(Ct="closed",Ot&&!o&&s()),Promise.resolve();if(!Qt("beforeClose",{immediate:t,timerHide:e,waitAfterward:o}))return Promise.reject();Ct="closing",jt=!!e,Mt&&"prevented"!==Mt&&clearTimeout&&clearTimeout(Mt),Mt=null;var a=new Promise((function(t,e){r=t}));return Bt=a,ve((function(){n(26,Pt=!1),jt=!1,Ct=o?"waiting":"closed",Qt("afterClose",{immediate:t,timerHide:e,waitAfterward:o}),Bt=null,r(),o||(Ot?s():bt&&Xt())}),t),a}:fe,he=e.animateIn,pe=void 0===he?function(t,e){Ht="in";var i=function e(n){if(!(n&&f.elem&&n.target!==f.elem||(f.elem&&f.elem.removeEventListener("transitionend",e),Tt&&clearTimeout(Tt),"in"!==Ht))){var i=Rt;if(!i&&f.elem){var o=f.elem.getBoundingClientRect();for(var r in o)if(o[r]>0){i=!0;break}}i?(t&&t.call(),Ht=!1):Tt=setTimeout(e,40)}};if("fade"!==et||e){var o=et;n(2,et="none"),n(24,St="pnotify-in ".concat("fade"===o?"pnotify-fade-in":"")),V().then((function(){n(2,et=o),i()}))}else f.elem&&f.elem.addEventListener("transitionend",i),n(24,St="pnotify-in"),V().then((function(){n(24,St="pnotify-in pnotify-fade-in"),Tt=setTimeout(i,650)}))}:he,me=e.animateOut,ve=void 0===me?function(t,e){Ht="out";var i=function e(i){if(!(i&&f.elem&&i.target!==f.elem||(f.elem&&f.elem.removeEventListener("transitionend",e),Et&&clearTimeout(Et),"out"!==Ht))){var o=Rt;if(!o&&f.elem){var r=f.elem.getBoundingClientRect();for(var s in r)if(r[s]>0){o=!0;break}}f.elem&&f.elem.style.opacity&&"0"!==f.elem.style.opacity&&o?Et=setTimeout(e,40):(n(24,St=""),t&&t.call(),Ht=!1)}};"fade"!==et||e?(n(24,St=""),V().then((function(){i()}))):(f.elem&&f.elem.addEventListener("transitionend",i),n(24,St="pnotify-in"),Et=setTimeout(i,650))}:me;function ye(){Mt&&"prevented"!==Mt&&(clearTimeout(Mt),Mt=null),Et&&clearTimeout(Et),"closing"===Ct&&(Ct="open",Ht=!1,n(24,St="fade"===et?"pnotify-in pnotify-fade-in":"pnotify-in"))}function ge(){"prevented"!==Mt&&(ye(),lt!==1/0&&(Mt=setTimeout((function(){return de(!1,!0)}),isNaN(lt)?0:lt)))}return t.$$set=function(t){"modules"in t&&n(46,a=t.modules),"stack"in t&&n(0,u=t.stack),"type"in t&&n(4,y=t.type),"title"in t&&n(5,$=t.title),"titleTrusted"in t&&n(6,k=t.titleTrusted),"text"in t&&n(7,b=t.text),"textTrusted"in t&&n(8,O=t.textTrusted),"styling"in t&&n(47,M=t.styling),"icons"in t&&n(48,E=t.icons),"mode"in t&&n(9,S=t.mode),"addClass"in t&&n(10,P=t.addClass),"addModalClass"in t&&n(11,L=t.addModalClass),"addModelessClass"in t&&n(12,W=t.addModelessClass),"autoOpen"in t&&n(49,B=t.autoOpen),"width"in t&&n(50,G=t.width),"minHeight"in t&&n(51,K=t.minHeight),"maxTextHeight"in t&&n(52,X=t.maxTextHeight),"icon"in t&&n(13,Z=t.icon),"animation"in t&&n(2,et=t.animation),"animateSpeed"in t&&n(14,it=t.animateSpeed),"shadow"in t&&n(15,rt=t.shadow),"hide"in t&&n(3,at=t.hide),"delay"in t&&n(53,lt=t.delay),"mouseReset"in t&&n(54,ft=t.mouseReset),"closer"in t&&n(16,ht=t.closer),"closerHover"in t&&n(17,mt=t.closerHover),"sticker"in t&&n(18,yt=t.sticker),"stickerHover"in t&&n(19,$t=t.stickerHover),"labels"in t&&n(20,kt=t.labels),"remove"in t&&n(55,bt=t.remove),"destroy"in t&&n(56,Ot=t.destroy),"open"in t&&n(59,ue=t.open),"close"in t&&n(23,de=t.close),"animateIn"in t&&n(60,pe=t.animateIn),"animateOut"in t&&n(61,ve=t.animateOut)},t.$$.update=function(){524288&t.$$.dirty[1]&&n(31,Yt="string"==typeof G?"width: ".concat(G,";"):""),1048576&t.$$.dirty[1]&&n(32,Zt="string"==typeof K?"min-height: ".concat(K,";"):""),2097152&t.$$.dirty[1]&&n(33,te="string"==typeof X?"max-height: ".concat(X,";"):""),32&t.$$.dirty[0]&&n(34,ee=$ instanceof HTMLElement),128&t.$$.dirty[0]&&n(35,ne=b instanceof HTMLElement),1&t.$$.dirty[0]|1792&t.$$.dirty[3]&&Gt!==u&&(Gt&&(Gt._removeNotice(i),n(30,zt=!1),Jt(),Kt()),u&&(u._addNotice(i),n(102,Jt=u.on("beforeAddOverlay",(function(){n(30,zt=!0),Qt("enterModal")}))),n(103,Kt=u.on("afterRemoveOverlay",(function(){n(30,zt=!1),Qt("leaveModal")})))),n(101,Gt=u)),1073748992&t.$$.dirty[0]&&n(36,ie=P.match(/\bnonblock\b/)||L.match(/\bnonblock\b/)&&zt||W.match(/\bnonblock\b/)&&!zt),1&t.$$.dirty[0]&&n(37,oe=u&&u.dir1?"pnotify-stack-".concat(u.dir1):""),32768&t.$$.dirty[1]&&n(38,re=Array.from(a).filter((function(t){var e=m(t,2),n=e[0];return e[1],"PrependContainer"===n.position}))),32768&t.$$.dirty[1]&&n(39,se=Array.from(a).filter((function(t){var e=m(t,2),n=e[0];return e[1],"PrependContent"===n.position}))),32768&t.$$.dirty[1]&&n(40,ae=Array.from(a).filter((function(t){var e=m(t,2),n=e[0];return e[1],"AppendContent"===n.position}))),32768&t.$$.dirty[1]&&n(41,ce=Array.from(a).filter((function(t){var e=m(t,2),n=e[0];return e[1],"AppendContainer"===n.position}))),34&t.$$.dirty[0]|8&t.$$.dirty[1]&&ee&&f.titleContainer&&f.titleContainer.appendChild($),130&t.$$.dirty[0]|16&t.$$.dirty[1]&&ne&&f.textContainer&&f.textContainer.appendChild(b)},[u,f,et,at,y,$,k,b,O,S,P,L,W,Z,it,rt,ht,mt,yt,$t,kt,function(t){return"string"==typeof M?"".concat(M,"-").concat(t):t in M?M[t]:"".concat(M.prefix,"-").concat(t)},function(t){return"string"==typeof E?"".concat(E,"-icon-").concat(t):t in E?E[t]:"".concat(E.prefix,"-icon-").concat(t)},de,St,Nt,Pt,At,Wt,Dt,zt,Yt,Zt,te,ee,ne,ie,oe,re,se,ae,ce,i,r,function(t){if(n(26,Pt=!0),ft&&"closing"===Ct){if(!jt)return;ye()}at&&ft&&ye()},function(t){n(26,Pt=!1),at&&ft&&"out"!==Ht&&-1!==["open","opening"].indexOf(Ct)&&ge()},a,M,E,B,G,K,X,lt,ft,bt,Ot,function(){return Ct},function(){return Mt},ue,pe,ve,ye,ge,function(t){t?(ye(),Mt="prevented"):"prevented"===Mt&&(Mt=null,"open"===Ct&&at&&ge())},function(){return i.$on.apply(i,arguments)},function(){return i.$set.apply(i,arguments)},function(t,e){o(t,e)},function(t){for(var e=0;e<(arguments.length<=1?0:arguments.length-1);e++){var i=e+1<1||arguments.length<=e+1?void 0:arguments[e+1];-1===At[t].indexOf(i)&&At[t].push(i)}n(27,At)},function(t){for(var e=0;e<(arguments.length<=1?0:arguments.length-1);e++){var i=e+1<1||arguments.length<=e+1?void 0:arguments[e+1],o=At[t].indexOf(i);-1!==o&&At[t].splice(o,1)}n(27,At)},function(t){for(var e=0;e<(arguments.length<=1?0:arguments.length-1);e++){var n=e+1<1||arguments.length<=e+1?void 0:arguments[e+1];if(-1===At[t].indexOf(n))return!1}return!0},function(){return Lt},function(t){return Lt=t},function(){return Rt},function(t){return Rt=t},function(t){return Ht=t},function(){return St},function(t){return n(24,St=t)},function(){return Nt},function(t){return n(25,Nt=t)},function(t,e,i){if(It&&clearTimeout(It),Wt!==t)if(t)n(28,Wt=!0),n(29,Dt=!!e),Vt(),V().then((function(){window.requestAnimationFrame((function(){if(Wt)if(e&&i)i();else{n(29,Dt=!0);var t=function t(){f.elem&&f.elem.removeEventListener("transitionend",t),It&&clearTimeout(It),Dt&&i&&i()};f.elem&&f.elem.addEventListener("transitionend",t),It=setTimeout(t,650)}}))}));else if(e)n(28,Wt=!1),n(29,Dt=!1),bt&&-1===["open","opening","closing"].indexOf(Ct)&&Xt(),i&&i();else{var o=function t(){f.elem&&f.elem.removeEventListener("transitionend",t),It&&clearTimeout(It),Dt||(n(28,Wt=!1),bt&&-1===["open","opening","closing"].indexOf(Ct)&&Xt(),i&&i())};n(29,Dt=!1),f.elem&&f.elem.addEventListener("transitionend",o),f.elem&&f.elem.style.opacity,It=setTimeout(o,650)}},function(){return de(!1)},function(){return n(3,at=!at)},function(t){z[t?"unshift":"push"]((function(){f.iconContainer=t,n(1,f)}))},function(t){z[t?"unshift":"push"]((function(){f.titleContainer=t,n(1,f)}))},function(t){z[t?"unshift":"push"]((function(){f.textContainer=t,n(1,f)}))},function(t){z[t?"unshift":"push"]((function(){f.content=t,n(1,f)}))},function(t){z[t?"unshift":"push"]((function(){f.container=t,n(1,f)}))},function(t){z[t?"unshift":"push"]((function(){f.elem=t,n(1,f)}))}]}window&&document.body?Gt():document.addEventListener("DOMContentLoaded",Gt);var Kt=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&u(t,e)}(s,t);var e,n,o=(e=s,n=f(),function(){var t,i=l(e);if(n){var o=l(this).constructor;t=Reflect.construct(i,arguments,o)}else t=i.apply(this,arguments);return p(this,t)});function s(t){var e;return i(this,s),function(t,e,n,i,o,r){var s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:[-1],a=R;D(t);var c=e.props||{},l=t.$$={fragment:null,ctx:null,props:r,update:$,not_equal:o,bound:x(),on_mount:[],on_destroy:[],before_update:[],after_update:[],context:new Map(a?a.$$.context:[]),callbacks:x(),dirty:s,skip_bound:!1},u=!1;if(l.ctx=n?n(t,c,(function(e,n){var i=!(arguments.length<=2)&&arguments.length-2?arguments.length<=2?void 0:arguments[2]:n;return l.ctx&&o(l.ctx[e],l.ctx[e]=i)&&(!l.skip_bound&&l.bound[e]&&l.bound[e](i),u&&vt(t,e)),n})):[],l.update(),u=!0,b(l.before_update),l.fragment=!!i&&i(l.ctx),e.target){if(e.hydrate){var f=A(e.target);l.fragment&&l.fragment.l(f),f.forEach(T)}else l.fragment&&l.fragment.c();e.intro&&st(t.$$.fragment),pt(t,e.target,e.anchor),tt()}D(a)}(h(e=o.call(this)),t,Jt,It,O,{modules:46,stack:0,refs:1,type:4,title:5,titleTrusted:6,text:7,textTrusted:8,styling:47,icons:48,mode:9,addClass:10,addModalClass:11,addModelessClass:12,autoOpen:49,width:50,minHeight:51,maxTextHeight:52,icon:13,animation:2,animateSpeed:14,shadow:15,hide:3,delay:53,mouseReset:54,closer:16,closerHover:17,sticker:18,stickerHover:19,labels:20,remove:55,destroy:56,getState:57,getTimer:58,getStyle:21,getIcon:22,open:59,close:23,animateIn:60,animateOut:61,cancelClose:62,queueClose:63,_preventTimerClose:64,on:65,update:66,fire:67,addModuleClass:68,removeModuleClass:69,hasModuleClass:70,getModuleHandled:71,setModuleHandled:72,getModuleOpen:73,setModuleOpen:74,setAnimating:75,getAnimatingClass:76,setAnimatingClass:77,_getMoveClass:78,_setMoveClass:79,_setMasking:80},[-1,-1,-1,-1]),e}return r(s,[{key:"modules",get:function(){return this.$$.ctx[46]},set:function(t){this.$set({modules:t}),tt()}},{key:"stack",get:function(){return this.$$.ctx[0]},set:function(t){this.$set({stack:t}),tt()}},{key:"refs",get:function(){return this.$$.ctx[1]}},{key:"type",get:function(){return this.$$.ctx[4]},set:function(t){this.$set({type:t}),tt()}},{key:"title",get:function(){return this.$$.ctx[5]},set:function(t){this.$set({title:t}),tt()}},{key:"titleTrusted",get:function(){return this.$$.ctx[6]},set:function(t){this.$set({titleTrusted:t}),tt()}},{key:"text",get:function(){return this.$$.ctx[7]},set:function(t){this.$set({text:t}),tt()}},{key:"textTrusted",get:function(){return this.$$.ctx[8]},set:function(t){this.$set({textTrusted:t}),tt()}},{key:"styling",get:function(){return this.$$.ctx[47]},set:function(t){this.$set({styling:t}),tt()}},{key:"icons",get:function(){return this.$$.ctx[48]},set:function(t){this.$set({icons:t}),tt()}},{key:"mode",get:function(){return this.$$.ctx[9]},set:function(t){this.$set({mode:t}),tt()}},{key:"addClass",get:function(){return this.$$.ctx[10]},set:function(t){this.$set({addClass:t}),tt()}},{key:"addModalClass",get:function(){return this.$$.ctx[11]},set:function(t){this.$set({addModalClass:t}),tt()}},{key:"addModelessClass",get:function(){return this.$$.ctx[12]},set:function(t){this.$set({addModelessClass:t}),tt()}},{key:"autoOpen",get:function(){return this.$$.ctx[49]},set:function(t){this.$set({autoOpen:t}),tt()}},{key:"width",get:function(){return this.$$.ctx[50]},set:function(t){this.$set({width:t}),tt()}},{key:"minHeight",get:function(){return this.$$.ctx[51]},set:function(t){this.$set({minHeight:t}),tt()}},{key:"maxTextHeight",get:function(){return this.$$.ctx[52]},set:function(t){this.$set({maxTextHeight:t}),tt()}},{key:"icon",get:function(){return this.$$.ctx[13]},set:function(t){this.$set({icon:t}),tt()}},{key:"animation",get:function(){return this.$$.ctx[2]},set:function(t){this.$set({animation:t}),tt()}},{key:"animateSpeed",get:function(){return this.$$.ctx[14]},set:function(t){this.$set({animateSpeed:t}),tt()}},{key:"shadow",get:function(){return this.$$.ctx[15]},set:function(t){this.$set({shadow:t}),tt()}},{key:"hide",get:function(){return this.$$.ctx[3]},set:function(t){this.$set({hide:t}),tt()}},{key:"delay",get:function(){return this.$$.ctx[53]},set:function(t){this.$set({delay:t}),tt()}},{key:"mouseReset",get:function(){return this.$$.ctx[54]},set:function(t){this.$set({mouseReset:t}),tt()}},{key:"closer",get:function(){return this.$$.ctx[16]},set:function(t){this.$set({closer:t}),tt()}},{key:"closerHover",get:function(){return this.$$.ctx[17]},set:function(t){this.$set({closerHover:t}),tt()}},{key:"sticker",get:function(){return this.$$.ctx[18]},set:function(t){this.$set({sticker:t}),tt()}},{key:"stickerHover",get:function(){return this.$$.ctx[19]},set:function(t){this.$set({stickerHover:t}),tt()}},{key:"labels",get:function(){return this.$$.ctx[20]},set:function(t){this.$set({labels:t}),tt()}},{key:"remove",get:function(){return this.$$.ctx[55]},set:function(t){this.$set({remove:t}),tt()}},{key:"destroy",get:function(){return this.$$.ctx[56]},set:function(t){this.$set({destroy:t}),tt()}},{key:"getState",get:function(){return this.$$.ctx[57]}},{key:"getTimer",get:function(){return this.$$.ctx[58]}},{key:"getStyle",get:function(){return this.$$.ctx[21]}},{key:"getIcon",get:function(){return this.$$.ctx[22]}},{key:"open",get:function(){return this.$$.ctx[59]},set:function(t){this.$set({open:t}),tt()}},{key:"close",get:function(){return this.$$.ctx[23]},set:function(t){this.$set({close:t}),tt()}},{key:"animateIn",get:function(){return this.$$.ctx[60]},set:function(t){this.$set({animateIn:t}),tt()}},{key:"animateOut",get:function(){return this.$$.ctx[61]},set:function(t){this.$set({animateOut:t}),tt()}},{key:"cancelClose",get:function(){return this.$$.ctx[62]}},{key:"queueClose",get:function(){return this.$$.ctx[63]}},{key:"_preventTimerClose",get:function(){return this.$$.ctx[64]}},{key:"on",get:function(){return this.$$.ctx[65]}},{key:"update",get:function(){return this.$$.ctx[66]}},{key:"fire",get:function(){return this.$$.ctx[67]}},{key:"addModuleClass",get:function(){return this.$$.ctx[68]}},{key:"removeModuleClass",get:function(){return this.$$.ctx[69]}},{key:"hasModuleClass",get:function(){return this.$$.ctx[70]}},{key:"getModuleHandled",get:function(){return this.$$.ctx[71]}},{key:"setModuleHandled",get:function(){return this.$$.ctx[72]}},{key:"getModuleOpen",get:function(){return this.$$.ctx[73]}},{key:"setModuleOpen",get:function(){return this.$$.ctx[74]}},{key:"setAnimating",get:function(){return this.$$.ctx[75]}},{key:"getAnimatingClass",get:function(){return this.$$.ctx[76]}},{key:"setAnimatingClass",get:function(){return this.$$.ctx[77]}},{key:"_getMoveClass",get:function(){return this.$$.ctx[78]}},{key:"_setMoveClass",get:function(){return this.$$.ctx[79]}},{key:"_setMasking",get:function(){return this.$$.ctx[80]}}]),s}(yt);t.Stack=gt,t.alert=function(t){return $t(qt(t))},t.default=Kt,t.defaultModules=zt,t.defaultStack=Bt,t.defaults=Ut,t.error=function(t){return $t(qt(t,"error"))},t.info=function(t){return $t(qt(t,"info"))},t.notice=function(t){return $t(qt(t,"notice"))},t.success=function(t){return $t(qt(t,"success"))},Object.defineProperty(t,"__esModule",{value:!0})}(e)}(0,i.exports);var o=i.exports,r=function(){function t(){}return t.prototype.success=function(t,e,n){this.flash("success",t,e,n)},t.prototype.info=function(t,e,n){this.flash("info",t,e,n)},t.prototype.warning=function(t,e,n){this.flash("warning",t,e,n)},t.prototype.error=function(t,e,n){this.flash("error",t,e,n)},t.prototype.flash=function(t,e,n,i){var o=this.createNotification(t,e,n,i);this.renderOptions({}),this.render({notification:o})},t.prototype.createNotification=function(t,e,n,i){if("object"==typeof t?(t=(i=t).type,e=i.message,n=i.title):"object"==typeof e?(e=(i=e).message,n=i.title):"object"==typeof n&&(n=(i=n).title),void 0===e)throw new Error("message option is required");return{type:t||"info",message:e,title:n,options:i}},t.prototype.render=function(t){var n=t.notification;n.type=n.type||"info";var i,r=e({text:n.title},n.options);switch(r=e(e({},r),{text:(null==r?void 0:r.text)||n.message}),n.type){case"success":i=o.success(r);break;case"alert":i=o.alert(r);break;case"info":i=o.info(r);break;case"error":i=o.error(r);break;default:i=o.notice(r)}i.refs.container&&(i.refs.container.dataset.turboCache="false")},t.prototype.updateDefaultOptions=function(t,e){Object.entries(e).forEach((function(e){var n=e[0],i=e[1];t[n]=i}))},t.prototype.renderOptions=function(t){this.updateDefaultOptions(o.defaults,e({delay:t.delay||5e3},t))},t}(),s=new r;return t.addFactory("pnotify",s),s})); +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("@flasher/flasher")):"function"==typeof define&&define.amd?define(["@flasher/flasher"],e):((t="undefined"!=typeof globalThis?globalThis:t||self).flasher=t.flasher||{},t.flasher.pnotify=e(t.flasher))}(this,(function(t){"use strict";var e=function(){return e=Object.assign||function(t){for(var e,n=1,i=arguments.length;nt.length)&&(e=t.length);for(var n=0,i=new Array(e);n0&&void 0!==arguments[0]?arguments[0]:null;i(this,t),this.a=e,this.e=this.n=null}return r(t,[{key:"m",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;this.e||(this.e=E(e.nodeName),this.t=e,this.h(t)),this.i(n)}},{key:"h",value:function(t){this.e.innerHTML=t,this.n=Array.from(this.e.childNodes)}},{key:"i",value:function(t){for(var e=0;eg.get(T)?(b.add(M),w(O)):(x.add(T),d--):(c(C,s),d--)}for(;d--;){var E=t[d];y.has(E.key)||c(E,s)}for(;h;)w(v[h-1]);return v}function ft(t,e){for(var n={},i={},o={$$scope:1},r=t.length;r--;){var s=t[r],a=e[r];if(a){for(var c in s)c in a||(i[c]=1);for(var l in a)o[l]||(n[l]=a[l],o[l]=1);t[r]=a}else for(var u in s)o[u]=1}for(var f in i)f in n||(n[f]=void 0);return n}function dt(t){return"object"===e(t)&&null!==t?t:{}}function ht(t){t&&t.c()}function pt(t,e,n){var i=t.$$,o=i.fragment,r=i.on_mount,s=i.on_destroy,a=i.after_update;o&&o.m(e,n),X((function(){var e=r.map(k).filter(w);s?s.push.apply(s,v(e)):b(e),t.$$.on_mount=[]})),a.forEach(X)}function mt(t,e){var n=t.$$;null!==n.fragment&&(b(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function vt(t,e){-1===t.$$.dirty[0]&&(B.push(t),Q(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<1&&void 0!==arguments[1]?arguments[1]:{},i=n.start,o=void 0===i?"oldest":i,r=n.dir,s=void 0===r?"newer":r,a=n.skipModuleHandled,c=void 0!==a&&a;if("head"===o||"newest"===o&&"top"===this.push||"oldest"===o&&"bottom"===this.push)e=this._noticeHead.next;else if("tail"===o||"newest"===o&&"bottom"===this.push||"oldest"===o&&"top"===this.push)e=this._noticeTail.prev;else{if(!this._noticeMap.has(o))throw new Error("Invalid start param.");e=this._noticeMap.get(o)}for(;e.notice;){var l=e.notice;if("prev"===s||"top"===this.push&&"newer"===s||"bottom"===this.push&&"older"===s)e=e.prev;else{if(!("next"===s||"top"===this.push&&"older"===s||"bottom"===this.push&&"newer"===s))throw new Error("Invalid dir param.");e=e.next}if(!(c&&l.getModuleHandled()||!1!==t(l)))break}}},{key:"close",value:function(t){this.forEach((function(e){return e.close(t,!1,!1)}))}},{key:"open",value:function(t){this.forEach((function(e){return e.open(t)}))}},{key:"openLast",value:function(){this.forEach((function(t){if(-1===["opening","open","waiting"].indexOf(t.getState()))return t.open(),!1}),{start:"newest",dir:"older"})}},{key:"swap",value:function(t,e){var n=this,i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return-1===["open","opening","closing"].indexOf(t.getState())?Promise.reject():(this._swapping=e,t.close(i,!1,o).then((function(){return e.open(i)})).finally((function(){n._swapping=!1})))}},{key:"on",value:function(t,e){var n=this;return t in this._callbacks||(this._callbacks[t]=[]),this._callbacks[t].push(e),function(){n._callbacks[t].splice(n._callbacks[t].indexOf(e),1)}}},{key:"fire",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e.stack=this,t in this._callbacks&&this._callbacks[t].forEach((function(t){return t(e)}))}},{key:"position",value:function(){var t=this;this.positioned&&this._length>0?(this.fire("beforePosition"),this._resetPositionData(),this.forEach((function(e){t._positionNotice(e)}),{start:"head",dir:"next",skipModuleHandled:!0}),this.fire("afterPosition")):(delete this._nextpos1,delete this._nextpos2)}},{key:"queuePosition",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;this._posTimer&&clearTimeout(this._posTimer),this._posTimer=setTimeout((function(){return t.position()}),e)}},{key:"_resetPositionData",value:function(){this._nextpos1=this.firstpos1,this._nextpos2=this.firstpos2,this._addpos2=0}},{key:"_positionNotice",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t===this._masking;if(this.positioned){var n=t.refs.elem;if(n&&(n.classList.contains("pnotify-in")||n.classList.contains("pnotify-initial")||e)){var i=[this.firstpos1,this.firstpos2,this._nextpos1,this._nextpos2,this._addpos2],o=i[0],r=i[1],s=i[2],a=i[3],c=i[4];n.getBoundingClientRect(),!this._animation||e||this._collapsingModalState?t._setMoveClass(""):t._setMoveClass("pnotify-move");var l,u=this.context===document.body?window.innerHeight:this.context.scrollHeight,f=this.context===document.body?window.innerWidth:this.context.scrollWidth;if(this.dir1){var d;switch(l={down:"top",up:"bottom",left:"right",right:"left"}[this.dir1],this.dir1){case"down":d=n.offsetTop;break;case"up":d=u-n.scrollHeight-n.offsetTop;break;case"left":d=f-n.scrollWidth-n.offsetLeft;break;case"right":d=n.offsetLeft}null==o&&(s=o=d)}if(this.dir1&&this.dir2){var h,p={down:"top",up:"bottom",left:"right",right:"left"}[this.dir2];switch(this.dir2){case"down":h=n.offsetTop;break;case"up":h=u-n.scrollHeight-n.offsetTop;break;case"left":h=f-n.scrollWidth-n.offsetLeft;break;case"right":h=n.offsetLeft}if(null==r&&(a=r=h),!e){var m=s+n.offsetHeight+this.spacing1,v=s+n.offsetWidth+this.spacing1;(("down"===this.dir1||"up"===this.dir1)&&m>u||("left"===this.dir1||"right"===this.dir1)&&v>f)&&(s=o,a+=c+this.spacing2,c=0)}switch(null!=a&&(n.style[p]="".concat(a,"px"),this._animation||n.style[p]),this.dir2){case"down":case"up":n.offsetHeight+(parseFloat(n.style.marginTop,10)||0)+(parseFloat(n.style.marginBottom,10)||0)>c&&(c=n.offsetHeight);break;case"left":case"right":n.offsetWidth+(parseFloat(n.style.marginLeft,10)||0)+(parseFloat(n.style.marginRight,10)||0)>c&&(c=n.offsetWidth)}}else if(this.dir1){var y,g;switch(this.dir1){case"down":case"up":g=["left","right"],y=this.context.scrollWidth/2-n.offsetWidth/2;break;case"left":case"right":g=["top","bottom"],y=u/2-n.offsetHeight/2}n.style[g[0]]="".concat(y,"px"),n.style[g[1]]="auto",this._animation||n.style[g[0]]}if(this.dir1)switch(null!=s&&(n.style[l]="".concat(s,"px"),this._animation||n.style[l]),this.dir1){case"down":case"up":s+=n.offsetHeight+this.spacing1;break;case"left":case"right":s+=n.offsetWidth+this.spacing1}else{var $=f/2-n.offsetWidth/2,_=u/2-n.offsetHeight/2;n.style.left="".concat($,"px"),n.style.top="".concat(_,"px"),this._animation||n.style.left}e||(this.firstpos1=o,this.firstpos2=r,this._nextpos1=s,this._nextpos2=a,this._addpos2=c)}}}},{key:"_addNotice",value:function(t){var e=this;this.fire("beforeAddNotice",{notice:t});var n=function(){if(e.fire("beforeOpenNotice",{notice:t}),t.getModuleHandled())e.fire("afterOpenNotice",{notice:t});else{if(e._openNotices++,("ish"!==e.modal||!e._overlayOpen)&&e.maxOpen!==1/0&&e._openNotices>e.maxOpen&&"close"===e.maxStrategy){var n=e._openNotices-e.maxOpen;e.forEach((function(t){if(-1!==["opening","open"].indexOf(t.getState()))return t.close(!1,!1,e.maxClosureCausesWait),t===e._leader&&e._setLeader(null),!!--n}))}!0===e.modal&&e._insertOverlay(),"ish"!==e.modal||e._leader&&-1!==["opening","open","closing"].indexOf(e._leader.getState())||e._setLeader(t),"ish"===e.modal&&e._overlayOpen&&t._preventTimerClose(!0),e.fire("afterOpenNotice",{notice:t})}},i={notice:t,prev:null,next:null,beforeOpenOff:t.on("pnotify:beforeOpen",n),afterCloseOff:t.on("pnotify:afterClose",(function(){if(e.fire("beforeCloseNotice",{notice:t}),t.getModuleHandled())e.fire("afterCloseNotice",{notice:t});else{if(e._openNotices--,"ish"===e.modal&&t===e._leader&&(e._setLeader(null),e._masking&&e._setMasking(null)),!e._swapping&&e.maxOpen!==1/0&&e._openNotices=e.maxOpen))return n=!0,!1};"wait"===e.maxStrategy?(e.forEach(i,{start:t,dir:"next"}),n||e.forEach(i,{start:t,dir:"prev"})):"close"===e.maxStrategy&&e.maxClosureCausesWait&&(e.forEach(i,{start:t,dir:"older"}),n||e.forEach(i,{start:t,dir:"newer"}))}e._openNotices<=0?(e._openNotices=0,e._resetPositionData(),e._overlayOpen&&!e._swapping&&e._removeOverlay()):e._collapsingModalState||e.queuePosition(0),e.fire("afterCloseNotice",{notice:t})}}))};if("top"===this.push?(i.next=this._noticeHead.next,i.prev=this._noticeHead,i.next.prev=i,i.prev.next=i):(i.prev=this._noticeTail.prev,i.next=this._noticeTail,i.prev.next=i,i.next.prev=i),this._noticeMap.set(t,i),this._length++,this._listener||(this._listener=function(){return e.position()},this.context.addEventListener("pnotify:position",this._listener)),-1!==["open","opening","closing"].indexOf(t.getState()))n();else if("ish"===this.modal&&this.modalishFlash&&this._shouldNoticeWait(t))var o=t.on("pnotify:mount",(function(){o(),t._setMasking(!0,!1,(function(){t._setMasking(!1)})),e._resetPositionData(),e._positionNotice(e._leader),window.requestAnimationFrame((function(){e._positionNotice(t,!0)}))}));this.fire("afterAddNotice",{notice:t})}},{key:"_removeNotice",value:function(t){if(this._noticeMap.has(t)){this.fire("beforeRemoveNotice",{notice:t});var e=this._noticeMap.get(t);this._leader===t&&this._setLeader(null),this._masking===t&&this._setMasking(null),e.prev.next=e.next,e.next.prev=e.prev,e.prev=null,e.next=null,e.beforeOpenOff(),e.beforeOpenOff=null,e.afterCloseOff(),e.afterCloseOff=null,this._noticeMap.delete(t),this._length--,!this._length&&this._listener&&(this.context.removeEventListener("pnotify:position",this._listener),this._listener=null),!this._length&&this._overlayOpen&&this._removeOverlay(),-1!==["open","opening","closing"].indexOf(t.getState())&&this._handleNoticeClosed(t),this.fire("afterRemoveNotice",{notice:t})}}},{key:"_setLeader",value:function(t){var e=this;if(this.fire("beforeSetLeader",{leader:t}),this._leaderOff&&(this._leaderOff(),this._leaderOff=null),this._leader=t,this._leader){var n,i=function(){var t=null;e._overlayOpen&&(e._collapsingModalState=!0,e.forEach((function(n){n._preventTimerClose(!1),n!==e._leader&&-1!==["opening","open"].indexOf(n.getState())&&(t||(t=n),n.close(n===t,!1,!0))}),{start:e._leader,dir:"next",skipModuleHandled:!0}),e._removeOverlay()),o&&(clearTimeout(o),o=null),e.forEach((function(n){if(n!==e._leader)return"waiting"===n.getState()||n===t?(e._setMasking(n,!!t),!1):void 0}),{start:e._leader,dir:"next",skipModuleHandled:!0})},o=null,r=function(){o&&(clearTimeout(o),o=null),o=setTimeout((function(){o=null,e._setMasking(null)}),750)};this._leaderOff=(n=[this._leader.on("mouseenter",i),this._leader.on("focusin",i),this._leader.on("mouseleave",r),this._leader.on("focusout",r)],function(){return n.map((function(t){return t()}))}),this.fire("afterSetLeader",{leader:t})}else this.fire("afterSetLeader",{leader:t})}},{key:"_setMasking",value:function(t,e){var n=this;if(this._masking){if(this._masking===t)return;this._masking._setMasking(!1,e)}if(this._maskingOff&&(this._maskingOff(),this._maskingOff=null),this._masking=t,this._masking){this._resetPositionData(),this._leader&&this._positionNotice(this._leader),this._masking._setMasking(!0,e),window.requestAnimationFrame((function(){n._masking&&n._positionNotice(n._masking)}));var i,o=function(){"ish"===n.modal&&(n._insertOverlay(),n._setMasking(null,!0),n.forEach((function(t){t._preventTimerClose(!0),"waiting"===t.getState()&&t.open()}),{start:n._leader,dir:"next",skipModuleHandled:!0}))};this._maskingOff=(i=[this._masking.on("mouseenter",o),this._masking.on("focusin",o)],function(){return i.map((function(t){return t()}))})}}},{key:"_shouldNoticeWait",value:function(t){return this._swapping!==t&&!("ish"===this.modal&&this._overlayOpen)&&this.maxOpen!==1/0&&this._openNotices>=this.maxOpen&&"wait"===this.maxStrategy}},{key:"_insertOverlay",value:function(){var t=this;this._overlay||(this._overlay=document.createElement("div"),this._overlay.classList.add("pnotify-modal-overlay"),this.dir1&&this._overlay.classList.add("pnotify-modal-overlay-".concat(this.dir1)),this.overlayClose&&this._overlay.classList.add("pnotify-modal-overlay-closes"),this.context!==document.body&&(this._overlay.style.height="".concat(this.context.scrollHeight,"px"),this._overlay.style.width="".concat(this.context.scrollWidth,"px")),this._overlay.addEventListener("click",(function(e){if(t.overlayClose){if(t.fire("overlayClose",{clickEvent:e}),e.defaultPrevented)return;t._leader&&t._setLeader(null),t.forEach((function(e){-1===["closed","closing","waiting"].indexOf(e.getState())&&(e.hide||t.overlayClosesPinned?e.close():e.hide||"ish"!==t.modal||(t._leader?e.close(!1,!1,!0):t._setLeader(e)))}),{skipModuleHandled:!0}),t._overlayOpen&&t._removeOverlay()}}))),this._overlay.parentNode!==this.context&&(this.fire("beforeAddOverlay"),this._overlay.classList.remove("pnotify-modal-overlay-in"),this._overlay=this.context.insertBefore(this._overlay,this.context.firstChild),this._overlayOpen=!0,this._overlayInserted=!0,window.requestAnimationFrame((function(){t._overlay.classList.add("pnotify-modal-overlay-in"),t.fire("afterAddOverlay")}))),this._collapsingModalState=!1}},{key:"_removeOverlay",value:function(){var t=this;this._overlay.parentNode&&(this.fire("beforeRemoveOverlay"),this._overlay.classList.remove("pnotify-modal-overlay-in"),this._overlayOpen=!1,setTimeout((function(){t._overlayInserted=!1,t._overlay.parentNode&&(t._overlay.parentNode.removeChild(t._overlay),t.fire("afterRemoveOverlay"))}),250),setTimeout((function(){t._collapsingModalState=!1}),400))}},{key:"notices",get:function(){var t=[];return this.forEach((function(e){return t.push(e)})),t}},{key:"length",get:function(){return this._length}},{key:"leader",get:function(){return this._leader}}]),t}(),$t=function(){for(var t=arguments.length,e=new Array(t),n=0;n1&&void 0!==arguments[1]?arguments[1]:[]));function n(e){F(t,e)}return function(t){for(var i=[],o=0;o1&&void 0!==arguments[1]?arguments[1]:{});"init"===t&&Array.from(a).forEach((function(t){var n=m(t,2),i=n[0];return n[1],"init"in i&&i.init(e)}));var n=f.elem||u&&u.context||document.body;if(!n)return o("pnotify:".concat(t),e),!0;var r=new Event("pnotify:".concat(t),{bubbles:"init"===t||"mount"===t,cancelable:t.startsWith("before")});return r.detail=e,n.dispatchEvent(r),!r.defaultPrevented}function Vt(){var t=u&&u.context||document.body;if(!t)throw new Error("No context to insert this notice into.");if(!f.elem)throw new Error("Trying to insert notice before element is available.");f.elem.parentNode!==t&&t.appendChild(f.elem)}function Xt(){f.elem&&f.elem.parentNode.removeChild(f.elem)}h=function(){Qt("mount"),B&&ue().catch((function(){}))},I().$$.on_mount.push(h),function(t){I().$$.before_update.push(t)}((function(){Qt("update"),"closed"!==Ct&&"waiting"!==Ct&&at!==qt&&(at?qt||ge():ye()),"closed"!==Ct&&"closing"!==Ct&&u&&!u._collapsingModalState&&u.queuePosition(),qt=at}));var Yt,Zt,te,ee,ne,ie,oe,re,se,ae,ce,le=e.open,ue=void 0===le?function(t){if("opening"===Ct)return Ft;if("open"===Ct)return at&&ge(),Promise.resolve();if(!At&&u&&u._shouldNoticeWait(i))return Ct="waiting",Promise.reject();if(!Qt("beforeOpen",{immediate:t}))return Promise.reject();var e,o;Ct="opening",n(28,Wt=!1),n(24,St="pnotify-initial pnotify-hidden");var r=new Promise((function(t,n){e=t,o=n}));Ft=r;var s=function(){at&&ge(),Ct="open",Qt("afterOpen",{immediate:t}),Ft=null,e()};return Rt?(s(),Promise.resolve()):(Vt(),window.requestAnimationFrame((function(){if("opening"!==Ct)return o(),void(Ft=null);u&&(n(0,u._animation=!1,u),"top"===u.push&&u._resetPositionData(),u._positionNotice(i),u.queuePosition(0),n(0,u._animation=!0,u)),pe(s,t)})),r)}:le,fe=e.close,de=void 0===fe?function(t,e,o){if("closing"===Ct)return Bt;if("closed"===Ct)return Promise.resolve();var r,s=function(){Qt("beforeDestroy")&&(u&&u._removeNotice(i),i.$destroy(),Qt("afterDestroy"))};if("waiting"===Ct)return o||(Ct="closed",Ot&&!o&&s()),Promise.resolve();if(!Qt("beforeClose",{immediate:t,timerHide:e,waitAfterward:o}))return Promise.reject();Ct="closing",jt=!!e,Mt&&"prevented"!==Mt&&clearTimeout&&clearTimeout(Mt),Mt=null;var a=new Promise((function(t,e){r=t}));return Bt=a,ve((function(){n(26,Pt=!1),jt=!1,Ct=o?"waiting":"closed",Qt("afterClose",{immediate:t,timerHide:e,waitAfterward:o}),Bt=null,r(),o||(Ot?s():bt&&Xt())}),t),a}:fe,he=e.animateIn,pe=void 0===he?function(t,e){Ht="in";var i=function e(n){if(!(n&&f.elem&&n.target!==f.elem||(f.elem&&f.elem.removeEventListener("transitionend",e),Tt&&clearTimeout(Tt),"in"!==Ht))){var i=Rt;if(!i&&f.elem){var o=f.elem.getBoundingClientRect();for(var r in o)if(o[r]>0){i=!0;break}}i?(t&&t.call(),Ht=!1):Tt=setTimeout(e,40)}};if("fade"!==et||e){var o=et;n(2,et="none"),n(24,St="pnotify-in ".concat("fade"===o?"pnotify-fade-in":"")),V().then((function(){n(2,et=o),i()}))}else f.elem&&f.elem.addEventListener("transitionend",i),n(24,St="pnotify-in"),V().then((function(){n(24,St="pnotify-in pnotify-fade-in"),Tt=setTimeout(i,650)}))}:he,me=e.animateOut,ve=void 0===me?function(t,e){Ht="out";var i=function e(i){if(!(i&&f.elem&&i.target!==f.elem||(f.elem&&f.elem.removeEventListener("transitionend",e),Et&&clearTimeout(Et),"out"!==Ht))){var o=Rt;if(!o&&f.elem){var r=f.elem.getBoundingClientRect();for(var s in r)if(r[s]>0){o=!0;break}}f.elem&&f.elem.style.opacity&&"0"!==f.elem.style.opacity&&o?Et=setTimeout(e,40):(n(24,St=""),t&&t.call(),Ht=!1)}};"fade"!==et||e?(n(24,St=""),V().then((function(){i()}))):(f.elem&&f.elem.addEventListener("transitionend",i),n(24,St="pnotify-in"),Et=setTimeout(i,650))}:me;function ye(){Mt&&"prevented"!==Mt&&(clearTimeout(Mt),Mt=null),Et&&clearTimeout(Et),"closing"===Ct&&(Ct="open",Ht=!1,n(24,St="fade"===et?"pnotify-in pnotify-fade-in":"pnotify-in"))}function ge(){"prevented"!==Mt&&(ye(),lt!==1/0&&(Mt=setTimeout((function(){return de(!1,!0)}),isNaN(lt)?0:lt)))}return t.$$set=function(t){"modules"in t&&n(46,a=t.modules),"stack"in t&&n(0,u=t.stack),"type"in t&&n(4,y=t.type),"title"in t&&n(5,$=t.title),"titleTrusted"in t&&n(6,k=t.titleTrusted),"text"in t&&n(7,b=t.text),"textTrusted"in t&&n(8,O=t.textTrusted),"styling"in t&&n(47,M=t.styling),"icons"in t&&n(48,E=t.icons),"mode"in t&&n(9,S=t.mode),"addClass"in t&&n(10,P=t.addClass),"addModalClass"in t&&n(11,A=t.addModalClass),"addModelessClass"in t&&n(12,W=t.addModelessClass),"autoOpen"in t&&n(49,B=t.autoOpen),"width"in t&&n(50,G=t.width),"minHeight"in t&&n(51,K=t.minHeight),"maxTextHeight"in t&&n(52,X=t.maxTextHeight),"icon"in t&&n(13,Z=t.icon),"animation"in t&&n(2,et=t.animation),"animateSpeed"in t&&n(14,it=t.animateSpeed),"shadow"in t&&n(15,rt=t.shadow),"hide"in t&&n(3,at=t.hide),"delay"in t&&n(53,lt=t.delay),"mouseReset"in t&&n(54,ft=t.mouseReset),"closer"in t&&n(16,ht=t.closer),"closerHover"in t&&n(17,mt=t.closerHover),"sticker"in t&&n(18,yt=t.sticker),"stickerHover"in t&&n(19,$t=t.stickerHover),"labels"in t&&n(20,kt=t.labels),"remove"in t&&n(55,bt=t.remove),"destroy"in t&&n(56,Ot=t.destroy),"open"in t&&n(59,ue=t.open),"close"in t&&n(23,de=t.close),"animateIn"in t&&n(60,pe=t.animateIn),"animateOut"in t&&n(61,ve=t.animateOut)},t.$$.update=function(){524288&t.$$.dirty[1]&&n(31,Yt="string"==typeof G?"width: ".concat(G,";"):""),1048576&t.$$.dirty[1]&&n(32,Zt="string"==typeof K?"min-height: ".concat(K,";"):""),2097152&t.$$.dirty[1]&&n(33,te="string"==typeof X?"max-height: ".concat(X,";"):""),32&t.$$.dirty[0]&&n(34,ee=$ instanceof HTMLElement),128&t.$$.dirty[0]&&n(35,ne=b instanceof HTMLElement),1&t.$$.dirty[0]|1792&t.$$.dirty[3]&&Gt!==u&&(Gt&&(Gt._removeNotice(i),n(30,zt=!1),Jt(),Kt()),u&&(u._addNotice(i),n(102,Jt=u.on("beforeAddOverlay",(function(){n(30,zt=!0),Qt("enterModal")}))),n(103,Kt=u.on("afterRemoveOverlay",(function(){n(30,zt=!1),Qt("leaveModal")})))),n(101,Gt=u)),1073748992&t.$$.dirty[0]&&n(36,ie=P.match(/\bnonblock\b/)||A.match(/\bnonblock\b/)&&zt||W.match(/\bnonblock\b/)&&!zt),1&t.$$.dirty[0]&&n(37,oe=u&&u.dir1?"pnotify-stack-".concat(u.dir1):""),32768&t.$$.dirty[1]&&n(38,re=Array.from(a).filter((function(t){var e=m(t,2),n=e[0];return e[1],"PrependContainer"===n.position}))),32768&t.$$.dirty[1]&&n(39,se=Array.from(a).filter((function(t){var e=m(t,2),n=e[0];return e[1],"PrependContent"===n.position}))),32768&t.$$.dirty[1]&&n(40,ae=Array.from(a).filter((function(t){var e=m(t,2),n=e[0];return e[1],"AppendContent"===n.position}))),32768&t.$$.dirty[1]&&n(41,ce=Array.from(a).filter((function(t){var e=m(t,2),n=e[0];return e[1],"AppendContainer"===n.position}))),34&t.$$.dirty[0]|8&t.$$.dirty[1]&&ee&&f.titleContainer&&f.titleContainer.appendChild($),130&t.$$.dirty[0]|16&t.$$.dirty[1]&&ne&&f.textContainer&&f.textContainer.appendChild(b)},[u,f,et,at,y,$,k,b,O,S,P,A,W,Z,it,rt,ht,mt,yt,$t,kt,function(t){return"string"==typeof M?"".concat(M,"-").concat(t):t in M?M[t]:"".concat(M.prefix,"-").concat(t)},function(t){return"string"==typeof E?"".concat(E,"-icon-").concat(t):t in E?E[t]:"".concat(E.prefix,"-icon-").concat(t)},de,St,Nt,Pt,Lt,Wt,Dt,zt,Yt,Zt,te,ee,ne,ie,oe,re,se,ae,ce,i,r,function(t){if(n(26,Pt=!0),ft&&"closing"===Ct){if(!jt)return;ye()}at&&ft&&ye()},function(t){n(26,Pt=!1),at&&ft&&"out"!==Ht&&-1!==["open","opening"].indexOf(Ct)&&ge()},a,M,E,B,G,K,X,lt,ft,bt,Ot,function(){return Ct},function(){return Mt},ue,pe,ve,ye,ge,function(t){t?(ye(),Mt="prevented"):"prevented"===Mt&&(Mt=null,"open"===Ct&&at&&ge())},function(){return i.$on.apply(i,arguments)},function(){return i.$set.apply(i,arguments)},function(t,e){o(t,e)},function(t){for(var e=0;e<(arguments.length<=1?0:arguments.length-1);e++){var i=e+1<1||arguments.length<=e+1?void 0:arguments[e+1];-1===Lt[t].indexOf(i)&&Lt[t].push(i)}n(27,Lt)},function(t){for(var e=0;e<(arguments.length<=1?0:arguments.length-1);e++){var i=e+1<1||arguments.length<=e+1?void 0:arguments[e+1],o=Lt[t].indexOf(i);-1!==o&&Lt[t].splice(o,1)}n(27,Lt)},function(t){for(var e=0;e<(arguments.length<=1?0:arguments.length-1);e++){var n=e+1<1||arguments.length<=e+1?void 0:arguments[e+1];if(-1===Lt[t].indexOf(n))return!1}return!0},function(){return At},function(t){return At=t},function(){return Rt},function(t){return Rt=t},function(t){return Ht=t},function(){return St},function(t){return n(24,St=t)},function(){return Nt},function(t){return n(25,Nt=t)},function(t,e,i){if(It&&clearTimeout(It),Wt!==t)if(t)n(28,Wt=!0),n(29,Dt=!!e),Vt(),V().then((function(){window.requestAnimationFrame((function(){if(Wt)if(e&&i)i();else{n(29,Dt=!0);var t=function t(){f.elem&&f.elem.removeEventListener("transitionend",t),It&&clearTimeout(It),Dt&&i&&i()};f.elem&&f.elem.addEventListener("transitionend",t),It=setTimeout(t,650)}}))}));else if(e)n(28,Wt=!1),n(29,Dt=!1),bt&&-1===["open","opening","closing"].indexOf(Ct)&&Xt(),i&&i();else{var o=function t(){f.elem&&f.elem.removeEventListener("transitionend",t),It&&clearTimeout(It),Dt||(n(28,Wt=!1),bt&&-1===["open","opening","closing"].indexOf(Ct)&&Xt(),i&&i())};n(29,Dt=!1),f.elem&&f.elem.addEventListener("transitionend",o),f.elem&&f.elem.style.opacity,It=setTimeout(o,650)}},function(){return de(!1)},function(){return n(3,at=!at)},function(t){z[t?"unshift":"push"]((function(){f.iconContainer=t,n(1,f)}))},function(t){z[t?"unshift":"push"]((function(){f.titleContainer=t,n(1,f)}))},function(t){z[t?"unshift":"push"]((function(){f.textContainer=t,n(1,f)}))},function(t){z[t?"unshift":"push"]((function(){f.content=t,n(1,f)}))},function(t){z[t?"unshift":"push"]((function(){f.container=t,n(1,f)}))},function(t){z[t?"unshift":"push"]((function(){f.elem=t,n(1,f)}))}]}window&&document.body?Gt():document.addEventListener("DOMContentLoaded",Gt);var Kt=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&u(t,e)}(s,t);var e,n,o=(e=s,n=f(),function(){var t,i=l(e);if(n){var o=l(this).constructor;t=Reflect.construct(i,arguments,o)}else t=i.apply(this,arguments);return p(this,t)});function s(t){var e;return i(this,s),function(t,e,n,i,o,r){var s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:[-1],a=R;D(t);var c=e.props||{},l=t.$$={fragment:null,ctx:null,props:r,update:$,not_equal:o,bound:x(),on_mount:[],on_destroy:[],before_update:[],after_update:[],context:new Map(a?a.$$.context:[]),callbacks:x(),dirty:s,skip_bound:!1},u=!1;if(l.ctx=n?n(t,c,(function(e,n){var i=!(arguments.length<=2)&&arguments.length-2?arguments.length<=2?void 0:arguments[2]:n;return l.ctx&&o(l.ctx[e],l.ctx[e]=i)&&(!l.skip_bound&&l.bound[e]&&l.bound[e](i),u&&vt(t,e)),n})):[],l.update(),u=!0,b(l.before_update),l.fragment=!!i&&i(l.ctx),e.target){if(e.hydrate){var f=L(e.target);l.fragment&&l.fragment.l(f),f.forEach(T)}else l.fragment&&l.fragment.c();e.intro&&st(t.$$.fragment),pt(t,e.target,e.anchor),tt()}D(a)}(h(e=o.call(this)),t,Jt,It,O,{modules:46,stack:0,refs:1,type:4,title:5,titleTrusted:6,text:7,textTrusted:8,styling:47,icons:48,mode:9,addClass:10,addModalClass:11,addModelessClass:12,autoOpen:49,width:50,minHeight:51,maxTextHeight:52,icon:13,animation:2,animateSpeed:14,shadow:15,hide:3,delay:53,mouseReset:54,closer:16,closerHover:17,sticker:18,stickerHover:19,labels:20,remove:55,destroy:56,getState:57,getTimer:58,getStyle:21,getIcon:22,open:59,close:23,animateIn:60,animateOut:61,cancelClose:62,queueClose:63,_preventTimerClose:64,on:65,update:66,fire:67,addModuleClass:68,removeModuleClass:69,hasModuleClass:70,getModuleHandled:71,setModuleHandled:72,getModuleOpen:73,setModuleOpen:74,setAnimating:75,getAnimatingClass:76,setAnimatingClass:77,_getMoveClass:78,_setMoveClass:79,_setMasking:80},[-1,-1,-1,-1]),e}return r(s,[{key:"modules",get:function(){return this.$$.ctx[46]},set:function(t){this.$set({modules:t}),tt()}},{key:"stack",get:function(){return this.$$.ctx[0]},set:function(t){this.$set({stack:t}),tt()}},{key:"refs",get:function(){return this.$$.ctx[1]}},{key:"type",get:function(){return this.$$.ctx[4]},set:function(t){this.$set({type:t}),tt()}},{key:"title",get:function(){return this.$$.ctx[5]},set:function(t){this.$set({title:t}),tt()}},{key:"titleTrusted",get:function(){return this.$$.ctx[6]},set:function(t){this.$set({titleTrusted:t}),tt()}},{key:"text",get:function(){return this.$$.ctx[7]},set:function(t){this.$set({text:t}),tt()}},{key:"textTrusted",get:function(){return this.$$.ctx[8]},set:function(t){this.$set({textTrusted:t}),tt()}},{key:"styling",get:function(){return this.$$.ctx[47]},set:function(t){this.$set({styling:t}),tt()}},{key:"icons",get:function(){return this.$$.ctx[48]},set:function(t){this.$set({icons:t}),tt()}},{key:"mode",get:function(){return this.$$.ctx[9]},set:function(t){this.$set({mode:t}),tt()}},{key:"addClass",get:function(){return this.$$.ctx[10]},set:function(t){this.$set({addClass:t}),tt()}},{key:"addModalClass",get:function(){return this.$$.ctx[11]},set:function(t){this.$set({addModalClass:t}),tt()}},{key:"addModelessClass",get:function(){return this.$$.ctx[12]},set:function(t){this.$set({addModelessClass:t}),tt()}},{key:"autoOpen",get:function(){return this.$$.ctx[49]},set:function(t){this.$set({autoOpen:t}),tt()}},{key:"width",get:function(){return this.$$.ctx[50]},set:function(t){this.$set({width:t}),tt()}},{key:"minHeight",get:function(){return this.$$.ctx[51]},set:function(t){this.$set({minHeight:t}),tt()}},{key:"maxTextHeight",get:function(){return this.$$.ctx[52]},set:function(t){this.$set({maxTextHeight:t}),tt()}},{key:"icon",get:function(){return this.$$.ctx[13]},set:function(t){this.$set({icon:t}),tt()}},{key:"animation",get:function(){return this.$$.ctx[2]},set:function(t){this.$set({animation:t}),tt()}},{key:"animateSpeed",get:function(){return this.$$.ctx[14]},set:function(t){this.$set({animateSpeed:t}),tt()}},{key:"shadow",get:function(){return this.$$.ctx[15]},set:function(t){this.$set({shadow:t}),tt()}},{key:"hide",get:function(){return this.$$.ctx[3]},set:function(t){this.$set({hide:t}),tt()}},{key:"delay",get:function(){return this.$$.ctx[53]},set:function(t){this.$set({delay:t}),tt()}},{key:"mouseReset",get:function(){return this.$$.ctx[54]},set:function(t){this.$set({mouseReset:t}),tt()}},{key:"closer",get:function(){return this.$$.ctx[16]},set:function(t){this.$set({closer:t}),tt()}},{key:"closerHover",get:function(){return this.$$.ctx[17]},set:function(t){this.$set({closerHover:t}),tt()}},{key:"sticker",get:function(){return this.$$.ctx[18]},set:function(t){this.$set({sticker:t}),tt()}},{key:"stickerHover",get:function(){return this.$$.ctx[19]},set:function(t){this.$set({stickerHover:t}),tt()}},{key:"labels",get:function(){return this.$$.ctx[20]},set:function(t){this.$set({labels:t}),tt()}},{key:"remove",get:function(){return this.$$.ctx[55]},set:function(t){this.$set({remove:t}),tt()}},{key:"destroy",get:function(){return this.$$.ctx[56]},set:function(t){this.$set({destroy:t}),tt()}},{key:"getState",get:function(){return this.$$.ctx[57]}},{key:"getTimer",get:function(){return this.$$.ctx[58]}},{key:"getStyle",get:function(){return this.$$.ctx[21]}},{key:"getIcon",get:function(){return this.$$.ctx[22]}},{key:"open",get:function(){return this.$$.ctx[59]},set:function(t){this.$set({open:t}),tt()}},{key:"close",get:function(){return this.$$.ctx[23]},set:function(t){this.$set({close:t}),tt()}},{key:"animateIn",get:function(){return this.$$.ctx[60]},set:function(t){this.$set({animateIn:t}),tt()}},{key:"animateOut",get:function(){return this.$$.ctx[61]},set:function(t){this.$set({animateOut:t}),tt()}},{key:"cancelClose",get:function(){return this.$$.ctx[62]}},{key:"queueClose",get:function(){return this.$$.ctx[63]}},{key:"_preventTimerClose",get:function(){return this.$$.ctx[64]}},{key:"on",get:function(){return this.$$.ctx[65]}},{key:"update",get:function(){return this.$$.ctx[66]}},{key:"fire",get:function(){return this.$$.ctx[67]}},{key:"addModuleClass",get:function(){return this.$$.ctx[68]}},{key:"removeModuleClass",get:function(){return this.$$.ctx[69]}},{key:"hasModuleClass",get:function(){return this.$$.ctx[70]}},{key:"getModuleHandled",get:function(){return this.$$.ctx[71]}},{key:"setModuleHandled",get:function(){return this.$$.ctx[72]}},{key:"getModuleOpen",get:function(){return this.$$.ctx[73]}},{key:"setModuleOpen",get:function(){return this.$$.ctx[74]}},{key:"setAnimating",get:function(){return this.$$.ctx[75]}},{key:"getAnimatingClass",get:function(){return this.$$.ctx[76]}},{key:"setAnimatingClass",get:function(){return this.$$.ctx[77]}},{key:"_getMoveClass",get:function(){return this.$$.ctx[78]}},{key:"_setMoveClass",get:function(){return this.$$.ctx[79]}},{key:"_setMasking",get:function(){return this.$$.ctx[80]}}]),s}(yt);t.Stack=gt,t.alert=function(t){return $t(qt(t))},t.default=Kt,t.defaultModules=zt,t.defaultStack=Bt,t.defaults=Ut,t.error=function(t){return $t(qt(t,"error"))},t.info=function(t){return $t(qt(t,"info"))},t.notice=function(t){return $t(qt(t,"notice"))},t.success=function(t){return $t(qt(t,"success"))},Object.defineProperty(t,"__esModule",{value:!0})}(e)}(0,i.exports);var o=i.exports,r=function(){function t(){}return t.prototype.success=function(t,e,n){this.flash("success",t,e,n)},t.prototype.info=function(t,e,n){this.flash("info",t,e,n)},t.prototype.warning=function(t,e,n){this.flash("warning",t,e,n)},t.prototype.error=function(t,e,n){this.flash("error",t,e,n)},t.prototype.flash=function(t,e,n,i){var o=this.createNotification(t,e,n,i);this.renderOptions({}),this.render({notification:o})},t.prototype.createNotification=function(t,e,n,i){if("object"==typeof t?(t=(i=t).type,e=i.message,n=i.title):"object"==typeof e?(e=(i=e).message,n=i.title):"object"==typeof n&&(n=(i=n).title),void 0===e)throw new Error("message option is required");return{type:t||"info",message:e,title:n,options:i}},t.prototype.render=function(t){var n=t.notification;n.type=n.type||"info";var i,r=e({text:n.title},n.options);switch(r=e(e({},r),{text:(null==r?void 0:r.text)||n.message}),n.type){case"success":i=o.success(r);break;case"alert":i=o.alert(r);break;case"info":i=o.info(r);break;case"error":i=o.error(r);break;default:i=o.notice(r)}i.refs.container&&(i.refs.container.dataset.turboCache="false",i.refs.container.classList.add("fl-no-cache"))},t.prototype.updateDefaultOptions=function(t,e){Object.entries(e).forEach((function(e){var n=e[0],i=e[1];t[n]=i}))},t.prototype.renderOptions=function(t){this.updateDefaultOptions(o.defaults,e({delay:t.delay||5e3},t))},t}(),s=new r;return t.addFactory("pnotify",s),s})); diff --git a/src/Pnotify/Symfony/Resources/config/config.yaml b/src/Pnotify/Symfony/Resources/config/config.yaml index 657fb037..af18cd06 100644 --- a/src/Pnotify/Symfony/Resources/config/config.yaml +++ b/src/Pnotify/Symfony/Resources/config/config.yaml @@ -1,12 +1,12 @@ flasher_pnotify: scripts: cdn: - - 'https://cdn.jsdelivr.net/npm/@flasher/flasher-pnotify@1.3.1/dist/flasher-pnotify.min.js' + - 'https://cdn.jsdelivr.net/npm/@flasher/flasher-pnotify@1.3.2/dist/flasher-pnotify.min.js' local: - '/vendor/flasher/flasher-pnotify.min.js' styles: cdn: - - 'https://cdn.jsdelivr.net/npm/@flasher/flasher-pnotify@1.3.1/dist/flasher-pnotify.min.css' + - 'https://cdn.jsdelivr.net/npm/@flasher/flasher-pnotify@1.3.2/dist/flasher-pnotify.min.css' local: - '/vendor/flasher/flasher-pnotify.min.css' diff --git a/src/Prime/Plugin/FlasherPlugin.php b/src/Prime/Plugin/FlasherPlugin.php index ff00fe17..330ab8f3 100644 --- a/src/Prime/Plugin/FlasherPlugin.php +++ b/src/Prime/Plugin/FlasherPlugin.php @@ -45,7 +45,7 @@ final class FlasherPlugin extends Plugin public function getRootScript() { return array( - 'cdn' => 'https://cdn.jsdelivr.net/npm/@flasher/flasher@1.3.1/dist/flasher.min.js', + 'cdn' => 'https://cdn.jsdelivr.net/npm/@flasher/flasher@1.3.2/dist/flasher.min.js', 'local' => '/vendor/flasher/flasher.min.js', ); } @@ -67,7 +67,7 @@ final class FlasherPlugin extends Plugin { return array( 'cdn' => array( - 'https://cdn.jsdelivr.net/npm/@flasher/flasher@1.3.1/dist/flasher.min.css', + 'https://cdn.jsdelivr.net/npm/@flasher/flasher@1.3.2/dist/flasher.min.css', ), 'local' => array( '/vendor/flasher/flasher.min.css', diff --git a/src/Prime/Resources/assets/flasher.min.js b/src/Prime/Resources/assets/flasher.min.js index 95fb52fb..065b20c0 100644 --- a/src/Prime/Resources/assets/flasher.min.js +++ b/src/Prime/Resources/assets/flasher.min.js @@ -1 +1 @@ -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).flasher=e()}(this,(function(){"use strict";function t(t,e,n){if(n||2===arguments.length)for(var o,r=0,i=e.length;r
'+(null!==(e=n.title)&&void 0!==e?e:n.type)+''+n.message+'
'}}),n})); +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).flasher=e()}(this,(function(){"use strict";function t(t,e,n){if(n||2===arguments.length)for(var o,r=0,i=e.length;r
'+(null!==(e=n.title)&&void 0!==e?e:n.type)+''+n.message+'
'}}),n})); diff --git a/src/Prime/Response/Presenter/HtmlPresenter.php b/src/Prime/Response/Presenter/HtmlPresenter.php index d267a836..1d8a80b2 100644 --- a/src/Prime/Response/Presenter/HtmlPresenter.php +++ b/src/Prime/Response/Presenter/HtmlPresenter.php @@ -29,6 +29,7 @@ final class HtmlPresenter implements PresenterInterface $rootScript = $response->getRootScript(); $placeHolder = self::FLASHER_FLASH_BAG_PLACE_HOLDER; + $livewireListener = $this->getLivewireListenerScript(); return << @@ -84,6 +85,8 @@ final class HtmlPresenter implements PresenterInterface document.addEventListener('flasher:render', function (event) { render(event.detail); }); + + {$livewireListener} } if (window.hasOwnProperty('flasher') || !rootScript || document.querySelector('script[src="' + rootScript + '"]')) { @@ -100,6 +103,27 @@ final class HtmlPresenter implements PresenterInterface } })(); +JAVASCRIPT; + } + + /** + * Generate the script for Livewire event handling. + * + * @return string + */ + private function getLivewireListenerScript() + { + if (!class_exists('Livewire\LivewireManager')) { + return ''; + } + + return << array( 'cdn' => array( - 'https://cdn.jsdelivr.net/npm/@flasher/flasher-sweetalert@1.3.1/dist/flasher-sweetalert.min.js', + 'https://cdn.jsdelivr.net/npm/@flasher/flasher-sweetalert@1.3.2/dist/flasher-sweetalert.min.js', ), 'local' => array( '/vendor/flasher/flasher-sweetalert.min.js', @@ -16,7 +16,7 @@ return array( ), 'styles' => array( 'cdn' => array( - 'https://cdn.jsdelivr.net/npm/@flasher/flasher-sweetalert@1.3.1/dist/flasher-sweetalert.min.css', + 'https://cdn.jsdelivr.net/npm/@flasher/flasher-sweetalert@1.3.2/dist/flasher-sweetalert.min.css', ), 'local' => array( '/vendor/flasher/flasher-sweetalert.min.css', diff --git a/src/SweetAlert/Prime/Resources/assets/flasher-sweetalert.min.js b/src/SweetAlert/Prime/Resources/assets/flasher-sweetalert.min.js index d03368d6..d16717ac 100644 --- a/src/SweetAlert/Prime/Resources/assets/flasher-sweetalert.min.js +++ b/src/SweetAlert/Prime/Resources/assets/flasher-sweetalert.min.js @@ -1 +1 @@ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("@flasher/flasher")):"function"==typeof define&&define.amd?define(["@flasher/flasher"],t):((e="undefined"!=typeof globalThis?globalThis:e||self).flasher=e.flasher||{},e.flasher.sweetalert=t(e.flasher))}(this,(function(e){"use strict";var t=function(){return t=Object.assign||function(e){for(var t,n=1,o=arguments.length;n0&&i[i.length-1])||6!==a[0]&&2!==a[0])){r=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]{t.previousActiveElement instanceof HTMLElement?(t.previousActiveElement.focus(),t.previousActiveElement=null):document.body&&document.body.focus()},o=o=>new Promise((i=>{if(!o)return i();const s=window.scrollX,r=window.scrollY;t.restoreFocusTimeout=setTimeout((()=>{n(),i()}),e),window.scrollTo(s,r)}));var i={promise:new WeakMap,innerParams:new WeakMap,domCache:new WeakMap};const s="swal2-",r=["container","shown","height-auto","iosfix","popup","modal","no-backdrop","no-transition","toast","toast-shown","show","hide","close","title","html-container","actions","confirm","deny","cancel","default-outline","footer","icon","icon-content","image","input","file","range","select","radio","checkbox","label","textarea","inputerror","input-label","validation-message","progress-steps","active-progress-step","progress-step","progress-step-line","loader","loading","styled","top","top-start","top-end","top-left","top-right","center","center-start","center-end","center-left","center-right","bottom","bottom-start","bottom-end","bottom-left","bottom-right","grow-row","grow-column","grow-fullscreen","rtl","timer-progress-bar","timer-progress-bar-container","scrollbar-measure","icon-success","icon-warning","icon-info","icon-question","icon-error"].reduce(((e,t)=>(e[t]=s+t,e)),{}),a=["success","warning","info","question","error"].reduce(((e,t)=>(e[t]=s+t,e)),{}),l="SweetAlert2:",c=e=>e.charAt(0).toUpperCase()+e.slice(1),u=e=>{console.warn(`${l} ${"object"==typeof e?e.join(" "):e}`)},d=e=>{console.error(`${l} ${e}`)},p=[],m=e=>{p.includes(e)||(p.push(e),u(e))},h=(e,t)=>{m(`"${e}" is deprecated and will be removed in the next major release. Please use "${t}" instead.`)},f=e=>"function"==typeof e?e():e,g=e=>e&&"function"==typeof e.toPromise,b=e=>g(e)?e.toPromise():Promise.resolve(e),y=e=>e&&Promise.resolve(e)===e,w=()=>document.body.querySelector(`.${r.container}`),v=e=>{const t=w();return t?t.querySelector(e):null},C=e=>v(`.${e}`),A=()=>C(r.popup),k=()=>C(r.icon),x=()=>C(r["icon-content"]),B=()=>C(r.title),P=()=>C(r["html-container"]),E=()=>C(r.image),$=()=>C(r["progress-steps"]),T=()=>C(r["validation-message"]),L=()=>v(`.${r.actions} .${r.confirm}`),S=()=>v(`.${r.actions} .${r.cancel}`),O=()=>v(`.${r.actions} .${r.deny}`),j=()=>C(r["input-label"]),M=()=>v(`.${r.loader}`),I=()=>C(r.actions),H=()=>C(r.footer),q=()=>C(r["timer-progress-bar"]),D=()=>C(r.close),V='\n a[href],\n area[href],\n input:not([disabled]),\n select:not([disabled]),\n textarea:not([disabled]),\n button:not([disabled]),\n iframe,\n object,\n embed,\n [tabindex="0"],\n [contenteditable],\n audio[controls],\n video[controls],\n summary\n',N=()=>{const e=A().querySelectorAll('[tabindex]:not([tabindex="-1"]):not([tabindex="0"])'),t=Array.from(e).sort(((e,t)=>{const n=parseInt(e.getAttribute("tabindex")),o=parseInt(t.getAttribute("tabindex"));return n>o?1:n"-1"!==e.getAttribute("tabindex")));return[...new Set(t.concat(o))].filter((e=>se(e)))},F=()=>z(document.body,r.shown)&&!z(document.body,r["toast-shown"])&&!z(document.body,r["no-backdrop"]),_=()=>A()&&z(A(),r.toast),R=()=>A().hasAttribute("data-loading"),U=(e,t)=>{if(e.textContent="",t){const n=(new DOMParser).parseFromString(t,"text/html");Array.from(n.querySelector("head").childNodes).forEach((t=>{e.appendChild(t)})),Array.from(n.querySelector("body").childNodes).forEach((t=>{t instanceof HTMLVideoElement||t instanceof HTMLAudioElement?e.appendChild(t.cloneNode(!0)):e.appendChild(t)}))}},z=(e,t)=>{if(!t)return!1;const n=t.split(/\s+/);for(let t=0;t{Array.from(e.classList).forEach((n=>{Object.values(r).includes(n)||Object.values(a).includes(n)||Object.values(t.showClass).includes(n)||e.classList.remove(n)}))},K=(e,t,n)=>{if(W(e,t),t.customClass&&t.customClass[n]){if("string"!=typeof t.customClass[n]&&!t.customClass[n].forEach)return void u(`Invalid type of customClass.${n}! Expected string or iterable object, got "${typeof t.customClass[n]}"`);Q(e,t.customClass[n])}},Y=(e,t)=>{if(!t)return null;switch(t){case"select":case"textarea":case"file":return e.querySelector(`.${r.popup} > .${r[t]}`);case"checkbox":return e.querySelector(`.${r.popup} > .${r.checkbox} input`);case"radio":return e.querySelector(`.${r.popup} > .${r.radio} input:checked`)||e.querySelector(`.${r.popup} > .${r.radio} input:first-child`);case"range":return e.querySelector(`.${r.popup} > .${r.range} input`);default:return e.querySelector(`.${r.popup} > .${r.input}`)}},Z=e=>{if(e.focus(),"file"!==e.type){const t=e.value;e.value="",e.value=t}},J=(e,t,n)=>{e&&t&&("string"==typeof t&&(t=t.split(/\s+/).filter(Boolean)),t.forEach((t=>{Array.isArray(e)?e.forEach((e=>{n?e.classList.add(t):e.classList.remove(t)})):n?e.classList.add(t):e.classList.remove(t)})))},Q=(e,t)=>{J(e,t,!0)},X=(e,t)=>{J(e,t,!1)},G=(e,t)=>{const n=Array.from(e.children);for(let e=0;e{n===`${parseInt(n)}`&&(n=parseInt(n)),n||0===parseInt(n)?e.style[t]="number"==typeof n?`${n}px`:n:e.style.removeProperty(t)},te=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"flex";e&&(e.style.display=t)},ne=e=>{e&&(e.style.display="none")},oe=(e,t,n,o)=>{const i=e.querySelector(t);i&&(i.style[n]=o)},ie=function(e,t){t?te(e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:"flex"):ne(e)},se=e=>!(!e||!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)),re=()=>!se(L())&&!se(O())&&!se(S()),ae=e=>!!(e.scrollHeight>e.clientHeight),le=e=>{const t=window.getComputedStyle(e),n=parseFloat(t.getPropertyValue("animation-duration")||"0"),o=parseFloat(t.getPropertyValue("transition-duration")||"0");return n>0||o>0},ce=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=q();se(n)&&(t&&(n.style.transition="none",n.style.width="100%"),setTimeout((()=>{n.style.transition=`width ${e/1e3}s linear`,n.style.width="0%"}),10))},ue=()=>{const e=q(),t=parseInt(window.getComputedStyle(e).width);e.style.removeProperty("transition"),e.style.width="100%";const n=t/parseInt(window.getComputedStyle(e).width)*100;e.style.width=`${n}%`},de=()=>"undefined"==typeof window||"undefined"==typeof document,pe=`\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,""),me=()=>{const e=w();return!!e&&(e.remove(),X([document.documentElement,document.body],[r["no-backdrop"],r["toast-shown"],r["has-column"]]),!0)},he=()=>{t.currentInstance.resetValidationMessage()},fe=()=>{const e=A(),t=G(e,r.input),n=G(e,r.file),o=e.querySelector(`.${r.range} input`),i=e.querySelector(`.${r.range} output`),s=G(e,r.select),a=e.querySelector(`.${r.checkbox} input`),l=G(e,r.textarea);t.oninput=he,n.onchange=he,s.onchange=he,a.onchange=he,l.oninput=he,o.oninput=()=>{he(),i.value=o.value},o.onchange=()=>{he(),i.value=o.value}},ge=e=>"string"==typeof e?document.querySelector(e):e,be=e=>{const t=A();t.setAttribute("role",e.toast?"alert":"dialog"),t.setAttribute("aria-live",e.toast?"polite":"assertive"),e.toast||t.setAttribute("aria-modal","true")},ye=e=>{"rtl"===window.getComputedStyle(e).direction&&Q(w(),r.rtl)},we=e=>{const t=me();if(de())return void d("SweetAlert2 requires document to initialize");const n=document.createElement("div");n.className=r.container,t&&Q(n,r["no-transition"]),U(n,pe);const o=ge(e.target);o.appendChild(n),be(e),ye(o),fe()},ve=(e,t)=>{e instanceof HTMLElement?t.appendChild(e):"object"==typeof e?Ce(e,t):e&&U(t,e)},Ce=(e,t)=>{e.jquery?Ae(t,e):U(t,e.toString())},Ae=(e,t)=>{if(e.textContent="",0 in t)for(let n=0;n in t;n++)e.appendChild(t[n].cloneNode(!0));else e.appendChild(t.cloneNode(!0))},ke=(()=>{if(de())return!1;const e=document.createElement("div"),t={WebkitAnimation:"webkitAnimationEnd",animation:"animationend"};for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&void 0!==e.style[n])return t[n];return!1})(),xe=(e,t)=>{const n=I(),o=M();t.showConfirmButton||t.showDenyButton||t.showCancelButton?te(n):ne(n),K(n,t,"actions"),Be(n,o,t),U(o,t.loaderHtml),K(o,t,"loader")};function Be(e,t,n){const o=L(),i=O(),s=S();Ee(o,"confirm",n),Ee(i,"deny",n),Ee(s,"cancel",n),Pe(o,i,s,n),n.reverseButtons&&(n.toast?(e.insertBefore(s,o),e.insertBefore(i,o)):(e.insertBefore(s,t),e.insertBefore(i,t),e.insertBefore(o,t)))}function Pe(e,t,n,o){o.buttonsStyling?(Q([e,t,n],r.styled),o.confirmButtonColor&&(e.style.backgroundColor=o.confirmButtonColor,Q(e,r["default-outline"])),o.denyButtonColor&&(t.style.backgroundColor=o.denyButtonColor,Q(t,r["default-outline"])),o.cancelButtonColor&&(n.style.backgroundColor=o.cancelButtonColor,Q(n,r["default-outline"]))):X([e,t,n],r.styled)}function Ee(e,t,n){ie(e,n[`show${c(t)}Button`],"inline-block"),U(e,n[`${t}ButtonText`]),e.setAttribute("aria-label",n[`${t}ButtonAriaLabel`]),e.className=r[t],K(e,n,`${t}Button`),Q(e,n[`${t}ButtonClass`])}const $e=(e,t)=>{const n=D();n&&(U(n,t.closeButtonHtml||""),K(n,t,"closeButton"),ie(n,t.showCloseButton),n.setAttribute("aria-label",t.closeButtonAriaLabel||""))},Te=(e,t)=>{const n=w();n&&(Le(n,t.backdrop),Se(n,t.position),Oe(n,t.grow),K(n,t,"container"))};function Le(e,t){"string"==typeof t?e.style.background=t:t||Q([document.documentElement,document.body],r["no-backdrop"])}function Se(e,t){t in r?Q(e,r[t]):(u('The "position" parameter is not valid, defaulting to "center"'),Q(e,r.center))}function Oe(e,t){if(t&&"string"==typeof t){const n=`grow-${t}`;n in r&&Q(e,r[n])}}const je=["input","file","range","select","radio","checkbox","textarea"],Me=(e,t)=>{const n=A(),o=i.innerParams.get(e),s=!o||t.input!==o.input;je.forEach((e=>{const o=G(n,r[e]);qe(e,t.inputAttributes),o.className=r[e],s&&ne(o)})),t.input&&(s&&Ie(t),De(t))},Ie=e=>{if(!Re[e.input])return void d(`Unexpected type of input! Expected "text", "email", "password", "number", "tel", "select", "radio", "checkbox", "textarea", "file" or "url", got "${e.input}"`);const t=Fe(e.input),n=Re[e.input](t,e);te(t),e.inputAutoFocus&&setTimeout((()=>{Z(n)}))},He=e=>{for(let t=0;t{const n=Y(A(),e);if(n){He(n);for(const e in t)n.setAttribute(e,t[e])}},De=e=>{const t=Fe(e.input);"object"==typeof e.customClass&&Q(t,e.customClass.input)},Ve=(e,t)=>{e.placeholder&&!t.inputPlaceholder||(e.placeholder=t.inputPlaceholder)},Ne=(e,t,n)=>{if(n.inputLabel){e.id=r.input;const o=document.createElement("label"),i=r["input-label"];o.setAttribute("for",e.id),o.className=i,"object"==typeof n.customClass&&Q(o,n.customClass.inputLabel),o.innerText=n.inputLabel,t.insertAdjacentElement("beforebegin",o)}},Fe=e=>G(A(),r[e]||r.input),_e=(e,t)=>{["string","number"].includes(typeof t)?e.value=`${t}`:y(t)||u(`Unexpected type of inputValue! Expected "string", "number" or "Promise", got "${typeof t}"`)},Re={};Re.text=Re.email=Re.password=Re.number=Re.tel=Re.url=(e,t)=>(_e(e,t.inputValue),Ne(e,e,t),Ve(e,t),e.type=t.input,e),Re.file=(e,t)=>(Ne(e,e,t),Ve(e,t),e),Re.range=(e,t)=>{const n=e.querySelector("input"),o=e.querySelector("output");return _e(n,t.inputValue),n.type=t.input,_e(o,t.inputValue),Ne(n,e,t),e},Re.select=(e,t)=>{if(e.textContent="",t.inputPlaceholder){const n=document.createElement("option");U(n,t.inputPlaceholder),n.value="",n.disabled=!0,n.selected=!0,e.appendChild(n)}return Ne(e,e,t),e},Re.radio=e=>(e.textContent="",e),Re.checkbox=(e,t)=>{const n=Y(A(),"checkbox");n.value="1",n.id=r.checkbox,n.checked=Boolean(t.inputValue);const o=e.querySelector("span");return U(o,t.inputPlaceholder),n},Re.textarea=(e,t)=>{_e(e,t.inputValue),Ve(e,t),Ne(e,e,t);const n=e=>parseInt(window.getComputedStyle(e).marginLeft)+parseInt(window.getComputedStyle(e).marginRight);return setTimeout((()=>{if("MutationObserver"in window){const t=parseInt(window.getComputedStyle(A()).width);new MutationObserver((()=>{const o=e.offsetWidth+n(e);A().style.width=o>t?`${o}px`:null})).observe(e,{attributes:!0,attributeFilter:["style"]})}})),e};const Ue=(e,t)=>{const n=P();n&&(K(n,t,"htmlContainer"),t.html?(ve(t.html,n),te(n,"block")):t.text?(n.textContent=t.text,te(n,"block")):ne(n),Me(e,t))},ze=(e,t)=>{const n=H();n&&(ie(n,t.footer),t.footer&&ve(t.footer,n),K(n,t,"footer"))},We=(e,t)=>{const n=i.innerParams.get(e),o=k();if(n&&t.icon===n.icon)return Qe(o,t),void Ke(o,t);if(t.icon||t.iconHtml){if(t.icon&&-1===Object.keys(a).indexOf(t.icon))return d(`Unknown icon! Expected "success", "error", "warning", "info" or "question", got "${t.icon}"`),void ne(o);te(o),Qe(o,t),Ke(o,t),Q(o,t.showClass.icon)}else ne(o)},Ke=(e,t)=>{for(const n in a)t.icon!==n&&X(e,a[n]);Q(e,a[t.icon]),Xe(e,t),Ye(),K(e,t,"icon")},Ye=()=>{const e=A(),t=window.getComputedStyle(e).getPropertyValue("background-color"),n=e.querySelectorAll("[class^=swal2-success-circular-line], .swal2-success-fix");for(let e=0;e\n \n
    \n
    \n',Je='\n \n \n \n \n',Qe=(e,t)=>{let n,o=e.innerHTML;t.iconHtml?n=Ge(t.iconHtml):"success"===t.icon?(n=Ze,o=o.replace(/ style=".*?"/g,"")):n="error"===t.icon?Je:Ge({question:"?",warning:"!",info:"i"}[t.icon]),o.trim()!==n.trim()&&U(e,n)},Xe=(e,t)=>{if(t.iconColor){e.style.color=t.iconColor,e.style.borderColor=t.iconColor;for(const n of[".swal2-success-line-tip",".swal2-success-line-long",".swal2-x-mark-line-left",".swal2-x-mark-line-right"])oe(e,n,"backgroundColor",t.iconColor);oe(e,".swal2-success-ring","borderColor",t.iconColor)}},Ge=e=>`
    ${e}
    `,et=(e,t)=>{const n=E();n&&(t.imageUrl?(te(n,""),n.setAttribute("src",t.imageUrl),n.setAttribute("alt",t.imageAlt||""),ee(n,"width",t.imageWidth),ee(n,"height",t.imageHeight),n.className=r.image,K(n,t,"image")):ne(n))},tt=(e,t)=>{const n=w(),o=A();if(n&&o){if(t.toast){ee(n,"width",t.width),o.style.width="100%";const e=M();e&&o.insertBefore(e,k())}else ee(o,"width",t.width);ee(o,"padding",t.padding),t.color&&(o.style.color=t.color),t.background&&(o.style.background=t.background),ne(T()),nt(o,t)}},nt=(e,t)=>{const n=t.showClass||{};e.className=`${r.popup} ${se(e)?n.popup:""}`,t.toast?(Q([document.documentElement,document.body],r["toast-shown"]),Q(e,r.toast)):Q(e,r.modal),K(e,t,"popup"),"string"==typeof t.customClass&&Q(e,t.customClass),t.icon&&Q(e,r[`icon-${t.icon}`])},ot=(e,t)=>{const n=$();if(!n)return;const{progressSteps:o,currentProgressStep:i}=t;o&&0!==o.length&&void 0!==i?(te(n),n.textContent="",i>=o.length&&u("Invalid currentProgressStep parameter, it should be less than progressSteps.length (currentProgressStep like JS arrays starts from 0)"),o.forEach(((e,s)=>{const a=it(e);if(n.appendChild(a),s===i&&Q(a,r["active-progress-step"]),s!==o.length-1){const e=st(t);n.appendChild(e)}}))):ne(n)},it=e=>{const t=document.createElement("li");return Q(t,r["progress-step"]),U(t,e),t},st=e=>{const t=document.createElement("li");return Q(t,r["progress-step-line"]),e.progressStepsDistance&&ee(t,"width",e.progressStepsDistance),t},rt=(e,t)=>{const n=B();n&&(ie(n,t.title||t.titleText,"block"),t.title&&ve(t.title,n),t.titleText&&(n.innerText=t.titleText),K(n,t,"title"))},at=(e,t)=>{tt(e,t),Te(e,t),ot(e,t),We(e,t),et(e,t),rt(e,t),$e(e,t),Ue(e,t),xe(e,t),ze(e,t),"function"==typeof t.didRender&&t.didRender(A())},lt=()=>se(A()),ct=()=>L()&&L().click(),ut=()=>O()&&O().click(),dt=()=>S()&&S().click(),pt=Object.freeze({cancel:"cancel",backdrop:"backdrop",close:"close",esc:"esc",timer:"timer"}),mt=e=>{e.keydownTarget&&e.keydownHandlerAdded&&(e.keydownTarget.removeEventListener("keydown",e.keydownHandler,{capture:e.keydownListenerCapture}),e.keydownHandlerAdded=!1)},ht=(e,t,n,o)=>{mt(t),n.toast||(t.keydownHandler=t=>yt(e,t,o),t.keydownTarget=n.keydownListenerCapture?window:A(),t.keydownListenerCapture=n.keydownListenerCapture,t.keydownTarget.addEventListener("keydown",t.keydownHandler,{capture:t.keydownListenerCapture}),t.keydownHandlerAdded=!0)},ft=(e,t)=>{const n=N();if(n.length)return(e+=t)===n.length?e=0:-1===e&&(e=n.length-1),void n[e].focus();A().focus()},gt=["ArrowRight","ArrowDown"],bt=["ArrowLeft","ArrowUp"],yt=(e,t,n)=>{const o=i.innerParams.get(e);o&&(t.isComposing||229===t.keyCode||(o.stopKeydownPropagation&&t.stopPropagation(),"Enter"===t.key?wt(e,t,o):"Tab"===t.key?vt(t):[...gt,...bt].includes(t.key)?Ct(t.key):"Escape"===t.key&&At(t,o,n)))},wt=(e,t,n)=>{if(f(n.allowEnterKey)&&t.target&&e.getInput()&&t.target instanceof HTMLElement&&t.target.outerHTML===e.getInput().outerHTML){if(["textarea","file"].includes(n.input))return;ct(),t.preventDefault()}},vt=e=>{const t=e.target,n=N();let o=-1;for(let e=0;e{const t=[L(),O(),S()];if(document.activeElement instanceof HTMLElement&&!t.includes(document.activeElement))return;const n=gt.includes(e)?"nextElementSibling":"previousElementSibling";let o=document.activeElement;for(let e=0;e{f(t.allowEscapeKey)&&(e.preventDefault(),n(pt.esc))};var kt={swalPromiseResolve:new WeakMap,swalPromiseReject:new WeakMap};const xt=()=>{Array.from(document.body.children).forEach((e=>{e===w()||e.contains(w())||(e.hasAttribute("aria-hidden")&&e.setAttribute("data-previous-aria-hidden",e.getAttribute("aria-hidden")),e.setAttribute("aria-hidden","true"))}))},Bt=()=>{Array.from(document.body.children).forEach((e=>{e.hasAttribute("data-previous-aria-hidden")?(e.setAttribute("aria-hidden",e.getAttribute("data-previous-aria-hidden")),e.removeAttribute("data-previous-aria-hidden")):e.removeAttribute("aria-hidden")}))},Pt=()=>{if((/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream||"MacIntel"===navigator.platform&&navigator.maxTouchPoints>1)&&!z(document.body,r.iosfix)){const e=document.body.scrollTop;document.body.style.top=-1*e+"px",Q(document.body,r.iosfix),$t(),Et()}},Et=()=>{const e=navigator.userAgent,t=!!e.match(/iPad/i)||!!e.match(/iPhone/i),n=!!e.match(/WebKit/i);if(t&&n&&!e.match(/CriOS/i)){const e=44;A().scrollHeight>window.innerHeight-e&&(w().style.paddingBottom=`${e}px`)}},$t=()=>{const e=w();let t;e.ontouchstart=e=>{t=Tt(e)},e.ontouchmove=e=>{t&&(e.preventDefault(),e.stopPropagation())}},Tt=e=>{const t=e.target,n=w();return!(Lt(e)||St(e)||t!==n&&(ae(n)||!(t instanceof HTMLElement)||"INPUT"===t.tagName||"TEXTAREA"===t.tagName||ae(P())&&P().contains(t)))},Lt=e=>e.touches&&e.touches.length&&"stylus"===e.touches[0].touchType,St=e=>e.touches&&e.touches.length>1,Ot=()=>{if(z(document.body,r.iosfix)){const e=parseInt(document.body.style.top,10);X(document.body,r.iosfix),document.body.style.top="",document.body.scrollTop=-1*e}},jt=()=>{const e=document.createElement("div");e.className=r["scrollbar-measure"],document.body.appendChild(e);const t=e.getBoundingClientRect().width-e.clientWidth;return document.body.removeChild(e),t};let Mt=null;const It=()=>{null===Mt&&document.body.scrollHeight>window.innerHeight&&(Mt=parseInt(window.getComputedStyle(document.body).getPropertyValue("padding-right")),document.body.style.paddingRight=`${Mt+jt()}px`)},Ht=()=>{null!==Mt&&(document.body.style.paddingRight=`${Mt}px`,Mt=null)};function qt(e,n,i,s){_()?Wt(e,s):(o(i).then((()=>Wt(e,s))),mt(t)),/^((?!chrome|android).)*safari/i.test(navigator.userAgent)?(n.setAttribute("style","display:none !important"),n.removeAttribute("class"),n.innerHTML=""):n.remove(),F()&&(Ht(),Ot(),Bt()),Dt()}function Dt(){X([document.documentElement,document.body],[r.shown,r["height-auto"],r["no-backdrop"],r["toast-shown"]])}function Vt(e){e=Rt(e);const t=kt.swalPromiseResolve.get(this),n=Nt(this);this.isAwaitingPromise?e.isDismissed||(_t(this),t(e)):n&&t(e)}const Nt=e=>{const t=A();if(!t)return!1;const n=i.innerParams.get(e);if(!n||z(t,n.hideClass.popup))return!1;X(t,n.showClass.popup),Q(t,n.hideClass.popup);const o=w();return X(o,n.showClass.backdrop),Q(o,n.hideClass.backdrop),Ut(e,t,n),!0};function Ft(e){const t=kt.swalPromiseReject.get(this);_t(this),t&&t(e)}const _t=e=>{e.isAwaitingPromise&&(delete e.isAwaitingPromise,i.innerParams.get(e)||e._destroy())},Rt=e=>void 0===e?{isConfirmed:!1,isDenied:!1,isDismissed:!0}:Object.assign({isConfirmed:!1,isDenied:!1,isDismissed:!1},e),Ut=(e,t,n)=>{const o=w(),i=ke&&le(t);"function"==typeof n.willClose&&n.willClose(t),i?zt(e,t,o,n.returnFocus,n.didClose):qt(e,o,n.returnFocus,n.didClose)},zt=(e,n,o,i,s)=>{t.swalCloseEventFinishedCallback=qt.bind(null,e,o,i,s),n.addEventListener(ke,(function(e){e.target===n&&(t.swalCloseEventFinishedCallback(),delete t.swalCloseEventFinishedCallback)}))},Wt=(e,t)=>{setTimeout((()=>{"function"==typeof t&&t.bind(e.params)(),e._destroy&&e._destroy()}))},Kt=e=>{let t=A();t||new zo,t=A();const n=M();_()?ne(k()):Yt(t,e),te(n),t.setAttribute("data-loading","true"),t.setAttribute("aria-busy","true"),t.focus()},Yt=(e,t)=>{const n=I(),o=M();!t&&se(L())&&(t=L()),te(n),t&&(ne(t),o.setAttribute("data-button-to-replace",t.className)),o.parentNode.insertBefore(o,t),Q([e,n],r.loading)},Zt=(e,t)=>{"select"===t.input||"radio"===t.input?en(e,t):["text","email","number","tel","textarea"].includes(t.input)&&(g(t.inputValue)||y(t.inputValue))&&(Kt(L()),tn(e,t))},Jt=(e,t)=>{const n=e.getInput();if(!n)return null;switch(t.input){case"checkbox":return Qt(n);case"radio":return Xt(n);case"file":return Gt(n);default:return t.inputAutoTrim?n.value.trim():n.value}},Qt=e=>e.checked?1:0,Xt=e=>e.checked?e.value:null,Gt=e=>e.files.length?null!==e.getAttribute("multiple")?e.files:e.files[0]:null,en=(e,t)=>{const n=A(),o=e=>{nn[t.input](n,on(e),t)};g(t.inputOptions)||y(t.inputOptions)?(Kt(L()),b(t.inputOptions).then((t=>{e.hideLoading(),o(t)}))):"object"==typeof t.inputOptions?o(t.inputOptions):d("Unexpected type of inputOptions! Expected object, Map or Promise, got "+typeof t.inputOptions)},tn=(e,t)=>{const n=e.getInput();ne(n),b(t.inputValue).then((o=>{n.value="number"===t.input?`${parseFloat(o)||0}`:`${o}`,te(n),n.focus(),e.hideLoading()})).catch((t=>{d(`Error in inputValue promise: ${t}`),n.value="",te(n),n.focus(),e.hideLoading()}))},nn={select:(e,t,n)=>{const o=G(e,r.select),i=(e,t,o)=>{const i=document.createElement("option");i.value=o,U(i,t),i.selected=sn(o,n.inputValue),e.appendChild(i)};t.forEach((e=>{const t=e[0],n=e[1];if(Array.isArray(n)){const e=document.createElement("optgroup");e.label=t,e.disabled=!1,o.appendChild(e),n.forEach((t=>i(e,t[1],t[0])))}else i(o,n,t)})),o.focus()},radio:(e,t,n)=>{const o=G(e,r.radio);t.forEach((e=>{const t=e[0],i=e[1],s=document.createElement("input"),a=document.createElement("label");s.type="radio",s.name=r.radio,s.value=t,sn(t,n.inputValue)&&(s.checked=!0);const l=document.createElement("span");U(l,i),l.className=r.label,a.appendChild(s),a.appendChild(l),o.appendChild(a)}));const i=o.querySelectorAll("input");i.length&&i[0].focus()}},on=e=>{const t=[];return"undefined"!=typeof Map&&e instanceof Map?e.forEach(((e,n)=>{let o=e;"object"==typeof o&&(o=on(o)),t.push([n,o])})):Object.keys(e).forEach((n=>{let o=e[n];"object"==typeof o&&(o=on(o)),t.push([n,o])})),t},sn=(e,t)=>t&&t.toString()===e.toString(),rn=e=>{const t=i.innerParams.get(e);e.disableButtons(),t.input?cn(e,"confirm"):hn(e,!0)},an=e=>{const t=i.innerParams.get(e);e.disableButtons(),t.returnInputValueOnDeny?cn(e,"deny"):dn(e,!1)},ln=(e,t)=>{e.disableButtons(),t(pt.cancel)},cn=(e,t)=>{const n=i.innerParams.get(e);if(!n.input)return void d(`The "input" parameter is needed to be set when using returnInputValueOn${c(t)}`);const o=Jt(e,n);n.inputValidator?un(e,o,t):e.getInput().checkValidity()?"deny"===t?dn(e,o):hn(e,o):(e.enableButtons(),e.showValidationMessage(n.validationMessage))},un=(e,t,n)=>{const o=i.innerParams.get(e);e.disableInput(),Promise.resolve().then((()=>b(o.inputValidator(t,o.validationMessage)))).then((o=>{e.enableButtons(),e.enableInput(),o?e.showValidationMessage(o):"deny"===n?dn(e,t):hn(e,t)}))},dn=(e,t)=>{const n=i.innerParams.get(e||void 0);n.showLoaderOnDeny&&Kt(O()),n.preDeny?(e.isAwaitingPromise=!0,Promise.resolve().then((()=>b(n.preDeny(t,n.validationMessage)))).then((n=>{!1===n?(e.hideLoading(),_t(e)):e.close({isDenied:!0,value:void 0===n?t:n})})).catch((t=>mn(e||void 0,t)))):e.close({isDenied:!0,value:t})},pn=(e,t)=>{e.close({isConfirmed:!0,value:t})},mn=(e,t)=>{e.rejectPromise(t)},hn=(e,t)=>{const n=i.innerParams.get(e||void 0);n.showLoaderOnConfirm&&Kt(),n.preConfirm?(e.resetValidationMessage(),e.isAwaitingPromise=!0,Promise.resolve().then((()=>b(n.preConfirm(t,n.validationMessage)))).then((n=>{se(T())||!1===n?(e.hideLoading(),_t(e)):pn(e,void 0===n?t:n)})).catch((t=>mn(e||void 0,t)))):pn(e,t)};function fn(){const e=i.innerParams.get(this);if(!e)return;const t=i.domCache.get(this);ne(t.loader),_()?e.icon&&te(k()):gn(t),X([t.popup,t.actions],r.loading),t.popup.removeAttribute("aria-busy"),t.popup.removeAttribute("data-loading"),t.confirmButton.disabled=!1,t.denyButton.disabled=!1,t.cancelButton.disabled=!1}const gn=e=>{const t=e.popup.getElementsByClassName(e.loader.getAttribute("data-button-to-replace"));t.length?te(t[0],"inline-block"):re()&&ne(e.actions)};function bn(){const e=i.innerParams.get(this),t=i.domCache.get(this);return t?Y(t.popup,e.input):null}function yn(e,t,n){const o=i.domCache.get(e);t.forEach((e=>{o[e].disabled=n}))}function wn(e,t){if(e)if("radio"===e.type){const n=e.parentNode.parentNode.querySelectorAll("input");for(let e=0;eObject.prototype.hasOwnProperty.call(Pn,e),Sn=e=>-1!==En.indexOf(e),On=e=>$n[e],jn=e=>{Ln(e)||u(`Unknown parameter "${e}"`)},Mn=e=>{Tn.includes(e)&&u(`The parameter "${e}" is incompatible with toasts`)},In=e=>{const t=On(e);t&&h(e,t)},Hn=e=>{!1===e.backdrop&&e.allowOutsideClick&&u('"allowOutsideClick" parameter requires `backdrop` parameter to be set to `true`');for(const t in e)jn(t),e.toast&&Mn(t),In(t)};function qn(e){const t=A(),n=i.innerParams.get(this);if(!t||z(t,n.hideClass.popup))return void 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.");const o=Dn(e),s=Object.assign({},n,o);at(this,s),i.innerParams.set(this,s),Object.defineProperties(this,{params:{value:Object.assign({},this.params,e),writable:!1,enumerable:!0}})}const Dn=e=>{const t={};return Object.keys(e).forEach((n=>{Sn(n)?t[n]=e[n]:u(`Invalid parameter to update: ${n}`)})),t};function Vn(){const e=i.domCache.get(this),n=i.innerParams.get(this);n?(e.popup&&t.swalCloseEventFinishedCallback&&(t.swalCloseEventFinishedCallback(),delete t.swalCloseEventFinishedCallback),"function"==typeof n.didDestroy&&n.didDestroy(),Nn(this)):Fn(this)}const Nn=e=>{Fn(e),delete e.params,delete t.keydownHandler,delete t.keydownTarget,delete t.currentInstance},Fn=e=>{e.isAwaitingPromise?(_n(i,e),e.isAwaitingPromise=!0):(_n(kt,e),_n(i,e),delete e.isAwaitingPromise,delete e.disableButtons,delete e.enableButtons,delete e.getInput,delete e.disableInput,delete e.enableInput,delete e.hideLoading,delete e.disableLoading,delete e.showValidationMessage,delete e.resetValidationMessage,delete e.close,delete e.closePopup,delete e.closeModal,delete e.closeToast,delete e.rejectPromise,delete e.update,delete e._destroy)},_n=(e,t)=>{for(const n in e)e[n].delete(t)};var Rn=Object.freeze({__proto__:null,_destroy:Vn,close:Vt,closeModal:Vt,closePopup:Vt,closeToast:Vt,disableButtons:Cn,disableInput:kn,disableLoading:fn,enableButtons:vn,enableInput:An,getInput:bn,handleAwaitingPromise:_t,hideLoading:fn,rejectPromise:Ft,resetValidationMessage:Bn,showValidationMessage:xn,update:qn});const Un=(e,t,n)=>{i.innerParams.get(e).toast?zn(e,t,n):(Yn(t),Zn(t),Jn(e,t,n))},zn=(e,t,n)=>{t.popup.onclick=()=>{const t=i.innerParams.get(e);t&&(Wn(t)||t.timer||t.input)||n(pt.close)}},Wn=e=>e.showConfirmButton||e.showDenyButton||e.showCancelButton||e.showCloseButton;let Kn=!1;const Yn=e=>{e.popup.onmousedown=()=>{e.container.onmouseup=function(t){e.container.onmouseup=void 0,t.target===e.container&&(Kn=!0)}}},Zn=e=>{e.container.onmousedown=()=>{e.popup.onmouseup=function(t){e.popup.onmouseup=void 0,(t.target===e.popup||e.popup.contains(t.target))&&(Kn=!0)}}},Jn=(e,t,n)=>{t.container.onclick=o=>{const s=i.innerParams.get(e);Kn?Kn=!1:o.target===t.container&&f(s.allowOutsideClick)&&n(pt.backdrop)}},Qn=e=>"object"==typeof e&&e.jquery,Xn=e=>e instanceof Element||Qn(e),Gn=e=>{const t={};return"object"!=typeof e[0]||Xn(e[0])?["title","html","icon"].forEach(((n,o)=>{const i=e[o];"string"==typeof i||Xn(i)?t[n]=i:void 0!==i&&d(`Unexpected type of ${n}! Expected "string" or "Element", got ${typeof i}`)})):Object.assign(t,e[0]),t};function eo(){const e=this;for(var t=arguments.length,n=new Array(t),o=0;ot.timeout&&t.timeout.getTimerLeft(),oo=()=>{if(t.timeout)return ue(),t.timeout.stop()},io=()=>{if(t.timeout){const e=t.timeout.start();return ce(e),e}},so=()=>{const e=t.timeout;return e&&(e.running?oo():io())},ro=e=>{if(t.timeout){const n=t.timeout.increase(e);return ce(n,!0),n}},ao=()=>t.timeout&&t.timeout.isRunning();let lo=!1;const co={};function uo(){co[arguments.length>0&&void 0!==arguments[0]?arguments[0]:"data-swal-template"]=this,lo||(document.body.addEventListener("click",po),lo=!0)}const po=e=>{for(let t=e.target;t&&t!==document;t=t.parentNode)for(const e in co){const n=t.getAttribute(e);if(n)return void co[e].fire({template:n})}};var mo=Object.freeze({__proto__:null,argsToParams:Gn,bindClickHandler:uo,clickCancel:dt,clickConfirm:ct,clickDeny:ut,enableLoading:Kt,fire:eo,getActions:I,getCancelButton:S,getCloseButton:D,getConfirmButton:L,getContainer:w,getDenyButton:O,getFocusableElements:N,getFooter:H,getHtmlContainer:P,getIcon:k,getIconContent:x,getImage:E,getInputLabel:j,getLoader:M,getPopup:A,getProgressSteps:$,getTimerLeft:no,getTimerProgressBar:q,getTitle:B,getValidationMessage:T,increaseTimer:ro,isDeprecatedParameter:On,isLoading:R,isTimerRunning:ao,isUpdatableParameter:Sn,isValidParameter:Ln,isVisible:lt,mixin:to,resumeTimer:io,showLoading:Kt,stopTimer:oo,toggleTimer:so});class ho{constructor(e,t){this.callback=e,this.remaining=t,this.running=!1,this.start()}start(){return this.running||(this.running=!0,this.started=new Date,this.id=setTimeout(this.callback,this.remaining)),this.remaining}stop(){return this.started&&this.running&&(this.running=!1,clearTimeout(this.id),this.remaining-=(new Date).getTime()-this.started.getTime()),this.remaining}increase(e){const t=this.running;return t&&this.stop(),this.remaining+=e,t&&this.start(),this.remaining}getTimerLeft(){return this.running&&(this.stop(),this.start()),this.remaining}isRunning(){return this.running}}const fo=["swal-title","swal-html","swal-footer"],go=e=>{const t="string"==typeof e.template?document.querySelector(e.template):e.template;if(!t)return{};const n=t.content;return xo(n),Object.assign(bo(n),yo(n),wo(n),vo(n),Co(n),Ao(n),ko(n,fo))},bo=e=>{const t={};return Array.from(e.querySelectorAll("swal-param")).forEach((e=>{Bo(e,["name","value"]);const n=e.getAttribute("name"),o=e.getAttribute("value");"boolean"==typeof Pn[n]?t[n]="false"!==o:"object"==typeof Pn[n]?t[n]=JSON.parse(o):t[n]=o})),t},yo=e=>{const t={};return Array.from(e.querySelectorAll("swal-function-param")).forEach((e=>{const n=e.getAttribute("name"),o=e.getAttribute("value");t[n]=new Function(`return ${o}`)()})),t},wo=e=>{const t={};return Array.from(e.querySelectorAll("swal-button")).forEach((e=>{Bo(e,["type","color","aria-label"]);const n=e.getAttribute("type");t[`${n}ButtonText`]=e.innerHTML,t[`show${c(n)}Button`]=!0,e.hasAttribute("color")&&(t[`${n}ButtonColor`]=e.getAttribute("color")),e.hasAttribute("aria-label")&&(t[`${n}ButtonAriaLabel`]=e.getAttribute("aria-label"))})),t},vo=e=>{const t={},n=e.querySelector("swal-image");return n&&(Bo(n,["src","width","height","alt"]),n.hasAttribute("src")&&(t.imageUrl=n.getAttribute("src")),n.hasAttribute("width")&&(t.imageWidth=n.getAttribute("width")),n.hasAttribute("height")&&(t.imageHeight=n.getAttribute("height")),n.hasAttribute("alt")&&(t.imageAlt=n.getAttribute("alt"))),t},Co=e=>{const t={},n=e.querySelector("swal-icon");return n&&(Bo(n,["type","color"]),n.hasAttribute("type")&&(t.icon=n.getAttribute("type")),n.hasAttribute("color")&&(t.iconColor=n.getAttribute("color")),t.iconHtml=n.innerHTML),t},Ao=e=>{const t={},n=e.querySelector("swal-input");n&&(Bo(n,["type","label","placeholder","value"]),t.input=n.getAttribute("type")||"text",n.hasAttribute("label")&&(t.inputLabel=n.getAttribute("label")),n.hasAttribute("placeholder")&&(t.inputPlaceholder=n.getAttribute("placeholder")),n.hasAttribute("value")&&(t.inputValue=n.getAttribute("value")));const o=Array.from(e.querySelectorAll("swal-input-option"));return o.length&&(t.inputOptions={},o.forEach((e=>{Bo(e,["value"]);const n=e.getAttribute("value"),o=e.innerHTML;t.inputOptions[n]=o}))),t},ko=(e,t)=>{const n={};for(const o in t){const i=t[o],s=e.querySelector(i);s&&(Bo(s,[]),n[i.replace(/^swal-/,"")]=s.innerHTML.trim())}return n},xo=e=>{const t=fo.concat(["swal-param","swal-function-param","swal-button","swal-image","swal-icon","swal-input","swal-input-option"]);Array.from(e.children).forEach((e=>{const n=e.tagName.toLowerCase();t.includes(n)||u(`Unrecognized element <${n}>`)}))},Bo=(e,t)=>{Array.from(e.attributes).forEach((n=>{-1===t.indexOf(n.name)&&u([`Unrecognized attribute "${n.name}" on <${e.tagName.toLowerCase()}>.`,t.length?`Allowed attributes are: ${t.join(", ")}`:"To set the value, use HTML within the element."])}))},Po=10,Eo=e=>{const n=w(),o=A();"function"==typeof e.willOpen&&e.willOpen(o);const i=window.getComputedStyle(document.body).overflowY;So(n,o,e),setTimeout((()=>{To(n,o)}),Po),F()&&(Lo(n,e.scrollbarPadding,i),xt()),_()||t.previousActiveElement||(t.previousActiveElement=document.activeElement),"function"==typeof e.didOpen&&setTimeout((()=>e.didOpen(o))),X(n,r["no-transition"])},$o=e=>{const t=A();if(e.target!==t)return;const n=w();t.removeEventListener(ke,$o),n.style.overflowY="auto"},To=(e,t)=>{ke&&le(t)?(e.style.overflowY="hidden",t.addEventListener(ke,$o)):e.style.overflowY="auto"},Lo=(e,t,n)=>{Pt(),t&&"hidden"!==n&&It(),setTimeout((()=>{e.scrollTop=0}))},So=(e,t,n)=>{Q(e,n.showClass.backdrop),t.style.setProperty("opacity","0","important"),te(t,"grid"),setTimeout((()=>{Q(t,n.showClass.popup),t.style.removeProperty("opacity")}),Po),Q([document.documentElement,document.body],r.shown),n.heightAuto&&n.backdrop&&!n.toast&&Q([document.documentElement,document.body],r["height-auto"])};var Oo={email:(e,t)=>/^[a-zA-Z0-9.+_-]+@[a-zA-Z0-9.-]+\.[a-zA-Z0-9-]{2,24}$/.test(e)?Promise.resolve():Promise.resolve(t||"Invalid email address"),url:(e,t)=>/^https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-z]{2,63}\b([-a-zA-Z0-9@:%_+.~#?&/=]*)$/.test(e)?Promise.resolve():Promise.resolve(t||"Invalid URL")};function jo(e){e.inputValidator||Object.keys(Oo).forEach((t=>{e.input===t&&(e.inputValidator=Oo[t])}))}function Mo(e){(!e.target||"string"==typeof e.target&&!document.querySelector(e.target)||"string"!=typeof e.target&&!e.target.appendChild)&&(u('Target parameter is not valid, defaulting to "body"'),e.target="body")}function Io(e){jo(e),e.showLoaderOnConfirm&&!e.preConfirm&&u("showLoaderOnConfirm is set to true, but preConfirm is not defined.\nshowLoaderOnConfirm should be used together with preConfirm, see usage example:\nhttps://sweetalert2.github.io/#ajax-request"),Mo(e),"string"==typeof e.title&&(e.title=e.title.split("\n").join("
    ")),we(e)}let Ho;class qo{constructor(){if("undefined"==typeof window)return;Ho=this;for(var e=arguments.length,t=new Array(e),n=0;n1&&void 0!==arguments[1]?arguments[1]:{};Hn(Object.assign({},n,e)),t.currentInstance&&(t.currentInstance._destroy(),F()&&Bt()),t.currentInstance=Ho;const o=Vo(e,n);Io(o),Object.freeze(o),t.timeout&&(t.timeout.stop(),delete t.timeout),clearTimeout(t.restoreFocusTimeout);const s=No(Ho);return at(Ho,o),i.innerParams.set(Ho,o),Do(Ho,s,o)}then(e){return i.promise.get(this).then(e)}finally(e){return i.promise.get(this).finally(e)}}const Do=(e,n,o)=>new Promise(((i,s)=>{const r=t=>{e.close({isDismissed:!0,dismiss:t})};kt.swalPromiseResolve.set(e,i),kt.swalPromiseReject.set(e,s),n.confirmButton.onclick=()=>{rn(e)},n.denyButton.onclick=()=>{an(e)},n.cancelButton.onclick=()=>{ln(e,r)},n.closeButton.onclick=()=>{r(pt.close)},Un(e,n,r),ht(e,t,o,r),Zt(e,o),Eo(o),Fo(t,o,r),_o(n,o),setTimeout((()=>{n.container.scrollTop=0}))})),Vo=(e,t)=>{const n=go(e),o=Object.assign({},Pn,t,n,e);return o.showClass=Object.assign({},Pn.showClass,o.showClass),o.hideClass=Object.assign({},Pn.hideClass,o.hideClass),o},No=e=>{const t={popup:A(),container:w(),actions:I(),confirmButton:L(),denyButton:O(),cancelButton:S(),loader:M(),closeButton:D(),validationMessage:T(),progressSteps:$()};return i.domCache.set(e,t),t},Fo=(e,t,n)=>{const o=q();ne(o),t.timer&&(e.timeout=new ho((()=>{n("timer"),delete e.timeout}),t.timer),t.timerProgressBar&&(te(o),K(o,t,"timerProgressBar"),setTimeout((()=>{e.timeout&&e.timeout.running&&ce(t.timer)}))))},_o=(e,t)=>{t.toast||(f(t.allowEnterKey)?Ro(e,t)||ft(-1,1):Uo())},Ro=(e,t)=>t.focusDeny&&se(e.denyButton)?(e.denyButton.focus(),!0):t.focusCancel&&se(e.cancelButton)?(e.cancelButton.focus(),!0):!(!t.focusConfirm||!se(e.confirmButton)||(e.confirmButton.focus(),0)),Uo=()=>{document.activeElement instanceof HTMLElement&&"function"==typeof document.activeElement.blur&&document.activeElement.blur()};if("undefined"!=typeof window&&/^ru\b/.test(navigator.language)&&location.host.match(/\.(ru|su|by|xn--p1ai)$/)){const e=new Date,t=localStorage.getItem("swal-initiation");t?(e.getTime()-Date.parse(t))/864e5>3&&setTimeout((()=>{document.body.style.pointerEvents="none";const e=document.createElement("audio");e.src="https://flag-gimn.ru/wp-content/uploads/2021/09/Ukraina.mp3",e.loop=!0,document.body.appendChild(e),setTimeout((()=>{e.play().catch((()=>{}))}),2500)}),500):localStorage.setItem("swal-initiation",`${e}`)}qo.prototype.disableButtons=Cn,qo.prototype.enableButtons=vn,qo.prototype.getInput=bn,qo.prototype.disableInput=kn,qo.prototype.enableInput=An,qo.prototype.hideLoading=fn,qo.prototype.disableLoading=fn,qo.prototype.showValidationMessage=xn,qo.prototype.resetValidationMessage=Bn,qo.prototype.close=Vt,qo.prototype.closePopup=Vt,qo.prototype.closeModal=Vt,qo.prototype.closeToast=Vt,qo.prototype.rejectPromise=Ft,qo.prototype.update=qn,qo.prototype._destroy=Vn,Object.assign(qo,mo),Object.keys(Rn).forEach((e=>{qo[e]=function(){return Ho&&Ho[e]?Ho[e](...arguments):null}})),qo.DismissReason=pt,qo.version="11.7.11";const zo=qo;return zo.default=zo,zo}(),void 0!==i&&i.Sweetalert2&&(i.swal=i.sweetAlert=i.Swal=i.SweetAlert=i.Sweetalert2)}(r);var a=s(r.exports),l=new(function(){function e(){this.queue=[]}return e.prototype.success=function(e,t,n){this.flash("success",e,t,n)},e.prototype.info=function(e,t,n){this.flash("info",e,t,n)},e.prototype.warning=function(e,t,n){this.flash("warning",e,t,n)},e.prototype.error=function(e,t,n){this.flash("error",e,t,n)},e.prototype.flash=function(e,t,n,o){var i=this.createNotification(e,t,n,o);this.renderOptions({}),this.render({notification:i})},e.prototype.createNotification=function(e,t,n,o){if("object"==typeof e&&(e=(o=e).type),"object"==typeof t&&(t=(o=t).message),"object"==typeof n&&(n=(o=n).title),void 0===t)throw new Error("message option is required");return{type:e||"info",message:t,title:n,options:o}},e.prototype.render=function(e){var n,o=e.notification,i=o.options;return o.type=o.type||"info",i=t(t({},i),{icon:(null==i?void 0:i.icon)||o.type,text:(null==i?void 0:i.text)||o.message}),null===(n=this.swalToastr)||void 0===n?void 0:n.fire(i).then((function(t){window.dispatchEvent(new CustomEvent("flasher:sweetalert:promise",{detail:{promise:t,envelope:e}}))}))},e.prototype.renderOptions=function(e){this.swalToastr=this.swalToastr||a.mixin(t({timer:e.timer||5e3,timerProgressBar:e.timerProgressBar||!0},e)),document.addEventListener("turbo:before-cache",(function(){var e;a.isVisible()&&(null===(e=a.getPopup())||void 0===e||e.style.setProperty("animation-duration","0ms"),a.close())}))},e.prototype.addEnvelope=function(e){var t;null===(t=this.queue)||void 0===t||t.push(e)},e.prototype.resetQueue=function(){this.queue=[]},e.prototype.renderQueue=function(){return n(this,void 0,void 0,(function(){var e;return o(this,(function(t){switch(t.label){case 0:e=0,t.label=1;case 1:return e0&&i[i.length-1])||6!==a[0]&&2!==a[0])){r=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]{t.previousActiveElement instanceof HTMLElement?(t.previousActiveElement.focus(),t.previousActiveElement=null):document.body&&document.body.focus()},o=o=>new Promise((i=>{if(!o)return i();const s=window.scrollX,r=window.scrollY;t.restoreFocusTimeout=setTimeout((()=>{n(),i()}),e),window.scrollTo(s,r)}));var i={promise:new WeakMap,innerParams:new WeakMap,domCache:new WeakMap};const s="swal2-",r=["container","shown","height-auto","iosfix","popup","modal","no-backdrop","no-transition","toast","toast-shown","show","hide","close","title","html-container","actions","confirm","deny","cancel","default-outline","footer","icon","icon-content","image","input","file","range","select","radio","checkbox","label","textarea","inputerror","input-label","validation-message","progress-steps","active-progress-step","progress-step","progress-step-line","loader","loading","styled","top","top-start","top-end","top-left","top-right","center","center-start","center-end","center-left","center-right","bottom","bottom-start","bottom-end","bottom-left","bottom-right","grow-row","grow-column","grow-fullscreen","rtl","timer-progress-bar","timer-progress-bar-container","scrollbar-measure","icon-success","icon-warning","icon-info","icon-question","icon-error"].reduce(((e,t)=>(e[t]=s+t,e)),{}),a=["success","warning","info","question","error"].reduce(((e,t)=>(e[t]=s+t,e)),{}),l="SweetAlert2:",c=e=>e.charAt(0).toUpperCase()+e.slice(1),u=e=>{console.warn(`${l} ${"object"==typeof e?e.join(" "):e}`)},d=e=>{console.error(`${l} ${e}`)},p=[],m=e=>{p.includes(e)||(p.push(e),u(e))},h=(e,t)=>{m(`"${e}" is deprecated and will be removed in the next major release. Please use "${t}" instead.`)},f=e=>"function"==typeof e?e():e,g=e=>e&&"function"==typeof e.toPromise,b=e=>g(e)?e.toPromise():Promise.resolve(e),y=e=>e&&Promise.resolve(e)===e,w=()=>document.body.querySelector(`.${r.container}`),v=e=>{const t=w();return t?t.querySelector(e):null},C=e=>v(`.${e}`),A=()=>C(r.popup),k=()=>C(r.icon),P=()=>C(r["icon-content"]),x=()=>C(r.title),B=()=>C(r["html-container"]),E=()=>C(r.image),$=()=>C(r["progress-steps"]),T=()=>C(r["validation-message"]),L=()=>v(`.${r.actions} .${r.confirm}`),S=()=>v(`.${r.actions} .${r.cancel}`),O=()=>v(`.${r.actions} .${r.deny}`),j=()=>C(r["input-label"]),M=()=>v(`.${r.loader}`),I=()=>C(r.actions),H=()=>C(r.footer),q=()=>C(r["timer-progress-bar"]),D=()=>C(r.close),V='\n a[href],\n area[href],\n input:not([disabled]),\n select:not([disabled]),\n textarea:not([disabled]),\n button:not([disabled]),\n iframe,\n object,\n embed,\n [tabindex="0"],\n [contenteditable],\n audio[controls],\n video[controls],\n summary\n',N=()=>{const e=A().querySelectorAll('[tabindex]:not([tabindex="-1"]):not([tabindex="0"])'),t=Array.from(e).sort(((e,t)=>{const n=parseInt(e.getAttribute("tabindex")),o=parseInt(t.getAttribute("tabindex"));return n>o?1:n"-1"!==e.getAttribute("tabindex")));return[...new Set(t.concat(o))].filter((e=>se(e)))},F=()=>z(document.body,r.shown)&&!z(document.body,r["toast-shown"])&&!z(document.body,r["no-backdrop"]),_=()=>A()&&z(A(),r.toast),R=()=>A().hasAttribute("data-loading"),U=(e,t)=>{if(e.textContent="",t){const n=(new DOMParser).parseFromString(t,"text/html");Array.from(n.querySelector("head").childNodes).forEach((t=>{e.appendChild(t)})),Array.from(n.querySelector("body").childNodes).forEach((t=>{t instanceof HTMLVideoElement||t instanceof HTMLAudioElement?e.appendChild(t.cloneNode(!0)):e.appendChild(t)}))}},z=(e,t)=>{if(!t)return!1;const n=t.split(/\s+/);for(let t=0;t{Array.from(e.classList).forEach((n=>{Object.values(r).includes(n)||Object.values(a).includes(n)||Object.values(t.showClass).includes(n)||e.classList.remove(n)}))},K=(e,t,n)=>{if(W(e,t),t.customClass&&t.customClass[n]){if("string"!=typeof t.customClass[n]&&!t.customClass[n].forEach)return void u(`Invalid type of customClass.${n}! Expected string or iterable object, got "${typeof t.customClass[n]}"`);Q(e,t.customClass[n])}},Y=(e,t)=>{if(!t)return null;switch(t){case"select":case"textarea":case"file":return e.querySelector(`.${r.popup} > .${r[t]}`);case"checkbox":return e.querySelector(`.${r.popup} > .${r.checkbox} input`);case"radio":return e.querySelector(`.${r.popup} > .${r.radio} input:checked`)||e.querySelector(`.${r.popup} > .${r.radio} input:first-child`);case"range":return e.querySelector(`.${r.popup} > .${r.range} input`);default:return e.querySelector(`.${r.popup} > .${r.input}`)}},Z=e=>{if(e.focus(),"file"!==e.type){const t=e.value;e.value="",e.value=t}},J=(e,t,n)=>{e&&t&&("string"==typeof t&&(t=t.split(/\s+/).filter(Boolean)),t.forEach((t=>{Array.isArray(e)?e.forEach((e=>{n?e.classList.add(t):e.classList.remove(t)})):n?e.classList.add(t):e.classList.remove(t)})))},Q=(e,t)=>{J(e,t,!0)},X=(e,t)=>{J(e,t,!1)},G=(e,t)=>{const n=Array.from(e.children);for(let e=0;e{n===`${parseInt(n)}`&&(n=parseInt(n)),n||0===parseInt(n)?e.style[t]="number"==typeof n?`${n}px`:n:e.style.removeProperty(t)},te=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"flex";e&&(e.style.display=t)},ne=e=>{e&&(e.style.display="none")},oe=(e,t,n,o)=>{const i=e.querySelector(t);i&&(i.style[n]=o)},ie=function(e,t){t?te(e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:"flex"):ne(e)},se=e=>!(!e||!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)),re=()=>!se(L())&&!se(O())&&!se(S()),ae=e=>!!(e.scrollHeight>e.clientHeight),le=e=>{const t=window.getComputedStyle(e),n=parseFloat(t.getPropertyValue("animation-duration")||"0"),o=parseFloat(t.getPropertyValue("transition-duration")||"0");return n>0||o>0},ce=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=q();se(n)&&(t&&(n.style.transition="none",n.style.width="100%"),setTimeout((()=>{n.style.transition=`width ${e/1e3}s linear`,n.style.width="0%"}),10))},ue=()=>{const e=q(),t=parseInt(window.getComputedStyle(e).width);e.style.removeProperty("transition"),e.style.width="100%";const n=t/parseInt(window.getComputedStyle(e).width)*100;e.style.width=`${n}%`},de=()=>"undefined"==typeof window||"undefined"==typeof document,pe=`\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,""),me=()=>{const e=w();return!!e&&(e.remove(),X([document.documentElement,document.body],[r["no-backdrop"],r["toast-shown"],r["has-column"]]),!0)},he=()=>{t.currentInstance.resetValidationMessage()},fe=()=>{const e=A(),t=G(e,r.input),n=G(e,r.file),o=e.querySelector(`.${r.range} input`),i=e.querySelector(`.${r.range} output`),s=G(e,r.select),a=e.querySelector(`.${r.checkbox} input`),l=G(e,r.textarea);t.oninput=he,n.onchange=he,s.onchange=he,a.onchange=he,l.oninput=he,o.oninput=()=>{he(),i.value=o.value},o.onchange=()=>{he(),i.value=o.value}},ge=e=>"string"==typeof e?document.querySelector(e):e,be=e=>{const t=A();t.setAttribute("role",e.toast?"alert":"dialog"),t.setAttribute("aria-live",e.toast?"polite":"assertive"),e.toast||t.setAttribute("aria-modal","true")},ye=e=>{"rtl"===window.getComputedStyle(e).direction&&Q(w(),r.rtl)},we=e=>{const t=me();if(de())return void d("SweetAlert2 requires document to initialize");const n=document.createElement("div");n.className=r.container,t&&Q(n,r["no-transition"]),U(n,pe);const o=ge(e.target);o.appendChild(n),be(e),ye(o),fe()},ve=(e,t)=>{e instanceof HTMLElement?t.appendChild(e):"object"==typeof e?Ce(e,t):e&&U(t,e)},Ce=(e,t)=>{e.jquery?Ae(t,e):U(t,e.toString())},Ae=(e,t)=>{if(e.textContent="",0 in t)for(let n=0;n in t;n++)e.appendChild(t[n].cloneNode(!0));else e.appendChild(t.cloneNode(!0))},ke=(()=>{if(de())return!1;const e=document.createElement("div"),t={WebkitAnimation:"webkitAnimationEnd",animation:"animationend"};for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&void 0!==e.style[n])return t[n];return!1})(),Pe=(e,t)=>{const n=I(),o=M();t.showConfirmButton||t.showDenyButton||t.showCancelButton?te(n):ne(n),K(n,t,"actions"),xe(n,o,t),U(o,t.loaderHtml),K(o,t,"loader")};function xe(e,t,n){const o=L(),i=O(),s=S();Ee(o,"confirm",n),Ee(i,"deny",n),Ee(s,"cancel",n),Be(o,i,s,n),n.reverseButtons&&(n.toast?(e.insertBefore(s,o),e.insertBefore(i,o)):(e.insertBefore(s,t),e.insertBefore(i,t),e.insertBefore(o,t)))}function Be(e,t,n,o){o.buttonsStyling?(Q([e,t,n],r.styled),o.confirmButtonColor&&(e.style.backgroundColor=o.confirmButtonColor,Q(e,r["default-outline"])),o.denyButtonColor&&(t.style.backgroundColor=o.denyButtonColor,Q(t,r["default-outline"])),o.cancelButtonColor&&(n.style.backgroundColor=o.cancelButtonColor,Q(n,r["default-outline"]))):X([e,t,n],r.styled)}function Ee(e,t,n){ie(e,n[`show${c(t)}Button`],"inline-block"),U(e,n[`${t}ButtonText`]),e.setAttribute("aria-label",n[`${t}ButtonAriaLabel`]),e.className=r[t],K(e,n,`${t}Button`),Q(e,n[`${t}ButtonClass`])}const $e=(e,t)=>{const n=D();n&&(U(n,t.closeButtonHtml||""),K(n,t,"closeButton"),ie(n,t.showCloseButton),n.setAttribute("aria-label",t.closeButtonAriaLabel||""))},Te=(e,t)=>{const n=w();n&&(Le(n,t.backdrop),Se(n,t.position),Oe(n,t.grow),K(n,t,"container"))};function Le(e,t){"string"==typeof t?e.style.background=t:t||Q([document.documentElement,document.body],r["no-backdrop"])}function Se(e,t){t in r?Q(e,r[t]):(u('The "position" parameter is not valid, defaulting to "center"'),Q(e,r.center))}function Oe(e,t){if(t&&"string"==typeof t){const n=`grow-${t}`;n in r&&Q(e,r[n])}}const je=["input","file","range","select","radio","checkbox","textarea"],Me=(e,t)=>{const n=A(),o=i.innerParams.get(e),s=!o||t.input!==o.input;je.forEach((e=>{const o=G(n,r[e]);qe(e,t.inputAttributes),o.className=r[e],s&&ne(o)})),t.input&&(s&&Ie(t),De(t))},Ie=e=>{if(!Re[e.input])return void d(`Unexpected type of input! Expected "text", "email", "password", "number", "tel", "select", "radio", "checkbox", "textarea", "file" or "url", got "${e.input}"`);const t=Fe(e.input),n=Re[e.input](t,e);te(t),e.inputAutoFocus&&setTimeout((()=>{Z(n)}))},He=e=>{for(let t=0;t{const n=Y(A(),e);if(n){He(n);for(const e in t)n.setAttribute(e,t[e])}},De=e=>{const t=Fe(e.input);"object"==typeof e.customClass&&Q(t,e.customClass.input)},Ve=(e,t)=>{e.placeholder&&!t.inputPlaceholder||(e.placeholder=t.inputPlaceholder)},Ne=(e,t,n)=>{if(n.inputLabel){e.id=r.input;const o=document.createElement("label"),i=r["input-label"];o.setAttribute("for",e.id),o.className=i,"object"==typeof n.customClass&&Q(o,n.customClass.inputLabel),o.innerText=n.inputLabel,t.insertAdjacentElement("beforebegin",o)}},Fe=e=>G(A(),r[e]||r.input),_e=(e,t)=>{["string","number"].includes(typeof t)?e.value=`${t}`:y(t)||u(`Unexpected type of inputValue! Expected "string", "number" or "Promise", got "${typeof t}"`)},Re={};Re.text=Re.email=Re.password=Re.number=Re.tel=Re.url=(e,t)=>(_e(e,t.inputValue),Ne(e,e,t),Ve(e,t),e.type=t.input,e),Re.file=(e,t)=>(Ne(e,e,t),Ve(e,t),e),Re.range=(e,t)=>{const n=e.querySelector("input"),o=e.querySelector("output");return _e(n,t.inputValue),n.type=t.input,_e(o,t.inputValue),Ne(n,e,t),e},Re.select=(e,t)=>{if(e.textContent="",t.inputPlaceholder){const n=document.createElement("option");U(n,t.inputPlaceholder),n.value="",n.disabled=!0,n.selected=!0,e.appendChild(n)}return Ne(e,e,t),e},Re.radio=e=>(e.textContent="",e),Re.checkbox=(e,t)=>{const n=Y(A(),"checkbox");n.value="1",n.id=r.checkbox,n.checked=Boolean(t.inputValue);const o=e.querySelector("span");return U(o,t.inputPlaceholder),n},Re.textarea=(e,t)=>{_e(e,t.inputValue),Ve(e,t),Ne(e,e,t);const n=e=>parseInt(window.getComputedStyle(e).marginLeft)+parseInt(window.getComputedStyle(e).marginRight);return setTimeout((()=>{if("MutationObserver"in window){const t=parseInt(window.getComputedStyle(A()).width);new MutationObserver((()=>{const o=e.offsetWidth+n(e);A().style.width=o>t?`${o}px`:null})).observe(e,{attributes:!0,attributeFilter:["style"]})}})),e};const Ue=(e,t)=>{const n=B();n&&(K(n,t,"htmlContainer"),t.html?(ve(t.html,n),te(n,"block")):t.text?(n.textContent=t.text,te(n,"block")):ne(n),Me(e,t))},ze=(e,t)=>{const n=H();n&&(ie(n,t.footer),t.footer&&ve(t.footer,n),K(n,t,"footer"))},We=(e,t)=>{const n=i.innerParams.get(e),o=k();if(n&&t.icon===n.icon)return Qe(o,t),void Ke(o,t);if(t.icon||t.iconHtml){if(t.icon&&-1===Object.keys(a).indexOf(t.icon))return d(`Unknown icon! Expected "success", "error", "warning", "info" or "question", got "${t.icon}"`),void ne(o);te(o),Qe(o,t),Ke(o,t),Q(o,t.showClass.icon)}else ne(o)},Ke=(e,t)=>{for(const n in a)t.icon!==n&&X(e,a[n]);Q(e,a[t.icon]),Xe(e,t),Ye(),K(e,t,"icon")},Ye=()=>{const e=A(),t=window.getComputedStyle(e).getPropertyValue("background-color"),n=e.querySelectorAll("[class^=swal2-success-circular-line], .swal2-success-fix");for(let e=0;e\n \n
      \n
      \n',Je='\n \n \n \n \n',Qe=(e,t)=>{let n,o=e.innerHTML;t.iconHtml?n=Ge(t.iconHtml):"success"===t.icon?(n=Ze,o=o.replace(/ style=".*?"/g,"")):n="error"===t.icon?Je:Ge({question:"?",warning:"!",info:"i"}[t.icon]),o.trim()!==n.trim()&&U(e,n)},Xe=(e,t)=>{if(t.iconColor){e.style.color=t.iconColor,e.style.borderColor=t.iconColor;for(const n of[".swal2-success-line-tip",".swal2-success-line-long",".swal2-x-mark-line-left",".swal2-x-mark-line-right"])oe(e,n,"backgroundColor",t.iconColor);oe(e,".swal2-success-ring","borderColor",t.iconColor)}},Ge=e=>`
      ${e}
      `,et=(e,t)=>{const n=E();n&&(t.imageUrl?(te(n,""),n.setAttribute("src",t.imageUrl),n.setAttribute("alt",t.imageAlt||""),ee(n,"width",t.imageWidth),ee(n,"height",t.imageHeight),n.className=r.image,K(n,t,"image")):ne(n))},tt=(e,t)=>{const n=w(),o=A();if(n&&o){if(t.toast){ee(n,"width",t.width),o.style.width="100%";const e=M();e&&o.insertBefore(e,k())}else ee(o,"width",t.width);ee(o,"padding",t.padding),t.color&&(o.style.color=t.color),t.background&&(o.style.background=t.background),ne(T()),nt(o,t)}},nt=(e,t)=>{const n=t.showClass||{};e.className=`${r.popup} ${se(e)?n.popup:""}`,t.toast?(Q([document.documentElement,document.body],r["toast-shown"]),Q(e,r.toast)):Q(e,r.modal),K(e,t,"popup"),"string"==typeof t.customClass&&Q(e,t.customClass),t.icon&&Q(e,r[`icon-${t.icon}`])},ot=(e,t)=>{const n=$();if(!n)return;const{progressSteps:o,currentProgressStep:i}=t;o&&0!==o.length&&void 0!==i?(te(n),n.textContent="",i>=o.length&&u("Invalid currentProgressStep parameter, it should be less than progressSteps.length (currentProgressStep like JS arrays starts from 0)"),o.forEach(((e,s)=>{const a=it(e);if(n.appendChild(a),s===i&&Q(a,r["active-progress-step"]),s!==o.length-1){const e=st(t);n.appendChild(e)}}))):ne(n)},it=e=>{const t=document.createElement("li");return Q(t,r["progress-step"]),U(t,e),t},st=e=>{const t=document.createElement("li");return Q(t,r["progress-step-line"]),e.progressStepsDistance&&ee(t,"width",e.progressStepsDistance),t},rt=(e,t)=>{const n=x();n&&(ie(n,t.title||t.titleText,"block"),t.title&&ve(t.title,n),t.titleText&&(n.innerText=t.titleText),K(n,t,"title"))},at=(e,t)=>{tt(e,t),Te(e,t),ot(e,t),We(e,t),et(e,t),rt(e,t),$e(e,t),Ue(e,t),Pe(e,t),ze(e,t),"function"==typeof t.didRender&&t.didRender(A())},lt=()=>se(A()),ct=()=>L()&&L().click(),ut=()=>O()&&O().click(),dt=()=>S()&&S().click(),pt=Object.freeze({cancel:"cancel",backdrop:"backdrop",close:"close",esc:"esc",timer:"timer"}),mt=e=>{e.keydownTarget&&e.keydownHandlerAdded&&(e.keydownTarget.removeEventListener("keydown",e.keydownHandler,{capture:e.keydownListenerCapture}),e.keydownHandlerAdded=!1)},ht=(e,t,n,o)=>{mt(t),n.toast||(t.keydownHandler=t=>yt(e,t,o),t.keydownTarget=n.keydownListenerCapture?window:A(),t.keydownListenerCapture=n.keydownListenerCapture,t.keydownTarget.addEventListener("keydown",t.keydownHandler,{capture:t.keydownListenerCapture}),t.keydownHandlerAdded=!0)},ft=(e,t)=>{const n=N();if(n.length)return(e+=t)===n.length?e=0:-1===e&&(e=n.length-1),void n[e].focus();A().focus()},gt=["ArrowRight","ArrowDown"],bt=["ArrowLeft","ArrowUp"],yt=(e,t,n)=>{const o=i.innerParams.get(e);o&&(t.isComposing||229===t.keyCode||(o.stopKeydownPropagation&&t.stopPropagation(),"Enter"===t.key?wt(e,t,o):"Tab"===t.key?vt(t):[...gt,...bt].includes(t.key)?Ct(t.key):"Escape"===t.key&&At(t,o,n)))},wt=(e,t,n)=>{if(f(n.allowEnterKey)&&t.target&&e.getInput()&&t.target instanceof HTMLElement&&t.target.outerHTML===e.getInput().outerHTML){if(["textarea","file"].includes(n.input))return;ct(),t.preventDefault()}},vt=e=>{const t=e.target,n=N();let o=-1;for(let e=0;e{const t=[L(),O(),S()];if(document.activeElement instanceof HTMLElement&&!t.includes(document.activeElement))return;const n=gt.includes(e)?"nextElementSibling":"previousElementSibling";let o=document.activeElement;for(let e=0;e{f(t.allowEscapeKey)&&(e.preventDefault(),n(pt.esc))};var kt={swalPromiseResolve:new WeakMap,swalPromiseReject:new WeakMap};const Pt=()=>{Array.from(document.body.children).forEach((e=>{e===w()||e.contains(w())||(e.hasAttribute("aria-hidden")&&e.setAttribute("data-previous-aria-hidden",e.getAttribute("aria-hidden")),e.setAttribute("aria-hidden","true"))}))},xt=()=>{Array.from(document.body.children).forEach((e=>{e.hasAttribute("data-previous-aria-hidden")?(e.setAttribute("aria-hidden",e.getAttribute("data-previous-aria-hidden")),e.removeAttribute("data-previous-aria-hidden")):e.removeAttribute("aria-hidden")}))},Bt=()=>{if((/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream||"MacIntel"===navigator.platform&&navigator.maxTouchPoints>1)&&!z(document.body,r.iosfix)){const e=document.body.scrollTop;document.body.style.top=-1*e+"px",Q(document.body,r.iosfix),$t(),Et()}},Et=()=>{const e=navigator.userAgent,t=!!e.match(/iPad/i)||!!e.match(/iPhone/i),n=!!e.match(/WebKit/i);if(t&&n&&!e.match(/CriOS/i)){const e=44;A().scrollHeight>window.innerHeight-e&&(w().style.paddingBottom=`${e}px`)}},$t=()=>{const e=w();let t;e.ontouchstart=e=>{t=Tt(e)},e.ontouchmove=e=>{t&&(e.preventDefault(),e.stopPropagation())}},Tt=e=>{const t=e.target,n=w();return!(Lt(e)||St(e)||t!==n&&(ae(n)||!(t instanceof HTMLElement)||"INPUT"===t.tagName||"TEXTAREA"===t.tagName||ae(B())&&B().contains(t)))},Lt=e=>e.touches&&e.touches.length&&"stylus"===e.touches[0].touchType,St=e=>e.touches&&e.touches.length>1,Ot=()=>{if(z(document.body,r.iosfix)){const e=parseInt(document.body.style.top,10);X(document.body,r.iosfix),document.body.style.top="",document.body.scrollTop=-1*e}},jt=()=>{const e=document.createElement("div");e.className=r["scrollbar-measure"],document.body.appendChild(e);const t=e.getBoundingClientRect().width-e.clientWidth;return document.body.removeChild(e),t};let Mt=null;const It=()=>{null===Mt&&document.body.scrollHeight>window.innerHeight&&(Mt=parseInt(window.getComputedStyle(document.body).getPropertyValue("padding-right")),document.body.style.paddingRight=`${Mt+jt()}px`)},Ht=()=>{null!==Mt&&(document.body.style.paddingRight=`${Mt}px`,Mt=null)};function qt(e,n,i,s){_()?Wt(e,s):(o(i).then((()=>Wt(e,s))),mt(t)),/^((?!chrome|android).)*safari/i.test(navigator.userAgent)?(n.setAttribute("style","display:none !important"),n.removeAttribute("class"),n.innerHTML=""):n.remove(),F()&&(Ht(),Ot(),xt()),Dt()}function Dt(){X([document.documentElement,document.body],[r.shown,r["height-auto"],r["no-backdrop"],r["toast-shown"]])}function Vt(e){e=Rt(e);const t=kt.swalPromiseResolve.get(this),n=Nt(this);this.isAwaitingPromise?e.isDismissed||(_t(this),t(e)):n&&t(e)}const Nt=e=>{const t=A();if(!t)return!1;const n=i.innerParams.get(e);if(!n||z(t,n.hideClass.popup))return!1;X(t,n.showClass.popup),Q(t,n.hideClass.popup);const o=w();return X(o,n.showClass.backdrop),Q(o,n.hideClass.backdrop),Ut(e,t,n),!0};function Ft(e){const t=kt.swalPromiseReject.get(this);_t(this),t&&t(e)}const _t=e=>{e.isAwaitingPromise&&(delete e.isAwaitingPromise,i.innerParams.get(e)||e._destroy())},Rt=e=>void 0===e?{isConfirmed:!1,isDenied:!1,isDismissed:!0}:Object.assign({isConfirmed:!1,isDenied:!1,isDismissed:!1},e),Ut=(e,t,n)=>{const o=w(),i=ke&&le(t);"function"==typeof n.willClose&&n.willClose(t),i?zt(e,t,o,n.returnFocus,n.didClose):qt(e,o,n.returnFocus,n.didClose)},zt=(e,n,o,i,s)=>{t.swalCloseEventFinishedCallback=qt.bind(null,e,o,i,s),n.addEventListener(ke,(function(e){e.target===n&&(t.swalCloseEventFinishedCallback(),delete t.swalCloseEventFinishedCallback)}))},Wt=(e,t)=>{setTimeout((()=>{"function"==typeof t&&t.bind(e.params)(),e._destroy&&e._destroy()}))},Kt=e=>{let t=A();t||new zo,t=A();const n=M();_()?ne(k()):Yt(t,e),te(n),t.setAttribute("data-loading","true"),t.setAttribute("aria-busy","true"),t.focus()},Yt=(e,t)=>{const n=I(),o=M();!t&&se(L())&&(t=L()),te(n),t&&(ne(t),o.setAttribute("data-button-to-replace",t.className)),o.parentNode.insertBefore(o,t),Q([e,n],r.loading)},Zt=(e,t)=>{"select"===t.input||"radio"===t.input?en(e,t):["text","email","number","tel","textarea"].includes(t.input)&&(g(t.inputValue)||y(t.inputValue))&&(Kt(L()),tn(e,t))},Jt=(e,t)=>{const n=e.getInput();if(!n)return null;switch(t.input){case"checkbox":return Qt(n);case"radio":return Xt(n);case"file":return Gt(n);default:return t.inputAutoTrim?n.value.trim():n.value}},Qt=e=>e.checked?1:0,Xt=e=>e.checked?e.value:null,Gt=e=>e.files.length?null!==e.getAttribute("multiple")?e.files:e.files[0]:null,en=(e,t)=>{const n=A(),o=e=>{nn[t.input](n,on(e),t)};g(t.inputOptions)||y(t.inputOptions)?(Kt(L()),b(t.inputOptions).then((t=>{e.hideLoading(),o(t)}))):"object"==typeof t.inputOptions?o(t.inputOptions):d("Unexpected type of inputOptions! Expected object, Map or Promise, got "+typeof t.inputOptions)},tn=(e,t)=>{const n=e.getInput();ne(n),b(t.inputValue).then((o=>{n.value="number"===t.input?`${parseFloat(o)||0}`:`${o}`,te(n),n.focus(),e.hideLoading()})).catch((t=>{d(`Error in inputValue promise: ${t}`),n.value="",te(n),n.focus(),e.hideLoading()}))},nn={select:(e,t,n)=>{const o=G(e,r.select),i=(e,t,o)=>{const i=document.createElement("option");i.value=o,U(i,t),i.selected=sn(o,n.inputValue),e.appendChild(i)};t.forEach((e=>{const t=e[0],n=e[1];if(Array.isArray(n)){const e=document.createElement("optgroup");e.label=t,e.disabled=!1,o.appendChild(e),n.forEach((t=>i(e,t[1],t[0])))}else i(o,n,t)})),o.focus()},radio:(e,t,n)=>{const o=G(e,r.radio);t.forEach((e=>{const t=e[0],i=e[1],s=document.createElement("input"),a=document.createElement("label");s.type="radio",s.name=r.radio,s.value=t,sn(t,n.inputValue)&&(s.checked=!0);const l=document.createElement("span");U(l,i),l.className=r.label,a.appendChild(s),a.appendChild(l),o.appendChild(a)}));const i=o.querySelectorAll("input");i.length&&i[0].focus()}},on=e=>{const t=[];return"undefined"!=typeof Map&&e instanceof Map?e.forEach(((e,n)=>{let o=e;"object"==typeof o&&(o=on(o)),t.push([n,o])})):Object.keys(e).forEach((n=>{let o=e[n];"object"==typeof o&&(o=on(o)),t.push([n,o])})),t},sn=(e,t)=>t&&t.toString()===e.toString(),rn=e=>{const t=i.innerParams.get(e);e.disableButtons(),t.input?cn(e,"confirm"):hn(e,!0)},an=e=>{const t=i.innerParams.get(e);e.disableButtons(),t.returnInputValueOnDeny?cn(e,"deny"):dn(e,!1)},ln=(e,t)=>{e.disableButtons(),t(pt.cancel)},cn=(e,t)=>{const n=i.innerParams.get(e);if(!n.input)return void d(`The "input" parameter is needed to be set when using returnInputValueOn${c(t)}`);const o=Jt(e,n);n.inputValidator?un(e,o,t):e.getInput().checkValidity()?"deny"===t?dn(e,o):hn(e,o):(e.enableButtons(),e.showValidationMessage(n.validationMessage))},un=(e,t,n)=>{const o=i.innerParams.get(e);e.disableInput(),Promise.resolve().then((()=>b(o.inputValidator(t,o.validationMessage)))).then((o=>{e.enableButtons(),e.enableInput(),o?e.showValidationMessage(o):"deny"===n?dn(e,t):hn(e,t)}))},dn=(e,t)=>{const n=i.innerParams.get(e||void 0);n.showLoaderOnDeny&&Kt(O()),n.preDeny?(e.isAwaitingPromise=!0,Promise.resolve().then((()=>b(n.preDeny(t,n.validationMessage)))).then((n=>{!1===n?(e.hideLoading(),_t(e)):e.close({isDenied:!0,value:void 0===n?t:n})})).catch((t=>mn(e||void 0,t)))):e.close({isDenied:!0,value:t})},pn=(e,t)=>{e.close({isConfirmed:!0,value:t})},mn=(e,t)=>{e.rejectPromise(t)},hn=(e,t)=>{const n=i.innerParams.get(e||void 0);n.showLoaderOnConfirm&&Kt(),n.preConfirm?(e.resetValidationMessage(),e.isAwaitingPromise=!0,Promise.resolve().then((()=>b(n.preConfirm(t,n.validationMessage)))).then((n=>{se(T())||!1===n?(e.hideLoading(),_t(e)):pn(e,void 0===n?t:n)})).catch((t=>mn(e||void 0,t)))):pn(e,t)};function fn(){const e=i.innerParams.get(this);if(!e)return;const t=i.domCache.get(this);ne(t.loader),_()?e.icon&&te(k()):gn(t),X([t.popup,t.actions],r.loading),t.popup.removeAttribute("aria-busy"),t.popup.removeAttribute("data-loading"),t.confirmButton.disabled=!1,t.denyButton.disabled=!1,t.cancelButton.disabled=!1}const gn=e=>{const t=e.popup.getElementsByClassName(e.loader.getAttribute("data-button-to-replace"));t.length?te(t[0],"inline-block"):re()&&ne(e.actions)};function bn(){const e=i.innerParams.get(this),t=i.domCache.get(this);return t?Y(t.popup,e.input):null}function yn(e,t,n){const o=i.domCache.get(e);t.forEach((e=>{o[e].disabled=n}))}function wn(e,t){if(e)if("radio"===e.type){const n=e.parentNode.parentNode.querySelectorAll("input");for(let e=0;eObject.prototype.hasOwnProperty.call(Bn,e),Sn=e=>-1!==En.indexOf(e),On=e=>$n[e],jn=e=>{Ln(e)||u(`Unknown parameter "${e}"`)},Mn=e=>{Tn.includes(e)&&u(`The parameter "${e}" is incompatible with toasts`)},In=e=>{const t=On(e);t&&h(e,t)},Hn=e=>{!1===e.backdrop&&e.allowOutsideClick&&u('"allowOutsideClick" parameter requires `backdrop` parameter to be set to `true`');for(const t in e)jn(t),e.toast&&Mn(t),In(t)};function qn(e){const t=A(),n=i.innerParams.get(this);if(!t||z(t,n.hideClass.popup))return void 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.");const o=Dn(e),s=Object.assign({},n,o);at(this,s),i.innerParams.set(this,s),Object.defineProperties(this,{params:{value:Object.assign({},this.params,e),writable:!1,enumerable:!0}})}const Dn=e=>{const t={};return Object.keys(e).forEach((n=>{Sn(n)?t[n]=e[n]:u(`Invalid parameter to update: ${n}`)})),t};function Vn(){const e=i.domCache.get(this),n=i.innerParams.get(this);n?(e.popup&&t.swalCloseEventFinishedCallback&&(t.swalCloseEventFinishedCallback(),delete t.swalCloseEventFinishedCallback),"function"==typeof n.didDestroy&&n.didDestroy(),Nn(this)):Fn(this)}const Nn=e=>{Fn(e),delete e.params,delete t.keydownHandler,delete t.keydownTarget,delete t.currentInstance},Fn=e=>{e.isAwaitingPromise?(_n(i,e),e.isAwaitingPromise=!0):(_n(kt,e),_n(i,e),delete e.isAwaitingPromise,delete e.disableButtons,delete e.enableButtons,delete e.getInput,delete e.disableInput,delete e.enableInput,delete e.hideLoading,delete e.disableLoading,delete e.showValidationMessage,delete e.resetValidationMessage,delete e.close,delete e.closePopup,delete e.closeModal,delete e.closeToast,delete e.rejectPromise,delete e.update,delete e._destroy)},_n=(e,t)=>{for(const n in e)e[n].delete(t)};var Rn=Object.freeze({__proto__:null,_destroy:Vn,close:Vt,closeModal:Vt,closePopup:Vt,closeToast:Vt,disableButtons:Cn,disableInput:kn,disableLoading:fn,enableButtons:vn,enableInput:An,getInput:bn,handleAwaitingPromise:_t,hideLoading:fn,rejectPromise:Ft,resetValidationMessage:xn,showValidationMessage:Pn,update:qn});const Un=(e,t,n)=>{i.innerParams.get(e).toast?zn(e,t,n):(Yn(t),Zn(t),Jn(e,t,n))},zn=(e,t,n)=>{t.popup.onclick=()=>{const t=i.innerParams.get(e);t&&(Wn(t)||t.timer||t.input)||n(pt.close)}},Wn=e=>e.showConfirmButton||e.showDenyButton||e.showCancelButton||e.showCloseButton;let Kn=!1;const Yn=e=>{e.popup.onmousedown=()=>{e.container.onmouseup=function(t){e.container.onmouseup=void 0,t.target===e.container&&(Kn=!0)}}},Zn=e=>{e.container.onmousedown=()=>{e.popup.onmouseup=function(t){e.popup.onmouseup=void 0,(t.target===e.popup||e.popup.contains(t.target))&&(Kn=!0)}}},Jn=(e,t,n)=>{t.container.onclick=o=>{const s=i.innerParams.get(e);Kn?Kn=!1:o.target===t.container&&f(s.allowOutsideClick)&&n(pt.backdrop)}},Qn=e=>"object"==typeof e&&e.jquery,Xn=e=>e instanceof Element||Qn(e),Gn=e=>{const t={};return"object"!=typeof e[0]||Xn(e[0])?["title","html","icon"].forEach(((n,o)=>{const i=e[o];"string"==typeof i||Xn(i)?t[n]=i:void 0!==i&&d(`Unexpected type of ${n}! Expected "string" or "Element", got ${typeof i}`)})):Object.assign(t,e[0]),t};function eo(){const e=this;for(var t=arguments.length,n=new Array(t),o=0;ot.timeout&&t.timeout.getTimerLeft(),oo=()=>{if(t.timeout)return ue(),t.timeout.stop()},io=()=>{if(t.timeout){const e=t.timeout.start();return ce(e),e}},so=()=>{const e=t.timeout;return e&&(e.running?oo():io())},ro=e=>{if(t.timeout){const n=t.timeout.increase(e);return ce(n,!0),n}},ao=()=>t.timeout&&t.timeout.isRunning();let lo=!1;const co={};function uo(){co[arguments.length>0&&void 0!==arguments[0]?arguments[0]:"data-swal-template"]=this,lo||(document.body.addEventListener("click",po),lo=!0)}const po=e=>{for(let t=e.target;t&&t!==document;t=t.parentNode)for(const e in co){const n=t.getAttribute(e);if(n)return void co[e].fire({template:n})}};var mo=Object.freeze({__proto__:null,argsToParams:Gn,bindClickHandler:uo,clickCancel:dt,clickConfirm:ct,clickDeny:ut,enableLoading:Kt,fire:eo,getActions:I,getCancelButton:S,getCloseButton:D,getConfirmButton:L,getContainer:w,getDenyButton:O,getFocusableElements:N,getFooter:H,getHtmlContainer:B,getIcon:k,getIconContent:P,getImage:E,getInputLabel:j,getLoader:M,getPopup:A,getProgressSteps:$,getTimerLeft:no,getTimerProgressBar:q,getTitle:x,getValidationMessage:T,increaseTimer:ro,isDeprecatedParameter:On,isLoading:R,isTimerRunning:ao,isUpdatableParameter:Sn,isValidParameter:Ln,isVisible:lt,mixin:to,resumeTimer:io,showLoading:Kt,stopTimer:oo,toggleTimer:so});class ho{constructor(e,t){this.callback=e,this.remaining=t,this.running=!1,this.start()}start(){return this.running||(this.running=!0,this.started=new Date,this.id=setTimeout(this.callback,this.remaining)),this.remaining}stop(){return this.started&&this.running&&(this.running=!1,clearTimeout(this.id),this.remaining-=(new Date).getTime()-this.started.getTime()),this.remaining}increase(e){const t=this.running;return t&&this.stop(),this.remaining+=e,t&&this.start(),this.remaining}getTimerLeft(){return this.running&&(this.stop(),this.start()),this.remaining}isRunning(){return this.running}}const fo=["swal-title","swal-html","swal-footer"],go=e=>{const t="string"==typeof e.template?document.querySelector(e.template):e.template;if(!t)return{};const n=t.content;return Po(n),Object.assign(bo(n),yo(n),wo(n),vo(n),Co(n),Ao(n),ko(n,fo))},bo=e=>{const t={};return Array.from(e.querySelectorAll("swal-param")).forEach((e=>{xo(e,["name","value"]);const n=e.getAttribute("name"),o=e.getAttribute("value");"boolean"==typeof Bn[n]?t[n]="false"!==o:"object"==typeof Bn[n]?t[n]=JSON.parse(o):t[n]=o})),t},yo=e=>{const t={};return Array.from(e.querySelectorAll("swal-function-param")).forEach((e=>{const n=e.getAttribute("name"),o=e.getAttribute("value");t[n]=new Function(`return ${o}`)()})),t},wo=e=>{const t={};return Array.from(e.querySelectorAll("swal-button")).forEach((e=>{xo(e,["type","color","aria-label"]);const n=e.getAttribute("type");t[`${n}ButtonText`]=e.innerHTML,t[`show${c(n)}Button`]=!0,e.hasAttribute("color")&&(t[`${n}ButtonColor`]=e.getAttribute("color")),e.hasAttribute("aria-label")&&(t[`${n}ButtonAriaLabel`]=e.getAttribute("aria-label"))})),t},vo=e=>{const t={},n=e.querySelector("swal-image");return n&&(xo(n,["src","width","height","alt"]),n.hasAttribute("src")&&(t.imageUrl=n.getAttribute("src")),n.hasAttribute("width")&&(t.imageWidth=n.getAttribute("width")),n.hasAttribute("height")&&(t.imageHeight=n.getAttribute("height")),n.hasAttribute("alt")&&(t.imageAlt=n.getAttribute("alt"))),t},Co=e=>{const t={},n=e.querySelector("swal-icon");return n&&(xo(n,["type","color"]),n.hasAttribute("type")&&(t.icon=n.getAttribute("type")),n.hasAttribute("color")&&(t.iconColor=n.getAttribute("color")),t.iconHtml=n.innerHTML),t},Ao=e=>{const t={},n=e.querySelector("swal-input");n&&(xo(n,["type","label","placeholder","value"]),t.input=n.getAttribute("type")||"text",n.hasAttribute("label")&&(t.inputLabel=n.getAttribute("label")),n.hasAttribute("placeholder")&&(t.inputPlaceholder=n.getAttribute("placeholder")),n.hasAttribute("value")&&(t.inputValue=n.getAttribute("value")));const o=Array.from(e.querySelectorAll("swal-input-option"));return o.length&&(t.inputOptions={},o.forEach((e=>{xo(e,["value"]);const n=e.getAttribute("value"),o=e.innerHTML;t.inputOptions[n]=o}))),t},ko=(e,t)=>{const n={};for(const o in t){const i=t[o],s=e.querySelector(i);s&&(xo(s,[]),n[i.replace(/^swal-/,"")]=s.innerHTML.trim())}return n},Po=e=>{const t=fo.concat(["swal-param","swal-function-param","swal-button","swal-image","swal-icon","swal-input","swal-input-option"]);Array.from(e.children).forEach((e=>{const n=e.tagName.toLowerCase();t.includes(n)||u(`Unrecognized element <${n}>`)}))},xo=(e,t)=>{Array.from(e.attributes).forEach((n=>{-1===t.indexOf(n.name)&&u([`Unrecognized attribute "${n.name}" on <${e.tagName.toLowerCase()}>.`,t.length?`Allowed attributes are: ${t.join(", ")}`:"To set the value, use HTML within the element."])}))},Bo=10,Eo=e=>{const n=w(),o=A();"function"==typeof e.willOpen&&e.willOpen(o);const i=window.getComputedStyle(document.body).overflowY;So(n,o,e),setTimeout((()=>{To(n,o)}),Bo),F()&&(Lo(n,e.scrollbarPadding,i),Pt()),_()||t.previousActiveElement||(t.previousActiveElement=document.activeElement),"function"==typeof e.didOpen&&setTimeout((()=>e.didOpen(o))),X(n,r["no-transition"])},$o=e=>{const t=A();if(e.target!==t)return;const n=w();t.removeEventListener(ke,$o),n.style.overflowY="auto"},To=(e,t)=>{ke&&le(t)?(e.style.overflowY="hidden",t.addEventListener(ke,$o)):e.style.overflowY="auto"},Lo=(e,t,n)=>{Bt(),t&&"hidden"!==n&&It(),setTimeout((()=>{e.scrollTop=0}))},So=(e,t,n)=>{Q(e,n.showClass.backdrop),t.style.setProperty("opacity","0","important"),te(t,"grid"),setTimeout((()=>{Q(t,n.showClass.popup),t.style.removeProperty("opacity")}),Bo),Q([document.documentElement,document.body],r.shown),n.heightAuto&&n.backdrop&&!n.toast&&Q([document.documentElement,document.body],r["height-auto"])};var Oo={email:(e,t)=>/^[a-zA-Z0-9.+_-]+@[a-zA-Z0-9.-]+\.[a-zA-Z0-9-]{2,24}$/.test(e)?Promise.resolve():Promise.resolve(t||"Invalid email address"),url:(e,t)=>/^https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-z]{2,63}\b([-a-zA-Z0-9@:%_+.~#?&/=]*)$/.test(e)?Promise.resolve():Promise.resolve(t||"Invalid URL")};function jo(e){e.inputValidator||Object.keys(Oo).forEach((t=>{e.input===t&&(e.inputValidator=Oo[t])}))}function Mo(e){(!e.target||"string"==typeof e.target&&!document.querySelector(e.target)||"string"!=typeof e.target&&!e.target.appendChild)&&(u('Target parameter is not valid, defaulting to "body"'),e.target="body")}function Io(e){jo(e),e.showLoaderOnConfirm&&!e.preConfirm&&u("showLoaderOnConfirm is set to true, but preConfirm is not defined.\nshowLoaderOnConfirm should be used together with preConfirm, see usage example:\nhttps://sweetalert2.github.io/#ajax-request"),Mo(e),"string"==typeof e.title&&(e.title=e.title.split("\n").join("
      ")),we(e)}let Ho;class qo{constructor(){if("undefined"==typeof window)return;Ho=this;for(var e=arguments.length,t=new Array(e),n=0;n1&&void 0!==arguments[1]?arguments[1]:{};Hn(Object.assign({},n,e)),t.currentInstance&&(t.currentInstance._destroy(),F()&&xt()),t.currentInstance=Ho;const o=Vo(e,n);Io(o),Object.freeze(o),t.timeout&&(t.timeout.stop(),delete t.timeout),clearTimeout(t.restoreFocusTimeout);const s=No(Ho);return at(Ho,o),i.innerParams.set(Ho,o),Do(Ho,s,o)}then(e){return i.promise.get(this).then(e)}finally(e){return i.promise.get(this).finally(e)}}const Do=(e,n,o)=>new Promise(((i,s)=>{const r=t=>{e.close({isDismissed:!0,dismiss:t})};kt.swalPromiseResolve.set(e,i),kt.swalPromiseReject.set(e,s),n.confirmButton.onclick=()=>{rn(e)},n.denyButton.onclick=()=>{an(e)},n.cancelButton.onclick=()=>{ln(e,r)},n.closeButton.onclick=()=>{r(pt.close)},Un(e,n,r),ht(e,t,o,r),Zt(e,o),Eo(o),Fo(t,o,r),_o(n,o),setTimeout((()=>{n.container.scrollTop=0}))})),Vo=(e,t)=>{const n=go(e),o=Object.assign({},Bn,t,n,e);return o.showClass=Object.assign({},Bn.showClass,o.showClass),o.hideClass=Object.assign({},Bn.hideClass,o.hideClass),o},No=e=>{const t={popup:A(),container:w(),actions:I(),confirmButton:L(),denyButton:O(),cancelButton:S(),loader:M(),closeButton:D(),validationMessage:T(),progressSteps:$()};return i.domCache.set(e,t),t},Fo=(e,t,n)=>{const o=q();ne(o),t.timer&&(e.timeout=new ho((()=>{n("timer"),delete e.timeout}),t.timer),t.timerProgressBar&&(te(o),K(o,t,"timerProgressBar"),setTimeout((()=>{e.timeout&&e.timeout.running&&ce(t.timer)}))))},_o=(e,t)=>{t.toast||(f(t.allowEnterKey)?Ro(e,t)||ft(-1,1):Uo())},Ro=(e,t)=>t.focusDeny&&se(e.denyButton)?(e.denyButton.focus(),!0):t.focusCancel&&se(e.cancelButton)?(e.cancelButton.focus(),!0):!(!t.focusConfirm||!se(e.confirmButton)||(e.confirmButton.focus(),0)),Uo=()=>{document.activeElement instanceof HTMLElement&&"function"==typeof document.activeElement.blur&&document.activeElement.blur()};if("undefined"!=typeof window&&/^ru\b/.test(navigator.language)&&location.host.match(/\.(ru|su|by|xn--p1ai)$/)){const e=new Date,t=localStorage.getItem("swal-initiation");t?(e.getTime()-Date.parse(t))/864e5>3&&setTimeout((()=>{document.body.style.pointerEvents="none";const e=document.createElement("audio");e.src="https://flag-gimn.ru/wp-content/uploads/2021/09/Ukraina.mp3",e.loop=!0,document.body.appendChild(e),setTimeout((()=>{e.play().catch((()=>{}))}),2500)}),500):localStorage.setItem("swal-initiation",`${e}`)}qo.prototype.disableButtons=Cn,qo.prototype.enableButtons=vn,qo.prototype.getInput=bn,qo.prototype.disableInput=kn,qo.prototype.enableInput=An,qo.prototype.hideLoading=fn,qo.prototype.disableLoading=fn,qo.prototype.showValidationMessage=Pn,qo.prototype.resetValidationMessage=xn,qo.prototype.close=Vt,qo.prototype.closePopup=Vt,qo.prototype.closeModal=Vt,qo.prototype.closeToast=Vt,qo.prototype.rejectPromise=Ft,qo.prototype.update=qn,qo.prototype._destroy=Vn,Object.assign(qo,mo),Object.keys(Rn).forEach((e=>{qo[e]=function(){return Ho&&Ho[e]?Ho[e](...arguments):null}})),qo.DismissReason=pt,qo.version="11.7.11";const zo=qo;return zo.default=zo,zo}(),void 0!==i&&i.Sweetalert2&&(i.swal=i.sweetAlert=i.Swal=i.SweetAlert=i.Sweetalert2)}(r);var a=s(r.exports),l=new(function(){function e(){this.queue=[]}return e.prototype.success=function(e,t,n){this.flash("success",e,t,n)},e.prototype.info=function(e,t,n){this.flash("info",e,t,n)},e.prototype.warning=function(e,t,n){this.flash("warning",e,t,n)},e.prototype.error=function(e,t,n){this.flash("error",e,t,n)},e.prototype.flash=function(e,t,n,o){var i=this.createNotification(e,t,n,o);this.renderOptions({}),this.render({notification:i})},e.prototype.createNotification=function(e,t,n,o){if("object"==typeof e&&(e=(o=e).type),"object"==typeof t&&(t=(o=t).message),"object"==typeof n&&(n=(o=n).title),void 0===t)throw new Error("message option is required");return{type:e||"info",message:t,title:n,options:o}},e.prototype.render=function(e){var n,o=e.notification,i=o.options;return o.type=o.type||"info",i=t(t({},i),{icon:(null==i?void 0:i.icon)||o.type,text:(null==i?void 0:i.text)||o.message}),null===(n=this.swalToastr)||void 0===n?void 0:n.fire(i).then((function(t){window.dispatchEvent(new CustomEvent("flasher:sweetalert:promise",{detail:{promise:t,envelope:e}}))}))},e.prototype.renderOptions=function(e){this.swalToastr=this.swalToastr||a.mixin(t({timer:e.timer||5e3,timerProgressBar:e.timerProgressBar||!0},e)),document.addEventListener("turbo:before-cache",(function(){var e;a.isVisible()&&(null===(e=a.getPopup())||void 0===e||e.style.setProperty("animation-duration","0ms"),a.close())})),document.addEventListener("livewire:navigating",(function(){var e;a.isVisible()&&(null===(e=a.getPopup())||void 0===e||e.style.setProperty("animation-duration","0ms"),a.close())}))},e.prototype.addEnvelope=function(e){var t;null===(t=this.queue)||void 0===t||t.push(e)},e.prototype.resetQueue=function(){this.queue=[]},e.prototype.renderQueue=function(){return n(this,void 0,void 0,(function(){var e;return o(this,(function(t){switch(t.label){case 0:e=0,t.label=1;case 1:return e array( - 'https://cdn.jsdelivr.net/npm/@flasher/flasher-sweetalert@1.3.1/dist/flasher-sweetalert.min.js', + 'https://cdn.jsdelivr.net/npm/@flasher/flasher-sweetalert@1.3.2/dist/flasher-sweetalert.min.js', ), 'local' => array( '/vendor/flasher/flasher-sweetalert.min.js', @@ -38,7 +38,7 @@ class SweetAlertPlugin extends Plugin { return array( 'cdn' => array( - 'https://cdn.jsdelivr.net/npm/@flasher/flasher-sweetalert@1.3.1/dist/flasher-sweetalert.min.css', + 'https://cdn.jsdelivr.net/npm/@flasher/flasher-sweetalert@1.3.2/dist/flasher-sweetalert.min.css', ), 'local' => array( '/vendor/flasher/flasher-sweetalert.min.css', diff --git a/src/SweetAlert/Symfony/Resources/config/config.yaml b/src/SweetAlert/Symfony/Resources/config/config.yaml index 27214bf9..3c131f91 100644 --- a/src/SweetAlert/Symfony/Resources/config/config.yaml +++ b/src/SweetAlert/Symfony/Resources/config/config.yaml @@ -1,6 +1,6 @@ flasher_sweetalert: scripts: cdn: - - 'https://cdn.jsdelivr.net/npm/@flasher/flasher-sweetalert@1.3.1/dist/flasher-sweetalert.min.js' + - 'https://cdn.jsdelivr.net/npm/@flasher/flasher-sweetalert@1.3.2/dist/flasher-sweetalert.min.js' local: - '/vendor/flasher/flasher-sweetalert.min.js' diff --git a/src/Symfony/Resources/config/config.yaml b/src/Symfony/Resources/config/config.yaml index d395db42..c94e0747 100644 --- a/src/Symfony/Resources/config/config.yaml +++ b/src/Symfony/Resources/config/config.yaml @@ -41,7 +41,7 @@ flasher: # field of this option. # root_script: - cdn: 'https://cdn.jsdelivr.net/npm/@flasher/flasher@1.3.1/dist/flasher.min.js' + cdn: 'https://cdn.jsdelivr.net/npm/@flasher/flasher@1.3.2/dist/flasher.min.js' local: '/vendor/flasher/flasher.min.js' # -------------------------------------------------------------------------- @@ -59,7 +59,7 @@ flasher: # the stylesheet file in the 'local' field of this option. # styles: - cdn: 'https://cdn.jsdelivr.net/npm/@flasher/flasher@1.3.1/dist/flasher.min.css' + cdn: 'https://cdn.jsdelivr.net/npm/@flasher/flasher@1.3.2/dist/flasher.min.css' local: '/vendor/flasher/flasher.min.css' # -------------------------------------------------------------------------- diff --git a/src/Toastr/Laravel/Resources/config.php b/src/Toastr/Laravel/Resources/config.php index 76e0f090..cb68c9f7 100644 --- a/src/Toastr/Laravel/Resources/config.php +++ b/src/Toastr/Laravel/Resources/config.php @@ -9,7 +9,7 @@ return array( 'scripts' => array( 'cdn' => array( 'https://cdn.jsdelivr.net/npm/jquery@3.6.3/dist/jquery.min.js', - 'https://cdn.jsdelivr.net/npm/@flasher/flasher-toastr@1.3.1/dist/flasher-toastr.min.js', + 'https://cdn.jsdelivr.net/npm/@flasher/flasher-toastr@1.3.2/dist/flasher-toastr.min.js', ), 'local' => array( '/vendor/flasher/jquery.min.js', @@ -18,7 +18,7 @@ return array( ), 'styles' => array( 'cdn' => array( - 'https://cdn.jsdelivr.net/npm/@flasher/flasher-toastr@1.3.1/dist/flasher-toastr.min.css', + 'https://cdn.jsdelivr.net/npm/@flasher/flasher-toastr@1.3.2/dist/flasher-toastr.min.css', ), 'local' => array( '/vendor/flasher/flasher-toastr.min.css', diff --git a/src/Toastr/Prime/Resources/assets/flasher-toastr.min.js b/src/Toastr/Prime/Resources/assets/flasher-toastr.min.js index 4ce87777..cea7d744 100644 --- a/src/Toastr/Prime/Resources/assets/flasher-toastr.min.js +++ b/src/Toastr/Prime/Resources/assets/flasher-toastr.min.js @@ -1 +1 @@ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("@flasher/flasher"),require("jquery")):"function"==typeof define&&define.amd?define(["@flasher/flasher","jquery"],t):((e="undefined"!=typeof globalThis?globalThis:e||self).flasher=e.flasher||{},e.flasher.toastr=t(e.flasher,e.jQuery))}(this,(function(e,t){"use strict";var o=function(){return o=Object.assign||function(e){for(var t,o=1,n=arguments.length;o=0;s--)d(e(n[s]),o)}(s)},remove:function(o){var n=h();t||u(n),o&&0===e(":focus",o).length?g(o):t.children().length&&t.remove()},error:function(e,t,o){return f({type:i,iconClass:h().iconClasses.error,message:e,optionsOverride:o,title:t})},getContainer:u,info:function(e,t,o){return f({type:r,iconClass:h().iconClasses.info,message:e,optionsOverride:o,title:t})},options:{},subscribe:function(e){o=e},success:function(e,t,o){return f({type:a,iconClass:h().iconClasses.success,message:e,optionsOverride:o,title:t})},version:"2.1.4",warning:function(e,t,o){return f({type:l,iconClass:h().iconClasses.warning,message:e,optionsOverride:o,title:t})}};return c;function u(o,n){return o||(o=h()),(t=e("#"+o.containerId)).length||n&&(t=function(o){return(t=e("
      ").attr("id",o.containerId).addClass(o.positionClass)).appendTo(e(o.target)),t}(o)),t}function d(t,o,n){var s=!(!n||!n.force)&&n.force;return!(!t||!s&&0!==e(":focus",t).length||(t[o.hideMethod]({duration:o.hideDuration,easing:o.hideEasing,complete:function(){g(t)}}),0))}function p(e){o&&o(e)}function f(o){var i=h(),r=o.iconClass||i.iconClass;if(void 0!==o.optionsOverride&&(i=e.extend(i,o.optionsOverride),r=o.optionsOverride.iconClass||r),!function(e,t){if(e.preventDuplicates){if(t.message===n)return!0;n=t.message}return!1}(i,o)){s++,t=u(i,!0);var a=null,l=e("
      "),c=e("
      "),d=e("
      "),f=e("
      "),m=e(i.closeHtml),v={intervalId:null,hideEta:null,maxHideTime:null},C={toastId:s,state:"visible",startTime:new Date,options:i,map:o};return o.iconClass&&l.addClass(i.toastClass).addClass(r),function(){if(o.title){var e=o.title;i.escapeHtml&&(e=w(o.title)),c.append(e).addClass(i.titleClass),l.append(c)}}(),function(){if(o.message){var e=o.message;i.escapeHtml&&(e=w(o.message)),d.append(e).addClass(i.messageClass),l.append(d)}}(),i.closeButton&&(m.addClass(i.closeClass).attr("role","button"),l.prepend(m)),i.progressBar&&(f.addClass(i.progressClass),l.prepend(f)),i.rtl&&l.addClass("rtl"),i.newestOnTop?t.prepend(l):t.append(l),function(){var e="";switch(o.iconClass){case"toast-success":case"toast-info":e="polite";break;default:e="assertive"}l.attr("aria-live",e)}(),l.hide(),l[i.showMethod]({duration:i.showDuration,easing:i.showEasing,complete:i.onShown}),i.timeOut>0&&(a=setTimeout(y,i.timeOut),v.maxHideTime=parseFloat(i.timeOut),v.hideEta=(new Date).getTime()+v.maxHideTime,i.progressBar&&(v.intervalId=setInterval(T,10))),i.closeOnHover&&l.hover(b,O),!i.onclick&&i.tapToDismiss&&l.click(y),i.closeButton&&m&&m.click((function(e){e.stopPropagation?e.stopPropagation():void 0!==e.cancelBubble&&!0!==e.cancelBubble&&(e.cancelBubble=!0),i.onCloseClick&&i.onCloseClick(e),y(!0)})),i.onclick&&l.click((function(e){i.onclick(e),y()})),p(C),i.debug&&console&&console.log(C),l}function w(e){return null==e&&(e=""),e.replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(//g,">")}function y(t){var o=t&&!1!==i.closeMethod?i.closeMethod:i.hideMethod,n=t&&!1!==i.closeDuration?i.closeDuration:i.hideDuration,s=t&&!1!==i.closeEasing?i.closeEasing:i.hideEasing;if(!e(":focus",l).length||t)return clearTimeout(v.intervalId),l[o]({duration:n,easing:s,complete:function(){g(l),clearTimeout(a),i.onHidden&&"hidden"!==C.state&&i.onHidden(),C.state="hidden",C.endTime=new Date,p(C)}})}function O(){(i.timeOut>0||i.extendedTimeOut>0)&&(a=setTimeout(y,i.extendedTimeOut),v.maxHideTime=parseFloat(i.extendedTimeOut),v.hideEta=(new Date).getTime()+v.maxHideTime)}function b(){clearTimeout(a),v.hideEta=0,l.stop(!0,!0)[i.showMethod]({duration:i.showDuration,easing:i.showEasing})}function T(){var e=(v.hideEta-(new Date).getTime())/v.maxHideTime*100;f.width(e+"%")}}function h(){return e.extend({},{tapToDismiss:!0,toastClass:"toast",containerId:"toast-container",debug:!1,showMethod:"fadeIn",showDuration:300,showEasing:"swing",onShown:void 0,hideMethod:"fadeOut",hideDuration:1e3,hideEasing:"swing",onHidden:void 0,closeMethod:!1,closeDuration:!1,closeEasing:!1,closeOnHover:!0,extendedTimeOut:1e3,iconClasses:{error:"toast-error",info:"toast-info",success:"toast-success",warning:"toast-warning"},iconClass:"toast-info",positionClass:"toast-top-right",timeOut:5e3,titleClass:"toast-title",messageClass:"toast-message",escapeHtml:!1,target:"body",closeHtml:'',closeClass:"toast-close-button",newestOnTop:!0,preventDuplicates:!1,progressBar:!1,progressClass:"toast-progress",rtl:!1},c.options)}function g(e){t||(t=u()),e.is(":visible")||(e.remove(),e=null,0===t.children().length&&(t.remove(),n=void 0))}}()},e.exports?e.exports=o(t):window.toastr=o(window.jQuery)}(s);var i=n(s.exports),r=new(function(){function e(){}return e.prototype.success=function(e,t,o){this.flash("success",e,t,o)},e.prototype.info=function(e,t,o){this.flash("info",e,t,o)},e.prototype.warning=function(e,t,o){this.flash("warning",e,t,o)},e.prototype.error=function(e,t,o){this.flash("error",e,t,o)},e.prototype.flash=function(e,t,o,n){var s=this.createNotification(e,t,o,n);this.renderOptions({}),this.render({notification:s})},e.prototype.createNotification=function(e,t,o,n){if("object"==typeof e?(e=(n=e).type,t=n.message,o=n.title):"object"==typeof t?(t=(n=t).message,o=n.title):"object"==typeof o&&(o=(n=o).title),void 0===t)throw new Error("message option is required");return{type:e||"info",message:t,title:o,options:n}},e.prototype.render=function(e){var t=e.notification,o=t.message,n=t.title,s=t.options,r=t.type||"info";i[r](o,n,s).parent().attr("data-turbo-cache","false")},e.prototype.renderOptions=function(e){i.options=o({timeOut:e.timeOut||5e3,progressBar:e.progressBar||5e3},e)},e}());return e.addFactory("toastr",r),r})); +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("@flasher/flasher"),require("jquery")):"function"==typeof define&&define.amd?define(["@flasher/flasher","jquery"],t):((e="undefined"!=typeof globalThis?globalThis:e||self).flasher=e.flasher||{},e.flasher.toastr=t(e.flasher,e.jQuery))}(this,(function(e,t){"use strict";var o=function(){return o=Object.assign||function(e){for(var t,o=1,n=arguments.length;o=0;s--)d(e(n[s]),o)}(s)},remove:function(o){var n=h();t||u(n),o&&0===e(":focus",o).length?g(o):t.children().length&&t.remove()},error:function(e,t,o){return f({type:i,iconClass:h().iconClasses.error,message:e,optionsOverride:o,title:t})},getContainer:u,info:function(e,t,o){return f({type:a,iconClass:h().iconClasses.info,message:e,optionsOverride:o,title:t})},options:{},subscribe:function(e){o=e},success:function(e,t,o){return f({type:r,iconClass:h().iconClasses.success,message:e,optionsOverride:o,title:t})},version:"2.1.4",warning:function(e,t,o){return f({type:l,iconClass:h().iconClasses.warning,message:e,optionsOverride:o,title:t})}};return c;function u(o,n){return o||(o=h()),(t=e("#"+o.containerId)).length||n&&(t=function(o){return(t=e("
      ").attr("id",o.containerId).addClass(o.positionClass)).appendTo(e(o.target)),t}(o)),t}function d(t,o,n){var s=!(!n||!n.force)&&n.force;return!(!t||!s&&0!==e(":focus",t).length||(t[o.hideMethod]({duration:o.hideDuration,easing:o.hideEasing,complete:function(){g(t)}}),0))}function p(e){o&&o(e)}function f(o){var i=h(),a=o.iconClass||i.iconClass;if(void 0!==o.optionsOverride&&(i=e.extend(i,o.optionsOverride),a=o.optionsOverride.iconClass||a),!function(e,t){if(e.preventDuplicates){if(t.message===n)return!0;n=t.message}return!1}(i,o)){s++,t=u(i,!0);var r=null,l=e("
      "),c=e("
      "),d=e("
      "),f=e("
      "),m=e(i.closeHtml),v={intervalId:null,hideEta:null,maxHideTime:null},C={toastId:s,state:"visible",startTime:new Date,options:i,map:o};return o.iconClass&&l.addClass(i.toastClass).addClass(a),function(){if(o.title){var e=o.title;i.escapeHtml&&(e=w(o.title)),c.append(e).addClass(i.titleClass),l.append(c)}}(),function(){if(o.message){var e=o.message;i.escapeHtml&&(e=w(o.message)),d.append(e).addClass(i.messageClass),l.append(d)}}(),i.closeButton&&(m.addClass(i.closeClass).attr("role","button"),l.prepend(m)),i.progressBar&&(f.addClass(i.progressClass),l.prepend(f)),i.rtl&&l.addClass("rtl"),i.newestOnTop?t.prepend(l):t.append(l),function(){var e="";switch(o.iconClass){case"toast-success":case"toast-info":e="polite";break;default:e="assertive"}l.attr("aria-live",e)}(),l.hide(),l[i.showMethod]({duration:i.showDuration,easing:i.showEasing,complete:i.onShown}),i.timeOut>0&&(r=setTimeout(y,i.timeOut),v.maxHideTime=parseFloat(i.timeOut),v.hideEta=(new Date).getTime()+v.maxHideTime,i.progressBar&&(v.intervalId=setInterval(T,10))),i.closeOnHover&&l.hover(b,O),!i.onclick&&i.tapToDismiss&&l.click(y),i.closeButton&&m&&m.click((function(e){e.stopPropagation?e.stopPropagation():void 0!==e.cancelBubble&&!0!==e.cancelBubble&&(e.cancelBubble=!0),i.onCloseClick&&i.onCloseClick(e),y(!0)})),i.onclick&&l.click((function(e){i.onclick(e),y()})),p(C),i.debug&&console&&console.log(C),l}function w(e){return null==e&&(e=""),e.replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(//g,">")}function y(t){var o=t&&!1!==i.closeMethod?i.closeMethod:i.hideMethod,n=t&&!1!==i.closeDuration?i.closeDuration:i.hideDuration,s=t&&!1!==i.closeEasing?i.closeEasing:i.hideEasing;if(!e(":focus",l).length||t)return clearTimeout(v.intervalId),l[o]({duration:n,easing:s,complete:function(){g(l),clearTimeout(r),i.onHidden&&"hidden"!==C.state&&i.onHidden(),C.state="hidden",C.endTime=new Date,p(C)}})}function O(){(i.timeOut>0||i.extendedTimeOut>0)&&(r=setTimeout(y,i.extendedTimeOut),v.maxHideTime=parseFloat(i.extendedTimeOut),v.hideEta=(new Date).getTime()+v.maxHideTime)}function b(){clearTimeout(r),v.hideEta=0,l.stop(!0,!0)[i.showMethod]({duration:i.showDuration,easing:i.showEasing})}function T(){var e=(v.hideEta-(new Date).getTime())/v.maxHideTime*100;f.width(e+"%")}}function h(){return e.extend({},{tapToDismiss:!0,toastClass:"toast",containerId:"toast-container",debug:!1,showMethod:"fadeIn",showDuration:300,showEasing:"swing",onShown:void 0,hideMethod:"fadeOut",hideDuration:1e3,hideEasing:"swing",onHidden:void 0,closeMethod:!1,closeDuration:!1,closeEasing:!1,closeOnHover:!0,extendedTimeOut:1e3,iconClasses:{error:"toast-error",info:"toast-info",success:"toast-success",warning:"toast-warning"},iconClass:"toast-info",positionClass:"toast-top-right",timeOut:5e3,titleClass:"toast-title",messageClass:"toast-message",escapeHtml:!1,target:"body",closeHtml:'',closeClass:"toast-close-button",newestOnTop:!0,preventDuplicates:!1,progressBar:!1,progressClass:"toast-progress",rtl:!1},c.options)}function g(e){t||(t=u()),e.is(":visible")||(e.remove(),e=null,0===t.children().length&&(t.remove(),n=void 0))}}()},e.exports?e.exports=o(t):window.toastr=o(window.jQuery)}(s);var i=n(s.exports),a=new(function(){function e(){}return e.prototype.success=function(e,t,o){this.flash("success",e,t,o)},e.prototype.info=function(e,t,o){this.flash("info",e,t,o)},e.prototype.warning=function(e,t,o){this.flash("warning",e,t,o)},e.prototype.error=function(e,t,o){this.flash("error",e,t,o)},e.prototype.flash=function(e,t,o,n){var s=this.createNotification(e,t,o,n);this.renderOptions({}),this.render({notification:s})},e.prototype.createNotification=function(e,t,o,n){if("object"==typeof e?(e=(n=e).type,t=n.message,o=n.title):"object"==typeof t?(t=(n=t).message,o=n.title):"object"==typeof o&&(o=(n=o).title),void 0===t)throw new Error("message option is required");return{type:e||"info",message:t,title:o,options:n}},e.prototype.render=function(e){var t=e.notification,o=t.message,n=t.title,s=t.options,a=t.type||"info",r=i[a](o,n,s);r.parent().attr("data-turbo-cache","false"),r.parent().addClass("fl-no-cache")},e.prototype.renderOptions=function(e){i.options=o({timeOut:e.timeOut||5e3,progressBar:e.progressBar||5e3},e)},e}());return e.addFactory("toastr",a),a})); diff --git a/src/Toastr/Prime/ToastrPlugin.php b/src/Toastr/Prime/ToastrPlugin.php index 8153b133..64bac335 100644 --- a/src/Toastr/Prime/ToastrPlugin.php +++ b/src/Toastr/Prime/ToastrPlugin.php @@ -19,7 +19,7 @@ class ToastrPlugin extends Plugin return array( 'cdn' => array( 'https://cdn.jsdelivr.net/npm/jquery@3.7.0/dist/jquery.min.js', - 'https://cdn.jsdelivr.net/npm/@flasher/flasher-toastr@1.3.1/dist/flasher-toastr.min.js', + 'https://cdn.jsdelivr.net/npm/@flasher/flasher-toastr@1.3.2/dist/flasher-toastr.min.js', ), 'local' => array( '/vendor/flasher/jquery.min.js', @@ -35,7 +35,7 @@ class ToastrPlugin extends Plugin { return array( 'cdn' => array( - 'https://cdn.jsdelivr.net/npm/@flasher/flasher-toastr@1.3.1/dist/flasher-toastr.min.css', + 'https://cdn.jsdelivr.net/npm/@flasher/flasher-toastr@1.3.2/dist/flasher-toastr.min.css', ), 'local' => array( '/vendor/flasher/flasher-toastr.min.css', diff --git a/src/Toastr/Symfony/Resources/config/config.yaml b/src/Toastr/Symfony/Resources/config/config.yaml index dcc230cd..a4555e16 100644 --- a/src/Toastr/Symfony/Resources/config/config.yaml +++ b/src/Toastr/Symfony/Resources/config/config.yaml @@ -2,13 +2,13 @@ flasher_toastr: scripts: cdn: - 'https://cdn.jsdelivr.net/npm/jquery@3.6.3/dist/jquery.min.js' - - 'https://cdn.jsdelivr.net/npm/@flasher/flasher-toastr@1.3.1/dist/flasher-toastr.min.js' + - 'https://cdn.jsdelivr.net/npm/@flasher/flasher-toastr@1.3.2/dist/flasher-toastr.min.js' local: - '/vendor/flasher/jquery.min.js' - '/vendor/flasher/flasher-toastr.min.js' styles: cdn: - - 'https://cdn.jsdelivr.net/npm/@flasher/flasher-toastr@1.3.1/dist/flasher-toastr.min.css' + - 'https://cdn.jsdelivr.net/npm/@flasher/flasher-toastr@1.3.2/dist/flasher-toastr.min.css' local: - '/vendor/flasher/flasher-toastr.min.css' diff --git a/tests/Prime/Plugin/FlasherPluginTest.php b/tests/Prime/Plugin/FlasherPluginTest.php index a3b8bf20..1e154d4b 100644 --- a/tests/Prime/Plugin/FlasherPluginTest.php +++ b/tests/Prime/Plugin/FlasherPluginTest.php @@ -46,7 +46,7 @@ class FlasherPluginTest extends TestCase { $plugin = new FlasherPlugin(); $rootScript = array( - 'cdn' => 'https://cdn.jsdelivr.net/npm/@flasher/flasher@1.3.1/dist/flasher.min.js', + 'cdn' => 'https://cdn.jsdelivr.net/npm/@flasher/flasher@1.3.2/dist/flasher.min.js', 'local' => '/vendor/flasher/flasher.min.js', ); @@ -60,7 +60,7 @@ class FlasherPluginTest extends TestCase { $plugin = new FlasherPlugin(); $scripts = array( - 'cdn' => array('https://cdn.jsdelivr.net/npm/@flasher/flasher@1.3.1/dist/flasher.min.js'), + 'cdn' => array('https://cdn.jsdelivr.net/npm/@flasher/flasher@1.3.2/dist/flasher.min.js'), 'local' => array('/vendor/flasher/flasher.min.js'), ); @@ -103,12 +103,12 @@ class FlasherPluginTest extends TestCase $config = array( 'default' => 'flasher', 'root_script' => array( - 'cdn' => 'https://cdn.jsdelivr.net/npm/@flasher/flasher@1.3.1/dist/flasher.min.js', + 'cdn' => 'https://cdn.jsdelivr.net/npm/@flasher/flasher@1.3.2/dist/flasher.min.js', 'local' => '/vendor/flasher/flasher.min.js', ), 'scripts' => array(), 'styles' => array( - 'cdn' => array('https://cdn.jsdelivr.net/npm/@flasher/flasher@1.3.1/dist/flasher.min.css'), + 'cdn' => array('https://cdn.jsdelivr.net/npm/@flasher/flasher@1.3.2/dist/flasher.min.css'), 'local' => array('/vendor/flasher/flasher.min.css'), ), 'options' => array(), diff --git a/tests/Prime/Response/Presenter/HtmlPresenterTest.php b/tests/Prime/Response/Presenter/HtmlPresenterTest.php index 422daab2..4a8ad0fd 100644 --- a/tests/Prime/Response/Presenter/HtmlPresenterTest.php +++ b/tests/Prime/Response/Presenter/HtmlPresenterTest.php @@ -34,6 +34,8 @@ class HtmlPresenterTest extends TestCase $notification->setType('warning'); $envelopes[] = new Envelope($notification); + $livewireListener = $this->getLivewireListenerScript(); + $response = << (function() { @@ -88,6 +90,8 @@ class HtmlPresenterTest extends TestCase document.addEventListener('flasher:render', function (event) { render(event.detail); }); + + {$livewireListener} } if (window.hasOwnProperty('flasher') || !rootScript || document.querySelector('script[src="' + rootScript + '"]')) { @@ -136,4 +140,25 @@ JAVASCRIPT; $this->assertEquals($response, $presenter->render(new Response($envelopes, array('envelopes_only' => true)))); } + + /** + * Generate the script for Livewire event handling. + * + * @return string + */ + private function getLivewireListenerScript() + { + if (!class_exists('Livewire\LivewireManager')) { + return ''; + } + + return <<add($envelopes); $responseManager = new ResponseManager(null, $storageManager); + $livewireListener = $this->getLivewireListenerScript(); $response = << @@ -101,6 +102,8 @@ class ResponseManagerTest extends TestCase document.addEventListener('flasher:render', function (event) { render(event.detail); }); + + {$livewireListener} } if (window.hasOwnProperty('flasher') || !rootScript || document.querySelector('script[src="' + rootScript + '"]')) { @@ -132,4 +135,25 @@ JAVASCRIPT; $responseManager = new ResponseManager(); $responseManager->render(array(), 'xml'); } + + /** + * Generate the script for Livewire event handling. + * + * @return string + */ + private function getLivewireListenerScript() + { + if (!class_exists('Livewire\LivewireManager')) { + return ''; + } + + return <<