@overlayed/app 0.8.4 → 0.9.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/dist/index.js CHANGED
@@ -1,17 +1,17 @@
1
- var it = Object.defineProperty;
2
- var at = (s, e, t) => e in s ? it(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t;
3
- var l = (s, e, t) => at(s, typeof e != "symbol" ? e + "" : e, t);
4
- import { type as L } from "arktype";
5
- import S, { mkdirSync as ge, existsSync as fe, writeFileSync as pe, createWriteStream as Oe, readdirSync as Re, unlinkSync as xe, readFileSync as Te, copyFileSync as ot } from "node:fs";
6
- import y, { join as $, resolve as lt } from "node:path";
7
- import { createRequire as te } from "node:module";
8
- import E from "node:fs/promises";
9
- import Ne from "jszip";
10
- import { createHash as ct } from "node:crypto";
11
- import ht from "node:events";
12
- import ut, { app as Ge } from "electron";
13
- var dt = Object.defineProperty, gt = (s, e, t) => e in s ? dt(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t, b = (s, e, t) => gt(s, typeof e != "symbol" ? e + "" : e, t);
14
- function ft(s) {
1
+ var ut = Object.defineProperty;
2
+ var ht = (s, e, t) => e in s ? ut(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t;
3
+ var c = (s, e, t) => ht(s, typeof e != "symbol" ? e + "" : e, t);
4
+ import { type as R } from "arktype";
5
+ import M, { mkdirSync as be, existsSync as ve, writeFileSync as we, createWriteStream as Ge, readdirSync as je, unlinkSync as Ue, readFileSync as ze, copyFileSync as dt } from "node:fs";
6
+ import m, { join as x, resolve as gt } from "node:path";
7
+ import { createRequire as ae } from "node:module";
8
+ import S from "node:fs/promises";
9
+ import He from "jszip";
10
+ import { createHash as ft } from "node:crypto";
11
+ import pt from "node:events";
12
+ import yt, { app as Ve } from "electron";
13
+ var mt = Object.defineProperty, bt = (s, e, t) => e in s ? mt(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t, E = (s, e, t) => bt(s, typeof e != "symbol" ? e + "" : e, t);
14
+ function vt(s) {
15
15
  return { all: s = s || /* @__PURE__ */ new Map(), on: function(e, t) {
16
16
  var r = s.get(e);
17
17
  r ? r.push(t) : s.set(e, [t]);
@@ -27,9 +27,9 @@ function ft(s) {
27
27
  });
28
28
  } };
29
29
  }
30
- class ye {
30
+ class Ee {
31
31
  constructor() {
32
- b(this, "emitter"), this.emitter = ft();
32
+ E(this, "emitter"), this.emitter = vt();
33
33
  }
34
34
  on(e, t) {
35
35
  this.emitter.on(e, t);
@@ -44,7 +44,7 @@ class ye {
44
44
  this.emitter.all.clear();
45
45
  }
46
46
  }
47
- function me(s, ...e) {
47
+ function Ie(s, ...e) {
48
48
  var t;
49
49
  return t = class extends s {
50
50
  /**
@@ -59,9 +59,9 @@ function me(s, ...e) {
59
59
  static clearInstance() {
60
60
  this._instance = void 0;
61
61
  }
62
- }, b(t, "_instance"), t;
62
+ }, E(t, "_instance"), t;
63
63
  }
64
- let pt = class extends ye {
64
+ let wt = class extends Ee {
65
65
  destroy() {
66
66
  this.removeAllListeners();
67
67
  }
@@ -90,13 +90,13 @@ let pt = class extends ye {
90
90
  });
91
91
  }
92
92
  };
93
- me(pt);
94
- let yt = class Be extends ye {
93
+ Ie(wt);
94
+ let Et = class We extends Ee {
95
95
  constructor(e, t) {
96
- super(), b(this, "stream"), b(this, "logPath"), b(this, "baseFileName"), b(this, "currentDate"), b(this, "rotationCheckInterval"), b(this, "isRotating", !1), this.logPath = e, this.baseFileName = t.replace(".log", ""), this.currentDate = this.getDateString(/* @__PURE__ */ new Date()), this.ensureLogDirectory(), this.ensureLogFile(), this.stream = this.createStream(), this.rotationCheckInterval = this.startRotationCheck(), this.cleanupOldLogs();
96
+ super(), E(this, "stream"), E(this, "logPath"), E(this, "baseFileName"), E(this, "currentDate"), E(this, "rotationCheckInterval"), E(this, "isRotating", !1), this.logPath = e, this.baseFileName = t.replace(".log", ""), this.currentDate = this.getDateString(/* @__PURE__ */ new Date()), this.ensureLogDirectory(), this.ensureLogFile(), this.stream = this.createStream(), this.rotationCheckInterval = this.startRotationCheck(), this.cleanupOldLogs();
97
97
  }
98
98
  static scope(e, t) {
99
- return new Be(e, t);
99
+ return new We(e, t);
100
100
  }
101
101
  log(...e) {
102
102
  this.write("log", ...e);
@@ -126,16 +126,16 @@ let yt = class Be extends ye {
126
126
  }
127
127
  ensureLogDirectory() {
128
128
  try {
129
- ge(this.logPath, { recursive: !0 });
129
+ be(this.logPath, { recursive: !0 });
130
130
  } catch (e) {
131
131
  throw console.error(`Failed to create log directory ${this.logPath}:`, e), e;
132
132
  }
133
133
  }
134
134
  ensureLogFile() {
135
- const e = $(this.logPath, this.getFileName(this.currentDate));
136
- if (!fe(e))
135
+ const e = x(this.logPath, this.getFileName(this.currentDate));
136
+ if (!ve(e))
137
137
  try {
138
- pe(e, "", "utf8");
138
+ we(e, "", "utf8");
139
139
  } catch (t) {
140
140
  throw console.error(`Failed to create log file ${e}:`, t), t;
141
141
  }
@@ -144,8 +144,8 @@ let yt = class Be extends ye {
144
144
  return e.toISOString().split("T")[0];
145
145
  }
146
146
  createStream() {
147
- const e = $(this.logPath, this.getFileName(this.currentDate));
148
- return Oe(e, {
147
+ const e = x(this.logPath, this.getFileName(this.currentDate));
148
+ return Ge(e, {
149
149
  flags: "a",
150
150
  encoding: "utf8"
151
151
  });
@@ -164,13 +164,13 @@ let yt = class Be extends ye {
164
164
  return setInterval(() => this.rotateLogs(), 6e4);
165
165
  }
166
166
  cleanupOldLogs() {
167
- const e = Re(this.logPath), t = /* @__PURE__ */ new Date();
167
+ const e = je(this.logPath), t = /* @__PURE__ */ new Date();
168
168
  t.setDate(t.getDate() - 3), e.filter((r) => r.startsWith(this.baseFileName) && r.endsWith(".log")).filter((r) => {
169
169
  const n = r.replace(`${this.baseFileName}-`, "").replace(".log", "");
170
170
  return new Date(n) < t;
171
171
  }).forEach((r) => {
172
172
  try {
173
- xe($(this.logPath, r));
173
+ Ue(x(this.logPath, r));
174
174
  } catch (n) {
175
175
  console.error(`Failed to delete old log file ${r}:`, n);
176
176
  }
@@ -184,10 +184,10 @@ let yt = class Be extends ye {
184
184
  });
185
185
  }
186
186
  };
187
- const mt = () => y.join(process.env.APPDATA ?? "", "overlayed"), bt = (s) => y.join(mt(), "apps", s), vt = (s) => y.join(bt(s), "logs");
188
- let wt = class {
187
+ const It = () => m.join(process.env.APPDATA ?? "", "overlayed"), kt = (s) => m.join(It(), "apps", s), _t = (s) => m.join(kt(s), "logs");
188
+ let Pt = class {
189
189
  constructor() {
190
- b(this, "data", []);
190
+ E(this, "data", []);
191
191
  }
192
192
  get size() {
193
193
  return this.data.length;
@@ -207,12 +207,12 @@ let wt = class {
207
207
  e && (yield e);
208
208
  }
209
209
  }
210
- }, Et = class {
210
+ }, St = class {
211
211
  constructor() {
212
- b(this, "fileName", "app.log"), b(this, "fileLogger"), b(this, "path"), b(this, "appId"), b(this, "messageQueue", new wt());
212
+ E(this, "fileName", "app.log"), E(this, "fileLogger"), E(this, "path"), E(this, "appId"), E(this, "messageQueue", new Pt());
213
213
  }
214
214
  init(e) {
215
- this.appId = e, this.path = vt(e), this.fileLogger = new yt(this.path, this.fileName), this.messageQueue.flush().forEach((t) => {
215
+ this.appId = e, this.path = _t(e), this.fileLogger = new Et(this.path, this.fileName), this.messageQueue.flush().forEach((t) => {
216
216
  var r;
217
217
  (r = this.fileLogger) == null || r[t.type](...t.args);
218
218
  });
@@ -269,20 +269,20 @@ let wt = class {
269
269
  console[e](...t), ((r = this.fileLogger) == null ? void 0 : r[e](...t)) ?? this.messageQueue.add({ type: e, args: t });
270
270
  }
271
271
  };
272
- me(Et);
273
- const It = te(import.meta.url), {
274
- PipeEventServer: kt,
275
- PipeEventClient: ls,
276
- PipeEventBase: cs,
277
- ProcessMonitor: hs,
278
- Process: us,
279
- InjectionMethod: ds,
280
- AccessLevel: gs,
281
- HardwareInterface: fs
282
- } = It("@overlayed/app/dist/native-interface/build/overlayed_native_interface_x64.node");
283
- let _t = class extends ye {
272
+ Ie(St);
273
+ const Ct = ae(import.meta.url), {
274
+ PipeEventServer: Lt,
275
+ PipeEventClient: ys,
276
+ PipeEventBase: ms,
277
+ ProcessMonitor: bs,
278
+ Process: vs,
279
+ InjectionMethod: ws,
280
+ AccessLevel: Es,
281
+ HardwareInterface: Is
282
+ } = Ct("@overlayed/app/dist/native-interface/build/overlayed_native_interface_x64.node");
283
+ let Dt = class extends Ee {
284
284
  constructor(e) {
285
- super(), b(this, "server", null), b(this, "_hasConnection", !1), b(this, "pipeId"), this.pipeId = e, this.init();
285
+ super(), E(this, "server", null), E(this, "_hasConnection", !1), E(this, "pipeId"), this.pipeId = e, this.init();
286
286
  }
287
287
  get hasConnection() {
288
288
  return this._hasConnection;
@@ -294,7 +294,7 @@ let _t = class extends ye {
294
294
  // TODO make sure that new events and new event keys do not stop the app from working
295
295
  // this is because we may have new events/event keys from a DLL but the types/validations might not be up to date
296
296
  init() {
297
- this.server = new kt(this.pipeId, { clientCount: 1, access: 1 }), this.server.on("event", (e) => {
297
+ this.server = new Lt(this.pipeId, { clientCount: 1, access: 1 }), this.server.on("event", (e) => {
298
298
  try {
299
299
  const t = JSON.parse(e);
300
300
  this.emit("data", [t]);
@@ -308,8 +308,8 @@ let _t = class extends ye {
308
308
  });
309
309
  }
310
310
  };
311
- const be = me(_t, "stats-cc");
312
- function St(s) {
311
+ const ke = Ie(Dt, "stats-cc");
312
+ function At(s) {
313
313
  return { all: s = s || /* @__PURE__ */ new Map(), on: function(e, t) {
314
314
  var r = s.get(e);
315
315
  r ? r.push(t) : s.set(e, [t]);
@@ -325,10 +325,10 @@ function St(s) {
325
325
  });
326
326
  } };
327
327
  }
328
- class ve {
328
+ class _e {
329
329
  constructor() {
330
- l(this, "emitter");
331
- this.emitter = St();
330
+ c(this, "emitter");
331
+ this.emitter = At();
332
332
  }
333
333
  on(e, t) {
334
334
  this.emitter.on(e, t);
@@ -343,9 +343,9 @@ class ve {
343
343
  this.emitter.all.clear();
344
344
  }
345
345
  }
346
- class Pt {
346
+ class Mt {
347
347
  constructor() {
348
- l(this, "listeners");
348
+ c(this, "listeners");
349
349
  this.listeners = /* @__PURE__ */ new Map();
350
350
  }
351
351
  on(e, t) {
@@ -361,10 +361,10 @@ class Pt {
361
361
  return a.length === 0 ? [] : await Promise.all(
362
362
  a.map(async (i) => {
363
363
  try {
364
- const c = i(...t);
365
- return c instanceof Promise ? await c : c;
366
- } catch (c) {
367
- console.error(`Error in event listener for ${String(e)}:`, c);
364
+ const l = i(...t);
365
+ return l instanceof Promise ? await l : l;
366
+ } catch (l) {
367
+ console.error(`Error in event listener for ${String(e)}:`, l);
368
368
  return;
369
369
  }
370
370
  })
@@ -374,7 +374,7 @@ class Pt {
374
374
  this.listeners.clear();
375
375
  }
376
376
  }
377
- function k(s, ...e) {
377
+ function L(s, ...e) {
378
378
  var r;
379
379
  return r = class extends s {
380
380
  /**
@@ -389,9 +389,9 @@ function k(s, ...e) {
389
389
  static clearInstance() {
390
390
  this._instance = void 0;
391
391
  }
392
- }, l(r, "_instance"), r;
392
+ }, c(r, "_instance"), r;
393
393
  }
394
- class Ct extends ve {
394
+ class Ot extends _e {
395
395
  destroy() {
396
396
  this.removeAllListeners();
397
397
  }
@@ -420,13 +420,13 @@ class Ct extends ve {
420
420
  });
421
421
  }
422
422
  }
423
- const I = k(Ct);
424
- class Lt {
423
+ const C = L(Ot);
424
+ class Kt {
425
425
  constructor(e) {
426
- l(this, "data");
427
- l(this, "_schema");
428
- l(this, "_defaultValue");
429
- l(this, "_path");
426
+ c(this, "data");
427
+ c(this, "_schema");
428
+ c(this, "_defaultValue");
429
+ c(this, "_path");
430
430
  const { schema: t, default: r, path: n } = e;
431
431
  this._schema = t, this._defaultValue = r, this._path = n;
432
432
  }
@@ -449,7 +449,7 @@ class Lt {
449
449
  save(e) {
450
450
  const t = this.onBeforeSave(e);
451
451
  try {
452
- S.writeFileSync(this.getFilePath(), JSON.stringify(t, void 0, 2));
452
+ M.writeFileSync(this.getFilePath(), JSON.stringify(t, void 0, 2));
453
453
  } catch {
454
454
  return;
455
455
  }
@@ -462,7 +462,7 @@ class Lt {
462
462
  return this.data = e, e;
463
463
  }
464
464
  try {
465
- const e = S.readFileSync(this.getFilePath(), "utf8"), t = this.onAfterLoad(this.parseStoredData(e));
465
+ const e = M.readFileSync(this.getFilePath(), "utf8"), t = this.onAfterLoad(this.parseStoredData(e));
466
466
  return this.data = t, t;
467
467
  } catch {
468
468
  return this.data = this._defaultValue;
@@ -479,8 +479,8 @@ class Lt {
479
479
  }
480
480
  parseStoredData(e) {
481
481
  try {
482
- const r = L("string.json.parse").to("object")(e);
483
- if (r instanceof L.errors)
482
+ const r = R("string.json.parse").to("object")(e);
483
+ if (r instanceof R.errors)
484
484
  return this._defaultValue;
485
485
  const n = this._schema["~standard"].validate(r);
486
486
  if (n instanceof Promise)
@@ -492,14 +492,14 @@ class Lt {
492
492
  }
493
493
  canReadWriteFile(e) {
494
494
  try {
495
- return S.accessSync(e, S.constants.R_OK | S.constants.W_OK), !0;
495
+ return M.accessSync(e, M.constants.R_OK | M.constants.W_OK), !0;
496
496
  } catch {
497
497
  return !1;
498
498
  }
499
499
  }
500
500
  fileExists(e) {
501
501
  try {
502
- return S.accessSync(e, S.constants.F_OK), !0;
502
+ return M.accessSync(e, M.constants.F_OK), !0;
503
503
  } catch {
504
504
  return !1;
505
505
  }
@@ -511,26 +511,26 @@ class Lt {
511
511
  return r;
512
512
  }
513
513
  reportInvalidConfigFile(e) {
514
- I.getInstance().error("Invalid config file", "INVALID_CONFIG_FILE", {
514
+ C.getInstance().error("Invalid config file", "INVALID_CONFIG_FILE", {
515
515
  issues: e.map((t) => t.message),
516
516
  filePath: this._path,
517
517
  data: this.data
518
518
  });
519
519
  }
520
520
  }
521
- class we extends ve {
521
+ class Pe extends _e {
522
522
  constructor(t, r) {
523
523
  super();
524
- l(this, "stream");
525
- l(this, "logPath");
526
- l(this, "baseFileName");
527
- l(this, "currentDate");
528
- l(this, "rotationCheckInterval");
529
- l(this, "isRotating", !1);
524
+ c(this, "stream");
525
+ c(this, "logPath");
526
+ c(this, "baseFileName");
527
+ c(this, "currentDate");
528
+ c(this, "rotationCheckInterval");
529
+ c(this, "isRotating", !1);
530
530
  this.logPath = t, this.baseFileName = r.replace(".log", ""), this.currentDate = this.getDateString(/* @__PURE__ */ new Date()), this.ensureLogDirectory(), this.ensureLogFile(), this.stream = this.createStream(), this.rotationCheckInterval = this.startRotationCheck(), this.cleanupOldLogs();
531
531
  }
532
532
  static scope(t, r) {
533
- return new we(t, r);
533
+ return new Pe(t, r);
534
534
  }
535
535
  log(...t) {
536
536
  this.write("log", ...t);
@@ -560,16 +560,16 @@ class we extends ve {
560
560
  }
561
561
  ensureLogDirectory() {
562
562
  try {
563
- ge(this.logPath, { recursive: !0 });
563
+ be(this.logPath, { recursive: !0 });
564
564
  } catch (t) {
565
565
  throw console.error(`Failed to create log directory ${this.logPath}:`, t), t;
566
566
  }
567
567
  }
568
568
  ensureLogFile() {
569
- const t = $(this.logPath, this.getFileName(this.currentDate));
570
- if (!fe(t))
569
+ const t = x(this.logPath, this.getFileName(this.currentDate));
570
+ if (!ve(t))
571
571
  try {
572
- pe(t, "", "utf8");
572
+ we(t, "", "utf8");
573
573
  } catch (r) {
574
574
  throw console.error(`Failed to create log file ${t}:`, r), r;
575
575
  }
@@ -578,8 +578,8 @@ class we extends ve {
578
578
  return t.toISOString().split("T")[0];
579
579
  }
580
580
  createStream() {
581
- const t = $(this.logPath, this.getFileName(this.currentDate));
582
- return Oe(t, {
581
+ const t = x(this.logPath, this.getFileName(this.currentDate));
582
+ return Ge(t, {
583
583
  flags: "a",
584
584
  encoding: "utf8"
585
585
  });
@@ -598,30 +598,30 @@ class we extends ve {
598
598
  return setInterval(() => this.rotateLogs(), 6e4);
599
599
  }
600
600
  cleanupOldLogs() {
601
- const t = Re(this.logPath), r = /* @__PURE__ */ new Date();
601
+ const t = je(this.logPath), r = /* @__PURE__ */ new Date();
602
602
  r.setDate(r.getDate() - 3), t.filter((n) => n.startsWith(this.baseFileName) && n.endsWith(".log")).filter((n) => {
603
603
  const a = n.replace(`${this.baseFileName}-`, "").replace(".log", "");
604
604
  return new Date(a) < r;
605
605
  }).forEach((n) => {
606
606
  try {
607
- xe($(this.logPath, n));
607
+ Ue(x(this.logPath, n));
608
608
  } catch (a) {
609
609
  console.error(`Failed to delete old log file ${n}:`, a);
610
610
  }
611
611
  });
612
612
  }
613
613
  write(t, ...r) {
614
- const n = /* @__PURE__ */ new Date(), a = n.toISOString().replace("T", " ").replace(/\.\d+Z$/, "") + `.${n.getMilliseconds().toString().padStart(3, "0")}`, o = r.map((c) => typeof c == "object" ? JSON.stringify(c, void 0, 2) : String(c)).join(" "), i = `[${a}] [${t}] ${o}
614
+ const n = /* @__PURE__ */ new Date(), a = n.toISOString().replace("T", " ").replace(/\.\d+Z$/, "") + `.${n.getMilliseconds().toString().padStart(3, "0")}`, o = r.map((l) => typeof l == "object" ? JSON.stringify(l, void 0, 2) : String(l)).join(" "), i = `[${a}] [${t}] ${o}
615
615
  `;
616
- this.stream.write(i, (c) => {
617
- c ? this.emit("error", c) : this.emit("write", i);
616
+ this.stream.write(i, (l) => {
617
+ l ? this.emit("error", l) : this.emit("write", i);
618
618
  });
619
619
  }
620
620
  }
621
- const Ee = () => y.join(process.env.APPDATA ?? "", "overlayed"), je = (s) => y.join(Ee(), "apps", s), Kt = (s) => y.join(je(s), "logs");
622
- class ze {
621
+ const Se = () => m.join(process.env.APPDATA ?? "", "overlayed"), qe = (s) => m.join(Se(), "apps", s), Rt = (s) => m.join(qe(s), "logs");
622
+ class Qe {
623
623
  constructor() {
624
- l(this, "data", []);
624
+ c(this, "data", []);
625
625
  }
626
626
  get size() {
627
627
  return this.data.length;
@@ -644,14 +644,14 @@ class ze {
644
644
  }
645
645
  class Ft {
646
646
  constructor() {
647
- l(this, "fileName", "app.log");
648
- l(this, "fileLogger");
649
- l(this, "path");
650
- l(this, "appId");
651
- l(this, "messageQueue", new ze());
647
+ c(this, "fileName", "app.log");
648
+ c(this, "fileLogger");
649
+ c(this, "path");
650
+ c(this, "appId");
651
+ c(this, "messageQueue", new Qe());
652
652
  }
653
653
  init(e) {
654
- this.appId = e, this.path = Kt(e), this.fileLogger = new we(this.path, this.fileName), this.messageQueue.flush().forEach((t) => {
654
+ this.appId = e, this.path = Rt(e), this.fileLogger = new Pe(this.path, this.fileName), this.messageQueue.flush().forEach((t) => {
655
655
  var r;
656
656
  (r = this.fileLogger) == null || r[t.type](...t.args);
657
657
  });
@@ -708,20 +708,20 @@ class Ft {
708
708
  console[e](...t), ((r = this.fileLogger) == null ? void 0 : r[e](...t)) ?? this.messageQueue.add({ type: e, args: t });
709
709
  }
710
710
  }
711
- const re = k(Ft);
712
- function Mt(s) {
711
+ const oe = L(Ft);
712
+ function $t(s) {
713
713
  return s;
714
714
  }
715
- function Dt(s) {
716
- return Mt;
715
+ function xt(s) {
716
+ return $t;
717
717
  }
718
- class At extends ht {
718
+ class Tt extends pt {
719
719
  constructor(t, r) {
720
720
  super();
721
- l(this, "blob");
722
- l(this, "chunkSizeMb");
723
- l(this, "maxConcurrent");
724
- l(this, "shouldStop", !1);
721
+ c(this, "blob");
722
+ c(this, "chunkSizeMb");
723
+ c(this, "maxConcurrent");
724
+ c(this, "shouldStop", !1);
725
725
  this.blob = t, this.chunkSizeMb = r.chunkSizeMb, this.maxConcurrent = r.maxConcurrent ?? 3;
726
726
  }
727
727
  get totalChunks() {
@@ -730,37 +730,37 @@ class At extends ht {
730
730
  async chunk(t) {
731
731
  const r = this.chunkSizeMb * 1024 * 1024, n = this.totalChunks;
732
732
  if (n === 0) return;
733
- const a = 5, o = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Set(), c = /* @__PURE__ */ new Set(), u = [];
734
- for (let h = 0; h < n; h++)
735
- u.push(h);
736
- const d = async (h) => {
737
- const f = h * r, w = Math.min(f + r, this.blob.size), F = this.blob.slice(f, w);
733
+ const a = 5, o = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Set(), l = /* @__PURE__ */ new Set(), h = [];
734
+ for (let u = 0; u < n; u++)
735
+ h.push(u);
736
+ const g = async (u) => {
737
+ const d = u * r, b = Math.min(d + r, this.blob.size), k = this.blob.slice(d, b);
738
738
  try {
739
- await t(F, h), c.add(h), this.emit("chunkComplete", h), i.delete(h);
740
- } catch (M) {
741
- const D = o.get(h) || 0;
742
- D < a ? (o.set(h, D + 1), await new Promise((v) => setTimeout(v, (D + 1) * 1e3)), u.push(h)) : (c.add(h), this.emit("error", M), this.shouldStop = !0, i.delete(h));
739
+ await t(k, u), l.add(u), this.emit("chunkComplete", u), i.delete(u);
740
+ } catch (P) {
741
+ const D = o.get(u) || 0;
742
+ D < a ? (o.set(u, D + 1), await new Promise((v) => setTimeout(v, (D + 1) * 1e3)), h.push(u)) : (l.add(u), this.emit("error", P), this.shouldStop = !0, i.delete(u));
743
743
  }
744
- }, p = [], g = async () => {
745
- for (; (u.length > 0 || i.size > 0) && !this.shouldStop; ) {
746
- if (u.length === 0) {
747
- await new Promise((f) => setTimeout(f, 10));
744
+ }, f = [], p = async () => {
745
+ for (; (h.length > 0 || i.size > 0) && !this.shouldStop; ) {
746
+ if (h.length === 0) {
747
+ await new Promise((d) => setTimeout(d, 10));
748
748
  continue;
749
749
  }
750
- const h = u.shift();
751
- c.has(h) || i.has(h) || (i.add(h), await d(h));
750
+ const u = h.shift();
751
+ l.has(u) || i.has(u) || (i.add(u), await g(u));
752
752
  }
753
753
  };
754
- for (let h = 0; h < this.maxConcurrent; h++)
755
- p.push(g());
756
- return await Promise.all(p);
754
+ for (let u = 0; u < this.maxConcurrent; u++)
755
+ f.push(p());
756
+ return await Promise.all(f);
757
757
  }
758
758
  }
759
- class Ve {
759
+ class Ye {
760
760
  constructor(e) {
761
- l(this, "logger");
762
- l(this, "initialized", !1);
763
- this.logger = re.getInstance().scope(e);
761
+ c(this, "logger");
762
+ c(this, "initialized", !1);
763
+ this.logger = oe.getInstance().scope(e);
764
764
  }
765
765
  init() {
766
766
  this.logger.log("Initializing"), this.initialized = !0;
@@ -769,12 +769,12 @@ class Ve {
769
769
  this.logger.log("Destroying"), this.initialized = !1;
770
770
  }
771
771
  }
772
- class se extends ve {
772
+ class le extends _e {
773
773
  constructor(t) {
774
774
  super();
775
- l(this, "logger");
776
- l(this, "initialized", !1);
777
- this.logger = re.getInstance().scope(t);
775
+ c(this, "logger");
776
+ c(this, "initialized", !1);
777
+ this.logger = oe.getInstance().scope(t);
778
778
  }
779
779
  init() {
780
780
  this.logger.log("Initializing"), this.initialized = !0;
@@ -783,12 +783,12 @@ class se extends ve {
783
783
  this.logger.log("Destroying"), this.initialized = !1, this.removeAllListeners();
784
784
  }
785
785
  }
786
- class $t extends Pt {
786
+ class Nt extends Mt {
787
787
  constructor(t) {
788
788
  super();
789
- l(this, "logger");
790
- l(this, "initialized", !1);
791
- this.logger = re.getInstance().scope(t);
789
+ c(this, "logger");
790
+ c(this, "initialized", !1);
791
+ this.logger = oe.getInstance().scope(t);
792
792
  }
793
793
  init() {
794
794
  this.logger.log("Initializing"), this.initialized = !0;
@@ -797,8 +797,8 @@ class $t extends Pt {
797
797
  this.logger.log("Destroying"), this.initialized = !1, this.removeAllListeners();
798
798
  }
799
799
  }
800
- var R = "object", Ue = "function", He = "prototype", ae = "text", Ie = "json", Le = "abort", oe = "paramsSerializer", Ke = "addEventListener", z = "status", _ = "headers", ne = Object, K = void 0, X = null, le = ne[He], Y = ne.keys, N = Array.isArray, Fe = "method", We = "HEAD", ce = "GET", Qe = "OPTIONS", Ot = "POST", Rt = "PUT", xt = "PATCH", Tt = "DELETE";
801
- function Nt(s, e) {
800
+ var N = "object", Je = "function", Xe = "prototype", ue = "text", Ce = "json", Ke = "abort", de = "paramsSerializer", Re = "addEventListener", q = "status", A = "headers", ce = Object, F = void 0, re = null, ge = ce[Xe], se = ce.keys, j = Array.isArray, Fe = "method", Ze = "HEAD", fe = "GET", et = "OPTIONS", Bt = "POST", Gt = "PUT", jt = "PATCH", Ut = "DELETE";
801
+ function zt(s, e) {
802
802
  let t = new AbortController();
803
803
  function r(i) {
804
804
  t.abort(i), a();
@@ -809,14 +809,14 @@ function Nt(s, e) {
809
809
  r(i.reason);
810
810
  break;
811
811
  }
812
- if (i != null && i[Ke]) {
813
- let c = () => {
812
+ if (i != null && i[Re]) {
813
+ let l = () => {
814
814
  r(i.reason);
815
815
  };
816
816
  n.push(() => {
817
- var u;
818
- (u = i.removeEventListener) == null || u.call(i, Le, c);
819
- }), i[Ke](Le, c);
817
+ var h;
818
+ (h = i.removeEventListener) == null || h.call(i, Ke, l);
819
+ }), i[Re](Ke, l);
820
820
  }
821
821
  }
822
822
  function a() {
@@ -825,116 +825,116 @@ function Nt(s, e) {
825
825
  let o = t.signal;
826
826
  return o.clear = a, o;
827
827
  }
828
- var Me = ne.getPrototypeOf, De = (s) => {
829
- if (s !== X && typeof s === R) {
830
- if (typeof Me === Ue) {
831
- let e = Me(s);
832
- return e === le || e === X;
828
+ var $e = ce.getPrototypeOf, xe = (s) => {
829
+ if (s !== re && typeof s === N) {
830
+ if (typeof $e === Je) {
831
+ let e = $e(s);
832
+ return e === ge || e === re;
833
833
  }
834
- return le.toString.call(s) === `[${R} Object]`;
834
+ return ge.toString.call(s) === `[${N} Object]`;
835
835
  }
836
836
  return !1;
837
- }, ke = (...s) => s.reduce((e, t) => {
838
- if (N(t)) throw new TypeError(`Arguments must be ${R}s, not arrays.`);
839
- return Y(t).forEach((r) => {
840
- ["__proto__", "constructor", He].includes(r) || (N(e[r]) && N(t[r]) ? e[r] = Array.from(new Set(e[r].concat(t[r]))) : De(e[r]) && De(t[r]) ? e[r] = ke(e[r], t[r]) : e[r] = t[r]);
837
+ }, Le = (...s) => s.reduce((e, t) => {
838
+ if (j(t)) throw new TypeError(`Arguments must be ${N}s, not arrays.`);
839
+ return se(t).forEach((r) => {
840
+ ["__proto__", "constructor", Xe].includes(r) || (j(e[r]) && j(t[r]) ? e[r] = Array.from(new Set(e[r].concat(t[r]))) : xe(e[r]) && xe(t[r]) ? e[r] = Le(e[r], t[r]) : e[r] = t[r]);
841
841
  }), e;
842
842
  }, {});
843
- function _e(s, e = !0, t = X, r) {
844
- if (s === K || s === X) return "";
845
- let n = [], a = e ? encodeURIComponent : (p) => p, o = N(s), { arrayFormat: i, allowDots: c, serializeDate: u } = r || {}, d = (p) => {
846
- if (c && !o) return `.${p}`;
843
+ function De(s, e = !0, t = re, r) {
844
+ if (s === F || s === re) return "";
845
+ let n = [], a = e ? encodeURIComponent : (f) => f, o = j(s), { arrayFormat: i, allowDots: l, serializeDate: h } = r || {}, g = (f) => {
846
+ if (l && !o) return `.${f}`;
847
847
  if (o) {
848
848
  if (i === "brackets") return "[]";
849
849
  if (i === "repeat") return "";
850
850
  }
851
- return `[${p}]`;
851
+ return `[${f}]`;
852
852
  };
853
- for (let p in s) if (le.hasOwnProperty.call(s, p)) {
854
- let g = s[p];
855
- if (g !== K) {
856
- let h = t ? `${t}${d(p)}` : a(p);
857
- if (!isNaN(g) && g instanceof Date && (g = u ? u(g) : g.toISOString()), typeof g === R) {
858
- let f = _e(g, e, h, r);
859
- f !== "" && n.push(f);
860
- } else n.push(`${a(h)}=${a(g)}`);
853
+ for (let f in s) if (ge.hasOwnProperty.call(s, f)) {
854
+ let p = s[f];
855
+ if (p !== F) {
856
+ let u = t ? `${t}${g(f)}` : a(f);
857
+ if (!isNaN(p) && p instanceof Date && (p = h ? h(p) : p.toISOString()), typeof p === N) {
858
+ let d = De(p, e, u, r);
859
+ d !== "" && n.push(d);
860
+ } else n.push(`${a(u)}=${a(p)}`);
861
861
  }
862
862
  }
863
863
  return n.join("&");
864
864
  }
865
- function he(s) {
866
- return N(s) ? s.map(he) : (s && typeof s === R && Y(s).forEach((e) => {
865
+ function pe(s) {
866
+ return j(s) ? s.map(pe) : (s && typeof s === N && se(s).forEach((e) => {
867
867
  let t = s[e];
868
- t === K ? delete s[e] : he(t);
868
+ t === F ? delete s[e] : pe(t);
869
869
  }), s);
870
870
  }
871
- function Gt(s) {
871
+ function Ht(s) {
872
872
  return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(s);
873
873
  }
874
- function Bt(s, e) {
874
+ function Vt(s, e) {
875
875
  return s ? e ? (s.endsWith("/") ? s : s + "/") + (e[0] === "/" ? e.slice(1) : e) : s : e || "";
876
876
  }
877
- var jt = "XiorError", zt = "XiorTimeoutError", qe = class extends Error {
877
+ var Wt = "XiorError", qt = "XiorTimeoutError", tt = class extends Error {
878
878
  constructor(s, e, t) {
879
- super(s), this.name = jt, this.request = e, this.config = e, this.response = t;
879
+ super(s), this.name = Wt, this.request = e, this.config = e, this.response = t;
880
880
  }
881
- }, Vt = class extends qe {
881
+ }, Qt = class extends tt {
882
882
  constructor(e, t, r) {
883
- super(e, t, r), this.name = zt;
883
+ super(e, t, r), this.name = qt;
884
884
  }
885
- }, Ut = Object.defineProperty, Ht = Object.defineProperties, Wt = Object.getOwnPropertyDescriptors, Z = Object.getOwnPropertySymbols, Je = Object.prototype.hasOwnProperty, Xe = Object.prototype.propertyIsEnumerable, Ae = (s, e, t) => e in s ? Ut(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t, G = (s, e) => {
886
- for (var t in e || (e = {})) Je.call(e, t) && Ae(s, t, e[t]);
887
- if (Z) for (var t of Z(e)) Xe.call(e, t) && Ae(s, t, e[t]);
885
+ }, Yt = Object.defineProperty, Jt = Object.defineProperties, Xt = Object.getOwnPropertyDescriptors, ne = Object.getOwnPropertySymbols, rt = Object.prototype.hasOwnProperty, st = Object.prototype.propertyIsEnumerable, Te = (s, e, t) => e in s ? Yt(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t, U = (s, e) => {
886
+ for (var t in e || (e = {})) rt.call(e, t) && Te(s, t, e[t]);
887
+ if (ne) for (var t of ne(e)) st.call(e, t) && Te(s, t, e[t]);
888
888
  return s;
889
- }, Q = (s, e) => Ht(s, Wt(e)), Qt = (s, e) => {
889
+ }, Z = (s, e) => Jt(s, Xt(e)), Zt = (s, e) => {
890
890
  var t = {};
891
- for (var r in s) Je.call(s, r) && e.indexOf(r) < 0 && (t[r] = s[r]);
892
- if (s != null && Z) for (var r of Z(s)) e.indexOf(r) < 0 && Xe.call(s, r) && (t[r] = s[r]);
891
+ for (var r in s) rt.call(s, r) && e.indexOf(r) < 0 && (t[r] = s[r]);
892
+ if (s != null && ne) for (var r of ne(s)) e.indexOf(r) < 0 && st.call(s, r) && (t[r] = s[r]);
893
893
  return t;
894
- }, B = (s, e, t) => new Promise((r, n) => {
895
- var a = (c) => {
894
+ }, z = (s, e, t) => new Promise((r, n) => {
895
+ var a = (l) => {
896
896
  try {
897
- i(t.next(c));
898
- } catch (u) {
899
- n(u);
897
+ i(t.next(l));
898
+ } catch (h) {
899
+ n(h);
900
900
  }
901
- }, o = (c) => {
901
+ }, o = (l) => {
902
902
  try {
903
- i(t.throw(c));
904
- } catch (u) {
905
- n(u);
903
+ i(t.throw(l));
904
+ } catch (h) {
905
+ n(h);
906
906
  }
907
- }, i = (c) => c.done ? r(c.value) : Promise.resolve(c.value).then(a, o);
907
+ }, i = (l) => l.done ? r(l.value) : Promise.resolve(l.value).then(a, o);
908
908
  i((t = t.apply(s, e)).next());
909
- }), Se = "application/", Ye = `${Se}x-www-form-urlencoded`, Ze = RegExp, qt = new Ze(`^${Ye}`, "i"), Jt = `${Se}${Ie}`, Xt = new Ze(`^${Se}.*${Ie}.*`, "i");
910
- function Yt(s = ce) {
911
- return [We, ce, Qe].includes(s);
909
+ }), Ae = "application/", nt = `${Ae}x-www-form-urlencoded`, it = RegExp, er = new it(`^${nt}`, "i"), tr = `${Ae}${Ce}`, rr = new it(`^${Ae}.*${Ce}.*`, "i");
910
+ function sr(s = fe) {
911
+ return [Ze, fe, et].includes(s);
912
912
  }
913
- var Zt = typeof URLSearchParams != `${K}`;
914
- function er(s) {
915
- return B(this, null, function* () {
916
- let e = s[oe] || _e, t = s.encodeURI !== !1, r = s[Fe] && s[Fe].toUpperCase(), n = s.url, a = n, o = Zt && s.data instanceof URLSearchParams, i = o ? ne.fromEntries(s.data.entries()) : s.data, c = i, u = s != null && s[_] ? G({}, s[_]) : {}, d = s.params, p = Yt(r);
917
- if (i && typeof i.append !== Ue) {
918
- let g = "", h = "content-type";
919
- if (s != null && s[_]) {
920
- let f = Y(s[_]).find((w) => w.toLowerCase() === h);
921
- f && (h = f, g = s[_][f]);
913
+ var nr = typeof URLSearchParams != `${F}`;
914
+ function ir(s) {
915
+ return z(this, null, function* () {
916
+ let e = s[de] || De, t = s.encodeURI !== !1, r = s[Fe] && s[Fe].toUpperCase(), n = s.url, a = n, o = nr && s.data instanceof URLSearchParams, i = o ? ce.fromEntries(s.data.entries()) : s.data, l = i, h = s != null && s[A] ? U({}, s[A]) : {}, g = s.params, f = sr(r);
917
+ if (i && typeof i.append !== Je) {
918
+ let p = "", u = "content-type";
919
+ if (s != null && s[A]) {
920
+ let d = se(s[A]).find((b) => b.toLowerCase() === u);
921
+ d && (u = d, p = s[A][d]);
922
922
  }
923
- (!g || o) && (g = p || o ? Ye : Jt, u[h] = g), typeof i === R && (p && d && (d = ke(i, d)), Xt.test(g) ? c = JSON.stringify(he(i)) : !p && qt.test(g) && (c = e(i)));
923
+ (!p || o) && (p = f || o ? nt : tr, h[u] = p), typeof i === N && (f && g && (g = Le(i, g)), rr.test(p) ? l = JSON.stringify(pe(i)) : !f && er.test(p) && (l = e(i)));
924
924
  }
925
- if (d && Y(d).length > 0) {
926
- let g = e(d, t);
927
- n += n.includes("?") ? `&${g}` : `?${g}`;
925
+ if (g && se(g).length > 0) {
926
+ let p = e(g, t);
927
+ n += n.includes("?") ? `&${p}` : `?${p}`;
928
928
  }
929
- return Q(G({}, s), { _data: c, _url: n, data: i, url: a, method: r, [_]: u, isGet: p });
929
+ return Z(U({}, s), { _data: l, _url: n, data: i, url: a, method: r, [A]: h, isGet: f });
930
930
  });
931
931
  }
932
- var tr = typeof AbortController != `${K}`;
933
- function rr(s, e) {
934
- return B(this, null, function* () {
932
+ var ar = typeof AbortController != `${F}`;
933
+ function or(s, e) {
934
+ return z(this, null, function* () {
935
935
  let t;
936
- if (!e || !s.ok || [ae, Ie].includes(e)) {
937
- if (t = yield s[ae](), t && e !== ae) try {
936
+ if (!e || !s.ok || [ue, Ce].includes(e)) {
937
+ if (t = yield s[ue](), t && e !== ue) try {
938
938
  t = JSON.parse(t);
939
939
  } catch {
940
940
  }
@@ -945,9 +945,9 @@ function rr(s, e) {
945
945
  return t;
946
946
  });
947
947
  }
948
- var sr = (s) => new O(s), O = class {
948
+ var lr = (s) => new T(s), T = class {
949
949
  constructor(e) {
950
- this.REQI = [], this.RESI = [], this.P = [], this.config = e, this.defaults = { params: {}, [_]: {} };
950
+ this.REQI = [], this.RESI = [], this.P = [], this.config = e, this.defaults = { params: {}, [A]: {} };
951
951
  }
952
952
  get interceptors() {
953
953
  return { request: { use: (e, t, r) => (this.REQI.push(e), e), eject: (e) => {
@@ -968,9 +968,9 @@ var sr = (s) => new O(s), O = class {
968
968
  } };
969
969
  }
970
970
  request(e) {
971
- return B(this, null, function* () {
972
- let t = ke(this.config || {}, this.defaults, typeof e == "string" ? { url: e } : e), r = "credentials";
973
- t.withCredentials && !t[r] && (t[r] = "include"), t[oe] || (t[oe] = _e);
971
+ return z(this, null, function* () {
972
+ let t = Le(this.config || {}, this.defaults, typeof e == "string" ? { url: e } : e), r = "credentials";
973
+ t.withCredentials && !t[r] && (t[r] = "include"), t[de] || (t[de] = De);
974
974
  for (let o of this.REQI) t = yield o(t);
975
975
  let n = this._.bind(this);
976
976
  this.P.forEach((o) => {
@@ -979,164 +979,167 @@ var sr = (s) => new O(s), O = class {
979
979
  let a = n(t);
980
980
  if (!t._did) {
981
981
  let o = 0, i = [];
982
- for (this.RESI.forEach(function(c) {
983
- i.push(c.fn, c.onRejected);
982
+ for (this.RESI.forEach(function(l) {
983
+ i.push(l.fn, l.onRejected);
984
984
  }); i.length > o; ) a = a.then(i[o++], i[o++]);
985
985
  }
986
986
  return a;
987
987
  });
988
988
  }
989
989
  _(e) {
990
- return B(this, null, function* () {
991
- let t = yield er(e), { url: r, method: n, headers: a, timeout: o, signal: i, data: c, _data: u, _url: d, isGet: p, fetch: g } = t, h = Qt(t, ["url", "method", "headers", "timeout", "signal", "data", "_data", "_url", "isGet", "fetch"]);
992
- e._url = d;
993
- let f, w = [], F = K;
994
- if (o && tr) {
990
+ return z(this, null, function* () {
991
+ let t = yield ir(e), { url: r, method: n, headers: a, timeout: o, signal: i, data: l, _data: h, _url: g, isGet: f, fetch: p } = t, u = Zt(t, ["url", "method", "headers", "timeout", "signal", "data", "_data", "_url", "isGet", "fetch"]);
992
+ e._url = g;
993
+ let d, b = [], k = F;
994
+ if (o && ar) {
995
995
  let v = new AbortController();
996
- F = setTimeout(() => {
997
- v.abort(new Vt(`timeout of ${o}ms exceeded`, e));
998
- }, o), w.push(v.signal);
996
+ k = setTimeout(() => {
997
+ v.abort(new Qt(`timeout of ${o}ms exceeded`, e));
998
+ }, o), b.push(v.signal);
999
999
  }
1000
- i && w.push(i), f = w[0], w.length > 1 && (f = Nt(w, () => {
1001
- clearTimeout(F);
1000
+ i && b.push(i), d = b[0], b.length > 1 && (d = zt(b, () => {
1001
+ clearTimeout(k);
1002
1002
  }));
1003
- let M = d || r, D = "baseURL";
1004
- return e[D] && !Gt(M) && (M = Bt(e[D], M)), (g || fetch)(M, Q(G({ body: p ? K : u }, h), { signal: f, method: n, headers: a })).then((v) => B(this, null, function* () {
1005
- let { responseType: st } = e, Ce = { data: yield rr(v, st), response: v, config: e, request: e, [z]: v[z], statusText: v.statusText, [_]: v[_] };
1003
+ let P = g || r, D = "baseURL";
1004
+ return e[D] && !Ht(P) && (P = Vt(e[D], P)), (p || fetch)(P, Z(U({ body: f ? F : h }, u), { signal: d, method: n, headers: a })).then((v) => z(this, null, function* () {
1005
+ let { responseType: W } = e, y = { data: yield or(v, W), response: v, config: e, request: e, [q]: v[q], statusText: v.statusText, [A]: v[A] };
1006
1006
  if (!v.ok) {
1007
- let nt = new qe(v[z] ? `Request failed with status code ${v[z]}` : "Network error", e, Ce);
1008
- return Promise.reject(nt);
1007
+ let I = new tt(v[q] ? `Request failed with status code ${v[q]}` : "Network error", e, y);
1008
+ return Promise.reject(I);
1009
1009
  }
1010
- return Ce;
1010
+ return y;
1011
1011
  })).finally(() => {
1012
1012
  var v;
1013
- F && clearTimeout(F), (v = f == null ? void 0 : f.clear) == null || v.call(f);
1013
+ k && clearTimeout(k), (v = d == null ? void 0 : d.clear) == null || v.call(d);
1014
1014
  });
1015
1015
  });
1016
1016
  }
1017
1017
  cG(e) {
1018
- return (t, r) => this.request(r ? Q(G({}, r), { method: e, url: t }) : { method: e, url: t });
1018
+ return (t, r) => this.request(r ? Z(U({}, r), { method: e, url: t }) : { method: e, url: t });
1019
1019
  }
1020
1020
  cP(e) {
1021
- return (t, r, n) => this.request(n ? Q(G({}, n), { method: e, url: t, data: r }) : { method: e, url: t, data: r });
1021
+ return (t, r, n) => this.request(n ? Z(U({}, n), { method: e, url: t, data: r }) : { method: e, url: t, data: r });
1022
1022
  }
1023
1023
  get(e, t) {
1024
- return this.cG(ce)(e, t);
1024
+ return this.cG(fe)(e, t);
1025
1025
  }
1026
1026
  head(e, t) {
1027
- return this.cG(We)(e, t);
1027
+ return this.cG(Ze)(e, t);
1028
1028
  }
1029
1029
  post(e, t, r) {
1030
- return this.cP(Ot)(e, t, r);
1030
+ return this.cP(Bt)(e, t, r);
1031
1031
  }
1032
1032
  put(e, t, r) {
1033
- return this.cP(Rt)(e, t, r);
1033
+ return this.cP(Gt)(e, t, r);
1034
1034
  }
1035
1035
  patch(e, t, r) {
1036
- return this.cP(xt)(e, t, r);
1036
+ return this.cP(jt)(e, t, r);
1037
1037
  }
1038
1038
  delete(e, t) {
1039
- return this.cG(Tt)(e, t);
1039
+ return this.cG(Ut)(e, t);
1040
1040
  }
1041
1041
  options(e, t) {
1042
- return this.cG(Qe)(e, t);
1042
+ return this.cG(et)(e, t);
1043
1043
  }
1044
1044
  };
1045
- O.create = sr, O.VERSION = "0.7.7";
1046
- var nr = Object.assign(O.create(), { create: O.create, VERSION: O.VERSION }), et = nr;
1047
- const Pe = et.create({
1045
+ T.create = lr, T.VERSION = "0.7.7";
1046
+ var cr = Object.assign(T.create(), { create: T.create, VERSION: T.VERSION }), at = cr;
1047
+ const Me = at.create({
1048
1048
  baseURL: "https://updater.stats.cc",
1049
1049
  headers: {
1050
1050
  Accept: "application/json",
1051
1051
  "Accept-Encoding": "gzip, deflate, br"
1052
1052
  }
1053
1053
  });
1054
- let ue;
1055
- function bs(s) {
1056
- ue = s;
1054
+ let ye;
1055
+ function Ss(s) {
1056
+ ye = s;
1057
1057
  }
1058
- const ie = et.create({
1058
+ const V = at.create({
1059
1059
  baseURL: "https://api.overlayed.gg",
1060
1060
  headers: {
1061
1061
  Accept: "application/json",
1062
1062
  "Accept-Encoding": "gzip, deflate, br"
1063
1063
  }
1064
1064
  });
1065
- Pe.interceptors.request.use((s) => {
1066
- const e = ue == null ? void 0 : ue();
1065
+ Me.interceptors.request.use((s) => {
1066
+ const e = ye == null ? void 0 : ye();
1067
1067
  return e && (s.headers ?? (s.headers = {}), s.headers.Authorization = e), s;
1068
1068
  });
1069
- function ir(s, e) {
1070
- return Pe.get(`/v1/native/${tt(s)}/version.txt`, {
1069
+ function ur(s) {
1070
+ return V.get(`/v1/public/applications/${s}`);
1071
+ }
1072
+ function hr(s, e) {
1073
+ return Me.get(`/v1/native/${ot(s)}/version.txt`, {
1071
1074
  params: { channel: e },
1072
1075
  responseType: "text"
1073
1076
  });
1074
1077
  }
1075
- function ar(s, e) {
1076
- return Pe.get(`/v1/native/${tt(s)}/files`, {
1078
+ function dr(s, e) {
1079
+ return Me.get(`/v1/native/${ot(s)}/files`, {
1077
1080
  params: { channel: e },
1078
1081
  responseType: "arraybuffer"
1079
1082
  });
1080
1083
  }
1081
- function tt(s) {
1082
- return s === "01JXPFK6YQ3N00N2Y9JHFNG55D" ? "siege-game-module" : s;
1084
+ function ot(s) {
1085
+ return s === "01JXPFK6YQ3N00N2Y9JHFNG55D" || s === "01JZEBPGHT5M4Y6SGY4P7Q9EZT" ? "siege-game-module" : s;
1083
1086
  }
1084
- function or() {
1085
- return ie.get("/v1/public/raven/config");
1087
+ function gr() {
1088
+ return V.get("/v1/public/raven/config");
1086
1089
  }
1087
- const lr = Dt();
1088
- function cr(s, e) {
1089
- return ie.get(`/v1/public/raven/games/${s}/builds/${e}`);
1090
+ const fr = xt();
1091
+ function pr(s, e) {
1092
+ return V.get(`/v1/public/raven/games/${s}/builds/${e}`);
1090
1093
  }
1091
- function hr(s, e) {
1092
- return ie.post(`/v1/public/raven/games/${s}/builds/upload`, null, {
1094
+ function yr(s, e) {
1095
+ return V.post(`/v1/public/raven/games/${s}/builds/upload`, null, {
1093
1096
  params: e
1094
1097
  });
1095
1098
  }
1096
- function ur(s, e) {
1099
+ function mr(s, e) {
1097
1100
  const t = new FormData();
1098
- return t.append("file", e.chunk), ie.patch(`/v1/public/raven/games/${s}/builds/upload`, t, {
1101
+ return t.append("file", e.chunk), V.patch(`/v1/public/raven/games/${s}/builds/upload`, t, {
1099
1102
  params: e
1100
1103
  });
1101
1104
  }
1102
- function dr(s) {
1105
+ function br(s) {
1103
1106
  return s instanceof Error && (s.name === "XiorError" || s.name === "XiorTimeoutError");
1104
1107
  }
1105
- function gr(s) {
1108
+ function vr(s) {
1106
1109
  return !!(s && "kind" in s.data && "message" in s.data);
1107
1110
  }
1108
- let q;
1109
- function vs(s) {
1110
- q = s;
1111
+ let ee;
1112
+ function Cs(s) {
1113
+ ee = s;
1111
1114
  }
1112
- class fr extends se {
1115
+ class wr extends le {
1113
1116
  constructor() {
1114
1117
  super("NativeModuleManager");
1115
- l(this, "UPDATE_CHECK_INTERVAL_MS", 1e3 * 60 * 5);
1118
+ c(this, "UPDATE_CHECK_INTERVAL_MS", 1e3 * 60 * 5);
1116
1119
  // 5 minutes
1117
- l(this, "targetDir");
1118
- l(this, "updateInterval");
1119
- this.targetDir = y.join(Ee(), "resources"), this.logger.log("Target directory", this.targetDir);
1120
+ c(this, "targetDir");
1121
+ c(this, "updateInterval");
1122
+ this.targetDir = m.join(Se(), "resources"), this.logger.log("Target directory", this.targetDir);
1120
1123
  }
1121
1124
  async initWithDlls(t) {
1122
- super.init(), await E.mkdir(this.targetDir, { recursive: !0 }), await this.checkForUpdates(t), clearInterval(this.updateInterval), this.updateInterval = setInterval(() => this.checkForUpdates(t), this.UPDATE_CHECK_INTERVAL_MS);
1125
+ super.init(), await S.mkdir(this.targetDir, { recursive: !0 }), await this.checkForUpdates(t), clearInterval(this.updateInterval), this.updateInterval = setInterval(() => this.checkForUpdates(t), this.UPDATE_CHECK_INTERVAL_MS);
1123
1126
  }
1124
1127
  destroy() {
1125
1128
  this.updateInterval && (clearInterval(this.updateInterval), this.updateInterval = void 0), super.destroy();
1126
1129
  }
1127
1130
  async getCurrentVersion(t) {
1128
1131
  try {
1129
- const r = y.join(this.targetDir, t, "version.txt");
1130
- return await E.readFile(r, "utf-8");
1132
+ const r = m.join(this.targetDir, t, "version.txt");
1133
+ return await S.readFile(r, "utf-8");
1131
1134
  } catch {
1132
1135
  return null;
1133
1136
  }
1134
1137
  }
1135
1138
  getTargetPath(t) {
1136
- return y.join(this.targetDir, t);
1139
+ return m.join(this.targetDir, t);
1137
1140
  }
1138
1141
  getTargetVersionPath(t, r) {
1139
- return y.join(this.getTargetPath(t), r);
1142
+ return m.join(this.getTargetPath(t), r);
1140
1143
  }
1141
1144
  async checkForUpdates(t) {
1142
1145
  const r = global.OVERLAYED.APP_BUILD_CHANNEL;
@@ -1144,10 +1147,10 @@ class fr extends se {
1144
1147
  this.logger.sentryError("Invalid VITE_BUILD_CHANNEL");
1145
1148
  return;
1146
1149
  }
1147
- await (q == null ? void 0 : q());
1150
+ await (ee == null ? void 0 : ee());
1148
1151
  for (const n of t)
1149
1152
  try {
1150
- const { data: a } = await ir(n, r), o = await this.getCurrentVersion(n);
1153
+ const { data: a } = await hr(n, r), o = await this.getCurrentVersion(n);
1151
1154
  this.logger.log(`${n} > Update Check. current: ${o}, latest: ${a}`);
1152
1155
  const i = a !== o;
1153
1156
  this.logger.log(`${n} > Update found: ${o} -> ${a}`), await this.downloadAndExtractDll(n, a, r, i), this.logger.log(`${n} > Downloaded and extracted`), i && (this.logger.log(`${n} > Cleaning up versions older than ${a}`), await this.cleanupOldVersions(n, a)), this.emit("dllUpdated", { identifier: n, version: a });
@@ -1156,46 +1159,46 @@ class fr extends se {
1156
1159
  }
1157
1160
  }
1158
1161
  async downloadAndExtractDll(t, r, n, a) {
1159
- const { data: o } = await ar(t, n), i = this.getTargetPath(t), c = this.getTargetVersionPath(t, r);
1160
- await E.mkdir(c, { recursive: !0 });
1161
- const u = new Ne();
1162
- await u.loadAsync(o);
1163
- const d = Object.keys(u.files).map(async (g) => {
1164
- const h = u.files[g];
1165
- if (h && !h.dir) {
1166
- const f = y.join(c, g);
1162
+ const { data: o } = await dr(t, n), i = this.getTargetPath(t), l = this.getTargetVersionPath(t, r);
1163
+ await S.mkdir(l, { recursive: !0 });
1164
+ const h = new He();
1165
+ await h.loadAsync(o);
1166
+ const g = Object.keys(h.files).map(async (p) => {
1167
+ const u = h.files[p];
1168
+ if (u && !u.dir) {
1169
+ const d = m.join(l, p);
1167
1170
  if (!a)
1168
1171
  try {
1169
- await E.access(f, E.constants.F_OK);
1172
+ await S.access(d, S.constants.F_OK);
1170
1173
  return;
1171
1174
  } catch {
1172
- this.logger.warn(`${t} > File missing, re-downloading: ${f}`);
1175
+ this.logger.warn(`${t} > File missing, re-downloading: ${d}`);
1173
1176
  }
1174
- const w = await h.async("nodebuffer");
1175
- await E.writeFile(f, w);
1177
+ const b = await u.async("nodebuffer");
1178
+ await S.writeFile(d, b);
1176
1179
  }
1177
1180
  });
1178
- await Promise.all(d);
1179
- const p = y.join(i, "version.txt");
1180
- this.logger.log("Saving version file", p), await E.writeFile(p, r);
1181
+ await Promise.all(g);
1182
+ const f = m.join(i, "version.txt");
1183
+ this.logger.log("Saving version file", f), await S.writeFile(f, r);
1181
1184
  }
1182
1185
  async cleanupOldVersions(t, r) {
1183
- const n = y.join(this.targetDir, t), a = await E.readdir(n, { withFileTypes: !0 });
1186
+ const n = m.join(this.targetDir, t), a = await S.readdir(n, { withFileTypes: !0 });
1184
1187
  for (const o of a)
1185
- o.isDirectory() && o.name !== r && await E.rm(y.join(n, o.name), { recursive: !0, force: !0 });
1188
+ o.isDirectory() && o.name !== r && await S.rm(m.join(n, o.name), { recursive: !0, force: !0 });
1186
1189
  }
1187
1190
  }
1188
- const ee = k(fr);
1189
- class pr extends se {
1191
+ const ie = L(wr);
1192
+ class Er extends le {
1190
1193
  constructor() {
1191
1194
  super("RavenManager");
1192
- l(this, "REFETCH_INTERVAL", 1e3 * 60 * 5);
1193
- l(this, "FAILED_REFETCH_INTERVAL", 1e3 * 30);
1194
- l(this, "_ravenConfig");
1195
- l(this, "_executableToGameMap", /* @__PURE__ */ new Map());
1196
- l(this, "_executablesArray", []);
1197
- l(this, "_refetchIntervalHandler", null);
1198
- l(this, "_failedRefetchTimeoutHandler", null);
1195
+ c(this, "REFETCH_INTERVAL", 1e3 * 60 * 5);
1196
+ c(this, "FAILED_REFETCH_INTERVAL", 1e3 * 30);
1197
+ c(this, "_ravenConfig");
1198
+ c(this, "_executableToGameMap", /* @__PURE__ */ new Map());
1199
+ c(this, "_executablesArray", []);
1200
+ c(this, "_refetchIntervalHandler", null);
1201
+ c(this, "_failedRefetchTimeoutHandler", null);
1199
1202
  }
1200
1203
  init() {
1201
1204
  super.init(), this.fetchRavenConfig(), this._refetchIntervalHandler = setInterval(() => {
@@ -1212,16 +1215,16 @@ class pr extends se {
1212
1215
  return this._executableToGameMap;
1213
1216
  }
1214
1217
  destroy() {
1215
- this._refetchIntervalHandler && clearInterval(this._refetchIntervalHandler), this._failedRefetchTimeoutHandler && clearTimeout(this._failedRefetchTimeoutHandler), ee.getInstance().destroy(), super.destroy();
1218
+ this._refetchIntervalHandler && clearInterval(this._refetchIntervalHandler), this._failedRefetchTimeoutHandler && clearTimeout(this._failedRefetchTimeoutHandler), ie.getInstance().destroy(), super.destroy();
1216
1219
  }
1217
1220
  async fetchRavenConfig() {
1218
1221
  try {
1219
1222
  const r = {
1220
1223
  games: [
1221
- ...(await or()).data.games,
1224
+ ...(await gr()).data.games,
1222
1225
  {
1223
1226
  name: "Valorant",
1224
- identifier: lr("valorant"),
1227
+ identifier: fr("valorant"),
1225
1228
  executables: ["VALORANT-Win64-Shipping.exe"],
1226
1229
  modules: []
1227
1230
  }
@@ -1236,7 +1239,7 @@ class pr extends se {
1236
1239
  }
1237
1240
  a.modules.forEach((o) => n.add(o));
1238
1241
  }
1239
- await ee.getInstance().initWithDlls(Array.from(n)), this.logger.log("Raven updated", this._ravenConfig), this.emit("executablesUpdated", { executables: this.executables, map: this._executableToGameMap });
1242
+ await ie.getInstance().initWithDlls(Array.from(n)), this.logger.log("Raven updated", this._ravenConfig), this.emit("executablesUpdated", { executables: this.executables, map: this._executableToGameMap });
1240
1243
  } catch (t) {
1241
1244
  this.logger.captureSentryException("Failed to fetch Raven config", t), this._failedRefetchTimeoutHandler = setTimeout(() => this.fetchRavenConfig(), this.FAILED_REFETCH_INTERVAL);
1242
1245
  }
@@ -1245,23 +1248,23 @@ class pr extends se {
1245
1248
  this._executableToGameMap.clear(), this._executablesArray = [];
1246
1249
  }
1247
1250
  }
1248
- const j = k(pr), yr = te(import.meta.url), {
1249
- PipeEventServer: ws,
1250
- PipeEventClient: Es,
1251
- PipeEventBase: Is,
1252
- ProcessMonitor: mr,
1253
- Process: V,
1254
- InjectionMethod: ks,
1255
- AccessLevel: _s,
1256
- HardwareInterface: br
1257
- } = yr("@overlayed/app/dist/native-interface/build/overlayed_native_interface_x64.node");
1258
- class vr extends se {
1251
+ const H = L(Er), Ir = ae(import.meta.url), {
1252
+ PipeEventServer: Ls,
1253
+ PipeEventClient: Ds,
1254
+ PipeEventBase: As,
1255
+ ProcessMonitor: kr,
1256
+ Process: Q,
1257
+ InjectionMethod: Ms,
1258
+ AccessLevel: Os,
1259
+ HardwareInterface: lt
1260
+ } = Ir("@overlayed/app/dist/native-interface/build/overlayed_native_interface_x64.node");
1261
+ class _r extends le {
1259
1262
  constructor() {
1260
1263
  super("ProcessManager");
1261
- l(this, "_processMonitor");
1262
- l(this, "_processes", /* @__PURE__ */ new Map());
1263
- l(this, "boundOnRavenManagerExecutablesUpdated", this.onRavenManagerExecutablesUpdated.bind(this));
1264
- this._processMonitor = new mr();
1264
+ c(this, "_processMonitor");
1265
+ c(this, "_processes", /* @__PURE__ */ new Map());
1266
+ c(this, "boundOnRavenManagerExecutablesUpdated", this.onRavenManagerExecutablesUpdated.bind(this));
1267
+ this._processMonitor = new kr();
1265
1268
  }
1266
1269
  get hasAnyActiveProcesses() {
1267
1270
  return this.activeProcesses.length > 0;
@@ -1270,14 +1273,14 @@ class vr extends se {
1270
1273
  return Array.from(this._processes.values()).flat().filter((t) => !t.destroyedAt);
1271
1274
  }
1272
1275
  init() {
1273
- super.init(), j.getInstance().on("executablesUpdated", this.boundOnRavenManagerExecutablesUpdated), this._processMonitor.on("create", (t) => {
1276
+ super.init(), H.getInstance().on("executablesUpdated", this.boundOnRavenManagerExecutablesUpdated), this._processMonitor.on("create", (t) => {
1274
1277
  this.logger.log("Process created", t), this.addProcess(t), this.logger.log(`Active Process Count: ${this._processes.size}`), this.emit("create", { process: t });
1275
1278
  }), this._processMonitor.on("destroy", (t) => {
1276
1279
  this.logger.log("Process destroyed", t), this.deleteProcess(t), this.logger.log(`Active Process Count: ${this._processes.size}`), this.emit("destroy", { process: t });
1277
1280
  });
1278
1281
  }
1279
1282
  destroy() {
1280
- j.getInstance().off("executablesUpdated", this.boundOnRavenManagerExecutablesUpdated), this._processes.clear(), this._processMonitor.removeAllListeners(), super.destroy();
1283
+ H.getInstance().off("executablesUpdated", this.boundOnRavenManagerExecutablesUpdated), this._processes.clear(), this._processMonitor.removeAllListeners(), super.destroy();
1281
1284
  }
1282
1285
  isProcessRunning(t) {
1283
1286
  const r = this._processes.get(t);
@@ -1305,11 +1308,11 @@ class vr extends se {
1305
1308
  n.length === 0 ? this._processes.delete(t.name) : this._processes.set(t.name, n);
1306
1309
  }
1307
1310
  }
1308
- const C = k(vr), wr = te(import.meta.url), { RenderInterface: Er, renderHookPath: Ss } = wr("@overlayed/app/dist/render-interface/build/overlayed_render_interface_x64.node");
1309
- var Ir = Object.defineProperty, kr = (s, e, t) => e in s ? Ir(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t, J = (s, e, t) => kr(s, typeof e != "symbol" ? e + "" : e, t);
1310
- let _r = class {
1311
+ const K = L(_r), Pr = ae(import.meta.url), { RenderInterface: Sr, renderHookPath: Ks } = Pr("@overlayed/app/dist/render-interface/build/overlayed_render_interface_x64.node");
1312
+ var Cr = Object.defineProperty, Lr = (s, e, t) => e in s ? Cr(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t, te = (s, e, t) => Lr(s, typeof e != "symbol" ? e + "" : e, t);
1313
+ let Dr = class {
1311
1314
  constructor(e) {
1312
- J(this, "_instance"), J(this, "_resolution"), J(this, "boundOnResolutionChanged", this.onResolutionChanged.bind(this)), this._instance = e, this._resolution = { width: 0, height: 0 }, this._instance.on("resolution", this.boundOnResolutionChanged);
1315
+ te(this, "_instance"), te(this, "_resolution"), te(this, "boundOnResolutionChanged", this.onResolutionChanged.bind(this)), this._instance = e, this._resolution = { width: 0, height: 0 }, this._instance.on("resolution", this.boundOnResolutionChanged);
1313
1316
  }
1314
1317
  destroy() {
1315
1318
  this._instance.off("resolution", this.boundOnResolutionChanged);
@@ -1324,22 +1327,22 @@ let _r = class {
1324
1327
  this._resolution = { width: e, height: t };
1325
1328
  }
1326
1329
  };
1327
- class Sr {
1330
+ class Ar {
1328
1331
  constructor() {
1329
- J(this, "interfaces", {});
1332
+ te(this, "interfaces", {});
1330
1333
  }
1331
1334
  createInterface(e) {
1332
- return this.interfaces[e] ? this.interfaces[e] : (this.interfaces[e] = new _r(new Er(e, { access: 1 })), this.interfaces[e]);
1335
+ return this.interfaces[e] ? this.interfaces[e] : (this.interfaces[e] = new Dr(new Sr(e, { access: 1 })), this.interfaces[e]);
1333
1336
  }
1334
1337
  getInterface(e) {
1335
1338
  return this.interfaces[e] ? this.interfaces[e] : this.createInterface(e);
1336
1339
  }
1337
1340
  }
1338
- const x = k(Sr);
1339
- var Pr = Object.defineProperty, Cr = (s, e, t) => e in s ? Pr(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t, U = (s, e, t) => Cr(s, typeof e != "symbol" ? e + "" : e, t);
1340
- class Lr {
1341
+ const B = L(Ar);
1342
+ var Mr = Object.defineProperty, Or = (s, e, t) => e in s ? Mr(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t, Y = (s, e, t) => Or(s, typeof e != "symbol" ? e + "" : e, t);
1343
+ class Kr {
1341
1344
  constructor(e) {
1342
- U(this, "_clientId", null), U(this, "_userId", null), U(this, "options"), U(this, "eventQueue"), this.options = this.resolveOptions(e), this.eventQueue = new ze(), this.setupFlushInterval();
1345
+ Y(this, "_clientId", null), Y(this, "_userId", null), Y(this, "options"), Y(this, "eventQueue"), this.options = this.resolveOptions(e), this.eventQueue = new Qe(), this.setupFlushInterval();
1343
1346
  }
1344
1347
  set clientId(e) {
1345
1348
  this._clientId = e;
@@ -1364,22 +1367,22 @@ class Lr {
1364
1367
  };
1365
1368
  }
1366
1369
  }
1367
- const P = k(Lr), Kr = te(import.meta.url), Fr = Kr.resolve("@overlayed/app/dist/render-interface/build/overlayed_render_hook_x64.dll");
1368
- class Mr extends $t {
1370
+ const O = L(Kr), Rr = ae(import.meta.url), Fr = Rr.resolve("@overlayed/app/dist/render-interface/build/overlayed_render_hook_x64.dll");
1371
+ class $r extends Nt {
1369
1372
  constructor() {
1370
1373
  super("GameLaunchManager");
1371
- l(this, "boundOnProcessCreate", this.onProcessCreate.bind(this));
1372
- l(this, "boundOnProcessDestroy", this.onProcessDestroy.bind(this));
1373
- l(this, "subscribedGames", /* @__PURE__ */ new Set());
1374
+ c(this, "boundOnProcessCreate", this.onProcessCreate.bind(this));
1375
+ c(this, "boundOnProcessDestroy", this.onProcessDestroy.bind(this));
1376
+ c(this, "subscribedGames", /* @__PURE__ */ new Set());
1374
1377
  }
1375
1378
  setSubscribedGames(t) {
1376
1379
  this.subscribedGames = new Set(t);
1377
1380
  }
1378
1381
  init() {
1379
- super.init(), x.getInstance().createInterface("OGG_SIEGE"), C.getInstance().on("create", this.boundOnProcessCreate), C.getInstance().on("destroy", this.boundOnProcessDestroy);
1382
+ super.init(), B.getInstance().createInterface("OGG_SIEGE"), K.getInstance().on("create", this.boundOnProcessCreate), K.getInstance().on("destroy", this.boundOnProcessDestroy);
1380
1383
  }
1381
1384
  destroy() {
1382
- C.getInstance().off("create", this.boundOnProcessCreate), C.getInstance().off("destroy", this.boundOnProcessDestroy), super.destroy();
1385
+ K.getInstance().off("create", this.boundOnProcessCreate), K.getInstance().off("destroy", this.boundOnProcessDestroy), super.destroy();
1383
1386
  }
1384
1387
  async onProcessCreate({ process: t }) {
1385
1388
  const r = this.getRavenGame(t);
@@ -1394,12 +1397,12 @@ class Mr extends $t {
1394
1397
  const n = new AbortController();
1395
1398
  if (await this.emit("gameLaunch", { game: r.identifier, reject: () => n.abort }), n.signal.aborted)
1396
1399
  return;
1397
- if (this.logger.log("Game Launched", r), this.logger.log("Process is elevated: ", t.isElevated), this.logger.log("Current process is elevated: ", V.currentProcess.isElevated), t.isElevated && !V.currentProcess.isElevated) {
1398
- I.getInstance().fatal("Game is elevated but the App is not", "ELEVATION_MISMATCH", {
1399
- appElevated: !!V.currentProcess.isElevated,
1400
+ if (this.logger.log("Game Launched", r), this.logger.log("Process is elevated: ", t.isElevated), this.logger.log("Current process is elevated: ", Q.currentProcess.isElevated), t.isElevated && !Q.currentProcess.isElevated) {
1401
+ C.getInstance().fatal("Game is elevated but the App is not", "ELEVATION_MISMATCH", {
1402
+ appElevated: !!Q.currentProcess.isElevated,
1400
1403
  gameElevated: !!t.isElevated
1401
1404
  }), this.logger.sentryLog("Game elevated but App is not", {
1402
- appElevated: V.currentProcess.isElevated,
1405
+ appElevated: Q.currentProcess.isElevated,
1403
1406
  gameElevated: t.isElevated
1404
1407
  });
1405
1408
  return;
@@ -1414,41 +1417,41 @@ class Mr extends $t {
1414
1417
  });
1415
1418
  }
1416
1419
  const o = r == null ? void 0 : r.modules.map(async (i) => {
1417
- const c = await ee.getInstance().getCurrentVersion(i);
1418
- if (!c)
1420
+ const l = await ie.getInstance().getCurrentVersion(i);
1421
+ if (!l)
1419
1422
  return this.logger.sentryError("No version found for DLL", { identifier: i }), Promise.resolve();
1420
- const u = ee.getInstance().getTargetVersionPath(i, c);
1421
- this.logger.log("DLL Path", u);
1422
- const d = await this.getDllFiles(u);
1423
- return this.logger.log("DLL Files", d), Promise.all(
1424
- d.map(async (p) => {
1425
- const g = y.basename(p), h = y.join(u, g);
1426
- if (!h)
1423
+ const h = ie.getInstance().getTargetVersionPath(i, l);
1424
+ this.logger.log("DLL Path", h);
1425
+ const g = await this.getDllFiles(h);
1426
+ return this.logger.log("DLL Files", g), Promise.all(
1427
+ g.map(async (f) => {
1428
+ const p = m.basename(f), u = m.join(h, p);
1429
+ if (!u)
1427
1430
  return Promise.resolve();
1428
- this.logger.log("Injecting: ", h);
1431
+ this.logger.log("Injecting: ", u);
1429
1432
  try {
1430
- return t.injectDll(h).then(() => {
1431
- this.logger.log("Injection Successful", h);
1432
- }).catch((f) => {
1433
- this.logger.sentryError("Injection Failed [1]", { targetPath: h }, f);
1433
+ return t.injectDll(u).then(() => {
1434
+ this.logger.log("Injection Successful", u);
1435
+ }).catch((d) => {
1436
+ this.logger.sentryError("Injection Failed [1]", { targetPath: u }, d);
1434
1437
  });
1435
- } catch (f) {
1436
- return this.logger.sentryError("Injection Failed [2]", { targetPath: h }, f), Promise.reject(f);
1438
+ } catch (d) {
1439
+ return this.logger.sentryError("Injection Failed [2]", { targetPath: u }, d), Promise.reject(d);
1437
1440
  }
1438
1441
  })
1439
1442
  );
1440
1443
  });
1441
- await Promise.allSettled(o), this.emit("gameReadyInternal", { ravenGame: r, process: t }), this.emit("gameReady", { game: r.identifier }), P.getInstance().track("game_launch", {
1444
+ await Promise.allSettled(o), this.emit("gameReadyInternal", { ravenGame: r, process: t }), this.emit("gameReady", { game: r.identifier }), O.getInstance().track("game_launch", {
1442
1445
  game: r.identifier
1443
1446
  });
1444
1447
  }
1445
1448
  copyDll(t) {
1446
- const r = y.basename(t), n = lt(t), a = y.join(Ee(), "resources"), o = y.join(a, r);
1449
+ const r = m.basename(t), n = gt(t), a = m.join(Se(), "resources"), o = m.join(a, r);
1447
1450
  this.logger.debug("Copying", n, "to", o);
1448
1451
  try {
1449
- fe(a) || ge(a, { recursive: !0 });
1450
- const i = Te(n);
1451
- pe(o, i), ot(n, o);
1452
+ ve(a) || be(a, { recursive: !0 });
1453
+ const i = ze(n);
1454
+ we(o, i), dt(n, o);
1452
1455
  } catch (i) {
1453
1456
  return i.code === "EBUSY" ? o : (this.logger.captureSentryException("Failed to copy", i), this.logger.sentryError("Failed to copy", { originalPath: n, targetPath: o }), !1);
1454
1457
  }
@@ -1456,21 +1459,21 @@ class Mr extends $t {
1456
1459
  }
1457
1460
  async getDllFiles(t) {
1458
1461
  try {
1459
- return (await E.readdir(t)).filter((n) => n.endsWith(".dll")).map((n) => y.join(t, n));
1462
+ return (await S.readdir(t)).filter((n) => n.endsWith(".dll")).map((n) => m.join(t, n));
1460
1463
  } catch (r) {
1461
1464
  return this.logger.captureSentryException("Failed to read DLL directory", r), this.logger.sentryError("Failed to read DLL directory", { dllPath: t }), [];
1462
1465
  }
1463
1466
  }
1464
1467
  onProcessDestroy({ process: t }) {
1465
1468
  const r = this.getRavenGame(t);
1466
- r && (this.emit("gameCloseInternal", { ravenGame: r, process: t }), this.emit("gameClose", { game: r.identifier }), P.getInstance().track("game_close", {
1469
+ r && (this.emit("gameCloseInternal", { ravenGame: r, process: t }), this.emit("gameClose", { game: r.identifier }), O.getInstance().track("game_close", {
1467
1470
  game: r.identifier
1468
1471
  }));
1469
1472
  }
1470
1473
  getRavenGame(t) {
1471
1474
  if (!t.name)
1472
1475
  return;
1473
- const r = j.getInstance().getExecutableData(t.name);
1476
+ const r = H.getInstance().getExecutableData(t.name);
1474
1477
  if (!r) {
1475
1478
  this.logger.sentryError("No raven game found for process", { process: t });
1476
1479
  return;
@@ -1478,17 +1481,17 @@ class Mr extends $t {
1478
1481
  return r;
1479
1482
  }
1480
1483
  }
1481
- const T = k(Mr);
1482
- class Dr extends Ve {
1484
+ const G = L($r);
1485
+ class xr extends Ye {
1483
1486
  constructor() {
1484
1487
  super("GameBuildManager");
1485
- l(this, "boundOnGameLaunch", this.onGameLaunch.bind(this));
1488
+ c(this, "boundOnGameLaunch", this.onGameLaunch.bind(this));
1486
1489
  }
1487
1490
  init() {
1488
- super.init(), T.getInstance().on("gameReadyInternal", this.boundOnGameLaunch);
1491
+ super.init(), G.getInstance().on("gameReadyInternal", this.boundOnGameLaunch);
1489
1492
  }
1490
1493
  destroy() {
1491
- T.getInstance().off("gameReadyInternal", this.boundOnGameLaunch), super.destroy();
1494
+ G.getInstance().off("gameReadyInternal", this.boundOnGameLaunch), super.destroy();
1492
1495
  }
1493
1496
  async onGameLaunch(...t) {
1494
1497
  const [{ ravenGame: r, process: n }] = t;
@@ -1500,54 +1503,54 @@ class Dr extends Ve {
1500
1503
  );
1501
1504
  return;
1502
1505
  }
1503
- const a = Te(n.path), o = ct("sha256").update(a).digest("hex");
1506
+ const a = ze(n.path), o = ft("sha256").update(a).digest("hex");
1504
1507
  this.logger.log("Process Path", n.path), this.logger.log("Process Name", n.name), this.logger.log("Build Hash", o);
1505
1508
  let i = !1;
1506
1509
  try {
1507
- i = (await cr(r.identifier, o)).data.upload;
1508
- } catch (d) {
1509
- this.logger.captureSentryException("Error checking game build hash", d);
1510
+ i = (await pr(r.identifier, o)).data.upload;
1511
+ } catch (g) {
1512
+ this.logger.captureSentryException("Error checking game build hash", g);
1510
1513
  return;
1511
1514
  }
1512
1515
  if (!i) {
1513
1516
  this.logger.log("Build hash already exists, skipping upload");
1514
1517
  return;
1515
1518
  }
1516
- const c = new Ne();
1517
- c.file(n.name, a);
1518
- const u = await c.generateAsync({ type: "blob" });
1519
+ const l = new He();
1520
+ l.file(n.name, a);
1521
+ const h = await l.generateAsync({ type: "blob" });
1519
1522
  try {
1520
- this.logger.log("Uploading build (size: ", u.size, " bytes)");
1521
- const d = new At(u, {
1523
+ this.logger.log("Uploading build (size: ", h.size, " bytes)");
1524
+ const g = new Tt(h, {
1522
1525
  chunkSizeMb: 25,
1523
1526
  maxConcurrent: 1
1524
- }), p = await hr(r.identifier, {
1527
+ }), f = await yr(r.identifier, {
1525
1528
  build_hash: o,
1526
- chunk_count: d.totalChunks,
1527
- file_size_bytes: u.size
1529
+ chunk_count: g.totalChunks,
1530
+ file_size_bytes: h.size
1528
1531
  });
1529
- await d.chunk(async (g, h) => {
1530
- this.logger.log("Uploading chunk", h), await ur(r.identifier, {
1531
- chunk: g,
1532
+ await g.chunk(async (p, u) => {
1533
+ this.logger.log("Uploading chunk", u), await mr(r.identifier, {
1534
+ chunk: p,
1532
1535
  build_hash: o,
1533
- chunk_index: h,
1534
- upload_token: p.data.upload_token
1536
+ chunk_index: u,
1537
+ upload_token: f.data.upload_token
1535
1538
  });
1536
1539
  }), this.logger.log("Build uploaded successfully");
1537
- } catch (d) {
1538
- dr(d) ? gr(d.response) ? this.logger.captureSentryException("Error uploading build hash, api error", d) : this.logger.captureSentryException("Error uploading build hash, request error", d) : this.logger.captureSentryException("Error uploading build hash, unknown error", d);
1540
+ } catch (g) {
1541
+ br(g) ? vr(g.response) ? this.logger.captureSentryException("Error uploading build hash, api error", g) : this.logger.captureSentryException("Error uploading build hash, request error", g) : this.logger.captureSentryException("Error uploading build hash, unknown error", g);
1539
1542
  }
1540
1543
  }
1541
1544
  }
1542
- const rt = k(Dr);
1543
- function Ar(s = []) {
1544
- return y.normalize(y.join(je(global.OVERLAYED.APP_NAME), ...s));
1545
+ const ct = L(xr);
1546
+ function Tr(s = []) {
1547
+ return m.normalize(m.join(qe(global.OVERLAYED.APPLICATION_ID), ...s));
1545
1548
  }
1546
- const $r = L({
1549
+ const Nr = R({
1547
1550
  game: "string",
1548
1551
  type: "string",
1549
1552
  creation_time: "number"
1550
- }), de = /* @__PURE__ */ new Map([
1553
+ }), me = /* @__PURE__ */ new Map([
1551
1554
  [1, "LeftButton"],
1552
1555
  [2, "RightButton"],
1553
1556
  [3, "Cancel"],
@@ -1740,34 +1743,34 @@ const $r = L({
1740
1743
  [252, "Noname"],
1741
1744
  [253, "PA1"],
1742
1745
  [254, "OEM_Clear"]
1743
- ]), $e = new Map(de.entries().map(([s, e]) => [e, s])), Or = L({
1746
+ ]), Ne = new Map(me.entries().map(([s, e]) => [e, s])), Br = R({
1744
1747
  "[string]": {
1745
1748
  keys: "string[]",
1746
- mode: L("'toggle' | 'hold'").pipe((s) => s ?? "toggle")
1749
+ mode: R("'toggle' | 'hold'").pipe((s) => s ?? "toggle")
1747
1750
  }
1748
1751
  });
1749
- class Rr extends se {
1752
+ class Gr extends le {
1750
1753
  constructor(t) {
1751
1754
  super("KeybindManager");
1752
- l(this, "preferencesKeybindToCallbacks", /* @__PURE__ */ new Map());
1753
- l(this, "pressedKeys", /* @__PURE__ */ new Set());
1754
- l(this, "activeKeybinds", /* @__PURE__ */ new Set());
1755
- l(this, "triggeredToggleKeybinds", /* @__PURE__ */ new Set());
1756
- l(this, "boundHandleKeyboardFocus", this.handleKeyboardFocus.bind(this));
1757
- l(this, "boundHandleKeyDown", this.handleKeyDown.bind(this));
1758
- l(this, "boundHandleKeyUp", this.handleKeyUp.bind(this));
1759
- l(this, "keybindsFile");
1755
+ c(this, "preferencesKeybindToCallbacks", /* @__PURE__ */ new Map());
1756
+ c(this, "pressedKeys", /* @__PURE__ */ new Set());
1757
+ c(this, "activeKeybinds", /* @__PURE__ */ new Set());
1758
+ c(this, "triggeredToggleKeybinds", /* @__PURE__ */ new Set());
1759
+ c(this, "boundHandleKeyboardFocus", this.handleKeyboardFocus.bind(this));
1760
+ c(this, "boundHandleKeyDown", this.handleKeyDown.bind(this));
1761
+ c(this, "boundHandleKeyUp", this.handleKeyUp.bind(this));
1762
+ c(this, "keybindsFile");
1760
1763
  // TODO try to figure out a better way to handle this
1761
- l(this, "keybindListeningPaused", !1);
1762
- this.keybindsFile = new Lt({
1763
- path: Ar(["keybinds.json"]),
1764
- schema: Or,
1764
+ c(this, "keybindListeningPaused", !1);
1765
+ this.keybindsFile = new Kt({
1766
+ path: Tr(["keybinds.json"]),
1767
+ schema: Br,
1765
1768
  default: t
1766
1769
  });
1767
1770
  }
1768
1771
  init() {
1769
1772
  super.init();
1770
- const t = x.getInstance().getInterface("OGG_SIEGE");
1773
+ const t = B.getInstance().getInterface("OGG_SIEGE");
1771
1774
  t.instance.on("keyboardFocus", this.boundHandleKeyboardFocus), t.instance.on("keyDown", this.boundHandleKeyDown), t.instance.on("keyUp", this.boundHandleKeyUp);
1772
1775
  }
1773
1776
  // TODO support multiple callbacks
@@ -1801,13 +1804,13 @@ class Rr extends se {
1801
1804
  return this.keybindsFile.get();
1802
1805
  }
1803
1806
  destroy() {
1804
- const t = x.getInstance().getInterface("OGG_SIEGE");
1807
+ const t = B.getInstance().getInterface("OGG_SIEGE");
1805
1808
  t.instance.off("keyboardFocus", this.boundHandleKeyboardFocus), t.instance.off("keyDown", this.boundHandleKeyDown), t.instance.off("keyUp", this.boundHandleKeyUp), super.destroy();
1806
1809
  }
1807
1810
  handleKeyDown(t) {
1808
1811
  if (this.keybindListeningPaused)
1809
1812
  return;
1810
- const r = de.get(t.key);
1813
+ const r = me.get(t.key);
1811
1814
  if (!r) {
1812
1815
  this.logger.error("Unknown key down", t);
1813
1816
  return;
@@ -1820,7 +1823,7 @@ class Rr extends se {
1820
1823
  async handleKeyUp(t) {
1821
1824
  if (this.keybindListeningPaused)
1822
1825
  return;
1823
- const r = de.get(t.key);
1826
+ const r = me.get(t.key);
1824
1827
  if (!r)
1825
1828
  return;
1826
1829
  this.pressedKeys.delete(r);
@@ -1841,14 +1844,14 @@ class Rr extends se {
1841
1844
  const t = this.keybindsFile.get();
1842
1845
  for (const [r, n] of this.preferencesKeybindToCallbacks.entries()) {
1843
1846
  const a = t[r];
1844
- if (a.keys.length === this.pressedKeys.size && a.keys.every((i) => $e.has(i) ? this.pressedKeys.has(i) : !1)) {
1847
+ if (a.keys.length === this.pressedKeys.size && a.keys.every((i) => Ne.has(i) ? this.pressedKeys.has(i) : !1)) {
1845
1848
  this.triggerKeybind(a, n, r);
1846
1849
  return;
1847
1850
  }
1848
1851
  }
1849
1852
  for (const [r, n] of this.preferencesKeybindToCallbacks.entries()) {
1850
1853
  const a = t[r];
1851
- a.keys.every((i) => $e.has(i) ? this.pressedKeys.has(i) : (this.logger.error("Unknown key", i, a), !1)) && this.triggerKeybind(a, n, r);
1854
+ a.keys.every((i) => Ne.has(i) ? this.pressedKeys.has(i) : (this.logger.error("Unknown key", i, a), !1)) && this.triggerKeybind(a, n, r);
1852
1855
  }
1853
1856
  }
1854
1857
  triggerKeybind(t, r, n) {
@@ -1869,15 +1872,15 @@ class Rr extends se {
1869
1872
  return `(${t.keys.join("+")}${t.mode ? ` ${t.mode}` : ""})`;
1870
1873
  }
1871
1874
  }
1872
- class xr extends Ve {
1875
+ class jr extends Ye {
1873
1876
  constructor(t) {
1874
1877
  super("OverridesManager");
1875
- l(this, "renderInterface");
1876
- l(this, "globalCursorOverrideCount", /* @__PURE__ */ new Set());
1877
- l(this, "globalMouseBlockCount", /* @__PURE__ */ new Set());
1878
- l(this, "globalKeyboardBlockCount", /* @__PURE__ */ new Set());
1879
- l(this, "keyInputBlocks", {});
1880
- this.renderInterface = x.getInstance().getInterface(t);
1878
+ c(this, "renderInterface");
1879
+ c(this, "globalCursorOverrideCount", /* @__PURE__ */ new Set());
1880
+ c(this, "globalMouseBlockCount", /* @__PURE__ */ new Set());
1881
+ c(this, "globalKeyboardBlockCount", /* @__PURE__ */ new Set());
1882
+ c(this, "keyInputBlocks", {});
1883
+ this.renderInterface = B.getInstance().getInterface(t);
1881
1884
  }
1882
1885
  scope(t) {
1883
1886
  return {
@@ -1900,35 +1903,105 @@ class xr extends Ve {
1900
1903
  this.keyInputBlocks[r] || (this.keyInputBlocks[r] = /* @__PURE__ */ new Set()), n ? this.keyInputBlocks[r].add(t) : this.keyInputBlocks[r].delete(t), n && this.keyInputBlocks[r].size === 1 ? this.renderInterface.instance.setKeyInputBlock(r, !0) : !n && this.keyInputBlocks[r].size === 0 && this.renderInterface.instance.setKeyInputBlock(r, !1);
1901
1904
  }
1902
1905
  }
1903
- const Tr = k(xr, "OGG_SIEGE");
1904
- let H = !1, W;
1905
- function Cs(s) {
1906
+ const Ur = L(jr, "OGG_SIEGE");
1907
+ var he, Be;
1908
+ function zr() {
1909
+ if (Be) return he;
1910
+ Be = 1;
1911
+ var s = (o, i) => () => (i || o((i = { exports: {} }).exports, i), i.exports), e = s((o, i) => {
1912
+ var l = /* @__PURE__ */ new Set(["mouseDown", "mouseUp", "pointerDown", "pointerUp"]), h = /* @__PURE__ */ new WeakSet();
1913
+ function g(f, p, { allowHosts: u } = {}) {
1914
+ let { shell: d } = p;
1915
+ if (h.has(f)) return;
1916
+ h.add(f);
1917
+ let b = f.webContents;
1918
+ function k(y) {
1919
+ return !!(!P(y) || u != null && u.includes(y.host));
1920
+ }
1921
+ function P(y) {
1922
+ return new URL(b.getURL()).origin !== y.origin;
1923
+ }
1924
+ let D = 0;
1925
+ function v() {
1926
+ D = Date.now();
1927
+ }
1928
+ function W() {
1929
+ let y = Date.now() - D, I = y < 150;
1930
+ return I || console.warn("was not recently active", y), I;
1931
+ }
1932
+ if (process.platform === "win32") {
1933
+ let y = { KEYDOWN: 256, LBUTTONUP: 514, MBUTTONUP: 520, RBUTTONUP: 517, XBUTTONUP: 524, TOUCH: 576 };
1934
+ for (let I of Object.values(y)) f.hookWindowMessage(I, v);
1935
+ }
1936
+ b.on("input-event", (y, I) => {
1937
+ l.has(I.type) && v();
1938
+ }), b.on("will-navigate", (y, I) => {
1939
+ let _ = y.url || I;
1940
+ if (console.log("will-navigate", _), !_) return;
1941
+ let Oe = new URL(_);
1942
+ if (!k(Oe)) {
1943
+ if (!W()) {
1944
+ console.log("blocked navigation", _), y.preventDefault();
1945
+ return;
1946
+ }
1947
+ P(Oe) && (console.log("external navigation", _), y.preventDefault(), d.openExternal(_));
1948
+ }
1949
+ }), b.session.on("will-download", (y, I) => {
1950
+ let _ = I.getURL();
1951
+ /^blob:/.test(_) || y.preventDefault();
1952
+ }), b.setWindowOpenHandler((y) => {
1953
+ console.log("window-open", y.url);
1954
+ let { url: I } = y, _ = new URL(I);
1955
+ if (!k(_)) return W() ? (P(_) && d.openExternal(y.url), { action: "deny" }) : (console.log("blocked navigation", I), { action: "deny" });
1956
+ });
1957
+ }
1958
+ i.exports = g;
1959
+ }), t = s((o, i) => {
1960
+ var l = /* @__PURE__ */ new Set(["Mozilla", "AppleWebKit", "Chrome", "Safari", "Gecko", "Firefox", "OPR", "Edg", "Version", "Mobile", "curl", "PostmanRuntime"]);
1961
+ async function h(g, f, p) {
1962
+ let { webContents: u } = g, d = await u.executeJavaScript("navigator.userAgent");
1963
+ d = d.match(/[^\/]+\/[^\s]+( \([^\)]+\))?/g).map((b) => b.trim()).filter((b) => {
1964
+ let [k] = b.split("/", 1);
1965
+ return l.has(k);
1966
+ }).join(" "), u.setUserAgent(d), f.app.userAgentFallback = d;
1967
+ }
1968
+ i.exports = h;
1969
+ }), r = e(), n = t();
1970
+ function a(o, i, l = {}) {
1971
+ r(o, i, l.linkHandler), n(o, i, l.userAgent);
1972
+ }
1973
+ return he = { setupRevUtils: a, setupLinkHandler: r, setUserAgent: n }, he;
1974
+ }
1975
+ var Hr = zr();
1976
+ let J = !1, X;
1977
+ function Fs(s) {
1906
1978
  const { init: e = !0 } = s;
1907
- if (Nr(s), re.getInstance().init(s.appName), H)
1908
- return W;
1979
+ if (Vr(s), oe.getInstance().init(s.appName), J)
1980
+ return X;
1909
1981
  function t() {
1910
- Qr(s);
1911
- const r = /* @__PURE__ */ new Map(), n = jr(s.modules, r), a = zr(), o = Ur(s.keybinds), i = Hr(), c = Wr();
1912
- Gr(s), Vr(s, r), H = !0, W = {
1982
+ rs(s);
1983
+ const r = /* @__PURE__ */ new Map(), n = Qr(s.modules, r), a = Yr(), o = Xr(s.keybinds), i = Zr(), l = es(), h = ts();
1984
+ Wr(s), Jr(s, r), J = !0, X = {
1913
1985
  ...n,
1914
1986
  ...a,
1987
+ ads: h,
1915
1988
  keybinds: o,
1916
1989
  windows: i,
1917
- input: c,
1918
- hasAnyActiveProcesses: () => C.getInstance().hasAnyActiveProcesses,
1990
+ input: l,
1991
+ hasAnyActiveProcesses: () => K.getInstance().hasAnyActiveProcesses,
1919
1992
  init: t,
1920
- initialized: H
1993
+ initialized: J
1921
1994
  };
1922
1995
  }
1923
- return e ? (t(), W) : new Proxy(
1996
+ return e ? (t(), X) : new Proxy(
1924
1997
  {
1925
1998
  init: t
1926
1999
  },
1927
2000
  {
1928
2001
  get: (r, n) => {
1929
- if (n !== "init" && !H)
2002
+ if (n !== "init" && !J)
1930
2003
  throw new Error(`overlayed was called before initialized: ${n}`);
1931
- return n === "init" ? r[n] : W[n];
2004
+ return n === "init" ? r[n] : X[n];
1932
2005
  }
1933
2006
  }
1934
2007
  );
@@ -1938,49 +2011,53 @@ global.OVERLAYED = new Proxy({}, {
1938
2011
  throw new Error("function overlayed was not called");
1939
2012
  }
1940
2013
  });
1941
- function Nr(s) {
2014
+ function Vr(s) {
1942
2015
  global.OVERLAYED = {
1943
- APP_NAME: s.appName,
1944
- APP_BUILD_CHANNEL: s.channel ?? "alpha"
2016
+ APPLICATION_ID: s.applicationId,
2017
+ APP_BUILD_CHANNEL: s.channel ?? "alpha",
2018
+ electron: s.electron
1945
2019
  };
1946
2020
  }
1947
- function Gr(s) {
2021
+ function Wr(s) {
1948
2022
  const e = s.universal ? ["*"] : s.modules.map((t) => t.key);
1949
- T.getInstance().setSubscribedGames(e), rt.getInstance().init(), T.getInstance().init(), C.getInstance().init(), j.getInstance().init(), Ge.on("quit", () => {
1950
- Br();
2023
+ G.getInstance().setSubscribedGames(e), ct.getInstance().init(), G.getInstance().init(), K.getInstance().init(), H.getInstance().init(), global.OVERLAYED.electron.ipcMain.handle("getAppInfo", async () => ({
2024
+ ...(await ur(global.OVERLAYED.APPLICATION_ID)).data,
2025
+ userId: lt.generateUniqueIdentifier()
2026
+ })), Ve.on("quit", () => {
2027
+ qr();
1951
2028
  });
1952
2029
  }
1953
- function Br() {
1954
- j.getInstance().destroy(), T.getInstance().destroy(), rt.getInstance().destroy(), C.getInstance().destroy(), x.getInstance().getInterface("OGG_SIEGE").destroy(), be.getInstance().destroy(), I.getInstance().destroy();
2030
+ function qr() {
2031
+ H.getInstance().destroy(), G.getInstance().destroy(), ct.getInstance().destroy(), K.getInstance().destroy(), B.getInstance().getInterface("OGG_SIEGE").destroy(), ke.getInstance().destroy(), C.getInstance().destroy();
1955
2032
  }
1956
- function jr(s, e) {
2033
+ function Qr(s, e) {
1957
2034
  return s.reduce((t, r) => {
1958
2035
  const n = r.key;
1959
2036
  return t[n] = {
1960
2037
  // prettier-ignore
1961
2038
  on(a, o) {
1962
- const i = A(n, a), c = e.get(i) ?? /* @__PURE__ */ new Set();
1963
- c.add(o), e.set(i, c);
2039
+ const i = $(n, a), l = e.get(i) ?? /* @__PURE__ */ new Set();
2040
+ l.add(o), e.set(i, l);
1964
2041
  },
1965
2042
  onAny(a) {
1966
- const o = A(n, "*"), i = e.get(o) ?? /* @__PURE__ */ new Set();
2043
+ const o = $(n, "*"), i = e.get(o) ?? /* @__PURE__ */ new Set();
1967
2044
  i.add(a), e.set(o, i);
1968
2045
  },
1969
2046
  // prettier-ignore
1970
2047
  off(a, o) {
1971
- const i = A(n, a), c = e.get(i) ?? /* @__PURE__ */ new Set();
1972
- c.delete(o), e.set(i, c);
2048
+ const i = $(n, a), l = e.get(i) ?? /* @__PURE__ */ new Set();
2049
+ l.delete(o), e.set(i, l);
1973
2050
  },
1974
2051
  // prettier-ignore
1975
2052
  offAny(a) {
1976
- const o = A(n, "*"), i = e.get(o) ?? /* @__PURE__ */ new Set();
2053
+ const o = $(n, "*"), i = e.get(o) ?? /* @__PURE__ */ new Set();
1977
2054
  i.delete(a), e.set(o, i);
1978
2055
  }
1979
2056
  }, t;
1980
2057
  }, {});
1981
2058
  }
1982
- function zr() {
1983
- const s = I.getInstance(), e = T.getInstance();
2059
+ function Yr() {
2060
+ const s = C.getInstance(), e = G.getInstance();
1984
2061
  return {
1985
2062
  on: (t, r) => {
1986
2063
  switch (t) {
@@ -2032,42 +2109,42 @@ function zr() {
2032
2109
  }
2033
2110
  };
2034
2111
  }
2035
- function A(s, e) {
2112
+ function $(s, e) {
2036
2113
  return `${s}:${e}`;
2037
2114
  }
2038
- function Vr(s, e) {
2039
- const t = be.getInstance();
2115
+ function Jr(s, e) {
2116
+ const t = ke.getInstance();
2040
2117
  function r(n) {
2041
- const a = $r(n);
2042
- if (a instanceof L.errors) {
2043
- I.getInstance().warn("Invalid event", "INVALID_EVENT", {
2118
+ const a = Nr(n);
2119
+ if (a instanceof R.errors) {
2120
+ C.getInstance().warn("Invalid event", "INVALID_EVENT", {
2044
2121
  summary: a.summary
2045
2122
  });
2046
2123
  return;
2047
2124
  }
2048
- const o = s.modules.find((f) => f.key === a.game), i = o == null ? void 0 : o.events.event;
2125
+ const o = s.modules.find((d) => d.key === a.game), i = o == null ? void 0 : o.events.event;
2049
2126
  if (!i)
2050
2127
  return;
2051
- const c = i(n);
2052
- if (c instanceof L.errors) {
2053
- I.getInstance().warn("Invalid event", "INVALID_EVENT", {
2054
- summary: c.summary
2128
+ const l = i(n);
2129
+ if (l instanceof R.errors) {
2130
+ C.getInstance().warn("Invalid event", "INVALID_EVENT", {
2131
+ summary: l.summary
2055
2132
  });
2056
2133
  return;
2057
2134
  }
2058
- const u = A(o.key, c.type), d = A(o.key, "*"), p = e.get(u), g = e.get(d), h = [...Array.from(p ?? []), ...Array.from(g ?? [])];
2059
- h.length !== 0 && h.forEach((f) => {
2060
- f(c);
2135
+ const h = $(o.key, l.type), g = $(o.key, "*"), f = e.get(h), p = e.get(g), u = [...Array.from(f ?? []), ...Array.from(p ?? [])];
2136
+ u.length !== 0 && u.forEach((d) => {
2137
+ d(l);
2061
2138
  });
2062
2139
  }
2063
2140
  return t.on("data", (n) => n.forEach(r)), t.on("error", (n) => {
2064
- I.getInstance().error("Pipe server error", "PIPE_SERVER_ERROR", {
2141
+ C.getInstance().error("Pipe server error", "PIPE_SERVER_ERROR", {
2065
2142
  error: n
2066
2143
  });
2067
2144
  }), t;
2068
2145
  }
2069
- function Ur(s) {
2070
- const e = new Rr(s), t = {};
2146
+ function Xr(s) {
2147
+ const e = new Gr(s), t = {};
2071
2148
  for (const n in s)
2072
2149
  t[n] = {
2073
2150
  on: (a, o) => {
@@ -2102,23 +2179,23 @@ function Ur(s) {
2102
2179
  e.updateKeybinds(n);
2103
2180
  }
2104
2181
  };
2105
- return e.init(), Ge.on("quit", () => {
2182
+ return e.init(), Ve.on("quit", () => {
2106
2183
  e.destroy();
2107
2184
  }), r;
2108
2185
  }
2109
- function Hr() {
2186
+ function Zr() {
2110
2187
  return {
2111
- createWindow: (s) => m().instance.newWindowInternal(ut.BrowserWindow, s),
2112
- on: (s, e) => m().instance.on(s, e),
2113
- off: (s, e) => m().instance.off(s, e),
2114
- once: (s, e) => m().instance.once(s, e),
2115
- addListener: (s, e) => m().instance.addListener(s, e),
2116
- removeListener: (s, e) => m().instance.removeListener(s, e),
2117
- removeAllListeners: () => m().instance.removeAllListeners(),
2118
- prependListener: (s, e) => m().instance.prependListener(s, e),
2119
- prependOnceListener: (s, e) => m().instance.prependOnceListener(s, e),
2188
+ createWindow: (s) => w().instance.newWindowInternal(yt.BrowserWindow, s),
2189
+ on: (s, e) => w().instance.on(s, e),
2190
+ off: (s, e) => w().instance.off(s, e),
2191
+ once: (s, e) => w().instance.once(s, e),
2192
+ addListener: (s, e) => w().instance.addListener(s, e),
2193
+ removeListener: (s, e) => w().instance.removeListener(s, e),
2194
+ removeAllListeners: () => w().instance.removeAllListeners(),
2195
+ prependListener: (s, e) => w().instance.prependListener(s, e),
2196
+ prependOnceListener: (s, e) => w().instance.prependOnceListener(s, e),
2120
2197
  getActiveGameInfo: () => {
2121
- const s = m(), e = be.getInstance();
2198
+ const s = w(), e = ke.getInstance();
2122
2199
  return {
2123
2200
  resolution: s.resolution,
2124
2201
  isConnected: e.hasConnection
@@ -2126,47 +2203,54 @@ function Hr() {
2126
2203
  }
2127
2204
  };
2128
2205
  }
2129
- function Wr() {
2206
+ function es() {
2130
2207
  return {
2131
- scope: (s) => Tr.getInstance().scope(s),
2208
+ scope: (s) => Ur.getInstance().scope(s),
2132
2209
  raw: {
2133
- setGlobalMouseBlock: (s) => m().instance.setGlobalMouseBlock(s),
2134
- setGlobalKeyboardBlock: (s) => m().instance.setGlobalKeyboardBlock(s),
2135
- setGlobalCursorOverride: (s) => m().instance.setGlobalCursorOverride(s),
2136
- setKeyInputBlock: (s, e) => m().instance.setKeyInputBlock(s, e),
2137
- getGlobalMouseBlock: () => m().instance.getGlobalMouseBlock(),
2138
- getGlobalKeyboardBlock: () => m().instance.getGlobalKeyboardBlock(),
2139
- getGlobalCursorOverride: () => m().instance.getGlobalCursorOverride(),
2140
- getKeyInputBlock: (s) => m().instance.getKeyInputBlock(s)
2210
+ setGlobalMouseBlock: (s) => w().instance.setGlobalMouseBlock(s),
2211
+ setGlobalKeyboardBlock: (s) => w().instance.setGlobalKeyboardBlock(s),
2212
+ setGlobalCursorOverride: (s) => w().instance.setGlobalCursorOverride(s),
2213
+ setKeyInputBlock: (s, e) => w().instance.setKeyInputBlock(s, e),
2214
+ getGlobalMouseBlock: () => w().instance.getGlobalMouseBlock(),
2215
+ getGlobalKeyboardBlock: () => w().instance.getGlobalKeyboardBlock(),
2216
+ getGlobalCursorOverride: () => w().instance.getGlobalCursorOverride(),
2217
+ getKeyInputBlock: (s) => w().instance.getKeyInputBlock(s)
2218
+ }
2219
+ };
2220
+ }
2221
+ function ts() {
2222
+ return {
2223
+ registerWindow: (s) => {
2224
+ Hr.setupRevUtils(s, global.OVERLAYED.electron);
2141
2225
  }
2142
2226
  };
2143
2227
  }
2144
- function Qr(s) {
2145
- P.getInstance().clientId = s.appName, P.getInstance().userId = br.generateUniqueIdentifier(), I.getInstance().on("fatal", (e) => {
2146
- P.getInstance().track("fatal", {
2228
+ function rs(s) {
2229
+ O.getInstance().clientId = s.appName, O.getInstance().userId = lt.generateUniqueIdentifier(), C.getInstance().on("fatal", (e) => {
2230
+ O.getInstance().track("fatal", {
2147
2231
  message: e.message,
2148
2232
  code: e.code,
2149
2233
  data: e.data
2150
2234
  });
2151
- }), I.getInstance().on("error", (e) => {
2152
- P.getInstance().track("error", {
2235
+ }), C.getInstance().on("error", (e) => {
2236
+ O.getInstance().track("error", {
2153
2237
  message: e.message,
2154
2238
  code: e.code,
2155
2239
  data: e.data
2156
2240
  });
2157
- }), I.getInstance().on("warning", (e) => {
2158
- P.getInstance().track("warning", {
2241
+ }), C.getInstance().on("warning", (e) => {
2242
+ O.getInstance().track("warning", {
2159
2243
  message: e.message,
2160
2244
  code: e.code,
2161
2245
  data: e.data
2162
2246
  });
2163
2247
  });
2164
2248
  }
2165
- function m() {
2166
- return x.getInstance().getInterface("OGG_SIEGE");
2249
+ function w() {
2250
+ return B.getInstance().getInterface("OGG_SIEGE");
2167
2251
  }
2168
2252
  export {
2169
- Cs as overlayed,
2170
- vs as setFetchLatestTokenCallback,
2171
- bs as setUpdaterTokenResolver
2253
+ Fs as overlayed,
2254
+ Cs as setFetchLatestTokenCallback,
2255
+ Ss as setUpdaterTokenResolver
2172
2256
  };