;
{
  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] = "22013cb6-5198-451b-9a65-9a5805827e48", e._sentryDebugIdIdentifier = "sentry-dbid-22013cb6-5198-451b-9a65-9a5805827e48");
  } catch (e) {
  }
}
;
import { jsxs, jsx } from "preact/jsx-runtime";
import cx from "classnames";
import { isValidElement, cloneElement } from "preact";
import { V as Button, L as Loader, r as Icon } from "./StoreProvider-CqQrndhS.js";
const endStateLayout = "adyen-kyc-end-state-layout";
const endStateLayoutHeader = "adyen-kyc-end-state-layout-header";
const endStateLayoutIcon = "adyen-kyc-end-state-layout-icon";
const endStateLayoutIconSuccess = "adyen-kyc-end-state-layout-icon-success";
const endStateLayoutIconError = "adyen-kyc-end-state-layout-icon-error";
const endStateLayoutIconInfo = "adyen-kyc-end-state-layout-icon-info";
const endStateLayoutIconWarning = "adyen-kyc-end-state-layout-icon-warning";
const endStateLayoutTitle = "adyen-kyc-end-state-layout-title";
const endStateLayoutDescription = "adyen-kyc-end-state-layout-description";
const endStateLayoutAction = "adyen-kyc-end-state-layout-action";
const styles = {
  endStateLayout,
  endStateLayoutHeader,
  endStateLayoutIcon,
  endStateLayoutIconSuccess,
  endStateLayoutIconError,
  endStateLayoutIconInfo,
  endStateLayoutIconWarning,
  endStateLayoutTitle,
  endStateLayoutDescription,
  endStateLayoutAction
};
const EndStateLayout = ({
  action,
  description,
  loading = false,
  title,
  variant = "success"
}) => {
  if (action && (!isValidElement(action) || action.type !== Button)) {
    throw new Error('EndStateLayout component only accepts Button component as "action".');
  }
  const iconClassname = cx(styles.endStateLayoutIcon, {
    [styles.endStateLayoutIconSuccess]: variant === "success",
    [styles.endStateLayoutIconError]: variant === "error",
    [styles.endStateLayoutIconWarning]: variant === "warning",
    [styles.endStateLayoutIconInfo]: variant === "info" || variant === "basic"
  });
  const iconName = {
    basic: "info-circle",
    error: "cross",
    info: "info-circle",
    success: "check",
    warning: "warning"
  };
  const actionButton = action ? cloneElement(action, { disabled: loading }) : null;
  return /* @__PURE__ */ jsxs("article", { className: styles.endStateLayout, children: [
    /* @__PURE__ */ jsxs("header", { className: styles.endStateLayoutHeader, children: [
      loading ? /* @__PURE__ */ jsx("div", { className: styles.endStateLayoutIcon, role: "progressbar", children: /* @__PURE__ */ jsx(Loader, {}) }) : /* @__PURE__ */ jsx("div", { className: iconClassname, role: "img", "aria-label": variant, children: /* @__PURE__ */ jsx(Icon, { name: iconName[variant] }) }),
      /* @__PURE__ */ jsx("h1", { className: styles.endStateLayoutTitle, children: title }),
      description && /* @__PURE__ */ jsx("div", { className: styles.endStateLayoutDescription, children: description })
    ] }),
    actionButton && /* @__PURE__ */ jsx("div", { className: styles.endStateLayoutAction, role: "toolbar", children: actionButton })
  ] });
};
export {
  EndStateLayout as E
};
