// ../src/helpers/formatClassString.ts
var formatClassString = (classesArray) => {
  return classesArray.filter((x) => !!x).join(" ");
};

// ../src/foundations/icons/sprite.svg
import { h } from "preact";
import { jsx, jsxs } from "preact/jsx-runtime";

// ../src/components/icon-sprite/icon-sprite.tsx
import { jsx as jsx2 } from "preact/jsx-runtime";

// ../src/components/teaser-dot/teaser-dot.tsx
import { jsx as jsx3 } from "preact/jsx-runtime";

// ../src/helpers/teaser.tsx
import { Fragment, jsx as jsx4, jsxs as jsxs2 } from "preact/jsx-runtime";
var Media = ({ media, rounded, isSquareImage }) => {
  const classNames = formatClassString([
    "ds-teaser__media",
    rounded && "ds-teaser__media--rounded",
    isSquareImage && "ds-teaser__media--square-image"
  ]);
  return media ? /* @__PURE__ */ jsx4("div", { className: classNames, children: media }) : null;
};
var Content = ({ children, bylinePicture }) => {
  return /* @__PURE__ */ jsxs2("div", { className: "ds-teaser__content", children: [
    /* @__PURE__ */ jsx4("div", { className: "ds-teaser__content-inner", children }),
    bylinePicture && /* @__PURE__ */ jsx4("div", { className: "ds-teaser__byline", children: bylinePicture })
  ] });
};

// ../src/components/teaser-card/teaser-card.tsx
import { jsx as jsx5 } from "preact/jsx-runtime";
var TeaserCard = ({ areaType, targetLink, theme, classNames, attributes, children }) => {
  const componentClassName = "ds-teaser";
  const classes = formatClassString([
    componentClassName,
    areaType && areaType !== "main" && `${componentClassName}--${areaType}`,
    areaType == "bauta" && "ds-dark",
    theme && `ds-theme--${theme}`,
    classNames
  ]);
  if (targetLink) {
    return /* @__PURE__ */ jsx5("a", { className: classes, href: targetLink, ...attributes, children });
  }
  return /* @__PURE__ */ jsx5("div", { className: classes, ...attributes, children });
};

// ../src/components/teaser-counter/teaser-counter.tsx
import { jsx as jsx6, jsxs as jsxs3 } from "preact/jsx-runtime";
var TeaserCounter = ({
  areaType,
  targetLink,
  classNames,
  attributes,
  media,
  counterText,
  counterNumber,
  title,
  subtitle
}) => {
  const componentClassName = "ds-teaser--counter";
  const classes = formatClassString([componentClassName, classNames]);
  const counterNumberIsValid = counterNumber !== void 0 && counterNumber !== null;
  return /* @__PURE__ */ jsxs3(TeaserCard, { areaType, targetLink, classNames: classes, attributes, children: [
    /* @__PURE__ */ jsxs3(Content, { children: [
      title && /* @__PURE__ */ jsxs3("h2", { className: `${componentClassName}__title`, children: [
        /* @__PURE__ */ jsx6("span", { className: `${componentClassName}__title--highlighted`, children: title }),
        subtitle && ` \u2013 ${subtitle}`
      ] }),
      (counterNumberIsValid || counterText) && /* @__PURE__ */ jsxs3("div", { className: `${componentClassName}__counter-wrapper`, children: [
        counterNumberIsValid && /* @__PURE__ */ jsx6("ul", { className: `${componentClassName}__list`, children: counterNumber.toString().split("").map((digit, index) => /* @__PURE__ */ jsx6("li", { className: `${componentClassName}__item`, children: digit }, index)) }),
        counterText && /* @__PURE__ */ jsx6(
          "p",
          {
            className: `${componentClassName}__counter-text`,
            dangerouslySetInnerHTML: { __html: counterText }
          }
        )
      ] })
    ] }),
    /* @__PURE__ */ jsx6(Media, { media })
  ] });
};
export {
  TeaserCounter
};
//# sourceMappingURL=teaser-counter.js.map
