'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

const index = require('./index-9a9efa1c.js');
const index$1 = require('./index-a8de2b09.js');
const bars = require('./bars-3fdeb31f.js');
const close = require('./close-9e014a80.js');
const arrow_left = require('./arrow_left-71879efe.js');
const angle_small_down = require('./angle_small_down-f00f19b1.js');
const arrow_right = require('./arrow_right-66958158.js');
const open_in_new = require('./open_in_new-03e5ca56.js');
const pnMarketwebSiteheaderStore = require('./pn-marketweb-siteheader-store-7548aafe.js');
const search = require('./search-3785cc26.js');

const icon$2 = '<svg class="pn-icon-svg" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"><path fill="#000" fill-rule="evenodd" d="M16.707 11.293a1 1 0 0 1 0 1.414l-6 6a1 1 0 0 1-1.414-1.414L14.586 12 9.293 6.707a1 1 0 0 1 1.414-1.414z" clip-rule="evenodd"/></svg>';
const angle_small_right = icon$2;

const icon$1 = '<svg class="pn-icon-svg" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"><path fill="#000" fill-rule="evenodd" d="M4.252 10A8 8 0 0 0 4 12c0 .69.088 1.36.252 2h3.166a13.8 13.8 0 0 1 0-4zm.818-2h2.795a13.6 13.6 0 0 1 1.719-3.629A8.02 8.02 0 0 0 5.07 8M12 4.48A11.7 11.7 0 0 0 9.972 8h4.056A11.7 11.7 0 0 0 12 4.48M14.557 10H9.443a11.8 11.8 0 0 0 0 4h5.114a11.8 11.8 0 0 0 0-4m2.025 4a13.8 13.8 0 0 0 0-4h3.166c.165.64.252 1.31.252 2s-.087 1.36-.252 2zm-2.554 2H9.972A11.7 11.7 0 0 0 12 19.52 11.7 11.7 0 0 0 14.028 16m-4.444 3.629A13.6 13.6 0 0 1 7.864 16H5.07a8.02 8.02 0 0 0 4.514 3.629m4.832 0A13.6 13.6 0 0 0 16.136 16h2.794a8.02 8.02 0 0 1-4.514 3.629M18.93 8h-2.795a13.6 13.6 0 0 0-1.719-3.629A8.02 8.02 0 0 1 18.93 8M2 12C2 6.477 6.477 2 12 2s10 4.477 10 10-4.477 10-10 10S2 17.523 2 12" clip-rule="evenodd"/></svg>';
const globe = icon$1;

const icon = '<svg class="pn-icon-svg" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"><path fill="#000" fill-rule="evenodd" d="M7.5 7.5a4.5 4.5 0 1 1 9 0 4.5 4.5 0 0 1-9 0M12 5a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5M4.928 20.372a1 1 0 0 1-1.856-.743l.883.353a82 82 0 0 1-.883-.354v-.002l.001-.002.003-.007.008-.018a4 4 0 0 1 .114-.25c.078-.161.193-.383.35-.645.315-.523.8-1.217 1.495-1.911C6.444 15.39 8.688 14 12 14s5.556 1.391 6.957 2.793a10 10 0 0 1 1.494 1.911 8 8 0 0 1 .44.837q.016.036.025.058l.008.018.003.007.001.004-.883.354.883-.353a1 1 0 0 1-1.856.744v.001l.001.001v-.002a2 2 0 0 0-.07-.15 6 6 0 0 0-.267-.49 8 8 0 0 0-1.193-1.526C16.444 17.11 14.688 16 12 16s-4.444 1.109-5.543 2.207a8 8 0 0 0-1.193 1.526 6 6 0 0 0-.336.64m0 0-.001.003zm14.144.001" clip-rule="evenodd"/></svg>';
const user = icon;

const translations$1 = {
    'sv': {
        heading: 'Språk',
    },
    'en': {
        heading: 'Language',
    },
    'da': {
        heading: 'Sprog',
    },
    'no': {
        heading: 'Språk',
    },
    'fi': {
        heading: 'Kieli',
    },
    'de': {
        heading: 'Sprache',
    },
    'zh': {
        heading: '语言',
    },
    'fr': {
        heading: 'Langue',
    },
    'es': {
        heading: 'Idioma',
    },
    'nl': {
        heading: 'Spraak',
    },
    'it': {
        heading: 'Idioma',
    },
    'tr': {
        heading: 'Dil',
    },
    'pl': {
        heading: 'Język',
    },
    'pt': {
        heading: 'Linguagem',
    },
    'pt-BR': {
        heading: 'Linguagem',
    },
};

const pnLanguageSelectorCss = "pn-button-dropdown .pn-button-dropdown>pn-button>.pn-button{min-height:initial}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border-width:0}@media screen and (max-width: 767px){.sr-only-mobile{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border-width:0}}pn-button-dropdown .pn-button-dropdown>pn-button>.pn-button{min-height:initial}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border-width:0}@media screen and (max-width: 767px){.sr-only-mobile{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border-width:0}}pn-language-selector{--languageselector-toggle-color:#005d92;--languageselector-toggle-hover-color:#0d234b;--languageselector-toggle-background-color:#ffffff;--languageselector-title-color:#2d2013}pn-language-selector{max-height:5.2rem}.languageselector{position:relative}.languageselector-togglebtn{cursor:pointer;border:0;padding:0.64rem 0;background-color:var(--languageselector-toggle-background-color);color:var(--languageselector-toggle-color);font-size:1.6rem}.languageselector-togglebtn:hover,.languageselector-togglebtn:focus,.languageselector-togglebtn:active{color:var(--languageselector-toggle-hover-color);text-decoration:underline}.languageselector-togglebtn svg{width:1.9rem;height:1.9rem}.languageselector-title{display:flex;align-items:center;padding:0.8rem 1.6rem;color:var(--languageselector-title-color)}.languageselector-list{list-style:none;margin:0;padding:0}pn-language-selector[appearance=dark] button:hover pn-icon svg path{fill:#000000}";
const PnLanguageSelectorStyle0 = pnLanguageSelectorCss;

const PnlanguageSelector = class {
    constructor(hostRef) {
        index.registerInstance(this, hostRef);
        this.setLanguage = index.createEvent(this, "setLanguage", 7);
        this.value = '';
        this.appearance = 'light';
        this.selectedLanguageName = '';
        this.options = [];
        this.i18n = undefined;
    }
    get hostElement() { return index.getElement(this); }
    // Events
    setLanguage;
    componentWillLoad() {
        this.setInitialSelectedLanguageName();
        this.setTranslations();
    }
    componentDidLoad() {
        this.initialize();
    }
    initialize() {
        this.setSelectedLanguageName();
        this.addEventBindingsToOptions();
    }
    setInitialSelectedLanguageName() {
        if (!window.Intl || !this.value) {
            return;
        }
        const langs = new Intl.DisplayNames([this.value], { type: 'language' });
        if (!langs) {
            return;
        }
        const languageName = langs.of(this.value);
        if (!languageName) {
            return;
        }
        this.selectedLanguageName = languageName.charAt(0).toUpperCase() + languageName.slice(1);
    }
    addEventBindingsToOptions() {
        const options = [].slice.apply(this.hostElement.querySelectorAll('pn-language-selector-option'));
        options.map((option) => {
            option.removeEventListener('setCurrentLanguage', (event) => {
                this.onSetCurrentLanguage(event.detail);
            });
            // Bind event listener for when a user change language
            option.addEventListener('setCurrentLanguage', (event) => {
                this.onSetCurrentLanguage(event.detail);
            });
        });
    }
    setSelectedLanguageName() {
        const options = [].slice.apply(this.hostElement.querySelectorAll('pn-language-selector-option'));
        options.map((option) => {
            // Set current label of language selector
            if (option.getAttribute('code') == this.value) {
                //  || option.getAttribute("selected") == "true"
                this.selectedLanguageName = option.getAttribute('name');
            }
        });
    }
    onSetCurrentLanguage(option) {
        this.value = option.code;
        this.selectedLanguageName = option.name;
        this.setLanguage.emit(this.value);
    }
    setTranslations() {
        if (translations$1[this.value]) {
            this.i18n = translations$1[this.value];
        }
    }
    onValueChange() {
        const components = this.hostElement.querySelectorAll('pn-language-selector-option') ?? [];
        components.forEach(component => {
            // Pass values as props into slotted components
            // component.setAttribute("current-language", this.value);
            const isSelected = (component.getAttribute('code') === this.value) + '';
            if (component.getAttribute('selected') + '' !== isSelected) {
                component.setAttribute('selected', isSelected);
            }
        });
    }
    render() {
        return (index.h(index.Host, { key: '30445c2ff5bc5cbf527afb34675dd448715486bc', value: this.value }, index.h("pn-button-dropdown", { key: '380b212f804b6a2fd37e4c734be306907f42f84f', label: this.selectedLanguageName, icon: globe, appearance: this.appearance, variant: "borderless", "aria-label": this.i18n.heading }, index.h("div", { key: '13b1715497c0031cb3465bb04364f20ad0794b6a', class: "languageselector-nav" }, index.h("strong", { key: '8a1492197591798fc7e51399a898ef618296ff4a', class: "languageselector-title" }, this.i18n.heading), index.h("div", { key: 'd6a6bd4dc29bfd413febce5e5bdefa136b02a495', class: "languageselector-list", role: "list" }, index.h("slot", { key: '5bbb0a7d8c5ff178663bf578d0ee8fa10c456819' }))))));
    }
    static get watchers() { return {
        "value": ["setSelectedLanguageName", "setTranslations", "onValueChange"]
    }; }
};
PnlanguageSelector.style = PnLanguageSelectorStyle0;

const pnLanguageSelectorOptionCss = "pn-button-dropdown .pn-button-dropdown>pn-button>.pn-button{min-height:initial}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border-width:0}@media screen and (max-width: 767px){.sr-only-mobile{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border-width:0}}pn-button-dropdown .pn-button-dropdown>pn-button>.pn-button{min-height:initial}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border-width:0}@media screen and (max-width: 767px){.sr-only-mobile{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border-width:0}}pn-language-selector-option{--languageselector-option-background-color:#ffffff;--languageselector-option-color:#005d92;--languageselector-option-hover-background-color:#f3f2f2;--languageselector-option-hover-color:#005d92;--languageselector-option-radio-outer-background-color:#ffffff;--languageselector-option-radio-outer-border-color:#d3cecb;--languageselector-option-radio-outer-hover-background-color:#e0f8ff;--languageselector-option-radio-outer-hover-border-color:#005d92;--languageselector-option-radio-outer-selected-border-color:#005d92;--languageselector-option-radio-inner-background-color:#005d92;--languageselector-option-radio-focus-ring-color:#005d92}pn-language-selector-option{margin:0;padding:0;list-style:none}.languageselector-button,.languageselector-link{width:100%;padding:1.1rem 1.6rem 1.1rem 1.4rem;display:flex;align-items:center;position:relative;text-decoration:none;border:0;cursor:pointer;background-color:var(--languageselector-option-background-color);color:var(--languageselector-option-color);font-size:1.6rem;font-weight:bold;border-radius:0}.languageselector-button:hover,.languageselector-button:focus,.languageselector-button:active,.languageselector-link:hover,.languageselector-link:focus,.languageselector-link:active{text-decoration:underline;box-shadow:none;background-color:var(--languageselector-option-hover-background-color);color:var(--languageselector-option-hover-color);outline:none}.languageselector-itemtext{display:inline-block;margin-left:1rem}.languageselector-radio-outer{background:var(--languageselector-option-radio-outer-background-color);border:0.1em solid var(--languageselector-option-radio-outer-border-color);border-radius:50%;height:1.5em;width:1.5em;display:flex;justify-content:center;align-items:center;transition:border 0.2s ease-in-out, background-color 0.2s ease-in-out, box-shadow 0.1s;cursor:pointer}.languageselector-radio-outer:focus>.languageselector-radio-outer,.languageselector-radio-outer:active>.languageselector-radio-outer{box-shadow:0 0 0 0.1rem white, 0 0 0 0.3rem var(--languageselector-option-radio-focus-ring-color)}.languageselector-radio-outer:hover>.languageselector-radio-outer{border:0.1rem solid var(--languageselector-option-radio-outer-hover-border-color);background:var(--languageselector-option-radio-outer-hover-background-color)}[selected=true] .languageselector-radio-outer{border:0.1rem solid var(--languageselector-option-radio-outer-selected-border-color)}.languageselector-radio-inner{transform:scale(0);height:1em;width:1em;background-color:var(--languageselector-option-radio-inner-background-color);border-radius:50%;transform-origin:center center;transition:transform 0.1s cubic-bezier(0.64, 0.01, 0.67, 0.92)}[selected=true] .languageselector-radio-inner{transform:scale(1)}";
const PnLanguageSelectorOptionStyle0 = pnLanguageSelectorOptionCss;

