import { p as proxyCustomElement, H, h } from './p-a53686b3.js';
import './p-717306ef.js';
import { T as TitleLogoVariation } from './p-5a256d98.js';
import './p-a4a001e1.js';
import './p-f518a4cf.js';
import './p-7e32c40b.js';
import './p-dcdffb3c.js';
import './p-5d21a361.js';
import './p-ad16c7a1.js';
import './p-f40f4b2a.js';
import './p-1f68d501.js';
import './p-ee88e3f1.js';
import './p-8142cc73.js';
import './p-905ccb30.js';
import './p-bc3d2778.js';
import './p-c8429245.js';
import './p-06625463.js';
import './p-f447b984.js';
import './p-9c5a93d8.js';
import './p-7933b555.js';
import './p-0f6c0360.js';
import './p-814ca2ad.js';
import './p-d8a98b3b.js';
import './p-07303cb5.js';
import './p-5f8dc01a.js';
import './p-2a023831.js';
import './p-5ba6737a.js';
import './p-e4a9f8f0.js';
import './p-f2a6768b.js';
import './p-40657c82.js';
import './p-f600576a.js';
import './p-3b20ec86.js';
import './p-9dd5d6c8.js';
import './p-77a93845.js';
import './p-06f939ab.js';
import './p-8cd2d6dd.js';
import './p-484a1d6d.js';
import './p-0f3fbb1e.js';
import './p-820e795b.js';
import './p-46cbbcb5.js';
import './p-d74742b8.js';
import './p-6e383896.js';
import './p-4bad4fb0.js';
import './p-d1886fff.js';
import './p-a6ca40fc.js';
import './p-b0e88537.js';
import { U as UtilBreakpointObserverBreakpoints } from './p-cdcaf0eb.js';
import { d as defineCustomElement$1 } from './p-4768901b.js';

const titleLogoCss = ".sc-digi-title-logo-h{display:block;--digi--title-logo-text-color:var(--digi--color--text--primary);--digi--title-logo-font-weight:var(--digi--global--typography--font-weight--bold);--digi--title-logo-font-size:var(--digi--typography--title-logo--font-size--mobile);--digi--title-logo-font-size-small:var(--digi--global--typography--font-size--large);--digi--title-logo-line-height-small:1.25rem;--digi--title-logo-symbol-color:var(--digi--color--logotype-color);--digi--title-logo-symbol-width:36px;--digi--title-logo-symbol-height:36px;--digi--title-logo-symbol-width-mobile:44px;--digi--title-logo-symbol-height-mobile:44px;--digi--title-logo-text-height:40px;--digi--title-logo-border-width:var(--digi--global--border-width--base);--digi--title-logo-vertical-padding:1.375rem;--digi--title-logo-gap:9px}.sc-digi-title-logo-h .digi-title-logo.sc-digi-title-logo{color:var(--digi--title-logo-text-color);display:flex;align-items:center;padding:var(--digi--title-logo-vertical-padding) 0}@media (min-width: 48rem){.sc-digi-title-logo-h .digi-title-logo.sc-digi-title-logo{--digi--title-logo-vertical-padding:1.5rem}}.sc-digi-title-logo-h .digi-title-logo.sc-digi-title-logo:focus-visible{outline:2px solid black;outline-offset:-3px;box-shadow:0px 0px 0px 5px inset white}.sc-digi-title-logo-h .digi-title-logo-symbol.sc-digi-title-logo{height:var(--digi--title-logo-symbol-height);width:var(--digi--title-logo-symbol-width);display:flex;flex-shrink:0;align-items:center}.sc-digi-title-logo-h .digi-title-logo-symbol.sc-digi-title-logo svg.sc-digi-title-logo{fill:var(--digi--title-logo-symbol-color)}.sc-digi-title-logo-h .digi-title-logo-name-wrapper.sc-digi-title-logo{color:var(--digi--title-logo-text-color);display:flex;flex-direction:column;justify-content:center;height:var(--digi--title-logo-text-height);border-left:var(--digi--title-logo-border-width) solid;margin-left:var(--digi--title-logo-gap);padding-left:var(--digi--title-logo-gap);font-weight:var(--digi--title-logo-font-weight);font-size:var(--digi--title-logo-font-size)}.sc-digi-title-logo-h .digi-title-logo.sc-digi-title-logo-s>[slot=logo-two-rows],.sc-digi-title-logo-h .digi-title-logo .sc-digi-title-logo-s>[slot=logo-two-rows]{display:flex;flex-direction:column;font-size:var(--digi--title-logo-font-size-small);line-height:var(--digi--title-logo-line-height-small)}.sc-digi-title-logo-h .digi-title-logo--mobile.sc-digi-title-logo{--digi--title-logo-symbol-height:var(--digi--title-logo-symbol-height-mobile);--digi--title-logo-symbol-width:var(--digi--title-logo-symbol-width-mobile)}.sc-digi-title-logo-h .digi-title-logo--mobile.sc-digi-title-logo .digi-title-logo-name-wrapper.sc-digi-title-logo{display:none}.sc-digi-title-logo-h .digi-title-logo--one-row.sc-digi-title-logo-s>[slot=logo-two-rows],.sc-digi-title-logo-h .digi-title-logo--one-row .sc-digi-title-logo-s>[slot=logo-two-rows]{display:none}.sc-digi-title-logo-h .digi-title-logo--two-rows.sc-digi-title-logo-s>[slot=logo-one-row],.sc-digi-title-logo-h .digi-title-logo--two-rows .sc-digi-title-logo-s>[slot=logo-one-row]{display:none}";
const DigiTitleLogoStyle0 = titleLogoCss;

