@cloudlet/toast 1.3.0 → 1.4.0-rc.1
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/CHANGELOG.md +112 -0
- package/README.md +5 -1
- package/dist/agent.d.ts +334 -0
- package/dist/agent.d.ts.map +1 -0
- package/dist/agent.js +494 -0
- package/dist/agent.js.map +1 -0
- package/dist/contracts/events.d.ts +14 -0
- package/dist/contracts/events.d.ts.map +1 -1
- package/dist/contracts/internal.d.ts +16 -2
- package/dist/contracts/internal.d.ts.map +1 -1
- package/dist/contracts/notifications.d.ts +16 -0
- package/dist/contracts/notifications.d.ts.map +1 -1
- package/dist/contracts/snapshots.d.ts +8 -0
- package/dist/contracts/snapshots.d.ts.map +1 -1
- package/dist/core/actions.d.ts +69 -0
- package/dist/core/actions.d.ts.map +1 -0
- package/dist/core/actions.js +160 -0
- package/dist/core/actions.js.map +1 -0
- package/dist/core/agent-port.d.ts +116 -0
- package/dist/core/agent-port.d.ts.map +1 -0
- package/dist/core/agent-port.js +138 -0
- package/dist/core/agent-port.js.map +1 -0
- package/dist/core/bridge.d.ts.map +1 -1
- package/dist/core/bridge.js +120 -231
- package/dist/core/bridge.js.map +1 -1
- package/dist/core/controller.d.ts +44 -9
- package/dist/core/controller.d.ts.map +1 -1
- package/dist/core/controller.js +367 -292
- package/dist/core/controller.js.map +1 -1
- package/dist/core/validation.d.ts.map +1 -1
- package/dist/core/validation.js +103 -94
- package/dist/core/validation.js.map +1 -1
- package/dist/react/card.d.ts.map +1 -1
- package/dist/react/card.js +3 -3
- package/dist/react/card.js.map +1 -1
- package/dist/react/host.d.ts.map +1 -1
- package/dist/react/host.js +257 -246
- package/dist/react/host.js.map +1 -1
- package/dist/react.d.ts +7 -0
- package/dist/react.d.ts.map +1 -1
- package/package.json +3 -2
- package/src/agent.ts +879 -0
- package/src/contracts/events.ts +15 -0
- package/src/contracts/internal.ts +14 -1
- package/src/contracts/notifications.ts +16 -0
- package/src/contracts/snapshots.ts +8 -0
- package/src/core/actions.ts +149 -0
- package/src/core/agent-port.ts +237 -0
- package/src/core/bridge.ts +19 -105
- package/src/core/controller.ts +183 -56
- package/src/core/validation.ts +6 -3
- package/src/react/card.tsx +4 -3
- package/src/react/host.tsx +26 -3
- package/src/react.ts +7 -0
package/dist/core/controller.js
CHANGED
|
@@ -2,7 +2,8 @@ import { copyContent as e, patchContent as t, validateContent as n, validateOpti
|
|
|
2
2
|
var s = Object.freeze, c = /* @__PURE__ */ new WeakSet(), l = /* @__PURE__ */ new WeakMap(), u = 0, d = s([]), f = s({
|
|
3
3
|
open: !1,
|
|
4
4
|
reason: null,
|
|
5
|
-
current: null
|
|
5
|
+
current: null,
|
|
6
|
+
source: null
|
|
6
7
|
}), p = s({
|
|
7
8
|
controller: null,
|
|
8
9
|
revision: 0,
|
|
@@ -40,54 +41,56 @@ function x(d, m) {
|
|
|
40
41
|
if (!m?.clock || typeof m.clock.now != "function" || typeof m.clock.schedule != "function") throw TypeError("Cloudlet requires a monotonic clock");
|
|
41
42
|
let x = m.clock;
|
|
42
43
|
if (typeof m.createCancellation != "function") throw TypeError("Cloudlet requires a cancellation source factory");
|
|
43
|
-
let S = `cloudlet-${++u}`, C = /* @__PURE__ */ new Map(),
|
|
44
|
+
let S = `cloudlet-${++u}`, C = /* @__PURE__ */ new Map(), ee = /* @__PURE__ */ new Set(), w = /* @__PURE__ */ new Set(), T = /* @__PURE__ */ new Map(), E = /* @__PURE__ */ new Set(), D = [], O = null, k = null, A = null, j = null, te = 0, ne = 0, M = 0, re = 0, N = null, P = null, F = null, I = null, L, R, z = null, B = null, ie = 0, V = null, H = null, ae = 0, U = 0, W = 0, G = !1, oe = !1, se = null, ce = 0, le, ue, K = () => `${S}:${++te}`, de = () => [...C.values()].reverse(), fe = () => de()[0] ?? null, pe = (e) => {
|
|
44
45
|
let t = e.operation?.getSnapshot();
|
|
45
46
|
return !!t?.canRetry && t.status !== "fulfilled";
|
|
46
|
-
},
|
|
47
|
+
}, me = (e) => !!e.content.action || pe(e) || e.content.attention === "open", he = (e) => {
|
|
47
48
|
let t = e.content.attention ?? "auto";
|
|
48
|
-
return t === "open" || t === "auto" && (
|
|
49
|
-
},
|
|
49
|
+
return t === "open" || t === "auto" && (me(e) || !!e.content.description);
|
|
50
|
+
}, ge = (e) => {
|
|
50
51
|
let t = e.content.action;
|
|
51
52
|
return t?.kind === "form" ? (e.form?.action !== t && (e.form = {
|
|
52
53
|
action: t,
|
|
53
54
|
errors: g,
|
|
54
|
-
values: s(Object.fromEntries(t.fields.map((e) => [e.name, e.defaultValue ?? ""])))
|
|
55
|
+
values: s(Object.fromEntries(t.fields.map((e) => [e.name, e.defaultValue ?? ""]))),
|
|
56
|
+
authors: s(Object.fromEntries(t.fields.flatMap((e) => e.defaultValue ? [[e.name, "app"]] : [])))
|
|
55
57
|
}), e.form) : e.form = null;
|
|
56
|
-
},
|
|
57
|
-
let t =
|
|
58
|
-
return !!t && t.action.fields.some((e) => t.values[e.name] !== (e.defaultValue ?? ""));
|
|
59
|
-
},
|
|
58
|
+
}, _e = (e) => {
|
|
59
|
+
let t = ge(e);
|
|
60
|
+
return !!t && t.action.fields.some((e) => (Object.hasOwn(t.values, e.name) ? t.values[e.name] : "") !== (e.defaultValue ?? ""));
|
|
61
|
+
}, q = () => E.has("hover") || E.has("focus") || [...C.values()].some((e) => e.pauses.has("gesture")) || !!N && _e(N.current), ve = (e) => {
|
|
60
62
|
let t = e === I;
|
|
61
63
|
return [
|
|
62
64
|
...t ? [] : ["inactive"],
|
|
63
|
-
...
|
|
65
|
+
...A === null ? ["no-host"] : [],
|
|
64
66
|
...t && !e.readable ? ["presentation-pending"] : [],
|
|
65
|
-
...t &&
|
|
67
|
+
...t && N && (N.reason === "user" || me(e)) ? ["island"] : [],
|
|
66
68
|
...e.action.status === "pending" ? ["action-pending"] : [],
|
|
67
|
-
...
|
|
68
|
-
...
|
|
69
|
+
..._e(e) ? ["draft"] : [],
|
|
70
|
+
...E,
|
|
69
71
|
...e.pauses
|
|
70
72
|
];
|
|
71
|
-
},
|
|
72
|
-
if (
|
|
73
|
+
}, ye = (e) => {
|
|
74
|
+
if (G) return "disposed";
|
|
73
75
|
if (typeof e != "object" || !e || !c.has(e)) return "invalid-handle";
|
|
74
76
|
if (e.controller !== S) return "foreign-controller";
|
|
75
77
|
if (C.get(e.id)?.handle !== e) return "stale-handle";
|
|
76
78
|
};
|
|
77
|
-
function
|
|
79
|
+
function be(e) {
|
|
78
80
|
return (t, ...n) => {
|
|
79
|
-
let r =
|
|
81
|
+
let r = ye(t);
|
|
80
82
|
return r ? y(r) : e(C.get(t.id), ...n);
|
|
81
83
|
};
|
|
82
84
|
}
|
|
83
|
-
function
|
|
84
|
-
|
|
85
|
+
function J(e) {
|
|
86
|
+
Se([{
|
|
85
87
|
type: "diagnostic",
|
|
88
|
+
source: "system",
|
|
86
89
|
diagnostic: s({ ...e })
|
|
87
90
|
}]);
|
|
88
91
|
}
|
|
89
|
-
function
|
|
90
|
-
|
|
92
|
+
function Y(e, t, n, r) {
|
|
93
|
+
J({
|
|
91
94
|
code: e,
|
|
92
95
|
source: t,
|
|
93
96
|
message: `${t} failed`,
|
|
@@ -95,80 +98,88 @@ function x(d, m) {
|
|
|
95
98
|
...r ? { handle: r } : {}
|
|
96
99
|
});
|
|
97
100
|
}
|
|
98
|
-
function
|
|
101
|
+
function xe(e, t) {
|
|
99
102
|
for (let n of [...e]) if (e.has(n)) try {
|
|
100
103
|
n();
|
|
101
104
|
} catch (e) {
|
|
102
|
-
|
|
105
|
+
Y("listener-error", t, e);
|
|
103
106
|
}
|
|
104
107
|
}
|
|
105
|
-
function
|
|
106
|
-
|
|
107
|
-
|
|
108
|
+
function Se(e, t = !1, n = x.now(), r = !1, i = !1) {
|
|
109
|
+
let a = t ? {
|
|
110
|
+
deliveries: e,
|
|
111
|
+
snapshot: ue,
|
|
112
|
+
closedBy: P
|
|
113
|
+
} : null;
|
|
114
|
+
if (D.push(() => {
|
|
115
|
+
a && (F = a, xe(ee, "subscribe"), F = null);
|
|
108
116
|
for (let t of e) {
|
|
109
117
|
if ("callback" in t) {
|
|
110
118
|
try {
|
|
111
119
|
t.callback();
|
|
112
120
|
} catch (e) {
|
|
113
|
-
|
|
121
|
+
Y("callback-error", t.source, e, t.handle);
|
|
114
122
|
}
|
|
115
123
|
continue;
|
|
116
124
|
}
|
|
117
125
|
let e = s({
|
|
118
126
|
...t,
|
|
119
127
|
controller: S,
|
|
120
|
-
sequence: ++
|
|
128
|
+
sequence: ++re,
|
|
121
129
|
at: i ? x.now() : n
|
|
122
130
|
});
|
|
123
|
-
for (let t of [...
|
|
131
|
+
for (let t of [...w]) if (w.has(t)) try {
|
|
124
132
|
t(e);
|
|
125
133
|
} catch (t) {
|
|
126
|
-
e.type !== "diagnostic" &&
|
|
134
|
+
e.type !== "diagnostic" && Y("listener-error", "onEvent", t);
|
|
127
135
|
}
|
|
128
136
|
if (e.type === "diagnostic") try {
|
|
129
137
|
b.onDiagnostic?.(e.diagnostic);
|
|
130
138
|
} catch {}
|
|
131
139
|
}
|
|
132
|
-
if (r &&
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
140
|
+
if (r && Se([{
|
|
141
|
+
type: "disposed",
|
|
142
|
+
source: "system"
|
|
143
|
+
}], !1, n, !1, !0), i) {
|
|
144
|
+
ee.clear(), w.clear();
|
|
145
|
+
for (let e of T.keys()) e.clear();
|
|
146
|
+
T.clear();
|
|
136
147
|
}
|
|
137
|
-
}), !
|
|
138
|
-
|
|
148
|
+
}), !oe) {
|
|
149
|
+
oe = !0;
|
|
139
150
|
try {
|
|
140
151
|
let e;
|
|
141
|
-
for (; e =
|
|
152
|
+
for (; e = D.shift();) e();
|
|
142
153
|
} finally {
|
|
143
|
-
|
|
154
|
+
oe = !1;
|
|
144
155
|
}
|
|
145
156
|
}
|
|
146
157
|
}
|
|
147
|
-
function
|
|
158
|
+
function X() {
|
|
148
159
|
let e = x.now();
|
|
149
160
|
for (let t of C.values()) t.activeSince !== null && t.remaining !== null && (t.remaining = Math.max(0, t.remaining - Math.max(0, e - t.activeSince)), t.activeSince = e);
|
|
150
161
|
return e;
|
|
151
162
|
}
|
|
152
|
-
function
|
|
153
|
-
++
|
|
163
|
+
function Ce() {
|
|
164
|
+
++ce, se?.(), se = null;
|
|
154
165
|
}
|
|
155
|
-
function
|
|
156
|
-
|
|
166
|
+
function we(e) {
|
|
167
|
+
Ce();
|
|
157
168
|
let t = Infinity;
|
|
158
169
|
for (let n of C.values()) {
|
|
159
|
-
let r = n.remaining !== null &&
|
|
170
|
+
let r = n.remaining !== null && ve(n).length === 0 && !G;
|
|
160
171
|
n.activeSince = r ? e : null, r && (t = Math.min(t, e + n.remaining));
|
|
161
172
|
}
|
|
162
173
|
if (!Number.isFinite(t)) return;
|
|
163
|
-
let n =
|
|
164
|
-
|
|
165
|
-
if (
|
|
166
|
-
let e =
|
|
167
|
-
for (let e of t)
|
|
168
|
-
t.length ?
|
|
174
|
+
let n = ce;
|
|
175
|
+
se = x.schedule(t, () => {
|
|
176
|
+
if (G || n !== ce) return;
|
|
177
|
+
let e = X(), t = [...C.values()].filter((e) => e.activeSince !== null && e.remaining === 0), r = [];
|
|
178
|
+
for (let e of t) ze(e, "timeout", r, "system");
|
|
179
|
+
t.length ? Z(r, e) : we(e);
|
|
169
180
|
});
|
|
170
181
|
}
|
|
171
|
-
function
|
|
182
|
+
function Te() {
|
|
172
183
|
let e = [...C.values()], t = s(e.map((e) => s({
|
|
173
184
|
handle: e.handle,
|
|
174
185
|
kind: e.kind,
|
|
@@ -177,44 +188,46 @@ function x(d, m) {
|
|
|
177
188
|
occurrences: e.occurrences,
|
|
178
189
|
location: e === I ? "current" : "stack",
|
|
179
190
|
remainingMs: e.remaining,
|
|
180
|
-
pauseReasons: s(
|
|
191
|
+
pauseReasons: s(ve(e)),
|
|
181
192
|
operation: e.operation?.getSnapshot() ?? null,
|
|
182
193
|
action: e.action,
|
|
183
|
-
draft:
|
|
194
|
+
draft: _e(e)
|
|
184
195
|
})));
|
|
185
|
-
|
|
196
|
+
le = s({
|
|
186
197
|
controller: S,
|
|
187
|
-
revision:
|
|
188
|
-
disposed:
|
|
198
|
+
revision: M,
|
|
199
|
+
disposed: G,
|
|
189
200
|
notifications: t,
|
|
190
|
-
stack: s(
|
|
191
|
-
island:
|
|
201
|
+
stack: s(de().map((e) => e.handle)),
|
|
202
|
+
island: N ? s({
|
|
192
203
|
open: !0,
|
|
193
|
-
reason:
|
|
194
|
-
current:
|
|
204
|
+
reason: N.reason,
|
|
205
|
+
current: N.current.handle,
|
|
206
|
+
source: N.source
|
|
195
207
|
}) : f,
|
|
196
208
|
overflow: s({
|
|
197
|
-
count:
|
|
198
|
-
pending:
|
|
209
|
+
count: U,
|
|
210
|
+
pending: U > 0
|
|
199
211
|
})
|
|
200
|
-
}),
|
|
201
|
-
...
|
|
212
|
+
}), ue = s({
|
|
213
|
+
...le,
|
|
202
214
|
presentation: I ? s({
|
|
203
215
|
handle: I.handle,
|
|
204
216
|
token: I.presentation,
|
|
205
217
|
readable: I.readable
|
|
206
218
|
}) : null,
|
|
207
|
-
focusRequest:
|
|
219
|
+
focusRequest: k,
|
|
208
220
|
forms: s(e.flatMap((e) => {
|
|
209
|
-
let t =
|
|
221
|
+
let t = ge(e);
|
|
210
222
|
return t ? [s({
|
|
211
223
|
handle: e.handle,
|
|
212
224
|
values: t.values,
|
|
213
|
-
errors: t.errors
|
|
225
|
+
errors: t.errors,
|
|
226
|
+
authors: t.authors
|
|
214
227
|
})] : [];
|
|
215
228
|
})),
|
|
216
229
|
announcements: s({
|
|
217
|
-
overflowCount:
|
|
230
|
+
overflowCount: W,
|
|
218
231
|
notifications: s(e.map((e) => s({
|
|
219
232
|
handle: e.handle,
|
|
220
233
|
queued: e.queuedAnnounced,
|
|
@@ -229,143 +242,189 @@ function x(d, m) {
|
|
|
229
242
|
})
|
|
230
243
|
});
|
|
231
244
|
}
|
|
232
|
-
function
|
|
233
|
-
|
|
245
|
+
function Z(e = [], t = x.now(), n = !1) {
|
|
246
|
+
Oe(), we(t), Ie(t), je(t), ++M, Te(), Se(e, !0, t, n);
|
|
234
247
|
}
|
|
235
|
-
function
|
|
236
|
-
let n =
|
|
237
|
-
return e(r),
|
|
248
|
+
function Q(e, t = !1) {
|
|
249
|
+
let n = X(), r = [];
|
|
250
|
+
return e(r), Z(r, n, t), _;
|
|
238
251
|
}
|
|
239
|
-
function
|
|
240
|
-
e.readable = !1, e.presentation =
|
|
252
|
+
function Ee(e) {
|
|
253
|
+
e.readable = !1, e.presentation = A === null ? null : K();
|
|
241
254
|
}
|
|
242
|
-
function
|
|
243
|
-
e.presentation = null, e.readable = !1, e.pauses.clear(),
|
|
255
|
+
function De(e) {
|
|
256
|
+
e.presentation = null, e.readable = !1, e.pauses.clear(), O === e.handle && (O = null), k?.target.kind === "notification" && k.target.handle === e.handle && (k = null);
|
|
244
257
|
}
|
|
245
|
-
function
|
|
246
|
-
let e =
|
|
247
|
-
e !== I && (I &&
|
|
258
|
+
function Oe() {
|
|
259
|
+
let e = N ? N.current : fe();
|
|
260
|
+
e !== I && (I && De(I), I = e, e && Ee(e));
|
|
248
261
|
}
|
|
249
|
-
function
|
|
250
|
-
++
|
|
262
|
+
function ke() {
|
|
263
|
+
++ie, B?.(), B = null;
|
|
251
264
|
}
|
|
252
|
-
function
|
|
253
|
-
|
|
265
|
+
function Ae(e, t) {
|
|
266
|
+
he(e) && (z = {
|
|
254
267
|
record: e,
|
|
255
268
|
due: t + (L ?? b.attentionDelay ?? 600),
|
|
256
269
|
waiting: !1
|
|
257
270
|
});
|
|
258
271
|
}
|
|
259
|
-
function
|
|
260
|
-
|
|
272
|
+
function je(e) {
|
|
273
|
+
ke();
|
|
261
274
|
let t = z;
|
|
262
|
-
if (!t ||
|
|
263
|
-
if (
|
|
275
|
+
if (!t || G) return;
|
|
276
|
+
if (A === null) {
|
|
264
277
|
t.waiting = !0;
|
|
265
278
|
return;
|
|
266
279
|
}
|
|
267
280
|
if (t.waiting) {
|
|
268
|
-
if (
|
|
281
|
+
if (q()) return;
|
|
269
282
|
t.waiting = !1, t.due = e + (L ?? b.attentionDelay ?? 600);
|
|
270
283
|
}
|
|
271
|
-
let n =
|
|
284
|
+
let n = ie;
|
|
272
285
|
B = x.schedule(t.due, () => {
|
|
273
|
-
if (
|
|
286
|
+
if (G || n !== ie || z !== t) return;
|
|
274
287
|
let e = x.now();
|
|
275
288
|
if (e < t.due) {
|
|
276
|
-
|
|
289
|
+
je(e);
|
|
277
290
|
return;
|
|
278
291
|
}
|
|
279
|
-
if (B = null,
|
|
292
|
+
if (B = null, q() || V) {
|
|
280
293
|
t.waiting = !0;
|
|
281
294
|
return;
|
|
282
295
|
}
|
|
283
296
|
z = null;
|
|
284
297
|
let r = t.record;
|
|
285
|
-
|
|
286
|
-
|
|
298
|
+
he(r) && N?.current !== r && Q(() => {
|
|
299
|
+
N ? (N.current = r, N.source = "system") : N = {
|
|
287
300
|
reason: "attention",
|
|
288
|
-
current: r
|
|
301
|
+
current: r,
|
|
302
|
+
source: "system"
|
|
289
303
|
};
|
|
290
304
|
});
|
|
291
305
|
});
|
|
292
306
|
}
|
|
293
|
-
let
|
|
294
|
-
function
|
|
295
|
-
|
|
296
|
-
|
|
307
|
+
let Me = () => L ?? b.attentionDelay ?? 600;
|
|
308
|
+
function Ne(e, t) {
|
|
309
|
+
N ? (N.current = e, N.source = t) : N = {
|
|
310
|
+
reason: "attention",
|
|
311
|
+
current: e,
|
|
312
|
+
source: t
|
|
313
|
+
}, z?.record === e ? z = null : z && (z.waiting = !1, z.due = x.now() + Me());
|
|
314
|
+
}
|
|
315
|
+
function Pe() {
|
|
316
|
+
++ae, H?.(), H = null;
|
|
317
|
+
}
|
|
318
|
+
function Fe(e) {
|
|
319
|
+
let t = V !== null;
|
|
320
|
+
return V = null, Pe(), N?.current === e ? (t && je(x.now()), "unchanged") : q() ? (V = {
|
|
321
|
+
record: e,
|
|
322
|
+
due: 0,
|
|
323
|
+
waiting: !0
|
|
324
|
+
}, "waiting") : (Q(() => Ne(e, "agent")), "shown");
|
|
325
|
+
}
|
|
326
|
+
function Ie(e) {
|
|
327
|
+
Pe();
|
|
328
|
+
let t = V;
|
|
329
|
+
if (!t) return;
|
|
330
|
+
if (G || A === null) {
|
|
331
|
+
V = null;
|
|
332
|
+
return;
|
|
333
|
+
}
|
|
334
|
+
if (t.waiting) {
|
|
335
|
+
if (q()) return;
|
|
336
|
+
t.waiting = !1, t.due = e + Me();
|
|
337
|
+
}
|
|
338
|
+
let n = ae;
|
|
339
|
+
H = x.schedule(t.due, () => {
|
|
340
|
+
if (G || n !== ae || V !== t) return;
|
|
341
|
+
let e = x.now();
|
|
342
|
+
e < t.due ? Ie(e) : (H = null, q() ? t.waiting = !0 : (V = null, N?.current === t.record ? je(e) : Q(() => Ne(t.record, "agent"))));
|
|
343
|
+
});
|
|
344
|
+
}
|
|
345
|
+
let Le = (e) => (e ?? b.autoDismiss) !== !1;
|
|
346
|
+
function Re(e) {
|
|
347
|
+
let t = Le(e) !== Le(R);
|
|
348
|
+
if (R = e, t) for (let e of C.values()) e.remaining = $(e);
|
|
297
349
|
}
|
|
298
|
-
function
|
|
299
|
-
return
|
|
350
|
+
function $(e) {
|
|
351
|
+
return Le(R) ? e.content.duration === void 0 ? (e.kind === "info" || e.kind === "success") && !e.content.action ? 6e3 : null : e.content.duration : null;
|
|
300
352
|
}
|
|
301
|
-
function
|
|
302
|
-
if (
|
|
303
|
-
let t =
|
|
304
|
-
|
|
353
|
+
function ze(e, t, n, r) {
|
|
354
|
+
if (N?.current === e) {
|
|
355
|
+
let t = de(), n = t.indexOf(e), i = t[n + 1] ?? t[n - 1];
|
|
356
|
+
i ? (N.current = i, N.source = r) : Be(r);
|
|
305
357
|
}
|
|
306
|
-
if (z?.record === e && (z = null), C.delete(e.handle.id), e.operation && n.push(e.operation.detach()), n.push({
|
|
358
|
+
if (z?.record === e && (z = null), V?.record === e && (V = null), C.delete(e.handle.id), e.operation && n.push(e.operation.detach()), n.push({
|
|
307
359
|
type: "closed",
|
|
360
|
+
source: r,
|
|
308
361
|
handle: e.handle,
|
|
309
362
|
reason: t
|
|
310
363
|
}), e.onClose) {
|
|
311
|
-
let
|
|
364
|
+
let i = e.onClose, a = s({
|
|
312
365
|
handle: e.handle,
|
|
313
|
-
reason: t
|
|
366
|
+
reason: t,
|
|
367
|
+
source: r
|
|
314
368
|
});
|
|
315
369
|
n.push({
|
|
316
|
-
callback: () =>
|
|
370
|
+
callback: () => i(a),
|
|
317
371
|
source: "onClose",
|
|
318
372
|
handle: e.handle
|
|
319
373
|
});
|
|
320
374
|
}
|
|
321
375
|
}
|
|
322
|
-
|
|
323
|
-
|
|
376
|
+
function Be(e) {
|
|
377
|
+
N = null, P = e;
|
|
378
|
+
}
|
|
379
|
+
let Ve = be((e, t, n) => Q((r) => ze(e, t, r, n)));
|
|
380
|
+
function He(e, t) {
|
|
324
381
|
e.push({
|
|
325
382
|
type: "overflow-acknowledged",
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
383
|
+
source: t,
|
|
384
|
+
count: U
|
|
385
|
+
}), U = W = 0, k?.target.kind === "overflow" && (k = null);
|
|
386
|
+
}
|
|
387
|
+
function Ue(e) {
|
|
388
|
+
return G ? y("disposed") : U ? Q((t) => He(t, e)) : v;
|
|
389
|
+
}
|
|
390
|
+
function We(e, t) {
|
|
391
|
+
if (G) return y("disposed");
|
|
392
|
+
let n = C.size, r = e === "clear-button" && U > 0;
|
|
393
|
+
return (n || r) && Q((n) => {
|
|
394
|
+
for (let r of C.values()) ze(r, e, n, t);
|
|
395
|
+
r && He(n, t);
|
|
338
396
|
}), {
|
|
339
397
|
status: "cleared",
|
|
340
|
-
count:
|
|
398
|
+
count: n
|
|
341
399
|
};
|
|
342
400
|
}
|
|
343
|
-
function
|
|
401
|
+
function Ge(e, t) {
|
|
344
402
|
if (typeof t != "function") throw TypeError("Listener must be a function");
|
|
345
|
-
return
|
|
403
|
+
return G ? () => {} : (e.add(t), () => {
|
|
346
404
|
e.delete(t);
|
|
347
405
|
});
|
|
348
406
|
}
|
|
349
|
-
function
|
|
350
|
-
if (
|
|
407
|
+
function Ke(e) {
|
|
408
|
+
if (G) return y("disposed");
|
|
351
409
|
let t = a(e);
|
|
352
|
-
return t.length ? (
|
|
410
|
+
return t.length ? (J({
|
|
353
411
|
code: "invalid-input",
|
|
354
412
|
source: "show",
|
|
355
413
|
message: "Invalid notification specification"
|
|
356
414
|
}), {
|
|
357
415
|
...y("invalid-input"),
|
|
358
416
|
issues: t
|
|
359
|
-
}) :
|
|
417
|
+
}) : qe(e);
|
|
360
418
|
}
|
|
361
|
-
function
|
|
419
|
+
function qe(t, n) {
|
|
362
420
|
if (t.id !== void 0 && C.has(t.id)) return y("id-conflict");
|
|
363
421
|
let r = t.dedupeKey === void 0 ? void 0 : [...C.values()].find((e) => e.dedupeKey === t.dedupeKey);
|
|
364
422
|
if (r) {
|
|
365
423
|
let e = r.occurrences;
|
|
366
|
-
return
|
|
424
|
+
return Q((t) => {
|
|
367
425
|
e = r.occurrences = Math.min(2 ** 53 - 1, e + 1), t.push({
|
|
368
426
|
type: "deduplicated",
|
|
427
|
+
source: "app",
|
|
369
428
|
handle: r.handle,
|
|
370
429
|
occurrences: e
|
|
371
430
|
});
|
|
@@ -375,28 +434,29 @@ function x(d, m) {
|
|
|
375
434
|
occurrences: e
|
|
376
435
|
};
|
|
377
436
|
}
|
|
378
|
-
if (C.size >= 100) return
|
|
379
|
-
|
|
437
|
+
if (C.size >= 100) return Q((e) => {
|
|
438
|
+
U = Math.min(2 ** 53 - 1, U + 1);
|
|
380
439
|
let t = s({
|
|
381
|
-
count:
|
|
440
|
+
count: U,
|
|
382
441
|
pending: !0
|
|
383
442
|
});
|
|
384
443
|
e.push({
|
|
385
444
|
type: "overflow",
|
|
386
|
-
|
|
445
|
+
source: "app",
|
|
446
|
+
count: U
|
|
387
447
|
}), b.onOverflow && e.push({
|
|
388
448
|
callback: () => b.onOverflow(t),
|
|
389
449
|
source: "onOverflow"
|
|
390
450
|
});
|
|
391
451
|
}), y("capacity");
|
|
392
|
-
let i =
|
|
452
|
+
let i = X(), a = t.id;
|
|
393
453
|
if (a === void 0) do
|
|
394
|
-
a = `${S}:notification-${++
|
|
454
|
+
a = `${S}:notification-${++ne}`;
|
|
395
455
|
while (C.has(a));
|
|
396
456
|
let o = s({
|
|
397
457
|
id: a,
|
|
398
458
|
controller: S,
|
|
399
|
-
generation:
|
|
459
|
+
generation: K()
|
|
400
460
|
});
|
|
401
461
|
c.add(o);
|
|
402
462
|
let l = {
|
|
@@ -421,32 +481,34 @@ function x(d, m) {
|
|
|
421
481
|
action: h,
|
|
422
482
|
form: null
|
|
423
483
|
};
|
|
424
|
-
l.remaining =
|
|
484
|
+
l.remaining = $(l), C.set(a, l), n?.(l), Ae(l, i);
|
|
425
485
|
let u = [{
|
|
426
486
|
type: "admitted",
|
|
487
|
+
source: "app",
|
|
427
488
|
handle: o
|
|
428
489
|
}];
|
|
429
490
|
if (l.operation) {
|
|
430
491
|
let e = l.operation.getSnapshot();
|
|
431
492
|
u.push({
|
|
432
493
|
type: "operation-started",
|
|
494
|
+
source: "app",
|
|
433
495
|
handle: o,
|
|
434
496
|
token: e.token,
|
|
435
497
|
attempt: e.attempt
|
|
436
498
|
});
|
|
437
499
|
}
|
|
438
|
-
return
|
|
500
|
+
return Z(u, i), {
|
|
439
501
|
status: "created",
|
|
440
502
|
handle: o
|
|
441
503
|
};
|
|
442
504
|
}
|
|
443
|
-
function
|
|
444
|
-
|
|
505
|
+
function Je(e) {
|
|
506
|
+
G || Se(e);
|
|
445
507
|
}
|
|
446
|
-
function
|
|
447
|
-
e.content = t, e.kind = n, e.remaining = n === "loading" ? null :
|
|
508
|
+
function Ye(e, t, n) {
|
|
509
|
+
e.content = t, e.kind = n, e.remaining = n === "loading" ? null : $(e), e.action = h, e === I && Ee(e), Ae(e, x.now()), k?.target.kind === "notification" && k.target.handle === e.handle && k.target.control === "action" && !t.action && (k = null);
|
|
448
510
|
}
|
|
449
|
-
function
|
|
511
|
+
function Xe(r, i) {
|
|
450
512
|
let a = typeof r == "function" ? r : null, c;
|
|
451
513
|
if (!a && (typeof r != "object" || !r || typeof (c = r.then) != "function")) throw TypeError("Operation source must be a factory or thenable");
|
|
452
514
|
let l = o(i, a !== null), u = (e) => i && typeof i == "object" ? Object.getOwnPropertyDescriptor(i, e)?.value : void 0, d = u("cancel"), f = !a && typeof d == "function" ? d : null, p = u("isCancellation"), h = typeof p == "function" ? p : null, g = l.length ? null : s({
|
|
@@ -455,12 +517,12 @@ function x(d, m) {
|
|
|
455
517
|
success: typeof i.success == "function" ? i.success : e(i.success),
|
|
456
518
|
error: typeof i.error == "function" ? i.error : e(i.error),
|
|
457
519
|
...i.cancelled === void 0 ? {} : { cancelled: typeof i.cancelled == "function" ? i.cancelled : e(i.cancelled) }
|
|
458
|
-
}), _ = /* @__PURE__ */ new Set(), v = null, x = !1, S,
|
|
459
|
-
function
|
|
520
|
+
}), _ = /* @__PURE__ */ new Set(), v = null, x = !1, S, ee = 0;
|
|
521
|
+
function w() {
|
|
460
522
|
let e = m.createCancellation(), t = s({
|
|
461
523
|
signal: e.signal,
|
|
462
|
-
token:
|
|
463
|
-
attempt: ++
|
|
524
|
+
token: K(),
|
|
525
|
+
attempt: ++ee
|
|
464
526
|
}), n, r, i = new Promise((e, t) => {
|
|
465
527
|
n = e, r = t;
|
|
466
528
|
}), a = {
|
|
@@ -476,53 +538,53 @@ function x(d, m) {
|
|
|
476
538
|
status: "pending",
|
|
477
539
|
cancelRequested: !1
|
|
478
540
|
};
|
|
479
|
-
return i.then((e) =>
|
|
480
|
-
|
|
541
|
+
return i.then((e) => ne(a, "fulfilled", e), (e) => ne(a, "rejected", e)).catch((e) => {
|
|
542
|
+
G || Y("callback-error", "operation-settlement", e);
|
|
481
543
|
}), a;
|
|
482
544
|
}
|
|
483
|
-
let
|
|
484
|
-
function
|
|
545
|
+
let E = w(), D = E;
|
|
546
|
+
function O() {
|
|
485
547
|
let e = {
|
|
486
|
-
token:
|
|
487
|
-
attempt:
|
|
488
|
-
status:
|
|
489
|
-
cancelRequested:
|
|
490
|
-
canCancel: !
|
|
491
|
-
canRetry: !
|
|
492
|
-
notification: x && !
|
|
548
|
+
token: D.context.token,
|
|
549
|
+
attempt: D.context.attempt,
|
|
550
|
+
status: D.status,
|
|
551
|
+
cancelRequested: D.cancelRequested,
|
|
552
|
+
canCancel: !G && D.status === "pending" && !D.cancelRequested && (!!a || !!f),
|
|
553
|
+
canRetry: !G && !!a && D.status !== "pending",
|
|
554
|
+
notification: x && !G ? v : null
|
|
493
555
|
};
|
|
494
556
|
return (!S || Object.keys(e).some((t) => e[t] !== S[t])) && (S = s(e)), S;
|
|
495
557
|
}
|
|
496
|
-
let
|
|
558
|
+
let k = {
|
|
497
559
|
source: "operation.subscribe",
|
|
498
|
-
callback: () =>
|
|
560
|
+
callback: () => xe(_, "operation.subscribe")
|
|
499
561
|
};
|
|
500
|
-
function
|
|
501
|
-
if (
|
|
562
|
+
function A(e) {
|
|
563
|
+
if (G || D !== e || !x || !v) return;
|
|
502
564
|
let t = C.get(v.id);
|
|
503
|
-
return t?.handle === v && t.operation ===
|
|
565
|
+
return t?.handle === v && t.operation === F ? t : void 0;
|
|
504
566
|
}
|
|
505
|
-
function
|
|
567
|
+
function j(e) {
|
|
506
568
|
try {
|
|
507
569
|
e.resolve(a ? a(e.context) : { then: c.bind(r) });
|
|
508
570
|
} catch (t) {
|
|
509
571
|
e.reject(t);
|
|
510
572
|
}
|
|
511
573
|
}
|
|
512
|
-
function
|
|
574
|
+
function te(e, t) {
|
|
513
575
|
if (t) {
|
|
514
|
-
let n =
|
|
515
|
-
t(),
|
|
516
|
-
} else
|
|
576
|
+
let n = X();
|
|
577
|
+
t(), Z(e, n);
|
|
578
|
+
} else Je(e);
|
|
517
579
|
}
|
|
518
|
-
function
|
|
580
|
+
function ne(t, r, i) {
|
|
519
581
|
if (t.status = r, r === "rejected") try {
|
|
520
582
|
(h ? h(i, t.context) === !0 : t.cancelRequested && typeof i == "object" && i && "name" in i && i.name === "AbortError") && (t.status = "cancelled");
|
|
521
583
|
} catch (e) {
|
|
522
|
-
|
|
584
|
+
G || Y("cancellation-error", "isCancellation", e);
|
|
523
585
|
}
|
|
524
586
|
let a;
|
|
525
|
-
if (
|
|
587
|
+
if (A(t) && g) {
|
|
526
588
|
let r = t.status, o = r === "fulfilled" ? b.messages?.operationSuccess ?? "Completed" : r === "cancelled" ? b.messages?.operationCancelled ?? "Cancelled" : b.messages?.operationError ?? "Something went wrong";
|
|
527
589
|
try {
|
|
528
590
|
let t = r === "fulfilled" ? g.success : r === "cancelled" ? g.cancelled : g.error, s = typeof t == "function" ? t(i) : t ?? { title: o };
|
|
@@ -532,118 +594,122 @@ function x(d, m) {
|
|
|
532
594
|
a = s({
|
|
533
595
|
title: o,
|
|
534
596
|
announcementPriority: "polite"
|
|
535
|
-
}),
|
|
597
|
+
}), G || Y("mapper-error", `track.${r}`, e, v ?? void 0);
|
|
536
598
|
}
|
|
537
599
|
}
|
|
538
|
-
let o =
|
|
539
|
-
|
|
600
|
+
let o = A(t), c = !!o && !!a;
|
|
601
|
+
te([...D === t ? [k] : [], {
|
|
540
602
|
type: "operation-settled",
|
|
603
|
+
source: "system",
|
|
541
604
|
handle: v,
|
|
542
605
|
token: t.context.token,
|
|
543
606
|
status: t.status,
|
|
544
607
|
uiApplied: c
|
|
545
|
-
}], o && a ? () =>
|
|
608
|
+
}], o && a ? () => Ye(o, a, t.status === "fulfilled" ? "success" : t.status === "cancelled" ? "warning" : "error") : void 0);
|
|
546
609
|
}
|
|
547
|
-
function
|
|
610
|
+
function M(e, n, r) {
|
|
548
611
|
e.cancelRequested = !0;
|
|
549
|
-
let
|
|
550
|
-
|
|
612
|
+
let i = A(e);
|
|
613
|
+
te([k, {
|
|
551
614
|
type: "cancellation-requested",
|
|
615
|
+
source: r,
|
|
552
616
|
handle: v,
|
|
553
617
|
token: e.context.token
|
|
554
|
-
}],
|
|
555
|
-
|
|
618
|
+
}], i ? () => {
|
|
619
|
+
i.content = t(i.content, { title: b.messages?.cancellationRequested ?? "Cancellation requested" });
|
|
556
620
|
} : void 0);
|
|
557
621
|
try {
|
|
558
622
|
e.abort(n), f?.(n);
|
|
559
623
|
} catch (e) {
|
|
560
|
-
|
|
624
|
+
G || Y("cancellation-error", "cancel", e, v ?? void 0);
|
|
561
625
|
}
|
|
562
626
|
}
|
|
563
|
-
function
|
|
627
|
+
function re() {
|
|
564
628
|
let e = /* @__PURE__ */ Error("Cancellation requested");
|
|
565
629
|
return e.name = "AbortError", e;
|
|
566
630
|
}
|
|
567
|
-
function
|
|
568
|
-
return
|
|
631
|
+
function N(e = re(), t) {
|
|
632
|
+
return G ? y("disposed") : D.status === "pending" ? !a && !f ? y("not-cancellable") : D.cancelRequested ? {
|
|
569
633
|
status: "unchanged",
|
|
570
634
|
reason: "already-requested"
|
|
571
|
-
} : (
|
|
635
|
+
} : (M(D, e, t), { status: "requested" }) : {
|
|
572
636
|
status: "unchanged",
|
|
573
637
|
reason: "settled"
|
|
574
638
|
};
|
|
575
639
|
}
|
|
576
|
-
function
|
|
577
|
-
if (
|
|
640
|
+
function P(e, t) {
|
|
641
|
+
if (G) return y("disposed");
|
|
578
642
|
if (!a) return y("not-retryable");
|
|
579
|
-
if (
|
|
580
|
-
let
|
|
581
|
-
|
|
582
|
-
let
|
|
583
|
-
return
|
|
643
|
+
if (D.status === "pending" && !e) return y("already-pending");
|
|
644
|
+
let n = D, r = w();
|
|
645
|
+
D = r;
|
|
646
|
+
let i = A(r);
|
|
647
|
+
return te([k, {
|
|
584
648
|
type: "operation-started",
|
|
649
|
+
source: t,
|
|
585
650
|
handle: v,
|
|
586
|
-
token:
|
|
587
|
-
attempt:
|
|
588
|
-
}],
|
|
589
|
-
|
|
590
|
-
} : void 0),
|
|
651
|
+
token: r.context.token,
|
|
652
|
+
attempt: r.context.attempt
|
|
653
|
+
}], i && g ? () => {
|
|
654
|
+
i.operationAnnounced.clear(), Ye(i, g.pending, "loading");
|
|
655
|
+
} : void 0), n.status === "pending" && !n.cancelRequested && M(n, re(), t), j(r), {
|
|
591
656
|
status: "started",
|
|
592
|
-
attempt:
|
|
657
|
+
attempt: r.public
|
|
593
658
|
};
|
|
594
659
|
}
|
|
595
|
-
let
|
|
596
|
-
getSnapshot:
|
|
597
|
-
retry: () =>
|
|
598
|
-
cancel:
|
|
599
|
-
detach: () => (x = !1,
|
|
600
|
-
},
|
|
601
|
-
if (
|
|
602
|
-
else if (!g)
|
|
660
|
+
let F = {
|
|
661
|
+
getSnapshot: O,
|
|
662
|
+
retry: (e) => P(!1, e),
|
|
663
|
+
cancel: N,
|
|
664
|
+
detach: () => (x = !1, k)
|
|
665
|
+
}, I;
|
|
666
|
+
if (G) I = y("disposed");
|
|
667
|
+
else if (!g) I = {
|
|
603
668
|
...y("invalid-input"),
|
|
604
669
|
issues: l
|
|
605
|
-
},
|
|
670
|
+
}, J({
|
|
606
671
|
code: "invalid-input",
|
|
607
672
|
source: "track",
|
|
608
673
|
message: "Invalid operation options"
|
|
609
674
|
});
|
|
610
675
|
else {
|
|
611
|
-
let e =
|
|
676
|
+
let e = qe({
|
|
612
677
|
...g.pending,
|
|
613
678
|
...g,
|
|
614
679
|
kind: "loading"
|
|
615
680
|
}, (e) => {
|
|
616
|
-
v = e.handle, x = !0, e.operation =
|
|
681
|
+
v = e.handle, x = !0, e.operation = F;
|
|
617
682
|
});
|
|
618
683
|
if (e.status === "deduplicated") throw Error("Tracked operation cannot be deduplicated");
|
|
619
|
-
|
|
684
|
+
I = e;
|
|
620
685
|
}
|
|
621
|
-
return
|
|
686
|
+
return I.status === "rejected" && Je([{
|
|
622
687
|
type: "operation-started",
|
|
688
|
+
source: "app",
|
|
623
689
|
handle: null,
|
|
624
|
-
token:
|
|
690
|
+
token: E.context.token,
|
|
625
691
|
attempt: 1
|
|
626
|
-
}]),
|
|
627
|
-
...
|
|
628
|
-
admission: s(
|
|
629
|
-
getSnapshot:
|
|
692
|
+
}]), j(E), s({
|
|
693
|
+
...E.public,
|
|
694
|
+
admission: s(I),
|
|
695
|
+
getSnapshot: O,
|
|
630
696
|
subscribe(e) {
|
|
631
|
-
let t =
|
|
632
|
-
return _.size &&
|
|
633
|
-
t(), _.size ||
|
|
697
|
+
let t = Ge(_, e);
|
|
698
|
+
return _.size && T.set(_, k), () => {
|
|
699
|
+
t(), _.size || T.delete(_);
|
|
634
700
|
};
|
|
635
701
|
},
|
|
636
|
-
cancel:
|
|
637
|
-
retry: () =>
|
|
638
|
-
restart: () =>
|
|
702
|
+
cancel: (e) => N(e, "app"),
|
|
703
|
+
retry: () => P(!1, "app"),
|
|
704
|
+
restart: () => P(!0, "app")
|
|
639
705
|
});
|
|
640
706
|
}
|
|
641
|
-
let
|
|
642
|
-
show: (e) =>
|
|
643
|
-
track:
|
|
644
|
-
update:
|
|
707
|
+
let Ze = s({
|
|
708
|
+
show: (e) => Ke(e),
|
|
709
|
+
track: Xe,
|
|
710
|
+
update: be((e, n) => {
|
|
645
711
|
let r = e.handle, a = i(n);
|
|
646
|
-
if (a.length) return
|
|
712
|
+
if (a.length) return J({
|
|
647
713
|
code: "invalid-input",
|
|
648
714
|
source: "update",
|
|
649
715
|
message: "Invalid notification patch",
|
|
@@ -655,26 +721,27 @@ function x(d, m) {
|
|
|
655
721
|
if (e.action.status === "pending" && Object.prototype.hasOwnProperty.call(n, "action")) return y("action-pending");
|
|
656
722
|
if (e.operation && (Object.prototype.hasOwnProperty.call(n, "kind") || e.operation.getSnapshot().status === "pending" && Object.prototype.hasOwnProperty.call(n, "duration"))) return y("operation-owned");
|
|
657
723
|
let o = t(e.content, n), s = n.kind ?? e.kind, c = n.priority ?? e.priority, l = Object.prototype.hasOwnProperty.call(n, "duration");
|
|
658
|
-
return o === e.content && s === e.kind && c === e.priority && !l && !(Object.prototype.hasOwnProperty.call(n, "action") && e.action.status === "failed") ? v :
|
|
659
|
-
let i =
|
|
724
|
+
return o === e.content && s === e.kind && c === e.priority && !l && !(Object.prototype.hasOwnProperty.call(n, "action") && e.action.status === "failed") ? v : Q((t) => {
|
|
725
|
+
let i = $(e);
|
|
660
726
|
e.content = o, Object.prototype.hasOwnProperty.call(n, "action") && (e.action = h), e.kind = s, e.priority = c;
|
|
661
|
-
let a =
|
|
662
|
-
(l || i !== a) && (e.remaining = a),
|
|
727
|
+
let a = $(e);
|
|
728
|
+
(l || i !== a) && (e.remaining = a), k?.target.kind === "notification" && k.target.handle === r && k.target.control === "action" && !o.action && (k = null), z?.record === e && !he(e) && (z = null), t.push({
|
|
663
729
|
type: "updated",
|
|
730
|
+
source: "app",
|
|
664
731
|
handle: r
|
|
665
732
|
});
|
|
666
733
|
});
|
|
667
734
|
}),
|
|
668
|
-
getHandle: (e) => !
|
|
669
|
-
dismiss: (e) =>
|
|
670
|
-
clear: () =>
|
|
735
|
+
getHandle: (e) => !G && typeof e == "string" ? C.get(e)?.handle : void 0,
|
|
736
|
+
dismiss: (e) => Ve(e, "programmatic", "app"),
|
|
737
|
+
clear: () => We("clear", "app"),
|
|
671
738
|
requestFocus(e = { kind: "anchor" }) {
|
|
672
|
-
if (
|
|
739
|
+
if (G) return y("disposed");
|
|
673
740
|
if (e?.kind === "notification") {
|
|
674
|
-
let t =
|
|
741
|
+
let t = ye(e.handle);
|
|
675
742
|
if (t) return y(t);
|
|
676
743
|
}
|
|
677
|
-
if (!
|
|
744
|
+
if (!A) return y("no-host");
|
|
678
745
|
if (!e || ![
|
|
679
746
|
"anchor",
|
|
680
747
|
"notification",
|
|
@@ -684,64 +751,64 @@ function x(d, m) {
|
|
|
684
751
|
let t = C.get(e.handle.id);
|
|
685
752
|
if (t !== I) return y("not-visible");
|
|
686
753
|
if (e.control !== void 0 && !["action", "close"].includes(e.control) || e.control === "action" && !t.content.action) return y("unavailable");
|
|
687
|
-
if (e.control !== void 0 && !
|
|
754
|
+
if (e.control !== void 0 && !N) return y("not-visible");
|
|
688
755
|
}
|
|
689
|
-
return e.kind === "overflow" && !
|
|
756
|
+
return e.kind === "overflow" && !U ? y("unavailable") : (Q(() => {
|
|
690
757
|
let t = e.kind === "notification" ? s({
|
|
691
758
|
kind: e.kind,
|
|
692
759
|
handle: e.handle,
|
|
693
760
|
...e.control ? { control: e.control } : {}
|
|
694
761
|
}) : s({ kind: e.kind });
|
|
695
|
-
|
|
696
|
-
token:
|
|
762
|
+
k = s({
|
|
763
|
+
token: K(),
|
|
697
764
|
target: t
|
|
698
765
|
});
|
|
699
766
|
}), { status: "requested" });
|
|
700
767
|
},
|
|
701
|
-
acknowledgeOverflow:
|
|
702
|
-
getSnapshot: () =>
|
|
768
|
+
acknowledgeOverflow: () => Ue("app"),
|
|
769
|
+
getSnapshot: () => le,
|
|
703
770
|
getServerSnapshot: () => p,
|
|
704
|
-
subscribe: (e) =>
|
|
705
|
-
onEvent: (e) =>
|
|
771
|
+
subscribe: (e) => Ge(ee, e),
|
|
772
|
+
onEvent: (e) => Ge(w, e),
|
|
706
773
|
dispose() {
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
for (let t of C.values())
|
|
710
|
-
for (let t of
|
|
711
|
-
|
|
774
|
+
G || Q((e) => {
|
|
775
|
+
G = !0;
|
|
776
|
+
for (let t of C.values()) ze(t, "dispose", e, "system");
|
|
777
|
+
for (let t of T.values()) e.includes(t) || e.push(t);
|
|
778
|
+
A = j = null, N && Be("system"), z = null, ke(), V = null, Pe(), k = null, E.clear(), U = W = 0;
|
|
712
779
|
}, !0);
|
|
713
780
|
}
|
|
714
781
|
});
|
|
715
|
-
return
|
|
782
|
+
return Te(), l.set(Ze, s({
|
|
716
783
|
options: b,
|
|
717
784
|
clock: x,
|
|
718
785
|
records: C,
|
|
719
|
-
globalPauses:
|
|
720
|
-
subscribe:
|
|
721
|
-
onEvent:
|
|
786
|
+
globalPauses: E,
|
|
787
|
+
subscribe: Ze.subscribe,
|
|
788
|
+
onEvent: Ze.onEvent,
|
|
722
789
|
get disposed() {
|
|
723
|
-
return
|
|
790
|
+
return G;
|
|
724
791
|
},
|
|
725
792
|
get presented() {
|
|
726
793
|
return I;
|
|
727
794
|
},
|
|
728
795
|
get rendererSnapshot() {
|
|
729
|
-
return
|
|
796
|
+
return ue;
|
|
730
797
|
},
|
|
731
798
|
get overflow() {
|
|
732
|
-
return
|
|
799
|
+
return U;
|
|
733
800
|
},
|
|
734
801
|
get lease() {
|
|
735
|
-
return
|
|
802
|
+
return A;
|
|
736
803
|
},
|
|
737
804
|
set lease(e) {
|
|
738
|
-
|
|
805
|
+
A = e;
|
|
739
806
|
},
|
|
740
807
|
get lastLease() {
|
|
741
|
-
return
|
|
808
|
+
return j;
|
|
742
809
|
},
|
|
743
810
|
set lastLease(e) {
|
|
744
|
-
|
|
811
|
+
j = e;
|
|
745
812
|
},
|
|
746
813
|
get hostDelay() {
|
|
747
814
|
return L;
|
|
@@ -756,11 +823,15 @@ function x(d, m) {
|
|
|
756
823
|
R = e;
|
|
757
824
|
},
|
|
758
825
|
get island() {
|
|
759
|
-
return
|
|
826
|
+
return N;
|
|
760
827
|
},
|
|
761
828
|
set island(e) {
|
|
762
|
-
|
|
829
|
+
N = e;
|
|
763
830
|
},
|
|
831
|
+
get announced() {
|
|
832
|
+
return F;
|
|
833
|
+
},
|
|
834
|
+
collapse: Be,
|
|
764
835
|
get attention() {
|
|
765
836
|
return z;
|
|
766
837
|
},
|
|
@@ -768,48 +839,52 @@ function x(d, m) {
|
|
|
768
839
|
z = e;
|
|
769
840
|
},
|
|
770
841
|
get focusRequest() {
|
|
771
|
-
return
|
|
842
|
+
return k;
|
|
772
843
|
},
|
|
773
844
|
set focusRequest(e) {
|
|
774
|
-
|
|
845
|
+
k = e;
|
|
775
846
|
},
|
|
776
847
|
get focused() {
|
|
777
|
-
return
|
|
848
|
+
return O;
|
|
778
849
|
},
|
|
779
850
|
set focused(e) {
|
|
780
|
-
|
|
851
|
+
O = e;
|
|
781
852
|
},
|
|
782
853
|
get overflowAnnounced() {
|
|
783
|
-
return
|
|
854
|
+
return W;
|
|
784
855
|
},
|
|
785
856
|
set overflowAnnounced(e) {
|
|
786
|
-
|
|
857
|
+
W = e;
|
|
787
858
|
},
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
859
|
+
interacting: q,
|
|
860
|
+
dirty: _e,
|
|
861
|
+
reach: Ne,
|
|
862
|
+
summon: Fe,
|
|
863
|
+
token: K,
|
|
864
|
+
diagnostic: J,
|
|
865
|
+
failure: Y,
|
|
866
|
+
mutate: Q,
|
|
867
|
+
commit: Z,
|
|
868
|
+
settle: X,
|
|
869
|
+
assign: Ee,
|
|
870
|
+
newest: fe,
|
|
871
|
+
formOf: ge,
|
|
872
|
+
handleError: ye,
|
|
873
|
+
withRecord: be,
|
|
874
|
+
autoDismissing: Le,
|
|
875
|
+
setHostAutoDismiss: Re,
|
|
876
|
+
dismiss: Ve,
|
|
877
|
+
acknowledgeOverflow: Ue,
|
|
878
|
+
clear: We,
|
|
804
879
|
reportRendererLoadError(e) {
|
|
805
|
-
|
|
880
|
+
G || J({
|
|
806
881
|
code: "renderer-load-error",
|
|
807
882
|
source: "Toaster",
|
|
808
883
|
message: "Toaster renderer failed to load",
|
|
809
884
|
error: e
|
|
810
885
|
});
|
|
811
886
|
}
|
|
812
|
-
})),
|
|
887
|
+
})), Ze;
|
|
813
888
|
}
|
|
814
889
|
//#endregion
|
|
815
890
|
export { _ as APPLIED, g as NO_FORM_ERRORS, m as RENDERER_SERVER, v as UNCHANGED, x as createCloudletCore, b as getControllerKernel, y as reject };
|