const PnlanguageSelectorOption = class {
    constructor(hostRef) {
        index.registerInstance(this, hostRef);
        this.setCurrentLanguage = index.createEvent(this, "setCurrentLanguage", 7);
        this.name = '';
        this.code = '';
        this.url = '';
        this.selected = false;
        this.currentLanguage = undefined;
    }
    spanEl;
    setCurrentLanguage;
    onOptionClick() {
        const currentlanguage = {
            name: this.name,
            code: this.code,
            url: this.url,
            current: true,
        };
        this.setCurrentLanguage.emit(currentlanguage);
    }
    componentDidLoad() {
        if (this.spanEl) {
            this.spanEl.setAttribute("xml:lang", this.code);
        }
    }
    render() {
        return (index.h(index.Host, { key: '120a44817be4b93b3032a3ad9594490ad08c71ab', role: "listitem", selected: this.selected + '', code: this.code, name: this.name }, !this.url ? (index.h("button", { class: "languageselector-button", "data-langcode": this.code, onClick: this.onOptionClick.bind(this) }, index.h("span", { class: "languageselector-radio-outer" }, index.h("span", { class: "languageselector-radio-inner" })), index.h("span", { ref: (el) => (this.spanEl = el), lang: this.code, class: "languageselector-itemtext" }, this.name, " - ", this.code))) : (index.h("a", { href: this.url, target: "_self", class: "languageselector-link", "data-langcode": this.code }, index.h("span", { class: "languageselector-radio-outer" }, index.h("span", { class: "languageselector-radio-inner" })), index.h("span", { ref: (el) => (this.spanEl = el), lang: this.code, class: "languageselector-itemtext" }, this.name, " - ", this.code)))));
    }
};
PnlanguageSelectorOption.style = PnLanguageSelectorOptionStyle0;

const translations = {
    'sv': {
        menuHomeButton: 'Hem',
        menuGoBackButton: 'Gå tillbaka',
        mainMenuButton: 'Meny',
        menuStartButton: 'Start',
        navLabel: 'Huvudnavigation',
    },
    'en': {
        menuHomeButton: 'Home',
        menuGoBackButton: 'Go back',
        mainMenuButton: 'Menu',
        menuStartButton: 'Start',
        navLabel: 'Main navigation',
    },
    'da': {
        menuHomeButton: 'Hjem',
        menuGoBackButton: 'Gå tilbage',
        mainMenuButton: 'Menu',
        menuStartButton: 'Start',
        navLabel: 'Hovednavigation',
    },
    'no': {
        menuHomeButton: 'Hjem',
        menuGoBackButton: 'Gå tilbake',
        mainMenuButton: 'Meny',
        menuStartButton: 'Start',
        navLabel: 'Hovednavigasjon',
    },
    'de': {
        menuHomeButton: 'Home',
        menuGoBackButton: 'Geh zurück',
        mainMenuButton: 'Menü',
        menuStartButton: 'Start',
        navLabel: 'Hauptnavigation',
    },
    'zh': {
        menuHomeButton: 'Home',
        menuGoBackButton: 'Go back',
        mainMenuButton: 'Menu',
        menuStartButton: 'Start',
        navLabel: 'Main navigation',
    },
    'it': {
        menuHomeButton: 'Home',
        menuGoBackButton: 'Go back',
        mainMenuButton: 'Menu',
        menuStartButton: 'Start',
        navLabel: 'Main navigation',
    },
    'nl': {
        menuHomeButton: 'Home',
        menuGoBackButton: 'Go back',
        mainMenuButton: 'Menu',
        menuStartButton: 'Start',
        navLabel: 'Main navigation',
    },
    'tr': {
        menuHomeButton: 'Anasayfa',
        menuGoBackButton: 'Geri git',
        mainMenuButton: 'Menü',
        menuStartButton: 'Başlat',
        navLabel: 'Ana gezinme',
    },
    'pt': {
        menuHomeButton: 'Página inicial',
        menuGoBackButton: 'Go back',
        mainMenuButton: 'Menu',
        menuStartButton: 'Start',
        navLabel: 'Main navigation',
    },
    'pl': {
        menuHomeButton: 'Strona główna',
        menuGoBackButton: 'Powrót',
        mainMenuButton: 'Menu',
        menuStartButton: 'Początek',
        navLabel: 'Menu główne systemu',
    },
    'pt-BR': {
        menuHomeButton: 'Página inicial',
        menuGoBackButton: 'Voltar',
        mainMenuButton: 'Menu',
        menuStartButton: 'Iniciar',
        navLabel: 'Navegação principal',
    },
};

// Read more about how stencil stores work here: https://stenciljs.com/docs/stencil-store
const { state: state$1, onChange: onChange$1 } = index$1.createStore({
    openLevel: '',
    currentLevel: 1,
    openMenu: false,
    i18n: {
        menuHomeButton: '',
        menuGoBackButton: '',
        mainMenuButton: '',
        menuStartButton: '',
        navLabel: '',
    },
});

const pnMainnavCss = "pn-button-dropdown .pn-button-dropdown>pn-button>.pn-button{min-height:initial}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border-width:0}@media screen and (max-width: 767px){.sr-only-mobile{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border-width:0}}pn-mainnav{--mainnav-nav-background-color:#ffffff;--mainnav-toggle-background-color:#005d92;--mainnav-toggle-text-color:#ffffff;--mainnav-toggle-border-radius:2.4rem;--mainnav-toggle-padding:0.6rem 1.6rem;--mainnav-toggle-font-size:1.6rem;--mainnav-top-position:var(--siteheader-mainnav-top-position-mobile,3em)}pn-mainnav{display:flex;flex-flow:row-reverse;position:relative;width:100%;min-height:5.1rem}@media screen and (min-width: 48em){pn-mainnav{flex-flow:row}}@media screen and (min-width: 64em){pn-mainnav{flex-flow:column}}@media screen and (min-width: 64em){pn-mainnav [slot=footer]{display:none}}pn-mainnav>nav{display:flex;flex-flow:column;position:fixed;top:var(--mainnav-top-position);bottom:0;left:0;width:100vw;height:auto;background-color:var(--mainnav-nav-background-color);z-index:2;visibility:hidden;transform:translateX(100vw);transition:transform 0.2s 0s;transition-property:transform, visibility}@media screen and (min-width: 48em){pn-mainnav>nav{top:6.5em}}@media screen and (min-width: 64em){pn-mainnav>nav{flex-flow:row-reverse;position:static;top:0;width:100%;height:auto;justify-content:space-between;visibility:visible;transform:translateX(0)}}pn-mainnav>nav a{text-decoration:none}pn-mainnav>nav button{cursor:pointer}.mainnav-toggle{display:flex;align-items:center;align-self:center}@media screen and (min-width: 64em){.mainnav-toggle{display:none}}.mainnav-toggle>button{display:flex;align-items:center;background-color:var(--mainnav-toggle-background-color);color:var(--mainnav-toggle-text-color);border:none;border-radius:var(--mainnav-toggle-border-radius);padding:var(--mainnav-toggle-padding);cursor:pointer;font-size:var(--mainnav-toggle-font-size)}.mainnav-toggle>button:focus{outline:0}.mainnav-toggle>button pn-icon{display:block;margin-left:0.8rem}.mainnav-toggle>button svg{display:block;margin:-0.2rem -0.5rem -0.2rem 0;width:1.9rem;height:1.9rem}pn-mainnav>nav[data-menu-open=true]{visibility:visible;transform:translateX(0)}";
const PnMainnavStyle0 = pnMainnavCss;

const PnMainnav = class {
    constructor(hostRef) {
        index.registerInstance(this, hostRef);
        this.menuLanguageChange = index.createEvent(this, "menuLanguageChange", 7);
        this.marketChange = index.createEvent(this, "marketChange", 7);
        this.menuOpenChange = index.createEvent(this, "menuOpenChange", 7);
        this.market = 'se';
        this.language = 'sv';
        this.navigationId = 'mainnav';
        this.openMenu = false;
        this.navLabel = '';
    }
    get hostElement() { return index.getElement(this); }
    menuLanguageChange; // Could not use language change since it's a existing window event
    marketChange;
    menuOpenChange;
    componentWillLoad() {
        this.init();
        document.removeEventListener('mousedown', this._onClickOutside.bind(this));
        document.addEventListener('mousedown', this._onClickOutside.bind(this));
    }
    async init() {
        this.setLanguage();
        this.setMarket();
    }
    _onClickOutside(event) {
        const clickedOutside = !this.hostElement.contains(event.target);
        if (clickedOutside) {
            state$1.openLevel = '';
        }
    }
    setLanguage() {
        this.menuLanguageChange.emit(this.language);
    }
    setMarket() {
        this.marketChange.emit(this.market);
    }
    onLanguageChange(event) {
        if (translations[event.detail]) {
            state$1.i18n = translations[event.detail];
            if (!this.navLabel) {
                this.navLabel = state$1.i18n.navLabel;
            }
        }
    }
    setMenuOpenState() {
        state$1.openMenu = !state$1.openMenu;
        this.menuOpenChange.emit(state$1.openMenu);
    }
    onOpenMenuLevelChange(event) {
        state$1.openLevel = event.detail;
    }
    render() {
        return (index.h(index.Host, { key: '96a2de7d4e9c02a53cab673a533f16b31330e3d5' }, index.h("div", { key: 'bfc843c5e20af6edfba29a21a42fa78f6ae3dcec', class: "mainnav-toggle" }, index.h("button", { key: 'c830400cb0eb94ec7e43e40faf540dec5cf98cb3', "aria-controls": this.navigationId, "aria-expanded": state$1.openMenu + '', onClick: this.setMenuOpenState.bind(this) }, state$1.i18n.mainMenuButton, index.h("pn-icon", { key: 'fbcffba27203ef72cd790ffc8b956aa92d94ffed', icon: state$1.openMenu ? close.close : bars.bars, color: "white" }))), index.h("nav", { key: 'b4e906e2e031ef66f83a5c2597d3f7cc3b2a2be1', class: "mainnav", "aria-label": this.navLabel, "data-menu-open": state$1.openMenu + '', "data-menu-currentlevel": state$1.currentLevel, id: this.navigationId }, index.h("slot", { key: '2c9742cd1aaf860cc0e51a4d66e049a59976e7c8' }))));
    }
};
PnMainnav.style = PnMainnavStyle0;

