phantasmal-world/main.f992e4453dd0ad27851d.js
Daan Vanden Bosch 1921b966bc Release 17.
2019-08-14 19:14:35 +02:00

1 line
333 KiB
JavaScript

(window.webpackJsonp=window.webpackJsonp||[]).push([[1],{"2YZa":function(e,t,n){"use strict";n.r(t);var i=n("q1tI"),o=n.n(i),r=n("i8i4"),s=n.n(r),a=n("GGSb"),d=n.n(a),l=n("O388"),u=n.n(l),c=n("BvKs"),_=n("2fM7"),p=n("kMSe");function v(e){const t=Object.values(e),n=t.filter(e=>"number"==typeof e);return n.length?n:t}class w{constructor(e,t){this.values=new Map,this.keys=v(e);for(const e of this.keys)this.values.set(e,t(e))}get(e){return this.values.get(e)}}const h=1/512,f=.1;var m;!function(e){e.Ephinea="Ephinea"}(m||(m={}));v(m);var g;!function(e){e[e.Viridia=0]="Viridia",e[e.Greenill=1]="Greenill",e[e.Skyly=2]="Skyly",e[e.Bluefull=3]="Bluefull",e[e.Purplenum=4]="Purplenum",e[e.Pinkal=5]="Pinkal",e[e.Redria=6]="Redria",e[e.Oran=7]="Oran",e[e.Yellowboze=8]="Yellowboze",e[e.Whitill=9]="Whitill"}(g||(g={}));const y=v(g);var k;!function(e){e[e.Normal=0]="Normal",e[e.Hard=1]="Hard",e[e.VHard=2]="VHard",e[e.Ultimate=3]="Ultimate"}(k||(k={}));const R=v(k);var b=n("7Uv3"),N=n.n(b),E=n("fyUT"),T=n("2vnA"),S=function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s};class O{constructor(e,t,n,i,o,r,s){this.id=e,this.name=t,this.min_atp=n,this.max_atp=i,this.ata=o,this.max_grind=r,this.required_atp=s}}class C{constructor(e,t,n,i,o,r,s,a,d,l,u){this.id=e,this.name=t,this.atp=n,this.ata=i,this.min_evp=o,this.max_evp=r,this.min_dfp=s,this.max_dfp=a,this.mst=d,this.hp=l,this.lck=u}}class D{constructor(e,t,n,i,o,r,s,a,d,l,u){this.id=e,this.name=t,this.atp=n,this.ata=i,this.min_evp=o,this.max_evp=r,this.min_dfp=s,this.max_dfp=a,this.mst=d,this.hp=l,this.lck=u}}class P{constructor(e,t){this.id=e,this.name=t}}class F{constructor(e,t){this.id=e,this.name=t}}class W{constructor(e){this.type=e,this.attribute=0,this.hit=0,this.grind=0}get grind_atp(){return 2*this.grind}}S([T.n],W.prototype,"attribute",void 0),S([T.n],W.prototype,"hit",void 0),S([T.n],W.prototype,"grind",void 0),S([T.f],W.prototype,"grind_atp",null);var L,U=n("LvDl"),M=function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},I=function(e,t,n,i){return new(n||(n=Promise))(function(o,r){function s(e){try{d(i.next(e))}catch(e){r(e)}}function a(e){try{d(i.throw(e))}catch(e){r(e)}}function d(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(s,a)}d((i=i.apply(e,t||[])).next())})};!function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Nominal=2]="Nominal",e[e.Error=3]="Error",e[e.Reloading=4]="Reloading"}(L||(L={}));class B{constructor(e,t){this._promise=new Promise(e=>e(this._value)),this._state=L.Uninitialized,this._value=e,this._load=t}get value(){return this._state===L.Uninitialized&&Object(U.defer)(()=>this.load_value()),this._value}set value(e){this._value=e}get promise(){return this._state===L.Uninitialized?this.load_value():this._promise}get state(){return this._state}get is_initialized(){return this._state!==L.Uninitialized}get is_loading(){switch(this._state){case L.Initializing:case L.Reloading:return!0;default:return!1}}get error(){return this._error}load(){return this.load_value()}load_value(){return I(this,void 0,void 0,function*(){if(this.is_loading)return this._promise;this._state=L.Initializing;try{return this._load&&(this._promise=this._load(),this._value=yield this._promise),this._state=L.Nominal,this._error=void 0,this._value}catch(e){throw this._state=L.Error,this._error=e,e}})}}M([T.n],B.prototype,"_value",void 0),M([T.n],B.prototype,"_promise",void 0),M([T.n],B.prototype,"_state",void 0),M([T.n],B.prototype,"_error",void 0),M([T.f],B.prototype,"value",null),M([T.f],B.prototype,"state",null),M([T.f],B.prototype,"is_initialized",null),M([T.f],B.prototype,"is_loading",null),M([T.f],B.prototype,"error",null);var A=function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s};class x{constructor(){this.current_server=m.Ephinea,this.current_tool=this.init_tool(),this.global_keyup_handlers=new Map,this.dispatch_global_keyup=e=>{const t=[];e.ctrlKey&&t.push("Ctrl"),e.shiftKey&&t.push("Shift"),e.altKey&&t.push("Alt"),t.push(e.key.toUpperCase());const n=t.join("-"),i=this.global_keyup_handlers.get(`${this.current_tool} -> ${n}`);i&&i()},Object(T.e)(()=>{window.location.hash=`#/${this.current_tool}`})}on_global_keyup(e,t,n){this.global_keyup_handlers.set(`${e} -> ${t}`,n)}init_tool(){const e=window.location.hash.slice(2);return e.length?e:"viewer"}}A([T.n],x.prototype,"current_server",void 0),A([T.n],x.prototype,"current_tool",void 0);const j=new x;class G extends w{constructor(e){super(m,e)}get current(){return this.get(j.current_server)}}(function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);r>3&&s&&Object.defineProperty(t,n,s)})([T.f],G.prototype,"current",null);var K=function(e,t,n,i){return new(n||(n=Promise))(function(o,r){function s(e){try{d(i.next(e))}catch(e){r(e)}}function a(e){try{d(i.throw(e))}catch(e){r(e)}}function d(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(s,a)}d((i=i.apply(e,t||[])).next())})};class z{constructor(){this.id_to_item_type=[],this.item_types=[],this.load=e=>K(this,void 0,void 0,function*(){const t=yield fetch(`/assets/itemTypes.${m[e].toLowerCase()}.json`),n=yield t.json(),i=new Array;for(const e of n){let t;switch(e.class){case"weapon":t=new O(e.id,e.name,e.minAtp,e.maxAtp,e.ata,e.maxGrind,e.requiredAtp);break;case"armor":t=new C(e.id,e.name,e.atp,e.ata,e.minEvp,e.maxEvp,e.minDfp,e.maxDfp,e.mst,e.hp,e.lck);break;case"shield":t=new D(e.id,e.name,e.atp,e.ata,e.minEvp,e.maxEvp,e.minDfp,e.maxDfp,e.mst,e.hp,e.lck);break;case"unit":t=new P(e.id,e.name);break;case"tool":t=new F(e.id,e.name);break;default:continue}this.id_to_item_type[t.id]=t,i.push(t)}return this.item_types=i,this})}get_by_id(e){return this.id_to_item_type[e]}}(function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);r>3&&s&&Object.defineProperty(t,n,s)})([T.n],z.prototype,"item_types",void 0);const H=new G(e=>{const t=new z;return new B(t,()=>t.load(e))});var V=function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s};const q=.2*.9,$=1.89*q;class J{constructor(e,t){this.store=e,this.item=t}get shifta_atp(){return this.item.type.min_atp===this.item.type.max_atp?0:this.item.type.max_atp*this.store.shifta_factor}get min_atp(){return this.item.type.min_atp+this.item.grind_atp}get max_atp(){return this.item.type.max_atp+this.item.grind_atp+this.shifta_atp}get final_min_atp(){return this.min_atp+this.store.armor_atp+this.store.shield_atp+this.store.base_atp+this.store.base_shifta_atp}get final_max_atp(){return this.max_atp+this.store.armor_atp+this.store.shield_atp+this.store.base_atp+this.store.base_shifta_atp}get min_normal_damage(){return(this.final_min_atp-this.store.enemy_dfp)*q}get max_normal_damage(){return(this.final_max_atp-this.store.enemy_dfp)*q}get avg_normal_damage(){return(this.min_normal_damage+this.max_normal_damage)/2}get min_heavy_damage(){return(this.final_min_atp-this.store.enemy_dfp)*$}get max_heavy_damage(){return(this.final_max_atp-this.store.enemy_dfp)*$}get avg_heavy_damage(){return(this.min_heavy_damage+this.max_heavy_damage)/2}}V([T.f],J.prototype,"shifta_atp",null),V([T.f],J.prototype,"min_atp",null),V([T.f],J.prototype,"max_atp",null),V([T.f],J.prototype,"final_min_atp",null),V([T.f],J.prototype,"final_max_atp",null),V([T.f],J.prototype,"min_normal_damage",null),V([T.f],J.prototype,"max_normal_damage",null),V([T.f],J.prototype,"avg_normal_damage",null),V([T.f],J.prototype,"min_heavy_damage",null),V([T.f],J.prototype,"max_heavy_damage",null),V([T.f],J.prototype,"avg_heavy_damage",null);class Y{constructor(){this.char_atp=0,this.mag_pow=0,this.shifta_lvl=0,this.weapons=T.n.array(),this.add_weapon=e=>{this.weapons.push(new J(this,new W(e)))},this.enemy_dfp=0}get weapon_types(){return H.current.value.item_types.filter(e=>e instanceof O)}get armor_types(){return H.current.value.item_types.filter(e=>e instanceof C)}get shield_types(){return H.current.value.item_types.filter(e=>e instanceof D)}get armor_atp(){return this.armor_type?this.armor_type.atp:0}get shield_atp(){return this.shield_type?this.shield_type.atp:0}get base_atp(){return this.char_atp+2*this.mag_pow}get shifta_factor(){return this.shifta_lvl?.013*(this.shifta_lvl-1)+.1:0}get base_shifta_atp(){return this.base_atp*this.shifta_factor}}V([T.f],Y.prototype,"weapon_types",null),V([T.f],Y.prototype,"armor_types",null),V([T.f],Y.prototype,"shield_types",null),V([T.n],Y.prototype,"char_atp",void 0),V([T.n],Y.prototype,"mag_pow",void 0),V([T.f],Y.prototype,"armor_atp",null),V([T.f],Y.prototype,"shield_atp",null),V([T.n],Y.prototype,"shifta_lvl",void 0),V([T.f],Y.prototype,"base_atp",null),V([T.f],Y.prototype,"shifta_factor",null),V([T.f],Y.prototype,"base_shifta_atp",null),V([T.n],Y.prototype,"weapons",void 0),V([T.n],Y.prototype,"armor_type",void 0),V([T.n],Y.prototype,"shield_type",void 0),V([T.n],Y.prototype,"enemy_dfp",void 0);const Z=new Y;var X=n("QCG5"),Q=n.n(X),ee=n("4D8E"),te=n.n(ee);class ne extends i.PureComponent{render(){return o.a.createElement(Q.a,Object.assign({className:te.a.main},this.props))}}let ie=class extends i.Component{constructor(){super(...arguments),this.add_weapon=e=>{if(e){let t=H.current.value.get_by_id(e.value);Z.add_weapon(t)}},this.armor_changed=e=>{if(e){let t=H.current.value.get_by_id(e.value);Z.armor_type=t}else Z.armor_type=void 0},this.shield_changed=e=>{if(e){let t=H.current.value.get_by_id(e.value);Z.shield_type=t}else Z.shield_type=void 0}}render(){return o.a.createElement("section",null,o.a.createElement("section",null,o.a.createElement("div",null,"Weapons:"),o.a.createElement(ne,{placeholder:"Add a weapon",value:void 0,options:Z.weapon_types.map(e=>({label:e.name,value:e.id})),onChange:this.add_weapon}),o.a.createElement("table",null,o.a.createElement("thead",null,o.a.createElement("tr",null,o.a.createElement("td",null,"Weapon"),o.a.createElement("td",null,"Min. ATP"),o.a.createElement("td",null,"Max. ATP"),o.a.createElement("td",null,"Grind"),o.a.createElement("td",null,"Grind ATP"),o.a.createElement("td",null,"Shifta ATP"),o.a.createElement("td",null,"Final Min. ATP"),o.a.createElement("td",null,"Final Max. ATP"),o.a.createElement("td",null,"Min. Normal Damage"),o.a.createElement("td",null,"Max. Normal Damage"),o.a.createElement("td",null,"Avg. Normal Damage"),o.a.createElement("td",null,"Min. Heavy Damage"),o.a.createElement("td",null,"Max. Heavy Damage"),o.a.createElement("td",null,"Avg. Heavy Damage"))),o.a.createElement("tbody",null,Z.weapons.map((e,t)=>o.a.createElement("tr",{key:t},o.a.createElement("td",null,e.item.type.name),o.a.createElement("td",null,e.item.type.min_atp),o.a.createElement("td",null,e.item.type.max_atp),o.a.createElement("td",null,o.a.createElement(E.a,{size:"small",value:e.item.grind,min:0,max:e.item.type.max_grind,step:1,onChange:t=>e.item.grind=t||0})),o.a.createElement("td",null,e.item.grind_atp),o.a.createElement("td",null,e.shifta_atp.toFixed(1)),o.a.createElement("td",null,e.final_min_atp.toFixed(1)),o.a.createElement("td",null,e.final_max_atp.toFixed(1)),o.a.createElement("td",null,e.min_normal_damage.toFixed(1)),o.a.createElement("td",null,e.max_normal_damage.toFixed(1)),o.a.createElement("td",null,e.avg_normal_damage.toFixed(1)),o.a.createElement("td",null,e.min_heavy_damage.toFixed(1)),o.a.createElement("td",null,e.max_heavy_damage.toFixed(1)),o.a.createElement("td",null,e.avg_heavy_damage.toFixed(1)))))),o.a.createElement("div",null,"Character ATP:"),o.a.createElement(E.a,{value:Z.char_atp,min:0,step:1,onChange:e=>Z.char_atp=e||0}),o.a.createElement("div",null,"MAG POW:"),o.a.createElement(E.a,{value:Z.mag_pow,min:0,max:200,step:1,onChange:e=>Z.mag_pow=e||0}),o.a.createElement("div",null,"Armor:"),o.a.createElement(ne,{placeholder:"Choose an armor",value:Z.armor_type&&Z.armor_type.id,options:Z.armor_types.map(e=>({label:e.name,value:e.id})),onChange:this.armor_changed}),o.a.createElement("span",null,"Armor ATP: ",Z.armor_atp),o.a.createElement("div",null,"Shield:"),o.a.createElement(ne,{placeholder:"Choose a shield",value:Z.shield_type&&Z.shield_type.id,options:Z.shield_types.map(e=>({label:e.name,value:e.id})),onChange:this.shield_changed}),o.a.createElement("span",null,"Shield ATP: ",Z.shield_atp),o.a.createElement("div",null,"Shifta level:"),o.a.createElement(E.a,{value:Z.shifta_lvl,min:0,max:30,step:1,onChange:e=>Z.shifta_lvl=e||0}),o.a.createElement("div",null,"Shifta factor:"),o.a.createElement("div",null,Z.shifta_factor.toFixed(3)),o.a.createElement("div",null,"Base shifta ATP:"),o.a.createElement("div",null,Z.base_shifta_atp.toFixed(2))))}};ie=function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s}([p.a],ie);var oe=n("+KLJ"),re=n("Gtni"),se=n.n(re);class ae extends i.Component{constructor(){super(...arguments),this.state={has_error:!1}}render(){return this.state.has_error?o.a.createElement("div",{className:se.a.main},o.a.createElement("div",null,o.a.createElement(oe.a,{type:"error",message:"Something went wrong."}))):this.props.children}static getDerivedStateFromError(){return{has_error:!0}}}function de(e){const t=t=>o.a.createElement(ae,null,o.a.createElement(e,Object.assign({},t)));return t.displayName=`${e.displayName}ErrorBoundary`,t}var le=n("ZTPi"),ue=n("DyTH"),ce=n.n(ue),_e=n("kl6h"),pe=n("wd/R"),ve=n.n(pe),we=n("c7k8"),he=function(e,t,n,i){return new(n||(n=Promise))(function(o,r){function s(e){try{d(i.next(e))}catch(e){r(e)}}function a(e){try{d(i.throw(e))}catch(e){r(e)}}function d(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(s,a)}d((i=i.apply(e,t||[])).next())})};const fe=d.a.get("persistence/Persister");class me{persist_for_server(e,t,n){this.persist(t+"."+m[e],n)}persist(e,t){try{localStorage.setItem(e,JSON.stringify(t))}catch(t){fe.error(`Couldn't persist ${e}.`,t)}}load_for_server(e,t){return he(this,void 0,void 0,function*(){return this.load(t+"."+m[e])})}load(e){return he(this,void 0,void 0,function*(){try{const t=localStorage.getItem(e);return t&&JSON.parse(t)}catch(t){return void fe.error(`Couldn't load ${e}.`,t)}})}}var ge=function(e,t,n,i){return new(n||(n=Promise))(function(o,r){function s(e){try{d(i.next(e))}catch(e){r(e)}}function a(e){try{d(i.throw(e))}catch(e){r(e)}}function d(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(s,a)}d((i=i.apply(e,t||[])).next())})};const ye="HuntMethodStore.methodUserTimes";const ke=new class extends me{persist_method_user_times(e,t){const n={};for(const t of e)null!=t.user_time&&(n[t.id]=t.user_time);this.persist_for_server(t,ye,n)}load_method_user_times(e,t){return ge(this,void 0,void 0,function*(){const n=yield this.load_for_server(t,ye);if(n)for(const t of e)t.user_time=n[t.id];return e})}};var Re;!function(e){e[e.I=1]="I",e[e.II=2]="II",e[e.IV=4]="IV"}(Re||(Re={}));const be=[Re.I,Re.II,Re.IV];function Ne(e){if(null==Re[e])throw new Error(`Invalid episode ${e}.`)}var Ee;!function(e){e[e.Unknown=0]="Unknown",e[e.FemaleFat=1]="FemaleFat",e[e.FemaleMacho=2]="FemaleMacho",e[e.FemaleTall=3]="FemaleTall",e[e.MaleDwarf=4]="MaleDwarf",e[e.MaleFat=5]="MaleFat",e[e.MaleMacho=6]="MaleMacho",e[e.MaleOld=7]="MaleOld",e[e.BlueSoldier=8]="BlueSoldier",e[e.RedSoldier=9]="RedSoldier",e[e.Principal=10]="Principal",e[e.Tekker=11]="Tekker",e[e.GuildLady=12]="GuildLady",e[e.Scientist=13]="Scientist",e[e.Nurse=14]="Nurse",e[e.Irene=15]="Irene",e[e.ItemShop=16]="ItemShop",e[e.Nurse2=17]="Nurse2",e[e.Hildebear=18]="Hildebear",e[e.Hildeblue=19]="Hildeblue",e[e.RagRappy=20]="RagRappy",e[e.AlRappy=21]="AlRappy",e[e.Monest=22]="Monest",e[e.Mothmant=23]="Mothmant",e[e.SavageWolf=24]="SavageWolf",e[e.BarbarousWolf=25]="BarbarousWolf",e[e.Booma=26]="Booma",e[e.Gobooma=27]="Gobooma",e[e.Gigobooma=28]="Gigobooma",e[e.Dragon=29]="Dragon",e[e.GrassAssassin=30]="GrassAssassin",e[e.PoisonLily=31]="PoisonLily",e[e.NarLily=32]="NarLily",e[e.NanoDragon=33]="NanoDragon",e[e.EvilShark=34]="EvilShark",e[e.PalShark=35]="PalShark",e[e.GuilShark=36]="GuilShark",e[e.PofuillySlime=37]="PofuillySlime",e[e.PouillySlime=38]="PouillySlime",e[e.PanArms=39]="PanArms",e[e.Migium=40]="Migium",e[e.Hidoom=41]="Hidoom",e[e.DeRolLe=42]="DeRolLe",e[e.Dubchic=43]="Dubchic",e[e.Gilchic=44]="Gilchic",e[e.Garanz=45]="Garanz",e[e.SinowBeat=46]="SinowBeat",e[e.SinowGold=47]="SinowGold",e[e.Canadine=48]="Canadine",e[e.Canane=49]="Canane",e[e.Dubswitch=50]="Dubswitch",e[e.VolOpt=51]="VolOpt",e[e.Delsaber=52]="Delsaber",e[e.ChaosSorcerer=53]="ChaosSorcerer",e[e.DarkGunner=54]="DarkGunner",e[e.DeathGunner=55]="DeathGunner",e[e.ChaosBringer=56]="ChaosBringer",e[e.DarkBelra=57]="DarkBelra",e[e.Dimenian=58]="Dimenian",e[e.LaDimenian=59]="LaDimenian",e[e.SoDimenian=60]="SoDimenian",e[e.Bulclaw=61]="Bulclaw",e[e.Bulk=62]="Bulk",e[e.Claw=63]="Claw",e[e.DarkFalz=64]="DarkFalz",e[e.Hildebear2=65]="Hildebear2",e[e.Hildeblue2=66]="Hildeblue2",e[e.RagRappy2=67]="RagRappy2",e[e.LoveRappy=68]="LoveRappy",e[e.StRappy=69]="StRappy",e[e.HalloRappy=70]="HalloRappy",e[e.EggRappy=71]="EggRappy",e[e.Monest2=72]="Monest2",e[e.Mothmant2=73]="Mothmant2",e[e.PoisonLily2=74]="PoisonLily2",e[e.NarLily2=75]="NarLily2",e[e.GrassAssassin2=76]="GrassAssassin2",e[e.Dimenian2=77]="Dimenian2",e[e.LaDimenian2=78]="LaDimenian2",e[e.SoDimenian2=79]="SoDimenian2",e[e.DarkBelra2=80]="DarkBelra2",e[e.BarbaRay=81]="BarbaRay",e[e.SavageWolf2=82]="SavageWolf2",e[e.BarbarousWolf2=83]="BarbarousWolf2",e[e.PanArms2=84]="PanArms2",e[e.Migium2=85]="Migium2",e[e.Hidoom2=86]="Hidoom2",e[e.Dubchic2=87]="Dubchic2",e[e.Gilchic2=88]="Gilchic2",e[e.Garanz2=89]="Garanz2",e[e.Dubswitch2=90]="Dubswitch2",e[e.Delsaber2=91]="Delsaber2",e[e.ChaosSorcerer2=92]="ChaosSorcerer2",e[e.GolDragon=93]="GolDragon",e[e.SinowBerill=94]="SinowBerill",e[e.SinowSpigell=95]="SinowSpigell",e[e.Merillia=96]="Merillia",e[e.Meriltas=97]="Meriltas",e[e.Mericarol=98]="Mericarol",e[e.Mericus=99]="Mericus",e[e.Merikle=100]="Merikle",e[e.UlGibbon=101]="UlGibbon",e[e.ZolGibbon=102]="ZolGibbon",e[e.Gibbles=103]="Gibbles",e[e.Gee=104]="Gee",e[e.GiGue=105]="GiGue",e[e.IllGill=106]="IllGill",e[e.DelLily=107]="DelLily",e[e.Epsilon=108]="Epsilon",e[e.GalGryphon=109]="GalGryphon",e[e.Deldepth=110]="Deldepth",e[e.Delbiter=111]="Delbiter",e[e.Dolmolm=112]="Dolmolm",e[e.Dolmdarl=113]="Dolmdarl",e[e.Morfos=114]="Morfos",e[e.Recobox=115]="Recobox",e[e.Recon=116]="Recon",e[e.SinowZoa=117]="SinowZoa",e[e.SinowZele=118]="SinowZele",e[e.OlgaFlow=119]="OlgaFlow",e[e.SandRappy=120]="SandRappy",e[e.DelRappy=121]="DelRappy",e[e.Astark=122]="Astark",e[e.SatelliteLizard=123]="SatelliteLizard",e[e.Yowie=124]="Yowie",e[e.MerissaA=125]="MerissaA",e[e.MerissaAA=126]="MerissaAA",e[e.Girtablulu=127]="Girtablulu",e[e.Zu=128]="Zu",e[e.Pazuzu=129]="Pazuzu",e[e.Boota=130]="Boota",e[e.ZeBoota=131]="ZeBoota",e[e.BaBoota=132]="BaBoota",e[e.Dorphon=133]="Dorphon",e[e.DorphonEclair=134]="DorphonEclair",e[e.Goran=135]="Goran",e[e.PyroGoran=136]="PyroGoran",e[e.GoranDetonator=137]="GoranDetonator",e[e.SaintMilion=138]="SaintMilion",e[e.Shambertin=139]="Shambertin",e[e.Kondrieu=140]="Kondrieu"}(Ee||(Ee={}));const Te=[],Se=[];function Oe(e){return De[e]}const Ce=[void 0,new Map,new Map,void 0,new Map],De=[];function Pe(e,t,n,i,o,r,s){if(Te.push(e),r&&Se.push(e),De[e]={name:t,simple_name:n,ultimate_name:i,episode:o,enemy:r,rare_type:s},o){const t=Ce[o];t&&(t.set(n,e),t.set(i,e))}}Pe(Ee.Unknown,"Unknown","Unknown","Unknown",void 0,!1),Pe(Ee.FemaleFat,"Female Fat","Female Fat","Female Fat",void 0,!1),Pe(Ee.FemaleMacho,"Female Macho","Female Macho","Female Macho",void 0,!1),Pe(Ee.FemaleTall,"Female Tall","Female Tall","Female Tall",void 0,!1),Pe(Ee.MaleDwarf,"Male Dwarf","Male Dwarf","Male Dwarf",void 0,!1),Pe(Ee.MaleFat,"Male Fat","Male Fat","Male Fat",void 0,!1),Pe(Ee.MaleMacho,"Male Macho","Male Macho","Male Macho",void 0,!1),Pe(Ee.MaleOld,"Male Old","Male Old","Male Old",void 0,!1),Pe(Ee.BlueSoldier,"Blue Soldier","Blue Soldier","Blue Soldier",void 0,!1),Pe(Ee.RedSoldier,"Red Soldier","Red Soldier","Red Soldier",void 0,!1),Pe(Ee.Principal,"Principal","Principal","Principal",void 0,!1),Pe(Ee.Tekker,"Tekker","Tekker","Tekker",void 0,!1),Pe(Ee.GuildLady,"Guild Lady","Guild Lady","Guild Lady",void 0,!1),Pe(Ee.Scientist,"Scientist","Scientist","Scientist",void 0,!1),Pe(Ee.Nurse,"Nurse","Nurse","Nurse",void 0,!1),Pe(Ee.Irene,"Irene","Irene","Irene",void 0,!1),Pe(Ee.ItemShop,"Item Shop","Item Shop","Item Shop",void 0,!1),Pe(Ee.Nurse2,"Nurse (Ep. II);","Nurse","Nurse",2,!1),Pe(Ee.Hildebear,"Hildebear","Hildebear","Hildelt",1,!0,Ee.Hildeblue),Pe(Ee.Hildeblue,"Hildeblue","Hildeblue","Hildetorr",1,!0),Pe(Ee.RagRappy,"Rag Rappy","Rag Rappy","El Rappy",1,!0,Ee.AlRappy),Pe(Ee.AlRappy,"Al Rappy","Al Rappy","Pal Rappy",1,!0),Pe(Ee.Monest,"Monest","Monest","Mothvist",1,!0),Pe(Ee.Mothmant,"Mothmant","Mothmant","Mothvert",1,!0),Pe(Ee.SavageWolf,"Savage Wolf","Savage Wolf","Gulgus",1,!0),Pe(Ee.BarbarousWolf,"Barbarous Wolf","Barbarous Wolf","Gulgus-Gue",1,!0),Pe(Ee.Booma,"Booma","Booma","Bartle",1,!0),Pe(Ee.Gobooma,"Gobooma","Gobooma","Barble",1,!0),Pe(Ee.Gigobooma,"Gigobooma","Gigobooma","Tollaw",1,!0),Pe(Ee.Dragon,"Dragon","Dragon","Sil Dragon",1,!0),Pe(Ee.GrassAssassin,"Grass Assassin","Grass Assassin","Crimson Assassin",1,!0),Pe(Ee.PoisonLily,"Poison Lily","Poison Lily","Ob Lily",1,!0,Ee.NarLily),Pe(Ee.NarLily,"Nar Lily","Nar Lily","Mil Lily",1,!0),Pe(Ee.NanoDragon,"Nano Dragon","Nano Dragon","Nano Dragon",1,!0),Pe(Ee.EvilShark,"Evil Shark","Evil Shark","Vulmer",1,!0),Pe(Ee.PalShark,"Pal Shark","Pal Shark","Govulmer",1,!0),Pe(Ee.GuilShark,"Guil Shark","Guil Shark","Melqueek",1,!0),Pe(Ee.PofuillySlime,"Pofuilly Slime","Pofuilly Slime","Pofuilly Slime",1,!0,Ee.PouillySlime),Pe(Ee.PouillySlime,"Pouilly Slime","Pouilly Slime","Pouilly Slime",1,!0),Pe(Ee.PanArms,"Pan Arms","Pan Arms","Pan Arms",1,!0),Pe(Ee.Migium,"Migium","Migium","Migium",1,!0),Pe(Ee.Hidoom,"Hidoom","Hidoom","Hidoom",1,!0),Pe(Ee.DeRolLe,"De Rol Le","De Rol Le","Dal Ra Lie",1,!0),Pe(Ee.Dubchic,"Dubchic","Dubchic","Dubchich",1,!0),Pe(Ee.Gilchic,"Gilchic","Gilchic","Gilchich",1,!0),Pe(Ee.Garanz,"Garanz","Garanz","Baranz",1,!0),Pe(Ee.SinowBeat,"Sinow Beat","Sinow Beat","Sinow Blue",1,!0),Pe(Ee.SinowGold,"Sinow Gold","Sinow Gold","Sinow Red",1,!0),Pe(Ee.Canadine,"Canadine","Canadine","Canabin",1,!0),Pe(Ee.Canane,"Canane","Canane","Canune",1,!0),Pe(Ee.Dubswitch,"Dubswitch","Dubswitch","Dubswitch",1,!0),Pe(Ee.VolOpt,"Vol Opt","Vol Opt","Vol Opt ver.2",1,!0),Pe(Ee.Delsaber,"Delsaber","Delsaber","Delsaber",1,!0),Pe(Ee.ChaosSorcerer,"Chaos Sorcerer","Chaos Sorcerer","Gran Sorcerer",1,!0),Pe(Ee.DarkGunner,"Dark Gunner","Dark Gunner","Dark Gunner",1,!0),Pe(Ee.DeathGunner,"Death Gunner","Death Gunner","Death Gunner",1,!0),Pe(Ee.ChaosBringer,"Chaos Bringer","Chaos Bringer","Dark Bringer",1,!0),Pe(Ee.DarkBelra,"Dark Belra","Dark Belra","Indi Belra",1,!0),Pe(Ee.Dimenian,"Dimenian","Dimenian","Arlan",1,!0),Pe(Ee.LaDimenian,"La Dimenian","La Dimenian","Merlan",1,!0),Pe(Ee.SoDimenian,"So Dimenian","So Dimenian","Del-D",1,!0),Pe(Ee.Bulclaw,"Bulclaw","Bulclaw","Bulclaw",1,!0),Pe(Ee.Bulk,"Bulk","Bulk","Bulk",1,!0),Pe(Ee.Claw,"Claw","Claw","Claw",1,!0),Pe(Ee.DarkFalz,"Dark Falz","Dark Falz","Dark Falz",1,!0),Pe(Ee.Hildebear2,"Hildebear (Ep. II);","Hildebear","Hildelt",2,!0,Ee.Hildeblue2),Pe(Ee.Hildeblue2,"Hildeblue (Ep. II);","Hildeblue","Hildetorr",2,!0),Pe(Ee.RagRappy2,"Rag Rappy (Ep. II);","Rag Rappy","El Rappy",2,!0,Ee.LoveRappy),Pe(Ee.LoveRappy,"Love Rappy","Love Rappy","Love Rappy",2,!0),Pe(Ee.StRappy,"St. Rappy","St. Rappy","St. Rappy",2,!0),Pe(Ee.HalloRappy,"Hallo Rappy","Hallo Rappy","Hallo Rappy",2,!0),Pe(Ee.EggRappy,"Egg Rappy","Egg Rappy","Egg Rappy",2,!0),Pe(Ee.Monest2,"Monest (Ep. II);","Monest","Mothvist",2,!0),Pe(Ee.Mothmant2,"Mothmant","Mothmant","Mothvert",2,!0),Pe(Ee.PoisonLily2,"Poison Lily (Ep. II);","Poison Lily","Ob Lily",2,!0,Ee.NarLily2),Pe(Ee.NarLily2,"Nar Lily (Ep. II);","Nar Lily","Mil Lily",2,!0),Pe(Ee.GrassAssassin2,"Grass Assassin (Ep. II);","Grass Assassin","Crimson Assassin",2,!0),Pe(Ee.Dimenian2,"Dimenian (Ep. II);","Dimenian","Arlan",2,!0),Pe(Ee.LaDimenian2,"La Dimenian (Ep. II);","La Dimenian","Merlan",2,!0),Pe(Ee.SoDimenian2,"So Dimenian (Ep. II);","So Dimenian","Del-D",2,!0),Pe(Ee.DarkBelra2,"Dark Belra (Ep. II);","Dark Belra","Indi Belra",2,!0),Pe(Ee.BarbaRay,"Barba Ray","Barba Ray","Barba Ray",2,!0),Pe(Ee.SavageWolf2,"Savage Wolf (Ep. II);","Savage Wolf","Gulgus",2,!0),Pe(Ee.BarbarousWolf2,"Barbarous Wolf (Ep. II);","Barbarous Wolf","Gulgus-Gue",2,!0),Pe(Ee.PanArms2,"Pan Arms (Ep. II);","Pan Arms","Pan Arms",2,!0),Pe(Ee.Migium2,"Migium (Ep. II);","Migium","Migium",2,!0),Pe(Ee.Hidoom2,"Hidoom (Ep. II);","Hidoom","Hidoom",2,!0),Pe(Ee.Dubchic2,"Dubchic (Ep. II);","Dubchic","Dubchich",2,!0),Pe(Ee.Gilchic2,"Gilchic (Ep. II);","Gilchic","Gilchich",2,!0),Pe(Ee.Garanz2,"Garanz (Ep. II);","Garanz","Baranz",2,!0),Pe(Ee.Dubswitch2,"Dubswitch (Ep. II);","Dubswitch","Dubswitch",2,!0),Pe(Ee.Delsaber2,"Delsaber (Ep. II);","Delsaber","Delsaber",2,!0),Pe(Ee.ChaosSorcerer2,"Chaos Sorcerer (Ep. II);","Chaos Sorcerer","Gran Sorcerer",2,!0),Pe(Ee.GolDragon,"Gol Dragon","Gol Dragon","Gol Dragon",2,!0),Pe(Ee.SinowBerill,"Sinow Berill","Sinow Berill","Sinow Berill",2,!0),Pe(Ee.SinowSpigell,"Sinow Spigell","Sinow Spigell","Sinow Spigell",2,!0),Pe(Ee.Merillia,"Merillia","Merillia","Merillia",2,!0),Pe(Ee.Meriltas,"Meriltas","Meriltas","Meriltas",2,!0),Pe(Ee.Mericarol,"Mericarol","Mericarol","Mericarol",2,!0),Pe(Ee.Mericus,"Mericus","Mericus","Mericus",2,!0),Pe(Ee.Merikle,"Merikle","Merikle","Merikle",2,!0),Pe(Ee.UlGibbon,"Ul Gibbon","Ul Gibbon","Ul Gibbon",2,!0),Pe(Ee.ZolGibbon,"Zol Gibbon","Zol Gibbon","Zol Gibbon",2,!0),Pe(Ee.Gibbles,"Gibbles","Gibbles","Gibbles",2,!0),Pe(Ee.Gee,"Gee","Gee","Gee",2,!0),Pe(Ee.GiGue,"Gi Gue","Gi Gue","Gi Gue",2,!0),Pe(Ee.IllGill,"Ill Gill","Ill Gill","Ill Gill",2,!0),Pe(Ee.DelLily,"Del Lily","Del Lily","Del Lily",2,!0),Pe(Ee.Epsilon,"Epsilon","Epsilon","Epsilon",2,!0),Pe(Ee.GalGryphon,"Gal Gryphon","Gal Gryphon","Gal Gryphon",2,!0),Pe(Ee.Deldepth,"Deldepth","Deldepth","Deldepth",2,!0),Pe(Ee.Delbiter,"Delbiter","Delbiter","Delbiter",2,!0),Pe(Ee.Dolmolm,"Dolmolm","Dolmolm","Dolmolm",2,!0),Pe(Ee.Dolmdarl,"Dolmdarl","Dolmdarl","Dolmdarl",2,!0),Pe(Ee.Morfos,"Morfos","Morfos","Morfos",2,!0),Pe(Ee.Recobox,"Recobox","Recobox","Recobox",2,!0),Pe(Ee.Recon,"Recon","Recon","Recon",2,!0),Pe(Ee.SinowZoa,"Sinow Zoa","Sinow Zoa","Sinow Zoa",2,!0),Pe(Ee.SinowZele,"Sinow Zele","Sinow Zele","Sinow Zele",2,!0),Pe(Ee.OlgaFlow,"Olga Flow","Olga Flow","Olga Flow",2,!0),Pe(Ee.SandRappy,"Sand Rappy","Sand Rappy","Sand Rappy",4,!0,Ee.DelRappy),Pe(Ee.DelRappy,"Del Rappy","Del Rappy","Del Rappy",4,!0),Pe(Ee.Astark,"Astark","Astark","Astark",4,!0),Pe(Ee.SatelliteLizard,"Satellite Lizard","Satellite Lizard","Satellite Lizard",4,!0),Pe(Ee.Yowie,"Yowie","Yowie","Yowie",4,!0),Pe(Ee.MerissaA,"Merissa A","Merissa A","Merissa A",4,!0,Ee.MerissaAA),Pe(Ee.MerissaAA,"Merissa AA","Merissa AA","Merissa AA",4,!0),Pe(Ee.Girtablulu,"Girtablulu","Girtablulu","Girtablulu",4,!0),Pe(Ee.Zu,"Zu","Zu","Zu",4,!0,Ee.Pazuzu),Pe(Ee.Pazuzu,"Pazuzu","Pazuzu","Pazuzu",4,!0),Pe(Ee.Boota,"Boota","Boota","Boota",4,!0),Pe(Ee.ZeBoota,"Ze Boota","Ze Boota","Ze Boota",4,!0),Pe(Ee.BaBoota,"Ba Boota","Ba Boota","Ba Boota",4,!0),Pe(Ee.Dorphon,"Dorphon","Dorphon","Dorphon",4,!0,Ee.DorphonEclair),Pe(Ee.DorphonEclair,"Dorphon Eclair","Dorphon Eclair","Dorphon Eclair",4,!0),Pe(Ee.Goran,"Goran","Goran","Goran",4,!0),Pe(Ee.PyroGoran,"Pyro Goran","Pyro Goran","Pyro Goran",4,!0),Pe(Ee.GoranDetonator,"Goran Detonator","Goran Detonator","Goran Detonator",4,!0),Pe(Ee.SaintMilion,"Saint-Milion","Saint-Milion","Saint-Milion",4,!0,Ee.Kondrieu),Pe(Ee.Shambertin,"Shambertin","Shambertin","Shambertin",4,!0,Ee.Kondrieu),Pe(Ee.Kondrieu,"Kondrieu","Kondrieu","Kondrieu",4,!0);var Fe=function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s};class We{constructor(e,t,n,i){if(!e)throw new Error("id is required.");if(i<=0)throw new Error("default_time must be greater than zero.");if(!t)throw new Error("name is required.");if(!n)throw new Error("quest is required.");this.id=e,this.name=t,this.episode=n.episode,this.quest=n,this.enemy_counts=n.enemy_counts,this.default_time=i}get time(){return null!=this.user_time?this.user_time:this.default_time}}Fe([T.n],We.prototype,"user_time",void 0),Fe([T.f],We.prototype,"time",null);class Le{constructor(e,t,n,i){if(this.id=e,this.name=t,this.episode=n,this.enemy_counts=i,!e)throw new Error("id is required.");if(!t)throw new Error("name is required.");if(!i)throw new Error("enemyCounts is required.")}}class Ue{constructor(e,t,n,i,o,r){this.difficulty=e,this.section_id=t,this.npc_type=n,this.item_type=i,this.anything_rate=o,this.rare_rate=r,this.rate=o*r}}var Me=function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},Ie=function(e,t,n,i){return new(n||(n=Promise))(function(o,r){function s(e){try{d(i.next(e))}catch(e){r(e)}}function a(e){try{d(i.throw(e))}catch(e){r(e)}}function d(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(s,a)}d((i=i.apply(e,t||[])).next())})};const Be=d.a.get("stores/HuntMethodStore");class Ae{constructor(){this.methods=new G(e=>new B([],()=>this.load_hunt_methods(e))),this.load_user_times=(e,t)=>Ie(this,void 0,void 0,function*(){yield ke.load_method_user_times(e,t),this.storage_disposer&&this.storage_disposer(),this.storage_disposer=Object(T.e)(()=>this.persist_user_times(e,t))}),this.persist_user_times=(e,t)=>{ke.persist_method_user_times(e,t)}}load_hunt_methods(e){return Ie(this,void 0,void 0,function*(){const t=yield fetch(`/assets/quests.${m[e].toLowerCase()}.json`),n=yield t.json(),i=new Array;for(const e of n){let t=0;const n=new Map;for(const[i,o]of Object.entries(e.enemyCounts)){const e=Ee[i];e?(n.set(e,o),t+=o):Be.error(`No NpcType found for code ${i}.`)}switch(e.id){case 31:case 34:case 1305:case 1306:case 1307:case 313:case 314:continue}i.push(new We(`q${e.id}`,e.name,new Le(e.id,e.name,e.episode,n),/^\d-\d.*/.test(e.name)?.75:t>400?.75:.5))}return yield this.load_user_times(i,e),i})}}Me([T.n],Ae.prototype,"methods",void 0);const xe=new Ae;var je=n("wH/B"),Ge=n.n(je);class Ke extends i.Component{constructor(){super(...arguments),this.sort_columns=new Array,this.column_width=({index:e})=>this.props.columns[e].width,this.cell_renderer=({columnIndex:e,rowIndex:t,style:n})=>{const i=this.props.columns[e];let r,s,a;const d=[Ge.a.cell];if(e===this.props.columns.length-1&&d.push(Ge.a.last_in_row),0===t){if(r=a=i.name,i.sortable){d.push(Ge.a.sortable);const e=this.sort_columns[0];e&&e.column===i&&(s=e.direction===we.d.ASC?o.a.createElement("svg",{className:Ge.a.sort_indictator,width:"18",height:"18",viewBox:"0 0 24 24"},o.a.createElement("path",{d:"M7 14l5-5 5 5z"}),o.a.createElement("path",{d:"M0 0h24v24H0z",fill:"none"})):o.a.createElement("svg",{className:Ge.a.sort_indictator,width:"18",height:"18",viewBox:"0 0 24 24"},o.a.createElement("path",{d:"M7 10l5 5 5-5z"}),o.a.createElement("path",{d:"M0 0h24v24H0z",fill:"none"})))}}else if(i.class_name&&d.push(i.class_name),this.props.footer&&t===1+this.props.row_count)d.push(Ge.a.footer_cell),r=null==i.footer_value?"":i.footer_value,a=null==i.footer_tooltip?"":i.footer_tooltip;else{const e=this.props.record({index:t-1});r=i.cell_renderer(e),i.tooltip&&(a=i.tooltip(e))}"string"!=typeof r&&d.push(Ge.a.custom);const l=0===t&&i.sortable?()=>this.header_clicked(i):void 0;return o.a.createElement("div",{className:d.join(" "),key:`${e}, ${t}`,style:n,title:a,onClick:l},"string"==typeof r?o.a.createElement("span",{className:Ge.a.cell_text},r):r,s)},this.header_clicked=e=>{const t=this.sort_columns.findIndex(t=>t.column===e);let n=-1===t?void 0:this.sort_columns.splice(t,1)[0];const i=0===t&&n&&n.direction===we.d.ASC?we.d.DESC:we.d.ASC;this.sort_columns.unshift({column:e,direction:i}),this.sort_columns.splice(10),this.props.sort&&this.props.sort(this.sort_columns)}}render(){return o.a.createElement("div",{className:Ge.a.main,style:{width:this.props.width,height:this.props.height}},o.a.createElement(we.c,{width:this.props.width,height:this.props.height,rowHeight:26,rowCount:this.props.row_count+1+(this.props.footer?1:0),fixedRowCount:1,overscanRowCount:this.props.overscan_row_count,columnWidth:this.column_width,columnCount:this.props.columns.length,fixedColumnCount:this.props.fixed_column_count,overscanColumnCount:this.props.overscan_column_count,cellRenderer:this.cell_renderer,classNameTopLeftGrid:Ge.a.header,classNameTopRightGrid:Ge.a.header,updateTigger:this.props.update_trigger}))}}var ze,He=n("FUFj"),Ve=n.n(He),qe=function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s};let $e=ze=class extends i.Component{constructor(){super(...arguments),this.record=({index:e})=>xe.methods.current.value[e],this.sort=e=>{const t=xe.methods.current.value.slice();t.sort((t,n)=>{for(const{column:i,direction:o}of e){let e=0;if("name"===i.key)e=t.name.localeCompare(n.name);else if("episode"===i.key)e=t.episode-n.episode;else if("time"===i.key)e=t.time-n.time;else if(i.key){const o=Ee[i.key];o&&(e=(t.enemy_counts.get(o)||0)-(n.enemy_counts.get(o)||0))}if(0!==e)return o===we.d.ASC?e:-e}return 0}),xe.methods.current.value=t}}render(){const e=xe.methods.current.value;return o.a.createElement("section",{className:Ve.a.main},o.a.createElement(we.a,null,({width:t,height:n})=>o.a.createElement(Ke,{width:t,height:n,row_count:e.length,columns:ze.columns,fixed_column_count:3,record:this.record,sort:this.sort,update_trigger:xe.methods.current.value})))}};$e.columns=(()=>{const e=[{key:"name",name:"Method",width:250,cell_renderer:e=>e.name,sortable:!0},{key:"episode",name:"Ep.",width:34,cell_renderer:e=>Re[e.episode],sortable:!0},{key:"time",name:"Time",width:50,cell_renderer:e=>o.a.createElement(Je,{method:e}),class_name:"integrated",sortable:!0}];for(const t of Se)e.push({key:Ee[t],name:Oe(t).name,width:75,cell_renderer:e=>{const n=e.enemy_counts.get(t);return null==n?"":n.toString()},class_name:"number",sortable:!0});return e})(),$e=ze=qe([p.a],$e);let Je=class extends o.a.Component{constructor(){super(...arguments),this.change=e=>{this.props.method.user_time=e.hour()+e.minute()/60}}render(){const e=this.props.method.time,t=Math.floor(e),n=Math.round(60*(e-t));return o.a.createElement(_e.a,{className:Ve.a.timepicker,value:ve()({hour:t,minute:n}),format:"HH:mm",size:"small",allowClear:!1,suffixIcon:o.a.createElement("span",null),onChange:this.change})}};Je=qe([p.a],Je);var Ye=n("lLyO"),Ze=n.n(Ye),Xe=function(e,t,n,i){return new(n||(n=Promise))(function(o,r){function s(e){try{d(i.next(e))}catch(e){r(e)}}function a(e){try{d(i.throw(e))}catch(e){r(e)}}function d(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(s,a)}d((i=i.apply(e,t||[])).next())})};const Qe="HuntOptimizerStore.wantedItems";const et=new class extends me{persist_wanted_items(e,t){this.persist_for_server(e,Qe,t.map(({item_type:e,amount:t})=>({itemTypeId:e.id,amount:t})))}load_wanted_items(e){return Xe(this,void 0,void 0,function*(){const t=yield H.get(e).promise,n=yield this.load_for_server(e,Qe),i=[];if(n)for(const{itemTypeId:e,itemKindId:o,amount:r}of n){const n=null!=e?t.get_by_id(e):t.get_by_id(o);n&&i.push(new lt(n,r))}return i})}};var tt=function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},nt=function(e,t,n,i){return new(n||(n=Promise))(function(o,r){function s(e){try{d(i.next(e))}catch(e){r(e)}}function a(e){try{d(i.throw(e))}catch(e){r(e)}}function d(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(s,a)}d((i=i.apply(e,t||[])).next())})};const it=d.a.get("stores/ItemDropStore");class ot{constructor(){this.table=[],this.item_type_to_drops=[];for(let e=0;e<R.length;e++){const e=[];this.table.push(e);for(let t=0;t<y.length;t++)e.push([])}}get_drop(e,t,n){return this.table[e][t][n]}set_drop(e,t,n,i){this.table[e][t][n]=i;let o=this.item_type_to_drops[i.item_type.id];o||(o=[],this.item_type_to_drops[i.item_type.id]=o),o.push(i)}get_drops_for_item_type(e){return this.item_type_to_drops[e]||[]}}class rt{constructor(){this.enemy_drops=new ot}}tt([T.n.ref],rt.prototype,"enemy_drops",void 0);const st=new G(e=>{const t=new rt;return new B(t,()=>(function(e,t){return nt(this,void 0,void 0,function*(){const n=yield H.current.promise,i=yield fetch(`/assets/enemyDrops.${m[t].toLowerCase()}.json`),o=yield i.json(),r=new ot;for(const e of o){const t=Ee[e.enemy];if(!t){it.warn(`Couldn't determine NpcType of episode ${e.episode} ${e.enemy}.`);continue}const i=k[e.difficulty],o=n.get_by_id(e.itemTypeId);if(!o){it.warn(`Couldn't find item kind ${e.itemTypeId}.`);continue}const s=g[e.sectionId];null!=s?r.set_drop(i,s,t,new Ue(i,s,t,o,e.dropRate,e.rareRate)):it.warn(`Couldn't find section ID ${e.sectionId}.`)}return e.enemy_drops=r,e})})(t,e))});var at=function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},dt=function(e,t,n,i){return new(n||(n=Promise))(function(o,r){function s(e){try{d(i.next(e))}catch(e){r(e)}}function a(e){try{d(i.throw(e))}catch(e){r(e)}}function d(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(s,a)}d((i=i.apply(e,t||[])).next())})};class lt{constructor(e,t){this.item_type=e,this.amount=t}}at([T.n],lt.prototype,"item_type",void 0),at([T.n],lt.prototype,"amount",void 0);class ut{constructor(e,t){this.wanted_items=e,this.optimal_methods=t}}class ct{constructor(e,t,n,i,o,r,s){this.difficulty=e,this.section_ids=t,this.method_name=n,this.method_episode=i,this.method_time=o,this.runs=r,this.total_time=r*o,this.item_counts=s}}class _t{constructor(){this.wanted_items=T.n.array(),this.optimize=()=>dt(this,void 0,void 0,function*(){if(!this.wanted_items.length)return void(this.result=void 0);const e=new Set(this.wanted_items.filter(e=>e.amount>0).map(e=>e.item_type)),t=yield xe.methods.current.promise,n=(yield st.current.promise).enemy_drops,i={};for(const e of this.wanted_items)i[e.item_type.name]={min:e.amount};const o={},r=new Map;for(const i of t){const t=new Map;for(const[e,n]of i.enemy_counts.entries()){const i=t.get(e)||0,o=Oe(e);if(null==o.rare_type)t.set(e,i+n);else{let r,s;o.rare_type===Ee.Kondrieu?(r=1-f,s=f):(r=1-h,s=h),t.set(e,i+n*r),t.set(o.rare_type,(t.get(o.rare_type)||0)+n*s)}}const s=[t],a=t.get(Ee.PanArms);if(a){const e=new Map(t);e.delete(Ee.PanArms),e.set(Ee.Migium,a),e.set(Ee.Hidoom,a),s.push(e)}const d=t.get(Ee.PanArms2);if(d){const e=new Map(t);e.delete(Ee.PanArms2),e.set(Ee.Migium2,d),e.set(Ee.Hidoom2,d),s.push(e)}for(let t=0;t<s.length;t++){const a=s[t],d=1===t;for(const t of R)for(const s of y){const l={time:i.time};let u=!1;for(const[i,o]of a.entries()){const r=n.get_drop(t,s,i);if(r&&e.has(r.item_type)){const e=l[r.item_type.name]||0;l[r.item_type.name]=e+o*r.rate,u=!0}}if(u){const e=this.full_method_name(t,s,i,d);o[e]=l,r.set(e,{method:i,difficulty:t,section_id:s,split_pan_arms:d})}}}}const s=Ze.a.Solve({optimize:"time",opType:"min",constraints:i,variables:o});if(!s.feasible)return void(this.result=void 0);const a=[];for(const[t,n]of Object.entries(s)){const i=r.get(t);if(i){const{method:r,difficulty:s,section_id:d,split_pan_arms:l}=i,u=n,c=o[t],_=new Map;for(const[t,n]of Object.entries(c))for(const i of e)if(t===i.name){_.set(i,u*n);break}const p=[];for(const e of y){let t=!0;if(e!==d){const n=o[this.full_method_name(s,e,r,l)];if(n){for(const e of Object.keys(c))if(c[e]!==n[e]){t=!1;break}}else t=!1}t&&p.push(e)}a.push(new ct(s,p,r.name+(l?" (Split Pan Arms)":""),r.episode,r.time,u,_))}}this.result=new ut([...e],a)}),this.initialize_persistence=()=>dt(this,void 0,void 0,function*(){this.wanted_items.replace(yield et.load_wanted_items(j.current_server)),Object(T.e)(()=>{et.persist_wanted_items(j.current_server,this.wanted_items)})}),this.initialize_persistence()}get huntable_item_types(){const e=st.current.value;return H.current.value.item_types.filter(t=>e.enemy_drops.get_drops_for_item_type(t.id).length)}full_method_name(e,t,n,i){let o=`${e}\t${t}\t${n.id}`;return i&&(o+="\tspa"),o}}at([T.f],_t.prototype,"huntable_item_types",null),at([T.n],_t.prototype,"wanted_items",void 0),at([T.n],_t.prototype,"result",void 0);const pt=new _t;function vt({section_id:e,size:t=28,title:n}){return o.a.createElement("div",{title:n,style:{display:"inline-block",width:t,height:t,backgroundImage:`url(/assets/images/sectionids/${g[e]}.png)`,backgroundSize:t}})}var wt=n("oQNU"),ht=n.n(wt),ft=function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s};let mt=class extends i.Component{constructor(){super(...arguments),this.record=({index:e})=>pt.result.optimal_methods[e]}get columns(){const e=pt.result,t=e?e.optimal_methods:[];let n=0,i=0;for(const e of t)n+=e.runs,i+=e.total_time;const r=[{name:"Difficulty",width:75,cell_renderer:e=>k[e.difficulty],footer_value:"Totals:"},{name:"Method",width:200,cell_renderer:e=>e.method_name,tooltip:e=>e.method_name},{name:"Ep.",width:34,cell_renderer:e=>Re[e.method_episode]},{name:"Section ID",width:80,cell_renderer:e=>o.a.createElement("div",{className:ht.a.sid_col},e.section_ids.map(e=>o.a.createElement(vt,{section_id:e,key:e,size:20}))),tooltip:e=>e.section_ids.map(e=>g[e]).join(", ")},{name:"Time/Run",width:80,cell_renderer:e=>(function(e){const t=Math.floor(e),n=Math.round(60*(e-t));return`${t.toString().padStart(2,"0")}:${n.toString().padStart(2,"0")}`})(e.method_time),class_name:"number"},{name:"Runs",width:60,cell_renderer:e=>e.runs.toFixed(1),tooltip:e=>e.runs.toString(),footer_value:n.toFixed(1),footer_tooltip:n.toString(),class_name:"number"},{name:"Total Hours",width:90,cell_renderer:e=>e.total_time.toFixed(1),tooltip:e=>e.total_time.toString(),footer_value:i.toFixed(1),footer_tooltip:i.toString(),class_name:"number"}];if(e)for(const n of e.wanted_items){let e=0;for(const i of t)e+=i.item_counts.get(n)||0;r.push({name:n.name,width:80,cell_renderer:e=>{const t=e.item_counts.get(n);return t?t.toFixed(2):""},tooltip:e=>{const t=e.item_counts.get(n);return t?t.toString():""},class_name:"number",footer_value:e.toFixed(2),footer_tooltip:e.toString()})}return r}get update_trigger(){return pt.result}render(){this.update_trigger;const e=pt.result;return o.a.createElement("section",{className:ht.a.main},o.a.createElement("h3",null,"Optimization Result"),o.a.createElement("div",{className:ht.a.table},o.a.createElement(we.a,null,({width:t,height:n})=>o.a.createElement(Ke,{width:t,height:n,row_count:e?e.optimal_methods.length:0,columns:this.columns,fixed_column_count:4,record:this.record,footer:null!=e,update_trigger:this.update_trigger}))))}};ft([T.f],mt.prototype,"columns",null),ft([T.f],mt.prototype,"update_trigger",null),mt=ft([p.a],mt);var gt=n("5hFC"),yt=n.n(gt),kt=n("2/Rp"),Rt=n("diRs"),bt=n("1Hwk"),Nt=n.n(bt),Et=function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s};let Tt=class extends i.Component{constructor(){super(...arguments),this.state={help_visible:!1},this.add_wanted=e=>{if(e){if(!pt.wanted_items.find(t=>t.item_type.id===e.value)){const t=H.current.value.get_by_id(e.value);pt.wanted_items.push(new lt(t,1))}}},this.remove_wanted=e=>()=>{const t=pt.wanted_items.findIndex(t=>t===e);-1!==t&&pt.wanted_items.splice(t,1)},this.table_remove_cell_renderer=({rowData:e})=>o.a.createElement(kt.a,{type:"link",icon:"delete",onClick:this.remove_wanted(e)}),this.no_rows_renderer=()=>o.a.createElement("div",{className:Nt.a.no_rows},o.a.createElement("p",null,'Add some items with the above drop down and click "Optimize" to see the result on the right.')),this.on_help_visible_change=e=>{this.setState({helpVisible:e})}}render(){return pt.wanted_items.slice(0,0),o.a.createElement("section",{className:Nt.a.main},o.a.createElement("h3",null,"Wanted Items",o.a.createElement(Rt.a,{content:o.a.createElement(St,null),trigger:"click",visible:this.state.help_visible,onVisibleChange:this.on_help_visible_change},o.a.createElement(kt.a,{icon:"info-circle",type:"link"}))),o.a.createElement("div",{className:Nt.a.top_bar},o.a.createElement(ne,{placeholder:"Add an item",value:void 0,style:{width:200},options:pt.huntable_item_types.map(e=>({label:e.name,value:e.id})),onChange:this.add_wanted}),o.a.createElement(kt.a,{onClick:pt.optimize,style:{marginLeft:10}},"Optimize")),o.a.createElement("div",{className:Nt.a.table},o.a.createElement(we.a,null,({width:e,height:t})=>o.a.createElement(we.e,{width:e,height:t,headerHeight:30,rowHeight:30,rowCount:pt.wanted_items.length,rowGetter:({index:e})=>pt.wanted_items[e],noRowsRenderer:this.no_rows_renderer},o.a.createElement(we.b,{label:"Amount",dataKey:"amount",width:70,cellRenderer:({rowData:e})=>o.a.createElement(Ot,{wantedItem:e})}),o.a.createElement(we.b,{label:"Item",dataKey:"item",width:150,flexGrow:1,cellDataGetter:({rowData:e})=>e.item_type.name}),o.a.createElement(we.b,{dataKey:"remove",width:30,cellRenderer:this.table_remove_cell_renderer})))))}};function St(){return o.a.createElement("div",{className:Nt.a.help},o.a.createElement("p",null,'Add some items with the drop down and click "Optimize" to see the optimal combination of hunt methods on the right.'),o.a.createElement("p",null,'At the moment a method is simply a quest run-through. Partial quest run-throughs are coming. View the list of methods on the "Methods" tab. Each method takes a certain amount of time, which affects the optimization result. Make sure the times are correct for you.'),o.a.createElement("p",null,"Only enemy drops are considered. Box drops are coming."),o.a.createElement("p",null,"The optimal result is calculated using linear optimization. The optimizer takes rare enemies and the fact that pan arms can be split in two into account."))}Tt=Et([p.a],Tt);let Ot=class extends i.Component{constructor(){super(...arguments),this.wanted_amount_changed=e=>{null!=e&&e>=0&&(this.props.wantedItem.amount=e)}}render(){const e=this.props.wantedItem;return o.a.createElement(E.a,{min:0,max:10,value:e.amount,onChange:this.wanted_amount_changed,size:"small",style:{width:"100%"}})}};function Ct(){return o.a.createElement("section",{className:yt.a.main},o.a.createElement(Tt,null),o.a.createElement(mt,null))}Ot=Et([p.a],Ot);const Dt=le.a.TabPane;var Pt=n("xGNL"),Ft=n.n(Pt),Wt=function(e,t,n,i){return new(n||(n=Promise))(function(o,r){function s(e){try{d(i.next(e))}catch(e){r(e)}}function a(e){try{d(i.throw(e))}catch(e){r(e)}}function d(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(s,a)}d((i=i.apply(e,t||[])).next())})};const Lt="QuestEditorUiPersister.layout_config";const Ut=new class extends me{constructor(){super(...arguments),this.persist_layout_config=Object(U.throttle)(e=>{this.persist(Lt,e)},500,{leading:!1,trailing:!0})}load_layout_config(e,t){return Wt(this,void 0,void 0,function*(){const n=yield this.load(Lt);return n&&this.verify_layout_config(n,e)?n:t})}verify_layout_config(e,t){const n=new Set(t);for(const t of e)if(!this.verify_layout_child(t,n,new Set,!0))return!1;return!0}verify_layout_child(e,t,n,i){if(!e)return!1;if("component"in e){if(!t.has(e.component))return!1;n.add(e.component)}if(e.content)for(const i of e.content)if(!this.verify_layout_child(i,t,n,!1))return!1;return!i||t.size===n.size}};var Mt,It;!function(e){e[e.Little=0]="Little",e[e.Big=1]="Big"}(Mt||(Mt={}));class Bt{constructor(e,t){this.x=e,this.y=t}set(e,t){return this.x=e,this.y=t,this}add(e){return this.x+=e.x,this.y+=e.y,this}clone(){return new Bt(this.x,this.y)}equals(e){return this.x===e.x&&this.y===e.y}}class At{constructor(e,t,n){this.x=e,this.y=t,this.z=n}set(e,t,n){return this.x=e,this.y=t,this.z=n,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}clone(){return new At(this.x,this.y,this.z)}equals(e){return this.x===e.x&&this.y===e.y&&this.z===e.z}}class xt{constructor(e,t){this._position=0,this.endianness=e,this.offset=t}get position(){return this._position}get endianness(){return this.little_endian?Mt.Little:Mt.Big}set endianness(e){this.little_endian=e===Mt.Little}get bytes_left(){return this.size-this.position}seek(e){return this.seek_start(this.position+e)}seek_start(e){if(e<0||e>this.size)throw new Error(`Offset ${e} is out of bounds.`);return this._position=e,this}seek_end(e){if(e<0||e>this.size)throw new Error(`Offset ${e} is out of bounds.`);return this._position=this.size-e,this}u8(){return this.u8_at(this._position++)}u8_at(e){return this.check_offset(e,1),this.dv.getUint8(this.offset+e)}u16(){const e=this.u16_at(this.position);return this._position+=2,e}u16_at(e){return this.check_offset(e,2),this.dv.getUint16(this.offset+e,this.little_endian)}u32(){const e=this.u32_at(this.position);return this._position+=4,e}u32_at(e){return this.check_offset(e,4),this.dv.getUint32(this.offset+e,this.little_endian)}i8(){return this.i8_at(this._position++)}i8_at(e){return this.check_offset(e,1),this.dv.getInt8(this.offset+e)}i16(){const e=this.i16_at(this.position);return this._position+=2,e}i16_at(e){return this.check_offset(e,2),this.dv.getInt16(this.offset+e,this.little_endian)}i32(){const e=this.i32_at(this.position);return this._position+=4,e}i32_at(e){return this.check_offset(e,4),this.dv.getInt32(this.offset+e,this.little_endian)}f32(){const e=this.f32_at(this.position);return this._position+=4,e}f32_at(e){return this.check_offset(e,4),this.dv.getFloat32(this.offset+e,this.little_endian)}u8_array(e){this.check_size("n",e,e);const t=[];for(let n=0;n<e;++n)t.push(this.dv.getUint8(this.offset+this._position++));return t}u16_array(e){this.check_size("n",e,2*e);const t=[];for(let n=0;n<e;++n)t.push(this.dv.getUint16(this.offset+this.position,this.little_endian)),this._position+=2;return t}u32_array(e){this.check_size("n",e,4*e);const t=[];for(let n=0;n<e;++n)t.push(this.dv.getUint32(this.offset+this.position,this.little_endian)),this._position+=4;return t}i32_array(e){this.check_size("n",e,4*e);const t=[];for(let n=0;n<e;++n)t.push(this.dv.getInt32(this.offset+this.position,this.little_endian)),this._position+=4;return t}vec2_f32(){return new Bt(this.f32(),this.f32())}vec3_f32(){return new At(this.f32(),this.f32(),this.f32())}string_ascii(e,t,n){let i=[];for(let o=0;o<e;o++){const r=this.u8();if(t&&0===r){n&&this.seek(e-o-1);break}i.push(r)}return String.fromCodePoint(...i)}string_utf16(e,t,n){let i=[],o=Math.floor(e/2);for(let e=0;e<o;e++){const r=this.u16();if(t&&0===r){n&&this.seek(2*(o-e-1));break}i.push(r)}return String.fromCodePoint(...i)}array_buffer(e=this.size-this.position){this.check_size("size",e,e);const t=this.backing_buffer.slice(this.offset+this.position,this.offset+this.position+e);return this._position+=e,t}copy_to_uint8_array(e,t=this.size-this.position){return this.check_size("size",t,t),e.set(new Uint8Array(this.backing_buffer,this.offset+this.position,t)),this._position+=t,this}check_size(e,t,n){if(n<0||n>this.size-this.position)throw new Error(`${e} ${t} is out of bounds.`)}check_offset(e,t){if(e<0||e+t>this.size)throw new Error(`Offset ${e} is out of bounds.`)}}class jt extends xt{write_u8(e){return this.ensure_size(1),this.dv.setUint8(this._position++,e),this}write_u16(e){return this.ensure_size(2),this.dv.setUint16(this.position,e,this.little_endian),this._position+=2,this}write_u32(e){return this.ensure_size(4),this.dv.setUint32(this.position,e,this.little_endian),this._position+=4,this}write_i8(e){return this.ensure_size(1),this.dv.setInt8(this.position,e),this._position+=1,this}write_i16(e){return this.ensure_size(2),this.dv.setInt16(this.position,e,this.little_endian),this._position+=2,this}write_i32(e){return this.ensure_size(4),this.dv.setInt32(this.position,e,this.little_endian),this._position+=4,this}write_f32(e){return this.ensure_size(4),this.dv.setFloat32(this.position,e,this.little_endian),this._position+=4,this}write_u8_array(e){return this.ensure_size(e.length),new Uint8Array(this.backing_buffer,this.offset+this.position).set(new Uint8Array(e)),this._position+=e.length,this}write_u16_array(e){this.ensure_size(2*e.length);const t=e.length;for(let n=0;n<t;n++)this.write_u16(e[n]);return this}write_u32_array(e){this.ensure_size(4*e.length);const t=e.length;for(let n=0;n<t;n++)this.write_u32(e[n]);return this}write_vec2_f32(e){return this.ensure_size(8),this.dv.setFloat32(this.position,e.x,this.little_endian),this.dv.setFloat32(this.position+4,e.y,this.little_endian),this._position+=8,this}write_vec3_f32(e){return this.ensure_size(12),this.dv.setFloat32(this.position,e.x,this.little_endian),this.dv.setFloat32(this.position+4,e.y,this.little_endian),this.dv.setFloat32(this.position+8,e.z,this.little_endian),this._position+=12,this}write_cursor(e){const t=e.size-e.position;return this.ensure_size(t),e.copy_to_uint8_array(new Uint8Array(this.backing_buffer,this.offset+this.position,t),t),this._position+=t,this}write_string_ascii(e,t){this.ensure_size(t);const n=Math.min(t,e.length);for(let t=0;t<n;t++)this.write_u8(e.codePointAt(t));let i=t-n;for(let e=0;e<i;e++)this.write_u8(0);return this}write_string_utf16(e,t){this.ensure_size(t);const n=Math.floor(t/2),i=Math.min(n,e.length);for(let t=0;t<i;t++)this.write_u16(e.codePointAt(t));let o=n-i;for(let e=0;e<o;e++)this.write_u16(0);return this}ensure_size(e){if(e>this.bytes_left)throw new Error(`${e} Bytes required but only ${this.bytes_left} available.`)}}class Gt extends jt{get size(){return this._size}set size(e){if(e>this.backing_buffer.byteLength-this.offset)throw new Error(`Size ${e} is out of bounds.`);this._size=e}constructor(e,t,n=0,i=e.byteLength-n){super(t,n),this._size=i,this.backing_buffer=e,this.dv=new DataView(e,0,e.byteLength)}take(e){const t=this.offset+this.position,n=new Gt(this.backing_buffer,this.endianness,t,e);return this._position+=e,n}}!function(e){e[e.Any=0]="Any",e[e.Byte=1]="Byte",e[e.Word=2]="Word",e[e.DWord=3]="DWord",e[e.Float=4]="Float",e[e.Label=5]="Label",e[e.ILabel=6]="ILabel",e[e.DLabel=7]="DLabel",e[e.SLabel=8]="SLabel",e[e.String=9]="String",e[e.ILabelVar=10]="ILabelVar",e[e.RegRef=11]="RegRef",e[e.RegTupRef=12]="RegTupRef",e[e.RegRefVar=13]="RegRefVar",e[e.Pointer=14]="Pointer"}(It||(It={}));const Kt={kind:It.Any},zt={kind:It.Byte},Ht={kind:It.Word},Vt={kind:It.DWord},qt={kind:It.Float},$t={kind:It.Label},Jt={kind:It.ILabel},Yt={kind:It.DLabel},Zt={kind:It.SLabel},Xt={kind:It.String},Qt={kind:It.ILabelVar},en={kind:It.RegRef},tn={kind:It.RegRefVar},nn={kind:It.Pointer},on=-Math.pow(2,31),rn=Math.pow(2,31)-1;Math.pow(2,32);var sn,an;!function(e){e[e.Read=0]="Read",e[e.Write=1]="Write",e[e.ReadWrite=2]="ReadWrite"}(sn||(sn={}));class dn{constructor(e,t,n){this.type=e,this.doc=t,this.access=n}}!function(e){e[e.Push=0]="Push",e[e.Pop=1]="Pop"}(an||(an={}));const ln=[],un=new Map;class cn{constructor(e,t,n,i,o){this.code=e,this.mnemonic=t,this.doc=n,this.size=this.code<256?1:2,this.params=i,this.stack=o}}cn.NOP=ln[0]=new cn(0,"nop","No operation, does nothing.",[],void 0),cn.RET=ln[1]=new cn(1,"ret","Returns control to caller.",[],void 0),cn.SYNC=ln[2]=new cn(2,"sync","Yields control for the rest of the current frame. Execution will continue the following frame.",[],void 0),cn.EXIT=ln[3]=new cn(3,"exit",void 0,[new dn(Vt,void 0,void 0)],an.Pop),cn.THREAD=ln[4]=new cn(4,"thread","Starts a new thread. Thread execution will start at the given label.\nOften used to check a register every frame. Make sure to yield control with sync when looping.",[new dn(Jt,void 0,void 0)],void 0),cn.VA_START=ln[5]=new cn(5,"va_start","Initializes a variable argument list.\nMake sure to call va_end after va_start and va_call.",[],void 0),cn.VA_END=ln[6]=new cn(6,"va_end","Restores the registers overwritten by arg_push* instructions.\nCalled after va_call.",[],void 0),cn.VA_CALL=ln[7]=new cn(7,"va_call","Calls the variable argument function at the given label.\nCalled after initializing the argument list with va_start and pushing arguments onto the stack with arg_push* instructions. Make sure to call va_end afterwards.",[new dn(Jt,void 0,void 0)],void 0),cn.LET=ln[8]=new cn(8,"let","Sets the first register's value to second one's value.",[new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,void 0,sn.Write)]},void 0,void 0),new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,void 0,sn.Read)]},void 0,void 0)],void 0),cn.LETI=ln[9]=new cn(9,"leti","Sets a register to the given value.",[new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,void 0,sn.Write)]},void 0,void 0),new dn(Vt,void 0,void 0)],void 0),cn.LETB=ln[10]=new cn(10,"letb","Sets a register to the given value.",[new dn({kind:It.RegTupRef,register_tuples:[new dn(zt,void 0,sn.Write)]},void 0,void 0),new dn(zt,void 0,void 0)],void 0),cn.LETW=ln[11]=new cn(11,"letw","Sets a register to the given value.",[new dn({kind:It.RegTupRef,register_tuples:[new dn(Ht,void 0,sn.Write)]},void 0,void 0),new dn(Ht,void 0,void 0)],void 0),cn.LETA=ln[12]=new cn(12,"leta","Sets the first register to the memory address of the second register. Not used by Sega.",[new dn({kind:It.RegTupRef,register_tuples:[new dn(nn,void 0,sn.Write)]},void 0,void 0),new dn({kind:It.RegTupRef,register_tuples:[new dn(Kt,void 0,sn.Read)]},void 0,void 0)],void 0),cn.LETO=ln[13]=new cn(13,"leto","Sets a register to the memory address of the given label. Not used by Sega.",[new dn({kind:It.RegTupRef,register_tuples:[new dn(nn,void 0,sn.Write)]},void 0,void 0),new dn($t,void 0,void 0)],void 0),cn.UNKNOWN_0E=ln[14]=new cn(14,"unknown_0e",void 0,[],void 0),cn.UNKNOWN_0F=ln[15]=new cn(15,"unknown_0f",void 0,[],void 0),cn.SET=ln[16]=new cn(16,"set","Sets a register to 1.",[new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,void 0,sn.Write)]},void 0,void 0)],void 0),cn.CLEAR=ln[17]=new cn(17,"clear","Sets a register to 0.",[new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,void 0,sn.Write)]},void 0,void 0)],void 0),cn.REV=ln[18]=new cn(18,"rev","Sets a register to 1 if its current value is 0, otherwise sets it to 0.",[new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,void 0,sn.ReadWrite)]},void 0,void 0)],void 0),cn.GSET=ln[19]=new cn(19,"gset",void 0,[new dn(Ht,void 0,void 0)],void 0),cn.GCLEAR=ln[20]=new cn(20,"gclear",void 0,[new dn(Ht,void 0,void 0)],void 0),cn.GREV=ln[21]=new cn(21,"grev",void 0,[new dn(Ht,void 0,void 0)],void 0),cn.GLET=ln[22]=new cn(22,"glet",void 0,[new dn(Ht,void 0,void 0)],void 0),cn.GGET=ln[23]=new cn(23,"gget","Sets a register to value of the given flag.",[new dn(Ht,void 0,void 0),new dn({kind:It.RegTupRef,register_tuples:[new dn(Ht,void 0,sn.Write)]},void 0,void 0)],void 0),cn.ADD=ln[24]=new cn(24,"add",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,void 0,sn.Write)]},void 0,void 0),new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,void 0,sn.Read)]},void 0,void 0)],void 0),cn.ADDI=ln[25]=new cn(25,"addi",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,void 0,sn.Write)]},void 0,void 0),new dn(Vt,void 0,void 0)],void 0),cn.SUB=ln[26]=new cn(26,"sub",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,void 0,sn.Write)]},void 0,void 0),new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,void 0,sn.Read)]},void 0,void 0)],void 0),cn.SUBI=ln[27]=new cn(27,"subi",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,void 0,sn.Write)]},void 0,void 0),new dn(Vt,void 0,void 0)],void 0),cn.MUL=ln[28]=new cn(28,"mul",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,void 0,sn.Write)]},void 0,void 0),new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,void 0,sn.Read)]},void 0,void 0)],void 0),cn.MULI=ln[29]=new cn(29,"muli",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,void 0,sn.Write)]},void 0,void 0),new dn(Vt,void 0,void 0)],void 0),cn.DIV=ln[30]=new cn(30,"div",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,void 0,sn.Write)]},void 0,void 0),new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,void 0,sn.Read)]},void 0,void 0)],void 0),cn.DIVI=ln[31]=new cn(31,"divi",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,void 0,sn.Write)]},void 0,void 0),new dn(Vt,void 0,void 0)],void 0),cn.AND=ln[32]=new cn(32,"and",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,void 0,sn.Write)]},void 0,void 0),new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,void 0,sn.Read)]},void 0,void 0)],void 0),cn.ANDI=ln[33]=new cn(33,"andi",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,void 0,sn.Write)]},void 0,void 0),new dn(Vt,void 0,void 0)],void 0),cn.OR=ln[34]=new cn(34,"or",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,void 0,sn.Write)]},void 0,void 0),new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,void 0,sn.Read)]},void 0,void 0)],void 0),cn.ORI=ln[35]=new cn(35,"ori",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,void 0,sn.Write)]},void 0,void 0),new dn(Vt,void 0,void 0)],void 0),cn.XOR=ln[36]=new cn(36,"xor",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,void 0,sn.Write)]},void 0,void 0),new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,void 0,sn.Read)]},void 0,void 0)],void 0),cn.XORI=ln[37]=new cn(37,"xori",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,void 0,sn.Write)]},void 0,void 0),new dn(Vt,void 0,void 0)],void 0),cn.MOD=ln[38]=new cn(38,"mod",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,void 0,sn.Write)]},void 0,void 0),new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,void 0,sn.Read)]},void 0,void 0)],void 0),cn.MODI=ln[39]=new cn(39,"modi",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,void 0,sn.Write)]},void 0,void 0),new dn(Vt,void 0,void 0)],void 0),cn.JMP=ln[40]=new cn(40,"jmp",void 0,[new dn(Jt,void 0,void 0)],void 0),cn.CALL=ln[41]=new cn(41,"call",void 0,[new dn(Jt,void 0,void 0)],void 0),cn.JMP_ON=ln[42]=new cn(42,"jmp_on",void 0,[new dn(Jt,void 0,void 0),new dn(tn,void 0,sn.Read)],void 0),cn.JMP_OFF=ln[43]=new cn(43,"jmp_off",void 0,[new dn(Jt,void 0,void 0),new dn(tn,void 0,sn.Read)],void 0),cn.JMP_E=ln[44]=new cn(44,"jmp_=",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Kt,void 0,sn.Read)]},void 0,void 0),new dn({kind:It.RegTupRef,register_tuples:[new dn(Kt,void 0,sn.Read)]},void 0,void 0),new dn(Jt,void 0,void 0)],void 0),cn.JMPI_E=ln[45]=new cn(45,"jmpi_=",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,void 0,sn.Read)]},void 0,void 0),new dn(Vt,void 0,void 0),new dn(Jt,void 0,void 0)],void 0),cn.JMP_NE=ln[46]=new cn(46,"jmp_!=",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Kt,void 0,sn.Read)]},void 0,void 0),new dn({kind:It.RegTupRef,register_tuples:[new dn(Kt,void 0,sn.Read)]},void 0,void 0),new dn(Jt,void 0,void 0)],void 0),cn.JMPI_NE=ln[47]=new cn(47,"jmpi_!=",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,void 0,sn.Read)]},void 0,void 0),new dn(Vt,void 0,void 0),new dn(Jt,void 0,void 0)],void 0),cn.UJMP_G=ln[48]=new cn(48,"ujmp_>",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,void 0,sn.Read)]},void 0,void 0),new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,void 0,sn.Read)]},void 0,void 0),new dn(Jt,void 0,void 0)],void 0),cn.UJMPI_G=ln[49]=new cn(49,"ujmpi_>",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,void 0,sn.Read)]},void 0,void 0),new dn(Vt,void 0,void 0),new dn(Jt,void 0,void 0)],void 0),cn.JMP_G=ln[50]=new cn(50,"jmp_>",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,void 0,sn.Read)]},void 0,void 0),new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,void 0,sn.Read)]},void 0,void 0),new dn(Jt,void 0,void 0)],void 0),cn.JMPI_G=ln[51]=new cn(51,"jmpi_>",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,void 0,sn.Read)]},void 0,void 0),new dn(Vt,void 0,void 0),new dn(Jt,void 0,void 0)],void 0),cn.UJMP_L=ln[52]=new cn(52,"ujmp_<",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,void 0,sn.Read)]},void 0,void 0),new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,void 0,sn.Read)]},void 0,void 0),new dn(Jt,void 0,void 0)],void 0),cn.UJMPI_L=ln[53]=new cn(53,"ujmpi_<",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,void 0,sn.Read)]},void 0,void 0),new dn(Vt,void 0,void 0),new dn(Jt,void 0,void 0)],void 0),cn.JMP_L=ln[54]=new cn(54,"jmp_<",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,void 0,sn.Read)]},void 0,void 0),new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,void 0,sn.Read)]},void 0,void 0),new dn(Jt,void 0,void 0)],void 0),cn.JMPI_L=ln[55]=new cn(55,"jmpi_<",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,void 0,sn.Read)]},void 0,void 0),new dn(Vt,void 0,void 0),new dn(Jt,void 0,void 0)],void 0),cn.UJMP_GE=ln[56]=new cn(56,"ujmp_>=",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,void 0,sn.Read)]},void 0,void 0),new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,void 0,sn.Read)]},void 0,void 0),new dn(Jt,void 0,void 0)],void 0),cn.UJMPI_GE=ln[57]=new cn(57,"ujmpi_>=",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,void 0,sn.Read)]},void 0,void 0),new dn(Vt,void 0,void 0),new dn(Jt,void 0,void 0)],void 0),cn.JMP_GE=ln[58]=new cn(58,"jmp_>=",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,void 0,sn.Read)]},void 0,void 0),new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,void 0,sn.Read)]},void 0,void 0),new dn(Jt,void 0,void 0)],void 0),cn.JMPI_GE=ln[59]=new cn(59,"jmpi_>=",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,void 0,sn.Read)]},void 0,void 0),new dn(Vt,void 0,void 0),new dn(Jt,void 0,void 0)],void 0),cn.UJMP_LE=ln[60]=new cn(60,"ujmp_<=",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,void 0,sn.Read)]},void 0,void 0),new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,void 0,sn.Read)]},void 0,void 0),new dn(Jt,void 0,void 0)],void 0),cn.UJMPI_LE=ln[61]=new cn(61,"ujmpi_<=",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,void 0,sn.Read)]},void 0,void 0),new dn(Vt,void 0,void 0),new dn(Jt,void 0,void 0)],void 0),cn.JMP_LE=ln[62]=new cn(62,"jmp_<=",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,void 0,sn.Read)]},void 0,void 0),new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,void 0,sn.Read)]},void 0,void 0),new dn(Jt,void 0,void 0)],void 0),cn.JMPI_LE=ln[63]=new cn(63,"jmpi_<=",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,void 0,sn.Read)]},void 0,void 0),new dn(Vt,void 0,void 0),new dn(Jt,void 0,void 0)],void 0),cn.SWITCH_JMP=ln[64]=new cn(64,"switch_jmp",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,void 0,sn.Read)]},void 0,void 0),new dn(Qt,void 0,void 0)],void 0),cn.SWITCH_CALL=ln[65]=new cn(65,"switch_call",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,void 0,sn.Read)]},void 0,void 0),new dn(Qt,void 0,void 0)],void 0),cn.STACK_PUSH=ln[66]=new cn(66,"stack_push",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Kt,void 0,sn.Read)]},void 0,void 0)],void 0),cn.STACK_POP=ln[67]=new cn(67,"stack_pop",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Kt,void 0,sn.Write)]},void 0,void 0)],void 0),cn.STACK_PUSHM=ln[68]=new cn(68,"stack_pushm","Pushes the values of an arbitrary amount of registers onto the stack.",[new dn(en,void 0,sn.Read),new dn(Vt,void 0,void 0)],void 0),cn.STACK_POPM=ln[69]=new cn(69,"stack_popm","Pops an arbitrary amount of values from the stack and writes them to registers.",[new dn(en,void 0,sn.Write),new dn(Vt,void 0,void 0)],void 0),cn.UNKNOWN_46=ln[70]=new cn(70,"unknown_46",void 0,[],void 0),cn.UNKNOWN_47=ln[71]=new cn(71,"unknown_47",void 0,[],void 0),cn.ARG_PUSHR=ln[72]=new cn(72,"arg_pushr","Pushes the value of the given register onto the stack.",[new dn({kind:It.RegTupRef,register_tuples:[new dn(Kt,void 0,sn.Read)]},void 0,void 0)],an.Push),cn.ARG_PUSHL=ln[73]=new cn(73,"arg_pushl","Pushes the given value onto the stack.",[new dn(Vt,void 0,void 0)],an.Push),cn.ARG_PUSHB=ln[74]=new cn(74,"arg_pushb","Pushes the given value onto the stack.",[new dn(zt,void 0,void 0)],an.Push),cn.ARG_PUSHW=ln[75]=new cn(75,"arg_pushw","Pushes the given value onto the stack.",[new dn(Ht,void 0,void 0)],an.Push),cn.ARG_PUSHA=ln[76]=new cn(76,"arg_pusha","Pushes the memory address of the given register onto the stack. Not used by Sega.",[new dn({kind:It.RegTupRef,register_tuples:[new dn(Kt,void 0,sn.Read)]},void 0,void 0)],an.Push),cn.ARG_PUSHO=ln[77]=new cn(77,"arg_pusho","Pushes the memory address of the given label onto the stack. Not used by Sega.",[new dn($t,void 0,void 0)],an.Push),cn.ARG_PUSHS=ln[78]=new cn(78,"arg_pushs","Pushes the given value onto the stack.",[new dn(Xt,void 0,void 0)],an.Push),cn.UNKNOWN_4F=ln[79]=new cn(79,"unknown_4f",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Kt,void 0,sn.Read)]},void 0,void 0),new dn({kind:It.RegTupRef,register_tuples:[new dn(Kt,void 0,sn.Read)]},void 0,void 0)],void 0),cn.MESSAGE=ln[80]=new cn(80,"message",void 0,[new dn(Vt,void 0,void 0),new dn(Xt,void 0,void 0)],an.Pop),cn.LIST=ln[81]=new cn(81,"list","Used to display a list of items and retrieve the item selected by the player.\nList items should be seperated by newlines. The selected item's index will be written to the given register.",[new dn({kind:It.RegTupRef,register_tuples:[new dn(zt,void 0,sn.Write)]},void 0,void 0),new dn(Xt,void 0,void 0)],an.Pop),cn.FADEIN=ln[82]=new cn(82,"fadein",void 0,[],void 0),cn.FADEOUT=ln[83]=new cn(83,"fadeout",void 0,[],void 0),cn.SE=ln[84]=new cn(84,"se",void 0,[new dn(Vt,void 0,void 0)],an.Pop),cn.BGM=ln[85]=new cn(85,"bgm",void 0,[new dn(Vt,void 0,void 0)],an.Pop),cn.UNKNOWN_56=ln[86]=new cn(86,"unknown_56",void 0,[],void 0),cn.UNKNOWN_57=ln[87]=new cn(87,"unknown_57",void 0,[],void 0),cn.ENABLE=ln[88]=new cn(88,"enable",void 0,[new dn(Vt,void 0,void 0)],an.Pop),cn.DISABLE=ln[89]=new cn(89,"disable",void 0,[new dn(Vt,void 0,void 0)],an.Pop),cn.WINDOW_MSG=ln[90]=new cn(90,"window_msg",void 0,[new dn(Xt,void 0,void 0)],an.Pop),cn.ADD_MSG=ln[91]=new cn(91,"add_msg",void 0,[new dn(Xt,void 0,void 0)],an.Pop),cn.MESEND=ln[92]=new cn(92,"mesend",void 0,[],void 0),cn.GETTIME=ln[93]=new cn(93,"gettime",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,void 0,sn.Write)]},void 0,void 0)],void 0),cn.WINEND=ln[94]=new cn(94,"winend",void 0,[],void 0),cn.UNKNOWN_5F=ln[95]=new cn(95,"unknown_5f",void 0,[],void 0),cn.NPC_CRT_V3=ln[96]=new cn(96,"npc_crt_v3",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Kt,void 0,sn.Read)]},void 0,void 0)],void 0),cn.NPC_STOP=ln[97]=new cn(97,"npc_stop",void 0,[new dn(Vt,void 0,void 0)],an.Pop),cn.NPC_PLAY=ln[98]=new cn(98,"npc_play",void 0,[new dn(Vt,void 0,void 0)],an.Pop),cn.NPC_KILL=ln[99]=new cn(99,"npc_kill",void 0,[new dn(Vt,void 0,void 0)],an.Pop),cn.NPC_NONT=ln[100]=new cn(100,"npc_nont",void 0,[],void 0),cn.NPC_TALK=ln[101]=new cn(101,"npc_talk",void 0,[],void 0),cn.NPC_CRP_V3=ln[102]=new cn(102,"npc_crp_v3",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Kt,void 0,sn.Read),new dn(Kt,void 0,sn.Read),new dn(Kt,void 0,sn.Read),new dn(Jt,void 0,sn.Read),new dn(Kt,void 0,sn.Read),new dn(Kt,void 0,sn.Read)]},void 0,void 0)],void 0),cn.UNKNOWN_67=ln[103]=new cn(103,"unknown_67",void 0,[],void 0),cn.CREATE_PIPE=ln[104]=new cn(104,"create_pipe",void 0,[new dn(Vt,void 0,void 0)],an.Pop),cn.P_HPSTAT_V3=ln[105]=new cn(105,"p_hpstat_v3",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Kt,void 0,sn.Read)]},void 0,void 0),new dn(Vt,void 0,void 0)],an.Pop),cn.P_DEAD_V3=ln[106]=new cn(106,"p_dead_v3",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,void 0,sn.Write)]},void 0,void 0),new dn(Vt,"Player slot.",void 0)],an.Pop),cn.P_DISABLEWARP=ln[107]=new cn(107,"p_disablewarp",void 0,[],void 0),cn.P_ENABLEWARP=ln[108]=new cn(108,"p_enablewarp",void 0,[],void 0),cn.P_MOVE_V3=ln[109]=new cn(109,"p_move_v3",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Kt,void 0,sn.Read)]},void 0,void 0)],void 0),cn.P_LOOK=ln[110]=new cn(110,"p_look",void 0,[new dn(Vt,void 0,void 0)],an.Pop),cn.UNKNOWN_6F=ln[111]=new cn(111,"unknown_6f",void 0,[],void 0),cn.P_ACTION_DISABLE=ln[112]=new cn(112,"p_action_disable",void 0,[],void 0),cn.P_ACTION_ENABLE=ln[113]=new cn(113,"p_action_enable",void 0,[],void 0),cn.DISABLE_MOVEMENT1=ln[114]=new cn(114,"disable_movement1",void 0,[new dn(Vt,void 0,void 0)],an.Pop),cn.ENABLE_MOVEMENT1=ln[115]=new cn(115,"enable_movement1",void 0,[new dn(Vt,void 0,void 0)],an.Pop),cn.P_NONCOL=ln[116]=new cn(116,"p_noncol",void 0,[],void 0),cn.P_COL=ln[117]=new cn(117,"p_col",void 0,[],void 0),cn.P_SETPOS=ln[118]=new cn(118,"p_setpos","Sets a player's position.",[new dn(Vt,"Player slot.",void 0),new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,"X coordinate.",sn.Read),new dn(Vt,"Y coordinate.",sn.Read),new dn(Vt,"Z coordinate.",sn.Read),new dn(Vt,"Y-axis rotation.",sn.Read)]},void 0,void 0)],an.Pop),cn.P_RETURN_GUILD=ln[119]=new cn(119,"p_return_guild",void 0,[],void 0),cn.P_TALK_GUILD=ln[120]=new cn(120,"p_talk_guild",void 0,[new dn(Vt,void 0,void 0)],an.Pop),cn.NPC_TALK_PL_V3=ln[121]=new cn(121,"npc_talk_pl_v3",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Kt,void 0,sn.Read)]},void 0,void 0)],void 0),cn.NPC_TALK_KILL=ln[122]=new cn(122,"npc_talk_kill",void 0,[new dn(Vt,void 0,void 0)],an.Pop),cn.NPC_CRTPK_V3=ln[123]=new cn(123,"npc_crtpk_v3",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Kt,void 0,sn.Read)]},void 0,void 0)],void 0),cn.NPC_CRPPK_V3=ln[124]=new cn(124,"npc_crppk_v3",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Kt,void 0,sn.Read)]},void 0,void 0)],void 0),cn.NPC_CRPTALK_V3=ln[125]=new cn(125,"npc_crptalk_v3",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Kt,void 0,sn.Read)]},void 0,void 0)],void 0),cn.P_LOOK_AT_V1=ln[126]=new cn(126,"p_look_at_v1",void 0,[new dn(Vt,void 0,void 0),new dn(Vt,void 0,void 0)],an.Pop),cn.NPC_CRP_ID_V3=ln[127]=new cn(127,"npc_crp_id_v3",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Kt,void 0,sn.Read)]},void 0,void 0)],void 0),cn.CAM_QUAKE=ln[128]=new cn(128,"cam_quake",void 0,[],void 0),cn.CAM_ADJ=ln[129]=new cn(129,"cam_adj",void 0,[],void 0),cn.CAM_ZMIN=ln[130]=new cn(130,"cam_zmin",void 0,[],void 0),cn.CAM_ZMOUT=ln[131]=new cn(131,"cam_zmout",void 0,[],void 0),cn.CAM_PAN_V3=ln[132]=new cn(132,"cam_pan_v3",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,void 0,sn.Read),new dn(Vt,void 0,sn.Read),new dn(Vt,void 0,sn.Read),new dn(Vt,void 0,sn.Read),new dn(Vt,void 0,sn.Read)]},void 0,void 0)],void 0),cn.GAME_LEV_SUPER=ln[133]=new cn(133,"game_lev_super",void 0,[],void 0),cn.GAME_LEV_RESET=ln[134]=new cn(134,"game_lev_reset",void 0,[],void 0),cn.POS_PIPE_V3=ln[135]=new cn(135,"pos_pipe_v3","Create a telepipe at a specific position for the given player slot that takes players back to Pioneer 2 or the Lab.",[new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,"X coordinate.",sn.Read),new dn(Vt,"Y coordinate.",sn.Read),new dn(Vt,"Z coordinate.",sn.Read),new dn(Vt,"Player slot.",sn.Read)]},void 0,void 0)],void 0),cn.IF_ZONE_CLEAR=ln[136]=new cn(136,"if_zone_clear",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,void 0,sn.Write)]},void 0,void 0),new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,void 0,sn.Read),new dn(Vt,void 0,sn.Read)]},void 0,void 0)],void 0),cn.CHK_ENE_NUM=ln[137]=new cn(137,"chk_ene_num","Retrieves the amount of enemies killed during the quest.",[new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,void 0,sn.Write)]},void 0,void 0)],void 0),cn.UNHIDE_OBJ=ln[138]=new cn(138,"unhide_obj",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,void 0,sn.Read),new dn(Vt,void 0,sn.Read),new dn(Vt,void 0,sn.Read)]},void 0,void 0)],void 0),cn.UNHIDE_ENE=ln[139]=new cn(139,"unhide_ene",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,void 0,sn.Read),new dn(Vt,void 0,sn.Read),new dn(Vt,void 0,sn.Read),new dn(Vt,void 0,sn.Read)]},void 0,void 0)],void 0),cn.AT_COORDS_CALL=ln[140]=new cn(140,"at_coords_call",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,void 0,sn.Read),new dn(Vt,void 0,sn.Read),new dn(Vt,void 0,sn.Read),new dn(Vt,void 0,sn.Read),new dn(Jt,void 0,sn.Read)]},void 0,void 0)],void 0),cn.AT_COORDS_TALK=ln[141]=new cn(141,"at_coords_talk",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,void 0,sn.Read),new dn(Vt,void 0,sn.Read),new dn(Vt,void 0,sn.Read),new dn(Vt,void 0,sn.Read),new dn(Jt,void 0,sn.Read)]},void 0,void 0)],void 0),cn.COL_NPCIN=ln[142]=new cn(142,"col_npcin",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,void 0,sn.Read),new dn(Vt,void 0,sn.Read),new dn(Vt,void 0,sn.Read),new dn(Vt,void 0,sn.Read),new dn(Jt,void 0,sn.Read)]},void 0,void 0)],void 0),cn.COL_NPCINR=ln[143]=new cn(143,"col_npcinr",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Kt,void 0,sn.Read)]},void 0,void 0)],void 0),cn.SWITCH_ON=ln[144]=new cn(144,"switch_on",void 0,[new dn(Vt,void 0,void 0)],an.Pop),cn.SWITCH_OFF=ln[145]=new cn(145,"switch_off",void 0,[new dn(Vt,void 0,void 0)],an.Pop),cn.PLAYBGM_EPI=ln[146]=new cn(146,"playbgm_epi",void 0,[new dn(Vt,void 0,void 0)],an.Pop),cn.SET_MAINWARP=ln[147]=new cn(147,"set_mainwarp",void 0,[new dn(Vt,void 0,void 0)],an.Pop),cn.SET_OBJ_PARAM=ln[148]=new cn(148,"set_obj_param","Creates a targetable object.",[new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,"X coordinate.",sn.Read),new dn(Vt,"Y coordinate.",sn.Read),new dn(Vt,"Z coordinate.",sn.Read),new dn(Vt,"Collision radius.",sn.Read),new dn(Jt,"Function label.",sn.Read),new dn(Vt,"Vertical position of the cursor.",sn.Read)]},void 0,void 0),new dn({kind:It.RegTupRef,register_tuples:[new dn(Kt,void 0,sn.Write)]},"Object handle.",void 0)],void 0),cn.SET_FLOOR_HANDLER=ln[149]=new cn(149,"set_floor_handler",void 0,[new dn(Vt,"Floor number.",void 0),new dn(Jt,"Handler function label.",void 0)],an.Pop),cn.CLR_FLOOR_HANDLER=ln[150]=new cn(150,"clr_floor_handler",void 0,[new dn(Vt,"Floor number.",void 0)],an.Pop),cn.COL_PLINAW=ln[151]=new cn(151,"col_plinaw",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Kt,void 0,sn.Read)]},void 0,void 0)],void 0),cn.HUD_HIDE=ln[152]=new cn(152,"hud_hide",void 0,[],void 0),cn.HUD_SHOW=ln[153]=new cn(153,"hud_show",void 0,[],void 0),cn.CINE_ENABLE=ln[154]=new cn(154,"cine_enable",void 0,[],void 0),cn.CINE_DISABLE=ln[155]=new cn(155,"cine_disable",void 0,[],void 0),cn.UNKNOWN_9C=ln[156]=new cn(156,"unknown_9c",void 0,[],void 0),cn.UNKNOWN_9D=ln[157]=new cn(157,"unknown_9d",void 0,[],void 0),cn.UNKNOWN_9E=ln[158]=new cn(158,"unknown_9e",void 0,[],void 0),cn.UNKNOWN_9F=ln[159]=new cn(159,"unknown_9f",void 0,[],void 0),cn.UNKNOWN_A0=ln[160]=new cn(160,"unknown_a0",void 0,[],void 0),cn.SET_QT_FAILURE=ln[161]=new cn(161,"set_qt_failure",void 0,[new dn(Jt,void 0,void 0)],void 0),cn.SET_QT_SUCCESS=ln[162]=new cn(162,"set_qt_success",void 0,[new dn(Jt,void 0,void 0)],void 0),cn.CLR_QT_FAILURE=ln[163]=new cn(163,"clr_qt_failure",void 0,[],void 0),cn.CLR_QT_SUCCESS=ln[164]=new cn(164,"clr_qt_success",void 0,[],void 0),cn.SET_QT_CANCEL=ln[165]=new cn(165,"set_qt_cancel",void 0,[new dn(Jt,void 0,void 0)],void 0),cn.CLR_QT_CANCEL=ln[166]=new cn(166,"clr_qt_cancel",void 0,[],void 0),cn.UNKNOWN_A7=ln[167]=new cn(167,"unknown_a7",void 0,[],void 0),cn.PL_WALK_V3=ln[168]=new cn(168,"pl_walk_v3",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Kt,void 0,sn.Read)]},void 0,void 0)],void 0),cn.UNKNOWN_A9=ln[169]=new cn(169,"unknown_a9",void 0,[],void 0),cn.UNKNOWN_AA=ln[170]=new cn(170,"unknown_aa",void 0,[],void 0),cn.UNKNOWN_AB=ln[171]=new cn(171,"unknown_ab",void 0,[],void 0),cn.UNKNOWN_AC=ln[172]=new cn(172,"unknown_ac",void 0,[],void 0),cn.UNKNOWN_AD=ln[173]=new cn(173,"unknown_ad",void 0,[],void 0),cn.UNKNOWN_AE=ln[174]=new cn(174,"unknown_ae",void 0,[],void 0),cn.UNKNOWN_AF=ln[175]=new cn(175,"unknown_af",void 0,[],void 0),cn.PL_ADD_MESETA=ln[176]=new cn(176,"pl_add_meseta",void 0,[new dn(Vt,void 0,void 0),new dn(Vt,void 0,void 0)],an.Pop),cn.THREAD_STG=ln[177]=new cn(177,"thread_stg",void 0,[new dn(Jt,void 0,void 0)],void 0),cn.DEL_OBJ_PARAM=ln[178]=new cn(178,"del_obj_param",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Kt,void 0,sn.Read)]},"Object handle.",void 0)],void 0),cn.ITEM_CREATE=ln[179]=new cn(179,"item_create",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Kt,void 0,sn.Read)]},void 0,void 0),new dn({kind:It.RegTupRef,register_tuples:[new dn(Kt,void 0,sn.Read)]},void 0,void 0)],void 0),cn.ITEM_CREATE2=ln[180]=new cn(180,"item_create2",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Kt,void 0,sn.Read)]},void 0,void 0),new dn({kind:It.RegTupRef,register_tuples:[new dn(Kt,void 0,sn.Read)]},void 0,void 0)],void 0),cn.ITEM_DELETE=ln[181]=new cn(181,"item_delete",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Kt,void 0,sn.Read)]},void 0,void 0),new dn({kind:It.RegTupRef,register_tuples:[new dn(Kt,void 0,sn.Read)]},void 0,void 0)],void 0),cn.ITEM_DELETE2=ln[182]=new cn(182,"item_delete2","Deletes an item from the player's inventory.",[new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,void 0,sn.Read),new dn(Vt,void 0,sn.Read),new dn(Vt,void 0,sn.Read)]},void 0,void 0),new dn({kind:It.RegTupRef,register_tuples:[new dn(Kt,void 0,sn.Write)]},void 0,void 0)],void 0),cn.ITEM_CHECK=ln[183]=new cn(183,"item_check",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Kt,void 0,sn.Read)]},void 0,void 0),new dn({kind:It.RegTupRef,register_tuples:[new dn(Kt,void 0,sn.Read)]},void 0,void 0)],void 0),cn.SETEVT=ln[184]=new cn(184,"setevt",void 0,[new dn(Vt,void 0,void 0)],an.Pop),cn.GET_DIFFLVL=ln[185]=new cn(185,"get_difflvl","Sets the given register to the current difficulty. 0 For normal, 1 for hard and 2 for both very hard and ultimate.\nUse get_difficulty_level2 if you want to differentiate between very hard and ultimate.",[new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,void 0,sn.Write)]},void 0,void 0)],void 0),cn.SET_QT_EXIT=ln[186]=new cn(186,"set_qt_exit",void 0,[new dn(Jt,void 0,void 0)],void 0),cn.CLR_QT_EXIT=ln[187]=new cn(187,"clr_qt_exit",void 0,[],void 0),cn.UNKNOWN_BC=ln[188]=new cn(188,"unknown_bc",void 0,[],void 0),cn.UNKNOWN_BD=ln[189]=new cn(189,"unknown_bd",void 0,[],void 0),cn.UNKNOWN_BE=ln[190]=new cn(190,"unknown_be",void 0,[],void 0),cn.UNKNOWN_BF=ln[191]=new cn(191,"unknown_bf",void 0,[],void 0),cn.PARTICLE_V3=ln[192]=new cn(192,"particle_v3",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Kt,void 0,sn.Read)]},void 0,void 0)],void 0),cn.NPC_TEXT=ln[193]=new cn(193,"npc_text",void 0,[new dn(Vt,void 0,void 0),new dn(Xt,void 0,void 0)],an.Pop),cn.NPC_CHKWARP=ln[194]=new cn(194,"npc_chkwarp",void 0,[],void 0),cn.PL_PKOFF=ln[195]=new cn(195,"pl_pkoff",void 0,[],void 0),cn.MAP_DESIGNATE=ln[196]=new cn(196,"map_designate",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Kt,void 0,sn.Read)]},void 0,void 0)],void 0),cn.MASTERKEY_ON=ln[197]=new cn(197,"masterkey_on",void 0,[],void 0),cn.MASTERKEY_OFF=ln[198]=new cn(198,"masterkey_off",void 0,[],void 0),cn.WINDOW_TIME=ln[199]=new cn(199,"window_time",void 0,[],void 0),cn.WINEND_TIME=ln[200]=new cn(200,"winend_time",void 0,[],void 0),cn.WINSET_TIME=ln[201]=new cn(201,"winset_time",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,void 0,sn.Write)]},void 0,void 0)],void 0),cn.GETMTIME=ln[202]=new cn(202,"getmtime",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Kt,void 0,sn.Write)]},void 0,void 0)],void 0),cn.SET_QUEST_BOARD_HANDLER=ln[203]=new cn(203,"set_quest_board_handler",void 0,[new dn(Vt,void 0,void 0),new dn(Jt,void 0,void 0),new dn(Xt,void 0,void 0)],an.Pop),cn.CLEAR_QUEST_BOARD_HANDLER=ln[204]=new cn(204,"clear_quest_board_handler",void 0,[new dn(Vt,void 0,void 0)],an.Pop),cn.PARTICLE_ID_V3=ln[205]=new cn(205,"particle_id_v3",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,void 0,sn.Read),new dn(Vt,void 0,sn.Read),new dn(Vt,void 0,sn.Read),new dn(Vt,void 0,sn.Read)]},void 0,void 0)],void 0),cn.NPC_CRPTALK_ID_V3=ln[206]=new cn(206,"npc_crptalk_id_v3",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Kt,void 0,sn.Read)]},void 0,void 0)],void 0),cn.NPC_LANG_CLEAN=ln[207]=new cn(207,"npc_lang_clean",void 0,[],void 0),cn.PL_PKON=ln[208]=new cn(208,"pl_pkon",void 0,[],void 0),cn.PL_CHK_ITEM2=ln[209]=new cn(209,"pl_chk_item2",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Kt,void 0,sn.Read)]},void 0,void 0),new dn({kind:It.RegTupRef,register_tuples:[new dn(Kt,void 0,sn.Read)]},void 0,void 0)],void 0),cn.ENABLE_MAINMENU=ln[210]=new cn(210,"enable_mainmenu",void 0,[],void 0),cn.DISABLE_MAINMENU=ln[211]=new cn(211,"disable_mainmenu",void 0,[],void 0),cn.START_BATTLEBGM=ln[212]=new cn(212,"start_battlebgm",void 0,[],void 0),cn.END_BATTLEBGM=ln[213]=new cn(213,"end_battlebgm",void 0,[],void 0),cn.DISP_MSG_QB=ln[214]=new cn(214,"disp_msg_qb",void 0,[new dn(Xt,void 0,void 0)],an.Pop),cn.CLOSE_MSG_QB=ln[215]=new cn(215,"close_msg_qb",void 0,[],void 0),cn.SET_EVENTFLAG_V3=ln[216]=new cn(216,"set_eventflag_v3",void 0,[new dn(Vt,void 0,void 0),new dn(Vt,void 0,void 0)],an.Pop),cn.SYNC_LETI=ln[217]=new cn(217,"sync_leti",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,void 0,sn.Write)]},void 0,void 0),new dn(Vt,void 0,void 0)],void 0),cn.SET_RETURNHUNTER=ln[218]=new cn(218,"set_returnhunter",void 0,[],void 0),cn.SET_RETURNCITY=ln[219]=new cn(219,"set_returncity",void 0,[],void 0),cn.LOAD_PVR=ln[220]=new cn(220,"load_pvr",void 0,[],void 0),cn.LOAD_MIDI=ln[221]=new cn(221,"load_midi",void 0,[],void 0),cn.UNKNOWN_DE=ln[222]=new cn(222,"unknown_de",void 0,[],void 0),cn.NPC_PARAM_V3=ln[223]=new cn(223,"npc_param_v3",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Kt,void 0,sn.Read)]},void 0,void 0),new dn(Vt,void 0,void 0)],an.Pop),cn.PAD_DRAGON=ln[224]=new cn(224,"pad_dragon",void 0,[],void 0),cn.CLEAR_MAINWARP=ln[225]=new cn(225,"clear_mainwarp",void 0,[new dn(Vt,void 0,void 0)],an.Pop),cn.PCAM_PARAM_V3=ln[226]=new cn(226,"pcam_param_v3",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Kt,void 0,sn.Read)]},void 0,void 0)],void 0),cn.START_SETEVT_V3=ln[227]=new cn(227,"start_setevt_v3",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Kt,void 0,sn.Read)]},void 0,void 0),new dn(Vt,void 0,void 0)],an.Pop),cn.WARP_ON=ln[228]=new cn(228,"warp_on",void 0,[],void 0),cn.WARP_OFF=ln[229]=new cn(229,"warp_off",void 0,[],void 0),cn.GET_SLOTNUMBER=ln[230]=new cn(230,"get_slotnumber",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,void 0,sn.Write)]},void 0,void 0)],void 0),cn.GET_SERVERNUMBER=ln[231]=new cn(231,"get_servernumber",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,void 0,sn.Write)]},void 0,void 0)],void 0),cn.SET_EVENTFLAG2=ln[232]=new cn(232,"set_eventflag2",void 0,[new dn(Vt,void 0,void 0),new dn({kind:It.RegTupRef,register_tuples:[new dn(Kt,void 0,sn.Read)]},void 0,void 0)],an.Pop),cn.RES=ln[233]=new cn(233,"res",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Kt,void 0,sn.Read)]},void 0,void 0),new dn({kind:It.RegTupRef,register_tuples:[new dn(Kt,void 0,sn.Read)]},void 0,void 0)],void 0),cn.UNKNOWN_EA=ln[234]=new cn(234,"unknown_ea",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Kt,void 0,sn.Read)]},void 0,void 0),new dn(Vt,void 0,void 0)],void 0),cn.ENABLE_BGMCTRL=ln[235]=new cn(235,"enable_bgmctrl",void 0,[new dn(Vt,void 0,void 0)],an.Pop),cn.SW_SEND=ln[236]=new cn(236,"sw_send",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Kt,void 0,sn.Read)]},void 0,void 0)],void 0),cn.CREATE_BGMCTRL=ln[237]=new cn(237,"create_bgmctrl",void 0,[],void 0),cn.PL_ADD_MESETA2=ln[238]=new cn(238,"pl_add_meseta2",void 0,[new dn(Vt,void 0,void 0)],an.Pop),cn.SYNC_REGISTER=ln[239]=new cn(239,"sync_register",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,void 0,sn.Write)]},void 0,void 0),new dn(Vt,void 0,void 0)],an.Pop),cn.SEND_REGWORK=ln[240]=new cn(240,"send_regwork",void 0,[],void 0),cn.LETI_FIXED_CAMERA_V3=ln[241]=new cn(241,"leti_fixed_camera_v3",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,void 0,sn.Read),new dn(Vt,void 0,sn.Read),new dn(Vt,void 0,sn.Read),new dn(Vt,void 0,sn.Read),new dn(Vt,void 0,sn.Read),new dn(Vt,void 0,sn.Read)]},void 0,void 0)],void 0),cn.DEFAULT_CAMERA_POS1=ln[242]=new cn(242,"default_camera_pos1",void 0,[],void 0),cn.UNKNOWN_F3=ln[243]=new cn(243,"unknown_f3",void 0,[],void 0),cn.UNKNOWN_F4=ln[244]=new cn(244,"unknown_f4",void 0,[],void 0),cn.UNKNOWN_F5=ln[245]=new cn(245,"unknown_f5",void 0,[],void 0),cn.UNKNOWN_F6=ln[246]=new cn(246,"unknown_f6",void 0,[],void 0),cn.UNKNOWN_F7=ln[247]=new cn(247,"unknown_f7",void 0,[],void 0),cn.UNKNOWN_F8=ln[248]=new cn(248,"unknown_f8",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Kt,void 0,sn.Read)]},void 0,void 0)],void 0),cn.UNKNOWN_F9=ln[249]=new cn(249,"unknown_f9",void 0,[],void 0),cn.GET_GC_NUMBER=ln[250]=new cn(250,"get_gc_number",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Kt,void 0,sn.Write)]},void 0,void 0)],void 0),cn.UNKNOWN_FB=ln[251]=new cn(251,"unknown_fb",void 0,[new dn(Ht,void 0,void 0)],void 0),cn.UNKNOWN_FC=ln[252]=new cn(252,"unknown_fc",void 0,[],void 0),cn.UNKNOWN_FD=ln[253]=new cn(253,"unknown_fd",void 0,[],void 0),cn.UNKNOWN_FE=ln[254]=new cn(254,"unknown_fe",void 0,[],void 0),cn.UNKNOWN_FF=ln[255]=new cn(255,"unknown_ff",void 0,[],void 0),cn.UNKNOWN_F800=ln[63488]=new cn(63488,"unknown_f800",void 0,[],void 0),cn.SET_CHAT_CALLBACK=ln[63489]=new cn(63489,"set_chat_callback",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Kt,void 0,sn.Read)]},void 0,void 0),new dn(Xt,void 0,void 0)],an.Pop),cn.UNKNOWN_F802=ln[63490]=new cn(63490,"unknown_f802",void 0,[],void 0),cn.UNKNOWN_F803=ln[63491]=new cn(63491,"unknown_f803",void 0,[],void 0),cn.UNKNOWN_F804=ln[63492]=new cn(63492,"unknown_f804",void 0,[],void 0),cn.UNKNOWN_F805=ln[63493]=new cn(63493,"unknown_f805",void 0,[],void 0),cn.UNKNOWN_F806=ln[63494]=new cn(63494,"unknown_f806",void 0,[],void 0),cn.UNKNOWN_F807=ln[63495]=new cn(63495,"unknown_f807",void 0,[],void 0),cn.GET_DIFFICULTY_LEVEL2=ln[63496]=new cn(63496,"get_difficulty_level2","Sets the given register to the current difficulty. 0 For normal, 1 for hard, 2 for very hard and 3 for ultimate.",[new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,void 0,sn.Write)]},void 0,void 0)],void 0),cn.GET_NUMBER_OF_PLAYER1=ln[63497]=new cn(63497,"get_number_of_player1","Set the given register to the current number of players. Either 1, 2, 3 or 4.",[new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,void 0,sn.Write)]},void 0,void 0)],void 0),cn.GET_COORD_OF_PLAYER=ln[63498]=new cn(63498,"get_coord_of_player","Retrieves a player's position.",[new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,"X coordinate.",sn.Write),new dn(Vt,"Y coordinate.",sn.Write),new dn(Vt,"Z coordinate.",sn.Write)]},void 0,void 0),new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,"Player slot.",sn.Read)]},void 0,void 0)],void 0),cn.ENABLE_MAP=ln[63499]=new cn(63499,"enable_map",void 0,[],void 0),cn.DISABLE_MAP=ln[63500]=new cn(63500,"disable_map",void 0,[],void 0),cn.MAP_DESIGNATE_EX=ln[63501]=new cn(63501,"map_designate_ex",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,void 0,sn.Read),new dn(Vt,void 0,sn.Read),new dn(Vt,void 0,sn.Read),new dn(Vt,void 0,sn.Read),new dn(Vt,void 0,sn.Read)]},void 0,void 0)],void 0),cn.UNKNOWN_F80E=ln[63502]=new cn(63502,"unknown_f80e",void 0,[new dn(Vt,void 0,void 0)],an.Pop),cn.UNKNOWN_F80F=ln[63503]=new cn(63503,"unknown_f80f",void 0,[new dn(Vt,void 0,void 0)],an.Pop),cn.BA_INITIAL_FLOOR=ln[63504]=new cn(63504,"ba_initial_floor",void 0,[new dn(Vt,void 0,void 0)],an.Pop),cn.SET_BA_RULES=ln[63505]=new cn(63505,"set_ba_rules",void 0,[],void 0),cn.UNKNOWN_F812=ln[63506]=new cn(63506,"unknown_f812",void 0,[new dn(Vt,void 0,void 0)],an.Pop),cn.UNKNOWN_F813=ln[63507]=new cn(63507,"unknown_f813",void 0,[new dn(Vt,void 0,void 0)],an.Pop),cn.UNKNOWN_F814=ln[63508]=new cn(63508,"unknown_f814",void 0,[new dn(Vt,void 0,void 0)],an.Pop),cn.UNKNOWN_F815=ln[63509]=new cn(63509,"unknown_f815",void 0,[new dn(Vt,void 0,void 0)],an.Pop),cn.UNKNOWN_F816=ln[63510]=new cn(63510,"unknown_f816",void 0,[new dn(Vt,void 0,void 0)],an.Pop),cn.UNKNOWN_F817=ln[63511]=new cn(63511,"unknown_f817",void 0,[new dn(Vt,void 0,void 0)],an.Pop),cn.UNKNOWN_F818=ln[63512]=new cn(63512,"unknown_f818",void 0,[new dn(Vt,void 0,void 0)],an.Pop),cn.UNKNOWN_F819=ln[63513]=new cn(63513,"unknown_f819",void 0,[new dn(Vt,void 0,void 0)],an.Pop),cn.UNKNOWN_F81A=ln[63514]=new cn(63514,"unknown_f81a",void 0,[new dn(Vt,void 0,void 0)],an.Pop),cn.UNKNOWN_F81B=ln[63515]=new cn(63515,"unknown_f81b",void 0,[new dn(Vt,void 0,void 0)],an.Pop),cn.BA_DISP_MSG=ln[63516]=new cn(63516,"ba_disp_msg",void 0,[new dn(Xt,void 0,void 0)],an.Pop),cn.DEATH_LVL_UP=ln[63517]=new cn(63517,"death_lvl_up",void 0,[new dn(Vt,void 0,void 0)],an.Pop),cn.DEATH_TECH_LVL_UP=ln[63518]=new cn(63518,"death_tech_lvl_up",void 0,[new dn(Vt,void 0,void 0)],an.Pop),cn.UNKNOWN_F81F=ln[63519]=new cn(63519,"unknown_f81f",void 0,[],void 0),cn.CMODE_STAGE=ln[63520]=new cn(63520,"cmode_stage",void 0,[new dn(Vt,void 0,void 0)],an.Pop),cn.UNKNOWN_F821=ln[63521]=new cn(63521,"unknown_f821",void 0,[],void 0),cn.UNKNOWN_F822=ln[63522]=new cn(63522,"unknown_f822",void 0,[],void 0),cn.UNKNOWN_F823=ln[63523]=new cn(63523,"unknown_f823",void 0,[new dn(Vt,void 0,void 0)],an.Pop),cn.UNKNOWN_F824=ln[63524]=new cn(63524,"unknown_f824",void 0,[new dn(Vt,void 0,void 0)],an.Pop),cn.EXP_MULTIPLICATION=ln[63525]=new cn(63525,"exp_multiplication",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Kt,void 0,sn.Write)]},void 0,void 0)],void 0),cn.EXP_DIVISION=ln[63526]=new cn(63526,"exp_division",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Kt,void 0,sn.Write)]},void 0,void 0)],void 0),cn.GET_USER_IS_DEAD=ln[63527]=new cn(63527,"get_user_is_dead",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Kt,void 0,sn.Write)]},void 0,void 0)],void 0),cn.GO_FLOOR=ln[63528]=new cn(63528,"go_floor","Sends a player to the given floor.",[new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,"Player slot.",sn.Read)]},void 0,void 0),new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,"Floor ID.",sn.Read)]},void 0,void 0)],void 0),cn.UNKNOWN_F829=ln[63529]=new cn(63529,"unknown_f829",void 0,[],void 0),cn.UNKNOWN_F82A=ln[63530]=new cn(63530,"unknown_f82a",void 0,[],void 0),cn.UNLOCK_DOOR2=ln[63531]=new cn(63531,"unlock_door2",void 0,[new dn(Vt,void 0,void 0),new dn(Vt,void 0,void 0)],an.Pop),cn.LOCK_DOOR2=ln[63532]=new cn(63532,"lock_door2",void 0,[new dn(Vt,void 0,void 0),new dn(Vt,void 0,void 0)],an.Pop),cn.IF_SWITCH_NOT_PRESSED=ln[63533]=new cn(63533,"if_switch_not_pressed",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,void 0,sn.Read),new dn(Vt,void 0,sn.Write)]},void 0,void 0)],void 0),cn.IF_SWITCH_PRESSED=ln[63534]=new cn(63534,"if_switch_pressed",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,"Floor ID.",sn.Read),new dn(Vt,"Switch ID.",sn.Read),new dn(Vt,"Will be set to 1 if the switch is pressed, 0 otherwise.",sn.Write)]},void 0,void 0)],void 0),cn.UNKNOWN_F82F=ln[63535]=new cn(63535,"unknown_f82f",void 0,[new dn(Vt,void 0,void 0),new dn(Vt,void 0,void 0)],an.Pop),cn.CONTROL_DRAGON=ln[63536]=new cn(63536,"control_dragon",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,void 0,sn.Read)]},void 0,void 0)],void 0),cn.RELEASE_DRAGON=ln[63537]=new cn(63537,"release_dragon",void 0,[],void 0),cn.UNKNOWN_F832=ln[63538]=new cn(63538,"unknown_f832",void 0,[],void 0),cn.UNKNOWN_F833=ln[63539]=new cn(63539,"unknown_f833",void 0,[],void 0),cn.UNKNOWN_F834=ln[63540]=new cn(63540,"unknown_f834",void 0,[],void 0),cn.UNKNOWN_F835=ln[63541]=new cn(63541,"unknown_f835",void 0,[],void 0),cn.UNKNOWN_F836=ln[63542]=new cn(63542,"unknown_f836",void 0,[],void 0),cn.UNKNOWN_F837=ln[63543]=new cn(63543,"unknown_f837",void 0,[],void 0),cn.SHRINK=ln[63544]=new cn(63544,"shrink",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,"Player slot.",sn.Read)]},void 0,void 0)],void 0),cn.UNSHRINK=ln[63545]=new cn(63545,"unshrink",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,"Player slot.",sn.Read)]},void 0,void 0)],void 0),cn.UNKNOWN_F83A=ln[63546]=new cn(63546,"unknown_f83a",void 0,[],void 0),cn.UNKNOWN_F83B=ln[63547]=new cn(63547,"unknown_f83b",void 0,[],void 0),cn.DISPLAY_CLOCK2=ln[63548]=new cn(63548,"display_clock2",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,void 0,sn.Read)]},void 0,void 0)],void 0),cn.UNKNOWN_F83D=ln[63549]=new cn(63549,"unknown_f83d",void 0,[new dn(Vt,void 0,void 0)],an.Pop),cn.DELETE_AREA_TITLE=ln[63550]=new cn(63550,"delete_area_title",void 0,[new dn(Vt,void 0,void 0)],an.Pop),cn.UNKNOWN_F83F=ln[63551]=new cn(63551,"unknown_f83f",void 0,[],void 0),cn.LOAD_NPC_DATA=ln[63552]=new cn(63552,"load_npc_data",void 0,[],void 0),cn.GET_NPC_DATA=ln[63553]=new cn(63553,"get_npc_data",void 0,[new dn(Yt,void 0,void 0)],void 0),cn.UNKNOWN_F842=ln[63554]=new cn(63554,"unknown_f842",void 0,[],void 0),cn.UNKNOWN_F843=ln[63555]=new cn(63555,"unknown_f843",void 0,[],void 0),cn.UNKNOWN_F844=ln[63556]=new cn(63556,"unknown_f844",void 0,[],void 0),cn.UNKNOWN_F845=ln[63557]=new cn(63557,"unknown_f845",void 0,[],void 0),cn.UNKNOWN_F846=ln[63558]=new cn(63558,"unknown_f846",void 0,[],void 0),cn.UNKNOWN_F847=ln[63559]=new cn(63559,"unknown_f847",void 0,[],void 0),cn.GIVE_DAMAGE_SCORE=ln[63560]=new cn(63560,"give_damage_score",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,void 0,sn.Write)]},void 0,void 0)],void 0),cn.TAKE_DAMAGE_SCORE=ln[63561]=new cn(63561,"take_damage_score",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,void 0,sn.Write)]},void 0,void 0)],void 0),cn.UNK_SCORE_F84A=ln[63562]=new cn(63562,"unk_score_f84a",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,void 0,sn.Write)]},void 0,void 0)],void 0),cn.UNK_SCORE_F84B=ln[63563]=new cn(63563,"unk_score_f84b",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,void 0,sn.Write)]},void 0,void 0)],void 0),cn.KILL_SCORE=ln[63564]=new cn(63564,"kill_score",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,void 0,sn.Write)]},void 0,void 0)],void 0),cn.DEATH_SCORE=ln[63565]=new cn(63565,"death_score",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,void 0,sn.Write)]},void 0,void 0)],void 0),cn.UNK_SCORE_F84E=ln[63566]=new cn(63566,"unk_score_f84e",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,void 0,sn.Write)]},void 0,void 0)],void 0),cn.ENEMY_DEATH_SCORE=ln[63567]=new cn(63567,"enemy_death_score",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,void 0,sn.Write)]},void 0,void 0)],void 0),cn.MESETA_SCORE=ln[63568]=new cn(63568,"meseta_score",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,void 0,sn.Write)]},void 0,void 0)],void 0),cn.UNKNOWN_F851=ln[63569]=new cn(63569,"unknown_f851",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,void 0,sn.Write)]},void 0,void 0)],void 0),cn.UNKNOWN_F852=ln[63570]=new cn(63570,"unknown_f852",void 0,[new dn(Vt,void 0,void 0)],an.Pop),cn.REVERSE_WARPS=ln[63571]=new cn(63571,"reverse_warps",void 0,[],void 0),cn.UNREVERSE_WARPS=ln[63572]=new cn(63572,"unreverse_warps",void 0,[],void 0),cn.SET_ULT_MAP=ln[63573]=new cn(63573,"set_ult_map",void 0,[],void 0),cn.UNSET_ULT_MAP=ln[63574]=new cn(63574,"unset_ult_map",void 0,[],void 0),cn.SET_AREA_TITLE=ln[63575]=new cn(63575,"set_area_title",void 0,[new dn(Xt,void 0,void 0)],an.Pop),cn.UNKNOWN_F858=ln[63576]=new cn(63576,"unknown_f858",void 0,[],void 0),cn.UNKNOWN_F859=ln[63577]=new cn(63577,"unknown_f859",void 0,[],void 0),cn.EQUIP_ITEM=ln[63578]=new cn(63578,"equip_item",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,void 0,sn.Read)]},void 0,void 0)],void 0),cn.UNEQUIP_ITEM=ln[63579]=new cn(63579,"unequip_item",void 0,[new dn(Vt,void 0,void 0),new dn(Vt,void 0,void 0)],an.Pop),cn.UNKNOWN_F85C=ln[63580]=new cn(63580,"unknown_f85c",void 0,[],void 0),cn.UNKNOWN_F85D=ln[63581]=new cn(63581,"unknown_f85d",void 0,[],void 0),cn.UNKNOWN_F85E=ln[63582]=new cn(63582,"unknown_f85e",void 0,[new dn(Vt,void 0,void 0)],an.Pop),cn.UNKNOWN_F85F=ln[63583]=new cn(63583,"unknown_f85f",void 0,[new dn(Vt,void 0,void 0)],an.Pop),cn.UNKNOWN_F860=ln[63584]=new cn(63584,"unknown_f860",void 0,[],void 0),cn.UNKNOWN_F861=ln[63585]=new cn(63585,"unknown_f861",void 0,[new dn(Vt,void 0,void 0)],an.Pop),cn.UNKNOWN_F862=ln[63586]=new cn(63586,"unknown_f862",void 0,[],void 0),cn.UNKNOWN_F863=ln[63587]=new cn(63587,"unknown_f863",void 0,[],void 0),cn.CMODE_RANK=ln[63588]=new cn(63588,"cmode_rank",void 0,[new dn(Vt,void 0,void 0),new dn(Xt,void 0,void 0)],an.Pop),cn.AWARD_ITEM_NAME=ln[63589]=new cn(63589,"award_item_name",void 0,[],void 0),cn.AWARD_ITEM_SELECT=ln[63590]=new cn(63590,"award_item_select",void 0,[],void 0),cn.AWARD_ITEM_GIVE_TO=ln[63591]=new cn(63591,"award_item_give_to",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,void 0,sn.Read)]},void 0,void 0)],void 0),cn.UNKNOWN_F868=ln[63592]=new cn(63592,"unknown_f868",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Kt,void 0,sn.Write)]},void 0,void 0),new dn({kind:It.RegTupRef,register_tuples:[new dn(Kt,void 0,sn.Write)]},void 0,void 0)],void 0),cn.UNKNOWN_F869=ln[63593]=new cn(63593,"unknown_f869",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Kt,void 0,sn.Write)]},void 0,void 0),new dn({kind:It.RegTupRef,register_tuples:[new dn(Kt,void 0,sn.Write)]},void 0,void 0)],void 0),cn.ITEM_CREATE_CMODE=ln[63594]=new cn(63594,"item_create_cmode",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Kt,void 0,sn.Write)]},void 0,void 0),new dn({kind:It.RegTupRef,register_tuples:[new dn(Kt,void 0,sn.Write)]},void 0,void 0)],void 0),cn.UNKNOWN_F86B=ln[63595]=new cn(63595,"unknown_f86b",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Kt,void 0,sn.Read)]},void 0,void 0)],void 0),cn.AWARD_ITEM_OK=ln[63596]=new cn(63596,"award_item_ok",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Kt,void 0,sn.Write)]},void 0,void 0)],void 0),cn.UNKNOWN_F86D=ln[63597]=new cn(63597,"unknown_f86d",void 0,[],void 0),cn.UNKNOWN_F86E=ln[63598]=new cn(63598,"unknown_f86e",void 0,[],void 0),cn.BA_SET_LIVES=ln[63599]=new cn(63599,"ba_set_lives",void 0,[new dn(Vt,void 0,void 0)],an.Pop),cn.BA_SET_TECH_LVL=ln[63600]=new cn(63600,"ba_set_tech_lvl",void 0,[new dn(Vt,void 0,void 0)],an.Pop),cn.BA_SET_LVL=ln[63601]=new cn(63601,"ba_set_lvl",void 0,[new dn(Vt,void 0,void 0)],an.Pop),cn.BA_SET_TIME_LIMIT=ln[63602]=new cn(63602,"ba_set_time_limit",void 0,[new dn(Vt,void 0,void 0)],an.Pop),cn.BOSS_IS_DEAD=ln[63603]=new cn(63603,"boss_is_dead",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Kt,void 0,sn.Write)]},void 0,void 0)],void 0),cn.UNKNOWN_F874=ln[63604]=new cn(63604,"unknown_f874",void 0,[],void 0),cn.UNKNOWN_F875=ln[63605]=new cn(63605,"unknown_f875",void 0,[],void 0),cn.UNKNOWN_F876=ln[63606]=new cn(63606,"unknown_f876",void 0,[],void 0),cn.ENABLE_TECHS=ln[63607]=new cn(63607,"enable_techs","Enables technique use for the given player.",[new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,"Player slot.",sn.Read)]},void 0,void 0)],void 0),cn.DISABLE_TECHS=ln[63608]=new cn(63608,"disable_techs","Disables technique use for the given player.",[new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,"Player slot.",sn.Read)]},void 0,void 0)],void 0),cn.GET_GENDER=ln[63609]=new cn(63609,"get_gender","Retrieves the player's gender. 0 If male, 1 if female.",[new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,"Player slot.",sn.Read)]},void 0,void 0),new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,"Player gender.",sn.Write)]},void 0,void 0)],void 0),cn.GET_CHARA_CLASS=ln[63610]=new cn(63610,"get_chara_class","Retrieves the player's race and character class.",[new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,"Player slot.",sn.Read)]},void 0,void 0),new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,"Player race. 0 If human, 1 if newman, 2 if cast.",sn.Write),new dn(Vt,"Player class. 0 If hunter, 1 if ranger, 2 if force.",sn.Write)]},void 0,void 0)],void 0),cn.TAKE_SLOT_MESETA=ln[63611]=new cn(63611,"take_slot_meseta","Takes an amount of meseta from a player's inventory.",[new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,"Player slot.",sn.Read),new dn(Vt,"Amount of meseta to take.",sn.Read)]},void 0,void 0),new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,"Will be set to 1 if the meseta was taken, 0 otherwise.",sn.Write)]},void 0,void 0)],void 0),cn.UNKNOWN_F87C=ln[63612]=new cn(63612,"unknown_f87c",void 0,[],void 0),cn.UNKNOWN_F87D=ln[63613]=new cn(63613,"unknown_f87d",void 0,[],void 0),cn.UNKNOWN_F87E=ln[63614]=new cn(63614,"unknown_f87e",void 0,[],void 0),cn.READ_GUILDCARD_FLAG=ln[63615]=new cn(63615,"read_guildcard_flag",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Kt,void 0,sn.Write)]},void 0,void 0),new dn({kind:It.RegTupRef,register_tuples:[new dn(Kt,void 0,sn.Write)]},void 0,void 0)],void 0),cn.UNKNOWN_F880=ln[63616]=new cn(63616,"unknown_f880",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Kt,void 0,sn.Write)]},void 0,void 0)],void 0),cn.GET_PL_NAME=ln[63617]=new cn(63617,"get_pl_name","Sets the value of <pl_name> to the given player's name.",[new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,"Player slot.",sn.Read)]},void 0,void 0)],void 0),cn.UNKNOWN_F882=ln[63618]=new cn(63618,"unknown_f882",void 0,[],void 0),cn.UNKNOWN_F883=ln[63619]=new cn(63619,"unknown_f883",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Kt,void 0,sn.Write)]},void 0,void 0),new dn({kind:It.RegTupRef,register_tuples:[new dn(Kt,void 0,sn.Write)]},void 0,void 0)],void 0),cn.UNKNOWN_F884=ln[63620]=new cn(63620,"unknown_f884",void 0,[],void 0),cn.UNKNOWN_F885=ln[63621]=new cn(63621,"unknown_f885",void 0,[],void 0),cn.UNKNOWN_F886=ln[63622]=new cn(63622,"unknown_f886",void 0,[],void 0),cn.UNKNOWN_F887=ln[63623]=new cn(63623,"unknown_f887",void 0,[],void 0),cn.UNKNOWN_F888=ln[63624]=new cn(63624,"unknown_f888",void 0,[],void 0),cn.UNKNOWN_F889=ln[63625]=new cn(63625,"unknown_f889",void 0,[],void 0),cn.GET_PLAYER_STATUS=ln[63626]=new cn(63626,"get_player_status",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Kt,void 0,sn.Write)]},void 0,void 0),new dn({kind:It.RegTupRef,register_tuples:[new dn(Kt,void 0,sn.Write)]},void 0,void 0)],void 0),cn.SEND_MAIL=ln[63627]=new cn(63627,"send_mail",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Kt,void 0,sn.Read)]},void 0,void 0),new dn(Xt,void 0,void 0)],an.Pop),cn.ONLINE_CHECK=ln[63628]=new cn(63628,"online_check",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Kt,void 0,sn.Write)]},void 0,void 0)],void 0),cn.CHL_SET_TIMERECORD=ln[63629]=new cn(63629,"chl_set_timerecord",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Kt,void 0,sn.Read)]},void 0,void 0)],void 0),cn.CHL_GET_TIMERECORD=ln[63630]=new cn(63630,"chl_get_timerecord",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Kt,void 0,sn.Write)]},void 0,void 0)],void 0),cn.UNKNOWN_F88F=ln[63631]=new cn(63631,"unknown_f88f",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Kt,void 0,sn.Write)]},void 0,void 0)],void 0),cn.UNKNOWN_F890=ln[63632]=new cn(63632,"unknown_f890",void 0,[],void 0),cn.LOAD_ENEMY_DATA=ln[63633]=new cn(63633,"load_enemy_data",void 0,[new dn(Vt,void 0,void 0)],an.Pop),cn.GET_PHYSICAL_DATA=ln[63634]=new cn(63634,"get_physical_data",void 0,[new dn(Ht,void 0,void 0)],void 0),cn.GET_ATTACK_DATA=ln[63635]=new cn(63635,"get_attack_data",void 0,[new dn(Ht,void 0,void 0)],void 0),cn.GET_RESIST_DATA=ln[63636]=new cn(63636,"get_resist_data",void 0,[new dn(Ht,void 0,void 0)],void 0),cn.GET_MOVEMENT_DATA=ln[63637]=new cn(63637,"get_movement_data",void 0,[new dn(Ht,void 0,void 0)],void 0),cn.UNKNOWN_F896=ln[63638]=new cn(63638,"unknown_f896",void 0,[],void 0),cn.UNKNOWN_F897=ln[63639]=new cn(63639,"unknown_f897",void 0,[],void 0),cn.SHIFT_LEFT=ln[63640]=new cn(63640,"shift_left",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,void 0,sn.Write)]},void 0,void 0),new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,void 0,sn.Read)]},void 0,void 0)],void 0),cn.SHIFT_RIGHT=ln[63641]=new cn(63641,"shift_right",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,void 0,sn.Write)]},void 0,void 0),new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,void 0,sn.Read)]},void 0,void 0)],void 0),cn.GET_RANDOM=ln[63642]=new cn(63642,"get_random",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,void 0,sn.Read),new dn(Vt,void 0,sn.Read)]},void 0,void 0),new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,void 0,sn.Write)]},void 0,void 0)],void 0),cn.RESET_MAP=ln[63643]=new cn(63643,"reset_map","Sets all registers to 0 and resets the quest.",[],void 0),cn.DISP_CHL_RETRY_MENU=ln[63644]=new cn(63644,"disp_chl_retry_menu",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Kt,void 0,sn.Write)]},void 0,void 0)],void 0),cn.CHL_REVERSER=ln[63645]=new cn(63645,"chl_reverser",void 0,[],void 0),cn.UNKNOWN_F89E=ln[63646]=new cn(63646,"unknown_f89e",void 0,[new dn(Vt,void 0,void 0)],an.Pop),cn.UNKNOWN_F89F=ln[63647]=new cn(63647,"unknown_f89f",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Kt,void 0,sn.Write)]},void 0,void 0)],void 0),cn.UNKNOWN_F8A0=ln[63648]=new cn(63648,"unknown_f8a0",void 0,[],void 0),cn.UNKNOWN_F8A1=ln[63649]=new cn(63649,"unknown_f8a1",void 0,[],void 0),cn.UNKNOWN_F8A2=ln[63650]=new cn(63650,"unknown_f8a2",void 0,[],void 0),cn.UNKNOWN_F8A3=ln[63651]=new cn(63651,"unknown_f8a3",void 0,[],void 0),cn.UNKNOWN_F8A4=ln[63652]=new cn(63652,"unknown_f8a4",void 0,[],void 0),cn.UNKNOWN_F8A5=ln[63653]=new cn(63653,"unknown_f8a5",void 0,[],void 0),cn.UNKNOWN_F8A6=ln[63654]=new cn(63654,"unknown_f8a6",void 0,[],void 0),cn.UNKNOWN_F8A7=ln[63655]=new cn(63655,"unknown_f8a7",void 0,[],void 0),cn.UNKNOWN_F8A8=ln[63656]=new cn(63656,"unknown_f8a8",void 0,[new dn(Vt,void 0,void 0)],an.Pop),cn.UNKNOWN_F8A9=ln[63657]=new cn(63657,"unknown_f8a9",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Kt,void 0,sn.Write)]},void 0,void 0)],void 0),cn.UNKNOWN_F8AA=ln[63658]=new cn(63658,"unknown_f8aa",void 0,[],void 0),cn.UNKNOWN_F8AB=ln[63659]=new cn(63659,"unknown_f8ab",void 0,[],void 0),cn.UNKNOWN_F8AC=ln[63660]=new cn(63660,"unknown_f8ac",void 0,[],void 0),cn.GET_NUMBER_OF_PLAYER2=ln[63661]=new cn(63661,"get_number_of_player2",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Kt,void 0,sn.Write)]},void 0,void 0)],void 0),cn.UNKNOWN_F8AE=ln[63662]=new cn(63662,"unknown_f8ae",void 0,[],void 0),cn.UNKNOWN_F8AF=ln[63663]=new cn(63663,"unknown_f8af",void 0,[],void 0),cn.UNKNOWN_F8B0=ln[63664]=new cn(63664,"unknown_f8b0",void 0,[],void 0),cn.UNKNOWN_F8B1=ln[63665]=new cn(63665,"unknown_f8b1",void 0,[],void 0),cn.UNKNOWN_F8B2=ln[63666]=new cn(63666,"unknown_f8b2",void 0,[],void 0),cn.UNKNOWN_F8B3=ln[63667]=new cn(63667,"unknown_f8b3",void 0,[],void 0),cn.UNKNOWN_F8B4=ln[63668]=new cn(63668,"unknown_f8b4",void 0,[],void 0),cn.UNKNOWN_F8B5=ln[63669]=new cn(63669,"unknown_f8b5",void 0,[],void 0),cn.UNKNOWN_F8B6=ln[63670]=new cn(63670,"unknown_f8b6",void 0,[],void 0),cn.UNKNOWN_F8B7=ln[63671]=new cn(63671,"unknown_f8b7",void 0,[],void 0),cn.UNKNOWN_F8B8=ln[63672]=new cn(63672,"unknown_f8b8",void 0,[],void 0),cn.CHL_RECOVERY=ln[63673]=new cn(63673,"chl_recovery",void 0,[],void 0),cn.UNKNOWN_F8BA=ln[63674]=new cn(63674,"unknown_f8ba",void 0,[],void 0),cn.UNKNOWN_F8BB=ln[63675]=new cn(63675,"unknown_f8bb",void 0,[],void 0),cn.SET_EPISODE=ln[63676]=new cn(63676,"set_episode",void 0,[new dn(Vt,void 0,void 0)],void 0),cn.UNKNOWN_F8BD=ln[63677]=new cn(63677,"unknown_f8bd",void 0,[],void 0),cn.UNKNOWN_F8BE=ln[63678]=new cn(63678,"unknown_f8be",void 0,[],void 0),cn.UNKNOWN_F8BF=ln[63679]=new cn(63679,"unknown_f8bf",void 0,[],void 0),cn.FILE_DL_REQ=ln[63680]=new cn(63680,"file_dl_req",void 0,[new dn(Vt,void 0,void 0),new dn(Xt,void 0,void 0)],an.Pop),cn.GET_DL_STATUS=ln[63681]=new cn(63681,"get_dl_status",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Kt,void 0,sn.Write)]},void 0,void 0)],void 0),cn.GBA_UNKNOWN4=ln[63682]=new cn(63682,"gba_unknown4",void 0,[],void 0),cn.GET_GBA_STATE=ln[63683]=new cn(63683,"get_gba_state",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Kt,void 0,sn.Write)]},void 0,void 0)],void 0),cn.UNKNOWN_F8C4=ln[63684]=new cn(63684,"unknown_f8c4",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Kt,void 0,sn.Write)]},void 0,void 0)],void 0),cn.UNKNOWN_F8C5=ln[63685]=new cn(63685,"unknown_f8c5",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Kt,void 0,sn.Write)]},void 0,void 0)],void 0),cn.QEXIT=ln[63686]=new cn(63686,"qexit",void 0,[],void 0),cn.USE_ANIMATION=ln[63687]=new cn(63687,"use_animation",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,"Player slot.",sn.Read)]},void 0,void 0),new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,"Animation ID.",sn.Read),new dn(Vt,"Animation duration in number of frames.",sn.Read)]},void 0,void 0)],void 0),cn.STOP_ANIMATION=ln[63688]=new cn(63688,"stop_animation",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,"Player slot.",sn.Read)]},void 0,void 0)],void 0),cn.RUN_TO_COORD=ln[63689]=new cn(63689,"run_to_coord",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Kt,void 0,sn.Read)]},void 0,void 0),new dn({kind:It.RegTupRef,register_tuples:[new dn(Kt,void 0,sn.Read)]},void 0,void 0)],void 0),cn.SET_SLOT_INVINCIBLE=ln[63690]=new cn(63690,"set_slot_invincible",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,"Player slot.",sn.Read)]},void 0,void 0),new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,void 0,sn.Read)]},void 0,void 0)],void 0),cn.UNKNOWN_F8CB=ln[63691]=new cn(63691,"unknown_f8cb",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Kt,void 0,sn.Read)]},void 0,void 0)],void 0),cn.SET_SLOT_POISON=ln[63692]=new cn(63692,"set_slot_poison",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,"Player slot.",sn.Read)]},void 0,void 0)],void 0),cn.SET_SLOT_PARALYZE=ln[63693]=new cn(63693,"set_slot_paralyze",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,"Player slot.",sn.Read)]},void 0,void 0)],void 0),cn.SET_SLOT_SHOCK=ln[63694]=new cn(63694,"set_slot_shock",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,"Player slot.",sn.Read)]},void 0,void 0)],void 0),cn.SET_SLOT_FREEZE=ln[63695]=new cn(63695,"set_slot_freeze",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,"Player slot.",sn.Read)]},void 0,void 0)],void 0),cn.SET_SLOT_SLOW=ln[63696]=new cn(63696,"set_slot_slow",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,"Player slot.",sn.Read)]},void 0,void 0)],void 0),cn.SET_SLOT_CONFUSE=ln[63697]=new cn(63697,"set_slot_confuse",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,"Player slot.",sn.Read)]},void 0,void 0)],void 0),cn.SET_SLOT_SHIFTA=ln[63698]=new cn(63698,"set_slot_shifta",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,"Player slot.",sn.Read)]},void 0,void 0)],void 0),cn.SET_SLOT_DEBAND=ln[63699]=new cn(63699,"set_slot_deband",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,"Player slot.",sn.Read)]},void 0,void 0)],void 0),cn.SET_SLOT_JELLEN=ln[63700]=new cn(63700,"set_slot_jellen",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,"Player slot.",sn.Read)]},void 0,void 0)],void 0),cn.SET_SLOT_ZALURE=ln[63701]=new cn(63701,"set_slot_zalure",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,"Player slot.",sn.Read)]},void 0,void 0)],void 0),cn.FLETI_FIXED_CAMERA=ln[63702]=new cn(63702,"fleti_fixed_camera",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Kt,void 0,sn.Read)]},void 0,void 0)],an.Pop),cn.FLETI_LOCKED_CAMERA=ln[63703]=new cn(63703,"fleti_locked_camera",void 0,[new dn(Vt,void 0,void 0),new dn({kind:It.RegTupRef,register_tuples:[new dn(Kt,void 0,sn.Read)]},void 0,void 0)],an.Pop),cn.DEFAULT_CAMERA_POS2=ln[63704]=new cn(63704,"default_camera_pos2",void 0,[],void 0),cn.SET_MOTION_BLUR=ln[63705]=new cn(63705,"set_motion_blur",void 0,[],void 0),cn.SET_SCREEN_BW=ln[63706]=new cn(63706,"set_screen_bw",void 0,[],void 0),cn.UNKNOWN_F8DB=ln[63707]=new cn(63707,"unknown_f8db",void 0,[new dn(Vt,void 0,void 0),new dn(Vt,void 0,void 0),new dn(Vt,void 0,void 0),new dn(Vt,void 0,void 0),new dn({kind:It.RegTupRef,register_tuples:[new dn(Kt,void 0,sn.Read)]},void 0,void 0),new dn(Ht,void 0,void 0)],an.Pop),cn.NPC_ACTION_STRING=ln[63708]=new cn(63708,"npc_action_string",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,void 0,sn.Read)]},void 0,void 0),new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,void 0,sn.Read)]},void 0,void 0),new dn(Zt,void 0,void 0)],void 0),cn.GET_PAD_COND=ln[63709]=new cn(63709,"get_pad_cond",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Kt,void 0,sn.Write)]},void 0,void 0),new dn({kind:It.RegTupRef,register_tuples:[new dn(Kt,void 0,sn.Write)]},void 0,void 0)],void 0),cn.GET_BUTTON_COND=ln[63710]=new cn(63710,"get_button_cond",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Kt,void 0,sn.Write)]},void 0,void 0),new dn({kind:It.RegTupRef,register_tuples:[new dn(Kt,void 0,sn.Write)]},void 0,void 0)],void 0),cn.FREEZE_ENEMIES=ln[63711]=new cn(63711,"freeze_enemies",void 0,[],void 0),cn.UNFREEZE_ENEMIES=ln[63712]=new cn(63712,"unfreeze_enemies",void 0,[],void 0),cn.FREEZE_EVERYTHING=ln[63713]=new cn(63713,"freeze_everything",void 0,[],void 0),cn.UNFREEZE_EVERYTHING=ln[63714]=new cn(63714,"unfreeze_everything",void 0,[],void 0),cn.RESTORE_HP=ln[63715]=new cn(63715,"restore_hp",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Kt,void 0,sn.Read)]},void 0,void 0)],void 0),cn.RESTORE_TP=ln[63716]=new cn(63716,"restore_tp",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Kt,void 0,sn.Read)]},void 0,void 0)],void 0),cn.CLOSE_CHAT_BUBBLE=ln[63717]=new cn(63717,"close_chat_bubble",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Kt,void 0,sn.Read)]},void 0,void 0)],void 0),cn.MOVE_COORDS_OBJECT=ln[63718]=new cn(63718,"move_coords_object",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Kt,void 0,sn.Read)]},void 0,void 0),new dn({kind:It.RegTupRef,register_tuples:[new dn(Kt,void 0,sn.Read)]},void 0,void 0)],void 0),cn.AT_COORDS_CALL_EX=ln[63719]=new cn(63719,"at_coords_call_ex",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Kt,void 0,sn.Read)]},void 0,void 0),new dn({kind:It.RegTupRef,register_tuples:[new dn(Kt,void 0,sn.Read)]},void 0,void 0)],void 0),cn.UNKNOWN_F8E8=ln[63720]=new cn(63720,"unknown_f8e8",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Kt,void 0,sn.Read)]},void 0,void 0),new dn({kind:It.RegTupRef,register_tuples:[new dn(Kt,void 0,sn.Read)]},void 0,void 0)],void 0),cn.UNKNOWN_F8E9=ln[63721]=new cn(63721,"unknown_f8e9",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Kt,void 0,sn.Read)]},void 0,void 0),new dn({kind:It.RegTupRef,register_tuples:[new dn(Kt,void 0,sn.Read)]},void 0,void 0)],void 0),cn.UNKNOWN_F8EA=ln[63722]=new cn(63722,"unknown_f8ea",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Kt,void 0,sn.Read)]},void 0,void 0),new dn({kind:It.RegTupRef,register_tuples:[new dn(Kt,void 0,sn.Read)]},void 0,void 0)],void 0),cn.UNKNOWN_F8EB=ln[63723]=new cn(63723,"unknown_f8eb",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Kt,void 0,sn.Read)]},void 0,void 0),new dn({kind:It.RegTupRef,register_tuples:[new dn(Kt,void 0,sn.Read)]},void 0,void 0)],void 0),cn.UNKNOWN_F8EC=ln[63724]=new cn(63724,"unknown_f8ec",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Kt,void 0,sn.Read)]},void 0,void 0),new dn({kind:It.RegTupRef,register_tuples:[new dn(Kt,void 0,sn.Read)]},void 0,void 0)],void 0),cn.ANIMATION_CHECK=ln[63725]=new cn(63725,"animation_check",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Kt,void 0,sn.Read)]},void 0,void 0),new dn({kind:It.RegTupRef,register_tuples:[new dn(Kt,void 0,sn.Read)]},void 0,void 0)],void 0),cn.CALL_IMAGE_DATA=ln[63726]=new cn(63726,"call_image_data",void 0,[new dn(Vt,void 0,void 0),new dn(Ht,void 0,void 0)],an.Pop),cn.UNKNOWN_F8EF=ln[63727]=new cn(63727,"unknown_f8ef",void 0,[],void 0),cn.TURN_OFF_BGM_P2=ln[63728]=new cn(63728,"turn_off_bgm_p2",void 0,[],void 0),cn.TURN_ON_BGM_P2=ln[63729]=new cn(63729,"turn_on_bgm_p2",void 0,[],void 0),cn.LOAD_UNK_DATA=ln[63730]=new cn(63730,"load_unk_data",void 0,[new dn(Vt,void 0,void 0),new dn(Vt,void 0,void 0),new dn(Vt,void 0,void 0),new dn(Vt,void 0,void 0),new dn({kind:It.RegTupRef,register_tuples:[new dn(Kt,void 0,sn.Read)]},void 0,void 0),new dn(Yt,void 0,void 0)],an.Pop),cn.PARTICLE2=ln[63731]=new cn(63731,"particle2",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Kt,void 0,sn.Read)]},void 0,void 0),new dn(Vt,void 0,void 0),new dn(qt,void 0,void 0)],an.Pop),cn.UNKNOWN_F8F4=ln[63732]=new cn(63732,"unknown_f8f4",void 0,[],void 0),cn.UNKNOWN_F8F5=ln[63733]=new cn(63733,"unknown_f8f5",void 0,[],void 0),cn.UNKNOWN_F8F6=ln[63734]=new cn(63734,"unknown_f8f6",void 0,[],void 0),cn.UNKNOWN_F8F7=ln[63735]=new cn(63735,"unknown_f8f7",void 0,[],void 0),cn.UNKNOWN_F8F8=ln[63736]=new cn(63736,"unknown_f8f8",void 0,[],void 0),cn.UNKNOWN_F8F9=ln[63737]=new cn(63737,"unknown_f8f9",void 0,[],void 0),cn.UNKNOWN_F8FA=ln[63738]=new cn(63738,"unknown_f8fa",void 0,[],void 0),cn.UNKNOWN_F8FB=ln[63739]=new cn(63739,"unknown_f8fb",void 0,[],void 0),cn.UNKNOWN_F8FC=ln[63740]=new cn(63740,"unknown_f8fc",void 0,[],void 0),cn.UNKNOWN_F8FD=ln[63741]=new cn(63741,"unknown_f8fd",void 0,[],void 0),cn.UNKNOWN_F8FE=ln[63742]=new cn(63742,"unknown_f8fe",void 0,[],void 0),cn.UNKNOWN_F8FF=ln[63743]=new cn(63743,"unknown_f8ff",void 0,[],void 0),cn.UNKNOWN_F900=ln[63744]=new cn(63744,"unknown_f900",void 0,[],void 0),cn.DEC2FLOAT=ln[63745]=new cn(63745,"dec2float",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(qt,void 0,sn.Write)]},void 0,void 0),new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,void 0,sn.Read)]},void 0,void 0)],void 0),cn.FLOAT2DEC=ln[63746]=new cn(63746,"float2dec",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,void 0,sn.Write)]},void 0,void 0),new dn({kind:It.RegTupRef,register_tuples:[new dn(qt,void 0,sn.Read)]},void 0,void 0)],void 0),cn.FLET=ln[63747]=new cn(63747,"flet",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(qt,void 0,sn.Write)]},void 0,void 0),new dn({kind:It.RegTupRef,register_tuples:[new dn(qt,void 0,sn.Read)]},void 0,void 0)],void 0),cn.FLETI=ln[63748]=new cn(63748,"fleti",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(qt,void 0,sn.Write)]},void 0,void 0),new dn(qt,void 0,void 0)],void 0),cn.UNKNOWN_F905=ln[63749]=new cn(63749,"unknown_f905",void 0,[],void 0),cn.UNKNOWN_F906=ln[63750]=new cn(63750,"unknown_f906",void 0,[],void 0),cn.UNKNOWN_F907=ln[63751]=new cn(63751,"unknown_f907",void 0,[],void 0),cn.FADD=ln[63752]=new cn(63752,"fadd",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(qt,void 0,sn.Write)]},void 0,void 0),new dn({kind:It.RegTupRef,register_tuples:[new dn(qt,void 0,sn.Read)]},void 0,void 0)],void 0),cn.FADDI=ln[63753]=new cn(63753,"faddi",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(qt,void 0,sn.Write)]},void 0,void 0),new dn(qt,void 0,void 0)],void 0),cn.FSUB=ln[63754]=new cn(63754,"fsub",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(qt,void 0,sn.Write)]},void 0,void 0),new dn({kind:It.RegTupRef,register_tuples:[new dn(qt,void 0,sn.Read)]},void 0,void 0)],void 0),cn.FSUBI=ln[63755]=new cn(63755,"fsubi",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(qt,void 0,sn.Write)]},void 0,void 0),new dn(qt,void 0,void 0)],void 0),cn.FMUL=ln[63756]=new cn(63756,"fmul",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(qt,void 0,sn.Write)]},void 0,void 0),new dn({kind:It.RegTupRef,register_tuples:[new dn(qt,void 0,sn.Read)]},void 0,void 0)],void 0),cn.FMULI=ln[63757]=new cn(63757,"fmuli",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(qt,void 0,sn.Write)]},void 0,void 0),new dn(qt,void 0,void 0)],void 0),cn.FDIV=ln[63758]=new cn(63758,"fdiv",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(qt,void 0,sn.Write)]},void 0,void 0),new dn({kind:It.RegTupRef,register_tuples:[new dn(qt,void 0,sn.Read)]},void 0,void 0)],void 0),cn.FDIVI=ln[63759]=new cn(63759,"fdivi",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(qt,void 0,sn.Write)]},void 0,void 0),new dn(qt,void 0,void 0)],void 0),cn.GET_UNKNOWN_COUNT=ln[63760]=new cn(63760,"get_unknown_count",void 0,[new dn(Vt,void 0,void 0),new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,void 0,sn.Write)]},void 0,void 0)],an.Pop),cn.GET_STACKABLE_ITEM_COUNT=ln[63761]=new cn(63761,"get_stackable_item_count",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,"Player slot.",sn.Read),new dn(Vt,void 0,sn.Read),new dn(Vt,void 0,sn.Read),new dn(Vt,void 0,sn.Read)]},void 0,void 0),new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,void 0,sn.Write)]},void 0,void 0)],void 0),cn.FREEZE_AND_HIDE_EQUIP=ln[63762]=new cn(63762,"freeze_and_hide_equip",void 0,[],void 0),cn.THAW_AND_SHOW_EQUIP=ln[63763]=new cn(63763,"thaw_and_show_equip",void 0,[],void 0),cn.SET_PALETTEX_CALLBACK=ln[63764]=new cn(63764,"set_palettex_callback",void 0,[new dn(Vt,"Player slot.",void 0),new dn(Jt,void 0,void 0)],an.Pop),cn.ACTIVATE_PALETTEX=ln[63765]=new cn(63765,"activate_palettex",void 0,[new dn(Vt,"Player slot.",void 0)],an.Pop),cn.ENABLE_PALETTEX=ln[63766]=new cn(63766,"enable_palettex",void 0,[new dn(Vt,"Player slot.",void 0)],an.Pop),cn.RESTORE_PALETTEX=ln[63767]=new cn(63767,"restore_palettex",void 0,[new dn(Vt,"Player slot.",void 0)],an.Pop),cn.DISABLE_PALETTEX=ln[63768]=new cn(63768,"disable_palettex",void 0,[new dn(Vt,"Player slot.",void 0)],an.Pop),cn.GET_PALETTEX_ACTIVATED=ln[63769]=new cn(63769,"get_palettex_activated",void 0,[new dn(Vt,"Player slot.",void 0),new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,void 0,sn.Write)]},void 0,void 0)],an.Pop),cn.GET_UNKNOWN_PALETTEX_STATUS=ln[63770]=new cn(63770,"get_unknown_palettex_status",void 0,[new dn(Vt,void 0,void 0),new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,void 0,sn.Write)]},void 0,void 0)],an.Pop),cn.DISABLE_MOVEMENT2=ln[63771]=new cn(63771,"disable_movement2",void 0,[new dn(Vt,"Player slot.",void 0)],an.Pop),cn.ENABLE_MOVEMENT2=ln[63772]=new cn(63772,"enable_movement2",void 0,[new dn(Vt,"Player slot.",void 0)],an.Pop),cn.GET_TIME_PLAYED=ln[63773]=new cn(63773,"get_time_played",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,void 0,sn.Write)]},void 0,void 0)],void 0),cn.GET_GUILDCARD_TOTAL=ln[63774]=new cn(63774,"get_guildcard_total",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,void 0,sn.Write)]},void 0,void 0)],void 0),cn.GET_SLOT_MESETA=ln[63775]=new cn(63775,"get_slot_meseta",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,void 0,sn.Write)]},void 0,void 0)],void 0),cn.GET_PLAYER_LEVEL=ln[63776]=new cn(63776,"get_player_level",void 0,[new dn(Vt,"Player slot.",void 0),new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,void 0,sn.Write)]},void 0,void 0)],an.Pop),cn.GET_SECTION_ID=ln[63777]=new cn(63777,"get_section_id",void 0,[new dn(Vt,"Player slot.",void 0),new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,void 0,sn.Write)]},void 0,void 0)],an.Pop),cn.GET_PLAYER_HP=ln[63778]=new cn(63778,"get_player_hp",void 0,[new dn(Vt,"Player slot.",void 0),new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,"Maximum HP.",sn.Write),new dn(Vt,"Current HP.",sn.Write),new dn(Vt,"Maximum TP.",sn.Write),new dn(Vt,"Current TP.",sn.Write)]},void 0,void 0)],an.Pop),cn.GET_FLOOR_NUMBER=ln[63779]=new cn(63779,"get_floor_number",void 0,[new dn(Vt,"Player slot.",void 0),new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,void 0,sn.Write)]},void 0,void 0)],an.Pop),cn.GET_COORD_PLAYER_DETECT=ln[63780]=new cn(63780,"get_coord_player_detect",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Kt,"Player slot.",sn.Read)]},void 0,void 0),new dn({kind:It.RegTupRef,register_tuples:[new dn(Kt,void 0,sn.Read)]},void 0,void 0)],void 0),cn.READ_GLOBAL_FLAG=ln[63781]=new cn(63781,"read_global_flag",void 0,[new dn(Vt,void 0,void 0),new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,void 0,sn.Write)]},void 0,void 0)],an.Pop),cn.WRITE_GLOBAL_FLAG=ln[63782]=new cn(63782,"write_global_flag",void 0,[new dn(Vt,void 0,void 0),new dn(Vt,void 0,void 0)],an.Pop),cn.UNKNOWN_F927=ln[63783]=new cn(63783,"unknown_f927",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Kt,void 0,sn.Write)]},void 0,void 0),new dn({kind:It.RegTupRef,register_tuples:[new dn(Kt,void 0,sn.Write)]},void 0,void 0)],void 0),cn.FLOOR_PLAYER_DETECT=ln[63784]=new cn(63784,"floor_player_detect",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,void 0,sn.Write),new dn(Vt,void 0,sn.Write),new dn(Vt,void 0,sn.Write),new dn(Vt,void 0,sn.Write)]},void 0,void 0)],void 0),cn.READ_DISK_FILE=ln[63785]=new cn(63785,"read_disk_file",void 0,[new dn(Xt,void 0,void 0)],an.Pop),cn.OPEN_PACK_SELECT=ln[63786]=new cn(63786,"open_pack_select",void 0,[],void 0),cn.ITEM_SELECT=ln[63787]=new cn(63787,"item_select",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Kt,void 0,sn.Write)]},void 0,void 0)],void 0),cn.GET_ITEM_ID=ln[63788]=new cn(63788,"get_item_id",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Kt,void 0,sn.Write)]},void 0,void 0)],void 0),cn.COLOR_CHANGE=ln[63789]=new cn(63789,"color_change",void 0,[new dn(Vt,void 0,void 0),new dn(Vt,void 0,void 0),new dn(Vt,void 0,void 0),new dn(Vt,void 0,void 0),new dn(Vt,void 0,void 0)],an.Pop),cn.SEND_STATISTIC=ln[63790]=new cn(63790,"send_statistic",void 0,[new dn(Vt,void 0,void 0),new dn(Vt,void 0,void 0),new dn(Vt,void 0,void 0),new dn(Vt,void 0,void 0),new dn(Vt,void 0,void 0),new dn(Vt,void 0,void 0),new dn(Vt,void 0,void 0),new dn(Vt,void 0,void 0)],an.Pop),cn.UNKNOWN_F92F=ln[63791]=new cn(63791,"unknown_f92f",void 0,[new dn(Vt,void 0,void 0),new dn(Vt,void 0,void 0)],an.Pop),cn.CHAT_BOX=ln[63792]=new cn(63792,"chat_box",void 0,[new dn(Vt,void 0,void 0),new dn(Vt,void 0,void 0),new dn(Vt,void 0,void 0),new dn(Vt,void 0,void 0),new dn(Vt,void 0,void 0),new dn(Xt,void 0,void 0)],an.Pop),cn.CHAT_BUBBLE=ln[63793]=new cn(63793,"chat_bubble",void 0,[new dn(Vt,void 0,void 0),new dn(Xt,void 0,void 0)],an.Pop),cn.UNKNOWN_F932=ln[63794]=new cn(63794,"unknown_f932",void 0,[],void 0),cn.UNKNOWN_F933=ln[63795]=new cn(63795,"unknown_f933",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Kt,void 0,sn.Write)]},void 0,void 0)],void 0),cn.SCROLL_TEXT=ln[63796]=new cn(63796,"scroll_text",void 0,[new dn(Vt,void 0,void 0),new dn(Vt,void 0,void 0),new dn(Vt,void 0,void 0),new dn(Vt,void 0,void 0),new dn(Vt,void 0,void 0),new dn(qt,void 0,void 0),new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,void 0,sn.Write)]},void 0,void 0),new dn(Xt,void 0,void 0)],an.Pop),cn.GBA_UNKNOWN1=ln[63797]=new cn(63797,"gba_unknown1",void 0,[],void 0),cn.GBA_UNKNOWN2=ln[63798]=new cn(63798,"gba_unknown2",void 0,[],void 0),cn.GBA_UNKNOWN3=ln[63799]=new cn(63799,"gba_unknown3",void 0,[],void 0),cn.ADD_DAMAGE_TO=ln[63800]=new cn(63800,"add_damage_to",void 0,[new dn(Vt,void 0,void 0),new dn(Vt,void 0,void 0)],an.Pop),cn.ITEM_DELETE3=ln[63801]=new cn(63801,"item_delete3",void 0,[new dn(Vt,void 0,void 0)],an.Pop),cn.GET_ITEM_INFO=ln[63802]=new cn(63802,"get_item_info",void 0,[new dn(Vt,void 0,void 0),new dn({kind:It.RegTupRef,register_tuples:[new dn(Kt,void 0,sn.Write)]},void 0,void 0)],an.Pop),cn.ITEM_PACKING1=ln[63803]=new cn(63803,"item_packing1",void 0,[new dn(Vt,void 0,void 0)],an.Pop),cn.ITEM_PACKING2=ln[63804]=new cn(63804,"item_packing2",void 0,[new dn(Vt,void 0,void 0),new dn(Vt,void 0,void 0)],an.Pop),cn.GET_LANG_SETTING=ln[63805]=new cn(63805,"get_lang_setting",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Kt,void 0,sn.Write)]},void 0,void 0)],an.Pop),cn.PREPARE_STATISTIC=ln[63806]=new cn(63806,"prepare_statistic",void 0,[new dn(Vt,void 0,void 0),new dn(Jt,void 0,void 0),new dn(Jt,void 0,void 0)],an.Pop),cn.KEYWORD_DETECT=ln[63807]=new cn(63807,"keyword_detect",void 0,[],void 0),cn.KEYWORD=ln[63808]=new cn(63808,"keyword",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,void 0,sn.Write)]},void 0,void 0),new dn(Vt,"Player slot.",void 0),new dn(Xt,void 0,void 0)],an.Pop),cn.GET_GUILDCARD_NUM=ln[63809]=new cn(63809,"get_guildcard_num",void 0,[new dn(Vt,"Player slot.",void 0),new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,void 0,sn.Write)]},void 0,void 0)],an.Pop),cn.UNKNOWN_F942=ln[63810]=new cn(63810,"unknown_f942",void 0,[],void 0),cn.UNKNOWN_F943=ln[63811]=new cn(63811,"unknown_f943",void 0,[],void 0),cn.GET_WRAP_STATUS=ln[63812]=new cn(63812,"get_wrap_status",void 0,[new dn(Vt,"Player slot.",void 0),new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,void 0,sn.Write)]},void 0,void 0)],an.Pop),cn.INITIAL_FLOOR=ln[63813]=new cn(63813,"initial_floor",void 0,[new dn(Vt,void 0,void 0)],an.Pop),cn.SIN=ln[63814]=new cn(63814,"sin",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,void 0,sn.Write)]},void 0,void 0),new dn(Vt,void 0,void 0)],an.Pop),cn.COS=ln[63815]=new cn(63815,"cos",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,void 0,sn.Write)]},void 0,void 0),new dn(Vt,void 0,void 0)],an.Pop),cn.UNKNOWN_F948=ln[63816]=new cn(63816,"unknown_f948",void 0,[],void 0),cn.UNKNOWN_F949=ln[63817]=new cn(63817,"unknown_f949",void 0,[],void 0),cn.BOSS_IS_DEAD2=ln[63818]=new cn(63818,"boss_is_dead2",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,void 0,sn.Write)]},void 0,void 0)],void 0),cn.UNKNOWN_F94B=ln[63819]=new cn(63819,"unknown_f94b",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,void 0,sn.Write)]},void 0,void 0)],void 0),cn.UNKNOWN_F94C=ln[63820]=new cn(63820,"unknown_f94c",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,void 0,sn.Write)]},void 0,void 0)],void 0),cn.IS_THERE_CARDBATTLE=ln[63821]=new cn(63821,"is_there_cardbattle",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,void 0,sn.Write)]},void 0,void 0)],void 0),cn.UNKNOWN_F94E=ln[63822]=new cn(63822,"unknown_f94e",void 0,[],void 0),cn.UNKNOWN_F94F=ln[63823]=new cn(63823,"unknown_f94f",void 0,[],void 0),cn.BB_P2_MENU=ln[63824]=new cn(63824,"bb_p2_menu",void 0,[new dn(Vt,void 0,void 0)],an.Pop),cn.BB_MAP_DESIGNATE=ln[63825]=new cn(63825,"bb_map_designate",void 0,[new dn(zt,void 0,void 0),new dn(Ht,void 0,void 0),new dn(zt,void 0,void 0),new dn(zt,void 0,void 0)],void 0),cn.BB_GET_NUMBER_IN_PACK=ln[63826]=new cn(63826,"bb_get_number_in_pack",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,void 0,sn.Write)]},void 0,void 0)],void 0),cn.BB_SWAP_ITEM=ln[63827]=new cn(63827,"bb_swap_item",void 0,[new dn(Vt,void 0,void 0),new dn(Vt,void 0,void 0),new dn(Vt,void 0,void 0),new dn(Vt,void 0,void 0),new dn(Vt,void 0,void 0),new dn(Vt,void 0,void 0),new dn(Jt,void 0,void 0),new dn(Jt,void 0,void 0)],an.Pop),cn.BB_CHECK_WRAP=ln[63828]=new cn(63828,"bb_check_wrap",void 0,[new dn(Vt,void 0,void 0),new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,void 0,sn.Write)]},void 0,void 0)],an.Pop),cn.BB_EXCHANGE_PD_ITEM=ln[63829]=new cn(63829,"bb_exchange_pd_item",void 0,[new dn(Vt,void 0,void 0),new dn(Vt,void 0,void 0),new dn(Vt,void 0,void 0),new dn(Jt,void 0,void 0),new dn(Jt,void 0,void 0)],an.Pop),cn.BB_EXCHANGE_PD_SRANK=ln[63830]=new cn(63830,"bb_exchange_pd_srank",void 0,[new dn(Vt,void 0,void 0),new dn(Vt,void 0,void 0),new dn(Vt,void 0,void 0),new dn(Vt,void 0,void 0),new dn(Vt,void 0,void 0),new dn(Jt,void 0,void 0),new dn(Jt,void 0,void 0)],an.Pop),cn.BB_EXCHANGE_PD_SPECIAL=ln[63831]=new cn(63831,"bb_exchange_pd_special",void 0,[new dn(Vt,void 0,void 0),new dn(Vt,void 0,void 0),new dn(Vt,void 0,void 0),new dn(Vt,void 0,void 0),new dn(Vt,void 0,void 0),new dn(Vt,void 0,void 0),new dn(Jt,void 0,void 0),new dn(Jt,void 0,void 0)],an.Pop),cn.BB_EXCHANGE_PD_PERCENT=ln[63832]=new cn(63832,"bb_exchange_pd_percent",void 0,[new dn(Vt,void 0,void 0),new dn(Vt,void 0,void 0),new dn(Vt,void 0,void 0),new dn(Vt,void 0,void 0),new dn(Vt,void 0,void 0),new dn(Vt,void 0,void 0),new dn(Jt,void 0,void 0),new dn(Jt,void 0,void 0)],an.Pop),cn.UNKNOWN_F959=ln[63833]=new cn(63833,"unknown_f959",void 0,[new dn(Vt,void 0,void 0)],an.Pop),cn.UNKNOWN_F95A=ln[63834]=new cn(63834,"unknown_f95a",void 0,[],void 0),cn.UNKNOWN_F95B=ln[63835]=new cn(63835,"unknown_f95b",void 0,[],void 0),cn.BB_EXCHANGE_SLT=ln[63836]=new cn(63836,"bb_exchange_slt",void 0,[new dn(Vt,void 0,void 0),new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,void 0,sn.Write)]},void 0,void 0),new dn(Jt,void 0,void 0),new dn(Jt,void 0,void 0)],an.Pop),cn.BB_EXCHANGE_PC=ln[63837]=new cn(63837,"bb_exchange_pc",void 0,[],void 0),cn.BB_BOX_CREATE_BP=ln[63838]=new cn(63838,"bb_box_create_bp",void 0,[new dn(Vt,void 0,void 0),new dn(qt,void 0,void 0),new dn(qt,void 0,void 0)],an.Pop),cn.BB_EXCHANGE_PT=ln[63839]=new cn(63839,"bb_exchange_pt",void 0,[new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,void 0,sn.Write)]},void 0,void 0),new dn({kind:It.RegTupRef,register_tuples:[new dn(Vt,void 0,sn.Write)]},void 0,void 0),new dn(Vt,void 0,void 0),new dn(Jt,void 0,void 0),new dn(Jt,void 0,void 0)],an.Pop),cn.UNKNOWN_F960=ln[63840]=new cn(63840,"unknown_f960",void 0,[new dn(Vt,void 0,void 0)],an.Pop),cn.UNKNOWN_F961=ln[63841]=new cn(63841,"unknown_f961",void 0,[],void 0),cn.UNKNOWN_F962=ln[63842]=new cn(63842,"unknown_f962",void 0,[],void 0),cn.UNKNOWN_F963=ln[63843]=new cn(63843,"unknown_f963",void 0,[],void 0),cn.UNKNOWN_F964=ln[63844]=new cn(63844,"unknown_f964",void 0,[],void 0),cn.UNKNOWN_F965=ln[63845]=new cn(63845,"unknown_f965",void 0,[],void 0),cn.UNKNOWN_F966=ln[63846]=new cn(63846,"unknown_f966",void 0,[],void 0),cn.UNKNOWN_F967=ln[63847]=new cn(63847,"unknown_f967",void 0,[],void 0),cn.UNKNOWN_F968=ln[63848]=new cn(63848,"unknown_f968",void 0,[],void 0),cn.UNKNOWN_F969=ln[63849]=new cn(63849,"unknown_f969",void 0,[],void 0),cn.UNKNOWN_F96A=ln[63850]=new cn(63850,"unknown_f96a",void 0,[],void 0),cn.UNKNOWN_F96B=ln[63851]=new cn(63851,"unknown_f96b",void 0,[],void 0),cn.UNKNOWN_F96C=ln[63852]=new cn(63852,"unknown_f96c",void 0,[],void 0),cn.UNKNOWN_F96D=ln[63853]=new cn(63853,"unknown_f96d",void 0,[],void 0),cn.UNKNOWN_F96E=ln[63854]=new cn(63854,"unknown_f96e",void 0,[],void 0),cn.UNKNOWN_F96F=ln[63855]=new cn(63855,"unknown_f96f",void 0,[],void 0),cn.UNKNOWN_F970=ln[63856]=new cn(63856,"unknown_f970",void 0,[],void 0),cn.UNKNOWN_F971=ln[63857]=new cn(63857,"unknown_f971",void 0,[],void 0),cn.UNKNOWN_F972=ln[63858]=new cn(63858,"unknown_f972",void 0,[],void 0),cn.UNKNOWN_F973=ln[63859]=new cn(63859,"unknown_f973",void 0,[],void 0),cn.UNKNOWN_F974=ln[63860]=new cn(63860,"unknown_f974",void 0,[],void 0),cn.UNKNOWN_F975=ln[63861]=new cn(63861,"unknown_f975",void 0,[],void 0),cn.UNKNOWN_F976=ln[63862]=new cn(63862,"unknown_f976",void 0,[],void 0),cn.UNKNOWN_F977=ln[63863]=new cn(63863,"unknown_f977",void 0,[],void 0),cn.UNKNOWN_F978=ln[63864]=new cn(63864,"unknown_f978",void 0,[],void 0),cn.UNKNOWN_F979=ln[63865]=new cn(63865,"unknown_f979",void 0,[],void 0),cn.UNKNOWN_F97A=ln[63866]=new cn(63866,"unknown_f97a",void 0,[],void 0),cn.UNKNOWN_F97B=ln[63867]=new cn(63867,"unknown_f97b",void 0,[],void 0),cn.UNKNOWN_F97C=ln[63868]=new cn(63868,"unknown_f97c",void 0,[],void 0),cn.UNKNOWN_F97D=ln[63869]=new cn(63869,"unknown_f97d",void 0,[],void 0),cn.UNKNOWN_F97E=ln[63870]=new cn(63870,"unknown_f97e",void 0,[],void 0),cn.UNKNOWN_F97F=ln[63871]=new cn(63871,"unknown_f97f",void 0,[],void 0),cn.UNKNOWN_F980=ln[63872]=new cn(63872,"unknown_f980",void 0,[],void 0),cn.UNKNOWN_F981=ln[63873]=new cn(63873,"unknown_f981",void 0,[],void 0),cn.UNKNOWN_F982=ln[63874]=new cn(63874,"unknown_f982",void 0,[],void 0),cn.UNKNOWN_F983=ln[63875]=new cn(63875,"unknown_f983",void 0,[],void 0),cn.UNKNOWN_F984=ln[63876]=new cn(63876,"unknown_f984",void 0,[],void 0),cn.UNKNOWN_F985=ln[63877]=new cn(63877,"unknown_f985",void 0,[],void 0),cn.UNKNOWN_F986=ln[63878]=new cn(63878,"unknown_f986",void 0,[],void 0),cn.UNKNOWN_F987=ln[63879]=new cn(63879,"unknown_f987",void 0,[],void 0),cn.UNKNOWN_F988=ln[63880]=new cn(63880,"unknown_f988",void 0,[],void 0),cn.UNKNOWN_F989=ln[63881]=new cn(63881,"unknown_f989",void 0,[],void 0),cn.UNKNOWN_F98A=ln[63882]=new cn(63882,"unknown_f98a",void 0,[],void 0),cn.UNKNOWN_F98B=ln[63883]=new cn(63883,"unknown_f98b",void 0,[],void 0),cn.UNKNOWN_F98C=ln[63884]=new cn(63884,"unknown_f98c",void 0,[],void 0),cn.UNKNOWN_F98D=ln[63885]=new cn(63885,"unknown_f98d",void 0,[],void 0),cn.UNKNOWN_F98E=ln[63886]=new cn(63886,"unknown_f98e",void 0,[],void 0),cn.UNKNOWN_F98F=ln[63887]=new cn(63887,"unknown_f98f",void 0,[],void 0),cn.UNKNOWN_F990=ln[63888]=new cn(63888,"unknown_f990",void 0,[],void 0),cn.UNKNOWN_F991=ln[63889]=new cn(63889,"unknown_f991",void 0,[],void 0),cn.UNKNOWN_F992=ln[63890]=new cn(63890,"unknown_f992",void 0,[],void 0),cn.UNKNOWN_F993=ln[63891]=new cn(63891,"unknown_f993",void 0,[],void 0),cn.UNKNOWN_F994=ln[63892]=new cn(63892,"unknown_f994",void 0,[],void 0),cn.UNKNOWN_F995=ln[63893]=new cn(63893,"unknown_f995",void 0,[],void 0),cn.UNKNOWN_F996=ln[63894]=new cn(63894,"unknown_f996",void 0,[],void 0),cn.UNKNOWN_F997=ln[63895]=new cn(63895,"unknown_f997",void 0,[],void 0),cn.UNKNOWN_F998=ln[63896]=new cn(63896,"unknown_f998",void 0,[],void 0),cn.UNKNOWN_F999=ln[63897]=new cn(63897,"unknown_f999",void 0,[],void 0),cn.UNKNOWN_F99A=ln[63898]=new cn(63898,"unknown_f99a",void 0,[],void 0),cn.UNKNOWN_F99B=ln[63899]=new cn(63899,"unknown_f99b",void 0,[],void 0),cn.UNKNOWN_F99C=ln[63900]=new cn(63900,"unknown_f99c",void 0,[],void 0),cn.UNKNOWN_F99D=ln[63901]=new cn(63901,"unknown_f99d",void 0,[],void 0),cn.UNKNOWN_F99E=ln[63902]=new cn(63902,"unknown_f99e",void 0,[],void 0),cn.UNKNOWN_F99F=ln[63903]=new cn(63903,"unknown_f99f",void 0,[],void 0),cn.UNKNOWN_F9A0=ln[63904]=new cn(63904,"unknown_f9a0",void 0,[],void 0),cn.UNKNOWN_F9A1=ln[63905]=new cn(63905,"unknown_f9a1",void 0,[],void 0),cn.UNKNOWN_F9A2=ln[63906]=new cn(63906,"unknown_f9a2",void 0,[],void 0),cn.UNKNOWN_F9A3=ln[63907]=new cn(63907,"unknown_f9a3",void 0,[],void 0),cn.UNKNOWN_F9A4=ln[63908]=new cn(63908,"unknown_f9a4",void 0,[],void 0),cn.UNKNOWN_F9A5=ln[63909]=new cn(63909,"unknown_f9a5",void 0,[],void 0),cn.UNKNOWN_F9A6=ln[63910]=new cn(63910,"unknown_f9a6",void 0,[],void 0),cn.UNKNOWN_F9A7=ln[63911]=new cn(63911,"unknown_f9a7",void 0,[],void 0),cn.UNKNOWN_F9A8=ln[63912]=new cn(63912,"unknown_f9a8",void 0,[],void 0),cn.UNKNOWN_F9A9=ln[63913]=new cn(63913,"unknown_f9a9",void 0,[],void 0),cn.UNKNOWN_F9AA=ln[63914]=new cn(63914,"unknown_f9aa",void 0,[],void 0),cn.UNKNOWN_F9AB=ln[63915]=new cn(63915,"unknown_f9ab",void 0,[],void 0),cn.UNKNOWN_F9AC=ln[63916]=new cn(63916,"unknown_f9ac",void 0,[],void 0),cn.UNKNOWN_F9AD=ln[63917]=new cn(63917,"unknown_f9ad",void 0,[],void 0),cn.UNKNOWN_F9AE=ln[63918]=new cn(63918,"unknown_f9ae",void 0,[],void 0),cn.UNKNOWN_F9AF=ln[63919]=new cn(63919,"unknown_f9af",void 0,[],void 0),cn.UNKNOWN_F9B0=ln[63920]=new cn(63920,"unknown_f9b0",void 0,[],void 0),cn.UNKNOWN_F9B1=ln[63921]=new cn(63921,"unknown_f9b1",void 0,[],void 0),cn.UNKNOWN_F9B2=ln[63922]=new cn(63922,"unknown_f9b2",void 0,[],void 0),cn.UNKNOWN_F9B3=ln[63923]=new cn(63923,"unknown_f9b3",void 0,[],void 0),cn.UNKNOWN_F9B4=ln[63924]=new cn(63924,"unknown_f9b4",void 0,[],void 0),cn.UNKNOWN_F9B5=ln[63925]=new cn(63925,"unknown_f9b5",void 0,[],void 0),cn.UNKNOWN_F9B6=ln[63926]=new cn(63926,"unknown_f9b6",void 0,[],void 0),cn.UNKNOWN_F9B7=ln[63927]=new cn(63927,"unknown_f9b7",void 0,[],void 0),cn.UNKNOWN_F9B8=ln[63928]=new cn(63928,"unknown_f9b8",void 0,[],void 0),cn.UNKNOWN_F9B9=ln[63929]=new cn(63929,"unknown_f9b9",void 0,[],void 0),cn.UNKNOWN_F9BA=ln[63930]=new cn(63930,"unknown_f9ba",void 0,[],void 0),cn.UNKNOWN_F9BB=ln[63931]=new cn(63931,"unknown_f9bb",void 0,[],void 0),cn.UNKNOWN_F9BC=ln[63932]=new cn(63932,"unknown_f9bc",void 0,[],void 0),cn.UNKNOWN_F9BD=ln[63933]=new cn(63933,"unknown_f9bd",void 0,[],void 0),cn.UNKNOWN_F9BE=ln[63934]=new cn(63934,"unknown_f9be",void 0,[],void 0),cn.UNKNOWN_F9BF=ln[63935]=new cn(63935,"unknown_f9bf",void 0,[],void 0),cn.UNKNOWN_F9C0=ln[63936]=new cn(63936,"unknown_f9c0",void 0,[],void 0),cn.UNKNOWN_F9C1=ln[63937]=new cn(63937,"unknown_f9c1",void 0,[],void 0),cn.UNKNOWN_F9C2=ln[63938]=new cn(63938,"unknown_f9c2",void 0,[],void 0),cn.UNKNOWN_F9C3=ln[63939]=new cn(63939,"unknown_f9c3",void 0,[],void 0),cn.UNKNOWN_F9C4=ln[63940]=new cn(63940,"unknown_f9c4",void 0,[],void 0),cn.UNKNOWN_F9C5=ln[63941]=new cn(63941,"unknown_f9c5",void 0,[],void 0),cn.UNKNOWN_F9C6=ln[63942]=new cn(63942,"unknown_f9c6",void 0,[],void 0),cn.UNKNOWN_F9C7=ln[63943]=new cn(63943,"unknown_f9c7",void 0,[],void 0),cn.UNKNOWN_F9C8=ln[63944]=new cn(63944,"unknown_f9c8",void 0,[],void 0),cn.UNKNOWN_F9C9=ln[63945]=new cn(63945,"unknown_f9c9",void 0,[],void 0),cn.UNKNOWN_F9CA=ln[63946]=new cn(63946,"unknown_f9ca",void 0,[],void 0),cn.UNKNOWN_F9CB=ln[63947]=new cn(63947,"unknown_f9cb",void 0,[],void 0),cn.UNKNOWN_F9CC=ln[63948]=new cn(63948,"unknown_f9cc",void 0,[],void 0),cn.UNKNOWN_F9CD=ln[63949]=new cn(63949,"unknown_f9cd",void 0,[],void 0),cn.UNKNOWN_F9CE=ln[63950]=new cn(63950,"unknown_f9ce",void 0,[],void 0),cn.UNKNOWN_F9CF=ln[63951]=new cn(63951,"unknown_f9cf",void 0,[],void 0),cn.UNKNOWN_F9D0=ln[63952]=new cn(63952,"unknown_f9d0",void 0,[],void 0),cn.UNKNOWN_F9D1=ln[63953]=new cn(63953,"unknown_f9d1",void 0,[],void 0),cn.UNKNOWN_F9D2=ln[63954]=new cn(63954,"unknown_f9d2",void 0,[],void 0),cn.UNKNOWN_F9D3=ln[63955]=new cn(63955,"unknown_f9d3",void 0,[],void 0),cn.UNKNOWN_F9D4=ln[63956]=new cn(63956,"unknown_f9d4",void 0,[],void 0),cn.UNKNOWN_F9D5=ln[63957]=new cn(63957,"unknown_f9d5",void 0,[],void 0),cn.UNKNOWN_F9D6=ln[63958]=new cn(63958,"unknown_f9d6",void 0,[],void 0),cn.UNKNOWN_F9D7=ln[63959]=new cn(63959,"unknown_f9d7",void 0,[],void 0),cn.UNKNOWN_F9D8=ln[63960]=new cn(63960,"unknown_f9d8",void 0,[],void 0),cn.UNKNOWN_F9D9=ln[63961]=new cn(63961,"unknown_f9d9",void 0,[],void 0),cn.UNKNOWN_F9DA=ln[63962]=new cn(63962,"unknown_f9da",void 0,[],void 0),cn.UNKNOWN_F9DB=ln[63963]=new cn(63963,"unknown_f9db",void 0,[],void 0),cn.UNKNOWN_F9DC=ln[63964]=new cn(63964,"unknown_f9dc",void 0,[],void 0),cn.UNKNOWN_F9DD=ln[63965]=new cn(63965,"unknown_f9dd",void 0,[],void 0),cn.UNKNOWN_F9DE=ln[63966]=new cn(63966,"unknown_f9de",void 0,[],void 0),cn.UNKNOWN_F9DF=ln[63967]=new cn(63967,"unknown_f9df",void 0,[],void 0),cn.UNKNOWN_F9E0=ln[63968]=new cn(63968,"unknown_f9e0",void 0,[],void 0),cn.UNKNOWN_F9E1=ln[63969]=new cn(63969,"unknown_f9e1",void 0,[],void 0),cn.UNKNOWN_F9E2=ln[63970]=new cn(63970,"unknown_f9e2",void 0,[],void 0),cn.UNKNOWN_F9E3=ln[63971]=new cn(63971,"unknown_f9e3",void 0,[],void 0),cn.UNKNOWN_F9E4=ln[63972]=new cn(63972,"unknown_f9e4",void 0,[],void 0),cn.UNKNOWN_F9E5=ln[63973]=new cn(63973,"unknown_f9e5",void 0,[],void 0),cn.UNKNOWN_F9E6=ln[63974]=new cn(63974,"unknown_f9e6",void 0,[],void 0),cn.UNKNOWN_F9E7=ln[63975]=new cn(63975,"unknown_f9e7",void 0,[],void 0),cn.UNKNOWN_F9E8=ln[63976]=new cn(63976,"unknown_f9e8",void 0,[],void 0),cn.UNKNOWN_F9E9=ln[63977]=new cn(63977,"unknown_f9e9",void 0,[],void 0),cn.UNKNOWN_F9EA=ln[63978]=new cn(63978,"unknown_f9ea",void 0,[],void 0),cn.UNKNOWN_F9EB=ln[63979]=new cn(63979,"unknown_f9eb",void 0,[],void 0),cn.UNKNOWN_F9EC=ln[63980]=new cn(63980,"unknown_f9ec",void 0,[],void 0),cn.UNKNOWN_F9ED=ln[63981]=new cn(63981,"unknown_f9ed",void 0,[],void 0),cn.UNKNOWN_F9EE=ln[63982]=new cn(63982,"unknown_f9ee",void 0,[],void 0),cn.UNKNOWN_F9EF=ln[63983]=new cn(63983,"unknown_f9ef",void 0,[],void 0),cn.UNKNOWN_F9F0=ln[63984]=new cn(63984,"unknown_f9f0",void 0,[],void 0),cn.UNKNOWN_F9F1=ln[63985]=new cn(63985,"unknown_f9f1",void 0,[],void 0),cn.UNKNOWN_F9F2=ln[63986]=new cn(63986,"unknown_f9f2",void 0,[],void 0),cn.UNKNOWN_F9F3=ln[63987]=new cn(63987,"unknown_f9f3",void 0,[],void 0),cn.UNKNOWN_F9F4=ln[63988]=new cn(63988,"unknown_f9f4",void 0,[],void 0),cn.UNKNOWN_F9F5=ln[63989]=new cn(63989,"unknown_f9f5",void 0,[],void 0),cn.UNKNOWN_F9F6=ln[63990]=new cn(63990,"unknown_f9f6",void 0,[],void 0),cn.UNKNOWN_F9F7=ln[63991]=new cn(63991,"unknown_f9f7",void 0,[],void 0),cn.UNKNOWN_F9F8=ln[63992]=new cn(63992,"unknown_f9f8",void 0,[],void 0),cn.UNKNOWN_F9F9=ln[63993]=new cn(63993,"unknown_f9f9",void 0,[],void 0),cn.UNKNOWN_F9FA=ln[63994]=new cn(63994,"unknown_f9fa",void 0,[],void 0),cn.UNKNOWN_F9FB=ln[63995]=new cn(63995,"unknown_f9fb",void 0,[],void 0),cn.UNKNOWN_F9FC=ln[63996]=new cn(63996,"unknown_f9fc",void 0,[],void 0),cn.UNKNOWN_F9FD=ln[63997]=new cn(63997,"unknown_f9fd",void 0,[],void 0),cn.UNKNOWN_F9FE=ln[63998]=new cn(63998,"unknown_f9fe",void 0,[],void 0),cn.UNKNOWN_F9FF=ln[63999]=new cn(63999,"unknown_f9ff",void 0,[],void 0),ln.forEach(e=>{un.set(e.mnemonic,e)});class _n{constructor(e,t){this.opcode=e,this.args=t,this.arg_size=0,this.param_to_args=[];const n=Math.min(e.params.length,t.length);for(let i=0;i<n;i++){const n=e.params[i].type,o=t[i];switch(this.param_to_args[i]=[],n.kind){case It.ILabelVar:case It.RegRefVar:this.arg_size++;for(let e=i;e<t.length;e++)this.param_to_args[i].push(t[e]),this.arg_size+=t[e].size;break;default:this.arg_size+=o.size,this.param_to_args[i].push(o)}}this.size=e.size+this.arg_size}}var pn;!function(e){e[e.Instructions=0]="Instructions",e[e.Data=1]="Data",e[e.String=2]="String"}(pn||(pn={}));class vn extends jt{get size(){return this._size}set size(e){e>this._size?this.ensure_size(e-this._size):this._size=e}get backing_buffer(){return this.buffer.backing_buffer}get dv(){return this.buffer.view}constructor(e,t,n=0,i=e.size-n){if(n<0||n>e.size)throw new Error(`Offset ${n} is out of bounds.`);if(i<0||n+i>e.size)throw new Error(`Size ${i} is out of bounds.`);super(t,n),this.buffer=e,this._size=i}take(e){this.check_size("size",e,e);const t=this.offset+this.position,n=new vn(this.buffer,this.endianness,t,e);return this._position+=e,n}ensure_size(e){const t=this.position+e-this._size;t>0&&(this._size+=t,this.buffer.size<this.offset+this._size&&(this.buffer.size=this.offset+this._size))}}class wn{constructor(e=8192){this._size=0,this._buffer=new ArrayBuffer(e),this._data_view=new DataView(this._buffer)}get size(){return this._size}set size(e){if(e<0)throw new Error("Size should be non-negative.");this.ensure_capacity(e),this._size=e}get capacity(){return this._buffer.byteLength}get backing_buffer(){return this._buffer}get view(){return this._data_view}sub_view(e,t){return new DataView(this._buffer,e,t)}ensure_capacity(e){if(e>this.capacity){let t=this.capacity||e;do{t*=2}while(t<e);const n=new ArrayBuffer(t);new Uint8Array(n).set(new Uint8Array(this._buffer,0,this.size)),this._buffer=n,this._data_view=new DataView(this._buffer)}}}function hn(e){const t=new fn(e.size,e.endianness);for(;e.bytes_left;){let n=0,i=0;const o=Math.max(0,e.position-Math.min(2048,e.bytes_left));for(let t=e.position-255;t>=o;t--){let o=e.position,r=t,s=0;for(;o+3<e.size&&s<252&&e.u32_at(o)===e.u32_at(r);)s+=4,o+=4,r+=4;for(;o<e.size&&s<255&&e.u8_at(o)===e.u8_at(r);)s++,o++,r++;if(s>=i&&(n=t,i=s,s>=255))break}i<3?t.add_u8(e.u8()):(t.copy(n-e.position,i),e.seek(i))}return t.finalize()}class fn{constructor(e,t){this.flags=0,this.flag_bits_left=0,this.flag_offset=0,this.output=new vn(new wn(e),t)}add_u8(e){this.write_control_bit(1),this.write_u8(e)}copy(e,t){e>-256&&t<=5?this.short_copy(e,t):this.long_copy(e,t)}finalize(){this.write_control_bit(0),this.write_control_bit(1),this.flags>>>=this.flag_bits_left;const e=this.output.position;return this.output.seek_start(this.flag_offset).write_u8(this.flags).seek_start(e),this.write_u8(0),this.write_u8(0),this.output.seek_start(0)}write_control_bit(e){if(0==this.flag_bits_left--){const e=this.output.position;this.output.seek_start(this.flag_offset).write_u8(this.flags).seek_start(e).write_u8(0),this.flag_offset=e,this.flag_bits_left=7}this.flags>>>=1,e&&(this.flags|=128)}write_u8(e){this.output.write_u8(e)}short_copy(e,t){t-=2,this.write_control_bit(0),this.write_control_bit(0),this.write_control_bit(t>>>1&1),this.write_control_bit(1&t),this.write_u8(255&e)}long_copy(e,t){t<=9?(this.write_control_bit(0),this.write_control_bit(1),this.write_u8(e<<3&248|t-2&7),this.write_u8(e>>5&255)):(this.write_control_bit(0),this.write_control_bit(1),this.write_u8(e<<3&248),this.write_u8(e>>5&255),this.write_u8(t-1))}}const mn=d.a.get("data_formats/compression/prs/decompress");function gn(e){const t=new yn(e);for(;;)if(1===t.read_flag_bit())t.copy_u8();else{let e,n;if(0===t.read_flag_bit())e=t.read_flag_bit()<<1,e|=t.read_flag_bit(),e+=2,n=t.read_u8()-256;else{if(0===(n=t.read_u16()))break;e=7&n,n>>>=3,0===e?(e=t.read_u8(),e+=1):e+=2,n-=8192}t.offset_copy(n,e)}return t.dst.seek_start(0)}class yn{constructor(e){this.src=e,this.dst=new vn(new wn(Math.floor(1.5*e.size)),e.endianness),this.flags=0,this.flag_bits_left=0}read_flag_bit(){0===this.flag_bits_left&&(this.flags=this.read_u8(),this.flag_bits_left=8);let e=1&this.flags;return this.flags>>>=1,this.flag_bits_left-=1,e}copy_u8(){this.dst.write_u8(this.read_u8())}read_u8(){return this.src.u8()}read_u16(){return this.src.u16()}offset_copy(e,t){(e<-8192||e>0)&&mn.error(`offset was ${e}, should be between -8192 and 0.`),(t<1||t>256)&&mn.error(`length was ${t}, should be between 1 and 256.`);const n=Math.min(-e,t);this.dst.seek(e);const i=this.dst.take(n);this.dst.seek(-e-n);for(let e=0;e<Math.floor(t/n);++e)this.dst.write_cursor(i),i.seek_start(0);this.dst.write_cursor(i.take(t%n))}}var kn;!function(e){e[e.None=0]="None",e[e.Return=1]="Return",e[e.Jump=2]="Jump",e[e.ConditionalJump=3]="ConditionalJump",e[e.Call=4]="Call"}(kn||(kn={}));class Rn{constructor(e,t,n,i,o){this.from=[],this.to=[],this.segment=e,this.start=t,this.end=n,this.branch_type=i,this.branch_labels=o}link_to(e){this.to.includes(e)||(this.to.push(e),e.from.push(this))}index_of_instruction(e){const t=this.segment.instructions.indexOf(e,this.start);return t<this.end?t:-1}}class bn{constructor(){this.blocks=[],this.instructions_to_block=new Map,this.labels_to_block=new Map}get_block_for_instruction(e){return this.instructions_to_block.get(e)}static create(e){const t=new bn;for(const n of e)this.create_basic_blocks(t,n);return this.link_blocks(t),t}static create_basic_blocks(e,t){const n=t.instructions.length;let i=0,o=!0;for(let r=0;r<n;r++){const s=t.instructions[r];let a,d;switch(s.opcode){case cn.RET:a=kn.Return,d=[];break;case cn.JMP:a=kn.Jump,d=[s.args[0].value];break;case cn.JMP_ON:case cn.JMP_OFF:a=kn.ConditionalJump,d=[s.args[0].value];break;case cn.JMP_E:case cn.JMPI_E:case cn.JMP_NE:case cn.JMPI_NE:case cn.UJMP_G:case cn.UJMPI_G:case cn.JMP_G:case cn.JMPI_G:case cn.UJMP_L:case cn.UJMPI_L:case cn.JMP_L:case cn.JMPI_L:case cn.UJMP_GE:case cn.UJMPI_GE:case cn.JMP_GE:case cn.JMPI_GE:case cn.UJMP_LE:case cn.UJMPI_LE:case cn.JMP_LE:case cn.JMPI_LE:a=kn.ConditionalJump,d=[s.args[2].value];break;case cn.SWITCH_JMP:a=kn.ConditionalJump,d=s.args.slice(1).map(e=>e.value);break;case cn.CALL:case cn.VA_CALL:a=kn.Call,d=[s.args[0].value];break;case cn.SWITCH_CALL:a=kn.Call,d=s.args.slice(1).map(e=>e.value);break;default:if(r===n-1){a=kn.None,d=[];break}continue}const l=new Rn(t,i,r+1,a,d);for(let t=l.start;t<l.end;t++)e.instructions_to_block.set(l.segment.instructions[t],l);if(e.blocks.push(l),o){for(const n of t.labels)e.labels_to_block.set(n,l);o=!1}i=r+1}}static link_blocks(e){const t=[];for(let n=0;n<e.blocks.length;n++){const i=e.blocks[n],o=e.blocks[n+1];switch(i.branch_type){case kn.Return:continue;case kn.Call:o&&t.push([i,o]);break;case kn.None:case kn.ConditionalJump:o&&i.link_to(o)}for(const t of i.branch_labels){const n=e.labels_to_block.get(t);n&&i.link_to(n)}}for(const[n,i]of t)Nn(e.labels_to_block,i,n)}}function Nn(e,t,n){for(const i of n.branch_labels){const n=e.get(i);n&&(n.branch_type===kn.Return?n.link_to(t):En(new Set,t,n))}}function En(e,t,n){if(!e.has(n)){e.add(n);for(const i of n.to)i.branch_type===kn.Return?i.link_to(t):En(e,t,i)}}class Tn{constructor(){this.intervals=[]}size(){return this.intervals.reduce((e,t)=>e+t.end-t.start+1,0)}get(e){for(const{start:t,end:n}of this.intervals){const i=n-t+1;if(e<i)return t+e;e-=i}}min(){return this.intervals.length?this.intervals[0].start:void 0}max(){return this.intervals.length?this.intervals[this.intervals.length-1].end:void 0}has(e){for(const t of this.intervals)if(t.start<=e&&e<=t.end)return!0;return!1}set_value(e){return this.intervals=[{start:e,end:e}],this}set_interval(e,t){if(t<e)throw new Error(`Interval upper bound should be greater than or equal to lower bound, got [${e}, ${t}].`);return this.intervals=[{start:e,end:t}],this}scalar_add(e){for(const t of this.intervals)t.start+=e,t.end+=e;return this}scalar_sub(e){return this.scalar_add(-e)}scalar_mul(e){for(const t of this.intervals)t.start*=e,t.end*=e;return this}scalar_div(e){for(const t of this.intervals)t.start=Math.floor(t.start/e),t.end=Math.floor(t.end/e);return this}union(e){let t=0;e:for(const n of e.intervals){for(;t<this.intervals.length;){const e=this.intervals[t];if(n.end<e.start-1){this.intervals.splice(t,0,n),t++;continue e}if(n.start<=e.end+1){e.start=Math.min(e.start,n.start);let i=t;for(;i<this.intervals.length&&n.end>this.intervals[i].start;)e.end=this.intervals[i].end,i++;this.intervals.splice(t+1,i-t-1),e.end=Math.max(e.end,n.end),t++;continue e}t++}this.intervals.push(n)}return this}to_array(){let e=[];for(const{start:t,end:n}of this.intervals)for(let i=t;i<=n;i++)e.push(i);return e}[Symbol.iterator](){const e=this;let t=0,n=NaN;return{next(){let i=!0;return t<e.intervals.length&&(isNaN(n)?(n=e.intervals[t].start,i=!1):n>e.intervals[t].end?++t<e.intervals.length&&(n=e.intervals[t].start,i=!1):i=!1),{done:i,value:n++}}}}}const Sn=d.a.get("scripting/data_flow_analysis/register_value"),On=on,Cn=rn;Math.pow(2,32);function Dn(e,t,n){const i=e.get_block_for_instruction(t);return i?function e(t,n,i,o,r){if(++t.iterations>100)return Sn.warn("Too many iterations."),(new Tn).set_interval(On,Cn);for(let s=o-1;s>=i.start;s--){const o=i.segment.instructions[s],a=o.args;switch(o.opcode){case cn.LET:if(a[0].value===r)return e(t,new Set(n),i,s,a[1].value);break;case cn.LETI:case cn.LETB:case cn.LETW:case cn.SYNC_LETI:if(a[0].value===r)return(new Tn).set_value(a[1].value);break;case cn.SET:if(a[0].value===r)return(new Tn).set_value(1);break;case cn.CLEAR:if(a[0].value===r)return(new Tn).set_value(0);break;case cn.REV:if(a[0].value===r){const o=e(t,new Set(n),i,s,r),a=o.size();return 0===a||1===a&&0===o.get(0)?(new Tn).set_value(1):o.has(0)?(new Tn).set_interval(0,1):(new Tn).set_value(0)}break;case cn.ADDI:if(a[0].value===r){const o=e(t,new Set(n),i,s,r);return o.scalar_add(a[1].value)}break;case cn.SUBI:if(a[0].value===r){const o=e(t,new Set(n),i,s,r);return o.scalar_sub(a[1].value)}break;case cn.MULI:if(a[0].value===r){const o=e(t,new Set(n),i,s,r);return o.scalar_mul(a[1].value)}break;case cn.DIVI:if(a[0].value===r){const o=e(t,new Set(n),i,s,r);return o.scalar_div(a[1].value)}break;case cn.IF_ZONE_CLEAR:if(a[0].value===r)return(new Tn).set_interval(0,1);break;case cn.GET_DIFFLVL:if(a[0].value===r)return(new Tn).set_interval(0,2);break;case cn.GET_SLOTNUMBER:if(a[0].value===r)return(new Tn).set_interval(0,3);break;case cn.GET_RANDOM:if(a[1].value===r){const o=e(t,new Set(n),i,s,a[0].value).min()||0,r=Math.max(e(t,new Set(n),i,s,a[0].value+1).max()||0,o+1);return(new Tn).set_interval(o,r-1)}break;case cn.STACK_PUSHM:case cn.STACK_POPM:{const e=a[0].value,t=a[0].value+a[1].value;if(e<=r&&r<t)return(new Tn).set_interval(On,Cn)}break;default:{const e=o.opcode.params,t=Math.min(a.length,e.length);for(let n=0;n<t;n++){const t=e[n];if(t.type.kind==It.RegTupRef){const e=a[n].value;let i=0;for(const n of t.type.register_tuples){if((n.access===sn.Write||n.access===sn.ReadWrite)&&e+i===r)return(new Tn).set_interval(On,Cn);i++}}}}}}const s=new Tn;n.add(i);for(const o of i.from){if(n.has(o)){s.set_interval(On,Cn);break}s.union(e(t,new Set(n),o,o.end,r))}return s}(new Pn,new Set,i,i.index_of_instruction(t),n):new Tn}class Pn{constructor(){this.iterations=0}}const Fn=d.a.get("scripting/data_flow_analysis/stack_value"),Wn=on,Ln=rn;function Un(e,t,n){const i=e.get_block_for_instruction(t);return i?function e(t,n,i,o,r){if(++t.iterations>100)return Fn.warn("Too many iterations."),(new Tn).set_interval(Wn,Ln);for(let e=o-1;e>=i.start;e--){const n=i.segment.instructions[e];if(n.opcode.stack===an.Pop){r+=n.opcode.params.length;continue}const o=n.args;switch(n.opcode){case cn.ARG_PUSHR:if(0===r)return Dn(t.cfg,n,o[0].value);r--;break;case cn.ARG_PUSHL:case cn.ARG_PUSHB:case cn.ARG_PUSHW:if(0===r)return(new Tn).set_value(o[0].value);r--;break;case cn.ARG_PUSHA:case cn.ARG_PUSHO:case cn.ARG_PUSHS:if(0===r)return(new Tn).set_interval(Wn,Ln);r--}}const s=new Tn;n.add(i);for(const o of i.from){if(n.has(o)){s.set_interval(Wn,Ln);break}s.union(e(t,new Set(n),o,o.end,r))}return s}(new Mn(e),new Set,i,i.index_of_instruction(t),n):new Tn}class Mn{constructor(e){this.cfg=e,this.iterations=0}}const In=d.a.get("data_formats/parsing/quest/bin");class Bn{constructor(e,t,n,i,o,r,s){this.quest_id=e,this.language=t,this.quest_name=n,this.short_description=i,this.long_description=o,this.object_code=r,this.shop_items=s}}const An=[];function xn(e,t=[0],n=!1){const i=e.u32(),o=e.u32(),r=e.u32();e.seek(4);const s=e.u32(),a=e.u32(),d=e.string_utf16(64,!0,!0),l=e.string_utf16(256,!0,!0),u=e.string_utf16(576,!0,!0);r!==e.size&&In.warn(`Value ${r} in bin size field does not match actual size ${e.size}.`),e.seek(4);const c=e.u32_array(932),_=Math.floor((e.size-o)/4);e.seek_start(o);const p=e.i32_array(_),v=new Gn(p),w=function(e,t,n,i){const o=new Map;!function(e,t,n,i,o){let r;do{r=i.size;for(const[r,s]of n)zn(i,t,e,r,s,o);const s=[...i.entries()].filter(([,e])=>e.type===pn.Instructions).sort(([e],[t])=>e-t).map(([,e])=>e),a=bn.create(s);n=new Map;for(const e of s)for(const t of e.instructions)for(let e=0;e<t.opcode.params.length;e++){const i=t.opcode.params[e];switch(i.type.kind){case It.ILabel:Kn(a,n,t,e,pn.Instructions);break;case It.ILabelVar:for(;e<t.args.length;e++)n.set(t.args[e].value,pn.Instructions);break;case It.DLabel:Kn(a,n,t,e,pn.Data);break;case It.SLabel:Kn(a,n,t,e,pn.String);break;case It.RegTupRef:{const o=t.args[e];for(let e=0;e<i.type.register_tuples.length;e++){const r=i.type.register_tuples[e];if(r.type.kind===It.ILabel){const i=Dn(a,t,o.value+e);if(i.size()<=10)for(const e of i)n.set(e,pn.Instructions)}}}}}}while(i.size>r)}(e,t,n.reduce((e,t)=>e.set(t,pn.Instructions),new Map),o,i);const r=[];let s=0;for(;s<e.size;){let n=o.get(s);if(!n){const i=t.get_labels(s);let r;if(i){const n=t.get_info(i[0]);r=n.next?n.next.offset:e.size}else{r=e.size;for(const e of t.labels)if(e.offset>s){r=e.offset;break}}if(e.seek_start(s),Hn(o,e,r,i||[]),n=o.get(s),r<=s){In.error(`Next offset ${r} was smaller than or equal to current offset ${s}.`);break}if(!n){In.error(`Couldn't create segment for offset ${s}.`);continue}}switch(r.push(n),n.type){case pn.Instructions:for(const e of n.instructions)s+=e.size;break;case pn.Data:s+=n.data.byteLength;break;case pn.String:s+=4*Math.ceil((n.value.length+1)/2);break;default:throw new Error(`${pn[n.type]} not implemented.`)}}for(const{label:e,offset:n}of t.labels){const t=o.get(n);t?t.labels.includes(e)||(t.labels.push(e),t.labels.sort((e,t)=>e-t)):In.warn(`Label ${e} with offset ${n} does not point to anything.`)}if(e.size!==s){const t=`Expected to parse ${e.size} bytes but parsed ${s} instead.`;if(!i)throw new Error(t);In.error(t)}return r}(e.seek_start(i).take(o-i),v,t,n);return new Bn(s,a,d,l,u,w,c)}function jn(e){const t=new wn(4652+100*e.object_code.length),n=new vn(t,Mt.Little);if(n.write_u32(4652),n.write_u32(0),n.write_u32(0),n.write_u32(4294967295),n.write_u32(e.quest_id),n.write_u32(e.language),n.write_string_utf16(e.quest_name,64),n.write_string_utf16(e.short_description,256),n.write_string_utf16(e.long_description,576),n.write_u32(0),e.shop_items.length>932)throw new Error(`shop_items can't be larger than 932, was ${e.shop_items.length}.`);n.write_u32_array(e.shop_items);for(let t=e.shop_items.length;t<932;t++)n.write_u32(0);for(;n.position<4652;)n.write_u8(0);const{size:i,label_offsets:o}=function(e,t){const n=e.position,i=[];for(const o of t){for(const t of o.labels)i[t]=e.position-n;if(o.type===pn.Instructions)for(const t of o.instructions){const n=t.opcode;if(2===n.size&&e.write_u8(n.code>>>8),e.write_u8(255&n.code),n.stack!==an.Pop)for(let i=0;i<n.params.length;i++){const o=n.params[i],r=t.param_to_args[i],[s]=r;switch(o.type.kind){case It.Byte:s.value>=0?e.write_u8(s.value):e.write_i8(s.value);break;case It.Word:s.value>=0?e.write_u16(s.value):e.write_i16(s.value);break;case It.DWord:s.value>=0?e.write_u32(s.value):e.write_i32(s.value);break;case It.Float:e.write_f32(s.value);break;case It.Label:case It.ILabel:case It.DLabel:case It.SLabel:e.write_u16(s.value);break;case It.String:e.write_string_utf16(s.value,s.size);break;case It.ILabelVar:e.write_u8(r.length),e.write_u16_array(r.map(e=>e.value));break;case It.RegRef:case It.RegTupRef:e.write_u8(s.value);break;case It.RegRefVar:e.write_u8(r.length),e.write_u8_array(r.map(e=>e.value));break;default:throw new Error(`Parameter type ${It[o.type.kind]} not implemented.`)}}}else if(o.type===pn.String){const t=4*Math.ceil((o.value.length+1)/2);e.write_string_utf16(o.value,t)}else e.write_cursor(new Gt(o.data,e.endianness))}return{size:e.position-n,label_offsets:i}}(n,e.object_code);for(let e=0;e<o.length;e++){const t=o[e];null==t?n.write_i32(-1):n.write_i32(t)}const r=n.position;return n.seek_start(4),n.write_u32(4652+i),n.write_u32(r),n.seek_start(0).array_buffer(r)}An[pn.Instructions]=2,An[pn.String]=1,An[pn.Data]=0;class Gn{constructor(e){this.labels=[],this.label_map=new Map,this.offset_map=new Map;for(let t=0;t<e.length;t++){const n=e[t];-1!==n&&this.labels.push({label:t,offset:n})}this.labels.sort((e,t)=>e.offset-t.offset||e.label-t.label);for(let e=0;e<this.labels.length;e++){const{label:t,offset:n}=this.labels[e];this.label_map.set(t,{offset:n,index:e});const i=this.offset_map.get(n)||[];i.push(t),this.offset_map.set(n,i)}}get_labels(e){return this.offset_map.get(e)}get_info(e){const t=this.label_map.get(e);if(null==t)return;let n;for(let e=t.index+1;e<this.labels.length&&!((n=this.labels[e]).offset>t.offset);e++)n=void 0;return{offset:t.offset,next:n}}}function Kn(e,t,n,i,o){if(n.opcode.stack===an.Pop){const r=Un(e,n,n.opcode.params.length-i-1);if(r.size()<=10)for(const e of r){const n=t.get(e);(null==n||An[o]>An[n])&&t.set(e,o)}}else{const e=n.args[i].value,r=t.get(e);(null==r||An[o]>An[r])&&t.set(e,o)}}function zn(e,t,n,i,o,r){try{const s=t.get_info(i);if(null==s)return void In.warn(`Label ${i} is not registered in the label table.`);let a,d=e.get(s.offset);if(d){if(d.labels.includes(i)||(d.labels.push(i),d.labels.sort((e,t)=>e-t)),!(An[o]>An[d.type]))return;a=d.labels}else a=[i];const l=s.next?s.next.offset:n.size;switch(n.seek_start(s.offset),o){case pn.Instructions:!function(e,t,n,i,o,r,s){const a=[],d={type:pn.Instructions,labels:o,instructions:a};e.set(n.position,d);for(;n.position<i;){const e=n.u8();let t;switch(e){case 248:case 249:t=e<<8|n.u8();break;default:t=e}let i=ln[t];try{const e=Vn(n,i);a.push(new _n(i,e))}catch(e){if(!s)throw e;In.error(`Exception occurred while parsing arguments for instruction ${i.mnemonic}.`,e),a.push(new _n(i,[]))}}if(null!=r){let i=!0;for(let e=a.length-1;e>=0;e--){const t=a[e].opcode;if(t===cn.RET||t===cn.JMP){i=!1;break}}i&&zn(e,t,n,r,pn.Instructions,s)}}(e,t,n,l,a,s.next&&s.next.label,r);break;case pn.Data:Hn(e,n,l,a);break;case pn.String:!function(e,t,n,i){const o=t.position,r={type:pn.String,labels:i,value:t.string_utf16(n-o,!0,!0)};e.set(o,r)}(e,n,l,a);break;default:throw new Error(`Segment type ${pn[o]} not implemented.`)}}catch(e){if(!r)throw e;In.error("Couldn't fully parse object code segment.",e)}}function Hn(e,t,n,i){const o=t.position,r={type:pn.Data,labels:i,data:t.array_buffer(n-o)};e.set(o,r)}function Vn(e,t){const n=[];if(t.stack!==an.Pop)for(const i of t.params)switch(i.type.kind){case It.Byte:n.push({value:e.u8(),size:1});break;case It.Word:n.push({value:e.u16(),size:2});break;case It.DWord:n.push({value:e.i32(),size:4});break;case It.Float:n.push({value:e.f32(),size:4});break;case It.Label:case It.ILabel:case It.DLabel:case It.SLabel:n.push({value:e.u16(),size:2});break;case It.String:{const t=e.position;n.push({value:e.string_utf16(Math.min(4096,e.bytes_left),!0,!1),size:e.position-t})}break;case It.ILabelVar:{const t=e.u8();n.push(...e.u16_array(t).map(e=>({value:e,size:2})))}break;case It.RegRef:case It.RegTupRef:n.push({value:e.u8(),size:1});break;case It.RegRefVar:{const t=e.u8();n.push(...e.u8_array(t).map(e=>({value:e,size:1})))}break;default:throw new Error(`Parameter type ${It[i.type.kind]} not implemented.`)}return n}const qn=d.a.get("data_formats/parsing/quest/dat"),$n=68,Jn=72;var Yn;function Zn(e){return Xn[e]}!function(e){e[e.Unknown=1e3]="Unknown",e[e.PlayerSet=1001]="PlayerSet",e[e.Particle=1002]="Particle",e[e.Teleporter=1003]="Teleporter",e[e.Warp=1004]="Warp",e[e.LightCollision=1005]="LightCollision",e[e.Item=1006]="Item",e[e.EnvSound=1007]="EnvSound",e[e.FogCollision=1008]="FogCollision",e[e.EventCollision=1009]="EventCollision",e[e.CharaCollision=1010]="CharaCollision",e[e.ElementalTrap=1011]="ElementalTrap",e[e.StatusTrap=1012]="StatusTrap",e[e.HealTrap=1013]="HealTrap",e[e.LargeElementalTrap=1014]="LargeElementalTrap",e[e.ObjRoomID=1015]="ObjRoomID",e[e.Sensor=1016]="Sensor",e[e.UnknownItem16=1017]="UnknownItem16",e[e.Lensflare=1018]="Lensflare",e[e.ScriptCollision=1019]="ScriptCollision",e[e.HealRing=1020]="HealRing",e[e.MapCollision=1021]="MapCollision",e[e.ScriptCollisionA=1022]="ScriptCollisionA",e[e.ItemLight=1023]="ItemLight",e[e.RadarCollision=1024]="RadarCollision",e[e.FogCollisionSW=1025]="FogCollisionSW",e[e.BossTeleporter=1026]="BossTeleporter",e[e.ImageBoard=1027]="ImageBoard",e[e.QuestWarp=1028]="QuestWarp",e[e.Epilogue=1029]="Epilogue",e[e.UnknownItem29=1030]="UnknownItem29",e[e.UnknownItem30=1031]="UnknownItem30",e[e.UnknownItem31=1032]="UnknownItem31",e[e.BoxDetectObject=1033]="BoxDetectObject",e[e.SymbolChatObject=1034]="SymbolChatObject",e[e.TouchPlateObject=1035]="TouchPlateObject",e[e.TargetableObject=1036]="TargetableObject",e[e.EffectObject=1037]="EffectObject",e[e.CountDownObject=1038]="CountDownObject",e[e.UnknownItem38=1039]="UnknownItem38",e[e.UnknownItem39=1040]="UnknownItem39",e[e.UnknownItem40=1041]="UnknownItem40",e[e.UnknownItem41=1042]="UnknownItem41",e[e.MenuActivation=1043]="MenuActivation",e[e.TelepipeLocation=1044]="TelepipeLocation",e[e.BGMCollision=1045]="BGMCollision",e[e.MainRagolTeleporter=1046]="MainRagolTeleporter",e[e.LobbyTeleporter=1047]="LobbyTeleporter",e[e.PrincipalWarp=1048]="PrincipalWarp",e[e.ShopDoor=1049]="ShopDoor",e[e.HuntersGuildDoor=1050]="HuntersGuildDoor",e[e.TeleporterDoor=1051]="TeleporterDoor",e[e.MedicalCenterDoor=1052]="MedicalCenterDoor",e[e.Elevator=1053]="Elevator",e[e.EasterEgg=1054]="EasterEgg",e[e.ValentinesHeart=1055]="ValentinesHeart",e[e.ChristmasTree=1056]="ChristmasTree",e[e.ChristmasWreath=1057]="ChristmasWreath",e[e.HalloweenPumpkin=1058]="HalloweenPumpkin",e[e.TwentyFirstCentury=1059]="TwentyFirstCentury",e[e.Sonic=1060]="Sonic",e[e.WelcomeBoard=1061]="WelcomeBoard",e[e.Firework=1062]="Firework",e[e.LobbyScreenDoor=1063]="LobbyScreenDoor",e[e.MainRagolTeleporterBattleInNextArea=1064]="MainRagolTeleporterBattleInNextArea",e[e.LabTeleporterDoor=1065]="LabTeleporterDoor",e[e.Pioneer2InvisibleTouchplate=1066]="Pioneer2InvisibleTouchplate",e[e.ForestDoor=1067]="ForestDoor",e[e.ForestSwitch=1068]="ForestSwitch",e[e.LaserFence=1069]="LaserFence",e[e.LaserSquareFence=1070]="LaserSquareFence",e[e.ForestLaserFenceSwitch=1071]="ForestLaserFenceSwitch",e[e.LightRays=1072]="LightRays",e[e.BlueButterfly=1073]="BlueButterfly",e[e.Probe=1074]="Probe",e[e.RandomTypeBox1=1075]="RandomTypeBox1",e[e.ForestWeatherStation=1076]="ForestWeatherStation",e[e.Battery=1077]="Battery",e[e.ForestConsole=1078]="ForestConsole",e[e.BlackSlidingDoor=1079]="BlackSlidingDoor",e[e.RicoMessagePod=1080]="RicoMessagePod",e[e.EnergyBarrier=1081]="EnergyBarrier",e[e.ForestRisingBridge=1082]="ForestRisingBridge",e[e.SwitchNoneDoor=1083]="SwitchNoneDoor",e[e.EnemyBoxGrey=1084]="EnemyBoxGrey",e[e.FixedTypeBox=1085]="FixedTypeBox",e[e.EnemyBoxBrown=1086]="EnemyBoxBrown",e[e.EmptyTypeBox=1087]="EmptyTypeBox",e[e.LaserFenseEx=1088]="LaserFenseEx",e[e.LaserSquareFenceEx=1089]="LaserSquareFenceEx",e[e.FloorPanel1=1090]="FloorPanel1",e[e.Caves4ButtonDoor=1091]="Caves4ButtonDoor",e[e.CavesNormalDoor=1092]="CavesNormalDoor",e[e.CavesSmashingPillar=1093]="CavesSmashingPillar",e[e.CavesSign1=1094]="CavesSign1",e[e.CavesSign2=1095]="CavesSign2",e[e.CavesSign3=1096]="CavesSign3",e[e.HexagalTank=1097]="HexagalTank",e[e.BrownPlatform=1098]="BrownPlatform",e[e.WarningLightObject=1099]="WarningLightObject",e[e.Rainbow=1100]="Rainbow",e[e.FloatingJelifish=1101]="FloatingJelifish",e[e.FloatingDragonfly=1102]="FloatingDragonfly",e[e.CavesSwitchDoor=1103]="CavesSwitchDoor",e[e.RobotRechargeStation=1104]="RobotRechargeStation",e[e.CavesCakeShop=1105]="CavesCakeShop",e[e.Caves1SmallRedRock=1106]="Caves1SmallRedRock",e[e.Caves1MediumRedRock=1107]="Caves1MediumRedRock",e[e.Caves1LargeRedRock=1108]="Caves1LargeRedRock",e[e.Caves2SmallRock1=1109]="Caves2SmallRock1",e[e.Caves2MediumRock1=1110]="Caves2MediumRock1",e[e.Caves2LargeRock1=1111]="Caves2LargeRock1",e[e.Caves2SmallRock2=1112]="Caves2SmallRock2",e[e.Caves2MediumRock2=1113]="Caves2MediumRock2",e[e.Caves2LargeRock2=1114]="Caves2LargeRock2",e[e.Caves3SmallRock=1115]="Caves3SmallRock",e[e.Caves3MediumRock=1116]="Caves3MediumRock",e[e.Caves3LargeRock=1117]="Caves3LargeRock",e[e.FloorPanel2=1118]="FloorPanel2",e[e.DestructableRockCaves1=1119]="DestructableRockCaves1",e[e.DestructableRockCaves2=1120]="DestructableRockCaves2",e[e.DestructableRockCaves3=1121]="DestructableRockCaves3",e[e.MinesDoor=1122]="MinesDoor",e[e.FloorPanel3=1123]="FloorPanel3",e[e.MinesSwitchDoor=1124]="MinesSwitchDoor",e[e.LargeCryoTube=1125]="LargeCryoTube",e[e.ComputerLikeCalus=1126]="ComputerLikeCalus",e[e.GreenScreenOpeningAndClosing=1127]="GreenScreenOpeningAndClosing",e[e.FloatingRobot=1128]="FloatingRobot",e[e.FloatingBlueLight=1129]="FloatingBlueLight",e[e.SelfDestructingObject1=1130]="SelfDestructingObject1",e[e.SelfDestructingObject2=1131]="SelfDestructingObject2",e[e.SelfDestructingObject3=1132]="SelfDestructingObject3",e[e.SparkMachine=1133]="SparkMachine",e[e.MinesLargeFlashingCrate=1134]="MinesLargeFlashingCrate",e[e.RuinsSeal=1135]="RuinsSeal",e[e.RuinsTeleporter=1136]="RuinsTeleporter",e[e.RuinsWarpSiteToSite=1137]="RuinsWarpSiteToSite",e[e.RuinsSwitch=1138]="RuinsSwitch",e[e.FloorPanel4=1139]="FloorPanel4",e[e.Ruins1Door=1140]="Ruins1Door",e[e.Ruins3Door=1141]="Ruins3Door",e[e.Ruins2Door=1142]="Ruins2Door",e[e.Ruins11ButtonDoor=1143]="Ruins11ButtonDoor",e[e.Ruins21ButtonDoor=1144]="Ruins21ButtonDoor",e[e.Ruins31ButtonDoor=1145]="Ruins31ButtonDoor",e[e.Ruins4ButtonDoor=1146]="Ruins4ButtonDoor",e[e.Ruins2ButtonDoor=1147]="Ruins2ButtonDoor",e[e.RuinsSensor=1148]="RuinsSensor",e[e.RuinsFenceSwitch=1149]="RuinsFenceSwitch",e[e.RuinsLaserFence4x2=1150]="RuinsLaserFence4x2",e[e.RuinsLaserFence6x2=1151]="RuinsLaserFence6x2",e[e.RuinsLaserFence4x4=1152]="RuinsLaserFence4x4",e[e.RuinsLaserFence6x4=1153]="RuinsLaserFence6x4",e[e.RuinsPoisonBlob=1154]="RuinsPoisonBlob",e[e.RuinsPilarTrap=1155]="RuinsPilarTrap",e[e.PopupTrapNoTech=1156]="PopupTrapNoTech",e[e.RuinsCrystal=1157]="RuinsCrystal",e[e.Monument=1158]="Monument",e[e.RuinsRock1=1159]="RuinsRock1",e[e.RuinsRock2=1160]="RuinsRock2",e[e.RuinsRock3=1161]="RuinsRock3",e[e.RuinsRock4=1162]="RuinsRock4",e[e.RuinsRock5=1163]="RuinsRock5",e[e.RuinsRock6=1164]="RuinsRock6",e[e.RuinsRock7=1165]="RuinsRock7",e[e.Poison=1166]="Poison",e[e.FixedBoxTypeRuins=1167]="FixedBoxTypeRuins",e[e.RandomBoxTypeRuins=1168]="RandomBoxTypeRuins",e[e.EnemyTypeBoxYellow=1169]="EnemyTypeBoxYellow",e[e.EnemyTypeBoxBlue=1170]="EnemyTypeBoxBlue",e[e.EmptyTypeBoxBlue=1171]="EmptyTypeBoxBlue",e[e.DestructableRock=1172]="DestructableRock",e[e.PopupTrapsTechs=1173]="PopupTrapsTechs",e[e.FlyingWhiteBird=1174]="FlyingWhiteBird",e[e.Tower=1175]="Tower",e[e.FloatingRocks=1176]="FloatingRocks",e[e.FloatingSoul=1177]="FloatingSoul",e[e.Butterfly=1178]="Butterfly",e[e.LobbyGameMenu=1179]="LobbyGameMenu",e[e.LobbyWarpObject=1180]="LobbyWarpObject",e[e.Lobby1EventObjectDefaultTree=1181]="Lobby1EventObjectDefaultTree",e[e.UnknownItem387=1182]="UnknownItem387",e[e.UnknownItem388=1183]="UnknownItem388",e[e.UnknownItem389=1184]="UnknownItem389",e[e.LobbyEventObjectStaticPumpkin=1185]="LobbyEventObjectStaticPumpkin",e[e.LobbyEventObject3ChristmasWindows=1186]="LobbyEventObject3ChristmasWindows",e[e.LobbyEventObjectRedAndWhiteCurtain=1187]="LobbyEventObjectRedAndWhiteCurtain",e[e.UnknownItem393=1188]="UnknownItem393",e[e.UnknownItem394=1189]="UnknownItem394",e[e.LobbyFishTank=1190]="LobbyFishTank",e[e.LobbyEventObjectButterflies=1191]="LobbyEventObjectButterflies",e[e.UnknownItem400=1192]="UnknownItem400",e[e.GreyWallLow=1193]="GreyWallLow",e[e.SpaceshipDoor=1194]="SpaceshipDoor",e[e.GreyWallHigh=1195]="GreyWallHigh",e[e.TempleNormalDoor=1196]="TempleNormalDoor",e[e.BreakableWallWallButUnbreakable=1197]="BreakableWallWallButUnbreakable",e[e.BrokenCilinderAndRubble=1198]="BrokenCilinderAndRubble",e[e.ThreeBrokenWallPiecesOnFloor=1199]="ThreeBrokenWallPiecesOnFloor",e[e.HighBrickCilinder=1200]="HighBrickCilinder",e[e.LyingCilinder=1201]="LyingCilinder",e[e.BrickConeWithFlatTop=1202]="BrickConeWithFlatTop",e[e.BreakableTempleWall=1203]="BreakableTempleWall",e[e.TempleMapDetect=1204]="TempleMapDetect",e[e.SmallBrownBrickRisingBridge=1205]="SmallBrownBrickRisingBridge",e[e.LongRisingBridgeWithPinkHighEdges=1206]="LongRisingBridgeWithPinkHighEdges",e[e.FourSwitchTempleDoor=1207]="FourSwitchTempleDoor",e[e.FourButtonSpaceshipDoor=1208]="FourButtonSpaceshipDoor",e[e.ItemBoxCca=1209]="ItemBoxCca",e[e.TeleporterEp2=1210]="TeleporterEp2",e[e.CCADoor=1211]="CCADoor",e[e.SpecialBoxCCA=1212]="SpecialBoxCCA",e[e.BigCCADoor=1213]="BigCCADoor",e[e.BigCCADoorSwitch=1214]="BigCCADoorSwitch",e[e.LittleRock=1215]="LittleRock",e[e.Little3StoneWall=1216]="Little3StoneWall",e[e.Medium3StoneWall=1217]="Medium3StoneWall",e[e.SpiderPlant=1218]="SpiderPlant",e[e.CCAAreaTeleporter=1219]="CCAAreaTeleporter",e[e.UnknownItem523=1220]="UnknownItem523",e[e.WhiteBird=1221]="WhiteBird",e[e.OrangeBird=1222]="OrangeBird",e[e.Saw=1223]="Saw",e[e.LaserDetect=1224]="LaserDetect",e[e.UnknownItem529=1225]="UnknownItem529",e[e.UnknownItem530=1226]="UnknownItem530",e[e.Seagull=1227]="Seagull",e[e.Fish=1228]="Fish",e[e.SeabedDoorWithBlueEdges=1229]="SeabedDoorWithBlueEdges",e[e.SeabedDoorAlwaysOpenNonTriggerable=1230]="SeabedDoorAlwaysOpenNonTriggerable",e[e.LittleCryotube=1231]="LittleCryotube",e[e.WideGlassWallBreakable=1232]="WideGlassWallBreakable",e[e.BlueFloatingRobot=1233]="BlueFloatingRobot",e[e.RedFloatingRobot=1234]="RedFloatingRobot",e[e.Dolphin=1235]="Dolphin",e[e.CaptureTrap=1236]="CaptureTrap",e[e.VRLink=1237]="VRLink",e[e.UnknownItem576=1238]="UnknownItem576",e[e.WarpInBarbaRayRoom=1239]="WarpInBarbaRayRoom",e[e.UnknownItem672=1240]="UnknownItem672",e[e.GeeNest=1241]="GeeNest",e[e.LabComputerConsole=1242]="LabComputerConsole",e[e.LabComputerConsoleGreenScreen=1243]="LabComputerConsoleGreenScreen",e[e.ChairYelllowPillow=1244]="ChairYelllowPillow",e[e.OrangeWallWithHoleInMiddle=1245]="OrangeWallWithHoleInMiddle",e[e.GreyWallWithHoleInMiddle=1246]="GreyWallWithHoleInMiddle",e[e.LongTable=1247]="LongTable",e[e.GBAStation=1248]="GBAStation",e[e.TalkLinkToSupport=1249]="TalkLinkToSupport",e[e.InstaWarp=1250]="InstaWarp",e[e.LabInvisibleObject=1251]="LabInvisibleObject",e[e.LabGlassWindowDoor=1252]="LabGlassWindowDoor",e[e.UnknownItem700=1253]="UnknownItem700",e[e.LabCelingWarp=1254]="LabCelingWarp",e[e.Ep4LightSource=1255]="Ep4LightSource",e[e.Cacti=1256]="Cacti",e[e.BigBrownRock=1257]="BigBrownRock",e[e.BreakableBrownRock=1258]="BreakableBrownRock",e[e.UnknownItem832=1259]="UnknownItem832",e[e.UnknownItem833=1260]="UnknownItem833",e[e.PoisonPlant=1261]="PoisonPlant",e[e.UnknownItem897=1262]="UnknownItem897",e[e.UnknownItem898=1263]="UnknownItem898",e[e.OozingDesertPlant=1264]="OozingDesertPlant",e[e.UnknownItem901=1265]="UnknownItem901",e[e.BigBlackRocks=1266]="BigBlackRocks",e[e.UnknownItem903=1267]="UnknownItem903",e[e.UnknownItem904=1268]="UnknownItem904",e[e.UnknownItem905=1269]="UnknownItem905",e[e.UnknownItem906=1270]="UnknownItem906",e[e.FallingRock=1271]="FallingRock",e[e.DesertPlantHasCollision=1272]="DesertPlantHasCollision",e[e.DesertFixedTypeBoxBreakableCrystals=1273]="DesertFixedTypeBoxBreakableCrystals",e[e.UnknownItem910=1274]="UnknownItem910",e[e.BeeHive=1275]="BeeHive",e[e.UnknownItem912=1276]="UnknownItem912",e[e.Heat=1277]="Heat",e[e.TopOfSaintMillionEgg=1278]="TopOfSaintMillionEgg",e[e.UnknownItem961=1279]="UnknownItem961"}(Yn||(Yn={}));const Xn=[];function Qn(e,t,n){Xn[e]={name:n,pso_id:t}}Qn(Yn.Unknown,void 0,"Unknown"),Qn(Yn.PlayerSet,0,"Player Set"),Qn(Yn.Particle,1,"Particle"),Qn(Yn.Teleporter,2,"Teleporter"),Qn(Yn.Warp,3,"Warp"),Qn(Yn.LightCollision,4,"Light Collision"),Qn(Yn.Item,5,"Item"),Qn(Yn.EnvSound,6,"Env Sound"),Qn(Yn.FogCollision,7,"Fog Collision"),Qn(Yn.EventCollision,8,"Event Collision"),Qn(Yn.CharaCollision,9,"Chara Collision"),Qn(Yn.ElementalTrap,10,"Elemental Trap"),Qn(Yn.StatusTrap,11,"Status Trap"),Qn(Yn.HealTrap,12,"Heal Trap"),Qn(Yn.LargeElementalTrap,13,"Large Elemental Trap"),Qn(Yn.ObjRoomID,14,"Obj Room ID"),Qn(Yn.Sensor,15,"Sensor"),Qn(Yn.UnknownItem16,16,"Unknown Item (16)"),Qn(Yn.Lensflare,17,"Lensflare"),Qn(Yn.ScriptCollision,18,"Script Collision"),Qn(Yn.HealRing,19,"Heal Ring"),Qn(Yn.MapCollision,20,"Map Collision"),Qn(Yn.ScriptCollisionA,21,"Script Collision A"),Qn(Yn.ItemLight,22,"Item Light"),Qn(Yn.RadarCollision,23,"Radar Collision"),Qn(Yn.FogCollisionSW,24,"Fog Collision SW"),Qn(Yn.BossTeleporter,25,"Boss Teleporter"),Qn(Yn.ImageBoard,26,"Image Board"),Qn(Yn.QuestWarp,27,"Quest Warp"),Qn(Yn.Epilogue,28,"Epilogue"),Qn(Yn.UnknownItem29,29,"Unknown Item (29)"),Qn(Yn.UnknownItem30,30,"Unknown Item (30)"),Qn(Yn.UnknownItem31,31,"Unknown Item (31)"),Qn(Yn.BoxDetectObject,32,"Box Detect Object"),Qn(Yn.SymbolChatObject,33,"Symbol Chat Object"),Qn(Yn.TouchPlateObject,34,"Touch plate Object"),Qn(Yn.TargetableObject,35,"Targetable Object"),Qn(Yn.EffectObject,36,"Effect object"),Qn(Yn.CountDownObject,37,"Count Down Object"),Qn(Yn.UnknownItem38,38,"Unknown Item (38)"),Qn(Yn.UnknownItem39,39,"Unknown Item (39)"),Qn(Yn.UnknownItem40,40,"Unknown Item (40)"),Qn(Yn.UnknownItem41,41,"Unknown Item (41)"),Qn(Yn.MenuActivation,64,"Menu activation"),Qn(Yn.TelepipeLocation,65,"Telepipe Location"),Qn(Yn.BGMCollision,66,"BGM Collision"),Qn(Yn.MainRagolTeleporter,67,"Main Ragol Teleporter"),Qn(Yn.LobbyTeleporter,68,"Lobby Teleporter"),Qn(Yn.PrincipalWarp,69,"Principal warp"),Qn(Yn.ShopDoor,70,"Shop Door"),Qn(Yn.HuntersGuildDoor,71,"Hunter's Guild Door"),Qn(Yn.TeleporterDoor,72,"Teleporter Door"),Qn(Yn.MedicalCenterDoor,73,"Medical Center Door"),Qn(Yn.Elevator,74,"Elevator"),Qn(Yn.EasterEgg,75,"Easter Egg"),Qn(Yn.ValentinesHeart,76,"Valentines Heart"),Qn(Yn.ChristmasTree,77,"Christmas Tree"),Qn(Yn.ChristmasWreath,78,"Christmas Wreath"),Qn(Yn.HalloweenPumpkin,79,"Halloween Pumpkin"),Qn(Yn.TwentyFirstCentury,80,"21st Century"),Qn(Yn.Sonic,81,"Sonic"),Qn(Yn.WelcomeBoard,82,"Welcome Board"),Qn(Yn.Firework,83,"Firework"),Qn(Yn.LobbyScreenDoor,84,"Lobby Screen Door"),Qn(Yn.MainRagolTeleporterBattleInNextArea,85,"Main Ragol Teleporter (Battle in next area?)"),Qn(Yn.LabTeleporterDoor,86,"Lab Teleporter Door"),Qn(Yn.Pioneer2InvisibleTouchplate,87,"Pioneer 2 Invisible Touchplate"),Qn(Yn.ForestDoor,128,"Forest Door"),Qn(Yn.ForestSwitch,129,"Forest Switch"),Qn(Yn.LaserFence,130,"Laser Fence"),Qn(Yn.LaserSquareFence,131,"Laser Square Fence"),Qn(Yn.ForestLaserFenceSwitch,132,"Forest Laser Fence Switch"),Qn(Yn.LightRays,133,"Light rays"),Qn(Yn.BlueButterfly,134,"Blue Butterfly"),Qn(Yn.Probe,135,"Probe"),Qn(Yn.RandomTypeBox1,136,"Random Type Box 1"),Qn(Yn.ForestWeatherStation,137,"Forest Weather Station"),Qn(Yn.Battery,138,"Battery"),Qn(Yn.ForestConsole,139,"Forest Console"),Qn(Yn.BlackSlidingDoor,140,"Black Sliding Door"),Qn(Yn.RicoMessagePod,141,"Rico Message Pod"),Qn(Yn.EnergyBarrier,142,"Energy Barrier"),Qn(Yn.ForestRisingBridge,143,"Forest Rising Bridge"),Qn(Yn.SwitchNoneDoor,144,"Switch (none door)"),Qn(Yn.EnemyBoxGrey,145,"Enemy Box (Grey)"),Qn(Yn.FixedTypeBox,146,"Fixed Type Box"),Qn(Yn.EnemyBoxBrown,147,"Enemy Box (Brown)"),Qn(Yn.EmptyTypeBox,149,"Empty Type Box"),Qn(Yn.LaserFenseEx,150,"Laser Fense Ex"),Qn(Yn.LaserSquareFenceEx,151,"Laser Square Fence Ex"),Qn(Yn.FloorPanel1,192,"Floor Panel 1"),Qn(Yn.Caves4ButtonDoor,193,"Caves 4 Button door"),Qn(Yn.CavesNormalDoor,194,"Caves Normal door"),Qn(Yn.CavesSmashingPillar,195,"Caves Smashing Pillar"),Qn(Yn.CavesSign1,196,"Caves Sign 1"),Qn(Yn.CavesSign2,197,"Caves Sign 2"),Qn(Yn.CavesSign3,198,"Caves Sign 3"),Qn(Yn.HexagalTank,199,"Hexagal Tank"),Qn(Yn.BrownPlatform,200,"Brown Platform"),Qn(Yn.WarningLightObject,201,"Warning Light Object"),Qn(Yn.Rainbow,203,"Rainbow"),Qn(Yn.FloatingJelifish,204,"Floating Jelifish"),Qn(Yn.FloatingDragonfly,205,"Floating Dragonfly"),Qn(Yn.CavesSwitchDoor,206,"Caves Switch Door"),Qn(Yn.RobotRechargeStation,207,"Robot Recharge Station"),Qn(Yn.CavesCakeShop,208,"Caves Cake Shop"),Qn(Yn.Caves1SmallRedRock,209,"Caves 1 Small Red Rock"),Qn(Yn.Caves1MediumRedRock,210,"Caves 1 Medium Red Rock"),Qn(Yn.Caves1LargeRedRock,211,"Caves 1 Large Red Rock"),Qn(Yn.Caves2SmallRock1,212,"Caves 2 Small Rock 1"),Qn(Yn.Caves2MediumRock1,213,"Caves 2 Medium Rock 1"),Qn(Yn.Caves2LargeRock1,214,"Caves 2 Large Rock 1"),Qn(Yn.Caves2SmallRock2,215,"Caves 2 Small Rock 2"),Qn(Yn.Caves2MediumRock2,216,"Caves 2 Medium Rock 2"),Qn(Yn.Caves2LargeRock2,217,"Caves 2 Large Rock 2"),Qn(Yn.Caves3SmallRock,218,"Caves 3 Small Rock"),Qn(Yn.Caves3MediumRock,219,"Caves 3 Medium Rock"),Qn(Yn.Caves3LargeRock,220,"Caves 3 Large Rock"),Qn(Yn.FloorPanel2,222,"Floor Panel 2"),Qn(Yn.DestructableRockCaves1,223,"Destructable Rock (Caves 1)"),Qn(Yn.DestructableRockCaves2,224,"Destructable Rock (Caves 2)"),Qn(Yn.DestructableRockCaves3,225,"Destructable Rock (Caves 3)"),Qn(Yn.MinesDoor,256,"Mines Door"),Qn(Yn.FloorPanel3,257,"Floor Panel 3"),Qn(Yn.MinesSwitchDoor,258,"Mines Switch Door"),Qn(Yn.LargeCryoTube,259,"Large Cryo-Tube"),Qn(Yn.ComputerLikeCalus,260,"Computer (like calus)"),Qn(Yn.GreenScreenOpeningAndClosing,261,"Green Screen opening and closing"),Qn(Yn.FloatingRobot,262,"Floating Robot"),Qn(Yn.FloatingBlueLight,263,"Floating Blue Light"),Qn(Yn.SelfDestructingObject1,264,"Self Destructing Object 1"),Qn(Yn.SelfDestructingObject2,265,"Self Destructing Object 2"),Qn(Yn.SelfDestructingObject3,266,"Self Destructing Object 3"),Qn(Yn.SparkMachine,267,"Spark Machine"),Qn(Yn.MinesLargeFlashingCrate,268,"Mines Large Flashing Crate"),Qn(Yn.RuinsSeal,304,"Ruins Seal"),Qn(Yn.RuinsTeleporter,320,"Ruins Teleporter"),Qn(Yn.RuinsWarpSiteToSite,321,"Ruins Warp (Site to site)"),Qn(Yn.RuinsSwitch,322,"Ruins Switch"),Qn(Yn.FloorPanel4,323,"Floor Panel 4"),Qn(Yn.Ruins1Door,324,"Ruins 1 Door"),Qn(Yn.Ruins3Door,325,"Ruins 3 Door"),Qn(Yn.Ruins2Door,326,"Ruins 2 Door"),Qn(Yn.Ruins11ButtonDoor,327,"Ruins 1-1 Button Door"),Qn(Yn.Ruins21ButtonDoor,328,"Ruins 2-1 Button Door"),Qn(Yn.Ruins31ButtonDoor,329,"Ruins 3-1 Button Door"),Qn(Yn.Ruins4ButtonDoor,330,"Ruins 4-Button Door"),Qn(Yn.Ruins2ButtonDoor,331,"Ruins 2-Button Door"),Qn(Yn.RuinsSensor,332,"Ruins Sensor"),Qn(Yn.RuinsFenceSwitch,333,"Ruins Fence Switch"),Qn(Yn.RuinsLaserFence4x2,334,"Ruins Laser Fence 4x2"),Qn(Yn.RuinsLaserFence6x2,335,"Ruins Laser Fence 6x2"),Qn(Yn.RuinsLaserFence4x4,336,"Ruins Laser Fence 4x4"),Qn(Yn.RuinsLaserFence6x4,337,"Ruins Laser Fence 6x4"),Qn(Yn.RuinsPoisonBlob,338,"Ruins poison Blob"),Qn(Yn.RuinsPilarTrap,339,"Ruins Pilar Trap"),Qn(Yn.PopupTrapNoTech,340,"Popup Trap (No Tech)"),Qn(Yn.RuinsCrystal,341,"Ruins Crystal"),Qn(Yn.Monument,342,"Monument"),Qn(Yn.RuinsRock1,345,"Ruins Rock 1"),Qn(Yn.RuinsRock2,346,"Ruins Rock 2"),Qn(Yn.RuinsRock3,347,"Ruins Rock 3"),Qn(Yn.RuinsRock4,348,"Ruins Rock 4"),Qn(Yn.RuinsRock5,349,"Ruins Rock 5"),Qn(Yn.RuinsRock6,350,"Ruins Rock 6"),Qn(Yn.RuinsRock7,351,"Ruins Rock 7"),Qn(Yn.Poison,352,"Poison"),Qn(Yn.FixedBoxTypeRuins,353,"Fixed Box Type (Ruins)"),Qn(Yn.RandomBoxTypeRuins,354,"Random Box Type (Ruins)"),Qn(Yn.EnemyTypeBoxYellow,355,"Enemy Type Box (Yellow)"),Qn(Yn.EnemyTypeBoxBlue,356,"Enemy Type Box (Blue)"),Qn(Yn.EmptyTypeBoxBlue,357,"Empty Type Box (Blue)"),Qn(Yn.DestructableRock,358,"Destructable Rock"),Qn(Yn.PopupTrapsTechs,359,"Popup Traps (techs)"),Qn(Yn.FlyingWhiteBird,368,"Flying White Bird"),Qn(Yn.Tower,369,"Tower"),Qn(Yn.FloatingRocks,370,"Floating Rocks"),Qn(Yn.FloatingSoul,371,"Floating Soul"),Qn(Yn.Butterfly,372,"Butterfly"),Qn(Yn.LobbyGameMenu,384,"Lobby Game menu"),Qn(Yn.LobbyWarpObject,385,"Lobby Warp Object"),Qn(Yn.Lobby1EventObjectDefaultTree,386,"Lobby 1 Event Object (Default Tree)"),Qn(Yn.UnknownItem387,387,"Unknown Item (387)"),Qn(Yn.UnknownItem388,388,"Unknown Item (388)"),Qn(Yn.UnknownItem389,389,"Unknown Item (389)"),Qn(Yn.LobbyEventObjectStaticPumpkin,390,"Lobby Event Object (Static Pumpkin)"),Qn(Yn.LobbyEventObject3ChristmasWindows,391,"Lobby Event Object (3 Christmas Windows)"),Qn(Yn.LobbyEventObjectRedAndWhiteCurtain,392,"Lobby Event Object (Red and White Curtain)"),Qn(Yn.UnknownItem393,393,"Unknown Item (393)"),Qn(Yn.UnknownItem394,394,"Unknown Item (394)"),Qn(Yn.LobbyFishTank,395,"Lobby Fish Tank"),Qn(Yn.LobbyEventObjectButterflies,396,"Lobby Event Object (Butterflies)"),Qn(Yn.UnknownItem400,400,"Unknown Item (400)"),Qn(Yn.GreyWallLow,401,"grey wall low"),Qn(Yn.SpaceshipDoor,402,"Spaceship Door"),Qn(Yn.GreyWallHigh,403,"grey wall high"),Qn(Yn.TempleNormalDoor,416,"Temple Normal Door"),Qn(Yn.BreakableWallWallButUnbreakable,417,'"breakable wall wall, but unbreakable"'),Qn(Yn.BrokenCilinderAndRubble,418,"Broken cilinder and rubble"),Qn(Yn.ThreeBrokenWallPiecesOnFloor,419,"3 broken wall pieces on floor"),Qn(Yn.HighBrickCilinder,420,"high brick cilinder"),Qn(Yn.LyingCilinder,421,"lying cilinder"),Qn(Yn.BrickConeWithFlatTop,422,"brick cone with flat top"),Qn(Yn.BreakableTempleWall,423,"breakable temple wall"),Qn(Yn.TempleMapDetect,424,"Temple Map Detect"),Qn(Yn.SmallBrownBrickRisingBridge,425,"small brown brick rising bridge"),Qn(Yn.LongRisingBridgeWithPinkHighEdges,426,"long rising bridge (with pink high edges)"),Qn(Yn.FourSwitchTempleDoor,427,"4 switch temple door"),Qn(Yn.FourButtonSpaceshipDoor,448,"4 button spaceship door"),Qn(Yn.ItemBoxCca,512,"item box cca"),Qn(Yn.TeleporterEp2,513,"Teleporter (Ep 2)"),Qn(Yn.CCADoor,514,"CCA Door"),Qn(Yn.SpecialBoxCCA,515,"Special Box CCA"),Qn(Yn.BigCCADoor,516,"Big CCA Door"),Qn(Yn.BigCCADoorSwitch,517,"Big CCA Door Switch"),Qn(Yn.LittleRock,518,"Little Rock"),Qn(Yn.Little3StoneWall,519,"Little 3 Stone Wall"),Qn(Yn.Medium3StoneWall,520,"Medium 3 stone wall"),Qn(Yn.SpiderPlant,521,"Spider Plant"),Qn(Yn.CCAAreaTeleporter,522,"CCA Area Teleporter"),Qn(Yn.UnknownItem523,523,"Unknown Item (523)"),Qn(Yn.WhiteBird,524,"White Bird"),Qn(Yn.OrangeBird,525,"Orange Bird"),Qn(Yn.Saw,527,"Saw"),Qn(Yn.LaserDetect,528,"Laser Detect"),Qn(Yn.UnknownItem529,529,"Unknown Item (529)"),Qn(Yn.UnknownItem530,530,"Unknown Item (530)"),Qn(Yn.Seagull,531,"Seagull"),Qn(Yn.Fish,544,"Fish"),Qn(Yn.SeabedDoorWithBlueEdges,545,"Seabed Door (with blue edges)"),Qn(Yn.SeabedDoorAlwaysOpenNonTriggerable,546,"Seabed door (always open, non-triggerable)"),Qn(Yn.LittleCryotube,547,"Little Cryotube"),Qn(Yn.WideGlassWallBreakable,548,"Wide Glass Wall (breakable)"),Qn(Yn.BlueFloatingRobot,549,"Blue floating robot"),Qn(Yn.RedFloatingRobot,550,"Red floating robot"),Qn(Yn.Dolphin,551,"Dolphin"),Qn(Yn.CaptureTrap,552,"Capture Trap"),Qn(Yn.VRLink,553,"VR link"),Qn(Yn.UnknownItem576,576,"Unknown Item (576)"),Qn(Yn.WarpInBarbaRayRoom,640,"Warp in Barba Ray Room"),Qn(Yn.UnknownItem672,672,"Unknown Item (672)"),Qn(Yn.GeeNest,688,"Gee Nest"),Qn(Yn.LabComputerConsole,689,"Lab Computer Console"),Qn(Yn.LabComputerConsoleGreenScreen,690,"Lab Computer Console (Green Screen)"),Qn(Yn.ChairYelllowPillow,691,"Chair, Yelllow Pillow"),Qn(Yn.OrangeWallWithHoleInMiddle,692,"orange wall with hole in middle"),Qn(Yn.GreyWallWithHoleInMiddle,693,"grey wall with hole in middle"),Qn(Yn.LongTable,694,"long table"),Qn(Yn.GBAStation,695,"GBA Station"),Qn(Yn.TalkLinkToSupport,696,"Talk (link to support)"),Qn(Yn.InstaWarp,697,"insta-warp"),Qn(Yn.LabInvisibleObject,698,"Lab Invisible Object"),Qn(Yn.LabGlassWindowDoor,699,"Lab Glass window Door"),Qn(Yn.UnknownItem700,700,"Unknown Item (700)"),Qn(Yn.LabCelingWarp,701,"Lab Celing Warp"),Qn(Yn.Ep4LightSource,768,"Ep4 Light Source"),Qn(Yn.Cacti,769,"cacti"),Qn(Yn.BigBrownRock,770,"Big Brown Rock"),Qn(Yn.BreakableBrownRock,771,"Breakable Brown Rock"),Qn(Yn.UnknownItem832,832,"Unknown Item (832)"),Qn(Yn.UnknownItem833,833,"Unknown Item (833)"),Qn(Yn.PoisonPlant,896,"Poison Plant"),Qn(Yn.UnknownItem897,897,"Unknown Item (897)"),Qn(Yn.UnknownItem898,898,"Unknown Item (898)"),Qn(Yn.OozingDesertPlant,899,"Oozing Desert Plant"),Qn(Yn.UnknownItem901,901,"Unknown Item (901)"),Qn(Yn.BigBlackRocks,902,"big black rocks"),Qn(Yn.UnknownItem903,903,"Unknown Item (903)"),Qn(Yn.UnknownItem904,904,"Unknown Item (904)"),Qn(Yn.UnknownItem905,905,"Unknown Item (905)"),Qn(Yn.UnknownItem906,906,"Unknown Item (906)"),Qn(Yn.FallingRock,907,"Falling Rock"),Qn(Yn.DesertPlantHasCollision,908,"Desert Plant (has collision)"),Qn(Yn.DesertFixedTypeBoxBreakableCrystals,909,"Desert Fixed Type Box (Breakable Crystals)"),Qn(Yn.UnknownItem910,910,"Unknown Item (910)"),Qn(Yn.BeeHive,911,"Bee Hive"),Qn(Yn.UnknownItem912,912,"Unknown Item (912)"),Qn(Yn.Heat,913,"Heat"),Qn(Yn.TopOfSaintMillionEgg,960,"Top of saint million egg"),Qn(Yn.UnknownItem961,961,"Unknown Item (961)");const ei=d.a.get("data_formats/parsing/quest/qst");function ti(e){let t="PC";const n=e.u8();e.seek(1);const i=e.u8();if(68===n?t="Dreamcast/GameCube":88===n?68===i&&(t="Blue Burst"):166===n&&(t="Dreamcast download"),"Blue Burst"===t){e.seek_start(0);const n=function(e){const t=[];for(let n=0;n<2;++n){e.seek(4);const n=e.u16();e.seek(38);const i=e.string_ascii(16,!0,!0),o=e.u32(),r=e.string_ascii(24,!0,!0);t.push({quest_id:n,file_name:i,file_name_2:r,size:o})}return t}(e),i=function(e,t){const n=new Map;for(;e.bytes_left>=1056;){const i=e.position,o=e.seek(4).u8(),r=e.seek(3).string_ascii(16,!0,!0);let s=n.get(r);if(!s){const e=t.get(r);n.set(r,s={name:r,expected_size:e,cursor:new vn(new wn(e||10240),Mt.Little),chunk_nos:new Set})}s.chunk_nos.has(o)?ei.warn(`File chunk number ${o} of file ${r} was already encountered, overwriting previous chunk.`):s.chunk_nos.add(o);let a=e.seek(1024).u32();e.seek(-1028),a>1024&&(ei.warn(`Data segment size of ${a} is larger than expected maximum size, reading just 1024 bytes.`),a=1024);const d=e.take(a),l=1024*o;if(s.cursor.size=Math.max(l+a,s.cursor.size),s.cursor.seek_start(l).write_cursor(d),e.seek(1032-d.size),e.position!==i+1056)throw new Error(`Read ${e.position-i} file chunk message bytes instead of expected 1056.`)}e.bytes_left&&ei.warn(`${e.bytes_left} Bytes left in file.`);for(const e of n.values()){e.cursor.seek_start(0),e.chunk_nos=new Set(Array.from(e.chunk_nos.values()).sort((e,t)=>e-t)),null!=e.expected_size&&e.cursor.size!==e.expected_size&&ei.warn(`File ${e.name} has an actual size of ${e.cursor.size} instead of the expected size ${e.expected_size}.`);const t=Math.max(e.cursor.size,e.expected_size||0);for(let n=0;n<Math.ceil(t/1024);++n)e.chunk_nos.has(n)||ei.warn(`File ${e.name} is missing chunk ${n}.`)}const i=[];for(const e of n.values())i.push({name:e.name,data:e.cursor.seek_start(0).array_buffer()});return i}(e,new Map(n.map(e=>[e.file_name,e.size])));for(const e of i){const t=n.find(t=>t.file_name===e.name);t&&(e.id=t.quest_id,e.name_2=t.file_name_2)}return{version:t,files:i}}ei.error(`Can't parse ${t} QST files.`)}function ni(e){const t=e.files,n=t.map(e=>88+1056*Math.ceil(e.data.byteLength/1024)).reduce((e,t)=>e+t),i=new ArrayBuffer(n),o=new Gt(i,Mt.Little);if(function(e,t){for(const n of t){if(n.name.length>15)throw new Error(`File ${n.name} has a name longer than 15 characters.`);e.write_u16(88),e.write_u16(68),e.write_u16(n.id||0);for(let t=0;t<38;++t)e.write_u8(0);let t;if(e.write_string_ascii(n.name,16),e.write_u32(n.data.byteLength),null==n.name_2){const e=n.name.lastIndexOf(".");t=-1===e?n.name+"_j":n.name.slice(0,e)+"_j"+n.name.slice(e)}else t=n.name_2;if(t.length>24)throw Error(`File ${n.name} has a file_name_2 length (${t}) longer than 24 characters.`);e.write_string_ascii(t,24)}}(o,t),function(e,t){const n=t.map(e=>({no:0,data:new Gt(e.data,Mt.Little),name:e.name}));let i=0;for(;i<n.length;)for(const t of n)t.data.bytes_left&&(ii(e,t.data,t.no++,t.name)||i++);for(const e of n){const t=Math.ceil(e.data.size/1024);if(e.no!==t)throw new Error(`Expected to write ${t} chunks for file "${e.name}" but ${e.no} where written.`)}}(o,t),o.position!==n)throw new Error(`Expected a final file size of ${n}, but got ${o.position}.`);return i}function ii(e,t,n,i){e.write_u8_array([28,4,19,0]),e.write_u8(n),e.write_u8_array([0,0,0]),e.write_string_ascii(i,16);const o=Math.min(1024,t.bytes_left);e.write_cursor(t.take(o));for(let t=o;t<1024;++t)e.write_u8(0);return e.write_u32(o),e.write_u32(0),t.bytes_left>0}const oi=d.a.get("data_formats/parsing/quest");function ri(e,t=!1){const n=ti(e);if(!n)return;let i,o;for(const e of n.files){const t=e.name.trim().toLowerCase();t.endsWith(".dat")?i=e:t.endsWith(".bin")&&(o=e)}if(!i)return void oi.error("File contains no DAT file.");if(!o)return void oi.error("File contains no BIN file.");const r=function(e){const t=[],n=[],i=[];for(;e.bytes_left;){const o=e.u32(),r=e.u32(),s=e.u32(),a=e.u32();if(0===o)break;if(a!==r-16)throw Error(`Malformed DAT file. Expected an entities size of ${r-16}, got ${a}.`);if(1===o){const n=Math.floor(a/$n),i=e.position;for(let i=0;i<n;++i){const n=e.u16(),i=e.u8_array(6),o=e.u16(),r=e.u16(),a=e.u16(),d=e.u8_array(2),l=e.vec3_f32(),u=new At(e.i32()/65535*2*Math.PI,e.i32()/65535*2*Math.PI,e.i32()/65535*2*Math.PI),c=[e.f32(),e.f32(),e.f32(),e.u32(),e.u32(),e.u32(),e.u32()];t.push({type_id:n,id:o,group_id:r,section_id:a,position:l,rotation:u,properties:c,area_id:s,unknown:[i,d]})}const r=e.position-i;r!==a&&(qn.warn(`Read ${r} bytes instead of expected ${a} for entity type ${o} (Object).`),e.seek(a-r))}else if(2===o){const t=Math.floor(a/Jn),i=e.position;for(let i=0;i<t;++i){const t=e.u16(),i=e.u8_array(10),o=e.u16(),r=e.u8_array(6),a=e.vec3_f32(),d=e.i32()/65535*2*Math.PI,l=e.i32()/65535*2*Math.PI,u=e.i32()/65535*2*Math.PI,c=e.vec3_f32(),_=e.f32(),p=e.f32(),v=e.u32(),w=e.u8_array(4);n.push({type_id:t,section_id:o,position:a,rotation:new At(d,l,u),scale:c,npc_id:_,script_label:p,roaming:v,area_id:s,unknown:[i,r,w]})}const r=e.position-i;r!==a&&(qn.warn(`Read ${r} bytes instead of expected ${a} for entity type ${o} (NPC).`),e.seek(a-r))}else i.push({entity_type:o,total_size:r,area_id:s,entities_size:a,data:e.u8_array(a)})}return{objs:t,npcs:n,unknowns:i}}(gn(new Gt(i.data,Mt.Little))),s=r.objs.map(e=>{const t=function(e){switch(e){default:return Yn.Unknown;case 0:return Yn.PlayerSet;case 1:return Yn.Particle;case 2:return Yn.Teleporter;case 3:return Yn.Warp;case 4:return Yn.LightCollision;case 5:return Yn.Item;case 6:return Yn.EnvSound;case 7:return Yn.FogCollision;case 8:return Yn.EventCollision;case 9:return Yn.CharaCollision;case 10:return Yn.ElementalTrap;case 11:return Yn.StatusTrap;case 12:return Yn.HealTrap;case 13:return Yn.LargeElementalTrap;case 14:return Yn.ObjRoomID;case 15:return Yn.Sensor;case 16:return Yn.UnknownItem16;case 17:return Yn.Lensflare;case 18:return Yn.ScriptCollision;case 19:return Yn.HealRing;case 20:return Yn.MapCollision;case 21:return Yn.ScriptCollisionA;case 22:return Yn.ItemLight;case 23:return Yn.RadarCollision;case 24:return Yn.FogCollisionSW;case 25:return Yn.BossTeleporter;case 26:return Yn.ImageBoard;case 27:return Yn.QuestWarp;case 28:return Yn.Epilogue;case 29:return Yn.UnknownItem29;case 30:return Yn.UnknownItem30;case 31:return Yn.UnknownItem31;case 32:return Yn.BoxDetectObject;case 33:return Yn.SymbolChatObject;case 34:return Yn.TouchPlateObject;case 35:return Yn.TargetableObject;case 36:return Yn.EffectObject;case 37:return Yn.CountDownObject;case 38:return Yn.UnknownItem38;case 39:return Yn.UnknownItem39;case 40:return Yn.UnknownItem40;case 41:return Yn.UnknownItem41;case 64:return Yn.MenuActivation;case 65:return Yn.TelepipeLocation;case 66:return Yn.BGMCollision;case 67:return Yn.MainRagolTeleporter;case 68:return Yn.LobbyTeleporter;case 69:return Yn.PrincipalWarp;case 70:return Yn.ShopDoor;case 71:return Yn.HuntersGuildDoor;case 72:return Yn.TeleporterDoor;case 73:return Yn.MedicalCenterDoor;case 74:return Yn.Elevator;case 75:return Yn.EasterEgg;case 76:return Yn.ValentinesHeart;case 77:return Yn.ChristmasTree;case 78:return Yn.ChristmasWreath;case 79:return Yn.HalloweenPumpkin;case 80:return Yn.TwentyFirstCentury;case 81:return Yn.Sonic;case 82:return Yn.WelcomeBoard;case 83:return Yn.Firework;case 84:return Yn.LobbyScreenDoor;case 85:return Yn.MainRagolTeleporterBattleInNextArea;case 86:return Yn.LabTeleporterDoor;case 87:return Yn.Pioneer2InvisibleTouchplate;case 128:return Yn.ForestDoor;case 129:return Yn.ForestSwitch;case 130:return Yn.LaserFence;case 131:return Yn.LaserSquareFence;case 132:return Yn.ForestLaserFenceSwitch;case 133:return Yn.LightRays;case 134:return Yn.BlueButterfly;case 135:return Yn.Probe;case 136:return Yn.RandomTypeBox1;case 137:return Yn.ForestWeatherStation;case 138:return Yn.Battery;case 139:return Yn.ForestConsole;case 140:return Yn.BlackSlidingDoor;case 141:return Yn.RicoMessagePod;case 142:return Yn.EnergyBarrier;case 143:return Yn.ForestRisingBridge;case 144:return Yn.SwitchNoneDoor;case 145:return Yn.EnemyBoxGrey;case 146:return Yn.FixedTypeBox;case 147:return Yn.EnemyBoxBrown;case 149:return Yn.EmptyTypeBox;case 150:return Yn.LaserFenseEx;case 151:return Yn.LaserSquareFenceEx;case 192:return Yn.FloorPanel1;case 193:return Yn.Caves4ButtonDoor;case 194:return Yn.CavesNormalDoor;case 195:return Yn.CavesSmashingPillar;case 196:return Yn.CavesSign1;case 197:return Yn.CavesSign2;case 198:return Yn.CavesSign3;case 199:return Yn.HexagalTank;case 200:return Yn.BrownPlatform;case 201:return Yn.WarningLightObject;case 203:return Yn.Rainbow;case 204:return Yn.FloatingJelifish;case 205:return Yn.FloatingDragonfly;case 206:return Yn.CavesSwitchDoor;case 207:return Yn.RobotRechargeStation;case 208:return Yn.CavesCakeShop;case 209:return Yn.Caves1SmallRedRock;case 210:return Yn.Caves1MediumRedRock;case 211:return Yn.Caves1LargeRedRock;case 212:return Yn.Caves2SmallRock1;case 213:return Yn.Caves2MediumRock1;case 214:return Yn.Caves2LargeRock1;case 215:return Yn.Caves2SmallRock2;case 216:return Yn.Caves2MediumRock2;case 217:return Yn.Caves2LargeRock2;case 218:return Yn.Caves3SmallRock;case 219:return Yn.Caves3MediumRock;case 220:return Yn.Caves3LargeRock;case 222:return Yn.FloorPanel2;case 223:return Yn.DestructableRockCaves1;case 224:return Yn.DestructableRockCaves2;case 225:return Yn.DestructableRockCaves3;case 256:return Yn.MinesDoor;case 257:return Yn.FloorPanel3;case 258:return Yn.MinesSwitchDoor;case 259:return Yn.LargeCryoTube;case 260:return Yn.ComputerLikeCalus;case 261:return Yn.GreenScreenOpeningAndClosing;case 262:return Yn.FloatingRobot;case 263:return Yn.FloatingBlueLight;case 264:return Yn.SelfDestructingObject1;case 265:return Yn.SelfDestructingObject2;case 266:return Yn.SelfDestructingObject3;case 267:return Yn.SparkMachine;case 268:return Yn.MinesLargeFlashingCrate;case 304:return Yn.RuinsSeal;case 320:return Yn.RuinsTeleporter;case 321:return Yn.RuinsWarpSiteToSite;case 322:return Yn.RuinsSwitch;case 323:return Yn.FloorPanel4;case 324:return Yn.Ruins1Door;case 325:return Yn.Ruins3Door;case 326:return Yn.Ruins2Door;case 327:return Yn.Ruins11ButtonDoor;case 328:return Yn.Ruins21ButtonDoor;case 329:return Yn.Ruins31ButtonDoor;case 330:return Yn.Ruins4ButtonDoor;case 331:return Yn.Ruins2ButtonDoor;case 332:return Yn.RuinsSensor;case 333:return Yn.RuinsFenceSwitch;case 334:return Yn.RuinsLaserFence4x2;case 335:return Yn.RuinsLaserFence6x2;case 336:return Yn.RuinsLaserFence4x4;case 337:return Yn.RuinsLaserFence6x4;case 338:return Yn.RuinsPoisonBlob;case 339:return Yn.RuinsPilarTrap;case 340:return Yn.PopupTrapNoTech;case 341:return Yn.RuinsCrystal;case 342:return Yn.Monument;case 345:return Yn.RuinsRock1;case 346:return Yn.RuinsRock2;case 347:return Yn.RuinsRock3;case 348:return Yn.RuinsRock4;case 349:return Yn.RuinsRock5;case 350:return Yn.RuinsRock6;case 351:return Yn.RuinsRock7;case 352:return Yn.Poison;case 353:return Yn.FixedBoxTypeRuins;case 354:return Yn.RandomBoxTypeRuins;case 355:return Yn.EnemyTypeBoxYellow;case 356:return Yn.EnemyTypeBoxBlue;case 357:return Yn.EmptyTypeBoxBlue;case 358:return Yn.DestructableRock;case 359:return Yn.PopupTrapsTechs;case 368:return Yn.FlyingWhiteBird;case 369:return Yn.Tower;case 370:return Yn.FloatingRocks;case 371:return Yn.FloatingSoul;case 372:return Yn.Butterfly;case 384:return Yn.LobbyGameMenu;case 385:return Yn.LobbyWarpObject;case 386:return Yn.Lobby1EventObjectDefaultTree;case 387:return Yn.UnknownItem387;case 388:return Yn.UnknownItem388;case 389:return Yn.UnknownItem389;case 390:return Yn.LobbyEventObjectStaticPumpkin;case 391:return Yn.LobbyEventObject3ChristmasWindows;case 392:return Yn.LobbyEventObjectRedAndWhiteCurtain;case 393:return Yn.UnknownItem393;case 394:return Yn.UnknownItem394;case 395:return Yn.LobbyFishTank;case 396:return Yn.LobbyEventObjectButterflies;case 400:return Yn.UnknownItem400;case 401:return Yn.GreyWallLow;case 402:return Yn.SpaceshipDoor;case 403:return Yn.GreyWallHigh;case 416:return Yn.TempleNormalDoor;case 417:return Yn.BreakableWallWallButUnbreakable;case 418:return Yn.BrokenCilinderAndRubble;case 419:return Yn.ThreeBrokenWallPiecesOnFloor;case 420:return Yn.HighBrickCilinder;case 421:return Yn.LyingCilinder;case 422:return Yn.BrickConeWithFlatTop;case 423:return Yn.BreakableTempleWall;case 424:return Yn.TempleMapDetect;case 425:return Yn.SmallBrownBrickRisingBridge;case 426:return Yn.LongRisingBridgeWithPinkHighEdges;case 427:return Yn.FourSwitchTempleDoor;case 448:return Yn.FourButtonSpaceshipDoor;case 512:return Yn.ItemBoxCca;case 513:return Yn.TeleporterEp2;case 514:return Yn.CCADoor;case 515:return Yn.SpecialBoxCCA;case 516:return Yn.BigCCADoor;case 517:return Yn.BigCCADoorSwitch;case 518:return Yn.LittleRock;case 519:return Yn.Little3StoneWall;case 520:return Yn.Medium3StoneWall;case 521:return Yn.SpiderPlant;case 522:return Yn.CCAAreaTeleporter;case 523:return Yn.UnknownItem523;case 524:return Yn.WhiteBird;case 525:return Yn.OrangeBird;case 527:return Yn.Saw;case 528:return Yn.LaserDetect;case 529:return Yn.UnknownItem529;case 530:return Yn.UnknownItem530;case 531:return Yn.Seagull;case 544:return Yn.Fish;case 545:return Yn.SeabedDoorWithBlueEdges;case 546:return Yn.SeabedDoorAlwaysOpenNonTriggerable;case 547:return Yn.LittleCryotube;case 548:return Yn.WideGlassWallBreakable;case 549:return Yn.BlueFloatingRobot;case 550:return Yn.RedFloatingRobot;case 551:return Yn.Dolphin;case 552:return Yn.CaptureTrap;case 553:return Yn.VRLink;case 576:return Yn.UnknownItem576;case 640:return Yn.WarpInBarbaRayRoom;case 672:return Yn.UnknownItem672;case 688:return Yn.GeeNest;case 689:return Yn.LabComputerConsole;case 690:return Yn.LabComputerConsoleGreenScreen;case 691:return Yn.ChairYelllowPillow;case 692:return Yn.OrangeWallWithHoleInMiddle;case 693:return Yn.GreyWallWithHoleInMiddle;case 694:return Yn.LongTable;case 695:return Yn.GBAStation;case 696:return Yn.TalkLinkToSupport;case 697:return Yn.InstaWarp;case 698:return Yn.LabInvisibleObject;case 699:return Yn.LabGlassWindowDoor;case 700:return Yn.UnknownItem700;case 701:return Yn.LabCelingWarp;case 768:return Yn.Ep4LightSource;case 769:return Yn.Cacti;case 770:return Yn.BigBrownRock;case 771:return Yn.BreakableBrownRock;case 832:return Yn.UnknownItem832;case 833:return Yn.UnknownItem833;case 896:return Yn.PoisonPlant;case 897:return Yn.UnknownItem897;case 898:return Yn.UnknownItem898;case 899:return Yn.OozingDesertPlant;case 901:return Yn.UnknownItem901;case 902:return Yn.BigBlackRocks;case 903:return Yn.UnknownItem903;case 904:return Yn.UnknownItem904;case 905:return Yn.UnknownItem905;case 906:return Yn.UnknownItem906;case 907:return Yn.FallingRock;case 908:return Yn.DesertPlantHasCollision;case 909:return Yn.DesertFixedTypeBoxBreakableCrystals;case 910:return Yn.UnknownItem910;case 911:return Yn.BeeHive;case 912:return Yn.UnknownItem912;case 913:return Yn.Heat;case 960:return Yn.TopOfSaintMillionEgg;case 961:return Yn.UnknownItem961}}(e.type_id);return{type:t,id:e.id,group_id:e.group_id,area_id:e.area_id,section_id:e.section_id,position:e.position,rotation:e.rotation,properties:new Map(e.properties.map((e,n)=>3!==n||t!==Yn.ScriptCollision&&t!==Yn.ForestConsole?4===n&&t===Yn.RicoMessagePod?["script_label",e]:5===n&&t===Yn.RicoMessagePod?["script_label_2",e]:[`property_${n}`,e]:["script_label",e])),unknown:e.unknown}});const a=xn(gn(new Gt(o.data,Mt.Little)),function(e,t){const n=new Set([0]);for(const t of e){const e=t.properties.get("script_label");null!=e&&n.add(e);const i=t.properties.get("script_label_2");null!=i&&n.add(i)}for(const e of t)n.add(Math.round(e.script_label));return[...n]}(s,r.npcs),t);let d=Re.I,l=new Map;if(a.object_code.length){let e;for(const t of a.object_code)if(t.type===pn.Instructions&&t.labels.includes(0)){e=t;break}e?(d=function(e){const t=e.find(e=>e.opcode===cn.SET_EPISODE);if(!t)return oi.debug("Function 0 has no set_episode instruction."),Re.I;switch(t.args[0].value){default:case 0:return Re.I;case 1:return Re.II;case 2:return Re.IV}}(e.instructions),l=function(e,t,n){const i=new Map;for(const e of n)e.opcode===cn.BB_MAP_DESIGNATE&&i.set(e.args[0].value,e.args[2].value);return i}(0,0,e.instructions)):oi.warn("No instruction for label 0 found.")}else oi.warn("File contains no instruction labels.");return{id:a.quest_id,language:a.language,name:a.quest_name,short_description:a.short_description,long_description:a.long_description,episode:d,objects:s,npcs:ai(d,r.npcs),dat_unknowns:r.unknowns,object_code:a.object_code,shop_items:a.shop_items,map_designations:l}}function si(e,t){const n=function({objs:e,npcs:t,unknowns:n}){const i=new wn(e.length*(16+$n)+t.length*(16+Jn)+n.reduce((e,t)=>e+t.total_size,0)),o=new vn(i,Mt.Little),r=Object(U.groupBy)(e,e=>e.area_id),s=Object.keys(r).map(e=>parseInt(e,10)).sort((e,t)=>e-t);for(const e of s){const t=r[e],n=t.length*$n;o.write_u32(1),o.write_u32(n+16),o.write_u32(e),o.write_u32(n);for(const e of t){if(2!==e.unknown.length)throw new Error(`unknown should be of length 2, was ${e.unknown.length}`);if(o.write_u16(e.type_id),6!==e.unknown[0].length)throw new Error(`unknown[0] should be of length 6, was ${e.unknown[0].length}`);if(o.write_u8_array(e.unknown[0]),o.write_u16(e.id),o.write_u16(e.group_id),o.write_u16(e.section_id),2!==e.unknown[1].length)throw new Error(`unknown[1] should be of length 2, was ${e.unknown[1].length}`);if(o.write_u8_array(e.unknown[1]),o.write_vec3_f32(e.position),o.write_i32(Math.round(e.rotation.x/(2*Math.PI)*65535)),o.write_i32(Math.round(e.rotation.y/(2*Math.PI)*65535)),o.write_i32(Math.round(e.rotation.z/(2*Math.PI)*65535)),7!==e.properties.length)throw new Error(`properties should be of length 7, was ${e.properties.length}`);o.write_f32(e.properties[0]),o.write_f32(e.properties[1]),o.write_f32(e.properties[2]),o.write_u32(e.properties[3]),o.write_u32(e.properties[4]),o.write_u32(e.properties[5]),o.write_u32(e.properties[6])}}const a=Object(U.groupBy)(t,e=>e.area_id),d=Object.keys(a).map(e=>parseInt(e,10)).sort((e,t)=>e-t);for(const e of d){const t=a[e],n=t.length*Jn;o.write_u32(2),o.write_u32(n+16),o.write_u32(e),o.write_u32(n);for(const e of t){if(3!==e.unknown.length)throw new Error(`unknown should be of length 3, was ${e.unknown.length}`);if(o.write_u16(e.type_id),10!==e.unknown[0].length)throw new Error(`unknown[0] should be of length 10, was ${e.unknown[0].length}`);if(o.write_u8_array(e.unknown[0]),o.write_u16(e.section_id),6!==e.unknown[1].length)throw new Error(`unknown[1] should be of length 6, was ${e.unknown[1].length}`);if(o.write_u8_array(e.unknown[1]),o.write_vec3_f32(e.position),o.write_i32(Math.round(e.rotation.x/(2*Math.PI)*65535)),o.write_i32(Math.round(e.rotation.y/(2*Math.PI)*65535)),o.write_i32(Math.round(e.rotation.z/(2*Math.PI)*65535)),o.write_vec3_f32(e.scale),o.write_f32(e.npc_id),o.write_f32(e.script_label),o.write_u32(e.roaming),4!==e.unknown[2].length)throw new Error(`unknown[2] should be of length 4, was ${e.unknown[2].length}`);o.write_u8_array(e.unknown[2])}}for(const e of n)o.write_u32(e.entity_type),o.write_u32(e.total_size),o.write_u32(e.area_id),o.write_u32(e.entities_size),o.write_u8_array(e.data);return o.write_u32(0),o.write_u32(0),o.write_u32(0),o.write_u32(0),i}({objs:(i=e.objects,i.map(e=>({type_id:Zn(e.type).pso_id,id:e.id,group_id:e.group_id,section_id:e.section_id,position:e.position,rotation:e.rotation,properties:[...e.properties.values()],area_id:e.area_id,unknown:e.unknown}))),npcs:li(e.npcs),unknowns:e.dat_unknowns});var i;const o=jn(new Bn(e.id,e.language,e.name,e.short_description,e.long_description,e.object_code,e.shop_items)),r=t.lastIndexOf("."),s=-1===r?t.slice(0,11):t.slice(0,Math.min(11,r));return ni({files:[{name:s+".dat",id:e.id,data:hn(new vn(n,Mt.Little)).array_buffer()},{name:s+".bin",id:e.id,data:hn(new Gt(o,Mt.Little)).array_buffer()}]})}function ai(e,t){return t.map(t=>({type:di(e,t),area_id:t.area_id,section_id:t.section_id,position:t.position,rotation:t.rotation,scale:t.scale,unknown:t.unknown,pso_type_id:t.type_id,npc_id:t.npc_id,script_label:Math.round(t.script_label),roaming:t.roaming}))}function di(e,{type_id:t,scale:n,roaming:i,area_id:o}){const r=Math.abs(n.y-1)>1e-5;switch(`${t}, ${i%3}, ${e}`){case"68, 0, 1":return Ee.Booma;case"68, 1, 1":return Ee.Gobooma;case"68, 2, 1":return Ee.Gigobooma;case"99, 0, 1":return Ee.EvilShark;case"99, 1, 1":return Ee.PalShark;case"99, 2, 1":return Ee.GuilShark;case"166, 0, 1":return Ee.Dimenian;case"166, 0, 2":return Ee.Dimenian2;case"166, 1, 1":return Ee.LaDimenian;case"166, 1, 2":return Ee.LaDimenian2;case"166, 2, 1":return Ee.SoDimenian;case"166, 2, 2":return Ee.SoDimenian2;case"214, 0, 2":return Ee.Mericarol;case"214, 1, 2":return Ee.Mericus;case"214, 2, 2":return Ee.Merikle;case"277, 0, 4":return Ee.Boota;case"277, 1, 4":return Ee.ZeBoota;case"277, 2, 4":return Ee.BaBoota;case"279, 0, 4":return Ee.Goran;case"279, 1, 4":return Ee.PyroGoran;case"279, 2, 4":return Ee.GoranDetonator}switch(`${t}, ${i%2}, ${e}`){case"64, 0, 1":return Ee.Hildebear;case"64, 0, 2":return Ee.Hildebear2;case"64, 1, 1":return Ee.Hildeblue;case"64, 1, 2":return Ee.Hildeblue2;case"65, 0, 1":return Ee.RagRappy;case"65, 0, 2":return Ee.RagRappy2;case"65, 0, 4":return Ee.SandRappy;case"65, 1, 1":return Ee.AlRappy;case"65, 1, 2":return Ee.LoveRappy;case"65, 1, 4":return Ee.DelRappy;case"128, 0, 1":return Ee.Dubchic;case"128, 0, 2":return Ee.Dubchic2;case"128, 1, 1":return Ee.Gilchic;case"128, 1, 2":return Ee.Gilchic2;case"212, 0, 2":return Ee.SinowBerill;case"212, 1, 2":return Ee.SinowSpigell;case"213, 0, 2":return Ee.Merillia;case"213, 1, 2":return Ee.Meriltas;case"215, 0, 2":return Ee.UlGibbon;case"215, 1, 2":return Ee.ZolGibbon;case"221, 0, 2":return Ee.Dolmolm;case"221, 1, 2":return Ee.Dolmdarl;case"224, 0, 2":return o>15?Ee.Epsilon:Ee.SinowZoa;case"224, 1, 2":return o>15?Ee.Epsilon:Ee.SinowZele;case"274, 0, 4":return Ee.MerissaA;case"274, 1, 4":return Ee.MerissaAA;case"276, 0, 4":return Ee.Zu;case"276, 1, 4":return Ee.Pazuzu;case"278, 0, 4":return Ee.Dorphon;case"278, 1, 4":return Ee.DorphonEclair;case"281, 0, 4":return r?Ee.SaintMilion:Ee.Kondrieu;case"281, 1, 4":return r?Ee.Shambertin:Ee.Kondrieu}switch(`${t}, ${e}`){case"66, 1":return Ee.Monest;case"66, 2":return Ee.Monest2;case"67, 1":return r?Ee.SavageWolf:Ee.BarbarousWolf;case"67, 2":return r?Ee.SavageWolf2:Ee.BarbarousWolf2;case"96, 1":return Ee.GrassAssassin;case"96, 2":return Ee.GrassAssassin2;case"97, 1":return o>15?Ee.DelLily:r?Ee.PoisonLily:Ee.NarLily;case"97, 2":return o>15?Ee.DelLily:r?Ee.PoisonLily2:Ee.NarLily2;case"98, 1":return Ee.NanoDragon;case"100, 1":return r?Ee.PofuillySlime:Ee.PouillySlime;case"101, 1":return Ee.PanArms;case"101, 2":return Ee.PanArms2;case"129, 1":return Ee.Garanz;case"129, 2":return Ee.Garanz2;case"130, 1":return r?Ee.SinowBeat:Ee.SinowGold;case"131, 1":return Ee.Canadine;case"132, 1":return Ee.Canane;case"133, 1":return Ee.Dubswitch;case"133, 2":return Ee.Dubswitch2;case"160, 1":return Ee.Delsaber;case"160, 2":return Ee.Delsaber2;case"161, 1":return Ee.ChaosSorcerer;case"161, 2":return Ee.ChaosSorcerer2;case"162, 1":return Ee.DarkGunner;case"164, 1":return Ee.ChaosBringer;case"165, 1":return Ee.DarkBelra;case"165, 2":return Ee.DarkBelra2;case"167, 1":return Ee.Bulclaw;case"168, 1":return Ee.Claw;case"192, 1":return Ee.Dragon;case"192, 2":return Ee.GalGryphon;case"193, 1":return Ee.DeRolLe;case"197, 1":return Ee.VolOpt;case"200, 1":return Ee.DarkFalz;case"202, 2":return Ee.OlgaFlow;case"203, 2":return Ee.BarbaRay;case"204, 2":return Ee.GolDragon;case"216, 2":return Ee.Gibbles;case"217, 2":return Ee.Gee;case"218, 2":return Ee.GiGue;case"219, 2":return Ee.Deldepth;case"220, 2":return Ee.Delbiter;case"222, 2":return Ee.Morfos;case"223, 2":return Ee.Recobox;case"225, 2":return Ee.IllGill;case"272, 4":return Ee.Astark;case"273, 4":return r?Ee.SatelliteLizard:Ee.Yowie;case"275, 4":return Ee.Girtablulu}switch(t){case 4:return Ee.FemaleFat;case 5:return Ee.FemaleMacho;case 7:return Ee.FemaleTall;case 10:return Ee.MaleDwarf;case 11:return Ee.MaleFat;case 12:return Ee.MaleMacho;case 13:return Ee.MaleOld;case 25:return Ee.BlueSoldier;case 26:return Ee.RedSoldier;case 27:return Ee.Principal;case 28:return Ee.Tekker;case 29:return Ee.GuildLady;case 30:return Ee.Scientist;case 31:return Ee.Nurse;case 32:return Ee.Irene;case 241:return Ee.ItemShop;case 254:return Ee.Nurse2}return Ee.Unknown}function li(e){const t=new DataView(new ArrayBuffer(4));return e.map(e=>{const n=function(e){switch(e){default:throw new Error(`Unexpected type ${Ee[e]}.`);case Ee.Unknown:return;case Ee.FemaleFat:return{type_id:4,roaming:0,regular:!0};case Ee.FemaleMacho:return{type_id:5,roaming:0,regular:!0};case Ee.FemaleTall:return{type_id:7,roaming:0,regular:!0};case Ee.MaleDwarf:return{type_id:10,roaming:0,regular:!0};case Ee.MaleFat:return{type_id:11,roaming:0,regular:!0};case Ee.MaleMacho:return{type_id:12,roaming:0,regular:!0};case Ee.MaleOld:return{type_id:13,roaming:0,regular:!0};case Ee.BlueSoldier:return{type_id:25,roaming:0,regular:!0};case Ee.RedSoldier:return{type_id:26,roaming:0,regular:!0};case Ee.Principal:return{type_id:27,roaming:0,regular:!0};case Ee.Tekker:return{type_id:28,roaming:0,regular:!0};case Ee.GuildLady:return{type_id:29,roaming:0,regular:!0};case Ee.Scientist:return{type_id:30,roaming:0,regular:!0};case Ee.Nurse:return{type_id:31,roaming:0,regular:!0};case Ee.Irene:return{type_id:32,roaming:0,regular:!0};case Ee.ItemShop:return{type_id:241,roaming:0,regular:!0};case Ee.Nurse2:return{type_id:254,roaming:0,regular:!0};case Ee.Hildebear:return{type_id:64,roaming:0,regular:!0};case Ee.Hildeblue:return{type_id:64,roaming:1,regular:!0};case Ee.RagRappy:return{type_id:65,roaming:0,regular:!0};case Ee.AlRappy:return{type_id:65,roaming:1,regular:!0};case Ee.Monest:return{type_id:66,roaming:0,regular:!0};case Ee.SavageWolf:return{type_id:67,roaming:0,regular:!0};case Ee.BarbarousWolf:return{type_id:67,roaming:0,regular:!1};case Ee.Booma:return{type_id:68,roaming:0,regular:!0};case Ee.Gobooma:return{type_id:68,roaming:1,regular:!0};case Ee.Gigobooma:return{type_id:68,roaming:2,regular:!0};case Ee.Dragon:return{type_id:192,roaming:0,regular:!0};case Ee.GrassAssassin:return{type_id:96,roaming:0,regular:!0};case Ee.PoisonLily:return{type_id:97,roaming:0,regular:!0};case Ee.NarLily:return{type_id:97,roaming:1,regular:!0};case Ee.NanoDragon:return{type_id:98,roaming:0,regular:!0};case Ee.EvilShark:return{type_id:99,roaming:0,regular:!0};case Ee.PalShark:return{type_id:99,roaming:1,regular:!0};case Ee.GuilShark:return{type_id:99,roaming:2,regular:!0};case Ee.PofuillySlime:return{type_id:100,roaming:0,regular:!0};case Ee.PouillySlime:return{type_id:100,roaming:0,regular:!1};case Ee.PanArms:return{type_id:101,roaming:0,regular:!0};case Ee.DeRolLe:return{type_id:193,roaming:0,regular:!0};case Ee.Dubchic:return{type_id:128,roaming:0,regular:!0};case Ee.Gilchic:return{type_id:128,roaming:1,regular:!0};case Ee.Garanz:return{type_id:129,roaming:0,regular:!0};case Ee.SinowBeat:return{type_id:130,roaming:0,regular:!0};case Ee.SinowGold:return{type_id:130,roaming:0,regular:!1};case Ee.Canadine:return{type_id:131,roaming:0,regular:!0};case Ee.Canane:return{type_id:132,roaming:0,regular:!0};case Ee.Dubswitch:return{type_id:133,roaming:0,regular:!0};case Ee.VolOpt:return{type_id:197,roaming:0,regular:!0};case Ee.Delsaber:return{type_id:160,roaming:0,regular:!0};case Ee.ChaosSorcerer:return{type_id:161,roaming:0,regular:!0};case Ee.DarkGunner:return{type_id:162,roaming:0,regular:!0};case Ee.ChaosBringer:return{type_id:164,roaming:0,regular:!0};case Ee.DarkBelra:return{type_id:165,roaming:0,regular:!0};case Ee.Dimenian:return{type_id:166,roaming:0,regular:!0};case Ee.LaDimenian:return{type_id:166,roaming:1,regular:!0};case Ee.SoDimenian:return{type_id:166,roaming:2,regular:!0};case Ee.Bulclaw:return{type_id:167,roaming:0,regular:!0};case Ee.Claw:return{type_id:168,roaming:0,regular:!0};case Ee.DarkFalz:return{type_id:200,roaming:0,regular:!0};case Ee.Hildebear2:return{type_id:64,roaming:0,regular:!0};case Ee.Hildeblue2:return{type_id:64,roaming:1,regular:!0};case Ee.RagRappy2:return{type_id:65,roaming:0,regular:!0};case Ee.LoveRappy:return{type_id:65,roaming:1,regular:!0};case Ee.Monest2:return{type_id:66,roaming:0,regular:!0};case Ee.PoisonLily2:return{type_id:97,roaming:0,regular:!0};case Ee.NarLily2:return{type_id:97,roaming:1,regular:!0};case Ee.GrassAssassin2:return{type_id:96,roaming:0,regular:!0};case Ee.Dimenian2:return{type_id:166,roaming:0,regular:!0};case Ee.LaDimenian2:return{type_id:166,roaming:1,regular:!0};case Ee.SoDimenian2:return{type_id:166,roaming:2,regular:!0};case Ee.DarkBelra2:return{type_id:165,roaming:0,regular:!0};case Ee.BarbaRay:return{type_id:203,roaming:0,regular:!0};case Ee.SavageWolf2:return{type_id:67,roaming:0,regular:!0};case Ee.BarbarousWolf2:return{type_id:67,roaming:0,regular:!1};case Ee.PanArms2:return{type_id:101,roaming:0,regular:!0};case Ee.Dubchic2:return{type_id:128,roaming:0,regular:!0};case Ee.Gilchic2:return{type_id:128,roaming:1,regular:!0};case Ee.Garanz2:return{type_id:129,roaming:0,regular:!0};case Ee.Dubswitch2:return{type_id:133,roaming:0,regular:!0};case Ee.Delsaber2:return{type_id:160,roaming:0,regular:!0};case Ee.ChaosSorcerer2:return{type_id:161,roaming:0,regular:!0};case Ee.GolDragon:return{type_id:204,roaming:0,regular:!0};case Ee.SinowBerill:return{type_id:212,roaming:0,regular:!0};case Ee.SinowSpigell:return{type_id:212,roaming:1,regular:!0};case Ee.Merillia:return{type_id:213,roaming:0,regular:!0};case Ee.Meriltas:return{type_id:213,roaming:1,regular:!0};case Ee.Mericarol:return{type_id:214,roaming:0,regular:!0};case Ee.Mericus:return{type_id:214,roaming:1,regular:!0};case Ee.Merikle:return{type_id:214,roaming:2,regular:!0};case Ee.UlGibbon:return{type_id:215,roaming:0,regular:!0};case Ee.ZolGibbon:return{type_id:215,roaming:1,regular:!0};case Ee.Gibbles:return{type_id:216,roaming:0,regular:!0};case Ee.Gee:return{type_id:217,roaming:0,regular:!0};case Ee.GiGue:return{type_id:218,roaming:0,regular:!0};case Ee.GalGryphon:return{type_id:192,roaming:0,regular:!0};case Ee.Deldepth:return{type_id:219,roaming:0,regular:!0};case Ee.Delbiter:return{type_id:220,roaming:0,regular:!0};case Ee.Dolmolm:return{type_id:221,roaming:0,regular:!0};case Ee.Dolmdarl:return{type_id:221,roaming:1,regular:!0};case Ee.Morfos:return{type_id:222,roaming:0,regular:!0};case Ee.Recobox:return{type_id:223,roaming:0,regular:!0};case Ee.Epsilon:case Ee.SinowZoa:return{type_id:224,roaming:0,regular:!0};case Ee.SinowZele:return{type_id:224,roaming:1,regular:!0};case Ee.IllGill:return{type_id:225,roaming:0,regular:!0};case Ee.DelLily:return{type_id:97,roaming:0,regular:!0};case Ee.OlgaFlow:return{type_id:202,roaming:0,regular:!0};case Ee.SandRappy:return{type_id:65,roaming:0,regular:!0};case Ee.DelRappy:return{type_id:65,roaming:1,regular:!0};case Ee.Astark:return{type_id:272,roaming:0,regular:!0};case Ee.SatelliteLizard:return{type_id:273,roaming:0,regular:!0};case Ee.Yowie:return{type_id:273,roaming:0,regular:!1};case Ee.MerissaA:return{type_id:274,roaming:0,regular:!0};case Ee.MerissaAA:return{type_id:274,roaming:1,regular:!0};case Ee.Girtablulu:return{type_id:275,roaming:0,regular:!0};case Ee.Zu:return{type_id:276,roaming:0,regular:!0};case Ee.Pazuzu:return{type_id:276,roaming:1,regular:!0};case Ee.Boota:return{type_id:277,roaming:0,regular:!0};case Ee.ZeBoota:return{type_id:277,roaming:1,regular:!0};case Ee.BaBoota:return{type_id:277,roaming:2,regular:!0};case Ee.Dorphon:return{type_id:278,roaming:0,regular:!0};case Ee.DorphonEclair:return{type_id:278,roaming:1,regular:!0};case Ee.Goran:return{type_id:279,roaming:0,regular:!0};case Ee.PyroGoran:return{type_id:279,roaming:1,regular:!0};case Ee.GoranDetonator:return{type_id:279,roaming:2,regular:!0};case Ee.SaintMilion:return{type_id:281,roaming:0,regular:!0};case Ee.Shambertin:return{type_id:281,roaming:1,regular:!0};case Ee.Kondrieu:return{type_id:281,roaming:0,regular:!1}}}(e.type)||{type_id:e.pso_type_id,roaming:e.roaming,regular:!0};t.setFloat32(0,e.scale.y),t.setUint32(0,-8388609&t.getUint32(0)|(n.regular?0:8388608));const i=t.getFloat32(0);let o=new At(e.scale.x,i,e.scale.z);return{type_id:n.type_id,section_id:e.section_id,position:e.position,rotation:e.rotation,scale:o,npc_id:e.npc_id,script_label:e.script_label,roaming:n.roaming,area_id:e.area_id,unknown:e.unknown}})}var ui=function(e,t,n,i){return new(n||(n=Promise))(function(o,r){function s(e){try{d(i.next(e))}catch(e){r(e)}}function a(e){try{d(i.throw(e))}catch(e){r(e)}}function d(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(s,a)}d((i=i.apply(e,t||[])).next())})};function ci(e){return ui(this,void 0,void 0,function*(){return new Promise((t,n)=>{const i=new FileReader;i.addEventListener("loadend",()=>{i.result instanceof ArrayBuffer?t(i.result):n(new Error("Couldn't read file."))}),i.readAsArrayBuffer(e)})})}var _i=function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s};class pi{constructor(e,t,n){this.description=e,this.undo=t,this.redo=n}}class vi{get can_undo(){return!!this.current&&this.current.can_undo}get can_redo(){return!!this.current&&this.current.can_redo}get first_undo(){return this.current&&this.current.first_undo}get first_redo(){return this.current&&this.current.first_redo}undo(){return!!this.current&&this.current.undo()}redo(){return!!this.current&&this.current.redo()}}_i([T.n],vi.prototype,"current",void 0),_i([T.f],vi.prototype,"can_undo",null),_i([T.f],vi.prototype,"can_redo",null),_i([T.f],vi.prototype,"first_undo",null),_i([T.f],vi.prototype,"first_redo",null);const wi=new vi;class hi{constructor(e,t,n){this._can_undo=!1,this._can_redo=!1,this.action=new pi(e,t,n)}make_current(){wi.current=this}ensure_not_current(){wi.current===this&&(wi.current=void 0)}get can_undo(){return this._can_undo}set can_undo(e){this._can_undo=e}get can_redo(){return this._can_redo}set can_redo(e){this._can_redo=e}get first_undo(){return this.can_undo?this.action:void 0}get first_redo(){return this.can_redo?this.action:void 0}undo(){return!!this.can_undo&&(this.action.undo(),!0)}redo(){return!!this.can_redo&&(this.action.redo(),!0)}reset(){this._can_undo=!1,this._can_redo=!1}}_i([T.n.ref],hi.prototype,"action",void 0),_i([T.d],hi.prototype,"make_current",null),_i([T.d],hi.prototype,"ensure_not_current",null),_i([T.n],hi.prototype,"_can_undo",void 0),_i([T.n],hi.prototype,"_can_redo",void 0),_i([T.f],hi.prototype,"first_undo",null),_i([T.f],hi.prototype,"first_redo",null),_i([T.d],hi.prototype,"undo",null),_i([T.d],hi.prototype,"redo",null),_i([T.d],hi.prototype,"reset",null);class fi{constructor(){this.stack=T.n.array([],{deep:!1}),this.index=0}make_current(){wi.current=this}ensure_not_current(){wi.current===this&&(wi.current=void 0)}get can_undo(){return this.index>0}get can_redo(){return this.index<this.stack.length}get first_undo(){return this.can_undo?this.stack[this.index-1]:void 0}get first_redo(){return this.can_redo?this.stack[this.index]:void 0}push_action(e,t,n){this.push(new pi(e,t,n))}push(e){this.stack.splice(this.index,this.stack.length-this.index,e),this.index++}pop(){return this.stack.splice(--this.index,1)[0]}undo(){return!!this.can_undo&&(this.stack[--this.index].undo(),!0)}redo(){return!!this.can_redo&&(this.stack[this.index++].redo(),!0)}reset(){this.stack.clear(),this.index=0}}function mi(e,t){e.seek_end(32);const n=e.u32(),i=e.u32();e.seek(8);const o=e.u32();return e.seek_start(n),{data_offset:o,index:t?function(e,t){const n=e.u16_array(t),i=[];let o=0;for(const t of n){o+=4*t,e.seek_start(o-4);const n=e.u32(),r=e.u32();i.push({offset:r,size:n})}return i}(e,i):[]}}function gi(e){const t=[];for(;e.bytes_left;){const n=e.u32(),i=e.u32();if(i>e.bytes_left)break;t.push({type:n,data:e.take(i)})}return t}_i([T.n],fi.prototype,"stack",void 0),_i([T.n],fi.prototype,"index",void 0),_i([T.d],fi.prototype,"make_current",null),_i([T.d],fi.prototype,"ensure_not_current",null),_i([T.f],fi.prototype,"can_undo",null),_i([T.f],fi.prototype,"can_redo",null),_i([T.f],fi.prototype,"first_undo",null),_i([T.f],fi.prototype,"first_redo",null),_i([T.d],fi.prototype,"push_action",null),_i([T.d],fi.prototype,"push",null),_i([T.d],fi.prototype,"pop",null),_i([T.d],fi.prototype,"undo",null),_i([T.d],fi.prototype,"redo",null),_i([T.d],fi.prototype,"reset",null);const yi=d.a.get("data_formats/parsing/ninja/njcm");var ki;function Ri(e,t){const n=e.u32(),i=e.u32(),o=e.vec3_f32(),r=e.f32(),s=[],a=[];if(n){e.seek_start(n);for(const n of bi(e,t,!0))if(n.type===ki.Vertex)for(const e of n.vertices)s[e.index]={position:e.position,normal:e.normal,bone_weight:e.bone_weight,bone_weight_status:e.bone_weight_status,calc_continue:e.calc_continue}}if(i){let n;e.seek_start(i);for(const i of bi(e,t,!1))if(i.type===ki.Tiny)n=i.texture_id;else if(i.type===ki.Strip){for(const e of i.triangle_strips)e.texture_id=n;a.push(...i.triangle_strips)}}return{type:"njcm",vertices:s,meshes:a,collision_sphere_center:o,collision_sphere_radius:r}}function bi(e,t,n){const i=[];let o=!0;for(;o;){const r=e.u8(),s=e.u8(),a=e.position;let d=0;if(0===r)i.push({type:ki.Null,type_id:r});else if(1<=r&&r<=3)i.push({type:ki.Bits,type_id:r});else if(4===r){const n=s,a=e.position;i.push({type:ki.CachePolygonList,type_id:r,cache_index:n,offset:a}),t[n]=a,o=!1}else if(5===r){const o=s,a=t[o];null!=a&&(e.seek_start(a),i.push(...bi(e,t,n))),i.push({type:ki.DrawPolygonList,type_id:r,cache_index:o})}else if(8<=r&&r<=9){d=2;const t=e.u16();i.push({type:ki.Tiny,type_id:r,flip_u:0!=(128&r),flip_v:0!=(64&r),clamp_u:0!=(32&r),clamp_v:0!=(16&r),mipmap_d_adjust:15&r,filter_mode:t>>>14,super_sample:0!=(64&t),texture_id:8191&t})}else 17<=r&&r<=31?(d=2+2*e.u16(),i.push({type:ki.Material,type_id:r})):32<=r&&r<=50?(d=2+4*e.u16(),i.push({type:ki.Vertex,type_id:r,vertices:Ni(e,r,s)})):56<=r&&r<=58?(d=2+2*e.u16(),i.push({type:ki.Volume,type_id:r})):64<=r&&r<=75?(d=2+2*e.u16(),i.push({type:ki.Strip,type_id:r,triangle_strips:Ei(e,r,s)})):255===r?(d=n?2:0,i.push({type:ki.End,type_id:r}),o=!1):(d=2+2*e.u16(),i.push({type:ki.Unknown,type_id:r}),yi.warn(`Unknown chunk type ${r} at offset ${a}.`));e.seek_start(a+d)}return i}function Ni(e,t,n){if(t<32||t>50)return yi.warn(`Unknown vertex chunk type ${t}.`),[];const i=3&n,o=0!=(128&n),r=e.u16(),s=e.u16(),a=[];for(let n=0;n<s;++n){const s={index:r+n,position:e.vec3_f32(),bone_weight:1,bone_weight_status:i,calc_continue:o};if(32===t)e.seek(4);else if(33===t)e.seek(4),s.normal=e.vec3_f32(),e.seek(4);else if(35<=t&&t<=40)37===t?(s.index=r+e.u16(),s.bone_weight=e.u16()/255):e.seek(4);else if(41<=t&&t<=47)s.normal=e.vec3_f32(),t>=42&&(44===t?(s.index=r+e.u16(),s.bone_weight=e.u16()/255):e.seek(4));else if(48<=t&&t<=50){const n=e.u32();s.normal=new At((n>>20&1023)/1023,(n>>10&1023)/1023,(1023&n)/1023),t>=49&&e.seek(4)}a.push(s)}return a}function Ei(e,t,n){const i={ignore_light:0!=(1&n),ignore_specular:0!=(2&n),ignore_ambient:0!=(4&n),use_alpha:0!=(8&n),double_side:0!=(16&n),flat_shading:0!=(32&n),environment_mapping:0!=(64&n)},o=e.u16(),r=o>>>14,s=16383&o;let a=!1,d=!1,l=!1,u=!1;switch(t){case 64:break;case 65:case 66:a=!0;break;case 67:l=!0;break;case 68:case 69:a=!0,l=!0;break;case 70:d=!0;break;case 71:case 72:a=!0,d=!0;break;case 73:break;case 74:case 75:u=!0;break;default:throw new Error(`Unexpected chunk type ID: ${t}.`)}const c=[];for(let t=0;t<s;++t){const t=e.i16(),n=t<1,o=Math.abs(t),s=[];for(let t=0;t<o;++t){const n={index:e.u16()};s.push(n),a&&(n.tex_coords=new Bt(e.u16()/255,e.u16()/255)),d&&e.seek(4),l&&(n.normal=new At(e.u16()/255,e.u16()/255,e.u16()/255)),u&&e.seek(8),t>=2&&e.seek(2*r)}c.push(Object.assign({},i,{clockwise_winding:n,has_tex_coords:a,has_normal:l,vertices:s}))}return c}!function(e){e[e.Unknown=0]="Unknown",e[e.Null=1]="Null",e[e.Bits=2]="Bits",e[e.CachePolygonList=3]="CachePolygonList",e[e.DrawPolygonList=4]="DrawPolygonList",e[e.Tiny=5]="Tiny",e[e.Material=6]="Material",e[e.Vertex=7]="Vertex",e[e.Volume=8]="Volume",e[e.Strip=9]="Strip",e[e.End=10]="End"}(ki||(ki={}));const Ti=d.a.get("data_formats/parsing/ninja/xj");function Si(e){e.seek(4);const t=e.u32(),n=e.u32(),i=e.u32(),o=e.u32(),r=e.u32(),s=e.u32(),a={type:"xj",vertices:[],meshes:[],collision_sphere_position:e.vec3_f32(),collision_sphere_radius:e.f32()};return n>=1&&(n>1&&Ti.warn(`Vertex info count of ${n} was larger than expected.`),a.vertices.push(...function(e,t){e.seek_start(t);const n=e.u16();e.seek(2);const i=e.u32(),o=e.u32(),r=e.u32(),s=[];for(let t=0;t<r;++t){e.seek_start(i+t*o);const r=e.vec3_f32();let a,d;switch(n){case 3:a=e.vec3_f32(),d=e.vec2_f32();break;case 4:break;case 5:e.seek(4),d=e.vec2_f32();break;case 6:a=e.vec3_f32();break;case 7:a=e.vec3_f32(),d=e.vec2_f32();break;default:Ti.warn(`Unknown vertex type ${n} with size ${o}.`)}s.push({position:r,normal:a,uv:d})}return s}(e,t))),a.meshes.push(...Oi(e,i,o)),a.meshes.push(...Oi(e,r,s)),a}function Oi(e,t,n){const i=[];for(let o=0;o<n;++o){e.seek_start(t+20*o);const n=e.u32(),r=e.u32(),s=e.u32(),a=e.u32(),d=Ci(e,n,r);e.seek_start(s);const l=e.u16_array(a);i.push({material_properties:d,indices:l})}return i}function Ci(e,t,n){const i={};for(let o=0;o<n;++o){switch(e.seek_start(t+16*o),e.u32()){case 2:i.alpha_src=e.u32(),i.alpha_dst=e.u32();break;case 3:i.texture_id=e.u32();break;case 5:i.diffuse_r=e.u8(),i.diffuse_g=e.u8(),i.diffuse_b=e.u8(),i.diffuse_a=e.u8()}}return i}const Di=2*Math.PI/65535,Pi=1296255566;class Fi{constructor(e,t,n,i,o,r){this.bone_cache=new Map,this._bone_count=-1,this.evaluation_flags=e,this.model=t,this.position=n,this.rotation=i,this.scale=o,this.children=r}bone_count(){if(-1===this._bone_count){const e=[0];this.get_bone_internal(this,1/0,e),this._bone_count=e[0]}return this._bone_count}get_bone(e){let t=this.bone_cache.get(e);return void 0===t&&(t=this.get_bone_internal(this,e,[0]),this.bone_cache.set(e,t||null)),t||void 0}get_bone_internal(e,t,n){if(!e.evaluation_flags.skip){const i=n[0]++;if(this.bone_cache.set(i,e),i===t)return e}if(!e.evaluation_flags.break_child_trace)for(const i of e.children){const e=this.get_bone_internal(i,t,n);if(e)return e}}}function Wi(e){return Mi(e,Ri,[])}function Li(e){return Mi(e,Si,void 0)}function Ui(e){return Ii(e,Si,void 0)}function Mi(e,t,n){const i=gi(e).filter(e=>e.type===Pi),o=[];for(const e of i)o.push(...Ii(e.data,t,n));return o}function Ii(e,t,n){const i=e.u32(),o=0!=(1&i),r=0!=(2&i),s=0!=(4&i),a=0!=(8&i),d=0!=(16&i),l=0!=(32&i),u=0!=(64&i),c=0!=(128&i),_=e.u32(),p=e.f32(),v=e.f32(),w=e.f32(),h=e.i32()*Di,f=e.i32()*Di,m=e.i32()*Di,g=e.f32(),y=e.f32(),k=e.f32(),R=e.u32(),b=e.u32();let N,E,T;return _&&(e.seek_start(_),N=t(e,n)),R?(e.seek_start(R),E=Ii(e,t,n)):E=[],b?(e.seek_start(b),T=Ii(e,t,n)):T=[],[new Fi({no_translate:o,no_rotate:r,no_scale:s,hidden:a,break_child_trace:d,zxy_rotation_order:l,skip:u,shape_skip:c},N,new At(p,v,w),new At(h,f,m),new At(g,y,k),E),...T]}function Bi(e,t,n){const i=[];for(let o=0;o<n;o++){e.seek_start(t+16*o);let n=e.u32();e.seek(8),4&e.u32()&&(n=e.seek_start(n).u32()),e.seek_start(n),i.push(...Ui(e))}return i}var Ai=n("Womt");class xi{constructor(){this.positions=[],this.normals=[],this.uvs=[],this.indices=[],this.bones=[],this.bone_indices=[],this.bone_weights=[],this.groups=[],this.material_indices=new Set([-1])}get vertex_count(){return this.positions.length/3}get index_count(){return this.indices.length}get_position(e){return new Ai.Vector3(this.positions[3*e],this.positions[3*e+1],this.positions[3*e+2])}get_normal(e){return new Ai.Vector3(this.normals[3*e],this.normals[3*e+1],this.normals[3*e+2])}add_vertex(e,t,n){this.positions.push(e.x,e.y,e.z),this.normals.push(t.x,t.y,t.z),this.uvs.push(n.x,n.y)}add_index(e){this.indices.push(e)}add_bone(e){this.bones.push(e)}add_bone_weight(e,t){this.bone_indices.push(e),this.bone_weights.push(t)}add_group(e,t,n){const i=this.groups[this.groups.length-1],o=null==n?-1:n;i&&i.material_index===o?i.size+=t:(this.groups.push({offset:e,size:t,material_index:o}),this.material_indices.add(o))}build(){const e=new Ai.BufferGeometry,t=e.userData;t.created_by_geometry_builder=!0,e.addAttribute("position",new Ai.Float32BufferAttribute(this.positions,3)),e.addAttribute("normal",new Ai.Float32BufferAttribute(this.normals,3)),e.addAttribute("uv",new Ai.Float32BufferAttribute(this.uvs,2)),e.setIndex(new Ai.Uint16BufferAttribute(this.indices,1)),this.bone_indices.length&&this.bones.length?(e.addAttribute("skinIndex",new Ai.Uint16BufferAttribute(this.bone_indices,4)),e.addAttribute("skinWeight",new Ai.Float32BufferAttribute(this.bone_weights,4)),t.bones=this.bones):t.bones=[];const n=new Map;let i=0;for(const e of[...this.material_indices].sort((e,t)=>e-t))n.set(e,i++);for(const t of this.groups)e.addGroup(t.offset,t.size,n.get(t.material_index));return t.normalized_material_indices=n,e.computeBoundingSphere(),e.computeBoundingBox(),e}}function ji(e){return new Ai.Vector3(e.x,e.y,e.z)}const Gi=new Ai.Vector3(0,1,0),Ki=new Ai.Vector2(0,0),zi=new Ai.Vector3(0,0,0),Hi=new Ai.Quaternion(0,0,0,1),Vi=new Ai.Vector3(1,1,1);function qi(e,t){new Yi(t).to_geometry_builder(e)}function $i(e){return new Yi(new xi).create_buffer_geometry(e)}class Ji{constructor(){this.vertices_stack=[]}put(e){this.vertices_stack.push(e)}get(e){const t=[];for(let n=this.vertices_stack.length-1;n>=0;n--){const i=this.vertices_stack[n][e];i&&t.push(i)}return t}}class Yi{constructor(e){this.vertices=new Ji,this.bone_id=0,this.builder=e}to_geometry_builder(e){this.object_to_geometry(e,void 0,new Ai.Matrix4)}create_buffer_geometry(e){return this.to_geometry_builder(e),this.builder.build()}object_to_geometry(e,t,n){const{no_translate:i,no_rotate:o,no_scale:r,hidden:s,break_child_trace:a,zxy_rotation_order:d,skip:l}=e.evaluation_flags,{position:u,rotation:c,scale:_}=e,p=new Ai.Euler(c.x,c.y,c.z,d?"ZXY":"ZYX"),v=(new Ai.Matrix4).compose(i?zi:ji(u),o?Hi:(new Ai.Quaternion).setFromEuler(p),r?Vi:ji(_)).premultiply(n);let w;if(l?w=t:((w=new Ai.Bone).name=this.bone_id.toString(),w.position.set(u.x,u.y,u.z),w.setRotationFromEuler(p),w.scale.set(_.x,_.y,_.z),this.builder.add_bone(w),t&&t.add(w)),e.model&&!s&&this.model_to_geometry(e.model,v),this.bone_id++,!a)for(const t of e.children)this.object_to_geometry(t,w,v)}model_to_geometry(e,t){!function(e){return"njcm"===e.type}(e)?this.xj_model_to_geometry(e,t):this.njcm_model_to_geometry(e,t)}njcm_model_to_geometry(e,t){const n=(new Ai.Matrix3).getNormalMatrix(t),i=e.vertices.map(e=>{const i=ji(e.position),o=e.normal?ji(e.normal):new Ai.Vector3(0,1,0);return i.applyMatrix4(t),o.applyMatrix3(n),{bone_id:this.bone_id,position:i,normal:o,bone_weight:e.bone_weight,bone_weight_status:e.bone_weight_status,calc_continue:e.calc_continue}});this.vertices.put(i);for(const t of e.meshes){const e=this.builder.index_count;for(let e=0;e<t.vertices.length;++e){const n=t.vertices[e],i=this.vertices.get(n.index);if(i.length){const o=i[0],r=o.normal||n.normal||Gi,s=this.builder.vertex_count;this.builder.add_vertex(o.position,r,t.has_tex_coords?n.tex_coords:Ki),e>=2&&(e%2==(t.clockwise_winding?1:0)?(this.builder.add_index(s-2),this.builder.add_index(s-1),this.builder.add_index(s)):(this.builder.add_index(s-2),this.builder.add_index(s),this.builder.add_index(s-1)));const a=[[0,0],[0,0],[0,0],[0,0]];for(let e=i.length-1;e>=0;e--){const t=i[e];a[t.bone_weight_status]=[t.bone_id,t.bone_weight]}for(const[e,t]of a)this.builder.add_bone_weight(e,t)}}this.builder.add_group(e,this.builder.index_count-e,t.texture_id)}}xj_model_to_geometry(e,t){const n=this.builder.vertex_count,i=(new Ai.Matrix3).getNormalMatrix(t);for(let{position:n,normal:o,uv:r}of e.vertices){const e=ji(n).applyMatrix4(t),s=(o?ji(o):new Ai.Vector3(0,1,0)).applyMatrix3(i),a=r||Ki;this.builder.add_vertex(e,s,a)}let o;for(const t of e.meshes){const e=this.builder.index_count;let i=!1;for(let e=2;e<t.indices.length;++e){const o=n+t.indices[e-2],r=n+t.indices[e-1],s=n+t.indices[e],a=this.builder.get_position(o),d=this.builder.get_position(r),l=this.builder.get_position(s),u=this.builder.get_normal(o),c=this.builder.get_normal(r),_=this.builder.get_normal(s),p=d.clone().sub(a).cross(l.clone().sub(a));i&&p.negate(),(p.dot(u)<0?1:0)+(p.dot(c)<0?1:0)+(p.dot(_)<0?1:0)>=2&&(i=!i),i?(this.builder.add_index(r),this.builder.add_index(o),this.builder.add_index(s)):(this.builder.add_index(o),this.builder.add_index(r),this.builder.add_index(s)),i=!i}null!=t.material_properties.texture_id&&(o=t.material_properties.texture_id),this.builder.add_group(e,this.builder.index_count-e,o)}}}class Zi{constructor(e,t,n){if(!Number.isInteger(e)||e<-1)throw new Error(`Expected id to be an integer greater than or equal to -1, got ${e}.`);if(!t)throw new Error("position is required.");if(!Number.isFinite(n))throw new Error("y_axis_rotation is required.");this.id=e,this.position=t,this.y_axis_rotation=n,this.sin_y_axis_rotation=Math.sin(this.y_axis_rotation),this.cos_y_axis_rotation=Math.cos(this.y_axis_rotation)}}const Xi=[new Ai.MeshBasicMaterial({color:8437968,transparent:!0,opacity:.25,visible:!1}),new Ai.MeshLambertMaterial({color:10526880,side:Ai.DoubleSide}),new Ai.MeshLambertMaterial({color:5288048,side:Ai.DoubleSide}),new Ai.MeshLambertMaterial({color:6307968,side:Ai.DoubleSide})],Qi=[new Ai.MeshBasicMaterial({color:9490656,wireframe:!0,transparent:!0,opacity:.3,visible:!1}),new Ai.MeshBasicMaterial({color:13684944,wireframe:!0}),new Ai.MeshBasicMaterial({color:8446112,wireframe:!0}),new Ai.MeshBasicMaterial({color:9466032,wireframe:!0})];var eo=function(e,t,n,i){return new(n||(n=Promise))(function(o,r){function s(e){try{d(i.next(e))}catch(e){r(e)}}function a(e){try{d(i.throw(e))}catch(e){r(e)}}function d(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(s,a)}d((i=i.apply(e,t||[])).next())})};function to(e){return eo(this,void 0,void 0,function*(){return(yield fetch("/assets"+e)).arrayBuffer()})}class no{constructor(){this.map=new Map}set(e,t){this.map.set(e,t)}get_or_set(e,t){let n=this.map.get(e);return void 0===n&&(n=t(),this.map.set(e,n)),n}}var io=function(e,t,n,i){return new(n||(n=Promise))(function(o,r){function s(e){try{d(i.next(e))}catch(e){r(e)}}function a(e){try{d(i.throw(e))}catch(e){r(e)}}function d(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(s,a)}d((i=i.apply(e,t||[])).next())})};const oo=new no,ro=new no;function so(e,t,n){return io(this,void 0,void 0,function*(){return ro.get_or_set(`${e}-${t}-${n}`,()=>uo(e,t,n,"collision").then(e=>(function(e){const t=new Ai.Group;for(const n of e.meshes){const e=new Ai.Geometry;for(const{x:t,y:i,z:o}of n.vertices)e.vertices.push(new Ai.Vector3(t,i,o));for(const{indices:t,flags:i,normal:o}of n.triangles){const n=16&i,r=1&i,s=64&i?3:n?2:r?1:0;e.faces.push(new Ai.Face3(t[0],t[1],t[2],new Ai.Vector3(o.x,o.y,o.z),void 0,s))}e.computeBoundingBox(),e.computeBoundingSphere();const i=new Ai.Mesh(e,Xi);i.renderOrder=1,t.add(i);const o=new Ai.Mesh(e,Qi);o.renderOrder=2,t.add(o)}return t})(function(e){const{data_offset:t}=mi(e,!1);e.seek_start(t);const n=e.u32();e.seek_start(n);const i={meshes:[]};for(;e.bytes_left;){const t=e.position,n=e.u32();if(0===n)break;const o={vertices:[],triangles:[]};i.meshes.push(o),e.seek_start(n);const r=e.u32(),s=e.u32(),a=e.u32(),d=e.u32();e.seek_start(s);for(let t=0;t<r;t++){const t=e.f32(),n=e.f32(),i=e.f32();o.vertices.push(new At(t,n,i))}e.seek_start(d);for(let t=0;t<a;t++){const t=e.u16(),n=e.u16(),i=e.u16(),r=e.u16(),s=e.f32(),a=e.f32(),d=e.f32();e.seek(16),o.triangles.push({indices:[t,n,i],flags:r,normal:new At(s,a,d)})}e.seek_start(t+24)}return i}(new Gt(e,Mt.Little)))))})}function ao(e,t,n){const i=uo(e,t,n,"render").then(e=>(function(e){const t=[],n=new Ai.Group;let i=0;for(const o of e.sections){const e=new xi;for(const t of o.objects)qi(t,e);const r=new Ai.Mesh(e.build(),new Ai.MeshBasicMaterial({color:(new Ai.Color).setHSL(i++%7/7,1,.5),transparent:!0,opacity:.25,side:Ai.DoubleSide}));if(n.add(r),r.position.set(o.position.x,o.position.y,o.position.z),r.rotation.set(o.rotation.x,o.rotation.y,o.rotation.z),r.updateMatrixWorld(),o.id>=0){const e=new Zi(o.id,o.position,o.rotation.y);t.push(e),r.userData.section=e}}return[t,n]})(function(e){const t=[];e.seek_end(16);const{data_offset:n}=mi(e,!1);e.seek_start(n),e.seek(8);const i=e.u32();e.seek(4);const o=e.u32();for(let n=0;n<i;n++){e.seek_start(o+52*n);const i=e.i32(),r=e.vec3_f32(),s=new At(e.u32()*Di,e.u32()*Di,e.u32()*Di);e.seek(4);const a=e.u32();e.seek(4);const d=e.u32(),l=Bi(e,a,d);t.push({id:i,position:r,rotation:s,objects:l})}return{sections:t}}(new Gt(e,Mt.Little))));return{geometry:i.then(([,e])=>e),sections:i.then(([e])=>e)}}const lo=[[["city00_00",1],["forest01",1],["forest02",1],["cave01_",6],["cave02_",5],["cave03_",6],["machine01_",6],["machine02_",6],["ancient01_",5],["ancient02_",5],["ancient03_",5],["boss01",1],["boss02",1],["boss03",1],["darkfalz00",1]],[["labo00_00",1],["ruins01_",3],["ruins02_",3],["space01_",3],["space02_",3],["jungle01_00",1],["jungle02_00",1],["jungle03_00",1],["jungle04_",3],["jungle05_00",1],["seabed01_",3],["seabed02_",3],["boss05",1],["boss06",1],["boss07",1],["boss08",1],["jungle06_00",1],["jungle07_",5]],[],[["city02_00",1],["wilds01_00",1],["wilds01_01",1],["wilds01_02",1],["wilds01_03",1],["crater01_00",1],["desert01_",3],["desert02_",3],["desert03_",3],["boss09_00",1]]];function uo(e,t,n,i){return io(this,void 0,void 0,function*(){return to(function(e,t,n){16===t&&1===n&&(t=17,n=1);const i=lo[e-1];if(0<=t&&t<i.length){const[o,r]=i[t];if(0<=n&&n<r){let e;if(1===r)e="";else for(e=String(n);e.length<2;)e="0"+e;return`/maps/map_${o}${e}`}throw new Error(`Unknown variant ${n} of area ${t} in episode ${e}.`)}throw new Error(`Unknown episode ${e} area ${t}.`)}(e,t,n)+("render"===i?"n.rel":"c.rel"))})}function co(e){return _o[e]}const _o=[];function po(e,t,n,i){const o={id:e,name:t,order:n,area_variants:[]};for(let e=0;e<i;e++)o.area_variants.push({id:e,area:o});return o}let vo=0;_o[Re.I]=[po(0,"Pioneer II",vo++,1),po(1,"Forest 1",vo++,1),po(2,"Forest 2",vo++,1),po(11,"Under the Dome",vo++,1),po(3,"Cave 1",vo++,6),po(4,"Cave 2",vo++,5),po(5,"Cave 3",vo++,6),po(12,"Underground Channel",vo++,1),po(6,"Mine 1",vo++,6),po(7,"Mine 2",vo++,6),po(13,"Monitor Room",vo++,1),po(8,"Ruins 1",vo++,5),po(9,"Ruins 2",vo++,5),po(10,"Ruins 3",vo++,5),po(14,"Dark Falz",vo++,1),po(15,"BA Ruins",vo++,3),po(16,"BA Spaceship",vo++,3),po(17,"Lobby",vo++,15)],vo=0,_o[Re.II]=[po(0,"Lab",vo++,1),po(1,"VR Temple Alpha",vo++,3),po(2,"VR Temple Beta",vo++,3),po(14,"VR Temple Final",vo++,1),po(3,"VR Spaceship Alpha",vo++,3),po(4,"VR Spaceship Beta",vo++,3),po(15,"VR Spaceship Final",vo++,1),po(5,"Central Control Area",vo++,1),po(6,"Jungle Area East",vo++,1),po(7,"Jungle Area North",vo++,1),po(8,"Mountain Area",vo++,3),po(9,"Seaside Area",vo++,1),po(12,"Cliffs of Gal Da Val",vo++,1),po(10,"Seabed Upper Levels",vo++,3),po(11,"Seabed Lower Levels",vo++,3),po(13,"Test Subject Disposal Area",vo++,1),po(16,"Seaside Area at Night",vo++,2),po(17,"Control Tower",vo++,5)],vo=0,_o[Re.IV]=[po(0,"Pioneer II (Ep. IV)",vo++,1),po(1,"Crater Route 1",vo++,1),po(2,"Crater Route 2",vo++,1),po(3,"Crater Route 3",vo++,1),po(4,"Crater Route 4",vo++,1),po(5,"Crater Interior",vo++,1),po(6,"Subterranean Desert 1",vo++,3),po(7,"Subterranean Desert 2",vo++,3),po(8,"Subterranean Desert 3",vo++,3),po(9,"Meteor Impact Site",vo++,1)];class wo{constructor(e,t){if(this.sections=T.n.array(),!Number.isInteger(e)||e<0)throw new Error(`Expected id to be a non-negative integer, got ${e}.`);this.id=e,this.area=t}}(function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);r>3&&s&&Object.defineProperty(t,n,s)})([T.n.shallow],wo.prototype,"sections",void 0);class ho{constructor(e,t,n,i){if(!Number.isInteger(e)||e<0)throw new Error(`Expected id to be a non-negative integer, got ${e}.`);if(!t)throw new Error("name is required.");if(!i)throw new Error("area_variants is required.");this.id=e,this.name=t,this.order=n,this.area_variants=i}}const fo=new class{constructor(){this.areas=[],this.get_areas_for_episode=e=>this.areas[e],this.get_area=(e,t)=>{const n=this.areas[e].find(e=>e.id===t);if(!n)throw new Error(`Area id ${t} for episode ${e} is invalid.`);return n},this.get_variant=(e,t,n)=>{const i=this.get_area(e,t).area_variants[n];if(!i)throw new Error(`Area variant id ${n} for area ${t} of episode ${e} is invalid.`);return i},this.get_area_sections=(e,t,n)=>(function(e,t,n){return io(this,void 0,void 0,function*(){return oo.get_or_set(`${e}-${t}-${n}`,()=>ao(e,t,n)).sections})})(e,t,n);for(const e of be)this.areas[e]=co(e).map(e=>{const t=new ho(e.id,e.name,e.order,[]);for(const n of e.area_variants)t.area_variants.push(new wo(n.id,t));return t})}};var mo=function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s};const go=d.a.get("domain/ObservableQuest");class yo{constructor(e,t,n,i,o,r,s,a,d,l,u,c){if(Ne(r),!s)throw new Error("map_designations is required.");if(!Array.isArray(a))throw new Error("objs is required.");if(!Array.isArray(d))throw new Error("npcs is required.");if(!l)throw new Error("dat_unknowns is required.");if(!u)throw new Error("object_code is required.");if(!c)throw new Error("shop_items is required.");this.set_id(e),this.set_language(t),this.set_name(n),this.set_short_description(i),this.set_long_description(o),this.episode=r,this.set_map_designations(s),this.objects=a,this.npcs=d,this.dat_unknowns=l,this.object_code=u,this.shop_items=c}get id(){return this._id}set_id(e){if(!Number.isInteger(e)||e<0||e>4294967295)throw new Error("id must be an integer greater than 0 and less than 4294967295.");this._id=e}get language(){return this._language}set_language(e){if(!Number.isInteger(e))throw new Error("language must be an integer.");this._language=e}get name(){return this._name}set_name(e){if(e.length>32)throw new Error("name can't be longer than 32 characters.");this._name=e}get short_description(){return this._short_description}set_short_description(e){if(e.length>128)throw new Error("short_description can't be longer than 128 characters.");this._short_description=e}get long_description(){return this._long_description}set_long_description(e){if(e.length>288)throw new Error("long_description can't be longer than 288 characters.");this._long_description=e}get entities_per_area(){const e=new Map;for(const t of this.npcs)e.set(t.area_id,(e.get(t.area_id)||0)+1);for(const t of this.objects)e.set(t.area_id,(e.get(t.area_id)||0)+1);return e}get map_designations(){return this._map_designations}set_map_designations(e){this._map_designations=e}get area_variants(){const e=new Map;for(const t of this.entities_per_area.keys())try{e.set(t,fo.get_variant(this.episode,t,0))}catch(e){go.warn(e)}for(const[t,n]of this._map_designations)try{e.set(t,fo.get_variant(this.episode,t,n))}catch(e){go.warn(e)}return[...e.values()]}}mo([T.n],yo.prototype,"_id",void 0),mo([T.d],yo.prototype,"set_id",null),mo([T.n],yo.prototype,"_language",void 0),mo([T.d],yo.prototype,"set_language",null),mo([T.n],yo.prototype,"_name",void 0),mo([T.d],yo.prototype,"set_name",null),mo([T.n],yo.prototype,"_short_description",void 0),mo([T.d],yo.prototype,"set_short_description",null),mo([T.n],yo.prototype,"_long_description",void 0),mo([T.d],yo.prototype,"set_long_description",null),mo([T.n],yo.prototype,"objects",void 0),mo([T.n],yo.prototype,"npcs",void 0),mo([T.f],yo.prototype,"entities_per_area",null),mo([T.n.ref],yo.prototype,"_map_designations",void 0),mo([T.f],yo.prototype,"area_variants",null);var ko=function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s};class Ro{constructor(e,t,n,i,o){if(null==e)throw new Error("type is required.");if(!Number.isInteger(t)||t<0)throw new Error(`Expected area_id to be a non-negative integer, got ${t}.`);if(!Number.isInteger(n)||n<0)throw new Error(`Expected section_id to be a non-negative integer, got ${n}.`);if(!i)throw new Error("position is required.");if(!o)throw new Error("rotation is required.");this.type=e,this.area_id=t,this._section_id=n,this.position=i,this.rotation=o}get section_id(){return this.section?this.section.id:this._section_id}get world_position(){if(this.section){let{x:e,y:t,z:n}=this.position;const i=-this.section.sin_y_axis_rotation,o=this.section.cos_y_axis_rotation,r=i*e+o*n,s=o*e-i*n+this.section.position.x,a=t+this.section.position.y,d=r+this.section.position.z;return new At(s,a,d)}return this.position}set world_position(e){let{x:t,y:n,z:i}=e;if(this.section){const e=t-this.section.position.x,o=n-this.section.position.y,r=i-this.section.position.z,s=-this.section.sin_y_axis_rotation,a=this.section.cos_y_axis_rotation;t=a*e+s*r,n=o,i=-s*e+a*r}this.position=new At(t,n,i)}set_world_position_and_section(e,t){this.world_position=e,this.section=t}}ko([T.n],Ro.prototype,"area_id",void 0),ko([T.f],Ro.prototype,"section_id",null),ko([T.n.ref],Ro.prototype,"section",void 0),ko([T.n.ref],Ro.prototype,"position",void 0),ko([T.n.ref],Ro.prototype,"rotation",void 0),ko([T.f],Ro.prototype,"world_position",null),ko([T.d],Ro.prototype,"set_world_position_and_section",null);class bo extends Ro{constructor(e,t,n,i,o,r,s,a,d){super(e,i,o,r,s),this.id=t,this.group_id=n,this.properties=a,this.unknown=d}props(){return new Map(this.properties)}get_prop(e){return this.properties.get(e)}set_prop(e,t){if(!this.properties.has(e))throw new Error(`Object doesn't have property ${e}.`);this.properties.set(e,t)}}ko([T.n],bo.prototype,"properties",void 0),ko([T.d],bo.prototype,"set_prop",null);class No extends Ro{constructor(e,t,n,i,o,r,s,a,d,l,u){super(e,r,s,a,d),this.pso_type_id=t,this.npc_id=n,this.script_label=i,this.roaming=o,this.unknown=u,this.scale=l}}function Eo(e){if(e===Re.II)throw new Error("Episode II not yet supported.");if(e===Re.IV)throw new Error("Episode IV not yet supported.");return new yo(0,0,"Untitled","Created with phantasmal.world.","Created with phantasmal.world.",e,(new Map).set(0,0),[new bo(Yn.MenuActivation,16384,0,0,10,new At(-16.313568115234375,3,-579.5118408203125),new At(.0009587526218325454,0,0),new Map([["property_0",1],["property_1",1],["property_2",1],["property_3",1],["property_4",0],["property_5",0],["property_6",2365279104]]),[[2,0,0,0,0,0],[0,0]]),new bo(Yn.MenuActivation,16385,0,0,10,new At(-393.07318115234375,10,-12.964752197265625),new At(0,0,0),new Map([["property_0",9183549615799121e-56],["property_1",1.0000011920928955],["property_2",1],["property_3",0],["property_4",0],["property_5",0],["property_6",2365279264]]),[[2,0,1,0,0,0],[0,0]]),new bo(Yn.MenuActivation,16386,0,0,10,new At(-458.60699462890625,10,-51.270660400390625),new At(0,0,0),new Map([["property_0",1],["property_1",1],["property_2",1],["property_3",2],["property_4",65536],["property_5",10],["property_6",2365279424]]),[[2,0,2,0,0,0],[0,0]]),new bo(Yn.MenuActivation,16387,0,0,10,new At(-430.19696044921875,10,-24.490447998046875),new At(0,0,0),new Map([["property_0",1],["property_1",1],["property_2",1],["property_3",3],["property_4",0],["property_5",0],["property_6",2365279584]]),[[2,0,3,0,0,0],[0,0]]),new bo(Yn.PlayerSet,16388,0,0,10,new At(.995330810546875,0,-37.0010986328125),new At(0,4.712460886831327,0),new Map([["property_0",0],["property_1",1],["property_2",1],["property_3",0],["property_4",0],["property_5",0],["property_6",2365279744]]),[[2,0,4,0,0,0],[0,0]]),new bo(Yn.PlayerSet,16389,0,0,10,new At(3.0009307861328125,0,-23.99688720703125),new At(0,4.859725289544806,0),new Map([["property_0",1.000000238418579],["property_1",1],["property_2",1],["property_3",0],["property_4",0],["property_5",0],["property_6",2365279904]]),[[2,0,5,0,0,0],[0,0]]),new bo(Yn.PlayerSet,16390,0,0,10,new At(2.0015106201171875,0,-50.00386047363281),new At(0,4.565196484117848,0),new Map([["property_0",2.000002384185791],["property_1",1],["property_2",1],["property_3",0],["property_4",0],["property_5",0],["property_6",2365280064]]),[[2,0,6,0,0,0],[0,0]]),new bo(Yn.PlayerSet,16391,0,0,10,new At(4.9973907470703125,0,-61.99664306640625),new At(0,4.368843947166543,0),new Map([["property_0",3.0000007152557373],["property_1",1],["property_2",1],["property_3",65536],["property_4",10],["property_5",0],["property_6",2365280224]]),[[2,0,7,0,0,0],[0,0]]),new bo(Yn.MainRagolTeleporter,18264,0,0,10,new At(132.00314331054688,1.000000238418579,-265.002197265625),new At(0,.49088134237826325,0),new Map([["property_0",1.000000238418579],["property_1",1],["property_2",1],["property_3",1],["property_4",0],["property_5",0],["property_6",2365227216]]),[[0,0,87,7,0,0],[0,0]]),new bo(Yn.PrincipalWarp,16393,0,0,10,new At(-228,0,-2020.99951171875),new At(0,2.9452880542695796,0),new Map([["property_0",-10.000004768371582],["property_1",0],["property_2",-30.000030517578125],["property_3",0],["property_4",65536],["property_5",65536],["property_6",2365280688]]),[[2,0,9,0,0,0],[0,0]]),new bo(Yn.MenuActivation,16394,0,0,10,new At(-41.000030517578125,0,42.37322998046875),new At(0,0,0),new Map([["property_0",1],["property_1",1],["property_2",1],["property_3",4],["property_4",0],["property_5",0],["property_6",2365280992]]),[[2,0,10,0,0,0],[1,0]]),new bo(Yn.MenuActivation,16395,0,0,10,new At(-479.21673583984375,8.781256675720215,-322.465576171875),new At(6.28328118244177,.0009587526218325454,0),new Map([["property_0",1],["property_1",1],["property_2",1],["property_3",5],["property_4",0],["property_5",0],["property_6",2365281152]]),[[2,0,11,0,0,0],[0,0]]),new bo(Yn.PrincipalWarp,16396,0,0,10,new At(-228,0,-351.0015869140625),new At(0,0,0),new Map([["property_0",10.000006675720215],["property_1",0],["property_2",-1760.0010986328125],["property_3",32768],["property_4",0],["property_5",0],["property_6",2365281312]]),[[2,0,12,0,0,0],[0,0]]),new bo(Yn.TelepipeLocation,16397,0,0,10,new At(-561.88232421875,0,-406.8829345703125),new At(0,0,0),new Map([["property_0",1],["property_1",1],["property_2",1],["property_3",0],["property_4",0],["property_5",0],["property_6",2365281616]]),[[2,0,13,0,0,0],[0,0]]),new bo(Yn.TelepipeLocation,16398,0,0,10,new At(-547.8557739257812,0,-444.8822326660156),new At(0,0,0),new Map([["property_0",1],["property_1",1],["property_2",1],["property_3",1],["property_4",0],["property_5",0],["property_6",2365281808]]),[[2,0,14,0,0,0],[0,0]]),new bo(Yn.TelepipeLocation,16399,0,0,10,new At(-486.441650390625,0,-497.4501647949219),new At(0,0,0),new Map([["property_0",9183549615799121e-56],["property_1",1.0000011920928955],["property_2",1],["property_3",3],["property_4",0],["property_5",0],["property_6",2365282e3]]),[[2,0,15,0,0,0],[0,0]]),new bo(Yn.TelepipeLocation,16400,0,0,10,new At(-522.4052734375,0,-474.1882629394531),new At(0,0,0),new Map([["property_0",1],["property_1",1],["property_2",1],["property_3",2],["property_4",65536],["property_5",10],["property_6",2365282192]]),[[2,0,16,0,0,0],[0,0]]),new bo(Yn.MedicalCenterDoor,16401,0,0,10,new At(-34.49853515625,0,-384.4951171875),new At(0,5.497871034636549,0),new Map([["property_0",3.0000007152557373],["property_1",1],["property_2",1],["property_3",1],["property_4",0],["property_5",0],["property_6",2365282384]]),[[2,0,17,0,0,0],[0,0]]),new bo(Yn.ShopDoor,16402,0,0,10,new At(-393.0031433105469,0,-143.49981689453125),new At(0,3.141640591220885,0),new Map([["property_0",3.0000007152557373],["property_1",1],["property_2",1],["property_3",1],["property_4",0],["property_5",0],["property_6",2365282640]]),[[2,0,18,0,0,0],[0,0]]),new bo(Yn.MenuActivation,16403,0,0,10,new At(-355.17462158203125,0,-43.15193176269531),new At(0,0,0),new Map([["property_0",1.000000238418579],["property_1",1],["property_2",1],["property_3",6],["property_4",0],["property_5",0],["property_6",2365282896]]),[[2,0,19,0,0,0],[0,0]]),new bo(Yn.HuntersGuildDoor,16404,0,0,10,new At(-43.00239562988281,0,-118.00120544433594),new At(0,3.141640591220885,0),new Map([["property_0",3.0000007152557373],["property_1",1],["property_2",1],["property_3",1],["property_4",0],["property_5",0],["property_6",2365283056]]),[[2,0,20,0,0,0],[0,0]]),new bo(Yn.TeleporterDoor,16405,0,0,10,new At(26.000823974609375,0,-265.99810791015625),new At(0,3.141640591220885,0),new Map([["property_0",3.0000007152557373],["property_1",1],["property_2",1],["property_3",1],["property_4",0],["property_5",0],["property_6",2365283312]]),[[2,0,21,0,0,0],[0,0]]),new bo(Yn.PlayerSet,16406,0,0,10,new At(57.81005859375,0,-268.5472412109375),new At(0,4.712460886831327,0),new Map([["property_0",0],["property_1",1],["property_2",1],["property_3",1],["property_4",0],["property_5",0],["property_6",2365283568]]),[[2,0,22,0,0,0],[0,0]]),new bo(Yn.PlayerSet,16407,0,0,10,new At(66.769287109375,0,-252.3748779296875),new At(0,4.712460886831327,0),new Map([["property_0",1.000000238418579],["property_1",1],["property_2",1],["property_3",1],["property_4",0],["property_5",0],["property_6",2365283728]]),[[2,0,23,0,0,0],[0,0]]),new bo(Yn.PlayerSet,16408,0,0,10,new At(67.36819458007812,0,-284.9297180175781),new At(0,4.712460886831327,0),new Map([["property_0",2.000000476837158],["property_1",1],["property_2",1],["property_3",1],["property_4",0],["property_5",0],["property_6",2365283888]]),[[2,0,24,0,0,0],[0,0]]),new bo(Yn.PlayerSet,16409,0,0,10,new At(77.10488891601562,0,-269.2830505371094),new At(0,4.712460886831327,0),new Map([["property_0",3.0000007152557373],["property_1",1],["property_2",1],["property_3",1],["property_4",0],["property_5",0],["property_6",2365284048]]),[[2,0,25,0,0,0],[0,0]])],[new No(Ee.GuildLady,29,1011.0010986328125,850,0,0,10,new At(-49.0010986328125,0,50.996429443359375),new At(0,2.3562304434156633,0),new At(0,0,0),[[0,0,7,86,0,0,0,0,23,87],[0,0,0,0,0,0],[128,238,223,176]]),new No(Ee.FemaleFat,4,1016.0010986328125,100,1,0,20,new At(167.99769592285156,0,83.99686431884766),new At(0,3.927050739026106,0),new At(24.000009536743164,0,0),[[0,0,7,88,0,0,0,0,23,89],[0,0,0,0,0,0],[128,238,232,48]]),new No(Ee.MaleDwarf,10,1015.0010986328125,90,1,0,20,new At(156.0028839111328,0,-49.99967575073242),new At(0,5.497871034636549,0),new At(30.000009536743164,0,0),[[0,0,7,89,0,0,0,0,23,90],[0,0,0,0,0,0],[128,238,236,176]]),new No(Ee.RedSoldier,26,1020.0010986328125,130,0,0,20,new At(237.9988250732422,0,-14.0001220703125),new At(0,5.497871034636549,0),new At(0,0,0),[[0,0,7,90,0,0,0,0,23,91],[0,0,0,0,0,0],[128,238,241,48]]),new No(Ee.BlueSoldier,25,1019.0010986328125,120,0,0,20,new At(238.00379943847656,0,63.00413513183594),new At(0,3.927050739026106,0),new At(0,0,0),[[0,0,7,91,0,0,0,0,23,92],[0,0,0,0,0,0],[128,238,245,176]]),new No(Ee.FemaleMacho,5,1014.0010986328125,80,1,0,20,new At(-2.001882553100586,0,35.0036506652832),new At(0,3.141640591220885,0),new At(26.000009536743164,0,0),[[0,0,7,92,0,0,0,0,23,93],[0,0,0,0,0,0],[128,238,250,48]]),new No(Ee.Scientist,30,1013.0010986328125,70,1,0,20,new At(-147.0000457763672,0,-7.996537208557129),new At(0,2.577127047485882,0),new At(30.000009536743164,0,0),[[0,0,7,93,0,0,0,0,23,94],[0,0,0,0,0,0],[128,238,254,176]]),new No(Ee.MaleOld,13,1012.0010986328125,60,1,0,20,new At(-219.99710083007812,0,-100.0008316040039),new At(0,0,0),new At(30.000011444091797,0,0),[[0,0,7,94,0,0,0,0,23,95],[0,0,0,0,0,0],[128,239,3,48]]),new No(Ee.GuildLady,29,1010.0010986328125,840,0,0,20,new At(-262.5099792480469,0,-24.53999900817871),new At(0,1.963525369513053,0),new At(0,0,0),[[0,0,7,95,0,0,0,0,23,106],[0,0,0,0,0,0],[128,239,100,192]]),new No(Ee.Tekker,28,1009,830,0,0,30,new At(-43.70983123779297,2.5999999046325684,-52.78248596191406),new At(0,.7854101478052212,0),new At(0,0,0),[[0,0,7,97,0,0,0,0,23,98],[0,0,0,0,0,0],[128,239,16,176]]),new No(Ee.MaleMacho,12,1006,800,0,0,30,new At(.33990478515625,2.5999999046325684,-84.71995544433594),new At(0,0,0),new At(0,0,0),[[0,0,7,98,0,0,0,0,23,99],[0,0,0,0,0,0],[128,239,21,48]]),new No(Ee.FemaleMacho,5,1008,820,0,0,30,new At(43.87113952636719,2.5999996662139893,-74.80299377441406),new At(0,-.5645135437350027,0),new At(0,0,0),[[0,0,7,99,0,0,0,0,23,100],[0,0,0,0,0,0],[128,239,25,176]]),new No(Ee.MaleFat,11,1007.0010986328125,810,0,0,30,new At(75.88380432128906,2.5999996662139893,-42.69328308105469),new At(0,-1.0308508189943528,0),new At(0,0,0),[[0,0,7,100,0,0,0,0,23,101],[0,0,0,0,0,0],[128,239,30,48]]),new No(Ee.FemaleTall,7,1021.0010986328125,140,1,0,30,new At(16.003997802734375,0,5.995697021484375),new At(0,-1.1781152217078317,0),new At(22.000009536743164,0,0),[[0,0,7,101,0,0,0,0,23,102],[0,0,0,0,0,0],[128,239,34,176]]),new No(Ee.Nurse,31,1017,860,0,0,40,new At(.3097381591796875,3,-105.3865966796875),new At(0,0,0),new At(0,0,0),[[0,0,7,102,0,0,0,0,23,103],[0,0,0,0,0,0],[128,239,39,48]]),new No(Ee.Nurse,31,1018.0010986328125,110,1,0,40,new At(53.499176025390625,0,-26.496688842773438),new At(0,5.497871034636549,0),new At(18.000009536743164,0,0),[[0,0,7,103,0,0,0,0,23,104],[0,0,0,0,0,0],[128,239,43,176]])],[],[{labels:[0],type:pn.Instructions,instructions:[new _n(cn.SET_EPISODE,[{value:0,size:4}]),new _n(cn.ARG_PUSHL,[{value:0,size:4}]),new _n(cn.ARG_PUSHW,[{value:150,size:2}]),new _n(cn.SET_FLOOR_HANDLER,[]),new _n(cn.BB_MAP_DESIGNATE,[{value:0,size:1},{value:0,size:2},{value:0,size:1},{value:0,size:1}]),new _n(cn.RET,[])]},{labels:[150],type:pn.Instructions,instructions:[new _n(cn.LETI,[{value:60,size:1},{value:237,size:4}]),new _n(cn.LETI,[{value:61,size:1},{value:0,size:4}]),new _n(cn.LETI,[{value:62,size:1},{value:333,size:4}]),new _n(cn.LETI,[{value:63,size:1},{value:-15,size:4}]),new _n(cn.ARG_PUSHL,[{value:0,size:4}]),new _n(cn.ARG_PUSHR,[{value:60,size:1}]),new _n(cn.P_SETPOS,[]),new _n(cn.LETI,[{value:60,size:1},{value:255,size:4}]),new _n(cn.LETI,[{value:61,size:1},{value:0,size:4}]),new _n(cn.LETI,[{value:62,size:1},{value:338,size:4}]),new _n(cn.LETI,[{value:63,size:1},{value:-43,size:4}]),new _n(cn.ARG_PUSHL,[{value:1,size:4}]),new _n(cn.ARG_PUSHR,[{value:60,size:1}]),new _n(cn.P_SETPOS,[]),new _n(cn.LETI,[{value:60,size:1},{value:222,size:4}]),new _n(cn.LETI,[{value:61,size:1},{value:0,size:4}]),new _n(cn.LETI,[{value:62,size:1},{value:322,size:4}]),new _n(cn.LETI,[{value:63,size:1},{value:25,size:4}]),new _n(cn.ARG_PUSHL,[{value:2,size:4}]),new _n(cn.ARG_PUSHR,[{value:60,size:1}]),new _n(cn.P_SETPOS,[]),new _n(cn.LETI,[{value:60,size:1},{value:248,size:4}]),new _n(cn.LETI,[{value:61,size:1},{value:0,size:4}]),new _n(cn.LETI,[{value:62,size:1},{value:323,size:4}]),new _n(cn.LETI,[{value:63,size:1},{value:-20,size:4}]),new _n(cn.ARG_PUSHL,[{value:3,size:4}]),new _n(cn.ARG_PUSHR,[{value:60,size:1}]),new _n(cn.P_SETPOS,[]),new _n(cn.RET,[])]}],[])}function To(e){return Oe(e)||Zn(e)}var So=function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s};const Oo=d.a.get("stores/QuestEditorStore");class Co{constructor(){this.debug=!1,this.undo=new fi,this.script_undo=new hi("Text edits",()=>{},()=>{}),this.save_dialog_open=!1,this.toggle_debug=()=>{this.debug=!this.debug},this.set_selected_entity=e=>{e&&this.set_current_area_id(e.area_id),this.selected_entity=e},this.set_current_area_id=e=>{this.selected_entity=void 0,null==e?this.current_area=void 0:this.current_quest&&(this.current_area=fo.get_area(this.current_quest.episode,e))},this.new_quest=e=>{this.set_quest(Eo(e))},this.open_file=Object(T.i)(function*(e,t){try{const n=yield ci(t),i=ri(new Gt(n,Mt.Little));this.set_quest(i&&new yo(i.id,i.language,i.name,i.short_description,i.long_description,i.episode,i.map_designations,i.objects.map(e=>new bo(e.type,e.id,e.group_id,e.area_id,e.section_id,e.position,e.rotation,e.properties,e.unknown)),i.npcs.map(e=>new No(e.type,e.pso_type_id,e.npc_id,e.script_label,e.roaming,e.area_id,e.section_id,e.position,e.rotation,e.scale,e.unknown)),i.dat_unknowns,i.object_code,i.shop_items),e)}catch(e){Oo.error("Couldn't read file.",e)}}),this.open_save_dialog=()=>{this.save_dialog_filename=this.current_quest_filename?this.current_quest_filename.endsWith(".qst")?this.current_quest_filename.slice(0,-4):this.current_quest_filename:"",this.save_dialog_open=!0},this.close_save_dialog=()=>{this.save_dialog_open=!1},this.set_save_dialog_filename=e=>{this.save_dialog_filename=e},this.save_current_quest_to_file=e=>{const t=this.current_quest;if(t){const n=si({id:t.id,language:t.language,name:t.name,short_description:t.short_description,long_description:t.long_description,episode:t.episode,objects:t.objects.map(e=>({type:e.type,area_id:e.area_id,section_id:e.section_id,position:e.position,rotation:e.rotation,unknown:e.unknown,id:e.id,group_id:e.group_id,properties:e.props()})),npcs:t.npcs.map(e=>({type:e.type,area_id:e.area_id,section_id:e.section_id,position:e.position,rotation:e.rotation,scale:e.scale,unknown:e.unknown,pso_type_id:e.pso_type_id,npc_id:e.npc_id,script_label:e.script_label,roaming:e.roaming})),dat_unknowns:t.dat_unknowns,object_code:t.object_code,shop_items:t.shop_items,map_designations:t.map_designations},e);e.endsWith(".qst")||(e+=".qst");const i=document.createElement("a");i.href=URL.createObjectURL(new Blob([n],{type:"application/octet-stream"})),i.download=e,document.body.appendChild(i),i.click(),URL.revokeObjectURL(i.href),document.body.removeChild(i)}this.save_dialog_open=!1},this.push_id_edit_action=(e,t)=>{const n=Do.current_quest;n&&n.set_id(t),this.undo.push_action("Edit ID",()=>{const t=Do.current_quest;t&&t.set_id(e)},()=>{const e=Do.current_quest;e&&e.set_id(t)})},this.push_name_edit_action=(e,t)=>{const n=Do.current_quest;n&&n.set_name(t),this.undo.push_action("Edit name",()=>{const t=Do.current_quest;t&&t.set_name(e)},()=>{const e=Do.current_quest;e&&e.set_name(t)})},this.push_short_description_edit_action=(e,t)=>{const n=Do.current_quest;n&&n.set_short_description(t),this.undo.push_action("Edit short description",()=>{const t=Do.current_quest;t&&t.set_short_description(e)},()=>{const e=Do.current_quest;e&&e.set_short_description(t)})},this.push_long_description_edit_action=(e,t)=>{const n=Do.current_quest;n&&n.set_long_description(t),this.undo.push_action("Edit long description",()=>{const t=Do.current_quest;t&&t.set_long_description(e)},()=>{const e=Do.current_quest;e&&e.set_long_description(t)})},this.push_entity_move_action=(e,t,n)=>{this.undo.push_action(`Move ${To(e.type).name}`,()=>{e.world_position=t,Do.set_selected_entity(e)},()=>{e.world_position=n,Do.set_selected_entity(e)})},this.set_quest=Object(T.i)(function*(e,t){if(this.current_quest_filename=t,e!==this.current_quest)if(this.undo.reset(),this.script_undo.reset(),this.selected_entity=void 0,this.current_quest=e,this.current_area=e?fo.get_area(e.episode,0):void 0,e)for(const t of e.area_variants){const n=yield fo.get_area_sections(e.episode,t.area.id,t.id);t.sections.replace(n);for(const i of e.objects.filter(e=>e.area_id===t.area.id))try{this.set_section_on_quest_entity(i,n)}catch(e){Oo.error(e)}for(const i of e.npcs.filter(e=>e.area_id===t.area.id))try{this.set_section_on_quest_entity(i,n)}catch(e){Oo.error(e)}}else Oo.error("Couldn't parse quest file.")}),this.set_section_on_quest_entity=(e,t)=>{const n=t.find(t=>t.id===e.section_id);n?e.section=n:Oo.warn(`Section ${e.section_id} not found.`)},j.on_global_keyup("quest_editor","Ctrl-Z",()=>{wi.current!==this.script_undo&&wi.undo()}),j.on_global_keyup("quest_editor","Ctrl-Shift-Z",()=>{wi.current!==this.script_undo&&wi.redo()}),j.on_global_keyup("quest_editor","Ctrl-Alt-D",this.toggle_debug)}}So([T.n],Co.prototype,"debug",void 0),So([T.n],Co.prototype,"current_quest_filename",void 0),So([T.n],Co.prototype,"current_quest",void 0),So([T.n],Co.prototype,"current_area",void 0),So([T.n],Co.prototype,"selected_entity",void 0),So([T.n],Co.prototype,"save_dialog_filename",void 0),So([T.n],Co.prototype,"save_dialog_open",void 0),So([T.d],Co.prototype,"toggle_debug",void 0),So([T.d],Co.prototype,"set_selected_entity",void 0),So([T.d],Co.prototype,"set_current_area_id",void 0),So([T.d],Co.prototype,"new_quest",void 0),So([T.d],Co.prototype,"open_save_dialog",void 0),So([T.d],Co.prototype,"close_save_dialog",void 0),So([T.d],Co.prototype,"set_save_dialog_filename",void 0),So([T.d],Co.prototype,"push_id_edit_action",void 0),So([T.d],Co.prototype,"push_name_edit_action",void 0),So([T.d],Co.prototype,"push_short_description_edit_action",void 0),So([T.d],Co.prototype,"push_long_description_edit_action",void 0),So([T.d],Co.prototype,"push_entity_move_action",void 0),So([T.d],Co.prototype,"set_quest",void 0);const Do=new Co;var Po=n("wsa1"),Fo=n("NUmZ"),Wo=n.n(Fo);const Lo=new DataView(new ArrayBuffer(4));function Uo(e,t,n){const i=[];for(let r=0;r<e.length;r++){const s=e[r].type,a=t[r];if(null!=a)switch(s.kind){case It.Float:n?i.push((o=a.value,Lo.setInt32(0,o),Lo.getFloat32(0)).toString()):i.push(a.value.toString());break;case It.ILabelVar:for(;r<t.length;r++)i.push(t[r].value.toString());break;case It.RegRefVar:for(;r<t.length;r++)i.push("r"+t[r].value);break;case It.RegRef:case It.RegTupRef:i.push("r"+a.value);break;case It.String:i.push(JSON.stringify(a.value));break;default:i.push(a.value.toString())}else i.push("")}var o;return i}var Mo=function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s};class Io{constructor(){this.warnings=[],this.errors=[],this.worker=new Wo.a,this.process_worker_message=e=>{const t=e.data;"new_object_code_output"===t.type&&this.quest&&(this.quest.object_code.splice(0,this.quest.object_code.length,...t.object_code),this.quest.set_map_designations(t.map_designations),this.warnings=t.warnings,this.errors=t.errors)},this.worker.onmessage=this.process_worker_message}disassemble(e){this.quest=e;const t=function(e,t=!1){const n=[],i=[];let o;for(const r of e){let e;switch(r.type){case pn.Instructions:e=".code";break;case pn.Data:e=".data";break;case pn.String:e=".string"}o!==r.type&&(o=r.type,n.length&&n.push(""),n.push(e,""));for(const e of r.labels)n.push(`${e}:`);if(r.type===pn.Data){const e=new Uint8Array(r.data);let t=" ";for(let i=0;i<e.length;i++)t+="0x"+e[i].toString(16).padStart(2,"0"),i%16==15?(n.push(t),t=" "):i<e.length-1&&(t+=" ");t.length>4&&n.push(t)}else if(r.type===pn.String)n.push(" "+JSON.stringify(r.value));else for(const e of r.instructions)if(t||e.opcode.stack!==an.Push){let o=[];e.opcode.stack===an.Pop?t||(o=Uo(e.opcode.params,i.splice(Math.max(0,i.length-e.opcode.params.length),e.opcode.params.length),!0)):o=Uo(e.opcode.params,e.args,!1),n.push(" "+e.opcode.mnemonic+(o.length?" "+o.join(", "):""))}else i.push(...e.args)}return n.length&&n.push(""),n}(e.object_code),n={type:"new_assembly_input",assembly:t};return this.worker.postMessage(n),t}update_assembly(e){const t={type:"assembly_change_input",changes:e};this.worker.postMessage(t)}dispose(){this.worker.terminate()}}Mo([T.n],Io.prototype,"warnings",void 0),Mo([T.n],Io.prototype,"errors",void 0),Mo([T.d],Io.prototype,"process_worker_message",void 0);var Bo=n("odCR"),Ao=n.n(Bo);const xo=ln.filter(e=>null!=e).map(e=>({label:e.mnemonic,kind:Po.languages.CompletionItemKind.Function,insertText:e.mnemonic})),jo=[{label:".code",kind:Po.languages.CompletionItemKind.Keyword,insertText:"code"},{label:".data",kind:Po.languages.CompletionItemKind.Keyword,insertText:"data"},{label:".string",kind:Po.languages.CompletionItemKind.Keyword,insertText:"string"}];Po.languages.register({id:"psoasm"}),Po.languages.setMonarchTokensProvider("psoasm",{defaultToken:"invalid",tokenizer:{root:[[/"([^"\\]|\\.)*$/,"string.invalid"],[/"/,{token:"string.quote",bracket:"@open",next:"@string"}],[/r\d+/,"predefined"],[/[^\s]+:/,"tag"],[/0x[0-9a-fA-F]+/,"number.hex"],[/-?\d+(\.\d+)?(e-?\d+)?/,"number.float"],[/-?[0-9]+/,"number"],[/\.[^\s]+/,"keyword"],[/[a-z][a-z0-9_=<>!]*/,"identifier"],[/[ \t\r\n]+/,"white"],[/\/\/.*$/,"comment"],[/,/,"delimiter"]],string:[[/[^\\"]+/,"string"],[/\\(?:[n\\"])/,"string.escape"],[/\\./,"string.escape.invalid"],[/"/,{token:"string.quote",bracket:"@close",next:"@pop"}]]}}),Po.languages.registerCompletionItemProvider("psoasm",{provideCompletionItems:(e,t)=>{const n=e.getValueInRange({startLineNumber:t.lineNumber,endLineNumber:t.lineNumber,startColumn:1,endColumn:t.column});return{suggestions:/^\s*([a-z][a-z0-9_=<>!]*)?$/.test(n)?xo:/^\s*\.[a-z]+$/.test(n)?jo:[],incomplete:!1}}}),Po.languages.setLanguageConfiguration("psoasm",{indentationRules:{increaseIndentPattern:/^\s*\d+:/,decreaseIndentPattern:/^\s*(\d+|\.)/},autoClosingPairs:[{open:'"',close:'"'}],surroundingPairs:[{open:'"',close:'"'}],comments:{lineComment:"//"}}),Po.editor.defineTheme("phantasmal-world",{base:"vs-dark",inherit:!0,rules:[{token:"",foreground:"e0e0e0",background:"#181818"},{token:"tag",foreground:"99bbff"},{token:"keyword",foreground:"d0a0ff",fontStyle:"bold"},{token:"predefined",foreground:"bbffbb"},{token:"number",foreground:"ffffaa"},{token:"number.hex",foreground:"ffffaa"},{token:"string",foreground:"88ffff"},{token:"string.escape",foreground:"8888ff"}],colors:{"editor.background":"#181818","editor.lineHighlightBackground":"#202020"}});class Go extends i.Component{render(){return o.a.createElement("section",{id:"qe-ScriptEditorComponent",className:Ao.a.main},o.a.createElement(we.a,null,({width:e,height:t})=>o.a.createElement(Ko,{width:e,height:t})))}}class Ko extends i.Component{constructor(){super(...arguments),this.div_ref=Object(i.createRef)(),this.disposers=[],this.update_model=()=>{const e=Do.current_quest;if(e&&this.editor&&this.assembly_analyser){const t=this.assembly_analyser.disassemble(e),n=Po.editor.createModel(t.join("\n"),"psoasm");Do.script_undo.action=new pi("Text edits",()=>{this.editor&&this.editor.trigger("undo stack","undo",void 0)},()=>{this.editor&&this.editor.trigger("redo stack","redo",void 0)});let i=n.getAlternativeVersionId(),o=i,r=i;const s=n.onDidChangeContent(e=>{const t=n.getAlternativeVersionId();t<o?(Do.script_undo.can_redo=!0,t===i&&(Do.script_undo.can_undo=!1)):(t<=r?t===r&&(Do.script_undo.can_redo=!1):(Do.script_undo.can_redo=!1,o>r&&(r=o)),Do.script_undo.can_undo=!0),o=t,this.assembly_analyser&&this.assembly_analyser.update_assembly(e.changes)});this.disposers.push(()=>s.dispose()),this.editor.setModel(n),this.editor.updateOptions({readOnly:!1})}else this.editor&&this.editor.updateOptions({readOnly:!0})},this.update_model_markers=()=>{if(!this.editor||!this.assembly_analyser)return;this.assembly_analyser.errors.length;const e=this.editor.getModel();e&&Po.editor.setModelMarkers(e,"psoasm",this.assembly_analyser.errors.map(e=>({severity:Po.MarkerSeverity.Error,message:e.message,startLineNumber:e.line_no,endLineNumber:e.line_no,startColumn:e.col,endColumn:e.col+e.length})))},this.dispose=()=>{if(this.editor){this.editor.dispose();const e=this.editor.getModel();e&&e.dispose(),this.editor=void 0}this.assembly_analyser&&this.assembly_analyser.dispose()}}render(){return o.a.createElement("div",{ref:this.div_ref})}componentDidMount(){this.div_ref.current&&(this.editor=Po.editor.create(this.div_ref.current,{theme:"phantasmal-world",scrollBeyondLastLine:!1,autoIndent:!0,fontSize:14,wordBasedSuggestions:!1,wordWrap:"on",wrappingIndent:"indent"}),this.assembly_analyser=new Io,this.disposers.push(this.dispose,Object(T.e)(this.update_model),Object(T.e)(this.update_model_markers)))}componentWillUnmount(){for(const e of this.disposers.splice(0,this.disposers.length))e()}shouldComponentUpdate(){return!1}UNSAFE_componentWillReceiveProps(e){this.props.width===e.width&&this.props.height===e.height||!this.editor||this.editor.layout(e)}}var zo=n("sYEv"),Ho=n.n(zo);class Vo extends i.Component{render(){return o.a.createElement("div",{className:Ho.a.main},this.props.children)}}var qo=n("LWqw"),$o=n.n(qo);let Jo=class extends i.Component{render(){const e=Do.selected_entity;let t;if(e){const n=e.section?e.section.id:e.section_id;t=o.a.createElement("table",{className:$o.a.table},o.a.createElement("tbody",null,o.a.createElement("tr",null,o.a.createElement("th",null,e instanceof No?"NPC":"Object",":"),o.a.createElement("td",null,To(e.type).name)),o.a.createElement("tr",null,o.a.createElement("th",null,"Section:"),o.a.createElement("td",null,n)),o.a.createElement("tr",null,o.a.createElement("th",{colSpan:2},"Section position:")),o.a.createElement(Yo,{entity:e,position_type:"position",coord:"x"}),o.a.createElement(Yo,{entity:e,position_type:"position",coord:"y"}),o.a.createElement(Yo,{entity:e,position_type:"position",coord:"z"}),o.a.createElement("tr",null,o.a.createElement("th",{colSpan:2},"World position:")),o.a.createElement(Yo,{entity:e,position_type:"world_position",coord:"x"}),o.a.createElement(Yo,{entity:e,position_type:"world_position",coord:"y"}),o.a.createElement(Yo,{entity:e,position_type:"world_position",coord:"z"})))}else t=o.a.createElement(Vo,null,"No entity selected.");return o.a.createElement("div",{className:$o.a.main,tabIndex:-1},t)}};Jo=function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s}([p.a],Jo);class Yo extends i.PureComponent{render(){return o.a.createElement("tr",null,o.a.createElement("th",{className:$o.a.coord_label},this.props.coord.toUpperCase(),":"),o.a.createElement("td",null,o.a.createElement(Zo,Object.assign({},this.props))))}}class Zo extends i.Component{constructor(){super(...arguments),this.state={value:0,initial_position:new At(0,0,0)},this.focus=()=>{this.setState({initial_position:this.props.entity.world_position})},this.blur=()=>{this.state.initial_position.equals(this.props.entity.world_position)||Do.push_entity_move_action(this.props.entity,this.state.initial_position,this.props.entity.world_position)},this.changed=e=>{if(null!=e){const t=this.props.entity,n=this.props.position_type,i=t[n].clone();i[this.props.coord]=e,t[n]=i}}}componentDidMount(){this.start_observing()}componentWillUnmount(){this.disposer&&this.disposer()}componentDidUpdate(e){this.props.entity!==e.entity&&this.start_observing()}render(){return o.a.createElement(E.a,{value:this.state.value,size:"small",precision:3,className:$o.a.coord,onFocus:this.focus,onBlur:this.blur,onChange:this.changed})}start_observing(){var e;this.disposer&&this.disposer(),this.disposer=Object(T.e)(()=>{this.setState({value:this.props.entity[this.props.position_type][this.props.coord]})},{name:`${e=this.props.entity.type,Ee[e]||Yn[e]}.${this.props.position_type}.${this.props.coord} changed`,delay:50})}}var Xo=n("mN4V"),Qo=n.n(Xo),er=n("dA25"),tr=n.n(er);class nr extends i.Component{render(){return i.createElement(E.a,{value:this.props.value,min:this.props.min,max:this.props.max,onChange:this.props.on_change,onBlur:this.props.on_blur,size:"small"})}}var ir=n("5rEg");class or extends i.Component{render(){return i.createElement(ir.a,{value:this.props.value,maxLength:this.props.max_length,onChange:this.props.on_change,onBlur:this.props.on_blur,size:"small"})}}class rr extends i.Component{render(){return i.createElement(ir.a.TextArea,{value:this.props.value,maxLength:this.props.max_length,rows:this.props.rows,onChange:this.props.on_change,onBlur:this.props.on_blur})}}let sr=class extends i.Component{render(){const e=Do.current_quest;let t;if(e){const n=e.episode===Re.IV?"IV":e.episode===Re.II?"II":"I";t=o.a.createElement("table",null,o.a.createElement("tbody",null,o.a.createElement("tr",null,o.a.createElement("th",null,"Episode:"),o.a.createElement("td",null,n)),o.a.createElement("tr",null,o.a.createElement("th",null,"ID:"),o.a.createElement("td",null,o.a.createElement(nr,{value:e.id,min:0,max:4294967295,on_change:this.id_changed}))),o.a.createElement("tr",null,o.a.createElement("th",null,"Name:"),o.a.createElement("td",null,o.a.createElement(or,{value:e.name,max_length:32,on_change:this.name_changed}))),o.a.createElement("tr",null,o.a.createElement("th",{colSpan:2},"Short description:")),o.a.createElement("tr",null,o.a.createElement("td",{colSpan:2},o.a.createElement(rr,{value:e.short_description,max_length:128,rows:3,on_change:this.short_description_changed}))),o.a.createElement("tr",null,o.a.createElement("th",{colSpan:2},"Long description:")),o.a.createElement("tr",null,o.a.createElement("td",{colSpan:2},o.a.createElement(rr,{value:e.long_description,max_length:288,rows:5,on_change:this.long_description_changed})))))}else t=o.a.createElement(Vo,null,"No quest loaded.");return o.a.createElement("div",{className:tr.a.main,tabIndex:-1},t)}id_changed(e){const t=Do.current_quest;t&&null!=e&&Do.push_id_edit_action(t.id,e)}name_changed(e){const t=Do.current_quest;t&&Do.push_name_edit_action(t.name,e.currentTarget.value)}short_description_changed(e){const t=Do.current_quest;t&&Do.push_short_description_edit_action(t.short_description,e.currentTarget.value)}long_description_changed(e){const t=Do.current_quest;t&&Do.push_long_description_edit_action(t.long_description,e.currentTarget.value)}};sr=function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s}([p.a],sr);const ar=new Ai.MeshLambertMaterial({color:65280,side:Ai.DoubleSide}),dr=new Ai.MeshLambertMaterial({color:16711935,side:Ai.DoubleSide}),lr=new Ai.MeshLambertMaterial({skinning:!0,color:16711935,side:Ai.DoubleSide});function ur(e,t,n=dr){return cr(e,t,n,Ai.Mesh)}function cr(e,t,n,i){const{created_by_geometry_builder:o,normalized_material_indices:r,bones:s}=e.userData;let a;if(Array.isArray(t))if(o){a=[ar];for(const[e,i]of r.entries())i>0&&(a[i]=t[e]||n)}else a=t;else a=t||n;const d=new i(e,a);return o&&s.length&&d instanceof Ai.SkinnedMesh&&(d.add(s[0]),d.bind(new Ai.Skeleton(s))),d}var _r;!function(e){e[e.Normal=0]="Normal",e[e.Hovered=1]="Hovered",e[e.Selected=2]="Selected"}(_r||(_r={}));const pr=[];pr[_r.Normal]=16776960,pr[_r.Hovered]=16768831,pr[_r.Selected]=16755200;const vr=[];function wr(e,t,n){return fr(e,t,n,pr[_r.Normal],Yn[e.type])}function hr(e,t,n){return fr(e,t,n,vr[_r.Normal],Ee[e.type])}function fr(e,t,n,i,o){const r=new Ai.MeshLambertMaterial({color:i,side:Ai.DoubleSide}),s=ur(t,n.length?n.map(e=>new Ai.MeshLambertMaterial({map:e,side:Ai.DoubleSide,alphaTest:.5})):r,r);s.name=o,s.userData.entity=e;const{x:a,y:d,z:l}=e.world_position;s.position.set(a,d,l);const u=e.rotation;return s.rotation.set(u.x,u.y,u.z),s}vr[_r.Normal]=16711680,vr[_r.Hovered]=16727903,vr[_r.Selected]=16711764;const mr=new Ai.Vector3(0,-1,0);class gr{constructor(e){this.renderer=e,this.raycaster=new Ai.Raycaster,this.last_pointer_position=new Ai.Vector2(0,0),this.moved_since_last_mouse_down=!1,this.try_highlight_selected=()=>{const e=Do.selected_entity,t=this.renderer.get_entity_mesh(e);t&&this.select({entity:e,mesh:t})},this.on_mouse_down=e=>{this.process_event(e),this.stop_transforming();const t=this.pick_entity(this.renderer.pointer_pos_to_device_coords(e));t?(this.renderer.controls.enabled=!1,this.pick=t,this.select(t)):(this.renderer.controls.enabled=!0,this.pick=void 0),this.renderer.schedule_render()},this.on_mouse_up=e=>{this.process_event(e),this.moved_since_last_mouse_down||this.pick||this.deselect(),this.stop_transforming(),this.renderer.controls.enabled=!0,this.renderer.schedule_render()},this.on_mouse_move=e=>{this.process_event(e);const t=this.renderer.pointer_pos_to_device_coords(e);if(this.selected&&this.pick)this.moved_since_last_mouse_down&&(1===e.buttons&&(e.shiftKey?this.translate_vertically(this.selected,this.pick,t):this.translate_horizontally(this.selected,this.pick,t)),this.renderer.schedule_render());else{const e=this.pick_entity(t);this.mark_hovered(e)&&this.renderer.schedule_render()}},this.stop_transforming=()=>{if(this.moved_since_last_mouse_down&&this.selected&&this.pick){const e=this.selected.entity;Do.push_entity_move_action(e,this.pick.initial_position,e.world_position)}this.pick=void 0},Object(T.e)(()=>{const e=Do.selected_entity;this.selected&&this.selected.entity===e||(this.stop_transforming(),e?this.try_highlight_selected():this.deselect())})}process_event(e){"mousedown"===e.type?this.moved_since_last_mouse_down=!1:e.offsetX===this.last_pointer_position.x&&e.offsetY===this.last_pointer_position.y||(this.moved_since_last_mouse_down=!0),this.last_pointer_position.set(e.offsetX,e.offsetY)}mark_hovered(e){let t=!1;return this.selected&&kr(e,this.selected)||(kr(e,this.hovered)||(this.hovered&&(yr(this.hovered,_r.Normal),this.hovered=void 0),e&&yr(e,_r.Hovered),t=!0),this.hovered=e),t}select(e){kr(e,this.hovered)&&(this.hovered=void 0),kr(e,this.selected)?this.selected=e:(this.selected&&yr(this.selected,_r.Normal),yr(e,_r.Selected),this.selected=e,Do.set_selected_entity(e.entity))}deselect(){this.selected&&yr(this.selected,_r.Normal),this.selected=void 0,Do.set_selected_entity(void 0)}translate_vertically(e,t,n){this.raycaster.setFromCamera(n,this.renderer.camera);const i=this.raycaster.ray,o=this.renderer.camera.getWorldDirection(new Ai.Vector3).negate(),r=(new Ai.Plane).setFromNormalAndCoplanarPoint(new Ai.Vector3(o.x,0,o.z).normalize(),e.mesh.position.sub(t.grab_offset)),s=new Ai.Vector3;if(i.intersectPlane(r,s)){const n=s.y+t.grab_offset.y,i=n-e.entity.world_position.y;t.drag_y+=i,t.drag_adjust.y-=i,e.entity.world_position=new At(e.entity.world_position.x,n,e.entity.world_position.z)}}translate_horizontally(e,t,n){const{intersection:i,section:o}=this.pick_terrain(n,t);if(i)e.entity.set_world_position_and_section(new At(i.point.x,i.point.y+t.drag_y,i.point.z),o);else{this.raycaster.setFromCamera(n,this.renderer.camera);const i=this.raycaster.ray,o=new Ai.Plane(new Ai.Vector3(0,1,0),-e.entity.world_position.y+t.grab_offset.y),r=new Ai.Vector3;i.intersectPlane(o,r)&&(e.entity.world_position=new At(r.x+t.grab_offset.x,e.entity.world_position.y,r.z+t.grab_offset.z))}}pick_entity(e){this.raycaster.setFromCamera(e,this.renderer.camera);const[t]=this.raycaster.intersectObjects(this.renderer.entity_models.children);if(!t)return;const n=t.object.userData.entity,i=t.object.position.clone().sub(t.point),o=i.clone();let r=0;this.raycaster.set(t.object.position,mr);const[s]=this.raycaster.intersectObjects(this.renderer.collision_geometry.children,!0);return s&&(o.y-=s.distance,r+=s.distance),{mesh:t.object,entity:n,initial_position:n.world_position,grab_offset:i,drag_adjust:o,drag_y:r}}pick_terrain(e,t){this.raycaster.setFromCamera(e,this.renderer.camera),this.raycaster.ray.origin.add(t.drag_adjust);const n=this.raycaster.intersectObjects(this.renderer.collision_geometry.children,!0);for(const e of n)if(e.face.normal.y>.75)return{intersection:e,section:e.object.userData.section};return{}}}function yr({entity:e,mesh:t},n){const i=e instanceof No?vr[n]:pr[n];if(t)if(Array.isArray(t.material))for(const e of t.material)n===_r.Normal&&e.map?e.color.set(16777215):e.color.set(i);else t.material.color.set(i)}function kr(e,t){return e&&t?e.entity===t.entity:e===t}const Rr=d.a.get("data_formats/parsing/ninja/texture"),br=1213027928,Nr=1414682200;function Er(e){const t=gi(e),n=t.find(e=>e.type===br),i=n&&function(e){return{texture_count:e.u16()}}(n.data),o=t.filter(e=>e.type===Nr).map(e=>(function(e){const t=e.u32(),n=e.u32(),i=e.u32(),o=e.u16(),r=e.u16(),s=e.u32();e.seek(36);const a=e.array_buffer(s);return{id:i,format:[t,n],width:o,height:r,size:s,data:a}})(e.data));return i?i.texture_count!==o.length&&Rr.warn(`Found ${o.length} textures instead of ${i.texture_count} as defined in the header.`):Rr.warn("No header found."),{textures:o}}function Tr(e){return e.textures.map(Sr)}function Sr(e){let t,n;switch(e.format[1]){case 6:t=Ai.RGBA_S3TC_DXT1_Format,n=e.width*e.height/2;break;case 7:t=Ai.RGBA_S3TC_DXT3_Format,n=e.width*e.height;break;default:throw new Error(`Format ${e.format.join(", ")} not supported.`)}const i=new Ai.CompressedTexture([{data:new Uint8Array(e.data,0,n),width:e.width,height:e.height}],e.width,e.height,t);return i.minFilter=Ai.LinearFilter,i.wrapS=Ai.MirroredRepeatWrapping,i.wrapT=Ai.MirroredRepeatWrapping,i.needsUpdate=!0,i}var Or=function(e,t,n,i){return new(n||(n=Promise))(function(o,r){function s(e){try{d(i.next(e))}catch(e){r(e)}}function a(e){try{d(i.throw(e))}catch(e){r(e)}}function d(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(s,a)}d((i=i.apply(e,t||[])).next())})};const Cr=d.a.get("loading/entities"),Dr=new Ai.CylinderBufferGeometry(3,3,20);Dr.translate(0,10,0);const Pr=new Promise(e=>e(Dr)),Fr=[],Wr=new Promise(e=>e(Fr)),Lr=new no;Lr.set(Ee.Unknown,Pr);const Ur=new no;Ur.set(Ee.Unknown,Wr);const Mr=new no,Ir=new no;for(const e of[Yn.Unknown,Yn.PlayerSet,Yn.FogCollision,Yn.EventCollision,Yn.ObjRoomID,Yn.ScriptCollision,Yn.ItemLight,Yn.FogCollisionSW,Yn.MenuActivation,Yn.BoxDetectObject,Yn.SymbolChatObject,Yn.TouchPlateObject,Yn.TargetableObject,Yn.EffectObject,Yn.CountDownObject,Yn.TelepipeLocation,Yn.Pioneer2InvisibleTouchplate,Yn.TempleMapDetect,Yn.LabInvisibleObject])Mr.set(e,Pr),Ir.set(e,Wr);function Br(e){return Or(this,void 0,void 0,function*(){return Lr.get_or_set(e,()=>Or(this,void 0,void 0,function*(){try{const{url:t,data:n}=yield Gr(e,zr.Geometry),i=new Gt(n,Mt.Little),o=t.endsWith(".nj")?Wi(i):Li(i);return o.length?$i(o[0]):(Cr.warn(`Couldn't parse ${t} for ${Ee[e]}.`),Dr)}catch(t){return Cr.warn(`Couldn't load geometry file for ${Ee[e]}.`,t),Dr}}))})}function Ar(e){return Or(this,void 0,void 0,function*(){return Ur.get_or_set(e,()=>Or(this,void 0,void 0,function*(){try{const{data:t}=yield Gr(e,zr.Texture);return Tr(Er(new Gt(t,Mt.Little)))}catch(t){return Cr.warn(`Couldn't load texture file for ${Ee[e]}.`,t),Fr}}))})}function xr(e){return Or(this,void 0,void 0,function*(){return Mr.get_or_set(e,()=>Or(this,void 0,void 0,function*(){try{const{url:t,data:n}=yield Kr(e,zr.Geometry),i=new Gt(n,Mt.Little),o=t.endsWith(".nj")?Wi(i):Li(i);return o.length?$i(o[0]):(Cr.warn(`Couldn't parse ${t} for ${Yn[e]}.`),Dr)}catch(t){return Cr.warn(`Couldn't load geometry file for ${Yn[e]}.`,t),Dr}}))})}function jr(e){return Or(this,void 0,void 0,function*(){return Ir.get_or_set(e,()=>Or(this,void 0,void 0,function*(){try{const{data:t}=yield Kr(e,zr.Texture);return Tr(Er(new Gt(t,Mt.Little)))}catch(t){return Cr.warn(`Couldn't load texture file for ${Yn[e]}.`,t),Fr}}))})}function Gr(e,t){return Or(this,void 0,void 0,function*(){const n=function e(t,n){switch(t){case Ee.Dubswitch:return`/npcs/${Ee[t]}.${n===zr.Geometry?"xj":"xvm"}`;case Ee.Hildebear2:return e(Ee.Hildebear,n);case Ee.Hildeblue2:return e(Ee.Hildeblue,n);case Ee.RagRappy2:return e(Ee.RagRappy,n);case Ee.Monest2:return e(Ee.Monest,n);case Ee.PoisonLily2:return e(Ee.PoisonLily,n);case Ee.NarLily2:return e(Ee.NarLily,n);case Ee.GrassAssassin2:return e(Ee.GrassAssassin,n);case Ee.Dimenian2:return e(Ee.Dimenian,n);case Ee.LaDimenian2:return e(Ee.LaDimenian,n);case Ee.SoDimenian2:return e(Ee.SoDimenian,n);case Ee.DarkBelra2:return e(Ee.DarkBelra,n);case Ee.SavageWolf2:return e(Ee.SavageWolf,n);case Ee.BarbarousWolf2:return e(Ee.BarbarousWolf,n);case Ee.PanArms2:return e(Ee.PanArms,n);case Ee.Dubchic2:return e(Ee.Dubchic,n);case Ee.Gilchic2:return e(Ee.Gilchic,n);case Ee.Garanz2:return e(Ee.Garanz,n);case Ee.Dubswitch2:return e(Ee.Dubswitch,n);case Ee.Delsaber2:return e(Ee.Delsaber,n);case Ee.ChaosSorcerer2:return e(Ee.ChaosSorcerer,n);default:return`/npcs/${Ee[t]}.${n===zr.Geometry?"nj":"xvm"}`}}(e,t);return{url:n,data:yield to(n)}})}function Kr(e,t){return Or(this,void 0,void 0,function*(){const n=function(e,t){if(t!==zr.Geometry)return`/objects/${Zn(e).pso_id}.xvm`;switch(e){case Yn.EasterEgg:case Yn.ChristmasTree:case Yn.ChristmasWreath:case Yn.TwentyFirstCentury:case Yn.Sonic:case Yn.WelcomeBoard:case Yn.FloatingJelifish:case Yn.RuinsSeal:case Yn.Dolphin:case Yn.Cacti:case Yn.BigBrownRock:case Yn.PoisonPlant:case Yn.BigBlackRocks:case Yn.FallingRock:case Yn.DesertFixedTypeBoxBreakableCrystals:case Yn.BeeHive:return`/objects/${Zn(e).pso_id}.nj`;default:return`/objects/${Zn(e).pso_id}.xj`}}(e,t);return{url:n,data:yield to(n)}})}var zr;!function(e){e[e.Geometry=0]="Geometry",e[e.Texture=1]="Texture"}(zr||(zr={}));var Hr=function(e,t,n,i){return new(n||(n=Promise))(function(o,r){function s(e){try{d(i.next(e))}catch(e){r(e)}}function a(e){try{d(i.throw(e))}catch(e){r(e)}}function d(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(s,a)}d((i=i.apply(e,t||[])).next())})};const Vr=d.a.get("rendering/QuestModelManager"),qr=new Ai.Vector3(0,800,700),$r=new Ai.Vector3(0,0,0),Jr=new Ai.Object3D;class Yr{constructor(e){this.renderer=e,this.entity_reaction_disposers=[]}load_models(e,t){return Hr(this,void 0,void 0,function*(){let n;if(e&&t&&(n=e.area_variants.find(e=>e.area.id===t.id)||fo.get_variant(e.episode,t.id,0)),this.quest!==e||this.area_variant!==n)if(this.quest=e,this.area=t,this.area_variant=n,this.dispose_entity_reactions(),e&&t)try{const i=e.episode,o=t.id,r=n?n.id:0,s=yield so(i,o,r),a=yield function(e,t,n){return io(this,void 0,void 0,function*(){return oo.get_or_set(`${e}-${t}-${n}`,()=>ao(e,t,n)).geometry})}(i,o,r);if(this.add_sections_to_collision_geometry(s,a),this.quest!==e||this.area_variant!==n)return;this.renderer.collision_geometry=s,this.renderer.render_geometry=a,this.renderer.reset_camera(qr,$r),this.renderer.reset_entity_models();for(const i of e.npcs)if(i.area_id===t.id){const t=yield Br(i.type),o=yield Ar(i.type);if(this.quest!==e||this.area_variant!==n)return;const r=hr(i,t,o);this.update_entity_geometry(i,r)}for(const i of e.objects)if(i.area_id===t.id){const t=yield xr(i.type),o=yield jr(i.type);if(this.quest!==e||this.area_variant!==n)return;const r=wr(i,t,o);this.update_entity_geometry(i,r)}}catch(n){Vr.error(`Couldn't load models for quest ${e.id}, ${t.name}.`,n),this.renderer.collision_geometry=Jr,this.renderer.render_geometry=Jr,this.renderer.reset_entity_models()}else this.renderer.collision_geometry=Jr,this.renderer.render_geometry=Jr,this.renderer.reset_entity_models()})}add_sections_to_collision_geometry(e,t){const n=new Ai.Raycaster,i=new Ai.Vector3,o=new Ai.Vector3(0,-1,0),r=new Ai.Vector3(0,1,0);for(const s of e.children){s.geometry.boundingBox.getCenter(i),n.set(i,o);const e=n.intersectObject(t,!0).find(e=>null!=e.object.userData.section);n.set(i,r);const a=n.intersectObject(t,!0).find(e=>null!=e.object.userData.section);let d;if(d=e&&a?e.distance<=a.distance?e:a:e||a){const e=s.userData,t=d.object.userData;e.section=t.section}}}update_entity_geometry(e,t){this.renderer.add_entity_model(t),this.entity_reaction_disposers.push(Object(T.e)(()=>{const{x:n,y:i,z:o}=e.world_position;t.position.set(n,i,o);const r=e.rotation;t.rotation.set(r.x,r.y,r.z),this.renderer.schedule_render()}))}dispose_entity_reactions(){for(const e of this.entity_reaction_disposers)e()}}var Zr=n("pVCM");Zr.a.install({THREE:Object.assign({},Ai,{MOUSE:Object.assign({},Ai.MOUSE,{LEFT:Ai.MOUSE.RIGHT,RIGHT:Ai.MOUSE.LEFT})})});class Xr{constructor(e){this._debug=!1,this.scene=new Ai.Scene,this.light_holder=new Ai.Group,this.renderer=new Ai.WebGLRenderer({antialias:!0}),this.render_scheduled=!1,this.render_stop_scheduled=!1,this.light=new Ai.HemisphereLight(16777215,5263440,1.2),this.controls_clock=new Ai.Clock,this.schedule_render=()=>{this.render_scheduled=!0},this.on_mouse_down=e=>{e.currentTarget&&e.currentTarget.focus()},this.call_render=()=>{const e=this.controls.update(this.controls_clock.getDelta()),t=this.render_scheduled||e;this.render_scheduled=!1,this.render_stop_scheduled?this.render_stop_scheduled=!1:(t&&this.render(),requestAnimationFrame(this.call_render))},this.camera=e,this.dom_element.tabIndex=0,this.dom_element.addEventListener("mousedown",this.on_mouse_down),this.dom_element.style.outline="none",this.controls=new Zr.a(e,this.renderer.domElement),this.controls.dampingFactor=1,this.controls.draggingDampingFactor=1,this.scene.background=new Ai.Color(1579032),this.light_holder.add(this.light),this.scene.add(this.light_holder),this.renderer.setPixelRatio(window.devicePixelRatio)}get debug(){return this._debug}set debug(e){this._debug=e}get dom_element(){return this.renderer.domElement}set_size(e,t){this.renderer.setSize(e,t),this.schedule_render()}pointer_pos_to_device_coords(e){const t=this.renderer.getSize(new Ai.Vector2);return t.width=e.offsetX/t.width*2-1,t.height=e.offsetY/t.height*-2+1,t}start_rendering(){requestAnimationFrame(this.call_render)}stop_rendering(){this.render_stop_scheduled=!0}reset_camera(e,t){this.controls.setLookAt(e.x,e.y,e.z,t.x,t.y,t.z)}render(){this.renderer.render(this.scene,this.camera)}}let Qr;class es extends Xr{constructor(){super(new Ai.PerspectiveCamera(60,1,10,1e4)),this._collision_geometry=new Ai.Object3D,this._render_geometry=new Ai.Object3D,this._entity_models=new Ai.Object3D,this.entity_to_mesh=new Map;const e=new Yr(this);Object(T.e)(()=>{e.load_models(Do.current_quest,Do.current_area)},{name:"call load_models"}),this.entity_controls=new gr(this),this.dom_element.addEventListener("mousedown",this.entity_controls.on_mouse_down),this.dom_element.addEventListener("mouseup",this.entity_controls.on_mouse_up),this.dom_element.addEventListener("mousemove",this.entity_controls.on_mouse_move)}get debug(){return this._debug}set debug(e){this._debug!==e&&(this._debug=e,this._render_geometry.visible=e,this.schedule_render())}get collision_geometry(){return this._collision_geometry}set collision_geometry(e){this.scene.remove(this.collision_geometry),this._collision_geometry=e,this.scene.add(e)}get render_geometry(){return this._render_geometry}set render_geometry(e){this.scene.remove(this._render_geometry),this._render_geometry=e,e.visible=this.debug,this.scene.add(e)}get entity_models(){return this._entity_models}set_size(e,t){this.camera.aspect=e/t,this.camera.updateProjectionMatrix(),super.set_size(e,t)}reset_entity_models(){this.scene.remove(this._entity_models),this._entity_models=new Ai.Group,this.scene.add(this._entity_models),this.entity_to_mesh.clear()}add_entity_model(e){const t=e.userData.entity;this._entity_models.add(e),this.entity_to_mesh.set(t,e),t===Do.selected_entity&&this.entity_controls.try_highlight_selected()}get_entity_mesh(e){return this.entity_to_mesh.get(e)}}class ts extends i.Component{constructor(){super(...arguments),this.modify_dom=e=>{e&&(this.props.renderer.set_size(this.props.width,this.props.height),e.appendChild(this.props.renderer.dom_element))}}render(){return o.a.createElement("div",{className:"RendererComponent",ref:this.modify_dom})}UNSAFE_componentWillReceiveProps(e){this.props.debug!==e.debug&&(this.props.renderer.debug=!!e.debug),this.props.width===e.width&&this.props.height===e.height||this.props.renderer.set_size(e.width,e.height)}componentDidMount(){this.props.renderer.start_rendering()}componentWillUnmount(){this.props.renderer.stop_rendering(),this.props.on_will_unmount&&this.props.on_will_unmount()}shouldComponentUpdate(){return!1}}let ns=class extends i.Component{render(){const e=Do.debug;return o.a.createElement(we.a,null,({width:t,height:n})=>o.a.createElement(ts,{renderer:(Qr||(Qr=new es),Qr),width:t,height:n,debug:e}))}};ns=function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s}([p.a],ns);var is=n("jsC+"),os=n("CtXQ"),rs=n("8z0m"),ss=n("kLXV"),as=n("Vl3Y"),ds=n("GNjY"),ls=n.n(ds),us=function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s};let cs=class extends i.Component{render(){const e=Do.current_quest;return o.a.createElement("div",{className:ls.a.main},o.a.createElement(is.a,{overlay:o.a.createElement(c.b,{onClick:this.new_quest},o.a.createElement(c.b.Item,{key:Re[Re.I]},"Episode I")),trigger:["click"]},o.a.createElement(kt.a,{icon:"file-add"},"New quest",o.a.createElement(os.a,{type:"down"}))),o.a.createElement(rs.a,{accept:".qst",showUploadList:!1,onChange:this.open_file,customRequest:()=>!1},o.a.createElement(kt.a,{icon:"file"},"Open file...")),o.a.createElement(kt.a,{icon:"save",onClick:Do.open_save_dialog,disabled:!e},"Save as..."),o.a.createElement(kt.a,{icon:"undo",onClick:this.undo,title:wi.first_undo?`Undo "${wi.first_undo.description}"`:"Nothing to undo",disabled:!wi.can_undo},"Undo"),o.a.createElement(kt.a,{icon:"redo",onClick:this.redo,title:wi.first_redo?`Redo "${wi.first_redo.description}"`:"Nothing to redo",disabled:!wi.can_redo},"Redo"),o.a.createElement(_s,null),o.a.createElement(ps,null))}new_quest({key:e}){Do.new_quest(Re[e])}open_file(e){e.file.originFileObj&&Do.open_file(e.file.name,e.file.originFileObj)}undo(){wi.undo()}redo(){wi.redo()}};cs=us([p.a],cs);let _s=class extends i.Component{render(){const e=Do.current_quest,t=e?fo.get_areas_for_episode(e.episode):[],n=Do.current_area;return o.a.createElement(_.a,{onChange:Do.set_current_area_id,value:n&&n.id,style:{width:200},disabled:!e},t.map(t=>{const n=e&&e.entities_per_area.get(t.id);return o.a.createElement(_.a.Option,{key:t.id,value:t.id},t.name,n&&` (${n})`)}))}};_s=us([p.a],_s);let ps=class extends i.Component{render(){return o.a.createElement(ss.a,{title:o.a.createElement(o.a.Fragment,null,o.a.createElement(os.a,{type:"save"})," Save as..."),visible:Do.save_dialog_open,onOk:this.ok,onCancel:this.cancel},o.a.createElement(as.a,{layout:"vertical"},o.a.createElement(as.a.Item,{label:"Name"},o.a.createElement(ir.a,{autoFocus:!0,maxLength:32,value:Do.save_dialog_filename,onChange:this.name_changed}))))}name_changed(e){Do.set_save_dialog_filename(e.currentTarget.value)}ok(){Do.save_current_quest_to_file(Do.save_dialog_filename||"untitled")}cancel(){Do.close_save_dialog()}};ps=us([p.a],ps);var vs=n("MoqK"),ws=n.n(vs);let hs=class extends i.Component{render(){const e=Do.current_quest,t=new Map;if(e)for(const n of e.npcs){const e=t.get(n.type)||0;t.set(n.type,e+1)}const n=8*(t.get(Ee.Canane)||0),i=[...t].sort((e,t)=>e[0]-t[0]).map(([e,t])=>{const i=e===Ee.Canadine?n:0;return o.a.createElement("tr",{key:e},o.a.createElement("td",null,Oe(e).name,":"),o.a.createElement("td",null,t+i))});return o.a.createElement("div",{className:ws.a.main},o.a.createElement("table",null,o.a.createElement("tbody",null,i)))}};hs=function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s}([p.a],hs);var fs=function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},ms=function(e,t,n,i){return new(n||(n=Promise))(function(o,r){function s(e){try{d(i.next(e))}catch(e){r(e)}}function a(e){try{d(i.throw(e))}catch(e){r(e)}}function d(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(s,a)}d((i=i.apply(e,t||[])).next())})};const gs=d.a.get("ui/quest_editor/QuestEditorComponent"),ys=new Map([[sr,"quest_info"],[hs,"npc_counts"],[ns,"quest_renderer"],[Go,"assembly_editor"],[Jo,"entity_info"]]),ks={settings:{showPopoutIcon:!1},dimensions:{headerHeight:28},labels:{close:"Close",maximise:"Maximise",minimise:"Minimise",popout:"Open in new window"}},Rs=[{type:"row",content:[{type:"stack",width:3,content:[{title:"Info",type:"react-component",component:ys.get(sr),isClosable:!1},{title:"NPC Counts",type:"react-component",component:ys.get(hs),isClosable:!1}]},{type:"stack",width:9,content:[{title:"3D View",type:"react-component",component:ys.get(ns),isClosable:!1},{title:"Script",type:"react-component",component:ys.get(Go),isClosable:!1}]},{title:"Entity",type:"react-component",component:ys.get(Jo),isClosable:!1,width:2}]}];let bs=class extends i.Component{constructor(){super(...arguments),this.layout_element=Object(i.createRef)(),this.focus=e=>{const t=document.getElementById("qe-ScriptEditorComponent");t&&t.compareDocumentPosition(e.target)&Node.DOCUMENT_POSITION_CONTAINED_BY?Do.script_undo.make_current():Do.undo.make_current()},this.resize=()=>{this.layout&&this.layout.updateSize()}}componentDidMount(){Do.undo.make_current(),window.addEventListener("resize",this.resize),setTimeout(()=>ms(this,void 0,void 0,function*(){if(this.layout_element.current&&!this.layout){const e=yield Ut.load_layout_config([...ys.values()],Rs),t=Object.assign({},ks,{content:e});try{this.layout=new Ft.a(t,this.layout_element.current)}catch(e){gs.warn("Couldn't initialize golden layout with persisted layout.",e),this.layout=new Ft.a(Object.assign({},ks,{content:Rs}),this.layout_element.current)}for(const[e,t]of ys)this.layout.registerComponent(t,e);this.layout.on("stateChanged",()=>{this.layout&&Ut.persist_layout_config(this.layout.toConfig().content)}),this.layout.on("stackCreated",e=>{e.on("activeContentItemChanged",e=>{"component"in e.config&&(e.config.component===ys.get(Go)?Do.script_undo.make_current():Do.undo.make_current())})}),this.layout.init()}}),0)}componentWillUnmount(){Do.undo.ensure_not_current(),window.removeEventListener("resize",this.resize),this.layout&&(this.layout.destroy(),this.layout=void 0)}render(){return o.a.createElement("div",{className:Qo.a.main},o.a.createElement(cs,null),o.a.createElement("div",{className:Qo.a.content,onFocus:this.focus,ref:this.layout_element}))}};bs=fs([p.a],bs);var Ns=n("Sdc0");const Es=1296321870;var Ts,Ss;function Os(e,t){return e.u32()===Es?function(e,t){const n=e.u32();return Cs(e.take(n),t)}(e,t):(e.seek_start(0),function(e,t){e.seek_end(16);const n=e.u32();e.seek_start(n);const i=e.u32();return e.seek_start(i),function(e,t){e.seek(4);const n=e.u32();return e.seek_start(n),Cs(e,t)}(e,t)}(e,t))}function Cs(e,t){let n=e.u32();const i=e.u32(),o=e.u16(),r=e.u16(),s=(192&r)>>6,a=15&r,d=[];for(let r=0;r<t;r++){e.seek_start(n),n=n+=8*a;let t={tracks:[]};d.push(t);const r=[],s=[];for(let t=0;t<a;t++)r.push(e.u32());for(let t=0;t<a;t++){const t=e.u32();s.push(t)}if(1&o){e.seek_start(r.shift());const n=s.shift();n&&t.tracks.push({type:Ss.Position,keyframes:Ds(e,n)})}if(2&o){e.seek_start(r.shift());const n=s.shift();n&&t.tracks.push({type:Ss.Rotation,keyframes:Ps(e,n,i)})}if(4&o){e.seek_start(r.shift());const n=s.shift();n&&t.tracks.push({type:Ss.Scale,keyframes:Ds(e,n)})}}return{motion_data:d,frame_count:i,type:o,interpolation:s,element_count:a}}function Ds(e,t){const n=[];for(let i=0;i<t;++i)n.push({frame:e.u32(),value:new At(e.f32(),e.f32(),e.f32())});return n}function Ps(e,t,n){const i=[],o=e.position;for(let n=0;n<t;++n)i.push({frame:e.u16(),value:new At(e.u16()*Di,e.u16()*Di,e.u16()*Di)});let r=-1;for(const{frame:s}of i){if(s<r||s>=n)return e.seek_start(o),Fs(e,t);r=s}return i}function Fs(e,t){const n=[];for(let i=0;i<t;++i)n.push({frame:e.u32(),value:new At(e.i32()*Di,e.i32()*Di,e.i32()*Di)});return n}!function(e){e[e.Linear=0]="Linear",e[e.Spline=1]="Spline",e[e.UserFunction=2]="UserFunction"}(Ts||(Ts={})),function(e){e[e.Position=0]="Position",e[e.Rotation=1]="Rotation",e[e.Scale=2]="Scale"}(Ss||(Ss={}));var Ws=function(e,t,n,i){return new(n||(n=Promise))(function(o,r){function s(e){try{d(i.next(e))}catch(e){r(e)}}function a(e){try{d(i.throw(e))}catch(e){r(e)}}function d(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(s,a)}d((i=i.apply(e,t||[])).next())})};function Ls(e,t,n){return Ws(this,void 0,void 0,function*(){return yield to(function(e,t,n){return`/player/${e}${t}${null==n?"":n}.nj`}(e,t,n))})}const Us=30;function Ms(e,t){const n=t.interpolation===Ts.Spline?Ai.InterpolateSmooth:Ai.InterpolateLinear,i=[];return t.motion_data.forEach((t,o)=>{const r=e.get_bone(o);r&&t.tracks.forEach(({type:e,keyframes:t})=>{const s=[],a=[];for(const n of t)if(s.push(n.frame/Us),e===Ss.Rotation){const e=r.evaluation_flags.zxy_rotation_order?"ZXY":"ZYX",t=(new Ai.Quaternion).setFromEuler(new Ai.Euler(n.value.x,n.value.y,n.value.z,e));a.push(t.x,t.y,t.z,t.w)}else a.push(n.value.x,n.value.y,n.value.z);if(e===Ss.Rotation)i.push(new Ai.QuaternionKeyframeTrack(`.bones[${o}].quaternion`,s,a,n));else{const t=e===Ss.Position?`.bones[${o}].position`:`.bones[${o}].scale`;i.push(new Ai.VectorKeyframeTrack(t,s,a,n))}})}),new Ai.AnimationClip("Animation",(t.frame_count-1)/Us,i).optimize()}class Is{constructor(e,t,n,i){this.name=e,this.head_style_count=t,this.hair_styles_count=n,this.hair_styles_with_accessory=i}}class Bs{constructor(e,t){this.id=e,this.name=t}}var As=function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},xs=function(e,t,n,i){return new(n||(n=Promise))(function(o,r){function s(e){try{d(i.next(e))}catch(e){r(e)}}function a(e){try{d(i.throw(e))}catch(e){r(e)}}function d(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(s,a)}d((i=i.apply(e,t||[])).next())})};const js=d.a.get("stores/ModelViewerStore"),Gs=new Map,Ks=new Map;class zs{constructor(){this.models=[new Is("HUmar",1,10,new Set([6])),new Is("HUnewearl",1,10,new Set),new Is("HUcast",5,0,new Set),new Is("HUcaseal",5,0,new Set),new Is("RAmar",1,10,new Set([0,1,2,3,4,5,6,7,8,9])),new Is("RAmarl",1,10,new Set([0,1,2,3,4,5,6,7,8,9])),new Is("RAcast",5,0,new Set),new Is("RAcaseal",5,0,new Set),new Is("FOmar",1,10,new Set([0,1,2,3,4,5,6,7,8,9])),new Is("FOmarl",1,10,new Set([0,1,2,3,4,5,6,7,8,9])),new Is("FOnewm",1,10,new Set([0,1,2,3,4,5,6,7,8,9])),new Is("FOnewearl",1,10,new Set([0,1,2,3,4,5,6,7,8,9]))],this.animations=new Array(572).fill(void 0).map((e,t)=>new Bs(t,`Animation ${t+1}`)),this.clock=new Ai.Clock,this.current_bone_count=0,this.animation_playing=!1,this.animation_frame_rate=Us,this.animation_frame=0,this.animation_frame_count=0,this.has_skeleton=!1,this.show_skeleton=!1,this.set_animation_frame_rate=Object(T.d)("set_animation_frame_rate",e=>{this.animation&&(this.animation.mixer.timeScale=e/Us,this.animation_frame_rate=e)}),this.set_animation_frame=Object(T.d)("set_animation_frame",e=>{if(this.animation){const t=this.animation_frame_count;e>t&&(e=1),e<1&&(e=t),this.animation.action.time=(e-1)/Us,this.animation_frame=e}}),this.load_model=e=>xs(this,void 0,void 0,function*(){const t=yield this.get_player_ninja_object(e);this.set_model(t,!0,e),this.current_bone_count=64}),this.load_animation=e=>xs(this,void 0,void 0,function*(){const t=yield this.get_nj_motion(e);this.current_model&&this.set_animation(Ms(this.current_model,t),e)}),this.load_file=e=>xs(this,void 0,void 0,function*(){try{const t=yield ci(e),n=new Gt(t,Mt.Little);if(e.name.endsWith(".nj")){const e=Wi(n)[0];this.set_model(e,!0)}else if(e.name.endsWith(".xj")){const e=Li(n)[0];this.set_model(e,!1)}else if(e.name.endsWith(".njm")){if(this.current_model){const e=Os(n,this.current_bone_count);this.set_animation(Ms(this.current_model,e))}}else if(e.name.endsWith(".xvm")){if(this.current_model){const e=Er(n);this.set_textures(Tr(e))}}else js.error(`Unknown file extension in filename "${e.name}".`)}catch(e){js.error("Couldn't read file.",e)}}),this.pause_animation=Object(T.d)("pause_animation",()=>{this.animation&&(this.animation.action.paused=!0,this.animation_playing=!1,this.clock.stop())}),this.toggle_animation_playing=Object(T.d)("toggle_animation_playing",()=>{this.animation&&(this.animation.action.paused=!this.animation.action.paused,this.animation_playing=!this.animation.action.paused,this.animation_playing?this.clock.start():this.clock.stop())}),this.update_animation_frame=Object(T.d)("update_animation_frame",()=>{if(this.animation&&this.animation_playing){const e=this.animation.action.time;this.animation_frame=Math.round(e*Us)+1}}),this.set_animation=Object(T.d)("set_animation",(e,t)=>{if(!(this.current_obj3d&&this.current_obj3d instanceof Ai.SkinnedMesh))return;let n;this.animation?(this.animation.mixer.stopAllAction(),n=this.animation.mixer):n=new Ai.AnimationMixer(this.current_obj3d),this.animation={player_animation:t,mixer:n,clip:e,action:n.clipAction(e)},this.clock.start(),this.animation.action.play(),this.animation_playing=!0,this.animation_frame_count=Math.round(Us*e.duration)+1}),this.set_model=Object(T.d)("set_model",(e,t,n)=>{this.current_obj3d&&this.animation&&(this.animation.mixer.stopAllAction(),this.animation.mixer.uncacheRoot(this.current_obj3d),this.animation=void 0),this.current_player_model=n,this.current_model=e,this.current_bone_count=e.bone_count(),this.has_skeleton=t,this.set_obj3d()}),this.set_textures=Object(T.d)("set_textures",e=>{this.set_obj3d(e)}),this.set_obj3d=e=>{if(this.current_model){let t;const n=e&&e.map(e=>new Ai.MeshLambertMaterial({skinning:this.has_skeleton,map:e,side:Ai.DoubleSide,alphaTest:.5})),i=(t=this.has_skeleton?function(e,t,n=lr){return cr(e,t,n,Ai.SkinnedMesh)}($i(this.current_model),n):ur($i(this.current_model),n)).geometry.boundingBox,o=i.max.y-i.min.y;t.translateY(-o/2-i.min.y),this.current_obj3d=t}}}add_to_bone(e,t,n){const i=e.get_bone(n);i&&(i.evaluation_flags.hidden=!1,i.evaluation_flags.break_child_trace=!1,i.children.push(t))}get_player_ninja_object(e){return xs(this,void 0,void 0,function*(){let t=Gs.get(e.name);return t||(t=this.get_all_assets(e),Gs.set(e.name,t),t)})}get_all_assets(e){return xs(this,void 0,void 0,function*(){const t=yield Ls(e.name,"Body"),n=Wi(new Gt(t,Mt.Little))[0];if(!n)throw new Error(`Couldn't parse body for player class ${e.name}.`);const i=yield Ls(e.name,"Head",0),o=Wi(new Gt(i,Mt.Little))[0];if(o&&this.add_to_bone(n,o,59),e.hair_styles_count>0){const t=yield Ls(e.name,"Hair",0),i=Wi(new Gt(t,Mt.Little))[0];if(i&&this.add_to_bone(n,i,59),e.hair_styles_with_accessory.has(0)){const t=yield Ls(e.name,"Accessory",0),i=Wi(new Gt(t,Mt.Little))[0];i&&this.add_to_bone(n,i,59)}}return n})}get_nj_motion(e){return xs(this,void 0,void 0,function*(){let t=Ks.get(e.id);return t||(t=function(e){return Ws(this,void 0,void 0,function*(){return yield to(`/player/animation/animation_${e.toString().padStart(3,"0")}.njm`)})}(e.id).then(e=>Os(new Gt(e,Mt.Little),this.current_bone_count)),Ks.set(e.id,t),t)})}}As([T.n.ref],zs.prototype,"current_player_model",void 0),As([T.n.ref],zs.prototype,"current_model",void 0),As([T.n.ref],zs.prototype,"current_bone_count",void 0),As([T.n.ref],zs.prototype,"current_obj3d",void 0),As([T.n.ref],zs.prototype,"animation",void 0),As([T.n],zs.prototype,"animation_playing",void 0),As([T.n],zs.prototype,"animation_frame_rate",void 0),As([T.n],zs.prototype,"animation_frame",void 0),As([T.n],zs.prototype,"animation_frame_count",void 0),As([T.n],zs.prototype,"show_skeleton",void 0);const Hs=new zs;let Vs;class qs extends Xr{constructor(){super(new Ai.PerspectiveCamera(75,1,1,200)),Object(T.e)(()=>{this.set_model(Hs.current_obj3d);const e=Hs.show_skeleton;this.skeleton_helper&&(this.skeleton_helper.visible=e,this.schedule_render()),Hs.animation&&this.schedule_render(),Hs.animation_playing||(Hs.animation_frame,this.schedule_render())})}set_size(e,t){this.camera.aspect=e/t,this.camera.updateProjectionMatrix(),super.set_size(e,t)}render(){Hs.animation&&(Hs.animation.mixer.update(Hs.clock.getDelta()),Hs.update_animation_frame()),this.light_holder.quaternion.copy(this.camera.quaternion),super.render(),Hs.animation&&!Hs.animation.action.paused&&this.schedule_render()}set_model(e){this.model!==e&&(this.model&&(this.scene.remove(this.model),this.scene.remove(this.skeleton_helper),this.skeleton_helper=void 0),e&&(this.scene.add(e),this.skeleton_helper=new Ai.SkeletonHelper(e),this.skeleton_helper.visible=Hs.show_skeleton,this.skeleton_helper.material.linewidth=3,this.scene.add(this.skeleton_helper),this.reset_camera(new Ai.Vector3(0,10,20),new Ai.Vector3(0,0,0))),this.model=e,this.schedule_render())}}var $s=n("G2EC"),Js=n.n($s);let Ys=class extends i.Component{render(){return o.a.createElement("section",{className:Js.a.main},o.a.createElement("ul",null,Hs.animations.map(e=>{const t=Hs.animation&&Hs.animation.player_animation&&Hs.animation.player_animation.id===e.id;return o.a.createElement("li",{key:e.id,className:t?Js.a.selected:void 0,onClick:()=>Hs.load_animation(e)},e.name)})))}};Ys=function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s}([p.a],Ys);var Zs=n("VXEj"),Xs=n("rxQ/"),Qs=n.n(Xs);let ea=class extends i.Component{render(){const e=Hs.current_player_model;return o.a.createElement("section",{className:Qs.a.main},o.a.createElement(Zs.a,{itemLayout:"horizontal",dataSource:Hs.models,size:"small",renderItem:t=>{const n=e===t;return o.a.createElement(Zs.a.Item,{onClick:()=>Hs.load_model(t)},o.a.createElement(Zs.a.Item.Meta,{title:o.a.createElement("span",{className:Qs.a.model+(n?` ${Qs.a.selected}`:"")},t.name)}))}}))}};ea=function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s}([p.a],ea);var ta=n("JGsf"),na=n.n(ta),ia=function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s};let oa=class extends i.Component{componentDidMount(){Hs.current_model||Hs.load_model(Hs.models[5])}render(){return o.a.createElement("div",{className:na.a.main},o.a.createElement(ra,null),o.a.createElement("div",{className:na.a.content},o.a.createElement(ea,null),o.a.createElement(Ys,null),o.a.createElement("div",{className:na.a.renderer},o.a.createElement(we.a,null,({width:e,height:t})=>o.a.createElement(ts,{renderer:(Vs||(Vs=new qs),Vs),width:e,height:t,on_will_unmount:Hs.pause_animation})))))}};oa=ia([p.a],oa);let ra=class extends i.Component{constructor(){super(...arguments),this.state={filename:void 0},this.load_file=e=>{e.file.originFileObj&&(this.setState({filename:e.file.name}),Hs.load_file(e.file.originFileObj))}}render(){return o.a.createElement("div",{className:na.a.toolbar},o.a.createElement(rs.a,{accept:".nj, .njm, .xj, .xvm",showUploadList:!1,onChange:this.load_file,customRequest:()=>!1},o.a.createElement(kt.a,{icon:"file"},this.state.filename||"Open file...")),Hs.animation&&o.a.createElement(o.a.Fragment,null,o.a.createElement(kt.a,{icon:Hs.animation_playing?"pause":"caret-right",onClick:Hs.toggle_animation_playing},Hs.animation_playing?"Pause animation":"Play animation"),o.a.createElement("div",{className:na.a.group},o.a.createElement("span",null,"Frame rate:"),o.a.createElement(E.a,{value:Hs.animation_frame_rate,onChange:e=>Hs.set_animation_frame_rate(e||0),min:1,step:1})),o.a.createElement("div",{className:na.a.group},o.a.createElement("span",null,"Frame:"),o.a.createElement(E.a,{value:Hs.animation_frame,onChange:e=>Hs.set_animation_frame(e||0),step:1}),o.a.createElement("span",null,"/ ",Hs.animation_frame_count))),o.a.createElement("div",{className:na.a.group},o.a.createElement("span",null,"Show skeleton:"),o.a.createElement(Ns.a,{checked:Hs.show_skeleton,onChange:e=>Hs.show_skeleton=e})))}};ra=ia([p.a],ra);var sa=function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},aa=function(e,t,n,i){return new(n||(n=Promise))(function(o,r){function s(e){try{d(i.next(e))}catch(e){r(e)}}function a(e){try{d(i.throw(e))}catch(e){r(e)}}function d(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(s,a)}d((i=i.apply(e,t||[])).next())})};const da=d.a.get("stores/TextureViewerStore");class la{constructor(){this.load_file=e=>aa(this,void 0,void 0,function*(){try{const t=yield ci(e);this.current_xvm=Er(new Gt(t,Mt.Little))}catch(e){da.error("Couldn't read file.",e)}})}}sa([T.n.ref],la.prototype,"current_xvm",void 0);const ua=new la,ca=d.a.get("rendering/TextureRenderer");let _a;class pa extends Xr{constructor(){super(new Ai.OrthographicCamera(-400,400,300,-300,1,10)),this.quad_meshes=[],this.render_textures=e=>{let t=10*(e.textures.length-1),n=0;for(const i of e.textures)t+=i.width,n=Math.max(n,i.height);let i=-Math.floor(t/2);const o=-Math.floor(n/2);for(const t of e.textures){let e;try{e=Sr(t)}catch(e){ca.warn("Couldn't convert XVM texture.",e)}const r=new Ai.Mesh(this.create_quad(i,o+Math.floor((n-t.height)/2),t.width,t.height),e?new Ai.MeshBasicMaterial({map:e,transparent:!0}):new Ai.MeshBasicMaterial({color:16711935}));this.quad_meshes.push(r),this.scene.add(r),i+=10+t.width}},this.controls.azimuthRotateSpeed=0,this.controls.polarRotateSpeed=0,Object(T.e)(()=>{this.scene.remove(...this.quad_meshes);const e=ua.current_xvm;e&&this.render_textures(e),this.reset_camera(new Ai.Vector3(0,0,5),new Ai.Vector3),this.schedule_render()})}set_size(e,t){this.camera.left=-Math.floor(e/2),this.camera.right=Math.ceil(e/2),this.camera.top=Math.floor(t/2),this.camera.bottom=-Math.ceil(t/2),this.camera.updateProjectionMatrix(),super.set_size(e,t)}create_quad(e,t,n,i){const o=new Ai.PlaneGeometry(n,i,1,1);return o.faceVertexUvs=[[[new Ai.Vector2(0,0),new Ai.Vector2(0,1),new Ai.Vector2(1,0)],[new Ai.Vector2(0,1),new Ai.Vector2(1,1),new Ai.Vector2(1,0)]]],o.translate(e+n/2,t+i/2,-5),o}}var va=n("Heoh"),wa=n.n(va);class ha extends i.Component{render(){return o.a.createElement("section",{className:wa.a.main},o.a.createElement(fa,null),o.a.createElement("div",{className:wa.a.renderer},o.a.createElement(we.a,null,({width:e,height:t})=>o.a.createElement(ts,{renderer:(_a||(_a=new pa),_a),width:e,height:t}))))}}let fa=class extends i.Component{constructor(){super(...arguments),this.state={filename:void 0},this.load_file=e=>{e.file.originFileObj&&(this.setState({filename:e.file.name}),ua.load_file(e.file.originFileObj))}}render(){return o.a.createElement("div",{className:wa.a.toolbar},o.a.createElement(rs.a,{accept:".xvm",showUploadList:!1,onChange:this.load_file,customRequest:()=>!1},o.a.createElement(kt.a,{icon:"file"},this.state.filename||"Open file...")))}};fa=function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s}([p.a],fa);var ma=n("758a"),ga=n.n(ma);var ya=function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s};const ka=de(class extends i.Component{render(){return o.a.createElement("section",{className:ga.a.main},o.a.createElement(le.a,{type:"card"},o.a.createElement(le.a.TabPane,{tab:"Models",key:"models"},o.a.createElement(oa,null)),o.a.createElement(le.a.TabPane,{tab:"Textures",key:"textures"},o.a.createElement(ha,null))))}}),Ra=de(bs),ba=de(function(){return o.a.createElement("section",{className:ce.a.main},o.a.createElement(le.a,{type:"card"},o.a.createElement(Dt,{tab:"Optimize",key:"optimize"},o.a.createElement(Ct,null)),o.a.createElement(Dt,{tab:"Methods",key:"methods"},o.a.createElement($e,null))))}),Na=de(ie);let Ea=class extends i.Component{constructor(){super(...arguments),this.menu_clicked=e=>{j.current_tool=e.key},this.keyup=e=>{j.dispatch_global_keyup(e)}}componentDidMount(){window.addEventListener("keyup",this.keyup)}componentWillUnmount(){window.removeEventListener("keyup",this.keyup)}render(){let e;switch(j.current_tool){case"viewer":e=o.a.createElement(ka,null);break;case"quest_editor":e=o.a.createElement(Ra,null);break;case"hunt_optimizer":e=o.a.createElement(ba,null);break;case"dps_calc":e=o.a.createElement(Na,null)}return o.a.createElement("div",{className:N.a.main},o.a.createElement("div",{className:N.a.navbar},o.a.createElement(c.b,{className:N.a.heading_menu,onClick:this.menu_clicked,selectedKeys:[j.current_tool],mode:"horizontal"},o.a.createElement(c.b.Item,{key:"viewer"},"Viewer",o.a.createElement("sup",{className:N.a.beta},"(Beta)")),o.a.createElement(c.b.Item,{key:"quest_editor"},"Quest Editor",o.a.createElement("sup",{className:N.a.beta},"(Beta)")),o.a.createElement(c.b.Item,{key:"hunt_optimizer"},"Hunt Optimizer")),o.a.createElement("div",{className:N.a.server_select},o.a.createElement("span",null,"Server:"),o.a.createElement(_.a,{defaultValue:m.Ephinea,style:{width:120}},o.a.createElement(_.a.Option,{value:m.Ephinea},m.Ephinea)))),o.a.createElement("div",{className:N.a.content},e))}};Ea=ya([p.a],Ea);n("Rkej"),n("FkOY"),n("R6Hk"),n("88+i"),n("UvNR"),n("k/c8");d.a.useDefaults({defaultLevel:d.a.WARN}),document.addEventListener("keydown",e=>{const t=e;t.ctrlKey&&!t.altKey&&"Z"===t.key.toUpperCase()&&t.preventDefault()}),document.addEventListener("beforeinput",e=>{const t=e;"historyUndo"!==t.inputType&&"historyRedo"!==t.inputType||e.preventDefault()});const Ta=document.createElement("div");Ta.id=u.a.phantasmal_world_root,document.body.append(Ta),s.a.render(o.a.createElement(Ea,null),Ta)},NUmZ:function(e,t,n){e.exports=function(){return new Worker(n.p+"8d4bdde37152cbc7f47b.worker.js")}},RnhZ:function(e,t,n){var i={"./af":"K/tc","./af.js":"K/tc","./ar":"jnO4","./ar-dz":"o1bE","./ar-dz.js":"o1bE","./ar-kw":"Qj4J","./ar-kw.js":"Qj4J","./ar-ly":"HP3h","./ar-ly.js":"HP3h","./ar-ma":"CoRJ","./ar-ma.js":"CoRJ","./ar-sa":"gjCT","./ar-sa.js":"gjCT","./ar-tn":"bYM6","./ar-tn.js":"bYM6","./ar.js":"jnO4","./az":"SFxW","./az.js":"SFxW","./be":"H8ED","./be.js":"H8ED","./bg":"hKrs","./bg.js":"hKrs","./bm":"p/rL","./bm.js":"p/rL","./bn":"kEOa","./bn.js":"kEOa","./bo":"0mo+","./bo.js":"0mo+","./br":"aIdf","./br.js":"aIdf","./bs":"JVSJ","./bs.js":"JVSJ","./ca":"1xZ4","./ca.js":"1xZ4","./cs":"PA2r","./cs.js":"PA2r","./cv":"A+xa","./cv.js":"A+xa","./cy":"l5ep","./cy.js":"l5ep","./da":"DxQv","./da.js":"DxQv","./de":"tGlX","./de-at":"s+uk","./de-at.js":"s+uk","./de-ch":"u3GI","./de-ch.js":"u3GI","./de.js":"tGlX","./dv":"WYrj","./dv.js":"WYrj","./el":"jUeY","./el.js":"jUeY","./en-SG":"zavE","./en-SG.js":"zavE","./en-au":"Dmvi","./en-au.js":"Dmvi","./en-ca":"OIYi","./en-ca.js":"OIYi","./en-gb":"Oaa7","./en-gb.js":"Oaa7","./en-ie":"4dOw","./en-ie.js":"4dOw","./en-il":"czMo","./en-il.js":"czMo","./en-nz":"b1Dy","./en-nz.js":"b1Dy","./eo":"Zduo","./eo.js":"Zduo","./es":"iYuL","./es-do":"CjzT","./es-do.js":"CjzT","./es-us":"Vclq","./es-us.js":"Vclq","./es.js":"iYuL","./et":"7BjC","./et.js":"7BjC","./eu":"D/JM","./eu.js":"D/JM","./fa":"jfSC","./fa.js":"jfSC","./fi":"gekB","./fi.js":"gekB","./fo":"ByF4","./fo.js":"ByF4","./fr":"nyYc","./fr-ca":"2fjn","./fr-ca.js":"2fjn","./fr-ch":"Dkky","./fr-ch.js":"Dkky","./fr.js":"nyYc","./fy":"cRix","./fy.js":"cRix","./ga":"USCx","./ga.js":"USCx","./gd":"9rRi","./gd.js":"9rRi","./gl":"iEDd","./gl.js":"iEDd","./gom-latn":"DKr+","./gom-latn.js":"DKr+","./gu":"4MV3","./gu.js":"4MV3","./he":"x6pH","./he.js":"x6pH","./hi":"3E1r","./hi.js":"3E1r","./hr":"S6ln","./hr.js":"S6ln","./hu":"WxRl","./hu.js":"WxRl","./hy-am":"1rYy","./hy-am.js":"1rYy","./id":"UDhR","./id.js":"UDhR","./is":"BVg3","./is.js":"BVg3","./it":"bpih","./it-ch":"bxKX","./it-ch.js":"bxKX","./it.js":"bpih","./ja":"B55N","./ja.js":"B55N","./jv":"tUCv","./jv.js":"tUCv","./ka":"IBtZ","./ka.js":"IBtZ","./kk":"bXm7","./kk.js":"bXm7","./km":"6B0Y","./km.js":"6B0Y","./kn":"PpIw","./kn.js":"PpIw","./ko":"Ivi+","./ko.js":"Ivi+","./ku":"JCF/","./ku.js":"JCF/","./ky":"lgnt","./ky.js":"lgnt","./lb":"RAwQ","./lb.js":"RAwQ","./lo":"sp3z","./lo.js":"sp3z","./lt":"JvlW","./lt.js":"JvlW","./lv":"uXwI","./lv.js":"uXwI","./me":"KTz0","./me.js":"KTz0","./mi":"aIsn","./mi.js":"aIsn","./mk":"aQkU","./mk.js":"aQkU","./ml":"AvvY","./ml.js":"AvvY","./mn":"lYtQ","./mn.js":"lYtQ","./mr":"Ob0Z","./mr.js":"Ob0Z","./ms":"6+QB","./ms-my":"ZAMP","./ms-my.js":"ZAMP","./ms.js":"6+QB","./mt":"G0Uy","./mt.js":"G0Uy","./my":"honF","./my.js":"honF","./nb":"bOMt","./nb.js":"bOMt","./ne":"OjkT","./ne.js":"OjkT","./nl":"+s0g","./nl-be":"2ykv","./nl-be.js":"2ykv","./nl.js":"+s0g","./nn":"uEye","./nn.js":"uEye","./pa-in":"8/+R","./pa-in.js":"8/+R","./pl":"jVdC","./pl.js":"jVdC","./pt":"8mBD","./pt-br":"0tRk","./pt-br.js":"0tRk","./pt.js":"8mBD","./ro":"lyxo","./ro.js":"lyxo","./ru":"lXzo","./ru.js":"lXzo","./sd":"Z4QM","./sd.js":"Z4QM","./se":"//9w","./se.js":"//9w","./si":"7aV9","./si.js":"7aV9","./sk":"e+ae","./sk.js":"e+ae","./sl":"gVVK","./sl.js":"gVVK","./sq":"yPMs","./sq.js":"yPMs","./sr":"zx6S","./sr-cyrl":"E+lV","./sr-cyrl.js":"E+lV","./sr.js":"zx6S","./ss":"Ur1D","./ss.js":"Ur1D","./sv":"X709","./sv.js":"X709","./sw":"dNwA","./sw.js":"dNwA","./ta":"PeUW","./ta.js":"PeUW","./te":"XLvN","./te.js":"XLvN","./tet":"V2x9","./tet.js":"V2x9","./tg":"Oxv6","./tg.js":"Oxv6","./th":"EOgW","./th.js":"EOgW","./tl-ph":"Dzi0","./tl-ph.js":"Dzi0","./tlh":"z3Vd","./tlh.js":"z3Vd","./tr":"DoHr","./tr.js":"DoHr","./tzl":"z1FC","./tzl.js":"z1FC","./tzm":"wQk9","./tzm-latn":"tT3J","./tzm-latn.js":"tT3J","./tzm.js":"wQk9","./ug-cn":"YRex","./ug-cn.js":"YRex","./uk":"raLr","./uk.js":"raLr","./ur":"UpQW","./ur.js":"UpQW","./uz":"Loxo","./uz-latn":"AQ68","./uz-latn.js":"AQ68","./uz.js":"Loxo","./vi":"KSF8","./vi.js":"KSF8","./x-pseudo":"/X5v","./x-pseudo.js":"/X5v","./yo":"fzPg","./yo.js":"fzPg","./zh-cn":"XDpg","./zh-cn.js":"XDpg","./zh-hk":"SatO","./zh-hk.js":"SatO","./zh-tw":"kOpN","./zh-tw.js":"kOpN"};function o(e){var t=r(e);return n(t)}function r(e){if(!n.o(i,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return i[e]}o.keys=function(){return Object.keys(i)},o.resolve=r,e.exports=o,o.id="RnhZ"}},[["2YZa",2,0,3]]]);