decord/source/components_native/premium/GiftPurchaseButton.tsx

76 lines
3.9 KiB
TypeScript
Raw Normal View History

// Module ID: 13654
// Function ID: 13655
2026-07-20 16:05:17 +00:00
// Name: GiftPurchaseButton
// Dependencies: [5, 19, 17, 4300, 7340, 21, 5062, 4632, 504, 7343, 11182, 7265, 10875, 4981, 1114, 4294, 10790, 5057, 13655, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
// Module 13654 (GiftPurchaseButton)
import asyncGeneratorStep from "asyncGeneratorStep" /* 5 */;
import noop from "module_19" /* 19 */;
import SubscriptionStore from "SubscriptionStore" /* 4300 */;
import IAPStore from "IAPStore" /* 7340 */;
2026-07-23 10:11:24 +00:00
const require = fn;
const View = fn(17).View;
const jsx = fn(21).jsx;
const size = fn(2);
const result = size.fileFinishedImporting("components_native/premium/GiftPurchaseButton.tsx");
2026-07-20 16:05:17 +00:00
export default function GiftPurchaseButton(style) {
let str = style.variant;
if (str === undefined) {
str = "primary";
}
const planId = style.planId;
let analyticsLocation = style.analyticsLocation;
if (analyticsLocation === undefined) {
analyticsLocation = {};
}
const recipientUserId = style.recipientUserId;
2026-07-23 10:11:24 +00:00
let analyticsLocations;
let createOrReuseGiftOrder;
const buttonTextColorStyles = planId(recipientUserId[6]).useButtonTextColorStyles(str);
2026-07-23 10:11:24 +00:00
const merged = Object.assign(planId(recipientUserId[7]).TextStyleSheet["text-sm/semibold"]);
2026-07-20 16:05:17 +00:00
const merged1 = Object.assign(buttonTextColorStyles);
const obj = {};
const obj2 = planId(recipientUserId[6]);
const items = [SubscriptionStore];
2026-07-29 08:29:29 +00:00
const stateFromStores = planId(recipientUserId[8]).useStateFromStores(items, () => premiumSubscription.getPremiumSubscription());
const obj4 = planId(recipientUserId[8]);
const productIdForGift = planId(recipientUserId[9]).getProductIdForGift(planId);
const obj5 = planId(recipientUserId[9]);
2026-07-23 10:11:24 +00:00
const canPurchaseIAP = planId(recipientUserId[10]).useCanPurchaseIAP(productIdForGift);
const obj6 = planId(recipientUserId[10]);
const items1 = [IAPStore];
const stateFromStores1 = planId(recipientUserId[8]).useStateFromStores(items1, () => IAPStore.isPurchasingProduct(productIdForGift));
let obj7 = planId(recipientUserId[8]);
const items2 = [IAPStore];
2026-07-29 08:29:29 +00:00
let tmp11 = null != stateFromStores;
const stateFromStores2 = planId(recipientUserId[8]).useStateFromStores(items2, () => IAPStore.getProduct(productIdForGift));
2026-07-29 08:29:29 +00:00
if (tmp11) {
tmp11 = stateFromStores.planId === planId;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
analyticsLocations = analyticsLocation(tmp2[11])().analyticsLocations;
2026-07-23 10:11:24 +00:00
const obj8 = planId(recipientUserId[8]);
createOrReuseGiftOrder = planId(recipientUserId[12]).useCreateOrReuseGiftOrder("GiftPurchaseButton");
2026-07-20 16:05:17 +00:00
const items3 = [planId, recipientUserId, analyticsLocation, analyticsLocations, createOrReuseGiftOrder, productIdForGift];
const obj3 = { style: style.style, children: null };
2026-07-29 08:29:29 +00:00
const callback = analyticsLocations.useCallback(productIdForGift(function*() {
closure_128_0 = yield createOrReuseGiftOrder({ planId, recipientUserId, productId: productIdForGift });
const premiumTypeFromPlanId = planId(4294).getPremiumTypeFromPlanId(closure_129_0);
const premiumType = premiumTypeFromPlanId.premiumType;
const planInterval = premiumTypeFromPlanId.planInterval;
planId(10790).openGiftModal({ recipientUserId: closure_129_2, premiumType, planInterval, analyticsLocation: closure_129_1, analyticsLocations: closure_129_4, order: closure_128_0 });
yield "HermesInternal";
const obj7 = { title: null, body: null };
const intl = planId(1114).intl;
obj7.title = intl.string(planId(1114).t.R0RpRX);
const intl2 = planId(1114).intl;
obj7.body = intl2.string(planId(1114).t.CKsXk3);
tmp3(4981).show(obj7);
2026-07-29 08:29:29 +00:00
}), items3);
const tmpResult = planId(recipientUserId[12]);
obj3.children = jsx(planId(recipientUserId[17]).BaseTextButton, { textElement: analyticsLocation(recipientUserId[18])({ style: obj, basePlanId: planId, isCurrentPlan: tmp11, isGift: true, product: stateFromStores2 }), variant: str, size: "sm", onPress: callback, loading: stateFromStores1, disabled: !canPurchaseIAP, grow: true });
2026-07-29 08:29:29 +00:00
return <createOrReuseGiftOrder style={arg0.style}>{null}</createOrReuseGiftOrder>;
2026-07-20 16:05:17 +00:00
};