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