77 lines
4.0 KiB
TypeScript
77 lines
4.0 KiB
TypeScript
/* Metro module 12169; source: modules/premium/promotions/PromotionStringUtils.tsx; dependencies: [3807, 1880, 566, 3802, 5137, 1244, 1948, 2] */
|
|
import SubscriptionPlanStore from '../../../stores/billing/SubscriptionPlanStore.tsx'; /* Metro dependency 3807 */
|
|
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
import * as IndexNativeModule from '../../../intl/index.native.tsx'; /* Metro dependency 1244 */
|
|
import * as PremiumConstantsModule from '../PremiumConstants.tsx'; /* Metro dependency 1880 */
|
|
|
|
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});
|
|
(FileImportTrackerModule).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 = (IndexNativeModule).intl;
|
|
const t = (IndexNativeModule).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 object = {};
|
|
object.url = (importDefault(1948) /* metro dependency 1948: HelpdeskUtils */).getArticleURL(r5);
|
|
object.linkText = r2;
|
|
return object;
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun93266, 12169, [3807, 1880, 566, 3802, 5137, 1244, 1948,
|
|
2]) /* metro module 12169, dependencies: [3807, 1880, 566, 3802, 5137, 1244, 1948, 2] */;
|