@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.d.ts +29 -3
- package/dist/index.js +612 -528
- package/dist/preload.d.ts +1 -0
- package/dist/preload.js +4 -0
- package/package.json +7 -1
package/dist/index.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { type as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import { createRequire as
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import { createHash as
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
var
|
|
14
|
-
function
|
|
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
|
|
30
|
+
class Ee {
|
|
31
31
|
constructor() {
|
|
32
|
-
|
|
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
|
|
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
|
-
},
|
|
62
|
+
}, E(t, "_instance"), t;
|
|
63
63
|
}
|
|
64
|
-
let
|
|
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
|
-
|
|
94
|
-
let
|
|
93
|
+
Ie(wt);
|
|
94
|
+
let Et = class We extends Ee {
|
|
95
95
|
constructor(e, t) {
|
|
96
|
-
super(),
|
|
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
|
|
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
|
-
|
|
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 =
|
|
136
|
-
if (!
|
|
135
|
+
const e = x(this.logPath, this.getFileName(this.currentDate));
|
|
136
|
+
if (!ve(e))
|
|
137
137
|
try {
|
|
138
|
-
|
|
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 =
|
|
148
|
-
return
|
|
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 =
|
|
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
|
-
|
|
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
|
|
188
|
-
let
|
|
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
|
-
|
|
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
|
-
},
|
|
210
|
+
}, St = class {
|
|
211
211
|
constructor() {
|
|
212
|
-
|
|
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 =
|
|
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
|
-
|
|
273
|
-
const
|
|
274
|
-
PipeEventServer:
|
|
275
|
-
PipeEventClient:
|
|
276
|
-
PipeEventBase:
|
|
277
|
-
ProcessMonitor:
|
|
278
|
-
Process:
|
|
279
|
-
InjectionMethod:
|
|
280
|
-
AccessLevel:
|
|
281
|
-
HardwareInterface:
|
|
282
|
-
} =
|
|
283
|
-
let
|
|
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(),
|
|
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
|
|
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
|
|
312
|
-
function
|
|
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
|
|
328
|
+
class _e {
|
|
329
329
|
constructor() {
|
|
330
|
-
|
|
331
|
-
this.emitter =
|
|
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
|
|
346
|
+
class Mt {
|
|
347
347
|
constructor() {
|
|
348
|
-
|
|
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
|
|
365
|
-
return
|
|
366
|
-
} catch (
|
|
367
|
-
console.error(`Error in event listener for ${String(e)}:`,
|
|
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
|
|
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
|
-
},
|
|
392
|
+
}, c(r, "_instance"), r;
|
|
393
393
|
}
|
|
394
|
-
class
|
|
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
|
|
424
|
-
class
|
|
423
|
+
const C = L(Ot);
|
|
424
|
+
class Kt {
|
|
425
425
|
constructor(e) {
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
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
|
-
|
|
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 =
|
|
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 =
|
|
483
|
-
if (r instanceof
|
|
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
|
|
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
|
|
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
|
-
|
|
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
|
|
521
|
+
class Pe extends _e {
|
|
522
522
|
constructor(t, r) {
|
|
523
523
|
super();
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
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
|
|
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
|
-
|
|
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 =
|
|
570
|
-
if (!
|
|
569
|
+
const t = x(this.logPath, this.getFileName(this.currentDate));
|
|
570
|
+
if (!ve(t))
|
|
571
571
|
try {
|
|
572
|
-
|
|
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 =
|
|
582
|
-
return
|
|
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 =
|
|
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
|
-
|
|
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((
|
|
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, (
|
|
617
|
-
|
|
616
|
+
this.stream.write(i, (l) => {
|
|
617
|
+
l ? this.emit("error", l) : this.emit("write", i);
|
|
618
618
|
});
|
|
619
619
|
}
|
|
620
620
|
}
|
|
621
|
-
const
|
|
622
|
-
class
|
|
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
|
-
|
|
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
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
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 =
|
|
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
|
|
712
|
-
function
|
|
711
|
+
const oe = L(Ft);
|
|
712
|
+
function $t(s) {
|
|
713
713
|
return s;
|
|
714
714
|
}
|
|
715
|
-
function
|
|
716
|
-
return
|
|
715
|
+
function xt(s) {
|
|
716
|
+
return $t;
|
|
717
717
|
}
|
|
718
|
-
class
|
|
718
|
+
class Tt extends pt {
|
|
719
719
|
constructor(t, r) {
|
|
720
720
|
super();
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
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(),
|
|
734
|
-
for (let
|
|
735
|
-
|
|
736
|
-
const
|
|
737
|
-
const
|
|
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(
|
|
740
|
-
} catch (
|
|
741
|
-
const D = o.get(
|
|
742
|
-
D < a ? (o.set(
|
|
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
|
-
},
|
|
745
|
-
for (; (
|
|
746
|
-
if (
|
|
747
|
-
await new Promise((
|
|
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
|
|
751
|
-
|
|
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
|
|
755
|
-
|
|
756
|
-
return await Promise.all(
|
|
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
|
|
759
|
+
class Ye {
|
|
760
760
|
constructor(e) {
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
this.logger =
|
|
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
|
|
772
|
+
class le extends _e {
|
|
773
773
|
constructor(t) {
|
|
774
774
|
super();
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
this.logger =
|
|
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
|
|
786
|
+
class Nt extends Mt {
|
|
787
787
|
constructor(t) {
|
|
788
788
|
super();
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
this.logger =
|
|
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
|
|
801
|
-
function
|
|
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[
|
|
813
|
-
let
|
|
812
|
+
if (i != null && i[Re]) {
|
|
813
|
+
let l = () => {
|
|
814
814
|
r(i.reason);
|
|
815
815
|
};
|
|
816
816
|
n.push(() => {
|
|
817
|
-
var
|
|
818
|
-
(
|
|
819
|
-
}), i[
|
|
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
|
|
829
|
-
if (s !==
|
|
830
|
-
if (typeof
|
|
831
|
-
let e =
|
|
832
|
-
return e ===
|
|
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
|
|
834
|
+
return ge.toString.call(s) === `[${N} Object]`;
|
|
835
835
|
}
|
|
836
836
|
return !1;
|
|
837
|
-
},
|
|
838
|
-
if (
|
|
839
|
-
return
|
|
840
|
-
["__proto__", "constructor",
|
|
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
|
|
844
|
-
if (s ===
|
|
845
|
-
let n = [], a = e ? encodeURIComponent : (
|
|
846
|
-
if (
|
|
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 `[${
|
|
851
|
+
return `[${f}]`;
|
|
852
852
|
};
|
|
853
|
-
for (let
|
|
854
|
-
let
|
|
855
|
-
if (
|
|
856
|
-
let
|
|
857
|
-
if (!isNaN(
|
|
858
|
-
let
|
|
859
|
-
|
|
860
|
-
} else n.push(`${a(
|
|
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
|
|
866
|
-
return
|
|
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 ===
|
|
868
|
+
t === F ? delete s[e] : pe(t);
|
|
869
869
|
}), s);
|
|
870
870
|
}
|
|
871
|
-
function
|
|
871
|
+
function Ht(s) {
|
|
872
872
|
return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(s);
|
|
873
873
|
}
|
|
874
|
-
function
|
|
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
|
|
877
|
+
var Wt = "XiorError", qt = "XiorTimeoutError", tt = class extends Error {
|
|
878
878
|
constructor(s, e, t) {
|
|
879
|
-
super(s), this.name =
|
|
879
|
+
super(s), this.name = Wt, this.request = e, this.config = e, this.response = t;
|
|
880
880
|
}
|
|
881
|
-
},
|
|
881
|
+
}, Qt = class extends tt {
|
|
882
882
|
constructor(e, t, r) {
|
|
883
|
-
super(e, t, r), this.name =
|
|
883
|
+
super(e, t, r), this.name = qt;
|
|
884
884
|
}
|
|
885
|
-
},
|
|
886
|
-
for (var t in e || (e = {}))
|
|
887
|
-
if (
|
|
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
|
-
},
|
|
889
|
+
}, Z = (s, e) => Jt(s, Xt(e)), Zt = (s, e) => {
|
|
890
890
|
var t = {};
|
|
891
|
-
for (var r in s)
|
|
892
|
-
if (s != null &&
|
|
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
|
-
},
|
|
895
|
-
var a = (
|
|
894
|
+
}, z = (s, e, t) => new Promise((r, n) => {
|
|
895
|
+
var a = (l) => {
|
|
896
896
|
try {
|
|
897
|
-
i(t.next(
|
|
898
|
-
} catch (
|
|
899
|
-
n(
|
|
897
|
+
i(t.next(l));
|
|
898
|
+
} catch (h) {
|
|
899
|
+
n(h);
|
|
900
900
|
}
|
|
901
|
-
}, o = (
|
|
901
|
+
}, o = (l) => {
|
|
902
902
|
try {
|
|
903
|
-
i(t.throw(
|
|
904
|
-
} catch (
|
|
905
|
-
n(
|
|
903
|
+
i(t.throw(l));
|
|
904
|
+
} catch (h) {
|
|
905
|
+
n(h);
|
|
906
906
|
}
|
|
907
|
-
}, i = (
|
|
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
|
-
}),
|
|
910
|
-
function
|
|
911
|
-
return [
|
|
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
|
|
914
|
-
function
|
|
915
|
-
return
|
|
916
|
-
let e = s[
|
|
917
|
-
if (i && typeof i.append !==
|
|
918
|
-
let
|
|
919
|
-
if (s != null && s[
|
|
920
|
-
let
|
|
921
|
-
|
|
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
|
-
(!
|
|
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 (
|
|
926
|
-
let
|
|
927
|
-
n += n.includes("?") ? `&${
|
|
925
|
+
if (g && se(g).length > 0) {
|
|
926
|
+
let p = e(g, t);
|
|
927
|
+
n += n.includes("?") ? `&${p}` : `?${p}`;
|
|
928
928
|
}
|
|
929
|
-
return
|
|
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
|
|
933
|
-
function
|
|
934
|
-
return
|
|
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 || [
|
|
937
|
-
if (t = yield s[
|
|
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
|
|
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
|
|
972
|
-
let t =
|
|
973
|
-
t.withCredentials && !t[r] && (t[r] = "include"), t[
|
|
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(
|
|
983
|
-
i.push(
|
|
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
|
|
991
|
-
let t = yield
|
|
992
|
-
e._url =
|
|
993
|
-
let
|
|
994
|
-
if (o &&
|
|
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
|
-
|
|
997
|
-
v.abort(new
|
|
998
|
-
}, o),
|
|
996
|
+
k = setTimeout(() => {
|
|
997
|
+
v.abort(new Qt(`timeout of ${o}ms exceeded`, e));
|
|
998
|
+
}, o), b.push(v.signal);
|
|
999
999
|
}
|
|
1000
|
-
i &&
|
|
1001
|
-
clearTimeout(
|
|
1000
|
+
i && b.push(i), d = b[0], b.length > 1 && (d = zt(b, () => {
|
|
1001
|
+
clearTimeout(k);
|
|
1002
1002
|
}));
|
|
1003
|
-
let
|
|
1004
|
-
return e[D] && !
|
|
1005
|
-
let { responseType:
|
|
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
|
|
1008
|
-
return Promise.reject(
|
|
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
|
|
1010
|
+
return y;
|
|
1011
1011
|
})).finally(() => {
|
|
1012
1012
|
var v;
|
|
1013
|
-
|
|
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 ?
|
|
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 ?
|
|
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(
|
|
1024
|
+
return this.cG(fe)(e, t);
|
|
1025
1025
|
}
|
|
1026
1026
|
head(e, t) {
|
|
1027
|
-
return this.cG(
|
|
1027
|
+
return this.cG(Ze)(e, t);
|
|
1028
1028
|
}
|
|
1029
1029
|
post(e, t, r) {
|
|
1030
|
-
return this.cP(
|
|
1030
|
+
return this.cP(Bt)(e, t, r);
|
|
1031
1031
|
}
|
|
1032
1032
|
put(e, t, r) {
|
|
1033
|
-
return this.cP(
|
|
1033
|
+
return this.cP(Gt)(e, t, r);
|
|
1034
1034
|
}
|
|
1035
1035
|
patch(e, t, r) {
|
|
1036
|
-
return this.cP(
|
|
1036
|
+
return this.cP(jt)(e, t, r);
|
|
1037
1037
|
}
|
|
1038
1038
|
delete(e, t) {
|
|
1039
|
-
return this.cG(
|
|
1039
|
+
return this.cG(Ut)(e, t);
|
|
1040
1040
|
}
|
|
1041
1041
|
options(e, t) {
|
|
1042
|
-
return this.cG(
|
|
1042
|
+
return this.cG(et)(e, t);
|
|
1043
1043
|
}
|
|
1044
1044
|
};
|
|
1045
|
-
|
|
1046
|
-
var
|
|
1047
|
-
const
|
|
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
|
|
1055
|
-
function
|
|
1056
|
-
|
|
1054
|
+
let ye;
|
|
1055
|
+
function Ss(s) {
|
|
1056
|
+
ye = s;
|
|
1057
1057
|
}
|
|
1058
|
-
const
|
|
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
|
-
|
|
1066
|
-
const e =
|
|
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
|
|
1070
|
-
return
|
|
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
|
|
1076
|
-
return
|
|
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
|
|
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
|
|
1085
|
-
return
|
|
1087
|
+
function gr() {
|
|
1088
|
+
return V.get("/v1/public/raven/config");
|
|
1086
1089
|
}
|
|
1087
|
-
const
|
|
1088
|
-
function
|
|
1089
|
-
return
|
|
1090
|
+
const fr = xt();
|
|
1091
|
+
function pr(s, e) {
|
|
1092
|
+
return V.get(`/v1/public/raven/games/${s}/builds/${e}`);
|
|
1090
1093
|
}
|
|
1091
|
-
function
|
|
1092
|
-
return
|
|
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
|
|
1099
|
+
function mr(s, e) {
|
|
1097
1100
|
const t = new FormData();
|
|
1098
|
-
return t.append("file", e.chunk),
|
|
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
|
|
1105
|
+
function br(s) {
|
|
1103
1106
|
return s instanceof Error && (s.name === "XiorError" || s.name === "XiorTimeoutError");
|
|
1104
1107
|
}
|
|
1105
|
-
function
|
|
1108
|
+
function vr(s) {
|
|
1106
1109
|
return !!(s && "kind" in s.data && "message" in s.data);
|
|
1107
1110
|
}
|
|
1108
|
-
let
|
|
1109
|
-
function
|
|
1110
|
-
|
|
1111
|
+
let ee;
|
|
1112
|
+
function Cs(s) {
|
|
1113
|
+
ee = s;
|
|
1111
1114
|
}
|
|
1112
|
-
class
|
|
1115
|
+
class wr extends le {
|
|
1113
1116
|
constructor() {
|
|
1114
1117
|
super("NativeModuleManager");
|
|
1115
|
-
|
|
1118
|
+
c(this, "UPDATE_CHECK_INTERVAL_MS", 1e3 * 60 * 5);
|
|
1116
1119
|
// 5 minutes
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
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
|
|
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 =
|
|
1130
|
-
return await
|
|
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
|
|
1139
|
+
return m.join(this.targetDir, t);
|
|
1137
1140
|
}
|
|
1138
1141
|
getTargetVersionPath(t, r) {
|
|
1139
|
-
return
|
|
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 (
|
|
1150
|
+
await (ee == null ? void 0 : ee());
|
|
1148
1151
|
for (const n of t)
|
|
1149
1152
|
try {
|
|
1150
|
-
const { data: a } = await
|
|
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
|
|
1160
|
-
await
|
|
1161
|
-
const
|
|
1162
|
-
await
|
|
1163
|
-
const
|
|
1164
|
-
const
|
|
1165
|
-
if (
|
|
1166
|
-
const
|
|
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
|
|
1172
|
+
await S.access(d, S.constants.F_OK);
|
|
1170
1173
|
return;
|
|
1171
1174
|
} catch {
|
|
1172
|
-
this.logger.warn(`${t} > File missing, re-downloading: ${
|
|
1175
|
+
this.logger.warn(`${t} > File missing, re-downloading: ${d}`);
|
|
1173
1176
|
}
|
|
1174
|
-
const
|
|
1175
|
-
await
|
|
1177
|
+
const b = await u.async("nodebuffer");
|
|
1178
|
+
await S.writeFile(d, b);
|
|
1176
1179
|
}
|
|
1177
1180
|
});
|
|
1178
|
-
await Promise.all(
|
|
1179
|
-
const
|
|
1180
|
-
this.logger.log("Saving version file",
|
|
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 =
|
|
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
|
|
1188
|
+
o.isDirectory() && o.name !== r && await S.rm(m.join(n, o.name), { recursive: !0, force: !0 });
|
|
1186
1189
|
}
|
|
1187
1190
|
}
|
|
1188
|
-
const
|
|
1189
|
-
class
|
|
1191
|
+
const ie = L(wr);
|
|
1192
|
+
class Er extends le {
|
|
1190
1193
|
constructor() {
|
|
1191
1194
|
super("RavenManager");
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
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),
|
|
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
|
|
1224
|
+
...(await gr()).data.games,
|
|
1222
1225
|
{
|
|
1223
1226
|
name: "Valorant",
|
|
1224
|
-
identifier:
|
|
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
|
|
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
|
|
1249
|
-
PipeEventServer:
|
|
1250
|
-
PipeEventClient:
|
|
1251
|
-
PipeEventBase:
|
|
1252
|
-
ProcessMonitor:
|
|
1253
|
-
Process:
|
|
1254
|
-
InjectionMethod:
|
|
1255
|
-
AccessLevel:
|
|
1256
|
-
HardwareInterface:
|
|
1257
|
-
} =
|
|
1258
|
-
class
|
|
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
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
this._processMonitor = new
|
|
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(),
|
|
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
|
-
|
|
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
|
|
1309
|
-
var
|
|
1310
|
-
let
|
|
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
|
-
|
|
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
|
|
1330
|
+
class Ar {
|
|
1328
1331
|
constructor() {
|
|
1329
|
-
|
|
1332
|
+
te(this, "interfaces", {});
|
|
1330
1333
|
}
|
|
1331
1334
|
createInterface(e) {
|
|
1332
|
-
return this.interfaces[e] ? this.interfaces[e] : (this.interfaces[e] = new
|
|
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
|
|
1339
|
-
var
|
|
1340
|
-
class
|
|
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
|
-
|
|
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
|
|
1368
|
-
class
|
|
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
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
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(),
|
|
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
|
-
|
|
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: ",
|
|
1398
|
-
|
|
1399
|
-
appElevated: !!
|
|
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:
|
|
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
|
|
1418
|
-
if (!
|
|
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
|
|
1421
|
-
this.logger.log("DLL Path",
|
|
1422
|
-
const
|
|
1423
|
-
return this.logger.log("DLL Files",
|
|
1424
|
-
|
|
1425
|
-
const
|
|
1426
|
-
if (!
|
|
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: ",
|
|
1431
|
+
this.logger.log("Injecting: ", u);
|
|
1429
1432
|
try {
|
|
1430
|
-
return t.injectDll(
|
|
1431
|
-
this.logger.log("Injection Successful",
|
|
1432
|
-
}).catch((
|
|
1433
|
-
this.logger.sentryError("Injection Failed [1]", { targetPath:
|
|
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 (
|
|
1436
|
-
return this.logger.sentryError("Injection Failed [2]", { targetPath:
|
|
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 }),
|
|
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 =
|
|
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
|
-
|
|
1450
|
-
const i =
|
|
1451
|
-
|
|
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
|
|
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 }),
|
|
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 =
|
|
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
|
|
1482
|
-
class
|
|
1484
|
+
const G = L($r);
|
|
1485
|
+
class xr extends Ye {
|
|
1483
1486
|
constructor() {
|
|
1484
1487
|
super("GameBuildManager");
|
|
1485
|
-
|
|
1488
|
+
c(this, "boundOnGameLaunch", this.onGameLaunch.bind(this));
|
|
1486
1489
|
}
|
|
1487
1490
|
init() {
|
|
1488
|
-
super.init(),
|
|
1491
|
+
super.init(), G.getInstance().on("gameReadyInternal", this.boundOnGameLaunch);
|
|
1489
1492
|
}
|
|
1490
1493
|
destroy() {
|
|
1491
|
-
|
|
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 =
|
|
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
|
|
1508
|
-
} catch (
|
|
1509
|
-
this.logger.captureSentryException("Error checking game build hash",
|
|
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
|
|
1517
|
-
|
|
1518
|
-
const
|
|
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: ",
|
|
1521
|
-
const
|
|
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
|
-
}),
|
|
1527
|
+
}), f = await yr(r.identifier, {
|
|
1525
1528
|
build_hash: o,
|
|
1526
|
-
chunk_count:
|
|
1527
|
-
file_size_bytes:
|
|
1529
|
+
chunk_count: g.totalChunks,
|
|
1530
|
+
file_size_bytes: h.size
|
|
1528
1531
|
});
|
|
1529
|
-
await
|
|
1530
|
-
this.logger.log("Uploading chunk",
|
|
1531
|
-
chunk:
|
|
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:
|
|
1534
|
-
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 (
|
|
1538
|
-
|
|
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
|
|
1543
|
-
function
|
|
1544
|
-
return
|
|
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
|
|
1549
|
+
const Nr = R({
|
|
1547
1550
|
game: "string",
|
|
1548
1551
|
type: "string",
|
|
1549
1552
|
creation_time: "number"
|
|
1550
|
-
}),
|
|
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
|
-
]),
|
|
1746
|
+
]), Ne = new Map(me.entries().map(([s, e]) => [e, s])), Br = R({
|
|
1744
1747
|
"[string]": {
|
|
1745
1748
|
keys: "string[]",
|
|
1746
|
-
mode:
|
|
1749
|
+
mode: R("'toggle' | 'hold'").pipe((s) => s ?? "toggle")
|
|
1747
1750
|
}
|
|
1748
1751
|
});
|
|
1749
|
-
class
|
|
1752
|
+
class Gr extends le {
|
|
1750
1753
|
constructor(t) {
|
|
1751
1754
|
super("KeybindManager");
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
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
|
-
|
|
1762
|
-
this.keybindsFile = new
|
|
1763
|
-
path:
|
|
1764
|
-
schema:
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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) =>
|
|
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) =>
|
|
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
|
|
1875
|
+
class jr extends Ye {
|
|
1873
1876
|
constructor(t) {
|
|
1874
1877
|
super("OverridesManager");
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
this.renderInterface =
|
|
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
|
|
1904
|
-
|
|
1905
|
-
function
|
|
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 (
|
|
1908
|
-
return
|
|
1979
|
+
if (Vr(s), oe.getInstance().init(s.appName), J)
|
|
1980
|
+
return X;
|
|
1909
1981
|
function t() {
|
|
1910
|
-
|
|
1911
|
-
const r = /* @__PURE__ */ new Map(), n =
|
|
1912
|
-
|
|
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:
|
|
1918
|
-
hasAnyActiveProcesses: () =>
|
|
1990
|
+
input: l,
|
|
1991
|
+
hasAnyActiveProcesses: () => K.getInstance().hasAnyActiveProcesses,
|
|
1919
1992
|
init: t,
|
|
1920
|
-
initialized:
|
|
1993
|
+
initialized: J
|
|
1921
1994
|
};
|
|
1922
1995
|
}
|
|
1923
|
-
return e ? (t(),
|
|
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" && !
|
|
2002
|
+
if (n !== "init" && !J)
|
|
1930
2003
|
throw new Error(`overlayed was called before initialized: ${n}`);
|
|
1931
|
-
return n === "init" ? r[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
|
|
2014
|
+
function Vr(s) {
|
|
1942
2015
|
global.OVERLAYED = {
|
|
1943
|
-
|
|
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
|
|
2021
|
+
function Wr(s) {
|
|
1948
2022
|
const e = s.universal ? ["*"] : s.modules.map((t) => t.key);
|
|
1949
|
-
|
|
1950
|
-
|
|
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
|
|
1954
|
-
|
|
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
|
|
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 =
|
|
1963
|
-
|
|
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 =
|
|
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 =
|
|
1972
|
-
|
|
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 =
|
|
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
|
|
1983
|
-
const s =
|
|
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
|
|
2112
|
+
function $(s, e) {
|
|
2036
2113
|
return `${s}:${e}`;
|
|
2037
2114
|
}
|
|
2038
|
-
function
|
|
2039
|
-
const t =
|
|
2115
|
+
function Jr(s, e) {
|
|
2116
|
+
const t = ke.getInstance();
|
|
2040
2117
|
function r(n) {
|
|
2041
|
-
const a =
|
|
2042
|
-
if (a instanceof
|
|
2043
|
-
|
|
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((
|
|
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
|
|
2052
|
-
if (
|
|
2053
|
-
|
|
2054
|
-
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
|
|
2059
|
-
|
|
2060
|
-
|
|
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
|
-
|
|
2141
|
+
C.getInstance().error("Pipe server error", "PIPE_SERVER_ERROR", {
|
|
2065
2142
|
error: n
|
|
2066
2143
|
});
|
|
2067
2144
|
}), t;
|
|
2068
2145
|
}
|
|
2069
|
-
function
|
|
2070
|
-
const e = new
|
|
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(),
|
|
2182
|
+
return e.init(), Ve.on("quit", () => {
|
|
2106
2183
|
e.destroy();
|
|
2107
2184
|
}), r;
|
|
2108
2185
|
}
|
|
2109
|
-
function
|
|
2186
|
+
function Zr() {
|
|
2110
2187
|
return {
|
|
2111
|
-
createWindow: (s) =>
|
|
2112
|
-
on: (s, e) =>
|
|
2113
|
-
off: (s, e) =>
|
|
2114
|
-
once: (s, e) =>
|
|
2115
|
-
addListener: (s, e) =>
|
|
2116
|
-
removeListener: (s, e) =>
|
|
2117
|
-
removeAllListeners: () =>
|
|
2118
|
-
prependListener: (s, e) =>
|
|
2119
|
-
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 =
|
|
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
|
|
2206
|
+
function es() {
|
|
2130
2207
|
return {
|
|
2131
|
-
scope: (s) =>
|
|
2208
|
+
scope: (s) => Ur.getInstance().scope(s),
|
|
2132
2209
|
raw: {
|
|
2133
|
-
setGlobalMouseBlock: (s) =>
|
|
2134
|
-
setGlobalKeyboardBlock: (s) =>
|
|
2135
|
-
setGlobalCursorOverride: (s) =>
|
|
2136
|
-
setKeyInputBlock: (s, e) =>
|
|
2137
|
-
getGlobalMouseBlock: () =>
|
|
2138
|
-
getGlobalKeyboardBlock: () =>
|
|
2139
|
-
getGlobalCursorOverride: () =>
|
|
2140
|
-
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
|
|
2145
|
-
|
|
2146
|
-
|
|
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
|
-
}),
|
|
2152
|
-
|
|
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
|
-
}),
|
|
2158
|
-
|
|
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
|
|
2166
|
-
return
|
|
2249
|
+
function w() {
|
|
2250
|
+
return B.getInstance().getInterface("OGG_SIEGE");
|
|
2167
2251
|
}
|
|
2168
2252
|
export {
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
|
|
2253
|
+
Fs as overlayed,
|
|
2254
|
+
Cs as setFetchLatestTokenCallback,
|
|
2255
|
+
Ss as setUpdaterTokenResolver
|
|
2172
2256
|
};
|