1"use strict";(self.webpackChunkng_up=self.webpackChunkng_up||[]).push([["default-src_app_web-app_services_profile-access_service_ts"],{69046:(b,L,e)=>{e.d(L,{Er:()=>D,JU:()=>l,iw:()=>o,l3:()=>U,lM:()=>d,v6:()=>t});var S=e(34929),p=e(62410),v=e(15741),g=e(60116),a=e(3184),R=e(65925),A=e(1146),B=e(14045),d=(()=>((d||(d={})).TWO="variant_50_perc",d))();const l="#upsell_annual_web_ios";var D=(()=>{return(r=D||(D={})).DISABLE="disable_banner",r.PROFILE_SELECT_PAGE="profile_select_cta",r.PARENT_DASHBOARD="parent_dashboard_cta",D;var r})();const t="com.getepic.",h={[d.TWO]:{heading:"Switch to an annual plan and save discountPercent%!",price_text:"Just <strong>$dealPrice</strong> a year, instead of $currentPrice with monthly plan.",discount_text:"It\u2019s like getting numberOfMonths months of Epic Family for free.",price_image:"/assets/upsell/piggy-bank.svg",discount_image:"/assets/upsell/pink-clock.svg"}};var o=(()=>{return(r=o||(o={})).WEB="WEB",r.ANDROID="ANDROID",r.IOS="IOS",r.APPLE="apple",o;var r})();const T=["",void 0,"android","ios","email","profile_select","parent_dashboard"];let U=(()=>{class r{constructor(i,s,E){this._dataService=i,this._accountService=s,this._store=E,this._considerInitialPrice=!1,this._bannerApiDetails={display_banner:!1,variant:d.TWO,product_id:"",platform:"",source:"",discount_percent:0}}getBannerDetails(){const i=this._store.select(v.GP);return new Promise((s,E)=>{i.pipe((0,g.h)(f=>Boolean(f))).subscribe(f=>(0,S.mG)(this,void 0,void 0,function*(){try{const W={platform:"WEB",uuid:this._accountService.uuid,countryCode:f},G=yield this._dataService.get("WebAccount","getUpgradeAnnualPlanBanner",W);s(G)}catch(W){E(W)}}),f=>E(f))})}setBannerDetailsForUpsell(i){this._bannerApiDetails=i}getBannerDetailsForUpsell(){return this._bannerApiDetails}setUpsellDealProduct(i){this._upsellDealProduct=i}getUpsellDealProduct(){return this._upsellDealProduct}getBannerVariantsData(){return h}updateUpsellBannerAction(i){return this._dataService.get("WebAccount","updateUpgradeSubscriptionBanner",{action:i,uuid:this._accountService.uuid})}getMappedPlatformValue(i){let s=o.WEB;switch(i=null==i?void 0:i.toLowerCase()){case p.T.ANDROID.toLowerCase():s=o.ANDROID;break;case p.T.IOS.toLowerCase():s=o.IOS}return s}setInitialPriceFlag(i){this._considerInitialPrice=i}getInitialPriceFlag(){return this._considerInitialPrice}getIosGroupTag(i){var s,E;return null===(E=null===(s=null==i?void 0:i.split(","))||void 0===s?void 0:s.filter(f=>f.indexOf("group")>=0)[0])||void 0===E?void 0:E.replace("#","")}appendProductId(i){this.setBannerDetailsForUpsell(Object.assign(Object.assign({},this.getBannerDetailsForUpsell()),{product_id:null==i?void 0:i.replace(t,"")}))}getVaidSourcesData(){return T}}return r.\u0275fac=function(i){return new(i||r)(a.LFG(R.D),a.LFG(A.B),a.LFG(B.yh))},r.\u0275prov=a.Yz7({token:r,factory:r.\u0275fac,providedIn:"root"}),r})()},58597:(b,L,e)=>{e.d(L,{n:()=>$});var S=e(34929),p=e(50253),v=e(78611),g=e(47735),a=e(15527),R=e(59295),A=e(44821),B=e(94660),d=e(42087),l=e(5593),D=e(73398),t=e(3184),h=e(1146),o=e(98476),T=e(68893),U=e(64617),r=e(44687),y=e(54189),i=e(77861),s=e(35520),E=e(48146),f=e(1494),W=e(12379),G=e(31503),x=e(69046);let $=(()=>{class M{constructor(n,P,c,u,O,C,K,_,m,I,F,N,z){this.accountService=n,this.audioVoiceoverService=P,this.bigQueryService=c,this.coreDialogService=u,this.dailyReadTimeService=O,this.eduOnboardingService=C,this.freemiumService=K,this.localStorageService=_,this.profileDefaultStateService=m,this.profileService=I,this.router=F,this.routingService=N,this._upsellService=z,this.profileSelected$=new p.x,this.disableClose=!1,this.routesToDisableCloseButtonOnPasswordScreen=[a.Pm.ACCOUNT_MANAGE_SUBSCRIPTION,`${a.Pm.DASHBOARD_PROFILES}?${A.Ui}=${A.nr}`],this.router.events.subscribe(()=>{this.disableClose=this.routesToDisableCloseButtonOnPasswordScreen.some(H=>this.router.url.indexOf(H)>=0)})}authenticateProfile(n,P){var c;return(0,S.mG)(this,void 0,void 0,function*(){let u={profile:n,hideCloseButton:this.disableClose};if(P){const O=null===(c=null==P?void 0:P.state)||void 0===c?void 0:c.gracePeriodActive;u=Object.assign(Object.assign({},u),{gracePeriodActive:O})}return yield this.coreDialogService.loadComponentWithLazyLoadImports(B.E.ProfileAuthDialogComponent,{disableClose:this.disableClose,data:u})})}selectProfile(n,P,c,u){![a.Pm.PROFILE_SELECT].includes(this.routingService.getCurRoute()[1])&&this.profileService.currentProfile.isParent&&(P=!0),this.audioVoiceoverService.clearPlayedAudioMap();const C=this.profileService.currentProfile.id;return P||this.eduOnboardingService.studentsSetupBannerData.isStudentExploreMode?this.onAccessSuccess(n,C,c,u):(_=>(0,S.mG)(this,void 0,void 0,function*(){if(_.isParent||_ instanceof g.V&&_.pin&&_.pin.length>0){const m=yield this.authenticateProfile(_,c);let I=yield(0,v.n)(m.afterClosed());return(null==I?void 0:I.success)||!1}return!0}))(n).then(_=>_?this.onAccessSuccess(n,C,c,u):null)}onAccessSuccess(n,P,c,u){return this.bigQueryService.mark_start(l.h.PERFORMANCE_USER_CHANGE_COMPLETE),Promise.all([this.freemiumService.handleProfileLogin(n),this.profileService.selectProfile(n.id,void 0,c,u,this._upsellService.getBannerDetailsForUpsell(),!this.accountService.isEducator())]).then(O=>{if(O&&O[1]){const C=O[1];this.freemiumService.resetFreemiumReadingDuration(),this.profileService.showFreemiumExperience(),this.dailyReadTimeService.checkDailyReadTimeDialog(),C.isParent&&this.bigQueryService.log("account_switch_to_parent"),this.profileService.isTeacher()&&this.eduOnboardingService.setIsStudentExploreMode(!1),this.profileDefaultStateService.getDefaultState(this.profileService.currentProfile).then(K=>{let _=K;return _=this.profileService.getRedirectState(_,u,this._upsellService.getBannerDetailsForUpsell()),this.localStorageService.set(D.vR,this.accountService.isEducator()&&!!this.profileService.currentProfile.isParent),this.loadOnboardingDataForEducator().then(()=>(0,S.mG)(this,void 0,void 0,function*(){this.router.events.pipe((0,R.q)(1)).subscribe(F=>{this.profileSelected$.next(this.profileService.currentProfile)});const m=this.profileService.currentProfile instanceof d.l&&this.accountService.isEducator();if(this.profileService.currentProfile instanceof g.V&&this.routingService.goToWebApp
1Route({route:_,extras:c||this.profileService.getRouteExtras()}),m){const F=yield this.eduOnboardingService.proceedWithTeacherOnboard();this.routingService.goToWebAppRoute({route:F||a.Pm.EDU_DASHBOARD})}})),this.bigQueryService.mark_end_and_send(l.h.PERFORMANCE_USER_CHANGE_COMPLETE,{src:"epic-header.service"}),n})}})}loadOnboardingDataForEducator(){return this.profileService.isTeacher()?this.eduOnboardingService.loadOnboardingData():Promise.resolve()}}return M.\u0275fac=function(n){return new(n||M)(t.LFG(h.B),t.LFG(y.dG),t.LFG(o.p),t.LFG(T.CoreDialogService),t.LFG(i.R),t.LFG(s.J0),t.LFG(E.h),t.LFG(U.n),t.LFG(f.w),t.LFG(r.ProfileService),t.LFG(W.F0),t.LFG(G.Zn),t.LFG(x.l3))},M.\u0275prov=t.Yz7({token:M,factory:M.\u0275fac,providedIn:"root"}),M})()},1494:(b,L,e)=>{e.d(L,{w:()=>d});var S=e(34929),p=e(15527),v=e(3184),g=e(1146),a=e(84762),R=e(11105),A=e(44687),B=e(77902);let d=(()=>{class l{constructor(t,h,o,T,U){this._accountService=t,this._accountFlagsService=h,this._experienceService=o,this._profileService=T,this._sessionStorageService=U,this.profileCreateIsFinishing=!1}getDefaultState(t){return(0,S.mG)(this,void 0,void 0,function*(){const h=yield this._getProfileShouldSeeTopicsOnboarding(t),o=this._getProfileShouldSeeOnboarding();return h||o?p.Pm.ONBOARDING_PROFILE:t.getDefaultState()})}_getProfileShouldSeeTopicsOnboarding(t){return(0,S.mG)(this,void 0,void 0,function*(){const h=this._sessionStorageService.getSessionStorageWithKey(this._sessionStorageService.KEYS.IS_LINKED_PROFILE_FIRST_SESSION);return!this._profileService.currentProfile.isParent&&this._experienceService.isPremiumExperience()&&this._profileService.currentProfile.nufComplete&&h?!(yield this._accountFlagsService.getProfileHasSeenFirstSession(this._profileService.currentProfile)):0})}_getProfileShouldSeeOnboarding(){return!(!this._profileService.currentProfile||this._profileService.currentProfile.nufComplete||this._profileService.currentProfile.isParent||this.profileCreateIsFinishing||this._accountService.isEducator())}}return l.\u0275fac=function(t){return new(t||l)(v.LFG(g.B),v.LFG(a.T),v.LFG(R.DT),v.LFG(A.ProfileService),v.LFG
1(B.u))},l.\u0275prov=v.Yz7({token:l,factory:l.\u0275fac,providedIn:"root"}),l})()}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.