Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4792.js (118.4 MB)
173 lines
7.6 KiB
TypeScript
173 lines
7.6 KiB
TypeScript
// Module ID: 8675
|
|
// Function ID: 8676
|
|
// Name: useAgeVerificationMethods
|
|
// Dependencies: [5, 32, 19, 8541, 8500, 504, 4820, 8501, 8528, 7675, 7680, 8676, 8505, 1114, 2]
|
|
// Exports: default
|
|
|
|
// Module 8675 (useAgeVerificationMethods)
|
|
import util from "util" /* 1114 */;
|
|
import MonitoringAgentDefault from "MonitoringAgent" /* 7675 */;
|
|
import MetricEvents from "MetricEvents" /* 7680 */;
|
|
import AgeVerificationURLActionCreators from "AgeVerificationURLActionCreators" /* 8505 */;
|
|
import asyncGeneratorStep from "asyncGeneratorStep" /* 5 */;
|
|
import _slicedToArray from "module_32" /* 32 */;
|
|
import noop from "module_19" /* 19 */;
|
|
import AgeVerificationStore from "AgeVerificationStore" /* 8541 */;
|
|
|
|
require = fn;
|
|
const AgeVerificationConstants = fn(8500);
|
|
({ VERIFICATION_METHOD_TITLE_MAP: closure_7, VerificationMethod: closure_8 } = AgeVerificationConstants);
|
|
const size = fn(2);
|
|
let result = size.fileFinishedImporting("modules/age_assurance/hooks/useAgeVerificationMethods.tsx");
|
|
|
|
export default function useAgeVerificationMethods(onGoogleWalletSelect) {
|
|
onGoogleWalletSelect = onGoogleWalletSelect.onGoogleWalletSelect;
|
|
let initiateAgeVerification;
|
|
first = undefined;
|
|
_slicedToArray = undefined;
|
|
({ onClose, classificationId } = onGoogleWalletSelect);
|
|
let items = [AgeVerificationStore];
|
|
const stateFromStoresObject = onGoogleWalletSelect(initiateAgeVerification[5]).useStateFromStoresObject(items, () => ({ methods: AgeVerificationStore.methods, loading: AgeVerificationStore.loading }));
|
|
const methods = stateFromStoresObject.methods;
|
|
let obj = onGoogleWalletSelect(initiateAgeVerification[5]);
|
|
let obj2 = onGoogleWalletSelect(initiateAgeVerification[6]);
|
|
initiateAgeVerification = obj2.useInitiateAgeVerification({ onComplete: onClose, entryPoint: onGoogleWalletSelect(initiateAgeVerification[7]).AgeVerificationModalEntryPoint.EXPRESSIVE_GET_STARTED, shouldShowExpressiveModal: true, classificationId }).initiateAgeVerification;
|
|
[first, _slicedToArray] = noop.useState(false);
|
|
const effect = noop.useEffect(() => {
|
|
c0 = false;
|
|
let result = onGoogleWalletSelect(initiateAgeVerification[8]).checkGoogleWalletAvailable();
|
|
result.then((result) => {
|
|
if (!c0) {
|
|
const obj2 = { name: MetricEvents.MetricEvents.GOOGLE_WALLET_AVAILABILITY_CHECK, tags: null };
|
|
const _HermesInternal = HermesInternal;
|
|
const items = ["available:" + result];
|
|
obj2.tags = items;
|
|
MonitoringAgentDefault.increment(obj2);
|
|
if (result) {
|
|
result = tmp4(8676).isGoogleWalletEnabled("age_verification_methods");
|
|
const tmp4Result = tmp4(8676);
|
|
}
|
|
closure_4(result);
|
|
tmp4 = require;
|
|
}
|
|
});
|
|
return () => {
|
|
c0 = true;
|
|
};
|
|
}, []);
|
|
const items1 = [methods];
|
|
const effect1 = noop.useEffect(() => {
|
|
if (null == methods) {
|
|
const ageVerificationMethods = AgeVerificationURLActionCreators.getAgeVerificationMethods();
|
|
}
|
|
}, items1);
|
|
const items2 = [methods, first, onGoogleWalletSelect, initiateAgeVerification];
|
|
let obj3 = { onComplete: onClose, entryPoint: onGoogleWalletSelect(initiateAgeVerification[7]).AgeVerificationModalEntryPoint.EXPRESSIVE_GET_STARTED, shouldShowExpressiveModal: true, classificationId };
|
|
return {
|
|
ageVerificationMethods: noop.useMemo(() => {
|
|
let found1;
|
|
if (methods != null) {
|
|
const found = methods.filter((item) => item !== constants.GOOGLE_WALLET);
|
|
const mapped = found.map((id) => {
|
|
if (null == closure_1_7[id]) {
|
|
return null;
|
|
} else {
|
|
let obj = { id, title: null, description: null, onClick: null };
|
|
({ title, description } = tmp);
|
|
const intl = onGoogleWalletSelect(1114).intl;
|
|
obj.title = intl.string(title);
|
|
const intl2 = onGoogleWalletSelect(1114).intl;
|
|
obj.description = intl2.string(description);
|
|
closure_1 = first(function*(arg0, value) {
|
|
if (c1 === 2) {
|
|
c1 = 3;
|
|
throw new TypeError("Generator functions may not be called on executing generators");
|
|
} else if (tmp3 === 3) {
|
|
if (arg0 === 1) {
|
|
throw value;
|
|
} else if (arg0 === 2) {
|
|
const obj2 = { value, done: true };
|
|
return obj2;
|
|
} else {
|
|
return { value: "HermesInternal", done: null };
|
|
}
|
|
} else {
|
|
try {
|
|
c1 = 2;
|
|
if (0 === v1) {
|
|
if (arg0 === 1) {
|
|
c1 = 3;
|
|
throw value;
|
|
} else if (arg0 === 2) {
|
|
c1 = 3;
|
|
const obj3 = { value, done: true };
|
|
return obj3;
|
|
} else {
|
|
const obj5 = id(8501);
|
|
const result = obj5.trackAgeVerificationModalClicked(id, id(8501).AgeVerificationModalVersion.EXPRESSIVE_PRIMARY, id(8501).AgeVerificationModalCta.METHOD_SELECT, id);
|
|
v1 = 1;
|
|
c1 = 1;
|
|
const obj4 = { value: v1(id), done: false };
|
|
return obj4;
|
|
}
|
|
} else if (arg0 === 1) {
|
|
c1 = 3;
|
|
throw value;
|
|
} else if (arg0 === 2) {
|
|
c1 = 3;
|
|
const obj = { value, done: true };
|
|
return obj;
|
|
} else {
|
|
c1 = 3;
|
|
return { value: "HermesInternal", done: null };
|
|
}
|
|
} catch (tmp5) {
|
|
c1 = tmp;
|
|
throw tmp5;
|
|
}
|
|
}
|
|
});
|
|
obj.onClick = function() {
|
|
const self = this;
|
|
const apply = closure_1.apply;
|
|
if (typeof apply === "unknown") {
|
|
let applyArgumentsResult = HermesBuiltin.applyArguments(self);
|
|
} else {
|
|
applyArgumentsResult = apply(self, arguments);
|
|
}
|
|
return applyArgumentsResult;
|
|
};
|
|
return obj;
|
|
}
|
|
});
|
|
found1 = mapped.filter((item) => null != item);
|
|
}
|
|
if (found1 == null) {
|
|
found1 = [];
|
|
}
|
|
if (first) {
|
|
if (null != onGoogleWalletSelect) {
|
|
if (null != React5[constants.GOOGLE_WALLET]) {
|
|
let obj = { id: tmp3.GOOGLE_WALLET, title: null, description: null, onClick: null };
|
|
let intl = util.intl;
|
|
obj.title = intl.string(tmp4.title);
|
|
let intl2 = util.intl;
|
|
obj.description = intl2.string(tmp4.description);
|
|
obj.onClick = function onClick(modalSessionId) {
|
|
const obj = methods(initiateAgeVerification[9]);
|
|
obj.increment({ name: onGoogleWalletSelect(initiateAgeVerification[10]).MetricEvents.GOOGLE_WALLET_METHOD_SELECTED });
|
|
const obj2 = { name: onGoogleWalletSelect(initiateAgeVerification[10]).MetricEvents.GOOGLE_WALLET_METHOD_SELECTED };
|
|
const result = onGoogleWalletSelect(initiateAgeVerification[7]).trackAgeVerificationModalClicked(modalSessionId, onGoogleWalletSelect(initiateAgeVerification[7]).AgeVerificationModalVersion.EXPRESSIVE_PRIMARY, onGoogleWalletSelect(initiateAgeVerification[7]).AgeVerificationModalCta.METHOD_SELECT, constants.GOOGLE_WALLET);
|
|
closure_1_0();
|
|
};
|
|
const items = [];
|
|
items[HermesBuiltin.arraySpread(found1, 0)] = obj;
|
|
return items;
|
|
}
|
|
}
|
|
}
|
|
return found1;
|
|
}, items2),
|
|
loading: stateFromStoresObject.loading
|
|
};
|
|
};
|