@swisspost/internet-header 1.16.0 → 1.16.2
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.
- package/dist/cjs/focus-trap.cjs.entry.js +32 -50
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/{post-internet-header-72edf928.js → post-internet-header-a55dfcff.js} +2 -3
- package/dist/cjs/swisspost-internet-header.cjs.entry.js +1 -1
- package/dist/collection/components/post-internet-breadcrumbs/post-internet-breadcrumbs.js +2 -8
- package/dist/collection/components/post-internet-header/post-internet-header.js +22 -62
- package/dist/components/focus-trap2.js +32 -50
- package/dist/components/swisspost-internet-header.js +2 -3
- package/dist/docs.json +31 -120
- package/dist/esm/focus-trap.entry.js +32 -50
- package/dist/esm/index.js +1 -1
- package/dist/esm/{post-internet-header-25cbaecc.js → post-internet-header-af82bc5f.js} +2 -3
- package/dist/esm/swisspost-internet-header.entry.js +1 -1
- package/dist/esm-es5/focus-trap.entry.js +3 -3
- package/dist/esm-es5/index.js +1 -1
- package/dist/esm-es5/{post-internet-header-25cbaecc.js → post-internet-header-af82bc5f.js} +1 -1
- package/dist/esm-es5/swisspost-internet-header.entry.js +1 -1
- package/dist/swisspost-internet-header/index.esm.js +1 -1
- package/dist/swisspost-internet-header/{p-2ca95ddf.system.js → p-20543d6d.system.js} +1 -1
- package/dist/swisspost-internet-header/{p-c45a080c.system.entry.js → p-4d5bddc5.system.entry.js} +3 -3
- package/dist/swisspost-internet-header/{p-572ff7a8.js → p-5c93e1e9.js} +1 -1
- package/dist/swisspost-internet-header/p-695fe962.system.js +1 -1
- package/dist/swisspost-internet-header/{p-5a806d1a.system.js → p-7936d692.system.js} +1 -1
- package/dist/swisspost-internet-header/{p-935c52e3.entry.js → p-8de89a63.entry.js} +1 -1
- package/dist/swisspost-internet-header/p-944e8412.entry.js +11 -0
- package/dist/swisspost-internet-header/{p-df70d07e.system.entry.js → p-b8d92cc7.system.entry.js} +1 -1
- package/dist/swisspost-internet-header/swisspost-internet-header.esm.js +1 -1
- package/dist/types/components/post-internet-breadcrumbs/post-internet-breadcrumbs.d.ts +0 -2
- package/dist/types/components/post-internet-header/post-internet-header.d.ts +1 -16
- package/dist/types/components.d.ts +4 -37
- package/package.json +2 -2
- package/dist/swisspost-internet-header/p-085d38af.entry.js +0 -11
package/dist/swisspost-internet-header/{p-c45a080c.system.entry.js → p-4d5bddc5.system.entry.js}
RENAMED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
System.register(["./p-5600adca.system.js"],(function(r){"use strict";var e,n,t,i;return{setters:[function(r){e=r.r;n=r.h;t=r.H;i=r.g}],execute:function(){
|
|
2
2
|
/*!
|
|
3
|
-
* tabbable 6.
|
|
3
|
+
* tabbable 6.2.0
|
|
4
4
|
* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
|
|
5
5
|
*/
|
|
6
|
-
var u=["input:not([inert])
|
|
6
|
+
var u=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"];var a=u.join(",");var o=typeof Element==="undefined";var f=o?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector;var v=!o&&Element.prototype.getRootNode?function(r){var e;return r===null||r===void 0?void 0:(e=r.getRootNode)===null||e===void 0?void 0:e.call(r)}:function(r){return r===null||r===void 0?void 0:r.ownerDocument};var l=function r(e,n){var t;if(n===void 0){n=true}var i=e===null||e===void 0?void 0:(t=e.getAttribute)===null||t===void 0?void 0:t.call(e,"inert");var u=i===""||i==="true";var a=u||n&&e&&r(e.parentNode);return a};var c=function r(e){var n;var t=e===null||e===void 0?void 0:(n=e.getAttribute)===null||n===void 0?void 0:n.call(e,"contenteditable");return t===""||t==="true"};var s=function r(e,n,t){if(l(e)){return[]}var i=Array.prototype.slice.apply(e.querySelectorAll(a));if(n&&f.call(e,a)){i.unshift(e)}i=i.filter(t);return i};var d=function r(e,n,t){var i=[];var u=Array.from(e);while(u.length){var o=u.shift();if(l(o,false)){continue}if(o.tagName==="SLOT"){var v=o.assignedElements();var c=v.length?v:o.children;var s=r(c,true,t);if(t.flatten){i.push.apply(i,s)}else{i.push({scopeParent:o,candidates:s})}}else{var d=f.call(o,a);if(d&&t.filter(o)&&(n||!e.includes(o))){i.push(o)}var b=o.shadowRoot||typeof t.getShadowRoot==="function"&&t.getShadowRoot(o);var p=!l(b,false)&&(!t.shadowRootFilter||t.shadowRootFilter(o));if(b&&p){var h=r(b===true?o.children:b.children,true,t);if(t.flatten){i.push.apply(i,h)}else{i.push({scopeParent:o,candidates:h})}}else{u.unshift.apply(u,o.children)}}}return i};var b=function r(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))};var p=function r(e){if(!e){throw new Error("No node provided")}if(e.tabIndex<0){if((/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||c(e))&&!b(e)){return 0}}return e.tabIndex};var h=function r(e,n){var t=p(e);if(t<0&&n&&!b(e)){return 0}return t};var w=function r(e,n){return e.tabIndex===n.tabIndex?e.documentOrder-n.documentOrder:e.tabIndex-n.tabIndex};var y=function r(e){return e.tagName==="INPUT"};var m=function r(e){return y(e)&&e.type==="hidden"};var E=function r(e){var n=e.tagName==="DETAILS"&&Array.prototype.slice.apply(e.children).some((function(r){return r.tagName==="SUMMARY"}));return n};var T=function r(e,n){for(var t=0;t<e.length;t++){if(e[t].checked&&e[t].form===n){return e[t]}}};var O=function r(e){if(!e.name){return true}var n=e.form||v(e);var t=function r(e){return n.querySelectorAll('input[type="radio"][name="'+e+'"]')};var i;if(typeof window!=="undefined"&&typeof window.CSS!=="undefined"&&typeof window.CSS.escape==="function"){i=t(window.CSS.escape(e.name))}else{try{i=t(e.name)}catch(r){console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",r.message);return false}}var u=T(i,e.form);return!u||u===e};var g=function r(e){return y(e)&&e.type==="radio"};var N=function r(e){return g(e)&&!O(e)};var F=function r(e){var n;var t=e&&v(e);var i=(n=t)===null||n===void 0?void 0:n.host;var u=false;if(t&&t!==e){var a,o,f;u=!!((a=i)!==null&&a!==void 0&&(o=a.ownerDocument)!==null&&o!==void 0&&o.contains(i)||e!==null&&e!==void 0&&(f=e.ownerDocument)!==null&&f!==void 0&&f.contains(e));while(!u&&i){var l,c,s;t=v(i);i=(l=t)===null||l===void 0?void 0:l.host;u=!!((c=i)!==null&&c!==void 0&&(s=c.ownerDocument)!==null&&s!==void 0&&s.contains(i))}}return u};var k=function r(e){var n=e.getBoundingClientRect(),t=n.width,i=n.height;return t===0&&i===0};var S=function r(e,n){var t=n.displayCheck,i=n.getShadowRoot;if(getComputedStyle(e).visibility==="hidden"){return true}var u=f.call(e,"details>summary:first-of-type");var a=u?e.parentElement:e;if(f.call(a,"details:not([open]) *")){return true}if(!t||t==="full"||t==="legacy-full"){if(typeof i==="function"){var o=e;while(e){var l=e.parentElement;var c=v(e);if(l&&!l.shadowRoot&&i(l)===true){return k(e)}else if(e.assignedSlot){e=e.assignedSlot}else if(!l&&c!==e.ownerDocument){e=c.host}else{e=l}}e=o}if(F(e)){return!e.getClientRects().length}if(t!=="legacy-full"){return true}}else if(t==="non-zero-area"){return k(e)}return false};var j=function r(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName)){var n=e.parentElement;while(n){if(n.tagName==="FIELDSET"&&n.disabled){for(var t=0;t<n.children.length;t++){var i=n.children.item(t);if(i.tagName==="LEGEND"){return f.call(n,"fieldset[disabled] *")?true:!i.contains(e)}}return true}n=n.parentElement}}return false};var A=function r(e,n){if(n.disabled||l(n)||m(n)||S(n,e)||E(n)||j(n)){return false}return true};var D=function r(e,n){if(N(n)||p(n)<0||!A(e,n)){return false}return true};var I=function r(e){var n=parseInt(e.getAttribute("tabindex"),10);if(isNaN(n)||n>=0){return true}return false};var P=function r(e){var n=[];var t=[];e.forEach((function(e,i){var u=!!e.scopeParent;var a=u?e.scopeParent:e;var o=h(a,u);var f=u?r(e.candidates):a;if(o===0){u?n.push.apply(n,f):n.push(a)}else{t.push({documentOrder:i,tabIndex:o,item:e,isScope:u,content:f})}}));return t.sort(w).reduce((function(r,e){e.isScope?r.push.apply(r,e.content):r.push(e.content);return r}),[]).concat(n)};var x=function r(e,n){n=n||{};var t;if(n.getShadowRoot){t=d([e],n.includeContainer,{filter:D.bind(null,n),flatten:false,getShadowRoot:n.getShadowRoot,shadowRootFilter:I})}else{t=s(e,n.includeContainer,D.bind(null,n))}return P(t)};var C=function r(e,n){n=n||{};var t;if(n.getShadowRoot){t=d([e],n.includeContainer,{filter:A.bind(null,n),flatten:true,getShadowRoot:n.getShadowRoot})}else{t=s(e,n.includeContainer,A.bind(null,n))}return t};var R=function r(e,n){n=n||{};if(!e){throw new Error("No node provided")}if(f.call(e,a)===false){return false}return D(n,e)};var L=u.concat("iframe").join(",");var U=function r(e,n){n=n||{};if(!e){throw new Error("No node provided")}if(f.call(e,L)===false){return false}return A(n,e)};
|
|
7
7
|
/*!
|
|
8
8
|
* focus-trap 7.5.4
|
|
9
9
|
* @license MIT, https://github.com/focus-trap/focus-trap/blob/master/LICENSE
|
|
10
|
-
*/function B(r,e){var n=Object.keys(r);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(r);e&&(t=t.filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.push.apply(n,t)}return n}function M(r){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?B(Object(n),!0).forEach((function(e){V(r,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(n)):B(Object(n)).forEach((function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(n,e))}))}return r}function V(r,e,n){e=Y(e);if(e in r){Object.defineProperty(r,e,{value:n,enumerable:true,configurable:true,writable:true})}else{r[e]=n}return r}function G(r,e){if(typeof r!=="object"||r===null)return r;var n=r[Symbol.toPrimitive];if(n!==undefined){var t=n.call(r,e||"default");if(typeof t!=="object")return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function Y(r){var e=G(r,"string");return typeof e==="symbol"?e:String(e)}var K={activateTrap:function r(e,n){if(e.length>0){var t=e[e.length-1];if(t!==n){t.pause()}}var i=e.indexOf(n);if(i===-1){e.push(n)}else{e.splice(i,1);e.push(n)}},deactivateTrap:function r(e,n){var t=e.indexOf(n);if(t!==-1){e.splice(t,1)}if(e.length>0){e[e.length-1].unpause()}}};var $=function r(e){return e.tagName&&e.tagName.toLowerCase()==="input"&&typeof e.select==="function"};var z=function r(e){return(e===null||e===void 0?void 0:e.key)==="Escape"||(e===null||e===void 0?void 0:e.key)==="Esc"||(e===null||e===void 0?void 0:e.keyCode)===27};var X=function r(e){return(e===null||e===void 0?void 0:e.key)==="Tab"||(e===null||e===void 0?void 0:e.keyCode)===9};var _=function r(e){return X(e)&&!e.shiftKey};var q=function r(e){return X(e)&&e.shiftKey};var H=function r(e){return setTimeout(e,0)};var J=function r(e,n){var t=-1;e.every((function(r,e){if(n(r)){t=e;return false}return true}));return t};var Q=function r(e){for(var n=arguments.length,t=new Array(n>1?n-1:0),i=1;i<n;i++){t[i-1]=arguments[i]}return typeof e==="function"?e.apply(void 0,t):e};var W=function r(e){return e.target.shadowRoot&&typeof e.composedPath==="function"?e.composedPath()[0]:e.target};var Z=[];var rr=function r(e,n){var t=(n===null||n===void 0?void 0:n.document)||document;var i=(n===null||n===void 0?void 0:n.trapStack)||Z;var u=M({returnFocusOnDeactivate:true,escapeDeactivates:true,delayInitialFocus:true,isKeyForward:_,isKeyBackward:q},n);var a={containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:false,paused:false,delayInitialFocusTimer:undefined,recentNavEvent:undefined};var o;var f=function r(e,n,t){return e&&e[n]!==undefined?e[n]:u[t||n]};var v=function r(e,n){var t=typeof(n===null||n===void 0?void 0:n.composedPath)==="function"?n.composedPath():undefined;return a.containerGroups.findIndex((function(r){var n=r.container,i=r.tabbableNodes;return n.contains(e)||(t===null||t===void 0?void 0:t.includes(n))||i.find((function(r){return r===e}))}))};var l=function r(e){var n=u[e];if(typeof n==="function"){for(var i=arguments.length,a=new Array(i>1?i-1:0),o=1;o<i;o++){a[o-1]=arguments[o]}n=n.apply(void 0,a)}if(n===true){n=undefined}if(!n){if(n===undefined||n===false){return n}throw new Error("`".concat(e,"` was specified but was not a node, or did not return a node"))}var f=n;if(typeof n==="string"){f=t.querySelector(n);if(!f){throw new Error("`".concat(e,"` as selector refers to no known node"))}}return f};var c=function r(){var e=l("initialFocus");if(e===false){return false}if(e===undefined||!U(e,u.tabbableOptions)){if(v(t.activeElement)>=0){e=t.activeElement}else{var n=a.tabbableGroups[0];var i=n&&n.firstTabbableNode;e=i||l("fallbackFocus")}}if(!e){throw new Error("Your focus-trap needs to have at least one focusable element")}return e};var s=function r(){a.containerGroups=a.containers.map((function(r){var e=C(r,u.tabbableOptions);var n=x(r,u.tabbableOptions);var t=e.length>0?e[0]:undefined;var i=e.length>0?e[e.length-1]:undefined;var a=n.find((function(r){return R(r)}));var o=n.slice().reverse().find((function(r){return R(r)}));var f=!!e.find((function(r){return p(r)>0}));return{container:r,tabbableNodes:e,focusableNodes:n,posTabIndexesFound:f,firstTabbableNode:t,lastTabbableNode:i,firstDomTabbableNode:a,lastDomTabbableNode:o,nextTabbableNode:function r(t){var i=arguments.length>1&&arguments[1]!==undefined?arguments[1]:true;var u=e.indexOf(t);if(u<0){if(i){return n.slice(n.indexOf(t)+1).find((function(r){return R(r)}))}return n.slice(0,n.indexOf(t)).reverse().find((function(r){return R(r)}))}return e[u+(i?1:-1)]}}}));a.tabbableGroups=a.containerGroups.filter((function(r){return r.tabbableNodes.length>0}));if(a.tabbableGroups.length<=0&&!l("fallbackFocus")){throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times")}if(a.containerGroups.find((function(r){return r.posTabIndexesFound}))&&a.containerGroups.length>1){throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.")}};var d=function r(e){var n=e.activeElement;if(!n){return}if(n.shadowRoot&&n.shadowRoot.activeElement!==null){return r(n.shadowRoot)}return n};var b=function r(e){if(e===false){return}if(e===d(document)){return}if(!e||!e.focus){r(c());return}e.focus({preventScroll:!!u.preventScroll});a.mostRecentlyFocusedNode=e;if($(e)){e.select()}};var h=function r(e){var n=l("setReturnFocus",e);return n?n:n===false?false:e};var y=function r(e){var n=e.target,t=e.event,i=e.isBackward,o=i===void 0?false:i;n=n||W(t);s();var f=null;if(a.tabbableGroups.length>0){var c=v(n,t);var d=c>=0?a.containerGroups[c]:undefined;if(c<0){if(o){f=a.tabbableGroups[a.tabbableGroups.length-1].lastTabbableNode}else{f=a.tabbableGroups[0].firstTabbableNode}}else if(o){var b=J(a.tabbableGroups,(function(r){var e=r.firstTabbableNode;return n===e}));if(b<0&&(d.container===n||U(n,u.tabbableOptions)&&!R(n,u.tabbableOptions)&&!d.nextTabbableNode(n,false))){b=c}if(b>=0){var h=b===0?a.tabbableGroups.length-1:b-1;var y=a.tabbableGroups[h];f=p(n)>=0?y.lastTabbableNode:y.lastDomTabbableNode}else if(!X(t)){f=d.nextTabbableNode(n,false)}}else{var w=J(a.tabbableGroups,(function(r){var e=r.lastTabbableNode;return n===e}));if(w<0&&(d.container===n||U(n,u.tabbableOptions)&&!R(n,u.tabbableOptions)&&!d.nextTabbableNode(n))){w=c}if(w>=0){var m=w===a.tabbableGroups.length-1?0:w+1;var E=a.tabbableGroups[m];f=p(n)>=0?E.firstTabbableNode:E.firstDomTabbableNode}else if(!X(t)){f=d.nextTabbableNode(n)}}}else{f=l("fallbackFocus")}return f};var w=function r(e){var n=W(e);if(v(n,e)>=0){return}if(Q(u.clickOutsideDeactivates,e)){o.deactivate({returnFocus:u.returnFocusOnDeactivate});return}if(Q(u.allowOutsideClick,e)){return}e.preventDefault()};var m=function r(e){var n=W(e);var t=v(n,e)>=0;if(t||n instanceof Document){if(t){a.mostRecentlyFocusedNode=n}}else{e.stopImmediatePropagation();var i;var o=true;if(a.mostRecentlyFocusedNode){if(p(a.mostRecentlyFocusedNode)>0){var f=v(a.mostRecentlyFocusedNode);var l=a.containerGroups[f].tabbableNodes;if(l.length>0){var s=l.findIndex((function(r){return r===a.mostRecentlyFocusedNode}));if(s>=0){if(u.isKeyForward(a.recentNavEvent)){if(s+1<l.length){i=l[s+1];o=false}}else{if(s-1>=0){i=l[s-1];o=false}}}}}else{if(!a.containerGroups.some((function(r){return r.tabbableNodes.some((function(r){return p(r)>0}))}))){o=false}}}else{o=false}if(o){i=y({target:a.mostRecentlyFocusedNode,isBackward:u.isKeyBackward(a.recentNavEvent)})}if(i){b(i)}else{b(a.mostRecentlyFocusedNode||c())}}a.recentNavEvent=undefined};var E=function r(e){var n=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;a.recentNavEvent=e;var t=y({event:e,isBackward:n});if(t){if(X(e)){e.preventDefault()}b(t)}};var O=function r(e){if(z(e)&&Q(u.escapeDeactivates,e)!==false){e.preventDefault();o.deactivate();return}if(u.isKeyForward(e)||u.isKeyBackward(e)){E(e,u.isKeyBackward(e))}};var T=function r(e){var n=W(e);if(v(n,e)>=0){return}if(Q(u.clickOutsideDeactivates,e)){return}if(Q(u.allowOutsideClick,e)){return}e.preventDefault();e.stopImmediatePropagation()};var g=function r(){if(!a.active){return}K.activateTrap(i,o);a.delayInitialFocusTimer=u.delayInitialFocus?H((function(){b(c())})):b(c());t.addEventListener("focusin",m,true);t.addEventListener("mousedown",w,{capture:true,passive:false});t.addEventListener("touchstart",w,{capture:true,passive:false});t.addEventListener("click",T,{capture:true,passive:false});t.addEventListener("keydown",O,{capture:true,passive:false});return o};var k=function r(){if(!a.active){return}t.removeEventListener("focusin",m,true);t.removeEventListener("mousedown",w,true);t.removeEventListener("touchstart",w,true);t.removeEventListener("click",T,true);t.removeEventListener("keydown",O,true);return o};var N=function r(e){var n=e.some((function(r){var e=Array.from(r.removedNodes);return e.some((function(r){return r===a.mostRecentlyFocusedNode}))}));if(n){b(c())}};var S=typeof window!=="undefined"&&"MutationObserver"in window?new MutationObserver(N):undefined;var F=function r(){if(!S){return}S.disconnect();if(a.active&&!a.paused){a.containers.map((function(r){S.observe(r,{subtree:true,childList:true})}))}};o={get active(){return a.active},get paused(){return a.paused},activate:function r(e){if(a.active){return this}var n=f(e,"onActivate");var i=f(e,"onPostActivate");var u=f(e,"checkCanFocusTrap");if(!u){s()}a.active=true;a.paused=false;a.nodeFocusedBeforeActivation=t.activeElement;n===null||n===void 0||n();var o=function r(){if(u){s()}g();F();i===null||i===void 0||i()};if(u){u(a.containers.concat()).then(o,o);return this}o();return this},deactivate:function r(e){if(!a.active){return this}var n=M({onDeactivate:u.onDeactivate,onPostDeactivate:u.onPostDeactivate,checkCanReturnFocus:u.checkCanReturnFocus},e);clearTimeout(a.delayInitialFocusTimer);a.delayInitialFocusTimer=undefined;k();a.active=false;a.paused=false;F();K.deactivateTrap(i,o);var t=f(n,"onDeactivate");var v=f(n,"onPostDeactivate");var l=f(n,"checkCanReturnFocus");var c=f(n,"returnFocus","returnFocusOnDeactivate");t===null||t===void 0||t();var s=function r(){H((function(){if(c){b(h(a.nodeFocusedBeforeActivation))}v===null||v===void 0||v()}))};if(c&&l){l(h(a.nodeFocusedBeforeActivation)).then(s,s);return this}s();return this},pause:function r(e){if(a.paused||!a.active){return this}var n=f(e,"onPause");var t=f(e,"onPostPause");a.paused=true;n===null||n===void 0||n();k();F();t===null||t===void 0||t();return this},unpause:function r(e){if(!a.paused||!a.active){return this}var n=f(e,"onUnpause");var t=f(e,"onPostUnpause");a.paused=false;n===null||n===void 0||n();s();g();F();t===null||t===void 0||t();return this},updateContainerElements:function r(e){var n=[].concat(e).filter(Boolean);a.containers=n.map((function(r){return typeof r==="string"?t.querySelector(r):r}));if(a.active){s()}F();return this}};o.updateContainerElements(e);return o};var er=r("focus_trap",function(){function r(r){e(this,r);this.active=false;this.trap=undefined}r.prototype.handleActiveChange=function(r){this.toggleTrap(r)};r.prototype.connectedCallback=function(){var r;if(!this.trap){this.trap=rr((r=this.host)===null||r===void 0?void 0:r.firstElementChild,{allowOutsideClick:true})}};r.prototype.componentDidLoad=function(){this.toggleTrap(this.active)};r.prototype.disconnectedCallback=function(){var r;(r=this.trap)===null||r===void 0?void 0:r.deactivate()};r.prototype.toggleTrap=function(r){var e,n;if(r){(e=this.trap)===null||e===void 0?void 0:e.activate()}else{(n=this.trap)===null||n===void 0?void 0:n.deactivate()}};r.prototype.render=function(){return n(t,{key:"40e6912cae0ae3e92b46cf4d251e1b1a47320d0f"},n("slot",{key:"39fe2c6ad0e0b419090ac8270840a83e49c286cf"}))};Object.defineProperty(r.prototype,"host",{get:function(){return i(this)},enumerable:false,configurable:true});Object.defineProperty(r,"watchers",{get:function(){return{active:["handleActiveChange"]}},enumerable:false,configurable:true});return r}())}}}));
|
|
10
|
+
*/function B(r,e){var n=Object.keys(r);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(r);e&&(t=t.filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.push.apply(n,t)}return n}function M(r){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?B(Object(n),!0).forEach((function(e){G(r,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(n)):B(Object(n)).forEach((function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(n,e))}))}return r}function G(r,e,n){e=K(e);if(e in r){Object.defineProperty(r,e,{value:n,enumerable:true,configurable:true,writable:true})}else{r[e]=n}return r}function Y(r,e){if(typeof r!=="object"||r===null)return r;var n=r[Symbol.toPrimitive];if(n!==undefined){var t=n.call(r,e||"default");if(typeof t!=="object")return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function K(r){var e=Y(r,"string");return typeof e==="symbol"?e:String(e)}var $={activateTrap:function r(e,n){if(e.length>0){var t=e[e.length-1];if(t!==n){t.pause()}}var i=e.indexOf(n);if(i===-1){e.push(n)}else{e.splice(i,1);e.push(n)}},deactivateTrap:function r(e,n){var t=e.indexOf(n);if(t!==-1){e.splice(t,1)}if(e.length>0){e[e.length-1].unpause()}}};var z=function r(e){return e.tagName&&e.tagName.toLowerCase()==="input"&&typeof e.select==="function"};var V=function r(e){return(e===null||e===void 0?void 0:e.key)==="Escape"||(e===null||e===void 0?void 0:e.key)==="Esc"||(e===null||e===void 0?void 0:e.keyCode)===27};var X=function r(e){return(e===null||e===void 0?void 0:e.key)==="Tab"||(e===null||e===void 0?void 0:e.keyCode)===9};var _=function r(e){return X(e)&&!e.shiftKey};var q=function r(e){return X(e)&&e.shiftKey};var H=function r(e){return setTimeout(e,0)};var J=function r(e,n){var t=-1;e.every((function(r,e){if(n(r)){t=e;return false}return true}));return t};var Q=function r(e){for(var n=arguments.length,t=new Array(n>1?n-1:0),i=1;i<n;i++){t[i-1]=arguments[i]}return typeof e==="function"?e.apply(void 0,t):e};var W=function r(e){return e.target.shadowRoot&&typeof e.composedPath==="function"?e.composedPath()[0]:e.target};var Z=[];var rr=function r(e,n){var t=(n===null||n===void 0?void 0:n.document)||document;var i=(n===null||n===void 0?void 0:n.trapStack)||Z;var u=M({returnFocusOnDeactivate:true,escapeDeactivates:true,delayInitialFocus:true,isKeyForward:_,isKeyBackward:q},n);var a={containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:false,paused:false,delayInitialFocusTimer:undefined,recentNavEvent:undefined};var o;var f=function r(e,n,t){return e&&e[n]!==undefined?e[n]:u[t||n]};var v=function r(e,n){var t=typeof(n===null||n===void 0?void 0:n.composedPath)==="function"?n.composedPath():undefined;return a.containerGroups.findIndex((function(r){var n=r.container,i=r.tabbableNodes;return n.contains(e)||(t===null||t===void 0?void 0:t.includes(n))||i.find((function(r){return r===e}))}))};var l=function r(e){var n=u[e];if(typeof n==="function"){for(var i=arguments.length,a=new Array(i>1?i-1:0),o=1;o<i;o++){a[o-1]=arguments[o]}n=n.apply(void 0,a)}if(n===true){n=undefined}if(!n){if(n===undefined||n===false){return n}throw new Error("`".concat(e,"` was specified but was not a node, or did not return a node"))}var f=n;if(typeof n==="string"){f=t.querySelector(n);if(!f){throw new Error("`".concat(e,"` as selector refers to no known node"))}}return f};var c=function r(){var e=l("initialFocus");if(e===false){return false}if(e===undefined||!U(e,u.tabbableOptions)){if(v(t.activeElement)>=0){e=t.activeElement}else{var n=a.tabbableGroups[0];var i=n&&n.firstTabbableNode;e=i||l("fallbackFocus")}}if(!e){throw new Error("Your focus-trap needs to have at least one focusable element")}return e};var s=function r(){a.containerGroups=a.containers.map((function(r){var e=x(r,u.tabbableOptions);var n=C(r,u.tabbableOptions);var t=e.length>0?e[0]:undefined;var i=e.length>0?e[e.length-1]:undefined;var a=n.find((function(r){return R(r)}));var o=n.slice().reverse().find((function(r){return R(r)}));var f=!!e.find((function(r){return p(r)>0}));return{container:r,tabbableNodes:e,focusableNodes:n,posTabIndexesFound:f,firstTabbableNode:t,lastTabbableNode:i,firstDomTabbableNode:a,lastDomTabbableNode:o,nextTabbableNode:function r(t){var i=arguments.length>1&&arguments[1]!==undefined?arguments[1]:true;var u=e.indexOf(t);if(u<0){if(i){return n.slice(n.indexOf(t)+1).find((function(r){return R(r)}))}return n.slice(0,n.indexOf(t)).reverse().find((function(r){return R(r)}))}return e[u+(i?1:-1)]}}}));a.tabbableGroups=a.containerGroups.filter((function(r){return r.tabbableNodes.length>0}));if(a.tabbableGroups.length<=0&&!l("fallbackFocus")){throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times")}if(a.containerGroups.find((function(r){return r.posTabIndexesFound}))&&a.containerGroups.length>1){throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.")}};var d=function r(e){var n=e.activeElement;if(!n){return}if(n.shadowRoot&&n.shadowRoot.activeElement!==null){return r(n.shadowRoot)}return n};var b=function r(e){if(e===false){return}if(e===d(document)){return}if(!e||!e.focus){r(c());return}e.focus({preventScroll:!!u.preventScroll});a.mostRecentlyFocusedNode=e;if(z(e)){e.select()}};var h=function r(e){var n=l("setReturnFocus",e);return n?n:n===false?false:e};var w=function r(e){var n=e.target,t=e.event,i=e.isBackward,o=i===void 0?false:i;n=n||W(t);s();var f=null;if(a.tabbableGroups.length>0){var c=v(n,t);var d=c>=0?a.containerGroups[c]:undefined;if(c<0){if(o){f=a.tabbableGroups[a.tabbableGroups.length-1].lastTabbableNode}else{f=a.tabbableGroups[0].firstTabbableNode}}else if(o){var b=J(a.tabbableGroups,(function(r){var e=r.firstTabbableNode;return n===e}));if(b<0&&(d.container===n||U(n,u.tabbableOptions)&&!R(n,u.tabbableOptions)&&!d.nextTabbableNode(n,false))){b=c}if(b>=0){var h=b===0?a.tabbableGroups.length-1:b-1;var w=a.tabbableGroups[h];f=p(n)>=0?w.lastTabbableNode:w.lastDomTabbableNode}else if(!X(t)){f=d.nextTabbableNode(n,false)}}else{var y=J(a.tabbableGroups,(function(r){var e=r.lastTabbableNode;return n===e}));if(y<0&&(d.container===n||U(n,u.tabbableOptions)&&!R(n,u.tabbableOptions)&&!d.nextTabbableNode(n))){y=c}if(y>=0){var m=y===a.tabbableGroups.length-1?0:y+1;var E=a.tabbableGroups[m];f=p(n)>=0?E.firstTabbableNode:E.firstDomTabbableNode}else if(!X(t)){f=d.nextTabbableNode(n)}}}else{f=l("fallbackFocus")}return f};var y=function r(e){var n=W(e);if(v(n,e)>=0){return}if(Q(u.clickOutsideDeactivates,e)){o.deactivate({returnFocus:u.returnFocusOnDeactivate});return}if(Q(u.allowOutsideClick,e)){return}e.preventDefault()};var m=function r(e){var n=W(e);var t=v(n,e)>=0;if(t||n instanceof Document){if(t){a.mostRecentlyFocusedNode=n}}else{e.stopImmediatePropagation();var i;var o=true;if(a.mostRecentlyFocusedNode){if(p(a.mostRecentlyFocusedNode)>0){var f=v(a.mostRecentlyFocusedNode);var l=a.containerGroups[f].tabbableNodes;if(l.length>0){var s=l.findIndex((function(r){return r===a.mostRecentlyFocusedNode}));if(s>=0){if(u.isKeyForward(a.recentNavEvent)){if(s+1<l.length){i=l[s+1];o=false}}else{if(s-1>=0){i=l[s-1];o=false}}}}}else{if(!a.containerGroups.some((function(r){return r.tabbableNodes.some((function(r){return p(r)>0}))}))){o=false}}}else{o=false}if(o){i=w({target:a.mostRecentlyFocusedNode,isBackward:u.isKeyBackward(a.recentNavEvent)})}if(i){b(i)}else{b(a.mostRecentlyFocusedNode||c())}}a.recentNavEvent=undefined};var E=function r(e){var n=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;a.recentNavEvent=e;var t=w({event:e,isBackward:n});if(t){if(X(e)){e.preventDefault()}b(t)}};var T=function r(e){if(V(e)&&Q(u.escapeDeactivates,e)!==false){e.preventDefault();o.deactivate();return}if(u.isKeyForward(e)||u.isKeyBackward(e)){E(e,u.isKeyBackward(e))}};var O=function r(e){var n=W(e);if(v(n,e)>=0){return}if(Q(u.clickOutsideDeactivates,e)){return}if(Q(u.allowOutsideClick,e)){return}e.preventDefault();e.stopImmediatePropagation()};var g=function r(){if(!a.active){return}$.activateTrap(i,o);a.delayInitialFocusTimer=u.delayInitialFocus?H((function(){b(c())})):b(c());t.addEventListener("focusin",m,true);t.addEventListener("mousedown",y,{capture:true,passive:false});t.addEventListener("touchstart",y,{capture:true,passive:false});t.addEventListener("click",O,{capture:true,passive:false});t.addEventListener("keydown",T,{capture:true,passive:false});return o};var N=function r(){if(!a.active){return}t.removeEventListener("focusin",m,true);t.removeEventListener("mousedown",y,true);t.removeEventListener("touchstart",y,true);t.removeEventListener("click",O,true);t.removeEventListener("keydown",T,true);return o};var F=function r(e){var n=e.some((function(r){var e=Array.from(r.removedNodes);return e.some((function(r){return r===a.mostRecentlyFocusedNode}))}));if(n){b(c())}};var k=typeof window!=="undefined"&&"MutationObserver"in window?new MutationObserver(F):undefined;var S=function r(){if(!k){return}k.disconnect();if(a.active&&!a.paused){a.containers.map((function(r){k.observe(r,{subtree:true,childList:true})}))}};o={get active(){return a.active},get paused(){return a.paused},activate:function r(e){if(a.active){return this}var n=f(e,"onActivate");var i=f(e,"onPostActivate");var u=f(e,"checkCanFocusTrap");if(!u){s()}a.active=true;a.paused=false;a.nodeFocusedBeforeActivation=t.activeElement;n===null||n===void 0||n();var o=function r(){if(u){s()}g();S();i===null||i===void 0||i()};if(u){u(a.containers.concat()).then(o,o);return this}o();return this},deactivate:function r(e){if(!a.active){return this}var n=M({onDeactivate:u.onDeactivate,onPostDeactivate:u.onPostDeactivate,checkCanReturnFocus:u.checkCanReturnFocus},e);clearTimeout(a.delayInitialFocusTimer);a.delayInitialFocusTimer=undefined;N();a.active=false;a.paused=false;S();$.deactivateTrap(i,o);var t=f(n,"onDeactivate");var v=f(n,"onPostDeactivate");var l=f(n,"checkCanReturnFocus");var c=f(n,"returnFocus","returnFocusOnDeactivate");t===null||t===void 0||t();var s=function r(){H((function(){if(c){b(h(a.nodeFocusedBeforeActivation))}v===null||v===void 0||v()}))};if(c&&l){l(h(a.nodeFocusedBeforeActivation)).then(s,s);return this}s();return this},pause:function r(e){if(a.paused||!a.active){return this}var n=f(e,"onPause");var t=f(e,"onPostPause");a.paused=true;n===null||n===void 0||n();N();S();t===null||t===void 0||t();return this},unpause:function r(e){if(!a.paused||!a.active){return this}var n=f(e,"onUnpause");var t=f(e,"onPostUnpause");a.paused=false;n===null||n===void 0||n();s();g();S();t===null||t===void 0||t();return this},updateContainerElements:function r(e){var n=[].concat(e).filter(Boolean);a.containers=n.map((function(r){return typeof r==="string"?t.querySelector(r):r}));if(a.active){s()}S();return this}};o.updateContainerElements(e);return o};var er=r("focus_trap",function(){function r(r){e(this,r);this.active=false;this.trap=undefined}r.prototype.handleActiveChange=function(r){this.toggleTrap(r)};r.prototype.connectedCallback=function(){var r;if(!this.trap){this.trap=rr((r=this.host)===null||r===void 0?void 0:r.firstElementChild,{allowOutsideClick:true})}};r.prototype.componentDidLoad=function(){this.toggleTrap(this.active)};r.prototype.disconnectedCallback=function(){var r;(r=this.trap)===null||r===void 0?void 0:r.deactivate()};r.prototype.toggleTrap=function(r){var e,n;if(r){(e=this.trap)===null||e===void 0?void 0:e.activate()}else{(n=this.trap)===null||n===void 0?void 0:n.deactivate()}};r.prototype.render=function(){return n(t,{key:"40e6912cae0ae3e92b46cf4d251e1b1a47320d0f"},n("slot",{key:"39fe2c6ad0e0b419090ac8270840a83e49c286cf"}))};Object.defineProperty(r.prototype,"host",{get:function(){return i(this)},enumerable:false,configurable:true});Object.defineProperty(r,"watchers",{get:function(){return{active:["handleActiveChange"]}},enumerable:false,configurable:true});return r}())}}}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as i,h as e,H as o,g as s}from"./p-67f6b5a8.js";import{d as n,t as a}from"./p-151d419a.js";import{g as r,p as l,t as h}from"./p-6c4128db.js";import{u as d}from"./p-a39139a9.js";import{s as c,d as p}from"./p-78d28548.js";import{S as g}from"./p-fa4599e6.js";import{S as u}from"./p-a0313d87.js";import{I as f}from"./p-840aa5c6.js";function m(t,i,e,o){let s=o;return i>0&&(i===1/0&&(s=!0),t.push(e)),s}const v=(t,i,e,o)=>{if(null===t||null===i)return 0;if(!e&&t.origin!==i.origin)return 0;const s=t.pathname.toLocaleLowerCase(),n=i.pathname.toLocaleLowerCase();if(s===n)return 1/0;if(t.pathname.length<i.pathname.length)return 0;if("auto"===o){const e=[t.origin.toLocaleLowerCase(),...s.split("/").filter((t=>null!==t&&""!==t))],o=[i.origin.toLocaleLowerCase(),...n.split("/").filter((t=>null!==t&&""!==t))],a=b(e,o);return Math.min(e.length,o.length)===a?a:0}return 0},b=(t,i)=>{if(null==t||null==i||0===t.length||0===i.length)return 0;let e=0;for(;e<Math.min(t.length,i.length);e++)if(t[e]!==i[e])return 0;return e};let w=null,x=null;const y=async({projectId:t,environment:i,language:e,cookieKey:o,localStorageKey:s,activeRouteProp:n,localizedCustomConfig:a,osFlyoutOverrides:h})=>{var d,c;const p=(()=>{const t=document.querySelector("#PPM_HEADER_DATA");return null!=(null==t?void 0:t.textContent)?JSON.parse(t.textContent):null})();let g,u,f=null;if(p)g=p,u=document.documentElement.lang;else{if(null==w&&(w=O(t,i)),f=await w,u=r(Object.keys(f),e,s,o),void 0===u)throw new Error("Internet Header: unable to determine current language");g=Object.assign({},f[u])}if(a){const t=(null===(d=null==a?void 0:a.header)||void 0===d?void 0:d.navMain)?Object.assign(Object.assign({},g.header),{navMain:[...g.header.navMain,...a.header.navMain]}):g.header;g=Object.assign(Object.assign({},g),{header:t})}return h&&(g.header.navMain=k(g,h)),null!=n&&(g.header.navMain=((t,i)=>{if(!1===i)return t;let e,o=!1;if(t=(t=>t.map((t=>{var i;return Object.assign(Object.assign({},t),{isActiveOverride:!1,flyout:(null===(i=t.flyout)||void 0===i?void 0:i.map((t=>Object.assign(Object.assign({},t),{linkList:t.linkList.map((t=>Object.assign(Object.assign({},t),{isActiveOverride:!1})))}))))||[]})})))(t),"auto"===i||"exact"===i){if((t=>t.filter((t=>t.isActive)).length>0)(t))return(t=>t.map((t=>{var i;return Object.assign(Object.assign({},t),{isActiveOverride:t.isActive,flyout:null===(i=t.flyout)||void 0===i?void 0:i.map((t=>Object.assign(Object.assign({},t),{linkList:t.linkList.map((t=>Object.assign(Object.assign({},t),{isActiveOverride:t.isActive})))})))})})))(t);e=new URL(window.location.href)}else try{o=i.startsWith("/")||i.startsWith("./"),e=new URL(i,window.location.href)}catch(e){return console.warn(`Active Route: ${i} is not a valid URL. Navigation highlighting has been disabled.`),t}const s=((t,i,e,o)=>{let s=!1;const n=[];return t.filter((t=>!s&&t)).forEach((t=>{var a;try{const a=new URL(t.url),r=v(i,a,o,e);s=m(n,r,{main:t,score:r},s)}catch(t){}null===(a=t.flyout)||void 0===a||a.forEach((a=>{var r;null===(r=a.linkList)||void 0===r||r.forEach((a=>{if(!a.isActive||"auto"!==e&&"exact"!==e)try{const r=new URL(a.url),l=v(i,r,o,e);s=m(n,l,{main:t,sub:a,score:l},s)}catch(t){}else s=!0}))}))})),n.sort(((t,i)=>i.score-t.score))})(t,e,i,o);if(0===s.length)return t;const n=s[0];return n.main.isActiveOverride=!0,n.sub&&(n.sub.isActiveOverride=!0),t})(g.header.navMain,n)),L(null===(c=null==g?void 0:g.header)||void 0===c?void 0:c.navMain),l(u,o,s),g},k=(t,i)=>null==i?t.header.navMain:t.header.navMain.map((t=>{var e,o,s;if("flyout_os"!==t.id)return t;null===x&&(x=JSON.parse(JSON.stringify(t)));const n=null!==(e=i.text)&&void 0!==e?e:x.text,a=null!==(o=i.title)&&void 0!==o?o:x.title;if(null==x.flyout||0===x.flyout.length||null==i.flyout||0===i.flyout.length)return Object.assign(Object.assign({},t),{title:a,text:n});const r=[...x.flyout.map(((t,e)=>{var o,s;const n=null===(o=i.flyout)||void 0===o?void 0:o[e];return{title:null!==(s=null==n?void 0:n.title)&&void 0!==s?s:t.title,linkList:[...t.linkList,...null!=(null==n?void 0:n.linkList)?n.linkList:[]]}})),...(null===(s=i.flyout)||void 0===s?void 0:s.slice(x.flyout.length))||[]];return Object.assign(Object.assign({},t),{text:n,title:a,flyout:r})})),O=async(t,i)=>{if(!C(t))throw new Error(`Internet Header: invalid project id "${t}"`);"test"===t&&(i="int01");let e=S(t,i);try{const t=await fetch(e);return await t.json()}catch(t){throw new Error(`Internet Header: fetching config failed. ${t.message}`)}},S=(t,i)=>{if("test"===t)return"assets/config/test-configuration.json";const e=i.toLowerCase(),o="prod"===e,s=`https://${o?"www":"int"}.post.ch`;try{return new URL(`${s}/api/headerjs/Json?serviceid=${encodeURIComponent(t)}${o?"":"&environment="+e}`).toString()}catch(t){throw new Error("Internet Header: Config URL is invalid.")}},C=t=>""!==t&&t.length>0&&/^[a-zA-Z][\w-]*[a-zA-Z0-9]$/.test(t),j=(t,i)=>{var e;let o;try{o="string"==typeof t?JSON.parse(t):t}catch(t){throw new Error("Internet Header: Custom config is invalid. Make sure your custom config contains valid JSON syntax and matches the definition. ")}let s=o[i];return(null===(e=null==s?void 0:s.header)||void 0===e?void 0:e.navMain)&&L(s.header.navMain),s},L=t=>{t.forEach((t=>{t.id="flyout_os"===t.id?t.id:d("main-nav-")}))},R=t=>{if(!(t instanceof HTMLElement||t instanceof SVGElement))return!1;const i=getComputedStyle(t);return["overflow","overflow-x","overflow-y"].some((t=>{const e=i.getPropertyValue(t);return"auto"===e||"scroll"===e}))},z=t=>{let i=t.parentElement;for(;i;){if("BODY"===i.nodeName)return document;if(R(i))return i;i=i.parentElement}return document},I=(t,i)=>{const e=z(t),o=e instanceof Element?e.scrollTop:e.documentElement.scrollTop,s="full"===c.stickyness?0:o;let n,a;if(i)n=t.clientHeight-1,a=i.clientHeight;else{const i=window.getComputedStyle(t),e=parseFloat(i.getPropertyValue("font-size"));a=parseFloat(i.getPropertyValue("--meta-header-height"))*e,n=a+parseFloat(i.getPropertyValue("--header-height"))*e}let r=1;return a>0&&(r=Math.max((n-Math.max(s,0))/(n-a),1)),r.toString()},P=class{async getCurrentLanguage(){var t;return null!==(t=c.currentLanguage)&&void 0!==t?t:"de"}constructor(e){if(t(this,e),this.headerLoaded=i(this,"headerLoaded",7),this.lastScrollTop=window.scrollY||document.documentElement.scrollTop,this.lastWindowWidth=window.innerWidth,this.handleClickOutsideBound=this.handleClickOutside.bind(this),this.project=void 0,this.stickyness="minimal",this.language=void 0,this.meta=!0,this.login=!0,this.search=!0,this.skiplinks=!0,this.configProxy=void 0,this.environment="prod",this.languageSwitchOverrides=void 0,this.customConfig=void 0,this.languageCookieKey=void 0,this.languageLocalStorageKey="swisspost-internet-header-language",this.logoutUrl=void 0,this.selfAdminOrigin=void 0,this.activeRoute="auto",this.osFlyoutOverrides=void 0,this.fullWidth=!1,this.activeFlyout=null,this.activeDropdownElement=null,this.isMainSlotEmpty=!0,void 0===this.project||""===this.project||!C(this.project))throw new Error(`Internet Header project key is "${this.project}". Please provide a valid project key.`)}connectedCallback(){this.throttledScroll=a(300,(()=>this.handleScrollEvent())),this.debouncedResize=n(200,(()=>this.handleResize()))}disconnectedCallback(){this.scrollParent.removeEventListener("scroll",this.throttledScroll),this.scrollParent.removeEventListener("resize",this.debouncedResize),p()}async componentWillLoad(){this.scrollParent=z(this.host),this.scrollParent.addEventListener("scroll",this.throttledScroll,{passive:!0}),this.scrollParent.addEventListener("resize",this.debouncedResize,{passive:!0});try{if(c.projectId=this.project,c.stickyness=this.stickyness,c.environment=this.environment.toLocaleLowerCase(),void 0!==this.language&&(c.currentLanguage=this.language),c.languageSwitchOverrides="string"==typeof this.languageSwitchOverrides?JSON.parse(this.languageSwitchOverrides):this.languageSwitchOverrides,c.osFlyoutOverrides="string"==typeof this.osFlyoutOverrides?JSON.parse(this.osFlyoutOverrides):this.osFlyoutOverrides,void 0!==this.customConfig){const t=Object.keys("string"==typeof this.customConfig?JSON.parse(this.customConfig):this.customConfig),i=c.currentLanguage||r(t,this.language);c.localizedCustomConfig=j(this.customConfig,i)}c.localizedConfig=await y({projectId:this.project,environment:c.environment,language:this.language,cookieKey:this.languageCookieKey,localStorageKey:this.languageLocalStorageKey,activeRouteProp:this.activeRoute,localizedCustomConfig:c.localizedCustomConfig,osFlyoutOverrides:c.osFlyoutOverrides})}catch(t){console.error(t)}}componentDidLoad(){window.requestAnimationFrame((()=>{this.handleResize(),this.headerLoaded.emit(),this.host.classList.add("header-loaded"),this.meta&&this.metaNav?this.updateLogoAnimation=((t,i)=>{const e=z(i),o=()=>{i.style.setProperty("--logo-scale",I(i,t))},s=n(150,o);return new IntersectionObserver((t=>{t.forEach((t=>{t.isIntersecting&&t.intersectionRatio>0?(e.addEventListener("scroll",o,{passive:!0}),window.addEventListener("resize",s),window.requestAnimationFrame(o)):(e.removeEventListener("scroll",o),window.removeEventListener("resize",s),window.requestAnimationFrame(o))}))}),{threshold:[0,.001]}).observe(t),o})(this.metaNav,this.host):""!==window.getComputedStyle(document.documentElement).getPropertyValue("--post-meta-header-height")&&document.documentElement.style.setProperty("--post-meta-header-height","0px")})),"full"===this.stickyness&&console.warn('Internet Header: The stickyness="full" option is deprecated.')}async handleLanguageChange(t){c.currentLanguage=t,c.localizedConfig=await y({projectId:this.project,environment:this.environment,language:t,cookieKey:this.languageCookieKey,localStorageKey:this.languageLocalStorageKey,activeRouteProp:this.activeRoute,localizedCustomConfig:c.localizedCustomConfig,osFlyoutOverrides:c.osFlyoutOverrides}),void 0!==this.customConfig&&(c.localizedCustomConfig=j(this.customConfig,t))}handleAvailableLanguagesChange(t){c.languageSwitchOverrides="string"==typeof t?JSON.parse(t):t}async handleOsFlyoutOverrides(t){c.osFlyoutOverrides="string"==typeof t?JSON.parse(t):t,c.localizedConfig=await y({projectId:this.project,environment:this.environment,language:this.language,cookieKey:this.languageCookieKey,localStorageKey:this.languageLocalStorageKey,activeRouteProp:this.activeRoute,localizedCustomConfig:c.localizedCustomConfig,osFlyoutOverrides:c.osFlyoutOverrides})}async handleActiveRouteChange(t){c.localizedConfig=await y({projectId:this.project,environment:this.environment,language:this.language,cookieKey:this.languageCookieKey,localStorageKey:this.languageLocalStorageKey,activeRouteProp:t,localizedCustomConfig:c.localizedCustomConfig,osFlyoutOverrides:c.osFlyoutOverrides})}async handleCustomConfigChange(t){if(void 0===this.language)return;const i=j(t,this.language);c.localizedCustomConfig=i,c.localizedConfig=await y({projectId:this.project,environment:this.environment,language:this.language,cookieKey:this.languageCookieKey,localStorageKey:this.languageLocalStorageKey,activeRouteProp:this.activeRoute,localizedCustomConfig:i,osFlyoutOverrides:c.osFlyoutOverrides})}handleSearchChange(t){c.search=t}handleLoginChange(t){c.login=t}handleMetaChange(t){c.meta=t}handleLanguageChangeEvent(t){this.handleLanguageChange(t.detail)}handleStickynessChange(t){c.stickyness=t,"function"==typeof this.updateLogoAnimation&&this.updateLogoAnimation()}handleClickOutside(t){this.activeDropdownElement&&!t.composedPath().includes(this.activeDropdownElement)&&this.activeDropdownElement.toggleDropdown(!1)}handleKeyUp(t){"Escape"===t.key&&(this.activeDropdownElement&&this.activeDropdownElement.toggleDropdown(!1),null!==this.activeFlyout&&this.mainNav&&this.mainNav.toggleDropdown(!1))}handleScrollEvent(){const t=this.scrollParent instanceof Document?this.scrollParent.documentElement.scrollTop:this.scrollParent.scrollTop;"minimal"===this.stickyness&&this.host.classList.toggle("scrolling-up",t<=this.lastScrollTop),this.lastScrollTop=t<=0?0:t}handleResize(){var t;this.isMainNavOpen()&&this.lastWindowWidth<1024&&window.innerWidth>=1024&&(null===(t=this.activeDropdownElement)||void 0===t||t.toggleDropdown(!1)),this.lastWindowWidth=window.innerWidth}handleDropdownToggled(t){(t.detail.open||this.activeDropdownElement===t.detail.element)&&(t.detail.open?(this.activeDropdownElement&&this.activeDropdownElement.toggleDropdown(!1),this.activeDropdownElement=t.detail.element,window.innerWidth>=1024&&window.setTimeout((()=>{window.addEventListener("click",this.handleClickOutsideBound)}),10),null!==this.activeFlyout&&this.mainNav&&this.mainNav.setActiveFlyout(null)):(this.activeDropdownElement=null,window.removeEventListener("click",this.handleClickOutsideBound)))}handleFlyoutToggled(t){this.activeFlyout=t.detail,this.activeDropdownElement&&null!==t.detail&&!this.isMainNavOpen()&&this.activeDropdownElement.toggleDropdown(!1)}toggleMobileDropdown(){var t;null===(t=this.mainNav)||void 0===t||t.toggleDropdown()}isMainNavOpen(){return this.activeDropdownElement&&"POST-MAIN-NAVIGATION"===this.activeDropdownElement.tagName}handleMainSlotChange(t){this.isMainSlotEmpty=0===t.target.assignedElements().length}render(){var t,i,s;if(!(null===(t=c.localizedConfig)||void 0===t?void 0:t.header))return void console.error(new Error("Internet Header: Config cannot be loaded"));const n=c.localizedConfig,a=this.meta&&void 0!==n.header.navMeta&&(null===(i=n.header.navMeta)||void 0===i?void 0:i.filter((t=>!t.isHomeLink)).length)>0,r=(null!==(s=this.login)&&void 0!==s?s:!n.header.isLoginWidgetHidden)&&n.header.loginWidgetOptions,l=n.header.navLang.length>1,d=a?I(this.host):"1";return e(o,{class:`stickyness-${this.stickyness} ${Boolean(this.activeDropdownElement)||Boolean(this.activeFlyout)?"dropdown-open":""}`,"data-version":"1.16.0",onKeyup:t=>this.handleKeyUp(t),style:{"--logo-scale":d}},e("header",{class:"post-internet-header"+(this.fullWidth?" full-width":"")},e(g,null),e("h1",{class:"visually-hidden"},h("Navigate on post.ch")),e(f,{condition:this.skiplinks},e("post-skiplinks",null)),e(f,{condition:a},e("post-meta-navigation",{orientation:"horizontal",class:"hidden-lg","full-width":this.fullWidth,ref:t=>this.metaNav=t},e(f,{condition:l},e("post-language-switch",{id:"post-language-switch-desktop",mode:"dropdown",onDropdownToggled:t=>this.handleDropdownToggled(t)})))),e("div",{class:"main-navigation-container wide-container"},e("post-header-logo",null),e("button",{class:"menu-button nav-link",onClick:()=>this.toggleMobileDropdown(),"aria-haspopup":"menu","aria-controls":"post-internet-header-main-navigation","aria-expanded":this.activeDropdownElement?"true":"false"},e("span",{class:"menu-button-text visually-hidden"},n.header.mobileMenu.text),e(u,{name:this.isMainNavOpen()?"pi-close":"pi-menu"})),e("post-main-navigation",{onDropdownToggled:t=>this.handleDropdownToggled(t),onFlyoutToggled:t=>this.handleFlyoutToggled(t),ref:t=>this.mainNav=t},e(f,{condition:a},e("post-meta-navigation",{orientation:"vertical"},e(f,{condition:l},e("post-language-switch",{id:"post-language-switch-mobile",mode:"list"}))))),e("div",{class:"main-navigation-controls"},e("div",{class:"main-navigation-custom-content"+(this.isMainSlotEmpty?" d-none":"")},e("slot",{name:"main",onSlotchange:t=>this.handleMainSlotChange(t)})),e(f,{condition:this.search},e("post-search",{onDropdownToggled:t=>this.handleDropdownToggled(t)})),e(f,{condition:!!r},e("post-klp-login-widget",{"logout-url":this.logoutUrl,"self-admin-origin":this.selfAdminOrigin},e("slot",{name:"login-widget"}))),e(f,{condition:!a&&l},e("post-language-switch",{id:"post-language-switch-no-meta",onDropdownToggled:t=>this.handleDropdownToggled(t),mode:"dropdown"}))))))}get host(){return s(this)}static get watchers(){return{language:["handleLanguageChange"],languageSwitchOverrides:["handleAvailableLanguagesChange"],osFlyoutOverrides:["handleOsFlyoutOverrides"],activeRoute:["handleActiveRouteChange"],customConfig:["handleCustomConfigChange"],search:["handleSearchChange"],login:["handleLoginChange"],meta:["handleMetaChange"],stickyness:["handleStickynessChange"]}}};P.style=':host{--post-contrast-color:#000;--post-focus-color:#1976c8;--post-contrast-color-inverted:#fff;--post-gray-10:hsl(0, 0%, 90%);--post-gray-20:hsl(0, 0%, 80%);--post-gray-40:hsl(0, 0%, 60%);--post-gray-60:hsl(0, 0%, 40%);--post-gray-80:hsl(0, 0%, 20%);--post-yellow:#fc0;--post-white:#fff;--post-light:#faf9f8;--post-gray:#f4f3f1;--post-dark:hsl(0, 0%, 20%);--post-black:#000;--post-primary:hsl(0, 0%, 20%);--post-secondary:hsl(0, 0%, 40%);--post-success:#2c871d;--post-warning:#f49e00;--post-error:#a51728;--post-info:#cce4ee;--post-success-background:#c0debb;--post-warning-background:#fce2b2;--post-error-background:#ffdade;--post-nightblue:#004976;--post-nightblue-bright:#0076a8;--post-petrol:#006d68;--post-petrol-bright:#00968f;--post-coral:#9e2a2f;--post-coral-bright:#e03c31;--post-olive:#716135;--post-olive-bright:#aa9d2e;--post-purple:#80276c;--post-purple-bright:#c5299b;--post-aubergine:#523178;--post-aubergine-bright:#7566a0;--post-contrast-color-rgb:0, 0, 0;--post-contrast-color-inverted-rgb:255, 255, 255;--post-gray-10-rgb:230, 230, 230;--post-gray-20-rgb:204, 204, 204;--post-gray-40-rgb:153, 153, 153;--post-gray-60-rgb:102, 102, 102;--post-gray-80-rgb:51, 51, 51;--post-black-alpha-10-rgba:rgba(0, 0, 0, 0.1);--post-black-alpha-20-rgba:rgba(0, 0, 0, 0.2);--post-black-alpha-40-rgba:rgba(0, 0, 0, 0.4);--post-black-alpha-60-rgba:rgba(0, 0, 0, 0.6);--post-black-alpha-80-rgba:rgba(0, 0, 0, 0.8);--post-white-alpha-10-rgba:rgba(255, 255, 255, 0.1);--post-white-alpha-20-rgba:rgba(255, 255, 255, 0.2);--post-white-alpha-40-rgba:rgba(255, 255, 255, 0.4);--post-white-alpha-60-rgba:rgba(255, 255, 255, 0.6);--post-white-alpha-80-rgba:rgba(255, 255, 255, 0.8);--post-yellow-rgb:255, 204, 0;--post-white-rgb:255, 255, 255;--post-light-rgb:250, 249, 248;--post-gray-rgb:244, 243, 241;--post-dark-rgb:51, 51, 51;--post-black-rgb:0, 0, 0;--post-primary-rgb:51, 51, 51;--post-secondary-rgb:102, 102, 102;--post-success-rgb:44, 135, 29;--post-warning-rgb:244, 158, 0;--post-error-rgb:165, 23, 40;--post-info-rgb:204, 228, 238;--post-success-background-rgb:192, 222, 187;--post-warning-background-rgb:252, 226, 178;--post-error-background-rgb:255, 218, 222;--post-nightblue-rgb:0, 73, 118;--post-nightblue-bright-rgb:0, 118, 168;--post-petrol-rgb:0, 109, 104;--post-petrol-bright-rgb:0, 150, 143;--post-coral-rgb:158, 42, 47;--post-coral-bright-rgb:224, 60, 49;--post-olive-rgb:113, 97, 53;--post-olive-bright-rgb:170, 157, 46;--post-purple-rgb:128, 39, 108;--post-purple-bright-rgb:197, 41, 155;--post-aubergine-rgb:82, 49, 120;--post-aubergine-bright-rgb:117, 102, 160}@font-face{font-display:swap;font-family:"Swiss Post Sans";font-weight:700;src:url("https://fonts.post.ch/swiss-post-sans/v1/SwissPostSans-Bold.woff2") format("woff2"),url("https://fonts.post.ch/swiss-post-sans/v1/SwissPostSans-Bold.woff") format("woff")}@font-face{font-display:swap;font-family:"Swiss Post Sans";font-weight:400;src:url("https://fonts.post.ch/swiss-post-sans/v1/SwissPostSans-Regular.woff2") format("woff2"),url("https://fonts.post.ch/swiss-post-sans/v1/SwissPostSans-Regular.woff") format("woff")}@font-face{font-display:swap;font-family:"Swiss Post Sans";font-weight:300;src:url("https://fonts.post.ch/swiss-post-sans/v1/SwissPostSans-Light.woff2") format("woff2"),url("https://fonts.post.ch/swiss-post-sans/v1/SwissPostSans-Light.woff") format("woff")}.visually-hidden{position:absolute;width:1px;height:1px;border:0;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0)}.btn-blank{background-color:rgba(0,0,0,0);border:none;border-radius:0;padding:0}.nav-link{outline:none;outline-offset:2px;text-decoration:none;color:rgba(0,0,0,.8);-webkit-transition:color 200ms;transition:color 200ms;background-color:rgba(0,0,0,0);-webkit-box-shadow:none;box-shadow:none;border:0;margin:0;cursor:pointer;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;gap:.5rem}.nav-link:is(:focus-visible,:focus-within,.pretend-focus){outline:2px solid var(--post-contrast-color)}.nav-link:hover,.nav-link:focus{color:#000}.nav-link:is(:focus-visible,:focus-within,.pretend-focus){z-index:1;position:relative}.nav-link>svg{width:1.4em;height:1.4em;-ms-flex-negative:0;flex-shrink:0}.nav-link>span{-ms-flex-negative:1;flex-shrink:1}.no-list{list-style:none;padding-left:0;margin-top:0;margin-bottom:0}*,:host,*::before,*::after{-webkit-box-sizing:border-box;box-sizing:border-box}:host{font-family:"Swiss Post Sans",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif}button{font:inherit;padding:0}a,button{border-radius:4px;outline:none;outline-offset:2px}a:is(:focus-visible,:focus-within,.pretend-focus),button:is(:focus-visible,:focus-within,.pretend-focus){outline:2px solid var(--post-contrast-color);border-radius:4px}img,svg{max-width:100%;max-height:100%}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){svg{color:currentColor;forced-color-adjust:preserve-parent-color}}.box>*:first-child{margin-top:0}.box>*:last-child{margin-bottom:0}.mirrored{-webkit-transform:scaleX(-1);transform:scaleX(-1)}.rotate-270{-webkit-transform:rotate(270deg);transform:rotate(270deg)}.bold{font-weight:700}.light{font-weight:300}.d-none{display:none !important}.d-flex{display:-ms-flexbox;display:flex}.d-inline-flex{display:-ms-inline-flexbox;display:inline-flex}.align-items-center{-ms-flex-align:center;align-items:center}@media (min-width: 1441px){.wide-container{margin:0 auto;max-width:1440px}}@media (max-width: 599.98px){.container{padding-right:16px;padding-left:16px}}@media (min-width: 600px)and (max-width: 1023.98px){.container{padding-right:32px;padding-left:32px}}@media (min-width: 1024px){.container{padding-right:40px;padding-left:40px}}@media (max-width: -0.02px){.hidden-xs{display:none}}@media (max-width: 399.98px){.hidden-sm{display:none}}@media (max-width: 599.98px){.hidden-rg{display:none}}@media (max-width: 779.98px){.hidden-md{display:none}}@media (max-width: 1023.98px){.hidden-lg{display:none}}@media (max-width: 1279.98px){.hidden-xl{display:none}}@media (max-width: 1439.98px){.hidden-xxl{display:none}}:host{--logo-scale:1}@media (max-width: 1023.98px){:host{--logo-scale:1 !important}}post-header-logo{height:var(--header-height);width:var(--header-height);-webkit-transform-origin:bottom left;transform-origin:bottom left;-webkit-transform:scale(var(--logo-scale));transform:scale(var(--logo-scale))}post-main-navigation{margin-left:calc(var(--header-height)*var(--logo-scale) - var(--header-height))}:host{display:block;position:relative;font-size:1rem;font-weight:300;z-index:var(--header-z-index, 10);--language-dropdown-margin-top:0px;--meta-header-height:var(--post-meta-header-height, 0px);--header-height:var(--post-header-height, 3.5rem)}@media (min-width: 1024px){:host{--meta-header-height:var(--post-meta-header-height, 3rem)}}@media (min-width: 1024px){:host{--header-height:var(--post-header-height, 4rem)}}@media (min-width: 1280px){:host{--header-height:var(--post-header-height, 4.5rem)}}:host([meta=false]){--meta-header-height:0px;--language-dropdown-margin-top:1px}@supports ((position: -webkit-sticky) or (position: sticky)){:host(:not(.stickyness-none)){position:-webkit-sticky;position:sticky}:host(.stickyness-full){top:0}:host(.stickyness-main){top:calc(var(--meta-header-height, 0px)*-1)}:host(.stickyness-minimal){top:calc((var(--header-height, 0px) + var(--meta-header-height, 0px) + 1px)*-1);-webkit-transition:top 200ms ease-in;transition:top 200ms ease-in}:host(.stickyness-minimal.scrolling-up),:host(.stickyness-minimal.dropdown-open){top:calc(var(--meta-header-height, 0px)*-1);--header-slide-in-transition:var(--post-header-slide-in-transition, top 200ms ease-out);-webkit-transition:var(--header-slide-in-transition);transition:var(--header-slide-in-transition)}}.post-internet-header{border-bottom:1px solid #e6e6e6;background-color:#fff}.main-navigation-container{display:-ms-flexbox;display:flex}.main-navigation-container>.main-navigation-controls{-ms-flex:0 1 auto;flex:0 1 auto}.main-navigation{display:-ms-flexbox;display:flex}.sub-navigation-container{position:absolute;top:100%;left:0;width:100%;display:-ms-flexbox;display:flex;background:#fff;visibility:hidden}.main-navigation-item:hover .sub-navigation-container{visibility:visible}.main-navigation-controls{display:-ms-flexbox;display:flex;margin-left:auto}@media (max-width: 1023.98px){.main-navigation-controls{font-weight:400}}@media (min-width: 1024px){.main-navigation-controls{font-size:1.0625rem}}.main-navigation-controls>*{border-left:1px solid #e6e6e6;-ms-flex:0 0 auto;flex:0 0 auto}.main-navigation-custom-content{max-height:var(--header-height);display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-negative:1;flex-shrink:1}.menu-button{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;padding:0 calc(1rem - 1px);font-weight:300;cursor:pointer;border-left:1px solid #e6e6e6;-ms-flex-order:1;order:1}@media (min-width: 1024px){.menu-button{display:none}}@media (min-width: 600px)and (max-width: 1023.98px){.menu-button .visually-hidden{position:static;width:auto;height:auto;margin:auto;overflow:visible;clip:auto;visibility:visible;margin-right:.5rem}}.menu-button svg{width:1.5rem;height:1.5rem}.full-width .wide-container{max-width:none}';export{P}
|
|
1
|
+
import{r as t,c as i,h as e,H as o,g as s}from"./p-67f6b5a8.js";import{d as n,t as a}from"./p-151d419a.js";import{g as r,p as l,t as h}from"./p-6c4128db.js";import{u as d}from"./p-a39139a9.js";import{s as c,d as p}from"./p-78d28548.js";import{S as g}from"./p-fa4599e6.js";import{S as u}from"./p-a0313d87.js";import{I as f}from"./p-840aa5c6.js";function m(t,i,e,o){let s=o;return i>0&&(i===1/0&&(s=!0),t.push(e)),s}const v=(t,i,e,o)=>{if(null===t||null===i)return 0;if(!e&&t.origin!==i.origin)return 0;const s=t.pathname.toLocaleLowerCase(),n=i.pathname.toLocaleLowerCase();if(s===n)return 1/0;if(t.pathname.length<i.pathname.length)return 0;if("auto"===o){const e=[t.origin.toLocaleLowerCase(),...s.split("/").filter((t=>null!==t&&""!==t))],o=[i.origin.toLocaleLowerCase(),...n.split("/").filter((t=>null!==t&&""!==t))],a=b(e,o);return Math.min(e.length,o.length)===a?a:0}return 0},b=(t,i)=>{if(null==t||null==i||0===t.length||0===i.length)return 0;let e=0;for(;e<Math.min(t.length,i.length);e++)if(t[e]!==i[e])return 0;return e};let w=null,x=null;const y=async({projectId:t,environment:i,language:e,cookieKey:o,localStorageKey:s,activeRouteProp:n,localizedCustomConfig:a,osFlyoutOverrides:h})=>{var d,c;const p=(()=>{const t=document.querySelector("#PPM_HEADER_DATA");return null!=(null==t?void 0:t.textContent)?JSON.parse(t.textContent):null})();let g,u,f=null;if(p)g=p,u=document.documentElement.lang;else{if(null==w&&(w=O(t,i)),f=await w,u=r(Object.keys(f),e,s,o),void 0===u)throw new Error("Internet Header: unable to determine current language");g=Object.assign({},f[u])}if(a){const t=(null===(d=null==a?void 0:a.header)||void 0===d?void 0:d.navMain)?Object.assign(Object.assign({},g.header),{navMain:[...g.header.navMain,...a.header.navMain]}):g.header;g=Object.assign(Object.assign({},g),{header:t})}return h&&(g.header.navMain=k(g,h)),null!=n&&(g.header.navMain=((t,i)=>{if(!1===i)return t;let e,o=!1;if(t=(t=>t.map((t=>{var i;return Object.assign(Object.assign({},t),{isActiveOverride:!1,flyout:(null===(i=t.flyout)||void 0===i?void 0:i.map((t=>Object.assign(Object.assign({},t),{linkList:t.linkList.map((t=>Object.assign(Object.assign({},t),{isActiveOverride:!1})))}))))||[]})})))(t),"auto"===i||"exact"===i){if((t=>t.filter((t=>t.isActive)).length>0)(t))return(t=>t.map((t=>{var i;return Object.assign(Object.assign({},t),{isActiveOverride:t.isActive,flyout:null===(i=t.flyout)||void 0===i?void 0:i.map((t=>Object.assign(Object.assign({},t),{linkList:t.linkList.map((t=>Object.assign(Object.assign({},t),{isActiveOverride:t.isActive})))})))})})))(t);e=new URL(window.location.href)}else try{o=i.startsWith("/")||i.startsWith("./"),e=new URL(i,window.location.href)}catch(e){return console.warn(`Active Route: ${i} is not a valid URL. Navigation highlighting has been disabled.`),t}const s=((t,i,e,o)=>{let s=!1;const n=[];return t.filter((t=>!s&&t)).forEach((t=>{var a;try{const a=new URL(t.url),r=v(i,a,o,e);s=m(n,r,{main:t,score:r},s)}catch(t){}null===(a=t.flyout)||void 0===a||a.forEach((a=>{var r;null===(r=a.linkList)||void 0===r||r.forEach((a=>{if(!a.isActive||"auto"!==e&&"exact"!==e)try{const r=new URL(a.url),l=v(i,r,o,e);s=m(n,l,{main:t,sub:a,score:l},s)}catch(t){}else s=!0}))}))})),n.sort(((t,i)=>i.score-t.score))})(t,e,i,o);if(0===s.length)return t;const n=s[0];return n.main.isActiveOverride=!0,n.sub&&(n.sub.isActiveOverride=!0),t})(g.header.navMain,n)),L(null===(c=null==g?void 0:g.header)||void 0===c?void 0:c.navMain),l(u,o,s),g},k=(t,i)=>null==i?t.header.navMain:t.header.navMain.map((t=>{var e,o,s;if("flyout_os"!==t.id)return t;null===x&&(x=JSON.parse(JSON.stringify(t)));const n=null!==(e=i.text)&&void 0!==e?e:x.text,a=null!==(o=i.title)&&void 0!==o?o:x.title;if(null==x.flyout||0===x.flyout.length||null==i.flyout||0===i.flyout.length)return Object.assign(Object.assign({},t),{title:a,text:n});const r=[...x.flyout.map(((t,e)=>{var o,s;const n=null===(o=i.flyout)||void 0===o?void 0:o[e];return{title:null!==(s=null==n?void 0:n.title)&&void 0!==s?s:t.title,linkList:[...t.linkList,...null!=(null==n?void 0:n.linkList)?n.linkList:[]]}})),...(null===(s=i.flyout)||void 0===s?void 0:s.slice(x.flyout.length))||[]];return Object.assign(Object.assign({},t),{text:n,title:a,flyout:r})})),O=async(t,i)=>{if(!C(t))throw new Error(`Internet Header: invalid project id "${t}"`);"test"===t&&(i="int01");let e=S(t,i);try{const t=await fetch(e);return await t.json()}catch(t){throw new Error(`Internet Header: fetching config failed. ${t.message}`)}},S=(t,i)=>{if("test"===t)return"assets/config/test-configuration.json";const e=i.toLowerCase(),o="prod"===e,s=`https://${o?"www":"int"}.post.ch`;try{return new URL(`${s}/api/headerjs/Json?serviceid=${encodeURIComponent(t)}${o?"":"&environment="+e}`).toString()}catch(t){throw new Error("Internet Header: Config URL is invalid.")}},C=t=>""!==t&&t.length>0&&/^[a-zA-Z][\w-]*[a-zA-Z0-9]$/.test(t),j=(t,i)=>{var e;let o;try{o="string"==typeof t?JSON.parse(t):t}catch(t){throw new Error("Internet Header: Custom config is invalid. Make sure your custom config contains valid JSON syntax and matches the definition. ")}let s=o[i];return(null===(e=null==s?void 0:s.header)||void 0===e?void 0:e.navMain)&&L(s.header.navMain),s},L=t=>{t.forEach((t=>{t.id="flyout_os"===t.id?t.id:d("main-nav-")}))},R=t=>{if(!(t instanceof HTMLElement||t instanceof SVGElement))return!1;const i=getComputedStyle(t);return["overflow","overflow-x","overflow-y"].some((t=>{const e=i.getPropertyValue(t);return"auto"===e||"scroll"===e}))},z=t=>{let i=t.parentElement;for(;i;){if("BODY"===i.nodeName)return document;if(R(i))return i;i=i.parentElement}return document},I=(t,i)=>{const e=z(t),o=e instanceof Element?e.scrollTop:e.documentElement.scrollTop,s="full"===c.stickyness?0:o;let n,a;if(i)n=t.clientHeight-1,a=i.clientHeight;else{const i=window.getComputedStyle(t),e=parseFloat(i.getPropertyValue("font-size"));a=parseFloat(i.getPropertyValue("--meta-header-height"))*e,n=a+parseFloat(i.getPropertyValue("--header-height"))*e}let r=1;return a>0&&(r=Math.max((n-Math.max(s,0))/(n-a),1)),r.toString()},P=class{async getCurrentLanguage(){var t;return null!==(t=c.currentLanguage)&&void 0!==t?t:"de"}constructor(e){if(t(this,e),this.headerLoaded=i(this,"headerLoaded",7),this.lastScrollTop=window.scrollY||document.documentElement.scrollTop,this.lastWindowWidth=window.innerWidth,this.handleClickOutsideBound=this.handleClickOutside.bind(this),this.project=void 0,this.stickyness="minimal",this.language=void 0,this.meta=!0,this.login=!0,this.search=!0,this.skiplinks=!0,this.configProxy=void 0,this.environment="prod",this.languageSwitchOverrides=void 0,this.customConfig=void 0,this.languageCookieKey=void 0,this.languageLocalStorageKey="swisspost-internet-header-language",this.logoutUrl=void 0,this.selfAdminOrigin=void 0,this.activeRoute="auto",this.osFlyoutOverrides=void 0,this.fullWidth=!1,this.activeFlyout=null,this.activeDropdownElement=null,this.isMainSlotEmpty=!0,void 0===this.project||""===this.project||!C(this.project))throw new Error(`Internet Header project key is "${this.project}". Please provide a valid project key.`)}connectedCallback(){this.throttledScroll=a(300,(()=>this.handleScrollEvent())),this.debouncedResize=n(200,(()=>this.handleResize()))}disconnectedCallback(){this.scrollParent.removeEventListener("scroll",this.throttledScroll),this.scrollParent.removeEventListener("resize",this.debouncedResize),p()}async componentWillLoad(){this.scrollParent=z(this.host),this.scrollParent.addEventListener("scroll",this.throttledScroll,{passive:!0}),this.scrollParent.addEventListener("resize",this.debouncedResize,{passive:!0});try{if(c.projectId=this.project,c.stickyness=this.stickyness,c.environment=this.environment.toLocaleLowerCase(),void 0!==this.language&&(c.currentLanguage=this.language),c.languageSwitchOverrides="string"==typeof this.languageSwitchOverrides?JSON.parse(this.languageSwitchOverrides):this.languageSwitchOverrides,c.osFlyoutOverrides="string"==typeof this.osFlyoutOverrides?JSON.parse(this.osFlyoutOverrides):this.osFlyoutOverrides,void 0!==this.customConfig){const t=Object.keys("string"==typeof this.customConfig?JSON.parse(this.customConfig):this.customConfig),i=c.currentLanguage||r(t,this.language);c.localizedCustomConfig=j(this.customConfig,i)}c.localizedConfig=await y({projectId:this.project,environment:c.environment,language:this.language,cookieKey:this.languageCookieKey,localStorageKey:this.languageLocalStorageKey,activeRouteProp:this.activeRoute,localizedCustomConfig:c.localizedCustomConfig,osFlyoutOverrides:c.osFlyoutOverrides})}catch(t){console.error(t)}}componentDidLoad(){window.requestAnimationFrame((()=>{this.handleResize(),this.headerLoaded.emit(),this.host.classList.add("header-loaded"),this.meta&&this.metaNav?this.updateLogoAnimation=((t,i)=>{const e=z(i),o=()=>{i.style.setProperty("--logo-scale",I(i,t))},s=n(150,o);return new IntersectionObserver((t=>{t.forEach((t=>{t.isIntersecting&&t.intersectionRatio>0?(e.addEventListener("scroll",o,{passive:!0}),window.addEventListener("resize",s),window.requestAnimationFrame(o)):(e.removeEventListener("scroll",o),window.removeEventListener("resize",s),window.requestAnimationFrame(o))}))}),{threshold:[0,.001]}).observe(t),o})(this.metaNav,this.host):""!==window.getComputedStyle(document.documentElement).getPropertyValue("--post-meta-header-height")&&document.documentElement.style.setProperty("--post-meta-header-height","0px")})),"full"===this.stickyness&&console.warn('Internet Header: The stickyness="full" option is deprecated.')}async handleLanguageChange(t){c.currentLanguage=t,c.localizedConfig=await y({projectId:this.project,environment:this.environment,language:t,cookieKey:this.languageCookieKey,localStorageKey:this.languageLocalStorageKey,activeRouteProp:this.activeRoute,localizedCustomConfig:c.localizedCustomConfig,osFlyoutOverrides:c.osFlyoutOverrides}),void 0!==this.customConfig&&(c.localizedCustomConfig=j(this.customConfig,t))}handleAvailableLanguagesChange(t){c.languageSwitchOverrides="string"==typeof t?JSON.parse(t):t}async handleOsFlyoutOverrides(t){c.osFlyoutOverrides="string"==typeof t?JSON.parse(t):t,c.localizedConfig=await y({projectId:this.project,environment:this.environment,language:this.language,cookieKey:this.languageCookieKey,localStorageKey:this.languageLocalStorageKey,activeRouteProp:this.activeRoute,localizedCustomConfig:c.localizedCustomConfig,osFlyoutOverrides:c.osFlyoutOverrides})}async handleActiveRouteChange(t){c.localizedConfig=await y({projectId:this.project,environment:this.environment,language:this.language,cookieKey:this.languageCookieKey,localStorageKey:this.languageLocalStorageKey,activeRouteProp:t,localizedCustomConfig:c.localizedCustomConfig,osFlyoutOverrides:c.osFlyoutOverrides})}async handleCustomConfigChange(t){if(void 0===this.language)return;const i=j(t,this.language);c.localizedCustomConfig=i,c.localizedConfig=await y({projectId:this.project,environment:this.environment,language:this.language,cookieKey:this.languageCookieKey,localStorageKey:this.languageLocalStorageKey,activeRouteProp:this.activeRoute,localizedCustomConfig:i,osFlyoutOverrides:c.osFlyoutOverrides})}handleSearchChange(t){c.search=t}handleLoginChange(t){c.login=t}handleMetaChange(t){c.meta=t}handleLanguageChangeEvent(t){this.handleLanguageChange(t.detail)}handleStickynessChange(t){c.stickyness=t,"function"==typeof this.updateLogoAnimation&&this.updateLogoAnimation()}handleClickOutside(t){this.activeDropdownElement&&!t.composedPath().includes(this.activeDropdownElement)&&this.activeDropdownElement.toggleDropdown(!1)}handleKeyUp(t){"Escape"===t.key&&(this.activeDropdownElement&&this.activeDropdownElement.toggleDropdown(!1),null!==this.activeFlyout&&this.mainNav&&this.mainNav.toggleDropdown(!1))}handleScrollEvent(){const t=this.scrollParent instanceof Document?this.scrollParent.documentElement.scrollTop:this.scrollParent.scrollTop;"minimal"===this.stickyness&&this.host.classList.toggle("scrolling-up",t<=this.lastScrollTop),this.lastScrollTop=t<=0?0:t}handleResize(){var t;this.isMainNavOpen()&&this.lastWindowWidth<1024&&window.innerWidth>=1024&&(null===(t=this.activeDropdownElement)||void 0===t||t.toggleDropdown(!1)),this.lastWindowWidth=window.innerWidth}handleDropdownToggled(t){(t.detail.open||this.activeDropdownElement===t.detail.element)&&(t.detail.open?(this.activeDropdownElement&&this.activeDropdownElement.toggleDropdown(!1),this.activeDropdownElement=t.detail.element,window.innerWidth>=1024&&window.setTimeout((()=>{window.addEventListener("click",this.handleClickOutsideBound)}),10),null!==this.activeFlyout&&this.mainNav&&this.mainNav.setActiveFlyout(null)):(this.activeDropdownElement=null,window.removeEventListener("click",this.handleClickOutsideBound)))}handleFlyoutToggled(t){this.activeFlyout=t.detail,this.activeDropdownElement&&null!==t.detail&&!this.isMainNavOpen()&&this.activeDropdownElement.toggleDropdown(!1)}toggleMobileDropdown(){var t;null===(t=this.mainNav)||void 0===t||t.toggleDropdown()}isMainNavOpen(){return this.activeDropdownElement&&"POST-MAIN-NAVIGATION"===this.activeDropdownElement.tagName}handleMainSlotChange(t){this.isMainSlotEmpty=0===t.target.assignedElements().length}render(){var t,i,s;if(!(null===(t=c.localizedConfig)||void 0===t?void 0:t.header))return void console.error(new Error("Internet Header: Config cannot be loaded"));const n=c.localizedConfig,a=this.meta&&void 0!==n.header.navMeta&&(null===(i=n.header.navMeta)||void 0===i?void 0:i.filter((t=>!t.isHomeLink)).length)>0,r=(null!==(s=this.login)&&void 0!==s?s:!n.header.isLoginWidgetHidden)&&n.header.loginWidgetOptions,l=n.header.navLang.length>1,d=a?I(this.host):"1";return e(o,{class:`stickyness-${this.stickyness} ${Boolean(this.activeDropdownElement)||Boolean(this.activeFlyout)?"dropdown-open":""}`,"data-version":"1.16.2",onKeyup:t=>this.handleKeyUp(t),style:{"--logo-scale":d}},e("header",{class:"post-internet-header"+(this.fullWidth?" full-width":"")},e(g,null),e("h1",{class:"visually-hidden"},h("Navigate on post.ch")),e(f,{condition:this.skiplinks},e("post-skiplinks",null)),e(f,{condition:a},e("post-meta-navigation",{orientation:"horizontal",class:"hidden-lg","full-width":this.fullWidth,ref:t=>this.metaNav=t},e(f,{condition:l},e("post-language-switch",{id:"post-language-switch-desktop",mode:"dropdown",onDropdownToggled:t=>this.handleDropdownToggled(t)})))),e("div",{class:"main-navigation-container wide-container"},e("post-header-logo",null),e("button",{class:"menu-button nav-link",onClick:()=>this.toggleMobileDropdown(),"aria-haspopup":"menu","aria-controls":"post-internet-header-main-navigation","aria-expanded":this.activeDropdownElement?"true":"false"},e("span",{class:"menu-button-text visually-hidden"},n.header.mobileMenu.text),e(u,{name:this.isMainNavOpen()?"pi-close":"pi-menu"})),e("post-main-navigation",{onDropdownToggled:t=>this.handleDropdownToggled(t),onFlyoutToggled:t=>this.handleFlyoutToggled(t),ref:t=>this.mainNav=t},e(f,{condition:a},e("post-meta-navigation",{orientation:"vertical"},e(f,{condition:l},e("post-language-switch",{id:"post-language-switch-mobile",mode:"list"}))))),e("div",{class:"main-navigation-controls"},e("div",{class:"main-navigation-custom-content"+(this.isMainSlotEmpty?" d-none":"")},e("slot",{name:"main",onSlotchange:t=>this.handleMainSlotChange(t)})),e(f,{condition:this.search},e("post-search",{onDropdownToggled:t=>this.handleDropdownToggled(t)})),e(f,{condition:!!r},e("post-klp-login-widget",{"logout-url":this.logoutUrl,"self-admin-origin":this.selfAdminOrigin},e("slot",{name:"login-widget"}))),e(f,{condition:!a&&l},e("post-language-switch",{id:"post-language-switch-no-meta",onDropdownToggled:t=>this.handleDropdownToggled(t),mode:"dropdown"}))))))}get host(){return s(this)}static get watchers(){return{language:["handleLanguageChange"],languageSwitchOverrides:["handleAvailableLanguagesChange"],osFlyoutOverrides:["handleOsFlyoutOverrides"],activeRoute:["handleActiveRouteChange"],customConfig:["handleCustomConfigChange"],search:["handleSearchChange"],login:["handleLoginChange"],meta:["handleMetaChange"],stickyness:["handleStickynessChange"]}}};P.style=':host{--post-contrast-color:#000;--post-focus-color:#1976c8;--post-contrast-color-inverted:#fff;--post-gray-10:hsl(0, 0%, 90%);--post-gray-20:hsl(0, 0%, 80%);--post-gray-40:hsl(0, 0%, 60%);--post-gray-60:hsl(0, 0%, 40%);--post-gray-80:hsl(0, 0%, 20%);--post-yellow:#fc0;--post-white:#fff;--post-light:#faf9f8;--post-gray:#f4f3f1;--post-dark:hsl(0, 0%, 20%);--post-black:#000;--post-primary:hsl(0, 0%, 20%);--post-secondary:hsl(0, 0%, 40%);--post-success:#2c871d;--post-warning:#f49e00;--post-error:#a51728;--post-info:#cce4ee;--post-success-background:#c0debb;--post-warning-background:#fce2b2;--post-error-background:#ffdade;--post-nightblue:#004976;--post-nightblue-bright:#0076a8;--post-petrol:#006d68;--post-petrol-bright:#00968f;--post-coral:#9e2a2f;--post-coral-bright:#e03c31;--post-olive:#716135;--post-olive-bright:#aa9d2e;--post-purple:#80276c;--post-purple-bright:#c5299b;--post-aubergine:#523178;--post-aubergine-bright:#7566a0;--post-contrast-color-rgb:0, 0, 0;--post-contrast-color-inverted-rgb:255, 255, 255;--post-gray-10-rgb:230, 230, 230;--post-gray-20-rgb:204, 204, 204;--post-gray-40-rgb:153, 153, 153;--post-gray-60-rgb:102, 102, 102;--post-gray-80-rgb:51, 51, 51;--post-black-alpha-10-rgba:rgba(0, 0, 0, 0.1);--post-black-alpha-20-rgba:rgba(0, 0, 0, 0.2);--post-black-alpha-40-rgba:rgba(0, 0, 0, 0.4);--post-black-alpha-60-rgba:rgba(0, 0, 0, 0.6);--post-black-alpha-80-rgba:rgba(0, 0, 0, 0.8);--post-white-alpha-10-rgba:rgba(255, 255, 255, 0.1);--post-white-alpha-20-rgba:rgba(255, 255, 255, 0.2);--post-white-alpha-40-rgba:rgba(255, 255, 255, 0.4);--post-white-alpha-60-rgba:rgba(255, 255, 255, 0.6);--post-white-alpha-80-rgba:rgba(255, 255, 255, 0.8);--post-yellow-rgb:255, 204, 0;--post-white-rgb:255, 255, 255;--post-light-rgb:250, 249, 248;--post-gray-rgb:244, 243, 241;--post-dark-rgb:51, 51, 51;--post-black-rgb:0, 0, 0;--post-primary-rgb:51, 51, 51;--post-secondary-rgb:102, 102, 102;--post-success-rgb:44, 135, 29;--post-warning-rgb:244, 158, 0;--post-error-rgb:165, 23, 40;--post-info-rgb:204, 228, 238;--post-success-background-rgb:192, 222, 187;--post-warning-background-rgb:252, 226, 178;--post-error-background-rgb:255, 218, 222;--post-nightblue-rgb:0, 73, 118;--post-nightblue-bright-rgb:0, 118, 168;--post-petrol-rgb:0, 109, 104;--post-petrol-bright-rgb:0, 150, 143;--post-coral-rgb:158, 42, 47;--post-coral-bright-rgb:224, 60, 49;--post-olive-rgb:113, 97, 53;--post-olive-bright-rgb:170, 157, 46;--post-purple-rgb:128, 39, 108;--post-purple-bright-rgb:197, 41, 155;--post-aubergine-rgb:82, 49, 120;--post-aubergine-bright-rgb:117, 102, 160}@font-face{font-display:swap;font-family:"Swiss Post Sans";font-weight:700;src:url("https://fonts.post.ch/swiss-post-sans/v1/SwissPostSans-Bold.woff2") format("woff2"),url("https://fonts.post.ch/swiss-post-sans/v1/SwissPostSans-Bold.woff") format("woff")}@font-face{font-display:swap;font-family:"Swiss Post Sans";font-weight:400;src:url("https://fonts.post.ch/swiss-post-sans/v1/SwissPostSans-Regular.woff2") format("woff2"),url("https://fonts.post.ch/swiss-post-sans/v1/SwissPostSans-Regular.woff") format("woff")}@font-face{font-display:swap;font-family:"Swiss Post Sans";font-weight:300;src:url("https://fonts.post.ch/swiss-post-sans/v1/SwissPostSans-Light.woff2") format("woff2"),url("https://fonts.post.ch/swiss-post-sans/v1/SwissPostSans-Light.woff") format("woff")}.visually-hidden{position:absolute;width:1px;height:1px;border:0;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0)}.btn-blank{background-color:rgba(0,0,0,0);border:none;border-radius:0;padding:0}.nav-link{outline:none;outline-offset:2px;text-decoration:none;color:rgba(0,0,0,.8);-webkit-transition:color 200ms;transition:color 200ms;background-color:rgba(0,0,0,0);-webkit-box-shadow:none;box-shadow:none;border:0;margin:0;cursor:pointer;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;gap:.5rem}.nav-link:is(:focus-visible,:focus-within,.pretend-focus){outline:2px solid var(--post-contrast-color)}.nav-link:hover,.nav-link:focus{color:#000}.nav-link:is(:focus-visible,:focus-within,.pretend-focus){z-index:1;position:relative}.nav-link>svg{width:1.4em;height:1.4em;-ms-flex-negative:0;flex-shrink:0}.nav-link>span{-ms-flex-negative:1;flex-shrink:1}.no-list{list-style:none;padding-left:0;margin-top:0;margin-bottom:0}*,:host,*::before,*::after{-webkit-box-sizing:border-box;box-sizing:border-box}:host{font-family:"Swiss Post Sans",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif}button{font:inherit;padding:0}a,button{border-radius:4px;outline:none;outline-offset:2px}a:is(:focus-visible,:focus-within,.pretend-focus),button:is(:focus-visible,:focus-within,.pretend-focus){outline:2px solid var(--post-contrast-color);border-radius:4px}img,svg{max-width:100%;max-height:100%}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){svg{color:currentColor;forced-color-adjust:preserve-parent-color}}.box>*:first-child{margin-top:0}.box>*:last-child{margin-bottom:0}.mirrored{-webkit-transform:scaleX(-1);transform:scaleX(-1)}.rotate-270{-webkit-transform:rotate(270deg);transform:rotate(270deg)}.bold{font-weight:700}.light{font-weight:300}.d-none{display:none !important}.d-flex{display:-ms-flexbox;display:flex}.d-inline-flex{display:-ms-inline-flexbox;display:inline-flex}.align-items-center{-ms-flex-align:center;align-items:center}@media (min-width: 1441px){.wide-container{margin:0 auto;max-width:1440px}}@media (max-width: 599.98px){.container{padding-right:16px;padding-left:16px}}@media (min-width: 600px)and (max-width: 1023.98px){.container{padding-right:32px;padding-left:32px}}@media (min-width: 1024px){.container{padding-right:40px;padding-left:40px}}@media (max-width: -0.02px){.hidden-xs{display:none}}@media (max-width: 399.98px){.hidden-sm{display:none}}@media (max-width: 599.98px){.hidden-rg{display:none}}@media (max-width: 779.98px){.hidden-md{display:none}}@media (max-width: 1023.98px){.hidden-lg{display:none}}@media (max-width: 1279.98px){.hidden-xl{display:none}}@media (max-width: 1439.98px){.hidden-xxl{display:none}}:host{--logo-scale:1}@media (max-width: 1023.98px){:host{--logo-scale:1 !important}}post-header-logo{height:var(--header-height);width:var(--header-height);-webkit-transform-origin:bottom left;transform-origin:bottom left;-webkit-transform:scale(var(--logo-scale));transform:scale(var(--logo-scale))}post-main-navigation{margin-left:calc(var(--header-height)*var(--logo-scale) - var(--header-height))}:host{display:block;position:relative;font-size:1rem;font-weight:300;z-index:var(--header-z-index, 10);--language-dropdown-margin-top:0px;--meta-header-height:var(--post-meta-header-height, 0px);--header-height:var(--post-header-height, 3.5rem)}@media (min-width: 1024px){:host{--meta-header-height:var(--post-meta-header-height, 3rem)}}@media (min-width: 1024px){:host{--header-height:var(--post-header-height, 4rem)}}@media (min-width: 1280px){:host{--header-height:var(--post-header-height, 4.5rem)}}:host([meta=false]){--meta-header-height:0px;--language-dropdown-margin-top:1px}@supports ((position: -webkit-sticky) or (position: sticky)){:host(:not(.stickyness-none)){position:-webkit-sticky;position:sticky}:host(.stickyness-full){top:0}:host(.stickyness-main){top:calc(var(--meta-header-height, 0px)*-1)}:host(.stickyness-minimal){top:calc((var(--header-height, 0px) + var(--meta-header-height, 0px) + 1px)*-1);-webkit-transition:top 200ms ease-in;transition:top 200ms ease-in}:host(.stickyness-minimal.scrolling-up),:host(.stickyness-minimal.dropdown-open){top:calc(var(--meta-header-height, 0px)*-1);--header-slide-in-transition:var(--post-header-slide-in-transition, top 200ms ease-out);-webkit-transition:var(--header-slide-in-transition);transition:var(--header-slide-in-transition)}}.post-internet-header{border-bottom:1px solid #e6e6e6;background-color:#fff}.main-navigation-container{display:-ms-flexbox;display:flex}.main-navigation-container>.main-navigation-controls{-ms-flex:0 1 auto;flex:0 1 auto}.main-navigation{display:-ms-flexbox;display:flex}.sub-navigation-container{position:absolute;top:100%;left:0;width:100%;display:-ms-flexbox;display:flex;background:#fff;visibility:hidden}.main-navigation-item:hover .sub-navigation-container{visibility:visible}.main-navigation-controls{display:-ms-flexbox;display:flex;margin-left:auto}@media (max-width: 1023.98px){.main-navigation-controls{font-weight:400}}@media (min-width: 1024px){.main-navigation-controls{font-size:1.0625rem}}.main-navigation-controls>*{border-left:1px solid #e6e6e6;-ms-flex:0 0 auto;flex:0 0 auto}.main-navigation-custom-content{max-height:var(--header-height);display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-negative:1;flex-shrink:1}.menu-button{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;padding:0 calc(1rem - 1px);font-weight:300;cursor:pointer;border-left:1px solid #e6e6e6;-ms-flex-order:1;order:1}@media (min-width: 1024px){.menu-button{display:none}}@media (min-width: 600px)and (max-width: 1023.98px){.menu-button .visually-hidden{position:static;width:auto;height:auto;margin:auto;overflow:visible;clip:auto;visibility:visible;margin-right:.5rem}}.menu-button svg{width:1.5rem;height:1.5rem}.full-width .wide-container{max-width:none}';export{P}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(e,t,n,o){function
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(e,t,n,o){function i(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,a){function s(e){try{u(o.next(e))}catch(e){a(e)}}function r(e){try{u(o["throw"](e))}catch(e){a(e)}}function u(e){e.done?n(e.value):i(e.value).then(s,r)}u((o=o.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},o,i,a,s;return s={next:r(0),throw:r(1),return:r(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function r(e){return function(t){return u([e,t])}}function u(r){if(o)throw new TypeError("Generator is already executing.");while(s&&(s=0,r[0]&&(n=0)),n)try{if(o=1,i&&(a=r[0]&2?i["return"]:r[0]?i["throw"]||((a=i["return"])&&a.call(i),0):i.next)&&!(a=a.call(i,r[1])).done)return a;if(i=0,a)r=[r[0]&2,a.value];switch(r[0]){case 0:case 1:a=r;break;case 4:n.label++;return{value:r[1],done:false};case 5:n.label++;i=r[1];r=[0];continue;case 7:r=n.ops.pop();n.trys.pop();continue;default:if(!(a=n.trys,a=a.length>0&&a[a.length-1])&&(r[0]===6||r[0]===2)){n=0;continue}if(r[0]===3&&(!a||r[1]>a[0]&&r[1]<a[3])){n.label=r[1];break}if(r[0]===6&&n.label<a[1]){n.label=a[1];a=r;break}if(a&&n.label<a[2]){n.label=a[2];n.ops.push(r);break}if(a[2])n.ops.pop();n.trys.pop();continue}r=t.call(e,n)}catch(e){r=[6,e];i=0}finally{o=a=0}if(r[0]&5)throw r[1];return{value:r[0]?r[1]:void 0,done:true}}};System.register(["./p-5600adca.system.js","./p-56ba5cbf.system.js"],(function(e,t){"use strict";var n,o,i;return{setters:[function(t){n=t.p;o=t.b;e("setNonce",t.s)},function(e){i=e.g}],execute:function(){var e=this;var a=function(){var e=t.meta.url;var o={};if(e!==""){o.resourcesUrl=new URL(".",e).href}return n(o)};a().then((function(t){return __awaiter(e,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return[4,i()];case 1:e.sent();return[2,o([["p-b8d92cc7.system",[[1,"swisspost-internet-header",{project:[1],stickyness:[1],language:[1],meta:[4],login:[4],search:[4],skiplinks:[4],configProxy:[1,"config-proxy"],environment:[1],languageSwitchOverrides:[1,"language-switch-overrides"],customConfig:[1,"custom-config"],languageCookieKey:[1,"language-cookie-key"],languageLocalStorageKey:[1,"language-local-storage-key"],logoutUrl:[1,"logout-url"],selfAdminOrigin:[1,"self-admin-origin"],activeRoute:[8,"active-route"],osFlyoutOverrides:[1,"os-flyout-overrides"],fullWidth:[4,"full-width"],activeFlyout:[32],activeDropdownElement:[32],isMainSlotEmpty:[32],getCurrentLanguage:[64]},[[0,"languageChanged","handleLanguageChangeEvent"]],{language:["handleLanguageChange"],languageSwitchOverrides:["handleAvailableLanguagesChange"],osFlyoutOverrides:["handleOsFlyoutOverrides"],activeRoute:["handleActiveRouteChange"],customConfig:["handleCustomConfigChange"],search:["handleSearchChange"],login:["handleLoginChange"],meta:["handleMetaChange"],stickyness:["handleStickynessChange"]}]]],["p-95285051.system",[[1,"swisspost-internet-breadcrumbs",{customItems:[1,"custom-items"],hideButtons:[4,"hide-buttons"],customBreadcrumbItems:[32],overlayVisible:[32],isConcatenated:[32],dropdownOpen:[32],refsReady:[32],toggleOverlayById:[64]},null,{customItems:["handleCustomConfigChange"]}]]],["p-88295f48.system",[[1,"swisspost-internet-footer",{liveSupportEnabled:[32],cookieSettingsEnabled:[32]}]]],["p-a06f4e27.system",[[1,"post-search",{searchDropdownOpen:[32],coveoSuggestions:[32],placeSuggestions:[32],parcelSuggestion:[32],toggleDropdown:[64],setFocus:[64]}]]],["p-f65ba1be.system",[[1,"post-header-logo"]]],["p-eefdd3f5.system",[[1,"post-klp-login-widget",{logoutUrl:[1,"logout-url"],selfAdminOrigin:[1,"self-admin-origin"],setFocus:[64]}]]],["p-34e560bf.system",[[1,"post-language-switch",{mode:[1],langSwitchOpen:[32],toggleDropdown:[64]}]]],["p-04fd7d46.system",[[1,"post-main-navigation",{activeFlyout:[32],mobileMenuOpen:[32],toggleDropdown:[64],setFocus:[64],setActiveFlyout:[64]}]]],["p-1a4bb959.system",[[1,"post-meta-navigation",{orientation:[1],fullWidth:[4,"full-width"]}]]],["p-cdb473a4.system",[[0,"post-skiplinks"]]],["p-4d5bddc5.system",[[4,"focus-trap",{active:[4],trap:[32]},null,{active:["handleActiveChange"]}]]]],t)]}}))}))}))}}}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(t,e,i,n){function o(t){return t instanceof i?t:new i((function(e){e(t)}))}return new(i||(i=Promise))((function(i,r){function s(t){try{l(n.next(t))}catch(t){r(t)}}function a(t){try{l(n["throw"](t))}catch(t){r(t)}}function l(t){t.done?i(t.value):o(t.value).then(s,a)}l((n=n.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var i={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},n,o,r,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(t){return function(e){return l([t,e])}}function l(a){if(n)throw new TypeError("Generator is already executing.");while(s&&(s=0,a[0]&&(i=0)),i)try{if(n=1,o&&(r=a[0]&2?o["return"]:a[0]?o["throw"]||((r=o["return"])&&r.call(o),0):o.next)&&!(r=r.call(o,a[1])).done)return r;if(o=0,r)a=[a[0]&2,r.value];switch(a[0]){case 0:case 1:r=a;break;case 4:i.label++;return{value:a[1],done:false};case 5:i.label++;o=a[1];a=[0];continue;case 7:a=i.ops.pop();i.trys.pop();continue;default:if(!(r=i.trys,r=r.length>0&&r[r.length-1])&&(a[0]===6||a[0]===2)){i=0;continue}if(a[0]===3&&(!r||a[1]>r[0]&&a[1]<r[3])){i.label=a[1];break}if(a[0]===6&&i.label<r[1]){i.label=r[1];r=a;break}if(r&&i.label<r[2]){i.label=r[2];i.ops.push(a);break}if(r[2])i.ops.pop();i.trys.pop();continue}a=e.call(t,i)}catch(t){a=[6,t];o=0}finally{n=r=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(t,e,i){if(i||arguments.length===2)for(var n=0,o=e.length,r;n<o;n++){if(r||!(n in e)){if(!r)r=Array.prototype.slice.call(e,0,n);r[n]=e[n]}}return t.concat(r||Array.prototype.slice.call(e))};System.register(["./p-5600adca.system.js","./p-abf306bd.system.js","./p-363c44ec.system.js","./p-d7e221af.system.js","./p-693ba981.system.js","./p-f0a9cc89.system.js","./p-812782e0.system.js","./p-1fd8561a.system.js"],(function(t){"use strict";var e,i,n,o,r,s,a,l,c,u,d,h,f,p,g,v;return{setters:[function(t){e=t.r;i=t.c;n=t.h;o=t.H;r=t.g},function(t){s=t.d;a=t.t},function(t){l=t.g;c=t.p;u=t.t},function(t){d=t.u},function(t){h=t.s;f=t.d},function(t){p=t.S},function(t){g=t.S},function(t){v=t.I}],execute:function(){var m=this;var b=function(t,e){if(e===false){return t}var i;var n=false;t=x(t);if(e==="auto"||e==="exact"){if(w(t)){return y(t)}i=new URL(window.location.href)}else{try{n=e.startsWith("/")||e.startsWith("./");i=new URL(e,window.location.href)}catch(i){console.warn("Active Route: ".concat(e," is not a valid URL. Navigation highlighting has been disabled."));return t}}var o=k(t,i,e,n);if(o.length===0){return t}var r=o[0];r.main.isActiveOverride=true;if(r.sub)r.sub.isActiveOverride=true;return t};var w=function(t){return t.filter((function(t){return t.isActive})).length>0};var y=function(t){return t.map((function(t){var e;return Object.assign(Object.assign({},t),{isActiveOverride:t.isActive,flyout:(e=t.flyout)===null||e===void 0?void 0:e.map((function(t){return Object.assign(Object.assign({},t),{linkList:t.linkList.map((function(t){return Object.assign(Object.assign({},t),{isActiveOverride:t.isActive})}))})}))})}))};var x=function(t){return t.map((function(t){var e;return Object.assign(Object.assign({},t),{isActiveOverride:false,flyout:((e=t.flyout)===null||e===void 0?void 0:e.map((function(t){return Object.assign(Object.assign({},t),{linkList:t.linkList.map((function(t){return Object.assign(Object.assign({},t),{isActiveOverride:false})}))})})))||[]})}))};var k=function(t,e,i,n){var o=false;var r=[];t.filter((function(t){return!o&&t})).forEach((function(t){var s;try{var a=new URL(t.url);var l=_(e,a,n,i);o=j(r,l,{main:t,score:l},o)}catch(t){}(s=t.flyout)===null||s===void 0?void 0:s.forEach((function(s){var a;(a=s.linkList)===null||a===void 0?void 0:a.forEach((function(s){if(s.isActive&&(i==="auto"||i==="exact")){o=true;return}try{var a=new URL(s.url);var l=_(e,a,n,i);o=j(r,l,{main:t,sub:s,score:l},o)}catch(t){}}))}))}));return r.sort((function(t,e){return e.score-t.score}))};function j(t,e,i,n){var o=n;if(e>0){if(e===Infinity)o=true;t.push(i)}return o}var _=function(t,e,i,n){if(t===null||e===null){return 0}if(!i&&t.origin!==e.origin){return 0}var o=t.pathname.toLocaleLowerCase();var r=e.pathname.toLocaleLowerCase();if(o===r){return Infinity}if(t.pathname.length<e.pathname.length){return 0}if(n==="auto"){var s=__spreadArray([t.origin.toLocaleLowerCase()],o.split("/").filter((function(t){return t!==null&&t!==""})),true);var a=__spreadArray([e.origin.toLocaleLowerCase()],r.split("/").filter((function(t){return t!==null&&t!==""})),true);var l=O(s,a);return Math.min(s.length,a.length)===l?l:0}return 0};var O=function(t,e){if(t==null||e==null||t.length===0||e.length===0){return 0}var i=0;for(;i<Math.min(t.length,e.length);i++){if(t[i]!==e[i]){return 0}}return i};var S=null;var C=null;var A=function(){var t=document.querySelector("#PPM_HEADER_DATA");if((t===null||t===void 0?void 0:t.textContent)!=null){return JSON.parse(t.textContent)}return null};var z=function(t){return __awaiter(m,[t],void 0,(function(t){var e,i,n,o,r,s,a;var u=t.projectId,d=t.environment,h=t.language,f=t.cookieKey,p=t.localStorageKey,g=t.activeRouteProp,v=t.localizedCustomConfig,m=t.osFlyoutOverrides;return __generator(this,(function(t){switch(t.label){case 0:n=A();r=null;if(!n)return[3,1];o=n;s=document.documentElement.lang;return[3,3];case 1:if(S==null){S=I(u,d)}return[4,S];case 2:r=t.sent();s=l(Object.keys(r),h,p,f);if(s===undefined){throw new Error("Internet Header: unable to determine current language")}o=Object.assign({},r[s]);t.label=3;case 3:if(v){a=((e=v===null||v===void 0?void 0:v.header)===null||e===void 0?void 0:e.navMain)?Object.assign(Object.assign({},o.header),{navMain:__spreadArray(__spreadArray([],o.header.navMain,true),v.header.navMain,true)}):o.header;o=Object.assign(Object.assign({},o),{header:a})}if(m)o.header.navMain=P(o,m);if(g!=null)o.header.navMain=b(o.header.navMain,g);E((i=o===null||o===void 0?void 0:o.header)===null||i===void 0?void 0:i.navMain);c(s,f,p);return[2,o]}}))}))};var P=function(t,e){if(e==null)return t.header.navMain;return t.header.navMain.map((function(t){var i,n,o;if(t.id!=="flyout_os")return t;if(C===null){C=JSON.parse(JSON.stringify(t))}var r=(i=e.text)!==null&&i!==void 0?i:C.text;var s=(n=e.title)!==null&&n!==void 0?n:C.title;if(C.flyout==null||C.flyout.length===0||e.flyout==null||e.flyout.length===0)return Object.assign(Object.assign({},t),{title:s,text:r});var a=__spreadArray(__spreadArray([],C.flyout.map((function(t,i){var n,o;var r=(n=e.flyout)===null||n===void 0?void 0:n[i];var s=(o=r===null||r===void 0?void 0:r.title)!==null&&o!==void 0?o:t.title;var a=(r===null||r===void 0?void 0:r.linkList)!=null?r.linkList:[];return{title:s,linkList:__spreadArray(__spreadArray([],t.linkList,true),a,true)}})),true),((o=e.flyout)===null||o===void 0?void 0:o.slice(C.flyout.length))||[],true);return Object.assign(Object.assign({},t),{text:r,title:s,flyout:a})}))};var I=function(t,e){return __awaiter(m,void 0,void 0,(function(){var i,n,o;return __generator(this,(function(r){switch(r.label){case 0:if(!L(t)){throw new Error('Internet Header: invalid project id "'.concat(t,'"'))}if(t==="test"){e="int01"}i=R(t,e);r.label=1;case 1:r.trys.push([1,4,,5]);return[4,fetch(i)];case 2:n=r.sent();return[4,n.json()];case 3:return[2,r.sent()];case 4:o=r.sent();throw new Error("Internet Header: fetching config failed. ".concat(o.message));case 5:return[2]}}))}))};var R=function(t,e){if(t==="test")return"assets/config/test-configuration.json";var i=e.toLowerCase();var n=i==="prod";var o="https://".concat(n?"www":"int",".post.ch");try{return new URL("".concat(o,"/api/headerjs/Json?serviceid=").concat(encodeURIComponent(t)).concat(!n?"&environment="+i:"")).toString()}catch(t){throw new Error("Internet Header: Config URL is invalid.")}};var L=function(t){return t!==""&&t.length>0&&/^[a-zA-Z][\w-]*[a-zA-Z0-9]$/.test(t)};var N=function(t,e){var i;var n;try{n=typeof t==="string"?JSON.parse(t):t}catch(t){throw new Error("Internet Header: Custom config is invalid. Make sure your custom config contains valid JSON syntax and matches the definition. ")}var o=n[e];if((i=o===null||o===void 0?void 0:o.header)===null||i===void 0?void 0:i.navMain)E(o.header.navMain);return o};var E=function(t){t.forEach((function(t){t.id=t.id==="flyout_os"?t.id:d("main-nav-")}))};var F="@swisspost/internet-header";var T="1.16.0";var H="The header for client facing applications.";var J="Swiss Post <design-system@post.ch>";var K="Apache-2.0";var M={type:"git",url:"https://github.com/swisspost/design-system.git"};var D="https://design-system.post.ch";var U={url:"https://github.com/swisspost/design-system/issues"};var B="loader/index.cjs.js";var G="loader/index.js";var q="loader/index.es2017.js";var V="loader/index.d.ts";var X="dist/collection/collection-manifest.json";var Z="dist/swisspost-internet-header/swisspost-internet-header.esm.js";var Y={access:"public"};var $=["dist/","loader/"];var Q={dev:"stencil build --serve --port 9310 --watch --docs-readme --dev --config stencil.config.dev.ts",start:"stencil build --watch --docs-readme",build:"stencil build --docs-readme",clean:"rimraf www dist loader",test:"pnpm run unit",unit:"jest","unit:watch":"jest --watch",e2e:"cypress run","e2e:ci":"xvfb-run -a cypress run","e2e:watch":"cypress open",lint:"eslint src/**/*{.ts,.tsx}","lint:fix":"eslint src/**/*{.ts,.tsx} --fix",generate:"stencil generate"};var W={"@swisspost/design-system-styles":"workspace:9.7.0","body-scroll-lock":"4.0.0-beta.0","iframe-resizer":"4.4.5",jquery:"3.7.1","throttle-debounce":"5.0.2","url-polyfill":"1.1.12"};var tt={"@babel/core":"7.25.2","@percy/cli":"1.29.1","@percy/cypress":"3.1.2","@stencil-community/eslint-plugin":"0.8.0","@stencil/core":"4.19.2","@stencil/sass":"3.0.12","@stencil/store":"2.0.16","@types/body-scroll-lock":"3.1.2","@types/iframe-resizer":"3.5.13","@types/jest":"29.5.12","@types/jquery":"3.5.30","@types/node":"20.14.14","@types/throttle-debounce":"5.0.2","babel-loader":"9.1.3",bootstrap:"5.3.3",cypress:"13.13.2","cypress-each":"1.14.0","cypress-storybook":"1.0.0",eslint:"8.57.0","eslint-plugin-react":"7.35.0","focus-trap":"7.5.4",globby:"14.0.2",jest:"29.7.0","jest-environment-jsdom":"29.7.0",rimraf:"6.0.1","rollup-plugin-node-polyfills":"0.2.1","rollup-plugin-scss":"4.0.0","rollup-plugin-visualizer":"5.12.0",sass:"1.77.8","start-server-and-test":"2.0.5","ts-jest":"29.2.4",typescript:"5.9.3"};var et=["components","web-components","header","stencil","design-system","ui","frontend"];var it={name:F,version:T,description:H,author:J,license:K,repository:M,homepage:D,bugs:U,main:B,module:G,es2017:q,types:V,collection:X,"collection:main":"dist/collection/index.js",unpkg:Z,publishConfig:Y,files:$,scripts:Q,dependencies:W,devDependencies:tt,keywords:et};var nt=function(t){if(!(t instanceof HTMLElement||t instanceof SVGElement)){return false}var e=getComputedStyle(t);return["overflow","overflow-x","overflow-y"].some((function(t){var i=e.getPropertyValue(t);return i==="auto"||i==="scroll"}))};var ot=function(t){var e=t.parentElement;while(e){if(e.nodeName==="BODY"){return document}if(nt(e)){return e}e=e.parentElement}return document};var rt=function(t,e){var i=ot(t);var n=i instanceof Element?i.scrollTop:i.documentElement.scrollTop;var o=h.stickyness==="full"?0:n;var r,s;if(e){r=t.clientHeight-1;s=e.clientHeight}else{var a=window.getComputedStyle(t);var l=parseFloat(a.getPropertyValue("font-size"));s=parseFloat(a.getPropertyValue("--meta-header-height"))*l;r=s+parseFloat(a.getPropertyValue("--header-height"))*l}var c=1;if(s>0){c=Math.max((r-Math.max(o,0))/(r-s),1)}return c.toString()};var st=function(t,e){var i=ot(e);var n=function(){e.style.setProperty("--logo-scale",rt(e,t))};var o=s(150,n);var r=new IntersectionObserver((function(t){t.forEach((function(t){if(t.isIntersecting&&t.intersectionRatio>0){i.addEventListener("scroll",n,{passive:true});window.addEventListener("resize",o);window.requestAnimationFrame(n)}else{i.removeEventListener("scroll",n);window.removeEventListener("resize",o);window.requestAnimationFrame(n)}}))}),{threshold:[0,.001]});r.observe(t);return n};var at=':host{--post-contrast-color:#000;--post-focus-color:#1976c8;--post-contrast-color-inverted:#fff;--post-gray-10:hsl(0, 0%, 90%);--post-gray-20:hsl(0, 0%, 80%);--post-gray-40:hsl(0, 0%, 60%);--post-gray-60:hsl(0, 0%, 40%);--post-gray-80:hsl(0, 0%, 20%);--post-yellow:#fc0;--post-white:#fff;--post-light:#faf9f8;--post-gray:#f4f3f1;--post-dark:hsl(0, 0%, 20%);--post-black:#000;--post-primary:hsl(0, 0%, 20%);--post-secondary:hsl(0, 0%, 40%);--post-success:#2c871d;--post-warning:#f49e00;--post-error:#a51728;--post-info:#cce4ee;--post-success-background:#c0debb;--post-warning-background:#fce2b2;--post-error-background:#ffdade;--post-nightblue:#004976;--post-nightblue-bright:#0076a8;--post-petrol:#006d68;--post-petrol-bright:#00968f;--post-coral:#9e2a2f;--post-coral-bright:#e03c31;--post-olive:#716135;--post-olive-bright:#aa9d2e;--post-purple:#80276c;--post-purple-bright:#c5299b;--post-aubergine:#523178;--post-aubergine-bright:#7566a0;--post-contrast-color-rgb:0, 0, 0;--post-contrast-color-inverted-rgb:255, 255, 255;--post-gray-10-rgb:230, 230, 230;--post-gray-20-rgb:204, 204, 204;--post-gray-40-rgb:153, 153, 153;--post-gray-60-rgb:102, 102, 102;--post-gray-80-rgb:51, 51, 51;--post-black-alpha-10-rgba:rgba(0, 0, 0, 0.1);--post-black-alpha-20-rgba:rgba(0, 0, 0, 0.2);--post-black-alpha-40-rgba:rgba(0, 0, 0, 0.4);--post-black-alpha-60-rgba:rgba(0, 0, 0, 0.6);--post-black-alpha-80-rgba:rgba(0, 0, 0, 0.8);--post-white-alpha-10-rgba:rgba(255, 255, 255, 0.1);--post-white-alpha-20-rgba:rgba(255, 255, 255, 0.2);--post-white-alpha-40-rgba:rgba(255, 255, 255, 0.4);--post-white-alpha-60-rgba:rgba(255, 255, 255, 0.6);--post-white-alpha-80-rgba:rgba(255, 255, 255, 0.8);--post-yellow-rgb:255, 204, 0;--post-white-rgb:255, 255, 255;--post-light-rgb:250, 249, 248;--post-gray-rgb:244, 243, 241;--post-dark-rgb:51, 51, 51;--post-black-rgb:0, 0, 0;--post-primary-rgb:51, 51, 51;--post-secondary-rgb:102, 102, 102;--post-success-rgb:44, 135, 29;--post-warning-rgb:244, 158, 0;--post-error-rgb:165, 23, 40;--post-info-rgb:204, 228, 238;--post-success-background-rgb:192, 222, 187;--post-warning-background-rgb:252, 226, 178;--post-error-background-rgb:255, 218, 222;--post-nightblue-rgb:0, 73, 118;--post-nightblue-bright-rgb:0, 118, 168;--post-petrol-rgb:0, 109, 104;--post-petrol-bright-rgb:0, 150, 143;--post-coral-rgb:158, 42, 47;--post-coral-bright-rgb:224, 60, 49;--post-olive-rgb:113, 97, 53;--post-olive-bright-rgb:170, 157, 46;--post-purple-rgb:128, 39, 108;--post-purple-bright-rgb:197, 41, 155;--post-aubergine-rgb:82, 49, 120;--post-aubergine-bright-rgb:117, 102, 160}@font-face{font-display:swap;font-family:"Swiss Post Sans";font-weight:700;src:url("https://fonts.post.ch/swiss-post-sans/v1/SwissPostSans-Bold.woff2") format("woff2"),url("https://fonts.post.ch/swiss-post-sans/v1/SwissPostSans-Bold.woff") format("woff")}@font-face{font-display:swap;font-family:"Swiss Post Sans";font-weight:400;src:url("https://fonts.post.ch/swiss-post-sans/v1/SwissPostSans-Regular.woff2") format("woff2"),url("https://fonts.post.ch/swiss-post-sans/v1/SwissPostSans-Regular.woff") format("woff")}@font-face{font-display:swap;font-family:"Swiss Post Sans";font-weight:300;src:url("https://fonts.post.ch/swiss-post-sans/v1/SwissPostSans-Light.woff2") format("woff2"),url("https://fonts.post.ch/swiss-post-sans/v1/SwissPostSans-Light.woff") format("woff")}.visually-hidden{position:absolute;width:1px;height:1px;border:0;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0)}.btn-blank{background-color:rgba(0,0,0,0);border:none;border-radius:0;padding:0}.nav-link{outline:none;outline-offset:2px;text-decoration:none;color:rgba(0,0,0,.8);-webkit-transition:color 200ms;transition:color 200ms;background-color:rgba(0,0,0,0);-webkit-box-shadow:none;box-shadow:none;border:0;margin:0;cursor:pointer;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;gap:.5rem}.nav-link:is(:focus-visible,:focus-within,.pretend-focus){outline:2px solid var(--post-contrast-color)}.nav-link:hover,.nav-link:focus{color:#000}.nav-link:is(:focus-visible,:focus-within,.pretend-focus){z-index:1;position:relative}.nav-link>svg{width:1.4em;height:1.4em;-ms-flex-negative:0;flex-shrink:0}.nav-link>span{-ms-flex-negative:1;flex-shrink:1}.no-list{list-style:none;padding-left:0;margin-top:0;margin-bottom:0}*,:host,*::before,*::after{-webkit-box-sizing:border-box;box-sizing:border-box}:host{font-family:"Swiss Post Sans",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif}button{font:inherit;padding:0}a,button{border-radius:4px;outline:none;outline-offset:2px}a:is(:focus-visible,:focus-within,.pretend-focus),button:is(:focus-visible,:focus-within,.pretend-focus){outline:2px solid var(--post-contrast-color);border-radius:4px}img,svg{max-width:100%;max-height:100%}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){svg{color:currentColor;forced-color-adjust:preserve-parent-color}}.box>*:first-child{margin-top:0}.box>*:last-child{margin-bottom:0}.mirrored{-webkit-transform:scaleX(-1);transform:scaleX(-1)}.rotate-270{-webkit-transform:rotate(270deg);transform:rotate(270deg)}.bold{font-weight:700}.light{font-weight:300}.d-none{display:none !important}.d-flex{display:-ms-flexbox;display:flex}.d-inline-flex{display:-ms-inline-flexbox;display:inline-flex}.align-items-center{-ms-flex-align:center;align-items:center}@media (min-width: 1441px){.wide-container{margin:0 auto;max-width:1440px}}@media (max-width: 599.98px){.container{padding-right:16px;padding-left:16px}}@media (min-width: 600px)and (max-width: 1023.98px){.container{padding-right:32px;padding-left:32px}}@media (min-width: 1024px){.container{padding-right:40px;padding-left:40px}}@media (max-width: -0.02px){.hidden-xs{display:none}}@media (max-width: 399.98px){.hidden-sm{display:none}}@media (max-width: 599.98px){.hidden-rg{display:none}}@media (max-width: 779.98px){.hidden-md{display:none}}@media (max-width: 1023.98px){.hidden-lg{display:none}}@media (max-width: 1279.98px){.hidden-xl{display:none}}@media (max-width: 1439.98px){.hidden-xxl{display:none}}:host{--logo-scale:1}@media (max-width: 1023.98px){:host{--logo-scale:1 !important}}post-header-logo{height:var(--header-height);width:var(--header-height);-webkit-transform-origin:bottom left;transform-origin:bottom left;-webkit-transform:scale(var(--logo-scale));transform:scale(var(--logo-scale))}post-main-navigation{margin-left:calc(var(--header-height)*var(--logo-scale) - var(--header-height))}:host{display:block;position:relative;font-size:1rem;font-weight:300;z-index:var(--header-z-index, 10);--language-dropdown-margin-top:0px;--meta-header-height:var(--post-meta-header-height, 0px);--header-height:var(--post-header-height, 3.5rem)}@media (min-width: 1024px){:host{--meta-header-height:var(--post-meta-header-height, 3rem)}}@media (min-width: 1024px){:host{--header-height:var(--post-header-height, 4rem)}}@media (min-width: 1280px){:host{--header-height:var(--post-header-height, 4.5rem)}}:host([meta=false]){--meta-header-height:0px;--language-dropdown-margin-top:1px}@supports ((position: -webkit-sticky) or (position: sticky)){:host(:not(.stickyness-none)){position:-webkit-sticky;position:sticky}:host(.stickyness-full){top:0}:host(.stickyness-main){top:calc(var(--meta-header-height, 0px)*-1)}:host(.stickyness-minimal){top:calc((var(--header-height, 0px) + var(--meta-header-height, 0px) + 1px)*-1);-webkit-transition:top 200ms ease-in;transition:top 200ms ease-in}:host(.stickyness-minimal.scrolling-up),:host(.stickyness-minimal.dropdown-open){top:calc(var(--meta-header-height, 0px)*-1);--header-slide-in-transition:var(--post-header-slide-in-transition, top 200ms ease-out);-webkit-transition:var(--header-slide-in-transition);transition:var(--header-slide-in-transition)}}.post-internet-header{border-bottom:1px solid #e6e6e6;background-color:#fff}.main-navigation-container{display:-ms-flexbox;display:flex}.main-navigation-container>.main-navigation-controls{-ms-flex:0 1 auto;flex:0 1 auto}.main-navigation{display:-ms-flexbox;display:flex}.sub-navigation-container{position:absolute;top:100%;left:0;width:100%;display:-ms-flexbox;display:flex;background:#fff;visibility:hidden}.main-navigation-item:hover .sub-navigation-container{visibility:visible}.main-navigation-controls{display:-ms-flexbox;display:flex;margin-left:auto}@media (max-width: 1023.98px){.main-navigation-controls{font-weight:400}}@media (min-width: 1024px){.main-navigation-controls{font-size:1.0625rem}}.main-navigation-controls>*{border-left:1px solid #e6e6e6;-ms-flex:0 0 auto;flex:0 0 auto}.main-navigation-custom-content{max-height:var(--header-height);display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-negative:1;flex-shrink:1}.menu-button{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;padding:0 calc(1rem - 1px);font-weight:300;cursor:pointer;border-left:1px solid #e6e6e6;-ms-flex-order:1;order:1}@media (min-width: 1024px){.menu-button{display:none}}@media (min-width: 600px)and (max-width: 1023.98px){.menu-button .visually-hidden{position:static;width:auto;height:auto;margin:auto;overflow:visible;clip:auto;visibility:visible;margin-right:.5rem}}.menu-button svg{width:1.5rem;height:1.5rem}.full-width .wide-container{max-width:none}';var lt=at;var ct=t("P",function(){function t(t){e(this,t);this.headerLoaded=i(this,"headerLoaded",7);this.lastScrollTop=window.scrollY||document.documentElement.scrollTop;this.lastWindowWidth=window.innerWidth;this.handleClickOutsideBound=this.handleClickOutside.bind(this);this.project=undefined;this.stickyness="minimal";this.language=undefined;this.meta=true;this.login=true;this.search=true;this.skiplinks=true;this.configProxy=undefined;this.environment="prod";this.languageSwitchOverrides=undefined;this.customConfig=undefined;this.languageCookieKey=undefined;this.languageLocalStorageKey="swisspost-internet-header-language";this.logoutUrl=undefined;this.selfAdminOrigin=undefined;this.activeRoute="auto";this.osFlyoutOverrides=undefined;this.fullWidth=false;this.activeFlyout=null;this.activeDropdownElement=null;this.isMainSlotEmpty=true;if(this.project===undefined||this.project===""||!L(this.project)){throw new Error('Internet Header project key is "'.concat(this.project,'". Please provide a valid project key.'))}}t.prototype.getCurrentLanguage=function(){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(e){return[2,(t=h.currentLanguage)!==null&&t!==void 0?t:"de"]}))}))};t.prototype.connectedCallback=function(){var t=this;this.throttledScroll=a(300,(function(){return t.handleScrollEvent()}));this.debouncedResize=s(200,(function(){return t.handleResize()}))};t.prototype.disconnectedCallback=function(){this.scrollParent.removeEventListener("scroll",this.throttledScroll);this.scrollParent.removeEventListener("resize",this.debouncedResize);f()};t.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var t,e,i,n;return __generator(this,(function(o){switch(o.label){case 0:this.scrollParent=ot(this.host);this.scrollParent.addEventListener("scroll",this.throttledScroll,{passive:true});this.scrollParent.addEventListener("resize",this.debouncedResize,{passive:true});o.label=1;case 1:o.trys.push([1,3,,4]);h.projectId=this.project;h.stickyness=this.stickyness;h.environment=this.environment.toLocaleLowerCase();if(this.language!==undefined)h.currentLanguage=this.language;h.languageSwitchOverrides=typeof this.languageSwitchOverrides==="string"?JSON.parse(this.languageSwitchOverrides):this.languageSwitchOverrides;h.osFlyoutOverrides=typeof this.osFlyoutOverrides==="string"?JSON.parse(this.osFlyoutOverrides):this.osFlyoutOverrides;if(this.customConfig!==undefined){t=Object.keys(typeof this.customConfig==="string"?JSON.parse(this.customConfig):this.customConfig);e=h.currentLanguage||l(t,this.language);h.localizedCustomConfig=N(this.customConfig,e)}i=h;return[4,z({projectId:this.project,environment:h.environment,language:this.language,cookieKey:this.languageCookieKey,localStorageKey:this.languageLocalStorageKey,activeRouteProp:this.activeRoute,localizedCustomConfig:h.localizedCustomConfig,osFlyoutOverrides:h.osFlyoutOverrides})];case 2:i.localizedConfig=o.sent();return[3,4];case 3:n=o.sent();console.error(n);return[3,4];case 4:return[2]}}))}))};t.prototype.componentDidLoad=function(){var t=this;window.requestAnimationFrame((function(){t.handleResize();t.headerLoaded.emit();t.host.classList.add("header-loaded");if(t.meta&&t.metaNav){t.updateLogoAnimation=st(t.metaNav,t.host)}else{var e=window.getComputedStyle(document.documentElement);if(e.getPropertyValue("--post-meta-header-height")!==""){document.documentElement.style.setProperty("--post-meta-header-height","0px")}}}));if(this.stickyness==="full")console.warn('Internet Header: The stickyness="full" option is deprecated.')};t.prototype.handleLanguageChange=function(t){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(i){switch(i.label){case 0:h.currentLanguage=t;e=h;return[4,z({projectId:this.project,environment:this.environment,language:t,cookieKey:this.languageCookieKey,localStorageKey:this.languageLocalStorageKey,activeRouteProp:this.activeRoute,localizedCustomConfig:h.localizedCustomConfig,osFlyoutOverrides:h.osFlyoutOverrides})];case 1:e.localizedConfig=i.sent();if(this.customConfig!==undefined)h.localizedCustomConfig=N(this.customConfig,t);return[2]}}))}))};t.prototype.handleAvailableLanguagesChange=function(t){h.languageSwitchOverrides=typeof t==="string"?JSON.parse(t):t};t.prototype.handleOsFlyoutOverrides=function(t){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(i){switch(i.label){case 0:h.osFlyoutOverrides=typeof t==="string"?JSON.parse(t):t;e=h;return[4,z({projectId:this.project,environment:this.environment,language:this.language,cookieKey:this.languageCookieKey,localStorageKey:this.languageLocalStorageKey,activeRouteProp:this.activeRoute,localizedCustomConfig:h.localizedCustomConfig,osFlyoutOverrides:h.osFlyoutOverrides})];case 1:e.localizedConfig=i.sent();return[2]}}))}))};t.prototype.handleActiveRouteChange=function(t){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(i){switch(i.label){case 0:e=h;return[4,z({projectId:this.project,environment:this.environment,language:this.language,cookieKey:this.languageCookieKey,localStorageKey:this.languageLocalStorageKey,activeRouteProp:t,localizedCustomConfig:h.localizedCustomConfig,osFlyoutOverrides:h.osFlyoutOverrides})];case 1:e.localizedConfig=i.sent();return[2]}}))}))};t.prototype.handleCustomConfigChange=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i;return __generator(this,(function(n){switch(n.label){case 0:if(this.language===undefined)return[2];e=N(t,this.language);h.localizedCustomConfig=e;i=h;return[4,z({projectId:this.project,environment:this.environment,language:this.language,cookieKey:this.languageCookieKey,localStorageKey:this.languageLocalStorageKey,activeRouteProp:this.activeRoute,localizedCustomConfig:e,osFlyoutOverrides:h.osFlyoutOverrides})];case 1:i.localizedConfig=n.sent();return[2]}}))}))};t.prototype.handleSearchChange=function(t){h.search=t};t.prototype.handleLoginChange=function(t){h.login=t};t.prototype.handleMetaChange=function(t){h.meta=t};t.prototype.handleLanguageChangeEvent=function(t){void this.handleLanguageChange(t.detail)};t.prototype.handleStickynessChange=function(t){h.stickyness=t;if(typeof this.updateLogoAnimation==="function")this.updateLogoAnimation()};t.prototype.handleClickOutside=function(t){if(this.activeDropdownElement&&!t.composedPath().includes(this.activeDropdownElement)){void this.activeDropdownElement.toggleDropdown(false)}};t.prototype.handleKeyUp=function(t){if(t.key==="Escape"){if(this.activeDropdownElement){void this.activeDropdownElement.toggleDropdown(false)}if(this.activeFlyout!==null&&this.mainNav){void this.mainNav.toggleDropdown(false)}}};t.prototype.handleScrollEvent=function(){var t=this.scrollParent instanceof Document?this.scrollParent.documentElement.scrollTop:this.scrollParent.scrollTop;if(this.stickyness==="minimal"){this.host.classList.toggle("scrolling-up",t<=this.lastScrollTop)}this.lastScrollTop=t<=0?0:t};t.prototype.handleResize=function(){var t;if(this.isMainNavOpen()&&this.lastWindowWidth<1024&&window.innerWidth>=1024){(t=this.activeDropdownElement)===null||t===void 0?void 0:t.toggleDropdown(false)}this.lastWindowWidth=window.innerWidth};t.prototype.handleDropdownToggled=function(t){var e=this;if(!t.detail.open&&this.activeDropdownElement!==t.detail.element){return}if(t.detail.open){if(this.activeDropdownElement){void this.activeDropdownElement.toggleDropdown(false)}this.activeDropdownElement=t.detail.element;if(window.innerWidth>=1024){window.setTimeout((function(){window.addEventListener("click",e.handleClickOutsideBound)}),10)}if(this.activeFlyout!==null&&this.mainNav){void this.mainNav.setActiveFlyout(null)}}else{this.activeDropdownElement=null;window.removeEventListener("click",this.handleClickOutsideBound)}};t.prototype.handleFlyoutToggled=function(t){this.activeFlyout=t.detail;if(this.activeDropdownElement&&t.detail!==null&&!this.isMainNavOpen()){void this.activeDropdownElement.toggleDropdown(false)}};t.prototype.toggleMobileDropdown=function(){var t;(t=this.mainNav)===null||t===void 0?void 0:t.toggleDropdown()};t.prototype.isMainNavOpen=function(){return this.activeDropdownElement&&this.activeDropdownElement.tagName==="POST-MAIN-NAVIGATION"};t.prototype.handleMainSlotChange=function(t){var e=t.target;this.isMainSlotEmpty=e.assignedElements().length===0};t.prototype.render=function(){var t=this;var e,i,r;if(!((e=h.localizedConfig)===null||e===void 0?void 0:e.header)){console.error(new Error("Internet Header: Config cannot be loaded"));return}var s=h.localizedConfig;var a=this.meta&&s.header.navMeta!==undefined&&((i=s.header.navMeta)===null||i===void 0?void 0:i.filter((function(t){return!t.isHomeLink})).length)>0;var l=((r=this.login)!==null&&r!==void 0?r:!s.header.isLoginWidgetHidden)&&s.header.loginWidgetOptions;var c=s.header.navLang.length>1;var d=a?rt(this.host):"1";return n(o,{class:"stickyness-".concat(this.stickyness," ").concat(Boolean(this.activeDropdownElement)||Boolean(this.activeFlyout)?"dropdown-open":""),"data-version":it.version,onKeyup:function(e){return t.handleKeyUp(e)},style:{"--logo-scale":d}},n("header",{class:"post-internet-header".concat(this.fullWidth?" full-width":"")},n(p,null),n("h1",{class:"visually-hidden"},u("Navigate on post.ch")),n(v,{condition:this.skiplinks},n("post-skiplinks",null)),n(v,{condition:a},n("post-meta-navigation",{orientation:"horizontal",class:"hidden-lg","full-width":this.fullWidth,ref:function(e){return t.metaNav=e}},n(v,{condition:c},n("post-language-switch",{id:"post-language-switch-desktop",mode:"dropdown",onDropdownToggled:function(e){return t.handleDropdownToggled(e)}})))),n("div",{class:"main-navigation-container wide-container"},n("post-header-logo",null),n("button",{class:"menu-button nav-link",onClick:function(){return t.toggleMobileDropdown()},"aria-haspopup":"menu","aria-controls":"post-internet-header-main-navigation","aria-expanded":this.activeDropdownElement?"true":"false"},n("span",{class:"menu-button-text visually-hidden"},s.header.mobileMenu.text),n(g,{name:this.isMainNavOpen()?"pi-close":"pi-menu"})),n("post-main-navigation",{onDropdownToggled:function(e){return t.handleDropdownToggled(e)},onFlyoutToggled:function(e){return t.handleFlyoutToggled(e)},ref:function(e){return t.mainNav=e}},n(v,{condition:a},n("post-meta-navigation",{orientation:"vertical"},n(v,{condition:c},n("post-language-switch",{id:"post-language-switch-mobile",mode:"list"}))))),n("div",{class:"main-navigation-controls"},n("div",{class:"main-navigation-custom-content".concat(this.isMainSlotEmpty?" d-none":"")},n("slot",{name:"main",onSlotchange:function(e){return t.handleMainSlotChange(e)}})),n(v,{condition:this.search},n("post-search",{onDropdownToggled:function(e){return t.handleDropdownToggled(e)}})),n(v,{condition:!!l},n("post-klp-login-widget",{"logout-url":this.logoutUrl,"self-admin-origin":this.selfAdminOrigin},n("slot",{name:"login-widget"}))),n(v,{condition:!a&&c},n("post-language-switch",{id:"post-language-switch-no-meta",onDropdownToggled:function(e){return t.handleDropdownToggled(e)},mode:"dropdown"}))))))};Object.defineProperty(t.prototype,"host",{get:function(){return r(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{language:["handleLanguageChange"],languageSwitchOverrides:["handleAvailableLanguagesChange"],osFlyoutOverrides:["handleOsFlyoutOverrides"],activeRoute:["handleActiveRouteChange"],customConfig:["handleCustomConfigChange"],search:["handleSearchChange"],login:["handleLoginChange"],meta:["handleMetaChange"],stickyness:["handleStickynessChange"]}},enumerable:false,configurable:true});return t}());ct.style=lt}}}));
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(t,e,i,n){function o(t){return t instanceof i?t:new i((function(e){e(t)}))}return new(i||(i=Promise))((function(i,r){function s(t){try{l(n.next(t))}catch(t){r(t)}}function a(t){try{l(n["throw"](t))}catch(t){r(t)}}function l(t){t.done?i(t.value):o(t.value).then(s,a)}l((n=n.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var i={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},n,o,r,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(t){return function(e){return l([t,e])}}function l(a){if(n)throw new TypeError("Generator is already executing.");while(s&&(s=0,a[0]&&(i=0)),i)try{if(n=1,o&&(r=a[0]&2?o["return"]:a[0]?o["throw"]||((r=o["return"])&&r.call(o),0):o.next)&&!(r=r.call(o,a[1])).done)return r;if(o=0,r)a=[a[0]&2,r.value];switch(a[0]){case 0:case 1:r=a;break;case 4:i.label++;return{value:a[1],done:false};case 5:i.label++;o=a[1];a=[0];continue;case 7:a=i.ops.pop();i.trys.pop();continue;default:if(!(r=i.trys,r=r.length>0&&r[r.length-1])&&(a[0]===6||a[0]===2)){i=0;continue}if(a[0]===3&&(!r||a[1]>r[0]&&a[1]<r[3])){i.label=a[1];break}if(a[0]===6&&i.label<r[1]){i.label=r[1];r=a;break}if(r&&i.label<r[2]){i.label=r[2];i.ops.push(a);break}if(r[2])i.ops.pop();i.trys.pop();continue}a=e.call(t,i)}catch(t){a=[6,t];o=0}finally{n=r=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(t,e,i){if(i||arguments.length===2)for(var n=0,o=e.length,r;n<o;n++){if(r||!(n in e)){if(!r)r=Array.prototype.slice.call(e,0,n);r[n]=e[n]}}return t.concat(r||Array.prototype.slice.call(e))};System.register(["./p-5600adca.system.js","./p-abf306bd.system.js","./p-363c44ec.system.js","./p-d7e221af.system.js","./p-693ba981.system.js","./p-f0a9cc89.system.js","./p-812782e0.system.js","./p-1fd8561a.system.js"],(function(t){"use strict";var e,i,n,o,r,s,a,l,c,u,d,h,f,p,g,v;return{setters:[function(t){e=t.r;i=t.c;n=t.h;o=t.H;r=t.g},function(t){s=t.d;a=t.t},function(t){l=t.g;c=t.p;u=t.t},function(t){d=t.u},function(t){h=t.s;f=t.d},function(t){p=t.S},function(t){g=t.S},function(t){v=t.I}],execute:function(){var m=this;var b=function(t,e){if(e===false){return t}var i;var n=false;t=x(t);if(e==="auto"||e==="exact"){if(w(t)){return y(t)}i=new URL(window.location.href)}else{try{n=e.startsWith("/")||e.startsWith("./");i=new URL(e,window.location.href)}catch(i){console.warn("Active Route: ".concat(e," is not a valid URL. Navigation highlighting has been disabled."));return t}}var o=k(t,i,e,n);if(o.length===0){return t}var r=o[0];r.main.isActiveOverride=true;if(r.sub)r.sub.isActiveOverride=true;return t};var w=function(t){return t.filter((function(t){return t.isActive})).length>0};var y=function(t){return t.map((function(t){var e;return Object.assign(Object.assign({},t),{isActiveOverride:t.isActive,flyout:(e=t.flyout)===null||e===void 0?void 0:e.map((function(t){return Object.assign(Object.assign({},t),{linkList:t.linkList.map((function(t){return Object.assign(Object.assign({},t),{isActiveOverride:t.isActive})}))})}))})}))};var x=function(t){return t.map((function(t){var e;return Object.assign(Object.assign({},t),{isActiveOverride:false,flyout:((e=t.flyout)===null||e===void 0?void 0:e.map((function(t){return Object.assign(Object.assign({},t),{linkList:t.linkList.map((function(t){return Object.assign(Object.assign({},t),{isActiveOverride:false})}))})})))||[]})}))};var k=function(t,e,i,n){var o=false;var r=[];t.filter((function(t){return!o&&t})).forEach((function(t){var s;try{var a=new URL(t.url);var l=_(e,a,n,i);o=j(r,l,{main:t,score:l},o)}catch(t){}(s=t.flyout)===null||s===void 0?void 0:s.forEach((function(s){var a;(a=s.linkList)===null||a===void 0?void 0:a.forEach((function(s){if(s.isActive&&(i==="auto"||i==="exact")){o=true;return}try{var a=new URL(s.url);var l=_(e,a,n,i);o=j(r,l,{main:t,sub:s,score:l},o)}catch(t){}}))}))}));return r.sort((function(t,e){return e.score-t.score}))};function j(t,e,i,n){var o=n;if(e>0){if(e===Infinity)o=true;t.push(i)}return o}var _=function(t,e,i,n){if(t===null||e===null){return 0}if(!i&&t.origin!==e.origin){return 0}var o=t.pathname.toLocaleLowerCase();var r=e.pathname.toLocaleLowerCase();if(o===r){return Infinity}if(t.pathname.length<e.pathname.length){return 0}if(n==="auto"){var s=__spreadArray([t.origin.toLocaleLowerCase()],o.split("/").filter((function(t){return t!==null&&t!==""})),true);var a=__spreadArray([e.origin.toLocaleLowerCase()],r.split("/").filter((function(t){return t!==null&&t!==""})),true);var l=O(s,a);return Math.min(s.length,a.length)===l?l:0}return 0};var O=function(t,e){if(t==null||e==null||t.length===0||e.length===0){return 0}var i=0;for(;i<Math.min(t.length,e.length);i++){if(t[i]!==e[i]){return 0}}return i};var S=null;var C=null;var A=function(){var t=document.querySelector("#PPM_HEADER_DATA");if((t===null||t===void 0?void 0:t.textContent)!=null){return JSON.parse(t.textContent)}return null};var z=function(t){return __awaiter(m,[t],void 0,(function(t){var e,i,n,o,r,s,a;var u=t.projectId,d=t.environment,h=t.language,f=t.cookieKey,p=t.localStorageKey,g=t.activeRouteProp,v=t.localizedCustomConfig,m=t.osFlyoutOverrides;return __generator(this,(function(t){switch(t.label){case 0:n=A();r=null;if(!n)return[3,1];o=n;s=document.documentElement.lang;return[3,3];case 1:if(S==null){S=I(u,d)}return[4,S];case 2:r=t.sent();s=l(Object.keys(r),h,p,f);if(s===undefined){throw new Error("Internet Header: unable to determine current language")}o=Object.assign({},r[s]);t.label=3;case 3:if(v){a=((e=v===null||v===void 0?void 0:v.header)===null||e===void 0?void 0:e.navMain)?Object.assign(Object.assign({},o.header),{navMain:__spreadArray(__spreadArray([],o.header.navMain,true),v.header.navMain,true)}):o.header;o=Object.assign(Object.assign({},o),{header:a})}if(m)o.header.navMain=P(o,m);if(g!=null)o.header.navMain=b(o.header.navMain,g);E((i=o===null||o===void 0?void 0:o.header)===null||i===void 0?void 0:i.navMain);c(s,f,p);return[2,o]}}))}))};var P=function(t,e){if(e==null)return t.header.navMain;return t.header.navMain.map((function(t){var i,n,o;if(t.id!=="flyout_os")return t;if(C===null){C=JSON.parse(JSON.stringify(t))}var r=(i=e.text)!==null&&i!==void 0?i:C.text;var s=(n=e.title)!==null&&n!==void 0?n:C.title;if(C.flyout==null||C.flyout.length===0||e.flyout==null||e.flyout.length===0)return Object.assign(Object.assign({},t),{title:s,text:r});var a=__spreadArray(__spreadArray([],C.flyout.map((function(t,i){var n,o;var r=(n=e.flyout)===null||n===void 0?void 0:n[i];var s=(o=r===null||r===void 0?void 0:r.title)!==null&&o!==void 0?o:t.title;var a=(r===null||r===void 0?void 0:r.linkList)!=null?r.linkList:[];return{title:s,linkList:__spreadArray(__spreadArray([],t.linkList,true),a,true)}})),true),((o=e.flyout)===null||o===void 0?void 0:o.slice(C.flyout.length))||[],true);return Object.assign(Object.assign({},t),{text:r,title:s,flyout:a})}))};var I=function(t,e){return __awaiter(m,void 0,void 0,(function(){var i,n,o;return __generator(this,(function(r){switch(r.label){case 0:if(!L(t)){throw new Error('Internet Header: invalid project id "'.concat(t,'"'))}if(t==="test"){e="int01"}i=R(t,e);r.label=1;case 1:r.trys.push([1,4,,5]);return[4,fetch(i)];case 2:n=r.sent();return[4,n.json()];case 3:return[2,r.sent()];case 4:o=r.sent();throw new Error("Internet Header: fetching config failed. ".concat(o.message));case 5:return[2]}}))}))};var R=function(t,e){if(t==="test")return"assets/config/test-configuration.json";var i=e.toLowerCase();var n=i==="prod";var o="https://".concat(n?"www":"int",".post.ch");try{return new URL("".concat(o,"/api/headerjs/Json?serviceid=").concat(encodeURIComponent(t)).concat(!n?"&environment="+i:"")).toString()}catch(t){throw new Error("Internet Header: Config URL is invalid.")}};var L=function(t){return t!==""&&t.length>0&&/^[a-zA-Z][\w-]*[a-zA-Z0-9]$/.test(t)};var N=function(t,e){var i;var n;try{n=typeof t==="string"?JSON.parse(t):t}catch(t){throw new Error("Internet Header: Custom config is invalid. Make sure your custom config contains valid JSON syntax and matches the definition. ")}var o=n[e];if((i=o===null||o===void 0?void 0:o.header)===null||i===void 0?void 0:i.navMain)E(o.header.navMain);return o};var E=function(t){t.forEach((function(t){t.id=t.id==="flyout_os"?t.id:d("main-nav-")}))};var F="@swisspost/internet-header";var T="1.16.2";var H="The header for client facing applications.";var J="Swiss Post <design-system@post.ch>";var K="Apache-2.0";var M={type:"git",url:"https://github.com/swisspost/design-system.git"};var D="https://design-system.post.ch";var U={url:"https://github.com/swisspost/design-system/issues"};var B="loader/index.cjs.js";var G="loader/index.js";var q="loader/index.es2017.js";var V="loader/index.d.ts";var X="dist/collection/collection-manifest.json";var Z="dist/swisspost-internet-header/swisspost-internet-header.esm.js";var Y={access:"public"};var $=["dist/","loader/"];var Q={dev:"stencil build --serve --port 9310 --watch --docs-readme --dev --config stencil.config.dev.ts",start:"stencil build --watch --docs-readme",build:"stencil build --docs-readme",clean:"rimraf www dist loader",test:"pnpm run unit",unit:"jest","unit:watch":"jest --watch",e2e:"cypress run","e2e:ci":"xvfb-run -a cypress run","e2e:watch":"cypress open",lint:"eslint src/**/*{.ts,.tsx}","lint:fix":"eslint src/**/*{.ts,.tsx} --fix",generate:"stencil generate"};var W={"@swisspost/design-system-styles":"workspace:9.9.0","body-scroll-lock":"4.0.0-beta.0","iframe-resizer":"4.4.5",jquery:"3.7.1","throttle-debounce":"5.0.2","url-polyfill":"1.1.12"};var tt={"@babel/core":"7.25.2","@percy/cli":"1.29.1","@percy/cypress":"3.1.2","@stencil-community/eslint-plugin":"0.8.0","@stencil/core":"4.19.2","@stencil/sass":"3.0.12","@stencil/store":"2.0.16","@types/body-scroll-lock":"3.1.2","@types/iframe-resizer":"3.5.13","@types/jest":"29.5.12","@types/jquery":"3.5.30","@types/node":"20.14.14","@types/throttle-debounce":"5.0.2","babel-loader":"9.1.3",bootstrap:"5.3.3",cypress:"13.13.2","cypress-each":"1.14.0","cypress-storybook":"1.0.0",eslint:"8.57.0","eslint-plugin-react":"7.35.0","focus-trap":"7.5.4",globby:"14.0.2",jest:"29.7.0","jest-environment-jsdom":"29.7.0",rimraf:"6.0.1","rollup-plugin-node-polyfills":"0.2.1","rollup-plugin-scss":"4.0.0","rollup-plugin-visualizer":"5.12.0",sass:"1.77.8","start-server-and-test":"2.0.5","ts-jest":"29.2.4",typescript:"5.9.3"};var et=["components","web-components","header","stencil","design-system","ui","frontend"];var it={name:F,version:T,description:H,author:J,license:K,repository:M,homepage:D,bugs:U,main:B,module:G,es2017:q,types:V,collection:X,"collection:main":"dist/collection/index.js",unpkg:Z,publishConfig:Y,files:$,scripts:Q,dependencies:W,devDependencies:tt,keywords:et};var nt=function(t){if(!(t instanceof HTMLElement||t instanceof SVGElement)){return false}var e=getComputedStyle(t);return["overflow","overflow-x","overflow-y"].some((function(t){var i=e.getPropertyValue(t);return i==="auto"||i==="scroll"}))};var ot=function(t){var e=t.parentElement;while(e){if(e.nodeName==="BODY"){return document}if(nt(e)){return e}e=e.parentElement}return document};var rt=function(t,e){var i=ot(t);var n=i instanceof Element?i.scrollTop:i.documentElement.scrollTop;var o=h.stickyness==="full"?0:n;var r,s;if(e){r=t.clientHeight-1;s=e.clientHeight}else{var a=window.getComputedStyle(t);var l=parseFloat(a.getPropertyValue("font-size"));s=parseFloat(a.getPropertyValue("--meta-header-height"))*l;r=s+parseFloat(a.getPropertyValue("--header-height"))*l}var c=1;if(s>0){c=Math.max((r-Math.max(o,0))/(r-s),1)}return c.toString()};var st=function(t,e){var i=ot(e);var n=function(){e.style.setProperty("--logo-scale",rt(e,t))};var o=s(150,n);var r=new IntersectionObserver((function(t){t.forEach((function(t){if(t.isIntersecting&&t.intersectionRatio>0){i.addEventListener("scroll",n,{passive:true});window.addEventListener("resize",o);window.requestAnimationFrame(n)}else{i.removeEventListener("scroll",n);window.removeEventListener("resize",o);window.requestAnimationFrame(n)}}))}),{threshold:[0,.001]});r.observe(t);return n};var at=':host{--post-contrast-color:#000;--post-focus-color:#1976c8;--post-contrast-color-inverted:#fff;--post-gray-10:hsl(0, 0%, 90%);--post-gray-20:hsl(0, 0%, 80%);--post-gray-40:hsl(0, 0%, 60%);--post-gray-60:hsl(0, 0%, 40%);--post-gray-80:hsl(0, 0%, 20%);--post-yellow:#fc0;--post-white:#fff;--post-light:#faf9f8;--post-gray:#f4f3f1;--post-dark:hsl(0, 0%, 20%);--post-black:#000;--post-primary:hsl(0, 0%, 20%);--post-secondary:hsl(0, 0%, 40%);--post-success:#2c871d;--post-warning:#f49e00;--post-error:#a51728;--post-info:#cce4ee;--post-success-background:#c0debb;--post-warning-background:#fce2b2;--post-error-background:#ffdade;--post-nightblue:#004976;--post-nightblue-bright:#0076a8;--post-petrol:#006d68;--post-petrol-bright:#00968f;--post-coral:#9e2a2f;--post-coral-bright:#e03c31;--post-olive:#716135;--post-olive-bright:#aa9d2e;--post-purple:#80276c;--post-purple-bright:#c5299b;--post-aubergine:#523178;--post-aubergine-bright:#7566a0;--post-contrast-color-rgb:0, 0, 0;--post-contrast-color-inverted-rgb:255, 255, 255;--post-gray-10-rgb:230, 230, 230;--post-gray-20-rgb:204, 204, 204;--post-gray-40-rgb:153, 153, 153;--post-gray-60-rgb:102, 102, 102;--post-gray-80-rgb:51, 51, 51;--post-black-alpha-10-rgba:rgba(0, 0, 0, 0.1);--post-black-alpha-20-rgba:rgba(0, 0, 0, 0.2);--post-black-alpha-40-rgba:rgba(0, 0, 0, 0.4);--post-black-alpha-60-rgba:rgba(0, 0, 0, 0.6);--post-black-alpha-80-rgba:rgba(0, 0, 0, 0.8);--post-white-alpha-10-rgba:rgba(255, 255, 255, 0.1);--post-white-alpha-20-rgba:rgba(255, 255, 255, 0.2);--post-white-alpha-40-rgba:rgba(255, 255, 255, 0.4);--post-white-alpha-60-rgba:rgba(255, 255, 255, 0.6);--post-white-alpha-80-rgba:rgba(255, 255, 255, 0.8);--post-yellow-rgb:255, 204, 0;--post-white-rgb:255, 255, 255;--post-light-rgb:250, 249, 248;--post-gray-rgb:244, 243, 241;--post-dark-rgb:51, 51, 51;--post-black-rgb:0, 0, 0;--post-primary-rgb:51, 51, 51;--post-secondary-rgb:102, 102, 102;--post-success-rgb:44, 135, 29;--post-warning-rgb:244, 158, 0;--post-error-rgb:165, 23, 40;--post-info-rgb:204, 228, 238;--post-success-background-rgb:192, 222, 187;--post-warning-background-rgb:252, 226, 178;--post-error-background-rgb:255, 218, 222;--post-nightblue-rgb:0, 73, 118;--post-nightblue-bright-rgb:0, 118, 168;--post-petrol-rgb:0, 109, 104;--post-petrol-bright-rgb:0, 150, 143;--post-coral-rgb:158, 42, 47;--post-coral-bright-rgb:224, 60, 49;--post-olive-rgb:113, 97, 53;--post-olive-bright-rgb:170, 157, 46;--post-purple-rgb:128, 39, 108;--post-purple-bright-rgb:197, 41, 155;--post-aubergine-rgb:82, 49, 120;--post-aubergine-bright-rgb:117, 102, 160}@font-face{font-display:swap;font-family:"Swiss Post Sans";font-weight:700;src:url("https://fonts.post.ch/swiss-post-sans/v1/SwissPostSans-Bold.woff2") format("woff2"),url("https://fonts.post.ch/swiss-post-sans/v1/SwissPostSans-Bold.woff") format("woff")}@font-face{font-display:swap;font-family:"Swiss Post Sans";font-weight:400;src:url("https://fonts.post.ch/swiss-post-sans/v1/SwissPostSans-Regular.woff2") format("woff2"),url("https://fonts.post.ch/swiss-post-sans/v1/SwissPostSans-Regular.woff") format("woff")}@font-face{font-display:swap;font-family:"Swiss Post Sans";font-weight:300;src:url("https://fonts.post.ch/swiss-post-sans/v1/SwissPostSans-Light.woff2") format("woff2"),url("https://fonts.post.ch/swiss-post-sans/v1/SwissPostSans-Light.woff") format("woff")}.visually-hidden{position:absolute;width:1px;height:1px;border:0;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0)}.btn-blank{background-color:rgba(0,0,0,0);border:none;border-radius:0;padding:0}.nav-link{outline:none;outline-offset:2px;text-decoration:none;color:rgba(0,0,0,.8);-webkit-transition:color 200ms;transition:color 200ms;background-color:rgba(0,0,0,0);-webkit-box-shadow:none;box-shadow:none;border:0;margin:0;cursor:pointer;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;gap:.5rem}.nav-link:is(:focus-visible,:focus-within,.pretend-focus){outline:2px solid var(--post-contrast-color)}.nav-link:hover,.nav-link:focus{color:#000}.nav-link:is(:focus-visible,:focus-within,.pretend-focus){z-index:1;position:relative}.nav-link>svg{width:1.4em;height:1.4em;-ms-flex-negative:0;flex-shrink:0}.nav-link>span{-ms-flex-negative:1;flex-shrink:1}.no-list{list-style:none;padding-left:0;margin-top:0;margin-bottom:0}*,:host,*::before,*::after{-webkit-box-sizing:border-box;box-sizing:border-box}:host{font-family:"Swiss Post Sans",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif}button{font:inherit;padding:0}a,button{border-radius:4px;outline:none;outline-offset:2px}a:is(:focus-visible,:focus-within,.pretend-focus),button:is(:focus-visible,:focus-within,.pretend-focus){outline:2px solid var(--post-contrast-color);border-radius:4px}img,svg{max-width:100%;max-height:100%}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){svg{color:currentColor;forced-color-adjust:preserve-parent-color}}.box>*:first-child{margin-top:0}.box>*:last-child{margin-bottom:0}.mirrored{-webkit-transform:scaleX(-1);transform:scaleX(-1)}.rotate-270{-webkit-transform:rotate(270deg);transform:rotate(270deg)}.bold{font-weight:700}.light{font-weight:300}.d-none{display:none !important}.d-flex{display:-ms-flexbox;display:flex}.d-inline-flex{display:-ms-inline-flexbox;display:inline-flex}.align-items-center{-ms-flex-align:center;align-items:center}@media (min-width: 1441px){.wide-container{margin:0 auto;max-width:1440px}}@media (max-width: 599.98px){.container{padding-right:16px;padding-left:16px}}@media (min-width: 600px)and (max-width: 1023.98px){.container{padding-right:32px;padding-left:32px}}@media (min-width: 1024px){.container{padding-right:40px;padding-left:40px}}@media (max-width: -0.02px){.hidden-xs{display:none}}@media (max-width: 399.98px){.hidden-sm{display:none}}@media (max-width: 599.98px){.hidden-rg{display:none}}@media (max-width: 779.98px){.hidden-md{display:none}}@media (max-width: 1023.98px){.hidden-lg{display:none}}@media (max-width: 1279.98px){.hidden-xl{display:none}}@media (max-width: 1439.98px){.hidden-xxl{display:none}}:host{--logo-scale:1}@media (max-width: 1023.98px){:host{--logo-scale:1 !important}}post-header-logo{height:var(--header-height);width:var(--header-height);-webkit-transform-origin:bottom left;transform-origin:bottom left;-webkit-transform:scale(var(--logo-scale));transform:scale(var(--logo-scale))}post-main-navigation{margin-left:calc(var(--header-height)*var(--logo-scale) - var(--header-height))}:host{display:block;position:relative;font-size:1rem;font-weight:300;z-index:var(--header-z-index, 10);--language-dropdown-margin-top:0px;--meta-header-height:var(--post-meta-header-height, 0px);--header-height:var(--post-header-height, 3.5rem)}@media (min-width: 1024px){:host{--meta-header-height:var(--post-meta-header-height, 3rem)}}@media (min-width: 1024px){:host{--header-height:var(--post-header-height, 4rem)}}@media (min-width: 1280px){:host{--header-height:var(--post-header-height, 4.5rem)}}:host([meta=false]){--meta-header-height:0px;--language-dropdown-margin-top:1px}@supports ((position: -webkit-sticky) or (position: sticky)){:host(:not(.stickyness-none)){position:-webkit-sticky;position:sticky}:host(.stickyness-full){top:0}:host(.stickyness-main){top:calc(var(--meta-header-height, 0px)*-1)}:host(.stickyness-minimal){top:calc((var(--header-height, 0px) + var(--meta-header-height, 0px) + 1px)*-1);-webkit-transition:top 200ms ease-in;transition:top 200ms ease-in}:host(.stickyness-minimal.scrolling-up),:host(.stickyness-minimal.dropdown-open){top:calc(var(--meta-header-height, 0px)*-1);--header-slide-in-transition:var(--post-header-slide-in-transition, top 200ms ease-out);-webkit-transition:var(--header-slide-in-transition);transition:var(--header-slide-in-transition)}}.post-internet-header{border-bottom:1px solid #e6e6e6;background-color:#fff}.main-navigation-container{display:-ms-flexbox;display:flex}.main-navigation-container>.main-navigation-controls{-ms-flex:0 1 auto;flex:0 1 auto}.main-navigation{display:-ms-flexbox;display:flex}.sub-navigation-container{position:absolute;top:100%;left:0;width:100%;display:-ms-flexbox;display:flex;background:#fff;visibility:hidden}.main-navigation-item:hover .sub-navigation-container{visibility:visible}.main-navigation-controls{display:-ms-flexbox;display:flex;margin-left:auto}@media (max-width: 1023.98px){.main-navigation-controls{font-weight:400}}@media (min-width: 1024px){.main-navigation-controls{font-size:1.0625rem}}.main-navigation-controls>*{border-left:1px solid #e6e6e6;-ms-flex:0 0 auto;flex:0 0 auto}.main-navigation-custom-content{max-height:var(--header-height);display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-negative:1;flex-shrink:1}.menu-button{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;padding:0 calc(1rem - 1px);font-weight:300;cursor:pointer;border-left:1px solid #e6e6e6;-ms-flex-order:1;order:1}@media (min-width: 1024px){.menu-button{display:none}}@media (min-width: 600px)and (max-width: 1023.98px){.menu-button .visually-hidden{position:static;width:auto;height:auto;margin:auto;overflow:visible;clip:auto;visibility:visible;margin-right:.5rem}}.menu-button svg{width:1.5rem;height:1.5rem}.full-width .wide-container{max-width:none}';var lt=at;var ct=t("P",function(){function t(t){e(this,t);this.headerLoaded=i(this,"headerLoaded",7);this.lastScrollTop=window.scrollY||document.documentElement.scrollTop;this.lastWindowWidth=window.innerWidth;this.handleClickOutsideBound=this.handleClickOutside.bind(this);this.project=undefined;this.stickyness="minimal";this.language=undefined;this.meta=true;this.login=true;this.search=true;this.skiplinks=true;this.configProxy=undefined;this.environment="prod";this.languageSwitchOverrides=undefined;this.customConfig=undefined;this.languageCookieKey=undefined;this.languageLocalStorageKey="swisspost-internet-header-language";this.logoutUrl=undefined;this.selfAdminOrigin=undefined;this.activeRoute="auto";this.osFlyoutOverrides=undefined;this.fullWidth=false;this.activeFlyout=null;this.activeDropdownElement=null;this.isMainSlotEmpty=true;if(this.project===undefined||this.project===""||!L(this.project)){throw new Error('Internet Header project key is "'.concat(this.project,'". Please provide a valid project key.'))}}t.prototype.getCurrentLanguage=function(){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(e){return[2,(t=h.currentLanguage)!==null&&t!==void 0?t:"de"]}))}))};t.prototype.connectedCallback=function(){var t=this;this.throttledScroll=a(300,(function(){return t.handleScrollEvent()}));this.debouncedResize=s(200,(function(){return t.handleResize()}))};t.prototype.disconnectedCallback=function(){this.scrollParent.removeEventListener("scroll",this.throttledScroll);this.scrollParent.removeEventListener("resize",this.debouncedResize);f()};t.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var t,e,i,n;return __generator(this,(function(o){switch(o.label){case 0:this.scrollParent=ot(this.host);this.scrollParent.addEventListener("scroll",this.throttledScroll,{passive:true});this.scrollParent.addEventListener("resize",this.debouncedResize,{passive:true});o.label=1;case 1:o.trys.push([1,3,,4]);h.projectId=this.project;h.stickyness=this.stickyness;h.environment=this.environment.toLocaleLowerCase();if(this.language!==undefined)h.currentLanguage=this.language;h.languageSwitchOverrides=typeof this.languageSwitchOverrides==="string"?JSON.parse(this.languageSwitchOverrides):this.languageSwitchOverrides;h.osFlyoutOverrides=typeof this.osFlyoutOverrides==="string"?JSON.parse(this.osFlyoutOverrides):this.osFlyoutOverrides;if(this.customConfig!==undefined){t=Object.keys(typeof this.customConfig==="string"?JSON.parse(this.customConfig):this.customConfig);e=h.currentLanguage||l(t,this.language);h.localizedCustomConfig=N(this.customConfig,e)}i=h;return[4,z({projectId:this.project,environment:h.environment,language:this.language,cookieKey:this.languageCookieKey,localStorageKey:this.languageLocalStorageKey,activeRouteProp:this.activeRoute,localizedCustomConfig:h.localizedCustomConfig,osFlyoutOverrides:h.osFlyoutOverrides})];case 2:i.localizedConfig=o.sent();return[3,4];case 3:n=o.sent();console.error(n);return[3,4];case 4:return[2]}}))}))};t.prototype.componentDidLoad=function(){var t=this;window.requestAnimationFrame((function(){t.handleResize();t.headerLoaded.emit();t.host.classList.add("header-loaded");if(t.meta&&t.metaNav){t.updateLogoAnimation=st(t.metaNav,t.host)}else{var e=window.getComputedStyle(document.documentElement);if(e.getPropertyValue("--post-meta-header-height")!==""){document.documentElement.style.setProperty("--post-meta-header-height","0px")}}}));if(this.stickyness==="full")console.warn('Internet Header: The stickyness="full" option is deprecated.')};t.prototype.handleLanguageChange=function(t){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(i){switch(i.label){case 0:h.currentLanguage=t;e=h;return[4,z({projectId:this.project,environment:this.environment,language:t,cookieKey:this.languageCookieKey,localStorageKey:this.languageLocalStorageKey,activeRouteProp:this.activeRoute,localizedCustomConfig:h.localizedCustomConfig,osFlyoutOverrides:h.osFlyoutOverrides})];case 1:e.localizedConfig=i.sent();if(this.customConfig!==undefined)h.localizedCustomConfig=N(this.customConfig,t);return[2]}}))}))};t.prototype.handleAvailableLanguagesChange=function(t){h.languageSwitchOverrides=typeof t==="string"?JSON.parse(t):t};t.prototype.handleOsFlyoutOverrides=function(t){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(i){switch(i.label){case 0:h.osFlyoutOverrides=typeof t==="string"?JSON.parse(t):t;e=h;return[4,z({projectId:this.project,environment:this.environment,language:this.language,cookieKey:this.languageCookieKey,localStorageKey:this.languageLocalStorageKey,activeRouteProp:this.activeRoute,localizedCustomConfig:h.localizedCustomConfig,osFlyoutOverrides:h.osFlyoutOverrides})];case 1:e.localizedConfig=i.sent();return[2]}}))}))};t.prototype.handleActiveRouteChange=function(t){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(i){switch(i.label){case 0:e=h;return[4,z({projectId:this.project,environment:this.environment,language:this.language,cookieKey:this.languageCookieKey,localStorageKey:this.languageLocalStorageKey,activeRouteProp:t,localizedCustomConfig:h.localizedCustomConfig,osFlyoutOverrides:h.osFlyoutOverrides})];case 1:e.localizedConfig=i.sent();return[2]}}))}))};t.prototype.handleCustomConfigChange=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i;return __generator(this,(function(n){switch(n.label){case 0:if(this.language===undefined)return[2];e=N(t,this.language);h.localizedCustomConfig=e;i=h;return[4,z({projectId:this.project,environment:this.environment,language:this.language,cookieKey:this.languageCookieKey,localStorageKey:this.languageLocalStorageKey,activeRouteProp:this.activeRoute,localizedCustomConfig:e,osFlyoutOverrides:h.osFlyoutOverrides})];case 1:i.localizedConfig=n.sent();return[2]}}))}))};t.prototype.handleSearchChange=function(t){h.search=t};t.prototype.handleLoginChange=function(t){h.login=t};t.prototype.handleMetaChange=function(t){h.meta=t};t.prototype.handleLanguageChangeEvent=function(t){void this.handleLanguageChange(t.detail)};t.prototype.handleStickynessChange=function(t){h.stickyness=t;if(typeof this.updateLogoAnimation==="function")this.updateLogoAnimation()};t.prototype.handleClickOutside=function(t){if(this.activeDropdownElement&&!t.composedPath().includes(this.activeDropdownElement)){void this.activeDropdownElement.toggleDropdown(false)}};t.prototype.handleKeyUp=function(t){if(t.key==="Escape"){if(this.activeDropdownElement){void this.activeDropdownElement.toggleDropdown(false)}if(this.activeFlyout!==null&&this.mainNav){void this.mainNav.toggleDropdown(false)}}};t.prototype.handleScrollEvent=function(){var t=this.scrollParent instanceof Document?this.scrollParent.documentElement.scrollTop:this.scrollParent.scrollTop;if(this.stickyness==="minimal"){this.host.classList.toggle("scrolling-up",t<=this.lastScrollTop)}this.lastScrollTop=t<=0?0:t};t.prototype.handleResize=function(){var t;if(this.isMainNavOpen()&&this.lastWindowWidth<1024&&window.innerWidth>=1024){(t=this.activeDropdownElement)===null||t===void 0?void 0:t.toggleDropdown(false)}this.lastWindowWidth=window.innerWidth};t.prototype.handleDropdownToggled=function(t){var e=this;if(!t.detail.open&&this.activeDropdownElement!==t.detail.element){return}if(t.detail.open){if(this.activeDropdownElement){void this.activeDropdownElement.toggleDropdown(false)}this.activeDropdownElement=t.detail.element;if(window.innerWidth>=1024){window.setTimeout((function(){window.addEventListener("click",e.handleClickOutsideBound)}),10)}if(this.activeFlyout!==null&&this.mainNav){void this.mainNav.setActiveFlyout(null)}}else{this.activeDropdownElement=null;window.removeEventListener("click",this.handleClickOutsideBound)}};t.prototype.handleFlyoutToggled=function(t){this.activeFlyout=t.detail;if(this.activeDropdownElement&&t.detail!==null&&!this.isMainNavOpen()){void this.activeDropdownElement.toggleDropdown(false)}};t.prototype.toggleMobileDropdown=function(){var t;(t=this.mainNav)===null||t===void 0?void 0:t.toggleDropdown()};t.prototype.isMainNavOpen=function(){return this.activeDropdownElement&&this.activeDropdownElement.tagName==="POST-MAIN-NAVIGATION"};t.prototype.handleMainSlotChange=function(t){var e=t.target;this.isMainSlotEmpty=e.assignedElements().length===0};t.prototype.render=function(){var t=this;var e,i,r;if(!((e=h.localizedConfig)===null||e===void 0?void 0:e.header)){console.error(new Error("Internet Header: Config cannot be loaded"));return}var s=h.localizedConfig;var a=this.meta&&s.header.navMeta!==undefined&&((i=s.header.navMeta)===null||i===void 0?void 0:i.filter((function(t){return!t.isHomeLink})).length)>0;var l=((r=this.login)!==null&&r!==void 0?r:!s.header.isLoginWidgetHidden)&&s.header.loginWidgetOptions;var c=s.header.navLang.length>1;var d=a?rt(this.host):"1";return n(o,{class:"stickyness-".concat(this.stickyness," ").concat(Boolean(this.activeDropdownElement)||Boolean(this.activeFlyout)?"dropdown-open":""),"data-version":it.version,onKeyup:function(e){return t.handleKeyUp(e)},style:{"--logo-scale":d}},n("header",{class:"post-internet-header".concat(this.fullWidth?" full-width":"")},n(p,null),n("h1",{class:"visually-hidden"},u("Navigate on post.ch")),n(v,{condition:this.skiplinks},n("post-skiplinks",null)),n(v,{condition:a},n("post-meta-navigation",{orientation:"horizontal",class:"hidden-lg","full-width":this.fullWidth,ref:function(e){return t.metaNav=e}},n(v,{condition:c},n("post-language-switch",{id:"post-language-switch-desktop",mode:"dropdown",onDropdownToggled:function(e){return t.handleDropdownToggled(e)}})))),n("div",{class:"main-navigation-container wide-container"},n("post-header-logo",null),n("button",{class:"menu-button nav-link",onClick:function(){return t.toggleMobileDropdown()},"aria-haspopup":"menu","aria-controls":"post-internet-header-main-navigation","aria-expanded":this.activeDropdownElement?"true":"false"},n("span",{class:"menu-button-text visually-hidden"},s.header.mobileMenu.text),n(g,{name:this.isMainNavOpen()?"pi-close":"pi-menu"})),n("post-main-navigation",{onDropdownToggled:function(e){return t.handleDropdownToggled(e)},onFlyoutToggled:function(e){return t.handleFlyoutToggled(e)},ref:function(e){return t.mainNav=e}},n(v,{condition:a},n("post-meta-navigation",{orientation:"vertical"},n(v,{condition:c},n("post-language-switch",{id:"post-language-switch-mobile",mode:"list"}))))),n("div",{class:"main-navigation-controls"},n("div",{class:"main-navigation-custom-content".concat(this.isMainSlotEmpty?" d-none":"")},n("slot",{name:"main",onSlotchange:function(e){return t.handleMainSlotChange(e)}})),n(v,{condition:this.search},n("post-search",{onDropdownToggled:function(e){return t.handleDropdownToggled(e)}})),n(v,{condition:!!l},n("post-klp-login-widget",{"logout-url":this.logoutUrl,"self-admin-origin":this.selfAdminOrigin},n("slot",{name:"login-widget"}))),n(v,{condition:!a&&c},n("post-language-switch",{id:"post-language-switch-no-meta",onDropdownToggled:function(e){return t.handleDropdownToggled(e)},mode:"dropdown"}))))))};Object.defineProperty(t.prototype,"host",{get:function(){return r(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{language:["handleLanguageChange"],languageSwitchOverrides:["handleAvailableLanguagesChange"],osFlyoutOverrides:["handleOsFlyoutOverrides"],activeRoute:["handleActiveRouteChange"],customConfig:["handleCustomConfigChange"],search:["handleSearchChange"],login:["handleLoginChange"],meta:["handleMetaChange"],stickyness:["handleStickynessChange"]}},enumerable:false,configurable:true});return t}());ct.style=lt}}}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{P as swisspost_internet_header}from"./p-
|
|
1
|
+
export{P as swisspost_internet_header}from"./p-5c93e1e9.js";import"./p-67f6b5a8.js";import"./p-151d419a.js";import"./p-6c4128db.js";import"./p-78d28548.js";import"./p-a39139a9.js";import"./p-fa4599e6.js";import"./p-a0313d87.js";import"./p-840aa5c6.js";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import{r as n,h as t,H as e,g as r}from"./p-67f6b5a8.js";
|
|
2
|
+
/*!
|
|
3
|
+
* tabbable 6.2.0
|
|
4
|
+
* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
|
|
5
|
+
*/
|
|
6
|
+
var o=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],i=o.join(","),u="undefined"==typeof Element,a=u?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,c=!u&&Element.prototype.getRootNode?function(n){var t;return null==n||null===(t=n.getRootNode)||void 0===t?void 0:t.call(n)}:function(n){return null==n?void 0:n.ownerDocument},f=function n(t,e){var r;void 0===e&&(e=!0);var o=null==t||null===(r=t.getAttribute)||void 0===r?void 0:r.call(t,"inert");return""===o||"true"===o||e&&t&&n(t.parentNode)},l=function(n,t,e){if(f(n))return[];var r=Array.prototype.slice.apply(n.querySelectorAll(i));return t&&a.call(n,i)&&r.unshift(n),r.filter(e)},s=function n(t,e,r){for(var o=[],u=Array.from(t);u.length;){var c=u.shift();if(!f(c,!1))if("SLOT"===c.tagName){var l=c.assignedElements(),s=n(l.length?l:c.children,!0,r);r.flatten?o.push.apply(o,s):o.push({scopeParent:c,candidates:s})}else{a.call(c,i)&&r.filter(c)&&(e||!t.includes(c))&&o.push(c);var v=c.shadowRoot||"function"==typeof r.getShadowRoot&&r.getShadowRoot(c),d=!f(v,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(c));if(v&&d){var b=n(!0===v?c.children:v.children,!0,r);r.flatten?o.push.apply(o,b):o.push({scopeParent:c,candidates:b})}else u.unshift.apply(u,c.children)}}return o},v=function(n){return!isNaN(parseInt(n.getAttribute("tabindex"),10))},d=function(n){if(!n)throw new Error("No node provided");return n.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(n.tagName)||function(n){var t,e=null==n||null===(t=n.getAttribute)||void 0===t?void 0:t.call(n,"contenteditable");return""===e||"true"===e}(n))&&!v(n)?0:n.tabIndex},b=function(n,t){return n.tabIndex===t.tabIndex?n.documentOrder-t.documentOrder:n.tabIndex-t.tabIndex},p=function(n){return"INPUT"===n.tagName},h=function(n){var t=n.getBoundingClientRect();return 0===t.width&&0===t.height},w=function(n,t){return!(t.disabled||f(t)||function(n){return p(n)&&"hidden"===n.type}(t)||function(n,t){var e=t.displayCheck,r=t.getShadowRoot;if("hidden"===getComputedStyle(n).visibility)return!0;var o=a.call(n,"details>summary:first-of-type");if(a.call(o?n.parentElement:n,"details:not([open]) *"))return!0;if(e&&"full"!==e&&"legacy-full"!==e){if("non-zero-area"===e)return h(n)}else{if("function"==typeof r){for(var i=n;n;){var u=n.parentElement,f=c(n);if(u&&!u.shadowRoot&&!0===r(u))return h(n);n=n.assignedSlot?n.assignedSlot:u||f===n.ownerDocument?u:f.host}n=i}if(function(n){var t,e,r,o,i=n&&c(n),u=null===(t=i)||void 0===t?void 0:t.host,a=!1;if(i&&i!==n)for(a=!!(null!==(e=u)&&void 0!==e&&null!==(r=e.ownerDocument)&&void 0!==r&&r.contains(u)||null!=n&&null!==(o=n.ownerDocument)&&void 0!==o&&o.contains(n));!a&&u;){var f,l,s;a=!(null===(l=u=null===(f=i=c(u))||void 0===f?void 0:f.host)||void 0===l||null===(s=l.ownerDocument)||void 0===s||!s.contains(u))}return a}(n))return!n.getClientRects().length;if("legacy-full"!==e)return!0}return!1}(t,n)||function(n){return"DETAILS"===n.tagName&&Array.prototype.slice.apply(n.children).some((function(n){return"SUMMARY"===n.tagName}))}(t)||function(n){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(n.tagName))for(var t=n.parentElement;t;){if("FIELDSET"===t.tagName&&t.disabled){for(var e=0;e<t.children.length;e++){var r=t.children.item(e);if("LEGEND"===r.tagName)return!!a.call(t,"fieldset[disabled] *")||!r.contains(n)}return!0}t=t.parentElement}return!1}(t))},y=function(n,t){return!(function(n){return function(n){return p(n)&&"radio"===n.type}(n)&&!function(n){if(!n.name)return!0;var t,e=n.form||c(n),r=function(n){return e.querySelectorAll('input[type="radio"][name="'+n+'"]')};if("undefined"!=typeof window&&void 0!==window.CSS&&"function"==typeof window.CSS.escape)t=r(window.CSS.escape(n.name));else try{t=r(n.name)}catch(n){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",n.message),!1}var o=function(n,t){for(var e=0;e<n.length;e++)if(n[e].checked&&n[e].form===t)return n[e]}(t,n.form);return!o||o===n}(n)}(t)||d(t)<0||!w(n,t))},m=function(n){var t=parseInt(n.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},E=function n(t){var e=[],r=[];return t.forEach((function(t,o){var i=!!t.scopeParent,u=i?t.scopeParent:t,a=function(n,t){var e=d(n);return e<0&&t&&!v(n)?0:e}(u,i),c=i?n(t.candidates):u;0===a?i?e.push.apply(e,c):e.push(u):r.push({documentOrder:o,tabIndex:a,item:t,isScope:i,content:c})})),r.sort(b).reduce((function(n,t){return t.isScope?n.push.apply(n,t.content):n.push(t.content),n}),[]).concat(e)},T=function(n,t){if(t=t||{},!n)throw new Error("No node provided");return!1!==a.call(n,i)&&y(t,n)},g=o.concat("iframe").join(","),O=function(n,t){if(t=t||{},!n)throw new Error("No node provided");return!1!==a.call(n,g)&&w(t,n)};
|
|
7
|
+
/*!
|
|
8
|
+
* focus-trap 7.5.4
|
|
9
|
+
* @license MIT, https://github.com/focus-trap/focus-trap/blob/master/LICENSE
|
|
10
|
+
*/
|
|
11
|
+
function k(n,t){var e=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable}))),e.push.apply(e,r)}return e}function F(n){for(var t=1;t<arguments.length;t++){var e=null!=arguments[t]?arguments[t]:{};t%2?k(Object(e),!0).forEach((function(t){var r,o,i;r=n,i=e[t],(o=function(n){var t=function(n){if("object"!=typeof n||null===n)return n;var t=n[Symbol.toPrimitive];if(void 0!==t){var e=t.call(n,"string");if("object"!=typeof e)return e;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(n)}(n);return"symbol"==typeof t?t:String(t)}(o=t))in r?Object.defineProperty(r,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[o]=i})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(e)):k(Object(e)).forEach((function(t){Object.defineProperty(n,t,Object.getOwnPropertyDescriptor(e,t))}))}return n}var N=function(n){return"Tab"===(null==n?void 0:n.key)||9===(null==n?void 0:n.keyCode)},A=function(n){return N(n)&&!n.shiftKey},S=function(n){return N(n)&&n.shiftKey},D=function(n){return setTimeout(n,0)},j=function(n,t){var e=-1;return n.every((function(n,r){return!t(n)||(e=r,!1)})),e},C=function(n){for(var t=arguments.length,e=new Array(t>1?t-1:0),r=1;r<t;r++)e[r-1]=arguments[r];return"function"==typeof n?n.apply(void 0,e):n},I=function(n){return n.target.shadowRoot&&"function"==typeof n.composedPath?n.composedPath()[0]:n.target},P=[],x=function(n,t){var e,r=(null==t?void 0:t.document)||document,o=(null==t?void 0:t.trapStack)||P,i=F({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,isKeyForward:A,isKeyBackward:S},t),u={containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,delayInitialFocusTimer:void 0,recentNavEvent:void 0},a=function(n,t,e){return n&&void 0!==n[t]?n[t]:i[e||t]},c=function(n,t){var e="function"==typeof(null==t?void 0:t.composedPath)?t.composedPath():void 0;return u.containerGroups.findIndex((function(t){var r=t.container,o=t.tabbableNodes;return r.contains(n)||(null==e?void 0:e.includes(r))||o.find((function(t){return t===n}))}))},f=function(n){var t=i[n];if("function"==typeof t){for(var e=arguments.length,o=new Array(e>1?e-1:0),u=1;u<e;u++)o[u-1]=arguments[u];t=t.apply(void 0,o)}if(!0===t&&(t=void 0),!t){if(void 0===t||!1===t)return t;throw new Error("`".concat(n,"` was specified but was not a node, or did not return a node"))}var a=t;if("string"==typeof t&&!(a=r.querySelector(t)))throw new Error("`".concat(n,"` as selector refers to no known node"));return a},v=function(){var n=f("initialFocus");if(!1===n)return!1;if(void 0===n||!O(n,i.tabbableOptions))if(c(r.activeElement)>=0)n=r.activeElement;else{var t=u.tabbableGroups[0];n=t&&t.firstTabbableNode||f("fallbackFocus")}if(!n)throw new Error("Your focus-trap needs to have at least one focusable element");return n},b=function(){if(u.containerGroups=u.containers.map((function(n){var t=function(n,t){var e;return e=(t=t||{}).getShadowRoot?s([n],t.includeContainer,{filter:y.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:m}):l(n,t.includeContainer,y.bind(null,t)),E(e)}(n,i.tabbableOptions),e=function(n,t){return(t=t||{}).getShadowRoot?s([n],t.includeContainer,{filter:w.bind(null,t),flatten:!0,getShadowRoot:t.getShadowRoot}):l(n,t.includeContainer,w.bind(null,t))}(n,i.tabbableOptions),r=t.length>0?t[0]:void 0,o=t.length>0?t[t.length-1]:void 0,u=e.find((function(n){return T(n)})),a=e.slice().reverse().find((function(n){return T(n)})),c=!!t.find((function(n){return d(n)>0}));return{container:n,tabbableNodes:t,focusableNodes:e,posTabIndexesFound:c,firstTabbableNode:r,lastTabbableNode:o,firstDomTabbableNode:u,lastDomTabbableNode:a,nextTabbableNode:function(n){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],o=t.indexOf(n);return o<0?r?e.slice(e.indexOf(n)+1).find((function(n){return T(n)})):e.slice(0,e.indexOf(n)).reverse().find((function(n){return T(n)})):t[o+(r?1:-1)]}}})),u.tabbableGroups=u.containerGroups.filter((function(n){return n.tabbableNodes.length>0})),u.tabbableGroups.length<=0&&!f("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");if(u.containerGroups.find((function(n){return n.posTabIndexesFound}))&&u.containerGroups.length>1)throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.")},p=function n(t){var e=t.activeElement;if(e)return e.shadowRoot&&null!==e.shadowRoot.activeElement?n(e.shadowRoot):e},h=function n(t){!1!==t&&t!==p(document)&&(t&&t.focus?(t.focus({preventScroll:!!i.preventScroll}),u.mostRecentlyFocusedNode=t,function(n){return n.tagName&&"input"===n.tagName.toLowerCase()&&"function"==typeof n.select}(t)&&t.select()):n(v()))},g=function(n){var t=f("setReturnFocus",n);return t||!1!==t&&n},k=function(n){var t=n.target,e=n.event,r=n.isBackward,o=void 0!==r&&r;t=t||I(e),b();var a=null;if(u.tabbableGroups.length>0){var l=c(t,e),s=l>=0?u.containerGroups[l]:void 0;if(l<0)a=o?u.tabbableGroups[u.tabbableGroups.length-1].lastTabbableNode:u.tabbableGroups[0].firstTabbableNode;else if(o){var v=j(u.tabbableGroups,(function(n){return t===n.firstTabbableNode}));if(v<0&&(s.container===t||O(t,i.tabbableOptions)&&!T(t,i.tabbableOptions)&&!s.nextTabbableNode(t,!1))&&(v=l),v>=0){var p=u.tabbableGroups[0===v?u.tabbableGroups.length-1:v-1];a=d(t)>=0?p.lastTabbableNode:p.lastDomTabbableNode}else N(e)||(a=s.nextTabbableNode(t,!1))}else{var h=j(u.tabbableGroups,(function(n){return t===n.lastTabbableNode}));if(h<0&&(s.container===t||O(t,i.tabbableOptions)&&!T(t,i.tabbableOptions)&&!s.nextTabbableNode(t))&&(h=l),h>=0){var w=u.tabbableGroups[h===u.tabbableGroups.length-1?0:h+1];a=d(t)>=0?w.firstTabbableNode:w.firstDomTabbableNode}else N(e)||(a=s.nextTabbableNode(t))}}else a=f("fallbackFocus");return a},x=function(n){var t=I(n);c(t,n)>=0||(C(i.clickOutsideDeactivates,n)?e.deactivate({returnFocus:i.returnFocusOnDeactivate}):C(i.allowOutsideClick,n)||n.preventDefault())},L=function(n){var t=I(n),e=c(t,n)>=0;if(e||t instanceof Document)e&&(u.mostRecentlyFocusedNode=t);else{var r;n.stopImmediatePropagation();var o=!0;if(u.mostRecentlyFocusedNode)if(d(u.mostRecentlyFocusedNode)>0){var a=c(u.mostRecentlyFocusedNode),f=u.containerGroups[a].tabbableNodes;if(f.length>0){var l=f.findIndex((function(n){return n===u.mostRecentlyFocusedNode}));l>=0&&(i.isKeyForward(u.recentNavEvent)?l+1<f.length&&(r=f[l+1],o=!1):l-1>=0&&(r=f[l-1],o=!1))}}else u.containerGroups.some((function(n){return n.tabbableNodes.some((function(n){return d(n)>0}))}))||(o=!1);else o=!1;o&&(r=k({target:u.mostRecentlyFocusedNode,isBackward:i.isKeyBackward(u.recentNavEvent)})),h(r||u.mostRecentlyFocusedNode||v())}u.recentNavEvent=void 0},R=function(n){if(("Escape"===(null==(t=n)?void 0:t.key)||"Esc"===(null==t?void 0:t.key)||27===(null==t?void 0:t.keyCode))&&!1!==C(i.escapeDeactivates,n))return n.preventDefault(),void e.deactivate();var t;(i.isKeyForward(n)||i.isKeyBackward(n))&&function(n){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];u.recentNavEvent=n;var e=k({event:n,isBackward:t});e&&(N(n)&&n.preventDefault(),h(e))}(n,i.isKeyBackward(n))},U=function(n){var t=I(n);c(t,n)>=0||C(i.clickOutsideDeactivates,n)||C(i.allowOutsideClick,n)||(n.preventDefault(),n.stopImmediatePropagation())},B=function(){if(u.active)return function(n,t){if(n.length>0){var e=n[n.length-1];e!==t&&e.pause()}var r=n.indexOf(t);-1===r||n.splice(r,1),n.push(t)}(o,e),u.delayInitialFocusTimer=i.delayInitialFocus?D((function(){h(v())})):h(v()),r.addEventListener("focusin",L,!0),r.addEventListener("mousedown",x,{capture:!0,passive:!1}),r.addEventListener("touchstart",x,{capture:!0,passive:!1}),r.addEventListener("click",U,{capture:!0,passive:!1}),r.addEventListener("keydown",R,{capture:!0,passive:!1}),e},M=function(){if(u.active)return r.removeEventListener("focusin",L,!0),r.removeEventListener("mousedown",x,!0),r.removeEventListener("touchstart",x,!0),r.removeEventListener("click",U,!0),r.removeEventListener("keydown",R,!0),e},G="undefined"!=typeof window&&"MutationObserver"in window?new MutationObserver((function(n){n.some((function(n){return Array.from(n.removedNodes).some((function(n){return n===u.mostRecentlyFocusedNode}))}))&&h(v())})):void 0,Y=function(){G&&(G.disconnect(),u.active&&!u.paused&&u.containers.map((function(n){G.observe(n,{subtree:!0,childList:!0})})))};return(e={get active(){return u.active},get paused(){return u.paused},activate:function(n){if(u.active)return this;var t=a(n,"onActivate"),e=a(n,"onPostActivate"),o=a(n,"checkCanFocusTrap");o||b(),u.active=!0,u.paused=!1,u.nodeFocusedBeforeActivation=r.activeElement,null==t||t();var i=function(){o&&b(),B(),Y(),null==e||e()};return o?(o(u.containers.concat()).then(i,i),this):(i(),this)},deactivate:function(n){if(!u.active)return this;var t=F({onDeactivate:i.onDeactivate,onPostDeactivate:i.onPostDeactivate,checkCanReturnFocus:i.checkCanReturnFocus},n);clearTimeout(u.delayInitialFocusTimer),u.delayInitialFocusTimer=void 0,M(),u.active=!1,u.paused=!1,Y(),function(n,t){var e=n.indexOf(t);-1!==e&&n.splice(e,1),n.length>0&&n[n.length-1].unpause()}(o,e);var r=a(t,"onDeactivate"),c=a(t,"onPostDeactivate"),f=a(t,"checkCanReturnFocus"),l=a(t,"returnFocus","returnFocusOnDeactivate");null==r||r();var s=function(){D((function(){l&&h(g(u.nodeFocusedBeforeActivation)),null==c||c()}))};return l&&f?(f(g(u.nodeFocusedBeforeActivation)).then(s,s),this):(s(),this)},pause:function(n){if(u.paused||!u.active)return this;var t=a(n,"onPause"),e=a(n,"onPostPause");return u.paused=!0,null==t||t(),M(),Y(),null==e||e(),this},unpause:function(n){if(!u.paused||!u.active)return this;var t=a(n,"onUnpause"),e=a(n,"onPostUnpause");return u.paused=!1,null==t||t(),b(),B(),Y(),null==e||e(),this},updateContainerElements:function(n){var t=[].concat(n).filter(Boolean);return u.containers=t.map((function(n){return"string"==typeof n?r.querySelector(n):n})),u.active&&b(),Y(),this}}).updateContainerElements(n),e};const L=class{constructor(t){n(this,t),this.active=!1,this.trap=void 0}handleActiveChange(n){this.toggleTrap(n)}connectedCallback(){var n;this.trap||(this.trap=x(null===(n=this.host)||void 0===n?void 0:n.firstElementChild,{allowOutsideClick:!0}))}componentDidLoad(){this.toggleTrap(this.active)}disconnectedCallback(){var n;null===(n=this.trap)||void 0===n||n.deactivate()}toggleTrap(n){var t,e;n?null===(t=this.trap)||void 0===t||t.activate():null===(e=this.trap)||void 0===e||e.deactivate()}render(){return t(e,{key:"40e6912cae0ae3e92b46cf4d251e1b1a47320d0f"},t("slot",{key:"39fe2c6ad0e0b419090ac8270840a83e49c286cf"}))}get host(){return r(this)}static get watchers(){return{active:["handleActiveChange"]}}};export{L as focus_trap}
|
package/dist/swisspost-internet-header/{p-df70d07e.system.entry.js → p-b8d92cc7.system.entry.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
System.register(["./p-
|
|
1
|
+
System.register(["./p-7936d692.system.js","./p-5600adca.system.js","./p-abf306bd.system.js","./p-363c44ec.system.js","./p-693ba981.system.js","./p-d7e221af.system.js","./p-f0a9cc89.system.js","./p-812782e0.system.js","./p-1fd8561a.system.js"],(function(s){"use strict";return{setters:[function(t){s("swisspost_internet_header",t.P)},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){}],execute:function(){}}}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as e,b as a}from"./p-67f6b5a8.js";export{s as setNonce}from"./p-67f6b5a8.js";import{g as o}from"./p-e1255160.js";(()=>{const a=import.meta.url,o={};return""!==a&&(o.resourcesUrl=new URL(".",a).href),e(o)})().then((async e=>(await o(),a([["p-
|
|
1
|
+
import{p as e,b as a}from"./p-67f6b5a8.js";export{s as setNonce}from"./p-67f6b5a8.js";import{g as o}from"./p-e1255160.js";(()=>{const a=import.meta.url,o={};return""!==a&&(o.resourcesUrl=new URL(".",a).href),e(o)})().then((async e=>(await o(),a([["p-8de89a63",[[1,"swisspost-internet-header",{project:[1],stickyness:[1],language:[1],meta:[4],login:[4],search:[4],skiplinks:[4],configProxy:[1,"config-proxy"],environment:[1],languageSwitchOverrides:[1,"language-switch-overrides"],customConfig:[1,"custom-config"],languageCookieKey:[1,"language-cookie-key"],languageLocalStorageKey:[1,"language-local-storage-key"],logoutUrl:[1,"logout-url"],selfAdminOrigin:[1,"self-admin-origin"],activeRoute:[8,"active-route"],osFlyoutOverrides:[1,"os-flyout-overrides"],fullWidth:[4,"full-width"],activeFlyout:[32],activeDropdownElement:[32],isMainSlotEmpty:[32],getCurrentLanguage:[64]},[[0,"languageChanged","handleLanguageChangeEvent"]],{language:["handleLanguageChange"],languageSwitchOverrides:["handleAvailableLanguagesChange"],osFlyoutOverrides:["handleOsFlyoutOverrides"],activeRoute:["handleActiveRouteChange"],customConfig:["handleCustomConfigChange"],search:["handleSearchChange"],login:["handleLoginChange"],meta:["handleMetaChange"],stickyness:["handleStickynessChange"]}]]],["p-5692afb1",[[1,"swisspost-internet-breadcrumbs",{customItems:[1,"custom-items"],hideButtons:[4,"hide-buttons"],customBreadcrumbItems:[32],overlayVisible:[32],isConcatenated:[32],dropdownOpen:[32],refsReady:[32],toggleOverlayById:[64]},null,{customItems:["handleCustomConfigChange"]}]]],["p-29d246c8",[[1,"swisspost-internet-footer",{liveSupportEnabled:[32],cookieSettingsEnabled:[32]}]]],["p-6c5a684e",[[1,"post-search",{searchDropdownOpen:[32],coveoSuggestions:[32],placeSuggestions:[32],parcelSuggestion:[32],toggleDropdown:[64],setFocus:[64]}]]],["p-1baf0e1e",[[1,"post-header-logo"]]],["p-2aced2a4",[[1,"post-klp-login-widget",{logoutUrl:[1,"logout-url"],selfAdminOrigin:[1,"self-admin-origin"],setFocus:[64]}]]],["p-e673cc0a",[[1,"post-language-switch",{mode:[1],langSwitchOpen:[32],toggleDropdown:[64]}]]],["p-9d5dbac8",[[1,"post-main-navigation",{activeFlyout:[32],mobileMenuOpen:[32],toggleDropdown:[64],setFocus:[64],setActiveFlyout:[64]}]]],["p-cce8bd3f",[[1,"post-meta-navigation",{orientation:[1],fullWidth:[4,"full-width"]}]]],["p-0fd62e04",[[0,"post-skiplinks"]]],["p-944e8412",[[4,"focus-trap",{active:[4],trap:[32]},null,{active:["handleActiveChange"]}]]]],e))));
|
|
@@ -2,12 +2,10 @@ import { IBreadcrumbItem, IBreadcrumbOverlay } from '../../models/breadcrumbs.mo
|
|
|
2
2
|
export declare class PostInternetBreadcrumbs {
|
|
3
3
|
/**
|
|
4
4
|
* Add custom breadcrumb items to the end of the pre-configured list. Handy if your online service has its own navigation structure.
|
|
5
|
-
* @deprecated overlays will no longer be provided in the next major release, therefore this method will no longer be needed.
|
|
6
5
|
*/
|
|
7
6
|
customItems?: string | IBreadcrumbItem[];
|
|
8
7
|
/**
|
|
9
8
|
* Hide all buttons.
|
|
10
|
-
* @deprecated Help and Contact buttons will no longer be provided in the next major release, therefore this prop will no longer be needed.
|
|
11
9
|
*/
|
|
12
10
|
hideButtons: boolean;
|
|
13
11
|
customBreadcrumbItems?: IBreadcrumbItem[];
|