@adyen/kyc-components
Version:
This guide assumes that you have already an account with Adyen. A legalEntity needs to be created, and you need to have a `legalEntityId` to instatiate a Component.
70 lines (69 loc) • 4.51 kB
JavaScript
try {
let e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "16cad73f-f68f-4a87-8a44-982db36c02f4", e._sentryDebugIdIdentifier = "sentry-dbid-16cad73f-f68f-4a87-8a44-982db36c02f4");
} catch (e) {}
import { n as addResourceBundles, r as useTranslation } from "./translation-BFxyJ1c5.js";
import { r as Loader } from "./Button-oj6H8OrC.js";
import { r as useLegalEntity } from "./useLegalEntity-yxi9XhLi.js";
import { t as getLegalEntityCountry } from "./getLegalEntityCountry-C6bSV6sB.js";
import { t as _rolldown_dynamic_import_helper_default } from "./_rolldown_dynamic_import_helper-rq_tsyLP.js";
import { C as EntityTypes } from "./processCapabilities-DlZY9-Jc.js";
import { p as TaskTypes } from "./entityAssociationUtil-BEzUdPbm.js";
import { n as useCapabilityProblems, t as getProblemsForEntity } from "./getProblemsForEntity-BLcIg3x_.js";
import { n as BusinessDetailsDropin, t as useBusinessDetailsData } from "./useBusinessDetailsData-DGPg34HR.js";
import { jsx } from "preact/jsx-runtime";
import { skipToken } from "@tanstack/preact-query";
//#region src/components/SoleProprietorship/pages/SoleProprietorshipPage.tsx
function SoleProprietorshipPage({ solePropId, onSubmit, handleHomeClick }) {
const { i18n } = useTranslation();
const { data: solePropLe } = useLegalEntity(solePropId ?? skipToken);
const capabilityProblems = useCapabilityProblems();
const { data, isLoading } = useBusinessDetailsData(TaskTypes.TRUST_MEMBER_COMPANY, solePropLe);
addResourceBundles(i18n, [{
ns: "business",
importFn: (lang) => _rolldown_dynamic_import_helper_default(/* @__PURE__ */ Object.assign({
"../../Business/language/bg-BG.json": () => import("./bg-BG-CodTfJR6.js"),
"../../Business/language/cs-CZ.json": () => import("./cs-CZ-BLE9aLKg.js"),
"../../Business/language/da-DK.json": () => import("./da-DK-DtAW2xZE.js"),
"../../Business/language/de-DE.json": () => import("./de-DE-DXNTaizu.js"),
"../../Business/language/el-GR.json": () => import("./el-GR-qH2iIn7-.js"),
"../../Business/language/en-US.json": () => import("./en-US-DBiYkRmE.js"),
"../../Business/language/es-ES.json": () => import("./es-ES-yxJhxnWV.js"),
"../../Business/language/et-EE.json": () => import("./et-EE-C3h50xW-.js"),
"../../Business/language/fi-FI.json": () => import("./fi-FI-wGXRm-tZ.js"),
"../../Business/language/fr-FR.json": () => import("./fr-FR-mFwC-nNY.js"),
"../../Business/language/hr-HR.json": () => import("./hr-HR-BAeB6ZDz.js"),
"../../Business/language/hu-HU.json": () => import("./hu-HU-Bb1gk4Jr.js"),
"../../Business/language/it-IT.json": () => import("./it-IT-CmoZrxWa.js"),
"../../Business/language/ja-JP.json": () => import("./ja-JP-CyP1sKap.js"),
"../../Business/language/lt-LT.json": () => import("./lt-LT-D0_qhzNo.js"),
"../../Business/language/lv-LV.json": () => import("./lv-LV-Bfkan_1O.js"),
"../../Business/language/nl-NL.json": () => import("./nl-NL-DXnNGqSV.js"),
"../../Business/language/no-NO.json": () => import("./no-NO-B1v42GMO2.js"),
"../../Business/language/pl-PL.json": () => import("./pl-PL-C5u2-nG22.js"),
"../../Business/language/pt-BR.json": () => import("./pt-BR-9jLurhS32.js"),
"../../Business/language/pt-PT.json": () => import("./pt-PT-B6DsKlac2.js"),
"../../Business/language/ro-RO.json": () => import("./ro-RO-9TjoIVJf2.js"),
"../../Business/language/sk-SK.json": () => import("./sk-SK-D5_Q4Djr2.js"),
"../../Business/language/sl-SI.json": () => import("./sl-SI-CuNIMCGx2.js"),
"../../Business/language/sv-SE.json": () => import("./sv-SE-C11kwGTV2.js")
}), `../../Business/language/${lang}.json`, 5)
}]);
if (isLoading || solePropId && !solePropLe) return /* @__PURE__ */ jsx(Loader, {});
const { rootLe, efpBusinessLines, documents } = data;
const problems = capabilityProblems && solePropId ? getProblemsForEntity(capabilityProblems, EntityTypes.LEGAL_ENTITY, solePropId) : void 0;
const country = getLegalEntityCountry(solePropLe ?? rootLe);
return /* @__PURE__ */ jsx(BusinessDetailsDropin, {
taskType: TaskTypes.SOLE_PROPRIETOR_COMPANY,
legalEntityResponse: rootLe,
efpBusinessLines,
documents,
associatedLegalArrangement: solePropLe,
problems: problems ?? {},
country,
onSubmit,
handleHomeClick
});
}
//#endregion
export { SoleProprietorshipPage };