Build 614181stable
Module 463398
2,188 characters · in no known chunkDependencies
Source Raw
function(e,t,n){"use strict";n.d(t,{A:()=>A});var i=n(439372),r=n(773669),a=n(287809),s=n(166403),l=n(158045);n(725018);var o=n(962644),d=n(412260),c=n(202541),u=n(652215),_=n(818348);class E extends i.A{actions={POST_CONNECTION_OPEN:this.onPostConnectionOpen.bind(this),EXPERIMENTS_FETCH_SUCCESS:this.onPostConnectionOpen.bind(this),IAP_PURCHASE_PRODUCT_SUCCESS:this.onMobilePurchaseSuccess.bind(this),GPLAY_PURCHASE_VERIFIED:this.onMobilePurchaseSuccess.bind(this),BILLING_USER_OFFER_ACKNOWLEDGED_SUCCESS:this.onOfferUpdated.bind(this),BILLING_USER_TRIAL_OFFER_ACKNOWLEDGED_SUCCESS:this.onOfferUpdated.bind(this),BILLING_REFERRAL_RESOLVE_SUCCESS:this.onOfferUpdated.bind(this),VIRTUAL_CURRENCY_REDEEM_SUCCESS:this.onVCRedeemed.bind(this)};stores=new Map().set(r.default,this.onLocaleChanged.bind(this)).set(s.A,this.onSubscriptionStateChanged.bind(this)).set(d.A,this.onPromotionsFetchSettled.bind(this));lastSubscriptionStateSignature=null;hasPendingSubscriptionRefetch=!1;_terminate(){this.hasPendingSubscriptionRefetch=!1,this.lastSubscriptionStateSignature=null}onLocaleChanged(){null==d.A.lastFetchedActivePromotions||d.A.lastFetchedActivePromotionsLocale!==r.default.locale&&(0,o.BE)(!1)}async onPostConnectionOpen(){(0,o.BE)(),await this.maybeFetchBogoPromotion()}maybeFetchBogoPromotion=async()=>{let e=a.default.getCurrentUser();l.Ay.isPremiumExactly(e,c.PremiumTypes.TIER_2)};onSubscriptionStateChanged(){let e,t=null==(e=s.A.getSubscriptions(!1))?"":Object.values(e).filter(e=>e.type===_.rz.PREMIUM).map(e=>{let t=e.items.map(e=>e.planId).sort().join("|");return`${e.id}:${e.type}:${e.status}:${t}`}).sort().join(","),n=null==this.lastSubscriptionStateSignature;if(t!==this.lastSubscriptionStateSignature&&(this.lastSubscriptionStateSignature=t,!n)){if(d.A.isFetchingActivePromotions){this.hasPendingSubscriptionRefetch=!0;return}(0,o.BE)(!1)}}onPromotionsFetchSettled(){!this.hasPendingSubscriptionRefetch||d.A.isFetchingActivePromotions||(this.hasPendingSubscriptionRefetch=!1,(0,o.BE)(!1))}onMobilePurchaseSuccess(){(0,o.BE)(!1)}onOfferUpdated(){(0,o.BE)(!1)}onVCRedeemed(e){let{entitlements:t}=e;t.some(e=>e.type===u.zF_.FRACTIONAL_REDEMPTION)&&(0,o.BE)(!1)}}let A=new E}