overlay-toolkit 0.13.1 → 0.13.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/overlay-toolkit.js
CHANGED
|
@@ -437,7 +437,7 @@ class S {
|
|
|
437
437
|
t(this, "base");
|
|
438
438
|
t(this, "bytes");
|
|
439
439
|
t(this, "mask");
|
|
440
|
-
this.addr = s.addr, this.base = s.base, this.valid ? (this.bytes = o(s.bytes), this.mask = s.mask) : (this.bytes = new Uint8Array(), this.mask = []);
|
|
440
|
+
this.addr = (s == null ? void 0 : s.addr) ?? 0, this.base = (s == null ? void 0 : s.base) ?? 0, this.valid ? (this.bytes = o(s.bytes), this.mask = s.mask) : (this.bytes = new Uint8Array(), this.mask = []);
|
|
441
441
|
}
|
|
442
442
|
get valid() {
|
|
443
443
|
return !!this.addr;
|
|
@@ -491,7 +491,7 @@ class A {
|
|
|
491
491
|
t(this, "length");
|
|
492
492
|
t(this, "bytes");
|
|
493
493
|
t(this, "value");
|
|
494
|
-
this.addr = s.addr, this.length = s.len, this.valid ? (this.bytes = o(s.bytes), this.value = s.value) : this.bytes = new Uint8Array();
|
|
494
|
+
this.addr = (s == null ? void 0 : s.addr) ?? 0, this.length = (s == null ? void 0 : s.len) ?? 0, this.valid ? (this.bytes = o(s.bytes), this.value = s.value) : this.bytes = new Uint8Array();
|
|
495
495
|
}
|
|
496
496
|
get valid() {
|
|
497
497
|
return !!this.addr && !!this.length;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(n,o){typeof exports=="object"&&typeof module<"u"?o(exports):typeof define=="function"&&define.amd?define(["exports"],o):(n=typeof globalThis<"u"?globalThis:n||self,o(n.overlayToolkit={}))})(this,function(n){"use strict";var Re=Object.defineProperty;var _e=(n,o,p)=>o in n?Re(n,o,{enumerable:!0,configurable:!0,writable:!0,value:p}):n[o]=p;var t=(n,o,p)=>_e(n,typeof o!="symbol"?o+"":o,p);function o(r){let s=null;return r instanceof ArrayBuffer?s=new Uint8Array(r):s=new Uint8Array(r.buffer,r.byteOffset,r.byteLength),[...s].map(e=>e.toString(16).padStart(2,"0")).join("")}function p(r){const s=new Uint8Array(Math.ceil(r.length/2));for(let e=0;e<r.length;)s[e/2]=Number.parseInt(r.slice(e,e+=2),16);return s}function ve(r){return new ke(r)}class ke extends EventTarget{constructor(e){super();t(this,"onconnect",null);t(this,"ondisconnect",null);t(this,"devices",new Map);this.api=e,this.addListener()}dispatchEvent(e){return e.type==="connect"&&this.onconnect&&this.onconnect.call(this,e),e.type==="disconnect"&&this.ondisconnect&&this.ondisconnect.call(this,e),super.dispatchEvent(e),!e.defaultPrevented}async getDevices(){const e=await this.requestGetDevices();let a=[];return e.forEach(i=>{if(this.devices.has(i.instanceId))a.push(this.devices.get(i.instanceId));else{const h=new m(this.api,i);this.devices.set(i.instanceId,h),a.push(h)}}),a}async requestDevice(e){return e&&console.log("Requesting device with options:",e),this.getDevices()}async requestGetDevices(){return(await l(this.api,"getDevices",{})).devices}addListener(){this.api.addOverlayListener("otk::hid::inputreport",e=>this.callbackInputReport(e)),this.api.addOverlayListener("otk::hid::devicechanged",e=>this.callbackDeviceChanged(e))}callbackInputReport(e){const a=e.instanceId,i=p(e.data),h=this.devices.get(a);h?h.dispatchEvent(new De("inputreport",h,i[0],new DataView(i.buffer,1))):console.warn("Device not found:",a)}callbackDeviceChanged(e){var a=e.add;const i=new m(this.api,e.device),h=new be(a?"connect":"disconnect",i);this.dispatchEvent(h)}}async function l(r,s,e){const a={call:"otk::hid",type:s,...e},i=await r.callOverlayHandler(a);return i.error&&console.log("callOverlayHID error:",s,e,i),i}class m extends EventTarget{constructor(e,a){super();t(this,"instanceId");t(this,"opened",!1);t(this,"vendorId");t(this,"productId");t(this,"productName");t(this,"collections");t(this,"oninputreport",null);this.api=e,this.instanceId=a.instanceId,this.vendorId=a.vendorId,this.productId=a.productId,this.productName=a.productName,this.collections=a.collections||[]}dispatchEvent(e){return e.type==="inputreport"&&this.oninputreport&&this.oninputreport.call(this,e),super.dispatchEvent(e),!e.defaultPrevented}async open(){this.opened||(await this.request("open",{}),this.opened=!0)}async close(){this.opened&&(await this.request("close",{}),this.opened=!1)}async forget(){}async sendReport(e,a){if(!this.opened)throw new Error("Device is not opened.");await this.request("send",{reportId:e,data:o(a)})}async sendFeatureReport(e,a){if(!this.opened)throw new Error("Device is not opened.");await this.request("sendFeature",{reportId:e,data:o(a)})}async receiveFeatureReport(e){if(!this.opened)throw new Error("Device is not opened.");const a=await this.request("recvFeature",{reportId:e}),i=p(a.data);return new DataView(i.buffer)}async request(e,a){return l(this.api,e,{instanceId:this.instanceId,...a})}}class be extends Event{constructor(e,a){super(e);t(this,"device");this.device=a}}class De extends Event{constructor(e,a,i,h){super(e);t(this,"device");t(this,"reportId");t(this,"data");this.device=a,this.reportId=i,this.data=h}}class Pe{constructor(s=null){t(this,"subscribers",new Map);t(this,"queue",[]);this.transport=s,s&&this.setTransport(s)}setTransport(s){this.transport=s,this.transport.addEventListener("message",e=>{this.dispatchOverlayEvent(e.detail)}),this.transport.addEventListener("connected",this.onTransportConnected.bind(this))}dispatchOverlayEvent(s){const e=this.subscribers.get(s.type);if(e)for(const a of e)a(s)}addOverlayListener(s,e){this.subscribers.has(s)||this.subscribers.set(s,[]),this.subscribers.get(s).push(e)}setOverlayListener(s,e){this.subscribers.set(s,[e])}removeOverlayListener(s,e){if(!this.subscribers.has(s))return;const a=this.subscribers.get(s);if(!e){a.length=0;return}const i=a.indexOf(e);i!==-1&&a.splice(i,1)}async callOverlayHandler(s){return!this.transport||!this.transport.connected?(console.warn("OverlayPluginAPI: Transport not connected, queuing message",s),new Promise(a=>{this.queue.push([s,a])})):this.transport.sendMessage(s)}startOverlayEvents(){var s={call:"subscribe",events:Array.from(this.subscribers.keys())};this.callOverlayHandler(s)}onTransportConnected(){if(!this.transport||!this.transport.connected||this.queue.length===0)return;console.log("OverlayPluginAPI: Transport connected, sending queued messages");let s=this.queue;this.queue=[];for(let[e,a]of s)this.transport.sendMessage(e).then(a)}get isConnected(){var s;return((s=this.transport)==null?void 0:s.connected)??!1}}class Ne extends EventTarget{constructor(){super(...arguments);t(this,"connected",!1);t(this,"evtHandlerWrapper",e=>{this.dispatchEvent(new CustomEvent("message",{detail:e}))})}get transportType(){return"plugin"}sendMessage(e){return new Promise(a=>{window.OverlayPluginApi.callHandler(JSON.stringify(e),i=>a(JSON.parse(i)))})}waitForApi(){if(!window.OverlayPluginApi||!window.OverlayPluginApi.ready){setTimeout(()=>this.waitForApi(),300);return}window.__OverlayCallback=this.evtHandlerWrapper,this.connected=!0,this.dispatchEvent(new Event("connected"))}}class Ce extends EventTarget{constructor(e){super();t(this,"ws");t(this,"sequence",0);t(this,"responseResolvers",new Map);t(this,"evtHandler",()=>{});t(this,"connected",!1);this.ws=new WebSocket(e),this.connect(this.ws)}connect(e){e.addEventListener("open",this.onOpen.bind(this)),e.addEventListener("error",this.onError.bind(this)),e.addEventListener("message",this.onMessage.bind(this)),e.addEventListener("close",this.onClosed.bind(this))}onError(e){console.error(e)}onOpen(){console.log("WebSocket connected"),this.connected=!0,this.dispatchEvent(new Event("connected"))}onMessage(e){try{const a=JSON.parse(e.data);if("rseq"in a){const i=a.rseq;this.responseResolvers.has(i)&&(this.responseResolvers.get(i)(a),this.responseResolvers.delete(i))}else this.dispatchEvent(new CustomEvent("message",{detail:a}))}catch{console.error("Failed to parse WebSocket message",e)}}onClosed(e){console.log("WebSocket closed",e),this.connected=!1,setTimeout(()=>{console.log("WebSocket reconnecting..."),this.ws=new WebSocket(this.ws.url),this.connect(this.ws)},3e3)}get transportType(){return"websocket"}sendMessage(e){const a=this.sequence++;return e.rseq=a,new Promise(i=>{this.responseResolvers.set(a,i),this.ws.send(JSON.stringify(e))})}set eventHandler(e){this.evtHandler=e}}const Ee=r=>({call:"otk::filesystem",action:"show_save_file_picker",options:r}),Me=r=>({call:"otk::filesystem",action:"show_open_file_picker",options:r}),Fe=r=>({call:"otk::filesystem",action:"file_info",handle:r}),w=(r,s)=>({call:"otk::filesystem",action:"read_file",handle:r,binary:s}),xe=(r,s)=>({call:"otk::filesystem",action:"open_write",handle:r,truncate:s}),He=(r,s)=>({call:"otk::filesystem",action:"write_file",handle:r,data:typeof s=="string"?s:btoa(String.fromCharCode(...new Uint8Array(s))),binary:typeof s!="string"}),I=(r,s,e)=>({call:"otk::filesystem",action:"file_op",handle:r,operation:s,param:e});class Se{constructor(s){t(this,"api");this.api=s}async showSaveFilePicker(s){const e=await this.api.callOverlayHandler(Ee(s));if(e.aborted)throw DOMException.ABORT_ERR;if(e&&e.handle&&e.name)return new u(this.api,e.handle,e.name);throw new Error(e.Error??"Failed to get file handle")}async showOpenFilePicker(s){const e=await this.api.callOverlayHandler(Me(s));if(e.aborted)throw DOMException.ABORT_ERR;if(e&&e.files&&Array.isArray(e.files))return e.files.map(a=>new u(this.api,a.handle,a.name));throw new Error(e.Error??"Failed to get file handles")}}class u{constructor(s,e,a){t(this,"kind","file");t(this,"name");t(this,"handle");t(this,"api");this.api=s,this.handle=e,this.name=a}async createWritable(s){const e=await this.api.callOverlayHandler(xe(this.handle,s==null?void 0:s.keepExistingData));if(e&&e.handle)return new Oe(this.api,e.handle);throw new Error(e.Error??"Failed to create writable stream")}async getFile(){const s=await this.api.callOverlayHandler(Fe(this.handle));if(s&&s.handle&&s.name)return new Te(this.api,s);throw new Error(s.Error??"Failed to get file")}isSameEntry(s){return s instanceof u?Promise.resolve(this.handle===s.handle):Promise.resolve(!1)}}class Te{constructor(s,e){t(this,"handle");t(this,"api");t(this,"lastModified");t(this,"name");t(this,"webkitRelativePath");t(this,"size");t(this,"type");this.api=s,this.handle=e.handle,this.name=e.name,this.size=e.size,this.type=e.type,this.lastModified=e.lastModified,this.webkitRelativePath=e.webkitRelativePath||""}arrayBuffer(){return this.bytes().then(s=>s.buffer)}async bytes(){const s=await this.api.callOverlayHandler(w(this.handle,!0));if(s&&s.data)return Uint8Array.from(atob(s.data),e=>e.charCodeAt(0));throw new Error(s.Error??"Failed to read file")}async text(){const s=await this.api.callOverlayHandler(w(this.handle,!1));if(s&&s.text)return s.text;throw new Error(s.Error??"Failed to read file")}slice(s,e,a){throw new Error("Method not implemented.")}stream(){throw new Error("Method not implemented.")}}class Oe{constructor(s,e){t(this,"locked",!1);t(this,"handle");t(this,"api");this.api=s,this.handle=e}seek(s){return this.api.callOverlayHandler(I(this.handle,"seek",s))}truncate(s){return this.api.callOverlayHandler(I(this.handle,"truncate",s))}writeData(s){return this.api.callOverlayHandler(He(this.handle,s))}write(s){return typeof s=="string"||s instanceof ArrayBuffer?this.writeData(s):s instanceof Uint8Array?this.writeData(s.buffer):s instanceof Blob?s.arrayBuffer().then(e=>this.writeData(e)):Promise.reject(new Error("Unsupported data type for writing"))}close(){return this.api.callOverlayHandler(I(this.handle,"close"))}abort(s){throw new Error("Method not implemented.")}getWriter(){throw new Error("Method not implemented.")}}class y{constructor(s){t(this,"addr");t(this,"base");t(this,"bytes");t(this,"mask");this.addr=s.addr,this.base=s.base,this.valid?(this.bytes=p(s.bytes),this.mask=s.mask):(this.bytes=new Uint8Array,this.mask=[])}get valid(){return!!this.addr}getNthRange(s){let e=0;for(let a=0;a<this.mask.length;a++)if(!this.mask[a]){let i;for(i=a;i<this.mask.length&&!this.mask[i];i++);if(e==s)return{begin:a,end:i};e++,a=i}return{begin:0,end:0}}getNthMasked(s){let e=this.getNthRange(s);return e.end>e.begin?this.bytes.slice(e.begin,e.end):null}getDataView(s){let e=this.getNthRange(s);return e.end>e.begin?new DataView(this.bytes.buffer,this.bytes.byteOffset+e.begin,Math.min(this.bytes.byteLength,e.end-e.begin)):null}getRelativePointer(s){let e=this.getNthRange(s);if(e.end<=e.begin)return 0;const i=new DataView(this.bytes.buffer,this.bytes.byteOffset,this.bytes.byteLength).getInt32(e.begin,!0);return this.addr+i+e.begin+4}}class f{constructor(s){t(this,"addr");t(this,"length");t(this,"bytes");t(this,"value");this.addr=s.addr,this.length=s.len,this.valid?(this.bytes=p(s.bytes),this.value=s.value):this.bytes=new Uint8Array}get valid(){return!!this.addr&&!!this.length}get dataView(){return new DataView(this.bytes.buffer,this.bytes.byteOffset,this.bytes.byteLength)}}class Ae{constructor(s){t(this,"headers");t(this,"ok");t(this,"status");t(this,"statusText");t(this,"type");t(this,"url");t(this,"redirected",!1);t(this,"body",null);t(this,"bodyUsed",!1);t(this,"_bodyContent");this.headers=new Headers;for(const e in s.headers)this.headers.append(e,s.headers[e]);this.ok=s.ok,this.status=s.status,this.statusText=s.statusText,this.type=s.type,this.url=s.url,this._bodyContent=s.body}clone(){throw new Error("Method not implemented.")}text(){return Promise.resolve(this._bodyContent)}json(){return Promise.resolve(JSON.parse(this._bodyContent))}arrayBuffer(){return this.bytes().then(s=>s.buffer)}formData(){throw new Error("Method not implemented.")}blob(){throw new Error("Method not implemented.")}bytes(){return Promise.resolve(Uint8Array.from(this._bodyContent,s=>s.charCodeAt(0)))}}class v{constructor(){t(this,"hid");t(this,"fs");t(this,"api",new Pe);t(this,"handlerMap",new Map);this.hid=ve(this.api),this.fs=new Se(this.api)}Fetch(s,e={}){const a={call:"Fetch",resource:s,options:e};return this.api.callOverlayHandler(a)}async fetch(s,e={}){const a={call:"otk::fetch",resource:s,options:e},i=await this.api.callOverlayHandler(a);if(!i)throw new Error("method not found");return new Ae(i)}async SubscribePacket(s,e,a){const i={call:"otk::packet",action:"subscribe",name:s,evt_name:"otk::packet::"+s,filters:e},h=await this.api.callOverlayHandler(i);if(!h)throw new Error("method not found");if(h.error)throw new Error(h.error);return h.evt_name?(this.api.setOverlayListener(h.evt_name,d=>this.packetHandler(d,!1)),this.api.startOverlayEvents()):console.warn("plugin does not support evt_name for packet subscription, may < 0.4.0"),this.handlerMap.set(h.name||s,{handler:a,evt_name:h.evt_name}),h.name||s}async UnsubscribePacket(s){const e={call:"otk::packet",action:"unsubscribe",name:s},a=await this.api.callOverlayHandler(e);if(a!=null&&a.error)throw new Error(a.error);if(this.handlerMap.has(s)){const i=this.handlerMap.get(s);i.evt_name&&this.api.removeOverlayListener(i.evt_name),this.handlerMap.delete(s)}}packetHandler(s,e=!1){let a=s,i=s;i.data=Uint8Array.from(atob(a.msg),d=>d.charCodeAt(0));let h=this.handlerMap.get(a.name);if(h){if(e&&h.evt_name)return;h.handler(i)}else e||console.warn("No packet handler for name",a.name)}async GetGameVersion(){const s={call:"otk::game_ver"};return this.api.callOverlayHandler(s)}async GetPluginVersion(){return(await this.GetPluginInfo()).version}async GetPluginInfo(){const s={call:"otk::plugin_ver"};return await this.api.callOverlayHandler(s)}async OpenBrowser(s){const e={call:"otk::open_browser",url:s},a=await this.api.callOverlayHandler(e);if(a!=null&&a.Error)throw new Error(a.Error)}async MemoryScanSig(s,e,a=0){const i={call:"otk::memory",action:"sig_scanner",sig:s,started_at:a,offset:e},h=await this.api.callOverlayHandler(i);if(h!=null&&h.Error)throw new Error(h.Error);return new y(h)}async MemoryRead(s,e){const a={call:"otk::memory",action:"read",addr:s,length:e},i=await this.api.callOverlayHandler(a);if(i!=null&&i.Error)throw new Error(i.Error);return new f(i)}Start(){this.api.addOverlayListener("otk::packet",s=>this.packetHandler(s,!0)),this.api.startOverlayEvents()}Dispatch(s){this.api.dispatchOverlayEvent(s)}AddListener(s,e){this.api.addOverlayListener(s,e)}RemoveListener(s,e){this.api.removeOverlayListener(s,e)}Call(s){return this.api.callOverlayHandler(s)}IsOverlayPluginCEF(){return"OverlayPluginApi"in window}tryConnectToCEF(){if(!this.IsOverlayPluginCEF()){setTimeout(()=>this.tryConnectToCEF(),300);return}const s=new Ne;this.api.setTransport(s),s.waitForApi()}Connect(s=""){if(this.tryConnectToCEF(),s||(s=new URLSearchParams(location.search).get("OVERLAY_WS")),s){if(this.IsOverlayPluginCEF()){console.warn("OverlayToolkit: Connect wsUrl ignored in OverlayPlugin CEF environment");return}const e=new Ce(s);this.api.setTransport(e)}}get isConnected(){return this.api.isConnected}}class c{constructor(s,e){t(this,"type");t(this,"typeCode");t(this,"time");this.typeCode=parseInt(e[0]),this.time=e[1],this.type=s}get timeDate(){return new Date(this.time)}}class k extends c{constructor(e){super("LogLine",e);t(this,"code");t(this,"name");t(this,"line");this.code=e[2],this.name=e[3],this.line=e[4]}}class b extends c{constructor(e){super("ChangeZone",e);t(this,"zoneID");t(this,"zoneName");this.zoneID=parseInt(e[2],16),this.zoneName=e[3]}}class D extends c{constructor(e){super("ChangePrimaryPlayer",e);t(this,"charID");t(this,"charName");this.charID=parseInt(e[2],16),this.charName=e[3]}get charIDHex(){return this.charID.toString(16).toUpperCase()}}class P extends c{constructor(e){super("AddCombatant",e);t(this,"id");t(this,"name");t(this,"job");t(this,"level");t(this,"ownerID");t(this,"worldID");t(this,"worldName");t(this,"npcNameID");t(this,"npcBaseID");t(this,"currentHP");t(this,"hp");t(this,"currentMP");t(this,"mp");t(this,"x");t(this,"y");t(this,"z");t(this,"heading");this.id=parseInt(e[2],16),this.name=e[3],this.job=parseInt(e[4],16),this.level=parseInt(e[5],16),this.ownerID=parseInt(e[6],16),this.worldID=parseInt(e[7],16),this.worldName=e[8],this.npcNameID=parseInt(e[9]),this.npcBaseID=parseInt(e[10]),this.currentHP=parseInt(e[11]),this.hp=parseInt(e[12]),this.currentMP=parseInt(e[13]),this.mp=parseInt(e[14]),this.x=parseFloat(e[17]),this.y=parseFloat(e[18]),this.z=parseFloat(e[19]),this.heading=parseFloat(e[20])}}class N extends c{constructor(e){super("RemoveCombatant",e);t(this,"id");t(this,"name");t(this,"job");t(this,"level");t(this,"ownerID");t(this,"world");t(this,"npcNameID");t(this,"npcBaseID");t(this,"currentHP");t(this,"hp");t(this,"currentMP");t(this,"mp");t(this,"x");t(this,"y");t(this,"z");t(this,"heading");this.id=parseInt(e[2],16),this.name=e[3],this.job=parseInt(e[4],16),this.level=parseInt(e[5],16),this.ownerID=parseInt(e[6],16),this.world=e[8],this.npcNameID=parseInt(e[9]),this.npcBaseID=parseInt(e[10]),this.currentHP=parseInt(e[11]),this.hp=parseInt(e[12]),this.currentMP=parseInt(e[13]),this.mp=parseInt(e[14]),this.x=parseFloat(e[17]),this.y=parseFloat(e[18]),this.z=parseFloat(e[19]),this.heading=parseFloat(e[20])}}class C extends c{constructor(e){super("PartyChanged",e);t(this,"party");this.party=[];let a=parseInt(e[2]);for(let i=0;i<a;i++)this.party.push(parseInt(e[3+i],16))}}class E extends c{constructor(e){super("PlayerStats",e);t(this,"job");t(this,"strength");t(this,"dexterity");t(this,"vitality");t(this,"intelligence");t(this,"mind");t(this,"piety");t(this,"attackPower");t(this,"directHit");t(this,"criticalHit");t(this,"attakcMagicPotency");t(this,"healingMagicPotency");t(this,"determination");t(this,"skillSpeed");t(this,"spellSpeed");t(this,"tenacity");t(this,"localContentID");this.job=parseInt(e[2],16),this.strength=parseInt(e[3]),this.dexterity=parseInt(e[4]),this.vitality=parseInt(e[5]),this.intelligence=parseInt(e[6]),this.mind=parseInt(e[7]),this.piety=parseInt(e[8]),this.attackPower=parseInt(e[9]),this.directHit=parseInt(e[10]),this.criticalHit=parseInt(e[11]),this.attakcMagicPotency=parseInt(e[12]),this.healingMagicPotency=parseInt(e[13]),this.determination=parseInt(e[14]),this.skillSpeed=parseInt(e[15]),this.spellSpeed=parseInt(e[16]),this.tenacity=parseInt(e[18]),this.localContentID=parseInt(e[19],16)}}class M extends c{constructor(e){super("NetworkStartsCasting",e);t(this,"sourceID");t(this,"sourceName");t(this,"id");t(this,"ability");t(this,"targetID");t(this,"targetName");t(this,"castTime");t(this,"x");t(this,"y");t(this,"z");t(this,"heading");this.sourceID=parseInt(e[2],16),this.sourceName=e[3],this.id=parseInt(e[4],16),this.ability=e[5],this.targetID=parseInt(e[6],16),this.targetName=e[7],this.castTime=parseFloat(e[8]),this.x=parseFloat(e[9]),this.y=parseFloat(e[10]),this.z=parseFloat(e[11]),this.heading=parseFloat(e[12])}}class F extends c{constructor(e){super(e[0]=="22"?"NetworkAOEAbility":"NetworkAbility",e);t(this,"sourceID");t(this,"sourceName");t(this,"id");t(this,"ability");t(this,"targetID");t(this,"targetName");t(this,"effects");t(this,"targetCurrentHP");t(this,"targetMaxHP");t(this,"targetCurrentMP");t(this,"targetMaxMP");t(this,"targetX");t(this,"targetY");t(this,"targetZ");t(this,"targetHeading");t(this,"currentHP");t(this,"maxHP");t(this,"currentMP");t(this,"maxMP");t(this,"x");t(this,"y");t(this,"z");t(this,"heading");t(this,"sequence");t(this,"targetIndex");t(this,"targetCount");t(this,"ownerID");t(this,"ownerName");t(this,"effectDisplayType");t(this,"actionID");t(this,"actionAnimationID");t(this,"animationLockTime");t(this,"rotationHex");this.sourceID=parseInt(e[2],16),this.sourceName=e[3],this.id=parseInt(e[4],16),this.ability=e[5],this.targetID=parseInt(e[6],16),this.targetName=e[7],this.effects=[];for(let a=0;a<8;a++)this.effects[a]={flags:parseInt(e[8+a*2],16),damage:e[9+a*2]};this.targetCurrentHP=parseInt(e[24]),this.targetMaxHP=parseInt(e[25]),this.targetCurrentMP=parseInt(e[26]),this.targetMaxMP=parseInt(e[27]),this.targetX=parseFloat(e[30]),this.targetY=parseFloat(e[31]),this.targetZ=parseFloat(e[32]),this.targetHeading=parseFloat(e[33]),this.currentHP=parseInt(e[34]),this.maxHP=parseInt(e[35]),this.currentMP=parseInt(e[36]),this.maxMP=parseInt(e[37]),this.x=parseFloat(e[40]),this.y=parseFloat(e[41]),this.z=parseFloat(e[42]),this.heading=parseFloat(e[43]),this.sequence=parseInt(e[44],16),this.targetIndex=parseInt(e[45]),this.targetCount=parseInt(e[46]),this.ownerID=parseInt(e[47],16),this.ownerName=e[48],this.effectDisplayType=parseInt(e[49]),this.actionID=parseInt(e[50],16),this.actionAnimationID=parseInt(e[51],16),this.animationLockTime=parseFloat(e[52]),this.rotationHex=parseInt(e[53],16)}}class x extends c{constructor(e){super("NetworkCancelAbility",e);t(this,"sourceID");t(this,"source");t(this,"id");t(this,"name");t(this,"reason");this.sourceID=parseInt(e[2],16),this.source=e[3],this.id=parseInt(e[4],16),this.name=e[5],this.reason=e[6]}}class H extends c{constructor(e){super("NetworkDoT",e);t(this,"id");t(this,"name");t(this,"which");t(this,"effectID");t(this,"damage");t(this,"currentHP");t(this,"maxHP");t(this,"currentMP");t(this,"maxMP");t(this,"x");t(this,"y");t(this,"z");t(this,"heading");t(this,"sourceID");t(this,"sourceName");t(this,"damageType");t(this,"sourceCurrentHP");t(this,"sourceMaxHP");t(this,"sourceCurrentMP");t(this,"sourceMaxMP");t(this,"sourceX");t(this,"sourceY");t(this,"sourceZ");t(this,"sourceHeading");this.id=parseInt(e[2],16),this.name=e[3],this.which=e[4],this.effectID=parseInt(e[5],16),this.damage=parseInt(e[6]),this.currentHP=parseInt(e[7]),this.maxHP=parseInt(e[8]),this.currentMP=parseInt(e[9]),this.maxMP=parseInt(e[10]),this.x=parseFloat(e[13]),this.y=parseFloat(e[14]),this.z=parseFloat(e[15]),this.heading=parseFloat(e[16]),this.sourceID=parseInt(e[17],16),this.sourceName=e[18],this.damageType=parseInt(e[19],16),this.sourceCurrentHP=parseInt(e[20]),this.sourceMaxHP=parseInt(e[21]),this.sourceCurrentMP=parseInt(e[22]),this.sourceMaxMP=parseInt(e[23]),this.sourceX=parseFloat(e[26]),this.sourceY=parseFloat(e[27]),this.sourceZ=parseFloat(e[28]),this.sourceHeading=parseFloat(e[29])}}class S extends c{constructor(e){super("NetworkDeath",e);t(this,"targetID");t(this,"targetName");t(this,"sourceID");t(this,"sourceName");this.targetID=parseInt(e[2],16),this.targetName=e[3],this.sourceID=parseInt(e[4],16),this.sourceName=e[5]}}class T extends c{constructor(e){super("NetworkBuff",e);t(this,"effectID");t(this,"effectName");t(this,"duration");t(this,"sourceID");t(this,"sourceName");t(this,"targetID");t(this,"targetName");t(this,"count");t(this,"targetMaxHP");t(this,"sourceMaxHP");this.effectID=parseInt(e[2],16),this.effectName=e[3],this.duration=parseFloat(e[4]),this.sourceID=parseInt(e[5],16),this.sourceName=e[6],this.targetID=parseInt(e[7],16),this.targetName=e[8],this.count=parseInt(e[9]),this.targetMaxHP=parseInt(e[10]==""?"-1":e[10]),this.sourceMaxHP=parseInt(e[11]==""?"-1":e[11])}}class O extends c{constructor(e){super("NetworkTargetIcon",e);t(this,"targetID");t(this,"targetName");t(this,"id");t(this,"data0");this.targetID=parseInt(e[2],16),this.targetName=e[3],this.id=parseInt(e[6],16),this.data0=parseInt(e[7],16)}}class A extends c{constructor(e){super("NetworkRaidMarker",e);t(this,"operation");t(this,"waymark");t(this,"id");t(this,"name");t(this,"x");t(this,"y");t(this,"z");this.operation=e[2],this.waymark=parseInt(e[3]),this.id=parseInt(e[4],16),this.name=e[5],this.x=parseFloat(e[6]),this.y=parseFloat(e[7]),this.z=parseFloat(e[8])}}class L extends c{constructor(e){super("NetworkTargetMarker",e);t(this,"operation");t(this,"waymark");t(this,"id");t(this,"name");t(this,"targetID");t(this,"targetName");this.operation=e[2],this.waymark=parseInt(e[3]),this.id=parseInt(e[4],16),this.name=e[5],this.targetID=parseInt(e[6],16),this.targetName=e[7]}}class R extends c{constructor(e){super("NetworkBuffRemove",e);t(this,"effectID");t(this,"effectName");t(this,"sourceID");t(this,"sourceName");t(this,"targetID");t(this,"targetName");t(this,"count");this.effectID=parseInt(e[2],16),this.effectName=e[3],this.sourceID=parseInt(e[5],16),this.sourceName=e[6],this.targetID=parseInt(e[7],16),this.targetName=e[8],this.count=parseInt(e[9],16)}}class _ extends c{constructor(e){super("NetworkGauge",e);t(this,"id");t(this,"data");this.id=parseInt(e[2],16),this.data=new Uint8Array(16);let a=new DataView(this.data.buffer);for(let i=0;i<4;i++){let h=parseInt(e[3+i]);a.setUint32(i*4,h,!0)}}}class q extends c{constructor(e){super("NetworkActorControl",e);t(this,"instance");t(this,"command");t(this,"data");this.instance=parseInt(e[2],16),this.command=parseInt(e[3],16),this.data=[];for(let a=0;a<4;a++)this.data.push(parseInt(e[4+a],16))}}class z extends c{constructor(e){super("NetworkNameToggle",e);t(this,"id");t(this,"name");t(this,"targetID");t(this,"targetName");t(this,"toggle");this.id=parseInt(e[2],16),this.name=e[3],this.targetID=parseInt(e[4],16),this.targetName=e[5],this.toggle=parseInt(e[6])===1}}class B extends c{constructor(e){super("NetworkTether",e);t(this,"sourceID");t(this,"sourceName");t(this,"targetID");t(this,"targetName");t(this,"id");this.sourceID=parseInt(e[2],16),this.sourceName=e[3],this.targetID=parseInt(e[4],16),this.targetName=e[5],this.id=parseInt(e[8],16)}}class U extends c{constructor(e){super("LimitBreak",e);t(this,"value");t(this,"bars");this.value=parseInt(e[2],16),this.bars=parseInt(e[3])}}class j extends c{constructor(e){super("NetworkActionSync",e);t(this,"id");t(this,"name");t(this,"sequenceID");t(this,"currentHP");t(this,"maxHP");t(this,"currentMP");t(this,"maxMP");t(this,"currentShield");t(this,"x");t(this,"y");t(this,"z");t(this,"heading");this.id=parseInt(e[2],16),this.name=e[3],this.sequenceID=parseInt(e[4],16),this.currentHP=e[5]?parseInt(e[5]):-1,this.maxHP=e[6]?parseInt(e[6]):-1,this.currentMP=e[7]?parseInt(e[7]):-1,this.maxMP=e[8]?parseInt(e[8]):-1,this.currentShield=e[9]?parseInt(e[9]):-1,this.x=parseFloat(e[11]),this.y=parseFloat(e[12]),this.z=parseFloat(e[13]),this.heading=parseFloat(e[14])}}class V extends c{constructor(e){super("NetworkStatusEffects",e);t(this,"targetID");t(this,"targetName");t(this,"jobLevelData");t(this,"currentHP");t(this,"maxHP");t(this,"currentMP");t(this,"maxMP");t(this,"currentShield");t(this,"x");t(this,"y");t(this,"z");t(this,"heading");t(this,"data");this.targetID=parseInt(e[2],16),this.targetName=e[3],this.jobLevelData=parseInt(e[4],16),this.currentHP=parseInt(e[5]),this.maxHP=parseInt(e[6]),this.currentMP=parseInt(e[7]),this.maxMP=parseInt(e[8]),this.currentShield=parseInt(e[9]),this.x=parseFloat(e[11]),this.y=parseFloat(e[12]),this.z=parseFloat(e[13]),this.heading=parseFloat(e[14]),this.data=[];for(let a=0;a<6;a++)this.data.push(parseInt(e[15+a],16))}}class G extends c{constructor(e){super("NetworkUpdateHP",e);t(this,"id");t(this,"name");t(this,"currentHP");t(this,"maxHP");t(this,"currentMP");t(this,"maxMP");t(this,"x");t(this,"y");t(this,"z");t(this,"heading");this.id=parseInt(e[2],16),this.name=e[3],this.currentHP=parseInt(e[4]),this.maxHP=parseInt(e[5]),this.currentMP=parseInt(e[6]),this.maxMP=parseInt(e[7]),this.x=parseFloat(e[10]),this.y=parseFloat(e[11]),this.z=parseFloat(e[12]),this.heading=parseFloat(e[13])}}class W extends c{constructor(e){super("Map",e);t(this,"id");t(this,"regionName");t(this,"placeName");t(this,"placeNameSub");this.id=parseInt(e[2],16),this.regionName=e[3],this.placeName=e[4],this.placeNameSub=e[5]}}class Y extends c{constructor(e){super("SystemLogMessage",e);t(this,"instance");t(this,"id");t(this,"params");this.instance=parseInt(e[2],16),this.id=parseInt(e[3],16),this.params=[];for(let a=0;a<3;a++)this.params.push(parseInt(e[4+a],16))}}class Z extends c{constructor(e){super("StatusList3",e);t(this,"id");t(this,"name");t(this,"statusList");this.id=parseInt(e[2],16),this.name=e[3],this.statusList=[];for(let a=0;a<e.length-4-1;a++)this.statusList.push(parseInt(e[4+a],16))}}class J extends c{constructor(e){super("Debug",e);t(this,"message");this.message=e[2]}}class X extends c{constructor(e){super("PacketDump",e);t(this,"len");t(this,"src");t(this,"dst");t(this,"packetType");t(this,"data");this.len=parseInt(e[2],16),this.src=parseInt(e[3],16),this.dst=parseInt(e[4],16),this.packetType=parseInt(e[5],16)&65535,this.data=new Uint8Array(this.len-16);for(let a=6,i=0;a<e.length-2;a++,i++){const h=parseInt(e[a],16);for(let d=0;d<4;d++)this.data[i*4+d]=h>>d*8&255}}}class K extends c{constructor(e){super("Version",e);t(this,"message");this.message=e[2]}}let $=class extends c{constructor(e){super("Error",e);t(this,"message");this.message=e[2]}};class Q extends c{constructor(e){super("LineRegistration",e);t(this,"id");t(this,"source");t(this,"name");t(this,"version");this.id=parseInt(e[2]),this.source=e[3],this.name=e[4],this.version=e[5]}}class g extends c{constructor(e){super("MapEffect",e);t(this,"instance");t(this,"flags");t(this,"location");t(this,"data0");t(this,"data1");this.instance=parseInt(e[2],16),this.flags=parseInt(e[3],16),this.location=parseInt(e[4],16),this.data0=parseInt(e[5],16),this.data1=parseInt(e[6],16)}}class ee extends c{constructor(e){super("FateDirector",e);t(this,"category");t(this,"unknown");t(this,"id");t(this,"progress");this.category=e[2],this.unknown=parseInt(e[3],16),this.id=parseInt(e[4],16),this.progress=parseInt(e[5],16)}}class te extends c{constructor(e){super("CEDirector",e);t(this,"popTime");t(this,"timeRemaining");t(this,"unknown");t(this,"ceKey");t(this,"numPlayers");t(this,"status");t(this,"unknown2");t(this,"progress");this.popTime=parseInt(e[2],16),this.timeRemaining=parseInt(e[3],16),this.unknown=parseInt(e[4],16),this.ceKey=parseInt(e[5],16),this.numPlayers=parseInt(e[6],16),this.status=parseInt(e[7],16),this.unknown2=parseInt(e[8],16),this.progress=parseInt(e[9],16)}}class se extends c{constructor(e){super("InCombat",e);t(this,"inACTCombat");t(this,"inGameCombat");t(this,"isACTChanged");t(this,"isGameChanged");this.inACTCombat=parseInt(e[2])===1,this.inGameCombat=parseInt(e[3])===1,this.isACTChanged=parseInt(e[4])===1,this.isGameChanged=parseInt(e[5])===1}}class re extends c{constructor(e){super("CombatantMemory",e);t(this,"change");t(this,"id");t(this,"data");this.change=e[2],this.id=parseInt(e[3],16),this.data=new Map;for(let a=4;a<e.length-1;a+=2)this.data.set(e[a],e[a+1])}}class ae extends c{constructor(e){super("RSVData",e);t(this,"locale");t(this,"unknown");t(this,"key");t(this,"value");this.locale=e[2],this.unknown=parseInt(e[3],16),this.key=e[4],this.value=e[5]}}class ne extends c{constructor(e){super("StartsUsingExtra",e);t(this,"sourceID");t(this,"id");t(this,"x");t(this,"y");t(this,"z");t(this,"heading");this.sourceID=parseInt(e[2],16),this.id=parseInt(e[3],16),this.x=parseFloat(e[4]),this.y=parseFloat(e[5]),this.z=parseFloat(e[6]),this.heading=parseFloat(e[7])}}class ie extends c{constructor(e){super("AbilityExtra",e);t(this,"sourceID");t(this,"id");t(this,"globalEffectCounter");t(this,"dataFlag");t(this,"x");t(this,"y");t(this,"z");t(this,"heading");t(this,"animationTargetId");this.sourceID=parseInt(e[2],16),this.id=parseInt(e[3],16),this.globalEffectCounter=parseInt(e[4],16),this.dataFlag=parseInt(e[5],16),this.x=parseFloat(e[6]),this.y=parseFloat(e[7]),this.z=parseFloat(e[8]),this.heading=parseFloat(e[9]),this.animationTargetId=parseInt(e[10],16)}}class ce extends c{constructor(e){super("ContentFinderSettings",e);t(this,"zoneID");t(this,"zoneName");t(this,"inContentFinderContent");t(this,"unrestrictedParty");t(this,"minimalItemLevel");t(this,"silenceEcho");t(this,"explorerMode");t(this,"levelSync");this.zoneID=parseInt(e[2],16),this.zoneName=e[3],this.inContentFinderContent=parseInt(e[4])===1,this.unrestrictedParty=parseInt(e[5])===1,this.minimalItemLevel=parseInt(e[6])===1,this.silenceEcho=parseInt(e[7])===1,this.explorerMode=parseInt(e[8])===1,this.levelSync=parseInt(e[9])===1}}class he extends c{constructor(e){super("NpcYell",e);t(this,"npcId");t(this,"npcNameId");t(this,"npcYellId");this.npcId=parseInt(e[2],16),this.npcNameId=parseInt(e[3],16),this.npcYellId=parseInt(e[4],16)}}class oe extends c{constructor(e){super("BattleTalk2",e);t(this,"npcId");t(this,"instance");t(this,"npcNameId");t(this,"instanceContentTextId");t(this,"displayMs");this.npcId=parseInt(e[2],16),this.instance=parseInt(e[3],16),this.npcNameId=parseInt(e[4],16),this.instanceContentTextId=parseInt(e[5],16),this.displayMs=parseInt(e[6])}}class pe extends c{constructor(e){super("Countdown",e);t(this,"id");t(this,"worldID");t(this,"countdownTime");t(this,"result");t(this,"name");this.id=parseInt(e[2],16),this.worldID=parseInt(e[3],16),this.countdownTime=parseInt(e[4]),this.result=parseInt(e[5],16),this.name=e[6]}}class de extends c{constructor(e){super("CountdownCancel",e);t(this,"id");t(this,"worldID");t(this,"name");this.id=parseInt(e[2],16),this.worldID=parseInt(e[3],16),this.name=e[4]}}class ue extends c{constructor(e){super("ActorMove",e);t(this,"id");t(this,"heading");t(this,"unk1");t(this,"unk2");t(this,"x");t(this,"y");t(this,"z");this.id=parseInt(e[2],16),this.heading=parseFloat(e[3]),this.unk1=parseInt(e[4],16),this.unk2=parseInt(e[5],16),this.x=parseFloat(e[6]),this.y=parseFloat(e[7]),this.z=parseFloat(e[8])}}class Ie extends c{constructor(e){super("ActorSetPos",e);t(this,"id");t(this,"heading");t(this,"unk1");t(this,"unk2");t(this,"x");t(this,"y");t(this,"z");this.id=parseInt(e[2],16),this.heading=parseFloat(e[3]),this.unk1=parseInt(e[4],16),this.unk2=parseInt(e[5],16),this.x=parseFloat(e[6]),this.y=parseFloat(e[7]),this.z=parseFloat(e[8])}}class le extends c{constructor(e){super("SpawnNpcExtra",e);t(this,"id");t(this,"parentID");t(this,"tetherID");t(this,"animationState");this.id=parseInt(e[2],16),this.parentID=parseInt(e[3],16),this.tetherID=parseInt(e[4],16),this.animationState=parseInt(e[5],16)}}class me extends c{constructor(e){super("ActorControlExtra",e);t(this,"id");t(this,"category");t(this,"param1");t(this,"param2");t(this,"param3");t(this,"param4");this.id=parseInt(e[2],16),this.category=parseInt(e[3],16),this.param1=parseInt(e[4],16),this.param2=parseInt(e[5],16),this.param3=parseInt(e[6],16),this.param4=parseInt(e[7],16)}}class we extends c{constructor(e){super("ActorControlSelfExtra",e);t(this,"id");t(this,"category");t(this,"param1");t(this,"param2");t(this,"param3");t(this,"param4");t(this,"param5");t(this,"param6");this.id=parseInt(e[2],16),this.category=parseInt(e[3],16),this.param1=parseInt(e[4],16),this.param2=parseInt(e[5],16),this.param3=parseInt(e[6],16),this.param4=parseInt(e[7],16),this.param5=parseInt(e[8],16),this.param6=parseInt(e[9],16)}}class ye extends c{constructor(e){super("Unknown",e);t(this,"rawLines");this.rawLines=e}}function Le(r){switch(parseInt(r[0])){case 0:return new k(r);case 1:return new b(r);case 2:return new D(r);case 3:return new P(r);case 4:return new N(r);case 11:return new C(r);case 12:return new E(r);case 20:return new M(r);case 21:case 22:return new F(r);case 23:return new x(r);case 24:return new H(r);case 25:return new S(r);case 26:return new T(r);case 27:return new O(r);case 28:return new A(r);case 29:return new L(r);case 30:return new R(r);case 31:return new _(r);case 33:return new q(r);case 34:return new z(r);case 35:return new B(r);case 36:return new U(r);case 37:return new j(r);case 38:return new V(r);case 39:return new G(r);case 40:return new W(r);case 41:return new Y(r);case 42:return new Z(r);case 251:return new J(r);case 252:return new X(r);case 253:return new K(r);case 254:return new $(r);case 256:return new Q(r);case 257:return new g(r);case 258:return new ee(r);case 259:return new te(r);case 260:return new se(r);case 261:return new re(r);case 262:return new ae(r);case 263:return new ne(r);case 264:return new ie(r);case 265:return new ce(r);case 266:return new he(r);case 267:return new oe(r);case 268:return new pe(r);case 269:return new de(r);case 270:return new ue(r);case 271:return new Ie(r);case 272:return new le(r);case 273:return new me(r);case 274:return new we(r);default:return new ye(r)}}let fe=new v;(function(){fe.Connect()})(),n.AbilityExtra=ie,n.ActorControlExtra=me,n.ActorControlSelfExtra=we,n.ActorMove=ue,n.ActorSetPos=Ie,n.AddCombatant=P,n.BattleTalk2=oe,n.CEDirector=te,n.ChangePrimaryPlayer=D,n.ChangeZone=b,n.CombatantMemory=re,n.ContentFinderSettings=ce,n.Countdown=pe,n.CountdownCancel=de,n.Debug=J,n.Error=$,n.FateDirector=ee,n.GameLogLine=k,n.InCombat=se,n.LimitBreak=U,n.LineRegistration=Q,n.LogLineBase=c,n.MapEffect=g,n.MapLog=W,n.MemoryReadResult=f,n.MemoryScanResult=y,n.NetowrkStartsCasting=M,n.NetworkAbility=F,n.NetworkActionSync=j,n.NetworkActorControl=q,n.NetworkBuff=T,n.NetworkBuffRemove=R,n.NetworkCancelAbility=x,n.NetworkDeath=S,n.NetworkDoT=H,n.NetworkGauge=_,n.NetworkNameToggle=z,n.NetworkRaidMarker=A,n.NetworkStatusEffects=V,n.NetworkTargetIcon=O,n.NetworkTargetMarker=L,n.NetworkTether=B,n.NetworkUpdateHP=G,n.NpcYell=he,n.OverlayToolkit=v,n.PacketDump=X,n.ParseLogLine=Le,n.PartyList=C,n.PlayerStats=E,n.RSVData=ae,n.RemoveCombatant=N,n.SpawnNpcExtra=le,n.StartsUsingExtra=ne,n.StatusList3=Z,n.SystemLogMessage=Y,n.UnknownLogLine=ye,n.Version=K,n.default=fe,Object.defineProperties(n,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
1
|
+
(function(n,o){typeof exports=="object"&&typeof module<"u"?o(exports):typeof define=="function"&&define.amd?define(["exports"],o):(n=typeof globalThis<"u"?globalThis:n||self,o(n.overlayToolkit={}))})(this,function(n){"use strict";var Re=Object.defineProperty;var _e=(n,o,p)=>o in n?Re(n,o,{enumerable:!0,configurable:!0,writable:!0,value:p}):n[o]=p;var t=(n,o,p)=>_e(n,typeof o!="symbol"?o+"":o,p);function o(r){let s=null;return r instanceof ArrayBuffer?s=new Uint8Array(r):s=new Uint8Array(r.buffer,r.byteOffset,r.byteLength),[...s].map(e=>e.toString(16).padStart(2,"0")).join("")}function p(r){const s=new Uint8Array(Math.ceil(r.length/2));for(let e=0;e<r.length;)s[e/2]=Number.parseInt(r.slice(e,e+=2),16);return s}function ve(r){return new ke(r)}class ke extends EventTarget{constructor(e){super();t(this,"onconnect",null);t(this,"ondisconnect",null);t(this,"devices",new Map);this.api=e,this.addListener()}dispatchEvent(e){return e.type==="connect"&&this.onconnect&&this.onconnect.call(this,e),e.type==="disconnect"&&this.ondisconnect&&this.ondisconnect.call(this,e),super.dispatchEvent(e),!e.defaultPrevented}async getDevices(){const e=await this.requestGetDevices();let a=[];return e.forEach(i=>{if(this.devices.has(i.instanceId))a.push(this.devices.get(i.instanceId));else{const h=new m(this.api,i);this.devices.set(i.instanceId,h),a.push(h)}}),a}async requestDevice(e){return e&&console.log("Requesting device with options:",e),this.getDevices()}async requestGetDevices(){return(await l(this.api,"getDevices",{})).devices}addListener(){this.api.addOverlayListener("otk::hid::inputreport",e=>this.callbackInputReport(e)),this.api.addOverlayListener("otk::hid::devicechanged",e=>this.callbackDeviceChanged(e))}callbackInputReport(e){const a=e.instanceId,i=p(e.data),h=this.devices.get(a);h?h.dispatchEvent(new De("inputreport",h,i[0],new DataView(i.buffer,1))):console.warn("Device not found:",a)}callbackDeviceChanged(e){var a=e.add;const i=new m(this.api,e.device),h=new be(a?"connect":"disconnect",i);this.dispatchEvent(h)}}async function l(r,s,e){const a={call:"otk::hid",type:s,...e},i=await r.callOverlayHandler(a);return i.error&&console.log("callOverlayHID error:",s,e,i),i}class m extends EventTarget{constructor(e,a){super();t(this,"instanceId");t(this,"opened",!1);t(this,"vendorId");t(this,"productId");t(this,"productName");t(this,"collections");t(this,"oninputreport",null);this.api=e,this.instanceId=a.instanceId,this.vendorId=a.vendorId,this.productId=a.productId,this.productName=a.productName,this.collections=a.collections||[]}dispatchEvent(e){return e.type==="inputreport"&&this.oninputreport&&this.oninputreport.call(this,e),super.dispatchEvent(e),!e.defaultPrevented}async open(){this.opened||(await this.request("open",{}),this.opened=!0)}async close(){this.opened&&(await this.request("close",{}),this.opened=!1)}async forget(){}async sendReport(e,a){if(!this.opened)throw new Error("Device is not opened.");await this.request("send",{reportId:e,data:o(a)})}async sendFeatureReport(e,a){if(!this.opened)throw new Error("Device is not opened.");await this.request("sendFeature",{reportId:e,data:o(a)})}async receiveFeatureReport(e){if(!this.opened)throw new Error("Device is not opened.");const a=await this.request("recvFeature",{reportId:e}),i=p(a.data);return new DataView(i.buffer)}async request(e,a){return l(this.api,e,{instanceId:this.instanceId,...a})}}class be extends Event{constructor(e,a){super(e);t(this,"device");this.device=a}}class De extends Event{constructor(e,a,i,h){super(e);t(this,"device");t(this,"reportId");t(this,"data");this.device=a,this.reportId=i,this.data=h}}class Pe{constructor(s=null){t(this,"subscribers",new Map);t(this,"queue",[]);this.transport=s,s&&this.setTransport(s)}setTransport(s){this.transport=s,this.transport.addEventListener("message",e=>{this.dispatchOverlayEvent(e.detail)}),this.transport.addEventListener("connected",this.onTransportConnected.bind(this))}dispatchOverlayEvent(s){const e=this.subscribers.get(s.type);if(e)for(const a of e)a(s)}addOverlayListener(s,e){this.subscribers.has(s)||this.subscribers.set(s,[]),this.subscribers.get(s).push(e)}setOverlayListener(s,e){this.subscribers.set(s,[e])}removeOverlayListener(s,e){if(!this.subscribers.has(s))return;const a=this.subscribers.get(s);if(!e){a.length=0;return}const i=a.indexOf(e);i!==-1&&a.splice(i,1)}async callOverlayHandler(s){return!this.transport||!this.transport.connected?(console.warn("OverlayPluginAPI: Transport not connected, queuing message",s),new Promise(a=>{this.queue.push([s,a])})):this.transport.sendMessage(s)}startOverlayEvents(){var s={call:"subscribe",events:Array.from(this.subscribers.keys())};this.callOverlayHandler(s)}onTransportConnected(){if(!this.transport||!this.transport.connected||this.queue.length===0)return;console.log("OverlayPluginAPI: Transport connected, sending queued messages");let s=this.queue;this.queue=[];for(let[e,a]of s)this.transport.sendMessage(e).then(a)}get isConnected(){var s;return((s=this.transport)==null?void 0:s.connected)??!1}}class Ne extends EventTarget{constructor(){super(...arguments);t(this,"connected",!1);t(this,"evtHandlerWrapper",e=>{this.dispatchEvent(new CustomEvent("message",{detail:e}))})}get transportType(){return"plugin"}sendMessage(e){return new Promise(a=>{window.OverlayPluginApi.callHandler(JSON.stringify(e),i=>a(JSON.parse(i)))})}waitForApi(){if(!window.OverlayPluginApi||!window.OverlayPluginApi.ready){setTimeout(()=>this.waitForApi(),300);return}window.__OverlayCallback=this.evtHandlerWrapper,this.connected=!0,this.dispatchEvent(new Event("connected"))}}class Ce extends EventTarget{constructor(e){super();t(this,"ws");t(this,"sequence",0);t(this,"responseResolvers",new Map);t(this,"evtHandler",()=>{});t(this,"connected",!1);this.ws=new WebSocket(e),this.connect(this.ws)}connect(e){e.addEventListener("open",this.onOpen.bind(this)),e.addEventListener("error",this.onError.bind(this)),e.addEventListener("message",this.onMessage.bind(this)),e.addEventListener("close",this.onClosed.bind(this))}onError(e){console.error(e)}onOpen(){console.log("WebSocket connected"),this.connected=!0,this.dispatchEvent(new Event("connected"))}onMessage(e){try{const a=JSON.parse(e.data);if("rseq"in a){const i=a.rseq;this.responseResolvers.has(i)&&(this.responseResolvers.get(i)(a),this.responseResolvers.delete(i))}else this.dispatchEvent(new CustomEvent("message",{detail:a}))}catch{console.error("Failed to parse WebSocket message",e)}}onClosed(e){console.log("WebSocket closed",e),this.connected=!1,setTimeout(()=>{console.log("WebSocket reconnecting..."),this.ws=new WebSocket(this.ws.url),this.connect(this.ws)},3e3)}get transportType(){return"websocket"}sendMessage(e){const a=this.sequence++;return e.rseq=a,new Promise(i=>{this.responseResolvers.set(a,i),this.ws.send(JSON.stringify(e))})}set eventHandler(e){this.evtHandler=e}}const Ee=r=>({call:"otk::filesystem",action:"show_save_file_picker",options:r}),Me=r=>({call:"otk::filesystem",action:"show_open_file_picker",options:r}),Fe=r=>({call:"otk::filesystem",action:"file_info",handle:r}),w=(r,s)=>({call:"otk::filesystem",action:"read_file",handle:r,binary:s}),xe=(r,s)=>({call:"otk::filesystem",action:"open_write",handle:r,truncate:s}),He=(r,s)=>({call:"otk::filesystem",action:"write_file",handle:r,data:typeof s=="string"?s:btoa(String.fromCharCode(...new Uint8Array(s))),binary:typeof s!="string"}),I=(r,s,e)=>({call:"otk::filesystem",action:"file_op",handle:r,operation:s,param:e});class Se{constructor(s){t(this,"api");this.api=s}async showSaveFilePicker(s){const e=await this.api.callOverlayHandler(Ee(s));if(e.aborted)throw DOMException.ABORT_ERR;if(e&&e.handle&&e.name)return new u(this.api,e.handle,e.name);throw new Error(e.Error??"Failed to get file handle")}async showOpenFilePicker(s){const e=await this.api.callOverlayHandler(Me(s));if(e.aborted)throw DOMException.ABORT_ERR;if(e&&e.files&&Array.isArray(e.files))return e.files.map(a=>new u(this.api,a.handle,a.name));throw new Error(e.Error??"Failed to get file handles")}}class u{constructor(s,e,a){t(this,"kind","file");t(this,"name");t(this,"handle");t(this,"api");this.api=s,this.handle=e,this.name=a}async createWritable(s){const e=await this.api.callOverlayHandler(xe(this.handle,s==null?void 0:s.keepExistingData));if(e&&e.handle)return new Oe(this.api,e.handle);throw new Error(e.Error??"Failed to create writable stream")}async getFile(){const s=await this.api.callOverlayHandler(Fe(this.handle));if(s&&s.handle&&s.name)return new Te(this.api,s);throw new Error(s.Error??"Failed to get file")}isSameEntry(s){return s instanceof u?Promise.resolve(this.handle===s.handle):Promise.resolve(!1)}}class Te{constructor(s,e){t(this,"handle");t(this,"api");t(this,"lastModified");t(this,"name");t(this,"webkitRelativePath");t(this,"size");t(this,"type");this.api=s,this.handle=e.handle,this.name=e.name,this.size=e.size,this.type=e.type,this.lastModified=e.lastModified,this.webkitRelativePath=e.webkitRelativePath||""}arrayBuffer(){return this.bytes().then(s=>s.buffer)}async bytes(){const s=await this.api.callOverlayHandler(w(this.handle,!0));if(s&&s.data)return Uint8Array.from(atob(s.data),e=>e.charCodeAt(0));throw new Error(s.Error??"Failed to read file")}async text(){const s=await this.api.callOverlayHandler(w(this.handle,!1));if(s&&s.text)return s.text;throw new Error(s.Error??"Failed to read file")}slice(s,e,a){throw new Error("Method not implemented.")}stream(){throw new Error("Method not implemented.")}}class Oe{constructor(s,e){t(this,"locked",!1);t(this,"handle");t(this,"api");this.api=s,this.handle=e}seek(s){return this.api.callOverlayHandler(I(this.handle,"seek",s))}truncate(s){return this.api.callOverlayHandler(I(this.handle,"truncate",s))}writeData(s){return this.api.callOverlayHandler(He(this.handle,s))}write(s){return typeof s=="string"||s instanceof ArrayBuffer?this.writeData(s):s instanceof Uint8Array?this.writeData(s.buffer):s instanceof Blob?s.arrayBuffer().then(e=>this.writeData(e)):Promise.reject(new Error("Unsupported data type for writing"))}close(){return this.api.callOverlayHandler(I(this.handle,"close"))}abort(s){throw new Error("Method not implemented.")}getWriter(){throw new Error("Method not implemented.")}}class y{constructor(s){t(this,"addr");t(this,"base");t(this,"bytes");t(this,"mask");this.addr=(s==null?void 0:s.addr)??0,this.base=(s==null?void 0:s.base)??0,this.valid?(this.bytes=p(s.bytes),this.mask=s.mask):(this.bytes=new Uint8Array,this.mask=[])}get valid(){return!!this.addr}getNthRange(s){let e=0;for(let a=0;a<this.mask.length;a++)if(!this.mask[a]){let i;for(i=a;i<this.mask.length&&!this.mask[i];i++);if(e==s)return{begin:a,end:i};e++,a=i}return{begin:0,end:0}}getNthMasked(s){let e=this.getNthRange(s);return e.end>e.begin?this.bytes.slice(e.begin,e.end):null}getDataView(s){let e=this.getNthRange(s);return e.end>e.begin?new DataView(this.bytes.buffer,this.bytes.byteOffset+e.begin,Math.min(this.bytes.byteLength,e.end-e.begin)):null}getRelativePointer(s){let e=this.getNthRange(s);if(e.end<=e.begin)return 0;const i=new DataView(this.bytes.buffer,this.bytes.byteOffset,this.bytes.byteLength).getInt32(e.begin,!0);return this.addr+i+e.begin+4}}class f{constructor(s){t(this,"addr");t(this,"length");t(this,"bytes");t(this,"value");this.addr=(s==null?void 0:s.addr)??0,this.length=(s==null?void 0:s.len)??0,this.valid?(this.bytes=p(s.bytes),this.value=s.value):this.bytes=new Uint8Array}get valid(){return!!this.addr&&!!this.length}get dataView(){return new DataView(this.bytes.buffer,this.bytes.byteOffset,this.bytes.byteLength)}}class Ae{constructor(s){t(this,"headers");t(this,"ok");t(this,"status");t(this,"statusText");t(this,"type");t(this,"url");t(this,"redirected",!1);t(this,"body",null);t(this,"bodyUsed",!1);t(this,"_bodyContent");this.headers=new Headers;for(const e in s.headers)this.headers.append(e,s.headers[e]);this.ok=s.ok,this.status=s.status,this.statusText=s.statusText,this.type=s.type,this.url=s.url,this._bodyContent=s.body}clone(){throw new Error("Method not implemented.")}text(){return Promise.resolve(this._bodyContent)}json(){return Promise.resolve(JSON.parse(this._bodyContent))}arrayBuffer(){return this.bytes().then(s=>s.buffer)}formData(){throw new Error("Method not implemented.")}blob(){throw new Error("Method not implemented.")}bytes(){return Promise.resolve(Uint8Array.from(this._bodyContent,s=>s.charCodeAt(0)))}}class v{constructor(){t(this,"hid");t(this,"fs");t(this,"api",new Pe);t(this,"handlerMap",new Map);this.hid=ve(this.api),this.fs=new Se(this.api)}Fetch(s,e={}){const a={call:"Fetch",resource:s,options:e};return this.api.callOverlayHandler(a)}async fetch(s,e={}){const a={call:"otk::fetch",resource:s,options:e},i=await this.api.callOverlayHandler(a);if(!i)throw new Error("method not found");return new Ae(i)}async SubscribePacket(s,e,a){const i={call:"otk::packet",action:"subscribe",name:s,evt_name:"otk::packet::"+s,filters:e},h=await this.api.callOverlayHandler(i);if(!h)throw new Error("method not found");if(h.error)throw new Error(h.error);return h.evt_name?(this.api.setOverlayListener(h.evt_name,d=>this.packetHandler(d,!1)),this.api.startOverlayEvents()):console.warn("plugin does not support evt_name for packet subscription, may < 0.4.0"),this.handlerMap.set(h.name||s,{handler:a,evt_name:h.evt_name}),h.name||s}async UnsubscribePacket(s){const e={call:"otk::packet",action:"unsubscribe",name:s},a=await this.api.callOverlayHandler(e);if(a!=null&&a.error)throw new Error(a.error);if(this.handlerMap.has(s)){const i=this.handlerMap.get(s);i.evt_name&&this.api.removeOverlayListener(i.evt_name),this.handlerMap.delete(s)}}packetHandler(s,e=!1){let a=s,i=s;i.data=Uint8Array.from(atob(a.msg),d=>d.charCodeAt(0));let h=this.handlerMap.get(a.name);if(h){if(e&&h.evt_name)return;h.handler(i)}else e||console.warn("No packet handler for name",a.name)}async GetGameVersion(){const s={call:"otk::game_ver"};return this.api.callOverlayHandler(s)}async GetPluginVersion(){return(await this.GetPluginInfo()).version}async GetPluginInfo(){const s={call:"otk::plugin_ver"};return await this.api.callOverlayHandler(s)}async OpenBrowser(s){const e={call:"otk::open_browser",url:s},a=await this.api.callOverlayHandler(e);if(a!=null&&a.Error)throw new Error(a.Error)}async MemoryScanSig(s,e,a=0){const i={call:"otk::memory",action:"sig_scanner",sig:s,started_at:a,offset:e},h=await this.api.callOverlayHandler(i);if(h!=null&&h.Error)throw new Error(h.Error);return new y(h)}async MemoryRead(s,e){const a={call:"otk::memory",action:"read",addr:s,length:e},i=await this.api.callOverlayHandler(a);if(i!=null&&i.Error)throw new Error(i.Error);return new f(i)}Start(){this.api.addOverlayListener("otk::packet",s=>this.packetHandler(s,!0)),this.api.startOverlayEvents()}Dispatch(s){this.api.dispatchOverlayEvent(s)}AddListener(s,e){this.api.addOverlayListener(s,e)}RemoveListener(s,e){this.api.removeOverlayListener(s,e)}Call(s){return this.api.callOverlayHandler(s)}IsOverlayPluginCEF(){return"OverlayPluginApi"in window}tryConnectToCEF(){if(!this.IsOverlayPluginCEF()){setTimeout(()=>this.tryConnectToCEF(),300);return}const s=new Ne;this.api.setTransport(s),s.waitForApi()}Connect(s=""){if(this.tryConnectToCEF(),s||(s=new URLSearchParams(location.search).get("OVERLAY_WS")),s){if(this.IsOverlayPluginCEF()){console.warn("OverlayToolkit: Connect wsUrl ignored in OverlayPlugin CEF environment");return}const e=new Ce(s);this.api.setTransport(e)}}get isConnected(){return this.api.isConnected}}class c{constructor(s,e){t(this,"type");t(this,"typeCode");t(this,"time");this.typeCode=parseInt(e[0]),this.time=e[1],this.type=s}get timeDate(){return new Date(this.time)}}class k extends c{constructor(e){super("LogLine",e);t(this,"code");t(this,"name");t(this,"line");this.code=e[2],this.name=e[3],this.line=e[4]}}class b extends c{constructor(e){super("ChangeZone",e);t(this,"zoneID");t(this,"zoneName");this.zoneID=parseInt(e[2],16),this.zoneName=e[3]}}class D extends c{constructor(e){super("ChangePrimaryPlayer",e);t(this,"charID");t(this,"charName");this.charID=parseInt(e[2],16),this.charName=e[3]}get charIDHex(){return this.charID.toString(16).toUpperCase()}}class P extends c{constructor(e){super("AddCombatant",e);t(this,"id");t(this,"name");t(this,"job");t(this,"level");t(this,"ownerID");t(this,"worldID");t(this,"worldName");t(this,"npcNameID");t(this,"npcBaseID");t(this,"currentHP");t(this,"hp");t(this,"currentMP");t(this,"mp");t(this,"x");t(this,"y");t(this,"z");t(this,"heading");this.id=parseInt(e[2],16),this.name=e[3],this.job=parseInt(e[4],16),this.level=parseInt(e[5],16),this.ownerID=parseInt(e[6],16),this.worldID=parseInt(e[7],16),this.worldName=e[8],this.npcNameID=parseInt(e[9]),this.npcBaseID=parseInt(e[10]),this.currentHP=parseInt(e[11]),this.hp=parseInt(e[12]),this.currentMP=parseInt(e[13]),this.mp=parseInt(e[14]),this.x=parseFloat(e[17]),this.y=parseFloat(e[18]),this.z=parseFloat(e[19]),this.heading=parseFloat(e[20])}}class N extends c{constructor(e){super("RemoveCombatant",e);t(this,"id");t(this,"name");t(this,"job");t(this,"level");t(this,"ownerID");t(this,"world");t(this,"npcNameID");t(this,"npcBaseID");t(this,"currentHP");t(this,"hp");t(this,"currentMP");t(this,"mp");t(this,"x");t(this,"y");t(this,"z");t(this,"heading");this.id=parseInt(e[2],16),this.name=e[3],this.job=parseInt(e[4],16),this.level=parseInt(e[5],16),this.ownerID=parseInt(e[6],16),this.world=e[8],this.npcNameID=parseInt(e[9]),this.npcBaseID=parseInt(e[10]),this.currentHP=parseInt(e[11]),this.hp=parseInt(e[12]),this.currentMP=parseInt(e[13]),this.mp=parseInt(e[14]),this.x=parseFloat(e[17]),this.y=parseFloat(e[18]),this.z=parseFloat(e[19]),this.heading=parseFloat(e[20])}}class C extends c{constructor(e){super("PartyChanged",e);t(this,"party");this.party=[];let a=parseInt(e[2]);for(let i=0;i<a;i++)this.party.push(parseInt(e[3+i],16))}}class E extends c{constructor(e){super("PlayerStats",e);t(this,"job");t(this,"strength");t(this,"dexterity");t(this,"vitality");t(this,"intelligence");t(this,"mind");t(this,"piety");t(this,"attackPower");t(this,"directHit");t(this,"criticalHit");t(this,"attakcMagicPotency");t(this,"healingMagicPotency");t(this,"determination");t(this,"skillSpeed");t(this,"spellSpeed");t(this,"tenacity");t(this,"localContentID");this.job=parseInt(e[2],16),this.strength=parseInt(e[3]),this.dexterity=parseInt(e[4]),this.vitality=parseInt(e[5]),this.intelligence=parseInt(e[6]),this.mind=parseInt(e[7]),this.piety=parseInt(e[8]),this.attackPower=parseInt(e[9]),this.directHit=parseInt(e[10]),this.criticalHit=parseInt(e[11]),this.attakcMagicPotency=parseInt(e[12]),this.healingMagicPotency=parseInt(e[13]),this.determination=parseInt(e[14]),this.skillSpeed=parseInt(e[15]),this.spellSpeed=parseInt(e[16]),this.tenacity=parseInt(e[18]),this.localContentID=parseInt(e[19],16)}}class M extends c{constructor(e){super("NetworkStartsCasting",e);t(this,"sourceID");t(this,"sourceName");t(this,"id");t(this,"ability");t(this,"targetID");t(this,"targetName");t(this,"castTime");t(this,"x");t(this,"y");t(this,"z");t(this,"heading");this.sourceID=parseInt(e[2],16),this.sourceName=e[3],this.id=parseInt(e[4],16),this.ability=e[5],this.targetID=parseInt(e[6],16),this.targetName=e[7],this.castTime=parseFloat(e[8]),this.x=parseFloat(e[9]),this.y=parseFloat(e[10]),this.z=parseFloat(e[11]),this.heading=parseFloat(e[12])}}class F extends c{constructor(e){super(e[0]=="22"?"NetworkAOEAbility":"NetworkAbility",e);t(this,"sourceID");t(this,"sourceName");t(this,"id");t(this,"ability");t(this,"targetID");t(this,"targetName");t(this,"effects");t(this,"targetCurrentHP");t(this,"targetMaxHP");t(this,"targetCurrentMP");t(this,"targetMaxMP");t(this,"targetX");t(this,"targetY");t(this,"targetZ");t(this,"targetHeading");t(this,"currentHP");t(this,"maxHP");t(this,"currentMP");t(this,"maxMP");t(this,"x");t(this,"y");t(this,"z");t(this,"heading");t(this,"sequence");t(this,"targetIndex");t(this,"targetCount");t(this,"ownerID");t(this,"ownerName");t(this,"effectDisplayType");t(this,"actionID");t(this,"actionAnimationID");t(this,"animationLockTime");t(this,"rotationHex");this.sourceID=parseInt(e[2],16),this.sourceName=e[3],this.id=parseInt(e[4],16),this.ability=e[5],this.targetID=parseInt(e[6],16),this.targetName=e[7],this.effects=[];for(let a=0;a<8;a++)this.effects[a]={flags:parseInt(e[8+a*2],16),damage:e[9+a*2]};this.targetCurrentHP=parseInt(e[24]),this.targetMaxHP=parseInt(e[25]),this.targetCurrentMP=parseInt(e[26]),this.targetMaxMP=parseInt(e[27]),this.targetX=parseFloat(e[30]),this.targetY=parseFloat(e[31]),this.targetZ=parseFloat(e[32]),this.targetHeading=parseFloat(e[33]),this.currentHP=parseInt(e[34]),this.maxHP=parseInt(e[35]),this.currentMP=parseInt(e[36]),this.maxMP=parseInt(e[37]),this.x=parseFloat(e[40]),this.y=parseFloat(e[41]),this.z=parseFloat(e[42]),this.heading=parseFloat(e[43]),this.sequence=parseInt(e[44],16),this.targetIndex=parseInt(e[45]),this.targetCount=parseInt(e[46]),this.ownerID=parseInt(e[47],16),this.ownerName=e[48],this.effectDisplayType=parseInt(e[49]),this.actionID=parseInt(e[50],16),this.actionAnimationID=parseInt(e[51],16),this.animationLockTime=parseFloat(e[52]),this.rotationHex=parseInt(e[53],16)}}class x extends c{constructor(e){super("NetworkCancelAbility",e);t(this,"sourceID");t(this,"source");t(this,"id");t(this,"name");t(this,"reason");this.sourceID=parseInt(e[2],16),this.source=e[3],this.id=parseInt(e[4],16),this.name=e[5],this.reason=e[6]}}class H extends c{constructor(e){super("NetworkDoT",e);t(this,"id");t(this,"name");t(this,"which");t(this,"effectID");t(this,"damage");t(this,"currentHP");t(this,"maxHP");t(this,"currentMP");t(this,"maxMP");t(this,"x");t(this,"y");t(this,"z");t(this,"heading");t(this,"sourceID");t(this,"sourceName");t(this,"damageType");t(this,"sourceCurrentHP");t(this,"sourceMaxHP");t(this,"sourceCurrentMP");t(this,"sourceMaxMP");t(this,"sourceX");t(this,"sourceY");t(this,"sourceZ");t(this,"sourceHeading");this.id=parseInt(e[2],16),this.name=e[3],this.which=e[4],this.effectID=parseInt(e[5],16),this.damage=parseInt(e[6]),this.currentHP=parseInt(e[7]),this.maxHP=parseInt(e[8]),this.currentMP=parseInt(e[9]),this.maxMP=parseInt(e[10]),this.x=parseFloat(e[13]),this.y=parseFloat(e[14]),this.z=parseFloat(e[15]),this.heading=parseFloat(e[16]),this.sourceID=parseInt(e[17],16),this.sourceName=e[18],this.damageType=parseInt(e[19],16),this.sourceCurrentHP=parseInt(e[20]),this.sourceMaxHP=parseInt(e[21]),this.sourceCurrentMP=parseInt(e[22]),this.sourceMaxMP=parseInt(e[23]),this.sourceX=parseFloat(e[26]),this.sourceY=parseFloat(e[27]),this.sourceZ=parseFloat(e[28]),this.sourceHeading=parseFloat(e[29])}}class S extends c{constructor(e){super("NetworkDeath",e);t(this,"targetID");t(this,"targetName");t(this,"sourceID");t(this,"sourceName");this.targetID=parseInt(e[2],16),this.targetName=e[3],this.sourceID=parseInt(e[4],16),this.sourceName=e[5]}}class T extends c{constructor(e){super("NetworkBuff",e);t(this,"effectID");t(this,"effectName");t(this,"duration");t(this,"sourceID");t(this,"sourceName");t(this,"targetID");t(this,"targetName");t(this,"count");t(this,"targetMaxHP");t(this,"sourceMaxHP");this.effectID=parseInt(e[2],16),this.effectName=e[3],this.duration=parseFloat(e[4]),this.sourceID=parseInt(e[5],16),this.sourceName=e[6],this.targetID=parseInt(e[7],16),this.targetName=e[8],this.count=parseInt(e[9]),this.targetMaxHP=parseInt(e[10]==""?"-1":e[10]),this.sourceMaxHP=parseInt(e[11]==""?"-1":e[11])}}class O extends c{constructor(e){super("NetworkTargetIcon",e);t(this,"targetID");t(this,"targetName");t(this,"id");t(this,"data0");this.targetID=parseInt(e[2],16),this.targetName=e[3],this.id=parseInt(e[6],16),this.data0=parseInt(e[7],16)}}class A extends c{constructor(e){super("NetworkRaidMarker",e);t(this,"operation");t(this,"waymark");t(this,"id");t(this,"name");t(this,"x");t(this,"y");t(this,"z");this.operation=e[2],this.waymark=parseInt(e[3]),this.id=parseInt(e[4],16),this.name=e[5],this.x=parseFloat(e[6]),this.y=parseFloat(e[7]),this.z=parseFloat(e[8])}}class L extends c{constructor(e){super("NetworkTargetMarker",e);t(this,"operation");t(this,"waymark");t(this,"id");t(this,"name");t(this,"targetID");t(this,"targetName");this.operation=e[2],this.waymark=parseInt(e[3]),this.id=parseInt(e[4],16),this.name=e[5],this.targetID=parseInt(e[6],16),this.targetName=e[7]}}class R extends c{constructor(e){super("NetworkBuffRemove",e);t(this,"effectID");t(this,"effectName");t(this,"sourceID");t(this,"sourceName");t(this,"targetID");t(this,"targetName");t(this,"count");this.effectID=parseInt(e[2],16),this.effectName=e[3],this.sourceID=parseInt(e[5],16),this.sourceName=e[6],this.targetID=parseInt(e[7],16),this.targetName=e[8],this.count=parseInt(e[9],16)}}class _ extends c{constructor(e){super("NetworkGauge",e);t(this,"id");t(this,"data");this.id=parseInt(e[2],16),this.data=new Uint8Array(16);let a=new DataView(this.data.buffer);for(let i=0;i<4;i++){let h=parseInt(e[3+i]);a.setUint32(i*4,h,!0)}}}class q extends c{constructor(e){super("NetworkActorControl",e);t(this,"instance");t(this,"command");t(this,"data");this.instance=parseInt(e[2],16),this.command=parseInt(e[3],16),this.data=[];for(let a=0;a<4;a++)this.data.push(parseInt(e[4+a],16))}}class z extends c{constructor(e){super("NetworkNameToggle",e);t(this,"id");t(this,"name");t(this,"targetID");t(this,"targetName");t(this,"toggle");this.id=parseInt(e[2],16),this.name=e[3],this.targetID=parseInt(e[4],16),this.targetName=e[5],this.toggle=parseInt(e[6])===1}}class B extends c{constructor(e){super("NetworkTether",e);t(this,"sourceID");t(this,"sourceName");t(this,"targetID");t(this,"targetName");t(this,"id");this.sourceID=parseInt(e[2],16),this.sourceName=e[3],this.targetID=parseInt(e[4],16),this.targetName=e[5],this.id=parseInt(e[8],16)}}class U extends c{constructor(e){super("LimitBreak",e);t(this,"value");t(this,"bars");this.value=parseInt(e[2],16),this.bars=parseInt(e[3])}}class j extends c{constructor(e){super("NetworkActionSync",e);t(this,"id");t(this,"name");t(this,"sequenceID");t(this,"currentHP");t(this,"maxHP");t(this,"currentMP");t(this,"maxMP");t(this,"currentShield");t(this,"x");t(this,"y");t(this,"z");t(this,"heading");this.id=parseInt(e[2],16),this.name=e[3],this.sequenceID=parseInt(e[4],16),this.currentHP=e[5]?parseInt(e[5]):-1,this.maxHP=e[6]?parseInt(e[6]):-1,this.currentMP=e[7]?parseInt(e[7]):-1,this.maxMP=e[8]?parseInt(e[8]):-1,this.currentShield=e[9]?parseInt(e[9]):-1,this.x=parseFloat(e[11]),this.y=parseFloat(e[12]),this.z=parseFloat(e[13]),this.heading=parseFloat(e[14])}}class V extends c{constructor(e){super("NetworkStatusEffects",e);t(this,"targetID");t(this,"targetName");t(this,"jobLevelData");t(this,"currentHP");t(this,"maxHP");t(this,"currentMP");t(this,"maxMP");t(this,"currentShield");t(this,"x");t(this,"y");t(this,"z");t(this,"heading");t(this,"data");this.targetID=parseInt(e[2],16),this.targetName=e[3],this.jobLevelData=parseInt(e[4],16),this.currentHP=parseInt(e[5]),this.maxHP=parseInt(e[6]),this.currentMP=parseInt(e[7]),this.maxMP=parseInt(e[8]),this.currentShield=parseInt(e[9]),this.x=parseFloat(e[11]),this.y=parseFloat(e[12]),this.z=parseFloat(e[13]),this.heading=parseFloat(e[14]),this.data=[];for(let a=0;a<6;a++)this.data.push(parseInt(e[15+a],16))}}class G extends c{constructor(e){super("NetworkUpdateHP",e);t(this,"id");t(this,"name");t(this,"currentHP");t(this,"maxHP");t(this,"currentMP");t(this,"maxMP");t(this,"x");t(this,"y");t(this,"z");t(this,"heading");this.id=parseInt(e[2],16),this.name=e[3],this.currentHP=parseInt(e[4]),this.maxHP=parseInt(e[5]),this.currentMP=parseInt(e[6]),this.maxMP=parseInt(e[7]),this.x=parseFloat(e[10]),this.y=parseFloat(e[11]),this.z=parseFloat(e[12]),this.heading=parseFloat(e[13])}}class W extends c{constructor(e){super("Map",e);t(this,"id");t(this,"regionName");t(this,"placeName");t(this,"placeNameSub");this.id=parseInt(e[2],16),this.regionName=e[3],this.placeName=e[4],this.placeNameSub=e[5]}}class Y extends c{constructor(e){super("SystemLogMessage",e);t(this,"instance");t(this,"id");t(this,"params");this.instance=parseInt(e[2],16),this.id=parseInt(e[3],16),this.params=[];for(let a=0;a<3;a++)this.params.push(parseInt(e[4+a],16))}}class Z extends c{constructor(e){super("StatusList3",e);t(this,"id");t(this,"name");t(this,"statusList");this.id=parseInt(e[2],16),this.name=e[3],this.statusList=[];for(let a=0;a<e.length-4-1;a++)this.statusList.push(parseInt(e[4+a],16))}}class J extends c{constructor(e){super("Debug",e);t(this,"message");this.message=e[2]}}class X extends c{constructor(e){super("PacketDump",e);t(this,"len");t(this,"src");t(this,"dst");t(this,"packetType");t(this,"data");this.len=parseInt(e[2],16),this.src=parseInt(e[3],16),this.dst=parseInt(e[4],16),this.packetType=parseInt(e[5],16)&65535,this.data=new Uint8Array(this.len-16);for(let a=6,i=0;a<e.length-2;a++,i++){const h=parseInt(e[a],16);for(let d=0;d<4;d++)this.data[i*4+d]=h>>d*8&255}}}class K extends c{constructor(e){super("Version",e);t(this,"message");this.message=e[2]}}let $=class extends c{constructor(e){super("Error",e);t(this,"message");this.message=e[2]}};class Q extends c{constructor(e){super("LineRegistration",e);t(this,"id");t(this,"source");t(this,"name");t(this,"version");this.id=parseInt(e[2]),this.source=e[3],this.name=e[4],this.version=e[5]}}class g extends c{constructor(e){super("MapEffect",e);t(this,"instance");t(this,"flags");t(this,"location");t(this,"data0");t(this,"data1");this.instance=parseInt(e[2],16),this.flags=parseInt(e[3],16),this.location=parseInt(e[4],16),this.data0=parseInt(e[5],16),this.data1=parseInt(e[6],16)}}class ee extends c{constructor(e){super("FateDirector",e);t(this,"category");t(this,"unknown");t(this,"id");t(this,"progress");this.category=e[2],this.unknown=parseInt(e[3],16),this.id=parseInt(e[4],16),this.progress=parseInt(e[5],16)}}class te extends c{constructor(e){super("CEDirector",e);t(this,"popTime");t(this,"timeRemaining");t(this,"unknown");t(this,"ceKey");t(this,"numPlayers");t(this,"status");t(this,"unknown2");t(this,"progress");this.popTime=parseInt(e[2],16),this.timeRemaining=parseInt(e[3],16),this.unknown=parseInt(e[4],16),this.ceKey=parseInt(e[5],16),this.numPlayers=parseInt(e[6],16),this.status=parseInt(e[7],16),this.unknown2=parseInt(e[8],16),this.progress=parseInt(e[9],16)}}class se extends c{constructor(e){super("InCombat",e);t(this,"inACTCombat");t(this,"inGameCombat");t(this,"isACTChanged");t(this,"isGameChanged");this.inACTCombat=parseInt(e[2])===1,this.inGameCombat=parseInt(e[3])===1,this.isACTChanged=parseInt(e[4])===1,this.isGameChanged=parseInt(e[5])===1}}class re extends c{constructor(e){super("CombatantMemory",e);t(this,"change");t(this,"id");t(this,"data");this.change=e[2],this.id=parseInt(e[3],16),this.data=new Map;for(let a=4;a<e.length-1;a+=2)this.data.set(e[a],e[a+1])}}class ae extends c{constructor(e){super("RSVData",e);t(this,"locale");t(this,"unknown");t(this,"key");t(this,"value");this.locale=e[2],this.unknown=parseInt(e[3],16),this.key=e[4],this.value=e[5]}}class ne extends c{constructor(e){super("StartsUsingExtra",e);t(this,"sourceID");t(this,"id");t(this,"x");t(this,"y");t(this,"z");t(this,"heading");this.sourceID=parseInt(e[2],16),this.id=parseInt(e[3],16),this.x=parseFloat(e[4]),this.y=parseFloat(e[5]),this.z=parseFloat(e[6]),this.heading=parseFloat(e[7])}}class ie extends c{constructor(e){super("AbilityExtra",e);t(this,"sourceID");t(this,"id");t(this,"globalEffectCounter");t(this,"dataFlag");t(this,"x");t(this,"y");t(this,"z");t(this,"heading");t(this,"animationTargetId");this.sourceID=parseInt(e[2],16),this.id=parseInt(e[3],16),this.globalEffectCounter=parseInt(e[4],16),this.dataFlag=parseInt(e[5],16),this.x=parseFloat(e[6]),this.y=parseFloat(e[7]),this.z=parseFloat(e[8]),this.heading=parseFloat(e[9]),this.animationTargetId=parseInt(e[10],16)}}class ce extends c{constructor(e){super("ContentFinderSettings",e);t(this,"zoneID");t(this,"zoneName");t(this,"inContentFinderContent");t(this,"unrestrictedParty");t(this,"minimalItemLevel");t(this,"silenceEcho");t(this,"explorerMode");t(this,"levelSync");this.zoneID=parseInt(e[2],16),this.zoneName=e[3],this.inContentFinderContent=parseInt(e[4])===1,this.unrestrictedParty=parseInt(e[5])===1,this.minimalItemLevel=parseInt(e[6])===1,this.silenceEcho=parseInt(e[7])===1,this.explorerMode=parseInt(e[8])===1,this.levelSync=parseInt(e[9])===1}}class he extends c{constructor(e){super("NpcYell",e);t(this,"npcId");t(this,"npcNameId");t(this,"npcYellId");this.npcId=parseInt(e[2],16),this.npcNameId=parseInt(e[3],16),this.npcYellId=parseInt(e[4],16)}}class oe extends c{constructor(e){super("BattleTalk2",e);t(this,"npcId");t(this,"instance");t(this,"npcNameId");t(this,"instanceContentTextId");t(this,"displayMs");this.npcId=parseInt(e[2],16),this.instance=parseInt(e[3],16),this.npcNameId=parseInt(e[4],16),this.instanceContentTextId=parseInt(e[5],16),this.displayMs=parseInt(e[6])}}class pe extends c{constructor(e){super("Countdown",e);t(this,"id");t(this,"worldID");t(this,"countdownTime");t(this,"result");t(this,"name");this.id=parseInt(e[2],16),this.worldID=parseInt(e[3],16),this.countdownTime=parseInt(e[4]),this.result=parseInt(e[5],16),this.name=e[6]}}class de extends c{constructor(e){super("CountdownCancel",e);t(this,"id");t(this,"worldID");t(this,"name");this.id=parseInt(e[2],16),this.worldID=parseInt(e[3],16),this.name=e[4]}}class ue extends c{constructor(e){super("ActorMove",e);t(this,"id");t(this,"heading");t(this,"unk1");t(this,"unk2");t(this,"x");t(this,"y");t(this,"z");this.id=parseInt(e[2],16),this.heading=parseFloat(e[3]),this.unk1=parseInt(e[4],16),this.unk2=parseInt(e[5],16),this.x=parseFloat(e[6]),this.y=parseFloat(e[7]),this.z=parseFloat(e[8])}}class Ie extends c{constructor(e){super("ActorSetPos",e);t(this,"id");t(this,"heading");t(this,"unk1");t(this,"unk2");t(this,"x");t(this,"y");t(this,"z");this.id=parseInt(e[2],16),this.heading=parseFloat(e[3]),this.unk1=parseInt(e[4],16),this.unk2=parseInt(e[5],16),this.x=parseFloat(e[6]),this.y=parseFloat(e[7]),this.z=parseFloat(e[8])}}class le extends c{constructor(e){super("SpawnNpcExtra",e);t(this,"id");t(this,"parentID");t(this,"tetherID");t(this,"animationState");this.id=parseInt(e[2],16),this.parentID=parseInt(e[3],16),this.tetherID=parseInt(e[4],16),this.animationState=parseInt(e[5],16)}}class me extends c{constructor(e){super("ActorControlExtra",e);t(this,"id");t(this,"category");t(this,"param1");t(this,"param2");t(this,"param3");t(this,"param4");this.id=parseInt(e[2],16),this.category=parseInt(e[3],16),this.param1=parseInt(e[4],16),this.param2=parseInt(e[5],16),this.param3=parseInt(e[6],16),this.param4=parseInt(e[7],16)}}class we extends c{constructor(e){super("ActorControlSelfExtra",e);t(this,"id");t(this,"category");t(this,"param1");t(this,"param2");t(this,"param3");t(this,"param4");t(this,"param5");t(this,"param6");this.id=parseInt(e[2],16),this.category=parseInt(e[3],16),this.param1=parseInt(e[4],16),this.param2=parseInt(e[5],16),this.param3=parseInt(e[6],16),this.param4=parseInt(e[7],16),this.param5=parseInt(e[8],16),this.param6=parseInt(e[9],16)}}class ye extends c{constructor(e){super("Unknown",e);t(this,"rawLines");this.rawLines=e}}function Le(r){switch(parseInt(r[0])){case 0:return new k(r);case 1:return new b(r);case 2:return new D(r);case 3:return new P(r);case 4:return new N(r);case 11:return new C(r);case 12:return new E(r);case 20:return new M(r);case 21:case 22:return new F(r);case 23:return new x(r);case 24:return new H(r);case 25:return new S(r);case 26:return new T(r);case 27:return new O(r);case 28:return new A(r);case 29:return new L(r);case 30:return new R(r);case 31:return new _(r);case 33:return new q(r);case 34:return new z(r);case 35:return new B(r);case 36:return new U(r);case 37:return new j(r);case 38:return new V(r);case 39:return new G(r);case 40:return new W(r);case 41:return new Y(r);case 42:return new Z(r);case 251:return new J(r);case 252:return new X(r);case 253:return new K(r);case 254:return new $(r);case 256:return new Q(r);case 257:return new g(r);case 258:return new ee(r);case 259:return new te(r);case 260:return new se(r);case 261:return new re(r);case 262:return new ae(r);case 263:return new ne(r);case 264:return new ie(r);case 265:return new ce(r);case 266:return new he(r);case 267:return new oe(r);case 268:return new pe(r);case 269:return new de(r);case 270:return new ue(r);case 271:return new Ie(r);case 272:return new le(r);case 273:return new me(r);case 274:return new we(r);default:return new ye(r)}}let fe=new v;(function(){fe.Connect()})(),n.AbilityExtra=ie,n.ActorControlExtra=me,n.ActorControlSelfExtra=we,n.ActorMove=ue,n.ActorSetPos=Ie,n.AddCombatant=P,n.BattleTalk2=oe,n.CEDirector=te,n.ChangePrimaryPlayer=D,n.ChangeZone=b,n.CombatantMemory=re,n.ContentFinderSettings=ce,n.Countdown=pe,n.CountdownCancel=de,n.Debug=J,n.Error=$,n.FateDirector=ee,n.GameLogLine=k,n.InCombat=se,n.LimitBreak=U,n.LineRegistration=Q,n.LogLineBase=c,n.MapEffect=g,n.MapLog=W,n.MemoryReadResult=f,n.MemoryScanResult=y,n.NetowrkStartsCasting=M,n.NetworkAbility=F,n.NetworkActionSync=j,n.NetworkActorControl=q,n.NetworkBuff=T,n.NetworkBuffRemove=R,n.NetworkCancelAbility=x,n.NetworkDeath=S,n.NetworkDoT=H,n.NetworkGauge=_,n.NetworkNameToggle=z,n.NetworkRaidMarker=A,n.NetworkStatusEffects=V,n.NetworkTargetIcon=O,n.NetworkTargetMarker=L,n.NetworkTether=B,n.NetworkUpdateHP=G,n.NpcYell=he,n.OverlayToolkit=v,n.PacketDump=X,n.ParseLogLine=Le,n.PartyList=C,n.PlayerStats=E,n.RSVData=ae,n.RemoveCombatant=N,n.SpawnNpcExtra=le,n.StartsUsingExtra=ne,n.StatusList3=Z,n.SystemLogMessage=Y,n.UnknownLogLine=ye,n.Version=K,n.default=fe,Object.defineProperties(n,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|