1import{r as t,E as o,x as e,i as r,_ as i,t as s}from"./custom-element-f942355b.js";import{n}from"./property-98bc03ee.js";import{r as a}from"./http.service-da101c73.js";import{a as f,o as d}from"./unsafe-html-37d7591c.js";import{f as l}from"./button-f774dca2.js";import"./cookie-info-modal-eed41c52.js";import{m as g}from"./main-5f540a2f.js";import{u as h,l as c}from"./localized-decorator-954945dd.js";import"./directive-de55b00a.js";import"./shared-styles-32c8a7b9.js";import"./login-btn-styles-9493d048.js";import"./traversal.helper-0bd2d65c.js";let m=class extends t{constructor(){super(),this.showFooterLogo=!0,this.footerSettings=void 0,this.frontSettings=null,this.openCookieModal=()=>{window.dispatchEvent(new CustomEvent("open-cookie-info-modal"))},this.addEventListeners(),h(this)}async connectedCallback(){super.connectedCallback(),await this.loadFrontSettings()}async loadFrontSettings(){this.frontSettings=await l.getSettings(),this.requestUpdate()}async addEventListeners(){window.addEventListener("dialogue-ready",(async t=>{const o=t.detail.styles;this.footerSettings=o.footerSettings,this.requestUpdate()}))}render(){if(!this.shouldRenderFooter())return o;const t=this.footerSettings?.footerMarkdown,r=this.frontSettings?.footer,i=this.frontSettings?.footerLogoUrl,s=this.footerSettings?.footerLogoSettings?.footerLogoBase64String,n=this.footerSettings?.footerLogoSettings?.footerLogoUrl||this.frontSettings?.footerLogoLinkUrl,a=this.footerSettings?.footerLogoSettings?.footerLogoAltText||this.frontSettings?.footerLogoAltText,l=this.footerSettings?this.footerSettings.showFooterLogo&&(s||i):!!i,g=s||i,h=(this.footerSettings?.footerTextPosition||this.frontSettings?.footerTextPosition||"Center").toLowerCase(),c=(this.footerSettings?.footerLogoPosition||"Right").toLowerCase(),m="left"===h?0:"center"===h?1:2,p="left"===c?0:"center"===c?1:2;let x="";return t?x=f(t):r&&(x=f(r)),e`<div id="footer"><div class="footer-grid" data-text-pos="${m}" data-logo-pos="${p}">${0===m?e`<div class="footer-text text-${h}">${d(x)}</div>`:0===p&&l?this.renderFooterLogo(g,n,a):e`<div></div>`} ${1===m?e`<div class="footer-text text-${h}">${d(x)}</div>`:1===p&&l?this.renderFooterLogo(g,n,a):e`<div></div>`} ${2===m?e`<div class="footer-text text-${h}">${d(x)}</div>`:2===p&&l?this.renderFooterLogo(g,n,a):e`<div></div>`}</div><div class="footer-links">${this.renderCookieLink()}</div></div>`}renderFooterLogo(t,r,i){return t?e`<div class="footer-logo"><a href="${r||"#"}" target="_blank" rel="noopener"><img class="footer-logo-img" src="${t}" alt="${i||"Footer Logo"}" title="${i||"Footer Logo"}"></a></div>`:o}renderSeperator(){return this.shouldRenderCookieLink()&&this.footerSettings?.showPrivacyLink?e`<span class="seperator">|</span>`:o}renderCookieLink(){return this.shouldRenderCookieLink()?e`<cookie-info-modal></cookie-info-modal><ia-link href="#" @click="${this.openCookieModal}">${g("Les om bruken av informasjonskapsler")}</ia-link>`:o}renderPrivacyLink(){return this.footerSettings?.showPrivacyLink?e`<ia-link href="#" target="_blank">${g("Les personvernerklæring")}</ia-link>`:o}shouldRenderFooter(){return this.showCookieLink||this.footerSettings?.showPageFooter}shouldRenderCookieLink(){return this.showCookieLink||this.footerSettings?.showCookieLink}static{this.styles=r`:host{font-size:var(--ia-font-size);background-color:var(--ia-footer-background-color,#fff)}#footer{padding:1rem;background-color:var(--ia-footer-background-color,#f8f8f8);min-height:3rem}.footer-grid{display:grid;grid-template-columns:1fr 1fr 1fr;gap:1rem;padding:1rem 0;align-items:start;grid-auto-flow:dense}.footer-grid[data-logo-pos="1"]{grid-template-columns:1fr auto 1fr}.footer-grid[data-text-pos="0"]:not([data-logo-pos="1"]){grid-template-columns:2fr 1fr 1fr}.footer-grid[data-text-pos="1"]:not([data-logo-pos="1"]){grid-template-columns:1fr 2fr 1fr}.footer-grid[data-text-pos="2"]:not([data-logo-pos="1"]){grid-template-columns:1fr 1fr 2fr}.footer-text{min-width:0;word-wrap:break-word;overflow-wrap:break-word}.footer-text.text-left,.footer-text.text-right{justify-self:start;text-align:left}.footer-text.text-center{justify-self:center;text-align:center}.footer-text>*{margin:.5rem 0}.footer-text>:first-child{margin-top:0}.footer-text>:last-child{margin-bottom:0}.footer-text a{color:var(--ia-primary-color);text-decoration:underline;cursor:pointer}.footer-text a:hover{text-decoration:none}.footer-text img{max-width:100%;height:auto;display:block}.footer-text.text-left img,.footer-text.text-right img{margin-left:0!important;margin-right:auto!important}.footer-text.text-center img{margin-left:auto!important;margin-right:auto!important}.footer-text.text-left p,.footer-text.text-right p{text-align:left}.footer-text.text-center p{text-align:center}.footer-logo{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;min-width:0;flex-shrink:0}.footer-logo-img{max-height:5rem;max-width:100%;width:auto;height:auto;object-fit:contain}.footer-links{padding:1rem 0;text-align:center}@media (max-width:768px){#footer{padding:1rem}.footer-grid{grid-template-columns:1fr!important;gap:1rem}.footer-text.text-center,.footer-text.text-left,.footer-text.text-right{justify-self:start;text-align:left}}`}};i([n({type:Boolean,attribute:"show-cookie-link"})],m.prototype,"showCookieLink",void 0),i([n({type:Boolean,attribute:"show-footer-logo"})],m.prototype,"showFooterLogo",void 0),i([a()],m.prototype,"frontSettings",void 0),m=i([c(),s("ia-footer")],m);export{m as Footer};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.