From 236461d9522fc18ce7f5690114edfc63bd52c7bc Mon Sep 17 00:00:00 2001 From: Michael <91761269+natural-stupidity@users.noreply.github.com> Date: Fri, 12 Sep 2025 22:39:03 -0400 Subject: [PATCH 1/8] app: removed vscode and dist folders --- app/.vscode/extensions.json | 3 --- app/dist/assets/index-DJYOLyXH.js | 9 --------- app/dist/assets/index-DZ9bIuuF.css | 1 - app/dist/index.html | 13 ------------- app/dist/svgs/check-solid.svg | 1 - app/dist/svgs/circle-info-solid.svg | 1 - app/dist/svgs/circle-notch-solid.svg | 1 - app/dist/svgs/database-solid.svg | 1 - app/dist/svgs/download-solid.svg | 1 - app/dist/svgs/folder-solid.svg | 1 - app/dist/svgs/gear-solid.svg | 1 - app/dist/svgs/lightbulb-solid.svg | 1 - app/dist/svgs/rocket-solid.svg | 1 - app/dist/svgs/svelte.svg | 1 - app/dist/svgs/user-solid.svg | 1 - app/dist/svgs/vite.svg | 1 - app/dist/svgs/wrench-solid.svg | 1 - app/dist/svgs/xmark-solid.svg | 1 - 18 files changed, 40 deletions(-) delete mode 100644 app/.vscode/extensions.json delete mode 100644 app/dist/assets/index-DJYOLyXH.js delete mode 100644 app/dist/assets/index-DZ9bIuuF.css delete mode 100644 app/dist/index.html delete mode 100644 app/dist/svgs/check-solid.svg delete mode 100644 app/dist/svgs/circle-info-solid.svg delete mode 100644 app/dist/svgs/circle-notch-solid.svg delete mode 100644 app/dist/svgs/database-solid.svg delete mode 100644 app/dist/svgs/download-solid.svg delete mode 100644 app/dist/svgs/folder-solid.svg delete mode 100644 app/dist/svgs/gear-solid.svg delete mode 100644 app/dist/svgs/lightbulb-solid.svg delete mode 100644 app/dist/svgs/rocket-solid.svg delete mode 100644 app/dist/svgs/svelte.svg delete mode 100644 app/dist/svgs/user-solid.svg delete mode 100644 app/dist/svgs/vite.svg delete mode 100644 app/dist/svgs/wrench-solid.svg delete mode 100644 app/dist/svgs/xmark-solid.svg diff --git a/app/.vscode/extensions.json b/app/.vscode/extensions.json deleted file mode 100644 index eeca46f7..00000000 --- a/app/.vscode/extensions.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "recommendations": ["EditorConfig.EditorConfig"] -} diff --git a/app/dist/assets/index-DJYOLyXH.js b/app/dist/assets/index-DJYOLyXH.js deleted file mode 100644 index 4c0d332b..00000000 --- a/app/dist/assets/index-DJYOLyXH.js +++ /dev/null @@ -1,9 +0,0 @@ -var Pn=Object.defineProperty;var Rn=(t,e,n)=>e in t?Pn(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var Qe=(t,e,n)=>(Rn(t,typeof e!="symbol"?e+"":e,n),n);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))l(o);new MutationObserver(o=>{for(const r of o)if(r.type==="childList")for(const i of r.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&l(i)}).observe(document,{childList:!0,subtree:!0});function n(o){const r={};return o.integrity&&(r.integrity=o.integrity),o.referrerPolicy&&(r.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?r.credentials="include":o.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function l(o){if(o.ep)return;o.ep=!0;const r=n(o);fetch(o.href,r)}})();var Rt=(t=>(t[t.SECOND=1e3]="SECOND",t[t.MINUTE=6e4]="MINUTE",t[t.HALF_HOUR=18e5]="HALF_HOUR",t[t.HOUR=36e5]="HOUR",t[t.DAY=864e5]="DAY",t[t.WEEK=6048e5]="WEEK",t[t.MONTH=2592e6]="MONTH",t))(Rt||{});class Je{static set(e,n,l,o){const r=new Date;r.setTime(r.getTime()+l*o);const i=`expires=${r.toUTCString()}`;document.cookie=`${e}=${n};${i};path=/`}static get(e){const n=`${e}=`,l=document.cookie.split(";");for(let o=0;o(t.rs3="rs3",t.osrs="osrs",t))(ce||{}),Ve=(t=>(t.official="Official",t.runelite="RuneLite",t.hdos="HDOS",t))(Ve||{});const jt={rs3:["Official"],osrs:["Official","RuneLite","HDOS"]};class at{static parseTokenResponse(e){try{const n=JSON.parse(e),l=n.id_token.split(".");if(l.length!==3){const i=`Malformed id_token: ${l.length} sections, expected 3`;return oe(i)}const o=JSON.parse(atob(l[0]));if(o.typ!=="JWT"){const i=`Bad id_token header: typ ${o.typ}, expected JWT`;return oe(i)}const r=JSON.parse(atob(l[1]));return Le({access_token:n.access_token,id_token:n.id_token,refresh_token:n.refresh_token,sub:r.sub,expiry:Date.now()+n.expires_in*1e3})}catch{return oe("Unable to parse token response")}}static parseSessionResponse(e){try{const n=JSON.parse(e);return n.sessionId?Le(n.sessionId):oe("sessionId does not exist on parsed object")}catch{return oe("Unable to parse session response")}}static decodeBolt(e){const n={};for(const l in e){const o=l,r=e[o];typeof r=="string"?n[o]=atob(r):Array.isArray(r)&&r.every(i=>typeof i=="string")?n[o]=r.map(i=>atob(i)):n[o]=r}return n}}var It=(t=>(t.Windows="windows",t.Linux="linux",t.MacOS="mac",t))(It||{});const R={env:at.decodeBolt(s()),platform:null,rs3debInstalledHash:null,rs3exeInstalledHash:null,rs3appInstalledHash:null,osrsexeInstalledHash:null,osrsappInstalledHash:null,runeLiteInstalledId:null,hdosInstalledVersion:null,isFlathub:!1,hasLibArchive:!1,hasBoltPlugins:!1,pluginConfig:{}};class yt{static async makeLoginUrl(e){const n=new TextEncoder().encode(e.pkceCodeVerifier),l=await crypto.subtle.digest("SHA-256",n);let o="";const r=new Uint8Array(l);for(let a=0;aMath.round(r*(l-0)/255+0)).map(r=>n[r]).join("")}}const Ge=class Ge{static async openLoginWindow(e,n,l){if(Ge.pendingLoginWindow!==null)return Ge.pendingLoginWindow.window.focus();const o=yt.makeRandomState(),r=yt.makeRandomVerifier(),i=new TextEncoder().encode(r),a=await crypto.subtle.digest("SHA-256",i);let c="";const u=new Uint8Array(a);for(let g=0;g{if(e.expiry-Date.now()<3e4){const l=new URLSearchParams({grant_type:"refresh_token",client_id:R.env.clientid,refresh_token:e.refresh_token}),o=new XMLHttpRequest;o.onreadystatechange=()=>{if(o.readyState==4)if(o.status==200){const i=at.parseTokenResponse(o.response);i.ok?n(Le(i.value)):n(oe(0))}else n(oe(o.status))},o.onerror=()=>{n(oe(0))};const r=R.env.origin.concat("/oauth2/token");o.open("POST",r,!0),o.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),o.setRequestHeader("Accept","application/json"),o.send(l)}else n(Le(e))})}static async getOAuthToken(e,n,l,o,r){const i=`${e}/oauth2/token`;return new Promise(a=>{const c=new XMLHttpRequest;c.onreadystatechange=()=>{if(c.readyState==4)if(c.status==200){const d=at.parseTokenResponse(c.response);return d.ok?a(Le(d.value)):a(oe(d.error))}else return a(oe(`Error: from ${i}: ${c.status}: ${c.response}`))},c.open("POST",i,!0),c.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),c.setRequestHeader("Accept","application/json");const u=new URLSearchParams({grant_type:"authorization_code",client_id:n,code:r,code_verifier:l,redirect_uri:o});c.send(u)})}static revokeOauthCreds(e){const n=`${R.env.origin}/oauth2/revoke`;return new Promise(l=>{const o=new XMLHttpRequest;o.open("POST",n,!0),o.onreadystatechange=()=>{o.readyState==4&&l(o.status)},o.setRequestHeader("Content-Type","application/x-www-form-urlencoded");const r=new URLSearchParams({token:e,client_id:R.env.clientid});o.send(r)})}static async getSessionId(e,n){const l=`${e}/sessions`;return new Promise(o=>{const r=new XMLHttpRequest;r.onreadystatechange=()=>{if(r.readyState==4)if(r.status==200){const a=at.parseSessionResponse(r.response);return a.ok?o(Le(a.value)):o(oe(a.error))}else oe(`Error: from ${l}: ${r.status}: ${r.response}`)},r.open("POST",l,!0),r.setRequestHeader("Content-Type","application/json"),r.setRequestHeader("Accept","application/json");const i={idToken:n};r.send(JSON.stringify(i))})}static validateIdToken(e,n){const l=e.split(".");if(l.length!==3)return oe(`Malformed id_token: ${l.length} sections, expected 3`);const o=JSON.parse(atob(l[0]));return o.typ!=="JWT"?oe(`Bad id_token header: typ ${o.typ}, expected JWT`):JSON.parse(atob(l[1])).nonce!==n?oe("Incorrect nonce in id_token"):Le(void 0)}};Qe(Ge,"pendingLoginWindow",null);let Se=Ge;class ut{static async buildSession(e,n){const l=await ut.getUser(e.sub,e.access_token);if(!l.ok)return oe(`Failed to fetch user. Status: ${l.error}`);const o=await ut.getUserAccounts(n);return o.ok?Le({user:l.value,accounts:o.value,tokens:e,session_id:n}):oe(`Failed to fetch game accounts. Status: ${o.error}`)}static getUser(e,n){return new Promise(l=>{const o=`${R.env.api}/users/${e}/displayName`,r=new XMLHttpRequest;r.onreadystatechange=()=>{if(r.readyState==4)if(r.status==200){const i=JSON.parse(r.response);l(Le(i))}else l(oe(r.status))},r.open("GET",o,!0),r.setRequestHeader("Authorization","Bearer ".concat(n)),r.send()})}static getUserAccounts(e){const n=`${R.env.auth_api}/accounts`;return new Promise(l=>{const o=new XMLHttpRequest;o.onreadystatechange=async()=>{if(o.readyState==4)if(o.status==200){const r=JSON.parse(o.response);l(Le(r))}else l(oe(o.status))},o.open("GET",n,!0),o.setRequestHeader("Accept","application/json"),o.setRequestHeader("Authorization","Bearer ".concat(e)),o.send()})}}function B(){}function In(t,e){for(const n in e)t[n]=e[n];return t}function Un(t){return!!t&&(typeof t=="object"||typeof t=="function")&&typeof t.then=="function"}function mn(t){return t()}function Et(){return Object.create(null)}function re(t){t.forEach(mn)}function ft(t){return typeof t=="function"}function _e(t,e){return t!=t?e==e:t!==e||t&&typeof t=="object"||typeof t=="function"}let it;function Ut(t,e){return t===e?!0:(it||(it=document.createElement("a")),it.href=e,t===it.href)}function Hn(t){return Object.keys(t).length===0}function bn(t,...e){if(t==null){for(const l of e)l(void 0);return B}const n=t.subscribe(...e);return n.unsubscribe?()=>n.unsubscribe():n}function ve(t){let e;return bn(t,n=>e=n)(),e}function ke(t,e,n){t.$$.on_destroy.push(bn(e,n))}function pt(t,e,n,l){if(t){const o=kn(t,e,n,l);return t[0](o)}}function kn(t,e,n,l){return t[1]&&l?In(n.ctx.slice(),t[1](l(e))):n.ctx}function _t(t,e,n,l){if(t[2]&&l){const o=t[2](l(n));if(e.dirty===void 0)return o;if(typeof o=="object"){const r=[],i=Math.max(e.dirty.length,o.length);for(let a=0;a32){const e=[],n=t.ctx.length/32;for(let l=0;lt.removeEventListener(e,n,l)}function Tn(t){return function(e){e.target===this&&t.call(this,e)}}function _(t,e,n){n==null?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function xn(t){return Array.from(t.childNodes)}function pe(t,e){e=""+e,t.data!==e&&(t.data=e)}function K(t,e){t.value=e??""}function xe(t,e,n){for(let l=0;l{const o=t.$$.callbacks[e];if(o){const r=Nn(e,n,{cancelable:l});return o.slice().forEach(i=>{i.call(t,r)}),!r.defaultPrevented}return!0}}const We=[],Pe=[];let Xe=[];const Mt=[],Mn=Promise.resolve();let Ht=!1;function An(){Ht||(Ht=!0,Mn.then(xt))}function Ye(t){Xe.push(t)}const $t=new Set;let De=0;function xt(){if(De!==0)return;const t=tt;do{try{for(;Det.indexOf(l)===-1?e.push(l):n.push(l)),n.forEach(l=>l()),Xe=e}const ct=new Set;let Ee;function nt(){Ee={r:0,c:[],p:Ee}}function st(){Ee.r||re(Ee.c),Ee=Ee.p}function q(t,e){t&&t.i&&(ct.delete(t),t.i(e))}function W(t,e,n,l){if(t&&t.o){if(ct.has(t))return;ct.add(t),Ee.c.push(()=>{ct.delete(t),l&&(n&&t.d(1),l())}),t.o(e)}else l&&l()}function dt(t,e){const n=e.token={};function l(o,r,i,a){if(e.token!==n)return;e.resolved=a;let c=e.ctx;i!==void 0&&(c=c.slice(),c[i]=a);const u=o&&(e.current=o)(c);let d=!1;e.block&&(e.blocks?e.blocks.forEach((f,b)=>{b!==r&&f&&(nt(),W(f,1,1,()=>{e.blocks[b]===f&&(e.blocks[b]=null)}),st())}):e.block.d(1),u.c(),q(u,1),u.m(e.mount(),e.anchor),d=!0),e.block=u,e.blocks&&(e.blocks[r]=u),d&&xt()}if(Un(t)){const o=mt();if(t.then(r=>{He(o),l(e.then,1,e.value,r),He(null)},r=>{if(He(o),l(e.catch,2,e.error,r),He(null),!e.hasCatch)throw r}),e.current!==e.pending)return l(e.pending,0),!0}else{if(e.current!==e.then)return l(e.then,1,e.value,t),!0;e.resolved=t}}function vn(t,e,n){const l=e.slice(),{resolved:o}=t;t.current===t.then&&(l[t.value]=o),t.current===t.catch&&(l[t.error]=o),t.block.p(l,n)}function ge(t){return(t==null?void 0:t.length)!==void 0?t:Array.from(t)}function Fn(t,e){t.d(1),e.delete(t.key)}function qn(t,e,n,l,o,r,i,a,c,u,d,f){let b=t.length,g=r.length,p=b;const y={};for(;p--;)y[t[p].key]=p;const h=[],L=new Map,$=new Map,x=[];for(p=g;p--;){const S=f(o,r,p),C=n(S);let T=i.get(C);T?l&&x.push(()=>T.p(S,e)):(T=u(C,S),T.c()),L.set(C,h[p]=T),C in y&&$.set(C,Math.abs(p-y[C]))}const I=new Set,O=new Set;function U(S){q(S,1),S.m(a,d),i.set(S.key,S),d=S.first,g--}for(;b&&g;){const S=h[g-1],C=t[b-1],T=S.key,j=C.key;S===C?(d=S.first,b--,g--):L.has(j)?!i.has(T)||I.has(T)?U(S):O.has(j)?b--:$.get(T)>$.get(j)?(O.add(T),U(S)):(I.add(j),b--):(c(C,i),b--)}for(;b--;){const S=t[b];L.has(S.key)||c(S,i)}for(;g;)U(h[g-1]);return re(x),h}function de(t){t&&t.c()}function ie(t,e,n){const{fragment:l,after_update:o}=t.$$;l&&l.m(e,n),Ye(()=>{const r=t.$$.on_mount.map(mn).filter(ft);t.$$.on_destroy?t.$$.on_destroy.push(...r):re(r),t.$$.on_mount=[]}),o.forEach(Ye)}function ae(t,e){const n=t.$$;n.fragment!==null&&(Bn(n.after_update),re(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function zn(t,e){t.$$.dirty[0]===-1&&(We.push(t),An(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<{const p=g.length?g[0]:b;return u.ctx&&o(u.ctx[f],u.ctx[f]=p)&&(!u.skip_bound&&u.bound[f]&&u.bound[f](p),d&&zn(t,f)),b}):[],u.update(),d=!0,re(u.before_update),u.fragment=l?l(u.ctx):!1,e.target){if(e.hydrate){const f=xn(e.target);u.fragment&&u.fragment.l(f),f.forEach(w)}else u.fragment&&u.fragment.c();e.intro&&q(t.$$.fragment),ie(t,e.target,e.anchor),xt()}He(c)}class me{constructor(){Qe(this,"$$");Qe(this,"$$set")}$destroy(){ae(this,1),this.$destroy=B}$on(e,n){if(!ft(n))return B;const l=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return l.push(n),()=>{const o=l.indexOf(n);o!==-1&&l.splice(o,1)}}$set(e){this.$$set&&!Hn(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const Wn="4",Be=[];function Me(t,e=B){let n;const l=new Set;function o(a){if(_e(t,a)&&(t=a,n)){const c=!Be.length;for(const u of l)u[1](),Be.push(u,t);if(c){for(let u=0;u{l.delete(u),l.size===0&&n&&(n(),n=null)}}return{set:o,update:r,subscribe:i}}var et=(t=>(t.info="info",t.warn="warn",t.error="error",t))(et||{});class Jn{constructor(){Qe(this,"logs",Me([]))}_addLog(e,n){this.logs.update(l=>(l.unshift({date:new Date,severity:e,content:n}),l))}info(e){this._addLog("info",e)}warn(e){this._addLog("warn",e)}error(e){this._addLog("error",e)}updateLogAtIndex(e,n){this.logs.update(l=>(l[e]&&(l[e].content=n),l))}}const A=new Jn;function Gn(t,e){let n=!1;return t.subscribe(l=>{n?e(l):n=!0})}const Vn={use_dark_theme:!0,rs_plugin_loader:!1,close_after_launch:!1,check_announcements:!0,flatpak_rich_presence:!1,runelite_use_custom_jar:!1,use_custom_rs_config_uri:!1,discard_expired_sessions:!0,rs_launch_command:null,osrs_launch_command:null,runelite_custom_jar:null,runelite_launch_command:null,hdos_launch_command:null,selected:{game:ce.osrs,client:Ve.runelite,user_id:null},userDetails:{}};function Xn(){const e=new URLSearchParams(window.location.search).get("config");function n(o){return typeof o=="object"&&typeof o.use_dark_theme=="boolean"&&typeof o.rs_plugin_loader=="boolean"&&typeof o.close_after_launch=="boolean"&&typeof o.check_announcements=="boolean"&&typeof o.flatpak_rich_presence=="boolean"&&typeof o.runelite_use_custom_jar=="boolean"&&typeof o.selected=="object"&&Object.values(ce).includes(o.selected.game)&&Object.values(Ve).includes(o.selected.client)&&(typeof o.selected.user_id=="string"||o.selected.user_id===null)&&typeof o.userDetails=="object"}const{config:l}=M;if(e)try{const o=JSON.parse(e);typeof o.check_announcements>"u"&&(o.check_announcements=!0,M.configHasPendingChanges=!0),typeof o.close_after_launch>"u"&&(o.close_after_launch=!1,M.configHasPendingChanges=!0),typeof o.discard_expired_sessions>"u"&&(o.discard_expired_sessions=!0,M.configHasPendingChanges=!0),n(o)?l.set(o):(A.error("The config saved on disk is not the correct format. It has been restored to default."),M.configHasPendingChanges=!0)}catch{A.error("Unable to parse config, restoring to default"),M.configHasPendingChanges=!0}else M.configHasPendingChanges=!0;Gn(M.config,()=>{M.configHasPendingChanges=!0})}const M={initialized:Me(!1),configHasPendingChanges:!1,pluginConfigHasPendingChanges:!1,config:Me(Vn),sessions:Me([])};let St=!1,Ct=!1;class ne{static async login(e,n){const l=await ut.buildSession(e,n);if(!l.ok)return oe(l.error);const o=l.value,i=ve(M.sessions).findIndex(a=>a.user.userId===e.sub);return i!==-1?M.sessions.update(a=>(a[i]=o,a)):(M.sessions.update(a=>(a.push(o),a)),M.config.update(a=>(a.selected.user_id=o.user.userId,a))),Le(o)}static async logout(e){const{sessions:n,config:l}=M;return n.update(o=>{const r=o.findIndex(i=>i.user.userId===e);return r>-1&&(Se.revokeOauthCreds(o[r].tokens.access_token),o.splice(r,1)),o}),l.update(o=>(typeof o.userDetails[e]<"u"&&delete o.userDetails[e],o.selected.user_id===e&&(o.selected.user_id=null),o)),ve(n)}static postJSON(e,n,l=null){const o=JSON.stringify(n);return fetch(e,{method:"POST",body:o,headers:{"Content-Type":"application/json"}}).then(i=>{i.ok||i.text().then(a=>A.error(`${e} error: ${i.status}: ${a}`)),l&&l(i)})}static saveConfig(e=!0){if(St||e&&!M.configHasPendingChanges)return;St=!0;const n=ve(M.config);return n.rs_launch_command===""&&(n.rs_launch_command=null),n.osrs_launch_command===""&&(n.osrs_launch_command=null),n.runelite_launch_command===""&&(n.runelite_launch_command=null),n.hdos_launch_command===""&&(n.hdos_launch_command=null),this.postJSON("/save-config",n,()=>St=!1),n}static savePluginConfig(e=!0){Ct||e&&!M.pluginConfigHasPendingChanges||(Ct=!0,this.postJSON("/save-plugin-config",R.pluginConfig,()=>Ct=!1))}static async saveCredentials(){return this.postJSON("/save-credentials",ve(M.sessions))}static async openFilePicker(){const e=await fetch("/jar-file-picker");return e.status===200?e.text():null}static findSession(e){return ve(M.sessions).find(l=>l.user.userId===e)}static findAccount(e,n){return e.find(l=>l.accountId==n)}}const Ot=Me([]);typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(Wn);function Yn(t){let e,n;const l=t[4].default,o=pt(l,t,t[3],null);return{c(){e=m("main"),o&&o.c(),_(e,"class","fixed top-0 h-screen w-screen bg-slate-100 text-xs text-slate-900 duration-200 sm:text-sm md:text-base dark:bg-slate-900 dark:text-slate-50"),ue(e,"dark",t[0])},m(r,i){v(r,e,i),o&&o.m(e,null),n=!0},p(r,[i]){o&&o.p&&(!n||i&8)&>(o,l,r,r[3],n?_t(l,r[3],i,null):ht(r[3]),null),(!n||i&1)&&ue(e,"dark",r[0])},i(r){n||(q(o,r),n=!0)},o(r){W(o,r),n=!1},d(r){r&&w(e),o&&o.d(r)}}}function Zn(t,e,n){let l,o,{$$slots:r={},$$scope:i}=e;const{config:a}=M;return ke(t,a,c=>n(2,o=c)),t.$$set=c=>{"$$scope"in c&&n(3,i=c.$$scope)},t.$$.update=()=>{t.$$.dirty&4&&n(0,l=o.use_dark_theme)},[l,a,o,i,r]}class yn extends me{constructor(e){super(),he(this,e,Zn,Yn,_e,{})}}function Kn(t){let e;return{c(){e=m("div"),e.innerHTML='loading',_(e,"class","flex h-full items-center justify-center")},m(n,l){v(n,e,l)},p:B,d(n){n&&w(e)}}}function Qn(t){let e,n;return e=new yn({props:{$$slots:{default:[Kn]},$$scope:{ctx:t}}}),{c(){de(e.$$.fragment)},m(l,o){ie(e,l,o),n=!0},p(l,[o]){const r={};o&32&&(r.$$scope={dirty:o,ctx:l}),e.$set(r)},i(l){n||(q(e.$$.fragment,l),n=!0)},o(l){W(e.$$.fragment,l),n=!1},d(l){ae(e,l)}}}function es(t){const e=window.opener;R.env==null&&o("BoltEnv is not defined. Please close and re-open Bolt to try again.");async function n(i){const a=Je.get("auth_verifier");if(!a)return o("Verifier token has expired. Please try signing in again."),null;const{clientid:c,redirect:u}=R.env,d=await Se.getOAuthToken(R.env.origin,c,a,u,i);return d.ok?d.value:(o(`Fetching OAuth token failed. ${d.error}`),null)}async function l(i){const a=Je.get("auth_nonce"),c=Se.validateIdToken(i,a??"");if(!c.ok)return o(c.error),null;const u=await Se.getSessionId(R.env.auth_api,i);return u.ok?u.value:(o(`Unable to retreive session id. ${u.error}`),null)}function o(i){r({type:"authFailed",reason:i}),fetch("/close")}function r(i){e.postMessage(i,window.location.origin)}return wn(async()=>{const i=new URLSearchParams(window.location.search),a=i.get("code"),c=i.get("state"),u=i.get("id_token");if(u==null&&a&&c){const d=await n(a);if(!d)return o("tokens object is null.");r({type:"authTokenUpdate",tokens:d});const f=crypto.randomUUID();Se.navigateToAuthConsent(R.env.origin,d.id_token,f)}else if(u&&a&&c){const d=await l(u);if(!d)return o("sessionId is null");r({type:"authSessionUpdate",sessionId:d}),fetch("/close")}else o("Authentication server did not response with the appropriate parameters. Please try again later.")}),jn(()=>{Je.remove("auth_verifier"),Je.remove("auth_nonce")}),[]}class ts extends me{constructor(e){super(),he(this,e,es,Qn,_e,{})}}function At(t){let e,n,l;return{c(){e=m("button"),e.innerHTML='Close',_(e,"class","absolute right-3 top-3 rounded-full bg-rose-500 p-[2px] shadow-lg duration-200 hover:rotate-90 hover:opacity-75")},m(o,r){v(o,e,r),n||(l=N(e,"click",t[2]),n=!0)},p:B,d(o){o&&w(e),n=!1,l()}}}function Dt(t){let e;const n=t[7].default,l=pt(n,t,t[6],null);return{c(){l&&l.c()},m(o,r){l&&l.m(o,r),e=!0},p(o,r){l&&l.p&&(!e||r&64)&>(l,n,o,o[6],e?_t(n,o[6],r,null):ht(o[6]),null)},i(o){e||(q(l,o),e=!0)},o(o){W(l,o),e=!1},d(o){l&&l.d(o)}}}function ns(t){let e,n,l,o,r,i,a=t[1]&&At(t),c=t[4]&&Dt(t);return{c(){e=m("dialog"),a&&a.c(),n=P(),c&&c.c(),_(e,"class",l=t[0]+" backdrop max-h-[90%] max-w-[90%] overflow-auto rounded-xl text-inherit focus-visible:outline-none svelte-csux1e"),ue(e,"backdrop:cursor-pointer",t[1])},m(u,d){v(u,e,d),a&&a.m(e,null),k(e,n),c&&c.m(e,null),t[8](e),o=!0,r||(i=[N(e,"keydown",t[9]),N(e,"mousedown",Tn(t[10]))],r=!0)},p(u,[d]){u[1]?a?a.p(u,d):(a=At(u),a.c(),a.m(e,n)):a&&(a.d(1),a=null),u[4]?c?(c.p(u,d),d&16&&q(c,1)):(c=Dt(u),c.c(),q(c,1),c.m(e,null)):c&&(nt(),W(c,1,1,()=>{c=null}),st()),(!o||d&1&&l!==(l=u[0]+" backdrop max-h-[90%] max-w-[90%] overflow-auto rounded-xl text-inherit focus-visible:outline-none svelte-csux1e"))&&_(e,"class",l),(!o||d&3)&&ue(e,"backdrop:cursor-pointer",u[1])},i(u){o||(q(c),o=!0)},o(u){W(c),o=!1},d(u){u&&w(e),a&&a.d(),c&&c.d(),t[8](null),r=!1,re(i)}}}function ss(t,e,n){let{$$slots:l={},$$scope:o}=e,{class:r=""}=e,{canSelfClose:i=!0}=e,a,c=!1;const u=En();function d(){a.showModal(),n(4,c=!0)}function f(){u("close"),a.close(),n(4,c=!1)}function b(y){Pe[y?"unshift":"push"](()=>{a=y,n(3,a)})}const g=y=>{y.key==="Escape"&&(y.preventDefault(),i&&f())},p=()=>{i&&f()};return t.$$set=y=>{"class"in y&&n(0,r=y.class),"canSelfClose"in y&&n(1,i=y.canSelfClose),"$$scope"in y&&n(6,o=y.$$scope)},[r,i,f,a,c,d,o,l,b,g,p]}class bt extends me{constructor(e){super(),he(this,e,ss,ns,_e,{class:0,canSelfClose:1,open:5,close:2})}get open(){return this.$$.ctx[5]}get close(){return this.$$.ctx[2]}}function ls(t){let e,n,l,o,r,i,a;return{c(){e=m("p"),e.textContent=`${atob("Qm9sdCBpcyBhbiB1bm9mZmljaWFsIHRoaXJkLXBhcnR5IGxhdW5jaGVyLiBJdCdzIGZyZWUgYW5kIG9wZW4tc291cmNlIHNvZnR3YXJlIGxpY2Vuc2VkIHVuZGVyIEFHUEwgMy4wLg==")}`,n=P(),l=m("p"),l.textContent=`${atob("SmFnZXggaXMgbm90IHJlc3BvbnNpYmxlIGZvciBhbnkgcHJvYmxlbXMgb3IgZGFtYWdlIGNhdXNlZCBieSB1c2luZyB0aGlzIHByb2R1Y3Qu")}`,o=P(),r=m("button"),r.textContent="I Understand",_(e,"class","p-2"),_(l,"class","p-2"),_(r,"class","m-5 rounded-lg border-2 border-blue-500 p-2 duration-200 hover:opacity-75")},m(c,u){v(c,e,u),v(c,n,u),v(c,l,u),v(c,o,u),v(c,r,u),i||(a=N(r,"click",t[2]),i=!0)},p:B,d(c){c&&(w(e),w(n),w(l),w(o),w(r)),i=!1,a()}}}function os(t){let e,n,l={canSelfClose:!1,class:"w-1/2 text-center",$$slots:{default:[ls]},$$scope:{ctx:t}};return e=new bt({props:l}),t[3](e),{c(){de(e.$$.fragment)},m(o,r){ie(e,o,r),n=!0},p(o,[r]){const i={};r&33&&(i.$$scope={dirty:r,ctx:o}),e.$set(i)},i(o){n||(q(e.$$.fragment,o),n=!0)},o(o){W(e.$$.fragment,o),n=!1},d(o){t[3](null),ae(e,o)}}}function rs(t,e,n){let l;const{sessions:o}=M;ke(t,o,c=>n(4,l=c));let r;wn(()=>{l.length==0&&r.open()});const i=()=>r.close();function a(c){Pe[c?"unshift":"push"](()=>{r=c,n(0,r)})}return[r,o,i,a]}class is extends me{constructor(e){super(),he(this,e,rs,os,_e,{})}}const ye={method:"GET"},as={"Content-Type":"application/octet-stream"};let Lt=null;const cs=2*60*1e3,us="https://api.github.com/repos/runelite/launcher/releases",ds="https://cdn.hdos.dev/client/getdown.txt",kt=t=>t?{method:"POST",headers:as,body:t}:ye,Oe=(t,e,n,l)=>{fetch(t,e).then(o=>{o.ok?n(o):(o.text().then(r=>A.error(`request failed: ${o.url}: ${o.status}: ${r}`)),l())}).catch(()=>{A.error(`request failed: ${t}: connection error`),l()})},Nt=async(t,e,n,l,o)=>{const r=b=>{A.error(`error downloading: ${b}`),l()};A.info(e);const i=b=>A.updateLogAtIndex(0,`${e} ${b}`);if(!t.body)return r("no HTTP response body");const a=t.body.getReader();if(!a)return r("invalid HTTP response");const c=t.headers.get("content-length")??o;if(!c)return r("cannot estimate download size");const u=parseInt(c);if(!c)return r("cannot estimate download size");const d=new Uint8Array(u);let f=0;for(;;){const b=await a.read();if(b.done)break;const g=b.value;d.set(g,f),f+=g.length;const p=(Math.round(1e3*f/u)/10).toFixed(1);i(p)}i("done"),n(d)};function fs(t,e,n){ne.saveConfig();const l=(a,c)=>{const u={},d=ve(M.config);a&&(u.hash=a),t&&(u.jx_session_id=t),e&&(u.jx_character_id=e),n&&(u.jx_display_name=n),d.rs_launch_command&&d.rs_launch_command.length>0&&(u.launch_command=d.rs_launch_command),d.rs_plugin_loader&&(u.plugin_loader="1"),d.use_custom_rs_config_uri&&d.rs_config_uri?u.config_uri=d.rs_config_uri:u.config_uri=R.env.default_config_uri,fetch("/launch-rs3-deb?".concat(new URLSearchParams(u).toString()),kt(c)).then(f=>{f.text().then(b=>A.info(`game launch status: '${b.trim()}'`)),f.ok&&(a&&(R.rs3debInstalledHash=a),d.close_after_launch&&!d.rs_plugin_loader&&fetch("/close"))})},o=()=>{R.rs3debInstalledHash&&l()},r=R.env.content_url,i=r.concat("dists/trusty/non-free/binary-amd64/Packages");Oe(i,ye,a=>a.text().then(c=>{const u=Object.fromEntries(c.split(` -`).map(d=>d.split(": ")));if(!u.Filename||!u.Size||!u.SHA256){A.error(`could not parse package data from URL: ${i}`),o();return}if(u.SHA256===R.rs3debInstalledHash){A.info("game client is up-to-date"),l();return}Oe(r.concat(u.Filename),ye,d=>Nt(d,"downloading RS3 client...",f=>l(u.SHA256,f),l,u.Size),o)}),o)}function $n(t,e,n,l){ne.saveConfig();const o=l?"/launch-runelite-jar-configure?":"/launch-runelite-jar?",r=ve(M.config),i=(c,u,d)=>{const f={};c&&(f.id=c),d&&(f.jar_path=d),t&&(f.jx_session_id=t),e&&(f.jx_character_id=e),n&&(f.jx_display_name=n),r.runelite_launch_command&&r.runelite_launch_command!==""&&(f.launch_command=r.runelite_launch_command),r.flatpak_rich_presence&&(f.flatpak_rich_presence=""),fetch(o.concat(new URLSearchParams(f).toString()),kt(u)).then(b=>{b.text().then(g=>A.info(`game launch status: '${g.trim()}'`)),b.ok&&(c&&(R.runeLiteInstalledId=c),r.close_after_launch&&!l&&fetch("/close"))})},a=()=>{R.runeLiteInstalledId&&i()};if(r.runelite_use_custom_jar){i(null,null,r.runelite_custom_jar);return}if(R.runeLiteInstalledId!==null&&Lt!==null&&Lt+cs>Date.now()){i();return}Oe(us,ye,c=>c.json().then(u=>{Lt=Date.now();const d=u.map(f=>f.assets).flat().find(f=>f.name.toLowerCase()=="runelite.jar");if(!d){A.info("note: no runelite releases found, so skipping update check"),a();return}if(d.id==R.runeLiteInstalledId){A.info("game is up-to-date"),i();return}Oe(d.browser_download_url,ye,f=>Nt(f,"downloading RuneLite launcher...",b=>i(d.id,b),a,d.size),a)}),a)}function ps(t,e,n){ne.saveConfig();const l=ve(M.config),o=(i,a)=>{const c={};i&&(c.version=i),t&&(c.jx_session_id=t),e&&(c.jx_character_id=e),n&&(c.jx_display_name=n),l.hdos_launch_command&&l.hdos_launch_command.length>0&&(c.launch_command=l.hdos_launch_command),fetch("/launch-hdos-jar?".concat(new URLSearchParams(c).toString()),kt(a)).then(u=>{u.text().then(d=>A.info(`game launch status: '${d.trim()}'`)),u.ok&&(i&&(R.hdosInstalledVersion=i),l.close_after_launch&&fetch("/close"))})},r=()=>{R.hdosInstalledVersion&&o()};Oe(ds,ye,i=>i.text().then(a=>{const c=a.match(/^launcher\.version *= *(.*?)$/m);if(!c||c.length<2){A.error("couldn't parse latest launcher version"),r();return}const u=c[1];if(u===R.hdosInstalledVersion){A.info("game is up-to-date"),o();return}Oe(`https://cdn.hdos.dev/launcher/v${u}/hdos-launcher.jar`,ye,d=>Nt(d,"downloading HDOS launcher...",f=>o(u,f),r),r)}),r)}function Pt(){fetch("/list-game-clients",ye).then(t=>{t.ok||t.text().then(e=>A.error(`failed to get client list: ${t.status}: ${e}`))})}function Bt(t,e,n,l,o){ne.saveConfig();const r=`${e?"osrs":R.env.provider}-${t?"win":"mac"}`,i=e?"osrs":"rs3",a=t?"exe":"app",c=`${i}${a}InstalledHash`,u=(f,b)=>{const g={},p=ve(M.config),y=e?p.osrs_launch_command:p.rs_launch_command;f&&(g.hash=f),n&&(g.jx_session_id=n),l&&(g.jx_character_id=l),o&&(g.jx_display_name=o),y&&y!==""&&(g.launch_command=y),e||(p.rs_plugin_loader&&(g.plugin_loader="1"),g.config_uri=p.use_custom_rs_config_uri&&p.rs_config_uri?p.rs_config_uri:R.env.default_config_uri);const h=L=>fetch(`/launch-${i}-${a}?${new URLSearchParams(g).toString()}`,L).then($=>{$.text().then(x=>A.info(`game launch status: '${x.trim()}'`)),$.ok&&(f&&(R[c]=f),p.close_after_launch&&(e||!p.rs_plugin_loader)&&fetch("/close"))});b?b.then(L=>h(kt(L))):h(ye)},d=()=>{R.hdosInstalledVersion&&u()};Oe(`${R.env.direct6_url}${r}/${r}.json`,ye,f=>f.text().then(b=>{const g=JSON.parse(atob(b.split(".")[1])).environments.production;if(R[c]===g.id){A.info("game client is up-to-date"),u();return}A.info(`downloading client version ${g.version}...`),Oe(`${R.env.direct6_url}${r}/catalog/${g.id}/catalog.json`,ye,p=>p.text().then(y=>{const h=JSON.parse(atob(y.split(".")[1])),L=$=>$.replace(/^http:\/\/(.{5})-akamai\.aws\.snxd\.com\//i,"https://$1.akamaized.net/").replace(/^http:/i,"https:");Oe(L(h.metafile),ye,$=>$.text().then(x=>{const I=JSON.parse(atob(x.split(".")[1])),O=I.pieces.digests.map(C=>{const T=atob(C).split("").map(D=>D.charCodeAt(0).toString(16).padStart(2,"0")).join(""),j=L(h.config.remote.baseUrl).concat(h.config.remote.pieceFormat.replace("{SubString:0,2,{TargetDigest}}",T.substring(0,2)).replace("{TargetDigest}",T));return fetch(j,ye).then(D=>D.blob().then(le=>{const ee=new DecompressionStream("gzip");return new Response(le.slice(6).stream().pipeThrough(ee)).blob()}))});let U=0,S=null;for(let C=0;C{const T=new Blob(C).slice(U,U+S);u(I.id,T.arrayBuffer())})}),d)}),d)}),d)}function Ft(t,e,n){const l=t.slice();return l[48]=e[n],l}function qt(t,e,n){const l=t.slice();return l[51]=e[n],l}function zt(t,e,n){const l=t.slice();return l[54]=e[n][0],l[47]=e[n][1],l}function Wt(t,e,n){const l=t.slice();return l[48]=e[n],l}function _s(t){let e,n=ge(t[5]),l=[];for(let o=0;ot[25].call(e))},m(f,b){v(f,e,b);for(let g=0;gl.parentNode,r.anchor=l},p(i,a){t=i,r.ctx=t,a[0]&16&&o!==(o=t[4])&&dt(o,r)||vn(r,t,a)},d(i){i&&(w(e),w(n),w(l)),r.block.d(i),r.token=null,r=null}}}function ks(t){let e,n,l,o,r,i,a,c,u,d,f,b,g,p,y,h,L,$=t[12]&&Zt(t);function x(U,S){return S[0]&1&&(p=null),p==null&&(p=Object.entries(U[0].pluginConfig).length!==0),p?Is:Rs}let I=x(t,[-1,-1]),O=I(t);return{c(){e=m("span"),n=m("button"),l=m("img"),i=P(),a=m("button"),c=m("img"),d=P(),f=m("br"),b=P(),$&&$.c(),g=P(),O.c(),y=Ie(),Ut(l.src,o="svgs/download-solid.svg")||_(l,"src",o),_(l,"alt","Install plugin from updater URL"),_(n,"class","mx-1 aspect-square w-9 select-none rounded-md bg-blue-500 p-1 text-[20px] font-bold duration-200 enabled:hover:opacity-75 disabled:bg-gray-500"),n.disabled=r=!t[0].hasLibArchive||t[10],_(n,"title","Install plugin from updater URL"),Ut(c.src,u="svgs/folder-solid.svg")||_(c,"src",u),_(c,"alt","Install plugin from local directory"),_(a,"class","aspect-square w-9 select-none rounded-md bg-blue-500 p-1 text-[20px] font-bold duration-200 enabled:hover:opacity-75 disabled:bg-gray-500"),a.disabled=t[10],_(a,"title","Install plugin from local directory"),_(e,"class","align-middle")},m(U,S){v(U,e,S),k(e,n),k(n,l),k(e,i),k(e,a),k(a,c),v(U,d,S),v(U,f,S),v(U,b,S),$&&$.m(U,S),v(U,g,S),O.m(U,S),v(U,y,S),h||(L=[N(n,"click",t[27]),N(a,"click",t[17])],h=!0)},p(U,S){S[0]&1025&&r!==(r=!U[0].hasLibArchive||U[10])&&(n.disabled=r),S[0]&1024&&(a.disabled=U[10]),U[12]?$?$.p(U,S):($=Zt(U),$.c(),$.m(g.parentNode,g)):$&&($.d(1),$=null),I===(I=x(U,S))&&O?O.p(U,S):(O.d(1),O=I(U),O&&(O.c(),O.m(y.parentNode,y)))},d(U){U&&(w(e),w(d),w(f),w(b),w(g),w(y)),$&&$.d(U),O.d(U),h=!1,re(L)}}}function ws(t){let e;return{c(){e=m("p"),e.textContent="error"},m(n,l){v(n,e,l)},p:B,d(n){n&&w(e)}}}function vs(t){let e,n,l,o,r,i,a,c,u,d;function f(h,L){return L[0]&19&&(e=null),L[0]&1&&(n=null),e==null&&(e=!!(h[47]&&h[47].main&&Object.keys(h[0].pluginConfig).includes(h[1]))),e?Ss:(n==null&&(n=Object.entries(h[0].pluginConfig).length===0),n?$s:ys)}let b=f(t,[-1,-1]),g=b(t),p=ge(t[5]),y=[];for(let h=0;h',i=P(),_(r,"class","select-none rounded-sm bg-rose-500 shadow-lg hover:opacity-75")},m(d,f){v(d,e,f),k(e,l),k(e,o),k(e,r),k(e,i),a||(c=N(r,"click",u),a=!0)},p(d,f){t=d,f[0]&33&&n!==(n=(t[0].pluginConfig[t[51].id].name??t[51].id)+"")&&pe(l,n)},d(d){d&&w(e),a=!1,c()}}}function Xt(t){let e,n;function l(i,a){return a[0]&33&&(e=null),e==null&&(e=!!Object.keys(i[0].pluginConfig).includes(i[51].id)),e?Ls:Cs}let o=l(t,[-1,-1]),r=o(t);return{c(){r.c(),n=Ie()},m(i,a){r.m(i,a),v(i,n,a)},p(i,a){o===(o=l(i,a))&&r?r.p(i,a):(r.d(1),r=o(i),r&&(r.c(),r.m(n.parentNode,n)))},d(i){i&&w(n),r.d(i)}}}function Yt(t){let e,n=t[48].uid===t[2]&&Vt(t);return{c(){n&&n.c(),e=Ie()},m(l,o){n&&n.m(l,o),v(l,e,o)},p(l,o){l[48].uid===l[2]?n?n.p(l,o):(n=Vt(l),n.c(),n.m(e.parentNode,e)):n&&(n.d(1),n=null)},d(l){l&&w(e),n&&n.d(l)}}}function Ps(t){let e;return{c(){e=m("p"),e.textContent="loading..."},m(n,l){v(n,e,l)},p:B,d(n){n&&w(e)}}}function Zt(t){let e,n,l,o,r,i,a,c,u,d,f,b;return{c(){e=m("label"),e.textContent="URL:",n=P(),l=m("textarea"),o=P(),r=m("button"),r.innerHTML='Confirm',i=P(),a=m("button"),a.innerHTML='Close',c=P(),u=m("br"),d=m("br"),_(e,"for","plugin-updater-url-input"),_(l,"rows","1"),_(l,"id","plugin-updater-url-input"),_(l,"class","w-[50%] max-w-[60%] resize-x rounded border-2 border-slate-300 bg-slate-100 text-slate-950 dark:border-slate-800"),_(r,"title","Confirm"),_(r,"class","select-none rounded-sm bg-emerald-500 hover:opacity-75"),_(a,"title","Close URL entry"),_(a,"class","select-none rounded-sm bg-rose-500 hover:opacity-75")},m(g,p){v(g,e,p),v(g,n,p),v(g,l,p),K(l,t[13]),v(g,o,p),v(g,r,p),v(g,i,p),v(g,a,p),v(g,c,p),v(g,u,p),v(g,d,p),f||(b=[N(l,"input",t[28]),N(r,"click",t[29]),N(a,"click",t[30])],f=!0)},p(g,p){p[0]&8192&&K(l,g[13])},d(g){g&&(w(e),w(n),w(l),w(o),w(r),w(i),w(a),w(c),w(u),w(d)),f=!1,re(b)}}}function Rs(t){let e;return{c(){e=m("p"),e.textContent=`You have no plugins installed. You can install plugins either from an updater URL, or by - downloading them onto your computer and selecting the "bolt.json" file.`},m(n,l){v(n,e,l)},p:B,d(n){n&&w(e)}}}function Is(t){let e=Object.keys(t[0].pluginConfig).includes(t[1])&&t[4]!==null,n,l=e&&Kt(t);return{c(){l&&l.c(),n=Ie()},m(o,r){l&&l.m(o,r),v(o,n,r)},p(o,r){r[0]&19&&(e=Object.keys(o[0].pluginConfig).includes(o[1])&&o[4]!==null),e?l?l.p(o,r):(l=Kt(o),l.c(),l.m(n.parentNode,n)):l&&(l.d(1),l=null)},d(o){o&&w(n),l&&l.d(o)}}}function Kt(t){let e,n,l,o,r,i,a,c,u,d,f,b,g={ctx:t,current:null,token:null,hasCatch:!0,pending:Os,then:Hs,catch:Us,value:47};dt(e=t[4],g);let p=t[3].updaterURL&&en(t);return{c(){g.block.c(),n=P(),l=m("button"),l.textContent="Browse data",o=z(` -   - `),r=m("button"),r.textContent="Browse config",i=P(),a=m("br"),c=P(),p&&p.c(),u=P(),d=m("button"),d.textContent="Remove",_(l,"class","mx-auto mb-1 w-[min(144px,_25%)] select-none rounded-lg bg-blue-500 p-2 font-bold text-black duration-200 hover:opacity-75"),_(r,"class","mx-auto mb-1 w-[min(144px,_25%)] select-none rounded-lg bg-blue-500 p-2 font-bold text-black duration-200 hover:opacity-75"),_(d,"class","m-1 mx-auto w-[min(144px,_25%)] select-none rounded-lg p-2 font-bold text-black duration-200 enabled:bg-rose-500 enabled:hover:opacity-75 disabled:bg-gray-500")},m(y,h){g.block.m(y,g.anchor=h),g.mount=()=>n.parentNode,g.anchor=n,v(y,n,h),v(y,l,h),v(y,o,h),v(y,r,h),v(y,i,h),v(y,a,h),v(y,c,h),p&&p.m(y,h),v(y,u,h),v(y,d,h),f||(b=[N(l,"click",t[31]),N(r,"click",t[32]),N(d,"click",t[34])],f=!0)},p(y,h){t=y,g.ctx=t,h[0]&16&&e!==(e=t[4])&&dt(e,g)||vn(g,t,h),t[3].updaterURL?p?p.p(t,h):(p=en(t),p.c(),p.m(u.parentNode,u)):p&&(p.d(1),p=null)},d(y){y&&(w(n),w(l),w(o),w(r),w(i),w(a),w(c),w(u),w(d)),g.block.d(y),g.token=null,g=null,p&&p.d(y),f=!1,re(b)}}}function Us(t){let e,n,l;return{c(){e=m("p"),e.textContent="error",n=P(),l=m("br")},m(o,r){v(o,e,r),v(o,n,r),v(o,l,r)},p:B,d(o){o&&(w(e),w(n),w(l))}}}function Hs(t){let e,n=(t[47].name??Ze)+"",l,o,r,i,a=(t[47].description??"no description")+"",c,u,d,f,b=t[47].version&&Qt(t);return{c(){e=m("p"),l=z(n),o=P(),b&&b.c(),r=P(),i=m("p"),c=z(a),d=P(),f=m("br"),_(e,"class","pb-4 text-xl font-bold"),_(i,"class",u=t[47].description?null:"italic")},m(g,p){v(g,e,p),k(e,l),k(e,o),b&&b.m(e,null),v(g,r,p),v(g,i,p),k(i,c),v(g,d,p),v(g,f,p)},p(g,p){p[0]&16&&n!==(n=(g[47].name??Ze)+"")&&pe(l,n),g[47].version?b?b.p(g,p):(b=Qt(g),b.c(),b.m(e,null)):b&&(b.d(1),b=null),p[0]&16&&a!==(a=(g[47].description??"no description")+"")&&pe(c,a),p[0]&16&&u!==(u=g[47].description?null:"italic")&&_(i,"class",u)},d(g){g&&(w(e),w(r),w(i),w(d),w(f)),b&&b.d()}}}function Qt(t){let e,n,l,o,r=t[47].version+"",i;return{c(){e=m("br"),n=P(),l=m("span"),o=z("v"),i=z(r),_(l,"class","pb-4 text-xl font-bold italic text-slate-600")},m(a,c){v(a,e,c),v(a,n,c),v(a,l,c),k(l,o),k(l,i)},p(a,c){c[0]&16&&r!==(r=a[47].version+"")&&pe(i,r)},d(a){a&&(w(e),w(n),w(l))}}}function Os(t){let e;return{c(){e=m("p"),e.textContent="loading..."},m(n,l){v(n,e,l)},p:B,d(n){n&&w(e)}}}function en(t){let e,n,l,o;return{c(){e=m("button"),e.textContent="Check updates",n=z(` -  `),_(e,"class","m-1 mx-auto w-[min(144px,_25%)] select-none rounded-lg p-2 font-bold text-black duration-200 enabled:bg-blue-500 enabled:hover:opacity-75 disabled:bg-gray-500")},m(r,i){v(r,e,i),v(r,n,i),l||(o=N(e,"click",t[33]),l=!0)},p:B,d(r){r&&(w(e),w(n)),l=!1,o()}}}function tn(t){let e,n,l,o;function r(c,u){return c[9]?xs:Ts}let i=r(t),a=i(t);return{c(){e=m("br"),n=m("br"),l=P(),a.c(),o=Ie()},m(c,u){v(c,e,u),v(c,n,u),v(c,l,u),a.m(c,u),v(c,o,u)},p(c,u){i===(i=r(c))&&a?a.p(c,u):(a.d(1),a=i(c),a&&(a.c(),a.m(o.parentNode,o)))},d(c){c&&(w(e),w(n),w(l),w(o)),a.d(c)}}}function Ts(t){let e,n,l;return{c(){e=m("p"),n=z("[info] "),l=z(t[8])},m(o,r){v(o,e,r),k(e,n),k(e,l)},p(o,r){r[0]&256&&pe(l,o[8])},d(o){o&&w(e)}}}function xs(t){let e,n,l;return{c(){e=m("p"),n=z("[error] "),l=z(t[8]),_(e,"class","text-red-500")},m(o,r){v(o,e,r),k(e,n),k(e,l)},p(o,r){r[0]&256&&pe(l,o[8])},d(o){o&&w(e)}}}function Ns(t){let e,n,l,o,r,i,a,c,u,d,f,b,g,p,y;function h(S,C){return S[5].length==0?gs:_s}let L=h(t),$=L(t);function x(S,C){return S[0].hasBoltPlugins?ms:hs}let I=x(t),O=I(t),U=t[8]&&tn(t);return{c(){e=m("div"),n=m("button"),l=z("Manage Plugins"),r=P(),i=m("hr"),a=P(),$.c(),c=P(),u=m("div"),O.c(),d=P(),U&&U.c(),f=P(),b=m("div"),g=m("button"),g.textContent="about plugins",_(n,"class",o="mx-auto mb-2 w-[95%] select-none rounded-lg border-2 "+(t[11]?"border-blue-500 text-black dark:text-white":"border-black bg-blue-500 text-black")+" p-2 font-bold hover:opacity-75"),_(i,"class","p-1 dark:border-slate-700"),_(e,"class","left-0 float-left h-full w-[min(180px,_50%)] overflow-hidden border-r-2 border-slate-300 pt-2 dark:border-slate-800"),_(u,"class","h-full pt-10"),_(g,"class","m-0 cursor-pointer select-none border-none bg-transparent p-0 text-sm text-gray-500 underline"),_(b,"class","absolute bottom-2 right-4")},m(S,C){v(S,e,C),k(e,n),k(n,l),k(e,r),k(e,i),k(e,a),$.m(e,null),v(S,c,C),v(S,u,C),O.m(u,null),k(u,d),U&&U.m(u,null),v(S,f,C),v(S,b,C),k(b,g),p||(y=[N(n,"click",t[23]),N(g,"click",t[21])],p=!0)},p(S,C){C[0]&2048&&o!==(o="mx-auto mb-2 w-[95%] select-none rounded-lg border-2 "+(S[11]?"border-blue-500 text-black dark:text-white":"border-black bg-blue-500 text-black")+" p-2 font-bold hover:opacity-75")&&_(n,"class",o),L===(L=h(S))&&$?$.p(S,C):($.d(1),$=L(S),$&&($.c(),$.m(e,null))),I===(I=x(S))&&O?O.p(S,C):(O.d(1),O=I(S),O&&(O.c(),O.m(u,d))),S[8]?U?U.p(S,C):(U=tn(S),U.c(),U.m(u,null)):U&&(U.d(1),U=null)},d(S){S&&(w(e),w(c),w(u),w(f),w(b)),$.d(),O.d(),U&&U.d(),p=!1,re(y)}}}function js(t){let e,n,l={class:"h-[90%] w-[90%] text-center",$$slots:{default:[Ns]},$$scope:{ctx:t}};return e=new bt({props:l}),t[37](e),e.$on("close",t[38]),{c(){de(e.$$.fragment)},m(o,r){ie(e,o,r),n=!0},p(o,r){const i={};r[0]&32639|r[1]&268435456&&(i.$$scope={dirty:r,ctx:o}),e.$set(i)},i(o){n||(q(e.$$.fragment,o),n=!0)},o(o){W(e.$$.fragment,o),n=!1},d(o){t[37](null),ae(e,o)}}}const Fe="bolt.json",Es="main.lua",Ze="(unnamed)",nn="(new character)";function Ms(t,e,n){let l,o,r,i;ke(t,Ot,H=>n(5,i=H));let a,c=null,u=!1;const d=R.platform==="windows"?"\\":"/",f=d.concat(Fe);function b(){n(12,G=!1),a.open()}const g=H=>{console.log(H),n(8,c=H),n(9,u=!1)},p=H=>{console.error(H),n(8,c=H),n(9,u=!0)},y=H=>new Promise((F,X)=>{const be=H.concat(H.endsWith(d)?Fe:f);var Z=new XMLHttpRequest;Z.onreadystatechange=()=>{Z.readyState==4&&(Z.status==200?F(JSON.parse(Z.responseText)):X(Z.responseText))},Z.open("GET","/read-json-file?".concat(new URLSearchParams({path:be}).toString()),!0),Z.send()}),h=H=>fetch("/get-plugindir-json?".concat(new URLSearchParams({id:H}).toString())).then(F=>F.ok?F.json():null),L=H=>{const X=R.pluginConfig[H];if(!X)return null;const be=X.path;return be?y(be):h(H)},$=()=>{const H=Object.keys(R.pluginConfig);let F;do F=crypto.randomUUID();while(H.includes(F));return F},x=(H,F)=>{y(H).then(X=>{n(1,j=$()),n(0,R.pluginConfig[j]={name:X.name??Ze,path:H,version:X.version},R),n(6,M.pluginConfigHasPendingChanges=!0,M)}).catch(X=>p(`config file '${F}' couldn't be fetched, reason: ${X}`))},I=H=>{g("downloading..."),fetch(H).then(async F=>{if(!F.ok){p(`can't install plugin: updater URL returned ${F.status}: ${F.statusText}`);return}const X=await F.json();if(X.url){const be=await fetch(X.url);if(!be.ok){p(`can't install plugin: remote download URL returned ${F.status}: ${F.statusText}`);return}const Z=await be.arrayBuffer();if(X.sha256){const Te=await crypto.subtle.digest("SHA-256",Z),wt=Array.from(new Uint8Array(Te)).map(vt=>vt.toString(16).padStart(2,"0")).join("");if(X.sha256!==wt){p("can't install plugin: incorrect file hash");return}}const we=$();if(!(await fetch("/install-plugin?".concat(new URLSearchParams({id:we}).toString()),{method:"POST",body:Z})).ok){p(`can't install plugin: ${F.statusText}`);return}const je=await h(we);je?(n(1,j=we),n(0,R.pluginConfig[j]={name:je.name??Ze,version:je.version,updaterURL:H,sha256:X.sha256},R),n(6,M.pluginConfigHasPendingChanges=!0,M),g(`plugin '${je.name}' installed`)):p(`can't install plugin: ${Fe} not found`)}}).catch(()=>{p("can't install plugin: unhandled exception")})};let O=!1;const U=()=>{n(10,O=!0);var H=new XMLHttpRequest;H.onreadystatechange=()=>{if(H.readyState==4&&(n(10,O=!1),H.status==200))if(H.responseText.endsWith(f)){const F=H.responseText.substring(0,H.responseText.length-Fe.length);x(F,H.responseText)}else p(`selection '${H.responseText}' is not named ${Fe}; ignored`)},H.open("GET","/json-file-picker",!0),H.send()};Pt();const S=(H,F,X,be)=>{let Z=null;if(X){const Ue=R.platform==="windows"?X.replaceAll("\\","/"):X;Z=Ue.endsWith(d)?Ue:Ue.concat("/")}var we=new XMLHttpRequest;we.onreadystatechange=()=>{we.readyState==4&&(Pt(),A.info(`Start-plugin status: ${we.statusText.trim()}`))},Z?we.open("GET","/start-plugin?".concat(new URLSearchParams({client:H.toString(),id:F,main:be,path:Z}).toString()),!0):we.open("GET","/start-plugin?".concat(new URLSearchParams({client:H.toString(),id:F,main:be}).toString()),!0),we.send()},C=(H,F)=>{var X=new XMLHttpRequest;X.onreadystatechange=()=>{X.readyState==4&&(Pt(),A.info(`Stop-plugin status: ${X.statusText.trim()}`))},X.open("GET","/stop-plugin?".concat(new URLSearchParams({client:H.toString(),uid:F.toString()}).toString()),!0),X.send()},T=(H,F)=>{const X=H.updaterURL;fetch(X).then(async be=>{if(!be.ok){p(`can't update plugin: updater URL returned ${be.status}: ${be.statusText}`);return}let Z=await be.json();if(!Z.url){g(`can't update plugin '${H.name}': no remote download URL is configured`);return}let we=!1;if(Z.sha256?H.sha256!==Z.sha256&&(we=!0):Z.version&&H.version!==Z.version&&(we=!0),we){const Ue=await fetch(Z.url);if(!Ue.ok){p(`can't update plugin: remote download URL returned ${Ue.status}: ${Ue.statusText}`);return}const je=await Ue.arrayBuffer();if(Z.sha256){const wt=await crypto.subtle.digest("SHA-256",je),vt=Array.from(new Uint8Array(wt)).map(Ln=>Ln.toString(16).padStart(2,"0")).join("");if(Z.sha256!==vt){p(`can't update plugin '${H.name}': incorrect file hash`);return}}fetch("/install-plugin?".concat(new URLSearchParams({id:F}).toString()),{method:"POST",body:je});const Te=await h(F);Te?(Z.sha256&&(H.sha256=Z.sha256),Te.name&&(H.name=Te.name),Te.version&&(H.version=Te.version),n(6,M.pluginConfigHasPendingChanges=!0,M),g(`plugin '${Te.name}' updated`)):p(`can't update plugin '${H.name}': ${Fe} not found`)}else g(`plugin '${H.name}' is already up-to-date`)})};var j;const D=()=>fetch("/open-external-url",{method:"POST",body:"https://bolt.adamcake.com/plugins"});var le=!1,ee;let G=!1,Q;const V=()=>n(11,le=!1),se=H=>{n(2,ee=H.uid),n(11,le=!0),n(12,G=!1),n(13,Q=""),n(8,c=null)};function E(){j=Tt(this),n(1,j),n(0,R)}const te=()=>n(8,c=null),Ce=()=>{n(12,G=!G),n(13,Q="")};function fe(){Q=this.value,n(13,Q)}const Ne=()=>{I(Q),n(12,G=!1),n(13,Q="")},$e=()=>{n(12,G=!1),n(13,Q="")},Ke=()=>{const H=R.pluginConfig[j].path;fetch(H?"/browse-directory?".concat(new URLSearchParams({path:H}).toString()):"/browse-plugin-data?".concat(new URLSearchParams({id:j}).toString()))},lt=()=>fetch("/browse-plugin-config?".concat(new URLSearchParams({id:j}).toString())),J=()=>T(l,j),Y=()=>{n(4,r=null),n(6,M.pluginConfigHasPendingChanges=!0,M);let H=R.pluginConfig;const F=H[j];F&&(fetch("/uninstall-plugin?".concat(new URLSearchParams({id:j,delete_data_dir:typeof F.path=="string"?"0":"1"}).toString())),g(`plugin '${F.name}' uninstalled`),delete H[j],n(0,R.pluginConfig=H,R))},ot=H=>S(ee,j,o??null,H.main??Es),rt=H=>{C(ee,H.uid)};function Sn(H){Pe[H?"unshift":"push"](()=>{a=H,n(7,a)})}const Cn=()=>ne.savePluginConfig(!0);return t.$$.update=()=>{t.$$.dirty[0]&36&&(i.some(H=>H.uid===ee)||n(11,le=!1)),t.$$.dirty[0]&3&&n(3,l=R.pluginConfig[j]),t.$$.dirty[0]&2&&n(4,r=L(j)),t.$$.dirty[0]&24&&r&&r.then(H=>{let F=!1;H.name!==l.name&&(n(3,l.name=H.name,l),F=!0),H.version!==l.version&&(n(3,l.version=H.version,l),F=!0),F&&(n(3,l),n(0,R),n(1,j),n(4,r),n(6,M.pluginConfigHasPendingChanges=!0,M))}),t.$$.dirty[0]&8&&n(14,o=l?l.path:null)},[R,j,ee,l,r,i,M,a,c,u,O,le,G,Q,o,g,I,U,S,C,T,D,b,V,se,E,te,Ce,fe,Ne,$e,Ke,lt,J,Y,ot,rt,Sn,Cn]}class As extends me{constructor(e){super(),he(this,e,Ms,js,_e,{open:22},null,[-1,-1])}get open(){return this.$$.ctx[22]}}function Ds(t){let e,n,l,o,r,i,a,c,u,d,f,b,g;return{c(){e=m("div"),n=m("h2"),n.textContent="Game is offline",l=P(),o=m("br"),r=P(),i=m("p"),i.textContent="This game appears to be offline for maintenance or an update. Launch anyway?",a=P(),c=m("div"),u=m("button"),u.textContent="No",d=P(),f=m("button"),f.textContent="Yes",_(n,"class","text-3xl font-extrabold"),_(u,"class","mx-1 mb-2 mt-5 w-[45%] rounded-lg bg-blue-500 p-2 font-bold text-black duration-200 hover:opacity-75"),_(f,"class","mx-1 mb-2 mt-5 w-[45%] rounded-lg bg-emerald-500 p-2 font-bold text-black duration-200 hover:opacity-75"),_(c,"class","align-bottom")},m(p,y){v(p,e,y),k(e,n),k(e,l),k(e,o),k(e,r),k(e,i),k(e,a),k(e,c),k(c,u),k(c,d),k(c,f),b||(g=[N(u,"click",t[5]),N(f,"click",t[6])],b=!0)},p:B,d(p){p&&w(e),b=!1,re(g)}}}function Bs(t){let e,n,l={class:"h-fit w-3/5 px-5 py-3 text-center",$$slots:{default:[Ds]},$$scope:{ctx:t}};return e=new bt({props:l}),t[7](e),{c(){de(e.$$.fragment)},m(o,r){ie(e,o,r),n=!0},p(o,[r]){const i={};r&271&&(i.$$scope={dirty:r,ctx:o}),e.$set(i)},i(o){n||(q(e.$$.fragment,o),n=!0)},o(o){W(e.$$.fragment,o),n=!1},d(o){t[7](null),ae(e,o)}}}function Fs(t,e,n){let l,o,r,i;function a(f,b,g){n(3,i=f),n(1,o=b),n(2,r=g),l.open()}const c=()=>{l.close()},u=()=>{i(o,r),l.close()};function d(f){Pe[f?"unshift":"push"](()=>{l=f,n(0,l)})}return[l,o,r,i,a,c,u,d]}class qs extends me{constructor(e){super(),he(this,e,Fs,Bs,_e,{open:4})}get open(){return this.$$.ctx[4]}}function sn(t,e,n){const l=t.slice();return l[20]=e[n],l}function ln(t,e,n){const l=t.slice();return l[23]=e[n],l}function zs(t){let e,n,l={};return e=new As({props:l}),t[16](e),{c(){de(e.$$.fragment)},m(o,r){ie(e,o,r),n=!0},p(o,r){const i={};e.$set(i)},i(o){n||(q(e.$$.fragment,o),n=!0)},o(o){W(e.$$.fragment,o),n=!1},d(o){t[16](null),ae(e,o)}}}function on(t){let e,n;return{c(){e=m("div"),n=z(t[7]),_(e,"class","absolute left-[2%] w-[96%] rounded-lg bg-blue-400 px-2 text-black")},m(l,o){v(l,e,o),k(e,n)},p(l,o){o&128&&pe(n,l[7])},d(l){l&&w(e)}}}function Ws(t){let e,n,l;return{c(){e=m("button"),e.textContent="Plugin menu",e.disabled=!R.hasBoltPlugins,_(e,"title",R.hasBoltPlugins?null:"This feature is disabled"),_(e,"class","w-52 rounded-lg p-2 font-bold text-black duration-200 enabled:bg-blue-500 enabled:hover:opacity-75 disabled:bg-gray-500")},m(o,r){v(o,e,r),n||(l=N(e,"click",t[19]),n=!0)},p:B,d(o){o&&w(e),n=!1,l()}}}function Js(t){let e,n,l,o,r,i,a=ge(jt[t[1].selected.game]),c=[];for(let u=0;ut[18].call(o)),_(e,"class","flex flex-col")},m(u,d){v(u,e,d),k(e,n),k(e,l),k(e,o);for(let f=0;fn(1,i=S)),ke(t,g,S=>n(8,u=S));let p=Me(null);ke(t,p,S=>n(7,c=S));let y=Me(!0);ke(t,y,S=>n(6,a=S));function h(S,C){if(!l)return A.warn("Please log in or select a user to play.");if(!o)return A.warn("Please select a character from the select menu.");const T=ne.findSession(i.selected.user_id);if(!T)return A.warn("Unable to launch game, session was not found.");const{session_id:j}=T,D=ne.findAccount(T.accounts,o);if(!D)return A.warn("Unable to launch game, account was not found.");const{accountId:le,displayName:ee}=D,G=R.platform===It.Windows,Q=R.platform===It.Linux;switch(S){case ce.osrs:switch(C){case Ve.official:Bt(G||Q,!0,j,le,ee);break;case Ve.runelite:$n(j,le,ee,!1);break;case Ve.hdos:ps(j,le,ee);break}break;case ce.rs3:Q?fs(j,le,ee):Bt(G,!1,j,le,ee);break}}function L(S){const C=S.target.value;if(!l)return;const T=i.userDetails[l];T?(T.account_id=C,Re(b,i.userDetails[l]=T,i)):Re(b,i.userDetails[l]={account_id:C},i)}function $(S){Pe[S?"unshift":"push"](()=>{d=S,n(2,d)})}function x(S){Pe[S?"unshift":"push"](()=>{f=S,n(3,f)})}const I=()=>{a?h(i.selected.game,i.selected.client):d.open(h,i.selected.game,i.selected.client)};function O(){i.selected.client=Tt(this),b.set(i)}const U=()=>{f.open()};return t.$$.update=()=>{var S,C;if(t.$$.dirty&2&&n(14,l=i.selected.user_id),t.$$.dirty&16386&&n(4,o=(S=i.userDetails[l??""])==null?void 0:S.account_id),t.$$.dirty&2&&n(5,r=((C=ne.findSession(i.selected.user_id))==null?void 0:C.accounts)??[]),t.$$.dirty&2)if(i.check_announcements){const T=i.selected.game==ce.osrs?"osrs":R.env.provider,j=`${R.env.psa_url}${T}/${T}.json`;fetch(j,{method:"GET",cache:"no-store"}).then(D=>D.json()).then(D=>{Re(p,c=D.psaEnabled&&D.psaMessage?D.psaMessage:null,c),Re(y,a=!(D.playDisabled??!1),a)})}else Re(p,c=null,c),Re(y,a=!0,a)},[h,i,d,f,o,r,a,c,u,b,g,p,y,L,l,$,x,I,O,U]}class Zs extends me{constructor(e){super(),he(this,e,Ys,Xs,_e,{launch:0})}get launch(){return this.$$.ctx[0]}}function un(t,e,n){const l=t.slice();return l[1]=e[n].date,l[2]=e[n].severity,l[3]=e[n].content,l}function dn(t){var c;let e,n=((c=t[1])==null?void 0:c.toLocaleTimeString())+"",l,o,r=t[3]+"",i,a;return{c(){e=m("li"),l=z(n),o=z(` - - `),i=z(r),a=P(),ue(e,"text-rose-500",t[2]===et.error),ue(e,"text-orange-700",t[2]===et.warn)},m(u,d){v(u,e,d),k(e,l),k(e,o),k(e,i),k(e,a)},p(u,d){var f;d&1&&n!==(n=((f=u[1])==null?void 0:f.toLocaleTimeString())+"")&&pe(l,n),d&1&&r!==(r=u[3]+"")&&pe(i,r),d&1&&ue(e,"text-rose-500",u[2]===et.error),d&1&&ue(e,"text-orange-700",u[2]===et.warn)},d(u){u&&w(e)}}}function Ks(t){let e,n,l,o,r=ge(t[0]),i=[];for(let a=0;a',l=P(),o=m("ol");for(let a=0;a{"logs"in o&&n(0,l=o.logs)},[l]}class el extends me{constructor(e){super(),he(this,e,Qs,Ks,_e,{logs:0})}}function fn(t,e,n){const l=t.slice();return l[7]=e[n],l}function pn(t,e){let n,l=e[7].user.displayName+"",o,r;return{key:t,first:null,c(){n=m("option"),o=z(l),n.__value=r=e[7].user.userId,K(n,n.__value),_(n,"class","dark:bg-slate-900"),this.first=n},m(i,a){v(i,n,a),k(n,o)},p(i,a){e=i,a&2&&l!==(l=e[7].user.displayName+"")&&pe(o,l),a&2&&r!==(r=e[7].user.userId)&&(n.__value=r,K(n,n.__value))},d(i){i&&w(n)}}}function tl(t){let e,n,l=[],o=new Map,r,i,a,c,u,d,f,b,g,p=ge(t[1]);const y=h=>h[7].user.userId;for(let h=0;ht[4].call(e)),_(a,"class","mx-auto mr-2 rounded-lg bg-blue-500 p-2 font-bold text-black duration-200 hover:opacity-75"),_(u,"class","mx-auto rounded-lg border-2 border-blue-500 p-2 font-bold duration-200 hover:opacity-75"),u.disabled=f=!t[0].selected.user_id,_(i,"class","mt-5 flex")},m(h,L){v(h,e,L),k(e,n);for(let $=0;$n(1,o=d)),ke(t,i,d=>n(0,l=d));function a(){l.selected.user_id=Tt(this),i.set(l)}return[l,o,r,i,a,()=>{const{origin:d,redirect:f,clientid:b}=R.env;Se.openLoginWindow(d,f,b)},async()=>{l.selected.user_id&&(await ne.logout(l.selected.user_id),ne.saveCredentials())}]}class sl extends me{constructor(e){super(),he(this,e,nl,tl,_e,{})}}function ll(t,{callback:e,ignore:n=[]}){const l=o=>{const r=n.some(i=>i.contains(o.target));t&&!t.contains(o.target)&&!o.defaultPrevented&&!r&&e()};return document.addEventListener("click",l,!0),document.addEventListener("contextmenu",l,!0),{destroy(){document.removeEventListener("click",l,!0),document.removeEventListener("contextmenu",l,!0)}}}const ol=t=>({}),_n=t=>({});function gn(t){let e,n,l,o,r,i;const a=t[9].content,c=pt(a,t,t[8],_n);return{c(){e=m("div"),c&&c.c(),_(e,"class",n="dropdown-color absolute z-20 rounded-lg border-2 "+t[1]+" "+t[2]+" svelte-xifudk")},m(u,d){v(u,e,d),c&&c.m(e,null),o=!0,r||(i=On(l=ll.call(null,e,{callback:t[3],ignore:[t[5]]})),r=!0)},p(u,d){c&&c.p&&(!o||d&256)&>(c,a,u,u[8],o?_t(a,u[8],d,ol):ht(u[8]),_n),(!o||d&6&&n!==(n="dropdown-color absolute z-20 rounded-lg border-2 "+u[1]+" "+u[2]+" svelte-xifudk"))&&_(e,"class",n),l&&ft(l.update)&&d&32&&l.update.call(null,{callback:u[3],ignore:[u[5]]})},i(u){o||(q(c,u),o=!0)},o(u){W(c,u),o=!1},d(u){u&&w(e),c&&c.d(u),r=!1,i()}}}function rl(t){let e,n,l,o,r,i,a;const c=t[9].default,u=pt(c,t,t[8],null);let d=t[4]&&gn(t);return{c(){e=m("div"),n=m("button"),u&&u.c(),l=P(),d&&d.c(),_(e,"class",o="relative h-fit w-fit "+t[0]+" svelte-xifudk")},m(f,b){v(f,e,b),k(e,n),u&&u.m(n,null),t[10](n),k(e,l),d&&d.m(e,null),r=!0,i||(a=N(n,"click",t[6]),i=!0)},p(f,[b]){u&&u.p&&(!r||b&256)&>(u,c,f,f[8],r?_t(c,f[8],b,null):ht(f[8]),null),f[4]?d?(d.p(f,b),b&16&&q(d,1)):(d=gn(f),d.c(),q(d,1),d.m(e,null)):d&&(nt(),W(d,1,1,()=>{d=null}),st()),(!r||b&1&&o!==(o="relative h-fit w-fit "+f[0]+" svelte-xifudk"))&&_(e,"class",o)},i(f){r||(q(u,f),q(d),r=!0)},o(f){W(u,f),W(d),r=!1},d(f){f&&w(e),u&&u.d(f),t[10](null),d&&d.d(),i=!1,a()}}}function il(t,e,n){let{$$slots:l={},$$scope:o}=e,{class:r=""}=e,{position:i="bottom"}=e,{align:a="start"}=e,c=!1,u;function d(){n(4,c=!0)}function f(){n(4,c=!1)}function b(){c?f():d()}function g(p){Pe[p?"unshift":"push"](()=>{u=p,n(5,u)})}return t.$$set=p=>{"class"in p&&n(0,r=p.class),"position"in p&&n(1,i=p.position),"align"in p&&n(2,a=p.align),"$$scope"in p&&n(8,o=p.$$scope)},[r,i,a,f,c,u,b,d,o,l,g]}class al extends me{constructor(e){super(),he(this,e,il,rl,_e,{class:0,position:1,align:2,open:7,close:3})}get open(){return this.$$.ctx[7]}get close(){return this.$$.ctx[3]}}function cl(t){let e,n,l,o,r,i,a,c,u,d,f,b,g,p,y,h,L,$;return{c(){e=m("button"),e.innerHTML=`
Browse app data - Browse App Data
`,n=P(),l=m("div"),o=m("label"),o.textContent="Check game announcements:",r=P(),i=m("input"),a=P(),c=m("div"),u=m("label"),u.textContent="Close Bolt after launching a game:",d=P(),f=m("input"),b=P(),g=m("div"),p=m("label"),p.textContent="Discard expired login sessions:",y=P(),h=m("input"),_(e,"id","data_dir_button"),_(e,"class","p-2 hover:opacity-75"),_(o,"for","check_announcements"),_(i,"id","check_announcements"),_(i,"type","checkbox"),_(i,"class","ml-2"),_(l,"class","mx-auto p-2"),_(l,"title",ul),_(u,"for","close_after_launch"),_(f,"id","close_after_launch"),_(f,"type","checkbox"),_(f,"class","ml-2"),_(c,"class","mx-auto p-2"),_(c,"title",dl),_(p,"for","discard_expired_logins"),_(h,"id","discard_expired_logins"),_(h,"type","checkbox"),_(h,"class","ml-2"),_(g,"class","mx-auto p-2"),_(g,"title",fl)},m(x,I){v(x,e,I),v(x,n,I),v(x,l,I),k(l,o),k(l,r),k(l,i),i.checked=t[0].check_announcements,v(x,a,I),v(x,c,I),k(c,u),k(c,d),k(c,f),f.checked=t[0].close_after_launch,v(x,b,I),v(x,g,I),k(g,p),k(g,y),k(g,h),h.checked=t[0].discard_expired_sessions,L||($=[N(e,"click",t[3]),N(i,"change",t[4]),N(f,"change",t[5]),N(h,"change",t[6])],L=!0)},p(x,[I]){I&1&&(i.checked=x[0].check_announcements),I&1&&(f.checked=x[0].close_after_launch),I&1&&(h.checked=x[0].discard_expired_sessions)},i:B,o:B,d(x){x&&(w(e),w(n),w(l),w(a),w(c),w(b),w(g)),L=!1,re($)}}}const ul="Allow checking for official announcements about game status. These will be displayed above the 'play' button. Disabling will reduce the number of web requests made when opening the launcher.",dl="Close the launcher immediately after launching a game",fl="Discard login sessions if they're no longer valid, prompting the player to sign-in again. If unchecked, the only way to discard a login will be by manually pressing the 'log out' button, even if your login no longer works.";function pl(t,e,n){let l;function o(){var d=new XMLHttpRequest;d.open("GET","/browse-data"),d.onreadystatechange=()=>{d.readyState==4&&A.info(`Browse status: '${d.responseText.trim()}'`)},d.send()}const{config:r}=M;ke(t,r,d=>n(0,l=d));const i=()=>{o()};function a(){l.check_announcements=this.checked,r.set(l)}function c(){l.close_after_launch=this.checked,r.set(l)}function u(){l.discard_expired_sessions=this.checked,r.set(l)}return[l,o,r,i,a,c,u]}class _l extends me{constructor(e){super(),he(this,e,pl,cl,_e,{})}}function gl(t){let e,n,l,o,r,i,a,c,u,d,f,b,g,p,y,h,L,$,x,I,O,U,S,C,T,j,D,le,ee,G,Q,V,se,E,te,Ce,fe,Ne,$e,Ke,lt;return{c(){var J,Y;e=m("button"),n=m("div"),n.innerHTML=`Configure RuneLite - Configure RuneLite`,o=P(),r=m("div"),i=m("label"),i.textContent="Use custom RuneLite JAR:",a=P(),c=m("input"),u=P(),d=m("div"),f=m("textarea"),g=P(),p=m("br"),y=P(),h=m("button"),L=z("Select File"),x=P(),I=m("div"),O=m("label"),O.textContent="OSRS launch command:",U=P(),S=m("br"),C=P(),T=m("textarea"),j=P(),D=m("div"),le=m("label"),le.textContent="RuneLite launch command:",ee=P(),G=m("br"),Q=P(),V=m("textarea"),se=P(),E=m("div"),te=m("label"),te.textContent="HDOS launch command:",Ce=P(),fe=m("br"),Ne=P(),$e=m("textarea"),_(n,"class","flex"),e.disabled=l=!((J=t[0])!=null&&J.session_id)||!((Y=t[3])!=null&&Y.accountId),_(e,"class","p-2 pb-5 hover:opacity-75"),_(i,"for","use_custom_jar"),_(c,"id","use_custom_jar"),_(c,"type","checkbox"),_(c,"class","ml-2"),_(r,"class","mx-auto border-t-2 border-slate-300 p-2 pt-5 dark:border-slate-800"),_(f,"class","h-10 rounded border-2 border-slate-300 bg-slate-100 text-slate-950 dark:border-slate-800 dark:bg-slate-900 dark:text-slate-50"),f.disabled=b=!t[1].runelite_use_custom_jar,_(h,"class","mt-1 rounded-lg border-2 border-blue-500 p-1 duration-200 enabled:hover:opacity-75"),h.disabled=$=t[2]||!t[1].runelite_use_custom_jar,_(d,"class","mx-auto p-2"),ue(d,"opacity-25",!t[1].runelite_use_custom_jar),_(O,"for","osrs_custom_launch_command"),_(T,"id","osrs_custom_launch_command"),_(T,"class","resize-x rounded border-2 border-slate-300 bg-slate-100 text-slate-950 disabled:opacity-50 dark:border-slate-800 dark:bg-slate-900 dark:text-slate-50"),_(T,"rows","1"),_(T,"cols","35"),_(T,"placeholder","%command%"),_(I,"class","p-2"),_(le,"for","runelite_custom_launch_command"),_(V,"id","runelite_custom_launch_command"),_(V,"class","resize-x rounded border-2 border-slate-300 bg-slate-100 text-slate-950 disabled:opacity-50 dark:border-slate-800 dark:bg-slate-900 dark:text-slate-50"),_(V,"rows","1"),_(V,"cols","35"),_(V,"placeholder","%command%"),_(D,"class","p-2"),_(te,"for","hdos_custom_launch_command"),_($e,"id","hdos_custom_launch_command"),_($e,"class","resize-x rounded border-2 border-slate-300 bg-slate-100 text-slate-950 disabled:opacity-50 dark:border-slate-800 dark:bg-slate-900 dark:text-slate-50"),_($e,"rows","1"),_($e,"cols","35"),_($e,"placeholder","%command%"),_(E,"class","p-2")},m(J,Y){v(J,e,Y),k(e,n),v(J,o,Y),v(J,r,Y),k(r,i),k(r,a),k(r,c),c.checked=t[1].runelite_use_custom_jar,v(J,u,Y),v(J,d,Y),k(d,f),K(f,t[1].runelite_custom_jar),k(d,g),k(d,p),k(d,y),k(d,h),k(h,L),v(J,x,Y),v(J,I,Y),k(I,O),k(I,U),k(I,S),k(I,C),k(I,T),K(T,t[1].osrs_launch_command),v(J,j,Y),v(J,D,Y),k(D,le),k(D,ee),k(D,G),k(D,Q),k(D,V),K(V,t[1].runelite_launch_command),v(J,se,Y),v(J,E,Y),k(E,te),k(E,Ce),k(E,fe),k(E,Ne),k(E,$e),K($e,t[1].hdos_launch_command),Ke||(lt=[N(e,"click",t[7]),N(c,"change",t[8]),N(f,"input",t[9]),N(h,"click",t[10]),N(T,"input",t[11]),N(V,"input",t[12]),N($e,"input",t[13])],Ke=!0)},p(J,[Y]){var ot,rt;Y&9&&l!==(l=!((ot=J[0])!=null&&ot.session_id)||!((rt=J[3])!=null&&rt.accountId))&&(e.disabled=l),Y&2&&(c.checked=J[1].runelite_use_custom_jar),Y&2&&b!==(b=!J[1].runelite_use_custom_jar)&&(f.disabled=b),Y&2&&K(f,J[1].runelite_custom_jar),Y&6&&$!==($=J[2]||!J[1].runelite_use_custom_jar)&&(h.disabled=$),Y&2&&ue(d,"opacity-25",!J[1].runelite_use_custom_jar),Y&2&&K(T,J[1].osrs_launch_command),Y&2&&K(V,J[1].runelite_launch_command),Y&2&&K($e,J[1].hdos_launch_command)},i:B,o:B,d(J){J&&(w(e),w(o),w(r),w(u),w(d),w(x),w(I),w(j),w(D),w(se),w(E)),Ke=!1,re(lt)}}}function hl(t,e,n){let l,o,r;const{config:i}=M;ke(t,i,L=>n(1,r=L));let a=!1;async function c(){n(2,a=!0),Re(i,r.runelite_custom_jar=await ne.openFilePicker(),r),console.log("done picking"),n(2,a=!1)}function u(){!(l!=null&&l.session_id)||!(o!=null&&o.accountId)||!(o!=null&&o.displayName)||$n(l.session_id,o.accountId,o.displayName,!0)}const d=()=>u();function f(){r.runelite_use_custom_jar=this.checked,i.set(r)}function b(){r.runelite_custom_jar=this.value,i.set(r)}const g=()=>{c()};function p(){r.osrs_launch_command=this.value,i.set(r)}function y(){r.runelite_launch_command=this.value,i.set(r)}function h(){r.hdos_launch_command=this.value,i.set(r)}return t.$$.update=()=>{var L;t.$$.dirty&2&&n(0,l=ne.findSession(r.selected.user_id)),t.$$.dirty&3&&n(3,o=ne.findAccount((l==null?void 0:l.accounts)??[],(L=r.userDetails[r.selected.user_id??""])==null?void 0:L.account_id))},[l,r,a,o,i,c,u,d,f,b,g,p,y,h]}class ml extends me{constructor(e){super(),he(this,e,hl,gl,_e,{})}}function bl(t){let e,n,l,o,r,i;return{c(){e=m("div"),n=m("label"),n.textContent="Enable Bolt plugin loader:",l=P(),o=m("input"),_(n,"for","enable_plugins"),_(o,"type","checkbox"),_(o,"name","enable_plugins"),_(o,"id","enable_plugins"),_(o,"class","ml-2"),_(e,"class","mx-auto p-2")},m(a,c){v(a,e,c),k(e,n),k(e,l),k(e,o),o.checked=t[0].rs_plugin_loader,r||(i=N(o,"change",t[2]),r=!0)},p(a,c){c&1&&(o.checked=a[0].rs_plugin_loader)},d(a){a&&w(e),r=!1,i()}}}function kl(t){let e,n,l,o,r,i,a,c,u,d,f,b,g,p,y,h,L,$,x=R.hasBoltPlugins&&bl(t);return{c(){x&&x.c(),e=P(),n=m("div"),l=m("label"),l.textContent="Use custom config URI:",o=P(),r=m("input"),i=P(),a=m("div"),c=m("textarea"),d=P(),f=m("div"),b=m("label"),b.textContent="Launch command:",g=P(),p=m("br"),y=P(),h=m("textarea"),_(l,"for","use_custom_uri"),_(r,"id","use_custom_uri"),_(r,"type","checkbox"),_(r,"class","ml-2"),_(n,"class","mx-auto p-2"),_(c,"class","rounded border-2 border-slate-300 bg-slate-100 text-slate-950 disabled:opacity-50 dark:border-slate-800 dark:bg-slate-900 dark:text-slate-50"),c.disabled=u=!t[0].use_custom_rs_config_uri,_(c,"rows","4"),_(c,"placeholder",R.env.default_config_uri),_(a,"class","p-2"),_(b,"for","rs_custom_launch_command"),_(h,"id","rs_custom_launch_command"),_(h,"class","resize-x rounded border-2 border-slate-300 bg-slate-100 text-slate-950 disabled:opacity-50 dark:border-slate-800 dark:bg-slate-900 dark:text-slate-50"),_(h,"rows","1"),_(h,"cols","35"),_(h,"placeholder","%command%"),_(f,"class","p-2")},m(I,O){x&&x.m(I,O),v(I,e,O),v(I,n,O),k(n,l),k(n,o),k(n,r),r.checked=t[0].use_custom_rs_config_uri,v(I,i,O),v(I,a,O),k(a,c),K(c,t[0].rs_config_uri),v(I,d,O),v(I,f,O),k(f,b),k(f,g),k(f,p),k(f,y),k(f,h),K(h,t[0].rs_launch_command),L||($=[N(r,"change",t[3]),N(c,"input",t[4]),N(h,"input",t[5])],L=!0)},p(I,[O]){R.hasBoltPlugins&&x.p(I,O),O&1&&(r.checked=I[0].use_custom_rs_config_uri),O&1&&u!==(u=!I[0].use_custom_rs_config_uri)&&(c.disabled=u),O&1&&K(c,I[0].rs_config_uri),O&1&&K(h,I[0].rs_launch_command)},i:B,o:B,d(I){I&&(w(e),w(n),w(i),w(a),w(d),w(f)),x&&x.d(I),L=!1,re($)}}}function wl(t,e,n){let l;const{config:o}=M;ke(t,o,u=>n(0,l=u));function r(){l.rs_plugin_loader=this.checked,o.set(l)}function i(){l.use_custom_rs_config_uri=this.checked,o.set(l)}function a(){l.rs_config_uri=this.value,o.set(l)}function c(){l.rs_launch_command=this.value,o.set(l)}return[l,o,r,i,a,c]}class vl extends me{constructor(e){super(),he(this,e,wl,kl,_e,{})}}function yl(t){let e,n;return e=new vl({}),{c(){de(e.$$.fragment)},m(l,o){ie(e,l,o),n=!0},i(l){n||(q(e.$$.fragment,l),n=!0)},o(l){W(e.$$.fragment,l),n=!1},d(l){ae(e,l)}}}function $l(t){let e,n;return e=new ml({}),{c(){de(e.$$.fragment)},m(l,o){ie(e,l,o),n=!0},i(l){n||(q(e.$$.fragment,l),n=!0)},o(l){W(e.$$.fragment,l),n=!1},d(l){ae(e,l)}}}function Sl(t){let e,n;return e=new _l({}),{c(){de(e.$$.fragment)},m(l,o){ie(e,l,o),n=!0},i(l){n||(q(e.$$.fragment,l),n=!0)},o(l){W(e.$$.fragment,l),n=!1},d(l){ae(e,l)}}}function Cl(t){let e,n,l,o,r,i,a,c,u,d,f,b,g,p,y,h,L,$,x,I;const O=[Sl,$l,yl],U=[];function S(C,T){return C[1]==C[2].general?0:C[1]==C[2].osrs?1:C[1]==C[2].rs3?2:-1}return~(h=S(t))&&(L=U[h]=O[h](t)),{c(){e=m("div"),n=m("div"),l=m("button"),o=z("General"),i=P(),a=m("button"),c=z("OSRS"),d=P(),f=m("button"),b=z("RS3"),p=P(),y=m("div"),L&&L.c(),_(l,"class",r=t[1]===t[2].general?qe:ze),_(a,"class",u=t[1]===t[2].osrs?qe:ze),_(f,"class",g=t[1]===t[2].rs3?qe:ze),_(n,"class","flex flex-col items-center gap-2 border-r-2 border-slate-300 pt-10 dark:border-slate-800"),_(y,"class","col-span-3 p-5 pt-10 text-center"),_(e,"class","grid h-full grid-cols-4")},m(C,T){v(C,e,T),k(e,n),k(n,l),k(l,o),k(n,i),k(n,a),k(a,c),k(n,d),k(n,f),k(f,b),k(e,p),k(e,y),~h&&U[h].m(y,null),$=!0,x||(I=[N(l,"click",t[4]),N(a,"click",t[5]),N(f,"click",t[6])],x=!0)},p(C,T){(!$||T&2&&r!==(r=C[1]===C[2].general?qe:ze))&&_(l,"class",r),(!$||T&2&&u!==(u=C[1]===C[2].osrs?qe:ze))&&_(a,"class",u),(!$||T&2&&g!==(g=C[1]===C[2].rs3?qe:ze))&&_(f,"class",g);let j=h;h=S(C),h!==j&&(L&&(nt(),W(U[j],1,1,()=>{U[j]=null}),st()),~h?(L=U[h],L||(L=U[h]=O[h](C),L.c()),q(L,1),L.m(y,null)):L=null)},i(C){$||(q(L),$=!0)},o(C){W(L),$=!1},d(C){C&&w(e),~h&&U[h].d(),x=!1,re(I)}}}function Ll(t){let e,n,l={class:"h-3/4 w-3/4 select-none",$$slots:{default:[Cl]},$$scope:{ctx:t}};return e=new bt({props:l}),t[7](e),{c(){de(e.$$.fragment)},m(o,r){ie(e,o,r),n=!0},p(o,[r]){const i={};r&258&&(i.$$scope={dirty:r,ctx:o}),e.$set(i)},i(o){n||(q(e.$$.fragment,o),n=!0)},o(o){W(e.$$.fragment,o),n=!1},d(o){t[7](null),ae(e,o)}}}let qe="border-2 border-blue-500 bg-blue-500 hover:opacity-75 font-bold text-black duration-200 rounded-lg p-1 w-3/4",ze="border-2 border-blue-500 hover:opacity-75 duration-200 rounded-lg p-1 w-3/4";function Pl(t,e,n){let l;function o(){l.open()}var r=(f=>(f[f.general=0]="general",f[f.osrs=1]="osrs",f[f.rs3=2]="rs3",f))(r||{});let i=0;const a=()=>{n(1,i=r.general)},c=()=>{n(1,i=r.osrs)},u=()=>{n(1,i=r.rs3)};function d(f){Pe[f?"unshift":"push"](()=>{l=f,n(0,l)})}return[l,i,r,o,a,c,u,d]}class Rl extends me{constructor(e){super(),he(this,e,Pl,Ll,_e,{open:3})}get open(){return this.$$.ctx[3]}}function Il(t){const e=t.slice(),n=ne.findSession(e[1].selected.user_id??"");return e[11]=n,e}function Ul(t){let e,n,l;return{c(){e=m("button"),e.textContent="Login",_(e,"class","h-11 w-48 rounded-lg border-2 border-slate-300 bg-inherit p-2 text-center font-bold text-black duration-200 hover:opacity-75 dark:border-slate-800 dark:text-slate-50")},m(o,r){v(o,e,r),n||(l=N(e,"click",t[10]),n=!0)},p:B,i:B,o:B,d(o){o&&w(e),n=!1,l()}}}function Hl(t){let e,n;return e=new al({props:{align:"center",$$slots:{content:[Tl],default:[Ol]},$$scope:{ctx:t}}}),{c(){de(e.$$.fragment)},m(l,o){ie(e,l,o),n=!0},p(l,o){const r={};o&4098&&(r.$$scope={dirty:o,ctx:l}),e.$set(r)},i(l){n||(q(e.$$.fragment,l),n=!0)},o(l){W(e.$$.fragment,l),n=!1},d(l){ae(e,l)}}}function Ol(t){var o;let e,n=(((o=t[11])==null?void 0:o.user.displayName)??"No user selected")+"",l;return{c(){e=m("button"),l=z(n),_(e,"class","h-11 w-48 rounded-lg border-2 border-slate-300 bg-inherit text-center font-bold text-black duration-200 hover:opacity-75 dark:border-slate-800 dark:text-slate-50")},m(r,i){v(r,e,i),k(e,l)},p(r,i){var a;i&2&&n!==(n=(((a=r[11])==null?void 0:a.user.displayName)??"No user selected")+"")&&pe(l,n)},d(r){r&&w(e)}}}function Tl(t){let e,n,l;return n=new sl({}),{c(){e=m("div"),de(n.$$.fragment),_(e,"slot","content"),_(e,"class","w-40")},m(o,r){v(o,e,r),ie(n,e,null),l=!0},p:B,i(o){l||(q(n.$$.fragment,o),l=!0)},o(o){W(n.$$.fragment,o),l=!1},d(o){o&&w(e),ae(n)}}}function xl(t){let e,n,l,o,r,i,a,c,u,d,f,b,g,p,y,h,L,$,x={};e=new Rl({props:x}),t[5](e);const I=[Hl,Ul],O=[];function U(C,T){return C[2].length>0?0:1}function S(C,T){return T===0?Il(C):C}return p=U(t),y=O[p]=I[p](S(t,p)),{c(){de(e.$$.fragment),n=P(),l=m("div"),o=m("div"),r=m("button"),r.textContent="RS3",i=P(),a=m("button"),a.textContent="OSRS",c=P(),u=m("div"),d=m("button"),d.innerHTML='Change Theme',f=P(),b=m("button"),b.innerHTML='Settings',g=P(),y.c(),_(r,"class","mx-1 w-20 rounded-lg border-2 border-blue-500 p-2 duration-200 hover:opacity-75"),ue(r,"text-black",t[1].selected.game===ce.rs3),ue(r,"bg-blue-500",t[1].selected.game===ce.rs3),_(a,"class","mx-1 w-20 rounded-lg border-2 border-blue-500 bg-blue-500 p-2 text-black duration-200 hover:opacity-75"),ue(a,"text-black",t[1].selected.game===ce.osrs),ue(a,"bg-blue-500",t[1].selected.game===ce.osrs),_(o,"class","m-3 ml-9 font-bold"),_(d,"class","h-10 w-10 rounded-full bg-blue-500 text-center duration-200 hover:rotate-45 hover:opacity-75"),_(b,"class","h-10 w-10 rounded-full bg-blue-500 text-center duration-200 hover:rotate-45 hover:opacity-75"),_(u,"class","m-2 ml-auto flex gap-2"),_(l,"class","fixed top-0 flex h-16 w-screen border-b-2 border-slate-300 bg-slate-100 duration-200 dark:border-slate-800 dark:bg-slate-900")},m(C,T){ie(e,C,T),v(C,n,T),v(C,l,T),k(l,o),k(o,r),k(o,i),k(o,a),k(l,c),k(l,u),k(u,d),k(u,f),k(u,b),k(u,g),O[p].m(u,null),h=!0,L||($=[N(r,"click",t[6]),N(a,"click",t[7]),N(d,"click",t[8]),N(b,"click",t[9])],L=!0)},p(C,[T]){const j={};e.$set(j),(!h||T&2)&&ue(r,"text-black",C[1].selected.game===ce.rs3),(!h||T&2)&&ue(r,"bg-blue-500",C[1].selected.game===ce.rs3),(!h||T&2)&&ue(a,"text-black",C[1].selected.game===ce.osrs),(!h||T&2)&&ue(a,"bg-blue-500",C[1].selected.game===ce.osrs);let D=p;p=U(C),p===D?O[p].p(S(C,p),T):(nt(),W(O[D],1,1,()=>{O[D]=null}),st(),y=O[p],y?y.p(S(C,p),T):(y=O[p]=I[p](S(C,p)),y.c()),q(y,1),y.m(u,null))},i(C){h||(q(e.$$.fragment,C),q(y),h=!0)},o(C){W(e.$$.fragment,C),W(y),h=!1},d(C){C&&(w(n),w(l)),t[5](null),ae(e,C),O[p].d(),L=!1,re($)}}}function Nl(t,e,n){let l,o;const{config:r,sessions:i}=M;ke(t,r,p=>n(1,l=p)),ke(t,i,p=>n(2,o=p));let a;function c(p){Pe[p?"unshift":"push"](()=>{a=p,n(0,a)})}return[a,l,o,r,i,c,()=>{Re(r,l.selected.game=ce.rs3,l)},()=>{Re(r,l.selected.game=ce.osrs,l)},()=>Re(r,l.use_dark_theme=!l.use_dark_theme,l),()=>a.open(),()=>{const{origin:p,redirect:y,clientid:h}=R.env;Se.openLoginWindow(p,y,h)}]}class jl extends me{constructor(e){super(),he(this,e,Nl,xl,_e,{})}}function El(t){let e,n,l,o,r,i,a,c,u,d,f,b,g;return e=new is({}),l=new jl({}),c=new Zs({}),b=new el({props:{logs:t[0]}}),{c(){de(e.$$.fragment),n=P(),de(l.$$.fragment),o=P(),r=m("div"),i=m("div"),a=P(),de(c.$$.fragment),u=P(),d=m("div"),f=P(),de(b.$$.fragment),_(r,"class","mt-16 grid h-full grid-flow-col grid-cols-3")},m(p,y){ie(e,p,y),v(p,n,y),ie(l,p,y),v(p,o,y),v(p,r,y),k(r,i),k(r,a),ie(c,r,null),k(r,u),k(r,d),v(p,f,y),ie(b,p,y),g=!0},p(p,y){const h={};y&1&&(h.logs=p[0]),b.$set(h)},i(p){g||(q(e.$$.fragment,p),q(l.$$.fragment,p),q(c.$$.fragment,p),q(b.$$.fragment,p),g=!0)},o(p){W(e.$$.fragment,p),W(l.$$.fragment,p),W(c.$$.fragment,p),W(b.$$.fragment,p),g=!1},d(p){p&&(w(n),w(o),w(r),w(f)),ae(e,p),ae(l,p),ae(c),ae(b,p)}}}function Ml(t){let e,n,l,o;return e=new yn({props:{$$slots:{default:[El]},$$scope:{ctx:t}}}),{c(){de(e.$$.fragment)},m(r,i){ie(e,r,i),n=!0,l||(o=N(window,"beforeunload",t[2]),l=!0)},p(r,[i]){const a={};i&9&&(a.$$scope={dirty:i,ctx:r}),e.$set(a)},i(r){n||(q(e.$$.fragment,r),n=!0)},o(r){W(e.$$.fragment,r),n=!1},d(r){ae(e,r),l=!1,o()}}}function Al(t,e,n){let l;const o=A.logs;return ke(t,o,i=>n(0,l=i)),[l,o,()=>{ne.saveConfig(),R.hasBoltPlugins&&ne.savePluginConfig(!0)}]}class Dl extends me{constructor(e){super(),he(this,e,Al,Ml,_e,{})}}const hn={target:document.getElementById("app")};window.opener||window.location.search.includes("&id_token")?new ts(hn):(Bl(),Xn(),Fl(),ql().finally(()=>{M.initialized.set(!0)}),new Dl(hn));function Bl(){const t=new URLSearchParams(window.location.search);R.platform=t.get("platform"),R.isFlathub=t.get("flathub")==="1",R.hasLibArchive=t.get("has_libarchive")==="1",R.rs3debInstalledHash=t.get("rs3_deb_installed_hash"),R.rs3exeInstalledHash=t.get("rs3_exe_installed_hash"),R.rs3appInstalledHash=t.get("rs3_app_installed_hash"),R.osrsexeInstalledHash=t.get("osrs_exe_installed_hash"),R.osrsappInstalledHash=t.get("osrs_app_installed_hash"),R.runeLiteInstalledId=t.get("runelite_installed_id"),R.hdosInstalledVersion=t.get("hdos_installed_version");const e=t.get("plugins");if(R.hasBoltPlugins=e!==null,e!==null)try{R.pluginConfig=JSON.parse(e)}catch{A.error("Unable to parse plugin list")}const n=t.get("credentials");if(n)try{const l=JSON.parse(n),o=l.every(r=>typeof r.session_id=="string"&&typeof r.tokens=="object"&&typeof r.accounts=="object"&&typeof r.user=="object");o?M.sessions.set(l):(M.sessions.set([]),ne.saveCredentials(),A.warn("Credentials saved on disk are out of date. Please sign in again.")),M.sessions.set(o?l:[])}catch{M.sessions.set([]),ne.saveCredentials(),A.error("Unable to parse saved credentials. Please sign in again.")}}function Fl(){const{origin:t,origin_2fa:e}=R.env,n=[window.location.origin,t,e];let l=null;window.addEventListener("message",async o=>{var r;if(!n.includes(o.origin)){A.info(`discarding window message from origin ${o.origin}`);return}switch(o.data.type){case"authTokenUpdate":{l=o.data.tokens;break}case"authSessionUpdate":{if(l===null)return A.error("auth is null. Please try again.");const i=o.data.sessionId,a=await ne.login(l,i);a.ok?A.info(`Added new user '${a.value.user.displayName}'`):A.error(`Unable to add new user. Please try again. ${a.error}`),ne.saveCredentials(),Se.pendingLoginWindow=null,l=null;break}case"authFailed":{A.error(`Unable to authenticate: ${o.data.reason}`),Se.pendingLoginWindow=null,l=null;break}case"externalUrl":{const i=new XMLHttpRequest;i.onreadystatechange=()=>{i.readyState==4&&A.info(`External URL status: '${i.responseText.trim()}'`)},i.open("POST","/open-external-url",!0),i.send(o.data.url);break}case"gameClientList":ve(M.config).close_after_launch&&o.data.clients.length>ve(Ot).length?fetch("/close"):Ot.set(o.data.clients);break;default:{const i=((r=o.data)==null?void 0:r.type)??"no type provided";A.info(`Unknown message type: ${i}`);break}}})}async function ql(){const t=ve(M.config).discard_expired_sessions,e=ve(M.sessions),n=[];e.length>0&&A.info("Logging in...");const l=e.map(i=>({promise:Se.refreshOAuthToken(i.tokens),session:i})),o=[];for(const i of l){const a=i.session,c=await i.promise;if(!c.ok){c.error===0?A.error(`Unable to verify saved login, status: ${c.error}. Do you have an internet connection? Please relaunch Bolt to try again.`):c.error>=400&&c.error<500&&t?(A.error(`Discarding expired login, status: ${c.error}. Please sign in again.`),n.push(a.tokens.sub)):A.error(`Unable to verify saved login due to HTTP error ${c.error}`);continue}const u=c.value;a.tokens=u,o.push({promise:ne.login(u,a.session_id),session:a})}for(const i of o){const a=i.session,c=await i.promise;c.ok?A.info(`Signed into saved user '${c.value.user.displayName}'`):(A.error(`Unable to sign into saved user '${a.user.displayName}' due to an error: ${c.error}`),t&&n.push(a.tokens.sub))}const r=n.map(ne.logout);for(const i of r)await i;M.sessions.set(e),await ne.saveCredentials()} diff --git a/app/dist/assets/index-DZ9bIuuF.css b/app/dist/assets/index-DZ9bIuuF.css deleted file mode 100644 index 361de2f2..00000000 --- a/app/dist/assets/index-DZ9bIuuF.css +++ /dev/null @@ -1 +0,0 @@ -*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.bottom-0{bottom:0}.bottom-2{bottom:.5rem}.left-0{left:0}.left-\[2\%\]{left:2%}.right-3{right:.75rem}.right-4{right:1rem}.right-6{right:1.5rem}.top-0{top:0}.top-2{top:.5rem}.top-3{top:.75rem}.z-20{z-index:20}.col-span-3{grid-column:span 3 / span 3}.float-left{float:left}.m-0{margin:0}.m-1{margin:.25rem}.m-2{margin:.5rem}.m-3{margin:.75rem}.m-5{margin:1.25rem}.m-auto{margin:auto}.mx-1{margin-left:.25rem;margin-right:.25rem}.mx-auto{margin-left:auto;margin-right:auto}.mb-1{margin-bottom:.25rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.ml-2{margin-left:.5rem}.ml-9{margin-left:2.25rem}.ml-auto{margin-left:auto}.mr-2{margin-right:.5rem}.mt-1{margin-top:.25rem}.mt-16{margin-top:4rem}.mt-5{margin-top:1.25rem}.flex{display:flex}.grid{display:grid}.contents{display:contents}.aspect-square{aspect-ratio:1 / 1}.h-1\/4{height:25%}.h-10{height:2.5rem}.h-11{height:2.75rem}.h-16{height:4rem}.h-3\/4{height:75%}.h-4{height:1rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-60{height:15rem}.h-7{height:1.75rem}.h-\[28px\]{height:28px}.h-\[90\%\]{height:90%}.h-fit{height:fit-content}.h-full{height:100%}.h-screen{height:100vh}.max-h-\[90\%\]{max-height:90%}.w-1\/2{width:50%}.w-10{width:2.5rem}.w-20{width:5rem}.w-24{width:6rem}.w-3\/4{width:75%}.w-3\/5{width:60%}.w-4{width:1rem}.w-40{width:10rem}.w-48{width:12rem}.w-5{width:1.25rem}.w-52{width:13rem}.w-6{width:1.5rem}.w-60{width:15rem}.w-7{width:1.75rem}.w-9{width:2.25rem}.w-\[45\%\]{width:45%}.w-\[50\%\]{width:50%}.w-\[90\%\]{width:90%}.w-\[95\%\]{width:95%}.w-\[96\%\]{width:96%}.w-\[min\(144px\,_25\%\)\]{width:min(144px,25%)}.w-\[min\(180px\,_50\%\)\]{width:min(180px,50%)}.w-\[min\(280px\,_45\%\)\]{width:min(280px,45%)}.w-auto{width:auto}.w-fit{width:fit-content}.w-full{width:100%}.w-screen{width:100vw}.max-w-\[60\%\]{max-width:60%}.max-w-\[90\%\]{max-width:90%}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-pointer{cursor:pointer}.select-none{-webkit-user-select:none;user-select:none}.resize-x{resize:horizontal}.list-inside{list-style-position:inside}.list-disc{list-style-type:disc}.grid-flow-col{grid-auto-flow:column}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-center{justify-content:center}.gap-2{gap:.5rem}.gap-4{gap:1rem}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-3xl{border-radius:1.5rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.rounded-sm{border-radius:.125rem}.rounded-xl{border-radius:.75rem}.border-2{border-width:2px}.border-b-2{border-bottom-width:2px}.border-r-2{border-right-width:2px}.border-t-2{border-top-width:2px}.border-none{border-style:none}.border-black{--tw-border-opacity: 1;border-color:rgb(0 0 0 / var(--tw-border-opacity))}.border-blue-500{--tw-border-opacity: 1;border-color:rgb(59 130 246 / var(--tw-border-opacity))}.border-inherit{border-color:inherit}.border-slate-300{--tw-border-opacity: 1;border-color:rgb(203 213 225 / var(--tw-border-opacity))}.border-t-slate-300{--tw-border-opacity: 1;border-top-color:rgb(203 213 225 / var(--tw-border-opacity))}.bg-blue-400{--tw-bg-opacity: 1;background-color:rgb(96 165 250 / var(--tw-bg-opacity))}.bg-blue-500{--tw-bg-opacity: 1;background-color:rgb(59 130 246 / var(--tw-bg-opacity))}.bg-emerald-500{--tw-bg-opacity: 1;background-color:rgb(16 185 129 / var(--tw-bg-opacity))}.bg-inherit{background-color:inherit}.bg-pink-500{--tw-bg-opacity: 1;background-color:rgb(236 72 153 / var(--tw-bg-opacity))}.bg-rose-500{--tw-bg-opacity: 1;background-color:rgb(244 63 94 / var(--tw-bg-opacity))}.bg-slate-100{--tw-bg-opacity: 1;background-color:rgb(241 245 249 / var(--tw-bg-opacity))}.bg-transparent{background-color:transparent}.bg-violet-500{--tw-bg-opacity: 1;background-color:rgb(139 92 246 / var(--tw-bg-opacity))}.bg-gradient-to-br{background-image:linear-gradient(to bottom right,var(--tw-gradient-stops))}.from-rose-500{--tw-gradient-from: #f43f5e var(--tw-gradient-from-position);--tw-gradient-to: rgb(244 63 94 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.to-violet-500{--tw-gradient-to: #8b5cf6 var(--tw-gradient-to-position)}.p-0{padding:0}.p-1{padding:.25rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-5{padding:1.25rem}.p-\[2px\]{padding:2px}.p-\[3px\]{padding:3px}.px-2{padding-left:.5rem;padding-right:.5rem}.px-5{padding-left:1.25rem;padding-right:1.25rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.pb-4{padding-bottom:1rem}.pb-5{padding-bottom:1.25rem}.pl-5{padding-left:1.25rem}.pt-1{padding-top:.25rem}.pt-10{padding-top:2.5rem}.pt-2{padding-top:.5rem}.pt-5{padding-top:1.25rem}.text-center{text-align:center}.align-middle{vertical-align:middle}.align-bottom{vertical-align:bottom}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-\[20px\]{font-size:20px}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-extrabold{font-weight:800}.italic{font-style:italic}.text-black{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity))}.text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity))}.text-inherit{color:inherit}.text-orange-700{--tw-text-opacity: 1;color:rgb(194 65 12 / var(--tw-text-opacity))}.text-red-500{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity))}.text-rose-500{--tw-text-opacity: 1;color:rgb(244 63 94 / var(--tw-text-opacity))}.text-slate-600{--tw-text-opacity: 1;color:rgb(71 85 105 / var(--tw-text-opacity))}.text-slate-900{--tw-text-opacity: 1;color:rgb(15 23 42 / var(--tw-text-opacity))}.text-slate-950{--tw-text-opacity: 1;color:rgb(2 6 23 / var(--tw-text-opacity))}.underline{text-decoration-line:underline}.opacity-25{opacity:.25}.shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.duration-200{transition-duration:.2s}.marker\:text-blue-500 *::marker{color:#3b82f6}.marker\:text-blue-500::marker{color:#3b82f6}.backdrop\:cursor-pointer::backdrop{cursor:pointer}.backdrop\:bg-black\/75::backdrop{background-color:#000000bf}.backdrop\:backdrop-blur-sm::backdrop{--tw-backdrop-blur: blur(4px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.hover\:rotate-45:hover{--tw-rotate: 45deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\:rotate-90:hover{--tw-rotate: 90deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\:opacity-75:hover{opacity:.75}.focus-visible\:outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.enabled\:bg-blue-500:enabled{--tw-bg-opacity: 1;background-color:rgb(59 130 246 / var(--tw-bg-opacity))}.enabled\:bg-rose-500:enabled{--tw-bg-opacity: 1;background-color:rgb(244 63 94 / var(--tw-bg-opacity))}.enabled\:hover\:opacity-75:hover:enabled{opacity:.75}.disabled\:bg-gray-500:disabled{--tw-bg-opacity: 1;background-color:rgb(107 114 128 / var(--tw-bg-opacity))}.disabled\:opacity-50:disabled{opacity:.5}@media (min-width: 640px){.sm\:text-sm{font-size:.875rem;line-height:1.25rem}}@media (min-width: 768px){.md\:text-base{font-size:1rem;line-height:1.5rem}}.dark\:border-slate-700:where(.dark,.dark *){--tw-border-opacity: 1;border-color:rgb(51 65 85 / var(--tw-border-opacity))}.dark\:border-slate-800:where(.dark,.dark *){--tw-border-opacity: 1;border-color:rgb(30 41 59 / var(--tw-border-opacity))}.dark\:border-t-slate-800:where(.dark,.dark *){--tw-border-opacity: 1;border-top-color:rgb(30 41 59 / var(--tw-border-opacity))}.dark\:bg-slate-900:where(.dark,.dark *){--tw-bg-opacity: 1;background-color:rgb(15 23 42 / var(--tw-bg-opacity))}.dark\:text-slate-50:where(.dark,.dark *){--tw-text-opacity: 1;color:rgb(248 250 252 / var(--tw-text-opacity))}.dark\:text-white:where(.dark,.dark *){--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.backdrop.svelte-csux1e::backdrop{background-color:#000000bf;--tw-backdrop-blur:blur(4px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.backdrop.svelte-csux1e:where(.dark,.dark *){--tw-bg-opacity:1;background-color:rgb(15 23 42 / var(--tw-bg-opacity))}.dropdown-color.svelte-xifudk{--tw-border-opacity:1;border-color:rgb(203 213 225 / var(--tw-border-opacity));--tw-bg-opacity:1;background-color:rgb(241 245 249 / var(--tw-bg-opacity));padding:.75rem;--tw-shadow:0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.dropdown-color.svelte-xifudk:where(.dark,.dark *){--tw-border-opacity:1;border-color:rgb(30 41 59 / var(--tw-border-opacity));--tw-bg-opacity:1;background-color:rgb(15 23 42 / var(--tw-bg-opacity))}.top.svelte-xifudk{bottom:100%;margin-bottom:.25rem}.bottom.svelte-xifudk{top:100%;margin-top:.25rem}.top.start.svelte-xifudk,.bottom.start.svelte-xifudk{left:0}.top.center.svelte-xifudk,.bottom.center.svelte-xifudk{left:50%;transform:translate(-50%)}.top.end.svelte-xifudk,.bottom.end.svelte-xifudk{right:0}.left.svelte-xifudk{right:100%;margin-right:.25rem}.right.svelte-xifudk{left:100%;margin-left:.25rem}.left.start.svelte-xifudk,.right.start.svelte-xifudk{top:0}.left.center.svelte-xifudk,.right.center.svelte-xifudk{top:50%;transform:translateY(-50%)}.left.end.svelte-xifudk,.right.end.svelte-xifudk{bottom:0} diff --git a/app/dist/index.html b/app/dist/index.html deleted file mode 100644 index c83aa4b1..00000000 --- a/app/dist/index.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - Bolt Launcher - - - - -
- - diff --git a/app/dist/svgs/check-solid.svg b/app/dist/svgs/check-solid.svg deleted file mode 100644 index 8ef9d629..00000000 --- a/app/dist/svgs/check-solid.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/app/dist/svgs/circle-info-solid.svg b/app/dist/svgs/circle-info-solid.svg deleted file mode 100644 index e7359e7c..00000000 --- a/app/dist/svgs/circle-info-solid.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/app/dist/svgs/circle-notch-solid.svg b/app/dist/svgs/circle-notch-solid.svg deleted file mode 100644 index 98b6dcfd..00000000 --- a/app/dist/svgs/circle-notch-solid.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/app/dist/svgs/database-solid.svg b/app/dist/svgs/database-solid.svg deleted file mode 100644 index 92a64d00..00000000 --- a/app/dist/svgs/database-solid.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/app/dist/svgs/download-solid.svg b/app/dist/svgs/download-solid.svg deleted file mode 100644 index 08469e7d..00000000 --- a/app/dist/svgs/download-solid.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/app/dist/svgs/folder-solid.svg b/app/dist/svgs/folder-solid.svg deleted file mode 100644 index 4253902c..00000000 --- a/app/dist/svgs/folder-solid.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/app/dist/svgs/gear-solid.svg b/app/dist/svgs/gear-solid.svg deleted file mode 100644 index f2baa1b7..00000000 --- a/app/dist/svgs/gear-solid.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/app/dist/svgs/lightbulb-solid.svg b/app/dist/svgs/lightbulb-solid.svg deleted file mode 100644 index 206be7de..00000000 --- a/app/dist/svgs/lightbulb-solid.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/app/dist/svgs/rocket-solid.svg b/app/dist/svgs/rocket-solid.svg deleted file mode 100644 index 28b4682e..00000000 --- a/app/dist/svgs/rocket-solid.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/app/dist/svgs/svelte.svg b/app/dist/svgs/svelte.svg deleted file mode 100644 index c5e08481..00000000 --- a/app/dist/svgs/svelte.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/app/dist/svgs/user-solid.svg b/app/dist/svgs/user-solid.svg deleted file mode 100644 index 30cbd7d3..00000000 --- a/app/dist/svgs/user-solid.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/app/dist/svgs/vite.svg b/app/dist/svgs/vite.svg deleted file mode 100644 index e7b8dfb1..00000000 --- a/app/dist/svgs/vite.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/app/dist/svgs/wrench-solid.svg b/app/dist/svgs/wrench-solid.svg deleted file mode 100644 index bc023c4c..00000000 --- a/app/dist/svgs/wrench-solid.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/app/dist/svgs/xmark-solid.svg b/app/dist/svgs/xmark-solid.svg deleted file mode 100644 index 64f147d9..00000000 --- a/app/dist/svgs/xmark-solid.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file From ff72282b6c820054314e1bac6b8afd56a9afded6 Mon Sep 17 00:00:00 2001 From: Michael <91761269+natural-stupidity@users.noreply.github.com> Date: Fri, 12 Sep 2025 22:41:21 -0400 Subject: [PATCH 2/8] repo: updated gitignore --- .gitignore | 3 ++- app/.gitignore | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index fd288b64..c27e30cf 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ .cache -.vscode/settings.json +.vscode +build DawnCache GPUCache diff --git a/app/.gitignore b/app/.gitignore index 944a1ecb..17e558e9 100644 --- a/app/.gitignore +++ b/app/.gitignore @@ -8,11 +8,12 @@ pnpm-debug.log* lerna-debug.log* node_modules +dist dist-ssr *.local # Editor directories and files -.vscode/settings.json +.vscode .idea .DS_Store *.suo From fd72310cda560c77982837d9837a3ed70e68b965 Mon Sep 17 00:00:00 2001 From: Michael <91761269+natural-stupidity@users.noreply.github.com> Date: Fri, 12 Sep 2025 23:10:13 -0400 Subject: [PATCH 3/8] app: upgrade to svelte 5 --- CMakeLists.txt | 3 + app/package.json | 16 +-- app/src/BoltApp.svelte | 4 +- .../Components/AccountDropdownContent.svelte | 4 +- .../lib/Components/CommonUI/Dropdown.svelte | 32 ++++-- app/src/lib/Components/CommonUI/Modal.svelte | 38 ++++--- app/src/lib/Components/Launch.svelte | 24 ++--- app/src/lib/Components/LogView.svelte | 6 +- app/src/lib/Components/MainLayout.svelte | 9 +- .../{ => Modals}/DisclaimerModal.svelte | 2 +- .../{ => Modals}/LaunchConfirmModal.svelte | 4 +- .../{ => Modals}/PluginModal.svelte | 102 +++++++++--------- .../{ => Modals}/SettingsModal.svelte | 6 +- .../Settings/GeneralSettingsTab.svelte | 2 +- .../Settings/OsrsSettingsTab.svelte | 22 ++-- .../Components/Settings/Rs3SettingsTab.svelte | 4 +- app/src/lib/Components/TopBar.svelte | 20 ++-- app/src/lib/Util/functions.ts | 1 + app/src/main.ts | 5 +- app/svelte.config.js | 2 +- 20 files changed, 174 insertions(+), 132 deletions(-) rename app/src/lib/Components/{ => Modals}/DisclaimerModal.svelte (93%) rename app/src/lib/Components/{ => Modals}/LaunchConfirmModal.svelte (96%) rename app/src/lib/Components/{ => Modals}/PluginModal.svelte (91%) rename app/src/lib/Components/{ => Modals}/SettingsModal.svelte (96%) diff --git a/CMakeLists.txt b/CMakeLists.txt index a44f5274..ecadcb82 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -353,6 +353,9 @@ if(NOT WIN32) "export XDG_DATA_DIRS=${CMAKE_CURRENT_BINARY_DIR}/${BOLT_SHAREDIR}\${XDG_DATA_DIRS:+:\${XDG_DATA_DIRS}}" "export XDG_CONFIG_HOME=${CMAKE_CURRENT_BINARY_DIR}/config" "export XDG_DATA_HOME=${CMAKE_CURRENT_BINARY_DIR}/data" + "cd app" + "bun run build" + "cd .." "cd ${CMAKE_CURRENT_BINARY_DIR}/${BOLT_CEF_INSTALLDIR}/bolt-launcher" "exec ./bolt \"$@\"" "" diff --git a/app/package.json b/app/package.json index 810b6bdf..a02f2513 100644 --- a/app/package.json +++ b/app/package.json @@ -2,25 +2,25 @@ "name": "vite_app", "version": "0.0.0", "devDependencies": { - "@sveltejs/vite-plugin-svelte": "^3.0.2", + "@sveltejs/vite-plugin-svelte": "^6.2.0", "@tsconfig/svelte": "^5.0.2", "autoprefixer": "^10.4.19", "eslint": "^8.57.0", "eslint-config-prettier": "^9.1.0", - "eslint-plugin-svelte": "^2.35.1", + "eslint-plugin-svelte": "^2.45.1", "postcss": "^8.4.38", "prettier": "^3.1.1", - "prettier-plugin-svelte": "^3.1.2", + "prettier-plugin-svelte": "^3.2.6", "prettier-plugin-tailwindcss": "^0.5.13", - "svelte": "^4.2.12", - "svelte-check": "^3.6.7", + "svelte": "^5.0.0", + "svelte-check": "^4.0.0", "tailwindcss": "^3.4.4", "tslib": "^2.6.2", - "typescript": "^5.4.3", + "typescript": "^5.5.0", "typescript-eslint": "^7.4.0", - "vite": "^5.2.0", + "vite": "^7.1.5", "vite-tsconfig-paths": "^4.3.2", - "vitest": "^1.2.0" + "vitest": "^3.2.4" }, "private": true, "scripts": { diff --git a/app/src/BoltApp.svelte b/app/src/BoltApp.svelte index 6d50d2fc..3e5c9ad7 100644 --- a/app/src/BoltApp.svelte +++ b/app/src/BoltApp.svelte @@ -1,5 +1,5 @@ { + onbeforeunload={() => { BoltService.saveConfig(); if (bolt.hasBoltPlugins) BoltService.savePluginConfig(true); }} diff --git a/app/src/lib/Components/AccountDropdownContent.svelte b/app/src/lib/Components/AccountDropdownContent.svelte index 8c175f56..0f3b606b 100644 --- a/app/src/lib/Components/AccountDropdownContent.svelte +++ b/app/src/lib/Components/AccountDropdownContent.svelte @@ -21,7 +21,7 @@
+
+ {#if isOpen} {/if}
diff --git a/app/src/lib/Components/CommonUI/Modal.svelte b/app/src/lib/Components/CommonUI/Modal.svelte index dc7a0080..6eced34e 100644 --- a/app/src/lib/Components/CommonUI/Modal.svelte +++ b/app/src/lib/Components/CommonUI/Modal.svelte @@ -1,13 +1,24 @@ - { + onkeydown={(e) => { if (e.key !== 'Escape') return; e.preventDefault(); if (canSelfClose) close(); }} - on:mousedown|self={() => { - if (canSelfClose) close(); + onmousedown={(e: MouseEvent) => { + if (dialog === (e.target as Node)) close(); }} - class:backdrop:cursor-pointer={canSelfClose} + class:dark={darkTheme} class="{className} backdrop max-h-[90%] max-w-[90%] overflow-auto rounded-xl text-inherit focus-visible:outline-none" > {#if canSelfClose} {/if} {#if isOpen} - + {@render children?.()} {/if} diff --git a/app/src/lib/Components/Launch.svelte b/app/src/lib/Components/Launch.svelte index b4a4dded..35272457 100644 --- a/app/src/lib/Components/Launch.svelte +++ b/app/src/lib/Components/Launch.svelte @@ -1,5 +1,4 @@ -{#if bolt.hasBoltPlugins} - -{/if} +
{#if $psa} @@ -120,7 +118,7 @@ modal.close()}>I Understand diff --git a/app/src/lib/Components/LaunchConfirmModal.svelte b/app/src/lib/Components/Modals/LaunchConfirmModal.svelte similarity index 96% rename from app/src/lib/Components/LaunchConfirmModal.svelte rename to app/src/lib/Components/Modals/LaunchConfirmModal.svelte index 63a343b1..4731b9fe 100644 --- a/app/src/lib/Components/LaunchConfirmModal.svelte +++ b/app/src/lib/Components/Modals/LaunchConfirmModal.svelte @@ -22,13 +22,13 @@
{ disableButtons = true; var xml = new XMLHttpRequest(); @@ -195,11 +195,6 @@ // get connected client list requestNewClientListPromise(); - $: { - if (!$clientList.some((x) => x.uid === selectedClientId)) { - isClientSelected = false; - } - } // function to start a plugin const startPlugin = (client: number, id: string, path: string | null, main: string) => { @@ -325,44 +320,51 @@ }; // plugin management interface - currently-selected plugin - var selectedPlugin: string; - $: selectedPluginMeta = bolt.pluginConfig[selectedPlugin]; - $: selectedPluginPath = selectedPluginMeta ? selectedPluginMeta.path : null; - $: managementPluginPromise = getPluginConfigPromiseFromID(selectedPlugin); - $: if (managementPluginPromise) { - managementPluginPromise.then((x) => { - // if the name in bolt.json has been changed, update it in the PluginMeta and our plugin config file - let dirty = false; - if (x.name !== selectedPluginMeta.name) { - selectedPluginMeta.name = x.name; - dirty = true; - } - if (x.version !== selectedPluginMeta.version) { - selectedPluginMeta.version = x.version; - dirty = true; - } - if (dirty) { - selectedPluginMeta = selectedPluginMeta; - GlobalState.pluginConfigHasPendingChanges = true; - } - }); - } + var selectedPlugin: string = $state(''); const openAboutPlugins = () => fetch('/open-external-url', { method: 'POST', body: 'https://bolt.adamcake.com/plugins' }); // connected clients list - var isClientSelected: boolean = false; - var selectedClientId: number; + var isClientSelected: boolean = $state(false); + var selectedClientId: number = $state(0); - let showURLEntry: boolean = false; - let textURLEntry: string; + let showURLEntry: boolean = $state(false); + let textURLEntry: string = $state(''); + $effect(() => { + if (!$clientList.some((x) => x.uid === selectedClientId)) { + isClientSelected = false; + } + }); + let selectedPluginMeta = $derived(bolt.pluginConfig[selectedPlugin]); + let managementPluginPromise = $derived(getPluginConfigPromiseFromID(selectedPlugin)); + $effect(() => { + if (managementPluginPromise) { + managementPluginPromise.then((x) => { + // if the name in bolt.json has been changed, update it in the PluginMeta and our plugin config file + let dirty = false; + if (x.name !== selectedPluginMeta.name) { + selectedPluginMeta.name = x.name; + dirty = true; + } + if (x.version !== selectedPluginMeta.version) { + selectedPluginMeta.version = x.version; + dirty = true; + } + if (dirty) { + selectedPluginMeta = selectedPluginMeta; + GlobalState.pluginConfigHasPendingChanges = true; + } + }); + } + }); + let selectedPluginPath = $derived(selectedPluginMeta ? selectedPluginMeta.path : null); BoltService.savePluginConfig(true)} + onClose={() => BoltService.savePluginConfig(true)} >
(isClientSelected = false)} + onclick={() => (isClientSelected = false)} > Manage Plugins @@ -381,7 +383,7 @@ {:else} {#each $clientList as client}

',1),hi=L('
',1),gi=L('


',1),mi=L("

error


",1),bi=L("

loading...

"),wi=(e,t)=>fetch("/browse-plugin-config?".concat(new URLSearchParams({id:K(t)}).toString())),yi=(e,t,n,r)=>t(p(n),K(r)),ki=L('  ',1),xi=L('  
',1),Si=L(`

You have no plugins installed. You can install plugins either from an updater URL, or by - downloading them onto your computer and selecting the "bolt.json" file.

`),$i=L('
',1),Ci=(e,t,n,r,a,o,i)=>t(K(n),K(r),p(a)??null,p(o).main??i),Ei=L(''),Li=L("

(no plugins installed)

"),Pi=L("

can't start plugin: does not appear to be configured

"),Ri=(e,t,n,r)=>{t(K(n),p(r).uid)},Ti=L('

'),Ii=L("

"),Oi=L('


',1),Ai=L("

error

"),Ui=L("

loading...

"),Ni=L("
",1),Hi=L(' ',1),Mi=L("

error

"),Di=L('

'),ji=L("

"),Fi=L("

",1),Bi=L('

',1);function qi(e,t){ye(t,!0);const n=()=>he(Pr,"$clientList",r),[r,a]=ze();let o,i=se(null),u=se(!1);const l=k.platform==="windows"?"\\":"/",c="bolt.json",f=l.concat(c),d="main.lua";function h(){R(Ce,!1),o.open()}const _=m=>{console.log(m),R(i,m,!0),R(u,!1)},v=m=>{console.error(m),R(i,m,!0),R(u,!0)},g=m=>new Promise((E,N)=>{const W=m.concat(m.endsWith(l)?c:f);var I=new XMLHttpRequest;I.onreadystatechange=()=>{I.readyState==4&&(I.status==200?E(JSON.parse(I.responseText)):N(I.responseText))},I.open("GET","/read-json-file?".concat(new URLSearchParams({path:W}).toString()),!0),I.send()}),b=m=>fetch("/get-plugindir-json?".concat(new URLSearchParams({id:m}).toString())).then(E=>E.ok?E.json():null),x=m=>{const N=k.pluginConfig[m];if(!N)return null;const W=N.path;return W?g(W):b(m)},y=()=>{const m=Object.keys(k.pluginConfig);let E;do E=crypto.randomUUID();while(m.includes(E));return E},U="(unnamed)",M="(new character)",j=(m,E)=>{g(m).then(N=>{R(D,y(),!0),k.pluginConfig[K(D)]={name:N.name??U,path:m,version:N.version},O.pluginConfigHasPendingChanges=!0}).catch(N=>v(`config file '${E}' couldn't be fetched, reason: ${N}`))},$=m=>{_("downloading..."),fetch(m).then(async E=>{if(!E.ok){v(`can't install plugin: updater URL returned ${E.status}: ${E.statusText}`);return}const N=await E.json();if(N.url){const W=await fetch(N.url);if(!W.ok){v(`can't install plugin: remote download URL returned ${E.status}: ${E.statusText}`);return}const I=await W.arrayBuffer();if(N.sha256){const Je=await crypto.subtle.digest("SHA-256",I),qt=Array.from(new Uint8Array(Je)).map(vn=>vn.toString(16).padStart(2,"0")).join("");if(N.sha256!==qt){v("can't install plugin: incorrect file hash");return}}const J=y();if(!(await fetch("/install-plugin?".concat(new URLSearchParams({id:J}).toString()),{method:"POST",body:I})).ok){v(`can't install plugin: ${E.statusText}`);return}const _e=await b(J);_e?(R(D,J,!0),k.pluginConfig[K(D)]={name:_e.name??U,version:_e.version,updaterURL:m,sha256:N.sha256},O.pluginConfigHasPendingChanges=!0,_(`plugin '${_e.name}' installed`)):v(`can't install plugin: ${c} not found`)}}).catch(()=>{v("can't install plugin: unhandled exception")})};let C=se(!1);const H=()=>{R(C,!0);var m=new XMLHttpRequest;m.onreadystatechange=()=>{if(m.readyState==4&&(R(C,!1),m.status==200))if(m.responseText.endsWith(f)){const E=m.responseText.substring(0,m.responseText.length-c.length);j(E,m.responseText)}else v(`selection '${m.responseText}' is not named ${c}; ignored`)},m.open("GET","/json-file-picker",!0),m.send()};mr();const F=(m,E,N,W)=>{let I=null;if(N){const Y=k.platform==="windows"?N.replaceAll("\\","/"):N;I=Y.endsWith(l)?Y:Y.concat("/")}var J=new XMLHttpRequest;J.onreadystatechange=()=>{J.readyState==4&&(mr(),A.info(`Start-plugin status: ${J.statusText.trim()}`))},I?J.open("GET","/start-plugin?".concat(new URLSearchParams({client:m.toString(),id:E,main:W,path:I}).toString()),!0):J.open("GET","/start-plugin?".concat(new URLSearchParams({client:m.toString(),id:E,main:W}).toString()),!0),J.send()},ue=(m,E)=>{var N=new XMLHttpRequest;N.onreadystatechange=()=>{N.readyState==4&&(mr(),A.info(`Stop-plugin status: ${N.statusText.trim()}`))},N.open("GET","/stop-plugin?".concat(new URLSearchParams({client:m.toString(),uid:E.toString()}).toString()),!0),N.send()},te=(m,E)=>{const N=m.updaterURL;fetch(N).then(async W=>{if(!W.ok){v(`can't update plugin: updater URL returned ${W.status}: ${W.statusText}`);return}let I=await W.json();if(!I.url){_(`can't update plugin '${m.name}': no remote download URL is configured`);return}let J=!1;if(I.sha256?m.sha256!==I.sha256&&(J=!0):I.version&&m.version!==I.version&&(J=!0),J){const Y=await fetch(I.url);if(!Y.ok){v(`can't update plugin: remote download URL returned ${Y.status}: ${Y.statusText}`);return}const _e=await Y.arrayBuffer();if(I.sha256){const qt=await crypto.subtle.digest("SHA-256",_e),vn=Array.from(new Uint8Array(qt)).map(nr=>nr.toString(16).padStart(2,"0")).join("");if(I.sha256!==vn){v(`can't update plugin '${m.name}': incorrect file hash`);return}}fetch("/install-plugin?".concat(new URLSearchParams({id:E}).toString()),{method:"POST",body:_e});const Je=await b(E);Je?(I.sha256&&(m.sha256=I.sha256),Je.name&&(m.name=Je.name),Je.version&&(m.version=Je.version),O.pluginConfigHasPendingChanges=!0,_(`plugin '${Je.name}' updated`)):v(`can't update plugin '${m.name}': ${c} not found`)}else _(`plugin '${m.name}' is already up-to-date`)})};var D=se(""),oe=se(!1),Me=se(0);let Ce=se(!1),ce=se("");on(()=>{n().some(m=>m.uid===K(Me))||R(oe,!1)});let ge=Be(()=>k.pluginConfig[K(D)]),rt=Be(()=>x(K(D)));on(()=>{p(rt)&&p(rt).then(m=>{let E=!1;m.name!==p(ge).name&&(p(ge).name=m.name,E=!0),m.version!==p(ge).version&&(p(ge).version=m.version,E=!0),E&&(R(ge,p(ge)),O.pluginConfigHasPendingChanges=!0)})});let Cn=Be(()=>p(ge)?p(ge).path:null);var tr={open:h};gt(Qn(e,{class:"h-[90%] w-[90%] text-center",onClose:()=>ee.savePluginConfig(!0),children:(m,E)=>{var N=Bi(),W=G(N),I=P(W);I.__click=[oi,oe];var J=w(I,4);{var Y=ve=>{var De=ii();S(ve,De)},_e=ve=>{var De=ot(),bt=G(De);$t(bt,1,n,Ut,(pn,Tt)=>{var Xe=ui(),ne=G(Xe);ne.__click=[li,Me,Tt,oe,Ce,ce,i];var Ie=P(ne);V(()=>{Te(ne,1,`m-1 h-[28px] w-[95%] select-none rounded-lg border-2 ${K(oe)&&K(Me)===p(Tt).uid?"border-black bg-blue-500 text-black":"border-blue-500 text-black dark:text-white"} hover:opacity-75`),me(Ie,p(Tt).identity||M)}),S(pn,Xe)}),S(ve,De)};X(J,ve=>{n().length==0?ve(Y):ve(_e,!1)})}var Je=w(W,2),qt=P(Je);{var vn=ve=>{var De=Hi(),bt=G(De);bt.__change=[ci,i],$t(bt,21,()=>Object.entries(k.pluginConfig),Ut,(ne,Ie)=>{var It=Be(()=>ga(p(Ie),2));let je=()=>p(It)[0],Oe=()=>p(It)[1];var st=fi(),Wt=P(st),Gt={};V(()=>{me(Wt,Oe().name??U),Gt!==(Gt=je())&&(st.value=(st.__value=je())??"")}),S(ne,st)});var pn=w(bt,2);{var Tt=ne=>{var Ie=$i(),It=G(Ie),je=P(It);je.__click=[di,Ce,ce];var Oe=w(je,2);Oe.__click=H;var st=w(It,4);{var Wt=ie=>{var pe=pi(),Ye=w(G(pe),2),wt=w(Ye,2);wt.__click=[_i,$,ce,Ce];var ut=w(wt,2);ut.__click=[vi,Ce,ce],Nt(Ye,()=>p(ce),xe=>R(ce,xe)),S(ie,pe)};X(st,ie=>{p(Ce)&&ie(Wt)})}var Gt=w(st,2);{var rr=ie=>{var pe=ot(),Ye=G(pe);{var wt=ut=>{var xe=xi(),ct=G(xe);os(ct,()=>p(rt),fe=>{var de=bi();S(fe,de)},(fe,de)=>{var Ze=gi(),kt=G(Ze),Ot=P(kt),or=w(Ot);{var oa=ir=>{var Jr=hi(),la=w(G(Jr),2),ua=P(la);V(()=>me(ua,`v${p(de).version??""}`)),S(ir,Jr)};X(or,ir=>{p(de).version&&ir(oa)})}var zr=w(kt,2),ia=P(zr);V(()=>{me(Ot,`${p(de).name??U??""} `),Te(zr,1,An(p(de).description?null:"italic")),me(ia,p(de).description??"no description")}),S(fe,Ze)},fe=>{var de=mi();S(fe,de)});var En=w(ct,2);En.__click=()=>{const fe=k.pluginConfig[K(D)].path;fetch(fe?"/browse-directory?".concat(new URLSearchParams({path:fe}).toString()):"/browse-plugin-data?".concat(new URLSearchParams({id:K(D)}).toString()))};var Ln=w(En,2);Ln.__click=[wi,D];var yt=w(Ln,4);{var Pn=fe=>{var de=ki(),Ze=G(de);Ze.__click=[yi,te,ge,D],S(fe,de)};X(yt,fe=>{p(ge).updaterURL&&fe(Pn)})}var ar=w(yt,2);ar.__click=()=>{R(rt,null),O.pluginConfigHasPendingChanges=!0;let fe=k.pluginConfig;const de=fe[K(D)];de&&(fetch("/uninstall-plugin?".concat(new URLSearchParams({id:K(D),delete_data_dir:typeof de.path=="string"?"0":"1"}).toString())),_(`plugin '${de.name}' uninstalled`),delete fe[K(D)],k.pluginConfig=fe)},S(ut,xe)};X(Ye,ut=>{Object.keys(k.pluginConfig).includes(K(D))&&p(rt)!==null&&ut(wt)})}S(ie,pe)},sr=ie=>{var pe=Si();S(ie,pe)};X(Gt,ie=>{Object.entries(k.pluginConfig).length!==0?ie(rr):ie(sr,!1)})}V(()=>{je.disabled=!k.hasLibArchive||p(C),Oe.disabled=p(C)}),S(ne,Ie)},Xe=ne=>{var Ie=Ni(),It=w(G(Ie),2);os(It,()=>p(rt),je=>{var Oe=Ui();S(je,Oe)},(je,Oe)=>{var st=Oi(),Wt=G(st);{var Gt=ie=>{var pe=Ei();pe.__click=[Ci,F,Me,D,Cn,Oe,d];var Ye=P(pe);V(()=>me(Ye,`Start ${p(Oe).name??""}`)),S(ie,pe)},rr=ie=>{var pe=ot(),Ye=G(pe);{var wt=xe=>{var ct=Li();S(xe,ct)},ut=xe=>{var ct=Pi();S(xe,ct)};X(Ye,xe=>{Object.entries(k.pluginConfig).length===0?xe(wt):xe(ut,!1)},!0)}S(ie,pe)};X(Wt,ie=>{p(Oe)&&p(Oe).main&&Object.keys(k.pluginConfig).includes(K(D))?ie(Gt):ie(rr,!1)})}var sr=w(Wt,8);$t(sr,1,n,Ut,(ie,pe)=>{var Ye=ot(),wt=G(Ye);{var ut=xe=>{var ct=ot(),En=G(ct);$t(En,17,()=>p(pe).plugins,Ut,(Ln,yt)=>{var Pn=ot(),ar=G(Pn);{var fe=Ze=>{var kt=Ti(),Ot=P(kt),or=w(Ot);or.__click=[Ri,ue,Me,yt],V(()=>me(Ot,`${k.pluginConfig[p(yt).id].name??p(yt).id??""} `)),S(Ze,kt)},de=Ze=>{var kt=Ii(),Ot=P(kt);V(()=>me(Ot,p(yt).id)),S(Ze,kt)};X(ar,Ze=>{Object.keys(k.pluginConfig).includes(p(yt).id)?Ze(fe):Ze(de,!1)})}S(Ln,Pn)}),S(xe,ct)};X(wt,xe=>{p(pe).uid===K(Me)&&xe(ut)})}S(ie,Ye)}),S(je,st)},je=>{var Oe=Ai();S(je,Oe)}),S(ne,Ie)};X(pn,ne=>{K(oe)?ne(Xe,!1):ne(Tt)})}Wr(bt,()=>K(D),ne=>R(D,ne)),S(ve,De)},nr=ve=>{var De=Mi();S(ve,De)};X(qt,ve=>{k.hasBoltPlugins?ve(vn):ve(nr,!1)})}var na=w(qt,2);{var ra=ve=>{var De=Fi(),bt=w(G(De),3);{var pn=Xe=>{var ne=Di(),Ie=P(ne);V(()=>me(Ie,`[error] ${p(i)??""}`)),S(Xe,ne)},Tt=Xe=>{var ne=ji(),Ie=P(ne);V(()=>me(Ie,`[info] ${p(i)??""}`)),S(Xe,ne)};X(bt,Xe=>{p(u)?Xe(pn):Xe(Tt,!1)})}S(ve,De)};X(na,ve=>{p(i)&&ve(ra)})}var sa=w(Je,2),aa=P(sa);aa.__click=[ai],V(()=>Te(I,1,`mx-auto mb-2 w-[95%] select-none rounded-lg border-2 ${K(oe)?"border-blue-500 text-black dark:text-white":"border-black bg-blue-500 text-black"} p-2 font-bold hover:opacity-75`)),S(m,N)},$$slots:{default:!0}}),m=>o=m,()=>o);var z=ke(tr);return a(),z}nt(["click","change"]);var Wi=L('
'),Gi=L(''),Vi=L(''),zi=L(''),Ji=L(''),Xi=L(''),Yi=L('
Launch icon
',1);function Zi(e,t){ye(t,!0);const n=()=>he(f,"$config",i),r=()=>he(g,"$psa",i),a=()=>he(b,"$gameEnabled",i),o=()=>he(d,"$initialized",i),[i,u]=ze();let l,c,{config:f,initialized:d}=O,h=Be(()=>n().selected.user_id),_=Be(()=>n().userDetails[p(h)??""]?.account_id),v=Be(()=>ee.findSession(n().selected.user_id)?.accounts??[]),g=Dt(null),b=Dt(!0);on(()=>{if(n().check_announcements){const z=n().selected.game==Ee.osrs?"osrs":k.env.provider,m=`${k.env.psa_url}${z}/${z}.json`;fetch(m,{method:"GET",cache:"no-store"}).then(E=>E.json()).then(E=>{Tn(g,E.psaEnabled&&E.psaMessage?E.psaMessage:null),Tn(b,!(E.playDisabled??!1))})}else Tn(g,null),Tn(b,!0)});function x(z,m){if(!p(h))return A.warn("Please log in or select a user to play.");if(!p(_))return A.warn("Please select a character from the select menu.");const E=ee.findSession(n().selected.user_id);if(!E)return A.warn("Unable to launch game, session was not found.");const{session_id:N}=E,W=ee.findAccount(E.accounts,p(_));if(!W)return A.warn("Unable to launch game, account was not found.");const{accountId:I,displayName:J}=W,Y=k.platform===wr.Windows,_e=k.platform===wr.Linux;switch(z){case Ee.osrs:switch(m){case Zt.official:fs(Y||_e,!0,N,I,J);break;case Zt.runelite:ta(N,I,J,!1);break;case Zt.hdos:ei(N,I,J);break}break;case Ee.rs3:_e?Qo(N,I,J):fs(Y,!1,N,I,J);break}}function y(z){const m=z.target.value;if(!p(h))return;const E=n().userDetails[p(h)];E?(E.account_id=m,ae(f,T(n).userDetails[p(h)]=E,T(n))):ae(f,T(n).userDetails[p(h)]={account_id:m},T(n))}var U={launch:x},M=Yi(),j=G(M);gt(si(j,{}),z=>l=z,()=>l);var $=w(j,2);gt(qi($,{}),z=>c=z,()=>c);var C=w($,2),H=P(C);{var F=z=>{var m=Wi(),E=P(m);V(()=>me(E,r())),S(z,m)};X(H,z=>{r()&&z(F)})}var ue=w(H,2),te=w(P(ue),2);te.__click=()=>{a()?x(n().selected.game,n().selected.client):l.open(x,n().selected.game,n().selected.client)};var D=w(te,2);{var oe=z=>{var m=Vi(),E=w(P(m),2);$t(E,5,()=>ca[n().selected.game],Ut,(N,W)=>{var I=Gi(),J=P(I),Y={};V(()=>{me(J,p(W)),Y!==(Y=p(W))&&(I.value=(I.__value=p(W))??"")}),S(N,I)}),Wr(E,()=>n().selected.client,N=>ae(f,T(n).selected.client=N,T(n))),S(z,m)},Me=z=>{var m=ot(),E=G(m);{var N=W=>{var I=zi();I.__click=()=>{c.open()},V(()=>{I.disabled=!k.hasBoltPlugins,vt(I,"title",k.hasBoltPlugins?null:"This feature is disabled")}),S(W,I)};X(E,W=>{n().selected.game===Ee.rs3&&W(N)},!0)}S(z,m)};X(D,z=>{n().selected.game==Ee.osrs?z(oe):z(Me,!1)})}var Ce=w(D,2),ce=w(P(Ce),2);ce.__change=y;var ge=P(ce);ge.value=(ge.__value=void 0)??"";var rt=w(ge);$t(rt,17,()=>p(v),Ut,(z,m)=>{var E=Ji(),N=P(E);{var W=Y=>{var _e=ss();V(()=>me(_e,p(m).displayName)),S(Y,_e)},I=Y=>{var _e=ss("New Character");S(Y,_e)};X(N,Y=>{p(m).displayName?Y(W):Y(I,!1)})}var J={};V(()=>{J!==(J=p(m).accountId)&&(E.value=(E.__value=p(m).accountId)??"")}),S(z,E)},z=>{var m=Xi();S(z,m)});var Cn;Zs(ce),V(()=>{te.disabled=!o(),ce.disabled=!o()||n().selected.user_id===null,Cn!==(Cn=p(_))&&(ce.value=(ce.__value=p(_))??"",qr(ce,p(_)))}),S(e,M);var tr=ke(U);return u(),tr}nt(["click","change"]);var Ki=L("
  • "),Qi=L('
    Message list icon
      ');function el(e,t){ye(t,!0);var n=Qi(),r=w(P(n),2);$t(r,21,()=>t.logs,Ut,(a,o)=>{let i=()=>p(o).date,u=()=>p(o).severity,l=()=>p(o).content;var c=Ki();let f;var d=P(c);V((h,_)=>{f=Te(c,1,"",null,f,h),me(d,`${_??""} - - ${l()??""}`)},[()=>({"text-rose-500":u()===Lr.error,"text-orange-700":u()===Lr.warn}),()=>i()?.toLocaleTimeString()]),S(a,c)}),S(e,n),ke()}var tl=L(''),nl=()=>{const{origin:e,redirect:t,clientid:n}=k.env;Pe.openLoginWindow(e,t,n)},rl=async(e,t,n)=>{t().selected.user_id&&(await ee.logout(t().selected.user_id),ee.saveCredentials())},sl=L('
      ',1);function al(e,t){ye(t,!1);const n=()=>he(u,"$config",a),r=()=>he(i,"$sessions",a),[a,o]=ze(),{sessions:i,config:u}=O;Rt();var l=sl(),c=G(l);V(()=>{n(),ro(()=>{r()})});var f=P(c);f.value=(f.__value=null)??"";var d=w(f);$t(d,1,r,g=>g.user.userId,(g,b)=>{var x=tl(),y=P(x),U={};V(()=>{me(y,p(b).user.displayName),U!==(U=p(b).user.userId)&&(x.value=(x.__value=p(b).user.userId)??"")}),S(g,x)});var h=w(c,2),_=P(h);_.__click=[nl];var v=w(_,2);v.__click=[rl,n,u],V(()=>v.disabled=!n().selected.user_id),Wr(c,()=>n().selected.user_id,g=>ae(u,T(n).selected.user_id=g,T(n))),S(e,l),ke(),o()}nt(["click"]);function ol(e,{callback:t,ignore:n=[]}){const r=a=>{const o=n.some(i=>i.contains(a.target));e&&!e.contains(a.target)&&!a.defaultPrevented&&!o&&t()};return document.addEventListener("click",r,!0),document.addEventListener("contextmenu",r,!0),{destroy(){document.removeEventListener("click",r,!0),document.removeEventListener("contextmenu",r,!0)}}}function il(e,t,n,r){p(t)?n():r()}var ll=L("
      "),ul=L("
      ");function cl(e,t){ye(t,!0);const n=()=>he(o,"$config",r),[r,a]=ze(),{config:o}=O;let i=Be(()=>n().use_dark_theme),u=rn(t,"class",3,""),l=rn(t,"position",3,"bottom"),c=rn(t,"align",3,"start"),f=se(!1),d=se(Yt(new HTMLButtonElement));function h(){R(f,!0)}function _(){R(f,!1)}var v={open:h,close:_},g=ul();let b;var x=P(g);x.__click=[il,f,_,h];var y=P(x);qn(y,()=>t.children??et),gt(x,$=>R(d,$),()=>p(d));var U=w(x,2);{var M=$=>{var C=ll(),H=P(C);qn(H,()=>t.content??et),Co(C,(F,ue)=>ol?.(F,ue),()=>({callback:_,ignore:[p(d)]})),V(()=>Te(C,1,`dropdown-color absolute z-20 rounded-lg border-2 ${l()??""} ${c()??""}`,"svelte-11xj3vp")),S($,C)};X(U,$=>{p(f)&&$(M)})}V($=>b=Te(g,1,`relative h-fit w-fit ${u()??""}`,"svelte-11xj3vp",b,$),[()=>({dark:p(i)})]),S(e,g);var j=ke(v);return a(),j}nt(["click"]);var fl=(e,t)=>{t()},dl=L('
      ',1);function _l(e,t){ye(t,!1);const n=()=>he(i,"$config",r),[r,a]=ze();function o(){var y=new XMLHttpRequest;y.open("GET","/browse-data"),y.onreadystatechange=()=>{y.readyState==4&&A.info(`Browse status: '${y.responseText.trim()}'`)},y.send()}const{config:i}=O,u="Allow checking for official announcements about game status. These will be displayed above the 'play' button. Disabling will reduce the number of web requests made when opening the launcher.",l="Close the launcher immediately after launching a game",c="Discard login sessions if they're no longer valid, prompting the player to sign-in again. If unchecked, the only way to discard a login will be by manually pressing the 'log out' button, even if your login no longer works.";Rt();var f=dl(),d=G(f);d.__click=[fl,o];var h=w(d,2);vt(h,"title",u);var _=w(P(h),2),v=w(h,2);vt(v,"title",l);var g=w(P(v),2),b=w(v,2);vt(b,"title",c);var x=w(P(b),2);nn(_,()=>n().check_announcements,y=>ae(i,T(n).check_announcements=y,T(n))),nn(g,()=>n().close_after_launch,y=>ae(i,T(n).close_after_launch=y,T(n))),nn(x,()=>n().discard_expired_sessions,y=>ae(i,T(n).discard_expired_sessions=y,T(n))),S(e,f),ke(),a()}nt(["click"]);var vl=(e,t)=>t(),pl=(e,t)=>{t()},hl=L('




      ',1);function gl(e,t){ye(t,!0);const n=()=>he(o,"$config",r),[r,a]=ze(),{config:o}=O;let i=Be(()=>ee.findSession(n().selected.user_id)),u=Be(()=>ee.findAccount(p(i)?.accounts??[],n().userDetails[n().selected.user_id??""]?.account_id)),l=se(!1);async function c(){R(l,!0),ae(o,T(n).runelite_custom_jar=await ee.openFilePicker(),T(n)),console.log("done picking"),R(l,!1)}function f(){!p(i)?.session_id||!p(u)?.accountId||!p(u)?.displayName||ta(p(i).session_id,p(u).accountId,p(u).displayName,!0)}var d=hl(),h=G(d);h.__click=[vl,f];var _=w(h,2),v=w(P(_),2),g=w(_,2);let b;var x=P(g),y=w(x,4);y.__click=[pl,c];var U=w(g,2),M=w(P(U),4);vt(M,"placeholder","%command%");var j=w(U,2),$=w(P(j),4);vt($,"placeholder","%command%");var C=w(j,2),H=w(P(C),4);vt(H,"placeholder","%command%"),V(F=>{h.disabled=!p(i)?.session_id||!p(u)?.accountId,b=Te(g,1,"mx-auto p-2",null,b,F),x.disabled=!n().runelite_use_custom_jar,y.disabled=p(l)||!n().runelite_use_custom_jar},[()=>({"opacity-25":!n().runelite_use_custom_jar})]),nn(v,()=>n().runelite_use_custom_jar,F=>ae(o,T(n).runelite_use_custom_jar=F,T(n))),Nt(x,()=>n().runelite_custom_jar,F=>ae(o,T(n).runelite_custom_jar=F,T(n))),Nt(M,()=>n().osrs_launch_command,F=>ae(o,T(n).osrs_launch_command=F,T(n))),Nt($,()=>n().runelite_launch_command,F=>ae(o,T(n).runelite_launch_command=F,T(n))),Nt(H,()=>n().hdos_launch_command,F=>ae(o,T(n).hdos_launch_command=F,T(n))),S(e,d),ke(),a()}nt(["click"]);var ml=L('
      '),bl=L('

      ',1);function wl(e,t){ye(t,!1);const n=()=>he(o,"$config",r),[r,a]=ze(),{config:o}=O;Rt();var i=bl(),u=G(i);{var l=g=>{var b=ml(),x=w(P(b),2);nn(x,()=>n().rs_plugin_loader,y=>ae(o,T(n).rs_plugin_loader=y,T(n))),S(g,b)};X(u,g=>{k.hasBoltPlugins&&g(l)})}var c=w(u,2),f=w(P(c),2),d=w(c,2),h=P(d),_=w(d,2),v=w(P(_),4);vt(v,"placeholder","%command%"),V(()=>{h.disabled=!n().use_custom_rs_config_uri,vt(h,"placeholder",k.env.default_config_uri)}),nn(f,()=>n().use_custom_rs_config_uri,g=>ae(o,T(n).use_custom_rs_config_uri=g,T(n))),Nt(h,()=>n().rs_config_uri,g=>ae(o,T(n).rs_config_uri=g,T(n))),Nt(v,()=>n().rs_launch_command,g=>ae(o,T(n).rs_launch_command=g,T(n))),S(e,i),ke(),a()}var yl=(e,t,n)=>{R(t,n.general)},kl=(e,t,n)=>{R(t,n.osrs)},xl=(e,t,n)=>{R(t,n.rs3)},Sl=L('
      ');function $l(e,t){ye(t,!1);let n=qe();function r(){p(n).open()}var a=(c=>(c[c.general=0]="general",c[c.osrs=1]="osrs",c[c.rs3=2]="rs3",c))(a||{});let o=qe(0),i="border-2 border-blue-500 bg-blue-500 hover:opacity-75 font-bold text-black duration-200 rounded-lg p-1 w-3/4",u="border-2 border-blue-500 hover:opacity-75 duration-200 rounded-lg p-1 w-3/4";var l={open:r};return Rt(),gt(Qn(e,{class:"h-3/4 w-3/4 select-none",children:(c,f)=>{var d=Sl(),h=P(d),_=P(h);_.__click=[yl,o,a];var v=w(_,2);v.__click=[kl,o,a];var g=w(v,2);g.__click=[xl,o,a];var b=w(h,2),x=P(b);{var y=M=>{_l(M,{})},U=M=>{var j=ot(),$=G(j);{var C=F=>{gl(F,{})},H=F=>{var ue=ot(),te=G(ue);{var D=oe=>{wl(oe,{})};X(te,oe=>{p(o)==a.rs3&&oe(D)},!0)}S(F,ue)};X($,F=>{p(o)==a.osrs?F(C):F(H,!1)},!0)}S(M,j)};X(x,M=>{p(o)==a.general?M(y):M(U,!1)})}V(()=>{Te(_,1,An(p(o)===a.general?i:u)),Te(v,1,An(p(o)===a.osrs?i:u)),Te(g,1,An(p(o)===a.rs3?i:u))}),S(c,d)},$$slots:{default:!0},$$legacy:!0}),c=>R(n,c),()=>p(n)),Ks(t,"open",r),ke(l)}nt(["click"]);var Cl=(e,t,n)=>{ae(n,T(t).selected.game=Ee.rs3,T(t))},El=(e,t,n)=>{ae(n,T(t).selected.game=Ee.osrs,T(t))},Ll=(e,t,n)=>ae(n,T(t).use_dark_theme=!t().use_dark_theme,T(t)),Pl=(e,t)=>p(t).open(),Rl=L('
      '),Tl=L(''),Il=()=>{const{origin:e,redirect:t,clientid:n}=k.env;Pe.openLoginWindow(e,t,n)},Ol=L(''),Al=L('
      ',1);function Ul(e,t){ye(t,!1);const n=()=>he(i,"$config",a),r=()=>he(u,"$sessions",a),[a,o]=ze(),{config:i,sessions:u}=O;let l=qe();Rt();var c=Al(),f=G(c);gt($l(f,{$$legacy:!0}),C=>R(l,C),()=>p(l));var d=w(f,2),h=P(d),_=P(h);let v;_.__click=[Cl,n,i];var g=w(_,2);let b;g.__click=[El,n,i];var x=w(h,2),y=P(x);y.__click=[Ll,n,i];var U=w(y,2);U.__click=[Pl,l];var M=w(U,2);{var j=C=>{const H=Mr(()=>ee.findSession(n().selected.user_id??""));cl(C,{align:"center",content:ue=>{var te=Rl(),D=P(te);al(D,{}),S(ue,te)},children:(ue,te)=>{var D=Tl(),oe=P(D);V(()=>me(oe,p(H)?.user.displayName??"No user selected")),S(ue,D)},$$slots:{content:!0,default:!0}})},$=C=>{var H=Ol();H.__click=[Il],S(C,H)};X(M,C=>{r().length>0?C(j):C($,!1)})}V((C,H)=>{v=Te(_,1,"mx-1 w-20 rounded-lg border-2 border-blue-500 p-2 duration-200 hover:opacity-75",null,v,C),b=Te(g,1,"mx-1 w-20 rounded-lg border-2 border-blue-500 bg-blue-500 p-2 text-black duration-200 hover:opacity-75",null,b,H)},[()=>({"text-black":n().selected.game===Ee.rs3,"bg-blue-500":n().selected.game===Ee.rs3}),()=>({"text-black":n().selected.game===Ee.osrs,"bg-blue-500":n().selected.game===Ee.osrs})]),S(e,c),ke(),o()}nt(["click"]);var Nl=L('
      ',1);function Hl(e,t){ye(t,!1);const n=()=>he(o,"$logs",r),[r,a]=ze(),o=A.logs;Rt(),wo("beforeunload",kr,()=>{ee.saveConfig(),k.hasBoltPlugins&&ee.savePluginConfig(!0)}),ea(e,{children:(i,u)=>{var l=Nl(),c=G(l);Jo(c,{});var f=w(c,2);Ul(f,{});var d=w(f,2),h=w(P(d),2);Zi(h,{});var _=w(d,2);el(_,{get logs(){return n()}}),S(i,l)}}),ke(),a()}const ds={target:document.getElementById("app")};window.opener||window.location.search.includes("&id_token")?as(Bo,ds):(Ml(),Mo(),Dl(),jl().finally(()=>{O.initialized.set(!0)}),as(Hl,ds));function Ml(){const e=new URLSearchParams(window.location.search);k.platform=e.get("platform"),k.isFlathub=e.get("flathub")==="1",k.hasLibArchive=e.get("has_libarchive")==="1",k.rs3debInstalledHash=e.get("rs3_deb_installed_hash"),k.rs3exeInstalledHash=e.get("rs3_exe_installed_hash"),k.rs3appInstalledHash=e.get("rs3_app_installed_hash"),k.osrsexeInstalledHash=e.get("osrs_exe_installed_hash"),k.osrsappInstalledHash=e.get("osrs_app_installed_hash"),k.runeLiteInstalledId=e.get("runelite_installed_id"),k.hdosInstalledVersion=e.get("hdos_installed_version");const t=e.get("plugins");if(k.hasBoltPlugins=t!==null,t!==null)try{k.pluginConfig=JSON.parse(t)}catch{A.error("Unable to parse plugin list")}const n=e.get("credentials");if(n)try{const r=JSON.parse(n),a=r.every(o=>typeof o.session_id=="string"&&typeof o.tokens=="object"&&typeof o.accounts=="object"&&typeof o.user=="object");a?O.sessions.set(r):(O.sessions.set([]),ee.saveCredentials(),A.warn("Credentials saved on disk are out of date. Please sign in again.")),O.sessions.set(a?r:[])}catch{O.sessions.set([]),ee.saveCredentials(),A.error("Unable to parse saved credentials. Please sign in again.")}}function Dl(){const{origin:e,origin_2fa:t}=k.env,n=[window.location.origin,e,t];let r=null;window.addEventListener("message",async a=>{if(!n.includes(a.origin)){A.info(`discarding window message from origin ${a.origin}`);return}switch(a.data.type){case"authTokenUpdate":{r=a.data.tokens;break}case"authSessionUpdate":{if(r===null)return A.error("auth is null. Please try again.");const o=a.data.sessionId,i=await ee.login(r,o);i.ok?A.info(`Added new user '${i.value.user.displayName}'`):A.error(`Unable to add new user. Please try again. ${i.error}`),ee.saveCredentials(),Pe.pendingLoginWindow=null,r=null;break}case"authFailed":{A.error(`Unable to authenticate: ${a.data.reason}`),Pe.pendingLoginWindow=null,r=null;break}case"externalUrl":{const o=new XMLHttpRequest;o.onreadystatechange=()=>{o.readyState==4&&A.info(`External URL status: '${o.responseText.trim()}'`)},o.open("POST","/open-external-url",!0),o.send(a.data.url);break}case"gameClientList":Le(O.config).close_after_launch&&a.data.clients.length>Le(Pr).length?fetch("/close"):Pr.set(a.data.clients);break;default:{const o=a.data?.type??"no type provided";A.info(`Unknown message type: ${o}`);break}}})}async function jl(){const e=Le(O.config).discard_expired_sessions,t=Le(O.sessions),n=[];t.length>0&&A.info("Logging in...");const r=t.map(i=>({promise:Pe.refreshOAuthToken(i.tokens),session:i})),a=[];for(const i of r){const u=i.session,l=await i.promise;if(!l.ok){l.error===0?A.error(`Unable to verify saved login, status: ${l.error}. Do you have an internet connection? Please relaunch Bolt to try again.`):l.error>=400&&l.error<500&&e?(A.error(`Discarding expired login, status: ${l.error}. Please sign in again.`),n.push(u.tokens.sub)):A.error(`Unable to verify saved login due to HTTP error ${l.error}`);continue}const c=l.value;u.tokens=c,a.push({promise:ee.login(c,u.session_id),session:u})}for(const i of a){const u=i.session,l=await i.promise;l.ok?A.info(`Signed into saved user '${l.value.user.displayName}'`):(A.error(`Unable to sign into saved user '${u.user.displayName}' due to an error: ${l.error}`),e&&n.push(u.tokens.sub))}const o=n.map(ee.logout);for(const i of o)await i;O.sessions.set(t),await ee.saveCredentials()} +(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))r(a);new MutationObserver(a=>{for(const o of a)if(o.type==="childList")for(const i of o.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&r(i)}).observe(document,{childList:!0,subtree:!0});function n(a){const o={};return a.integrity&&(o.integrity=a.integrity),a.referrerPolicy&&(o.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?o.credentials="include":a.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(a){if(a.ep)return;a.ep=!0;const o=n(a);fetch(a.href,o)}})();var br=(e=>(e[e.SECOND=1e3]="SECOND",e[e.MINUTE=6e4]="MINUTE",e[e.HALF_HOUR=18e5]="HALF_HOUR",e[e.HOUR=36e5]="HOUR",e[e.DAY=864e5]="DAY",e[e.WEEK=6048e5]="WEEK",e[e.MONTH=2592e6]="MONTH",e))(br||{});class Xt{static set(t,n,r,a){const o=new Date;o.setTime(o.getTime()+r*a);const i=`expires=${o.toUTCString()}`;document.cookie=`${t}=${n};${i};path=/`}static get(t){const n=`${t}=`,r=document.cookie.split(";");for(let a=0;a(e.rs3="rs3",e.osrs="osrs",e))(Ee||{}),Yt=(e=>(e.official="Official",e.runelite="RuneLite",e.hdos="HDOS",e))(Yt||{});const ca={rs3:["Official"],osrs:["Official","RuneLite","HDOS"]};class Tn{static parseTokenResponse(t){try{const n=JSON.parse(t),r=n.id_token.split(".");if(r.length!==3){const i=`Malformed id_token: ${r.length} sections, expected 3`;return re(i)}const a=JSON.parse(atob(r[0]));if(a.typ!=="JWT"){const i=`Bad id_token header: typ ${a.typ}, expected JWT`;return re(i)}const o=JSON.parse(atob(r[1]));return Ke({access_token:n.access_token,id_token:n.id_token,refresh_token:n.refresh_token,sub:o.sub,expiry:Date.now()+n.expires_in*1e3})}catch{return re("Unable to parse token response")}}static parseSessionResponse(t){try{const n=JSON.parse(t);return n.sessionId?Ke(n.sessionId):re("sessionId does not exist on parsed object")}catch{return re("Unable to parse session response")}}static decodeBolt(t){const n={};for(const r in t){const a=r,o=t[a];typeof o=="string"?n[a]=atob(o):Array.isArray(o)&&o.every(i=>typeof i=="string")?n[a]=o.map(i=>atob(i)):n[a]=o}return n}}var wr=(e=>(e.Windows="windows",e.Linux="linux",e.MacOS="mac",e))(wr||{});const k={env:Tn.decodeBolt(s()),platform:null,rs3debInstalledHash:null,rs3exeInstalledHash:null,rs3appInstalledHash:null,osrsexeInstalledHash:null,osrsappInstalledHash:null,runeLiteInstalledId:null,hdosInstalledVersion:null,isFlathub:!1,hasLibArchive:!1,hasBoltPlugins:!1,pluginConfig:{}};class lr{static async makeLoginUrl(t){const n=new TextEncoder().encode(t.pkceCodeVerifier),r=await crypto.subtle.digest("SHA-256",n);let a="";const o=new Uint8Array(r);for(let u=0;uMath.round(o*(r-0)/255+0)).map(o=>n[o]).join("")}}class Pe{static pendingLoginWindow=null;static async openLoginWindow(t,n,r){if(Pe.pendingLoginWindow!==null)return Pe.pendingLoginWindow.window.focus();const a=lr.makeRandomState(),o=lr.makeRandomVerifier(),i=new TextEncoder().encode(o),u=await crypto.subtle.digest("SHA-256",i);let l="";const c=new Uint8Array(u);for(let _=0;_{if(t.expiry-Date.now()<3e4){const r=new URLSearchParams({grant_type:"refresh_token",client_id:k.env.clientid,refresh_token:t.refresh_token}),a=new XMLHttpRequest;a.onreadystatechange=()=>{if(a.readyState==4)if(a.status==200){const i=Tn.parseTokenResponse(a.response);i.ok?n(Ke(i.value)):n(re(0))}else n(re(a.status))},a.onerror=()=>{n(re(0))};const o=k.env.origin.concat("/oauth2/token");a.open("POST",o,!0),a.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),a.setRequestHeader("Accept","application/json"),a.send(r)}else n(Ke(t))})}static async getOAuthToken(t,n,r,a,o){const i=`${t}/oauth2/token`;return new Promise(u=>{const l=new XMLHttpRequest;l.onreadystatechange=()=>{if(l.readyState==4)if(l.status==200){const f=Tn.parseTokenResponse(l.response);return f.ok?u(Ke(f.value)):u(re(f.error))}else return u(re(`Error: from ${i}: ${l.status}: ${l.response}`))},l.open("POST",i,!0),l.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),l.setRequestHeader("Accept","application/json");const c=new URLSearchParams({grant_type:"authorization_code",client_id:n,code:o,code_verifier:r,redirect_uri:a});l.send(c)})}static revokeOauthCreds(t){const n=`${k.env.origin}/oauth2/revoke`;return new Promise(r=>{const a=new XMLHttpRequest;a.open("POST",n,!0),a.onreadystatechange=()=>{a.readyState==4&&r(a.status)},a.setRequestHeader("Content-Type","application/x-www-form-urlencoded");const o=new URLSearchParams({token:t,client_id:k.env.clientid});a.send(o)})}static async getSessionId(t,n){const r=`${t}/sessions`;return new Promise(a=>{const o=new XMLHttpRequest;o.onreadystatechange=()=>{if(o.readyState==4)if(o.status==200){const u=Tn.parseSessionResponse(o.response);return u.ok?a(Ke(u.value)):a(re(u.error))}else re(`Error: from ${r}: ${o.status}: ${o.response}`)},o.open("POST",r,!0),o.setRequestHeader("Content-Type","application/json"),o.setRequestHeader("Accept","application/json");const i={idToken:n};o.send(JSON.stringify(i))})}static validateIdToken(t,n){const r=t.split(".");if(r.length!==3)return re(`Malformed id_token: ${r.length} sections, expected 3`);const a=JSON.parse(atob(r[0]));return a.typ!=="JWT"?re(`Bad id_token header: typ ${a.typ}, expected JWT`):JSON.parse(atob(r[1])).nonce!==n?re("Incorrect nonce in id_token"):Ke(void 0)}}class Un{static async buildSession(t,n){const r=await Un.getUser(t.sub,t.access_token);if(!r.ok)return re(`Failed to fetch user. Status: ${r.error}`);const a=await Un.getUserAccounts(n);return a.ok?Ke({user:r.value,accounts:a.value,tokens:t,session_id:n}):re(`Failed to fetch game accounts. Status: ${a.error}`)}static getUser(t,n){return new Promise(r=>{const a=`${k.env.api}/users/${t}/displayName`,o=new XMLHttpRequest;o.onreadystatechange=()=>{if(o.readyState==4)if(o.status==200){const i=JSON.parse(o.response);r(Ke(i))}else r(re(o.status))},o.open("GET",a,!0),o.setRequestHeader("Authorization","Bearer ".concat(n)),o.send()})}static getUserAccounts(t){const n=`${k.env.auth_api}/accounts`;return new Promise(r=>{const a=new XMLHttpRequest;a.onreadystatechange=async()=>{if(a.readyState==4)if(a.status==200){const o=JSON.parse(a.response);r(Ke(o))}else r(re(a.status))},a.open("GET",n,!0),a.setRequestHeader("Accept","application/json"),a.setRequestHeader("Authorization","Bearer ".concat(t)),a.send()})}}const _s=!1;var Wn=Array.isArray,fa=Array.prototype.indexOf,Rr=Array.from,Nn=Object.defineProperty,Zt=Object.getOwnPropertyDescriptor,vs=Object.getOwnPropertyDescriptors,da=Object.prototype,_a=Array.prototype,Ir=Object.getPrototypeOf,Xr=Object.isExtensible;const et=()=>{};function va(e){return typeof e?.then=="function"}function pa(e){return e()}function Hn(e){for(var t=0;t{e=r,t=a});return{promise:n,resolve:e,reject:t}}function ga(e,t){if(Array.isArray(e))return e;if(!(Symbol.iterator in e))return Array.from(e);const n=[];for(const r of e)if(n.push(r),n.length===t)break;return n}const He=2,Tr=4,Gn=8,on=16,mt=32,Ft=64,Or=128,We=256,Mn=512,be=1024,Ge=2048,Pt=4096,tt=8192,ln=16384,Ar=32768,yn=65536,Yr=1<<17,ma=1<<18,un=1<<19,ps=1<<20,yr=1<<21,Ur=1<<22,Ht=1<<23,Ct=Symbol("$state"),ba=Symbol(""),Nr=new class extends Error{name="StaleReactionError";message="The reaction that called `getAbortSignal()` was re-run or destroyed"};function hs(e){return e===this.v}function Hr(e,t){return e!=e?t==t:e!==t||e!==null&&typeof e=="object"||typeof e=="function"}function gs(e){return!Hr(e,this.v)}function ms(e){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function wa(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function ya(e){throw new Error("https://svelte.dev/e/effect_in_teardown")}function ka(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function xa(e){throw new Error("https://svelte.dev/e/effect_orphan")}function Sa(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function $a(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function Ca(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function Ea(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function La(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}let kn=!1,Pa=!1;function Ra(){kn=!0}const Vn=1,zn=2,bs=4,Ia=8,Ta=16,Oa=1,Aa=2,le=Symbol(),Ua="http://www.w3.org/1999/xhtml";let Q=null;function Lt(e){Q=e}function ye(e,t=!1,n){Q={p:Q,c:null,e:null,s:e,x:null,l:kn&&!t?{s:null,u:null,$:[]}:null}}function ke(e){var t=Q,n=t.e;if(n!==null){t.e=null;for(var r of n)Fs(r)}return e!==void 0&&(t.x=e),Q=t.p,e??{}}function cn(){return!kn||Q!==null&&Q.l===null}let xt=[],Dn=[];function ws(){var e=xt;xt=[],Hn(e)}function Na(){var e=Dn;Dn=[],Hn(e)}function Ha(){return xt.length>0||Dn.length>0}function qt(e){if(xt.length===0&&!gn){var t=xt;queueMicrotask(()=>{t===xt&&ws()})}xt.push(e)}function Ma(){xt.length>0&&ws(),Dn.length>0&&Na()}function Da(){console.warn("https://svelte.dev/e/select_multiple_invalid_value")}function ja(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}let Fa=!1;function pn(e){if(typeof e!="object"||e===null||Ct in e)return e;const t=Ir(e);if(t!==da&&t!==_a)return e;var n=new Map,r=Wn(e),a=se(0),o=Mt,i=u=>{if(Mt===o)return u();var l=q,c=Mt;we(null),ns(o);var f=u();return we(l),ns(c),f};return r&&n.set("length",se(e.length)),new Proxy(e,{defineProperty(u,l,c){(!("value"in c)||c.configurable===!1||c.enumerable===!1||c.writable===!1)&&$a();var f=n.get(l);return f===void 0?f=i(()=>{var d=se(c.value);return n.set(l,d),d}):R(f,c.value,!0),!0},deleteProperty(u,l){var c=n.get(l);if(c===void 0){if(l in u){const f=i(()=>se(le));n.set(l,f),mn(a)}}else R(c,le),mn(a);return!0},get(u,l,c){if(l===Ct)return e;var f=n.get(l),d=l in u;if(f===void 0&&(!d||Zt(u,l)?.writable)&&(f=i(()=>{var _=pn(d?u[l]:le),v=se(_);return v}),n.set(l,f)),f!==void 0){var h=p(f);return h===le?void 0:h}return Reflect.get(u,l,c)},getOwnPropertyDescriptor(u,l){var c=Reflect.getOwnPropertyDescriptor(u,l);if(c&&"value"in c){var f=n.get(l);f&&(c.value=p(f))}else if(c===void 0){var d=n.get(l),h=d?.v;if(d!==void 0&&h!==le)return{enumerable:!0,configurable:!0,value:h,writable:!0}}return c},has(u,l){if(l===Ct)return!0;var c=n.get(l),f=c!==void 0&&c.v!==le||Reflect.has(u,l);if(c!==void 0||B!==null&&(!f||Zt(u,l)?.writable)){c===void 0&&(c=i(()=>{var h=f?pn(u[l]):le,_=se(h);return _}),n.set(l,c));var d=p(c);if(d===le)return!1}return f},set(u,l,c,f){var d=n.get(l),h=l in u;if(r&&l==="length")for(var _=c;_se(le)),n.set(_+"",v))}if(d===void 0)(!h||Zt(u,l)?.writable)&&(d=i(()=>se(void 0)),R(d,pn(c)),n.set(l,d));else{h=d.v!==le;var g=i(()=>pn(c));R(d,g)}var b=Reflect.getOwnPropertyDescriptor(u,l);if(b?.set&&b.set.call(f,c),!h){if(r&&typeof l=="string"){var x=n.get("length"),y=Number(l);Number.isInteger(y)&&y>=x.v&&R(x,y+1)}mn(a)}return!0},ownKeys(u){p(a);var l=Reflect.ownKeys(u).filter(d=>{var h=n.get(d);return h===void 0||h.v!==le});for(var[c,f]of n)f.v!==le&&!(c in u)&&l.push(c);return l},setPrototypeOf(){Ca()}})}function Zr(e){try{if(e!==null&&typeof e=="object"&&Ct in e)return e[Ct]}catch{}return e}function qa(e,t){return Object.is(Zr(e),Zr(t))}var kr,ys,ks,xs;function Ba(){if(kr===void 0){kr=window,ys=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,n=Text.prototype;ks=Zt(t,"firstChild").get,xs=Zt(t,"nextSibling").get,Xr(e)&&(e.__click=void 0,e.__className=void 0,e.__attributes=null,e.__style=void 0,e.__e=void 0),Xr(n)&&(n.__t=void 0)}}function fn(e=""){return document.createTextNode(e)}function jn(e){return ks.call(e)}function xn(e){return xs.call(e)}function P(e,t){return jn(e)}function G(e,t=!1){{var n=jn(e);return n instanceof Comment&&n.data===""?xn(n):n}}function w(e,t=1,n=!1){let r=e;for(;t--;)r=xn(r);return r}function Wa(e){e.textContent=""}function Ss(){return!1}const Ga=new WeakMap;function $s(e){var t=B;if(t===null)return q.f|=Ht,e;if((t.f&Ar)===0){if((t.f&Or)===0)throw!t.parent&&e instanceof Error&&Cs(e),e;t.b.error(e)}else rn(e,t)}function rn(e,t){for(;t!==null;){if((t.f&Or)!==0)try{t.b.error(e);return}catch(n){e=n}t=t.parent}throw e instanceof Error&&Cs(e),e}function Cs(e){const t=Ga.get(e);t&&(Nn(e,"message",{value:t.message}),Nn(e,"stack",{value:t.stack}))}const ur=new Set;let Z=null,On=null,xr=new Set,jt=[],Jn=null,Sr=!1,gn=!1;class ft{current=new Map;#a=new Map;#t=new Set;#d=0;#o=null;#c=!1;#s=[];#n=[];#e=[];#r=[];#i=[];#f=[];#u=[];skipped_effects=new Set;process(t){jt=[],On=null;for(const a of t)this.#_(a);if(this.#s.length===0&&this.#d===0){this.#v();var n=this.#e,r=this.#r;this.#e=[],this.#r=[],this.#i=[],On=Z,Z=null,Kr(n),Kr(r),Z===null?Z=this:ur.delete(this),this.#o?.resolve()}else this.#l(this.#e),this.#l(this.#r),this.#l(this.#i);for(const a of this.#s)Qt(a);for(const a of this.#n)Qt(a);this.#s=[],this.#n=[]}#_(t){t.f^=be;for(var n=t.first;n!==null;){var r=n.f,a=(r&(mt|Ft))!==0,o=a&&(r&be)!==0,i=o||(r&tt)!==0||this.skipped_effects.has(n);if(!i&&n.fn!==null){if(a)n.f^=be;else if((r&Tr)!==0)this.#r.push(n);else if((r&be)===0)if((r&Ur)!==0){var u=n.b?.is_pending()?this.#n:this.#s;u.push(n)}else Zn(n)&&((n.f&on)!==0&&this.#i.push(n),Qt(n));var l=n.first;if(l!==null){n=l;continue}}var c=n.parent;for(n=n.next;n===null&&c!==null;)n=c.next,c=c.parent}}#l(t){for(const n of t)((n.f&Ge)!==0?this.#f:this.#u).push(n),Re(n,be);t.length=0}capture(t,n){this.#a.has(t)||this.#a.set(t,n),this.current.set(t,t.v)}activate(){Z=this}deactivate(){Z=null,On=null;for(const t of xr)if(xr.delete(t),t(),Z!==null)break}neuter(){this.#c=!0}flush(){jt.length>0?Ls():this.#v(),Z===this&&(this.#d===0&&ur.delete(this),this.deactivate())}#v(){if(!this.#c)for(const t of this.#t)t();this.#t.clear()}increment(){this.#d+=1}decrement(){if(this.#d-=1,this.#d===0){for(const t of this.#f)Re(t,Ge),sn(t);for(const t of this.#u)Re(t,Pt),sn(t);this.#e=[],this.#r=[],this.flush()}else this.deactivate()}add_callback(t){this.#t.add(t)}settled(){return(this.#o??=ha()).promise}static ensure(){if(Z===null){const t=Z=new ft;ur.add(Z),gn||ft.enqueue(()=>{Z===t&&t.flush()})}return Z}static enqueue(t){qt(t)}}function Es(e){var t=gn;gn=!0;try{for(var n;;){if(Ma(),jt.length===0&&!Ha()&&(Z?.flush(),jt.length===0))return Jn=null,n;Ls()}}finally{gn=t}}function Ls(){var e=Kt;Sr=!0;try{var t=0;for(es(!0);jt.length>0;){var n=ft.ensure();if(t++>1e3){var r,a;Va()}n.process(jt),Et.clear()}}finally{Sr=!1,es(e),Jn=null}}function Va(){try{Sa()}catch(e){rn(e,Jn)}}let At=null;function Kr(e){var t=e.length;if(t!==0){for(var n=0;n0)){Et.clear();for(const a of At)Qt(a);At=[]}}At=null}}function sn(e){for(var t=Jn=e;t.parent!==null;){t=t.parent;var n=t.f;if(Sr&&t===B&&(n&on)!==0)return;if((n&(Ft|mt))!==0){if((n&be)===0)return;t.f^=be}}jt.push(t)}function za(e){let t=0,n=ht(0),r;return()=>{co()&&(p(n),Sn(()=>(t===0&&(r=I(()=>e(()=>mn(n)))),t+=1,()=>{qt(()=>{t-=1,t===0&&(r?.(),r=void 0,mn(n))})})))}}var Ja=yn|un|Or;function Xa(e,t,n){new Ya(e,t,n)}class Ya{parent;#a=!1;#t;#d=null;#o;#c;#s;#n=null;#e=null;#r=null;#i=null;#f=0;#u=0;#_=!1;#l=null;#v=()=>{this.#l&&it(this.#l,this.#f)};#m=za(()=>(this.#l=ht(this.#f),()=>{this.#l=null}));constructor(t,n,r){this.#t=t,this.#o=n,this.#c=r,this.parent=B.b,this.#a=!!this.#o.pending,this.#s=$n(()=>{B.b=this;{try{this.#n=$e(()=>r(this.#t))}catch(a){this.error(a)}this.#u>0?this.#h():this.#a=!1}},Ja)}#b(){try{this.#n=$e(()=>this.#c(this.#t))}catch(t){this.error(t)}this.#a=!1}#w(){const t=this.#o.pending;t&&(this.#e=$e(()=>t(this.#t)),ft.enqueue(()=>{this.#n=this.#p(()=>(ft.ensure(),$e(()=>this.#c(this.#t)))),this.#u>0?this.#h():(_t(this.#e,()=>{this.#e=null}),this.#a=!1)}))}is_pending(){return this.#a||!!this.parent&&this.parent.is_pending()}has_pending_snippet(){return!!this.#o.pending}#p(t){var n=B,r=q,a=Q;Ve(this.#s),we(this.#s),Lt(this.#s.ctx);try{return t()}catch(o){return $s(o),null}finally{Ve(n),we(r),Lt(a)}}#h(){const t=this.#o.pending;this.#n!==null&&(this.#i=document.createDocumentFragment(),Za(this.#n,this.#i)),this.#e===null&&(this.#e=$e(()=>t(this.#t)))}#g(t){if(!this.has_pending_snippet()){this.parent&&this.parent.#g(t);return}this.#u+=t,this.#u===0&&(this.#a=!1,this.#e&&_t(this.#e,()=>{this.#e=null}),this.#i&&(this.#t.before(this.#i),this.#i=null))}update_pending_count(t){this.#g(t),this.#f+=t,xr.add(this.#v)}get_effect_pending(){return this.#m(),p(this.#l)}error(t){var n=this.#o.onerror;let r=this.#o.failed;if(this.#_||!n&&!r)throw t;this.#n&&(Ne(this.#n),this.#n=null),this.#e&&(Ne(this.#e),this.#e=null),this.#r&&(Ne(this.#r),this.#r=null);var a=!1,o=!1;const i=()=>{if(a){ja();return}a=!0,o&&La(),ft.ensure(),this.#f=0,this.#r!==null&&_t(this.#r,()=>{this.#r=null}),this.#a=this.has_pending_snippet(),this.#n=this.#p(()=>(this.#_=!1,$e(()=>this.#c(this.#t)))),this.#u>0?this.#h():this.#a=!1};var u=q;try{we(null),o=!0,n?.(t,i),o=!1}catch(l){rn(l,this.#s&&this.#s.parent)}finally{we(u)}r&&qt(()=>{this.#r=this.#p(()=>{this.#_=!0;try{return $e(()=>{r(this.#t,()=>t,()=>i)})}catch(l){return rn(l,this.#s.parent),null}finally{this.#_=!1}})})}}function Za(e,t){for(var n=e.nodes_start,r=e.nodes_end;n!==null;){var a=n===r?null:xn(n);t.append(n),n=a}}function Ka(e,t,n){const r=cn()?Xn:Mr;if(t.length===0){n(e.map(r));return}var a=Z,o=B,i=Qa();Promise.all(t.map(u=>eo(u))).then(u=>{a?.activate(),i();try{n([...e.map(r),...u])}catch(l){(o.f&ln)===0&&rn(l,o)}a?.deactivate(),Ps()}).catch(u=>{rn(u,o)})}function Qa(){var e=B,t=q,n=Q,r=Z;return function(){Ve(e),we(t),Lt(n),r?.activate()}}function Ps(){Ve(null),we(null),Lt(null)}function Xn(e){var t=He|Ge,n=q!==null&&(q.f&He)!==0?q:null;return B===null||n!==null&&(n.f&We)!==0?t|=We:B.f|=un,{ctx:Q,deps:null,effects:null,equals:hs,f:t,fn:e,reactions:null,rv:0,v:le,wv:0,parent:n??B,ac:null}}function eo(e,t){let n=B;n===null&&wa();var r=n.b,a=void 0,o=ht(le),i=null,u=!q;return vo(()=>{try{var l=e();i&&Promise.resolve(l).catch(()=>{})}catch(_){l=Promise.reject(_)}var c=()=>l;a=i?.then(c,c)??Promise.resolve(l),i=a;var f=Z,d=r.is_pending();u&&(r.update_pending_count(1),d||f.increment());const h=(_,v=void 0)=>{i=null,d||f.activate(),v?v!==Nr&&(o.f|=Ht,it(o,v)):((o.f&Ht)!==0&&(o.f^=Ht),it(o,_)),u&&(r.update_pending_count(-1),d||f.decrement()),Ps()};if(a.then(h,_=>h(null,_||"unknown")),f)return()=>{queueMicrotask(()=>f.neuter())}}),new Promise(l=>{function c(f){function d(){f===a?l(o):c(a)}f.then(d,d)}c(a)})}function qe(e){const t=Xn(e);return Os(t),t}function Mr(e){const t=Xn(e);return t.equals=gs,t}function Rs(e){var t=e.effects;if(t!==null){e.effects=null;for(var n=0;n{Promise.resolve().then(()=>{if(!e.defaultPrevented)for(const t of e.target.elements)t.__on_r?.()})},{capture:!0}))}function Yn(e){var t=q,n=B;we(null),Ve(null);try{return e()}finally{we(t),Ve(n)}}function jr(e,t,n,r=n){e.addEventListener(t,()=>Yn(n));const a=e.__on_r;a?e.__on_r=()=>{a(),r(!0)}:e.__on_r=()=>r(!0),so()}let Kt=!1;function es(e){Kt=e}let dn=!1;function ts(e){dn=e}let q=null,Qe=!1;function we(e){q=e}let B=null;function Ve(e){B=e}let dt=null;function Os(e){q!==null&&(dt===null?dt=[e]:dt.push(e))}let Se=null,Ae=0,Fe=null;function ao(e){Fe=e}let As=1,wn=0,Mt=wn;function ns(e){Mt=e}let St=!1;function Us(){return++As}function Zn(e){var t=e.f;if((t&Ge)!==0)return!0;if((t&Pt)!==0){var n=e.deps,r=(t&We)!==0;if(n!==null){var a,o,i=(t&Mn)!==0,u=r&&B!==null&&!St,l=n.length;if((i||u)&&(B===null||(B.f&ln)===0)){var c=e,f=c.parent;for(a=0;ae.wv)return!0}(!r||B!==null&&!St)&&Re(e,be)}return!1}function Ns(e,t,n=!0){var r=e.reactions;if(r!==null&&!dt?.includes(e))for(var a=0;a{e.ac.abort(Nr)}),e.ac=null);try{e.f|=yr;var d=e.fn,h=d(),_=e.deps;if(Se!==null){var v;if(Fn(e,Ae),_!==null&&Ae>0)for(_.length=Ae+Se.length,v=0;vnew Promise(r=>{n.outro?_t(t,()=>{Ne(t),r(void 0)}):(Ne(t),r(void 0))})}function Fr(e){return lt(Tr,e,!1)}function vo(e){return lt(Ur|un,e,!0)}function Sn(e,t=0){return lt(Gn|t,e,!0)}function V(e,t=[],n=[]){Ka(t,n,r=>{lt(Gn,()=>e(...r.map(p)),!0)})}function $n(e,t=0){var n=lt(on|t,e,!0);return n}function $e(e,t=!0){return lt(mt|un,e,!0,t)}function qs(e){var t=e.teardown;if(t!==null){const n=dn,r=q;ts(!0),we(null);try{t.call(null)}finally{ts(n),we(r)}}}function Bs(e,t=!1){var n=e.first;for(e.first=e.last=null;n!==null;){const a=n.ac;a!==null&&Yn(()=>{a.abort(Nr)});var r=n.next;(n.f&Ft)!==0?n.parent=null:Ne(n,t),n=r}}function po(e){for(var t=e.first;t!==null;){var n=t.next;(t.f&mt)===0&&Ne(t),t=n}}function Ne(e,t=!0){var n=!1;(t||(e.f&ma)!==0)&&e.nodes_start!==null&&e.nodes_end!==null&&(ho(e.nodes_start,e.nodes_end),n=!0),Bs(e,t&&!n),Fn(e,0),Re(e,ln);var r=e.transitions;if(r!==null)for(const o of r)o.stop();qs(e);var a=e.parent;a!==null&&a.first!==null&&Ws(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes_start=e.nodes_end=e.ac=null}function ho(e,t){for(;e!==null;){var n=e===t?null:xn(e);e.remove(),e=n}}function Ws(e){var t=e.parent,n=e.prev,r=e.next;n!==null&&(n.next=r),r!==null&&(r.prev=n),t!==null&&(t.first===e&&(t.first=r),t.last===e&&(t.last=n))}function _t(e,t){var n=[];qr(e,n,!0),Gs(n,()=>{Ne(e),t&&t()})}function Gs(e,t){var n=e.length;if(n>0){var r=()=>--n||t();for(var a of e)a.out(r)}else t()}function qr(e,t,n){if((e.f&tt)===0){if(e.f^=tt,e.transitions!==null)for(const i of e.transitions)(i.is_global||n)&&t.push(i);for(var r=e.first;r!==null;){var a=r.next,o=(r.f&yn)!==0||(r.f&mt)!==0;qr(r,t,o?n:!1),r=a}}}function en(e){Vs(e,!0)}function Vs(e,t){if((e.f&tt)!==0){e.f^=tt,(e.f&be)===0&&(Re(e,Ge),sn(e));for(var n=e.first;n!==null;){var r=n.next,a=(n.f&yn)!==0||(n.f&mt)!==0;Vs(n,a?t:!1),n=r}if(e.transitions!==null)for(const o of e.transitions)(o.is_global||t)&&o.in()}}const go=["touchstart","touchmove"];function mo(e){return go.includes(e)}const zs=new Set,Cr=new Set;function bo(e,t,n,r={}){function a(o){if(r.capture||hn.call(t,o),!o.cancelBubble)return Yn(()=>n?.call(this,o))}return e.startsWith("pointer")||e.startsWith("touch")||e==="wheel"?qt(()=>{t.addEventListener(e,a,r)}):t.addEventListener(e,a,r),a}function wo(e,t,n,r,a){var o={capture:r,passive:a},i=bo(e,t,n,o);(t===document.body||t===window||t===document||t instanceof HTMLMediaElement)&&Kn(()=>{t.removeEventListener(e,i,o)})}function nt(e){for(var t=0;t{throw y});throw h}}finally{e.__root=t,delete e.currentTarget,we(f),Ve(d)}}}function yo(e){var t=document.createElement("template");return t.innerHTML=e.replaceAll("",""),t.content}function qn(e,t){var n=B;n.nodes_start===null&&(n.nodes_start=e,n.nodes_end=t)}function L(e,t){var n=(t&Oa)!==0,r=(t&Aa)!==0,a,o=!e.startsWith("");return()=>{a===void 0&&(a=yo(o?e:""+e),n||(a=jn(a)));var i=r||ys?document.importNode(a,!0):a.cloneNode(!0);if(n){var u=jn(i),l=i.lastChild;qn(u,l)}else qn(i,i);return i}}function ss(e=""){{var t=fn(e+"");return qn(t,t),t}}function ot(){var e=document.createDocumentFragment(),t=document.createComment(""),n=fn();return e.append(t,n),qn(t,n),e}function S(e,t){e!==null&&e.before(t)}function me(e,t){var n=t==null?"":typeof t=="object"?t+"":t;n!==(e.__t??=e.nodeValue)&&(e.__t=n,e.nodeValue=n+"")}function as(e,t){return ko(e,t)}const Vt=new Map;function ko(e,{target:t,anchor:n,props:r={},events:a,context:o,intro:i=!0}){Ba();var u=new Set,l=d=>{for(var h=0;h{var d=n??t.appendChild(fn());return Xa(d,{pending:()=>{}},h=>{if(o){ye({});var _=Q;_.c=o}a&&(r.$$events=a),c=e(h,r)||{},o&&ke()}),()=>{for(var h of u){t.removeEventListener(h,hn);var _=Vt.get(h);--_===0?(document.removeEventListener(h,hn),Vt.delete(h)):Vt.set(h,_)}Cr.delete(l),d!==n&&d.parentNode?.removeChild(d)}});return xo.set(c,f),c}let xo=new WeakMap;const cr=0,Rn=1,fr=2;function os(e,t,n,r,a){var o=e,i=cn(),u=Q,l=le,c,f,d,h=i?ht(void 0):Be(void 0,!1,!1),_=i?ht(void 0):Be(void 0,!1,!1),v=!1;function g(x,y){v=!0,y&&(Ve(b),we(b),Lt(u));try{x===cr&&n&&(c?en(c):c=$e(()=>n(o))),x===Rn&&r&&(f?en(f):f=$e(()=>r(o,h))),x===fr&&a&&(d?en(d):d=$e(()=>a(o,_))),x!==cr&&c&&_t(c,()=>c=null),x!==Rn&&f&&_t(f,()=>f=null),x!==fr&&d&&_t(d,()=>d=null)}finally{y&&(Lt(null),we(null),Ve(null),Es())}}var b=$n(()=>{if(l!==(l=t())){if(va(l)){var x=l;v=!1,x.then(y=>{x===l&&(it(h,y),g(Rn,!0))},y=>{if(x===l&&(it(_,y),g(fr,!0),!a))throw _.v}),qt(()=>{v||g(cr,!0)})}else it(h,l),g(Rn,!1);return()=>l=le}})}function X(e,t,n=!1){var r=e,a=null,o=null,i=le,u=n?yn:0,l=!1;const c=(_,v=!0)=>{l=!0,h(v,_)};var f=null;function d(){f!==null&&(f.lastChild.remove(),r.before(f),f=null);var _=i?a:o,v=i?o:a;_&&en(_),v&&_t(v,()=>{i?o=null:a=null})}const h=(_,v)=>{if(i!==(i=_)){var g=Ss(),b=r;if(g&&(f=document.createDocumentFragment(),f.append(b=fn())),i?a??=v&&$e(()=>v(b)):o??=v&&$e(()=>v(b)),g){var x=Z,y=i?a:o,U=i?o:a;y&&x.skipped_effects.delete(y),U&&x.skipped_effects.add(U),x.add_callback(d)}else d()}};$n(()=>{l=!1,t(c),l||h(null,null)},u)}function Ut(e,t){return t}function So(e,t,n){for(var r=e.items,a=[],o=t.length,i=0;i0&&a.length===0&&n!==null;if(u){var l=n.parentNode;Wa(l),l.append(n),r.clear(),at(e,t[0].prev,t[o-1].next)}Gs(a,()=>{for(var c=0;c{var x=n();return Wn(x)?x:x==null?[]:Rr(x)}),v,g;function b(){$o(g,v,u,h,i,a,t,r,n),o!==null&&(v.length===0?f?en(f):f=$e(()=>o(i)):f!==null&&_t(f,()=>{f=null}))}$n(()=>{g??=B,v=p(_);var x=v.length;if(!(d&&x===0)){d=x===0;var y,U,M,j;if(Ss()){var $=new Set,C=Z;for(U=0;U0){var ge=(i&bs)!==0&&d===0?a:null;if(c){for(C=0;C{if(x!==void 0)for($ of x)$.a?.apply()}),e.first=n.first&&n.first.e,e.last=b&&b.e;for(var rt of r.values())Ne(rt.e);r.clear()}function Js(e,t,n,r){(r&Vn)!==0&&it(e.v,t),(r&zn)!==0?it(e.i,n):e.i=n}function Xs(e,t,n,r,a,o,i,u,l,c,f){var d=(l&Vn)!==0,h=(l&Ta)===0,_=d?h?Be(a,!1,!1):ht(a):a,v=(l&zn)===0?i:ht(i),g={i:v,v:_,k:o,a:null,e:null,prev:n,next:r};try{if(e===null){var b=document.createDocumentFragment();b.append(e=fn())}return g.e=$e(()=>u(e,_,v,c),Fa),g.e.prev=n&&n.e,g.e.next=r&&r.e,n===null?f||(t.first=g):(n.next=g,n.e.next=g.e),r!==null&&(r.prev=g,r.e.prev=g.e),g}finally{}}function dr(e,t,n){for(var r=e.next?e.next.e.nodes_start:n,a=t?t.e.nodes_start:n,o=e.e.nodes_start;o!==null&&o!==r;){var i=xn(o);a.before(o),o=i}}function at(e,t,n){t===null?e.first=n:(t.next=n,t.e.next=n&&n.e),n!==null&&(n.prev=t,n.e.prev=t&&t.e)}function Bn(e,t,...n){var r=e,a=et,o;$n(()=>{a!==(a=t())&&(o&&(Ne(o),o=null),o=$e(()=>a(r,...n)))},yn)}function Co(e,t,n){Fr(()=>{var r=I(()=>t(e,n?.())||{});if(n&&r?.update){var a=!1,o={};Sn(()=>{var i=n();Ds(i),a&&Hr(o,i)&&(o=i,r.update(i))}),a=!0}if(r?.destroy)return()=>r.destroy()})}function Ys(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t=0;){var u=i+o;(i===0||is.includes(r[i-1]))&&(u===r.length||is.includes(r[u]))?r=(i===0?"":r.substring(0,i))+r.substring(u+1):i=u}}return r===""?null:r}function Ie(e,t,n,r,a,o){var i=e.__className;if(i!==n||i===void 0){var u=Lo(n,r,o);u==null?e.removeAttribute("class"):e.className=u,e.__className=n}else if(o&&a!==o)for(var l in o){var c=!!o[l];(a==null||c!==!!a[l])&&e.classList.toggle(l,c)}return o}function Br(e,t,n=!1){if(e.multiple){if(t==null)return;if(!Wn(t))return Da();for(var r of e.options)r.selected=t.includes(bn(r));return}for(r of e.options){var a=bn(r);if(qa(a,t)){r.selected=!0;return}}(!n||t!==void 0)&&(e.selectedIndex=-1)}function Zs(e){var t=new MutationObserver(()=>{Br(e,e.__value)});t.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),Kn(()=>{t.disconnect()})}function Wr(e,t,n=t){var r=!0;jr(e,"change",a=>{var o=a?"[selected]":":checked",i;if(e.multiple)i=[].map.call(e.querySelectorAll(o),bn);else{var u=e.querySelector(o)??e.querySelector("option:not([disabled])");i=u&&bn(u)}n(i)}),Fr(()=>{var a=t();if(Br(e,a,r),r&&a===void 0){var o=e.querySelector(":checked");o!==null&&(a=bn(o),n(a))}e.__value=a,r=!1}),Zs(e)}function bn(e){return"__value"in e?e.__value:e.value}const Po=Symbol("is custom element"),Ro=Symbol("is html");function vt(e,t,n,r){var a=Io(e);a[t]!==(a[t]=n)&&(t==="loading"&&(e[ba]=n),n==null?e.removeAttribute(t):typeof n!="string"&&To(e).includes(t)?e[t]=n:e.setAttribute(t,n))}function Io(e){return e.__attributes??={[Po]:e.nodeName.includes("-"),[Ro]:e.namespaceURI===Ua}}var ls=new Map;function To(e){var t=e.getAttribute("is")||e.nodeName,n=ls.get(t);if(n)return n;ls.set(t,n=[]);for(var r,a=e,o=Element.prototype;o!==a;){r=vs(a);for(var i in r)r[i].set&&n.push(i);a=Ir(a)}return n}function Nt(e,t,n=t){var r=new WeakSet;jr(e,"input",async a=>{var o=a?e.defaultValue:e.value;if(o=_r(e)?vr(o):o,n(o),Z!==null&&r.add(Z),await io(),o!==(o=t())){var i=e.selectionStart,u=e.selectionEnd;e.value=o??"",u!==null&&(e.selectionStart=i,e.selectionEnd=Math.min(u,e.value.length))}}),I(t)==null&&e.value&&(n(_r(e)?vr(e.value):e.value),Z!==null&&r.add(Z)),Sn(()=>{var a=t();if(e===document.activeElement){var o=On??Z;if(r.has(o))return}_r(e)&&a===vr(e.value)||e.type==="date"&&!a&&!e.value||a!==e.value&&(e.value=a??"")})}function tn(e,t,n=t){jr(e,"change",r=>{var a=r?e.defaultChecked:e.checked;n(a)}),I(t)==null&&n(e.checked),Sn(()=>{var r=t();e.checked=!!r})}function _r(e){var t=e.type;return t==="number"||t==="range"}function vr(e){return e===""?null:+e}function Ks(e,t,n){var r=Zt(e,t);r&&r.set&&(e[t]=n,Kn(()=>{e[t]=null}))}function us(e,t){return e===t||e?.[Ct]===t}function gt(e={},t,n,r){return Fr(()=>{var a,o;return Sn(()=>{a=o,o=[],I(()=>{e!==n(...o)&&(t(e,...o),a&&us(n(...a),e)&&t(null,...a))})}),()=>{qt(()=>{o&&us(n(...o),e)&&t(null,...o)})}}),e}function Rt(e=!1){const t=Q,n=t.l.u;if(!n)return;let r=()=>Ds(t.s);if(e){let a=0,o={};const i=Xn(()=>{let u=!1;const l=t.s;for(const c in l)l[c]!==o[c]&&(o[c]=l[c],u=!0);return u&&a++,a});r=()=>p(i)}n.b.length&&fo(()=>{cs(t,r),Hn(n.b)}),an(()=>{const a=I(()=>n.m.map(pa));return()=>{for(const o of a)typeof o=="function"&&o()}}),n.a.length&&an(()=>{cs(t,r),Hn(n.a)})}function cs(e,t){if(e.l.s)for(const n of e.l.s)p(n);t()}let Er=Symbol();function he(e,t,n){const r=n[t]??={store:null,source:Be(void 0),unsubscribe:et};if(r.store!==e&&!(Er in n))if(r.unsubscribe(),r.store=e??null,e==null)r.source.v=void 0,r.unsubscribe=et;else{var a=!0;r.unsubscribe=Qs(e,o=>{a?r.source.v=o:R(r.source,o)}),a=!1}return e&&Er in n?Le(e):p(r.source)}function In(e,t){return e.set(t),t}function ze(){const e={};function t(){Kn(()=>{for(var n in e)e[n].unsubscribe();Nn(e,Er,{enumerable:!1,value:!0})})}return[e,t]}function ae(e,t,n){return e.set(n),t}function nn(e,t,n,r){var a=r,o=!0,i=()=>(o&&(o=!1,a=r),a),u;u=e[t],u===void 0&&r!==void 0&&(u=i());var l;return l=()=>{var c=e[t];return c===void 0?i():(o=!0,c)},l}function Gr(e){Q===null&&ms(),kn&&Q.l!==null?Ao(Q).m.push(e):an(()=>{const t=I(e);if(typeof t=="function")return t})}function Oo(e){Q===null&&ms(),Gr(()=>()=>I(e))}function Ao(e){var t=e.l;return t.u??={a:[],b:[],m:[]}}function Qs(e,t,n){if(e==null)return t(void 0),et;const r=I(()=>e.subscribe(t,n));return r.unsubscribe?()=>r.unsubscribe():r}const zt=[];function Dt(e,t=et){let n=null;const r=new Set;function a(u){if(Hr(e,u)&&(e=u,n)){const l=!zt.length;for(const c of r)c[1](),zt.push(c,e);if(l){for(let c=0;c{r.delete(c),r.size===0&&n&&(n(),n=null)}}return{set:a,update:o,subscribe:i}}function Le(e){let t;return Qs(e,n=>t=n)(),t}var Lr=(e=>(e.info="info",e.warn="warn",e.error="error",e))(Lr||{});class Uo{logs=Dt([]);_addLog(t,n){this.logs.update(r=>(r.unshift({date:new Date,severity:t,content:n}),r))}info(t){this._addLog("info",t)}warn(t){this._addLog("warn",t)}error(t){this._addLog("error",t)}updateLogAtIndex(t,n){this.logs.update(r=>(r[t]&&(r[t].content=n),r))}}const A=new Uo;function No(e,t){let n=!1;return e.subscribe(r=>{n?t(r):n=!0})}const Ho={use_dark_theme:!0,rs_plugin_loader:!1,close_after_launch:!1,check_announcements:!0,flatpak_rich_presence:!1,runelite_use_custom_jar:!1,use_custom_rs_config_uri:!1,discard_expired_sessions:!0,rs_launch_command:null,osrs_launch_command:null,runelite_custom_jar:null,runelite_launch_command:null,hdos_launch_command:null,selected:{game:Ee.osrs,client:Yt.runelite,user_id:null},userDetails:{}};function Mo(){const t=new URLSearchParams(window.location.search).get("config");function n(a){return typeof a=="object"&&typeof a.use_dark_theme=="boolean"&&typeof a.rs_plugin_loader=="boolean"&&typeof a.close_after_launch=="boolean"&&typeof a.check_announcements=="boolean"&&typeof a.flatpak_rich_presence=="boolean"&&typeof a.runelite_use_custom_jar=="boolean"&&typeof a.selected=="object"&&Object.values(Ee).includes(a.selected.game)&&Object.values(Yt).includes(a.selected.client)&&(typeof a.selected.user_id=="string"||a.selected.user_id===null)&&typeof a.userDetails=="object"}const{config:r}=O;if(t)try{const a=JSON.parse(t);typeof a.check_announcements>"u"&&(a.check_announcements=!0,O.configHasPendingChanges=!0),typeof a.close_after_launch>"u"&&(a.close_after_launch=!1,O.configHasPendingChanges=!0),typeof a.discard_expired_sessions>"u"&&(a.discard_expired_sessions=!0,O.configHasPendingChanges=!0),n(a)?r.set(a):(A.error("The config saved on disk is not the correct format. It has been restored to default."),O.configHasPendingChanges=!0)}catch{A.error("Unable to parse config, restoring to default"),O.configHasPendingChanges=!0}else O.configHasPendingChanges=!0;No(O.config,()=>{O.configHasPendingChanges=!0})}const O={initialized:Dt(!1),configHasPendingChanges:!1,pluginConfigHasPendingChanges:!1,config:Dt(Ho),sessions:Dt([])};let pr=!1,hr=!1;class ee{static async login(t,n){const r=await Un.buildSession(t,n);if(!r.ok)return re(r.error);const a=r.value,i=Le(O.sessions).findIndex(u=>u.user.userId===t.sub);return i!==-1?O.sessions.update(u=>(u[i]=a,u)):(O.sessions.update(u=>(u.push(a),u)),O.config.update(u=>(u.selected.user_id=a.user.userId,u))),Ke(a)}static async logout(t){const{sessions:n,config:r}=O;return n.update(a=>{const o=a.findIndex(i=>i.user.userId===t);return o>-1&&(Pe.revokeOauthCreds(a[o].tokens.access_token),a.splice(o,1)),a}),r.update(a=>(typeof a.userDetails[t]<"u"&&delete a.userDetails[t],a.selected.user_id===t&&(a.selected.user_id=null),a)),Le(n)}static postJSON(t,n,r=null){const a=JSON.stringify(n);return fetch(t,{method:"POST",body:a,headers:{"Content-Type":"application/json"}}).then(i=>{i.ok||i.text().then(u=>A.error(`${t} error: ${i.status}: ${u}`)),r&&r(i)})}static saveConfig(t=!0){if(pr||t&&!O.configHasPendingChanges)return;pr=!0;const n=Le(O.config);return n.rs_launch_command===""&&(n.rs_launch_command=null),n.osrs_launch_command===""&&(n.osrs_launch_command=null),n.runelite_launch_command===""&&(n.runelite_launch_command=null),n.hdos_launch_command===""&&(n.hdos_launch_command=null),this.postJSON("/save-config",n,()=>pr=!1),n}static savePluginConfig(t=!0){hr||t&&!O.pluginConfigHasPendingChanges||(hr=!0,this.postJSON("/save-plugin-config",k.pluginConfig,()=>hr=!1))}static async saveCredentials(){return this.postJSON("/save-credentials",Le(O.sessions))}static async openFilePicker(){const t=await fetch("/jar-file-picker");return t.status===200?t.text():null}static findSession(t){return Le(O.sessions).find(r=>r.user.userId===t)}static findAccount(t,n){return t.find(r=>r.accountId==n)}}const Pr=Dt([]),Do="5";typeof window<"u"&&((window.__svelte??={}).v??=new Set).add(Do);Ra();var jo=L("
      ");function ea(e,t){const n=()=>he(o,"$config",r),[r,a]=ze(),{config:o}=O;let i=qe(()=>n().use_dark_theme);var u=jo();let l;var c=P(u);Bn(c,()=>t.children??et),V(f=>l=Ie(u,1,"fixed top-0 h-screen w-screen bg-slate-100 text-xs text-slate-900 duration-200 sm:text-sm md:text-base dark:bg-slate-900 dark:text-slate-50",null,l,f),[()=>({dark:p(i)})]),S(e,u),a()}var Fo=L('
      loading
      ');function qo(e,t){ye(t,!1);const n=window.opener;k.env==null&&o("BoltEnv is not defined. Please close and re-open Bolt to try again.");async function r(u){const l=Xt.get("auth_verifier");if(!l)return o("Verifier token has expired. Please try signing in again."),null;const{clientid:c,redirect:f}=k.env,d=await Pe.getOAuthToken(k.env.origin,c,l,f,u);return d.ok?d.value:(o(`Fetching OAuth token failed. ${d.error}`),null)}async function a(u){const l=Xt.get("auth_nonce"),c=Pe.validateIdToken(u,l??"");if(!c.ok)return o(c.error),null;const f=await Pe.getSessionId(k.env.auth_api,u);return f.ok?f.value:(o(`Unable to retreive session id. ${f.error}`),null)}function o(u){i({type:"authFailed",reason:u}),fetch("/close")}function i(u){n.postMessage(u,window.location.origin)}Gr(async()=>{const u=new URLSearchParams(window.location.search),l=u.get("code"),c=u.get("state"),f=u.get("id_token");if(f==null&&l&&c){const d=await r(l);if(!d)return o("tokens object is null.");i({type:"authTokenUpdate",tokens:d});const h=crypto.randomUUID();Pe.navigateToAuthConsent(k.env.origin,d.id_token,h)}else if(f&&l&&c){const d=await a(f);if(!d)return o("sessionId is null");i({type:"authSessionUpdate",sessionId:d}),fetch("/close")}else o("Authentication server did not response with the appropriate parameters. Please try again later.")}),Oo(()=>{Xt.remove("auth_verifier"),Xt.remove("auth_nonce")}),Rt(),ea(e,{children:(u,l)=>{var c=Fo();S(u,c)}}),ke()}var Bo=(e,t,n)=>{e.key==="Escape"&&(e.preventDefault(),t()&&n())},Wo=L(''),Go=L(" ");function Qn(e,t){ye(t,!0);const n=()=>he(o,"$config",r),[r,a]=ze(),{config:o}=O;let i=qe(()=>n().use_dark_theme),u=nn(t,"class",3,""),l=nn(t,"canSelfClose",3,!0),c=nn(t,"onClose",3,()=>{}),f,d=se(!1);function h(){f.showModal(),R(d,!0)}function _(){c()(),f.close(),R(d,!1)}var v={open:h,close:_},g=Go();g.__keydown=[Bo,l,_],g.__mousedown=$=>{f===$.target&&_()};let b;var x=P(g);{var y=$=>{var C=Wo();C.__click=_,S($,C)};X(x,$=>{l()&&$(y)})}var U=w(x,2);{var M=$=>{var C=ot(),H=G(C);Bn(H,()=>t.children??et),S($,C)};X(U,$=>{p(d)&&$(M)})}gt(g,$=>f=$,()=>f),V($=>b=Ie(g,1,`${u()??""} backdrop max-h-[90%] max-w-[90%] overflow-auto rounded-xl text-inherit focus-visible:outline-none`,"svelte-1nslvnn",b,$),[()=>({dark:p(i)})]),S(e,g);var j=ke(v);return a(),j}nt(["keydown","mousedown","click"]);var Vo=(e,t)=>p(t).close(),zo=L('

      ',1);function Jo(e,t){ye(t,!1);const n=()=>he(o,"$sessions",r),[r,a]=ze(),{sessions:o}=O;let i=Be();Gr(()=>{n().length==0&&p(i).open()}),Rt(),gt(Qn(e,{canSelfClose:!1,class:"w-1/2 text-center",children:(u,l)=>{var c=zo(),f=G(c);f.textContent=atob("Qm9sdCBpcyBhbiB1bm9mZmljaWFsIHRoaXJkLXBhcnR5IGxhdW5jaGVyLiBJdCdzIGZyZWUgYW5kIG9wZW4tc291cmNlIHNvZnR3YXJlIGxpY2Vuc2VkIHVuZGVyIEFHUEwgMy4wLg==");var d=w(f,2);d.textContent=atob("SmFnZXggaXMgbm90IHJlc3BvbnNpYmxlIGZvciBhbnkgcHJvYmxlbXMgb3IgZGFtYWdlIGNhdXNlZCBieSB1c2luZyB0aGlzIHByb2R1Y3Qu");var h=w(d,2);h.__click=[Vo,i],S(u,c)},$$slots:{default:!0},$$legacy:!0}),u=>R(i,u),()=>p(i)),ke(),a()}nt(["click"]);const Ue={method:"GET"},Xo={"Content-Type":"application/octet-stream"};let gr=null;const Yo=120*1e3,Zo="https://api.github.com/repos/runelite/launcher/releases",Ko="https://cdn.hdos.dev/client/getdown.txt",er=e=>e?{method:"POST",headers:Xo,body:e}:Ue,pt=(e,t,n,r)=>{fetch(e,t).then(a=>{a.ok?n(a):(a.text().then(o=>A.error(`request failed: ${a.url}: ${a.status}: ${o}`)),r())}).catch(()=>{A.error(`request failed: ${e}: connection error`),r()})},Vr=async(e,t,n,r,a)=>{const o=h=>{A.error(`error downloading: ${h}`),r()};A.info(t);const i=h=>A.updateLogAtIndex(0,`${t} ${h}`);if(!e.body)return o("no HTTP response body");const u=e.body.getReader();if(!u)return o("invalid HTTP response");const l=e.headers.get("content-length")??a;if(!l)return o("cannot estimate download size");const c=parseInt(l);if(!l)return o("cannot estimate download size");const f=new Uint8Array(c);let d=0;for(;;){const h=await u.read();if(h.done)break;const _=h.value;f.set(_,d),d+=_.length;const v=(Math.round(1e3*d/c)/10).toFixed(1);i(v)}i("done"),n(f)};function Qo(e,t,n){ee.saveConfig();const r=(u,l)=>{const c={},f=Le(O.config);u&&(c.hash=u),e&&(c.jx_session_id=e),t&&(c.jx_character_id=t),n&&(c.jx_display_name=n),f.rs_launch_command&&f.rs_launch_command.length>0&&(c.launch_command=f.rs_launch_command),f.rs_plugin_loader&&(c.plugin_loader="1"),f.use_custom_rs_config_uri&&f.rs_config_uri?c.config_uri=f.rs_config_uri:c.config_uri=k.env.default_config_uri,fetch("/launch-rs3-deb?".concat(new URLSearchParams(c).toString()),er(l)).then(d=>{d.text().then(h=>A.info(`game launch status: '${h.trim()}'`)),d.ok&&(u&&(k.rs3debInstalledHash=u),f.close_after_launch&&!f.rs_plugin_loader&&fetch("/close"))})},a=()=>{k.rs3debInstalledHash&&r()},o=k.env.content_url,i=o.concat("dists/trusty/non-free/binary-amd64/Packages");pt(i,Ue,u=>u.text().then(l=>{const c=Object.fromEntries(l.split(` +`).map(f=>f.split(": ")));if(!c.Filename||!c.Size||!c.SHA256){A.error(`could not parse package data from URL: ${i}`),a();return}if(c.SHA256===k.rs3debInstalledHash){A.info("game client is up-to-date"),r();return}pt(o.concat(c.Filename),Ue,f=>Vr(f,"downloading RS3 client...",d=>r(c.SHA256,d),r,c.Size),a)}),a)}function ta(e,t,n,r){ee.saveConfig();const a=r?"/launch-runelite-jar-configure?":"/launch-runelite-jar?",o=Le(O.config),i=(l,c,f)=>{const d={};l&&(d.id=l),f&&(d.jar_path=f),e&&(d.jx_session_id=e),t&&(d.jx_character_id=t),n&&(d.jx_display_name=n),o.runelite_launch_command&&o.runelite_launch_command!==""&&(d.launch_command=o.runelite_launch_command),o.flatpak_rich_presence&&(d.flatpak_rich_presence=""),fetch(a.concat(new URLSearchParams(d).toString()),er(c)).then(h=>{h.text().then(_=>A.info(`game launch status: '${_.trim()}'`)),h.ok&&(l&&(k.runeLiteInstalledId=l),o.close_after_launch&&!r&&fetch("/close"))})},u=()=>{k.runeLiteInstalledId&&i()};if(o.runelite_use_custom_jar){i(null,null,o.runelite_custom_jar);return}if(k.runeLiteInstalledId!==null&&gr!==null&&gr+Yo>Date.now()){i();return}pt(Zo,Ue,l=>l.json().then(c=>{gr=Date.now();const f=c.map(d=>d.assets).flat().find(d=>d.name.toLowerCase()=="runelite.jar");if(!f){A.info("note: no runelite releases found, so skipping update check"),u();return}if(f.id==k.runeLiteInstalledId){A.info("game is up-to-date"),i();return}pt(f.browser_download_url,Ue,d=>Vr(d,"downloading RuneLite launcher...",h=>i(f.id,h),u,f.size),u)}),u)}function ei(e,t,n){ee.saveConfig();const r=Le(O.config),a=(i,u)=>{const l={};i&&(l.version=i),e&&(l.jx_session_id=e),t&&(l.jx_character_id=t),n&&(l.jx_display_name=n),r.hdos_launch_command&&r.hdos_launch_command.length>0&&(l.launch_command=r.hdos_launch_command),fetch("/launch-hdos-jar?".concat(new URLSearchParams(l).toString()),er(u)).then(c=>{c.text().then(f=>A.info(`game launch status: '${f.trim()}'`)),c.ok&&(i&&(k.hdosInstalledVersion=i),r.close_after_launch&&fetch("/close"))})},o=()=>{k.hdosInstalledVersion&&a()};pt(Ko,Ue,i=>i.text().then(u=>{const l=u.match(/^launcher\.version *= *(.*?)$/m);if(!l||l.length<2){A.error("couldn't parse latest launcher version"),o();return}const c=l[1];if(c===k.hdosInstalledVersion){A.info("game is up-to-date"),a();return}pt(`https://cdn.hdos.dev/launcher/v${c}/hdos-launcher.jar`,Ue,f=>Vr(f,"downloading HDOS launcher...",d=>a(c,d),o),o)}),o)}function mr(){fetch("/list-game-clients",Ue).then(e=>{e.ok||e.text().then(t=>A.error(`failed to get client list: ${e.status}: ${t}`))})}function fs(e,t,n,r,a){ee.saveConfig();const o=`${t?"osrs":k.env.provider}-${e?"win":"mac"}`,i=t?"osrs":"rs3",u=e?"exe":"app",l=`${i}${u}InstalledHash`,c=(d,h)=>{const _={},v=Le(O.config),g=t?v.osrs_launch_command:v.rs_launch_command;d&&(_.hash=d),n&&(_.jx_session_id=n),r&&(_.jx_character_id=r),a&&(_.jx_display_name=a),g&&g!==""&&(_.launch_command=g),t||(v.rs_plugin_loader&&(_.plugin_loader="1"),_.config_uri=v.use_custom_rs_config_uri&&v.rs_config_uri?v.rs_config_uri:k.env.default_config_uri);const b=x=>fetch(`/launch-${i}-${u}?${new URLSearchParams(_).toString()}`,x).then(y=>{y.text().then(U=>A.info(`game launch status: '${U.trim()}'`)),y.ok&&(d&&(k[l]=d),v.close_after_launch&&(t||!v.rs_plugin_loader)&&fetch("/close"))});h?h.then(x=>b(er(x))):b(Ue)},f=()=>{k.hdosInstalledVersion&&c()};pt(`${k.env.direct6_url}${o}/${o}.json`,Ue,d=>d.text().then(h=>{const _=JSON.parse(atob(h.split(".")[1])).environments.production;if(k[l]===_.id){A.info("game client is up-to-date"),c();return}A.info(`downloading client version ${_.version}...`),pt(`${k.env.direct6_url}${o}/catalog/${_.id}/catalog.json`,Ue,v=>v.text().then(g=>{const b=JSON.parse(atob(g.split(".")[1])),x=y=>y.replace(/^http:\/\/(.{5})-akamai\.aws\.snxd\.com\//i,"https://$1.akamaized.net/").replace(/^http:/i,"https:");pt(x(b.metafile),Ue,y=>y.text().then(U=>{const M=JSON.parse(atob(U.split(".")[1])),j=M.pieces.digests.map(H=>{const F=atob(H).split("").map(te=>te.charCodeAt(0).toString(16).padStart(2,"0")).join(""),ue=x(b.config.remote.baseUrl).concat(b.config.remote.pieceFormat.replace("{SubString:0,2,{TargetDigest}}",F.substring(0,2)).replace("{TargetDigest}",F));return fetch(ue,Ue).then(te=>te.blob().then(D=>{const oe=new DecompressionStream("gzip");return new Response(D.slice(6).stream().pipeThrough(oe)).blob()}))});let $=0,C=null;for(let H=0;H{const F=new Blob(H).slice($,$+C);c(M.id,F.arrayBuffer())})}),f)}),f)}),f)}var ti=(e,t)=>{p(t).close()},ni=(e,t,n,r,a)=>{p(t)(p(n),p(r)),p(a).close()},ri=L('

      Game is offline


      This game appears to be offline for maintenance or an update. Launch anyway?

      ');function si(e,t){ye(t,!1);let n=Be(),r=Be(),a=Be(),o=Be();function i(l,c,f){R(o,l),R(r,c),R(a,f),p(n).open()}var u={open:i};return gt(Qn(e,{class:"h-fit w-3/5 px-5 py-3 text-center",children:(l,c)=>{var f=ri(),d=w(P(f),6),h=P(d);h.__click=[ti,n];var _=w(h,2);_.__click=[ni,o,r,a,n],S(l,f)},$$slots:{default:!0},$$legacy:!0}),l=>R(n,l),()=>p(n)),Ks(t,"open",i),ke(u)}nt(["click"]);const ai=()=>fetch("/open-external-url",{method:"POST",body:"https://bolt.adamcake.com/plugins"});var oi=(e,t)=>R(t,!1),ii=L("

      (start an RS3 game client with plugins enabled and it will be listed here.)

      "),li=(e,t,n,r,a,o,i)=>{R(t,p(n).uid,!0),R(r,!0),R(a,!1),R(o,""),R(i,null)},ui=L("
      ",1),ci=(e,t)=>R(t,null),fi=L(''),di=(e,t,n)=>{R(t,!p(t)),R(n,"")},_i=(e,t,n,r)=>{t(p(n)),R(r,!1),R(n,"")},vi=(e,t,n)=>{R(t,!1),R(n,"")},pi=L('

      ',1),hi=L('
      ',1),gi=L('


      ',1),mi=L("

      error


      ",1),bi=L("

      loading...

      "),wi=(e,t)=>fetch("/browse-plugin-config?".concat(new URLSearchParams({id:K(t)}).toString())),yi=(e,t,n,r)=>t(p(n),K(r)),ki=L('  ',1),xi=L('  
      ',1),Si=L(`

      You have no plugins installed. You can install plugins either from an updater URL, or by + downloading them onto your computer and selecting the "bolt.json" file.

      `),$i=L('
      ',1),Ci=(e,t,n,r,a,o,i)=>t(K(n),K(r),p(a)??null,p(o).main??i),Ei=L(''),Li=L("

      (no plugins installed)

      "),Pi=L("

      can't start plugin: does not appear to be configured

      "),Ri=(e,t,n,r)=>{t(K(n),p(r).uid)},Ii=L('

      '),Ti=L("

      "),Oi=L('


      ',1),Ai=L("

      error

      "),Ui=L("

      loading...

      "),Ni=L("
      ",1),Hi=L(' ',1),Mi=L("

      error

      "),Di=L('

      '),ji=L("

      "),Fi=L("

      ",1),qi=L('

      ',1);function Bi(e,t){ye(t,!0);const n=()=>he(Pr,"$clientList",r),[r,a]=ze();let o,i=se(null),u=se(!1);const l=k.platform==="windows"?"\\":"/",c="bolt.json",f=l.concat(c),d="main.lua";function h(){R(Ce,!1),o.open()}const _=m=>{console.log(m),R(i,m,!0),R(u,!1)},v=m=>{console.error(m),R(i,m,!0),R(u,!0)},g=m=>new Promise((E,N)=>{const W=m.concat(m.endsWith(l)?c:f);var T=new XMLHttpRequest;T.onreadystatechange=()=>{T.readyState==4&&(T.status==200?E(JSON.parse(T.responseText)):N(T.responseText))},T.open("GET","/read-json-file?".concat(new URLSearchParams({path:W}).toString()),!0),T.send()}),b=m=>fetch("/get-plugindir-json?".concat(new URLSearchParams({id:m}).toString())).then(E=>E.ok?E.json():null),x=m=>{const N=k.pluginConfig[m];if(!N)return null;const W=N.path;return W?g(W):b(m)},y=()=>{const m=Object.keys(k.pluginConfig);let E;do E=crypto.randomUUID();while(m.includes(E));return E},U="(unnamed)",M="(new character)",j=(m,E)=>{g(m).then(N=>{R(D,y(),!0),k.pluginConfig[K(D)]={name:N.name??U,path:m,version:N.version},O.pluginConfigHasPendingChanges=!0}).catch(N=>v(`config file '${E}' couldn't be fetched, reason: ${N}`))},$=m=>{_("downloading..."),fetch(m).then(async E=>{if(!E.ok){v(`can't install plugin: updater URL returned ${E.status}: ${E.statusText}`);return}const N=await E.json();if(N.url){const W=await fetch(N.url);if(!W.ok){v(`can't install plugin: remote download URL returned ${E.status}: ${E.statusText}`);return}const T=await W.arrayBuffer();if(N.sha256){const Je=await crypto.subtle.digest("SHA-256",T),Bt=Array.from(new Uint8Array(Je)).map(_n=>_n.toString(16).padStart(2,"0")).join("");if(N.sha256!==Bt){v("can't install plugin: incorrect file hash");return}}const J=y();if(!(await fetch("/install-plugin?".concat(new URLSearchParams({id:J}).toString()),{method:"POST",body:T})).ok){v(`can't install plugin: ${E.statusText}`);return}const _e=await b(J);_e?(R(D,J,!0),k.pluginConfig[K(D)]={name:_e.name??U,version:_e.version,updaterURL:m,sha256:N.sha256},O.pluginConfigHasPendingChanges=!0,_(`plugin '${_e.name}' installed`)):v(`can't install plugin: ${c} not found`)}}).catch(()=>{v("can't install plugin: unhandled exception")})};let C=se(!1);const H=()=>{R(C,!0);var m=new XMLHttpRequest;m.onreadystatechange=()=>{if(m.readyState==4&&(R(C,!1),m.status==200))if(m.responseText.endsWith(f)){const E=m.responseText.substring(0,m.responseText.length-c.length);j(E,m.responseText)}else v(`selection '${m.responseText}' is not named ${c}; ignored`)},m.open("GET","/json-file-picker",!0),m.send()};mr();const F=(m,E,N,W)=>{let T=null;if(N){const Y=k.platform==="windows"?N.replaceAll("\\","/"):N;T=Y.endsWith(l)?Y:Y.concat("/")}var J=new XMLHttpRequest;J.onreadystatechange=()=>{J.readyState==4&&(mr(),A.info(`Start-plugin status: ${J.statusText.trim()}`))},T?J.open("GET","/start-plugin?".concat(new URLSearchParams({client:m.toString(),id:E,main:W,path:T}).toString()),!0):J.open("GET","/start-plugin?".concat(new URLSearchParams({client:m.toString(),id:E,main:W}).toString()),!0),J.send()},ue=(m,E)=>{var N=new XMLHttpRequest;N.onreadystatechange=()=>{N.readyState==4&&(mr(),A.info(`Stop-plugin status: ${N.statusText.trim()}`))},N.open("GET","/stop-plugin?".concat(new URLSearchParams({client:m.toString(),uid:E.toString()}).toString()),!0),N.send()},te=(m,E)=>{const N=m.updaterURL;fetch(N).then(async W=>{if(!W.ok){v(`can't update plugin: updater URL returned ${W.status}: ${W.statusText}`);return}let T=await W.json();if(!T.url){_(`can't update plugin '${m.name}': no remote download URL is configured`);return}let J=!1;if(T.sha256?m.sha256!==T.sha256&&(J=!0):T.version&&m.version!==T.version&&(J=!0),J){const Y=await fetch(T.url);if(!Y.ok){v(`can't update plugin: remote download URL returned ${Y.status}: ${Y.statusText}`);return}const _e=await Y.arrayBuffer();if(T.sha256){const Bt=await crypto.subtle.digest("SHA-256",_e),_n=Array.from(new Uint8Array(Bt)).map(nr=>nr.toString(16).padStart(2,"0")).join("");if(T.sha256!==_n){v(`can't update plugin '${m.name}': incorrect file hash`);return}}fetch("/install-plugin?".concat(new URLSearchParams({id:E}).toString()),{method:"POST",body:_e});const Je=await b(E);Je?(T.sha256&&(m.sha256=T.sha256),Je.name&&(m.name=Je.name),Je.version&&(m.version=Je.version),O.pluginConfigHasPendingChanges=!0,_(`plugin '${Je.name}' updated`)):v(`can't update plugin '${m.name}': ${c} not found`)}else _(`plugin '${m.name}' is already up-to-date`)})};var D=se(""),oe=se(!1),Me=se(0);let Ce=se(!1),ce=se("");an(()=>{n().some(m=>m.uid===K(Me))||R(oe,!1)});let ge=qe(()=>k.pluginConfig[K(D)]),rt=qe(()=>x(K(D)));an(()=>{p(rt)&&p(rt).then(m=>{let E=!1;m.name!==p(ge).name&&(p(ge).name=m.name,E=!0),m.version!==p(ge).version&&(p(ge).version=m.version,E=!0),E&&(R(ge,p(ge)),O.pluginConfigHasPendingChanges=!0)})});let Cn=qe(()=>p(ge)?p(ge).path:null);var tr={open:h};gt(Qn(e,{class:"h-[90%] w-[90%] text-center",onClose:()=>ee.savePluginConfig(!0),children:(m,E)=>{var N=qi(),W=G(N),T=P(W);T.__click=[oi,oe];var J=w(T,4);{var Y=ve=>{var De=ii();S(ve,De)},_e=ve=>{var De=ot(),bt=G(De);$t(bt,1,n,Ut,(vn,It)=>{var Xe=ui(),ne=G(Xe);ne.__click=[li,Me,It,oe,Ce,ce,i];var Te=P(ne);V(()=>{Ie(ne,1,`m-1 h-[28px] w-[95%] select-none rounded-lg border-2 ${K(oe)&&K(Me)===p(It).uid?"border-black bg-blue-500 text-black":"border-blue-500 text-black dark:text-white"} hover:opacity-75`),me(Te,p(It).identity||M)}),S(vn,Xe)}),S(ve,De)};X(J,ve=>{n().length==0?ve(Y):ve(_e,!1)})}var Je=w(W,2),Bt=P(Je);{var _n=ve=>{var De=Hi(),bt=G(De);bt.__change=[ci,i],$t(bt,21,()=>Object.entries(k.pluginConfig),Ut,(ne,Te)=>{var Tt=qe(()=>ga(p(Te),2));let je=()=>p(Tt)[0],Oe=()=>p(Tt)[1];var st=fi(),Wt=P(st),Gt={};V(()=>{me(Wt,Oe().name??U),Gt!==(Gt=je())&&(st.value=(st.__value=je())??"")}),S(ne,st)});var vn=w(bt,2);{var It=ne=>{var Te=$i(),Tt=G(Te),je=P(Tt);je.__click=[di,Ce,ce];var Oe=w(je,2);Oe.__click=H;var st=w(Tt,4);{var Wt=ie=>{var pe=pi(),Ye=w(G(pe),2),wt=w(Ye,2);wt.__click=[_i,$,ce,Ce];var ut=w(wt,2);ut.__click=[vi,Ce,ce],Nt(Ye,()=>p(ce),xe=>R(ce,xe)),S(ie,pe)};X(st,ie=>{p(Ce)&&ie(Wt)})}var Gt=w(st,2);{var rr=ie=>{var pe=ot(),Ye=G(pe);{var wt=ut=>{var xe=xi(),ct=G(xe);os(ct,()=>p(rt),fe=>{var de=bi();S(fe,de)},(fe,de)=>{var Ze=gi(),kt=G(Ze),Ot=P(kt),or=w(Ot);{var oa=ir=>{var Jr=hi(),la=w(G(Jr),2),ua=P(la);V(()=>me(ua,`v${p(de).version??""}`)),S(ir,Jr)};X(or,ir=>{p(de).version&&ir(oa)})}var zr=w(kt,2),ia=P(zr);V(()=>{me(Ot,`${p(de).name??U??""} `),Ie(zr,1,An(p(de).description?null:"italic")),me(ia,p(de).description??"no description")}),S(fe,Ze)},fe=>{var de=mi();S(fe,de)});var En=w(ct,2);En.__click=()=>{const fe=k.pluginConfig[K(D)].path;fetch(fe?"/browse-directory?".concat(new URLSearchParams({path:fe}).toString()):"/browse-plugin-data?".concat(new URLSearchParams({id:K(D)}).toString()))};var Ln=w(En,2);Ln.__click=[wi,D];var yt=w(Ln,4);{var Pn=fe=>{var de=ki(),Ze=G(de);Ze.__click=[yi,te,ge,D],S(fe,de)};X(yt,fe=>{p(ge).updaterURL&&fe(Pn)})}var ar=w(yt,2);ar.__click=()=>{R(rt,null),O.pluginConfigHasPendingChanges=!0;let fe=k.pluginConfig;const de=fe[K(D)];de&&(fetch("/uninstall-plugin?".concat(new URLSearchParams({id:K(D),delete_data_dir:typeof de.path=="string"?"0":"1"}).toString())),_(`plugin '${de.name}' uninstalled`),delete fe[K(D)],k.pluginConfig=fe)},S(ut,xe)};X(Ye,ut=>{Object.keys(k.pluginConfig).includes(K(D))&&p(rt)!==null&&ut(wt)})}S(ie,pe)},sr=ie=>{var pe=Si();S(ie,pe)};X(Gt,ie=>{Object.entries(k.pluginConfig).length!==0?ie(rr):ie(sr,!1)})}V(()=>{je.disabled=!k.hasLibArchive||p(C),Oe.disabled=p(C)}),S(ne,Te)},Xe=ne=>{var Te=Ni(),Tt=w(G(Te),2);os(Tt,()=>p(rt),je=>{var Oe=Ui();S(je,Oe)},(je,Oe)=>{var st=Oi(),Wt=G(st);{var Gt=ie=>{var pe=Ei();pe.__click=[Ci,F,Me,D,Cn,Oe,d];var Ye=P(pe);V(()=>me(Ye,`Start ${p(Oe).name??""}`)),S(ie,pe)},rr=ie=>{var pe=ot(),Ye=G(pe);{var wt=xe=>{var ct=Li();S(xe,ct)},ut=xe=>{var ct=Pi();S(xe,ct)};X(Ye,xe=>{Object.entries(k.pluginConfig).length===0?xe(wt):xe(ut,!1)},!0)}S(ie,pe)};X(Wt,ie=>{p(Oe)&&p(Oe).main&&Object.keys(k.pluginConfig).includes(K(D))?ie(Gt):ie(rr,!1)})}var sr=w(Wt,8);$t(sr,1,n,Ut,(ie,pe)=>{var Ye=ot(),wt=G(Ye);{var ut=xe=>{var ct=ot(),En=G(ct);$t(En,17,()=>p(pe).plugins,Ut,(Ln,yt)=>{var Pn=ot(),ar=G(Pn);{var fe=Ze=>{var kt=Ii(),Ot=P(kt),or=w(Ot);or.__click=[Ri,ue,Me,yt],V(()=>me(Ot,`${k.pluginConfig[p(yt).id].name??p(yt).id??""} `)),S(Ze,kt)},de=Ze=>{var kt=Ti(),Ot=P(kt);V(()=>me(Ot,p(yt).id)),S(Ze,kt)};X(ar,Ze=>{Object.keys(k.pluginConfig).includes(p(yt).id)?Ze(fe):Ze(de,!1)})}S(Ln,Pn)}),S(xe,ct)};X(wt,xe=>{p(pe).uid===K(Me)&&xe(ut)})}S(ie,Ye)}),S(je,st)},je=>{var Oe=Ai();S(je,Oe)}),S(ne,Te)};X(vn,ne=>{K(oe)?ne(Xe,!1):ne(It)})}Wr(bt,()=>K(D),ne=>R(D,ne)),S(ve,De)},nr=ve=>{var De=Mi();S(ve,De)};X(Bt,ve=>{k.hasBoltPlugins?ve(_n):ve(nr,!1)})}var na=w(Bt,2);{var ra=ve=>{var De=Fi(),bt=w(G(De),3);{var vn=Xe=>{var ne=Di(),Te=P(ne);V(()=>me(Te,`[error] ${p(i)??""}`)),S(Xe,ne)},It=Xe=>{var ne=ji(),Te=P(ne);V(()=>me(Te,`[info] ${p(i)??""}`)),S(Xe,ne)};X(bt,Xe=>{p(u)?Xe(vn):Xe(It,!1)})}S(ve,De)};X(na,ve=>{p(i)&&ve(ra)})}var sa=w(Je,2),aa=P(sa);aa.__click=[ai],V(()=>Ie(T,1,`mx-auto mb-2 w-[95%] select-none rounded-lg border-2 ${K(oe)?"border-blue-500 text-black dark:text-white":"border-black bg-blue-500 text-black"} p-2 font-bold hover:opacity-75`)),S(m,N)},$$slots:{default:!0}}),m=>o=m,()=>o);var z=ke(tr);return a(),z}nt(["click","change"]);var Wi=L('
      '),Gi=L(''),Vi=L(''),zi=L(''),Ji=L(''),Xi=L(''),Yi=L('
      Launch icon
      ',1);function Zi(e,t){ye(t,!0);const n=()=>he(f,"$config",i),r=()=>he(g,"$psa",i),a=()=>he(b,"$gameEnabled",i),o=()=>he(d,"$initialized",i),[i,u]=ze();let l,c,{config:f,initialized:d}=O,h=qe(()=>n().selected.user_id),_=qe(()=>n().userDetails[p(h)??""]?.account_id),v=qe(()=>ee.findSession(n().selected.user_id)?.accounts??[]),g=Dt(null),b=Dt(!0);an(()=>{if(n().check_announcements){const z=n().selected.game==Ee.osrs?"osrs":k.env.provider,m=`${k.env.psa_url}${z}/${z}.json`;fetch(m,{method:"GET",cache:"no-store"}).then(E=>E.json()).then(E=>{In(g,E.psaEnabled&&E.psaMessage?E.psaMessage:null),In(b,!(E.playDisabled??!1))})}else In(g,null),In(b,!0)});function x(z,m){if(!p(h))return A.warn("Please log in or select a user to play.");if(!p(_))return A.warn("Please select a character from the select menu.");const E=ee.findSession(n().selected.user_id);if(!E)return A.warn("Unable to launch game, session was not found.");const{session_id:N}=E,W=ee.findAccount(E.accounts,p(_));if(!W)return A.warn("Unable to launch game, account was not found.");const{accountId:T,displayName:J}=W,Y=k.platform===wr.Windows,_e=k.platform===wr.Linux;switch(z){case Ee.osrs:switch(m){case Yt.official:fs(Y||_e,!0,N,T,J);break;case Yt.runelite:ta(N,T,J,!1);break;case Yt.hdos:ei(N,T,J);break}break;case Ee.rs3:_e?Qo(N,T,J):fs(Y,!1,N,T,J);break}}function y(z){const m=z.target.value;if(!p(h))return;const E=n().userDetails[p(h)];E?(E.account_id=m,ae(f,I(n).userDetails[p(h)]=E,I(n))):ae(f,I(n).userDetails[p(h)]={account_id:m},I(n))}var U={launch:x},M=Yi(),j=G(M);gt(si(j,{}),z=>l=z,()=>l);var $=w(j,2);gt(Bi($,{}),z=>c=z,()=>c);var C=w($,2),H=P(C);{var F=z=>{var m=Wi(),E=P(m);V(()=>me(E,r())),S(z,m)};X(H,z=>{r()&&z(F)})}var ue=w(H,2),te=w(P(ue),2);te.__click=()=>{a()?x(n().selected.game,n().selected.client):l.open(x,n().selected.game,n().selected.client)};var D=w(te,2);{var oe=z=>{var m=Vi(),E=w(P(m),2);$t(E,5,()=>ca[n().selected.game],Ut,(N,W)=>{var T=Gi(),J=P(T),Y={};V(()=>{me(J,p(W)),Y!==(Y=p(W))&&(T.value=(T.__value=p(W))??"")}),S(N,T)}),Wr(E,()=>n().selected.client,N=>ae(f,I(n).selected.client=N,I(n))),S(z,m)},Me=z=>{var m=ot(),E=G(m);{var N=W=>{var T=zi();T.__click=()=>{c.open()},V(()=>{T.disabled=!k.hasBoltPlugins,vt(T,"title",k.hasBoltPlugins?null:"This feature is disabled")}),S(W,T)};X(E,W=>{n().selected.game===Ee.rs3&&W(N)},!0)}S(z,m)};X(D,z=>{n().selected.game==Ee.osrs?z(oe):z(Me,!1)})}var Ce=w(D,2),ce=w(P(Ce),2);ce.__change=y;var ge=P(ce);ge.value=(ge.__value=void 0)??"";var rt=w(ge);$t(rt,17,()=>p(v),Ut,(z,m)=>{var E=Ji(),N=P(E);{var W=Y=>{var _e=ss();V(()=>me(_e,p(m).displayName)),S(Y,_e)},T=Y=>{var _e=ss("New Character");S(Y,_e)};X(N,Y=>{p(m).displayName?Y(W):Y(T,!1)})}var J={};V(()=>{J!==(J=p(m).accountId)&&(E.value=(E.__value=p(m).accountId)??"")}),S(z,E)},z=>{var m=Xi();S(z,m)});var Cn;Zs(ce),V(()=>{te.disabled=!o(),ce.disabled=!o()||n().selected.user_id===null,Cn!==(Cn=p(_))&&(ce.value=(ce.__value=p(_))??"",Br(ce,p(_)))}),S(e,M);var tr=ke(U);return u(),tr}nt(["click","change"]);var Ki=L("
    1. "),Qi=L('
      Message list icon
        ');function el(e,t){ye(t,!0);var n=Qi(),r=w(P(n),2);$t(r,21,()=>t.logs,Ut,(a,o)=>{let i=()=>p(o).date,u=()=>p(o).severity,l=()=>p(o).content;var c=Ki();let f;var d=P(c);V((h,_)=>{f=Ie(c,1,"",null,f,h),me(d,`${_??""} + - ${l()??""}`)},[()=>({"text-rose-500":u()===Lr.error,"text-orange-700":u()===Lr.warn}),()=>i()?.toLocaleTimeString()]),S(a,c)}),S(e,n),ke()}var tl=L(''),nl=()=>{const{origin:e,redirect:t,clientid:n}=k.env;Pe.openLoginWindow(e,t,n)},rl=async(e,t,n)=>{t().selected.user_id&&(await ee.logout(t().selected.user_id),ee.saveCredentials())},sl=L('
        ',1);function al(e,t){ye(t,!1);const n=()=>he(u,"$config",a),r=()=>he(i,"$sessions",a),[a,o]=ze(),{sessions:i,config:u}=O;Rt();var l=sl(),c=G(l);V(()=>{n(),ro(()=>{r()})});var f=P(c);f.value=(f.__value=null)??"";var d=w(f);$t(d,1,r,g=>g.user.userId,(g,b)=>{var x=tl(),y=P(x),U={};V(()=>{me(y,p(b).user.displayName),U!==(U=p(b).user.userId)&&(x.value=(x.__value=p(b).user.userId)??"")}),S(g,x)});var h=w(c,2),_=P(h);_.__click=[nl];var v=w(_,2);v.__click=[rl,n,u],V(()=>v.disabled=!n().selected.user_id),Wr(c,()=>n().selected.user_id,g=>ae(u,I(n).selected.user_id=g,I(n))),S(e,l),ke(),o()}nt(["click"]);function ol(e,{callback:t,ignore:n=[]}){const r=a=>{const o=n.some(i=>i.contains(a.target));e&&!e.contains(a.target)&&!a.defaultPrevented&&!o&&t()};return document.addEventListener("click",r,!0),document.addEventListener("contextmenu",r,!0),{destroy(){document.removeEventListener("click",r,!0),document.removeEventListener("contextmenu",r,!0)}}}function il(e,t,n,r){p(t)?n():r()}var ll=L("
        "),ul=L("
        ");function cl(e,t){ye(t,!0);const n=()=>he(o,"$config",r),[r,a]=ze(),{config:o}=O;let i=qe(()=>n().use_dark_theme),u=nn(t,"class",3,""),l=nn(t,"position",3,"bottom"),c=nn(t,"align",3,"start"),f=se(!1),d=se(void 0);function h(){R(f,!0)}function _(){R(f,!1)}var v={open:h,close:_},g=ul();let b;var x=P(g);x.__click=[il,f,_,h];var y=P(x);Bn(y,()=>t.children??et),gt(x,$=>R(d,$),()=>p(d));var U=w(x,2);{var M=$=>{var C=ll(),H=P(C);Bn(H,()=>t.content??et),Co(C,(F,ue)=>ol?.(F,ue),()=>({callback:_,ignore:[p(d)]})),V(()=>Ie(C,1,`dropdown-color absolute z-20 rounded-lg border-2 ${l()??""} ${c()??""}`,"svelte-11xj3vp")),S($,C)};X(U,$=>{p(f)&&$(M)})}V($=>b=Ie(g,1,`relative h-fit w-fit ${u()??""}`,"svelte-11xj3vp",b,$),[()=>({dark:p(i)})]),S(e,g);var j=ke(v);return a(),j}nt(["click"]);var fl=(e,t)=>{t()},dl=L('
        ',1);function _l(e,t){ye(t,!1);const n=()=>he(i,"$config",r),[r,a]=ze();function o(){var y=new XMLHttpRequest;y.open("GET","/browse-data"),y.onreadystatechange=()=>{y.readyState==4&&A.info(`Browse status: '${y.responseText.trim()}'`)},y.send()}const{config:i}=O,u="Allow checking for official announcements about game status. These will be displayed above the 'play' button. Disabling will reduce the number of web requests made when opening the launcher.",l="Close the launcher immediately after launching a game",c="Discard login sessions if they're no longer valid, prompting the player to sign-in again. If unchecked, the only way to discard a login will be by manually pressing the 'log out' button, even if your login no longer works.";Rt();var f=dl(),d=G(f);d.__click=[fl,o];var h=w(d,2);vt(h,"title",u);var _=w(P(h),2),v=w(h,2);vt(v,"title",l);var g=w(P(v),2),b=w(v,2);vt(b,"title",c);var x=w(P(b),2);tn(_,()=>n().check_announcements,y=>ae(i,I(n).check_announcements=y,I(n))),tn(g,()=>n().close_after_launch,y=>ae(i,I(n).close_after_launch=y,I(n))),tn(x,()=>n().discard_expired_sessions,y=>ae(i,I(n).discard_expired_sessions=y,I(n))),S(e,f),ke(),a()}nt(["click"]);var vl=(e,t)=>t(),pl=(e,t)=>{t()},hl=L('




        ',1);function gl(e,t){ye(t,!0);const n=()=>he(o,"$config",r),[r,a]=ze(),{config:o}=O;let i=qe(()=>ee.findSession(n().selected.user_id)),u=qe(()=>ee.findAccount(p(i)?.accounts??[],n().userDetails[n().selected.user_id??""]?.account_id)),l=se(!1);async function c(){R(l,!0),ae(o,I(n).runelite_custom_jar=await ee.openFilePicker(),I(n)),console.log("done picking"),R(l,!1)}function f(){!p(i)?.session_id||!p(u)?.accountId||!p(u)?.displayName||ta(p(i).session_id,p(u).accountId,p(u).displayName,!0)}var d=hl(),h=G(d);h.__click=[vl,f];var _=w(h,2),v=w(P(_),2),g=w(_,2);let b;var x=P(g),y=w(x,4);y.__click=[pl,c];var U=w(g,2),M=w(P(U),4);vt(M,"placeholder","%command%");var j=w(U,2),$=w(P(j),4);vt($,"placeholder","%command%");var C=w(j,2),H=w(P(C),4);vt(H,"placeholder","%command%"),V(F=>{h.disabled=!p(i)?.session_id||!p(u)?.accountId,b=Ie(g,1,"mx-auto p-2",null,b,F),x.disabled=!n().runelite_use_custom_jar,y.disabled=p(l)||!n().runelite_use_custom_jar},[()=>({"opacity-25":!n().runelite_use_custom_jar})]),tn(v,()=>n().runelite_use_custom_jar,F=>ae(o,I(n).runelite_use_custom_jar=F,I(n))),Nt(x,()=>n().runelite_custom_jar,F=>ae(o,I(n).runelite_custom_jar=F,I(n))),Nt(M,()=>n().osrs_launch_command,F=>ae(o,I(n).osrs_launch_command=F,I(n))),Nt($,()=>n().runelite_launch_command,F=>ae(o,I(n).runelite_launch_command=F,I(n))),Nt(H,()=>n().hdos_launch_command,F=>ae(o,I(n).hdos_launch_command=F,I(n))),S(e,d),ke(),a()}nt(["click"]);var ml=L('
        '),bl=L('

        ',1);function wl(e,t){ye(t,!1);const n=()=>he(o,"$config",r),[r,a]=ze(),{config:o}=O;Rt();var i=bl(),u=G(i);{var l=g=>{var b=ml(),x=w(P(b),2);tn(x,()=>n().rs_plugin_loader,y=>ae(o,I(n).rs_plugin_loader=y,I(n))),S(g,b)};X(u,g=>{k.hasBoltPlugins&&g(l)})}var c=w(u,2),f=w(P(c),2),d=w(c,2),h=P(d),_=w(d,2),v=w(P(_),4);vt(v,"placeholder","%command%"),V(()=>{h.disabled=!n().use_custom_rs_config_uri,vt(h,"placeholder",k.env.default_config_uri)}),tn(f,()=>n().use_custom_rs_config_uri,g=>ae(o,I(n).use_custom_rs_config_uri=g,I(n))),Nt(h,()=>n().rs_config_uri,g=>ae(o,I(n).rs_config_uri=g,I(n))),Nt(v,()=>n().rs_launch_command,g=>ae(o,I(n).rs_launch_command=g,I(n))),S(e,i),ke(),a()}var yl=(e,t,n)=>{R(t,n.general)},kl=(e,t,n)=>{R(t,n.osrs)},xl=(e,t,n)=>{R(t,n.rs3)},Sl=L('
        ');function $l(e,t){ye(t,!1);var n=(c=>(c[c.general=0]="general",c[c.osrs=1]="osrs",c[c.rs3=2]="rs3",c))(n||{});let r=Be(),a=Be(0),o="border-2 border-blue-500 bg-blue-500 hover:opacity-75 font-bold text-black duration-200 rounded-lg p-1 w-3/4",i="border-2 border-blue-500 hover:opacity-75 duration-200 rounded-lg p-1 w-3/4";function u(){p(r).open()}var l={open:u};return Rt(),gt(Qn(e,{class:"h-3/4 w-3/4 select-none",children:(c,f)=>{var d=Sl(),h=P(d),_=P(h);_.__click=[yl,a,n];var v=w(_,2);v.__click=[kl,a,n];var g=w(v,2);g.__click=[xl,a,n];var b=w(h,2),x=P(b);{var y=M=>{_l(M,{})},U=M=>{var j=ot(),$=G(j);{var C=F=>{gl(F,{})},H=F=>{var ue=ot(),te=G(ue);{var D=oe=>{wl(oe,{})};X(te,oe=>{p(a)==n.rs3&&oe(D)},!0)}S(F,ue)};X($,F=>{p(a)==n.osrs?F(C):F(H,!1)},!0)}S(M,j)};X(x,M=>{p(a)==n.general?M(y):M(U,!1)})}V(()=>{Ie(_,1,An(p(a)===n.general?o:i)),Ie(v,1,An(p(a)===n.osrs?o:i)),Ie(g,1,An(p(a)===n.rs3?o:i))}),S(c,d)},$$slots:{default:!0},$$legacy:!0}),c=>R(r,c),()=>p(r)),Ks(t,"open",u),ke(l)}nt(["click"]);var Cl=(e,t,n)=>{ae(n,I(t).selected.game=Ee.rs3,I(t))},El=(e,t,n)=>{ae(n,I(t).selected.game=Ee.osrs,I(t))},Ll=(e,t,n)=>ae(n,I(t).use_dark_theme=!t().use_dark_theme,I(t)),Pl=(e,t)=>p(t).open(),Rl=L('
        '),Il=L(''),Tl=()=>{const{origin:e,redirect:t,clientid:n}=k.env;Pe.openLoginWindow(e,t,n)},Ol=L(''),Al=L('
        ',1);function Ul(e,t){ye(t,!1);const n=()=>he(i,"$config",a),r=()=>he(u,"$sessions",a),[a,o]=ze(),{config:i,sessions:u}=O;let l=Be();Rt();var c=Al(),f=G(c);gt($l(f,{$$legacy:!0}),C=>R(l,C),()=>p(l));var d=w(f,2),h=P(d),_=P(h);let v;_.__click=[Cl,n,i];var g=w(_,2);let b;g.__click=[El,n,i];var x=w(h,2),y=P(x);y.__click=[Ll,n,i];var U=w(y,2);U.__click=[Pl,l];var M=w(U,2);{var j=C=>{const H=Mr(()=>ee.findSession(n().selected.user_id??""));cl(C,{align:"center",content:ue=>{var te=Rl(),D=P(te);al(D,{}),S(ue,te)},children:(ue,te)=>{var D=Il(),oe=P(D);V(()=>me(oe,p(H)?.user.displayName??"No user selected")),S(ue,D)},$$slots:{content:!0,default:!0}})},$=C=>{var H=Ol();H.__click=[Tl],S(C,H)};X(M,C=>{r().length>0?C(j):C($,!1)})}V((C,H)=>{v=Ie(_,1,"mx-1 w-20 rounded-lg border-2 border-blue-500 p-2 duration-200 hover:opacity-75",null,v,C),b=Ie(g,1,"mx-1 w-20 rounded-lg border-2 border-blue-500 bg-blue-500 p-2 text-black duration-200 hover:opacity-75",null,b,H)},[()=>({"text-black":n().selected.game===Ee.rs3,"bg-blue-500":n().selected.game===Ee.rs3}),()=>({"text-black":n().selected.game===Ee.osrs,"bg-blue-500":n().selected.game===Ee.osrs})]),S(e,c),ke(),o()}nt(["click"]);var Nl=L('
        ',1);function Hl(e,t){ye(t,!1);const n=()=>he(o,"$logs",r),[r,a]=ze(),o=A.logs;Rt(),wo("beforeunload",kr,()=>{ee.saveConfig(),k.hasBoltPlugins&&ee.savePluginConfig(!0)}),ea(e,{children:(i,u)=>{var l=Nl(),c=G(l);Jo(c,{});var f=w(c,2);Ul(f,{});var d=w(f,2),h=w(P(d),2);Zi(h,{});var _=w(d,2);el(_,{get logs(){return n()}}),S(i,l)}}),ke(),a()}const ds={target:document.getElementById("app")};window.opener||window.location.search.includes("&id_token")?as(qo,ds):(Ml(),Mo(),Dl(),jl().finally(()=>{O.initialized.set(!0)}),as(Hl,ds));function Ml(){const e=new URLSearchParams(window.location.search);k.platform=e.get("platform"),k.isFlathub=e.get("flathub")==="1",k.hasLibArchive=e.get("has_libarchive")==="1",k.rs3debInstalledHash=e.get("rs3_deb_installed_hash"),k.rs3exeInstalledHash=e.get("rs3_exe_installed_hash"),k.rs3appInstalledHash=e.get("rs3_app_installed_hash"),k.osrsexeInstalledHash=e.get("osrs_exe_installed_hash"),k.osrsappInstalledHash=e.get("osrs_app_installed_hash"),k.runeLiteInstalledId=e.get("runelite_installed_id"),k.hdosInstalledVersion=e.get("hdos_installed_version");const t=e.get("plugins");if(k.hasBoltPlugins=t!==null,t!==null)try{k.pluginConfig=JSON.parse(t)}catch{A.error("Unable to parse plugin list")}const n=e.get("credentials");if(n)try{const r=JSON.parse(n),a=r.every(o=>typeof o.session_id=="string"&&typeof o.tokens=="object"&&typeof o.accounts=="object"&&typeof o.user=="object");a?O.sessions.set(r):(O.sessions.set([]),ee.saveCredentials(),A.warn("Credentials saved on disk are out of date. Please sign in again.")),O.sessions.set(a?r:[])}catch{O.sessions.set([]),ee.saveCredentials(),A.error("Unable to parse saved credentials. Please sign in again.")}}function Dl(){const{origin:e,origin_2fa:t}=k.env,n=[window.location.origin,e,t];let r=null;window.addEventListener("message",async a=>{if(!n.includes(a.origin)){A.info(`discarding window message from origin ${a.origin}`);return}switch(a.data.type){case"authTokenUpdate":{r=a.data.tokens;break}case"authSessionUpdate":{if(r===null)return A.error("auth is null. Please try again.");const o=a.data.sessionId,i=await ee.login(r,o);i.ok?A.info(`Added new user '${i.value.user.displayName}'`):A.error(`Unable to add new user. Please try again. ${i.error}`),ee.saveCredentials(),Pe.pendingLoginWindow=null,r=null;break}case"authFailed":{A.error(`Unable to authenticate: ${a.data.reason}`),Pe.pendingLoginWindow=null,r=null;break}case"externalUrl":{const o=new XMLHttpRequest;o.onreadystatechange=()=>{o.readyState==4&&A.info(`External URL status: '${o.responseText.trim()}'`)},o.open("POST","/open-external-url",!0),o.send(a.data.url);break}case"gameClientList":Le(O.config).close_after_launch&&a.data.clients.length>Le(Pr).length?fetch("/close"):Pr.set(a.data.clients);break;default:{const o=a.data?.type??"no type provided";A.info(`Unknown message type: ${o}`);break}}})}async function jl(){const e=Le(O.config).discard_expired_sessions,t=Le(O.sessions),n=[];t.length>0&&A.info("Logging in...");const r=t.map(i=>({promise:Pe.refreshOAuthToken(i.tokens),session:i})),a=[];for(const i of r){const u=i.session,l=await i.promise;if(!l.ok){l.error===0?A.error(`Unable to verify saved login, status: ${l.error}. Do you have an internet connection? Please relaunch Bolt to try again.`):l.error>=400&&l.error<500&&e?(A.error(`Discarding expired login, status: ${l.error}. Please sign in again.`),n.push(u.tokens.sub)):A.error(`Unable to verify saved login due to HTTP error ${l.error}`);continue}const c=l.value;u.tokens=c,a.push({promise:ee.login(c,u.session_id),session:u})}for(const i of a){const u=i.session,l=await i.promise;l.ok?A.info(`Signed into saved user '${l.value.user.displayName}'`):(A.error(`Unable to sign into saved user '${u.user.displayName}' due to an error: ${l.error}`),e&&n.push(u.tokens.sub))}const o=n.map(ee.logout);for(const i of o)await i;O.sessions.set(t),await ee.saveCredentials()} diff --git a/app/dist/index.html b/app/dist/index.html index e6090f40..2b8fc748 100644 --- a/app/dist/index.html +++ b/app/dist/index.html @@ -4,7 +4,7 @@ Bolt Launcher - + diff --git a/app/src/AuthApp.svelte b/app/src/AuthApp.svelte index ed4b87b3..51eba9ef 100644 --- a/app/src/AuthApp.svelte +++ b/app/src/AuthApp.svelte @@ -3,7 +3,7 @@ import { AuthService, type AuthTokens } from '$lib/Services/AuthService'; import { CookieService } from '$lib/Services/CookieService'; import { bolt } from '$lib/State/Bolt'; - import type { BoltMessage } from '$lib/Util/interfaces'; + import type { BoltMessage } from '$lib/Util/Interfaces'; import { onDestroy, onMount } from 'svelte'; const parentWindow = window.opener as { diff --git a/app/src/lib/Components/CommonUI/Dropdown.svelte b/app/src/lib/Components/CommonUI/Dropdown.svelte index 873486c1..54a98f5f 100644 --- a/app/src/lib/Components/CommonUI/Dropdown.svelte +++ b/app/src/lib/Components/CommonUI/Dropdown.svelte @@ -2,6 +2,9 @@ import { GlobalState } from '$lib/State/GlobalState'; import clickOutside from '$lib/Util/ClickOutside'; + const { config } = GlobalState; + let darkTheme = $derived($config.use_dark_theme); + interface Props { class?: string; position?: 'top' | 'right' | 'bottom' | 'left'; @@ -9,9 +12,6 @@ children?: import('svelte').Snippet; content?: import('svelte').Snippet; } - const { config } = GlobalState; - let darkTheme = $derived($config.use_dark_theme); - let { class: className = '', position = 'bottom', @@ -21,7 +21,7 @@ }: Props = $props(); let isOpen = $state(false); - let openButton: HTMLButtonElement = $state(); + let openButton: HTMLButtonElement | undefined = $state(); export function open() { isOpen = true; diff --git a/app/src/lib/Components/CommonUI/Modal.svelte b/app/src/lib/Components/CommonUI/Modal.svelte index 6eced34e..deea4d54 100644 --- a/app/src/lib/Components/CommonUI/Modal.svelte +++ b/app/src/lib/Components/CommonUI/Modal.svelte @@ -1,14 +1,15 @@ diff --git a/app/src/lib/Components/Settings/OsrsSettingsTab.svelte b/app/src/lib/Components/Settings/OsrsSettingsTab.svelte index 5b040335..54051215 100644 --- a/app/src/lib/Components/Settings/OsrsSettingsTab.svelte +++ b/app/src/lib/Components/Settings/OsrsSettingsTab.svelte @@ -1,7 +1,7 @@ + diff --git a/app/src/lib/Components/Modals/PluginModal.svelte b/app/src/lib/Components/Modals/PluginModal.svelte index 1b0bda6e..be6471b9 100644 --- a/app/src/lib/Components/Modals/PluginModal.svelte +++ b/app/src/lib/Components/Modals/PluginModal.svelte @@ -16,6 +16,7 @@ let messageText: string | null = $state(null); let messageIsError: boolean = $state(false); + let pluginList: { [key: string] : PluginMeta } = $state(bolt.pluginConfig); const platformFileSep: string = bolt.platform === 'windows' ? '\\' : '/'; const configFileName: string = 'bolt.json'; @@ -27,6 +28,11 @@ modal.open(); } + const close = () => { + bolt.pluginConfig = pluginList; + BoltService.savePluginConfig(true); + } + const setMessageInfo = (msg: string) => { console.log(msg); messageText = msg; @@ -69,8 +75,7 @@ }; const getPluginConfigPromiseFromID = (id: string): Promise | null => { - const list = bolt.pluginConfig; - const meta = list[id]; + const meta = pluginList[id]; if (!meta) return null; const path = meta.path; if (path) return getPluginConfigPromiseFromPath(path); @@ -78,7 +83,7 @@ }; const getNewPluginID = () => { - const ids = Object.keys(bolt.pluginConfig); + const ids = Object.keys(pluginList); let id; do { id = crypto.randomUUID(); @@ -93,7 +98,7 @@ getPluginConfigPromiseFromPath(folderPath) .then((plugin: PluginConfig) => { selectedPlugin = getNewPluginID(); - bolt.pluginConfig[selectedPlugin] = { + pluginList[selectedPlugin] = { name: plugin.name ?? unnamedPluginName, path: folderPath, version: plugin.version @@ -147,7 +152,7 @@ const plugin = await getPluginConfigPromiseFromDataDir(id); if (plugin) { selectedPlugin = id; - bolt.pluginConfig[selectedPlugin] = { + pluginList[selectedPlugin] = { name: plugin.name ?? unnamedPluginName, version: plugin.version, updaterURL: url, @@ -336,7 +341,7 @@ isClientSelected = false; } }); - let selectedPluginMeta = $derived(bolt.pluginConfig[selectedPlugin]); + let selectedPluginMeta = $derived(pluginList[selectedPlugin]); let managementPluginPromise = $derived(getPluginConfigPromiseFromID(selectedPlugin)); $effect(() => { if (managementPluginPromise) { @@ -364,7 +369,7 @@ BoltService.savePluginConfig(true)} + onClose={() => close() } >
        (messageText = null)} > - {#each Object.entries(bolt.pluginConfig) as [id, plugin]} + {#each Object.entries(pluginList) as [id, plugin]} {/each} @@ -464,8 +469,8 @@ >

        {/if} - {#if Object.entries(bolt.pluginConfig).length !== 0} - {#if Object.keys(bolt.pluginConfig).includes(selectedPlugin) && managementPluginPromise !== null} + {#if Object.entries(pluginList).length !== 0} + {#if Object.keys(pluginList).includes(selectedPlugin) && managementPluginPromise !== null} {#await managementPluginPromise}

        loading...

        {:then plugin} @@ -489,7 +494,7 @@ - {:else if Object.entries(bolt.pluginConfig).length === 0} + {:else if Object.entries(pluginList).length === 0}

        (no plugins installed)

        {:else}

        can't start plugin: does not appear to be configured

        @@ -585,9 +588,9 @@ {#each $clientList as client} {#if client.uid === selectedClientId} {#each client.plugins as activePlugin} - {#if Object.keys(bolt.pluginConfig).includes(activePlugin.id)} + {#if Object.keys(pluginList).includes(activePlugin.id)}

        - {bolt.pluginConfig[activePlugin.id].name ?? activePlugin.id} + {pluginList[activePlugin.id].name ?? activePlugin.id} '),zo=L("

        ");function nr(e,t){me(t,!0);const n=()=>ve(o,"$config",r),[r,a]=Je(),{config:o}=O;let i=Be(()=>n().use_dark_theme),u=ln(t,"class",3,""),l=ln(t,"canSelfClose",3,!0),c=ln(t,"onClose",3,()=>{}),f,d=oe(!1);function p(){f.showModal(),P(d,!0)}function _(){c()(),f.close(),P(d,!1)}var h={open:p,close:_},g=zo();g.__keydown=[Go,l,_],g.__mousedown=S=>{f===S.target&&_()};let m;var k=C(g);{var b=S=>{var E=Vo();E.__click=_,x(S,E)};J(k,S=>{l()&&S(b)})}var U=w(k,2);{var H=S=>{var E=lt(),M=B(E);Vn(M,()=>t.children??nt),x(S,E)};J(U,S=>{v(d)&&S(H)})}wt(g,S=>f=S,()=>f),W(S=>m=Ie(g,1,`${u()??""} backdrop max-h-[90%] max-w-[90%] overflow-auto rounded-xl text-inherit focus-visible:outline-none`,"svelte-1nslvnn",m,S),[()=>({dark:v(i)})]),x(e,g);var D=be(h);return a(),D}st(["keydown","mousedown","click"]);var Jo=(e,t)=>v(t).close(),Xo=L('

        ',1);function Yo(e,t){me(t,!1);const n=()=>ve(o,"$sessions",r),[r,a]=Je(),{sessions:o}=O;let i=We();zr(()=>{n().length==0&&v(i).open()}),At(),wt(nr(e,{canSelfClose:!1,class:"w-1/2 text-center",children:(u,l)=>{var c=Xo(),f=B(c);f.textContent=atob("Qm9sdCBpcyBhbiB1bm9mZmljaWFsIHRoaXJkLXBhcnR5IGxhdW5jaGVyLiBJdCdzIGZyZWUgYW5kIG9wZW4tc291cmNlIHNvZnR3YXJlIGxpY2Vuc2VkIHVuZGVyIEFHUEwgMy4wLg==");var d=w(f,2);d.textContent=atob("SmFnZXggaXMgbm90IHJlc3BvbnNpYmxlIGZvciBhbnkgcHJvYmxlbXMgb3IgZGFtYWdlIGNhdXNlZCBieSB1c2luZyB0aGlzIHByb2R1Y3Qu");var p=w(d,2);p.__click=[Jo,i],x(u,c)},$$slots:{default:!0},$$legacy:!0}),u=>P(i,u),()=>v(i)),be(),a()}st(["click"]);const Ne={method:"GET"},Zo={"Content-Type":"application/octet-stream"};let br=null;const Ko=120*1e3,Qo="https://api.github.com/repos/runelite/launcher/releases",ei="https://cdn.hdos.dev/client/getdown.txt",rr=e=>e?{method:"POST",headers:Zo,body:e}:Ne,mt=(e,t,n,r)=>{fetch(e,t).then(a=>{a.ok?n(a):(a.text().then(o=>A.error(`request failed: ${a.url}: ${a.status}: ${o}`)),r())}).catch(()=>{A.error(`request failed: ${e}: connection error`),r()})},Jr=async(e,t,n,r,a)=>{const o=p=>{A.error(`error downloading: ${p}`),r()};A.info(t);const i=p=>A.updateLogAtIndex(0,`${t} ${p}`);if(!e.body)return o("no HTTP response body");const u=e.body.getReader();if(!u)return o("invalid HTTP response");const l=e.headers.get("content-length")??a;if(!l)return o("cannot estimate download size");const c=parseInt(l);if(!l)return o("cannot estimate download size");const f=new Uint8Array(c);let d=0;for(;;){const p=await u.read();if(p.done)break;const _=p.value;f.set(_,d),d+=_.length;const h=(Math.round(1e3*d/c)/10).toFixed(1);i(h)}i("done"),n(f)};function ti(e,t,n){te.saveConfig();const r=(u,l)=>{const c={},f=Ce(O.config);u&&(c.hash=u),e&&(c.jx_session_id=e),t&&(c.jx_character_id=t),n&&(c.jx_display_name=n),f.rs_launch_command&&f.rs_launch_command.length>0&&(c.launch_command=f.rs_launch_command),f.rs_plugin_loader&&(c.plugin_loader="1"),f.use_custom_rs_config_uri&&f.rs_config_uri?c.config_uri=f.rs_config_uri:c.config_uri=$.env.default_config_uri,fetch("/launch-rs3-deb?".concat(new URLSearchParams(c).toString()),rr(l)).then(d=>{d.text().then(p=>A.info(`game launch status: '${p.trim()}'`)),d.ok&&(u&&($.rs3debInstalledHash=u),f.close_after_launch&&!f.rs_plugin_loader&&fetch("/close"))})},a=()=>{$.rs3debInstalledHash&&r()},o=$.env.content_url,i=o.concat("dists/trusty/non-free/binary-amd64/Packages");mt(i,Ne,u=>u.text().then(l=>{const c=Object.fromEntries(l.split(` `).map(f=>f.split(": ")));if(!c.Filename||!c.Size||!c.SHA256){A.error(`could not parse package data from URL: ${i}`),a();return}if(c.SHA256===$.rs3debInstalledHash){A.info("game client is up-to-date"),r();return}mt(o.concat(c.Filename),Ne,f=>Jr(f,"downloading RS3 client...",d=>r(c.SHA256,d),r,c.Size),a)}),a)}function ra(e,t,n,r){te.saveConfig();const a=r?"/launch-runelite-jar-configure?":"/launch-runelite-jar?",o=Ce(O.config),i=(l,c,f)=>{const d={};l&&(d.id=l),f&&(d.jar_path=f),e&&(d.jx_session_id=e),t&&(d.jx_character_id=t),n&&(d.jx_display_name=n),o.runelite_launch_command&&o.runelite_launch_command!==""&&(d.launch_command=o.runelite_launch_command),o.flatpak_rich_presence&&(d.flatpak_rich_presence=""),fetch(a.concat(new URLSearchParams(d).toString()),rr(c)).then(p=>{p.text().then(_=>A.info(`game launch status: '${_.trim()}'`)),p.ok&&(l&&($.runeLiteInstalledId=l),o.close_after_launch&&!r&&fetch("/close"))})},u=()=>{$.runeLiteInstalledId&&i()};if(o.runelite_use_custom_jar){i(null,null,o.runelite_custom_jar);return}if($.runeLiteInstalledId!==null&&br!==null&&br+Ko>Date.now()){i();return}mt(Qo,Ne,l=>l.json().then(c=>{br=Date.now();const f=c.map(d=>d.assets).flat().find(d=>d.name.toLowerCase()=="runelite.jar");if(!f){A.info("note: no runelite releases found, so skipping update check"),u();return}if(f.id==$.runeLiteInstalledId){A.info("game is up-to-date"),i();return}mt(f.browser_download_url,Ne,d=>Jr(d,"downloading RuneLite launcher...",p=>i(f.id,p),u,f.size),u)}),u)}function ni(e,t,n){te.saveConfig();const r=Ce(O.config),a=(i,u)=>{const l={};i&&(l.version=i),e&&(l.jx_session_id=e),t&&(l.jx_character_id=t),n&&(l.jx_display_name=n),r.hdos_launch_command&&r.hdos_launch_command.length>0&&(l.launch_command=r.hdos_launch_command),fetch("/launch-hdos-jar?".concat(new URLSearchParams(l).toString()),rr(u)).then(c=>{c.text().then(f=>A.info(`game launch status: '${f.trim()}'`)),c.ok&&(i&&($.hdosInstalledVersion=i),r.close_after_launch&&fetch("/close"))})},o=()=>{$.hdosInstalledVersion&&a()};mt(ei,Ne,i=>i.text().then(u=>{const l=u.match(/^launcher\.version *= *(.*?)$/m);if(!l||l.length<2){A.error("couldn't parse latest launcher version"),o();return}const c=l[1];if(c===$.hdosInstalledVersion){A.info("game is up-to-date"),a();return}mt(`https://cdn.hdos.dev/launcher/v${c}/hdos-launcher.jar`,Ne,f=>Jr(f,"downloading HDOS launcher...",d=>a(c,d),o),o)}),o)}function wr(){fetch("/list-game-clients",Ne).then(e=>{e.ok||e.text().then(t=>A.error(`failed to get client list: ${e.status}: ${t}`))})}function _s(e,t,n,r,a){te.saveConfig();const o=`${t?"osrs":$.env.provider}-${e?"win":"mac"}`,i=t?"osrs":"rs3",u=e?"exe":"app",l=`${i}${u}InstalledHash`,c=(d,p)=>{const _={},h=Ce(O.config),g=t?h.osrs_launch_command:h.rs_launch_command;d&&(_.hash=d),n&&(_.jx_session_id=n),r&&(_.jx_character_id=r),a&&(_.jx_display_name=a),g&&g!==""&&(_.launch_command=g),t||(h.rs_plugin_loader&&(_.plugin_loader="1"),_.config_uri=h.use_custom_rs_config_uri&&h.rs_config_uri?h.rs_config_uri:$.env.default_config_uri);const m=k=>fetch(`/launch-${i}-${u}?${new URLSearchParams(_).toString()}`,k).then(b=>{b.text().then(U=>A.info(`game launch status: '${U.trim()}'`)),b.ok&&(d&&($[l]=d),h.close_after_launch&&(t||!h.rs_plugin_loader)&&fetch("/close"))});p?p.then(k=>m(rr(k))):m(Ne)},f=()=>{$.hdosInstalledVersion&&c()};mt(`${$.env.direct6_url}${o}/${o}.json`,Ne,d=>d.text().then(p=>{const _=JSON.parse(atob(p.split(".")[1])).environments.production;if($[l]===_.id){A.info("game client is up-to-date"),c();return}A.info(`downloading client version ${_.version}...`),mt(`${$.env.direct6_url}${o}/catalog/${_.id}/catalog.json`,Ne,h=>h.text().then(g=>{const m=JSON.parse(atob(g.split(".")[1])),k=b=>b.replace(/^http:\/\/(.{5})-akamai\.aws\.snxd\.com\//i,"https://$1.akamaized.net/").replace(/^http:/i,"https:");mt(k(m.metafile),Ne,b=>b.text().then(U=>{const H=JSON.parse(atob(U.split(".")[1])),D=H.pieces.digests.map(M=>{const j=atob(M).split("").map(re=>re.charCodeAt(0).toString(16).padStart(2,"0")).join(""),ce=k(m.config.remote.baseUrl).concat(m.config.remote.pieceFormat.replace("{SubString:0,2,{TargetDigest}}",j.substring(0,2)).replace("{TargetDigest}",j));return fetch(ce,Ne).then(re=>re.blob().then(ne=>{const Se=new DecompressionStream("gzip");return new Response(ne.slice(6).stream().pipeThrough(Se)).blob()}))});let S=0,E=null;for(let M=0;M{const j=new Blob(M).slice(S,S+E);c(H.id,j.arrayBuffer())})}),f)}),f)}),f)}var ri=(e,t)=>{v(t).close()},si=(e,t,n,r,a)=>{v(t)(v(n),v(r)),v(a).close()},ai=L('

        Game is offline


        This game appears to be offline for maintenance or an update. Launch anyway?

        ');function oi(e,t){me(t,!1);let n=We(),r=We(),a=We(),o=We();function i(l,c,f){P(o,l),P(r,c),P(a,f),v(n).open()}var u={open:i};return wt(nr(e,{class:"h-fit w-3/5 px-5 py-3 text-center",children:(l,c)=>{var f=ai(),d=w(C(f),6),p=C(d);p.__click=[ri,n];var _=w(p,2);_.__click=[si,o,r,a,n],x(l,f)},$$slots:{default:!0},$$legacy:!0}),l=>P(n,l),()=>v(n)),ea(t,"open",i),be(u)}st(["click"]);const ii=()=>fetch("/open-external-url",{method:"POST",body:"https://bolt.adamcake.com/plugins"});var li=(e,t)=>P(t,!1),ui=L("

        (start an RS3 game client with plugins enabled and it will be listed here.)

        "),ci=(e,t,n,r,a,o,i)=>{P(t,v(n).uid,!0),P(r,!0),P(a,!1),P(o,""),P(i,null)},fi=L("
        ",1),di=(e,t)=>P(t,null),_i=L(''),vi=(e,t,n)=>{P(t,!v(t)),P(n,"")},pi=(e,t,n,r)=>{t(v(n)),P(r,!1),P(n,"")},hi=(e,t,n)=>{P(t,!1),P(n,"")},gi=L('

        ',1),mi=L('
        ',1),bi=L('


        ',1),wi=L("

        error


        ",1),yi=L("

        loading...

        "),ki=(e,t,n)=>{const r=t[Q(n)].path;fetch(r?"/browse-directory?".concat(new URLSearchParams({path:r}).toString()):"/browse-plugin-data?".concat(new URLSearchParams({id:Q(n)}).toString()))},xi=(e,t)=>fetch("/browse-plugin-config?".concat(new URLSearchParams({id:Q(t)}).toString())),Si=(e,t,n,r)=>t(v(n),Q(r)),$i=L('  ',1),Ei=L('  
        ',1),Li=L(`

        You have no plugins installed. You can install plugins either from an updater URL, or by - downloading them onto your computer and selecting the "bolt.json" file.

        `),Ci=L('
        ',1),Pi=(e,t,n,r,a,o,i)=>t(Q(n),Q(r),v(a)??null,v(o).main??i),Ri=L(''),Ii=L("

        (no plugins installed)

        "),Ti=L("

        can't start plugin: does not appear to be configured

        "),Oi=(e,t,n,r)=>{t(Q(n),v(r).uid)},Ai=L('

        '),Ui=L("

        "),Ni=L('


        ',1),Hi=L("

        error

        "),Mi=L("

        loading...

        "),Di=L("
        ",1),ji=L(' ',1),Fi=L("

        error

        "),qi=L('

        '),Bi=L("

        "),Wi=L("

        ",1),Gi=L('

        ',1);function Vi(e,t){me(t,!0);const n=()=>ve(Ir,"$clientList",r),[r,a]=Je();let o,i=oe(null),u=oe(!1),l=en($.pluginConfig);const c=$.platform==="windows"?"\\":"/",f="bolt.json",d=c.concat(f),p="main.lua";function _(){P(De,!1),o.open()}const h=()=>{$.pluginConfig=l,te.savePluginConfig(!0)},g=y=>{console.log(y),P(i,y,!0),P(u,!1)},m=y=>{console.error(y),P(i,y,!0),P(u,!0)},k=y=>new Promise((I,T)=>{const z=y.concat(y.endsWith(c)?f:d);var N=new XMLHttpRequest;N.onreadystatechange=()=>{N.readyState==4&&(N.status==200?I(JSON.parse(N.responseText)):T(N.responseText))},N.open("GET","/read-json-file?".concat(new URLSearchParams({path:z}).toString()),!0),N.send()}),b=y=>fetch("/get-plugindir-json?".concat(new URLSearchParams({id:y}).toString())).then(I=>I.ok?I.json():null),U=y=>{const I=l[y];if(!I)return null;const T=I.path;return T?k(T):b(y)},H=()=>{const y=Object.keys(l);let I;do I=crypto.randomUUID();while(y.includes(I));return I},D="(unnamed)",S="(new character)",E=(y,I)=>{k(y).then(T=>{P(K,H(),!0),l[Q(K)]={name:T.name??D,path:y,version:T.version},O.pluginConfigHasPendingChanges=!0}).catch(T=>m(`config file '${I}' couldn't be fetched, reason: ${T}`))},M=y=>{g("downloading..."),fetch(y).then(async I=>{if(!I.ok){m(`can't install plugin: updater URL returned ${I.status}: ${I.statusText}`);return}const T=await I.json();if(T.url){const z=await fetch(T.url);if(!z.ok){m(`can't install plugin: remote download URL returned ${I.status}: ${I.statusText}`);return}const N=await z.arrayBuffer();if(T.sha256){const Ye=await crypto.subtle.digest("SHA-256",N),zt=Array.from(new Uint8Array(Ye)).map(mn=>mn.toString(16).padStart(2,"0")).join("");if(T.sha256!==zt){m("can't install plugin: incorrect file hash");return}}const Y=H();if(!(await fetch("/install-plugin?".concat(new URLSearchParams({id:Y}).toString()),{method:"POST",body:N})).ok){m(`can't install plugin: ${I.statusText}`);return}const ft=await b(Y);ft?(P(K,Y,!0),l[Q(K)]={name:ft.name??D,version:ft.version,updaterURL:y,sha256:T.sha256},O.pluginConfigHasPendingChanges=!0,g(`plugin '${ft.name}' installed`)):m(`can't install plugin: ${f} not found`)}}).catch(()=>{m("can't install plugin: unhandled exception")})};let j=oe(!1);const ce=()=>{P(j,!0);var y=new XMLHttpRequest;y.onreadystatechange=()=>{if(y.readyState==4&&(P(j,!1),y.status==200))if(y.responseText.endsWith(d)){const I=y.responseText.substring(0,y.responseText.length-f.length);E(I,y.responseText)}else m(`selection '${y.responseText}' is not named ${f}; ignored`)},y.open("GET","/json-file-picker",!0),y.send()};wr();const re=(y,I,T,z)=>{let N=null;if(T){const Xe=$.platform==="windows"?T.replaceAll("\\","/"):T;N=Xe.endsWith(c)?Xe:Xe.concat("/")}var Y=new XMLHttpRequest;Y.onreadystatechange=()=>{Y.readyState==4&&(wr(),A.info(`Start-plugin status: ${Y.statusText.trim()}`))},N?Y.open("GET","/start-plugin?".concat(new URLSearchParams({client:y.toString(),id:I,main:z,path:N}).toString()),!0):Y.open("GET","/start-plugin?".concat(new URLSearchParams({client:y.toString(),id:I,main:z}).toString()),!0),Y.send()},ne=(y,I)=>{var T=new XMLHttpRequest;T.onreadystatechange=()=>{T.readyState==4&&(wr(),A.info(`Stop-plugin status: ${T.statusText.trim()}`))},T.open("GET","/stop-plugin?".concat(new URLSearchParams({client:y.toString(),uid:I.toString()}).toString()),!0),T.send()},Se=(y,I)=>{const T=y.updaterURL;fetch(T).then(async z=>{if(!z.ok){m(`can't update plugin: updater URL returned ${z.status}: ${z.statusText}`);return}let N=await z.json();if(!N.url){g(`can't update plugin '${y.name}': no remote download URL is configured`);return}let Y=!1;if(N.sha256?y.sha256!==N.sha256&&(Y=!0):N.version&&y.version!==N.version&&(Y=!0),Y){const Xe=await fetch(N.url);if(!Xe.ok){m(`can't update plugin: remote download URL returned ${Xe.status}: ${Xe.statusText}`);return}const ft=await Xe.arrayBuffer();if(N.sha256){const zt=await crypto.subtle.digest("SHA-256",ft),mn=Array.from(new Uint8Array(zt)).map(sr=>sr.toString(16).padStart(2,"0")).join("");if(N.sha256!==mn){m(`can't update plugin '${y.name}': incorrect file hash`);return}}fetch("/install-plugin?".concat(new URLSearchParams({id:I}).toString()),{method:"POST",body:ft});const Ye=await b(I);Ye?(N.sha256&&(y.sha256=N.sha256),Ye.name&&(y.name=Ye.name),Ye.version&&(y.version=Ye.version),O.pluginConfigHasPendingChanges=!0,g(`plugin '${Ye.name}' updated`)):m(`can't update plugin '${y.name}': ${f} not found`)}else g(`plugin '${y.name}' is already up-to-date`)})};var K=oe(""),$e=oe(!1),fe=oe(0);let De=oe(!1),at=oe("");fn(()=>{n().some(y=>y.uid===Q(fe))||P($e,!1)});let Te=Be(()=>l[Q(K)]),kt=Be(()=>U(Q(K)));fn(()=>{v(kt)&&v(kt).then(y=>{let I=!1;y.name!==v(Te).name&&(v(Te).name=y.name,I=!0),y.version!==v(Te).version&&(v(Te).version=y.version,I=!0),I&&(P(Te,v(Te)),O.pluginConfigHasPendingChanges=!0)})});let V=Be(()=>v(Te)?v(Te).path:null);var X={open:_};wt(nr(e,{class:"h-[90%] w-[90%] text-center",onClose:()=>h(),children:(y,I)=>{var T=Gi(),z=B(T),N=C(z);N.__click=[li,$e];var Y=w(N,4);{var Xe=de=>{var je=ui();x(de,je)},ft=de=>{var je=lt(),xt=B(je);Pt(xt,1,n,Dt,(bn,Ut)=>{var Ze=fi(),se=B(Ze);se.__click=[ci,fe,Ut,$e,De,at,i];var Oe=C(se);W(()=>{Ie(se,1,`m-1 h-[28px] w-[95%] select-none rounded-lg border-2 ${Q($e)&&Q(fe)===v(Ut).uid?"border-black bg-blue-500 text-black":"border-blue-500 text-black dark:text-white"} hover:opacity-75`),pe(Oe,v(Ut).identity||S)}),x(bn,Ze)}),x(de,je)};J(Y,de=>{n().length==0?de(Xe):de(ft,!1)})}var Ye=w(z,2),zt=C(Ye);{var mn=de=>{var je=ji(),xt=B(je);xt.__change=[di,i],Pt(xt,21,()=>Object.entries(l),Dt,(se,Oe)=>{var Nt=Be(()=>ba(v(Oe),2));let Fe=()=>v(Nt)[0],Ae=()=>v(Nt)[1];var ot=_i(),Jt=C(ot),Xt={};W(()=>{pe(Jt,Ae().name??D),Xt!==(Xt=Fe())&&(ot.value=(ot.__value=Fe())??"")}),x(se,ot)});var bn=w(xt,2);{var Ut=se=>{var Oe=Ci(),Nt=B(Oe),Fe=C(Nt);Fe.__click=[vi,De,at];var Ae=w(Fe,2);Ae.__click=ce;var ot=w(Nt,4);{var Jt=le=>{var _e=gi(),Ke=w(B(_e),2),St=w(Ke,2);St.__click=[pi,M,at,De];var dt=w(St,2);dt.__click=[hi,De,at],jt(Ke,()=>v(at),we=>P(at,we)),x(le,_e)};J(ot,le=>{v(De)&&le(Jt)})}var Xt=w(ot,2);{var ar=le=>{var _e=lt(),Ke=B(_e);{var St=dt=>{var we=Ei(),_t=B(we);ls(_t,()=>v(kt),ye=>{var Ee=yi();x(ye,Ee)},(ye,Ee)=>{var Qe=bi(),Et=B(Qe),Ht=C(Et),lr=w(Ht);{var la=ur=>{var Yr=mi(),ca=w(B(Yr),2),fa=C(ca);W(()=>pe(fa,`v${v(Ee).version??""}`)),x(ur,Yr)};J(lr,ur=>{v(Ee).version&&ur(la)})}var Xr=w(Et,2),ua=C(Xr);W(()=>{pe(Ht,`${v(Ee).name??D??""} `),Ie(Xr,1,Hn(v(Ee).description?null:"italic")),pe(ua,v(Ee).description??"no description")}),x(ye,Qe)},ye=>{var Ee=wi();x(ye,Ee)});var Rn=w(_t,2);Rn.__click=[ki,l,K];var In=w(Rn,2);In.__click=[xi,K];var $t=w(In,4);{var Tn=ye=>{var Ee=$i(),Qe=B(Ee);Qe.__click=[Si,Se,Te,K],x(ye,Ee)};J($t,ye=>{v(Te).updaterURL&&ye(Tn)})}var ir=w($t,2);ir.__click=()=>{P(kt,null),O.pluginConfigHasPendingChanges=!0;const ye=l[Q(K)];ye&&(fetch("/uninstall-plugin?".concat(new URLSearchParams({id:Q(K),delete_data_dir:typeof ye.path=="string"?"0":"1"}).toString())),g(`plugin '${ye.name}' uninstalled`),delete l[Q(K)])},x(dt,we)};J(Ke,dt=>{Object.keys(l).includes(Q(K))&&v(kt)!==null&&dt(St)})}x(le,_e)},or=le=>{var _e=Li();x(le,_e)};J(Xt,le=>{Object.entries(l).length!==0?le(ar):le(or,!1)})}W(()=>{Fe.disabled=!$.hasLibArchive||v(j),Ae.disabled=v(j)}),x(se,Oe)},Ze=se=>{var Oe=Di(),Nt=w(B(Oe),2);ls(Nt,()=>v(kt),Fe=>{var Ae=Mi();x(Fe,Ae)},(Fe,Ae)=>{var ot=Ni(),Jt=B(ot);{var Xt=le=>{var _e=Ri();_e.__click=[Pi,re,fe,K,V,Ae,p];var Ke=C(_e);W(()=>pe(Ke,`Start ${v(Ae).name??""}`)),x(le,_e)},ar=le=>{var _e=lt(),Ke=B(_e);{var St=we=>{var _t=Ii();x(we,_t)},dt=we=>{var _t=Ti();x(we,_t)};J(Ke,we=>{Object.entries(l).length===0?we(St):we(dt,!1)},!0)}x(le,_e)};J(Jt,le=>{v(Ae)&&v(Ae).main&&Object.keys(l).includes(Q(K))?le(Xt):le(ar,!1)})}var or=w(Jt,8);Pt(or,1,n,Dt,(le,_e)=>{var Ke=lt(),St=B(Ke);{var dt=we=>{var _t=lt(),Rn=B(_t);Pt(Rn,17,()=>v(_e).plugins,Dt,(In,$t)=>{var Tn=lt(),ir=B(Tn);{var ye=Qe=>{var Et=Ai(),Ht=C(Et),lr=w(Ht);lr.__click=[Oi,ne,fe,$t],W(()=>pe(Ht,`${l[v($t).id].name??v($t).id??""} `)),x(Qe,Et)},Ee=Qe=>{var Et=Ui(),Ht=C(Et);W(()=>pe(Ht,v($t).id)),x(Qe,Et)};J(ir,Qe=>{Object.keys(l).includes(v($t).id)?Qe(ye):Qe(Ee,!1)})}x(In,Tn)}),x(we,_t)};J(St,we=>{v(_e).uid===Q(fe)&&we(dt)})}x(le,Ke)}),x(Fe,ot)},Fe=>{var Ae=Hi();x(Fe,Ae)}),x(se,Oe)};J(bn,se=>{Q($e)?se(Ze,!1):se(Ut)})}Vr(xt,()=>Q(K),se=>P(K,se)),x(de,je)},sr=de=>{var je=Fi();x(de,je)};J(zt,de=>{$.hasBoltPlugins?de(mn):de(sr,!1)})}var sa=w(zt,2);{var aa=de=>{var je=Wi(),xt=w(B(je),3);{var bn=Ze=>{var se=qi(),Oe=C(se);W(()=>pe(Oe,`[error] ${v(i)??""}`)),x(Ze,se)},Ut=Ze=>{var se=Bi(),Oe=C(se);W(()=>pe(Oe,`[info] ${v(i)??""}`)),x(Ze,se)};J(xt,Ze=>{v(u)?Ze(bn):Ze(Ut,!1)})}x(de,je)};J(sa,de=>{v(i)&&de(aa)})}var oa=w(Ye,2),ia=C(oa);ia.__click=[ii],W(()=>Ie(N,1,`mx-auto mb-2 w-[95%] select-none rounded-lg border-2 ${Q($e)?"border-blue-500 text-black dark:text-white":"border-black bg-blue-500 text-black"} p-2 font-bold hover:opacity-75`)),x(y,T)},$$slots:{default:!0}}),y=>o=y,()=>o);var G=be(X);return a(),G}st(["click","change"]);var zi=L('
        '),Ji=L(''),Xi=L(''),Yi=L(''),Zi=L(''),Ki=L(''),Qi=L('
        Launch icon
        ',1);function el(e,t){me(t,!0);const n=()=>ve(f,"$config",i),r=()=>ve(g,"$psa",i),a=()=>ve(m,"$gameEnabled",i),o=()=>ve(d,"$initialized",i),[i,u]=Je();let l,c,{config:f,initialized:d}=O,p=Be(()=>n().selected.user_id),_=Be(()=>n().userDetails[v(p)??""]?.account_id),h=Be(()=>te.findSession(n().selected.user_id)?.accounts??[]),g=Bt(null),m=Bt(!0);fn(()=>{if(n().check_announcements){const V=n().selected.game==Le.osrs?"osrs":$.env.provider,X=`${$.env.psa_url}${V}/${V}.json`;fetch(X,{method:"GET",cache:"no-store"}).then(G=>G.json()).then(G=>{An(g,G.psaEnabled&&G.psaMessage?G.psaMessage:null),An(m,!(G.playDisabled??!1))})}else An(g,null),An(m,!0)});function k(V,X){if(!v(p))return A.warn("Please log in or select a user to play.");if(!v(_))return A.warn("Please select a character from the select menu.");const G=te.findSession(n().selected.user_id);if(!G)return A.warn("Unable to launch game, session was not found.");const{session_id:y}=G,I=te.findAccount(G.accounts,v(_));if(!I)return A.warn("Unable to launch game, account was not found.");const{accountId:T,displayName:z}=I,N=$.platform===kr.Windows,Y=$.platform===kr.Linux;switch(V){case Le.osrs:switch(X){case tn.official:_s(N||Y,!0,y,T,z);break;case tn.runelite:ra(y,T,z,!1);break;case tn.hdos:ni(y,T,z);break}break;case Le.rs3:Y?ti(y,T,z):_s(N,!1,y,T,z);break}}function b(V){const X=V.target.value;if(!v(p))return;const G=n().userDetails[v(p)];G?(G.account_id=X,ie(f,R(n).userDetails[v(p)]=G,R(n))):ie(f,R(n).userDetails[v(p)]={account_id:X},R(n))}var U={launch:k},H=Qi(),D=B(H);wt(oi(D,{}),V=>l=V,()=>l);var S=w(D,2);wt(Vi(S,{}),V=>c=V,()=>c);var E=w(S,2),M=C(E);{var j=V=>{var X=zi(),G=C(X);W(()=>pe(G,r())),x(V,X)};J(M,V=>{r()&&V(j)})}var ce=w(M,2),re=w(C(ce),2);re.__click=()=>{a()?k(n().selected.game,n().selected.client):l.open(k,n().selected.game,n().selected.client)};var ne=w(re,2);{var Se=V=>{var X=Xi(),G=w(C(X),2);Pt(G,5,()=>da[n().selected.game],Dt,(y,I)=>{var T=Ji(),z=C(T),N={};W(()=>{pe(z,v(I)),N!==(N=v(I))&&(T.value=(T.__value=v(I))??"")}),x(y,T)}),Vr(G,()=>n().selected.client,y=>ie(f,R(n).selected.client=y,R(n))),x(V,X)},K=V=>{var X=lt(),G=B(X);{var y=I=>{var T=Yi();T.__click=()=>{c.open()},W(()=>{T.disabled=!$.hasBoltPlugins,gt(T,"title",$.hasBoltPlugins?null:"This feature is disabled")}),x(I,T)};J(G,I=>{n().selected.game===Le.rs3&&I(y)},!0)}x(V,X)};J(ne,V=>{n().selected.game==Le.osrs?V(Se):V(K,!1)})}var $e=w(ne,2),fe=w(C($e),2);fe.__change=b;var De=C(fe);De.value=(De.__value=void 0)??"";var at=w(De);Pt(at,17,()=>v(h),Dt,(V,X)=>{var G=Zi(),y=C(G);{var I=N=>{var Y=os();W(()=>pe(Y,v(X).displayName)),x(N,Y)},T=N=>{var Y=os("New Character");x(N,Y)};J(y,N=>{v(X).displayName?N(I):N(T,!1)})}var z={};W(()=>{z!==(z=v(X).accountId)&&(G.value=(G.__value=v(X).accountId)??"")}),x(V,G)},V=>{var X=Ki();x(V,X)});var Te;Qs(fe),W(()=>{re.disabled=!o(),fe.disabled=!o()||n().selected.user_id===null,Te!==(Te=v(_))&&(fe.value=(fe.__value=v(_))??"",Gr(fe,v(_)))}),x(e,H);var kt=be(U);return u(),kt}st(["click","change"]);var tl=L("
      1. "),nl=L('
        Message list icon
          ');function rl(e,t){me(t,!0);var n=nl(),r=w(C(n),2);Pt(r,21,()=>t.logs,Dt,(a,o)=>{let i=()=>v(o).date,u=()=>v(o).severity,l=()=>v(o).content;var c=tl();let f;var d=C(c);W((p,_)=>{f=Ie(c,1,"",null,f,p),pe(d,`${_??""} + downloading them onto your computer and selecting the "bolt.json" file.

          `),Ci=L('
          ',1),Pi=(e,t,n,r,a,o,i)=>t(Q(n),Q(r),v(a)??null,v(o).main??i),Ri=L(''),Ii=L("

          (no plugins installed)

          "),Ti=L("

          can't start plugin: does not appear to be configured

          "),Oi=(e,t,n,r)=>{t(Q(n),v(r).uid)},Ai=L('

          '),Ui=L("

          "),Ni=L('


          ',1),Hi=L("

          error

          "),Mi=L("

          loading...

          "),Di=L("
          ",1),ji=L(' ',1),Fi=L("

          error

          "),qi=L('

          '),Bi=L("

          "),Wi=L("

          ",1),Gi=L('

          ',1);function Vi(e,t){me(t,!0);const n=()=>ve(Ir,"$clientList",r),[r,a]=Je();let o,i=oe(null),u=oe(!1),l=en($.pluginConfig);const c=$.platform==="windows"?"\\":"/",f="bolt.json",d=c.concat(f),p="main.lua";function _(){P(De,!1),o.open()}const h=()=>{$.pluginConfig=l,te.savePluginConfig(!0)},g=y=>{console.log(y),P(i,y,!0),P(u,!1)},m=y=>{console.error(y),P(i,y,!0),P(u,!0)},k=y=>new Promise((I,T)=>{const z=y.concat(y.endsWith(c)?f:d);var N=new XMLHttpRequest;N.onreadystatechange=()=>{N.readyState==4&&(N.status==200?I(JSON.parse(N.responseText)):T(N.responseText))},N.open("GET","/read-json-file?".concat(new URLSearchParams({path:z}).toString()),!0),N.send()}),b=y=>fetch("/get-plugindir-json?".concat(new URLSearchParams({id:y}).toString())).then(I=>I.ok?I.json():null),U=y=>{const I=l[y];if(!I)return null;const T=I.path;return T?k(T):b(y)},H=()=>{const y=Object.keys(l);let I;do I=crypto.randomUUID();while(y.includes(I));return I},D="(unnamed)",S="(new character)",E=(y,I)=>{k(y).then(T=>{P(K,H(),!0),l[Q(K)]={name:T.name??D,path:y,version:T.version},$.pluginConfig=l,O.pluginConfigHasPendingChanges=!0}).catch(T=>m(`config file '${I}' couldn't be fetched, reason: ${T}`))},M=y=>{g("downloading..."),fetch(y).then(async I=>{if(!I.ok){m(`can't install plugin: updater URL returned ${I.status}: ${I.statusText}`);return}const T=await I.json();if(T.url){const z=await fetch(T.url);if(!z.ok){m(`can't install plugin: remote download URL returned ${I.status}: ${I.statusText}`);return}const N=await z.arrayBuffer();if(T.sha256){const Ye=await crypto.subtle.digest("SHA-256",N),zt=Array.from(new Uint8Array(Ye)).map(mn=>mn.toString(16).padStart(2,"0")).join("");if(T.sha256!==zt){m("can't install plugin: incorrect file hash");return}}const Y=H();if(!(await fetch("/install-plugin?".concat(new URLSearchParams({id:Y}).toString()),{method:"POST",body:N})).ok){m(`can't install plugin: ${I.statusText}`);return}const ft=await b(Y);ft?(P(K,Y,!0),l[Q(K)]={name:ft.name??D,version:ft.version,updaterURL:y,sha256:T.sha256},$.pluginConfig=l,O.pluginConfigHasPendingChanges=!0,g(`plugin '${ft.name}' installed`)):m(`can't install plugin: ${f} not found`)}}).catch(()=>{m("can't install plugin: unhandled exception")})};let j=oe(!1);const ce=()=>{P(j,!0);var y=new XMLHttpRequest;y.onreadystatechange=()=>{if(y.readyState==4&&(P(j,!1),y.status==200))if(y.responseText.endsWith(d)){const I=y.responseText.substring(0,y.responseText.length-f.length);E(I,y.responseText)}else m(`selection '${y.responseText}' is not named ${f}; ignored`)},y.open("GET","/json-file-picker",!0),y.send()};wr();const re=(y,I,T,z)=>{let N=null;if(T){const Xe=$.platform==="windows"?T.replaceAll("\\","/"):T;N=Xe.endsWith(c)?Xe:Xe.concat("/")}var Y=new XMLHttpRequest;Y.onreadystatechange=()=>{Y.readyState==4&&(wr(),A.info(`Start-plugin status: ${Y.statusText.trim()}`))},N?Y.open("GET","/start-plugin?".concat(new URLSearchParams({client:y.toString(),id:I,main:z,path:N}).toString()),!0):Y.open("GET","/start-plugin?".concat(new URLSearchParams({client:y.toString(),id:I,main:z}).toString()),!0),Y.send()},ne=(y,I)=>{var T=new XMLHttpRequest;T.onreadystatechange=()=>{T.readyState==4&&(wr(),A.info(`Stop-plugin status: ${T.statusText.trim()}`))},T.open("GET","/stop-plugin?".concat(new URLSearchParams({client:y.toString(),uid:I.toString()}).toString()),!0),T.send()},Se=(y,I)=>{const T=y.updaterURL;fetch(T).then(async z=>{if(!z.ok){m(`can't update plugin: updater URL returned ${z.status}: ${z.statusText}`);return}let N=await z.json();if(!N.url){g(`can't update plugin '${y.name}': no remote download URL is configured`);return}let Y=!1;if(N.sha256?y.sha256!==N.sha256&&(Y=!0):N.version&&y.version!==N.version&&(Y=!0),Y){const Xe=await fetch(N.url);if(!Xe.ok){m(`can't update plugin: remote download URL returned ${Xe.status}: ${Xe.statusText}`);return}const ft=await Xe.arrayBuffer();if(N.sha256){const zt=await crypto.subtle.digest("SHA-256",ft),mn=Array.from(new Uint8Array(zt)).map(sr=>sr.toString(16).padStart(2,"0")).join("");if(N.sha256!==mn){m(`can't update plugin '${y.name}': incorrect file hash`);return}}fetch("/install-plugin?".concat(new URLSearchParams({id:I}).toString()),{method:"POST",body:ft});const Ye=await b(I);Ye?(N.sha256&&(y.sha256=N.sha256),Ye.name&&(y.name=Ye.name),Ye.version&&(y.version=Ye.version),O.pluginConfigHasPendingChanges=!0,g(`plugin '${Ye.name}' updated`)):m(`can't update plugin '${y.name}': ${f} not found`)}else g(`plugin '${y.name}' is already up-to-date`)})};var K=oe(""),$e=oe(!1),fe=oe(0);let De=oe(!1),at=oe("");fn(()=>{n().some(y=>y.uid===Q(fe))||P($e,!1)});let Te=Be(()=>l[Q(K)]),kt=Be(()=>U(Q(K)));fn(()=>{v(kt)&&v(kt).then(y=>{let I=!1;y.name!==v(Te).name&&(v(Te).name=y.name,I=!0),y.version!==v(Te).version&&(v(Te).version=y.version,I=!0),I&&(P(Te,v(Te)),O.pluginConfigHasPendingChanges=!0)})});let V=Be(()=>v(Te)?v(Te).path:null);var X={open:_};wt(nr(e,{class:"h-[90%] w-[90%] text-center",onClose:()=>h(),children:(y,I)=>{var T=Gi(),z=B(T),N=C(z);N.__click=[li,$e];var Y=w(N,4);{var Xe=de=>{var je=ui();x(de,je)},ft=de=>{var je=lt(),xt=B(je);Pt(xt,1,n,Dt,(bn,Ut)=>{var Ze=fi(),se=B(Ze);se.__click=[ci,fe,Ut,$e,De,at,i];var Oe=C(se);W(()=>{Ie(se,1,`m-1 h-[28px] w-[95%] select-none rounded-lg border-2 ${Q($e)&&Q(fe)===v(Ut).uid?"border-black bg-blue-500 text-black":"border-blue-500 text-black dark:text-white"} hover:opacity-75`),pe(Oe,v(Ut).identity||S)}),x(bn,Ze)}),x(de,je)};J(Y,de=>{n().length==0?de(Xe):de(ft,!1)})}var Ye=w(z,2),zt=C(Ye);{var mn=de=>{var je=ji(),xt=B(je);xt.__change=[di,i],Pt(xt,21,()=>Object.entries(l),Dt,(se,Oe)=>{var Nt=Be(()=>ba(v(Oe),2));let Fe=()=>v(Nt)[0],Ae=()=>v(Nt)[1];var ot=_i(),Jt=C(ot),Xt={};W(()=>{pe(Jt,Ae().name??D),Xt!==(Xt=Fe())&&(ot.value=(ot.__value=Fe())??"")}),x(se,ot)});var bn=w(xt,2);{var Ut=se=>{var Oe=Ci(),Nt=B(Oe),Fe=C(Nt);Fe.__click=[vi,De,at];var Ae=w(Fe,2);Ae.__click=ce;var ot=w(Nt,4);{var Jt=le=>{var _e=gi(),Ke=w(B(_e),2),St=w(Ke,2);St.__click=[pi,M,at,De];var dt=w(St,2);dt.__click=[hi,De,at],jt(Ke,()=>v(at),we=>P(at,we)),x(le,_e)};J(ot,le=>{v(De)&&le(Jt)})}var Xt=w(ot,2);{var ar=le=>{var _e=lt(),Ke=B(_e);{var St=dt=>{var we=Ei(),_t=B(we);ls(_t,()=>v(kt),ye=>{var Ee=yi();x(ye,Ee)},(ye,Ee)=>{var Qe=bi(),Et=B(Qe),Ht=C(Et),lr=w(Ht);{var la=ur=>{var Yr=mi(),ca=w(B(Yr),2),fa=C(ca);W(()=>pe(fa,`v${v(Ee).version??""}`)),x(ur,Yr)};J(lr,ur=>{v(Ee).version&&ur(la)})}var Xr=w(Et,2),ua=C(Xr);W(()=>{pe(Ht,`${v(Ee).name??D??""} `),Ie(Xr,1,Hn(v(Ee).description?null:"italic")),pe(ua,v(Ee).description??"no description")}),x(ye,Qe)},ye=>{var Ee=wi();x(ye,Ee)});var Rn=w(_t,2);Rn.__click=[ki,l,K];var In=w(Rn,2);In.__click=[xi,K];var $t=w(In,4);{var Tn=ye=>{var Ee=$i(),Qe=B(Ee);Qe.__click=[Si,Se,Te,K],x(ye,Ee)};J($t,ye=>{v(Te).updaterURL&&ye(Tn)})}var ir=w($t,2);ir.__click=()=>{P(kt,null),O.pluginConfigHasPendingChanges=!0;const ye=l[Q(K)];ye&&(fetch("/uninstall-plugin?".concat(new URLSearchParams({id:Q(K),delete_data_dir:typeof ye.path=="string"?"0":"1"}).toString())),g(`plugin '${ye.name}' uninstalled`),delete l[Q(K)])},x(dt,we)};J(Ke,dt=>{Object.keys(l).includes(Q(K))&&v(kt)!==null&&dt(St)})}x(le,_e)},or=le=>{var _e=Li();x(le,_e)};J(Xt,le=>{Object.entries(l).length!==0?le(ar):le(or,!1)})}W(()=>{Fe.disabled=!$.hasLibArchive||v(j),Ae.disabled=v(j)}),x(se,Oe)},Ze=se=>{var Oe=Di(),Nt=w(B(Oe),2);ls(Nt,()=>v(kt),Fe=>{var Ae=Mi();x(Fe,Ae)},(Fe,Ae)=>{var ot=Ni(),Jt=B(ot);{var Xt=le=>{var _e=Ri();_e.__click=[Pi,re,fe,K,V,Ae,p];var Ke=C(_e);W(()=>pe(Ke,`Start ${v(Ae).name??""}`)),x(le,_e)},ar=le=>{var _e=lt(),Ke=B(_e);{var St=we=>{var _t=Ii();x(we,_t)},dt=we=>{var _t=Ti();x(we,_t)};J(Ke,we=>{Object.entries(l).length===0?we(St):we(dt,!1)},!0)}x(le,_e)};J(Jt,le=>{v(Ae)&&v(Ae).main&&Object.keys(l).includes(Q(K))?le(Xt):le(ar,!1)})}var or=w(Jt,8);Pt(or,1,n,Dt,(le,_e)=>{var Ke=lt(),St=B(Ke);{var dt=we=>{var _t=lt(),Rn=B(_t);Pt(Rn,17,()=>v(_e).plugins,Dt,(In,$t)=>{var Tn=lt(),ir=B(Tn);{var ye=Qe=>{var Et=Ai(),Ht=C(Et),lr=w(Ht);lr.__click=[Oi,ne,fe,$t],W(()=>pe(Ht,`${l[v($t).id].name??v($t).id??""} `)),x(Qe,Et)},Ee=Qe=>{var Et=Ui(),Ht=C(Et);W(()=>pe(Ht,v($t).id)),x(Qe,Et)};J(ir,Qe=>{Object.keys(l).includes(v($t).id)?Qe(ye):Qe(Ee,!1)})}x(In,Tn)}),x(we,_t)};J(St,we=>{v(_e).uid===Q(fe)&&we(dt)})}x(le,Ke)}),x(Fe,ot)},Fe=>{var Ae=Hi();x(Fe,Ae)}),x(se,Oe)};J(bn,se=>{Q($e)?se(Ze,!1):se(Ut)})}Vr(xt,()=>Q(K),se=>P(K,se)),x(de,je)},sr=de=>{var je=Fi();x(de,je)};J(zt,de=>{$.hasBoltPlugins?de(mn):de(sr,!1)})}var sa=w(zt,2);{var aa=de=>{var je=Wi(),xt=w(B(je),3);{var bn=Ze=>{var se=qi(),Oe=C(se);W(()=>pe(Oe,`[error] ${v(i)??""}`)),x(Ze,se)},Ut=Ze=>{var se=Bi(),Oe=C(se);W(()=>pe(Oe,`[info] ${v(i)??""}`)),x(Ze,se)};J(xt,Ze=>{v(u)?Ze(bn):Ze(Ut,!1)})}x(de,je)};J(sa,de=>{v(i)&&de(aa)})}var oa=w(Ye,2),ia=C(oa);ia.__click=[ii],W(()=>Ie(N,1,`mx-auto mb-2 w-[95%] select-none rounded-lg border-2 ${Q($e)?"border-blue-500 text-black dark:text-white":"border-black bg-blue-500 text-black"} p-2 font-bold hover:opacity-75`)),x(y,T)},$$slots:{default:!0}}),y=>o=y,()=>o);var G=be(X);return a(),G}st(["click","change"]);var zi=L('
          '),Ji=L(''),Xi=L(''),Yi=L(''),Zi=L(''),Ki=L(''),Qi=L('
          Launch icon
          ',1);function el(e,t){me(t,!0);const n=()=>ve(f,"$config",i),r=()=>ve(g,"$psa",i),a=()=>ve(m,"$gameEnabled",i),o=()=>ve(d,"$initialized",i),[i,u]=Je();let l,c,{config:f,initialized:d}=O,p=Be(()=>n().selected.user_id),_=Be(()=>n().userDetails[v(p)??""]?.account_id),h=Be(()=>te.findSession(n().selected.user_id)?.accounts??[]),g=Bt(null),m=Bt(!0);fn(()=>{if(n().check_announcements){const V=n().selected.game==Le.osrs?"osrs":$.env.provider,X=`${$.env.psa_url}${V}/${V}.json`;fetch(X,{method:"GET",cache:"no-store"}).then(G=>G.json()).then(G=>{An(g,G.psaEnabled&&G.psaMessage?G.psaMessage:null),An(m,!(G.playDisabled??!1))})}else An(g,null),An(m,!0)});function k(V,X){if(!v(p))return A.warn("Please log in or select a user to play.");if(!v(_))return A.warn("Please select a character from the select menu.");const G=te.findSession(n().selected.user_id);if(!G)return A.warn("Unable to launch game, session was not found.");const{session_id:y}=G,I=te.findAccount(G.accounts,v(_));if(!I)return A.warn("Unable to launch game, account was not found.");const{accountId:T,displayName:z}=I,N=$.platform===kr.Windows,Y=$.platform===kr.Linux;switch(V){case Le.osrs:switch(X){case tn.official:_s(N||Y,!0,y,T,z);break;case tn.runelite:ra(y,T,z,!1);break;case tn.hdos:ni(y,T,z);break}break;case Le.rs3:Y?ti(y,T,z):_s(N,!1,y,T,z);break}}function b(V){const X=V.target.value;if(!v(p))return;const G=n().userDetails[v(p)];G?(G.account_id=X,ie(f,R(n).userDetails[v(p)]=G,R(n))):ie(f,R(n).userDetails[v(p)]={account_id:X},R(n))}var U={launch:k},H=Qi(),D=B(H);wt(oi(D,{}),V=>l=V,()=>l);var S=w(D,2);wt(Vi(S,{}),V=>c=V,()=>c);var E=w(S,2),M=C(E);{var j=V=>{var X=zi(),G=C(X);W(()=>pe(G,r())),x(V,X)};J(M,V=>{r()&&V(j)})}var ce=w(M,2),re=w(C(ce),2);re.__click=()=>{a()?k(n().selected.game,n().selected.client):l.open(k,n().selected.game,n().selected.client)};var ne=w(re,2);{var Se=V=>{var X=Xi(),G=w(C(X),2);Pt(G,5,()=>da[n().selected.game],Dt,(y,I)=>{var T=Ji(),z=C(T),N={};W(()=>{pe(z,v(I)),N!==(N=v(I))&&(T.value=(T.__value=v(I))??"")}),x(y,T)}),Vr(G,()=>n().selected.client,y=>ie(f,R(n).selected.client=y,R(n))),x(V,X)},K=V=>{var X=lt(),G=B(X);{var y=I=>{var T=Yi();T.__click=()=>{c.open()},W(()=>{T.disabled=!$.hasBoltPlugins,gt(T,"title",$.hasBoltPlugins?null:"This feature is disabled")}),x(I,T)};J(G,I=>{n().selected.game===Le.rs3&&I(y)},!0)}x(V,X)};J(ne,V=>{n().selected.game==Le.osrs?V(Se):V(K,!1)})}var $e=w(ne,2),fe=w(C($e),2);fe.__change=b;var De=C(fe);De.value=(De.__value=void 0)??"";var at=w(De);Pt(at,17,()=>v(h),Dt,(V,X)=>{var G=Zi(),y=C(G);{var I=N=>{var Y=os();W(()=>pe(Y,v(X).displayName)),x(N,Y)},T=N=>{var Y=os("New Character");x(N,Y)};J(y,N=>{v(X).displayName?N(I):N(T,!1)})}var z={};W(()=>{z!==(z=v(X).accountId)&&(G.value=(G.__value=v(X).accountId)??"")}),x(V,G)},V=>{var X=Ki();x(V,X)});var Te;Qs(fe),W(()=>{re.disabled=!o(),fe.disabled=!o()||n().selected.user_id===null,Te!==(Te=v(_))&&(fe.value=(fe.__value=v(_))??"",Gr(fe,v(_)))}),x(e,H);var kt=be(U);return u(),kt}st(["click","change"]);var tl=L("
        1. "),nl=L('
          Message list icon
            ');function rl(e,t){me(t,!0);var n=nl(),r=w(C(n),2);Pt(r,21,()=>t.logs,Dt,(a,o)=>{let i=()=>v(o).date,u=()=>v(o).severity,l=()=>v(o).content;var c=tl();let f;var d=C(c);W((p,_)=>{f=Ie(c,1,"",null,f,p),pe(d,`${_??""} - ${l()??""}`)},[()=>({"text-rose-500":u()===Rr.error,"text-orange-700":u()===Rr.warn}),()=>i()?.toLocaleTimeString()]),x(a,c)}),x(e,n),be()}var sl=L(''),al=()=>{const{origin:e,redirect:t,clientid:n}=$.env;Pe.openLoginWindow(e,t,n)},ol=async(e,t,n)=>{t().selected.user_id&&(await te.logout(t().selected.user_id),te.saveCredentials())},il=L('
            ',1);function ll(e,t){me(t,!1);const n=()=>ve(u,"$config",a),r=()=>ve(i,"$sessions",a),[a,o]=Je(),{sessions:i,config:u}=O;At();var l=il(),c=B(l);W(()=>{n(),ao(()=>{r()})});var f=C(c);f.value=(f.__value=null)??"";var d=w(f);Pt(d,1,r,g=>g.user.userId,(g,m)=>{var k=sl(),b=C(k),U={};W(()=>{pe(b,v(m).user.displayName),U!==(U=v(m).user.userId)&&(k.value=(k.__value=v(m).user.userId)??"")}),x(g,k)});var p=w(c,2),_=C(p);_.__click=[al];var h=w(_,2);h.__click=[ol,n,u],W(()=>h.disabled=!n().selected.user_id),Vr(c,()=>n().selected.user_id,g=>ie(u,R(n).selected.user_id=g,R(n))),x(e,l),be(),o()}st(["click"]);function ul(e,{callback:t,ignore:n=[]}){const r=a=>{const o=n.some(i=>i.contains(a.target));e&&!e.contains(a.target)&&!a.defaultPrevented&&!o&&t()};return document.addEventListener("click",r,!0),document.addEventListener("contextmenu",r,!0),{destroy(){document.removeEventListener("click",r,!0),document.removeEventListener("contextmenu",r,!0)}}}function cl(e,t,n,r){v(t)?n():r()}var fl=L("
            "),dl=L("
            ");function _l(e,t){me(t,!0);const n=()=>ve(o,"$config",r),[r,a]=Je(),{config:o}=O;let i=Be(()=>n().use_dark_theme),u=ln(t,"class",3,""),l=ln(t,"position",3,"bottom"),c=ln(t,"align",3,"start"),f=oe(!1),d=oe(void 0);function p(){P(f,!0)}function _(){P(f,!1)}var h={open:p,close:_},g=dl();let m;var k=C(g);k.__click=[cl,f,_,p];var b=C(k);Vn(b,()=>t.children??nt),wt(k,S=>P(d,S),()=>v(d));var U=w(k,2);{var H=S=>{var E=fl(),M=C(E);Vn(M,()=>t.content??nt),Co(E,(j,ce)=>ul?.(j,ce),()=>({callback:_,ignore:[v(d)]})),W(()=>Ie(E,1,`dropdown-color absolute z-20 rounded-lg border-2 ${l()??""} ${c()??""}`,"svelte-11xj3vp")),x(S,E)};J(U,S=>{v(f)&&S(H)})}W(S=>m=Ie(g,1,`relative h-fit w-fit ${u()??""}`,"svelte-11xj3vp",m,S),[()=>({dark:v(i)})]),x(e,g);var D=be(h);return a(),D}st(["click"]);var vl=(e,t)=>{t()},pl=L('
            ',1);function hl(e,t){me(t,!1);const n=()=>ve(i,"$config",r),[r,a]=Je();function o(){var b=new XMLHttpRequest;b.open("GET","/browse-data"),b.onreadystatechange=()=>{b.readyState==4&&A.info(`Browse status: '${b.responseText.trim()}'`)},b.send()}const{config:i}=O,u="Allow checking for official announcements about game status. These will be displayed above the 'play' button. Disabling will reduce the number of web requests made when opening the launcher.",l="Close the launcher immediately after launching a game",c="Discard login sessions if they're no longer valid, prompting the player to sign-in again. If unchecked, the only way to discard a login will be by manually pressing the 'log out' button, even if your login no longer works.";At();var f=pl(),d=B(f);d.__click=[vl,o];var p=w(d,2);gt(p,"title",u);var _=w(C(p),2),h=w(p,2);gt(h,"title",l);var g=w(C(h),2),m=w(h,2);gt(m,"title",c);var k=w(C(m),2);on(_,()=>n().check_announcements,b=>ie(i,R(n).check_announcements=b,R(n))),on(g,()=>n().close_after_launch,b=>ie(i,R(n).close_after_launch=b,R(n))),on(k,()=>n().discard_expired_sessions,b=>ie(i,R(n).discard_expired_sessions=b,R(n))),x(e,f),be(),a()}st(["click"]);var gl=(e,t)=>t(),ml=(e,t)=>{t()},bl=L('




            ',1);function wl(e,t){me(t,!0);const n=()=>ve(o,"$config",r),[r,a]=Je(),{config:o}=O;let i=Be(()=>te.findSession(n().selected.user_id)),u=Be(()=>te.findAccount(v(i)?.accounts??[],n().userDetails[n().selected.user_id??""]?.account_id)),l=oe(!1);async function c(){P(l,!0),ie(o,R(n).runelite_custom_jar=await te.openFilePicker(),R(n)),console.log("done picking"),P(l,!1)}function f(){!v(i)?.session_id||!v(u)?.accountId||!v(u)?.displayName||ra(v(i).session_id,v(u).accountId,v(u).displayName,!0)}var d=bl(),p=B(d);p.__click=[gl,f];var _=w(p,2),h=w(C(_),2),g=w(_,2);let m;var k=C(g),b=w(k,4);b.__click=[ml,c];var U=w(g,2),H=w(C(U),4);gt(H,"placeholder","%command%");var D=w(U,2),S=w(C(D),4);gt(S,"placeholder","%command%");var E=w(D,2),M=w(C(E),4);gt(M,"placeholder","%command%"),W(j=>{p.disabled=!v(i)?.session_id||!v(u)?.accountId,m=Ie(g,1,"mx-auto p-2",null,m,j),k.disabled=!n().runelite_use_custom_jar,b.disabled=v(l)||!n().runelite_use_custom_jar},[()=>({"opacity-25":!n().runelite_use_custom_jar})]),on(h,()=>n().runelite_use_custom_jar,j=>ie(o,R(n).runelite_use_custom_jar=j,R(n))),jt(k,()=>n().runelite_custom_jar,j=>ie(o,R(n).runelite_custom_jar=j,R(n))),jt(H,()=>n().osrs_launch_command,j=>ie(o,R(n).osrs_launch_command=j,R(n))),jt(S,()=>n().runelite_launch_command,j=>ie(o,R(n).runelite_launch_command=j,R(n))),jt(M,()=>n().hdos_launch_command,j=>ie(o,R(n).hdos_launch_command=j,R(n))),x(e,d),be(),a()}st(["click"]);var yl=L('
            '),kl=L('

            ',1);function xl(e,t){me(t,!1);const n=()=>ve(o,"$config",r),[r,a]=Je(),{config:o}=O;At();var i=kl(),u=B(i);{var l=g=>{var m=yl(),k=w(C(m),2);on(k,()=>n().rs_plugin_loader,b=>ie(o,R(n).rs_plugin_loader=b,R(n))),x(g,m)};J(u,g=>{$.hasBoltPlugins&&g(l)})}var c=w(u,2),f=w(C(c),2),d=w(c,2),p=C(d),_=w(d,2),h=w(C(_),4);gt(h,"placeholder","%command%"),W(()=>{p.disabled=!n().use_custom_rs_config_uri,gt(p,"placeholder",$.env.default_config_uri)}),on(f,()=>n().use_custom_rs_config_uri,g=>ie(o,R(n).use_custom_rs_config_uri=g,R(n))),jt(p,()=>n().rs_config_uri,g=>ie(o,R(n).rs_config_uri=g,R(n))),jt(h,()=>n().rs_launch_command,g=>ie(o,R(n).rs_launch_command=g,R(n))),x(e,i),be(),a()}var Sl=(e,t,n)=>{P(t,n.general)},$l=(e,t,n)=>{P(t,n.osrs)},El=(e,t,n)=>{P(t,n.rs3)},Ll=L('
            ');function Cl(e,t){me(t,!1);var n=(c=>(c[c.general=0]="general",c[c.osrs=1]="osrs",c[c.rs3=2]="rs3",c))(n||{});let r=We(),a=We(0),o="border-2 border-blue-500 bg-blue-500 hover:opacity-75 font-bold text-black duration-200 rounded-lg p-1 w-3/4",i="border-2 border-blue-500 hover:opacity-75 duration-200 rounded-lg p-1 w-3/4";function u(){v(r).open()}var l={open:u};return At(),wt(nr(e,{class:"h-3/4 w-3/4 select-none",children:(c,f)=>{var d=Ll(),p=C(d),_=C(p);_.__click=[Sl,a,n];var h=w(_,2);h.__click=[$l,a,n];var g=w(h,2);g.__click=[El,a,n];var m=w(p,2),k=C(m);{var b=H=>{hl(H,{})},U=H=>{var D=lt(),S=B(D);{var E=j=>{wl(j,{})},M=j=>{var ce=lt(),re=B(ce);{var ne=Se=>{xl(Se,{})};J(re,Se=>{v(a)==n.rs3&&Se(ne)},!0)}x(j,ce)};J(S,j=>{v(a)==n.osrs?j(E):j(M,!1)},!0)}x(H,D)};J(k,H=>{v(a)==n.general?H(b):H(U,!1)})}W(()=>{Ie(_,1,Hn(v(a)===n.general?o:i)),Ie(h,1,Hn(v(a)===n.osrs?o:i)),Ie(g,1,Hn(v(a)===n.rs3?o:i))}),x(c,d)},$$slots:{default:!0},$$legacy:!0}),c=>P(r,c),()=>v(r)),ea(t,"open",u),be(l)}st(["click"]);var Pl=(e,t,n)=>{ie(n,R(t).selected.game=Le.rs3,R(t))},Rl=(e,t,n)=>{ie(n,R(t).selected.game=Le.osrs,R(t))},Il=(e,t,n)=>ie(n,R(t).use_dark_theme=!t().use_dark_theme,R(t)),Tl=(e,t)=>v(t).open(),Ol=L('
            '),Al=L(''),Ul=()=>{const{origin:e,redirect:t,clientid:n}=$.env;Pe.openLoginWindow(e,t,n)},Nl=L(''),Hl=L('
            ',1);function Ml(e,t){me(t,!1);const n=()=>ve(i,"$config",a),r=()=>ve(u,"$sessions",a),[a,o]=Je(),{config:i,sessions:u}=O;let l=We();At();var c=Hl(),f=B(c);wt(Cl(f,{$$legacy:!0}),E=>P(l,E),()=>v(l));var d=w(f,2),p=C(d),_=C(p);let h;_.__click=[Pl,n,i];var g=w(_,2);let m;g.__click=[Rl,n,i];var k=w(p,2),b=C(k);b.__click=[Il,n,i];var U=w(b,2);U.__click=[Tl,l];var H=w(U,2);{var D=E=>{const M=jr(()=>te.findSession(n().selected.user_id??""));_l(E,{align:"center",content:ce=>{var re=Ol(),ne=C(re);ll(ne,{}),x(ce,re)},children:(ce,re)=>{var ne=Al(),Se=C(ne);W(()=>pe(Se,v(M)?.user.displayName??"No user selected")),x(ce,ne)},$$slots:{content:!0,default:!0}})},S=E=>{var M=Nl();M.__click=[Ul],x(E,M)};J(H,E=>{r().length>0?E(D):E(S,!1)})}W((E,M)=>{h=Ie(_,1,"mx-1 w-20 rounded-lg border-2 border-blue-500 p-2 duration-200 hover:opacity-75",null,h,E),m=Ie(g,1,"mx-1 w-20 rounded-lg border-2 border-blue-500 bg-blue-500 p-2 text-black duration-200 hover:opacity-75",null,m,M)},[()=>({"text-black":n().selected.game===Le.rs3,"bg-blue-500":n().selected.game===Le.rs3}),()=>({"text-black":n().selected.game===Le.osrs,"bg-blue-500":n().selected.game===Le.osrs})]),x(e,c),be(),o()}st(["click"]);var Dl=L('
            ',1);function jl(e,t){me(t,!1);const n=()=>ve(o,"$logs",r),[r,a]=Je(),o=A.logs;At(),ko("beforeunload",Sr,()=>{te.saveConfig(),$.hasBoltPlugins&&te.savePluginConfig(!0)}),na(e,{children:(i,u)=>{var l=Dl(),c=B(l);Yo(c,{});var f=w(c,2);Ml(f,{});var d=w(f,2),p=w(C(d),2);el(p,{});var _=w(d,2);rl(_,{get logs(){return n()}}),x(i,l)}}),be(),a()}const vs={target:document.getElementById("app")};window.opener||window.location.search.includes("&id_token")?is(Wo,vs):(Fl(),jo(),ql(),Bl().finally(()=>{O.initialized.set(!0)}),is(jl,vs));function Fl(){const e=new URLSearchParams(window.location.search);$.platform=e.get("platform"),$.isFlathub=e.get("flathub")==="1",$.hasLibArchive=e.get("has_libarchive")==="1",$.rs3debInstalledHash=e.get("rs3_deb_installed_hash"),$.rs3exeInstalledHash=e.get("rs3_exe_installed_hash"),$.rs3appInstalledHash=e.get("rs3_app_installed_hash"),$.osrsexeInstalledHash=e.get("osrs_exe_installed_hash"),$.osrsappInstalledHash=e.get("osrs_app_installed_hash"),$.runeLiteInstalledId=e.get("runelite_installed_id"),$.hdosInstalledVersion=e.get("hdos_installed_version");const t=e.get("plugins");if($.hasBoltPlugins=t!==null,t!==null)try{$.pluginConfig=JSON.parse(t)}catch{A.error("Unable to parse plugin list")}const n=e.get("credentials");if(n)try{const r=JSON.parse(n),a=r.every(o=>typeof o.session_id=="string"&&typeof o.tokens=="object"&&typeof o.accounts=="object"&&typeof o.user=="object");a?O.sessions.set(r):(O.sessions.set([]),te.saveCredentials(),A.warn("Credentials saved on disk are out of date. Please sign in again.")),O.sessions.set(a?r:[])}catch{O.sessions.set([]),te.saveCredentials(),A.error("Unable to parse saved credentials. Please sign in again.")}}function ql(){const{origin:e,origin_2fa:t}=$.env,n=[window.location.origin,e,t];let r=null;window.addEventListener("message",async a=>{if(!n.includes(a.origin)){A.info(`discarding window message from origin ${a.origin}`);return}switch(a.data.type){case"authTokenUpdate":{r=a.data.tokens;break}case"authSessionUpdate":{if(r===null)return A.error("auth is null. Please try again.");const o=a.data.sessionId,i=await te.login(r,o);i.ok?A.info(`Added new user '${i.value.user.displayName}'`):A.error(`Unable to add new user. Please try again. ${i.error}`),te.saveCredentials(),Pe.pendingLoginWindow=null,r=null;break}case"authFailed":{A.error(`Unable to authenticate: ${a.data.reason}`),Pe.pendingLoginWindow=null,r=null;break}case"externalUrl":{const o=new XMLHttpRequest;o.onreadystatechange=()=>{o.readyState==4&&A.info(`External URL status: '${o.responseText.trim()}'`)},o.open("POST","/open-external-url",!0),o.send(a.data.url);break}case"gameClientList":Ce(O.config).close_after_launch&&a.data.clients.length>Ce(Ir).length?fetch("/close"):Ir.set(a.data.clients);break;default:{const o=a.data?.type??"no type provided";A.info(`Unknown message type: ${o}`);break}}})}async function Bl(){const e=Ce(O.config).discard_expired_sessions,t=Ce(O.sessions),n=[];t.length>0&&A.info("Logging in...");const r=t.map(i=>({promise:Pe.refreshOAuthToken(i.tokens),session:i})),a=[];for(const i of r){const u=i.session,l=await i.promise;if(!l.ok){l.error===0?A.error(`Unable to verify saved login, status: ${l.error}. Do you have an internet connection? Please relaunch Bolt to try again.`):l.error>=400&&l.error<500&&e?(A.error(`Discarding expired login, status: ${l.error}. Please sign in again.`),n.push(u.tokens.sub)):A.error(`Unable to verify saved login due to HTTP error ${l.error}`);continue}const c=l.value;u.tokens=c,a.push({promise:te.login(c,u.session_id),session:u})}for(const i of a){const u=i.session,l=await i.promise;l.ok?A.info(`Signed into saved user '${l.value.user.displayName}'`):(A.error(`Unable to sign into saved user '${u.user.displayName}' due to an error: ${l.error}`),e&&n.push(u.tokens.sub))}const o=n.map(te.logout);for(const i of o)await i;O.sessions.set(t),await te.saveCredentials()} diff --git a/app/dist/index.html b/app/dist/index.html index 737f429f..4e06ef47 100644 --- a/app/dist/index.html +++ b/app/dist/index.html @@ -4,7 +4,7 @@ Bolt Launcher - + diff --git a/app/src/lib/Components/Modals/PluginModal.svelte b/app/src/lib/Components/Modals/PluginModal.svelte index be6471b9..6ff1b46d 100644 --- a/app/src/lib/Components/Modals/PluginModal.svelte +++ b/app/src/lib/Components/Modals/PluginModal.svelte @@ -103,6 +103,7 @@ path: folderPath, version: plugin.version }; + bolt.pluginConfig = pluginList; GlobalState.pluginConfigHasPendingChanges = true; }) .catch((reason) => @@ -158,6 +159,7 @@ updaterURL: url, sha256: config.sha256 }; + bolt.pluginConfig = pluginList; GlobalState.pluginConfigHasPendingChanges = true; setMessageInfo(`plugin '${plugin.name}' installed`); } else { From 00dd370abd70b491457baef3e4353824f3294ad1 Mon Sep 17 00:00:00 2001 From: Michael <91761269+natural-stupidity@users.noreply.github.com> Date: Thu, 25 Sep 2025 21:04:33 -0400 Subject: [PATCH 8/8] app: updated libraries and fixed eslint --- app/.eslintrc.cjs | 12 ++++-- app/bun.lockb | Bin 145476 -> 150877 bytes app/dist/assets/index-BA5wxT7c.css | 1 + .../{index-By6QcpeR.js => index-BhbsQGn9.js} | 0 app/dist/assets/index-CtkRCEbJ.css | 1 - app/dist/index.html | 4 +- app/package.json | 40 ++++++++++-------- .../lib/Components/CommonUI/Dropdown.svelte | 3 +- .../lib/Components/Modals/PluginModal.svelte | 10 ++--- .../Components/Modals/SettingsModal.svelte | 2 +- 10 files changed, 39 insertions(+), 34 deletions(-) create mode 100644 app/dist/assets/index-BA5wxT7c.css rename app/dist/assets/{index-By6QcpeR.js => index-BhbsQGn9.js} (100%) delete mode 100644 app/dist/assets/index-CtkRCEbJ.css diff --git a/app/.eslintrc.cjs b/app/.eslintrc.cjs index d6f77fff..35f4e2bf 100644 --- a/app/.eslintrc.cjs +++ b/app/.eslintrc.cjs @@ -28,9 +28,13 @@ module.exports = { } } ], - // this rule is for naming conventions, such as snake_case or camelCase enforcement - // rules: { - // '@typescript-eslint/naming-convention': 'error' - // }, + rules: { + '@typescript-eslint/no-unused-vars': [ + 'error', + { + caughtErrors: 'none' + } + ] + }, ignorePatterns: ['dist/', '*.cjs'] }; diff --git a/app/bun.lockb b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ThNPAE_JvA$aCyy%nyAeBxKZ zn?JrL)aE`Pgi^fiSE0DO^tT7E%x?WdGy9>+-aRr>Q#>6cNoyyx@7F>B1 zbT1!QQMBf}J_|KV(CmlwN$FWq#d#jg;++EUH_bpE_F1S@N_n~G?dh$AJOiW%*$QM- z$cbuQ7K#u>!JI6}6?k<;H@#9Dsgx z9_A%FQ(cQV7j9kX6l!ZIV!KeCTYtdA^!rPHv7jUkE+?(jS2Wnlas2325q|xP5H4Bj zdtY#-(P+W1(MXiM!PHH(vcM-1Qr{$Y<_p77n@~5=2?lp^6K|TLyujSLmBq~>uX|0X z$m_U^X1PutqPZzQ>m@ej4Z}s3+(zEwB2)g>UtA$IICuXjxa7_b5T6#|e)ok6d|8M% zPVnXawM6`~L2h;}G0=q9E+g7=(}&0ssY~<9p<+9}wT{?<52`Dg^F4G6y(ARn^Fl=z ztv}hv4~2;?rPS|9ywj4hx+SJ~re$^GBf>;PcNO&Yk`s<|{QuXnb;7T6$^^V?rjT zo8rK)3{D#9iF{#Y(ZS|Bn}BZm!SGwZ!~dt$Mu`~@Q2WXvdbX~YSfP}vznOOgZd zl9j~(X+-4qt}pHqXvQ|Q+ie9@8jd+TRk{9AwDHBE5qoSgr%lydVE4=VrmNhqaPpKP)y?;BSk%b z(NJ_11O2)19<5rvkyySot Bolt Launcher - - + +

            diff --git a/app/package.json b/app/package.json index a02f2513..bbf23b6b 100644 --- a/app/package.json +++ b/app/package.json @@ -2,23 +2,23 @@ "name": "vite_app", "version": "0.0.0", "devDependencies": { - "@sveltejs/vite-plugin-svelte": "^6.2.0", - "@tsconfig/svelte": "^5.0.2", - "autoprefixer": "^10.4.19", - "eslint": "^8.57.0", - "eslint-config-prettier": "^9.1.0", - "eslint-plugin-svelte": "^2.45.1", - "postcss": "^8.4.38", - "prettier": "^3.1.1", - "prettier-plugin-svelte": "^3.2.6", - "prettier-plugin-tailwindcss": "^0.5.13", - "svelte": "^5.0.0", - "svelte-check": "^4.0.0", - "tailwindcss": "^3.4.4", - "tslib": "^2.6.2", - "typescript": "^5.5.0", - "typescript-eslint": "^7.4.0", - "vite": "^7.1.5", + "@sveltejs/vite-plugin-svelte": "^6.2.1", + "@tsconfig/svelte": "^5.0.5", + "autoprefixer": "^10.4.21", + "eslint": "^8.57.1", + "eslint-config-prettier": "^9.1.2", + "eslint-plugin-svelte": "^2.46.1", + "postcss": "^8.5.6", + "prettier": "^3.6.2", + "prettier-plugin-svelte": "^3.4.0", + "prettier-plugin-tailwindcss": "^0.5.14", + "svelte": "^5.39.6", + "svelte-check": "^4.3.2", + "tailwindcss": "^3.4.17", + "tslib": "^2.8.1", + "typescript": "^5.9.2", + "typescript-eslint": "^7.18.0", + "vite": "^7.1.7", "vite-tsconfig-paths": "^4.3.2", "vitest": "^3.2.4" }, @@ -35,5 +35,9 @@ "lint": "prettier --check . && eslint .", "format": "prettier --write ." }, - "type": "module" + "type": "module", + "dependencies": { + "@typescript-eslint/eslint-plugin": "^8.44.1", + "@typescript-eslint/parser": "^8.44.1" + } } diff --git a/app/src/lib/Components/CommonUI/Dropdown.svelte b/app/src/lib/Components/CommonUI/Dropdown.svelte index 54a98f5f..f6e92a38 100644 --- a/app/src/lib/Components/CommonUI/Dropdown.svelte +++ b/app/src/lib/Components/CommonUI/Dropdown.svelte @@ -32,7 +32,8 @@ } function toggle() { - isOpen ? close() : open(); + if (isOpen) close(); + else open(); } diff --git a/app/src/lib/Components/Modals/PluginModal.svelte b/app/src/lib/Components/Modals/PluginModal.svelte index 6ff1b46d..b530d935 100644 --- a/app/src/lib/Components/Modals/PluginModal.svelte +++ b/app/src/lib/Components/Modals/PluginModal.svelte @@ -16,7 +16,7 @@ let messageText: string | null = $state(null); let messageIsError: boolean = $state(false); - let pluginList: { [key: string] : PluginMeta } = $state(bolt.pluginConfig); + let pluginList: { [key: string]: PluginMeta } = $state(bolt.pluginConfig); const platformFileSep: string = bolt.platform === 'windows' ? '\\' : '/'; const configFileName: string = 'bolt.json'; @@ -31,7 +31,7 @@ const close = () => { bolt.pluginConfig = pluginList; BoltService.savePluginConfig(true); - } + }; const setMessageInfo = (msg: string) => { console.log(msg); @@ -368,11 +368,7 @@ let selectedPluginPath = $derived(selectedPluginMeta ? selectedPluginMeta.path : null); - close() } -> + close()}>
            diff --git a/app/src/lib/Components/Modals/SettingsModal.svelte b/app/src/lib/Components/Modals/SettingsModal.svelte index 72ef2b1a..76fc3e9d 100644 --- a/app/src/lib/Components/Modals/SettingsModal.svelte +++ b/app/src/lib/Components/Modals/SettingsModal.svelte @@ -18,7 +18,7 @@ let activeClass = 'border-2 border-blue-500 bg-blue-500 hover:opacity-75 font-bold text-black duration-200 rounded-lg p-1 w-3/4'; let inactiveClass = 'border-2 border-blue-500 hover:opacity-75 duration-200 rounded-lg p-1 w-3/4'; - + export function open() { modal.open(); }