/* Metro module 9524; source: modules/quests/utils/QuestMatchingUtils.tsx; dependencies: [57, 4234, 6528, 661, 4237, 7116, 7091, 7114, 2] */ function _fun74307(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#74307, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9710:6, offset: 0x01d899e9, size: 330 bytes, params: 8, frame: 21 let env0_0 = require; const _arrayLikeToArray_74310 = 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 closure = questMatchesActivity; const closure2 = getQuestByActivity; const Object = global.Object; Object.defineProperty(exports, '__esModule', {value: true}); const env0_2 = importDefault(57) /* metro dependency 57 */; const applicationStore = importDefault(4234) /* metro dependency 4234: ApplicationStore */; const questConstantsModule = require(6528) /* metro dependency 6528: QuestConstants */; const env0_4 = questConstantsModule.DISCORD_APPLICATION_ID; const env0_5 = questConstantsModule.PLAY_ACTIVITY_CLOUD_GAMING_QUEST_ID; const env0_6 = questConstantsModule.PLAY_ACTIVITY_SOCIAL_ENTRY_APPLICATION_ID; const env0_7 = (require(661) /* metro dependency 661: Constants */).ActivityGamePlatforms; const env0_8 = (require(4237) /* metro dependency 4237: Constants */).XBOX_ACTIVITY_APPLICATION_ID; (require(2) /* metro dependency 2 */).fileFinishedImporting('modules/quests/utils/QuestMatchingUtils.tsx'); exports.questMatchesActivity = closure; exports.getQuestByActivity = closure2; exports.getQuestByApplicationId = getQuestByApplicationId; exports.allPlayOnDesktopQuestsByApplicationId = function(a0, a1) { var env0_0 = a1; var Array = global.Array; return Array.from(a0.values()).filter(_fun74317); }; exports.getQuestsFromActivities = function(a0, a1) { var value4; var value5; if (a1 == null) { return null; } if (a0 == null) { return null; } var value2 = _createForOfIteratorHelperLoose_74308(a1); var value3 = value2(); if (value3.done) { return null; } var r3 = value3; loopExit3: while (true) { value4 = getQuestByActivity(a0, r3.value); if (value4 != null) { break loopExit3; } value5 = value2(); if (value5.done) { return null; } r3 = value5; continue; } return value4; }; exports.getEligibleQuestsForApplicationId = function(a0, a1) { var r0; var value = a2; var env0_0 = a1; var env0_1 = value !== undefined ? value : false; if (a1 == null) { r0 = []; } else { value = global.Array.from(a0.values()); value = value.filter(_fun74320); r0 = value; } return r0; }; } function _createForOfIteratorHelperLoose_74308(a0, a1) { // fn#74308, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9710:317, offset: 0x01d89b33, 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 _fun74309; } value = undefined; if (a0) { if (typeof a0 === 'string') { value = _arrayLikeToArray_74310(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_74310(a0, value); r6 = value; } else { regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', ''); if (regexp.test(r9)) { value = _arrayLikeToArray_74310(a0, value); r6 = value; } else { r6 = value; } } r5 = r6; } } else { r5 = value; } if (r5) { if (r5) { } return _fun74309; } 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 questMatchesActivity(a0, a1) { // fn#74311, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9710:1227, offset: 0x01d89ca7, size: 295 bytes, params: 3, frame: 19 var r1; var r2; var r0; var value10; var consoleApplicationId; let value = a0 != null; if (value) { r1 = a0.application_id === XBOX_ACTIVITY_APPLICATION_ID || a0.platform === ActivityGamePlatforms.XBOX; if (r1) { value10 = a0.name.toLowerCase(); consoleApplicationId = (require(7116) /* metro dependency 7116: QuestTaskUtils */).getConsoleApplicationId(a1); if (consoleApplicationId == null) { r2 = false; } else { value = ApplicationStore.getApplication(consoleApplicationId); r2 = value != null && value10 === value.name.toLowerCase(); } r1 = r2; } else { r1 = a0.platform === ActivityGamePlatforms.PS4 || a0.platform === ActivityGamePlatforms.PS5; if (r1) { value10 = a0.name.toLowerCase(); consoleApplicationId = (require(7116) /* metro dependency 7116: QuestTaskUtils */).getConsoleApplicationId(a1); if (consoleApplicationId == null) { r2 = false; } else { value = ApplicationStore.getApplication(consoleApplicationId); r2 = value != null && value10 === value.name.toLowerCase(); } r1 = r2; } else { r1 = a1 != null && a1.id === PLAY_ACTIVITY_CLOUD_GAMING_QUEST_ID; r1 = r1 && a0.application_id === PLAY_ACTIVITY_SOCIAL_ENTRY_APPLICATION_ID; r1 = !r1 ? a0.application_id != null && questMatchesApplicationId(a0.application_id, a1) : r1; } } r0 = r1; } else { r0 = value; } return r0; } function getQuestByActivity(a0, a1) { // fn#74312, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9710:1685, offset: 0x01d89dce, size: 129 bytes, params: 3, frame: 21 var r2; var value4; var value5; var property; var moduleValue; var isQuestExpired; var value6; const value2 = _createForOfIteratorHelperLoose_74308(a0); const value3 = value2(); let done = value3.done; if (!done) { r2 = value3; reducibleLoop1: while (true) { value4 = r2.value; value5 = env0_2(value4, 2); value5[0]; property = value5[1]; if (questMatchesActivity(a1, property)) { moduleValue = require(7091) /* metro dependency 7091: QuestDataUtils */; isQuestExpired = moduleValue.isQuestExpired; reducibleJoin4: while (true) { if (!Reflect.apply(isQuestExpired, moduleValue, [property])) { return property; } break reducibleJoin4; } } value6 = value2(); done = value6.done; if (done) { return undefined; } r2 = value6; continue reducibleLoop1; } } } function questMatchesApplicationId(a0, a1) { // fn#74313, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9710:1888, offset: 0x01d89e4f, size: 77 bytes, params: 3, frame: 12 var r0; const env0_0 = a0; let value = require(7116) /* metro dependency 7116: QuestTaskUtils */; value = value.getAllApplicationIds(a1); const value2 = value != null; if (value2) { value = value.some(_fun74314); r0 = value; } else { r0 = value2; } return r0; } function getQuestByApplicationId(a0, a1) { // fn#74315, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9710:2193, offset: 0x01d89e9c, size: 137 bytes, params: 3, frame: 22 var r2; var r0; var value5; var value6; var property; var moduleValue; var isQuestExpired; var value7; const _createForOfIteratorHelperLoose_74308Binding = _createForOfIteratorHelperLoose_74308; const value2 = undefined; const value3 = _createForOfIteratorHelperLoose_74308Binding(a0); const value4 = value3(); let done = value4.done; if (done) { r0 = value2; } else { r2 = value4; reducibleLoop1: while (true) { value5 = r2.value; value6 = env0_2(value5, 2); value6[0]; property = value6[1]; if (questMatchesApplicationId(a1, property)) { moduleValue = require(7091) /* metro dependency 7091: QuestDataUtils */; isQuestExpired = moduleValue.isQuestExpired; reducibleJoin3: while (true) { if (Reflect.apply(isQuestExpired, moduleValue, [property])) { break reducibleJoin3; } r0 = property; break reducibleLoop1; } } value7 = value3(); done = value7.done; if (done) { r0 = value2; break reducibleLoop1; } r2 = value7; continue reducibleLoop1; } } return r0; } function allPlayOnDesktopQuestsByApplicationId(a0, a1) { // fn#74316, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9710:2461, offset: 0x01d89f25, size: 58 bytes, params: 3, frame: 13 const env0_0 = a1; const Array = global.Array; return Array.from(a0.values()).filter(_fun74317); } function getEligibleQuestsForApplicationId(a0, a1) { // fn#74319, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9710:2925, offset: 0x01d8a01f, size: 85 bytes, params: 3, frame: 13 var r0; var Array; let value = a2; const env0_0 = a1; if (value !== undefined) { } if (a1 == null) { r0 = []; } else { Array = global.Array; value = Array.from(a0.values()); value = value.filter(_fun74320); r0 = value; } return r0; } function _fun74317(a0) { // fn#74317, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9710:2551, offset: 0x01d89f5f, size: 105 bytes, params: 2, frame: 16 var r0; var moduleValue; let value = environment.__proto__; const value3 = questMatchesApplicationId(require, a0); if (value3) { moduleValue = require(7091) /* metro dependency 7091: QuestDataUtils */; r0 = !moduleValue.isQuestExpired(a0); } else { r0 = value3; } if (r0) { value = require(7116) /* metro dependency 7116: QuestTaskUtils */; value = value.hasPlayOnDesktopTask({quest: a0}); r0 = value; } return r0; } function _fun74320(a0) { // fn#74320, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9710:3027, offset: 0x01d8a074, size: 225 bytes, params: 2, frame: 17 var moduleValue3; const value = environment.__proto__; const value2 = undefined; const activityApplicationId = (require(7116) /* metro dependency 7116: QuestTaskUtils */).getActivityApplicationId(a0); let r0 = a0 != null && (require(7114) /* metro dependency 7114: QuestUtils */).canLaunchActivity(a0); if (r0) { moduleValue3 = require(7091) /* metro dependency 7091: QuestDataUtils */; r0 = !moduleValue3.isQuestExpired(a0); } r0 = r0 && activityApplicationId === require && activityApplicationId !== DISCORD_APPLICATION_ID; r0 = r0 && ((a0.userStatus == null ? value2 : a0.userStatus.completedAt) == null || env0_1) && ((a0.userStatus == null ? value2 : a0.userStatus.enrolledAt) == null || env0_1); return r0; }