@postnord/pn-marketweb-components 4.6.0 → 4.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/cjs/pn-language-selector_13.cjs.entry.js +6 -5
  2. package/cjs/pn-language-selector_13.cjs.entry.js.map +1 -1
  3. package/cjs/pn-marketweb-siteheader-login-button_2.cjs.entry.js +3 -5
  4. package/cjs/pn-marketweb-siteheader-login-button_2.cjs.entry.js.map +1 -1
  5. package/cjs/transfer-3cf2ea0d.js +8 -0
  6. package/cjs/transfer-3cf2ea0d.js.map +1 -0
  7. package/collection/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-linklist.css +0 -3
  8. package/collection/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-profileselection.css +13 -27
  9. package/collection/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-profileselection.js +4 -4
  10. package/collection/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-profileselection.js.map +1 -1
  11. package/collection/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login.css +0 -7
  12. package/components/pn-marketweb-siteheader-login-linklist2.js +2 -2
  13. package/components/pn-marketweb-siteheader-login-linklist2.js.map +1 -1
  14. package/components/pn-marketweb-siteheader-login-profileselection2.js +5 -5
  15. package/components/pn-marketweb-siteheader-login-profileselection2.js.map +1 -1
  16. package/components/pn-marketweb-siteheader-login2.js +1 -1
  17. package/components/pn-marketweb-siteheader-login2.js.map +1 -1
  18. package/esm/pn-language-selector_13.entry.js +6 -5
  19. package/esm/pn-language-selector_13.entry.js.map +1 -1
  20. package/esm/pn-marketweb-siteheader-login-button_2.entry.js +2 -4
  21. package/esm/pn-marketweb-siteheader-login-button_2.entry.js.map +1 -1
  22. package/esm/transfer-a5986b65.js +6 -0
  23. package/esm/transfer-a5986b65.js.map +1 -0
  24. package/package.json +1 -1
  25. package/pn-market-web-components/p-a89eaf58.entry.js +2 -0
  26. package/pn-market-web-components/p-a89eaf58.entry.js.map +1 -0
  27. package/pn-market-web-components/p-d3a44504.entry.js +2 -0
  28. package/pn-market-web-components/p-d3a44504.entry.js.map +1 -0
  29. package/pn-market-web-components/p-e36420d7.js +2 -0
  30. package/pn-market-web-components/p-e36420d7.js.map +1 -0
  31. package/pn-market-web-components/pn-market-web-components.esm.js +1 -1
  32. package/pn-market-web-components/p-c668f68a.entry.js +0 -2
  33. package/pn-market-web-components/p-c668f68a.entry.js.map +0 -1
  34. package/pn-market-web-components/p-da4863ad.entry.js +0 -2
  35. package/pn-market-web-components/p-da4863ad.entry.js.map +0 -1
@@ -5,11 +5,9 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  const index = require('./index-9a9efa1c.js');
6
6
  const pnMarketwebSiteheaderStore = require('./pn-marketweb-siteheader-store-7548aafe.js');
7
7
  const arrow_right = require('./arrow_right-66958158.js');
8
+ const transfer = require('./transfer-3cf2ea0d.js');
8
9
  require('./index-a8de2b09.js');
9
10
 
10
- 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="M21.78 11.375a1 1 0 0 1 0 1.25l-4 5a1 1 0 1 1-1.56-1.25L18.92 13H7a1 1 0 1 1 0-2h11.92l-2.7-3.375a1 1 0 1 1 1.56-1.25zM11 3a3 3 0 0 1 3 3v2a1 1 0 1 1-2 0V6a1 1 0 0 0-1-1H5a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1v-2a1 1 0 1 1 2 0v2a3 3 0 0 1-3 3H5a3 3 0 0 1-3-3V6a3 3 0 0 1 3-3z" clip-rule="evenodd"/></svg>';
11
- const transfer = icon;
12
-
13
11
  const getLoginUrl = (useMarketwebLogin, environment) => {
14
12
  const environment_Production = "PRODUCTION";
15
13
  const devAuthUrl = 'https://atportal.postnord.com/api/unified-login/backend/authorization?redirectionUrl=';
@@ -51,7 +49,7 @@ const PnMarketwebSiteheaderLoginButton = class {
51
49
  };
52
50
  PnMarketwebSiteheaderLoginButton.style = PnMarketwebSiteheaderLoginButtonStyle0;
53
51
 
54
- const pnMarketwebSiteheaderLoginLinklistCss = "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-linklist{--login-linklist-heading-color:var(--siteheader-login-linklist-heading-color, inherit);--login-linklist-link-color:var(--siteheader-login-linklist-link-color, #005d92);--login-linklist-link-hover-color:var(--siteheader-login-linklist-link-hover-color, #0d234b);--login-linklist-button-link-color:var(--siteheader-login-linklist-button-link-color, #ffffff);--login-linklist-icon-color:var(--siteheader-login-linklist-icon-color, #005d92);--login-linklist-icon-hover-color:var(--siteheader-login-linklist-icon-hover-color, #0d234b)}pn-marketweb-siteheader-login-linklist{display:flex;flex-direction:column}.pn-marketweb-siteheader-login-linklist-heading{font-weight:500;font-size:1.6rem;margin-bottom:2.4rem;color:var(--login-linklist-heading-color)}pn-marketweb-siteheader-login-linklist strong{margin-bottom:2.4rem}pn-marketweb-siteheader-login-linklist ul{list-style-type:none;padding:0;margin:0}pn-marketweb-siteheader-login-linklist ul>li{margin-bottom:2.4rem}pn-marketweb-siteheader-login-linklist ul>li:last-of-type{margin-bottom:0}pn-marketweb-siteheader-login-linklist ul>li a{text-decoration:none;font-size:1.6rem;line-height:1.5;font-weight:500}pn-marketweb-siteheader-login-linklist ul>li a:hover{color:var(--login-linklist-button-link-color)}pn-marketweb-siteheader-login-linklist ul>li a:not(.pn-button){color:var(--login-linklist-link-color)}pn-marketweb-siteheader-login-linklist ul>li:hover a:not(.pn-button){color:var(--login-linklist-link-hover-color);text-decoration:underline}pn-marketweb-siteheader-login-linklist ul>li pn-icon{padding-left:0.8rem}pn-marketweb-siteheader-login-linklist ul>li pn-icon svg>path{fill:var(--login-linklist-icon-color) !important}pn-marketweb-siteheader-login-linklist ul>li:hover pn-icon svg>path{fill:var(--login-linklist-icon-hover-color) !important}";
52
+ const pnMarketwebSiteheaderLoginLinklistCss = "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-linklist{--login-linklist-heading-color:var(--siteheader-login-linklist-heading-color, inherit);--login-linklist-link-color:var(--siteheader-login-linklist-link-color, #005d92);--login-linklist-link-hover-color:var(--siteheader-login-linklist-link-hover-color, #0d234b);--login-linklist-button-link-color:var(--siteheader-login-linklist-button-link-color, #ffffff);--login-linklist-icon-color:var(--siteheader-login-linklist-icon-color, #005d92);--login-linklist-icon-hover-color:var(--siteheader-login-linklist-icon-hover-color, #0d234b)}pn-marketweb-siteheader-login-linklist{display:flex;flex-direction:column}.pn-marketweb-siteheader-login-linklist-heading{font-weight:500;font-size:1.6rem;margin-bottom:2.4rem;color:var(--login-linklist-heading-color)}pn-marketweb-siteheader-login-linklist strong{margin-bottom:2.4rem}pn-marketweb-siteheader-login-linklist ul{list-style-type:none;padding:0;margin:0}pn-marketweb-siteheader-login-linklist ul>li{margin-bottom:2.4rem}pn-marketweb-siteheader-login-linklist ul>li a{text-decoration:none;font-size:1.6rem;line-height:1.5;font-weight:500}pn-marketweb-siteheader-login-linklist ul>li a:hover{color:var(--login-linklist-button-link-color)}pn-marketweb-siteheader-login-linklist ul>li a:not(.pn-button){color:var(--login-linklist-link-color)}pn-marketweb-siteheader-login-linklist ul>li:hover a:not(.pn-button){color:var(--login-linklist-link-hover-color);text-decoration:underline}pn-marketweb-siteheader-login-linklist ul>li pn-icon{padding-left:0.8rem}pn-marketweb-siteheader-login-linklist ul>li pn-icon svg>path{fill:var(--login-linklist-icon-color) !important}pn-marketweb-siteheader-login-linklist ul>li:hover pn-icon svg>path{fill:var(--login-linklist-icon-hover-color) !important}";
55
53
  const PnMarketwebSiteheaderLoginLinklistStyle0 = pnMarketwebSiteheaderLoginLinklistCss;
56
54
 
57
55
  const PnMarketwebSiteheaderLoginLinklist = class {
@@ -113,7 +111,7 @@ const PnMarketwebSiteheaderLoginLinklist = class {
113
111
  if (link.isLogoutLink) {
114
112
  pnMarketwebSiteheaderStore.state.loginManager.clearUserData();
115
113
  }
116
- } }, link.linkText, link.isLogoutLink ? index.h("pn-icon", { icon: transfer }) : index.h("pn-icon", { icon: arrow_right.arrow_right }))));
114
+ } }, link.linkText, link.isLogoutLink ? index.h("pn-icon", { icon: transfer.transfer }) : index.h("pn-icon", { icon: arrow_right.arrow_right }))));
117
115
  }
