@inertiaui/notifications-react 1.0.1 → 1.0.3
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/inertiaui-notifications.js +1116 -1098
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import { isValidElement as e, useEffect as t, useId as n, useLayoutEffect as r, useMemo as i, useRef as a, useState as o, useSyncExternalStore as s } from "react";
|
|
2
|
+
import { createPortal as c } from "react-dom";
|
|
3
|
+
import { extendTailwindMerge as l } from "tailwind-merge";
|
|
4
|
+
import { animate as u, autoUpdateTopLayerPopover as d, cancelAnimations as f, createAnnouncer as p, createPopoverController as m, createTooltipController as h, isRightToLeft as g, positionTopLayerPopover as _, prefersReducedMotion as v, replacePlaceholders as y } from "@inertiaui/vanilla";
|
|
5
|
+
import { InfiniteScroll as b, Link as x, http as S, router as C, socketId as w, usePage as T } from "@inertiajs/react";
|
|
6
6
|
import { Fragment as E, jsx as D, jsxs as O } from "react/jsx-runtime";
|
|
7
7
|
// ../js/types.ts
|
|
8
8
|
var k = [
|
|
@@ -97,32 +97,37 @@ function ne(e) {
|
|
|
97
97
|
}
|
|
98
98
|
}
|
|
99
99
|
function U(e) {
|
|
100
|
-
|
|
100
|
+
let t = new URL(window.location.href), n = new URL(e.url, t);
|
|
101
|
+
for (let e of [t, n]) e.hash = "", e.searchParams.sort();
|
|
102
|
+
return n.href === t.href;
|
|
101
103
|
}
|
|
102
104
|
function re(e) {
|
|
105
|
+
return e.button !== 0 || e.metaKey || e.ctrlKey || e.shiftKey || e.altKey;
|
|
106
|
+
}
|
|
107
|
+
function ie(e) {
|
|
103
108
|
let t = e.target;
|
|
104
109
|
return typeof t?.closest == "function" && t.closest("a[href]") !== null;
|
|
105
110
|
}
|
|
106
|
-
function
|
|
107
|
-
return !e.onClick &&
|
|
111
|
+
function ae(e, t, n) {
|
|
112
|
+
return !e.onClick && ie(n) && (re(n) || e.external || e.newTab || !ne(t));
|
|
108
113
|
}
|
|
109
|
-
var
|
|
110
|
-
function
|
|
114
|
+
var oe = 1500;
|
|
115
|
+
function se(e, t) {
|
|
111
116
|
let n, r = () => {
|
|
112
117
|
n !== void 0 && (clearTimeout(n), n = void 0, window.location.assign(t));
|
|
113
118
|
};
|
|
114
|
-
n = setTimeout(r,
|
|
119
|
+
n = setTimeout(r, oe), e.then(r, r);
|
|
115
120
|
}
|
|
116
|
-
function
|
|
121
|
+
function W(e, t, n, r, i) {
|
|
117
122
|
r();
|
|
118
123
|
let a = i?.();
|
|
119
|
-
a && !
|
|
124
|
+
a && !re(n) && !t.newTab && (n.preventDefault(), se(a, e));
|
|
120
125
|
}
|
|
121
|
-
var
|
|
122
|
-
function
|
|
126
|
+
var ce = (e) => typeof e?.then == "function";
|
|
127
|
+
function le(e, t, n, r, i) {
|
|
123
128
|
e.event && window.dispatchEvent(new CustomEvent(e.event, { detail: e.payload }));
|
|
124
129
|
let a = e.onClick?.(t);
|
|
125
|
-
if (
|
|
130
|
+
if (ce(a)) return a.then(() => {
|
|
126
131
|
i?.(), r(!0);
|
|
127
132
|
}, () => r(!1)), "pending";
|
|
128
133
|
let o = L(e.href);
|
|
@@ -132,7 +137,7 @@ function ce(e, t, n, r, i) {
|
|
|
132
137
|
if (e.newTab) window.open(o, "_blank", "noopener"), i?.();
|
|
133
138
|
else {
|
|
134
139
|
let e = i?.();
|
|
135
|
-
e ?
|
|
140
|
+
e ? se(e, o) : window.location.assign(o);
|
|
136
141
|
}
|
|
137
142
|
return "done";
|
|
138
143
|
}
|
|
@@ -141,6 +146,10 @@ function ce(e, t, n, r, i) {
|
|
|
141
146
|
return n.visit(o, {
|
|
142
147
|
method: s,
|
|
143
148
|
data: e.data,
|
|
149
|
+
...s === "get" ? {} : {
|
|
150
|
+
preserveState: U,
|
|
151
|
+
preserveScroll: U
|
|
152
|
+
},
|
|
144
153
|
...e.visit,
|
|
145
154
|
onSuccess: () => void (c = !0),
|
|
146
155
|
onFinish: () => {
|
|
@@ -149,48 +158,48 @@ function ce(e, t, n, r, i) {
|
|
|
149
158
|
}), "pending";
|
|
150
159
|
}
|
|
151
160
|
// ../js/cn.ts
|
|
152
|
-
var
|
|
161
|
+
var ue = l({ extend: { theme: { radius: ["iui-toast", "iui-inbox"] } } });
|
|
153
162
|
function G(...e) {
|
|
154
|
-
return
|
|
163
|
+
return ue(e.filter(Boolean).join(" "));
|
|
155
164
|
}
|
|
156
165
|
// ../js/icons.ts
|
|
157
|
-
var K = (e, t) => Object.hasOwn(e, t) ? e[t] : void 0,
|
|
166
|
+
var K = (e, t) => Object.hasOwn(e, t) ? e[t] : void 0, de = {
|
|
158
167
|
success: "M10 18a8 8 0 1 0 0-16 8 8 0 0 0 0 16Zm3.857-9.809a.75.75 0 0 0-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 1 0-1.06 1.061l2.5 2.5a.75.75 0 0 0 1.137-.089l4-5.5Z",
|
|
159
168
|
info: "M18 10a8 8 0 1 1-16 0 8 8 0 0 1 16 0Zm-7-4a1 1 0 1 1-2 0 1 1 0 0 1 2 0ZM9 9a.75.75 0 0 0 0 1.5h.253a.25.25 0 0 1 .244.304l-.459 2.066A1.75 1.75 0 0 0 10.747 15H11a.75.75 0 0 0 0-1.5h-.253a.25.25 0 0 1-.244-.304l.459-2.066A1.75 1.75 0 0 0 9.253 9H9Z",
|
|
160
169
|
warning: "M8.485 2.495c.673-1.167 2.357-1.167 3.03 0l6.28 10.875c.673 1.167-.17 2.625-1.516 2.625H3.72c-1.347 0-2.189-1.458-1.515-2.625L8.485 2.495ZM10 5a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 10 5Zm0 9a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z",
|
|
161
170
|
error: "M10 18a8 8 0 1 0 0-16 8 8 0 0 0 0 16ZM8.28 7.22a.75.75 0 0 0-1.06 1.06L8.94 10l-1.72 1.72a.75.75 0 1 0 1.06 1.06L10 11.06l1.72 1.72a.75.75 0 1 0 1.06-1.06L11.06 10l1.72-1.72a.75.75 0 0 0-1.06-1.06L10 8.94 8.28 7.22Z"
|
|
162
|
-
},
|
|
163
|
-
dismiss: [
|
|
164
|
-
bell:
|
|
165
|
-
notification:
|
|
171
|
+
}, q = "M6.28 5.22a.75.75 0 0 0-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 1 0 1.06 1.06L10 11.06l3.72 3.72a.75.75 0 1 0 1.06-1.06L11.06 10l3.72-3.72a.75.75 0 0 0-1.06-1.06L10 8.94 6.28 5.22Z", fe = "M10 3a7 7 0 0 1 7 7", pe = ["M10 2a6 6 0 0 0-6 6c0 1.887-.454 3.665-1.257 5.234a.75.75 0 0 0 .515 1.076 32.91 32.91 0 0 0 3.256.508 3.5 3.5 0 0 0 6.972 0 32.903 32.903 0 0 0 3.256-.508.75.75 0 0 0 .515-1.076A11.448 11.448 0 0 1 16 8a6 6 0 0 0-6-6ZM8.05 14.943a33.54 33.54 0 0 0 3.9 0 2 2 0 0 1-3.9 0Z"], me = ["M4 8c0-.26.017-.517.049-.77l7.722 7.723a33.56 33.56 0 0 1-3.722-.01 2 2 0 0 0 3.862.15l1.134 1.134a3.5 3.5 0 0 1-6.53-1.409 32.91 32.91 0 0 1-3.257-.508.75.75 0 0 1-.515-1.076A11.448 11.448 0 0 0 4 8ZM17.266 13.9a.756.756 0 0 1-.068.116L6.389 3.207A6 6 0 0 1 16 8c.001 1.887.455 3.665 1.258 5.234a.75.75 0 0 1 .01.666ZM3.28 2.22a.75.75 0 0 0-1.06 1.06l14.5 14.5a.75.75 0 1 0 1.06-1.06L3.28 2.22Z"], he = ["M1 11.27c0-.246.033-.492.099-.73l1.523-5.521A2.75 2.75 0 0 1 5.273 3h9.454a2.75 2.75 0 0 1 2.651 2.019l1.523 5.52c.066.239.099.485.099.732V15a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2v-3.73Zm3.068-5.852A1.25 1.25 0 0 1 5.273 4.5h9.454a1.25 1.25 0 0 1 1.205.918l1.523 5.52c.006.02.01.041.015.062H14a1 1 0 0 0-.86.49l-.606 1.02a1 1 0 0 1-.86.49H8.236a1 1 0 0 1-.894-.553l-.448-.894A1 1 0 0 0 6 11H2.53l.015-.062 1.523-5.52Z"], ge = {
|
|
172
|
+
dismiss: [q],
|
|
173
|
+
bell: pe,
|
|
174
|
+
notification: pe,
|
|
166
175
|
read: ["M16.704 4.153a.75.75 0 0 1 .143 1.052l-8 10.5a.75.75 0 0 1-1.127.075l-4.5-4.5a.75.75 0 0 1 1.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 0 1 1.05-.143Z"],
|
|
167
176
|
unread: ["M3 4a2 2 0 0 0-2 2v1.161l8.441 4.221a1.25 1.25 0 0 0 1.118 0L19 7.162V6a2 2 0 0 0-2-2H3Z", "m19 8.839-7.77 3.885a2.75 2.75 0 0 1-2.46 0L1 8.839V14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V8.839Z"],
|
|
168
177
|
archive: ["M2 3a1 1 0 0 0-1 1v1a1 1 0 0 0 1 1h16a1 1 0 0 0 1-1V4a1 1 0 0 0-1-1H2Z", "M2 7.5h16l-.811 7.71a2 2 0 0 1-1.99 1.79H4.802a2 2 0 0 1-1.99-1.79L2 7.5ZM7 11a1 1 0 0 1 1-1h4a1 1 0 1 1 0 2H8a1 1 0 0 1-1-1Z"],
|
|
169
|
-
unarchive:
|
|
178
|
+
unarchive: he,
|
|
170
179
|
snooze: ["M10 18a8 8 0 1 0 0-16 8 8 0 0 0 0 16Zm.75-13a.75.75 0 0 0-1.5 0v5c0 .414.336.75.75.75h4a.75.75 0 0 0 0-1.5h-3.25V5Z"],
|
|
171
|
-
unsnooze:
|
|
172
|
-
mute:
|
|
173
|
-
unmute:
|
|
180
|
+
unsnooze: he,
|
|
181
|
+
mute: me,
|
|
182
|
+
unmute: pe,
|
|
174
183
|
pause: ["M2 10a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm5-2.25A.75.75 0 0 1 7.75 7h.5a.75.75 0 0 1 .75.75v4.5a.75.75 0 0 1-.75.75h-.5a.75.75 0 0 1-.75-.75v-4.5Zm4 0a.75.75 0 0 1 .75-.75h.5a.75.75 0 0 1 .75.75v4.5a.75.75 0 0 1-.75.75h-.5a.75.75 0 0 1-.75-.75v-4.5Z"],
|
|
175
|
-
paused:
|
|
184
|
+
paused: me,
|
|
176
185
|
more: ["M3 10a1.5 1.5 0 1 1 3 0 1.5 1.5 0 0 1-3 0ZM8.5 10a1.5 1.5 0 1 1 3 0 1.5 1.5 0 0 1-3 0ZM15.5 8.5a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3Z"],
|
|
177
186
|
delete: ["M8.75 1A2.75 2.75 0 0 0 6 3.75v.443c-.795.077-1.584.176-2.365.298a.75.75 0 1 0 .23 1.482l.149-.022.841 10.518A2.75 2.75 0 0 0 7.596 19h4.807a2.75 2.75 0 0 0 2.742-2.53l.841-10.52.149.023a.75.75 0 0 0 .23-1.482A41.03 41.03 0 0 0 14 4.193V3.75A2.75 2.75 0 0 0 11.25 1h-2.5ZM10 4c.84 0 1.673.025 2.5.075V3.75c0-.69-.56-1.25-1.25-1.25h-2.5c-.69 0-1.25.56-1.25 1.25v.325C8.327 4.025 9.16 4 10 4ZM8.58 7.72a.75.75 0 0 0-1.5.06l.3 7.5a.75.75 0 1 0 1.5-.06l-.3-7.5Zm4.34.06a.75.75 0 1 0-1.5-.06l-.3 7.5a.75.75 0 1 0 1.5.06l.3-7.5Z"],
|
|
178
|
-
empty:
|
|
187
|
+
empty: he,
|
|
179
188
|
result: ["M10 18a8 8 0 1 0 0-16 8 8 0 0 0 0 16Zm3.857-9.809a.75.75 0 0 0-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 1 0-1.06 1.061l2.5 2.5a.75.75 0 0 0 1.137-.089l4-5.5Z"],
|
|
180
189
|
announcement: ["M13.92 3.845a19.362 19.362 0 0 1-6.3 1.98C6.765 5.942 5.89 6 5 6a4 4 0 0 0-.504 7.969 15.97 15.97 0 0 0 1.271 3.34c.397.771 1.342 1 2.05.59l.867-.5c.726-.419.94-1.32.588-2.02-.166-.331-.315-.666-.448-1.004 1.8.357 3.511.963 5.096 1.78A17.964 17.964 0 0 0 15 10c0-2.162-.381-4.235-1.08-6.155ZM15.243 3.097A19.456 19.456 0 0 1 16.5 10c0 2.43-.445 4.758-1.257 6.904l-.03.077a.75.75 0 0 0 1.401.537 20.903 20.903 0 0 0 1.312-5.745 2 2 0 0 0 0-3.546 20.902 20.902 0 0 0-1.312-5.745.75.75 0 0 0-1.4.537l.029.078Z"]
|
|
181
|
-
},
|
|
182
|
-
function
|
|
183
|
-
|
|
190
|
+
}, J = null;
|
|
191
|
+
function _e(e) {
|
|
192
|
+
J = e;
|
|
184
193
|
}
|
|
185
|
-
function
|
|
186
|
-
return
|
|
194
|
+
function ve(e, t = {}) {
|
|
195
|
+
return J?.(e, t) ?? null;
|
|
187
196
|
}
|
|
188
|
-
function
|
|
189
|
-
let i = K(n, e) ?? (r ? r(e, t) :
|
|
197
|
+
function ye(e, t, n = {}, r) {
|
|
198
|
+
let i = K(n, e) ?? (r ? r(e, t) : ve(e, t));
|
|
190
199
|
return i == null || i === !1 ? void 0 : i;
|
|
191
200
|
}
|
|
192
201
|
// ../js/translations.ts
|
|
193
|
-
var
|
|
202
|
+
var be = {
|
|
194
203
|
toaster_label: "Notifications",
|
|
195
204
|
toaster_label_with_hotkey: ":label (:hotkey)",
|
|
196
205
|
toaster_hotkey_alt: "Alt",
|
|
@@ -329,28 +338,28 @@ var ye = {
|
|
|
329
338
|
preferences_retry: "Try again",
|
|
330
339
|
preferences_save_failed: "Your preferences could not be saved.",
|
|
331
340
|
preferences_push_device_remove_failed: "The device could not be removed."
|
|
332
|
-
},
|
|
333
|
-
function
|
|
334
|
-
for (let [t, n] of Object.entries(e)) n !== void 0 && (
|
|
335
|
-
}
|
|
336
|
-
var Se = (e) => Object.hasOwn(be, e) ? be[e] : void 0;
|
|
337
|
-
function Ce(e, t = {}) {
|
|
338
|
-
return typeof e == "function" ? e(t) : T(e, t);
|
|
341
|
+
}, xe = Object.assign(Object.create(null), be);
|
|
342
|
+
function Se(e) {
|
|
343
|
+
for (let [t, n] of Object.entries(e)) n !== void 0 && (xe[t] = n);
|
|
339
344
|
}
|
|
345
|
+
var Ce = (e) => Object.hasOwn(xe, e) ? xe[e] : void 0;
|
|
340
346
|
function we(e, t = {}) {
|
|
341
|
-
|
|
342
|
-
|
|
347
|
+
return typeof e == "function" ? e(t) : y(e, t);
|
|
348
|
+
}
|
|
349
|
+
function Te(e, t = {}) {
|
|
350
|
+
let n = Ce(e);
|
|
351
|
+
return n === void 0 ? e : we(n, t);
|
|
343
352
|
}
|
|
344
|
-
var
|
|
345
|
-
function
|
|
346
|
-
return Object.fromEntries(t.map((t) => [t,
|
|
353
|
+
var Ee = (e, t) => e + t.replace(/[A-Z]/g, (e) => `_${e.toLowerCase()}`);
|
|
354
|
+
function De(e, t) {
|
|
355
|
+
return Object.fromEntries(t.map((t) => [t, be[Ee(e, t)]]));
|
|
347
356
|
}
|
|
348
|
-
function
|
|
357
|
+
function Oe(e, t, n) {
|
|
349
358
|
let r = (e) => n && Object.hasOwn(n, e) ? n[e] : void 0;
|
|
350
|
-
return Object.fromEntries(t.map((t) => [t, r(t) ??
|
|
359
|
+
return Object.fromEntries(t.map((t) => [t, r(t) ?? Ce(Ee(e, t)) ?? Ee(e, t)]));
|
|
351
360
|
}
|
|
352
361
|
// ../js/inbox.ts
|
|
353
|
-
var
|
|
362
|
+
var ke = [
|
|
354
363
|
"read",
|
|
355
364
|
"unread",
|
|
356
365
|
"seen",
|
|
@@ -359,41 +368,41 @@ var Oe = [
|
|
|
359
368
|
"snooze",
|
|
360
369
|
"unsnooze",
|
|
361
370
|
"delete"
|
|
362
|
-
],
|
|
371
|
+
], Ae = [
|
|
363
372
|
"snooze",
|
|
364
373
|
"archive",
|
|
365
374
|
"mute",
|
|
366
375
|
"delete"
|
|
367
|
-
],
|
|
376
|
+
], je = [
|
|
368
377
|
"snooze",
|
|
369
378
|
"archive",
|
|
370
379
|
"mute"
|
|
371
|
-
],
|
|
380
|
+
], Me = {
|
|
372
381
|
archive: "archive",
|
|
373
382
|
unarchive: "archive",
|
|
374
383
|
snooze: "snooze",
|
|
375
384
|
unsnooze: "snooze",
|
|
376
385
|
delete: "delete"
|
|
377
|
-
},
|
|
386
|
+
}, Ne = (e, t) => (e !== "snoozed" || t.includes("snooze")) && (e !== "archived" || t.includes("archive")), Pe = 100, Fe = "inertiauiInbox", Y = (e) => e ? Date.parse(e) : NaN, Ie = ({ counts: e, category: t, categoryCounts: n }) => t === null ? e.unread : n[t] ?? 0, Le = (e) => e.expiresAt !== null && Y(e.expiresAt) <= Date.now(), Re = (e, t = Date.now()) => e.snoozedUntil !== null && Y(e.snoozedUntil) > t, ze = (e, t, n) => {
|
|
378
387
|
if (t === null || n === 0) return e;
|
|
379
388
|
let { [t]: r = 0, ...i } = e, a = Math.max(0, r + n);
|
|
380
389
|
return a === 0 ? i : {
|
|
381
390
|
...i,
|
|
382
391
|
[t]: a
|
|
383
392
|
};
|
|
384
|
-
},
|
|
393
|
+
}, Be = (e, t) => Y(e.createdAt) > Y(t.createdAt) || Y(e.createdAt) === Y(t.createdAt) && e.total > t.total, Ve = (e, t) => {
|
|
385
394
|
let n = new Map(t.map((e) => [e.id, e])), r = e.filter((e) => {
|
|
386
395
|
let t = n.get(e.id);
|
|
387
|
-
return t === void 0 ||
|
|
396
|
+
return t === void 0 || Be(e, t);
|
|
388
397
|
}), i = new Set(r.map((e) => e.id));
|
|
389
398
|
return [...r, ...t.filter((e) => !i.has(e.id))];
|
|
390
|
-
},
|
|
399
|
+
}, He = (e, { latest: t, latestIds: n }) => t !== null && (Y(e.createdAt) < Y(t) || Y(e.createdAt) === Y(t) && n.includes(e.id)), Ue = (e) => N(e) ? {
|
|
391
400
|
name: P(e.name) ?? void 0,
|
|
392
401
|
avatar: L(e.avatar)
|
|
393
402
|
} : null;
|
|
394
|
-
function
|
|
403
|
+
function We(e) {
|
|
395
404
|
if (!N(e) || typeof e.id != "string" || typeof e.title != "string" || typeof e.createdAt != "string") return;
|
|
396
|
-
let t =
|
|
405
|
+
let t = Ue(e.actor), n = (Array.isArray(e.actors) ? e.actors.map(Ue) : [t]).filter((e) => e !== null);
|
|
397
406
|
return {
|
|
398
407
|
id: e.id,
|
|
399
408
|
type: P(e.type) ?? "",
|
|
@@ -424,8 +433,8 @@ function Ue(e) {
|
|
|
424
433
|
expiresAt: P(e.expiresAt)
|
|
425
434
|
};
|
|
426
435
|
}
|
|
427
|
-
var
|
|
428
|
-
let t = N(e) ?
|
|
436
|
+
var Ge = (e) => Array.isArray(e) ? {} : N(e) ? Object.fromEntries(Object.entries(e).filter((e) => typeof e[1] == "number")) : void 0, Ke = (e) => {
|
|
437
|
+
let t = N(e) ? Ge(e.categories) : void 0;
|
|
429
438
|
return N(e) && typeof e.unread == "number" && typeof e.unseen == "number" && typeof e.revision == "number" && (e.latest === null || typeof e.latest == "string") && Array.isArray(e.latestIds) && t !== void 0 ? {
|
|
430
439
|
unread: e.unread,
|
|
431
440
|
unseen: e.unseen,
|
|
@@ -437,7 +446,7 @@ var We = (e) => Array.isArray(e) ? {} : N(e) ? Object.fromEntries(Object.entries
|
|
|
437
446
|
},
|
|
438
447
|
context: P(e.context)
|
|
439
448
|
} : void 0;
|
|
440
|
-
},
|
|
449
|
+
}, qe = (e) => N(e) ? Object.fromEntries(Object.entries(e).filter((e) => typeof e[1] == "string")) : {}, Je = (e) => Array.isArray(e) ? e.filter((e) => e === "tomorrow" || typeof e == "number" && Number.isInteger(e) && e > 0) : dt, Ye = (e) => N(e) ? Object.fromEntries(Object.entries(e).filter((e) => N(e[1])).map(([e, t]) => [e, {
|
|
441
450
|
label: P(t.label) ?? e,
|
|
442
451
|
category: P(t.category),
|
|
443
452
|
data: N(t.data) ? Object.fromEntries(Object.entries(t.data).filter((e) => [
|
|
@@ -445,8 +454,8 @@ var We = (e) => Array.isArray(e) ? {} : N(e) ? Object.fromEntries(Object.entries
|
|
|
445
454
|
"number",
|
|
446
455
|
"boolean"
|
|
447
456
|
].includes(typeof e[1]))) : {}
|
|
448
|
-
}])) : {},
|
|
449
|
-
function
|
|
457
|
+
}])) : {}, Xe = (e, t) => t !== void 0 && (t.category === null || e.category === t.category) && Object.entries(t.data).every(([t, n]) => e.data[t] === n);
|
|
458
|
+
function Ze(e) {
|
|
450
459
|
if (!N(e)) return;
|
|
451
460
|
if (e.kind === "item") return typeof e.id == "string" ? {
|
|
452
461
|
kind: "item",
|
|
@@ -462,7 +471,7 @@ function Xe(e) {
|
|
|
462
471
|
ids: e.ids.filter((e) => typeof e == "string")
|
|
463
472
|
} : void 0;
|
|
464
473
|
if (e.kind === "update") {
|
|
465
|
-
let t =
|
|
474
|
+
let t = We(e.item);
|
|
466
475
|
return t === void 0 ? void 0 : {
|
|
467
476
|
kind: "update",
|
|
468
477
|
item: t
|
|
@@ -478,7 +487,7 @@ function Xe(e) {
|
|
|
478
487
|
until: e.until
|
|
479
488
|
} : void 0;
|
|
480
489
|
if (e.kind === "items") {
|
|
481
|
-
let t =
|
|
490
|
+
let t = ke.find((t) => t === e.action);
|
|
482
491
|
if (t === void 0 || t === "delete" || !Array.isArray(e.ids) || typeof e.at != "string" || t === "snooze" && typeof e.until != "string") return;
|
|
483
492
|
let n = e.ids.filter((e) => typeof e == "string");
|
|
484
493
|
return t === "snooze" ? {
|
|
@@ -509,25 +518,25 @@ function Xe(e) {
|
|
|
509
518
|
category: n
|
|
510
519
|
} : void 0;
|
|
511
520
|
}
|
|
512
|
-
var
|
|
521
|
+
var Qe = (e, t) => t.split(".").reduce((e, t) => N(e) ? e[t] : void 0, e), $e = () => ({
|
|
513
522
|
unread: 0,
|
|
514
523
|
unseen: 0,
|
|
515
524
|
categories: {}
|
|
516
|
-
}),
|
|
525
|
+
}), et = 2147483647, tt = (e, { before: t, ids: n, category: r }) => {
|
|
517
526
|
if (r !== null && e.category !== r) return !1;
|
|
518
527
|
let i = Y(e.createdAt);
|
|
519
528
|
return i < Y(t) || i === Y(t) && (n === null || n.includes(e.id));
|
|
520
|
-
},
|
|
529
|
+
}, nt = (e, t, n) => tt(e, t) ? t.kind === "archive" ? e.archivedAt === null && (!t.onlyRead || e.readAt !== null) ? {
|
|
521
530
|
...e,
|
|
522
531
|
archivedAt: n
|
|
523
532
|
} : e : t.kind === "seen" ? e.seenAt === null ? {
|
|
524
533
|
...e,
|
|
525
534
|
seenAt: n
|
|
526
|
-
} : e : e.readAt === null && e.archivedAt === null && !
|
|
535
|
+
} : e : e.readAt === null && e.archivedAt === null && !Re(e) ? {
|
|
527
536
|
...e,
|
|
528
537
|
readAt: n,
|
|
529
538
|
seenAt: e.seenAt ?? n
|
|
530
|
-
} : e : e,
|
|
539
|
+
} : e : e, rt = (e, { action: t, ids: n, at: r, until: i }) => n.includes(e.id) ? t === "read" ? e.readAt === null ? {
|
|
531
540
|
...e,
|
|
532
541
|
readAt: r,
|
|
533
542
|
seenAt: e.seenAt ?? r
|
|
@@ -549,21 +558,21 @@ var Ze = (e, t) => t.split(".").reduce((e, t) => N(e) ? e[t] : void 0, e), Qe =
|
|
|
549
558
|
} : t === "unsnooze" ? e.snoozedUntil === null ? e : {
|
|
550
559
|
...e,
|
|
551
560
|
snoozedUntil: null
|
|
552
|
-
} : e : e,
|
|
561
|
+
} : e : e, it = (e, t, n) => t.kind === "items" ? rt(e, t) : nt(e, t, n), at = ({ readAt: e, seenAt: t, archivedAt: n, snoozedUntil: r, result: i }) => ({
|
|
553
562
|
readAt: e,
|
|
554
563
|
seenAt: t,
|
|
555
564
|
archivedAt: n,
|
|
556
565
|
snoozedUntil: r,
|
|
557
566
|
result: i
|
|
558
567
|
});
|
|
559
|
-
function
|
|
560
|
-
let e, t =
|
|
568
|
+
function ot() {
|
|
569
|
+
let e, t = Fe, n, r = 0, i, a, o = null, s = null, c = je, l = !0, u = {}, d = dt, f = {}, p = null, m, h, g = {
|
|
561
570
|
unread: 0,
|
|
562
571
|
unseen: 0
|
|
563
572
|
}, _ = {}, v = [], y = [], b = "all", x = null, S = "idle", C = !1, w = !1, T = null, E = 0, D, O = {}, k = 0, A = 0, j = /* @__PURE__ */ new Set(), M = /* @__PURE__ */ new Map(), F = [], I = [], R = /* @__PURE__ */ new Set(), z = /* @__PURE__ */ new Set(), B = /* @__PURE__ */ new Map(), ee = /* @__PURE__ */ new Map(), V = !1, te = {
|
|
564
573
|
until: null,
|
|
565
574
|
revision: -Infinity
|
|
566
|
-
},
|
|
575
|
+
}, U = null, ie, oe = null, se = /* @__PURE__ */ new Set(), ce = /* @__PURE__ */ new Set(), ue = /* @__PURE__ */ new Set(), G = /* @__PURE__ */ new Set(), K, de = (e, t, n) => {
|
|
567
576
|
let r = M.get(e);
|
|
568
577
|
(!r || n > r.revision) && M.set(e, {
|
|
569
578
|
state: t,
|
|
@@ -582,8 +591,8 @@ function at() {
|
|
|
582
591
|
...r,
|
|
583
592
|
...a.state
|
|
584
593
|
}, n = a.revision);
|
|
585
|
-
for (let e of F) e.revision > n && (r =
|
|
586
|
-
for (let t of I) t.kind === "bulk" ? r =
|
|
594
|
+
for (let e of F) e.revision > n && (r = it(r, e.change, e.at));
|
|
595
|
+
for (let t of I) t.kind === "bulk" ? r = it(r, t.change, t.at) : t.kind === "mute" && t.group === r.group ? r = {
|
|
587
596
|
...r,
|
|
588
597
|
muted: t.muted
|
|
589
598
|
} : t.kind === "item" && t.id === e.id && (t.createdAt === null || Y(e.createdAt) <= Y(t.createdAt)) && (r = {
|
|
@@ -591,13 +600,13 @@ function at() {
|
|
|
591
600
|
...t.state
|
|
592
601
|
});
|
|
593
602
|
return r;
|
|
594
|
-
}, fe = (e) => z.has(e) || I.some((t) => t.kind === "delete" && t.ids.includes(e)), pe = (e, t, n = null) => fe(e.id) ||
|
|
603
|
+
}, fe = (e) => z.has(e) || I.some((t) => t.kind === "delete" && t.ids.includes(e)), pe = (e, t, n = null) => fe(e.id) || Le(e) || n !== null && e.category !== n ? !1 : t === "archived" || e.archivedAt !== null ? t === "archived" && e.archivedAt !== null : Re(e) === (t === "snoozed") ? t === "unread" ? e.readAt === null || R.has(e.id) : t === "all" || t === "snoozed" || Xe(e, Object.hasOwn(f, t) ? f[t] : void 0) : !1, me = () => {
|
|
595
604
|
let e = I.reduce((e, t) => t.kind === "pause" ? t.until : e, void 0), t = e === void 0 ? te.until : e;
|
|
596
605
|
return V && t !== null && Y(t) > Date.now() ? t : null;
|
|
597
606
|
}, he = (e) => {
|
|
598
|
-
e !== oe && (clearTimeout(
|
|
607
|
+
e !== oe && (clearTimeout(ie), ie = void 0, oe = e, e !== null && (ie = setTimeout(() => {
|
|
599
608
|
oe = null, me() === null ? J() : he(e);
|
|
600
|
-
}, Math.min(Y(e) - Date.now(),
|
|
609
|
+
}, Math.min(Y(e) - Date.now(), et))));
|
|
601
610
|
}, ge = (e, t) => {
|
|
602
611
|
t > te.revision && (te = {
|
|
603
612
|
until: e,
|
|
@@ -605,7 +614,7 @@ function at() {
|
|
|
605
614
|
});
|
|
606
615
|
}, J = () => {
|
|
607
616
|
let e = me();
|
|
608
|
-
he(e),
|
|
617
|
+
he(e), K = {
|
|
609
618
|
url: a,
|
|
610
619
|
user: i,
|
|
611
620
|
channel: o,
|
|
@@ -615,7 +624,7 @@ function at() {
|
|
|
615
624
|
categoryFilter: u,
|
|
616
625
|
tabs: f,
|
|
617
626
|
counts: g,
|
|
618
|
-
items:
|
|
627
|
+
items: Ve(y, v).map(q).filter((e) => pe(e, b, x)),
|
|
619
628
|
arrived: y,
|
|
620
629
|
filter: b,
|
|
621
630
|
category: x,
|
|
@@ -628,18 +637,18 @@ function at() {
|
|
|
628
637
|
pausedUntil: e,
|
|
629
638
|
canPause: V,
|
|
630
639
|
pausePresets: d
|
|
631
|
-
},
|
|
640
|
+
}, se.forEach((e) => e());
|
|
632
641
|
};
|
|
633
642
|
J();
|
|
634
|
-
let _e =
|
|
643
|
+
let _e = K, ve = (e) => {
|
|
635
644
|
for (let t of e) {
|
|
636
645
|
let e = Y(t.createdAt);
|
|
637
646
|
D === void 0 || e > Y(D.at) ? D = {
|
|
638
647
|
at: t.createdAt,
|
|
639
648
|
ids: /* @__PURE__ */ new Set([t.id])
|
|
640
|
-
} : e === Y(D.at) && D.ids.add(t.id), t.revision !== null && de(t.id,
|
|
649
|
+
} : e === Y(D.at) && D.ids.add(t.id), t.revision !== null && de(t.id, at(t), t.revision);
|
|
641
650
|
}
|
|
642
|
-
}, ye = () => (/* @__PURE__ */ new Date()).toISOString(), be = () => h !== void 0 && h.counted.latest !== null && (D === void 0 || Y(h.counted.latest) > Y(D.at)), xe = (e) => e.archivedAt === null && !
|
|
651
|
+
}, ye = () => (/* @__PURE__ */ new Date()).toISOString(), be = () => h !== void 0 && h.counted.latest !== null && (D === void 0 || Y(h.counted.latest) > Y(D.at)), xe = (e) => e.archivedAt === null && !Re(e), Se = (e) => xe(e) ? {
|
|
643
652
|
unread: +(e.readAt === null),
|
|
644
653
|
unseen: +(e.seenAt === null)
|
|
645
654
|
} : {
|
|
@@ -650,8 +659,8 @@ function at() {
|
|
|
650
659
|
g = {
|
|
651
660
|
unread: g.unread + t,
|
|
652
661
|
unseen: g.unseen + n
|
|
653
|
-
}, _ =
|
|
654
|
-
}, we = (e) => h === void 0 || !
|
|
662
|
+
}, _ = ze(_, e.category, t);
|
|
663
|
+
}, we = (e) => h === void 0 || !He(e, h.counted), Te = () => {
|
|
655
664
|
if (!(h === void 0 || I.length > 0)) {
|
|
656
665
|
g = {
|
|
657
666
|
unread: h.unread,
|
|
@@ -660,24 +669,24 @@ function at() {
|
|
|
660
669
|
for (let e of y) we(e) && Ce(q(e));
|
|
661
670
|
}
|
|
662
671
|
}, Ee = (e) => {
|
|
663
|
-
let t =
|
|
672
|
+
let t = Ke(N(e) ? e.counts : void 0);
|
|
664
673
|
!t || t.context !== p || h !== void 0 && t.revision < h.revision || (h = t, Te());
|
|
665
674
|
}, De = ({ unread: e, unseen: t, categories: n }, r) => {
|
|
666
675
|
g = {
|
|
667
676
|
unread: Math.max(0, g.unread + r * e),
|
|
668
677
|
unseen: Math.max(0, g.unseen + r * t)
|
|
669
|
-
}, _ = Object.entries(n).reduce((e, [t, n]) =>
|
|
678
|
+
}, _ = Object.entries(n).reduce((e, [t, n]) => ze(e, t, r * n), _);
|
|
670
679
|
}, Oe = (e, t) => {
|
|
671
680
|
if (e.kind === "item") {
|
|
672
681
|
let { kind: n, id: r, ...i } = e;
|
|
673
682
|
de(r, i, t);
|
|
674
|
-
} else if (e.kind === "delete")
|
|
683
|
+
} else if (e.kind === "delete") ke(e.ids);
|
|
675
684
|
else if (e.kind === "update") {
|
|
676
685
|
let n = {
|
|
677
686
|
...e.item,
|
|
678
687
|
revision: e.item.revision ?? t
|
|
679
688
|
}, r = B.get(n.id);
|
|
680
|
-
(r === void 0 || (r.revision ?? 0) < n.revision) && B.set(n.id, n), de(n.id,
|
|
689
|
+
(r === void 0 || (r.revision ?? 0) < n.revision) && B.set(n.id, n), de(n.id, at(n), n.revision);
|
|
681
690
|
} else if (e.kind === "mute") {
|
|
682
691
|
let n = ee.get(e.group);
|
|
683
692
|
(n === void 0 || n.revision < t) && ee.set(e.group, {
|
|
@@ -689,35 +698,35 @@ function at() {
|
|
|
689
698
|
at: ye(),
|
|
690
699
|
revision: t
|
|
691
700
|
}];
|
|
692
|
-
},
|
|
701
|
+
}, ke = (e) => {
|
|
693
702
|
e.forEach((e) => z.add(e)), y = y.filter((e) => !z.has(e.id)), v = v.filter((e) => !z.has(e.id));
|
|
694
|
-
},
|
|
695
|
-
r++, E++, i = void 0, a = void 0, o = null, s = null, c =
|
|
703
|
+
}, Ie = () => {
|
|
704
|
+
r++, E++, i = void 0, a = void 0, o = null, s = null, c = je, l = !0, u = {}, d = dt, f = {}, p = null, m = void 0, h = void 0, g = {
|
|
696
705
|
unread: 0,
|
|
697
706
|
unseen: 0
|
|
698
707
|
}, _ = {}, v = [], y = [], b = "all", x = null, S = "idle", C = !1, w = !1, T = null, D = void 0, O = {}, M.clear(), F = [], I = [], R.clear(), z.clear(), B.clear(), ee.clear(), V = !1, te = {
|
|
699
708
|
until: null,
|
|
700
709
|
revision: -Infinity
|
|
701
|
-
},
|
|
702
|
-
},
|
|
710
|
+
}, U = null;
|
|
711
|
+
}, Ue = async (t) => {
|
|
703
712
|
let n = new URLSearchParams({ filter: b });
|
|
704
713
|
x !== null && n.set("category", x), t && n.set("cursor", t);
|
|
705
714
|
let r = await e.request("get", `${a}?${n.toString()}`);
|
|
706
715
|
return {
|
|
707
|
-
items: N(r) && Array.isArray(r.items) ? r.items.map(
|
|
716
|
+
items: N(r) && Array.isArray(r.items) ? r.items.map(We).filter((e) => e !== void 0) : [],
|
|
708
717
|
cursor: N(r) && typeof r.nextCursor == "string" ? r.nextCursor : null,
|
|
709
718
|
body: r
|
|
710
719
|
};
|
|
711
|
-
},
|
|
720
|
+
}, Ge = async (t, i, o) => {
|
|
712
721
|
if (!e || a === void 0) return;
|
|
713
722
|
let s = r;
|
|
714
723
|
I = [...I, t], De(t.delta, 1), J();
|
|
715
724
|
try {
|
|
716
725
|
let n = await e.request("post", `${a}/${i}`, o);
|
|
717
726
|
if (s !== r) return;
|
|
718
|
-
let c = N(n) ? n : {}, l =
|
|
727
|
+
let c = N(n) ? n : {}, l = Ze(c.change), u = Ke(c.counts)?.revision;
|
|
719
728
|
if (!l || u === void 0) throw Error("The inbox endpoint answered without the change and the counts.");
|
|
720
|
-
I = I.filter((e) => e !== t), Oe(l, u), Ee(c),
|
|
729
|
+
I = I.filter((e) => e !== t), Oe(l, u), Ee(c), G.forEach((e) => e({
|
|
721
730
|
change: l,
|
|
722
731
|
counts: c.counts
|
|
723
732
|
}));
|
|
@@ -734,11 +743,11 @@ function at() {
|
|
|
734
743
|
return {
|
|
735
744
|
unread: e.unread + a,
|
|
736
745
|
unseen: e.unseen + i.unseen - r.unseen,
|
|
737
|
-
categories: t.category === null || a === 0 ? e.categories :
|
|
746
|
+
categories: t.category === null || a === 0 ? e.categories : ze(e.categories, t.category, a)
|
|
738
747
|
};
|
|
739
|
-
},
|
|
748
|
+
}, $e()), nt = (e, t, n) => {
|
|
740
749
|
let r = t.map((e) => e.id);
|
|
741
|
-
if (e === "delete") return
|
|
750
|
+
if (e === "delete") return Ge({
|
|
742
751
|
kind: "delete",
|
|
743
752
|
ids: r,
|
|
744
753
|
delta: tt(t.map((e) => ({
|
|
@@ -757,14 +766,14 @@ function at() {
|
|
|
757
766
|
...n === void 0 ? {} : { until: n }
|
|
758
767
|
}, a = tt(t.map((e) => ({
|
|
759
768
|
before: e,
|
|
760
|
-
after:
|
|
769
|
+
after: rt(e, i)
|
|
761
770
|
})));
|
|
762
|
-
return e === "seen" ?
|
|
771
|
+
return e === "seen" ? Ge({
|
|
763
772
|
kind: "bulk",
|
|
764
773
|
change: i,
|
|
765
774
|
at: i.at,
|
|
766
775
|
delta: a
|
|
767
|
-
}, "seen/items", { ids: r }) :
|
|
776
|
+
}, "seen/items", { ids: r }) : Ge({
|
|
768
777
|
kind: "bulk",
|
|
769
778
|
change: i,
|
|
770
779
|
at: i.at,
|
|
@@ -779,7 +788,7 @@ function at() {
|
|
|
779
788
|
...e,
|
|
780
789
|
...t
|
|
781
790
|
}), o = a.unread - i.unread;
|
|
782
|
-
return
|
|
791
|
+
return Ge({
|
|
783
792
|
kind: "item",
|
|
784
793
|
id: e.id,
|
|
785
794
|
state: t,
|
|
@@ -790,11 +799,11 @@ function at() {
|
|
|
790
799
|
categories: e.category === null ? {} : { [e.category]: o }
|
|
791
800
|
}
|
|
792
801
|
}, `${encodeURIComponent(e.id)}/${n}`, r);
|
|
793
|
-
}, st = (e, t, n) =>
|
|
802
|
+
}, st = (e, t, n) => Ge({
|
|
794
803
|
kind: "mute",
|
|
795
804
|
group: t,
|
|
796
805
|
muted: n,
|
|
797
|
-
delta:
|
|
806
|
+
delta: $e()
|
|
798
807
|
}, `${encodeURIComponent(e.id)}/${n ? "mute" : "unmute"}`), ct = (e, t, n, r, i) => {
|
|
799
808
|
let a = D ? {
|
|
800
809
|
before: D.at,
|
|
@@ -807,7 +816,7 @@ function at() {
|
|
|
807
816
|
...t === null ? {} : { category: t },
|
|
808
817
|
...i
|
|
809
818
|
};
|
|
810
|
-
return
|
|
819
|
+
return Ge({
|
|
811
820
|
kind: "bulk",
|
|
812
821
|
change: {
|
|
813
822
|
...e,
|
|
@@ -831,28 +840,28 @@ function at() {
|
|
|
831
840
|
unseen: -g.unseen,
|
|
832
841
|
categories: e ? Object.fromEntries(Object.entries(_).map(([e, t]) => [e, -t])) : {}
|
|
833
842
|
};
|
|
834
|
-
},
|
|
843
|
+
}, ut = (e) => {
|
|
835
844
|
let t = y.find((t) => t.id === e) ?? v.find((t) => t.id === e);
|
|
836
845
|
return t && q(t);
|
|
837
846
|
}, ft = (e) => {
|
|
838
|
-
let t = typeof e == "string" ? e : e.id, n = typeof e == "string" ?
|
|
839
|
-
return n === void 0 ?
|
|
847
|
+
let t = typeof e == "string" ? e : e.id, n = typeof e == "string" ? ut(e) : q(e), r = ye();
|
|
848
|
+
return n === void 0 ? Ge({
|
|
840
849
|
kind: "item",
|
|
841
850
|
id: t,
|
|
842
851
|
state: { readAt: r },
|
|
843
|
-
delta:
|
|
852
|
+
delta: $e(),
|
|
844
853
|
createdAt: null
|
|
845
854
|
}, `${encodeURIComponent(t)}/read`) : n.readAt === null ? (R.add(t), ot(n, {
|
|
846
855
|
readAt: r,
|
|
847
856
|
seenAt: n.seenAt ?? r
|
|
848
857
|
}, "read")) : Promise.resolve();
|
|
849
858
|
}, pt = (e, t) => {
|
|
850
|
-
let n = typeof e == "string" ? e : e.id, r = typeof e == "string" ?
|
|
851
|
-
if (r === void 0) return
|
|
859
|
+
let n = typeof e == "string" ? e : e.id, r = typeof e == "string" ? ut(e) : q(e), i = `${encodeURIComponent(n)}/complete`;
|
|
860
|
+
if (r === void 0) return Ge({
|
|
852
861
|
kind: "item",
|
|
853
862
|
id: n,
|
|
854
863
|
state: {},
|
|
855
|
-
delta:
|
|
864
|
+
delta: $e(),
|
|
856
865
|
createdAt: null
|
|
857
866
|
}, i, { action: t });
|
|
858
867
|
let a = r.actions[t]?.result;
|
|
@@ -860,38 +869,38 @@ function at() {
|
|
|
860
869
|
}, mt = (e, t) => {
|
|
861
870
|
let n = r;
|
|
862
871
|
return () => n === r ? pt(e, t) : Promise.resolve();
|
|
863
|
-
},
|
|
872
|
+
}, ht = (e) => c.includes(e), X = {
|
|
864
873
|
subscribe(e) {
|
|
865
|
-
return
|
|
874
|
+
return se.add(e), () => se.delete(e);
|
|
866
875
|
},
|
|
867
|
-
getSnapshot: () =>
|
|
876
|
+
getSnapshot: () => K,
|
|
868
877
|
getServerSnapshot: () => _e,
|
|
869
878
|
connect(r, i = {}) {
|
|
870
879
|
e = r, t = i.prop ?? t, n = i.onFailure ?? n;
|
|
871
880
|
},
|
|
872
881
|
sync(e, n) {
|
|
873
|
-
let r =
|
|
882
|
+
let r = Qe(e, t), h = n === "history" || n === "cached";
|
|
874
883
|
if (!N(r)) {
|
|
875
|
-
r === null && !h && a !== void 0 && (
|
|
884
|
+
r === null && !h && a !== void 0 && (Ie(), J());
|
|
876
885
|
return;
|
|
877
886
|
}
|
|
878
887
|
let g = P(r.user) ?? void 0;
|
|
879
888
|
if (g !== i) {
|
|
880
889
|
if (h) return;
|
|
881
|
-
|
|
890
|
+
Ie(), i = g;
|
|
882
891
|
}
|
|
883
|
-
if (a = P(r.url) ?? a, o = P(r.channel), s = P(r.announcementsChannel), f =
|
|
892
|
+
if (a = P(r.url) ?? a, o = P(r.channel), s = P(r.announcementsChannel), f = Ye(r.tabs), p = P(r.context), V = N(r.pause), !h) {
|
|
884
893
|
let e = r.allowedActions;
|
|
885
|
-
c = Array.isArray(e) ?
|
|
894
|
+
c = Array.isArray(e) ? Ae.filter((t) => e.includes(t)) : je, l = r.selectable !== !1, u = qe(r.categoryFilter), d = Je(N(r.pause) ? r.pause.presets : void 0);
|
|
886
895
|
}
|
|
887
|
-
|
|
896
|
+
Ne(b, c) || (b = "all", S !== "idle" && X.load()), !h && r !== m && (R.clear(), Ee({ counts: r }), U = r.push ?? null, N(r.pause) && ge(P(r.pause.until), typeof r.revision == "number" ? r.revision : 0)), m = r, J();
|
|
888
897
|
},
|
|
889
898
|
async load(t, n) {
|
|
890
899
|
if (!e || a === void 0) return;
|
|
891
900
|
let i = r, o = ++E;
|
|
892
|
-
x = n === void 0 ? t === void 0 ? x : null : n, b = t ?? b, b =
|
|
901
|
+
x = n === void 0 ? t === void 0 ? x : null : n, b = t ?? b, b = Ne(b, c) ? b : "all", S = "loading", C = !1, w = !1, R.clear(), J();
|
|
893
902
|
try {
|
|
894
|
-
let e = await
|
|
903
|
+
let e = await Ue(null);
|
|
895
904
|
i === r && o === E && (v = e.items, T = e.cursor, S = "ready", ve(e.items), Ee(e.body));
|
|
896
905
|
} catch {
|
|
897
906
|
i === r && o === E && (S = "error");
|
|
@@ -902,7 +911,7 @@ function at() {
|
|
|
902
911
|
if (!e || a === void 0 || T === null || C || S !== "ready" || w && !t) return;
|
|
903
912
|
let n = r, i = E;
|
|
904
913
|
C = !0, w = !1, J();
|
|
905
|
-
let o = await
|
|
914
|
+
let o = await Ue(T).catch(() => void 0);
|
|
906
915
|
if (n === r && i === E) {
|
|
907
916
|
if (o === void 0) w = !0;
|
|
908
917
|
else {
|
|
@@ -925,34 +934,34 @@ function at() {
|
|
|
925
934
|
let i = r;
|
|
926
935
|
try {
|
|
927
936
|
let n = await e.request("get", `${a}/${encodeURIComponent(t)}`);
|
|
928
|
-
return i === r && N(n) ?
|
|
937
|
+
return i === r && N(n) ? X.receive(n.item, n.counts) : void 0;
|
|
929
938
|
} catch {
|
|
930
939
|
return;
|
|
931
940
|
}
|
|
932
941
|
},
|
|
933
942
|
receive(e, t) {
|
|
934
|
-
let n =
|
|
935
|
-
if (!n || a === void 0 || z.has(n.id) || y.some((e) => e.id === n.id && !
|
|
943
|
+
let n = We(e);
|
|
944
|
+
if (!n || a === void 0 || z.has(n.id) || y.some((e) => e.id === n.id && !Be(n, e))) return;
|
|
936
945
|
let r = N(e) ? P(e.context) : null;
|
|
937
946
|
if (p !== null && r !== null && r !== p) return;
|
|
938
947
|
y = [n, ...y.filter((e) => e.id !== n.id)].sort((e, t) => Y(t.createdAt) - Y(e.createdAt)), ve([n]);
|
|
939
948
|
let i = q(n);
|
|
940
|
-
return Ee({ counts: t }), I.length > 0 || h === void 0 ? we(n) && Ce(i) : Te(), J(), k > 0 && S === "ready" && pe(i, b, x) && i.seenAt === null &&
|
|
949
|
+
return Ee({ counts: t }), I.length > 0 || h === void 0 ? we(n) && Ce(i) : Te(), J(), k > 0 && S === "ready" && pe(i, b, x) && i.seenAt === null && X.markAllAsSeen(), ce.forEach((e) => e(n)), n;
|
|
941
950
|
},
|
|
942
951
|
onArrival(e) {
|
|
943
|
-
return
|
|
952
|
+
return ce.add(e), () => ce.delete(e);
|
|
944
953
|
},
|
|
945
954
|
receiveChange(e) {
|
|
946
|
-
let t = N(e) ? e.change : void 0, n =
|
|
955
|
+
let t = N(e) ? e.change : void 0, n = Ze(t), r = Ke(N(e) ? e.counts : void 0);
|
|
947
956
|
if (!n || r === void 0 || a === void 0) return;
|
|
948
957
|
let { revision: i } = r;
|
|
949
|
-
(r.context === p || n.kind !== "read" && n.kind !== "seen" && n.kind !== "archive") && (n.kind === "item" && N(t) && N(t.item) &&
|
|
958
|
+
(r.context === p || n.kind !== "read" && n.kind !== "seen" && n.kind !== "archive") && (n.kind === "item" && N(t) && N(t.item) && X.receive({
|
|
950
959
|
...t.item,
|
|
951
960
|
revision: t.item.revision ?? i
|
|
952
|
-
}), Oe(n, i), Ee(e), J(),
|
|
961
|
+
}), Oe(n, i), Ee(e), J(), ue.forEach((e) => e(n)));
|
|
953
962
|
},
|
|
954
963
|
onChange(e) {
|
|
955
|
-
return
|
|
964
|
+
return ue.add(e), () => ue.delete(e);
|
|
956
965
|
},
|
|
957
966
|
apply: q,
|
|
958
967
|
belongs: pe,
|
|
@@ -960,10 +969,10 @@ function at() {
|
|
|
960
969
|
markAsRead: ft,
|
|
961
970
|
complete: pt,
|
|
962
971
|
completer: mt,
|
|
963
|
-
pushSettings: () =>
|
|
972
|
+
pushSettings: () => U,
|
|
964
973
|
context: () => p,
|
|
965
974
|
onSaved(e) {
|
|
966
|
-
return
|
|
975
|
+
return G.add(e), () => G.delete(e);
|
|
967
976
|
},
|
|
968
977
|
markAsUnread(e) {
|
|
969
978
|
let t = q(e);
|
|
@@ -971,56 +980,56 @@ function at() {
|
|
|
971
980
|
},
|
|
972
981
|
archive(e) {
|
|
973
982
|
let t = q(e);
|
|
974
|
-
return !
|
|
983
|
+
return !ht("archive") || t.archivedAt !== null ? Promise.resolve() : ot(t, { archivedAt: ye() }, "archive");
|
|
975
984
|
},
|
|
976
985
|
unarchive(e) {
|
|
977
986
|
let t = q(e);
|
|
978
|
-
return !
|
|
987
|
+
return !ht("archive") || t.archivedAt === null ? Promise.resolve() : ot(t, { archivedAt: null }, "unarchive");
|
|
979
988
|
},
|
|
980
989
|
snooze(e, t) {
|
|
981
|
-
if (!
|
|
990
|
+
if (!ht("snooze")) return Promise.resolve();
|
|
982
991
|
let n = q(e), r = new Date(t).toISOString();
|
|
983
992
|
return ot(n, { snoozedUntil: r }, "snooze", { until: r });
|
|
984
993
|
},
|
|
985
994
|
unsnooze(e) {
|
|
986
995
|
let t = q(e);
|
|
987
|
-
return !
|
|
996
|
+
return !ht("snooze") || t.snoozedUntil === null ? Promise.resolve() : ot(t, { snoozedUntil: null }, "unsnooze");
|
|
988
997
|
},
|
|
989
998
|
mute(e) {
|
|
990
999
|
let t = q(e);
|
|
991
|
-
return !
|
|
1000
|
+
return !ht("mute") || t.group === null || t.muted ? Promise.resolve() : st(t, t.group, !0);
|
|
992
1001
|
},
|
|
993
1002
|
unmute(e) {
|
|
994
1003
|
let t = q(e);
|
|
995
|
-
return !
|
|
1004
|
+
return !ht("mute") || t.group === null || !t.muted ? Promise.resolve() : st(t, t.group, !1);
|
|
996
1005
|
},
|
|
997
1006
|
pause(e) {
|
|
998
1007
|
let t = new Date(e).toISOString();
|
|
999
|
-
return V ?
|
|
1008
|
+
return V ? Ge({
|
|
1000
1009
|
kind: "pause",
|
|
1001
1010
|
until: t,
|
|
1002
|
-
delta:
|
|
1011
|
+
delta: $e()
|
|
1003
1012
|
}, "pause", { until: t }) : Promise.resolve();
|
|
1004
1013
|
},
|
|
1005
1014
|
resume() {
|
|
1006
|
-
return me() === null ? Promise.resolve() :
|
|
1015
|
+
return me() === null ? Promise.resolve() : Ge({
|
|
1007
1016
|
kind: "pause",
|
|
1008
1017
|
until: null,
|
|
1009
|
-
delta:
|
|
1018
|
+
delta: $e()
|
|
1010
1019
|
}, "resume");
|
|
1011
1020
|
},
|
|
1012
1021
|
batch(e, t, n) {
|
|
1013
|
-
let r =
|
|
1014
|
-
if (e !== "seen" && !l || r !== void 0 && !
|
|
1022
|
+
let r = Me[e];
|
|
1023
|
+
if (e !== "seen" && !l || r !== void 0 && !ht(r)) return Promise.resolve();
|
|
1015
1024
|
if (e === "snooze" && n === void 0) return Promise.reject(/* @__PURE__ */ TypeError("Snoozing notifications needs the time to snooze them until."));
|
|
1016
1025
|
let i = t.map(q), a = e === "snooze" && n !== void 0 ? new Date(n).toISOString() : void 0, o = [];
|
|
1017
|
-
for (let t = 0; t < i.length; t +=
|
|
1026
|
+
for (let t = 0; t < i.length; t += Pe) o.push(nt(e, i.slice(t, t + Pe), a));
|
|
1018
1027
|
return Promise.all(o).then(() => void 0);
|
|
1019
1028
|
},
|
|
1020
1029
|
delete(e) {
|
|
1021
|
-
if (!
|
|
1030
|
+
if (!ht("delete")) return Promise.resolve();
|
|
1022
1031
|
let t = q(e), { unread: n, unseen: r } = Se(t);
|
|
1023
|
-
return
|
|
1032
|
+
return Ge({
|
|
1024
1033
|
kind: "delete",
|
|
1025
1034
|
ids: [t.id],
|
|
1026
1035
|
delta: {
|
|
@@ -1037,8 +1046,8 @@ function at() {
|
|
|
1037
1046
|
return g.unseen === 0 ? Promise.resolve() : ct({ kind: "seen" }, null, lt(!1), "seen");
|
|
1038
1047
|
},
|
|
1039
1048
|
archiveAll({ onlyRead: e = !1, category: t = x } = {}) {
|
|
1040
|
-
if (!
|
|
1041
|
-
let n = e ?
|
|
1049
|
+
if (!ht("archive")) return Promise.resolve();
|
|
1050
|
+
let n = e ? $e() : lt(!0, t);
|
|
1042
1051
|
return ct({
|
|
1043
1052
|
kind: "archive",
|
|
1044
1053
|
onlyRead: e
|
|
@@ -1047,7 +1056,7 @@ function at() {
|
|
|
1047
1056
|
async opened(e, { markAllAsSeen: t = !0, categories: n } = {}) {
|
|
1048
1057
|
t && k++, A++, j.forEach((e) => e());
|
|
1049
1058
|
let r = t ? g.unseen > 0 : be(), i = e !== void 0 && !e.includes(b) ? e[0] ?? b : b, a = n !== void 0 && x !== null && !n.includes(x) ? null : x;
|
|
1050
|
-
i !== b || a !== x ? await
|
|
1059
|
+
i !== b || a !== x ? await X.load(i, a) : (S !== "ready" || r) && await X.load(), t && S === "ready" && await X.markAllAsSeen();
|
|
1051
1060
|
},
|
|
1052
1061
|
closed({ markAllAsSeen: e = !0 } = {}) {
|
|
1053
1062
|
e && (k = Math.max(0, k - 1)), A = Math.max(0, A - 1);
|
|
@@ -1060,20 +1069,20 @@ function at() {
|
|
|
1060
1069
|
if (n?.defaultPrevented) return;
|
|
1061
1070
|
ft(t);
|
|
1062
1071
|
let r = L(t.url);
|
|
1063
|
-
r === void 0 || n &&
|
|
1072
|
+
r === void 0 || n && re(n) || (n?.preventDefault(), !ne(r) || !e ? window.location.assign(r) : e.visit(r, {}));
|
|
1064
1073
|
},
|
|
1065
1074
|
runAction(t, n, i) {
|
|
1066
1075
|
let a = t.actions[n];
|
|
1067
1076
|
if (!a || i?.defaultPrevented) return;
|
|
1068
1077
|
let o = H(a);
|
|
1069
|
-
if (i && o !== void 0 &&
|
|
1070
|
-
a.event && !
|
|
1078
|
+
if (i && o !== void 0 && ae(a, o, i)) {
|
|
1079
|
+
a.event && !re(i) && window.dispatchEvent(new CustomEvent(a.event, { detail: a.payload })), W(o, a, i, () => void ft(t), a.result === void 0 ? void 0 : () => pt(t, n));
|
|
1071
1080
|
return;
|
|
1072
1081
|
}
|
|
1073
1082
|
if (i?.preventDefault(), O[t.id] !== void 0) return;
|
|
1074
1083
|
ft(t);
|
|
1075
1084
|
let s = r, c = a.result === void 0 ? void 0 : mt(t, n);
|
|
1076
|
-
|
|
1085
|
+
le(a, t, e, () => {
|
|
1077
1086
|
if (s !== r) return;
|
|
1078
1087
|
let { [t.id]: e, ...n } = O;
|
|
1079
1088
|
O = n, J();
|
|
@@ -1083,12 +1092,12 @@ function at() {
|
|
|
1083
1092
|
}, J());
|
|
1084
1093
|
}
|
|
1085
1094
|
};
|
|
1086
|
-
return
|
|
1095
|
+
return X;
|
|
1087
1096
|
}
|
|
1088
|
-
function
|
|
1089
|
-
return
|
|
1097
|
+
function st(e, t, n, r = null) {
|
|
1098
|
+
return Ve(e.getSnapshot().arrived, t).map((t) => e.apply(t)).filter((t) => e.belongs(t, n, r));
|
|
1090
1099
|
}
|
|
1091
|
-
function
|
|
1100
|
+
function ct(e, t = !0) {
|
|
1092
1101
|
let n = [], r = /* @__PURE__ */ new Map();
|
|
1093
1102
|
for (let i of e) {
|
|
1094
1103
|
let e = t ? i.group : null, a = e === null ? void 0 : r.get(e);
|
|
@@ -1104,8 +1113,8 @@ function st(e, t = !0) {
|
|
|
1104
1113
|
}
|
|
1105
1114
|
return n;
|
|
1106
1115
|
}
|
|
1107
|
-
function
|
|
1108
|
-
let n =
|
|
1116
|
+
function lt(e = {}, t = /* @__PURE__ */ new Date()) {
|
|
1117
|
+
let n = Tt(e), r = (e) => {
|
|
1109
1118
|
let n = new Date(t);
|
|
1110
1119
|
return n.setDate(t.getDate() + e), n.setHours(9, 0, 0, 0), n;
|
|
1111
1120
|
}, i = new Date(t.getTime() + 108e5), a = i.getDate() === t.getDate() ? [{
|
|
@@ -1124,7 +1133,7 @@ function ct(e = {}, t = /* @__PURE__ */ new Date()) {
|
|
|
1124
1133
|
}] : []
|
|
1125
1134
|
];
|
|
1126
1135
|
}
|
|
1127
|
-
function
|
|
1136
|
+
function ut(e, t, n) {
|
|
1128
1137
|
let r = new Date(e), i = new Date(t).toDateString() === r.toDateString();
|
|
1129
1138
|
return r.toLocaleString(n, i ? {
|
|
1130
1139
|
hour: "numeric",
|
|
@@ -1135,18 +1144,18 @@ function lt(e, t, n) {
|
|
|
1135
1144
|
minute: "2-digit"
|
|
1136
1145
|
});
|
|
1137
1146
|
}
|
|
1138
|
-
var
|
|
1147
|
+
var dt = [
|
|
1139
1148
|
30,
|
|
1140
1149
|
60,
|
|
1141
1150
|
120,
|
|
1142
1151
|
"tomorrow"
|
|
1143
1152
|
];
|
|
1144
|
-
function
|
|
1153
|
+
function ft(e, t = /* @__PURE__ */ new Date()) {
|
|
1145
1154
|
if (e !== "tomorrow") return new Date(t.getTime() + e * 6e4);
|
|
1146
1155
|
let n = new Date(t);
|
|
1147
1156
|
return n.setDate(t.getDate() + 1), n.setHours(8, 0, 0, 0), n;
|
|
1148
1157
|
}
|
|
1149
|
-
function
|
|
1158
|
+
function pt(e, t, n) {
|
|
1150
1159
|
return e.filter((e) => e === "tomorrow" || Number.isFinite(e) && e > 0).map((e) => {
|
|
1151
1160
|
if (e === "tomorrow") return {
|
|
1152
1161
|
label: Z(t.pauseTomorrow),
|
|
@@ -1166,16 +1175,16 @@ function ft(e, t, n) {
|
|
|
1166
1175
|
};
|
|
1167
1176
|
});
|
|
1168
1177
|
}
|
|
1169
|
-
function
|
|
1178
|
+
function mt(e, t, n) {
|
|
1170
1179
|
let r = new Date(e);
|
|
1171
|
-
return r.getTime() - t < 5184e5 ?
|
|
1180
|
+
return r.getTime() - t < 5184e5 ? ut(r, t, n) : r.toLocaleString(n, {
|
|
1172
1181
|
month: "short",
|
|
1173
1182
|
day: "numeric",
|
|
1174
1183
|
hour: "numeric",
|
|
1175
1184
|
minute: "2-digit"
|
|
1176
1185
|
});
|
|
1177
1186
|
}
|
|
1178
|
-
var
|
|
1187
|
+
var ht = ot(), X = ht, gt = {
|
|
1179
1188
|
load: X.load,
|
|
1180
1189
|
loadMore: X.loadMore,
|
|
1181
1190
|
refresh: X.refresh,
|
|
@@ -1202,11 +1211,11 @@ var mt = at(), X = mt, ht = {
|
|
|
1202
1211
|
open: X.open,
|
|
1203
1212
|
runAction: X.runAction
|
|
1204
1213
|
};
|
|
1205
|
-
function
|
|
1214
|
+
function _t(e) {
|
|
1206
1215
|
X.getSnapshot().url === void 0 && X.sync(e, "initial");
|
|
1207
1216
|
}
|
|
1208
|
-
var
|
|
1209
|
-
function
|
|
1217
|
+
var vt = ht;
|
|
1218
|
+
function yt(e = 6e4) {
|
|
1210
1219
|
let t = /* @__PURE__ */ new Set(), n = Date.now(), r, i = () => {
|
|
1211
1220
|
n = Date.now(), t.forEach((e) => e());
|
|
1212
1221
|
};
|
|
@@ -1219,8 +1228,8 @@ function vt(e = 6e4) {
|
|
|
1219
1228
|
getSnapshot: () => n
|
|
1220
1229
|
};
|
|
1221
1230
|
}
|
|
1222
|
-
var
|
|
1223
|
-
function
|
|
1231
|
+
var bt = yt();
|
|
1232
|
+
function xt(e, t, n) {
|
|
1224
1233
|
let r = (Y(e) - t) / 1e3, i = new Intl.RelativeTimeFormat(n, { numeric: "auto" });
|
|
1225
1234
|
for (let [e, t] of [
|
|
1226
1235
|
["year", 31536e3],
|
|
@@ -1232,12 +1241,12 @@ function bt(e, t, n) {
|
|
|
1232
1241
|
]) if (Math.abs(r) >= t) return i.format(Math.round(r / t), e);
|
|
1233
1242
|
return i.format(0, "second");
|
|
1234
1243
|
}
|
|
1235
|
-
function
|
|
1244
|
+
function St(e, t, n) {
|
|
1236
1245
|
let r = new Intl.NumberFormat(n);
|
|
1237
1246
|
return e > t ? `${r.format(t)}+` : r.format(e);
|
|
1238
1247
|
}
|
|
1239
|
-
var
|
|
1240
|
-
function
|
|
1248
|
+
var Ct = /* @__PURE__ */ "title.bell.bellNew.bellPaused.all.unread.archived.snoozed.markAllAsRead.archiveAll.moreActions.itemControl.markAsRead.markAsUnread.archive.unarchive.snooze.unsnooze.mute.unmute.muted.delete.select.selectAll.selected.selection.readSelected.unreadSelected.snoozeSelected.unsnoozeSelected.archiveSelected.unarchiveSelected.deleteSelected.clearSelection.showNew.snoozeUntil.snoozedUntil.snoozeLaterToday.snoozeTomorrow.snoozeNextWeek.pause.pauseFor.pauseTomorrow.pausedUntil.resume.showMore.showLess.unreadState.actorsAndOther.actorsAndOthers.empty.emptyUnread.emptyArchived.emptySnoozed.error.retry.categories.allCategories.loading.loadMore.viewAll.announcement".split("."), wt = De("inbox_", Ct), Tt = (e) => Oe("inbox_", Ct, e), Z = we, Et = (e) => e.actors.slice(0, 3);
|
|
1249
|
+
function Dt(e, t) {
|
|
1241
1250
|
let [n, r] = t.actors;
|
|
1242
1251
|
if (!(t.actorCount < 2 || !n?.name)) return t.actorCount > 2 ? Z(e.actorsAndOthers, {
|
|
1243
1252
|
name: n.name,
|
|
@@ -1248,8 +1257,8 @@ function Et(e, t) {
|
|
|
1248
1257
|
}) : void 0;
|
|
1249
1258
|
}
|
|
1250
1259
|
// ../js/realtime.ts
|
|
1251
|
-
var
|
|
1252
|
-
function
|
|
1260
|
+
var Ot = ".inertiaui.inbox.arrived", kt = ".inertiaui.inbox.changed", At = ".inertiaui.announcement.published", jt = 1e3, Mt = "inertiaui-inbox";
|
|
1261
|
+
function Nt(e, t, n) {
|
|
1253
1262
|
let r, i = !1, a, o, s = /* @__PURE__ */ new Set(), c = !1, l, u = () => {
|
|
1254
1263
|
try {
|
|
1255
1264
|
return r?.();
|
|
@@ -1270,7 +1279,7 @@ function Mt(e, t, n) {
|
|
|
1270
1279
|
if (!N(t) || typeof t.id != "string") return;
|
|
1271
1280
|
let { id: r } = t, i = typeof t.context == "string" ? t.context : null, a = setTimeout(() => {
|
|
1272
1281
|
s.delete(a), e.loadArrival(r, i).then((e) => e && n(e));
|
|
1273
|
-
}, Math.random() *
|
|
1282
|
+
}, Math.random() * jt);
|
|
1274
1283
|
s.add(a);
|
|
1275
1284
|
}, m = () => {
|
|
1276
1285
|
let { announcementsChannel: t } = e.getSnapshot();
|
|
@@ -1279,10 +1288,10 @@ function Mt(e, t, n) {
|
|
|
1279
1288
|
let n = t === null ? void 0 : u();
|
|
1280
1289
|
if (!n || t === null || !r) return;
|
|
1281
1290
|
let i = n.private(t);
|
|
1282
|
-
i.listen(
|
|
1291
|
+
i.listen(At, p), o = {
|
|
1283
1292
|
channel: t,
|
|
1284
1293
|
resolve: r,
|
|
1285
|
-
stop: () => i.stopListening(
|
|
1294
|
+
stop: () => i.stopListening(At, p)
|
|
1286
1295
|
};
|
|
1287
1296
|
}, h = () => {
|
|
1288
1297
|
g(), m();
|
|
@@ -1293,7 +1302,7 @@ function Mt(e, t, n) {
|
|
|
1293
1302
|
let n = t === null ? void 0 : u();
|
|
1294
1303
|
if (!n || t === null || !r) return;
|
|
1295
1304
|
let i = n.private(t);
|
|
1296
|
-
i.listen(
|
|
1305
|
+
i.listen(Ot, d), i.listen(kt, f);
|
|
1297
1306
|
let o = !1, s = n.connector?.onConnectionChange?.((t) => {
|
|
1298
1307
|
t === "connected" && o && e.refresh(), o = t !== "connected";
|
|
1299
1308
|
});
|
|
@@ -1301,7 +1310,7 @@ function Mt(e, t, n) {
|
|
|
1301
1310
|
channel: t,
|
|
1302
1311
|
resolve: r,
|
|
1303
1312
|
stop() {
|
|
1304
|
-
i.stopListening(
|
|
1313
|
+
i.stopListening(Ot, d), i.stopListening(kt, f), typeof s == "function" && s();
|
|
1305
1314
|
}
|
|
1306
1315
|
};
|
|
1307
1316
|
}, _ = () => typeof document < "u" && document.visibilityState === "hidden", v = () => {
|
|
@@ -1310,7 +1319,7 @@ function Mt(e, t, n) {
|
|
|
1310
1319
|
c && !_() && e.refresh(), v();
|
|
1311
1320
|
};
|
|
1312
1321
|
typeof document < "u" && document.addEventListener("visibilitychange", y);
|
|
1313
|
-
let b = typeof BroadcastChannel == "function" ? new BroadcastChannel(
|
|
1322
|
+
let b = typeof BroadcastChannel == "function" ? new BroadcastChannel(Mt) : void 0;
|
|
1314
1323
|
b?.addEventListener("message", (t) => {
|
|
1315
1324
|
let { url: n, user: r, channel: i } = e.getSnapshot(), a = t.data;
|
|
1316
1325
|
N(a) && n !== void 0 && a.url === n && a.user === r && a.channel === i && e.receiveChange(a);
|
|
@@ -1338,21 +1347,21 @@ function Mt(e, t, n) {
|
|
|
1338
1347
|
}
|
|
1339
1348
|
};
|
|
1340
1349
|
}
|
|
1341
|
-
var
|
|
1342
|
-
function
|
|
1350
|
+
var Pt = "inertiaui-inbox-", Ft = (e) => `${Pt}${e}`, It = (e) => e.startsWith(Pt) ? e.slice(16) : void 0;
|
|
1351
|
+
function Lt(e, t, n) {
|
|
1343
1352
|
let r = t === "none" || e.announcement || e.quiet === !0 || e.readAt !== null || e.archivedAt !== null ? null : e.toast ?? (t === "all" ? "default" : null);
|
|
1344
1353
|
if (r === null) return;
|
|
1345
|
-
let { title: i, ...a } =
|
|
1354
|
+
let { title: i, ...a } = Rt(e, n);
|
|
1346
1355
|
return {
|
|
1347
1356
|
title: i,
|
|
1348
1357
|
options: {
|
|
1349
|
-
id:
|
|
1358
|
+
id: Ft(e.id),
|
|
1350
1359
|
type: r,
|
|
1351
1360
|
...a
|
|
1352
1361
|
}
|
|
1353
1362
|
};
|
|
1354
1363
|
}
|
|
1355
|
-
function
|
|
1364
|
+
function Rt(e, t) {
|
|
1356
1365
|
let n = e.actions.length > 0 || e.url === null ? e.actions.map(({ onClick: e, ...t }) => t) : [{
|
|
1357
1366
|
...t,
|
|
1358
1367
|
href: e.url
|
|
@@ -1366,8 +1375,8 @@ function Lt(e, t) {
|
|
|
1366
1375
|
};
|
|
1367
1376
|
}
|
|
1368
1377
|
// ../js/browserAlerts.ts
|
|
1369
|
-
var
|
|
1370
|
-
function
|
|
1378
|
+
var zt = "inertiaui-notifications";
|
|
1379
|
+
function Bt(e) {
|
|
1371
1380
|
let t = document, n = navigator.locks;
|
|
1372
1381
|
if (!n) return {
|
|
1373
1382
|
elected: () => t.visibilityState === "visible",
|
|
@@ -1393,25 +1402,25 @@ function zt(e) {
|
|
|
1393
1402
|
}
|
|
1394
1403
|
};
|
|
1395
1404
|
}
|
|
1396
|
-
async function
|
|
1405
|
+
async function Vt() {
|
|
1397
1406
|
return typeof Notification == "function" ? Notification.requestPermission() : "denied";
|
|
1398
1407
|
}
|
|
1399
|
-
var
|
|
1400
|
-
function
|
|
1408
|
+
var Ht;
|
|
1409
|
+
function Ut() {
|
|
1401
1410
|
if (typeof AudioContext != "function") return;
|
|
1402
|
-
|
|
1403
|
-
let e =
|
|
1411
|
+
Ht ??= new AudioContext();
|
|
1412
|
+
let e = Ht;
|
|
1404
1413
|
for (let [t, n] of [880, 1320].entries()) {
|
|
1405
1414
|
let r = e.currentTime + t * .15, i = e.createOscillator(), a = e.createGain();
|
|
1406
1415
|
i.frequency.value = n, a.gain.setValueAtTime(.2, r), a.gain.exponentialRampToValueAtTime(.001, r + .4), i.connect(a).connect(e.destination), i.start(r), i.stop(r + .4);
|
|
1407
1416
|
}
|
|
1408
1417
|
}
|
|
1409
|
-
function
|
|
1418
|
+
function Wt(e) {
|
|
1410
1419
|
let t = !1, n = "", r, i, a, o = !1, s, c = !1, l = !1, u, d, f = () => {
|
|
1411
1420
|
let a = document.title !== i;
|
|
1412
1421
|
a && (n = document.title);
|
|
1413
|
-
let { unread: o } = e.getSnapshot().counts, s = t && o > 0 ?
|
|
1414
|
-
count:
|
|
1422
|
+
let { unread: o } = e.getSnapshot().counts, s = t && o > 0 ? Te("inbox_title_count", {
|
|
1423
|
+
count: St(o, 99),
|
|
1415
1424
|
number: o,
|
|
1416
1425
|
title: n
|
|
1417
1426
|
}) : n;
|
|
@@ -1429,7 +1438,7 @@ function Ut(e) {
|
|
|
1429
1438
|
e !== o && (o = e, m());
|
|
1430
1439
|
}, g = () => {
|
|
1431
1440
|
let e = c || l !== !1;
|
|
1432
|
-
e && !d && (d = zt
|
|
1441
|
+
e && !d && (d = Bt(zt)), !e && d && (d.stop(), d = void 0);
|
|
1433
1442
|
}, _ = (t) => {
|
|
1434
1443
|
if (typeof Notification != "function" || Notification.permission !== "granted") return;
|
|
1435
1444
|
let n;
|
|
@@ -1437,7 +1446,7 @@ function Ut(e) {
|
|
|
1437
1446
|
n = new Notification(t.title, {
|
|
1438
1447
|
body: t.body ?? void 0,
|
|
1439
1448
|
icon: t.actor?.avatar,
|
|
1440
|
-
tag:
|
|
1449
|
+
tag: Ft(t.id)
|
|
1441
1450
|
});
|
|
1442
1451
|
} catch {
|
|
1443
1452
|
return;
|
|
@@ -1446,7 +1455,7 @@ function Ut(e) {
|
|
|
1446
1455
|
window.focus(), n.close(), e.open(t);
|
|
1447
1456
|
});
|
|
1448
1457
|
}, v = (e) => {
|
|
1449
|
-
navigator.userActivation?.hasBeenActive !== !1 && (e === !0 ?
|
|
1458
|
+
navigator.userActivation?.hasBeenActive !== !1 && (e === !0 ? Ut() : (u?.getAttribute("src") !== e && (u = new Audio(e)), u.currentTime = 0, u.play().catch(() => {})));
|
|
1450
1459
|
};
|
|
1451
1460
|
return e.onArrival((e) => {
|
|
1452
1461
|
d?.elected() && e.quiet !== !0 && e.readAt === null && e.archivedAt === null && (c && document.visibilityState === "hidden" && _(e), l !== !1 && v(l));
|
|
@@ -1457,12 +1466,12 @@ function Ut(e) {
|
|
|
1457
1466
|
} };
|
|
1458
1467
|
}
|
|
1459
1468
|
// ../js/preferences.ts
|
|
1460
|
-
var
|
|
1469
|
+
var Gt = [
|
|
1461
1470
|
"instant",
|
|
1462
1471
|
"hourly",
|
|
1463
1472
|
"daily",
|
|
1464
1473
|
"weekly"
|
|
1465
|
-
],
|
|
1474
|
+
], Kt = [
|
|
1466
1475
|
"monday",
|
|
1467
1476
|
"tuesday",
|
|
1468
1477
|
"wednesday",
|
|
@@ -1470,29 +1479,29 @@ var Wt = [
|
|
|
1470
1479
|
"friday",
|
|
1471
1480
|
"saturday",
|
|
1472
1481
|
"sunday"
|
|
1473
|
-
],
|
|
1482
|
+
], qt = {
|
|
1474
1483
|
status: "idle",
|
|
1475
1484
|
channels: [],
|
|
1476
1485
|
groups: [],
|
|
1477
1486
|
categories: [],
|
|
1478
1487
|
notificationHours: null,
|
|
1479
|
-
frequencies:
|
|
1480
|
-
},
|
|
1488
|
+
frequencies: Gt
|
|
1489
|
+
}, Jt = (e, t) => typeof e == "string" ? e : t, Yt = (e) => Gt.includes(e), Xt = (e) => typeof e == "string" && /^([01]\d|2[0-3]):[0-5]\d-([01]\d|2[0-3]):[0-5]\d$/.test(e), Zt = (e) => [...e].sort(), Qt = (e) => {
|
|
1481
1490
|
if (!N(e) || !N(e.days)) return null;
|
|
1482
1491
|
let t = e.days;
|
|
1483
1492
|
return {
|
|
1484
1493
|
enabled: e.enabled === !0,
|
|
1485
|
-
days: Object.fromEntries(
|
|
1494
|
+
days: Object.fromEntries(Kt.map((e) => [e, Zt(Array.isArray(t[e]) ? t[e].filter(Xt) : [])]))
|
|
1486
1495
|
};
|
|
1487
|
-
},
|
|
1488
|
-
let t = Array.isArray(e) ?
|
|
1489
|
-
return t.length > 0 ? t :
|
|
1496
|
+
}, $t = (e) => {
|
|
1497
|
+
let t = Array.isArray(e) ? Gt.filter((t) => e.includes(t)) : [];
|
|
1498
|
+
return t.length > 0 ? t : Gt;
|
|
1490
1499
|
};
|
|
1491
|
-
function
|
|
1500
|
+
function en(e) {
|
|
1492
1501
|
if (N(e) && Array.isArray(e.channels) && Array.isArray(e.categories)) return {
|
|
1493
1502
|
channels: e.channels.filter(N).flatMap((e) => typeof e.key == "string" ? [{
|
|
1494
1503
|
key: e.key,
|
|
1495
|
-
label:
|
|
1504
|
+
label: Jt(e.label, e.key),
|
|
1496
1505
|
globalSwitch: e.globalSwitch === !0,
|
|
1497
1506
|
enabled: e.enabled !== !1,
|
|
1498
1507
|
digest: e.digest === !0,
|
|
@@ -1501,23 +1510,23 @@ function $t(e) {
|
|
|
1501
1510
|
}] : []),
|
|
1502
1511
|
groups: (Array.isArray(e.groups) ? e.groups : []).filter(N).flatMap((e) => typeof e.key == "string" ? [{
|
|
1503
1512
|
key: e.key,
|
|
1504
|
-
label:
|
|
1513
|
+
label: Jt(e.label, e.key),
|
|
1505
1514
|
description: P(e.description)
|
|
1506
1515
|
}] : []),
|
|
1507
1516
|
categories: e.categories.filter(N).flatMap((e) => typeof e.key == "string" ? [{
|
|
1508
1517
|
key: e.key,
|
|
1509
|
-
label:
|
|
1518
|
+
label: Jt(e.label, e.key),
|
|
1510
1519
|
description: P(e.description),
|
|
1511
1520
|
group: P(e.group),
|
|
1512
1521
|
locked: e.locked === !0,
|
|
1513
1522
|
channels: Object.fromEntries(Object.entries(N(e.channels) ? e.channels : {}).filter((e) => typeof e[1] == "boolean")),
|
|
1514
|
-
frequency:
|
|
1523
|
+
frequency: Yt(e.frequency) ? e.frequency : null
|
|
1515
1524
|
}] : []),
|
|
1516
|
-
notificationHours:
|
|
1517
|
-
frequencies:
|
|
1525
|
+
notificationHours: Qt(e.notificationHours),
|
|
1526
|
+
frequencies: $t(e.frequencies)
|
|
1518
1527
|
};
|
|
1519
1528
|
}
|
|
1520
|
-
function
|
|
1529
|
+
function tn(e) {
|
|
1521
1530
|
let t = new Set(e.groups.map(({ key: e }) => e)), n = e.categories.filter(({ group: e }) => e === null || !t.has(e)), r = e.groups.map((t) => ({
|
|
1522
1531
|
group: t,
|
|
1523
1532
|
categories: e.categories.filter((e) => e.group === t.key)
|
|
@@ -1527,47 +1536,47 @@ function en(e) {
|
|
|
1527
1536
|
categories: n
|
|
1528
1537
|
}] : [], ...r.filter(({ categories: e }) => e.length > 0)];
|
|
1529
1538
|
}
|
|
1530
|
-
var
|
|
1539
|
+
var nn = (e, t) => e.locked || t.enabled && e.channels[t.key] === !0, rn = (e, t, n) => {
|
|
1531
1540
|
let r = n.find((e) => e.inbox);
|
|
1532
|
-
return !t.push || r === void 0 || r.key === t.key || e.channels[r.key] === void 0 ||
|
|
1533
|
-
},
|
|
1541
|
+
return !t.push || r === void 0 || r.key === t.key || e.channels[r.key] === void 0 || nn(e, r);
|
|
1542
|
+
}, an = (e, t, n) => nn(e, t) && rn(e, t, n), on = (e, t, n) => e.locked || !t.enabled || !rn(e, t, n), sn = (e, t) => e.frequency !== null && t.some((n) => n.digest && e.channels[n.key] !== void 0 && an(e, n, t)), cn = (e, t) => new Intl.DateTimeFormat(t, {
|
|
1534
1543
|
weekday: "long",
|
|
1535
1544
|
timeZone: "UTC"
|
|
1536
|
-
}).format(Date.UTC(2024, 0, 1 +
|
|
1545
|
+
}).format(Date.UTC(2024, 0, 1 + Kt.indexOf(e))), ln = (e) => {
|
|
1537
1546
|
let [t = "", n = ""] = e.split("-");
|
|
1538
1547
|
return [t, n];
|
|
1539
|
-
},
|
|
1540
|
-
function
|
|
1541
|
-
let n =
|
|
1542
|
-
for (let t = 1; t <
|
|
1543
|
-
let [r] = e.days[
|
|
1548
|
+
}, un = (e, t) => e.days[t].length > 0 && Kt.every((n) => n === t || e.days[n].length === 0);
|
|
1549
|
+
function dn(e, t) {
|
|
1550
|
+
let n = Kt.indexOf(t);
|
|
1551
|
+
for (let t = 1; t < Kt.length; t++) {
|
|
1552
|
+
let [r] = e.days[Kt[(n + Kt.length - t) % Kt.length]];
|
|
1544
1553
|
if (r !== void 0) return r;
|
|
1545
1554
|
}
|
|
1546
1555
|
return "09:00-17:00";
|
|
1547
1556
|
}
|
|
1548
|
-
var
|
|
1549
|
-
function
|
|
1550
|
-
let t = e.map((e) =>
|
|
1557
|
+
var fn = 1440, pn = (e) => Number(e.slice(0, 2)) * 60 + Number(e.slice(3)), mn = (e) => [Math.floor(e / 60) % 24, e % 60].map((e) => String(e).padStart(2, "0")).join(":");
|
|
1558
|
+
function hn(e) {
|
|
1559
|
+
let t = e.map((e) => ln(e).map(pn));
|
|
1551
1560
|
if (t.length === 0 || t.some(([e, t]) => t <= e)) return;
|
|
1552
1561
|
let n = Math.max(...t.map(([, e]) => e));
|
|
1553
|
-
return n + 120 <=
|
|
1562
|
+
return n + 120 <= fn ? `${mn(n + 60)}-${mn(n + 120)}` : void 0;
|
|
1554
1563
|
}
|
|
1555
|
-
var
|
|
1564
|
+
var gn = (e, t, n) => t?.day === n ? t.ranges : e?.days[n] ?? [], _n = (e, t, n) => e === null ? [] : Kt.map((r) => ({
|
|
1556
1565
|
day: r,
|
|
1557
|
-
name:
|
|
1558
|
-
ranges:
|
|
1559
|
-
locked: !e.enabled ||
|
|
1560
|
-
canAdd: e.enabled &&
|
|
1566
|
+
name: cn(r, n),
|
|
1567
|
+
ranges: gn(e, t, r).map(ln),
|
|
1568
|
+
locked: !e.enabled || un(e, r),
|
|
1569
|
+
canAdd: e.enabled && hn(e.days[r]) !== void 0
|
|
1561
1570
|
}));
|
|
1562
|
-
function
|
|
1563
|
-
let { day: r } = n, i =
|
|
1571
|
+
function vn(e, t, n) {
|
|
1572
|
+
let { day: r } = n, i = gn(e, t, r), a;
|
|
1564
1573
|
switch (n.kind) {
|
|
1565
1574
|
case "toggle":
|
|
1566
|
-
if (!e?.enabled ||
|
|
1567
|
-
a = e.days[r].length > 0 ? [] : [
|
|
1575
|
+
if (!e?.enabled || un(e, r)) return;
|
|
1576
|
+
a = e.days[r].length > 0 ? [] : [dn(e, r)];
|
|
1568
1577
|
break;
|
|
1569
1578
|
case "time": {
|
|
1570
|
-
let [e, t] =
|
|
1579
|
+
let [e, t] = ln(i[n.index] ?? ""), o = n.field === "start" ? `${n.time}-${t}` : `${e}-${n.time}`;
|
|
1571
1580
|
return a = i.map((e, t) => t === n.index ? o : e), {
|
|
1572
1581
|
ranges: a,
|
|
1573
1582
|
editing: () => ({
|
|
@@ -1580,7 +1589,7 @@ function _n(e, t, n) {
|
|
|
1580
1589
|
a = i.filter((e, t) => t !== n.index);
|
|
1581
1590
|
break;
|
|
1582
1591
|
case "add": {
|
|
1583
|
-
let t =
|
|
1592
|
+
let t = hn(i);
|
|
1584
1593
|
if (!e?.enabled || t === void 0) return;
|
|
1585
1594
|
a = [...i, t];
|
|
1586
1595
|
}
|
|
@@ -1593,23 +1602,23 @@ function _n(e, t, n) {
|
|
|
1593
1602
|
} : e
|
|
1594
1603
|
};
|
|
1595
1604
|
}
|
|
1596
|
-
var
|
|
1605
|
+
var yn = () => {
|
|
1597
1606
|
try {
|
|
1598
1607
|
return Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
1599
1608
|
} catch {
|
|
1600
1609
|
return;
|
|
1601
1610
|
}
|
|
1602
|
-
},
|
|
1603
|
-
function
|
|
1611
|
+
}, bn = (e, t) => e.enabled === t.enabled && Kt.every((n) => e.days[n].join() === t.days[n].join()), xn = (e, t) => typeof e == "object" && typeof t == "object" ? bn(e, t) : e === t, Sn = "*", Cn = "*";
|
|
1612
|
+
function wn() {
|
|
1604
1613
|
let e, t, n, r = 0, i = 0, a = 0, o = {
|
|
1605
1614
|
channels: [],
|
|
1606
1615
|
categories: [],
|
|
1607
1616
|
notificationHours: null
|
|
1608
|
-
}, s = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Map(), u =
|
|
1609
|
-
if (t === null) return n ===
|
|
1617
|
+
}, s = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Map(), u = qt, d = /* @__PURE__ */ new Set(), f = ({ category: e, channel: t }) => JSON.stringify([e, t]), p = (e, { category: t, channel: n }) => {
|
|
1618
|
+
if (t === null) return n === Cn ? e.notificationHours ?? void 0 : e.channels.find(({ key: e }) => e === n)?.enabled;
|
|
1610
1619
|
let r = e.categories.find(({ key: e }) => e === t);
|
|
1611
|
-
return n ===
|
|
1612
|
-
}, m = (e, t, n) => t ===
|
|
1620
|
+
return n === Sn ? r?.frequency ?? void 0 : r?.channels[n];
|
|
1621
|
+
}, m = (e, t, n) => t === Sn ? e.frequency !== null && Yt(n) ? {
|
|
1613
1622
|
...e,
|
|
1614
1623
|
frequency: n
|
|
1615
1624
|
} : e : e.channels[t] !== void 0 && typeof n == "boolean" ? {
|
|
@@ -1618,7 +1627,7 @@ function Cn() {
|
|
|
1618
1627
|
...e.channels,
|
|
1619
1628
|
[t]: n
|
|
1620
1629
|
}
|
|
1621
|
-
} : e, h = (e, { category: t, channel: n }, r) => t === null ? n ===
|
|
1630
|
+
} : e, h = (e, { category: t, channel: n }, r) => t === null ? n === Cn ? e.notificationHours !== null && typeof r == "object" ? {
|
|
1622
1631
|
...e,
|
|
1623
1632
|
notificationHours: r
|
|
1624
1633
|
} : e : typeof r == "boolean" ? {
|
|
@@ -1630,12 +1639,12 @@ function Cn() {
|
|
|
1630
1639
|
} : e : {
|
|
1631
1640
|
...e,
|
|
1632
1641
|
categories: e.categories.map((e) => e.key === t ? m(e, n, r) : e)
|
|
1633
|
-
}, g = ({ category: e, channel: t }, n) => e === null ? t ===
|
|
1642
|
+
}, g = ({ category: e, channel: t }, n) => e === null ? t === Cn ? {
|
|
1634
1643
|
notificationHours: n,
|
|
1635
|
-
timezone:
|
|
1636
|
-
} : { channels: { [t]: n } } : t ===
|
|
1644
|
+
timezone: yn()
|
|
1645
|
+
} : { channels: { [t]: n } } : t === Sn ? {
|
|
1637
1646
|
frequencies: { [e]: n },
|
|
1638
|
-
timezone:
|
|
1647
|
+
timezone: yn()
|
|
1639
1648
|
} : { preferences: { [e]: { [t]: n } } }, _ = (e) => {
|
|
1640
1649
|
u = {
|
|
1641
1650
|
...u,
|
|
@@ -1647,7 +1656,7 @@ function Cn() {
|
|
|
1647
1656
|
}), y = async (i, c) => {
|
|
1648
1657
|
let u = r, d = s.get(c).value;
|
|
1649
1658
|
try {
|
|
1650
|
-
let t =
|
|
1659
|
+
let t = en(await e.request("post", `${n}/preferences`, g(i, d)));
|
|
1651
1660
|
if (u !== r) return;
|
|
1652
1661
|
o = h(o, i, (t && p(t, i)) ?? d), l.set(c, {
|
|
1653
1662
|
cell: i,
|
|
@@ -1657,7 +1666,7 @@ function Cn() {
|
|
|
1657
1666
|
if (u !== r) return;
|
|
1658
1667
|
t?.(e);
|
|
1659
1668
|
}
|
|
1660
|
-
(
|
|
1669
|
+
(xn(s.get(c)?.value, d) || xn(s.get(c)?.value, p(o, i))) && s.delete(c), v(), s.has(c) && await y(i, c);
|
|
1661
1670
|
}, b = (e, t, n) => {
|
|
1662
1671
|
let i = {
|
|
1663
1672
|
category: e,
|
|
@@ -1687,7 +1696,7 @@ function Cn() {
|
|
|
1687
1696
|
else {
|
|
1688
1697
|
_({ status: "loading" });
|
|
1689
1698
|
try {
|
|
1690
|
-
let t =
|
|
1699
|
+
let t = en(await e.request("get", `${n}/preferences`));
|
|
1691
1700
|
if (s !== r || c !== i) return;
|
|
1692
1701
|
if (!t) {
|
|
1693
1702
|
_({ status: "error" });
|
|
@@ -1717,36 +1726,36 @@ function Cn() {
|
|
|
1717
1726
|
},
|
|
1718
1727
|
setFrequency(t, r) {
|
|
1719
1728
|
let i = u.categories.find(({ key: e }) => e === t);
|
|
1720
|
-
return !e || n === void 0 || !i || i.frequency === null || i.frequency === r || !u.frequencies.includes(r) ? Promise.resolve() : b(t,
|
|
1729
|
+
return !e || n === void 0 || !i || i.frequency === null || i.frequency === r || !u.frequencies.includes(r) ? Promise.resolve() : b(t, Sn, r);
|
|
1721
1730
|
},
|
|
1722
1731
|
setNotificationHours(t) {
|
|
1723
1732
|
let r = u.notificationHours;
|
|
1724
1733
|
if (!e || n === void 0 || r === null) return Promise.resolve();
|
|
1725
|
-
let i =
|
|
1726
|
-
if (!i.every(([, e]) => Array.isArray(e) && e.every(
|
|
1734
|
+
let i = Kt.map((e) => [e, t.days?.[e] ?? r.days[e]]);
|
|
1735
|
+
if (!i.every(([, e]) => Array.isArray(e) && e.every(Xt)) || i.every(([, e]) => e.length === 0)) return Promise.resolve();
|
|
1727
1736
|
let a = {
|
|
1728
1737
|
enabled: t.enabled ?? r.enabled,
|
|
1729
|
-
days: Object.fromEntries(i.map(([e, t]) => [e,
|
|
1738
|
+
days: Object.fromEntries(i.map(([e, t]) => [e, Zt(t)]))
|
|
1730
1739
|
};
|
|
1731
|
-
return
|
|
1740
|
+
return xn(a, r) ? Promise.resolve() : b(null, Cn, a);
|
|
1732
1741
|
},
|
|
1733
1742
|
reset(e) {
|
|
1734
1743
|
r++, i++, o = {
|
|
1735
1744
|
channels: [],
|
|
1736
1745
|
categories: [],
|
|
1737
1746
|
notificationHours: null
|
|
1738
|
-
}, s.clear(), c.clear(), l.clear(), n = e, _(
|
|
1747
|
+
}, s.clear(), c.clear(), l.clear(), n = e, _(qt), d.size > 0 && e !== void 0 && x.load(e);
|
|
1739
1748
|
}
|
|
1740
1749
|
};
|
|
1741
1750
|
return x;
|
|
1742
1751
|
}
|
|
1743
|
-
var
|
|
1752
|
+
var Tn = /* @__PURE__ */ "title.category.toggle.locked.global.globalDescription.frequency.frequencyLabel.frequencyInstant.frequencyHourly.frequencyDaily.frequencyWeekly.pushDevice.pushOff.pushOn.pushTurnOn.pushTurnOff.pushTurningOn.pushTurningOff.pushBlocked.pushHomeScreen.pushInsecure.pushBrave.pushFailed.pushFailedOff.pushRetry.pushDevices.pushDeviceName.pushDeviceUnknown.pushDeviceActive.pushDeviceRemove.pushDeviceRemoveLabel.notificationHours.notificationHoursDescription.notificationHoursStart.notificationHoursEnd.notificationHoursDay.notificationHoursOff.notificationHoursAdd.notificationHoursAddLabel.notificationHoursRemove.notificationHoursRemoveLabel.empty.loading.error.retry".split("."), En = De("preferences_", Tn), Dn = {
|
|
1744
1753
|
instant: "frequencyInstant",
|
|
1745
1754
|
hourly: "frequencyHourly",
|
|
1746
1755
|
daily: "frequencyDaily",
|
|
1747
1756
|
weekly: "frequencyWeekly"
|
|
1748
|
-
},
|
|
1749
|
-
function
|
|
1757
|
+
}, On = (e) => Oe("preferences_", Tn, e), kn = wn();
|
|
1758
|
+
function An(e, t, n, r) {
|
|
1750
1759
|
let i = t.some(({ frequency: e }) => e !== null);
|
|
1751
1760
|
return {
|
|
1752
1761
|
hasGlobalSwitches: e.some(({ globalSwitch: e }) => e),
|
|
@@ -1754,15 +1763,15 @@ function kn(e, t, n, r) {
|
|
|
1754
1763
|
columns: e.length + (i ? 2 : 1),
|
|
1755
1764
|
frequencyOptions: n.map((e) => ({
|
|
1756
1765
|
value: e,
|
|
1757
|
-
label:
|
|
1766
|
+
label: we(r[Dn[e]])
|
|
1758
1767
|
}))
|
|
1759
1768
|
};
|
|
1760
1769
|
}
|
|
1761
|
-
function
|
|
1762
|
-
|
|
1770
|
+
function jn(e, t, n) {
|
|
1771
|
+
on(e, t, n) || kn.set(e.key, t.key, !e.channels[t.key]);
|
|
1763
1772
|
}
|
|
1764
1773
|
// ../js/push.ts
|
|
1765
|
-
var
|
|
1774
|
+
var Mn = {
|
|
1766
1775
|
available: !1,
|
|
1767
1776
|
supported: !1,
|
|
1768
1777
|
permission: "default",
|
|
@@ -1772,11 +1781,11 @@ var jn = {
|
|
|
1772
1781
|
request: null,
|
|
1773
1782
|
devices: null
|
|
1774
1783
|
};
|
|
1775
|
-
function
|
|
1784
|
+
function Nn(e) {
|
|
1776
1785
|
return !e.available || e.reason === "unsupported" ? null : e.busy ? "busy" : e.reason ?? (e.subscribed ? "on" : "off");
|
|
1777
1786
|
}
|
|
1778
|
-
function
|
|
1779
|
-
let t =
|
|
1787
|
+
function Pn(e) {
|
|
1788
|
+
let t = Nn(e), n = e.request?.action ?? "subscribe", r = n === "unsubscribe";
|
|
1780
1789
|
switch (t) {
|
|
1781
1790
|
case null: return null;
|
|
1782
1791
|
case "off": return {
|
|
@@ -1849,39 +1858,39 @@ function Nn(e) {
|
|
|
1849
1858
|
};
|
|
1850
1859
|
}
|
|
1851
1860
|
}
|
|
1852
|
-
function
|
|
1861
|
+
function Fn(e) {
|
|
1853
1862
|
return !N(e) || typeof e.publicKey != "string" || e.publicKey === "" || typeof e.worker != "string" || e.worker === "" ? null : {
|
|
1854
1863
|
publicKey: e.publicKey,
|
|
1855
1864
|
worker: e.worker,
|
|
1856
1865
|
subscribed: e.subscribed === !0
|
|
1857
1866
|
};
|
|
1858
1867
|
}
|
|
1859
|
-
var
|
|
1860
|
-
function
|
|
1868
|
+
var In = (e) => typeof e == "string" && e !== "" ? e : null;
|
|
1869
|
+
function Ln(e) {
|
|
1861
1870
|
if (N(e) && Array.isArray(e.devices)) return e.devices.flatMap((e) => N(e) && typeof e.id == "number" && typeof e.activeAt == "string" ? [{
|
|
1862
1871
|
id: e.id,
|
|
1863
|
-
browser:
|
|
1864
|
-
platform:
|
|
1872
|
+
browser: In(e.browser),
|
|
1873
|
+
platform: In(e.platform),
|
|
1865
1874
|
activeAt: e.activeAt,
|
|
1866
1875
|
current: e.current === !0
|
|
1867
1876
|
}] : []);
|
|
1868
1877
|
}
|
|
1869
|
-
function
|
|
1878
|
+
function Rn(e) {
|
|
1870
1879
|
let t = e.replaceAll("-", "+").replaceAll("_", "/"), n = atob(t.padEnd(t.length + (4 - t.length % 4) % 4, "="));
|
|
1871
1880
|
return Uint8Array.from(n, (e) => e.charCodeAt(0));
|
|
1872
1881
|
}
|
|
1873
|
-
function
|
|
1882
|
+
function zn(e, t) {
|
|
1874
1883
|
let n = e.options?.applicationServerKey;
|
|
1875
1884
|
if (!n) return !0;
|
|
1876
1885
|
let r = new Uint8Array(n);
|
|
1877
1886
|
return r.length === t.length && r.every((e, n) => e === t[n]);
|
|
1878
1887
|
}
|
|
1879
|
-
var
|
|
1880
|
-
function
|
|
1881
|
-
return window.isSecureContext ? navigator.serviceWorker !== void 0 && "PushManager" in window && typeof Notification == "function" ? null :
|
|
1888
|
+
var Bn = () => /iPad|iPhone|iPod/.test(navigator.userAgent) || navigator.userAgent.includes("Macintosh") && navigator.maxTouchPoints > 1, Vn = () => navigator.standalone === !0 || window.matchMedia?.("(display-mode: standalone)").matches === !0;
|
|
1889
|
+
function Hn() {
|
|
1890
|
+
return window.isSecureContext ? navigator.serviceWorker !== void 0 && "PushManager" in window && typeof Notification == "function" ? null : Bn() && !Vn() ? "home-screen" : "unsupported" : "insecure";
|
|
1882
1891
|
}
|
|
1883
|
-
var
|
|
1884
|
-
function
|
|
1892
|
+
var Un = () => "brave" in navigator, Wn = () => typeof Notification == "function" ? Notification.permission : "default", Gn = (e) => new URL("./", new URL(e, window.location.href)).href;
|
|
1893
|
+
function Kn(e) {
|
|
1885
1894
|
let t = e.installing ?? e.waiting;
|
|
1886
1895
|
return e.active || !t ? e.active ? Promise.resolve(e) : Promise.reject(/* @__PURE__ */ Error("The service worker did not install.")) : new Promise((n, r) => {
|
|
1887
1896
|
let i = () => {
|
|
@@ -1890,8 +1899,8 @@ function Gn(e) {
|
|
|
1890
1899
|
t.addEventListener("statechange", i);
|
|
1891
1900
|
});
|
|
1892
1901
|
}
|
|
1893
|
-
function
|
|
1894
|
-
let e, t, n, r, i, a = 0, o = null, s = null, c = "unsupported", l = "default", u = !1, d, f = null, p = !1, m = Promise.resolve(), h = null, g = /* @__PURE__ */ new Set(), _ = null, v = 0, y =
|
|
1902
|
+
function qn() {
|
|
1903
|
+
let e, t, n, r, i, a = 0, o = null, s = null, c = "unsupported", l = "default", u = !1, d, f = null, p = !1, m = Promise.resolve(), h = null, g = /* @__PURE__ */ new Set(), _ = null, v = 0, y = Mn, b = /* @__PURE__ */ new Set(), x = () => f?.status === "pending", S = () => {
|
|
1895
1904
|
let e = s !== null, t = c === null, n = {
|
|
1896
1905
|
available: e,
|
|
1897
1906
|
supported: t,
|
|
@@ -1907,11 +1916,11 @@ function Kn() {
|
|
|
1907
1916
|
let t = m.then(e);
|
|
1908
1917
|
return m = t.catch(() => {}), t;
|
|
1909
1918
|
}, w = () => t?.getSnapshot().url, T = async (e) => {
|
|
1910
|
-
let t =
|
|
1919
|
+
let t = Gn(e.worker), n = await navigator.serviceWorker.getRegistration(t);
|
|
1911
1920
|
return n?.scope === t ? n : void 0;
|
|
1912
1921
|
}, E = async (e, t) => {
|
|
1913
1922
|
let n = new URL(e.worker, window.location.href).href;
|
|
1914
|
-
return
|
|
1923
|
+
return Kn(t?.active?.scriptURL === n ? t : await navigator.serviceWorker.register(n, { scope: Gn(e.worker) }));
|
|
1915
1924
|
}, D = (t, n, r) => t === a ? e.request("post", `${w()}/${n}`, r) : Promise.reject(/* @__PURE__ */ Error("Another user signed in.")), O = async (e, t, n = !1) => {
|
|
1916
1925
|
let r = await D(e, "push/subscribe", {
|
|
1917
1926
|
...t.toJSON(),
|
|
@@ -1921,14 +1930,14 @@ function Kn() {
|
|
|
1921
1930
|
if (!N(r) || r.subscribed !== !0) throw Error("The push endpoint did not save the subscription.");
|
|
1922
1931
|
return !0;
|
|
1923
1932
|
}, k = async (e, t, n, r = !1) => {
|
|
1924
|
-
let i =
|
|
1933
|
+
let i = Rn(n.publicKey), a, o;
|
|
1925
1934
|
try {
|
|
1926
|
-
a = await t.pushManager.getSubscription(), a && !
|
|
1935
|
+
a = await t.pushManager.getSubscription(), a && !zn(a, i) && (await a.unsubscribe(), a = null), a ??= o = await t.pushManager.subscribe({
|
|
1927
1936
|
userVisibleOnly: !0,
|
|
1928
1937
|
applicationServerKey: i
|
|
1929
1938
|
});
|
|
1930
1939
|
} catch (e) {
|
|
1931
|
-
throw
|
|
1940
|
+
throw Un() ? Object.assign(/* @__PURE__ */ Error("Brave could not subscribe."), {
|
|
1932
1941
|
brave: !0,
|
|
1933
1942
|
cause: e
|
|
1934
1943
|
}) : e;
|
|
@@ -1952,7 +1961,7 @@ function Kn() {
|
|
|
1952
1961
|
};
|
|
1953
1962
|
try {
|
|
1954
1963
|
let i = await E(n, e), a = await i.pushManager.getSubscription();
|
|
1955
|
-
if (a &&
|
|
1964
|
+
if (a && zn(a, Rn(n.publicKey))) {
|
|
1956
1965
|
n.subscribed && !await O(t, a, !0).catch(() => !0) && (await a.unsubscribe().catch(() => {}), r());
|
|
1957
1966
|
return;
|
|
1958
1967
|
}
|
|
@@ -1970,7 +1979,7 @@ function Kn() {
|
|
|
1970
1979
|
if (s === null || !e) return;
|
|
1971
1980
|
let t = a, n = ++v;
|
|
1972
1981
|
try {
|
|
1973
|
-
let r =
|
|
1982
|
+
let r = Ln(await e.request("get", `${w()}/push/devices`));
|
|
1974
1983
|
t === a && n === v && r && (h = r, M());
|
|
1975
1984
|
} catch {}
|
|
1976
1985
|
}, F = () => {
|
|
@@ -1981,14 +1990,14 @@ function Kn() {
|
|
|
1981
1990
|
let e = t.getSnapshot(), n = e.url === void 0 ? void 0 : e.user ?? "";
|
|
1982
1991
|
n !== i && (i = n, I());
|
|
1983
1992
|
let r = t.pushSettings();
|
|
1984
|
-
r !== o && (o = r, s =
|
|
1993
|
+
r !== o && (o = r, s = Fn(r), s === null ? (u = !1, d = void 0, f = x() ? f : null) : s.subscribed !== d && (u = d = s.subscribed)), l = Wn(), S(), j();
|
|
1985
1994
|
}, z = () => {
|
|
1986
|
-
l =
|
|
1995
|
+
l = Wn(), S(), j();
|
|
1987
1996
|
}, B = (t) => {
|
|
1988
1997
|
let r = t.data;
|
|
1989
1998
|
if (N(r) && r.type === "inertiaui-notifications:shown") {
|
|
1990
|
-
let e = typeof r.tag == "string" ?
|
|
1991
|
-
e !== void 0 && n?.(e) && ee([
|
|
1999
|
+
let e = typeof r.tag == "string" ? It(r.tag) : void 0;
|
|
2000
|
+
e !== void 0 && n?.(e) && ee([Ft(e)]);
|
|
1992
2001
|
return;
|
|
1993
2002
|
}
|
|
1994
2003
|
if (!N(r) || r.type !== "inertiaui-notifications:visit") return;
|
|
@@ -2002,13 +2011,13 @@ function Kn() {
|
|
|
2002
2011
|
let t = N(e.data) ? e.data.context : void 0;
|
|
2003
2012
|
return n === null || t === void 0 || t === n;
|
|
2004
2013
|
};
|
|
2005
|
-
(e === null ? (await r.getNotifications()).filter((e) =>
|
|
2014
|
+
(e === null ? (await r.getNotifications()).filter((e) => It(e.tag) !== void 0 && i(e) && a(e)) : (await Promise.all(e.map((e) => r.getNotifications({ tag: e })))).flat()).forEach((e) => e.close());
|
|
2006
2015
|
} catch {}
|
|
2007
2016
|
}, V = (e) => {
|
|
2008
2017
|
switch (e.kind) {
|
|
2009
|
-
case "item": return e.readAt !== null || e.archivedAt !== null ? ee([
|
|
2010
|
-
case "items": return e.action === "read" || e.action === "archive" ? ee(e.ids.map(
|
|
2011
|
-
case "delete": return ee(e.ids.map(
|
|
2018
|
+
case "item": return e.readAt !== null || e.archivedAt !== null ? ee([Ft(e.id)]) : Promise.resolve();
|
|
2019
|
+
case "items": return e.action === "read" || e.action === "archive" ? ee(e.ids.map(Ft)) : Promise.resolve();
|
|
2020
|
+
case "delete": return ee(e.ids.map(Ft));
|
|
2012
2021
|
case "read":
|
|
2013
2022
|
case "archive": return e.category === null && !(e.kind === "archive" && e.onlyRead) ? ee(null, Date.parse(e.before), t?.context() ?? null) : Promise.resolve();
|
|
2014
2023
|
default: return Promise.resolve();
|
|
@@ -2021,7 +2030,7 @@ function Kn() {
|
|
|
2021
2030
|
getSnapshot: () => y,
|
|
2022
2031
|
connect(i, a, o, s) {
|
|
2023
2032
|
if (e = i, t) return;
|
|
2024
|
-
t = a, n = o, r = s, c =
|
|
2033
|
+
t = a, n = o, r = s, c = Hn(), c === null && (navigator.serviceWorker.addEventListener("message", B), navigator.serviceWorker.startMessages(), navigator.permissions?.query({ name: "notifications" }).then((e) => e.addEventListener("change", z)).catch(() => {}), document.addEventListener("visibilitychange", z));
|
|
2025
2034
|
let l = (e) => void V(e);
|
|
2026
2035
|
a.onChange(l), a.onSaved(({ change: e }) => l(e)), a.subscribe(R), R();
|
|
2027
2036
|
},
|
|
@@ -2031,7 +2040,7 @@ function Kn() {
|
|
|
2031
2040
|
f = {
|
|
2032
2041
|
action: "subscribe",
|
|
2033
2042
|
status: "pending"
|
|
2034
|
-
}, S(), l = Notification.permission === "default" ? await Notification.requestPermission().catch(
|
|
2043
|
+
}, S(), l = Notification.permission === "default" ? await Notification.requestPermission().catch(Wn) : Notification.permission, t === a && (l === "granted" && (p = !0, await C(async () => {
|
|
2035
2044
|
if (t === a) try {
|
|
2036
2045
|
await k(t, await E(n, await T(n)), n), t === a && (u = !0, F());
|
|
2037
2046
|
} catch (e) {
|
|
@@ -2074,41 +2083,41 @@ function Kn() {
|
|
|
2074
2083
|
}
|
|
2075
2084
|
g.delete(e), M();
|
|
2076
2085
|
},
|
|
2077
|
-
close: (e) => ee(e.map(
|
|
2086
|
+
close: (e) => ee(e.map(Ft))
|
|
2078
2087
|
};
|
|
2079
2088
|
}
|
|
2080
|
-
var
|
|
2081
|
-
function
|
|
2089
|
+
var Jn = qn();
|
|
2090
|
+
function Yn(e, t, n, r) {
|
|
2082
2091
|
return (e ?? []).filter((e) => !e.current).map((e) => {
|
|
2083
|
-
let i = e.browser ??
|
|
2092
|
+
let i = e.browser ?? we(t.pushDeviceUnknown), a = e.platform === null ? i : we(t.pushDeviceName, {
|
|
2084
2093
|
browser: i,
|
|
2085
2094
|
platform: e.platform
|
|
2086
2095
|
});
|
|
2087
2096
|
return {
|
|
2088
2097
|
id: e.id,
|
|
2089
2098
|
name: a,
|
|
2090
|
-
active:
|
|
2091
|
-
removeLabel:
|
|
2099
|
+
active: we(t.pushDeviceActive, { time: xt(e.activeAt, n, r) }),
|
|
2100
|
+
removeLabel: we(t.pushDeviceRemoveLabel, { device: a })
|
|
2092
2101
|
};
|
|
2093
2102
|
});
|
|
2094
2103
|
}
|
|
2095
|
-
function
|
|
2104
|
+
function Xn(e) {
|
|
2096
2105
|
let t = e?.button;
|
|
2097
|
-
t && e?.state !== "busy" && (t.action === "subscribe" ?
|
|
2106
|
+
t && e?.state !== "busy" && (t.action === "subscribe" ? Jn.enable() : Jn.disable());
|
|
2098
2107
|
}
|
|
2099
2108
|
// ../js/toastStore.ts
|
|
2100
|
-
var
|
|
2101
|
-
function
|
|
2109
|
+
var Zn = 1e3;
|
|
2110
|
+
function Qn({ title: e, description: t }) {
|
|
2102
2111
|
let n = e.length + (t?.length ?? 0);
|
|
2103
2112
|
return Math.min(Math.max(2e3 + 60 * n, 5e3), 12e3);
|
|
2104
2113
|
}
|
|
2105
|
-
function
|
|
2106
|
-
return typeof t.duration == "function" ? t.duration(e) : e.type === "loading" || e.actions?.some((e) => !e.altText) || e.type === "error" && t.persistentErrors !== !1 ? null : typeof t.duration == "number" ? t.duration : e.type === "warning" ? Math.max(
|
|
2114
|
+
function $n(e, t = {}) {
|
|
2115
|
+
return typeof t.duration == "function" ? t.duration(e) : e.type === "loading" || e.actions?.some((e) => !e.altText) || e.type === "error" && t.persistentErrors !== !1 ? null : typeof t.duration == "number" ? t.duration : e.type === "warning" ? Math.max(Qn(e), 8e3) : Qn(e);
|
|
2107
2116
|
}
|
|
2108
|
-
function
|
|
2117
|
+
function er(e) {
|
|
2109
2118
|
return (e.type === "error" ? 0 : e.type === "warning" ? 2 : 4) + (e.actions.length > 0 ? 0 : 1);
|
|
2110
2119
|
}
|
|
2111
|
-
var
|
|
2120
|
+
var tr = (e) => e === void 0 || Number.isNaN(e) ? void 0 : Math.min(Math.max(e, 0), 1), nr = (e) => [...e.action ? [e.action] : [], ...e.actions ?? []], rr = {
|
|
2112
2121
|
duration: !0,
|
|
2113
2122
|
persistentErrors: !0,
|
|
2114
2123
|
durationScale: !0,
|
|
@@ -2118,7 +2127,7 @@ var er = (e) => e === void 0 || Number.isNaN(e) ? void 0 : Math.min(Math.max(e,
|
|
|
2118
2127
|
dedupe: !0,
|
|
2119
2128
|
removeDelay: !0
|
|
2120
2129
|
};
|
|
2121
|
-
function
|
|
2130
|
+
function ir(e = {}) {
|
|
2122
2131
|
let t = {}, n = 0, r = 0, i = [], a = !1, o = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Set(), c = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Set(), u = [], d = () => {
|
|
2123
2132
|
a && (a = !1, i = Array.from(o.values(), (e) => e.toast));
|
|
2124
2133
|
for (let e of l) e();
|
|
@@ -2127,7 +2136,7 @@ function rr(e = {}) {
|
|
|
2127
2136
|
}, f = (e, t) => {
|
|
2128
2137
|
e.toast = t, a = !0;
|
|
2129
2138
|
}, p = (e, n) => {
|
|
2130
|
-
let r = n === void 0 ?
|
|
2139
|
+
let r = n === void 0 ? $n(e, t) : n;
|
|
2131
2140
|
return r === null || t.autoDismiss === !1 ? null : Math.round(r * (t.durationScale ?? 1));
|
|
2132
2141
|
}, m = (e) => {
|
|
2133
2142
|
e.handle !== void 0 && (clearTimeout(e.handle), e.handle = void 0, e.remaining -= Date.now() - e.startedAt);
|
|
@@ -2135,7 +2144,7 @@ function rr(e = {}) {
|
|
|
2135
2144
|
let { timer: t } = e;
|
|
2136
2145
|
if (!t) return;
|
|
2137
2146
|
let n = (c.get(e.toast.toaster ?? "") ?? 0) > 0, r = e.toast.state === "visible" && s.size === 0 && e.holds.size === 0 && e.toast.pendingAction === void 0 && n;
|
|
2138
|
-
r && t.handle === void 0 ? (t.remaining = Math.max(t.remaining, Math.min(
|
|
2147
|
+
r && t.handle === void 0 ? (t.remaining = Math.max(t.remaining, Math.min(Zn, t.duration)), t.startedAt = Date.now(), t.handle = setTimeout(() => E(e.toast.id, "timeout"), t.remaining)) : r || m(t);
|
|
2139
2148
|
}, g = (e) => {
|
|
2140
2149
|
e.timer && m(e.timer);
|
|
2141
2150
|
let { duration: t } = e.toast;
|
|
@@ -2163,7 +2172,7 @@ function rr(e = {}) {
|
|
|
2163
2172
|
let e = t.overflow === "hide" ? -1 : 1;
|
|
2164
2173
|
for (let t of o.values()) {
|
|
2165
2174
|
if (t.toast.state !== "queued") continue;
|
|
2166
|
-
let n = _(t), r = n.filter((e) => e.toast.state === "visible").length, i = n.filter((e) => e.toast.state === "queued").sort((t, n) =>
|
|
2175
|
+
let n = _(t), r = n.filter((e) => e.toast.state === "visible").length, i = n.filter((e) => e.toast.state === "queued").sort((t, n) => er(t.toast) - er(n.toast) || e * (t.sequence - n.sequence));
|
|
2167
2176
|
for (let e of i) {
|
|
2168
2177
|
if (r >= v()) break;
|
|
2169
2178
|
r++, f(e, {
|
|
@@ -2176,7 +2185,7 @@ function rr(e = {}) {
|
|
|
2176
2185
|
let n = _(e).filter((t) => t !== e && t.toast.state === "visible");
|
|
2177
2186
|
if (n.length < v()) return "visible";
|
|
2178
2187
|
if (t.overflow !== "drop-oldest" && t.overflow !== "hide") return "queued";
|
|
2179
|
-
let r = n.reduce((e, t) =>
|
|
2188
|
+
let r = n.reduce((e, t) => er(t.toast) > er(e.toast) ? t : e);
|
|
2180
2189
|
return t.overflow === "hide" ? (f(r, {
|
|
2181
2190
|
...r.toast,
|
|
2182
2191
|
state: "queued"
|
|
@@ -2186,7 +2195,7 @@ function rr(e = {}) {
|
|
|
2186
2195
|
type: n.type ?? "default",
|
|
2187
2196
|
title: t,
|
|
2188
2197
|
description: n.description,
|
|
2189
|
-
actions:
|
|
2198
|
+
actions: nr(n)
|
|
2190
2199
|
};
|
|
2191
2200
|
return {
|
|
2192
2201
|
id: e,
|
|
@@ -2199,14 +2208,14 @@ function rr(e = {}) {
|
|
|
2199
2208
|
toaster: n.toaster,
|
|
2200
2209
|
politeness: n.politeness,
|
|
2201
2210
|
data: n.data,
|
|
2202
|
-
progress:
|
|
2211
|
+
progress: tr(n.progress),
|
|
2203
2212
|
onClose: n.onClose,
|
|
2204
2213
|
onRemove: n.onRemove,
|
|
2205
2214
|
...i
|
|
2206
2215
|
};
|
|
2207
2216
|
}, w = (e, n) => {
|
|
2208
2217
|
let r = n.type ?? "default";
|
|
2209
|
-
if (!(t.dedupe === !1 || n.id !== void 0 || r === "loading" ||
|
|
2218
|
+
if (!(t.dedupe === !1 || n.id !== void 0 || r === "loading" || nr(n).length > 0 || n.data !== void 0)) return [...o.values()].find(({ toast: t }) => t.state !== "closing" && t.actions.length === 0 && t.data === void 0 && t.toaster === n.toaster && t.type === r && t.title === e && t.description === n.description);
|
|
2210
2219
|
};
|
|
2211
2220
|
function T(e, t = {}) {
|
|
2212
2221
|
let i = t.id === void 0 ? void 0 : o.get(t.id);
|
|
@@ -2264,7 +2273,7 @@ function rr(e = {}) {
|
|
|
2264
2273
|
...c,
|
|
2265
2274
|
title: r ?? n.toast.title
|
|
2266
2275
|
};
|
|
2267
|
-
"description" in t && (u.description = t.description), t.progress !== void 0 && (u.progress =
|
|
2276
|
+
"description" in t && (u.description = t.description), t.progress !== void 0 && (u.progress = tr(t.progress)), (i !== void 0 || a !== void 0) && (u.actions = nr({
|
|
2268
2277
|
action: i,
|
|
2269
2278
|
actions: a
|
|
2270
2279
|
})), "duration" in t && (n.requested = t.duration), l && (u.duration = p(u, n.requested), u.revision++);
|
|
@@ -2323,7 +2332,7 @@ function rr(e = {}) {
|
|
|
2323
2332
|
};
|
|
2324
2333
|
},
|
|
2325
2334
|
configure(e) {
|
|
2326
|
-
let n = Object.entries(e).filter(([e, t]) => t !== void 0 && e in
|
|
2335
|
+
let n = Object.entries(e).filter(([e, t]) => t !== void 0 && e in rr);
|
|
2327
2336
|
t = {
|
|
2328
2337
|
...t,
|
|
2329
2338
|
...Object.fromEntries(n)
|
|
@@ -2333,11 +2342,11 @@ function rr(e = {}) {
|
|
|
2333
2342
|
return O.configure(e), O;
|
|
2334
2343
|
}
|
|
2335
2344
|
// ../js/toast.ts
|
|
2336
|
-
var Q =
|
|
2337
|
-
Q.subscribe(() =>
|
|
2338
|
-
var
|
|
2339
|
-
function
|
|
2340
|
-
let e = `scope-${++
|
|
2345
|
+
var Q = ir(), ar = 0;
|
|
2346
|
+
Q.subscribe(() => ar++);
|
|
2347
|
+
var or = () => ar, sr = 0;
|
|
2348
|
+
function cr() {
|
|
2349
|
+
let e = `scope-${++sr}:`, t = /* @__PURE__ */ new Map();
|
|
2341
2350
|
return {
|
|
2342
2351
|
pause(n = "manual", r) {
|
|
2343
2352
|
t.set(JSON.stringify([n, r ?? null]), [n, r]), Q.pause(e + n, r);
|
|
@@ -2350,22 +2359,22 @@ function sr() {
|
|
|
2350
2359
|
}
|
|
2351
2360
|
};
|
|
2352
2361
|
}
|
|
2353
|
-
var
|
|
2354
|
-
let n = t.id === void 0 ? void 0 :
|
|
2355
|
-
n !== void 0 &&
|
|
2356
|
-
}),
|
|
2362
|
+
var lr = j, ur, dr = "requested", fr, pr, mr, hr = B((e, t) => {
|
|
2363
|
+
let n = t.id === void 0 ? void 0 : It(t.id);
|
|
2364
|
+
n !== void 0 && vt.panelOpen() ? vt.loadArrival(n).then((e) => e && Er(e)) : Q.add(e, t);
|
|
2365
|
+
}), gr = (e) => hr(ee(e, lr)), _r = typeof window < "u", vr, yr = [
|
|
2357
2366
|
403,
|
|
2358
2367
|
419,
|
|
2359
2368
|
429,
|
|
2360
2369
|
"5xx",
|
|
2361
2370
|
"network"
|
|
2362
2371
|
];
|
|
2363
|
-
function
|
|
2372
|
+
function br(e) {
|
|
2364
2373
|
let t = (t) => {
|
|
2365
2374
|
let n = e(t);
|
|
2366
|
-
return n === void 0 ? "" :
|
|
2375
|
+
return n === void 0 ? "" : we(n);
|
|
2367
2376
|
};
|
|
2368
|
-
return Object.fromEntries(
|
|
2377
|
+
return Object.fromEntries(yr.map((e) => {
|
|
2369
2378
|
let n = t(`error_toast_${e}`), r = t(`error_toast_${e}_description`);
|
|
2370
2379
|
return [e, r === "" ? { title: n } : {
|
|
2371
2380
|
title: n,
|
|
@@ -2373,122 +2382,122 @@ function yr(e) {
|
|
|
2373
2382
|
}];
|
|
2374
2383
|
}));
|
|
2375
2384
|
}
|
|
2376
|
-
var
|
|
2377
|
-
...
|
|
2378
|
-
...
|
|
2385
|
+
var xr = br((e) => be[e]), Sr = () => ur && {
|
|
2386
|
+
...br(Ce),
|
|
2387
|
+
...ur
|
|
2379
2388
|
};
|
|
2380
|
-
function
|
|
2389
|
+
function Cr(e, t) {
|
|
2381
2390
|
return (t[e] ?? (e >= 500 ? t["5xx"] : void 0)) || void 0;
|
|
2382
2391
|
}
|
|
2383
|
-
function
|
|
2392
|
+
function wr(e, t) {
|
|
2384
2393
|
let { code: n, response: r } = e ?? {};
|
|
2385
2394
|
if (n === "ERR_NETWORK") return t.network || void 0;
|
|
2386
2395
|
if (n !== "ERR_HTTP_RESPONSE" || r?.status === void 0) return;
|
|
2387
2396
|
let { status: i, headers: a } = r;
|
|
2388
|
-
if (!(a["x-inertia"] || a["x-inertia-location"] || i === 409 && a["x-inertia-redirect"] || a["x-inertiaui-toasts"])) return
|
|
2397
|
+
if (!(a["x-inertia"] || a["x-inertia-location"] || i === 409 && a["x-inertia-redirect"] || a["x-inertiaui-toasts"])) return Cr(i, t);
|
|
2389
2398
|
}
|
|
2390
|
-
var
|
|
2391
|
-
label:
|
|
2392
|
-
altText:
|
|
2393
|
-
}),
|
|
2394
|
-
let t =
|
|
2395
|
-
t && (typeof document < "u" && document.visibilityState === "visible" &&
|
|
2396
|
-
},
|
|
2397
|
-
e.kind === "delete" ? e.ids.forEach((e) => Q.dismiss(
|
|
2398
|
-
},
|
|
2399
|
-
let t =
|
|
2399
|
+
var Tr = () => ({
|
|
2400
|
+
label: Te("inbox_toast_view"),
|
|
2401
|
+
altText: Te("inbox_toast_view_alt")
|
|
2402
|
+
}), Er = (e) => {
|
|
2403
|
+
let t = Lt(e, dr, Tr());
|
|
2404
|
+
t && (typeof document < "u" && document.visibilityState === "visible" && Jn.close([e.id]), vt.panelOpen() || Q.getSnapshot().some((e) => e.id === t.options.id && e.state !== "closing") || Q.add(t.title, t.options));
|
|
2405
|
+
}, Dr = (e) => document.visibilityState === "visible" && Q.getSnapshot().some((t) => t.id === Ft(e) && t.state !== "closing"), Or = () => Q.getSnapshot().filter((e) => It(e.id) !== void 0 && e.pendingAction === void 0).forEach((e) => Q.dismiss(e.id)), kr = (e) => {
|
|
2406
|
+
e.kind === "delete" ? e.ids.forEach((e) => Q.dismiss(Ft(e))) : e.kind === "update" && Q.update(Ft(e.item.id), Rt(e.item, Tr()));
|
|
2407
|
+
}, Ar = (e) => {
|
|
2408
|
+
let t = It(e);
|
|
2400
2409
|
t !== void 0 && X.markAsRead(t);
|
|
2401
|
-
},
|
|
2402
|
-
let r =
|
|
2403
|
-
return r === void 0 || n.result === void 0 ? void 0 :
|
|
2410
|
+
}, jr = (e, t, n) => {
|
|
2411
|
+
let r = It(e);
|
|
2412
|
+
return r === void 0 || n.result === void 0 ? void 0 : vt.completer(r, t);
|
|
2404
2413
|
};
|
|
2405
|
-
function
|
|
2406
|
-
if (
|
|
2407
|
-
if (!
|
|
2408
|
-
|
|
2414
|
+
function Mr(e, t = {}) {
|
|
2415
|
+
if (lr = t.flashKey ?? lr, Q.configure(t), dr = t.inbox?.arrivalToasts ?? dr, fr = t.inbox?.onArrival ?? fr, t.errorToasts !== void 0 && (ur = t.errorToasts === !1 ? void 0 : t.errorToasts === !0 ? {} : t.errorToasts), _r) {
|
|
2416
|
+
if (!vr) {
|
|
2417
|
+
vr = e;
|
|
2409
2418
|
let t = (e) => (t) => {
|
|
2410
|
-
let n =
|
|
2411
|
-
n &&
|
|
2419
|
+
let n = Sr();
|
|
2420
|
+
n && wr(t, n) || Q.add(e(), { type: "error" });
|
|
2412
2421
|
};
|
|
2413
|
-
X.connect(e, { onFailure: t(() =>
|
|
2422
|
+
X.connect(e, { onFailure: t(() => Te("inbox_update_failed")) }), kn.connect(e, { onFailure: t(() => Te("preferences_save_failed")) });
|
|
2414
2423
|
let n = ({ url: e, user: t }) => e === void 0 ? void 0 : t ?? "", r = n(X.getSnapshot()), i = r !== void 0;
|
|
2415
2424
|
X.subscribe(() => {
|
|
2416
2425
|
let e = n(X.getSnapshot());
|
|
2417
|
-
e !== r && (i &&
|
|
2418
|
-
}),
|
|
2426
|
+
e !== r && (i && kn.reset(X.getSnapshot().url), i ||= e !== void 0, r = e);
|
|
2427
|
+
}), Nr(e), X.onArrival((e) => fr?.(e)), X.onChange(kr), vt.onPanelOpened(Or), pr = Nt(vt, e, Er), mr = Wt(X), Jn.connect(e, vt, Dr, t(() => Te("preferences_push_device_remove_failed")));
|
|
2419
2428
|
}
|
|
2420
|
-
X.connect(
|
|
2429
|
+
X.connect(vr, { prop: t.inbox?.prop }), pr?.configure({
|
|
2421
2430
|
echo: t.inbox?.echo,
|
|
2422
2431
|
poll: t.inbox?.poll
|
|
2423
|
-
}),
|
|
2432
|
+
}), mr?.configure(t.inbox ?? {});
|
|
2424
2433
|
}
|
|
2425
2434
|
}
|
|
2426
|
-
function
|
|
2427
|
-
e.onFlash(
|
|
2435
|
+
function Nr(e) {
|
|
2436
|
+
e.onFlash(gr), e.onNavigate((e, t) => X.sync(e, t)), e.onRequest((e) => ne(e.url) ? {
|
|
2428
2437
|
...e.headers,
|
|
2429
2438
|
[M]: "1"
|
|
2430
2439
|
} : e.headers), e.onResponse((e) => {
|
|
2431
|
-
|
|
2440
|
+
gr(te(e)), hr(V(e.headers));
|
|
2432
2441
|
}), e.onError((e) => {
|
|
2433
2442
|
let t = e?.response;
|
|
2434
|
-
t?.headers &&
|
|
2435
|
-
let n =
|
|
2443
|
+
t?.headers && hr(V(t.headers));
|
|
2444
|
+
let n = Sr(), r = n && wr(e, n);
|
|
2436
2445
|
r && Q.add(r.title, {
|
|
2437
2446
|
type: "error",
|
|
2438
2447
|
description: r.description
|
|
2439
2448
|
});
|
|
2440
2449
|
}), e.onHttpException((e) => {
|
|
2441
|
-
let t =
|
|
2442
|
-
return t && e.status !== void 0 && !e.headers["x-inertia"] &&
|
|
2450
|
+
let t = Sr();
|
|
2451
|
+
return t && e.status !== void 0 && !e.headers["x-inertia"] && Cr(e.status, t) ? !1 : void 0;
|
|
2443
2452
|
});
|
|
2444
2453
|
let t = () => document.visibilityState === "hidden" ? Q.pause("hidden") : Q.resume("hidden");
|
|
2445
2454
|
document.addEventListener("visibilitychange", t), t(), window.addEventListener("blur", () => Q.pause("blur")), window.addEventListener("focus", () => Q.resume("blur"));
|
|
2446
2455
|
}
|
|
2447
|
-
var
|
|
2448
|
-
function
|
|
2456
|
+
var Pr = /* @__PURE__ */ new Map();
|
|
2457
|
+
function Fr(e, t) {
|
|
2449
2458
|
let n = Q.getSnapshot().find((t) => t.id === e), r = n?.actions[t];
|
|
2450
2459
|
if (!n || !r || n.state === "closing" || n.pendingAction !== void 0) return;
|
|
2451
|
-
|
|
2452
|
-
let i =
|
|
2460
|
+
Ar(e);
|
|
2461
|
+
let i = jr(e, t, r), a = {}, o = () => {
|
|
2453
2462
|
r.keepOpen ? Q.setPendingAction(e, void 0) : Q.dismiss(e, "action");
|
|
2454
|
-
}, s =
|
|
2455
|
-
|
|
2463
|
+
}, s = le(r, n, vr, (n) => {
|
|
2464
|
+
Pr.get(e) === a && (Pr.delete(e), Q.getSnapshot().find((t) => t.id === e)?.pendingAction === t && (n ? o() : Q.setPendingAction(e, void 0)));
|
|
2456
2465
|
}, i);
|
|
2457
|
-
s === "pending" ? (
|
|
2466
|
+
s === "pending" ? (Pr.set(e, a), Q.setPendingAction(e, t)) : s === "done" && o();
|
|
2458
2467
|
}
|
|
2459
|
-
function
|
|
2468
|
+
function Ir(e, t, n) {
|
|
2460
2469
|
let r = Q.getSnapshot().find((t) => t.id === e)?.actions[t];
|
|
2461
2470
|
if (!r) return;
|
|
2462
|
-
let i = H(r), a =
|
|
2463
|
-
if (i !== void 0 &&
|
|
2464
|
-
if (
|
|
2471
|
+
let i = H(r), a = jr(e, t, r);
|
|
2472
|
+
if (i !== void 0 && ae(r, i, n)) {
|
|
2473
|
+
if (W(i, r, n, () => Ar(e), a), re(n)) return;
|
|
2465
2474
|
r.event && window.dispatchEvent(new CustomEvent(r.event, { detail: r.payload })), r.keepOpen || Q.dismiss(e, "action");
|
|
2466
|
-
} else n.preventDefault(),
|
|
2475
|
+
} else n.preventDefault(), Fr(e, t);
|
|
2467
2476
|
}
|
|
2468
|
-
var
|
|
2477
|
+
var Lr = (e, t) => _r ? Q.add(e, t) : t?.id ?? "", Rr = (e) => (t, n) => Lr(t, {
|
|
2469
2478
|
...n,
|
|
2470
2479
|
type: e
|
|
2471
|
-
}),
|
|
2480
|
+
}), zr = (e, t, n, r) => {
|
|
2472
2481
|
let { title: i, ...a } = typeof r == "string" ? { title: r } : r;
|
|
2473
|
-
return
|
|
2482
|
+
return Lr(i, {
|
|
2474
2483
|
...n,
|
|
2475
2484
|
type: t,
|
|
2476
2485
|
...a,
|
|
2477
2486
|
id: e
|
|
2478
2487
|
});
|
|
2479
|
-
},
|
|
2480
|
-
r === void 0 ? Q.getSnapshot().some((t) => t.id === e && t.type === "loading") && Q.dismiss(e) :
|
|
2481
|
-
},
|
|
2482
|
-
success:
|
|
2483
|
-
info:
|
|
2484
|
-
warning:
|
|
2485
|
-
error:
|
|
2486
|
-
loading:
|
|
2488
|
+
}, Br = (e, t, n, r, i) => {
|
|
2489
|
+
r === void 0 ? Q.getSnapshot().some((t) => t.id === e && t.type === "loading") && Q.dismiss(e) : zr(e, t, n, typeof r == "function" ? r(i) : r);
|
|
2490
|
+
}, Vr = 0, Hr = Object.assign(Lr, {
|
|
2491
|
+
success: Rr("success"),
|
|
2492
|
+
info: Rr("info"),
|
|
2493
|
+
warning: Rr("warning"),
|
|
2494
|
+
error: Rr("error"),
|
|
2495
|
+
loading: Rr("loading"),
|
|
2487
2496
|
update: (e, t) => Q.update(e, t),
|
|
2488
2497
|
dismiss: (e) => Q.dismiss(e),
|
|
2489
2498
|
promise(e, { loading: t, success: n, error: r, ...i }) {
|
|
2490
|
-
let a =
|
|
2491
|
-
throw
|
|
2499
|
+
let a = zr(i.id ?? `iui-promise-${++Vr}`, "loading", i, t), o = (typeof e == "function" ? e() : e).then((e) => (typeof Response < "u" && e instanceof Response && !e.ok ? Br(a, "error", i, r, e) : Br(a, "success", i, n, e), e), (e) => {
|
|
2500
|
+
throw Br(a, "error", i, r, e), e;
|
|
2492
2501
|
});
|
|
2493
2502
|
return o.catch(() => {}), {
|
|
2494
2503
|
id: a,
|
|
@@ -2496,21 +2505,21 @@ var Ir = (e, t) => gr ? Q.add(e, t) : t?.id ?? "", Lr = (e) => (t, n) => Ir(t, {
|
|
|
2496
2505
|
};
|
|
2497
2506
|
},
|
|
2498
2507
|
track({ loading: e, success: t, error: n, ...r }, i) {
|
|
2499
|
-
let a = i ?? {}, o = r.id ?? `iui-track-${++
|
|
2508
|
+
let a = i ?? {}, o = r.id ?? `iui-track-${++Vr}`, s = !1;
|
|
2500
2509
|
return {
|
|
2501
2510
|
...i,
|
|
2502
2511
|
onStart(t) {
|
|
2503
|
-
s = !1, e !== void 0 &&
|
|
2512
|
+
s = !1, e !== void 0 && zr(o, "loading", r, e), a.onStart?.(t);
|
|
2504
2513
|
},
|
|
2505
2514
|
onProgress(t) {
|
|
2506
2515
|
let n = t?.progress;
|
|
2507
2516
|
e !== void 0 && n !== void 0 && Q.update(o, { progress: n }), a.onProgress?.(t);
|
|
2508
2517
|
},
|
|
2509
2518
|
onSuccess(e) {
|
|
2510
|
-
s = !0,
|
|
2519
|
+
s = !0, Br(o, "success", r, t, e), a.onSuccess?.(e);
|
|
2511
2520
|
},
|
|
2512
2521
|
onError(e) {
|
|
2513
|
-
s = !0,
|
|
2522
|
+
s = !0, Br(o, "error", r, n, e), a.onError?.(e);
|
|
2514
2523
|
},
|
|
2515
2524
|
onFinish(e) {
|
|
2516
2525
|
s || Q.dismiss(o), a.onFinish?.(e);
|
|
@@ -2519,19 +2528,19 @@ var Ir = (e, t) => gr ? Q.add(e, t) : t?.id ?? "", Lr = (e) => (t, n) => Ir(t, {
|
|
|
2519
2528
|
},
|
|
2520
2529
|
fromHeaders(e) {
|
|
2521
2530
|
let t = e instanceof Headers ? e.get(M) : e["x-inertiaui-toasts"] ?? e["X-InertiaUI-Toasts"];
|
|
2522
|
-
|
|
2531
|
+
_r && t && hr(V({ [M]: t }));
|
|
2523
2532
|
}
|
|
2524
|
-
}),
|
|
2533
|
+
}), Ur = ["F8"], Wr = [
|
|
2525
2534
|
"altKey",
|
|
2526
2535
|
"ctrlKey",
|
|
2527
2536
|
"metaKey",
|
|
2528
2537
|
"shiftKey"
|
|
2529
|
-
],
|
|
2538
|
+
], Gr = {
|
|
2530
2539
|
altKey: "toaster_hotkey_alt",
|
|
2531
2540
|
ctrlKey: "toaster_hotkey_ctrl",
|
|
2532
2541
|
metaKey: "toaster_hotkey_meta",
|
|
2533
2542
|
shiftKey: "toaster_hotkey_shift"
|
|
2534
|
-
},
|
|
2543
|
+
}, Kr = {
|
|
2535
2544
|
width: "0",
|
|
2536
2545
|
height: "0",
|
|
2537
2546
|
margin: "0",
|
|
@@ -2541,31 +2550,31 @@ var Ir = (e, t) => gr ? Q.add(e, t) : t?.id ?? "", Lr = (e) => (t, n) => Ir(t, {
|
|
|
2541
2550
|
background: "none",
|
|
2542
2551
|
color: "inherit",
|
|
2543
2552
|
"pointer-events": "auto"
|
|
2544
|
-
},
|
|
2545
|
-
function
|
|
2546
|
-
return e.map((e) => Object.hasOwn(
|
|
2553
|
+
}, qr = 45, Jr = .11;
|
|
2554
|
+
function Yr(e) {
|
|
2555
|
+
return e.map((e) => Object.hasOwn(Gr, e) ? Te(Gr[e]) : e.replace(/^(Key|Digit)/, "")).join(Te("toaster_hotkey_separator"));
|
|
2547
2556
|
}
|
|
2548
|
-
function
|
|
2549
|
-
let n = e ??
|
|
2550
|
-
return t.length > 0 ?
|
|
2557
|
+
function Xr(e, t) {
|
|
2558
|
+
let n = e ?? Te("toaster_label");
|
|
2559
|
+
return t.length > 0 ? Te("toaster_label_with_hotkey", {
|
|
2551
2560
|
label: n,
|
|
2552
|
-
hotkey:
|
|
2561
|
+
hotkey: Yr(t)
|
|
2553
2562
|
}) : n;
|
|
2554
2563
|
}
|
|
2555
|
-
function
|
|
2556
|
-
return e === void 0 ?
|
|
2557
|
-
}
|
|
2558
|
-
function Zr(e, t = {}) {
|
|
2559
|
-
let n = K(t, e) ?? Se(`toast_type_${e}`);
|
|
2560
|
-
return n === void 0 ? "" : Ce(n);
|
|
2564
|
+
function Zr(e, t) {
|
|
2565
|
+
return e === void 0 ? Te("toast_dismiss", { title: t.title }) : we(e, { title: t.title });
|
|
2561
2566
|
}
|
|
2562
2567
|
function Qr(e, t = {}) {
|
|
2563
|
-
let n =
|
|
2568
|
+
let n = K(t, e) ?? Ce(`toast_type_${e}`);
|
|
2569
|
+
return n === void 0 ? "" : we(n);
|
|
2570
|
+
}
|
|
2571
|
+
function $r(e, t = {}) {
|
|
2572
|
+
let n = Qr(e.type, t), r = n ? `${n}: ${e.title}` : e.title, i = [/[.!?…]$/.test(r) ? r : `${r}.`];
|
|
2564
2573
|
e.description && i.push(e.description);
|
|
2565
2574
|
for (let t of e.actions) t.altText && i.push(t.altText);
|
|
2566
2575
|
return i.join(" ");
|
|
2567
2576
|
}
|
|
2568
|
-
function
|
|
2577
|
+
function ei(e, t) {
|
|
2569
2578
|
let n = /* @__PURE__ */ new Map();
|
|
2570
2579
|
for (let r of [...e].reverse()) if (r.state !== "queued") {
|
|
2571
2580
|
let e = r.position ?? t;
|
|
@@ -2573,28 +2582,28 @@ function $r(e, t) {
|
|
|
2573
2582
|
}
|
|
2574
2583
|
return k.filter((e) => n.has(e)).map((e) => [e, n.get(e)]);
|
|
2575
2584
|
}
|
|
2576
|
-
var
|
|
2577
|
-
function
|
|
2578
|
-
let { region: r, host: i } = t, a =
|
|
2585
|
+
var ti = 0;
|
|
2586
|
+
function ni(e, t, n) {
|
|
2587
|
+
let { region: r, host: i } = t, a = p({
|
|
2579
2588
|
polite: t.polite,
|
|
2580
2589
|
assertive: t.assertive
|
|
2581
|
-
}), o = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Map(), l = ++
|
|
2590
|
+
}), o = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Map(), l = ++ti, u = {
|
|
2582
2591
|
hover: `hover-${l}`,
|
|
2583
2592
|
focus: `focus-${l}`,
|
|
2584
2593
|
swipe: `swipe-${l}`
|
|
2585
|
-
}, d = null, f = null,
|
|
2594
|
+
}, d = null, f = null, m = 0, h = null, g = "pointer", _ = null, y = n().name, b = e.attach(y), x = () => e.getSnapshot().filter((e) => e.toaster === n().name && e.state !== "queued"), S = () => Array.from(r.querySelectorAll("[data-toast-list]")), C = (e) => r.querySelector(`[data-toast-id="${CSS.escape(e)}"]`), w = (e) => e instanceof Element ? e.closest("[data-toast-id]") ?? null : null, T = (e) => e.dataset.state !== "closing", E = () => x().reverse().map((e) => C(e.id)).filter((e) => e !== null && T(e)), D = (e) => (e.querySelector("[data-toast-body]")?.offsetHeight ?? e.offsetHeight) + (e.offsetHeight - e.clientHeight), O = () => {
|
|
2586
2595
|
let { visibleToasts: e, expand: t } = n();
|
|
2587
|
-
for (let n of
|
|
2596
|
+
for (let n of S()) {
|
|
2588
2597
|
let r = Array.from(n.querySelectorAll(":scope > [data-toast-id]")).filter(T), i = 0;
|
|
2589
2598
|
n.dataset.expanded = String(t || n === d || n.contains(document.activeElement)), r.forEach((t, n) => {
|
|
2590
2599
|
let a = D(t);
|
|
2591
|
-
t.style.setProperty("--toast-index", String(n)), t.style.setProperty("--toast-before", `${i}px`), t.style.setProperty("--toast-height", `${a}px`), t.style.zIndex = String(r.length - n), t.dataset.front = String(n === 0), t.dataset.overflow = String(n >= e), t !==
|
|
2600
|
+
t.style.setProperty("--toast-index", String(n)), t.style.setProperty("--toast-before", `${i}px`), t.style.setProperty("--toast-height", `${a}px`), t.style.zIndex = String(r.length - n), t.dataset.front = String(n === 0), t.dataset.overflow = String(n >= e), t !== _?.item && (delete t.dataset.swipeOut, t.style.removeProperty("--toast-swipe")), i += a;
|
|
2592
2601
|
}), n.style.setProperty("--toast-count", String(r.length)), n.style.setProperty("--toast-visible", String(Math.max(1, Math.min(r.length, e)))), n.style.setProperty("--toast-front-height", `${r[0] ? D(r[0]) : 0}px`), n.style.setProperty("--toast-heights", `${i}px`);
|
|
2593
2602
|
}
|
|
2594
2603
|
}, k = typeof ResizeObserver == "function" ? new ResizeObserver(() => O()) : void 0, A = /* @__PURE__ */ new WeakSet(), j = () => {
|
|
2595
|
-
let t = !
|
|
2596
|
-
for (let r of
|
|
2597
|
-
let i =
|
|
2604
|
+
let t = !v(), n = /* @__PURE__ */ new Set();
|
|
2605
|
+
for (let r of x()) {
|
|
2606
|
+
let i = C(r.id)?.querySelector("[data-toast-progress]"), a = e.timer(r.id);
|
|
2598
2607
|
if (!i || !a) continue;
|
|
2599
2608
|
n.add(r.id);
|
|
2600
2609
|
let o = Math.max(0, a.remaining / a.duration);
|
|
@@ -2623,17 +2632,17 @@ function ti(e, t, n) {
|
|
|
2623
2632
|
}, M = e.subscribe(j), N = () => {
|
|
2624
2633
|
f = null, e.resume(u.focus);
|
|
2625
2634
|
}, P = () => {
|
|
2626
|
-
let e = E(), t =
|
|
2627
|
-
N(), t ? t.focus() : n?.isConnected && (
|
|
2635
|
+
let e = E(), t = g === "pointer" ? void 0 : e[Math.min(m, e.length - 1)], n = h;
|
|
2636
|
+
N(), t ? t.focus() : n?.isConnected && (h = null, n.focus({ preventScroll: !0 }));
|
|
2628
2637
|
}, F = () => {
|
|
2629
|
-
f && (!f.isConnected || !T(f)) ? P() : r.contains(document.activeElement) || (
|
|
2638
|
+
f && (!f.isConnected || !T(f)) ? P() : r.contains(document.activeElement) || (h = null, N());
|
|
2630
2639
|
}, I = (t) => {
|
|
2631
|
-
t.relatedTarget instanceof HTMLElement && !r.contains(t.relatedTarget) && (
|
|
2640
|
+
t.relatedTarget instanceof HTMLElement && !r.contains(t.relatedTarget) && (h = t.relatedTarget), f = w(t.target), m = f ? E().indexOf(f) : 0, e.pause(u.focus), O();
|
|
2632
2641
|
}, L = () => void setTimeout(() => {
|
|
2633
2642
|
F(), O();
|
|
2634
2643
|
}), R = (t) => {
|
|
2635
|
-
|
|
2636
|
-
let n =
|
|
2644
|
+
g = "keyboard";
|
|
2645
|
+
let n = w(t.target);
|
|
2637
2646
|
t.key === "Escape" && n?.dataset.toastId !== void 0 && n.dataset.dismissible !== "false" && (t.preventDefault(), e.dismiss(n.dataset.toastId, "escape"));
|
|
2638
2647
|
}, z = (t) => {
|
|
2639
2648
|
d !== t && (d = t, t ? e.pause(u.hover) : e.resume(u.hover), O());
|
|
@@ -2648,9 +2657,9 @@ function ti(e, t, n) {
|
|
|
2648
2657
|
let n = te(e);
|
|
2649
2658
|
return n === "both" || (n === "right" ? t > 0 : t < 0);
|
|
2650
2659
|
}, ne = (e) => {
|
|
2651
|
-
if (
|
|
2652
|
-
let t =
|
|
2653
|
-
e.button === 0 && t && !n && t.dataset.dismissible !== "false" && T(t) && (
|
|
2660
|
+
if (g = e.pointerType === "touch" ? "touch" : "pointer", _?.active) return;
|
|
2661
|
+
let t = w(e.target), n = e.target instanceof Element && e.target.closest("a, button, input, select, textarea, [data-toast-no-swipe]");
|
|
2662
|
+
e.button === 0 && t && !n && t.dataset.dismissible !== "false" && T(t) && (_ = {
|
|
2654
2663
|
item: t,
|
|
2655
2664
|
pointerId: e.pointerId,
|
|
2656
2665
|
x: e.clientX,
|
|
@@ -2659,45 +2668,45 @@ function ti(e, t, n) {
|
|
|
2659
2668
|
active: !1
|
|
2660
2669
|
});
|
|
2661
2670
|
}, U = (t) => {
|
|
2662
|
-
if (!
|
|
2663
|
-
if (!
|
|
2664
|
-
|
|
2671
|
+
if (!_ || t.pointerId !== _.pointerId) return;
|
|
2672
|
+
if (!_.active && (!(t.buttons & 1) || !_.item.isConnected || !T(_.item))) {
|
|
2673
|
+
_ = null;
|
|
2665
2674
|
return;
|
|
2666
2675
|
}
|
|
2667
|
-
let n = t.clientX -
|
|
2668
|
-
if (!
|
|
2676
|
+
let n = t.clientX - _.x;
|
|
2677
|
+
if (!_.active) {
|
|
2669
2678
|
if (Math.abs(n) < 4) return;
|
|
2670
|
-
|
|
2679
|
+
_.active = !0, _.item.dataset.swiping = "true";
|
|
2671
2680
|
try {
|
|
2672
|
-
|
|
2681
|
+
_.item.setPointerCapture(t.pointerId);
|
|
2673
2682
|
} catch {}
|
|
2674
2683
|
e.pause(u.swipe);
|
|
2675
2684
|
}
|
|
2676
|
-
|
|
2677
|
-
let r = H(
|
|
2678
|
-
|
|
2685
|
+
_.dx = n;
|
|
2686
|
+
let r = H(_.item, n) ? n : Math.sign(n) * Math.min(Math.abs(n) * .15, 8);
|
|
2687
|
+
_.item.style.setProperty("--toast-swipe", `${r}px`);
|
|
2679
2688
|
}, re = (t) => {
|
|
2680
|
-
if (!
|
|
2681
|
-
let { item: n, dx: r, active: i } =
|
|
2682
|
-
|
|
2689
|
+
if (!_) return;
|
|
2690
|
+
let { item: n, dx: r, active: i } = _, a = n.dataset.toastId;
|
|
2691
|
+
_ = null, i && (delete n.dataset.swiping, e.resume(u.swipe), t && a !== void 0 ? (n.dataset.swipeOut = r > 0 ? "right" : "left", e.dismiss(a, "swipe")) : n.style.removeProperty("--toast-swipe"));
|
|
2683
2692
|
}, ie = (e) => {
|
|
2684
|
-
if (!
|
|
2685
|
-
let t = Math.abs(
|
|
2686
|
-
re(!n && H(
|
|
2693
|
+
if (!_ || e.pointerId !== _.pointerId) return;
|
|
2694
|
+
let t = Math.abs(_.dx) / Math.max(1, Date.now() - _.time), n = (window.getSelection?.()?.toString() ?? "") !== "";
|
|
2695
|
+
re(!n && H(_.item, _.dx) && (Math.abs(_.dx) >= qr || t > Jr));
|
|
2687
2696
|
}, ae = (e) => {
|
|
2688
|
-
e.pointerId ===
|
|
2697
|
+
e.pointerId === _?.pointerId && re(!1);
|
|
2689
2698
|
}, oe = (e) => {
|
|
2690
2699
|
let t = (t) => {
|
|
2691
2700
|
t.relatedTarget === e && t.stopImmediatePropagation();
|
|
2692
2701
|
};
|
|
2693
2702
|
ce && window.addEventListener("focusout", t, !0), e.focus(), window.removeEventListener("focusout", t, !0);
|
|
2694
2703
|
}, se = (e) => {
|
|
2695
|
-
let { hotkey: t } = n(), i = t.length > 0 && t.every((t) =>
|
|
2696
|
-
i && a && (e.preventDefault(),
|
|
2697
|
-
}, W = [], ce = !1, le = (e) => e.isConnected && (e instanceof HTMLDialogElement ? e.open && e.matches(":modal") : ce && e.matches(":popover-open")),
|
|
2704
|
+
let { hotkey: t } = n(), i = t.length > 0 && t.every((t) => Wr.includes(t) ? e[t] : e.code === t), a = E()[0];
|
|
2705
|
+
i && a && (e.preventDefault(), g = "keyboard", document.activeElement instanceof HTMLElement && document.activeElement !== document.body && !r.contains(document.activeElement) && (h = document.activeElement), oe(a));
|
|
2706
|
+
}, W = [], ce = !1, le = (e) => e.isConnected && (e instanceof HTMLDialogElement ? e.open && e.matches(":modal") : ce && e.matches(":popover-open")), ue = (e) => e instanceof HTMLElement && e !== i && e.hasAttribute("popover") && /^(alert)?dialog$/.test(e.getAttribute("role") ?? ""), G = (e) => {
|
|
2698
2707
|
let t = W.indexOf(e);
|
|
2699
2708
|
t !== -1 && W.splice(t, 1);
|
|
2700
|
-
},
|
|
2709
|
+
}, K = (e) => {
|
|
2701
2710
|
let t = Array.from(i?.querySelectorAll("[data-toast-id]") ?? []);
|
|
2702
2711
|
t.forEach((e) => e.style.transition = "none"), e(), i?.offsetWidth, t.forEach((e) => e.style.removeProperty("transition"));
|
|
2703
2712
|
}, de = () => !!i?.isConnected && ce && !i.matches(":popover-open"), q = () => {
|
|
@@ -2707,26 +2716,26 @@ function ti(e, t, n) {
|
|
|
2707
2716
|
i.showPopover();
|
|
2708
2717
|
} catch {
|
|
2709
2718
|
requestAnimationFrame(() => {
|
|
2710
|
-
de() &&
|
|
2719
|
+
de() && K(() => i.showPopover());
|
|
2711
2720
|
});
|
|
2712
2721
|
}
|
|
2713
2722
|
}
|
|
2714
2723
|
}, fe = () => {
|
|
2715
2724
|
if (!i) return;
|
|
2716
2725
|
let e = [...W].reverse().find(le) ?? document.body;
|
|
2717
|
-
i.parentElement === e ? de() && q() :
|
|
2726
|
+
i.parentElement === e ? de() && q() : K(() => {
|
|
2718
2727
|
e.append(i), q();
|
|
2719
2728
|
});
|
|
2720
2729
|
}, pe = (e) => {
|
|
2721
|
-
|
|
2730
|
+
G(e), e.open && e.matches(":modal") && W.push(e);
|
|
2722
2731
|
}, me = (e) => {
|
|
2723
|
-
|
|
2732
|
+
ue(e.target) && e.newState === "closed" && (G(e.target), fe());
|
|
2724
2733
|
}, he = (e) => {
|
|
2725
|
-
|
|
2734
|
+
ue(e.target) && e.newState === "open" && (G(e.target), W.push(e.target), fe());
|
|
2726
2735
|
}, ge = (e) => e.stopPropagation(), J = (e) => {
|
|
2727
2736
|
e.relatedTarget instanceof Node && r.contains(e.relatedTarget) && e.stopPropagation();
|
|
2728
2737
|
}, _e = (e) => {
|
|
2729
|
-
let t =
|
|
2738
|
+
let t = w(e.target);
|
|
2730
2739
|
e.key === "Escape" && t && r.contains(t) && t.dataset.dismissible !== "false" && e.preventDefault();
|
|
2731
2740
|
}, ve = (e) => {
|
|
2732
2741
|
e.addEventListener("pointerdown", ge), e.addEventListener("focusin", ge), e.addEventListener("focusout", J), window.addEventListener("keydown", _e, !0), document.addEventListener("beforetoggle", me, !0), document.addEventListener("toggle", he, !0);
|
|
@@ -2736,9 +2745,9 @@ function ti(e, t, n) {
|
|
|
2736
2745
|
let t = e && typeof i?.showPopover == "function";
|
|
2737
2746
|
if (i && t !== ce) {
|
|
2738
2747
|
if (ce = t, t) {
|
|
2739
|
-
ve(i), i.setAttribute("aria-live", "off"), i.setAttribute("popover", "manual"), Object.entries(
|
|
2740
|
-
for (let e of document.querySelectorAll("[popover]"))
|
|
2741
|
-
} else ye(i), i.matches(":popover-open") && i.hidePopover(), i.removeAttribute("popover"), i.removeAttribute("aria-live"), Object.keys(
|
|
2748
|
+
ve(i), i.setAttribute("aria-live", "off"), i.setAttribute("popover", "manual"), Object.entries(Kr).forEach(([e, t]) => i.style.setProperty(e, t));
|
|
2749
|
+
for (let e of document.querySelectorAll("[popover]")) ue(e) && le(e) && W.push(e);
|
|
2750
|
+
} else ye(i), i.matches(":popover-open") && i.hidePopover(), i.removeAttribute("popover"), i.removeAttribute("aria-live"), Object.keys(Kr).forEach((e) => i.style.removeProperty(e)), W.splice(0, W.length, ...W.filter((e) => e instanceof HTMLDialogElement));
|
|
2742
2751
|
fe();
|
|
2743
2752
|
}
|
|
2744
2753
|
}, xe = i && typeof MutationObserver == "function" ? new MutationObserver((e) => {
|
|
@@ -2752,12 +2761,12 @@ function ti(e, t, n) {
|
|
|
2752
2761
|
attributeFilter: ["open"]
|
|
2753
2762
|
}), fe()), be(n().aboveModals), r.addEventListener("focusin", I), r.addEventListener("focusout", L), r.addEventListener("keydown", R), r.addEventListener("pointerdown", ne), r.addEventListener("pointermove", U), r.addEventListener("pointerup", ie), r.addEventListener("pointercancel", ae), r.addEventListener("pointerover", ee), r.addEventListener("pointerout", V), document.addEventListener("keydown", se), {
|
|
2754
2763
|
update() {
|
|
2755
|
-
be(n().aboveModals), n().name !==
|
|
2756
|
-
let t =
|
|
2764
|
+
be(n().aboveModals), n().name !== y && (b(), y = n().name, b = e.attach(y));
|
|
2765
|
+
let t = x(), { typeLabels: r } = n(), i = !v();
|
|
2757
2766
|
for (let e of t) {
|
|
2758
2767
|
if (e.state === "closing") continue;
|
|
2759
|
-
o.get(e.id) !== e.revision && (o.set(e.id, e.revision), a.announce(
|
|
2760
|
-
let t =
|
|
2768
|
+
o.get(e.id) !== e.revision && (o.set(e.id, e.revision), a.announce($r(e, r), e.politeness ?? (e.type === "error" ? "assertive" : "polite")));
|
|
2769
|
+
let t = C(e.id);
|
|
2761
2770
|
t && i && e.count > (s.get(e.id) ?? e.count) && typeof t.animate == "function" && t.animate([
|
|
2762
2771
|
{ scale: "1" },
|
|
2763
2772
|
{ scale: "1.03" },
|
|
@@ -2770,28 +2779,28 @@ function ti(e, t, n) {
|
|
|
2770
2779
|
n && k && !A.has(n) && (A.add(n), k.observe(n));
|
|
2771
2780
|
}
|
|
2772
2781
|
for (let e of [o, s]) for (let n of e.keys()) t.some((e) => e.id === n) || e.delete(n);
|
|
2773
|
-
F(), f && (
|
|
2782
|
+
F(), f && (m = E().indexOf(f)), _ && !_.item.isConnected && re(!1), d && !d.matches(":hover") && (d = null, e.resume(u.hover)), O(), j();
|
|
2774
2783
|
},
|
|
2775
2784
|
destroy() {
|
|
2776
|
-
r.removeEventListener("focusin", I), r.removeEventListener("focusout", L), r.removeEventListener("keydown", R), r.removeEventListener("pointerdown", ne), r.removeEventListener("pointermove", U), r.removeEventListener("pointerup", ie), r.removeEventListener("pointercancel", ae), r.removeEventListener("pointerover", ee), r.removeEventListener("pointerout", V), document.removeEventListener("keydown", se), be(!1), M(), k?.disconnect(), xe?.disconnect(), c.forEach((e) => e.animation?.cancel()), a.destroy(), e.resume(u.hover), e.resume(u.focus), e.resume(u.swipe),
|
|
2785
|
+
r.removeEventListener("focusin", I), r.removeEventListener("focusout", L), r.removeEventListener("keydown", R), r.removeEventListener("pointerdown", ne), r.removeEventListener("pointermove", U), r.removeEventListener("pointerup", ie), r.removeEventListener("pointercancel", ae), r.removeEventListener("pointerover", ee), r.removeEventListener("pointerout", V), document.removeEventListener("keydown", se), be(!1), M(), k?.disconnect(), xe?.disconnect(), c.forEach((e) => e.animation?.cancel()), a.destroy(), e.resume(u.hover), e.resume(u.focus), e.resume(u.swipe), b();
|
|
2777
2786
|
}
|
|
2778
2787
|
};
|
|
2779
2788
|
}
|
|
2780
2789
|
// src/classes.ts
|
|
2781
|
-
var
|
|
2790
|
+
var ri = "iui-toast rounded-iui-toast border-iui-toast-border bg-iui-toast-surface text-iui-toast-foreground focus-visible:ring-iui-toast-ring border shadow-lg focus-visible:ring-2 focus-visible:outline-hidden", ii = "flex items-start gap-3 p-4", ai = {
|
|
2782
2791
|
default: "text-iui-toast-default",
|
|
2783
2792
|
info: "text-iui-toast-info",
|
|
2784
2793
|
success: "text-iui-toast-success",
|
|
2785
2794
|
warning: "text-iui-toast-warning",
|
|
2786
2795
|
error: "text-iui-toast-error",
|
|
2787
2796
|
loading: "text-iui-toast-loading"
|
|
2788
|
-
},
|
|
2789
|
-
`${
|
|
2790
|
-
var
|
|
2791
|
-
`${
|
|
2792
|
-
var
|
|
2797
|
+
}, oi = "bg-iui-toast-default size-2 rounded-full", si = "size-5 rounded-full object-cover", ci = "size-5 motion-safe:animate-spin", li = "text-sm font-medium wrap-break-word", ui = "rounded-iui-toast focus-visible:ring-iui-toast-ring inline-flex items-center gap-1.5 px-2.5 py-1.5 text-xs font-medium focus-visible:ring-2 focus-visible:outline-hidden aria-disabled:cursor-default aria-disabled:opacity-60";
|
|
2798
|
+
`${ui}`, `${ui}`;
|
|
2799
|
+
var di = "rounded-iui-inbox text-iui-inbox-icon hover:bg-iui-inbox-control-hover hover:text-iui-inbox-icon-hover focus-visible:ring-iui-inbox-ring aria-expanded:bg-iui-inbox-control-hover aria-expanded:text-iui-inbox-icon-hover relative inline-flex size-9 items-center justify-center focus-visible:ring-2 focus-visible:outline-hidden", fi = "iui-inbox-panel border-iui-inbox-border bg-iui-inbox-surface text-iui-inbox-foreground shadow-xl focus-visible:outline-hidden", pi = "iui-inbox-panel-body flex min-h-0 flex-1 flex-col", mi = "-me-1.5 flex items-center gap-1", hi = "inline-flex", gi = "text-iui-inbox-accent tabular-nums", _i = "min-h-0 flex-1 overflow-y-auto overscroll-contain", vi = "sticky top-0 z-20 flex h-0 justify-center", yi = "divide-iui-inbox-border divide-y", bi = "focus-visible:ring-iui-inbox-ring focus-visible:ring-2 focus-visible:ring-inset focus-visible:outline-hidden", xi = "group/item hover:bg-iui-inbox-control-hover/60 data-[selected=true]:bg-iui-inbox-control-hover/60 has-[[data-inbox-link]:focus-visible]:ring-iui-inbox-ring relative flex flex-wrap gap-3 px-4 py-3 has-[[data-inbox-link]:focus-visible]:ring-2 has-[[data-inbox-link]:focus-visible]:ring-inset", Si = "relative flex shrink-0 self-start", Ci = "bg-iui-inbox-control-hover text-iui-inbox-icon-hover flex size-9 shrink-0 items-center justify-center overflow-hidden rounded-full text-sm font-medium", wi = "text-iui-inbox-foreground text-sm wrap-break-word group-data-[read=false]/item:font-semibold", Ti = "after:absolute after:inset-0 focus-visible:outline-hidden", Ei = "text-iui-inbox-muted-foreground mt-1 block text-xs", Di = "text-iui-inbox-muted-foreground mt-1 flex items-center gap-1 text-xs", Oi = "rounded-md focus-visible:ring-iui-inbox-ring inline-flex items-center gap-1.5 px-2.5 py-1.5 text-xs font-medium focus-visible:ring-2 focus-visible:outline-hidden aria-disabled:cursor-default aria-disabled:opacity-60";
|
|
2800
|
+
`${Oi}`;
|
|
2801
|
+
var ki = `${Oi} border-iui-inbox-border bg-iui-inbox-surface hover:bg-iui-inbox-control-hover border`, Ai = "iui-inbox-controls border-iui-inbox-border z-10 flex shrink-0 items-center gap-0.5 rounded-md opacity-0 group-focus-within/item:opacity-100 group-hover/item:opacity-100 [@media(hover:none)]:opacity-100", ji = "border-iui-inbox-border flex shrink-0 items-center justify-between gap-3 border-t px-4 py-1.5", Mi = "text-iui-inbox-foreground flex items-center gap-2 text-sm font-medium", Ni = "accent-iui-inbox-accent size-4 cursor-pointer", Pi = "text-iui-inbox-icon hover:bg-iui-inbox-control-hover hover:text-iui-inbox-icon-hover focus-visible:ring-iui-inbox-ring rounded-md p-1.5 focus-visible:ring-2 focus-visible:outline-hidden [@media(hover:hover)]:p-1", Fi = "text-iui-inbox-muted-foreground flex flex-col items-center gap-3 px-6 py-12 text-center text-sm", Ii = "text-iui-inbox-icon size-8", Li = "text-iui-inbox-muted-foreground flex justify-center py-3", Ri = "overflow-x-auto", zi = "w-full border-collapse text-sm", Bi = "text-iui-inbox-muted-foreground px-4 py-2.5 text-start text-xs font-medium", Vi = "text-iui-inbox-muted-foreground w-20 px-2 py-2.5 text-center text-xs font-medium sm:w-24", Hi = "border-iui-inbox-border border-t", Ui = "min-w-36 px-4 py-3 text-start align-top font-normal", Wi = "text-iui-inbox-foreground me-2 font-medium", Gi = "px-2 py-3 text-center align-middle";
|
|
2793
2802
|
// ../js/inertia.ts
|
|
2794
|
-
function
|
|
2803
|
+
function Ki(e, t, n) {
|
|
2795
2804
|
return {
|
|
2796
2805
|
onFlash: (t) => void e.on("flash", (e) => t(e.detail.flash)),
|
|
2797
2806
|
onRequest: (e) => void t.onRequest((t) => ({
|
|
@@ -2827,11 +2836,20 @@ function Gi(e, t, n) {
|
|
|
2827
2836
|
};
|
|
2828
2837
|
}
|
|
2829
2838
|
// src/notifications.ts
|
|
2830
|
-
function
|
|
2831
|
-
|
|
2839
|
+
function qi(e) {
|
|
2840
|
+
Mr(Ki(C, S, w), e);
|
|
2841
|
+
}
|
|
2842
|
+
function Ji() {
|
|
2843
|
+
let e;
|
|
2844
|
+
try {
|
|
2845
|
+
e = T().flash;
|
|
2846
|
+
} catch {}
|
|
2847
|
+
r(() => {
|
|
2848
|
+
qi(), e && gr(e);
|
|
2849
|
+
}, []);
|
|
2832
2850
|
}
|
|
2833
2851
|
// src/parts.tsx
|
|
2834
|
-
function
|
|
2852
|
+
function Yi({ className: e }) {
|
|
2835
2853
|
return /* @__PURE__ */ O("svg", {
|
|
2836
2854
|
viewBox: "0 0 20 20",
|
|
2837
2855
|
fill: "none",
|
|
@@ -2845,130 +2863,129 @@ function qi({ className: e }) {
|
|
|
2845
2863
|
r: "7",
|
|
2846
2864
|
opacity: "0.25"
|
|
2847
2865
|
}), /* @__PURE__ */ D("path", {
|
|
2848
|
-
d:
|
|
2866
|
+
d: fe,
|
|
2849
2867
|
strokeLinecap: "round"
|
|
2850
2868
|
})]
|
|
2851
2869
|
});
|
|
2852
2870
|
}
|
|
2853
|
-
var
|
|
2854
|
-
function
|
|
2855
|
-
return
|
|
2871
|
+
var Xi = (t) => typeof t == "function" || typeof t == "object" && !!t && "$$typeof" in t && !e(t);
|
|
2872
|
+
function Zi(e, t) {
|
|
2873
|
+
return Xi(e) ? /* @__PURE__ */ D(e, {
|
|
2856
2874
|
className: t,
|
|
2857
2875
|
"aria-hidden": "true"
|
|
2858
2876
|
}) : e;
|
|
2859
2877
|
}
|
|
2860
2878
|
function $({ name: e, context: t, icons: n, resolver: r, className: i }) {
|
|
2861
|
-
let a =
|
|
2862
|
-
return a === void 0 ? e === "spinner" ? /* @__PURE__ */ D(
|
|
2879
|
+
let a = ye(e, t, n, r);
|
|
2880
|
+
return a === void 0 ? e === "spinner" ? /* @__PURE__ */ D(Yi, { className: i }) : /* @__PURE__ */ D("svg", {
|
|
2863
2881
|
viewBox: "0 0 20 20",
|
|
2864
2882
|
fill: "currentColor",
|
|
2865
2883
|
"aria-hidden": "true",
|
|
2866
2884
|
className: i,
|
|
2867
|
-
children: K(
|
|
2885
|
+
children: K(ge, e)?.map((e) => /* @__PURE__ */ D("path", {
|
|
2868
2886
|
fillRule: "evenodd",
|
|
2869
2887
|
clipRule: "evenodd",
|
|
2870
2888
|
d: e
|
|
2871
2889
|
}, e))
|
|
2872
|
-
}) :
|
|
2890
|
+
}) : Zi(a, i);
|
|
2873
2891
|
}
|
|
2874
2892
|
// src/Toaster.tsx
|
|
2875
|
-
var
|
|
2876
|
-
function
|
|
2877
|
-
if (
|
|
2878
|
-
src:
|
|
2893
|
+
var Qi = [], $i = () => () => {};
|
|
2894
|
+
function ea({ toast: t, icons: n, resolver: r }) {
|
|
2895
|
+
if (t.image !== void 0) return /* @__PURE__ */ D("img", {
|
|
2896
|
+
src: t.image,
|
|
2879
2897
|
alt: "",
|
|
2880
|
-
className:
|
|
2898
|
+
className: si
|
|
2881
2899
|
});
|
|
2882
|
-
if (
|
|
2883
|
-
let
|
|
2900
|
+
if (e(t.icon)) return t.icon;
|
|
2901
|
+
let i = (e, i) => ye(e, {
|
|
2884
2902
|
component: "Toaster",
|
|
2885
2903
|
part: i,
|
|
2886
|
-
toast:
|
|
2887
|
-
},
|
|
2888
|
-
if (
|
|
2889
|
-
if (
|
|
2904
|
+
toast: t
|
|
2905
|
+
}, n, r), a = (typeof t.icon == "string" ? i(t.icon, "icon") : void 0) ?? i(t.type, "type");
|
|
2906
|
+
if (a !== void 0) return Zi(a, "size-5");
|
|
2907
|
+
if (t.type === "loading") return /* @__PURE__ */ D($, {
|
|
2890
2908
|
name: "spinner",
|
|
2891
2909
|
context: {
|
|
2892
2910
|
component: "Toaster",
|
|
2893
2911
|
part: "type",
|
|
2894
|
-
toast:
|
|
2912
|
+
toast: t
|
|
2895
2913
|
},
|
|
2896
|
-
icons:
|
|
2897
|
-
resolver:
|
|
2898
|
-
className:
|
|
2914
|
+
icons: n,
|
|
2915
|
+
resolver: r,
|
|
2916
|
+
className: ci
|
|
2899
2917
|
});
|
|
2900
|
-
let
|
|
2901
|
-
return
|
|
2918
|
+
let o = K(de, t.type);
|
|
2919
|
+
return o === void 0 ? /* @__PURE__ */ D("span", { className: oi }) : /* @__PURE__ */ D("svg", {
|
|
2902
2920
|
viewBox: "0 0 20 20",
|
|
2903
2921
|
fill: "currentColor",
|
|
2904
2922
|
className: "size-5",
|
|
2905
2923
|
children: /* @__PURE__ */ D("path", {
|
|
2906
2924
|
fillRule: "evenodd",
|
|
2907
2925
|
clipRule: "evenodd",
|
|
2908
|
-
d:
|
|
2926
|
+
d: o
|
|
2909
2927
|
})
|
|
2910
2928
|
});
|
|
2911
2929
|
}
|
|
2912
|
-
function
|
|
2913
|
-
|
|
2930
|
+
function ta({ position: e = "bottom-right", name: t, label: n, dismissLabel: i, hotkey: l = Ur, typeLabels: u = {}, visibleToasts: d = 3, expand: f = !1, progress: p = !1, icons: m = {}, iconResolver: h, classes: g = {}, renderToast: _, renderIcon: v, components: y = {}, aboveModals: b = !0 }) {
|
|
2931
|
+
Ji();
|
|
2932
|
+
let x = s(Q.subscribe, Q.getSnapshot, () => Qi), S = s($i, () => !0, () => !1), [C] = o(() => typeof document > "u" ? null : Object.assign(document.createElement("div"), { className: "iui-toaster-host" })), w = a(null), T = a(null), k = a(null), A = a(null), j = a({
|
|
2914
2933
|
name: t,
|
|
2915
|
-
hotkey:
|
|
2916
|
-
typeLabels:
|
|
2917
|
-
visibleToasts:
|
|
2918
|
-
expand:
|
|
2919
|
-
aboveModals:
|
|
2934
|
+
hotkey: l,
|
|
2935
|
+
typeLabels: u,
|
|
2936
|
+
visibleToasts: d,
|
|
2937
|
+
expand: f,
|
|
2938
|
+
aboveModals: b
|
|
2920
2939
|
});
|
|
2921
|
-
if (
|
|
2922
|
-
|
|
2940
|
+
if (r(() => {
|
|
2941
|
+
j.current = {
|
|
2923
2942
|
name: t,
|
|
2924
|
-
hotkey:
|
|
2925
|
-
typeLabels:
|
|
2926
|
-
visibleToasts:
|
|
2927
|
-
expand:
|
|
2928
|
-
aboveModals:
|
|
2943
|
+
hotkey: l,
|
|
2944
|
+
typeLabels: u,
|
|
2945
|
+
visibleToasts: d,
|
|
2946
|
+
expand: f,
|
|
2947
|
+
aboveModals: b
|
|
2929
2948
|
};
|
|
2930
|
-
}),
|
|
2931
|
-
|
|
2932
|
-
|
|
2933
|
-
|
|
2934
|
-
|
|
2935
|
-
|
|
2936
|
-
|
|
2937
|
-
|
|
2938
|
-
|
|
2939
|
-
|
|
2940
|
-
|
|
2941
|
-
return M.current = e, () => {
|
|
2942
|
-
e.destroy(), M.current = null, T.remove();
|
|
2949
|
+
}), r(() => {
|
|
2950
|
+
if (!C || !S) return;
|
|
2951
|
+
document.body.append(C);
|
|
2952
|
+
let e = ni(Q, {
|
|
2953
|
+
region: w.current,
|
|
2954
|
+
host: C,
|
|
2955
|
+
polite: T.current,
|
|
2956
|
+
assertive: k.current
|
|
2957
|
+
}, () => j.current);
|
|
2958
|
+
return A.current = e, () => {
|
|
2959
|
+
e.destroy(), A.current = null, C.remove();
|
|
2943
2960
|
};
|
|
2944
|
-
}, [
|
|
2945
|
-
let
|
|
2946
|
-
let t = () => Q.dismiss(e.id, "user"), n = (t, n) =>
|
|
2947
|
-
if (
|
|
2961
|
+
}, [C, S]), r(() => A.current?.update()), !C || !S) return null;
|
|
2962
|
+
let M = ei(x.filter((e) => e.toaster === t), e), N = (e) => {
|
|
2963
|
+
let t = () => Q.dismiss(e.id, "user"), n = (t, n) => Ir(e.id, t, n.nativeEvent), r = K(y, e.type);
|
|
2964
|
+
if (r) return /* @__PURE__ */ D(r, {
|
|
2948
2965
|
toast: e,
|
|
2949
2966
|
dismiss: t,
|
|
2950
2967
|
runAction: n
|
|
2951
2968
|
});
|
|
2952
|
-
if (
|
|
2969
|
+
if (_) return _(e, {
|
|
2953
2970
|
dismiss: t,
|
|
2954
2971
|
runAction: n
|
|
2955
2972
|
});
|
|
2956
|
-
let a =
|
|
2973
|
+
let a = Qr(e.type, u);
|
|
2957
2974
|
return /* @__PURE__ */ O(E, { children: [
|
|
2958
2975
|
e.icon !== !1 && /* @__PURE__ */ D("span", {
|
|
2959
2976
|
"aria-hidden": "true",
|
|
2960
|
-
className: G("flex size-5 shrink-0 items-center justify-center", K(
|
|
2961
|
-
children:
|
|
2977
|
+
className: G("flex size-5 shrink-0 items-center justify-center", K(ai, e.type) ?? ai.default, g.icon),
|
|
2978
|
+
children: v ? v(e) : /* @__PURE__ */ D(ea, {
|
|
2962
2979
|
toast: e,
|
|
2963
|
-
icons:
|
|
2964
|
-
resolver:
|
|
2980
|
+
icons: m,
|
|
2981
|
+
resolver: h
|
|
2965
2982
|
})
|
|
2966
2983
|
}),
|
|
2967
2984
|
/* @__PURE__ */ O("div", {
|
|
2968
2985
|
className: "min-w-0 flex-1",
|
|
2969
2986
|
children: [
|
|
2970
2987
|
/* @__PURE__ */ O("p", {
|
|
2971
|
-
className: G(
|
|
2988
|
+
className: G(li, g.title),
|
|
2972
2989
|
children: [
|
|
2973
2990
|
a && /* @__PURE__ */ O("span", {
|
|
2974
2991
|
className: "sr-only",
|
|
@@ -2979,12 +2996,12 @@ function $i({ position: e = "bottom-right", name: t, label: n, dismissLabel: r,
|
|
|
2979
2996
|
"data-toast-count": !0,
|
|
2980
2997
|
"aria-hidden": "true",
|
|
2981
2998
|
className: "bg-iui-toast-control-hover text-iui-toast-muted-foreground ms-1.5 inline-block rounded-full px-1.5 text-xs font-medium tabular-nums",
|
|
2982
|
-
children:
|
|
2999
|
+
children: Te("toast_count", { count: e.count })
|
|
2983
3000
|
})
|
|
2984
3001
|
]
|
|
2985
3002
|
}),
|
|
2986
3003
|
e.description && /* @__PURE__ */ D("p", {
|
|
2987
|
-
className: G("text-iui-toast-muted-foreground mt-1 text-sm wrap-break-word",
|
|
3004
|
+
className: G("text-iui-toast-muted-foreground mt-1 text-sm wrap-break-word", g.description),
|
|
2988
3005
|
children: e.description
|
|
2989
3006
|
}),
|
|
2990
3007
|
e.progress !== void 0 && /* @__PURE__ */ D("div", {
|
|
@@ -2996,18 +3013,18 @@ function $i({ position: e = "bottom-right", name: t, label: n, dismissLabel: r,
|
|
|
2996
3013
|
"data-toast-progressbar": "",
|
|
2997
3014
|
className: "bg-iui-toast-control-hover mt-2 h-1.5 overflow-hidden rounded-full",
|
|
2998
3015
|
children: /* @__PURE__ */ D("div", {
|
|
2999
|
-
className: G("h-full rounded-full bg-current transition-[width] duration-300 motion-reduce:transition-none", K(
|
|
3016
|
+
className: G("h-full rounded-full bg-current transition-[width] duration-300 motion-reduce:transition-none", K(ai, e.type) ?? ai.default),
|
|
3000
3017
|
style: { width: `${e.progress * 100}%` }
|
|
3001
3018
|
})
|
|
3002
3019
|
}),
|
|
3003
3020
|
e.actions.length > 0 && /* @__PURE__ */ D("div", {
|
|
3004
|
-
className: G("mt-3 flex flex-wrap gap-2",
|
|
3021
|
+
className: G("mt-3 flex flex-wrap gap-2", g.actions),
|
|
3005
3022
|
children: e.actions.map((t, r) => {
|
|
3006
3023
|
let i = H(t), a = {
|
|
3007
3024
|
"aria-disabled": e.pendingAction !== void 0 || void 0,
|
|
3008
3025
|
"aria-busy": e.pendingAction === r || void 0,
|
|
3009
3026
|
"data-toast-action": "",
|
|
3010
|
-
className: G(r === 0 ? "rounded-iui-toast focus-visible:ring-iui-toast-ring inline-flex items-center gap-1.5 px-2.5 py-1.5 text-xs font-medium focus-visible:ring-2 focus-visible:outline-hidden aria-disabled:cursor-default aria-disabled:opacity-60 border-iui-toast-action text-iui-toast-action hover:bg-iui-toast-action/10 border" : "rounded-iui-toast focus-visible:ring-iui-toast-ring inline-flex items-center gap-1.5 px-2.5 py-1.5 text-xs font-medium focus-visible:ring-2 focus-visible:outline-hidden aria-disabled:cursor-default aria-disabled:opacity-60 border-iui-toast-border hover:bg-iui-toast-control-hover border",
|
|
3027
|
+
className: G(r === 0 ? "rounded-iui-toast focus-visible:ring-iui-toast-ring inline-flex items-center gap-1.5 px-2.5 py-1.5 text-xs font-medium focus-visible:ring-2 focus-visible:outline-hidden aria-disabled:cursor-default aria-disabled:opacity-60 border-iui-toast-action text-iui-toast-action hover:bg-iui-toast-action/10 border" : "rounded-iui-toast focus-visible:ring-iui-toast-ring inline-flex items-center gap-1.5 px-2.5 py-1.5 text-xs font-medium focus-visible:ring-2 focus-visible:outline-hidden aria-disabled:cursor-default aria-disabled:opacity-60 border-iui-toast-border hover:bg-iui-toast-control-hover border", g.action),
|
|
3011
3028
|
onClick: (e) => n(r, e)
|
|
3012
3029
|
}, o = /* @__PURE__ */ O(E, { children: [e.pendingAction === r && /* @__PURE__ */ D($, {
|
|
3013
3030
|
name: "spinner",
|
|
@@ -3017,8 +3034,8 @@ function $i({ position: e = "bottom-right", name: t, label: n, dismissLabel: r,
|
|
|
3017
3034
|
toast: e,
|
|
3018
3035
|
action: t
|
|
3019
3036
|
},
|
|
3020
|
-
icons:
|
|
3021
|
-
resolver:
|
|
3037
|
+
icons: m,
|
|
3038
|
+
resolver: h,
|
|
3022
3039
|
className: "size-3.5 motion-safe:animate-spin"
|
|
3023
3040
|
}), t.label] });
|
|
3024
3041
|
return i === void 0 ? /* @__PURE__ */ D("button", {
|
|
@@ -3038,8 +3055,8 @@ function $i({ position: e = "bottom-right", name: t, label: n, dismissLabel: r,
|
|
|
3038
3055
|
}),
|
|
3039
3056
|
e.dismissible && /* @__PURE__ */ D("button", {
|
|
3040
3057
|
type: "button",
|
|
3041
|
-
"aria-label":
|
|
3042
|
-
className: G("rounded-iui-toast text-iui-toast-icon hover:bg-iui-toast-control-hover hover:text-iui-toast-icon-hover focus-visible:ring-iui-toast-ring -m-1 shrink-0 p-1 focus-visible:ring-2 focus-visible:outline-hidden",
|
|
3058
|
+
"aria-label": Zr(i, e),
|
|
3059
|
+
className: G("rounded-iui-toast text-iui-toast-icon hover:bg-iui-toast-control-hover hover:text-iui-toast-icon-hover focus-visible:ring-iui-toast-ring -m-1 shrink-0 p-1 focus-visible:ring-2 focus-visible:outline-hidden", g.dismiss),
|
|
3043
3060
|
onClick: t,
|
|
3044
3061
|
children: /* @__PURE__ */ D($, {
|
|
3045
3062
|
name: "dismiss",
|
|
@@ -3048,21 +3065,21 @@ function $i({ position: e = "bottom-right", name: t, label: n, dismissLabel: r,
|
|
|
3048
3065
|
part: "dismiss",
|
|
3049
3066
|
toast: e
|
|
3050
3067
|
},
|
|
3051
|
-
icons:
|
|
3052
|
-
resolver:
|
|
3068
|
+
icons: m,
|
|
3069
|
+
resolver: h,
|
|
3053
3070
|
className: "size-4"
|
|
3054
3071
|
})
|
|
3055
3072
|
})
|
|
3056
3073
|
] });
|
|
3057
3074
|
};
|
|
3058
|
-
return
|
|
3059
|
-
ref:
|
|
3060
|
-
"aria-label":
|
|
3075
|
+
return c(/* @__PURE__ */ O("section", {
|
|
3076
|
+
ref: w,
|
|
3077
|
+
"aria-label": Xr(n, l),
|
|
3061
3078
|
tabIndex: -1,
|
|
3062
3079
|
className: "iui-toaster outline-none",
|
|
3063
3080
|
"data-toaster": t,
|
|
3064
3081
|
children: [
|
|
3065
|
-
|
|
3082
|
+
M.map(([e, t]) => /* @__PURE__ */ D("ol", {
|
|
3066
3083
|
role: "list",
|
|
3067
3084
|
"data-toast-list": "",
|
|
3068
3085
|
"data-position": e,
|
|
@@ -3074,81 +3091,81 @@ function $i({ position: e = "bottom-right", name: t, label: n, dismissLabel: r,
|
|
|
3074
3091
|
"data-dismissible": String(e.dismissible),
|
|
3075
3092
|
"aria-busy": e.type === "loading" || void 0,
|
|
3076
3093
|
tabIndex: 0,
|
|
3077
|
-
className: G(
|
|
3094
|
+
className: G(ri, g.toast),
|
|
3078
3095
|
children: [/* @__PURE__ */ D("div", {
|
|
3079
3096
|
"data-toast-body": "",
|
|
3080
|
-
className:
|
|
3081
|
-
children:
|
|
3082
|
-
}),
|
|
3097
|
+
className: ii,
|
|
3098
|
+
children: N(e)
|
|
3099
|
+
}), p && e.duration !== null && /* @__PURE__ */ D("div", {
|
|
3083
3100
|
"data-toast-progress": "",
|
|
3084
3101
|
"aria-hidden": "true",
|
|
3085
|
-
className: G("iui-toast-progress", K(
|
|
3102
|
+
className: G("iui-toast-progress", K(ai, e.type) ?? ai.default, g.progress)
|
|
3086
3103
|
})]
|
|
3087
3104
|
}, e.id))
|
|
3088
3105
|
}, e)),
|
|
3089
3106
|
/* @__PURE__ */ D("div", {
|
|
3090
|
-
ref:
|
|
3107
|
+
ref: T,
|
|
3091
3108
|
role: "status",
|
|
3092
3109
|
"aria-live": "polite",
|
|
3093
3110
|
"aria-atomic": "true",
|
|
3094
3111
|
className: "sr-only"
|
|
3095
3112
|
}),
|
|
3096
3113
|
/* @__PURE__ */ D("div", {
|
|
3097
|
-
ref:
|
|
3114
|
+
ref: k,
|
|
3098
3115
|
"aria-live": "assertive",
|
|
3099
3116
|
"aria-atomic": "true",
|
|
3100
3117
|
className: "sr-only"
|
|
3101
3118
|
})
|
|
3102
3119
|
]
|
|
3103
|
-
}),
|
|
3120
|
+
}), C);
|
|
3104
3121
|
}
|
|
3105
3122
|
// ../js/notificationCenter.ts
|
|
3106
|
-
var
|
|
3123
|
+
var na = [
|
|
3107
3124
|
"all",
|
|
3108
3125
|
"unread",
|
|
3109
3126
|
"snoozed",
|
|
3110
3127
|
"archived"
|
|
3111
|
-
],
|
|
3128
|
+
], ra = {
|
|
3112
3129
|
all: "empty",
|
|
3113
3130
|
unread: "emptyUnread",
|
|
3114
3131
|
snoozed: "emptySnoozed",
|
|
3115
3132
|
archived: "emptyArchived"
|
|
3116
|
-
},
|
|
3117
|
-
function
|
|
3118
|
-
return Object.hasOwn(
|
|
3133
|
+
}, ia = (e) => [...na, ...Object.keys(e)], aa = (e) => ia(e.tabs).filter((t) => Ne(t, e.allowedActions));
|
|
3134
|
+
function oa(e, t, n) {
|
|
3135
|
+
return Object.hasOwn(ra, e) ? Z(t[e]) : Object.hasOwn(n, e) ? n[e].label : e;
|
|
3119
3136
|
}
|
|
3120
|
-
var
|
|
3137
|
+
var sa = (e, t) => Z(t[Object.hasOwn(ra, e) ? ra[e] : "empty"]), ca = (e, t, n) => e.map((e) => ({
|
|
3121
3138
|
filter: e,
|
|
3122
|
-
label:
|
|
3139
|
+
label: oa(e, n, t.tabs),
|
|
3123
3140
|
selected: t.filter === e,
|
|
3124
3141
|
count: e === "unread" ? t.counts.unread : null
|
|
3125
|
-
})),
|
|
3126
|
-
function
|
|
3142
|
+
})), la = (e, t) => t.length > 0 ? e.filter((e) => !t.includes(e.id)) : e;
|
|
3143
|
+
function ua(e, t) {
|
|
3127
3144
|
return e.status === "idle" || e.status === "loading" && t === 0 ? "loading" : e.status === "error" ? "error" : t === 0 ? "empty" : "items";
|
|
3128
3145
|
}
|
|
3129
|
-
function
|
|
3130
|
-
|
|
3146
|
+
function da(e, t = e.category) {
|
|
3147
|
+
Ie({
|
|
3131
3148
|
...e,
|
|
3132
3149
|
category: t
|
|
3133
3150
|
}) > 0 && X.markAllAsRead({ category: t });
|
|
3134
3151
|
}
|
|
3135
|
-
var
|
|
3136
|
-
function
|
|
3152
|
+
var fa = (e) => e.filter === "all" && e.allowedActions.includes("archive");
|
|
3153
|
+
function pa(e, t) {
|
|
3137
3154
|
e.length > 0 && X.archiveAll({ category: t });
|
|
3138
3155
|
}
|
|
3139
|
-
function
|
|
3156
|
+
function ma(e, t, n, r) {
|
|
3140
3157
|
let i = new URL(e, "http://localhost"), a = i.searchParams;
|
|
3141
3158
|
return a.delete("filter"), a.delete("category"), r !== void 0 && a.delete(r), t !== "all" && a.set("filter", t), n !== null && a.set("category", n), `${i.pathname}${i.search}`;
|
|
3142
3159
|
}
|
|
3143
|
-
function
|
|
3160
|
+
function ha(e, t, n, r) {
|
|
3144
3161
|
let i = new URL(e, "http://localhost").searchParams, a = i.get("filter");
|
|
3145
3162
|
return {
|
|
3146
|
-
filter: n ?? (a !== null &&
|
|
3163
|
+
filter: n ?? (a !== null && aa(t).includes(a) ? a : "all"),
|
|
3147
3164
|
category: r === void 0 ? i.get("category") || null : r
|
|
3148
3165
|
};
|
|
3149
3166
|
}
|
|
3150
|
-
var
|
|
3151
|
-
function
|
|
3167
|
+
var ga = (e, t, n, r) => Z(e.pausedUntil, { time: mt(t, n, r) }), _a = (e, t, n) => mt(ft(e.preset, new Date(t)), t, n);
|
|
3168
|
+
function va(e, t) {
|
|
3152
3169
|
let n = !t.includes("snooze") || e === "archived" ? [] : [e === "snoozed" ? {
|
|
3153
3170
|
action: "unsnooze",
|
|
3154
3171
|
icon: "unsnooze",
|
|
@@ -3186,12 +3203,12 @@ function ga(e, t) {
|
|
|
3186
3203
|
...i
|
|
3187
3204
|
];
|
|
3188
3205
|
}
|
|
3189
|
-
var
|
|
3190
|
-
function
|
|
3206
|
+
var ya = (e, t, n = /* @__PURE__ */ new Date()) => e ? e(n) : lt(t, n);
|
|
3207
|
+
function ba(e, t, n) {
|
|
3191
3208
|
let r = e.filter((e) => e !== t);
|
|
3192
3209
|
return n ? [...r, t] : r;
|
|
3193
3210
|
}
|
|
3194
|
-
function
|
|
3211
|
+
function xa(e, t, { scroller: n, listed: r }) {
|
|
3195
3212
|
let i = [], a = (e) => {
|
|
3196
3213
|
i = e, t(e);
|
|
3197
3214
|
}, o = n ?? window, s = () => n ? n.scrollTop > 0 : e.getBoundingClientRect().top < 0, c = X.onArrival((t) => {
|
|
@@ -3215,8 +3232,8 @@ function ya(e, t, { scroller: n, listed: r }) {
|
|
|
3215
3232
|
}
|
|
3216
3233
|
};
|
|
3217
3234
|
}
|
|
3218
|
-
var
|
|
3219
|
-
function
|
|
3235
|
+
var Sa = 1e3, Ca = 250;
|
|
3236
|
+
function wa(e, t, n = e) {
|
|
3220
3237
|
let r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Set(), a = [], o, s = () => {
|
|
3221
3238
|
o = void 0;
|
|
3222
3239
|
let e = a, n = t().filter((t) => e.includes(t.id));
|
|
@@ -3226,11 +3243,11 @@ function Sa(e, t, n = e) {
|
|
|
3226
3243
|
}, l = (e) => {
|
|
3227
3244
|
r.delete(e);
|
|
3228
3245
|
let t = e.dataset.inboxId;
|
|
3229
|
-
t !== void 0 && e.dataset.seen === "false" && e.isConnected && (u.unobserve(e), i.delete(e), a.push(t), o ??= setTimeout(s,
|
|
3246
|
+
t !== void 0 && e.dataset.seen === "false" && e.isConnected && (u.unobserve(e), i.delete(e), a.push(t), o ??= setTimeout(s, Ca));
|
|
3230
3247
|
}, u = new IntersectionObserver((e) => {
|
|
3231
3248
|
for (let t of e) {
|
|
3232
3249
|
let e = t.target, n = t.rootBounds !== null && t.intersectionRect.height >= t.rootBounds.height / 2;
|
|
3233
|
-
t.isIntersecting && (t.intersectionRatio >= .5 || n) ? r.set(e, r.get(e) ?? setTimeout(() => l(e),
|
|
3250
|
+
t.isIntersecting && (t.intersectionRatio >= .5 || n) ? r.set(e, r.get(e) ?? setTimeout(() => l(e), Sa)) : c(e);
|
|
3234
3251
|
}
|
|
3235
3252
|
}, {
|
|
3236
3253
|
root: n,
|
|
@@ -3252,7 +3269,7 @@ function Sa(e, t, n = e) {
|
|
|
3252
3269
|
f.disconnect(), u.disconnect(), r.forEach((e) => clearTimeout(e)), o !== void 0 && (clearTimeout(o), s());
|
|
3253
3270
|
} };
|
|
3254
3271
|
}
|
|
3255
|
-
function
|
|
3272
|
+
function Ta(e, t) {
|
|
3256
3273
|
let n = (e.target instanceof Element ? e.target : null)?.closest("[data-inbox-link], [data-inbox-action]"), r = n?.closest("[data-inbox-item]")?.dataset.inboxId, i = r === void 0 ? void 0 : t.find((e) => e.id === r);
|
|
3257
3274
|
if (!n || !i) return;
|
|
3258
3275
|
if (!n.hasAttribute("data-inbox-action")) return { item: i };
|
|
@@ -3262,7 +3279,7 @@ function Ca(e, t) {
|
|
|
3262
3279
|
action: o
|
|
3263
3280
|
} : void 0;
|
|
3264
3281
|
}
|
|
3265
|
-
var
|
|
3282
|
+
var Ea = 160, Da = [
|
|
3266
3283
|
"position",
|
|
3267
3284
|
"box-sizing",
|
|
3268
3285
|
"inset",
|
|
@@ -3278,7 +3295,7 @@ var wa = 160, Ta = [
|
|
|
3278
3295
|
"overflow-y",
|
|
3279
3296
|
"overscroll-behavior"
|
|
3280
3297
|
];
|
|
3281
|
-
function
|
|
3298
|
+
function Oa(e, t, n) {
|
|
3282
3299
|
let r, i = null, a, o = t.querySelector("[data-inbox-scroller]"), s = o !== null && typeof ResizeObserver == "function" ? new ResizeObserver(() => {
|
|
3283
3300
|
o.offsetHeight > 0 && o.querySelector(":scope > [role=\"status\"]") === null && t.style.setProperty("--inbox-list-height", `${o.offsetHeight}px`);
|
|
3284
3301
|
}) : void 0;
|
|
@@ -3289,33 +3306,33 @@ function Ea(e, t, n) {
|
|
|
3289
3306
|
}, l = () => {
|
|
3290
3307
|
if (!t.matches(":popover-open")) return;
|
|
3291
3308
|
if (getComputedStyle(t).getPropertyValue("--inbox-layout").trim() === "sheet") {
|
|
3292
|
-
a?.(), a = void 0,
|
|
3309
|
+
a?.(), a = void 0, Da.forEach((e) => t.style.removeProperty(e)), delete t.dataset.side;
|
|
3293
3310
|
return;
|
|
3294
3311
|
}
|
|
3295
|
-
let { placement: r } =
|
|
3312
|
+
let { placement: r } = _(e, t, {
|
|
3296
3313
|
placement: n.placement(),
|
|
3297
3314
|
offset: c("--inbox-gap", 8),
|
|
3298
3315
|
viewportMargin: c("--inbox-offset", 8),
|
|
3299
3316
|
anchorPositioning: !1
|
|
3300
3317
|
});
|
|
3301
|
-
t.dataset.side = r.split("-")[0], a ??=
|
|
3302
|
-
}, u = () => void (a === void 0 && l()),
|
|
3318
|
+
t.dataset.side = r.split("-")[0], a ??= d(e, t, l);
|
|
3319
|
+
}, u = () => void (a === void 0 && l()), f = (e) => {
|
|
3303
3320
|
e.newState === "open" && requestAnimationFrame(() => a === void 0 && l());
|
|
3304
|
-
},
|
|
3321
|
+
}, p = (r) => {
|
|
3305
3322
|
let i = r.newState === "open";
|
|
3306
3323
|
i ? (a === void 0 && l(), window.addEventListener("resize", u), t.contains(document.activeElement) || t.focus({ preventScroll: !0 })) : (a?.(), a = void 0, window.removeEventListener("resize", u)), e.setAttribute("aria-expanded", String(i)), n.onToggle(i);
|
|
3307
|
-
},
|
|
3324
|
+
}, m = (n) => {
|
|
3308
3325
|
let r = n.relatedTarget;
|
|
3309
3326
|
r instanceof Node && !t.contains(r) && !e.contains(r) && t.matches(":popover-open") && t.hidePopover();
|
|
3310
3327
|
};
|
|
3311
|
-
return t.addEventListener("beforetoggle",
|
|
3328
|
+
return t.addEventListener("beforetoggle", f), t.addEventListener("toggle", p), t.addEventListener("focusout", m), {
|
|
3312
3329
|
observe(e) {
|
|
3313
3330
|
let t = e?.closest("[data-inbox-scroller]") ?? null;
|
|
3314
3331
|
r && t === i || (r?.disconnect(), i = t, r = typeof IntersectionObserver == "function" ? new IntersectionObserver((e) => {
|
|
3315
3332
|
e.some((e) => e.isIntersecting) && n.onEndReached();
|
|
3316
3333
|
}, {
|
|
3317
3334
|
root: t,
|
|
3318
|
-
rootMargin: `0px 0px ${
|
|
3335
|
+
rootMargin: `0px 0px ${Ea}px 0px`
|
|
3319
3336
|
}) : void 0), r?.disconnect(), e && r?.observe(e);
|
|
3320
3337
|
},
|
|
3321
3338
|
place: l,
|
|
@@ -3323,11 +3340,11 @@ function Ea(e, t, n) {
|
|
|
3323
3340
|
t.matches(":popover-open") && t.hidePopover();
|
|
3324
3341
|
},
|
|
3325
3342
|
destroy() {
|
|
3326
|
-
r?.disconnect(), s?.disconnect(), a?.(), t.removeEventListener("beforetoggle",
|
|
3343
|
+
r?.disconnect(), s?.disconnect(), a?.(), t.removeEventListener("beforetoggle", f), t.removeEventListener("toggle", p), t.removeEventListener("focusout", m), window.removeEventListener("resize", u);
|
|
3327
3344
|
}
|
|
3328
3345
|
};
|
|
3329
3346
|
}
|
|
3330
|
-
var
|
|
3347
|
+
var ka = {
|
|
3331
3348
|
j: "next",
|
|
3332
3349
|
arrowdown: "next",
|
|
3333
3350
|
k: "previous",
|
|
@@ -3337,15 +3354,15 @@ var Da = {
|
|
|
3337
3354
|
h: "snooze",
|
|
3338
3355
|
x: "select",
|
|
3339
3356
|
enter: "open"
|
|
3340
|
-
},
|
|
3357
|
+
}, Aa = {
|
|
3341
3358
|
read: "[data-inbox-toggle-read]",
|
|
3342
3359
|
archive: "[data-inbox-toggle-archive]",
|
|
3343
3360
|
snooze: "[data-inbox-snooze]",
|
|
3344
3361
|
select: "[data-inbox-select]",
|
|
3345
3362
|
open: "[data-inbox-link]"
|
|
3346
3363
|
};
|
|
3347
|
-
function
|
|
3348
|
-
let n =
|
|
3364
|
+
function ja(e, t) {
|
|
3365
|
+
let n = ka[e.key.toLowerCase()], r = e.target instanceof HTMLElement ? e.target : null;
|
|
3349
3366
|
if (!n || !r || e.defaultPrevented || e.ctrlKey || e.metaKey || e.altKey || r.closest("input:not([type=\"checkbox\"]), textarea, select, [contenteditable]:not([contenteditable=\"false\"]), [role=\"tab\"]")) return;
|
|
3350
3367
|
let i = [...t.querySelectorAll("[data-inbox-item]")], a = r.closest("[data-inbox-item]"), o = a ? i.indexOf(a) : -1;
|
|
3351
3368
|
if ((n === "open" || e.key.startsWith("Arrow")) && r !== a && r !== t) return;
|
|
@@ -3354,10 +3371,10 @@ function ka(e, t) {
|
|
|
3354
3371
|
t && (e.preventDefault(), t.focus());
|
|
3355
3372
|
return;
|
|
3356
3373
|
}
|
|
3357
|
-
let s = a?.querySelector(
|
|
3374
|
+
let s = a?.querySelector(Aa[n]);
|
|
3358
3375
|
a && s && (e.preventDefault(), s.click());
|
|
3359
3376
|
}
|
|
3360
|
-
function
|
|
3377
|
+
function Ma(e, t = () => e) {
|
|
3361
3378
|
let n, r = (t) => e.querySelector(`[data-inbox-item][data-inbox-id="${CSS.escape(t)}"]`), i = () => Array.from(e.querySelectorAll("[data-inbox-item]"), (e) => e.dataset.inboxId ?? ""), a = () => {
|
|
3362
3379
|
let t = document.activeElement, r = t instanceof HTMLElement && e.contains(t) ? t.closest("[data-inbox-item]")?.dataset.inboxId : void 0;
|
|
3363
3380
|
n = r === void 0 ? void 0 : {
|
|
@@ -3388,17 +3405,17 @@ function Aa(e, t = () => e) {
|
|
|
3388
3405
|
e.removeEventListener("focusin", a), e.removeEventListener("focusout", o), s?.disconnect();
|
|
3389
3406
|
};
|
|
3390
3407
|
}
|
|
3391
|
-
function
|
|
3408
|
+
function Na(e, t, n, r, i = !1) {
|
|
3392
3409
|
let a = t > 0 ? Z(e.bellNew, {
|
|
3393
|
-
count:
|
|
3410
|
+
count: St(t, n, r),
|
|
3394
3411
|
number: t
|
|
3395
3412
|
}) : Z(e.bell);
|
|
3396
3413
|
return i ? Z(e.bellPaused, { label: a }) : a;
|
|
3397
3414
|
}
|
|
3398
|
-
function
|
|
3415
|
+
function Pa(e) {
|
|
3399
3416
|
return e.trim().split(/\s+/).slice(0, 2).map((e) => Array.from(e)[0]?.toLocaleUpperCase() ?? "").join("");
|
|
3400
3417
|
}
|
|
3401
|
-
function
|
|
3418
|
+
function Fa(e, t, n, r = !1) {
|
|
3402
3419
|
let i = n.indexOf(t), a = {
|
|
3403
3420
|
ArrowRight: r ? -1 : 1,
|
|
3404
3421
|
ArrowLeft: r ? 1 : -1
|
|
@@ -3406,24 +3423,24 @@ function Na(e, t, n, r = !1) {
|
|
|
3406
3423
|
return a === void 0 ? e === "Home" ? n[0] : e === "End" ? n.at(-1) : void 0 : n[(i + a + n.length) % n.length];
|
|
3407
3424
|
}
|
|
3408
3425
|
// ../js/overlay.ts
|
|
3409
|
-
var
|
|
3410
|
-
function
|
|
3426
|
+
var Ia = () => typeof HTMLElement < "u" && "showPopover" in HTMLElement.prototype, La = null;
|
|
3427
|
+
function Ra(e) {
|
|
3411
3428
|
let t = null, n = (n) => {
|
|
3412
|
-
n &&
|
|
3429
|
+
n && La !== t ? (La?.hide(), La = t) : !n && La === t && (La = null), e.onOpenChange(n);
|
|
3413
3430
|
}, r = (t) => {
|
|
3414
3431
|
let n = e.tooltip();
|
|
3415
|
-
if (n) return
|
|
3432
|
+
if (n) return f(n), v() ? void 0 : u(n, t ? [{ opacity: 0 }, { opacity: 1 }] : [{ opacity: 1 }, { opacity: 0 }], {
|
|
3416
3433
|
duration: t ? 150 : 75,
|
|
3417
3434
|
easing: t ? "out" : "in"
|
|
3418
3435
|
});
|
|
3419
|
-
}, i = () => t ??=
|
|
3436
|
+
}, i = () => t ??= h({
|
|
3420
3437
|
...e,
|
|
3421
3438
|
onOpenChange: n,
|
|
3422
|
-
onMount: ({ popover: e }) => () =>
|
|
3439
|
+
onMount: ({ popover: e }) => () => f(e),
|
|
3423
3440
|
transition: r
|
|
3424
3441
|
});
|
|
3425
3442
|
return {
|
|
3426
|
-
native:
|
|
3443
|
+
native: Ia(),
|
|
3427
3444
|
onPointerEnter: (e) => {
|
|
3428
3445
|
e.pointerType !== "touch" && i().onMouseEnter();
|
|
3429
3446
|
},
|
|
@@ -3435,31 +3452,31 @@ function Ia(e) {
|
|
|
3435
3452
|
onFocusOut: (e) => t?.onFocusOut(e),
|
|
3436
3453
|
mount: () => t?.mount(),
|
|
3437
3454
|
cleanup: () => {
|
|
3438
|
-
t?.cleanup(),
|
|
3455
|
+
t?.cleanup(), La === t && (La = null);
|
|
3439
3456
|
}
|
|
3440
3457
|
};
|
|
3441
3458
|
}
|
|
3442
3459
|
// src/Tooltip.tsx
|
|
3443
|
-
function
|
|
3444
|
-
let [
|
|
3445
|
-
reference: () =>
|
|
3446
|
-
tooltip: () =>
|
|
3447
|
-
onOpenChange:
|
|
3460
|
+
function za({ text: e, shortcut: t, children: n }) {
|
|
3461
|
+
let [i, s] = o(!1), c = a(null), l = a(null), u = a(null), d = () => u.current ??= Ra({
|
|
3462
|
+
reference: () => c.current,
|
|
3463
|
+
tooltip: () => l.current,
|
|
3464
|
+
onOpenChange: s
|
|
3448
3465
|
});
|
|
3449
|
-
return
|
|
3450
|
-
|
|
3451
|
-
}, [
|
|
3452
|
-
ref:
|
|
3453
|
-
className:
|
|
3454
|
-
onPointerEnter: (e) =>
|
|
3455
|
-
onPointerLeave: () =>
|
|
3456
|
-
onPointerDown: () =>
|
|
3457
|
-
onFocus: (e) =>
|
|
3458
|
-
onBlur: (e) =>
|
|
3459
|
-
children: [n,
|
|
3460
|
-
ref:
|
|
3466
|
+
return r(() => () => u.current?.cleanup(), []), r(() => {
|
|
3467
|
+
i && u.current?.mount();
|
|
3468
|
+
}, [i]), /* @__PURE__ */ O("span", {
|
|
3469
|
+
ref: c,
|
|
3470
|
+
className: hi,
|
|
3471
|
+
onPointerEnter: (e) => d().onPointerEnter(e.nativeEvent),
|
|
3472
|
+
onPointerLeave: () => d().onPointerLeave(),
|
|
3473
|
+
onPointerDown: () => d().onPointerDown(),
|
|
3474
|
+
onFocus: (e) => d().onFocusIn(e.nativeEvent),
|
|
3475
|
+
onBlur: (e) => d().onFocusOut(e.nativeEvent),
|
|
3476
|
+
children: [n, i && /* @__PURE__ */ O("span", {
|
|
3477
|
+
ref: l,
|
|
3461
3478
|
role: "tooltip",
|
|
3462
|
-
popover:
|
|
3479
|
+
popover: Ia() ? "manual" : void 0,
|
|
3463
3480
|
"data-inbox-tooltip": "",
|
|
3464
3481
|
className: "bg-iui-inbox-tooltip text-iui-inbox-tooltip-foreground pointer-events-none m-0 flex w-max max-w-xs items-center gap-1.5 rounded-md px-2 py-1 text-xs font-medium shadow-md",
|
|
3465
3482
|
children: [e, t && /* @__PURE__ */ D("kbd", {
|
|
@@ -3470,17 +3487,17 @@ function La({ text: e, shortcut: t, children: n }) {
|
|
|
3470
3487
|
});
|
|
3471
3488
|
}
|
|
3472
3489
|
// src/InboxHeader.tsx
|
|
3473
|
-
function
|
|
3474
|
-
let T =
|
|
3475
|
-
...
|
|
3476
|
-
category:
|
|
3477
|
-
}), F =
|
|
3478
|
-
filter:
|
|
3479
|
-
allowedActions:
|
|
3480
|
-
}), I =
|
|
3490
|
+
function Ba({ component: e, state: i, filter: s, category: c, items: l, labels: u, icons: d, iconResolver: f, classes: p, locale: h, maxCount: _ = 99, now: v, panel: y, href: b, open: S = !0, renderHeader: C, renderTab: w }) {
|
|
3491
|
+
let T = n(), k = n(), A = (e) => Z(u[e]), j = aa(i), M = [[null, A("allCategories")], ...Object.entries(i.categoryFilter)], N = M.length > 1, P = Ie({
|
|
3492
|
+
...i,
|
|
3493
|
+
category: c
|
|
3494
|
+
}), F = fa({
|
|
3495
|
+
filter: s,
|
|
3496
|
+
allowedActions: i.allowedActions
|
|
3497
|
+
}), I = s === "all" || s === "unread", L = F || i.canPause, R = I || L, z = (t) => ({
|
|
3481
3498
|
component: e,
|
|
3482
3499
|
part: t
|
|
3483
|
-
}), B =
|
|
3500
|
+
}), B = a(null), ee = a(null), [V, te] = o(!1), H = pt(i.pausePresets, u, h), ne = a(null), U = () => ne.current ??= m({
|
|
3484
3501
|
reference: () => B.current,
|
|
3485
3502
|
popover: () => ee.current,
|
|
3486
3503
|
position: {
|
|
@@ -3490,73 +3507,73 @@ function Ra({ component: e, state: n, filter: r, category: i, items: a, labels:
|
|
|
3490
3507
|
menu: !0,
|
|
3491
3508
|
onOpenChange: te
|
|
3492
3509
|
});
|
|
3493
|
-
|
|
3510
|
+
r(() => {
|
|
3494
3511
|
let e = ne.current;
|
|
3495
3512
|
if (V && e) return e.mount(), () => e.cleanup();
|
|
3496
|
-
}, [V]),
|
|
3497
|
-
let re = (e) => void X.pause(
|
|
3513
|
+
}, [V]), t(() => ne.current?.close(!1), [S]);
|
|
3514
|
+
let re = (e) => void X.pause(ft(e.preset)), ie = (e) => {
|
|
3498
3515
|
let t = e.currentTarget.closest("[data-inbox-panel], [data-inbox-list]");
|
|
3499
3516
|
X.resume(), (B.current ?? t)?.focus();
|
|
3500
|
-
}, ae = () =>
|
|
3501
|
-
let t =
|
|
3502
|
-
n !== void 0 &&
|
|
3517
|
+
}, ae = () => da(i, c), oe = () => pa(l, c), se = (e, t) => void X.load(e, t), W = (e) => {
|
|
3518
|
+
let t = g(e.currentTarget), n = Fa(e.key, s, j, t);
|
|
3519
|
+
n !== void 0 && y && (e.preventDefault(), se(n, c), document.getElementById(y.tabId(n))?.focus());
|
|
3503
3520
|
}, ce = (e) => w ? w(e) : /* @__PURE__ */ O(E, { children: [
|
|
3504
3521
|
e.label,
|
|
3505
3522
|
" ",
|
|
3506
3523
|
e.count !== null && e.count > 0 && /* @__PURE__ */ D("span", {
|
|
3507
3524
|
className: "bg-iui-inbox-accent-subtle text-iui-inbox-accent rounded-full px-1.5 text-xs/5 tabular-nums",
|
|
3508
|
-
children:
|
|
3525
|
+
children: St(e.count, _, h)
|
|
3509
3526
|
})
|
|
3510
|
-
] }), le = (e) => j.length > 1 &&
|
|
3527
|
+
] }), le = (e) => j.length > 1 && b && /* @__PURE__ */ D("div", {
|
|
3511
3528
|
className: e,
|
|
3512
|
-
children:
|
|
3513
|
-
...
|
|
3514
|
-
filter:
|
|
3515
|
-
},
|
|
3516
|
-
href:
|
|
3529
|
+
children: ca(j, {
|
|
3530
|
+
...i,
|
|
3531
|
+
filter: s
|
|
3532
|
+
}, u).map((e) => /* @__PURE__ */ D(x, {
|
|
3533
|
+
href: b(e.filter, c),
|
|
3517
3534
|
"aria-current": e.selected ? "page" : void 0,
|
|
3518
3535
|
"data-inbox-tab": e.filter,
|
|
3519
3536
|
className: "text-iui-inbox-muted-foreground hover:text-iui-inbox-foreground focus-visible:ring-iui-inbox-ring aria-selected:border-iui-inbox-accent aria-selected:text-iui-inbox-accent aria-[current=page]:border-iui-inbox-accent aria-[current=page]:text-iui-inbox-accent -mb-px inline-flex items-center gap-1.5 rounded-t-md border-b-2 border-transparent px-1.5 py-2 text-sm font-medium focus-visible:ring-2 focus-visible:outline-hidden focus-visible:ring-inset",
|
|
3520
3537
|
children: ce(e)
|
|
3521
3538
|
}, e.filter))
|
|
3522
|
-
}),
|
|
3539
|
+
}), ue = (e, t) => /* @__PURE__ */ O(E, { children: [
|
|
3523
3540
|
t,
|
|
3524
3541
|
" ",
|
|
3525
|
-
e !== null &&
|
|
3526
|
-
className:
|
|
3527
|
-
children:
|
|
3542
|
+
e !== null && i.categoryCounts[e] ? /* @__PURE__ */ D("span", {
|
|
3543
|
+
className: gi,
|
|
3544
|
+
children: St(i.categoryCounts[e], _, h)
|
|
3528
3545
|
}) : null
|
|
3529
3546
|
] });
|
|
3530
3547
|
return /* @__PURE__ */ O(E, { children: [
|
|
3531
3548
|
C ? C({
|
|
3532
|
-
...
|
|
3533
|
-
titleId:
|
|
3534
|
-
title:
|
|
3535
|
-
close:
|
|
3549
|
+
...y && {
|
|
3550
|
+
titleId: y.titleId,
|
|
3551
|
+
title: y.title,
|
|
3552
|
+
close: y.close
|
|
3536
3553
|
},
|
|
3537
|
-
filter:
|
|
3538
|
-
category:
|
|
3554
|
+
filter: s,
|
|
3555
|
+
category: c,
|
|
3539
3556
|
unread: P,
|
|
3540
3557
|
markAllAsRead: ae,
|
|
3541
3558
|
canArchiveAll: F,
|
|
3542
3559
|
archiveAll: oe,
|
|
3543
|
-
allowedActions:
|
|
3544
|
-
canPause:
|
|
3545
|
-
pausedUntil:
|
|
3560
|
+
allowedActions: i.allowedActions,
|
|
3561
|
+
canPause: i.canPause,
|
|
3562
|
+
pausedUntil: i.pausedUntil,
|
|
3546
3563
|
pauseOptions: H,
|
|
3547
3564
|
pause: re,
|
|
3548
3565
|
resume: () => void X.resume()
|
|
3549
|
-
}) : /* @__PURE__ */ D(E, { children: (
|
|
3550
|
-
className:
|
|
3566
|
+
}) : /* @__PURE__ */ D(E, { children: (y || j.length > 1 || R) && /* @__PURE__ */ O("div", {
|
|
3567
|
+
className: y ? "flex items-center justify-between gap-3 px-4 pt-3 pb-1" : "border-iui-inbox-border flex flex-wrap-reverse items-stretch border-b pe-4",
|
|
3551
3568
|
children: [
|
|
3552
|
-
|
|
3553
|
-
id:
|
|
3569
|
+
y && /* @__PURE__ */ D("h2", {
|
|
3570
|
+
id: y.titleId,
|
|
3554
3571
|
className: "text-base font-semibold",
|
|
3555
|
-
children:
|
|
3572
|
+
children: y.title
|
|
3556
3573
|
}),
|
|
3557
3574
|
le("iui-inbox-fade border-iui-inbox-border -mb-px flex min-w-0 flex-auto gap-1 overflow-x-auto border-b ps-2.5 pe-8 scrollbar-none"),
|
|
3558
3575
|
R && /* @__PURE__ */ O("div", {
|
|
3559
|
-
className:
|
|
3576
|
+
className: y ? "-me-1.5 flex items-center gap-1" : "-me-1.5 flex shrink-0 items-center gap-1 py-2 ps-2.5",
|
|
3560
3577
|
children: [I && /* @__PURE__ */ D("button", {
|
|
3561
3578
|
type: "button",
|
|
3562
3579
|
"data-inbox-read-all": "",
|
|
@@ -3564,7 +3581,7 @@ function Ra({ component: e, state: n, filter: r, category: i, items: a, labels:
|
|
|
3564
3581
|
className: "text-iui-inbox-muted-foreground hover:text-iui-inbox-foreground focus-visible:ring-iui-inbox-ring rounded-md px-1.5 py-1 text-xs font-medium focus-visible:ring-2 focus-visible:outline-hidden aria-disabled:pointer-events-none aria-disabled:opacity-50",
|
|
3565
3582
|
onClick: ae,
|
|
3566
3583
|
children: A("markAllAsRead")
|
|
3567
|
-
}), L && /* @__PURE__ */ O(E, { children: [/* @__PURE__ */ D(
|
|
3584
|
+
}), L && /* @__PURE__ */ O(E, { children: [/* @__PURE__ */ D(za, {
|
|
3568
3585
|
text: A("moreActions"),
|
|
3569
3586
|
children: /* @__PURE__ */ D("button", {
|
|
3570
3587
|
ref: B,
|
|
@@ -3574,7 +3591,7 @@ function Ra({ component: e, state: n, filter: r, category: i, items: a, labels:
|
|
|
3574
3591
|
"aria-label": A("moreActions"),
|
|
3575
3592
|
"aria-expanded": V,
|
|
3576
3593
|
"aria-controls": V ? T : void 0,
|
|
3577
|
-
className: G("text-iui-inbox-icon hover:bg-iui-inbox-control-hover hover:text-iui-inbox-icon-hover focus-visible:ring-iui-inbox-ring rounded-md p-1.5 focus-visible:ring-2 focus-visible:outline-hidden [@media(hover:hover)]:p-1",
|
|
3594
|
+
className: G("text-iui-inbox-icon hover:bg-iui-inbox-control-hover hover:text-iui-inbox-icon-hover focus-visible:ring-iui-inbox-ring rounded-md p-1.5 focus-visible:ring-2 focus-visible:outline-hidden [@media(hover:hover)]:p-1", p.control),
|
|
3578
3595
|
onClick: (e) => U().toggle(e.nativeEvent),
|
|
3579
3596
|
onPointerDown: () => U().onPointerDown(),
|
|
3580
3597
|
onKeyDown: (e) => U().onKeydown(e.nativeEvent),
|
|
@@ -3582,8 +3599,8 @@ function Ra({ component: e, state: n, filter: r, category: i, items: a, labels:
|
|
|
3582
3599
|
children: /* @__PURE__ */ D($, {
|
|
3583
3600
|
name: "more",
|
|
3584
3601
|
context: z("more-actions"),
|
|
3585
|
-
icons:
|
|
3586
|
-
resolver:
|
|
3602
|
+
icons: d,
|
|
3603
|
+
resolver: f,
|
|
3587
3604
|
className: "size-4"
|
|
3588
3605
|
})
|
|
3589
3606
|
})
|
|
@@ -3592,7 +3609,7 @@ function Ra({ component: e, state: n, filter: r, category: i, items: a, labels:
|
|
|
3592
3609
|
ref: ee,
|
|
3593
3610
|
role: "menu",
|
|
3594
3611
|
"aria-label": A("moreActions"),
|
|
3595
|
-
popover:
|
|
3612
|
+
popover: Ia() ? "auto" : void 0,
|
|
3596
3613
|
"data-inbox-menu": "",
|
|
3597
3614
|
className: "border-iui-inbox-border bg-iui-inbox-surface text-iui-inbox-foreground rounded-iui-inbox m-0 w-max min-w-48 border p-1 shadow-lg",
|
|
3598
3615
|
children: [
|
|
@@ -3600,22 +3617,22 @@ function Ra({ component: e, state: n, filter: r, category: i, items: a, labels:
|
|
|
3600
3617
|
type: "button",
|
|
3601
3618
|
role: "menuitem",
|
|
3602
3619
|
"data-inbox-archive-all": "",
|
|
3603
|
-
"aria-disabled":
|
|
3620
|
+
"aria-disabled": l.length === 0 || void 0,
|
|
3604
3621
|
className: "hover:bg-iui-inbox-control-hover focus-visible:bg-iui-inbox-control-hover flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-start text-sm outline-hidden aria-disabled:pointer-events-none aria-disabled:opacity-50",
|
|
3605
3622
|
onClick: oe,
|
|
3606
3623
|
children: [/* @__PURE__ */ D($, {
|
|
3607
3624
|
name: "archive",
|
|
3608
3625
|
context: z("archive-all"),
|
|
3609
|
-
icons:
|
|
3610
|
-
resolver:
|
|
3626
|
+
icons: d,
|
|
3627
|
+
resolver: f,
|
|
3611
3628
|
className: "text-iui-inbox-icon size-4 shrink-0"
|
|
3612
3629
|
}), A("archiveAll")]
|
|
3613
3630
|
}),
|
|
3614
|
-
F &&
|
|
3631
|
+
F && i.canPause && /* @__PURE__ */ D("div", {
|
|
3615
3632
|
role: "separator",
|
|
3616
3633
|
className: "bg-iui-inbox-border -mx-1 my-1 h-px"
|
|
3617
3634
|
}),
|
|
3618
|
-
|
|
3635
|
+
i.canPause && /* @__PURE__ */ O("div", {
|
|
3619
3636
|
role: "group",
|
|
3620
3637
|
"aria-labelledby": k,
|
|
3621
3638
|
children: [/* @__PURE__ */ O("div", {
|
|
@@ -3624,8 +3641,8 @@ function Ra({ component: e, state: n, filter: r, category: i, items: a, labels:
|
|
|
3624
3641
|
children: [/* @__PURE__ */ D($, {
|
|
3625
3642
|
name: "pause",
|
|
3626
3643
|
context: z("pause"),
|
|
3627
|
-
icons:
|
|
3628
|
-
resolver:
|
|
3644
|
+
icons: d,
|
|
3645
|
+
resolver: f,
|
|
3629
3646
|
className: "text-iui-inbox-icon size-4 shrink-0"
|
|
3630
3647
|
}), A("pause")]
|
|
3631
3648
|
}), H.map((e) => /* @__PURE__ */ O("button", {
|
|
@@ -3639,7 +3656,7 @@ function Ra({ component: e, state: n, filter: r, category: i, items: a, labels:
|
|
|
3639
3656
|
" ",
|
|
3640
3657
|
/* @__PURE__ */ D("span", {
|
|
3641
3658
|
className: "text-iui-inbox-muted-foreground ms-auto ps-6 tabular-nums",
|
|
3642
|
-
children:
|
|
3659
|
+
children: _a(e, v, h)
|
|
3643
3660
|
})
|
|
3644
3661
|
]
|
|
3645
3662
|
}, e.label))]
|
|
@@ -3651,20 +3668,20 @@ function Ra({ component: e, state: n, filter: r, category: i, items: a, labels:
|
|
|
3651
3668
|
}) }),
|
|
3652
3669
|
/* @__PURE__ */ D("div", {
|
|
3653
3670
|
"aria-live": "polite",
|
|
3654
|
-
children:
|
|
3671
|
+
children: i.pausedUntil !== null && /* @__PURE__ */ O("p", {
|
|
3655
3672
|
"data-inbox-paused": "",
|
|
3656
3673
|
className: "bg-iui-inbox-control-hover text-iui-inbox-foreground mx-4 mt-1 mb-2 flex shrink-0 items-center gap-2 rounded-md px-3 py-2 text-xs",
|
|
3657
3674
|
children: [
|
|
3658
3675
|
/* @__PURE__ */ D($, {
|
|
3659
3676
|
name: "paused",
|
|
3660
3677
|
context: z("paused"),
|
|
3661
|
-
icons:
|
|
3662
|
-
resolver:
|
|
3678
|
+
icons: d,
|
|
3679
|
+
resolver: f,
|
|
3663
3680
|
className: "text-iui-inbox-icon size-4 shrink-0"
|
|
3664
3681
|
}),
|
|
3665
3682
|
/* @__PURE__ */ D("span", {
|
|
3666
3683
|
className: "min-w-0 flex-1",
|
|
3667
|
-
children:
|
|
3684
|
+
children: ga(u, i.pausedUntil, v, h)
|
|
3668
3685
|
}),
|
|
3669
3686
|
/* @__PURE__ */ D("button", {
|
|
3670
3687
|
type: "button",
|
|
@@ -3677,24 +3694,24 @@ function Ra({ component: e, state: n, filter: r, category: i, items: a, labels:
|
|
|
3677
3694
|
})
|
|
3678
3695
|
}),
|
|
3679
3696
|
C && le("iui-inbox-fade border-iui-inbox-border flex shrink-0 gap-1 overflow-x-auto border-b ps-2.5 pe-8 scrollbar-none"),
|
|
3680
|
-
j.length > 1 && !
|
|
3697
|
+
j.length > 1 && !b && y && /* @__PURE__ */ D("div", {
|
|
3681
3698
|
role: "tablist",
|
|
3682
|
-
"aria-labelledby":
|
|
3699
|
+
"aria-labelledby": y.titleId,
|
|
3683
3700
|
className: "iui-inbox-fade border-iui-inbox-border flex shrink-0 gap-1 overflow-x-auto border-b ps-2.5 pe-8 scrollbar-none",
|
|
3684
3701
|
onKeyDown: W,
|
|
3685
|
-
children:
|
|
3686
|
-
...
|
|
3687
|
-
filter:
|
|
3688
|
-
},
|
|
3689
|
-
id:
|
|
3702
|
+
children: ca(j, {
|
|
3703
|
+
...i,
|
|
3704
|
+
filter: s
|
|
3705
|
+
}, u).map((e) => /* @__PURE__ */ D("button", {
|
|
3706
|
+
id: y.tabId(e.filter),
|
|
3690
3707
|
type: "button",
|
|
3691
3708
|
role: "tab",
|
|
3692
3709
|
"aria-selected": e.selected,
|
|
3693
|
-
"aria-controls":
|
|
3710
|
+
"aria-controls": y.listId,
|
|
3694
3711
|
tabIndex: e.selected ? 0 : -1,
|
|
3695
3712
|
"data-inbox-tab": e.filter,
|
|
3696
3713
|
className: "text-iui-inbox-muted-foreground hover:text-iui-inbox-foreground focus-visible:ring-iui-inbox-ring aria-selected:border-iui-inbox-accent aria-selected:text-iui-inbox-accent aria-[current=page]:border-iui-inbox-accent aria-[current=page]:text-iui-inbox-accent -mb-px inline-flex items-center gap-1.5 rounded-t-md border-b-2 border-transparent px-1.5 py-2 text-sm font-medium focus-visible:ring-2 focus-visible:outline-hidden focus-visible:ring-inset",
|
|
3697
|
-
onClick: () => se(e.filter,
|
|
3714
|
+
onClick: () => se(e.filter, c),
|
|
3698
3715
|
children: ce(e)
|
|
3699
3716
|
}, e.filter))
|
|
3700
3717
|
}),
|
|
@@ -3702,35 +3719,35 @@ function Ra({ component: e, state: n, filter: r, category: i, items: a, labels:
|
|
|
3702
3719
|
role: "group",
|
|
3703
3720
|
"aria-label": A("categories"),
|
|
3704
3721
|
className: "iui-inbox-fade border-iui-inbox-border flex shrink-0 gap-1.5 overflow-x-auto border-b ps-4 pe-8 py-2 scrollbar-none",
|
|
3705
|
-
children: M.map(([e,
|
|
3706
|
-
href:
|
|
3722
|
+
children: M.map(([e, t]) => b ? /* @__PURE__ */ D(x, {
|
|
3723
|
+
href: b(s, e),
|
|
3707
3724
|
"data-inbox-category": e ?? "",
|
|
3708
|
-
"aria-current":
|
|
3725
|
+
"aria-current": c === e ? "page" : void 0,
|
|
3709
3726
|
className: "border-iui-inbox-border text-iui-inbox-muted-foreground hover:bg-iui-inbox-control-hover hover:text-iui-inbox-foreground focus-visible:ring-iui-inbox-ring aria-pressed:border-iui-inbox-accent aria-pressed:bg-iui-inbox-accent-subtle aria-pressed:text-iui-inbox-accent aria-[current=page]:border-iui-inbox-accent aria-[current=page]:bg-iui-inbox-accent-subtle aria-[current=page]:text-iui-inbox-accent inline-flex shrink-0 items-center gap-1 rounded-full border px-2.5 py-1 text-xs font-medium focus-visible:ring-2 focus-visible:outline-hidden",
|
|
3710
|
-
children:
|
|
3727
|
+
children: ue(e, t)
|
|
3711
3728
|
}, e ?? "") : /* @__PURE__ */ D("button", {
|
|
3712
3729
|
type: "button",
|
|
3713
3730
|
"data-inbox-category": e ?? "",
|
|
3714
|
-
"aria-pressed":
|
|
3731
|
+
"aria-pressed": c === e,
|
|
3715
3732
|
className: "border-iui-inbox-border text-iui-inbox-muted-foreground hover:bg-iui-inbox-control-hover hover:text-iui-inbox-foreground focus-visible:ring-iui-inbox-ring aria-pressed:border-iui-inbox-accent aria-pressed:bg-iui-inbox-accent-subtle aria-pressed:text-iui-inbox-accent aria-[current=page]:border-iui-inbox-accent aria-[current=page]:bg-iui-inbox-accent-subtle aria-[current=page]:text-iui-inbox-accent inline-flex shrink-0 items-center gap-1 rounded-full border px-2.5 py-1 text-xs font-medium focus-visible:ring-2 focus-visible:outline-hidden",
|
|
3716
|
-
onClick: () => se(
|
|
3717
|
-
children:
|
|
3733
|
+
onClick: () => se(s, e),
|
|
3734
|
+
children: ue(e, t)
|
|
3718
3735
|
}, e ?? ""))
|
|
3719
3736
|
})
|
|
3720
3737
|
] });
|
|
3721
3738
|
}
|
|
3722
3739
|
// src/NotificationItem.tsx
|
|
3723
|
-
var
|
|
3740
|
+
var Va = [
|
|
3724
3741
|
"snooze",
|
|
3725
3742
|
"archive",
|
|
3726
3743
|
"mute"
|
|
3727
3744
|
];
|
|
3728
|
-
function
|
|
3729
|
-
let g = e.readAt === null, _ = e.archivedAt !== null, v =
|
|
3745
|
+
function Ha({ item: e, now: r, labels: i = Tt(), icons: s = {}, iconResolver: c, classes: l = {}, locale: u, pendingAction: d, snooze: f, allowedActions: p = Va, selected: m = !1, onSelectedChange: h }) {
|
|
3746
|
+
let g = e.readAt === null, _ = e.archivedAt !== null, v = Re(e, r), y = Dt(i, e), b = Et(e), x = (e) => p.includes(e), S = (t) => Z(i.itemControl, {
|
|
3730
3747
|
action: Z(t),
|
|
3731
3748
|
title: e.title
|
|
3732
|
-
}), C = x("snooze"), w =
|
|
3733
|
-
T && !C && k(null),
|
|
3749
|
+
}), C = x("snooze"), w = n(), [T, k] = o(null), A = a(null);
|
|
3750
|
+
T && !C && k(null), t(() => {
|
|
3734
3751
|
T && A.current?.querySelector("button")?.focus();
|
|
3735
3752
|
}, [T]);
|
|
3736
3753
|
let j = () => {
|
|
@@ -3738,40 +3755,40 @@ function Ba({ item: e, now: t, labels: n = wt(), icons: r = {}, iconResolver: i,
|
|
|
3738
3755
|
else if (T) k(null);
|
|
3739
3756
|
else {
|
|
3740
3757
|
let e = /* @__PURE__ */ new Date();
|
|
3741
|
-
k(
|
|
3758
|
+
k(f ? f(e) : lt(i, e));
|
|
3742
3759
|
}
|
|
3743
3760
|
}, M = (t) => ({
|
|
3744
3761
|
component: "NotificationItem",
|
|
3745
3762
|
part: t,
|
|
3746
3763
|
item: e
|
|
3747
|
-
}), N = e.icon ?
|
|
3764
|
+
}), N = e.icon ? ye(e.icon, M("media"), s, c) : void 0, P = new Date(e.createdAt).toLocaleString(u, {
|
|
3748
3765
|
dateStyle: "medium",
|
|
3749
3766
|
timeStyle: "short"
|
|
3750
3767
|
}), F = /* @__PURE__ */ D($, {
|
|
3751
3768
|
name: e.announcement ? "announcement" : "notification",
|
|
3752
3769
|
context: M("media"),
|
|
3753
|
-
icons:
|
|
3754
|
-
resolver:
|
|
3770
|
+
icons: s,
|
|
3771
|
+
resolver: c,
|
|
3755
3772
|
className: "size-5"
|
|
3756
3773
|
});
|
|
3757
3774
|
e.actor?.avatar ? F = /* @__PURE__ */ D("img", {
|
|
3758
3775
|
src: e.actor.avatar,
|
|
3759
3776
|
alt: "",
|
|
3760
3777
|
className: "size-full object-cover"
|
|
3761
|
-
}) : N === void 0 ? e.actor?.name && (F =
|
|
3778
|
+
}) : N === void 0 ? e.actor?.name && (F = Pa(e.actor.name)) : F = Zi(N, "size-5");
|
|
3762
3779
|
let I = h ? "label" : "span";
|
|
3763
3780
|
return /* @__PURE__ */ O("div", {
|
|
3764
3781
|
"data-read": String(!g),
|
|
3765
3782
|
"data-archived": String(_),
|
|
3766
3783
|
"data-selected": h ? String(m) : void 0,
|
|
3767
|
-
className: G(
|
|
3784
|
+
className: G(xi, l.item),
|
|
3768
3785
|
children: [
|
|
3769
3786
|
/* @__PURE__ */ O(I, {
|
|
3770
|
-
className: G(
|
|
3787
|
+
className: G(Si, h && "z-10 cursor-pointer"),
|
|
3771
3788
|
children: [
|
|
3772
3789
|
/* @__PURE__ */ D("span", {
|
|
3773
3790
|
"aria-hidden": "true",
|
|
3774
|
-
className: G(
|
|
3791
|
+
className: G(Ci, l.media),
|
|
3775
3792
|
children: F
|
|
3776
3793
|
}),
|
|
3777
3794
|
h && /* @__PURE__ */ D("span", {
|
|
@@ -3781,7 +3798,7 @@ function Ba({ item: e, now: t, labels: n = wt(), icons: r = {}, iconResolver: i,
|
|
|
3781
3798
|
"data-inbox-select": "",
|
|
3782
3799
|
"aria-keyshortcuts": "X",
|
|
3783
3800
|
checked: m,
|
|
3784
|
-
"aria-label": Z(
|
|
3801
|
+
"aria-label": Z(i.select, { title: e.title }),
|
|
3785
3802
|
className: "accent-iui-inbox-accent size-4 cursor-pointer",
|
|
3786
3803
|
onChange: (e) => h(e.target.checked)
|
|
3787
3804
|
})
|
|
@@ -3796,27 +3813,27 @@ function Ba({ item: e, now: t, labels: n = wt(), icons: r = {}, iconResolver: i,
|
|
|
3796
3813
|
className: "min-w-0 flex-1",
|
|
3797
3814
|
children: [
|
|
3798
3815
|
/* @__PURE__ */ O("p", {
|
|
3799
|
-
className: G(
|
|
3816
|
+
className: G(wi, l.title),
|
|
3800
3817
|
children: [
|
|
3801
3818
|
g && /* @__PURE__ */ O("span", {
|
|
3802
3819
|
className: "sr-only",
|
|
3803
|
-
children: [Z(
|
|
3820
|
+
children: [Z(i.unreadState), ": "]
|
|
3804
3821
|
}),
|
|
3805
3822
|
e.announcement && /* @__PURE__ */ O("span", {
|
|
3806
3823
|
className: "sr-only",
|
|
3807
|
-
children: [Z(
|
|
3824
|
+
children: [Z(i.announcement), ": "]
|
|
3808
3825
|
}),
|
|
3809
3826
|
e.url ? /* @__PURE__ */ D("a", {
|
|
3810
3827
|
"data-inbox-link": "",
|
|
3811
3828
|
href: e.url,
|
|
3812
|
-
className:
|
|
3829
|
+
className: Ti,
|
|
3813
3830
|
onClick: (t) => X.open(e, t.nativeEvent),
|
|
3814
3831
|
children: e.title
|
|
3815
3832
|
}) : e.title
|
|
3816
3833
|
]
|
|
3817
3834
|
}),
|
|
3818
3835
|
e.body && /* @__PURE__ */ D("p", {
|
|
3819
|
-
className: G("text-iui-inbox-muted-foreground mt-0.5 line-clamp-3 text-sm wrap-break-word",
|
|
3836
|
+
className: G("text-iui-inbox-muted-foreground mt-0.5 line-clamp-3 text-sm wrap-break-word", l.body),
|
|
3820
3837
|
children: e.body
|
|
3821
3838
|
}),
|
|
3822
3839
|
e.image && /* @__PURE__ */ D("img", {
|
|
@@ -3826,7 +3843,7 @@ function Ba({ item: e, now: t, labels: n = wt(), icons: r = {}, iconResolver: i,
|
|
|
3826
3843
|
}),
|
|
3827
3844
|
y && /* @__PURE__ */ O("p", {
|
|
3828
3845
|
"data-inbox-actors": "",
|
|
3829
|
-
className: G("text-iui-inbox-muted-foreground mt-1.5 flex items-center gap-1.5 text-xs",
|
|
3846
|
+
className: G("text-iui-inbox-muted-foreground mt-1.5 flex items-center gap-1.5 text-xs", l.actors),
|
|
3830
3847
|
children: [/* @__PURE__ */ D("span", {
|
|
3831
3848
|
"aria-hidden": "true",
|
|
3832
3849
|
className: "isolate flex",
|
|
@@ -3837,79 +3854,79 @@ function Ba({ item: e, now: t, labels: n = wt(), icons: r = {}, iconResolver: i,
|
|
|
3837
3854
|
src: e.avatar,
|
|
3838
3855
|
alt: "",
|
|
3839
3856
|
className: "size-full object-cover"
|
|
3840
|
-
}) : e.name &&
|
|
3857
|
+
}) : e.name && Pa(e.name)
|
|
3841
3858
|
}, t))
|
|
3842
3859
|
}), y]
|
|
3843
3860
|
}),
|
|
3844
3861
|
v && e.snoozedUntil ? /* @__PURE__ */ O("p", {
|
|
3845
3862
|
"data-inbox-snoozed-until": "",
|
|
3846
3863
|
suppressHydrationWarning: !0,
|
|
3847
|
-
className: G(
|
|
3864
|
+
className: G(Di, l.time),
|
|
3848
3865
|
children: [/* @__PURE__ */ D($, {
|
|
3849
3866
|
name: "snooze",
|
|
3850
3867
|
context: M("snoozed-until"),
|
|
3851
|
-
icons:
|
|
3852
|
-
resolver:
|
|
3868
|
+
icons: s,
|
|
3869
|
+
resolver: c,
|
|
3853
3870
|
className: "size-3.5"
|
|
3854
|
-
}), Z(
|
|
3871
|
+
}), Z(i.snoozedUntil, { time: ut(e.snoozedUntil, r, u) })]
|
|
3855
3872
|
}) : /* @__PURE__ */ D("time", {
|
|
3856
3873
|
dateTime: e.createdAt,
|
|
3857
3874
|
title: P,
|
|
3858
3875
|
suppressHydrationWarning: !0,
|
|
3859
|
-
className: G(
|
|
3860
|
-
children:
|
|
3876
|
+
className: G(Ei, l.time),
|
|
3877
|
+
children: xt(e.createdAt, r, u)
|
|
3861
3878
|
}),
|
|
3862
3879
|
e.muted && /* @__PURE__ */ O("p", {
|
|
3863
3880
|
"data-inbox-muted": "",
|
|
3864
|
-
className: G("text-iui-inbox-muted-foreground mt-1 flex items-center gap-1 text-xs",
|
|
3881
|
+
className: G("text-iui-inbox-muted-foreground mt-1 flex items-center gap-1 text-xs", l.time),
|
|
3865
3882
|
children: [/* @__PURE__ */ D($, {
|
|
3866
3883
|
name: "mute",
|
|
3867
3884
|
context: M("muted"),
|
|
3868
|
-
icons:
|
|
3869
|
-
resolver:
|
|
3885
|
+
icons: s,
|
|
3886
|
+
resolver: c,
|
|
3870
3887
|
className: "size-3.5"
|
|
3871
|
-
}), Z(
|
|
3888
|
+
}), Z(i.muted)]
|
|
3872
3889
|
}),
|
|
3873
3890
|
e.result !== null && /* @__PURE__ */ O("p", {
|
|
3874
3891
|
"data-inbox-result": "",
|
|
3875
|
-
className: G("text-iui-inbox-muted-foreground mt-2 flex items-center gap-1.5 text-xs font-medium",
|
|
3892
|
+
className: G("text-iui-inbox-muted-foreground mt-2 flex items-center gap-1.5 text-xs font-medium", l.result),
|
|
3876
3893
|
children: [/* @__PURE__ */ D($, {
|
|
3877
3894
|
name: "result",
|
|
3878
3895
|
context: M("result"),
|
|
3879
|
-
icons:
|
|
3880
|
-
resolver:
|
|
3896
|
+
icons: s,
|
|
3897
|
+
resolver: c,
|
|
3881
3898
|
className: "size-3.5"
|
|
3882
3899
|
}), e.result]
|
|
3883
3900
|
}),
|
|
3884
3901
|
e.result === null && e.actions.length > 0 && /* @__PURE__ */ D("div", {
|
|
3885
3902
|
className: "relative z-10 mt-2 flex flex-wrap gap-2",
|
|
3886
3903
|
children: e.actions.map((t, n) => {
|
|
3887
|
-
let
|
|
3888
|
-
"aria-disabled":
|
|
3889
|
-
"aria-busy":
|
|
3904
|
+
let r = H(t), i = {
|
|
3905
|
+
"aria-disabled": d !== void 0 || void 0,
|
|
3906
|
+
"aria-busy": d === n || void 0,
|
|
3890
3907
|
"data-inbox-action": String(n),
|
|
3891
|
-
className: G(n === 0 ? "rounded-md focus-visible:ring-iui-inbox-ring inline-flex items-center gap-1.5 px-2.5 py-1.5 text-xs font-medium focus-visible:ring-2 focus-visible:outline-hidden aria-disabled:cursor-default aria-disabled:opacity-60 border-iui-inbox-accent text-iui-inbox-accent hover:bg-iui-inbox-accent-subtle border" : "rounded-md focus-visible:ring-iui-inbox-ring inline-flex items-center gap-1.5 px-2.5 py-1.5 text-xs font-medium focus-visible:ring-2 focus-visible:outline-hidden aria-disabled:cursor-default aria-disabled:opacity-60 border-iui-inbox-border bg-iui-inbox-surface hover:bg-iui-inbox-control-hover border",
|
|
3908
|
+
className: G(n === 0 ? "rounded-md focus-visible:ring-iui-inbox-ring inline-flex items-center gap-1.5 px-2.5 py-1.5 text-xs font-medium focus-visible:ring-2 focus-visible:outline-hidden aria-disabled:cursor-default aria-disabled:opacity-60 border-iui-inbox-accent text-iui-inbox-accent hover:bg-iui-inbox-accent-subtle border" : "rounded-md focus-visible:ring-iui-inbox-ring inline-flex items-center gap-1.5 px-2.5 py-1.5 text-xs font-medium focus-visible:ring-2 focus-visible:outline-hidden aria-disabled:cursor-default aria-disabled:opacity-60 border-iui-inbox-border bg-iui-inbox-surface hover:bg-iui-inbox-control-hover border", l.action),
|
|
3892
3909
|
onClick: (t) => X.runAction(e, n, t.nativeEvent)
|
|
3893
|
-
},
|
|
3910
|
+
}, a = /* @__PURE__ */ O(E, { children: [d === n && /* @__PURE__ */ D($, {
|
|
3894
3911
|
name: "spinner",
|
|
3895
3912
|
context: {
|
|
3896
3913
|
...M("action"),
|
|
3897
3914
|
action: t
|
|
3898
3915
|
},
|
|
3899
|
-
icons:
|
|
3900
|
-
resolver:
|
|
3916
|
+
icons: s,
|
|
3917
|
+
resolver: c,
|
|
3901
3918
|
className: "size-3.5 motion-safe:animate-spin"
|
|
3902
3919
|
}), t.label] });
|
|
3903
|
-
return
|
|
3920
|
+
return r === void 0 ? /* @__PURE__ */ D("button", {
|
|
3904
3921
|
type: "button",
|
|
3905
|
-
...
|
|
3906
|
-
children:
|
|
3922
|
+
...i,
|
|
3923
|
+
children: a
|
|
3907
3924
|
}, n) : /* @__PURE__ */ D("a", {
|
|
3908
|
-
href:
|
|
3925
|
+
href: r,
|
|
3909
3926
|
target: t.newTab ? "_blank" : void 0,
|
|
3910
3927
|
rel: t.newTab ? "noopener noreferrer" : void 0,
|
|
3911
|
-
...
|
|
3912
|
-
children:
|
|
3928
|
+
...i,
|
|
3929
|
+
children: a
|
|
3913
3930
|
}, n);
|
|
3914
3931
|
})
|
|
3915
3932
|
}),
|
|
@@ -3917,120 +3934,120 @@ function Ba({ item: e, now: t, labels: n = wt(), icons: r = {}, iconResolver: i,
|
|
|
3917
3934
|
id: w,
|
|
3918
3935
|
ref: A,
|
|
3919
3936
|
role: "group",
|
|
3920
|
-
"aria-label": Z(
|
|
3937
|
+
"aria-label": Z(i.snoozeUntil),
|
|
3921
3938
|
"data-inbox-snooze-options": "",
|
|
3922
3939
|
className: "relative z-10 mt-2 flex flex-wrap gap-2",
|
|
3923
|
-
children: T.map((
|
|
3940
|
+
children: T.map((t) => /* @__PURE__ */ O("button", {
|
|
3924
3941
|
type: "button",
|
|
3925
3942
|
"data-inbox-snooze-option": "",
|
|
3926
|
-
className: G("rounded-md focus-visible:ring-iui-inbox-ring inline-flex items-center gap-1.5 px-2.5 py-1.5 text-xs font-medium focus-visible:ring-2 focus-visible:outline-hidden aria-disabled:cursor-default aria-disabled:opacity-60 border-iui-inbox-border bg-iui-inbox-surface hover:bg-iui-inbox-control-hover border",
|
|
3943
|
+
className: G("rounded-md focus-visible:ring-iui-inbox-ring inline-flex items-center gap-1.5 px-2.5 py-1.5 text-xs font-medium focus-visible:ring-2 focus-visible:outline-hidden aria-disabled:cursor-default aria-disabled:opacity-60 border-iui-inbox-border bg-iui-inbox-surface hover:bg-iui-inbox-control-hover border", l.action),
|
|
3927
3944
|
onClick: () => {
|
|
3928
|
-
k(null), X.snooze(e,
|
|
3945
|
+
k(null), X.snooze(e, t.until);
|
|
3929
3946
|
},
|
|
3930
3947
|
children: [
|
|
3931
|
-
|
|
3948
|
+
t.label,
|
|
3932
3949
|
" ",
|
|
3933
3950
|
/* @__PURE__ */ D("span", {
|
|
3934
3951
|
className: "text-iui-inbox-muted-foreground font-normal",
|
|
3935
|
-
children:
|
|
3952
|
+
children: ut(t.until, r, u)
|
|
3936
3953
|
})
|
|
3937
3954
|
]
|
|
3938
|
-
},
|
|
3955
|
+
}, t.label))
|
|
3939
3956
|
})
|
|
3940
3957
|
]
|
|
3941
3958
|
}),
|
|
3942
3959
|
/* @__PURE__ */ O("div", {
|
|
3943
|
-
className:
|
|
3960
|
+
className: Ai,
|
|
3944
3961
|
children: [
|
|
3945
|
-
/* @__PURE__ */ D(
|
|
3946
|
-
text: Z(g ?
|
|
3962
|
+
/* @__PURE__ */ D(za, {
|
|
3963
|
+
text: Z(g ? i.markAsRead : i.markAsUnread),
|
|
3947
3964
|
shortcut: "U",
|
|
3948
3965
|
children: /* @__PURE__ */ D("button", {
|
|
3949
3966
|
type: "button",
|
|
3950
3967
|
"data-inbox-toggle-read": "",
|
|
3951
3968
|
"aria-keyshortcuts": "U",
|
|
3952
|
-
"aria-label": S(g ?
|
|
3953
|
-
className: G(
|
|
3969
|
+
"aria-label": S(g ? i.markAsRead : i.markAsUnread),
|
|
3970
|
+
className: G(Pi, l.control),
|
|
3954
3971
|
onClick: () => void (g ? X.markAsRead(e) : X.markAsUnread(e)),
|
|
3955
3972
|
children: /* @__PURE__ */ D($, {
|
|
3956
3973
|
name: g ? "read" : "unread",
|
|
3957
3974
|
context: M("toggle-read"),
|
|
3958
|
-
icons:
|
|
3959
|
-
resolver:
|
|
3975
|
+
icons: s,
|
|
3976
|
+
resolver: c,
|
|
3960
3977
|
className: "size-4"
|
|
3961
3978
|
})
|
|
3962
3979
|
})
|
|
3963
3980
|
}),
|
|
3964
|
-
C && !_ && /* @__PURE__ */ D(
|
|
3965
|
-
text: Z(v ?
|
|
3981
|
+
C && !_ && /* @__PURE__ */ D(za, {
|
|
3982
|
+
text: Z(v ? i.unsnooze : i.snooze),
|
|
3966
3983
|
shortcut: "H",
|
|
3967
3984
|
children: /* @__PURE__ */ D("button", {
|
|
3968
3985
|
type: "button",
|
|
3969
3986
|
"data-inbox-snooze": "",
|
|
3970
3987
|
"aria-keyshortcuts": "H",
|
|
3971
|
-
"aria-label": S(v ?
|
|
3988
|
+
"aria-label": S(v ? i.unsnooze : i.snooze),
|
|
3972
3989
|
"aria-expanded": v ? void 0 : T !== null,
|
|
3973
3990
|
"aria-controls": v || !T ? void 0 : w,
|
|
3974
|
-
className: G("text-iui-inbox-icon hover:bg-iui-inbox-control-hover hover:text-iui-inbox-icon-hover focus-visible:ring-iui-inbox-ring rounded-md p-1.5 focus-visible:ring-2 focus-visible:outline-hidden [@media(hover:hover)]:p-1",
|
|
3991
|
+
className: G("text-iui-inbox-icon hover:bg-iui-inbox-control-hover hover:text-iui-inbox-icon-hover focus-visible:ring-iui-inbox-ring rounded-md p-1.5 focus-visible:ring-2 focus-visible:outline-hidden [@media(hover:hover)]:p-1", l.control),
|
|
3975
3992
|
onClick: j,
|
|
3976
3993
|
children: /* @__PURE__ */ D($, {
|
|
3977
3994
|
name: v ? "unsnooze" : "snooze",
|
|
3978
3995
|
context: M("snooze"),
|
|
3979
|
-
icons:
|
|
3980
|
-
resolver:
|
|
3996
|
+
icons: s,
|
|
3997
|
+
resolver: c,
|
|
3981
3998
|
className: "size-4"
|
|
3982
3999
|
})
|
|
3983
4000
|
})
|
|
3984
4001
|
}),
|
|
3985
|
-
e.group !== null && x("mute") && /* @__PURE__ */ D(
|
|
3986
|
-
text: Z(e.muted ?
|
|
4002
|
+
e.group !== null && x("mute") && /* @__PURE__ */ D(za, {
|
|
4003
|
+
text: Z(e.muted ? i.unmute : i.mute),
|
|
3987
4004
|
children: /* @__PURE__ */ D("button", {
|
|
3988
4005
|
type: "button",
|
|
3989
4006
|
"data-inbox-mute": "",
|
|
3990
|
-
"aria-label": S(e.muted ?
|
|
3991
|
-
className: G("text-iui-inbox-icon hover:bg-iui-inbox-control-hover hover:text-iui-inbox-icon-hover focus-visible:ring-iui-inbox-ring rounded-md p-1.5 focus-visible:ring-2 focus-visible:outline-hidden [@media(hover:hover)]:p-1",
|
|
4007
|
+
"aria-label": S(e.muted ? i.unmute : i.mute),
|
|
4008
|
+
className: G("text-iui-inbox-icon hover:bg-iui-inbox-control-hover hover:text-iui-inbox-icon-hover focus-visible:ring-iui-inbox-ring rounded-md p-1.5 focus-visible:ring-2 focus-visible:outline-hidden [@media(hover:hover)]:p-1", l.control),
|
|
3992
4009
|
onClick: () => void (e.muted ? X.unmute(e) : X.mute(e)),
|
|
3993
4010
|
children: /* @__PURE__ */ D($, {
|
|
3994
4011
|
name: e.muted ? "unmute" : "mute",
|
|
3995
4012
|
context: M("mute"),
|
|
3996
|
-
icons:
|
|
3997
|
-
resolver:
|
|
4013
|
+
icons: s,
|
|
4014
|
+
resolver: c,
|
|
3998
4015
|
className: "size-4"
|
|
3999
4016
|
})
|
|
4000
4017
|
})
|
|
4001
4018
|
}),
|
|
4002
|
-
x("archive") && /* @__PURE__ */ D(
|
|
4003
|
-
text: Z(_ ?
|
|
4019
|
+
x("archive") && /* @__PURE__ */ D(za, {
|
|
4020
|
+
text: Z(_ ? i.unarchive : i.archive),
|
|
4004
4021
|
shortcut: "E",
|
|
4005
4022
|
children: /* @__PURE__ */ D("button", {
|
|
4006
4023
|
type: "button",
|
|
4007
4024
|
"data-inbox-toggle-archive": "",
|
|
4008
4025
|
"aria-keyshortcuts": "E",
|
|
4009
|
-
"aria-label": S(_ ?
|
|
4010
|
-
className: G("text-iui-inbox-icon hover:bg-iui-inbox-control-hover hover:text-iui-inbox-icon-hover focus-visible:ring-iui-inbox-ring rounded-md p-1.5 focus-visible:ring-2 focus-visible:outline-hidden [@media(hover:hover)]:p-1",
|
|
4026
|
+
"aria-label": S(_ ? i.unarchive : i.archive),
|
|
4027
|
+
className: G("text-iui-inbox-icon hover:bg-iui-inbox-control-hover hover:text-iui-inbox-icon-hover focus-visible:ring-iui-inbox-ring rounded-md p-1.5 focus-visible:ring-2 focus-visible:outline-hidden [@media(hover:hover)]:p-1", l.control),
|
|
4011
4028
|
onClick: () => void (_ ? X.unarchive(e) : X.archive(e)),
|
|
4012
4029
|
children: /* @__PURE__ */ D($, {
|
|
4013
4030
|
name: _ ? "unarchive" : "archive",
|
|
4014
4031
|
context: M("archive"),
|
|
4015
|
-
icons:
|
|
4016
|
-
resolver:
|
|
4032
|
+
icons: s,
|
|
4033
|
+
resolver: c,
|
|
4017
4034
|
className: "size-4"
|
|
4018
4035
|
})
|
|
4019
4036
|
})
|
|
4020
4037
|
}),
|
|
4021
|
-
x("delete") && /* @__PURE__ */ D(
|
|
4022
|
-
text: Z(
|
|
4038
|
+
x("delete") && /* @__PURE__ */ D(za, {
|
|
4039
|
+
text: Z(i.delete),
|
|
4023
4040
|
children: /* @__PURE__ */ D("button", {
|
|
4024
4041
|
type: "button",
|
|
4025
4042
|
"data-inbox-delete": "",
|
|
4026
|
-
"aria-label": S(
|
|
4027
|
-
className: G("text-iui-inbox-icon hover:bg-iui-inbox-control-hover hover:text-iui-inbox-icon-hover focus-visible:ring-iui-inbox-ring rounded-md p-1.5 focus-visible:ring-2 focus-visible:outline-hidden [@media(hover:hover)]:p-1",
|
|
4043
|
+
"aria-label": S(i.delete),
|
|
4044
|
+
className: G("text-iui-inbox-icon hover:bg-iui-inbox-control-hover hover:text-iui-inbox-icon-hover focus-visible:ring-iui-inbox-ring rounded-md p-1.5 focus-visible:ring-2 focus-visible:outline-hidden [@media(hover:hover)]:p-1", l.control),
|
|
4028
4045
|
onClick: () => void X.delete(e),
|
|
4029
4046
|
children: /* @__PURE__ */ D($, {
|
|
4030
4047
|
name: "delete",
|
|
4031
4048
|
context: M("delete"),
|
|
4032
|
-
icons:
|
|
4033
|
-
resolver:
|
|
4049
|
+
icons: s,
|
|
4050
|
+
resolver: c,
|
|
4034
4051
|
className: "size-4"
|
|
4035
4052
|
})
|
|
4036
4053
|
})
|
|
@@ -4041,22 +4058,22 @@ function Ba({ item: e, now: t, labels: n = wt(), icons: r = {}, iconResolver: i,
|
|
|
4041
4058
|
});
|
|
4042
4059
|
}
|
|
4043
4060
|
// src/ItemGroup.tsx
|
|
4044
|
-
function
|
|
4045
|
-
let [h, g] =
|
|
4061
|
+
function Ua({ group: e, now: t, labels: r, icons: i, iconResolver: a, classes: s, locale: c, pendingActions: l, snooze: u, allowedActions: d, selected: f, select: p, renderItem: m }) {
|
|
4062
|
+
let [h, g] = o(!1), _ = n();
|
|
4046
4063
|
h && e.others.length === 0 && g(!1);
|
|
4047
|
-
let v = (e,
|
|
4048
|
-
let
|
|
4064
|
+
let v = (e, n) => {
|
|
4065
|
+
let o = {
|
|
4049
4066
|
item: e,
|
|
4050
4067
|
now: t,
|
|
4051
|
-
labels:
|
|
4052
|
-
icons:
|
|
4053
|
-
iconResolver:
|
|
4054
|
-
classes:
|
|
4055
|
-
locale:
|
|
4056
|
-
pendingAction:
|
|
4057
|
-
snooze:
|
|
4058
|
-
allowedActions:
|
|
4059
|
-
selected:
|
|
4068
|
+
labels: r,
|
|
4069
|
+
icons: i,
|
|
4070
|
+
iconResolver: a,
|
|
4071
|
+
classes: s,
|
|
4072
|
+
locale: c,
|
|
4073
|
+
pendingAction: l[e.id],
|
|
4074
|
+
snooze: u,
|
|
4075
|
+
allowedActions: d,
|
|
4076
|
+
selected: f?.includes(e.id) ?? !1,
|
|
4060
4077
|
onSelectedChange: p ? (t) => p(e.id, t) : void 0
|
|
4061
4078
|
};
|
|
4062
4079
|
return /* @__PURE__ */ O("li", {
|
|
@@ -4067,8 +4084,8 @@ function Va({ group: e, now: t, labels: n, icons: r, iconResolver: i, classes: a
|
|
|
4067
4084
|
"data-seen": String(e.seenAt !== null),
|
|
4068
4085
|
"data-archived": String(e.archivedAt !== null),
|
|
4069
4086
|
"data-announcement": e.announcement ? "true" : void 0,
|
|
4070
|
-
className:
|
|
4071
|
-
children: [m ? m(e, t,
|
|
4087
|
+
className: bi,
|
|
4088
|
+
children: [m ? m(e, t, o) : /* @__PURE__ */ D(Ha, { ...o }), n]
|
|
4072
4089
|
}, e.id);
|
|
4073
4090
|
};
|
|
4074
4091
|
return v(e.item, e.others.length > 0 && /* @__PURE__ */ O(E, { children: [/* @__PURE__ */ D("button", {
|
|
@@ -4078,7 +4095,7 @@ function Va({ group: e, now: t, labels: n, icons: r, iconResolver: i, classes: a
|
|
|
4078
4095
|
"aria-controls": h ? _ : void 0,
|
|
4079
4096
|
className: "text-iui-inbox-muted-foreground hover:text-iui-inbox-foreground focus-visible:ring-iui-inbox-ring ms-15 -mt-2 mb-2.5 rounded-md px-1 py-0.5 text-xs font-medium focus-visible:ring-2 focus-visible:outline-hidden",
|
|
4080
4097
|
onClick: () => g(!h),
|
|
4081
|
-
children: h ? Z(
|
|
4098
|
+
children: h ? Z(r.showLess) : Z(r.showMore, { count: e.others.length })
|
|
4082
4099
|
}), h && /* @__PURE__ */ D("ul", {
|
|
4083
4100
|
id: _,
|
|
4084
4101
|
role: "list",
|
|
@@ -4087,21 +4104,21 @@ function Va({ group: e, now: t, labels: n, icons: r, iconResolver: i, classes: a
|
|
|
4087
4104
|
})] }));
|
|
4088
4105
|
}
|
|
4089
4106
|
// src/SelectionBar.tsx
|
|
4090
|
-
function
|
|
4091
|
-
let _ =
|
|
4092
|
-
S !== null && y.length === 0 && C(null),
|
|
4107
|
+
function Wa({ component: e, items: r, selected: i, onSelectedChange: s, filter: c, allowedActions: l, now: u, labels: d, icons: f, iconResolver: p, classes: m, locale: h, snooze: g }) {
|
|
4108
|
+
let _ = n(), v = (e) => Z(d[e]), y = r.filter((e) => i.includes(e.id)), b = y.length === r.length, x = a(null), [S, C] = o(null);
|
|
4109
|
+
S !== null && y.length === 0 && C(null), t(() => {
|
|
4093
4110
|
S && x.current?.querySelector("button")?.focus();
|
|
4094
4111
|
}, [S]);
|
|
4095
4112
|
let w = (e, t) => {
|
|
4096
|
-
|
|
4113
|
+
s([]), X.batch(e, y, t);
|
|
4097
4114
|
};
|
|
4098
4115
|
return y.length === 0 ? null : /* @__PURE__ */ O(E, { children: [/* @__PURE__ */ O("div", {
|
|
4099
4116
|
role: "group",
|
|
4100
4117
|
"aria-label": v("selection"),
|
|
4101
4118
|
"data-inbox-selection": "",
|
|
4102
|
-
className:
|
|
4119
|
+
className: ji,
|
|
4103
4120
|
children: [/* @__PURE__ */ O("div", {
|
|
4104
|
-
className:
|
|
4121
|
+
className: Mi,
|
|
4105
4122
|
children: [/* @__PURE__ */ D("input", {
|
|
4106
4123
|
type: "checkbox",
|
|
4107
4124
|
"data-inbox-select-all": "",
|
|
@@ -4110,23 +4127,23 @@ function Ha({ component: e, items: t, selected: n, onSelectedChange: r, filter:
|
|
|
4110
4127
|
},
|
|
4111
4128
|
checked: b,
|
|
4112
4129
|
"aria-label": v("selectAll"),
|
|
4113
|
-
className:
|
|
4114
|
-
onChange: () =>
|
|
4130
|
+
className: Ni,
|
|
4131
|
+
onChange: () => s(b ? [] : r.map((e) => e.id))
|
|
4115
4132
|
}), /* @__PURE__ */ D("span", {
|
|
4116
4133
|
"aria-live": "polite",
|
|
4117
|
-
children: Z(
|
|
4134
|
+
children: Z(d.selected, { count: y.length })
|
|
4118
4135
|
})]
|
|
4119
4136
|
}), /* @__PURE__ */ O("div", {
|
|
4120
|
-
className:
|
|
4121
|
-
children: [
|
|
4137
|
+
className: mi,
|
|
4138
|
+
children: [va(c, l).map((t) => /* @__PURE__ */ D("button", {
|
|
4122
4139
|
type: "button",
|
|
4123
4140
|
"data-inbox-batch": t.action,
|
|
4124
4141
|
"aria-label": v(t.label),
|
|
4125
4142
|
title: v(t.label),
|
|
4126
4143
|
"aria-expanded": t.action === "snooze" ? S !== null : void 0,
|
|
4127
4144
|
"aria-controls": t.action === "snooze" && S ? _ : void 0,
|
|
4128
|
-
className: G(
|
|
4129
|
-
onClick: () => t.action === "snooze" ? C(S ? null :
|
|
4145
|
+
className: G(Pi, m.control),
|
|
4146
|
+
onClick: () => t.action === "snooze" ? C(S ? null : ya(g, d)) : w(t.action),
|
|
4130
4147
|
children: /* @__PURE__ */ D($, {
|
|
4131
4148
|
name: t.icon,
|
|
4132
4149
|
context: {
|
|
@@ -4134,7 +4151,7 @@ function Ha({ component: e, items: t, selected: n, onSelectedChange: r, filter:
|
|
|
4134
4151
|
part: "selection",
|
|
4135
4152
|
action: t.action
|
|
4136
4153
|
},
|
|
4137
|
-
icons:
|
|
4154
|
+
icons: f,
|
|
4138
4155
|
resolver: p,
|
|
4139
4156
|
className: "size-4"
|
|
4140
4157
|
})
|
|
@@ -4143,15 +4160,15 @@ function Ha({ component: e, items: t, selected: n, onSelectedChange: r, filter:
|
|
|
4143
4160
|
"data-inbox-clear-selection": "",
|
|
4144
4161
|
"aria-label": v("clearSelection"),
|
|
4145
4162
|
title: v("clearSelection"),
|
|
4146
|
-
className: G(
|
|
4147
|
-
onClick: () =>
|
|
4163
|
+
className: G(Pi, m.control),
|
|
4164
|
+
onClick: () => s([]),
|
|
4148
4165
|
children: /* @__PURE__ */ D($, {
|
|
4149
4166
|
name: "dismiss",
|
|
4150
4167
|
context: {
|
|
4151
4168
|
component: e,
|
|
4152
4169
|
part: "clear-selection"
|
|
4153
4170
|
},
|
|
4154
|
-
icons:
|
|
4171
|
+
icons: f,
|
|
4155
4172
|
resolver: p,
|
|
4156
4173
|
className: "size-4"
|
|
4157
4174
|
})
|
|
@@ -4176,29 +4193,29 @@ function Ha({ component: e, items: t, selected: n, onSelectedChange: r, filter:
|
|
|
4176
4193
|
" ",
|
|
4177
4194
|
/* @__PURE__ */ D("span", {
|
|
4178
4195
|
className: "text-iui-inbox-muted-foreground font-normal",
|
|
4179
|
-
children:
|
|
4196
|
+
children: ut(e.until, u, h)
|
|
4180
4197
|
})
|
|
4181
4198
|
]
|
|
4182
4199
|
}, e.label))
|
|
4183
4200
|
})] });
|
|
4184
4201
|
}
|
|
4185
4202
|
// src/NotificationCenter.tsx
|
|
4186
|
-
var
|
|
4187
|
-
function
|
|
4188
|
-
let { props: I } =
|
|
4203
|
+
var Ga = () => () => {};
|
|
4204
|
+
function Ka({ labels: e, badge: t = "count", count: i = "unseen", maxCount: c = 99, href: l, icons: u = {}, iconResolver: d, classes: f = {}, locale: p, renderItem: m, renderEmpty: h, group: g = !0, snooze: _, placement: v = "bottom-end", open: y, onOpenChange: b, onItemClick: S, onAction: w, renderTrigger: k, renderBadge: A, renderHeader: j, renderTab: M, renderLoading: N, renderError: P, renderFooter: F }) {
|
|
4205
|
+
let { props: I } = T(), L = n(), R = {
|
|
4189
4206
|
panel: `${L}-panel`,
|
|
4190
4207
|
title: `${L}-title`,
|
|
4191
4208
|
list: `${L}-list`,
|
|
4192
4209
|
tab: (e) => `${L}-tab-${e}`
|
|
4193
|
-
}, z =
|
|
4194
|
-
|
|
4195
|
-
|
|
4196
|
-
let e, t = !1, n =
|
|
4210
|
+
}, z = s(X.subscribe, X.getSnapshot, X.getServerSnapshot), [B, ee] = o(!1), [V] = o(Date.now), te = s(B ? bt.subscribe : Ga, bt.getSnapshot, () => V), H = Tt(e), ne = (e) => Z(H[e]), U = z.counts[i], re = sa(z.filter, H), ie = aa(z), ae = z.categoryFilter, [oe, se] = o([]), W = la(z.items, oe), ce = ct(W, g), le = ie.length > 1, ue = a(null), K = a(null), de = a(null), q = a(null), fe = a(null), pe = a(null), me = a(ie), he = a(ae), ge = a(v), J = a(b);
|
|
4211
|
+
r(() => {
|
|
4212
|
+
qi(), _t(I);
|
|
4213
|
+
let e, t = !1, n = Ma(K.current), r = xa(q.current, se, {
|
|
4197
4214
|
scroller: q.current,
|
|
4198
4215
|
listed: (e) => X.getSnapshot().items.some((t) => t.id === e)
|
|
4199
4216
|
});
|
|
4200
|
-
fe.current =
|
|
4201
|
-
let
|
|
4217
|
+
fe.current = r;
|
|
4218
|
+
let i = wa(q.current, () => X.getSnapshot().items), a = Oa(ue.current, K.current, {
|
|
4202
4219
|
onToggle(n) {
|
|
4203
4220
|
ee(n), t = n, J.current?.(n), n ? (e = window.location.href, X.opened(me.current, {
|
|
4204
4221
|
markAllAsSeen: !1,
|
|
@@ -4208,50 +4225,50 @@ function Wa({ labels: e, badge: n = "count", count: i = "unseen", maxCount: o =
|
|
|
4208
4225
|
onEndReached: () => void X.loadMore(),
|
|
4209
4226
|
placement: () => ge.current
|
|
4210
4227
|
});
|
|
4211
|
-
pe.current =
|
|
4212
|
-
let
|
|
4213
|
-
window.location.href !== e &&
|
|
4228
|
+
pe.current = a;
|
|
4229
|
+
let o = C.on("navigate", () => {
|
|
4230
|
+
window.location.href !== e && a.close();
|
|
4214
4231
|
});
|
|
4215
4232
|
return () => {
|
|
4216
|
-
t && X.closed({ markAllAsSeen: !1 }),
|
|
4233
|
+
t && X.closed({ markAllAsSeen: !1 }), o(), n(), r.destroy(), i.destroy(), a.destroy(), pe.current = null;
|
|
4217
4234
|
};
|
|
4218
|
-
}, []),
|
|
4235
|
+
}, []), r(() => pe.current?.observe(B ? de.current : null), [
|
|
4219
4236
|
z,
|
|
4220
4237
|
B,
|
|
4221
4238
|
W.length > 0
|
|
4222
|
-
]),
|
|
4223
|
-
J.current =
|
|
4224
|
-
}),
|
|
4225
|
-
let e =
|
|
4226
|
-
|
|
4227
|
-
}, [
|
|
4228
|
-
ge.current =
|
|
4229
|
-
}, [
|
|
4239
|
+
]), r(() => {
|
|
4240
|
+
J.current = b, me.current = ie, he.current = ae;
|
|
4241
|
+
}), r(() => {
|
|
4242
|
+
let e = K.current?.matches(":popover-open") ?? !1;
|
|
4243
|
+
y === !0 && !e ? K.current?.showPopover() : y === !1 && e && pe.current?.close();
|
|
4244
|
+
}, [y]), r(() => {
|
|
4245
|
+
ge.current = v, pe.current?.place();
|
|
4246
|
+
}, [v]), r(() => {
|
|
4230
4247
|
B && ie.length > 0 && !ie.includes(z.filter) && X.load(ie[0], z.category);
|
|
4231
4248
|
}, [ie.join()]);
|
|
4232
4249
|
let _e = () => {
|
|
4233
4250
|
let e = document.getElementById(R.panel);
|
|
4234
4251
|
e?.matches(":popover-open") && e.hidePopover();
|
|
4235
|
-
}, ve = `${z.filter}|${z.category}|${B}|${z.selectable}`, [ye, be] =
|
|
4252
|
+
}, ve = `${z.filter}|${z.category}|${B}|${z.selectable}`, [ye, be] = o([]), [xe, Se] = o(ve);
|
|
4236
4253
|
xe !== ve && (Se(ve), be([]));
|
|
4237
4254
|
let Ce = W.some((e) => ye.includes(e.id));
|
|
4238
|
-
|
|
4239
|
-
let we = (e, t) => be((n) =>
|
|
4240
|
-
let t =
|
|
4241
|
-
t?.action ?
|
|
4255
|
+
r(() => fe.current?.release(), [ve]);
|
|
4256
|
+
let we = (e, t) => be((n) => ba(n, e, t)), Te = (e) => {
|
|
4257
|
+
let t = Ta(e.nativeEvent, z.items);
|
|
4258
|
+
t?.action ? w?.(t.item, t.action, e) : t && S?.(t.item, e);
|
|
4242
4259
|
}, Ee = (e) => /* @__PURE__ */ O(E, { children: [/* @__PURE__ */ D("p", {
|
|
4243
4260
|
role: "alert",
|
|
4244
4261
|
children: ne("error")
|
|
4245
4262
|
}), /* @__PURE__ */ D("button", {
|
|
4246
4263
|
type: "button",
|
|
4247
4264
|
"data-inbox-retry": "",
|
|
4248
|
-
className:
|
|
4265
|
+
className: ki,
|
|
4249
4266
|
onClick: e,
|
|
4250
4267
|
children: ne("retry")
|
|
4251
|
-
})] }), De =
|
|
4268
|
+
})] }), De = ua(z, W.length), Oe;
|
|
4252
4269
|
return Oe = De === "loading" ? /* @__PURE__ */ D("div", {
|
|
4253
4270
|
role: "status",
|
|
4254
|
-
className:
|
|
4271
|
+
className: Fi,
|
|
4255
4272
|
children: N ? N() : /* @__PURE__ */ O(E, { children: [/* @__PURE__ */ D($, {
|
|
4256
4273
|
name: "spinner",
|
|
4257
4274
|
context: {
|
|
@@ -4259,23 +4276,23 @@ function Wa({ labels: e, badge: n = "count", count: i = "unseen", maxCount: o =
|
|
|
4259
4276
|
part: "loading"
|
|
4260
4277
|
},
|
|
4261
4278
|
icons: u,
|
|
4262
|
-
resolver:
|
|
4263
|
-
className: G(
|
|
4279
|
+
resolver: d,
|
|
4280
|
+
className: G(Ii, "motion-safe:animate-spin")
|
|
4264
4281
|
}), /* @__PURE__ */ D("span", {
|
|
4265
4282
|
className: "sr-only",
|
|
4266
4283
|
children: ne("loading")
|
|
4267
4284
|
})] })
|
|
4268
4285
|
}) : De === "error" ? /* @__PURE__ */ D("div", {
|
|
4269
4286
|
"data-inbox-error": "",
|
|
4270
|
-
className:
|
|
4287
|
+
className: Fi,
|
|
4271
4288
|
children: (P ?? (({ retry: e }) => Ee(e)))({
|
|
4272
4289
|
more: !1,
|
|
4273
4290
|
retry: () => void X.load()
|
|
4274
4291
|
})
|
|
4275
4292
|
}) : De === "empty" ? /* @__PURE__ */ D("div", {
|
|
4276
4293
|
"data-inbox-empty": "",
|
|
4277
|
-
className:
|
|
4278
|
-
children:
|
|
4294
|
+
className: Fi,
|
|
4295
|
+
children: h ? h(z.filter) : /* @__PURE__ */ O(E, { children: [/* @__PURE__ */ D($, {
|
|
4279
4296
|
name: "empty",
|
|
4280
4297
|
context: {
|
|
4281
4298
|
component: "NotificationCenter",
|
|
@@ -4283,28 +4300,28 @@ function Wa({ labels: e, badge: n = "count", count: i = "unseen", maxCount: o =
|
|
|
4283
4300
|
filter: z.filter
|
|
4284
4301
|
},
|
|
4285
4302
|
icons: u,
|
|
4286
|
-
resolver:
|
|
4287
|
-
className:
|
|
4303
|
+
resolver: d,
|
|
4304
|
+
className: Ii
|
|
4288
4305
|
}), /* @__PURE__ */ D("p", { children: re })] })
|
|
4289
4306
|
}) : /* @__PURE__ */ O(E, { children: [
|
|
4290
4307
|
/* @__PURE__ */ D("ul", {
|
|
4291
4308
|
role: "list",
|
|
4292
4309
|
"data-inbox-selecting": Ce || void 0,
|
|
4293
|
-
className: G(
|
|
4294
|
-
children: ce.map((e) => /* @__PURE__ */ D(
|
|
4310
|
+
className: G(yi, f.list),
|
|
4311
|
+
children: ce.map((e) => /* @__PURE__ */ D(Ua, {
|
|
4295
4312
|
group: e,
|
|
4296
4313
|
now: te,
|
|
4297
4314
|
labels: H,
|
|
4298
4315
|
icons: u,
|
|
4299
|
-
iconResolver:
|
|
4300
|
-
classes:
|
|
4301
|
-
locale:
|
|
4316
|
+
iconResolver: d,
|
|
4317
|
+
classes: f,
|
|
4318
|
+
locale: p,
|
|
4302
4319
|
pendingActions: z.pendingActions,
|
|
4303
|
-
snooze:
|
|
4320
|
+
snooze: _,
|
|
4304
4321
|
allowedActions: z.allowedActions,
|
|
4305
4322
|
selected: z.selectable ? ye : void 0,
|
|
4306
4323
|
select: z.selectable ? we : void 0,
|
|
4307
|
-
renderItem:
|
|
4324
|
+
renderItem: m
|
|
4308
4325
|
}, e.key))
|
|
4309
4326
|
}),
|
|
4310
4327
|
z.hasMore && z.moreFailed && /* @__PURE__ */ D("div", {
|
|
@@ -4326,7 +4343,7 @@ function Wa({ labels: e, badge: n = "count", count: i = "unseen", maxCount: o =
|
|
|
4326
4343
|
part: "loading-more"
|
|
4327
4344
|
},
|
|
4328
4345
|
icons: u,
|
|
4329
|
-
resolver:
|
|
4346
|
+
resolver: d,
|
|
4330
4347
|
className: "size-5 motion-safe:animate-spin"
|
|
4331
4348
|
})
|
|
4332
4349
|
})
|
|
@@ -4334,16 +4351,16 @@ function Wa({ labels: e, badge: n = "count", count: i = "unseen", maxCount: o =
|
|
|
4334
4351
|
"data-inbox": "",
|
|
4335
4352
|
className: "inline-flex",
|
|
4336
4353
|
children: [/* @__PURE__ */ D("button", {
|
|
4337
|
-
ref:
|
|
4354
|
+
ref: ue,
|
|
4338
4355
|
type: "button",
|
|
4339
4356
|
popoverTarget: R.panel,
|
|
4340
4357
|
"aria-haspopup": "dialog",
|
|
4341
4358
|
"aria-expanded": B,
|
|
4342
4359
|
"aria-controls": R.panel,
|
|
4343
|
-
"aria-label":
|
|
4360
|
+
"aria-label": Na(H, U, c, p, z.pausedUntil !== null),
|
|
4344
4361
|
"data-inbox-bell": "",
|
|
4345
4362
|
"data-paused": z.pausedUntil === null ? void 0 : "true",
|
|
4346
|
-
className: G(
|
|
4363
|
+
className: G(di, f.bell),
|
|
4347
4364
|
children: k ? k({
|
|
4348
4365
|
open: B,
|
|
4349
4366
|
count: U,
|
|
@@ -4356,40 +4373,40 @@ function Wa({ labels: e, badge: n = "count", count: i = "unseen", maxCount: o =
|
|
|
4356
4373
|
part: "bell"
|
|
4357
4374
|
},
|
|
4358
4375
|
icons: u,
|
|
4359
|
-
resolver:
|
|
4376
|
+
resolver: d,
|
|
4360
4377
|
className: "size-5"
|
|
4361
4378
|
}),
|
|
4362
|
-
|
|
4379
|
+
t !== "none" && U > 0 && A && A({
|
|
4363
4380
|
count: U,
|
|
4364
|
-
text:
|
|
4381
|
+
text: St(U, c, p)
|
|
4365
4382
|
}),
|
|
4366
|
-
|
|
4383
|
+
t === "count" && U > 0 && !A && /* @__PURE__ */ D("span", {
|
|
4367
4384
|
"data-inbox-badge": "",
|
|
4368
4385
|
"aria-hidden": "true",
|
|
4369
|
-
className: G("bg-iui-inbox-badge text-iui-inbox-badge-foreground absolute -inset-e-0.5 -top-0.5 flex h-4.5 min-w-4.5 items-center justify-center rounded-full px-1 text-[0.6875rem] leading-none font-semibold tabular-nums",
|
|
4370
|
-
children:
|
|
4386
|
+
className: G("bg-iui-inbox-badge text-iui-inbox-badge-foreground absolute -inset-e-0.5 -top-0.5 flex h-4.5 min-w-4.5 items-center justify-center rounded-full px-1 text-[0.6875rem] leading-none font-semibold tabular-nums", f.badge),
|
|
4387
|
+
children: St(U, c, p)
|
|
4371
4388
|
}),
|
|
4372
|
-
|
|
4389
|
+
t === "dot" && U > 0 && !A && /* @__PURE__ */ D("span", {
|
|
4373
4390
|
"data-inbox-badge": "",
|
|
4374
4391
|
"aria-hidden": "true",
|
|
4375
|
-
className: G("bg-iui-inbox-badge absolute inset-e-1.5 top-1.5 size-2 rounded-full forced-color-adjust-none forced-colors:bg-[Highlight]",
|
|
4392
|
+
className: G("bg-iui-inbox-badge absolute inset-e-1.5 top-1.5 size-2 rounded-full forced-color-adjust-none forced-colors:bg-[Highlight]", f.badge)
|
|
4376
4393
|
})
|
|
4377
4394
|
] })
|
|
4378
4395
|
}), /* @__PURE__ */ D("div", {
|
|
4379
4396
|
id: R.panel,
|
|
4380
|
-
ref:
|
|
4397
|
+
ref: K,
|
|
4381
4398
|
popover: "auto",
|
|
4382
4399
|
role: "dialog",
|
|
4383
4400
|
"aria-labelledby": R.title,
|
|
4384
4401
|
tabIndex: -1,
|
|
4385
4402
|
"data-inbox-panel": "",
|
|
4386
|
-
className: G(
|
|
4387
|
-
onKeyDown: (e) =>
|
|
4403
|
+
className: G(fi, f.panel),
|
|
4404
|
+
onKeyDown: (e) => ja(e.nativeEvent, K.current),
|
|
4388
4405
|
onClickCapture: Te,
|
|
4389
4406
|
children: /* @__PURE__ */ O("div", {
|
|
4390
|
-
className:
|
|
4407
|
+
className: pi,
|
|
4391
4408
|
children: [
|
|
4392
|
-
/* @__PURE__ */ D(
|
|
4409
|
+
/* @__PURE__ */ D(Ba, {
|
|
4393
4410
|
component: "NotificationCenter",
|
|
4394
4411
|
state: z,
|
|
4395
4412
|
filter: z.filter,
|
|
@@ -4397,10 +4414,10 @@ function Wa({ labels: e, badge: n = "count", count: i = "unseen", maxCount: o =
|
|
|
4397
4414
|
items: z.items,
|
|
4398
4415
|
labels: H,
|
|
4399
4416
|
icons: u,
|
|
4400
|
-
iconResolver:
|
|
4401
|
-
classes:
|
|
4402
|
-
locale:
|
|
4403
|
-
maxCount:
|
|
4417
|
+
iconResolver: d,
|
|
4418
|
+
classes: f,
|
|
4419
|
+
locale: p,
|
|
4420
|
+
maxCount: c,
|
|
4404
4421
|
now: te,
|
|
4405
4422
|
panel: {
|
|
4406
4423
|
titleId: R.title,
|
|
@@ -4420,10 +4437,10 @@ function Wa({ labels: e, badge: n = "count", count: i = "unseen", maxCount: o =
|
|
|
4420
4437
|
role: le ? "tabpanel" : void 0,
|
|
4421
4438
|
"aria-labelledby": le ? R.tab(z.filter) : void 0,
|
|
4422
4439
|
"aria-busy": z.status === "loading" || z.loadingMore || void 0,
|
|
4423
|
-
className:
|
|
4440
|
+
className: _i,
|
|
4424
4441
|
children: [/* @__PURE__ */ D("div", {
|
|
4425
4442
|
"aria-live": "polite",
|
|
4426
|
-
className:
|
|
4443
|
+
className: vi,
|
|
4427
4444
|
children: oe.length > 0 && /* @__PURE__ */ D("button", {
|
|
4428
4445
|
type: "button",
|
|
4429
4446
|
"data-inbox-show-new": "",
|
|
@@ -4433,7 +4450,7 @@ function Wa({ labels: e, badge: n = "count", count: i = "unseen", maxCount: o =
|
|
|
4433
4450
|
})
|
|
4434
4451
|
}), Oe]
|
|
4435
4452
|
}),
|
|
4436
|
-
/* @__PURE__ */ D(
|
|
4453
|
+
/* @__PURE__ */ D(Wa, {
|
|
4437
4454
|
component: "NotificationCenter",
|
|
4438
4455
|
items: W,
|
|
4439
4456
|
selected: ye,
|
|
@@ -4443,16 +4460,16 @@ function Wa({ labels: e, badge: n = "count", count: i = "unseen", maxCount: o =
|
|
|
4443
4460
|
now: te,
|
|
4444
4461
|
labels: H,
|
|
4445
4462
|
icons: u,
|
|
4446
|
-
iconResolver:
|
|
4447
|
-
classes:
|
|
4448
|
-
locale:
|
|
4449
|
-
snooze:
|
|
4463
|
+
iconResolver: d,
|
|
4464
|
+
classes: f,
|
|
4465
|
+
locale: p,
|
|
4466
|
+
snooze: _
|
|
4450
4467
|
}),
|
|
4451
4468
|
F ? F({
|
|
4452
|
-
href:
|
|
4469
|
+
href: l,
|
|
4453
4470
|
close: _e
|
|
4454
|
-
}) :
|
|
4455
|
-
href:
|
|
4471
|
+
}) : l && /* @__PURE__ */ D(x, {
|
|
4472
|
+
href: l,
|
|
4456
4473
|
"data-inbox-view-all": "",
|
|
4457
4474
|
className: "border-iui-inbox-border text-iui-inbox-accent hover:bg-iui-inbox-control-hover focus-visible:ring-iui-inbox-ring block border-t px-4 py-2.5 text-center text-sm font-medium focus-visible:ring-2 focus-visible:outline-hidden focus-visible:ring-inset",
|
|
4458
4475
|
children: ne("viewAll")
|
|
@@ -4463,35 +4480,35 @@ function Wa({ labels: e, badge: n = "count", count: i = "unseen", maxCount: o =
|
|
|
4463
4480
|
});
|
|
4464
4481
|
}
|
|
4465
4482
|
// src/NotificationList.tsx
|
|
4466
|
-
function
|
|
4467
|
-
let A =
|
|
4483
|
+
function qa({ data: e, filter: t, labels: n, icons: c = {}, iconResolver: l, classes: u = {}, locale: d, buffer: f = 250, manual: p = !1, preserveUrl: m = !1, renderItem: h, renderEmpty: g, category: _, group: v = !0, snooze: y, maxCount: x = 99, renderHeader: S, renderTab: C, onItemClick: w, onAction: k }) {
|
|
4484
|
+
let A = T(), j = s(X.subscribe, X.getSnapshot, X.getServerSnapshot), [M] = o(Date.now), N = s(bt.subscribe, bt.getSnapshot, () => M), { filter: P, category: F } = ha(A.url, j, t, _), I = Tt(n), L = sa(P, I), R = a(null), z = A.props[e]?.data, B = i(() => Array.isArray(z) ? z.map(We).filter((e) => e !== void 0) : [], [z]), ee = i(() => st(X, B, P, F), [
|
|
4468
4485
|
B,
|
|
4469
4486
|
P,
|
|
4470
4487
|
F,
|
|
4471
4488
|
j
|
|
4472
|
-
]), [V, te] =
|
|
4489
|
+
]), [V, te] = o([]), H = la(ee, V), ne = ct(H, v), U = !!A.scrollProps?.[e]?.nextPage, re = a(null), ie = a(H), ae = a({
|
|
4473
4490
|
loaded: B,
|
|
4474
4491
|
filter: P,
|
|
4475
4492
|
category: F
|
|
4476
4493
|
});
|
|
4477
|
-
|
|
4494
|
+
r(() => {
|
|
4478
4495
|
ie.current = H, ae.current = {
|
|
4479
4496
|
loaded: B,
|
|
4480
4497
|
filter: P,
|
|
4481
4498
|
category: F
|
|
4482
4499
|
};
|
|
4483
4500
|
});
|
|
4484
|
-
let oe = (
|
|
4485
|
-
le !== se && (
|
|
4486
|
-
let
|
|
4487
|
-
|
|
4488
|
-
let de = (e, t) => ce((n) =>
|
|
4489
|
-
return
|
|
4490
|
-
|
|
4491
|
-
}, []),
|
|
4492
|
-
let e =
|
|
4501
|
+
let oe = (t, n) => ma(A.url, t, n, A.scrollProps?.[e]?.pageName), se = `${P}|${F}|${j.selectable}`, [W, ce] = o([]), [le, ue] = o(se);
|
|
4502
|
+
le !== se && (ue(se), ce([]));
|
|
4503
|
+
let K = H.some((e) => W.includes(e.id));
|
|
4504
|
+
r(() => re.current?.release(), [se]);
|
|
4505
|
+
let de = (e, t) => ce((n) => ba(n, e, t));
|
|
4506
|
+
return r(() => {
|
|
4507
|
+
qi(), _t(A.props);
|
|
4508
|
+
}, []), r(() => X.remember(B), [B]), r(() => Ma(R.current), []), r(() => {
|
|
4509
|
+
let e = xa(R.current, te, { listed: (e) => st(X, ae.current.loaded, ae.current.filter, ae.current.category).some((t) => t.id === e) });
|
|
4493
4510
|
re.current = e;
|
|
4494
|
-
let t =
|
|
4511
|
+
let t = wa(R.current, () => ie.current, null);
|
|
4495
4512
|
return () => {
|
|
4496
4513
|
e.destroy(), t.destroy(), re.current = null;
|
|
4497
4514
|
};
|
|
@@ -4499,32 +4516,32 @@ function Ga({ data: t, filter: n, labels: r, icons: i = {}, iconResolver: o, cla
|
|
|
4499
4516
|
ref: R,
|
|
4500
4517
|
"data-inbox-list": "",
|
|
4501
4518
|
tabIndex: -1,
|
|
4502
|
-
onKeyDown: (e) =>
|
|
4519
|
+
onKeyDown: (e) => ja(e.nativeEvent, R.current),
|
|
4503
4520
|
onClickCapture: (e) => {
|
|
4504
|
-
let t =
|
|
4505
|
-
t?.action ? k?.(t.item, t.action, e) : t &&
|
|
4521
|
+
let t = Ta(e.nativeEvent, H);
|
|
4522
|
+
t?.action ? k?.(t.item, t.action, e) : t && w?.(t.item, e);
|
|
4506
4523
|
},
|
|
4507
4524
|
children: [
|
|
4508
|
-
/* @__PURE__ */ D(
|
|
4525
|
+
/* @__PURE__ */ D(Ba, {
|
|
4509
4526
|
component: "NotificationList",
|
|
4510
4527
|
state: j,
|
|
4511
4528
|
filter: P,
|
|
4512
4529
|
category: F,
|
|
4513
4530
|
items: H,
|
|
4514
4531
|
labels: I,
|
|
4515
|
-
icons:
|
|
4516
|
-
iconResolver:
|
|
4517
|
-
classes:
|
|
4518
|
-
locale:
|
|
4519
|
-
maxCount:
|
|
4532
|
+
icons: c,
|
|
4533
|
+
iconResolver: l,
|
|
4534
|
+
classes: u,
|
|
4535
|
+
locale: d,
|
|
4536
|
+
maxCount: x,
|
|
4520
4537
|
now: N,
|
|
4521
4538
|
href: oe,
|
|
4522
|
-
renderHeader:
|
|
4523
|
-
renderTab:
|
|
4539
|
+
renderHeader: S,
|
|
4540
|
+
renderTab: C
|
|
4524
4541
|
}),
|
|
4525
4542
|
/* @__PURE__ */ D("div", {
|
|
4526
4543
|
"aria-live": "polite",
|
|
4527
|
-
className:
|
|
4544
|
+
className: vi,
|
|
4528
4545
|
children: V.length > 0 && /* @__PURE__ */ D("button", {
|
|
4529
4546
|
type: "button",
|
|
4530
4547
|
"data-inbox-show-new": "",
|
|
@@ -4533,34 +4550,34 @@ function Ga({ data: t, filter: n, labels: r, icons: i = {}, iconResolver: o, cla
|
|
|
4533
4550
|
children: Z(I.showNew, { count: V.length })
|
|
4534
4551
|
})
|
|
4535
4552
|
}),
|
|
4536
|
-
/* @__PURE__ */ D(
|
|
4537
|
-
data:
|
|
4538
|
-
buffer:
|
|
4539
|
-
manual:
|
|
4540
|
-
preserveUrl:
|
|
4553
|
+
/* @__PURE__ */ D(b, {
|
|
4554
|
+
data: e,
|
|
4555
|
+
buffer: f,
|
|
4556
|
+
manual: p,
|
|
4557
|
+
preserveUrl: m,
|
|
4541
4558
|
as: "ul",
|
|
4542
4559
|
role: "list",
|
|
4543
4560
|
hidden: H.length === 0 || void 0,
|
|
4544
|
-
"data-inbox-selecting":
|
|
4545
|
-
className: G(
|
|
4561
|
+
"data-inbox-selecting": K || void 0,
|
|
4562
|
+
className: G(yi, u.list),
|
|
4546
4563
|
loading: /* @__PURE__ */ O("div", {
|
|
4547
4564
|
role: "status",
|
|
4548
|
-
className:
|
|
4565
|
+
className: Li,
|
|
4549
4566
|
children: [/* @__PURE__ */ D($, {
|
|
4550
4567
|
name: "spinner",
|
|
4551
4568
|
context: {
|
|
4552
4569
|
component: "NotificationList",
|
|
4553
4570
|
part: "loading-more"
|
|
4554
4571
|
},
|
|
4555
|
-
icons:
|
|
4556
|
-
resolver:
|
|
4557
|
-
className:
|
|
4572
|
+
icons: c,
|
|
4573
|
+
resolver: l,
|
|
4574
|
+
className: ci
|
|
4558
4575
|
}), /* @__PURE__ */ D("span", {
|
|
4559
4576
|
className: "sr-only",
|
|
4560
4577
|
children: Z(I.loading)
|
|
4561
4578
|
})]
|
|
4562
4579
|
}),
|
|
4563
|
-
next:
|
|
4580
|
+
next: p ? ({ fetch: e, hasMore: t, loading: n }) => t && /* @__PURE__ */ D("div", {
|
|
4564
4581
|
className: "text-iui-inbox-muted-foreground flex justify-center py-3",
|
|
4565
4582
|
children: /* @__PURE__ */ D("button", {
|
|
4566
4583
|
type: "button",
|
|
@@ -4571,40 +4588,40 @@ function Ga({ data: t, filter: n, labels: r, icons: i = {}, iconResolver: o, cla
|
|
|
4571
4588
|
children: Z(I.loadMore)
|
|
4572
4589
|
})
|
|
4573
4590
|
}) : void 0,
|
|
4574
|
-
children: ne.map((e) => /* @__PURE__ */ D(
|
|
4591
|
+
children: ne.map((e) => /* @__PURE__ */ D(Ua, {
|
|
4575
4592
|
group: e,
|
|
4576
4593
|
now: N,
|
|
4577
4594
|
labels: I,
|
|
4578
|
-
icons:
|
|
4579
|
-
iconResolver:
|
|
4580
|
-
classes:
|
|
4581
|
-
locale:
|
|
4595
|
+
icons: c,
|
|
4596
|
+
iconResolver: l,
|
|
4597
|
+
classes: u,
|
|
4598
|
+
locale: d,
|
|
4582
4599
|
pendingActions: j.pendingActions,
|
|
4583
|
-
snooze:
|
|
4600
|
+
snooze: y,
|
|
4584
4601
|
allowedActions: j.allowedActions,
|
|
4585
4602
|
selected: j.selectable ? W : void 0,
|
|
4586
4603
|
select: j.selectable ? de : void 0,
|
|
4587
|
-
renderItem:
|
|
4604
|
+
renderItem: h
|
|
4588
4605
|
}, e.key))
|
|
4589
4606
|
}),
|
|
4590
4607
|
H.length === 0 && !U && /* @__PURE__ */ D("div", {
|
|
4591
4608
|
"data-inbox-empty": "",
|
|
4592
4609
|
className: "text-iui-inbox-muted-foreground flex flex-col items-center gap-3 px-6 py-12 text-center text-sm",
|
|
4593
|
-
children:
|
|
4610
|
+
children: g ? g(P) : /* @__PURE__ */ O(E, { children: [/* @__PURE__ */ D($, {
|
|
4594
4611
|
name: "empty",
|
|
4595
4612
|
context: {
|
|
4596
4613
|
component: "NotificationList",
|
|
4597
4614
|
part: "empty",
|
|
4598
4615
|
filter: P
|
|
4599
4616
|
},
|
|
4600
|
-
icons:
|
|
4601
|
-
resolver:
|
|
4617
|
+
icons: c,
|
|
4618
|
+
resolver: l,
|
|
4602
4619
|
className: "text-iui-inbox-icon size-8"
|
|
4603
4620
|
}), /* @__PURE__ */ D("p", { children: L })] })
|
|
4604
4621
|
}),
|
|
4605
|
-
|
|
4622
|
+
K && /* @__PURE__ */ D("div", {
|
|
4606
4623
|
className: "bg-iui-inbox-surface sticky bottom-0 z-20",
|
|
4607
|
-
children: /* @__PURE__ */ D(
|
|
4624
|
+
children: /* @__PURE__ */ D(Wa, {
|
|
4608
4625
|
component: "NotificationList",
|
|
4609
4626
|
items: H,
|
|
4610
4627
|
selected: W,
|
|
@@ -4613,88 +4630,88 @@ function Ga({ data: t, filter: n, labels: r, icons: i = {}, iconResolver: o, cla
|
|
|
4613
4630
|
allowedActions: j.allowedActions,
|
|
4614
4631
|
now: N,
|
|
4615
4632
|
labels: I,
|
|
4616
|
-
icons:
|
|
4617
|
-
iconResolver:
|
|
4618
|
-
classes:
|
|
4619
|
-
locale:
|
|
4620
|
-
snooze:
|
|
4633
|
+
icons: c,
|
|
4634
|
+
iconResolver: l,
|
|
4635
|
+
classes: u,
|
|
4636
|
+
locale: d,
|
|
4637
|
+
snooze: y
|
|
4621
4638
|
})
|
|
4622
4639
|
})
|
|
4623
4640
|
]
|
|
4624
4641
|
});
|
|
4625
4642
|
}
|
|
4626
4643
|
// src/usePreferences.ts
|
|
4627
|
-
var
|
|
4628
|
-
function
|
|
4629
|
-
let { props: e } =
|
|
4630
|
-
return
|
|
4631
|
-
|
|
4644
|
+
var Ja = () => kn.load(X.getSnapshot().url);
|
|
4645
|
+
function Ya() {
|
|
4646
|
+
let { props: e } = T(), t = s(kn.subscribe, kn.getSnapshot, () => qt), n = i(() => tn(t), [t]);
|
|
4647
|
+
return r(() => {
|
|
4648
|
+
qi(), _t(e), Ja();
|
|
4632
4649
|
}, []), {
|
|
4633
4650
|
...t,
|
|
4634
4651
|
sections: n,
|
|
4635
|
-
load:
|
|
4636
|
-
set:
|
|
4637
|
-
setChannel:
|
|
4638
|
-
setFrequency:
|
|
4639
|
-
setNotificationHours:
|
|
4640
|
-
receives: (e, n) =>
|
|
4641
|
-
frequencyApplies:
|
|
4642
|
-
isDisabled: (e, n) =>
|
|
4652
|
+
load: Ja,
|
|
4653
|
+
set: kn.set,
|
|
4654
|
+
setChannel: kn.setChannel,
|
|
4655
|
+
setFrequency: kn.setFrequency,
|
|
4656
|
+
setNotificationHours: kn.setNotificationHours,
|
|
4657
|
+
receives: (e, n) => an(e, n, t.channels),
|
|
4658
|
+
frequencyApplies: sn,
|
|
4659
|
+
isDisabled: (e, n) => on(e, n, t.channels)
|
|
4643
4660
|
};
|
|
4644
4661
|
}
|
|
4645
4662
|
// src/usePush.ts
|
|
4646
|
-
var
|
|
4647
|
-
function
|
|
4648
|
-
let { props: e } =
|
|
4649
|
-
return
|
|
4650
|
-
|
|
4663
|
+
var Xa = () => Mn;
|
|
4664
|
+
function Za() {
|
|
4665
|
+
let { props: e } = T(), t = s(Jn.subscribe, Jn.getSnapshot, Xa);
|
|
4666
|
+
return r(() => {
|
|
4667
|
+
qi(), _t(e);
|
|
4651
4668
|
}, []), {
|
|
4652
4669
|
...t,
|
|
4653
|
-
deviceState:
|
|
4654
|
-
subscribe:
|
|
4655
|
-
unsubscribe:
|
|
4656
|
-
loadDevices:
|
|
4657
|
-
removeDevice:
|
|
4670
|
+
deviceState: Nn(t),
|
|
4671
|
+
subscribe: Jn.enable,
|
|
4672
|
+
unsubscribe: Jn.disable,
|
|
4673
|
+
loadDevices: Jn.loadDevices,
|
|
4674
|
+
removeDevice: Jn.removeDevice
|
|
4658
4675
|
};
|
|
4659
4676
|
}
|
|
4660
4677
|
// src/NotificationPreferences.tsx
|
|
4661
|
-
function
|
|
4662
|
-
let { status:
|
|
4663
|
-
|
|
4664
|
-
R &&
|
|
4678
|
+
function Qa({ labels: e, classes: r = {}, locale: i, renderCategory: a, renderGroup: c, renderChannel: l, renderEmpty: u }) {
|
|
4679
|
+
let { status: d, channels: f, categories: p, sections: m, notificationHours: h, frequencies: g, load: _, setChannel: v, setFrequency: y, setNotificationHours: b, receives: x, frequencyApplies: S, isDisabled: C } = Ya(), w = Za(), [T, k] = o(null), A = On(e), j = (e) => Z(A[e]), M = An(f, p, g, A), N = f.some((e) => e.push) ? Pn(w) : null, [P] = o(Date.now), F = s(bt.subscribe, bt.getSnapshot, () => P), I = Yn(w.devices, A, F, i), L = n(), R = N !== null;
|
|
4680
|
+
t(() => {
|
|
4681
|
+
R && Jn.loadDevices();
|
|
4665
4682
|
}, [R]);
|
|
4666
4683
|
let z = (e) => {
|
|
4667
|
-
let t =
|
|
4684
|
+
let t = vn(h, T, e);
|
|
4668
4685
|
t && (k(t.editing), b({ days: { [e.day]: t.ranges } }));
|
|
4669
4686
|
};
|
|
4670
|
-
return
|
|
4687
|
+
return d === "error" ? /* @__PURE__ */ D("div", {
|
|
4671
4688
|
"data-inbox-preferences": "",
|
|
4672
4689
|
children: /* @__PURE__ */ O("div", {
|
|
4673
4690
|
"data-inbox-preferences-error": "",
|
|
4674
|
-
className:
|
|
4691
|
+
className: Fi,
|
|
4675
4692
|
children: [/* @__PURE__ */ D("p", { children: j("error") }), /* @__PURE__ */ D("button", {
|
|
4676
4693
|
type: "button",
|
|
4677
|
-
className:
|
|
4694
|
+
className: ki,
|
|
4678
4695
|
onClick: () => void _(),
|
|
4679
4696
|
children: j("retry")
|
|
4680
4697
|
})]
|
|
4681
4698
|
})
|
|
4682
|
-
}) :
|
|
4699
|
+
}) : p.length === 0 ? /* @__PURE__ */ D("div", {
|
|
4683
4700
|
"data-inbox-preferences": "",
|
|
4684
|
-
children:
|
|
4701
|
+
children: d === "ready" ? /* @__PURE__ */ D("div", {
|
|
4685
4702
|
"data-inbox-preferences-empty": "",
|
|
4686
|
-
className:
|
|
4687
|
-
children:
|
|
4703
|
+
className: Fi,
|
|
4704
|
+
children: u ? u() : /* @__PURE__ */ D("p", { children: j("empty") })
|
|
4688
4705
|
}) : /* @__PURE__ */ O("div", {
|
|
4689
4706
|
role: "status",
|
|
4690
|
-
className:
|
|
4707
|
+
className: Fi,
|
|
4691
4708
|
children: [/* @__PURE__ */ D($, {
|
|
4692
4709
|
name: "spinner",
|
|
4693
4710
|
context: {
|
|
4694
4711
|
component: "NotificationPreferences",
|
|
4695
4712
|
part: "loading"
|
|
4696
4713
|
},
|
|
4697
|
-
className:
|
|
4714
|
+
className: ci
|
|
4698
4715
|
}), /* @__PURE__ */ D("span", {
|
|
4699
4716
|
className: "sr-only",
|
|
4700
4717
|
children: j("loading")
|
|
@@ -4704,9 +4721,9 @@ function Xa({ labels: e, classes: t = {}, locale: n, renderCategory: r, renderGr
|
|
|
4704
4721
|
"data-inbox-preferences": "",
|
|
4705
4722
|
children: [
|
|
4706
4723
|
/* @__PURE__ */ D("div", {
|
|
4707
|
-
className:
|
|
4724
|
+
className: Ri,
|
|
4708
4725
|
children: /* @__PURE__ */ O("table", {
|
|
4709
|
-
className: G(
|
|
4726
|
+
className: G(zi, r.table),
|
|
4710
4727
|
children: [
|
|
4711
4728
|
/* @__PURE__ */ D("caption", {
|
|
4712
4729
|
className: "sr-only",
|
|
@@ -4715,37 +4732,37 @@ function Xa({ labels: e, classes: t = {}, locale: n, renderCategory: r, renderGr
|
|
|
4715
4732
|
/* @__PURE__ */ D("thead", { children: /* @__PURE__ */ O("tr", { children: [
|
|
4716
4733
|
/* @__PURE__ */ D("th", {
|
|
4717
4734
|
scope: "col",
|
|
4718
|
-
className: G(
|
|
4735
|
+
className: G(Bi, r.head),
|
|
4719
4736
|
children: j("category")
|
|
4720
4737
|
}),
|
|
4721
|
-
|
|
4738
|
+
f.map((e) => /* @__PURE__ */ D("th", {
|
|
4722
4739
|
scope: "col",
|
|
4723
|
-
className: G(
|
|
4724
|
-
children:
|
|
4740
|
+
className: G(Vi, r.head),
|
|
4741
|
+
children: l ? l(e) : e.label
|
|
4725
4742
|
}, e.key)),
|
|
4726
4743
|
M.hasFrequencies && /* @__PURE__ */ D("th", {
|
|
4727
4744
|
scope: "col",
|
|
4728
|
-
className: G("text-iui-inbox-muted-foreground w-40 px-4 py-2.5 text-start text-xs font-medium",
|
|
4745
|
+
className: G("text-iui-inbox-muted-foreground w-40 px-4 py-2.5 text-start text-xs font-medium", r.head),
|
|
4729
4746
|
children: j("frequency")
|
|
4730
4747
|
})
|
|
4731
4748
|
] }) }),
|
|
4732
4749
|
M.hasGlobalSwitches && /* @__PURE__ */ D("tbody", {
|
|
4733
4750
|
"data-inbox-preferences-global": "",
|
|
4734
4751
|
children: /* @__PURE__ */ O("tr", {
|
|
4735
|
-
className: G("border-iui-inbox-border border-t",
|
|
4752
|
+
className: G("border-iui-inbox-border border-t", r.row),
|
|
4736
4753
|
children: [
|
|
4737
4754
|
/* @__PURE__ */ O("th", {
|
|
4738
4755
|
scope: "row",
|
|
4739
4756
|
className: "min-w-36 px-4 py-3 text-start align-top font-normal",
|
|
4740
4757
|
children: [/* @__PURE__ */ D("span", {
|
|
4741
|
-
className: G("text-iui-inbox-foreground font-medium",
|
|
4758
|
+
className: G("text-iui-inbox-foreground font-medium", r.label),
|
|
4742
4759
|
children: j("global")
|
|
4743
4760
|
}), /* @__PURE__ */ D("span", {
|
|
4744
|
-
className: G("text-iui-inbox-muted-foreground mt-0.5 block",
|
|
4761
|
+
className: G("text-iui-inbox-muted-foreground mt-0.5 block", r.description),
|
|
4745
4762
|
children: j("globalDescription")
|
|
4746
4763
|
})]
|
|
4747
4764
|
}),
|
|
4748
|
-
|
|
4765
|
+
f.map((e) => /* @__PURE__ */ D("td", {
|
|
4749
4766
|
className: "px-2 py-3 text-center align-middle",
|
|
4750
4767
|
children: e.globalSwitch && /* @__PURE__ */ D("button", {
|
|
4751
4768
|
type: "button",
|
|
@@ -4756,7 +4773,7 @@ function Xa({ labels: e, classes: t = {}, locale: n, renderCategory: r, renderGr
|
|
|
4756
4773
|
channel: e.label
|
|
4757
4774
|
}),
|
|
4758
4775
|
"data-inbox-preference-channel": e.key,
|
|
4759
|
-
className: G("group/switch bg-iui-inbox-icon aria-checked:bg-iui-inbox-accent focus-visible:ring-iui-inbox-ring focus-visible:ring-offset-iui-inbox-surface relative inline-flex h-5 w-9 shrink-0 items-center rounded-full focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-hidden aria-disabled:cursor-default aria-disabled:opacity-50 forced-colors:border motion-safe:transition-colors",
|
|
4776
|
+
className: G("group/switch bg-iui-inbox-icon aria-checked:bg-iui-inbox-accent focus-visible:ring-iui-inbox-ring focus-visible:ring-offset-iui-inbox-surface relative inline-flex h-5 w-9 shrink-0 items-center rounded-full focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-hidden aria-disabled:cursor-default aria-disabled:opacity-50 forced-colors:border motion-safe:transition-colors", r.switch),
|
|
4760
4777
|
onClick: () => void v(e.key, !e.enabled),
|
|
4761
4778
|
children: /* @__PURE__ */ D("span", {
|
|
4762
4779
|
"aria-hidden": "true",
|
|
@@ -4775,65 +4792,65 @@ function Xa({ labels: e, classes: t = {}, locale: n, renderCategory: r, renderGr
|
|
|
4775
4792
|
children: /* @__PURE__ */ D("th", {
|
|
4776
4793
|
scope: "rowgroup",
|
|
4777
4794
|
colSpan: M.columns,
|
|
4778
|
-
className: G("bg-iui-inbox-control-hover/50 px-4 pt-4 pb-2 text-start font-normal",
|
|
4779
|
-
children:
|
|
4795
|
+
className: G("bg-iui-inbox-control-hover/50 px-4 pt-4 pb-2 text-start font-normal", r.group),
|
|
4796
|
+
children: c ? c(e.group) : /* @__PURE__ */ O(E, { children: [/* @__PURE__ */ D("span", {
|
|
4780
4797
|
className: "text-iui-inbox-foreground font-semibold",
|
|
4781
4798
|
children: e.group.label
|
|
4782
4799
|
}), e.group.description && /* @__PURE__ */ D("span", {
|
|
4783
|
-
className: G("text-iui-inbox-muted-foreground mt-0.5 block",
|
|
4800
|
+
className: G("text-iui-inbox-muted-foreground mt-0.5 block", r.description),
|
|
4784
4801
|
children: e.group.description
|
|
4785
4802
|
})] })
|
|
4786
4803
|
})
|
|
4787
4804
|
}), e.categories.map((e) => /* @__PURE__ */ O("tr", {
|
|
4788
4805
|
"data-inbox-preference-category": e.key,
|
|
4789
|
-
className: G(
|
|
4806
|
+
className: G(Hi, r.row),
|
|
4790
4807
|
children: [
|
|
4791
4808
|
/* @__PURE__ */ D("th", {
|
|
4792
4809
|
scope: "row",
|
|
4793
|
-
className:
|
|
4794
|
-
children:
|
|
4810
|
+
className: Ui,
|
|
4811
|
+
children: a ? a(e) : /* @__PURE__ */ O(E, { children: [
|
|
4795
4812
|
/* @__PURE__ */ D("span", {
|
|
4796
|
-
className: G(
|
|
4813
|
+
className: G(Wi, r.label),
|
|
4797
4814
|
children: e.label
|
|
4798
4815
|
}),
|
|
4799
4816
|
e.locked && /* @__PURE__ */ D("span", {
|
|
4800
|
-
className: G("bg-iui-inbox-control-hover text-iui-inbox-muted-foreground inline-block rounded-full px-2 py-0.5 text-xs font-medium whitespace-nowrap",
|
|
4817
|
+
className: G("bg-iui-inbox-control-hover text-iui-inbox-muted-foreground inline-block rounded-full px-2 py-0.5 text-xs font-medium whitespace-nowrap", r.badge),
|
|
4801
4818
|
children: j("locked")
|
|
4802
4819
|
}),
|
|
4803
4820
|
e.description && /* @__PURE__ */ D("span", {
|
|
4804
|
-
className: G("text-iui-inbox-muted-foreground mt-0.5 block",
|
|
4821
|
+
className: G("text-iui-inbox-muted-foreground mt-0.5 block", r.description),
|
|
4805
4822
|
children: e.description
|
|
4806
4823
|
})
|
|
4807
4824
|
] })
|
|
4808
4825
|
}),
|
|
4809
|
-
|
|
4810
|
-
className:
|
|
4811
|
-
children: e.channels[
|
|
4826
|
+
f.map((t) => /* @__PURE__ */ D("td", {
|
|
4827
|
+
className: Gi,
|
|
4828
|
+
children: e.channels[t.key] !== void 0 && /* @__PURE__ */ D("button", {
|
|
4812
4829
|
type: "button",
|
|
4813
4830
|
role: "switch",
|
|
4814
|
-
"aria-checked": x(e,
|
|
4815
|
-
"aria-disabled": C(e,
|
|
4831
|
+
"aria-checked": x(e, t),
|
|
4832
|
+
"aria-disabled": C(e, t) || void 0,
|
|
4816
4833
|
"aria-label": Z(A.toggle, {
|
|
4817
4834
|
category: e.label,
|
|
4818
|
-
channel:
|
|
4835
|
+
channel: t.label
|
|
4819
4836
|
}),
|
|
4820
|
-
"data-inbox-preference": `${e.key}.${
|
|
4821
|
-
className: G("group/switch bg-iui-inbox-icon aria-checked:bg-iui-inbox-accent focus-visible:ring-iui-inbox-ring focus-visible:ring-offset-iui-inbox-surface relative inline-flex h-5 w-9 shrink-0 items-center rounded-full focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-hidden aria-disabled:cursor-default aria-disabled:opacity-50 forced-colors:border motion-safe:transition-colors",
|
|
4822
|
-
onClick: () =>
|
|
4837
|
+
"data-inbox-preference": `${e.key}.${t.key}`,
|
|
4838
|
+
className: G("group/switch bg-iui-inbox-icon aria-checked:bg-iui-inbox-accent focus-visible:ring-iui-inbox-ring focus-visible:ring-offset-iui-inbox-surface relative inline-flex h-5 w-9 shrink-0 items-center rounded-full focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-hidden aria-disabled:cursor-default aria-disabled:opacity-50 forced-colors:border motion-safe:transition-colors", r.switch),
|
|
4839
|
+
onClick: () => jn(e, t, f),
|
|
4823
4840
|
children: /* @__PURE__ */ D("span", {
|
|
4824
4841
|
"aria-hidden": "true",
|
|
4825
4842
|
className: "bg-iui-inbox-surface ms-0.5 size-4 rounded-full shadow-sm forced-color-adjust-none group-aria-checked/switch:translate-x-4 forced-colors:bg-[ButtonText] forced-colors:group-aria-checked/switch:bg-[Highlight] motion-safe:transition-transform rtl:group-aria-checked/switch:-translate-x-4"
|
|
4826
4843
|
})
|
|
4827
4844
|
})
|
|
4828
|
-
},
|
|
4845
|
+
}, t.key)),
|
|
4829
4846
|
M.hasFrequencies && /* @__PURE__ */ D("td", {
|
|
4830
4847
|
className: "px-4 py-3 text-start align-middle",
|
|
4831
4848
|
children: e.frequency !== null && /* @__PURE__ */ D("select", {
|
|
4832
4849
|
value: e.frequency,
|
|
4833
|
-
disabled: !S(e,
|
|
4850
|
+
disabled: !S(e, f),
|
|
4834
4851
|
"aria-label": Z(A.frequencyLabel, { category: e.label }),
|
|
4835
4852
|
"data-inbox-preference-frequency": e.key,
|
|
4836
|
-
className: G("rounded-iui-inbox border-iui-inbox-border bg-iui-inbox-surface text-iui-inbox-foreground focus-visible:ring-iui-inbox-ring min-w-full border px-2 py-1 text-sm focus-visible:ring-2 focus-visible:outline-hidden disabled:cursor-default disabled:opacity-50",
|
|
4853
|
+
className: G("rounded-iui-inbox border-iui-inbox-border bg-iui-inbox-surface text-iui-inbox-foreground focus-visible:ring-iui-inbox-ring min-w-full border px-2 py-1 text-sm focus-visible:ring-2 focus-visible:outline-hidden disabled:cursor-default disabled:opacity-50", r.select),
|
|
4837
4854
|
onChange: (t) => void y(e.key, t.target.value),
|
|
4838
4855
|
children: M.frequencyOptions.map((e) => /* @__PURE__ */ D("option", {
|
|
4839
4856
|
value: e.value,
|
|
@@ -4857,16 +4874,16 @@ function Xa({ labels: e, classes: t = {}, locale: n, renderCategory: r, renderGr
|
|
|
4857
4874
|
children: [/* @__PURE__ */ O("div", {
|
|
4858
4875
|
className: "min-w-0 grow basis-64",
|
|
4859
4876
|
children: [/* @__PURE__ */ D("span", {
|
|
4860
|
-
className: G("text-iui-inbox-foreground font-medium",
|
|
4877
|
+
className: G("text-iui-inbox-foreground font-medium", r.label),
|
|
4861
4878
|
children: j("pushDevice")
|
|
4862
4879
|
}), /* @__PURE__ */ D("div", {
|
|
4863
4880
|
"aria-live": "polite",
|
|
4864
4881
|
"data-inbox-push-device-status": "",
|
|
4865
4882
|
children: N.hint ? /* @__PURE__ */ D("p", {
|
|
4866
|
-
className: G("bg-iui-inbox-control-hover text-iui-inbox-foreground mt-2 rounded-md px-3 py-2",
|
|
4883
|
+
className: G("bg-iui-inbox-control-hover text-iui-inbox-foreground mt-2 rounded-md px-3 py-2", r.description),
|
|
4867
4884
|
children: j(N.text)
|
|
4868
4885
|
}) : /* @__PURE__ */ D("span", {
|
|
4869
|
-
className: G("text-iui-inbox-muted-foreground mt-0.5 block",
|
|
4886
|
+
className: G("text-iui-inbox-muted-foreground mt-0.5 block", r.description),
|
|
4870
4887
|
children: j(N.text)
|
|
4871
4888
|
})
|
|
4872
4889
|
})]
|
|
@@ -4875,7 +4892,7 @@ function Xa({ labels: e, classes: t = {}, locale: n, renderCategory: r, renderGr
|
|
|
4875
4892
|
"aria-disabled": N.state === "busy" || void 0,
|
|
4876
4893
|
"data-inbox-push-device-button": "",
|
|
4877
4894
|
className: G(N.button.primary ? "rounded-md focus-visible:ring-iui-inbox-ring inline-flex items-center gap-1.5 px-2.5 py-1.5 text-xs font-medium focus-visible:ring-2 focus-visible:outline-hidden aria-disabled:cursor-default aria-disabled:opacity-60 border-iui-inbox-accent text-iui-inbox-accent hover:bg-iui-inbox-accent-subtle border" : "rounded-md focus-visible:ring-iui-inbox-ring inline-flex items-center gap-1.5 px-2.5 py-1.5 text-xs font-medium focus-visible:ring-2 focus-visible:outline-hidden aria-disabled:cursor-default aria-disabled:opacity-60 border-iui-inbox-border bg-iui-inbox-surface hover:bg-iui-inbox-control-hover border", "shrink-0 whitespace-nowrap"),
|
|
4878
|
-
onClick: () =>
|
|
4895
|
+
onClick: () => Xn(N),
|
|
4879
4896
|
children: [N.state === "busy" && /* @__PURE__ */ D($, {
|
|
4880
4897
|
name: "spinner",
|
|
4881
4898
|
context: {
|
|
@@ -4901,10 +4918,10 @@ function Xa({ labels: e, classes: t = {}, locale: n, renderCategory: r, renderGr
|
|
|
4901
4918
|
children: [/* @__PURE__ */ O("div", {
|
|
4902
4919
|
className: "min-w-0 grow",
|
|
4903
4920
|
children: [/* @__PURE__ */ D("span", {
|
|
4904
|
-
className: G("text-iui-inbox-foreground font-medium",
|
|
4921
|
+
className: G("text-iui-inbox-foreground font-medium", r.label),
|
|
4905
4922
|
children: e.name
|
|
4906
4923
|
}), /* @__PURE__ */ D("span", {
|
|
4907
|
-
className: G("text-iui-inbox-muted-foreground mt-0.5 block",
|
|
4924
|
+
className: G("text-iui-inbox-muted-foreground mt-0.5 block", r.description),
|
|
4908
4925
|
children: e.active
|
|
4909
4926
|
})]
|
|
4910
4927
|
}), /* @__PURE__ */ D("button", {
|
|
@@ -4912,7 +4929,7 @@ function Xa({ labels: e, classes: t = {}, locale: n, renderCategory: r, renderGr
|
|
|
4912
4929
|
"aria-label": e.removeLabel,
|
|
4913
4930
|
"data-inbox-push-other-device-remove": "",
|
|
4914
4931
|
className: G("rounded-md focus-visible:ring-iui-inbox-ring inline-flex items-center gap-1.5 px-2.5 py-1.5 text-xs font-medium focus-visible:ring-2 focus-visible:outline-hidden aria-disabled:cursor-default aria-disabled:opacity-60 border-iui-inbox-border bg-iui-inbox-surface hover:bg-iui-inbox-control-hover border", "shrink-0 whitespace-nowrap"),
|
|
4915
|
-
onClick: () => void
|
|
4932
|
+
onClick: () => void Jn.removeDevice(e.id),
|
|
4916
4933
|
children: j("pushDeviceRemove")
|
|
4917
4934
|
})]
|
|
4918
4935
|
}, e.id))
|
|
@@ -4930,24 +4947,24 @@ function Xa({ labels: e, classes: t = {}, locale: n, renderCategory: r, renderGr
|
|
|
4930
4947
|
"aria-checked": h.enabled,
|
|
4931
4948
|
"aria-label": j("notificationHours"),
|
|
4932
4949
|
"data-inbox-notification-hours": "",
|
|
4933
|
-
className: G("group/switch bg-iui-inbox-icon aria-checked:bg-iui-inbox-accent focus-visible:ring-iui-inbox-ring focus-visible:ring-offset-iui-inbox-surface relative inline-flex h-5 w-9 shrink-0 items-center rounded-full focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-hidden aria-disabled:cursor-default aria-disabled:opacity-50 forced-colors:border motion-safe:transition-colors",
|
|
4950
|
+
className: G("group/switch bg-iui-inbox-icon aria-checked:bg-iui-inbox-accent focus-visible:ring-iui-inbox-ring focus-visible:ring-offset-iui-inbox-surface relative inline-flex h-5 w-9 shrink-0 items-center rounded-full focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-hidden aria-disabled:cursor-default aria-disabled:opacity-50 forced-colors:border motion-safe:transition-colors", r.switch),
|
|
4934
4951
|
onClick: () => void b({ enabled: !h.enabled }),
|
|
4935
4952
|
children: /* @__PURE__ */ D("span", {
|
|
4936
4953
|
"aria-hidden": "true",
|
|
4937
4954
|
className: "bg-iui-inbox-surface ms-0.5 size-4 rounded-full shadow-sm forced-color-adjust-none group-aria-checked/switch:translate-x-4 forced-colors:bg-[ButtonText] forced-colors:group-aria-checked/switch:bg-[Highlight] motion-safe:transition-transform rtl:group-aria-checked/switch:-translate-x-4"
|
|
4938
4955
|
})
|
|
4939
4956
|
}), /* @__PURE__ */ O("div", { children: [/* @__PURE__ */ D("span", {
|
|
4940
|
-
className: G("text-iui-inbox-foreground font-medium",
|
|
4957
|
+
className: G("text-iui-inbox-foreground font-medium", r.label),
|
|
4941
4958
|
children: j("notificationHours")
|
|
4942
4959
|
}), /* @__PURE__ */ D("span", {
|
|
4943
|
-
className: G("text-iui-inbox-muted-foreground mt-0.5 block",
|
|
4960
|
+
className: G("text-iui-inbox-muted-foreground mt-0.5 block", r.description),
|
|
4944
4961
|
children: j("notificationHoursDescription")
|
|
4945
4962
|
})] })]
|
|
4946
4963
|
}), /* @__PURE__ */ D("div", {
|
|
4947
4964
|
className: "mt-3 flex flex-col gap-3 sm:gap-2",
|
|
4948
|
-
children:
|
|
4965
|
+
children: _n(h, T, i).map(({ day: e, name: t, ranges: n, locked: i, canAdd: a }) => /* @__PURE__ */ O("div", {
|
|
4949
4966
|
role: "group",
|
|
4950
|
-
"aria-label":
|
|
4967
|
+
"aria-label": t,
|
|
4951
4968
|
"data-inbox-notification-hours-day": e,
|
|
4952
4969
|
className: "flex flex-wrap items-start gap-x-4 gap-y-2",
|
|
4953
4970
|
onBlur: (e) => {
|
|
@@ -4958,11 +4975,11 @@ function Xa({ labels: e, classes: t = {}, locale: n, renderCategory: r, renderGr
|
|
|
4958
4975
|
children: [/* @__PURE__ */ D("button", {
|
|
4959
4976
|
type: "button",
|
|
4960
4977
|
role: "switch",
|
|
4961
|
-
"aria-checked":
|
|
4978
|
+
"aria-checked": n.length > 0,
|
|
4962
4979
|
"aria-disabled": i || void 0,
|
|
4963
|
-
"aria-label": Z(A.notificationHoursDay, { day:
|
|
4980
|
+
"aria-label": Z(A.notificationHoursDay, { day: t }),
|
|
4964
4981
|
"data-inbox-notification-hours-day-switch": "",
|
|
4965
|
-
className: G("group/switch bg-iui-inbox-icon aria-checked:bg-iui-inbox-accent focus-visible:ring-iui-inbox-ring focus-visible:ring-offset-iui-inbox-surface relative inline-flex h-5 w-9 shrink-0 items-center rounded-full focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-hidden aria-disabled:cursor-default aria-disabled:opacity-50 forced-colors:border motion-safe:transition-colors",
|
|
4982
|
+
className: G("group/switch bg-iui-inbox-icon aria-checked:bg-iui-inbox-accent focus-visible:ring-iui-inbox-ring focus-visible:ring-offset-iui-inbox-surface relative inline-flex h-5 w-9 shrink-0 items-center rounded-full focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-hidden aria-disabled:cursor-default aria-disabled:opacity-50 forced-colors:border motion-safe:transition-colors", r.switch),
|
|
4966
4983
|
onClick: () => z({
|
|
4967
4984
|
kind: "toggle",
|
|
4968
4985
|
day: e
|
|
@@ -4971,10 +4988,10 @@ function Xa({ labels: e, classes: t = {}, locale: n, renderCategory: r, renderGr
|
|
|
4971
4988
|
"aria-hidden": "true",
|
|
4972
4989
|
className: "bg-iui-inbox-surface ms-0.5 size-4 rounded-full shadow-sm forced-color-adjust-none group-aria-checked/switch:translate-x-4 forced-colors:bg-[ButtonText] forced-colors:group-aria-checked/switch:bg-[Highlight] motion-safe:transition-transform rtl:group-aria-checked/switch:-translate-x-4"
|
|
4973
4990
|
})
|
|
4974
|
-
}), /* @__PURE__ */ D("span", { children:
|
|
4975
|
-
}),
|
|
4991
|
+
}), /* @__PURE__ */ D("span", { children: t })]
|
|
4992
|
+
}), n.length > 0 ? /* @__PURE__ */ D("div", {
|
|
4976
4993
|
className: "flex min-w-0 grow basis-60 flex-col items-start gap-2",
|
|
4977
|
-
children:
|
|
4994
|
+
children: n.map(([i, o], s) => /* @__PURE__ */ O("div", {
|
|
4978
4995
|
className: "flex flex-wrap items-center gap-x-3 gap-y-2",
|
|
4979
4996
|
children: [
|
|
4980
4997
|
/* @__PURE__ */ O("label", {
|
|
@@ -4988,7 +5005,7 @@ function Xa({ labels: e, classes: t = {}, locale: n, renderCategory: r, renderGr
|
|
|
4988
5005
|
value: i,
|
|
4989
5006
|
disabled: !h.enabled,
|
|
4990
5007
|
"data-inbox-notification-hours-start": "",
|
|
4991
|
-
className: G("rounded-iui-inbox border-iui-inbox-border bg-iui-inbox-surface text-iui-inbox-foreground focus-visible:ring-iui-inbox-ring border px-2 py-1 text-sm focus-visible:ring-2 focus-visible:outline-hidden disabled:cursor-default disabled:opacity-50",
|
|
5008
|
+
className: G("rounded-iui-inbox border-iui-inbox-border bg-iui-inbox-surface text-iui-inbox-foreground focus-visible:ring-iui-inbox-ring border px-2 py-1 text-sm focus-visible:ring-2 focus-visible:outline-hidden disabled:cursor-default disabled:opacity-50", r.time),
|
|
4992
5009
|
onChange: (t) => z({
|
|
4993
5010
|
kind: "time",
|
|
4994
5011
|
day: e,
|
|
@@ -5014,7 +5031,7 @@ function Xa({ labels: e, classes: t = {}, locale: n, renderCategory: r, renderGr
|
|
|
5014
5031
|
value: o,
|
|
5015
5032
|
disabled: !h.enabled,
|
|
5016
5033
|
"data-inbox-notification-hours-end": "",
|
|
5017
|
-
className: G("rounded-iui-inbox border-iui-inbox-border bg-iui-inbox-surface text-iui-inbox-foreground focus-visible:ring-iui-inbox-ring border px-2 py-1 text-sm focus-visible:ring-2 focus-visible:outline-hidden disabled:cursor-default disabled:opacity-50",
|
|
5034
|
+
className: G("rounded-iui-inbox border-iui-inbox-border bg-iui-inbox-surface text-iui-inbox-foreground focus-visible:ring-iui-inbox-ring border px-2 py-1 text-sm focus-visible:ring-2 focus-visible:outline-hidden disabled:cursor-default disabled:opacity-50", r.time),
|
|
5018
5035
|
onChange: (t) => z({
|
|
5019
5036
|
kind: "time",
|
|
5020
5037
|
day: e,
|
|
@@ -5024,13 +5041,13 @@ function Xa({ labels: e, classes: t = {}, locale: n, renderCategory: r, renderGr
|
|
|
5024
5041
|
})
|
|
5025
5042
|
})]
|
|
5026
5043
|
}),
|
|
5027
|
-
|
|
5044
|
+
n.length > 1 && /* @__PURE__ */ D("button", {
|
|
5028
5045
|
type: "button",
|
|
5029
5046
|
disabled: !h.enabled,
|
|
5030
5047
|
"aria-label": Z(A.notificationHoursRemoveLabel, {
|
|
5031
5048
|
start: i,
|
|
5032
5049
|
end: o,
|
|
5033
|
-
day:
|
|
5050
|
+
day: t
|
|
5034
5051
|
}),
|
|
5035
5052
|
"data-inbox-notification-hours-remove": "",
|
|
5036
5053
|
className: "text-iui-inbox-muted-foreground -ms-2 hover:bg-iui-inbox-control-hover hover:text-iui-inbox-foreground focus-visible:ring-iui-inbox-ring rounded-md px-2 py-1 text-xs font-medium focus-visible:ring-2 focus-visible:outline-hidden disabled:cursor-default disabled:opacity-50 disabled:hover:bg-transparent disabled:hover:text-iui-inbox-muted-foreground",
|
|
@@ -5041,10 +5058,10 @@ function Xa({ labels: e, classes: t = {}, locale: n, renderCategory: r, renderGr
|
|
|
5041
5058
|
}),
|
|
5042
5059
|
children: j("notificationHoursRemove")
|
|
5043
5060
|
}),
|
|
5044
|
-
s ===
|
|
5061
|
+
s === n.length - 1 && /* @__PURE__ */ D("button", {
|
|
5045
5062
|
type: "button",
|
|
5046
5063
|
disabled: !a,
|
|
5047
|
-
"aria-label": Z(A.notificationHoursAddLabel, { day:
|
|
5064
|
+
"aria-label": Z(A.notificationHoursAddLabel, { day: t }),
|
|
5048
5065
|
"data-inbox-notification-hours-add": "",
|
|
5049
5066
|
className: "text-iui-inbox-muted-foreground -ms-2 hover:bg-iui-inbox-control-hover hover:text-iui-inbox-foreground focus-visible:ring-iui-inbox-ring rounded-md px-2 py-1 text-xs font-medium focus-visible:ring-2 focus-visible:outline-hidden disabled:cursor-default disabled:opacity-50 disabled:hover:bg-transparent disabled:hover:text-iui-inbox-muted-foreground",
|
|
5050
5067
|
onClick: () => z({
|
|
@@ -5066,33 +5083,34 @@ function Xa({ labels: e, classes: t = {}, locale: n, renderCategory: r, renderGr
|
|
|
5066
5083
|
});
|
|
5067
5084
|
}
|
|
5068
5085
|
// src/useNotifications.ts
|
|
5069
|
-
function
|
|
5070
|
-
let { props: e } =
|
|
5071
|
-
return
|
|
5072
|
-
|
|
5086
|
+
function $a() {
|
|
5087
|
+
let { props: e } = T(), t = s(X.subscribe, X.getSnapshot, X.getServerSnapshot);
|
|
5088
|
+
return r(() => {
|
|
5089
|
+
qi(), _t(e);
|
|
5073
5090
|
}, []), {
|
|
5074
5091
|
...t,
|
|
5075
|
-
...
|
|
5076
|
-
toast:
|
|
5092
|
+
...gt,
|
|
5093
|
+
toast: Hr
|
|
5077
5094
|
};
|
|
5078
5095
|
}
|
|
5079
5096
|
// src/useToasts.ts
|
|
5080
|
-
var
|
|
5081
|
-
function
|
|
5082
|
-
|
|
5083
|
-
|
|
5084
|
-
|
|
5085
|
-
|
|
5086
|
-
|
|
5087
|
-
|
|
5097
|
+
var eo = [], to = (e, t, n) => n ? Ir(e, t, n.nativeEvent) : Fr(e, t);
|
|
5098
|
+
function no(e) {
|
|
5099
|
+
Ji();
|
|
5100
|
+
let t = s(Q.subscribe, Q.getSnapshot, () => eo);
|
|
5101
|
+
s(Q.subscribe, or, () => 0);
|
|
5102
|
+
let n = i(() => t.filter((t) => t.toaster === e), [t, e]), [a] = o(cr);
|
|
5103
|
+
return r(() => Q.attach(e), [e]), r(() => a.release, []), {
|
|
5104
|
+
toasts: n,
|
|
5105
|
+
toast: Hr,
|
|
5088
5106
|
update: Q.update,
|
|
5089
5107
|
dismiss: Q.dismiss,
|
|
5090
|
-
pause:
|
|
5091
|
-
resume:
|
|
5108
|
+
pause: a.pause,
|
|
5109
|
+
resume: a.resume,
|
|
5092
5110
|
timer: Q.timer,
|
|
5093
|
-
runAction:
|
|
5111
|
+
runAction: to
|
|
5094
5112
|
};
|
|
5095
5113
|
}
|
|
5096
5114
|
// src/iconResolver.ts
|
|
5097
|
-
var
|
|
5098
|
-
export {
|
|
5115
|
+
var ro = _e, io = ve;
|
|
5116
|
+
export { xr as DEFAULT_ERROR_MESSAGES, wt as DEFAULT_INBOX_LABELS, En as DEFAULT_PREFERENCES_LABELS, Ka as NotificationCenter, Ha as NotificationItem, qa as NotificationList, Qa as NotificationPreferences, ta as Toaster, ct as groupItems, X as inboxStore, qi as initNotifications, Re as isSnoozed, ft as pauseEnd, mt as pauseTime, kn as preferencesStore, xt as relativeTime, Vt as requestNotificationPermission, io as resolveIcon, ro as setIconResolver, Se as setTranslations, lt as snoozeOptions, Hr as toast, Te as trans, $a as useNotifications, Ya as usePreferences, Za as usePush, no as useToasts };
|