import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
import { F as FetchHelper } from './FetchHelper.js';
import { M as MarketWebContextService } from './MarketWebContextService.js';
import { H as HeadingTag } from './HeadingTag.js';
import { d as defineCustomElement$4 } from './pn-site-footer2.js';
import { d as defineCustomElement$3 } from './pn-site-footer-col2.js';
import { d as defineCustomElement$2 } from './pn-swan2.js';

const getSocialMediaIconsByType = (linkType = '', fill = '#005D92') => {
    switch (linkType) {
        case 'facebook':
            return `<svg width="56" height="56" viewBox="0 0 56 56" fill="none" xmlns="http://www.w3.org/2000/svg">
          <circle cx="28" cy="28" r="28" fill="${fill}" />
          <path fill-rule="evenodd" clip-rule="evenodd" d="M38.6754 16H17.3246C16.593 16 16 16.5929 16 17.3246V38.6754C16 39.407 16.593 40 17.3246 40H28.8191V30.706H25.6915V27.0839H28.8191V24.4127C28.8191 21.3128 30.7124 19.6248 33.4778 19.6248C34.8023 19.6248 35.9409 19.7235 36.2726 19.7675V23.0071L34.3547 23.008C32.8507 23.008 32.5596 23.7226 32.5596 24.7713V27.0839H36.1463L35.6793 30.706H32.5596V40H38.6754C39.407 40 40 39.407 40 38.6754V17.3246C40 16.5929 39.407 16 38.6754 16Z" fill="white" />
      </svg>`;
        case 'twitter':
            return `<svg width="56" height="56" viewBox="0 0 56 56" fill="none" xmlns="http://www.w3.org/2000/svg">
              <circle cx="28" cy="28" r="28" fill="${fill}"/>
              <path d="M34.8996 17.5H38.5996L30.5996 26.4L39.9996 38.6H32.5996L26.7996 31.2L20.1996 38.6H16.4996L25.0996 29L16.0996 17.5H23.5996L28.7996 24.2L34.8996 17.5ZM33.5996 36.4H35.5996L22.4996 19.5H20.2996L33.5996 36.4Z" fill="white"/>
              </svg>`;
        case 'linkedin':
            return `<svg width="56" height="56" viewBox="0 0 56 56" fill="none" xmlns="http://www.w3.org/2000/svg">
          <circle cx="28" cy="28" r="28" fill="${fill}" />
          <path d="M37.5809 16H18.4191C17.0832 16 16 17.0747 16 18.399V37.601C16 38.9267 17.0832 40 18.4191 40H37.5809C38.9182 40 40 38.9253 40 37.601V18.399C40 17.0747 38.9182 16 37.5809 16ZM23.7013 34.9895H20.4725V24.7229H23.7013V34.9895ZM22.0653 23.4634C21.0462 23.4634 20.3874 22.7487 20.3874 21.8672C20.3874 20.965 21.0672 20.2711 22.1085 20.2711C23.1499 20.2711 23.7864 20.9636 23.8074 21.8672C23.8074 22.7501 23.1485 23.4634 22.0653 23.4634ZM35.4912 34.9895H32.2624V29.3002C32.2624 27.9772 31.7948 27.075 30.6264 27.075C29.7344 27.075 29.204 27.6834 28.9695 28.2711C28.8843 28.4808 28.8634 28.7746 28.8634 29.0685V34.9881H25.6332V27.9979C25.6332 26.7177 25.5913 25.6472 25.5481 24.7229H28.3525L28.5018 26.1507H28.566C28.9904 25.4789 30.0318 24.4925 31.7739 24.4925C33.8984 24.4925 35.4912 25.8996 35.4912 28.9222V34.9895Z" fill="white" />
      </svg>`;
        case 'instagram':
            return `<svg width="56" height="56" viewBox="0 0 56 56" fill="none" xmlns="http://www.w3.org/2000/svg">
          <circle cx="28" cy="28" r="28" fill="${fill}" />
          <path fill-rule="evenodd" clip-rule="evenodd" d="M27.9995 18.1621C31.2037 18.1621 31.5829 18.1745 32.8485 18.2321C34.0183 18.2854 34.6538 18.4807 35.0767 18.6451C35.6369 18.8628 36.0365 19.1228 36.4566 19.5425C36.8768 19.9626 37.1368 20.3623 37.354 20.9224C37.5184 21.3454 37.7137 21.9808 37.767 23.1507C37.8246 24.4158 37.837 24.7955 37.837 27.9998C37.837 31.204 37.8246 31.5832 37.767 32.8488C37.7137 34.0187 37.5184 34.6541 37.354 35.0771C37.1363 35.6373 36.8763 36.0369 36.4566 36.457C36.0365 36.8772 35.6369 37.1372 35.0767 37.3545C34.6538 37.5188 34.0183 37.7141 32.8485 37.7674C31.5834 37.8251 31.2037 37.8375 27.9995 37.8375C24.7953 37.8375 24.4157 37.8251 23.1506 37.7674C21.9807 37.7141 21.3453 37.5188 20.9223 37.3545C20.3622 37.1368 19.9625 36.8767 19.5424 36.457C19.1223 36.0369 18.8622 35.6373 18.645 35.0771C18.4807 34.6541 18.2854 34.0187 18.232 32.8488C18.1744 31.5837 18.162 31.204 18.162 27.9998C18.162 24.7955 18.1744 24.4163 18.232 23.1507C18.2854 21.9808 18.4807 21.3454 18.645 20.9224C18.8627 20.3623 19.1228 19.9626 19.5424 19.5425C19.9625 19.1224 20.3622 18.8623 20.9223 18.6451C21.3453 18.4807 21.9807 18.2854 23.1506 18.2321C24.4161 18.1745 24.7953 18.1621 27.9995 18.1621ZM27.9995 16C24.7405 16 24.3318 16.0138 23.052 16.0724C21.7749 16.1305 20.9028 16.3334 20.1392 16.6302C19.35 16.9369 18.6807 17.3471 18.0139 18.0144C17.347 18.6813 16.9365 19.3505 16.6302 20.1393C16.3334 20.9029 16.1305 21.7751 16.0724 23.0521C16.0138 24.332 16 24.7407 16 27.9998C16 31.2588 16.0138 31.6675 16.0724 32.9474C16.1305 34.2245 16.3334 35.0966 16.6302 35.8602C16.9369 36.6495 17.347 37.3187 18.0144 37.9856C18.6817 38.6529 19.3505 39.0631 20.1397 39.3698C20.9028 39.6666 21.7754 39.8695 23.0524 39.9276C24.3323 39.9862 24.741 40 28 40C31.259 40 31.6677 39.9862 32.9476 39.9276C34.2246 39.8695 35.0972 39.6666 35.8603 39.3698C36.6495 39.0631 37.3188 38.6529 37.9856 37.9856C38.653 37.3182 39.0631 36.6495 39.3698 35.8602C39.6666 35.0971 39.8695 34.2245 39.9276 32.9474C39.9862 31.6675 40 31.2588 40 27.9998C40 24.7407 39.9862 24.332 39.9276 23.0521C39.8695 21.7751 39.6666 20.9024 39.3698 20.1393C39.0631 19.35 38.653 18.6808 37.9856 18.0139C37.3183 17.3466 36.6495 16.9365 35.8603 16.6297C35.0963 16.3334 34.2241 16.1305 32.9471 16.0724C31.6672 16.0138 31.2585 16 27.9995 16ZM27.9996 21.8379C24.5963 21.8379 21.8379 24.5969 21.8379 27.9998C21.8379 31.4027 24.5968 34.1616 27.9996 34.1616C31.4025 34.1616 34.1613 31.4027 34.1613 27.9998C34.1613 24.5969 31.4029 21.8379 27.9996 21.8379ZM27.9996 31.9995C25.7904 31.9995 23.9999 30.2085 23.9999 27.9998C23.9999 25.7905 25.7909 24 27.9996 24C30.2083 24 31.9993 25.791 31.9993 27.9998C31.9993 30.209 30.2088 31.9995 27.9996 31.9995ZM35.845 21.594C35.845 22.3892 35.2003 23.0339 34.4051 23.0339C33.6098 23.0339 32.9651 22.3892 32.9651 21.594C32.9651 20.7987 33.6098 20.154 34.4051 20.154C35.2003 20.154 35.845 20.7987 35.845 21.594Z" fill="white" />
      </svg>`;
        case 'youtube':
            return `<svg width="56" height="56" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 56 56" style="enable-background:new 0 0 56 56;" xml:space="preserve">
        <circle fill="${fill}" cx="28" cy="28" r="28"></circle>
        <g transform="translate(9937 4831.656)">
          <path fill="#fff" d="M-9909-4793.8c0,0-2.2,0-4.7-0.1c-1.4,0-2.7-0.1-3.7-0.2c-1.3-0.1-2.1-0.2-2.6-0.3
            c-0.3-0.1-0.6-0.2-0.9-0.4c-0.3-0.2-0.5-0.3-0.7-0.6s-0.4-0.5-0.6-0.7c-0.2-0.3-0.3-0.6-0.4-0.9c-0.4-1.7-0.6-4-0.6-6.7
            c0-1.2,0.1-2.4,0.2-3.6c0.1-0.6,0.1-1.1,0.2-1.7c0.1-0.5,0.1-1.1,0.2-1.5c0.1-0.3,0.2-0.6,0.4-0.9c0.2-0.3,0.3-0.5,0.6-0.7
            s0.5-0.4,0.7-0.6c0.3-0.2,0.6-0.3,0.9-0.4c0.5-0.1,1.4-0.3,2.6-0.3c1-0.1,2.2-0.1,3.7-0.2c2.4-0.1,4.6-0.1,4.7-0.1
            c0,0,2.2,0,4.7,0.1c1.4,0,2.7,0.1,3.7,0.2c1.3,0.1,2.1,0.2,2.6,0.3c0.3,0.1,0.6,0.2,0.9,0.4c0.3,0.2,0.5,0.3,0.7,0.6
            s0.4,0.5,0.6,0.7c0.2,0.3,0.3,0.6,0.4,0.9c0.2,0.9,0.4,2,0.5,3.1c0.1,1.1,0.1,2.3,0.1,3.6c0,1.2-0.1,2.4-0.2,3.6
            c-0.1,0.6-0.1,1.1-0.2,1.7c-0.1,0.5-0.2,1.1-0.2,1.5c-0.1,0.3-0.2,0.6-0.4,0.9c-0.2,0.3-0.3,0.5-0.6,0.7c-0.2,0.2-0.5,0.4-0.7,0.6
            c-0.3,0.2-0.6,0.3-0.9,0.4c-0.5,0.1-1.4,0.3-2.6,0.3c-1,0.1-2.2,0.1-3.7,0.2C-9906.8-4793.8-9909-4793.8-9909-4793.8z
             M-9911.8-4807.9v8.4l7.3-4.2L-9911.8-4807.9z"></path>
        </g>
        </svg>`;
        default:
            return '';
    }
};

