/*! DMXzone Notifications Version: 2.0.0 (c) 2024 Wappler.io @build 2024-04-15 17:48:46 */ dmx.Component("notifications",{attributes:{position:{type:String,default:"top",enum:["top","bottom"]},align:{type:String,default:"end",enum:["left","right","full","start","center","end","stretch"]},offsetX:{type:Number,default:15},offsetY:{type:Number,default:15},spacing:{type:Number,default:10},opacity:{type:Number,default:.8},timeout:{type:Number,default:5e3},extendedTimeout:{type:Number,default:1e3},showAnimation:{type:String,default:"fadeIn"},showDuration:{type:Number,default:400},hideAnimation:{type:String,default:"fadeOut"},hideDuration:{type:Number,default:400},closeAnimation:{type:String,default:"fadeOut"},closeDuration:{type:Number,default:400},closeIcon:{type:String,default:"fa fa-times"},closable:{type:Boolean,default:!1},infoBackground:{type:String,default:"#2f96b4"},infoColor:{type:String,default:"#fff"},infoIcon:{type:String,default:"fa fa-info"},successIcon:{type:String,default:"fa fa-check"},successBackground:{type:String,default:"#51a351"},successColor:{type:String,default:"#fff"},warningIcon:{type:String,default:"fa fa-exclamation"},warningBackground:{type:String,default:"#f89406"},warningColor:{type:String,default:"#fff"},dangerIcon:{type:String,default:"fa fa-warning"},dangerBackground:{type:String,default:"#bd362f"},dangerColor:{type:String,default:"#fff"}},methods:{clear(){this._clear()},msg(t,e){this._show("msg",t,e)},info(t,e){this._show("info",t,Object.assign({icon:this.props.infoIcon,color:this.props.infoColor,background:this.props.infoBackground},e))},success(t,e){this._show("success",t,Object.assign({icon:this.props.successIcon,color:this.props.successColor,background:this.props.successBackground},e))},warning(t,e){this._show("warning",t,Object.assign({icon:this.props.warningIcon,color:this.props.warningColor,background:this.props.warningBackground},e))},danger:function(t,e){this._show("danger",t,Object.assign({icon:this.props.dangerIcon,color:this.props.dangerColor,background:this.props.dangerBackground},e))}},events:{click:CustomEvent},init(){this._alignMap={left:"flex-start",right:"flex-end",full:"stretch",start:"flex-start",center:"center",end:"flex-end",stretch:"stretch"}},render(t){t.classList.add("dmx-notifications"),t.setAttribute("aria-live","polite"),t.setAttribute("aria-atomic","true"),this._clear(),this._update()},performUpdate(t){this._update()},_clear:function(){this.$node.textContent=""},_update(){this.$node.style.setProperty("--dmx-notify-offset-x",this.props.offsetX+"px"),this.$node.style.setProperty("--dmx-notify-offset-y",this.props.offsetY+"px"),this.$node.style.setProperty("--dmx-notify-align",this._alignMap[this.props.align]),this.$node.style.setProperty("--dmx-notify-gap",this.props.spacing+"px"),this.$node.style.setProperty("--dmx-notify-direction","top"==this.props.position?"column":"column-reverse")},_template(t){let e=`