/* Metro module 4271; source: records/LibraryApplicationRecord.tsx; dependencies: [6, 7, 15, 17, 18, 1886, 4234, 4272, 661, 1391, 3738, 2] */ import ClassCallCheck from '../by-id/module-00006-ClassCallCheck.js'; /* Metro dependency 6 */ import CreateClass from '../by-id/module-00007-CreateClass.js'; /* Metro dependency 7 */ import PossibleConstructorReturn from '../by-id/module-00015-PossibleConstructorReturn.js'; /* Metro dependency 15 */ import Module00017 from '../by-id/module-00017.js'; /* Metro dependency 17 */ import Inherits from '../by-id/module-00018-Inherits.js'; /* Metro dependency 18 */ import Record from '../lib/Record.tsx'; /* Metro dependency 1886 */ import ApplicationStore from '../modules/applications/ApplicationStore.tsx'; /* Metro dependency 4234 */ import EntitlementRecord from './EntitlementRecord.tsx'; /* Metro dependency 4272 */ import * as FileImportTrackerModule from '../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */ import * as ConstantsModule from '../Constants.tsx'; /* Metro dependency 661 */ function _fun36191(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#36191, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4443:6, offset: 0x01084c95, size: 283 bytes, params: 8, frame: 19 const Object = global.Object; Object.defineProperty(exports, '__esModule', {value: true}); let value = Record; value = _fun36195(value); (FileImportTrackerModule).fileFinishedImporting('records/LibraryApplicationRecord.tsx'); exports.default = value; function _isNativeReflectConstruct_36192() { // fn#36192, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4443:246, offset: 0x01084db0, size: 94 bytes, params: 1, frame: 18 var Boolean; var prototype; var valueOf; var call; var Reflect; var construct; var closure; var value; var error; try { Boolean = global.Boolean; prototype = Boolean.prototype; valueOf = prototype.valueOf; call = valueOf.call; Reflect = global.Reflect; construct = Reflect.construct; Boolean = global.Boolean; closure = function() { }; value = Reflect.apply(construct, Reflect, [Boolean, [], closure]); value = Reflect.apply(call, valueOf, [value]); var result = !value; } catch (error) { } return (_isNativeReflectConstruct_36192_isNativeReflectConstruct = function() { return !!result; })(); } function _fun36195(a0) { // fn#36195, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4443:445, offset: 0x01084e0e, size: 467 bytes, params: 2, frame: 18 const LibraryApplicationRecord2 = LibraryApplicationRecord; Inherits(LibraryApplicationRecord2, a0); return CreateClass(LibraryApplicationRecord2, [{key: 'getFlags', value: function() { return this.flags; }}, {key: 'hasFlag', value: value_36198}, {key: 'isHidden', value: function() { return this.hasFlag(LibraryApplicationFlags.HIDDEN); }}, {key: 'isLegacyOverlayEnabled', value: function() { return !this.hasFlag(LibraryApplicationFlags.OVERLAY_DISABLED); }}, {key: 'isOverlayV3Enabled', value: function() { return !this.hasFlag(LibraryApplicationFlags.OVERLAY_V3_DISABLED); }}, {key: 'isOverlayEnabled', value: function() { return this.isLegacyOverlayEnabled() || this.isOverlayV3Enabled(); }}, {key: 'isMasterBranch', value: function() { return this.branchId === this.id; }}, {key: 'isDiscordApplication', value: function() { return true; }}, {key: 'isEntitled', value: function(a0, a1) { var env0_0 = this; var env0_1 = a0; var env0_2 = a1; var property = this.isTestMode; return property ? !!property : this.entitlements.some(_fun36206); }}, {key: 'isPreorder', value: function() { return this.sku.preorderReleaseAt != null || this.sku.preorderApproximateReleaseDate != null; }}, {key: 'getDistributor', value: function() { return Distributors.DISCORD; }}, {key: 'getBranchName', value: function() { return this.branch != null ? this.branch.name : 'master'; }}, {key: 'getBranchedName', value: function(a0) { return this.isMasterBranch() || this.branch == null ? a0.name : '' + a0.name + ' (' + this.branch.name + ')'; }}, {key: 'getSkuIdForAnalytics', value: function() { return this.sku.id; }}, {key: 'getAnalyticsData', value: value_36212}], [{key: 'createFromServer', value: value_36213}, {key: 'createForTestMode', value: value_36215}]); function LibraryApplicationRecord({id, createdAt, flags, branchId, entitlements, branch, sku, isTestMode}) { // fn#36196, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4443:457, offset: 0x01084fe1, size: 210 bytes, params: 2, frame: 20 let value = environment.__proto__; env1_3(this, LibraryApplicationRecord); const value3 = env1_6(LibraryApplicationRecord); value = env1_5(this, _isNativeReflectConstruct_36192() ? global.Reflect.construct(value3, [], env1_6(this).constructor) : value3.apply(this, undefined)); value.id = id; value.createdAt = createdAt; value.flags = flags; value.branchId = branchId; value.entitlements = entitlements; value.branch = branch; value.sku = sku; isTestMode = !!isTestMode && isTestMode; value.isTestMode = isTestMode; return value; } function value_36198(a0) { // fn#36198, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4443:1008, offset: 0x010850bd, size: 50 bytes, params: 2, frame: 13 let value = environment.__proto__; value = importAll(1391) /* metro dependency 1391: FlagUtils */; return value.hasFlag(this.flags, a0); } function value_36205(a0, a1) { // fn#36205, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4443:1560, offset: 0x01085180, size: 62 bytes, params: 3, frame: 12 const env0_1 = a0; const env0_2 = a1; const isTestMode = this.isTestMode; return isTestMode ? !!isTestMode : this.entitlements.some(_fun36206); function _fun36206(a0) { // fn#36206, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4443:1623, offset: 0x010851be, size: 39 bytes, params: 2, frame: 15 return a0.isValid(env0_1, require, env0_0.branchId); } } function value_36212() { // fn#36212, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4443:2160, offset: 0x010852ae, size: 106 bytes, params: 1, frame: 14 let value = environment.__proto__; value = ApplicationStore.getApplication(this.id); const object = {}; const value2 = null; object.application_id = value2 != value ? value.id : value2; object.application_name = value2 != value ? value.name : value2; object.sku_id = this.getSkuIdForAnalytics(); object.launcher_platform = this.getDistributor(); return object; } function value_36213(a0) { // fn#36213, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4443:2390, offset: 0x01085318, size: 299 bytes, params: 2, frame: 17 const object = {}; object.id = a0.application.id; object.branchId = a0.branch_id; const entitlements = a0.entitlements; let value = null; object.entitlements = value != entitlements ? a0.entitlements.map(function(a0) { return EntitlementRecord.createFromServer(a0); }) : []; object.branch = a0.branch; object.flags = a0.flags; object.createdAt = a0.created_at; const object2 = {}; object2.id = a0.sku.id; object2.type = a0.sku.type; object2.premium = a0.sku.premium; object2.preorderReleaseAt = value != a0.sku.preorder_release_at ? (importDefault(3738) /* metro dependency 3738 */)(a0.sku.preorder_release_at) : value; let preorder_approximate_release_date = a0.sku.preorder_approximate_release_date; preorder_approximate_release_date = value != preorder_approximate_release_date ? a0.sku.preorder_approximate_release_date : value; object2.preorderApproximateReleaseDate = preorder_approximate_release_date; object.sku = object2; value = Object.create(LibraryApplicationRecord.prototype, {constructor: {value: LibraryApplicationRecord}}); const libraryApplicationRecord = new LibraryApplicationRecord(object); return libraryApplicationRecord instanceof Object ? libraryApplicationRecord : value; } function value_36215(a0) { // fn#36215, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4443:2921, offset: 0x0108545a, size: 160 bytes, params: 2, frame: 13 const object = {}; object.id = a0.id; object.entitlements = []; object.branchId = a0.branch.id; object.branch = a0.branch; let value = environment.__proto__; const ENTITLED = LibraryApplicationFlags.ENTITLED; object.flags = ENTITLED; object.createdAt = a0.branch.created_at; const DURABLE_PRIMARY = SKUTypes.DURABLE_PRIMARY; object.sku = {id: a0.skuId, type: DURABLE_PRIMARY, premium: false}; object.isTestMode = true; value = Object.create(LibraryApplicationRecord.prototype, {constructor: {value: LibraryApplicationRecord}}); const libraryApplicationRecord = new LibraryApplicationRecord(object); return libraryApplicationRecord instanceof Object ? libraryApplicationRecord : value; } } } global.__d(_fun36191, 4271, [6, 7, 15, 17, 18, 1886, 4234, 4272, 661, 1391, 3738, 2]) /* metro module 4271, dependencies: [6, 7, 15, 17, 18, 1886, 4234, 4272, 661, 1391, 3738, 2] */;