Loading
function(e,t,n){n.d(t,{H:()=>d,X:()=>c});var r=n(477900),l=n(582128),i=n(702841),u=n(617710),s=n(579908),o=n(636194);let a=l.createContext(void 0);function c(e){let t=l.useContext(a);if(null==t)throw Error(`${e??"useGroupListingsFetchContext"} must be used within a GroupListingsFetchContextProvider`);let{listingsLoaded:n,fetchGroupListingsForGuild:r}=t;return l.useEffect(()=>{r()},[r]),n}function d(e){let{guildId:t,children:n,refetchOnMount:c,includeSoftDeleted:d,countryCode:E,dontFetchWhileTrue:h}=e,A=(0,i.bG)([u.A],()=>u.A.isConnected()),S=(0,i.bG)([o.A],()=>null!=t?o.A.getSubscriptionGroupListingsForGuildFetchState(t):o.e.FETCHED),[I,_]=l.useState(!0===c),f=l.useCallback(()=>{if(null==t||!A||!0===h)return;let e=o.A.getSubscriptionGroupListingsForGuildFetchState(t);(I||e===o.e.NOT_FETCHED)&&(_(!1),s.WA(t,{includeSoftDeleted:d,countryCode:E}))},[A,t,d,E,h,I]),m=S===o.e.FETCHED&&!I;return(0,r.jsx)(a.Provider,{value:{listingsLoaded:m,fetchGroupListingsForGuild:f},children:n})}}