const pnMainnavLevelCss = "pn-button-dropdown .pn-button-dropdown>pn-button>.pn-button{min-height:initial}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border-width:0}@media screen and (max-width: 767px){.sr-only-mobile{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border-width:0}}pn-mainnav-level{--mainnav-level-bg:#ffffff;--mainnav-level-link-color:#005d92;--mainnav-level-2-border-top-left-radius-desktop:var(--siteheader-mainnav-level-2-border-top-left-radius-desktop, 1rem);--mainnav-level-2-border-top-right-radius-desktop:var(--siteheader-mainnav-level-2-border-top-right-radius-desktop, 1rem);--mainnav-level-2-border-bottom-right-radius-desktop:var(--siteheader-mainnav-level-2-border-bottom-right-radius-desktop, 1rem);--mainnav-level-2-border-bottom-left-radius-desktop:var(--siteheader-mainnav-level-2-border-bottom-left-radius-desktop, 1rem);--mainnav-level-2-shadow:0 0.06rem 0.18rem rgba(0, 0, 0, 0.1), 0 0.32rem 0.72rem rgba(0, 0, 0, 0.13);--mainnav-level-header-button-color:#005d92;--mainnav-level-header-link-font-size:2.4rem;--mainnav-level-header-icon-size:2.4rem}pn-mainnav-level{display:block}pn-mainnav-level:not(.hydrated){max-height:5.6rem;overflow:hidden}pn-mainnav-level[data-level=\"1\"]{width:100%;right:0;overflow-y:scroll;overflow-x:hidden;flex:1}@media screen and (min-width: 64em){pn-mainnav-level[data-level=\"1\"]{width:auto;overflow:initial}pn-mainnav-level[data-level=\"1\"]::-webkit-scrollbar{display:none}}pn-mainnav-level[data-level=\"2\"]{position:absolute;top:0;bottom:0;left:0;width:100vw;padding:0;background-color:var(--mainnav-level-bg);z-index:1;transform:translateX(100vw);transition:transform 0.2s 0s;transition-property:transform, visibility;overflow:scroll;visibility:hidden}@media screen and (min-width: 64em){pn-mainnav-level[data-level=\"2\"]{top:calc(100% + 1rem);bottom:auto;width:auto;height:auto;padding:1.6rem 1.6rem 0 1.6rem;border-top-left-radius:var(--mainnav-level-2-border-top-left-radius-desktop);border-top-right-radius:var(--mainnav-level-2-border-top-right-radius-desktop);border-bottom-right-radius:var(--mainnav-level-2-border-bottom-right-radius-desktop);border-bottom-left-radius:var(--mainnav-level-2-border-bottom-left-radius-desktop);display:none;z-index:3;box-shadow:var(--mainnav-level-2-shadow)}pn-mainnav-level[data-level=\"2\"][data-menuitem-rightaligned=true]{right:0;left:unset}}@media screen and (max-height: 33.125em){pn-mainnav-level[data-level=\"2\"]{-ms-overflow-style:none;scrollbar-width:none}pn-mainnav-level[data-level=\"2\"]::-webkit-scrollbar{display:none}}pn-mainnav-level[data-level=\"2\"][aria-hidden=false]{transform:translateX(0);visibility:visible}@media screen and (min-width: 64em){pn-mainnav-level[data-level=\"2\"][aria-hidden=false]{display:block;overflow:visible}pn-mainnav-level[data-level=\"2\"][aria-hidden=false]:not([data-level-listcount=\"1\"]){display:grid;grid-template-columns:minmax(12em, 20em) 1fr;grid-template-rows:auto auto;gap:0 1.6rem;grid-template-areas:\"top top\" \"left right\"}}@media screen and (min-width: 64em){pn-mainnav-level[data-level=\"2\"][data-level-alignment=left]{right:0;left:unset}}@media screen and (min-width: 64em){pn-mainnav-level[data-level=\"2\"][data-level-alignment=center]{left:50%;transform:translateX(-50%)}}pn-mainnav-level[data-level=\"2\"] a{color:var(--mainnav-level-link-color);text-decoration:none}pn-mainnav-level [slot=top]{display:flex}@media screen and (min-width: 48em){pn-mainnav-level [slot=top]{display:none}}[data-menu-currentlevel=\"2\"] pn-mainnav-level [slot=footer]{display:none;overscroll-behavior:contain}.mainnav-level-header{grid-area:top}.mainnav-level-header>label{position:absolute;width:0.1rem;height:0.1rem;padding:0;margin:-0.1rem;overflow:hidden;clip:rect(0, 0, 0, 0);border:0;white-space:nowrap}.mainnav-level-header>button{display:block;position:relative;width:100%;padding:2.4rem 0 2.4rem 6.2rem;border:none;background-color:transparent;color:var(--mainnav-level-header-button-color);text-align:left}@media screen and (min-width: 64em){.mainnav-level-header>button{display:none;speak:none}}.mainnav-level-header>button>pn-icon{speak:none;position:absolute;top:50%;left:3rem;width:var(--mainnav-level-header-icon-size);height:var(--mainnav-level-header-icon-size);transform:translateY(-50%)}[data-level=\"2\"] .mainnav-level-header>pn-mainnav-link>a{font-size:var(--mainnav-level-header-link-font-size)}";
const PnMainnavLevelStyle0 = pnMainnavLevelCss;

const PnMainnavLevel = class {
    constructor(hostRef) {
        index.registerInstance(this, hostRef);
        this.label = '';
        this.level = 1;
        this.levelId = '';
        this.isOpen = false;
        this.parentName = '';
        this.parentHref = '';
        this.parentLinkId = '';
        this.listCount = 0;
        this.alignment = 'right';
    }
    get hostElement() { return index.getElement(this); }
    async componentWillLoad() {
        this.setState();
        onChange$1('openLevel', () => {
            this.onChangeOpenLevel();
        });
    }
    setState() {
        this.listCount = this.hostElement.querySelectorAll(':scope > pn-mainnav-list').length;
        const parentElm = this.hostElement.parentElement;
        if (parentElm.tagName.toLowerCase() !== 'nav') {
            this.level = 2;
        }
        if (parentElm.tagName.toLowerCase() === 'pn-mainnav-link') {
            this.parentName = parentElm.getAttribute('name') + '';
            if ((!this.label && this.parentName) || this.label !== this.parentName) {
                this.label = this.parentName;
            }
            this.parentHref = parentElm.getAttribute('href') + '';
            this.parentLinkId = parentElm.getAttribute('linkid') + '';
            const parentLinkName = this.parentName.toLowerCase().replace(/\W/gi, '_');
            this.levelId = `mainnav-lvl${this.level}-${parentLinkName}`;
        }
    }
    onOpen() {
        if (this.level === 2) {
            requestAnimationFrame(() => {
                const levelClientRect = this.hostElement.getClientRects()[0];
                if (!levelClientRect) {
                    return;
                }
                const navElm = this.hostElement.parentElement.parentElement.parentElement.parentElement;
                if (navElm && navElm.tagName.toLowerCase() === 'nav') {
                    const navClientRect = navElm.getClientRects()[0];
                    if (!navClientRect) {
                        return;
                    }
                    if (levelClientRect.right > window.innerWidth) {
                        const levelParentRect = this.hostElement.parentElement.getClientRects()[0];
                        if (levelParentRect.left - levelClientRect.width < 0) {
                            this.alignment = 'center';
                        }
                        else {
                            this.alignment = 'left';
                        }
                    }
                }
            });
        }
    }
    onChangeOpenLevel() {
        this.isOpen = state$1.openLevel === this.levelId;
        state$1.currentLevel = this.level;
    }
    render() {
        return (index.h(index.Host, { key: '1717f62604a0b8a245bc26eb0cf55b72192b5592', ...(this.level > 1 && this.levelId ? { 'aria-hidden': !this.isOpen + '' } : {}), "data-level-listcount": this.listCount + '', "data-level-alignment": this.alignment, "data-level": this.level + '', ...(this.levelId ? { id: this.levelId } : {}) }, this.level > 1 ? (index.h("div", { class: "mainnav-level-header" }, index.h("label", { htmlFor: this.levelId }, state$1.i18n.menuGoBackButton), index.h("button", { class: "secondlevel-backbtn", onClick: () => {
                state$1.openLevel = '';
                state$1.currentLevel = 1;
            }, "aria-expanded": (state$1.openLevel === this.levelId) + '' }, index.h("pn-icon", { icon: arrow_left.arrow_left, color: "blue700" }), state$1.i18n.menuStartButton), this.parentHref && this.label ? index.h("pn-mainnav-link", { href: this.parentHref, name: this.label, linkid: this.parentLinkId }) : null)) : null, index.h("slot", { key: '582cdd7a6bc61e25e6a196fc17c43bce3907033a', name: "top" }), index.h("slot", { key: '2b076344434db3b9b844423f4a797e793deba873' }), index.h("slot", { key: 'd45c6146209b2eed25166a38285f06aa5ae66a53', name: "additional" }), index.h("slot", { key: '5f29d378a41d9e8eee471cb131fac87bf5767572', name: "footer" })));
    }
    static get watchers() { return {
        "label": ["setState"],
        "isOpen": ["onOpen"]
    }; }
};
PnMainnavLevel.style = PnMainnavLevelStyle0;

const pnMainnavLinkCss = "pn-button-dropdown .pn-button-dropdown>pn-button>.pn-button{min-height:initial}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border-width:0}@media screen and (max-width: 767px){.sr-only-mobile{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border-width:0}}pn-mainnav-link{--mainnav-link-active-desktop-color:var(--siteheader-mainnav-link-active-desktop-color, #005d92);--mainnav-link-level1-indicator-color:var(--siteheader-mainnav-link-level1-indicator-color, #00a0d6);--mainnav-link-level1-indicator-active-color:var(--siteheader-mainnav-link-level1-indicator-active-color, #8eddf9);--mainnav-link-level1-first-border-top:0.1rem solid #f3f2f2;--mainnav-link-level1-border-bottom:var(--siteheader-mainnav-link-level1-border-bottom, 0.1rem solid #f3f2f2);--mainnav-link-level2-border-bottom:var(--siteheader-mainnav-link-level2-border-bottom, 0.1rem solid #f3f2f2)}pn-mainnav-link{display:block}pn-mainnav-link button,pn-mainnav-link a{position:relative;display:flex;align-items:center;border:0 none;background-color:transparent;color:#005d92;font-weight:normal}pn-mainnav-link button:hover,pn-mainnav-link button:focus,pn-mainnav-link a:hover,pn-mainnav-link a:focus{background-color:#ffffff;color:#005d92;outline:0;box-shadow:none}pn-mainnav-link button:active,pn-mainnav-link a:active{background-color:#f3f2f2;color:#00a0d6;box-shadow:none}@media screen and (min-width: 64em){[data-level=\"1\"] pn-mainnav-link{position:relative;height:100%;padding-left:0;scroll-snap-align:center}}[data-level=\"1\"] pn-mainnav-link:first-child{border-top:var(--mainnav-link-level1-first-border-top)}@media screen and (min-width: 64em){[data-level=\"1\"] pn-mainnav-link:first-child{border:0}}[data-level=\"1\"] pn-mainnav-link>button,[data-level=\"1\"] pn-mainnav-link>a{width:100%;height:auto;padding:1.9rem 0 1.9rem 3rem;border-bottom:var(--mainnav-link-level1-border-bottom);font-size:2rem}@media screen and (min-width: 64em){[data-level=\"1\"] pn-mainnav-link>button,[data-level=\"1\"] pn-mainnav-link>a{position:relative;height:100%;overflow:hidden;padding:1.6rem 1.6rem;border:0;outline:0;white-space:nowrap;font-size:1.6rem;font-weight:normal}}@media screen and (min-width: 64em){[data-level=\"1\"] pn-mainnav-link>button::before,[data-level=\"1\"] pn-mainnav-link>a::before{content:\"\";position:absolute;bottom:0;left:0;width:100%;height:0.5em;background-color:var(--mainnav-link-level1-indicator-color);border-radius:0.5em 0.5em 0 0;transform:translateY(100%);transition:transform 0.1s cubic-bezier(0.64, 0.01, 0.67, 0.92)}}@media screen and (min-width: 64em){[data-level=\"1\"] pn-mainnav-link>button:hover::before,[data-level=\"1\"] pn-mainnav-link>button:focus::before,[data-level=\"1\"] pn-mainnav-link>a:hover::before,[data-level=\"1\"] pn-mainnav-link>a:focus::before{transform:translateY(0)}}@media screen and (min-width: 64em){[data-level=\"1\"] pn-mainnav-link>button:active,[data-level=\"1\"] pn-mainnav-link>a:active{color:var(--mainnav-link-active-desktop-color);outline:0;box-shadow:none}}@media screen and (min-width: 64em){[data-level=\"1\"] pn-mainnav-link>button:active::before,[data-level=\"1\"] pn-mainnav-link>a:active::before{background-color:var(--mainnav-link-level1-indicator-active-color);transform:translateY(0)}}@media screen and (min-width: 64em){[data-level=\"1\"] pn-mainnav-link>button:hover,[data-level=\"1\"] pn-mainnav-link>button:focus,[data-level=\"1\"] pn-mainnav-link>a:hover,[data-level=\"1\"] pn-mainnav-link>a:focus{text-decoration:none}}@media screen and (min-width: 64em){[data-level=\"1\"] pn-mainnav-link>button[aria-expanded=true]::before,[data-level=\"1\"] pn-mainnav-link>a[aria-expanded=true]::before{content:\"\";position:absolute;bottom:0;left:0;width:100%;height:0.5em;background-color:var(--mainnav-link-level1-indicator-color);border-radius:0.5em 0.5em 0 0;transform:translateY(0);transition:transform 0.1s cubic-bezier(0.64, 0.01, 0.67, 0.92)}}[data-level=\"1\"] pn-mainnav-link [aria-expanded=true] .first-level_icon{transform:rotateX(180deg)}[data-level=\"1\"] pn-mainnav-link pn-icon.first-level_icon{display:none;width:1.92rem;height:1.92rem;transition:0.25s linear transform}@media screen and (min-width: 64em){[data-level=\"1\"] pn-mainnav-link pn-icon.first-level_icon{display:block}}[data-level=\"1\"] pn-mainnav-link pn-icon.first-level_arrow{display:block;position:absolute;top:50%;right:2.4rem;width:2.4rem;height:2.4rem;transform:translateY(-50%)}@media screen and (min-width: 64em){[data-level=\"1\"] pn-mainnav-link pn-icon.first-level_arrow{display:none}}[data-level=\"1\"] pn-mainnav-link pn-icon svg{width:100%;height:100%;pointer-events:none;speak:none}@media screen and (min-width: 64em){pn-mainnav-level[data-level=\"2\"]:not([data-level-listcount=\"1\"]) pn-mainnav-list:last-child pn-mainnav-link>a{min-width:unset}}[data-level=\"2\"] pn-mainnav-link{position:static;display:inline-block;width:100%;height:auto}@media screen and (min-width: 64em){[data-level=\"2\"] pn-mainnav-link{margin-bottom:1.6rem;padding-left:0}}[data-level=\"2\"] pn-mainnav-link>a{padding:2.2rem 0 2.2rem 3rem;border-bottom:var(--mainnav-link-level2-border-bottom);white-space:normal;font-size:1.6rem}@media screen and (min-width: 64em){[data-level=\"2\"] pn-mainnav-link>a{min-width:16em;padding:1.4rem 1.6rem;border:0;border-radius:1rem}}[data-level=\"2\"] pn-mainnav-link>a:hover{background-color:#ffffff;color:#005d92}[data-level=\"2\"] pn-mainnav-link>a:hover,[data-level=\"2\"] pn-mainnav-link>a:focus{box-shadow:none}@media screen and (min-width: 64em){[data-level=\"2\"] pn-mainnav-link>a:hover,[data-level=\"2\"] pn-mainnav-link>a:focus{background-color:#f3f2f2;color:#005d92;text-decoration:underline;outline:0}}[data-level=\"2\"] pn-mainnav-link>a:hover::before,[data-level=\"2\"] pn-mainnav-link>a:focus::before{content:none}[data-level=\"2\"] pn-mainnav-link>a:active{box-shadow:none}@media screen and (min-width: 64em){[data-level=\"2\"] pn-mainnav-link>a:active{background-color:#f3f2f2;color:#00a0d6;outline:0}}[data-level=\"2\"] pn-mainnav-link>a:active::before{content:none}[data-level=\"2\"] pn-mainnav-link pn-icon{display:inline-block;width:1.5rem;height:1.5rem;min-width:1.5rem;margin-left:0.2em}[data-level=\"2\"] pn-mainnav-link pn-icon svg{width:100%;height:100%;pointer-events:none;speak:none}";
const PnMainnavLinkStyle0 = pnMainnavLinkCss;

