Module 340124

19,501 characters · in no known chunk
Dependencies
Source Raw
function(e,t,n){"use strict";n.d(t,{WM:()=>q,lx:()=>es,N1:()=>z,xB:()=>eh,Yb:()=>et,IV:()=>eA,Oq:()=>X,r8:()=>eu,lk:()=>ee,qY:()=>ef,jh:()=>Q,CV:()=>W,UZ:()=>en,yO:()=>ed,Fr:()=>ec,Oy:()=>Z,Gn:()=>eo,uI:()=>e_,zh:()=>eT,R2:()=>$,d6:()=>er,g5:()=>J,vD:()=>Y,qV:()=>eS,HA:()=>ea,Yf:()=>em,Ov:()=>K,QG:()=>el,Am:()=>eg,Zb:()=>eI,dQ:()=>ep,Gt:()=>ei}),n(323874),n(14289),n(35956);var i,r=n(562708),s=n(323889),a=n(636537),o=n(228366),l=n(181658),u=n(859387);function c(e){var t,n;return{id:e.id,labelTitle:e.label_title,labelSubtitle:e.label_subtitle,heroImage:(0,u.dv)(e.hero_image),heroVideo:(0,u.dv)(e.hero_video),sponsorImage:(0,u.dv)(e.sponsor_image),cta:{url:(t=e.cta).url,buttonLabel:t.button_label,android:null!=t.android?{androidAppId:t.android.android_app_id}:void 0,ios:null!=t.ios?{iosAppId:t.ios.ios_app_id}:void 0},questIds:e.quest_ids,questHomeEntrypoint:null!=e.quest_home_entrypoint?{linearGradient:(n=e.quest_home_entrypoint).linear_gradient,radialGradient:n.radial_gradient,image:(0,u.dv)(n.image),tooltipImage:(0,u.dv)(n.tooltip_image),tooltipTitle:n.tooltip_title,tooltipSubtitle:n.tooltip_subtitle}:void 0,shelfImage:(0,u.dv)(e.shelf_image),shelfVideo:(0,u.dv)(e.shelf_video)}}var d=n(881615),_=n(234396),f=n(888548),h=n(69114),p=n(633965),E=n(463347),m=n(310829),g=n(383394),A=n(711014),I=n(174459),T=n(927813),S=n(499785),N=n(789999),y=n(322683),C=n(544180),v=n(652215);function O(e){if(Math.random()>.1)return;let t=null==e.apiResponseTimestamp?null:e.apiResponseTimestamp-e.initialSendTimestamp,n=(0,y.O)();I.default.track(v.HAw.EARNED_DECISION_ROUNDTRIP,{...(0,h.A)(),endpoint:e.endpoint,was_successful:e.wasSuccessful,api_latency_ms:t,mobile_network_type:C.A.getType(),...null!=n&&{mobile_signal_strength_level:n},caller_source:e.callerSource,request_id:e.requestId,fetched_at:e.fetchedAt,is_foregrounded:(0,N.R)()})}class R{pendingRequests=new Map;recordEarnedRequestAttempt(e,t){let n={initialSendTimestamp:Date.now(),endpoint:"/quests/earned-decision",apiResponseTimestamp:null,wasSuccessful:!1,callerSource:t,requestId:null,fetchedAt:null};this.pendingRequests.set(e,n),setTimeout(()=>{let t=this.pendingRequests.get(e);null!=t&&(O(t),this.pendingRequests.delete(e))},3e4)}recordEarnedRequestApiResponse(e,t){let{wasSuccessful:n,requestId:i=null,fetchedAt:r=null}=t,s=this.pendingRequests.get(e);null!=s&&(O({...s,apiResponseTimestamp:Date.now(),wasSuccessful:n,requestId:i,fetchedAt:r}),this.pendingRequests.delete(e))}}let b=new R;var D=n(260364),L=n(859703),w=n(302654);function M(e,t,n){if(Math.random()>.1)return;let i=null==e.apiResponseTimestamp?null:e.apiResponseTimestamp-e.initialSendTimestamp,r=(0,y.O)();I.default.track(v.HAw.QUEST_DECISION_ROUNDTRIP,{...(0,h.A)(),endpoint:e.endpoint,was_successful:e.wasSuccessful,api_latency_ms:i,mobile_network_type:C.A.getType(),...null!=r&&{mobile_signal_strength_level:r},caller_source:e.callerSource,ad_request_id:e.adRequestId,fetched_at:n,previous_ad_request_id:e.previousAdDecision?.adDecisionData?.decision_id??null,previous_fetched_at:e.previousAdDecision?.fetchedAt??null,transition_case:t,is_foregrounded:(0,N.R)()})}class P{pendingRequests=new Map;recordQuestRequestAttempt(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,{enableNewRequestBehavior:i}=w.A.getConfig({location:"recordQuestRequestAttempt"}),r=i&&null!=n?L.A.questAdDecisionByPlacement.get(n)??null:null,s={initialSendTimestamp:Date.now(),endpoint:e,apiResponseTimestamp:null,wasSuccessful:!1,callerSource:t,adRequestId:null,previousAdDecision:r,placement:n};this.pendingRequests.set(e,s),setTimeout(()=>{let t=this.pendingRequests.get(e);null!=t&&(M(t,"timeout",null),this.pendingRequests.delete(e))},3e4)}recordQuestRequestApiResponse(e,t){let{wasSuccessful:n,adRequestId:i=null,currentQuestId:r=null,currentFetchedAt:s=null}=t,a=this.pendingRequests.get(e);if(null!=a){let t,u,{enableNewRequestBehavior:c}=w.A.getConfig({location:"recordQuestRequestApiResponse"});if(c){var o,l;let e,n,c;o=a.previousAdDecision,l=null!==s?{questId:r,adCreativeId:r,fetchedAt:s,ttlMillis:0,adDecisionData:null!=i?{decision_id:i}:void 0}:null,n=(e=e=>null==e?"null":null==e.questId?"no_serve":"quest")(o),c=e(l),t="quest"!==n||"quest"!==c?`${n}_to_${c}`:o?.questId===l?.questId?"same_quest":"different_quest",u=s}else t="legacy",u=null;M({...a,apiResponseTimestamp:Date.now(),wasSuccessful:n,adRequestId:i},t,u),this.pendingRequests.delete(e)}}}let x=new P;var U=n(507107),k=n(405670);let G=(0,n(945810).mj)({name:"2026-01-less-personalized-ads",kind:"user",defaultConfig:{enabled:!1},variations:{0:{enabled:!1},1:{enabled:!0}}});var F=n(561844),V=n(710969),B=n(319252),H=n(190107),j=n(375708);async function Y(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];try{let n=(await a.Bo.post({url:v.Rsh.QUEST_ON_CONSOLE_START(e),query:t?{preview:t}:void 0,failImmediatelyWhenRateLimited:!0,rejectWithError:!1})).body;if(null!=n.quest_user_status)o.h.dispatch({type:"QUESTS_USER_STATUS_UPDATE",user_status:n.quest_user_status});else if(null!=n.error_hints_v2&&n.error_hints_v2.length>0)return{errorHints:n.error_hints_v2.slice(0,5)}}catch(n){let e=new l.A(n);if(429===e.status)return{errorHints:[{type:U.xv.RATE_LIMITED,message:j.intl.string(j.t.Whhv4w),connected_account_id:"",connected_account_type:""}]};let t=e.getAnyErrorMessage()??j.intl.string(j.t.xSCvBf);return{errorHints:[{type:U.xv.GENERIC,message:t,connected_account_id:"",connected_account_type:""}]}}return{errorHints:[]}}async function W(e){await a.Bo.post({url:v.Rsh.QUEST_ON_CONSOLE_STOP(e),rejectWithError:!1})}async function K(){await a.Bo.del({url:v.Rsh.QUESTS_RESET_RECENT_QUEST_COMPLETIONS,rejectWithError:!1})}async function z(){if(!L.A.isFetchingCurrentQuests){o.h.dispatch({type:"QUESTS_FETCH_CURRENT_QUESTS_BEGIN"});try{let e=await a.Bo.get({url:v.Rsh.QUESTS_CURRENT_QUESTS,rejectWithError:!1}),t=e.body.quests.filter(e=>(0,B.s2)(e)).map(e=>(0,B.rO)(e)),n=e.body.quest_enrollment_blocked_until,i=t.filter(e=>e.userStatus?.claimedAt!=null||e.config.rewardsConfig.platforms.length>0),r=e.body.excluded_quests.map(e=>(0,B._g)(e));o.h.dispatch({type:"QUESTS_FETCH_CURRENT_QUESTS_SUCCESS",quests:i,excludedQuests:r,questEnrollmentBlockedUntil:n})}catch(e){o.h.dispatch({type:"QUESTS_FETCH_CURRENT_QUESTS_FAILURE",error:new l.A(e)})}}}async function $(e){let{questId:t,streamKey:n,applicationId:i,terminal:s=!1,executableFingerprint:a}=e;try{let e=await S.A.post({url:v.Rsh.QUESTS_HEARTBEAT(t),body:{stream_key:n,application_id:i,terminal:s,executable_fingerprint:a},trackedActionData:{event:r.NetworkActionNames.QUEST_HEARTBEAT,properties:{quest_id:t,application_id:i,terminal:s,is_overlay:__OVERLAY__,stack_trace:Error().stack??"",is_playtime_eligible:!0}},rejectWithError:!1});o.h.dispatch({type:"QUESTS_SEND_HEARTBEAT_SUCCESS",userStatus:(0,B.tp)(e.body),questId:t,streamKey:n})}catch(e){o.h.dispatch({type:"QUESTS_SEND_HEARTBEAT_FAILURE",error:new l.A(e),questId:t,streamKey:n})}}var q=((i={}).SUCCESS="success",i.CAPTCHA_FAILED="captcha_failed",i.UNKNOWN_ERROR="unknown_error",i.PREVIOUS_IN_FLIGHT_REQUEST="previous_in_flight_request",i);async function Z(e,t){if(null!=t.questContentCTA&&(0,F.Y5)({questId:e,questContent:t.questContent,questContentCTA:t.questContentCTA,questContentPosition:t.questContentPosition,questContentRowIndex:t.questContentRowIndex,sourceQuestContent:t.sourceQuestContent}),e===H.Fw&&(0,m.u)(),L.A.isEnrolling(e))return{type:"previous_in_flight_request"};o.h.dispatch({type:"QUESTS_ENROLL_BEGIN",questId:e});try{let n=(0,V.L4)(t.questContent),i=(0,V.Gp)(t.questContent,e),r=await a.Bo.post({url:v.Rsh.QUESTS_ENROLL(e),body:{location:t.questContent,...(0,V.Kc)(e,t.questContent),metadata_sealed:null!=n?n:null,traffic_metadata_sealed:null!=i?i:null},rejectWithError:!0});return o.h.dispatch({type:"QUESTS_ENROLL_SUCCESS",enrolledQuestUserStatus:(0,B.tp)(r.body)}),{type:"success"}}catch(t){var n;return o.h.dispatch({type:"QUESTS_ENROLL_FAILURE",questId:e}),(n=t)instanceof f.CaptchaCancelError||null!=n&&"object"==typeof n&&(400===n.status&&n.body?.captcha_key!=null||null!=n.captchaFields&&Object.keys(n.captchaFields).length>0||n.fields?.captcha_key!=null)?{type:"captcha_failed"}:{type:"unknown_error"}}}async function X(e,t,n){if(!L.A.isClaimingReward(e)){o.h.dispatch({type:"QUESTS_CLAIM_REWARD_BEGIN",questId:e});try{let i=(0,V.L4)(n),r=(0,V.Gp)(n,e),s=await a.Bo.post({url:v.Rsh.QUESTS_CLAIM_REWARD(e),body:{platform:t,location:n,...(0,V.Kc)(e,n),metadata_sealed:null!=i?i:null,traffic_metadata_sealed:null!=r?r:null},rejectWithError:!1}),l=(0,B.Dv)(s.body);return 0===l.errors.length?o.h.dispatch({type:"QUESTS_CLAIM_REWARD_SUCCESS",questId:e,entitlements:l}):o.h.dispatch({type:"QUESTS_CLAIM_REWARD_FAILURE",error:l.errors,questId:e}),l}catch(t){throw o.h.dispatch({type:"QUESTS_CLAIM_REWARD_FAILURE",error:new l.A(t),questId:e}),t}}}async function Q(e){if(!L.A.isFetchingRewardCode(e)){o.h.dispatch({type:"QUESTS_FETCH_REWARD_CODE_BEGIN",questId:e});try{let t=await a.Bo.get({url:v.Rsh.QUESTS_REWARD_CODE(e),rejectWithError:!1});o.h.dispatch({type:"QUESTS_FETCH_REWARD_CODE_SUCCESS",questId:e,rewardCode:(0,B.Rd)(t.body)})}catch(t){throw o.h.dispatch({type:"QUESTS_FETCH_REWARD_CODE_FAILURE",error:new l.A(t),questId:e}),t}}}async function J(e,t){let n=L.A.isDismissingContent(e),i=(0,V.vy)(t);if(!n&&i){o.h.dispatch({type:"QUESTS_DISMISS_CONTENT_BEGIN",questId:e,content:t});try{let n=(0,V.Gp)(t,e),i=await a.Bo.post({url:v.Rsh.QUESTS_DISMISS_CONTENT(e,t),body:{...(0,V.Kc)(e,t),traffic_metadata_sealed:null!=n?n:null},rejectWithError:!1});o.h.dispatch({type:"QUESTS_DISMISS_CONTENT_SUCCESS",dismissedQuestUserStatus:(0,B.tp)(i.body)})}catch(t){o.h.dispatch({type:"QUESTS_DISMISS_CONTENT_FAILURE",error:new l.A(t),questId:e})}}}function ee(e){o.h.dispatch({type:"QUESTS_DISMISS_PROGRESS_TRACKING_FAILURE_NOTICE",streamKey:e})}async function et(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;try{let n=await a.Bo.post({url:v.Rsh.QUESTS_PREVIEW_COMPLETE(e),body:{percent:t},rejectWithError:!1});o.h.dispatch({type:"QUESTS_PREVIEW_UPDATE_SUCCESS",previewQuestUserStatus:(0,B.tp)(n.body)})}catch(t){o.h.dispatch({type:"QUESTS_PREVIEW_UPDATE_FAILURE",error:new l.A(t),questId:e})}}async function en(e){try{let t=await a.Bo.del({url:v.Rsh.QUESTS_PREVIEW_STATUS(e),body:{},rejectWithError:!1});o.h.dispatch({type:"QUESTS_PREVIEW_UPDATE_SUCCESS",previewQuestUserStatus:(0,B.tp)(t.body)})}catch(t){o.h.dispatch({type:"QUESTS_PREVIEW_UPDATE_FAILURE",error:new l.A(t),questId:e})}}async function ei(e){try{o.h.dispatch({type:"QUESTS_DOCK_RESET_SOFT_DISMISSAL"});let t=await a.Bo.del({url:v.Rsh.QUESTS_PREVIEW_DISMISSIBILITY(e),body:{},rejectWithError:!1});o.h.dispatch({type:"QUESTS_PREVIEW_UPDATE_SUCCESS",previewQuestUserStatus:(0,B.tp)(t.body)})}catch(t){o.h.dispatch({type:"QUESTS_PREVIEW_UPDATE_FAILURE",error:new l.A(t),questId:e})}}function er(e){o.h.dispatch({type:"QUESTS_DELIVERY_OVERRIDE",questId:e})}function es(e,t){o.h.dispatch({type:"QUESTS_SELECT_TASK_PLATFORM",questId:e,platform:t})}async function ea(){if(!L.A.isFetchingClaimedQuests){o.h.dispatch({type:"QUESTS_FETCH_CLAIMED_QUESTS_BEGIN"});try{let e=(await a.Bo.get({url:v.Rsh.QUESTS_CLAIMED_QUESTS,rejectWithError:!1})).body.quests.map(e=>(0,B.S)(e));o.h.dispatch({type:"QUESTS_FETCH_CLAIMED_QUESTS_SUCCESS",quests:e})}catch(e){o.h.dispatch({type:"QUESTS_FETCH_CLAIMED_QUESTS_FAILURE",error:new l.A(e)})}}}function eo(e,t,n){o.h.dispatch({type:"QUESTS_UPDATE_OPTIMISTIC_PROGRESS",questId:e,taskEventName:t,progress:n})}function el(e){o.h.dispatch({type:"QUESTS_RESET_OPTIMISTIC_PROGRESS",questId:e})}async function eu(e,t){let n=Date.now();x.recordQuestRequestAttempt("/quests/decision",t,e),o.h.dispatch({type:"QUESTS_FETCH_QUEST_TO_DELIVER_BEGIN",placement:e});try{let i,r=await (0,_.Ht)(),l=await (0,d.sN)(),u=G.getConfig({location:"QuestActionCreators.fetchQuestToDeliver"}),c=(0,p.pc)(),f=null!=c?c():[],m=A.Ay.getGuildsTree(),T=f.filter(e=>{if((0,E.tZ)(e))return!1;let t=m.getNode(e);return t?.parentId==null||g.A.isFolderExpanded(t.parentId)}).slice(0,50),S=u.enabled?T:void 0,N=new URLSearchParams({placement:String(e)});r?.uuid!=null&&N.append("client_heartbeat_session_id",r.uuid),null!=l.uuid&&N.append("client_ad_session_id",l.uuid),null!=S&&S.forEach(e=>N.append("visible_guild_ids",e));let y=(await a.Bo.get({url:`${v.Rsh.QUEST_FETCH_QUEST_TO_DELIVER}?${N.toString()}`,rejectWithError:!1})).body,C=y.creative;if(null!=C)C.creative_type===s.p.QUEST&&(i=(0,B.Yn)(C.creative_content));else{let e=y.quest;i=null!=e?(0,B.Yn)(e):void 0}if(o.h.dispatch({type:"QUESTS_FETCH_QUEST_TO_DELIVER_SUCCESS",quest:i,adDecisionData:{ad_id:y.ad_identifiers?.ad_id,adset_id:y.ad_identifiers?.adset_id,ad_set_id:y.ad_identifiers?.ad_set_id,campaign_id:y.ad_identifiers?.campaign_id,creative_id:y.ad_identifiers?.creative_id,creative_type:y.ad_identifiers?.creative_type,decision_id:y.request_id,is_targeted:null!=y.ad_identifiers},metadataSealed:y.metadata_sealed,trafficMetadataSealed:y.traffic_metadata_sealed,adContext:y.ad_context,responseTtlSeconds:y.response_ttl_seconds,placement:e,fetchedAt:n}),x.recordQuestRequestApiResponse("/quests/decision",{wasSuccessful:!0,adRequestId:String(y.request_id),currentQuestId:i?.id??null,currentFetchedAt:n}),null==i)return;e===U.yW.DESKTOP_ACCOUNT_PANEL_AREA&&D.A.startTracking(i.id),I.default.track(v.HAw.QUEST_DECISION_RECEIVED,{...(0,h.A)(),quest_id:i.id,caller_source:t,ad_request_id:String(y.request_id)})}catch(i){x.recordQuestRequestApiResponse("/quests/decision",{wasSuccessful:!1,currentFetchedAt:n}),I.default.track(v.HAw.QUEST_DECISION_ROUNDTRIP_ERROR,{...(0,h.A)(),reason:i?.message??null,api_error:new l.A(i).getAnyErrorMessage(),caller_source:t}),o.h.dispatch({type:"QUESTS_FETCH_QUEST_TO_DELIVER_FAILURE",error:new l.A(i),placement:e})}}function ec(e,t){o.h.dispatch({type:"QUESTS_FETCH_QUEST_TO_DELIVER_SUCCESS",quest:void 0,placement:e,fetchedAt:Date.now(),responseTtlSeconds:t/1e3})}async function ed(e,t,n){if(L.A.isFetchingEarnedQuestToDeliverByPlacement(t))return;let i=L.A.earnedQuestForPlacement.get(t)?.earnedDecisionByQuestId,r=e.filter(e=>{let t=i?.get(e);return!(0,V.Oh)(t)});if(0===r.length)return;let s=Date.now();b.recordEarnedRequestAttempt(t,n),o.h.dispatch({type:"QUESTS_FETCH_EARNED_QUEST_TO_DELIVER_BEGIN",content:t});try{let e=await (0,_.Ht)(),n=r.join(","),i=await a.Bo.get({url:v.Rsh.QUEST_EARNED_DECISION(n,t,e?.uuid),rejectWithError:!1}),l=i.body.quests,u=i.body.response_ttl_seconds,c=new Map(r.map(e=>{let t=l?.[e];return[e,null!=t&&(0,B.s2)(t)?t:null]}));o.h.dispatch({type:"QUESTS_FETCH_EARNED_QUEST_TO_DELIVER_SUCCESS",serverQuests:c,content:t,fetchedAt:s,responseTtlSeconds:u}),b.recordEarnedRequestApiResponse(t,{wasSuccessful:!0,requestId:i.body.request_id??null,fetchedAt:s})}catch(e){b.recordEarnedRequestApiResponse(t,{wasSuccessful:!1,fetchedAt:s}),o.h.dispatch({type:"QUESTS_FETCH_EARNED_QUEST_TO_DELIVER_FAILURE",error:new l.A(e),content:t})}}async function e_(e,t){await S.A.post({url:v.Rsh.QUESTS_VIDEO_PROGRESS(e),body:{timestamp:t},trackedActionData:{event:r.NetworkActionNames.QUEST_VIDEO_PROGRESS,properties:{quest_id:e,timestamp_sec:t.toString(),stack_trace:Error().stack??""}},rejectWithError:!1})}async function ef(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=(0,u.tW)(e,u.fY.VIDEO_PLAYER_TRANSCRIPT,void 0,t);if(null==n)return void k.Ay.getState().setTranscriptAsset({questId:e.id,fetchStatus:k.Lx.FAILURE});k.Ay.getState().setTranscriptAsset({questId:e.id,fetchStatus:k.Lx.FETCHING});try{let t=await a.Bo.get({url:n.url,rejectWithError:!0});k.Ay.getState().setTranscriptAsset({questId:e.id,fetchStatus:k.Lx.SUCCESS,text:t.text,url:n.url})}catch(t){k.Ay.getState().setTranscriptAsset({questId:e.id,fetchStatus:k.Lx.FAILURE})}}async function eh(e){let t=await a.Bo.get({url:v.Rsh.QUEST(e),rejectWithError:!1});return(0,B.Yn)(t.body)}async function ep(e){if(!L.A.isFetchingQuestPreview(e)){o.h.dispatch({type:"QUESTS_FETCH_PREVIEW_BEGIN",questId:e});try{let t=await a.Bo.get({url:v.Rsh.QUEST_PREVIEW(e),rejectWithError:!1});o.h.dispatch({type:"QUESTS_FETCH_PREVIEW_SUCCESS",questId:e,quest:(0,B.rO)(t.body)})}catch(t){throw o.h.dispatch({type:"QUESTS_FETCH_PREVIEW_FAILURE",error:new l.A(t),questId:e}),t}}}let eE=5*T.A.Millis.MINUTE;async function em(){if(L.A.isFetchingQuestHomeHero())return;let e=L.A.getLastFetchedQuestHomeHero();if(!(null!=e&&Date.now()-e<=eE)){o.h.dispatch({type:"QUESTS_FETCH_QUEST_HOME_HERO_BEGIN"});try{let e=[U.gh.QUEST_HOME_BANNER],t=await a.Bo.get({url:v.Rsh.QUEST_PLACEMENT,query:{placements:e,platform:U.vg.WEB},rejectWithError:!1});o.h.dispatch({type:"QUESTS_FETCH_QUEST_HOME_HERO_SUCCESS",questHomeHero:(0,B.oc)(t.body)})}catch(e){throw o.h.dispatch({type:"QUESTS_FETCH_QUEST_HOME_HERO_FAILURE",error:new l.A(e)}),e}}}async function eg(){let e=U.yW.QUEST_HOME_BANNER_DESKTOP;if(L.A.isFetchingQuestToDeliverByPlacement(e))return;let t=L.A.getLastFetchedQuestHomeHero();if(null!=t&&Date.now()-t<=eE)return;let n=Date.now();o.h.dispatch({type:"QUESTS_FETCH_QUEST_HOME_HERO_DECISION_BEGIN",placement:e});try{let t=await (0,_.Ht)(),i=await (0,d.sN)(),r=new URLSearchParams({placement:String(e),num_decisions_requested:"1"});t?.uuid!=null&&r.append("client_heartbeat_session_id",t.uuid),null!=i.uuid&&r.append("client_ad_session_id",i.uuid);let l=(await a.Bo.get({url:`${v.Rsh.QUESTS_GET_DECISIONS}?${r.toString()}`,rejectWithError:!1})).body,u=l.decisions?.[0]??null,f=u?.creative??null,h=null;null!=f&&f.creative_type===s.p.QUEST_HOME_HERO&&(h=c(f.creative_content)),o.h.dispatch({type:"QUESTS_FETCH_QUEST_HOME_HERO_DECISION_SUCCESS",questHomeHero:h,adDecisionData:{ad_id:u?.ad_identifiers?.ad_id,ad_set_id:u?.ad_identifiers?.ad_set_id,campaign_id:u?.ad_identifiers?.campaign_id,creative_id:u?.ad_identifiers?.creative_id,creative_type:u?.ad_identifiers?.creative_type,decision_id:l.request_id,is_targeted:u?.ad_identifiers!=null},metadataSealed:u?.metadata_sealed,trafficMetadataSealed:u?.traffic_metadata_sealed,adContext:u?.ad_context,responseTtlSeconds:u?.response_ttl_seconds,placement:e,fetchedAt:n})}catch(t){throw o.h.dispatch({type:"QUESTS_FETCH_QUEST_HOME_HERO_DECISION_FAILURE",error:new l.A(t),placement:e}),t}}async function eA(e){let t=U.yW.QUEST_HOME_BANNER_DESKTOP,n=Date.now();o.h.dispatch({type:"QUESTS_FETCH_QUEST_HOME_HERO_DECISION_BEGIN",placement:t});try{let i=new URLSearchParams;i.append("ad_creative_ids",e);let r=(await a.Bo.get({url:`${v.Rsh.QUESTS_CREATIVE_PREVIEW}?${i.toString()}`,rejectWithError:!1})).body,l=r.decisions?.[0]??null,u=l?.creative??null,d=null;null!=u&&u.creative_type===s.p.QUEST_HOME_HERO&&(d=c(u.creative_content)),o.h.dispatch({type:"QUESTS_FETCH_QUEST_HOME_HERO_DECISION_SUCCESS",questHomeHero:d,adDecisionData:{ad_id:l?.ad_identifiers?.ad_id,ad_set_id:l?.ad_identifiers?.ad_set_id,campaign_id:l?.ad_identifiers?.campaign_id,creative_id:l?.ad_identifiers?.creative_id,creative_type:l?.ad_identifiers?.creative_type,decision_id:r.request_id,is_targeted:l?.ad_identifiers!=null},metadataSealed:l?.metadata_sealed,trafficMetadataSealed:l?.traffic_metadata_sealed,adContext:l?.ad_context,responseTtlSeconds:l?.response_ttl_seconds,placement:t,fetchedAt:n})}catch(e){throw o.h.dispatch({type:"QUESTS_FETCH_QUEST_HOME_HERO_DECISION_FAILURE",error:new l.A(e),placement:t}),e}}function eI(e){o.h.dispatch({type:"UNENROLLED_ACTIVITY_QUEST_DISMISS",questId:e})}function eT(e,t){o.h.dispatch({type:"AD_CONTENT_MARK_SEEN",adCreativeType:e,contentIds:t})}function eS(e,t){o.h.dispatch({type:"AD_CONTENT_MARK_UNSEEN",adCreativeType:e,contentIds:t})}}