@trycourier/courier-ui-inbox 1.0.1-beta → 1.0.3-beta

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/index.es.js CHANGED
@@ -1,8 +1,910 @@
1
- var Lo = Object.defineProperty;
2
- var To = (g, i, e) => i in g ? Lo(g, i, { enumerable: !0, configurable: !0, writable: !0, value: e }) : g[i] = e;
3
- var a = (g, i, e) => To(g, typeof i != "symbol" ? i + "" : i, e);
4
- import { Courier as C } from "@trycourier/courier-js";
5
- var Bo = Object.defineProperty, Ao = (g, i, e) => i in g ? Bo(g, i, { enumerable: !0, configurable: !0, writable: !0, value: e }) : g[i] = e, L = (g, i, e) => Ao(g, typeof i != "symbol" ? i + "" : i, e);
1
+ var qo = Object.defineProperty;
2
+ var Vo = (h, t, e) => t in h ? qo(h, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : h[t] = e;
3
+ var a = (h, t, e) => Vo(h, typeof t != "symbol" ? t + "" : t, e);
4
+ var jo = Object.defineProperty, Zo = (h, t, e) => t in h ? jo(h, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : h[t] = e, T = (h, t, e) => Zo(h, typeof t != "symbol" ? t + "" : t, e);
5
+ const ko = class wo {
6
+ constructor(t, e) {
7
+ T(this, "webSocket", null), T(this, "pingInterval", null), T(this, "onOpen"), T(this, "onMessageReceived"), T(this, "onClose"), T(this, "onError"), T(this, "url"), T(this, "options"), this.url = t, this.options = e;
8
+ }
9
+ /**
10
+ * Dynamically checks if the WebSocket is connected
11
+ */
12
+ get isConnected() {
13
+ return this.webSocket !== null;
14
+ }
15
+ async connect() {
16
+ return this.disconnect(), new Promise((t, e) => {
17
+ try {
18
+ this.webSocket = new WebSocket(this.url), this.webSocket.onopen = () => {
19
+ var i;
20
+ (i = this.onOpen) == null || i.call(this), t();
21
+ }, this.webSocket.onmessage = (i) => {
22
+ var s;
23
+ (s = this.onMessageReceived) == null || s.call(this, i.data);
24
+ }, this.webSocket.onclose = (i) => {
25
+ var s;
26
+ this.webSocket = null, (s = this.onClose) == null || s.call(this, i.code, i.reason);
27
+ }, this.webSocket.onerror = (i) => {
28
+ var s;
29
+ this.webSocket = null;
30
+ const o = new Error("Courier Socket connection failed");
31
+ o.originalEvent = i, (s = this.onError) == null || s.call(this, o), e(o);
32
+ };
33
+ } catch (i) {
34
+ this.webSocket = null, e(i);
35
+ }
36
+ });
37
+ }
38
+ disconnect() {
39
+ this.stopPing(), this.webSocket && (this.webSocket.close(wo.NORMAL_CLOSURE_STATUS), this.webSocket = null);
40
+ }
41
+ async send(t) {
42
+ if (!this.webSocket)
43
+ return !1;
44
+ const e = JSON.stringify(t);
45
+ return this.webSocket.send(e) !== void 0;
46
+ }
47
+ keepAlive(t) {
48
+ this.stopPing(), this.pingInterval = setInterval(async () => {
49
+ var e;
50
+ try {
51
+ await this.send({ action: "keepAlive" });
52
+ } catch (i) {
53
+ (e = this.options.logger) == null || e.error("Error occurred on Keep Alive:", i);
54
+ }
55
+ }, (t == null ? void 0 : t.intervalInMillis) ?? 3e5);
56
+ }
57
+ stopPing() {
58
+ this.pingInterval && (clearInterval(this.pingInterval), this.pingInterval = null);
59
+ }
60
+ };
61
+ T(ko, "NORMAL_CLOSURE_STATUS", 1e3);
62
+ let Jo = ko;
63
+ const yo = (h) => ({
64
+ courier: {
65
+ rest: (h == null ? void 0 : h.courier.rest) || "https://api.courier.com",
66
+ graphql: (h == null ? void 0 : h.courier.graphql) || "https://api.courier.com/client/q"
67
+ },
68
+ inbox: {
69
+ graphql: (h == null ? void 0 : h.inbox.graphql) || "https://inbox.courier.com/q",
70
+ webSocket: (h == null ? void 0 : h.inbox.webSocket) || "wss://realtime.courier.com"
71
+ }
72
+ });
73
+ class Go {
74
+ constructor(t) {
75
+ T(this, "PREFIX", "[COURIER]"), this.showLogs = t;
76
+ }
77
+ warn(t, ...e) {
78
+ this.showLogs && console.warn(`${this.PREFIX} ${t}`, ...e);
79
+ }
80
+ log(t, ...e) {
81
+ this.showLogs && console.log(`${this.PREFIX} ${t}`, ...e);
82
+ }
83
+ error(t, ...e) {
84
+ this.showLogs && console.error(`${this.PREFIX} ${t}`, ...e);
85
+ }
86
+ debug(t, ...e) {
87
+ this.showLogs && console.debug(`${this.PREFIX} ${t}`, ...e);
88
+ }
89
+ info(t, ...e) {
90
+ this.showLogs && console.info(`${this.PREFIX} ${t}`, ...e);
91
+ }
92
+ }
93
+ class Ae {
94
+ static generate(t) {
95
+ const e = Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15);
96
+ return t ? t + e : e;
97
+ }
98
+ }
99
+ class Pe extends Error {
100
+ constructor(t, e, i) {
101
+ super(e), this.code = t, this.type = i, this.name = "CourierRequestError";
102
+ }
103
+ }
104
+ function So(h, t, e, i) {
105
+ h.log(`
106
+ 📡 New Courier ${e} Request: ${t}
107
+ URL: ${i.url}
108
+ ${i.method ? `Method: ${i.method}` : ""}
109
+ ${i.query ? `Query: ${i.query}` : ""}
110
+ ${i.variables ? `Variables: ${JSON.stringify(i.variables, null, 2)}` : ""}
111
+ Headers: ${JSON.stringify(i.headers, null, 2)}
112
+ Body: ${i.body ? JSON.stringify(i.body, null, 2) : "Empty"}
113
+ `);
114
+ }
115
+ function Io(h, t, e, i) {
116
+ h.log(`
117
+ 📡 New Courier ${e} Response: ${t}
118
+ Status Code: ${i.status}
119
+ Response JSON: ${JSON.stringify(i.response, null, 2)}
120
+ `);
121
+ }
122
+ async function K(h) {
123
+ const t = h.validCodes ?? [200], e = h.options.showLogs ? Ae.generate() : void 0, i = new Request(h.url, {
124
+ method: h.method,
125
+ headers: {
126
+ "Content-Type": "application/json",
127
+ ...h.headers
128
+ },
129
+ body: h.body ? JSON.stringify(h.body) : void 0
130
+ });
131
+ e && So(h.options.logger, e, "HTTP", {
132
+ url: i.url,
133
+ method: i.method,
134
+ headers: Object.fromEntries(i.headers.entries()),
135
+ body: h.body
136
+ });
137
+ const s = await fetch(i);
138
+ if (s.status === 204)
139
+ return;
140
+ let o;
141
+ try {
142
+ o = await s.json();
143
+ } catch {
144
+ if (s.status === 200)
145
+ return;
146
+ throw new Pe(
147
+ s.status,
148
+ "Failed to parse response as JSON",
149
+ "PARSE_ERROR"
150
+ );
151
+ }
152
+ if (e && Io(h.options.logger, e, "HTTP", {
153
+ status: s.status,
154
+ response: o
155
+ }), !t.includes(s.status))
156
+ throw new Pe(
157
+ s.status,
158
+ (o == null ? void 0 : o.message) || "Unknown Error",
159
+ o == null ? void 0 : o.type
160
+ );
161
+ return o;
162
+ }
163
+ async function Z(h) {
164
+ const t = h.options.showLogs ? Ae.generate() : void 0;
165
+ t && So(h.options.logger, t, "GraphQL", {
166
+ url: h.url,
167
+ headers: h.headers,
168
+ query: h.query,
169
+ variables: h.variables
170
+ });
171
+ const e = await fetch(h.url, {
172
+ method: "POST",
173
+ headers: {
174
+ "Content-Type": "application/json",
175
+ ...h.headers
176
+ },
177
+ body: JSON.stringify({
178
+ query: h.query,
179
+ variables: h.variables
180
+ })
181
+ });
182
+ let i;
183
+ try {
184
+ i = await e.json();
185
+ } catch {
186
+ throw new Pe(
187
+ e.status,
188
+ "Failed to parse response as JSON",
189
+ "PARSE_ERROR"
190
+ );
191
+ }
192
+ if (t && Io(h.options.logger, t, "GraphQL", {
193
+ status: e.status,
194
+ response: i
195
+ }), !e.ok)
196
+ throw new Pe(
197
+ e.status,
198
+ (i == null ? void 0 : i.message) || "Unknown Error",
199
+ i == null ? void 0 : i.type
200
+ );
201
+ return i;
202
+ }
203
+ class re {
204
+ constructor(t) {
205
+ this.options = t;
206
+ }
207
+ }
208
+ class Wo extends re {
209
+ /**
210
+ * Get a brand by ID using GraphQL
211
+ * @param brandId - The ID of the brand to retrieve
212
+ * @returns Promise resolving to the requested brand
213
+ */
214
+ async getBrand(t) {
215
+ const e = `
216
+ query GetBrand {
217
+ brand(brandId: "${t.brandId}") {
218
+ settings {
219
+ colors {
220
+ primary
221
+ secondary
222
+ tertiary
223
+ }
224
+ inapp {
225
+ borderRadius
226
+ disableCourierFooter
227
+ }
228
+ }
229
+ }
230
+ }
231
+ `;
232
+ return (await Z({
233
+ options: this.options,
234
+ url: this.options.apiUrls.courier.graphql,
235
+ headers: {
236
+ "x-courier-user-id": this.options.userId,
237
+ "x-courier-client-key": "empty",
238
+ // Empty for now. Will be removed in future.
239
+ Authorization: `Bearer ${this.options.accessToken}`
240
+ },
241
+ query: e,
242
+ variables: { brandId: t.brandId }
243
+ })).data.brand;
244
+ }
245
+ }
246
+ class ze extends Jo {
247
+ constructor(t) {
248
+ const e = ze.buildUrl(t);
249
+ super(e, t), T(this, "receivedMessage"), T(this, "receivedMessageEvent"), this.onMessageReceived = (i) => this.convertToType(i);
250
+ }
251
+ convertToType(t) {
252
+ var e, i, s, o;
253
+ try {
254
+ switch (JSON.parse(t).type) {
255
+ case "event":
256
+ const c = JSON.parse(t);
257
+ (e = this.receivedMessageEvent) == null || e.call(this, c);
258
+ break;
259
+ case "message":
260
+ const d = JSON.parse(t);
261
+ (i = this.receivedMessage) == null || i.call(this, d);
262
+ break;
263
+ }
264
+ } catch (n) {
265
+ (s = this.options.logger) == null || s.error("Error parsing socket message", n), n instanceof Error && ((o = this.onError) == null || o.call(this, n));
266
+ }
267
+ }
268
+ async sendSubscribe(t) {
269
+ var e;
270
+ const i = {
271
+ action: "subscribe",
272
+ data: {
273
+ userAgent: "courier-js",
274
+ // TODO: Equivalent to Courier.agent.value()
275
+ channel: this.options.userId,
276
+ event: "*",
277
+ version: (t == null ? void 0 : t.version) ?? 5
278
+ }
279
+ };
280
+ this.options.connectionId && (i.data.clientSourceId = this.options.connectionId), this.options.tenantId && (i.data.accountId = this.options.tenantId), (e = this.options.logger) == null || e.debug("Sending subscribe request", i), await this.send(i);
281
+ }
282
+ static buildUrl(t) {
283
+ var e;
284
+ let i = ((e = t.apiUrls) == null ? void 0 : e.inbox.webSocket) ?? "";
285
+ return t.accessToken && (i += `/?auth=${t.accessToken}`), i;
286
+ }
287
+ }
288
+ class Ko extends re {
289
+ constructor(t) {
290
+ super(t), T(this, "socket"), this.socket = new ze(t);
291
+ }
292
+ /**
293
+ * Get paginated messages
294
+ * @param paginationLimit - Number of messages to return per page (default: 24)
295
+ * @param startCursor - Cursor for pagination
296
+ * @returns Promise resolving to paginated messages response
297
+ */
298
+ async getMessages(t) {
299
+ const e = `
300
+ query GetInboxMessages(
301
+ $params: FilterParamsInput = { ${this.options.tenantId ? `accountId: "${this.options.tenantId}"` : ""} }
302
+ $limit: Int = ${(t == null ? void 0 : t.paginationLimit) ?? 24}
303
+ $after: String ${t != null && t.startCursor ? `= "${t.startCursor}"` : ""}
304
+ ) {
305
+ count(params: $params)
306
+ messages(params: $params, limit: $limit, after: $after) {
307
+ totalCount
308
+ pageInfo {
309
+ startCursor
310
+ hasNextPage
311
+ }
312
+ nodes {
313
+ messageId
314
+ read
315
+ archived
316
+ created
317
+ opened
318
+ title
319
+ preview
320
+ data
321
+ tags
322
+ trackingIds {
323
+ clickTrackingId
324
+ }
325
+ actions {
326
+ content
327
+ data
328
+ href
329
+ }
330
+ }
331
+ }
332
+ }
333
+ `;
334
+ return await Z({
335
+ options: this.options,
336
+ query: e,
337
+ headers: {
338
+ "x-courier-user-id": this.options.userId,
339
+ Authorization: `Bearer ${this.options.accessToken}`
340
+ },
341
+ url: this.options.apiUrls.inbox.graphql
342
+ });
343
+ }
344
+ /**
345
+ * Get paginated archived messages
346
+ * @param paginationLimit - Number of messages to return per page (default: 24)
347
+ * @param startCursor - Cursor for pagination
348
+ * @returns Promise resolving to paginated archived messages response
349
+ */
350
+ async getArchivedMessages(t) {
351
+ const e = `
352
+ query GetInboxMessages(
353
+ $params: FilterParamsInput = { ${this.options.tenantId ? `accountId: "${this.options.tenantId}"` : ""}, archived: true }
354
+ $limit: Int = ${(t == null ? void 0 : t.paginationLimit) ?? 24}
355
+ $after: String ${t != null && t.startCursor ? `= "${t.startCursor}"` : ""}
356
+ ) {
357
+ count(params: $params)
358
+ messages(params: $params, limit: $limit, after: $after) {
359
+ totalCount
360
+ pageInfo {
361
+ startCursor
362
+ hasNextPage
363
+ }
364
+ nodes {
365
+ messageId
366
+ read
367
+ archived
368
+ created
369
+ opened
370
+ title
371
+ preview
372
+ data
373
+ tags
374
+ trackingIds {
375
+ clickTrackingId
376
+ }
377
+ actions {
378
+ content
379
+ data
380
+ href
381
+ }
382
+ }
383
+ }
384
+ }
385
+ `;
386
+ return Z({
387
+ options: this.options,
388
+ query: e,
389
+ headers: {
390
+ "x-courier-user-id": this.options.userId,
391
+ Authorization: `Bearer ${this.options.accessToken}`
392
+ },
393
+ url: this.options.apiUrls.inbox.graphql
394
+ });
395
+ }
396
+ /**
397
+ * Get unread message count
398
+ * @returns Promise resolving to number of unread messages
399
+ */
400
+ async getUnreadMessageCount() {
401
+ var t;
402
+ const e = `
403
+ query GetMessages {
404
+ count(params: { status: "unread" ${this.options.tenantId ? `, accountId: "${this.options.tenantId}"` : ""} })
405
+ }
406
+ `;
407
+ return ((t = (await Z({
408
+ options: this.options,
409
+ query: e,
410
+ headers: {
411
+ "x-courier-user-id": this.options.userId,
412
+ Authorization: `Bearer ${this.options.accessToken}`
413
+ },
414
+ url: this.options.apiUrls.inbox.graphql
415
+ })).data) == null ? void 0 : t.count) ?? 0;
416
+ }
417
+ /**
418
+ * Track a click event
419
+ * @param messageId - ID of the message
420
+ * @param trackingId - ID for tracking the click
421
+ * @returns Promise resolving when click is tracked
422
+ */
423
+ async click(t) {
424
+ const e = `
425
+ mutation TrackEvent {
426
+ clicked(messageId: "${t.messageId}", trackingId: "${t.trackingId}")
427
+ }
428
+ `, i = {
429
+ "x-courier-user-id": this.options.userId,
430
+ Authorization: `Bearer ${this.options.accessToken}`
431
+ };
432
+ this.options.connectionId && (i["x-courier-client-source-id"] = this.options.connectionId), await Z({
433
+ options: this.options,
434
+ query: e,
435
+ headers: i,
436
+ url: this.options.apiUrls.inbox.graphql
437
+ });
438
+ }
439
+ /**
440
+ * Mark a message as read
441
+ * @param messageId - ID of the message to mark as read
442
+ * @returns Promise resolving when message is marked as read
443
+ */
444
+ async read(t) {
445
+ const e = `
446
+ mutation TrackEvent {
447
+ read(messageId: "${t.messageId}")
448
+ }
449
+ `, i = {
450
+ "x-courier-user-id": this.options.userId,
451
+ Authorization: `Bearer ${this.options.accessToken}`
452
+ };
453
+ this.options.connectionId && (i["x-courier-client-source-id"] = this.options.connectionId), await Z({
454
+ options: this.options,
455
+ query: e,
456
+ headers: i,
457
+ url: this.options.apiUrls.inbox.graphql
458
+ });
459
+ }
460
+ /**
461
+ * Mark a message as unread
462
+ * @param messageId - ID of the message to mark as unread
463
+ * @returns Promise resolving when message is marked as unread
464
+ */
465
+ async unread(t) {
466
+ const e = `
467
+ mutation TrackEvent {
468
+ unread(messageId: "${t.messageId}")
469
+ }
470
+ `, i = {
471
+ "x-courier-user-id": this.options.userId,
472
+ Authorization: `Bearer ${this.options.accessToken}`
473
+ };
474
+ this.options.connectionId && (i["x-courier-client-source-id"] = this.options.connectionId), await Z({
475
+ options: this.options,
476
+ query: e,
477
+ headers: i,
478
+ url: this.options.apiUrls.inbox.graphql
479
+ });
480
+ }
481
+ /**
482
+ * Mark all messages as read
483
+ * @returns Promise resolving when all messages are marked as read
484
+ */
485
+ async readAll() {
486
+ const t = `
487
+ mutation TrackEvent {
488
+ markAllRead
489
+ }
490
+ `, e = {
491
+ "x-courier-user-id": this.options.userId,
492
+ Authorization: `Bearer ${this.options.accessToken}`
493
+ };
494
+ this.options.connectionId && (e["x-courier-client-source-id"] = this.options.connectionId), await Z({
495
+ options: this.options,
496
+ query: t,
497
+ headers: e,
498
+ url: this.options.apiUrls.inbox.graphql
499
+ });
500
+ }
501
+ /**
502
+ * Mark a message as opened
503
+ * @param messageId - ID of the message to mark as opened
504
+ * @returns Promise resolving when message is marked as opened
505
+ */
506
+ async open(t) {
507
+ const e = `
508
+ mutation TrackEvent {
509
+ opened(messageId: "${t.messageId}")
510
+ }
511
+ `, i = {
512
+ "x-courier-user-id": this.options.userId,
513
+ Authorization: `Bearer ${this.options.accessToken}`
514
+ };
515
+ this.options.connectionId && (i["x-courier-client-source-id"] = this.options.connectionId), await Z({
516
+ options: this.options,
517
+ query: e,
518
+ headers: i,
519
+ url: this.options.apiUrls.inbox.graphql
520
+ });
521
+ }
522
+ /**
523
+ * Archive a message
524
+ * @param messageId - ID of the message to archive
525
+ * @returns Promise resolving when message is archived
526
+ */
527
+ async archive(t) {
528
+ const e = `
529
+ mutation TrackEvent {
530
+ archive(messageId: "${t.messageId}")
531
+ }
532
+ `, i = {
533
+ "x-courier-user-id": this.options.userId,
534
+ Authorization: `Bearer ${this.options.accessToken}`
535
+ };
536
+ this.options.connectionId && (i["x-courier-client-source-id"] = this.options.connectionId), await Z({
537
+ options: this.options,
538
+ query: e,
539
+ headers: i,
540
+ url: this.options.apiUrls.inbox.graphql
541
+ });
542
+ }
543
+ /**
544
+ * Archive all read messages.
545
+ */
546
+ async archiveRead() {
547
+ const t = `
548
+ mutation TrackEvent {
549
+ archiveRead
550
+ }
551
+ `, e = {
552
+ "x-courier-user-id": this.options.userId,
553
+ Authorization: `Bearer ${this.options.accessToken}`
554
+ };
555
+ this.options.connectionId && (e["x-courier-client-source-id"] = this.options.connectionId), await Z({
556
+ options: this.options,
557
+ query: t,
558
+ headers: e,
559
+ url: this.options.apiUrls.inbox.graphql
560
+ });
561
+ }
562
+ }
563
+ class Xo {
564
+ /**
565
+ * Transforms a single API response item to the CourierUserPreferencesTopic type
566
+ * @param item - The API response item
567
+ * @returns A CourierUserPreferencesTopic object
568
+ */
569
+ transformItem(t) {
570
+ return {
571
+ topicId: t.topic_id,
572
+ topicName: t.topic_name,
573
+ sectionId: t.section_id,
574
+ sectionName: t.section_name,
575
+ status: t.status,
576
+ defaultStatus: t.default_status,
577
+ hasCustomRouting: t.has_custom_routing,
578
+ customRouting: t.custom_routing || []
579
+ };
580
+ }
581
+ /**
582
+ * Transforms an array of API response items to CourierUserPreferencesTopic objects
583
+ * @param items - The API response items
584
+ * @returns A generator of CourierUserPreferencesTopic objects
585
+ */
586
+ *transform(t) {
587
+ for (const e of t)
588
+ yield this.transformItem(e);
589
+ }
590
+ }
591
+ function Qo(h) {
592
+ const t = atob(h), e = new Uint8Array(t.length);
593
+ for (let i = 0; i < t.length; i++)
594
+ e[i] = t.charCodeAt(i);
595
+ return String.fromCharCode(...e);
596
+ }
597
+ function Yo(h) {
598
+ const t = new Uint8Array(h.length);
599
+ for (let e = 0; e < h.length; e++)
600
+ t[e] = h.charCodeAt(e);
601
+ return btoa(String.fromCharCode(...t));
602
+ }
603
+ class en extends re {
604
+ constructor() {
605
+ super(...arguments), T(this, "transformer", new Xo());
606
+ }
607
+ /**
608
+ * Get all preferences for a user
609
+ * @param paginationCursor - Optional cursor for pagination
610
+ * @returns Promise resolving to user preferences
611
+ * @see https://www.courier.com/docs/reference/user-preferences/list-all-user-preferences
612
+ */
613
+ async getUserPreferences(t) {
614
+ let e = `${this.options.apiUrls.courier.rest}/users/${this.options.userId}/preferences`;
615
+ t != null && t.paginationCursor && (e += `?cursor=${t.paginationCursor}`);
616
+ const s = await K({
617
+ options: this.options,
618
+ url: e,
619
+ method: "GET",
620
+ headers: {
621
+ Authorization: `Bearer ${this.options.accessToken}`
622
+ }
623
+ });
624
+ return {
625
+ items: [...this.transformer.transform(s.items)],
626
+ paging: s.paging
627
+ };
628
+ }
629
+ /**
630
+ * Get preferences for a specific topic
631
+ * @param topicId - The ID of the topic to get preferences for
632
+ * @returns Promise resolving to topic preferences
633
+ * @see https://www.courier.com/docs/reference/user-preferences/get-subscription-topic-preferences
634
+ */
635
+ async getUserPreferenceTopic(t) {
636
+ const i = await K({
637
+ options: this.options,
638
+ url: `${this.options.apiUrls.courier.rest}/users/${this.options.userId}/preferences/${t.topicId}`,
639
+ method: "GET",
640
+ headers: {
641
+ Authorization: `Bearer ${this.options.accessToken}`
642
+ }
643
+ });
644
+ return this.transformer.transformItem(i.topic);
645
+ }
646
+ /**
647
+ * Update preferences for a specific topic
648
+ * @param topicId - The ID of the topic to update preferences for
649
+ * @param status - The new status for the topic
650
+ * @param hasCustomRouting - Whether the topic has custom routing
651
+ * @param customRouting - The custom routing channels for the topic
652
+ * @returns Promise resolving when update is complete
653
+ * @see https://www.courier.com/docs/reference/user-preferences/update-subscription-topic-preferences
654
+ */
655
+ async putUserPreferenceTopic(t) {
656
+ const e = {
657
+ topic: {
658
+ status: t.status,
659
+ has_custom_routing: t.hasCustomRouting,
660
+ custom_routing: t.customRouting
661
+ }
662
+ };
663
+ await K({
664
+ options: this.options,
665
+ url: `${this.options.apiUrls.courier.rest}/users/${this.options.userId}/preferences/${t.topicId}`,
666
+ method: "PUT",
667
+ headers: {
668
+ Authorization: `Bearer ${this.options.accessToken}`
669
+ },
670
+ body: e
671
+ });
672
+ }
673
+ /**
674
+ * Get the notification center URL
675
+ * @param clientKey - The client key to use for the URL
676
+ * @returns The notification center URL
677
+ */
678
+ getNotificationCenterUrl(t) {
679
+ const e = Qo(t.clientKey);
680
+ return `https://view.notificationcenter.app/p/${Yo(`${e}#${this.options.userId}${this.options.tenantId ? `#${this.options.tenantId}` : ""}#false`)}`;
681
+ }
682
+ }
683
+ class tn extends re {
684
+ /**
685
+ * Store a push notification token for a user
686
+ * @param token - The push notification token
687
+ * @param provider - The provider of the token
688
+ * @param device - The device information
689
+ * @see https://www.courier.com/docs/reference/token-management/put-token
690
+ */
691
+ async putUserToken(t) {
692
+ const e = {
693
+ provider_key: t.provider,
694
+ ...t.device && {
695
+ device: {
696
+ app_id: t.device.appId,
697
+ ad_id: t.device.adId,
698
+ device_id: t.device.deviceId,
699
+ platform: t.device.platform,
700
+ manufacturer: t.device.manufacturer,
701
+ model: t.device.model
702
+ }
703
+ }
704
+ };
705
+ await K({
706
+ options: this.options,
707
+ url: `${this.options.apiUrls.courier.rest}/users/${this.options.userId}/tokens/${t.token}`,
708
+ method: "PUT",
709
+ headers: {
710
+ Authorization: `Bearer ${this.options.accessToken}`
711
+ },
712
+ body: e,
713
+ validCodes: [200, 204]
714
+ });
715
+ }
716
+ /**
717
+ * Delete a push notification token for a user
718
+ * @param token - The push notification token
719
+ * @returns Promise resolving when token is deleted
720
+ */
721
+ async deleteUserToken(t) {
722
+ await K({
723
+ options: this.options,
724
+ url: `${this.options.apiUrls.courier.rest}/users/${this.options.userId}/tokens/${t.token}`,
725
+ method: "DELETE",
726
+ headers: {
727
+ Authorization: `Bearer ${this.options.accessToken}`
728
+ },
729
+ validCodes: [200, 204]
730
+ });
731
+ }
732
+ }
733
+ class sn extends re {
734
+ /**
735
+ * Subscribe a user to a list
736
+ * @param listId - The ID of the list to subscribe to
737
+ * @returns Promise resolving when subscription is complete
738
+ * @see https://www.courier.com/docs/reference/lists/recipient-subscribe
739
+ */
740
+ async putSubscription(t) {
741
+ return await K({
742
+ url: `${this.options.apiUrls.courier.rest}/lists/${t.listId}/subscriptions/${this.options.userId}`,
743
+ options: this.options,
744
+ method: "PUT",
745
+ headers: {
746
+ Authorization: `Bearer ${this.options.accessToken}`
747
+ }
748
+ });
749
+ }
750
+ /**
751
+ * Unsubscribe a user from a list
752
+ * @param listId - The ID of the list to unsubscribe from
753
+ * @returns Promise resolving when unsubscription is complete
754
+ * @see https://www.courier.com/docs/reference/lists/delete-subscription
755
+ */
756
+ async deleteSubscription(t) {
757
+ return await K({
758
+ url: `${this.options.apiUrls.courier.rest}/lists/${t.listId}/subscriptions/${this.options.userId}`,
759
+ options: this.options,
760
+ method: "DELETE",
761
+ headers: {
762
+ Authorization: `Bearer ${this.options.accessToken}`
763
+ }
764
+ });
765
+ }
766
+ }
767
+ class on extends re {
768
+ /**
769
+ * Post an inbound courier event
770
+ * @param event - The event type: Example: "New Order Placed"
771
+ * @param messageId - The message ID
772
+ * @param type - The type of event: Available options: "track"
773
+ * @param properties - The properties of the event
774
+ * @returns Promise resolving to the message ID
775
+ * @see https://www.courier.com/docs/reference/inbound/courier-track-event
776
+ */
777
+ async postInboundCourier(t) {
778
+ return await K({
779
+ url: `${this.options.apiUrls.courier.rest}/inbound/courier`,
780
+ options: this.options,
781
+ method: "POST",
782
+ headers: {
783
+ Authorization: `Bearer ${this.options.accessToken}`
784
+ },
785
+ body: {
786
+ ...t,
787
+ userId: this.options.userId
788
+ },
789
+ validCodes: [200, 202]
790
+ });
791
+ }
792
+ /**
793
+ * Post a tracking URL event
794
+ * These urls are found in messages sent from Courier
795
+ * @param url - The URL to post the event to
796
+ * @param event - The event type: Available options: "click", "open", "unsubscribe"
797
+ * @returns Promise resolving when the event is posted
798
+ */
799
+ async postTrackingUrl(t) {
800
+ return await K({
801
+ url: t.url,
802
+ options: this.options,
803
+ method: "POST",
804
+ body: {
805
+ event: t.event
806
+ }
807
+ });
808
+ }
809
+ }
810
+ class nn extends re {
811
+ constructor(t) {
812
+ var e, i;
813
+ const s = t.showLogs !== void 0 ? t.showLogs : process.env.NODE_ENV === "development", o = {
814
+ ...t,
815
+ showLogs: s,
816
+ apiUrls: t.apiUrls || yo(),
817
+ accessToken: t.jwt ?? t.publicApiKey
818
+ };
819
+ super({
820
+ ...o,
821
+ logger: new Go(o.showLogs),
822
+ apiUrls: yo(o.apiUrls)
823
+ }), T(this, "tokens"), T(this, "brands"), T(this, "preferences"), T(this, "inbox"), T(this, "lists"), T(this, "tracking"), this.tokens = new tn(this.options), this.brands = new Wo(this.options), this.preferences = new en(this.options), this.inbox = new Ko(this.options), this.lists = new sn(this.options), this.tracking = new on(this.options), !this.options.jwt && !this.options.publicApiKey && this.options.logger.warn("Courier Client initialized with no authentication method. Please provide a JWT or public API key."), this.options.publicApiKey && ((e = this.options.logger) == null || e.warn(
824
+ `Courier Warning: Public API Keys are for testing only. Please use JWTs for production.
825
+ You can generate a JWT with this endpoint: https://www.courier.com/docs/reference/auth/issue-token
826
+ This endpoint should be called from your backend server, not the SDK.`
827
+ )), this.options.jwt && this.options.publicApiKey && ((i = this.options.logger) == null || i.warn(
828
+ "Courier Warning: Both a JWT and a Public API Key were provided. The Public API Key will be ignored."
829
+ ));
830
+ }
831
+ }
832
+ class rn {
833
+ constructor(t) {
834
+ T(this, "callback"), this.callback = t;
835
+ }
836
+ remove() {
837
+ v.shared.removeAuthenticationListener(this);
838
+ }
839
+ }
840
+ const Eo = class Me {
841
+ constructor() {
842
+ T(this, "id", Ae.generate()), T(this, "instanceClient"), T(this, "_paginationLimit", 24), T(this, "authenticationListeners", []);
843
+ }
844
+ get paginationLimit() {
845
+ return this._paginationLimit;
846
+ }
847
+ set paginationLimit(t) {
848
+ this._paginationLimit = Math.min(Math.max(t, 1), 100);
849
+ }
850
+ /**
851
+ * Get the Courier client instance
852
+ * @returns The Courier client instance or undefined if not signed in
853
+ */
854
+ get client() {
855
+ return this.instanceClient;
856
+ }
857
+ /**
858
+ * Get the shared Courier instance
859
+ * @returns The shared Courier instance
860
+ */
861
+ static get shared() {
862
+ return Me.instance || (Me.instance = new Me()), Me.instance;
863
+ }
864
+ /**
865
+ * Sign in to Courier
866
+ * @param options - The options for the Courier client
867
+ */
868
+ signIn(t) {
869
+ const e = t.connectionId ?? Ae.generate();
870
+ this.instanceClient = new nn({ ...t, connectionId: e }), this.notifyAuthenticationListeners({ userId: t.userId });
871
+ }
872
+ /**
873
+ * Sign out of Courier
874
+ */
875
+ signOut() {
876
+ this.instanceClient = void 0, this.notifyAuthenticationListeners({ userId: void 0 });
877
+ }
878
+ /**
879
+ * Register a callback to be notified of authentication state changes
880
+ * @param callback - Function to be called when authentication state changes
881
+ * @returns AuthenticationListener instance that can be used to remove the listener
882
+ */
883
+ addAuthenticationListener(t) {
884
+ var e;
885
+ (e = this.instanceClient) == null || e.options.logger.info("Adding authentication listener");
886
+ const i = new rn(t);
887
+ return this.authenticationListeners.push(i), i;
888
+ }
889
+ /**
890
+ * Unregister an authentication state change listener
891
+ * @param listener - The AuthenticationListener instance to remove
892
+ */
893
+ removeAuthenticationListener(t) {
894
+ var e;
895
+ (e = this.instanceClient) == null || e.options.logger.info("Removing authentication listener"), this.authenticationListeners = this.authenticationListeners.filter((i) => i !== t);
896
+ }
897
+ /**
898
+ * Notify all authentication listeners
899
+ * @param props - The props to notify the listeners with
900
+ */
901
+ notifyAuthenticationListeners(t) {
902
+ this.authenticationListeners.forEach((e) => e.callback(t));
903
+ }
904
+ };
905
+ T(Eo, "instance");
906
+ let v = Eo;
907
+ var an = Object.defineProperty, hn = (h, t, e) => t in h ? an(h, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : h[t] = e, $ = (h, t, e) => hn(h, typeof t != "symbol" ? t + "" : t, e);
6
908
  const r = {
7
909
  black: {
8
910
  500: "#171717",
@@ -24,7 +926,7 @@ const r = {
24
926
  400: "#60A5FA",
25
927
  500: "#2563EB"
26
928
  }
27
- }, G = {
929
+ }, W = {
28
930
  light: {
29
931
  colors: {
30
932
  primary: r.black[500],
@@ -49,21 +951,21 @@ const r = {
49
951
  cornerRadius: "4px"
50
952
  }
51
953
  }
52
- }, go = () => typeof window > "u" ? "light" : window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light", mo = (g) => {
954
+ }, Mo = () => typeof window > "u" ? "light" : window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light", To = (h) => {
53
955
  if (typeof window > "u")
54
956
  return () => {
55
957
  };
56
- const i = window.matchMedia("(prefers-color-scheme: dark)"), e = (t) => {
57
- g(t.matches ? "dark" : "light");
958
+ const t = window.matchMedia("(prefers-color-scheme: dark)"), e = (i) => {
959
+ h(i.matches ? "dark" : "light");
58
960
  };
59
- return i.addEventListener("change", e), () => {
60
- i.removeEventListener("change", e);
961
+ return t.addEventListener("change", e), () => {
962
+ t.removeEventListener("change", e);
61
963
  };
62
964
  };
63
- class bo extends HTMLElement {
965
+ class $o extends HTMLElement {
64
966
  constructor() {
65
- super(), L(this, "_currentSystemTheme"), L(this, "_systemThemeCleanup"), this._currentSystemTheme = go(), this._systemThemeCleanup = mo((i) => {
66
- this._currentSystemTheme = i, this.onSystemThemeChange(i);
967
+ super(), $(this, "_currentSystemTheme"), $(this, "_systemThemeCleanup"), this._currentSystemTheme = Mo(), this._systemThemeCleanup = To((t) => {
968
+ this._currentSystemTheme = t, this.onSystemThemeChange(t);
67
969
  });
68
970
  }
69
971
  get currentSystemTheme() {
@@ -72,47 +974,47 @@ class bo extends HTMLElement {
72
974
  disconnectedCallback() {
73
975
  this._systemThemeCleanup && this._systemThemeCleanup();
74
976
  }
75
- onSystemThemeChange(i) {
977
+ onSystemThemeChange(t) {
76
978
  }
77
979
  }
78
- const Te = {
980
+ const Fe = {
79
981
  borderRadius: "4px",
80
982
  fontSize: "14px"
81
- }, ee = {
82
- primary: (g) => ({
83
- ...Te,
84
- backgroundColor: G[g].colors.primary,
85
- textColor: G[g].colors.secondary,
983
+ }, se = {
984
+ primary: (h) => ({
985
+ ...Fe,
986
+ backgroundColor: W[h].colors.primary,
987
+ textColor: W[h].colors.secondary,
86
988
  fontWeight: "500",
87
989
  shadow: "none"
88
990
  }),
89
- secondary: (g) => ({
90
- ...Te,
91
- backgroundColor: G[g].colors.secondary,
92
- textColor: G[g].colors.primary,
991
+ secondary: (h) => ({
992
+ ...Fe,
993
+ backgroundColor: W[h].colors.secondary,
994
+ textColor: W[h].colors.primary,
93
995
  fontWeight: "500",
94
- border: `1px solid ${G[g].colors.border}`,
95
- shadow: g === "light" ? "0px 1px 2px 0px rgba(0, 0, 0, 0.06)" : "0px 1px 2px 0px rgba(255, 255, 255, 0.1)"
996
+ border: `1px solid ${W[h].colors.border}`,
997
+ shadow: h === "light" ? "0px 1px 2px 0px rgba(0, 0, 0, 0.06)" : "0px 1px 2px 0px rgba(255, 255, 255, 0.1)"
96
998
  }),
97
- tertiary: (g) => ({
98
- ...Te,
99
- backgroundColor: G[g].colors.border,
100
- textColor: G[g].colors.primary,
999
+ tertiary: (h) => ({
1000
+ ...Fe,
1001
+ backgroundColor: W[h].colors.border,
1002
+ textColor: W[h].colors.primary,
101
1003
  fontWeight: "500",
102
1004
  border: "none",
103
1005
  shadow: "none"
104
1006
  })
105
1007
  };
106
- class Ie extends bo {
107
- constructor(i) {
108
- super(), L(this, "_button"), L(this, "_style");
1008
+ class Re extends $o {
1009
+ constructor(t) {
1010
+ super(), $(this, "_button"), $(this, "_style");
109
1011
  const e = this.attachShadow({ mode: "open" });
110
- this._button = document.createElement("button"), this._button.setAttribute("part", "button"), this._style = document.createElement("style"), this._style.textContent = this.getStyles(i), e.appendChild(this._style), e.appendChild(this._button), this.updateButton(i), this._button.addEventListener("click", (t) => {
111
- t.preventDefault(), t.stopPropagation(), i.onClick && i.onClick();
1012
+ this._button = document.createElement("button"), this._button.setAttribute("part", "button"), this._style = document.createElement("style"), this._style.textContent = this.getStyles(t), e.appendChild(this._style), e.appendChild(this._button), this.updateButton(t), this._button.addEventListener("click", (i) => {
1013
+ i.preventDefault(), i.stopPropagation(), t.onClick && t.onClick();
112
1014
  });
113
1015
  }
114
- getStyles(i) {
115
- const e = () => ee.secondary(this.currentSystemTheme).textColor, t = () => ee.secondary(this.currentSystemTheme).backgroundColor, s = () => ee.secondary(this.currentSystemTheme).border, o = () => ee.secondary(this.currentSystemTheme).shadow, n = () => ee.secondary(this.currentSystemTheme).borderRadius, h = () => ee.secondary(this.currentSystemTheme).fontSize, d = () => ee.secondary(this.currentSystemTheme).fontWeight;
1016
+ getStyles(t) {
1017
+ const e = () => se.secondary(this.currentSystemTheme).textColor, i = () => se.secondary(this.currentSystemTheme).backgroundColor, s = () => se.secondary(this.currentSystemTheme).border, o = () => se.secondary(this.currentSystemTheme).shadow, n = () => se.secondary(this.currentSystemTheme).borderRadius, c = () => se.secondary(this.currentSystemTheme).fontSize, d = () => se.secondary(this.currentSystemTheme).fontWeight;
116
1018
  return `
117
1019
  :host {
118
1020
  display: inline-block;
@@ -120,27 +1022,27 @@ class Ie extends bo {
120
1022
 
121
1023
  button {
122
1024
  border: none;
123
- border-radius: ${i.borderRadius ?? n()};
124
- font-weight: ${i.fontWeight ?? d()};
125
- font-family: ${i.fontFamily ?? "inherit"};
126
- font-size: ${i.fontSize ?? h()};
1025
+ border-radius: ${t.borderRadius ?? n()};
1026
+ font-weight: ${t.fontWeight ?? d()};
1027
+ font-family: ${t.fontFamily ?? "inherit"};
1028
+ font-size: ${t.fontSize ?? c()};
127
1029
  padding: 6px 10px;
128
1030
  cursor: pointer;
129
1031
  width: 100%;
130
1032
  height: 100%;
131
- background-color: ${i.backgroundColor ?? t()};
132
- color: ${i.textColor ?? e()};
133
- border: ${i.border ?? s()};
134
- box-shadow: ${i.shadow ?? o()};
1033
+ background-color: ${t.backgroundColor ?? i()};
1034
+ color: ${t.textColor ?? e()};
1035
+ border: ${t.border ?? s()};
1036
+ box-shadow: ${t.shadow ?? o()};
135
1037
  touch-action: manipulation;
136
1038
  }
137
1039
 
138
1040
  button:hover {
139
- ${i.hoverBackgroundColor ? `background-color: ${i.hoverBackgroundColor};` : "filter: brightness(0.9);"}
1041
+ ${t.hoverBackgroundColor ? `background-color: ${t.hoverBackgroundColor};` : "filter: brightness(0.9);"}
140
1042
  }
141
1043
 
142
1044
  button:active {
143
- ${i.activeBackgroundColor ? `background-color: ${i.activeBackgroundColor};` : "filter: brightness(0.8);"}
1045
+ ${t.activeBackgroundColor ? `background-color: ${t.activeBackgroundColor};` : "filter: brightness(0.8);"}
144
1046
  }
145
1047
 
146
1048
  button:disabled {
@@ -149,12 +1051,12 @@ class Ie extends bo {
149
1051
  }
150
1052
  `;
151
1053
  }
152
- updateButton(i) {
153
- i.text && (this._button.textContent = i.text), this._style.textContent = this.getStyles(i);
1054
+ updateButton(t) {
1055
+ t.text && (this._button.textContent = t.text), this._style.textContent = this.getStyles(t);
154
1056
  }
155
1057
  }
156
- customElements.get("courier-button") || customElements.define("courier-button", Ie);
157
- const f = {
1058
+ customElements.get("courier-button") || customElements.define("courier-button", Re);
1059
+ const x = {
158
1060
  inbox: `<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
159
1061
  <path d="M5.5 14.5V17C5.5 17.2812 5.71875 17.5 6 17.5H18C18.25 17.5 18.5 17.2812 18.5 17V14.5H15.9375L15.2812 15.8125C15.0938 16.25 14.6562 16.5 14.1875 16.5H9.78125C9.3125 16.5 8.875 16.25 8.6875 15.8125L8.03125 14.5H5.5ZM18.1875 13L16.6562 6.90625C16.5938 6.65625 16.4062 6.5 16.1875 6.5H7.8125C7.5625 6.5 7.375 6.65625 7.3125 6.90625L5.78125 13H8.1875C8.65625 13 9.09375 13.2812 9.3125 13.7188L9.9375 15H14.0312L14.6875 13.7188C14.875 13.2812 15.3125 13 15.7812 13H18.1875ZM4 14.25C4 14.0938 4 13.9375 4.03125 13.7812L5.84375 6.53125C6.09375 5.625 6.875 5 7.8125 5H16.1875C17.0938 5 17.9062 5.625 18.125 6.53125L19.9375 13.7812C19.9688 13.9375 20 14.0938 20 14.25V17C20 18.125 19.0938 19 18 19H6C4.875 19 4 18.125 4 17V14.25Z" fill="currentColor"/>
160
1062
  </svg>`,
@@ -183,13 +1085,13 @@ const f = {
183
1085
  <path d="M5.5 11C5.0625 11 4.75 10.6875 4.75 10.25V5.75C4.75 5.34375 5.0625 5 5.5 5C5.90625 5 6.25 5.34375 6.25 5.75V8.28125L6.875 7.53125C8.15625 6 10.0625 5 12.25 5C16.0938 5 19.25 8.15625 19.25 12C19.25 15.875 16.0938 19 12.25 19C10.6562 19 9.21875 18.5 8.03125 17.625C7.71875 17.375 7.625 16.9062 7.875 16.5625C8.125 16.2188 8.59375 16.1562 8.9375 16.4062C9.84375 17.0938 11 17.5 12.25 17.5C15.2812 17.5 17.75 15.0625 17.75 12C17.75 8.96875 15.2812 6.5 12.25 6.5C10.5312 6.5 9.03125 7.28125 8 8.5L7.15625 9.5H10C10.4062 9.5 10.75 9.84375 10.75 10.25C10.75 10.6875 10.4062 11 10 11H5.5Z" fill="currentColor"/>
184
1086
  </svg>`
185
1087
  };
186
- class ie extends HTMLElement {
187
- constructor(i, e) {
188
- super(), L(this, "_color"), L(this, "_svg"), L(this, "_iconContainer"), L(this, "_style"), this._color = i ?? r.black[500], this._svg = e;
189
- const t = this.attachShadow({ mode: "open" });
190
- this._iconContainer = document.createElement("div"), t.appendChild(this._iconContainer), this._style = document.createElement("style"), this._style.textContent = this.getStyles(this._color), t.appendChild(this._style), this.refresh();
1088
+ class ne extends HTMLElement {
1089
+ constructor(t, e) {
1090
+ super(), $(this, "_color"), $(this, "_svg"), $(this, "_iconContainer"), $(this, "_style"), this._color = t ?? r.black[500], this._svg = e;
1091
+ const i = this.attachShadow({ mode: "open" });
1092
+ this._iconContainer = document.createElement("div"), i.appendChild(this._iconContainer), this._style = document.createElement("style"), this._style.textContent = this.getStyles(this._color), i.appendChild(this._style), this.refresh();
191
1093
  }
192
- getStyles(i) {
1094
+ getStyles(t) {
193
1095
  return `
194
1096
  :host {
195
1097
  display: inline-block;
@@ -202,25 +1104,25 @@ class ie extends HTMLElement {
202
1104
  svg {
203
1105
  width: 24px;
204
1106
  height: 24px;
205
- color: ${i};
1107
+ color: ${t};
206
1108
  }
207
1109
  `;
208
1110
  }
209
1111
  refresh() {
210
1112
  this._svg && (this._iconContainer.innerHTML = this._svg), this._color && (this._style.textContent = this.getStyles(this._color));
211
1113
  }
212
- updateColor(i) {
213
- this._color = i, this.refresh();
1114
+ updateColor(t) {
1115
+ this._color = t, this.refresh();
214
1116
  }
215
- updateSVG(i) {
216
- this._svg = i, this.refresh();
1117
+ updateSVG(t) {
1118
+ this._svg = t, this.refresh();
217
1119
  }
218
1120
  }
219
- customElements.get("courier-icon") || customElements.define("courier-icon", ie);
220
- class Pe extends HTMLElement {
1121
+ customElements.get("courier-icon") || customElements.define("courier-icon", ne);
1122
+ class Ue extends HTMLElement {
221
1123
  constructor() {
222
- super(), L(this, "link");
223
- const i = this.attachShadow({ mode: "open" });
1124
+ super(), $(this, "link");
1125
+ const t = this.attachShadow({ mode: "open" });
224
1126
  this.link = document.createElement("a"), this.link.setAttribute("part", "link");
225
1127
  const e = document.createElement("style");
226
1128
  e.textContent = `
@@ -240,7 +1142,7 @@ class Pe extends HTMLElement {
240
1142
 
241
1143
  /* Variants */
242
1144
  a[data-variant="primary"][data-mode="light"] {
243
- color: var(--courier-link-color, ${G.light.colors.link});
1145
+ color: var(--courier-link-color, ${W.light.colors.link});
244
1146
  }
245
1147
 
246
1148
  a[data-variant="primary"][data-mode="light"]:hover {
@@ -252,7 +1154,7 @@ class Pe extends HTMLElement {
252
1154
  }
253
1155
 
254
1156
  a[data-variant="primary"][data-mode="dark"] {
255
- color: var(--courier-link-color, ${G.dark.colors.link});
1157
+ color: var(--courier-link-color, ${W.dark.colors.link});
256
1158
  }
257
1159
 
258
1160
  a[data-variant="primary"][data-mode="dark"]:hover {
@@ -272,15 +1174,15 @@ class Pe extends HTMLElement {
272
1174
  cursor: not-allowed;
273
1175
  pointer-events: none;
274
1176
  }
275
- `, i.appendChild(e), i.appendChild(this.link), this.updateVariant(), this.updateUnderline(), this.updateMode();
1177
+ `, t.appendChild(e), t.appendChild(this.link), this.updateVariant(), this.updateUnderline(), this.updateMode();
276
1178
  }
277
1179
  connectedCallback() {
278
- const i = document.createElement("slot");
279
- this.link.appendChild(i), this.updateHref();
1180
+ const t = document.createElement("slot");
1181
+ this.link.appendChild(t), this.updateHref();
280
1182
  }
281
- attributeChangedCallback(i, e, t) {
282
- if (e !== t)
283
- switch (i) {
1183
+ attributeChangedCallback(t, e, i) {
1184
+ if (e !== i)
1185
+ switch (t) {
284
1186
  case "href":
285
1187
  this.updateHref();
286
1188
  break;
@@ -309,39 +1211,39 @@ class Pe extends HTMLElement {
309
1211
  }
310
1212
  }
311
1213
  updateHref() {
312
- const i = this.getAttribute("href");
313
- i && (this.link.href = i);
1214
+ const t = this.getAttribute("href");
1215
+ t && (this.link.href = t);
314
1216
  }
315
1217
  updateVariant() {
316
- const i = this.getAttribute("variant") || "primary", e = this.getAttribute("mode") || "light";
317
- this.link.setAttribute("data-variant", i), this.link.setAttribute("data-mode", e);
1218
+ const t = this.getAttribute("variant") || "primary", e = this.getAttribute("mode") || "light";
1219
+ this.link.setAttribute("data-variant", t), this.link.setAttribute("data-mode", e);
318
1220
  }
319
1221
  updateColor() {
320
- const i = this.getAttribute("color");
321
- i ? this.link.style.setProperty("--courier-link-color", i) : this.link.style.removeProperty("--courier-link-color");
1222
+ const t = this.getAttribute("color");
1223
+ t ? this.link.style.setProperty("--courier-link-color", t) : this.link.style.removeProperty("--courier-link-color");
322
1224
  }
323
1225
  updateUnderline() {
324
- const i = this.getAttribute("underline") === "true";
325
- this.link.setAttribute("data-underline", i.toString());
1226
+ const t = this.getAttribute("underline") === "true";
1227
+ this.link.setAttribute("data-underline", t.toString());
326
1228
  }
327
1229
  updateMode() {
328
- const i = this.getAttribute("mode") || "light";
329
- this.link.setAttribute("data-mode", i);
1230
+ const t = this.getAttribute("mode") || "light";
1231
+ this.link.setAttribute("data-mode", t);
330
1232
  }
331
1233
  updateTarget() {
332
- const i = this.getAttribute("target");
333
- i && (this.link.target = i);
1234
+ const t = this.getAttribute("target");
1235
+ t && (this.link.target = t);
334
1236
  }
335
1237
  updateFontFamily() {
336
- const i = this.getAttribute("font-family");
337
- i ? this.link.style.setProperty("--courier-link-font-family", i) : this.link.style.removeProperty("--courier-link-font-family");
1238
+ const t = this.getAttribute("font-family");
1239
+ t ? this.link.style.setProperty("--courier-link-font-family", t) : this.link.style.removeProperty("--courier-link-font-family");
338
1240
  }
339
1241
  updateFontSize() {
340
- const i = this.getAttribute("font-size");
341
- i ? this.link.style.setProperty("--courier-link-font-size", i) : this.link.style.removeProperty("--courier-link-font-size");
1242
+ const t = this.getAttribute("font-size");
1243
+ t ? this.link.style.setProperty("--courier-link-font-size", t) : this.link.style.removeProperty("--courier-link-font-size");
342
1244
  }
343
1245
  }
344
- L(Pe, "observedAttributes", [
1246
+ $(Ue, "observedAttributes", [
345
1247
  "href",
346
1248
  "variant",
347
1249
  "disabled",
@@ -352,46 +1254,46 @@ L(Pe, "observedAttributes", [
352
1254
  "font-family",
353
1255
  "font-size"
354
1256
  ]);
355
- customElements.get("courier-link") || customElements.define("courier-link", Pe);
356
- class Le extends bo {
1257
+ customElements.get("courier-link") || customElements.define("courier-link", Ue);
1258
+ class De extends $o {
357
1259
  constructor() {
358
- super(), L(this, "shadow"), this.shadow = this.attachShadow({ mode: "open" });
1260
+ super(), $(this, "shadow"), this.shadow = this.attachShadow({ mode: "open" });
359
1261
  }
360
1262
  // Build the element with a factory function
361
- build(i) {
362
- if (i === null) {
1263
+ build(t) {
1264
+ if (t === null) {
363
1265
  this.shadow.replaceChildren();
364
1266
  return;
365
1267
  }
366
- const e = i ?? this.defaultElement();
1268
+ const e = t ?? this.defaultElement();
367
1269
  this.shadow.replaceChildren(e);
368
1270
  }
369
1271
  // Default element to be used if no factory is provided
370
1272
  defaultElement() {
371
- const i = document.createElement("div");
372
- return i.textContent = "Default Element Factory", i.style.cssText = `
1273
+ const t = document.createElement("div");
1274
+ return t.textContent = "Default Element Factory", t.style.cssText = `
373
1275
  background-color: red;
374
1276
  text-align: center;
375
1277
  padding: 12px;
376
- `, i;
1278
+ `, t;
377
1279
  }
378
1280
  }
379
- class Me extends Le {
380
- constructor(i) {
381
- super(), L(this, "_props"), L(this, "_title"), L(this, "_button"), L(this, "_style"), L(this, "_buttonClickCallback", null), this._props = i;
1281
+ class Be extends De {
1282
+ constructor(t) {
1283
+ super(), $(this, "_props"), $(this, "_title"), $(this, "_button"), $(this, "_style"), $(this, "_buttonClickCallback", null), this._props = t;
382
1284
  }
383
1285
  defaultElement() {
384
- var i, e;
385
- const t = document.createElement("div");
386
- return this._title = document.createElement("h2"), (i = this._props.title) != null && i.text && (this._title.textContent = this._props.title.text), this._button = new Ie(this._props.button ?? ee.secondary(this.currentSystemTheme)), this._style = document.createElement("style"), this._style.textContent = this.getStyles(this._props), t.className = "container", t.appendChild(this._style), t.appendChild(this._title), t.appendChild(this._button), this.shadow.appendChild(t), (e = this._button) == null || e.addEventListener("click", () => {
1286
+ var t, e;
1287
+ const i = document.createElement("div");
1288
+ return this._title = document.createElement("h2"), (t = this._props.title) != null && t.text && (this._title.textContent = this._props.title.text), this._button = new Re(this._props.button ?? se.secondary(this.currentSystemTheme)), this._style = document.createElement("style"), this._style.textContent = this.getStyles(this._props), i.className = "container", i.appendChild(this._style), i.appendChild(this._title), i.appendChild(this._button), this.shadow.appendChild(i), (e = this._button) == null || e.addEventListener("click", () => {
387
1289
  this._buttonClickCallback && this._buttonClickCallback();
388
- }), t;
1290
+ }), i;
389
1291
  }
390
- onSystemThemeChange(i) {
1292
+ onSystemThemeChange(t) {
391
1293
  this.updateStyles(this._props);
392
1294
  }
393
- getStyles(i) {
394
- var e, t, s, o;
1295
+ getStyles(t) {
1296
+ var e, i, s, o;
395
1297
  return `
396
1298
  :host {
397
1299
  display: flex;
@@ -413,26 +1315,26 @@ class Me extends Le {
413
1315
 
414
1316
  .container h2 {
415
1317
  margin: 0;
416
- color: ${((e = i.title) == null ? void 0 : e.textColor) ?? "red"};
417
- font-size: ${((t = i.title) == null ? void 0 : t.fontSize) ?? "16px"};
418
- font-weight: ${((s = i.title) == null ? void 0 : s.fontWeight) ?? "500"};
419
- font-family: ${((o = i.title) == null ? void 0 : o.fontFamily) ?? "inherit"};
1318
+ color: ${((e = t.title) == null ? void 0 : e.textColor) ?? "red"};
1319
+ font-size: ${((i = t.title) == null ? void 0 : i.fontSize) ?? "16px"};
1320
+ font-weight: ${((s = t.title) == null ? void 0 : s.fontWeight) ?? "500"};
1321
+ font-family: ${((o = t.title) == null ? void 0 : o.fontFamily) ?? "inherit"};
420
1322
  }
421
1323
  `;
422
1324
  }
423
- updateStyles(i) {
424
- this._props = i, this._style && (this._style.textContent = this.getStyles(i)), this._button && this._button.updateButton(i.button);
1325
+ updateStyles(t) {
1326
+ this._props = t, this._style && (this._style.textContent = this.getStyles(t)), this._button && this._button.updateButton(t.button);
425
1327
  }
426
- setButtonClickCallback(i) {
427
- this._buttonClickCallback = i;
1328
+ setButtonClickCallback(t) {
1329
+ this._buttonClickCallback = t;
428
1330
  }
429
1331
  }
430
- customElements.get("courier-info-state") || customElements.define("courier-info-state", Me);
431
- class Se extends HTMLElement {
432
- constructor(i, e, t, s, o, n, h, d) {
433
- super(), L(this, "_backgroundColor"), L(this, "_hoverBackgroundColor"), L(this, "_activeBackgroundColor"), L(this, "_borderRadius"), L(this, "_height"), L(this, "_width"), L(this, "_style"), L(this, "_button"), L(this, "_icon"), this._borderRadius = n, this._backgroundColor = t, this._hoverBackgroundColor = s, this._activeBackgroundColor = o, this._height = h, this._width = d;
434
- const c = this.attachShadow({ mode: "open" });
435
- this._button = document.createElement("button"), this._button.setAttribute("part", "button"), this._icon = new ie(e, i), this._style = document.createElement("style"), this.refresh(), c.appendChild(this._style), this._button.appendChild(this._icon), c.appendChild(this._button);
1332
+ customElements.get("courier-info-state") || customElements.define("courier-info-state", Be);
1333
+ class $e extends HTMLElement {
1334
+ constructor(t, e, i, s, o, n, c, d) {
1335
+ super(), $(this, "_backgroundColor"), $(this, "_hoverBackgroundColor"), $(this, "_activeBackgroundColor"), $(this, "_borderRadius"), $(this, "_height"), $(this, "_width"), $(this, "_style"), $(this, "_button"), $(this, "_icon"), this._borderRadius = n, this._backgroundColor = i, this._hoverBackgroundColor = s, this._activeBackgroundColor = o, this._height = c, this._width = d;
1336
+ const l = this.attachShadow({ mode: "open" });
1337
+ this._button = document.createElement("button"), this._button.setAttribute("part", "button"), this._icon = new ne(e, t), this._style = document.createElement("style"), this.refresh(), l.appendChild(this._style), this._button.appendChild(this._icon), l.appendChild(this._button);
436
1338
  }
437
1339
  refresh() {
438
1340
  this._style.textContent = this.getStyles();
@@ -480,34 +1382,34 @@ class Se extends HTMLElement {
480
1382
  }
481
1383
  `;
482
1384
  }
483
- updateIconColor(i) {
484
- this._icon.updateColor(i);
1385
+ updateIconColor(t) {
1386
+ this._icon.updateColor(t);
485
1387
  }
486
- updateIconSVG(i) {
487
- this._icon.updateSVG(i);
1388
+ updateIconSVG(t) {
1389
+ this._icon.updateSVG(t);
488
1390
  }
489
- updateBackgroundColor(i) {
490
- this._backgroundColor = i, this.refresh();
1391
+ updateBackgroundColor(t) {
1392
+ this._backgroundColor = t, this.refresh();
491
1393
  }
492
- updateHoverBackgroundColor(i) {
493
- this._hoverBackgroundColor = i, this.refresh();
1394
+ updateHoverBackgroundColor(t) {
1395
+ this._hoverBackgroundColor = t, this.refresh();
494
1396
  }
495
- updateActiveBackgroundColor(i) {
496
- this._activeBackgroundColor = i, this.refresh();
1397
+ updateActiveBackgroundColor(t) {
1398
+ this._activeBackgroundColor = t, this.refresh();
497
1399
  }
498
1400
  }
499
- customElements.get("courier-icon-button") || customElements.define("courier-icon-button", Se);
500
- const Po = [
501
- { name: "courier-button", class: Ie },
502
- { name: "courier-icon", class: ie },
503
- { name: "courier-link", class: Pe },
504
- { name: "courier-info-state", class: Me },
505
- { name: "courier-icon-button", class: Se }
1401
+ customElements.get("courier-icon-button") || customElements.define("courier-icon-button", $e);
1402
+ const cn = [
1403
+ { name: "courier-button", class: Re },
1404
+ { name: "courier-icon", class: ne },
1405
+ { name: "courier-link", class: Ue },
1406
+ { name: "courier-info-state", class: Be },
1407
+ { name: "courier-icon-button", class: $e }
506
1408
  ];
507
- Po.forEach(({ name: g, class: i }) => {
508
- customElements.get(g) || customElements.define(g, i);
1409
+ cn.forEach(({ name: h, class: t }) => {
1410
+ customElements.get(h) || customElements.define(h, t);
509
1411
  });
510
- const te = class te {
1412
+ const oe = class oe {
511
1413
  constructor() {
512
1414
  a(this, "_inboxDataSet");
513
1415
  a(this, "_archiveDataSet");
@@ -517,7 +1419,7 @@ const te = class te {
517
1419
  a(this, "isPaginatingArchive", !1);
518
1420
  }
519
1421
  static get shared() {
520
- return te.instance || (te.instance = new te()), te.instance;
1422
+ return oe.instance || (oe.instance = new oe()), oe.instance;
521
1423
  }
522
1424
  get unreadCount() {
523
1425
  return this._unreadCount ?? 0;
@@ -528,16 +1430,16 @@ const te = class te {
528
1430
  get archiveDataSet() {
529
1431
  return this._archiveDataSet ?? { messages: [], canPaginate: !1, paginationCursor: null };
530
1432
  }
531
- addDataStoreListener(i) {
532
- this._dataStoreListeners.push(i);
1433
+ addDataStoreListener(t) {
1434
+ this._dataStoreListeners.push(t);
533
1435
  }
534
- removeDataStoreListener(i) {
535
- this._dataStoreListeners = this._dataStoreListeners.filter((e) => e !== i);
1436
+ removeDataStoreListener(t) {
1437
+ this._dataStoreListeners = this._dataStoreListeners.filter((e) => e !== t);
536
1438
  }
537
- async fetchDataSet(i) {
538
- var t, s, o, n, h, d, c, u, m, p;
539
- if (i.canUseCache)
540
- switch (i.feedType) {
1439
+ async fetchDataSet(t) {
1440
+ var i, s, o, n, c, d, l, p, m, g;
1441
+ if (t.canUseCache)
1442
+ switch (t.feedType) {
541
1443
  case "inbox":
542
1444
  if (this._inboxDataSet)
543
1445
  return this._inboxDataSet;
@@ -547,23 +1449,23 @@ const te = class te {
547
1449
  return this._archiveDataSet;
548
1450
  break;
549
1451
  }
550
- const e = i.feedType === "inbox" ? await ((t = C.shared.client) == null ? void 0 : t.inbox.getMessages()) : await ((s = C.shared.client) == null ? void 0 : s.inbox.getArchivedMessages());
1452
+ const e = t.feedType === "inbox" ? await ((i = v.shared.client) == null ? void 0 : i.inbox.getMessages()) : await ((s = v.shared.client) == null ? void 0 : s.inbox.getArchivedMessages());
551
1453
  return {
552
1454
  messages: ((n = (o = e == null ? void 0 : e.data) == null ? void 0 : o.messages) == null ? void 0 : n.nodes) ?? [],
553
- canPaginate: ((c = (d = (h = e == null ? void 0 : e.data) == null ? void 0 : h.messages) == null ? void 0 : d.pageInfo) == null ? void 0 : c.hasNextPage) ?? !1,
554
- paginationCursor: ((p = (m = (u = e == null ? void 0 : e.data) == null ? void 0 : u.messages) == null ? void 0 : m.pageInfo) == null ? void 0 : p.startCursor) ?? null
1455
+ canPaginate: ((l = (d = (c = e == null ? void 0 : e.data) == null ? void 0 : c.messages) == null ? void 0 : d.pageInfo) == null ? void 0 : l.hasNextPage) ?? !1,
1456
+ paginationCursor: ((g = (m = (p = e == null ? void 0 : e.data) == null ? void 0 : p.messages) == null ? void 0 : m.pageInfo) == null ? void 0 : g.startCursor) ?? null
555
1457
  };
556
1458
  }
557
- async fetchUnreadCount(i) {
558
- var t;
559
- return i.canUseCache && this._unreadCount !== void 0 ? this._unreadCount : await ((t = C.shared.client) == null ? void 0 : t.inbox.getUnreadMessageCount()) ?? 0;
1459
+ async fetchUnreadCount(t) {
1460
+ var i;
1461
+ return t.canUseCache && this._unreadCount !== void 0 ? this._unreadCount : await ((i = v.shared.client) == null ? void 0 : i.inbox.getUnreadMessageCount()) ?? 0;
560
1462
  }
561
- async load(i) {
562
- var e, t, s;
1463
+ async load(t) {
1464
+ var e, i, s;
563
1465
  try {
564
- if (!((e = C.shared.client) != null && e.options.userId))
1466
+ if (!((e = v.shared.client) != null && e.options.userId))
565
1467
  throw new Error("User is not signed in");
566
- const o = i ?? { feedType: "inbox", canUseCache: !0 }, [n, h] = await Promise.all([
1468
+ const o = t ?? { feedType: "inbox", canUseCache: !0 }, [n, c] = await Promise.all([
567
1469
  this.fetchDataSet(o),
568
1470
  this.fetchUnreadCount(o)
569
1471
  ]);
@@ -575,85 +1477,88 @@ const te = class te {
575
1477
  this._archiveDataSet = n;
576
1478
  break;
577
1479
  }
578
- this._unreadCount = h, this._dataStoreListeners.forEach((d) => {
579
- var c, u, m, p;
580
- (u = (c = d.events).onDataSetChange) == null || u.call(c, n, o.feedType), (p = (m = d.events).onUnreadCountChange) == null || p.call(m, this._unreadCount ?? 0);
1480
+ this._unreadCount = c, this._dataStoreListeners.forEach((d) => {
1481
+ var l, p, m, g;
1482
+ (p = (l = d.events).onDataSetChange) == null || p.call(l, n, o.feedType), (g = (m = d.events).onUnreadCountChange) == null || g.call(m, this._unreadCount ?? 0);
581
1483
  }), await this.connectSocket();
582
1484
  } catch (o) {
583
- (s = (t = C.shared.client) == null ? void 0 : t.options.logger) == null || s.error("Error loading inbox:", o), this._dataStoreListeners.forEach((n) => {
584
- var h, d;
585
- (d = (h = n.events).onError) == null || d.call(h, o);
1485
+ (s = (i = v.shared.client) == null ? void 0 : i.options.logger) == null || s.error("Error loading inbox:", o), this._dataStoreListeners.forEach((n) => {
1486
+ var c, d;
1487
+ (d = (c = n.events).onError) == null || d.call(c, o);
586
1488
  });
587
1489
  }
588
1490
  }
589
1491
  async connectSocket() {
590
- var e, t, s, o, n, h, d, c, u, m, p, x;
591
- const i = (e = C.shared.client) == null ? void 0 : e.inbox.socket;
1492
+ var e, i, s, o, n, c, d, l, p, m, g, f;
1493
+ const t = (e = v.shared.client) == null ? void 0 : e.inbox.socket;
592
1494
  try {
593
- if (!i) {
594
- (s = (t = C.shared.client) == null ? void 0 : t.options.logger) == null || s.info("CourierInbox socket not available");
1495
+ if (!t) {
1496
+ (s = (i = v.shared.client) == null ? void 0 : i.options.logger) == null || s.info("CourierInbox socket not available");
595
1497
  return;
596
1498
  }
597
- if ((h = (o = C.shared.client) == null ? void 0 : o.options.logger) == null || h.info("CourierInbox socket connectionId:", (n = C.shared.client) == null ? void 0 : n.options.connectionId), i.isConnected) {
598
- (c = (d = C.shared.client) == null ? void 0 : d.options.logger) == null || c.info("CourierInbox socket already connected. Socket will not attempt reconnection.");
1499
+ if ((c = (o = v.shared.client) == null ? void 0 : o.options.logger) == null || c.info("CourierInbox socket connectionId:", (n = v.shared.client) == null ? void 0 : n.options.connectionId), t.isConnected) {
1500
+ (l = (d = v.shared.client) == null ? void 0 : d.options.logger) == null || l.info("CourierInbox socket already connected. Socket will not attempt reconnection.");
599
1501
  return;
600
1502
  }
601
- i.receivedMessage = (_) => {
1503
+ t.receivedMessage = (_) => {
602
1504
  this.addMessage(_, 0, "inbox");
603
- }, i.receivedMessageEvent = (_) => {
1505
+ }, t.receivedMessageEvent = (_) => {
604
1506
  let b;
605
1507
  switch (_.messageId && (b = this.getMessage({ messageId: _.messageId })), _.event) {
606
1508
  case "mark-all-read":
607
- this.readAllMessages();
1509
+ this.readAllMessages({ canCallApi: !1 });
608
1510
  break;
609
1511
  case "read":
610
- b && this.readMessage(b, !1);
1512
+ b && this.readMessage({ message: b, canCallApi: !1 });
611
1513
  break;
612
1514
  case "unread":
613
- b && this.unreadMessage(b, !1);
1515
+ b && this.unreadMessage({ message: b, canCallApi: !1 });
614
1516
  break;
615
1517
  case "opened":
616
- b && this.openMessage(b, !1);
1518
+ b && this.openMessage({ message: b, canCallApi: !1 });
617
1519
  break;
618
1520
  case "archive":
619
- b && this.archiveMessage(b, !1);
1521
+ b && this.archiveMessage({ message: b, canCallApi: !1 });
1522
+ break;
1523
+ case "archive-read":
1524
+ this.archiveReadMessages({ canCallApi: !1 });
620
1525
  break;
621
1526
  case "click":
622
- b && this.clickMessage(b, !1);
1527
+ b && this.clickMessage({ message: b, canCallApi: !1 });
623
1528
  break;
624
1529
  case "unopened":
625
1530
  case "unarchive":
626
1531
  break;
627
1532
  }
628
- }, await i.connect(), await i.sendSubscribe(), i.keepAlive(), (m = (u = C.shared.client) == null ? void 0 : u.options.logger) == null || m.info("CourierInbox socket connected");
1533
+ }, await t.connect(), await t.sendSubscribe(), t.keepAlive(), (m = (p = v.shared.client) == null ? void 0 : p.options.logger) == null || m.info("CourierInbox socket connected");
629
1534
  } catch (_) {
630
- (x = (p = C.shared.client) == null ? void 0 : p.options.logger) == null || x.error("Failed to connect socket:", _);
1535
+ (f = (g = v.shared.client) == null ? void 0 : g.options.logger) == null || f.error("Failed to connect socket:", _);
631
1536
  }
632
1537
  }
633
- getMessage(i) {
634
- var e, t;
635
- return ((e = this._inboxDataSet) == null ? void 0 : e.messages.find((s) => s.messageId === i.messageId)) ?? ((t = this._archiveDataSet) == null ? void 0 : t.messages.find((s) => s.messageId === i.messageId));
1538
+ getMessage(t) {
1539
+ var e, i;
1540
+ return ((e = this._inboxDataSet) == null ? void 0 : e.messages.find((s) => s.messageId === t.messageId)) ?? ((i = this._archiveDataSet) == null ? void 0 : i.messages.find((s) => s.messageId === t.messageId));
636
1541
  }
637
- async fetchNextPageOfMessages(i) {
638
- var e, t, s, o, n, h, d, c, u, m, p, x, _, b, v, k, w, S, E, M, I, T, $, D;
639
- switch (i.feedType) {
1542
+ async fetchNextPageOfMessages(t) {
1543
+ var e, i, s, o, n, c, d, l, p, m, g, f, _, b, C, k, w, S, I, E, M, L, R, D;
1544
+ switch (t.feedType) {
640
1545
  case "inbox":
641
1546
  if (this.isPaginatingInbox)
642
1547
  return null;
643
1548
  if ((e = this._inboxDataSet) != null && e.canPaginate && this._inboxDataSet.paginationCursor)
644
1549
  try {
645
1550
  this.isPaginatingInbox = !0;
646
- const y = await ((t = C.shared.client) == null ? void 0 : t.inbox.getMessages({
647
- paginationLimit: C.shared.paginationLimit,
1551
+ const y = await ((i = v.shared.client) == null ? void 0 : i.inbox.getMessages({
1552
+ paginationLimit: v.shared.paginationLimit,
648
1553
  startCursor: this._inboxDataSet.paginationCursor
649
- })), B = {
1554
+ })), A = {
650
1555
  messages: ((o = (s = y == null ? void 0 : y.data) == null ? void 0 : s.messages) == null ? void 0 : o.nodes) ?? [],
651
- canPaginate: ((d = (h = (n = y == null ? void 0 : y.data) == null ? void 0 : n.messages) == null ? void 0 : h.pageInfo) == null ? void 0 : d.hasNextPage) ?? !1,
652
- paginationCursor: ((m = (u = (c = y == null ? void 0 : y.data) == null ? void 0 : c.messages) == null ? void 0 : u.pageInfo) == null ? void 0 : m.startCursor) ?? null
1556
+ canPaginate: ((d = (c = (n = y == null ? void 0 : y.data) == null ? void 0 : n.messages) == null ? void 0 : c.pageInfo) == null ? void 0 : d.hasNextPage) ?? !1,
1557
+ paginationCursor: ((m = (p = (l = y == null ? void 0 : y.data) == null ? void 0 : l.messages) == null ? void 0 : p.pageInfo) == null ? void 0 : m.startCursor) ?? null
653
1558
  };
654
- return this.addPage(B, "inbox"), B;
1559
+ return this.addPage(A, "inbox"), A;
655
1560
  } catch (y) {
656
- return (x = (p = C.shared.client) == null ? void 0 : p.options.logger) == null || x.error("Error fetching next page of inbox messages:", y), null;
1561
+ return (f = (g = v.shared.client) == null ? void 0 : g.options.logger) == null || f.error("Error fetching next page of inbox messages:", y), null;
657
1562
  } finally {
658
1563
  this.isPaginatingInbox = !1;
659
1564
  }
@@ -664,17 +1569,17 @@ const te = class te {
664
1569
  if ((_ = this._archiveDataSet) != null && _.canPaginate && this._archiveDataSet.paginationCursor)
665
1570
  try {
666
1571
  this.isPaginatingArchive = !0;
667
- const y = await ((b = C.shared.client) == null ? void 0 : b.inbox.getArchivedMessages({
668
- paginationLimit: C.shared.paginationLimit,
1572
+ const y = await ((b = v.shared.client) == null ? void 0 : b.inbox.getArchivedMessages({
1573
+ paginationLimit: v.shared.paginationLimit,
669
1574
  startCursor: this._archiveDataSet.paginationCursor
670
- })), B = {
671
- messages: ((k = (v = y == null ? void 0 : y.data) == null ? void 0 : v.messages) == null ? void 0 : k.nodes) ?? [],
672
- canPaginate: ((E = (S = (w = y == null ? void 0 : y.data) == null ? void 0 : w.messages) == null ? void 0 : S.pageInfo) == null ? void 0 : E.hasNextPage) ?? !1,
673
- paginationCursor: ((T = (I = (M = y == null ? void 0 : y.data) == null ? void 0 : M.messages) == null ? void 0 : I.pageInfo) == null ? void 0 : T.startCursor) ?? null
1575
+ })), A = {
1576
+ messages: ((k = (C = y == null ? void 0 : y.data) == null ? void 0 : C.messages) == null ? void 0 : k.nodes) ?? [],
1577
+ canPaginate: ((I = (S = (w = y == null ? void 0 : y.data) == null ? void 0 : w.messages) == null ? void 0 : S.pageInfo) == null ? void 0 : I.hasNextPage) ?? !1,
1578
+ paginationCursor: ((L = (M = (E = y == null ? void 0 : y.data) == null ? void 0 : E.messages) == null ? void 0 : M.pageInfo) == null ? void 0 : L.startCursor) ?? null
674
1579
  };
675
- return this.addPage(B, "archive"), B;
1580
+ return this.addPage(A, "archive"), A;
676
1581
  } catch (y) {
677
- return (D = ($ = C.shared.client) == null ? void 0 : $.options.logger) == null || D.error("Error fetching next page of archived messages:", y), null;
1582
+ return (D = (R = v.shared.client) == null ? void 0 : R.options.logger) == null || D.error("Error fetching next page of archived messages:", y), null;
678
1583
  } finally {
679
1584
  this.isPaginatingArchive = !1;
680
1585
  }
@@ -682,201 +1587,227 @@ const te = class te {
682
1587
  }
683
1588
  return null;
684
1589
  }
685
- applyLocalMessageChange(i, e) {
686
- for (const [t, s] of Object.entries(e))
687
- s !== void 0 && this.updateMessage(i, s, t);
1590
+ applyLocalMessageChange(t, e) {
1591
+ for (const [i, s] of Object.entries(e))
1592
+ s !== void 0 && this.updateMessage(t, s, i);
688
1593
  }
689
- async readMessage(i, e = !0) {
690
- var o, n, h, d;
691
- if (!C.shared.client)
1594
+ async readMessage({ message: t, canCallApi: e = !0 }) {
1595
+ var o, n, c, d;
1596
+ if (!v.shared.client)
692
1597
  return;
693
- const t = i;
694
- if (t.read)
1598
+ const i = t;
1599
+ if (i.read)
695
1600
  return;
696
1601
  const s = {
697
- inbox: (o = this._inboxDataSet) == null ? void 0 : o.messages.findIndex((c) => c.messageId === i.messageId),
698
- archive: (n = this._archiveDataSet) == null ? void 0 : n.messages.findIndex((c) => c.messageId === i.messageId)
1602
+ inbox: (o = this._inboxDataSet) == null ? void 0 : o.messages.findIndex((l) => l.messageId === t.messageId),
1603
+ archive: (n = this._archiveDataSet) == null ? void 0 : n.messages.findIndex((l) => l.messageId === t.messageId)
699
1604
  };
700
1605
  try {
701
- i.read = (/* @__PURE__ */ new Date()).toISOString(), this.applyLocalMessageChange(i, s), e && await C.shared.client.inbox.read({ messageId: i.messageId });
702
- } catch (c) {
703
- this.applyLocalMessageChange(t, s), (d = (h = C.shared.client) == null ? void 0 : h.options.logger) == null || d.error("Error reading message:", c);
1606
+ t.read = (/* @__PURE__ */ new Date()).toISOString(), this.applyLocalMessageChange(t, s), e && await v.shared.client.inbox.read({ messageId: t.messageId });
1607
+ } catch (l) {
1608
+ this.applyLocalMessageChange(i, s), (d = (c = v.shared.client) == null ? void 0 : c.options.logger) == null || d.error("Error reading message:", l);
704
1609
  }
705
1610
  }
706
- async unreadMessage(i, e = !0) {
707
- var o, n, h, d;
708
- if (!C.shared.client)
1611
+ async unreadMessage({ message: t, canCallApi: e = !0 }) {
1612
+ var o, n, c, d;
1613
+ if (!v.shared.client)
709
1614
  return;
710
- const t = i;
711
- if (!t.read)
1615
+ const i = t;
1616
+ if (!i.read)
712
1617
  return;
713
1618
  const s = {
714
- inbox: (o = this._inboxDataSet) == null ? void 0 : o.messages.findIndex((c) => c.messageId === i.messageId),
715
- archive: (n = this._archiveDataSet) == null ? void 0 : n.messages.findIndex((c) => c.messageId === i.messageId)
1619
+ inbox: (o = this._inboxDataSet) == null ? void 0 : o.messages.findIndex((l) => l.messageId === t.messageId),
1620
+ archive: (n = this._archiveDataSet) == null ? void 0 : n.messages.findIndex((l) => l.messageId === t.messageId)
716
1621
  };
717
1622
  try {
718
- i.read = void 0, this.applyLocalMessageChange(i, s), e && await C.shared.client.inbox.unread({ messageId: i.messageId });
719
- } catch (c) {
720
- this.applyLocalMessageChange(t, s), (d = (h = C.shared.client) == null ? void 0 : h.options.logger) == null || d.error("Error unreading message:", c);
1623
+ t.read = void 0, this.applyLocalMessageChange(t, s), e && await v.shared.client.inbox.unread({ messageId: t.messageId });
1624
+ } catch (l) {
1625
+ this.applyLocalMessageChange(i, s), (d = (c = v.shared.client) == null ? void 0 : c.options.logger) == null || d.error("Error unreading message:", l);
721
1626
  }
722
1627
  }
723
- async openMessage(i, e = !0) {
724
- var o, n, h, d;
725
- if (!C.shared.client)
1628
+ async openMessage({ message: t, canCallApi: e = !0 }) {
1629
+ var o, n, c, d;
1630
+ if (!v.shared.client)
726
1631
  return;
727
- const t = i, s = {
728
- inbox: (o = this._inboxDataSet) == null ? void 0 : o.messages.findIndex((c) => c.messageId === i.messageId),
729
- archive: (n = this._archiveDataSet) == null ? void 0 : n.messages.findIndex((c) => c.messageId === i.messageId)
1632
+ const i = t, s = {
1633
+ inbox: (o = this._inboxDataSet) == null ? void 0 : o.messages.findIndex((l) => l.messageId === t.messageId),
1634
+ archive: (n = this._archiveDataSet) == null ? void 0 : n.messages.findIndex((l) => l.messageId === t.messageId)
730
1635
  };
731
- if (!(!s.inbox && !s.archive) && !t.opened)
1636
+ if (!(!s.inbox && !s.archive) && !i.opened)
732
1637
  try {
733
- i.opened = (/* @__PURE__ */ new Date()).toISOString(), this.applyLocalMessageChange(i, s), e && await C.shared.client.inbox.open({ messageId: i.messageId });
734
- } catch (c) {
735
- this.applyLocalMessageChange(t, s), (d = (h = C.shared.client) == null ? void 0 : h.options.logger) == null || d.error("Error opening message:", c);
1638
+ t.opened = (/* @__PURE__ */ new Date()).toISOString(), this.applyLocalMessageChange(t, s), e && await v.shared.client.inbox.open({ messageId: t.messageId });
1639
+ } catch (l) {
1640
+ this.applyLocalMessageChange(i, s), (d = (c = v.shared.client) == null ? void 0 : c.options.logger) == null || d.error("Error opening message:", l);
736
1641
  }
737
1642
  }
738
- async clickMessage(i, e = !0) {
739
- var t, s, o, n;
740
- if (C.shared.client)
1643
+ async clickMessage({ message: t, canCallApi: e = !0 }) {
1644
+ var i, s, o, n;
1645
+ if (v.shared.client)
741
1646
  try {
742
- (t = i.trackingIds) != null && t.clickTrackingId && e && await C.shared.client.inbox.click({
743
- messageId: i.messageId,
744
- trackingId: (s = i.trackingIds) == null ? void 0 : s.clickTrackingId
1647
+ (i = t.trackingIds) != null && i.clickTrackingId && e && await v.shared.client.inbox.click({
1648
+ messageId: t.messageId,
1649
+ trackingId: (s = t.trackingIds) == null ? void 0 : s.clickTrackingId
745
1650
  });
746
- } catch (h) {
747
- (n = (o = C.shared.client) == null ? void 0 : o.options.logger) == null || n.error("Error clicking message:", h);
1651
+ } catch (c) {
1652
+ (n = (o = v.shared.client) == null ? void 0 : o.options.logger) == null || n.error("Error clicking message:", c);
748
1653
  }
749
1654
  }
750
- async archiveMessage(i, e = !0) {
1655
+ async archiveMessage({ message: t, canCallApi: e = !0 }) {
751
1656
  var o, n;
752
- if (!C.shared.client)
1657
+ if (!v.shared.client)
753
1658
  return;
754
- const t = i, s = (o = this._inboxDataSet) == null ? void 0 : o.messages.findIndex((h) => h.messageId === i.messageId);
1659
+ const i = t, s = (o = this._inboxDataSet) == null ? void 0 : o.messages.findIndex((c) => c.messageId === t.messageId);
755
1660
  if (s !== void 0)
756
1661
  try {
757
- if (this.removeMessage(i, s, "inbox"), (n = this._archiveDataSet) != null && n.messages) {
758
- const h = this.findInsertIndex(i, this._archiveDataSet.messages);
759
- i.archived = (/* @__PURE__ */ new Date()).toISOString(), this.addMessage(i, h, "archive");
1662
+ if (this.removeMessage(t, s, "inbox"), (n = this._archiveDataSet) != null && n.messages) {
1663
+ const c = this.findInsertIndex(t, this._archiveDataSet.messages);
1664
+ t.archived = (/* @__PURE__ */ new Date()).toISOString(), this.addMessage(t, c, "archive");
760
1665
  }
761
- e && await C.shared.client.inbox.archive({ messageId: i.messageId });
1666
+ e && await v.shared.client.inbox.archive({ messageId: t.messageId });
762
1667
  } catch {
763
- this.addMessage(t, s, "inbox"), i.archived = void 0, this.removeMessage(i, s, "archive");
1668
+ this.addMessage(i, s, "inbox"), t.archived = void 0, this.removeMessage(t, s, "archive");
764
1669
  }
765
1670
  }
766
- async readAllMessages(i = !0) {
767
- var o, n, h, d;
768
- if (!C.shared.client)
1671
+ async archiveReadMessages({ canCallApi: t = !0 } = {}) {
1672
+ var s;
1673
+ if (!v.shared.client)
1674
+ return;
1675
+ const e = this._inboxDataSet, i = this._archiveDataSet;
1676
+ try {
1677
+ (s = this._inboxDataSet) == null || s.messages.forEach((o) => {
1678
+ var c, d;
1679
+ if (!o.read)
1680
+ return;
1681
+ const n = (c = this._inboxDataSet) == null ? void 0 : c.messages.findIndex((l) => l.messageId === o.messageId);
1682
+ if (n !== void 0 && (this.removeMessage(o, n, "inbox"), (d = this._archiveDataSet) != null && d.messages)) {
1683
+ const l = this.findInsertIndex(o, this._archiveDataSet.messages);
1684
+ o.archived = (/* @__PURE__ */ new Date()).toISOString(), this.addMessage(o, l, "archive");
1685
+ }
1686
+ }), this._dataStoreListeners.forEach((o) => {
1687
+ var n, c, d, l;
1688
+ this._inboxDataSet && ((c = (n = o.events).onDataSetChange) == null || c.call(n, this._inboxDataSet, "inbox")), this._archiveDataSet && ((l = (d = o.events).onDataSetChange) == null || l.call(d, this._archiveDataSet, "archive"));
1689
+ }), t && await v.shared.client.inbox.archiveRead();
1690
+ } catch (o) {
1691
+ console.error("Error archiving read messages:", o), this._inboxDataSet && e && (this._inboxDataSet.messages = e.messages), this._archiveDataSet && i && (this._archiveDataSet.messages = i.messages), this._dataStoreListeners.forEach((n) => {
1692
+ var c, d, l, p;
1693
+ this._inboxDataSet && ((d = (c = n.events).onDataSetChange) == null || d.call(c, this._inboxDataSet, "inbox")), this._archiveDataSet && ((p = (l = n.events).onDataSetChange) == null || p.call(l, this._archiveDataSet, "archive"));
1694
+ });
1695
+ }
1696
+ }
1697
+ async readAllMessages({ canCallApi: t = !0 } = {}) {
1698
+ var o, n, c, d;
1699
+ if (!v.shared.client)
769
1700
  return;
770
- const e = this._inboxDataSet, t = this._archiveDataSet, s = this._unreadCount;
1701
+ const e = this._inboxDataSet, i = this._archiveDataSet, s = this._unreadCount;
771
1702
  try {
772
- (o = this._inboxDataSet) == null || o.messages.forEach((c) => {
773
- c.read || (c.read = (/* @__PURE__ */ new Date()).toISOString());
774
- }), (n = this._archiveDataSet) == null || n.messages.forEach((c) => {
775
- c.read || (c.read = (/* @__PURE__ */ new Date()).toISOString());
776
- }), this._unreadCount = 0, this._dataStoreListeners.forEach((c) => {
777
- var u, m, p, x, _, b;
778
- this._inboxDataSet && ((m = (u = c.events).onDataSetChange) == null || m.call(u, this._inboxDataSet, "inbox")), this._archiveDataSet && ((x = (p = c.events).onDataSetChange) == null || x.call(p, this._archiveDataSet, "archive")), (b = (_ = c.events).onUnreadCountChange) == null || b.call(_, this._unreadCount);
779
- }), i && await C.shared.client.inbox.readAll();
780
- } catch (c) {
781
- (d = (h = C.shared.client) == null ? void 0 : h.options.logger) == null || d.error("Error reading all messages:", c), this._inboxDataSet && e && (this._inboxDataSet.messages = e.messages), this._archiveDataSet && t && (this._archiveDataSet.messages = t.messages), this._unreadCount = s, this._dataStoreListeners.forEach((u) => {
782
- var m, p, x, _, b, v;
783
- this._inboxDataSet && ((p = (m = u.events).onDataSetChange) == null || p.call(m, this._inboxDataSet, "inbox")), this._archiveDataSet && ((_ = (x = u.events).onDataSetChange) == null || _.call(x, this._archiveDataSet, "archive")), (v = (b = u.events).onUnreadCountChange) == null || v.call(b, this._unreadCount);
1703
+ (o = this._inboxDataSet) == null || o.messages.forEach((l) => {
1704
+ l.read || (l.read = (/* @__PURE__ */ new Date()).toISOString());
1705
+ }), (n = this._archiveDataSet) == null || n.messages.forEach((l) => {
1706
+ l.read || (l.read = (/* @__PURE__ */ new Date()).toISOString());
1707
+ }), this._unreadCount = 0, this._dataStoreListeners.forEach((l) => {
1708
+ var p, m, g, f, _, b;
1709
+ this._inboxDataSet && ((m = (p = l.events).onDataSetChange) == null || m.call(p, this._inboxDataSet, "inbox")), this._archiveDataSet && ((f = (g = l.events).onDataSetChange) == null || f.call(g, this._archiveDataSet, "archive")), (b = (_ = l.events).onUnreadCountChange) == null || b.call(_, this._unreadCount);
1710
+ }), t && await v.shared.client.inbox.readAll();
1711
+ } catch (l) {
1712
+ (d = (c = v.shared.client) == null ? void 0 : c.options.logger) == null || d.error("Error reading all messages:", l), this._inboxDataSet && e && (this._inboxDataSet.messages = e.messages), this._archiveDataSet && i && (this._archiveDataSet.messages = i.messages), this._unreadCount = s, this._dataStoreListeners.forEach((p) => {
1713
+ var m, g, f, _, b, C;
1714
+ this._inboxDataSet && ((g = (m = p.events).onDataSetChange) == null || g.call(m, this._inboxDataSet, "inbox")), this._archiveDataSet && ((_ = (f = p.events).onDataSetChange) == null || _.call(f, this._archiveDataSet, "archive")), (C = (b = p.events).onUnreadCountChange) == null || C.call(b, this._unreadCount);
784
1715
  });
785
1716
  }
786
1717
  }
787
- findInsertIndex(i, e) {
788
- const t = [...e];
789
- t.push(i), t.sort((o, n) => {
790
- const h = new Date(o.created ?? Date.now()).getTime();
791
- return new Date(n.created ?? Date.now()).getTime() - h;
1718
+ findInsertIndex(t, e) {
1719
+ const i = [...e];
1720
+ i.push(t), i.sort((o, n) => {
1721
+ const c = new Date(o.created ?? Date.now()).getTime();
1722
+ return new Date(n.created ?? Date.now()).getTime() - c;
792
1723
  });
793
- const s = t.findIndex((o) => o.messageId === i.messageId);
1724
+ const s = i.findIndex((o) => o.messageId === t.messageId);
794
1725
  return Math.max(s - 1, 0);
795
1726
  }
796
- addPage(i, e) {
1727
+ addPage(t, e) {
797
1728
  switch (e) {
798
1729
  case "inbox":
799
- this._inboxDataSet && (this._inboxDataSet.canPaginate = i.canPaginate, this._inboxDataSet.paginationCursor = i.paginationCursor, this._inboxDataSet.messages = [...this._inboxDataSet.messages, ...i.messages]);
1730
+ this._inboxDataSet && (this._inboxDataSet.canPaginate = t.canPaginate, this._inboxDataSet.paginationCursor = t.paginationCursor, this._inboxDataSet.messages = [...this._inboxDataSet.messages, ...t.messages]);
800
1731
  break;
801
1732
  case "archive":
802
- this._archiveDataSet && (this._archiveDataSet.canPaginate = i.canPaginate, this._archiveDataSet.paginationCursor = i.paginationCursor, this._archiveDataSet.messages = [...this._archiveDataSet.messages, ...i.messages]);
1733
+ this._archiveDataSet && (this._archiveDataSet.canPaginate = t.canPaginate, this._archiveDataSet.paginationCursor = t.paginationCursor, this._archiveDataSet.messages = [...this._archiveDataSet.messages, ...t.messages]);
803
1734
  break;
804
1735
  }
805
1736
  this._dataStoreListeners.forEach(
806
- (t) => {
1737
+ (i) => {
807
1738
  var s, o;
808
- return (o = (s = t.events).onPageAdded) == null ? void 0 : o.call(s, i, e);
1739
+ return (o = (s = i.events).onPageAdded) == null ? void 0 : o.call(s, t, e);
809
1740
  }
810
1741
  );
811
1742
  }
812
- addMessage(i, e, t) {
1743
+ addMessage(t, e, i) {
813
1744
  var s, o;
814
- switch (t) {
1745
+ switch (i) {
815
1746
  case "inbox":
816
- !i.read && this._unreadCount !== void 0 && (this._unreadCount = this._unreadCount + 1), (s = this._inboxDataSet) == null || s.messages.splice(e, 0, i);
1747
+ !t.read && this._unreadCount !== void 0 && (this._unreadCount = this._unreadCount + 1), (s = this._inboxDataSet) == null || s.messages.splice(e, 0, t);
817
1748
  break;
818
1749
  case "archive":
819
- (o = this._archiveDataSet) == null || o.messages.splice(e, 0, i);
1750
+ (o = this._archiveDataSet) == null || o.messages.splice(e, 0, t);
820
1751
  break;
821
1752
  }
822
1753
  this._dataStoreListeners.forEach((n) => {
823
- var h, d, c, u;
824
- (d = (h = n.events).onMessageAdd) == null || d.call(h, i, e, t), (u = (c = n.events).onUnreadCountChange) == null || u.call(c, this._unreadCount ?? 0);
1754
+ var c, d, l, p;
1755
+ (d = (c = n.events).onMessageAdd) == null || d.call(c, t, e, i), (p = (l = n.events).onUnreadCountChange) == null || p.call(l, this._unreadCount ?? 0);
825
1756
  });
826
1757
  }
827
- removeMessage(i, e, t) {
1758
+ removeMessage(t, e, i) {
828
1759
  var s, o;
829
- switch (t) {
1760
+ switch (i) {
830
1761
  case "inbox":
831
- !i.read && this._unreadCount !== void 0 && (this._unreadCount = this._unreadCount - 1), (s = this._inboxDataSet) == null || s.messages.splice(e, 1);
1762
+ !t.read && this._unreadCount !== void 0 && (this._unreadCount = this._unreadCount - 1), (s = this._inboxDataSet) == null || s.messages.splice(e, 1);
832
1763
  break;
833
1764
  case "archive":
834
1765
  (o = this._archiveDataSet) == null || o.messages.splice(e, 1);
835
1766
  break;
836
1767
  }
837
1768
  this._dataStoreListeners.forEach((n) => {
838
- var h, d, c, u;
839
- (d = (h = n.events).onMessageRemove) == null || d.call(h, i, e, t), (u = (c = n.events).onUnreadCountChange) == null || u.call(c, this._unreadCount ?? 0);
1769
+ var c, d, l, p;
1770
+ (d = (c = n.events).onMessageRemove) == null || d.call(c, t, e, i), (p = (l = n.events).onUnreadCountChange) == null || p.call(l, this._unreadCount ?? 0);
840
1771
  });
841
1772
  }
842
- updateMessage(i, e, t) {
843
- switch (t) {
1773
+ updateMessage(t, e, i) {
1774
+ switch (i) {
844
1775
  case "inbox":
845
- this._unreadCount !== void 0 && !i.archived && (i.read && (this._unreadCount = Math.max(0, this._unreadCount - 1)), i.read || (this._unreadCount = this._unreadCount + 1)), this._inboxDataSet && (this._inboxDataSet.messages[e] = i);
1776
+ this._unreadCount !== void 0 && !t.archived && (t.read && (this._unreadCount = Math.max(0, this._unreadCount - 1)), t.read || (this._unreadCount = this._unreadCount + 1)), this._inboxDataSet && (this._inboxDataSet.messages[e] = t);
846
1777
  break;
847
1778
  case "archive":
848
- this._archiveDataSet && (this._archiveDataSet.messages[e] = i);
1779
+ this._archiveDataSet && (this._archiveDataSet.messages[e] = t);
849
1780
  break;
850
1781
  }
851
1782
  this._dataStoreListeners.forEach((s) => {
852
- var o, n, h, d;
853
- (n = (o = s.events).onMessageUpdate) == null || n.call(o, i, e, t), (d = (h = s.events).onUnreadCountChange) == null || d.call(h, this._unreadCount ?? 0);
1783
+ var o, n, c, d;
1784
+ (n = (o = s.events).onMessageUpdate) == null || n.call(o, t, e, i), (d = (c = s.events).onUnreadCountChange) == null || d.call(c, this._unreadCount ?? 0);
854
1785
  });
855
1786
  }
856
1787
  };
857
- a(te, "instance");
858
- let A = te;
859
- function zo(g) {
860
- return A.shared.readMessage(g);
1788
+ a(oe, "instance");
1789
+ let P = oe;
1790
+ function gn(h) {
1791
+ return P.shared.readMessage({ message: h });
861
1792
  }
862
- function Oo(g) {
863
- return A.shared.unreadMessage(g);
1793
+ function mn(h) {
1794
+ return P.shared.unreadMessage({ message: h });
864
1795
  }
865
- function No(g) {
866
- return A.shared.clickMessage(g);
1796
+ function bn(h) {
1797
+ return P.shared.clickMessage({ message: h });
867
1798
  }
868
- function Uo(g) {
869
- return A.shared.archiveMessage(g);
1799
+ function _n(h) {
1800
+ return P.shared.archiveMessage({ message: h });
870
1801
  }
871
- function Vo(g) {
872
- return A.shared.openMessage(g);
1802
+ function fn(h) {
1803
+ return P.shared.openMessage({ message: h });
873
1804
  }
874
- function $o(g) {
875
- if (!g.created) return "Now";
876
- const i = /* @__PURE__ */ new Date(), e = new Date(g.created), t = Math.floor((i.getTime() - e.getTime()) / 1e3);
877
- return t < 60 ? `${t}s` : t < 3600 ? `${Math.floor(t / 60)}m` : t < 86400 ? `${Math.floor(t / 3600)}h` : t < 604800 ? `${Math.floor(t / 86400)}d` : t < 31536e3 ? `${Math.floor(t / 604800)}w` : `${Math.floor(t / 31536e3)}y`;
1805
+ function ln(h) {
1806
+ if (!h.created) return "Now";
1807
+ const t = /* @__PURE__ */ new Date(), e = new Date(h.created), i = Math.floor((t.getTime() - e.getTime()) / 1e3);
1808
+ return i < 60 ? `${i}s` : i < 3600 ? `${Math.floor(i / 60)}m` : i < 86400 ? `${Math.floor(i / 3600)}h` : i < 604800 ? `${Math.floor(i / 86400)}d` : i < 31536e3 ? `${Math.floor(i / 604800)}w` : `${Math.floor(i / 31536e3)}y`;
878
1809
  }
879
- class _o extends HTMLElement {
1810
+ class Lo extends HTMLElement {
880
1811
  constructor(e) {
881
1812
  super();
882
1813
  // State
@@ -885,14 +1816,14 @@ class _o extends HTMLElement {
885
1816
  // Components
886
1817
  a(this, "_style");
887
1818
  this._theme = e;
888
- const t = this.attachShadow({ mode: "open" });
889
- this._style = document.createElement("style"), this._style.textContent = this.getStyles(), t.appendChild(this._style);
1819
+ const i = this.attachShadow({ mode: "open" });
1820
+ this._style = document.createElement("style"), this._style.textContent = this.getStyles(), i.appendChild(this._style);
890
1821
  const s = document.createElement("ul");
891
- s.className = "menu", t.appendChild(s);
1822
+ s.className = "menu", i.appendChild(s);
892
1823
  }
893
1824
  getStyles() {
894
- var t, s, o;
895
- const e = (o = (s = (t = this._theme.inbox) == null ? void 0 : t.list) == null ? void 0 : s.item) == null ? void 0 : o.menu;
1825
+ var i, s, o;
1826
+ const e = (o = (s = (i = this._theme.inbox) == null ? void 0 : i.list) == null ? void 0 : s.item) == null ? void 0 : o.menu;
896
1827
  return `
897
1828
  :host {
898
1829
  display: block;
@@ -935,19 +1866,19 @@ class _o extends HTMLElement {
935
1866
  this._options = e, this.renderMenu();
936
1867
  }
937
1868
  renderMenu() {
938
- var o, n, h, d;
1869
+ var o, n, c, d;
939
1870
  const e = (o = this.shadowRoot) == null ? void 0 : o.querySelector("ul.menu");
940
1871
  if (!e) return;
941
1872
  e.innerHTML = "";
942
- const t = (d = (h = (n = this._theme.inbox) == null ? void 0 : n.list) == null ? void 0 : h.item) == null ? void 0 : d.menu, s = (c) => {
943
- c.stopPropagation(), c.preventDefault();
1873
+ const i = (d = (c = (n = this._theme.inbox) == null ? void 0 : n.list) == null ? void 0 : c.item) == null ? void 0 : d.menu, s = (l) => {
1874
+ l.stopPropagation(), l.preventDefault();
944
1875
  };
945
- this._options.forEach((c) => {
946
- var p, x, _;
947
- const u = new Se(c.icon.svg, c.icon.color, t == null ? void 0 : t.backgroundColor, (p = t == null ? void 0 : t.item) == null ? void 0 : p.hoverBackgroundColor, (x = t == null ? void 0 : t.item) == null ? void 0 : x.activeBackgroundColor, (_ = t == null ? void 0 : t.item) == null ? void 0 : _.borderRadius), m = (b) => {
948
- s(b), c.onClick();
1876
+ this._options.forEach((l) => {
1877
+ var g, f, _;
1878
+ const p = new $e(l.icon.svg, l.icon.color, i == null ? void 0 : i.backgroundColor, (g = i == null ? void 0 : i.item) == null ? void 0 : g.hoverBackgroundColor, (f = i == null ? void 0 : i.item) == null ? void 0 : f.activeBackgroundColor, (_ = i == null ? void 0 : i.item) == null ? void 0 : _.borderRadius), m = (b) => {
1879
+ s(b), l.onClick();
949
1880
  };
950
- u.addEventListener("click", m), u.addEventListener("touchstart", s), u.addEventListener("touchend", m), u.addEventListener("touchmove", s), u.addEventListener("mousedown", s), u.addEventListener("mouseup", s), e.appendChild(u);
1881
+ p.addEventListener("click", m), p.addEventListener("touchstart", s), p.addEventListener("touchend", m), p.addEventListener("touchmove", s), p.addEventListener("mousedown", s), p.addEventListener("mouseup", s), e.appendChild(p);
951
1882
  });
952
1883
  }
953
1884
  show() {
@@ -957,8 +1888,8 @@ class _o extends HTMLElement {
957
1888
  this.classList.remove("visible");
958
1889
  }
959
1890
  }
960
- customElements.get("courier-list-item-menu") || customElements.define("courier-list-item-menu", _o);
961
- class xo extends HTMLElement {
1891
+ customElements.get("courier-list-item-menu") || customElements.define("courier-list-item-menu", Lo);
1892
+ class Ao extends HTMLElement {
962
1893
  constructor(e) {
963
1894
  super();
964
1895
  // State
@@ -982,13 +1913,13 @@ class xo extends HTMLElement {
982
1913
  a(this, "onItemLongPress", null);
983
1914
  a(this, "onItemActionClick", null);
984
1915
  this._theme = e, this._isMobile = "ontouchstart" in window;
985
- const t = this.attachShadow({ mode: "open" }), s = document.createElement("div");
986
- s.className = "content-container", this._titleElement = document.createElement("p"), this._titleElement.setAttribute("part", "title"), this._subtitleElement = document.createElement("p"), this._subtitleElement.setAttribute("part", "subtitle"), this._actionsContainer = document.createElement("div"), this._actionsContainer.className = "actions-container", s.appendChild(this._titleElement), s.appendChild(this._subtitleElement), s.appendChild(this._actionsContainer), this._timeElement = document.createElement("p"), this._timeElement.setAttribute("part", "time"), this._unreadIndicator = document.createElement("div"), this._unreadIndicator.className = "unread-indicator", this._style = document.createElement("style"), this._refreshStyles(), this._menu = new _o(this._theme), this._menu.setOptions(this._getMenuOptions()), t.append(this._style, this._unreadIndicator, s, this._timeElement, this._menu);
1916
+ const i = this.attachShadow({ mode: "open" }), s = document.createElement("div");
1917
+ s.className = "content-container", this._titleElement = document.createElement("p"), this._titleElement.setAttribute("part", "title"), this._subtitleElement = document.createElement("p"), this._subtitleElement.setAttribute("part", "subtitle"), this._actionsContainer = document.createElement("div"), this._actionsContainer.className = "actions-container", s.appendChild(this._titleElement), s.appendChild(this._subtitleElement), s.appendChild(this._actionsContainer), this._timeElement = document.createElement("p"), this._timeElement.setAttribute("part", "time"), this._unreadIndicator = document.createElement("div"), this._unreadIndicator.className = "unread-indicator", this._style = document.createElement("style"), this._refreshStyles(), this._menu = new Lo(this._theme), this._menu.setOptions(this._getMenuOptions()), i.append(this._style, this._unreadIndicator, s, this._timeElement, this._menu);
987
1918
  const o = (n) => {
988
1919
  n.stopPropagation(), n.preventDefault();
989
1920
  };
990
1921
  this._menu.addEventListener("mousedown", o), this._menu.addEventListener("pointerdown", o), this._menu.addEventListener("click", o), this.addEventListener("click", (n) => {
991
- this._menu.contains(n.target) || n.composedPath().includes(this._menu) || this._message && this.onItemClick && !(n.target instanceof ie) && !this._isLongPress && this.onItemClick(this._message);
1922
+ this._menu.contains(n.target) || n.composedPath().includes(this._menu) || this._message && this.onItemClick && !(n.target instanceof ne) && !this._isLongPress && this.onItemClick(this._message);
992
1923
  }), this._setupHoverBehavior(), this._setupLongPressBehavior();
993
1924
  }
994
1925
  _setupHoverBehavior() {
@@ -1001,14 +1932,14 @@ class xo extends HTMLElement {
1001
1932
  const e = (n = (o = (s = this._theme.inbox) == null ? void 0 : s.list) == null ? void 0 : o.item) == null ? void 0 : n.menu;
1002
1933
  if (!(e != null && e.enabled))
1003
1934
  return;
1004
- const t = e.longPress;
1935
+ const i = e.longPress;
1005
1936
  this.addEventListener(
1006
1937
  "touchstart",
1007
1938
  () => {
1008
1939
  this._longPressTimeout = window.setTimeout(() => {
1009
- this._isLongPress = !0, this._showMenu(), this._message && this.onItemLongPress && (this.onItemLongPress(this._message), navigator.vibrate && navigator.vibrate((t == null ? void 0 : t.vibrationDuration) ?? 50)), setTimeout(() => {
1940
+ this._isLongPress = !0, this._showMenu(), this._message && this.onItemLongPress && (this.onItemLongPress(this._message), navigator.vibrate && navigator.vibrate((i == null ? void 0 : i.vibrationDuration) ?? 50)), setTimeout(() => {
1010
1941
  this._hideMenu(), this._isLongPress = !1;
1011
- }, (t == null ? void 0 : t.displayDuration) ?? 2e3);
1942
+ }, (i == null ? void 0 : i.displayDuration) ?? 2e3);
1012
1943
  }, 650);
1013
1944
  },
1014
1945
  { passive: !0 }
@@ -1021,43 +1952,43 @@ class xo extends HTMLElement {
1021
1952
  }
1022
1953
  // Helpers
1023
1954
  _getMenuOptions() {
1024
- var s, o, n, h, d, c, u, m, p, x, _, b, v, k, w, S, E, M, I;
1025
- const e = (h = (n = (o = (s = this._theme.inbox) == null ? void 0 : s.list) == null ? void 0 : o.item) == null ? void 0 : n.menu) == null ? void 0 : h.item;
1026
- let t = [];
1027
- return (d = this._message) != null && d.archived || t.push({
1028
- id: (c = this._message) != null && c.read ? "unread" : "read",
1955
+ var s, o, n, c, d, l, p, m, g, f, _, b, C, k, w, S, I, E, M;
1956
+ const e = (c = (n = (o = (s = this._theme.inbox) == null ? void 0 : s.list) == null ? void 0 : o.item) == null ? void 0 : n.menu) == null ? void 0 : c.item;
1957
+ let i = [];
1958
+ return (d = this._message) != null && d.archived || i.push({
1959
+ id: (l = this._message) != null && l.read ? "unread" : "read",
1029
1960
  icon: {
1030
- svg: (u = this._message) != null && u.read ? (m = e == null ? void 0 : e.unread) == null ? void 0 : m.svg : (p = e == null ? void 0 : e.read) == null ? void 0 : p.svg,
1031
- color: (x = this._message) != null && x.read ? (_ = e == null ? void 0 : e.unread) == null ? void 0 : _.color : ((b = e == null ? void 0 : e.read) == null ? void 0 : b.color) ?? "red"
1961
+ svg: (p = this._message) != null && p.read ? (m = e == null ? void 0 : e.unread) == null ? void 0 : m.svg : (g = e == null ? void 0 : e.read) == null ? void 0 : g.svg,
1962
+ color: (f = this._message) != null && f.read ? (_ = e == null ? void 0 : e.unread) == null ? void 0 : _.color : ((b = e == null ? void 0 : e.read) == null ? void 0 : b.color) ?? "red"
1032
1963
  },
1033
1964
  onClick: () => {
1034
- this._message && (this._message.read ? A.shared.unreadMessage(this._message) : A.shared.readMessage(this._message));
1965
+ this._message && (this._message.read ? P.shared.unreadMessage({ message: this._message }) : P.shared.readMessage({ message: this._message }));
1035
1966
  }
1036
- }), t.push({
1037
- id: (v = this._message) != null && v.archived ? "unarchive" : "archive",
1967
+ }), i.push({
1968
+ id: (C = this._message) != null && C.archived ? "unarchive" : "archive",
1038
1969
  icon: {
1039
1970
  svg: (k = this._message) != null && k.archived ? (w = e == null ? void 0 : e.unarchive) == null ? void 0 : w.svg : (S = e == null ? void 0 : e.archive) == null ? void 0 : S.svg,
1040
- color: (E = this._message) != null && E.archived ? (M = e == null ? void 0 : e.unarchive) == null ? void 0 : M.color : ((I = e == null ? void 0 : e.archive) == null ? void 0 : I.color) ?? "red"
1971
+ color: (I = this._message) != null && I.archived ? (E = e == null ? void 0 : e.unarchive) == null ? void 0 : E.color : ((M = e == null ? void 0 : e.archive) == null ? void 0 : M.color) ?? "red"
1041
1972
  },
1042
1973
  onClick: () => {
1043
- this._message && (this._message.archived ? alert("unarchive") : A.shared.archiveMessage(this._message));
1974
+ this._message && (this._message.archived ? alert("unarchive") : P.shared.archiveMessage({ message: this._message }));
1044
1975
  }
1045
- }), t;
1976
+ }), i;
1046
1977
  }
1047
1978
  // Menu visibility helpers
1048
1979
  _showMenu() {
1049
- var t, s, o;
1050
- const e = (o = (s = (t = this._theme.inbox) == null ? void 0 : t.list) == null ? void 0 : s.item) == null ? void 0 : o.menu;
1980
+ var i, s, o;
1981
+ const e = (o = (s = (i = this._theme.inbox) == null ? void 0 : i.list) == null ? void 0 : s.item) == null ? void 0 : o.menu;
1051
1982
  e && e.enabled && (this._menu.setOptions(this._getMenuOptions()), this._menu.style.display = "block", this._menu.show(), this._timeElement.style.opacity = "0");
1052
1983
  }
1053
1984
  _hideMenu() {
1054
- var t, s, o;
1055
- const e = (o = (s = (t = this._theme.inbox) == null ? void 0 : t.list) == null ? void 0 : s.item) == null ? void 0 : o.menu;
1985
+ var i, s, o;
1986
+ const e = (o = (s = (i = this._theme.inbox) == null ? void 0 : i.list) == null ? void 0 : s.item) == null ? void 0 : o.menu;
1056
1987
  e && e.enabled && (this._menu.hide(), this._menu.style.display = "none", this._timeElement.style.opacity = "1");
1057
1988
  }
1058
1989
  _getStyles() {
1059
- var t, s, o, n, h, d, c, u, m, p, x;
1060
- const e = (s = (t = this._theme.inbox) == null ? void 0 : t.list) == null ? void 0 : s.item;
1990
+ var i, s, o, n, c, d, l, p, m, g, f;
1991
+ const e = (s = (i = this._theme.inbox) == null ? void 0 : i.list) == null ? void 0 : s.item;
1061
1992
  return `
1062
1993
  :host {
1063
1994
  display: flex;
@@ -1143,20 +2074,20 @@ class xo extends HTMLElement {
1143
2074
  p[part='title'] {
1144
2075
  font-family: ${((o = e == null ? void 0 : e.title) == null ? void 0 : o.family) ?? "inherit"};
1145
2076
  font-size: ${((n = e == null ? void 0 : e.title) == null ? void 0 : n.size) ?? "14px"};
1146
- color: ${((h = e == null ? void 0 : e.title) == null ? void 0 : h.color) ?? "red"};
2077
+ color: ${((c = e == null ? void 0 : e.title) == null ? void 0 : c.color) ?? "red"};
1147
2078
  margin-bottom: 4px;
1148
2079
  }
1149
2080
 
1150
2081
  p[part='subtitle'] {
1151
2082
  font-family: ${((d = e == null ? void 0 : e.subtitle) == null ? void 0 : d.family) ?? "inherit"};
1152
- font-size: ${((c = e == null ? void 0 : e.subtitle) == null ? void 0 : c.size) ?? "14px"};
1153
- color: ${((u = e == null ? void 0 : e.subtitle) == null ? void 0 : u.color) ?? "red"};
2083
+ font-size: ${((l = e == null ? void 0 : e.subtitle) == null ? void 0 : l.size) ?? "14px"};
2084
+ color: ${((p = e == null ? void 0 : e.subtitle) == null ? void 0 : p.color) ?? "red"};
1154
2085
  }
1155
2086
 
1156
2087
  p[part='time'] {
1157
2088
  font-family: ${((m = e == null ? void 0 : e.time) == null ? void 0 : m.family) ?? "inherit"};
1158
- font-size: ${((p = e == null ? void 0 : e.time) == null ? void 0 : p.size) ?? "14px"};
1159
- color: ${((x = e == null ? void 0 : e.time) == null ? void 0 : x.color) ?? "red"};
2089
+ font-size: ${((g = e == null ? void 0 : e.time) == null ? void 0 : g.size) ?? "14px"};
2090
+ color: ${((f = e == null ? void 0 : e.time) == null ? void 0 : f.color) ?? "red"};
1160
2091
  text-align: right;
1161
2092
  white-space: nowrap;
1162
2093
  }
@@ -1187,17 +2118,17 @@ class xo extends HTMLElement {
1187
2118
  // Lifecycle hooks
1188
2119
  connectedCallback() {
1189
2120
  var s, o;
1190
- const e = this.getAttribute("message"), t = this.getAttribute("feed-type");
1191
- if (t && (this._feedType = t), e)
2121
+ const e = this.getAttribute("message"), i = this.getAttribute("feed-type");
2122
+ if (i && (this._feedType = i), e)
1192
2123
  try {
1193
2124
  this._message = JSON.parse(e), this._updateContent();
1194
2125
  } catch (n) {
1195
- (o = (s = C.shared.client) == null ? void 0 : s.options.logger) == null || o.error("CourierListItem – failed to parse message:", n);
2126
+ (o = (s = v.shared.client) == null ? void 0 : s.options.logger) == null || o.error("CourierListItem – failed to parse message:", n);
1196
2127
  }
1197
2128
  }
1198
2129
  // Public API
1199
- setMessage(e, t) {
1200
- this._message = e, this._feedType = t, this._updateContent();
2130
+ setMessage(e, i) {
2131
+ this._message = e, this._feedType = i, this._updateContent();
1201
2132
  }
1202
2133
  setOnItemClick(e) {
1203
2134
  this.onItemClick = e;
@@ -1210,49 +2141,49 @@ class xo extends HTMLElement {
1210
2141
  }
1211
2142
  // Content rendering
1212
2143
  _updateContent() {
1213
- var s, o, n, h, d, c;
2144
+ var s, o, n, c, d, l;
1214
2145
  if (!this._message) {
1215
2146
  this._titleElement.textContent = "", this._subtitleElement.textContent = "";
1216
2147
  return;
1217
2148
  }
1218
- this.classList.toggle("unread", !this._message.read && this._feedType !== "archive"), this._titleElement.textContent = this._message.title || "Untitled Message", this._subtitleElement.textContent = this._message.preview || this._message.body || "", this._timeElement.textContent = $o(this._message), this._menu.setOptions(this._getMenuOptions());
2149
+ this.classList.toggle("unread", !this._message.read && this._feedType !== "archive"), this._titleElement.textContent = this._message.title || "Untitled Message", this._subtitleElement.textContent = this._message.preview || this._message.body || "", this._timeElement.textContent = ln(this._message), this._menu.setOptions(this._getMenuOptions());
1219
2150
  const e = ((s = this._message) == null ? void 0 : s.actions) && this._message.actions.length > 0;
1220
2151
  this._actionsContainer.style.display = e ? "flex" : "none";
1221
- const t = (h = (n = (o = this._theme.inbox) == null ? void 0 : o.list) == null ? void 0 : n.item) == null ? void 0 : h.actions;
1222
- (c = (d = this._message) == null ? void 0 : d.actions) == null || c.forEach((u) => {
1223
- var p, x, _, b;
1224
- const m = new Ie({
1225
- text: u.content,
2152
+ const i = (c = (n = (o = this._theme.inbox) == null ? void 0 : o.list) == null ? void 0 : n.item) == null ? void 0 : c.actions;
2153
+ (l = (d = this._message) == null ? void 0 : d.actions) == null || l.forEach((p) => {
2154
+ var g, f, _, b;
2155
+ const m = new Re({
2156
+ text: p.content,
1226
2157
  variant: "secondary",
1227
- backgroundColor: t == null ? void 0 : t.backgroundColor,
1228
- hoverBackgroundColor: t == null ? void 0 : t.hoverBackgroundColor,
1229
- activeBackgroundColor: t == null ? void 0 : t.activeBackgroundColor,
1230
- border: t == null ? void 0 : t.border,
1231
- borderRadius: t == null ? void 0 : t.borderRadius,
1232
- shadow: t == null ? void 0 : t.shadow,
1233
- fontFamily: (p = t == null ? void 0 : t.font) == null ? void 0 : p.family,
1234
- fontSize: (x = t == null ? void 0 : t.font) == null ? void 0 : x.size,
1235
- fontWeight: (_ = t == null ? void 0 : t.font) == null ? void 0 : _.weight,
1236
- textColor: (b = t == null ? void 0 : t.font) == null ? void 0 : b.color,
2158
+ backgroundColor: i == null ? void 0 : i.backgroundColor,
2159
+ hoverBackgroundColor: i == null ? void 0 : i.hoverBackgroundColor,
2160
+ activeBackgroundColor: i == null ? void 0 : i.activeBackgroundColor,
2161
+ border: i == null ? void 0 : i.border,
2162
+ borderRadius: i == null ? void 0 : i.borderRadius,
2163
+ shadow: i == null ? void 0 : i.shadow,
2164
+ fontFamily: (g = i == null ? void 0 : i.font) == null ? void 0 : g.family,
2165
+ fontSize: (f = i == null ? void 0 : i.font) == null ? void 0 : f.size,
2166
+ fontWeight: (_ = i == null ? void 0 : i.font) == null ? void 0 : _.weight,
2167
+ textColor: (b = i == null ? void 0 : i.font) == null ? void 0 : b.color,
1237
2168
  onClick: () => {
1238
- this._message && this.onItemActionClick && this.onItemActionClick(this._message, u);
2169
+ this._message && this.onItemActionClick && this.onItemActionClick(this._message, p);
1239
2170
  }
1240
2171
  });
1241
2172
  this._actionsContainer.appendChild(m);
1242
2173
  });
1243
2174
  }
1244
2175
  }
1245
- customElements.get("courier-list-item") || customElements.define("courier-list-item", xo);
1246
- class fo extends HTMLElement {
1247
- constructor(e, t) {
2176
+ customElements.get("courier-list-item") || customElements.define("courier-list-item", Ao);
2177
+ class Po extends HTMLElement {
2178
+ constructor(e, i) {
1248
2179
  super();
1249
2180
  // Shadow root
1250
2181
  a(this, "_shadow");
1251
2182
  this._shadow = this.attachShadow({ mode: "open" });
1252
2183
  const s = document.createElement("style");
1253
- s.textContent = this.getStyles(t), this._shadow.appendChild(s);
1254
- const o = new Ee(e, 35), n = new Ee(e, 100), h = new Ee(e, 82);
1255
- this._shadow.appendChild(o), this._shadow.appendChild(n), this._shadow.appendChild(h);
2184
+ s.textContent = this.getStyles(i), this._shadow.appendChild(s);
2185
+ const o = new Le(e, 35), n = new Le(e, 100), c = new Le(e, 82);
2186
+ this._shadow.appendChild(o), this._shadow.appendChild(n), this._shadow.appendChild(c);
1256
2187
  }
1257
2188
  getStyles(e) {
1258
2189
  return `
@@ -1268,41 +2199,41 @@ class fo extends HTMLElement {
1268
2199
  `;
1269
2200
  }
1270
2201
  }
1271
- customElements.get("courier-inbox-skeleton-list-item") || customElements.define("courier-inbox-skeleton-list-item", fo);
1272
- class Ee extends HTMLElement {
1273
- constructor(e, t) {
2202
+ customElements.get("courier-inbox-skeleton-list-item") || customElements.define("courier-inbox-skeleton-list-item", Po);
2203
+ class Le extends HTMLElement {
2204
+ constructor(e, i) {
1274
2205
  super();
1275
2206
  a(this, "_shadow");
1276
2207
  this._shadow = this.attachShadow({ mode: "open" });
1277
2208
  const s = document.createElement("style");
1278
- s.textContent = this.getStyles(e, t), this._shadow.appendChild(s);
2209
+ s.textContent = this.getStyles(e, i), this._shadow.appendChild(s);
1279
2210
  const o = document.createElement("div");
1280
2211
  o.className = "skeleton-item", this._shadow.appendChild(o);
1281
2212
  }
1282
- getStyles(e, t) {
1283
- var m, p, x, _, b, v, k, w, S, E, M, I;
1284
- const s = ((x = (p = (m = e.inbox) == null ? void 0 : m.loading) == null ? void 0 : p.animation) == null ? void 0 : x.barColor) ?? "#000", o = s.length === 4 ? `#${s[1]}${s[1]}${s[2]}${s[2]}${s[3]}${s[3]}` : s, n = parseInt(o.slice(1, 3), 16), h = parseInt(o.slice(3, 5), 16), d = parseInt(o.slice(5, 7), 16), c = `rgba(${n}, ${h}, ${d}, 0.8)`, u = `rgba(${n}, ${h}, ${d}, 0.4)`;
2213
+ getStyles(e, i) {
2214
+ var m, g, f, _, b, C, k, w, S, I, E, M;
2215
+ const s = ((f = (g = (m = e.inbox) == null ? void 0 : m.loading) == null ? void 0 : g.animation) == null ? void 0 : f.barColor) ?? "#000", o = s.length === 4 ? `#${s[1]}${s[1]}${s[2]}${s[2]}${s[3]}${s[3]}` : s, n = parseInt(o.slice(1, 3), 16), c = parseInt(o.slice(3, 5), 16), d = parseInt(o.slice(5, 7), 16), l = `rgba(${n}, ${c}, ${d}, 0.8)`, p = `rgba(${n}, ${c}, ${d}, 0.4)`;
1285
2216
  return `
1286
2217
  :host {
1287
2218
  display: flex;
1288
2219
  height: 100%;
1289
- width: ${t}%;
2220
+ width: ${i}%;
1290
2221
  align-items: flex-start;
1291
2222
  justify-content: flex-start;
1292
2223
  }
1293
2224
 
1294
2225
  .skeleton-item {
1295
- height: ${((v = (b = (_ = e.inbox) == null ? void 0 : _.loading) == null ? void 0 : b.animation) == null ? void 0 : v.barHeight) ?? "14px"};
2226
+ height: ${((C = (b = (_ = e.inbox) == null ? void 0 : _.loading) == null ? void 0 : b.animation) == null ? void 0 : C.barHeight) ?? "14px"};
1296
2227
  width: 100%;
1297
2228
  background: linear-gradient(
1298
2229
  90deg,
1299
- ${c} 25%,
1300
- ${u} 50%,
1301
- ${c} 75%
2230
+ ${l} 25%,
2231
+ ${p} 50%,
2232
+ ${l} 75%
1302
2233
  );
1303
2234
  background-size: 200% 100%;
1304
2235
  animation: shimmer ${((S = (w = (k = e.inbox) == null ? void 0 : k.loading) == null ? void 0 : w.animation) == null ? void 0 : S.duration) ?? "2s"} ease-in-out infinite;
1305
- border-radius: ${((I = (M = (E = e.inbox) == null ? void 0 : E.loading) == null ? void 0 : M.animation) == null ? void 0 : I.barBorderRadius) ?? "14px"};
2236
+ border-radius: ${((M = (E = (I = e.inbox) == null ? void 0 : I.loading) == null ? void 0 : E.animation) == null ? void 0 : M.barBorderRadius) ?? "14px"};
1306
2237
  }
1307
2238
 
1308
2239
  @keyframes shimmer {
@@ -1316,8 +2247,8 @@ class Ee extends HTMLElement {
1316
2247
  `;
1317
2248
  }
1318
2249
  }
1319
- customElements.get("courier-skeleton-animated-row") || customElements.define("courier-skeleton-animated-row", Ee);
1320
- class $e extends Le {
2250
+ customElements.get("courier-skeleton-animated-row") || customElements.define("courier-skeleton-animated-row", Le);
2251
+ class Ne extends De {
1321
2252
  constructor(e) {
1322
2253
  super();
1323
2254
  a(this, "_theme");
@@ -1326,16 +2257,16 @@ class $e extends Le {
1326
2257
  defaultElement() {
1327
2258
  const e = document.createElement("div");
1328
2259
  e.className = "list";
1329
- const t = document.createElement("style");
1330
- t.textContent = this.getStyles(), e.appendChild(t);
2260
+ const i = document.createElement("style");
2261
+ i.textContent = this.getStyles(), e.appendChild(i);
1331
2262
  for (let s = 0; s < 3; s++) {
1332
- const o = new fo(this._theme, 1 / (s + 1));
2263
+ const o = new Po(this._theme, 1 / (s + 1));
1333
2264
  e.appendChild(o);
1334
2265
  }
1335
2266
  return this.shadow.appendChild(e), e;
1336
2267
  }
1337
2268
  getStyles() {
1338
- var e, t;
2269
+ var e, i;
1339
2270
  return `
1340
2271
  :host {
1341
2272
  display: flex;
@@ -1355,7 +2286,7 @@ class $e extends Le {
1355
2286
  }
1356
2287
 
1357
2288
  .list > * {
1358
- border-bottom: ${((t = (e = this._theme.inbox) == null ? void 0 : e.loading) == null ? void 0 : t.divider) ?? "1px solid red"};
2289
+ border-bottom: ${((i = (e = this._theme.inbox) == null ? void 0 : e.loading) == null ? void 0 : i.divider) ?? "1px solid red"};
1359
2290
  }
1360
2291
 
1361
2292
  .list > *:last-child {
@@ -1364,8 +2295,8 @@ class $e extends Le {
1364
2295
  `;
1365
2296
  }
1366
2297
  }
1367
- customElements.get("courier-inbox-skeleton-list") || customElements.define("courier-inbox-skeleton-list", $e);
1368
- class Co extends HTMLElement {
2298
+ customElements.get("courier-inbox-skeleton-list") || customElements.define("courier-inbox-skeleton-list", Ne);
2299
+ class Bo extends HTMLElement {
1369
2300
  constructor(e) {
1370
2301
  super();
1371
2302
  // Components
@@ -1375,12 +2306,12 @@ class Co extends HTMLElement {
1375
2306
  // Handlers
1376
2307
  a(this, "onPaginationTrigger");
1377
2308
  this.onPaginationTrigger = e.onPaginationTrigger, this.customItem = e.customItem;
1378
- const t = this.attachShadow({ mode: "open" }), s = document.createElement("style");
1379
- if (s.textContent = this.getStyles(), t.appendChild(s), this.customItem)
1380
- t.appendChild(this.customItem);
2309
+ const i = this.attachShadow({ mode: "open" }), s = document.createElement("style");
2310
+ if (s.textContent = this.getStyles(), i.appendChild(s), this.customItem)
2311
+ i.appendChild(this.customItem);
1381
2312
  else {
1382
2313
  const o = document.createElement("div");
1383
- o.className = "skeleton-container", this.skeletonLoadingList = new $e(e.theme), this.skeletonLoadingList.build(void 0), o.appendChild(this.skeletonLoadingList), t.appendChild(o);
2314
+ o.className = "skeleton-container", this.skeletonLoadingList = new Ne(e.theme), this.skeletonLoadingList.build(void 0), o.appendChild(this.skeletonLoadingList), i.appendChild(o);
1384
2315
  }
1385
2316
  this.observer = new IntersectionObserver((o) => {
1386
2317
  o.forEach((n) => {
@@ -1405,8 +2336,8 @@ class Co extends HTMLElement {
1405
2336
  this.observer.disconnect();
1406
2337
  }
1407
2338
  }
1408
- customElements.get("courier-inbox-pagination-list-item") || customElements.define("courier-inbox-pagination-list-item", Co);
1409
- class vo extends HTMLElement {
2339
+ customElements.get("courier-inbox-pagination-list-item") || customElements.define("courier-inbox-pagination-list-item", Bo);
2340
+ class Ro extends HTMLElement {
1410
2341
  constructor(e) {
1411
2342
  super();
1412
2343
  // Theme
@@ -1432,16 +2363,16 @@ class vo extends HTMLElement {
1432
2363
  this._themeSubscription = e.themeManager.subscribe((o) => {
1433
2364
  this.refreshTheme();
1434
2365
  }), this._onRefresh = e.onRefresh, this._onPaginationTrigger = e.onPaginationTrigger, this._onMessageClick = e.onMessageClick, this._onMessageActionClick = e.onMessageActionClick, this._onMessageLongPress = e.onMessageLongPress;
1435
- const t = this.attachShadow({ mode: "open" }), s = document.createElement("style");
1436
- s.textContent = this.getStyles(), t.appendChild(s);
2366
+ const i = this.attachShadow({ mode: "open" }), s = document.createElement("style");
2367
+ s.textContent = this.getStyles(), i.appendChild(s);
1437
2368
  }
1438
2369
  // Getters
1439
2370
  get messages() {
1440
2371
  return this._messages;
1441
2372
  }
1442
2373
  getStyles() {
1443
- var t;
1444
- const e = (t = this._themeSubscription.manager.getTheme().inbox) == null ? void 0 : t.list;
2374
+ var i;
2375
+ const e = (i = this._themeSubscription.manager.getTheme().inbox) == null ? void 0 : i.list;
1445
2376
  return `
1446
2377
  :host {
1447
2378
  flex: 1;
@@ -1458,8 +2389,8 @@ class vo extends HTMLElement {
1458
2389
  `;
1459
2390
  }
1460
2391
  reset() {
1461
- var t, s;
1462
- for (; (t = this.shadowRoot) != null && t.firstChild; )
2392
+ var i, s;
2393
+ for (; (i = this.shadowRoot) != null && i.firstChild; )
1463
2394
  this.shadowRoot.removeChild(this.shadowRoot.firstChild);
1464
2395
  const e = document.createElement("style");
1465
2396
  e.textContent = this.getStyles(), (s = this.shadowRoot) == null || s.appendChild(e);
@@ -1470,14 +2401,14 @@ class vo extends HTMLElement {
1470
2401
  addPage(e) {
1471
2402
  this._messages = [...this._messages, ...e.messages], this._canPaginate = !!e.canPaginate, this._error = null, this._isLoading = !1, this.render();
1472
2403
  }
1473
- addMessage(e, t = 0) {
1474
- this._messages.splice(t, 0, e), this.render();
2404
+ addMessage(e, i = 0) {
2405
+ this._messages.splice(i, 0, e), this.render();
1475
2406
  }
1476
2407
  removeMessage(e = 0) {
1477
2408
  this._messages.splice(e, 1), this.render();
1478
2409
  }
1479
- updateMessage(e, t = 0) {
1480
- this._messages[t] = e, this.render();
2410
+ updateMessage(e, i = 0) {
2411
+ this._messages[i] = e, this.render();
1481
2412
  }
1482
2413
  setFeedType(e) {
1483
2414
  this._feedType = e, this._error = null, this._isLoading = !0, this.render();
@@ -1498,93 +2429,93 @@ class vo extends HTMLElement {
1498
2429
  this._onRefresh();
1499
2430
  }
1500
2431
  render() {
1501
- var s, o, n, h, d, c, u, m, p, x, _, b, v, k, w, S, E, M, I, T, $, D, y, B, F, H, R, z, O, N, U, V, Z, J, q, X, Y, j, se, oe, ne, re, ae, he, ce, le, de, ue, pe, ge, me, be, _e, xe, fe, Ce, ve, ye;
2432
+ var s, o, n, c, d, l, p, m, g, f, _, b, C, k, w, S, I, E, M, L, R, D, y, A, F, H, O, z, U, N, q, V, j, X, Q, Y, ee, G, ae, he, ce, le, de, ue, pe, ge, me, be, _e, fe, xe, ve, Ce, ye, ke, we, Se, Ie;
1502
2433
  this.reset();
1503
2434
  const e = this._themeSubscription.manager.getTheme();
1504
2435
  if (this._error) {
1505
- const l = (s = e.inbox) == null ? void 0 : s.error, P = new Me({
2436
+ const u = (s = e.inbox) == null ? void 0 : s.error, B = new Be({
1506
2437
  title: {
1507
- text: ((o = l == null ? void 0 : l.title) == null ? void 0 : o.text) ?? this._error.message,
1508
- textColor: (h = (n = l == null ? void 0 : l.title) == null ? void 0 : n.font) == null ? void 0 : h.color,
1509
- fontFamily: (c = (d = l == null ? void 0 : l.title) == null ? void 0 : d.font) == null ? void 0 : c.family,
1510
- fontSize: (m = (u = l == null ? void 0 : l.title) == null ? void 0 : u.font) == null ? void 0 : m.size,
1511
- fontWeight: (x = (p = l == null ? void 0 : l.title) == null ? void 0 : p.font) == null ? void 0 : x.weight
2438
+ text: ((o = u == null ? void 0 : u.title) == null ? void 0 : o.text) ?? this._error.message,
2439
+ textColor: (c = (n = u == null ? void 0 : u.title) == null ? void 0 : n.font) == null ? void 0 : c.color,
2440
+ fontFamily: (l = (d = u == null ? void 0 : u.title) == null ? void 0 : d.font) == null ? void 0 : l.family,
2441
+ fontSize: (m = (p = u == null ? void 0 : u.title) == null ? void 0 : p.font) == null ? void 0 : m.size,
2442
+ fontWeight: (f = (g = u == null ? void 0 : u.title) == null ? void 0 : g.font) == null ? void 0 : f.weight
1512
2443
  },
1513
2444
  button: {
1514
- text: (_ = l == null ? void 0 : l.button) == null ? void 0 : _.text,
1515
- backgroundColor: (b = l == null ? void 0 : l.button) == null ? void 0 : b.backgroundColor,
1516
- hoverBackgroundColor: (v = l == null ? void 0 : l.button) == null ? void 0 : v.hoverBackgroundColor,
1517
- activeBackgroundColor: (k = l == null ? void 0 : l.button) == null ? void 0 : k.activeBackgroundColor,
1518
- textColor: (S = (w = l == null ? void 0 : l.button) == null ? void 0 : w.font) == null ? void 0 : S.color,
1519
- fontFamily: (M = (E = l == null ? void 0 : l.button) == null ? void 0 : E.font) == null ? void 0 : M.family,
1520
- fontSize: (T = (I = l == null ? void 0 : l.button) == null ? void 0 : I.font) == null ? void 0 : T.size,
1521
- fontWeight: (D = ($ = l == null ? void 0 : l.button) == null ? void 0 : $.font) == null ? void 0 : D.weight,
1522
- shadow: (y = l == null ? void 0 : l.button) == null ? void 0 : y.shadow,
1523
- border: (B = l == null ? void 0 : l.button) == null ? void 0 : B.border,
1524
- borderRadius: (F = l == null ? void 0 : l.button) == null ? void 0 : F.borderRadius
2445
+ text: (_ = u == null ? void 0 : u.button) == null ? void 0 : _.text,
2446
+ backgroundColor: (b = u == null ? void 0 : u.button) == null ? void 0 : b.backgroundColor,
2447
+ hoverBackgroundColor: (C = u == null ? void 0 : u.button) == null ? void 0 : C.hoverBackgroundColor,
2448
+ activeBackgroundColor: (k = u == null ? void 0 : u.button) == null ? void 0 : k.activeBackgroundColor,
2449
+ textColor: (S = (w = u == null ? void 0 : u.button) == null ? void 0 : w.font) == null ? void 0 : S.color,
2450
+ fontFamily: (E = (I = u == null ? void 0 : u.button) == null ? void 0 : I.font) == null ? void 0 : E.family,
2451
+ fontSize: (L = (M = u == null ? void 0 : u.button) == null ? void 0 : M.font) == null ? void 0 : L.size,
2452
+ fontWeight: (D = (R = u == null ? void 0 : u.button) == null ? void 0 : R.font) == null ? void 0 : D.weight,
2453
+ shadow: (y = u == null ? void 0 : u.button) == null ? void 0 : y.shadow,
2454
+ border: (A = u == null ? void 0 : u.button) == null ? void 0 : A.border,
2455
+ borderRadius: (F = u == null ? void 0 : u.button) == null ? void 0 : F.borderRadius
1525
2456
  }
1526
2457
  });
1527
- P.build((H = this._errorStateFactory) == null ? void 0 : H.call(this, { feedType: this._feedType, error: this._error })), P.setButtonClickCallback(() => this.handleRetry()), (R = this.shadowRoot) == null || R.appendChild(P);
2458
+ B.build((H = this._errorStateFactory) == null ? void 0 : H.call(this, { feedType: this._feedType, error: this._error })), B.setButtonClickCallback(() => this.handleRetry()), (O = this.shadowRoot) == null || O.appendChild(B);
1528
2459
  return;
1529
2460
  }
1530
2461
  if (this._isLoading) {
1531
- const l = new $e(e);
1532
- l.build((z = this._loadingStateFactory) == null ? void 0 : z.call(this, { feedType: this._feedType })), (O = this.shadowRoot) == null || O.appendChild(l);
2462
+ const u = new Ne(e);
2463
+ u.build((z = this._loadingStateFactory) == null ? void 0 : z.call(this, { feedType: this._feedType })), (U = this.shadowRoot) == null || U.appendChild(u);
1533
2464
  return;
1534
2465
  }
1535
2466
  if (this._messages.length === 0) {
1536
- const l = (N = e.inbox) == null ? void 0 : N.empty, P = new Me({
2467
+ const u = (N = e.inbox) == null ? void 0 : N.empty, B = new Be({
1537
2468
  title: {
1538
- text: ((U = l == null ? void 0 : l.title) == null ? void 0 : U.text) ?? `No ${this._feedType} messages yet`,
1539
- textColor: (Z = (V = l == null ? void 0 : l.title) == null ? void 0 : V.font) == null ? void 0 : Z.color,
1540
- fontFamily: (q = (J = l == null ? void 0 : l.title) == null ? void 0 : J.font) == null ? void 0 : q.family,
1541
- fontSize: (Y = (X = l == null ? void 0 : l.title) == null ? void 0 : X.font) == null ? void 0 : Y.size,
1542
- fontWeight: (se = (j = l == null ? void 0 : l.title) == null ? void 0 : j.font) == null ? void 0 : se.weight
2469
+ text: ((q = u == null ? void 0 : u.title) == null ? void 0 : q.text) ?? `No ${this._feedType} messages yet`,
2470
+ textColor: (j = (V = u == null ? void 0 : u.title) == null ? void 0 : V.font) == null ? void 0 : j.color,
2471
+ fontFamily: (Q = (X = u == null ? void 0 : u.title) == null ? void 0 : X.font) == null ? void 0 : Q.family,
2472
+ fontSize: (ee = (Y = u == null ? void 0 : u.title) == null ? void 0 : Y.font) == null ? void 0 : ee.size,
2473
+ fontWeight: (ae = (G = u == null ? void 0 : u.title) == null ? void 0 : G.font) == null ? void 0 : ae.weight
1543
2474
  },
1544
2475
  button: {
1545
- text: (oe = l == null ? void 0 : l.button) == null ? void 0 : oe.text,
1546
- backgroundColor: (ne = l == null ? void 0 : l.button) == null ? void 0 : ne.backgroundColor,
1547
- hoverBackgroundColor: (re = l == null ? void 0 : l.button) == null ? void 0 : re.hoverBackgroundColor,
1548
- activeBackgroundColor: (ae = l == null ? void 0 : l.button) == null ? void 0 : ae.activeBackgroundColor,
1549
- textColor: (ce = (he = l == null ? void 0 : l.button) == null ? void 0 : he.font) == null ? void 0 : ce.color,
1550
- fontFamily: (de = (le = l == null ? void 0 : l.button) == null ? void 0 : le.font) == null ? void 0 : de.family,
1551
- fontSize: (pe = (ue = l == null ? void 0 : l.button) == null ? void 0 : ue.font) == null ? void 0 : pe.size,
1552
- fontWeight: (me = (ge = l == null ? void 0 : l.button) == null ? void 0 : ge.font) == null ? void 0 : me.weight,
1553
- shadow: (be = l == null ? void 0 : l.button) == null ? void 0 : be.shadow,
1554
- border: (_e = l == null ? void 0 : l.button) == null ? void 0 : _e.border,
1555
- borderRadius: (xe = l == null ? void 0 : l.button) == null ? void 0 : xe.borderRadius
2476
+ text: (he = u == null ? void 0 : u.button) == null ? void 0 : he.text,
2477
+ backgroundColor: (ce = u == null ? void 0 : u.button) == null ? void 0 : ce.backgroundColor,
2478
+ hoverBackgroundColor: (le = u == null ? void 0 : u.button) == null ? void 0 : le.hoverBackgroundColor,
2479
+ activeBackgroundColor: (de = u == null ? void 0 : u.button) == null ? void 0 : de.activeBackgroundColor,
2480
+ textColor: (pe = (ue = u == null ? void 0 : u.button) == null ? void 0 : ue.font) == null ? void 0 : pe.color,
2481
+ fontFamily: (me = (ge = u == null ? void 0 : u.button) == null ? void 0 : ge.font) == null ? void 0 : me.family,
2482
+ fontSize: (_e = (be = u == null ? void 0 : u.button) == null ? void 0 : be.font) == null ? void 0 : _e.size,
2483
+ fontWeight: (xe = (fe = u == null ? void 0 : u.button) == null ? void 0 : fe.font) == null ? void 0 : xe.weight,
2484
+ shadow: (ve = u == null ? void 0 : u.button) == null ? void 0 : ve.shadow,
2485
+ border: (Ce = u == null ? void 0 : u.button) == null ? void 0 : Ce.border,
2486
+ borderRadius: (ye = u == null ? void 0 : u.button) == null ? void 0 : ye.borderRadius
1556
2487
  }
1557
2488
  });
1558
- P.build((fe = this._emptyStateFactory) == null ? void 0 : fe.call(this, { feedType: this._feedType })), P.setButtonClickCallback(() => this.handleRefresh()), (Ce = this.shadowRoot) == null || Ce.appendChild(P);
2489
+ B.build((ke = this._emptyStateFactory) == null ? void 0 : ke.call(this, { feedType: this._feedType })), B.setButtonClickCallback(() => this.handleRefresh()), (we = this.shadowRoot) == null || we.appendChild(B);
1559
2490
  return;
1560
2491
  }
1561
- const t = document.createElement("ul");
1562
- if ((ve = this.shadowRoot) == null || ve.appendChild(t), this._messages.forEach((l, P) => {
2492
+ const i = document.createElement("ul");
2493
+ if ((Se = this.shadowRoot) == null || Se.appendChild(i), this._messages.forEach((u, B) => {
1563
2494
  if (this._listItemFactory) {
1564
- t.appendChild(this._listItemFactory({ message: l, index: P }));
2495
+ i.appendChild(this._listItemFactory({ message: u, index: B }));
1565
2496
  return;
1566
2497
  }
1567
- const K = new xo(e);
1568
- K.setMessage(l, this._feedType), K.setOnItemClick((Q) => {
1569
- var W;
1570
- return (W = this._onMessageClick) == null ? void 0 : W.call(this, Q, P);
1571
- }), K.setOnItemActionClick((Q, W) => {
1572
- var ke;
1573
- return (ke = this._onMessageActionClick) == null ? void 0 : ke.call(this, Q, W, P);
1574
- }), K.setOnItemLongPress((Q) => {
1575
- var W;
1576
- return (W = this._onMessageLongPress) == null ? void 0 : W.call(this, Q, P);
1577
- }), t.appendChild(K);
2498
+ const te = new Ao(e);
2499
+ te.setMessage(u, this._feedType), te.setOnItemClick((ie) => {
2500
+ var J;
2501
+ return (J = this._onMessageClick) == null ? void 0 : J.call(this, ie, B);
2502
+ }), te.setOnItemActionClick((ie, J) => {
2503
+ var Ee;
2504
+ return (Ee = this._onMessageActionClick) == null ? void 0 : Ee.call(this, ie, J, B);
2505
+ }), te.setOnItemLongPress((ie) => {
2506
+ var J;
2507
+ return (J = this._onMessageLongPress) == null ? void 0 : J.call(this, ie, B);
2508
+ }), i.appendChild(te);
1578
2509
  }), this._canPaginate) {
1579
- const l = new Co({
2510
+ const u = new Bo({
1580
2511
  theme: e,
1581
- customItem: (ye = this._paginationItemFactory) == null ? void 0 : ye.call(this, { feedType: this._feedType }),
2512
+ customItem: (Ie = this._paginationItemFactory) == null ? void 0 : Ie.call(this, { feedType: this._feedType }),
1582
2513
  onPaginationTrigger: () => {
1583
- var P;
1584
- return (P = this._onPaginationTrigger) == null ? void 0 : P.call(this, this._feedType);
2514
+ var B;
2515
+ return (B = this._onPaginationTrigger) == null ? void 0 : B.call(this, this._feedType);
1585
2516
  }
1586
2517
  });
1587
- t.appendChild(l);
2518
+ i.appendChild(u);
1588
2519
  }
1589
2520
  }
1590
2521
  // Factories
@@ -1611,8 +2542,8 @@ class vo extends HTMLElement {
1611
2542
  this._themeSubscription.unsubscribe();
1612
2543
  }
1613
2544
  }
1614
- customElements.get("courier-inbox-list") || customElements.define("courier-inbox-list", vo);
1615
- class yo extends HTMLElement {
2545
+ customElements.get("courier-inbox-list") || customElements.define("courier-inbox-list", Ro);
2546
+ class Do extends HTMLElement {
1616
2547
  constructor(e) {
1617
2548
  super();
1618
2549
  // State
@@ -1627,13 +2558,13 @@ class yo extends HTMLElement {
1627
2558
  // Theme
1628
2559
  a(this, "_themeManager");
1629
2560
  this._option = e.option, this._isSelected = e.isSelected, this._themeManager = e.themeManager;
1630
- const t = this.attachShadow({ mode: "open" });
1631
- this._style = document.createElement("style"), this._content = document.createElement("div"), this._content.className = "menu-item", this._itemIcon = new ie(this._option.icon.svg ?? f.inbox), this._itemIcon.setAttribute("size", "16"), this._title = document.createElement("p"), this._title.textContent = this._option.text;
2561
+ const i = this.attachShadow({ mode: "open" });
2562
+ this._style = document.createElement("style"), this._content = document.createElement("div"), this._content.className = "menu-item", this._itemIcon = new ne(this._option.icon.svg ?? x.inbox), this._itemIcon.setAttribute("size", "16"), this._title = document.createElement("p"), this._title.textContent = this._option.text;
1632
2563
  const s = document.createElement("div");
1633
- s.className = "spacer", this._selectionIcon = new ie(f.check), this._content.appendChild(this._itemIcon), this._content.appendChild(this._title), this._content.appendChild(s), e.selectable && this._content.appendChild(this._selectionIcon), t.appendChild(this._style), t.appendChild(this._content), this._selectionIcon.style.display = this._isSelected ? "block" : "none", this.refreshTheme();
2564
+ s.className = "spacer", this._selectionIcon = new ne(x.check), this._content.appendChild(this._itemIcon), this._content.appendChild(this._title), this._content.appendChild(s), e.selectable && this._content.appendChild(this._selectionIcon), i.appendChild(this._style), i.appendChild(this._content), this._selectionIcon.style.display = this._isSelected ? "block" : "none", this.refreshTheme();
1634
2565
  }
1635
2566
  getStyles() {
1636
- var t, s, o, n, h, d, c, u, m, p, x, _, b, v, k, w, S, E, M, I, T, $, D, y, B, F, H, R, z, O, N, U, V, Z;
2567
+ var i, s, o, n, c, d, l, p, m, g, f, _, b, C, k, w, S, I, E, M, L, R, D, y, A, F, H, O, z, U, N, q, V, j;
1637
2568
  const e = this._themeManager.getTheme();
1638
2569
  return `
1639
2570
  :host {
@@ -1644,11 +2575,11 @@ class yo extends HTMLElement {
1644
2575
  }
1645
2576
 
1646
2577
  :host(:hover) {
1647
- background-color: ${((h = (n = (o = (s = (t = e.inbox) == null ? void 0 : t.header) == null ? void 0 : s.menus) == null ? void 0 : o.popup) == null ? void 0 : n.list) == null ? void 0 : h.hoverBackgroundColor) ?? "red"};
2578
+ background-color: ${((c = (n = (o = (s = (i = e.inbox) == null ? void 0 : i.header) == null ? void 0 : s.menus) == null ? void 0 : o.popup) == null ? void 0 : n.list) == null ? void 0 : c.hoverBackgroundColor) ?? "red"};
1648
2579
  }
1649
2580
 
1650
2581
  :host(:active) {
1651
- background-color: ${((p = (m = (u = (c = (d = e.inbox) == null ? void 0 : d.header) == null ? void 0 : c.menus) == null ? void 0 : u.popup) == null ? void 0 : m.list) == null ? void 0 : p.activeBackgroundColor) ?? "red"};
2582
+ background-color: ${((g = (m = (p = (l = (d = e.inbox) == null ? void 0 : d.header) == null ? void 0 : l.menus) == null ? void 0 : p.popup) == null ? void 0 : m.list) == null ? void 0 : g.activeBackgroundColor) ?? "red"};
1652
2583
  }
1653
2584
 
1654
2585
  .menu-item {
@@ -1664,10 +2595,10 @@ class yo extends HTMLElement {
1664
2595
 
1665
2596
  p {
1666
2597
  margin: 0;
1667
- font-family: ${((w = (k = (v = (b = (_ = (x = e.inbox) == null ? void 0 : x.header) == null ? void 0 : _.menus) == null ? void 0 : b.popup) == null ? void 0 : v.list) == null ? void 0 : k.font) == null ? void 0 : w.family) ?? "inherit"};
1668
- font-weight: ${(($ = (T = (I = (M = (E = (S = e.inbox) == null ? void 0 : S.header) == null ? void 0 : E.menus) == null ? void 0 : M.popup) == null ? void 0 : I.list) == null ? void 0 : T.font) == null ? void 0 : $.weight) ?? "inherit"};
1669
- font-size: ${((R = (H = (F = (B = (y = (D = e.inbox) == null ? void 0 : D.header) == null ? void 0 : y.menus) == null ? void 0 : B.popup) == null ? void 0 : F.list) == null ? void 0 : H.font) == null ? void 0 : R.size) ?? "14px"};
1670
- color: ${((Z = (V = (U = (N = (O = (z = e.inbox) == null ? void 0 : z.header) == null ? void 0 : O.menus) == null ? void 0 : N.popup) == null ? void 0 : U.list) == null ? void 0 : V.font) == null ? void 0 : Z.color) ?? "red"};
2598
+ font-family: ${((w = (k = (C = (b = (_ = (f = e.inbox) == null ? void 0 : f.header) == null ? void 0 : _.menus) == null ? void 0 : b.popup) == null ? void 0 : C.list) == null ? void 0 : k.font) == null ? void 0 : w.family) ?? "inherit"};
2599
+ font-weight: ${((R = (L = (M = (E = (I = (S = e.inbox) == null ? void 0 : S.header) == null ? void 0 : I.menus) == null ? void 0 : E.popup) == null ? void 0 : M.list) == null ? void 0 : L.font) == null ? void 0 : R.weight) ?? "inherit"};
2600
+ font-size: ${((O = (H = (F = (A = (y = (D = e.inbox) == null ? void 0 : D.header) == null ? void 0 : y.menus) == null ? void 0 : A.popup) == null ? void 0 : F.list) == null ? void 0 : H.font) == null ? void 0 : O.size) ?? "14px"};
2601
+ color: ${((j = (V = (q = (N = (U = (z = e.inbox) == null ? void 0 : z.header) == null ? void 0 : U.menus) == null ? void 0 : N.popup) == null ? void 0 : q.list) == null ? void 0 : V.font) == null ? void 0 : j.color) ?? "red"};
1671
2602
  white-space: nowrap;
1672
2603
  }
1673
2604
 
@@ -1677,13 +2608,13 @@ class yo extends HTMLElement {
1677
2608
  `;
1678
2609
  }
1679
2610
  refreshTheme() {
1680
- var e, t, s, o;
1681
- this._style.textContent = this.getStyles(), this._selectionIcon.updateColor(((e = this._option.selectionIcon) == null ? void 0 : e.color) ?? "red"), this._selectionIcon.updateSVG(((t = this._option.selectionIcon) == null ? void 0 : t.svg) ?? f.check), this._title.textContent = this._option.text ?? "Missing Text", this._itemIcon.updateColor(((s = this._option.icon) == null ? void 0 : s.color) ?? "red"), this._itemIcon.updateSVG(((o = this._option.icon) == null ? void 0 : o.svg) ?? f.inbox);
2611
+ var e, i, s, o;
2612
+ this._style.textContent = this.getStyles(), this._selectionIcon.updateColor(((e = this._option.selectionIcon) == null ? void 0 : e.color) ?? "red"), this._selectionIcon.updateSVG(((i = this._option.selectionIcon) == null ? void 0 : i.svg) ?? x.check), this._title.textContent = this._option.text ?? "Missing Text", this._itemIcon.updateColor(((s = this._option.icon) == null ? void 0 : s.color) ?? "red"), this._itemIcon.updateSVG(((o = this._option.icon) == null ? void 0 : o.svg) ?? x.inbox);
1682
2613
  }
1683
2614
  }
1684
- customElements.get("courier-inbox-filter-menu-item") || customElements.define("courier-inbox-filter-menu-item", yo);
1685
- class Be extends HTMLElement {
1686
- constructor(e, t, s, o, n) {
2615
+ customElements.get("courier-inbox-filter-menu-item") || customElements.define("courier-inbox-filter-menu-item", Do);
2616
+ class He extends HTMLElement {
2617
+ constructor(e, i, s, o, n) {
1687
2618
  super();
1688
2619
  // Theme
1689
2620
  a(this, "_themeSubscription");
@@ -1697,14 +2628,14 @@ class Be extends HTMLElement {
1697
2628
  a(this, "_menuButton");
1698
2629
  a(this, "_menu");
1699
2630
  a(this, "_style");
1700
- this._type = t, this._selectable = s, this._options = o, this._selectedIndex = 0, this._onMenuOpen = n;
1701
- const h = this.attachShadow({ mode: "open" });
1702
- this._menuButton = new Se(t === "filters" ? f.filter : f.overflow), this._menu = document.createElement("div"), this._menu.className = `menu ${t}`, this._style = document.createElement("style"), h.appendChild(this._style), h.appendChild(this._menuButton), h.appendChild(this._menu), this._menuButton.addEventListener("click", this.toggleMenu.bind(this)), document.addEventListener("click", this.handleOutsideClick.bind(this)), this._themeSubscription = e.subscribe((d) => {
2631
+ this._type = i, this._selectable = s, this._options = o, this._selectedIndex = 0, this._onMenuOpen = n;
2632
+ const c = this.attachShadow({ mode: "open" });
2633
+ this._menuButton = new $e(i === "filters" ? x.filter : x.overflow), this._menu = document.createElement("div"), this._menu.className = `menu ${i}`, this._style = document.createElement("style"), c.appendChild(this._style), c.appendChild(this._menuButton), c.appendChild(this._menu), this._menuButton.addEventListener("click", this.toggleMenu.bind(this)), document.addEventListener("click", this.handleOutsideClick.bind(this)), this._themeSubscription = e.subscribe((d) => {
1703
2634
  this.refreshTheme();
1704
2635
  }), this.refreshTheme();
1705
2636
  }
1706
2637
  getStyles() {
1707
- var t, s, o, n, h, d, c, u, m, p, x, _, b, v, k, w, S, E, M, I, T;
2638
+ var i, s, o, n, c, d, l, p, m, g, f, _, b, C, k, w, S, I, E, M, L;
1708
2639
  const e = this._themeSubscription.manager.getTheme();
1709
2640
  return `
1710
2641
  :host {
@@ -1717,10 +2648,10 @@ class Be extends HTMLElement {
1717
2648
  position: absolute;
1718
2649
  top: 42px;
1719
2650
  right: -6px;
1720
- border-radius: ${((n = (o = (s = (t = e.inbox) == null ? void 0 : t.header) == null ? void 0 : s.menus) == null ? void 0 : o.popup) == null ? void 0 : n.borderRadius) ?? "6px"};
1721
- border: ${((u = (c = (d = (h = e.inbox) == null ? void 0 : h.header) == null ? void 0 : d.menus) == null ? void 0 : c.popup) == null ? void 0 : u.border) ?? "1px solid red"};
1722
- background: ${((_ = (x = (p = (m = e.inbox) == null ? void 0 : m.header) == null ? void 0 : p.menus) == null ? void 0 : x.popup) == null ? void 0 : _.backgroundColor) ?? "red"};
1723
- box-shadow: ${((w = (k = (v = (b = e.inbox) == null ? void 0 : b.header) == null ? void 0 : v.menus) == null ? void 0 : k.popup) == null ? void 0 : w.shadow) ?? "0 4px 12px 0 red"};
2651
+ border-radius: ${((n = (o = (s = (i = e.inbox) == null ? void 0 : i.header) == null ? void 0 : s.menus) == null ? void 0 : o.popup) == null ? void 0 : n.borderRadius) ?? "6px"};
2652
+ border: ${((p = (l = (d = (c = e.inbox) == null ? void 0 : c.header) == null ? void 0 : d.menus) == null ? void 0 : l.popup) == null ? void 0 : p.border) ?? "1px solid red"};
2653
+ background: ${((_ = (f = (g = (m = e.inbox) == null ? void 0 : m.header) == null ? void 0 : g.menus) == null ? void 0 : f.popup) == null ? void 0 : _.backgroundColor) ?? "red"};
2654
+ box-shadow: ${((w = (k = (C = (b = e.inbox) == null ? void 0 : b.header) == null ? void 0 : C.menus) == null ? void 0 : k.popup) == null ? void 0 : w.shadow) ?? "0 4px 12px 0 red"};
1724
2655
  z-index: 1000;
1725
2656
  min-width: 200px;
1726
2657
  overflow: hidden;
@@ -1728,7 +2659,7 @@ class Be extends HTMLElement {
1728
2659
  }
1729
2660
 
1730
2661
  courier-inbox-filter-menu-item {
1731
- border-bottom: ${((T = (I = (M = (E = (S = e.inbox) == null ? void 0 : S.header) == null ? void 0 : E.menus) == null ? void 0 : M.popup) == null ? void 0 : I.list) == null ? void 0 : T.divider) ?? "none"};
2662
+ border-bottom: ${((L = (M = (E = (I = (S = e.inbox) == null ? void 0 : S.header) == null ? void 0 : I.menus) == null ? void 0 : E.popup) == null ? void 0 : M.list) == null ? void 0 : L.divider) ?? "none"};
1732
2663
  }
1733
2664
 
1734
2665
  courier-inbox-filter-menu-item:last-child {
@@ -1737,31 +2668,31 @@ class Be extends HTMLElement {
1737
2668
  `;
1738
2669
  }
1739
2670
  refreshTheme() {
1740
- var h, d, c, u, m, p;
2671
+ var c, d, l, p, m, g;
1741
2672
  this._style.textContent = this.getStyles();
1742
- const t = (d = (h = this._themeSubscription.manager.getTheme().inbox) == null ? void 0 : h.header) == null ? void 0 : d.menus, s = this._type === "filters", o = s ? (c = t == null ? void 0 : t.filters) == null ? void 0 : c.button : (u = t == null ? void 0 : t.actions) == null ? void 0 : u.button, n = s ? f.filter : f.overflow;
1743
- this._menuButton.updateIconSVG(((m = o == null ? void 0 : o.icon) == null ? void 0 : m.svg) ?? n), this._menuButton.updateIconColor(((p = o == null ? void 0 : o.icon) == null ? void 0 : p.color) ?? "red"), this._menuButton.updateBackgroundColor((o == null ? void 0 : o.backgroundColor) ?? "transparent"), this._menuButton.updateHoverBackgroundColor((o == null ? void 0 : o.hoverBackgroundColor) ?? "red"), this._menuButton.updateActiveBackgroundColor((o == null ? void 0 : o.activeBackgroundColor) ?? "red"), this.refreshMenuItems();
2673
+ const i = (d = (c = this._themeSubscription.manager.getTheme().inbox) == null ? void 0 : c.header) == null ? void 0 : d.menus, s = this._type === "filters", o = s ? (l = i == null ? void 0 : i.filters) == null ? void 0 : l.button : (p = i == null ? void 0 : i.actions) == null ? void 0 : p.button, n = s ? x.filter : x.overflow;
2674
+ this._menuButton.updateIconSVG(((m = o == null ? void 0 : o.icon) == null ? void 0 : m.svg) ?? n), this._menuButton.updateIconColor(((g = o == null ? void 0 : o.icon) == null ? void 0 : g.color) ?? "red"), this._menuButton.updateBackgroundColor((o == null ? void 0 : o.backgroundColor) ?? "transparent"), this._menuButton.updateHoverBackgroundColor((o == null ? void 0 : o.hoverBackgroundColor) ?? "red"), this._menuButton.updateActiveBackgroundColor((o == null ? void 0 : o.activeBackgroundColor) ?? "red"), this.refreshMenuItems();
1744
2675
  }
1745
2676
  setOptions(e) {
1746
2677
  this._options = e, this.refreshMenuItems();
1747
2678
  }
1748
2679
  refreshMenuItems() {
1749
- this._menu.innerHTML = "", this._options.forEach((e, t) => {
1750
- const s = new yo({
2680
+ this._menu.innerHTML = "", this._options.forEach((e, i) => {
2681
+ const s = new Do({
1751
2682
  option: e,
1752
2683
  selectable: this._selectable,
1753
- isSelected: this._selectedIndex === t,
2684
+ isSelected: this._selectedIndex === i,
1754
2685
  themeManager: this._themeSubscription.manager
1755
2686
  });
1756
2687
  s.addEventListener("click", () => {
1757
- this._selectedIndex = t, e.onClick(e), this.refreshMenuItems(), this.closeMenu();
2688
+ this._selectedIndex = i, e.onClick(e), this.refreshMenuItems(), this.closeMenu();
1758
2689
  }), this._menu.appendChild(s);
1759
2690
  });
1760
2691
  }
1761
2692
  toggleMenu(e) {
1762
2693
  e.stopPropagation();
1763
- const t = this._menu.style.display !== "block";
1764
- this._menu.style.display = t ? "block" : "none", t && this._onMenuOpen();
2694
+ const i = this._menu.style.display !== "block";
2695
+ this._menu.style.display = i ? "block" : "none", i && this._onMenuOpen();
1765
2696
  }
1766
2697
  handleOutsideClick(e) {
1767
2698
  this.contains(e.target) || this.closeMenu();
@@ -1770,14 +2701,14 @@ class Be extends HTMLElement {
1770
2701
  this._menu.style.display = "none";
1771
2702
  }
1772
2703
  selectOption(e) {
1773
- this._selectedIndex = this._options.findIndex((t) => t.id === e.id), this.refreshMenuItems();
2704
+ this._selectedIndex = this._options.findIndex((i) => i.id === e.id), this.refreshMenuItems();
1774
2705
  }
1775
2706
  disconnectedCallback() {
1776
2707
  this._themeSubscription.unsubscribe();
1777
2708
  }
1778
2709
  }
1779
- customElements.get("courier-inbox-option-menu") || customElements.define("courier-inbox-option-menu", Be);
1780
- class De extends HTMLElement {
2710
+ customElements.get("courier-inbox-option-menu") || customElements.define("courier-inbox-option-menu", He);
2711
+ class qe extends HTMLElement {
1781
2712
  constructor(e) {
1782
2713
  super();
1783
2714
  // Theme
@@ -1791,12 +2722,12 @@ class De extends HTMLElement {
1791
2722
  this._location = e.location, this._themeSubscription = e.themeBus.subscribe((s) => {
1792
2723
  this.refreshTheme(this._location);
1793
2724
  });
1794
- const t = this.attachShadow({ mode: "open" });
1795
- this._badge = document.createElement("span"), this._badge.className = "unread-badge", this._style = document.createElement("style"), this._style.textContent = this.getStyles(this._location), t.appendChild(this._style), t.appendChild(this._badge);
2725
+ const i = this.attachShadow({ mode: "open" });
2726
+ this._badge = document.createElement("span"), this._badge.className = "unread-badge", this._style = document.createElement("style"), this._style.textContent = this.getStyles(this._location), i.appendChild(this._style), i.appendChild(this._badge);
1796
2727
  }
1797
2728
  getStyles(e) {
1798
- var c, u, m, p, x, _, b;
1799
- const t = this._themeSubscription.manager.getTheme(), s = e === "button" ? (u = (c = t.popup) == null ? void 0 : c.button) == null ? void 0 : u.unreadIndicator : (x = (p = (m = t.inbox) == null ? void 0 : m.header) == null ? void 0 : p.filters) == null ? void 0 : x.unreadIndicator, o = s == null ? void 0 : s.backgroundColor, n = s == null ? void 0 : s.borderRadius, h = (_ = s == null ? void 0 : s.font) == null ? void 0 : _.color, d = (b = s == null ? void 0 : s.font) == null ? void 0 : b.size;
2729
+ var l, p, m, g, f, _, b;
2730
+ const i = this._themeSubscription.manager.getTheme(), s = e === "button" ? (p = (l = i.popup) == null ? void 0 : l.button) == null ? void 0 : p.unreadIndicator : (f = (g = (m = i.inbox) == null ? void 0 : m.header) == null ? void 0 : g.filters) == null ? void 0 : f.unreadIndicator, o = s == null ? void 0 : s.backgroundColor, n = s == null ? void 0 : s.borderRadius, c = (_ = s == null ? void 0 : s.font) == null ? void 0 : _.color, d = (b = s == null ? void 0 : s.font) == null ? void 0 : b.size;
1800
2731
  return `
1801
2732
  :host {
1802
2733
  display: inline-block;
@@ -1804,7 +2735,7 @@ class De extends HTMLElement {
1804
2735
 
1805
2736
  .unread-badge {
1806
2737
  background-color: ${o};
1807
- color: ${h};
2738
+ color: ${c};
1808
2739
  border-radius: ${n};
1809
2740
  padding: 4px 8px;
1810
2741
  font-size: ${d};
@@ -1827,9 +2758,9 @@ class De extends HTMLElement {
1827
2758
  this._themeSubscription.unsubscribe();
1828
2759
  }
1829
2760
  }
1830
- customElements.get("courier-unread-count-badge") || customElements.define("courier-unread-count-badge", De);
1831
- class ko extends HTMLElement {
1832
- constructor(e, t) {
2761
+ customElements.get("courier-unread-count-badge") || customElements.define("courier-unread-count-badge", qe);
2762
+ class Fo extends HTMLElement {
2763
+ constructor(e, i) {
1833
2764
  super();
1834
2765
  // Theme
1835
2766
  a(this, "_themeSubscription");
@@ -1842,9 +2773,9 @@ class ko extends HTMLElement {
1842
2773
  a(this, "_unreadBadge");
1843
2774
  a(this, "_container");
1844
2775
  a(this, "_style");
1845
- this._option = t;
2776
+ this._option = i;
1846
2777
  const s = this.attachShadow({ mode: "open" });
1847
- this._style = document.createElement("style"), this._container = document.createElement("div"), this._container.className = "title-section", this._iconElement = new ie(void 0, this._option.icon.svg), this._titleElement = document.createElement("h2"), this._unreadBadge = new De({
2778
+ this._style = document.createElement("style"), this._container = document.createElement("div"), this._container.className = "title-section", this._iconElement = new ne(void 0, this._option.icon.svg), this._titleElement = document.createElement("h2"), this._unreadBadge = new qe({
1848
2779
  themeBus: e,
1849
2780
  location: "header"
1850
2781
  }), this._container.appendChild(this._iconElement), this._container.appendChild(this._titleElement), this._container.appendChild(this._unreadBadge), s.appendChild(this._style), s.appendChild(this._container), this._themeSubscription = e.subscribe((o) => {
@@ -1852,7 +2783,7 @@ class ko extends HTMLElement {
1852
2783
  }), this.refreshTheme(this._feedType ?? "inbox");
1853
2784
  }
1854
2785
  getStyles() {
1855
- var t, s, o, n, h, d, c, u, m, p, x, _, b, v, k, w;
2786
+ var i, s, o, n, c, d, l, p, m, g, f, _, b, C, k, w;
1856
2787
  const e = this._themeSubscription.manager.getTheme();
1857
2788
  return `
1858
2789
  .title-section {
@@ -1869,10 +2800,10 @@ class ko extends HTMLElement {
1869
2800
 
1870
2801
  h2 {
1871
2802
  margin: 0;
1872
- font-family: ${((n = (o = (s = (t = e.inbox) == null ? void 0 : t.header) == null ? void 0 : s.filters) == null ? void 0 : o.font) == null ? void 0 : n.family) ?? "inherit"};
1873
- font-size: ${((u = (c = (d = (h = e.inbox) == null ? void 0 : h.header) == null ? void 0 : d.filters) == null ? void 0 : c.font) == null ? void 0 : u.size) ?? "18px"};
1874
- font-weight: ${((_ = (x = (p = (m = e.inbox) == null ? void 0 : m.header) == null ? void 0 : p.filters) == null ? void 0 : x.font) == null ? void 0 : _.weight) ?? "500"};
1875
- color: ${((w = (k = (v = (b = e.inbox) == null ? void 0 : b.header) == null ? void 0 : v.filters) == null ? void 0 : k.font) == null ? void 0 : w.color) ?? "red"};
2803
+ font-family: ${((n = (o = (s = (i = e.inbox) == null ? void 0 : i.header) == null ? void 0 : s.filters) == null ? void 0 : o.font) == null ? void 0 : n.family) ?? "inherit"};
2804
+ font-size: ${((p = (l = (d = (c = e.inbox) == null ? void 0 : c.header) == null ? void 0 : d.filters) == null ? void 0 : l.font) == null ? void 0 : p.size) ?? "18px"};
2805
+ font-weight: ${((_ = (f = (g = (m = e.inbox) == null ? void 0 : m.header) == null ? void 0 : g.filters) == null ? void 0 : f.font) == null ? void 0 : _.weight) ?? "500"};
2806
+ color: ${((w = (k = (C = (b = e.inbox) == null ? void 0 : b.header) == null ? void 0 : C.filters) == null ? void 0 : k.font) == null ? void 0 : w.color) ?? "red"};
1876
2807
  }
1877
2808
 
1878
2809
  courier-unread-count-badge {
@@ -1883,18 +2814,18 @@ class ko extends HTMLElement {
1883
2814
  refreshTheme(e) {
1884
2815
  this._feedType = e, this._style.textContent = this.getStyles(), this._unreadBadge.refreshTheme("header"), this.updateFilter();
1885
2816
  }
1886
- updateSelectedOption(e, t, s) {
1887
- this._option = e, this._feedType = t, this._unreadBadge.setCount(s), this.updateFilter();
2817
+ updateSelectedOption(e, i, s) {
2818
+ this._option = e, this._feedType = i, this._unreadBadge.setCount(s), this.updateFilter();
1888
2819
  }
1889
2820
  updateFilter() {
1890
- var t, s, o, n, h, d, c, u, m, p, x, _, b, v, k, w, S, E, M, I, T, $, D, y, B, F, H, R;
2821
+ var i, s, o, n, c, d, l, p, m, g, f, _, b, C, k, w, S, I, E, M, L, R, D, y, A, F, H, O;
1891
2822
  const e = this._themeSubscription.manager.getTheme();
1892
2823
  switch (this._feedType) {
1893
2824
  case "inbox":
1894
- this._titleElement.textContent = ((n = (o = (s = (t = e.inbox) == null ? void 0 : t.header) == null ? void 0 : s.filters) == null ? void 0 : o.inbox) == null ? void 0 : n.text) ?? "Inbox", this._iconElement.updateSVG(((m = (u = (c = (d = (h = e.inbox) == null ? void 0 : h.header) == null ? void 0 : d.filters) == null ? void 0 : c.inbox) == null ? void 0 : u.icon) == null ? void 0 : m.svg) ?? f.inbox), this._iconElement.updateColor(((v = (b = (_ = (x = (p = e.inbox) == null ? void 0 : p.header) == null ? void 0 : x.filters) == null ? void 0 : _.inbox) == null ? void 0 : b.icon) == null ? void 0 : v.color) ?? "red");
2825
+ this._titleElement.textContent = ((n = (o = (s = (i = e.inbox) == null ? void 0 : i.header) == null ? void 0 : s.filters) == null ? void 0 : o.inbox) == null ? void 0 : n.text) ?? "Inbox", this._iconElement.updateSVG(((m = (p = (l = (d = (c = e.inbox) == null ? void 0 : c.header) == null ? void 0 : d.filters) == null ? void 0 : l.inbox) == null ? void 0 : p.icon) == null ? void 0 : m.svg) ?? x.inbox), this._iconElement.updateColor(((C = (b = (_ = (f = (g = e.inbox) == null ? void 0 : g.header) == null ? void 0 : f.filters) == null ? void 0 : _.inbox) == null ? void 0 : b.icon) == null ? void 0 : C.color) ?? "red");
1895
2826
  break;
1896
2827
  case "archive":
1897
- this._titleElement.textContent = ((E = (S = (w = (k = e.inbox) == null ? void 0 : k.header) == null ? void 0 : w.filters) == null ? void 0 : S.archive) == null ? void 0 : E.text) ?? "Archive", this._iconElement.updateSVG(((D = ($ = (T = (I = (M = e.inbox) == null ? void 0 : M.header) == null ? void 0 : I.filters) == null ? void 0 : T.archive) == null ? void 0 : $.icon) == null ? void 0 : D.svg) ?? f.archive), this._iconElement.updateColor(((R = (H = (F = (B = (y = e.inbox) == null ? void 0 : y.header) == null ? void 0 : B.filters) == null ? void 0 : F.archive) == null ? void 0 : H.icon) == null ? void 0 : R.color) ?? "red");
2828
+ this._titleElement.textContent = ((I = (S = (w = (k = e.inbox) == null ? void 0 : k.header) == null ? void 0 : w.filters) == null ? void 0 : S.archive) == null ? void 0 : I.text) ?? "Archive", this._iconElement.updateSVG(((D = (R = (L = (M = (E = e.inbox) == null ? void 0 : E.header) == null ? void 0 : M.filters) == null ? void 0 : L.archive) == null ? void 0 : R.icon) == null ? void 0 : D.svg) ?? x.archive), this._iconElement.updateColor(((O = (H = (F = (A = (y = e.inbox) == null ? void 0 : y.header) == null ? void 0 : A.filters) == null ? void 0 : F.archive) == null ? void 0 : H.icon) == null ? void 0 : O.color) ?? "red");
1898
2829
  break;
1899
2830
  }
1900
2831
  }
@@ -1903,8 +2834,8 @@ class ko extends HTMLElement {
1903
2834
  this._themeSubscription.unsubscribe();
1904
2835
  }
1905
2836
  }
1906
- customElements.get("courier-inbox-header-title") || customElements.define("courier-inbox-header-title", ko);
1907
- class wo extends Le {
2837
+ customElements.get("courier-inbox-header-title") || customElements.define("courier-inbox-header-title", Fo);
2838
+ class Ho extends De {
1908
2839
  constructor(e) {
1909
2840
  super();
1910
2841
  // Theme
@@ -1919,86 +2850,86 @@ class wo extends Le {
1919
2850
  a(this, "_style");
1920
2851
  // Callbacks
1921
2852
  a(this, "_onFeedTypeChange");
1922
- this._themeSubscription = e.themeManager.subscribe((t) => {
2853
+ this._themeSubscription = e.themeManager.subscribe((i) => {
1923
2854
  this.refreshTheme();
1924
2855
  }), this._onFeedTypeChange = e.onFeedTypeChange;
1925
2856
  }
1926
2857
  // Menu options
1927
2858
  getFilterOptions() {
1928
- var s, o, n, h, d, c, u, m, p, x, _, b, v, k, w, S, E, M, I, T, $, D, y, B, F, H, R, z, O, N, U, V, Z, J, q, X, Y;
1929
- const e = this._themeSubscription.manager.getTheme(), t = (n = (o = (s = e.inbox) == null ? void 0 : s.header) == null ? void 0 : o.menus) == null ? void 0 : n.filters;
2859
+ var s, o, n, c, d, l, p, m, g, f, _, b, C, k, w, S, I, E, M, L, R, D, y, A, F, H, O, z, U, N, q, V, j, X, Q, Y, ee;
2860
+ const e = this._themeSubscription.manager.getTheme(), i = (n = (o = (s = e.inbox) == null ? void 0 : s.header) == null ? void 0 : o.menus) == null ? void 0 : n.filters;
1930
2861
  return [
1931
2862
  {
1932
2863
  id: "inbox",
1933
- text: ((h = t == null ? void 0 : t.inbox) == null ? void 0 : h.text) ?? "Inbox",
2864
+ text: ((c = i == null ? void 0 : i.inbox) == null ? void 0 : c.text) ?? "Inbox",
1934
2865
  icon: {
1935
- color: ((c = (d = t == null ? void 0 : t.inbox) == null ? void 0 : d.icon) == null ? void 0 : c.color) ?? "red",
1936
- svg: ((m = (u = t == null ? void 0 : t.inbox) == null ? void 0 : u.icon) == null ? void 0 : m.svg) ?? f.inbox
2866
+ color: ((l = (d = i == null ? void 0 : i.inbox) == null ? void 0 : d.icon) == null ? void 0 : l.color) ?? "red",
2867
+ svg: ((m = (p = i == null ? void 0 : i.inbox) == null ? void 0 : p.icon) == null ? void 0 : m.svg) ?? x.inbox
1937
2868
  },
1938
2869
  selectionIcon: {
1939
- color: ((k = (v = (b = (_ = (x = (p = e.inbox) == null ? void 0 : p.header) == null ? void 0 : x.menus) == null ? void 0 : _.popup) == null ? void 0 : b.list) == null ? void 0 : v.selectionIcon) == null ? void 0 : k.color) ?? "red",
1940
- svg: ((T = (I = (M = (E = (S = (w = e.inbox) == null ? void 0 : w.header) == null ? void 0 : S.menus) == null ? void 0 : E.popup) == null ? void 0 : M.list) == null ? void 0 : I.selectionIcon) == null ? void 0 : T.svg) ?? f.check
2870
+ color: ((k = (C = (b = (_ = (f = (g = e.inbox) == null ? void 0 : g.header) == null ? void 0 : f.menus) == null ? void 0 : _.popup) == null ? void 0 : b.list) == null ? void 0 : C.selectionIcon) == null ? void 0 : k.color) ?? "red",
2871
+ svg: ((L = (M = (E = (I = (S = (w = e.inbox) == null ? void 0 : w.header) == null ? void 0 : S.menus) == null ? void 0 : I.popup) == null ? void 0 : E.list) == null ? void 0 : M.selectionIcon) == null ? void 0 : L.svg) ?? x.check
1941
2872
  },
1942
- onClick: (j) => {
1943
- this.handleOptionMenuItemClick("inbox", j);
2873
+ onClick: (G) => {
2874
+ this.handleOptionMenuItemClick("inbox", G);
1944
2875
  }
1945
2876
  },
1946
2877
  {
1947
2878
  id: "archive",
1948
- text: (($ = t == null ? void 0 : t.archive) == null ? void 0 : $.text) ?? "Archive",
2879
+ text: ((R = i == null ? void 0 : i.archive) == null ? void 0 : R.text) ?? "Archive",
1949
2880
  icon: {
1950
- color: ((y = (D = t == null ? void 0 : t.archive) == null ? void 0 : D.icon) == null ? void 0 : y.color) ?? "red",
1951
- svg: ((F = (B = t == null ? void 0 : t.archive) == null ? void 0 : B.icon) == null ? void 0 : F.svg) ?? f.archive
2881
+ color: ((y = (D = i == null ? void 0 : i.archive) == null ? void 0 : D.icon) == null ? void 0 : y.color) ?? "red",
2882
+ svg: ((F = (A = i == null ? void 0 : i.archive) == null ? void 0 : A.icon) == null ? void 0 : F.svg) ?? x.archive
1952
2883
  },
1953
2884
  selectionIcon: {
1954
- color: ((U = (N = (O = (z = (R = (H = e.inbox) == null ? void 0 : H.header) == null ? void 0 : R.menus) == null ? void 0 : z.popup) == null ? void 0 : O.list) == null ? void 0 : N.selectionIcon) == null ? void 0 : U.color) ?? "red",
1955
- svg: ((Y = (X = (q = (J = (Z = (V = e.inbox) == null ? void 0 : V.header) == null ? void 0 : Z.menus) == null ? void 0 : J.popup) == null ? void 0 : q.list) == null ? void 0 : X.selectionIcon) == null ? void 0 : Y.svg) ?? f.check
2885
+ color: ((q = (N = (U = (z = (O = (H = e.inbox) == null ? void 0 : H.header) == null ? void 0 : O.menus) == null ? void 0 : z.popup) == null ? void 0 : U.list) == null ? void 0 : N.selectionIcon) == null ? void 0 : q.color) ?? "red",
2886
+ svg: ((ee = (Y = (Q = (X = (j = (V = e.inbox) == null ? void 0 : V.header) == null ? void 0 : j.menus) == null ? void 0 : X.popup) == null ? void 0 : Q.list) == null ? void 0 : Y.selectionIcon) == null ? void 0 : ee.svg) ?? x.check
1956
2887
  },
1957
- onClick: (j) => {
1958
- this.handleOptionMenuItemClick("archive", j);
2888
+ onClick: (G) => {
2889
+ this.handleOptionMenuItemClick("archive", G);
1959
2890
  }
1960
2891
  }
1961
2892
  ];
1962
2893
  }
1963
2894
  getActionOptions() {
1964
- var s, o, n, h, d, c, u, m, p, x, _, b, v, k, w, S, E, M;
1965
- const t = (n = (o = (s = this._themeSubscription.manager.getTheme().inbox) == null ? void 0 : s.header) == null ? void 0 : o.menus) == null ? void 0 : n.actions;
2895
+ var s, o, n, c, d, l, p, m, g, f, _, b, C, k, w, S, I, E;
2896
+ const i = (n = (o = (s = this._themeSubscription.manager.getTheme().inbox) == null ? void 0 : s.header) == null ? void 0 : o.menus) == null ? void 0 : n.actions;
1966
2897
  return [
1967
2898
  {
1968
2899
  id: "markAllRead",
1969
- text: ((h = t == null ? void 0 : t.markAllRead) == null ? void 0 : h.text) ?? "Mark All as Read",
2900
+ text: ((c = i == null ? void 0 : i.markAllRead) == null ? void 0 : c.text) ?? "Mark All as Read",
1970
2901
  icon: {
1971
- color: ((c = (d = t == null ? void 0 : t.markAllRead) == null ? void 0 : d.icon) == null ? void 0 : c.color) ?? "red",
1972
- svg: ((m = (u = t == null ? void 0 : t.markAllRead) == null ? void 0 : u.icon) == null ? void 0 : m.svg) ?? f.inbox
2902
+ color: ((l = (d = i == null ? void 0 : i.markAllRead) == null ? void 0 : d.icon) == null ? void 0 : l.color) ?? "red",
2903
+ svg: ((m = (p = i == null ? void 0 : i.markAllRead) == null ? void 0 : p.icon) == null ? void 0 : m.svg) ?? x.inbox
1973
2904
  },
1974
2905
  selectionIcon: null,
1975
- onClick: (I) => {
1976
- A.shared.readAllMessages();
2906
+ onClick: (M) => {
2907
+ P.shared.readAllMessages({ canCallApi: !0 });
1977
2908
  }
1978
2909
  },
1979
2910
  {
1980
2911
  id: "archiveAll",
1981
- text: ((p = t == null ? void 0 : t.archiveAll) == null ? void 0 : p.text) ?? "Archive All",
2912
+ text: ((g = i == null ? void 0 : i.archiveAll) == null ? void 0 : g.text) ?? "Archive All",
1982
2913
  icon: {
1983
- color: ((_ = (x = t == null ? void 0 : t.archiveAll) == null ? void 0 : x.icon) == null ? void 0 : _.color) ?? "red",
1984
- svg: ((v = (b = t == null ? void 0 : t.archiveAll) == null ? void 0 : b.icon) == null ? void 0 : v.svg) ?? f.archive
2914
+ color: ((_ = (f = i == null ? void 0 : i.archiveAll) == null ? void 0 : f.icon) == null ? void 0 : _.color) ?? "red",
2915
+ svg: ((C = (b = i == null ? void 0 : i.archiveAll) == null ? void 0 : b.icon) == null ? void 0 : C.svg) ?? x.archive
1985
2916
  },
1986
2917
  selectionIcon: null,
1987
- onClick: (I) => {
1988
- var T;
1989
- alert(JSON.stringify((T = C.shared.client) == null ? void 0 : T.options));
2918
+ onClick: (M) => {
2919
+ var L;
2920
+ alert(JSON.stringify((L = v.shared.client) == null ? void 0 : L.options));
1990
2921
  }
1991
2922
  },
1992
2923
  {
1993
2924
  id: "archiveRead",
1994
- text: ((k = t == null ? void 0 : t.archiveRead) == null ? void 0 : k.text) ?? "Archive Read",
2925
+ text: ((k = i == null ? void 0 : i.archiveRead) == null ? void 0 : k.text) ?? "Archive Read",
1995
2926
  icon: {
1996
- color: ((S = (w = t == null ? void 0 : t.archiveRead) == null ? void 0 : w.icon) == null ? void 0 : S.color) ?? "red",
1997
- svg: ((M = (E = t == null ? void 0 : t.archiveRead) == null ? void 0 : E.icon) == null ? void 0 : M.svg) ?? f.archive
2927
+ color: ((S = (w = i == null ? void 0 : i.archiveRead) == null ? void 0 : w.icon) == null ? void 0 : S.color) ?? "red",
2928
+ svg: ((E = (I = i == null ? void 0 : i.archiveRead) == null ? void 0 : I.icon) == null ? void 0 : E.svg) ?? x.archive
1998
2929
  },
1999
2930
  selectionIcon: null,
2000
- onClick: (I) => {
2001
- alert("TODO: Archive read messages");
2931
+ onClick: (M) => {
2932
+ P.shared.archiveReadMessages({ canCallApi: !0 });
2002
2933
  }
2003
2934
  }
2004
2935
  ];
@@ -2007,40 +2938,40 @@ class wo extends Le {
2007
2938
  return ["icon", "title", "feed-type"];
2008
2939
  }
2009
2940
  refreshTheme() {
2010
- var s, o, n, h, d, c, u;
2011
- const e = this._themeSubscription.manager.getTheme(), t = (s = this.shadow) == null ? void 0 : s.querySelector(".courier-inbox-header");
2012
- t && (t.style.backgroundColor = ((n = (o = e.inbox) == null ? void 0 : o.header) == null ? void 0 : n.backgroundColor) ?? r.white[500], t.style.boxShadow = ((d = (h = e.inbox) == null ? void 0 : h.header) == null ? void 0 : d.shadow) ?? `0px 1px 0px 0px ${r.gray[500]}`), (c = this._filterMenu) == null || c.setOptions(this.getFilterOptions()), (u = this._actionMenu) == null || u.setOptions(this.getActionOptions());
2941
+ var s, o, n, c, d, l, p;
2942
+ const e = this._themeSubscription.manager.getTheme(), i = (s = this.shadow) == null ? void 0 : s.querySelector(".courier-inbox-header");
2943
+ i && (i.style.backgroundColor = ((n = (o = e.inbox) == null ? void 0 : o.header) == null ? void 0 : n.backgroundColor) ?? r.white[500], i.style.boxShadow = ((d = (c = e.inbox) == null ? void 0 : c.header) == null ? void 0 : d.shadow) ?? `0px 1px 0px 0px ${r.gray[500]}`), (l = this._filterMenu) == null || l.setOptions(this.getFilterOptions()), (p = this._actionMenu) == null || p.setOptions(this.getActionOptions());
2013
2944
  }
2014
- handleOptionMenuItemClick(e, t) {
2015
- this._feedType = e, this._titleSection && this._titleSection.updateSelectedOption(t, this._feedType, this._feedType === "inbox" ? this._unreadCount : 0), this._onFeedTypeChange(e);
2945
+ handleOptionMenuItemClick(e, i) {
2946
+ this._feedType = e, this._titleSection && this._titleSection.updateSelectedOption(i, this._feedType, this._feedType === "inbox" ? this._unreadCount : 0), this._onFeedTypeChange(e);
2016
2947
  }
2017
2948
  render(e) {
2018
2949
  this._feedType = e.feedType, this._unreadCount = e.unreadCount, this.refreshTitleSection();
2019
2950
  }
2020
2951
  refreshTitleSection() {
2021
- var t, s;
2952
+ var i, s;
2022
2953
  const e = this.getFilterOptions().find((o) => ["inbox", "archive"].includes(o.id) && o.id === this._feedType);
2023
- e && ((t = this._titleSection) == null || t.updateSelectedOption(e, this._feedType, this._feedType === "inbox" ? this._unreadCount : 0), (s = this._filterMenu) == null || s.selectOption(e));
2954
+ e && ((i = this._titleSection) == null || i.updateSelectedOption(e, this._feedType, this._feedType === "inbox" ? this._unreadCount : 0), (s = this._filterMenu) == null || s.selectOption(e));
2024
2955
  }
2025
2956
  build(e) {
2026
- var t;
2027
- super.build(e), this._style = document.createElement("style"), this._style.textContent = this.getStyles(), (t = this.shadow) == null || t.appendChild(this._style), this.refreshTheme();
2957
+ var i;
2958
+ super.build(e), this._style = document.createElement("style"), this._style.textContent = this.getStyles(), (i = this.shadow) == null || i.appendChild(this._style), this.refreshTheme();
2028
2959
  }
2029
2960
  defaultElement() {
2030
2961
  const e = this.getFilterOptions();
2031
- this._titleSection = new ko(this._themeSubscription.manager, e[0]), this._filterMenu = new Be(this._themeSubscription.manager, "filters", !0, e, () => {
2962
+ this._titleSection = new Fo(this._themeSubscription.manager, e[0]), this._filterMenu = new He(this._themeSubscription.manager, "filters", !0, e, () => {
2032
2963
  var n;
2033
2964
  (n = this._actionMenu) == null || n.closeMenu();
2034
- }), this._actionMenu = new Be(this._themeSubscription.manager, "actions", !1, this.getActionOptions(), () => {
2965
+ }), this._actionMenu = new He(this._themeSubscription.manager, "actions", !1, this.getActionOptions(), () => {
2035
2966
  var n;
2036
2967
  (n = this._filterMenu) == null || n.closeMenu();
2037
2968
  }), this._filterMenu.selectOption(e[0]);
2038
- const t = document.createElement("div");
2039
- t.className = "spacer";
2969
+ const i = document.createElement("div");
2970
+ i.className = "spacer";
2040
2971
  const s = document.createElement("div");
2041
2972
  s.className = "actions", s.appendChild(this._filterMenu), s.appendChild(this._actionMenu);
2042
2973
  const o = document.createElement("div");
2043
- return o.className = "courier-inbox-header", o.appendChild(this._titleSection), o.appendChild(t), o.appendChild(s), o;
2974
+ return o.className = "courier-inbox-header", o.appendChild(this._titleSection), o.appendChild(i), o.appendChild(s), o;
2044
2975
  }
2045
2976
  getStyles() {
2046
2977
  return `
@@ -2079,22 +3010,22 @@ class wo extends Le {
2079
3010
  this._themeSubscription.unsubscribe();
2080
3011
  }
2081
3012
  }
2082
- customElements.get("courier-inbox-header") || customElements.define("courier-inbox-header", wo);
2083
- class So {
2084
- constructor(i) {
3013
+ customElements.get("courier-inbox-header") || customElements.define("courier-inbox-header", Ho);
3014
+ class Oo {
3015
+ constructor(t) {
2085
3016
  a(this, "events");
2086
- this.events = i;
3017
+ this.events = t;
2087
3018
  }
2088
3019
  remove() {
2089
- A.shared.removeDataStoreListener(this);
3020
+ P.shared.removeDataStoreListener(this);
2090
3021
  }
2091
3022
  }
2092
- const we = {
3023
+ const Te = {
2093
3024
  popup: {
2094
3025
  button: {
2095
3026
  icon: {
2096
3027
  color: r.black[500],
2097
- svg: f.inbox
3028
+ svg: x.inbox
2098
3029
  },
2099
3030
  backgroundColor: "transparent",
2100
3031
  hoverBackgroundColor: r.black[50010],
@@ -2130,14 +3061,14 @@ const we = {
2130
3061
  inbox: {
2131
3062
  icon: {
2132
3063
  color: r.black[500],
2133
- svg: f.inbox
3064
+ svg: x.inbox
2134
3065
  },
2135
3066
  text: "Inbox"
2136
3067
  },
2137
3068
  archive: {
2138
3069
  icon: {
2139
3070
  color: r.black[500],
2140
- svg: f.archive
3071
+ svg: x.archive
2141
3072
  },
2142
3073
  text: "Archive"
2143
3074
  },
@@ -2168,7 +3099,7 @@ const we = {
2168
3099
  },
2169
3100
  selectionIcon: {
2170
3101
  color: r.black[500],
2171
- svg: f.check
3102
+ svg: x.check
2172
3103
  }
2173
3104
  }
2174
3105
  },
@@ -2176,7 +3107,7 @@ const we = {
2176
3107
  button: {
2177
3108
  icon: {
2178
3109
  color: r.black[500],
2179
- svg: f.filter
3110
+ svg: x.filter
2180
3111
  },
2181
3112
  backgroundColor: "transparent",
2182
3113
  hoverBackgroundColor: r.black[50010],
@@ -2185,14 +3116,14 @@ const we = {
2185
3116
  inbox: {
2186
3117
  icon: {
2187
3118
  color: r.black[500],
2188
- svg: f.inbox
3119
+ svg: x.inbox
2189
3120
  },
2190
3121
  text: "Inbox"
2191
3122
  },
2192
3123
  archive: {
2193
3124
  icon: {
2194
3125
  color: r.black[500],
2195
- svg: f.archive
3126
+ svg: x.archive
2196
3127
  },
2197
3128
  text: "Archive"
2198
3129
  }
@@ -2201,7 +3132,7 @@ const we = {
2201
3132
  button: {
2202
3133
  icon: {
2203
3134
  color: r.black[500],
2204
- svg: f.overflow
3135
+ svg: x.overflow
2205
3136
  },
2206
3137
  backgroundColor: "transparent",
2207
3138
  hoverBackgroundColor: r.black[50010],
@@ -2210,21 +3141,21 @@ const we = {
2210
3141
  markAllRead: {
2211
3142
  icon: {
2212
3143
  color: r.black[500],
2213
- svg: f.read
3144
+ svg: x.read
2214
3145
  },
2215
3146
  text: "Mark All as Read"
2216
3147
  },
2217
3148
  archiveAll: {
2218
3149
  icon: {
2219
3150
  color: r.black[500],
2220
- svg: f.archive
3151
+ svg: x.archive
2221
3152
  },
2222
3153
  text: "Archive All"
2223
3154
  },
2224
3155
  archiveRead: {
2225
3156
  icon: {
2226
3157
  color: r.black[500],
2227
- svg: f.archiveRead
3158
+ svg: x.archiveRead
2228
3159
  },
2229
3160
  text: "Archive Read"
2230
3161
  }
@@ -2283,19 +3214,19 @@ const we = {
2283
3214
  borderRadius: "0px",
2284
3215
  read: {
2285
3216
  color: r.black[500],
2286
- svg: f.read
3217
+ svg: x.read
2287
3218
  },
2288
3219
  unread: {
2289
3220
  color: r.black[500],
2290
- svg: f.unread
3221
+ svg: x.unread
2291
3222
  },
2292
3223
  archive: {
2293
3224
  color: r.black[500],
2294
- svg: f.archive
3225
+ svg: x.archive
2295
3226
  },
2296
3227
  unarchive: {
2297
3228
  color: r.black[500],
2298
- svg: f.unarchive
3229
+ svg: x.unarchive
2299
3230
  }
2300
3231
  }
2301
3232
  }
@@ -2335,12 +3266,12 @@ const we = {
2335
3266
  }
2336
3267
  }
2337
3268
  }
2338
- }, Ae = {
3269
+ }, Oe = {
2339
3270
  popup: {
2340
3271
  button: {
2341
3272
  icon: {
2342
3273
  color: r.white[500],
2343
- svg: f.inbox
3274
+ svg: x.inbox
2344
3275
  },
2345
3276
  backgroundColor: "transparent",
2346
3277
  hoverBackgroundColor: r.white[50010],
@@ -2376,14 +3307,14 @@ const we = {
2376
3307
  inbox: {
2377
3308
  icon: {
2378
3309
  color: r.white[500],
2379
- svg: f.inbox
3310
+ svg: x.inbox
2380
3311
  },
2381
3312
  text: "Inbox"
2382
3313
  },
2383
3314
  archive: {
2384
3315
  icon: {
2385
3316
  color: r.white[500],
2386
- svg: f.archive
3317
+ svg: x.archive
2387
3318
  },
2388
3319
  text: "Archive"
2389
3320
  },
@@ -2414,7 +3345,7 @@ const we = {
2414
3345
  },
2415
3346
  selectionIcon: {
2416
3347
  color: r.white[500],
2417
- svg: f.check
3348
+ svg: x.check
2418
3349
  }
2419
3350
  }
2420
3351
  },
@@ -2422,7 +3353,7 @@ const we = {
2422
3353
  button: {
2423
3354
  icon: {
2424
3355
  color: r.white[500],
2425
- svg: f.filter
3356
+ svg: x.filter
2426
3357
  },
2427
3358
  backgroundColor: "transparent",
2428
3359
  hoverBackgroundColor: r.white[50010],
@@ -2431,14 +3362,14 @@ const we = {
2431
3362
  inbox: {
2432
3363
  icon: {
2433
3364
  color: r.white[500],
2434
- svg: f.inbox
3365
+ svg: x.inbox
2435
3366
  },
2436
3367
  text: "Inbox"
2437
3368
  },
2438
3369
  archive: {
2439
3370
  icon: {
2440
3371
  color: r.white[500],
2441
- svg: f.archive
3372
+ svg: x.archive
2442
3373
  },
2443
3374
  text: "Archive"
2444
3375
  }
@@ -2447,7 +3378,7 @@ const we = {
2447
3378
  button: {
2448
3379
  icon: {
2449
3380
  color: r.white[500],
2450
- svg: f.overflow
3381
+ svg: x.overflow
2451
3382
  },
2452
3383
  backgroundColor: "transparent",
2453
3384
  hoverBackgroundColor: r.white[50010],
@@ -2456,21 +3387,21 @@ const we = {
2456
3387
  markAllRead: {
2457
3388
  icon: {
2458
3389
  color: r.white[500],
2459
- svg: f.read
3390
+ svg: x.read
2460
3391
  },
2461
3392
  text: "Mark All as Read"
2462
3393
  },
2463
3394
  archiveAll: {
2464
3395
  icon: {
2465
3396
  color: r.white[500],
2466
- svg: f.archive
3397
+ svg: x.archive
2467
3398
  },
2468
3399
  text: "Archive All"
2469
3400
  },
2470
3401
  archiveRead: {
2471
3402
  icon: {
2472
3403
  color: r.white[500],
2473
- svg: f.archiveRead
3404
+ svg: x.archiveRead
2474
3405
  },
2475
3406
  text: "Archive Read"
2476
3407
  }
@@ -2529,19 +3460,19 @@ const we = {
2529
3460
  borderRadius: "0px",
2530
3461
  read: {
2531
3462
  color: r.white[500],
2532
- svg: f.read
3463
+ svg: x.read
2533
3464
  },
2534
3465
  unread: {
2535
3466
  color: r.white[500],
2536
- svg: f.unread
3467
+ svg: x.unread
2537
3468
  },
2538
3469
  archive: {
2539
3470
  color: r.white[500],
2540
- svg: f.archive
3471
+ svg: x.archive
2541
3472
  },
2542
3473
  unarchive: {
2543
3474
  color: r.white[500],
2544
- svg: f.unarchive
3475
+ svg: x.unarchive
2545
3476
  }
2546
3477
  }
2547
3478
  }
@@ -2581,195 +3512,195 @@ const we = {
2581
3512
  }
2582
3513
  }
2583
3514
  }
2584
- }, Do = (g, i) => {
2585
- var t, s, o, n, h, d, c, u, m, p, x, _, b, v, k, w, S, E, M, I, T, $, D, y, B, F, H, R, z, O, N, U, V, Z, J, q, X, Y, j, se, oe, ne, re, ae, he, ce, le, de, ue, pe, ge, me, be, _e, xe, fe, Ce, ve, ye, l, P, K, Q, W, ke, Fe, He, Re, ze, Oe, Ne, Ue, Ve, Ze, We, je, Ge, Je, qe, Xe, Ye, Ke, Qe, et, tt, it, st, ot, nt, rt, at, ht, ct, lt, dt, ut, pt, gt, mt, bt, _t, xt, ft, Ct, vt, yt, kt, wt, St, Et, Mt, It, Lt, Tt, Bt, At, Pt, $t, Dt, Ft, Ht, Rt, zt, Ot, Nt, Ut, Vt, Zt, Wt, jt, Gt, Jt, qt, Xt, Yt, Kt, Qt, ei, ti, ii, si, oi, ni, ri, ai, hi, ci, li, di, ui, pi, gi, mi, bi, _i, xi, fi, Ci, vi, yi, ki, wi, Si, Ei, Mi, Ii, Li, Ti, Bi, Ai, Pi, $i, Di, Fi, Hi, Ri, zi, Oi, Ni, Ui, Vi, Zi, Wi, ji, Gi, Ji, qi, Xi, Yi, Ki, Qi, es, ts, is, ss, os, ns, rs, as, hs, cs, ls, ds, us, ps, gs, ms, bs, _s, xs, fs, Cs, vs, ys, ks, ws, Ss, Es, Ms, Is, Ls, Ts, Bs, As, Ps, $s, Ds, Fs, Hs, Rs, zs, Os, Ns, Us, Vs, Zs, Ws, js, Gs, Js, qs, Xs, Ys, Ks, Qs, eo, to, io, so, oo, no, ro, ao, ho, co, lo, uo, po;
2586
- const e = g === "light" ? we : Ae;
3515
+ }, dn = (h, t) => {
3516
+ var i, s, o, n, c, d, l, p, m, g, f, _, b, C, k, w, S, I, E, M, L, R, D, y, A, F, H, O, z, U, N, q, V, j, X, Q, Y, ee, G, ae, he, ce, le, de, ue, pe, ge, me, be, _e, fe, xe, ve, Ce, ye, ke, we, Se, Ie, u, B, te, ie, J, Ee, Ve, je, Ze, Je, Ge, We, Ke, Xe, Qe, Ye, et, tt, it, st, ot, nt, rt, at, ht, ct, lt, dt, ut, pt, gt, mt, bt, _t, ft, xt, vt, Ct, yt, kt, wt, St, It, Et, Mt, Tt, $t, Lt, At, Pt, Bt, Rt, Dt, Ft, Ht, Ot, zt, Ut, Nt, qt, Vt, jt, Zt, Jt, Gt, Wt, Kt, Xt, Qt, Yt, ei, ti, ii, si, oi, ni, ri, ai, hi, ci, li, di, ui, pi, gi, mi, bi, _i, fi, xi, vi, Ci, yi, ki, wi, Si, Ii, Ei, Mi, Ti, $i, Li, Ai, Pi, Bi, Ri, Di, Fi, Hi, Oi, zi, Ui, Ni, qi, Vi, ji, Zi, Ji, Gi, Wi, Ki, Xi, Qi, Yi, es, ts, is, ss, os, ns, rs, as, hs, cs, ls, ds, us, ps, gs, ms, bs, _s, fs, xs, vs, Cs, ys, ks, ws, Ss, Is, Es, Ms, Ts, $s, Ls, As, Ps, Bs, Rs, Ds, Fs, Hs, Os, zs, Us, Ns, qs, Vs, js, Zs, Js, Gs, Ws, Ks, Xs, Qs, Ys, eo, to, io, so, oo, no, ro, ao, ho, co, lo, uo, po, go, mo, bo, _o, fo, xo, vo, Co;
3517
+ const e = h === "light" ? Te : Oe;
2587
3518
  return {
2588
3519
  popup: {
2589
3520
  button: {
2590
- ...(t = e.popup) == null ? void 0 : t.button,
2591
- ...(s = i.popup) == null ? void 0 : s.button,
3521
+ ...(i = e.popup) == null ? void 0 : i.button,
3522
+ ...(s = t.popup) == null ? void 0 : s.button,
2592
3523
  icon: {
2593
3524
  ...(n = (o = e.popup) == null ? void 0 : o.button) == null ? void 0 : n.icon,
2594
- ...(d = (h = i.popup) == null ? void 0 : h.button) == null ? void 0 : d.icon
3525
+ ...(d = (c = t.popup) == null ? void 0 : c.button) == null ? void 0 : d.icon
2595
3526
  },
2596
3527
  unreadIndicator: {
2597
- ...(u = (c = e.popup) == null ? void 0 : c.button) == null ? void 0 : u.unreadIndicator,
2598
- ...(p = (m = i.popup) == null ? void 0 : m.button) == null ? void 0 : p.unreadIndicator
3528
+ ...(p = (l = e.popup) == null ? void 0 : l.button) == null ? void 0 : p.unreadIndicator,
3529
+ ...(g = (m = t.popup) == null ? void 0 : m.button) == null ? void 0 : g.unreadIndicator
2599
3530
  }
2600
3531
  },
2601
3532
  window: {
2602
- ...(x = e.popup) == null ? void 0 : x.window,
2603
- ...(_ = i.popup) == null ? void 0 : _.window
3533
+ ...(f = e.popup) == null ? void 0 : f.window,
3534
+ ...(_ = t.popup) == null ? void 0 : _.window
2604
3535
  }
2605
3536
  },
2606
3537
  inbox: {
2607
3538
  header: {
2608
3539
  ...(b = e.inbox) == null ? void 0 : b.header,
2609
- ...(v = i.inbox) == null ? void 0 : v.header,
3540
+ ...(C = t.inbox) == null ? void 0 : C.header,
2610
3541
  filters: {
2611
3542
  ...(w = (k = e.inbox) == null ? void 0 : k.header) == null ? void 0 : w.filters,
2612
- ...(E = (S = i.inbox) == null ? void 0 : S.header) == null ? void 0 : E.filters,
3543
+ ...(I = (S = t.inbox) == null ? void 0 : S.header) == null ? void 0 : I.filters,
2613
3544
  inbox: {
2614
- ...(T = (I = (M = e.inbox) == null ? void 0 : M.header) == null ? void 0 : I.filters) == null ? void 0 : T.inbox,
2615
- ...(y = (D = ($ = i.inbox) == null ? void 0 : $.header) == null ? void 0 : D.filters) == null ? void 0 : y.inbox,
3545
+ ...(L = (M = (E = e.inbox) == null ? void 0 : E.header) == null ? void 0 : M.filters) == null ? void 0 : L.inbox,
3546
+ ...(y = (D = (R = t.inbox) == null ? void 0 : R.header) == null ? void 0 : D.filters) == null ? void 0 : y.inbox,
2616
3547
  icon: {
2617
- ...(R = (H = (F = (B = e.inbox) == null ? void 0 : B.header) == null ? void 0 : F.filters) == null ? void 0 : H.inbox) == null ? void 0 : R.icon,
2618
- ...(U = (N = (O = (z = i.inbox) == null ? void 0 : z.header) == null ? void 0 : O.filters) == null ? void 0 : N.inbox) == null ? void 0 : U.icon
3548
+ ...(O = (H = (F = (A = e.inbox) == null ? void 0 : A.header) == null ? void 0 : F.filters) == null ? void 0 : H.inbox) == null ? void 0 : O.icon,
3549
+ ...(q = (N = (U = (z = t.inbox) == null ? void 0 : z.header) == null ? void 0 : U.filters) == null ? void 0 : N.inbox) == null ? void 0 : q.icon
2619
3550
  }
2620
3551
  },
2621
3552
  archive: {
2622
- ...(J = (Z = (V = e.inbox) == null ? void 0 : V.header) == null ? void 0 : Z.filters) == null ? void 0 : J.archive,
2623
- ...(Y = (X = (q = i.inbox) == null ? void 0 : q.header) == null ? void 0 : X.filters) == null ? void 0 : Y.archive,
3553
+ ...(X = (j = (V = e.inbox) == null ? void 0 : V.header) == null ? void 0 : j.filters) == null ? void 0 : X.archive,
3554
+ ...(ee = (Y = (Q = t.inbox) == null ? void 0 : Q.header) == null ? void 0 : Y.filters) == null ? void 0 : ee.archive,
2624
3555
  icon: {
2625
- ...(ne = (oe = (se = (j = e.inbox) == null ? void 0 : j.header) == null ? void 0 : se.filters) == null ? void 0 : oe.archive) == null ? void 0 : ne.icon,
2626
- ...(ce = (he = (ae = (re = i.inbox) == null ? void 0 : re.header) == null ? void 0 : ae.filters) == null ? void 0 : he.archive) == null ? void 0 : ce.icon
3556
+ ...(ce = (he = (ae = (G = e.inbox) == null ? void 0 : G.header) == null ? void 0 : ae.filters) == null ? void 0 : he.archive) == null ? void 0 : ce.icon,
3557
+ ...(pe = (ue = (de = (le = t.inbox) == null ? void 0 : le.header) == null ? void 0 : de.filters) == null ? void 0 : ue.archive) == null ? void 0 : pe.icon
2627
3558
  }
2628
3559
  },
2629
3560
  unreadIndicator: {
2630
- ...(ue = (de = (le = e.inbox) == null ? void 0 : le.header) == null ? void 0 : de.filters) == null ? void 0 : ue.unreadIndicator,
2631
- ...(me = (ge = (pe = i.inbox) == null ? void 0 : pe.header) == null ? void 0 : ge.filters) == null ? void 0 : me.unreadIndicator
3561
+ ...(be = (me = (ge = e.inbox) == null ? void 0 : ge.header) == null ? void 0 : me.filters) == null ? void 0 : be.unreadIndicator,
3562
+ ...(xe = (fe = (_e = t.inbox) == null ? void 0 : _e.header) == null ? void 0 : fe.filters) == null ? void 0 : xe.unreadIndicator
2632
3563
  }
2633
3564
  },
2634
3565
  menus: {
2635
- ...(_e = (be = e.inbox) == null ? void 0 : be.header) == null ? void 0 : _e.menus,
2636
- ...(fe = (xe = i.inbox) == null ? void 0 : xe.header) == null ? void 0 : fe.menus,
3566
+ ...(Ce = (ve = e.inbox) == null ? void 0 : ve.header) == null ? void 0 : Ce.menus,
3567
+ ...(ke = (ye = t.inbox) == null ? void 0 : ye.header) == null ? void 0 : ke.menus,
2637
3568
  popup: {
2638
- ...(ye = (ve = (Ce = e.inbox) == null ? void 0 : Ce.header) == null ? void 0 : ve.menus) == null ? void 0 : ye.popup,
2639
- ...(K = (P = (l = i.inbox) == null ? void 0 : l.header) == null ? void 0 : P.menus) == null ? void 0 : K.popup,
3569
+ ...(Ie = (Se = (we = e.inbox) == null ? void 0 : we.header) == null ? void 0 : Se.menus) == null ? void 0 : Ie.popup,
3570
+ ...(te = (B = (u = t.inbox) == null ? void 0 : u.header) == null ? void 0 : B.menus) == null ? void 0 : te.popup,
2640
3571
  list: {
2641
- ...(Fe = (ke = (W = (Q = e.inbox) == null ? void 0 : Q.header) == null ? void 0 : W.menus) == null ? void 0 : ke.popup) == null ? void 0 : Fe.list,
2642
- ...(Oe = (ze = (Re = (He = i.inbox) == null ? void 0 : He.header) == null ? void 0 : Re.menus) == null ? void 0 : ze.popup) == null ? void 0 : Oe.list,
3572
+ ...(Ve = (Ee = (J = (ie = e.inbox) == null ? void 0 : ie.header) == null ? void 0 : J.menus) == null ? void 0 : Ee.popup) == null ? void 0 : Ve.list,
3573
+ ...(Ge = (Je = (Ze = (je = t.inbox) == null ? void 0 : je.header) == null ? void 0 : Ze.menus) == null ? void 0 : Je.popup) == null ? void 0 : Ge.list,
2643
3574
  font: {
2644
- ...(We = (Ze = (Ve = (Ue = (Ne = e.inbox) == null ? void 0 : Ne.header) == null ? void 0 : Ue.menus) == null ? void 0 : Ve.popup) == null ? void 0 : Ze.list) == null ? void 0 : We.font,
2645
- ...(Xe = (qe = (Je = (Ge = (je = i.inbox) == null ? void 0 : je.header) == null ? void 0 : Ge.menus) == null ? void 0 : Je.popup) == null ? void 0 : qe.list) == null ? void 0 : Xe.font
3575
+ ...(Ye = (Qe = (Xe = (Ke = (We = e.inbox) == null ? void 0 : We.header) == null ? void 0 : Ke.menus) == null ? void 0 : Xe.popup) == null ? void 0 : Qe.list) == null ? void 0 : Ye.font,
3576
+ ...(ot = (st = (it = (tt = (et = t.inbox) == null ? void 0 : et.header) == null ? void 0 : tt.menus) == null ? void 0 : it.popup) == null ? void 0 : st.list) == null ? void 0 : ot.font
2646
3577
  },
2647
3578
  selectionIcon: {
2648
- ...(tt = (et = (Qe = (Ke = (Ye = e.inbox) == null ? void 0 : Ye.header) == null ? void 0 : Ke.menus) == null ? void 0 : Qe.popup) == null ? void 0 : et.list) == null ? void 0 : tt.selectionIcon,
2649
- ...(rt = (nt = (ot = (st = (it = i.inbox) == null ? void 0 : it.header) == null ? void 0 : st.menus) == null ? void 0 : ot.popup) == null ? void 0 : nt.list) == null ? void 0 : rt.selectionIcon
3579
+ ...(ct = (ht = (at = (rt = (nt = e.inbox) == null ? void 0 : nt.header) == null ? void 0 : rt.menus) == null ? void 0 : at.popup) == null ? void 0 : ht.list) == null ? void 0 : ct.selectionIcon,
3580
+ ...(gt = (pt = (ut = (dt = (lt = t.inbox) == null ? void 0 : lt.header) == null ? void 0 : dt.menus) == null ? void 0 : ut.popup) == null ? void 0 : pt.list) == null ? void 0 : gt.selectionIcon
2650
3581
  }
2651
3582
  }
2652
3583
  },
2653
3584
  filters: {
2654
- ...(ct = (ht = (at = e.inbox) == null ? void 0 : at.header) == null ? void 0 : ht.menus) == null ? void 0 : ct.filters,
2655
- ...(ut = (dt = (lt = i.inbox) == null ? void 0 : lt.header) == null ? void 0 : dt.menus) == null ? void 0 : ut.filters,
3585
+ ...(_t = (bt = (mt = e.inbox) == null ? void 0 : mt.header) == null ? void 0 : bt.menus) == null ? void 0 : _t.filters,
3586
+ ...(vt = (xt = (ft = t.inbox) == null ? void 0 : ft.header) == null ? void 0 : xt.menus) == null ? void 0 : vt.filters,
2656
3587
  inbox: {
2657
- ...(bt = (mt = (gt = (pt = e.inbox) == null ? void 0 : pt.header) == null ? void 0 : gt.menus) == null ? void 0 : mt.filters) == null ? void 0 : bt.inbox,
2658
- ...(Ct = (ft = (xt = (_t = i.inbox) == null ? void 0 : _t.header) == null ? void 0 : xt.menus) == null ? void 0 : ft.filters) == null ? void 0 : Ct.inbox,
3588
+ ...(wt = (kt = (yt = (Ct = e.inbox) == null ? void 0 : Ct.header) == null ? void 0 : yt.menus) == null ? void 0 : kt.filters) == null ? void 0 : wt.inbox,
3589
+ ...(Mt = (Et = (It = (St = t.inbox) == null ? void 0 : St.header) == null ? void 0 : It.menus) == null ? void 0 : Et.filters) == null ? void 0 : Mt.inbox,
2659
3590
  icon: {
2660
- ...(St = (wt = (kt = (yt = (vt = e.inbox) == null ? void 0 : vt.header) == null ? void 0 : yt.menus) == null ? void 0 : kt.filters) == null ? void 0 : wt.inbox) == null ? void 0 : St.icon,
2661
- ...(Tt = (Lt = (It = (Mt = (Et = i.inbox) == null ? void 0 : Et.header) == null ? void 0 : Mt.menus) == null ? void 0 : It.filters) == null ? void 0 : Lt.inbox) == null ? void 0 : Tt.icon
3591
+ ...(Pt = (At = (Lt = ($t = (Tt = e.inbox) == null ? void 0 : Tt.header) == null ? void 0 : $t.menus) == null ? void 0 : Lt.filters) == null ? void 0 : At.inbox) == null ? void 0 : Pt.icon,
3592
+ ...(Ht = (Ft = (Dt = (Rt = (Bt = t.inbox) == null ? void 0 : Bt.header) == null ? void 0 : Rt.menus) == null ? void 0 : Dt.filters) == null ? void 0 : Ft.inbox) == null ? void 0 : Ht.icon
2662
3593
  }
2663
3594
  },
2664
3595
  archive: {
2665
- ...($t = (Pt = (At = (Bt = e.inbox) == null ? void 0 : Bt.header) == null ? void 0 : At.menus) == null ? void 0 : Pt.filters) == null ? void 0 : $t.archive,
2666
- ...(Rt = (Ht = (Ft = (Dt = i.inbox) == null ? void 0 : Dt.header) == null ? void 0 : Ft.menus) == null ? void 0 : Ht.filters) == null ? void 0 : Rt.archive,
3596
+ ...(Nt = (Ut = (zt = (Ot = e.inbox) == null ? void 0 : Ot.header) == null ? void 0 : zt.menus) == null ? void 0 : Ut.filters) == null ? void 0 : Nt.archive,
3597
+ ...(Zt = (jt = (Vt = (qt = t.inbox) == null ? void 0 : qt.header) == null ? void 0 : Vt.menus) == null ? void 0 : jt.filters) == null ? void 0 : Zt.archive,
2667
3598
  icon: {
2668
- ...(Vt = (Ut = (Nt = (Ot = (zt = e.inbox) == null ? void 0 : zt.header) == null ? void 0 : Ot.menus) == null ? void 0 : Nt.filters) == null ? void 0 : Ut.archive) == null ? void 0 : Vt.icon,
2669
- ...(Jt = (Gt = (jt = (Wt = (Zt = i.inbox) == null ? void 0 : Zt.header) == null ? void 0 : Wt.menus) == null ? void 0 : jt.filters) == null ? void 0 : Gt.archive) == null ? void 0 : Jt.icon
3599
+ ...(Xt = (Kt = (Wt = (Gt = (Jt = e.inbox) == null ? void 0 : Jt.header) == null ? void 0 : Gt.menus) == null ? void 0 : Wt.filters) == null ? void 0 : Kt.archive) == null ? void 0 : Xt.icon,
3600
+ ...(ii = (ti = (ei = (Yt = (Qt = t.inbox) == null ? void 0 : Qt.header) == null ? void 0 : Yt.menus) == null ? void 0 : ei.filters) == null ? void 0 : ti.archive) == null ? void 0 : ii.icon
2670
3601
  }
2671
3602
  }
2672
3603
  },
2673
3604
  actions: {
2674
- ...(Yt = (Xt = (qt = e.inbox) == null ? void 0 : qt.header) == null ? void 0 : Xt.menus) == null ? void 0 : Yt.actions,
2675
- ...(ei = (Qt = (Kt = i.inbox) == null ? void 0 : Kt.header) == null ? void 0 : Qt.menus) == null ? void 0 : ei.actions,
3605
+ ...(ni = (oi = (si = e.inbox) == null ? void 0 : si.header) == null ? void 0 : oi.menus) == null ? void 0 : ni.actions,
3606
+ ...(hi = (ai = (ri = t.inbox) == null ? void 0 : ri.header) == null ? void 0 : ai.menus) == null ? void 0 : hi.actions,
2676
3607
  markAllRead: {
2677
- ...(oi = (si = (ii = (ti = e.inbox) == null ? void 0 : ti.header) == null ? void 0 : ii.menus) == null ? void 0 : si.actions) == null ? void 0 : oi.markAllRead,
2678
- ...(hi = (ai = (ri = (ni = i.inbox) == null ? void 0 : ni.header) == null ? void 0 : ri.menus) == null ? void 0 : ai.actions) == null ? void 0 : hi.markAllRead,
3608
+ ...(ui = (di = (li = (ci = e.inbox) == null ? void 0 : ci.header) == null ? void 0 : li.menus) == null ? void 0 : di.actions) == null ? void 0 : ui.markAllRead,
3609
+ ...(bi = (mi = (gi = (pi = t.inbox) == null ? void 0 : pi.header) == null ? void 0 : gi.menus) == null ? void 0 : mi.actions) == null ? void 0 : bi.markAllRead,
2679
3610
  icon: {
2680
- ...(pi = (ui = (di = (li = (ci = e.inbox) == null ? void 0 : ci.header) == null ? void 0 : li.menus) == null ? void 0 : di.actions) == null ? void 0 : ui.markAllRead) == null ? void 0 : pi.icon,
2681
- ...(xi = (_i = (bi = (mi = (gi = i.inbox) == null ? void 0 : gi.header) == null ? void 0 : mi.menus) == null ? void 0 : bi.actions) == null ? void 0 : _i.markAllRead) == null ? void 0 : xi.icon
3611
+ ...(Ci = (vi = (xi = (fi = (_i = e.inbox) == null ? void 0 : _i.header) == null ? void 0 : fi.menus) == null ? void 0 : xi.actions) == null ? void 0 : vi.markAllRead) == null ? void 0 : Ci.icon,
3612
+ ...(Ii = (Si = (wi = (ki = (yi = t.inbox) == null ? void 0 : yi.header) == null ? void 0 : ki.menus) == null ? void 0 : wi.actions) == null ? void 0 : Si.markAllRead) == null ? void 0 : Ii.icon
2682
3613
  }
2683
3614
  },
2684
3615
  archiveAll: {
2685
- ...(yi = (vi = (Ci = (fi = e.inbox) == null ? void 0 : fi.header) == null ? void 0 : Ci.menus) == null ? void 0 : vi.actions) == null ? void 0 : yi.archiveAll,
2686
- ...(Ei = (Si = (wi = (ki = i.inbox) == null ? void 0 : ki.header) == null ? void 0 : wi.menus) == null ? void 0 : Si.actions) == null ? void 0 : Ei.archiveAll,
3616
+ ...($i = (Ti = (Mi = (Ei = e.inbox) == null ? void 0 : Ei.header) == null ? void 0 : Mi.menus) == null ? void 0 : Ti.actions) == null ? void 0 : $i.archiveAll,
3617
+ ...(Bi = (Pi = (Ai = (Li = t.inbox) == null ? void 0 : Li.header) == null ? void 0 : Ai.menus) == null ? void 0 : Pi.actions) == null ? void 0 : Bi.archiveAll,
2687
3618
  icon: {
2688
- ...(Bi = (Ti = (Li = (Ii = (Mi = e.inbox) == null ? void 0 : Mi.header) == null ? void 0 : Ii.menus) == null ? void 0 : Li.actions) == null ? void 0 : Ti.archiveAll) == null ? void 0 : Bi.icon,
2689
- ...(Fi = (Di = ($i = (Pi = (Ai = i.inbox) == null ? void 0 : Ai.header) == null ? void 0 : Pi.menus) == null ? void 0 : $i.actions) == null ? void 0 : Di.archiveAll) == null ? void 0 : Fi.icon
3619
+ ...(Oi = (Hi = (Fi = (Di = (Ri = e.inbox) == null ? void 0 : Ri.header) == null ? void 0 : Di.menus) == null ? void 0 : Fi.actions) == null ? void 0 : Hi.archiveAll) == null ? void 0 : Oi.icon,
3620
+ ...(Vi = (qi = (Ni = (Ui = (zi = t.inbox) == null ? void 0 : zi.header) == null ? void 0 : Ui.menus) == null ? void 0 : Ni.actions) == null ? void 0 : qi.archiveAll) == null ? void 0 : Vi.icon
2690
3621
  }
2691
3622
  },
2692
3623
  archiveRead: {
2693
- ...(Oi = (zi = (Ri = (Hi = e.inbox) == null ? void 0 : Hi.header) == null ? void 0 : Ri.menus) == null ? void 0 : zi.actions) == null ? void 0 : Oi.archiveRead,
2694
- ...(Zi = (Vi = (Ui = (Ni = i.inbox) == null ? void 0 : Ni.header) == null ? void 0 : Ui.menus) == null ? void 0 : Vi.actions) == null ? void 0 : Zi.archiveRead,
3624
+ ...(Gi = (Ji = (Zi = (ji = e.inbox) == null ? void 0 : ji.header) == null ? void 0 : Zi.menus) == null ? void 0 : Ji.actions) == null ? void 0 : Gi.archiveRead,
3625
+ ...(Qi = (Xi = (Ki = (Wi = t.inbox) == null ? void 0 : Wi.header) == null ? void 0 : Ki.menus) == null ? void 0 : Xi.actions) == null ? void 0 : Qi.archiveRead,
2695
3626
  icon: {
2696
- ...(qi = (Ji = (Gi = (ji = (Wi = e.inbox) == null ? void 0 : Wi.header) == null ? void 0 : ji.menus) == null ? void 0 : Gi.actions) == null ? void 0 : Ji.archiveRead) == null ? void 0 : qi.icon,
2697
- ...(es = (Qi = (Ki = (Yi = (Xi = i.inbox) == null ? void 0 : Xi.header) == null ? void 0 : Yi.menus) == null ? void 0 : Ki.actions) == null ? void 0 : Qi.archiveRead) == null ? void 0 : es.icon
3627
+ ...(ss = (is = (ts = (es = (Yi = e.inbox) == null ? void 0 : Yi.header) == null ? void 0 : es.menus) == null ? void 0 : ts.actions) == null ? void 0 : is.archiveRead) == null ? void 0 : ss.icon,
3628
+ ...(hs = (as = (rs = (ns = (os = t.inbox) == null ? void 0 : os.header) == null ? void 0 : ns.menus) == null ? void 0 : rs.actions) == null ? void 0 : as.archiveRead) == null ? void 0 : hs.icon
2698
3629
  }
2699
3630
  }
2700
3631
  }
2701
3632
  }
2702
3633
  },
2703
3634
  list: {
2704
- ...(ts = e.inbox) == null ? void 0 : ts.list,
2705
- ...(is = i.inbox) == null ? void 0 : is.list,
3635
+ ...(cs = e.inbox) == null ? void 0 : cs.list,
3636
+ ...(ls = t.inbox) == null ? void 0 : ls.list,
2706
3637
  item: {
2707
- ...(os = (ss = e.inbox) == null ? void 0 : ss.list) == null ? void 0 : os.item,
2708
- ...(rs = (ns = i.inbox) == null ? void 0 : ns.list) == null ? void 0 : rs.item,
3638
+ ...(us = (ds = e.inbox) == null ? void 0 : ds.list) == null ? void 0 : us.item,
3639
+ ...(gs = (ps = t.inbox) == null ? void 0 : ps.list) == null ? void 0 : gs.item,
2709
3640
  menu: {
2710
- ...(cs = (hs = (as = e.inbox) == null ? void 0 : as.list) == null ? void 0 : hs.item) == null ? void 0 : cs.menu,
2711
- ...(us = (ds = (ls = i.inbox) == null ? void 0 : ls.list) == null ? void 0 : ds.item) == null ? void 0 : us.menu,
3641
+ ...(_s = (bs = (ms = e.inbox) == null ? void 0 : ms.list) == null ? void 0 : bs.item) == null ? void 0 : _s.menu,
3642
+ ...(vs = (xs = (fs = t.inbox) == null ? void 0 : fs.list) == null ? void 0 : xs.item) == null ? void 0 : vs.menu,
2712
3643
  item: {
2713
- ...(bs = (ms = (gs = (ps = e.inbox) == null ? void 0 : ps.list) == null ? void 0 : gs.item) == null ? void 0 : ms.menu) == null ? void 0 : bs.item,
2714
- ...(Cs = (fs = (xs = (_s = i.inbox) == null ? void 0 : _s.list) == null ? void 0 : xs.item) == null ? void 0 : fs.menu) == null ? void 0 : Cs.item,
3644
+ ...(ws = (ks = (ys = (Cs = e.inbox) == null ? void 0 : Cs.list) == null ? void 0 : ys.item) == null ? void 0 : ks.menu) == null ? void 0 : ws.item,
3645
+ ...(Ms = (Es = (Is = (Ss = t.inbox) == null ? void 0 : Ss.list) == null ? void 0 : Is.item) == null ? void 0 : Es.menu) == null ? void 0 : Ms.item,
2715
3646
  read: {
2716
- ...(Ss = (ws = (ks = (ys = (vs = e.inbox) == null ? void 0 : vs.list) == null ? void 0 : ys.item) == null ? void 0 : ks.menu) == null ? void 0 : ws.item) == null ? void 0 : Ss.read,
2717
- ...(Ts = (Ls = (Is = (Ms = (Es = i.inbox) == null ? void 0 : Es.list) == null ? void 0 : Ms.item) == null ? void 0 : Is.menu) == null ? void 0 : Ls.item) == null ? void 0 : Ts.read
3647
+ ...(Ps = (As = (Ls = ($s = (Ts = e.inbox) == null ? void 0 : Ts.list) == null ? void 0 : $s.item) == null ? void 0 : Ls.menu) == null ? void 0 : As.item) == null ? void 0 : Ps.read,
3648
+ ...(Hs = (Fs = (Ds = (Rs = (Bs = t.inbox) == null ? void 0 : Bs.list) == null ? void 0 : Rs.item) == null ? void 0 : Ds.menu) == null ? void 0 : Fs.item) == null ? void 0 : Hs.read
2718
3649
  },
2719
3650
  unread: {
2720
- ...(Ds = ($s = (Ps = (As = (Bs = e.inbox) == null ? void 0 : Bs.list) == null ? void 0 : As.item) == null ? void 0 : Ps.menu) == null ? void 0 : $s.item) == null ? void 0 : Ds.unread,
2721
- ...(Os = (zs = (Rs = (Hs = (Fs = i.inbox) == null ? void 0 : Fs.list) == null ? void 0 : Hs.item) == null ? void 0 : Rs.menu) == null ? void 0 : zs.item) == null ? void 0 : Os.unread
3651
+ ...(qs = (Ns = (Us = (zs = (Os = e.inbox) == null ? void 0 : Os.list) == null ? void 0 : zs.item) == null ? void 0 : Us.menu) == null ? void 0 : Ns.item) == null ? void 0 : qs.unread,
3652
+ ...(Gs = (Js = (Zs = (js = (Vs = t.inbox) == null ? void 0 : Vs.list) == null ? void 0 : js.item) == null ? void 0 : Zs.menu) == null ? void 0 : Js.item) == null ? void 0 : Gs.unread
2722
3653
  },
2723
3654
  archive: {
2724
- ...(Ws = (Zs = (Vs = (Us = (Ns = e.inbox) == null ? void 0 : Ns.list) == null ? void 0 : Us.item) == null ? void 0 : Vs.menu) == null ? void 0 : Zs.item) == null ? void 0 : Ws.archive,
2725
- ...(Xs = (qs = (Js = (Gs = (js = i.inbox) == null ? void 0 : js.list) == null ? void 0 : Gs.item) == null ? void 0 : Js.menu) == null ? void 0 : qs.item) == null ? void 0 : Xs.archive
3655
+ ...(Ys = (Qs = (Xs = (Ks = (Ws = e.inbox) == null ? void 0 : Ws.list) == null ? void 0 : Ks.item) == null ? void 0 : Xs.menu) == null ? void 0 : Qs.item) == null ? void 0 : Ys.archive,
3656
+ ...(oo = (so = (io = (to = (eo = t.inbox) == null ? void 0 : eo.list) == null ? void 0 : to.item) == null ? void 0 : io.menu) == null ? void 0 : so.item) == null ? void 0 : oo.archive
2726
3657
  },
2727
3658
  unarchive: {
2728
- ...(to = (eo = (Qs = (Ks = (Ys = e.inbox) == null ? void 0 : Ys.list) == null ? void 0 : Ks.item) == null ? void 0 : Qs.menu) == null ? void 0 : eo.item) == null ? void 0 : to.unarchive,
2729
- ...(ro = (no = (oo = (so = (io = i.inbox) == null ? void 0 : io.list) == null ? void 0 : so.item) == null ? void 0 : oo.menu) == null ? void 0 : no.item) == null ? void 0 : ro.unarchive
3659
+ ...(co = (ho = (ao = (ro = (no = e.inbox) == null ? void 0 : no.list) == null ? void 0 : ro.item) == null ? void 0 : ao.menu) == null ? void 0 : ho.item) == null ? void 0 : co.unarchive,
3660
+ ...(mo = (go = (po = (uo = (lo = t.inbox) == null ? void 0 : lo.list) == null ? void 0 : uo.item) == null ? void 0 : po.menu) == null ? void 0 : go.item) == null ? void 0 : mo.unarchive
2730
3661
  }
2731
3662
  }
2732
3663
  }
2733
3664
  }
2734
3665
  },
2735
3666
  loading: {
2736
- ...(ao = e.inbox) == null ? void 0 : ao.loading,
2737
- ...(ho = i.inbox) == null ? void 0 : ho.loading
3667
+ ...(bo = e.inbox) == null ? void 0 : bo.loading,
3668
+ ...(_o = t.inbox) == null ? void 0 : _o.loading
2738
3669
  },
2739
3670
  empty: {
2740
- ...(co = e.inbox) == null ? void 0 : co.empty,
2741
- ...(lo = i.inbox) == null ? void 0 : lo.empty
3671
+ ...(fo = e.inbox) == null ? void 0 : fo.empty,
3672
+ ...(xo = t.inbox) == null ? void 0 : xo.empty
2742
3673
  },
2743
3674
  error: {
2744
- ...(uo = e.inbox) == null ? void 0 : uo.error,
2745
- ...(po = i.inbox) == null ? void 0 : po.error
3675
+ ...(vo = e.inbox) == null ? void 0 : vo.error,
3676
+ ...(Co = t.inbox) == null ? void 0 : Co.error
2746
3677
  }
2747
3678
  }
2748
3679
  };
2749
3680
  };
2750
- class Eo {
2751
- constructor(i) {
3681
+ class zo {
3682
+ constructor(t) {
2752
3683
  // Event IDs
2753
3684
  a(this, "THEME_CHANGE_EVENT", "courier_inbox_theme_change");
2754
3685
  // State
2755
3686
  a(this, "_theme");
2756
- a(this, "_lightTheme", we);
2757
- a(this, "_darkTheme", Ae);
3687
+ a(this, "_lightTheme", Te);
3688
+ a(this, "_darkTheme", Oe);
2758
3689
  a(this, "_target");
2759
3690
  a(this, "_subscriptions", []);
2760
3691
  // System theme
2761
3692
  a(this, "_userMode");
2762
3693
  a(this, "_systemMode");
2763
3694
  a(this, "_systemThemeCleanup");
2764
- this._theme = i, this._target = new EventTarget(), this._userMode = "system", this._systemMode = go(), this.setLightTheme(we), this.setDarkTheme(Ae), this._systemThemeCleanup = mo((e) => {
3695
+ this._theme = t, this._target = new EventTarget(), this._userMode = "system", this._systemMode = Mo(), this.setLightTheme(Te), this.setDarkTheme(Oe), this._systemThemeCleanup = To((e) => {
2765
3696
  this._systemMode = e, this.updateTheme();
2766
3697
  });
2767
3698
  }
2768
- setLightTheme(i) {
2769
- this._lightTheme = i, this._systemMode === "light" && this.updateTheme();
3699
+ setLightTheme(t) {
3700
+ this._lightTheme = t, this._systemMode === "light" && this.updateTheme();
2770
3701
  }
2771
- setDarkTheme(i) {
2772
- this._darkTheme = i, this._systemMode === "dark" && this.updateTheme();
3702
+ setDarkTheme(t) {
3703
+ this._darkTheme = t, this._systemMode === "dark" && this.updateTheme();
2773
3704
  }
2774
3705
  /**
2775
3706
  * Get the current system theme
@@ -2787,53 +3718,53 @@ class Eo {
2787
3718
  * Update the theme
2788
3719
  */
2789
3720
  updateTheme() {
2790
- const i = this._userMode === "system" ? this._systemMode : this._userMode, e = i === "light" ? this._lightTheme : this._darkTheme, t = Do(i, e);
2791
- this.setTheme(t);
3721
+ const t = this._userMode === "system" ? this._systemMode : this._userMode, e = t === "light" ? this._lightTheme : this._darkTheme, i = dn(t, e);
3722
+ this.setTheme(i);
2792
3723
  }
2793
3724
  /**
2794
3725
  * Set the theme and notify all listeners
2795
3726
  */
2796
- setTheme(i) {
2797
- i !== this._theme && (this._theme = i, this._target.dispatchEvent(new CustomEvent(this.THEME_CHANGE_EVENT, {
2798
- detail: { theme: i }
3727
+ setTheme(t) {
3728
+ t !== this._theme && (this._theme = t, this._target.dispatchEvent(new CustomEvent(this.THEME_CHANGE_EVENT, {
3729
+ detail: { theme: t }
2799
3730
  })));
2800
3731
  }
2801
3732
  /**
2802
3733
  * Set the mode and notify all listeners
2803
3734
  */
2804
- setMode(i) {
2805
- this._userMode = i, this.updateTheme();
3735
+ setMode(t) {
3736
+ this._userMode = t, this.updateTheme();
2806
3737
  }
2807
3738
  /**
2808
3739
  * Subscribe to theme changes
2809
3740
  * @param {Function} callback - Function to run when the theme changes
2810
3741
  * @returns {CourierInboxThemeSubscription} - Object with remove method to stop listening
2811
3742
  */
2812
- subscribe(i) {
3743
+ subscribe(t) {
2813
3744
  const e = new AbortController();
2814
3745
  this._target.addEventListener(this.THEME_CHANGE_EVENT, (s) => {
2815
- i(s.detail.theme);
3746
+ t(s.detail.theme);
2816
3747
  }, { signal: e.signal });
2817
- const t = {
3748
+ const i = {
2818
3749
  manager: this,
2819
3750
  unsubscribe: () => {
2820
3751
  e.abort();
2821
- const s = this._subscriptions.indexOf(t);
3752
+ const s = this._subscriptions.indexOf(i);
2822
3753
  s > -1 && this._subscriptions.splice(s, 1);
2823
3754
  }
2824
3755
  };
2825
- return this._subscriptions.push(t), t;
3756
+ return this._subscriptions.push(i), i;
2826
3757
  }
2827
3758
  /**
2828
3759
  * Clean up event listeners
2829
3760
  */
2830
3761
  cleanup() {
2831
- this._systemThemeCleanup && this._systemThemeCleanup(), this._subscriptions.forEach((i) => i.unsubscribe()), this._subscriptions = [];
3762
+ this._systemThemeCleanup && this._systemThemeCleanup(), this._subscriptions.forEach((t) => t.unsubscribe()), this._subscriptions = [];
2832
3763
  }
2833
3764
  }
2834
- class Mo extends HTMLElement {
3765
+ class Uo extends HTMLElement {
2835
3766
  constructor(e) {
2836
- var t;
3767
+ var i;
2837
3768
  super();
2838
3769
  // State
2839
3770
  a(this, "_currentFeed", "inbox");
@@ -2855,16 +3786,16 @@ class Mo extends HTMLElement {
2855
3786
  // Default props
2856
3787
  a(this, "_defaultProps", {
2857
3788
  title: "Inbox",
2858
- icon: f.inbox,
3789
+ icon: x.inbox,
2859
3790
  feedType: this._currentFeed,
2860
3791
  height: "768px"
2861
3792
  });
2862
- this._shadow = this.attachShadow({ mode: "open" }), this._themeManager = e ?? new Eo(we), this._header = new wo({
3793
+ this._shadow = this.attachShadow({ mode: "open" }), this._themeManager = e ?? new zo(Te), this._header = new Ho({
2863
3794
  themeManager: this._themeManager,
2864
3795
  onFeedTypeChange: (s) => {
2865
3796
  this.setFeedType(s);
2866
3797
  }
2867
- }), this._header.build(void 0), this._shadow.appendChild(this._header), this._list = new vo({
3798
+ }), this._header.build(void 0), this._shadow.appendChild(this._header), this._list = new Ro({
2868
3799
  themeManager: this._themeManager,
2869
3800
  onRefresh: () => {
2870
3801
  this.refresh();
@@ -2872,28 +3803,28 @@ class Mo extends HTMLElement {
2872
3803
  onPaginationTrigger: async (s) => {
2873
3804
  var o, n;
2874
3805
  try {
2875
- await A.shared.fetchNextPageOfMessages({
3806
+ await P.shared.fetchNextPageOfMessages({
2876
3807
  feedType: s
2877
3808
  });
2878
- } catch (h) {
2879
- (n = (o = C.shared.client) == null ? void 0 : o.options.logger) == null || n.error("Failed to fetch next page of messages:", h);
3809
+ } catch (c) {
3810
+ (n = (o = v.shared.client) == null ? void 0 : o.options.logger) == null || n.error("Failed to fetch next page of messages:", c);
2880
3811
  }
2881
3812
  },
2882
3813
  onMessageClick: (s, o) => {
2883
3814
  var n;
2884
- A.shared.clickMessage(s), this.dispatchEvent(new CustomEvent("message-click", {
3815
+ P.shared.clickMessage({ message: s }), this.dispatchEvent(new CustomEvent("message-click", {
2885
3816
  detail: { message: s, index: o },
2886
3817
  bubbles: !0,
2887
3818
  composed: !0
2888
3819
  })), (n = this._onMessageClick) == null || n.call(this, { message: s, index: o });
2889
3820
  },
2890
3821
  onMessageActionClick: (s, o, n) => {
2891
- var h;
3822
+ var c;
2892
3823
  this.dispatchEvent(new CustomEvent("message-action-click", {
2893
3824
  detail: { message: s, action: o, index: n },
2894
3825
  bubbles: !0,
2895
3826
  composed: !0
2896
- })), (h = this._onMessageActionClick) == null || h.call(this, { message: s, action: o, index: n });
3827
+ })), (c = this._onMessageActionClick) == null || c.call(this, { message: s, action: o, index: n });
2897
3828
  },
2898
3829
  onMessageLongPress: (s, o) => {
2899
3830
  var n;
@@ -2903,7 +3834,7 @@ class Mo extends HTMLElement {
2903
3834
  composed: !0
2904
3835
  })), (n = this._onMessageLongPress) == null || n.call(this, { message: s, index: o });
2905
3836
  }
2906
- }), this._style = document.createElement("style"), this.refreshTheme(), this._shadow.appendChild(this._style), this._shadow.appendChild(this._list), this._datastoreListener = new So({
3837
+ }), this._style = document.createElement("style"), this.refreshTheme(), this._shadow.appendChild(this._style), this._shadow.appendChild(this._list), this._datastoreListener = new Oo({
2907
3838
  onError: (s) => {
2908
3839
  this._list.setError(s);
2909
3840
  },
@@ -2925,11 +3856,11 @@ class Mo extends HTMLElement {
2925
3856
  onUnreadCountChange: (s) => {
2926
3857
  this.updateHeader();
2927
3858
  }
2928
- }), A.shared.addDataStoreListener(this._datastoreListener), this._themeManager.subscribe((s) => {
3859
+ }), P.shared.addDataStoreListener(this._datastoreListener), this._themeManager.subscribe((s) => {
2929
3860
  this.refreshTheme();
2930
- }), this._authListener = C.shared.addAuthenticationListener((s) => {
3861
+ }), this._authListener = v.shared.addAuthenticationListener((s) => {
2931
3862
  this.refresh();
2932
- }), (t = C.shared.client) != null && t.options.userId && this.refresh();
3863
+ }), (i = v.shared.client) != null && i.options.userId && this.refresh();
2933
3864
  }
2934
3865
  get theme() {
2935
3866
  return this._themeManager.getTheme();
@@ -3005,7 +3936,7 @@ class Mo extends HTMLElement {
3005
3936
  updateHeader() {
3006
3937
  const e = {
3007
3938
  feedType: this._currentFeed,
3008
- unreadCount: A.shared.unreadCount,
3939
+ unreadCount: P.shared.unreadCount,
3009
3940
  messageCount: this._list.messages.length
3010
3941
  };
3011
3942
  switch (this._headerFactory) {
@@ -3016,13 +3947,13 @@ class Mo extends HTMLElement {
3016
3947
  this._header.build(null);
3017
3948
  break;
3018
3949
  default:
3019
- const t = this._headerFactory(e);
3020
- this._header.build(t);
3950
+ const i = this._headerFactory(e);
3951
+ this._header.build(i);
3021
3952
  break;
3022
3953
  }
3023
3954
  }
3024
3955
  async load(e) {
3025
- await A.shared.load(e);
3956
+ await P.shared.load(e);
3026
3957
  }
3027
3958
  refresh() {
3028
3959
  this.load({
@@ -3034,12 +3965,12 @@ class Mo extends HTMLElement {
3034
3965
  this.refresh();
3035
3966
  }
3036
3967
  disconnectedCallback() {
3037
- var e, t;
3038
- this._themeManager.cleanup(), (e = this._datastoreListener) == null || e.remove(), (t = this._authListener) == null || t.remove();
3968
+ var e, i;
3969
+ this._themeManager.cleanup(), (e = this._datastoreListener) == null || e.remove(), (i = this._authListener) == null || i.remove();
3039
3970
  }
3040
- attributeChangedCallback(e, t, s) {
3041
- var o, n, h, d, c, u;
3042
- if (t !== s)
3971
+ attributeChangedCallback(e, i, s) {
3972
+ var o, n, c, d, l, p;
3973
+ if (i !== s)
3043
3974
  switch (e) {
3044
3975
  case "height":
3045
3976
  const m = s || this._defaultProps.height;
@@ -3049,8 +3980,8 @@ class Mo extends HTMLElement {
3049
3980
  if (s)
3050
3981
  try {
3051
3982
  this._onMessageClick = new Function("props", s);
3052
- } catch (p) {
3053
- (n = (o = C.shared.client) == null ? void 0 : o.options.logger) == null || n.error("Failed to parse message-click handler:", p);
3983
+ } catch (g) {
3984
+ (n = (o = v.shared.client) == null ? void 0 : o.options.logger) == null || n.error("Failed to parse message-click handler:", g);
3054
3985
  }
3055
3986
  else
3056
3987
  this._onMessageClick = void 0;
@@ -3059,8 +3990,8 @@ class Mo extends HTMLElement {
3059
3990
  if (s)
3060
3991
  try {
3061
3992
  this._onMessageActionClick = new Function("props", s);
3062
- } catch (p) {
3063
- (d = (h = C.shared.client) == null ? void 0 : h.options.logger) == null || d.error("Failed to parse message-action-click handler:", p);
3993
+ } catch (g) {
3994
+ (d = (c = v.shared.client) == null ? void 0 : c.options.logger) == null || d.error("Failed to parse message-action-click handler:", g);
3064
3995
  }
3065
3996
  else
3066
3997
  this._onMessageActionClick = void 0;
@@ -3069,8 +4000,8 @@ class Mo extends HTMLElement {
3069
4000
  if (s)
3070
4001
  try {
3071
4002
  this._onMessageLongPress = new Function("props", s);
3072
- } catch (p) {
3073
- (u = (c = C.shared.client) == null ? void 0 : c.options.logger) == null || u.error("Failed to parse message-long-press handler:", p);
4003
+ } catch (g) {
4004
+ (p = (l = v.shared.client) == null ? void 0 : l.options.logger) == null || p.error("Failed to parse message-long-press handler:", g);
3074
4005
  }
3075
4006
  else
3076
4007
  this._onMessageLongPress = void 0;
@@ -3087,8 +4018,8 @@ class Mo extends HTMLElement {
3087
4018
  }
3088
4019
  }
3089
4020
  }
3090
- customElements.get("courier-inbox") || customElements.define("courier-inbox", Mo);
3091
- class Io extends Le {
4021
+ customElements.get("courier-inbox") || customElements.define("courier-inbox", Uo);
4022
+ class No extends De {
3092
4023
  constructor(e) {
3093
4024
  super();
3094
4025
  // Theme
@@ -3097,12 +4028,12 @@ class Io extends Le {
3097
4028
  a(this, "_container");
3098
4029
  a(this, "_triggerButton");
3099
4030
  a(this, "_unreadCountBadge");
3100
- this._themeSubscription = e.subscribe((t) => {
4031
+ this._themeSubscription = e.subscribe((i) => {
3101
4032
  this.updateTheme();
3102
4033
  });
3103
4034
  }
3104
4035
  defaultElement() {
3105
- this._container = document.createElement("div"), this._container.className = "menu-button-container", this._triggerButton = new Se(f.inbox), this._unreadCountBadge = new De({
4036
+ this._container = document.createElement("div"), this._container.className = "menu-button-container", this._triggerButton = new $e(x.inbox), this._unreadCountBadge = new qe({
3106
4037
  themeBus: this._themeSubscription.manager,
3107
4038
  location: "button"
3108
4039
  }), this._unreadCountBadge.id = "unread-badge";
@@ -3125,20 +4056,20 @@ class Io extends Le {
3125
4056
  `;
3126
4057
  }
3127
4058
  onUnreadCountChange(e) {
3128
- var t;
3129
- (t = this._unreadCountBadge) == null || t.setCount(e), this.updateTheme();
4059
+ var i;
4060
+ (i = this._unreadCountBadge) == null || i.setCount(e), this.updateTheme();
3130
4061
  }
3131
4062
  updateTheme() {
3132
- var t, s, o, n, h, d, c, u, m, p, x, _, b, v, k, w, S, E;
4063
+ var i, s, o, n, c, d, l, p, m, g, f, _, b, C, k, w, S, I;
3133
4064
  const e = this._themeSubscription.manager.getTheme();
3134
- (n = this._triggerButton) == null || n.updateIconColor(((o = (s = (t = e == null ? void 0 : e.popup) == null ? void 0 : t.button) == null ? void 0 : s.icon) == null ? void 0 : o.color) ?? r.black[500]), (u = this._triggerButton) == null || u.updateIconSVG(((c = (d = (h = e == null ? void 0 : e.popup) == null ? void 0 : h.button) == null ? void 0 : d.icon) == null ? void 0 : c.svg) ?? f.inbox), (x = this._triggerButton) == null || x.updateBackgroundColor(((p = (m = e == null ? void 0 : e.popup) == null ? void 0 : m.button) == null ? void 0 : p.backgroundColor) ?? "transparent"), (v = this._triggerButton) == null || v.updateHoverBackgroundColor(((b = (_ = e == null ? void 0 : e.popup) == null ? void 0 : _.button) == null ? void 0 : b.hoverBackgroundColor) ?? r.black[50010]), (S = this._triggerButton) == null || S.updateActiveBackgroundColor(((w = (k = e == null ? void 0 : e.popup) == null ? void 0 : k.button) == null ? void 0 : w.activeBackgroundColor) ?? r.black[50020]), (E = this._unreadCountBadge) == null || E.refreshTheme("button");
4065
+ (n = this._triggerButton) == null || n.updateIconColor(((o = (s = (i = e == null ? void 0 : e.popup) == null ? void 0 : i.button) == null ? void 0 : s.icon) == null ? void 0 : o.color) ?? r.black[500]), (p = this._triggerButton) == null || p.updateIconSVG(((l = (d = (c = e == null ? void 0 : e.popup) == null ? void 0 : c.button) == null ? void 0 : d.icon) == null ? void 0 : l.svg) ?? x.inbox), (f = this._triggerButton) == null || f.updateBackgroundColor(((g = (m = e == null ? void 0 : e.popup) == null ? void 0 : m.button) == null ? void 0 : g.backgroundColor) ?? "transparent"), (C = this._triggerButton) == null || C.updateHoverBackgroundColor(((b = (_ = e == null ? void 0 : e.popup) == null ? void 0 : _.button) == null ? void 0 : b.hoverBackgroundColor) ?? r.black[50010]), (S = this._triggerButton) == null || S.updateActiveBackgroundColor(((w = (k = e == null ? void 0 : e.popup) == null ? void 0 : k.button) == null ? void 0 : w.activeBackgroundColor) ?? r.black[50020]), (I = this._unreadCountBadge) == null || I.refreshTheme("button");
3135
4066
  }
3136
4067
  disconnectedCallback() {
3137
4068
  this._themeSubscription.unsubscribe();
3138
4069
  }
3139
4070
  }
3140
- customElements.get("courier-inbox-menu-button") || customElements.define("courier-inbox-menu-button", Io);
3141
- class Fo extends HTMLElement {
4071
+ customElements.get("courier-inbox-menu-button") || customElements.define("courier-inbox-menu-button", No);
4072
+ class un extends HTMLElement {
3142
4073
  constructor() {
3143
4074
  super();
3144
4075
  // State
@@ -3150,7 +4081,7 @@ class Fo extends HTMLElement {
3150
4081
  a(this, "_bottom", "40px");
3151
4082
  a(this, "_left", "0");
3152
4083
  // Theming
3153
- a(this, "_themeManager", new Eo(we));
4084
+ a(this, "_themeManager", new zo(Te));
3154
4085
  // Components
3155
4086
  a(this, "_triggerButton");
3156
4087
  a(this, "_popup");
@@ -3161,7 +4092,7 @@ class Fo extends HTMLElement {
3161
4092
  // Factories
3162
4093
  a(this, "_popupMenuButtonFactory");
3163
4094
  const e = this.attachShadow({ mode: "open" });
3164
- this._triggerButton = new Io(this._themeManager), this._triggerButton.build(void 0), this._popup = document.createElement("div"), this._popup.className = "popup", this._inbox = new Mo(this._themeManager), this._inbox.setAttribute("height", "100%"), this._style = document.createElement("style"), this.refreshTheme(), e.appendChild(this._style), e.appendChild(this._triggerButton), e.appendChild(this._popup), this._popup.appendChild(this._inbox), this._triggerButton.addEventListener("click", this.togglePopup.bind(this)), document.addEventListener("click", this.handleOutsideClick.bind(this)), this.updatePopupPosition(), this._datastoreListener = new So(this), A.shared.addDataStoreListener(this._datastoreListener), this._themeManager.subscribe((t) => {
4095
+ this._triggerButton = new No(this._themeManager), this._triggerButton.build(void 0), this._popup = document.createElement("div"), this._popup.className = "popup", this._inbox = new Uo(this._themeManager), this._inbox.setAttribute("height", "100%"), this._style = document.createElement("style"), this.refreshTheme(), e.appendChild(this._style), e.appendChild(this._triggerButton), e.appendChild(this._popup), this._popup.appendChild(this._inbox), this._triggerButton.addEventListener("click", this.togglePopup.bind(this)), document.addEventListener("click", this.handleOutsideClick.bind(this)), this.updatePopupPosition(), this._datastoreListener = new Oo(this), P.shared.addDataStoreListener(this._datastoreListener), this._themeManager.subscribe((i) => {
3165
4096
  this.refreshTheme();
3166
4097
  });
3167
4098
  }
@@ -3181,7 +4112,7 @@ class Fo extends HTMLElement {
3181
4112
  this._style.textContent = this.getStyles();
3182
4113
  }
3183
4114
  getStyles() {
3184
- var e, t, s, o, n, h, d, c;
4115
+ var e, i, s, o, n, c, d, l;
3185
4116
  return `
3186
4117
  :host {
3187
4118
  display: inline-block;
@@ -3196,10 +4127,10 @@ class Fo extends HTMLElement {
3196
4127
  .popup {
3197
4128
  display: none;
3198
4129
  position: absolute;
3199
- background: ${((t = (e = this.theme.popup) == null ? void 0 : e.window) == null ? void 0 : t.backgroundColor) ?? "red"};
4130
+ background: ${((i = (e = this.theme.popup) == null ? void 0 : e.window) == null ? void 0 : i.backgroundColor) ?? "red"};
3200
4131
  border-radius: ${((o = (s = this.theme.popup) == null ? void 0 : s.window) == null ? void 0 : o.borderRadius) ?? "8px"};
3201
- border: ${((h = (n = this.theme.popup) == null ? void 0 : n.window) == null ? void 0 : h.border) ?? "1px solid red"};
3202
- box-shadow: ${((c = (d = this.theme.popup) == null ? void 0 : d.window) == null ? void 0 : c.shadow) ?? "0px 8px 16px -4px red"};
4132
+ border: ${((c = (n = this.theme.popup) == null ? void 0 : n.window) == null ? void 0 : c.border) ?? "1px solid red"};
4133
+ box-shadow: ${((l = (d = this.theme.popup) == null ? void 0 : d.window) == null ? void 0 : l.shadow) ?? "0px 8px 16px -4px red"};
3203
4134
  z-index: 1000;
3204
4135
  width: ${this._width};
3205
4136
  height: ${this._height};
@@ -3220,7 +4151,7 @@ class Fo extends HTMLElement {
3220
4151
  }
3221
4152
  `;
3222
4153
  }
3223
- attributeChangedCallback(e, t, s) {
4154
+ attributeChangedCallback(e, i, s) {
3224
4155
  switch (e) {
3225
4156
  case "popup-alignment":
3226
4157
  this.isValidPosition(s) && (this._popupAlignment = s, this.updatePopupPosition());
@@ -3319,12 +4250,12 @@ class Fo extends HTMLElement {
3319
4250
  setContent(e) {
3320
4251
  this._inbox.innerHTML = "", this._inbox.appendChild(e);
3321
4252
  }
3322
- setSize(e, t) {
3323
- this._width = e, this._height = t, this._popup.style.width = e, this._popup.style.height = t;
4253
+ setSize(e, i) {
4254
+ this._width = e, this._height = i, this._popup.style.width = e, this._popup.style.height = i;
3324
4255
  }
3325
4256
  setPosition(e) {
3326
- var t, s;
3327
- this.isValidPosition(e) ? (this._popupAlignment = e, this.updatePopupPosition()) : (s = (t = C.shared.client) == null ? void 0 : t.options.logger) == null || s.error(`Invalid position: ${e}`);
4257
+ var i, s;
4258
+ this.isValidPosition(e) ? (this._popupAlignment = e, this.updatePopupPosition()) : (s = (i = v.shared.client) == null ? void 0 : i.options.logger) == null || s.error(`Invalid position: ${e}`);
3328
4259
  }
3329
4260
  setFeedType(e) {
3330
4261
  this._inbox.setFeedType(e);
@@ -3355,15 +4286,15 @@ class Fo extends HTMLElement {
3355
4286
  this._popupMenuButtonFactory = e, this.render();
3356
4287
  }
3357
4288
  render() {
3358
- const e = A.shared.unreadCount;
4289
+ const e = P.shared.unreadCount;
3359
4290
  switch (this._popupMenuButtonFactory) {
3360
4291
  case void 0:
3361
4292
  case null:
3362
4293
  this._triggerButton.build(void 0), this._triggerButton.onUnreadCountChange(e);
3363
4294
  break;
3364
4295
  default:
3365
- const t = this._popupMenuButtonFactory({ unreadCount: e });
3366
- this._triggerButton.build(t);
4296
+ const i = this._popupMenuButtonFactory({ unreadCount: e });
4297
+ this._triggerButton.build(i);
3367
4298
  break;
3368
4299
  }
3369
4300
  }
@@ -3372,39 +4303,39 @@ class Fo extends HTMLElement {
3372
4303
  (e = this._datastoreListener) == null || e.remove(), this._themeManager.cleanup();
3373
4304
  }
3374
4305
  }
3375
- customElements.get("courier-inbox-menu") || customElements.define("courier-inbox-menu", Fo);
3376
- class Zo {
3377
- onDataSetChange(i, e) {
4306
+ customElements.get("courier-inbox-menu") || customElements.define("courier-inbox-menu", un);
4307
+ class xn {
4308
+ onDataSetChange(t, e) {
3378
4309
  }
3379
- onPageAdded(i, e) {
4310
+ onPageAdded(t, e) {
3380
4311
  }
3381
- onUnreadCountChange(i) {
4312
+ onUnreadCountChange(t) {
3382
4313
  }
3383
- onMessageAdd(i, e, t) {
4314
+ onMessageAdd(t, e, i) {
3384
4315
  }
3385
- onMessageRemove(i, e, t) {
4316
+ onMessageRemove(t, e, i) {
3386
4317
  }
3387
- onMessageUpdate(i, e, t) {
4318
+ onMessageUpdate(t, e, i) {
3388
4319
  }
3389
- onError(i) {
4320
+ onError(t) {
3390
4321
  }
3391
4322
  }
3392
4323
  export {
3393
- Mo as CourierInbox,
3394
- So as CourierInboxDataStoreListener,
3395
- A as CourierInboxDatastore,
3396
- Zo as CourierInboxDatastoreEvents,
3397
- wo as CourierInboxHeader,
3398
- Fo as CourierInboxMenu,
3399
- Eo as CourierInboxThemeManager,
3400
- xo as CourierListItem,
3401
- Uo as archiveMessage,
3402
- No as clickMessage,
3403
- Ae as defaultDarkTheme,
3404
- we as defaultLightTheme,
3405
- $o as getMessageTime,
3406
- zo as markAsRead,
3407
- Oo as markAsUnread,
3408
- Do as mergeTheme,
3409
- Vo as openMessage
4324
+ Uo as CourierInbox,
4325
+ Oo as CourierInboxDataStoreListener,
4326
+ P as CourierInboxDatastore,
4327
+ xn as CourierInboxDatastoreEvents,
4328
+ Ho as CourierInboxHeader,
4329
+ un as CourierInboxMenu,
4330
+ zo as CourierInboxThemeManager,
4331
+ Ao as CourierListItem,
4332
+ _n as archiveMessage,
4333
+ bn as clickMessage,
4334
+ Oe as defaultDarkTheme,
4335
+ Te as defaultLightTheme,
4336
+ ln as getMessageTime,
4337
+ gn as markAsRead,
4338
+ mn as markAsUnread,
4339
+ dn as mergeTheme,
4340
+ fn as openMessage
3410
4341
  };