{"version":3,"file":"toast-BIQrrdQq.js","sources":["../../cognitocmsapi/stores/toast.ts"],"sourcesContent":["import { acceptHMRUpdate, defineStore } from 'pinia'\nimport { nanoid } from 'nanoid'\n\nexport const useToastStore = defineStore({\n id: 'toast',\n\n state: () => {\n return {\n toasts: [],\n }\n },\n\n actions: {\n addToast(message: string, type: string, timeout: number) {\n const id = nanoid()\n const toast = { message, type, timeout, id }\n this.toasts.push(toast)\n setTimeout(() => {\n // Remove toast\n this.toasts.splice(this.toasts.findIndex(e => e.id == id), 1)\n }, timeout)\n },\n },\n\n persist: false,\n share: {\n enable: false,\n },\n})\n\nif (import.meta.hot) {\n import.meta.hot.accept(acceptHMRUpdate(useToastStore, import.meta.hot))\n}\n"],"names":["useToastStore","defineStore","message","type","timeout","id","nanoid","toast","e"],"mappings":"6CAGO,MAAMA,EAAgBC,EAAY,CACvC,GAAI,QAEJ,MAAO,KACE,CACL,OAAQ,CAAA,CACV,GAGF,QAAS,CACP,SAASC,EAAiBC,EAAcC,EAAiB,CACvD,MAAMC,EAAKC,EAAO,EACZC,EAAQ,CAAE,QAAAL,EAAS,KAAAC,EAAM,QAAAC,EAAS,GAAAC,CAAG,EACtC,KAAA,OAAO,KAAKE,CAAK,EACtB,WAAW,IAAM,CAEV,KAAA,OAAO,OAAO,KAAK,OAAO,aAAeC,EAAE,IAAMH,CAAE,EAAG,CAAC,GAC3DD,CAAO,CAAA,CAEd,EAEA,QAAS,GACT,MAAO,CACL,OAAQ,EAAA,CAEZ,CAAC"}