Initial commit
This commit is contained in:
commit
af3b49f756
16065 files changed
+2938410
No files matched your search
@@ -0,0 +1,28 @@
|
||||
/* Metro module 10390; source: modules/premium/promotions/MarketingComponentHooks.tsx; dependencies: [4502, 4048, 566, 3866, 2] */
|
||||
function _fun80481(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#80481, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10576:6, offset: 0x01e7d6c9, size: 118 bytes, params: 8, frame: 19
|
||||
const env0_0 = require;
|
||||
const Object = global.Object;
|
||||
Object.defineProperty(exports, '__esModule', {value: true});
|
||||
const accessibilityStore = importDefault(4502) /* metro dependency 4502: AccessibilityStore */;
|
||||
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/premium/promotions/MarketingComponentHooks.tsx');
|
||||
exports.useThemeAndReducedMotionAwareAssetUrl = useThemeAndReducedMotionAwareAssetUrl;
|
||||
}
|
||||
|
||||
function useThemeAndReducedMotionAwareAssetUrl(a0, a1) { // fn#80482, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10576:234, offset: 0x01e7d73f, size: 173 bytes, params: 3, frame: 17
|
||||
var r0;
|
||||
var value;
|
||||
const value2 = (importDefault(4048) /* metro dependency 4048: useTheme */)();
|
||||
const useReducedMotion = (require(566) /* metro dependency 566: flux */).useStateFromStores([AccessibilityStore],
|
||||
function() {
|
||||
return AccessibilityStore.useReducedMotion;
|
||||
});
|
||||
const value3 = null;
|
||||
if (value3 == a0) {
|
||||
r0 = value3;
|
||||
} else {
|
||||
value = require(3866) /* metro dependency 3866: themes */;
|
||||
r0 = value.isThemeDark(value2) || a1 ? useReducedMotion ? a0.darkStaticUrl : a0.darkUrl : useReducedMotion ? a0.lightStaticUrl : a0.lightUrl;
|
||||
}
|
||||
return r0;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,93 @@
|
||||
/* Metro module 7264; source: modules/premium/promotions/MarketingComponentRecord.tsx; dependencies: [6, 7, 15, 17, 18, 1886, 7265, 1316, 2] */
|
||||
function _fun58397(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#58397, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7442:6, offset: 0x016c6c63, size: 202 bytes, params: 8, frame: 19
|
||||
const env0_0 = require;
|
||||
const Object = global.Object;
|
||||
Object.defineProperty(exports, '__esModule', {value: true});
|
||||
const env0_2 = importDefault(6) /* metro dependency 6 */;
|
||||
const env0_3 = importDefault(7) /* metro dependency 7 */;
|
||||
const env0_4 = importDefault(15) /* metro dependency 15 */;
|
||||
const env0_5 = importDefault(17) /* metro dependency 17 */;
|
||||
const env0_6 = importDefault(18) /* metro dependency 18 */;
|
||||
let value = importDefault(1886) /* metro dependency 1886: Record */;
|
||||
value = _fun58401(value);
|
||||
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/premium/promotions/MarketingComponentRecord.tsx');
|
||||
exports.default = value;
|
||||
}
|
||||
|
||||
function _isNativeReflectConstruct_58398() { // fn#58398, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7442:148, offset: 0x016c6d2d, 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_58398_isNativeReflectConstruct = function() {
|
||||
return !!result;
|
||||
})();
|
||||
}
|
||||
|
||||
function _fun58401(a0) { // fn#58401, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7442:347, offset: 0x016c6d8b, size: 71 bytes, params: 2, frame: 16
|
||||
const closure = MarketingComponentRecord;
|
||||
env0_6(closure, a0);
|
||||
return env0_3(closure, null, [{key: 'createFromServer', value: value_58403}]);
|
||||
}
|
||||
|
||||
function MarketingComponentRecord({id, componentType, properties, promotionId}) { // fn#58402, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7442:359, offset: 0x016c6dd2, size: 158 bytes, params: 2, frame: 20
|
||||
let value = environment.__proto__;
|
||||
env1_2(this, MarketingComponentRecord);
|
||||
const value3 = env1_5(MarketingComponentRecord);
|
||||
value = env1_4(this, _isNativeReflectConstruct_58398() ? global.Reflect.construct(value3, [],
|
||||
env1_5(this).constructor) : value3.apply(this, undefined));
|
||||
value.id = id;
|
||||
value.componentType = componentType;
|
||||
value.properties = properties;
|
||||
value.promotionId = promotionId;
|
||||
return value;
|
||||
}
|
||||
|
||||
function value_58403({id, component_type, properties, promotion_id}) { // fn#58403, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7442:805, offset: 0x016c6e70, size: 214 bytes, params: 2, frame: 20
|
||||
var object2;
|
||||
var environment;
|
||||
const TextDecoder = global.TextDecoder;
|
||||
let textDecoder = new TextDecoder('utf-8', {ignoreBOM: true});
|
||||
object2 = {id: id, componentType: component_type};
|
||||
textDecoder = environment.__proto__;
|
||||
const PremiumMarketingComponentProperties = (require(7265) /* metro dependency 7265: premium_marketing_component_properties */).PremiumMarketingComponentProperties;
|
||||
const fromBinary = PremiumMarketingComponentProperties.fromBinary;
|
||||
textDecoder = require(1316) /* metro dependency 1316 */;
|
||||
textDecoder = textDecoder.base64decode(properties);
|
||||
object2.properties = Reflect.apply(fromBinary, PremiumMarketingComponentProperties, [textDecoder,
|
||||
{readUnknownField: true, readerFactory: readerFactory_58404}]);
|
||||
object2.promotionId = promotion_id;
|
||||
textDecoder = Object.create(MarketingComponentRecord.prototype, {constructor: {value: MarketingComponentRecord}});
|
||||
const marketingComponentRecord = new MarketingComponentRecord(object2);
|
||||
return marketingComponentRecord instanceof Object ? marketingComponentRecord : textDecoder;
|
||||
}
|
||||
|
||||
function value_58403ReaderFactory(a0) { // fn#58404, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7442:1075, owner: value_58403.readerFactory, offset: 0x016c6f46, size: 63 bytes, params: 2, frame: 13
|
||||
let value = environment.__proto__.__proto__;
|
||||
const BinaryReader = (require(1316) /* metro dependency 1316 */).BinaryReader;
|
||||
const binding = env0_0;
|
||||
value = Object.create(BinaryReader.prototype, {constructor: {value: BinaryReader}});
|
||||
const binaryReader = new BinaryReader(a0, binding);
|
||||
return binaryReader instanceof Object ? binaryReader : value;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
/* Metro module 12169; source: modules/premium/promotions/PromotionStringUtils.tsx; dependencies: [3807, 1880, 566, 3802, 5137, 1244, 1948, 2] */
|
||||
function _fun93266(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#93266, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12355:6, offset: 0x020ad048, size: 163 bytes, params: 8, frame: 19
|
||||
const env0_0 = require;
|
||||
const Object = global.Object;
|
||||
Object.defineProperty(exports, '__esModule', {value: true});
|
||||
const subscriptionPlanStore = importDefault(3807) /* metro dependency 3807: SubscriptionPlanStore */;
|
||||
const premiumConstantsModule = require(1880) /* metro dependency 1880: PremiumConstants */;
|
||||
const env0_4 = premiumConstantsModule.PremiumSubscriptionSKUs;
|
||||
const env0_5 = premiumConstantsModule.SubscriptionPlans;
|
||||
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/premium/promotions/PromotionStringUtils.tsx');
|
||||
exports.useFormatStringWithCommonPremiumParams = useFormatStringWithCommonPremiumParams;
|
||||
exports.getHelpArticleLinkProps = getHelpArticleLinkProps;
|
||||
}
|
||||
|
||||
function useFormatStringWithCommonPremiumParams(a0) { // fn#93267, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12355:292, offset: 0x020ad0eb, size: 211 bytes, params: 2, frame: 17
|
||||
var r0;
|
||||
var property;
|
||||
var defaultImport;
|
||||
var getDefaultPrice;
|
||||
var PREMIUM_MONTH_TIER_2;
|
||||
var value5;
|
||||
var moduleValue2;
|
||||
var formatPrice;
|
||||
var amount;
|
||||
var currency;
|
||||
var value6;
|
||||
var error;
|
||||
const value = '...';
|
||||
const moduleValue = require(dependencyMap[2]);
|
||||
const useStateFromStores = moduleValue.useStateFromStores;
|
||||
if (a0.indexOf('{price}') === -1) {
|
||||
r0 = value;
|
||||
} else if (Reflect.apply(useStateFromStores, moduleValue, [[SubscriptionPlanStore], function() {
|
||||
return SubscriptionPlanStore.isLoadedForSKU(PremiumSubscriptionSKUs.TIER_2);
|
||||
}])) {
|
||||
try {
|
||||
property = dependencyMap[3];
|
||||
defaultImport = importDefault(property);
|
||||
getDefaultPrice = defaultImport.getDefaultPrice;
|
||||
PREMIUM_MONTH_TIER_2 = SubscriptionPlans.PREMIUM_MONTH_TIER_2;
|
||||
value5 = Reflect.apply(getDefaultPrice, defaultImport, [PREMIUM_MONTH_TIER_2]);
|
||||
property = dependencyMap[4];
|
||||
moduleValue2 = require(property);
|
||||
formatPrice = moduleValue2.formatPrice;
|
||||
amount = value5.amount;
|
||||
currency = value5.currency;
|
||||
value6 = Reflect.apply(formatPrice, moduleValue2, [amount, currency]);
|
||||
r0 = value6;
|
||||
} catch (error) {
|
||||
r0 = value;
|
||||
}
|
||||
} else {
|
||||
r0 = value;
|
||||
}
|
||||
return a0.replace(RegExp('\\{price\\}', 'g'), r0);
|
||||
}
|
||||
|
||||
function getHelpArticleLinkProps(a0, a1) { // fn#93269, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12355:625, offset: 0x020ad1dc, size: 209 bytes, params: 3, frame: 17
|
||||
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
||||
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
|
||||
const value = a1;
|
||||
const value2 = undefined;
|
||||
const r5 = (a0 == null ? value2 : a0.id) == null || a0.id === '' ? value : a0.id;
|
||||
if (r5 === '') {
|
||||
return null;
|
||||
}
|
||||
const r2 = (a0 == null ? value2 : a0.linkText) == null ? intl.string(t['sBp+u0']) : a0.linkText !== '' ? a0.linkText : intl.string(t['sBp+u0']);
|
||||
const object2 = {};
|
||||
object2.url = (importDefault(1948) /* metro dependency 1948: HelpdeskUtils */).getArticleURL(r5);
|
||||
object2.linkText = r2;
|
||||
return object2;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,381 @@
|
||||
/* Metro module 7286; source: modules/premium/promotions/PromotionUtils.tsx; dependencies: [5, 1348, 7262, 3808, 7064, 7261, 1880, 661, 4237, 4002, 507, 477, 683, 1391, 1365, 21, 1367, 7263, 3802, 2] */
|
||||
function _fun58765(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#58765, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7464:6, offset: 0x016d65f5, size: 475 bytes, params: 8, frame: 24
|
||||
let env0_0 = require;
|
||||
const _arrayLikeToArray_58768 = 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 = function(a0) {
|
||||
var object = {code: a0.code, userId: a0.user_id, claimedAt: a0.claimed_at};
|
||||
object.promotion = PromotionRecord.createFromServer(a0.promotion);
|
||||
return object;
|
||||
};
|
||||
const closure2 = getNextUnseenOutboundPromotionId;
|
||||
const closure3 = function({partnerId}) {
|
||||
return partnerId === require(dependencyMap[17]).LOGITECH_PARTNER_ID;
|
||||
};
|
||||
const closure4 = shouldShowOutboundPromotionOnPlatform;
|
||||
const closure5 = function({promotionType}) {
|
||||
return promotionType === require(dependencyMap[17]).PromotionTypes.THIRD_PARTY_OUTBOUND_RECURRING;
|
||||
};
|
||||
const Object = global.Object;
|
||||
Object.defineProperty(exports, '__esModule', {value: true});
|
||||
const env0_3 = importDefault(5) /* metro dependency 5 */;
|
||||
const userSettingsProtoStore = importDefault(1348) /* metro dependency 1348: UserSettingsProtoStore */;
|
||||
const promotionRecord = importDefault(7262) /* metro dependency 7262: PromotionRecord */;
|
||||
const subscriptionStore = importDefault(3808) /* metro dependency 3808: SubscriptionStore */;
|
||||
const userOfferStore = importDefault(7064) /* metro dependency 7064: UserOfferStore */;
|
||||
const promotionsStore = importDefault(7261) /* metro dependency 7261: PromotionsStore */;
|
||||
let value = require(1880) /* metro dependency 1880: PremiumConstants */;
|
||||
const env0_9 = value.PremiumTypes;
|
||||
const env0_10 = value.PromotionFlags;
|
||||
value = require(661) /* metro dependency 661: Constants */;
|
||||
const env0_11 = value.AnalyticEvents;
|
||||
const env0_12 = value.Endpoints;
|
||||
const env0_13 = value.Platforms;
|
||||
(require(4237) /* metro dependency 4237: Constants */).ActivityPlatform;
|
||||
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/premium/promotions/PromotionUtils.tsx');
|
||||
exports.getPromotionImageURL = getPromotionImageURL;
|
||||
exports.claimedOutboundPromotionCodeFromServer = closure;
|
||||
exports.claimOutboundPromotion = function() {
|
||||
return _claimOutboundPromotion.apply(this, arguments);
|
||||
};
|
||||
exports.getOutboundPromotionRedemptionUrl = function(a0, a1) {
|
||||
var r0;
|
||||
var property;
|
||||
var value;
|
||||
if (a1.outboundRedemptionUrlFormat == null) {
|
||||
r0 = a1.outboundRedemptionPageLink ?? '';
|
||||
} else if (a1.outboundRedemptionUrlFormat !== '') {
|
||||
property = a1.outboundRedemptionUrlFormat;
|
||||
value = (0, global.encodeURIComponent)(a0);
|
||||
value = property.replace('{code}', value);
|
||||
r0 = value;
|
||||
} else {
|
||||
r0 = a1.outboundRedemptionPageLink ?? '';
|
||||
}
|
||||
return r0;
|
||||
};
|
||||
exports.getNextUnseenOutboundPromotionId = closure2;
|
||||
exports.shouldShowOutboundPromotionNotice = shouldShowOutboundPromotionNotice;
|
||||
exports.isLogitechPromotion = closure3;
|
||||
exports.shouldShowOutboundPromotionOnPlatform = closure4;
|
||||
exports.isTrialUserEligibleToSeeOutboundPromotion = function(a0, a1) {
|
||||
return a1[a0.id] != null || a0.isRedeemableByTrialUsers();
|
||||
};
|
||||
exports.getClaimedOutboundPromotionCodeMap = getClaimedOutboundPromotionCodeMap;
|
||||
exports.getClaimedEndedOutboundPromotions = function(a0, a1) {
|
||||
var Set = global.Set;
|
||||
var value = a1.map(_fun58788);
|
||||
value = new Set(value);
|
||||
var env0_0 = value;
|
||||
return a0.filter(_fun58789);
|
||||
};
|
||||
exports.isRecurringPromotion = closure5;
|
||||
exports.isRecurring3PRewardsLocked = isRecurring3PRewardsLocked;
|
||||
}
|
||||
|
||||
function _createForOfIteratorHelperLoose_58766(a0, a1) { // fn#58766, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7464:291, offset: 0x016d67d0, size: 370 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 _fun58767;
|
||||
}
|
||||
value = undefined;
|
||||
if (a0) {
|
||||
if (typeof a0 === 'string') {
|
||||
value = _arrayLikeToArray_58768(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_58768(a0, value);
|
||||
r6 = value;
|
||||
} else {
|
||||
regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', '');
|
||||
if (regexp.test(r9)) {
|
||||
value = _arrayLikeToArray_58768(a0, value);
|
||||
r6 = value;
|
||||
} else {
|
||||
r6 = value;
|
||||
}
|
||||
}
|
||||
r5 = r6;
|
||||
}
|
||||
} else {
|
||||
r5 = value;
|
||||
}
|
||||
if (r5) {
|
||||
if (r5) {
|
||||
}
|
||||
return _fun58767;
|
||||
}
|
||||
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 _claimOutboundPromotion() { // fn#58770, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7464:1354, offset: 0x016d6984, size: 48 bytes, params: 1, frame: 14
|
||||
return env0_3(_fun58772).apply(this, arguments);
|
||||
}
|
||||
|
||||
function getNextUnseenOutboundPromotionId() { // fn#58773, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7464:1862, offset: 0x016d6afe, size: 264 bytes, params: 1, frame: 18
|
||||
var lastDismissedObjectId;
|
||||
var property;
|
||||
const outboundPromotions = PromotionsStore.outboundPromotions;
|
||||
const env0_0 = PromotionsStore.consumedInboundPromotionId;
|
||||
let value2 = outboundPromotions.filter(_fun58774);
|
||||
const userContent = UserSettingsProtoStore.settings.userContent;
|
||||
const value3 = null;
|
||||
let value4 = undefined;
|
||||
if (value3 == userContent) {
|
||||
lastDismissedObjectId = value4;
|
||||
} else {
|
||||
property = userContent.recurringDismissibleContentStates[(require(1365) /* metro dependency 1365: dismissible_content */).DismissibleContent.THIRD_PARTY_OUTBOUND_PROMO_NAGBAR];
|
||||
lastDismissedObjectId = value3 == property ? value4 : property.lastDismissedObjectId;
|
||||
}
|
||||
const r5 = value3 == lastDismissedObjectId ? value2 : value2.filter(_fun58775);
|
||||
const premiumTypeSubscription = SubscriptionStore.getPremiumTypeSubscription();
|
||||
const r4 = value3 == premiumTypeSubscription || !premiumTypeSubscription.hasActiveTrial ? UserOfferStore.hasAnyUnexpiredOffer() ? r5.filter(function(a0) {
|
||||
return a0.isRedeemableByTrialUsers();
|
||||
}) : r5 : r5.filter(_fun58776);
|
||||
return r4.length === 0 ? value3 : r4.sort(function(a0, a1) {
|
||||
var Date = global.Date;
|
||||
var value2 = new Date(a0.startDate);
|
||||
Date = global.Date;
|
||||
var value4 = new Date(a1.startDate);
|
||||
value2 = 1;
|
||||
return value2 < value4 ? -1 : value2;
|
||||
})[0].id;
|
||||
}
|
||||
|
||||
function shouldShowOutboundPromotionOnPlatform(a0) { // fn#58779, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7464:2632, offset: 0x016d6d3d, size: 70 bytes, params: 2, frame: 13
|
||||
const isIOS2 = (require(477) /* metro dependency 477: PlatformUtils */).isIOS();
|
||||
return isIOS2 ? !a0.hasFlag(PromotionFlags.IS_BLOCKED_IOS) : !isIOS2;
|
||||
}
|
||||
|
||||
function getPromotionImageURL(a0, a1) { // fn#58781, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7464:2958, offset: 0x016d6db7, size: 204 bytes, params: 3, frame: 25
|
||||
let value = require(4002) /* metro dependency 4002: shared */;
|
||||
value = value.isThemeDark(a1);
|
||||
const r7 = value ? 'logo-dark' : 'logo-light';
|
||||
const GLOBAL_ENV = global.window.GLOBAL_ENV;
|
||||
const CDN_HOST = GLOBAL_ENV.CDN_HOST;
|
||||
return CDN_HOST != null ? 'https://' + CDN_HOST + '/promotions/' + a0 + '/' + r7 + '?size=256' : '' + global.location.protocol + global.window.GLOBAL_ENV.API_ENDPOINT + '/promotions/' + a0 + '/' + r7 + '?size=256';
|
||||
}
|
||||
|
||||
function shouldShowOutboundPromotionNotice() { // fn#58784, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7464:3814, offset: 0x016d6ee1, size: 97 bytes, params: 1, frame: 18
|
||||
var r0;
|
||||
var value;
|
||||
const nextUnseenOutboundPromotionId = getNextUnseenOutboundPromotionId();
|
||||
const value3 = nextUnseenOutboundPromotionId != null;
|
||||
if (value3) {
|
||||
value = require(1367) /* metro dependency 1367: DismissibleContentUtils */;
|
||||
value = !value.isTimeRecurringSnowflakeBoundDismissibleContentDismissed((require(1365) /* metro dependency 1365: dismissible_content */).DismissibleContent.THIRD_PARTY_OUTBOUND_PROMO_NAGBAR,
|
||||
|
||||
nextUnseenOutboundPromotionId, {cooldownDurationMs: 259200000});
|
||||
r0 = value;
|
||||
} else {
|
||||
r0 = value3;
|
||||
}
|
||||
return r0;
|
||||
}
|
||||
|
||||
function getClaimedOutboundPromotionCodeMap(a0) { // fn#58786, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7464:4392, offset: 0x016d6f66, size: 73 bytes, params: 2, frame: 14
|
||||
var r2;
|
||||
var value3;
|
||||
var code;
|
||||
var promotion;
|
||||
var id;
|
||||
var value4;
|
||||
const object2 = {};
|
||||
const value = _createForOfIteratorHelperLoose_58766(a0);
|
||||
const value2 = value();
|
||||
let done = value2.done;
|
||||
if (!done) {
|
||||
for (r2 = value2; true; r2 = value4) {
|
||||
value3 = r2.value;
|
||||
code = value3.code;
|
||||
promotion = value3.promotion;
|
||||
id = promotion.id;
|
||||
object2[id] = code;
|
||||
value4 = value();
|
||||
done = value4.done;
|
||||
if (done) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return object2;
|
||||
}
|
||||
|
||||
function getClaimedEndedOutboundPromotions(a0, a1) { // fn#58787, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7464:4597, offset: 0x016d6faf, size: 72 bytes, params: 3, frame: 14
|
||||
const Set = global.Set;
|
||||
const set = new Set(a1.map(function(a0) {
|
||||
return a0.id;
|
||||
}));
|
||||
return a0.filter(_fun58789);
|
||||
}
|
||||
|
||||
function isRecurring3PRewardsLocked(a0) { // fn#58790, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7464:4899, offset: 0x016d7054, size: 80 bytes, params: 2, frame: 15
|
||||
var r0;
|
||||
var defaultImport;
|
||||
let value = a0 == null;
|
||||
if (value) {
|
||||
r0 = value;
|
||||
} else {
|
||||
defaultImport = importDefault(3802) /* metro dependency 3802: PremiumUtils */;
|
||||
value = defaultImport.isPremiumExactly(a0, PremiumTypes.TIER_2);
|
||||
value = value === false;
|
||||
r0 = value;
|
||||
}
|
||||
r0 = !r0 ? a0.isFractionalPremiumWithNoStandardSub() : r0;
|
||||
return r0;
|
||||
}
|
||||
|
||||
async function _fun58772({promotionId, promotionTitle, partnerId, analyticsLocations}) { // fn#58772, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7464:1423, offset: 0x016d69c6, size: 312 bytes, params: 2, frame: 24
|
||||
if (false) {
|
||||
return undefined;
|
||||
}
|
||||
await undefined;
|
||||
if (false) {
|
||||
return undefined;
|
||||
}
|
||||
value = environment.__proto__.__proto__;
|
||||
let binding = env2_0;
|
||||
const HTTP = binding(env2_2[10]).HTTP;
|
||||
const post = HTTP.post;
|
||||
const object2 = {};
|
||||
object2.url = env2_12.CLAIM_OUTBOUND_PROMOTION_CODE(promotionId);
|
||||
object2.rejectWithError = false;
|
||||
await Reflect.apply(post, HTTP, [object2]);
|
||||
if (false) {
|
||||
return undefined;
|
||||
}
|
||||
const body = undefined.body;
|
||||
const isIOS2 = env2_0(env2_2[11]).isIOS();
|
||||
binding = env2_13;
|
||||
const r14 = isIOS2 ? binding.IOS : binding.ANDROID;
|
||||
const value7 = env2_1(env2_2[12]);
|
||||
const track = value7.track;
|
||||
const OUTBOUND_PROMOTION_CLAIMED = env2_11.OUTBOUND_PROMOTION_CLAIMED;
|
||||
Reflect.apply(track, value7, [OUTBOUND_PROMOTION_CLAIMED, {platform: r14, status: undefined.status,
|
||||
location_stack: analyticsLocations, promotion_id: promotionId, name: promotionTitle ?? null,
|
||||
partner: partnerId ?? null}]);
|
||||
return env2_16(body);
|
||||
}
|
||||
|
||||
function _fun58774(a0) { // fn#58774, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7464:1978, offset: 0x016d6c06, size: 99 bytes, params: 2, frame: 15
|
||||
var r0;
|
||||
var moduleValue;
|
||||
const id = a0.id;
|
||||
let value = id !== consumedInboundPromotionId;
|
||||
if (value) {
|
||||
value = environment.__proto__;
|
||||
moduleValue = require(1391) /* metro dependency 1391: FlagUtils */;
|
||||
value = !moduleValue.hasFlag(a0.flags, PromotionFlags.SUPPRESS_NOTIFICATION);
|
||||
r0 = value;
|
||||
} else {
|
||||
r0 = value;
|
||||
}
|
||||
if (r0) {
|
||||
value = environment.__proto__;
|
||||
value = !isLogitechPromotion(a0);
|
||||
r0 = value;
|
||||
}
|
||||
return r0;
|
||||
}
|
||||
|
||||
function _fun58775({id}) { // fn#58775, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7464:2269, offset: 0x016d6c69, size: 61 bytes, params: 2, frame: 13
|
||||
let value = environment.__proto__;
|
||||
value = Reflect.apply((importDefault(21) /* metro dependency 21: SnowflakeUtils */).compare, value, [id,
|
||||
lastDismissedObjectId]);
|
||||
return value === 1;
|
||||
}
|
||||
|
||||
function _fun58776(a0) { // fn#58776, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7464:2416, offset: 0x016d6ca6, size: 15 bytes, params: 2, frame: 9
|
||||
return a0.isRedeemableByTrialUsers();
|
||||
}
|
||||
|
||||
function _fun58789({promotion}) { // fn#58789, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7464:4698, offset: 0x016d6ff7, size: 93 bytes, params: 2, frame: 12
|
||||
var r0;
|
||||
const binding = env0_0;
|
||||
let value = binding.has(promotion.id);
|
||||
if (value) {
|
||||
r0 = !value;
|
||||
} else {
|
||||
value = environment.__proto__;
|
||||
value = !isRecurringPromotion(promotion);
|
||||
r0 = value;
|
||||
}
|
||||
if (r0) {
|
||||
value = environment.__proto__;
|
||||
value = !isLogitechPromotion(promotion);
|
||||
r0 = value;
|
||||
}
|
||||
if (r0) {
|
||||
value = environment.__proto__;
|
||||
value = shouldShowOutboundPromotionOnPlatform(promotion);
|
||||
r0 = value;
|
||||
}
|
||||
return r0;
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,255 @@
|
||||
/* Metro module 7285; source: modules/premium/promotions/PromotionsHooks.tsx; dependencies: [31, 1878, 7064, 7261, 1880, 566, 7286, 7287, 7288, 3802, 694, 7289, 2] */
|
||||
function _fun58735(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#58735, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7463:6, offset: 0x016d5cc1, size: 228 bytes, params: 8, frame: 20
|
||||
const env0_0 = require;
|
||||
const closure = useEligibleActiveOutboundPromotions;
|
||||
const Object = global.Object;
|
||||
Object.defineProperty(exports, '__esModule', {value: true});
|
||||
const env0_3 = importAll(31) /* metro dependency 31 */;
|
||||
const userStore = importDefault(1878) /* metro dependency 1878: UserStore */;
|
||||
const userOfferStore = importDefault(7064) /* metro dependency 7064: UserOfferStore */;
|
||||
const promotionsStore = importDefault(7261) /* metro dependency 7261: PromotionsStore */;
|
||||
const env0_7 = (require(1880) /* metro dependency 1880: PremiumConstants */).PremiumTypes;
|
||||
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/premium/promotions/PromotionsHooks.tsx');
|
||||
exports.useEligibleActiveOutboundPromotions = closure;
|
||||
exports.useOutboundPromotions = useOutboundPromotions;
|
||||
exports.useUnseenOutboundPromotions = useUnseenOutboundPromotions;
|
||||
exports.useBogoPromotion = function() {
|
||||
var object = {};
|
||||
object.promotion = require(dependencyMap[5]).useStateFromStores([PromotionsStore], _fun58764);
|
||||
return object;
|
||||
};
|
||||
}
|
||||
|
||||
function useEligibleActiveOutboundPromotions(a0, a1, a2, a3) { // fn#58736, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7463:159, offset: 0x016d5da5, size: 179 bytes, params: 5, frame: 23
|
||||
const env0_0 = a0;
|
||||
const env0_1 = a1;
|
||||
const env0_2 = a2;
|
||||
return a3.useMemo(_fun58739,
|
||||
[(require(566) /* metro dependency 566: flux */).useStateFromStoresArray([PromotionsStore], function() {
|
||||
return PromotionsStore.outboundPromotions;
|
||||
}), (require(566) /* metro dependency 566: flux */).useStateFromStores([PromotionsStore], function() {
|
||||
return PromotionsStore.consumedInboundPromotionId;
|
||||
}), a2, a0, a1, a3]);
|
||||
}
|
||||
|
||||
function useOutboundPromotions() { // fn#58741, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7463:754, offset: 0x016d5f45, size: 564 bytes, params: 1, frame: 26
|
||||
var r4;
|
||||
const lastFetchedActivePromotions = (require(566) /* metro dependency 566: flux */).useStateFromStores([PromotionsStore],
|
||||
function() {
|
||||
return PromotionsStore.lastFetchedActivePromotions;
|
||||
});
|
||||
const currentUser = (require(566) /* metro dependency 566: flux */).useStateFromStores([UserStore], function() {
|
||||
return UserStore.getCurrentUser();
|
||||
});
|
||||
const value2 = (require(7287) /* metro dependency 7287: PremiumSubscriptionTrialUtil */).useHasActiveTrial();
|
||||
const value3 = (require(566) /* metro dependency 566: flux */).useStateFromStores([UserOfferStore], function() {
|
||||
return UserOfferStore.hasAnyUnexpiredOffer();
|
||||
});
|
||||
const value4 = (require(7288) /* metro dependency 7288: ReverseTrialUtilsNative */).useIsInReverseTrial();
|
||||
const defaultImport = importDefault(3802) /* metro dependency 3802: PremiumUtils */;
|
||||
const isPremiumExactly = defaultImport.isPremiumExactly;
|
||||
const TIER_2 = PremiumTypes.TIER_2;
|
||||
const isPremiumExactly2 = Reflect.apply(isPremiumExactly, defaultImport, [currentUser, TIER_2]);
|
||||
const isPremium2 = defaultImport.isPremium(currentUser);
|
||||
let r5 = isPremium2 ? isPremiumExactly2 : !isPremium2;
|
||||
const claimedOutboundPromotionCodes = (require(566) /* metro dependency 566: flux */).useStateFromStores([PromotionsStore],
|
||||
function() {
|
||||
return PromotionsStore.claimedOutboundPromotionCodes;
|
||||
});
|
||||
const env0_3 = claimedOutboundPromotionCodes;
|
||||
const claimedOutboundPromotionCodesLoaded = (require(566) /* metro dependency 566: flux */).useStateFromStores([PromotionsStore],
|
||||
function() {
|
||||
return PromotionsStore.claimedOutboundPromotionCodesLoaded;
|
||||
});
|
||||
env0_3.useEffect(_fun58747, [lastFetchedActivePromotions, value4]);
|
||||
env0_3.useEffect(_fun58749, [lastFetchedActivePromotions, r5, value4]);
|
||||
env0_3.useEffect(_fun58751, []);
|
||||
const value6 = env0_3.useMemo(_fun58753, [claimedOutboundPromotionCodes]);
|
||||
const value7 = useEligibleActiveOutboundPromotions(value2, value3, value4, value6);
|
||||
const value = env0_3.useMemo(_fun58754, [value7, claimedOutboundPromotionCodes]);
|
||||
if (claimedOutboundPromotionCodesLoaded) {
|
||||
r5 = r5 ? lastFetchedActivePromotions != null : !r5;
|
||||
r5 = !r5 ? value4 : r5;
|
||||
r4 = r5;
|
||||
} else {
|
||||
r4 = claimedOutboundPromotionCodesLoaded;
|
||||
}
|
||||
return {promotionsLoaded: r4, activeOutboundPromotions: value7, claimedEndedOutboundPromotions: value,
|
||||
claimedOutboundPromotionCodeMap: value6};
|
||||
}
|
||||
|
||||
function useUnseenOutboundPromotions() { // fn#58757, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7463:2111, offset: 0x016d6428, size: 208 bytes, params: 1, frame: 23
|
||||
const fluxModule = require(566) /* metro dependency 566: flux */;
|
||||
let useStateFromStores = fluxModule.useStateFromStores;
|
||||
const lastSeenOutboundPromotionStartDate = Reflect.apply(useStateFromStores, fluxModule, [[PromotionsStore],
|
||||
function() {
|
||||
return PromotionsStore.lastSeenOutboundPromotionStartDate;
|
||||
}]);
|
||||
const value2 = (require(7287) /* metro dependency 7287: PremiumSubscriptionTrialUtil */).useHasActiveTrial();
|
||||
const moduleValue3 = fluxModule;
|
||||
useStateFromStores = moduleValue3.useStateFromStores;
|
||||
const value5 = useEligibleActiveOutboundPromotions(value2, Reflect.apply(useStateFromStores, moduleValue3,
|
||||
[[UserOfferStore], function() {
|
||||
return UserOfferStore.hasAnyUnexpiredOffer();
|
||||
}]), (require(7288) /* metro dependency 7288: ReverseTrialUtilsNative */).useIsInReverseTrial(), {});
|
||||
const binding = env0_3;
|
||||
const useMemo = binding.useMemo;
|
||||
return Reflect.apply(useMemo, binding, [_fun58760, [value5, lastSeenOutboundPromotionStartDate]]).filter(_fun58762);
|
||||
}
|
||||
|
||||
function useBogoPromotion() { // fn#58763, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7463:2569, offset: 0x016d65a6, size: 64 bytes, params: 1, frame: 14
|
||||
const fluxModule = require(566) /* metro dependency 566: flux */;
|
||||
const useStateFromStores = fluxModule.useStateFromStores;
|
||||
return {promotion: Reflect.apply(useStateFromStores, fluxModule, [[PromotionsStore], function() {
|
||||
return PromotionsStore.bogoPromotion;
|
||||
}])};
|
||||
}
|
||||
|
||||
function _fun58739() { // fn#58739, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7463:370, offset: 0x016d5e76, size: 26 bytes, params: 1, frame: 11
|
||||
return env0_4.filter(_fun58740);
|
||||
}
|
||||
|
||||
function _fun58747() { // fn#58747, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7463:1276, offset: 0x016d61cd, size: 70 bytes, params: 1, frame: 11
|
||||
var environment;
|
||||
var value;
|
||||
if (lastFetchedActivePromotions != null || env0_1) {
|
||||
value = environment.__proto__;
|
||||
value = importDefault(694) /* metro dependency 694: Dispatcher */;
|
||||
value.wait(_fun58748);
|
||||
}
|
||||
}
|
||||
|
||||
function _fun58749() { // fn#58749, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7463:1376, offset: 0x016d6238, size: 45 bytes, params: 1, frame: 12
|
||||
var environment;
|
||||
const value = environment.__proto__;
|
||||
(importDefault(694) /* metro dependency 694: Dispatcher */).wait(_fun58750);
|
||||
}
|
||||
|
||||
function _fun58751() { // fn#58751, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7463:1478, offset: 0x016d62ad, size: 45 bytes, params: 1, frame: 12
|
||||
var environment;
|
||||
const value = environment.__proto__;
|
||||
(importDefault(694) /* metro dependency 694: Dispatcher */).wait(_fun58752);
|
||||
}
|
||||
|
||||
function _fun58753() { // fn#58753, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7463:1575, offset: 0x016d62ff, size: 45 bytes, params: 1, frame: 11
|
||||
const value = environment.__proto__;
|
||||
return (require(7286) /* metro dependency 7286: PromotionUtils */).getClaimedOutboundPromotionCodeMap(claimedOutboundPromotionCodes);
|
||||
}
|
||||
|
||||
function _fun58754() { // fn#58754, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7463:1691, offset: 0x016d632c, size: 77 bytes, params: 1, frame: 14
|
||||
const Set = global.Set;
|
||||
const set = new Set(env0_4.map(function(a0) {
|
||||
return a0.id;
|
||||
}));
|
||||
return claimedOutboundPromotionCodes.filter(_fun58756);
|
||||
}
|
||||
|
||||
function _fun58760() { // fn#58760, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7463:2412, offset: 0x016d6507, size: 42 bytes, params: 1, frame: 12
|
||||
return lastSeenOutboundPromotionStartDate == null ? env0_1 : env0_1.filter(function({startDate}) {
|
||||
var Date = global.Date;
|
||||
var value2 = new Date(startDate);
|
||||
startDate = global.Date;
|
||||
var lastSeenOutboundPromotionStartDateBinding = lastSeenOutboundPromotionStartDate;
|
||||
var value4 = Object.create(startDate.prototype, {constructor: {value: startDate}});
|
||||
var value5 = new startDate(lastSeenOutboundPromotionStartDateBinding);
|
||||
return value2 > (value5 instanceof Object ? value5 : value4);
|
||||
});
|
||||
}
|
||||
|
||||
function _fun58762(a0) { // fn#58762, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7463:2495, offset: 0x016d657d, size: 41 bytes, params: 2, frame: 11
|
||||
const value = environment.__proto__;
|
||||
return (require(7286) /* metro dependency 7286: PromotionUtils */).shouldShowOutboundPromotionOnPlatform(a0);
|
||||
}
|
||||
|
||||
function _fun58740(a0) { // fn#58740, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7463:384, offset: 0x016d5e90, size: 181 bytes, params: 2, frame: 20
|
||||
var r4;
|
||||
var r3;
|
||||
var r2;
|
||||
var r1;
|
||||
var r0;
|
||||
var value3;
|
||||
var shouldShowOutboundPromotionOnPlatform2;
|
||||
var isLogitechPromotion2;
|
||||
const id = a0.id;
|
||||
const value = environment.__proto__;
|
||||
const value2 = id !== consumedInboundPromotionId;
|
||||
if (value2) {
|
||||
value3 = environment.__proto__.__proto__;
|
||||
shouldShowOutboundPromotionOnPlatform2 = (require(7286) /* metro dependency 7286: PromotionUtils */).shouldShowOutboundPromotionOnPlatform(a0);
|
||||
if (shouldShowOutboundPromotionOnPlatform2) {
|
||||
if (importDefault) {
|
||||
r2 = !importDefault;
|
||||
} else {
|
||||
isLogitechPromotion2 = (require(7286) /* metro dependency 7286: PromotionUtils */).isLogitechPromotion(a0);
|
||||
if (isLogitechPromotion2) {
|
||||
r3 = !isLogitechPromotion2;
|
||||
} else {
|
||||
r4 = !env1_0 && !require;
|
||||
r4 = !r4 ? (require(7286) /* metro dependency 7286: PromotionUtils */).isTrialUserEligibleToSeeOutboundPromotion(a0,
|
||||
|
||||
|
||||
|
||||
|
||||
importAll) : r4;
|
||||
r3 = r4;
|
||||
}
|
||||
r2 = r3;
|
||||
}
|
||||
r1 = r2;
|
||||
} else {
|
||||
r1 = !!shouldShowOutboundPromotionOnPlatform2;
|
||||
}
|
||||
r0 = r1;
|
||||
} else {
|
||||
r0 = value2;
|
||||
}
|
||||
return r0;
|
||||
}
|
||||
|
||||
function _fun58748() { // fn#58748, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7463:1310, offset: 0x016d6213, size: 37 bytes, params: 1, frame: 11
|
||||
const value = environment.__proto__.__proto__;
|
||||
return (importDefault(7289) /* metro dependency 7289: PromotionsActionCreators */).markOutboundPromotionsSeen();
|
||||
}
|
||||
|
||||
function _fun58750() { // fn#58750, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7463:1396, offset: 0x016d6265, size: 72 bytes, params: 1, frame: 12
|
||||
let value = environment.__proto__;
|
||||
if (env1_2 && (lastFetchedActivePromotions == null || env1_1)) {
|
||||
value = environment.__proto__.__proto__;
|
||||
value = importDefault(7289) /* metro dependency 7289: PromotionsActionCreators */;
|
||||
value.fetchActivePromotions();
|
||||
}
|
||||
}
|
||||
|
||||
function _fun58752() { // fn#58752, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7463:1498, offset: 0x016d62da, size: 37 bytes, params: 1, frame: 11
|
||||
const value = environment.__proto__.__proto__;
|
||||
(importDefault(7289) /* metro dependency 7289: PromotionsActionCreators */).fetchClaimedOutboundPromotionCodes();
|
||||
}
|
||||
|
||||
function _fun58756({promotion}) { // fn#58756, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7463:1749, offset: 0x016d6379, size: 175 bytes, params: 2, frame: 14
|
||||
var r0;
|
||||
const binding = env0_0;
|
||||
let value = binding.has(promotion.id);
|
||||
if (value) {
|
||||
r0 = !value;
|
||||
} else {
|
||||
value = environment.__proto__.__proto__;
|
||||
value = require(7286) /* metro dependency 7286: PromotionUtils */;
|
||||
value = value.isRecurringPromotion({promotionType: promotion.promotionType});
|
||||
value = value === false;
|
||||
r0 = value;
|
||||
}
|
||||
if (r0) {
|
||||
value = environment.__proto__.__proto__;
|
||||
value = require(7286) /* metro dependency 7286: PromotionUtils */;
|
||||
value = !value.isLogitechPromotion(promotion);
|
||||
r0 = value;
|
||||
}
|
||||
if (r0) {
|
||||
value = environment.__proto__.__proto__;
|
||||
value = require(7286) /* metro dependency 7286: PromotionUtils */;
|
||||
value = value.shouldShowOutboundPromotionOnPlatform(promotion);
|
||||
r0 = value;
|
||||
}
|
||||
return r0;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,144 @@
|
||||
/* Metro module 15811; source: modules/premium/promotions/PromotionsManager.tsx; dependencies: [5, 6, 7, 15, 17, 18, 1878, 1880, 661, 482, 3802, 7260, 7289, 4860, 2] */
|
||||
function _fun121506(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#121506, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16019:6, offset: 0x02549a94, size: 328 bytes, params: 8, frame: 19
|
||||
const env0_0 = require;
|
||||
const Object = global.Object;
|
||||
Object.defineProperty(exports, '__esModule', {value: true});
|
||||
const env0_3 = importDefault(5) /* metro dependency 5 */;
|
||||
const env0_4 = importDefault(6) /* metro dependency 6 */;
|
||||
const env0_5 = importDefault(7) /* metro dependency 7 */;
|
||||
const env0_6 = importDefault(15) /* metro dependency 15 */;
|
||||
const env0_7 = importDefault(17) /* metro dependency 17 */;
|
||||
const env0_8 = importDefault(18) /* metro dependency 18 */;
|
||||
const userStore = importDefault(1878) /* metro dependency 1878: UserStore */;
|
||||
const env0_10 = (require(1880) /* metro dependency 1880: PremiumConstants */).PremiumTypes;
|
||||
const env0_11 = (require(661) /* metro dependency 661: Constants */).EntitlementTypes;
|
||||
const env0_12 = (require(482) /* metro dependency 482: Constants */).SubscriptionTypes;
|
||||
let value = importDefault(4860) /* metro dependency 4860: AutomaticLifecycleManager */;
|
||||
value = _fun121510(value);
|
||||
value = new value();
|
||||
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/premium/promotions/PromotionsManager.tsx');
|
||||
exports.default = value;
|
||||
}
|
||||
|
||||
function _isNativeReflectConstruct_121507() { // fn#121507, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16019:246, offset: 0x02549bdc, size: 98 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_121507_isNativeReflectConstruct = function() {
|
||||
return !!result;
|
||||
})();
|
||||
}
|
||||
|
||||
function _fun121510(a0) { // fn#121510, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16019:445, offset: 0x02549c3e, size: 196 bytes, params: 2, frame: 16
|
||||
const closure = PromotionsManager;
|
||||
env0_8(closure, a0);
|
||||
const binding = env0_5;
|
||||
const env0_0 = env0_3(_fun121515);
|
||||
return binding(closure, [{key: 'onPostConnectionOpen', value: value_121516}, {key: 'onSubscriptionUpdated',
|
||||
value: value_121517}, {key: 'onMobilePurchaseSuccess', value: value_121518}, {key: 'onOfferUpdated',
|
||||
value: value_121519}, {key: 'onVCRedeemed', value: value_121520}]);
|
||||
}
|
||||
|
||||
function PromotionsManager(a0) { // fn#121511, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16019:457, offset: 0x02549d02, size: 334 bytes, params: 2, frame: 20
|
||||
var r0;
|
||||
var Reflect;
|
||||
let value = copyRestArgs(0, undefined);
|
||||
let binding = env1_4;
|
||||
binding(this, PromotionsManager);
|
||||
let object = [];
|
||||
arraySpread(object, value, 0, object);
|
||||
value = env1_7(PromotionsManager);
|
||||
binding = env1_6;
|
||||
if (_isNativeReflectConstruct_121507()) {
|
||||
Reflect = global.Reflect;
|
||||
value = Reflect.construct(value, object, env1_7(this).constructor);
|
||||
r0 = value;
|
||||
} else {
|
||||
value = value.apply(this, object);
|
||||
r0 = value;
|
||||
}
|
||||
value = binding(this, r0);
|
||||
object = {};
|
||||
object.POST_CONNECTION_OPEN = value.onPostConnectionOpen.bind(value);
|
||||
object.EXPERIMENTS_FETCH_SUCCESS = value.onPostConnectionOpen.bind(value);
|
||||
object.BILLING_SUBSCRIPTION_UPDATE_SUCCESS = value.onSubscriptionUpdated.bind(value);
|
||||
object.IAP_PURCHASE_PRODUCT_SUCCESS = value.onMobilePurchaseSuccess.bind(value);
|
||||
object.GPLAY_PURCHASE_VERIFIED = value.onMobilePurchaseSuccess.bind(value);
|
||||
object.BILLING_USER_OFFER_ACKNOWLEDGED_SUCCESS = value.onOfferUpdated.bind(value);
|
||||
object.BILLING_USER_TRIAL_OFFER_ACKNOWLEDGED_SUCCESS = value.onOfferUpdated.bind(value);
|
||||
object.VIRTUAL_CURRENCY_REDEEM_SUCCESS = value.onVCRedeemed.bind(value);
|
||||
value.actions = object;
|
||||
value.maybeFetchBogoPromotion = env1_3(_fun121513);
|
||||
return value;
|
||||
}
|
||||
|
||||
function* _fun121515() { // fn#121515, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16019:1445, offset: 0x02549edd, size: 74 bytes, params: 1, frame: 13
|
||||
if (true) {
|
||||
value = environment.__proto__.__proto__;
|
||||
env2_0(env2_2[12]).maybeFetchActivePromotions();
|
||||
yield this.maybeFetchBogoPromotion();
|
||||
}
|
||||
}
|
||||
|
||||
function value_121517({subscription}) { // fn#121517, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16019:1636, offset: 0x02549f27, size: 70 bytes, params: 2, frame: 11
|
||||
const type = subscription.type;
|
||||
const value = environment.__proto__;
|
||||
const PREMIUM = SubscriptionTypes.PREMIUM;
|
||||
if (type === PREMIUM) {
|
||||
(require(7289) /* metro dependency 7289: PromotionsActionCreators */).maybeFetchActivePromotions(false);
|
||||
}
|
||||
}
|
||||
|
||||
function value_121518() { // fn#121518, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16019:1762, offset: 0x02549f6d, size: 40 bytes, params: 1, frame: 12
|
||||
const value = environment.__proto__;
|
||||
(require(7289) /* metro dependency 7289: PromotionsActionCreators */).maybeFetchActivePromotions(false);
|
||||
}
|
||||
|
||||
function value_121520({entitlements}) { // fn#121520, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16019:1922, offset: 0x02549f95, size: 74 bytes, params: 2, frame: 11
|
||||
var environment;
|
||||
var value;
|
||||
if (entitlements.some(function({type}) {
|
||||
return type === EntitlementTypes.FRACTIONAL_REDEMPTION;
|
||||
})) {
|
||||
value = environment.__proto__;
|
||||
value = require(7289) /* metro dependency 7289: PromotionsActionCreators */;
|
||||
value.maybeFetchActivePromotions(false);
|
||||
}
|
||||
}
|
||||
|
||||
function* _fun121513() { // fn#121513, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16019:1224, offset: 0x02549e5b, size: 119 bytes, params: 1, frame: 16
|
||||
if (true) {
|
||||
value = environment.__proto__.__proto__.__proto__;
|
||||
var currentUser = env3_9.getCurrentUser();
|
||||
var value4 = env3_1(env3_2[10]);
|
||||
var isPremiumExactly = value4.isPremiumExactly;
|
||||
var TIER_2 = env3_10.TIER_2;
|
||||
if (Reflect.apply(isPremiumExactly, value4, [currentUser, TIER_2])) {
|
||||
return undefined;
|
||||
}
|
||||
value = env3_0(env3_2[11]);
|
||||
yield value.maybeFetchActiveBogoPromotion();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,400 @@
|
||||
/* Metro module 7261; source: modules/premium/promotions/PromotionsStore.tsx; dependencies: [6, 7, 15, 17, 18, 1348, 7262, 7264, 7263, 566, 694, 2] */
|
||||
function _fun58330(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#58330, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7439:6, offset: 0x016c5417, size: 625 bytes, params: 8, frame: 21
|
||||
const env0_0 = require;
|
||||
const closure = createEmptyPromotionsByType;
|
||||
const initializeFromUserSettings_58336 = function() {
|
||||
var r3;
|
||||
var property = UserSettingsProtoStore.settings.userContent;
|
||||
var value2 = null;
|
||||
var value3 = undefined;
|
||||
r3 = value2 == property || value2 == property.lastDismissedOutboundPromotionStartDate ? value3 : property.lastDismissedOutboundPromotionStartDate.value;
|
||||
env0_17 = value2 != r3 ? r3 : value2;
|
||||
return value3;
|
||||
};
|
||||
const Object = global.Object;
|
||||
Object.defineProperty(exports, '__esModule', {value: true});
|
||||
const env0_2 = importDefault(6) /* metro dependency 6 */;
|
||||
const env0_3 = importDefault(7) /* metro dependency 7 */;
|
||||
const env0_4 = importDefault(15) /* metro dependency 15 */;
|
||||
const env0_5 = importDefault(17) /* metro dependency 17 */;
|
||||
const env0_6 = importDefault(18) /* metro dependency 18 */;
|
||||
const userSettingsProtoStore = importDefault(1348) /* metro dependency 1348: UserSettingsProtoStore */;
|
||||
const promotionRecord = importDefault(7262) /* metro dependency 7262: PromotionRecord */;
|
||||
const marketingComponentRecord = importDefault(7264) /* metro dependency 7264: MarketingComponentRecord */;
|
||||
const env0_10 = {'hasFetchedConsumedInboundPromotionId': false, 'consumedInboundPromotionId': null,
|
||||
'lastSeenOutboundPromotionStartDate': null};
|
||||
let env0_16 = closure();
|
||||
let Map = global.Map;
|
||||
let map = new Map();
|
||||
let env0_19 = [];
|
||||
const PersistedStore = (importDefault(566) /* metro dependency 566: flux */).PersistedStore;
|
||||
map = _fun58337(PersistedStore);
|
||||
map.displayName = 'PromotionsStore';
|
||||
map.persistKey = 'PromotionsPersistedStore';
|
||||
map.migrations = [function(a0) {
|
||||
var error;
|
||||
try {
|
||||
delete a0.bogoPromotion;
|
||||
} catch (error) {
|
||||
}
|
||||
return a0;
|
||||
}];
|
||||
map = new map(importDefault(694) /* metro dependency 694: Dispatcher */,
|
||||
{ACTIVE_PROMOTIONS_FETCH_SUCCESS: ACTIVE_PROMOTIONS_FETCH_SUCCESS, ACTIVE_PROMOTIONS_FETCH: function() {
|
||||
env0_14 = true;
|
||||
}, ACTIVE_PROMOTIONS_FETCH_FAIL: function() {
|
||||
env0_16 = createEmptyPromotionsByType();
|
||||
var Map = global.Map;
|
||||
var value3 = new Map();
|
||||
env0_14 = false;
|
||||
}, ACTIVE_PROMOTIONS_CLEAR: function() {
|
||||
env0_16 = createEmptyPromotionsByType();
|
||||
var value3 = new global.Map();
|
||||
env0_11 = null;
|
||||
env0_14 = false;
|
||||
env0_15 = global.Date.now();
|
||||
}, ACTIVE_BOGO_PROMOTION_FETCH_SUCCESS: function({activePromotion}) {
|
||||
var object = {id: activePromotion.id};
|
||||
object.startDate = activePromotion.startDate.toISOString();
|
||||
activePromotion = activePromotion.endDate;
|
||||
object.endDate = activePromotion.toISOString();
|
||||
env0_11 = object;
|
||||
env0_13 = global.Date.now();
|
||||
env0_12 = false;
|
||||
}, ACTIVE_BOGO_PROMOTION_FETCH: function() {
|
||||
env0_12 = true;
|
||||
}, ACTIVE_BOGO_PROMOTION_FETCH_FAIL: function() {
|
||||
env0_11 = null;
|
||||
env0_12 = false;
|
||||
}, OUTBOUND_PROMOTION_NOTICE_DISMISS: OUTBOUND_PROMOTION_NOTICE_DISMISS,
|
||||
OUTBOUND_PROMOTIONS_SEEN: OUTBOUND_PROMOTIONS_SEEN,
|
||||
CLAIMED_OUTBOUND_PROMOTION_CODES_FETCH_SUCCESS: function(a0) {
|
||||
env0_19 = a0.claimedOutboundPromotionCodes;
|
||||
env0_20 = true;
|
||||
}, CLAIMED_OUTBOUND_PROMOTION_CODES_FETCH_FAIL: function() {
|
||||
env0_19 = [];
|
||||
env0_20 = true;
|
||||
}, CLAIMED_OUTBOUND_PROMOTION_CODE_ADD: CLAIMED_OUTBOUND_PROMOTION_CODE_ADD, LOGOUT: LOGOUT_58382,
|
||||
PREMIUM_MARKETING_PREVIEW: PREMIUM_MARKETING_PREVIEW});
|
||||
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/premium/promotions/PromotionsStore.tsx');
|
||||
exports.default = map;
|
||||
}
|
||||
|
||||
function _isNativeReflectConstruct_58331() { // fn#58331, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7439:178, offset: 0x016c5688, 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_58331_isNativeReflectConstruct = function() {
|
||||
return !!result;
|
||||
})();
|
||||
}
|
||||
|
||||
function createEmptyPromotionsByType() { // fn#58334, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7439:491, offset: 0x016c56e6, size: 244 bytes, params: 1, frame: 15
|
||||
const {THIRD_PARTY, BOGO, THIRD_PARTY_DIRECT_FULFILLMENT, MARKETING_MOMENT, THIRD_PARTY_INBOUND,
|
||||
THIRD_PARTY_OUTBOUND, GIFT_PROMOTION,
|
||||
THIRD_PARTY_OUTBOUND_RECURRING} = (require(7263) /* metro dependency 7263: constants */).PromotionTypes;
|
||||
return {[THIRD_PARTY]: {}, [BOGO]: {}, [THIRD_PARTY_DIRECT_FULFILLMENT]: {}, [MARKETING_MOMENT]: {},
|
||||
[THIRD_PARTY_INBOUND]: {}, [THIRD_PARTY_OUTBOUND]: {}, [GIFT_PROMOTION]: {},
|
||||
[THIRD_PARTY_OUTBOUND_RECURRING]: {}};
|
||||
}
|
||||
|
||||
function getLatestActiveOutboundPromotionStartDate() { // fn#58335, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7439:1008, offset: 0x016c57da, size: 161 bytes, params: 1, frame: 17
|
||||
var r4;
|
||||
var r5;
|
||||
var r7;
|
||||
var r3;
|
||||
var property;
|
||||
var value5;
|
||||
var startDate;
|
||||
var value6;
|
||||
var value7;
|
||||
const Object = global.Object;
|
||||
const values = Object.values;
|
||||
const binding = env0_16;
|
||||
const value = undefined;
|
||||
const PromotionTypes = (require(7263) /* metro dependency 7263: constants */).PromotionTypes;
|
||||
const THIRD_PARTY_OUTBOUND = PromotionTypes.THIRD_PARTY_OUTBOUND;
|
||||
const value2 = Reflect.apply(values, Object, [binding[THIRD_PARTY_OUTBOUND]]);
|
||||
let length = value2.length;
|
||||
const value3 = 0;
|
||||
const value4 = null;
|
||||
if (value3 < length) {
|
||||
r4 = value4;
|
||||
r5 = value3;
|
||||
while (true) {
|
||||
property = value2[r5];
|
||||
value5 = value4 == r4;
|
||||
if (value5) {
|
||||
r7 = value5;
|
||||
} else {
|
||||
value6 = property.startDate > r4;
|
||||
r7 = value6;
|
||||
}
|
||||
if (!r7) {
|
||||
continue;
|
||||
}
|
||||
startDate = property.startDate;
|
||||
r4 = startDate;
|
||||
value7 = typeof r5 === 'bigint' ? r5 + 1n : +r5 + 1;
|
||||
length = value2.length;
|
||||
if (value7 < length) {
|
||||
r5 = value7;
|
||||
continue;
|
||||
}
|
||||
r3 = r4;
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
r3 = value4;
|
||||
}
|
||||
const r1 = value4 == r3 ? value : r3.toISOString();
|
||||
return value4 != r1 ? r1 : value4;
|
||||
}
|
||||
|
||||
function _fun58337(a0) { // fn#58337, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7439:1448, offset: 0x016c58c1, size: 617 bytes, params: 2, frame: 16
|
||||
const closure = PromotionsStore;
|
||||
env0_6(closure, a0);
|
||||
return env0_3(closure, [{key: 'initialize', value: value_58339}, {key: 'outboundPromotions', get: get_58340},
|
||||
{key: 'outboundRecurringPromotions', get: get_58341}, {key: 'lastSeenOutboundPromotionStartDate',
|
||||
get: get_58342}, {key: 'lastDismissedOutboundPromotionStartDate', get: get_58343},
|
||||
{key: 'lastFetchedActivePromotions', get: get_58344}, {key: 'isFetchingActivePromotions', get: get_58345},
|
||||
{key: 'hasFetchedConsumedInboundPromotionId', get: get_58346}, {key: 'consumedInboundPromotionId',
|
||||
get: get_58347}, {key: 'bogoPromotion', get: get_58348}, {key: 'isFetchingActiveBogoPromotion', get: get_58349},
|
||||
{key: 'lastFetchedActiveBogoPromotion', get: get_58350}, {key: 'promotionsByType', get: get_58351},
|
||||
{key: 'getPromotionByTypeAndId', value: value_58352}, {key: 'getPromotionByTypeAndKey', value: value_58353},
|
||||
{key: 'getState', value: value_58355}, {key: 'getMarketingComponentByType', value: value_58356},
|
||||
{key: 'getPromotionsByPartner', value: value_58357}, {key: 'getGiftPromotion', value: value_58360},
|
||||
{key: 'getGiftPromotionRewardSkuIds', value: function() {
|
||||
var r0;
|
||||
r0 = this.getGiftPromotion()?.rewardSkuIds;
|
||||
r0 = r0 ?? [];
|
||||
return r0;
|
||||
}}, {key: 'getMarketingMomentPromotion', value: value_58362}, {key: 'getMarketingMomentRewardSkuIds',
|
||||
value: function() {
|
||||
var r0;
|
||||
r0 = this.getMarketingMomentPromotion()?.rewardSkuIds;
|
||||
r0 = r0 ?? [];
|
||||
return r0;
|
||||
}}, {key: 'claimedOutboundPromotionCodes', get: get_58364}, {key: 'claimedOutboundPromotionCodesLoaded',
|
||||
get: get_58365}]);
|
||||
}
|
||||
|
||||
function ACTIVE_PROMOTIONS_FETCH_SUCCESS({promotions, consumedInboundPromotionId}) { // fn#58367, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7439:4393, offset: 0x016c5eab, size: 143 bytes, params: 2, frame: 15
|
||||
env0_16 = createEmptyPromotionsByType();
|
||||
const Map = global.Map;
|
||||
const map = new Map();
|
||||
promotions.forEach(_fun58368);
|
||||
const Date = global.Date;
|
||||
env0_15 = Date.now();
|
||||
if (!env0_10.hasFetchedConsumedInboundPromotionId) {
|
||||
env0_10.hasFetchedConsumedInboundPromotionId = true;
|
||||
env0_10.consumedInboundPromotionId = consumedInboundPromotionId;
|
||||
}
|
||||
}
|
||||
|
||||
function OUTBOUND_PROMOTION_NOTICE_DISMISS() { // fn#58376, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7439:5567, offset: 0x016c60b7, size: 98 bytes, params: 1, frame: 15
|
||||
const Object = global.Object;
|
||||
const values = Object.values;
|
||||
const binding = env0_16;
|
||||
const PromotionTypes = (require(7263) /* metro dependency 7263: constants */).PromotionTypes;
|
||||
const THIRD_PARTY_OUTBOUND = PromotionTypes.THIRD_PARTY_OUTBOUND;
|
||||
if (Reflect.apply(values, Object, [binding[THIRD_PARTY_OUTBOUND]]).length === 0) {
|
||||
return false;
|
||||
}
|
||||
if (getLatestActiveOutboundPromotionStartDate() == null) {
|
||||
}
|
||||
}
|
||||
|
||||
function OUTBOUND_PROMOTIONS_SEEN() { // fn#58377, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7439:5791, offset: 0x016c6119, size: 108 bytes, params: 1, frame: 15
|
||||
const Object = global.Object;
|
||||
const values = Object.values;
|
||||
const binding = env0_16;
|
||||
const PromotionTypes = (require(7263) /* metro dependency 7263: constants */).PromotionTypes;
|
||||
const THIRD_PARTY_OUTBOUND = PromotionTypes.THIRD_PARTY_OUTBOUND;
|
||||
if (Reflect.apply(values, Object, [binding[THIRD_PARTY_OUTBOUND]]).length === 0) {
|
||||
return false;
|
||||
}
|
||||
const latestActiveOutboundPromotionStartDate = getLatestActiveOutboundPromotionStartDate();
|
||||
if (latestActiveOutboundPromotionStartDate != null) {
|
||||
env0_10.lastSeenOutboundPromotionStartDate = latestActiveOutboundPromotionStartDate;
|
||||
}
|
||||
}
|
||||
|
||||
function CLAIMED_OUTBOUND_PROMOTION_CODE_ADD({claimedOutboundPromotionCode}) { // fn#58380, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7439:6317, offset: 0x016c61b4, size: 82 bytes, params: 2, frame: 15
|
||||
const binding = env0_19;
|
||||
if (binding.some(function(a0) {
|
||||
return a0.promotion.id === claimedOutboundPromotionCode.promotion.id;
|
||||
})) {
|
||||
return false;
|
||||
}
|
||||
const binding2 = env0_19;
|
||||
const items2 = [];
|
||||
const value2 = arraySpread(items2, binding2, 0, binding);
|
||||
items2[value2] = claimedOutboundPromotionCode;
|
||||
value2 + 1;
|
||||
}
|
||||
|
||||
function LOGOUT_58382() { // fn#58382, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7439:6478, offset: 0x016c622c, size: 87 bytes, params: 1, frame: 12
|
||||
env0_10 = {'hasFetchedConsumedInboundPromotionId': false, 'consumedInboundPromotionId': null,
|
||||
'lastSeenOutboundPromotionStartDate': null};
|
||||
env0_16 = createEmptyPromotionsByType();
|
||||
env0_18.clear();
|
||||
env0_19 = [];
|
||||
}
|
||||
|
||||
function PREMIUM_MARKETING_PREVIEW({data}) { // fn#58383, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7439:6728, offset: 0x016c6283, size: 51 bytes, params: 2, frame: 13
|
||||
const fromServer = MarketingComponentRecord.createFromServer(data);
|
||||
const binding = env0_18;
|
||||
binding.set(fromServer.componentType, fromServer);
|
||||
}
|
||||
|
||||
function value_58339(a0) { // fn#58339, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7439:1753, offset: 0x016c5b2a, size: 69 bytes, params: 2, frame: 14
|
||||
var value;
|
||||
if (a0 != null) {
|
||||
value = environment.__proto__;
|
||||
env1_10 = a0;
|
||||
}
|
||||
this.waitFor(UserSettingsProtoStore);
|
||||
this.syncWith([UserSettingsProtoStore], initializeFromUserSettings_58336);
|
||||
}
|
||||
|
||||
function get_58340() { // fn#58340, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7439:1874, offset: 0x016c5b6f, size: 65 bytes, params: 1, frame: 14
|
||||
const Object = global.Object;
|
||||
const values = Object.values;
|
||||
const binding = env1_16;
|
||||
const PromotionTypes = (require(7263) /* metro dependency 7263: constants */).PromotionTypes;
|
||||
const THIRD_PARTY_OUTBOUND = PromotionTypes.THIRD_PARTY_OUTBOUND;
|
||||
return Reflect.apply(values, Object, [binding[THIRD_PARTY_OUTBOUND]]);
|
||||
}
|
||||
|
||||
function get_58341() { // fn#58341, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7439:1995, offset: 0x016c5bb0, size: 65 bytes, params: 1, frame: 14
|
||||
const Object = global.Object;
|
||||
const values = Object.values;
|
||||
const binding = env1_16;
|
||||
const PromotionTypes = (require(7263) /* metro dependency 7263: constants */).PromotionTypes;
|
||||
const THIRD_PARTY_OUTBOUND_RECURRING = PromotionTypes.THIRD_PARTY_OUTBOUND_RECURRING;
|
||||
return Reflect.apply(values, Object, [binding[THIRD_PARTY_OUTBOUND_RECURRING]]);
|
||||
}
|
||||
|
||||
function get_58342() { // fn#58342, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7439:2133, offset: 0x016c5bf1, size: 15 bytes, params: 1, frame: 1
|
||||
return env1_10.lastSeenOutboundPromotionStartDate;
|
||||
}
|
||||
|
||||
function get_58346() { // fn#58346, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7439:2432, offset: 0x016c5c00, size: 15 bytes, params: 1, frame: 1
|
||||
return env1_10.hasFetchedConsumedInboundPromotionId;
|
||||
}
|
||||
|
||||
function get_58347() { // fn#58347, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7439:2529, offset: 0x016c5c0f, size: 15 bytes, params: 1, frame: 1
|
||||
return env1_10.consumedInboundPromotionId;
|
||||
}
|
||||
|
||||
function value_58352(a0, a1) { // fn#58352, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7439:2839, offset: 0x016c5c1e, size: 34 bytes, params: 3, frame: 3
|
||||
const value = environment.__proto__;
|
||||
return env1_16[a0]?.[a1];
|
||||
}
|
||||
|
||||
function value_58353(a0, a1) { // fn#58353, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7439:2933, offset: 0x016c5c40, size: 59 bytes, params: 3, frame: 13
|
||||
var environment;
|
||||
const env0_0 = a1;
|
||||
const Object = global.Object;
|
||||
const values = Object.values;
|
||||
const value = environment.__proto__;
|
||||
return Reflect.apply(values, Object, [env1_16[a0]]).find(function({promotionKey}) {
|
||||
return promotionKey === require;
|
||||
});
|
||||
}
|
||||
|
||||
function value_58356(a0) { // fn#58356, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7439:3091, offset: 0x016c5c91, size: 34 bytes, params: 2, frame: 11
|
||||
let value = environment.__proto__;
|
||||
value = env1_18.get(a0);
|
||||
const value2 = null;
|
||||
return value2 != value ? value : value2;
|
||||
}
|
||||
|
||||
function value_58357(a0) { // fn#58357, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7439:3180, offset: 0x016c5cb3, size: 165 bytes, params: 2, frame: 20
|
||||
var environment;
|
||||
const env0_0 = a0;
|
||||
const object2 = {};
|
||||
let Object = global.Object;
|
||||
let values = Object.values;
|
||||
const value = environment.__proto__;
|
||||
let binding = env1_16;
|
||||
const PromotionTypes = (require(7263) /* metro dependency 7263: constants */).PromotionTypes;
|
||||
const THIRD_PARTY_OUTBOUND = PromotionTypes.THIRD_PARTY_OUTBOUND;
|
||||
object2.oneTime = Reflect.apply(values, Object, [binding[THIRD_PARTY_OUTBOUND]]).filter(_fun58358);
|
||||
Object = global.Object;
|
||||
values = Object.values;
|
||||
binding = env1_16;
|
||||
const THIRD_PARTY_OUTBOUND_RECURRING = PromotionTypes.THIRD_PARTY_OUTBOUND_RECURRING;
|
||||
object2.recurring = Reflect.apply(values, Object, [binding[THIRD_PARTY_OUTBOUND_RECURRING]]).filter(_fun58359);
|
||||
return object2;
|
||||
}
|
||||
|
||||
function value_58360() { // fn#58360, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7439:3442, offset: 0x016c5d6e, size: 86 bytes, params: 1, frame: 13
|
||||
let value = environment.__proto__;
|
||||
const binding = env1_16;
|
||||
const PromotionTypes = (require(7263) /* metro dependency 7263: constants */).PromotionTypes;
|
||||
const GIFT_PROMOTION = PromotionTypes.GIFT_PROMOTION;
|
||||
const property = binding[GIFT_PROMOTION];
|
||||
const Object = global.Object;
|
||||
value = Object.keys(property);
|
||||
return value.length === 0 ? null : property[value[0]];
|
||||
}
|
||||
|
||||
function value_58362() { // fn#58362, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7439:3734, offset: 0x016c5dec, size: 132 bytes, params: 1, frame: 13
|
||||
let value = environment.__proto__;
|
||||
const binding = env1_16;
|
||||
const PromotionTypes = (require(7263) /* metro dependency 7263: constants */).PromotionTypes;
|
||||
const MARKETING_MOMENT = PromotionTypes.MARKETING_MOMENT;
|
||||
let property = binding[MARKETING_MOMENT];
|
||||
const Object = global.Object;
|
||||
value = Object.keys(property);
|
||||
if (value.length === 0) {
|
||||
return null;
|
||||
}
|
||||
property = property[value[0]];
|
||||
const endDate = property.endDate;
|
||||
const Date = global.Date;
|
||||
let date = new Date();
|
||||
date = null;
|
||||
return endDate < date ? date : property;
|
||||
}
|
||||
|
||||
function _fun58368(a0) { // fn#58368, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7439:4535, offset: 0x016c5f3a, size: 77 bytes, params: 2, frame: 12
|
||||
env1_16[a0.promotion_type][a0.id] = PromotionRecord.createFromServer(a0);
|
||||
const marketing_components = a0.marketing_components;
|
||||
if (marketing_components != null) {
|
||||
marketing_components.forEach(_fun58369);
|
||||
}
|
||||
}
|
||||
|
||||
function _fun58358({partnerId}) { // fn#58358, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7439:3277, offset: 0x016c5d58, size: 22 bytes, params: 2, frame: 2
|
||||
return partnerId === env0_0;
|
||||
}
|
||||
|
||||
function _fun58369(a0) { // fn#58369, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7439:4642, offset: 0x016c5f87, size: 46 bytes, params: 2, frame: 15
|
||||
const binding = env2_18;
|
||||
binding.set(a0.component_type, MarketingComponentRecord.createFromServer(a0));
|
||||
}
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
/* Metro module 7263; source: modules/premium/promotions/constants.tsx; dependencies: [2] */
|
||||
function _fun58396(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#58396, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7441:6, offset: 0x016c6ae9, size: 378 bytes, params: 8, frame: 17
|
||||
const Object = global.Object;
|
||||
Object.defineProperty(exports, '__esModule', {value: true});
|
||||
const object = {THIRD_PARTY: 0};
|
||||
object[0] = 'THIRD_PARTY';
|
||||
object.BOGO = 1;
|
||||
object[1] = 'BOGO';
|
||||
object.THIRD_PARTY_DIRECT_FULFILLMENT = 2;
|
||||
object[2] = 'THIRD_PARTY_DIRECT_FULFILLMENT';
|
||||
object.THIRD_PARTY_INBOUND = 3;
|
||||
object[3] = 'THIRD_PARTY_INBOUND';
|
||||
object.THIRD_PARTY_OUTBOUND = 4;
|
||||
object[4] = 'THIRD_PARTY_OUTBOUND';
|
||||
object.MARKETING_MOMENT = 5;
|
||||
object[5] = 'MARKETING_MOMENT';
|
||||
object.GIFT_PROMOTION = 6;
|
||||
object[6] = 'GIFT_PROMOTION';
|
||||
object.THIRD_PARTY_OUTBOUND_RECURRING = 7;
|
||||
object[7] = 'THIRD_PARTY_OUTBOUND_RECURRING';
|
||||
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/premium/promotions/constants.tsx');
|
||||
exports.CountryListMode = {BLOCKLIST: 'blocklist', ALLOWLIST: 'allowlist'};
|
||||
exports.PromotionTypes = object;
|
||||
exports.RECURRING_PARTNERS = {steelseries: {'id': 'steelseries', 'label': 'SteelSeries'},
|
||||
kontrolfreek: {'id': 'kontrolfreek', 'label': 'KontrolFreek'}, logitech: {'id': 'logitech',
|
||||
'label': 'Logitech'}};
|
||||
exports.STEELSERIES_PARTNER_ID = 'steelseries';
|
||||
exports.KONTROLFREEK_PARTNER_ID = 'kontrolfreek';
|
||||
exports.LOGITECH_PARTNER_ID = 'logitech';
|
||||
exports.XBOX_PARTNER_ID = 'xbox';
|
||||
exports.YOUTUBE_PARTNER_ID = 'youtube';
|
||||
}
|
||||
|
||||
@@ -0,0 +1,109 @@
|
||||
/* Metro module 15282; source: modules/premium/promotions/native/BogoPromotionActionSheet.tsx; dependencies: [31, 27, 4502, 1880, 661, 1376, 33, 4501, 697, 6771, 566, 7040, 6275, 5475, 4573, 1244, 6766, 1948, 4578, 7954, 2] */
|
||||
function _fun116900(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#116900, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15479:6, offset: 0x0249a932, size: 581 bytes, params: 8, frame: 23
|
||||
var object3;
|
||||
const env0_0 = require;
|
||||
const Object = global.Object;
|
||||
Object.defineProperty(exports, '__esModule', {value: true});
|
||||
const env0_3 = importAll(31) /* metro dependency 31 */;
|
||||
const env0_4 = (require(27) /* metro dependency 27 */).View;
|
||||
const accessibilityStore = importDefault(4502) /* metro dependency 4502: AccessibilityStore */;
|
||||
const env0_6 = (require(1880) /* metro dependency 1880: PremiumConstants */).PremiumTypes;
|
||||
let value = require(661) /* metro dependency 661: Constants */;
|
||||
const env0_7 = value.AnalyticsSections;
|
||||
const env0_8 = value.AnalyticsObjects;
|
||||
const env0_9 = value.AnalyticsPages;
|
||||
const env0_10 = value.AnalyticsObjectTypes;
|
||||
const env0_11 = value.HelpdeskArticles;
|
||||
const env0_12 = (require(1376) /* metro dependency 1376: DismissibleContentConstants */).ContentDismissActionType;
|
||||
value = require(33) /* metro dependency 33 */;
|
||||
const env0_13 = value.jsx;
|
||||
const env0_14 = value.jsxs;
|
||||
value = require(4501) /* metro dependency 4501: createStyles */;
|
||||
const createStyles = value.createStyles;
|
||||
object3 = {};
|
||||
const object4 = {'dipslay': 'flex', 'flexDirection': 'column', 'justifyContent': 'center', 'alignItems': 'center'};
|
||||
let PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
|
||||
object4.padding = PX_16;
|
||||
object4.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.lg;
|
||||
let PX_24 = (importDefault(697) /* metro dependency 697: native */).space.PX_24;
|
||||
object4.marginBottom = PX_24;
|
||||
object3.container = object4;
|
||||
PX_24 = (importDefault(697) /* metro dependency 697: native */).space.PX_24;
|
||||
object3.buttonContainer = {'marginTop': null, 'width': 335, 'height': 48, marginTop: PX_24};
|
||||
object3.header = {'marginBottom': 12, 'textAlign': 'center'};
|
||||
object3.subheader = {textAlign: 'center'};
|
||||
const object6 = {'alignSelf': 'center', 'paddingBottom': null, 'height': 213, 'width': 335, 'borderRadius': null,
|
||||
'marginBottom': 12};
|
||||
PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
|
||||
object6.paddingBottom = PX_16;
|
||||
object6.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.lg;
|
||||
object3.image = object6;
|
||||
object3.nitroWheelIcon = {'bottom': -1, 'width': 22, 'height': 16};
|
||||
const env0_15 = Reflect.apply(createStyles, value, [object3]);
|
||||
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/premium/promotions/native/BogoPromotionActionSheet.tsx');
|
||||
exports.default = BogoPromotionActionSheet;
|
||||
}
|
||||
|
||||
function BogoPromotionActionSheet({markAsDismissed}) { // fn#116901, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15479:969, offset: 0x0249ab77, size: 784 bytes, params: 2, frame: 33
|
||||
const styles = useStyles();
|
||||
const analyticsLocations = (importDefault(6771) /* metro dependency 6771: useAnalyticsLocations */)().analyticsLocations;
|
||||
const useReducedMotion = (require(566) /* metro dependency 566: flux */).useStateFromStores([AccessibilityStore],
|
||||
function() {
|
||||
return AccessibilityStore.useReducedMotion;
|
||||
});
|
||||
const binding = env0_3;
|
||||
const value2 = binding.useCallback(_fun116903, [analyticsLocations, markAsDismissed]);
|
||||
const value3 = binding.useCallback(function() {
|
||||
markAsDismissed(ContentDismissActionType.USER_DISMISS);
|
||||
}, [markAsDismissed]);
|
||||
const BottomSheet = (require(6275) /* metro dependency 6275: BottomSheetNative */).BottomSheet;
|
||||
const items7 = [styles.container];
|
||||
const items2 = [((Component) => <Component source={{uri: 'https://cdn.discordapp.com/assets/content/a59aed2e0e61a955dc3e0f4f6f7ab295e39f89a93c4f01e4bd84ed7fb418ec63.png'}} style={styles.image} />)(importDefault(5475) /* metro dependency 5475: FastImage */)];
|
||||
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
|
||||
const items3 = [styles.header];
|
||||
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
||||
let string = intl.string;
|
||||
items2[1] = <Text style={items3} color="mobile-text-heading-primary" variant="heading-xl/bold">{Reflect.apply(string,
|
||||
intl, [(require(1244) /* metro dependency 1244: indexNative */).t['6Jjfk8']])}</Text>;
|
||||
const TextWithIOSLinkWorkaround = (require(6766) /* metro dependency 6766: TextWithIOSLinkWorkaround */).TextWithIOSLinkWorkaround;
|
||||
const items4 = [styles.subheader];
|
||||
const format = intl.format;
|
||||
const y7lJK6 = (require(1244) /* metro dependency 1244: indexNative */).t.y7lJK6;
|
||||
const defaultImport2 = importDefault(1948) /* metro dependency 1948: HelpdeskUtils */;
|
||||
const getArticleURL = defaultImport2.getArticleURL;
|
||||
const SUMMER_BOGO_2025 = HelpdeskArticles.SUMMER_BOGO_2025;
|
||||
items2[2] = <TextWithIOSLinkWorkaround style={items4} color="text-subtle" variant="text-md/medium">{Reflect.apply(format,
|
||||
intl, [y7lJK6, {helpCenterLink: Reflect.apply(getArticleURL, defaultImport2,
|
||||
[SUMMER_BOGO_2025])}])}</TextWithIOSLinkWorkaround>;
|
||||
const items5 = [styles.buttonContainer];
|
||||
const Button = (require(4578) /* metro dependency 4578: ButtonNative */).Button;
|
||||
string = intl.string;
|
||||
const J61px0 = (require(1244) /* metro dependency 1244: indexNative */).t.J61px0;
|
||||
const NitroWheelIcon = (require(7954) /* metro dependency 7954: NitroWheelIcon */).NitroWheelIcon;
|
||||
const items6 = [styles.nitroWheelIcon];
|
||||
const WHITE = (importDefault(697) /* metro dependency 697: native */).unsafe_rawColors.WHITE;
|
||||
items2[3] = <View style={items5}><Button text={Reflect.apply(string, intl,
|
||||
[J61px0])} size="lg" onPress={value2} icon={<NitroWheelIcon style={items6} color={WHITE} size="custom" />} iconPosition="start" variant="experimental_premium-primary" shiny={!useReducedMotion} /></View>;
|
||||
return (
|
||||
<BottomSheet onDismiss={value3}>
|
||||
<View style={items7}>
|
||||
{items2}
|
||||
</View>
|
||||
</BottomSheet>
|
||||
);
|
||||
}
|
||||
|
||||
function _fun116903() { // fn#116903, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15479:1142, offset: 0x0249ae87, size: 147 bytes, params: 1, frame: 15
|
||||
const markAsDismissedBinding = markAsDismissed;
|
||||
const PRIMARY = ContentDismissActionType.PRIMARY;
|
||||
markAsDismissedBinding(PRIMARY);
|
||||
const defaultImport = importDefault(7040) /* metro dependency 7040: openPremiumPlanSelectionActionSheet */;
|
||||
const BOGO_PROMOTION_ACTION_SHEET = AnalyticsPages.BOGO_PROMOTION_ACTION_SHEET;
|
||||
const FOOTER = AnalyticsSections.FOOTER;
|
||||
const BUTTON_CTA = AnalyticsObjects.BUTTON_CTA;
|
||||
const BUY = AnalyticsObjectTypes.BUY;
|
||||
const TIER_2 = PremiumTypes.TIER_2;
|
||||
defaultImport({analyticsLocation: {page: BOGO_PROMOTION_ACTION_SHEET, section: FOOTER, object: BUTTON_CTA,
|
||||
objectType: BUY}, analyticsLocations: analyticsLocations, premiumType: TIER_2});
|
||||
}
|
||||
|
||||
@@ -0,0 +1,92 @@
|
||||
/* Metro module 7586; source: modules/premium/promotions/native/MarketingPageBannerTile.tsx; dependencies: [31, 27, 4502, 33, 4501, 697, 566, 6771, 7587, 8742, 480, 7583, 12169, 4573, 6766, 3853, 4578, 7954, 2] */
|
||||
function _fun60847(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#60847, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7764:6, offset: 0x017116bb, size: 516 bytes, params: 8, frame: 22
|
||||
var object2;
|
||||
const env0_0 = require;
|
||||
const Object = global.Object;
|
||||
Object.defineProperty(exports, '__esModule', {value: true});
|
||||
importAll(31) /* metro dependency 31 */;
|
||||
let value = require(27) /* metro dependency 27 */;
|
||||
const env0_3 = value.Image;
|
||||
const env0_4 = value.View;
|
||||
const accessibilityStore = importDefault(4502) /* metro dependency 4502: AccessibilityStore */;
|
||||
value = require(33) /* metro dependency 33 */;
|
||||
const env0_6 = value.jsx;
|
||||
const env0_7 = value.jsxs;
|
||||
value = require(4501) /* metro dependency 4501: createStyles */;
|
||||
const createStyles = value.createStyles;
|
||||
object2 = {};
|
||||
object2.container = {width: '100%'};
|
||||
const object5 = {'display': 'flex', 'width': '100%', 'flexDirection': 'column', 'justifyContent': 'flex-start'};
|
||||
let PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
|
||||
object5.padding = PX_16;
|
||||
object5.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.lg;
|
||||
const BACKGROUND_SECONDARY_ALT = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_SECONDARY_ALT;
|
||||
object5.backgroundColor = BACKGROUND_SECONDARY_ALT;
|
||||
object5.overflow = 'hidden';
|
||||
object2.card = object5;
|
||||
const object6 = {'width': '100%', 'maxWidth': 317, 'height': 144};
|
||||
object6.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.md;
|
||||
PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
|
||||
object6.marginBottom = PX_16;
|
||||
const PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
|
||||
object6.padding = PX_8;
|
||||
object6.alignSelf = 'center';
|
||||
object2.image = object6;
|
||||
const PX_4 = (importDefault(697) /* metro dependency 697: native */).space.PX_4;
|
||||
object2.bodyText = {marginTop: PX_4};
|
||||
PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
|
||||
object2.ctaButton = {marginTop: PX_16};
|
||||
object2.nitroWheelIcon = {'bottom': -1, 'width': 22, 'height': 16};
|
||||
const env0_8 = Reflect.apply(createStyles, value, [object2]);
|
||||
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/premium/promotions/native/MarketingPageBannerTile.tsx');
|
||||
exports.default = _default_60848;
|
||||
}
|
||||
|
||||
function _default_60848({style, cardStyle, componentId, bannerFields, analyticsPage, onPaymentSuccess, onPaymentDismiss}) { // fn#60848, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7764:730, offset: 0x017118bf, size: 988 bytes, params: 2, frame: 33
|
||||
var object2;
|
||||
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
|
||||
const styles = useStyles();
|
||||
const useReducedMotion = (require(566) /* metro dependency 566: flux */).useStateFromStores([AccessibilityStore],
|
||||
function() {
|
||||
return AccessibilityStore.useReducedMotion;
|
||||
});
|
||||
const buttonActionHandler = (require(7587) /* metro dependency 7587: PremiumMarketingButtonActions */).getButtonActionHandler({buttonAction: bannerFields.button?.buttonAction,
|
||||
analyticsLocations: (importDefault(6771) /* metro dependency 6771: useAnalyticsLocations */)().analyticsLocations,
|
||||
analyticsPage: analyticsPage, onPaymentSuccess: onPaymentSuccess, onPaymentDismiss: onPaymentDismiss});
|
||||
const defaultImport = importDefault(8742) /* metro dependency 8742: useTrackImpression */;
|
||||
object2 = {};
|
||||
const ImpressionTypes = (require(480) /* metro dependency 480: AnalyticsUtils */).ImpressionTypes;
|
||||
const VIEW = ImpressionTypes.VIEW;
|
||||
object2.type = VIEW;
|
||||
const ImpressionNames = (require(480) /* metro dependency 480: AnalyticsUtils */).ImpressionNames;
|
||||
const PREMIUM_MARKETING_COMPONENT = ImpressionNames.PREMIUM_MARKETING_COMPONENT;
|
||||
object2.name = PREMIUM_MARKETING_COMPONENT;
|
||||
const MarketingComponentType = (require(7583) /* metro dependency 7583: MarketingComponentType */).MarketingComponentType;
|
||||
const MARKETING_PAGE_BANNER = MarketingComponentType.MARKETING_PAGE_BANNER;
|
||||
object2.properties = {component_type: MARKETING_PAGE_BANNER, component_id: componentId};
|
||||
defaultImport(object2);
|
||||
const value4 = (require(12169) /* metro dependency 12169: PromotionStringUtils */).useFormatStringWithCommonPremiumParams(bannerFields.body);
|
||||
const helpArticleLinkProps = (require(12169) /* metro dependency 12169: PromotionStringUtils */).getHelpArticleLinkProps(bannerFields.helpArticle,
|
||||
bannerFields.helpArticleId);
|
||||
const items4 = [styles.container, style];
|
||||
const items2 = [styles.card, cardStyle];
|
||||
const items3 = [bannerFields.assetUrl !== '' && <Image source={{uri: bannerFields.assetUrl}} style={styles.image} resizeMode="contain" />];
|
||||
items3[1] = <Text color="mobile-text-heading-primary" variant="text-lg/bold">{bannerFields.header}</Text>;
|
||||
const TextWithIOSLinkWorkaround = (require(6766) /* metro dependency 6766: TextWithIOSLinkWorkaround */).TextWithIOSLinkWorkaround;
|
||||
items3[2] = <TextWithIOSLinkWorkaround color="mobile-text-heading-primary" variant="text-sm/medium" style={styles.bodyText}>{value4}{' '}{helpArticleLinkProps != null && <Text color="text-link" variant="text-sm/medium" accessibilityRole="link" onPress={onPress_60850}>{helpArticleLinkProps.linkText}</Text>}</TextWithIOSLinkWorkaround>;
|
||||
items3[3] = bannerFields.button != null && <View style={styles.ctaButton}>{((Button) => <Button text={bannerFields.button.copy} size="lg" onPress={buttonActionHandler} icon={((NitroWheelIcon) => <NitroWheelIcon style={[styles.nitroWheelIcon]} color={(importDefault(697) /* metro dependency 697: native */).colors.WHITE} size="custom" />)((require(7954) /* metro dependency 7954: NitroWheelIcon */).NitroWheelIcon)} iconPosition="start" variant="experimental_premium-primary" shiny={!useReducedMotion} />)((require(4578) /* metro dependency 4578: ButtonNative */).Button)}</View>;
|
||||
return (
|
||||
<View style={items4}>
|
||||
<View style={items2}>
|
||||
{items3}
|
||||
</View>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
|
||||
function _default_60848OnPress() { // fn#60850, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7764:1923, owner: _default_60848.onPress, offset: 0x01711c9b, size: 50 bytes, params: 1, frame: 11
|
||||
let value = environment.__proto__;
|
||||
value = importDefault(3853) /* metro dependency 3853: Linking */;
|
||||
return value.openURL(env0_0.url);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,138 @@
|
||||
/* Metro module 15285; source: modules/premium/promotions/native/PremiumMarketingMomentActionSheet.tsx; dependencies: [31, 27, 4502, 661, 1376, 33, 4501, 697, 566, 6771, 7587, 8742, 480, 7583, 12169, 6275, 4651, 9543, 5475, 4573, 6766, 3853, 4578, 1244, 7954, 2] */
|
||||
function _fun116920(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#116920, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15482:6, offset: 0x0249b75e, size: 538 bytes, params: 8, frame: 23
|
||||
var object3;
|
||||
const env0_0 = require;
|
||||
const Object = global.Object;
|
||||
Object.defineProperty(exports, '__esModule', {value: true});
|
||||
const env0_3 = importAll(31) /* metro dependency 31 */;
|
||||
const env0_4 = (require(27) /* metro dependency 27 */).View;
|
||||
const accessibilityStore = importDefault(4502) /* metro dependency 4502: AccessibilityStore */;
|
||||
const env0_6 = (require(661) /* metro dependency 661: Constants */).AnalyticsPages;
|
||||
const env0_7 = (require(1376) /* metro dependency 1376: DismissibleContentConstants */).ContentDismissActionType;
|
||||
let value = require(33) /* metro dependency 33 */;
|
||||
const env0_8 = value.jsx;
|
||||
const env0_9 = value.jsxs;
|
||||
value = require(4501) /* metro dependency 4501: createStyles */;
|
||||
const createStyles = value.createStyles;
|
||||
object3 = {};
|
||||
const object4 = {'display': 'flex', 'flexDirection': 'column', 'alignItems': 'center', 'paddingVertical': 12,
|
||||
'paddingHorizontal': 20};
|
||||
object4.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.lg;
|
||||
object3.container = object4;
|
||||
let PX_24 = (importDefault(697) /* metro dependency 697: native */).space.PX_24;
|
||||
object3.buttonContainer = {'marginTop': null, 'width': 335, 'height': 48, marginTop: PX_24};
|
||||
const PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
|
||||
object3.header = {marginBottom: PX_8, textAlign: 'center'};
|
||||
object3.body = {textAlign: 'center'};
|
||||
const object5 = {'height': 188, 'width': 335};
|
||||
object5.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.md;
|
||||
PX_24 = (importDefault(697) /* metro dependency 697: native */).space.PX_24;
|
||||
object5.marginBottom = PX_24;
|
||||
object3.image = object5;
|
||||
const object8 = {};
|
||||
object8.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.md;
|
||||
PX_24 = (importDefault(697) /* metro dependency 697: native */).space.PX_24;
|
||||
object8.marginBottom = PX_24;
|
||||
object3.video = object8;
|
||||
object3.nitroWheelIcon = {'bottom': -1, 'width': 22, 'height': 16};
|
||||
const env0_10 = Reflect.apply(createStyles, value, [object3]);
|
||||
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/premium/promotions/native/PremiumMarketingMomentActionSheet.tsx');
|
||||
exports.default = PremiumMarketingMomentActionSheet;
|
||||
}
|
||||
|
||||
function PremiumMarketingMomentActionSheet({markAsDismissed, bottomSheetData, componentId}) { // fn#116921, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15482:863, offset: 0x0249b978, size: 1211 bytes, params: 2, frame: 34
|
||||
var object5;
|
||||
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
|
||||
var r8;
|
||||
var r15;
|
||||
var Video;
|
||||
var object2;
|
||||
var intl;
|
||||
const env0_3 = undefined;
|
||||
const styles = useStyles();
|
||||
const useReducedMotion = (require(566) /* metro dependency 566: flux */).useStateFromStores([AccessibilityStore],
|
||||
function() {
|
||||
return AccessibilityStore.useReducedMotion;
|
||||
});
|
||||
let value3 = env0_3.useCallback(function() {
|
||||
var markAsDismissedBinding = markAsDismissed;
|
||||
var value3 = undefined;
|
||||
markAsDismissedBinding(ContentDismissActionType.PRIMARY);
|
||||
var moduleValue = require(dependencyMap[10]);
|
||||
var getButtonActionHandler = moduleValue.getButtonActionHandler;
|
||||
var button = bottomSheetData.button;
|
||||
Reflect.apply(getButtonActionHandler, moduleValue,
|
||||
[{buttonAction: button == null ? value3 : button.buttonAction,
|
||||
analyticsLocations: analyticsLocations,
|
||||
analyticsPage: AnalyticsPages.PREMIUM_MARKETING_MOMENT_ACTION_SHEET}])();
|
||||
return value3;
|
||||
}, [bottomSheetData.button?.buttonAction, markAsDismissed,
|
||||
(importDefault(6771) /* metro dependency 6771: useAnalyticsLocations */)().analyticsLocations]);
|
||||
const value4 = env0_3.useCallback(function() {
|
||||
markAsDismissed(ContentDismissActionType.USER_DISMISS);
|
||||
}, [markAsDismissed]);
|
||||
const defaultImport = importDefault(8742) /* metro dependency 8742: useTrackImpression */;
|
||||
object5 = {};
|
||||
const ImpressionTypes = (require(480) /* metro dependency 480: AnalyticsUtils */).ImpressionTypes;
|
||||
const HALFSHEET = ImpressionTypes.HALFSHEET;
|
||||
object5.type = HALFSHEET;
|
||||
const ImpressionNames = (require(480) /* metro dependency 480: AnalyticsUtils */).ImpressionNames;
|
||||
const PREMIUM_MARKETING_COMPONENT = ImpressionNames.PREMIUM_MARKETING_COMPONENT;
|
||||
object5.name = PREMIUM_MARKETING_COMPONENT;
|
||||
const MarketingComponentType = (require(7583) /* metro dependency 7583: MarketingComponentType */).MarketingComponentType;
|
||||
const MOBILE_BOTTOM_SHEET = MarketingComponentType.MOBILE_BOTTOM_SHEET;
|
||||
object5.properties = {component_type: MOBILE_BOTTOM_SHEET, component_id: componentId,
|
||||
dismissible_content: bottomSheetData.dismissibleContent};
|
||||
defaultImport(object5);
|
||||
const helpArticleLinkProps = (require(12169) /* metro dependency 12169: PromotionStringUtils */).getHelpArticleLinkProps(bottomSheetData.helpArticle,
|
||||
bottomSheetData.helpArticleId);
|
||||
const BottomSheet = (require(6275) /* metro dependency 6275: BottomSheetNative */).BottomSheet;
|
||||
const items3 = [styles.container];
|
||||
const uploadUtilsModule = require(4651) /* metro dependency 4651: UploadUtils */;
|
||||
const getFile = uploadUtilsModule.getFile;
|
||||
const object3 = {};
|
||||
let assetUrl = bottomSheetData.assetUrl;
|
||||
object3.uri = assetUrl;
|
||||
if (Reflect.apply(getFile, uploadUtilsModule, [object3]).isVideo) {
|
||||
Video = importDefault(9543) /* metro dependency 9543: Video */;
|
||||
object2 = {};
|
||||
assetUrl = bottomSheetData.assetUrl;
|
||||
object2.videoURI = assetUrl;
|
||||
assetUrl = bottomSheetData.assetUrl;
|
||||
object2.uri = assetUrl;
|
||||
r8 = <Video src={object2} style={styles.video} muted height={188} width={335} paused={useReducedMotion} resizeMode="contain" />;
|
||||
} else {
|
||||
r8 = ((Component) => <Component source={{uri: bottomSheetData.assetUrl}} style={styles.image} resizeMode="contain" />)(importDefault(5475) /* metro dependency 5475: FastImage */);
|
||||
}
|
||||
const items2 = [r8];
|
||||
items2[1] = <Text style={[styles.header]} color="mobile-text-heading-primary" variant="heading-lg/extrabold">{bottomSheetData.header}</Text>;
|
||||
const TextWithIOSLinkWorkaround = (require(6766) /* metro dependency 6766: TextWithIOSLinkWorkaround */).TextWithIOSLinkWorkaround;
|
||||
items2[2] = <TextWithIOSLinkWorkaround style={[styles.body]} color="text-default" variant="text-sm/normal">{bottomSheetData.body}{' '}{helpArticleLinkProps != null && <Text color="text-link" variant="text-sm/normal" accessibilityRole="link" onPress={onPress_116925}>{helpArticleLinkProps.linkText}</Text>}</TextWithIOSLinkWorkaround>;
|
||||
const items6 = [styles.buttonContainer];
|
||||
const Button = (require(4578) /* metro dependency 4578: ButtonNative */).Button;
|
||||
const copy = bottomSheetData.button?.copy;
|
||||
if (copy != null) {
|
||||
r15 = copy;
|
||||
} else {
|
||||
intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
||||
r15 = intl.string((require(1244) /* metro dependency 1244: indexNative */).t.J61px0);
|
||||
}
|
||||
const NitroWheelIcon = (require(7954) /* metro dependency 7954: NitroWheelIcon */).NitroWheelIcon;
|
||||
const items7 = [styles.nitroWheelIcon];
|
||||
const WHITE = (importDefault(697) /* metro dependency 697: native */).unsafe_rawColors.WHITE;
|
||||
items2[3] = <View style={items6}><Button text={r15} size="lg" onPress={value3} icon={<NitroWheelIcon style={items7} color={WHITE} size="custom" />} iconPosition="start" variant="experimental_premium-primary" shiny={!useReducedMotion} /></View>;
|
||||
return (
|
||||
<BottomSheet onDismiss={value4}>
|
||||
<View style={items3}>
|
||||
{items2}
|
||||
</View>
|
||||
</BottomSheet>
|
||||
);
|
||||
}
|
||||
|
||||
function PremiumMarketingMomentActionSheetOnPress() { // fn#116925, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15482:2360, owner: PremiumMarketingMomentActionSheet.onPress, offset: 0x0249bead, size: 50 bytes, params: 1, frame: 11
|
||||
let value = environment.__proto__;
|
||||
value = importDefault(3853) /* metro dependency 3853: Linking */;
|
||||
return value.openURL(env0_3.url);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user