xv-webcomponents 1.3.49-qa.0 → 1.3.51-qa.0
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/{index-BNc1Ov5g.js → index-SeExY50a.js} +2 -17
- package/dist/cjs/{index-BNc1Ov5g.js.map → index-SeExY50a.js.map} +1 -1
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/xv-accordion-v2_45.cjs.entry.js +271 -185
- package/dist/cjs/xv-accordion-v2_45.cjs.entry.js.map +1 -1
- package/dist/cjs/xv-webcomponents.cjs.js +1 -1
- package/dist/collection/components/xv-header/xv-header.css +185 -221
- package/dist/collection/components/xv-header/xv-header.js +269 -159
- package/dist/collection/components/xv-header/xv-header.js.map +1 -1
- package/dist/collection/components/xv-image-viewer/xv-image-viewer.js +1 -1
- package/dist/collection/components/xv-link/xv-link.js +1 -1
- package/dist/collection/components/xv-mega-menu/xv-mega-menu.js +2 -2
- package/dist/collection/components/xv-modal/xv-modal.js +1 -1
- package/dist/collection/components/xv-notification/xv-notification.js +1 -1
- package/dist/collection/components/xv-number-input/xv-number-input.js +2 -2
- package/dist/collection/components/xv-overflow-menu/_vars.js +0 -1
- package/dist/collection/components/xv-overflow-menu/_vars.js.map +1 -1
- package/dist/collection/components/xv-overflow-menu/xv-overflow-menu-item/xv-overflow-menu-item.css +0 -8
- package/dist/collection/components/xv-overflow-menu/xv-overflow-menu-item/xv-overflow-menu-item.js +4 -25
- package/dist/collection/components/xv-overflow-menu/xv-overflow-menu-item/xv-overflow-menu-item.js.map +1 -1
- package/dist/collection/components/xv-overflow-menu/xv-overflow-menu.css +0 -3
- package/dist/collection/components/xv-overflow-menu/xv-overflow-menu.js +4 -4
- package/dist/collection/components/xv-overflow-menu/xv-overflow-menu.js.map +1 -1
- package/dist/collection/components/xv-pagination/xv-pagination.js +1 -1
- package/dist/collection/components/xv-progress-indicator/xv-progress-indicator-item/xv-progress-indicator-item.js +1 -1
- package/dist/collection/components/xv-progress-indicator/xv-progress-indicator.js +1 -1
- package/dist/collection/components/xv-radio/xv-radio.js +2 -2
- package/dist/collection/components/xv-slider/xv-slider.js +1 -1
- package/dist/collection/components/xv-table/xv-table-cell/xv-table-cell.js +1 -1
- package/dist/collection/components/xv-table/xv-table-expand/xv-table-expand.js +1 -1
- package/dist/collection/components/xv-table/xv-table-row/xv-table-row.js +1 -1
- package/dist/collection/components/xv-table/xv-table.js +1 -1
- package/dist/collection/components/xv-tabs/xv-tab/xv-tab.js +1 -1
- package/dist/collection/components/xv-tag/xv-tag.js +1 -1
- package/dist/collection/components/xv-tag/xv-tag.js.map +1 -1
- package/dist/collection/components/xv-tag-combobox/xv-tag-combobox.js +2 -2
- package/dist/collection/components/xv-text-input/xv-text-input.js +2 -2
- package/dist/collection/components/xv-textarea/xv-textarea.js +2 -2
- package/dist/collection/components/xv-tile/xv-tile.js +2 -2
- package/dist/collection/components/xv-toggle/xv-toggle.js +1 -1
- package/dist/collection/components/xv-toggle-tip/xv-toggle-tip.js +1 -1
- package/dist/collection/components/xv-tooltip/xv-tooltip.js +2 -2
- package/dist/esm/{index-_tZy78IZ.js → index-ZFbwGttR.js} +3 -17
- package/dist/esm/{index-_tZy78IZ.js.map → index-ZFbwGttR.js.map} +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/xv-accordion-v2_45.entry.js +271 -185
- package/dist/esm/xv-accordion-v2_45.entry.js.map +1 -1
- package/dist/esm/xv-webcomponents.js +1 -1
- package/dist/types/components/xv-header/xv-header.d.ts +47 -36
- package/dist/types/components/xv-overflow-menu/_vars.d.ts +1 -2
- package/dist/types/components/xv-overflow-menu/xv-overflow-menu-item/xv-overflow-menu-item.d.ts +0 -1
- package/dist/types/components/xv-overflow-menu/xv-overflow-menu.d.ts +1 -1
- package/dist/types/components.d.ts +10 -10
- package/dist/xv-webcomponents/index.esm.js +1 -1
- package/dist/xv-webcomponents/p-5864b74b.entry.js +2 -0
- package/dist/xv-webcomponents/p-5864b74b.entry.js.map +1 -0
- package/dist/xv-webcomponents/p-ZFbwGttR.js +2 -0
- package/dist/xv-webcomponents/{p-_tZy78IZ.js.map → p-ZFbwGttR.js.map} +1 -1
- package/dist/xv-webcomponents/xv-webcomponents.esm.js +1 -1
- package/package.json +1 -1
- package/dist/xv-webcomponents/p-89a2be01.entry.js +0 -2
- package/dist/xv-webcomponents/p-89a2be01.entry.js.map +0 -1
- package/dist/xv-webcomponents/p-_tZy78IZ.js +0 -2
|
@@ -1,190 +1,275 @@
|
|
|
1
|
-
import { h
|
|
2
|
-
import { SIZE_VAR } from "../../types/enum";
|
|
3
|
-
import { debounce, getMetaNav } from "../../utils/utils";
|
|
4
|
-
import { OverflowMenuVariant } from "../xv-overflow-menu/_vars";
|
|
1
|
+
import { h } from "@stencil/core";
|
|
5
2
|
export class XvHeader {
|
|
6
3
|
constructor() {
|
|
7
|
-
this.
|
|
8
|
-
|
|
4
|
+
this.htmlContent = '';
|
|
5
|
+
this.showLoginModal = false;
|
|
6
|
+
this.isCockpitMenuExpanded = true;
|
|
7
|
+
this.isEntitiesMenuExpanded = true;
|
|
8
|
+
this.isUserMenuExpanded = true;
|
|
9
|
+
this.suggestions = [];
|
|
10
|
+
this.searchQuery = '';
|
|
11
|
+
this.listPosition = { width: 0, top: 0, left: 0 };
|
|
12
|
+
this.showPopover = false;
|
|
9
13
|
this.mobMenuOpen = false;
|
|
10
|
-
this.
|
|
11
|
-
|
|
14
|
+
this.orgUnit = '';
|
|
15
|
+
this.notificationsHtml = '';
|
|
16
|
+
this.notificationsCount = 0;
|
|
17
|
+
this.megaMenu = false;
|
|
18
|
+
this.onMetaNavUpdated = () => this.loadMetaNav();
|
|
19
|
+
this.currentSuggestion = null;
|
|
20
|
+
this.openLoginModal = () => {
|
|
21
|
+
this.showLoginModal = true;
|
|
12
22
|
};
|
|
13
|
-
this.
|
|
14
|
-
this.
|
|
23
|
+
this.togglePopover = () => {
|
|
24
|
+
this.showPopover = !this.showPopover;
|
|
25
|
+
};
|
|
26
|
+
this.closeLoginModal = async () => {
|
|
27
|
+
this.showLoginModal = false;
|
|
15
28
|
};
|
|
16
|
-
this.
|
|
17
|
-
const
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
if (
|
|
29
|
+
this.handleSearchInput = async (e) => {
|
|
30
|
+
const target = e.target;
|
|
31
|
+
const query = target.value.trim();
|
|
32
|
+
this.searchQuery = query;
|
|
33
|
+
if (query.length < 2) {
|
|
34
|
+
this.suggestions = [];
|
|
35
|
+
this.currentSuggestion = null;
|
|
21
36
|
return;
|
|
22
|
-
img.onerror = null;
|
|
23
|
-
img.src = fallbackUrl;
|
|
24
|
-
if (prevSource === null || prevSource === void 0 ? void 0 : prevSource.srcset) {
|
|
25
|
-
prevSource.srcset = 'https://www.crossvertise.com/ResourcePackages/Bootstrap/assets/dist/images/logo.svg';
|
|
26
37
|
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
this.handleSearch = async (event) => {
|
|
38
|
+
const rect = target.getBoundingClientRect();
|
|
39
|
+
this.listPosition = { width: rect.width, top: rect.bottom + window.scrollY, left: rect.left + window.scrollX };
|
|
40
|
+
const url = 'https://xv-search.search.windows.net/indexes/xv-shared-index-live/docs/suggest?fuzzy=true&suggesterName=xv-shared-index-live-suggester&api-version=2020-06-30&search=' +
|
|
41
|
+
encodeURIComponent(query) +
|
|
42
|
+
'&$top=10&$select=title_de,page_link,source&$orderby=source desc';
|
|
33
43
|
try {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
}
|
|
40
|
-
const
|
|
41
|
-
fuzzy: 'true',
|
|
42
|
-
suggesterName: 'xv-shared-index-live-suggester',
|
|
43
|
-
'api-version': '2020-06-30',
|
|
44
|
-
search,
|
|
45
|
-
$top: '10',
|
|
46
|
-
$select: 'title_de,page_link,source',
|
|
47
|
-
$orderby: 'source desc',
|
|
48
|
-
}).toString();
|
|
49
|
-
const res = await fetch(`https://xv-search.search.windows.net/indexes/xv-shared-index-live/docs/suggest?${queryString}`, { headers: { 'Content-Type': 'application/json', 'api-key': '7315DEF1FA0C8B12109B12BA28E517E7' } });
|
|
50
|
-
const data = await res.json();
|
|
44
|
+
const resp = await fetch(url, {
|
|
45
|
+
headers: {
|
|
46
|
+
'Content-Type': 'application/json',
|
|
47
|
+
'api-key': '7315DEF1FA0C8B12109B12BA28E517E7',
|
|
48
|
+
},
|
|
49
|
+
});
|
|
50
|
+
const data = await resp.json();
|
|
51
51
|
this.suggestions = Array.isArray(data.value) ? data.value : [];
|
|
52
|
+
this.currentSuggestion = this.suggestions.length > 0 ? this.suggestions[0].title_de : null;
|
|
52
53
|
}
|
|
53
|
-
catch (
|
|
54
|
-
console.
|
|
54
|
+
catch (err) {
|
|
55
|
+
console.error('Failed to fetch suggestions', err);
|
|
55
56
|
}
|
|
56
|
-
|
|
57
|
-
|
|
57
|
+
};
|
|
58
|
+
this.navigateToSuggestion = (s) => {
|
|
59
|
+
window.location.href = "https://www.crossvertise.com" + s.page_link;
|
|
60
|
+
};
|
|
61
|
+
this.handleKeyDown = (e) => {
|
|
62
|
+
const input = e.target;
|
|
63
|
+
if (e.key === 'Tab' && this.currentSuggestion) {
|
|
64
|
+
input.value = this.currentSuggestion;
|
|
65
|
+
e.preventDefault();
|
|
66
|
+
}
|
|
67
|
+
else if (e.key === 'Escape') {
|
|
68
|
+
this.currentSuggestion = null;
|
|
69
|
+
input.value = '';
|
|
70
|
+
this.suggestions = [];
|
|
58
71
|
}
|
|
59
72
|
};
|
|
60
|
-
this.
|
|
61
|
-
|
|
62
|
-
const form = button.closest('form');
|
|
63
|
-
if (!form)
|
|
64
|
-
return;
|
|
65
|
-
const input = form.querySelector('input[type="search"]');
|
|
66
|
-
if (input)
|
|
67
|
-
input.focus();
|
|
73
|
+
this.toggleMobMenu = () => {
|
|
74
|
+
this.mobMenuOpen = !this.mobMenuOpen;
|
|
68
75
|
};
|
|
69
|
-
this.
|
|
70
|
-
|
|
71
|
-
if (event.key !== 'Escape')
|
|
72
|
-
return;
|
|
73
|
-
(_a = event.currentTarget) === null || _a === void 0 ? void 0 : _a.blur();
|
|
74
|
-
this.suggestions = [];
|
|
76
|
+
this.closeMobMenu = ({ detail }) => {
|
|
77
|
+
this.mobMenuOpen = !!detail;
|
|
75
78
|
};
|
|
76
|
-
this.handlePreventEvent = (e) => e.preventDefault();
|
|
77
|
-
// endregion ImpersonationInfo
|
|
78
|
-
// region Notifications
|
|
79
|
-
this.notifications = [];
|
|
80
|
-
// endregion Notifications
|
|
81
|
-
// region Account
|
|
82
|
-
this.showLoginModal = false;
|
|
83
79
|
}
|
|
84
80
|
handleOrgUnitChange({ detail: orgUnit }) {
|
|
85
81
|
this.orgUnit = orgUnit || '';
|
|
86
82
|
}
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
83
|
+
escapeRegExp(text) {
|
|
84
|
+
return text.replace(/[.*+?^${}()|[\\]\\]/g, '\\$&');
|
|
85
|
+
}
|
|
86
|
+
getLogoUrl() {
|
|
87
|
+
// Logic to determine logo URL based on some condition
|
|
88
|
+
var _a;
|
|
89
|
+
const logoUrl = (_a = this.metaNav) === null || _a === void 0 ? void 0 : _a.LogoUrl;
|
|
90
|
+
if (logoUrl) {
|
|
91
|
+
return logoUrl;
|
|
94
92
|
}
|
|
95
|
-
|
|
93
|
+
return 'https://www.crossvertise.com/ResourcePackages/Bootstrap/assets/dist/images/logo.svg';
|
|
96
94
|
}
|
|
97
|
-
|
|
98
|
-
|
|
95
|
+
getSmallLogoUrl() {
|
|
96
|
+
var _a;
|
|
97
|
+
const logoSmallUrl = (_a = this.metaNav) === null || _a === void 0 ? void 0 : _a.LogoSmallUrl;
|
|
98
|
+
if (logoSmallUrl) {
|
|
99
|
+
return logoSmallUrl;
|
|
100
|
+
}
|
|
101
|
+
return 'https://www.crossvertise.com/ResourcePackages/Bootstrap/assets/dist/images/logo.svg';
|
|
99
102
|
}
|
|
100
|
-
|
|
101
|
-
|
|
103
|
+
componentDidLoad() {
|
|
104
|
+
window.addEventListener('xv:metaNav-update', this.onMetaNavUpdated);
|
|
105
|
+
}
|
|
106
|
+
getBaseUrl() {
|
|
107
|
+
const hostname = window.location.hostname;
|
|
108
|
+
if (hostname.includes('sitefinity-qa.crossvertise.com')) {
|
|
109
|
+
return 'https://qa.crossvertise.com';
|
|
110
|
+
}
|
|
111
|
+
else if (hostname.includes('www.crossvertise.com')) {
|
|
112
|
+
return 'https://market.crossvertise.com';
|
|
113
|
+
}
|
|
114
|
+
else if (hostname.includes('sitefinity-staging.crossvertise.com')) {
|
|
115
|
+
return 'https://staging.crossvertise.com';
|
|
116
|
+
}
|
|
117
|
+
else {
|
|
118
|
+
return '';
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
async fetchMetaNav() {
|
|
102
122
|
try {
|
|
103
|
-
|
|
104
|
-
return;
|
|
105
|
-
const response = await fetch(`${this.baseUrl}/de-de/home/getpersonalareajson`, {
|
|
123
|
+
const response = await fetch(`${this.getBaseUrl()}/de-de/home/getpersonalareajson`, {
|
|
106
124
|
method: 'POST',
|
|
107
125
|
credentials: "include",
|
|
108
|
-
headers: {
|
|
126
|
+
headers: {
|
|
127
|
+
'Content-Type': 'application/json'
|
|
128
|
+
}
|
|
109
129
|
});
|
|
110
130
|
const metaNav = await response.json();
|
|
111
131
|
localStorage.setItem('metaNav', JSON.stringify(metaNav));
|
|
132
|
+
this.metaNav = metaNav;
|
|
133
|
+
this.updateNotificationsState();
|
|
134
|
+
}
|
|
135
|
+
catch (e) {
|
|
136
|
+
console.warn('Could not fetch metaNav:', e);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
loadMetaNav() {
|
|
140
|
+
var _a, _b;
|
|
141
|
+
try {
|
|
142
|
+
const metaNavRaw = localStorage.getItem('metaNav');
|
|
143
|
+
if (metaNavRaw) {
|
|
144
|
+
this.metaNav = JSON.parse(metaNavRaw);
|
|
145
|
+
this.orgUnit = ((_b = (_a = this.metaNav) === null || _a === void 0 ? void 0 : _a.User) === null || _b === void 0 ? void 0 : _b.SelectedOrgUnitName) || '';
|
|
146
|
+
this.updateNotificationsState();
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
catch (e) {
|
|
150
|
+
console.warn('Could not parse metaNav from localStorage:', e);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
updateNotificationsState() {
|
|
154
|
+
var _a;
|
|
155
|
+
if ((_a = this.metaNav) === null || _a === void 0 ? void 0 : _a.IsManager) {
|
|
156
|
+
void this.initializeNotifications();
|
|
157
|
+
}
|
|
158
|
+
else {
|
|
159
|
+
this.resetNotificationsState();
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
toggleCockpitMenu() {
|
|
163
|
+
this.isCockpitMenuExpanded = !this.isCockpitMenuExpanded;
|
|
164
|
+
}
|
|
165
|
+
toggleEntitiesMenu() {
|
|
166
|
+
this.isEntitiesMenuExpanded = !this.isEntitiesMenuExpanded;
|
|
167
|
+
}
|
|
168
|
+
toggleUserMenu() {
|
|
169
|
+
this.isUserMenuExpanded = !this.isUserMenuExpanded;
|
|
170
|
+
}
|
|
171
|
+
disconnectedCallback() {
|
|
172
|
+
window.removeEventListener('xv:metaNav-update', this.onMetaNavUpdated);
|
|
173
|
+
}
|
|
174
|
+
componentWillLoad() {
|
|
175
|
+
void this.initHeader();
|
|
176
|
+
}
|
|
177
|
+
async initHeader() {
|
|
178
|
+
try {
|
|
179
|
+
await this.fetchMetaNav();
|
|
180
|
+
this.loadMetaNav();
|
|
181
|
+
const envMap = {
|
|
182
|
+
'qa.crossvertise.com': 'qa',
|
|
183
|
+
'komsa-test.crossvertise.com': 'qa',
|
|
184
|
+
'staging.crossvertise.com': 'staging',
|
|
185
|
+
'market.crossvertise.com': 'release',
|
|
186
|
+
'allianz.crossvertise.com': 'release',
|
|
187
|
+
'philips.crossvertise.com': 'release',
|
|
188
|
+
'komsa.crossvertise.com': 'release',
|
|
189
|
+
};
|
|
190
|
+
const env = Object.keys(envMap).find(h => window.location.hostname.includes(h))
|
|
191
|
+
? envMap[Object.keys(envMap).find(h => window.location.hostname.includes(h))]
|
|
192
|
+
: 'qa';
|
|
193
|
+
const response = await fetch(`https://crossvertise.blob.core.windows.net/nav-sync-${env}/nav.html`);
|
|
194
|
+
const text = await response.text();
|
|
195
|
+
const parser = new DOMParser();
|
|
196
|
+
this.htmlContent = parser.parseFromString(text, 'text/html').body.innerHTML;
|
|
112
197
|
}
|
|
113
198
|
catch (error) {
|
|
114
|
-
console.error('Failed to fetch
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
}
|
|
137
|
-
// endregion
|
|
138
|
-
// region ImpersonationInfo
|
|
139
|
-
_renderImpersonationInfo() {
|
|
140
|
-
var _a, _b, _c, _d, _e;
|
|
141
|
-
if (!((_a = this.metaNav) === null || _a === void 0 ? void 0 : _a.ImpersonationInfo))
|
|
142
|
-
return null;
|
|
143
|
-
return (h("li", { class: "impersonationInfo" }, h("xv-toggle-tip", { position: "bottom-end" }, h("xv-button-v2", { variant: "ghost", slot: "trigger", size: SIZE_VAR.MD }, h("span", { slot: "icon-left", class: "fa-stack" }, h("i", { class: "far fa-user fa-stack-1x" }), h("i", { class: "fa fa-search fa-stack-1x", style: { fontSize: '0.7em', position: 'absolute', bottom: '0', left: '10px' } }))), h("ul", { slot: "body", class: "xv-helper-text-02" }, h("li", null, "Kundenperspektive aktiviert f\u00FCr:"), h("li", null, (_b = this.metaNav.ImpersonationInfo) === null || _b === void 0 ? void 0 : _b.NameAndTitle), h("li", null, (_c = this.metaNav.ImpersonationInfo) === null || _c === void 0 ? void 0 : _c.CompanyName), h("li", null, (_d = this.metaNav.ImpersonationInfo) === null || _d === void 0 ? void 0 : _d.Email), h("li", null, (_e = this.metaNav.ImpersonationInfo) === null || _e === void 0 ? void 0 : _e.PhoneOffice)), h("xv-link-v2", { slot: "footer", href: `${this.baseUrl}/de-de/mycrossvertise/account/clearimpersonation`, variant: "ghost" }, h("xv-button-v2", { block: true, variant: "accent" }, "Kundenperspektive verlassen")))));
|
|
144
|
-
}
|
|
145
|
-
async getNotifications() {
|
|
199
|
+
console.error('Failed to fetch header HTML:', error === null || error === void 0 ? void 0 : error.message, error);
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
render() {
|
|
203
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18;
|
|
204
|
+
const baseUrl = window.location.origin;
|
|
205
|
+
const isMegaMenuEnabled = !!(((_a = this.metaNav) === null || _a === void 0 ? void 0 : _a.EnableMegaMenu) || this.megaMenu);
|
|
206
|
+
return (h("div", { key: 'b2d72ae623e7dfe4a5464146885285c493e63767', id: "nav-container", class: "xv-header" }, h("nav", { key: 'd6fb8c6769a4426cff01c6852d8d1db71db10216', class: "navbar navbar-default navbar-fixed-top backend-force-relative" }, h("div", { key: '2f81d64f318b4a2d5b16485072ac63d2d7db125f', class: "generic-wrapper" }, h("div", { key: '0fbeb8da6c9eb4695d9c4f8f84ce5a4fb8eca309', class: "container" }, h("div", { key: '4f6abc6972f189c10ee4fb062b03ddaa1a44bffd', class: "xv-header-row" }, h("div", { key: '22ca124bbfd010910e7e395ddaa0e89f4d7051d8', class: "xv-header-col xv-header-col--left" }, h("div", { key: 'cee3080500aa218d92835a9b5c68c14792484599', class: "navbar-header" }, h("button", { key: '2cf6730b7a0333bf9c404c50ee3238c023e35dca', class: "btn btn-default navbar-toggle pull-left navbar-btn", onClick: this.toggleMobMenu }, h("i", { key: '25ba3bc8ab521a2bc3a50cab40884b8393d7fdcb', class: "fa fa-bars fa-lg", "aria-hidden": "true" })), h("div", { key: '7cd3998464f7feb8d0f345c21b053f4c1030005d', class: "visible-xs-inline visible-sm-inline" }, h("a", { key: '1ce45c9359284b066187b7d7532c51120b8ea088', href: `${baseUrl}/`, class: "navbar-brand" }, h("img", { key: 'e839387378413d25e8f1176a2497ec8ae418bdca', src: this.getSmallLogoUrl(), alt: "Crossvertise" }))), h("div", { key: '8ca1b61622ebb0208f4fef6f9d3d6cddd2e9d775', class: "hidden-xs hidden-sm" }, h("a", { key: '64361fc52c686a37a3a7bffa9b5d4cd14a3acac6', href: `${baseUrl}/`, class: "navbar-brand" }, h("img", { key: '7ee172d300fc7b8b7fd1a405ed55b4ab436d92cb', loading: "lazy", src: this.getLogoUrl(), alt: "Crossvertise" })))), this.orgUnit && (h("xv-link-v2", { key: '4d1901805473294f83cbb224494279e958ee2fb6', size: "lg", class: "xv-header--link-no-visited", variant: "standalone", href: "/de-de/mycrossvertise" }, this.orgUnit))), h("div", { key: '10f5f50c64884c64e6046eac7eb40e7a5cf2597c', class: "xv-header-col xv-header-col--right" }, h("ul", { key: 'c3d5610bb6d461dbd444f93ac54044f12a6cfff1', class: "nav nav-pills nav-meta pull-right" }, ((_b = this.metaNav) === null || _b === void 0 ? void 0 : _b.ImpersonationInfo) && (h("li", { key: '36322d35aa71dcd9c8d8fe39d9ac0ad478a65e08' }, h("div", { key: 'cb568b1b125e8fe52cebe6f311c20b32c547669b', class: "btn btn-link navbar-btn navbar-btn-cust hidden-xs", onClick: this.togglePopover }, h("i", { key: '91d14492029e11442dd4aa087dceaf21ec9388ce', class: "fa fa-user" }), h("i", { key: '28b99554bbb6690adde10c530876708a0226b164', class: "fa fa-exchange-alt" })), h("div", { key: 'b7adef0c72e76e8999422eb4598fcf31e234b002', class: "popover popover-fixed fade bottom in", style: { "display": this.showPopover ? "block" : "none" } }, h("div", { key: 'd070282c1f3e86694acefa46fb46d325683daa59', class: "arrow" }), h("h3", { key: '80f564bab89ba01e5602f227eb812311adfa4637', class: "popover-title" }, "Momentan ist die Kundenperspektive aktiviert f\u00FCr:"), h("div", { key: '23f372cd42a39a9498da53296a16384f6fe136d1', class: "popover-content" }, h("div", { key: 'd9a63158e2e9f9cd117e51c8e8d8b03cd876ca6b', class: "row" }, h("div", { key: '0ce05ec3f18ad52967bf1304937c150b5c760bf7', class: "col-xs-12" }, h("table", { key: '4caa19d3d92b13271754f4a974bd4518c3653bae', class: "table-condensed" }, h("tbody", { key: '4895a1614922ef8b9631728a767d5b071463fbec' }, h("tr", { key: '2fd19372fec88dc26ca1d709dac3926a6ce7fa1a' }, h("td", { key: 'aa5b5bd303f536bf93d37566ac892cf6bdb56eb9' }, h("span", { key: '3cf635f0c52048f387c716950ffeace9cceb9364' }, (_d = (_c = this.metaNav) === null || _c === void 0 ? void 0 : _c.ImpersonationInfo) === null || _d === void 0 ? void 0 : _d.NameAndTitle))), h("tr", { key: '2b13d8bd2a7c6c505eb63866a0381190241294eb' }, h("td", { key: '3b1ee6a84d21db6d7c18e97c06fe24f6cb00bf9d' }, h("span", { key: 'c3e9d8b0894baad3b389e0af2a79320ee632285c' }, (_f = (_e = this.metaNav) === null || _e === void 0 ? void 0 : _e.ImpersonationInfo) === null || _f === void 0 ? void 0 : _f.CompanyName))), h("tr", { key: 'd1e4faa5539c66c451845f5359f5130a8f3e0d75' }, h("td", { key: '00b18ae09c08f1dcd9337d838a25a734cffcc953' }, h("span", { key: 'acbfd9c00651e4b857f79fd8a2d4c30a1f71813b' }, (_h = (_g = this.metaNav) === null || _g === void 0 ? void 0 : _g.ImpersonationInfo) === null || _h === void 0 ? void 0 : _h.Email))), h("tr", { key: 'e7d94bb3e26b195189d73672028e4ce6f4ce6f75' }, h("td", { key: 'a2c6ecdc0decc8fd2df4beaf8178b125055cfcdb' }, h("span", { key: 'ab20b3c476522d4a7c99aeacf764d4141131822f' }, (_k = (_j = this.metaNav) === null || _j === void 0 ? void 0 : _j.ImpersonationInfo) === null || _k === void 0 ? void 0 : _k.PhoneOffice)))))))), h("div", { key: 'b84b635965e70de3441efbcdaa81dabb49f69be7', class: "row contact-contactform-container", id: "contact-contactform-container-nav" }, h("div", { key: 'd3473fcf0c293254a5cd5078ae1a2c0b18172c21', class: "col-xs-12" }, h("a", { key: 'e3dbeb5b33b44ab850a1ff2623b8fceb9e4502f1', class: "btn btn-primary btn-block", href: "/de-de/mycrossvertise/account/clearimpersonation" }, "Kundenperspektive verlassen")))))), h("li", { key: 'ddc586b8903208b8a21c700f2af6754a43b02412' }, h("a", { key: '5a5358da48594e24f8a172305fe775158c43ca31', class: "btn btn-link navbar-btn hidden-xs", href: "https://www.crossvertise.com/ueber-uns/kontakt" }, "Kontakt"), h("a", { key: '3311f066c4f0427ae6db847515084fabac245113', href: "/contact", class: "btn btn-link navbar-btn hidden-xs", style: { display: 'none' } }, "Kontakt"), h("a", { key: '07d18bed5a3f6b7388263b594cb6fc5e67c0dba6', class: "btn btn-default btn-link navbar-btn visible-xs hidden-xxs", href: "#" }, h("i", { key: '691f980c8f3533062539f17cbf8ba0bd872b1cd3', class: "fa fa-phone" }))), ((_l = this.metaNav) === null || _l === void 0 ? void 0 : _l.IsManager) && (h("li", { key: 'db73ee26134fe5de0bd50929d9294b5edc7b8ab8', class: "dropdown", "data-bind": "visible: $root.isManager", id: "notifications-dropdown" }, h("a", { key: '0a619d3924133d71ea82942e329957b15c6d6f1d', id: "notifications-dropdown-toggle", "data-target": "#", class: "dropdown-toggle btn navbar-btn btn-link", "data-toggle": "dropdown", role: "button", "data-container": "body", "aria-haspopup": "true", "aria-expanded": "false" }, h("i", { key: 'fae59968e4bb3e22d0d83074824ce874b5cb2979', class: "fas fa-bell fa-lg" }), this.notificationsCount > 0 && (h("span", { key: 'f76d963d408fc36c48a9cbc69d4288992dbf254f', id: "notifications-count", class: "badge badge-success badge-top-right" }, this.notificationsCount))), this.notificationsHtml && (h("ul", { key: '24dd4f72b9dd5bd785e7bbbf33b29469f0334322', id: "notifications-menu", class: "dropdown-menu dropdown-menu-left notification-panel" }, h("div", { key: '18142cd91976d7c414214e573f03f7ecc836c4c7', class: "notification-body", id: "notification-body" }, h("div", { key: 'b61d634d85939ae73f7d57211c54dead5f35a05f', class: "notifications", innerHTML: this.notificationsHtml })))))), ((_m = this.metaNav) === null || _m === void 0 ? void 0 : _m.IsAuthenticated) && (h("li", { key: 'da055bbf92fd1853d4773137654fa41abc5f3b78', class: "dropdown", id: "my-xv-menu" }, h("a", { key: '01d9b81ddf2b2d7e63c8eae04a4984c4b0040ba6', class: "dropdown-toggle btn navbar-btn btn-link", "data-toggle": "dropdown", role: "button", "data-container": "body", "aria-haspopup": "true", "aria-expanded": "false" }, h("i", { key: 'd85d54bd38a0949df10074c682191af9b2ac6082', class: "fa fa-user fa-lg text-success", "aria-hidden": "true" }), "\u00A0", h("span", { key: '8ab69565ea75fc718fe234db959046f102a7c325', class: "hidden-xs" }, (_o = this.metaNav) === null || _o === void 0 ? void 0 : _o.UserMenuText), "\u00A0", h("span", { key: '1734bb3e5d1c2ec1c8f9a3b9819e417f8ab145ad', class: "caret" })), h("ul", { key: '6c5b3bb8f65e66ae187962fcd0968319bae9a2f6', class: "dropdown-menu-left dropdown-menu navbar-myxv" }, ((_p = this.metaNav) === null || _p === void 0 ? void 0 : _p.IsManager) && (h("li", { key: '846d40f35ec1608a54e0bdfe4b09d150b367e183' }, h("a", { key: 'bb945874c6a2660ffe370f8db2826928f1f3bf2d', onClick: () => this.toggleCockpitMenu() }, h("i", { key: 'c0599ff56608687aaf94cb3869a4edbb0f062e47', class: "fa fa-tachometer-alt fa-fw" }), "\u00A0Cockpitfunktionen \u00A0", h("i", { key: '2137d185082a10019eb13a7679047451f9657968', class: "fa fa-caret-down" })))), this.isCockpitMenuExpanded && ((_r = (_q = this.metaNav) === null || _q === void 0 ? void 0 : _q.ManagerCockpitMenu) === null || _r === void 0 ? void 0 : _r.map(item => (h("li", { class: 'user-menu-item' }, h("a", { href: item.Url, target: item.Target || '_self' }, h("i", { class: item.CssClass }), "\u00A0\u00A0", item.Text))))), ((_s = this.metaNav) === null || _s === void 0 ? void 0 : _s.IsManager) && (h("li", { key: 'f87e28acbd18d718c9882eb0abecd20dbbdef860' }, h("a", { key: '30a634e5e48b78a6274df47cefd1df1a49e9c65e', onClick: () => this.toggleEntitiesMenu() }, h("i", { key: '1dfb05e695432acedd5ed00f84901e03cb80d7ab', class: "fa fa-cubes" }), "\u00A0Entit\u00E4ten \u00A0", h("i", { key: 'be21805f962c2885271b91697334478d3bf885aa', class: "fa fa-caret-down" })))), this.isEntitiesMenuExpanded && ((_u = (_t = this.metaNav) === null || _t === void 0 ? void 0 : _t.ManagerEntitiesMenu) === null || _u === void 0 ? void 0 : _u.map(item => (h("li", { class: 'user-menu-item' }, h("a", { href: item.Url, target: item.Target || '_self' }, h("i", { class: item.CssClass }), item.Text))))), (_w = (_v = this.metaNav) === null || _v === void 0 ? void 0 : _v.ManagerMenu) === null || _w === void 0 ? void 0 :
|
|
207
|
+
_w.map(item => (h("li", null, h("a", { href: item.Url, target: item.Target || '_self' }, h("i", { class: item.CssClass }), "\u00A0", item.Text)))), ((_x = this.metaNav) === null || _x === void 0 ? void 0 : _x.IsManager) && (h("li", { key: '91d05ebc94d98f6731b38da231ce0ef8c7ec35ab', role: "separator", class: "divider" })), ((_y = this.metaNav) === null || _y === void 0 ? void 0 : _y.IsManager) && (h("li", { key: '55392bef67f3ce7df4f1144b82acd8e3fc031f7f' }, h("a", { key: 'd699191eeeb4cacb623f5611d0789a8ef72824f5', onClick: () => this.toggleUserMenu() }, h("i", { key: '1ad80b8e00dced451134bbd64cd6574001df2d01', class: "fa fa-user" }), "\u00A0Mein Crossvertise \u00A0", h("span", { key: 'f4edfb85c2f7102a9bdc2f7a1e17147f47a70807', class: "badge" }, (_z = this.metaNav) === null || _z === void 0 ? void 0 : _z.PendingItems), h("i", { key: '546dbdb90e2b93b19ea692a9f7e20bab4afc8886', class: "fa fa-caret-down" })))), this.isUserMenuExpanded && ((_1 = (_0 = this.metaNav) === null || _0 === void 0 ? void 0 : _0.UserMenu) === null || _1 === void 0 ? void 0 : _1.map(item => (h("li", { class: 'user-menu-item' }, h("a", { href: item.Url, target: item.Target || '_self', class: "user-menu-item-link" }, h("i", { class: item.CssClass }), item.Text, "\u00A0", item.BadgeText && (h("span", { class: "badge" }, item.BadgeText))))))), ((_3 = (_2 = this.metaNav) === null || _2 === void 0 ? void 0 : _2.ImpersonationInfo) === null || _3 === void 0 ? void 0 : _3.isImpersonated) && (h("li", { key: '3debc40527c8014daf03e44f482b273206ec2d6f', class: 'user-menu-item' }, h("a", { key: '145d9a319f3c603d5bd8393371fcea4a5b826e03', href: (_5 = (_4 = this.metaNav) === null || _4 === void 0 ? void 0 : _4.ImpersonationInfo) === null || _5 === void 0 ? void 0 : _5.ClearImpersonationUrl }, h("i", { key: 'e343c7e7b0f2076cd9f50405521e8ccdb28879ad', class: "fa fa-exchange-alt" }), "Kundenperspektive verlassen"))), ((_6 = this.metaNav) === null || _6 === void 0 ? void 0 : _6.IsManager) && (h("li", { key: '7b829f2a351978ce2179b694b5a8a3e549b0351b', role: "separator", class: "divider" })), (_8 = (_7 = this.metaNav) === null || _7 === void 0 ? void 0 : _7.ActionsMenu) === null || _8 === void 0 ? void 0 :
|
|
208
|
+
_8.map(item => (h("li", null, h("a", { href: item.Url, target: item.Target || '_self' }, h("i", { class: item.CssClass }), item.Text)))), h("li", { key: '65696c2c7851f2e1e6d5d7d50825820828964b7e' }, h("a", { key: '57876bca99c70a0909e80a17900ed9f552eae570', href: `${this.getBaseUrl()}/de-de/mycrossvertise/account/logoff?returnUrl=${window.location.hostname}` }, h("i", { key: '751caee3b63db2000f5dcb72062d987911055ec5', class: "fa fa-sign-out-alt fa-fw", "aria-hidden": "true" }), "Logout"))))), !((_9 = this.metaNav) === null || _9 === void 0 ? void 0 : _9.IsAuthenticated) && (h("li", { key: '63ab31dc3ceea5fcfc6d290783934e0257492026', class: "hidden-md hidden-lg" }, h("a", { key: '9238edc94dd096e7764a8a59ae1d06a16773461f', class: "btn btn-default navbar-btn btn-link mob-login", href: `${this.getBaseUrl()}//de-de/mycrossvertise/account/logon` }, h("i", { key: 'b7316eccc78d838dc0adb7d347ed2740222bbf13', class: "fa fa-user fa-lg", "aria-hidden": "true" })))), h("xv-login-modal", { key: 'ccdd084bef122c4d65d51eb4b33be841fdfaf3e9', visible: this.showLoginModal, onClose: this.closeLoginModal }), !((_10 = this.metaNav) === null || _10 === void 0 ? void 0 : _10.IsAuthenticated) && (h("li", { key: '296e2abe0310ad17c340c0adc09080acf01b888e', class: "hidden-xs hidden-sm" }, h("a", { key: 'a23c3b06c4bb333cfd33847ced2f6705ed1ff3ac', role: "button", onClick: this.openLoginModal, class: "btn btn-default navbar-btn btn-link" }, h("i", { key: '047db7384278d0e3742c2779857bfde91b3fc6cf', class: "fa fa-user fa-lg", "aria-hidden": "true" }), h("span", { key: '5241bda1c1f9ab8dbe03417eac2340079ce8f5f3', class: "padding-sm-left" }, "Login")))), !((_11 = this.metaNav) === null || _11 === void 0 ? void 0 : _11.IsAuthenticated) && (h("li", { key: '3178b833272e40f5198ec329d2e7ebbe15ced65c', class: "hidden-xs" }, h("a", { key: 'fc0c9339753b96ce1c9c5b33e93eb8122484007a', class: "btn btn-default navbar-btn btn-link", href: `${this.getBaseUrl()}/de-de/mycrossvertise/account/register` }, h("span", { key: 'bdd12930785274864eac53200dfc5b3a283b5a63' }, "Registrieren")))), h("li", { key: '13efe2a3ca1ebfe7a97fa050aedd5fb852cf8299', class: "navbar-divider hidden-xs" }), h("li", { key: '84056d0fc454c3dfc22c83f17831fb3050631456' }, h("xv-button-v2", { key: 'ef0f9ce169582f9ed7db7b5d552e31a96aabc8f4', class: "navbar-btn", variant: 'accent', onClick: () => window.location.href = `${this.getBaseUrl()}/de-de/mycrossvertise/shoppingcart/activecart` }, h("span", { key: '4cca211d034c8ed403e5a39640c6644d95a353cc', class: "xv-font-icon-warenkorb fa-lg fa-fw", "aria-hidden": "true" }), h("span", { key: 'ed18d28000d745ded72a8ca60aad3581aa1ae2bb', class: "hidden-xs hidden-sm" }, "\u00A0Warenkorb\u00A0"), h("xv-tag-v2", { key: '1a544cd7be0b7378bf13170ef9fee38c1eca15d1', id: "shopping-cart-items-badge", size: 'sm', bg: "var(--background)", color: "var(--icon-interactive)" }, ((_13 = (_12 = this.metaNav) === null || _12 === void 0 ? void 0 : _12.Cart) === null || _13 === void 0 ? void 0 : _13.NumberOfItems) || 0)))))))), h("div", { key: '07ba78645bcf0227103576e5a6911f9794fd2971', class: "collapse hidden-md hidden-lg", id: "search-collapse" }, h("div", { key: 'ee9565d8b34bbab11b4c81614851df85d39cfce5', class: "container" }, h("form", { key: 'd12cfbaf9f70b6d1762483c969a0f602285265aa', action: "/de-de/media/search", class: "navbar-form", method: "get", role: "search" }, h("div", { key: '83ca4da9e31938426a6310c925e6d830e00415fc', class: "input-group" }, h("input", { key: '85e0e2d5701aab9cf563102dc0a9a5deecae6950', class: "form-control", name: "Q", placeholder: "Suche", type: "text", autocomplete: "off" }), h("span", { key: '526749a29a3d79af192b88cb0ab961d592b29445', class: "input-group-btn force-full-width" }, h("button", { key: 'ca1e696ad0b8e5e399c30b4d3bc0cbb35da23edc', class: "btn btn-default search-addon", type: "submit" }, h("i", { key: '9159204777277235253d1ee48a2464ce99ef7007', class: "fa fa-search", "aria-hidden": "true" }))))))), isMegaMenuEnabled && (h("div", { key: '4e98d2f1ecee3c69398cdaa60f6fa389c0787863', class: "xv-header-nav xv-header-nav--shadow" }, h("div", { key: 'bc9c2cbbe9966f2cc940e8b7d998ce9b443aafba', class: "container" }, h("xv-mega-menu", { key: 'a50984a887760f4fb229714ed86d772092199778', open: this.mobMenuOpen, onOpenChange: this.closeMobMenu }, ((_14 = this.metaNav) === null || _14 === void 0 ? void 0 : _14.EnableMegaMenuSearch) || isMegaMenuEnabled && (h("form", { key: '72cf63915fb787119c5df691d13b7b60b53430d1', slot: "menu-right", action: `${this.getBaseUrl()}/de-de/media/search` }, h("div", { key: '7502a32c84a4794bf8663f199d59002674c5d013', class: "input-group" }, h("input", { key: '671c3825d0d5ba1c404e4c479a523f6dcf282fff', class: "form-control", onInput: this.handleSearchInput, onKeyDown: this.handleKeyDown, autocomplete: "off", "data-val": "true", "data-val-required": "Das Feld \"Q\" ist erforderlich.", name: "Q", placeholder: "Suche", type: "search" }), h("span", { key: '408806fd048e3ac48e751c299329a26fd7e4d74e', class: "input-group-btn force-full-width" }, h("button", { key: 'c1d8ae2970158fb03c026e6b3645eaafe16dd77e', class: "btn btn-default search-addon", type: "submit" }, h("i", { key: 'f0a8e430a7fbcdd397c268c6380a9d971b3a46a2', class: "fa fa-search", "aria-hidden": "true" }))))))))))), !isMegaMenuEnabled && h("div", { key: '48aaa5f6ef0e4c4dac618b109d4674abd37e3ca3', innerHTML: this.htmlContent }), isMegaMenuEnabled && (h("ul", { key: 'c3aab9bd6cab1c9206f06a4904c27c1b98e7b119', class: "ui-autocomplete ui-front ui-menu ui-widget ui-widget-content ui-corner-all", id: "xv-search-suggestions", style: {
|
|
209
|
+
width: `${(_15 = this.listPosition) === null || _15 === void 0 ? void 0 : _15.width}px`,
|
|
210
|
+
top: `${(_16 = this.listPosition) === null || _16 === void 0 ? void 0 : _16.top}px`,
|
|
211
|
+
left: `${(_17 = this.listPosition) === null || _17 === void 0 ? void 0 : _17.left}px`,
|
|
212
|
+
display: ((_18 = this.suggestions) === null || _18 === void 0 ? void 0 : _18.length) ? 'block' : 'none',
|
|
213
|
+
position: 'absolute',
|
|
214
|
+
zIndex: '1000',
|
|
215
|
+
} }, this.suggestions.map(s => (h("li", { class: "ui-menu-item", role: "presentation" }, h("a", { href: "#", onClick: e => {
|
|
216
|
+
e.preventDefault();
|
|
217
|
+
this.navigateToSuggestion(s);
|
|
218
|
+
} }, s.title_de.split(new RegExp(`(${this.escapeRegExp(this.searchQuery)})`, 'gi')).map(part => { var _a; return part.toLowerCase() === ((_a = this.searchQuery) === null || _a === void 0 ? void 0 : _a.toLowerCase()) ? h("b", null, part) : part; })))))))));
|
|
219
|
+
}
|
|
220
|
+
async initializeNotifications() {
|
|
146
221
|
var _a;
|
|
147
|
-
if (!((_a = this.metaNav) === null || _a === void 0 ? void 0 : _a.IsManager))
|
|
222
|
+
if (!((_a = this.metaNav) === null || _a === void 0 ? void 0 : _a.IsManager)) {
|
|
148
223
|
return;
|
|
224
|
+
}
|
|
225
|
+
await this.loadNotifications();
|
|
226
|
+
}
|
|
227
|
+
getNotificationsApiUrl() {
|
|
228
|
+
var _a;
|
|
229
|
+
const defaultOrigin = 'https://www.crossvertise.com';
|
|
230
|
+
const fallbackOrigin = 'https://market.crossvertise.com';
|
|
231
|
+
const path = '/de-de/api/notifications/list';
|
|
232
|
+
const normalizeOrigin = (value) => value.replace(/\/+$/, '');
|
|
149
233
|
try {
|
|
150
|
-
const
|
|
151
|
-
|
|
234
|
+
const rawOrigin = typeof window !== 'undefined' && ((_a = window.location) === null || _a === void 0 ? void 0 : _a.origin)
|
|
235
|
+
? window.location.origin
|
|
236
|
+
: defaultOrigin;
|
|
237
|
+
const normalizedOrigin = normalizeOrigin(rawOrigin);
|
|
238
|
+
const effectiveOrigin = normalizedOrigin === normalizeOrigin(defaultOrigin) ? fallbackOrigin : normalizedOrigin;
|
|
239
|
+
return new URL(path, `${effectiveOrigin}/`).toString();
|
|
240
|
+
}
|
|
241
|
+
catch (error) {
|
|
242
|
+
console.warn('Falling back to notifications fallback origin:', error);
|
|
243
|
+
return new URL(path, `${fallbackOrigin}/`).toString();
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
async loadNotifications() {
|
|
247
|
+
try {
|
|
248
|
+
const response = await fetch(this.getNotificationsApiUrl(), {
|
|
249
|
+
credentials: 'include',
|
|
250
|
+
});
|
|
251
|
+
if (!response.ok) {
|
|
152
252
|
throw new Error(`Request failed with status ${response.status}`);
|
|
253
|
+
}
|
|
153
254
|
const data = await response.json();
|
|
154
|
-
|
|
255
|
+
if (Array.isArray(data) && data.length > 0) {
|
|
256
|
+
this.notificationsHtml = data.reduce((acc, notification) => acc + ((notification === null || notification === void 0 ? void 0 : notification.template) || ''), '');
|
|
257
|
+
this.notificationsCount = data.length;
|
|
258
|
+
}
|
|
259
|
+
else {
|
|
260
|
+
this.notificationsHtml = '';
|
|
261
|
+
this.notificationsCount = 0;
|
|
262
|
+
}
|
|
155
263
|
}
|
|
156
264
|
catch (error) {
|
|
157
|
-
|
|
265
|
+
console.error('Failed to load notifications:', error);
|
|
266
|
+
this.notificationsHtml = '';
|
|
267
|
+
this.notificationsCount = 0;
|
|
158
268
|
}
|
|
159
269
|
}
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
return null;
|
|
164
|
-
return (h("li", { class: "notifications" }, h("xv-overflow-menu-v2", { position: "right", size: SIZE_VAR.MD }, h("span", { slot: "trigger", class: "fa-stack" }, h("i", { class: "far fa-bell fa-stack-1x fa-sm" }), this.notifications.length > 0 && (h("xv-tag-v2", { class: "counter-badge counter-badge--absolute", bg: "var(--icon-interactive, #97BF0D)", color: "var(--text-inverse, #FFF)" }, this.notifications.length))), this.notifications.map((notification) => (h("xv-overflow-menu-v2-item", { value: notification.id, variant: OverflowMenuVariant.GHOST, disabled: notification.isRead, clickable: false }, h("div", { class: "notifications-item" }, h("i", { class: {
|
|
165
|
-
far: true,
|
|
166
|
-
'fa-clock': !notification.status,
|
|
167
|
-
'fa-times-circle': notification.status === 1,
|
|
168
|
-
'fa-circle': notification.status && notification.status !== 1,
|
|
169
|
-
} }), h("div", { class: "notifications-item-body" }, h("span", null, "Rechnungsentwurf f\u00FCr Auftrag ", notification.orderId, " ist ausstehend"), h("xv-link-v2", { variant: notification.isRead ? 'ghost' : 'standalone', href: `/de-de/manager/ordersales/details/${notification.orderId}` }, "Auftrag anschauen")))))))));
|
|
170
|
-
}
|
|
171
|
-
_renderAccount() {
|
|
172
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
173
|
-
if (!((_a = this.metaNav) === null || _a === void 0 ? void 0 : _a.IsAuthenticated)) {
|
|
174
|
-
return (h("li", null, h("xv-button-v2", { variant: "ghost", size: SIZE_VAR.MD, onClick: () => this.showLoginModal = true }, h("i", { class: "far fa-user" }), h("span", { class: "header-label" }, "Mein Konto")), h("xv-login-modal", { visible: this.showLoginModal, onClose: () => this.showLoginModal = false })));
|
|
175
|
-
}
|
|
176
|
-
return (h("li", { class: { myArea: true, onHover: true, isOpen: false } }, h("xv-button-v2", { class: "myArea-btn", variant: "ghost", size: SIZE_VAR.MD }, h("i", { class: "far fa-user" }), h("div", { class: "header-label" }, ((_b = this.metaNav) === null || _b === void 0 ? void 0 : _b.IsManager) && h("small", null, "Manager"), h("span", null, ((_c = this.metaNav) === null || _c === void 0 ? void 0 : _c.UserMenuText) || 'Mein Konto')), h("i", { class: "caret" })), h("ul", { class: "myArea-list" }, ((_e = (_d = this.metaNav) === null || _d === void 0 ? void 0 : _d.ManagerCockpitMenu) === null || _e === void 0 ? void 0 : _e.length) && (h(Fragment, null, h("li", { class: "myArea-list--category" }, "Cockpitfunktionen"), this.metaNav.ManagerCockpitMenu.map((item) => (h("li", null, h("xv-link-v2", { variant: "standalone", href: item.Url, target: item.Target }, item.Text)))), h("li", { class: "myArea-list--divider" }))), ((_g = (_f = this.metaNav) === null || _f === void 0 ? void 0 : _f.ManagerEntitiesMenu) === null || _g === void 0 ? void 0 : _g.length) && (h(Fragment, null, h("li", { class: "myArea-list--category" }, "Entit\u00E4ten"), this.metaNav.ManagerEntitiesMenu.map((item) => (h("li", null, h("xv-link-v2", { variant: "standalone", href: item.Url, target: item.Target }, item.Text)))), h("li", { class: "myArea-list--divider" }))), ((_j = (_h = this.metaNav) === null || _h === void 0 ? void 0 : _h.ManagerMenu) === null || _j === void 0 ? void 0 : _j.length) && (h(Fragment, null, this.metaNav.ManagerMenu.map((item) => (h("li", null, h("xv-link-v2", { variant: "standalone", href: item.Url, target: item.Target }, item.Text)))), h("li", { class: "myArea-list--divider" }))), !((_k = this.metaNav) === null || _k === void 0 ? void 0 : _k.IsManager) && ((_m = (_l = this.metaNav) === null || _l === void 0 ? void 0 : _l.UserMenu) === null || _m === void 0 ? void 0 : _m.length) && (h(Fragment, null, this.metaNav.UserMenu.map((item) => (h("li", null, h("xv-link-v2", { variant: "standalone", href: item.Url, target: item.Target }, item.Text)))), h("li", { class: "myArea-list--divider" }))), h("li", null, h("xv-link-v2", { href: `${this.baseUrl}/de-de/mycrossvertise/account/logoff?returnUrl=${window.location.hostname}`, variant: "standalone" }, "Abmelden")))));
|
|
177
|
-
}
|
|
178
|
-
// endregion Account
|
|
179
|
-
// region ShoppingCart
|
|
180
|
-
_renderShoppingCart() {
|
|
181
|
-
var _a, _b;
|
|
182
|
-
return (h("li", null, h("xv-link-v2", { href: `${this.baseUrl}/de-de/mycrossvertise/shoppingcart/activecart`, variant: "ghost" }, h("xv-button-v2", { variant: "ghost", size: SIZE_VAR.MD }, h("i", { class: "far fa-shopping-cart" }), h("span", { class: "header-label" }, "Warenkorb"), h("xv-tag-v2", { class: "counter-badge", bg: "var(--icon-interactive, #97BF0D)", color: "var(--text-inverse, #FFF)" }, ((_b = (_a = this.metaNav) === null || _a === void 0 ? void 0 : _a.Cart) === null || _b === void 0 ? void 0 : _b.NumberOfItems) || 0)))));
|
|
183
|
-
}
|
|
184
|
-
// endregion ShoppingCart
|
|
185
|
-
render() {
|
|
186
|
-
var _a, _b, _c, _d;
|
|
187
|
-
return (h("header", { key: '05aba899a497a865f60ebe6c03c4972568bd8fc7', class: "header" }, h("div", { key: '5f7a4a3f8404a06986cf3a893d4277db8e71efa1', class: "header-wrapper" }, h("div", { key: '5bb573f1a9a3b708c42ba63e0f9e3cc6427fec83', class: "container" }, h("div", { key: '2f80fa810932207aafd5d48f340b12ea7866dcb4', class: "header-top" }, h("div", { key: '9fa387c1f346dd10834a5ced907a9fa2bf200e13', class: "header-top--left" }, h("xv-button-v2", { key: 'b5675bec2c4fc5af6428780e24cb5abc20140ec3', class: "menu-btn", variant: "ghost", onClick: this.toggleMobMenu }, h("i", { key: 'ab37ddf212334baa200c51382c6396e7e9d7bd53', slot: "icon-left", class: { 'fa': true, 'fa-times': this.mobMenuOpen, 'fa-bars': !this.mobMenuOpen } })), h("a", { key: '3a5d48d5e44a9a50fde1bac580f509bb3e705a58', href: `${window.location.origin}/` }, h("picture", { key: '6497f812d1dfc30dced66caa94c5656075d26fc7' }, h("source", { key: 'daca15082b8104dbc1812fef6d066e5b3b667495', srcSet: ((_a = this.metaNav) === null || _a === void 0 ? void 0 : _a.LogoUrl) || 'https://www.crossvertise.com/ResourcePackages/Bootstrap/assets/dist/images/logo.svg', media: "(min-width: 990px)" }), h("img", { key: '63b79c36b05b21d122514a4c613f0522ed5446a8', src: ((_b = this.metaNav) === null || _b === void 0 ? void 0 : _b.LogoSmallUrl) || 'https://www.crossvertise.com/ResourcePackages/Bootstrap/assets/dist/images/logo-small.svg', onError: this.logoFallback, loading: "lazy", alt: "Crossvertise" }))), this.orgUnit && (h("xv-link-v2", { key: 'ab5a3e03ceb65e0fd19f033879693bb04abbcce8', class: "xv-header--link-no-visited", variant: "standalone", href: "/de-de/mycrossvertise" }, this.orgUnit))), h("ul", { key: 'b94fd9cb719b5fdae0695aa91c35b7f8f1d859cf', class: "header-top--right" }, this._renderSearch(), this._renderImpersonationInfo(), !((_c = this.metaNav) === null || _c === void 0 ? void 0 : _c.IsManager) && (h("li", { key: '5e5925ab227de29f94f627848cc09aea3bac35c7' }, h("xv-link-v2", { key: '08e48bfac4a2cf619ce3e36a3b77a0eec6e1491c', variant: "ghost", href: "https://www.crossvertise.com/ueber-uns/kontakt" }, h("xv-button-v2", { key: '62a02223db498c538542381c97b9684ef9cca299', variant: "ghost", size: SIZE_VAR.MD }, h("i", { key: '911efe486206bd3edc121ff07b86a672c7fbc794', class: "far fa-envelope" }), h("span", { key: '682e6d71c604d58c481586c35428b467e7b1dc84', class: "header-label" }, "Kontakt"))))), this._renderNotifications(), this._renderAccount(), !((_d = this.metaNav) === null || _d === void 0 ? void 0 : _d.IsManager) && (h("li", { key: 'c1d5b7c845d0528c4820875b0afbc22343e8137f' }, h("xv-link-v2", { key: '242db7d0be1903a7fee470f766f1b48619b41b70', variant: "ghost", href: "https://help.crossvertise.com" }, h("xv-button-v2", { key: 'fb61b773edec47ec3b25aefae359c4dc3cc3254d', variant: "ghost", size: SIZE_VAR.MD }, h("i", { key: '480f1b6c4ff097b615f2da90f0c88aabe6cf3852', class: "far fa-question-circle" }), h("span", { key: 'f782b27ea7a5146c2d179bb355677267ba00adb5', class: "header-label" }, "Hilfe"))))), this._renderShoppingCart())), h("xv-mega-menu", { key: '01676a87332402f4bea66e186af4cfc23313aeb3', open: this.mobMenuOpen, onOpenChange: this.closeMobMenu })))));
|
|
270
|
+
resetNotificationsState() {
|
|
271
|
+
this.notificationsHtml = '';
|
|
272
|
+
this.notificationsCount = 0;
|
|
188
273
|
}
|
|
189
274
|
static get is() { return "xv-header"; }
|
|
190
275
|
static get originalStyleUrls() {
|
|
@@ -197,15 +282,46 @@ export class XvHeader {
|
|
|
197
282
|
"$": ["xv-header.css"]
|
|
198
283
|
};
|
|
199
284
|
}
|
|
285
|
+
static get properties() {
|
|
286
|
+
return {
|
|
287
|
+
"megaMenu": {
|
|
288
|
+
"type": "boolean",
|
|
289
|
+
"attribute": "mega-menu",
|
|
290
|
+
"mutable": false,
|
|
291
|
+
"complexType": {
|
|
292
|
+
"original": "boolean",
|
|
293
|
+
"resolved": "boolean",
|
|
294
|
+
"references": {}
|
|
295
|
+
},
|
|
296
|
+
"required": false,
|
|
297
|
+
"optional": false,
|
|
298
|
+
"docs": {
|
|
299
|
+
"tags": [],
|
|
300
|
+
"text": ""
|
|
301
|
+
},
|
|
302
|
+
"getter": false,
|
|
303
|
+
"setter": false,
|
|
304
|
+
"reflect": false,
|
|
305
|
+
"defaultValue": "false"
|
|
306
|
+
}
|
|
307
|
+
};
|
|
308
|
+
}
|
|
200
309
|
static get states() {
|
|
201
310
|
return {
|
|
311
|
+
"htmlContent": {},
|
|
312
|
+
"showLoginModal": {},
|
|
313
|
+
"isCockpitMenuExpanded": {},
|
|
314
|
+
"isEntitiesMenuExpanded": {},
|
|
315
|
+
"isUserMenuExpanded": {},
|
|
316
|
+
"suggestions": {},
|
|
317
|
+
"searchQuery": {},
|
|
318
|
+
"listPosition": {},
|
|
319
|
+
"showPopover": {},
|
|
202
320
|
"metaNav": {},
|
|
203
|
-
"orgUnit": {},
|
|
204
321
|
"mobMenuOpen": {},
|
|
205
|
-
"
|
|
206
|
-
"
|
|
207
|
-
"
|
|
208
|
-
"showLoginModal": {}
|
|
322
|
+
"orgUnit": {},
|
|
323
|
+
"notificationsHtml": {},
|
|
324
|
+
"notificationsCount": {}
|
|
209
325
|
};
|
|
210
326
|
}
|
|
211
327
|
static get elementRef() { return "el"; }
|
|
@@ -216,12 +332,6 @@ export class XvHeader {
|
|
|
216
332
|
"target": "window",
|
|
217
333
|
"capture": false,
|
|
218
334
|
"passive": false
|
|
219
|
-
}, {
|
|
220
|
-
"name": "xv:metaNav-update",
|
|
221
|
-
"method": "metaNavUpdate",
|
|
222
|
-
"target": "window",
|
|
223
|
-
"capture": false,
|
|
224
|
-
"passive": false
|
|
225
335
|
}];
|
|
226
336
|
}
|
|
227
337
|
}
|