decord/source/stores/native/IAPStore.android.tsx

181 lines
5.6 KiB
TypeScript
Raw Normal View History

2026-08-05 07:35:12 +00:00
// Module ID: 5752
// Function ID: 5753
2026-07-29 08:29:29 +00:00
// Name: updateProduct
2026-08-05 07:35:12 +00:00
// Dependencies: [5753, 505, 5749, 3916, 589, 709, 2]
2026-07-20 16:05:17 +00:00
2026-08-05 07:35:12 +00:00
// Module 5752 (updateProduct)
2026-07-23 10:11:24 +00:00
import GPlayConnectionState from "GPlayConnectionState";
import { CurrencyCodes } from "sum";
2026-07-29 08:29:29 +00:00
import { Store } from "initialize";
import set from "formatSingleCurrencyPrice";
2026-07-23 10:11:24 +00:00
2026-07-20 16:05:17 +00:00
function updateProduct(currencyCode) {
const formatted = currencyCode.currencyCode.toLowerCase();
const result = currencyCode.price / 100;
2026-07-29 08:29:29 +00:00
if ("BG" === c14) {
2026-07-20 16:05:17 +00:00
if (formatted === CurrencyCodes.EUR) {
2026-08-05 07:35:12 +00:00
let formatDualPriceForBGResult = require(5749) /* formatSingleCurrencyPrice */.formatDualPriceForBG(result, { convertToMajorUnits: false });
const obj2 = require(5749) /* formatSingleCurrencyPrice */;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
let obj = {};
2026-07-20 16:05:17 +00:00
const merged = Object.assign(currencyCode);
2026-07-29 08:29:29 +00:00
obj.price = currencyCode.price;
obj.currencyCode = formatted;
obj.priceString = formatDualPriceForBGResult;
2026-07-20 16:05:17 +00:00
return obj;
}
2026-08-05 07:35:12 +00:00
obj = require(5749) /* formatSingleCurrencyPrice */;
2026-07-20 16:05:17 +00:00
formatDualPriceForBGResult = obj.formatSingleCurrencyPrice(result, formatted, { convertToMajorUnits: false });
}
function skusLoaded(arg0) {
let skus;
let skusType;
({ skus, skusType } = arg0);
2026-07-23 10:11:24 +00:00
let item = skus.forEach((identifier) => {
2026-07-29 08:29:29 +00:00
const result = store.set(identifier.identifier, identifier);
2026-07-20 16:05:17 +00:00
});
const arr = Array.from(map.values());
let found;
2026-07-29 08:29:29 +00:00
if (arr != null) {
2026-07-20 16:05:17 +00:00
found = arr.filter((arg0) => null != arg0);
}
2026-07-23 10:11:24 +00:00
let mapped = found;
2026-07-29 08:29:29 +00:00
if (found != null) {
2026-07-20 16:05:17 +00:00
const item1 = found.forEach((offerIds) => {
offerIds = undefined;
2026-07-29 08:29:29 +00:00
if (offerIds != null) {
2026-07-20 16:05:17 +00:00
offerIds = offerIds.offerIds;
}
if (null != offerIds) {
2026-07-29 08:29:29 +00:00
const item = offerIds.forEach((arg0) => set.add(arg0));
2026-07-20 16:05:17 +00:00
}
});
}
2026-07-29 08:29:29 +00:00
try {
mapped = undefined;
if (mapped != null) {
mapped = mapped.map(updateProduct);
}
if (mapped != null) {
const item2 = mapped.forEach((identifier) => {
const result = store.set(identifier.identifier, identifier);
2026-07-20 16:05:17 +00:00
});
}
if (GPlaySkusType.IN_APP === skusType) {
2026-07-29 08:29:29 +00:00
let c12 = false;
} else if (tmp12.SUBSCRIPTION === skusType) {
let c13 = false;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
} catch (tmp7) {
2026-08-05 07:35:12 +00:00
let result = require(3916) /* _createGatewayCheckoutContext */.captureBillingException(tmp7);
const obj = require(3916) /* _createGatewayCheckoutContext */;
2026-07-20 16:05:17 +00:00
}
}
2026-07-23 10:11:24 +00:00
GPlayConnectionState = GPlayConnectionState.GPlayConnectionState;
const GPlaySkusType = GPlayConnectionState.GPlaySkusType;
2026-07-20 16:05:17 +00:00
const DISCONNECTED = GPlayConnectionState.DISCONNECTED;
2026-07-29 08:29:29 +00:00
let c6 = null;
2026-07-20 16:05:17 +00:00
const map = new Map();
2026-07-23 10:11:24 +00:00
let set = new Set();
2026-07-20 16:05:17 +00:00
const set1 = new Set();
2026-07-29 08:29:29 +00:00
let c10 = null;
let c11 = false;
let c12 = false;
let c13 = false;
let c14 = null;
class IAPStore extends Store {
}
const prototype = IAPStore.prototype;
prototype["getProducts"] = function getProducts() {
return c6;
};
prototype["getOfferIds"] = function getOfferIds() {
return set;
};
prototype["getProduct"] = function getProduct(arg0) {
let value = map.get(arg0);
if (value == null) {
value = null;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return value;
};
prototype["isBusy"] = function isBusy() {
return set1.size > 0 || c11;
};
prototype["isPurchasingProduct"] = function isPurchasingProduct(GENERIC_CONSUMABLE) {
return set1.has(GENERIC_CONSUMABLE);
};
prototype["isReady"] = function isReady() {
return DISCONNECTED === GPlayConnectionState.CONNECTED;
};
prototype["hasConnectionError"] = function hasConnectionError() {
return DISCONNECTED === GPlayConnectionState.ERROR;
};
prototype["getPendingDowngrade"] = function getPendingDowngrade() {
return c10;
};
prototype["isFetchingGoogleSkus"] = function isFetchingGoogleSkus() {
let tmp = c13;
if (!c13) {
tmp = c12;
}
return tmp;
};
prototype["isFetchingProducts"] = function isFetchingProducts() {
let tmp = c13;
if (!c13) {
tmp = c12;
}
return tmp;
};
prototype["getUserCountry"] = function getUserCountry() {
return c14;
};
IAPStore.displayName = "IAPStore";
const iAPStore = new IAPStore(require("dispatcher"), {
2026-07-20 16:05:17 +00:00
GPLAY_UPDATE_CONNECTION_STATE: function updateConnectionState(connectionState) {
2026-07-23 10:11:24 +00:00
connectionState = connectionState.connectionState;
2026-07-20 16:05:17 +00:00
},
GPLAY_FETCH_SUBSCRIPTION_SKUS_START: function handleFetchSubscriptionSkusStart() {
2026-07-29 08:29:29 +00:00
let c13 = true;
2026-07-20 16:05:17 +00:00
},
GPLAY_SUBSCRIPTION_SKUS_LOADED: skusLoaded,
GPLAY_FETCH_SUBSCRIPTION_SKUS_FAILED: function handleFetchSubscriptionSkusFailed() {
2026-07-29 08:29:29 +00:00
let c13 = false;
2026-07-20 16:05:17 +00:00
},
GPLAY_FETCH_IN_APP_SKUS_START: function handleFetchInAppSkusStart() {
2026-07-29 08:29:29 +00:00
let c12 = true;
2026-07-20 16:05:17 +00:00
},
GPLAY_IN_APP_SKUS_LOADED: skusLoaded,
GPLAY_FETCH_IN_APP_SKUS_FAILED: function handleFetchInAppSkusFailed() {
2026-07-29 08:29:29 +00:00
let c12 = false;
2026-07-20 16:05:17 +00:00
},
GPLAY_VERIFICATION_START: function handleVerificationStart(productId) {
set1.add(productId.productId);
},
GPLAY_VERIFICATION_END: function handleVerificationEnd(productId) {
productId = productId.productId;
if (set1.has(productId)) {
2026-07-29 08:29:29 +00:00
obj.delete(productId);
2026-07-20 16:05:17 +00:00
} else {
const _Error = Error;
const _HermesInternal = HermesInternal;
const error = new Error("Tried verifying product without initialization: " + productId);
throw error;
}
2026-07-29 08:29:29 +00:00
obj = set1;
2026-07-20 16:05:17 +00:00
},
GPLAY_UPDATE_PENDING_DOWNGRADE: function handleUpdatePendingDowngrade(pendingDowngrade) {
pendingDowngrade = pendingDowngrade.pendingDowngrade;
},
GPLAY_UPDATE_IS_DOWNGRADING: function handleUpdateIsDowngrading(isDowngrading) {
isDowngrading = isDowngrading.isDowngrading;
},
GPLAY_SET_USER_COUNTRY: function handleSetUserCountry(countryCode) {
countryCode = countryCode.countryCode;
}
});
2026-07-23 10:11:24 +00:00
let result = set.fileFinishedImporting("stores/native/IAPStore.android.tsx");
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
export default iAPStore;