var u=Object.defineProperty;var c=(e,t,s)=>t in e?u(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s;var n=(e,t,s)=>c(e,typeof t!="symbol"?t+"":t,s);import{S as l}from"./Str.js?ver=1.3.17";import{t as y}from"./Translator.js?ver=1.3.17";import{A as g}from"./index.js?ver=1.3.17";class m{constructor(){n(this,"$notify",g);n(this,"duration",1500);n(this,"offset",30)}success(t,s="Success"){this.notify(t,s,"success")}error(t,s="Error",i=null){this.notify(t,s,"error",null,i??2e3)}info(t,s="Information"){this.notify(t,s,"info")}notify(t,s="Success",i="success",o=null,r=null){t=this.parseMessage(t),this.$notify({type:i,title:s,offset:o??this.offset,message:t,dangerouslyUseHTMLString:!0,duration:r??this.duration})}parseMessage(t){return t?typeof t=="string"?t:t&&t.message?t.message:l.objectToString(t):y("Something went wrong!")}validationErrors(t){var s,i;if(t){if(t&&((s=t.data)!=null&&s.message))return this.error((i=t.data)==null?void 0:i.message);if(t.data&&typeof t.data=="object"){let o="";for(const r in t.data){const f=t.data[r],a=Object.values(f);o+=a+" </br>"}this.error(o)}}}}const b=new m;export{b as n};
