Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4790.js (118.4 MB)
47 lines
2.1 KiB
TypeScript
47 lines
2.1 KiB
TypeScript
// Module ID: 7469
|
|
// Function ID: 7470
|
|
// Name: BlockedPaymentsCountryExperiment
|
|
// Dependencies: [4519, 1433, 7470, 2]
|
|
// Exports: getIsPaymentsBlocked, useBlockedPaymentsConfig, useIsPaymentsBlocked
|
|
|
|
// Module 7469 (BlockedPaymentsCountryExperiment)
|
|
import useGeoForUserDefault from "useGeoForUser" /* 7470 */;
|
|
import createExperiment from "module_4519" /* 4519 */;
|
|
import ApexExperiment from "ApexExperiment" /* 1433 */;
|
|
import size from "module_2" /* 2 */;
|
|
|
|
const obj = { kind: "user", id: "2022-03_block_russian_purchases", label: "Block purchases based on country", defaultConfig: { paymentsBlocked: false }, treatments: null };
|
|
const items = [{ id: 1, label: "Payments Blocked", config: { paymentsBlocked: true } }];
|
|
obj.treatments = items;
|
|
let closure_2 = createExperiment.createExperiment(obj);
|
|
const obj2 = { name: "2026-03-block-purchases", kind: "user", defaultConfig: { enabled: false }, variations: null };
|
|
const obj3 = { 1: null };
|
|
obj3[1] = { enabled: true };
|
|
obj2.variations = obj3;
|
|
let closure_3 = ApexExperiment.createApexExperiment(obj2);
|
|
const result = size.fileFinishedImporting("modules/billing/experiments/BlockedPaymentsCountryExperiment.tsx");
|
|
|
|
export const useBlockedPaymentsConfig = function useBlockedPaymentsConfig() {
|
|
let enabled = closure_2.useExperiment({ location: "c519a9_1" }, { autoTrackExposure: false }).paymentsBlocked;
|
|
if (!enabled) {
|
|
enabled = closure_3.useConfig({ location: "c519a9_1" }).enabled;
|
|
}
|
|
if (!enabled) {
|
|
enabled = "RU" === useGeoForUserDefault().defaultBillingCountryCode;
|
|
}
|
|
return enabled;
|
|
};
|
|
export const useIsPaymentsBlocked = function useIsPaymentsBlocked() {
|
|
let enabled = closure_2.useExperiment({ location: "dc120b_3" }, { autoTrackExposure: false }).paymentsBlocked;
|
|
if (!enabled) {
|
|
enabled = closure_3.useConfig({ location: "dc120b_3" }).enabled;
|
|
}
|
|
return enabled;
|
|
};
|
|
export const getIsPaymentsBlocked = function getIsPaymentsBlocked() {
|
|
let enabled = closure_2.getCurrentConfig({ location: "1ee357_1" }, { autoTrackExposure: false }).paymentsBlocked;
|
|
if (!enabled) {
|
|
enabled = closure_3.getConfig({ location: "1ee357_1" }).enabled;
|
|
}
|
|
return enabled;
|
|
};
|