const translations = {
    sv: {
        searchlabel: 'Sök',
        searchplaceholder: 'Vad letar du efter?',
        searchbuttontext: 'Sök',
        menuHomeButton: 'Hem',
        menuGoBackButton: 'Gå tillbaka',
        mainMenuButton: 'Meny',
        menuStartButton: 'Start',
    },
    en: {
        searchlabel: 'Search',
        searchplaceholder: 'Search',
        searchbuttontext: 'Search',
        menuHomeButton: 'Home',
        menuGoBackButton: 'Go back',
        mainMenuButton: 'Menu',
        menuStartButton: 'Start',
    },
    da: {
        searchlabel: 'Søg',
        searchplaceholder: 'Søg',
        searchbuttontext: 'Søg',
        menuHomeButton: 'Hjem',
        menuGoBackButton: 'Gå tilbage',
        mainMenuButton: 'Menu',
        menuStartButton: 'Start',
    },
    no: {
        searchlabel: 'Søk',
        searchplaceholder: 'Søk',
        searchbuttontext: 'Søk',
        menuHomeButton: 'Hjem',
        menuGoBackButton: 'Gå tilbake',
        mainMenuButton: 'Meny',
        menuStartButton: 'Start',
    },
    fi: {
        searchlabel: 'Hae',
        searchplaceholder: 'Hae',
        searchbuttontext: 'Hae',
        menuHomeButton: 'Koti',
        menuGoBackButton: 'Mene takaisin',
        mainMenuButton: 'Valikko',
        menuStartButton: 'Alkaa',
    },
    zh: {
        searchlabel: 'Search',
        searchplaceholder: 'Search',
        searchbuttontext: 'Search',
        menuHomeButton: 'Home',
        menuGoBackButton: 'Go back',
        mainMenuButton: 'Menu',
        menuStartButton: 'Start',
    },
    it: {
        searchlabel: 'Search',
        searchplaceholder: 'Search',
        searchbuttontext: 'Search',
        menuHomeButton: 'Home',
        menuGoBackButton: 'Go back',
        mainMenuButton: 'Menu',
        menuStartButton: 'Start',
    },
    nl: {
        searchlabel: 'Search',
        searchplaceholder: 'Search',
        searchbuttontext: 'Search',
        menuHomeButton: 'Home',
        menuGoBackButton: 'Go back',
        mainMenuButton: 'Menu',
        menuStartButton: 'Start',
    },
};

