Build 545032stable
Module 424185
1,843 characters · in da61f1f79c3f9106.jsDependencies
Source Raw
function(t,i,e){e.d(i,{default:()=>k});var l=e(627968),n=e(64700),r=e(224640),a=e(20742),s=e(430993),c=e(834730),d=e(696208),u=e(289873),o=e(17928),_=e(964486),p=e(67480),g=e(174459),E=e(733391),h=e(832163),x=e(652215),b=e(375708),f=e(495630);function k(t){let{transitionState:i,onClose:e,onContinue:k,guildId:A,skuId:I,analyticsLocations:R}=t,j=(0,o.bG)([h.A],()=>h.A.getSKUEligibilityEntry(I)),m=j?.state,S=(0,o.bG)([p.A],()=>p.A.get(I)),T=n.useRef(0),C=n.useRef(!1);(0,_.Ay)(()=>{T.current=Date.now(),g.default.track(x.HAw.SLAYER_STOREFRONT_PURCHASE_ELIGIBILITY_STARTED,{sku_id:I,guild_id:A,application_id:S?.applicationId??null,eligibility_state:j?.state??"none",location_stack:R})});let L=n.useCallback(t=>{if(C.current)return;C.current=!0;let i=j?.state==="error"?j:void 0;g.default.track(x.HAw.SLAYER_STOREFRONT_PURCHASE_ELIGIBILITY_COMPLETED,{sku_id:I,guild_id:A,application_id:S?.applicationId??null,result:t,duration_ms:Date.now()-T.current,error_reason:i?.reason??null,error_http_status:i?.httpStatus??null,location_stack:R})},[I,A,S?.applicationId,j,R]);return n.useEffect(()=>{null==m&&(0,E.iR)(A,I)},[A,I,m]),n.useEffect(()=>{if(null!=m&&"checking"!==m){if("ineligible"===m)return void L("ineligible");L(m),k()}},[m,k,L]),(0,l.jsx)(r.d,{transitionState:i,onClose:e,size:"ineligible"===m?"md":"sm",children:"ineligible"===m?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(a.rQ,{title:b.intl.string(b.t.cg0M2H)}),(0,l.jsx)(s.c,{children:(0,l.jsx)(c.E,{variant:"text-md/normal",color:"text-subtle",children:b.intl.string(b.t.IqlPbQ)})}),(0,l.jsx)(d.H,{actionsFullWidth:!0,actions:[{variant:"primary",text:b.intl.string(b.t.cpT0Cq),onClick:e}]})]}):(0,l.jsx)(s.c,{children:(0,l.jsxs)("div",{className:f.Q,children:[(0,l.jsx)(u.y,{}),(0,l.jsx)(c.E,{variant:"text-md/normal",color:"text-subtle",children:b.intl.string(b.t.pWxiLd)})]})})})}}