const PnMainnavLink = class {
    constructor(hostRef) {
        index.registerInstance(this, hostRef);
        this.name = '';
        this.href = '';
        this.target = '';
        this.linkid = '';
        this.levelId = '';
        this.open = false;
        this.hasChildren = false;
    }
    get hostElement() { return index.getElement(this); }
    componentWillLoad() {
        this.hasChildren = this.hostElement.querySelectorAll('pn-mainnav-level').length > 0;
        if (this.hasChildren && this.name) {
            const safeLevelName = this.name.toLowerCase().replace(/\W/gi, '_');
            this.levelId = `mainnav-lvl${2}-${safeLevelName}`;
        }
    }
    setOpenMenuLevel() {
        state$1.openLevel = state$1.openLevel + '' === this.levelId + '' ? '' : this.levelId;
    }
    render() {
        return (index.h(index.Host, { key: '76a15bd12ee14e7d774661d578445facd3722004', role: "listitem", name: this.name, href: this.href, linkid: this.linkid }, this.hasChildren ? (index.h("button", { onClick: this.setOpenMenuLevel.bind(this), "aria-controls": this.levelId, "aria-expanded": (state$1.openLevel + '' === this.levelId + '') + '', "aria-haspopup": "true" }, this.name, index.h("pn-icon", { class: "first-level_icon", icon: angle_small_down.angle_small_down, color: "blue700" }), index.h("pn-icon", { class: "first-level_arrow", icon: arrow_right.arrow_right, color: "blue700" }))) : (index.h("a", { href: this.href, ...(this.target ? { target: this.target } : {}), ...(this.target === '_blank' ? { rel: 'nofollow noopener' } : {}), ...(this.linkid ? { id: this.linkid } : {}) }, this.name, this.target === '_blank' ? index.h("pn-icon", { icon: open_in_new.open_in_new, color: "blue700" }) : null)), index.h("slot", { key: '6d2e33590d65706ea811fdcb963c48950517bc61' })));
    }
};
PnMainnavLink.style = PnMainnavLinkStyle0;

const pnMainnavListCss = "pn-button-dropdown .pn-button-dropdown>pn-button>.pn-button{min-height:initial}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border-width:0}@media screen and (max-width: 767px){.sr-only-mobile{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border-width:0}}pn-mainnav-list{--mainnav-list-secondary-border-right:0.1rem solid #d3cecb;--mainnav-list-heading-font-size:1.8rem;--mainnav-list-heading-color:var(--siteheader-mainnav-list-heading-color, #000000)}pn-mainnav-list{display:block;overflow:visible;list-style:none;margin:0;padding:0;grid-area:right}@media screen and (min-width: 64em){pn-mainnav-list+pn-mainnav-list{grid-area:left;border-right:var(--mainnav-list-secondary-border-right);margin-bottom:1.6rem;margin-right:-0.7rem;padding-right:0.7rem}}[data-level=\"1\"]>pn-mainnav-list{overflow:scroll;-webkit-overflow-scrolling:touch}@media screen and (min-width: 64em){[data-level=\"1\"]>pn-mainnav-list{height:100%;display:flex;flex-flow:row;overflow:visible;padding:0}}@media screen and (min-width: 64em){[data-level=\"2\"]>pn-mainnav-list[data-navlist-showcolumns=true]{column-count:2;column-gap:1.6rem;padding-bottom:1.6rem}}.mainnav-list-heading{display:none;font-weight:bold;column-span:all;font-size:var(--mainnav-list-heading-font-size);padding:1.4rem 1.4rem 1.4rem 4.8rem;color:var(--mainnav-list-heading-color)}@media screen and (min-width: 64em){.mainnav-list-heading{display:block;padding:0 1.4rem 1.4rem 1.4rem}}";
const PnMainnavListStyle0 = pnMainnavListCss;

const PnMainnavList = class {
    constructor(hostRef) {
        index.registerInstance(this, hostRef);
        this.heading = '';
        this.linkCount = 0;
    }
    get hostElement() { return index.getElement(this); }
    componentWillLoad() {
        this.linkCount = this.hostElement.querySelectorAll(':scope > pn-mainnav-link').length;
    }
    render() {
        return (index.h(index.Host, { key: '9a48708097c27c00ae3244b6d7974757717182c3', class: "mainnav-list", role: "list", "data-navlist-itemcount": this.linkCount + '', "data-navlist-showcolumns": (this.linkCount >= 8) + '' }, this.heading ? index.h("div", { class: "mainnav-list-heading" }, this.heading) : null, index.h("slot", { key: 'ca8723edd8fbf394adb586da44d07067abf393e4' })));
    }
};
PnMainnavList.style = PnMainnavListStyle0;

