import { p as proxyCustomElement, H, c as createEvent, h } from './p-a53686b3.js';
import { b as InfoCardType, a as InfoCardSize, I as InfoCardBorderPosition, c as InfoCardVariation } from './p-814ca2ad.js';
import { l as logger } from './p-e3d2e899.js';
import { d as defineCustomElement$5 } from './p-dafe1c96.js';
import { d as defineCustomElement$4 } from './p-da621047.js';
import { d as defineCustomElement$3 } from './p-3e02ce82.js';
import { d as defineCustomElement$2 } from './p-5c53d1d4.js';

const infoCardCss = ".sc-digi-info-card-h{--digi--info-card--background-color--primary:var(--digi--color--background--pop-out);--digi--info-card--background-color--secondary:var(--digi--color--background--secondary);--digi--info-card--background-color--related:var(--digi--color--background--primary);--digi--info-card--color--heading:var(--digi--color--text--primary);--digi--info-card--color--heading--multi:var(--digi--color--text--interactive--primary);--digi--info-card--border:var(--digi--border-width--complementary-2) solid var(--digi--color--border--accent--primary);--digi--info-card--padding:var(--digi--padding--large) var(--digi--padding--medium) var(--digi--padding--largest) var(--digi--padding--medium);--digi--info-card--padding--desktop:var(--digi--padding--largest-2) var(--digi--padding--largest) var(--digi--padding--largest-3) var(--digi--padding--largest);--digi--info-card--heading--font-weight:var(--digi--typography--heading-3--font-weight--desktop);--digi--info-card--heading--font-size--mobile:var(--digi--typography--heading-2--font-size--mobile);--digi--info-card--heading--font-size--desktop:var(--digi--typography--heading-2--font-size--desktop);--BACKGROUND-COLOR:var(--digi--info-card--background-color--single)}.sc-digi-info-card-h .digi-info-card.sc-digi-info-card{background-color:var(--BACKGROUND-COLOR);height:100%;display:grid;position:relative}.sc-digi-info-card-h .digi-info-card--primary.sc-digi-info-card{--BACKGROUND-COLOR:var(--digi--info-card--background-color--primary)}.sc-digi-info-card-h .digi-info-card--tip.sc-digi-info-card{--COLOR--HEADING:var(--digi--info-card--color--heading);--PADDING:var(--digi--info-card--padding);--MARGIN-TOP:var(--digi--margin--medium)}@media (min-width: 48rem){.sc-digi-info-card-h .digi-info-card--tip.sc-digi-info-card{--PADDING:var(--digi--info-card--padding--desktop)}}.sc-digi-info-card-h .digi-info-card--related.sc-digi-info-card{--BACKGROUND-COLOR:var(--digi--info-card--background-color--related);--COLOR--HEADING:var(--digi--info-card--color--heading);--PADDING:var(--digi--info-card--padding);--MARGIN-TOP:var(--digi--margin--medium)}@media (min-width: 48rem){.sc-digi-info-card-h .digi-info-card--related.sc-digi-info-card{--PADDING:var(--digi--info-card--padding--desktop)}}.sc-digi-info-card-h .digi-info-card--secondary.sc-digi-info-card{--BACKGROUND-COLOR:var(--digi--info-card--background-color--secondary)}.sc-digi-info-card-h .digi-info-card--border-top.sc-digi-info-card{border-top:var(--digi--info-card--border)}.sc-digi-info-card-h .digi-info-card--border-left.sc-digi-info-card{border-left:var(--digi--info-card--border)}.sc-digi-info-card-h .digi-info-card__content.sc-digi-info-card{grid-column:1;grid-row:1;padding:var(--PADDING)}.sc-digi-info-card-h .digi-info-card__icon.sc-digi-info-card{position:absolute;top:0;right:0;transform:translateY(-50%)}.sc-digi-info-card-h .digi-info-card__heading.sc-digi-info-card{font-family:var(--digi--global--typography--font-family--default);font-size:var(--digi--info-card--heading--font-size--mobile);margin-top:0;margin-bottom:0.5rem;font-weight:var(--digi--info-card--heading--font-weight);display:block;color:var(--COLOR--HEADING)}@media (min-width: 48rem){.sc-digi-info-card-h .digi-info-card__heading.sc-digi-info-card{font-size:var(--digi--info-card--heading--font-size--desktop);margin-bottom:1rem}}.sc-digi-info-card-h .digi-info-card--active-link.sc-digi-info-card .digi-info-card__heading.sc-digi-info-card{text-decoration:underline}.sc-digi-info-card-h .digi-info-card__link.sc-digi-info-card{margin-top:var(--MARGIN-TOP);display:block;font-size:inherit;line-height:inherit;font-weight:inherit}.sc-digi-info-card-h .digi-info-card__link-overlay.sc-digi-info-card{grid-column:1;grid-row:1;opacity:0}";
const DigiInfoCardStyle0 = infoCardCss;

