{"version":3,"file":"AppSnackbar.vue.mjs","sources":["../../lib/modal/AppSnackbar.vue"],"sourcesContent":["<template>\n  <div>\n    <app-toast\n      v-for=\"toast in toasts\"\n      :key=\"`toast@${toast.id}`\"\n      :toastId=\"toast.id\"\n      :variant=\"toast.variant\"\n      @closed=\"handleClosed\"\n    >\n      {{ toast.message }}\n    </app-toast>\n  </div>\n</template>\n\n<script>\nimport AppToast from \"./AppToast.vue\";\n\nexport default {\n  name: 'Snackbar',\n  components: {\n    AppToast\n  },\n  data() {\n    return {\n      nextId: 0,\n      toasts: [],\n    };\n  },\n  created() {\n    this.$store.subscribe((mutation, state) => {\n      if (mutation.type === 'snackbar/SHOW_MESSAGE') {\n        const { message, variant } = state.snackbar;\n        this.toasts.push({ message, variant, id: this.nextId });\n        this.nextId += 1;\n      }\n    });\n  },\n  methods: {\n    handleClosed(id) {\n      this.toasts.splice(this.toasts.findIndex(t => t.id === id), 1);\n    },\n  },\n};\n</script>\n\n<style>\n\n</style>\n"],"names":["_sfc_main","AppToast","mutation","state","message","variant","id","t","_createElementBlock","_Fragment","_renderList","$data","toast","_createBlock","_component_app_toast","$options","_createTextVNode","_toDisplayString"],"mappings":";;;AAiBA,MAAKA,IAAU;AAAA,EACb,MAAM;AAAA,EACN,YAAY;AAAA,IACV,UAAAC;AAAA,EACD;AAAA,EACD,OAAO;AACL,WAAO;AAAA,MACL,QAAQ;AAAA,MACR,QAAQ,CAAE;AAAA;EAEb;AAAA,EACD,UAAU;AACR,SAAK,OAAO,UAAU,CAACC,GAAUC,MAAU;AACzC,UAAID,EAAS,SAAS,yBAAyB;AAC7C,cAAM,EAAE,SAAAE,GAAS,SAAAC,MAAYF,EAAM;AACnC,aAAK,OAAO,KAAK,EAAE,SAAAC,GAAS,SAAAC,GAAS,IAAI,KAAK,OAAO,CAAC,GACtD,KAAK,UAAU;AAAA,MACjB;AAAA,IACF,CAAC;AAAA,EACF;AAAA,EACD,SAAS;AAAA,IACP,aAAaC,GAAI;AACf,WAAK,OAAO,OAAO,KAAK,OAAO,UAAU,CAAAC,MAAKA,EAAE,OAAOD,CAAE,GAAG,CAAC;AAAA,IAC9D;AAAA,EACF;AACH;;;cAzCEE,EAUM,OAAA,MAAA;AAAA,YATJA,EAQYC,GAAA,MAAAC,EAPMC,EAAM,QAAA,CAAfC,YADTC,EAQYC,GAAA;AAAA,MANT,KAAG,SAAWF,EAAM,EAAE;AAAA,MACtB,SAASA,EAAM;AAAA,MACf,SAASA,EAAM;AAAA,MACf,UAAQG,EAAY;AAAA;iBAErB,MAAmB;AAAA,QAAhBC,EAAAC,EAAAL,EAAM,OAAO,GAAA,CAAA;AAAA;;;;;;"}