@postnord/web-components
Version:
PostNord Web Components
186 lines (180 loc) • 6.98 kB
JavaScript
/*!
* Built with Stencil
* By PostNord.
*/
import { r as registerInstance, g as getElement, h, a as Host } from './index-C247oTEA.js';
import { o as open_in_new } from './open_in_new-IFVOY5Gf.js';
import { awaitTopbar, SE, en, NO } from './index.js';
const URLS = {
SE: {
domain: {
sv: 'https://www.postnord.se',
en: 'https://www.postnord.se/en',
},
contact: {
sv: 'https://www.postnord.se/kundservice',
en: 'https://www.postnord.se/en/help-and-support/contact-us',
},
cookies: {
sv: 'https://www.postnord.se/cookies',
en: 'https://www.postnord.se/en/cookies',
},
privacy: {
sv: 'https://www.postnord.se/integritetspolicy',
en: 'https://www.postnord.se/en/privacy-policy',
},
terms: {
sv: 'https://www.postnord.se/siteassets/pdf/villkor/anvandarvillkor-postnord-konto.pdf',
en: 'https://www.postnord.se/siteassets/pdf/villkor/anvandarvillkor-postnord-konto.pdf',
},
},
DK: {
domain: {
da: 'https://www.postnord.dk',
en: 'https://www.postnord.com/en',
},
contact: {
da: 'https://www.postnord.dk/kundeservice',
en: 'https://www.postnord.dk/en/help-and-support',
},
cookies: {
da: 'https://www.postnord.dk/cookies',
en: 'https://www.postnord.dk/en/cookies',
},
privacy: {
da: 'https://www.postnord.dk/personlige-oplysninger',
en: 'https://www.postnord.se/en/privacy-policy',
},
terms: {
da: 'https://www.postnord.dk/contentassets/4806069a7d6c44959c94b13417d78f22/kundeportalen.pdf',
en: 'https://www.postnord.dk/kundeservice/kundeservice-erhverv/forretningsbetingelser',
},
},
FI: {
domain: {
fi: 'https://www.postnord.fi',
sv: 'https://www.postnord.fi/sv',
en: 'https://www.postnord.fi/en',
},
contact: {
fi: 'https://www.postnord.fi/asiakaspalvelu/ota-yhteytta',
sv: 'https://www.postnord.fi/sv/kundtjanst',
en: 'https://www.postnord.fi/en/customer-service',
},
cookies: {
fi: 'https://www.postnord.fi/yksityisyydensuoja/tietoa-evasteista',
sv: 'https://www.postnord.fi/sv/integritetspolicy/information-om-cookies',
en: 'https://www.postnord.fi/en/privacy-policy/information-about-the-cookies',
},
privacy: {
fi: 'https://www.postnord.fi/yksityisyydensuoja',
sv: 'https://www.postnord.fi/sv/integritetspolicy',
en: 'https://www.postnord.se/en/privacy-policy',
},
terms: {
fi: 'https://www.postnord.fi/laheta/sopimusehdot',
sv: 'https://www.postnord.fi/sv/skicka/villkor',
en: 'https://www.postnord.fi/en/sending/terms',
},
},
NO: {
domain: {
no: 'https://www.postnord.no',
en: 'https://www.postnord.no/en',
},
contact: {
no: 'https://www.postnord.no/kundeservice',
en: 'https://www.postnord.no/en/contact-postnord',
},
cookies: {
no: 'https://www.postnord.no/cookies',
en: 'https://www.postnord.no/en/cookies',
},
privacy: {
no: 'https://www.postnord.no/personvernerklaering',
en: 'https://www.postnord.se/en/privacy-policy',
},
},
contact: 'https://portal.postnord.com/customerservice',
};
const translations = {
cookies: {
sv: 'Cookies',
en: 'Cookies',
da: 'Cookies',
fi: 'Evästeet',
no: 'Cookies',
},
questions: {
sv: 'Undrar du över något?',
en: 'Do you have any questions?',
da: 'Har du nogen spørgsmål?',
fi: 'Onko sinulla kysyttävää?',
no: 'Har du noen spørsmål?',
},
contact: {
sv: 'Kontakta oss',
en: 'Get in touch',
da: 'Kontakt os',
fi: 'Ota yhteyttä',
no: 'Ta kontakt',
},
info: {
sv: 'Mer information om PostNord hittar du på',
en: 'More information about PostNord can be found at',
da: 'Mere information om PostNord findes på',
fi: 'Lisää tietoa PostNordista löydät osoitteesta',
no: 'Du finner mer informasjon om PostNord på',
},
privacy: {
sv: 'Integritetspolicy',
en: 'Privacy policy',
da: 'Integritetspolitik',
fi: 'Yksityisyysasetukset',
no: 'Privacy policy',
},
terms: {
sv: 'Villkor',
en: 'Terms and conditions',
da: 'Vilkår og betingelser',
fi: 'Sopimusehdot',
no: 'Betingelser og vilkår',
},
};
const pnFooterCss = "pn-footer{color:#5e554a;padding-bottom:2em;display:block}pn-footer .pn-footer-row{padding:0.2em 0;font-size:0.9em;text-align:center}pn-footer .pn-footer-row p{margin:0 0.2em 0 0;display:inline-block}pn-footer pn-text-link{margin-right:0.5em}pn-footer pn-text-link:last-child{margin-right:0}";
const PnFooter = class {
constructor(hostRef) {
registerInstance(this, hostRef);
}
get hostElement() { return getElement(this); }
/** Set the market for the footer. */
market = null;
/** Set the language for the footer. */
language = null;
async componentWillLoad() {
if (this.market && this.language)
return;
await awaitTopbar(this.hostElement);
}
getLink(name) {
return URLS?.[this.market || SE]?.[name]?.[this.language || en];
}
getText(name) {
if (name === 'domain')
return this.getLink(name)?.replace('https://www.', '');
return translations?.[name]?.[this.language];
}
renderLink(name) {
const url = this.getLink(name);
const text = this.getText(name);
if (url && text) {
return h("pn-text-link", { label: text, target: "_blank", rel: "noopener noreferrer", href: url, icon: open_in_new });
}
}
render() {
return (h(Host, { key: '883eb215c98d26c3997c46f2ef736c811f6cf4c8' }, h("div", { key: '25a6ca34523403258c177248387e72862508bf8e', class: "pn-footer-row" }, h("p", { key: '6eb54f95486695feae0d62184d6d0e07256f86c7' }, this.getText('questions')), this.renderLink('contact')), h("div", { key: '831d77c2804a7df873e337ee330a7af31925a6b8', class: "pn-footer-row" }, this.market !== NO && this.renderLink('terms'), this.renderLink('privacy'), this.renderLink('cookies')), h("div", { key: 'e22e504ac2d545766e4363b7a2e9f8f25d115aab', class: "pn-footer-row" }, h("p", { key: 'a3224e7b7d1ff351e9179348b1c9699c76b038ca' }, this.getText('info')), this.renderLink('domain'))));
}
};
PnFooter.style = pnFooterCss;
export { PnFooter as pn_footer };
//# sourceMappingURL=pn-footer.entry.js.map