318 lines
14 KiB
TypeScript
318 lines
14 KiB
TypeScript
/* Metro module 13536; source: modules/quests/native/BountiesModal/useBountiesModalVideoAnalytics.tsx; dependencies: [31, 661, 9513, 491, 7110, 7121, 9522, 13523, 2] */
|
|
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_2 = importAll(31) /* metro dependency 31 */;
|
|
const env0_3 = (require(661) /* metro dependency 661: Constants */).AnalyticEvents;
|
|
const env0_4 = [25, 50, 75];
|
|
(require(2) /* metro dependency 2 */).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 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
|
|
var object2;
|
|
const env0_2 = rewardDurationMs;
|
|
const value2 = (require(9513) /* metro dependency 9513: ContentImpressionTrackerHooks */).useQuestImpressionId();
|
|
const binding = env0_2;
|
|
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]);
|
|
object2 = {};
|
|
object2.handleVideoProgressAnalytics = binding.useCallback(_fun102878, [value6, value7, value9, rewardDurationMs]);
|
|
object2.handleVideoEndAnalytics = binding.useCallback(_fun102879, [value6, value7, value9, value8]);
|
|
object2.handleVideoLoopedAnalytics = binding.useCallback(_fun102880, [bountyId, value, value2, sourceQuestContent,
|
|
rewardDurationMs]);
|
|
object2.handleVideoPausedAnalytics = binding.useCallback(_fun102881, [bountyId, value, value2, sourceQuestContent,
|
|
rewardDurationMs]);
|
|
object2.handleVideoResumedAnalytics = binding.useCallback(_fun102882, [bountyId, value, value2, sourceQuestContent,
|
|
rewardDurationMs]);
|
|
return object2;
|
|
}
|
|
|
|
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 (require(491) /* metro dependency 491 */).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 analyticsActionsModule = require(7110) /* metro dependency 7110: AnalyticsActions */;
|
|
const trackAdContentEvent = analyticsActionsModule.trackAdContentEvent;
|
|
const object2 = {};
|
|
object2.adContentId = bountyId;
|
|
const AdCreativeType = (require(7121) /* metro dependency 7121: AdCreativeType */).AdCreativeType;
|
|
const BOUNTY = AdCreativeType.BOUNTY;
|
|
object2.adCreativeType = BOUNTY;
|
|
const AD_VIDEO_PROGRESSED = AnalyticEvents.AD_VIDEO_PROGRESSED;
|
|
object2.event = AD_VIDEO_PROGRESSED;
|
|
object2.properties = {progress: progress, video_timestamp_seconds: videoTimestampSeconds, video_session_id: env0_4,
|
|
impression_id: env0_3, threshold_met: thresholdMet, reward_timer_seconds: rewardDurationMs / 1000};
|
|
object2.sourceQuestContent = sourceQuestContent;
|
|
Reflect.apply(trackAdContentEvent, analyticsActionsModule, [object2]);
|
|
}
|
|
|
|
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 analyticsActionsModule = require(7110) /* metro dependency 7110: AnalyticsActions */;
|
|
const trackAdContentEvent = analyticsActionsModule.trackAdContentEvent;
|
|
const object2 = {};
|
|
object2.adContentId = bountyId;
|
|
const AdCreativeType = (require(7121) /* metro dependency 7121: AdCreativeType */).AdCreativeType;
|
|
const BOUNTY = AdCreativeType.BOUNTY;
|
|
object2.adCreativeType = BOUNTY;
|
|
const AD_VIDEO_LOOPED = AnalyticEvents.AD_VIDEO_LOOPED;
|
|
object2.event = AD_VIDEO_LOOPED;
|
|
object2.properties = {video_session_id: env0_4, impression_id: env0_3, loop_count: a0,
|
|
reward_timer_seconds: rewardDurationMs / 1000};
|
|
object2.sourceQuestContent = sourceQuestContent;
|
|
Reflect.apply(trackAdContentEvent, analyticsActionsModule, [object2]);
|
|
}
|
|
|
|
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 object2;
|
|
const PlaybackTriggerSource = (require(13523) /* metro dependency 13523: AdVideoPlayer */).PlaybackTriggerSource;
|
|
const USER_INTERACTION = PlaybackTriggerSource.USER_INTERACTION;
|
|
if (a1 === USER_INTERACTION) {
|
|
moduleValue = require(7110) /* metro dependency 7110: AnalyticsActions */;
|
|
trackAdContentEvent = moduleValue.trackAdContentEvent;
|
|
object2 = {};
|
|
object2.adContentId = bountyId;
|
|
object2.adCreativeType = (require(7121) /* metro dependency 7121: AdCreativeType */).AdCreativeType.BOUNTY;
|
|
object2.event = AnalyticEvents.AD_VIDEO_PAUSED;
|
|
object2.properties = {video_timestamp_seconds: a0, video_session_id: env0_4, impression_id: env0_3,
|
|
reward_timer_seconds: rewardDurationMs / 1000};
|
|
object2.sourceQuestContent = sourceQuestContent;
|
|
Reflect.apply(trackAdContentEvent, moduleValue, [object2]);
|
|
}
|
|
}
|
|
|
|
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 object2;
|
|
const PlaybackTriggerSource = (require(13523) /* metro dependency 13523: AdVideoPlayer */).PlaybackTriggerSource;
|
|
const USER_INTERACTION = PlaybackTriggerSource.USER_INTERACTION;
|
|
if (a1 === USER_INTERACTION) {
|
|
moduleValue = require(7110) /* metro dependency 7110: AnalyticsActions */;
|
|
trackAdContentEvent = moduleValue.trackAdContentEvent;
|
|
object2 = {};
|
|
object2.adContentId = bountyId;
|
|
object2.adCreativeType = (require(7121) /* metro dependency 7121: AdCreativeType */).AdCreativeType.BOUNTY;
|
|
object2.event = AnalyticEvents.AD_VIDEO_RESUMED;
|
|
object2.properties = {video_timestamp_seconds: a0, video_session_id: env0_4, impression_id: env0_3,
|
|
reward_timer_seconds: rewardDurationMs / 1000};
|
|
object2.sourceQuestContent = sourceQuestContent;
|
|
Reflect.apply(trackAdContentEvent, moduleValue, [object2]);
|
|
}
|
|
}
|
|
|