const pnMarketwebSitefooterCss = "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-marketweb-sitefooter .social-media a[target=_blank]:not(.pn-button):after{content:none}@media screen and (min-width: 60em){pn-marketweb-sitefooter:not([theme=dotcom]) pn-site-footer-col:has(div[slot=bottomsocialmediadesktop]){display:flex;align-content:flex-start;align-items:flex-start;flex-direction:column;flex-wrap:wrap;min-width:min-content}pn-marketweb-sitefooter:not([theme=dotcom]) pn-site-footer-col:has(div[slot=bottomsocialmediadesktop]) div[slot=bottomsocialmediadesktop]{display:block;margin-top:auto;margin-bottom:1.6rem}pn-marketweb-sitefooter:not([theme=dotcom]) pn-site-footer-col:has(div[slot=bottomsocialmediadesktop]) div[slot=bottomsocialmediadesktop] .trustpilot-widget{display:flex;justify-content:flex-start}}pn-marketweb-sitefooter:not([theme=dotcom]) [slot=bottomsocialmediamobile]{display:block;margin-top:1rem;margin-bottom:2.3rem}pn-marketweb-sitefooter:not([theme=dotcom]) [slot=bottomsocialmediamobile] .trustpilot-widget{display:flex;justify-content:center}@media screen and (min-width: 33.125em){pn-marketweb-sitefooter:not([theme=dotcom]) [slot=bottomsocialmediamobile] .trustpilot-widget{justify-content:flex-start}}@media screen and (min-width: 60em){pn-marketweb-sitefooter:not([theme=dotcom]) [slot=bottomsocialmediamobile]{display:none}}div[slot=middle-extra-mobile],div[slot=middle-extra]{display:none}pn-marketweb-sitefooter[theme=dotcom]{width:100%}pn-marketweb-sitefooter[theme=dotcom] div[slot=bottomsocialmediamobile],pn-marketweb-sitefooter[theme=dotcom] div[slot=bottomsocialmediadesktop]{display:none}pn-marketweb-sitefooter[theme=dotcom] div[slot=middle-extra-mobile]{display:block;width:100%;text-align:-webkit-center;margin:2.4rem 0}@media screen and (min-width: 1024px){pn-marketweb-sitefooter[theme=dotcom] div[slot=middle-extra-mobile]{display:none}pn-marketweb-sitefooter[theme=dotcom] div[slot=middle-extra]{display:block;width:100%;text-align:-webkit-center;margin:3.2rem 0}}pn-marketweb-sitefooter[theme=dotcom] div[slot=bottom] .social-media.social-media--swan{display:flex;flex-direction:column;align-items:center}@media screen and (min-width: 768px){pn-marketweb-sitefooter[theme=dotcom] div[slot=bottom] .social-media.social-media--swan{flex-direction:row}}pn-marketweb-sitefooter[theme=dotcom] div[slot=bottom] .social-media.social-media--swan ul{margin-bottom:1.6rem}@media screen and (min-width: 768px){pn-marketweb-sitefooter[theme=dotcom] div[slot=bottom] .social-media.social-media--swan ul{margin-bottom:0;margin-right:4.8rem}}pn-marketweb-sitefooter[theme=dotcom] div[slot=bottom] .social-media.social-media--swan .swan-wrapper{display:flex;flex-direction:column;width:100%}@media screen and (min-width: 768px){pn-marketweb-sitefooter[theme=dotcom] div[slot=bottom] .social-media.social-media--swan .swan-wrapper{width:auto;flex-direction:row}}pn-marketweb-sitefooter[theme=dotcom] div[slot=bottom] .social-media.social-media--swan .swan-wrapper .separator{border-top:1px solid #d3cecb;margin-bottom:1.6rem}@media screen and (min-width: 768px){pn-marketweb-sitefooter[theme=dotcom] div[slot=bottom] .social-media.social-media--swan .swan-wrapper .separator{display:flex;width:1px;height:auto;min-height:90%;background-color:#d3cecb;margin-right:4.8rem;margin-bottom:0}}pn-marketweb-sitefooter[theme=dotcom] div[slot=bottom] .social-media.social-media--swan .swan-wrapper .swan{justify-self:center;align-self:center}pn-marketweb-sitefooter[theme=dotcom][backgroundcolor=bluedarkest] pn-site-footer[theme=dotcom] pn-site-footer-col[theme=dotcom] svg path{fill:#ffffff}pn-marketweb-sitefooter[theme=dotcom][backgroundcolor=bluedarkest] pn-site-footer[theme=dotcom] pn-swan *{color:white}pn-marketweb-sitefooter[theme=dotcom][backgroundcolor=blue] pn-site-footer[theme=dotcom]{background-color:#005d92}pn-marketweb-sitefooter[theme=dotcom][backgroundcolor=blue] pn-site-footer[theme=dotcom] .pn-sitefooter-top,pn-marketweb-sitefooter[theme=dotcom][backgroundcolor=blue] pn-site-footer[theme=dotcom] .pn-sitefooter-bottom{background-color:#005d92}pn-marketweb-sitefooter[theme=dotcom][backgroundcolor=blue] pn-site-footer[theme=dotcom]>svg path{fill:#005d92}pn-marketweb-sitefooter[theme=dotcom][backgroundcolor=blue] pn-site-footer[theme=dotcom] .pn-sitefooter-bottom .social-media{border-top:0.1rem solid #d3cecb;border-bottom:0.1rem solid #d3cecb}pn-marketweb-sitefooter[theme=dotcom][backgroundcolor=blue] pn-site-footer[theme=dotcom] .pn-sitefooter-bottom .social-media>ul>li:hover svg>circle{fill:#8eddf9}pn-marketweb-sitefooter[theme=dotcom][backgroundcolor=blue] pn-site-footer[theme=dotcom] pn-site-footer-col[theme=dotcom] svg path{fill:#ffffff}pn-marketweb-sitefooter[theme=dotcom][backgroundcolor=blue] pn-site-footer[theme=dotcom] pn-swan *{color:white}pn-marketweb-sitefooter[theme=dotcom][backgroundcolor=gray] pn-site-footer[theme=dotcom]{background-color:#f3f2f2}pn-marketweb-sitefooter[theme=dotcom][backgroundcolor=gray] pn-site-footer[theme=dotcom]>svg path{fill:#f3f2f2}pn-marketweb-sitefooter[theme=dotcom][backgroundcolor=gray] pn-site-footer[theme=dotcom] .pn-sitefooter-top,pn-marketweb-sitefooter[theme=dotcom][backgroundcolor=gray] pn-site-footer[theme=dotcom] .pn-sitefooter-bottom{background-color:#f3f2f2}pn-marketweb-sitefooter[theme=dotcom][backgroundcolor=gray] pn-site-footer[theme=dotcom] .pn-sitefooter-bottom .social-media{border-top:0.1rem solid #d3cecb;border-bottom:0.1rem solid #d3cecb}pn-marketweb-sitefooter[theme=dotcom][backgroundcolor=gray] pn-site-footer[theme=dotcom] .pn-sitefooter-bottom .social-media li svg circle{fill:#005d92}pn-marketweb-sitefooter[theme=dotcom][backgroundcolor=gray] pn-site-footer[theme=dotcom] .pn-sitefooter-bottom .social-media li svg:hover>circle{fill:#00a0d6}pn-marketweb-sitefooter[theme=dotcom][backgroundcolor=gray] pn-site-footer[theme=dotcom] .pn-sitefooter-bottom>[slot=bottom]>.copyright *{color:#005d92}pn-marketweb-sitefooter[theme=dotcom][backgroundcolor=gray] pn-site-footer[theme=dotcom] pn-site-footer-col[theme=dotcom] *{color:#0d234b}pn-marketweb-sitefooter[theme=dotcom][backgroundcolor=gray] pn-site-footer[theme=dotcom] pn-site-footer-col[theme=dotcom] svg path{fill:#0d234b}pn-marketweb-sitefooter[theme=dotcom][backgroundcolor=gray] pn-site-footer[theme=dotcom] pn-site-footer-col[theme=dotcom] a:not(.pn-h2){color:#005d92}pn-marketweb-sitefooter[theme=tpl] pn-site-footer{background-color:#0d234b;padding-top:6rem}@media screen and (max-width: 33.125em){pn-marketweb-sitefooter[theme=tpl] pn-site-footer{padding-left:2.6rem;padding-right:2.6rem}}pn-marketweb-sitefooter[theme=tpl] pn-site-footer>svg{display:none}pn-marketweb-sitefooter[theme=tpl] div.pn-sitefooter-bottom{background-color:#0d234b;color:#ffffff;margin:2.5rem 0}pn-marketweb-sitefooter[theme=tpl] div.pn-sitefooter-bottom div[slot=bottom]{border-top:1px solid #005d92;border-bottom:1px solid #005d92}pn-marketweb-sitefooter[theme=tpl] div.pn-sitefooter-bottom a{color:#ffffff}pn-marketweb-sitefooter[theme=tpl] div.pn-sitefooter-bottom a:hover{text-decoration:underline;color:#ffffff}pn-marketweb-sitefooter[theme=tpl] .pn-sitefooter-top,pn-marketweb-sitefooter[theme=tpl] .pn-sitefooter-logo{background-color:#0d234b;color:#ffffff}pn-marketweb-sitefooter[theme=tpl] .pn-sitefooter-top a,pn-marketweb-sitefooter[theme=tpl] .pn-sitefooter-logo a{color:#fbc2c1}pn-marketweb-sitefooter[theme=tpl] .pn-sitefooter-top a:hover,pn-marketweb-sitefooter[theme=tpl] .pn-sitefooter-logo a:hover{text-decoration:underline;color:#fbc2c1}@media screen and (max-width: 60em){pn-marketweb-sitefooter[theme=tpl] .pn-sitefooter-top .pn-sitefooter-cols{padding:0 8rem}}@media screen and (max-width: 60em){pn-marketweb-sitefooter[theme=tpl] .pn-sitefooter-top .pn-sitefooter-cols{padding:0 5rem}}@media screen and (max-width: 48em){pn-marketweb-sitefooter[theme=tpl] .pn-sitefooter-top .pn-sitefooter-cols{padding:0 3rem}}@media screen and (min-width: 33.125em){pn-marketweb-sitefooter[theme=tpl] .pn-sitefooter-top .pn-sitefooter-cols{width:114rem;justify-content:space-between}}pn-marketweb-sitefooter[theme=tpl] div.pn-sitefooter-logo a svg path{fill:#00a0d6}@media screen and (min-width: 33.125em){pn-marketweb-sitefooter[theme=tpl] div pn-site-footer-col{width:unset;min-width:unset}pn-marketweb-sitefooter[theme=tpl] div pn-site-footer-col:first-child{min-width:45%}}@media screen and (max-width: 60em){pn-marketweb-sitefooter[theme=tpl] div pn-site-footer-col:first-child{min-width:100%;padding-top:0}}pn-marketweb-sitefooter[theme=tpl] div pn-site-footer-col a{display:inline-flex;gap:0.7rem;align-items:flex-start}pn-marketweb-sitefooter[theme=tpl] div pn-site-footer-col a .pn-h2{color:#ffffff}pn-marketweb-sitefooter[theme=tpl] div pn-site-footer-col a span.footer-tpl-links{display:none}pn-marketweb-sitefooter[theme=tpl] div pn-site-footer-col a:hover{text-decoration:underline;color:#fbc2c1}pn-marketweb-sitefooter[theme=tpl] div pn-site-footer-col a pn-icon svg{background-color:#fbc2c1;border-radius:0.3rem;height:1.7rem;width:1.7rem;margin-top:0.3rem}pn-marketweb-sitefooter[theme=tpl] div pn-site-footer-col a pn-icon svg path{fill:#0d234b}pn-marketweb-sitefooter[theme=tpl] div pn-site-footer-col .pn-h2{margin-bottom:3.5rem}pn-marketweb-sitefooter[theme=tpl] div pn-site-footer-col ul.social-media{flex-direction:column;gap:0.5rem;row-gap:0rem}pn-marketweb-sitefooter[theme=tpl] div pn-site-footer-col ul.social-media li{max-height:4rem}pn-marketweb-sitefooter[theme=tpl] div pn-site-footer-col ul.social-media a{align-items:center;gap:0}pn-marketweb-sitefooter[theme=tpl] div pn-site-footer-col ul.social-media a circle{display:none}pn-marketweb-sitefooter[theme=tpl] div pn-site-footer-col ul.social-media a span.footer-tpl-links{display:block}pn-marketweb-sitefooter[theme=tpl] div pn-site-footer-col ul.social-media a svg{height:3.7rem;width:3.7rem}pn-marketweb-sitefooter[theme=tpl] div pn-site-footer-col ul.social-media a svg path{fill:#fbc2c1}";
const PnMarketwebSitefooterStyle0 = pnMarketwebSitefooterCss;