const InfoCard = /*@__PURE__*/ proxyCustomElement(class InfoCard extends H {
    constructor() {
        super();
        this.__registerHost();
        this.afOnClickLink = createEvent(this, "afOnClickLink", 7);
        this.afHeading = undefined;
        this.afHeadingLevel = undefined;
        this.afType = InfoCardType.TIP;
        this.afSize = InfoCardSize.STANDARD;
        this.afBorderPosition = InfoCardBorderPosition.TOP;
        this.afVariation = InfoCardVariation.PRIMARY;
        this.afLinkText = undefined;
        this.afLinkHref = undefined;
        this.hideVisitedColor = undefined;
        this.activeLink = false;
        this.afSvgAriaHidden = undefined;
        this.hasListIcon = false;
    }
    // get shouldRenderListIcon() {
    // 	return true
    // }
    setHasListIcon() {
        const List = this.hostElement.querySelector('digi-list');
        if (List) {
            this.hasListIcon = true;
        }
    }
    componentWillLoad() {
        this.validateHeading();
        this.setHasListIcon();
    }
    validateHeading() {
        if (!this.afHeading || !this.afHeadingLevel) {
            logger.warn(`digi-info-card must have a heading and a heading level. Please add af-heading and af-heading-level`, this.hostElement);
        }
    }
    clickLinkHandler(e) {
        this.afOnClickLink.emit(e);
    }
    get shouldRenderInternalLink() {
        return this.afType !== this.afLinkText && this.afLinkHref;
    }
    get cssModifiers() {
        return {
            'digi-info-card--primary': this.afVariation === InfoCardVariation.PRIMARY &&
                this.afType === InfoCardType.TIP,
            'digi-info-card--secondary': this.afVariation === InfoCardVariation.SECONDARY,
            'digi-info-card--tip': this.afType === InfoCardType.TIP,
            'digi-info-card--related': this.afType === InfoCardType.RELATED,
            'digi-info-card--standard': this.afSize === InfoCardSize.STANDARD,
            'digi-info-card--border-top': this.afBorderPosition === InfoCardBorderPosition.TOP &&
                this.afType === InfoCardType.RELATED,
            'digi-info-card--border-left': this.afBorderPosition === InfoCardBorderPosition.LEFT &&
                this.afType === InfoCardType.RELATED,
            'digi-info-card--active-link': this.activeLink === true
        };
    }
    render() {
        return (h("div", { key: 'd329c1893d18b70ddb6e8d3823f8a97f8855b05f', class: Object.assign({ 'digi-info-card': true }, this.cssModifiers) }, h("div", { key: '2477bfc64a4c8042800baf4810a3a18cd7873d95', class: "digi-info-card__content" }, h("div", { key: 'c49f79c689160a902802682a3487c222ea59f530', class: "digi-info-card__icon" }, this.hasListIcon && (h("span", { key: '482ce58bd638ef055f9baacdd2ef9d4cd1f124ae', class: "digi-info-card__icon" }, h("slot", { key: '4f95901bb6f9ddb794f019bf3ee5efb242dcae4b', name: "icon" })))), h(this.afHeadingLevel, { key: '8793659ade0389f010cea838fd75275a5ac6c044', class: "digi-info-card__heading" }, this.afHeading), h("digi-typography", { key: '70d3f1b8a475742d8f679c13422762778922d085' }, h("slot", { key: '032c50f8c0044c7858a5b1f02ae5f9d46fa5da4a' })), this.shouldRenderInternalLink && (h("digi-link-internal", { key: 'a4960ea9eb277d21ab6b90bfe673c671a07f3f7f', class: "digi-info-card__link", afHref: this.afLinkHref, onAfOnClick: (e) => this.clickLinkHandler(e), hideVisitedColor: this.hideVisitedColor }, this.afLinkText)))));
    }
    get hostElement() { return this; }
    static get watchers() { return {
        "afHeading": ["validateHeading"],
        "afHeadingLevel": ["validateHeading"]
    }; }
    static get style() { return DigiInfoCardStyle0; }
}, [6, "digi-info-card", {
        "afHeading": [1, "af-heading"],
        "afHeadingLevel": [1, "af-heading-level"],
        "afType": [1, "af-type"],
        "afSize": [1, "af-size"],
        "afBorderPosition": [1, "af-border-position"],
        "afVariation": [1, "af-variation"],
        "afLinkText": [1, "af-link-text"],
        "afLinkHref": [1, "af-link-href"],
        "hideVisitedColor": [4, "hide-visited-color"],
        "afSvgAriaHidden": [4, "af-svg-aria-hidden"],
        "activeLink": [32],
        "hasListIcon": [32]
    }, undefined, {
        "afHeading": ["validateHeading"],
        "afHeadingLevel": ["validateHeading"]
    }]);
function defineCustomElement$1() {
    if (typeof customElements === "undefined") {
        return;
    }
    const components = ["digi-info-card", "digi-icon-chevron-right", "digi-link", "digi-link-internal", "digi-typography"];
    components.forEach(tagName => { switch (tagName) {
        case "digi-info-card":
            if (!customElements.get(tagName)) {
                customElements.define(tagName, InfoCard);
            }
            break;
        case "digi-icon-chevron-right":
            if (!customElements.get(tagName)) {
                defineCustomElement$5();
            }
            break;
        case "digi-link":
            if (!customElements.get(tagName)) {
                defineCustomElement$4();
            }
            break;
        case "digi-link-internal":
            if (!customElements.get(tagName)) {
                defineCustomElement$3();
            }
            break;
        case "digi-typography":
            if (!customElements.get(tagName)) {
                defineCustomElement$2();
            }
            break;
    } });
}

const DigiInfoCard = InfoCard;
const defineCustomElement = defineCustomElement$1;

export { DigiInfoCard, defineCustomElement };
