@synnaxlabs/drift 0.48.0 → 0.49.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,8 +1,8 @@
1
- import { configureStore as j } from "@reduxjs/toolkit";
2
- import { M as w, g, l as d, a as T, r as E, _ as y, Q as F, I as N, b as M, i as V, c as $, s as U, d as Q, e as Z, f as I, h as C, S as q, Z as K, j as X, k as B, m as Y, n as G, o as H, p as J, q as x, t as W, u as ee, v as se, w as te, x as ie, y as ae, z as oe, A as ne, B as ce, C as le, D as re, E as ue, F as fe } from "./state-BI4Gp9I9.js";
3
- import { s as de, a as we, b as he, c as ye, d as pe, e as _e } from "./selectors-DyMwTbxE.js";
4
- const be = new Error("request for lock canceled");
5
- var me = function(t, e, s, i) {
1
+ import { configureStore as N } from "@reduxjs/toolkit";
2
+ import { M as w, g as T, l as f, a as g, y as F, r as E, b as y, N as V, I as j, c as M, i as $, d as U, s as Q, e as Z, f as K, h as I, j as C, S as q, Z as X, k as B, m as G, n as H, o as Y, p as J, q as x, t as W, u as ee, v as se, w as ie, x as te, z as ae, A as oe, B as ne, C as ce, D as le, E as re, F as ue, G as de, H as fe } from "./state-D-AHxNXX.js";
3
+ import { s as we, a as he, b as ye, c as pe, d as _e, e as be } from "./selectors-UsB3Nvlx.js";
4
+ const me = new Error("request for lock canceled");
5
+ var ze = function(i, e, s, t) {
6
6
  function a(o) {
7
7
  return o instanceof s ? o : new s(function(c) {
8
8
  c(o);
@@ -11,39 +11,39 @@ var me = function(t, e, s, i) {
11
11
  return new (s || (s = Promise))(function(o, c) {
12
12
  function n(l) {
13
13
  try {
14
- u(i.next(l));
15
- } catch (f) {
16
- c(f);
14
+ u(t.next(l));
15
+ } catch (d) {
16
+ c(d);
17
17
  }
18
18
  }
19
19
  function r(l) {
20
20
  try {
21
- u(i.throw(l));
22
- } catch (f) {
23
- c(f);
21
+ u(t.throw(l));
22
+ } catch (d) {
23
+ c(d);
24
24
  }
25
25
  }
26
26
  function u(l) {
27
27
  l.done ? o(l.value) : a(l.value).then(n, r);
28
28
  }
29
- u((i = i.apply(t, e || [])).next());
29
+ u((t = t.apply(i, e || [])).next());
30
30
  });
31
31
  };
32
- class ze {
33
- constructor(e, s = be) {
32
+ class Se {
33
+ constructor(e, s = me) {
34
34
  this._value = e, this._cancelError = s, this._queue = [], this._weightedWaiters = [];
35
35
  }
36
36
  acquire(e = 1, s = 0) {
37
37
  if (e <= 0)
38
38
  throw new Error(`invalid weight ${e}: must be positive`);
39
- return new Promise((i, a) => {
40
- const o = { resolve: i, reject: a, weight: e, priority: s }, c = O(this._queue, (n) => s <= n.priority);
39
+ return new Promise((t, a) => {
40
+ const o = { resolve: t, reject: a, weight: e, priority: s }, c = O(this._queue, (n) => s <= n.priority);
41
41
  c === -1 && e <= this._value ? this._dispatchItem(o) : this._queue.splice(c + 1, 0, o);
42
42
  });
43
43
  }
44
44
  runExclusive(e) {
45
- return me(this, arguments, void 0, function* (s, i = 1, a = 0) {
46
- const [o, c] = yield this.acquire(i, a);
45
+ return ze(this, arguments, void 0, function* (s, t = 1, a = 0) {
46
+ const [o, c] = yield this.acquire(t, a);
47
47
  try {
48
48
  return yield s(o);
49
49
  } finally {
@@ -54,8 +54,8 @@ class ze {
54
54
  waitForUnlock(e = 1, s = 0) {
55
55
  if (e <= 0)
56
56
  throw new Error(`invalid weight ${e}: must be positive`);
57
- return this._couldLockImmediately(e, s) ? Promise.resolve() : new Promise((i) => {
58
- this._weightedWaiters[e - 1] || (this._weightedWaiters[e - 1] = []), Se(this._weightedWaiters[e - 1], { resolve: i, priority: s });
57
+ return this._couldLockImmediately(e, s) ? Promise.resolve() : new Promise((t) => {
58
+ this._weightedWaiters[e - 1] || (this._weightedWaiters[e - 1] = []), ke(this._weightedWaiters[e - 1], { resolve: t, priority: s });
59
59
  });
60
60
  }
61
61
  isLocked() {
@@ -93,16 +93,16 @@ class ze {
93
93
  if (this._queue.length === 0)
94
94
  for (let e = this._value; e > 0; e--) {
95
95
  const s = this._weightedWaiters[e - 1];
96
- s && (s.forEach((i) => i.resolve()), this._weightedWaiters[e - 1] = []);
96
+ s && (s.forEach((t) => t.resolve()), this._weightedWaiters[e - 1] = []);
97
97
  }
98
98
  else {
99
99
  const e = this._queue[0].priority;
100
100
  for (let s = this._value; s > 0; s--) {
101
- const i = this._weightedWaiters[s - 1];
102
- if (!i)
101
+ const t = this._weightedWaiters[s - 1];
102
+ if (!t)
103
103
  continue;
104
- const a = i.findIndex((o) => o.priority <= e);
105
- (a === -1 ? i : i.splice(0, a)).forEach(((o) => o.resolve()));
104
+ const a = t.findIndex((o) => o.priority <= e);
105
+ (a === -1 ? t : t.splice(0, a)).forEach(((o) => o.resolve()));
106
106
  }
107
107
  }
108
108
  }
@@ -110,17 +110,17 @@ class ze {
110
110
  return (this._queue.length === 0 || this._queue[0].priority < s) && e <= this._value;
111
111
  }
112
112
  }
113
- function Se(t, e) {
114
- const s = O(t, (i) => e.priority <= i.priority);
115
- t.splice(s + 1, 0, e);
113
+ function ke(i, e) {
114
+ const s = O(i, (t) => e.priority <= t.priority);
115
+ i.splice(s + 1, 0, e);
116
116
  }
117
- function O(t, e) {
118
- for (let s = t.length - 1; s >= 0; s--)
119
- if (e(t[s]))
117
+ function O(i, e) {
118
+ for (let s = i.length - 1; s >= 0; s--)
119
+ if (e(i[s]))
120
120
  return s;
121
121
  return -1;
122
122
  }
123
- var ke = function(t, e, s, i) {
123
+ var ve = function(i, e, s, t) {
124
124
  function a(o) {
125
125
  return o instanceof s ? o : new s(function(c) {
126
126
  c(o);
@@ -129,30 +129,30 @@ var ke = function(t, e, s, i) {
129
129
  return new (s || (s = Promise))(function(o, c) {
130
130
  function n(l) {
131
131
  try {
132
- u(i.next(l));
133
- } catch (f) {
134
- c(f);
132
+ u(t.next(l));
133
+ } catch (d) {
134
+ c(d);
135
135
  }
136
136
  }
137
137
  function r(l) {
138
138
  try {
139
- u(i.throw(l));
140
- } catch (f) {
141
- c(f);
139
+ u(t.throw(l));
140
+ } catch (d) {
141
+ c(d);
142
142
  }
143
143
  }
144
144
  function u(l) {
145
145
  l.done ? o(l.value) : a(l.value).then(n, r);
146
146
  }
147
- u((i = i.apply(t, e || [])).next());
147
+ u((t = t.apply(i, e || [])).next());
148
148
  });
149
149
  };
150
- class ve {
150
+ class Te {
151
151
  constructor(e) {
152
- this._semaphore = new ze(1, e);
152
+ this._semaphore = new Se(1, e);
153
153
  }
154
154
  acquire() {
155
- return ke(this, arguments, void 0, function* (e = 0) {
155
+ return ve(this, arguments, void 0, function* (e = 0) {
156
156
  const [, s] = yield this._semaphore.acquire(1, e);
157
157
  return s;
158
158
  });
@@ -173,223 +173,209 @@ class ve {
173
173
  return this._semaphore.cancel();
174
174
  }
175
175
  }
176
- const ge = (t) => [...new Set(t)], Te = (t, e, s = !0) => {
177
- const i = /* @__PURE__ */ new Map();
178
- return t.forEach((a) => {
179
- const o = e(a);
180
- if (i.has(o)) {
181
- if (s) return;
182
- i.delete(o);
183
- }
184
- i.set(o, a);
185
- }), Array.from(i.values());
186
- }, Ee = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
187
- __proto__: null,
188
- by: Te,
189
- unique: ge
190
- }, Symbol.toStringTag, { value: "Module" })), L = "DA@", A = "://", Me = (t, e) => L.concat(e, A, t), Ie = (t) => {
191
- const [e, s] = t.split(A);
192
- if (s == null) return [t, ""];
193
- const [, i] = e.split(L);
194
- return [s, i];
195
- }, z = (t, e) => ({
196
- ...t,
197
- type: Me(t.type, e)
198
- }), Ce = (t) => {
199
- const [e, s] = Ie(t.type);
176
+ const L = "DA@", A = "://", ge = (i, e) => L.concat(e, A, i), Ee = (i) => {
177
+ const [e, s] = i.split(A);
178
+ if (s == null) return [i, ""];
179
+ const [, t] = e.split(L);
180
+ return [s, t];
181
+ }, z = (i, e) => ({
182
+ ...i,
183
+ type: ge(i.type, e)
184
+ }), Me = (i) => {
185
+ const [e, s] = Ee(i.type);
200
186
  return {
201
187
  emitted: s != null && s.length > 0,
202
188
  emitter: s,
203
- action: { ...t, type: e }
189
+ action: { ...i, type: e }
204
190
  };
205
- }, qe = (t) => {
191
+ }, Ie = (i) => {
206
192
  const {
207
193
  centerCount: e,
208
194
  processCount: s,
209
- focusCount: i,
195
+ focusCount: t,
210
196
  stage: a,
211
197
  key: o,
212
198
  prerenderLabel: c,
213
199
  reserved: n,
214
200
  minimized: r,
215
201
  ...u
216
- } = t;
202
+ } = i;
217
203
  return u;
218
- }, Oe = async (t, e, s, i) => {
204
+ }, Ce = async (i, e, s, t) => {
219
205
  const a = (await s.listLabels()).filter(
220
206
  (l) => l !== w
221
- ), o = Object.keys(t.windows).filter((l) => l !== w);
222
- g(i, "syncInitial"), d(i, "existing windows in runtime", a.sort()), d(i, "non-main windows in state", o.sort()), T(i);
223
- const c = Ee.unique([...a, ...o]);
207
+ ), o = Object.keys(i.windows).filter((l) => l !== w);
208
+ T(t, "syncInitial"), f(t, "existing windows in runtime", a.sort()), f(t, "non-main windows in state", o.sort()), g(t);
209
+ const c = F.unique([...a, ...o]);
224
210
  for (const l of c)
225
- !a.includes(l) && s.isMain() ? (d(i, "state window not in runtime, creating", l), await R(s, l, t.windows[l], i)) : o.includes(l) || (d(i, "runtime window not in state, closing", l), await p(s, l, i));
226
- const n = s.label(), r = t.windows[n];
211
+ !a.includes(l) && s.isMain() ? (f(t, "state window not in runtime, creating", l), await R(s, l, i.windows[l], t)) : o.includes(l) || (f(t, "runtime window not in state, closing", l), await p(s, l, t));
212
+ const n = s.label(), r = i.windows[n];
227
213
  if (r == null) return;
228
- const u = { ...N };
229
- await P(u, r, s, i), e(
214
+ const u = { ...j };
215
+ await P(u, r, s, t), e(
230
216
  E({ label: s.label(), ...await s.getProps() })
231
217
  );
232
- }, Le = async (t, e, s, i) => {
233
- d(i, "sync", t, e), s.isMain() && await Ae(t, e, s, i);
234
- const a = t.windows[s.label()], o = e.windows[s.label()];
235
- a == null || o == null || await P(a, o, s, i);
236
- }, P = async (t, e, s, i) => {
218
+ }, qe = async (i, e, s, t) => {
219
+ f(t, "sync", i, e), s.isMain() && await Oe(i, e, s, t);
220
+ const a = i.windows[s.label()], o = e.windows[s.label()];
221
+ a == null || o == null || await P(a, o, s, t);
222
+ }, P = async (i, e, s, t) => {
237
223
  const a = [];
238
- e.title != null && e.title !== t.title && a.push([
224
+ e.title != null && e.title !== i.title && a.push([
239
225
  "title",
240
- { prev: t.title, next: e.title },
226
+ { prev: i.title, next: e.title },
241
227
  async () => s.setTitle(e.title)
242
228
  ]);
243
- const o = e.visible != null && e.visible !== t.visible, c = e.visible === !1, n = () => a.push([
229
+ const o = e.visible != null && e.visible !== i.visible, c = e.visible === !1, n = () => a.push([
244
230
  "visible",
245
- { prev: t.visible, next: e.visible },
231
+ { prev: i.visible, next: e.visible },
246
232
  async () => {
247
233
  if (await s.setVisible(e.visible), e.visible === !1) return;
248
234
  let r = e.position;
249
- r ??= (await s.getProps()).position, r != null && (await s.setPosition(F.translate(r, { x: 1, y: 1 })), await s.setPosition(r));
235
+ r ??= (await s.getProps()).position, r != null && (await s.setPosition(V.translate(r, { x: 1, y: 1 })), await s.setPosition(r));
250
236
  }
251
237
  ]);
252
- if (o && c && n(), e.skipTaskbar != null && e.skipTaskbar !== t.skipTaskbar && a.push([
238
+ if (o && c && n(), e.skipTaskbar != null && e.skipTaskbar !== i.skipTaskbar && a.push([
253
239
  "skipTaskbar",
254
- { prev: t.skipTaskbar, next: e.skipTaskbar },
240
+ { prev: i.skipTaskbar, next: e.skipTaskbar },
255
241
  async () => await s.setSkipTaskbar(e.skipTaskbar)
256
- ]), e.maximized != null && e.maximized !== t.maximized && a.push([
242
+ ]), e.maximized != null && e.maximized !== i.maximized && a.push([
257
243
  "maximized",
258
- { prev: t.maximized, next: e.maximized },
244
+ { prev: i.maximized, next: e.maximized },
259
245
  async () => await s.setMaximized(e.maximized)
260
- ]), e.fullscreen != null && e.fullscreen !== t.fullscreen && a.push([
246
+ ]), e.fullscreen != null && e.fullscreen !== i.fullscreen && a.push([
261
247
  "fullscreen",
262
- { prev: t.fullscreen, next: e.fullscreen },
248
+ { prev: i.fullscreen, next: e.fullscreen },
263
249
  async () => await s.setFullscreen(e.fullscreen)
264
- ]), e.centerCount !== t.centerCount && a.push([
250
+ ]), e.centerCount !== i.centerCount && a.push([
265
251
  "center",
266
- { prev: t.centerCount, next: e.centerCount },
252
+ { prev: i.centerCount, next: e.centerCount },
267
253
  async () => s.center()
268
- ]), e.minimized != null && e.minimized !== t.minimized && a.push([
254
+ ]), e.minimized != null && e.minimized !== i.minimized && a.push([
269
255
  "minimized",
270
- { prev: t.minimized, next: e.minimized },
256
+ { prev: i.minimized, next: e.minimized },
271
257
  async () => await s.setMinimized(e.minimized)
272
- ]), e.resizable != null && e.resizable !== t.resizable && a.push([
258
+ ]), e.resizable != null && e.resizable !== i.resizable && a.push([
273
259
  "resizable",
274
- { prev: t.resizable, next: e.resizable },
260
+ { prev: i.resizable, next: e.resizable },
275
261
  async () => await s.setResizable(e.resizable)
276
- ]), e.minSize != null && !y.equals(e.minSize, t.minSize) && a.push([
262
+ ]), e.minSize != null && !y.equals(e.minSize, i.minSize) && a.push([
277
263
  "minSize",
278
- { prev: t.minSize, next: e.minSize },
264
+ { prev: i.minSize, next: e.minSize },
279
265
  async () => await s.setMinSize(e.minSize)
280
- ]), e.maxSize != null && !y.equals(e.maxSize, t.maxSize) && a.push([
266
+ ]), e.maxSize != null && !y.equals(e.maxSize, i.maxSize) && a.push([
281
267
  "maxSize",
282
- { prev: t.maxSize, next: e.maxSize },
268
+ { prev: i.maxSize, next: e.maxSize },
283
269
  async () => await s.setMaxSize(e.maxSize)
284
- ]), e.size != null && !y.equals(e.size, t.size) && a.push([
270
+ ]), e.size != null && !y.equals(e.size, i.size) && a.push([
285
271
  "size",
286
- { prev: t.size, next: e.size },
272
+ { prev: i.size, next: e.size },
287
273
  async () => await s.setSize(e.size)
288
- ]), e.position != null && !y.equals(e.position, t.position) && a.push([
274
+ ]), e.position != null && !y.equals(e.position, i.position) && a.push([
289
275
  "position",
290
- { prev: t.position, next: e.position },
276
+ { prev: i.position, next: e.position },
291
277
  async () => await s.setPosition(e.position)
292
- ]), e.focusCount !== t.focusCount && a.push(
278
+ ]), e.focusCount !== i.focusCount && a.push(
293
279
  [
294
280
  "setVisible",
295
- { prev: t.visible, next: e.visible },
281
+ { prev: i.visible, next: e.visible },
296
282
  async () => await s.setVisible(!0)
297
283
  ],
298
284
  [
299
285
  "focus",
300
- { prev: t.focusCount, next: e.focusCount },
286
+ { prev: i.focusCount, next: e.focusCount },
301
287
  async () => await s.focus()
302
288
  ]
303
- ), e.decorations != null && e.decorations !== t.decorations && a.push([
289
+ ), e.decorations != null && e.decorations !== i.decorations && a.push([
304
290
  "decorations",
305
- { prev: t.decorations, next: e.decorations },
291
+ { prev: i.decorations, next: e.decorations },
306
292
  async () => await s.setDecorations(e.decorations)
307
- ]), e.alwaysOnTop != null && e.alwaysOnTop !== t.alwaysOnTop && a.push([
293
+ ]), e.alwaysOnTop != null && e.alwaysOnTop !== i.alwaysOnTop && a.push([
308
294
  "alwaysOnTop",
309
- { prev: t.alwaysOnTop, next: e.alwaysOnTop },
295
+ { prev: i.alwaysOnTop, next: e.alwaysOnTop },
310
296
  async () => await s.setAlwaysOnTop(e.alwaysOnTop)
311
297
  ]), o && !c && n(), a.length !== 0) {
312
- g(i, `syncCurrent, label: ${s.label()}, key: ${e.key}`);
313
- for (const [r, { prev: u, next: l }] of a) d(i, r, u, "->", l);
314
- T(i);
298
+ T(t, `syncCurrent, label: ${s.label()}, key: ${e.key}`);
299
+ for (const [r, { prev: u, next: l }] of a) f(t, r, u, "->", l);
300
+ g(t);
315
301
  for (const [, , r] of a) await r();
316
302
  }
317
- }, Ae = async (t, e, s, i) => {
318
- const a = Object.keys(t.windows).filter((n) => !(n in e.windows)), o = Object.keys(e.windows).filter((n) => !(n in t.windows)), c = s.isMain();
303
+ }, Oe = async (i, e, s, t) => {
304
+ const a = Object.keys(i.windows).filter((n) => !(n in e.windows)), o = Object.keys(e.windows).filter((n) => !(n in i.windows)), c = s.isMain();
319
305
  if (c && a.length > 0)
320
306
  for (const n of a)
321
- d(i, "syncMain", "closing", n), n === w && await Promise.all(
322
- Object.keys(e.windows).filter((r) => r !== w).map(async (r) => await p(s, r, i))
323
- ), await p(s, n, i);
307
+ f(t, "syncMain", "closing", n), n === w && await Promise.all(
308
+ Object.keys(e.windows).filter((r) => r !== w).map(async (r) => await p(s, r, t))
309
+ ), await p(s, n, t);
324
310
  if (c && o.length > 0)
325
311
  for (const n of o)
326
- await R(s, n, e.windows[n], i);
327
- }, R = async (t, e, s, i) => (d(i, "createWindow", s), await t.create(e, qe(s))), p = async (t, e, s) => (d(s, "closeWindow", e), await t.close(e)), S = "[drift] - unexpected undefined action", k = "[drift] - unexpected undefined action type", _ = (t) => {
328
- if (t.emitted ??= !1, t.action == null)
329
- throw console.warn(S, t), new Error(S);
330
- if (t.action.type == null || t.action.type.length === 0)
331
- throw console.warn(k, t), new Error(k);
332
- }, Pe = new ve(), Re = [E.type, M.type], De = (t, e = !1) => (s) => (i) => (a) => {
333
- let { action: o, emitted: c, emitter: n } = Ce(a);
334
- const r = t.label();
312
+ await R(s, n, e.windows[n], t);
313
+ }, R = async (i, e, s, t) => (f(t, "createWindow", s), await i.create(e, Ie(s))), p = async (i, e, s) => (f(s, "closeWindow", e), await i.close(e)), S = "[drift] - unexpected undefined action", k = "[drift] - unexpected undefined action type", _ = (i) => {
314
+ if (i.emitted ??= !1, i.action == null)
315
+ throw console.warn(S, i), new Error(S);
316
+ if (i.action.type == null || i.action.type.length === 0)
317
+ throw console.warn(k, i), new Error(k);
318
+ }, Le = new Te(), Ae = [E.type, M.type], Pe = (i, e = !1) => (s) => (t) => (a) => {
319
+ let { action: o, emitted: c, emitter: n } = Me(a);
320
+ const r = i.label();
335
321
  _({ action: a, emitted: c, emitter: n });
336
- const u = V(o.type);
337
- if (u && d(e, "[drift] - middleware", {
322
+ const u = $(o.type);
323
+ if (u && f(e, "[drift] - middleware", {
338
324
  action: o,
339
325
  emitted: c,
340
326
  emitter: n,
341
327
  host: r
342
- }), n === t.label()) return;
343
- const l = u && !Re.includes(o.type);
344
- let f = null;
345
- u && (f = s.getState().drift, o = $(
328
+ }), n === i.label()) return;
329
+ const l = u && !Ae.includes(o.type);
330
+ let d = null;
331
+ u && (d = s.getState().drift, o = U(
346
332
  o,
347
- f
333
+ d
348
334
  ));
349
- const h = i(o), b = l ? s.getState().drift : null, D = U(c, o.type);
350
- return Pe.runExclusive(async () => {
335
+ const h = t(o), b = l ? s.getState().drift : null, D = Q(c, o.type);
336
+ return Le.runExclusive(async () => {
351
337
  try {
352
- f !== null && b !== null && await Le(f, b, t, e), D && await t.emit({ action: o });
338
+ d !== null && b !== null && await qe(d, b, i, e), D && await i.emit({ action: o });
353
339
  } catch (m) {
354
- d(e, "[drift] - ERROR", {
340
+ f(e, "[drift] - ERROR", {
355
341
  error: m.message,
356
342
  action: o,
357
343
  emitted: c,
358
344
  emitter: n,
359
345
  host: r
360
- }), s.dispatch(Q({ key: r, message: m.message }));
346
+ }), s.dispatch(Z({ key: r, message: m.message }));
361
347
  }
362
348
  }), h;
363
- }, je = (t, e, s = !1) => (i) => {
364
- const a = t != null ? typeof t == "function" ? t(i) : t : i();
365
- return [De(e, s), ...a];
366
- }, Fe = async ({
367
- runtime: t,
349
+ }, Re = (i, e, s = !1) => (t) => {
350
+ const a = i != null ? typeof i == "function" ? i(t) : i : t();
351
+ return [Pe(e, s), ...a];
352
+ }, De = async ({
353
+ runtime: i,
368
354
  preloadedState: e,
369
355
  middleware: s,
370
- debug: i = !1,
356
+ debug: t = !1,
371
357
  enablePrerender: a = !0,
372
358
  defaultWindowProps: o,
373
359
  ...c
374
360
  }) => {
375
- await t.configure();
361
+ await i.configure();
376
362
  let n;
377
- n = j({
363
+ n = N({
378
364
  ...c,
379
365
  preloadedState: await Ne(
380
- i,
381
366
  t,
367
+ i,
382
368
  () => n,
383
369
  o,
384
370
  e
385
371
  ),
386
- middleware: je(s, t, i)
387
- }), await Oe(n.getState().drift, n.dispatch, t, i);
388
- const r = t.label();
372
+ middleware: Re(s, i, t)
373
+ }), await Ce(n.getState().drift, n.dispatch, i, t);
374
+ const r = i.label();
389
375
  return n.dispatch(
390
- Z({ enablePrerender: a, defaultWindowProps: o, debug: i, label: r })
391
- ), n.dispatch(I({ stage: "created" })), t.onCloseRequested(() => n?.dispatch(C({}))), n;
392
- }, Ne = async (t, e, s, i, a) => e.isMain() ? (await e.subscribe(({ action: c, emitter: n, sendState: r }) => {
376
+ K({ enablePrerender: a, defaultWindowProps: o, debug: t, label: r })
377
+ ), n.dispatch(I({ stage: "created" })), i.onCloseRequested(() => n?.dispatch(C({}))), n;
378
+ }, Ne = async (i, e, s, t, a) => e.isMain() ? (await e.subscribe(({ action: c, emitter: n, sendState: r }) => {
393
379
  const u = s();
394
380
  if (u == null) return;
395
381
  if (c != null) {
@@ -398,27 +384,27 @@ const ge = (t) => [...new Set(t)], Te = (t, e, s = !0) => {
398
384
  }
399
385
  const l = u.getState();
400
386
  r === !0 && e.emit({ state: l }, n);
401
- }), typeof a == "function" ? v(i, t, await a()) : v(i, t, a)) : await new Promise((c, n) => {
387
+ }), typeof a == "function" ? v(t, i, await a()) : v(t, i, a)) : await new Promise((c, n) => {
402
388
  (async () => {
403
389
  try {
404
- await e.subscribe(({ action: u, emitter: l, state: f }) => {
390
+ await e.subscribe(({ action: u, emitter: l, state: d }) => {
405
391
  const h = s();
406
392
  if (h == null)
407
- return f != null ? c(f) : void 0;
393
+ return d != null ? c(d) : void 0;
408
394
  u != null && (_({ action: u, emitter: l }), h.dispatch(z(u, l)));
409
395
  }), await e.emit({ sendState: !0 }, w);
410
396
  } catch (u) {
411
397
  n(u);
412
398
  }
413
399
  })();
414
- }), Ve = Fe, v = (t, e, s) => {
400
+ }), Fe = De, v = (i, e, s) => {
415
401
  if (s == null) return s;
416
- const i = s[q];
417
- return i.config.debug = e ?? i.config.debug, i.windows = Object.fromEntries(
418
- Object.entries(i.windows).filter(([, a]) => a.reserved).map(([a, o]) => (t?.visible != null && (o.visible = t.visible), o.focusCount = 0, o.centerCount = 0, o.processCount = 0, [a, o]))
402
+ const t = s[q];
403
+ return t.config.debug = e ?? t.config.debug, t.windows = Object.fromEntries(
404
+ Object.entries(t.windows).filter(([, a]) => a.reserved).map(([a, o]) => (i?.visible != null && (o.visible = i.visible), o.focusCount = 0, o.centerCount = 0, o.processCount = 0, [a, o]))
419
405
  ), s;
420
406
  };
421
- class $e {
407
+ class Ve {
422
408
  async emit() {
423
409
  }
424
410
  async subscribe() {
@@ -474,77 +460,77 @@ class $e {
474
460
  async configure() {
475
461
  }
476
462
  }
477
- const Ke = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
463
+ const Qe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
478
464
  __proto__: null,
479
465
  MAIN_WINDOW: w,
480
- NoopRuntime: $e,
466
+ NoopRuntime: Ve,
481
467
  SLICE_NAME: q,
482
- ZERO_SLICE_STATE: K,
468
+ ZERO_SLICE_STATE: X,
483
469
  closeWindow: C,
484
- completeProcess: X,
485
- configureStore: Ve,
486
- createWindow: B,
487
- focusWindow: Y,
488
- reducer: G,
489
- registerProcess: H,
470
+ completeProcess: B,
471
+ configureStore: Fe,
472
+ createWindow: G,
473
+ focusWindow: H,
474
+ reducer: Y,
475
+ registerProcess: J,
490
476
  reloadWindow: M,
491
- selectSliceState: de,
492
- selectWindow: we,
493
- selectWindowAttribute: he,
494
- selectWindowKey: ye,
495
- selectWindowLabel: pe,
496
- selectWindows: _e,
497
- setWindowAlwaysOnTop: J,
498
- setWindowDecorations: x,
499
- setWindowFullscreen: W,
500
- setWindowMaxSize: ee,
501
- setWindowMaximized: se,
477
+ selectSliceState: we,
478
+ selectWindow: he,
479
+ selectWindowAttribute: ye,
480
+ selectWindowKey: pe,
481
+ selectWindowLabel: _e,
482
+ selectWindows: be,
483
+ setWindowAlwaysOnTop: x,
484
+ setWindowDecorations: W,
485
+ setWindowFullscreen: ee,
486
+ setWindowMaxSize: se,
487
+ setWindowMaximized: ie,
502
488
  setWindowMinSize: te,
503
- setWindowMinimized: ie,
504
- setWindowPosition: ae,
505
- setWindowProps: oe,
506
- setWindowResizable: ne,
507
- setWindowSize: ce,
508
- setWindowSkipTaskbar: le,
489
+ setWindowMinimized: ae,
490
+ setWindowPosition: oe,
491
+ setWindowProps: ne,
492
+ setWindowResizable: ce,
493
+ setWindowSize: le,
494
+ setWindowSkipTaskbar: re,
509
495
  setWindowStage: I,
510
- setWindowTitle: re,
511
- setWindowVisible: ue,
496
+ setWindowTitle: ue,
497
+ setWindowVisible: de,
512
498
  windowPropsZ: fe
513
499
  }, Symbol.toStringTag, { value: "Module" }));
514
500
  export {
515
- Ke as Drift,
501
+ Qe as Drift,
516
502
  w as MAIN_WINDOW,
517
- $e as NoopRuntime,
503
+ Ve as NoopRuntime,
518
504
  q as SLICE_NAME,
519
- K as ZERO_SLICE_STATE,
505
+ X as ZERO_SLICE_STATE,
520
506
  C as closeWindow,
521
- X as completeProcess,
522
- Ve as configureStore,
523
- B as createWindow,
524
- Y as focusWindow,
525
- G as reducer,
526
- H as registerProcess,
507
+ B as completeProcess,
508
+ Fe as configureStore,
509
+ G as createWindow,
510
+ H as focusWindow,
511
+ Y as reducer,
512
+ J as registerProcess,
527
513
  M as reloadWindow,
528
- de as selectSliceState,
529
- we as selectWindow,
530
- he as selectWindowAttribute,
531
- ye as selectWindowKey,
532
- pe as selectWindowLabel,
533
- _e as selectWindows,
534
- J as setWindowAlwaysOnTop,
535
- x as setWindowDecorations,
536
- W as setWindowFullscreen,
537
- ee as setWindowMaxSize,
538
- se as setWindowMaximized,
514
+ we as selectSliceState,
515
+ he as selectWindow,
516
+ ye as selectWindowAttribute,
517
+ pe as selectWindowKey,
518
+ _e as selectWindowLabel,
519
+ be as selectWindows,
520
+ x as setWindowAlwaysOnTop,
521
+ W as setWindowDecorations,
522
+ ee as setWindowFullscreen,
523
+ se as setWindowMaxSize,
524
+ ie as setWindowMaximized,
539
525
  te as setWindowMinSize,
540
- ie as setWindowMinimized,
541
- ae as setWindowPosition,
542
- oe as setWindowProps,
543
- ne as setWindowResizable,
544
- ce as setWindowSize,
545
- le as setWindowSkipTaskbar,
526
+ ae as setWindowMinimized,
527
+ oe as setWindowPosition,
528
+ ne as setWindowProps,
529
+ ce as setWindowResizable,
530
+ le as setWindowSize,
531
+ re as setWindowSkipTaskbar,
546
532
  I as setWindowStage,
547
- re as setWindowTitle,
548
- ue as setWindowVisible,
533
+ ue as setWindowTitle,
534
+ de as setWindowVisible,
549
535
  fe as windowPropsZ
550
536
  };