class MarketWebLoginManager {
    eventTarget = window ?? document?.body;
    endpoint = '';
    storagePrefix = 'pn-user';
    checkUserLoggedInStateInterval = 0;
    baseUrls = {
        at: 'https://atportal.postnord.com/api/unified-login/backend',
        prod: 'https://portal.postnord.com/api/unified-login/backend',
    };
    events = {
        loginstatechange: 'loginstatechange',
    };
    endpoints = {
        authorizationEndpoint: `/authorization`,
        tokenExchangeEndpoint: `/token`,
        userInfoEndpoint: `/user`,
        logoutEndpoint: `/logout`,
    };
    keys = {
        tokensource: 'tokensource',
        token: 'token',
        accessToken: 'accessToken',
        user: 'user',
        expire: 'expire',
        expireDate: 'expiredate',
    };
    overridetokenValue = 'overridetokenValue';
    siteUrl = window.location.origin;
    abortSignalForLoginCheck = null;
    loginCheckInProgress = false;
    loginCheckTimer = null;
    constructor(options = null) {
        if (!options) {
            return;
        }
        this.eventTarget = options.eventTarget ? options.eventTarget : this.eventTarget;
        this.endpoint = options.endpoint ? options.endpoint : `${window.location.protocol}//${window.location.host}`;
        this.storagePrefix ??= options.storagePrefix;
        this.checkUserLoggedInStateInterval =
            options.checkUserLoggedInStateInterval && options.checkUserLoggedInStateInterval > 0 ? parseInt(options.checkUserLoggedInStateInterval + '', 10) : 0;
        if (options.userInfo) {
            this.store.set(this.keys.user, options.userInfo);
            this.registerToken(this.overridetokenValue, 'override');
        }
    }
    init(checkParameters = true) {
        if (checkParameters) {
            this.checkParameters();
            this.checkPNTopbar();
            this.checkExpireTime();
            if (this.store.get(this.keys.token) && !this.store.get(this.keys.user)) {
                this.fetchUserInfo();
            }
            this.loginStateChange();
            if (this.checkUserLoggedInStateInterval > 0) {
                this.initiateLoggedInCheck();
            }
        }
    }
    setSiteUrl(siteUrl) {
        if (siteUrl) {
            this.siteUrl = siteUrl;
        }
    }
    initiateLoggedInCheck() {
        if (this.isLoggedIn()) {
            if (window && window['AbortController']) {
                this.abortSignalForLoginCheck = new AbortController();
            }
            this.loginCheckTimer = window.setInterval(() => {
                this.doExternalLoggedInCheck()
                    .then(() => { })
                    .catch(() => { });
            }, this.checkUserLoggedInStateInterval);
        }
    }
    async doExternalLoggedInCheck() {
        if (!window.navigator.onLine) {
            // Don't check if the user is not online
            return;
        }
        if (!this.getToken()) {
            window.clearInterval(this.checkUserLoggedInStateInterval);
            return;
        }
        if (this.loginCheckInProgress && this.abortSignalForLoginCheck) {
            this.abortSignalForLoginCheck.abort();
            this.abortSignalForLoginCheck = new AbortController();
        }
        this.loginCheckInProgress = true;
        const reqConfig = {
            method: 'GET',
            headers: {
                'Accept': 'application/json',
                'Content-Type': 'application/json',
                'Authorization': this.getToken(),
            },
        };
        if (this.abortSignalForLoginCheck && this.abortSignalForLoginCheck['signal']) {
            reqConfig['signal'] = this.abortSignalForLoginCheck['signal'];
        }
        const response = await fetch(`${this.getBaseUrl()}${this.endpoints.userInfoEndpoint}`, reqConfig);
        if (response.status === 409) {
            // This is a status the API returns if a user has been logged out
            window.clearInterval(this.checkUserLoggedInStateInterval);
            console.log('Cleared out user data due to bad response from authentication endpoint');
            this.LogoutUser();
            return;
        }
        if (!response.ok) {
            // The response was "bad". This could be due to bad connectivity or something else.
            // We'll ignore it so we don't unecessarily log users out or have them loose state if they're switching connection
            return;
        }
        const data = await response.json();
        if (!data || !data['accessToken']) {
            window.clearInterval(this.checkUserLoggedInStateInterval);
            console.log('Cleared out user data due to bad response from authentication endpoint');
            this.LogoutUser();
        }
        this.loginCheckInProgress = false;
    }
    LogoutUser() {
        this.clearUserData();
        // Log out user
        if (this.eventTarget) {
            const logoutLink = this.eventTarget.querySelector('#pn-marketweb-header-logoutlink');
            if (logoutLink) {
                logoutLink.click();
                return;
            }
        }
        this.loginStateChange();
        // If no logout link was found, attempt to change URL to redirect link
        const currentPageHref = window.location.href;
        window.location.href = this.getLogoutUrl(currentPageHref);
    }
    isLoggedIn(override = false) {
        if (override) {
            return override;
        }
        let isLoggedIn = this.store.get(this.keys.token) && this.store.get(this.keys.user) ? true : false;
        if (!isLoggedIn && this.store.get(this.keys.token) === this.overridetokenValue) {
            isLoggedIn = true;
        }
        return isLoggedIn;
    }
    registerToken(token = '', tokenSource = 'frontend') {
        if (!token || token === this.getToken()) {
            return;
        }
        this.clearUserData();
        this.store.set(this.keys.tokensource, tokenSource);
        this.store.set(this.keys.token, token);
        this.fetchUserInfo();
    }
    invalidateTokenOfType(tokenSource = 'frontend') {
        const currentToken = this.store.get(this.keys.token);
        if (!currentToken) {
            return;
        }
        const currentTokenSource = this.store.get(this.keys.tokensource);
        if (currentTokenSource !== tokenSource) {
            return;
        }
        // If we have a token and the source is set then we will invalidate the user data
        this.clearUserData();
    }
    getLoginUrl(redirectPage = '') {
        const currentPage = window.location.href;
        redirectPage = redirectPage ? redirectPage : currentPage;
        return `${this.getBaseUrl()}${this.endpoints.authorizationEndpoint}?redirectionUrl=${redirectPage}`;
    }
    getLogoutUrl(linkHref = '') {
        if (linkHref.indexOf('logout?logoutUrl') !== -1) {
            // Link has already been formatted.
            return linkHref;
        }
        let redirectPage = linkHref
            .replace('logout', '')
            .replace('http://window.location.href/?', window.location.href)
            .replace('https://window.location.href/?', window.location.href);
        let rootUrl = this.siteUrl;
        try {
            const url = new URL(this.siteUrl + '');
            rootUrl = url.origin;
        }
        catch (e) { }
        const addSlash = rootUrl.lastIndexOf('/') !== rootUrl.length - 1;
        const siteUrl = rootUrl + (addSlash ? '/' : '') + 'logout';
        const secondLogoutUrl = `${this.getBaseUrl()}${this.endpoints.logoutEndpoint}?authorization=${this.store.get(this.keys.token)}%26redirectionUrl=${redirectPage}`;
        const logoutUrl = `${siteUrl}?logoutUrl=${secondLogoutUrl}`;
        return logoutUrl;
    }
    getUserInfo() {
        if (this.isLoggedIn()) {
            return this.store.get(this.keys.user);
        }
    }
    getEventTarget() {
        return this.eventTarget;
    }
    checkExpireTime() {
        const expire = this.store.get(this.keys.expire);
        if (!expire) {
            return;
        }
        const now = new Date();
        const expireDate = new Date(Math.floor(parseInt(expire, 10) * 1000));
        if (now > expireDate) {
            console.info('Login time has expired');
            this.clearUserData();
            this.loginStateChange();
        }
    }
    checkPNTopbar() {
        if (this.isLoggedIn() || !window['pnTopbar'] || !window['pnTopbar']['session_id']) {
            return;
        }
        this.store.set(this.keys.token, window['pnTopbar']['session_id']);
        this.fetchUserInfo();
    }
    checkParameters() {
        if (!window?.location) {
            return;
        }
        const params = new URLSearchParams(window.location.search);
        if (params.get('oneTimeCode')) {
            const oneTimeCode = params.get('oneTimeCode');
            this.exchangeToken(oneTimeCode).then(() => {
                const currentHref = window.location.href;
                const paramPrefix = currentHref.indexOf('?oneTimeCode') !== -1 ? '?' : '&';
                const newUrl = currentHref.replace(`${paramPrefix}oneTimeCode=${oneTimeCode}`, '');
                history.replaceState({}, document.querySelector('title').innerText, newUrl);
            });
        }
    }
    async fetchUserInfo() {
        const token = this.store.get(this.keys.token);
        if (this.store.get(this.keys.token) === this.overridetokenValue) {
            console.info('Did not fetch user data since it was set by an override');
            return;
        }
        const reqConfig = {
            method: 'GET',
            headers: {
                'Accept': 'application/json',
                'Content-Type': 'application/json',
                'Authorization': token,
            },
        };
        const response = await fetch(`${this.getBaseUrl()}${this.endpoints.userInfoEndpoint}`, reqConfig);
        const data = await response.json();
        if (data && data['idToken']) {
            try {
                const { idToken, expiryTime, accessToken } = data;
                const userInfo = this.parseUserInfo(idToken);
                if (!userInfo) {
                    console.error('Userdata is not valid');
                    this.clearUserData();
                    return;
                }
                this.store.set(this.keys.user, userInfo);
                // 10 Min early expire
                this.store.set(this.keys.accessToken, accessToken);
                this.store.set(this.keys.expire, expiryTime);
                this.store.set(this.keys.expireDate, new Date(Math.floor(parseInt(expiryTime, 10) * 1000)));
                this.loginStateChange();
            }
            catch (e) {
                console.error('Unable to get user information', e);
            }
        }
        else {
            console.error('Unable to get user information. Clearing login state');
            this.clearUserData();
        }
    }
    clearUserData() {
        this.store.remove(this.keys.user);
        this.store.remove(this.keys.tokensource);
        this.store.remove(this.keys.accessToken);
        this.store.remove(this.keys.token);
        this.store.remove(this.keys.expire);
        this.store.remove(this.keys.expireDate);
    }
    getToken() {
        return this.store.get(this.keys.token);
    }
    getAccessToken() {
        return this.store.get(this.keys.accessToken);
    }
    async exchangeToken(oneTimeCode) {
        this.clearUserData();
        const response = await fetch(`${this.getBaseUrl()}${this.endpoints.tokenExchangeEndpoint}?oneTimeCode=${oneTimeCode}`);
        const { token } = await response.json();
        if (typeof token === 'string' && token) {
            this.store.set(this.keys.token, token);
        }
        this.fetchUserInfo();
    }
    loginStateChange() {
        if (!this.eventTarget) {
            return;
        }
        this.eventTarget.dispatchEvent(new CustomEvent(this.events.loginstatechange, {
            detail: this.isLoggedIn(),
        }));
    }
    getBaseUrl() {
        const atEnvironments = ['localhost', 'integration.', 'inte.', 'local.', 'prep.'];
        let useATEnv = atEnvironments.filter(x => this.endpoint.indexOf(x) !== -1).length > 0;
        if (['devportal.postnord.com', 'atportal.postnord.com'].indexOf(window.location.hostname) !== -1) {
            useATEnv = true;
        }
        if (useATEnv) {
            return this.baseUrls.at;
        }
        return this.baseUrls.prod;
    }
    parseUserInfo(idToken) {
        if (!idToken) {
            return null;
        }
        var base64Url = idToken.split('.')[1];
        var base64 = base64Url.replace(/-/g, '+').replace(/_/g, '/');
        var jsonPayload = decodeURIComponent(atob(base64)
            .split('')
            .map(function (c) {
            return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2);
        })
            .join(''));
        return JSON.parse(jsonPayload);
    }
    store = {
        get: (key) => {
            const value = window.localStorage.getItem(`${this.storagePrefix}-${key}`);
            if (!value) {
                return value;
            }
            if (value.indexOf('{') === 0) {
                try {
                    return JSON.parse(value);
                }
                catch (e) { }
            }
            if (value.indexOf(',') !== -1) {
                return value.split(',');
            }
            return value;
        },
        set: (key, value) => {
            if (typeof value === 'object' && typeof value.length === 'undefined') {
                window.localStorage.setItem(`${this.storagePrefix}-${key}`, JSON.stringify(value));
                return;
            }
            window.localStorage.setItem(`${this.storagePrefix}-${key}`, value);
        },
        remove: (key) => {
            window.localStorage.removeItem(`${this.storagePrefix}-${key}`);
        },
    };
}

const pnMarketwebSiteheaderLoginCss = "pn-button-dropdown .pn-button-dropdown>pn-button>.pn-button{min-height:initial}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border-width:0}@media screen and (max-width: 767px){.sr-only-mobile{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border-width:0}}pn-marketweb-siteheader-login{--login-dropdown-divider-background:var(--siteheader-login-dropdown-divider-background,\n    #f9f8f8);--login-dropdown-text-color:var(--siteheader-login-dropdown-text-color,\n    #2d2013);--login-dropdown-link-color:var(--siteheader-login-dropdown-link-color,\n    #005d92);--login-dropdown-link-hover-decoration:var(--siteheader-login-dropdown-link-hover-decoration,\n      underline);--login-dark-icon-hover-fill:var(--siteheader-login-dark-icon-hover-fill,\n    #000000);padding:1rem 0;max-height:5.2rem;position:relative}pn-marketweb-siteheader-login pn-button-dropdown{display:none}pn-marketweb-siteheader-login pn-button-dropdown .pn-button-dropdown-container .pn-button-dropdown-content{max-width:350px;display:flex;flex-direction:column;gap:2.4rem;padding:4rem}pn-marketweb-siteheader-login pn-button-dropdown .pn-button-dropdown-container .pn-button-dropdown-content pn-button{width:100%}pn-marketweb-siteheader-login pn-button-dropdown .pn-button-dropdown-container .pn-button-dropdown-content pn-marketweb-siteheader-unified-login::after{display:block;content:\"\";width:100%;height:2px;margin-top:2.4rem;background:var(--login-dropdown-divider-background)}pn-marketweb-siteheader-login pn-button-dropdown .pn-button-dropdown-container .pn-button-dropdown-content span{font-size:1.4rem;color:var(--login-dropdown-text-color)}pn-marketweb-siteheader-login pn-button-dropdown .pn-button-dropdown-container .pn-button-dropdown-content span::before{display:block;content:\"\";width:100%;height:2px;background:var(--login-dropdown-divider-background)}pn-marketweb-siteheader-login pn-button-dropdown .pn-button-dropdown-container .pn-button-dropdown-content span a{text-decoration:none;color:var(--login-dropdown-link-color)}pn-marketweb-siteheader-login pn-button-dropdown .pn-button-dropdown-container .pn-button-dropdown-content span a:hover{text-decoration:var(--login-dropdown-link-hover-decoration)}pn-marketweb-siteheader-login pn-button-dropdown .pn-button-dropdown-container .pn-button-dropdown-content span *{margin-bottom:0}pn-marketweb-siteheader-login.hydrated pn-button-dropdown{display:block}pn-marketweb-siteheader-login[appearance=dark] button:hover pn-icon svg path{fill:var(--login-dark-icon-hover-fill)}";
const PnMarketwebSiteheaderLoginStyle0 = pnMarketwebSiteheaderLoginCss;

