PageSourceSearch

https://enpatiler.com/_nuxt/CGlne9yu.js

js enpatiler.com collected 2026-09-24 14:13:07 UTC 1,020 bytes, 1 lines download raw bytes

1import{y as o,a as i,d as r}from"./DEDF2X20.js";const c=o("favorites",{state:()=>({favoriteIds:[],items:[],loading:!1}),getters:{isFavorite:a=>t=>a.favoriteIds.includes(t)},actions:{async fetchFavorites(){if(i().isAuthenticated){this.loading=!0;try{const t=await r("/ecommerce/favorites");if(t&&t.success){let e=[];Array.isArray(t.data)?e=t.data:t.data?.favorites&&Array.isArray(t.data.favorites)?e=t.data.favorites:t.data?.data?.favorites&&Array.isArray(t.data.data.favorites)&&(e=t.data.data.favorites),this.items=e,this.favoriteIds=this.items.map(s=>s.id)}}catch(t){console.error("Failed to fetch favorites",t)}finally{this.loading=!1}}},async toggleFavorite(a){if(i().isAuthenticated){try{const e=await r(`/ecommerce/favorites/${a}/toggle`,{method:"POST"});if(e&&e.success)return this.favoriteIds.includes(a)?(this.favoriteIds=this.favoriteIds.filter(s=>s!==a),this.items=this.items.filter(s=>s.id!==a)):this.favoriteIds.push(a),!0}catch(e){console.error("Failed to toggle favorite",e)}return!1}}}});export{c as u};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.