import{H as u,h as n}from"./app-k0jcl5PQ.js";const y={userVideoHistory(a,t,o,d){let i="video:history",r="{gateway}/v1/users/me/watch-history";return a&&(i+=`:${a}`,r+=`?cursor=${a}`),{key:i,url:r,formatData:e=>({data:e.data.map(s=>{const m=n.format(s.lastTimeWatched),v=n.format(m,"YYYY-MM-DD");return{...s,lastTimeWatched:m,lastDateWatched:v}}),pagination:e.pagination}),success:t,error:o,always:d}},videoHistory(a,t,o,d,i){const r=a.sort().map(e=>`videoId=${e}`);return{key:`video:history:videos:${r.join("&")}`,url:`{gateway}/v1/videos/history?${r.join("&")}`,normalizeOptions:{namespace:t},formatData:e=>e!=null&&e.length?e.map(s=>({id:s.videoId,lastProgressPoint:s.lastProgressPoint})):e,success:o,error:d,always:i}},removeFromHistory(a,t=[]){return{url:`{gateway}/v1/users/me/videos/${a}/watch-history`,key:`remove:video:history:${a}`,type:u.DELETE,invalidationKeys:["video:history",...t]}}};export{y as V};
//# sourceMappingURL=DqZSd8JQ.chunk.js.map