const PnMarketwebSiteheaderLogin = class {
    constructor(hostRef) {
        index.registerInstance(this, hostRef);
        this.loginStateChange = index.createEvent(this, "loginStateChange", 7);
        this.endpoint = '';
        this.token = '';
        this.i18n = {
            searchlabel: '',
            searchplaceholder: '',
            searchbuttontext: '',
            menuHomeButton: '',
            menuGoBackButton: '',
            mainMenuButton: '',
            menuStartButton: '',
            profileSelectionFlyoutHeading: '',
            unifiedLoginButton: '',
            unifiedMyPagesButton: '',
        };
        this.siteUrl = '';
        this.emitEvents = true;
        this.loginDialog = null;
        this.fullname = '';
        this.loggedin = false;
        this.showProfileSelection = false;
        this.showUnifiedLogin = false;
        this.checkUserLoggedInStateInterval = 0;
        this.environment = undefined;
        this.appearance = 'light';
        this.loginLinks = undefined;
        this.toggleButtonText = this.loginDialog?.loginMenuLinkText ? this.loginDialog.loginMenuLinkText : '';
        this.username = this.fullname;
        this.useMarketwebLogin = undefined;
    }
    get hostElement() { return index.getElement(this); }
    // Events
    loginStateChange;
    componentWillLoad() {
        const userInfo = this.loggedin && this.fullname ? { given_name: this.fullname } : null;
        pnMarketwebSiteheaderStore.state.loginManager = new MarketWebLoginManager({
            endpoint: this.endpoint,
            eventTarget: this.hostElement,
            checkUserLoggedInStateInterval: this.checkUserLoggedInStateInterval,
            userInfo,
        });
        pnMarketwebSiteheaderStore.state.loginManager.setSiteUrl(this.siteUrl);
        this.hostElement['loginmanager'] = pnMarketwebSiteheaderStore.state.loginManager;
        if (this.token) {
            pnMarketwebSiteheaderStore.state.loginManager.registerToken(this.token, 'backend');
        }
        else if (this.emitEvents) {
            // The primary login instance
            pnMarketwebSiteheaderStore.state.loginManager.invalidateTokenOfType('backend');
        }
        this.hostElement.addEventListener(pnMarketwebSiteheaderStore.state.loginManager.events.loginstatechange, this.onLoginStateChange.bind(this));
        this.init();
        this.setUserName();
        this.setToggleButtonText();
    }
    async init() {
        pnMarketwebSiteheaderStore.state.loginManager.init(this.emitEvents);
        this.setToggleButtonText();
        this.adjustLoginLinks();
    }
    adjustLoginLinks() {
        if (!this.loginDialog?.loginMenuLinks) {
            return;
        }
        const adjustLink = (link, i) => {
            if (!link.isLogoutLink) {
                link.isLogoutLink = link.pageLink.indexOf('location.href') !== -1 && link.pageLink.indexOf('logout') !== -1;
            }
            if (link.isLogoutLink) {
                link.href = pnMarketwebSiteheaderStore.state.loginManager.getLogoutUrl(link.pageLink);
            }
            if (i === 0 && !link.href) {
                link.href = pnMarketwebSiteheaderStore.state.loginManager.getLoginUrl();
                link.linkType = 'primary';
            }
            if (link.primaryLinkApperance && !link.linkType) {
                link.linkType = 'primary';
            }
            return link;
        };
        if (this.loginDialog) {
            this.loginDialog.loginMenuLinks = this.loginDialog.loginMenuLinks.map(adjustLink);
            this.loginDialog.loggedInLinks = this.loginDialog.loggedInLinks.map(adjustLink);
        }
        this.loginDialog.legacyLoginLinks = [
            {
                href: pnMarketwebSiteheaderStore.state.loginManager.getLoginUrl(this.loginDialog.loginUrl),
                linkText: this.loginDialog.loginLinkText,
                openInNewWindow: false,
                isLogoutLink: false,
                pageLink: null,
                linkType: 'primary',
                primaryLinkApperance: true,
            },
            {
                href: pnMarketwebSiteheaderStore.state.loginManager.getLoginUrl(this.loginDialog.registerUrl),
                linkText: this.loginDialog.createLoginLinkText,
                openInNewWindow: false,
                isLogoutLink: false,
                pageLink: null,
                primaryLinkApperance: false,
            },
        ];
    }
    setUserName() {
        const userInfo = pnMarketwebSiteheaderStore.state.loginManager.getUserInfo();
        let name = '';
        if (!this.loggedin || !userInfo) {
            this.username = name;
        }
        if (userInfo && userInfo.given_name) {
            name = userInfo.given_name + (userInfo?.family_name ? ` ${userInfo?.family_name}` : '');
        }
        if (!name && userInfo && userInfo.email) {
            name = userInfo.email;
        }
        if (!name && this.fullname) {
            name = this.fullname;
        }
        this.username = name;
        this.adjustLoginLinks();
    }
    setToggleButtonText() {
        if (this.loggedin) {
            this.toggleButtonText = this.username;
            if (!this.toggleButtonText) {
                this.toggleButtonText = this.loginDialog.loggedInButtonText;
            }
        }
        else {
            this.toggleButtonText = this.loginDialog.loginMenuLinkText;
        }
    }
    onLoginStateChange(e) {
        if (this.loggedin !== e.detail && this.emitEvents) {
            this.loggedin = e.detail;
            this.loginStateChange.emit({ loggedIn: this.loggedin, token: pnMarketwebSiteheaderStore.state.loginManager.getToken() });
            this.setUserName();
            this.setToggleButtonText();
        }
    }
    render() {
        if (!this.loginDialog) {
            return;
        }
        let hostElementAttribute = {
            username: null,
            loggedin: 'false',
        };
        if (this.username) {
            hostElementAttribute.username = this.username;
            hostElementAttribute.loggedin = this.loggedin + '';
        }
        return (index.h(index.Host, { ...hostElementAttribute }, index.h("pn-button-dropdown", { label: this.toggleButtonText, icon: user, appearance: this.appearance, variant: "borderless", class: "siteheader-logindialog" }, this.showUnifiedLogin && !this.loggedin && (index.h("pn-marketweb-siteheader-unified-login", { loggedIn: this.loggedin, logInLabel: this.i18n.unifiedLoginButton, useMarketwebLogin: this.useMarketwebLogin, environment: this.environment })), this.loggedin && this.showProfileSelection ? (index.h("pn-marketweb-siteheader-login-profileselection", { loginDialog: this.loginDialog, loggedin: this.loggedin, i18n: this.i18n, idNamespace: this.emitEvents ? '1' : '2', endpoint: this.endpoint })) : (index.h("pn-marketweb-siteheader-login-links", { loginDialog: this.loginDialog, loggedin: this.loggedin, idNamespace: this.emitEvents ? '1' : '2', username: this.username, showUnifiedLogin: this.showUnifiedLogin })), !this.loggedin && this.loginDialog?.loginInfo && (index.h("span", { innerHTML: `${this.loginDialog.loginInfo}` })))));
    }
    static get watchers() { return {
        "i18n": ["init"],
        "loginDialog": ["init"]
    }; }
};
PnMarketwebSiteheaderLogin.style = PnMarketwebSiteheaderLoginStyle0;

const pnMarketwebSiteheaderLoginLinksCss = "pn-button-dropdown .pn-button-dropdown>pn-button>.pn-button{min-height:initial}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border-width:0}@media screen and (max-width: 767px){.sr-only-mobile{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border-width:0}}";
const PnMarketwebSiteheaderLoginLinksStyle0 = pnMarketwebSiteheaderLoginLinksCss;

const PnMarketwebSiteheaderLoginLinks = class {
    constructor(hostRef) {
        index.registerInstance(this, hostRef);
        this.loginDialog = null;
        this.idNamespace = '';
        this.loggedin = false;
        this.username = '';
        this.showUnifiedLogin = false;
    }
    get hostElement() { return index.getElement(this); }
    componentWillLoad() {
        this.init();
    }
    async init() {
        this.adjustLoginLinks();
    }
    adjustLoginLinks() {
        if (!this.loginDialog) {
            return;
        }
        const adjustLink = (link, i) => {
            if (!link.isLogoutLink) {
                link.isLogoutLink = link.pageLink.indexOf('location.href') !== -1 && link.pageLink.indexOf('logout') !== -1;
            }
            if (link.isLogoutLink) {
                link.href = pnMarketwebSiteheaderStore.state.loginManager.getLogoutUrl(link.href);
            }
            link.href = link.href.replace('window.location.href', window.location.href);
            if (i === 0 && !link.href) {
                link.href = pnMarketwebSiteheaderStore.state.loginManager.getLoginUrl();
                link.linkType = 'primary';
            }
            if (link.primaryLinkApperance && !link.linkType) {
                link.linkType = 'primary';
            }
        };
        if (this.loginDialog?.loginMenuLinks) {
            this.loginDialog?.loginMenuLinks.forEach(adjustLink);
        }
        if (this.loginDialog?.loggedInLinks) {
            this.loginDialog?.loggedInLinks.forEach(adjustLink);
        }
        this.loginDialog.legacyLoginLinks = [
            {
                href: pnMarketwebSiteheaderStore.state.loginManager.getLoginUrl(this.loginDialog.loginUrl),
                linkText: this.loginDialog.loginLinkText,
                openInNewWindow: false,
                isLogoutLink: false,
                pageLink: null,
                linkType: 'primary',
                primaryLinkApperance: true,
            },
            {
                href: pnMarketwebSiteheaderStore.state.loginManager.getLoginUrl(this.loginDialog.registerUrl),
                linkText: this.loginDialog.createLoginLinkText,
                openInNewWindow: false,
                isLogoutLink: false,
                pageLink: null,
                primaryLinkApperance: false,
            },
        ];
    }
    render() {
        if (!this.loginDialog) {
            return;
        }
        let hostElementAttribute = {
            username: null,
            loggedin: false,
        };
        if (this.username) {
            hostElementAttribute.username = this.username;
            hostElementAttribute.loggedin = this.loggedin;
        }
        return (index.h(index.Host, { ...hostElementAttribute }, !this.loginDialog.overrideLoginMenu ? (index.h("div", { "data-loggedin": this.loggedin + '' }, this.loggedin ? (index.h("pn-marketweb-siteheader-login-linklist", { links: this.loginDialog.loggedInLinks, idNamespace: this.idNamespace })) : (index.h("div", null, this.loginDialog.loginMenuLinks?.length > 0 ? (index.h("pn-marketweb-siteheader-login-linklist", { heading: this.loginDialog.loginTitle, links: this.loginDialog.loginMenuLinks, idNamespace: this.idNamespace, showUnifiedLogin: this.showUnifiedLogin })) : (index.h("pn-marketweb-siteheader-login-linklist", { links: this.loginDialog.legacyLoginLinks, idNamespace: this.idNamespace })))))) : null, this.loginDialog.overrideLoginMenu ? (index.h("pn-marketweb-siteheader-login-linklist", { links: this.loginDialog.loginMenuLinks, idNamespace: this.idNamespace })) : null));
    }
    static get watchers() { return {
        "loginDialog": ["init"]
    }; }
};
PnMarketwebSiteheaderLoginLinks.style = PnMarketwebSiteheaderLoginLinksStyle0;

const pnMarketwebSiteheaderLoginProfileselectionCss = "pn-button-dropdown .pn-button-dropdown>pn-button>.pn-button{min-height:initial}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border-width:0}@media screen and (max-width: 767px){.sr-only-mobile{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border-width:0}}pn-marketweb-siteheader-login-profileselection{--login-profileselection-heading-color:var(--siteheader-login-profileselection-heading-color,\n      inherit);--login-profileselection-description-color:var(--siteheader-login-profileselection-description-color,\n      #5e554a);--login-profileselection-user-name-color:var(--siteheader-login-profileselection-user-name-color,\n      inherit);--login-profileselection-divider-background:var(--siteheader-login-profileselection-divider-background,\n      #00a0d6);--login-profileselection-profileoption-link-background:var(--siteheader-login-profileselection-profileoption-link-background,\n      #ffffff);--login-profileselection-profileoption-link-color:var(--siteheader-login-profileselection-profileoption-link-color,\n      #005d92);--login-profileselection-profileoption-link-hover-background:var(--siteheader-login-profileselection-profileoption-link-hover-background,\n      #f3f2f2);--login-profileselection-logout-link-color:var(--siteheader-login-profileselection-logout-link-color,\n      #005d92)}.pn-marketweb-siteheader-login-profileselection-heading{display:block;padding:0.5rem 0 1rem;color:var(--login-profileselection-heading-color)}.pn-marketweb-siteheader-login-profileselection-user,.pn-marketweb-siteheader-login-profileselection-currentprofile{margin-top:1rem;margin-bottom:1rem}.pn-marketweb-siteheader-login-profileselection-user-name,.pn-marketweb-siteheader-login-profileselection-currentprofile-name{line-height:1;color:var(--login-profileselection-user-name-color)}.pn-marketweb-siteheader-login-profileselection-user-description,.pn-marketweb-siteheader-login-profileselection-currentprofile-description{font-weight:400;white-space:normal;word-break:break-all;color:var(--login-profileselection-description-color);font-size:0.75em}.pn-marketweb-siteheader-login-profileselection-divider{position:relative;width:100%;height:1rem;background:var(--login-profileselection-divider-background);margin-left:-1em;margin-top:1.6rem;margin-bottom:1.6rem;border-radius:0 0.6em 0.6em 0;padding:0}.pn-marketweb-siteheader-login-profileselection-divider::after{content:\"\";position:absolute;right:0;top:0;width:0.6em;height:0.6em;border-radius:50%;background:inherit;transform:translateX(calc(100% + 0.2em))}.pn-marketweb-siteheader-login-profileselection-profileoption-link{display:flex;align-items:center;margin:0 -1em;padding:0.6rem 1.6rem;background:var(--login-profileselection-profileoption-link-background);color:var(--login-profileselection-profileoption-link-color);text-decoration:none;transition:background 0.15s ease-in-out}.pn-marketweb-siteheader-login-profileselection-profileoption-link:hover,.pn-marketweb-siteheader-login-profileselection-profileoption-link:focus,.pn-marketweb-siteheader-login-profileselection-profileoption-link:active{background:var(--login-profileselection-profileoption-link-hover-background)}.pn-marketweb-siteheader-login-profileselection-profileoption-content{flex-grow:1}.pn-marketweb-siteheader-login-profileselection-profileoption-name{font-weight:700}.pn-marketweb-siteheader-login-profileselection-profileoption-description{font-weight:400;white-space:normal;word-break:break-all;color:var(--login-profileselection-description-color);font-size:0.75em}.pn-marketweb-siteheader-login-profileselection-logout{width:100%;padding:1.6rem;text-align:center}.pn-marketweb-siteheader-login-profileselection-logout-link{display:inline-block;font-weight:500;color:var(--login-profileselection-logout-link-color);text-decoration:none}.pn-marketweb-siteheader-login-profileselection-logout-link:hover,.pn-marketweb-siteheader-login-profileselection-logout-link:focus,.pn-marketweb-siteheader-login-profileselection-logout-link:active{text-decoration:underline}";
const PnMarketwebSiteheaderLoginProfileselectionStyle0 = pnMarketwebSiteheaderLoginProfileselectionCss;