const TitleLogo = /*@__PURE__*/ proxyCustomElement(class TitleLogo extends H {
    constructor() {
        super();
        this.__registerHost();
        this.handleWindowResize = () => {
            this.titleLogoVariation = this.setLogoVariation(window.innerWidth);
        };
        this.isMobile = undefined;
        this.isTablet = undefined;
        this.titleLogoVariation = undefined;
        this.afAriaLabel = undefined;
        this.afLogoBreakpoint = undefined;
    }
    setLogoVariation(width) {
        if (this.isMobile)
            return TitleLogoVariation.MOBILE;
        const isNarrow = this.afLogoBreakpoint
            ? width < this.afLogoBreakpoint
            : this.isTablet;
        if (isNarrow) {
            return this.hasTwoRowLogoName
                ? TitleLogoVariation.TWO_ROWS
                : TitleLogoVariation.ONE_ROW;
        }
        return this.hasOneRowLogoName
            ? TitleLogoVariation.ONE_ROW
            : TitleLogoVariation.TWO_ROWS;
    }
    /**
     * Find out if we have one or both of the possible logo variations
     * Throw an error if we have none
     */
    componentWillLoad() {
        this.hasOneRowLogoName = !!this.hostElement.querySelector('[slot="logo-one-row"]');
        this.hasTwoRowLogoName = !!this.hostElement.querySelector('[slot="logo-two-rows"]');
        if (!this.hasOneRowLogoName && !this.hasTwoRowLogoName) {
            throw new Error('Du behöver ange minst en variant av logo-text');
        }
    }
    /**
     * We need a custom resize listener here, since we're
     * not only relying on breakpoints
     */
    componentDidLoad() {
        if (window) {
            this.handleWindowResize();
            window.addEventListener('resize', this.handleWindowResize, { passive: true });
        }
    }
    /**
     * Let's clean up as well
     */
    disconnectedCallback() {
        if (window) {
            window.removeEventListener('resize', this.handleWindowResize);
        }
    }
    handleBreakpointObserver(e) {
        this.isMobile = e.detail.value === UtilBreakpointObserverBreakpoints.SMALL;
        this.isTablet = e.detail.value === UtilBreakpointObserverBreakpoints.MEDIUM;
    }
    get cssModifiers() {
        return {
            'digi-title-logo--mobile': this.titleLogoVariation === TitleLogoVariation.MOBILE,
            'digi-title-logo--one-row': this.titleLogoVariation === TitleLogoVariation.ONE_ROW,
            'digi-title-logo--two-rows': this.titleLogoVariation === TitleLogoVariation.TWO_ROWS
        };
    }
    render() {
        return (h("div", { key: '3529ae2c761883716e7ef698ea2ce35f70108bb9', class: Object.assign({ 'digi-title-logo': true }, this.cssModifiers) }, h("digi-util-breakpoint-observer", { key: '5404aac52451d6041e5a6e60d430b6d81a24a63f', onAfOnChange: (e) => this.handleBreakpointObserver(e) }), h("div", { key: 'f417c914c65d6898d34187a1aa3f31e9c7137bf2', class: "digi-title-logo-symbol" }, h("svg", { key: '6d3a73a4b112f93af24d2bee57278380d7f1ab4e', viewBox: "0 0 44 44", fill: "none", xmlns: "http://www.w3.org/2000/svg", role: "img" }, h("path", { key: 'eee432df3edbb799bc79dd4b47521499ed73ce39', "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M15.0076 6.97426V0C31.0194 0 44 12.9056 44 28.8261C44 34.3951 42.4073 39.5923 39.6561 44L33.8019 40.1595C35.822 36.8551 36.9855 32.9758 36.9855 28.8261C36.9855 16.7575 27.1458 6.97426 15.0076 6.97426ZM6.99059 28.8257C6.99059 33.2284 10.5795 36.7972 15.0076 36.7972C19.4356 36.7972 23.0245 33.2284 23.0245 28.8257C23.0245 24.4235 19.4356 20.8548 15.0076 20.8548C10.5795 20.8548 6.99059 24.4235 6.99059 28.8257ZM0 28.8257C0 20.5853 6.71916 13.9047 15.0076 13.9047C23.296 13.9047 30.0151 20.5853 30.0151 28.8257C30.0151 37.0666 23.296 43.7472 15.0076 43.7472C6.71916 43.7472 0 37.0666 0 28.8257Z", class: "main-symbol" }))), h("div", { key: 'd4367443a500da7d0767c1525ca5af1704ff13d7', class: "digi-title-logo-name-wrapper" }, h("slot", { key: 'f508b45dc39f72a2ec5626a8bc5d550a61c2a43c', name: "logo-one-row" }), h("slot", { key: 'faa09969cd0a8149e58bcf93a065c5956c766477', name: "logo-two-rows" }))));
    }
    get hostElement() { return this; }
    static get style() { return DigiTitleLogoStyle0; }
}, [6, "digi-title-logo", {
        "afAriaLabel": [1, "af-aria-label"],
        "afLogoBreakpoint": [2, "af-logo-breakpoint"],
        "isMobile": [32],
        "isTablet": [32],
        "titleLogoVariation": [32]
    }]);
function defineCustomElement() {
    if (typeof customElements === "undefined") {
        return;
    }
    const components = ["digi-title-logo", "digi-util-breakpoint-observer"];
    components.forEach(tagName => { switch (tagName) {
        case "digi-title-logo":
            if (!customElements.get(tagName)) {
                customElements.define(tagName, TitleLogo);
            }
            break;
        case "digi-util-breakpoint-observer":
            if (!customElements.get(tagName)) {
                defineCustomElement$1();
            }
            break;
    } });
}

export { TitleLogo as T, defineCustomElement as d };
