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] = "d4c08306-7834-42f4-bdd0-a782405cd93b", e._sentryDebugIdIdentifier = "sentry-dbid-d4c08306-7834-42f4-bdd0-a782405cd93b");
} catch (e) {}
import { i as stylesheets, n as EmbedShell, t as resolveEnvironment } from "./resolveEnvironment-BcrJH82n.js";
import { t as emitAdyenSdkEvent } from "./emitEvent-DYC1em5m.js";
import { t as AcceptTermsOfServiceComponent } from "./AcceptTermsOfServiceComponent-BIYgOoqa.js";
import register from "preact-custom-element";
import { useRef } from "preact/hooks";
import { jsx } from "preact/jsx-runtime";
//#region src/embeds/terms-of-service-management/adyen-terms-of-service-management.tsx
/**
* Enables users to view and accept the Terms of Service documents.
*/
var AdyenTermsOfService = ({ rootlegalentityid, fetchToken, environment, locale, settings = {}, experiments = {}, view }) => {
	const eventEmitterRef = useRef(null);
	const handleOnComplete = (data) => {
		emitAdyenSdkEvent(eventEmitterRef, "complete", data);
	};
	const handleOnAccept = (data) => {
		emitAdyenSdkEvent(eventEmitterRef, "accept", data);
	};
	const handleOnClose = () => {
		emitAdyenSdkEvent(eventEmitterRef, "close");
	};
	return /* @__PURE__ */ jsx("div", {
		ref: eventEmitterRef,
		style: "width:100%;",
		children: /* @__PURE__ */ jsx(EmbedShell, {
			componentName: "adyen-terms-of-service-management",
			rootLegalEntityId: rootlegalentityid,
			settings,
			features: experiments,
			getSdkToken: fetchToken,
			locale,
			baseUrl: resolveEnvironment(environment),
			children: /* @__PURE__ */ jsx(AcceptTermsOfServiceComponent, {
				legalEntityId: rootlegalentityid,
				onAccept: handleOnAccept,
				onComplete: handleOnComplete,
				modalView: view === "modal",
				onClose: handleOnClose
			})
		})
	});
};
register(AdyenTermsOfService, "adyen-terms-of-service-management", [
	"rootlegalentityid",
	"fetchToken",
	"environment",
	"locale",
	"settings",
	"experiments",
	"view"
], {
	shadow: true,
	adoptedStyleSheets: stylesheets
});
//#endregion
export { AdyenTermsOfService };