const PnMarketwebSiteheaderLoginProfileselection = class {
    constructor(hostRef) {
        index.registerInstance(this, hostRef);
        this.loginDialog = null;
        this.endpoint = '';
        this.loggedin = false;
        this.idNamespace = '';
        this.heading = null;
        this.i18n = {
            searchlabel: '',
            searchplaceholder: '',
            searchbuttontext: '',
            menuHomeButton: '',
            menuGoBackButton: '',
            mainMenuButton: '',
            menuStartButton: '',
            profileSelectionFlyoutHeading: '',
        };
        this.user = null;
        this.logoutLink = null;
        this.userName = null;
        this.userEmail = '';
        this.currentProfile = null;
        this.profileoptions = [];
    }
    get hostElement() { return index.getElement(this); }
    componentWillLoad() {
        if (this.heading === null && this.i18n?.profileSelectionFlyoutHeading) {
            this.heading = this.i18n.profileSelectionFlyoutHeading;
        }
        this.init();
    }
    init() {
        this.updateUserInfo();
        this.adjustLoginLinks();
        this.fetchProfiles();
    }
    async fetchProfiles() {
        if (!this.loggedin || this.profileoptions.length > 0) {
            return;
        }
        let apiUrl = `${this.endpoint}${this.endpoint.lastIndexOf('/') > -1 && this.endpoint.lastIndexOf('/') === this.endpoint.length - 1 ? '' : '/'}api/user/parentorganizations`;
        const req = await fetch(apiUrl);
        const reqdata = await req.json();
        const fallbackData = {
            loggedin: true,
            organizations: [
                {
                    name: 'Forsheda Livs AB',
                    customerNumber: '5564513603',
                    id: 'dbba867d-1dff-3dbb-b420-c57b4b828b73',
                    selected: true,
                    profiles: [
                        {
                            name: 'Forsheda Livs AB',
                            customerNumber: '20685482',
                            id: 'f757ba28-9a73-15a2-f128-4b394d970f3f',
                            ssid: '',
                            selected: false,
                            customerGroup: 'Business',
                        },
                        {
                            name: 'ICA MAXI KUNGSBACKA',
                            customerNumber: '20831191',
                            id: '5aea41df-32b0-3f7e-2946-78598360177d',
                            ssid: '259686',
                            selected: true,
                            customerGroup: 'Agent',
                        },
                    ],
                },
                {
                    name: 'Hem Livs i Kungsbacka AB',
                    customerNumber: '5565271250',
                    id: '97ca363c-40ef-cca9-7a3c-9e7f025567c2',
                    selected: false,
                    profiles: [
                        {
                            name: 'ICA KVANTUM KUNGSBACKA',
                            customerNumber: '20831193',
                            id: 'fbd61ffd-41c6-2206-b88e-cfef91e1dc39',
                            ssid: '259691',
                            selected: false,
                            customerGroup: 'Agent',
                        },
                    ],
                },
                {
                    name: 'ICA SUPERMARKET TORGET',
                    customerNumber: '5568902679',
                    id: '7cb76a94-e1a5-5f57-58fd-bc563851b28e',
                    selected: false,
                    profiles: [
                        {
                            name: 'ICA SUPERMARKET TORGET',
                            customerNumber: '20831212',
                            id: '3a2db017-b68f-6fa0-fe70-542c08cd97ce',
                            ssid: '',
                            selected: false,
                            customerGroup: 'Agent',
                        },
                    ],
                },
            ],
        };
        const data = window.location.href.indexOf('localhost:6008') !== -1 ? fallbackData : reqdata;
        if (!data || !data.organizations || !data.organizations.length) {
            this.heading = ""; //this is to not get "logged in as" text when its private account
            return;
        }
        data.organizations.forEach(org => {
            if (org.selected === true && org.profiles) {
                const selectedProfile = org.profiles.filter(x => x.selected === true);
                if (selectedProfile && selectedProfile[0] && selectedProfile[0].customerGroup.toLocaleLowerCase() === 'agent' && selectedProfile[0].ssid) {
                    org.customerNumber = selectedProfile[0].ssid;
                }
            }
            else {
                if (org.customerNumber.length === 10 && org.customerNumber.substring(0, 2) === '55') {
                    org.customerNumber = org.customerNumber.substring(0, 6) + '-' + org.customerNumber.substring(6);
                }
                this.profileoptions.push(org);
            }
        });
        let currentProfileObj = data.organizations.filter(x => x.selected === true)[0];
        const userProfileOption = {
            name: this.userName,
            customerNumber: '',
            id: '',
            selected: !currentProfileObj,
            profiles: [],
        };
        if (!currentProfileObj) {
            currentProfileObj = userProfileOption;
        }
        if (currentProfileObj && currentProfileObj.name) {
            this.currentProfile = currentProfileObj;
        }
        this.profileoptions.push(userProfileOption);
    }
    adjustLoginLinks() {
        const adjustLink = (link, i) => {
            if (!link.isLogoutLink) {
                link.isLogoutLink = link.pageLink.indexOf('location.href') !== -1 && link.pageLink.indexOf('logout') !== -1;
            }
            if (link.isLogoutLink) {
                link.href = pnMarketwebSiteheaderStore.state.loginManager.getLogoutUrl(link.href);
            }
            if (i === 0 && !link.href) {
                link.href = pnMarketwebSiteheaderStore.state.loginManager.getLoginUrl();
                link.linkType = 'primary';
            }
            if (link.primaryLinkApperance && !link.linkType) {
                link.linkType = 'primary';
            }
        };
        if (this.loginDialog?.loggedInLinks) {
            this.loginDialog?.loggedInLinks.forEach(adjustLink);
        }
        this.logoutLink = this.loginDialog?.loggedInLinks.filter(x => x.isLogoutLink)[0] ?? null;
    }
    updateUserInfo() {
        const userInfo = pnMarketwebSiteheaderStore.state.loginManager.getUserInfo();
        this.user = userInfo;
        if (!userInfo) {
            return;
        }
        if (userInfo && userInfo.email) {
            this.userEmail = userInfo.email;
        }
        if (userInfo && userInfo.given_name) {
            this.userName = userInfo.given_name + (userInfo?.family_name ? ` ${userInfo?.family_name}` : '');
        }
        if (userInfo && userInfo.given_name) {
            this.userName = userInfo.given_name;
            return;
        }
        if (userInfo && userInfo.family_name) {
            this.userName = userInfo.family_name;
            return;
        }
        if (userInfo && userInfo.username) {
            this.userName = userInfo.username;
            return;
        }
    }
    filterLogoutLink(loggedInLinks) {
        return loggedInLinks.filter((link) => !link.isLogoutLink);
    }
    render() {
        if (!this.loginDialog) {
            return;
        }
        let hostElementAttribute = {};
        return (index.h(index.Host, { ...hostElementAttribute }, this.heading ? index.h("strong", { class: "pn-marketweb-siteheader-login-profileselection-heading" }, this.heading) : null, this.currentProfile !== null && this.currentProfile.name ? (index.h("div", { class: "pn-marketweb-siteheader-login-profileselection-currentprofile" }, index.h("div", { class: "pn-marketweb-siteheader-login-profileselection-currentprofile-name" }, this.currentProfile.name), index.h("div", { class: "pn-marketweb-siteheader-login-profileselection-currentprofile-description" }, this.currentProfile.customerNumber ? this.currentProfile.customerNumber : this.userEmail))) : null, index.h("pn-marketweb-siteheader-login-linklist", { links: this.filterLogoutLink(this.loginDialog.loggedInLinks), idNamespace: this.idNamespace }), index.h("div", { class: "pn-marketweb-siteheader-login-profileselection-divider" }), this.profileoptions
            .filter(x => x.selected !== true)
            .map(organization => {
            let customerNumber = organization.profiles.length > 0 ? organization.profiles[0].customerNumber : organization.customerNumber;
            return (index.h("div", { class: "pn-marketweb-siteheader-login-profileselection-profileoption" }, index.h("a", { href: `${this.endpoint}/api/user/setprofile?customernumber=${customerNumber}&returnUrl=${encodeURIComponent(window.location.href)}`, class: "pn-marketweb-siteheader-login-profileselection-profileoption-link" }, index.h("div", { class: "pn-marketweb-siteheader-login-profileselection-profileoption-content" }, index.h("div", { class: "pn-marketweb-siteheader-login-profileselection-profileoption-name" }, organization.name), index.h("div", { class: "pn-marketweb-siteheader-login-profileselection-profileoption-description" }, organization.customerNumber ? organization.customerNumber : this.userEmail)), index.h("pn-icon", { icon: arrow_right.arrow_right, small: "false", color: "blue700" }))));
        }), this.logoutLink ? (index.h("div", { class: "pn-marketweb-siteheader-login-profileselection-logout" }, index.h("a", { href: this.logoutLink.href, rel: "nofollower noopener", id: "pn-marketweb-header-logoutlink", onClick: () => pnMarketwebSiteheaderStore.state.loginManager.clearUserData(), class: "pn-marketweb-siteheader-login-profileselection-logout-link" }, this.logoutLink.linkText))) : null));
    }
};
PnMarketwebSiteheaderLoginProfileselection.style = PnMarketwebSiteheaderLoginProfileselectionStyle0;

// Read more about how stencil stores work here: https://stenciljs.com/docs/stencil-store
const { state, onChange } = index$1.createStore({
    searchValue: '',
    autocompleteSuggestions: {},
    requestAbortController: new AbortController(),
});

const pnMarketwebSiteheaderSearchCss = "pn-button-dropdown .pn-button-dropdown>pn-button>.pn-button{min-height:initial}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border-width:0}@media screen and (max-width: 767px){.sr-only-mobile{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border-width:0}}.siteheader-search a{display:none}@media screen and (min-width: 48em){.siteheader-search a{display:block}}.siteheader-search pn-search-field>.input-container button{background:#ffffff}.siteheader-search pn-search-field.button-icon pn-button,.siteheader-search pn-button{display:inline-flex}.siteheader-search pn-search-field.button-icon pn-button button,.siteheader-search pn-button button{align-self:center;padding:0;height:2.3em;width:2.4em;line-height:0;min-height:unset;min-width:initial}.siteheader-search pn-search-field.button-icon pn-button pn-icon,.siteheader-search pn-button pn-icon{margin-left:0}.siteheader-search pn-search-field.button-icon pn-button .pn-button-tooltip,.siteheader-search pn-button .pn-button-tooltip{line-height:initial !important}.siteheader-search form{justify-content:flex-end;align-items:stretch;width:auto;flex:none;display:flex;padding:0;margin:0 0 0 0.4rem;position:relative;flex-direction:column}@media screen and (min-width: 60em){.siteheader-search form{margin-right:1.6rem}}.siteheader-search form pn-search-field{min-width:13.5em}.siteheader-search form pn-search-field .input-container{align-self:center}.siteheader-search form pn-search-field input{height:auto;min-height:1em;padding:0.6em 0.75em}";
const PnMarketwebSiteheaderSearchStyle0 = pnMarketwebSiteheaderSearchCss;