const PnMarketwebSiteheader = /*@__PURE__*/ proxyCustomElement(class PnMarketwebSiteheader extends HTMLElement {
    constructor() {
        super();
        this.__registerHost();
        this.market = 'se';
        this.language = 'sv';
        this.environment = null;
        this.endpoint = null;
        this.siteDomainInUrls = false;
        this.cache = false;
        this.theme = 'default';
        this.backgroundcolor = 'darkestblue';
        this.showSwan = false;
        this.headingLevel = "h2";
        this.siteDefinition = undefined;
        this.footerContent = undefined;
        this.i18n = undefined;
        this.gotData = false;
        this.fetchingData = false;
    }
    get hostElement() { return this; }
    fetchHelper = new FetchHelper('sitefooter');
    endpointPath = '/api/footer/footer';
    componentWillLoad() {
        this.setInitialValues().then(() => {
            this.init();
        });
    }
    async setInitialValues(href = window.location.href) {
        const marketWebContextService = new MarketWebContextService(href);
        if (!this.market) {
            const resolvedMarket = await marketWebContextService.getMarket();
            this.market = resolvedMarket;
        }
        if (!this.language) {
            const resolvedMarket = await marketWebContextService.getLanguage();
            this.language = resolvedMarket;
        }
        if (!this.environment) {
            this.environment = await marketWebContextService.getEnvironmentName();
        }
        if (!this.endpoint && this.environment?.indexOf('local') === -1) {
            this.endpoint = await marketWebContextService.getEndpoint(this.environment, this.market);
        }
        if (!this.endpoint) {
            this.endpoint = '';
        }
    }
    async init() {
        this.setTranslations();
        await this.fetchData();
    }
    setTranslations() {
        if (this.language && translations[this.language]) {
            this.i18n = translations[this.language];
        }
    }
    onLanguageChange() {
        this.setTranslations();
        this.fetchData();
    }
    onMarketChange() {
        this.fetchData();
    }
    setFetchUrl(endpointBase) {
        switch (this.theme) {
            case 'dotcom':
                return `${endpointBase}${this.endpointPath}?market=${this.market}&language=${this.language}&breakOutSocialMedia=true&extendColumns=true`;
            default:
                return `${endpointBase}${this.endpointPath}?market=${this.market}&language=${this.language}`;
        }
    }
    async fetchData() {
        if (this.endpoint === null || !this.market || !this.language) {
            // console.warn(`One or more values where not specified.\nEndpoint: ${this.endpoint}\nMarket: ${this.market}\nLanguage: ${this.language}`)
            return;
        }
        this.fetchingData = true;
        const endpointBase = this.endpoint.lastIndexOf('/') === this.endpoint.length - 1 ? this.endpoint.substring(0, this.endpoint.length - 1) : this.endpoint;
        const fetchUrl = this.setFetchUrl(endpointBase);
        const data = (await this.fetchHelper.fetchJson(fetchUrl, {
            mode: 'cors',
        }, this.cache, this.onFetchRefreshed.bind(this)));
        await this.setStateFromData(data);
    }
    onFetchRefreshed(data) {
        this.setStateFromData(data);
    }
    setStateFromData(data) {
        if (typeof data !== 'object') {
            console.warn('Data was not valid', data);
        }
        this.siteDefinition = data.sitedefinition;
        this.footerContent = data.footer;
        if (this.siteDomainInUrls) {
            this.adjustLinks();
        }
        this.gotData = true;
        this.fetchingData = true;
    }
    adjustLinks() {
        this.footerContent.bottomLinks.forEach(link => {
            link.linkHref = this.adjustHref(link.linkHref);
        });
        this.footerContent.columns.forEach(col => {
            col.links.forEach(link => {
                link.linkHref = this.adjustHref(link.linkHref);
            });
        });
    }
    adjustHref(href) {
        if (!href || href.indexOf('http') === 0 || this.siteDomainInUrls) {
            return href;
        }
        const domainUrl = this.siteDefinition.url.lastIndexOf('/') === this.siteDefinition.url.length - 1
            ? this.siteDefinition.url.substring(0, this.siteDefinition.url.length - 1)
            : this.siteDefinition.url;
        href = domainUrl + href;
        return href;
    }
    uniqueId(text) {
        return 'footer-' + text.replace(/[^A-Za-z0-9.\\\/]/gim, '');
    }
    renderCols() {
        if (this.gotData && this.footerContent?.columns) {
            return this.footerContent.columns.map(column => {
                return (h("pn-site-footer-col", { theme: this.theme }, column.firstLinkAsHeader && column.links && column.links[0] ? (h("a", { href: column.links[0].linkHref, target: column.links[0].openInNewWindow ? '_blank' : null, rel: column.links[0].openInNewWindow ? 'noopener nofollower noreferrer' : null, title: column.links[0].linkText, id: this.uniqueId(column.links[0].linkText) }, h(HeadingTag, { level: this.headingLevel, cssClass: `${"pn-" + this.headingLevel}` }, column.links[0].linkText))) : (h(HeadingTag, { level: this.headingLevel, cssClass: `${"pn-" + this.headingLevel}` }, column.heading)), column.links && (!column.body || this.theme === 'tpl') ? (h("ul", { ...(column.links && column.links[0] && column.links[0].linkType && { class: 'social-media' }) }, column.links.map((link, i) => {
                    if (!link.linkHref || (column.firstLinkAsHeader && i == 0)) {
                        return false;
                    }
                    let linkText = link.linkText;
                    if (link.linkType) {
                        linkText = getSocialMediaIconsByType(link.linkType);
                    }
                    let linkId = this.uniqueId(linkText);
                    return (h("li", null, h("a", { href: link.linkHref, ...(link.openInNewWindow && { target: '_blank' }), title: link.linkText, innerHTML: linkText, id: linkId }, this.theme === 'tpl' ? h("span", { class: "footer-tpl-links" }, link.linkText) : null)));
                }))) : null, column.body ? h("div", { innerHTML: column.body }) : null, h("slot", { name: "bottomsocialmediadesktop" }), h("slot", { name: "bottomsocialmediamobile" })));
            });
        }
        else {
            return null;
        }
    }
    renderBottomLinks() {
        return this.footerContent.bottomLinks.map(link => {
            if (!link.linkHref) {
                return h("li", null, link.linkText);
            }
            let linkId = this.uniqueId(link.linkText);
            return (h("li", null, h("a", { href: link.linkHref, ...(link.openInNewWindow && { target: '_blank' }), title: link.linkText, id: linkId }, link.linkText)));
        });
    }
    renderDefaultFooter() {
        return (h(Host, { language: this.language, market: this.market, environment: this.environment }, h("pn-site-footer", { url: this.siteDefinition?.url ?? '' }, h("slot", { name: "logo" }), this.renderCols(), h("div", { slot: "bottom" }, this.gotData && this.footerContent?.copyrightText ? h("span", null, this.footerContent.copyrightText) : null, this.gotData && this.footerContent?.bottomLinks ? (h("span", null, this.footerContent.bottomLinks.map(link => {
            if (!link.linkHref) {
                return h("span", null, link.linkText);
            }
            let linkId = this.uniqueId(link.linkText);
            return (h("a", { href: link.linkHref, ...(link.openInNewWindow && { target: '_blank' }), title: link.linkText, id: linkId }, link.linkText));
        }))) : null))));
    }
    renderSocialMeidaIconListElements() {
        return (this.gotData &&
            this.footerContent?.socialmedialinks.map(link => {
                let linkText = getSocialMediaIconsByType(link.linkType, '#00A0D6');
                let linkId = this.uniqueId(link.linkText);
                return (h("li", null, h("a", { href: link.linkHref, ...(link.openInNewWindow && { target: '_blank' }), title: link.linkText, innerHTML: linkText, id: linkId })));
            }));
    }
    renderSwanComponent() {
        return (this.showSwan && (h("div", { class: "swan-wrapper" }, h("div", { class: "separator" }), h("pn-swan", { language: this.language, "license-number": this.footerContent?.swanInfo?.swanLicense, "link-to": this.footerContent?.swanInfo?.swanLink }))));
    }
    renderDotComFooter() {
        return (h(Host, { language: this.language, market: this.market, environment: this.environment }, h("pn-site-footer", { theme: this.theme, url: this.siteDefinition?.url ?? '' }, this.renderCols(), h("slot", { name: "middle-extra" }), h("slot", { name: "middle-extra-mobile" }), h("div", { slot: "bottom" }, h("div", { class: `social-media ${this.showSwan ? 'social-media--swan' : ''}` }, h("ul", null, this.renderSocialMeidaIconListElements()), this.renderSwanComponent()), h("div", { class: "copyright" }, this.gotData && this.footerContent?.copyrightText ? h("span", null, this.footerContent.copyrightText) : null, this.gotData && this.footerContent?.bottomLinks ? h("ul", null, this.renderBottomLinks()) : null)))));
    }
    render() {
        switch (this.theme) {
            case 'dotcom':
                return this.renderDotComFooter();
            default:
                return this.renderDefaultFooter();
        }
    }
    static get watchers() { return {
        "language": ["onLanguageChange"],
        "market": ["onMarketChange"]
    }; }
    static get style() { return PnMarketwebSitefooterStyle0; }
}, [4, "pn-marketweb-sitefooter", {
        "market": [1537],
        "language": [1537],
        "environment": [1537],
        "endpoint": [1],
        "siteDomainInUrls": [4, "site-domain-in-urls"],
        "cache": [4],
        "theme": [513],
        "backgroundcolor": [513],
        "showSwan": [4, "show-swan"],
        "headingLevel": [1, "heading-level"],
        "siteDefinition": [32],
        "footerContent": [32],
        "i18n": [32],
        "gotData": [32],
        "fetchingData": [32]
    }, undefined, {
        "language": ["onLanguageChange"],
        "market": ["onMarketChange"]
    }]);
function defineCustomElement$1() {
    if (typeof customElements === "undefined") {
        return;
    }
    const components = ["pn-marketweb-sitefooter", "pn-site-footer", "pn-site-footer-col", "pn-swan"];
    components.forEach(tagName => { switch (tagName) {
        case "pn-marketweb-sitefooter":
            if (!customElements.get(tagName)) {
                customElements.define(tagName, PnMarketwebSiteheader);
            }
            break;
        case "pn-site-footer":
            if (!customElements.get(tagName)) {
                defineCustomElement$4();
            }
            break;
        case "pn-site-footer-col":
            if (!customElements.get(tagName)) {
                defineCustomElement$3();
            }
            break;
        case "pn-swan":
            if (!customElements.get(tagName)) {
                defineCustomElement$2();
            }
            break;
    } });
}

const PnMarketwebSitefooter = PnMarketwebSiteheader;
const defineCustomElement = defineCustomElement$1;

export { PnMarketwebSitefooter, defineCustomElement };

//# sourceMappingURL=pn-marketweb-sitefooter.js.map