@everymatrix/nuts-inbox-widget 1.74.0 → 1.74.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/loader.cjs.js +1 -1
- package/dist/cjs/nuts-inbox-widget.cjs.js +1 -1
- package/dist/cjs/nuts-inbox-widget_3.cjs.entry.js +148 -72
- package/dist/collection/api/methods/index.js +9 -5
- package/dist/collection/cache/index.js +1 -0
- package/dist/collection/cache/notification-cache.js +71 -0
- package/dist/collection/components/nuts-inbox-widget/nuts-inbox-widget.js +3 -1
- package/dist/collection/components/nuts-notification/nuts-notification.js +29 -7
- package/dist/collection/components/nuts-popover/nuts-popover.css +17 -0
- package/dist/collection/components/nuts-popover/nuts-popover.js +51 -67
- package/dist/esm/loader.js +1 -1
- package/dist/esm/nuts-inbox-widget.js +1 -1
- package/dist/esm/nuts-inbox-widget_3.entry.js +148 -72
- package/dist/nuts-inbox-widget/nuts-inbox-widget.esm.js +1 -1
- package/dist/nuts-inbox-widget/nuts-inbox-widget_3.entry.js +1 -1
- package/dist/types/api/methods/index.d.ts +2 -0
- package/dist/types/api/methods/types.d.ts +0 -1
- package/dist/types/cache/index.d.ts +1 -0
- package/dist/types/cache/notification-cache.d.ts +24 -0
- package/dist/types/components/nuts-notification/nuts-notification.d.ts +1 -0
- package/dist/types/components/nuts-popover/nuts-popover.d.ts +5 -6
- package/dist/types/components.d.ts +2 -0
- package/package.json +1 -1
- /package/dist/types/Users/{adrian.pripon/Documents/Work → maria.bumbar/Desktop/Widgets & Template}/widgets-monorepo/packages/stencil/nuts-inbox-widget/.stencil/libs/common/src/storybook/storybook-utils.d.ts +0 -0
- /package/dist/types/Users/{adrian.pripon/Documents/Work → maria.bumbar/Desktop/Widgets & Template}/widgets-monorepo/packages/stencil/nuts-inbox-widget/.stencil/packages/stencil/nuts-inbox-widget/stencil.config.d.ts +0 -0
- /package/dist/types/Users/{adrian.pripon/Documents/Work → maria.bumbar/Desktop/Widgets & Template}/widgets-monorepo/packages/stencil/nuts-inbox-widget/.stencil/packages/stencil/nuts-inbox-widget/stencil.config.dev.d.ts +0 -0
- /package/dist/types/Users/{adrian.pripon/Documents/Work → maria.bumbar/Desktop/Widgets & Template}/widgets-monorepo/packages/stencil/nuts-inbox-widget/.stencil/packages/stencil/nuts-inbox-widget/storybook/main.d.ts +0 -0
- /package/dist/types/Users/{adrian.pripon/Documents/Work → maria.bumbar/Desktop/Widgets & Template}/widgets-monorepo/packages/stencil/nuts-inbox-widget/.stencil/packages/stencil/nuts-inbox-widget/storybook/preview.d.ts +0 -0
- /package/dist/types/Users/{adrian.pripon/Documents/Work → maria.bumbar/Desktop/Widgets & Template}/widgets-monorepo/packages/stencil/nuts-inbox-widget/.stencil/tools/plugins/index.d.ts +0 -0
- /package/dist/types/Users/{adrian.pripon/Documents/Work → maria.bumbar/Desktop/Widgets & Template}/widgets-monorepo/packages/stencil/nuts-inbox-widget/.stencil/tools/plugins/stencil-clean-deps-plugin.d.ts +0 -0
- /package/dist/types/Users/{adrian.pripon/Documents/Work → maria.bumbar/Desktop/Widgets & Template}/widgets-monorepo/packages/stencil/nuts-inbox-widget/.stencil/tools/plugins/vite-chunk-plugin.d.ts +0 -0
- /package/dist/types/Users/{adrian.pripon/Documents/Work → maria.bumbar/Desktop/Widgets & Template}/widgets-monorepo/packages/stencil/nuts-inbox-widget/.stencil/tools/plugins/vite-clean-deps-plugin.d.ts +0 -0
|
@@ -4089,7 +4089,6 @@ Object.assign(lookup, {
|
|
|
4089
4089
|
});
|
|
4090
4090
|
|
|
4091
4091
|
const initializeSession = async ({ baseUrl, body, sessionId }) => {
|
|
4092
|
-
var _a;
|
|
4093
4092
|
const url = new URL(`${baseUrl}/widgets/session/initialize`);
|
|
4094
4093
|
const headers = new Headers();
|
|
4095
4094
|
headers.append('Content-Type', 'application/json');
|
|
@@ -4101,8 +4100,14 @@ const initializeSession = async ({ baseUrl, body, sessionId }) => {
|
|
|
4101
4100
|
};
|
|
4102
4101
|
try {
|
|
4103
4102
|
const res = await fetch(url.href, options);
|
|
4104
|
-
|
|
4105
|
-
|
|
4103
|
+
if (!res.ok) {
|
|
4104
|
+
return {
|
|
4105
|
+
token: null,
|
|
4106
|
+
unseenCounter: 0
|
|
4107
|
+
};
|
|
4108
|
+
}
|
|
4109
|
+
const { data } = await res.json();
|
|
4110
|
+
const newToken = data === null || data === void 0 ? void 0 : data.token;
|
|
4106
4111
|
headers.append('Widget-Authorization', `Bearer ${newToken}`);
|
|
4107
4112
|
const unseenCounter = await getUnseenCount({
|
|
4108
4113
|
baseUrl,
|
|
@@ -4199,7 +4204,6 @@ const getNotifications = async ({ baseUrl, page, token }) => {
|
|
|
4199
4204
|
const res = await fetch(url.href, options);
|
|
4200
4205
|
const data = await res.json();
|
|
4201
4206
|
return {
|
|
4202
|
-
isLoading: false,
|
|
4203
4207
|
numberOfNotifications: data.totalCount,
|
|
4204
4208
|
notifications: data.data,
|
|
4205
4209
|
hasMore: data.hasMore
|
|
@@ -4208,7 +4212,6 @@ const getNotifications = async ({ baseUrl, page, token }) => {
|
|
|
4208
4212
|
catch (error) {
|
|
4209
4213
|
console.log(error);
|
|
4210
4214
|
return {
|
|
4211
|
-
isLoading: false,
|
|
4212
4215
|
numberOfNotifications: 0,
|
|
4213
4216
|
notifications: [],
|
|
4214
4217
|
hasMore: undefined
|
|
@@ -4252,6 +4255,78 @@ const deleteAll = async ({ baseUrl, token }) => {
|
|
|
4252
4255
|
}
|
|
4253
4256
|
};
|
|
4254
4257
|
|
|
4258
|
+
class NotificationCache {
|
|
4259
|
+
constructor() {
|
|
4260
|
+
this.PAGE_SIZE = 10;
|
|
4261
|
+
this.cache = new Map();
|
|
4262
|
+
this.currentPage = 0;
|
|
4263
|
+
}
|
|
4264
|
+
observePageUpdate(callback) {
|
|
4265
|
+
this.onPageUpdate = callback;
|
|
4266
|
+
}
|
|
4267
|
+
setCurrentPage(page) {
|
|
4268
|
+
this.currentPage = page;
|
|
4269
|
+
this.syncCurrentPage();
|
|
4270
|
+
}
|
|
4271
|
+
updateCache(notifications) {
|
|
4272
|
+
this.resetCache();
|
|
4273
|
+
const pageCount = Math.ceil(notifications.length / this.PAGE_SIZE);
|
|
4274
|
+
for (let i = 0; i < pageCount; i++) {
|
|
4275
|
+
const pageNotifications = notifications.slice(i * this.PAGE_SIZE, (i + 1) * this.PAGE_SIZE);
|
|
4276
|
+
const hasMore = i < pageCount - 1;
|
|
4277
|
+
this.cache.set(i, { notifications: pageNotifications, hasMore });
|
|
4278
|
+
}
|
|
4279
|
+
this.syncCurrentPage();
|
|
4280
|
+
}
|
|
4281
|
+
syncCurrentPage() {
|
|
4282
|
+
var _a;
|
|
4283
|
+
const entry = this.cache.get(this.currentPage);
|
|
4284
|
+
const notifications = (_a = entry === null || entry === void 0 ? void 0 : entry.notifications) !== null && _a !== void 0 ? _a : [];
|
|
4285
|
+
const hasMore = entry === null || entry === void 0 ? void 0 : entry.hasMore;
|
|
4286
|
+
this.onPageUpdate([...notifications], hasMore);
|
|
4287
|
+
}
|
|
4288
|
+
deleteById(id) {
|
|
4289
|
+
const updatedNotifications = this.getAllFromCache().filter((n) => n.id !== id);
|
|
4290
|
+
this.updateCache(updatedNotifications);
|
|
4291
|
+
}
|
|
4292
|
+
addToFront(notification) {
|
|
4293
|
+
if (!this.cache.get(0)) {
|
|
4294
|
+
return;
|
|
4295
|
+
}
|
|
4296
|
+
const updatedNotifications = [notification, ...this.getAllFromCache()];
|
|
4297
|
+
this.updateCache(updatedNotifications);
|
|
4298
|
+
}
|
|
4299
|
+
markAsRead(id, mark) {
|
|
4300
|
+
const updatedNotifications = this.getAllFromCache().map((n) => (n.id === id ? Object.assign(Object.assign({}, n), mark) : n));
|
|
4301
|
+
this.updateCache(updatedNotifications);
|
|
4302
|
+
}
|
|
4303
|
+
markAllAsRead() {
|
|
4304
|
+
const updatedNotifications = this.getAllFromCache().map((n) => (Object.assign(Object.assign({}, n), { read: true, seen: true })));
|
|
4305
|
+
this.updateCache(updatedNotifications);
|
|
4306
|
+
}
|
|
4307
|
+
clearAll() {
|
|
4308
|
+
this.resetCache();
|
|
4309
|
+
this.setCurrentPage(0);
|
|
4310
|
+
}
|
|
4311
|
+
resetCache() {
|
|
4312
|
+
this.cache.clear();
|
|
4313
|
+
this.cache.set(0, { notifications: [], hasMore: false });
|
|
4314
|
+
}
|
|
4315
|
+
async loadPageFromApi(page, loader) {
|
|
4316
|
+
if (this.cache.has(page)) {
|
|
4317
|
+
this.setCurrentPage(page);
|
|
4318
|
+
return;
|
|
4319
|
+
}
|
|
4320
|
+
const data = await loader();
|
|
4321
|
+
this.cache.set(page, { notifications: data.notifications, hasMore: data.hasMore });
|
|
4322
|
+
this.setCurrentPage(page);
|
|
4323
|
+
}
|
|
4324
|
+
getAllFromCache() {
|
|
4325
|
+
return Array.from(this.cache.values()).flatMap((entry) => entry.notifications);
|
|
4326
|
+
}
|
|
4327
|
+
}
|
|
4328
|
+
const notificationCache = new NotificationCache();
|
|
4329
|
+
|
|
4255
4330
|
const nutsInboxWidgetCss = ":host{display:block;font-family:\"Roboto\", \"Arial\", sans-serif}.BellIconWrapper{width:100%;height:40px;display:flex}.BellIconWrapper :hover{cursor:pointer}.BellIcon{width:40px;height:40px;display:flex;justify-content:center;align-items:center}";
|
|
4256
4331
|
const NutsInboxWidgetStyle0 = nutsInboxWidgetCss;
|
|
4257
4332
|
|
|
@@ -4379,6 +4454,7 @@ const NutsInboxWidget = class {
|
|
|
4379
4454
|
});
|
|
4380
4455
|
this.socketRef.on('notification_received', (data) => {
|
|
4381
4456
|
this.newNotification.emit(data.message);
|
|
4457
|
+
notificationCache.addToFront(data.message);
|
|
4382
4458
|
});
|
|
4383
4459
|
this.socketRef.on('unseen_count_changed', (data) => {
|
|
4384
4460
|
this.unseenCount = data.unseenCount;
|
|
@@ -4437,7 +4513,7 @@ const NutsInboxWidget = class {
|
|
|
4437
4513
|
return (h("div", { onClick: this.togglePopover, class: "BellIcon" }, h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "32", height: "32", fill: "currentColor", class: "bi bi-bell", viewBox: "0 0 16 16" }, ' ', h("path", { d: "M8 16a2 2 0 0 0 2-2H6a2 2 0 0 0 2 2zM8 1.918l-.797.161A4.002 4.002 0 0 0 4 6c0 .628-.134 2.197-.459 3.742-.16.767-.376 1.566-.663 2.258h10.244c-.287-.692-.502-1.49-.663-2.258C12.134 8.197 12 6.628 12 6a4.002 4.002 0 0 0-3.203-3.92L8 1.917zM14.22 12c.223.447.481.801.78 1H1c.299-.199.557-.553.78-1C2.68 10.2 3 6.88 3 6c0-2.42 1.72-4.44 4.005-4.901a1 1 0 1 1 1.99 0A5.002 5.002 0 0 1 13 6c0 .88.32 4.2 1.22 6z" }), ' '), this.unseenCount > 0 ? (h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", class: "nc-bell-button-dot css-0 css-1eg2znq" }, h("rect", { x: "1.5", y: "1.5", width: "13", height: "13", rx: "6.5", fill: "url(#paint0_linear_1722_2699)", stroke: "#1E1E26", "stroke-width": "3" }), h("defs", null, h("linearGradient", { id: "paint0_linear_1722_2699", x1: "8", y1: "13", x2: "8", y2: "3", gradientUnits: "userSpaceOnUse" }, h("stop", { "stop-color": "#FF512F" }), h("stop", { offset: "1", "stop-color": "#DD2476" }))))) : ('')));
|
|
4438
4514
|
}
|
|
4439
4515
|
render() {
|
|
4440
|
-
return (h("div", { key: '
|
|
4516
|
+
return (h("div", { key: '15e43d27da4718c321f1d498b79b8491b8e298f5', ref: this.assignRefToStylingContainer, class: "Wrapper" }, h("div", { key: '29f955f1cab9088c6c52f55637ae64f4138c1a7c', ref: this.assignRefToBell, class: "BellIconWrapper" }, !this.isLoading && this.renderBellIcon()), this.token && this.popoverVisible && (h("nuts-popover", { key: '6859355573c32c22d69156d8ca04045bee6bc020', "notification-action": this.notificationAction, sessionId: this.sessionId, "unseen-count": this.unseenCount, token: this.token, "backend-url": this.backendUrl, "operator-id": this.operatorId, "user-id": this.userId, language: this.language, "client-styling": this.clientStyling, "client-styling-url": this.clientStylingUrl, "translation-url": this.translationUrl }))));
|
|
4441
4517
|
}
|
|
4442
4518
|
get el() { return getElement(this); }
|
|
4443
4519
|
static get watchers() { return {
|
|
@@ -42178,6 +42254,10 @@ const DownOutlined$1 = DownOutlined;
|
|
|
42178
42254
|
var InfoCircleFilled = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm32 664c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V456c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272zm-32-344a48.01 48.01 0 010-96 48.01 48.01 0 010 96z" } }] }, "name": "info-circle", "theme": "filled" };
|
|
42179
42255
|
const InfoCircleFilled$1 = InfoCircleFilled;
|
|
42180
42256
|
|
|
42257
|
+
// This icon file is generated automatically.
|
|
42258
|
+
var LoadingOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "0 0 1024 1024", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z" } }] }, "name": "loading", "theme": "outlined" };
|
|
42259
|
+
const LoadingOutlined$1 = LoadingOutlined;
|
|
42260
|
+
|
|
42181
42261
|
// This icon file is generated automatically.
|
|
42182
42262
|
var QuestionCircleFilled = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 708c-22.1 0-40-17.9-40-40s17.9-40 40-40 40 17.9 40 40-17.9 40-40 40zm62.9-219.5a48.3 48.3 0 00-30.9 44.8V620c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8v-21.5c0-23.1 6.7-45.9 19.9-64.9 12.9-18.6 30.9-32.8 52.1-40.9 34-13.1 56-41.6 56-72.7 0-44.1-43.1-80-96-80s-96 35.9-96 80v7.6c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V420c0-39.3 17.2-76 48.4-103.3C430.4 290.4 470 276 512 276s81.6 14.5 111.6 40.7C654.8 344 672 380.7 672 420c0 57.8-38.1 109.8-97.1 132.5z" } }] }, "name": "question-circle", "theme": "filled" };
|
|
42183
42263
|
const QuestionCircleFilled$1 = QuestionCircleFilled;
|
|
@@ -42292,6 +42372,7 @@ const NutsNotification = class {
|
|
|
42292
42372
|
registerInstance(this, hostRef);
|
|
42293
42373
|
this.messageDeteled = createEvent(this, "messageDeleted", 7);
|
|
42294
42374
|
this.settingsOpened = createEvent(this, "settingsOpened", 7);
|
|
42375
|
+
this.messageReadEmitter = createEvent(this, "messageRead", 7);
|
|
42295
42376
|
this.toggleSettingsModal = (e) => {
|
|
42296
42377
|
e.stopImmediatePropagation();
|
|
42297
42378
|
this.showSettingsModal = !this.showSettingsModal;
|
|
@@ -42301,21 +42382,28 @@ const NutsNotification = class {
|
|
|
42301
42382
|
event === null || event === void 0 ? void 0 : event.stopImmediatePropagation();
|
|
42302
42383
|
const unread = this.messageRead;
|
|
42303
42384
|
const markAsReadBody = {
|
|
42304
|
-
messageId:
|
|
42385
|
+
messageId: this.messageId,
|
|
42305
42386
|
mark: {
|
|
42306
42387
|
seen: !unread,
|
|
42307
42388
|
read: !unread
|
|
42308
42389
|
}
|
|
42309
42390
|
};
|
|
42310
|
-
const
|
|
42391
|
+
const { messageRead, messageSeen, showSettingsModal } = await markAsRead({
|
|
42311
42392
|
baseUrl: this.baseUrl,
|
|
42312
42393
|
body: markAsReadBody,
|
|
42313
42394
|
token: this.token,
|
|
42314
42395
|
unread
|
|
42315
42396
|
});
|
|
42316
|
-
this.
|
|
42317
|
-
|
|
42318
|
-
|
|
42397
|
+
this.messageReadEmitter.emit({
|
|
42398
|
+
messageId: this.messageId,
|
|
42399
|
+
mark: {
|
|
42400
|
+
seen: messageSeen,
|
|
42401
|
+
read: messageRead
|
|
42402
|
+
}
|
|
42403
|
+
});
|
|
42404
|
+
this.messageRead = messageRead;
|
|
42405
|
+
this.messageSeen = messageSeen;
|
|
42406
|
+
this.showSettingsModal = showSettingsModal;
|
|
42319
42407
|
};
|
|
42320
42408
|
this.deleteNotification = async () => {
|
|
42321
42409
|
const deleteMessageResponse = await deleteMessage({
|
|
@@ -42456,10 +42544,10 @@ const NutsNotification = class {
|
|
|
42456
42544
|
ADD_ATTR: ['target'],
|
|
42457
42545
|
ALLOWED_TAGS: ['b', 'u', 'i', 'br']
|
|
42458
42546
|
});
|
|
42459
|
-
return (h("div", { key: '
|
|
42547
|
+
return (h("div", { key: '358d94581fec81af5bb3027f346c6064d80db0de', class: "Wrapper" }, h("div", { key: 'ad5ff48a4b8957c8e5de3a9b766db4588f3fd046', class: 'NotificationContainer' + (this.messageSeen ? '' : ' Unseen'), ref: this.assignRefToStylingContainer, onClick: this.notificationActionHandler }, this.badge ? (h("div", { class: "AvatarContainer" }, h("div", { class: "Avatar" }, ((_a = systemIcons[this.badge]) === null || _a === void 0 ? void 0 : _a.icon) ? (h("div", { innerHTML: systemIcons[this.badge].icon })) : (h("img", { class: "AvatarImage", src: this.badge }))))) : (''), h("div", { key: 'd32ac71ae5260d39faafacb227195985b197e2e8', class: "ContentContainer" }, h("div", { key: 'ad5d1ba9db8bf9f84836f8787b5c5e23e17179d4', innerHTML: sanitizedNotificationBody }), h("p", { key: 'bfd20edda2b7a8a07038da3a16fceb454d0b16f8', class: "Date" }, formatDistanceToNow(new Date(this.date), {
|
|
42460
42548
|
addSuffix: true,
|
|
42461
42549
|
locale: dateFnsLocale(this.language)
|
|
42462
|
-
}))), h("div", { key: '
|
|
42550
|
+
}))), h("div", { key: '09469bd8ba4a0f680c1004cc1015c8de10776791', class: "RightActionsContainer" }, h("div", { key: '201c8f47031d61dc05d7b3e33aa1d7ef90bea202', class: "Settings", onClick: this.toggleSettingsModal }, h("svg", { key: 'b6dd191937df73ce43a5e3345e5c931a203d0bdd', width: "24", height: "24", viewBox: "0 0 30 30", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, h("path", { key: '8742031106db8a0de43ab7713edd190a8e638b5b', d: "M20.625 15.5C20.625 16.5547 21.4453 17.375 22.5 17.375C23.5156 17.375 24.375 16.5547 24.375 15.5C24.375 14.4844 23.5156 13.625 22.5 13.625C21.4453 13.625 20.625 14.4844 20.625 15.5ZM9.375 15.5C9.375 14.4844 8.51562 13.625 7.5 13.625C6.44531 13.625 5.625 14.4844 5.625 15.5C5.625 16.5547 6.44531 17.375 7.5 17.375C8.51562 17.375 9.375 16.5547 9.375 15.5ZM16.875 15.5C16.875 14.4844 16.0156 13.625 15 13.625C13.9453 13.625 13.125 14.4844 13.125 15.5C13.125 16.5547 13.9453 17.375 15 17.375C16.0156 17.375 16.875 16.5547 16.875 15.5Z", fill: "currentColor" }))), ((_b = this.content) === null || _b === void 0 ? void 0 : _b.length) > MAX_NOTIFICATION_TEXT_LENGTH && (h("div", { key: '31d6515c2456a75e38a4be41e24c88f0bb845718', class: "AccordionArrow", innerHTML: systemIcons.arrowDown.icon, ref: this.assignRefToDropdownArrow })))), this.showSettingsModal ? (h("div", { class: "SettingsDropdown" }, h("button", { onClick: this.toggleNotificationRead }, h("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, h("path", { d: "M14.9434 5.17969C14.2109 4.59375 13.625 4.125 10.1387 1.60547C9.64062 1.25391 8.67383 0.375 8 0.375V0.404297C7.9707 0.404297 7.9707 0.375 7.9707 0.375C7.29688 0.375 6.33008 1.25391 5.83203 1.60547C2.3457 4.125 1.75977 4.59375 1.02734 5.17969C0.675781 5.44336 0.5 5.85352 0.5 6.26367V13.9688C0.5 14.7598 1.11523 15.375 1.90625 15.375H14.0938C14.8555 15.375 15.5 14.7598 15.5 13.9688V6.26367C15.5 5.85352 15.2949 5.44336 14.9434 5.17969ZM9.37695 11.1562C8.9668 11.4785 8.46875 11.6543 8 11.6543C7.50195 11.6543 7.00391 11.4785 6.59375 11.1562L2.375 7.8457V6.49805C2.99023 6 3.72266 5.44336 6.94531 3.12891C7.0332 3.04102 7.15039 2.95312 7.26758 2.86523C7.41406 2.74805 7.73633 2.48438 8 2.33789C8.23438 2.48438 8.55664 2.74805 8.70312 2.86523C8.82031 2.95312 8.9375 3.04102 9.02539 3.12891C12.2188 5.44336 12.9805 6 13.625 6.49805V7.8457L9.37695 11.1562Z", fill: "currentColor" })), translate$1(this.messageRead ? 'markAsUnread' : 'markAsRead', this.language)), h("button", { onClick: this.deleteNotification }, h("svg", { width: "16", height: "16", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, h("path", { d: "M4.375 15.4375C4.375 16.1758 4.94922 16.75 5.6875 16.75H13.5625C14.2734 16.75 14.875 16.1758 14.875 15.4375V6.25H4.375V15.4375ZM11.8125 8.4375C11.8125 8.21875 12.0039 8 12.25 8C12.4688 8 12.6875 8.21875 12.6875 8.4375V14.5625C12.6875 14.8086 12.4688 15 12.25 15C12.0039 15 11.8125 14.8086 11.8125 14.5625V8.4375ZM9.1875 8.4375C9.1875 8.21875 9.37891 8 9.625 8C9.84375 8 10.0625 8.21875 10.0625 8.4375V14.5625C10.0625 14.8086 9.84375 15 9.625 15C9.37891 15 9.1875 14.8086 9.1875 14.5625V8.4375ZM6.5625 8.4375C6.5625 8.21875 6.75391 8 7 8C7.21875 8 7.4375 8.21875 7.4375 8.4375V14.5625C7.4375 14.8086 7.21875 15 7 15C6.75391 15 6.5625 14.8086 6.5625 14.5625V8.4375ZM15.3125 3.625H12.25L11.9219 2.99609C11.8398 2.85938 11.7031 2.75 11.5391 2.75H7.68359C7.51953 2.75 7.38281 2.85938 7.30078 2.99609L7 3.625H3.9375C3.69141 3.625 3.5 3.84375 3.5 4.0625V4.9375C3.5 5.18359 3.69141 5.375 3.9375 5.375H15.3125C15.5312 5.375 15.75 5.18359 15.75 4.9375V4.0625C15.75 3.84375 15.5312 3.625 15.3125 3.625Z", fill: "currentColor" })), translate$1('removeMessage', this.language)))) : ('')));
|
|
42463
42551
|
}
|
|
42464
42552
|
get el() { return getElement(this); }
|
|
42465
42553
|
static get watchers() { return {
|
|
@@ -42470,7 +42558,7 @@ const NutsNotification = class {
|
|
|
42470
42558
|
};
|
|
42471
42559
|
NutsNotification.style = NutsNotificationStyle0;
|
|
42472
42560
|
|
|
42473
|
-
const nutsPopoverCss = ":host{display:block}.Popover{padding:15px 0px;border-radius:7px;box-shadow:var(--emw--color-gray-400, rgba(0, 0, 0, 0.2)) 0px 5px 20px;background:var(--emw--color-gray-300, rgb(30, 30, 38));margin:0px;font-family:inherit;color:var(--emw--color-gray-200, rgb(51, 55, 55));direction:ltr;width:420px;z-index:999;position:absolute;right:0}.Popover .Header{display:flex;padding:0 20px 10px 20px;align-items:center;box-shadow:var(--emw--color-gray-20, rgba(0, 0, 0, 0.2)) 0px 5px 5px -5px}.Popover .Header .Title{color:var(--emw--color-white, rgb(255, 255, 255));font-size:20px;font-style:normal;font-weight:700;line-height:24px;text-align:center;padding-left:10px;display:flex;align-items:center;gap:5px}.Popover .Header .Title .UnseenCounter{margin-right:5px;display:flex;align-items:center;justify-content:center;text-decoration:none;box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;text-transform:uppercase;border-radius:var(--emw--border-radius-medium, 10px);letter-spacing:0.25px;text-overflow:ellipsis;overflow:hidden;padding:0px;width:25px;height:20px;pointer-events:none;border:none;background:linear-gradient(0deg, var(--emw--color-secondary-20, rgb(255, 81, 47)) 0%, var(--emw--color-secondary, rgb(221, 36, 118)) 100%);font-family:inherit;line-height:14px;color:var(--emw--color-white, rgb(255, 255, 255));font-weight:bold;font-size:12px}.Popover .Header .MarkAsRead{font-size:14px;font-style:normal;font-weight:400;line-height:17px;color:var(--emw--color-gray-150, rgb(130, 130, 153));cursor:pointer;pointer-events:auto;opacity:0.5}.Popover .Header .MarkAsRead:hover{opacity:0.7;transition:250ms}.Popover .Header .ActionButtons{margin-left:auto;display:flex;align-items:center;justify-content:center}.Popover .Header .DeleteAll,.Popover .Header .ClosePopover{font-style:normal;border:none;background:transparent;font-weight:400;line-height:17px;color:var(--emw--color-gray-150, rgb(130, 130, 153));cursor:pointer;pointer-events:auto;opacity:0.5}.Popover .Header .DeleteAll svg,.Popover .Header .ClosePopover svg{width:25px;height:25px}.Popover .Header .DeleteAll:hover,.Popover .Header .ClosePopover:hover{opacity:0.7;transition:250ms}.Popover .Header .ClosePopover div{display:flex;align-items:center;justify-content:center}.Popover .Header .DeleteAll{display:flex;align-items:center;justify-content:center}.Popover .Header .DeleteAll svg{width:30px;height:30px}.Popover .Header .DeleteAll.Active{opacity:1}.Popover .Header .DeleteAll:disabled{opacity:0.5;cursor:not-allowed}.Popover .DeleteAllDropdown{z-index:999;position:absolute;background:var(--emw--color-gray-400, rgb(41, 41, 51));box-shadow:var(--emw--color-gray-20, rgba(0, 0, 0, 0.2)) 0px 5px 20px;border-radius:7px;padding:4px;border:none;transition-property:opacity;transition-duration:150ms;transition-timing-function:ease;opacity:1;width:max-content;display:flex;flex-direction:column;right:100px;top:50px}.Popover .DeleteAllDropdown svg{margin-right:10px}.Popover .DeleteAllDropdown button{font-family:inherit;border:0px;background-color:transparent;outline:0px;width:100%;text-align:left;text-decoration:none;box-sizing:border-box;padding:10px 12px;cursor:pointer;border-radius:7px;display:flex;align-items:center;color:var(--emw--color-white, rgb(255, 255, 255));font-weight:400;font-size:14px}.Popover .DeleteAllDropdown button:hover{background:var(--emw--color-gray-300, rgb(61, 61, 77));transition:300ms}.Popover .NotificationList{height:400px;overflow:auto;box-shadow:0px 20px 10px -20px rgba(0, 0, 0, 0.45) inset, 0px -20px 10px -20px rgba(0, 0, 0, 0.45) inset}.Popover .NotificationList .NoMessages{display:flex;justify-content:center;flex-direction:column;align-items:center;height:100%}.Popover .NotificationList .NoMessages p{color:var(--emw--color-white, #fff);opacity:0.7}.Popover .Pagination{display:flex;justify-content:space-around;margin-top:13px}.Popover .Pagination .Button{width:43%}.Popover .Pagination .Button button{font-family:inherit;border:0px;background-color:transparent;outline:0px;width:100%;text-align:left;text-decoration:none;box-sizing:border-box;padding:10px 12px;cursor:pointer;border-radius:7px;display:flex;align-items:center;color:var(--emw--color-white, rgb(255, 255, 255));font-weight:400;font-size:14px;justify-content:center}.Popover .Pagination .Button button svg{width:15px;height:15px;fill:white}.Popover .Pagination .Button button:disabled{cursor:default;opacity:0.5}.Popover .Pagination .Button button:hover:enabled{background:var(--emw--color-gray-300, rgb(61, 61, 77));transition:300ms}";
|
|
42561
|
+
const nutsPopoverCss = ":host{display:block}.Popover{padding:15px 0px;border-radius:7px;box-shadow:var(--emw--color-gray-400, rgba(0, 0, 0, 0.2)) 0px 5px 20px;background:var(--emw--color-gray-300, rgb(30, 30, 38));margin:0px;font-family:inherit;color:var(--emw--color-gray-200, rgb(51, 55, 55));direction:ltr;width:420px;z-index:999;position:absolute;right:0}.Popover .Header{display:flex;padding:0 20px 10px 20px;align-items:center;box-shadow:var(--emw--color-gray-20, rgba(0, 0, 0, 0.2)) 0px 5px 5px -5px}.Popover .Header .Title{color:var(--emw--color-white, rgb(255, 255, 255));font-size:20px;font-style:normal;font-weight:700;line-height:24px;text-align:center;padding-left:10px;display:flex;align-items:center;gap:5px}.Popover .Header .Title .UnseenCounter{margin-right:5px;display:flex;align-items:center;justify-content:center;text-decoration:none;box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;text-transform:uppercase;border-radius:var(--emw--border-radius-medium, 10px);letter-spacing:0.25px;text-overflow:ellipsis;overflow:hidden;padding:0px;width:25px;height:20px;pointer-events:none;border:none;background:linear-gradient(0deg, var(--emw--color-secondary-20, rgb(255, 81, 47)) 0%, var(--emw--color-secondary, rgb(221, 36, 118)) 100%);font-family:inherit;line-height:14px;color:var(--emw--color-white, rgb(255, 255, 255));font-weight:bold;font-size:12px}.Popover .Header .MarkAsRead{font-size:14px;font-style:normal;font-weight:400;line-height:17px;color:var(--emw--color-gray-150, rgb(130, 130, 153));cursor:pointer;pointer-events:auto;opacity:0.5}.Popover .Header .MarkAsRead:hover{opacity:0.7;transition:250ms}.Popover .Header .ActionButtons{margin-left:auto;display:flex;align-items:center;justify-content:center}.Popover .Header .DeleteAll,.Popover .Header .ClosePopover{font-style:normal;border:none;background:transparent;font-weight:400;line-height:17px;color:var(--emw--color-gray-150, rgb(130, 130, 153));cursor:pointer;pointer-events:auto;opacity:0.5}.Popover .Header .DeleteAll svg,.Popover .Header .ClosePopover svg{width:25px;height:25px}.Popover .Header .DeleteAll:hover,.Popover .Header .ClosePopover:hover{opacity:0.7;transition:250ms}.Popover .Header .ClosePopover div{display:flex;align-items:center;justify-content:center}.Popover .Header .DeleteAll{display:flex;align-items:center;justify-content:center}.Popover .Header .DeleteAll svg{width:30px;height:30px}.Popover .Header .DeleteAll.Active{opacity:1}.Popover .Header .DeleteAll:disabled{opacity:0.5;cursor:not-allowed}.Popover .DeleteAllDropdown{z-index:999;position:absolute;background:var(--emw--color-gray-400, rgb(41, 41, 51));box-shadow:var(--emw--color-gray-20, rgba(0, 0, 0, 0.2)) 0px 5px 20px;border-radius:7px;padding:4px;border:none;transition-property:opacity;transition-duration:150ms;transition-timing-function:ease;opacity:1;width:max-content;display:flex;flex-direction:column;right:100px;top:50px}.Popover .DeleteAllDropdown svg{margin-right:10px}.Popover .DeleteAllDropdown button{font-family:inherit;border:0px;background-color:transparent;outline:0px;width:100%;text-align:left;text-decoration:none;box-sizing:border-box;padding:10px 12px;cursor:pointer;border-radius:7px;display:flex;align-items:center;color:var(--emw--color-white, rgb(255, 255, 255));font-weight:400;font-size:14px}.Popover .DeleteAllDropdown button:hover{background:var(--emw--color-gray-300, rgb(61, 61, 77));transition:300ms}.Popover .NotificationList{height:400px;overflow:auto;box-shadow:0px 20px 10px -20px rgba(0, 0, 0, 0.45) inset, 0px -20px 10px -20px rgba(0, 0, 0, 0.45) inset}.Popover .NotificationList .NoMessages{display:flex;justify-content:center;flex-direction:column;align-items:center;height:100%}.Popover .NotificationList .NoMessages p{color:var(--emw--color-white, #fff);opacity:0.7}.Popover .Loading{display:flex;align-items:center;justify-content:center;width:100%;height:100%}.Popover .Loading svg{animation:spin 1s linear infinite;transform-origin:center}.Popover .Pagination{display:flex;justify-content:space-around;margin-top:13px}.Popover .Pagination .Button{width:43%}.Popover .Pagination .Button button{font-family:inherit;border:0px;background-color:transparent;outline:0px;width:100%;text-align:left;text-decoration:none;box-sizing:border-box;padding:10px 12px;cursor:pointer;border-radius:7px;display:flex;align-items:center;color:var(--emw--color-white, rgb(255, 255, 255));font-weight:400;font-size:14px;justify-content:center}.Popover .Pagination .Button button svg{width:15px;height:15px;fill:white}.Popover .Pagination .Button button:disabled{cursor:default;opacity:0.5}.Popover .Pagination .Button button:hover:enabled{background:var(--emw--color-gray-300, rgb(61, 61, 77));transition:300ms}@keyframes spin{100%{transform:rotate(360deg)}}";
|
|
42474
42562
|
const NutsPopoverStyle0 = nutsPopoverCss;
|
|
42475
42563
|
|
|
42476
42564
|
const NutsPopover = class {
|
|
@@ -42480,33 +42568,15 @@ const NutsPopover = class {
|
|
|
42480
42568
|
this.allMessagesDeteled = createEvent(this, "allMessagesDeleted", 7);
|
|
42481
42569
|
this.closePopoverEmmiter = createEvent(this, "closePopover", 7);
|
|
42482
42570
|
this.currentPage = 0;
|
|
42483
|
-
this.updateNotificationsDataAfterPageChange = (getNotificationsData) => {
|
|
42484
|
-
this.notifications = getNotificationsData.notifications;
|
|
42485
|
-
this.hasMore = getNotificationsData.hasMore;
|
|
42486
|
-
this.isLoading = getNotificationsData.isLoading;
|
|
42487
|
-
};
|
|
42488
42571
|
this.nextPage = async () => {
|
|
42489
|
-
if (!this.hasMore) {
|
|
42490
|
-
return;
|
|
42491
|
-
}
|
|
42492
42572
|
this.currentPage++;
|
|
42493
|
-
|
|
42494
|
-
baseUrl: this.baseUrl,
|
|
42495
|
-
token: this.token,
|
|
42496
|
-
page: this.currentPage
|
|
42497
|
-
}).then((data) => {
|
|
42498
|
-
return this.updateNotificationsDataAfterPageChange(data);
|
|
42499
|
-
});
|
|
42573
|
+
this.triggerGetNotifications();
|
|
42500
42574
|
};
|
|
42501
|
-
this.prevPage = () => {
|
|
42575
|
+
this.prevPage = async () => {
|
|
42502
42576
|
if (this.currentPage > 0) {
|
|
42503
42577
|
this.currentPage--;
|
|
42578
|
+
this.triggerGetNotifications();
|
|
42504
42579
|
}
|
|
42505
|
-
getNotifications({
|
|
42506
|
-
baseUrl: this.baseUrl,
|
|
42507
|
-
token: this.token,
|
|
42508
|
-
page: this.currentPage
|
|
42509
|
-
}).then((data) => this.updateNotificationsDataAfterPageChange(data));
|
|
42510
42580
|
};
|
|
42511
42581
|
this.setClientStyling = () => {
|
|
42512
42582
|
let sheet = document.createElement('style');
|
|
@@ -42536,6 +42606,7 @@ const NutsPopover = class {
|
|
|
42536
42606
|
if (markedAllNotificationsAsRead) {
|
|
42537
42607
|
this.allNotificationsRead.emit();
|
|
42538
42608
|
this.unseenCount = 0;
|
|
42609
|
+
notificationCache.markAllAsRead();
|
|
42539
42610
|
}
|
|
42540
42611
|
};
|
|
42541
42612
|
this.deleteAllNotifications = async () => {
|
|
@@ -42546,6 +42617,8 @@ const NutsPopover = class {
|
|
|
42546
42617
|
if (allNotificationsDeleted) {
|
|
42547
42618
|
this.allMessagesDeteled.emit();
|
|
42548
42619
|
this.unseenCount = 0;
|
|
42620
|
+
this.currentPage = 0;
|
|
42621
|
+
notificationCache.clearAll();
|
|
42549
42622
|
this.showDeleteAllPopup = false;
|
|
42550
42623
|
}
|
|
42551
42624
|
};
|
|
@@ -42574,36 +42647,19 @@ const NutsPopover = class {
|
|
|
42574
42647
|
this.clientStyling = '';
|
|
42575
42648
|
this.translationUrl = '';
|
|
42576
42649
|
this.notifications = undefined;
|
|
42577
|
-
this.isLoading =
|
|
42650
|
+
this.isLoading = false;
|
|
42651
|
+
this.isNotificationsLoading = true;
|
|
42578
42652
|
this.showMarkAll = false;
|
|
42579
42653
|
this.limitStylingAppends = false;
|
|
42580
42654
|
this.showDeleteAllPopup = false;
|
|
42581
42655
|
this.hasMore = true;
|
|
42582
42656
|
}
|
|
42583
|
-
|
|
42584
|
-
|
|
42585
|
-
|
|
42586
|
-
|
|
42587
|
-
|
|
42588
|
-
|
|
42589
|
-
token: this.token,
|
|
42590
|
-
page: this.currentPage
|
|
42591
|
-
}).then((data) => this.updateNotificationsDataAfterPageChange(data));
|
|
42592
|
-
}
|
|
42593
|
-
allMessagesDeletedHandler() {
|
|
42594
|
-
this.notifications = [];
|
|
42595
|
-
getNotifications({
|
|
42596
|
-
baseUrl: this.baseUrl,
|
|
42597
|
-
token: this.token,
|
|
42598
|
-
page: this.currentPage
|
|
42599
|
-
}).then((data) => this.updateNotificationsDataAfterPageChange(data));
|
|
42600
|
-
}
|
|
42601
|
-
newNotificationHandler(event) {
|
|
42602
|
-
if (Array.isArray(this.notifications)) {
|
|
42603
|
-
this.notifications = [event.detail, ...this.notifications];
|
|
42604
|
-
return;
|
|
42605
|
-
}
|
|
42606
|
-
this.notifications = [event.detail];
|
|
42657
|
+
messageDeletedHandler(event) {
|
|
42658
|
+
notificationCache.deleteById(event.detail);
|
|
42659
|
+
}
|
|
42660
|
+
messageReadHandler(event) {
|
|
42661
|
+
const { messageId, mark } = event.detail;
|
|
42662
|
+
notificationCache.markAsRead(messageId, mark);
|
|
42607
42663
|
}
|
|
42608
42664
|
clickOutsideHandle(ev) {
|
|
42609
42665
|
var _a;
|
|
@@ -42650,26 +42706,46 @@ const NutsPopover = class {
|
|
|
42650
42706
|
}
|
|
42651
42707
|
// end custom styling area
|
|
42652
42708
|
}
|
|
42709
|
+
async triggerGetNotifications() {
|
|
42710
|
+
this.isNotificationsLoading = true;
|
|
42711
|
+
try {
|
|
42712
|
+
await notificationCache.loadPageFromApi(this.currentPage, async () => getNotifications({
|
|
42713
|
+
baseUrl: this.baseUrl,
|
|
42714
|
+
token: this.token,
|
|
42715
|
+
page: this.currentPage
|
|
42716
|
+
}));
|
|
42717
|
+
}
|
|
42718
|
+
finally {
|
|
42719
|
+
this.isNotificationsLoading = false;
|
|
42720
|
+
}
|
|
42721
|
+
}
|
|
42653
42722
|
connectedCallback() {
|
|
42654
42723
|
this.baseUrl = `${this.backendUrl}/v1/${this.operatorId}`;
|
|
42655
|
-
|
|
42656
|
-
|
|
42657
|
-
|
|
42658
|
-
|
|
42659
|
-
|
|
42724
|
+
notificationCache.observePageUpdate((notifications, hasMore) => {
|
|
42725
|
+
if ((notifications === null || notifications === void 0 ? void 0 : notifications.length) === 0 && this.currentPage > 0) {
|
|
42726
|
+
// if it's last notification on it's page go back a page and retrigger
|
|
42727
|
+
this.currentPage--;
|
|
42728
|
+
this.triggerGetNotifications();
|
|
42729
|
+
return;
|
|
42730
|
+
}
|
|
42731
|
+
this.notifications = notifications;
|
|
42732
|
+
this.hasMore = hasMore;
|
|
42733
|
+
});
|
|
42734
|
+
this.triggerGetNotifications();
|
|
42660
42735
|
if (this.unseenCount != 0) {
|
|
42661
42736
|
this.showMarkAll = true;
|
|
42662
42737
|
}
|
|
42663
42738
|
}
|
|
42664
42739
|
render() {
|
|
42665
|
-
var _a, _b
|
|
42666
|
-
return (h("div", { key: '
|
|
42740
|
+
var _a, _b;
|
|
42741
|
+
return (h("div", { key: 'f1e94beefef26d3934955020552014a30b0544ed', class: "Popover", ref: this.assignRefToStylingContainer }, h("div", { key: '7cf55accedb0b20be815f8755ae8b9f316ce2416', class: "Header" }, h("div", { key: '11092950fc491f1b6e8ee60ae23703f9981ec2fa', class: "Title" }, translate$1('notifications', this.language), this.unseenCount > 0 ? h("div", { class: "UnseenCounter" }, this.unseenCount) : ''), this.showMarkAll && (h("div", { key: '8d041cdbc51818c8a5119569dd919c6ab5daa0c0', class: "MarkAsRead", onClick: this.markAllNotificationsAsRead }, translate$1('markAllAsRead', this.language))), h("div", { key: 'b8865c62341b0fc4db24741cb46bd0edc308a935', class: "ActionButtons" }, h("button", { key: 'a074740e1641941d35b9facf1796371da126530f', class: `DeleteAll${this.showDeleteAllPopup ? ' Active' : ''}`, onClick: this.showDeletePopup, disabled: !((_a = this.notifications) === null || _a === void 0 ? void 0 : _a.length) }, h("svg", { key: 'a543450f4ff6261d140a26ca5a97b988389ff982', width: "16", height: "16", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, h("path", { key: '0eed6954821bea3d392b21446894fd5651fb1674', d: "M4.375 15.4375C4.375 16.1758 4.94922 16.75 5.6875 16.75H13.5625C14.2734 16.75 14.875 16.1758 14.875 15.4375V6.25H4.375V15.4375ZM11.8125 8.4375C11.8125 8.21875 12.0039 8 12.25 8C12.4688 8 12.6875 8.21875 12.6875 8.4375V14.5625C12.6875 14.8086 12.4688 15 12.25 15C12.0039 15 11.8125 14.8086 11.8125 14.5625V8.4375ZM9.1875 8.4375C9.1875 8.21875 9.37891 8 9.625 8C9.84375 8 10.0625 8.21875 10.0625 8.4375V14.5625C10.0625 14.8086 9.84375 15 9.625 15C9.37891 15 9.1875 14.8086 9.1875 14.5625V8.4375ZM6.5625 8.4375C6.5625 8.21875 6.75391 8 7 8C7.21875 8 7.4375 8.21875 7.4375 8.4375V14.5625C7.4375 14.8086 7.21875 15 7 15C6.75391 15 6.5625 14.8086 6.5625 14.5625V8.4375ZM15.3125 3.625H12.25L11.9219 2.99609C11.8398 2.85938 11.7031 2.75 11.5391 2.75H7.68359C7.51953 2.75 7.38281 2.85938 7.30078 2.99609L7 3.625H3.9375C3.69141 3.625 3.5 3.84375 3.5 4.0625V4.9375C3.5 5.18359 3.69141 5.375 3.9375 5.375H15.3125C15.5312 5.375 15.75 5.18359 15.75 4.9375V4.0625C15.75 3.84375 15.5312 3.625 15.3125 3.625Z", fill: "currentColor" }))), h("button", { key: 'f79e2a36a88b8b29c542ecb631d401258fbc606b', class: "ClosePopover", onClick: this.closePopover }, h("div", { key: '06ca6ddd2d1c402f05cdb74986c85c50780ee829', innerHTML: renderIconDefinitionToSVGElement(CloseCircleOutlined$1, {
|
|
42667
42742
|
extraSVGAttrs: { width: '20px', height: '20px', fill: '#A1A1B2' }
|
|
42668
|
-
}) }))), this.showDeleteAllPopup && (h("div", { key: '
|
|
42669
|
-
|
|
42670
|
-
|
|
42671
|
-
|
|
42672
|
-
|
|
42743
|
+
}) }))), this.showDeleteAllPopup && (h("div", { key: '0185c7fba8fbd79ebba6247e01a7ce85652b755f', class: "DeleteAllDropdown", ref: (el) => (this.dropdownRef = el) }, h("button", { key: 'f183425b99dcb14758eea42e165ec628fb97a421', onClick: this.deleteAllNotifications }, translate$1('deleteAllMessages', this.language))))), !this.isLoading && (h("div", { key: 'ff6474f5107c9cd28cf61eaf8db3fe06cfe51fae', class: "NotificationList" }, this.isNotificationsLoading ? (h("div", { class: "Loading", innerHTML: renderIconDefinitionToSVGElement(LoadingOutlined$1, {
|
|
42744
|
+
extraSVGAttrs: { width: '30px', height: '30px', fill: '#A1A1B2' }
|
|
42745
|
+
}) })) : ((_b = this.notifications) === null || _b === void 0 ? void 0 : _b.length) > 0 ? (this.notifications.map((item) => {
|
|
42746
|
+
var _a;
|
|
42747
|
+
return (h("nuts-notification", { "client-styling": this.clientStyling, "client-styling-url": this.clientStylingUrl, key: item.id, "user-id": this.userId, "operator-id": this.operatorId, content: item.content, "message-id": item.id, badge: ((_a = item.actor) === null || _a === void 0 ? void 0 : _a.data) || '', sessionId: this.sessionId, date: item.createdAt, read: item.read, seen: item.seen, language: this.language, "notification-action": this.notificationAction, token: this.token, "backend-url": this.backendUrl, "redirect-url": item.cta.data.url, "translation-url": this.translationUrl }));
|
|
42748
|
+
})) : (h("div", { class: "NoMessages" }, h("svg", { width: "120", height: "108", viewBox: "0 0 120 108", fill: "none" }, h("circle", { cx: "11.3191", cy: "30.7872", r: "6.31915", stroke: "#3D3D4D", "stroke-width": "3.5", "stroke-linecap": "round", "stroke-linejoin": "round" }), h("ellipse", { cx: "60.117", cy: "27.9787", rx: "5.96809", ry: "5.61702", stroke: "#828299", "stroke-width": "3.5", "stroke-linecap": "round", "stroke-linejoin": "round" }), h("path", { d: "M79.5424 49.4934C79.5424 44.1598 77.6437 39.0446 74.2641 35.2732C70.8844 31.5017 66.3006 29.3829 61.5211 29.3829C56.7415 29.3829 52.1578 31.5017 48.7781 35.2732C45.3985 39.0446 43.4998 44.1598 43.4998 49.4934C43.4998 72.9557 34.4892 79.6592 34.4892 79.6592H88.553C88.553 79.6592 79.5424 72.9557 79.5424 49.4934Z", fill: "#292933" }), h("path", { d: "M68.8995 81.7552C68.1496 83.551 67.0731 85.0417 65.778 86.0779C64.4828 87.1141 63.0144 87.6595 61.5198 87.6595C60.0252 87.6595 58.5568 87.1141 57.2617 86.0779C55.9665 85.0417 54.8901 83.551 54.1401 81.7552", fill: "#292933" }), h("path", { d: "M81.2976 50.2203C81.2976 68.2545 87.2222 76.7327 90.2814 79.9083C90.7671 80.4126 90.3802 81.4764 89.68 81.4764C88.0927 81.4764 86.5488 81.4764 85.0422 81.4764M68.5814 82.946C67.6854 84.8068 66.3993 86.3513 64.8518 87.425C63.3044 88.4987 61.5499 89.0638 59.7641 89.0638C57.9783 89.0638 56.2239 88.4987 54.6765 87.425C53.129 86.3513 51.8429 84.8068 50.9468 82.946M79.712 42.3723C78.6394 39.8192 77.0439 37.4727 74.991 35.4861C70.953 31.5783 65.4763 29.3829 59.7656 29.3829C54.055 29.3829 48.5783 31.5783 44.5403 35.4861C43.3681 36.6205 42.345 37.8722 41.4832 39.2127C40.4958 40.7487 39.7202 42.4013 39.1747 44.1276C38.5563 46.0847 38.2337 48.1364 38.2337 50.2203C38.2337 53.2503 38.0665 56.0106 37.7737 58.5212M34.8401 70.7608C32.9874 75.4551 30.7688 78.331 29.2526 79.9055C28.767 80.4099 29.155 81.4764 29.8551 81.4764C47.1962 81.4764 59.3571 81.4764 74.1593 81.4764", stroke: "#828299", "stroke-width": "3.5", "stroke-linecap": "round", "stroke-linejoin": "round" }), h("path", { d: "M55.6345 59.0737C55.1665 59.7144 54.4949 60.2462 53.6868 60.6159C52.8787 60.9855 51.9625 61.1801 51.0299 61.1801C50.0973 61.1801 49.1811 60.9855 48.373 60.6159C47.5649 60.2462 46.8933 59.7144 46.4254 59.0737", stroke: "#828299", "stroke-width": "3.5", "stroke-linecap": "round", "stroke-linejoin": "round" }), h("path", { d: "M73.1877 59.0737C72.7197 59.7144 72.0481 60.2462 71.24 60.6159C70.4319 60.9855 69.5157 61.1801 68.5831 61.1801C67.6506 61.1801 66.7344 60.9855 65.9263 60.6159C65.1182 60.2462 64.4465 59.7144 63.9786 59.0737", stroke: "#828299", "stroke-width": "3.5", "stroke-linecap": "round", "stroke-linejoin": "round" }), h("circle", { cx: "107.511", cy: "56.0638", r: "7.02128", stroke: "#3D3D4D", "stroke-width": "3.5", "stroke-linecap": "round", "stroke-linejoin": "round" }), h("circle", { cx: "16.4252", cy: "58.1703", r: "4.21277", fill: "#3D3D4D" }), h("ellipse", { cx: "59.9573", cy: "104.511", rx: "25.2766", ry: "2.80851", fill: "#3D3D4D" }), h("path", { d: "M81.5317 18.1489H88.553L81.5317 25.1702H88.553", stroke: "#828299", "stroke-width": "3.5", "stroke-linecap": "round", "stroke-linejoin": "round" }), h("path", { d: "M96.6807 2H106.51L96.6807 11.8298H106.51", stroke: "#828299", "stroke-width": "3.5", "stroke-linecap": "round", "stroke-linejoin": "round" })), h("p", null, translate$1('noMessages', this.language)))))), !this.isLoading && (h("div", { key: '2f6963fcdbde521150bcdf1a74df14c1c83c0590', class: "Pagination" }, h("div", { key: '50b7efd6616498cb39545f34748fe8ccfd044928', class: "Button" }, h("button", { key: '936b5f460c7d68a3388b3b1c463001302156c4f0', disabled: this.isNotificationsLoading || this.currentPage <= 0, onClick: this.prevPage }, h("svg", { key: '66c1f5220c386baa75dc639765cc8ff2be56cf13', class: "svg-icon", viewBox: "0 0 20 20" }, h("path", { key: '59cf1db0cedb6380700afae53a79cdd55bc4aca4', d: "M8.388,10.049l4.76-4.873c0.303-0.31,0.297-0.804-0.012-1.105c-0.309-0.304-0.803-0.293-1.105,0.012L6.726,9.516c-0.303,0.31-0.296,0.805,0.012,1.105l5.433,5.307c0.152,0.148,0.35,0.223,0.547,0.223c0.203,0,0.406-0.08,0.559-0.236c0.303-0.309,0.295-0.803-0.012-1.104L8.388,10.049z" })), translate$1('prev', this.language))), h("div", { key: 'b3deb3012ec1ce92a96b4cc1f4ae13b495d5792d', class: "Button" }, h("button", { key: '063fc0d76d6ca06eccc0129e8edcfa40e7cc8f4c', disabled: this.isNotificationsLoading || !this.hasMore, onClick: this.nextPage }, translate$1('next', this.language), h("svg", { key: '1a36392bd201328cd17fe6fa235450f54ac134bc', class: "svg-icon", viewBox: "0 0 20 20" }, h("path", { key: 'a66894d1ab1713d32c604a00251d2100da32c063', d: "M11.611,10.049l-4.76-4.873c-0.303-0.31-0.297-0.804,0.012-1.105c0.309-0.304,0.803-0.293,1.105,0.012l5.306,5.433c0.304,0.31,0.296,0.805-0.012,1.105L7.83,15.928c-0.152,0.148-0.35,0.223-0.547,0.223c-0.203,0-0.406-0.08-0.559-0.236c-0.303-0.309-0.295-0.803,0.012-1.104L11.611,10.049z" }))))))));
|
|
42673
42749
|
}
|
|
42674
42750
|
static get watchers() { return {
|
|
42675
42751
|
"unseenCount": ["unseenCountHandler"],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as n,b as
|
|
1
|
+
import{p as n,b as i}from"./index-6a331097.js";export{s as setNonce}from"./index-6a331097.js";import{g as e}from"./app-globals-0f993ce5.js";(()=>{const i=import.meta.url,e={};return""!==i&&(e.resourcesUrl=new URL(".",i).href),n(e)})().then((async n=>(await e(),i([["nuts-inbox-widget_3",[[1,"nuts-inbox-widget",{backendUrl:[513,"backend-url"],socketUrl:[513,"socket-url"],userId:[513,"user-id"],sessionId:[513,"session-id"],operatorId:[513,"operator-id"],subscriberId:[513,"subscriber-id"],deviceId:[513,"device-id"],language:[513],environment:[513],applicationIdentifier:[513,"application-identifier"],clientStyling:[1537,"client-styling"],clientStylingUrl:[513,"client-styling-url"],bellIconPosition:[513,"bell-icon-position"],notificationAction:[513,"notification-action"],translationUrl:[513,"translation-url"],isLoading:[32],popoverVisible:[32],unseenCount:[32],limitStylingAppends:[32]},[[8,"click","clickOutsideHandle"],[0,"allNotificationsRead","resetUnseenCount"],[8,"closePopover","closePopoverHandler"]],{subscriberId:["initializeHandler"],operatorId:["initializeHandler"],applicationIdentifier:["initializeHandler"],deviceId:["initializeHandler"],clientStyling:["handleStylingChange"],clientStylingUrl:["handleStylingUrlChange"],translationUrl:["handleNewTranslations"]}],[0,"nuts-popover",{language:[513],userId:[513,"user-id"],operatorId:[513,"operator-id"],token:[513],sessionId:[513,"session-id"],backendUrl:[513,"backend-url"],unseenCount:[514,"unseen-count"],clientStylingUrl:[513,"client-styling-url"],notificationAction:[513,"notification-action"],clientStyling:[1537,"client-styling"],translationUrl:[513,"translation-url"],notifications:[32],isLoading:[32],isNotificationsLoading:[32],showMarkAll:[32],limitStylingAppends:[32],showDeleteAllPopup:[32],hasMore:[32]},[[8,"messageDeleted","messageDeletedHandler"],[8,"messageRead","messageReadHandler"],[8,"click","clickOutsideHandle"]],{unseenCount:["unseenCountHandler"],clientStyling:["handleStylingChange"],clientStylingUrl:["handleStylingUrlChange"],translationUrl:["handleNewTranslations"]}],[0,"nuts-notification",{badge:[513],content:[513],date:[513],showSettings:[516,"show-settings"],read:[516],seen:[516],language:[513],sessionId:[513,"session-id"],subscriberId:[513,"subscriber-id"],userId:[513,"user-id"],messageId:[513,"message-id"],operatorId:[513,"operator-id"],token:[513],backendUrl:[513,"backend-url"],redirectUrl:[513,"redirect-url"],notificationAction:[513,"notification-action"],clientStylingUrl:[513,"client-styling-url"],translationUrl:[513,"translation-url"],clientStyling:[1537,"client-styling"],showSettingsModal:[32],messageSeen:[32],messageRead:[32],displayedContent:[32],limitStylingAppends:[32]},[[8,"allNotificationsRead","allNotificationsReadHandler"],[8,"settingsOpened","settingsOpenedHandler"],[8,"click","clickOutsideHandle"]],{clientStyling:["handleStylingChange"],clientStylingUrl:["handleStylingUrlChange"],translationUrl:["handleNewTranslations"]}]]]],n))));
|