This commit is contained in:
janisslsm committed 2026-11-01 12:12:55 +02:00
1 parent 1781d25a15
commit 732c0ad767
33051 files changed
+2591613 -3019689

No files matched your search

@@ -0,0 +1,20 @@
// Metro module 1854 (f1855).
import * as _GlobalUtils from "../../../utils/GlobalUtils";
import * as _mappers from "./mappers";
const r11 = {
ANIMATED: "animated",
STATIC: "static",
VIDEO: "video"
};
let c1564_2 = "media/v1/collectibles-shop";
export const parseSkuIdFromServerData = _mappers.parseSkuIdFromServerData;
export { r11 as CollectiblesItemAssetFormat };
export function getCollectiblesItemAssetUrl({ skuId, assetFormat, assetId }) {
let r20 = null;
if (skuId != null) {
const isDiscordBackendDevelopment = _GlobalUtils.isDiscordBackendDevelopment();
const r28 = Boolean(assetId);
r20 = isDiscordBackendDevelopment ? `http://localhost:3000/_storage/${c1564_2}/${skuId}/${r28 ? `${assetId}/` : ""}${assetFormat}` : `https://cdn.discordapp.com/${c1564_2}/${skuId}/${r28 ? `${assetId}/` : ""}${assetFormat}`;
}
return r20;
}
@@ -0,0 +1,22 @@
// Metro module 5851 (f5852).
import { AnalyticEvents } from "../../../Constants";
import AnalyticsUtils from "../../../utils/AnalyticsUtils";
const r15 = {
SHOP_MOUNTED: "shop_mounted",
CATEGORIES_FETCH_STARTED: "categories_fetch_started",
CATEGORIES_FETCH_COMPLETED: "categories_fetch_completed",
SHOP_HOME_FETCH_STARTED: "shop_home_fetch_started",
SHOP_HOME_FETCH_COMPLETED: "shop_home_fetch_completed",
SHOP_RENDERED: "shop_rendered"
};
export { r15 as CollectiblesShopPerfCheckpoint };
export function trackShopPerf(a0) {
const sessionId = a0.sessionId;
AnalyticsUtils.track(AnalyticEvents.COLLECTIBLES_SHOP_PERF_TRACKED, {
page_session_id: sessionId,
checkpoint: a0.checkpoint,
tab: a0.tab,
unpublished_categories_shown: a0.unpublishedCategoriesShown,
cache_disabled: a0.cacheDisabled
});
}
@@ -0,0 +1,254 @@
// Metro module 5809 (f5810).
import _slicedToArray from "../../../_bundle/_slicedToArray";
import { isProfileEffectRecord } from "../records/ProfileEffectRecord";
import { CurrencyCodes, PriceSetAssignmentPurchaseTypes } from "../../../Constants";
import { CollectiblesItemType } from "../../../_bundle/Module1901";
let $mk77177 = function() {
return (a0) => a0.currency === CurrencyCodes.DISCORD_ORB;
}, $mk77178 = function() {
return (a0) => a0.currency !== CurrencyCodes.DISCORD_ORB;
};
export function getProductOrbPrice(a0) {
const r12 = a0.product.prices[a0.hasShopDiscount ? PriceSetAssignmentPurchaseTypes.PREMIUM_TIER_2 : PriceSetAssignmentPurchaseTypes.DEFAULT];
const r4 = r12 == null;
let r13 = void 0;
if (!r4) {
const countryPrices = r12.countryPrices;
const r15 = countryPrices == null;
r13 = void 0;
if (!r15) {
const prices = countryPrices.prices;
r13 = prices == null ? void 0 : prices.slice(0, 2);
}
}
if (r13 == null) {
r13 = [];
}
let r21 = r13.find($mk77177());
if (r21 == null) {
r21 = null;
}
return r21;
}
export function getProductFiatPrice(a0) {
const r12 = a0.product.prices[a0.hasShopDiscount ? PriceSetAssignmentPurchaseTypes.MOBILE_PREMIUM_TIER_2 : PriceSetAssignmentPurchaseTypes.MOBILE];
const r4 = r12 == null;
let r13 = void 0;
if (!r4) {
const countryPrices = r12.countryPrices;
const r15 = countryPrices == null;
r13 = void 0;
if (!r15) {
const prices = countryPrices.prices;
r13 = prices == null ? void 0 : prices.slice(0, 2);
}
}
if (r13 == null) {
r13 = [];
}
let r21 = r13.find($mk77178());
if (r21 == null) {
r21 = null;
}
return r21;
}
export function getHasOrbPrice(a0) {
const r11 = a0.prices[PriceSetAssignmentPurchaseTypes.DEFAULT];
const r4 = r11 == null;
let r12 = void 0;
if (!r4) {
const countryPrices = r11.countryPrices;
const r14 = countryPrices == null;
r12 = void 0;
if (!r14) {
const prices = countryPrices.prices;
r12 = prices == null ? void 0 : prices.slice(0, 2);
}
}
if (r12 == null) {
r12 = [];
}
let r19 = r12.find($mk77177());
if (r19 == null) {
r19 = null;
}
return r19 != null;
}
export function getHasNonOrbPrice(a0) {
const r11 = a0.prices[PriceSetAssignmentPurchaseTypes.MOBILE];
const r4 = r11 == null;
let r12 = void 0;
if (!r4) {
const countryPrices = r11.countryPrices;
const r14 = countryPrices == null;
r12 = void 0;
if (!r14) {
const prices = countryPrices.prices;
r12 = prices == null ? void 0 : prices.slice(0, 2);
}
}
if (r12 == null) {
r12 = [];
}
let r19 = r12.find($mk77178());
if (r19 == null) {
r19 = null;
}
return r19 != null;
}
export function isOrbsExclusiveProduct(a0) {
if (a0 == null) {
return false;
}
const r12 = a0.prices[PriceSetAssignmentPurchaseTypes.DEFAULT];
const r3 = r12 == null;
let r11 = void 0;
if (!r3) {
const countryPrices = r12.countryPrices;
const r14 = countryPrices == null;
r11 = void 0;
if (!r14) {
const prices = countryPrices.prices;
r11 = prices == null ? void 0 : prices.slice(0, 2);
}
}
if (r11 == null) {
r11 = [];
}
let r20 = r11.find($mk77177());
if (r20 == null) {
r20 = null;
}
let r21 = r20 != null;
const r24 = a0.prices[PriceSetAssignmentPurchaseTypes.MOBILE];
const r5 = r24 == null;
let r25 = void 0;
if (!r5) {
const countryPrices2 = r24.countryPrices;
const r27 = countryPrices2 == null;
r25 = void 0;
if (!r27) {
const prices2 = countryPrices2.prices;
r25 = prices2 == null ? void 0 : prices2.slice(0, 2);
}
}
if (r25 == null) {
r25 = [];
}
let r35 = r25.find($mk77178());
if (r35 == null) {
r35 = null;
}
const r36 = r35 != null;
if (r21) {
r21 = !r36;
}
return r21;
}
export function isDynamicProduct(a0) {
let r3 = a0 != null;
if (r3) {
const r1 = a0 == null;
let r7 = null;
if (!r1) {
if (a0.type === CollectiblesItemType.VARIANTS_GROUP) {
const r2 = a0.variants == null;
r7 = null;
if (!r2) {
const length = a0.variants.length;
r7 = null;
if (length !== 0) {
const r20 = a0.variants[0];
r7 = r20 == null ? null : _slicedToArray(r20.items, 1)[0].type;
}
}
} else {
r7 = a0.type;
}
}
r3 = r7 === CollectiblesItemType.PROFILE_EFFECT && a0.items.some((item) => isProfileEffectRecord(item) && item.effects.some((effect) => effect.randomizedSources != null && effect.randomizedSources.length > 0));
}
return r3;
}
export function getProductsWithOrbsPrice(a0) {
return a0.filter((item) => {
const r12 = item.prices[PriceSetAssignmentPurchaseTypes.DEFAULT];
const r3 = r12 == null;
let r11 = void 0;
if (!r3) {
const countryPrices = r12.countryPrices;
const r14 = countryPrices == null;
r11 = void 0;
if (!r14) {
const prices = countryPrices.prices;
r11 = prices == null ? void 0 : prices.slice(0, 2);
}
}
if (r11 == null) {
r11 = [];
}
let r20 = r11.find($mk77177());
if (r20 == null) {
r20 = null;
}
let r21 = r20 != null;
const r24 = item.prices[PriceSetAssignmentPurchaseTypes.MOBILE];
const r5 = r24 == null;
let r25 = void 0;
if (!r5) {
const countryPrices2 = r24.countryPrices;
const r27 = countryPrices2 == null;
r25 = void 0;
if (!r27) {
const prices2 = countryPrices2.prices;
r25 = prices2 == null ? void 0 : prices2.slice(0, 2);
}
}
if (r25 == null) {
r25 = [];
}
let r35 = r25.find($mk77178());
if (r35 == null) {
r35 = null;
}
const r36 = r35 != null;
if (r21) {
r21 = r36;
}
return r21;
});
}
export function getIsVariantProduct(a0) {
return a0.type === CollectiblesItemType.VARIANTS_GROUP && a0.variants != null && a0.variants.length !== 0;
}
export function getProductSkuIds(a0) {
return a0.type === CollectiblesItemType.VARIANTS_GROUP && a0.variants != null && a0.variants.length !== 0 ? a0.variants.map((variant) => variant.skuId) : [a0.skuId];
}
export function getSelectedProduct(a0, a1) {
const r12 = a0.type === CollectiblesItemType.VARIANTS_GROUP && a0.variants != null && a0.variants.length !== 0;
let r16 = a0;
if (r12) {
r16 = a0;
if (a1 != null) {
let r20 = a0.variants[a1];
if (r20 == null) {
r20 = a0;
}
r16 = r20;
}
}
return r16;
}
export function getProductType(a0) {
if (a0 == null) {
return null;
}
if (a0.type === CollectiblesItemType.VARIANTS_GROUP) {
if (a0.variants != null && a0.variants.length !== 0) {
const r18 = a0.variants[0];
return r18 == null ? null : _slicedToArray(r18.items, 1)[0].type;
}
return null;
}
return a0.type;
}
@@ -0,0 +1,82 @@
// Metro module 5846 (f5847).
import { ApplicationStreamPresets } from "../../go_live/StreamSettingsConstants";
import { MediaEngineContextTypes } from "../../../_bundle/Module4286";
import { ShopVariantsReturnStyle } from "../../../_bundle/Module5847";
import useFractionalPremiumInfo from "../../billing/hooks/useFractionalPremiumInfo";
import { dateFormat } from "../../../utils/DateUtils";
export function constructGoLiveSource(a0, a1, a2) {
const r1 = {
qualityOptions: {
preset: ApplicationStreamPresets.PRESET_CUSTOM,
resolution: a0,
frameRate: a1
},
context: MediaEngineContextTypes.STREAM
};
if (a2 != null) {
if (a2.desktopSource != null) {
r1.desktopSettings = {
sourceId: a2.desktopSource.id,
sound: true
};
}
if (a2.cameraSource != null) {
r1.cameraSettings = {
videoDeviceGuid: a2.cameraSource.videoDeviceGuid,
audioDeviceGuid: a2.cameraSource.audioDeviceGuid
};
}
}
return r1;
}
export function buildFetchCollectiblesOptionsQuery(a0, a1) {
const r3 = {};
if (a1 != null) {
r3.tab = a1;
}
if (a0 != null) {
if (a0.noCache === true) {
r3.no_cache = true;
}
if (a0.includeUnpublished === true) {
r3.include_unpublished = true;
}
if (a0.includeBundles === true) {
r3.include_bundles = true;
}
if (a0.includeDynamicBlocks === true) {
r3.include_dynamic_blocks = true;
}
if (a0.countryCode != null && a0.countryCode !== "") {
r3.country_code = a0.countryCode;
}
if (a0.paymentGateway !== null) {
r3.payment_gateway = a0.paymentGateway;
}
if (a0.variantsReturnStyle === ShopVariantsReturnStyle.VARIANTS_GROUP) {
r3.variants_return_style = ShopVariantsReturnStyle.VARIANTS_GROUP;
}
if (a0.shopHomeConfig != null) {
r3.shop_home_config = a0.shopHomeConfig;
}
if (a0.skipNumCategories != null) {
r3.skip_num_categories = a0.skipNumCategories;
}
}
return r3;
}
export function getOptimizedProfileEffectThumbnailUrl(a0) {
if (a0 != null) {
return `${a0}?width=100&height=195`;
}
}
export function useFetchFractionalPremiumInfo() {
const fractionalPremiumInfo = useFractionalPremiumInfo({
forceFetch: true
});
return {
isLoading: !fractionalPremiumInfo.fetched,
isFractionalPremiumActive: fractionalPremiumInfo.isFractionalPremiumActive,
expiresAt: dateFormat(fractionalPremiumInfo.endsAt, "L")
};
}
@@ -0,0 +1,14 @@
// Metro module 13126 (f13127).
import CollectiblesShopHomeStore from "../CollectiblesShopHomeStore";
import { CollectibleShopTab } from "../CollectiblesShopConstants";
import { ShopBlockType } from "../../../_bundle/Module5829";
export function getWideBannerDismissibleContentVersion() {
for (const item of [CollectibleShopTab.HOME, CollectibleShopTab.ORBS, CollectibleShopTab.CATALOG]) {
const r31 = CollectiblesShopHomeStore.getShopBlocks(item).find((item) => item.type === ShopBlockType.WIDE_BANNER);
if (r31?.dismissibleContentVersion == null) {
continue;
}
return r31.dismissibleContentVersion;
}
return 0;
}
@@ -0,0 +1,23 @@
// Metro module 8693 (f8694).
import { ItemsSortingHat } from "../hooks/useShopProductItems";
import { isBundleProduct } from "../CollectiblesUtils";
export function isValidCollectiblesBundle(a0) {
const itemsSortingHat = new ItemsSortingHat(a0.items);
const { firstProfileEffect, firstAvatarDecoration, firstNameplate } = itemsSortingHat;
return firstAvatarDecoration != null && firstProfileEffect != null && firstNameplate == null || firstAvatarDecoration != null && firstProfileEffect != null && firstNameplate != null;
}
export function isValidCollectiblesBundleItems(a0) {
const itemsSortingHat = new ItemsSortingHat(a0);
const { firstProfileEffect, firstAvatarDecoration, firstNameplate } = itemsSortingHat;
return firstAvatarDecoration != null && firstProfileEffect != null && firstNameplate == null || firstAvatarDecoration != null && firstProfileEffect != null && firstNameplate != null;
}
export function bundleContainsNameplates(a0) {
let r12 = !!isBundleProduct(a0);
if (r12) {
const itemsSortingHat = new ItemsSortingHat(a0.items);
itemsSortingHat.firstProfileEffect;
itemsSortingHat.firstAvatarDecoration;
r12 = itemsSortingHat.firstNameplate != null;
}
return r12;
}
@@ -0,0 +1,57 @@
// Metro module 8726 (f8727).
import { intl, t } from "../../../intl/index.native";
import { getProductType } from "./CollectiblesProductUtils";
import { CollectiblesItemType } from "../../../_bundle/Module1901";
export function getProductName(a0) {
if (a0 == null) {
return "";
}
const r16 = intl.string(t.z7y5vF);
return "baseVariantName" in a0 && (a0.baseVariantName != null && a0.variantLabel !== r16) ? intl.formatToPlainString(t.BZN5k2, {
baseVariantName: a0.baseVariantName,
variantLabel: a0.variantLabel
}) : a0.name;
}
export function getPurchasedProductName(a0) {
if (a0 == null) {
return "";
}
const r15 = intl.string(t.z7y5vF);
return a0.baseVariantName != null && a0.variantLabel !== r15 ? intl.formatToPlainString(t.BZN5k2, {
baseVariantName: a0.baseVariantName,
variantLabel: a0.variantLabel
}) : a0.name;
}
export function getProductNameAndTypeLabel(a0) {
const r0 = a0 == null;
let product = "";
if (!r0) {
const r18 = intl.string(t.z7y5vF);
product = "baseVariantName" in a0 && (a0.baseVariantName != null && a0.variantLabel !== r18) ? intl.formatToPlainString(t.BZN5k2, {
baseVariantName: a0.baseVariantName,
variantLabel: a0.variantLabel
}) : a0.name;
}
const productType = getProductType(a0);
if (CollectiblesItemType.AVATAR_DECORATION === productType) {
return intl.formatToPlainString(t.lvBzLi, {
product
});
}
if (CollectiblesItemType.PROFILE_EFFECT === productType) {
return intl.formatToPlainString(t.eR7moP, {
product
});
}
if (CollectiblesItemType.NAMEPLATE === productType) {
return intl.formatToPlainString(t.YFOwHj, {
product
});
}
if (CollectiblesItemType.PROFILE_FRAME === productType) {
return intl.formatToPlainString(t.vov8LX, {
product
});
}
return product;
}
+101
View File
@@ -0,0 +1,101 @@
// Metro module 1853 (f1854).
export function parseSkuIdFromServerData(a0) {
let r7;
L7: {
if (typeof a0.skuId !== "string" && typeof a0.skuId !== "number") {
if (typeof a0.sku_id !== "string") {
const sku_id = a0.sku_id;
r7 = null;
if (typeof sku_id !== "number") {
break L7;
}
}
r7 = String(a0.sku_id);
} else {
r7 = String(a0.skuId);
}
}
return r7;
}
export function parseServerUserCollectibles(a0) {
let skuId;
let r2 = null;
if (typeof a0 === "object") {
const r1 = a0 == null;
r2 = null;
if (!r1) {
const r9 = "nameplate" in a0;
let r10 = null;
if (r9) {
const nameplate = a0.nameplate;
r10 = null;
if (typeof nameplate === "object") {
const nameplate2 = a0.nameplate;
let nameplate3 = null;
if (typeof nameplate2 === "object") {
const r12 = nameplate2 == null;
nameplate3 = null;
if (!r12) {
L13: {
if (typeof nameplate2.skuId !== "string" && typeof nameplate2.skuId !== "number") {
if (typeof nameplate2.sku_id !== "string") {
const sku_id = nameplate2.sku_id;
skuId = null;
if (typeof sku_id !== "number") {
break L13;
}
}
skuId = String(nameplate2.sku_id);
} else {
skuId = String(nameplate2.skuId);
}
}
const r24 = skuId == null;
nameplate3 = null;
if (!r24) {
const r26 = "label" in nameplate2;
nameplate3 = null;
if (r26) {
const label = nameplate2.label;
nameplate3 = null;
if (typeof label === "string") {
const r29 = "palette" in nameplate2;
nameplate3 = null;
if (r29) {
const palette = nameplate2.palette;
nameplate3 = null;
if (typeof palette === "string") {
const r31 = {
skuId,
label: nameplate2.label,
palette: nameplate2.palette
};
if ("asset" in nameplate2 && typeof nameplate2.asset === "string") {
r31.asset = nameplate2.asset;
}
if ("expiresAt" in nameplate2 && typeof nameplate2.expiresAt === "number") {
r31.expiresAt = nameplate2.expiresAt;
}
const r43 = "expires_at" in nameplate2 && typeof nameplate2.expires_at === "number";
nameplate3 = r31;
if (r43) {
r31.expiresAt = nameplate2.expires_at;
nameplate3 = r31;
}
}
}
}
}
}
}
}
r10 = {
nameplate: nameplate3
};
}
}
r2 = r10;
}
}
return r2;
}