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] = "2160b329-ebc4-4321-a920-f6df6fec2862", e._sentryDebugIdIdentifier = "sentry-dbid-2160b329-ebc4-4321-a920-f6df6fec2862");
} catch (e) {}
import { n as addResourceBundles, r as useTranslation } from "./translation-Br5wIPO-.js";
import { i as stylesheets, n as EmbedShell, t as resolveEnvironment } from "./resolveEnvironment-BcrJH82n.js";
import { s as useApiContext } from "./http-CHTzpXCd.js";
import { t as _rolldown_dynamic_import_helper_default } from "./_rolldown_dynamic_import_helper-CCXvMgfE.js";
import { n as useTermsOfServiceAcceptanceInfos, t as useTermsOfServiceStatus } from "./useTermsOfServiceStatus-Dh4huPkR.js";
import { t as emitAdyenSdkEvent } from "./emitEvent-DYC1em5m.js";
import { t as EmbeddedStatus } from "./EmbeddedStatus-Ch7vvcve.js";
import register from "preact-custom-element";
import { useRef } from "preact/hooks";
import { jsx } from "preact/jsx-runtime";
//#region src/components/EmbeddedDropins/ManageTermsOfServiceComponent/ManageTermsOfServiceComponent.tsx
function ManageTermsOfServiceComponent({ legalEntityId, onClick }) {
	const { rootLegalEntityId: currentLegalEntityId } = useApiContext();
	currentLegalEntityId.value = legalEntityId;
	const { i18n, t } = useTranslation(["ui", "contract"]);
	const { isLoading: isLoadingSigned, data: signedData } = useTermsOfServiceAcceptanceInfos();
	const { isLoading: isLoadingUnsigned, data: unsignedData } = useTermsOfServiceStatus();
	addResourceBundles(i18n, [{
		ns: "ui",
		importFn: (lang) => _rolldown_dynamic_import_helper_default(/* @__PURE__ */ Object.assign({
			"../../ui/language/bg-BG.json": () => import("./bg-BG-IjNKw0Zu.js"),
			"../../ui/language/cs-CZ.json": () => import("./cs-CZ-B6AZX4nL.js"),
			"../../ui/language/da-DK.json": () => import("./da-DK-B8aHvZ1W.js"),
			"../../ui/language/de-DE.json": () => import("./de-DE-cPL-uSMG.js"),
			"../../ui/language/el-GR.json": () => import("./el-GR-BDXwftjw.js"),
			"../../ui/language/en-US.json": () => import("./en-US-_l9425V1.js"),
			"../../ui/language/es-ES.json": () => import("./es-ES-D67pkLVu.js"),
			"../../ui/language/et-EE.json": () => import("./et-EE-Dg93VJbx.js"),
			"../../ui/language/fi-FI.json": () => import("./fi-FI-BNtrKnDN.js"),
			"../../ui/language/fr-FR.json": () => import("./fr-FR-DYDmBWWT.js"),
			"../../ui/language/hr-HR.json": () => import("./hr-HR-DbebVQF9.js"),
			"../../ui/language/hu-HU.json": () => import("./hu-HU-e9KN8lp6.js"),
			"../../ui/language/it-IT.json": () => import("./it-IT-16IjDttL.js"),
			"../../ui/language/ja-JP.json": () => import("./ja-JP-CJY6uqPb.js"),
			"../../ui/language/lt-LT.json": () => import("./lt-LT-BVVTYN3z.js"),
			"../../ui/language/lv-LV.json": () => import("./lv-LV-BeobSRYx.js"),
			"../../ui/language/nl-NL.json": () => import("./nl-NL-DKpjFbpm.js"),
			"../../ui/language/no-NO.json": () => import("./no-NO-CG5RteG_.js"),
			"../../ui/language/pl-PL.json": () => import("./pl-PL-R6bNjSQB.js"),
			"../../ui/language/pt-BR.json": () => import("./pt-BR-VlNZLr8f.js"),
			"../../ui/language/pt-PT.json": () => import("./pt-PT-Dmor9x6o.js"),
			"../../ui/language/ro-RO.json": () => import("./ro-RO-BRtHlgch.js"),
			"../../ui/language/sk-SK.json": () => import("./sk-SK--ohjuOMW.js"),
			"../../ui/language/sl-SI.json": () => import("./sl-SI-DWJzi8r_.js"),
			"../../ui/language/sv-SE.json": () => import("./sv-SE-DTpqjuJd.js")
		}), `../../ui/language/${lang}.json`, 5)
	}, {
		ns: "contract",
		importFn: (lang) => _rolldown_dynamic_import_helper_default(/* @__PURE__ */ Object.assign({
			"../../Contract/language/bg-BG.json": () => import("./bg-BG-mf-xq3ph.js"),
			"../../Contract/language/cs-CZ.json": () => import("./cs-CZ-B_nYIuIi.js"),
			"../../Contract/language/da-DK.json": () => import("./da-DK-CBt4gQjw.js"),
			"../../Contract/language/de-DE.json": () => import("./de-DE-D8Is4iJk.js"),
			"../../Contract/language/el-GR.json": () => import("./el-GR-BZ9AJNm4.js"),
			"../../Contract/language/en-US.json": () => import("./en-US-BhctnSAK.js"),
			"../../Contract/language/es-ES.json": () => import("./es-ES-B2MIlPdM.js"),
			"../../Contract/language/et-EE.json": () => import("./et-EE-Lw-rTsG-.js"),
			"../../Contract/language/fi-FI.json": () => import("./fi-FI-TDF0ZiiC.js"),
			"../../Contract/language/fr-FR.json": () => import("./fr-FR-fwcu0Hmd.js"),
			"../../Contract/language/hr-HR.json": () => import("./hr-HR-dL_cUkZa.js"),
			"../../Contract/language/hu-HU.json": () => import("./hu-HU-ReTWA1v3.js"),
			"../../Contract/language/it-IT.json": () => import("./it-IT-C2JfprsD.js"),
			"../../Contract/language/ja-JP.json": () => import("./ja-JP-BRGxY7zc.js"),
			"../../Contract/language/lt-LT.json": () => import("./lt-LT-_MAUl9-y.js"),
			"../../Contract/language/lv-LV.json": () => import("./lv-LV-Br4-Sv0n.js"),
			"../../Contract/language/nl-NL.json": () => import("./nl-NL-ByNQn3Ma.js"),
			"../../Contract/language/no-NO.json": () => import("./no-NO-CX2Lkpbt.js"),
			"../../Contract/language/pl-PL.json": () => import("./pl-PL-W0KU0YTp.js"),
			"../../Contract/language/pt-BR.json": () => import("./pt-BR-CdeMGenL.js"),
			"../../Contract/language/pt-PT.json": () => import("./pt-PT-BEkfXdZQ.js"),
			"../../Contract/language/ro-RO.json": () => import("./ro-RO-tf_g2ahZ.js"),
			"../../Contract/language/sk-SK.json": () => import("./sk-SK-DaSC7QsL.js"),
			"../../Contract/language/sl-SI.json": () => import("./sl-SI-C6KiyZyh.js"),
			"../../Contract/language/sv-SE.json": () => import("./sv-SE-CTB2971Y.js")
		}), `../../Contract/language/${lang}.json`, 5)
	}]);
	const signed = signedData?.data?.map((d) => d.type);
	const unsigned = unsignedData?.termsOfServiceTypes;
	const hasSignedAll = signed?.length !== 0 && unsigned?.length === 0;
	const isLoading = isLoadingSigned && isLoadingUnsigned;
	const title = t(($) => $["serviceAgreements"], { ns: "contract" });
	return hasSignedAll ? /* @__PURE__ */ jsx(EmbeddedStatus, {
		onClick,
		title,
		tag: {
			text: t(($) => $["complete"]),
			variant: "green"
		},
		loading: isLoading
	}) : /* @__PURE__ */ jsx(EmbeddedStatus, {
		onClick,
		actionIndicator: { text: t(($) => $["accept"], { ns: "contract" }) },
		title,
		loading: isLoading
	});
}
//#endregion
//#region src/embeds/terms-of-service-status/adyen-terms-of-service-status.tsx
/**
* Enables users to view the status of the Terms of Service documents and download the signed copies.
*/
var AdyenManageTermsOfService = ({ rootlegalentityid, fetchToken, environment, locale, settings = {}, experiments = {} }) => {
	const eventEmitterRef = useRef(null);
	const handleOnClick = () => {
		emitAdyenSdkEvent(eventEmitterRef, "click");
	};
	return /* @__PURE__ */ jsx("div", {
		ref: eventEmitterRef,
		style: "width:100%;",
		children: /* @__PURE__ */ jsx(EmbedShell, {
			componentName: "adyen-terms-of-service-status",
			rootLegalEntityId: rootlegalentityid,
			settings,
			features: experiments,
			getSdkToken: fetchToken,
			locale,
			baseUrl: resolveEnvironment(environment),
			children: /* @__PURE__ */ jsx(ManageTermsOfServiceComponent, {
				legalEntityId: rootlegalentityid,
				onClick: handleOnClick
			})
		})
	});
};
register(AdyenManageTermsOfService, "adyen-terms-of-service-status", [
	"rootlegalentityid",
	"fetchToken",
	"environment",
	"locale",
	"settings",
	"experiments"
], {
	shadow: true,
	adoptedStyleSheets: stylesheets
});
//#endregion
