decord/source/modules/premium/native/utils/PremiumManagementUtils.tsx

140 lines
5.5 KiB
TypeScript
Raw Normal View History

2026-07-25 08:10:48 +00:00
// Module ID: 6495
2026-07-27 11:26:19 +00:00
// Function ID: 58069
2026-07-20 16:05:17 +00:00
// Name: getPremiumManagementMethod
2026-07-25 08:10:48 +00:00
// Dependencies: [653, 482, 33, 3, 4472, 1212, 477, 1553, 6496, 6499, 2]
2026-07-20 16:05:17 +00:00
// Exports: getExternalManagementMessage
2026-07-25 08:10:48 +00:00
// Module 6495 (getPremiumManagementMethod)
2026-07-23 10:11:24 +00:00
import { SubscriptionStatusTypes } from "ME";
import { PaymentGatewayToFriendlyName as closure_4 } from "sum";
import { jsx } from "jsxProd";
import importDefaultResult from "timestamp";
2026-07-20 16:05:17 +00:00
function getPremiumManagementMethod(isOnPlatformMatchingExternalPaymentGateway) {
if (null == isOnPlatformMatchingExternalPaymentGateway) {
return null;
} else if (isOnPlatformMatchingExternalPaymentGateway.isOnPlatformMatchingExternalPaymentGateway) {
let IN_WEB = obj.IN_APP;
} else {
if (isOnPlatformMatchingExternalPaymentGateway.isPurchasedExternally) {
if (null != isOnPlatformMatchingExternalPaymentGateway.paymentGateway) {
IN_WEB = obj.IN_EXTERNAL_MOBILE_PAYMENT_GATEWAY;
}
}
IN_WEB = obj.IN_WEB;
}
}
function defaultMobileWebNitroManagementSuccessCallback() {
return importDefaultResult.log("Successfully opened mobile web Nitro Management page");
}
function defaultMobileWebNitroManagementFailureCallback(arg0) {
importDefaultResult.error("Failed to open mobile web Nitro Management page, error response: ", arg0);
2026-07-25 08:10:48 +00:00
let obj = importDefault(4472);
2026-07-20 16:05:17 +00:00
obj = {};
2026-07-23 10:11:24 +00:00
const intl = require(1212) /* getSystemLocale */.intl;
obj.title = intl.string(require(1212) /* getSystemLocale */.t.NrBVjw);
const intl2 = require(1212) /* getSystemLocale */.intl;
obj.body = intl2.string(require(1212) /* getSystemLocale */.t["gD+grx"]);
2026-07-20 16:05:17 +00:00
obj.hideActionSheet = true;
obj.show(obj);
}
importDefaultResult = new importDefaultResult("PremiumManagementUtils");
2026-07-23 10:11:24 +00:00
let obj = { IN_APP: "manage_in_app", IN_EXTERNAL_MOBILE_PAYMENT_GATEWAY: "manage_in_external_mobile_payment_gateway", IN_WEB: "manage_in_web" };
const result = require("jsxProd").fileFinishedImporting("modules/premium/native/utils/PremiumManagementUtils.tsx");
2026-07-20 16:05:17 +00:00
export const MobileWebDestinationTypes = { PREMIUM_MANAGEMENT: "premium_management" };
export const PremiumManagementMethod = obj;
export { getPremiumManagementMethod };
export const getExternalManagementMessage = function getExternalManagementMessage(subscription, arg1) {
let tmp = arg1;
if (arg1 === undefined) {
tmp = null;
}
const require = tmp;
function manageExternalNitroSubscription() {
if (null != tmp) {
2026-07-23 10:11:24 +00:00
let obj = tmp(outer1_2[8]);
2026-07-20 16:05:17 +00:00
obj = { loadId: tmp.loadId };
if (null != tmp.onSuccessCallback) {
let onSuccessCallback = tmp.onSuccessCallback;
} else {
2026-07-23 10:11:24 +00:00
onSuccessCallback = outer1_9;
2026-07-20 16:05:17 +00:00
}
if (null != tmp.onFailureCallback) {
let onFailureCallback = tmp.onFailureCallback;
} else {
2026-07-23 10:11:24 +00:00
onFailureCallback = outer1_10;
2026-07-20 16:05:17 +00:00
}
return obj.goToStandaloneNitroManagementFromMobileApp("premium_external_management", obj, onSuccessCallback, onFailureCallback);
}
}
const tmp2 = getPremiumManagementMethod(subscription);
if (null != tmp2) {
if (tmp2 !== obj.IN_APP) {
let str2 = "iOS";
if (!obj8.isIOS()) {
2026-07-23 10:11:24 +00:00
obj = require(1553) /* isMetaQuest */;
2026-07-20 16:05:17 +00:00
let str = "Android";
if (obj.isMetaQuest()) {
str = "Meta Quest";
}
str2 = str;
}
if (tmp2 === obj.IN_EXTERNAL_MOBILE_PAYMENT_GATEWAY) {
if (null != subscription) {
if (null != subscription.paymentGateway) {
2026-07-23 10:11:24 +00:00
const intl4 = require(1212) /* getSystemLocale */.intl;
obj = { mobilePlatform: str2, externalPaymentGateway: table[subscription.paymentGateway] };
return intl4.formatToPlainString(require(1212) /* getSystemLocale */.t.cFZnqX, obj);
2026-07-20 16:05:17 +00:00
}
}
}
if (tmp2 === obj.IN_WEB) {
if (null != tmp) {
if (tmp.shouldAllowExternalManagement) {
if ("iOS" !== str2) {
2026-07-23 10:11:24 +00:00
let obj1 = require(1553) /* isMetaQuest */;
2026-07-20 16:05:17 +00:00
}
let status;
if (null != subscription) {
status = subscription.status;
}
let tmp13 = status === SubscriptionStatusTypes.CANCELED;
if (!tmp13) {
tmp13 = status === SubscriptionStatusTypes.PAUSE_PENDING;
}
if (!tmp13) {
tmp13 = status === SubscriptionStatusTypes.PAST_DUE;
}
if (tmp.returnCtaAsComponent) {
obj = {};
obj1 = { justifyContent: "flex-start" };
obj.containerStyle = obj1;
obj.onPress = function onPress() {
return manageExternalNitroSubscription();
};
2026-07-23 10:11:24 +00:00
const intl3 = require(1212) /* getSystemLocale */.intl;
const t = require(1212) /* getSystemLocale */.t;
obj.text = intl3.string(tmp13 ? t.tqSSSA : t["olSp/D"]);
2026-07-20 16:05:17 +00:00
obj.variant = "text-sm/semibold";
2026-07-25 08:10:48 +00:00
jsx(require(6499) /* LinkButton */.LinkButton, {});
2026-07-20 16:05:17 +00:00
const tmp18 = jsx;
} else {
2026-07-23 10:11:24 +00:00
const intl2 = require(1212) /* getSystemLocale */.intl;
2026-07-20 16:05:17 +00:00
const obj2 = { manageExternalNitroSubscription };
2026-07-23 10:11:24 +00:00
return intl2.format(require(1212) /* getSystemLocale */.t.IERwUb, obj2);
2026-07-20 16:05:17 +00:00
}
}
}
2026-07-23 10:11:24 +00:00
const intl = require(1212) /* getSystemLocale */.intl;
2026-07-20 16:05:17 +00:00
const obj3 = { mobilePlatform: str2 };
2026-07-23 10:11:24 +00:00
return intl.formatToPlainString(require(1212) /* getSystemLocale */.t.CnoyAN, obj3);
2026-07-20 16:05:17 +00:00
} else {
return null;
}
2026-07-23 10:11:24 +00:00
obj8 = require(477) /* set */;
2026-07-20 16:05:17 +00:00
}
}
return null;
};