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