import{d as l}from"./vue.runtime.esm-Ct3_M7aQ.chunk.mjs";import{f as s}from"./collectionFetcher-Bc_5r3B7.chunk.mjs";import{al as n,l as e}from"./index-BMeBqg0T.chunk.mjs";import{A as c}from"./AbortControllerMixin-KqbYNBDv.chunk.mjs";const g=l({name:"FetchCollectionsMixin",data(){return{errorFetchingCollections:null,loadingCollections:!1}},mixins:[c],methods:{async fetchCollections(t,r=[],i=n){if(this.loadingCollections)return[];try{this.loadingCollections=!0,this.errorFetchingCollections=null;const o=await s(t,{signal:this.abortController.signal},r,i);return this.$store.dispatch("addCollections",{collections:o}),o}catch(o){o.response?.status===404?this.errorFetchingCollections=404:this.errorFetchingCollections=o,e.error("Error fetching collections:",{error:o})}finally{this.loadingCollections=!1}return[]}}});export{g as F};
//# sourceMappingURL=FetchCollectionsMixin-CqTYuk_r.chunk.mjs.map
