decord/beta/source/modules/premium/promotions/PromotionStringUtils.tsx
github-actions e7a050048e chore: update source for beta 347.7
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4943.js (118.4 MB)
2026-09-21 19:31:18 +00:00

102 lines
3.2 KiB
TypeScript

// Module ID: 13700
// Function ID: 13701
// Name: PromotionStringUtils
// Dependencies: [4423, 1378, 558, 568, 504, 4418, 7481, 1119, 2112, 2]
// Exports: getHelpArticleLinkProps
// Module 13700 (PromotionStringUtils)
import initialize from "initialize" /* 504 */;
import c from "c" /* 568 */;
import util from "util" /* 1119 */;
import HelpdeskUtilsDefault from "HelpdeskUtils" /* 2112 */;
import PremiumUtilsDefault from "PremiumUtils" /* 4418 */;
import PriceUtils from "PriceUtils" /* 7481 */;
import SubscriptionPlanStore from "SubscriptionPlanStore" /* 4423 */;
require = fn;
const PremiumConstants = fn(1378);
({ PremiumSubscriptionSKUs: closure_4, SubscriptionPlans: hasOwnProperty } = PremiumConstants);
const ReactCompilerGating = fn(558);
const size = fn(2);
const result = size.fileFinishedImporting("modules/premium/promotions/PromotionStringUtils.tsx");
export const useFormatStringWithCommonPremiumParams = ReactCompilerGating.isReactCompilerEnabled() ? ((arr) => {
const cResult = c.c(3);
let str = "...";
if (cResult[0] === Symbol.for("react.memo_cache_sentinel")) {
const items = [SubscriptionPlanStore];
const fn = function u() {
return loadedForSKU.isLoadedForSKU(TIER_2.TIER_2);
};
cResult[0] = items;
cResult[1] = fn;
tmp4 = items;
tmp5 = fn;
} else {
[tmp4, tmp5] = cResult;
}
const stateFromStores = initialize.useStateFromStores(tmp4, tmp5);
if (-1 !== arr.indexOf("{price}")) {
if (stateFromStores) {
try {
const defaultPrice = PremiumUtilsDefault.getDefaultPrice(hasOwnProperty.PREMIUM_MONTH_TIER_2);
str = tmp(7481).formatPrice(defaultPrice.amount, defaultPrice.currency);
const tmpResult2 = tmp(7481);
} catch (err) {
}
}
}
if (cResult[2] === Symbol.for("react.memo_cache_sentinel")) {
const tmp12 = /\{price\}/g;
cResult[2] = tmp12;
let tmp11 = tmp12;
} else {
tmp11 = cResult[2];
}
return arr.replace(tmp11, str);
}) : ((arr) => {
let str = "...";
const items = [SubscriptionPlanStore];
const stateFromStores = initialize.useStateFromStores(items, () => loadedForSKU.isLoadedForSKU(TIER_2.TIER_2));
if (-1 !== arr.indexOf("{price}")) {
if (stateFromStores) {
try {
const defaultPrice = PremiumUtilsDefault.getDefaultPrice(hasOwnProperty.PREMIUM_MONTH_TIER_2);
str = PriceUtils.formatPrice(defaultPrice.amount, defaultPrice.currency);
const tmpResult = PriceUtils;
} catch (err) {
}
}
}
return arr.replace(/\{price\}/g, str);
});
export const getHelpArticleLinkProps = function getHelpArticleLinkProps(helpArticle, helpArticleId) {
let id1;
if (helpArticle != null) {
id1 = helpArticle.id;
}
let id = helpArticleId;
if (null != id1) {
id = helpArticleId;
if ("" !== helpArticle.id) {
id = helpArticle.id;
}
}
if ("" === id) {
return null;
} else {
let linkText1;
if (helpArticle != null) {
linkText1 = helpArticle.linkText;
}
if (null != linkText1) {
if ("" !== helpArticle.linkText) {
let linkText = helpArticle.linkText;
}
const obj = { url: HelpdeskUtilsDefault.getArticleURL(id), linkText };
return obj;
}
const intl = util.intl;
linkText = intl.string(util.t["sBp+u0"]);
}
};