import{d as s}from"./preload-helper-DadE4qT2.chunk.mjs";import{f as l}from"./collectionFetcher-D94WC1TK.chunk.mjs";import{d as n,l as e}from"./index-Dgdobvu3.chunk.mjs";import{A as c}from"./AbortControllerMixin-Bb5X6Yae.chunk.mjs";const g=s({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 l(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-DcEv3N9Z.chunk.mjs.map