2026-08-24 06:08:38 +00:00
// Module ID: 10727
// Function ID: 10728
2026-07-29 08:29:29 +00:00
// Name: set
2026-08-24 06:08:38 +00:00
// Dependencies: [5, 19, 7491, 9543, 676, 21, 514, 9539, 7489, 7507, 7519, 7518, 500, 7469, 9541, 10516, 9540, 9544, 7497, 7508, 7524, 5011, 5016, 10726, 589, 4766, 2]
2026-07-20 16:05:17 +00:00
// Exports: QuestContentImpressionTracker
2026-08-24 06:08:38 +00:00
// Module 10727 (set)
import closure_3 from "asyncGeneratorStep" /* 5 */ ;
import importAllResult from "noop" /* 19 */ ;
import closure_5 from "initializeState" /* 7491 */ ;
import MAX_BRAND_SAFETY_CONTEXT_ARRAY_LEN from "MAX_BRAND_SAFETY_CONTEXT_ARRAY_LEN" /* 9543 */ ;
import { AnalyticEvents } from "ME" /* 676 */ ;
import { jsx } from "jsxProd" /* 21 */ ;
import set from "set" /* 2 */ ;
2026-07-23 10:11:24 +00:00
const require = arg1 ;
2026-07-29 08:29:29 +00:00
let c4 = importAllResult ;
2026-08-24 06:08:38 +00:00
( { HEARTBEAT_SECONDS : closure_6 , MIN_QUEST_VIEW_TIME_SECONDS : error , MIN_QUEST_CONTENT_VISIBILITY_PERCENTAGE : closure_8 } = MAX_BRAND_SAFETY_CONTEXT_ARRAY_LEN ) ;
2026-07-23 10:11:24 +00:00
let set = new Set ( ) ;
2026-07-29 08:29:29 +00:00
let QuestContentImpression ;
class QuestContentImpression {
constructor ( arg0 ) {
obj = Object . create ( new . target . prototype ) ;
closure_0 = obj ;
obj . isRunning = false ;
obj . trackViewedPlacement = function trackViewedPlacement ( adCreativeId ) {
2026-08-24 06:08:38 +00:00
obj = obj ( closure_1_2 [ 8 ] ) ;
2026-07-29 08:29:29 +00:00
const questPlacementFromQuestContent = obj . getQuestPlacementFromQuestContent ( obj . questContent ) ;
let result = null != questPlacementFromQuestContent ;
if ( result ) {
2026-08-24 06:08:38 +00:00
result = obj ( closure_1_2 [ 8 ] ) . isBillableQuestContent ( obj . questContent ) ;
const tmpResult = obj ( closure_1_2 [ 8 ] ) ;
2026-07-29 08:29:29 +00:00
}
if ( result ) {
const _HermesInternal = HermesInternal ;
2026-08-24 06:08:38 +00:00
closure_1_11 . add ( "" + adCreativeId + "_" + questPlacementFromQuestContent ) ;
2026-07-29 08:29:29 +00:00
}
} ;
obj . shouldExtendSession = function shouldExtendSession ( adCreativeId ) {
2026-08-24 06:08:38 +00:00
obj = obj ( closure_1_2 [ 8 ] ) ;
2026-07-29 08:29:29 +00:00
const questPlacementFromQuestContent = obj . getQuestPlacementFromQuestContent ( obj . questContent ) ;
let result = null != questPlacementFromQuestContent ;
if ( result ) {
const _HermesInternal = HermesInternal ;
2026-08-24 06:08:38 +00:00
result = ! closure_1_11 . has ( "" + adCreativeId + "_" + questPlacementFromQuestContent ) ;
2026-07-29 08:29:29 +00:00
}
if ( result ) {
2026-08-24 06:08:38 +00:00
result = obj ( closure_1_2 [ 8 ] ) . isBillableQuestContent ( obj . questContent ) ;
const tmpResult = obj ( closure_1_2 [ 8 ] ) ;
2026-07-29 08:29:29 +00:00
}
return result ;
} ;
closure_0 = obj ;
2026-08-24 06:08:38 +00:00
obj . onMinViewTimeReached = closure_3 ( function * ( ) {
2026-07-29 08:29:29 +00:00
if ( c3 === 2 ) {
c3 = 3 ;
HermesBuiltin . throwTypeError ( ) ;
} else if ( tmp4 === 3 ) {
if ( arg0 === 1 ) {
throw arg1 ;
} else if ( arg0 === 2 ) {
2026-08-24 06:08:38 +00:00
obj = { value : null , done : true } ;
2026-07-29 08:29:29 +00:00
obj [ 0 ] = arg1 ;
return obj ;
} else {
2026-08-24 06:08:38 +00:00
return { value : "HermesInternal" , done : null } ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
} else {
try {
c3 = 2 ;
if ( 0 === obj4 ) {
if ( arg0 === 1 ) {
c3 = 3 ;
throw arg1 ;
} else if ( arg0 === 2 ) {
c3 = 3 ;
obj = { value : null , done : true } ;
obj [ 0 ] = arg1 ;
return obj ;
} else {
let obj3 = tmp5 ;
2026-08-24 06:08:38 +00:00
closure_0 = tmp2 ;
2026-07-29 08:29:29 +00:00
closure_0 = undefined ;
obj3 = undefined ;
obj4 = undefined ;
2026-08-24 06:08:38 +00:00
const obj10 = closure_1_0 ( 7519 ) ;
2026-07-29 08:29:29 +00:00
obj4 = 1 ;
c3 = 1 ;
2026-08-24 06:08:38 +00:00
obj1 = { value : null , done : false } ;
obj1 [ 0 ] = obj10 . getAdUser ( closure_1_0 ( 7518 ) . getQuestContentName ( closure_1_0 . questContent ) ) ;
2026-07-29 08:29:29 +00:00
return obj1 ;
}
} else if ( arg0 === 1 ) {
c3 = 3 ;
throw arg1 ;
} else if ( arg0 === 2 ) {
c3 = 3 ;
let obj2 = { value : null , done : true } ;
obj2 [ 0 ] = arg1 ;
return obj2 ;
} else {
closure_0 = arg1 ;
obj3 = { trackGuildAndChannelMetadata : null , sourceQuestContent : null } ;
obj3 [ 0 ] = closure_0 . trackGuildAndChannelMetadata ;
obj3 [ 1 ] = closure_0 . sourceQuestContent ;
obj4 = { min_view_time_seconds : null , min_viewport_percentage : null , triggered_by_status_change : null , apple_advertising_id : null , android_advertising_id : null } ;
obj4 [ 0 ] = closure_0 . minViewTimeSeconds ;
obj4 [ 1 ] = closure_0 . minViewportPercentage ;
obj4 [ 2 ] = closure_0 . triggeredByStatusChange ;
let advertisingId = null ;
if ( null != closure_0 ) {
2026-08-24 06:08:38 +00:00
obj = closure_1_0 ( 500 ) ;
2026-07-29 08:29:29 +00:00
advertisingId = null ;
if ( obj . isIOS ( ) ) {
2026-08-24 06:08:38 +00:00
advertisingId = closure_1_0 . advertisingId ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
}
obj4 [ 3 ] = advertisingId ;
let advertisingId1 = null ;
2026-08-24 06:08:38 +00:00
if ( null != closure_1_0 ) {
obj1 = closure_1_0 ( 500 ) ;
2026-07-29 08:29:29 +00:00
advertisingId1 = null ;
if ( obj1 . isAndroid ( ) ) {
2026-08-24 06:08:38 +00:00
advertisingId1 = closure_1_0 . advertisingId ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
}
obj4 [ 4 ] = advertisingId1 ;
2026-08-24 06:08:38 +00:00
let merged = Object . assign ( closure_1_1 ( 7469 ) ( ) ) ;
obj2 = closure_1_0 ( 9541 ) ;
let merged1 = Object . assign ( obj2 . getBrandSafetyContext ( closure_1_0 . questContent ) ) ;
const adContentIds = closure_1_0 . entity . adContentIds ;
2026-07-29 08:29:29 +00:00
const item = adContentIds . forEach ( ( adCreativeId ) = > {
2026-08-24 06:08:38 +00:00
obj = closure_2_0 ( obj4 [ 8 ] ) ;
obj1 = closure_0 ;
2026-07-29 08:29:29 +00:00
let adMetadataSealed = obj . getAdMetadataSealed ( closure_0 . sourceQuestContent , adCreativeId ) ;
const shouldExtendSessionResult = closure_0 . shouldExtendSession ( adCreativeId ) ;
closure_0 . trackViewedPlacement ( adCreativeId ) ;
const adCreativeType = closure_0 . entity . adCreativeType ;
2026-08-24 06:08:38 +00:00
const QUEST = closure_2_0 ( obj4 [ 9 ] ) . AdCreativeType . QUEST ;
2026-07-29 08:29:29 +00:00
if ( closure_0 . migrateQuestContentViewedToCaptureAdUserAction ) {
if ( adCreativeType === QUEST ) {
2026-08-24 06:08:38 +00:00
const quest = closure_2_5 . getQuest ( tmp30 ) ;
2026-07-29 08:29:29 +00:00
let isQuestExpiredResult = null == quest ;
if ( ! isQuestExpiredResult ) {
let tmpResult = tmp ( tmp2 [ 8 ] ) ;
isQuestExpiredResult = tmpResult . isQuestExpired ( quest ) ;
}
if ( ! isQuestExpiredResult ) {
tmpResult = tmp ( tmp2 [ 15 ] ) ;
const items = [ tmp30 ] ;
tmpResult . markAdContentSeen ( tmp ( tmp2 [ 9 ] ) . AdCreativeType . QUEST , items ) ;
}
}
const adCreativeType2 = obj1 . entity . adCreativeType ;
const QUEST2 = tmp ( tmp2 [ 9 ] ) . AdCreativeType . QUEST ;
obj = { adCreativeType : null , adCreativeId : null } ;
obj [ 0 ] = obj1 . entity . adCreativeType ;
obj [ 1 ] = obj1 . entity . adContentIds [ arg1 ] ;
const tmpResult1 = tmp ( tmp2 [ 16 ] ) ;
const result = tmp ( tmp2 [ 8 ] ) . isBillableQuestContent ( obj1 . questContent ) ;
const AdUserActionType = tmp ( tmp2 [ 17 ] ) . AdUserActionType ;
obj = { type : null , surfaceId : null , sourceQuestContent : null , impressionId : null , triggeredByStatusChange : null , minViewTimeSeconds : null , minViewportPercentage : null , isQuestEnrollmentBlocked : null , shouldExtendSession : null , adUser : null , questContentPosition : null , questContentRowIndex : null , trackGuildAndChannelMetadata : null } ;
obj [ 0 ] = result ? AdUserActionType.VIEW_EXTERNAL_PAID_AD_PLACEMENT_IMPRESSION : AdUserActionType.VIEW_INTERNAL_SURFACE_IMPRESSION ;
( { questContent : obj19 [ 1 ] , sourceQuestContent : obj19 [ 2 ] , id : obj19 [ 3 ] , triggeredByStatusChange : obj19 [ 4 ] , minViewTimeSeconds : obj19 [ 5 ] , minViewportPercentage : obj19 [ 6 ] , isQuestEnrollmentBlocked : obj19 [ 7 ] } = obj1 ) ;
obj [ 8 ] = shouldExtendSessionResult ;
obj [ 9 ] = closure_0 ;
( { questContentPosition : obj19 [ 10 ] , questContentRowIndex : obj19 [ 11 ] , trackGuildAndChannelMetadata : obj19 [ 12 ] } = obj1 ) ;
const merged = Object . assign ( obj ) ;
tmpResult1 . captureAdUserAction ( obj ) ;
const tmpResult2 = tmp ( tmp2 [ 8 ] ) ;
const questLogger = tmp ( tmp2 [ 18 ] ) . getQuestLogger ( ) ;
const tmpResult3 = tmp ( tmp2 [ 18 ] ) ;
const _HermesInternal2 = HermesInternal ;
obj1 = { impressionId : null } ;
obj1 [ 0 ] = obj1 . id ;
questLogger . info ( "" + adCreativeId + " ad content viewed for at least " + obj1 . minViewTimeSeconds + "s at " + tmp ( tmp2 [ 11 ] ) . getQuestContentName ( obj1 . questContent ) , obj1 ) ;
} else if ( adCreativeType === QUEST ) {
2026-08-24 06:08:38 +00:00
const quest1 = closure_2_5 . getQuest ( tmp6 ) ;
2026-07-29 08:29:29 +00:00
let isQuestExpiredResult1 = null == quest1 ;
if ( ! isQuestExpiredResult1 ) {
isQuestExpiredResult1 = tmp ( tmp2 [ 8 ] ) . isQuestExpired ( quest1 ) ;
const tmpResult5 = tmp ( tmp2 [ 8 ] ) ;
}
if ( ! isQuestExpiredResult1 ) {
const items1 = [ tmp6 ] ;
tmp ( tmp2 [ 15 ] ) . markAdContentSeen ( tmp ( tmp2 [ 9 ] ) . AdCreativeType . QUEST , items1 ) ;
const tmpResult6 = tmp ( tmp2 [ 15 ] ) ;
}
const questLogger1 = tmp ( tmp2 [ 18 ] ) . getQuestLogger ( ) ;
let questName ;
if ( quest1 != null ) {
questName = quest1 . config . messages . questName ;
}
if ( questName == null ) {
questName = tmp6 ;
}
const tmpResult7 = tmp ( tmp2 [ 18 ] ) ;
const _HermesInternal = HermesInternal ;
const obj2 = { impressionId : null } ;
obj2 [ 0 ] = obj1 . id ;
questLogger1 . info ( "" + questName + " Quest viewed for at least " + obj1 . minViewTimeSeconds + "s at " + tmp ( tmp2 [ 11 ] ) . getQuestContentName ( obj1 . questContent ) , obj2 ) ;
const tmpResult8 = tmp ( tmp2 [ 11 ] ) ;
2026-08-24 06:08:38 +00:00
obj3 = { } ;
2026-07-29 08:29:29 +00:00
const merged1 = Object . assign ( obj3 ) ;
obj3 . shouldExtendSession = shouldExtendSessionResult ;
obj3 . questId = obj1 . entity . adContentIds [ arg1 ] ;
2026-08-24 06:08:38 +00:00
obj3 . event = closure_2_9 . QUEST_CONTENT_VIEWED ;
2026-07-29 08:29:29 +00:00
obj4 = { } ;
const merged2 = Object . assign ( obj4 ) ;
const merged3 = Object . assign ( obj1 . commonProperties ( ) ) ;
if ( adMetadataSealed == null ) {
adMetadataSealed = null ;
}
obj4 . metadata_sealed = adMetadataSealed ;
const tmpResult9 = tmp ( tmp2 [ 19 ] ) ;
const currentQuestHomeSearchSession = tmp ( tmp2 [ 20 ] ) . getCurrentQuestHomeSearchSession ( ) ;
let uuid ;
if ( currentQuestHomeSearchSession != null ) {
uuid = currentQuestHomeSearchSession . uuid ;
}
if ( uuid == null ) {
uuid = null ;
}
obj4 . search_session_id = uuid ;
const tmpResult10 = tmp ( tmp2 [ 20 ] ) ;
let id ;
if ( quest1 != null ) {
id = quest1 . id ;
}
let adTrafficMetadataSealed = tmp ( tmp2 [ 8 ] ) . getAdTrafficMetadataSealed ( obj1 . sourceQuestContent , id ) ;
if ( adTrafficMetadataSealed == null ) {
adTrafficMetadataSealed = null ;
}
obj4 . traffic_metadata_sealed = adTrafficMetadataSealed ;
obj3 . properties = obj4 ;
tmpResult9 . trackQuestEvent ( obj3 ) ;
const tmpResult11 = tmp ( tmp2 [ 8 ] ) ;
} else {
const questLogger2 = tmp ( tmp2 [ 18 ] ) . getQuestLogger ( ) ;
const tmpResult12 = tmp ( tmp2 [ 18 ] ) ;
const _HermesInternal3 = HermesInternal ;
const obj5 = { impressionId : null } ;
obj5 [ 0 ] = obj1 . id ;
questLogger2 . info ( "" + obj1 . entity . adContentIds [ arg1 ] + " ad content viewed for at least " + obj1 . minViewTimeSeconds + "s at " + tmp ( tmp2 [ 11 ] ) . getQuestContentName ( obj1 . questContent ) , obj5 ) ;
const tmpResult13 = tmp ( tmp2 [ 11 ] ) ;
const obj6 = { } ;
const merged4 = Object . assign ( obj3 ) ;
obj6 . shouldExtendSession = shouldExtendSessionResult ;
obj6 . adContentId = obj1 . entity . adContentIds [ arg1 ] ;
obj6 . adCreativeType = obj1 . entity . adCreativeType ;
2026-08-24 06:08:38 +00:00
obj6 . event = closure_2_9 . QUEST_CONTENT_VIEWED ;
2026-07-29 08:29:29 +00:00
const obj7 = { } ;
const merged5 = Object . assign ( obj4 ) ;
const merged6 = Object . assign ( obj1 . commonProperties ( ) ) ;
obj6 . properties = obj7 ;
tmp ( tmp2 [ 19 ] ) . trackAdContentEvent ( obj6 ) ;
const tmpResult14 = tmp ( tmp2 [ 19 ] ) ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
} ) ;
2026-08-24 06:08:38 +00:00
if ( closure_1_0 . onImpressionCallback != null ) {
2026-07-29 08:29:29 +00:00
onImpressionCallback ( ) ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
c3 = 3 ;
2026-08-24 06:08:38 +00:00
return { value : "HermesInternal" , done : null } ;
2026-07-29 08:29:29 +00:00
}
} catch ( tmp34 ) {
c3 = tmp ;
throw tmp34 ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
}
} ) ;
obj . beat = function beat ( arg0 ) {
let flag = arg0 ;
if ( arg0 === undefined ) {
flag = false ;
}
let rounded ;
2026-08-24 06:08:38 +00:00
obj = undefined ;
2026-07-29 08:29:29 +00:00
obj = undefined ;
if ( null != flag . lastBeatTime ) {
const _Math = Math ;
const _Date = Date ;
rounded = Math . round ( Date . now ( ) - tmp . lastBeatTime ) ;
obj = { trackGuildAndChannelMetadata : null , sourceQuestContent : null } ;
( { trackGuildAndChannelMetadata : obj [ 0 ] , sourceQuestContent : obj [ 1 ] } = tmp ) ;
obj = { is_termination_beat : null , viewed_time_ms : null , triggered_by_status_change : null } ;
obj [ 0 ] = flag ;
obj [ 1 ] = rounded ;
obj [ 2 ] = tmp . triggeredByStatusChange ;
const adContentIds = tmp . entity . adContentIds ;
const item = adContentIds . forEach ( ( arg0 , arg1 ) = > {
2026-08-24 06:08:38 +00:00
obj = flag ;
if ( flag . entity . adCreativeType === obj ( closure_2_2 [ 9 ] ) . AdCreativeType . QUEST ) {
const quest = closure_2_5 . getQuest ( tmp18 ) ;
2026-07-29 08:29:29 +00:00
let tmpResult = tmp ( tmp2 [ 18 ] ) ;
const questLogger = tmpResult . getQuestLogger ( ) ;
2026-07-20 16:05:17 +00:00
let questName ;
2026-07-29 08:29:29 +00:00
if ( quest != null ) {
2026-07-20 16:05:17 +00:00
questName = quest . config . messages . questName ;
}
2026-07-29 08:29:29 +00:00
if ( questName == null ) {
questName = tmp18 ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
let str7 = "" ;
if ( flag ) {
str7 = "terminal " ;
2026-07-20 16:05:17 +00:00
}
const _HermesInternal2 = HermesInternal ;
2026-07-29 08:29:29 +00:00
obj = { impressionId : null } ;
obj [ 0 ] = obj . id ;
questLogger . info ( "" + questName + " Quest impression " + str7 + "heartbeat: " + rounded + "ms since last heartbeat" , obj ) ;
tmpResult = tmp ( tmp2 [ 19 ] ) ;
obj = { } ;
const merged = Object . assign ( obj ) ;
obj . questId = obj . entity . adContentIds [ arg1 ] ;
2026-08-24 06:08:38 +00:00
obj . event = closure_2_9 . QUEST_CONTENT_VIEW_TIME ;
obj1 = { } ;
2026-07-29 08:29:29 +00:00
const merged1 = Object . assign ( obj ) ;
const merged2 = Object . assign ( obj . commonProperties ( ) ) ;
obj . properties = obj1 ;
tmpResult . trackQuestEvent ( obj ) ;
} else {
const questLogger1 = tmp ( tmp2 [ 18 ] ) . getQuestLogger ( ) ;
let str = "" ;
if ( flag ) {
str = "terminal " ;
}
const _HermesInternal = HermesInternal ;
const obj2 = { impressionId : null } ;
obj2 [ 0 ] = obj . id ;
questLogger1 . info ( "" + obj . entity . adContentIds [ arg1 ] + " ad content impression " + str + "heartbeat: " + rounded + "ms since last heartbeat" , obj2 ) ;
const tmpResult1 = tmp ( tmp2 [ 18 ] ) ;
const obj3 = { } ;
const merged3 = Object . assign ( obj ) ;
obj3 . adContentId = obj . entity . adContentIds [ arg1 ] ;
obj3 . adCreativeType = obj . entity . adCreativeType ;
2026-08-24 06:08:38 +00:00
obj3 . event = closure_2_9 . QUEST_CONTENT_VIEW_TIME ;
2026-07-29 08:29:29 +00:00
const obj4 = { } ;
const merged4 = Object . assign ( obj ) ;
const merged5 = Object . assign ( obj . commonProperties ( ) ) ;
obj3 . properties = obj4 ;
tmp ( tmp2 [ 19 ] ) . trackAdContentEvent ( obj3 ) ;
const tmpResult2 = tmp ( tmp2 [ 19 ] ) ;
2026-07-20 16:05:17 +00:00
}
} ) ;
2026-07-29 08:29:29 +00:00
}
flag . lastBeatTime = Date . now ( ) ;
} ;
obj . commonProperties = function commonProperties() {
obj = { impression_id : obj.id , is_quest_enrollment_blocked : obj.isQuestEnrollmentBlocked } ;
2026-08-24 06:08:38 +00:00
const merged = Object . assign ( obj ( closure_1_2 [ 11 ] ) . getContentProperties ( obj . questContent , obj . questContentPosition , obj . questContentRowIndex ) ) ;
2026-07-29 08:29:29 +00:00
return obj ;
} ;
obj . clone = function clone ( triggeredByStatusChange ) {
obj . stop ( ) ;
obj = { questContent : obj.questContent , questContentRowIndex : obj.questContentRowIndex , questContentPosition : obj.questContentPosition , trackGuildAndChannelMetadata : obj.trackGuildAndChannelMetadata , triggeredByStatusChange : triggeredByStatusChange.triggeredByStatusChange , isQuestEnrollmentBlocked : obj.isQuestEnrollmentBlocked , onImpression : obj.onImpressionCallback , sourceQuestContent : obj.sourceQuestContent } ;
const merged = Object . assign ( obj . entity ) ;
2026-08-24 06:08:38 +00:00
return new closure_1_14 ( obj ) ;
2026-07-29 08:29:29 +00:00
} ;
obj . start = function start() {
obj . stop ( false ) ;
obj . lastBeatTime = Date . now ( ) ;
2026-08-24 06:08:38 +00:00
obj . heartbeatTimeoutId = window . setInterval ( ( ) = > closure_0 . beat ( ) , 1000 * closure_1_6 ) ;
2026-07-29 08:29:29 +00:00
obj . minViewTimeReachedTimeoutId = window . setTimeout ( obj . onMinViewTimeReached , 1000 * obj . minViewTimeSeconds ) ;
obj = { trackGuildAndChannelMetadata : obj.trackGuildAndChannelMetadata , sourceQuestContent : obj.sourceQuestContent } ;
2026-08-24 06:08:38 +00:00
closure_1 = { triggered_by_status_change : obj.triggeredByStatusChange } ;
2026-07-29 08:29:29 +00:00
const adContentIds = obj . entity . adContentIds ;
const item = adContentIds . forEach ( ( adCreativeId ) = > {
2026-08-24 06:08:38 +00:00
obj = obj ( closure_2_2 [ 8 ] ) ;
obj1 = closure_0 ;
2026-07-29 08:29:29 +00:00
let adMetadataSealed = obj . getAdMetadataSealed ( closure_0 . sourceQuestContent , adCreativeId ) ;
if ( closure_0 . migrateQuestContentLoadedToCaptureAdUserAction ) {
obj = { adCreativeType : null , adCreativeId : null } ;
obj [ 0 ] = obj1 . entity . adCreativeType ;
obj [ 1 ] = obj1 . entity . adContentIds [ arg1 ] ;
let tmpResult = tmp ( tmp2 [ 16 ] ) ;
obj = { type : null , surfaceId : null , sourceQuestContent : null , impressionId : null , triggeredByStatusChange : null , trackGuildAndChannelMetadata : null , questContentPosition : null , questContentRowIndex : null } ;
obj [ 0 ] = tmp ( tmp2 [ 17 ] ) . AdUserActionType . END_CONTENT_LOAD ;
( { questContent : obj13 [ 1 ] , sourceQuestContent : obj13 [ 2 ] , id : obj13 [ 3 ] , triggeredByStatusChange : obj13 [ 4 ] , trackGuildAndChannelMetadata : obj13 [ 5 ] , questContentPosition : obj13 [ 6 ] , questContentRowIndex : obj13 [ 7 ] } = obj1 ) ;
const merged = Object . assign ( obj ) ;
tmpResult . captureAdUserAction ( obj ) ;
} else if ( closure_0 . entity . adCreativeType === tmp4 ) {
2026-08-24 06:08:38 +00:00
const quest = closure_2_5 . getQuest ( tmp5 ) ;
2026-07-29 08:29:29 +00:00
tmpResult = tmp ( tmp2 [ 18 ] ) ;
const questLogger = tmpResult . getQuestLogger ( ) ;
let questName ;
if ( quest != null ) {
questName = quest . config . messages . questName ;
}
if ( questName == null ) {
questName = tmp5 ;
}
const _HermesInternal = HermesInternal ;
obj1 = { impressionId : null } ;
obj1 [ 0 ] = obj1 . id ;
questLogger . info ( "" + questName + " Quest became visible at " + tmp ( tmp2 [ 11 ] ) . getQuestContentName ( obj1 . questContent ) , obj1 ) ;
const tmpResult1 = tmp ( tmp2 [ 11 ] ) ;
const obj2 = { } ;
const merged1 = Object . assign ( closure_0 ) ;
obj2 . questId = obj1 . entity . adContentIds [ arg1 ] ;
2026-08-24 06:08:38 +00:00
obj2 . event = closure_2_9 . QUEST_CONTENT_LOADED ;
2026-07-29 08:29:29 +00:00
const obj3 = { } ;
const merged2 = Object . assign ( closure_1 ) ;
if ( adMetadataSealed == null ) {
adMetadataSealed = null ;
}
obj3 . metadata_sealed = adMetadataSealed ;
const merged3 = Object . assign ( obj1 . commonProperties ( ) ) ;
const tmpResult2 = tmp ( tmp2 [ 19 ] ) ;
let id ;
if ( quest != null ) {
id = quest . id ;
}
let adTrafficMetadataSealed = tmp ( tmp2 [ 8 ] ) . getAdTrafficMetadataSealed ( obj1 . sourceQuestContent , id ) ;
if ( adTrafficMetadataSealed == null ) {
adTrafficMetadataSealed = null ;
}
obj3 . traffic_metadata_sealed = adTrafficMetadataSealed ;
obj2 . properties = obj3 ;
tmpResult2 . trackQuestEvent ( obj2 ) ;
const tmpResult3 = tmp ( tmp2 [ 8 ] ) ;
} else {
const questLogger1 = tmp ( tmp2 [ 18 ] ) . getQuestLogger ( ) ;
const tmpResult4 = tmp ( tmp2 [ 18 ] ) ;
const _HermesInternal2 = HermesInternal ;
const obj4 = { impressionId : null } ;
obj4 [ 0 ] = obj1 . id ;
questLogger1 . info ( "" + obj1 . entity . adContentIds [ arg1 ] + " ad content became visible at " + tmp ( tmp2 [ 11 ] ) . getQuestContentName ( obj1 . questContent ) , obj4 ) ;
const tmpResult5 = tmp ( tmp2 [ 11 ] ) ;
const obj5 = { } ;
const merged4 = Object . assign ( closure_0 ) ;
obj5 . adContentId = obj1 . entity . adContentIds [ arg1 ] ;
obj5 . adCreativeType = obj1 . entity . adCreativeType ;
2026-08-24 06:08:38 +00:00
obj5 . event = closure_2_9 . QUEST_CONTENT_LOADED ;
2026-07-29 08:29:29 +00:00
const obj6 = { } ;
const merged5 = Object . assign ( closure_1 ) ;
const merged6 = Object . assign ( obj1 . commonProperties ( ) ) ;
obj5 . properties = obj6 ;
tmp ( tmp2 [ 19 ] ) . trackAdContentEvent ( obj5 ) ;
const tmpResult6 = tmp ( tmp2 [ 19 ] ) ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
} ) ;
2026-08-24 06:08:38 +00:00
obj = closure_1_1 ( closure_1_2 [ 21 ] ) ;
obj = { name : obj ( closure_1_2 [ 22 ] ) . MetricEvents . QUEST_CONTENT_IMPRESSION , tags : null } ;
const items = [ "quest_content:" + obj ( closure_1_2 [ 11 ] ) . getQuestContentName ( obj . questContent ) ] ;
2026-07-29 08:29:29 +00:00
obj [ 1 ] = items ;
obj . increment ( obj ) ;
obj . isRunning = true ;
} ;
obj . stop = function stop() {
let flag = arg0 ;
if ( arg0 === undefined ) {
flag = true ;
}
if ( flag ) {
obj . beat ( true ) ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj . lastBeatTime = undefined ;
clearInterval ( obj . heartbeatTimeoutId ) ;
clearTimeout ( obj . minViewTimeReachedTimeoutId ) ;
obj . isRunning = false ;
} ;
( { questContent , minViewTimeSeconds , adContentIds , adCreativeType , triggeredByStatusChange , trackGuildAndChannelMetadata , questContentPosition , questContentRowIndex } = global ) ;
if ( undefined === minViewTimeSeconds ) {
2026-08-24 06:08:38 +00:00
minViewTimeSeconds = closure_7 ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
( { isQuestEnrollmentBlocked , onImpression , sourceQuestContent } = global ) ;
tmp2 = closure_0 ;
tmp3 = closure_2 ;
obj = require ( "v1" ) ;
obj . id = obj . v4 ( ) ;
obj . questContent = questContent ;
obj . questContentPosition = questContentPosition ;
obj . minViewTimeSeconds = minViewTimeSeconds ;
obj . minViewportPercentage = closure_8 ;
obj . trackGuildAndChannelMetadata = trackGuildAndChannelMetadata ;
obj . triggeredByStatusChange = triggeredByStatusChange ;
obj . questContentRowIndex = questContentRowIndex ;
obj . isQuestEnrollmentBlocked = isQuestEnrollmentBlocked ;
obj . onImpressionCallback = onImpression ;
obj . sourceQuestContent = sourceQuestContent ;
obj2 = require ( "apexExperiment" ) ;
obj . migrateQuestContentLoadedToCaptureAdUserAction = obj2 . shouldMigrateToAdAnalyticsInterface ( require ( "apexExperiment" ) . AdAnalyticsInterfaceExperimentStep . STEP_1_LOADED , "quest_content_impression" ) ;
obj3 = require ( "apexExperiment" ) ;
obj4 = require ( "getQuestDeliveryDataForPlacement" ) ;
result = obj4 . isBillableQuestContent ( questContent ) ;
AdAnalyticsInterfaceExperimentStep = require ( "apexExperiment" ) . AdAnalyticsInterfaceExperimentStep ;
obj . migrateQuestContentViewedToCaptureAdUserAction = obj3 . shouldMigrateToAdAnalyticsInterface ( result ? AdAnalyticsInterfaceExperimentStep.STEP_5_VIEWED_IMPRESSION : AdAnalyticsInterfaceExperimentStep.STEP_4_VIEWED_NON_IMPRESSION , "quest_content_impression" ) ;
QUEST = require ( "AdCreativeType" ) . AdCreativeType . QUEST ;
obj . entity = { adContentIds , adCreativeType } ;
return obj ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
}
const prototype = QuestContentImpression . prototype ;
prototype [ "getId" ] = function getId() {
return this . id ;
} ;
prototype [ "getQuestContentPosition" ] = function getQuestContentPosition() {
return this . questContentPosition ;
} ;
2026-07-20 16:05:17 +00:00
const context = importAllResult . createContext ( undefined ) ;
2026-07-23 10:11:24 +00:00
let result = set . fileFinishedImporting ( "modules/quests/lib/analytics/ContentImpressionTracker.tsx" ) ;
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
export { QuestContentImpression } ;
2026-07-20 16:05:17 +00:00
export const QuestImpressionContext = context ;
export const QuestContentImpressionTracker = function QuestContentImpressionTracker ( visible ) {
2026-07-23 10:11:24 +00:00
const _require = visible ;
2026-07-20 16:05:17 +00:00
visible = visible . visible ;
const visibleChanged = visible . visibleChanged ;
const focused = visible . focused ;
const focusedChanged = visible . focusedChanged ;
const sourceQuestContent = visible . sourceQuestContent ;
2026-07-29 08:29:29 +00:00
let obj = _require ( visibleChanged [ 23 ] ) ;
2026-07-20 16:05:17 +00:00
const questStatusChanged = obj . useQuestStatusChanged ( visible ) ;
2026-07-29 08:29:29 +00:00
const ref = focusedChanged . useRef ( null ) ;
const items = [ sourceQuestContent ] ;
const stateFromStores = _require ( visibleChanged [ 24 ] ) . useStateFromStores ( items , ( ) = > null != sourceQuestContent . questEnrollmentBlockedUntil , [ ] ) ;
visible ( visibleChanged [ 25 ] ) ( ( ) = > ( ) = > {
if ( null != ref . current ) {
const current = ref . current ;
2026-07-20 16:05:17 +00:00
current . stop ( ) ;
}
} ) ;
const items1 = [ focused , visible , focusedChanged , visibleChanged , , , , , , , , , , , ] ;
( { adContentIds : arr2 [ 4 ] , onImpression : arr2 [ 5 ] , questContent : arr2 [ 6 ] , questContentPosition : arr2 [ 7 ] , questContentRowIndex : arr2 [ 8 ] , trackGuildAndChannelMetadata : arr2 [ 9 ] } = visible ) ;
items1 [ 10 ] = questStatusChanged ;
items1 [ 11 ] = visible . minViewTimeSeconds ;
items1 [ 12 ] = stateFromStores ;
items1 [ 13 ] = sourceQuestContent ;
items1 [ 14 ] = visible . adCreativeType ;
2026-07-29 08:29:29 +00:00
const effect = focusedChanged . useEffect ( ( ) = > {
2026-07-20 16:05:17 +00:00
let tmp = focused ;
if ( focused ) {
tmp = visible ;
}
let tmp2 = visibleChanged ;
2026-07-29 08:29:29 +00:00
let tmp3 = visibleChanged ;
2026-07-20 16:05:17 +00:00
if ( ! visibleChanged ) {
2026-07-29 08:29:29 +00:00
tmp3 = focusedChanged ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if ( ! tmp3 ) {
tmp3 = questStatusChanged ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if ( tmp3 ) {
tmp3 = tmp ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
let tmp4 = tmp3 ;
if ( ! tmp3 ) {
if ( ! tmp2 ) {
tmp2 = focusedChanged ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if ( tmp2 ) {
tmp2 = ! tmp ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
tmp4 = tmp2 ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if ( ! tmp4 ) {
tmp4 = questStatusChanged ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if ( tmp4 ) {
tmp4 = null != ref . current ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if ( tmp4 ) {
2026-07-20 16:05:17 +00:00
const current = ref . current ;
current . stop ( ) ;
}
2026-07-29 08:29:29 +00:00
if ( tmp3 ) {
let obj = { isQuestEnrollmentBlocked : null , minViewTimeSeconds : null , onImpression : null , questContent : null , questContentPosition : null , questContentRowIndex : null , sourceQuestContent : null , trackGuildAndChannelMetadata : null , triggeredByStatusChange : null } ;
obj [ 0 ] = stateFromStores ;
( { minViewTimeSeconds : obj [ 1 ] , onImpression : obj [ 2 ] , questContent : obj [ 3 ] , questContentPosition : obj [ 4 ] , questContentRowIndex : obj [ 5 ] } = visible ) ;
obj [ 6 ] = sourceQuestContent ;
obj [ 7 ] = visible . trackGuildAndChannelMetadata ;
obj [ 8 ] = questStatusChanged ;
2026-07-23 10:11:24 +00:00
const adCreativeType = visible . adCreativeType ;
2026-07-29 08:29:29 +00:00
const QUEST = visible ( visibleChanged [ 9 ] ) . AdCreativeType . QUEST ;
2026-07-20 16:05:17 +00:00
obj = { } ;
const merged = Object . assign ( obj ) ;
2026-07-29 08:29:29 +00:00
( { adContentIds : obj2.adContentIds , adCreativeType : obj2.adCreativeType } = visible ) ;
2026-08-24 06:08:38 +00:00
ref . current = new closure_1_12 ( obj ) ;
2026-07-20 16:05:17 +00:00
const current2 = ref . current ;
current2 . start ( ) ;
}
} , items1 ) ;
obj = { value : ref , children : visible.children ( visible . reference , ref ) } ;
2026-07-23 10:11:24 +00:00
return < context.Provider value = { ref } > { arg0 . children ( arg0 . reference , ref ) } < / context.Provider > ;
2026-07-20 16:05:17 +00:00
} ;