import{p as c}from"./mixins-CpCP8hE3.js";const a=()=>({characters:[[],[],[],[],[],[],[]],summons:[[],[],[],[],[],[],[]],chara_count:{null:0,10:0,20:0,500:0,600:0,1e3:0,1010:0,1020:0,1030:0,1040:0,1050:0,1500:0,1600:0,sum:0},chara_total:{null:0,10:0,20:0,500:0,600:0,1e3:0,1010:0,1020:0,1030:0,1040:0,1050:0,1500:0,1600:0,sum:0},summon_count:{null:0,20:0,500:0,600:0,1e3:0,1020:0,1030:0,1600:0,sum:0},summon_total:{null:0,20:0,500:0,600:0,1e3:0,1020:0,1030:0,1600:0,sum:0},user_id:-1}),e={namespaced:!0,state(){return a()},mutations:{resetCollection(o,u){Object.assign(o,a())}},actions:{fetchCollection({state:o,dispatch:u},r){if(o.user_id!==r)return Object.assign(o,a()),o.user_id=r,Promise.all([this.axios.get("/tracker/charas/"+r).then(n=>{n.data.forEach(t=>{o.characters[t.e].push(t),t.owned&&(o.chara_count.sum++,o.chara_count[t.d]++),o.chara_total[t.d]++}),o.chara_total.sum=n.data.length}).catch(n=>u("addAxiosErrorMessage",n,{root:!0})),this.axios.get("/tracker/summons/"+r).then(n=>{n.data.forEach(t=>{o.summons[t.e].push(t),t.owned&&(o.summon_count.sum++,o.summon_count[t.d]++),o.summon_total[t.d]++}),o.summon_total.sum=n.data.length}).catch(n=>u("addAxiosErrorMessage",n,{root:!0}))])}}},l=c("collection",e);export{l as p};
