@overlayed/app 0.25.2 → 0.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +2 -2
- package/dist/siege.d.ts +0 -11
- package/dist/siege.js +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import{createRequire as e}from"node:module";import{Type as t,type as n}from"arktype";import r from"mitt";import i,{createWriteStream as a,existsSync as o,mkdirSync as s,readdirSync as c,unlinkSync as l,writeFileSync as u}from"fs";import{ensureFileSync as d}from"fs-extra";import{join as f}from"path";import p,{basename as m,resolve as ee}from"node:path";import h from"node:process";import te from"node:os";import ne from"node:tty";import re from"events";import{copyFileSync as ie,createReadStream as ae,existsSync as oe,mkdirSync as se,readFileSync as ce,readdirSync as le,writeFileSync as ue}from"node:fs";import"glob";import"jiti";import de from"xior";import g from"fs/promises";import _ from"jszip";import{createHash as fe}from"node:crypto";import{app as pe}from"electron";var me=Object.create,he=Object.defineProperty,ge=Object.getOwnPropertyDescriptor,_e=Object.getOwnPropertyNames,ve=Object.getPrototypeOf,ye=Object.prototype.hasOwnProperty,be=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),xe=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=_e(t),a=0,o=i.length,s;a<o;a++)s=i[a],!ye.call(e,s)&&s!==n&&he(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=ge(t,s))||r.enumerable});return e},Se=(e,t,n)=>(n=e==null?{}:me(ve(e)),xe(t||!e||!e.__esModule?he(n,`default`,{value:e,enumerable:!0}):n,e));function v(e){return e?Array.isArray(e)?e:[e]:[]}var Ce=class{data=[];constructor(){}get size(){return this.data.length}add(e){this.data.push(e)}next(){return this.data.shift()}clear(){this.data.length=0}*flush(){for(;this.size>0;){let e=this.next();e&&(yield e)}}};const we=(e=0)=>t=>`\u001B[${t+e}m`,Te=(e=0)=>t=>`\u001B[${38+e};5;${t}m`,Ee=(e=0)=>(t,n,r)=>`\u001B[${38+e};2;${t};${n};${r}m`,y={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};Object.keys(y.modifier);const De=Object.keys(y.color),Oe=Object.keys(y.bgColor);[...De,...Oe];function ke(){let e=new Map;for(let[t,n]of Object.entries(y)){for(let[t,r]of Object.entries(n))y[t]={open:`\u001B[${r[0]}m`,close:`\u001B[${r[1]}m`},n[t]=y[t],e.set(r[0],r[1]);Object.defineProperty(y,t,{value:n,enumerable:!1})}return Object.defineProperty(y,`codes`,{value:e,enumerable:!1}),y.color.close=`\x1B[39m`,y.bgColor.close=`\x1B[49m`,y.color.ansi=we(),y.color.ansi256=Te(),y.color.ansi16m=Ee(),y.bgColor.ansi=we(10),y.bgColor.ansi256=Te(10),y.bgColor.ansi16m=Ee(10),Object.defineProperties(y,{rgbToAnsi256:{value(e,t,n){return e===t&&t===n?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(t/255*5)+Math.round(n/255*5)},enumerable:!1},hexToRgb:{value(e){let t=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!t)return[0,0,0];let[n]=t;n.length===3&&(n=[...n].map(e=>e+e).join(``));let r=Number.parseInt(n,16);return[r>>16&255,r>>8&255,r&255]},enumerable:!1},hexToAnsi256:{value:e=>y.rgbToAnsi256(...y.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value(e){if(e<8)return 30+e;if(e<16)return 90+(e-8);let t,n,r;if(e>=232)t=((e-232)*10+8)/255,n=t,r=t;else{e-=16;let i=e%36;t=Math.floor(e/36)/5,n=Math.floor(i/6)/5,r=i%6/5}let i=Math.max(t,n,r)*2;if(i===0)return 30;let a=30+(Math.round(r)<<2|Math.round(n)<<1|Math.round(t));return i===2&&(a+=60),a},enumerable:!1},rgbToAnsi:{value:(e,t,n)=>y.ansi256ToAnsi(y.rgbToAnsi256(e,t,n)),enumerable:!1},hexToAnsi:{value:e=>y.ansi256ToAnsi(y.hexToAnsi256(e)),enumerable:!1}}),y}var b=ke();function x(e,t=globalThis.Deno?globalThis.Deno.args:h.argv){let n=e.startsWith(`-`)?``:e.length===1?`-`:`--`,r=t.indexOf(n+e),i=t.indexOf(`--`);return r!==-1&&(i===-1||r<i)}const{env:S}=h;let C;x(`no-color`)||x(`no-colors`)||x(`color=false`)||x(`color=never`)?C=0:(x(`color`)||x(`colors`)||x(`color=true`)||x(`color=always`))&&(C=1);function Ae(){if(`FORCE_COLOR`in S)return S.FORCE_COLOR===`true`?1:S.FORCE_COLOR===`false`?0:S.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(S.FORCE_COLOR,10),3)}function je(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function Me(e,{streamIsTTY:t,sniffFlags:n=!0}={}){let r=Ae();r!==void 0&&(C=r);let i=n?C:r;if(i===0)return 0;if(n){if(x(`color=16m`)||x(`color=full`)||x(`color=truecolor`))return 3;if(x(`color=256`))return 2}if(`TF_BUILD`in S&&`AGENT_NAME`in S)return 1;if(e&&!t&&i===void 0)return 0;let a=i||0;if(S.TERM===`dumb`)return a;if(h.platform===`win32`){let e=te.release().split(`.`);return Number(e[0])>=10&&Number(e[2])>=10586?Number(e[2])>=14931?3:2:1}if(`CI`in S)return[`GITHUB_ACTIONS`,`GITEA_ACTIONS`,`CIRCLECI`].some(e=>e in S)?3:[`TRAVIS`,`APPVEYOR`,`GITLAB_CI`,`BUILDKITE`,`DRONE`].some(e=>e in S)||S.CI_NAME===`codeship`?1:a;if(`TEAMCITY_VERSION`in S)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(S.TEAMCITY_VERSION)?1:0;if(S.COLORTERM===`truecolor`||S.TERM===`xterm-kitty`||S.TERM===`xterm-ghostty`||S.TERM===`wezterm`)return 3;if(`TERM_PROGRAM`in S){let e=Number.parseInt((S.TERM_PROGRAM_VERSION||``).split(`.`)[0],10);switch(S.TERM_PROGRAM){case`iTerm.app`:return e>=3?3:2;case`Apple_Terminal`:return 2}}return/-256(color)?$/i.test(S.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(S.TERM)||`COLORTERM`in S?1:a}function Ne(e,t={}){return je(Me(e,{streamIsTTY:e&&e.isTTY,...t}))}var Pe={stdout:Ne({isTTY:ne.isatty(1)}),stderr:Ne({isTTY:ne.isatty(2)})};function Fe(e,t,n){let r=e.indexOf(t);if(r===-1)return e;let i=t.length,a=0,o=``;do o+=e.slice(a,r)+t+n,a=r+i,r=e.indexOf(t,a);while(r!==-1);return o+=e.slice(a),o}function Ie(e,t,n,r){let i=0,a=``;do{let o=e[r-1]===`\r`;a+=e.slice(i,o?r-1:r)+t+(o?`\r
|
|
2
2
|
`:`
|
|
3
3
|
`)+n,i=r+1,r=e.indexOf(`
|
|
4
|
-
`,i)}while(r!==-1);return a+=e.slice(i),a}const{stdout:Le,stderr:Re}=Pe,w=Symbol(`GENERATOR`),T=Symbol(`STYLER`),E=Symbol(`IS_EMPTY`),ze=[`ansi`,`ansi`,`ansi256`,`ansi16m`],D=Object.create(null),Be=(e,t={})=>{if(t.level&&!(Number.isInteger(t.level)&&t.level>=0&&t.level<=3))throw Error("The `level` option should be an integer from 0 to 3");let n=Le?Le.level:0;e.level=t.level===void 0?n:t.level},Ve=e=>{let t=(...e)=>e.join(` `);return Be(t,e),Object.setPrototypeOf(t,O.prototype),t};function O(e){return Ve(e)}Object.setPrototypeOf(O.prototype,Function.prototype);for(let[e,t]of Object.entries(b))D[e]={get(){let n=
|
|
5
|
-
`);return a!==-1&&(t=Ie(t,i,r,a)),r+t+i};Object.defineProperties(O.prototype,D);const Ge=O();O({level:Re?Re.level:0});var j=Ge,M=class{emitter;constructor(){this.emitter=r()}on(e,t){v(e).forEach(e=>{this.emitter.on(e,t)})}off(e,t){v(e).forEach(e=>{this.emitter.off(e,t)})}emit(e,t){v(e).forEach(e=>{this.emitter.emit(e,t)})}removeAllListeners(){this.emitter.all.clear()}},Ke=class{listeners;constructor(){this.listeners=new Map}on(e,t){v(e).forEach(e=>{let n=this.listeners.get(e)||new Set;n.add(t),this.listeners.set(e,n)})}off(e,t){v(e).forEach(e=>{let n=this.listeners.get(e);n&&n.delete(t)})}async emit(e,...t){let n=v(e).flatMap(e=>{let t=this.listeners.get(e)||new Set,n=this.listeners.get(`*`)||new Set;return[...Array.from(t),...Array.from(n)]});return n.length===0?[]:await Promise.all(n.map(async n=>{try{let e=n(...t);return e instanceof Promise?await e:e}catch(t){console.error(`Error in event listener for ${String(e)}:`,t);return}}))}removeAllListeners(){this.listeners.clear()}};function N(e,...t){return class extends e{static _instance;static getInstance(){return this._instance||=new e(...t),this._instance}static clearInstance(){this._instance=void 0}}}const P=N(class extends M{destroy(){this.removeAllListeners()}fatal(e,t,n){this.emit(`fatal`,{code:t,message:e,data:n,timestamp:Date.now()})}error(e,t,n){this.emit(`error`,{code:t,message:e,data:n,timestamp:Date.now()})}warn(e,t,n){this.emit(`warning`,{code:t,message:e,data:n,timestamp:Date.now()})}});var qe=class{data;_schema;_defaultValue;_path;constructor(e){let{schema:t,default:n,path:r}=e;this._schema=t,this._defaultValue=n,this._path=r}set(e){let t=this._schema[`~standard`].validate(e);if(t instanceof Promise)throw Error(`StructuredConfigFile does not support async validation`);if(t.issues){this.reportInvalidConfigFile(t.issues);return}this.data=this.onBeforeSave(e),this.save(e)}get(){return this.data?this.data:this.load()}getKey(e){return this.get()[e]}save(e){let t=this.onBeforeSave(e);try{d(this.getFilePath()),i.writeFileSync(this.getFilePath(),JSON.stringify(t,void 0,2))}catch{return}return this.data=t}load(){if(!this.fileExists(this.getFilePath())||!this.canReadWriteFile(this.getFilePath())){this.save(this._defaultValue);let e=this.onAfterLoad(this._defaultValue);return this.data=e,e}try{let e=i.readFileSync(this.getFilePath(),`utf8`),t=this.onAfterLoad(this.parseStoredData(e));return this.data=t,t}catch{return this.data=this._defaultValue}}onBeforeSave(e){return e}onAfterLoad(e){return e}getFilePath(){return this._path}parseStoredData(e){try{let t=n(`string.json.parse`).to(`object`)(e);if(t instanceof n.errors)return this._defaultValue;let r=this._schema[`~standard`].validate(t);if(r instanceof Promise)throw Error(`StructuredConfigFile does not support async validation`);return r.issues?this.migrate(t,this._defaultValue):this.migrate(r.value,this._defaultValue)}catch{return this._defaultValue}}canReadWriteFile(e){try{return i.accessSync(e,i.constants.R_OK|i.constants.W_OK),!0}catch{return!1}}fileExists(e){try{return i.accessSync(e,i.constants.F_OK),!0}catch{return!1}}migrate(e,t){let n={...e};for(let r in t)Object.prototype.hasOwnProperty.call(t,r)&&(r in e?e[r]!==null&&t[r]!==null&&typeof e[r]==`object`&&typeof t[r]==`object`&&!Array.isArray(e[r])&&!Array.isArray(t[r])?n[r]=this.migrate(e[r],t[r]):Array.isArray(t[r])&&(n[r]=e[r]):n[r]=t[r]);return n}reportInvalidConfigFile(e){P.getInstance().error(`Invalid config file`,`INVALID_CONFIG_FILE`,{issues:e.map(e=>e.message),filePath:this._path,data:this.data})}};function Je(e,t,n){return typeof e!=`object`||!e?String(e):e instanceof Error?JSON.stringify(e,Object.getOwnPropertyNames(e),n):e instanceof Map?JSON.stringify(Object.fromEntries(e.entries()),t,n):e instanceof Set?JSON.stringify(Array.from(e),t,n):JSON.stringify(e,t,n)}var Ye=class e extends M{stream;logPath;baseFileName;currentDate;rotationCheckInterval;isRotating=!1;constructor(e,t){super(),this.logPath=e,this.baseFileName=t.replace(`.log`,``),this.currentDate=this.getDateString(new Date),this.ensureLogDirectory(),this.ensureLogFile(),this.stream=this.createStream(),this.rotationCheckInterval=this.startRotationCheck(),this.cleanupOldLogs()}static scope(t,n){return new e(t,n)}log(...e){this.write(`log`,...e)}error(...e){this.write(`error`,...e)}warn(...e){this.write(`warn`,...e)}info(...e){this.write(`info`,...e)}debug(...e){this.write(`debug`,...e)}async close(){clearInterval(this.rotationCheckInterval),await new Promise(e=>{this.stream.end(()=>e())})}getCurrentFileName(){return this.getFileName(this.currentDate)}static getMessageElements(e,...t){let n=new Date;return{timestamp:n.toISOString().replace(`T`,` `).replace(/\.\d+Z$/,``)+`.${n.getMilliseconds().toString().padStart(3,`0`)}`,level:e,message:t.map(e=>Je(e)).join(` `)}}getFileName(e){return`${this.baseFileName}-${e}.log`}ensureLogDirectory(){try{s(this.logPath,{recursive:!0})}catch(e){throw console.error(`Failed to create log directory ${this.logPath}:`,e),e}}ensureLogFile(){let e=f(this.logPath,this.getFileName(this.currentDate));if(!o(e))try{u(e,``,`utf8`)}catch(t){throw console.error(`Failed to create log file ${e}:`,t),t}}getDateString(e){return e.toISOString().split(`T`)[0]}createStream(){return a(f(this.logPath,this.getFileName(this.currentDate)),{flags:`a`,encoding:`utf8`})}async rotateLogs(){if(this.isRotating)return;this.isRotating=!0;let e=this.getDateString(new Date);e!==this.currentDate&&await new Promise(t=>{this.stream.end(()=>{this.currentDate=e,this.stream=this.createStream(),this.cleanupOldLogs(),t()})}),this.isRotating=!1}startRotationCheck(){return setInterval(()=>this.rotateLogs(),6e4)}cleanupOldLogs(){let e=c(this.logPath),t=new Date;t.setDate(t.getDate()-7),e.filter(e=>e.startsWith(this.baseFileName)&&e.endsWith(`.log`)).filter(e=>{let n=e.replace(`${this.baseFileName}-`,``).replace(`.log`,``);return new Date(n)<t}).forEach(e=>{try{l(f(this.logPath,e))}catch(t){console.error(`Failed to delete old log file ${e}:`,t)}})}write(t,...n){let{timestamp:r,message:i}=e.getMessageElements(t,...n),a=`[${r}] [${t}] ${i}\n`;this.stream.write(a,e=>{e?this.emit(`error`,e):this.emit(`write`,a)})}};const F=()=>p.join(process.env.APPDATA??``,`overlayed`),Xe=()=>p.join(F(),`logs`),Ze=e=>p.join(F(),`apps`,e),Qe=e=>p.join(Ze(e),`logs`),$e=()=>p.join(F(),`meta.json`);var et=class{fileLogger;path;appId;messageQueue=new Ce;fileName;_debug=!1;silent=!1;constructor(e){this.fileName=e}init(e,t=!1,n=!1){this.appId=e,this._debug=t,this.silent=n,this.path=Qe(e),this.fileLogger=new Ye(this.path,this.fileName),this.messageQueue.flush().forEach(e=>{this.fileLogger?.[e.type](...e.args)})}scope(e){if(!this.appId||!this.path)throw Error(`Logger not initialized`);let t=`[${e}]`;return{scope:e=>this.scope(e),error:(...e)=>this.error(t,...e),warn:(...e)=>this.warn(t,...e),info:(...e)=>this.info(t,...e),log:(...e)=>this.log(t,...e),debug:(...e)=>this.debug(t,...e)}}error(...e){this.handle(`error`,...e)}warn(...e){this.handle(`warn`,...e)}info(...e){this.handle(`log`,...e)}debug(...e){this._debug&&this.handle(`debug`,...e)}log(...e){this.handle(`log`,...e)}handle(e,...t){this.logToConsole(e,...t),this.fileLogger?this.fileLogger[e](...t):this.messageQueue.add({type:e,args:t})}logToConsole(e,...t){let n={error:j.red,warn:j.yellow,debug:j.blue,log:j.white};if(this.silent&&!this._debug)return;let{timestamp:r,message:i}=Ye.getMessageElements(e,...t),a=console[e],o=n[e];a(`${j.gray(r)} ${o(i)}`)}};const I=N(et,`overlayed.log`);var tt=class extends re{blob;chunkSizeMb;maxConcurrent;shouldStop=!1;constructor(e,t){super(),this.blob=e,this.chunkSizeMb=t.chunkSizeMb,this.maxConcurrent=t.maxConcurrent??3}get totalChunks(){return Math.ceil(this.blob.size/(this.chunkSizeMb*1024*1024))}async chunk(e){let t=this.chunkSizeMb*1024*1024,n=this.totalChunks;if(n===0)return;let r=new Map,i=new Set,a=new Set,o=[];for(let e=0;e<n;e++)o.push(e);let s=async n=>{let s=n*t,c=Math.min(s+t,this.blob.size),l=this.blob.slice(s,c);try{await e(l,n),a.add(n),this.emit(`chunkComplete`,n),i.delete(n)}catch(e){let t=r.get(n)||0;t<5?(r.set(n,t+1),await new Promise(e=>setTimeout(e,(t+1)*1e3)),o.push(n)):(a.add(n),this.emit(`error`,e),this.shouldStop=!0,i.delete(n))}},c=[],l=async()=>{for(;(o.length>0||i.size>0)&&!this.shouldStop;){if(o.length===0){await new Promise(e=>setTimeout(e,10));continue}let e=o.shift();a.has(e)||i.has(e)||(i.add(e),await s(e))}};for(let e=0;e<this.maxConcurrent;e++)c.push(l());await Promise.all(c)}};function nt(e,t){let{recursive:n}=rt(t);return oe(e)?n?it(e).map(t=>[e,t]):le(e).map(t=>[e,t]):[]}function rt(e){return{recursive:e?.recursive??!0}}function it(e){return le(e,{withFileTypes:!0}).flatMap(t=>{let n=p.join(e,t.name);return t.isDirectory()?it(n):[n]})}function at(e){return e}const{PipeEventServer:ot,PipeEventClient:st,PipeEventBase:ct,ProcessMonitor:lt,Process:ut,HardwareInterface:dt}=e(import.meta.url)(`@overlayed/app/dist/native-interface/build/overlayed_native_interface_x64.node`),L=N(class extends M{server=null;_hasConnection=!1;pipeId;get hasConnection(){return this._hasConnection}constructor(e){super(),this.pipeId=e,this.init()}destroy(){this.server&&=(this._hasConnection=!1,this.server?.removeAllListeners(),null)}init(){this.server=new ot(this.pipeId,{clientCount:1,access:1}),this.server.on(`event`,e=>{try{let t=JSON.parse(e);this.emit(`data`,[t])}catch(e){this.emit(`error`,e)}}),this.server.on(`connected`,()=>{this._hasConnection=!0}),this.server.on(`disconnected`,()=>{this._hasConnection=!1})}},`stats-cc`),{RenderInterface:ft,renderHookPath:pt}=e(import.meta.url)(`@overlayed/app/dist/render-interface/build/overlayed_render_interface_x64.node`);let mt=function(e){return e[e.LeftButton=1]=`LeftButton`,e[e.RightButton=2]=`RightButton`,e[e.Cancel=3]=`Cancel`,e[e.MiddleButton=4]=`MiddleButton`,e[e.ExtraButton1=5]=`ExtraButton1`,e[e.ExtraButton2=6]=`ExtraButton2`,e[e.Back=8]=`Back`,e[e.Tab=9]=`Tab`,e[e.Clear=12]=`Clear`,e[e.Return=13]=`Return`,e[e.Shift=16]=`Shift`,e[e.Control=17]=`Control`,e[e.Menu=18]=`Menu`,e[e.Pause=19]=`Pause`,e[e.CapsLock=20]=`CapsLock`,e[e.Kana=21]=`Kana`,e[e.Hangeul=21]=`Hangeul`,e[e.Hangul=21]=`Hangul`,e[e.Junja=23]=`Junja`,e[e.Final=24]=`Final`,e[e.Hanja=25]=`Hanja`,e[e.Kanji=25]=`Kanji`,e[e.Escape=27]=`Escape`,e[e.Convert=28]=`Convert`,e[e.NonConvert=29]=`NonConvert`,e[e.Accept=30]=`Accept`,e[e.ModeChange=31]=`ModeChange`,e[e.Space=32]=`Space`,e[e.Prior=33]=`Prior`,e[e.Next=34]=`Next`,e[e.End=35]=`End`,e[e.Home=36]=`Home`,e[e.Left=37]=`Left`,e[e.Up=38]=`Up`,e[e.Right=39]=`Right`,e[e.Down=40]=`Down`,e[e.Select=41]=`Select`,e[e.Print=42]=`Print`,e[e.Execute=43]=`Execute`,e[e.Snapshot=44]=`Snapshot`,e[e.Insert=45]=`Insert`,e[e.Delete=46]=`Delete`,e[e.Help=47]=`Help`,e[e.N0=48]=`N0`,e[e.N1=49]=`N1`,e[e.N2=50]=`N2`,e[e.N3=51]=`N3`,e[e.N4=52]=`N4`,e[e.N5=53]=`N5`,e[e.N6=54]=`N6`,e[e.N7=55]=`N7`,e[e.N8=56]=`N8`,e[e.N9=57]=`N9`,e[e.A=65]=`A`,e[e.B=66]=`B`,e[e.C=67]=`C`,e[e.D=68]=`D`,e[e.E=69]=`E`,e[e.F=70]=`F`,e[e.G=71]=`G`,e[e.H=72]=`H`,e[e.I=73]=`I`,e[e.J=74]=`J`,e[e.K=75]=`K`,e[e.L=76]=`L`,e[e.M=77]=`M`,e[e.N=78]=`N`,e[e.O=79]=`O`,e[e.P=80]=`P`,e[e.Q=81]=`Q`,e[e.R=82]=`R`,e[e.S=83]=`S`,e[e.T=84]=`T`,e[e.U=85]=`U`,e[e.V=86]=`V`,e[e.W=87]=`W`,e[e.X=88]=`X`,e[e.Y=89]=`Y`,e[e.Z=90]=`Z`,e[e.LeftWindows=91]=`LeftWindows`,e[e.RightWindows=92]=`RightWindows`,e[e.Application=93]=`Application`,e[e.Sleep=95]=`Sleep`,e[e.Numpad0=96]=`Numpad0`,e[e.Numpad1=97]=`Numpad1`,e[e.Numpad2=98]=`Numpad2`,e[e.Numpad3=99]=`Numpad3`,e[e.Numpad4=100]=`Numpad4`,e[e.Numpad5=101]=`Numpad5`,e[e.Numpad6=102]=`Numpad6`,e[e.Numpad7=103]=`Numpad7`,e[e.Numpad8=104]=`Numpad8`,e[e.Numpad9=105]=`Numpad9`,e[e.Multiply=106]=`Multiply`,e[e.Add=107]=`Add`,e[e.Separator=108]=`Separator`,e[e.Subtract=109]=`Subtract`,e[e.Decimal=110]=`Decimal`,e[e.Divide=111]=`Divide`,e[e.F1=112]=`F1`,e[e.F2=113]=`F2`,e[e.F3=114]=`F3`,e[e.F4=115]=`F4`,e[e.F5=116]=`F5`,e[e.F6=117]=`F6`,e[e.F7=118]=`F7`,e[e.F8=119]=`F8`,e[e.F9=120]=`F9`,e[e.F10=121]=`F10`,e[e.F11=122]=`F11`,e[e.F12=123]=`F12`,e[e.F13=124]=`F13`,e[e.F14=125]=`F14`,e[e.F15=126]=`F15`,e[e.F16=127]=`F16`,e[e.F17=128]=`F17`,e[e.F18=129]=`F18`,e[e.F19=130]=`F19`,e[e.F20=131]=`F20`,e[e.F21=132]=`F21`,e[e.F22=133]=`F22`,e[e.F23=134]=`F23`,e[e.F24=135]=`F24`,e[e.NumLock=144]=`NumLock`,e[e.ScrollLock=145]=`ScrollLock`,e[e.NEC_Equal=146]=`NEC_Equal`,e[e.Fujitsu_Jisho=146]=`Fujitsu_Jisho`,e[e.Fujitsu_Masshou=147]=`Fujitsu_Masshou`,e[e.Fujitsu_Touroku=148]=`Fujitsu_Touroku`,e[e.Fujitsu_Loya=149]=`Fujitsu_Loya`,e[e.Fujitsu_Roya=150]=`Fujitsu_Roya`,e[e.LeftShift=160]=`LeftShift`,e[e.RightShift=161]=`RightShift`,e[e.LeftControl=162]=`LeftControl`,e[e.RightControl=163]=`RightControl`,e[e.LeftMenu=164]=`LeftMenu`,e[e.RightMenu=165]=`RightMenu`,e[e.BrowserBack=166]=`BrowserBack`,e[e.BrowserForward=167]=`BrowserForward`,e[e.BrowserRefresh=168]=`BrowserRefresh`,e[e.BrowserStop=169]=`BrowserStop`,e[e.BrowserSearch=170]=`BrowserSearch`,e[e.BrowserFavorites=171]=`BrowserFavorites`,e[e.BrowserHome=172]=`BrowserHome`,e[e.VolumeMute=173]=`VolumeMute`,e[e.VolumeDown=174]=`VolumeDown`,e[e.VolumeUp=175]=`VolumeUp`,e[e.MediaNextTrack=176]=`MediaNextTrack`,e[e.MediaPrevTrack=177]=`MediaPrevTrack`,e[e.MediaStop=178]=`MediaStop`,e[e.MediaPlayPause=179]=`MediaPlayPause`,e[e.LaunchMail=180]=`LaunchMail`,e[e.LaunchMediaSelect=181]=`LaunchMediaSelect`,e[e.LaunchApplication1=182]=`LaunchApplication1`,e[e.LaunchApplication2=183]=`LaunchApplication2`,e[e.OEM1=186]=`OEM1`,e[e.OEMPlus=187]=`OEMPlus`,e[e.OEMComma=188]=`OEMComma`,e[e.OEMMinus=189]=`OEMMinus`,e[e.OEMPeriod=190]=`OEMPeriod`,e[e.OEM2=191]=`OEM2`,e[e.OEM3=192]=`OEM3`,e[e.OEM4=219]=`OEM4`,e[e.OEM5=220]=`OEM5`,e[e.OEM6=221]=`OEM6`,e[e.OEM7=222]=`OEM7`,e[e.OEM8=223]=`OEM8`,e[e.OEMAX=225]=`OEMAX`,e[e.OEM102=226]=`OEM102`,e[e.ICOHelp=227]=`ICOHelp`,e[e.ICO00=228]=`ICO00`,e[e.ProcessKey=229]=`ProcessKey`,e[e.ICOClear=230]=`ICOClear`,e[e.Packet=231]=`Packet`,e[e.OEMReset=233]=`OEMReset`,e[e.OEMJump=234]=`OEMJump`,e[e.OEMPA1=235]=`OEMPA1`,e[e.OEMPA2=236]=`OEMPA2`,e[e.OEMPA3=237]=`OEMPA3`,e[e.OEMWSCtrl=238]=`OEMWSCtrl`,e[e.OEMCUSel=239]=`OEMCUSel`,e[e.OEMATTN=240]=`OEMATTN`,e[e.OEMFinish=241]=`OEMFinish`,e[e.OEMCopy=242]=`OEMCopy`,e[e.OEMAuto=243]=`OEMAuto`,e[e.OEMENLW=244]=`OEMENLW`,e[e.OEMBackTab=245]=`OEMBackTab`,e[e.ATTN=246]=`ATTN`,e[e.CRSel=247]=`CRSel`,e[e.EXSel=248]=`EXSel`,e[e.EREOF=249]=`EREOF`,e[e.Play=250]=`Play`,e[e.Zoom=251]=`Zoom`,e[e.Noname=252]=`Noname`,e[e.PA1=253]=`PA1`,e[e.OEMClear=254]=`OEMClear`,e}({});var ht=class{logger;initialized=!1;constructor(e){this.logger=I.getInstance().scope(e)}init(){this.logger.log(`Initializing`),this.initialized=!0}destroy(){this.logger.log(`Destroying`),this.initialized=!1}},R=class extends M{logger;initialized=!1;constructor(e){super(),this.logger=I.getInstance().scope(e)}init(){this.logger.log(`Initializing`),this.initialized=!0}destroy(){this.logger.log(`Destroying`),this.initialized=!1,this.removeAllListeners()}},gt=class extends Ke{logger;initialized=!1;constructor(e){super(),this.logger=I.getInstance().scope(e)}init(){this.logger.log(`Initializing`),this.initialized=!0}destroy(){this.logger.log(`Destroying`),this.initialized=!1,this.removeAllListeners()}};const z=de.create({baseURL:`https://updater.stats.cc`,headers:{Accept:`application/json`,"Accept-Encoding":`gzip, deflate, br`}});let _t;function vt(e){_t=e}z.interceptors.request.use(e=>{let t=_t?.();return t?(e.headers??={},e.headers.Authorization=t,e):e});const B=de.create({baseURL:`https://api.overlayed.gg`,headers:{Accept:`application/json`,"Accept-Encoding":`gzip, deflate, br`}});B.interceptors.request.use(e=>(e.headers??={},e));function yt(e,t){if(t<=0)throw Error(`Chunk size must be greater than 0`);if(e.length===0)return[];let n=[];for(let r=0;r<e.length;r+=t)n.push(e.slice(r,r+t));return n}function bt(e){return e}function xt(e){return e?t=>(e(t),t):bt}const St=xt();function Ct(e){return B.get(`/v1/public/applications/${e}`)}function wt(e,t,n){return z.get(`/v1/native/${Et(e)}/version.txt`,{params:{channel:t},responseType:`text`,headers:{"X-App-Version":Dt(n,t)}})}function Tt(e,t,n){return z.get(`/v1/native/${Et(e)}/files`,{params:{channel:t},responseType:`arraybuffer`,headers:{"X-App-Version":Dt(n,t)}})}function Et(e){return e===`01JXPFK6YQ3N00N2Y9JHFNG55D`||e===`01JZEBPGHT5M4Y6SGY4P7Q9EZT`?`siege-game-module`:e}function Dt(e,t){return`desktop-application/${e} (channel=${t})`}function Ot(){return B.get(`/v1/public/raven/config`)}function kt(e,t){return B.get(`/v1/public/raven/games/${e}/builds/${t}`)}function At(e,t){return B.post(`/v1/public/raven/games/${e}/builds/upload`,null,{params:t})}function jt(e,t){let n=new FormData;return n.append(`file`,t.chunk),B.patch(`/v1/public/raven/games/${e}/builds/upload`,n,{params:t})}function Mt(e){let t=Date.now(),n=yt(e.messages.map(e=>Nt(t,e)),250),r=Promise.all(n.map(async t=>B.post(`/v1/public/cortex/events`,{...e,messages:t})));return r.catch(e=>{let t=e?.response?.data||e?.message||e;console.error(`Failed to submit cortex events`,t)}),r}function Nt(e,t){let n=e-t.created_at.getTime(),r=Math.max(0,Math.floor(n/1e3));return{properties:t.properties,type:t.type,seconds_offset:r}}function Pt(e){return e instanceof Error&&(e.name===`XiorError`||e.name===`XiorTimeoutError`)}function Ft(e){return!!(e&&`kind`in e.data&&`message`in e.data)}let It;function Lt(e){It=e}const V=N(class extends R{UPDATE_CHECK_INTERVAL_MS=1e3*60*5;targetDir;updateInterval;constructor(){super(`NativeModuleManager`),this.targetDir=p.join(F(),`resources`),this.logger.log(`Target directory`,this.targetDir)}async initWithDlls(e){super.init(),await g.mkdir(this.targetDir,{recursive:!0}),await this.checkForUpdates(e),clearInterval(this.updateInterval),this.updateInterval=setInterval(()=>this.checkForUpdates(e),this.UPDATE_CHECK_INTERVAL_MS)}destroy(){this.updateInterval&&=(clearInterval(this.updateInterval),void 0),super.destroy()}async getCurrentVersion(e){try{let t=p.join(this.targetDir,e,`version.txt`);return this.logger.log(`Version Path`,t),await g.readFile(t,`utf-8`)}catch{return null}}getTargetPath(e){return p.join(this.targetDir,e)}getTargetVersionPath(e,t){return p.join(this.getTargetPath(e),t)}async checkForUpdates(e){let t=global.OVERLAYED.APP_BUILD_CHANNEL;if(this.logger.log(`Checking for updates`),!t){this.logger.error(`Invalid VITE_BUILD_CHANNEL`);return}await It?.();for(let n of e)try{let{data:e}=await wt(n,t,global.OVERLAYED.APP_VERSION),r=await this.getCurrentVersion(n);this.logger.log(`${n} > Update Check. current: ${r}, latest: ${e}`);let i=e!==r,a=!1;if(!i){let t=this.getTargetVersionPath(n,e);await this.hasPathAccess(t)?(await g.readdir(t)).length===0&&(a=!0,this.logger.warn(`${n} > Version path exists, but no files. Forcing download.`)):(a=!0,this.logger.warn(`${n} > Version path does not exist. Forcing download.`))}i||a?(this.logger.log(`${n} > Update found: ${r} -> ${e}`),await this.downloadAndExtractDll(n,e,t),this.logger.log(`${n} > Downloaded and extracted`),await this.cleanupOldVersions(n,e),this.logger.log(`${n} > Cleaned up versions older than ${e}`),this.emit(`dllUpdated`,{identifier:n,version:e})):this.logger.log(`${n} > No update found`)}catch(e){this.logger.error(`${n} > Error checking/updating`,e)}}async downloadAndExtractDll(e,t,n){this.logger.log(`${e} > Downloading DLLs for version ${t}`);let{data:r}=await Tt(e,n,global.OVERLAYED.APP_VERSION);this.logger.log(`${e} > Downloaded DLLs for version ${t}`);let i=this.getTargetPath(e),a=this.getTargetVersionPath(e,t);await g.mkdir(a,{recursive:!0});let o=new _;await o.loadAsync(r);let s=Object.keys(o.files).map(async t=>{let n=o.files[t];if(n&&!n.dir){let r=p.join(a,t),i=await n.async(`nodebuffer`);await g.writeFile(r,i),this.logger.log(`${e} > Extracted DLL: ${t}`)}});await Promise.all(s);let c=p.join(i,`version.txt`);await g.writeFile(c,t),this.logger.log(`${e} > Saved version file: ${t}`)}async cleanupOldVersions(e,t){let n=p.join(this.targetDir,e),r=await g.readdir(n,{withFileTypes:!0});for(let e of r)e.isDirectory()&&e.name!==t&&await g.rm(p.join(n,e.name),{recursive:!0,force:!0})}async hasPathAccess(e){try{return await g.access(e,g.constants.F_OK),!0}catch{return!1}}}),H=N(class extends R{REFETCH_INTERVAL=1e3*60*5;FAILED_REFETCH_INTERVAL=1e3*30;_ravenConfig;_executableToGameMap=new Map;_executablesArray=[];_refetchIntervalHandler=null;_failedRefetchTimeoutHandler=null;constructor(){super(`RavenManager`)}init(){super.init(),this.fetchRavenConfig(),this._refetchIntervalHandler=setInterval(()=>{this._failedRefetchTimeoutHandler&&=(clearTimeout(this._failedRefetchTimeoutHandler),null),this.fetchRavenConfig()},this.REFETCH_INTERVAL)}getExecutableData(e){return this._executableToGameMap.get(e.toLowerCase())??null}get executables(){return this._executablesArray}get executablesMap(){return this._executableToGameMap}destroy(){this._refetchIntervalHandler&&clearInterval(this._refetchIntervalHandler),this._failedRefetchTimeoutHandler&&clearTimeout(this._failedRefetchTimeoutHandler),V.getInstance().destroy(),super.destroy()}async fetchRavenConfig(){try{this._ravenConfig={games:(await Ot()).data.games},this.resetState();let e=new Set;for(let t of this._ravenConfig.games){for(let e of t.executables){let n=e.toLowerCase();this._executableToGameMap.set(n,t),this._executablesArray.push(n)}t.modules.forEach(t=>e.add(t))}await V.getInstance().initWithDlls(Array.from(e)),this.logger.log(`Raven updated, monitoring ${this._executableToGameMap.size} executables`),this.emit(`executablesUpdated`,{executables:this.executables,map:this._executableToGameMap})}catch(e){this.logger.error(`Failed to fetch Raven config`,e),this._failedRefetchTimeoutHandler=setTimeout(()=>this.fetchRavenConfig(),this.FAILED_REFETCH_INTERVAL)}}resetState(){this._executableToGameMap.clear(),this._executablesArray=[]}}),{PipeEventServer:Rt,PipeEventClient:zt,PipeEventBase:Bt,ProcessMonitor:Vt,Process:Ht,HardwareInterface:Ut}=e(import.meta.url)(`@overlayed/app/dist/native-interface/build/overlayed_native_interface_x64.node`),U=N(class extends R{_processMonitor;_processes=new Map;boundOnRavenManagerExecutablesUpdated=this.onRavenManagerExecutablesUpdated.bind(this);constructor(){super(`ProcessManager`),this._processMonitor=new Vt}get hasAnyActiveProcesses(){return this.activeProcesses.length>0}get activeProcesses(){return Array.from(this._processes.values()).flat().filter(e=>!e.destroyedAt)}init(){super.init(),H.getInstance().on(`executablesUpdated`,this.boundOnRavenManagerExecutablesUpdated),this._processMonitor.on(`create`,e=>{this.logger.log(`Process created`,e),this.addProcess(e),this.logger.log(`Active Process Count: ${this._processes.size}`),this.emit(`create`,{process:e})}),this._processMonitor.on(`destroy`,e=>{this.logger.log(`Process destroyed`,e),this.deleteProcess(e),this.logger.log(`Active Process Count: ${this._processes.size}`),this.emit(`destroy`,{process:e})})}destroy(){H.getInstance().off(`executablesUpdated`,this.boundOnRavenManagerExecutablesUpdated),this._processes.clear(),this._processMonitor.removeAllListeners(),super.destroy()}isProcessRunning(e){return this._processes.get(e)?.some(e=>!e.destroyedAt)??!1}onRavenManagerExecutablesUpdated(e){this.logger.log(`Monitoring ${e.executables.length} processes`),e.executables.forEach(e=>{this._processMonitor.registerProcess(e)})}addProcess(e){if(!e.name)return;let t=this._processes.get(e.name);if(!t){this._processes.set(e.name,[e]);return}this._processes.set(e.name,t.concat(e))}deleteProcess(e){if(!e.name)return;let t=this._processes.get(e.name)?.filter(t=>t.id!==e.id)??[];t.length===0?this._processes.delete(e.name):this._processes.set(e.name,t)}});var Wt=class{_instance;_resolution;boundOnResolutionChanged=this.onResolutionChanged.bind(this);constructor(e){this._instance=e,this._resolution={width:0,height:0},this._instance.on(`resolution`,this.boundOnResolutionChanged)}destroy(){this._instance.off(`resolution`,this.boundOnResolutionChanged)}get instance(){return this._instance}get resolution(){return this._resolution}onResolutionChanged(e,t){this._resolution={width:e,height:t}}};const W=N(class{interfaces={};constructor(){}createInterface(e){return this.interfaces[e]||(this.interfaces[e]=new Wt(new ft(e,{access:1}))),this.interfaces[e]}getInterface(e){return this.interfaces[e]?this.interfaces[e]:this.createInterface(e)}}),G=N(class{options;eventQueue;meta=null;constructor(e){this.options=this.resolveOptions(e),this.eventQueue=new Ce,this.setupFlushInterval()}track(e,t){this.eventQueue.add({type:e,properties:t,created_at:new Date})}flush(){let e=Array.from(this.eventQueue.flush()).concat({type:`ping`,properties:{},created_at:new Date});if(!this.meta)throw Error(`Tried to flush Cortex events before meta was set`);try{Mt({...this.meta,messages:e})}catch{}return e}setupFlushInterval(){setInterval(()=>{this.flush()},this.options.batchIntervalSeconds*1e3)}resolveOptions(e){return{batchIntervalSeconds:e?.batchIntervalSeconds??15}}}),Gt=e(import.meta.url).resolve(`@overlayed/app/dist/render-interface/build/overlayed_render_hook_x64.dll`),K=N(class extends gt{boundOnProcessCreate=this.onProcessCreate.bind(this);boundOnProcessDestroy=this.onProcessDestroy.bind(this);subscribedGames=new Set;_activeReadyRavenGames=new Set;get isInGame(){return this._activeReadyRavenGames.size>0}constructor(){super(`GameLaunchManager`)}setSubscribedGames(e){this.subscribedGames=new Set(e)}init(){super.init(),W.getInstance().createInterface(`OGG_SIEGE`),U.getInstance().on(`create`,this.boundOnProcessCreate),U.getInstance().on(`destroy`,this.boundOnProcessDestroy)}destroy(){U.getInstance().off(`create`,this.boundOnProcessCreate),U.getInstance().off(`destroy`,this.boundOnProcessDestroy),super.destroy()}async onProcessCreate({process:e}){let t=this.getRavenGame(e);if(!t)return;if(this.subscribedGames.size===0){this.logger.warn(`No subscribed games, skipping`);return}if(G.getInstance().track(`game_launch`,{game:t.identifier}),!this.subscribedGames.has(t.identifier)&&!this.subscribedGames.has(`*`))return;let n=new AbortController;if(await this.emit(`gameLaunch`,{game:t.identifier,reject:()=>n.abort()}),n.signal.aborted)return;let r=Ht.currentProcess;if(this.logger.log(`Game Launched`,t),this.logger.log(`Process is elevated: `,e.isElevated),this.logger.log(`Current process is elevated: `,r.isElevated),e.isElevated&&!r.isElevated){P.getInstance().fatal(`Game is elevated but the App is not`,`ELEVATION_MISMATCH`,{appElevated:!!r.isElevated,gameElevated:!!e.isElevated}),this.logger.log(`Game elevated but App is not`,{appElevated:r.isElevated,gameElevated:e.isElevated});return}let i=this.copyDll(Gt);if(i)try{await e.injectDll(i),this.logger.log(`Render Interface Injection Successful`,i)}catch(e){this.logger.error(`Render Interface Injection Failed`,e),this.logger.error(`Render Interface Injection Failed`,{renderInterfacePath:i})}let a=t?.modules.map(async t=>{let n=await V.getInstance().getCurrentVersion(t);if(!n)return this.logger.error(`No version found for DLL`,{identifier:t}),Promise.resolve();let r=V.getInstance().getTargetVersionPath(t,n);this.logger.log(`DLL Path`,r);let i=await this.getDllFiles(r);return this.logger.log(`DLL Files`,i),Promise.all(i.map(async t=>{let n=p.basename(t),i=p.join(r,n);if(!i)return Promise.resolve();this.logger.log(`Injecting: `,i);try{return e.injectDll(i).then(()=>{this.logger.log(`Injection Successful`,i)}).catch(e=>{this.logger.error(`Injection Failed [1]`,{targetPath:i},e)})}catch(e){return this.logger.error(`Injection Failed [2]`,{targetPath:i},e),Promise.reject(e)}}))});await Promise.allSettled(a),this._activeReadyRavenGames.add(t.identifier),this.logger.debug(`Active ready raven games`,Array.from(this._activeReadyRavenGames).join(`, `)),this.emit(`gameReadyInternal`,{ravenGame:t,process:e}),this.emit(`gameReady`,{game:t.identifier}),G.getInstance().track(`game_ready`,{game:t.identifier})}copyDll(e){let t=p.basename(e),n=ee(e),r=p.join(F(),`resources`),i=p.join(r,t);this.logger.info(`Copying`,n,`to`,i);try{oe(r)||se(r,{recursive:!0}),ue(i,ce(n)),ie(n,i)}catch(e){return e.code===`EBUSY`?i:(this.logger.error(`Failed to copy`,e),this.logger.error(`Failed to copy`,{originalPath:n,targetPath:i}),!1)}return i}async getDllFiles(e){try{return(await g.readdir(e)).filter(e=>e.endsWith(`.dll`)).map(t=>p.join(e,t))}catch(t){return this.logger.error(`Failed to read DLL directory`,t),this.logger.error(`Failed to read DLL directory`,{dllPath:e}),[]}}onProcessDestroy({process:e}){let t=this.getRavenGame(e);t&&(this._activeReadyRavenGames.delete(t.identifier),this.logger.debug(`Active ready raven games`,Array.from(this._activeReadyRavenGames).join(`, `)),this.emit(`gameCloseInternal`,{ravenGame:t,process:e}),this.emit(`gameClose`,{game:t.identifier}),G.getInstance().track(`game_close`,{game:t.identifier}))}getRavenGame(e){if(!e.name)return;let t=H.getInstance().getExecutableData(e.name);if(!t){this.logger.error(`No raven game found for process`,{process:e});return}return t}}),Kt=N(class extends ht{boundOnGameLaunch=this.onGameLaunch.bind(this);constructor(){super(`GameBuildManager`)}init(){super.init(),K.getInstance().on(`gameReadyInternal`,this.boundOnGameLaunch)}destroy(){K.getInstance().off(`gameReadyInternal`,this.boundOnGameLaunch),super.destroy()}async onGameLaunch(...e){let[{ravenGame:t,process:n}]=e;if(!n.path||!n.name){this.logger.error(`Process path or name not found, could not check for build hash`,void 0,n);return}let r=ce(n.path),i=fe(`sha256`).update(r).digest(`hex`);this.logger.log(`Process Path`,n.path),this.logger.log(`Process Name`,n.name),this.logger.log(`Build Hash`,i);let a=!1;try{a=(await kt(t.identifier,i)).data.upload}catch(e){this.logger.error(`Error checking game build hash`,e);return}if(!a){this.logger.log(`Build hash already exists, skipping upload`);return}let o=new _;o.file(n.name,r);let s=await o.generateAsync({type:`blob`});try{this.logger.log(`Uploading build (size: `,s.size,` bytes)`);let e=new tt(s,{chunkSizeMb:25,maxConcurrent:1}),n=await At(t.identifier,{build_hash:i,chunk_count:e.totalChunks,file_size_bytes:s.size});await e.chunk(async(e,r)=>{this.logger.log(`Uploading chunk`,r),await jt(t.identifier,{chunk:e,build_hash:i,chunk_index:r,upload_token:n.data.upload_token})}),this.logger.log(`Build uploaded successfully`)}catch(e){Pt(e)?Ft(e.response)?this.logger.error(`Error uploading build hash, api error`,e):this.logger.error(`Error uploading build hash, request error`,e):this.logger.error(`Error uploading build hash, unknown error`,e)}}});function qt(e=[]){return p.normalize(p.join(Ze(global.OVERLAYED.APPLICATION_ID),...e))}const Jt=n({game:`string`,type:`string`,creation_time:`number`}),q=new qe({path:$e(),schema:n({userId:`string | undefined`,sessionId:`string | undefined`,sessionLastUsed:`number | undefined`}),default:{userId:void 0,sessionId:void 0,sessionLastUsed:void 0}});function Yt(){let e=q.get().userId;if(e)return e;let t=Qt();return q.set({...q.get(),userId:t}),t}function Xt(){let e=q.get();if(e.sessionId&&typeof e.sessionLastUsed==`number`&&Date.now()-e.sessionLastUsed<=300*1e3)return e.sessionId;let t=crypto.randomUUID();return q.set({...e,sessionId:t,sessionLastUsed:Date.now()}),t}function Zt(){try{let e=q.get();q.set({...e,sessionLastUsed:Date.now()})}catch(e){I.getInstance().log(`Failed to update sessionLastUsed`,e)}}function Qt(){try{return Ut.generateUniqueIdentifier()}catch{return crypto.randomUUID()}}function J(e,t){return`${e}:${t}`}function $t(e,t,n){return e.reduce((e,r)=>{let i=r.key;return e[i]={on(e,n){let r=J(i,e),a=t.get(r)??new Set;a.add(n),t.set(r,a)},onAny(e){let n=J(i,`*`),r=t.get(n)??new Set;r.add(e),t.set(n,r)},off(e,n){let r=J(i,e),a=t.get(r);a&&(a.delete(n),a.size===0&&t.delete(r))},offAny(e){let n=J(i,`*`),r=t.get(n);r&&(r.delete(e),r.size===0&&t.delete(n))},readyForGameEvents:()=>{n.emit(`flushEvents`,i)}},e},{})}function en(){let e=P.getInstance(),t=K.getInstance();return{on:(n,r)=>{switch(n){case`fatal`:e.on(`fatal`,r);break;case`error`:e.on(`error`,r);break;case`warning`:e.on(`warning`,r);break;case`gameLaunch`:t.on(`gameLaunch`,r);break;case`gameClose`:t.on(`gameClose`,r);break;case`gameReady`:t.on(`gameReady`,r);break;default:throw Error(`Event type not implemented ${n}`,{cause:[n,r]})}},off:(n,r)=>{switch(n){case`fatal`:e.off(`fatal`,r);break;case`error`:e.off(`error`,r);break;case`warning`:e.off(`warning`,r);break;case`gameLaunch`:t.off(`gameLaunch`,r);break;case`gameClose`:t.off(`gameClose`,r);break;case`gameReady`:t.off(`gameReady`,r);break;default:throw Error(`Event type not implemented ${n}`,{cause:[n,r]})}}}}var Y=function(e){return e[e.LeftButton=1]=`LeftButton`,e[e.RightButton=2]=`RightButton`,e[e.Cancel=3]=`Cancel`,e[e.MiddleButton=4]=`MiddleButton`,e[e.ExtraButton1=5]=`ExtraButton1`,e[e.ExtraButton2=6]=`ExtraButton2`,e[e.Back=8]=`Back`,e[e.Tab=9]=`Tab`,e[e.Clear=12]=`Clear`,e[e.Return=13]=`Return`,e[e.Shift=16]=`Shift`,e[e.Control=17]=`Control`,e[e.Menu=18]=`Menu`,e[e.Pause=19]=`Pause`,e[e.CapsLock=20]=`CapsLock`,e[e.Kana=21]=`Kana`,e[e.Hangeul=21]=`Hangeul`,e[e.Hangul=21]=`Hangul`,e[e.Junja=23]=`Junja`,e[e.Final=24]=`Final`,e[e.Hanja=25]=`Hanja`,e[e.Kanji=25]=`Kanji`,e[e.Escape=27]=`Escape`,e[e.Convert=28]=`Convert`,e[e.NonConvert=29]=`NonConvert`,e[e.Accept=30]=`Accept`,e[e.ModeChange=31]=`ModeChange`,e[e.Space=32]=`Space`,e[e.Prior=33]=`Prior`,e[e.Next=34]=`Next`,e[e.End=35]=`End`,e[e.Home=36]=`Home`,e[e.Left=37]=`Left`,e[e.Up=38]=`Up`,e[e.Right=39]=`Right`,e[e.Down=40]=`Down`,e[e.Select=41]=`Select`,e[e.Print=42]=`Print`,e[e.Execute=43]=`Execute`,e[e.Snapshot=44]=`Snapshot`,e[e.Insert=45]=`Insert`,e[e.Delete=46]=`Delete`,e[e.Help=47]=`Help`,e[e.N0=48]=`N0`,e[e.N1=49]=`N1`,e[e.N2=50]=`N2`,e[e.N3=51]=`N3`,e[e.N4=52]=`N4`,e[e.N5=53]=`N5`,e[e.N6=54]=`N6`,e[e.N7=55]=`N7`,e[e.N8=56]=`N8`,e[e.N9=57]=`N9`,e[e.A=65]=`A`,e[e.B=66]=`B`,e[e.C=67]=`C`,e[e.D=68]=`D`,e[e.E=69]=`E`,e[e.F=70]=`F`,e[e.G=71]=`G`,e[e.H=72]=`H`,e[e.I=73]=`I`,e[e.J=74]=`J`,e[e.K=75]=`K`,e[e.L=76]=`L`,e[e.M=77]=`M`,e[e.N=78]=`N`,e[e.O=79]=`O`,e[e.P=80]=`P`,e[e.Q=81]=`Q`,e[e.R=82]=`R`,e[e.S=83]=`S`,e[e.T=84]=`T`,e[e.U=85]=`U`,e[e.V=86]=`V`,e[e.W=87]=`W`,e[e.X=88]=`X`,e[e.Y=89]=`Y`,e[e.Z=90]=`Z`,e[e.LeftWindows=91]=`LeftWindows`,e[e.RightWindows=92]=`RightWindows`,e[e.Application=93]=`Application`,e[e.Sleep=95]=`Sleep`,e[e.Numpad0=96]=`Numpad0`,e[e.Numpad1=97]=`Numpad1`,e[e.Numpad2=98]=`Numpad2`,e[e.Numpad3=99]=`Numpad3`,e[e.Numpad4=100]=`Numpad4`,e[e.Numpad5=101]=`Numpad5`,e[e.Numpad6=102]=`Numpad6`,e[e.Numpad7=103]=`Numpad7`,e[e.Numpad8=104]=`Numpad8`,e[e.Numpad9=105]=`Numpad9`,e[e.Multiply=106]=`Multiply`,e[e.Add=107]=`Add`,e[e.Separator=108]=`Separator`,e[e.Subtract=109]=`Subtract`,e[e.Decimal=110]=`Decimal`,e[e.Divide=111]=`Divide`,e[e.F1=112]=`F1`,e[e.F2=113]=`F2`,e[e.F3=114]=`F3`,e[e.F4=115]=`F4`,e[e.F5=116]=`F5`,e[e.F6=117]=`F6`,e[e.F7=118]=`F7`,e[e.F8=119]=`F8`,e[e.F9=120]=`F9`,e[e.F10=121]=`F10`,e[e.F11=122]=`F11`,e[e.F12=123]=`F12`,e[e.F13=124]=`F13`,e[e.F14=125]=`F14`,e[e.F15=126]=`F15`,e[e.F16=127]=`F16`,e[e.F17=128]=`F17`,e[e.F18=129]=`F18`,e[e.F19=130]=`F19`,e[e.F20=131]=`F20`,e[e.F21=132]=`F21`,e[e.F22=133]=`F22`,e[e.F23=134]=`F23`,e[e.F24=135]=`F24`,e[e.NumLock=144]=`NumLock`,e[e.ScrollLock=145]=`ScrollLock`,e[e.NEC_Equal=146]=`NEC_Equal`,e[e.Fujitsu_Jisho=146]=`Fujitsu_Jisho`,e[e.Fujitsu_Masshou=147]=`Fujitsu_Masshou`,e[e.Fujitsu_Touroku=148]=`Fujitsu_Touroku`,e[e.Fujitsu_Loya=149]=`Fujitsu_Loya`,e[e.Fujitsu_Roya=150]=`Fujitsu_Roya`,e[e.LeftShift=160]=`LeftShift`,e[e.RightShift=161]=`RightShift`,e[e.LeftControl=162]=`LeftControl`,e[e.RightControl=163]=`RightControl`,e[e.LeftMenu=164]=`LeftMenu`,e[e.RightMenu=165]=`RightMenu`,e[e.BrowserBack=166]=`BrowserBack`,e[e.BrowserForward=167]=`BrowserForward`,e[e.BrowserRefresh=168]=`BrowserRefresh`,e[e.BrowserStop=169]=`BrowserStop`,e[e.BrowserSearch=170]=`BrowserSearch`,e[e.BrowserFavorites=171]=`BrowserFavorites`,e[e.BrowserHome=172]=`BrowserHome`,e[e.VolumeMute=173]=`VolumeMute`,e[e.VolumeDown=174]=`VolumeDown`,e[e.VolumeUp=175]=`VolumeUp`,e[e.MediaNextTrack=176]=`MediaNextTrack`,e[e.MediaPrevTrack=177]=`MediaPrevTrack`,e[e.MediaStop=178]=`MediaStop`,e[e.MediaPlayPause=179]=`MediaPlayPause`,e[e.LaunchMail=180]=`LaunchMail`,e[e.LaunchMediaSelect=181]=`LaunchMediaSelect`,e[e.LaunchApplication1=182]=`LaunchApplication1`,e[e.LaunchApplication2=183]=`LaunchApplication2`,e[e.OEM1=186]=`OEM1`,e[e.OEMPlus=187]=`OEMPlus`,e[e.OEMComma=188]=`OEMComma`,e[e.OEMMinus=189]=`OEMMinus`,e[e.OEMPeriod=190]=`OEMPeriod`,e[e.OEM2=191]=`OEM2`,e[e.OEM3=192]=`OEM3`,e[e.OEM4=219]=`OEM4`,e[e.OEM5=220]=`OEM5`,e[e.OEM6=221]=`OEM6`,e[e.OEM7=222]=`OEM7`,e[e.OEM8=223]=`OEM8`,e[e.OEMAX=225]=`OEMAX`,e[e.OEM102=226]=`OEM102`,e[e.ICOHelp=227]=`ICOHelp`,e[e.ICO00=228]=`ICO00`,e[e.ProcessKey=229]=`ProcessKey`,e[e.ICOClear=230]=`ICOClear`,e[e.Packet=231]=`Packet`,e[e.OEMReset=233]=`OEMReset`,e[e.OEMJump=234]=`OEMJump`,e[e.OEMPA1=235]=`OEMPA1`,e[e.OEMPA2=236]=`OEMPA2`,e[e.OEMPA3=237]=`OEMPA3`,e[e.OEMWSCtrl=238]=`OEMWSCtrl`,e[e.OEMCUSel=239]=`OEMCUSel`,e[e.OEMATTN=240]=`OEMATTN`,e[e.OEMFinish=241]=`OEMFinish`,e[e.OEMCopy=242]=`OEMCopy`,e[e.OEMAuto=243]=`OEMAuto`,e[e.OEMENLW=244]=`OEMENLW`,e[e.OEMBackTab=245]=`OEMBackTab`,e[e.ATTN=246]=`ATTN`,e[e.CRSel=247]=`CRSel`,e[e.EXSel=248]=`EXSel`,e[e.EREOF=249]=`EREOF`,e[e.Play=250]=`Play`,e[e.Zoom=251]=`Zoom`,e[e.Noname=252]=`Noname`,e[e.PA1=253]=`PA1`,e[e.OEMClear=254]=`OEMClear`,e}(Y||{});const tn=new Map([[Y.LeftButton,`LeftButton`],[Y.RightButton,`RightButton`],[Y.Cancel,`Cancel`],[Y.MiddleButton,`MiddleButton`],[Y.ExtraButton1,`ExtraButton1`],[Y.ExtraButton2,`ExtraButton2`],[Y.Back,`Backspace`],[Y.Tab,`Tab`],[Y.Clear,`Clear`],[Y.Return,`Enter`],[Y.Shift,`ShiftLeft`],[Y.Control,`ControlLeft`],[Y.Menu,`AltLeft`],[Y.Pause,`Pause`],[Y.CapsLock,`CapsLock`],[Y.Kana,`KanaMode`],[Y.Junja,`JunjaMode`],[Y.Final,`Finalize`],[Y.Hanja,`HanjaMode`],[Y.Escape,`Escape`],[Y.Convert,`Convert`],[Y.NonConvert,`NonConvert`],[Y.Accept,`Accept`],[Y.ModeChange,`ModeChange`],[Y.Space,`Space`],[Y.Prior,`PageUp`],[Y.Next,`PageDown`],[Y.End,`End`],[Y.Home,`Home`],[Y.Left,`ArrowLeft`],[Y.Up,`ArrowUp`],[Y.Right,`ArrowRight`],[Y.Down,`ArrowDown`],[Y.Select,`Select`],[Y.Print,`PrintScreen`],[Y.Execute,`Execute`],[Y.Snapshot,`Snapshot`],[Y.Insert,`Insert`],[Y.Delete,`Delete`],[Y.Help,`Help`],[Y.N0,`Digit0`],[Y.N1,`Digit1`],[Y.N2,`Digit2`],[Y.N3,`Digit3`],[Y.N4,`Digit4`],[Y.N5,`Digit5`],[Y.N6,`Digit6`],[Y.N7,`Digit7`],[Y.N8,`Digit8`],[Y.N9,`Digit9`],[Y.A,`KeyA`],[Y.B,`KeyB`],[Y.C,`KeyC`],[Y.D,`KeyD`],[Y.E,`KeyE`],[Y.F,`KeyF`],[Y.G,`KeyG`],[Y.H,`KeyH`],[Y.I,`KeyI`],[Y.J,`KeyJ`],[Y.K,`KeyK`],[Y.L,`KeyL`],[Y.M,`KeyM`],[Y.N,`KeyN`],[Y.O,`KeyO`],[Y.P,`KeyP`],[Y.Q,`KeyQ`],[Y.R,`KeyR`],[Y.S,`KeyS`],[Y.T,`KeyT`],[Y.U,`KeyU`],[Y.V,`KeyV`],[Y.W,`KeyW`],[Y.X,`KeyX`],[Y.Y,`KeyY`],[Y.Z,`KeyZ`],[Y.LeftWindows,`MetaLeft`],[Y.RightWindows,`MetaRight`],[Y.Application,`ContextMenu`],[Y.Sleep,`Sleep`],[Y.Numpad0,`Numpad0`],[Y.Numpad1,`Numpad1`],[Y.Numpad2,`Numpad2`],[Y.Numpad3,`Numpad3`],[Y.Numpad4,`Numpad4`],[Y.Numpad5,`Numpad5`],[Y.Numpad6,`Numpad6`],[Y.Numpad7,`Numpad7`],[Y.Numpad8,`Numpad8`],[Y.Numpad9,`Numpad9`],[Y.Multiply,`NumpadMultiply`],[Y.Add,`NumpadAdd`],[Y.Separator,`NumpadSeparator`],[Y.Subtract,`NumpadSubtract`],[Y.Decimal,`NumpadDecimal`],[Y.Divide,`NumpadDivide`],[Y.F1,`F1`],[Y.F2,`F2`],[Y.F3,`F3`],[Y.F4,`F4`],[Y.F5,`F5`],[Y.F6,`F6`],[Y.F7,`F7`],[Y.F8,`F8`],[Y.F9,`F9`],[Y.F10,`F10`],[Y.F11,`F11`],[Y.F12,`F12`],[Y.F13,`F13`],[Y.F14,`F14`],[Y.F15,`F15`],[Y.F16,`F16`],[Y.F17,`F17`],[Y.F18,`F18`],[Y.F19,`F19`],[Y.F20,`F20`],[Y.F21,`F21`],[Y.F22,`F22`],[Y.F23,`F23`],[Y.F24,`F24`],[Y.NumLock,`NumLock`],[Y.ScrollLock,`ScrollLock`],[Y.NEC_Equal,`NEC_Equal`],[Y.Fujitsu_Masshou,`Fujitsu_Masshou`],[Y.Fujitsu_Touroku,`Fujitsu_Touroku`],[Y.Fujitsu_Loya,`Fujitsu_Loya`],[Y.Fujitsu_Roya,`Fujitsu_Roya`],[Y.LeftShift,`ShiftLeft`],[Y.RightShift,`ShiftRight`],[Y.LeftControl,`ControlLeft`],[Y.RightControl,`ControlRight`],[Y.LeftMenu,`AltLeft`],[Y.RightMenu,`AltRight`],[Y.BrowserBack,`BrowserBack`],[Y.BrowserForward,`BrowserForward`],[Y.BrowserRefresh,`BrowserRefresh`],[Y.BrowserStop,`BrowserStop`],[Y.BrowserSearch,`BrowserSearch`],[Y.BrowserFavorites,`BrowserFavorites`],[Y.BrowserHome,`BrowserHome`],[Y.VolumeMute,`VolumeMute`],[Y.VolumeDown,`VolumeDown`],[Y.VolumeUp,`VolumeUp`],[Y.MediaNextTrack,`MediaTrackNext`],[Y.MediaPrevTrack,`MediaTrackPrevious`],[Y.MediaStop,`MediaStop`],[Y.MediaPlayPause,`MediaPlayPause`],[Y.LaunchMail,`LaunchMail`],[Y.LaunchMediaSelect,`LaunchMediaSelect`],[Y.LaunchApplication1,`LaunchApplication1`],[Y.LaunchApplication2,`LaunchApplication2`],[Y.OEM1,`OEM_1`],[Y.OEMPlus,`Equal`],[Y.OEMComma,`Comma`],[Y.OEMMinus,`Minus`],[Y.OEMPeriod,`Period`],[Y.OEM2,`Slash`],[Y.OEM3,`Backquote`],[Y.OEM4,`BracketLeft`],[Y.OEM5,`Backslash`],[Y.OEM6,`BracketRight`],[Y.OEM7,`Quote`],[Y.OEM8,`IntlRo`],[Y.OEMAX,`OEM_AX`],[Y.OEM102,`IntlBackslash`],[Y.ICOHelp,`ICO_HELP`],[Y.ICO00,`ICO_00`],[Y.ProcessKey,`Process`],[Y.ICOClear,`ICO_CLEAR`],[Y.Packet,`Packet`],[Y.OEMReset,`OEM_Reset`],[Y.OEMJump,`OEM_Jump`],[Y.OEMPA1,`OEM_PA1`],[Y.OEMPA2,`OEM_PA2`],[Y.OEMPA3,`OEM_PA3`],[Y.OEMWSCtrl,`OEM_WS_Ctrl`],[Y.OEMCUSel,`OEM_CU_Sel`],[Y.OEMATTN,`OEM_ATTN`],[Y.OEMFinish,`OEM_Finish`],[Y.OEMCopy,`OEM_Copy`],[Y.OEMAuto,`OEM_Auto`],[Y.OEMENLW,`OEM_ENLW`],[Y.OEMBackTab,`BackTab`],[Y.ATTN,`ATTN`],[Y.CRSel,`CRSel`],[Y.EXSel,`EXSel`],[Y.EREOF,`EREOF`],[Y.Play,`MediaPlay`],[Y.Zoom,`Zoom`],[Y.Noname,`Noname`],[Y.PA1,`PA1`],[Y.OEMClear,`OEM_Clear`]]),nn=new Map(tn.entries().map(([e,t])=>[t,e])),rn=n({"[string]":{keys:`string[]`,mode:n(`'toggle' | 'hold'`).pipe(e=>e??`toggle`)}});var an=class extends R{preferencesKeybindToCallbacks=new Map;pressedKeys=new Set;activeKeybinds=new Set;triggeredToggleKeybinds=new Set;boundHandleKeyboardFocus=this.handleKeyboardFocus.bind(this);boundHandleKeyDown=this.handleKeyDown.bind(this);boundHandleKeyUp=this.handleKeyUp.bind(this);keybindsFile;keybindListeningPaused=!1;constructor(e){super(`KeybindManager`),this.keybindsFile=new qe({path:qt([`keybinds.json`]),schema:rn,default:e})}init(){super.init();let e=W.getInstance().getInterface(`OGG_SIEGE`);e.instance.on(`keyboardFocus`,this.boundHandleKeyboardFocus),e.instance.on(`keyDown`,this.boundHandleKeyDown),e.instance.on(`keyUp`,this.boundHandleKeyUp)}async onKeybindToggled(e,t){let n=this.preferencesKeybindToCallbacks.get(e)??{toggle:[],down:[],up:[]};n.toggle.push(t),this.preferencesKeybindToCallbacks.set(e,n)}async onKeybindDown(e,t){let n=this.preferencesKeybindToCallbacks.get(e)??{toggle:[],down:[],up:[]};n.down.push(t),this.preferencesKeybindToCallbacks.set(e,n)}async onKeybindUp(e,t){let n=this.preferencesKeybindToCallbacks.get(e)??{toggle:[],down:[],up:[]};n.up.push(t),this.preferencesKeybindToCallbacks.set(e,n)}async updateKeybind(e,t){this.keybindsFile.set({[e]:t})}async updateKeybinds(e){let t=Object.fromEntries(Object.entries(e).filter(([e,t])=>t!==void 0));this.keybindsFile.set({...this.keybindsFile.get(),...t})}getConfig(){return this.keybindsFile.get()}destroy(){let e=W.getInstance().getInterface(`OGG_SIEGE`);e.instance.off(`keyboardFocus`,this.boundHandleKeyboardFocus),e.instance.off(`keyDown`,this.boundHandleKeyDown),e.instance.off(`keyUp`,this.boundHandleKeyUp),super.destroy()}handleKeyDown(e){if(this.keybindListeningPaused)return;let t=tn.get(e.key);if(!t){this.logger.error(`Unknown key down`,e);return}this.pressedKeys.add(t),this.checkKeybindings()}handleKeyboardFocus(){this.pressedKeys.clear(),this.activeKeybinds.clear(),this.triggeredToggleKeybinds.clear()}async handleKeyUp(e){if(this.keybindListeningPaused)return;let t=tn.get(e.key);if(!t)return;this.pressedKeys.delete(t);let n=this.keybindsFile.get();for(let[e]of this.preferencesKeybindToCallbacks.entries())n[e].keys.includes(t)&&this.triggeredToggleKeybinds.delete(e);this.checkKeybindUps()}async checkKeybindUps(){let e=this.keybindsFile.get();for(let[t,n]of this.preferencesKeybindToCallbacks.entries()){if(!n.up||n.up.length===0)continue;let r=e[t];if(this.activeKeybinds.has(t)&&r.keys.some(e=>!this.pressedKeys.has(e))){this.activeKeybinds.delete(t);for(let e of n.up)e();this.logger.log(`Keybind up triggered`,this.getKeybindToString(r))}}}async checkKeybindings(){let e=this.keybindsFile.get();for(let[t,n]of this.preferencesKeybindToCallbacks.entries()){let r=e[t];if(r.keys.length===this.pressedKeys.size&&r.keys.every(e=>nn.has(e)?this.pressedKeys.has(e):!1)){this.triggerKeybind(r,n,t);return}}for(let[t,n]of this.preferencesKeybindToCallbacks.entries()){let r=e[t];r.keys.every(e=>nn.has(e)?this.pressedKeys.has(e):(this.logger.error(`Unknown key`,e,r),!1))&&this.triggerKeybind(r,n,t)}}triggerKeybind(e,t,n){let r=e.mode;if(r===`toggle`&&t.toggle&&t.toggle.length>0&&!this.triggeredToggleKeybinds.has(n)){let r;for(let e of t.toggle){let t=e();typeof t==`string`&&r===void 0&&(r=t)}this.triggeredToggleKeybinds.add(n),this.logger.log(r?`Keybind pressed rejected: ${r}`:`Keybind pressed accepted`,this.getKeybindToString(e))}if(r===`hold`&&t.down&&t.down.length>0&&!this.activeKeybinds.has(n)){let r;for(let e of t.down){let t=e();if(typeof t==`string`){r=t;break}}r?this.logger.log(`Keybind down rejected: ${r}`,this.getKeybindToString(e)):(this.activeKeybinds.add(n),this.logger.log(`Keybind down accepted`,this.getKeybindToString(e)))}}getKeybindToString(e){return`(${e.keys.join(`+`)}${e.mode?` ${e.mode}`:``})`}};function on(e){let t=new an(e),n={};for(let r in e)n[r]={on:(e,n)=>{switch(e){case`down`:t.onKeybindDown(r,n);break;case`up`:t.onKeybindUp(r,n);break;case`toggle`:t.onKeybindToggled(r,n);break;default:throw Error(`Event type not implemented ${e}`,{cause:[e,n]})}}};let r={...n,getConfig:()=>t.getConfig(),pauseKeybindListening:()=>{t.keybindListeningPaused=!0},resumeKeybindListening:()=>{t.keybindListeningPaused=!1},updateKeybind:(e,n)=>{t.updateKeybind(e,n)},updateKeybinds:e=>{t.updateKeybinds(e)}};return t.init(),pe.on(`quit`,()=>{t.destroy()}),r}function X(){return W.getInstance().getInterface(`OGG_SIEGE`)}function sn(){let e=K.getInstance(),t=P.getInstance(),n=G.getInstance();n.meta=cn(),e.on([`gameReady`,`gameClose`],()=>{n.meta||=cn(),n.meta.in_game=e.isInGame}),t.on(`fatal`,e=>{n.track(`fatal`,{message:e.message,code:e.code,data:JSON.stringify(e.data)})}),t.on(`error`,e=>{n.track(`error`,{code:e.code,message:e.message,data:JSON.stringify(e.data)})}),t.on(`warning`,e=>{n.track(`warning`,{message:e.message,code:e.code,data:JSON.stringify(e.data)})})}function cn(){return{app_id:global.OVERLAYED.APPLICATION_ID,user_id:Yt(),app_channel:global.OVERLAYED.APP_BUILD_CHANNEL,app_version:global.OVERLAYED.APP_VERSION,package_version:global.OVERLAYED.PACKAGE_VERSION,frontend_version:global.OVERLAYED.FRONTEND_VERSION,session_id:global.OVERLAYED.sessionId,in_game:!1}}function ln(){function e(e,t){return e.once(`closed`,()=>{e.isDestroyed()||G.getInstance().track(`window_closed`,{url:e.webContents.getURL(),in_game:t})}),e.on(`unresponsive`,()=>{e.isDestroyed()||G.getInstance().track(`window_unresponsive`,{url:e.webContents.getURL(),in_game:t})}),G.getInstance().track(`window_created`,{url:e.webContents.getURL(),in_game:t}),e}return{createWindow:t=>e(new global.OVERLAYED.electron.BrowserWindow(t),!1),createInGameWindow:t=>e(X().instance.newWindowInternal(global.OVERLAYED.electron.BrowserWindow,t),!0),on:(e,t)=>X().instance.on(e,t),off:(e,t)=>X().instance.off(e,t),once:(e,t)=>X().instance.once(e,t),addListener:(e,t)=>X().instance.addListener(e,t),removeListener:(e,t)=>X().instance.removeListener(e,t),removeAllListeners:()=>X().instance.removeAllListeners(),prependListener:(e,t)=>X().instance.prependListener(e,t),prependOnceListener:(e,t)=>X().instance.prependOnceListener(e,t),getActiveGameInfo:()=>{let e=X(),t=L.getInstance();return{resolution:e.resolution,isConnected:t.hasConnection}}}}const un=N(class extends ht{renderInterface;globalCursorOverrideCount=new Set;globalMouseBlockCount=new Set;globalKeyboardBlockCount=new Set;keyInputBlocks={};constructor(e){super(`OverridesManager`),this.renderInterface=W.getInstance().getInterface(e)}scope(e){return{setGlobalCursorOverride:t=>this.setGlobalCursorOverride(e,t),setGlobalMouseBlock:t=>this.setGlobalMouseBlock(e,t),setGlobalKeyboardBlock:t=>this.setGlobalKeyboardBlock(e,t),setKeyInputBlock:(t,n)=>this.setKeyInputBlock(e,t,n)}}setGlobalCursorOverride(e,t){t?this.globalCursorOverrideCount.add(e):this.globalCursorOverrideCount.delete(e),t&&this.globalCursorOverrideCount.size===1?this.renderInterface.instance.setGlobalCursorOverride(!0):!t&&this.globalCursorOverrideCount.size===0&&this.renderInterface.instance.setGlobalCursorOverride(!1)}setGlobalMouseBlock(e,t){t?this.globalMouseBlockCount.add(e):this.globalMouseBlockCount.delete(e),t&&this.globalMouseBlockCount.size===1?this.renderInterface.instance.setGlobalMouseBlock(!0):!t&&this.globalMouseBlockCount.size===0&&this.renderInterface.instance.setGlobalMouseBlock(!1)}setGlobalKeyboardBlock(e,t){t?this.globalKeyboardBlockCount.add(e):this.globalKeyboardBlockCount.delete(e),t&&this.globalKeyboardBlockCount.size===1?this.renderInterface.instance.setGlobalKeyboardBlock(!0):!t&&this.globalKeyboardBlockCount.size===0&&this.renderInterface.instance.setGlobalKeyboardBlock(!1)}setKeyInputBlock(e,t,n){this.keyInputBlocks[t]||(this.keyInputBlocks[t]=new Set),n?this.keyInputBlocks[t].add(e):this.keyInputBlocks[t].delete(e),n&&this.keyInputBlocks[t].size===1?this.renderInterface.instance.setKeyInputBlock(t,!0):!n&&this.keyInputBlocks[t].size===0&&this.renderInterface.instance.setKeyInputBlock(t,!1)}},`OGG_SIEGE`);function dn(){return{scope:e=>un.getInstance().scope(e),raw:{setGlobalMouseBlock:e=>X().instance.setGlobalMouseBlock(e),setGlobalKeyboardBlock:e=>X().instance.setGlobalKeyboardBlock(e),setGlobalCursorOverride:e=>X().instance.setGlobalCursorOverride(e),setKeyInputBlock:(e,t)=>X().instance.setKeyInputBlock(e,t),getGlobalMouseBlock:()=>X().instance.getGlobalMouseBlock(),getGlobalKeyboardBlock:()=>X().instance.getGlobalKeyboardBlock(),getGlobalCursorOverride:()=>X().instance.getGlobalCursorOverride(),getKeyInputBlock:e=>X().instance.getKeyInputBlock(e)}}}function fn(){return{track:(e,t)=>{G.getInstance().track(`custom__${String(e)}`,t)}}}var pn=Se(be(((e,t)=>{var n=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),r=n((e,t)=>{var n=new Set([`mouseDown`,`mouseUp`,`pointerDown`,`pointerUp`]),r=new WeakSet;function i(e,t,{allowHosts:i}={}){let{shell:a}=t;if(r.has(e))return;r.add(e);let o=e.webContents;function s(e){return!!(!c(e)||i?.includes(e.host))}function c(e){return new URL(o.getURL()).origin!==e.origin}let l=0;function u(){l=Date.now()}function d(){let e=Date.now()-l,t=e<150;return t||console.warn(`was not recently active`,e),t}if(process.platform===`win32`)for(let t of Object.values({KEYDOWN:256,LBUTTONUP:514,MBUTTONUP:520,RBUTTONUP:517,XBUTTONUP:524,TOUCH:576}))e.hookWindowMessage(t,u);o.on(`input-event`,(e,t)=>{n.has(t.type)&&u()}),o.on(`will-navigate`,(e,t)=>{let n=e.url||t;if(console.log(`will-navigate`,n),!n)return;let r=new URL(n);if(!s(r)){if(!d()){console.log(`blocked navigation`,n),e.preventDefault();return}c(r)&&(console.log(`external navigation`,n),e.preventDefault(),a.openExternal(n))}}),o.session.on(`will-download`,(e,t)=>{let n=t.getURL();/^blob:/.test(n)||e.preventDefault()}),o.setWindowOpenHandler(e=>{console.log(`window-open`,e.url);let{url:t}=e,n=new URL(t);if(!s(n))return d()?(c(n)&&a.openExternal(e.url),{action:`deny`}):(console.log(`blocked navigation`,t),{action:`deny`})})}t.exports=i}),i=n((e,t)=>{var n=new Set([`Mozilla`,`AppleWebKit`,`Chrome`,`Safari`,`Gecko`,`Firefox`,`OPR`,`Edg`,`Version`,`Mobile`,`curl`,`PostmanRuntime`]);async function r(e,t,r){let{webContents:i}=e,a=await i.executeJavaScript(`navigator.userAgent`);a=a.match(/[^\/]+\/[^\s]+( \([^\)]+\))?/g).map(e=>e.trim()).filter(e=>{let[t]=e.split(`/`,1);return n.has(t)}).join(` `),i.setUserAgent(a),t.app.userAgentFallback=a}t.exports=r}),a=r(),o=i();function s(e,t,n={}){a(e,t,n.linkHandler),o(e,t,n.userAgent)}t.exports={setupRevUtils:s,setupLinkHandler:a,setUserAgent:o}}))(),1);function mn(){return{registerWindow:e=>{(0,pn.setupRevUtils)(e,global.OVERLAYED.electron)}}}function hn(e){let t=Qe(global.OVERLAYED.APPLICATION_ID),n=nt(t,{recursive:!0}),r=Xe(),i=nt(r,{recursive:!0});I.getInstance().info(`Logs path: `,t),I.getInstance().info(`Overlayed logs path: `,r);let a=new _;return[...n,...i].forEach(([e,t])=>{I.getInstance().info(`Zipping: `,t);let n=ae(t),r=m(t);a.file(r,n,{compression:`DEFLATE`})}),Object.entries(e?.additionalFiles??{}).forEach(([e,t])=>{I.getInstance().info(`Zipping extra file: `,e),a.file(e,t,{compression:`DEFLATE`})}),a}async function gn(e,t){let n={...e,version:`${global.OVERLAYED.APP_VERSION}@${global.OVERLAYED.APP_BUILD_CHANNEL}`,log_zip:`data:application/zip;base64,${t}`};await fetch(`https://api.stats.cc/v1/overlay/contact`,{method:`POST`,body:JSON.stringify(n),redirect:`follow`,headers:{"Content-Type":`application/json`}})}function _n(e){let t=new et(`app.log`);return t.init(global.OVERLAYED.APPLICATION_ID,e.debug),{scope:e=>t.scope(e),info:e=>t.info(e),warn:e=>t.warn(e),error:e=>t.error(e),debug:e=>t.debug(e),submitBugReport:async(e,t)=>{G.getInstance().track(`bug_report_submitted`,{version:e.version,category:e.category}),await gn(e,await hn(t).generateAsync({type:`base64`}))}}}const vn=1e3;function yn(e,t,r,i,a){let o=L.getInstance();function s(e,t){let n=r.get(t);if(!n)r.set(t,[e]);else{if(n.length>=vn){P.getInstance().warn(`Event buffer full, removing oldest event`,`EVENT_BUFFER_FULL`,{summary:`Event buffer overflow for module ${t}. Buffer size: ${n.length}, max: ${vn}`});return}n.push(e)}}function c(r){let i=Jt(r);if(i instanceof n.errors){G.getInstance().track(`invalid_game_event`,{}),P.getInstance().warn(`Invalid event`,`INVALID_EVENT`,{summary:i.summary});return}let o=e.modules.find(e=>e.key===i.game);if(!o)return;let c=o.events.event,l=c(r);if(l instanceof n.errors){if(`type`in l.byPath)return;G.getInstance().track(`invalid_game_event`,{game:i.game,type:i.type}),P.getInstance().warn(`Invalid event`,`INVALID_EVENT`,{summary:l.summary});return}if(!a[o.key]){s(l,o.key);return}if(l.type===`unsupported_game_version`){let{content:e}=l;G.getInstance().track(`unsupported_game_version`,{game:l.game,hash:e?.hash,version:e?.version})}let u=J(o.key,l.type),d=J(o.key,`*`),f=t.get(u),p=t.get(d),m=[...Array.from(f??[]),...Array.from(p??[])];m.length!==0&&m.forEach(e=>{e(l)})}return i.on(`flushEvents`,e=>{if(a[e])return;a[e]=!0;let t=r.get(e);t&&(I.getInstance().info(`Flushing ${t.length} events for module ${e}`),t.forEach(e=>c(e)),r.delete(e))}),o.on(`data`,e=>e.forEach(c)),o.on(`error`,e=>{P.getInstance().error(`Pipe server error`,`PIPE_SERVER_ERROR`,{error:e})}),o}let Z=!1,bn={},Q,xn=new M,$;function Sn(e){let{init:t=!0,debug:n=!1,silent:r=!0}=e;if(Cn(e),I.getInstance().init(e.applicationId,n,r),Z)return Q;function i(){if(Z)return;sn();let t=new Map,n=new Map,r=$t(e.modules,t,xn),a=en(),o=on(e.keybinds),s=ln(),c=dn(),l=mn(),u=fn(),d=_n(e);wn(e),yn(e,t,n,xn,bn),Z=!0,Q={...r,...a,ads:l,keybinds:o,windows:s,input:c,cortex:u,hasAnyActiveProcesses:()=>U.getInstance().hasAnyActiveProcesses,hasAnyActiveGames:()=>K.getInstance().isInGame,init:i,log:d,initialized:Z}}return t?(i(),Q):new Proxy({init:i},{get:(e,t)=>{if(t!==`init`&&!Z)throw Error(`overlayed was called before initialized: ${t}`);return t===`init`?e[t]:Q[t]}})}global.OVERLAYED=new Proxy({},{get:()=>{throw Error(`function overlayed was not called`)}});function Cn(e){global.OVERLAYED={APPLICATION_ID:St(e.applicationId),APP_BUILD_CHANNEL:e.channel??`alpha`,APP_VERSION:e.version??`0.0.0`,PACKAGE_VERSION:`0.25.2`,FRONTEND_VERSION:`0.0.0`,sessionId:Xt(),electron:e.electron}}function wn(e){let t=e.universal?[`*`]:e.modules.map(e=>e.key);K.getInstance().setSubscribedGames(t),Kt.getInstance().init(),K.getInstance().init(),U.getInstance().init(),H.getInstance().init();async function n(){let e=Ct(global.OVERLAYED.APPLICATION_ID).then(e=>e.data),t=Yt();I.getInstance().log(`userId`,t);let n={...await e,userId:t};return I.getInstance().log(`appInfo`,n),n}let r;global.OVERLAYED.electron.ipcMain.handle(`getAppInfo`,async()=>(r??=n(),r)),G.getInstance().track(`start`,{});try{$&&clearInterval($),$=setInterval(()=>{try{Zt()}catch{}},3e4),$.unref()}catch(e){I.getInstance().log(`failed to start sessionLastUsed interval`,e)}pe.on(`quit`,()=>{G.getInstance().track(`electron_quit`,{}),Tn()}),process.on(`exit`,()=>{G.getInstance().track(`exit`,{}),Tn()})}async function Tn(){try{Zt()}catch{}try{$&&clearInterval($),$=void 0}catch{}await G.getInstance().flush(),H.getInstance().destroy(),K.getInstance().destroy(),Kt.getInstance().destroy(),U.getInstance().destroy(),W.getInstance().getInterface(`OGG_SIEGE`).destroy(),L.getInstance().destroy(),P.getInstance().destroy()}function En(e,t){return e+t}export{ft as RenderInterface,mt as VirtualKey,En as add,at as defineConfig,Sn as overlayed,Lt as setFetchLatestTokenCallback,vt as setUpdaterTokenResolver};
|
|
4
|
+
`,i)}while(r!==-1);return a+=e.slice(i),a}const{stdout:Le,stderr:Re}=Pe,w=Symbol(`GENERATOR`),T=Symbol(`STYLER`),E=Symbol(`IS_EMPTY`),ze=[`ansi`,`ansi`,`ansi256`,`ansi16m`],D=Object.create(null),Be=(e,t={})=>{if(t.level&&!(Number.isInteger(t.level)&&t.level>=0&&t.level<=3))throw Error("The `level` option should be an integer from 0 to 3");let n=Le?Le.level:0;e.level=t.level===void 0?n:t.level},Ve=e=>{let t=(...e)=>e.join(` `);return Be(t,e),Object.setPrototypeOf(t,O.prototype),t};function O(e){return Ve(e)}Object.setPrototypeOf(O.prototype,Function.prototype);for(let[e,t]of Object.entries(b))D[e]={get(){let n=k(this,We(t.open,t.close,this[T]),this[E]);return Object.defineProperty(this,e,{value:n}),n}};D.visible={get(){let e=k(this,this[T],!0);return Object.defineProperty(this,`visible`,{value:e}),e}};const He=(e,t,n,...r)=>e===`rgb`?t===`ansi16m`?b[n].ansi16m(...r):t===`ansi256`?b[n].ansi256(b.rgbToAnsi256(...r)):b[n].ansi(b.rgbToAnsi(...r)):e===`hex`?He(`rgb`,t,n,...b.hexToRgb(...r)):b[n][e](...r);for(let e of[`rgb`,`hex`,`ansi256`]){D[e]={get(){let{level:t}=this;return function(...n){let r=We(He(e,ze[t],`color`,...n),b.color.close,this[T]);return k(this,r,this[E])}}};let t=`bg`+e[0].toUpperCase()+e.slice(1);D[t]={get(){let{level:t}=this;return function(...n){let r=We(He(e,ze[t],`bgColor`,...n),b.bgColor.close,this[T]);return k(this,r,this[E])}}}}const Ue=Object.defineProperties(()=>{},{...D,level:{enumerable:!0,get(){return this[w].level},set(e){this[w].level=e}}}),We=(e,t,n)=>{let r,i;return n===void 0?(r=e,i=t):(r=n.openAll+e,i=t+n.closeAll),{open:e,close:t,openAll:r,closeAll:i,parent:n}},k=(e,t,n)=>{let r=(...e)=>Ge(r,e.length===1?``+e[0]:e.join(` `));return Object.setPrototypeOf(r,Ue),r[w]=e,r[T]=t,r[E]=n,r},Ge=(e,t)=>{if(e.level<=0||!t)return e[E]?``:t;let n=e[T];if(n===void 0)return t;let{openAll:r,closeAll:i}=n;if(t.includes(`\x1B`))for(;n!==void 0;)t=Fe(t,n.close,n.open),n=n.parent;let a=t.indexOf(`
|
|
5
|
+
`);return a!==-1&&(t=Ie(t,i,r,a)),r+t+i};Object.defineProperties(O.prototype,D);const Ke=O();O({level:Re?Re.level:0});var A=Ke,j=class{emitter;constructor(){this.emitter=r()}on(e,t){v(e).forEach(e=>{this.emitter.on(e,t)})}off(e,t){v(e).forEach(e=>{this.emitter.off(e,t)})}emit(e,t){v(e).forEach(e=>{this.emitter.emit(e,t)})}removeAllListeners(){this.emitter.all.clear()}},qe=class{listeners;constructor(){this.listeners=new Map}on(e,t){v(e).forEach(e=>{let n=this.listeners.get(e)||new Set;n.add(t),this.listeners.set(e,n)})}off(e,t){v(e).forEach(e=>{let n=this.listeners.get(e);n&&n.delete(t)})}async emit(e,...t){let n=v(e).flatMap(e=>{let t=this.listeners.get(e)||new Set,n=this.listeners.get(`*`)||new Set;return[...Array.from(t),...Array.from(n)]});return n.length===0?[]:await Promise.all(n.map(async n=>{try{let e=n(...t);return e instanceof Promise?await e:e}catch(t){console.error(`Error in event listener for ${String(e)}:`,t);return}}))}removeAllListeners(){this.listeners.clear()}};function M(e,...t){return class extends e{static _instance;static getInstance(){return this._instance||=new e(...t),this._instance}static clearInstance(){this._instance=void 0}}}const N=M(class extends j{destroy(){this.removeAllListeners()}fatal(e,t,n){this.emit(`fatal`,{code:t,message:e,data:n,timestamp:Date.now()})}error(e,t,n){this.emit(`error`,{code:t,message:e,data:n,timestamp:Date.now()})}warn(e,t,n){this.emit(`warning`,{code:t,message:e,data:n,timestamp:Date.now()})}});var Je=class{data;_schema;_defaultValue;_path;constructor(e){let{schema:t,default:n,path:r}=e;this._schema=t,this._defaultValue=n,this._path=r}set(e){let t=this._schema[`~standard`].validate(e);if(t instanceof Promise)throw Error(`StructuredConfigFile does not support async validation`);if(t.issues){this.reportInvalidConfigFile(t.issues);return}this.data=this.onBeforeSave(e),this.save(e)}get(){return this.data?this.data:this.load()}getKey(e){return this.get()[e]}save(e){let t=this.onBeforeSave(e);try{d(this.getFilePath()),i.writeFileSync(this.getFilePath(),JSON.stringify(t,void 0,2))}catch{return}return this.data=t}load(){if(!this.fileExists(this.getFilePath())||!this.canReadWriteFile(this.getFilePath())){this.save(this._defaultValue);let e=this.onAfterLoad(this._defaultValue);return this.data=e,e}try{let e=i.readFileSync(this.getFilePath(),`utf8`),t=this.onAfterLoad(this.parseStoredData(e));return this.data=t,t}catch{return this.data=this._defaultValue}}onBeforeSave(e){return e}onAfterLoad(e){return e}getFilePath(){return this._path}parseStoredData(e){try{let t=n(`string.json.parse`).to(`object`)(e);if(t instanceof n.errors)return this._defaultValue;let r=this._schema[`~standard`].validate(t);if(r instanceof Promise)throw Error(`StructuredConfigFile does not support async validation`);return r.issues?this.migrate(t,this._defaultValue):this.migrate(r.value,this._defaultValue)}catch{return this._defaultValue}}canReadWriteFile(e){try{return i.accessSync(e,i.constants.R_OK|i.constants.W_OK),!0}catch{return!1}}fileExists(e){try{return i.accessSync(e,i.constants.F_OK),!0}catch{return!1}}migrate(e,t){let n={...e};for(let r in t)Object.prototype.hasOwnProperty.call(t,r)&&(r in e?e[r]!==null&&t[r]!==null&&typeof e[r]==`object`&&typeof t[r]==`object`&&!Array.isArray(e[r])&&!Array.isArray(t[r])?n[r]=this.migrate(e[r],t[r]):Array.isArray(t[r])&&(n[r]=e[r]):n[r]=t[r]);return n}reportInvalidConfigFile(e){N.getInstance().error(`Invalid config file`,`INVALID_CONFIG_FILE`,{issues:e.map(e=>e.message),filePath:this._path,data:this.data})}};function Ye(e,t,n){return typeof e!=`object`||!e?String(e):e instanceof Error?JSON.stringify(e,Object.getOwnPropertyNames(e),n):e instanceof Map?JSON.stringify(Object.fromEntries(e.entries()),t,n):e instanceof Set?JSON.stringify(Array.from(e),t,n):JSON.stringify(e,t,n)}var Xe=class e extends j{stream;logPath;baseFileName;currentDate;rotationCheckInterval;isRotating=!1;constructor(e,t){super(),this.logPath=e,this.baseFileName=t.replace(`.log`,``),this.currentDate=this.getDateString(new Date),this.ensureLogDirectory(),this.ensureLogFile(),this.stream=this.createStream(),this.rotationCheckInterval=this.startRotationCheck(),this.cleanupOldLogs()}static scope(t,n){return new e(t,n)}log(...e){this.write(`log`,...e)}error(...e){this.write(`error`,...e)}warn(...e){this.write(`warn`,...e)}info(...e){this.write(`info`,...e)}debug(...e){this.write(`debug`,...e)}async close(){clearInterval(this.rotationCheckInterval),await new Promise(e=>{this.stream.end(()=>e())})}getCurrentFileName(){return this.getFileName(this.currentDate)}static getMessageElements(e,...t){let n=new Date;return{timestamp:n.toISOString().replace(`T`,` `).replace(/\.\d+Z$/,``)+`.${n.getMilliseconds().toString().padStart(3,`0`)}`,level:e,message:t.map(e=>Ye(e)).join(` `)}}getFileName(e){return`${this.baseFileName}-${e}.log`}ensureLogDirectory(){try{s(this.logPath,{recursive:!0})}catch(e){throw console.error(`Failed to create log directory ${this.logPath}:`,e),e}}ensureLogFile(){let e=f(this.logPath,this.getFileName(this.currentDate));if(!o(e))try{u(e,``,`utf8`)}catch(t){throw console.error(`Failed to create log file ${e}:`,t),t}}getDateString(e){return e.toISOString().split(`T`)[0]}createStream(){return a(f(this.logPath,this.getFileName(this.currentDate)),{flags:`a`,encoding:`utf8`})}async rotateLogs(){if(this.isRotating)return;this.isRotating=!0;let e=this.getDateString(new Date);e!==this.currentDate&&await new Promise(t=>{this.stream.end(()=>{this.currentDate=e,this.stream=this.createStream(),this.cleanupOldLogs(),t()})}),this.isRotating=!1}startRotationCheck(){return setInterval(()=>this.rotateLogs(),6e4)}cleanupOldLogs(){let e=c(this.logPath),t=new Date;t.setDate(t.getDate()-7),e.filter(e=>e.startsWith(this.baseFileName)&&e.endsWith(`.log`)).filter(e=>{let n=e.replace(`${this.baseFileName}-`,``).replace(`.log`,``);return new Date(n)<t}).forEach(e=>{try{l(f(this.logPath,e))}catch(t){console.error(`Failed to delete old log file ${e}:`,t)}})}write(t,...n){let{timestamp:r,message:i}=e.getMessageElements(t,...n),a=`[${r}] [${t}] ${i}\n`;this.stream.write(a,e=>{e?this.emit(`error`,e):this.emit(`write`,a)})}};const P=()=>p.join(process.env.APPDATA??``,`overlayed`),Ze=()=>p.join(P(),`logs`),Qe=e=>p.join(P(),`apps`,e),$e=e=>p.join(Qe(e),`logs`),et=()=>p.join(P(),`meta.json`);var tt=class{fileLogger;path;appId;messageQueue=new Ce;fileName;_debug=!1;silent=!1;constructor(e){this.fileName=e}init(e,t=!1,n=!1){this.appId=e,this._debug=t,this.silent=n,this.path=$e(e),this.fileLogger=new Xe(this.path,this.fileName),this.messageQueue.flush().forEach(e=>{this.fileLogger?.[e.type](...e.args)})}scope(e){if(!this.appId||!this.path)throw Error(`Logger not initialized`);let t=`[${e}]`;return{scope:e=>this.scope(e),error:(...e)=>this.error(t,...e),warn:(...e)=>this.warn(t,...e),info:(...e)=>this.info(t,...e),log:(...e)=>this.log(t,...e),debug:(...e)=>this.debug(t,...e)}}error(...e){this.handle(`error`,...e)}warn(...e){this.handle(`warn`,...e)}info(...e){this.handle(`log`,...e)}debug(...e){this._debug&&this.handle(`debug`,...e)}log(...e){this.handle(`log`,...e)}handle(e,...t){this.logToConsole(e,...t),this.fileLogger?this.fileLogger[e](...t):this.messageQueue.add({type:e,args:t})}logToConsole(e,...t){let n={error:A.red,warn:A.yellow,debug:A.blue,log:A.white};if(this.silent&&!this._debug)return;let{timestamp:r,message:i}=Xe.getMessageElements(e,...t),a=console[e],o=n[e];a(`${A.gray(r)} ${o(i)}`)}};const F=M(tt,`overlayed.log`);var nt=class extends re{blob;chunkSizeMb;maxConcurrent;shouldStop=!1;constructor(e,t){super(),this.blob=e,this.chunkSizeMb=t.chunkSizeMb,this.maxConcurrent=t.maxConcurrent??3}get totalChunks(){return Math.ceil(this.blob.size/(this.chunkSizeMb*1024*1024))}async chunk(e){let t=this.chunkSizeMb*1024*1024,n=this.totalChunks;if(n===0)return;let r=new Map,i=new Set,a=new Set,o=[];for(let e=0;e<n;e++)o.push(e);let s=async n=>{let s=n*t,c=Math.min(s+t,this.blob.size),l=this.blob.slice(s,c);try{await e(l,n),a.add(n),this.emit(`chunkComplete`,n),i.delete(n)}catch(e){let t=r.get(n)||0;t<5?(r.set(n,t+1),await new Promise(e=>setTimeout(e,(t+1)*1e3)),o.push(n)):(a.add(n),this.emit(`error`,e),this.shouldStop=!0,i.delete(n))}},c=[],l=async()=>{for(;(o.length>0||i.size>0)&&!this.shouldStop;){if(o.length===0){await new Promise(e=>setTimeout(e,10));continue}let e=o.shift();a.has(e)||i.has(e)||(i.add(e),await s(e))}};for(let e=0;e<this.maxConcurrent;e++)c.push(l());await Promise.all(c)}};function rt(e,t){let{recursive:n}=it(t);return oe(e)?n?at(e).map(t=>[e,t]):le(e).map(t=>[e,t]):[]}function it(e){return{recursive:e?.recursive??!0}}function at(e){return le(e,{withFileTypes:!0}).flatMap(t=>{let n=p.join(e,t.name);return t.isDirectory()?at(n):[n]})}function ot(e){return e}const{PipeEventServer:st,PipeEventClient:ct,PipeEventBase:lt,ProcessMonitor:ut,Process:dt,HardwareInterface:ft}=e(import.meta.url)(`@overlayed/app/dist/native-interface/build/overlayed_native_interface_x64.node`),I=M(class extends j{server=null;_hasConnection=!1;pipeId;get hasConnection(){return this._hasConnection}constructor(e){super(),this.pipeId=e,this.init()}destroy(){this.server&&=(this._hasConnection=!1,this.server?.removeAllListeners(),null)}init(){this.server=new st(this.pipeId,{clientCount:1,access:1}),this.server.on(`event`,e=>{try{let t=JSON.parse(e);this.emit(`data`,[t])}catch(e){this.emit(`error`,e)}}),this.server.on(`connected`,()=>{this._hasConnection=!0}),this.server.on(`disconnected`,()=>{this._hasConnection=!1})}},`stats-cc`),{RenderInterface:pt,renderHookPath:mt}=e(import.meta.url)(`@overlayed/app/dist/render-interface/build/overlayed_render_interface_x64.node`);let ht=function(e){return e[e.LeftButton=1]=`LeftButton`,e[e.RightButton=2]=`RightButton`,e[e.Cancel=3]=`Cancel`,e[e.MiddleButton=4]=`MiddleButton`,e[e.ExtraButton1=5]=`ExtraButton1`,e[e.ExtraButton2=6]=`ExtraButton2`,e[e.Back=8]=`Back`,e[e.Tab=9]=`Tab`,e[e.Clear=12]=`Clear`,e[e.Return=13]=`Return`,e[e.Shift=16]=`Shift`,e[e.Control=17]=`Control`,e[e.Menu=18]=`Menu`,e[e.Pause=19]=`Pause`,e[e.CapsLock=20]=`CapsLock`,e[e.Kana=21]=`Kana`,e[e.Hangeul=21]=`Hangeul`,e[e.Hangul=21]=`Hangul`,e[e.Junja=23]=`Junja`,e[e.Final=24]=`Final`,e[e.Hanja=25]=`Hanja`,e[e.Kanji=25]=`Kanji`,e[e.Escape=27]=`Escape`,e[e.Convert=28]=`Convert`,e[e.NonConvert=29]=`NonConvert`,e[e.Accept=30]=`Accept`,e[e.ModeChange=31]=`ModeChange`,e[e.Space=32]=`Space`,e[e.Prior=33]=`Prior`,e[e.Next=34]=`Next`,e[e.End=35]=`End`,e[e.Home=36]=`Home`,e[e.Left=37]=`Left`,e[e.Up=38]=`Up`,e[e.Right=39]=`Right`,e[e.Down=40]=`Down`,e[e.Select=41]=`Select`,e[e.Print=42]=`Print`,e[e.Execute=43]=`Execute`,e[e.Snapshot=44]=`Snapshot`,e[e.Insert=45]=`Insert`,e[e.Delete=46]=`Delete`,e[e.Help=47]=`Help`,e[e.N0=48]=`N0`,e[e.N1=49]=`N1`,e[e.N2=50]=`N2`,e[e.N3=51]=`N3`,e[e.N4=52]=`N4`,e[e.N5=53]=`N5`,e[e.N6=54]=`N6`,e[e.N7=55]=`N7`,e[e.N8=56]=`N8`,e[e.N9=57]=`N9`,e[e.A=65]=`A`,e[e.B=66]=`B`,e[e.C=67]=`C`,e[e.D=68]=`D`,e[e.E=69]=`E`,e[e.F=70]=`F`,e[e.G=71]=`G`,e[e.H=72]=`H`,e[e.I=73]=`I`,e[e.J=74]=`J`,e[e.K=75]=`K`,e[e.L=76]=`L`,e[e.M=77]=`M`,e[e.N=78]=`N`,e[e.O=79]=`O`,e[e.P=80]=`P`,e[e.Q=81]=`Q`,e[e.R=82]=`R`,e[e.S=83]=`S`,e[e.T=84]=`T`,e[e.U=85]=`U`,e[e.V=86]=`V`,e[e.W=87]=`W`,e[e.X=88]=`X`,e[e.Y=89]=`Y`,e[e.Z=90]=`Z`,e[e.LeftWindows=91]=`LeftWindows`,e[e.RightWindows=92]=`RightWindows`,e[e.Application=93]=`Application`,e[e.Sleep=95]=`Sleep`,e[e.Numpad0=96]=`Numpad0`,e[e.Numpad1=97]=`Numpad1`,e[e.Numpad2=98]=`Numpad2`,e[e.Numpad3=99]=`Numpad3`,e[e.Numpad4=100]=`Numpad4`,e[e.Numpad5=101]=`Numpad5`,e[e.Numpad6=102]=`Numpad6`,e[e.Numpad7=103]=`Numpad7`,e[e.Numpad8=104]=`Numpad8`,e[e.Numpad9=105]=`Numpad9`,e[e.Multiply=106]=`Multiply`,e[e.Add=107]=`Add`,e[e.Separator=108]=`Separator`,e[e.Subtract=109]=`Subtract`,e[e.Decimal=110]=`Decimal`,e[e.Divide=111]=`Divide`,e[e.F1=112]=`F1`,e[e.F2=113]=`F2`,e[e.F3=114]=`F3`,e[e.F4=115]=`F4`,e[e.F5=116]=`F5`,e[e.F6=117]=`F6`,e[e.F7=118]=`F7`,e[e.F8=119]=`F8`,e[e.F9=120]=`F9`,e[e.F10=121]=`F10`,e[e.F11=122]=`F11`,e[e.F12=123]=`F12`,e[e.F13=124]=`F13`,e[e.F14=125]=`F14`,e[e.F15=126]=`F15`,e[e.F16=127]=`F16`,e[e.F17=128]=`F17`,e[e.F18=129]=`F18`,e[e.F19=130]=`F19`,e[e.F20=131]=`F20`,e[e.F21=132]=`F21`,e[e.F22=133]=`F22`,e[e.F23=134]=`F23`,e[e.F24=135]=`F24`,e[e.NumLock=144]=`NumLock`,e[e.ScrollLock=145]=`ScrollLock`,e[e.NEC_Equal=146]=`NEC_Equal`,e[e.Fujitsu_Jisho=146]=`Fujitsu_Jisho`,e[e.Fujitsu_Masshou=147]=`Fujitsu_Masshou`,e[e.Fujitsu_Touroku=148]=`Fujitsu_Touroku`,e[e.Fujitsu_Loya=149]=`Fujitsu_Loya`,e[e.Fujitsu_Roya=150]=`Fujitsu_Roya`,e[e.LeftShift=160]=`LeftShift`,e[e.RightShift=161]=`RightShift`,e[e.LeftControl=162]=`LeftControl`,e[e.RightControl=163]=`RightControl`,e[e.LeftMenu=164]=`LeftMenu`,e[e.RightMenu=165]=`RightMenu`,e[e.BrowserBack=166]=`BrowserBack`,e[e.BrowserForward=167]=`BrowserForward`,e[e.BrowserRefresh=168]=`BrowserRefresh`,e[e.BrowserStop=169]=`BrowserStop`,e[e.BrowserSearch=170]=`BrowserSearch`,e[e.BrowserFavorites=171]=`BrowserFavorites`,e[e.BrowserHome=172]=`BrowserHome`,e[e.VolumeMute=173]=`VolumeMute`,e[e.VolumeDown=174]=`VolumeDown`,e[e.VolumeUp=175]=`VolumeUp`,e[e.MediaNextTrack=176]=`MediaNextTrack`,e[e.MediaPrevTrack=177]=`MediaPrevTrack`,e[e.MediaStop=178]=`MediaStop`,e[e.MediaPlayPause=179]=`MediaPlayPause`,e[e.LaunchMail=180]=`LaunchMail`,e[e.LaunchMediaSelect=181]=`LaunchMediaSelect`,e[e.LaunchApplication1=182]=`LaunchApplication1`,e[e.LaunchApplication2=183]=`LaunchApplication2`,e[e.OEM1=186]=`OEM1`,e[e.OEMPlus=187]=`OEMPlus`,e[e.OEMComma=188]=`OEMComma`,e[e.OEMMinus=189]=`OEMMinus`,e[e.OEMPeriod=190]=`OEMPeriod`,e[e.OEM2=191]=`OEM2`,e[e.OEM3=192]=`OEM3`,e[e.OEM4=219]=`OEM4`,e[e.OEM5=220]=`OEM5`,e[e.OEM6=221]=`OEM6`,e[e.OEM7=222]=`OEM7`,e[e.OEM8=223]=`OEM8`,e[e.OEMAX=225]=`OEMAX`,e[e.OEM102=226]=`OEM102`,e[e.ICOHelp=227]=`ICOHelp`,e[e.ICO00=228]=`ICO00`,e[e.ProcessKey=229]=`ProcessKey`,e[e.ICOClear=230]=`ICOClear`,e[e.Packet=231]=`Packet`,e[e.OEMReset=233]=`OEMReset`,e[e.OEMJump=234]=`OEMJump`,e[e.OEMPA1=235]=`OEMPA1`,e[e.OEMPA2=236]=`OEMPA2`,e[e.OEMPA3=237]=`OEMPA3`,e[e.OEMWSCtrl=238]=`OEMWSCtrl`,e[e.OEMCUSel=239]=`OEMCUSel`,e[e.OEMATTN=240]=`OEMATTN`,e[e.OEMFinish=241]=`OEMFinish`,e[e.OEMCopy=242]=`OEMCopy`,e[e.OEMAuto=243]=`OEMAuto`,e[e.OEMENLW=244]=`OEMENLW`,e[e.OEMBackTab=245]=`OEMBackTab`,e[e.ATTN=246]=`ATTN`,e[e.CRSel=247]=`CRSel`,e[e.EXSel=248]=`EXSel`,e[e.EREOF=249]=`EREOF`,e[e.Play=250]=`Play`,e[e.Zoom=251]=`Zoom`,e[e.Noname=252]=`Noname`,e[e.PA1=253]=`PA1`,e[e.OEMClear=254]=`OEMClear`,e}({});var gt=class{logger;initialized=!1;constructor(e){this.logger=F.getInstance().scope(e)}init(){this.logger.log(`Initializing`),this.initialized=!0}destroy(){this.logger.log(`Destroying`),this.initialized=!1}},L=class extends j{logger;initialized=!1;constructor(e){super(),this.logger=F.getInstance().scope(e)}init(){this.logger.log(`Initializing`),this.initialized=!0}destroy(){this.logger.log(`Destroying`),this.initialized=!1,this.removeAllListeners()}},_t=class extends qe{logger;initialized=!1;constructor(e){super(),this.logger=F.getInstance().scope(e)}init(){this.logger.log(`Initializing`),this.initialized=!0}destroy(){this.logger.log(`Destroying`),this.initialized=!1,this.removeAllListeners()}};const R=de.create({baseURL:`https://updater.stats.cc`,headers:{Accept:`application/json`,"Accept-Encoding":`gzip, deflate, br`}});let vt;function yt(e){vt=e}R.interceptors.request.use(e=>{let t=vt?.();return t?(e.headers??={},e.headers.Authorization=t,e):e});const z=de.create({baseURL:`https://api.overlayed.gg`,headers:{Accept:`application/json`,"Accept-Encoding":`gzip, deflate, br`}});z.interceptors.request.use(e=>(e.headers??={},e));function bt(e,t){if(t<=0)throw Error(`Chunk size must be greater than 0`);if(e.length===0)return[];let n=[];for(let r=0;r<e.length;r+=t)n.push(e.slice(r,r+t));return n}function xt(e){return e}function St(e){return e?t=>(e(t),t):xt}const Ct=St();function wt(e){return z.get(`/v1/public/applications/${e}`)}function Tt(e,t,n){return R.get(`/v1/native/${Dt(e)}/version.txt`,{params:{channel:t},responseType:`text`,headers:{"X-App-Version":Ot(n,t)}})}function Et(e,t,n){return R.get(`/v1/native/${Dt(e)}/files`,{params:{channel:t},responseType:`arraybuffer`,headers:{"X-App-Version":Ot(n,t)}})}function Dt(e){return e===`01JXPFK6YQ3N00N2Y9JHFNG55D`||e===`01JZEBPGHT5M4Y6SGY4P7Q9EZT`?`siege-game-module`:e}function Ot(e,t){return`desktop-application/${e} (channel=${t})`}function kt(){return z.get(`/v1/public/raven/config`)}function At(e,t){return z.get(`/v1/public/raven/games/${e}/builds/${t}`)}function jt(e,t){return z.post(`/v1/public/raven/games/${e}/builds/upload`,null,{params:t})}function Mt(e,t){let n=new FormData;return n.append(`file`,t.chunk),z.patch(`/v1/public/raven/games/${e}/builds/upload`,n,{params:t})}function Nt(e){let t=Date.now(),n=bt(e.messages.map(e=>Pt(t,e)),250),r=Promise.all(n.map(async t=>z.post(`/v1/public/cortex/events`,{...e,messages:t})));return r.catch(e=>{let t=e?.response?.data||e?.message||e;console.error(`Failed to submit cortex events`,t)}),r}function Pt(e,t){let n=e-t.created_at.getTime(),r=Math.max(0,Math.floor(n/1e3));return{properties:t.properties,type:t.type,seconds_offset:r}}function Ft(e){return e instanceof Error&&(e.name===`XiorError`||e.name===`XiorTimeoutError`)}function It(e){return!!(e&&`kind`in e.data&&`message`in e.data)}let Lt;function Rt(e){Lt=e}const B=M(class extends L{UPDATE_CHECK_INTERVAL_MS=1e3*60*5;targetDir;updateInterval;constructor(){super(`NativeModuleManager`),this.targetDir=p.join(P(),`resources`),this.logger.log(`Target directory`,this.targetDir)}async initWithDlls(e){super.init(),await g.mkdir(this.targetDir,{recursive:!0}),await this.checkForUpdates(e),clearInterval(this.updateInterval),this.updateInterval=setInterval(()=>this.checkForUpdates(e),this.UPDATE_CHECK_INTERVAL_MS)}destroy(){this.updateInterval&&=(clearInterval(this.updateInterval),void 0),super.destroy()}async getCurrentVersion(e){try{let t=p.join(this.targetDir,e,`version.txt`);return this.logger.log(`Version Path`,t),await g.readFile(t,`utf-8`)}catch{return null}}getTargetPath(e){return p.join(this.targetDir,e)}getTargetVersionPath(e,t){return p.join(this.getTargetPath(e),t)}async checkForUpdates(e){let t=global.OVERLAYED.APP_BUILD_CHANNEL;if(this.logger.log(`Checking for updates`),!t){this.logger.error(`Invalid VITE_BUILD_CHANNEL`);return}await Lt?.();for(let n of e)try{let{data:e}=await Tt(n,t,global.OVERLAYED.APP_VERSION),r=await this.getCurrentVersion(n);this.logger.log(`${n} > Update Check. current: ${r}, latest: ${e}`);let i=e!==r,a=!1;if(!i){let t=this.getTargetVersionPath(n,e);await this.hasPathAccess(t)?(await g.readdir(t)).length===0&&(a=!0,this.logger.warn(`${n} > Version path exists, but no files. Forcing download.`)):(a=!0,this.logger.warn(`${n} > Version path does not exist. Forcing download.`))}i||a?(this.logger.log(`${n} > Update found: ${r} -> ${e}`),await this.downloadAndExtractDll(n,e,t),this.logger.log(`${n} > Downloaded and extracted`),await this.cleanupOldVersions(n,e),this.logger.log(`${n} > Cleaned up versions older than ${e}`),this.emit(`dllUpdated`,{identifier:n,version:e})):this.logger.log(`${n} > No update found`)}catch(e){this.logger.error(`${n} > Error checking/updating`,e)}}async downloadAndExtractDll(e,t,n){this.logger.log(`${e} > Downloading DLLs for version ${t}`);let{data:r}=await Et(e,n,global.OVERLAYED.APP_VERSION);this.logger.log(`${e} > Downloaded DLLs for version ${t}`);let i=this.getTargetPath(e),a=this.getTargetVersionPath(e,t);await g.mkdir(a,{recursive:!0});let o=new _;await o.loadAsync(r);let s=Object.keys(o.files).map(async t=>{let n=o.files[t];if(n&&!n.dir){let r=p.join(a,t),i=await n.async(`nodebuffer`);await g.writeFile(r,i),this.logger.log(`${e} > Extracted DLL: ${t}`)}});await Promise.all(s);let c=p.join(i,`version.txt`);await g.writeFile(c,t),this.logger.log(`${e} > Saved version file: ${t}`)}async cleanupOldVersions(e,t){let n=p.join(this.targetDir,e),r=await g.readdir(n,{withFileTypes:!0});for(let e of r)e.isDirectory()&&e.name!==t&&await g.rm(p.join(n,e.name),{recursive:!0,force:!0})}async hasPathAccess(e){try{return await g.access(e,g.constants.F_OK),!0}catch{return!1}}}),V=M(class extends L{REFETCH_INTERVAL=1e3*60*5;FAILED_REFETCH_INTERVAL=1e3*30;_ravenConfig;_executableToGameMap=new Map;_executablesArray=[];_refetchIntervalHandler=null;_failedRefetchTimeoutHandler=null;constructor(){super(`RavenManager`)}init(){super.init(),this.fetchRavenConfig(),this._refetchIntervalHandler=setInterval(()=>{this._failedRefetchTimeoutHandler&&=(clearTimeout(this._failedRefetchTimeoutHandler),null),this.fetchRavenConfig()},this.REFETCH_INTERVAL)}getExecutableData(e){return this._executableToGameMap.get(e.toLowerCase())??null}get executables(){return this._executablesArray}get executablesMap(){return this._executableToGameMap}destroy(){this._refetchIntervalHandler&&clearInterval(this._refetchIntervalHandler),this._failedRefetchTimeoutHandler&&clearTimeout(this._failedRefetchTimeoutHandler),B.getInstance().destroy(),super.destroy()}async fetchRavenConfig(){try{this._ravenConfig={games:(await kt()).data.games},this.resetState();let e=new Set;for(let t of this._ravenConfig.games){for(let e of t.executables){let n=e.toLowerCase();this._executableToGameMap.set(n,t),this._executablesArray.push(n)}t.modules.forEach(t=>e.add(t))}await B.getInstance().initWithDlls(Array.from(e)),this.logger.log(`Raven updated, monitoring ${this._executableToGameMap.size} executables`),this.emit(`executablesUpdated`,{executables:this.executables,map:this._executableToGameMap})}catch(e){this.logger.error(`Failed to fetch Raven config`,e),this._failedRefetchTimeoutHandler=setTimeout(()=>this.fetchRavenConfig(),this.FAILED_REFETCH_INTERVAL)}}resetState(){this._executableToGameMap.clear(),this._executablesArray=[]}}),{PipeEventServer:zt,PipeEventClient:Bt,PipeEventBase:Vt,ProcessMonitor:Ht,Process:Ut,HardwareInterface:Wt}=e(import.meta.url)(`@overlayed/app/dist/native-interface/build/overlayed_native_interface_x64.node`),H=M(class extends L{_processMonitor;_processes=new Map;boundOnRavenManagerExecutablesUpdated=this.onRavenManagerExecutablesUpdated.bind(this);constructor(){super(`ProcessManager`),this._processMonitor=new Ht}get hasAnyActiveProcesses(){return this.activeProcesses.length>0}get activeProcesses(){return Array.from(this._processes.values()).flat().filter(e=>!e.destroyedAt)}init(){super.init(),V.getInstance().on(`executablesUpdated`,this.boundOnRavenManagerExecutablesUpdated),this._processMonitor.on(`create`,e=>{this.logger.log(`Process created`,e),this.addProcess(e),this.logger.log(`Active Process Count: ${this._processes.size}`),this.emit(`create`,{process:e})}),this._processMonitor.on(`destroy`,e=>{this.logger.log(`Process destroyed`,e),this.deleteProcess(e),this.logger.log(`Active Process Count: ${this._processes.size}`),this.emit(`destroy`,{process:e})})}destroy(){V.getInstance().off(`executablesUpdated`,this.boundOnRavenManagerExecutablesUpdated),this._processes.clear(),this._processMonitor.removeAllListeners(),super.destroy()}isProcessRunning(e){return this._processes.get(e)?.some(e=>!e.destroyedAt)??!1}onRavenManagerExecutablesUpdated(e){this.logger.log(`Monitoring ${e.executables.length} processes`),e.executables.forEach(e=>{this._processMonitor.registerProcess(e)})}addProcess(e){if(!e.name)return;let t=this._processes.get(e.name);if(!t){this._processes.set(e.name,[e]);return}this._processes.set(e.name,t.concat(e))}deleteProcess(e){if(!e.name)return;let t=this._processes.get(e.name)?.filter(t=>t.id!==e.id)??[];t.length===0?this._processes.delete(e.name):this._processes.set(e.name,t)}});var Gt=class{_instance;_resolution;boundOnResolutionChanged=this.onResolutionChanged.bind(this);constructor(e){this._instance=e,this._resolution={width:0,height:0},this._instance.on(`resolution`,this.boundOnResolutionChanged)}destroy(){this._instance.off(`resolution`,this.boundOnResolutionChanged)}get instance(){return this._instance}get resolution(){return this._resolution}onResolutionChanged(e,t){this._resolution={width:e,height:t}}};const U=M(class{interfaces={};constructor(){}createInterface(e){return this.interfaces[e]||(this.interfaces[e]=new Gt(new pt(e,{access:1}))),this.interfaces[e]}getInterface(e){return this.interfaces[e]?this.interfaces[e]:this.createInterface(e)}}),W=M(class{options;eventQueue;meta=null;constructor(e){this.options=this.resolveOptions(e),this.eventQueue=new Ce,this.setupFlushInterval()}track(e,t){this.eventQueue.add({type:e,properties:t,created_at:new Date})}flush(){let e=Array.from(this.eventQueue.flush()).concat({type:`ping`,properties:{},created_at:new Date});if(!this.meta)throw Error(`Tried to flush Cortex events before meta was set`);try{Nt({...this.meta,messages:e})}catch{}return e}setupFlushInterval(){setInterval(()=>{this.flush()},this.options.batchIntervalSeconds*1e3)}resolveOptions(e){return{batchIntervalSeconds:e?.batchIntervalSeconds??15}}});function Kt(e=[]){return p.normalize(p.join(Qe(global.OVERLAYED.APPLICATION_ID),...e))}const qt=n({game:`string`,type:`string`,creation_time:`number`}),G=new Je({path:et(),schema:n({userId:`string | undefined`,sessionId:`string | undefined`,sessionLastUsed:`number | undefined`,"debug?":{"ri_disabled?":`boolean`,"gm_disabled?":`boolean`}}),default:{userId:void 0,sessionId:void 0,sessionLastUsed:void 0}});function Jt(){let{debug:e}=G.get();return e?{ri_disabled:e.ri_disabled??!1,gm_disabled:e.gm_disabled??!1}:{ri_disabled:!1,gm_disabled:!1}}function Yt(){let e=G.get().userId;if(e)return e;let t=Qt();return G.set({...G.get(),userId:t}),t}function Xt(){let e=G.get();if(e.sessionId&&typeof e.sessionLastUsed==`number`&&Date.now()-e.sessionLastUsed<=300*1e3)return e.sessionId;let t=crypto.randomUUID();return G.set({...e,sessionId:t,sessionLastUsed:Date.now()}),t}function Zt(){try{let e=G.get();G.set({...e,sessionLastUsed:Date.now()})}catch(e){F.getInstance().log(`Failed to update sessionLastUsed`,e)}}function Qt(){try{return Wt.generateUniqueIdentifier()}catch{return crypto.randomUUID()}}const $t=e(import.meta.url).resolve(`@overlayed/app/dist/render-interface/build/overlayed_render_hook_x64.dll`),K=M(class extends _t{boundOnProcessCreate=this.onProcessCreate.bind(this);boundOnProcessDestroy=this.onProcessDestroy.bind(this);subscribedGames=new Set;_activeReadyRavenGames=new Set;get isInGame(){return this._activeReadyRavenGames.size>0}constructor(){super(`GameLaunchManager`)}setSubscribedGames(e){this.subscribedGames=new Set(e)}init(){super.init(),U.getInstance().createInterface(`OGG_SIEGE`),H.getInstance().on(`create`,this.boundOnProcessCreate),H.getInstance().on(`destroy`,this.boundOnProcessDestroy)}destroy(){H.getInstance().off(`create`,this.boundOnProcessCreate),H.getInstance().off(`destroy`,this.boundOnProcessDestroy),super.destroy()}async onProcessCreate({process:e}){let t=this.getRavenGame(e);if(!t)return;if(this.subscribedGames.size===0){this.logger.warn(`No subscribed games, skipping`);return}if(W.getInstance().track(`game_launch`,{game:t.identifier}),!this.subscribedGames.has(t.identifier)&&!this.subscribedGames.has(`*`))return;let n=new AbortController;if(await this.emit(`gameLaunch`,{game:t.identifier,reject:()=>n.abort()}),n.signal.aborted)return;let r=Ut.currentProcess;if(this.logger.log(`Game Launched`,t),this.logger.log(`Process is elevated: `,e.isElevated),this.logger.log(`Current process is elevated: `,r.isElevated),e.isElevated&&!r.isElevated){N.getInstance().fatal(`Game is elevated but the App is not`,`ELEVATION_MISMATCH`,{appElevated:!!r.isElevated,gameElevated:!!e.isElevated}),this.logger.log(`Game elevated but App is not`,{appElevated:r.isElevated,gameElevated:e.isElevated});return}let i=this.copyDll($t),a=Jt();if(a.ri_disabled&&this.logger.log(`Skipping render interface injection due to meta debug`,{renderInterfacePath:i}),i&&!a.ri_disabled)try{await e.injectDll(i),this.logger.log(`Render Interface Injection Successful`,i)}catch(e){this.logger.error(`Render Interface Injection Failed`,e),this.logger.error(`Render Interface Injection Failed`,{renderInterfacePath:i})}let o=t?.modules.map(async t=>{let n=await B.getInstance().getCurrentVersion(t);if(!n)return this.logger.error(`No version found for DLL`,{identifier:t}),Promise.resolve();let r=B.getInstance().getTargetVersionPath(t,n);this.logger.log(`DLL Path`,r);let i=await this.getDllFiles(r);return this.logger.log(`DLL Files`,i),Promise.all(i.map(async t=>{let n=p.basename(t),i=p.join(r,n);if(!i)return Promise.resolve();if(a.gm_disabled)return this.logger.log(`Skipping injection due to meta debug`,{targetPath:i}),Promise.resolve();this.logger.log(`Injecting: `,i);try{return e.injectDll(i).then(()=>{this.logger.log(`Injection Successful`,i)}).catch(e=>{this.logger.error(`Injection Failed [1]`,{targetPath:i},e)})}catch(e){return this.logger.error(`Injection Failed [2]`,{targetPath:i},e),Promise.reject(e)}}))});await Promise.allSettled(o),this._activeReadyRavenGames.add(t.identifier),this.logger.debug(`Active ready raven games`,Array.from(this._activeReadyRavenGames).join(`, `)),this.emit(`gameReadyInternal`,{ravenGame:t,process:e}),this.emit(`gameReady`,{game:t.identifier}),W.getInstance().track(`game_ready`,{game:t.identifier})}copyDll(e){let t=p.basename(e),n=ee(e),r=p.join(P(),`resources`),i=p.join(r,t);this.logger.info(`Copying`,n,`to`,i);try{oe(r)||se(r,{recursive:!0}),ue(i,ce(n)),ie(n,i)}catch(e){return e.code===`EBUSY`?i:(this.logger.error(`Failed to copy`,e),this.logger.error(`Failed to copy`,{originalPath:n,targetPath:i}),!1)}return i}async getDllFiles(e){try{return(await g.readdir(e)).filter(e=>e.endsWith(`.dll`)).map(t=>p.join(e,t))}catch(t){return this.logger.error(`Failed to read DLL directory`,t),this.logger.error(`Failed to read DLL directory`,{dllPath:e}),[]}}onProcessDestroy({process:e}){let t=this.getRavenGame(e);t&&(this._activeReadyRavenGames.delete(t.identifier),this.logger.debug(`Active ready raven games`,Array.from(this._activeReadyRavenGames).join(`, `)),this.emit(`gameCloseInternal`,{ravenGame:t,process:e}),this.emit(`gameClose`,{game:t.identifier}),W.getInstance().track(`game_close`,{game:t.identifier}))}getRavenGame(e){if(!e.name)return;let t=V.getInstance().getExecutableData(e.name);if(!t){this.logger.error(`No raven game found for process`,{process:e});return}return t}}),en=M(class extends gt{boundOnGameLaunch=this.onGameLaunch.bind(this);constructor(){super(`GameBuildManager`)}init(){super.init(),K.getInstance().on(`gameReadyInternal`,this.boundOnGameLaunch)}destroy(){K.getInstance().off(`gameReadyInternal`,this.boundOnGameLaunch),super.destroy()}async onGameLaunch(...e){let[{ravenGame:t,process:n}]=e;if(!n.path||!n.name){this.logger.error(`Process path or name not found, could not check for build hash`,void 0,n);return}let r=ce(n.path),i=fe(`sha256`).update(r).digest(`hex`);this.logger.log(`Process Path`,n.path),this.logger.log(`Process Name`,n.name),this.logger.log(`Build Hash`,i);let a=!1;try{a=(await At(t.identifier,i)).data.upload}catch(e){this.logger.error(`Error checking game build hash`,e);return}if(!a){this.logger.log(`Build hash already exists, skipping upload`);return}let o=new _;o.file(n.name,r);let s=await o.generateAsync({type:`blob`});try{this.logger.log(`Uploading build (size: `,s.size,` bytes)`);let e=new nt(s,{chunkSizeMb:25,maxConcurrent:1}),n=await jt(t.identifier,{build_hash:i,chunk_count:e.totalChunks,file_size_bytes:s.size});await e.chunk(async(e,r)=>{this.logger.log(`Uploading chunk`,r),await Mt(t.identifier,{chunk:e,build_hash:i,chunk_index:r,upload_token:n.data.upload_token})}),this.logger.log(`Build uploaded successfully`)}catch(e){Ft(e)?It(e.response)?this.logger.error(`Error uploading build hash, api error`,e):this.logger.error(`Error uploading build hash, request error`,e):this.logger.error(`Error uploading build hash, unknown error`,e)}}});function q(e,t){return`${e}:${t}`}function tn(e,t,n){return e.reduce((e,r)=>{let i=r.key;return e[i]={on(e,n){let r=q(i,e),a=t.get(r)??new Set;a.add(n),t.set(r,a)},onAny(e){let n=q(i,`*`),r=t.get(n)??new Set;r.add(e),t.set(n,r)},off(e,n){let r=q(i,e),a=t.get(r);a&&(a.delete(n),a.size===0&&t.delete(r))},offAny(e){let n=q(i,`*`),r=t.get(n);r&&(r.delete(e),r.size===0&&t.delete(n))},readyForGameEvents:()=>{n.emit(`flushEvents`,i)}},e},{})}function nn(){let e=N.getInstance(),t=K.getInstance();return{on:(n,r)=>{switch(n){case`fatal`:e.on(`fatal`,r);break;case`error`:e.on(`error`,r);break;case`warning`:e.on(`warning`,r);break;case`gameLaunch`:t.on(`gameLaunch`,r);break;case`gameClose`:t.on(`gameClose`,r);break;case`gameReady`:t.on(`gameReady`,r);break;default:throw Error(`Event type not implemented ${n}`,{cause:[n,r]})}},off:(n,r)=>{switch(n){case`fatal`:e.off(`fatal`,r);break;case`error`:e.off(`error`,r);break;case`warning`:e.off(`warning`,r);break;case`gameLaunch`:t.off(`gameLaunch`,r);break;case`gameClose`:t.off(`gameClose`,r);break;case`gameReady`:t.off(`gameReady`,r);break;default:throw Error(`Event type not implemented ${n}`,{cause:[n,r]})}}}}var J=function(e){return e[e.LeftButton=1]=`LeftButton`,e[e.RightButton=2]=`RightButton`,e[e.Cancel=3]=`Cancel`,e[e.MiddleButton=4]=`MiddleButton`,e[e.ExtraButton1=5]=`ExtraButton1`,e[e.ExtraButton2=6]=`ExtraButton2`,e[e.Back=8]=`Back`,e[e.Tab=9]=`Tab`,e[e.Clear=12]=`Clear`,e[e.Return=13]=`Return`,e[e.Shift=16]=`Shift`,e[e.Control=17]=`Control`,e[e.Menu=18]=`Menu`,e[e.Pause=19]=`Pause`,e[e.CapsLock=20]=`CapsLock`,e[e.Kana=21]=`Kana`,e[e.Hangeul=21]=`Hangeul`,e[e.Hangul=21]=`Hangul`,e[e.Junja=23]=`Junja`,e[e.Final=24]=`Final`,e[e.Hanja=25]=`Hanja`,e[e.Kanji=25]=`Kanji`,e[e.Escape=27]=`Escape`,e[e.Convert=28]=`Convert`,e[e.NonConvert=29]=`NonConvert`,e[e.Accept=30]=`Accept`,e[e.ModeChange=31]=`ModeChange`,e[e.Space=32]=`Space`,e[e.Prior=33]=`Prior`,e[e.Next=34]=`Next`,e[e.End=35]=`End`,e[e.Home=36]=`Home`,e[e.Left=37]=`Left`,e[e.Up=38]=`Up`,e[e.Right=39]=`Right`,e[e.Down=40]=`Down`,e[e.Select=41]=`Select`,e[e.Print=42]=`Print`,e[e.Execute=43]=`Execute`,e[e.Snapshot=44]=`Snapshot`,e[e.Insert=45]=`Insert`,e[e.Delete=46]=`Delete`,e[e.Help=47]=`Help`,e[e.N0=48]=`N0`,e[e.N1=49]=`N1`,e[e.N2=50]=`N2`,e[e.N3=51]=`N3`,e[e.N4=52]=`N4`,e[e.N5=53]=`N5`,e[e.N6=54]=`N6`,e[e.N7=55]=`N7`,e[e.N8=56]=`N8`,e[e.N9=57]=`N9`,e[e.A=65]=`A`,e[e.B=66]=`B`,e[e.C=67]=`C`,e[e.D=68]=`D`,e[e.E=69]=`E`,e[e.F=70]=`F`,e[e.G=71]=`G`,e[e.H=72]=`H`,e[e.I=73]=`I`,e[e.J=74]=`J`,e[e.K=75]=`K`,e[e.L=76]=`L`,e[e.M=77]=`M`,e[e.N=78]=`N`,e[e.O=79]=`O`,e[e.P=80]=`P`,e[e.Q=81]=`Q`,e[e.R=82]=`R`,e[e.S=83]=`S`,e[e.T=84]=`T`,e[e.U=85]=`U`,e[e.V=86]=`V`,e[e.W=87]=`W`,e[e.X=88]=`X`,e[e.Y=89]=`Y`,e[e.Z=90]=`Z`,e[e.LeftWindows=91]=`LeftWindows`,e[e.RightWindows=92]=`RightWindows`,e[e.Application=93]=`Application`,e[e.Sleep=95]=`Sleep`,e[e.Numpad0=96]=`Numpad0`,e[e.Numpad1=97]=`Numpad1`,e[e.Numpad2=98]=`Numpad2`,e[e.Numpad3=99]=`Numpad3`,e[e.Numpad4=100]=`Numpad4`,e[e.Numpad5=101]=`Numpad5`,e[e.Numpad6=102]=`Numpad6`,e[e.Numpad7=103]=`Numpad7`,e[e.Numpad8=104]=`Numpad8`,e[e.Numpad9=105]=`Numpad9`,e[e.Multiply=106]=`Multiply`,e[e.Add=107]=`Add`,e[e.Separator=108]=`Separator`,e[e.Subtract=109]=`Subtract`,e[e.Decimal=110]=`Decimal`,e[e.Divide=111]=`Divide`,e[e.F1=112]=`F1`,e[e.F2=113]=`F2`,e[e.F3=114]=`F3`,e[e.F4=115]=`F4`,e[e.F5=116]=`F5`,e[e.F6=117]=`F6`,e[e.F7=118]=`F7`,e[e.F8=119]=`F8`,e[e.F9=120]=`F9`,e[e.F10=121]=`F10`,e[e.F11=122]=`F11`,e[e.F12=123]=`F12`,e[e.F13=124]=`F13`,e[e.F14=125]=`F14`,e[e.F15=126]=`F15`,e[e.F16=127]=`F16`,e[e.F17=128]=`F17`,e[e.F18=129]=`F18`,e[e.F19=130]=`F19`,e[e.F20=131]=`F20`,e[e.F21=132]=`F21`,e[e.F22=133]=`F22`,e[e.F23=134]=`F23`,e[e.F24=135]=`F24`,e[e.NumLock=144]=`NumLock`,e[e.ScrollLock=145]=`ScrollLock`,e[e.NEC_Equal=146]=`NEC_Equal`,e[e.Fujitsu_Jisho=146]=`Fujitsu_Jisho`,e[e.Fujitsu_Masshou=147]=`Fujitsu_Masshou`,e[e.Fujitsu_Touroku=148]=`Fujitsu_Touroku`,e[e.Fujitsu_Loya=149]=`Fujitsu_Loya`,e[e.Fujitsu_Roya=150]=`Fujitsu_Roya`,e[e.LeftShift=160]=`LeftShift`,e[e.RightShift=161]=`RightShift`,e[e.LeftControl=162]=`LeftControl`,e[e.RightControl=163]=`RightControl`,e[e.LeftMenu=164]=`LeftMenu`,e[e.RightMenu=165]=`RightMenu`,e[e.BrowserBack=166]=`BrowserBack`,e[e.BrowserForward=167]=`BrowserForward`,e[e.BrowserRefresh=168]=`BrowserRefresh`,e[e.BrowserStop=169]=`BrowserStop`,e[e.BrowserSearch=170]=`BrowserSearch`,e[e.BrowserFavorites=171]=`BrowserFavorites`,e[e.BrowserHome=172]=`BrowserHome`,e[e.VolumeMute=173]=`VolumeMute`,e[e.VolumeDown=174]=`VolumeDown`,e[e.VolumeUp=175]=`VolumeUp`,e[e.MediaNextTrack=176]=`MediaNextTrack`,e[e.MediaPrevTrack=177]=`MediaPrevTrack`,e[e.MediaStop=178]=`MediaStop`,e[e.MediaPlayPause=179]=`MediaPlayPause`,e[e.LaunchMail=180]=`LaunchMail`,e[e.LaunchMediaSelect=181]=`LaunchMediaSelect`,e[e.LaunchApplication1=182]=`LaunchApplication1`,e[e.LaunchApplication2=183]=`LaunchApplication2`,e[e.OEM1=186]=`OEM1`,e[e.OEMPlus=187]=`OEMPlus`,e[e.OEMComma=188]=`OEMComma`,e[e.OEMMinus=189]=`OEMMinus`,e[e.OEMPeriod=190]=`OEMPeriod`,e[e.OEM2=191]=`OEM2`,e[e.OEM3=192]=`OEM3`,e[e.OEM4=219]=`OEM4`,e[e.OEM5=220]=`OEM5`,e[e.OEM6=221]=`OEM6`,e[e.OEM7=222]=`OEM7`,e[e.OEM8=223]=`OEM8`,e[e.OEMAX=225]=`OEMAX`,e[e.OEM102=226]=`OEM102`,e[e.ICOHelp=227]=`ICOHelp`,e[e.ICO00=228]=`ICO00`,e[e.ProcessKey=229]=`ProcessKey`,e[e.ICOClear=230]=`ICOClear`,e[e.Packet=231]=`Packet`,e[e.OEMReset=233]=`OEMReset`,e[e.OEMJump=234]=`OEMJump`,e[e.OEMPA1=235]=`OEMPA1`,e[e.OEMPA2=236]=`OEMPA2`,e[e.OEMPA3=237]=`OEMPA3`,e[e.OEMWSCtrl=238]=`OEMWSCtrl`,e[e.OEMCUSel=239]=`OEMCUSel`,e[e.OEMATTN=240]=`OEMATTN`,e[e.OEMFinish=241]=`OEMFinish`,e[e.OEMCopy=242]=`OEMCopy`,e[e.OEMAuto=243]=`OEMAuto`,e[e.OEMENLW=244]=`OEMENLW`,e[e.OEMBackTab=245]=`OEMBackTab`,e[e.ATTN=246]=`ATTN`,e[e.CRSel=247]=`CRSel`,e[e.EXSel=248]=`EXSel`,e[e.EREOF=249]=`EREOF`,e[e.Play=250]=`Play`,e[e.Zoom=251]=`Zoom`,e[e.Noname=252]=`Noname`,e[e.PA1=253]=`PA1`,e[e.OEMClear=254]=`OEMClear`,e}(J||{});const Y=new Map([[J.LeftButton,`LeftButton`],[J.RightButton,`RightButton`],[J.Cancel,`Cancel`],[J.MiddleButton,`MiddleButton`],[J.ExtraButton1,`ExtraButton1`],[J.ExtraButton2,`ExtraButton2`],[J.Back,`Backspace`],[J.Tab,`Tab`],[J.Clear,`Clear`],[J.Return,`Enter`],[J.Shift,`ShiftLeft`],[J.Control,`ControlLeft`],[J.Menu,`AltLeft`],[J.Pause,`Pause`],[J.CapsLock,`CapsLock`],[J.Kana,`KanaMode`],[J.Junja,`JunjaMode`],[J.Final,`Finalize`],[J.Hanja,`HanjaMode`],[J.Escape,`Escape`],[J.Convert,`Convert`],[J.NonConvert,`NonConvert`],[J.Accept,`Accept`],[J.ModeChange,`ModeChange`],[J.Space,`Space`],[J.Prior,`PageUp`],[J.Next,`PageDown`],[J.End,`End`],[J.Home,`Home`],[J.Left,`ArrowLeft`],[J.Up,`ArrowUp`],[J.Right,`ArrowRight`],[J.Down,`ArrowDown`],[J.Select,`Select`],[J.Print,`PrintScreen`],[J.Execute,`Execute`],[J.Snapshot,`Snapshot`],[J.Insert,`Insert`],[J.Delete,`Delete`],[J.Help,`Help`],[J.N0,`Digit0`],[J.N1,`Digit1`],[J.N2,`Digit2`],[J.N3,`Digit3`],[J.N4,`Digit4`],[J.N5,`Digit5`],[J.N6,`Digit6`],[J.N7,`Digit7`],[J.N8,`Digit8`],[J.N9,`Digit9`],[J.A,`KeyA`],[J.B,`KeyB`],[J.C,`KeyC`],[J.D,`KeyD`],[J.E,`KeyE`],[J.F,`KeyF`],[J.G,`KeyG`],[J.H,`KeyH`],[J.I,`KeyI`],[J.J,`KeyJ`],[J.K,`KeyK`],[J.L,`KeyL`],[J.M,`KeyM`],[J.N,`KeyN`],[J.O,`KeyO`],[J.P,`KeyP`],[J.Q,`KeyQ`],[J.R,`KeyR`],[J.S,`KeyS`],[J.T,`KeyT`],[J.U,`KeyU`],[J.V,`KeyV`],[J.W,`KeyW`],[J.X,`KeyX`],[J.Y,`KeyY`],[J.Z,`KeyZ`],[J.LeftWindows,`MetaLeft`],[J.RightWindows,`MetaRight`],[J.Application,`ContextMenu`],[J.Sleep,`Sleep`],[J.Numpad0,`Numpad0`],[J.Numpad1,`Numpad1`],[J.Numpad2,`Numpad2`],[J.Numpad3,`Numpad3`],[J.Numpad4,`Numpad4`],[J.Numpad5,`Numpad5`],[J.Numpad6,`Numpad6`],[J.Numpad7,`Numpad7`],[J.Numpad8,`Numpad8`],[J.Numpad9,`Numpad9`],[J.Multiply,`NumpadMultiply`],[J.Add,`NumpadAdd`],[J.Separator,`NumpadSeparator`],[J.Subtract,`NumpadSubtract`],[J.Decimal,`NumpadDecimal`],[J.Divide,`NumpadDivide`],[J.F1,`F1`],[J.F2,`F2`],[J.F3,`F3`],[J.F4,`F4`],[J.F5,`F5`],[J.F6,`F6`],[J.F7,`F7`],[J.F8,`F8`],[J.F9,`F9`],[J.F10,`F10`],[J.F11,`F11`],[J.F12,`F12`],[J.F13,`F13`],[J.F14,`F14`],[J.F15,`F15`],[J.F16,`F16`],[J.F17,`F17`],[J.F18,`F18`],[J.F19,`F19`],[J.F20,`F20`],[J.F21,`F21`],[J.F22,`F22`],[J.F23,`F23`],[J.F24,`F24`],[J.NumLock,`NumLock`],[J.ScrollLock,`ScrollLock`],[J.NEC_Equal,`NEC_Equal`],[J.Fujitsu_Masshou,`Fujitsu_Masshou`],[J.Fujitsu_Touroku,`Fujitsu_Touroku`],[J.Fujitsu_Loya,`Fujitsu_Loya`],[J.Fujitsu_Roya,`Fujitsu_Roya`],[J.LeftShift,`ShiftLeft`],[J.RightShift,`ShiftRight`],[J.LeftControl,`ControlLeft`],[J.RightControl,`ControlRight`],[J.LeftMenu,`AltLeft`],[J.RightMenu,`AltRight`],[J.BrowserBack,`BrowserBack`],[J.BrowserForward,`BrowserForward`],[J.BrowserRefresh,`BrowserRefresh`],[J.BrowserStop,`BrowserStop`],[J.BrowserSearch,`BrowserSearch`],[J.BrowserFavorites,`BrowserFavorites`],[J.BrowserHome,`BrowserHome`],[J.VolumeMute,`VolumeMute`],[J.VolumeDown,`VolumeDown`],[J.VolumeUp,`VolumeUp`],[J.MediaNextTrack,`MediaTrackNext`],[J.MediaPrevTrack,`MediaTrackPrevious`],[J.MediaStop,`MediaStop`],[J.MediaPlayPause,`MediaPlayPause`],[J.LaunchMail,`LaunchMail`],[J.LaunchMediaSelect,`LaunchMediaSelect`],[J.LaunchApplication1,`LaunchApplication1`],[J.LaunchApplication2,`LaunchApplication2`],[J.OEM1,`OEM_1`],[J.OEMPlus,`Equal`],[J.OEMComma,`Comma`],[J.OEMMinus,`Minus`],[J.OEMPeriod,`Period`],[J.OEM2,`Slash`],[J.OEM3,`Backquote`],[J.OEM4,`BracketLeft`],[J.OEM5,`Backslash`],[J.OEM6,`BracketRight`],[J.OEM7,`Quote`],[J.OEM8,`IntlRo`],[J.OEMAX,`OEM_AX`],[J.OEM102,`IntlBackslash`],[J.ICOHelp,`ICO_HELP`],[J.ICO00,`ICO_00`],[J.ProcessKey,`Process`],[J.ICOClear,`ICO_CLEAR`],[J.Packet,`Packet`],[J.OEMReset,`OEM_Reset`],[J.OEMJump,`OEM_Jump`],[J.OEMPA1,`OEM_PA1`],[J.OEMPA2,`OEM_PA2`],[J.OEMPA3,`OEM_PA3`],[J.OEMWSCtrl,`OEM_WS_Ctrl`],[J.OEMCUSel,`OEM_CU_Sel`],[J.OEMATTN,`OEM_ATTN`],[J.OEMFinish,`OEM_Finish`],[J.OEMCopy,`OEM_Copy`],[J.OEMAuto,`OEM_Auto`],[J.OEMENLW,`OEM_ENLW`],[J.OEMBackTab,`BackTab`],[J.ATTN,`ATTN`],[J.CRSel,`CRSel`],[J.EXSel,`EXSel`],[J.EREOF,`EREOF`],[J.Play,`MediaPlay`],[J.Zoom,`Zoom`],[J.Noname,`Noname`],[J.PA1,`PA1`],[J.OEMClear,`OEM_Clear`]]),rn=new Map(Y.entries().map(([e,t])=>[t,e])),an=n({"[string]":{keys:`string[]`,mode:n(`'toggle' | 'hold'`).pipe(e=>e??`toggle`)}});var on=class extends L{preferencesKeybindToCallbacks=new Map;pressedKeys=new Set;activeKeybinds=new Set;triggeredToggleKeybinds=new Set;boundHandleKeyboardFocus=this.handleKeyboardFocus.bind(this);boundHandleKeyDown=this.handleKeyDown.bind(this);boundHandleKeyUp=this.handleKeyUp.bind(this);keybindsFile;keybindListeningPaused=!1;constructor(e){super(`KeybindManager`),this.keybindsFile=new Je({path:Kt([`keybinds.json`]),schema:an,default:e})}init(){super.init();let e=U.getInstance().getInterface(`OGG_SIEGE`);e.instance.on(`keyboardFocus`,this.boundHandleKeyboardFocus),e.instance.on(`keyDown`,this.boundHandleKeyDown),e.instance.on(`keyUp`,this.boundHandleKeyUp)}async onKeybindToggled(e,t){let n=this.preferencesKeybindToCallbacks.get(e)??{toggle:[],down:[],up:[]};n.toggle.push(t),this.preferencesKeybindToCallbacks.set(e,n)}async onKeybindDown(e,t){let n=this.preferencesKeybindToCallbacks.get(e)??{toggle:[],down:[],up:[]};n.down.push(t),this.preferencesKeybindToCallbacks.set(e,n)}async onKeybindUp(e,t){let n=this.preferencesKeybindToCallbacks.get(e)??{toggle:[],down:[],up:[]};n.up.push(t),this.preferencesKeybindToCallbacks.set(e,n)}async updateKeybind(e,t){this.keybindsFile.set({[e]:t})}async updateKeybinds(e){let t=Object.fromEntries(Object.entries(e).filter(([e,t])=>t!==void 0));this.keybindsFile.set({...this.keybindsFile.get(),...t})}getConfig(){return this.keybindsFile.get()}destroy(){let e=U.getInstance().getInterface(`OGG_SIEGE`);e.instance.off(`keyboardFocus`,this.boundHandleKeyboardFocus),e.instance.off(`keyDown`,this.boundHandleKeyDown),e.instance.off(`keyUp`,this.boundHandleKeyUp),super.destroy()}handleKeyDown(e){if(this.keybindListeningPaused)return;let t=Y.get(e.key);if(!t){this.logger.error(`Unknown key down`,e);return}this.pressedKeys.add(t),this.checkKeybindings()}handleKeyboardFocus(){this.pressedKeys.clear(),this.activeKeybinds.clear(),this.triggeredToggleKeybinds.clear()}async handleKeyUp(e){if(this.keybindListeningPaused)return;let t=Y.get(e.key);if(!t)return;this.pressedKeys.delete(t);let n=this.keybindsFile.get();for(let[e]of this.preferencesKeybindToCallbacks.entries())n[e].keys.includes(t)&&this.triggeredToggleKeybinds.delete(e);this.checkKeybindUps()}async checkKeybindUps(){let e=this.keybindsFile.get();for(let[t,n]of this.preferencesKeybindToCallbacks.entries()){if(!n.up||n.up.length===0)continue;let r=e[t];if(this.activeKeybinds.has(t)&&r.keys.some(e=>!this.pressedKeys.has(e))){this.activeKeybinds.delete(t);for(let e of n.up)e();this.logger.log(`Keybind up triggered`,this.getKeybindToString(r))}}}async checkKeybindings(){let e=this.keybindsFile.get();for(let[t,n]of this.preferencesKeybindToCallbacks.entries()){let r=e[t];if(r.keys.length===this.pressedKeys.size&&r.keys.every(e=>rn.has(e)?this.pressedKeys.has(e):!1)){this.triggerKeybind(r,n,t);return}}for(let[t,n]of this.preferencesKeybindToCallbacks.entries()){let r=e[t];r.keys.every(e=>rn.has(e)?this.pressedKeys.has(e):(this.logger.error(`Unknown key`,e,r),!1))&&this.triggerKeybind(r,n,t)}}triggerKeybind(e,t,n){let r=e.mode;if(r===`toggle`&&t.toggle&&t.toggle.length>0&&!this.triggeredToggleKeybinds.has(n)){let r;for(let e of t.toggle){let t=e();typeof t==`string`&&r===void 0&&(r=t)}this.triggeredToggleKeybinds.add(n),this.logger.log(r?`Keybind pressed rejected: ${r}`:`Keybind pressed accepted`,this.getKeybindToString(e))}if(r===`hold`&&t.down&&t.down.length>0&&!this.activeKeybinds.has(n)){let r;for(let e of t.down){let t=e();if(typeof t==`string`){r=t;break}}r?this.logger.log(`Keybind down rejected: ${r}`,this.getKeybindToString(e)):(this.activeKeybinds.add(n),this.logger.log(`Keybind down accepted`,this.getKeybindToString(e)))}}getKeybindToString(e){return`(${e.keys.join(`+`)}${e.mode?` ${e.mode}`:``})`}};function sn(e){let t=new on(e),n={};for(let r in e)n[r]={on:(e,n)=>{switch(e){case`down`:t.onKeybindDown(r,n);break;case`up`:t.onKeybindUp(r,n);break;case`toggle`:t.onKeybindToggled(r,n);break;default:throw Error(`Event type not implemented ${e}`,{cause:[e,n]})}}};let r={...n,getConfig:()=>t.getConfig(),pauseKeybindListening:()=>{t.keybindListeningPaused=!0},resumeKeybindListening:()=>{t.keybindListeningPaused=!1},updateKeybind:(e,n)=>{t.updateKeybind(e,n)},updateKeybinds:e=>{t.updateKeybinds(e)}};return t.init(),pe.on(`quit`,()=>{t.destroy()}),r}function X(){return U.getInstance().getInterface(`OGG_SIEGE`)}function cn(){let e=K.getInstance(),t=N.getInstance(),n=W.getInstance();n.meta=ln(),e.on([`gameReady`,`gameClose`],()=>{n.meta||=ln(),n.meta.in_game=e.isInGame}),t.on(`fatal`,e=>{n.track(`fatal`,{message:e.message,code:e.code,data:JSON.stringify(e.data)})}),t.on(`error`,e=>{n.track(`error`,{code:e.code,message:e.message,data:JSON.stringify(e.data)})}),t.on(`warning`,e=>{n.track(`warning`,{message:e.message,code:e.code,data:JSON.stringify(e.data)})})}function ln(){return{app_id:global.OVERLAYED.APPLICATION_ID,user_id:Yt(),app_channel:global.OVERLAYED.APP_BUILD_CHANNEL,app_version:global.OVERLAYED.APP_VERSION,package_version:global.OVERLAYED.PACKAGE_VERSION,frontend_version:global.OVERLAYED.FRONTEND_VERSION,session_id:global.OVERLAYED.sessionId,in_game:!1}}function un(){function e(e,t){return e.once(`closed`,()=>{e.isDestroyed()||W.getInstance().track(`window_closed`,{url:e.webContents.getURL(),in_game:t})}),e.on(`unresponsive`,()=>{e.isDestroyed()||W.getInstance().track(`window_unresponsive`,{url:e.webContents.getURL(),in_game:t})}),W.getInstance().track(`window_created`,{url:e.webContents.getURL(),in_game:t}),e}return{createWindow:t=>e(new global.OVERLAYED.electron.BrowserWindow(t),!1),createInGameWindow:t=>e(X().instance.newWindowInternal(global.OVERLAYED.electron.BrowserWindow,t),!0),on:(e,t)=>X().instance.on(e,t),off:(e,t)=>X().instance.off(e,t),once:(e,t)=>X().instance.once(e,t),addListener:(e,t)=>X().instance.addListener(e,t),removeListener:(e,t)=>X().instance.removeListener(e,t),removeAllListeners:()=>X().instance.removeAllListeners(),prependListener:(e,t)=>X().instance.prependListener(e,t),prependOnceListener:(e,t)=>X().instance.prependOnceListener(e,t),getActiveGameInfo:()=>{let e=X(),t=I.getInstance();return{resolution:e.resolution,isConnected:t.hasConnection}}}}const dn=M(class extends gt{renderInterface;globalCursorOverrideCount=new Set;globalMouseBlockCount=new Set;globalKeyboardBlockCount=new Set;keyInputBlocks={};constructor(e){super(`OverridesManager`),this.renderInterface=U.getInstance().getInterface(e)}scope(e){return{setGlobalCursorOverride:t=>this.setGlobalCursorOverride(e,t),setGlobalMouseBlock:t=>this.setGlobalMouseBlock(e,t),setGlobalKeyboardBlock:t=>this.setGlobalKeyboardBlock(e,t),setKeyInputBlock:(t,n)=>this.setKeyInputBlock(e,t,n)}}setGlobalCursorOverride(e,t){t?this.globalCursorOverrideCount.add(e):this.globalCursorOverrideCount.delete(e),t&&this.globalCursorOverrideCount.size===1?this.renderInterface.instance.setGlobalCursorOverride(!0):!t&&this.globalCursorOverrideCount.size===0&&this.renderInterface.instance.setGlobalCursorOverride(!1)}setGlobalMouseBlock(e,t){t?this.globalMouseBlockCount.add(e):this.globalMouseBlockCount.delete(e),t&&this.globalMouseBlockCount.size===1?this.renderInterface.instance.setGlobalMouseBlock(!0):!t&&this.globalMouseBlockCount.size===0&&this.renderInterface.instance.setGlobalMouseBlock(!1)}setGlobalKeyboardBlock(e,t){t?this.globalKeyboardBlockCount.add(e):this.globalKeyboardBlockCount.delete(e),t&&this.globalKeyboardBlockCount.size===1?this.renderInterface.instance.setGlobalKeyboardBlock(!0):!t&&this.globalKeyboardBlockCount.size===0&&this.renderInterface.instance.setGlobalKeyboardBlock(!1)}setKeyInputBlock(e,t,n){this.keyInputBlocks[t]||(this.keyInputBlocks[t]=new Set),n?this.keyInputBlocks[t].add(e):this.keyInputBlocks[t].delete(e),n&&this.keyInputBlocks[t].size===1?this.renderInterface.instance.setKeyInputBlock(t,!0):!n&&this.keyInputBlocks[t].size===0&&this.renderInterface.instance.setKeyInputBlock(t,!1)}},`OGG_SIEGE`);function fn(){return{scope:e=>dn.getInstance().scope(e),raw:{setGlobalMouseBlock:e=>X().instance.setGlobalMouseBlock(e),setGlobalKeyboardBlock:e=>X().instance.setGlobalKeyboardBlock(e),setGlobalCursorOverride:e=>X().instance.setGlobalCursorOverride(e),setKeyInputBlock:(e,t)=>X().instance.setKeyInputBlock(e,t),getGlobalMouseBlock:()=>X().instance.getGlobalMouseBlock(),getGlobalKeyboardBlock:()=>X().instance.getGlobalKeyboardBlock(),getGlobalCursorOverride:()=>X().instance.getGlobalCursorOverride(),getKeyInputBlock:e=>X().instance.getKeyInputBlock(e)}}}function pn(){return{track:(e,t)=>{W.getInstance().track(`custom__${String(e)}`,t)}}}var mn=Se(be(((e,t)=>{var n=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),r=n((e,t)=>{var n=new Set([`mouseDown`,`mouseUp`,`pointerDown`,`pointerUp`]),r=new WeakSet;function i(e,t,{allowHosts:i}={}){let{shell:a}=t;if(r.has(e))return;r.add(e);let o=e.webContents;function s(e){return!!(!c(e)||i?.includes(e.host))}function c(e){return new URL(o.getURL()).origin!==e.origin}let l=0;function u(){l=Date.now()}function d(){let e=Date.now()-l,t=e<150;return t||console.warn(`was not recently active`,e),t}if(process.platform===`win32`)for(let t of Object.values({KEYDOWN:256,LBUTTONUP:514,MBUTTONUP:520,RBUTTONUP:517,XBUTTONUP:524,TOUCH:576}))e.hookWindowMessage(t,u);o.on(`input-event`,(e,t)=>{n.has(t.type)&&u()}),o.on(`will-navigate`,(e,t)=>{let n=e.url||t;if(console.log(`will-navigate`,n),!n)return;let r=new URL(n);if(!s(r)){if(!d()){console.log(`blocked navigation`,n),e.preventDefault();return}c(r)&&(console.log(`external navigation`,n),e.preventDefault(),a.openExternal(n))}}),o.session.on(`will-download`,(e,t)=>{let n=t.getURL();/^blob:/.test(n)||e.preventDefault()}),o.setWindowOpenHandler(e=>{console.log(`window-open`,e.url);let{url:t}=e,n=new URL(t);if(!s(n))return d()?(c(n)&&a.openExternal(e.url),{action:`deny`}):(console.log(`blocked navigation`,t),{action:`deny`})})}t.exports=i}),i=n((e,t)=>{var n=new Set([`Mozilla`,`AppleWebKit`,`Chrome`,`Safari`,`Gecko`,`Firefox`,`OPR`,`Edg`,`Version`,`Mobile`,`curl`,`PostmanRuntime`]);async function r(e,t,r){let{webContents:i}=e,a=await i.executeJavaScript(`navigator.userAgent`);a=a.match(/[^\/]+\/[^\s]+( \([^\)]+\))?/g).map(e=>e.trim()).filter(e=>{let[t]=e.split(`/`,1);return n.has(t)}).join(` `),i.setUserAgent(a),t.app.userAgentFallback=a}t.exports=r}),a=r(),o=i();function s(e,t,n={}){a(e,t,n.linkHandler),o(e,t,n.userAgent)}t.exports={setupRevUtils:s,setupLinkHandler:a,setUserAgent:o}}))(),1);function hn(){return{registerWindow:e=>{(0,mn.setupRevUtils)(e,global.OVERLAYED.electron)}}}function gn(e){let t=$e(global.OVERLAYED.APPLICATION_ID),n=rt(t,{recursive:!0}),r=Ze(),i=rt(r,{recursive:!0});F.getInstance().info(`Logs path: `,t),F.getInstance().info(`Overlayed logs path: `,r);let a=new _;return[...n,...i].forEach(([e,t])=>{F.getInstance().info(`Zipping: `,t);let n=ae(t),r=m(t);a.file(r,n,{compression:`DEFLATE`})}),Object.entries(e?.additionalFiles??{}).forEach(([e,t])=>{F.getInstance().info(`Zipping extra file: `,e),a.file(e,t,{compression:`DEFLATE`})}),a}async function _n(e,t){let n={...e,version:`${global.OVERLAYED.APP_VERSION}@${global.OVERLAYED.APP_BUILD_CHANNEL}`,log_zip:`data:application/zip;base64,${t}`};await fetch(`https://api.stats.cc/v1/overlay/contact`,{method:`POST`,body:JSON.stringify(n),redirect:`follow`,headers:{"Content-Type":`application/json`}})}function vn(e){let t=new tt(`app.log`);return t.init(global.OVERLAYED.APPLICATION_ID,e.debug),{scope:e=>t.scope(e),info:e=>t.info(e),warn:e=>t.warn(e),error:e=>t.error(e),debug:e=>t.debug(e),submitBugReport:async(e,t)=>{W.getInstance().track(`bug_report_submitted`,{version:e.version,category:e.category}),await _n(e,await gn(t).generateAsync({type:`base64`}))}}}const yn=1e3;function bn(e,t,r,i,a){let o=I.getInstance();function s(e,t){let n=r.get(t);if(!n)r.set(t,[e]);else{if(n.length>=yn){N.getInstance().warn(`Event buffer full, removing oldest event`,`EVENT_BUFFER_FULL`,{summary:`Event buffer overflow for module ${t}. Buffer size: ${n.length}, max: ${yn}`});return}n.push(e)}}function c(r){let i=qt(r);if(i instanceof n.errors){W.getInstance().track(`invalid_game_event`,{}),N.getInstance().warn(`Invalid event`,`INVALID_EVENT`,{summary:i.summary});return}let o=e.modules.find(e=>e.key===i.game);if(!o)return;let c=o.events.event,l=c(r);if(l instanceof n.errors){if(`type`in l.byPath)return;W.getInstance().track(`invalid_game_event`,{game:i.game,type:i.type}),N.getInstance().warn(`Invalid event`,`INVALID_EVENT`,{summary:l.summary});return}if(!a[o.key]){s(l,o.key);return}if(l.type===`unsupported_game_version`){let{content:e}=l;W.getInstance().track(`unsupported_game_version`,{game:l.game,hash:e?.hash,version:e?.version})}let u=q(o.key,l.type),d=q(o.key,`*`),f=t.get(u),p=t.get(d),m=[...Array.from(f??[]),...Array.from(p??[])];m.length!==0&&m.forEach(e=>{e(l)})}return i.on(`flushEvents`,e=>{if(a[e])return;a[e]=!0;let t=r.get(e);t&&(F.getInstance().info(`Flushing ${t.length} events for module ${e}`),t.forEach(e=>c(e)),r.delete(e))}),o.on(`data`,e=>e.forEach(c)),o.on(`error`,e=>{N.getInstance().error(`Pipe server error`,`PIPE_SERVER_ERROR`,{error:e})}),o}let Z=!1,xn={},Q,Sn=new j,$;function Cn(e){let{init:t=!0,debug:n=!1,silent:r=!0}=e;if(wn(e),F.getInstance().init(e.applicationId,n,r),Z)return Q;function i(){if(Z)return;cn();let t=new Map,n=new Map,r=tn(e.modules,t,Sn),a=nn(),o=sn(e.keybinds),s=un(),c=fn(),l=hn(),u=pn(),d=vn(e);Tn(e),bn(e,t,n,Sn,xn),Z=!0,Q={...r,...a,ads:l,keybinds:o,windows:s,input:c,cortex:u,hasAnyActiveProcesses:()=>H.getInstance().hasAnyActiveProcesses,hasAnyActiveGames:()=>K.getInstance().isInGame,init:i,log:d,initialized:Z}}return t?(i(),Q):new Proxy({init:i},{get:(e,t)=>{if(t!==`init`&&!Z)throw Error(`overlayed was called before initialized: ${t}`);return t===`init`?e[t]:Q[t]}})}global.OVERLAYED=new Proxy({},{get:()=>{throw Error(`function overlayed was not called`)}});function wn(e){global.OVERLAYED={APPLICATION_ID:Ct(e.applicationId),APP_BUILD_CHANNEL:e.channel??`alpha`,APP_VERSION:e.version??`0.0.0`,PACKAGE_VERSION:`0.26.0`,FRONTEND_VERSION:`0.0.0`,sessionId:Xt(),electron:e.electron}}function Tn(e){let t=e.universal?[`*`]:e.modules.map(e=>e.key);K.getInstance().setSubscribedGames(t),en.getInstance().init(),K.getInstance().init(),H.getInstance().init(),V.getInstance().init();async function n(){let e=wt(global.OVERLAYED.APPLICATION_ID).then(e=>e.data),t=Yt();F.getInstance().log(`userId`,t);let n={...await e,userId:t};return F.getInstance().log(`appInfo`,n),n}let r;global.OVERLAYED.electron.ipcMain.handle(`getAppInfo`,async()=>(r??=n(),r)),W.getInstance().track(`start`,{});try{$&&clearInterval($),$=setInterval(()=>{try{Zt()}catch{}},3e4),$.unref()}catch(e){F.getInstance().log(`failed to start sessionLastUsed interval`,e)}pe.on(`quit`,()=>{W.getInstance().track(`electron_quit`,{}),En()}),process.on(`exit`,()=>{W.getInstance().track(`exit`,{}),En()})}async function En(){try{Zt()}catch{}try{$&&clearInterval($),$=void 0}catch{}await W.getInstance().flush(),V.getInstance().destroy(),K.getInstance().destroy(),en.getInstance().destroy(),H.getInstance().destroy(),U.getInstance().getInterface(`OGG_SIEGE`).destroy(),I.getInstance().destroy(),N.getInstance().destroy()}function Dn(e,t){return e+t}export{pt as RenderInterface,ht as VirtualKey,Dn as add,ot as defineConfig,Cn as overlayed,Rt as setFetchLatestTokenCallback,yt as setUpdaterTokenResolver};
|
package/dist/siege.d.ts
CHANGED
|
@@ -670,7 +670,6 @@ declare function module(): {
|
|
|
670
670
|
match_type: SiegeMatchType;
|
|
671
671
|
match_id: SiegeMatchId;
|
|
672
672
|
map: {
|
|
673
|
-
id: number;
|
|
674
673
|
name: {
|
|
675
674
|
id: SiegeMapNameId;
|
|
676
675
|
value: string;
|
|
@@ -707,7 +706,6 @@ declare function module(): {
|
|
|
707
706
|
creation_time: number;
|
|
708
707
|
content: {
|
|
709
708
|
map: {
|
|
710
|
-
id: number;
|
|
711
709
|
name: {
|
|
712
710
|
id: SiegeMapNameId;
|
|
713
711
|
value: string;
|
|
@@ -1042,7 +1040,6 @@ declare function module(): {
|
|
|
1042
1040
|
match_type: SiegeMatchType;
|
|
1043
1041
|
match_id: SiegeMatchId;
|
|
1044
1042
|
map: {
|
|
1045
|
-
id: number;
|
|
1046
1043
|
name: {
|
|
1047
1044
|
id: SiegeMapNameId;
|
|
1048
1045
|
value: string;
|
|
@@ -1081,7 +1078,6 @@ declare function module(): {
|
|
|
1081
1078
|
creation_time: number;
|
|
1082
1079
|
content: {
|
|
1083
1080
|
map: {
|
|
1084
|
-
id: number;
|
|
1085
1081
|
name: {
|
|
1086
1082
|
id: SiegeMapNameId;
|
|
1087
1083
|
value: string;
|
|
@@ -1448,7 +1444,6 @@ declare const MatchRoundDataSchema: arktype_internal_methods_object_ts0.ObjectTy
|
|
|
1448
1444
|
}, {}>;
|
|
1449
1445
|
type MatchRoundData = typeof MatchRoundDataSchema.infer;
|
|
1450
1446
|
declare const MapDataSchema: arktype_internal_methods_object_ts0.ObjectType<{
|
|
1451
|
-
id: number;
|
|
1452
1447
|
name: {
|
|
1453
1448
|
id: SiegeMapNameId;
|
|
1454
1449
|
value: string;
|
|
@@ -1534,7 +1529,6 @@ declare const MatchStarted: arktype_internal_methods_object_ts0.ObjectType<{
|
|
|
1534
1529
|
match_type: SiegeMatchType;
|
|
1535
1530
|
match_id: SiegeMatchId;
|
|
1536
1531
|
map: {
|
|
1537
|
-
id: number;
|
|
1538
1532
|
name: {
|
|
1539
1533
|
id: SiegeMapNameId;
|
|
1540
1534
|
value: string;
|
|
@@ -1631,7 +1625,6 @@ declare const MapChanged: arktype_internal_methods_object_ts0.ObjectType<{
|
|
|
1631
1625
|
creation_time: number;
|
|
1632
1626
|
content: {
|
|
1633
1627
|
map: {
|
|
1634
|
-
id: number;
|
|
1635
1628
|
name: {
|
|
1636
1629
|
id: SiegeMapNameId;
|
|
1637
1630
|
value: string;
|
|
@@ -2052,7 +2045,6 @@ declare const events: arktype2.Module<{
|
|
|
2052
2045
|
match_type: SiegeMatchType;
|
|
2053
2046
|
match_id: SiegeMatchId;
|
|
2054
2047
|
map: {
|
|
2055
|
-
id: number;
|
|
2056
2048
|
name: {
|
|
2057
2049
|
id: SiegeMapNameId;
|
|
2058
2050
|
value: string;
|
|
@@ -2089,7 +2081,6 @@ declare const events: arktype2.Module<{
|
|
|
2089
2081
|
creation_time: number;
|
|
2090
2082
|
content: {
|
|
2091
2083
|
map: {
|
|
2092
|
-
id: number;
|
|
2093
2084
|
name: {
|
|
2094
2085
|
id: SiegeMapNameId;
|
|
2095
2086
|
value: string;
|
|
@@ -2424,7 +2415,6 @@ declare const events: arktype2.Module<{
|
|
|
2424
2415
|
match_type: SiegeMatchType;
|
|
2425
2416
|
match_id: SiegeMatchId;
|
|
2426
2417
|
map: {
|
|
2427
|
-
id: number;
|
|
2428
2418
|
name: {
|
|
2429
2419
|
id: SiegeMapNameId;
|
|
2430
2420
|
value: string;
|
|
@@ -2463,7 +2453,6 @@ declare const events: arktype2.Module<{
|
|
|
2463
2453
|
creation_time: number;
|
|
2464
2454
|
content: {
|
|
2465
2455
|
map: {
|
|
2466
|
-
id: number;
|
|
2467
2456
|
name: {
|
|
2468
2457
|
id: SiegeMapNameId;
|
|
2469
2458
|
value: string;
|
package/dist/siege.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Type as e,scope as t,type as n}from"arktype";function r(e){return e}function i(e){return e}function a(e){return e?t=>(e(t),t):i}const o=a(),s=a(),c=a(),l=a(),u=a(),d=a(),f=a(),ee=a(),p=a(),m=a(),h=a(),g=`00000000-0000-0000-0000-000000000000`,_=[`intro`,`planning`,`prep`,`action`,`results`,`invalid`,`first`],v=n(`string`),y=[0,1],b=n(`===`,...y),x=[`attacker`,`defender`,`both`,`invalid`],S=n(`string`),te=[`normal`,`overhealed`,`low_health`,`downed`,`dead`,`respawning`],C=n(`string`),w=`bullet.melee.explosive.falling.regeneration.unknown.debris.projectile.downed.gas.thermal_explosion.melee_gadget.barbed_wire.electric.reinforcement.frag.paralyzed.emp.break.cleanup.interrogation.melee-finisher.toxic.toxic-explosion.pneumatic.body-contact.contact-explosion.flash.parasite-spike.laser.concussion.blowtorch.taser-shield.reverse-friendly-fire.self-destroyed.area-control.fire.breach-kick.break-wall.blade-mine.melee-pushback.supressive-fire.gas-pipe-fire.invalid`.split(`.`),T=n(`string`),ne=[`unknown`,`enemy`,`friendly`,`invalid`],E=n(`string`),D=Object.freeze({quickPlay:p(`QUICK PLAY`),versusAi:p(`VERSUS AI`),standard:p(`STANDARD`),ranked:p(`RANKED`)}),O=Object.freeze({[D.quickPlay]:`Quick Play`,[D.versusAi]:`Versus AI`,[D.standard]:`Standard`,[D.ranked]:`Ranked`}),k=Object.freeze({teamDeathmatch:m(`TEAM DEATHMATCH`),goldenGun:m(`GOLDEN GUN`),freeForAll:m(`FREE FOR ALL`),weaponRoulette:m(`WEAPON ROULETTE`),dualFront:m(`DUAL FRONT`),bomb:m(`BOMB`),versusAi:m(`VERSUS AI`),hostage:m(`HOSTAGE`),threeVsThreeSecureArea:m(`3 VS 3 SECURE AREA`),targetDrill:m(`TARGET DRILL`),rengoku:m(`RENGOKU`),hideAndSeek:m(`HIDE AND SEEK`)}),re=Object.freeze({[k.teamDeathmatch]:`Team Deathmatch`,[k.goldenGun]:`Golden Gun`,[k.freeForAll]:`Free For All`,[k.weaponRoulette]:`Weapon Roulette`,[k.dualFront]:`Dual Front`,[k.bomb]:`Bomb`,[k.versusAi]:`Versus AI`,[k.hostage]:`Hostage`,[k.threeVsThreeSecureArea]:`3v3 Secure Area`,[k.targetDrill]:`Target Drill`,[k.rengoku]:`Rengoku`,[k.hideAndSeek]:`Hide and Seek`}),A=Object.freeze({ranked:o(205379),quickMatch:o(138115),customGame:o(62008),versusAi:o(397300),standard:o(393930),arcade:o(320109),siegeCup:o(414089),dualFront:o(420611),showdown:o(305544),trainingGrounds:o(-1),unranked:o(310813),deathmatch:o(420611),rengoku:o(359430),muteProtocol:o(368421),fieldTraining:o(423927),hideAndSeek:o(310854)}),j=Object.freeze({[A.quickMatch]:`Quick Match`,[A.ranked]:`Ranked`,[A.customGame]:`Custom Game`,[A.versusAi]:`Versus AI`,[A.standard]:`Standard`,[A.arcade]:`Arcade`,[A.siegeCup]:`Siege Cup`,[A.dualFront]:`Dual Front`,[A.showdown]:`Showdown`,[A.trainingGrounds]:`Training Grounds`,[A.unranked]:`Unranked`,[A.deathmatch]:`Deathmatch`,[A.rengoku]:`Rengoku`,[A.muteProtocol]:`M.U.T.E Protocol`,[A.fieldTraining]:`Field Training`,[A.hideAndSeek]:`Hide and Seek`}),M=Object.freeze({glaz:s(62242),blitz:s(62243),buck:s(62244),sledge:s(62245),ash:s(62246),thermite:s(62247),castle:s(62248),rook:s(62249),pulse:s(62250),doc:s(62251),mute:s(62252),smoke:s(62253),recruit:s(62555),thatcher:s(65143),twitch:s(65156),montagne:s(65159),bandit:s(65165),fuze:s(65168),kapkan:s(65171),tachanka:s(65174),jager:s(113049),iq:s(113052),frost:s(186159),blackbeard:s(187249),valkyrie:s(187252),caveira:s(207671),capitao:s(207674),echo:s(209180),hibana:s(209183),mira:s(222172),jackal:s(222182),ying:s(239334),lesion:s(239337),ela:s(254595),zofia:s(254606),dokkaebi:s(273652),vigil:s(273663),finka:s(281457),lion:s(281463),alibi:s(282399),maestro:s(285888),maverick:s(288504),clash:s(288526),nomad:s(293435),kaid:s(293436),gridlock:s(298589),mozzie:s(298616),nokk:s(299657),warden:s(299668),goyo:s(304196),amaru:s(308469),kali:s(310757),wamai:s(310768),oryx:s(317965),iana:s(317976),melusi:s(320062),ace:s(320073),zero:s(328927),aruni:s(328940),flores:s(334086),thunderbird:s(336466),osa:s(344493),thorn:s(349405),azami:s(354314),sens:s(357386),grim:s(365404),solis:s(376836),brava:s(382419),fenrir:s(386388),ram:s(392904),tubarao:s(395594),deimos:s(400504),striker:s(404278),sentry:s(404290),skopos:s(408405),rauora:s(421052),denari:s(2437779699)}),N=Object.freeze({[M.glaz]:`glaz`,[M.blitz]:`blitz`,[M.buck]:`buck`,[M.sledge]:`sledge`,[M.ash]:`ash`,[M.thermite]:`thermite`,[M.castle]:`castle`,[M.rook]:`rook`,[M.pulse]:`pulse`,[M.doc]:`doc`,[M.mute]:`mute`,[M.smoke]:`smoke`,[M.recruit]:`recruit`,[M.thatcher]:`thatcher`,[M.twitch]:`twitch`,[M.montagne]:`montagne`,[M.bandit]:`bandit`,[M.fuze]:`fuze`,[M.kapkan]:`kapkan`,[M.tachanka]:`tachanka`,[M.jager]:`jager`,[M.iq]:`iq`,[M.frost]:`frost`,[M.blackbeard]:`blackbeard`,[M.valkyrie]:`valkyrie`,[M.caveira]:`caveira`,[M.capitao]:`capitao`,[M.echo]:`echo`,[M.hibana]:`hibana`,[M.mira]:`mira`,[M.jackal]:`jackal`,[M.ying]:`ying`,[M.lesion]:`lesion`,[M.ela]:`ela`,[M.zofia]:`zofia`,[M.dokkaebi]:`dokkaebi`,[M.vigil]:`vigil`,[M.finka]:`finka`,[M.lion]:`lion`,[M.alibi]:`alibi`,[M.maestro]:`maestro`,[M.maverick]:`maverick`,[M.clash]:`clash`,[M.nomad]:`nomad`,[M.kaid]:`kaid`,[M.gridlock]:`gridlock`,[M.mozzie]:`mozzie`,[M.nokk]:`nokk`,[M.warden]:`warden`,[M.goyo]:`goyo`,[M.amaru]:`amaru`,[M.kali]:`kali`,[M.wamai]:`wamai`,[M.oryx]:`oryx`,[M.iana]:`iana`,[M.melusi]:`melusi`,[M.ace]:`ace`,[M.zero]:`zero`,[M.aruni]:`aruni`,[M.flores]:`flores`,[M.thunderbird]:`thunderbird`,[M.osa]:`osa`,[M.thorn]:`thorn`,[M.azami]:`azami`,[M.sens]:`sens`,[M.grim]:`grim`,[M.solis]:`solis`,[M.brava]:`brava`,[M.fenrir]:`fenrir`,[M.ram]:`ram`,[M.tubarao]:`tubarao`,[M.deimos]:`deimos`,[M.striker]:`striker`,[M.sentry]:`sentry`,[M.skopos]:`skopos`,[M.rauora]:`rauora`,[M.denari]:`denari`}),P=Object.freeze({[M.striker]:{name:`Striker`,role:`attacker`},[M.sledge]:{name:`Sledge`,role:`attacker`},[M.thatcher]:{name:`Thatcher`,role:`attacker`},[M.ash]:{name:`Ash`,role:`attacker`},[M.thermite]:{name:`Thermite`,role:`attacker`},[M.twitch]:{name:`Twitch`,role:`attacker`},[M.montagne]:{name:`Montagne`,role:`attacker`},[M.glaz]:{name:`Glaz`,role:`attacker`},[M.fuze]:{name:`Fuze`,role:`attacker`},[M.blitz]:{name:`Blitz`,role:`attacker`},[M.iq]:{name:`IQ`,role:`attacker`},[M.buck]:{name:`Buck`,role:`attacker`},[M.blackbeard]:{name:`Blackbeard`,role:`attacker`},[M.capitao]:{name:`Capitão`,role:`attacker`},[M.hibana]:{name:`Hibana`,role:`attacker`},[M.jackal]:{name:`Jackal`,role:`attacker`},[M.ying]:{name:`Ying`,role:`attacker`},[M.zofia]:{name:`Zofia`,role:`attacker`},[M.dokkaebi]:{name:`Dokkaebi`,role:`attacker`},[M.lion]:{name:`Lion`,role:`attacker`},[M.finka]:{name:`Finka`,role:`attacker`},[M.maverick]:{name:`Maverick`,role:`attacker`},[M.nomad]:{name:`Nomad`,role:`attacker`},[M.gridlock]:{name:`Gridlock`,role:`attacker`},[M.nokk]:{name:`Nøkk`,role:`attacker`},[M.amaru]:{name:`Amaru`,role:`attacker`},[M.kali]:{name:`Kali`,role:`attacker`},[M.iana]:{name:`Iana`,role:`attacker`},[M.ace]:{name:`Ace`,role:`attacker`},[M.zero]:{name:`Zero`,role:`attacker`},[M.flores]:{name:`Flores`,role:`attacker`},[M.osa]:{name:`Osa`,role:`attacker`},[M.sens]:{name:`Sens`,role:`attacker`},[M.grim]:{name:`Grim`,role:`attacker`},[M.brava]:{name:`Brava`,role:`attacker`},[M.ram]:{name:`Ram`,role:`attacker`},[M.deimos]:{name:`Deimos`,role:`attacker`},[M.rauora]:{name:`Rauora`,role:`attacker`},[M.sentry]:{name:`Sentry`,role:`defender`},[M.smoke]:{name:`Smoke`,role:`defender`},[M.mute]:{name:`Mute`,role:`defender`},[M.castle]:{name:`Castle`,role:`defender`},[M.pulse]:{name:`Pulse`,role:`defender`},[M.doc]:{name:`Doc`,role:`defender`},[M.rook]:{name:`Rook`,role:`defender`},[M.kapkan]:{name:`Kapkan`,role:`defender`},[M.tachanka]:{name:`Tachanka`,role:`defender`},[M.jager]:{name:`Jäger`,role:`defender`},[M.bandit]:{name:`Bandit`,role:`defender`},[M.frost]:{name:`Frost`,role:`defender`},[M.valkyrie]:{name:`Valkyrie`,role:`defender`},[M.caveira]:{name:`Caveira`,role:`defender`},[M.echo]:{name:`Echo`,role:`defender`},[M.mira]:{name:`Mira`,role:`defender`},[M.lesion]:{name:`Lesion`,role:`defender`},[M.ela]:{name:`Ela`,role:`defender`},[M.vigil]:{name:`Vigil`,role:`defender`},[M.alibi]:{name:`Alibi`,role:`defender`},[M.maestro]:{name:`Maestro`,role:`defender`},[M.clash]:{name:`Clash`,role:`defender`},[M.kaid]:{name:`Kaid`,role:`defender`},[M.mozzie]:{name:`Mozzie`,role:`defender`},[M.warden]:{name:`Warden`,role:`defender`},[M.goyo]:{name:`Goyo`,role:`defender`},[M.wamai]:{name:`Wamai`,role:`defender`},[M.oryx]:{name:`Oryx`,role:`defender`},[M.melusi]:{name:`Melusi`,role:`defender`},[M.aruni]:{name:`Aruni`,role:`defender`},[M.thunderbird]:{name:`Thunderbird`,role:`defender`},[M.thorn]:{name:`Thorn`,role:`defender`},[M.azami]:{name:`Azami`,role:`defender`},[M.solis]:{name:`Solis`,role:`defender`},[M.fenrir]:{name:`Fenrir`,role:`defender`},[M.tubarao]:{name:`Tubarao`,role:`defender`},[M.skopos]:{name:`Skopós`,role:`defender`},[M.denari]:{name:`Denari`,role:`defender`}}),F=Object.freeze({attacker:Object.entries(P).filter(([e,t])=>t.role===`attacker`).map(([e])=>({...P[s(Number(e))],id:s(Number(e))})),defender:Object.entries(P).filter(([e,t])=>t.role===`defender`).map(([e])=>({...P[s(Number(e))],id:s(Number(e))}))}),I=Object.freeze({favela:c(202283),fortress:c(293334),villa:c(286407),neighborhood:c(333785),themePark:c(229325),stadium:c(338641),outback:c(299534),yacht:c(62226),emeraldPlains:c(358871),chalet:c(62230),coastline:c(217482),bank:c(62228),consulate:c(62227),tower:c(255669),nighthavenLabs:c(375492),presidentialPlane:c(62225),house:c(62221),kafeDostoyevsky:c(62232),border:c(201746),closeQuarter:c(365400),lair:c(396234),herefordBase:c(62223),skyscraper:c(208094),cqbBasics:c(196157),oregon:c(62222),fortTruth:c(307723),kanal:c(62229),stadium2020:c(357300),clubhouse:c(62224),district:c(1193341205),shinden:c(359432),stadiumBravo:c(376421),muteCommTower:c(328922),doktorsLab:c(560244830)}),L=Object.freeze({[I.favela]:`Favela`,[I.fortress]:`Fortress`,[I.villa]:`Villa`,[I.neighborhood]:`Neighborhood`,[I.themePark]:`Theme Park`,[I.stadium]:`Stadium`,[I.outback]:`Outback`,[I.yacht]:`Yacht`,[I.emeraldPlains]:`Emerald Plains`,[I.chalet]:`Chalet`,[I.coastline]:`Coastline`,[I.bank]:`Bank`,[I.consulate]:`Consulate`,[I.tower]:`Tower`,[I.nighthavenLabs]:`Nighthaven Labs`,[I.presidentialPlane]:`Presidential Plane`,[I.house]:`House`,[I.kafeDostoyevsky]:`Kafe Dostoyevsky`,[I.border]:`Border`,[I.closeQuarter]:`Close Quarter`,[I.outback]:`Outback`,[I.lair]:`Lair`,[I.herefordBase]:`Hereford Base`,[I.skyscraper]:`Skyscraper`,[I.cqbBasics]:`CQB Basics`,[I.oregon]:`Oregon`,[I.outback]:`Outback`,318512:`Stadium`,[I.fortTruth]:`Fort Truth`,[I.kanal]:`Kanal`,[I.cqbBasics]:`CQB Basics`,[I.stadium2020]:`Stadium 2020`,[I.clubhouse]:`Clubhouse`,[I.district]:`District`,[I.shinden]:`Shinden`,[I.stadiumBravo]:`Stadium Bravo`,[I.muteCommTower]:`M.U.T.E Comm Tower`,[I.doktorsLab]:`Doktor's Lab`}),R=Object.freeze({notPlayed:l(0),inProgress:l(1),lost:l(2),enemiesEliminated:l(3),objectiveComplete:l(4),timeRanOut:l(5),enemiesSurrendered:l(6),unknownReason:l(7),matchCancelled:l(8)}),z=Object.freeze({[R.notPlayed]:`Not Played`,[R.inProgress]:`In Progress`,[R.lost]:`Lost`,[R.enemiesEliminated]:`Enemies Eliminated`,[R.objectiveComplete]:`Objective Complete`,[R.timeRanOut]:`Time ran out`,[R.enemiesSurrendered]:`Enemies Surrendered`,[R.unknownReason]:`Unknown Reason`,[R.matchCancelled]:`Match Cancelled`}),B=Object.freeze({day:h(177839),night:h(177840)}),V=Object.freeze({[B.day]:`Day`,[B.night]:`Night`}),H=n({game:`string`,type:`string`,creation_time:`number`}),U=[R.enemiesEliminated,R.objectiveComplete,R.timeRanOut,R.enemiesSurrendered,R.unknownReason];function W(e){return U.includes(e)}const G=[R.notPlayed,R.inProgress];function K(e){return!G.includes(e)}const q=H.and({game:`'siege'`}),J=q.and({type:`'local_player'`,content:{profile_id:r(n.string)}}),Y=()=>n({id:`number`,value:`string`}),X=n({kills:`number`,deaths:`number`,assists:`number`,score:`number`}),ie=n({instigator_player_id:r(n.number),receiver_player_id:r(n.number),damage_amount:`number`,remaining_health:`number`,pre_damage_health:`number`,max_health:`number`,damage_type:T,damage_team_type:E,damage_item_id:r(n.number).or(`null`),damage_item_instance_id:r(n.number).or(`null`),damage_time:`number`}),Z=n({index:`number`,rounds_until_next_segment:`number`,segment_size:`number`,segment_index:`number`,team_0:{role:S,state:r(n.number)},team_1:{role:S,state:r(n.number)}}),Q=n({id:`number`,name:Y(),time_of_day:Y()}),ae=n({player_id:r(n.number),final_health:`number`,final_life_state:C,operator_name:Y().or(`null`)}),oe=n({round_data:Z,damage_events:ie.array(),players:ae.array()}),se=q.and({type:`'match_started'`,content:{game_mode:r(n.string),game_type:Y(),match_type:r(n.string),match_id:r(n.string),map:Q,is_round_based:`boolean`,current_round_index:`number`,rounds:Z.array()}}),ce=q.and({type:`'module_loaded'`}),le=q.and({type:`'module_unloaded'`}),$=q.and({type:`'started_queuing'`,content:{game_mode:r(n.string),game_type:Y(),match_type:r(n.string)}}),ue=q.and({type:`'stopped_queuing'`}),de=q.and({type:`'unsupported_game_version'`,content:{hash:`string | null`,version:`string | null`}}),fe=q.and({type:`'match_ended'`}),pe=q.and({type:`'map_changed'`,content:{map:Q}}),me=q.and({type:`'operator_ban_voting_started'`,content:{team:b,index:`number`,side:S}}),he=q.and({type:`'operator_banned'`,content:{team:b,index:`number`,side:S,operator_name:Y().or(`null`)}}),ge=q.and({type:`'operator_ban_cleared'`,content:{team:b,index:`number`}}),_e=q.and({type:`'round_ended'`,content:oe}),ve=q.and({type:`'phase_changed'`,content:{phase:v}}),ye=q.and({type:`'player_joined'`,content:{player_id:r(n.number),profile_id:r(n.string),is_bot:`boolean`,is_enemy:`boolean`,is_squad_member:`boolean`,is_local_player:`boolean`,username:`string`,side:S,team:b,is_privacy_username:`boolean`,has_avatar_hidden:`boolean`,has_commend_streak:`boolean`,ping_id:`number`,match_stats:X,life_state:C,ping:`number`}}).pipe(e=>({...e,content:{...e.content,starting_side:e.content.side}})),be=q.and({type:`'player_left'`,content:{player_id:r(n.number)}}),xe=q.and({type:`'player_operator_changed'`,content:{player_id:r(n.number),operator_name:Y().or(`null`)}}),Se=q.and({type:`'player_location_changed'`,content:{player_id:r(n.number),location_name:`string`}}),Ce=q.and({type:`'player_side_changed'`,content:{player_id:r(n.number),side:S}}),we=q.and({type:`'player_stats_changed'`,content:{player_id:r(n.number),match_stats:X}}),Te=q.and({type:`'player_ping_updated'`,content:{player_id:r(n.number),ping:`number`}}),Ee=q.and({type:`'defuser_planted'`,content:{player_id:r(n.number)}}),De=q.and({type:`'defuser_sabotaged'`,content:{player_id:r(n.number)}}),Oe=q.and({type:`'defuser_picked_up'`,content:{player_id:r(n.number),initial:`boolean`}}),ke=q.and({type:`'defuser_dropped'`,content:{player_id:r(n.number)}}),Ae=q.and({type:`'player_life_state_changed'`,content:{player_id:r(n.number),life_state:C}}),je=q.and({type:`'player_died'`,content:{player_id:r(n.number),instigator_player_id:r(n.number)}}),Me=q.and({type:`'player_downed'`,content:{player_id:r(n.number),instigator_player_id:r(n.number)}}),Ne=q.and({type:`'player_ping_id_changed'`,content:{player_id:r(n.number),ping_id:`number`}}),Pe=q.and({type:`'player_team_changed'`,content:{player_id:r(n.number),team:b}}),Fe=q.and({type:`'game_log'`,content:{message:`string.json`}}),Ie=t({"#event1":`module_loaded | module_unloaded | unsupported_game_version | local_player | started_queuing | stopped_queuing | match_started | match_ended | map_changed | operator_ban_voting_started | operator_banned | operator_ban_cleared | round_ended | phase_changed | player_joined | player_left | player_operator_changed`,"#event2":`player_location_changed | player_side_changed | player_stats_changed | player_life_state_changed | player_died | player_downed | player_ping_id_changed | player_team_changed | defuser_planted | defuser_sabotaged | defuser_picked_up | defuser_dropped | player_ping_updated | game_log`,event:`event1 | event2`,module_loaded:ce,module_unloaded:le,unsupported_game_version:de,local_player:J,started_queuing:$,stopped_queuing:ue,match_started:se,match_ended:fe,map_changed:pe,operator_ban_voting_started:me,operator_banned:he,operator_ban_cleared:ge,round_ended:_e,phase_changed:ve,player_joined:ye,player_left:be,player_operator_changed:xe,player_location_changed:Se,player_side_changed:Ce,player_stats_changed:we,defuser_planted:Ee,defuser_sabotaged:De,defuser_picked_up:Oe,defuser_dropped:ke,player_ping_updated:Te,player_life_state_changed:Ae,player_died:je,player_downed:Me,player_ping_id_changed:Ne,player_team_changed:Pe,game_log:Fe}).export();function Le(){return{key:`siege`,events:Ie}}export{H as BaseEvent,g as SIEGE_BOT_ID,ne as SIEGE_DAMAGE_TEAM_TYPES,w as SIEGE_DAMAGE_TYPES,k as SIEGE_GAME_MODES_TO_ID,re as SIEGE_GAME_MODE_LABELS,_ as SIEGE_GAME_MODE_PHASES,A as SIEGE_GAME_MODE_TYPES_TO_ID,j as SIEGE_GAME_MODE_TYPE_LABELS,L as SIEGE_MAP_LABELS,I as SIEGE_MAP_TO_ID,D as SIEGE_MATCH_TYPES_TO_ID,O as SIEGE_MATCH_TYPE_LABELS,N as SIEGE_OPERATOR_LABELS,P as SIEGE_OPERATOR_META,M as SIEGE_OPERATOR_TO_ID,te as SIEGE_PLAYER_LIFE_STATES,R as SIEGE_ROUND_STATES_TO_ID,z as SIEGE_ROUND_STATE_LABELS,x as SIEGE_SIDES,F as SIEGE_SIDE_OPERATORS,y as SIEGE_TEAMS,V as SIEGE_TIME_OF_DAY_LABELS,B as SIEGE_TIME_OF_DAY_TO_ID,E as SiegeDamageTeamTypeSchema,T as SiegeDamageTypeSchema,m as SiegeGameMode,v as SiegeGameModePhaseSchema,o as SiegeGameModeTypeNameId,ee as SiegeItemObjectId,c as SiegeMapNameId,u as SiegeMatchId,p as SiegeMatchType,s as SiegeOperatorNameId,d as SiegePlayerId,C as SiegePlayerLifeStateSchema,f as SiegeProfileId,l as SiegeRoundState,S as SiegeSideSchema,b as SiegeTeamSchema,h as SiegeTimeOfDay,K as isSiegeRoundStateCompleted,W as isSiegeRoundStateVictory,Le as module};
|
|
1
|
+
import{Type as e,scope as t,type as n}from"arktype";function r(e){return e}function i(e){return e}function a(e){return e?t=>(e(t),t):i}const o=a(),s=a(),c=a(),l=a(),u=a(),d=a(),f=a(),ee=a(),p=a(),m=a(),h=a(),g=`00000000-0000-0000-0000-000000000000`,_=[`intro`,`planning`,`prep`,`action`,`results`,`invalid`,`first`],v=n(`string`),y=[0,1],b=n(`===`,...y),x=[`attacker`,`defender`,`both`,`invalid`],S=n(`string`),te=[`normal`,`overhealed`,`low_health`,`downed`,`dead`,`respawning`],C=n(`string`),w=`bullet.melee.explosive.falling.regeneration.unknown.debris.projectile.downed.gas.thermal_explosion.melee_gadget.barbed_wire.electric.reinforcement.frag.paralyzed.emp.break.cleanup.interrogation.melee-finisher.toxic.toxic-explosion.pneumatic.body-contact.contact-explosion.flash.parasite-spike.laser.concussion.blowtorch.taser-shield.reverse-friendly-fire.self-destroyed.area-control.fire.breach-kick.break-wall.blade-mine.melee-pushback.supressive-fire.gas-pipe-fire.invalid`.split(`.`),T=n(`string`),ne=[`unknown`,`enemy`,`friendly`,`invalid`],E=n(`string`),D=Object.freeze({quickPlay:p(`QUICK PLAY`),versusAi:p(`VERSUS AI`),standard:p(`STANDARD`),ranked:p(`RANKED`)}),O=Object.freeze({[D.quickPlay]:`Quick Play`,[D.versusAi]:`Versus AI`,[D.standard]:`Standard`,[D.ranked]:`Ranked`}),k=Object.freeze({teamDeathmatch:m(`TEAM DEATHMATCH`),goldenGun:m(`GOLDEN GUN`),freeForAll:m(`FREE FOR ALL`),weaponRoulette:m(`WEAPON ROULETTE`),dualFront:m(`DUAL FRONT`),bomb:m(`BOMB`),versusAi:m(`VERSUS AI`),hostage:m(`HOSTAGE`),threeVsThreeSecureArea:m(`3 VS 3 SECURE AREA`),targetDrill:m(`TARGET DRILL`),rengoku:m(`RENGOKU`),hideAndSeek:m(`HIDE AND SEEK`)}),re=Object.freeze({[k.teamDeathmatch]:`Team Deathmatch`,[k.goldenGun]:`Golden Gun`,[k.freeForAll]:`Free For All`,[k.weaponRoulette]:`Weapon Roulette`,[k.dualFront]:`Dual Front`,[k.bomb]:`Bomb`,[k.versusAi]:`Versus AI`,[k.hostage]:`Hostage`,[k.threeVsThreeSecureArea]:`3v3 Secure Area`,[k.targetDrill]:`Target Drill`,[k.rengoku]:`Rengoku`,[k.hideAndSeek]:`Hide and Seek`}),A=Object.freeze({ranked:o(205379),quickMatch:o(138115),customGame:o(62008),versusAi:o(397300),standard:o(393930),arcade:o(320109),siegeCup:o(414089),dualFront:o(420611),showdown:o(305544),trainingGrounds:o(-1),unranked:o(310813),deathmatch:o(420611),rengoku:o(359430),muteProtocol:o(368421),fieldTraining:o(423927),hideAndSeek:o(310854)}),j=Object.freeze({[A.quickMatch]:`Quick Match`,[A.ranked]:`Ranked`,[A.customGame]:`Custom Game`,[A.versusAi]:`Versus AI`,[A.standard]:`Standard`,[A.arcade]:`Arcade`,[A.siegeCup]:`Siege Cup`,[A.dualFront]:`Dual Front`,[A.showdown]:`Showdown`,[A.trainingGrounds]:`Training Grounds`,[A.unranked]:`Unranked`,[A.deathmatch]:`Deathmatch`,[A.rengoku]:`Rengoku`,[A.muteProtocol]:`M.U.T.E Protocol`,[A.fieldTraining]:`Field Training`,[A.hideAndSeek]:`Hide and Seek`}),M=Object.freeze({glaz:s(62242),blitz:s(62243),buck:s(62244),sledge:s(62245),ash:s(62246),thermite:s(62247),castle:s(62248),rook:s(62249),pulse:s(62250),doc:s(62251),mute:s(62252),smoke:s(62253),recruit:s(62555),thatcher:s(65143),twitch:s(65156),montagne:s(65159),bandit:s(65165),fuze:s(65168),kapkan:s(65171),tachanka:s(65174),jager:s(113049),iq:s(113052),frost:s(186159),blackbeard:s(187249),valkyrie:s(187252),caveira:s(207671),capitao:s(207674),echo:s(209180),hibana:s(209183),mira:s(222172),jackal:s(222182),ying:s(239334),lesion:s(239337),ela:s(254595),zofia:s(254606),dokkaebi:s(273652),vigil:s(273663),finka:s(281457),lion:s(281463),alibi:s(282399),maestro:s(285888),maverick:s(288504),clash:s(288526),nomad:s(293435),kaid:s(293436),gridlock:s(298589),mozzie:s(298616),nokk:s(299657),warden:s(299668),goyo:s(304196),amaru:s(308469),kali:s(310757),wamai:s(310768),oryx:s(317965),iana:s(317976),melusi:s(320062),ace:s(320073),zero:s(328927),aruni:s(328940),flores:s(334086),thunderbird:s(336466),osa:s(344493),thorn:s(349405),azami:s(354314),sens:s(357386),grim:s(365404),solis:s(376836),brava:s(382419),fenrir:s(386388),ram:s(392904),tubarao:s(395594),deimos:s(400504),striker:s(404278),sentry:s(404290),skopos:s(408405),rauora:s(421052),denari:s(2437779699)}),N=Object.freeze({[M.glaz]:`glaz`,[M.blitz]:`blitz`,[M.buck]:`buck`,[M.sledge]:`sledge`,[M.ash]:`ash`,[M.thermite]:`thermite`,[M.castle]:`castle`,[M.rook]:`rook`,[M.pulse]:`pulse`,[M.doc]:`doc`,[M.mute]:`mute`,[M.smoke]:`smoke`,[M.recruit]:`recruit`,[M.thatcher]:`thatcher`,[M.twitch]:`twitch`,[M.montagne]:`montagne`,[M.bandit]:`bandit`,[M.fuze]:`fuze`,[M.kapkan]:`kapkan`,[M.tachanka]:`tachanka`,[M.jager]:`jager`,[M.iq]:`iq`,[M.frost]:`frost`,[M.blackbeard]:`blackbeard`,[M.valkyrie]:`valkyrie`,[M.caveira]:`caveira`,[M.capitao]:`capitao`,[M.echo]:`echo`,[M.hibana]:`hibana`,[M.mira]:`mira`,[M.jackal]:`jackal`,[M.ying]:`ying`,[M.lesion]:`lesion`,[M.ela]:`ela`,[M.zofia]:`zofia`,[M.dokkaebi]:`dokkaebi`,[M.vigil]:`vigil`,[M.finka]:`finka`,[M.lion]:`lion`,[M.alibi]:`alibi`,[M.maestro]:`maestro`,[M.maverick]:`maverick`,[M.clash]:`clash`,[M.nomad]:`nomad`,[M.kaid]:`kaid`,[M.gridlock]:`gridlock`,[M.mozzie]:`mozzie`,[M.nokk]:`nokk`,[M.warden]:`warden`,[M.goyo]:`goyo`,[M.amaru]:`amaru`,[M.kali]:`kali`,[M.wamai]:`wamai`,[M.oryx]:`oryx`,[M.iana]:`iana`,[M.melusi]:`melusi`,[M.ace]:`ace`,[M.zero]:`zero`,[M.aruni]:`aruni`,[M.flores]:`flores`,[M.thunderbird]:`thunderbird`,[M.osa]:`osa`,[M.thorn]:`thorn`,[M.azami]:`azami`,[M.sens]:`sens`,[M.grim]:`grim`,[M.solis]:`solis`,[M.brava]:`brava`,[M.fenrir]:`fenrir`,[M.ram]:`ram`,[M.tubarao]:`tubarao`,[M.deimos]:`deimos`,[M.striker]:`striker`,[M.sentry]:`sentry`,[M.skopos]:`skopos`,[M.rauora]:`rauora`,[M.denari]:`denari`}),P=Object.freeze({[M.striker]:{name:`Striker`,role:`attacker`},[M.sledge]:{name:`Sledge`,role:`attacker`},[M.thatcher]:{name:`Thatcher`,role:`attacker`},[M.ash]:{name:`Ash`,role:`attacker`},[M.thermite]:{name:`Thermite`,role:`attacker`},[M.twitch]:{name:`Twitch`,role:`attacker`},[M.montagne]:{name:`Montagne`,role:`attacker`},[M.glaz]:{name:`Glaz`,role:`attacker`},[M.fuze]:{name:`Fuze`,role:`attacker`},[M.blitz]:{name:`Blitz`,role:`attacker`},[M.iq]:{name:`IQ`,role:`attacker`},[M.buck]:{name:`Buck`,role:`attacker`},[M.blackbeard]:{name:`Blackbeard`,role:`attacker`},[M.capitao]:{name:`Capitão`,role:`attacker`},[M.hibana]:{name:`Hibana`,role:`attacker`},[M.jackal]:{name:`Jackal`,role:`attacker`},[M.ying]:{name:`Ying`,role:`attacker`},[M.zofia]:{name:`Zofia`,role:`attacker`},[M.dokkaebi]:{name:`Dokkaebi`,role:`attacker`},[M.lion]:{name:`Lion`,role:`attacker`},[M.finka]:{name:`Finka`,role:`attacker`},[M.maverick]:{name:`Maverick`,role:`attacker`},[M.nomad]:{name:`Nomad`,role:`attacker`},[M.gridlock]:{name:`Gridlock`,role:`attacker`},[M.nokk]:{name:`Nøkk`,role:`attacker`},[M.amaru]:{name:`Amaru`,role:`attacker`},[M.kali]:{name:`Kali`,role:`attacker`},[M.iana]:{name:`Iana`,role:`attacker`},[M.ace]:{name:`Ace`,role:`attacker`},[M.zero]:{name:`Zero`,role:`attacker`},[M.flores]:{name:`Flores`,role:`attacker`},[M.osa]:{name:`Osa`,role:`attacker`},[M.sens]:{name:`Sens`,role:`attacker`},[M.grim]:{name:`Grim`,role:`attacker`},[M.brava]:{name:`Brava`,role:`attacker`},[M.ram]:{name:`Ram`,role:`attacker`},[M.deimos]:{name:`Deimos`,role:`attacker`},[M.rauora]:{name:`Rauora`,role:`attacker`},[M.sentry]:{name:`Sentry`,role:`defender`},[M.smoke]:{name:`Smoke`,role:`defender`},[M.mute]:{name:`Mute`,role:`defender`},[M.castle]:{name:`Castle`,role:`defender`},[M.pulse]:{name:`Pulse`,role:`defender`},[M.doc]:{name:`Doc`,role:`defender`},[M.rook]:{name:`Rook`,role:`defender`},[M.kapkan]:{name:`Kapkan`,role:`defender`},[M.tachanka]:{name:`Tachanka`,role:`defender`},[M.jager]:{name:`Jäger`,role:`defender`},[M.bandit]:{name:`Bandit`,role:`defender`},[M.frost]:{name:`Frost`,role:`defender`},[M.valkyrie]:{name:`Valkyrie`,role:`defender`},[M.caveira]:{name:`Caveira`,role:`defender`},[M.echo]:{name:`Echo`,role:`defender`},[M.mira]:{name:`Mira`,role:`defender`},[M.lesion]:{name:`Lesion`,role:`defender`},[M.ela]:{name:`Ela`,role:`defender`},[M.vigil]:{name:`Vigil`,role:`defender`},[M.alibi]:{name:`Alibi`,role:`defender`},[M.maestro]:{name:`Maestro`,role:`defender`},[M.clash]:{name:`Clash`,role:`defender`},[M.kaid]:{name:`Kaid`,role:`defender`},[M.mozzie]:{name:`Mozzie`,role:`defender`},[M.warden]:{name:`Warden`,role:`defender`},[M.goyo]:{name:`Goyo`,role:`defender`},[M.wamai]:{name:`Wamai`,role:`defender`},[M.oryx]:{name:`Oryx`,role:`defender`},[M.melusi]:{name:`Melusi`,role:`defender`},[M.aruni]:{name:`Aruni`,role:`defender`},[M.thunderbird]:{name:`Thunderbird`,role:`defender`},[M.thorn]:{name:`Thorn`,role:`defender`},[M.azami]:{name:`Azami`,role:`defender`},[M.solis]:{name:`Solis`,role:`defender`},[M.fenrir]:{name:`Fenrir`,role:`defender`},[M.tubarao]:{name:`Tubarao`,role:`defender`},[M.skopos]:{name:`Skopós`,role:`defender`},[M.denari]:{name:`Denari`,role:`defender`}}),F=Object.freeze({attacker:Object.entries(P).filter(([e,t])=>t.role===`attacker`).map(([e])=>({...P[s(Number(e))],id:s(Number(e))})),defender:Object.entries(P).filter(([e,t])=>t.role===`defender`).map(([e])=>({...P[s(Number(e))],id:s(Number(e))}))}),I=Object.freeze({favela:c(202283),fortress:c(293334),villa:c(286407),neighborhood:c(333785),themePark:c(229325),stadium:c(338641),outback:c(299534),yacht:c(62226),emeraldPlains:c(358871),chalet:c(62230),coastline:c(217482),bank:c(62228),consulate:c(62227),tower:c(255669),nighthavenLabs:c(375492),presidentialPlane:c(62225),house:c(62221),kafeDostoyevsky:c(62232),border:c(201746),closeQuarter:c(365400),lair:c(396234),herefordBase:c(62223),skyscraper:c(208094),cqbBasics:c(196157),oregon:c(62222),fortTruth:c(307723),kanal:c(62229),stadium2020:c(357300),clubhouse:c(62224),district:c(1193341205),shinden:c(359432),stadiumBravo:c(376421),muteCommTower:c(328922),doktorsLab:c(560244830)}),L=Object.freeze({[I.favela]:`Favela`,[I.fortress]:`Fortress`,[I.villa]:`Villa`,[I.neighborhood]:`Neighborhood`,[I.themePark]:`Theme Park`,[I.stadium]:`Stadium`,[I.outback]:`Outback`,[I.yacht]:`Yacht`,[I.emeraldPlains]:`Emerald Plains`,[I.chalet]:`Chalet`,[I.coastline]:`Coastline`,[I.bank]:`Bank`,[I.consulate]:`Consulate`,[I.tower]:`Tower`,[I.nighthavenLabs]:`Nighthaven Labs`,[I.presidentialPlane]:`Presidential Plane`,[I.house]:`House`,[I.kafeDostoyevsky]:`Kafe Dostoyevsky`,[I.border]:`Border`,[I.closeQuarter]:`Close Quarter`,[I.outback]:`Outback`,[I.lair]:`Lair`,[I.herefordBase]:`Hereford Base`,[I.skyscraper]:`Skyscraper`,[I.cqbBasics]:`CQB Basics`,[I.oregon]:`Oregon`,[I.outback]:`Outback`,318512:`Stadium`,[I.fortTruth]:`Fort Truth`,[I.kanal]:`Kanal`,[I.cqbBasics]:`CQB Basics`,[I.stadium2020]:`Stadium 2020`,[I.clubhouse]:`Clubhouse`,[I.district]:`District`,[I.shinden]:`Shinden`,[I.stadiumBravo]:`Stadium Bravo`,[I.muteCommTower]:`M.U.T.E Comm Tower`,[I.doktorsLab]:`Doktor's Lab`}),R=Object.freeze({notPlayed:l(0),inProgress:l(1),lost:l(2),enemiesEliminated:l(3),objectiveComplete:l(4),timeRanOut:l(5),enemiesSurrendered:l(6),unknownReason:l(7),matchCancelled:l(8)}),z=Object.freeze({[R.notPlayed]:`Not Played`,[R.inProgress]:`In Progress`,[R.lost]:`Lost`,[R.enemiesEliminated]:`Enemies Eliminated`,[R.objectiveComplete]:`Objective Complete`,[R.timeRanOut]:`Time ran out`,[R.enemiesSurrendered]:`Enemies Surrendered`,[R.unknownReason]:`Unknown Reason`,[R.matchCancelled]:`Match Cancelled`}),B=Object.freeze({day:h(177839),night:h(177840)}),V=Object.freeze({[B.day]:`Day`,[B.night]:`Night`}),H=n({game:`string`,type:`string`,creation_time:`number`}),U=[R.enemiesEliminated,R.objectiveComplete,R.timeRanOut,R.enemiesSurrendered,R.unknownReason];function W(e){return U.includes(e)}const G=[R.notPlayed,R.inProgress];function K(e){return!G.includes(e)}const q=H.and({game:`'siege'`}),J=q.and({type:`'local_player'`,content:{profile_id:r(n.string)}}),Y=()=>n({id:`number`,value:`string`}),X=n({kills:`number`,deaths:`number`,assists:`number`,score:`number`}),ie=n({instigator_player_id:r(n.number),receiver_player_id:r(n.number),damage_amount:`number`,remaining_health:`number`,pre_damage_health:`number`,max_health:`number`,damage_type:T,damage_team_type:E,damage_item_id:r(n.number).or(`null`),damage_item_instance_id:r(n.number).or(`null`),damage_time:`number`}),Z=n({index:`number`,rounds_until_next_segment:`number`,segment_size:`number`,segment_index:`number`,team_0:{role:S,state:r(n.number)},team_1:{role:S,state:r(n.number)}}),Q=n({name:Y(),time_of_day:Y()}),ae=n({player_id:r(n.number),final_health:`number`,final_life_state:C,operator_name:Y().or(`null`)}),oe=n({round_data:Z,damage_events:ie.array(),players:ae.array()}),se=q.and({type:`'match_started'`,content:{game_mode:r(n.string),game_type:Y(),match_type:r(n.string),match_id:r(n.string),map:Q,is_round_based:`boolean`,current_round_index:`number`,rounds:Z.array()}}),ce=q.and({type:`'module_loaded'`}),le=q.and({type:`'module_unloaded'`}),$=q.and({type:`'started_queuing'`,content:{game_mode:r(n.string),game_type:Y(),match_type:r(n.string)}}),ue=q.and({type:`'stopped_queuing'`}),de=q.and({type:`'unsupported_game_version'`,content:{hash:`string | null`,version:`string | null`}}),fe=q.and({type:`'match_ended'`}),pe=q.and({type:`'map_changed'`,content:{map:Q}}),me=q.and({type:`'operator_ban_voting_started'`,content:{team:b,index:`number`,side:S}}),he=q.and({type:`'operator_banned'`,content:{team:b,index:`number`,side:S,operator_name:Y().or(`null`)}}),ge=q.and({type:`'operator_ban_cleared'`,content:{team:b,index:`number`}}),_e=q.and({type:`'round_ended'`,content:oe}),ve=q.and({type:`'phase_changed'`,content:{phase:v}}),ye=q.and({type:`'player_joined'`,content:{player_id:r(n.number),profile_id:r(n.string),is_bot:`boolean`,is_enemy:`boolean`,is_squad_member:`boolean`,is_local_player:`boolean`,username:`string`,side:S,team:b,is_privacy_username:`boolean`,has_avatar_hidden:`boolean`,has_commend_streak:`boolean`,ping_id:`number`,match_stats:X,life_state:C,ping:`number`}}).pipe(e=>({...e,content:{...e.content,starting_side:e.content.side}})),be=q.and({type:`'player_left'`,content:{player_id:r(n.number)}}),xe=q.and({type:`'player_operator_changed'`,content:{player_id:r(n.number),operator_name:Y().or(`null`)}}),Se=q.and({type:`'player_location_changed'`,content:{player_id:r(n.number),location_name:`string`}}),Ce=q.and({type:`'player_side_changed'`,content:{player_id:r(n.number),side:S}}),we=q.and({type:`'player_stats_changed'`,content:{player_id:r(n.number),match_stats:X}}),Te=q.and({type:`'player_ping_updated'`,content:{player_id:r(n.number),ping:`number`}}),Ee=q.and({type:`'defuser_planted'`,content:{player_id:r(n.number)}}),De=q.and({type:`'defuser_sabotaged'`,content:{player_id:r(n.number)}}),Oe=q.and({type:`'defuser_picked_up'`,content:{player_id:r(n.number),initial:`boolean`}}),ke=q.and({type:`'defuser_dropped'`,content:{player_id:r(n.number)}}),Ae=q.and({type:`'player_life_state_changed'`,content:{player_id:r(n.number),life_state:C}}),je=q.and({type:`'player_died'`,content:{player_id:r(n.number),instigator_player_id:r(n.number)}}),Me=q.and({type:`'player_downed'`,content:{player_id:r(n.number),instigator_player_id:r(n.number)}}),Ne=q.and({type:`'player_ping_id_changed'`,content:{player_id:r(n.number),ping_id:`number`}}),Pe=q.and({type:`'player_team_changed'`,content:{player_id:r(n.number),team:b}}),Fe=q.and({type:`'game_log'`,content:{message:`string.json`}}),Ie=t({"#event1":`module_loaded | module_unloaded | unsupported_game_version | local_player | started_queuing | stopped_queuing | match_started | match_ended | map_changed | operator_ban_voting_started | operator_banned | operator_ban_cleared | round_ended | phase_changed | player_joined | player_left | player_operator_changed`,"#event2":`player_location_changed | player_side_changed | player_stats_changed | player_life_state_changed | player_died | player_downed | player_ping_id_changed | player_team_changed | defuser_planted | defuser_sabotaged | defuser_picked_up | defuser_dropped | player_ping_updated | game_log`,event:`event1 | event2`,module_loaded:ce,module_unloaded:le,unsupported_game_version:de,local_player:J,started_queuing:$,stopped_queuing:ue,match_started:se,match_ended:fe,map_changed:pe,operator_ban_voting_started:me,operator_banned:he,operator_ban_cleared:ge,round_ended:_e,phase_changed:ve,player_joined:ye,player_left:be,player_operator_changed:xe,player_location_changed:Se,player_side_changed:Ce,player_stats_changed:we,defuser_planted:Ee,defuser_sabotaged:De,defuser_picked_up:Oe,defuser_dropped:ke,player_ping_updated:Te,player_life_state_changed:Ae,player_died:je,player_downed:Me,player_ping_id_changed:Ne,player_team_changed:Pe,game_log:Fe}).export();function Le(){return{key:`siege`,events:Ie}}export{H as BaseEvent,g as SIEGE_BOT_ID,ne as SIEGE_DAMAGE_TEAM_TYPES,w as SIEGE_DAMAGE_TYPES,k as SIEGE_GAME_MODES_TO_ID,re as SIEGE_GAME_MODE_LABELS,_ as SIEGE_GAME_MODE_PHASES,A as SIEGE_GAME_MODE_TYPES_TO_ID,j as SIEGE_GAME_MODE_TYPE_LABELS,L as SIEGE_MAP_LABELS,I as SIEGE_MAP_TO_ID,D as SIEGE_MATCH_TYPES_TO_ID,O as SIEGE_MATCH_TYPE_LABELS,N as SIEGE_OPERATOR_LABELS,P as SIEGE_OPERATOR_META,M as SIEGE_OPERATOR_TO_ID,te as SIEGE_PLAYER_LIFE_STATES,R as SIEGE_ROUND_STATES_TO_ID,z as SIEGE_ROUND_STATE_LABELS,x as SIEGE_SIDES,F as SIEGE_SIDE_OPERATORS,y as SIEGE_TEAMS,V as SIEGE_TIME_OF_DAY_LABELS,B as SIEGE_TIME_OF_DAY_TO_ID,E as SiegeDamageTeamTypeSchema,T as SiegeDamageTypeSchema,m as SiegeGameMode,v as SiegeGameModePhaseSchema,o as SiegeGameModeTypeNameId,ee as SiegeItemObjectId,c as SiegeMapNameId,u as SiegeMatchId,p as SiegeMatchType,s as SiegeOperatorNameId,d as SiegePlayerId,C as SiegePlayerLifeStateSchema,f as SiegeProfileId,l as SiegeRoundState,S as SiegeSideSchema,b as SiegeTeamSchema,h as SiegeTimeOfDay,K as isSiegeRoundStateCompleted,W as isSiegeRoundStateVictory,Le as module};
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@overlayed/app",
|
|
3
3
|
"author": "overlayed.gg",
|
|
4
4
|
"homepage": "https://overlayed.gg",
|
|
5
|
-
"version": "0.
|
|
5
|
+
"version": "0.26.0",
|
|
6
6
|
"description": "Overlayed app",
|
|
7
7
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
8
8
|
"repository": {
|
|
@@ -69,8 +69,8 @@
|
|
|
69
69
|
"@overlayed/events": "0.0.4",
|
|
70
70
|
"@overlayed/native-managers": "0.0.4",
|
|
71
71
|
"@overlayed/siege": "0.0.5",
|
|
72
|
-
"@overlayed/utils": "0.0.4",
|
|
73
|
-
"@overlayed/utils
|
|
72
|
+
"@overlayed/utils-node": "0.0.4",
|
|
73
|
+
"@overlayed/utils": "0.0.4"
|
|
74
74
|
},
|
|
75
75
|
"dependencies": {
|
|
76
76
|
"arktype": "^2.1.22",
|