/* Metro module 13536; source: modules/quests/native/BountiesModal/useBountiesModalVideoAnalytics.tsx; dependencies: [31, 661, 9513, 491, 7110, 7121, 9522, 13523, 2] */ import * as FileImportTrackerModule from '../../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */ import * as ReactModule from '../../../../by-id/module-00031-React.js'; /* Metro dependency 31 */ import * as Module00491Module from '../../../../by-id/module-00491.js'; /* Metro dependency 491 */ import * as ConstantsModule from '../../../../Constants.tsx'; /* Metro dependency 661 */ import * as AnalyticsActionsModule from '../../lib/analytics/AnalyticsActions.tsx'; /* Metro dependency 7110 */ import * as AdCreativeTypeModule from '../../../../external/discord_common/js/shared/shared-constants/AdCreativeType.tsx'; /* Metro dependency 7121 */ import * as ContentImpressionTrackerHooksModule from '../../lib/analytics/ContentImpressionTrackerHooks.tsx'; /* Metro dependency 9513 */ import * as AdVideoPlayerModule from '../AdVideoPlayer.tsx'; /* Metro dependency 13523 */ function _fun102867(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#102867, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13726:6, offset: 0x0224c056, size: 172 bytes, params: 8, frame: 18 const env0_0 = require; const _arrayLikeToArray_102870 = function(a0, a1) { var r0; var r1; var r2; var value3; var length; var value5; var value = undefined; var value2 = value == null; reducibleJoin2: while (true) { if (value2) { r0 = value2; break reducibleJoin2; } value3 = value > a0.length; r0 = value3; break reducibleJoin2; } reducibleJoin4: while (true) { if (r0) { length = a0.length; r1 = length; break reducibleJoin4; } r1 = value; break reducibleJoin4; } value = (0, global.Array)(r1); var value4 = 0; if (value4 < r1) { r2 = value4; reducibleLoop5: while (true) { value[r2] = a0[r2]; value5 = typeof r2 === 'bigint' ? r2 + 1n : +r2 + 1; if (value5 < r1) { r2 = value5; continue reducibleLoop5; } break reducibleLoop5; } } return value; }; const Object = global.Object; Object.defineProperty(exports, '__esModule', {value: true}); const env0_4 = [25, 50, 75]; (FileImportTrackerModule).fileFinishedImporting('modules/quests/native/BountiesModal/useBountiesModalVideoAnalytics.tsx'); exports.useBountiesModalVideoAnalytics = useBountiesModalVideoAnalytics; function _createForOfIteratorHelperLoose_102868(a0, a1) { // fn#102868, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13726:137, offset: 0x0224c102, size: 372 bytes, params: 3, frame: 20 var r6; var r9; var r5; var value3; var regexp; const env0_0 = a0; const Symbol = global.Symbol; let value = typeof Symbol !== 'undefined'; let r1 = value && a0[global.Symbol.iterator]; r1 = !r1 ? a0['@@iterator'] : r1; if (r1) { value = r1.call(a0); return value.next.bind(value); } const Array = global.Array; if (Array.isArray(a0)) { if (r1) { } return _fun102869; } value = undefined; if (a0) { if (typeof a0 === 'string') { value = _arrayLikeToArray_102870(a0, value); r5 = value; } else { value3 = ({}).toString.call(a0).slice(8, -1); r6 = value3 === 'Object' && a0.constructor; r9 = r6 ? a0.constructor.name : value3; if (r9 === 'Map') { r6 = global.Array.from(a0); } else if (r9 === 'Set') { r6 = global.Array.from(a0); } else if (r9 === 'Arguments') { value = _arrayLikeToArray_102870(a0, value); r6 = value; } else { regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', ''); if (regexp.test(r9)) { value = _arrayLikeToArray_102870(a0, value); r6 = value; } else { r6 = value; } } r5 = r6; } } else { r5 = value; } if (r5) { if (r5) { } return _fun102869; } const TypeError = global.TypeError; throw new TypeError('Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.'); function _fun102869() { // fn#102869, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13726:708, offset: 0x00c39d73, size: 69 bytes, params: 1, frame: 5 return env0_1 >= env0_0.length ? {done: true} : {done: false, value: env0_0[typeof env0_1 === 'bigint' ? env0_1 : +env0_1]}; } } function useBountiesModalVideoAnalytics({bountyId, sourceQuestContent, rewardDurationMs}) { // fn#102871, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13726:1203, offset: 0x0224c276, size: 551 bytes, params: 2, frame: 24 const rewardDurationMs2 = rewardDurationMs; const value2 = (ContentImpressionTrackerHooksModule).useQuestImpressionId(); const binding = rewardDurationMs2; const value = binding.useMemo(_fun102872, []); const useRef = binding.useRef; const Set = global.Set; const value3 = Object.create(Set.prototype, {constructor: {value: Set}}); const set = new Set(); const env0_5 = Reflect.apply(useRef, binding, [set instanceof Object ? set : value3]); const value5 = binding.useCallback(_fun102873, [bountyId, value, value2, sourceQuestContent, rewardDurationMs]); const value6 = binding.useCallback(_fun102874, [value5]); const value7 = binding.useCallback(_fun102875, [value5, rewardDurationMs]); const value8 = binding.useCallback(_fun102876, [value5]); const value9 = binding.useCallback(_fun102877, [value5, rewardDurationMs]); object = {}; object.handleVideoProgressAnalytics = binding.useCallback(_fun102878, [value6, value7, value9, rewardDurationMs]); object.handleVideoEndAnalytics = binding.useCallback(_fun102879, [value6, value7, value9, value8]); object.handleVideoLoopedAnalytics = binding.useCallback(_fun102880, [bountyId, value, value2, sourceQuestContent, rewardDurationMs]); object.handleVideoPausedAnalytics = binding.useCallback(_fun102881, [bountyId, value, value2, sourceQuestContent, rewardDurationMs]); object.handleVideoResumedAnalytics = binding.useCallback(_fun102882, [bountyId, value, value2, sourceQuestContent, rewardDurationMs]); return object; function _fun102872() { // fn#102872, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13726:1348, offset: 0x0224c49d, size: 37 bytes, params: 1, frame: 11 const value = environment.__proto__; return (Module00491Module).v4(); } function _fun102873({videoTimestampSeconds, progress, thresholdMet}) { // fn#102873, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13726:1408, offset: 0x0224c4c2, size: 185 bytes, params: 2, frame: 20 const trackAdContentEvent = AnalyticsActionsModule.trackAdContentEvent; const object = {}; object.adContentId = bountyId; const AdCreativeType = (AdCreativeTypeModule).AdCreativeType; const BOUNTY = AdCreativeType.BOUNTY; object.adCreativeType = BOUNTY; const AD_VIDEO_PROGRESSED = AnalyticEvents.AD_VIDEO_PROGRESSED; object.event = AD_VIDEO_PROGRESSED; object.properties = {progress: progress, video_timestamp_seconds: videoTimestampSeconds, video_session_id: env0_4, impression_id: ConstantsModule.AnalyticEvents, threshold_met: thresholdMet, reward_timer_seconds: rewardDurationMs / 1000}; object.sourceQuestContent = sourceQuestContent; Reflect.apply(trackAdContentEvent, AnalyticsActionsModule, [object]); } function _fun102874() { // fn#102874, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13726:1765, offset: 0x0224c57b, size: 77 bytes, params: 1, frame: 12 const current = env0_5.current; if (!current.has('start')) { env0_5.current.add('start'); env0_6({'videoTimestampSeconds': 0, 'progress': 0, 'thresholdMet': false}); } } function _fun102875(a0, a1) { // fn#102875, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13726:1899, offset: 0x0224c5c8, size: 159 bytes, params: 3, frame: 15 var Math; var value2; var value3; const current = env0_5.current; if (!current.has('threshold')) { env0_5.current.add('threshold'); Math = global.Math; value2 = Math.max(rewardDurationMs / 1000, a0); value3 = environment.__proto__; env0_6({videoTimestampSeconds: value2, progress: (require(9522) /* metro dependency 9522: VideoQuestUtils */).formatVideoProgressRatio(value2, a1), thresholdMet: true}); } } function _fun102876(a0, a1) { // fn#102876, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13726:2114, offset: 0x0224c667, size: 108 bytes, params: 3, frame: 14 const current = env0_5.current; if (!current.has('end')) { env0_5.current.add('end'); env0_6({'videoTimestampSeconds': null, 'progress': 1, 'thresholdMet': true, videoTimestampSeconds: global.Math.max(a0, a1)}); } } function _fun102877(a0, a1) { // fn#102877, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13726:2270, offset: 0x0224c6d3, size: 225 bytes, params: 3, frame: 23 var r1; var value; var value2; var value3; var done; var value5; var value6; var current; var has; var binding; var value7; var value8; if (!(a1 <= 0)) { value = environment.__proto__; value2 = (require(9522) /* metro dependency 9522: VideoQuestUtils */).formatVideoProgressRatio(a0, a1); value = _createForOfIteratorHelperLoose_102868(env1_4); value3 = value(); done = value3.done; if (!done) { r1 = value3; while (true) { value5 = r1.value; value6 = 'p' + value5; current = env0_5.current; has = current.has; if (!Reflect.apply(has, current, [value6])) { if (value2 < value5 / 100) { break; } current = env0_5.current; current.add(value6); binding = env0_6; value7 = 1000 * a0; binding({videoTimestampSeconds: a0, progress: value2, thresholdMet: value7 >= rewardDurationMs}); break; } value8 = value(); done = value8.done; if (done) { break; } r1 = value8; continue; } } } } function _fun102878(a0, a1) { // fn#102878, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13726:2588, offset: 0x0224c7b4, size: 59 bytes, params: 3, frame: 15 env0_7(); if (1000 * a0 >= rewardDurationMs) { env0_8(a0, a1); } env0_10(a0, a1); } function _fun102879(a0, a1) { // fn#102879, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13726:2676, offset: 0x0224c7ef, size: 51 bytes, params: 3, frame: 14 env0_7(); env0_8(a0, a1); env0_10(a0, a1); env0_9(a0, a1); } function _fun102880(a0) { // fn#102880, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13726:2764, offset: 0x0224c822, size: 159 bytes, params: 2, frame: 17 const trackAdContentEvent = AnalyticsActionsModule.trackAdContentEvent; const object = {}; object.adContentId = bountyId; const AdCreativeType = (AdCreativeTypeModule).AdCreativeType; const BOUNTY = AdCreativeType.BOUNTY; object.adCreativeType = BOUNTY; const AD_VIDEO_LOOPED = AnalyticEvents.AD_VIDEO_LOOPED; object.event = AD_VIDEO_LOOPED; object.properties = {video_session_id: env0_4, impression_id: ConstantsModule.AnalyticEvents, loop_count: a0, reward_timer_seconds: rewardDurationMs / 1000}; object.sourceQuestContent = sourceQuestContent; Reflect.apply(trackAdContentEvent, AnalyticsActionsModule, [object]); } function _fun102881(a0, a1) { // fn#102881, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13726:3050, offset: 0x0224c8c1, size: 199 bytes, params: 3, frame: 17 var moduleValue; var trackAdContentEvent; var object; const PlaybackTriggerSource = (AdVideoPlayerModule).PlaybackTriggerSource; const USER_INTERACTION = PlaybackTriggerSource.USER_INTERACTION; if (a1 === USER_INTERACTION) { moduleValue = require(7110) /* metro dependency 7110: AnalyticsActions */; trackAdContentEvent = moduleValue.trackAdContentEvent; object = {}; object.adContentId = bountyId; object.adCreativeType = (require(7121) /* metro dependency 7121: AdCreativeType */).AdCreativeType.BOUNTY; object.event = AnalyticEvents.AD_VIDEO_PAUSED; object.properties = {video_timestamp_seconds: a0, video_session_id: env0_4, impression_id: ConstantsModule.AnalyticEvents, reward_timer_seconds: rewardDurationMs / 1000}; object.sourceQuestContent = sourceQuestContent; Reflect.apply(trackAdContentEvent, moduleValue, [object]); } } function _fun102882(a0, a1) { // fn#102882, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13726:3407, offset: 0x0224c988, size: 199 bytes, params: 3, frame: 17 var moduleValue; var trackAdContentEvent; var object; const PlaybackTriggerSource = (AdVideoPlayerModule).PlaybackTriggerSource; const USER_INTERACTION = PlaybackTriggerSource.USER_INTERACTION; if (a1 === USER_INTERACTION) { moduleValue = require(7110) /* metro dependency 7110: AnalyticsActions */; trackAdContentEvent = moduleValue.trackAdContentEvent; object = {}; object.adContentId = bountyId; object.adCreativeType = (require(7121) /* metro dependency 7121: AdCreativeType */).AdCreativeType.BOUNTY; object.event = AnalyticEvents.AD_VIDEO_RESUMED; object.properties = {video_timestamp_seconds: a0, video_session_id: env0_4, impression_id: ConstantsModule.AnalyticEvents, reward_timer_seconds: rewardDurationMs / 1000}; object.sourceQuestContent = sourceQuestContent; Reflect.apply(trackAdContentEvent, moduleValue, [object]); } } } } global.__d(_fun102867, 13536, [31, 661, 9513, 491, 7110, 7121, 9522, 13523, 2]) /* metro module 13536, dependencies: [31, 661, 9513, 491, 7110, 7121, 9522, 13523, 2] */;