import{aI as h,b2 as g,M as n,aA as m,dK as f}from"./app-k0jcl5PQ.js";import{u as l}from"./BAuuQuuB.chunk.js";import{u as F}from"./CnmbO5oy.chunk.js";const d="id";function y(e){return h.useMemo(()=>{if(!e.target.length||!e.source.length)return[];const a=new Map,o=e.target.reduce((t,r)=>{const s=r[e.targetKey||d].toString();return t[s]?t:{...t,[s]:r}},{});return e.source.forEach(t=>{const r=t[e.sourceKey||d].toString();if(a.has(r))return;const s=o[r];s&&a.set(r,s)}),[...a.values()]},[e.source,e.target,...e.deps||[]])}function K(e){var i;const u=g(),a=c=>e.shouldFetch&&m.getSentShares({cursor:c}),o=c=>u(a(c)),t=F(a,o),r=(i=t.items)==null?void 0:i.filter(c=>[n.Video,n.Clip,n.Interactive].includes(c.objectTypeId)).map(c=>c.objectId.toString()),s=l(r,f.videos);return{items:y({source:t.items,target:s.itemsArr,sourceKey:"objectId"}),hasMore:t.hasMore,isFetching:s.isFetching,nextCursor:t.nextCursor,hasFirstPageCompleted:s.hasFirstRequestCompleted,fetchNext:o}}export{K as a,y as u};
//# sourceMappingURL=BbvXec0K.chunk.js.map