118
116
  render() {
119
117
  if (!this.links || this.links.length === 0) {
@@ -1 +1 @@
1
- {"file":"pn-marketweb-siteheader-login-button.pn-marketweb-siteheader-login-linklist.entry.cjs.js","mappings":";;;;;;;;;AAAA,MAAM,IAAI,GAAG,gcAAgc,CAAC;AACvc,MAAM,QAAQ,GAAG,IAAI;;ACDrB,MAAM,WAAW,GAAG,CAAC,iBAAyB,EAAE,WAAkB;IAEzE,MAAM,sBAAsB,GAAG,YAAY,CAAC;IAE5C,MAAM,UAAU,GAAG,uFAAuF,CAAC;IAC3G,MAAM,WAAW,GAAG,qFAAqF,CAAC;IAC1G,MAAM,iBAAiB,GAAG,mBAAmB,CAAC;IAE9C,IAAG,iBAAiB,EAClB;QACE,OAAO,iBAAiB,CAAC;KAC1B;SACK,IAAI,WAAW,CAAC,WAAW,EAAE,KAAK,sBAAsB,EAAE;QAC5D,OAAO,UAAU,CAAC;KACnB;SAAM;QACH,OA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AAY,GAAGA,qBAAS,IAAI,EAAEE,uBAAW,GAAY,CAC/F,CACD,EACL;KACH;IAED,MAAM;QACJ,IAAI,CAAC,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE;YAC1C,OAAO;SACR;QACD,QACEF,QAACC,UAAI,QACF,IAAI,CAAC,OAAO,GAAGD,eAAG,KAAK,EAAC,gDAAgD,IAAE,IAAI,CAAC,OAAO,CAAK,GAAG,IAAI,EACnGA,oBACG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI;YAClB;gBACE,OAAO,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,CAAC;aAC9F;SACF,CAAC,CACC,CACA,EACP;KACH;;;;;;;","names":["h","Host","arrow_right","headerState"],"sources":["node_modules/pn-design-assets/pn-assets/icons/transfer.js","src/components/layout-components/pn-marketweb-siteheader/unifiedLoginHelper.ts","src/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-button.scss?tag=pn-marketweb-siteheader-login-button","src/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-button.tsx","src/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-linklist.scss?tag=pn-marketweb-siteheader-login-linklist","src/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-linklist.tsx"],"sourcesContent":["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=\"M21.78 11.375a1 1 0 0 1 0 1.25l-4 5a1 1 0 1 1-1.56-1.25L18.92 13H7a1 1 0 1 1 0-2h11.92l-2.7-3.375a1 1 0 1 1 1.56-1.25zM11 3a3 3 0 0 1 3 3v2a1 1 0 1 1-2 0V6a1 1 0 0 0-1-1H5a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1v-2a1 1 0 1 1 2 0v2a3 3 0 0 1-3 3H5a3 3 0 0 1-3-3V6a3 3 0 0 1 3-3z\" clip-rule=\"evenodd\"/></svg>';\nexport const transfer = icon;\n","export const getLoginUrl = (useMarketwebLogin:boolean, environment:string) => {\n\nconst environment_Production = \"PRODUCTION\";\n\nconst devAuthUrl = 'https://atportal.postnord.com/api/unified-login/backend/authorization?redirectionUrl=';\nconst prodAuthUrl = 'https://portal.postnord.com/api/unified-login/backend/authorization?redirectionUrl=';\nconst marketwebLoginUrl = '/login?returnUrl=';\n\nif(useMarketwebLogin)\n {\n return marketwebLoginUrl;\n }\n else if (environment.toUpperCase() !== environment_Production) {\n return devAuthUrl;\n } else {\n return prodAuthUrl;\n } \n };\n","pn-marketweb-siteheader-login-button {\n}\n","import { Component, Element, h, Host, Prop } from '@stencil/core';\n\nimport { getLoginUrl } from './unifiedLoginHelper';\n\n@Component({\n tag: 'pn-marketweb-siteheader-login-button',\n styleUrl: 'pn-marketweb-siteheader-login-button.scss',\n})\nexport class PnMarketwebSiteheaderLoginButton {\n @Element() hostElement: HTMLElement;\n @Prop() label: string = 'Log in';\n @Prop() useMarketwebLogin: boolean = false;\n @Prop() environment: string = 'local';\n \n loginUrl: string;\n\n componentWillLoad() {\n this.loginUrl = getLoginUrl(this.useMarketwebLogin, this.environment);\n }\n\n nagivateToLoginUrl() {\n const navigationUrl = `${this.loginUrl}${encodeURIComponent(window.location.href)}`;\n return navigationUrl;\n }\n\n render() {\n return (\n <Host>\n <pn-button href={this.nagivateToLoginUrl()}>{this.label}</pn-button>\n </Host>\n );\n }\n}\n","@import '../../../globals/main.scss';\n@import './pn-marketweb-siteheader-common.scss';\n\n// -----------------------------------------------------------------------------\n// Internal layout / visual constants (SCSS only)\n// -----------------------------------------------------------------------------\n$login-linklist-heading-font-weight: 500;\n$login-linklist-heading-font-size: 1.6rem;\n$login-linklist-heading-margin-bottom: 2.4rem;\n\n$login-linklist-strong-margin-bottom: 2.4rem;\n\n$login-linklist-list-item-margin-bottom: 2.4rem;\n\n$login-linklist-link-font-size: 1.6rem;\n$login-linklist-link-line-height: 1.5;\n$login-linklist-link-font-weight: 500;\n\n$login-linklist-icon-padding-left: 0.8rem;\n\n// -----------------------------------------------------------------------------\n// Component token defaults (CSS vars - only real override surface)\n// -----------------------------------------------------------------------------\npn-marketweb-siteheader-login-linklist {\n --login-linklist-heading-color: var(--siteheader-login-linklist-heading-color, inherit);\n\n --login-linklist-link-color: var(--siteheader-login-linklist-link-color, #{$blue700});\n --login-linklist-link-hover-color: var(--siteheader-login-linklist-link-hover-color, #{$blue900});\n\n --login-linklist-button-link-color: var(--siteheader-login-linklist-button-link-color, #{$white});\n\n --login-linklist-icon-color: var(--siteheader-login-linklist-icon-color, #{$blue700});\n --login-linklist-icon-hover-color: var(--siteheader-login-linklist-icon-hover-color, #{$blue900});\n}\n\n// -----------------------------------------------------------------------------\n// Host shell / layout\n// -----------------------------------------------------------------------------\npn-marketweb-siteheader-login-linklist {\n display: flex;\n flex-direction: column;\n}\n\n// -----------------------------------------------------------------------------\n// Heading\n// -----------------------------------------------------------------------------\n.pn-marketweb-siteheader-login-linklist-heading {\n font-weight: $login-linklist-heading-font-weight;\n font-size: $login-linklist-heading-font-size;\n margin-bottom: $login-linklist-heading-margin-bottom;\n color: var(--login-linklist-heading-color);\n}\n\npn-marketweb-siteheader-login-linklist strong {\n margin-bottom: $login-linklist-strong-margin-bottom;\n}\n\n// -----------------------------------------------------------------------------\n// List structure\n// -----------------------------------------------------------------------------\npn-marketweb-siteheader-login-linklist ul {\n list-style-type: none;\n padding: 0;\n margin: 0;\n}\n\npn-marketweb-siteheader-login-linklist ul>li {\n margin-bottom: $login-linklist-list-item-margin-bottom;\n\n &:last-of-type {\n margin-bottom: 0;\n }\n}\n\n// -----------------------------------------------------------------------------\n// Links\n// -----------------------------------------------------------------------------\npn-marketweb-siteheader-login-linklist ul>li a {\n text-decoration: none;\n font-size: $login-linklist-link-font-size;\n line-height: $login-linklist-link-line-height;\n font-weight: $login-linklist-link-font-weight;\n\n &:hover {\n color:var(--login-linklist-button-link-color);\n }\n}\n\npn-marketweb-siteheader-login-linklist ul>li a:not(.pn-button) {\n color: var(--login-linklist-link-color);\n}\n\npn-marketweb-siteheader-login-linklist ul>li:hover a:not(.pn-button) {\n color: var(--login-linklist-link-hover-color);\n text-decoration: underline;\n}\n\n// -----------------------------------------------------------------------------\n// Icons\n// -----------------------------------------------------------------------------\npn-marketweb-siteheader-login-linklist ul>li pn-icon {\n padding-left: $login-linklist-icon-padding-left;\n\n svg>path {\n fill: var(--login-linklist-icon-color) !important;\n }\n}\n\npn-marketweb-siteheader-login-linklist ul>li:hover pn-icon {\n svg>path {\n fill: var(--login-linklist-icon-hover-color) !important;\n }\n}","import { Component, Element, h, Host, Prop } from '@stencil/core';\n\nimport { state as headerState } from './pn-marketweb-siteheader-store';\nimport { LoginDialogLink } from './pn-marketweb-siteheader-types';\nimport { arrow_right, transfer } from 'pn-design-assets/pn-assets/icons.js';\n\n@Component({\n tag: 'pn-marketweb-siteheader-login-linklist',\n styleUrl: 'pn-marketweb-siteheader-login-linklist.scss',\n})\nexport class PnMarketwebSiteheaderLoginLinklist {\n @Element() hostElement: HTMLElement;\n\n @Prop() heading: string = null;\n @Prop() links: LoginDialogLink[] = [];\n @Prop() idNamespace: string = '';\n @Prop() showUnifiedLogin: boolean = false;\n\n componentWillLoad() {}\n\n uniqueId(text: string) {\n return 'loginlink-' + text.replace(/[^A-Za-z0-9.\\\\\\/]/gim, '') + '-' + this.idNamespace;\n }\n\n linkAppearanceAttributes(link) {\n let attributes = {};\n if (link.linkType) {\n switch (link.linkType) {\n case 'primary':\n attributes = {\n appearance: '',\n variant: '',\n };\n break;\n case 'secondary':\n attributes = {\n appearance: 'light',\n variant: 'outlined',\n };\n break;\n case 'regularlink':\n default:\n attributes = {\n appearance: 'light',\n variant: 'borderless',\n icon: arrow_right,\n };\n break;\n }\n return attributes;\n }\n if (!link.linkType) {\n attributes = {\n appearance: link.primaryLinkApperance ? 'dark' : 'light',\n };\n }\n return attributes;\n }\n\n renderListAsButtons(link) {\n return (\n <li>\n <pn-button\n href={link.href}\n id={this.uniqueId(link.linkText)}\n {...(link.openInNewWindow && { target: '_blank' })}\n {...this.linkAppearanceAttributes(link)}\n onClick={() => {\n if (link.isLogoutLink) {\n headerState.loginManager.clearUserData();\n }\n }}\n >\n {link.linkText}\n </pn-button>\n </li>\n );\n }\n\n renderListAsLinks(link) {\n return (\n <li>\n <a\n href={link.href}\n id={this.uniqueId(link.linkText)}\n {...(link.openInNewWindow && { target: '_blank' })}\n onClick={() => {\n if (link.isLogoutLink) {\n headerState.loginManager.clearUserData();\n }\n }}\n >\n {link.linkText}\n {link.isLogoutLink ? <pn-icon icon={transfer}></pn-icon> : <pn-icon icon={arrow_right}></pn-icon>}\n </a>\n </li>\n );\n }\n\n render() {\n if (!this.links || this.links.length === 0) {\n return;\n }\n return (\n <Host>\n {this.heading ? <p class=\"pn-marketweb-siteheader-login-linklist-heading\">{this.heading}</p> : null}\n <ul>\n {this.links.map(link => {\n {\n return this.showUnifiedLogin ? this.renderListAsLinks(link) : this.renderListAsButtons(link);\n }\n })}\n </ul>\n </Host>\n );\n }\n}\n"],"version":3}
1
+ {"file":"pn-marketweb-siteheader-login-button.pn-marketweb-siteheader-login-linklist.entry.cjs.js","mappings":";;;;;;;;;;AAAO,MAAM,WAAW,GAAG,CAAC,iBAAyB,EAAE,WAAkB;IAEzE,MAAM,sBAAsB,GAAG,YAAY,CAAC;IAE5C,MAAM,UAAU,GAAG,uFAAuF,CAAC;IAC3G,MAAM,WAAW,GAAG,qFAAqF,CAAC;IAC1G,MAAM,iBAAiB,GAAG,mBAAmB,CAAC;IAE9C,IAAG,iBAAiB,EAClB;QACE,OAAO,iBAAiB,CAAC;KAC1B;SACK,IAAI,WAAW,CAAC,WAAW,EAAE,KAAK,sBAAsB,EAAE;QAC5D,OAAO,UAA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AAS,IAAI,EAAEI,iBAAQ,GAAY,GAAGJ,qBAAS,IAAI,EAAEE,uBAAW,GAAY,CAC/F,CACD,EACL;KACH;IAED,MAAM;QACJ,IAAI,CAAC,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE;YAC1C,OAAO;SACR;QACD,QACEF,QAACC,UAAI,QACF,IAAI,CAAC,OAAO,GAAGD,eAAG,KAAK,EAAC,gDAAgD,IAAE,IAAI,CAAC,OAAO,CAAK,GAAG,IAAI,EACnGA,oBACG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI;YAClB;gBACE,OAAO,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,CAAC;aAC9F;SACF,CAAC,CACC,CACA,EACP;KACH;;;;;;;","names":["h","Host","arrow_right","headerState","transfer"],"sources":["src/components/layout-components/pn-marketweb-siteheader/unifiedLoginHelper.ts","src/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-button.scss?tag=pn-marketweb-siteheader-login-button","src/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-button.tsx","src/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-linklist.scss?tag=pn-marketweb-siteheader-login-linklist","src/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-linklist.tsx"],"sourcesContent":["export const getLoginUrl = (useMarketwebLogin:boolean, environment:string) => {\n\nconst environment_Production = \"PRODUCTION\";\n\nconst devAuthUrl = 'https://atportal.postnord.com/api/unified-login/backend/authorization?redirectionUrl=';\nconst prodAuthUrl = 'https://portal.postnord.com/api/unified-login/backend/authorization?redirectionUrl=';\nconst marketwebLoginUrl = '/login?returnUrl=';\n\nif(useMarketwebLogin)\n {\n return marketwebLoginUrl;\n }\n else if (environment.toUpperCase() !== environment_Production) {\n return devAuthUrl;\n } else {\n return prodAuthUrl;\n } \n };\n","pn-marketweb-siteheader-login-button {\n}\n","import { Component, Element, h, Host, Prop } from '@stencil/core';\n\nimport { getLoginUrl } from './unifiedLoginHelper';\n\n@Component({\n tag: 'pn-marketweb-siteheader-login-button',\n styleUrl: 'pn-marketweb-siteheader-login-button.scss',\n})\nexport class PnMarketwebSiteheaderLoginButton {\n @Element() hostElement: HTMLElement;\n @Prop() label: string = 'Log in';\n @Prop() useMarketwebLogin: boolean = false;\n @Prop() environment: string = 'local';\n \n loginUrl: string;\n\n componentWillLoad() {\n this.loginUrl = getLoginUrl(this.useMarketwebLogin, this.environment);\n }\n\n nagivateToLoginUrl() {\n const navigationUrl = `${this.loginUrl}${encodeURIComponent(window.location.href)}`;\n return navigationUrl;\n }\n\n render() {\n return (\n <Host>\n <pn-button href={this.nagivateToLoginUrl()}>{this.label}</pn-button>\n </Host>\n );\n }\n}\n","@import '../../../globals/main.scss';\n@import './pn-marketweb-siteheader-common.scss';\n\n// -----------------------------------------------------------------------------\n// Internal layout / visual constants (SCSS only)\n// -----------------------------------------------------------------------------\n$login-linklist-heading-font-weight: 500;\n$login-linklist-heading-font-size: 1.6rem;\n$login-linklist-heading-margin-bottom: 2.4rem;\n\n$login-linklist-strong-margin-bottom: 2.4rem;\n\n$login-linklist-list-item-margin-bottom: 2.4rem;\n\n$login-linklist-link-font-size: 1.6rem;\n$login-linklist-link-line-height: 1.5;\n$login-linklist-link-font-weight: 500;\n\n$login-linklist-icon-padding-left: 0.8rem;\n\n// -----------------------------------------------------------------------------\n// Component token defaults (CSS vars - only real override surface)\n// -----------------------------------------------------------------------------\npn-marketweb-siteheader-login-linklist {\n --login-linklist-heading-color: var(--siteheader-login-linklist-heading-color, inherit);\n\n --login-linklist-link-color: var(--siteheader-login-linklist-link-color, #{$blue700});\n --login-linklist-link-hover-color: var(--siteheader-login-linklist-link-hover-color, #{$blue900});\n\n --login-linklist-button-link-color: var(--siteheader-login-linklist-button-link-color, #{$white});\n\n --login-linklist-icon-color: var(--siteheader-login-linklist-icon-color, #{$blue700});\n --login-linklist-icon-hover-color: var(--siteheader-login-linklist-icon-hover-color, #{$blue900});\n}\n\n// -----------------------------------------------------------------------------\n// Host shell / layout\n// -----------------------------------------------------------------------------\npn-marketweb-siteheader-login-linklist {\n display: flex;\n flex-direction: column;\n}\n\n// -----------------------------------------------------------------------------\n// Heading\n// -----------------------------------------------------------------------------\n.pn-marketweb-siteheader-login-linklist-heading {\n font-weight: $login-linklist-heading-font-weight;\n font-size: $login-linklist-heading-font-size;\n margin-bottom: $login-linklist-heading-margin-bottom;\n color: var(--login-linklist-heading-color);\n}\n\npn-marketweb-siteheader-login-linklist strong {\n margin-bottom: $login-linklist-strong-margin-bottom;\n}\n\n// -----------------------------------------------------------------------------\n// List structure\n// -----------------------------------------------------------------------------\npn-marketweb-siteheader-login-linklist ul {\n list-style-type: none;\n padding: 0;\n margin: 0;\n}\n\npn-marketweb-siteheader-login-linklist ul>li {\n margin-bottom: $login-linklist-list-item-margin-bottom;\n}\n\n// -----------------------------------------------------------------------------\n// Links\n// -----------------------------------------------------------------------------\npn-marketweb-siteheader-login-linklist ul>li a {\n text-decoration: none;\n font-size: $login-linklist-link-font-size;\n line-height: $login-linklist-link-line-height;\n font-weight: $login-linklist-link-font-weight;\n\n &:hover {\n color:var(--login-linklist-button-link-color);\n }\n}\n\npn-marketweb-siteheader-login-linklist ul>li a:not(.pn-button) {\n color: var(--login-linklist-link-color);\n}\n\npn-marketweb-siteheader-login-linklist ul>li:hover a:not(.pn-button) {\n color: var(--login-linklist-link-hover-color);\n text-decoration: underline;\n}\n\n// -----------------------------------------------------------------------------\n// Icons\n// -----------------------------------------------------------------------------\npn-marketweb-siteheader-login-linklist ul>li pn-icon {\n padding-left: $login-linklist-icon-padding-left;\n\n svg>path {\n fill: var(--login-linklist-icon-color) !important;\n }\n}\n\npn-marketweb-siteheader-login-linklist ul>li:hover pn-icon {\n svg>path {\n fill: var(--login-linklist-icon-hover-color) !important;\n }\n}","import { Component, Element, h, Host, Prop } from '@stencil/core';\n\nimport { state as headerState } from './pn-marketweb-siteheader-store';\nimport { LoginDialogLink } from './pn-marketweb-siteheader-types';\nimport { arrow_right, transfer } from 'pn-design-assets/pn-assets/icons.js';\n\n@Component({\n tag: 'pn-marketweb-siteheader-login-linklist',\n styleUrl: 'pn-marketweb-siteheader-login-linklist.scss',\n})\nexport class PnMarketwebSiteheaderLoginLinklist {\n @Element() hostElement: HTMLElement;\n\n @Prop() heading: string = null;\n @Prop() links: LoginDialogLink[] = [];\n @Prop() idNamespace: string = '';\n @Prop() showUnifiedLogin: boolean = false;\n\n componentWillLoad() {}\n\n uniqueId(text: string) {\n return 'loginlink-' + text.replace(/[^A-Za-z0-9.\\\\\\/]/gim, '') + '-' + this.idNamespace;\n }\n\n linkAppearanceAttributes(link) {\n let attributes = {};\n if (link.linkType) {\n switch (link.linkType) {\n case 'primary':\n attributes = {\n appearance: '',\n variant: '',\n };\n break;\n case 'secondary':\n attributes = {\n appearance: 'light',\n variant: 'outlined',\n };\n break;\n case 'regularlink':\n default:\n attributes = {\n appearance: 'light',\n variant: 'borderless',\n icon: arrow_right,\n };\n break;\n }\n return attributes;\n }\n if (!link.linkType) {\n attributes = {\n appearance: link.primaryLinkApperance ? 'dark' : 'light',\n };\n }\n return attributes;\n }\n\n renderListAsButtons(link) {\n return (\n <li>\n <pn-button\n href={link.href}\n id={this.uniqueId(link.linkText)}\n {...(link.openInNewWindow && { target: '_blank' })}\n {...this.linkAppearanceAttributes(link)}\n onClick={() => {\n if (link.isLogoutLink) {\n headerState.loginManager.clearUserData();\n }\n }}\n >\n {link.linkText}\n </pn-button>\n </li>\n );\n }\n\n renderListAsLinks(link) {\n return (\n <li>\n <a\n href={link.href}\n id={this.uniqueId(link.linkText)}\n {...(link.openInNewWindow && { target: '_blank' })}\n onClick={() => {\n if (link.isLogoutLink) {\n headerState.loginManager.clearUserData();\n }\n }}\n >\n {link.linkText}\n {link.isLogoutLink ? <pn-icon icon={transfer}></pn-icon> : <pn-icon icon={arrow_right}></pn-icon>}\n </a>\n </li>\n );\n }\n\n render() {\n if (!this.links || this.links.length === 0) {\n return;\n }\n return (\n <Host>\n {this.heading ? <p class=\"pn-marketweb-siteheader-login-linklist-heading\">{this.heading}</p> : null}\n <ul>\n {this.links.map(link => {\n {\n return this.showUnifiedLogin ? this.renderListAsLinks(link) : this.renderListAsButtons(link);\n }\n })}\n </ul>\n </Host>\n );\n }\n}\n"],"version":3}
@@ -0,0 +1,8 @@
1
+ 'use strict';
2
+
3
+ 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="M21.78 11.375a1 1 0 0 1 0 1.25l-4 5a1 1 0 1 1-1.56-1.25L18.92 13H7a1 1 0 1 1 0-2h11.92l-2.7-3.375a1 1 0 1 1 1.56-1.25zM11 3a3 3 0 0 1 3 3v2a1 1 0 1 1-2 0V6a1 1 0 0 0-1-1H5a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1v-2a1 1 0 1 1 2 0v2a3 3 0 0 1-3 3H5a3 3 0 0 1-3-3V6a3 3 0 0 1 3-3z" clip-rule="evenodd"/></svg>';
4
+ const transfer = icon;
5
+
6
+ exports.transfer = transfer;
7
+
8
+ //# sourceMappingURL=transfer-3cf2ea0d.js.map
@@ -0,0 +1 @@
1
+ {"file":"transfer-3cf2ea0d.js","mappings":";;AAAA,MAAM,IAAI,GAAG,gcAAgc,CAAC;AAClc,MAAC,QAAQ,GAAG;;;;","names":[],"sources":["node_modules/pn-design-assets/pn-assets/icons/transfer.js"],"sourcesContent":["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=\"M21.78 11.375a1 1 0 0 1 0 1.25l-4 5a1 1 0 1 1-1.56-1.25L18.92 13H7a1 1 0 1 1 0-2h11.92l-2.7-3.375a1 1 0 1 1 1.56-1.25zM11 3a3 3 0 0 1 3 3v2a1 1 0 1 1-2 0V6a1 1 0 0 0-1-1H5a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1v-2a1 1 0 1 1 2 0v2a3 3 0 0 1-3 3H5a3 3 0 0 1-3-3V6a3 3 0 0 1 3-3z\" clip-rule=\"evenodd\"/></svg>';\nexport const transfer = icon;\n"],"version":3}
@@ -61,9 +61,6 @@ pn-marketweb-siteheader-login-linklist ul {
61
61
  pn-marketweb-siteheader-login-linklist ul > li {
62
62
  margin-bottom: 2.4rem;
63
63
  }
64
- pn-marketweb-siteheader-login-linklist ul > li:last-of-type {
65
- margin-bottom: 0;
66
- }
67
64
 
68
65
  pn-marketweb-siteheader-login-linklist ul > li a {
69
66
  text-decoration: none;
@@ -73,32 +73,9 @@ pn-marketweb-siteheader-login-profileselection {
73
73
  font-size: 0.75em;
74
74
  }
75
75
 
76
- .pn-marketweb-siteheader-login-profileselection-divider {
77
- position: relative;
78
- width: 100%;
79
- height: 1rem;
80
- background: var(--login-profileselection-divider-background);
81
- margin-left: -1em;
82
- margin-top: 1.6rem;
83
- margin-bottom: 1.6rem;
84
- border-radius: 0 0.6em 0.6em 0;
85
- padding: 0;
86
- }
87
- .pn-marketweb-siteheader-login-profileselection-divider::after {
88
- content: "";
89
- position: absolute;
90
- right: 0;
91
- top: 0;
92
- width: 0.6em;
93
- height: 0.6em;
94
- border-radius: 50%;
95
- background: inherit;
96
- transform: translateX(calc(100% + 0.2em));
97
- }
98
-
99
76
  .pn-marketweb-siteheader-login-profileselection-profileoption-link {
100
77
  display: flex;
101
- align-items: center;
78
+ align-items: flex-start;
102
79
  margin: 0 -1em;
103
80
  padding: 0.6rem 1.6rem;
104
81
  background: var(--login-profileselection-profileoption-link-background);
@@ -111,7 +88,10 @@ pn-marketweb-siteheader-login-profileselection {
111
88
  }
112
89
 
113
90
  .pn-marketweb-siteheader-login-profileselection-profileoption-content {
114
- flex-grow: 1;
91
+ padding-right: 0.5rem;
92
+ }
93
+ .pn-marketweb-siteheader-login-profileselection-profileoption-content pn-icon {
94
+ margin-left: 0.5rem;
115
95
  }
116
96
 
117
97
  .pn-marketweb-siteheader-login-profileselection-profileoption-name {
@@ -128,8 +108,14 @@ pn-marketweb-siteheader-login-profileselection {
128
108
 
129
109
  .pn-marketweb-siteheader-login-profileselection-logout {
130
110
  width: 100%;
131
- padding: 1.6rem;
132
- text-align: center;
111
+ }
112
+ .pn-marketweb-siteheader-login-profileselection-logout::before {
113
+ display: block;
114
+ content: "";
115
+ width: 100%;
116
+ height: 2px;
117
+ margin: 1.5rem 0;
118
+ background: var(--login-dropdown-divider-background);
133
119
  }
134
120
 
135
121
  .pn-marketweb-siteheader-login-profileselection-logout-link {
@@ -1,6 +1,6 @@
1
1
  import { h, Host } from "@stencil/core";
2
2
  import { state as headerState } from "./pn-marketweb-siteheader-store";
3
- import { arrow_right } from "pn-design-assets/pn-assets/icons.js";
3
+ import { arrow_right, transfer } from "pn-design-assets/pn-assets/icons.js";
4
4
  export class PnMarketwebSiteheaderLoginProfileselection {
5
5
  constructor() {
6
6
  this.loginDialog = null;
@@ -194,12 +194,12 @@ export class PnMarketwebSiteheaderLoginProfileselection {
194
194
  return;
195
195
  }
196
196
  let hostElementAttribute = {};
197
- return (h(Host, { ...hostElementAttribute }, this.heading ? h("strong", { class: "pn-marketweb-siteheader-login-profileselection-heading" }, this.heading) : null, this.currentProfile !== null && this.currentProfile.name ? (h("div", { class: "pn-marketweb-siteheader-login-profileselection-currentprofile" }, h("div", { class: "pn-marketweb-siteheader-login-profileselection-currentprofile-name" }, this.currentProfile.name), h("div", { class: "pn-marketweb-siteheader-login-profileselection-currentprofile-description" }, this.currentProfile.customerNumber ? this.currentProfile.customerNumber : this.userEmail))) : null, h("pn-marketweb-siteheader-login-linklist", { links: this.filterLogoutLink(this.loginDialog.loggedInLinks), idNamespace: this.idNamespace }), h("div", { class: "pn-marketweb-siteheader-login-profileselection-divider" }), this.profileoptions
197
+ return (h(Host, { ...hostElementAttribute }, this.heading ? h("strong", { class: "pn-marketweb-siteheader-login-profileselection-heading" }, this.heading) : null, this.currentProfile !== null && this.currentProfile.name ? (h("div", { class: "pn-marketweb-siteheader-login-profileselection-currentprofile" }, h("div", { class: "pn-marketweb-siteheader-login-profileselection-currentprofile-name" }, this.currentProfile.name), h("div", { class: "pn-marketweb-siteheader-login-profileselection-currentprofile-description" }, this.currentProfile.customerNumber ? this.currentProfile.customerNumber : this.userEmail))) : null, h("pn-marketweb-siteheader-login-linklist", { links: this.filterLogoutLink(this.loginDialog.loggedInLinks), idNamespace: this.idNamespace }), this.profileoptions
198
198
  .filter(x => x.selected !== true)
199
199
  .map(organization => {
200
200
  let customerNumber = organization.profiles.length > 0 ? organization.profiles[0].customerNumber : organization.customerNumber;
201
- return (h("div", { class: "pn-marketweb-siteheader-login-profileselection-profileoption" }, h("a", { href: `${this.endpoint}/api/user/setprofile?customernumber=${customerNumber}&returnUrl=${encodeURIComponent(window.location.href)}`, class: "pn-marketweb-siteheader-login-profileselection-profileoption-link" }, h("div", { class: "pn-marketweb-siteheader-login-profileselection-profileoption-content" }, h("div", { class: "pn-marketweb-siteheader-login-profileselection-profileoption-name" }, organization.name), h("div", { class: "pn-marketweb-siteheader-login-profileselection-profileoption-description" }, organization.customerNumber ? organization.customerNumber : this.userEmail)), h("pn-icon", { icon: arrow_right, small: "false", color: "blue700" }))));
202
- }), this.logoutLink ? (h("div", { class: "pn-marketweb-siteheader-login-profileselection-logout" }, h("a", { href: this.logoutLink.href, rel: "nofollower noopener", id: "pn-marketweb-header-logoutlink", onClick: () => headerState.loginManager.clearUserData(), class: "pn-marketweb-siteheader-login-profileselection-logout-link" }, this.logoutLink.linkText))) : null));
201
+ return (h("div", { class: "pn-marketweb-siteheader-login-profileselection-profileoption" }, h("a", { href: `${this.endpoint}/api/user/setprofile?customernumber=${customerNumber}&returnUrl=${encodeURIComponent(window.location.href)}`, class: "pn-marketweb-siteheader-login-profileselection-profileoption-link" }, h("div", { class: "pn-marketweb-siteheader-login-profileselection-profileoption-content" }, h("div", { class: "pn-marketweb-siteheader-login-profileselection-profileoption-name" }, organization.name, h("pn-icon", { icon: arrow_right, small: "false", color: "blue700" })), h("div", { class: "pn-marketweb-siteheader-login-profileselection-profileoption-description" }, organization.customerNumber ? organization.customerNumber : this.userEmail)))));
202
+ }), this.logoutLink ? (h("div", { class: "pn-marketweb-siteheader-login-profileselection-logout" }, h("pn-text-link", { href: this.logoutLink.href, rel: "nofollower noopener", id: "pn-marketweb-header-logoutlink", onClick: () => headerState.loginManager.clearUserData(), class: "pn-marketweb-siteheader-login-profileselection-logout-link", icon: transfer, label: this.logoutLink.linkText }))) : null));
203
203
  }
204
204
  static get is() { return "pn-marketweb-siteheader-login-profileselection"; }
205
205
  static get originalStyleUrls() {
@@ -1 +1 @@
1
- {"version":3,"file":"pn-marketweb-siteheader-login-profileselection.js","sourceRoot":"","sources":["../../../../src/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-profileselection.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAGzE,OAAO,EAAE,KAAK,IAAI,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAEvE,OAAO,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAC;AAMlE,MAAM,OAAO,0CAA0C;;2BAID,IAAI;wBAC7B,EAAE;wBACD,KAAK;2BACH,EAAE;uBACN,IAAI;oBACC;YAC7B,WAAW,EAAE,EAAE;YACf,iBAAiB,EAAE,EAAE;YACrB,gBAAgB,EAAE,EAAE;YACpB,cAAc,EAAE,EAAE;YAClB,gBAAgB,EAAE,EAAE;YACpB,cAAc,EAAE,EAAE;YAClB,eAAe,EAAE,EAAE;YACnB,6BAA6B,EAAE,EAAE;SAChB;oBAEQ,IAAI;0BAE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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, h, Host, Prop, State } from '@stencil/core';\n\nimport { IUserInfo } from '../../../globals/MarketWebLoginManager';\nimport { state as headerState } from './pn-marketweb-siteheader-store';\nimport { LoginDialog, LoginDialogLink, ProfileSelectorCustomerItem, ProfileSelectorOrganization, SiteHeaderI18N } from './pn-marketweb-siteheader-types';\nimport { arrow_right } from 'pn-design-assets/pn-assets/icons.js';\n\n@Component({\n tag: 'pn-marketweb-siteheader-login-profileselection',\n styleUrl: 'pn-marketweb-siteheader-login-profileselection.scss',\n})\nexport class PnMarketwebSiteheaderLoginProfileselection {\n @Element() hostElement: HTMLElement;\n\n // Login dialog\n @Prop({ mutable: true }) loginDialog: LoginDialog = null;\n @Prop() endpoint: string = '';\n @Prop() loggedin: boolean = false;\n @Prop() idNamespace: string = '';\n @Prop() heading: string = null;\n @Prop() i18n: SiteHeaderI18N = {\n searchlabel: '',\n searchplaceholder: '',\n searchbuttontext: '',\n menuHomeButton: '',\n menuGoBackButton: '',\n mainMenuButton: '',\n menuStartButton: '',\n profileSelectionFlyoutHeading: '',\n } as SiteHeaderI18N;\n\n @State() user: IUserInfo = null;\n\n @State() logoutLink: LoginDialogLink = null;\n @State() userName: string = null;\n @State() userEmail: string = '';\n\n @Prop({ mutable: true }) currentProfile: ProfileSelectorCustomerItem = null;\n @Prop({ mutable: true }) profileoptions: ProfileSelectorOrganization[] = [];\n\n componentWillLoad() {\n if (this.heading === null && this.i18n?.profileSelectionFlyoutHeading) {\n this.heading = this.i18n.profileSelectionFlyoutHeading;\n }\n this.init();\n }\n\n init() {\n this.updateUserInfo();\n this.adjustLoginLinks();\n this.fetchProfiles();\n }\n async fetchProfiles() {\n if (!this.loggedin || this.profileoptions.length > 0) {\n return;\n }\n let apiUrl = `${this.endpoint}${this.endpoint.lastIndexOf('/') > -1 && this.endpoint.lastIndexOf('/') === this.endpoint.length - 1 ? '' : '/'}api/user/parentorganizations`;\n const req = await fetch(apiUrl);\n const reqdata = await req.json();\n const fallbackData = {\n loggedin: true,\n organizations: [\n {\n name: 'Forsheda Livs AB',\n customerNumber: '5564513603',\n id: 'dbba867d-1dff-3dbb-b420-c57b4b828b73',\n selected: true,\n profiles: [\n {\n name: 'Forsheda Livs AB',\n customerNumber: '20685482',\n id: 'f757ba28-9a73-15a2-f128-4b394d970f3f',\n ssid: '',\n selected: false,\n customerGroup: 'Business',\n },\n {\n name: 'ICA MAXI KUNGSBACKA',\n customerNumber: '20831191',\n id: '5aea41df-32b0-3f7e-2946-78598360177d',\n ssid: '259686',\n selected: true,\n customerGroup: 'Agent',\n },\n ],\n },\n {\n name: 'Hem Livs i Kungsbacka AB',\n customerNumber: '5565271250',\n id: '97ca363c-40ef-cca9-7a3c-9e7f025567c2',\n selected: false,\n profiles: [\n {\n name: 'ICA KVANTUM KUNGSBACKA',\n customerNumber: '20831193',\n id: 'fbd61ffd-41c6-2206-b88e-cfef91e1dc39',\n ssid: '259691',\n selected: false,\n customerGroup: 'Agent',\n },\n ],\n },\n {\n name: 'ICA SUPERMARKET TORGET',\n customerNumber: '5568902679',\n id: '7cb76a94-e1a5-5f57-58fd-bc563851b28e',\n selected: false,\n profiles: [\n {\n name: 'ICA SUPERMARKET TORGET',\n customerNumber: '20831212',\n id: '3a2db017-b68f-6fa0-fe70-542c08cd97ce',\n ssid: '',\n selected: false,\n customerGroup: 'Agent',\n },\n ],\n },\n ],\n };\n const data = window.location.href.indexOf('localhost:6008') !== -1 ? fallbackData : reqdata;\n\n if (!data || !data.organizations || !data.organizations.length) {\n this.heading = \"\"; //this is to not get \"logged in as\" text when its private account\n return;\n }\n\n (data.organizations as ProfileSelectorOrganization[]).forEach(org => {\n if (org.selected === true && org.profiles) {\n const selectedProfile = org.profiles.filter(x => x.selected === true);\n if (selectedProfile && selectedProfile[0] && selectedProfile[0].customerGroup.toLocaleLowerCase() === 'agent' && selectedProfile[0].ssid) {\n org.customerNumber = selectedProfile[0].ssid;\n }\n } else {\n if (org.customerNumber.length === 10 && org.customerNumber.substring(0, 2) === '55') {\n org.customerNumber = org.customerNumber.substring(0, 6) + '-' + org.customerNumber.substring(6);\n }\n this.profileoptions.push(org);\n }\n });\n\n let currentProfileObj = data.organizations.filter(x => x.selected === true)[0];\n const userProfileOption = {\n name: this.userName,\n customerNumber: '',\n id: '',\n selected: !currentProfileObj,\n profiles: [],\n };\n if (!currentProfileObj) {\n currentProfileObj = userProfileOption;\n }\n\n if (currentProfileObj && currentProfileObj.name) {\n this.currentProfile = currentProfileObj;\n }\n this.profileoptions.push(userProfileOption);\n }\n adjustLoginLinks() {\n const adjustLink = (link, i) => {\n if (!link.isLogoutLink) {\n link.isLogoutLink = link.pageLink.indexOf('location.href') !== -1 && link.pageLink.indexOf('logout') !== -1;\n }\n if (link.isLogoutLink) {\n link.href = headerState.loginManager.getLogoutUrl(link.href);\n }\n\n if (i === 0 && !link.href) {\n link.href = headerState.loginManager.getLoginUrl();\n link.linkType = 'primary';\n }\n if (link.primaryLinkApperance && !link.linkType) {\n link.linkType = 'primary';\n }\n };\n\n if (this.loginDialog?.loggedInLinks) {\n this.loginDialog?.loggedInLinks.forEach(adjustLink);\n }\n\n this.logoutLink = this.loginDialog?.loggedInLinks.filter(x => x.isLogoutLink)[0] ?? null;\n }\n updateUserInfo() {\n const userInfo: IUserInfo = headerState.loginManager.getUserInfo();\n this.user = userInfo;\n if (!userInfo) {\n return;\n }\n if (userInfo && userInfo.email) {\n this.userEmail = userInfo.email;\n }\n if (userInfo && userInfo.given_name) {\n this.userName = userInfo.given_name + (userInfo?.family_name ? ` ${userInfo?.family_name}` : '');\n }\n if (userInfo && userInfo.given_name) {\n this.userName = userInfo.given_name;\n return;\n }\n if (userInfo && userInfo.family_name) {\n this.userName = userInfo.family_name;\n return;\n }\n if (userInfo && userInfo.username) {\n this.userName = userInfo.username;\n return;\n }\n }\n\n filterLogoutLink(loggedInLinks: LoginDialogLink[]): LoginDialogLink[] {\n return loggedInLinks.filter((link: LoginDialogLink) => !link.isLogoutLink);\n }\n\n render() {\n if (!this.loginDialog) {\n return;\n }\n\n let hostElementAttribute = {};\n return (\n <Host {...hostElementAttribute}>\n {this.heading ? <strong class=\"pn-marketweb-siteheader-login-profileselection-heading\">{this.heading}</strong> : null}\n {this.currentProfile !== null && this.currentProfile.name ? (\n <div class=\"pn-marketweb-siteheader-login-profileselection-currentprofile\">\n <div class=\"pn-marketweb-siteheader-login-profileselection-currentprofile-name\">{this.currentProfile.name}</div>\n <div class=\"pn-marketweb-siteheader-login-profileselection-currentprofile-description\">\n {this.currentProfile.customerNumber ? this.currentProfile.customerNumber : this.userEmail}\n </div>\n </div>\n ) : null}\n\n <pn-marketweb-siteheader-login-linklist\n links={this.filterLogoutLink(this.loginDialog.loggedInLinks)}\n idNamespace={this.idNamespace}\n ></pn-marketweb-siteheader-login-linklist>\n\n <div class=\"pn-marketweb-siteheader-login-profileselection-divider\"></div>\n {this.profileoptions\n .filter(x => x.selected !== true)\n .map(organization => {\n let customerNumber = organization.profiles.length > 0 ? organization.profiles[0].customerNumber : organization.customerNumber;\n return (\n <div class=\"pn-marketweb-siteheader-login-profileselection-profileoption\">\n {/* /api/user/setprofile? profile=xxxxx */}\n <a\n href={`${this.endpoint}/api/user/setprofile?customernumber=${customerNumber}&returnUrl=${encodeURIComponent(window.location.href)}`}\n class=\"pn-marketweb-siteheader-login-profileselection-profileoption-link\"\n >\n <div class=\"pn-marketweb-siteheader-login-profileselection-profileoption-content\">\n <div class=\"pn-marketweb-siteheader-login-profileselection-profileoption-name\">{organization.name}</div>\n <div class=\"pn-marketweb-siteheader-login-profileselection-profileoption-description\">\n {organization.customerNumber ? organization.customerNumber : this.userEmail}\n </div>\n </div>\n <pn-icon icon={arrow_right} small=\"false\" color=\"blue700\"></pn-icon>\n </a>\n </div>\n );\n })}\n\n {this.logoutLink ? (\n <div class=\"pn-marketweb-siteheader-login-profileselection-logout\">\n {/* https://se-inte.postnord.com/UnifiedLogin/ExternalLoginCallback?returnUrl=https://se-inte.postnord.com/handla-online&profile=770e785b-702b-dc22-b1e9-4839eded4f83 */}\n <a\n href={this.logoutLink.href}\n rel=\"nofollower noopener\"\n id=\"pn-marketweb-header-logoutlink\"\n onClick={() => headerState.loginManager.clearUserData()}\n class=\"pn-marketweb-siteheader-login-profileselection-logout-link\"\n >\n {this.logoutLink.linkText}\n </a>\n </div>\n ) : null}\n </Host>\n );\n }\n}\n"]}
1
+ {"version":3,"file":"pn-marketweb-siteheader-login-profileselection.js","sourceRoot":"","sources":["../../../../src/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-profileselection.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAGzE,OAAO,EAAE,KAAK,IAAI,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAEvE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,qCAAqC,CAAC;AAM5E,MAAM,OAAO,0CAA0C;;2BAID,IAAI;wBAC7B,EAAE;wBACD,KAAK;2BACH,EAAE;uBACN,IAAI;oBACC;YAC7B,WAAW,EAAE,EAAE;YACf,iBAAiB,EAAE,EAAE;YACrB,gBAAgB,EAAE,EAAE;YACpB,cAAc,EAAE,EAAE;YAClB,gBAAgB,EAAE,EAAE;YACpB,cAAc,EAAE,EAAE;YAClB,eAAe,EAAE,EAAE;YACnB,6BAA6B,EAAE,EAAE;SAChB;oBAEQ,IAAI;0BAEQ,IAAI;wBACf,IAAI;yBACH,EAAE;8BAEwC,IAAI;8BACF,EAAE;;IA1BhE,WAAW,CAAc;IA4BpC,iBAAiB;QACf,IAAI,IAAI,CAAC,OAAO,KAAK,IAAI,IAAI,IAAI,CAAC,IAAI,EAAE,6BAA6B,EAAE,CAAC;YACtE,IAAI,CAAC,OAAO,GAAG,IA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cAAc,kBAAkB,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,EACnI,KAAK,EAAC,mEAAmE;wBACzE,WAAK,KAAK,EAAC,sEAAsE;4BAC/E,WAAK,KAAK,EAAC,mEAAmE;gCAC3E,YAAY,CAAC,IAAI;gCAClB,eAAS,IAAI,EAAE,WAAW,EAAE,KAAK,EAAC,OAAO,EAAC,KAAK,EAAC,SAAS,GAAW,CAChE;4BACN,WAAK,KAAK,EAAC,0EAA0E,IAClF,YAAY,CAAC,cAAc,CAAC,CAAC,CAAC,YAAY,CAAC,cAAc,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CACvE,CACF,CACJ,CACA,CACP,CAAC;YACJ,CAAC,CAAC;YAEH,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CACjB,WAAK,KAAK,EAAC,uDAAuD;gBAEhE,oBACE,IAAI,EAAE,IAAI,CAAC,UAAU,CAAC,IAAI,EAC1B,GAAG,EAAC,qBAAqB,EACzB,EAAE,EAAC,gCAAgC,EACnC,OAAO,EAAE,GAAG,EAAE,CAAC,WAAW,CAAC,YAAY,CAAC,aAAa,EAAE,EACvD,KAAK,EAAC,4DAA4D,EAClE,IAAI,EAAE,QAAQ,EACd,KAAK,EAAE,IAAI,CAAC,UAAU,CAAC,QAAQ,GAElB,CACX,CACP,CAAC,CAAC,CAAC,IAAI,CACH,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, h, Host, Prop, State } from '@stencil/core';\n\nimport { IUserInfo } from '../../../globals/MarketWebLoginManager';\nimport { state as headerState } from './pn-marketweb-siteheader-store';\nimport { LoginDialog, LoginDialogLink, ProfileSelectorCustomerItem, ProfileSelectorOrganization, SiteHeaderI18N } from './pn-marketweb-siteheader-types';\nimport { arrow_right, transfer } from 'pn-design-assets/pn-assets/icons.js';\n\n@Component({\n tag: 'pn-marketweb-siteheader-login-profileselection',\n styleUrl: 'pn-marketweb-siteheader-login-profileselection.scss',\n})\nexport class PnMarketwebSiteheaderLoginProfileselection {\n @Element() hostElement: HTMLElement;\n\n // Login dialog\n @Prop({ mutable: true }) loginDialog: LoginDialog = null;\n @Prop() endpoint: string = '';\n @Prop() loggedin: boolean = false;\n @Prop() idNamespace: string = '';\n @Prop() heading: string = null;\n @Prop() i18n: SiteHeaderI18N = {\n searchlabel: '',\n searchplaceholder: '',\n searchbuttontext: '',\n menuHomeButton: '',\n menuGoBackButton: '',\n mainMenuButton: '',\n menuStartButton: '',\n profileSelectionFlyoutHeading: '',\n } as SiteHeaderI18N;\n\n @State() user: IUserInfo = null;\n\n @State() logoutLink: LoginDialogLink = null;\n @State() userName: string = null;\n @State() userEmail: string = '';\n\n @Prop({ mutable: true }) currentProfile: ProfileSelectorCustomerItem = null;\n @Prop({ mutable: true }) profileoptions: ProfileSelectorOrganization[] = [];\n\n componentWillLoad() {\n if (this.heading === null && this.i18n?.profileSelectionFlyoutHeading) {\n this.heading = this.i18n.profileSelectionFlyoutHeading;\n }\n this.init();\n }\n\n init() {\n this.updateUserInfo();\n this.adjustLoginLinks();\n this.fetchProfiles();\n }\n async fetchProfiles() {\n if (!this.loggedin || this.profileoptions.length > 0) {\n return;\n }\n let apiUrl = `${this.endpoint}${this.endpoint.lastIndexOf('/') > -1 && this.endpoint.lastIndexOf('/') === this.endpoint.length - 1 ? '' : '/'}api/user/parentorganizations`;\n const req = await fetch(apiUrl);\n const reqdata = await req.json();\n const fallbackData = {\n loggedin: true,\n organizations: [\n {\n name: 'Forsheda Livs AB',\n customerNumber: '5564513603',\n id: 'dbba867d-1dff-3dbb-b420-c57b4b828b73',\n selected: true,\n profiles: [\n {\n name: 'Forsheda Livs AB',\n customerNumber: '20685482',\n id: 'f757ba28-9a73-15a2-f128-4b394d970f3f',\n ssid: '',\n selected: false,\n customerGroup: 'Business',\n },\n {\n name: 'ICA MAXI KUNGSBACKA',\n customerNumber: '20831191',\n id: '5aea41df-32b0-3f7e-2946-78598360177d',\n ssid: '259686',\n selected: true,\n customerGroup: 'Agent',\n },\n ],\n },\n {\n name: 'Hem Livs i Kungsbacka AB',\n customerNumber: '5565271250',\n id: '97ca363c-40ef-cca9-7a3c-9e7f025567c2',\n selected: false,\n profiles: [\n {\n name: 'ICA KVANTUM KUNGSBACKA',\n customerNumber: '20831193',\n id: 'fbd61ffd-41c6-2206-b88e-cfef91e1dc39',\n ssid: '259691',\n selected: false,\n customerGroup: 'Agent',\n },\n ],\n },\n {\n name: 'ICA SUPERMARKET TORGET',\n customerNumber: '5568902679',\n id: '7cb76a94-e1a5-5f57-58fd-bc563851b28e',\n selected: false,\n profiles: [\n {\n name: 'ICA SUPERMARKET TORGET',\n customerNumber: '20831212',\n id: '3a2db017-b68f-6fa0-fe70-542c08cd97ce',\n ssid: '',\n selected: false,\n customerGroup: 'Agent',\n },\n ],\n },\n ],\n };\n const data = window.location.href.indexOf('localhost:6008') !== -1 ? fallbackData : reqdata;\n\n if (!data || !data.organizations || !data.organizations.length) {\n this.heading = \"\"; //this is to not get \"logged in as\" text when its private account\n return;\n }\n\n (data.organizations as ProfileSelectorOrganization[]).forEach(org => {\n if (org.selected === true && org.profiles) {\n const selectedProfile = org.profiles.filter(x => x.selected === true);\n if (selectedProfile && selectedProfile[0] && selectedProfile[0].customerGroup.toLocaleLowerCase() === 'agent' && selectedProfile[0].ssid) {\n org.customerNumber = selectedProfile[0].ssid;\n }\n } else {\n if (org.customerNumber.length === 10 && org.customerNumber.substring(0, 2) === '55') {\n org.customerNumber = org.customerNumber.substring(0, 6) + '-' + org.customerNumber.substring(6);\n }\n this.profileoptions.push(org);\n }\n });\n\n let currentProfileObj = data.organizations.filter(x => x.selected === true)[0];\n const userProfileOption = {\n name: this.userName,\n customerNumber: '',\n id: '',\n selected: !currentProfileObj,\n profiles: [],\n };\n if (!currentProfileObj) {\n currentProfileObj = userProfileOption;\n }\n\n if (currentProfileObj && currentProfileObj.name) {\n this.currentProfile = currentProfileObj;\n }\n this.profileoptions.push(userProfileOption);\n }\n adjustLoginLinks() {\n const adjustLink = (link, i) => {\n if (!link.isLogoutLink) {\n link.isLogoutLink = link.pageLink.indexOf('location.href') !== -1 && link.pageLink.indexOf('logout') !== -1;\n }\n if (link.isLogoutLink) {\n link.href = headerState.loginManager.getLogoutUrl(link.href);\n }\n\n if (i === 0 && !link.href) {\n link.href = headerState.loginManager.getLoginUrl();\n link.linkType = 'primary';\n }\n if (link.primaryLinkApperance && !link.linkType) {\n link.linkType = 'primary';\n }\n };\n\n if (this.loginDialog?.loggedInLinks) {\n this.loginDialog?.loggedInLinks.forEach(adjustLink);\n }\n\n this.logoutLink = this.loginDialog?.loggedInLinks.filter(x => x.isLogoutLink)[0] ?? null;\n }\n updateUserInfo() {\n const userInfo: IUserInfo = headerState.loginManager.getUserInfo();\n this.user = userInfo;\n if (!userInfo) {\n return;\n }\n if (userInfo && userInfo.email) {\n this.userEmail = userInfo.email;\n }\n if (userInfo && userInfo.given_name) {\n this.userName = userInfo.given_name + (userInfo?.family_name ? ` ${userInfo?.family_name}` : '');\n }\n if (userInfo && userInfo.given_name) {\n this.userName = userInfo.given_name;\n return;\n }\n if (userInfo && userInfo.family_name) {\n this.userName = userInfo.family_name;\n return;\n }\n if (userInfo && userInfo.username) {\n this.userName = userInfo.username;\n return;\n }\n }\n\n filterLogoutLink(loggedInLinks: LoginDialogLink[]): LoginDialogLink[] {\n return loggedInLinks.filter((link: LoginDialogLink) => !link.isLogoutLink);\n }\n\n render() {\n if (!this.loginDialog) {\n return;\n }\n\n let hostElementAttribute = {};\n return (\n <Host {...hostElementAttribute}>\n {this.heading ? <strong class=\"pn-marketweb-siteheader-login-profileselection-heading\">{this.heading}</strong> : null}\n {this.currentProfile !== null && this.currentProfile.name ? (\n <div class=\"pn-marketweb-siteheader-login-profileselection-currentprofile\">\n <div class=\"pn-marketweb-siteheader-login-profileselection-currentprofile-name\">{this.currentProfile.name}</div>\n <div class=\"pn-marketweb-siteheader-login-profileselection-currentprofile-description\">\n {this.currentProfile.customerNumber ? this.currentProfile.customerNumber : this.userEmail}\n </div>\n </div>\n ) : null}\n\n <pn-marketweb-siteheader-login-linklist\n links={this.filterLogoutLink(this.loginDialog.loggedInLinks)}\n idNamespace={this.idNamespace}\n ></pn-marketweb-siteheader-login-linklist>\n\n {this.profileoptions\n .filter(x => x.selected !== true)\n .map(organization => {\n let customerNumber = organization.profiles.length > 0 ? organization.profiles[0].customerNumber : organization.customerNumber;\n return (\n <div class=\"pn-marketweb-siteheader-login-profileselection-profileoption\">\n {/* /api/user/setprofile? profile=xxxxx */}\n <a\n href={`${this.endpoint}/api/user/setprofile?customernumber=${customerNumber}&returnUrl=${encodeURIComponent(window.location.href)}`}\n class=\"pn-marketweb-siteheader-login-profileselection-profileoption-link\">\n <div class=\"pn-marketweb-siteheader-login-profileselection-profileoption-content\">\n <div class=\"pn-marketweb-siteheader-login-profileselection-profileoption-name\">\n {organization.name}\n <pn-icon icon={arrow_right} small=\"false\" color=\"blue700\"></pn-icon>\n </div>\n <div class=\"pn-marketweb-siteheader-login-profileselection-profileoption-description\">\n {organization.customerNumber ? organization.customerNumber : this.userEmail}\n </div>\n </div>\n </a>\n </div>\n );\n })}\n\n {this.logoutLink ? (\n <div class=\"pn-marketweb-siteheader-login-profileselection-logout\">\n {/* https://se-inte.postnord.com/UnifiedLogin/ExternalLoginCallback?returnUrl=https://se-inte.postnord.com/handla-online&profile=770e785b-702b-dc22-b1e9-4839eded4f83 */}\n <pn-text-link\n href={this.logoutLink.href}\n rel=\"nofollower noopener\"\n id=\"pn-marketweb-header-logoutlink\"\n onClick={() => headerState.loginManager.clearUserData()}\n class=\"pn-marketweb-siteheader-login-profileselection-logout-link\"\n icon={transfer}\n label={this.logoutLink.linkText}\n >\n </pn-text-link>\n </div>\n ) : null}\n </Host>\n );\n }\n}\n"]}
@@ -67,13 +67,6 @@ pn-marketweb-siteheader-login pn-button-dropdown .pn-button-dropdown-container .
67
67
  font-size: 1.4rem;
68
68
  color: var(--login-dropdown-text-color);
69
69
  }
70
- pn-marketweb-siteheader-login pn-button-dropdown .pn-button-dropdown-container .pn-button-dropdown-content span::before {
71
- display: block;
72
- content: "";
73
- width: 100%;
74
- height: 2px;
75
- background: var(--login-dropdown-divider-background);
76
- }
77
70
  pn-marketweb-siteheader-login pn-button-dropdown .pn-button-dropdown-container .pn-button-dropdown-content span a {
78
71
  text-decoration: none;
79
72
  color: var(--login-dropdown-link-color);
@@ -10,7 +10,7 @@ const { state, onChange } = createStore({
10
10
  loginManager: null,
11
11
  });
12
12
 
13
- const pnMarketwebSiteheaderLoginLinklistCss = "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-linklist{--login-linklist-heading-color:var(--siteheader-login-linklist-heading-color, inherit);--login-linklist-link-color:var(--siteheader-login-linklist-link-color, #005d92);--login-linklist-link-hover-color:var(--siteheader-login-linklist-link-hover-color, #0d234b);--login-linklist-button-link-color:var(--siteheader-login-linklist-button-link-color, #ffffff);--login-linklist-icon-color:var(--siteheader-login-linklist-icon-color, #005d92);--login-linklist-icon-hover-color:var(--siteheader-login-linklist-icon-hover-color, #0d234b)}pn-marketweb-siteheader-login-linklist{display:flex;flex-direction:column}.pn-marketweb-siteheader-login-linklist-heading{font-weight:500;font-size:1.6rem;margin-bottom:2.4rem;color:var(--login-linklist-heading-color)}pn-marketweb-siteheader-login-linklist strong{margin-bottom:2.4rem}pn-marketweb-siteheader-login-linklist ul{list-style-type:none;padding:0;margin:0}pn-marketweb-siteheader-login-linklist ul>li{margin-bottom:2.4rem}pn-marketweb-siteheader-login-linklist ul>li:last-of-type{margin-bottom:0}pn-marketweb-siteheader-login-linklist ul>li a{text-decoration:none;font-size:1.6rem;line-height:1.5;font-weight:500}pn-marketweb-siteheader-login-linklist ul>li a:hover{color:var(--login-linklist-button-link-color)}pn-marketweb-siteheader-login-linklist ul>li a:not(.pn-button){color:var(--login-linklist-link-color)}pn-marketweb-siteheader-login-linklist ul>li:hover a:not(.pn-button){color:var(--login-linklist-link-hover-color);text-decoration:underline}pn-marketweb-siteheader-login-linklist ul>li pn-icon{padding-left:0.8rem}pn-marketweb-siteheader-login-linklist ul>li pn-icon svg>path{fill:var(--login-linklist-icon-color) !important}pn-marketweb-siteheader-login-linklist ul>li:hover pn-icon svg>path{fill:var(--login-linklist-icon-hover-color) !important}";
13
+ const pnMarketwebSiteheaderLoginLinklistCss = "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-linklist{--login-linklist-heading-color:var(--siteheader-login-linklist-heading-color, inherit);--login-linklist-link-color:var(--siteheader-login-linklist-link-color, #005d92);--login-linklist-link-hover-color:var(--siteheader-login-linklist-link-hover-color, #0d234b);--login-linklist-button-link-color:var(--siteheader-login-linklist-button-link-color, #ffffff);--login-linklist-icon-color:var(--siteheader-login-linklist-icon-color, #005d92);--login-linklist-icon-hover-color:var(--siteheader-login-linklist-icon-hover-color, #0d234b)}pn-marketweb-siteheader-login-linklist{display:flex;flex-direction:column}.pn-marketweb-siteheader-login-linklist-heading{font-weight:500;font-size:1.6rem;margin-bottom:2.4rem;color:var(--login-linklist-heading-color)}pn-marketweb-siteheader-login-linklist strong{margin-bottom:2.4rem}pn-marketweb-siteheader-login-linklist ul{list-style-type:none;padding:0;margin:0}pn-marketweb-siteheader-login-linklist ul>li{margin-bottom:2.4rem}pn-marketweb-siteheader-login-linklist ul>li a{text-decoration:none;font-size:1.6rem;line-height:1.5;font-weight:500}pn-marketweb-siteheader-login-linklist ul>li a:hover{color:var(--login-linklist-button-link-color)}pn-marketweb-siteheader-login-linklist ul>li a:not(.pn-button){color:var(--login-linklist-link-color)}pn-marketweb-siteheader-login-linklist ul>li:hover a:not(.pn-button){color:var(--login-linklist-link-hover-color);text-decoration:underline}pn-marketweb-siteheader-login-linklist ul>li pn-icon{padding-left:0.8rem}pn-marketweb-siteheader-login-linklist ul>li pn-icon svg>path{fill:var(--login-linklist-icon-color) !important}pn-marketweb-siteheader-login-linklist ul>li:hover pn-icon svg>path{fill:var(--login-linklist-icon-hover-color) !important}";
14
14
  const PnMarketwebSiteheaderLoginLinklistStyle0 = pnMarketwebSiteheaderLoginLinklistCss;
15
15
 
16
16
  const PnMarketwebSiteheaderLoginLinklist = /*@__PURE__*/ proxyCustomElement(class PnMarketwebSiteheaderLoginLinklist extends HTMLElement {
@@ -106,6 +106,6 @@ function defineCustomElement() {
106
106
  } });
107
107
  }
108
108
 
109
- export { PnMarketwebSiteheaderLoginLinklist as P, defineCustomElement as d, state as s };
109
+ export { PnMarketwebSiteheaderLoginLinklist as P, defineCustomElement as d, state as s, transfer as t };
110
110
 
111
111
  //# sourceMappingURL=pn-marketweb-siteheader-login-linklist2.js.map
@@ -1 +1 @@
1
- {"file":"pn-marketweb-siteheader-login-linklist2.js","mappings":";;;;AAAA,MAAM,IAAI,GAAG,gcAAgc,CAAC;AACvc,MAAM,QAAQ,GAAG,IAAI;;ACA5B;MAEM,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,WAAW,CAAC;IACtC,Y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ets/icons/transfer.js","src/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-store.tsx","src/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-linklist.scss?tag=pn-marketweb-siteheader-login-linklist","src/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-linklist.tsx"],"sourcesContent":["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=\"M21.78 11.375a1 1 0 0 1 0 1.25l-4 5a1 1 0 1 1-1.56-1.25L18.92 13H7a1 1 0 1 1 0-2h11.92l-2.7-3.375a1 1 0 1 1 1.56-1.25zM11 3a3 3 0 0 1 3 3v2a1 1 0 1 1-2 0V6a1 1 0 0 0-1-1H5a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1v-2a1 1 0 1 1 2 0v2a3 3 0 0 1-3 3H5a3 3 0 0 1-3-3V6a3 3 0 0 1 3-3z\" clip-rule=\"evenodd\"/></svg>';\nexport const transfer = icon;\n","import { createStore } from '@stencil/store';\n// Read more about how stencil stores work here: https://stenciljs.com/docs/stencil-store\n\nconst { state, onChange } = createStore({\n loginManager: null,\n});\n\nexport { state, onChange };\nexport default state;\n","@import '../../../globals/main.scss';\n@import './pn-marketweb-siteheader-common.scss';\n\n// -----------------------------------------------------------------------------\n// Internal layout / visual constants (SCSS only)\n// -----------------------------------------------------------------------------\n$login-linklist-heading-font-weight: 500;\n$login-linklist-heading-font-size: 1.6rem;\n$login-linklist-heading-margin-bottom: 2.4rem;\n\n$login-linklist-strong-margin-bottom: 2.4rem;\n\n$login-linklist-list-item-margin-bottom: 2.4rem;\n\n$login-linklist-link-font-size: 1.6rem;\n$login-linklist-link-line-height: 1.5;\n$login-linklist-link-font-weight: 500;\n\n$login-linklist-icon-padding-left: 0.8rem;\n\n// -----------------------------------------------------------------------------\n// Component token defaults (CSS vars - only real override surface)\n// -----------------------------------------------------------------------------\npn-marketweb-siteheader-login-linklist {\n --login-linklist-heading-color: var(--siteheader-login-linklist-heading-color, inherit);\n\n --login-linklist-link-color: var(--siteheader-login-linklist-link-color, #{$blue700});\n --login-linklist-link-hover-color: var(--siteheader-login-linklist-link-hover-color, #{$blue900});\n\n --login-linklist-button-link-color: var(--siteheader-login-linklist-button-link-color, #{$white});\n\n --login-linklist-icon-color: var(--siteheader-login-linklist-icon-color, #{$blue700});\n --login-linklist-icon-hover-color: var(--siteheader-login-linklist-icon-hover-color, #{$blue900});\n}\n\n// -----------------------------------------------------------------------------\n// Host shell / layout\n// -----------------------------------------------------------------------------\npn-marketweb-siteheader-login-linklist {\n display: flex;\n flex-direction: column;\n}\n\n// -----------------------------------------------------------------------------\n// Heading\n// -----------------------------------------------------------------------------\n.pn-marketweb-siteheader-login-linklist-heading {\n font-weight: $login-linklist-heading-font-weight;\n font-size: $login-linklist-heading-font-size;\n margin-bottom: $login-linklist-heading-margin-bottom;\n color: var(--login-linklist-heading-color);\n}\n\npn-marketweb-siteheader-login-linklist strong {\n margin-bottom: $login-linklist-strong-margin-bottom;\n}\n\n// -----------------------------------------------------------------------------\n// List structure\n// -----------------------------------------------------------------------------\npn-marketweb-siteheader-login-linklist ul {\n list-style-type: none;\n padding: 0;\n margin: 0;\n}\n\npn-marketweb-siteheader-login-linklist ul>li {\n margin-bottom: $login-linklist-list-item-margin-bottom;\n\n &:last-of-type {\n margin-bottom: 0;\n }\n}\n\n// -----------------------------------------------------------------------------\n// Links\n// -----------------------------------------------------------------------------\npn-marketweb-siteheader-login-linklist ul>li a {\n text-decoration: none;\n font-size: $login-linklist-link-font-size;\n line-height: $login-linklist-link-line-height;\n font-weight: $login-linklist-link-font-weight;\n\n &:hover {\n color:var(--login-linklist-button-link-color);\n }\n}\n\npn-marketweb-siteheader-login-linklist ul>li a:not(.pn-button) {\n color: var(--login-linklist-link-color);\n}\n\npn-marketweb-siteheader-login-linklist ul>li:hover a:not(.pn-button) {\n color: var(--login-linklist-link-hover-color);\n text-decoration: underline;\n}\n\n// -----------------------------------------------------------------------------\n// Icons\n// -----------------------------------------------------------------------------\npn-marketweb-siteheader-login-linklist ul>li pn-icon {\n padding-left: $login-linklist-icon-padding-left;\n\n svg>path {\n fill: var(--login-linklist-icon-color) !important;\n }\n}\n\npn-marketweb-siteheader-login-linklist ul>li:hover pn-icon {\n svg>path {\n fill: var(--login-linklist-icon-hover-color) !important;\n }\n}","import { Component, Element, h, Host, Prop } from '@stencil/core';\n\nimport { state as headerState } from './pn-marketweb-siteheader-store';\nimport { LoginDialogLink } from './pn-marketweb-siteheader-types';\nimport { arrow_right, transfer } from 'pn-design-assets/pn-assets/icons.js';\n\n@Component({\n tag: 'pn-marketweb-siteheader-login-linklist',\n styleUrl: 'pn-marketweb-siteheader-login-linklist.scss',\n})\nexport class PnMarketwebSiteheaderLoginLinklist {\n @Element() hostElement: HTMLElement;\n\n @Prop() heading: string = null;\n @Prop() links: LoginDialogLink[] = [];\n @Prop() idNamespace: string = '';\n @Prop() showUnifiedLogin: boolean = false;\n\n componentWillLoad() {}\n\n uniqueId(text: string) {\n return 'loginlink-' + text.replace(/[^A-Za-z0-9.\\\\\\/]/gim, '') + '-' + this.idNamespace;\n }\n\n linkAppearanceAttributes(link) {\n let attributes = {};\n if (link.linkType) {\n switch (link.linkType) {\n case 'primary':\n attributes = {\n appearance: '',\n variant: '',\n };\n break;\n case 'secondary':\n attributes = {\n appearance: 'light',\n variant: 'outlined',\n };\n break;\n case 'regularlink':\n default:\n attributes = {\n appearance: 'light',\n variant: 'borderless',\n icon: arrow_right,\n };\n break;\n }\n return attributes;\n }\n if (!link.linkType) {\n attributes = {\n appearance: link.primaryLinkApperance ? 'dark' : 'light',\n };\n }\n return attributes;\n }\n\n renderListAsButtons(link) {\n return (\n <li>\n <pn-button\n href={link.href}\n id={this.uniqueId(link.linkText)}\n {...(link.openInNewWindow && { target: '_blank' })}\n {...this.linkAppearanceAttributes(link)}\n onClick={() => {\n if (link.isLogoutLink) {\n headerState.loginManager.clearUserData();\n }\n }}\n >\n {link.linkText}\n </pn-button>\n </li>\n );\n }\n\n renderListAsLinks(link) {\n return (\n <li>\n <a\n href={link.href}\n id={this.uniqueId(link.linkText)}\n {...(link.openInNewWindow && { target: '_blank' })}\n onClick={() => {\n if (link.isLogoutLink) {\n headerState.loginManager.clearUserData();\n }\n }}\n >\n {link.linkText}\n {link.isLogoutLink ? <pn-icon icon={transfer}></pn-icon> : <pn-icon icon={arrow_right}></pn-icon>}\n </a>\n </li>\n );\n }\n\n render() {\n if (!this.links || this.links.length === 0) {\n return;\n }\n return (\n <Host>\n {this.heading ? <p class=\"pn-marketweb-siteheader-login-linklist-heading\">{this.heading}</p> : null}\n <ul>\n {this.links.map(link => {\n {\n return this.showUnifiedLogin ? this.renderListAsLinks(link) : this.renderListAsButtons(link);\n }\n })}\n </ul>\n </Host>\n );\n }\n}\n"],"version":3}
1
+ {"file":"pn-marketweb-siteheader-login-linklist2.js","mappings":";;;;AAAA,MAAM,IAAI,GAAG,gcAAgc,CAAC;AAClc,MAAC,QAAQ,GAAG;;ACAxB;MAEM,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,WAAW,CAAC;IACtC,YAAY,EAAE,IAAI;CACnB;;ACLD,MAAM,qCAAqC,GAAG,ioEAAioE,CAAC;AAChrE,iDAAe,qCAAqC;;MCSvC,kCAAkC;;;;uBAGnB,IAAI;qBACK,EAAE;2BACP,EAAE;gCACI,KAAK;;;IAEzC,iBAAiB,MAAK;IAEtB,QAAQ,CAAC,IAAY;QACnB,OAAO,YAAY,GAAG,IAAI,CAAC,OAAO,CAAC,sBAAsB,EAAE,EAAE,CAAC,GAAG,GAAG,GAAG,IAAI,CAAC,WAAW,CAAC;KACzF;IAED,wBAAwB,CAAC,IAAI;QAC3B,IAAI,UAAU,GAAG,EAAE,CAAC;QACpB,IAAI,IAAI,CAAC,QAAQ,EAAE;YACjB,QAAQ,IAAI,CAAC,QAAQ;gBACn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,IAAI,CAAC,YAAY,EAAE;oBACrBA,KAAW,CAAC,YAAY,CAAC,aAAa,EAAE,CAAC;iBAC1C;aACF,IAEA,IAAI,CAAC,QAAQ,EACb,IAAI,CAAC,YAAY,GAAG,eAAS,IAAI,EAAE,QAAQ,GAAY,GAAG,eAAS,IAAI,EAAE,WAAW,GAAY,CAC/F,CACD,EACL;KACH;IAED,MAAM;QACJ,IAAI,CAAC,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE;YAC1C,OAAO;SACR;QACD,QACE,EAAC,IAAI,QACF,IAAI,CAAC,OAAO,GAAG,SAAG,KAAK,EAAC,gDAAgD,IAAE,IAAI,CAAC,OAAO,CAAK,GAAG,IAAI,EACnG,cACG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI;YAClB;gBACE,OAAO,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,CAAC;aAC9F;SACF,CAAC,CACC,CACA,EACP;KACH;;;;;;;;;;;;;;;;;;;;;;;;","names":["headerState"],"sources":["node_modules/pn-design-assets/pn-assets/icons/transfer.js","src/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-store.tsx","src/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-linklist.scss?tag=pn-marketweb-siteheader-login-linklist","src/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-linklist.tsx"],"sourcesContent":["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=\"M21.78 11.375a1 1 0 0 1 0 1.25l-4 5a1 1 0 1 1-1.56-1.25L18.92 13H7a1 1 0 1 1 0-2h11.92l-2.7-3.375a1 1 0 1 1 1.56-1.25zM11 3a3 3 0 0 1 3 3v2a1 1 0 1 1-2 0V6a1 1 0 0 0-1-1H5a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1v-2a1 1 0 1 1 2 0v2a3 3 0 0 1-3 3H5a3 3 0 0 1-3-3V6a3 3 0 0 1 3-3z\" clip-rule=\"evenodd\"/></svg>';\nexport const transfer = icon;\n","import { createStore } from '@stencil/store';\n// Read more about how stencil stores work here: https://stenciljs.com/docs/stencil-store\n\nconst { state, onChange } = createStore({\n loginManager: null,\n});\n\nexport { state, onChange };\nexport default state;\n","@import '../../../globals/main.scss';\n@import './pn-marketweb-siteheader-common.scss';\n\n// -----------------------------------------------------------------------------\n// Internal layout / visual constants (SCSS only)\n// -----------------------------------------------------------------------------\n$login-linklist-heading-font-weight: 500;\n$login-linklist-heading-font-size: 1.6rem;\n$login-linklist-heading-margin-bottom: 2.4rem;\n\n$login-linklist-strong-margin-bottom: 2.4rem;\n\n$login-linklist-list-item-margin-bottom: 2.4rem;\n\n$login-linklist-link-font-size: 1.6rem;\n$login-linklist-link-line-height: 1.5;\n$login-linklist-link-font-weight: 500;\n\n$login-linklist-icon-padding-left: 0.8rem;\n\n// -----------------------------------------------------------------------------\n// Component token defaults (CSS vars - only real override surface)\n// -----------------------------------------------------------------------------\npn-marketweb-siteheader-login-linklist {\n --login-linklist-heading-color: var(--siteheader-login-linklist-heading-color, inherit);\n\n --login-linklist-link-color: var(--siteheader-login-linklist-link-color, #{$blue700});\n --login-linklist-link-hover-color: var(--siteheader-login-linklist-link-hover-color, #{$blue900});\n\n --login-linklist-button-link-color: var(--siteheader-login-linklist-button-link-color, #{$white});\n\n --login-linklist-icon-color: var(--siteheader-login-linklist-icon-color, #{$blue700});\n --login-linklist-icon-hover-color: var(--siteheader-login-linklist-icon-hover-color, #{$blue900});\n}\n\n// -----------------------------------------------------------------------------\n// Host shell / layout\n// -----------------------------------------------------------------------------\npn-marketweb-siteheader-login-linklist {\n display: flex;\n flex-direction: column;\n}\n\n// -----------------------------------------------------------------------------\n// Heading\n// -----------------------------------------------------------------------------\n.pn-marketweb-siteheader-login-linklist-heading {\n font-weight: $login-linklist-heading-font-weight;\n font-size: $login-linklist-heading-font-size;\n margin-bottom: $login-linklist-heading-margin-bottom;\n color: var(--login-linklist-heading-color);\n}\n\npn-marketweb-siteheader-login-linklist strong {\n margin-bottom: $login-linklist-strong-margin-bottom;\n}\n\n// -----------------------------------------------------------------------------\n// List structure\n// -----------------------------------------------------------------------------\npn-marketweb-siteheader-login-linklist ul {\n list-style-type: none;\n padding: 0;\n margin: 0;\n}\n\npn-marketweb-siteheader-login-linklist ul>li {\n margin-bottom: $login-linklist-list-item-margin-bottom;\n}\n\n// -----------------------------------------------------------------------------\n// Links\n// -----------------------------------------------------------------------------\npn-marketweb-siteheader-login-linklist ul>li a {\n text-decoration: none;\n font-size: $login-linklist-link-font-size;\n line-height: $login-linklist-link-line-height;\n font-weight: $login-linklist-link-font-weight;\n\n &:hover {\n color:var(--login-linklist-button-link-color);\n }\n}\n\npn-marketweb-siteheader-login-linklist ul>li a:not(.pn-button) {\n color: var(--login-linklist-link-color);\n}\n\npn-marketweb-siteheader-login-linklist ul>li:hover a:not(.pn-button) {\n color: var(--login-linklist-link-hover-color);\n text-decoration: underline;\n}\n\n// -----------------------------------------------------------------------------\n// Icons\n// -----------------------------------------------------------------------------\npn-marketweb-siteheader-login-linklist ul>li pn-icon {\n padding-left: $login-linklist-icon-padding-left;\n\n svg>path {\n fill: var(--login-linklist-icon-color) !important;\n }\n}\n\npn-marketweb-siteheader-login-linklist ul>li:hover pn-icon {\n svg>path {\n fill: var(--login-linklist-icon-hover-color) !important;\n }\n}","import { Component, Element, h, Host, Prop } from '@stencil/core';\n\nimport { state as headerState } from './pn-marketweb-siteheader-store';\nimport { LoginDialogLink } from './pn-marketweb-siteheader-types';\nimport { arrow_right, transfer } from 'pn-design-assets/pn-assets/icons.js';\n\n@Component({\n tag: 'pn-marketweb-siteheader-login-linklist',\n styleUrl: 'pn-marketweb-siteheader-login-linklist.scss',\n})\nexport class PnMarketwebSiteheaderLoginLinklist {\n @Element() hostElement: HTMLElement;\n\n @Prop() heading: string = null;\n @Prop() links: LoginDialogLink[] = [];\n @Prop() idNamespace: string = '';\n @Prop() showUnifiedLogin: boolean = false;\n\n componentWillLoad() {}\n\n uniqueId(text: string) {\n return 'loginlink-' + text.replace(/[^A-Za-z0-9.\\\\\\/]/gim, '') + '-' + this.idNamespace;\n }\n\n linkAppearanceAttributes(link) {\n let attributes = {};\n if (link.linkType) {\n switch (link.linkType) {\n case 'primary':\n attributes = {\n appearance: '',\n variant: '',\n };\n break;\n case 'secondary':\n attributes = {\n appearance: 'light',\n variant: 'outlined',\n };\n break;\n case 'regularlink':\n default:\n attributes = {\n appearance: 'light',\n variant: 'borderless',\n icon: arrow_right,\n };\n break;\n }\n return attributes;\n }\n if (!link.linkType) {\n attributes = {\n appearance: link.primaryLinkApperance ? 'dark' : 'light',\n };\n }\n return attributes;\n }\n\n renderListAsButtons(link) {\n return (\n <li>\n <pn-button\n href={link.href}\n id={this.uniqueId(link.linkText)}\n {...(link.openInNewWindow && { target: '_blank' })}\n {...this.linkAppearanceAttributes(link)}\n onClick={() => {\n if (link.isLogoutLink) {\n headerState.loginManager.clearUserData();\n }\n }}\n >\n {link.linkText}\n </pn-button>\n </li>\n );\n }\n\n renderListAsLinks(link) {\n return (\n <li>\n <a\n href={link.href}\n id={this.uniqueId(link.linkText)}\n {...(link.openInNewWindow && { target: '_blank' })}\n onClick={() => {\n if (link.isLogoutLink) {\n headerState.loginManager.clearUserData();\n }\n }}\n >\n {link.linkText}\n {link.isLogoutLink ? <pn-icon icon={transfer}></pn-icon> : <pn-icon icon={arrow_right}></pn-icon>}\n </a>\n </li>\n );\n }\n\n render() {\n if (!this.links || this.links.length === 0) {\n return;\n }\n return (\n <Host>\n {this.heading ? <p class=\"pn-marketweb-siteheader-login-linklist-heading\">{this.heading}</p> : null}\n <ul>\n {this.links.map(link => {\n {\n return this.showUnifiedLogin ? this.renderListAsLinks(link) : this.renderListAsButtons(link);\n }\n })}\n </ul>\n </Host>\n );\n }\n}\n"],"version":3}
@@ -1,8 +1,8 @@
1
1
  import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
2
- import { s as state, d as defineCustomElement$1 } from './pn-marketweb-siteheader-login-linklist2.js';
2
+ import { s as state, t as transfer, d as defineCustomElement$1 } from './pn-marketweb-siteheader-login-linklist2.js';
3
3
  import { a as arrow_right } from './arrow_right.js';
4
4
 
5
- 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}";
5
+ 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-profileoption-link{display:flex;align-items:flex-start;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{padding-right:0.5rem}.pn-marketweb-siteheader-login-profileselection-profileoption-content pn-icon{margin-left:0.5rem}.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%}.pn-marketweb-siteheader-login-profileselection-logout::before{display:block;content:\"\";width:100%;height:2px;margin:1.5rem 0;background:var(--login-dropdown-divider-background)}.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}";
6
6
  const PnMarketwebSiteheaderLoginProfileselectionStyle0 = pnMarketwebSiteheaderLoginProfileselectionCss;
7
7
 
8
8
  const PnMarketwebSiteheaderLoginProfileselection = /*@__PURE__*/ proxyCustomElement(class PnMarketwebSiteheaderLoginProfileselection extends HTMLElement {
@@ -200,12 +200,12 @@ const PnMarketwebSiteheaderLoginProfileselection = /*@__PURE__*/ proxyCustomElem
200
200
  return;
201
201
  }
202
202
  let hostElementAttribute = {};
203
- return (h(Host, { ...hostElementAttribute }, this.heading ? h("strong", { class: "pn-marketweb-siteheader-login-profileselection-heading" }, this.heading) : null, this.currentProfile !== null && this.currentProfile.name ? (h("div", { class: "pn-marketweb-siteheader-login-profileselection-currentprofile" }, h("div", { class: "pn-marketweb-siteheader-login-profileselection-currentprofile-name" }, this.currentProfile.name), h("div", { class: "pn-marketweb-siteheader-login-profileselection-currentprofile-description" }, this.currentProfile.customerNumber ? this.currentProfile.customerNumber : this.userEmail))) : null, h("pn-marketweb-siteheader-login-linklist", { links: this.filterLogoutLink(this.loginDialog.loggedInLinks), idNamespace: this.idNamespace }), h("div", { class: "pn-marketweb-siteheader-login-profileselection-divider" }), this.profileoptions
203
+ return (h(Host, { ...hostElementAttribute }, this.heading ? h("strong", { class: "pn-marketweb-siteheader-login-profileselection-heading" }, this.heading) : null, this.currentProfile !== null && this.currentProfile.name ? (h("div", { class: "pn-marketweb-siteheader-login-profileselection-currentprofile" }, h("div", { class: "pn-marketweb-siteheader-login-profileselection-currentprofile-name" }, this.currentProfile.name), h("div", { class: "pn-marketweb-siteheader-login-profileselection-currentprofile-description" }, this.currentProfile.customerNumber ? this.currentProfile.customerNumber : this.userEmail))) : null, h("pn-marketweb-siteheader-login-linklist", { links: this.filterLogoutLink(this.loginDialog.loggedInLinks), idNamespace: this.idNamespace }), this.profileoptions
204
204
  .filter(x => x.selected !== true)
205
205
  .map(organization => {
206
206
  let customerNumber = organization.profiles.length > 0 ? organization.profiles[0].customerNumber : organization.customerNumber;
207
- return (h("div", { class: "pn-marketweb-siteheader-login-profileselection-profileoption" }, h("a", { href: `${this.endpoint}/api/user/setprofile?customernumber=${customerNumber}&returnUrl=${encodeURIComponent(window.location.href)}`, class: "pn-marketweb-siteheader-login-profileselection-profileoption-link" }, h("div", { class: "pn-marketweb-siteheader-login-profileselection-profileoption-content" }, h("div", { class: "pn-marketweb-siteheader-login-profileselection-profileoption-name" }, organization.name), h("div", { class: "pn-marketweb-siteheader-login-profileselection-profileoption-description" }, organization.customerNumber ? organization.customerNumber : this.userEmail)), h("pn-icon", { icon: arrow_right, small: "false", color: "blue700" }))));
208
- }), this.logoutLink ? (h("div", { class: "pn-marketweb-siteheader-login-profileselection-logout" }, h("a", { href: this.logoutLink.href, rel: "nofollower noopener", id: "pn-marketweb-header-logoutlink", onClick: () => state.loginManager.clearUserData(), class: "pn-marketweb-siteheader-login-profileselection-logout-link" }, this.logoutLink.linkText))) : null));
207
+ return (h("div", { class: "pn-marketweb-siteheader-login-profileselection-profileoption" }, h("a", { href: `${this.endpoint}/api/user/setprofile?customernumber=${customerNumber}&returnUrl=${encodeURIComponent(window.location.href)}`, class: "pn-marketweb-siteheader-login-profileselection-profileoption-link" }, h("div", { class: "pn-marketweb-siteheader-login-profileselection-profileoption-content" }, h("div", { class: "pn-marketweb-siteheader-login-profileselection-profileoption-name" }, organization.name, h("pn-icon", { icon: arrow_right, small: "false", color: "blue700" })), h("div", { class: "pn-marketweb-siteheader-login-profileselection-profileoption-description" }, organization.customerNumber ? organization.customerNumber : this.userEmail)))));
208
+ }), this.logoutLink ? (h("div", { class: "pn-marketweb-siteheader-login-profileselection-logout" }, h("pn-text-link", { href: this.logoutLink.href, rel: "nofollower noopener", id: "pn-marketweb-header-logoutlink", onClick: () => state.loginManager.clearUserData(), class: "pn-marketweb-siteheader-login-profileselection-logout-link", icon: transfer, label: this.logoutLink.linkText }))) : null));
209
209
  }
210
210
  static get style() { return PnMarketwebSiteheaderLoginProfileselectionStyle0; }
211
211
  }, [0, "pn-marketweb-siteheader-login-profileselection", {
@@ -1 +1 @@
1
- {"file":"pn-marketweb-siteheader-login-profileselection2.js","mappings":";;;;AAAA,MAAM,6CAA6C,GAAG,wkIAAwkI,CAAC;AAC/nI,yDAAe,6CAA6C;;MCU/C,0CAA0C;;;;2BAID,IAAI;wBAC7B,EAAE;wBACD,KAAK;2BACH,EAAE;uBACN,IAAI;oBACC;YAC7B,WAAW,EAAE,EAAE;YACf,iBAAiB,EAAE,EAAE;YACrB,gBAAgB,EAAE,EAAE;YACpB,cAAc,EAAE,EAAE;YAClB,gBAAgB,EAAE,EAAE;YACpB,cAAc,EAAE,EAAE;YAClB,eAAe,EAAE,EAAE;YACnB,6BAA6B,EAAE,EAAE;SAChB;oBAEQ,IAAI;0BAEQ,IAAI;wBACf,IAAI;yBACH,EAAE;8BAEwC,IAAI;8BACF,EAAE;;;IAE3E,iBAAiB;QACf,IAAI,IAAI,CAAC,OA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,EAAE,IAAI,CAAC,UAAU,CAAC,IAAI,EAC1B,GAAG,EAAC,qBAAqB,EACzB,EAAE,EAAC,gCAAgC,EACnC,OAAO,EAAE,MAAMA,KAAW,CAAC,YAAY,CAAC,aAAa,EAAE,EACvD,KAAK,EAAC,4DAA4D,IAEjE,IAAI,CAAC,UAAU,CAAC,QAAQ,CACvB,CACA,IACJ,IAAI,CACH,EACP;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["headerState"],"sources":["src/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-profileselection.scss?tag=pn-marketweb-siteheader-login-profileselection","src/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-profileselection.tsx"],"sourcesContent":["@import '../../../globals/main.scss';\n@import './pn-marketweb-siteheader-common.scss';\n\n// -----------------------------------------------------------------------------\n// Internal layout / visual constants (SCSS only)\n// -----------------------------------------------------------------------------\n$login-profileselection-description-font-weight: 400;\n$login-profileselection-description-font-size: 0.75em;\n\n$login-profileselection-divider-dot-size: 0.6em;\n$login-profileselection-divider-dot-offset: 0.2em;\n\n$login-profileselection-profileoption-link-padding: 0.6rem 1.6rem;\n$login-profileselection-profileoption-link-transition: background 0.15s ease-in-out;\n\n// -----------------------------------------------------------------------------\n// Component token defaults (CSS vars - only real override surface)\n// -----------------------------------------------------------------------------\npn-marketweb-siteheader-login-profileselection {\n --login-profileselection-heading-color: var(--siteheader-login-profileselection-heading-color,\n inherit);\n --login-profileselection-description-color: var(--siteheader-login-profileselection-description-color,\n #{$gray700});\n --login-profileselection-user-name-color: var(--siteheader-login-profileselection-user-name-color,\n inherit);\n --login-profileselection-divider-background: var(--siteheader-login-profileselection-divider-background,\n #{$blue400});\n --login-profileselection-profileoption-link-background: var(--siteheader-login-profileselection-profileoption-link-background,\n #{$white});\n --login-profileselection-profileoption-link-color: var(--siteheader-login-profileselection-profileoption-link-color,\n #{$blue700});\n --login-profileselection-profileoption-link-hover-background: var(--siteheader-login-profileselection-profileoption-link-hover-background,\n #{$gray50});\n --login-profileselection-logout-link-color: var(--siteheader-login-profileselection-logout-link-color,\n #{$blue700});\n}\n\n// -----------------------------------------------------------------------------\n// Heading\n// -----------------------------------------------------------------------------\n.pn-marketweb-siteheader-login-profileselection-heading {\n display: block;\n padding: 0.5rem 0 1rem;\n color:var(--login-profileselection-heading-color);\n}\n\n// -----------------------------------------------------------------------------\n// User / current profile sections\n// -----------------------------------------------------------------------------\n.pn-marketweb-siteheader-login-profileselection-user,\n.pn-marketweb-siteheader-login-profileselection-currentprofile {\n margin-top: 1rem;\n margin-bottom: 1rem;\n}\n\n.pn-marketweb-siteheader-login-profileselection-user-name,\n.pn-marketweb-siteheader-login-profileselection-currentprofile-name {\n line-height: 1;\n color: var(--login-profileselection-user-name-color);\n}\n\n.pn-marketweb-siteheader-login-profileselection-user-description,\n.pn-marketweb-siteheader-login-profileselection-currentprofile-description {\n font-weight: $login-profileselection-description-font-weight;\n white-space: normal;\n word-break: break-all;\n color: var(--login-profileselection-description-color);\n font-size: $login-profileselection-description-font-size;\n}\n\n// -----------------------------------------------------------------------------\n// Divider\n// -----------------------------------------------------------------------------\n.pn-marketweb-siteheader-login-profileselection-divider {\n position: relative;\n width: 100%;\n height: 1rem;\n background: var(--login-profileselection-divider-background);\n\n margin-left: -1em; // Negative positioning due to nav dropdown's padding\n margin-top: 1.6rem;\n margin-bottom: 1.6rem;\n border-radius: 0 0.6em 0.6em 0;\n padding: 0;\n\n &::after {\n content: '';\n position: absolute;\n right: 0;\n top: 0;\n width: $login-profileselection-divider-dot-size;\n height: $login-profileselection-divider-dot-size;\n border-radius: 50%;\n background: inherit;\n transform: translateX(calc(100% + #{$login-profileselection-divider-dot-offset}));\n }\n}\n\n// -----------------------------------------------------------------------------\n// Profile options\n// -----------------------------------------------------------------------------\n.pn-marketweb-siteheader-login-profileselection-profileoption-link {\n display: flex;\n align-items: center;\n margin: 0 -1em; // Negative margin due to dropdown content padding\n padding: $login-profileselection-profileoption-link-padding;\n background: var(--login-profileselection-profileoption-link-background);\n color: var(--login-profileselection-profileoption-link-color);\n text-decoration: none;\n transition: $login-profileselection-profileoption-link-transition;\n\n &:hover,\n &:focus,\n &:active {\n background: var(--login-profileselection-profileoption-link-hover-background);\n }\n}\n\n.pn-marketweb-siteheader-login-profileselection-profileoption-content {\n flex-grow: 1;\n}\n\n.pn-marketweb-siteheader-login-profileselection-profileoption-name {\n font-weight: 700;\n}\n\n.pn-marketweb-siteheader-login-profileselection-profileoption-description {\n font-weight: $login-profileselection-description-font-weight;\n white-space: normal;\n word-break: break-all;\n color: var(--login-profileselection-description-color);\n font-size: $login-profileselection-description-font-size;\n}\n\n// -----------------------------------------------------------------------------\n// Logout\n// -----------------------------------------------------------------------------\n.pn-marketweb-siteheader-login-profileselection-logout {\n width: 100%;\n padding: 1.6rem;\n text-align: center;\n}\n\n.pn-marketweb-siteheader-login-profileselection-logout-link {\n display: inline-block;\n font-weight: 500;\n color: var(--login-profileselection-logout-link-color);\n text-decoration: none;\n\n &:hover,\n &:focus,\n &:active {\n text-decoration: underline;\n }\n}","import { Component, Element, h, Host, Prop, State } from '@stencil/core';\n\nimport { IUserInfo } from '../../../globals/MarketWebLoginManager';\nimport { state as headerState } from './pn-marketweb-siteheader-store';\nimport { LoginDialog, LoginDialogLink, ProfileSelectorCustomerItem, ProfileSelectorOrganization, SiteHeaderI18N } from './pn-marketweb-siteheader-types';\nimport { arrow_right } from 'pn-design-assets/pn-assets/icons.js';\n\n@Component({\n tag: 'pn-marketweb-siteheader-login-profileselection',\n styleUrl: 'pn-marketweb-siteheader-login-profileselection.scss',\n})\nexport class PnMarketwebSiteheaderLoginProfileselection {\n @Element() hostElement: HTMLElement;\n\n // Login dialog\n @Prop({ mutable: true }) loginDialog: LoginDialog = null;\n @Prop() endpoint: string = '';\n @Prop() loggedin: boolean = false;\n @Prop() idNamespace: string = '';\n @Prop() heading: string = null;\n @Prop() i18n: SiteHeaderI18N = {\n searchlabel: '',\n searchplaceholder: '',\n searchbuttontext: '',\n menuHomeButton: '',\n menuGoBackButton: '',\n mainMenuButton: '',\n menuStartButton: '',\n profileSelectionFlyoutHeading: '',\n } as SiteHeaderI18N;\n\n @State() user: IUserInfo = null;\n\n @State() logoutLink: LoginDialogLink = null;\n @State() userName: string = null;\n @State() userEmail: string = '';\n\n @Prop({ mutable: true }) currentProfile: ProfileSelectorCustomerItem = null;\n @Prop({ mutable: true }) profileoptions: ProfileSelectorOrganization[] = [];\n\n componentWillLoad() {\n if (this.heading === null && this.i18n?.profileSelectionFlyoutHeading) {\n this.heading = this.i18n.profileSelectionFlyoutHeading;\n }\n this.init();\n }\n\n init() {\n this.updateUserInfo();\n this.adjustLoginLinks();\n this.fetchProfiles();\n }\n async fetchProfiles() {\n if (!this.loggedin || this.profileoptions.length > 0) {\n return;\n }\n let apiUrl = `${this.endpoint}${this.endpoint.lastIndexOf('/') > -1 && this.endpoint.lastIndexOf('/') === this.endpoint.length - 1 ? '' : '/'}api/user/parentorganizations`;\n const req = await fetch(apiUrl);\n const reqdata = await req.json();\n const fallbackData = {\n loggedin: true,\n organizations: [\n {\n name: 'Forsheda Livs AB',\n customerNumber: '5564513603',\n id: 'dbba867d-1dff-3dbb-b420-c57b4b828b73',\n selected: true,\n profiles: [\n {\n name: 'Forsheda Livs AB',\n customerNumber: '20685482',\n id: 'f757ba28-9a73-15a2-f128-4b394d970f3f',\n ssid: '',\n selected: false,\n customerGroup: 'Business',\n },\n {\n name: 'ICA MAXI KUNGSBACKA',\n customerNumber: '20831191',\n id: '5aea41df-32b0-3f7e-2946-78598360177d',\n ssid: '259686',\n selected: true,\n customerGroup: 'Agent',\n },\n ],\n },\n {\n name: 'Hem Livs i Kungsbacka AB',\n customerNumber: '5565271250',\n id: '97ca363c-40ef-cca9-7a3c-9e7f025567c2',\n selected: false,\n profiles: [\n {\n name: 'ICA KVANTUM KUNGSBACKA',\n customerNumber: '20831193',\n id: 'fbd61ffd-41c6-2206-b88e-cfef91e1dc39',\n ssid: '259691',\n selected: false,\n customerGroup: 'Agent',\n },\n ],\n },\n {\n name: 'ICA SUPERMARKET TORGET',\n customerNumber: '5568902679',\n id: '7cb76a94-e1a5-5f57-58fd-bc563851b28e',\n selected: false,\n profiles: [\n {\n name: 'ICA SUPERMARKET TORGET',\n customerNumber: '20831212',\n id: '3a2db017-b68f-6fa0-fe70-542c08cd97ce',\n ssid: '',\n selected: false,\n customerGroup: 'Agent',\n },\n ],\n },\n ],\n };\n const data = window.location.href.indexOf('localhost:6008') !== -1 ? fallbackData : reqdata;\n\n if (!data || !data.organizations || !data.organizations.length) {\n this.heading = \"\"; //this is to not get \"logged in as\" text when its private account\n return;\n }\n\n (data.organizations as ProfileSelectorOrganization[]).forEach(org => {\n if (org.selected === true && org.profiles) {\n const selectedProfile = org.profiles.filter(x => x.selected === true);\n if (selectedProfile && selectedProfile[0] && selectedProfile[0].customerGroup.toLocaleLowerCase() === 'agent' && selectedProfile[0].ssid) {\n org.customerNumber = selectedProfile[0].ssid;\n }\n } else {\n if (org.customerNumber.length === 10 && org.customerNumber.substring(0, 2) === '55') {\n org.customerNumber = org.customerNumber.substring(0, 6) + '-' + org.customerNumber.substring(6);\n }\n this.profileoptions.push(org);\n }\n });\n\n let currentProfileObj = data.organizations.filter(x => x.selected === true)[0];\n const userProfileOption = {\n name: this.userName,\n customerNumber: '',\n id: '',\n selected: !currentProfileObj,\n profiles: [],\n };\n if (!currentProfileObj) {\n currentProfileObj = userProfileOption;\n }\n\n if (currentProfileObj && currentProfileObj.name) {\n this.currentProfile = currentProfileObj;\n }\n this.profileoptions.push(userProfileOption);\n }\n adjustLoginLinks() {\n const adjustLink = (link, i) => {\n if (!link.isLogoutLink) {\n link.isLogoutLink = link.pageLink.indexOf('location.href') !== -1 && link.pageLink.indexOf('logout') !== -1;\n }\n if (link.isLogoutLink) {\n link.href = headerState.loginManager.getLogoutUrl(link.href);\n }\n\n if (i === 0 && !link.href) {\n link.href = headerState.loginManager.getLoginUrl();\n link.linkType = 'primary';\n }\n if (link.primaryLinkApperance && !link.linkType) {\n link.linkType = 'primary';\n }\n };\n\n if (this.loginDialog?.loggedInLinks) {\n this.loginDialog?.loggedInLinks.forEach(adjustLink);\n }\n\n this.logoutLink = this.loginDialog?.loggedInLinks.filter(x => x.isLogoutLink)[0] ?? null;\n }\n updateUserInfo() {\n const userInfo: IUserInfo = headerState.loginManager.getUserInfo();\n this.user = userInfo;\n if (!userInfo) {\n return;\n }\n if (userInfo && userInfo.email) {\n this.userEmail = userInfo.email;\n }\n if (userInfo && userInfo.given_name) {\n this.userName = userInfo.given_name + (userInfo?.family_name ? ` ${userInfo?.family_name}` : '');\n }\n if (userInfo && userInfo.given_name) {\n this.userName = userInfo.given_name;\n return;\n }\n if (userInfo && userInfo.family_name) {\n this.userName = userInfo.family_name;\n return;\n }\n if (userInfo && userInfo.username) {\n this.userName = userInfo.username;\n return;\n }\n }\n\n filterLogoutLink(loggedInLinks: LoginDialogLink[]): LoginDialogLink[] {\n return loggedInLinks.filter((link: LoginDialogLink) => !link.isLogoutLink);\n }\n\n render() {\n if (!this.loginDialog) {\n return;\n }\n\n let hostElementAttribute = {};\n return (\n <Host {...hostElementAttribute}>\n {this.heading ? <strong class=\"pn-marketweb-siteheader-login-profileselection-heading\">{this.heading}</strong> : null}\n {this.currentProfile !== null && this.currentProfile.name ? (\n <div class=\"pn-marketweb-siteheader-login-profileselection-currentprofile\">\n <div class=\"pn-marketweb-siteheader-login-profileselection-currentprofile-name\">{this.currentProfile.name}</div>\n <div class=\"pn-marketweb-siteheader-login-profileselection-currentprofile-description\">\n {this.currentProfile.customerNumber ? this.currentProfile.customerNumber : this.userEmail}\n </div>\n </div>\n ) : null}\n\n <pn-marketweb-siteheader-login-linklist\n links={this.filterLogoutLink(this.loginDialog.loggedInLinks)}\n idNamespace={this.idNamespace}\n ></pn-marketweb-siteheader-login-linklist>\n\n <div class=\"pn-marketweb-siteheader-login-profileselection-divider\"></div>\n {this.profileoptions\n .filter(x => x.selected !== true)\n .map(organization => {\n let customerNumber = organization.profiles.length > 0 ? organization.profiles[0].customerNumber : organization.customerNumber;\n return (\n <div class=\"pn-marketweb-siteheader-login-profileselection-profileoption\">\n {/* /api/user/setprofile? profile=xxxxx */}\n <a\n href={`${this.endpoint}/api/user/setprofile?customernumber=${customerNumber}&returnUrl=${encodeURIComponent(window.location.href)}`}\n class=\"pn-marketweb-siteheader-login-profileselection-profileoption-link\"\n >\n <div class=\"pn-marketweb-siteheader-login-profileselection-profileoption-content\">\n <div class=\"pn-marketweb-siteheader-login-profileselection-profileoption-name\">{organization.name}</div>\n <div class=\"pn-marketweb-siteheader-login-profileselection-profileoption-description\">\n {organization.customerNumber ? organization.customerNumber : this.userEmail}\n </div>\n </div>\n <pn-icon icon={arrow_right} small=\"false\" color=\"blue700\"></pn-icon>\n </a>\n </div>\n );\n })}\n\n {this.logoutLink ? (\n <div class=\"pn-marketweb-siteheader-login-profileselection-logout\">\n {/* https://se-inte.postnord.com/UnifiedLogin/ExternalLoginCallback?returnUrl=https://se-inte.postnord.com/handla-online&profile=770e785b-702b-dc22-b1e9-4839eded4f83 */}\n <a\n href={this.logoutLink.href}\n rel=\"nofollower noopener\"\n id=\"pn-marketweb-header-logoutlink\"\n onClick={() => headerState.loginManager.clearUserData()}\n class=\"pn-marketweb-siteheader-login-profileselection-logout-link\"\n >\n {this.logoutLink.linkText}\n </a>\n </div>\n ) : null}\n </Host>\n );\n }\n}\n"],"version":3}
1
+ {"file":"pn-marketweb-siteheader-login-profileselection2.js","mappings":";;;;AAAA,MAAM,6CAA6C,GAAG,y3HAAy3H,CAAC;AACh7H,yDAAe,6CAA6C;;MCU/C,0CAA0C;;;;2BAID,IAAI;wBAC7B,EAAE;wBACD,KAAK;2BACH,EAAE;uBACN,IAAI;oBACC;YAC7B,WAAW,EAAE,EAAE;YACf,iBAAiB,EAAE,EAAE;YACrB,gBAAgB,EAAE,EAAE;YACpB,cAAc,EAAE,EAAE;YAClB,gBAAgB,EAAE,EAAE;YACpB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c,GAAG,YAAY,CAAC,cAAc,GAAG,IAAI,CAAC,SAAS,CACvE,CACF,CACJ,CACA,EACN;SACH,CAAC,EAEH,IAAI,CAAC,UAAU,IACd,WAAK,KAAK,EAAC,uDAAuD,IAEhE,oBACE,IAAI,EAAE,IAAI,CAAC,UAAU,CAAC,IAAI,EAC1B,GAAG,EAAC,qBAAqB,EACzB,EAAE,EAAC,gCAAgC,EACnC,OAAO,EAAE,MAAMA,KAAW,CAAC,YAAY,CAAC,aAAa,EAAE,EACvD,KAAK,EAAC,4DAA4D,EAClE,IAAI,EAAE,QAAQ,EACd,KAAK,EAAE,IAAI,CAAC,UAAU,CAAC,QAAQ,GAElB,CACX,IACJ,IAAI,CACH,EACP;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["headerState"],"sources":["src/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-profileselection.scss?tag=pn-marketweb-siteheader-login-profileselection","src/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-profileselection.tsx"],"sourcesContent":["@import '../../../globals/main.scss';\n@import './pn-marketweb-siteheader-common.scss';\n\n// -----------------------------------------------------------------------------\n// Internal layout / visual constants (SCSS only)\n// -----------------------------------------------------------------------------\n$login-profileselection-description-font-weight: 400;\n$login-profileselection-description-font-size: 0.75em;\n\n$login-profileselection-divider-dot-size: 0.6em;\n$login-profileselection-divider-dot-offset: 0.2em;\n\n$login-profileselection-profileoption-link-padding: 0.6rem 1.6rem;\n$login-profileselection-profileoption-link-transition: background 0.15s ease-in-out;\n\n// -----------------------------------------------------------------------------\n// Component token defaults (CSS vars - only real override surface)\n// -----------------------------------------------------------------------------\npn-marketweb-siteheader-login-profileselection {\n --login-profileselection-heading-color: var(--siteheader-login-profileselection-heading-color,\n inherit);\n --login-profileselection-description-color: var(--siteheader-login-profileselection-description-color,\n #{$gray700});\n --login-profileselection-user-name-color: var(--siteheader-login-profileselection-user-name-color,\n inherit);\n --login-profileselection-divider-background: var(--siteheader-login-profileselection-divider-background,\n #{$blue400});\n --login-profileselection-profileoption-link-background: var(--siteheader-login-profileselection-profileoption-link-background,\n #{$white});\n --login-profileselection-profileoption-link-color: var(--siteheader-login-profileselection-profileoption-link-color,\n #{$blue700});\n --login-profileselection-profileoption-link-hover-background: var(--siteheader-login-profileselection-profileoption-link-hover-background,\n #{$gray50});\n --login-profileselection-logout-link-color: var(--siteheader-login-profileselection-logout-link-color,\n #{$blue700});\n}\n\n// -----------------------------------------------------------------------------\n// Heading\n// -----------------------------------------------------------------------------\n.pn-marketweb-siteheader-login-profileselection-heading {\n display: block;\n padding: 0.5rem 0 1rem;\n color:var(--login-profileselection-heading-color);\n}\n\n// -----------------------------------------------------------------------------\n// User / current profile sections\n// -----------------------------------------------------------------------------\n.pn-marketweb-siteheader-login-profileselection-user,\n.pn-marketweb-siteheader-login-profileselection-currentprofile {\n margin-top: 1rem;\n margin-bottom: 1rem;\n}\n\n.pn-marketweb-siteheader-login-profileselection-user-name,\n.pn-marketweb-siteheader-login-profileselection-currentprofile-name {\n line-height: 1;\n color: var(--login-profileselection-user-name-color);\n}\n\n.pn-marketweb-siteheader-login-profileselection-user-description,\n.pn-marketweb-siteheader-login-profileselection-currentprofile-description {\n font-weight: $login-profileselection-description-font-weight;\n white-space: normal;\n word-break: break-all;\n color: var(--login-profileselection-description-color);\n font-size: $login-profileselection-description-font-size;\n}\n\n// -----------------------------------------------------------------------------\n// Profile options\n// -----------------------------------------------------------------------------\n.pn-marketweb-siteheader-login-profileselection-profileoption-link {\n display: flex;\n align-items: flex-start;\n margin: 0 -1em; // Negative margin due to dropdown content padding\n padding: $login-profileselection-profileoption-link-padding;\n background: var(--login-profileselection-profileoption-link-background);\n color: var(--login-profileselection-profileoption-link-color);\n text-decoration: none;\n transition: $login-profileselection-profileoption-link-transition;\n\n &:hover,\n &:focus,\n &:active {\n background: var(--login-profileselection-profileoption-link-hover-background);\n }\n}\n\n.pn-marketweb-siteheader-login-profileselection-profileoption-content {\n padding-right: 0.5rem;\n\n pn-icon {\n margin-left: 0.5rem;\n }\n}\n\n.pn-marketweb-siteheader-login-profileselection-profileoption-name {\n font-weight: 700;\n}\n\n.pn-marketweb-siteheader-login-profileselection-profileoption-description {\n font-weight: $login-profileselection-description-font-weight;\n white-space: normal;\n word-break: break-all;\n color: var(--login-profileselection-description-color);\n font-size: $login-profileselection-description-font-size;\n}\n\n// -----------------------------------------------------------------------------\n// Logout\n// -----------------------------------------------------------------------------\n.pn-marketweb-siteheader-login-profileselection-logout {\n width: 100%;\n\n &::before {\n display: block;\n content: \"\";\n width: 100%;\n height: 2px;\n margin: 1.5rem 0;\n background: var(--login-dropdown-divider-background);\n }\n}\n\n.pn-marketweb-siteheader-login-profileselection-logout-link {\n display: inline-block;\n font-weight: 500;\n color: var(--login-profileselection-logout-link-color);\n text-decoration: none;\n\n &:hover,\n &:focus,\n &:active {\n text-decoration: underline;\n }\n}","import { Component, Element, h, Host, Prop, State } from '@stencil/core';\n\nimport { IUserInfo } from '../../../globals/MarketWebLoginManager';\nimport { state as headerState } from './pn-marketweb-siteheader-store';\nimport { LoginDialog, LoginDialogLink, ProfileSelectorCustomerItem, ProfileSelectorOrganization, SiteHeaderI18N } from './pn-marketweb-siteheader-types';\nimport { arrow_right, transfer } from 'pn-design-assets/pn-assets/icons.js';\n\n@Component({\n tag: 'pn-marketweb-siteheader-login-profileselection',\n styleUrl: 'pn-marketweb-siteheader-login-profileselection.scss',\n})\nexport class PnMarketwebSiteheaderLoginProfileselection {\n @Element() hostElement: HTMLElement;\n\n // Login dialog\n @Prop({ mutable: true }) loginDialog: LoginDialog = null;\n @Prop() endpoint: string = '';\n @Prop() loggedin: boolean = false;\n @Prop() idNamespace: string = '';\n @Prop() heading: string = null;\n @Prop() i18n: SiteHeaderI18N = {\n searchlabel: '',\n searchplaceholder: '',\n searchbuttontext: '',\n menuHomeButton: '',\n menuGoBackButton: '',\n mainMenuButton: '',\n menuStartButton: '',\n profileSelectionFlyoutHeading: '',\n } as SiteHeaderI18N;\n\n @State() user: IUserInfo = null;\n\n @State() logoutLink: LoginDialogLink = null;\n @State() userName: string = null;\n @State() userEmail: string = '';\n\n @Prop({ mutable: true }) currentProfile: ProfileSelectorCustomerItem = null;\n @Prop({ mutable: true }) profileoptions: ProfileSelectorOrganization[] = [];\n\n componentWillLoad() {\n if (this.heading === null && this.i18n?.profileSelectionFlyoutHeading) {\n this.heading = this.i18n.profileSelectionFlyoutHeading;\n }\n this.init();\n }\n\n init() {\n this.updateUserInfo();\n this.adjustLoginLinks();\n this.fetchProfiles();\n }\n async fetchProfiles() {\n if (!this.loggedin || this.profileoptions.length > 0) {\n return;\n }\n let apiUrl = `${this.endpoint}${this.endpoint.lastIndexOf('/') > -1 && this.endpoint.lastIndexOf('/') === this.endpoint.length - 1 ? '' : '/'}api/user/parentorganizations`;\n const req = await fetch(apiUrl);\n const reqdata = await req.json();\n const fallbackData = {\n loggedin: true,\n organizations: [\n {\n name: 'Forsheda Livs AB',\n customerNumber: '5564513603',\n id: 'dbba867d-1dff-3dbb-b420-c57b4b828b73',\n selected: true,\n profiles: [\n {\n name: 'Forsheda Livs AB',\n customerNumber: '20685482',\n id: 'f757ba28-9a73-15a2-f128-4b394d970f3f',\n ssid: '',\n selected: false,\n customerGroup: 'Business',\n },\n {\n name: 'ICA MAXI KUNGSBACKA',\n customerNumber: '20831191',\n id: '5aea41df-32b0-3f7e-2946-78598360177d',\n ssid: '259686',\n selected: true,\n customerGroup: 'Agent',\n },\n ],\n },\n {\n name: 'Hem Livs i Kungsbacka AB',\n customerNumber: '5565271250',\n id: '97ca363c-40ef-cca9-7a3c-9e7f025567c2',\n selected: false,\n profiles: [\n {\n name: 'ICA KVANTUM KUNGSBACKA',\n customerNumber: '20831193',\n id: 'fbd61ffd-41c6-2206-b88e-cfef91e1dc39',\n ssid: '259691',\n selected: false,\n customerGroup: 'Agent',\n },\n ],\n },\n {\n name: 'ICA SUPERMARKET TORGET',\n customerNumber: '5568902679',\n id: '7cb76a94-e1a5-5f57-58fd-bc563851b28e',\n selected: false,\n profiles: [\n {\n name: 'ICA SUPERMARKET TORGET',\n customerNumber: '20831212',\n id: '3a2db017-b68f-6fa0-fe70-542c08cd97ce',\n ssid: '',\n selected: false,\n customerGroup: 'Agent',\n },\n ],\n },\n ],\n };\n const data = window.location.href.indexOf('localhost:6008') !== -1 ? fallbackData : reqdata;\n\n if (!data || !data.organizations || !data.organizations.length) {\n this.heading = \"\"; //this is to not get \"logged in as\" text when its private account\n return;\n }\n\n (data.organizations as ProfileSelectorOrganization[]).forEach(org => {\n if (org.selected === true && org.profiles) {\n const selectedProfile = org.profiles.filter(x => x.selected === true);\n if (selectedProfile && selectedProfile[0] && selectedProfile[0].customerGroup.toLocaleLowerCase() === 'agent' && selectedProfile[0].ssid) {\n org.customerNumber = selectedProfile[0].ssid;\n }\n } else {\n if (org.customerNumber.length === 10 && org.customerNumber.substring(0, 2) === '55') {\n org.customerNumber = org.customerNumber.substring(0, 6) + '-' + org.customerNumber.substring(6);\n }\n this.profileoptions.push(org);\n }\n });\n\n let currentProfileObj = data.organizations.filter(x => x.selected === true)[0];\n const userProfileOption = {\n name: this.userName,\n customerNumber: '',\n id: '',\n selected: !currentProfileObj,\n profiles: [],\n };\n if (!currentProfileObj) {\n currentProfileObj = userProfileOption;\n }\n\n if (currentProfileObj && currentProfileObj.name) {\n this.currentProfile = currentProfileObj;\n }\n this.profileoptions.push(userProfileOption);\n }\n adjustLoginLinks() {\n const adjustLink = (link, i) => {\n if (!link.isLogoutLink) {\n link.isLogoutLink = link.pageLink.indexOf('location.href') !== -1 && link.pageLink.indexOf('logout') !== -1;\n }\n if (link.isLogoutLink) {\n link.href = headerState.loginManager.getLogoutUrl(link.href);\n }\n\n if (i === 0 && !link.href) {\n link.href = headerState.loginManager.getLoginUrl();\n link.linkType = 'primary';\n }\n if (link.primaryLinkApperance && !link.linkType) {\n link.linkType = 'primary';\n }\n };\n\n if (this.loginDialog?.loggedInLinks) {\n this.loginDialog?.loggedInLinks.forEach(adjustLink);\n }\n\n this.logoutLink = this.loginDialog?.loggedInLinks.filter(x => x.isLogoutLink)[0] ?? null;\n }\n updateUserInfo() {\n const userInfo: IUserInfo = headerState.loginManager.getUserInfo();\n this.user = userInfo;\n if (!userInfo) {\n return;\n }\n if (userInfo && userInfo.email) {\n this.userEmail = userInfo.email;\n }\n if (userInfo && userInfo.given_name) {\n this.userName = userInfo.given_name + (userInfo?.family_name ? ` ${userInfo?.family_name}` : '');\n }\n if (userInfo && userInfo.given_name) {\n this.userName = userInfo.given_name;\n return;\n }\n if (userInfo && userInfo.family_name) {\n this.userName = userInfo.family_name;\n return;\n }\n if (userInfo && userInfo.username) {\n this.userName = userInfo.username;\n return;\n }\n }\n\n filterLogoutLink(loggedInLinks: LoginDialogLink[]): LoginDialogLink[] {\n return loggedInLinks.filter((link: LoginDialogLink) => !link.isLogoutLink);\n }\n\n render() {\n if (!this.loginDialog) {\n return;\n }\n\n let hostElementAttribute = {};\n return (\n <Host {...hostElementAttribute}>\n {this.heading ? <strong class=\"pn-marketweb-siteheader-login-profileselection-heading\">{this.heading}</strong> : null}\n {this.currentProfile !== null && this.currentProfile.name ? (\n <div class=\"pn-marketweb-siteheader-login-profileselection-currentprofile\">\n <div class=\"pn-marketweb-siteheader-login-profileselection-currentprofile-name\">{this.currentProfile.name}</div>\n <div class=\"pn-marketweb-siteheader-login-profileselection-currentprofile-description\">\n {this.currentProfile.customerNumber ? this.currentProfile.customerNumber : this.userEmail}\n </div>\n </div>\n ) : null}\n\n <pn-marketweb-siteheader-login-linklist\n links={this.filterLogoutLink(this.loginDialog.loggedInLinks)}\n idNamespace={this.idNamespace}\n ></pn-marketweb-siteheader-login-linklist>\n\n {this.profileoptions\n .filter(x => x.selected !== true)\n .map(organization => {\n let customerNumber = organization.profiles.length > 0 ? organization.profiles[0].customerNumber : organization.customerNumber;\n return (\n <div class=\"pn-marketweb-siteheader-login-profileselection-profileoption\">\n {/* /api/user/setprofile? profile=xxxxx */}\n <a\n href={`${this.endpoint}/api/user/setprofile?customernumber=${customerNumber}&returnUrl=${encodeURIComponent(window.location.href)}`}\n class=\"pn-marketweb-siteheader-login-profileselection-profileoption-link\">\n <div class=\"pn-marketweb-siteheader-login-profileselection-profileoption-content\">\n <div class=\"pn-marketweb-siteheader-login-profileselection-profileoption-name\">\n {organization.name}\n <pn-icon icon={arrow_right} small=\"false\" color=\"blue700\"></pn-icon>\n </div>\n <div class=\"pn-marketweb-siteheader-login-profileselection-profileoption-description\">\n {organization.customerNumber ? organization.customerNumber : this.userEmail}\n </div>\n </div>\n </a>\n </div>\n );\n })}\n\n {this.logoutLink ? (\n <div class=\"pn-marketweb-siteheader-login-profileselection-logout\">\n {/* https://se-inte.postnord.com/UnifiedLogin/ExternalLoginCallback?returnUrl=https://se-inte.postnord.com/handla-online&profile=770e785b-702b-dc22-b1e9-4839eded4f83 */}\n <pn-text-link\n href={this.logoutLink.href}\n rel=\"nofollower noopener\"\n id=\"pn-marketweb-header-logoutlink\"\n onClick={() => headerState.loginManager.clearUserData()}\n class=\"pn-marketweb-siteheader-login-profileselection-logout-link\"\n icon={transfer}\n label={this.logoutLink.linkText}\n >\n </pn-text-link>\n </div>\n ) : null}\n </Host>\n );\n }\n}\n"],"version":3}