!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).notyf=e(t.flasher)}(this,(function(t){"use strict";class e{success(t,e,i){this.flash("success",t,e,i)}error(t,e,i){this.flash("error",t,e,i)}info(t,e,i){this.flash("info",t,e,i)}warning(t,e,i){this.flash("warning",t,e,i)}flash(t,e,i,n){let o,s,a,r={};if("object"==typeof t?(r=Object.assign({},t),o=r.type,s=r.message,a=r.title,delete r.type,delete r.message,delete r.title):"object"==typeof e?(r=Object.assign({},e),o=t,s=r.message,a=r.title,delete r.message,delete r.title):(o=t,s=e,null==i?(a=void 0,r=n||{}):"string"==typeof i?(a=i,r=n||{}):"object"==typeof i&&(r=Object.assign({},i),"title"in r?(a=r.title,delete r.title):a=void 0,n&&"object"==typeof n&&(r=Object.assign(Object.assign({},r),n)))),!o)throw new Error("Type is required for notifications");if(null==s)throw new Error("Message is required for notifications");null==a&&(a=o.charAt(0).toUpperCase()+o.slice(1));const c={type:o,message:s,title:a,options:r,metadata:{plugin:""}};this.renderOptions(r),this.renderEnvelopes([c])}}var i,n=function(){return n=Object.assign||function(t){for(var e,i=1,n=arguments.length;i{var e;try{const i=Object.assign(Object.assign({},t),t.options);null===(e=this.notyf)||void 0===e||e.open(i)}catch(e){console.error("PHPFlasher Notyf: Error rendering notification",e,t)}}));try{if(this.notyf){const t=this.notyf.view.container,e=this.notyf.view.a11yContainer;t&&t.dataset&&(t.dataset.turboTemporary=""),e&&e.dataset&&(e.dataset.turboTemporary="")}}catch(t){console.error("PHPFlasher Notyf: Error setting Turbo compatibility",t)}}renderOptions(t){if(!t)return;const e=Object.assign({duration:t.duration||1e4},t);e.types=e.types||[],this.addTypeIfNotExists(e.types,{type:"info",className:"notyf__toast--info",background:"#5784E5",icon:{className:"notyf__icon--info",tagName:"i"}}),this.addTypeIfNotExists(e.types,{type:"warning",className:"notyf__toast--warning",background:"#E3A008",icon:{className:"notyf__icon--warning",tagName:"i"}}),this.notyf=this.notyf||new p(e)}initializeNotyf(){this.notyf||this.renderOptions({duration:1e4,position:{x:"right",y:"top"},dismissible:!0})}addTypeIfNotExists(t,e){t.some((t=>t.type===e.type))||t.push(e)}};return t.addPlugin("notyf",f),f}));