const PnMarketwebSiteheaderSearch = class {
    constructor(hostRef) {
        index.registerInstance(this, hostRef);
        this.i18n = undefined;
        this.showOnlyLink = false;
        this.hideSearch = false;
        this.language = null;
        this.siteid = null;
        this.search = {};
        this.primary = false;
        this.icononly = true;
        this.autoCompleteOptions = [];
    }
    get hostElement() { return index.getElement(this); }
    onSearchValueUpdate() {
        this.getAutocomplete(state.searchValue);
    }
    async getAutocomplete(prefix) {
        if (!this.search.AutocompleteEndpoint || prefix.length < 2) {
            this.autoCompleteOptions = [];
            return;
        }
        if (state.autocompleteSuggestions[prefix]) {
            this.setAutocompleteSuggestions(state.autocompleteSuggestions[prefix]);
            return;
        }
        let autocompleteUrl = `${this.search.AutocompleteEndpoint}?prefix=${prefix}&size=10`;
        if (this.language || this.siteid) {
            autocompleteUrl += `&tags=`;
            if (this.language) {
                autocompleteUrl += `language:${this.language}`;
            }
            if (this.language && this.siteid) {
                autocompleteUrl += `,`;
            }
            if (this.siteid) {
                autocompleteUrl += `siteid:${this.siteid}`;
            }
        }
        const req = await fetch(autocompleteUrl, { signal: state.requestAbortController.signal }).catch(e => {
            console.warn('Unable to fetch autocomplete suggestions', e);
        });
        if (!req) {
            return;
        }
        const data = await req.json();
        if (!data || !data.hits || !data.hits.length) {
            return;
        }
        const suggestions = data.hits
            .filter(item => item.type === 'editorial')
            .map(item => {
            return item.query;
        });
        // Store query in store
        state.autocompleteSuggestions[prefix] = suggestions;
        this.setAutocompleteSuggestions(suggestions);
    }
    setAutocompleteSuggestions(suggestions) {
        if (typeof suggestions !== 'object' || typeof suggestions.length !== 'number' || suggestions.length === 0) {
            return;
        }
        this.autoCompleteOptions = suggestions;
    }
    componentWillLoad() {
        onChange('searchValue', () => {
            this.onSearchValueUpdate();
        });
    }
    componentDidRender() {
        const inputSearchElm = this.hostElement.querySelector('pn-search-field input:not([list])');
        if (inputSearchElm && this.search.AutocompleteEndpoint) {
            inputSearchElm.setAttribute('list', 'siteheader-search-autocomplete');
        }
    }
    render() {
        if (!this.search.formActionUrl || this.hideSearch) {
            return;
        }
        const autocompleteAttribute = this.search.AutocompleteEndpoint ? { list: 'siteheader-search-autocomplete' } : {};
        return (index.h("div", { class: "siteheader-search" }, this.showOnlyLink ? (index.h("pn-button", { href: this.search.formActionUrl, appearance: "light", icon: search.search, tooltip: this.i18n.searchlabel })) : (index.h("form", { method: "get", action: this.search.formActionUrl, role: "search" }, index.h("pn-search-field", { ...autocompleteAttribute, label: this.i18n.searchlabel, name: "q", button: this.icononly ? 'icon' : null, "button-label": 'Search', placeholder: this.i18n.searchplaceholder, onUpdate: (e) => {
                state.searchValue = e.detail;
            }, onSearch: () => {
                const form = this.hostElement.querySelector('form');
                if (form) {
                    form.submit();
                }
            } }), this.primary && this.search.AutocompleteEndpoint ? (index.h("datalist", { id: "siteheader-search-autocomplete" }, this.autoCompleteOptions.map(item => (index.h("option", null, item))))) : null))));
    }
};
PnMarketwebSiteheaderSearch.style = PnMarketwebSiteheaderSearchStyle0;

const pnMarketwebSiteheaderUnifiedLoginCss = "";
const PnMarketwebSiteheaderUnifiedLoginStyle0 = pnMarketwebSiteheaderUnifiedLoginCss;

const PnMarketwebSiteheaderUnifiedLogin = class {
    constructor(hostRef) {
        index.registerInstance(this, hostRef);
        this.loggedIn = false;
        this.logInLabel = undefined;
        this.useMarketwebLogin = undefined;
        this.environment = undefined;
    }
    get hostElement() { return index.getElement(this); }
    render() {
        return (index.h(index.Host, { key: '1d7e3f775dac554952c3816c21717425aad528ed' }, index.h("pn-marketweb-siteheader-login-button", { key: '73d6e8a79a601d163c154d933f8bf946f6e2890b', label: this.logInLabel, useMarketwebLogin: this.useMarketwebLogin, environment: this.environment })));
    }
};
PnMarketwebSiteheaderUnifiedLogin.style = PnMarketwebSiteheaderUnifiedLoginStyle0;

const languageData = {
  sv: {
    navlabel: 'Webbplatsväljare',
  },
  en: {
    navlabel: 'Website selector',
  },
  da: {
    navlabel: 'Webstedsvælger',
  },
  no: {
    navlabel: 'Nettstedsvelger',
  },
  fi: {
    navlabel: 'Verkkosivun valitsin',
  },
  de: {
    navlabel: 'Website-Selektor',
  },
};

const pnSiteSelectorCss = "pn-button-dropdown .pn-button-dropdown>pn-button>.pn-button{min-height:initial}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border-width:0}@media screen and (max-width: 767px){.sr-only-mobile{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border-width:0}}pn-site-selector{--siteselector-heading-color:#000000;--siteselector-description-color:#2d2013;--siteselector-hover-background-color:#f3f2f2;--siteselector-hover-text-color:#005d92;--siteselector-active-text-color:#00a0d6;--siteselector-item-title-color:#2d2013;--siteselector-item-link-color:#005d92}pn-site-selector{display:flex;position:relative;justify-content:center;max-height:5.2rem}@media screen and (min-width: 75em){pn-site-selector{display:block}}.siteselector-heading{display:block;padding:0;margin-bottom:1.6rem;color:var(--siteselector-heading-color)}@media screen and (min-width: 75em){.siteselector-heading{display:flex;align-items:center;margin-top:0.8rem}}.siteselector-list{list-style:none;margin:0;padding:0}pn-site-selector[appearance=dark] button:hover pn-icon svg path{fill:#000000}";
const PnSiteSelectorStyle0 = pnSiteSelectorCss;

const PnSiteSelector = class {
    constructor(hostRef) {
        index.registerInstance(this, hostRef);
        this.buttontext = 'postnord';
        this.heading = 'PostNord';
        this.language = 'sv';
        this.appearance = 'light';
        this.i18n = { navlabel: 'Site selector' };
    }
    get hostElement() { return index.getElement(this); }
    componentWillLoad() {
        this.setLanguage();
    }
    setLanguage() {
        if (languageData[this.language]) {
            this.i18n = languageData[this.language];
        }
    }
    render() {
        return (index.h(index.Host, { key: '475423951cea0f0c5f79433c523a6badfdc9f75b' }, index.h("pn-button-dropdown", { key: 'ec59499056be6e43eb44174fca7e961814fd92b2', label: this.buttontext, icon: angle_small_down.angle_small_down, appearance: this.appearance, variant: "borderless", "aria-label": this.i18n.navlabel }, index.h("div", { key: '21530f0e90b86b8c61e3f7001d603a12eec154bb', class: "siteselector-nav" }, this.heading ? index.h("strong", { class: "siteselector-heading" }, this.heading) : null, index.h("div", { key: 'b3835279e816311acbc58c2e22ca252b0ea0f67c', role: "menu", class: "siteselector-list" }, index.h("slot", { key: '6cab81e8edcb474db69fa4d8be355368630dc2f7' }))))));
    }
};
PnSiteSelector.style = PnSiteSelectorStyle0;

const pnSiteSelectorItemCss = "pn-button-dropdown .pn-button-dropdown>pn-button>.pn-button{min-height:initial}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border-width:0}@media screen and (max-width: 767px){.sr-only-mobile{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border-width:0}}pn-site-selector-item{display:block}pn-site-selector-item>div,pn-site-selector-item>a{display:flex;flex-flow:column;position:relative;padding:0.8rem 0}.siteselector-item-link{border-radius:0;text-decoration:none;color:var(--siteselector-item-link-color, #005d92);flex-direction:row}.siteselector-item-link:hover,.siteselector-item-link:focus{background-color:var(--siteselector-hover-background-color, #f3f2f2);color:var(--siteselector-hover-text-color, #005d92);text-decoration:underline;outline:none;box-shadow:none}.siteselector-item-link:active{background-color:var(--siteselector-hover-background-color, #f3f2f2);color:var(--siteselector-active-text-color, #00a0d6);outline:none}.siteselector-item-link>span{flex-grow:1}.siteselector-item-link pn-icon{right:3.2rem;width:1.9rem;height:1.9rem;align-self:center}.siteselector-item-link pn-icon svg{width:100%;height:auto}.siteselector-item-title{display:block}.siteselector-item-title:not(.siteselector-item-link .siteselector-item-title){color:var(--siteselector-item-title-color, #2d2013)}.siteselector-item-description{color:var(--siteselector-description-color, #2d2013);font-size:1.28rem}a:hover>.siteselector-item-description,a:focus>.siteselector-item-description{background-color:var(--siteselector-hover-background-color, #f3f2f2);color:var(--siteselector-hover-text-color, #005d92);text-decoration:underline;outline:none}a:active>.siteselector-item-description{background-color:var(--siteselector-hover-background-color, #f3f2f2);color:var(--siteselector-active-text-color, #00a0d6);outline:none}";
const PnSiteSelectorItemStyle0 = pnSiteSelectorItemCss;

const PnSiteSelectorItem = class {
    constructor(hostRef) {
        index.registerInstance(this, hostRef);
        this.url = '';
        this.heading = '';
        this.description = '';
        this.newwindow = false;
    }
    render() {
        return (index.h(index.Host, { key: '3d40379b0f9568f2bdd7f15fdd017bc159c9b0d2', role: "menuitem" }, this.url ? (index.h("a", { class: "siteselector-item-link", href: this.url, target: this.newwindow ? '_blank' : 'self', rel: this.newwindow ? 'nofollow noopener' : '' }, index.h("span", null, this.heading && index.h("span", { class: "siteselector-item-title" }, this.heading), this.description && index.h("small", { class: "siteselector-item-description" }, this.description)), index.h("pn-icon", { icon: angle_small_right, color: "blue700" }))) : (index.h("div", null, this.heading && index.h("span", { class: "siteselector-item-title" }, this.heading), this.description && index.h("small", { class: "siteselector-item-description" }, this.description)))));
    }
};
PnSiteSelectorItem.style = PnSiteSelectorItemStyle0;

exports.pn_language_selector = PnlanguageSelector;
exports.pn_language_selector_option = PnlanguageSelectorOption;
exports.pn_mainnav = PnMainnav;
exports.pn_mainnav_level = PnMainnavLevel;
exports.pn_mainnav_link = PnMainnavLink;
exports.pn_mainnav_list = PnMainnavList;
exports.pn_marketweb_siteheader_login = PnMarketwebSiteheaderLogin;
exports.pn_marketweb_siteheader_login_links = PnMarketwebSiteheaderLoginLinks;
exports.pn_marketweb_siteheader_login_profileselection = PnMarketwebSiteheaderLoginProfileselection;
exports.pn_marketweb_siteheader_search = PnMarketwebSiteheaderSearch;
exports.pn_marketweb_siteheader_unified_login = PnMarketwebSiteheaderUnifiedLogin;
exports.pn_site_selector = PnSiteSelector;
exports.pn_site_selector_item = PnSiteSelectorItem;

//# sourceMappingURL=pn-language-selector_13.cjs.entry.js.map