@facto-to/notifications 0.0.0-stage → 0.1.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +204 -0
- package/README.md +53 -2
- package/dist/core.d.ts +397 -0
- package/dist/core.js +1106 -0
- package/dist/react.d.ts +311 -0
- package/dist/react.js +414 -0
- package/dist/styles.css +1 -0
- package/dist/ui.d.ts +335 -0
- package/dist/ui.js +1124 -0
- package/package.json +88 -4
package/dist/react.js
ADDED
|
@@ -0,0 +1,414 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as H } from "react/jsx-runtime";
|
|
3
|
+
import { useState as A, useRef as v, useCallback as C, useEffect as q, useMemo as j, useContext as F, createContext as z } from "react";
|
|
4
|
+
import { createRealtimeStream as J } from "./core.js";
|
|
5
|
+
function U(e) {
|
|
6
|
+
let a = 0;
|
|
7
|
+
for (const i of e)
|
|
8
|
+
i.unread && (a += 1);
|
|
9
|
+
return a;
|
|
10
|
+
}
|
|
11
|
+
function h(e, a = !0) {
|
|
12
|
+
return {
|
|
13
|
+
scopeKey: e,
|
|
14
|
+
items: [],
|
|
15
|
+
unreadCount: 0,
|
|
16
|
+
hasExplicitUnreadCount: !1,
|
|
17
|
+
nextCursor: null,
|
|
18
|
+
loading: a,
|
|
19
|
+
loadingMore: !1,
|
|
20
|
+
error: null,
|
|
21
|
+
streamStatus: "idle",
|
|
22
|
+
sessionRevoked: !1,
|
|
23
|
+
revokedReason: null,
|
|
24
|
+
lastEnvelope: null
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
function Q(e, a) {
|
|
28
|
+
const i = e.findIndex((t) => a.aggregationKey && t.aggregationKey === a.aggregationKey ? !0 : t.id === a.id);
|
|
29
|
+
if (i === -1)
|
|
30
|
+
return {
|
|
31
|
+
items: [a, ...e],
|
|
32
|
+
unreadDelta: a.unread ? 1 : 0,
|
|
33
|
+
replaced: !1
|
|
34
|
+
};
|
|
35
|
+
const f = e[i], y = [
|
|
36
|
+
a,
|
|
37
|
+
...e.slice(0, i),
|
|
38
|
+
...e.slice(i + 1)
|
|
39
|
+
], o = (a.unread ? 1 : 0) - (f.unread ? 1 : 0);
|
|
40
|
+
return {
|
|
41
|
+
items: y,
|
|
42
|
+
unreadDelta: o,
|
|
43
|
+
replaced: !0
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
function k(e, a) {
|
|
47
|
+
const { items: i, unreadDelta: f } = Q(e.items, a), y = e.hasExplicitUnreadCount ? Math.max(0, e.unreadCount + f) : U(i);
|
|
48
|
+
return {
|
|
49
|
+
...e,
|
|
50
|
+
items: i,
|
|
51
|
+
unreadCount: y
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
function O(e, a, i) {
|
|
55
|
+
let f;
|
|
56
|
+
if (!i)
|
|
57
|
+
f = [...a.items];
|
|
58
|
+
else {
|
|
59
|
+
const t = new Set(e.items.map((p) => p.id)), K = new Set(
|
|
60
|
+
e.items.map((p) => p.aggregationKey).filter((p) => !!p)
|
|
61
|
+
), m = a.items.filter((p) => !(t.has(p.id) || p.aggregationKey && K.has(p.aggregationKey)));
|
|
62
|
+
f = [...e.items, ...m];
|
|
63
|
+
}
|
|
64
|
+
const y = typeof a.unreadCount == "number", o = y ? Math.max(0, a.unreadCount) : U(f);
|
|
65
|
+
return {
|
|
66
|
+
...e,
|
|
67
|
+
items: f,
|
|
68
|
+
unreadCount: o,
|
|
69
|
+
hasExplicitUnreadCount: y,
|
|
70
|
+
nextCursor: a.nextCursor ?? null,
|
|
71
|
+
loading: !1,
|
|
72
|
+
loadingMore: !1,
|
|
73
|
+
error: null
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
function V(e, a) {
|
|
77
|
+
let i = !1, f = !1;
|
|
78
|
+
const y = e.items.map((t) => t.id !== a || !t.unread ? t : (i = !0, f = !0, { ...t, unread: !1 }));
|
|
79
|
+
if (!i) return e;
|
|
80
|
+
const o = e.hasExplicitUnreadCount ? Math.max(0, e.unreadCount - (f ? 1 : 0)) : U(y);
|
|
81
|
+
return {
|
|
82
|
+
...e,
|
|
83
|
+
items: y,
|
|
84
|
+
unreadCount: o
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
function W(e) {
|
|
88
|
+
const a = e.items.map(
|
|
89
|
+
(i) => i.unread ? { ...i, unread: !1 } : i
|
|
90
|
+
);
|
|
91
|
+
return {
|
|
92
|
+
...e,
|
|
93
|
+
items: a,
|
|
94
|
+
unreadCount: 0
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
function P(e, a, i) {
|
|
98
|
+
let f = !1, y = 0;
|
|
99
|
+
const o = e.items.map((K) => {
|
|
100
|
+
if (K.id !== a) return K;
|
|
101
|
+
f = !0;
|
|
102
|
+
const m = { ...K, ...i };
|
|
103
|
+
return y = (m.unread ? 1 : 0) - (K.unread ? 1 : 0), m;
|
|
104
|
+
});
|
|
105
|
+
if (!f) return e;
|
|
106
|
+
const t = e.hasExplicitUnreadCount ? Math.max(0, e.unreadCount + y) : U(o);
|
|
107
|
+
return {
|
|
108
|
+
...e,
|
|
109
|
+
items: o,
|
|
110
|
+
unreadCount: t
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
const G = z(null);
|
|
114
|
+
function $({
|
|
115
|
+
adapter: e,
|
|
116
|
+
children: a,
|
|
117
|
+
currentOperator: i,
|
|
118
|
+
onActionError: f
|
|
119
|
+
}) {
|
|
120
|
+
const [y, o] = A(
|
|
121
|
+
() => h(e.scopeKey, !0)
|
|
122
|
+
), t = v(e);
|
|
123
|
+
t.current = e;
|
|
124
|
+
const K = v(f);
|
|
125
|
+
K.current = f;
|
|
126
|
+
const m = v(i);
|
|
127
|
+
m.current = i;
|
|
128
|
+
const p = e.scopeKey, u = v(0), E = v(/* @__PURE__ */ new Set()), g = y.scopeKey === p ? y : h(p, !0), x = v(g);
|
|
129
|
+
x.current = g;
|
|
130
|
+
const M = C((c) => {
|
|
131
|
+
for (const r of E.current)
|
|
132
|
+
r(c);
|
|
133
|
+
}, []), b = C(async () => {
|
|
134
|
+
const c = t.current.scopeKey, r = u.current;
|
|
135
|
+
o((l) => {
|
|
136
|
+
const s = l.scopeKey === c ? l : h(c, !0);
|
|
137
|
+
return {
|
|
138
|
+
...s,
|
|
139
|
+
loading: s.items.length === 0,
|
|
140
|
+
error: null
|
|
141
|
+
};
|
|
142
|
+
});
|
|
143
|
+
try {
|
|
144
|
+
const l = await t.current.list();
|
|
145
|
+
if (u.current !== r || t.current.scopeKey !== c)
|
|
146
|
+
return;
|
|
147
|
+
o((s) => {
|
|
148
|
+
const n = s.scopeKey === c ? s : h(c, !1);
|
|
149
|
+
return O(n, l, !1);
|
|
150
|
+
});
|
|
151
|
+
} catch (l) {
|
|
152
|
+
if (u.current !== r || t.current.scopeKey !== c)
|
|
153
|
+
return;
|
|
154
|
+
o((s) => ({
|
|
155
|
+
...s.scopeKey === c ? s : h(c, !1),
|
|
156
|
+
loading: !1,
|
|
157
|
+
loadingMore: !1,
|
|
158
|
+
error: l
|
|
159
|
+
}));
|
|
160
|
+
}
|
|
161
|
+
}, []), I = C(async () => {
|
|
162
|
+
const c = x.current;
|
|
163
|
+
if (!c.nextCursor || c.loading || c.loadingMore) return;
|
|
164
|
+
const r = t.current.scopeKey, l = u.current, s = c.nextCursor;
|
|
165
|
+
o(
|
|
166
|
+
(n) => n.scopeKey === r ? { ...n, loadingMore: !0 } : n
|
|
167
|
+
);
|
|
168
|
+
try {
|
|
169
|
+
const n = await t.current.list(s);
|
|
170
|
+
if (u.current !== l || t.current.scopeKey !== r)
|
|
171
|
+
return;
|
|
172
|
+
o(
|
|
173
|
+
(d) => d.scopeKey === r ? O(d, n, !0) : d
|
|
174
|
+
);
|
|
175
|
+
} catch (n) {
|
|
176
|
+
if (u.current !== l || t.current.scopeKey !== r)
|
|
177
|
+
return;
|
|
178
|
+
o(
|
|
179
|
+
(d) => d.scopeKey === r ? { ...d, loadingMore: !1, error: n } : d
|
|
180
|
+
);
|
|
181
|
+
}
|
|
182
|
+
}, []), w = C((c) => {
|
|
183
|
+
const r = t.current.scopeKey;
|
|
184
|
+
o((l) => {
|
|
185
|
+
const s = l.scopeKey === r ? l : h(r, !1);
|
|
186
|
+
return k(s, c);
|
|
187
|
+
});
|
|
188
|
+
}, []), T = C(async (c) => {
|
|
189
|
+
const r = t.current.scopeKey, l = u.current, s = x.current;
|
|
190
|
+
o(
|
|
191
|
+
(n) => n.scopeKey === r ? V(n, c) : n
|
|
192
|
+
);
|
|
193
|
+
try {
|
|
194
|
+
await t.current.markRead?.(c);
|
|
195
|
+
} catch (n) {
|
|
196
|
+
u.current === l && t.current.scopeKey === r && (o({ ...s, error: n }), K.current?.(n));
|
|
197
|
+
}
|
|
198
|
+
}, []), L = C(async () => {
|
|
199
|
+
const c = t.current.scopeKey, r = u.current, l = x.current;
|
|
200
|
+
o(
|
|
201
|
+
(s) => s.scopeKey === c ? W(s) : s
|
|
202
|
+
);
|
|
203
|
+
try {
|
|
204
|
+
await t.current.markAllRead?.();
|
|
205
|
+
} catch (s) {
|
|
206
|
+
u.current === r && t.current.scopeKey === c && (o({ ...l, error: s }), K.current?.(s));
|
|
207
|
+
}
|
|
208
|
+
}, []), D = C(async (c) => {
|
|
209
|
+
const r = t.current.scopeKey, l = u.current, s = x.current;
|
|
210
|
+
o(
|
|
211
|
+
(n) => n.scopeKey === r ? P(n, c, {
|
|
212
|
+
claimStatus: "claimed",
|
|
213
|
+
claimedBy: m.current,
|
|
214
|
+
unread: !1
|
|
215
|
+
}) : n
|
|
216
|
+
);
|
|
217
|
+
try {
|
|
218
|
+
const n = await t.current.claim?.(c);
|
|
219
|
+
n && u.current === l && t.current.scopeKey === r && o(
|
|
220
|
+
(d) => d.scopeKey === r ? k(d, n) : d
|
|
221
|
+
);
|
|
222
|
+
} catch (n) {
|
|
223
|
+
u.current === l && t.current.scopeKey === r && (o({ ...s, error: n }), K.current?.(n));
|
|
224
|
+
}
|
|
225
|
+
}, []), N = C(async (c) => {
|
|
226
|
+
const r = t.current.scopeKey, l = u.current, s = x.current;
|
|
227
|
+
o(
|
|
228
|
+
(n) => n.scopeKey === r ? P(n, c, {
|
|
229
|
+
claimStatus: "resolved",
|
|
230
|
+
unread: !1
|
|
231
|
+
}) : n
|
|
232
|
+
);
|
|
233
|
+
try {
|
|
234
|
+
const n = await t.current.resolve?.(c);
|
|
235
|
+
n && u.current === l && t.current.scopeKey === r && o(
|
|
236
|
+
(d) => d.scopeKey === r ? k(d, n) : d
|
|
237
|
+
);
|
|
238
|
+
} catch (n) {
|
|
239
|
+
u.current === l && t.current.scopeKey === r && (o({ ...s, error: n }), K.current?.(n));
|
|
240
|
+
}
|
|
241
|
+
}, []), S = C(
|
|
242
|
+
(c) => (E.current.add(c), () => {
|
|
243
|
+
E.current.delete(c);
|
|
244
|
+
}),
|
|
245
|
+
[]
|
|
246
|
+
);
|
|
247
|
+
q(() => {
|
|
248
|
+
u.current += 1;
|
|
249
|
+
const c = u.current, r = p;
|
|
250
|
+
o(h(r, !0)), b();
|
|
251
|
+
const l = t.current.subscribe?.({
|
|
252
|
+
onEnvelope: (s) => {
|
|
253
|
+
if (u.current !== c || t.current.scopeKey !== r)
|
|
254
|
+
return;
|
|
255
|
+
s.invalidateKeys && s.invalidateKeys.length > 0 && t.current.onInvalidateKeys?.(s.invalidateKeys);
|
|
256
|
+
const n = t.current.mapEnvelopeToItem?.(s) ?? null;
|
|
257
|
+
o((d) => {
|
|
258
|
+
const B = d.scopeKey === r ? d : h(r, !1);
|
|
259
|
+
return { ...n ? k(B, n) : B, lastEnvelope: s };
|
|
260
|
+
}), M({ envelope: s, item: n });
|
|
261
|
+
},
|
|
262
|
+
onItem: (s) => {
|
|
263
|
+
u.current !== c || t.current.scopeKey !== r || (o((n) => {
|
|
264
|
+
const d = n.scopeKey === r ? n : h(r, !1);
|
|
265
|
+
return k(d, s);
|
|
266
|
+
}), M({ item: s }));
|
|
267
|
+
},
|
|
268
|
+
onLagged: () => {
|
|
269
|
+
u.current !== c || t.current.scopeKey !== r || b();
|
|
270
|
+
},
|
|
271
|
+
onResync: () => {
|
|
272
|
+
u.current !== c || t.current.scopeKey !== r || b();
|
|
273
|
+
},
|
|
274
|
+
onSessionRevoked: (s) => {
|
|
275
|
+
u.current !== c || t.current.scopeKey !== r || (o((n) => ({
|
|
276
|
+
...n.scopeKey === r ? n : h(r, !1),
|
|
277
|
+
streamStatus: "revoked",
|
|
278
|
+
sessionRevoked: !0,
|
|
279
|
+
revokedReason: s
|
|
280
|
+
})), t.current.onSessionRevoked?.(s));
|
|
281
|
+
},
|
|
282
|
+
onStatusChange: (s) => {
|
|
283
|
+
u.current !== c || t.current.scopeKey !== r || o((n) => {
|
|
284
|
+
const d = n.scopeKey === r ? n : h(r, !1);
|
|
285
|
+
return {
|
|
286
|
+
...d,
|
|
287
|
+
streamStatus: s,
|
|
288
|
+
sessionRevoked: d.sessionRevoked || s === "revoked"
|
|
289
|
+
};
|
|
290
|
+
});
|
|
291
|
+
}
|
|
292
|
+
});
|
|
293
|
+
return () => {
|
|
294
|
+
l?.();
|
|
295
|
+
};
|
|
296
|
+
}, [p, b, M]);
|
|
297
|
+
const R = j(
|
|
298
|
+
() => ({
|
|
299
|
+
scopeKey: g.scopeKey,
|
|
300
|
+
items: g.items,
|
|
301
|
+
unreadCount: g.unreadCount,
|
|
302
|
+
nextCursor: g.nextCursor,
|
|
303
|
+
loading: g.loading,
|
|
304
|
+
loadingMore: g.loadingMore,
|
|
305
|
+
error: g.error,
|
|
306
|
+
streamStatus: g.streamStatus,
|
|
307
|
+
sessionRevoked: g.sessionRevoked,
|
|
308
|
+
revokedReason: g.revokedReason,
|
|
309
|
+
lastEnvelope: g.lastEnvelope,
|
|
310
|
+
refresh: b,
|
|
311
|
+
loadMore: I,
|
|
312
|
+
markRead: T,
|
|
313
|
+
markAllRead: L,
|
|
314
|
+
claim: D,
|
|
315
|
+
resolve: N,
|
|
316
|
+
upsertItem: w,
|
|
317
|
+
subscribeLiveEvents: S
|
|
318
|
+
}),
|
|
319
|
+
[
|
|
320
|
+
g,
|
|
321
|
+
b,
|
|
322
|
+
I,
|
|
323
|
+
T,
|
|
324
|
+
L,
|
|
325
|
+
D,
|
|
326
|
+
N,
|
|
327
|
+
w,
|
|
328
|
+
S
|
|
329
|
+
]
|
|
330
|
+
);
|
|
331
|
+
return /* @__PURE__ */ H(G.Provider, { value: R, children: a });
|
|
332
|
+
}
|
|
333
|
+
function ee() {
|
|
334
|
+
const e = F(G);
|
|
335
|
+
if (!e)
|
|
336
|
+
throw new Error(
|
|
337
|
+
"useNotificationCenter must be used within a NotificationCenterProvider"
|
|
338
|
+
);
|
|
339
|
+
return e;
|
|
340
|
+
}
|
|
341
|
+
function te() {
|
|
342
|
+
return F(G);
|
|
343
|
+
}
|
|
344
|
+
function ne(e, a) {
|
|
345
|
+
const [i, f] = A("idle"), [y, o] = A(
|
|
346
|
+
e?.lastEventId
|
|
347
|
+
), t = v(null), K = v(e);
|
|
348
|
+
K.current = e;
|
|
349
|
+
const m = v(a);
|
|
350
|
+
m.current = a;
|
|
351
|
+
const p = !!(e && e.enabled !== !1), u = e?.url, E = e?.scopeKey, g = e?.multiTab, x = e?.credentials, M = e?.requireAuthHeader, b = e?.maxReconnectAttempts, I = e?.reconnectBaseDelayMs, w = e?.reconnectMaxDelayMs, T = e?.visibilityResyncThresholdMs, L = e?.lastEventId;
|
|
352
|
+
q(() => {
|
|
353
|
+
if (!p || !u || !K.current) {
|
|
354
|
+
f("idle");
|
|
355
|
+
return;
|
|
356
|
+
}
|
|
357
|
+
const N = K.current, S = J(N, {
|
|
358
|
+
onOpen: () => {
|
|
359
|
+
o(S.getLastEventId()), m.current.onOpen?.();
|
|
360
|
+
},
|
|
361
|
+
onFrame: (R) => {
|
|
362
|
+
R.id !== void 0 && o(R.id), m.current.onFrame(R);
|
|
363
|
+
},
|
|
364
|
+
onLagged: (R, c) => {
|
|
365
|
+
m.current.onLagged?.(R, c);
|
|
366
|
+
},
|
|
367
|
+
onSessionRevoked: (R) => {
|
|
368
|
+
m.current.onSessionRevoked?.(R);
|
|
369
|
+
},
|
|
370
|
+
onResync: (R) => {
|
|
371
|
+
m.current.onResync?.(R);
|
|
372
|
+
},
|
|
373
|
+
onStatusChange: (R) => {
|
|
374
|
+
f(R), m.current.onStatusChange?.(R);
|
|
375
|
+
},
|
|
376
|
+
onTransportError: (R) => {
|
|
377
|
+
m.current.onTransportError?.(R);
|
|
378
|
+
}
|
|
379
|
+
});
|
|
380
|
+
return t.current = S, f(S.getStatus()), o(S.getLastEventId()), () => {
|
|
381
|
+
t.current === S && (t.current = null), S.close();
|
|
382
|
+
};
|
|
383
|
+
}, [
|
|
384
|
+
p,
|
|
385
|
+
u,
|
|
386
|
+
E,
|
|
387
|
+
g,
|
|
388
|
+
x,
|
|
389
|
+
M,
|
|
390
|
+
b,
|
|
391
|
+
I,
|
|
392
|
+
w,
|
|
393
|
+
T,
|
|
394
|
+
L
|
|
395
|
+
]);
|
|
396
|
+
const D = C(() => {
|
|
397
|
+
t.current?.close();
|
|
398
|
+
}, []);
|
|
399
|
+
return { status: i, lastEventId: y, close: D };
|
|
400
|
+
}
|
|
401
|
+
export {
|
|
402
|
+
$ as NotificationCenterProvider,
|
|
403
|
+
P as applyItemPatchToState,
|
|
404
|
+
O as applyListResultToState,
|
|
405
|
+
W as applyMarkAllReadToState,
|
|
406
|
+
V as applyMarkReadToState,
|
|
407
|
+
k as applyUpsertToState,
|
|
408
|
+
U as countUnreadItems,
|
|
409
|
+
h as createEmptyNotificationState,
|
|
410
|
+
Q as upsertNotificationItem,
|
|
411
|
+
ee as useNotificationCenter,
|
|
412
|
+
te as useOptionalNotificationCenter,
|
|
413
|
+
ne as useRealtimeStream
|
|
414
|
+
};
|
package/dist/styles.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.facto-notif-bell,.facto-notif-tx-group,.facto-notif-tx-card,.facto-notif-feed,.facto-notif-row,.facto-notif-action-queue,.facto-notif-incident,.facto-notif-drawer,.facto-notif-drawer-panel{box-sizing:border-box;font-family:var(--facto-font-sans);letter-spacing:var(--facto-tracking)}.facto-notif-bell{position:relative}.facto-notif-bell--open .facto-icon-button__visual{background:var(--facto-action-secondary-hover)}.facto-notif-bell__dot{position:absolute;top:7px;right:7px;width:8px;height:8px;border-radius:50%;background:var(--facto-badge-dot);border:2px solid var(--facto-canvas);pointer-events:none}.facto-notif-bell__count{position:absolute;top:2px;right:1px;min-width:18px;height:18px;padding:0 5px;border-radius:var(--facto-button-radius);background:var(--facto-action-primary);color:var(--facto-action-primary-foreground);border:2px solid var(--facto-canvas);font-size:.6875rem;line-height:1;font-weight:var(--facto-font-weight-semibold);display:inline-flex;align-items:center;justify-content:center;font-variant-numeric:tabular-nums;pointer-events:none}.facto-notif-bell__count--critical{background:var(--facto-danger)}.facto-surface .facto-notif-bell__dot,.facto-surface .facto-notif-bell__count{border-color:var(--facto-surface)}.facto-notif-tx-groups{display:flex;flex-direction:column;gap:var(--facto-space-5);min-width:0}.facto-notif-tx-group{display:flex;flex-direction:column;gap:var(--facto-space-2);min-width:0}.facto-notif-day-label{margin:0;padding:0 2px;font-size:var(--facto-font-size-label);line-height:var(--facto-line-height-label);font-weight:var(--facto-font-weight-medium);color:var(--facto-muted)}.facto-notif-tx-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:10px;min-width:0}.facto-notif-tx-card{width:100%;min-height:44px;text-align:left;padding:14px var(--facto-space-4);display:flex;flex-direction:column;gap:var(--facto-space-3);border:1px solid var(--facto-line);border-radius:var(--facto-radius-card);background:var(--facto-surface);color:var(--facto-text);font:inherit;transition:background-color .14s ease,border-color .14s ease}button.facto-notif-tx-card{cursor:pointer}button.facto-notif-tx-card:hover{background:var(--facto-surface-hover);border-color:var(--facto-line-strong)}button.facto-notif-tx-card:focus-visible{outline:2px solid var(--facto-focus);outline-offset:2px}.facto-notif-tx-card--static{cursor:default}.facto-notif-tx-card--highlighted{border-color:var(--facto-accent-strong);background:var(--facto-accent-soft)}.facto-notif-tx-card--danger{background:var(--facto-danger-soft);border-color:var(--facto-notice-danger-border)}button.facto-notif-tx-card--danger:hover{background:var(--facto-danger-soft);border-color:var(--facto-danger)}.facto-notif-tx-card__top{display:flex;align-items:center;justify-content:space-between;gap:var(--facto-space-2);min-width:0}.facto-notif-tx-card__meta{display:inline-flex;align-items:baseline;gap:var(--facto-space-2);min-width:0;flex-wrap:wrap}.facto-notif-tx-card__verb{font-size:.8125rem;font-weight:var(--facto-font-weight-medium);color:var(--facto-muted)}.facto-notif-tx-card--danger .facto-notif-tx-card__verb{color:var(--facto-text)}.facto-notif-tx-card__status{font-size:.8125rem;font-weight:var(--facto-font-weight-medium);color:var(--facto-text-secondary)}.facto-notif-tx-card__status--danger{color:var(--facto-danger)}.facto-notif-tx-card__status--success{color:var(--facto-accent-strong)}.facto-notif-tx-card__time-wrap{display:inline-flex;align-items:center;gap:6px;flex-shrink:0}.facto-notif-tx-card__time{font-size:var(--facto-font-size-label);line-height:var(--facto-line-height-label);color:var(--facto-muted);font-variant-numeric:tabular-nums}.facto-notif-tx-card--danger .facto-notif-tx-card__time{color:var(--facto-danger)}.facto-notif-unread-dot{display:inline-block;width:6px;height:6px;border-radius:50%;background:var(--facto-badge-dot);flex-shrink:0}.facto-notif-tx-card__body{display:flex;align-items:center;justify-content:space-between;gap:var(--facto-space-3);min-width:0}.facto-notif-tx-card__left{display:flex;align-items:center;gap:var(--facto-space-3);min-width:0;flex:1 1 auto}.facto-notif-tx-card__logos{flex-shrink:0;padding-left:8px}.facto-notif-tx-card__logos .facto-avatar{margin-left:-8px;border-color:var(--facto-surface);background:var(--facto-subtle);color:var(--facto-text)}.facto-notif-tx-card--danger .facto-notif-tx-card__logos .facto-avatar{border-color:var(--facto-danger-soft)}.facto-notif-tx-card--highlighted .facto-notif-tx-card__logos .facto-avatar{border-color:var(--facto-accent-soft)}.facto-notif-tx-card__entity{display:flex;flex-direction:column;gap:2px;min-width:0}.facto-notif-tx-card__title{font-size:.9375rem;font-weight:var(--facto-font-weight-semibold);color:var(--facto-text);line-height:1.3;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.facto-notif-tx-card__sub{font-size:var(--facto-font-size-label);color:var(--facto-muted);line-height:1.3;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-variant-numeric:tabular-nums}.facto-notif-tx-card--danger .facto-notif-tx-card__sub{color:var(--facto-text-secondary)}.facto-notif-tx-card__right{display:flex;flex-direction:column;align-items:flex-end;gap:2px;flex-shrink:0;text-align:right;min-width:0}.facto-notif-tx-card__amount{font-size:.9375rem;font-weight:var(--facto-font-weight-semibold);color:var(--facto-text);line-height:1.3;font-variant-numeric:tabular-nums;white-space:nowrap}.facto-notif-tx-card__amount--positive{color:var(--facto-accent-strong)}.facto-notif-tx-card__amount--danger{color:var(--facto-danger)}.facto-notif-tx-card__route{font-size:var(--facto-font-size-label);color:var(--facto-muted);line-height:1.3;white-space:nowrap;font-variant-numeric:tabular-nums}.facto-notif-tx-card__route-target{color:var(--facto-text-secondary)}.facto-notif-feed{overflow:hidden;display:flex;flex-direction:column;min-width:0}.facto-notif-feed__header{padding:var(--facto-space-5) var(--facto-space-5) 14px;display:flex;align-items:center;justify-content:space-between;gap:var(--facto-space-3);flex-wrap:wrap}.facto-notif-feed__title{margin:0;font-size:var(--facto-font-size-heading-md);line-height:var(--facto-line-height-heading-md);font-weight:var(--facto-font-weight-semibold);letter-spacing:var(--facto-tracking-heading-tight);color:var(--facto-text)}.facto-notif-feed__header-actions{display:inline-flex;align-items:center;gap:var(--facto-space-2);flex-wrap:wrap}.facto-notif-mark-all{min-height:44px;padding:6px 8px;font-size:.8125rem;text-decoration:none}.facto-notif-mark-all:hover:not(:disabled){text-decoration:underline}.facto-tabs-list.facto-notif-tabs-list{padding:0 var(--facto-space-5);border-radius:0;border-bottom:1px solid var(--facto-line);background:transparent;display:flex;flex-wrap:nowrap;align-items:center;gap:var(--facto-space-5);overflow-x:auto;max-width:100%}.facto-tabs-trigger.facto-notif-tabs-trigger{position:relative;min-width:44px;min-height:44px;padding:10px 4px 12px;border:0;border-bottom:2px solid transparent;border-radius:0;margin-bottom:-1px;background:transparent;color:var(--facto-muted);box-shadow:none;display:inline-flex;align-items:center;justify-content:center;gap:7px;white-space:nowrap;flex-shrink:0;transition:color .12s ease,border-color .12s ease}.facto-tabs-trigger.facto-notif-tabs-trigger:hover:not(:disabled){color:var(--facto-text)}.facto-tabs-trigger.facto-notif-tabs-trigger[data-state=active]{background:transparent;box-shadow:none;color:var(--facto-text);font-weight:var(--facto-font-weight-semibold);border-bottom-color:var(--facto-text)}.facto-tabs-content.facto-notif-tabs-content{padding-top:0}.facto-notif-tab-count{min-width:20px;height:20px;padding:0 6px;border-radius:6px;background:var(--facto-subtle);color:var(--facto-text-secondary);font-size:var(--facto-font-size-label);line-height:1;font-weight:var(--facto-font-weight-semibold);display:inline-flex;align-items:center;justify-content:center;font-variant-numeric:tabular-nums}.facto-notif-tab-count--danger{background:var(--facto-danger);color:var(--facto-action-primary-foreground)}.facto-notif-feed__list{list-style:none;margin:0;padding:0}.facto-notif-feed__state{padding:var(--facto-space-5)}.facto-notif-row{padding:var(--facto-space-4) var(--facto-space-5);border-bottom:1px solid var(--facto-line);display:flex;align-items:flex-start;gap:var(--facto-space-3);min-width:0;transition:background-color .12s ease}.facto-notif-row:last-child{border-bottom:0}.facto-notif-row:hover{background:var(--facto-surface-hover)}.facto-notif-row--highlighted{background:var(--facto-accent-soft)}.facto-notif-row__avatar-wrap{position:relative;width:36px;height:36px;flex-shrink:0;margin-top:2px}.facto-notif-row__avatar{width:36px;height:36px;color:var(--facto-text)}.facto-notif-row__avatar-badge{position:absolute;right:-3px;bottom:-2px;width:18px;height:18px;border-radius:50%;border:2px solid var(--facto-surface);background:var(--facto-action-primary);color:var(--facto-action-primary-foreground);display:inline-flex;align-items:center;justify-content:center}.facto-notif-row__avatar-badge--danger{background:var(--facto-danger)}.facto-notif-row__avatar-badge--success{background:var(--facto-accent-strong)}.facto-notif-row__content{flex:1 1 auto;min-width:0;display:flex;flex-direction:column;gap:6px}.facto-notif-row__meta{font-size:var(--facto-font-size-label);line-height:1.35;color:var(--facto-muted);overflow-wrap:anywhere;font-variant-numeric:tabular-nums}.facto-notif-row__headline{margin:0;font-size:var(--facto-font-size);line-height:1.45;color:var(--facto-text-secondary);overflow-wrap:anywhere}.facto-notif-row__actor{font-weight:var(--facto-font-weight-semibold);color:var(--facto-text)}.facto-notif-row__title-link{border:0;padding:0;background:transparent;color:var(--facto-text);font:inherit;font-weight:var(--facto-font-weight-medium);text-align:left;cursor:pointer;text-decoration:underline;text-underline-offset:3px;text-decoration-color:var(--facto-line-strong)}.facto-notif-row__title-link:focus-visible{outline:2px solid var(--facto-focus);outline-offset:2px;border-radius:4px}.facto-notif-row__title-text{color:var(--facto-text);font-weight:var(--facto-font-weight-medium)}.facto-notif-row__unread-dot{vertical-align:middle;margin-left:6px}.facto-notif-row__desc{margin:0;font-size:.8125rem;line-height:1.45;color:var(--facto-muted);overflow-wrap:anywhere}.facto-notif-quote-box{margin-top:var(--facto-space-1);border:1px solid var(--facto-line);border-radius:var(--facto-radius-control);background:var(--facto-surface-hover);padding:var(--facto-space-3);display:flex;flex-direction:column;gap:10px;min-width:0}.facto-notif-quote-text{margin:0;font-size:.8125rem;line-height:1.45;color:var(--facto-text);overflow-wrap:anywhere}.facto-notif-quote-mention{font-weight:var(--facto-font-weight-semibold);color:var(--facto-text)}.facto-notif-reply-form{display:flex;align-items:center;gap:var(--facto-space-2);min-width:0}.facto-notif-reply-input{flex:1 1 auto;min-width:0;min-height:44px;font-size:1rem}.facto-notif-reply-submit{flex-shrink:0;min-width:44px;min-height:44px}.facto-notif-actions{margin-top:var(--facto-space-1);display:flex;align-items:center;gap:var(--facto-space-2);flex-wrap:wrap}.facto-notif-actions .facto-button{min-height:44px}.facto-notif-state-diff{margin-top:var(--facto-space-1);display:flex;align-items:center;gap:var(--facto-space-2);flex-wrap:wrap}.facto-notif-state-arrow{color:var(--facto-muted);display:inline-flex;align-items:center}.facto-notif-state-meta{display:inline-flex;align-items:center;gap:6px;font-size:var(--facto-font-size-label);color:var(--facto-muted);overflow-wrap:anywhere}.facto-notif-attachment{margin-top:var(--facto-space-1);display:flex;align-items:center;justify-content:space-between;gap:var(--facto-space-3);padding:var(--facto-space-2) var(--facto-space-2) var(--facto-space-2) var(--facto-space-3);border-radius:var(--facto-radius-control);background:var(--facto-subtle);min-width:0}.facto-notif-attachment>.facto-icon-button{flex-shrink:0}.facto-notif-attachment__left{display:flex;align-items:center;gap:10px;min-width:0;flex:1 1 auto}.facto-notif-attachment__icon{width:32px;height:32px;border-radius:8px;background:var(--facto-surface);border:1px solid var(--facto-line);color:var(--facto-text-secondary);display:inline-flex;align-items:center;justify-content:center;flex-shrink:0}.facto-notif-attachment__meta{display:flex;flex-direction:column;gap:1px;min-width:0}.facto-notif-attachment__name{font-size:.8125rem;font-weight:var(--facto-font-weight-medium);color:var(--facto-text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.facto-notif-attachment__sub{font-size:var(--facto-font-size-label);color:var(--facto-muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.facto-notif-action-queue{padding:var(--facto-space-4);display:flex;flex-direction:column;gap:var(--facto-space-3);min-width:0}.facto-notif-action-queue__top{display:flex;align-items:flex-start;justify-content:space-between;gap:var(--facto-space-2);flex-wrap:wrap}.facto-notif-action-queue__copy{display:flex;flex-direction:column;gap:4px;min-width:0;flex:1 1 180px}.facto-notif-action-queue__title{margin:0;font-size:.9375rem;font-weight:var(--facto-font-weight-semibold);color:var(--facto-text);overflow-wrap:anywhere}.facto-notif-action-queue__sub{margin:0;font-size:var(--facto-font-size-label);color:var(--facto-muted);overflow-wrap:anywhere;font-variant-numeric:tabular-nums}.facto-notif-action-queue__badges{display:inline-flex;align-items:center;gap:var(--facto-space-2);flex-wrap:wrap;flex-shrink:0}.facto-notif-action-queue__footer{display:flex;align-items:center;justify-content:space-between;gap:var(--facto-space-3);flex-wrap:wrap}.facto-notif-action-queue__claimer{font-size:var(--facto-font-size-label);color:var(--facto-muted)}.facto-notif-action-queue__actions{display:inline-flex;align-items:center;gap:var(--facto-space-2);flex-wrap:wrap}.facto-notif-action-queue__actions .facto-button{min-height:44px}.facto-notice.facto-notif-incident{align-items:center;flex-wrap:wrap;gap:var(--facto-space-3)}.facto-notice.facto-notif-incident>div:first-child{flex:1 1 240px;min-width:0}.facto-notice.facto-notif-incident>.facto-notif-incident__actions{display:inline-flex;flex-direction:row;align-items:center;gap:var(--facto-space-2);flex-wrap:wrap;flex-shrink:0}.facto-notice.facto-notif-incident>.facto-notif-incident__actions .facto-notif-incident__count{background:var(--facto-surface);color:var(--facto-danger);font-size:var(--facto-font-size-label);line-height:var(--facto-line-height-label);font-variant-numeric:tabular-nums}.facto-notice.facto-notif-incident>.facto-notif-incident__actions .facto-notif-incident__btn{min-height:44px;background:var(--facto-surface);color:var(--facto-text)}.facto-notice.facto-notif-incident>.facto-notif-incident__actions .facto-button span{color:inherit;font-size:inherit;line-height:inherit}.facto-notice.facto-notif-incident>.facto-notif-incident__actions .facto-notif-incident__btn:hover:not(:disabled){background:var(--facto-subtle)}.facto-sheet.facto-sheet--right.facto-notif-drawer{top:var(--facto-space-4);right:var(--facto-space-4);bottom:var(--facto-space-4);left:auto;width:min(440px,calc(100vw - 32px));max-height:none;padding:0;border:1px solid var(--facto-line);border-radius:var(--facto-radius-sheet);box-shadow:var(--facto-shadow-sheet);transform:none;display:flex;flex-direction:column;overflow:hidden}.facto-sheet.facto-sheet--right.facto-notif-drawer--transactions{background:var(--facto-canvas)}.facto-notif-drawer-panel{display:flex;flex-direction:column;height:100%;min-height:0;min-width:0;background:var(--facto-surface);color:var(--facto-text)}.facto-notif-drawer-panel--transactions{background:var(--facto-canvas)}.facto-notif-drawer__header{padding:var(--facto-space-4) var(--facto-space-5);border-bottom:1px solid var(--facto-line);background:var(--facto-surface);display:flex;align-items:center;justify-content:space-between;gap:var(--facto-space-2);flex-wrap:wrap}.facto-notif-drawer__heading{display:flex;flex-direction:column;gap:2px;min-width:0}.facto-notif-drawer__title{margin:0;font-size:var(--facto-font-size-heading-md);line-height:var(--facto-line-height-heading-md);font-weight:var(--facto-font-weight-semibold);letter-spacing:var(--facto-tracking-heading-tight);color:var(--facto-text)}.facto-notif-drawer__status{display:inline-flex;align-items:center;gap:6px;font-size:var(--facto-font-size-label);line-height:var(--facto-line-height-label);color:var(--facto-muted)}.facto-notif-stream-dot{width:8px;height:8px;border-radius:50%;background:var(--facto-muted);flex-shrink:0}.facto-notif-stream-dot--open{background:var(--facto-accent)}.facto-notif-stream-dot--revoked{background:var(--facto-danger)}.facto-notif-drawer__controls{display:inline-flex;align-items:center;gap:var(--facto-space-1);flex-shrink:0}.facto-notif-drawer__body{flex:1 1 auto;overflow-y:auto;min-height:0;min-width:0}.facto-notif-drawer__body--transactions{padding:var(--facto-space-4) var(--facto-space-5) var(--facto-space-5)}.facto-notif-drawer__footer{padding:10px var(--facto-space-5);border-top:1px solid var(--facto-line);background:var(--facto-surface);display:flex;align-items:center;justify-content:space-between;gap:var(--facto-space-2);font-size:var(--facto-font-size-label);color:var(--facto-muted);flex-wrap:wrap}@media(max-width:640px){.facto-notif-feed__header{padding:var(--facto-space-4) var(--facto-space-4) var(--facto-space-3)}.facto-tabs-list.facto-notif-tabs-list{padding:0 var(--facto-space-4);gap:var(--facto-space-4)}.facto-notif-row{padding:14px var(--facto-space-4)}.facto-notif-drawer__header{padding:var(--facto-space-3) var(--facto-space-4)}.facto-notif-drawer__body--transactions{padding:var(--facto-space-4)}.facto-sheet.facto-sheet--right.facto-notif-drawer{inset:0;width:100vw;max-width:100vw;max-height:100dvh;padding:0;border:0;border-radius:0}}@media(max-width:380px){.facto-notif-tx-card{padding:var(--facto-space-3)}.facto-notif-tx-card__body{flex-wrap:wrap;row-gap:var(--facto-space-2)}.facto-notif-tx-card__right{width:100%;flex-direction:row;align-items:baseline;justify-content:space-between;gap:var(--facto-space-2);flex-wrap:wrap;text-align:left}.facto-notif-tx-card__route{white-space:normal;overflow-wrap:anywhere}}@media(prefers-reduced-motion:reduce){.facto-notif-tx-card,.facto-notif-row,.facto-tabs-trigger.facto-notif-tabs-trigger{transition:none}}
|