@htmlbricks/hb-pad-joystick 0.61.39 → 0.61.41

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/main.iife.js CHANGED
@@ -1,6 +1,6 @@
1
- (function(ae){"use strict";typeof window<"u"&&((window.__svelte??={}).v??=new Set).add("5");const mr=2,oe="[",le="[!",ue="]",at={},E=Symbol(),fe=!1;var he=Array.isArray,gr=Array.prototype.indexOf,wr=Array.from,xt=Object.keys,ot=Object.defineProperty,lt=Object.getOwnPropertyDescriptor,yr=Object.prototype,kr=Array.prototype,$r=Object.getPrototypeOf,ce=Object.isExtensible;function de(t){for(var e=0;e<t.length;e++)t[e]()}function Er(){var t,e,r=new Promise((n,s)=>{t=n,e=s});return{promise:r,resolve:t,reject:e}}const P=2,Ft=4,Sr=8,ut=16,F=32,G=64,ve=128,M=256,Ct=512,S=1024,L=2048,H=4096,z=8192,ft=16384,It=32768,Wt=65536,pe=1<<17,xr=1<<18,wt=1<<19,Cr=1<<20,qt=1<<21,_e=1<<22,Tt=1<<23,Gt=Symbol("$state"),Tr=Symbol("legacy props"),be=new class extends Error{name="StaleReactionError";message="The reaction that called `getAbortSignal()` was re-run or destroyed"},Rr=3,Rt=8;function Pr(t){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function Nr(t){throw new Error("https://svelte.dev/e/effect_in_teardown")}function Or(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function Mr(t){throw new Error("https://svelte.dev/e/effect_orphan")}function Lr(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function Yr(){throw new Error("https://svelte.dev/e/hydration_failed")}function Ar(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function jr(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function Dr(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function Pt(t){console.warn("https://svelte.dev/e/hydration_mismatch")}let x=!1;function ht(t){x=t}let $;function Z(t){if(t===null)throw Pt(),at;return $=t}function Ht(){return Z(rt($))}function me(t){if(x){if(rt($)!==null)throw Pt(),at;$=t}}function Xr(){for(var t=0,e=$;;){if(e.nodeType===Rt){var r=e.data;if(r===ue){if(t===0)return e;t-=1}else(r===oe||r===le)&&(t+=1)}var n=rt(e);e.remove(),e=n}}function Fr(t){if(!t||t.nodeType!==Rt)throw Pt(),at;return t.data}function ge(t){return t===this.v}function Ir(t,e){return t!=t?e==e:t!==e||t!==null&&typeof t=="object"||typeof t=="function"}function Wr(t){return!Ir(t,this.v)}let qr=!1,A=null;function we(t){A=t}function ye(t,e=!1,r){A={p:A,c:null,e:null,s:t,x:null,l:null}}function ke(t){var e=A,r=e.e;if(r!==null){e.e=null;for(var n of r)We(n)}return t!==void 0&&(e.x=t),A=e.p,t??{}}function $e(){return!0}const Gr=new WeakMap;function Hr(t){var e=m;if(e===null)return b.f|=Tt,t;if((e.f&It)===0){if((e.f&ve)===0)throw!e.parent&&t instanceof Error&&Se(t),t;e.b.error(t)}else Ee(t,e)}function Ee(t,e){for(;e!==null;){if((e.f&ve)!==0)try{e.b.error(t);return}catch(r){t=r}e=e.parent}throw t instanceof Error&&Se(t),t}function Se(t){const e=Gr.get(t);e&&(ot(t,"message",{value:e.message}),ot(t,"stack",{value:e.stack}))}let zt=[],Vt=[];function zr(){var t=zt;zt=[],de(t)}function Vr(){var t=Vt;Vt=[],de(t)}function Ur(){zt.length>0&&zr(),Vt.length>0&&Vr()}function Br(t){var e=P|L,r=b!==null&&(b.f&P)!==0?b:null;return m===null||r!==null&&(r.f&M)!==0?e|=M:m.f|=wt,{ctx:A,deps:null,effects:null,equals:ge,f:e,fn:t,reactions:null,rv:0,v:E,wv:0,parent:r??m,ac:null}}function xe(t){var e=t.effects;if(e!==null){t.effects=null;for(var r=0;r<e.length;r+=1)U(e[r])}}function Jr(t){for(var e=t.parent;e!==null;){if((e.f&P)===0)return e;e=e.parent}return null}function Ut(t){var e,r=m;pt(Jr(t));try{xe(t),e=er(t)}finally{pt(r)}return e}function Ce(t){var e=Ut(t);if(t.equals(e)||(t.v=e,t.wv=Qe()),!it){var r=(J||(t.f&M)!==0)&&t.deps!==null?H:S;O(t,r)}}const Bt=new Set;let R=null,Te=new Set,Nt=[];function Re(){const t=Nt.shift();Nt.length>0&&queueMicrotask(Re),t()}let Q=[],Ot=null,Jt=!1,Mt=!1;class tt{current=new Map;#e=new Map;#t=new Set;#r=0;#u=null;#f=!1;#i=[];#a=[];#s=[];#n=[];#o=[];#h=[];#c=[];skipped_effects=new Set;process(e){Q=[];for(const s of e)this.#v(s);if(this.#i.length===0&&this.#r===0){this.#d();var r=this.#s,n=this.#n;this.#s=[],this.#n=[],this.#o=[],R=null,Ne(r),Ne(n),R===null?R=this:Bt.delete(this),this.#u?.resolve()}else this.#l(this.#s),this.#l(this.#n),this.#l(this.#o);for(const s of this.#i)_t(s);for(const s of this.#a)_t(s);this.#i=[],this.#a=[]}#v(e){e.f^=S;for(var r=e.first;r!==null;){var n=r.f,s=(n&(F|G))!==0,i=s&&(n&S)!==0,a=i||(n&z)!==0||this.skipped_effects.has(r);if(!a&&r.fn!==null){if(s)r.f^=S;else if((n&Ft)!==0)this.#n.push(r);else if((n&S)===0)if((n&_e)!==0){var o=r.b?.is_pending()?this.#a:this.#i;o.push(r)}else Yt(r)&&((r.f&ut)!==0&&this.#o.push(r),_t(r));var l=r.first;if(l!==null){r=l;continue}}var u=r.parent;for(r=r.next;r===null&&u!==null;)r=u.next,u=u.parent}}#l(e){for(const r of e)((r.f&L)!==0?this.#h:this.#c).push(r),O(r,S);e.length=0}capture(e,r){this.#e.has(e)||this.#e.set(e,r),this.current.set(e,e.v)}activate(){R=this}deactivate(){R=null;for(const e of Te)if(Te.delete(e),e(),R!==null)break}neuter(){this.#f=!0}flush(){Q.length>0?Pe():this.#d(),R===this&&(this.#r===0&&Bt.delete(this),this.deactivate())}#d(){if(!this.#f)for(const e of this.#t)e();this.#t.clear()}increment(){this.#r+=1}decrement(){if(this.#r-=1,this.#r===0){for(const e of this.#h)O(e,L),ct(e);for(const e of this.#c)O(e,H),ct(e);this.#s=[],this.#n=[],this.flush()}else this.deactivate()}add_callback(e){this.#t.add(e)}settled(){return(this.#u??=Er()).promise}static ensure(){if(R===null){const e=R=new tt;Bt.add(R),Mt||tt.enqueue(()=>{R===e&&e.flush()})}return R}static enqueue(e){Nt.length===0&&queueMicrotask(Re),Nt.unshift(e)}}function Lt(t){var e=Mt;Mt=!0;try{for(var r;;){if(Ur(),Q.length===0&&(R?.flush(),Q.length===0))return Ot=null,r;Pe()}}finally{Mt=e}}function Pe(){var t=vt;Jt=!0;try{var e=0;for(Be(!0);Q.length>0;){var r=tt.ensure();if(e++>1e3){var n,s;Kr()}r.process(Q),V.clear()}}finally{Jt=!1,Be(t),Ot=null}}function Kr(){try{Lr()}catch(t){Ee(t,Ot)}}let et=null;function Ne(t){var e=t.length;if(e!==0){for(var r=0;r<e;){var n=t[r++];if((n.f&(ft|z))===0&&Yt(n)&&(et=[],_t(n),n.deps===null&&n.first===null&&n.nodes_start===null&&(n.teardown===null&&n.ac===null?He(n):n.fn=null),et?.length>0)){V.clear();for(const s of et)_t(s);et=[]}}et=null}}function ct(t){for(var e=Ot=t;e.parent!==null;){e=e.parent;var r=e.f;if(Jt&&e===m&&(r&ut)!==0)return;if((r&(G|F))!==0){if((r&S)===0)return;e.f^=S}}Q.push(e)}const V=new Map;function Oe(t,e){var r={f:0,v:t,reactions:null,equals:ge,rv:0,wv:0};return r}function I(t,e){const r=Oe(t);return vn(r),r}function Zr(t,e=!1,r=!0){const n=Oe(t);return e||(n.equals=Wr),n}function W(t,e,r=!1){b!==null&&(!X||(b.f&pe)!==0)&&$e()&&(b.f&(P|ut|_e|pe))!==0&&!q?.includes(t)&&Dr();let n=r?dt(e):e;return Qr(t,n)}function Qr(t,e){if(!t.equals(e)){var r=t.v;it?V.set(t,e):V.set(t,r),t.v=e;var n=tt.ensure();n.capture(t,r),(t.f&P)!==0&&((t.f&L)!==0&&Ut(t),O(t,(t.f&M)===0?S:H)),t.wv=Qe(),Me(t,L),m!==null&&(m.f&S)!==0&&(m.f&(F|G))===0&&(Y===null?pn([t]):Y.push(t))}return e}function Kt(t){W(t,t.v+1)}function Me(t,e){var r=t.reactions;if(r!==null)for(var n=r.length,s=0;s<n;s++){var i=r[s],a=i.f,o=(a&L)===0;o&&O(i,e),(a&P)!==0?Me(i,H):o&&((a&ut)!==0&&et!==null&&et.push(i),ct(i))}}function dt(t){if(typeof t!="object"||t===null||Gt in t)return t;const e=$r(t);if(e!==yr&&e!==kr)return t;var r=new Map,n=he(t),s=I(0),i=st,a=o=>{if(st===i)return o();var l=b,u=st;B(null),Ze(i);var h=o();return B(l),Ze(u),h};return n&&r.set("length",I(t.length)),new Proxy(t,{defineProperty(o,l,u){(!("value"in u)||u.configurable===!1||u.enumerable===!1||u.writable===!1)&&Ar();var h=r.get(l);return h===void 0?h=a(()=>{var c=I(u.value);return r.set(l,c),c}):W(h,u.value,!0),!0},deleteProperty(o,l){var u=r.get(l);if(u===void 0){if(l in o){const h=a(()=>I(E));r.set(l,h),Kt(s)}}else W(u,E),Kt(s);return!0},get(o,l,u){if(l===Gt)return t;var h=r.get(l),c=l in o;if(h===void 0&&(!c||lt(o,l)?.writable)&&(h=a(()=>{var d=dt(c?o[l]:E),f=I(d);return f}),r.set(l,h)),h!==void 0){var v=K(h);return v===E?void 0:v}return Reflect.get(o,l,u)},getOwnPropertyDescriptor(o,l){var u=Reflect.getOwnPropertyDescriptor(o,l);if(u&&"value"in u){var h=r.get(l);h&&(u.value=K(h))}else if(u===void 0){var c=r.get(l),v=c?.v;if(c!==void 0&&v!==E)return{enumerable:!0,configurable:!0,value:v,writable:!0}}return u},has(o,l){if(l===Gt)return!0;var u=r.get(l),h=u!==void 0&&u.v!==E||Reflect.has(o,l);if(u!==void 0||m!==null&&(!h||lt(o,l)?.writable)){u===void 0&&(u=a(()=>{var v=h?dt(o[l]):E,d=I(v);return d}),r.set(l,u));var c=K(u);if(c===E)return!1}return h},set(o,l,u,h){var c=r.get(l),v=l in o;if(n&&l==="length")for(var d=u;d<c.v;d+=1){var f=r.get(d+"");f!==void 0?W(f,E):d in o&&(f=a(()=>I(E)),r.set(d+"",f))}if(c===void 0)(!v||lt(o,l)?.writable)&&(c=a(()=>I(void 0)),W(c,dt(u)),r.set(l,c));else{v=c.v!==E;var p=a(()=>dt(u));W(c,p)}var y=Reflect.getOwnPropertyDescriptor(o,l);if(y?.set&&y.set.call(h,u),!v){if(n&&typeof l=="string"){var k=r.get("length"),g=Number(l);Number.isInteger(g)&&g>=k.v&&W(k,g+1)}Kt(s)}return!0},ownKeys(o){K(s);var l=Reflect.ownKeys(o).filter(c=>{var v=r.get(c);return v===void 0||v.v!==E});for(var[u,h]of r)h.v!==E&&!(u in o)&&l.push(u);return l},setPrototypeOf(){jr()}})}var Le,Ye,Ae,je;function Zt(){if(Le===void 0){Le=window,Ye=/Firefox/.test(navigator.userAgent);var t=Element.prototype,e=Node.prototype,r=Text.prototype;Ae=lt(e,"firstChild").get,je=lt(e,"nextSibling").get,ce(t)&&(t.__click=void 0,t.__className=void 0,t.__attributes=null,t.__style=void 0,t.__e=void 0),ce(r)&&(r.__t=void 0)}}function yt(t=""){return document.createTextNode(t)}function kt(t){return Ae.call(t)}function rt(t){return je.call(t)}function De(t,e){if(!x)return kt(t);var r=kt($);return r===null&&(r=$.appendChild(yt())),Z(r),r}function Xe(t,e){if(!x){var r=kt(t);return r instanceof Comment&&r.data===""?rt(r):r}return $}function Qt(t,e=1,r=!1){let n=x?$:t;for(var s;e--;)s=n,n=rt(n);if(!x)return n;if(r&&n?.nodeType!==Rr){var i=yt();return n===null?s?.after(i):n.before(i),Z(i),i}return Z(n),n}function tn(t){t.textContent=""}function en(){return!1}function Fe(t){var e=b,r=m;B(null),pt(null);try{return t()}finally{B(e),pt(r)}}function rn(t){m===null&&b===null&&Mr(),b!==null&&(b.f&M)!==0&&m===null&&Or(),it&&Nr()}function nn(t,e){var r=e.last;r===null?e.last=e.first=t:(r.next=t,t.prev=r,e.last=t)}function nt(t,e,r,n=!0){var s=m;s!==null&&(s.f&z)!==0&&(t|=z);var i={ctx:A,deps:null,nodes_start:null,nodes_end:null,f:t|L,first:null,fn:e,last:null,next:null,parent:s,b:s&&s.b,prev:null,teardown:null,transitions:null,wv:0,ac:null};if(r)try{_t(i),i.f|=It}catch(l){throw U(i),l}else e!==null&&ct(i);if(n){var a=i;if(r&&a.deps===null&&a.teardown===null&&a.nodes_start===null&&a.first===a.last&&(a.f&wt)===0&&(a=a.first),a!==null&&(a.parent=s,s!==null&&nn(a,s),b!==null&&(b.f&P)!==0&&(t&G)===0)){var o=b;(o.effects??=[]).push(a)}}return i}function Ie(t){rn();var e=m.f,r=!b&&(e&F)!==0&&(e&It)===0;if(r){var n=A;(n.e??=[]).push(t)}else return We(t)}function We(t){return nt(Ft|Cr,t,!1)}function sn(t){tt.ensure();const e=nt(G|wt,t,!0);return()=>{U(e)}}function an(t){tt.ensure();const e=nt(G|wt,t,!0);return(r={})=>new Promise(n=>{r.outro?ze(e,()=>{U(e),n(void 0)}):(U(e),n(void 0))})}function on(t){return nt(Ft,t,!1)}function ln(t,e=0){return nt(Sr|e,t,!0)}function un(t,e=0){var r=nt(ut|e,t,!0);return r}function te(t,e=!0){return nt(F|wt,t,!0,e)}function qe(t){var e=t.teardown;if(e!==null){const r=it,n=b;Je(!0),B(null);try{e.call(null)}finally{Je(r),B(n)}}}function Ge(t,e=!1){var r=t.first;for(t.first=t.last=null;r!==null;){const s=r.ac;s!==null&&Fe(()=>{s.abort(be)});var n=r.next;(r.f&G)!==0?r.parent=null:U(r,e),r=n}}function fn(t){for(var e=t.first;e!==null;){var r=e.next;(e.f&F)===0&&U(e),e=r}}function U(t,e=!0){var r=!1;(e||(t.f&xr)!==0)&&t.nodes_start!==null&&t.nodes_end!==null&&(hn(t.nodes_start,t.nodes_end),r=!0),Ge(t,e&&!r),At(t,0),O(t,ft);var n=t.transitions;if(n!==null)for(const i of n)i.stop();qe(t);var s=t.parent;s!==null&&s.first!==null&&He(t),t.next=t.prev=t.teardown=t.ctx=t.deps=t.fn=t.nodes_start=t.nodes_end=t.ac=null}function hn(t,e){for(;t!==null;){var r=t===e?null:rt(t);t.remove(),t=r}}function He(t){var e=t.parent,r=t.prev,n=t.next;r!==null&&(r.next=n),n!==null&&(n.prev=r),e!==null&&(e.first===t&&(e.first=n),e.last===t&&(e.last=r))}function ze(t,e){var r=[];Ve(t,r,!0),cn(r,()=>{U(t),e&&e()})}function cn(t,e){var r=t.length;if(r>0){var n=()=>--r||e();for(var s of t)s.out(n)}else e()}function Ve(t,e,r){if((t.f&z)===0){if(t.f^=z,t.transitions!==null)for(const a of t.transitions)(a.is_global||r)&&e.push(a);for(var n=t.first;n!==null;){var s=n.next,i=(n.f&Wt)!==0||(n.f&F)!==0;Ve(n,e,i?r:!1),n=s}}}function dn(t){Ue(t,!0)}function Ue(t,e){if((t.f&z)!==0){t.f^=z,(t.f&S)===0&&(O(t,L),ct(t));for(var r=t.first;r!==null;){var n=r.next,s=(r.f&Wt)!==0||(r.f&F)!==0;Ue(r,s?e:!1),r=n}if(t.transitions!==null)for(const i of t.transitions)(i.is_global||e)&&i.in()}}let vt=!1;function Be(t){vt=t}let it=!1;function Je(t){it=t}let b=null,X=!1;function B(t){b=t}let m=null;function pt(t){m=t}let q=null;function vn(t){b!==null&&(q===null?q=[t]:q.push(t))}let C=null,N=0,Y=null;function pn(t){Y=t}let Ke=1,$t=0,st=$t;function Ze(t){st=t}let J=!1;function Qe(){return++Ke}function Yt(t){var e=t.f;if((e&L)!==0)return!0;if((e&H)!==0){var r=t.deps,n=(e&M)!==0;if(r!==null){var s,i,a=(e&Ct)!==0,o=n&&m!==null&&!J,l=r.length;if((a||o)&&(m===null||(m.f&ft)===0)){var u=t,h=u.parent;for(s=0;s<l;s++)i=r[s],(a||!i?.reactions?.includes(u))&&(i.reactions??=[]).push(u);a&&(u.f^=Ct),o&&h!==null&&(h.f&M)===0&&(u.f^=M)}for(s=0;s<l;s++)if(i=r[s],Yt(i)&&Ce(i),i.wv>t.wv)return!0}(!n||m!==null&&!J)&&O(t,S)}return!1}function tr(t,e,r=!0){var n=t.reactions;if(n!==null&&!q?.includes(t))for(var s=0;s<n.length;s++){var i=n[s];(i.f&P)!==0?tr(i,e,!1):e===i&&(r?O(i,L):(i.f&S)!==0&&O(i,H),ct(i))}}function er(t){var e=C,r=N,n=Y,s=b,i=J,a=q,o=A,l=X,u=st,h=t.f;C=null,N=0,Y=null,J=(h&M)!==0&&(X||!vt||b===null),b=(h&(F|G))===0?t:null,q=null,we(t.ctx),X=!1,st=++$t,t.ac!==null&&(Fe(()=>{t.ac.abort(be)}),t.ac=null);try{t.f|=qt;var c=t.fn,v=c(),d=t.deps;if(C!==null){var f;if(At(t,N),d!==null&&N>0)for(d.length=N+C.length,f=0;f<C.length;f++)d[N+f]=C[f];else t.deps=d=C;if(!J||(h&P)!==0&&t.reactions!==null)for(f=N;f<d.length;f++)(d[f].reactions??=[]).push(t)}else d!==null&&N<d.length&&(At(t,N),d.length=N);if($e()&&Y!==null&&!X&&d!==null&&(t.f&(P|H|L))===0)for(f=0;f<Y.length;f++)tr(Y[f],t);return s!==null&&s!==t&&($t++,Y!==null&&(n===null?n=Y:n.push(...Y))),(t.f&Tt)!==0&&(t.f^=Tt),v}catch(p){return Hr(p)}finally{t.f^=qt,C=e,N=r,Y=n,b=s,J=i,q=a,we(o),X=l,st=u}}function _n(t,e){let r=e.reactions;if(r!==null){var n=gr.call(r,t);if(n!==-1){var s=r.length-1;s===0?r=e.reactions=null:(r[n]=r[s],r.pop())}}r===null&&(e.f&P)!==0&&(C===null||!C.includes(e))&&(O(e,H),(e.f&(M|Ct))===0&&(e.f^=Ct),xe(e),At(e,0))}function At(t,e){var r=t.deps;if(r!==null)for(var n=e;n<r.length;n++)_n(t,r[n])}function _t(t){var e=t.f;if((e&ft)===0){O(t,S);var r=m,n=vt;m=t,vt=!0;try{(e&ut)!==0?fn(t):Ge(t),qe(t);var s=er(t);t.teardown=typeof s=="function"?s:null,t.wv=Ke;var i;fe&&qr&&(t.f&L)!==0&&t.deps}finally{vt=n,m=r}}}function K(t){var e=t.f,r=(e&P)!==0;if(b!==null&&!X){var n=m!==null&&(m.f&ft)!==0;if(!n&&!q?.includes(t)){var s=b.deps;if((b.f&qt)!==0)t.rv<$t&&(t.rv=$t,C===null&&s!==null&&s[N]===t?N++:C===null?C=[t]:(!J||!C.includes(t))&&C.push(t));else{(b.deps??=[]).push(t);var i=t.reactions;i===null?t.reactions=[b]:i.includes(b)||i.push(b)}}}else if(r&&t.deps===null&&t.effects===null){var a=t,o=a.parent;o!==null&&(o.f&M)===0&&(a.f^=M)}if(it){if(V.has(t))return V.get(t);if(r){a=t;var l=a.v;return((a.f&S)===0&&a.reactions!==null||rr(a))&&(l=Ut(a)),V.set(a,l),l}}else r&&(a=t,Yt(a)&&Ce(a));if((t.f&Tt)!==0)throw t.v;return t.v}function rr(t){if(t.v===E)return!0;if(t.deps===null)return!1;for(const e of t.deps)if(V.has(e)||(e.f&P)!==0&&rr(e))return!0;return!1}function bn(t){var e=X;try{return X=!0,t()}finally{X=e}}const mn=-7169;function O(t,e){t.f=t.f&mn|e}const nr=new Set,ee=new Set;function gn(t){for(var e=0;e<t.length;e++)nr.add(t[e]);for(var r of ee)r(t)}let ir=null;function jt(t){var e=this,r=e.ownerDocument,n=t.type,s=t.composedPath?.()||[],i=s[0]||t.target;ir=t;var a=0,o=ir===t&&t.__root;if(o){var l=s.indexOf(o);if(l!==-1&&(e===document||e===window)){t.__root=e;return}var u=s.indexOf(e);if(u===-1)return;l<=u&&(a=l)}if(i=s[a]||t.target,i!==e){ot(t,"currentTarget",{configurable:!0,get(){return i||r}});var h=b,c=m;B(null),pt(null);try{for(var v,d=[];i!==null;){var f=i.assignedSlot||i.parentNode||i.host||null;try{var p=i["__"+n];if(p!=null&&(!i.disabled||t.target===i))if(he(p)){var[y,...k]=p;y.apply(i,[t,...k])}else p.call(i,t)}catch(g){v?d.push(g):v=g}if(t.cancelBubble||f===e||f===null)break;i=f}if(v){for(let g of d)queueMicrotask(()=>{throw g});throw v}}finally{t.__root=e,delete t.currentTarget,B(h),pt(c)}}}function wn(t){var e=document.createElement("template");return e.innerHTML=t.replaceAll("<!>","<!---->"),e.content}function Et(t,e){var r=m;r.nodes_start===null&&(r.nodes_start=t,r.nodes_end=e)}function re(t,e){var r=(e&mr)!==0,n,s=!t.startsWith("<!>");return()=>{if(x)return Et($,null),$;n===void 0&&(n=wn(s?t:"<!>"+t),n=kt(n));var i=r||Ye?document.importNode(n,!0):n.cloneNode(!0);return Et(i,i),i}}function sr(){if(x)return Et($,null),$;var t=document.createDocumentFragment(),e=document.createComment(""),r=yt();return t.append(e,r),Et(e,r),t}function bt(t,e){if(x){m.nodes_end=$,Ht();return}t!==null&&t.before(e)}const yn=["touchstart","touchmove"];function kn(t){return yn.includes(t)}function ar(t,e){return or(t,e)}function $n(t,e){Zt(),e.intro=e.intro??!1;const r=e.target,n=x,s=$;try{for(var i=kt(r);i&&(i.nodeType!==Rt||i.data!==oe);)i=rt(i);if(!i)throw at;ht(!0),Z(i),Ht();const a=or(t,{...e,anchor:i});if($===null||$.nodeType!==Rt||$.data!==ue)throw Pt(),at;return ht(!1),a}catch(a){if(a instanceof Error&&a.message.split(`
2
- `).some(o=>o.startsWith("https://svelte.dev/e/")))throw a;return a!==at&&console.warn("Failed to hydrate: ",a),e.recover===!1&&Yr(),Zt(),tn(r),ht(!1),ar(t,e)}finally{ht(n),Z(s)}}const mt=new Map;function or(t,{target:e,anchor:r,props:n={},events:s,context:i,intro:a=!0}){Zt();var o=new Set,l=c=>{for(var v=0;v<c.length;v++){var d=c[v];if(!o.has(d)){o.add(d);var f=kn(d);e.addEventListener(d,jt,{passive:f});var p=mt.get(d);p===void 0?(document.addEventListener(d,jt,{passive:f}),mt.set(d,1)):mt.set(d,p+1)}}};l(wr(nr)),ee.add(l);var u=void 0,h=an(()=>{var c=r??e.appendChild(yt());return te(()=>{if(i){ye({});var v=A;v.c=i}s&&(n.$$events=s),x&&Et(c,null),u=t(c,n)||{},x&&(m.nodes_end=$),i&&ke()}),()=>{for(var v of o){e.removeEventListener(v,jt);var d=mt.get(v);--d===0?(document.removeEventListener(v,jt),mt.delete(v)):mt.set(v,d)}ee.delete(l),c!==r&&c.parentNode?.removeChild(c)}});return ne.set(u,h),u}let ne=new WeakMap;function En(t,e){const r=ne.get(t);return r?(ne.delete(t),r(e)):Promise.resolve()}function Sn(t){A===null&&Pr(),Ie(()=>{const e=bn(t);if(typeof e=="function")return e})}function lr(t,e,r=!1){x&&Ht();var n=t,s=null,i=null,a=E,o=r?Wt:0,l=!1;const u=(d,f=!0)=>{l=!0,v(f,d)};var h=null;function c(){h!==null&&(h.lastChild.remove(),n.before(h),h=null);var d=a?s:i,f=a?i:s;d&&dn(d),f&&ze(f,()=>{a?i=null:s=null})}const v=(d,f)=>{if(a===(a=d))return;let p=!1;if(x){const Xt=Fr(n)===le;!!a===Xt&&(n=Xr(),Z(n),ht(!1),p=!0)}var y=en(),k=n;if(y&&(h=document.createDocumentFragment(),h.append(k=yt())),a?s??=f&&te(()=>f(k)):i??=f&&te(()=>f(k)),y){var g=R,T=a?s:i,j=a?i:s;T&&g.skipped_effects.delete(T),j&&g.skipped_effects.add(j),g.add_callback(c)}else c();p&&ht(!0)};un(()=>{l=!1,e(u),l||v(null,null)},o),x&&(n=$)}function xn(t,e){on(()=>{var r=t.getRootNode(),n=r.host?r:r.head??r.ownerDocument.head;if(!n.querySelector("#"+e.hash)){const s=document.createElement("style");s.id=e.hash,s.textContent=e.code,n.appendChild(s)}})}function ie(t,e,r,n){var s=n,i=!0,a=()=>(i&&(i=!1,s=n),s),o;o=t[e],o===void 0&&n!==void 0&&(o=a());var l;l=()=>{var v=t[e];return v===void 0?a():(i=!0,v)};var u=!1,h=Br(()=>(u=!1,l())),c=m;return(function(v,d){if(arguments.length>0){const f=d?K(h):v;return W(h,f),u=!0,s!==void 0&&(s=f),v}return it&&u||(c.f&ft)!==0?h.v:K(h)})}function Cn(t){return new Tn(t)}class Tn{#e;#t;constructor(e){var r=new Map,n=(i,a)=>{var o=Zr(a,!1,!1);return r.set(i,o),o};const s=new Proxy({...e.props||{},$$events:{}},{get(i,a){return K(r.get(a)??n(a,Reflect.get(i,a)))},has(i,a){return a===Tr?!0:(K(r.get(a)??n(a,Reflect.get(i,a))),Reflect.has(i,a))},set(i,a,o){return W(r.get(a)??n(a,o),o),Reflect.set(i,a,o)}});this.#t=(e.hydrate?$n:ar)(e.component,{target:e.target,anchor:e.anchor,props:s,context:e.context,intro:e.intro??!1,recover:e.recover}),(!e?.props?.$$host||e.sync===!1)&&Lt(),this.#e=s.$$events;for(const i of Object.keys(this.#t))i==="$set"||i==="$destroy"||i==="$on"||ot(this,i,{get(){return this.#t[i]},set(a){this.#t[i]=a},enumerable:!0});this.#t.$set=i=>{Object.assign(s,i)},this.#t.$destroy=()=>{En(this.#t)}}$set(e){this.#t.$set(e)}$on(e,r){this.#e[e]=this.#e[e]||[];const n=(...s)=>r.call(this,...s);return this.#e[e].push(n),()=>{this.#e[e]=this.#e[e].filter(s=>s!==n)}}$destroy(){this.#t.$destroy()}}let ur;typeof HTMLElement=="function"&&(ur=class extends HTMLElement{$$ctor;$$s;$$c;$$cn=!1;$$d={};$$r=!1;$$p_d={};$$l={};$$l_u=new Map;$$me;constructor(t,e,r){super(),this.$$ctor=t,this.$$s=e,r&&this.attachShadow({mode:"open"})}addEventListener(t,e,r){if(this.$$l[t]=this.$$l[t]||[],this.$$l[t].push(e),this.$$c){const n=this.$$c.$on(t,e);this.$$l_u.set(e,n)}super.addEventListener(t,e,r)}removeEventListener(t,e,r){if(super.removeEventListener(t,e,r),this.$$c){const n=this.$$l_u.get(e);n&&(n(),this.$$l_u.delete(e))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){let t=function(n){return s=>{const i=document.createElement("slot");n!=="default"&&(i.name=n),bt(s,i)}};if(await Promise.resolve(),!this.$$cn||this.$$c)return;const e={},r=Rn(this);for(const n of this.$$s)n in r&&(n==="default"&&!this.$$d.children?(this.$$d.children=t(n),e.default=!0):e[n]=t(n));for(const n of this.attributes){const s=this.$$g_p(n.name);s in this.$$d||(this.$$d[s]=Dt(s,n.value,this.$$p_d,"toProp"))}for(const n in this.$$p_d)!(n in this.$$d)&&this[n]!==void 0&&(this.$$d[n]=this[n],delete this[n]);this.$$c=Cn({component:this.$$ctor,target:this.shadowRoot||this,props:{...this.$$d,$$slots:e,$$host:this}}),this.$$me=sn(()=>{ln(()=>{this.$$r=!0;for(const n of xt(this.$$c)){if(!this.$$p_d[n]?.reflect)continue;this.$$d[n]=this.$$c[n];const s=Dt(n,this.$$d[n],this.$$p_d,"toAttribute");s==null?this.removeAttribute(this.$$p_d[n].attribute||n):this.setAttribute(this.$$p_d[n].attribute||n,s)}this.$$r=!1})});for(const n in this.$$l)for(const s of this.$$l[n]){const i=this.$$c.$on(n,s);this.$$l_u.set(s,i)}this.$$l={}}}attributeChangedCallback(t,e,r){this.$$r||(t=this.$$g_p(t),this.$$d[t]=Dt(t,r,this.$$p_d,"toProp"),this.$$c?.$set({[t]:this.$$d[t]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then(()=>{!this.$$cn&&this.$$c&&(this.$$c.$destroy(),this.$$me(),this.$$c=void 0)})}$$g_p(t){return xt(this.$$p_d).find(e=>this.$$p_d[e].attribute===t||!this.$$p_d[e].attribute&&e.toLowerCase()===t)||t}});function Dt(t,e,r,n){const s=r[t]?.type;if(e=s==="Boolean"&&typeof e!="boolean"?e!=null:e,!n||!r[t])return e;if(n==="toAttribute")switch(s){case"Object":case"Array":return e==null?null:JSON.stringify(e);case"Boolean":return e?"":null;case"Number":return e??null;default:return e}else switch(s){case"Object":case"Array":return e&&JSON.parse(e);case"Boolean":return e;case"Number":return e!=null?+e:e;default:return e}}function Rn(t){const e={};return t.childNodes.forEach(r=>{e[r.slot||"default"]=!0}),e}function Pn(t,e,r,n,s,i){let a=class extends ur{constructor(){super(t,r,s),this.$$p_d=e}static get observedAttributes(){return xt(e).map(o=>(e[o].attribute||o).toLowerCase())}};return xt(e).forEach(o=>{ot(a.prototype,o,{get(){return this.$$c&&o in this.$$c?this.$$c[o]:this.$$d[o]},set(l){l=Dt(o,l,e),this.$$d[o]=l;var u=this.$$c;if(u){var h=lt(u,o)?.get;h?u[o]=l:u.$set({[o]:l})}}})}),n.forEach(o=>{ot(a.prototype,o,{get(){return this.$$c?.[o]}})}),t.element=a,a}function Nn(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var gt={},se,fr;function On(){if(fr)return se;fr=1;var t=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,e=/\n/g,r=/^\s*/,n=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,s=/^:\s*/,i=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,a=/^[;\s]*/,o=/^\s+|\s+$/g,l=`
3
- `,u="/",h="*",c="",v="comment",d="declaration";se=function(p,y){if(typeof p!="string")throw new TypeError("First argument must be a string");if(!p)return[];y=y||{};var k=1,g=1;function T(w){var _=w.match(e);_&&(k+=_.length);var D=w.lastIndexOf(l);g=~D?w.length-D:g+w.length}function j(){var w={line:k,column:g};return function(_){return _.position=new Xt(w),pr(),_}}function Xt(w){this.start=w,this.end={line:k,column:g},this.source=y.source}Xt.prototype.content=p;function vr(w){var _=new Error(y.source+":"+k+":"+g+": "+w);if(_.reason=w,_.filename=y.source,_.line=k,_.column=g,_.source=p,!y.silent)throw _}function St(w){var _=w.exec(p);if(_){var D=_[0];return T(D),p=p.slice(D.length),_}}function pr(){St(r)}function _r(w){var _;for(w=w||[];_=br();)_!==!1&&w.push(_);return w}function br(){var w=j();if(!(u!=p.charAt(0)||h!=p.charAt(1))){for(var _=2;c!=p.charAt(_)&&(h!=p.charAt(_)||u!=p.charAt(_+1));)++_;if(_+=2,c===p.charAt(_-1))return vr("End of comment missing");var D=p.slice(2,_-2);return g+=2,T(D),p=p.slice(_),g+=2,w({type:v,comment:D})}}function Gn(){var w=j(),_=St(n);if(_){if(br(),!St(s))return vr("property missing ':'");var D=St(i),zn=w({type:d,property:f(_[0].replace(t,c)),value:D?f(D[0].replace(t,c)):c});return St(a),zn}}function Hn(){var w=[];_r(w);for(var _;_=Gn();)_!==!1&&(w.push(_),_r(w));return w}return pr(),Hn()};function f(p){return p?p.replace(o,c):c}return se}var hr;function Mn(){if(hr)return gt;hr=1;var t=gt&&gt.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(gt,"__esModule",{value:!0}),gt.default=r;var e=t(On());function r(n,s){var i=null;if(!n||typeof n!="string")return i;var a=(0,e.default)(n),o=typeof s=="function";return a.forEach(function(l){if(l.type==="declaration"){var u=l.property,h=l.value;o?s(u,h,l):h&&(i=i||{},i[u]=h)}}),i}return gt}var Ln=Mn();const cr=Nn(Ln);cr.default;class Yn{constructor(e,r){this.StickStatus={xPosition:0,yPosition:0,x:0,y:0,cardinalDirection:"C"},this.parameters=r?.parameters||{};const n={title:"joystick",width:0,height:0,internalFillColor:"#00AA00",internalLineWidth:2,internalStrokeColor:"#003300",externalLineWidth:2,externalStrokeColor:"#008000",autoReturnToCenter:!0,callback:function(i){}};this.callback=r?.callback||n.callback,this.title=r?.parameters?.title||n.title,this.width=r?.parameters?.width||n.width,this.height=r?.parameters?.height||n.height,this.internalFillColor=r?.parameters?.internalFillColor||n.internalFillColor,this.internalLineWidth=r?.parameters?.internalLineWidth||n.internalLineWidth,this.internalStrokeColor=r?.parameters?.internalStrokeColor||n.internalStrokeColor,this.externalLineWidth=r?.parameters?.externalLineWidth||n.externalLineWidth,this.externalStrokeColor=r?.parameters?.externalStrokeColor||n.externalStrokeColor,this.autoReturnToCenter=r?.parameters?.autoReturnToCenter||n.autoReturnToCenter,console.log("stttt",e.style),e.style.touchAction="none",this.canvas=document.createElement("canvas"),this.canvas.id=this.title,this.width===0&&(this.width=e.clientWidth),this.height===0&&(this.height=e.clientHeight),this.canvas.width=this.width,this.canvas.height=this.height,e.appendChild(this.canvas);const s=this.canvas.getContext("2d");console.log("canvas",s),this.context=s,this.pressed=!1,this.circumference=2*Math.PI,this.internalRadius=(this.canvas.width-(this.canvas.width/2+10))/2,this.maxMoveStick=this.internalRadius*1.1,this.externalRadius=this.internalRadius*1.6,this.centerX=this.canvas.width/2,this.centerY=this.canvas.height/2,this.directionHorizontalLimitPos=this.canvas.width/10,this.directionHorizontalLimitNeg=this.directionHorizontalLimitPos*-1,this.directionVerticalLimitPos=this.canvas.height/10,this.directionVerticalLimitNeg=this.directionVerticalLimitPos*-1,this.movedX=this.centerX,this.movedY=this.centerY,"ontouchstart"in document.documentElement?(this.canvas.addEventListener("touchstart",i=>this._onTouchStart(i),!1),document.addEventListener("touchmove",i=>this._onTouchMove(i),!1),document.addEventListener("touchend",i=>this._onTouchEnd(i),!1)):(this.canvas.addEventListener("mousedown",i=>this._onMouseDown(i),!1),document.addEventListener("mousemove",i=>this._onMouseMove(i),!1),document.addEventListener("mouseup",i=>this._onMouseUp(i),!1)),this._drawExternal(),this._drawInternal()}_drawExternal(){this.context.beginPath(),this.context.arc(this.centerX,this.centerY,this.externalRadius,0,this.circumference,!1),this.context.lineWidth=this.externalLineWidth,this.context.strokeStyle=this.externalStrokeColor,this.context.stroke()}_drawInternal(){this.context.beginPath(),this.movedX<this.internalRadius&&(this.movedX=this.maxMoveStick),this.movedX+this.internalRadius>this.canvas.width&&(this.movedX=this.canvas.width-this.maxMoveStick),this.movedY<this.internalRadius&&(this.movedY=this.maxMoveStick),this.movedY+this.internalRadius>this.canvas.height&&(this.movedY=this.canvas.height-this.maxMoveStick),this.context.arc(this.movedX,this.movedY,this.internalRadius,0,this.circumference,!1);const e=this.context.createRadialGradient(this.centerX,this.centerY,5,this.centerX,this.centerY,200);e.addColorStop(0,this.internalFillColor),e.addColorStop(1,this.internalStrokeColor),this.context.fillStyle=e,this.context.fill(),this.context.lineWidth=this.internalLineWidth,this.context.strokeStyle=this.internalStrokeColor,this.context.stroke()}_onTouchStart(e){this.pressed=!0}_onTouchMove(e){this.pressed&&e.targetTouches[0].target===this.canvas&&(this.movedX=e.targetTouches[0].pageX,this.movedY=e.targetTouches[0].pageY,this.canvas.offsetParent.tagName.toUpperCase()==="BODY"?(this.movedX-=this.canvas.offsetLeft,this.movedY-=this.canvas.offsetTop):(this.movedX-=this.canvas.offsetParent.offsetLeft,this.movedY-=this.canvas.offsetParent.offsetTop),this.context.clearRect(0,0,this.canvas.width,this.canvas.height),this._drawExternal(),this._drawInternal(),this.StickStatus.xPosition=this.movedX,this.StickStatus.yPosition=this.movedY,this.StickStatus.x=Number((100*((this.movedX-this.centerX)/this.maxMoveStick)).toFixed()),this.StickStatus.y=Number((100*((this.movedY-this.centerY)/this.maxMoveStick)*-1).toFixed()),this.StickStatus.cardinalDirection=this._getCardinalDirection(),this.callback(this.StickStatus))}_onTouchEnd(e){this.pressed=!1,this.autoReturnToCenter&&(this.movedX=this.centerX,this.movedY=this.centerY),this.context.clearRect(0,0,this.canvas.width,this.canvas.height),this._drawExternal(),this._drawInternal(),this.StickStatus.xPosition=this.movedX,this.StickStatus.yPosition=this.movedY,this.StickStatus.x=Number((100*((this.movedX-this.centerX)/this.maxMoveStick)).toFixed()),this.StickStatus.y=Number((100*((this.movedY-this.centerY)/this.maxMoveStick)*-1).toFixed()),this.StickStatus.cardinalDirection=this._getCardinalDirection(),this.callback(this.StickStatus)}_onMouseDown(e){this.pressed=!0}_onMouseMove(e){this.pressed&&(this.movedX=e.pageX,this.movedY=e.pageY,this.canvas.offsetParent.tagName.toUpperCase()==="BODY"?(this.movedX-=this.canvas.offsetLeft,this.movedY-=this.canvas.offsetTop):(this.movedX-=this.canvas.offsetParent.offsetLeft,this.movedY-=this.canvas.offsetParent.offsetTop),this.context.clearRect(0,0,this.canvas.width,this.canvas.height),this._drawExternal(),this._drawInternal(),this.StickStatus.xPosition=this.movedX,this.StickStatus.yPosition=this.movedY,this.StickStatus.x=Number((100*((this.movedX-this.centerX)/this.maxMoveStick)).toFixed()),this.StickStatus.y=Number((100*((this.movedY-this.centerY)/this.maxMoveStick)*-1).toFixed()),this.StickStatus.cardinalDirection=this._getCardinalDirection(),this.callback(this.StickStatus))}_onMouseUp(e){this.pressed=!1,this.autoReturnToCenter&&(this.movedX=this.centerX,this.movedY=this.centerY),this.context.clearRect(0,0,this.canvas.width,this.canvas.height),this._drawExternal(),this._drawInternal(),this.StickStatus.xPosition=this.movedX,this.StickStatus.yPosition=this.movedY,this.StickStatus.x=Number((100*((this.movedX-this.centerX)/this.maxMoveStick)).toFixed()),this.StickStatus.y=Number((100*((this.movedY-this.centerY)/this.maxMoveStick)*-1).toFixed()),this.StickStatus.cardinalDirection=this._getCardinalDirection(),this.callback(this.StickStatus)}_getCardinalDirection(){let e="",r=this.movedX-this.centerX,n=this.movedY-this.centerY;return n>=this.directionVerticalLimitNeg&&n<=this.directionVerticalLimitPos&&(e="C"),n<this.directionVerticalLimitNeg&&(e="N"),n>this.directionVerticalLimitPos&&(e="S"),r<this.directionHorizontalLimitNeg&&(e==="C"?e="W":e+="W"),r>this.directionHorizontalLimitPos&&(e==="C"?e="E":e+="E"),e}GetWidth(){return this.canvas.width}GetHeight(){return this.canvas.height}GetPosX(){return this.movedX}GetPosY(){return this.movedY}GetX(){return(100*((this.movedX-this.centerX)/this.maxMoveStick)).toFixed()}GetY(){return(100*((this.movedY-this.centerY)/this.maxMoveStick)*-1).toFixed()}GetDir(){return this._getCardinalDirection()}}var An=(t,e)=>e("up"),jn=(t,e)=>e("right"),Dn=(t,e)=>e("down"),Xn=(t,e)=>e("left"),Fn=re('<div class="set svelte-1hlpbb9"><nav class="d-pad svelte-1hlpbb9"><button class="up svelte-1hlpbb9" aria-label="Move up"></button> <button class="right svelte-1hlpbb9" aria-label="Move right"></button> <button class="down svelte-1hlpbb9" aria-label="Move down"></button> <button class="left svelte-1hlpbb9" aria-label="Move left"></button></nav></div>'),In=re('<div id="joystick" class="svelte-1hlpbb9"></div>'),Wn=re("<div>Unknown type</div>");const qn={hash:"svelte-1hlpbb9",code:`@import url("https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap");:host {font-family:"Roboto", sans-serif;--hb-pad-joystick-size: 200px;--dpad-radius: 17%;--dpad-radius-in: 20%;--dpad-fg: #ddd;--dpad-fg-hover: #eee;--dpad-bg: #fff;--arrowcolor: #aaa;--tri-sml-a: calc(var(--hb-pad-joystick-size) / 9);--tri-sml-b: calc(var(--hb-pad-joystick-size) / 6);--tri-lrg-a: calc(var(--hb-pad-joystick-size) / 9);--tri-lrg-b: calc(var(--hb-pad-joystick-size) / 6);--dpad-arrow-shift: 5px;--dpad-arrow-move: 35%;}#joystick.svelte-1hlpbb9 {width:var(--hb-pad-joystick-size);height:var(--hb-pad-joystick-size);margin:auto;}.set.svelte-1hlpbb9 {overflow:hidden;}.set.svelte-1hlpbb9 .d-pad:where(.svelte-1hlpbb9) {display:inline-block;}.d-pad.svelte-1hlpbb9 {position:relative;width:var(--hb-pad-joystick-size);height:var(--hb-pad-joystick-size);border-radius:48%;overflow:hidden;}.d-pad.svelte-1hlpbb9:before {content:"";position:absolute;top:50%;left:50%;border-radius:5%;transform:translate(-50%, -50%);width:66.6%;height:66.6%;background:var(--dpad-fg);}.d-pad.svelte-1hlpbb9:after {content:"";position:absolute;display:none;z-index:2;width:20%;height:20%;top:50%;left:50%;background:var(--dpad-fg);border-radius:50%;transform:translate(-50%, -50%);transition:all 0.25s;cursor:pointer;}.d-pad.svelte-1hlpbb9:hover:after {width:30%;height:30%;}.d-pad.svelte-1hlpbb9 button:where(.svelte-1hlpbb9) {cursor:pointer;border:none;display:block;position:absolute;-webkit-tap-highlight-color:rgba(255, 255, 255, 0);width:33.3%;height:43%;line-height:40%;color:#fff;background:var(--dpad-fg);text-align:center;}.d-pad.svelte-1hlpbb9 button:where(.svelte-1hlpbb9):hover {background:var(--dpad-fg-hover);}.d-pad.svelte-1hlpbb9 button:where(.svelte-1hlpbb9):before {content:"";position:absolute;width:0;height:0;border-radius:5px;border-style:solid;transition:all 0.25s;}.d-pad.svelte-1hlpbb9 button:where(.svelte-1hlpbb9):after {content:"";position:absolute;width:102%;height:78%;background:var(--dpad-bg);border-radius:var(--dpad-radius-in);}.d-pad.svelte-1hlpbb9 button.left:where(.svelte-1hlpbb9),
1
+ (function(oe){"use strict";typeof window<"u"&&((window.__svelte??={}).v??=new Set).add("5");const wr=2,le="[",ue="[!",fe="]",ot={},E=Symbol(),ce=!1;var he=Array.isArray,yr=Array.prototype.indexOf,kr=Array.from,Ct=Object.keys,lt=Object.defineProperty,ut=Object.getOwnPropertyDescriptor,$r=Object.prototype,Er=Array.prototype,Sr=Object.getPrototypeOf,de=Object.isExtensible;function ve(t){for(var e=0;e<t.length;e++)t[e]()}function xr(){var t,e,r=new Promise((n,i)=>{t=n,e=i});return{promise:r,resolve:t,reject:e}}const P=2,It=4,Cr=8,ft=16,X=32,G=64,_e=128,M=256,Tt=512,S=1024,D=2048,H=4096,V=8192,ct=16384,Wt=32768,qt=65536,pe=1<<17,Tr=1<<18,yt=1<<19,Rr=1<<20,Gt=1<<21,be=1<<22,Rt=1<<23,Ht=Symbol("$state"),Pr=Symbol("legacy props"),me=new class extends Error{name="StaleReactionError";message="The reaction that called `getAbortSignal()` was re-run or destroyed"},Nr=3,Pt=8;function Lr(t){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function Mr(t){throw new Error("https://svelte.dev/e/effect_in_teardown")}function Dr(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function Or(t){throw new Error("https://svelte.dev/e/effect_orphan")}function jr(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function Yr(){throw new Error("https://svelte.dev/e/hydration_failed")}function Ar(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function Fr(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function Xr(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function Nt(t){console.warn("https://svelte.dev/e/hydration_mismatch")}let x=!1;function ht(t){x=t}let $;function Z(t){if(t===null)throw Nt(),ot;return $=t}function Vt(){return Z(rt($))}function ge(t){if(x){if(rt($)!==null)throw Nt(),ot;$=t}}function Ir(){for(var t=0,e=$;;){if(e.nodeType===Pt){var r=e.data;if(r===fe){if(t===0)return e;t-=1}else(r===le||r===ue)&&(t+=1)}var n=rt(e);e.remove(),e=n}}function Wr(t){if(!t||t.nodeType!==Pt)throw Nt(),ot;return t.data}function we(t){return t===this.v}function qr(t,e){return t!=t?e==e:t!==e||t!==null&&typeof t=="object"||typeof t=="function"}function Gr(t){return!qr(t,this.v)}let Hr=!1,j=null;function ye(t){j=t}function ke(t,e=!1,r){j={p:j,c:null,e:null,s:t,x:null,l:null}}function $e(t){var e=j,r=e.e;if(r!==null){e.e=null;for(var n of r)qe(n)}return t!==void 0&&(e.x=t),j=e.p,t??{}}function Ee(){return!0}const Vr=new WeakMap;function zr(t){var e=m;if(e===null)return b.f|=Rt,t;if((e.f&Wt)===0){if((e.f&_e)===0)throw!e.parent&&t instanceof Error&&xe(t),t;e.b.error(t)}else Se(t,e)}function Se(t,e){for(;e!==null;){if((e.f&_e)!==0)try{e.b.error(t);return}catch(r){t=r}e=e.parent}throw t instanceof Error&&xe(t),t}function xe(t){const e=Vr.get(t);e&&(lt(t,"message",{value:e.message}),lt(t,"stack",{value:e.stack}))}let zt=[],Ut=[];function Ur(){var t=zt;zt=[],ve(t)}function Br(){var t=Ut;Ut=[],ve(t)}function Jr(){zt.length>0&&Ur(),Ut.length>0&&Br()}function Kr(t){var e=P|D,r=b!==null&&(b.f&P)!==0?b:null;return m===null||r!==null&&(r.f&M)!==0?e|=M:m.f|=yt,{ctx:j,deps:null,effects:null,equals:we,f:e,fn:t,reactions:null,rv:0,v:E,wv:0,parent:r??m,ac:null}}function Ce(t){var e=t.effects;if(e!==null){t.effects=null;for(var r=0;r<e.length;r+=1)U(e[r])}}function Zr(t){for(var e=t.parent;e!==null;){if((e.f&P)===0)return e;e=e.parent}return null}function Bt(t){var e,r=m;pt(Zr(t));try{Ce(t),e=rr(t)}finally{pt(r)}return e}function Te(t){var e=Bt(t);if(t.equals(e)||(t.v=e,t.wv=tr()),!it){var r=(J||(t.f&M)!==0)&&t.deps!==null?H:S;L(t,r)}}const Jt=new Set;let R=null,Re=new Set,Lt=[];function Pe(){const t=Lt.shift();Lt.length>0&&queueMicrotask(Pe),t()}let Q=[],Mt=null,Kt=!1,Dt=!1;class tt{current=new Map;#e=new Map;#t=new Set;#r=0;#u=null;#f=!1;#i=[];#a=[];#s=[];#n=[];#o=[];#c=[];#h=[];skipped_effects=new Set;process(e){Q=[];for(const i of e)this.#v(i);if(this.#i.length===0&&this.#r===0){this.#d();var r=this.#s,n=this.#n;this.#s=[],this.#n=[],this.#o=[],R=null,Le(r),Le(n),R===null?R=this:Jt.delete(this),this.#u?.resolve()}else this.#l(this.#s),this.#l(this.#n),this.#l(this.#o);for(const i of this.#i)bt(i);for(const i of this.#a)bt(i);this.#i=[],this.#a=[]}#v(e){e.f^=S;for(var r=e.first;r!==null;){var n=r.f,i=(n&(X|G))!==0,s=i&&(n&S)!==0,a=s||(n&V)!==0||this.skipped_effects.has(r);if(!a&&r.fn!==null){if(i)r.f^=S;else if((n&It)!==0)this.#n.push(r);else if((n&S)===0)if((n&be)!==0){var o=r.b?.is_pending()?this.#a:this.#i;o.push(r)}else jt(r)&&((r.f&ft)!==0&&this.#o.push(r),bt(r));var l=r.first;if(l!==null){r=l;continue}}var u=r.parent;for(r=r.next;r===null&&u!==null;)r=u.next,u=u.parent}}#l(e){for(const r of e)((r.f&D)!==0?this.#c:this.#h).push(r),L(r,S);e.length=0}capture(e,r){this.#e.has(e)||this.#e.set(e,r),this.current.set(e,e.v)}activate(){R=this}deactivate(){R=null;for(const e of Re)if(Re.delete(e),e(),R!==null)break}neuter(){this.#f=!0}flush(){Q.length>0?Ne():this.#d(),R===this&&(this.#r===0&&Jt.delete(this),this.deactivate())}#d(){if(!this.#f)for(const e of this.#t)e();this.#t.clear()}increment(){this.#r+=1}decrement(){if(this.#r-=1,this.#r===0){for(const e of this.#c)L(e,D),dt(e);for(const e of this.#h)L(e,H),dt(e);this.#s=[],this.#n=[],this.flush()}else this.deactivate()}add_callback(e){this.#t.add(e)}settled(){return(this.#u??=xr()).promise}static ensure(){if(R===null){const e=R=new tt;Jt.add(R),Dt||tt.enqueue(()=>{R===e&&e.flush()})}return R}static enqueue(e){Lt.length===0&&queueMicrotask(Pe),Lt.unshift(e)}}function Ot(t){var e=Dt;Dt=!0;try{for(var r;;){if(Jr(),Q.length===0&&(R?.flush(),Q.length===0))return Mt=null,r;Ne()}}finally{Dt=e}}function Ne(){var t=_t;Kt=!0;try{var e=0;for(Je(!0);Q.length>0;){var r=tt.ensure();if(e++>1e3){var n,i;Qr()}r.process(Q),z.clear()}}finally{Kt=!1,Je(t),Mt=null}}function Qr(){try{jr()}catch(t){Se(t,Mt)}}let et=null;function Le(t){var e=t.length;if(e!==0){for(var r=0;r<e;){var n=t[r++];if((n.f&(ct|V))===0&&jt(n)&&(et=[],bt(n),n.deps===null&&n.first===null&&n.nodes_start===null&&(n.teardown===null&&n.ac===null?Ve(n):n.fn=null),et?.length>0)){z.clear();for(const i of et)bt(i);et=[]}}et=null}}function dt(t){for(var e=Mt=t;e.parent!==null;){e=e.parent;var r=e.f;if(Kt&&e===m&&(r&ft)!==0)return;if((r&(G|X))!==0){if((r&S)===0)return;e.f^=S}}Q.push(e)}const z=new Map;function Me(t,e){var r={f:0,v:t,reactions:null,equals:we,rv:0,wv:0};return r}function I(t,e){const r=Me(t);return pn(r),r}function tn(t,e=!1,r=!0){const n=Me(t);return e||(n.equals=Gr),n}function W(t,e,r=!1){b!==null&&(!F||(b.f&pe)!==0)&&Ee()&&(b.f&(P|ft|be|pe))!==0&&!q?.includes(t)&&Xr();let n=r?vt(e):e;return en(t,n)}function en(t,e){if(!t.equals(e)){var r=t.v;it?z.set(t,e):z.set(t,r),t.v=e;var n=tt.ensure();n.capture(t,r),(t.f&P)!==0&&((t.f&D)!==0&&Bt(t),L(t,(t.f&M)===0?S:H)),t.wv=tr(),De(t,D),m!==null&&(m.f&S)!==0&&(m.f&(X|G))===0&&(O===null?bn([t]):O.push(t))}return e}function Zt(t){W(t,t.v+1)}function De(t,e){var r=t.reactions;if(r!==null)for(var n=r.length,i=0;i<n;i++){var s=r[i],a=s.f,o=(a&D)===0;o&&L(s,e),(a&P)!==0?De(s,H):o&&((a&ft)!==0&&et!==null&&et.push(s),dt(s))}}function vt(t){if(typeof t!="object"||t===null||Ht in t)return t;const e=Sr(t);if(e!==$r&&e!==Er)return t;var r=new Map,n=he(t),i=I(0),s=st,a=o=>{if(st===s)return o();var l=b,u=st;B(null),Qe(s);var c=o();return B(l),Qe(u),c};return n&&r.set("length",I(t.length)),new Proxy(t,{defineProperty(o,l,u){(!("value"in u)||u.configurable===!1||u.enumerable===!1||u.writable===!1)&&Ar();var c=r.get(l);return c===void 0?c=a(()=>{var d=I(u.value);return r.set(l,d),d}):W(c,u.value,!0),!0},deleteProperty(o,l){var u=r.get(l);if(u===void 0){if(l in o){const c=a(()=>I(E));r.set(l,c),Zt(i)}}else W(u,E),Zt(i);return!0},get(o,l,u){if(l===Ht)return t;var c=r.get(l),d=l in o;if(c===void 0&&(!d||ut(o,l)?.writable)&&(c=a(()=>{var v=vt(d?o[l]:E),f=I(v);return f}),r.set(l,c)),c!==void 0){var h=K(c);return h===E?void 0:h}return Reflect.get(o,l,u)},getOwnPropertyDescriptor(o,l){var u=Reflect.getOwnPropertyDescriptor(o,l);if(u&&"value"in u){var c=r.get(l);c&&(u.value=K(c))}else if(u===void 0){var d=r.get(l),h=d?.v;if(d!==void 0&&h!==E)return{enumerable:!0,configurable:!0,value:h,writable:!0}}return u},has(o,l){if(l===Ht)return!0;var u=r.get(l),c=u!==void 0&&u.v!==E||Reflect.has(o,l);if(u!==void 0||m!==null&&(!c||ut(o,l)?.writable)){u===void 0&&(u=a(()=>{var h=c?vt(o[l]):E,v=I(h);return v}),r.set(l,u));var d=K(u);if(d===E)return!1}return c},set(o,l,u,c){var d=r.get(l),h=l in o;if(n&&l==="length")for(var v=u;v<d.v;v+=1){var f=r.get(v+"");f!==void 0?W(f,E):v in o&&(f=a(()=>I(E)),r.set(v+"",f))}if(d===void 0)(!h||ut(o,l)?.writable)&&(d=a(()=>I(void 0)),W(d,vt(u)),r.set(l,d));else{h=d.v!==E;var _=a(()=>vt(u));W(d,_)}var y=Reflect.getOwnPropertyDescriptor(o,l);if(y?.set&&y.set.call(c,u),!h){if(n&&typeof l=="string"){var k=r.get("length"),g=Number(l);Number.isInteger(g)&&g>=k.v&&W(k,g+1)}Zt(i)}return!0},ownKeys(o){K(i);var l=Reflect.ownKeys(o).filter(d=>{var h=r.get(d);return h===void 0||h.v!==E});for(var[u,c]of r)c.v!==E&&!(u in o)&&l.push(u);return l},setPrototypeOf(){Fr()}})}var Oe,je,Ye,Ae;function Qt(){if(Oe===void 0){Oe=window,je=/Firefox/.test(navigator.userAgent);var t=Element.prototype,e=Node.prototype,r=Text.prototype;Ye=ut(e,"firstChild").get,Ae=ut(e,"nextSibling").get,de(t)&&(t.__click=void 0,t.__className=void 0,t.__attributes=null,t.__style=void 0,t.__e=void 0),de(r)&&(r.__t=void 0)}}function kt(t=""){return document.createTextNode(t)}function $t(t){return Ye.call(t)}function rt(t){return Ae.call(t)}function Fe(t,e){if(!x)return $t(t);var r=$t($);return r===null&&(r=$.appendChild(kt())),Z(r),r}function Xe(t,e){if(!x){var r=$t(t);return r instanceof Comment&&r.data===""?rt(r):r}return $}function te(t,e=1,r=!1){let n=x?$:t;for(var i;e--;)i=n,n=rt(n);if(!x)return n;if(r&&n?.nodeType!==Nr){var s=kt();return n===null?i?.after(s):n.before(s),Z(s),s}return Z(n),n}function rn(t){t.textContent=""}function nn(){return!1}function Ie(t){var e=b,r=m;B(null),pt(null);try{return t()}finally{B(e),pt(r)}}function sn(t){m===null&&b===null&&Or(),b!==null&&(b.f&M)!==0&&m===null&&Dr(),it&&Mr()}function an(t,e){var r=e.last;r===null?e.last=e.first=t:(r.next=t,t.prev=r,e.last=t)}function nt(t,e,r,n=!0){var i=m;i!==null&&(i.f&V)!==0&&(t|=V);var s={ctx:j,deps:null,nodes_start:null,nodes_end:null,f:t|D,first:null,fn:e,last:null,next:null,parent:i,b:i&&i.b,prev:null,teardown:null,transitions:null,wv:0,ac:null};if(r)try{bt(s),s.f|=Wt}catch(l){throw U(s),l}else e!==null&&dt(s);if(n){var a=s;if(r&&a.deps===null&&a.teardown===null&&a.nodes_start===null&&a.first===a.last&&(a.f&yt)===0&&(a=a.first),a!==null&&(a.parent=i,i!==null&&an(a,i),b!==null&&(b.f&P)!==0&&(t&G)===0)){var o=b;(o.effects??=[]).push(a)}}return s}function We(t){sn();var e=m.f,r=!b&&(e&X)!==0&&(e&Wt)===0;if(r){var n=j;(n.e??=[]).push(t)}else return qe(t)}function qe(t){return nt(It|Rr,t,!1)}function on(t){tt.ensure();const e=nt(G|yt,t,!0);return()=>{U(e)}}function ln(t){tt.ensure();const e=nt(G|yt,t,!0);return(r={})=>new Promise(n=>{r.outro?ze(e,()=>{U(e),n(void 0)}):(U(e),n(void 0))})}function un(t){return nt(It,t,!1)}function fn(t,e=0){return nt(Cr|e,t,!0)}function cn(t,e=0){var r=nt(ft|e,t,!0);return r}function ee(t,e=!0){return nt(X|yt,t,!0,e)}function Ge(t){var e=t.teardown;if(e!==null){const r=it,n=b;Ke(!0),B(null);try{e.call(null)}finally{Ke(r),B(n)}}}function He(t,e=!1){var r=t.first;for(t.first=t.last=null;r!==null;){const i=r.ac;i!==null&&Ie(()=>{i.abort(me)});var n=r.next;(r.f&G)!==0?r.parent=null:U(r,e),r=n}}function hn(t){for(var e=t.first;e!==null;){var r=e.next;(e.f&X)===0&&U(e),e=r}}function U(t,e=!0){var r=!1;(e||(t.f&Tr)!==0)&&t.nodes_start!==null&&t.nodes_end!==null&&(dn(t.nodes_start,t.nodes_end),r=!0),He(t,e&&!r),Yt(t,0),L(t,ct);var n=t.transitions;if(n!==null)for(const s of n)s.stop();Ge(t);var i=t.parent;i!==null&&i.first!==null&&Ve(t),t.next=t.prev=t.teardown=t.ctx=t.deps=t.fn=t.nodes_start=t.nodes_end=t.ac=null}function dn(t,e){for(;t!==null;){var r=t===e?null:rt(t);t.remove(),t=r}}function Ve(t){var e=t.parent,r=t.prev,n=t.next;r!==null&&(r.next=n),n!==null&&(n.prev=r),e!==null&&(e.first===t&&(e.first=n),e.last===t&&(e.last=r))}function ze(t,e){var r=[];Ue(t,r,!0),vn(r,()=>{U(t),e&&e()})}function vn(t,e){var r=t.length;if(r>0){var n=()=>--r||e();for(var i of t)i.out(n)}else e()}function Ue(t,e,r){if((t.f&V)===0){if(t.f^=V,t.transitions!==null)for(const a of t.transitions)(a.is_global||r)&&e.push(a);for(var n=t.first;n!==null;){var i=n.next,s=(n.f&qt)!==0||(n.f&X)!==0;Ue(n,e,s?r:!1),n=i}}}function _n(t){Be(t,!0)}function Be(t,e){if((t.f&V)!==0){t.f^=V,(t.f&S)===0&&(L(t,D),dt(t));for(var r=t.first;r!==null;){var n=r.next,i=(r.f&qt)!==0||(r.f&X)!==0;Be(r,i?e:!1),r=n}if(t.transitions!==null)for(const s of t.transitions)(s.is_global||e)&&s.in()}}let _t=!1;function Je(t){_t=t}let it=!1;function Ke(t){it=t}let b=null,F=!1;function B(t){b=t}let m=null;function pt(t){m=t}let q=null;function pn(t){b!==null&&(q===null?q=[t]:q.push(t))}let C=null,N=0,O=null;function bn(t){O=t}let Ze=1,Et=0,st=Et;function Qe(t){st=t}let J=!1;function tr(){return++Ze}function jt(t){var e=t.f;if((e&D)!==0)return!0;if((e&H)!==0){var r=t.deps,n=(e&M)!==0;if(r!==null){var i,s,a=(e&Tt)!==0,o=n&&m!==null&&!J,l=r.length;if((a||o)&&(m===null||(m.f&ct)===0)){var u=t,c=u.parent;for(i=0;i<l;i++)s=r[i],(a||!s?.reactions?.includes(u))&&(s.reactions??=[]).push(u);a&&(u.f^=Tt),o&&c!==null&&(c.f&M)===0&&(u.f^=M)}for(i=0;i<l;i++)if(s=r[i],jt(s)&&Te(s),s.wv>t.wv)return!0}(!n||m!==null&&!J)&&L(t,S)}return!1}function er(t,e,r=!0){var n=t.reactions;if(n!==null&&!q?.includes(t))for(var i=0;i<n.length;i++){var s=n[i];(s.f&P)!==0?er(s,e,!1):e===s&&(r?L(s,D):(s.f&S)!==0&&L(s,H),dt(s))}}function rr(t){var e=C,r=N,n=O,i=b,s=J,a=q,o=j,l=F,u=st,c=t.f;C=null,N=0,O=null,J=(c&M)!==0&&(F||!_t||b===null),b=(c&(X|G))===0?t:null,q=null,ye(t.ctx),F=!1,st=++Et,t.ac!==null&&(Ie(()=>{t.ac.abort(me)}),t.ac=null);try{t.f|=Gt;var d=t.fn,h=d(),v=t.deps;if(C!==null){var f;if(Yt(t,N),v!==null&&N>0)for(v.length=N+C.length,f=0;f<C.length;f++)v[N+f]=C[f];else t.deps=v=C;if(!J||(c&P)!==0&&t.reactions!==null)for(f=N;f<v.length;f++)(v[f].reactions??=[]).push(t)}else v!==null&&N<v.length&&(Yt(t,N),v.length=N);if(Ee()&&O!==null&&!F&&v!==null&&(t.f&(P|H|D))===0)for(f=0;f<O.length;f++)er(O[f],t);return i!==null&&i!==t&&(Et++,O!==null&&(n===null?n=O:n.push(...O))),(t.f&Rt)!==0&&(t.f^=Rt),h}catch(_){return zr(_)}finally{t.f^=Gt,C=e,N=r,O=n,b=i,J=s,q=a,ye(o),F=l,st=u}}function mn(t,e){let r=e.reactions;if(r!==null){var n=yr.call(r,t);if(n!==-1){var i=r.length-1;i===0?r=e.reactions=null:(r[n]=r[i],r.pop())}}r===null&&(e.f&P)!==0&&(C===null||!C.includes(e))&&(L(e,H),(e.f&(M|Tt))===0&&(e.f^=Tt),Ce(e),Yt(e,0))}function Yt(t,e){var r=t.deps;if(r!==null)for(var n=e;n<r.length;n++)mn(t,r[n])}function bt(t){var e=t.f;if((e&ct)===0){L(t,S);var r=m,n=_t;m=t,_t=!0;try{(e&ft)!==0?hn(t):He(t),Ge(t);var i=rr(t);t.teardown=typeof i=="function"?i:null,t.wv=Ze;var s;ce&&Hr&&(t.f&D)!==0&&t.deps}finally{_t=n,m=r}}}function K(t){var e=t.f,r=(e&P)!==0;if(b!==null&&!F){var n=m!==null&&(m.f&ct)!==0;if(!n&&!q?.includes(t)){var i=b.deps;if((b.f&Gt)!==0)t.rv<Et&&(t.rv=Et,C===null&&i!==null&&i[N]===t?N++:C===null?C=[t]:(!J||!C.includes(t))&&C.push(t));else{(b.deps??=[]).push(t);var s=t.reactions;s===null?t.reactions=[b]:s.includes(b)||s.push(b)}}}else if(r&&t.deps===null&&t.effects===null){var a=t,o=a.parent;o!==null&&(o.f&M)===0&&(a.f^=M)}if(it){if(z.has(t))return z.get(t);if(r){a=t;var l=a.v;return((a.f&S)===0&&a.reactions!==null||nr(a))&&(l=Bt(a)),z.set(a,l),l}}else r&&(a=t,jt(a)&&Te(a));if((t.f&Rt)!==0)throw t.v;return t.v}function nr(t){if(t.v===E)return!0;if(t.deps===null)return!1;for(const e of t.deps)if(z.has(e)||(e.f&P)!==0&&nr(e))return!0;return!1}function gn(t){var e=F;try{return F=!0,t()}finally{F=e}}const wn=-7169;function L(t,e){t.f=t.f&wn|e}const ir=new Set,re=new Set;function yn(t){for(var e=0;e<t.length;e++)ir.add(t[e]);for(var r of re)r(t)}let sr=null;function At(t){var e=this,r=e.ownerDocument,n=t.type,i=t.composedPath?.()||[],s=i[0]||t.target;sr=t;var a=0,o=sr===t&&t.__root;if(o){var l=i.indexOf(o);if(l!==-1&&(e===document||e===window)){t.__root=e;return}var u=i.indexOf(e);if(u===-1)return;l<=u&&(a=l)}if(s=i[a]||t.target,s!==e){lt(t,"currentTarget",{configurable:!0,get(){return s||r}});var c=b,d=m;B(null),pt(null);try{for(var h,v=[];s!==null;){var f=s.assignedSlot||s.parentNode||s.host||null;try{var _=s["__"+n];if(_!=null&&(!s.disabled||t.target===s))if(he(_)){var[y,...k]=_;y.apply(s,[t,...k])}else _.call(s,t)}catch(g){h?v.push(g):h=g}if(t.cancelBubble||f===e||f===null)break;s=f}if(h){for(let g of v)queueMicrotask(()=>{throw g});throw h}}finally{t.__root=e,delete t.currentTarget,B(c),pt(d)}}}function kn(t){var e=document.createElement("template");return e.innerHTML=t.replaceAll("<!>","<!---->"),e.content}function St(t,e){var r=m;r.nodes_start===null&&(r.nodes_start=t,r.nodes_end=e)}function ne(t,e){var r=(e&wr)!==0,n,i=!t.startsWith("<!>");return()=>{if(x)return St($,null),$;n===void 0&&(n=kn(i?t:"<!>"+t),n=$t(n));var s=r||je?document.importNode(n,!0):n.cloneNode(!0);return St(s,s),s}}function ar(){if(x)return St($,null),$;var t=document.createDocumentFragment(),e=document.createComment(""),r=kt();return t.append(e,r),St(e,r),t}function mt(t,e){if(x){m.nodes_end=$,Vt();return}t!==null&&t.before(e)}const $n=["touchstart","touchmove"];function En(t){return $n.includes(t)}function or(t,e){return lr(t,e)}function Sn(t,e){Qt(),e.intro=e.intro??!1;const r=e.target,n=x,i=$;try{for(var s=$t(r);s&&(s.nodeType!==Pt||s.data!==le);)s=rt(s);if(!s)throw ot;ht(!0),Z(s),Vt();const a=lr(t,{...e,anchor:s});if($===null||$.nodeType!==Pt||$.data!==fe)throw Nt(),ot;return ht(!1),a}catch(a){if(a instanceof Error&&a.message.split(`
2
+ `).some(o=>o.startsWith("https://svelte.dev/e/")))throw a;return a!==ot&&console.warn("Failed to hydrate: ",a),e.recover===!1&&Yr(),Qt(),rn(r),ht(!1),or(t,e)}finally{ht(n),Z(i)}}const gt=new Map;function lr(t,{target:e,anchor:r,props:n={},events:i,context:s,intro:a=!0}){Qt();var o=new Set,l=d=>{for(var h=0;h<d.length;h++){var v=d[h];if(!o.has(v)){o.add(v);var f=En(v);e.addEventListener(v,At,{passive:f});var _=gt.get(v);_===void 0?(document.addEventListener(v,At,{passive:f}),gt.set(v,1)):gt.set(v,_+1)}}};l(kr(ir)),re.add(l);var u=void 0,c=ln(()=>{var d=r??e.appendChild(kt());return ee(()=>{if(s){ke({});var h=j;h.c=s}i&&(n.$$events=i),x&&St(d,null),u=t(d,n)||{},x&&(m.nodes_end=$),s&&$e()}),()=>{for(var h of o){e.removeEventListener(h,At);var v=gt.get(h);--v===0?(document.removeEventListener(h,At),gt.delete(h)):gt.set(h,v)}re.delete(l),d!==r&&d.parentNode?.removeChild(d)}});return ie.set(u,c),u}let ie=new WeakMap;function xn(t,e){const r=ie.get(t);return r?(ie.delete(t),r(e)):Promise.resolve()}function Cn(t){j===null&&Lr(),We(()=>{const e=gn(t);if(typeof e=="function")return e})}function ur(t,e,r=!1){x&&Vt();var n=t,i=null,s=null,a=E,o=r?qt:0,l=!1;const u=(v,f=!0)=>{l=!0,h(f,v)};var c=null;function d(){c!==null&&(c.lastChild.remove(),n.before(c),c=null);var v=a?i:s,f=a?s:i;v&&_n(v),f&&ze(f,()=>{a?s=null:i=null})}const h=(v,f)=>{if(a===(a=v))return;let _=!1;if(x){const Xt=Wr(n)===ue;!!a===Xt&&(n=Ir(),Z(n),ht(!1),_=!0)}var y=nn(),k=n;if(y&&(c=document.createDocumentFragment(),c.append(k=kt())),a?i??=f&&ee(()=>f(k)):s??=f&&ee(()=>f(k)),y){var g=R,T=a?i:s,Y=a?s:i;T&&g.skipped_effects.delete(T),Y&&g.skipped_effects.add(Y),g.add_callback(d)}else d();_&&ht(!0)};cn(()=>{l=!1,e(u),l||h(null,null)},o),x&&(n=$)}function Tn(t,e){un(()=>{var r=t.getRootNode(),n=r.host?r:r.head??r.ownerDocument.head;if(!n.querySelector("#"+e.hash)){const i=document.createElement("style");i.id=e.hash,i.textContent=e.code,n.appendChild(i)}})}function se(t,e,r,n){var i=n,s=!0,a=()=>(s&&(s=!1,i=n),i),o;o=t[e],o===void 0&&n!==void 0&&(o=a());var l;l=()=>{var h=t[e];return h===void 0?a():(s=!0,h)};var u=!1,c=Kr(()=>(u=!1,l())),d=m;return(function(h,v){if(arguments.length>0){const f=v?K(c):h;return W(c,f),u=!0,i!==void 0&&(i=f),h}return it&&u||(d.f&ct)!==0?c.v:K(c)})}function Rn(t){return new Pn(t)}class Pn{#e;#t;constructor(e){var r=new Map,n=(s,a)=>{var o=tn(a,!1,!1);return r.set(s,o),o};const i=new Proxy({...e.props||{},$$events:{}},{get(s,a){return K(r.get(a)??n(a,Reflect.get(s,a)))},has(s,a){return a===Pr?!0:(K(r.get(a)??n(a,Reflect.get(s,a))),Reflect.has(s,a))},set(s,a,o){return W(r.get(a)??n(a,o),o),Reflect.set(s,a,o)}});this.#t=(e.hydrate?Sn:or)(e.component,{target:e.target,anchor:e.anchor,props:i,context:e.context,intro:e.intro??!1,recover:e.recover}),(!e?.props?.$$host||e.sync===!1)&&Ot(),this.#e=i.$$events;for(const s of Object.keys(this.#t))s==="$set"||s==="$destroy"||s==="$on"||lt(this,s,{get(){return this.#t[s]},set(a){this.#t[s]=a},enumerable:!0});this.#t.$set=s=>{Object.assign(i,s)},this.#t.$destroy=()=>{xn(this.#t)}}$set(e){this.#t.$set(e)}$on(e,r){this.#e[e]=this.#e[e]||[];const n=(...i)=>r.call(this,...i);return this.#e[e].push(n),()=>{this.#e[e]=this.#e[e].filter(i=>i!==n)}}$destroy(){this.#t.$destroy()}}let fr;typeof HTMLElement=="function"&&(fr=class extends HTMLElement{$$ctor;$$s;$$c;$$cn=!1;$$d={};$$r=!1;$$p_d={};$$l={};$$l_u=new Map;$$me;constructor(t,e,r){super(),this.$$ctor=t,this.$$s=e,r&&this.attachShadow({mode:"open"})}addEventListener(t,e,r){if(this.$$l[t]=this.$$l[t]||[],this.$$l[t].push(e),this.$$c){const n=this.$$c.$on(t,e);this.$$l_u.set(e,n)}super.addEventListener(t,e,r)}removeEventListener(t,e,r){if(super.removeEventListener(t,e,r),this.$$c){const n=this.$$l_u.get(e);n&&(n(),this.$$l_u.delete(e))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){let t=function(n){return i=>{const s=document.createElement("slot");n!=="default"&&(s.name=n),mt(i,s)}};if(await Promise.resolve(),!this.$$cn||this.$$c)return;const e={},r=Nn(this);for(const n of this.$$s)n in r&&(n==="default"&&!this.$$d.children?(this.$$d.children=t(n),e.default=!0):e[n]=t(n));for(const n of this.attributes){const i=this.$$g_p(n.name);i in this.$$d||(this.$$d[i]=Ft(i,n.value,this.$$p_d,"toProp"))}for(const n in this.$$p_d)!(n in this.$$d)&&this[n]!==void 0&&(this.$$d[n]=this[n],delete this[n]);this.$$c=Rn({component:this.$$ctor,target:this.shadowRoot||this,props:{...this.$$d,$$slots:e,$$host:this}}),this.$$me=on(()=>{fn(()=>{this.$$r=!0;for(const n of Ct(this.$$c)){if(!this.$$p_d[n]?.reflect)continue;this.$$d[n]=this.$$c[n];const i=Ft(n,this.$$d[n],this.$$p_d,"toAttribute");i==null?this.removeAttribute(this.$$p_d[n].attribute||n):this.setAttribute(this.$$p_d[n].attribute||n,i)}this.$$r=!1})});for(const n in this.$$l)for(const i of this.$$l[n]){const s=this.$$c.$on(n,i);this.$$l_u.set(i,s)}this.$$l={}}}attributeChangedCallback(t,e,r){this.$$r||(t=this.$$g_p(t),this.$$d[t]=Ft(t,r,this.$$p_d,"toProp"),this.$$c?.$set({[t]:this.$$d[t]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then(()=>{!this.$$cn&&this.$$c&&(this.$$c.$destroy(),this.$$me(),this.$$c=void 0)})}$$g_p(t){return Ct(this.$$p_d).find(e=>this.$$p_d[e].attribute===t||!this.$$p_d[e].attribute&&e.toLowerCase()===t)||t}});function Ft(t,e,r,n){const i=r[t]?.type;if(e=i==="Boolean"&&typeof e!="boolean"?e!=null:e,!n||!r[t])return e;if(n==="toAttribute")switch(i){case"Object":case"Array":return e==null?null:JSON.stringify(e);case"Boolean":return e?"":null;case"Number":return e??null;default:return e}else switch(i){case"Object":case"Array":return e&&JSON.parse(e);case"Boolean":return e;case"Number":return e!=null?+e:e;default:return e}}function Nn(t){const e={};return t.childNodes.forEach(r=>{e[r.slot||"default"]=!0}),e}function Ln(t,e,r,n,i,s){let a=class extends fr{constructor(){super(t,r,i),this.$$p_d=e}static get observedAttributes(){return Ct(e).map(o=>(e[o].attribute||o).toLowerCase())}};return Ct(e).forEach(o=>{lt(a.prototype,o,{get(){return this.$$c&&o in this.$$c?this.$$c[o]:this.$$d[o]},set(l){l=Ft(o,l,e),this.$$d[o]=l;var u=this.$$c;if(u){var c=ut(u,o)?.get;c?u[o]=l:u.$set({[o]:l})}}})}),n.forEach(o=>{lt(a.prototype,o,{get(){return this.$$c?.[o]}})}),t.element=a,a}function Mn(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var wt={},ae,cr;function Dn(){if(cr)return ae;cr=1;var t=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,e=/\n/g,r=/^\s*/,n=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,a=/^[;\s]*/,o=/^\s+|\s+$/g,l=`
3
+ `,u="/",c="*",d="",h="comment",v="declaration";ae=function(_,y){if(typeof _!="string")throw new TypeError("First argument must be a string");if(!_)return[];y=y||{};var k=1,g=1;function T(w){var p=w.match(e);p&&(k+=p.length);var A=w.lastIndexOf(l);g=~A?w.length-A:g+w.length}function Y(){var w={line:k,column:g};return function(p){return p.position=new Xt(w),br(),p}}function Xt(w){this.start=w,this.end={line:k,column:g},this.source=y.source}Xt.prototype.content=_;function pr(w){var p=new Error(y.source+":"+k+":"+g+": "+w);if(p.reason=w,p.filename=y.source,p.line=k,p.column=g,p.source=_,!y.silent)throw p}function xt(w){var p=w.exec(_);if(p){var A=p[0];return T(A),_=_.slice(A.length),p}}function br(){xt(r)}function mr(w){var p;for(w=w||[];p=gr();)p!==!1&&w.push(p);return w}function gr(){var w=Y();if(!(u!=_.charAt(0)||c!=_.charAt(1))){for(var p=2;d!=_.charAt(p)&&(c!=_.charAt(p)||u!=_.charAt(p+1));)++p;if(p+=2,d===_.charAt(p-1))return pr("End of comment missing");var A=_.slice(2,p-2);return g+=2,T(A),_=_.slice(p),g+=2,w({type:h,comment:A})}}function zn(){var w=Y(),p=xt(n);if(p){if(gr(),!xt(i))return pr("property missing ':'");var A=xt(s),Bn=w({type:v,property:f(p[0].replace(t,d)),value:A?f(A[0].replace(t,d)):d});return xt(a),Bn}}function Un(){var w=[];mr(w);for(var p;p=zn();)p!==!1&&(w.push(p),mr(w));return w}return br(),Un()};function f(_){return _?_.replace(o,d):d}return ae}var hr;function On(){if(hr)return wt;hr=1;var t=wt&&wt.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(wt,"__esModule",{value:!0}),wt.default=r;var e=t(Dn());function r(n,i){var s=null;if(!n||typeof n!="string")return s;var a=(0,e.default)(n),o=typeof i=="function";return a.forEach(function(l){if(l.type==="declaration"){var u=l.property,c=l.value;o?i(u,c,l):c&&(s=s||{},s[u]=c)}}),s}return wt}var jn=On();const dr=Mn(jn);dr.default;class Yn{constructor(e,r){this.StickStatus={xPosition:0,yPosition:0,x:0,y:0,cardinalDirection:"C"},this.parameters=r?.parameters||{};const n={title:"joystick",width:0,height:0,internalFillColor:"#00AA00",internalLineWidth:2,internalStrokeColor:"#003300",externalLineWidth:2,externalStrokeColor:"#008000",autoReturnToCenter:!0,callback:function(s){}};this.callback=r?.callback||n.callback,this.title=r?.parameters?.title||n.title,this.width=r?.parameters?.width||n.width,this.height=r?.parameters?.height||n.height,this.internalFillColor=r?.parameters?.internalFillColor||n.internalFillColor,this.internalLineWidth=r?.parameters?.internalLineWidth||n.internalLineWidth,this.internalStrokeColor=r?.parameters?.internalStrokeColor||n.internalStrokeColor,this.externalLineWidth=r?.parameters?.externalLineWidth||n.externalLineWidth,this.externalStrokeColor=r?.parameters?.externalStrokeColor||n.externalStrokeColor,this.autoReturnToCenter=r?.parameters?.autoReturnToCenter||n.autoReturnToCenter,console.log("stttt",e.style),e.style.touchAction="none",this.canvas=document.createElement("canvas"),this.canvas.id=this.title,this.width===0&&(this.width=e.clientWidth),this.height===0&&(this.height=e.clientHeight),this.canvas.width=this.width,this.canvas.height=this.height,e.appendChild(this.canvas);const i=this.canvas.getContext("2d");console.log("canvas",i),this.context=i,this.pressed=!1,this.circumference=2*Math.PI,this.internalRadius=(this.canvas.width-(this.canvas.width/2+10))/2,this.maxMoveStick=this.internalRadius*1.1,this.externalRadius=this.internalRadius*1.6,this.centerX=this.canvas.width/2,this.centerY=this.canvas.height/2,this.directionHorizontalLimitPos=this.canvas.width/10,this.directionHorizontalLimitNeg=this.directionHorizontalLimitPos*-1,this.directionVerticalLimitPos=this.canvas.height/10,this.directionVerticalLimitNeg=this.directionVerticalLimitPos*-1,this.movedX=this.centerX,this.movedY=this.centerY,"ontouchstart"in document.documentElement?(this.canvas.addEventListener("touchstart",s=>this._onTouchStart(s),!1),document.addEventListener("touchmove",s=>this._onTouchMove(s),!1),document.addEventListener("touchend",s=>this._onTouchEnd(s),!1)):(this.canvas.addEventListener("mousedown",s=>this._onMouseDown(s),!1),document.addEventListener("mousemove",s=>this._onMouseMove(s),!1),document.addEventListener("mouseup",s=>this._onMouseUp(s),!1)),this._drawExternal(),this._drawInternal()}_drawExternal(){this.context.beginPath(),this.context.arc(this.centerX,this.centerY,this.externalRadius,0,this.circumference,!1),this.context.lineWidth=this.externalLineWidth,this.context.strokeStyle=this.externalStrokeColor,this.context.stroke()}_drawInternal(){this.context.beginPath(),this.movedX<this.internalRadius&&(this.movedX=this.maxMoveStick),this.movedX+this.internalRadius>this.canvas.width&&(this.movedX=this.canvas.width-this.maxMoveStick),this.movedY<this.internalRadius&&(this.movedY=this.maxMoveStick),this.movedY+this.internalRadius>this.canvas.height&&(this.movedY=this.canvas.height-this.maxMoveStick),this.context.arc(this.movedX,this.movedY,this.internalRadius,0,this.circumference,!1);const e=this.context.createRadialGradient(this.centerX,this.centerY,5,this.centerX,this.centerY,200);e.addColorStop(0,this.internalFillColor),e.addColorStop(1,this.internalStrokeColor),this.context.fillStyle=e,this.context.fill(),this.context.lineWidth=this.internalLineWidth,this.context.strokeStyle=this.internalStrokeColor,this.context.stroke()}_onTouchStart(e){this.pressed=!0}_onTouchMove(e){this.pressed&&e.targetTouches[0].target===this.canvas&&(this.movedX=e.targetTouches[0].pageX,this.movedY=e.targetTouches[0].pageY,this.canvas.offsetParent.tagName.toUpperCase()==="BODY"?(this.movedX-=this.canvas.offsetLeft,this.movedY-=this.canvas.offsetTop):(this.movedX-=this.canvas.offsetParent.offsetLeft,this.movedY-=this.canvas.offsetParent.offsetTop),this.context.clearRect(0,0,this.canvas.width,this.canvas.height),this._drawExternal(),this._drawInternal(),this.StickStatus.xPosition=this.movedX,this.StickStatus.yPosition=this.movedY,this.StickStatus.x=Number((100*((this.movedX-this.centerX)/this.maxMoveStick)).toFixed()),this.StickStatus.y=Number((100*((this.movedY-this.centerY)/this.maxMoveStick)*-1).toFixed()),this.StickStatus.cardinalDirection=this._getCardinalDirection(),this.callback(this.StickStatus))}_onTouchEnd(e){this.pressed=!1,this.autoReturnToCenter&&(this.movedX=this.centerX,this.movedY=this.centerY),this.context.clearRect(0,0,this.canvas.width,this.canvas.height),this._drawExternal(),this._drawInternal(),this.StickStatus.xPosition=this.movedX,this.StickStatus.yPosition=this.movedY,this.StickStatus.x=Number((100*((this.movedX-this.centerX)/this.maxMoveStick)).toFixed()),this.StickStatus.y=Number((100*((this.movedY-this.centerY)/this.maxMoveStick)*-1).toFixed()),this.StickStatus.cardinalDirection=this._getCardinalDirection(),this.callback(this.StickStatus)}_onMouseDown(e){this.pressed=!0}_onMouseMove(e){this.pressed&&(this.movedX=e.pageX,this.movedY=e.pageY,this.canvas.offsetParent.tagName.toUpperCase()==="BODY"?(this.movedX-=this.canvas.offsetLeft,this.movedY-=this.canvas.offsetTop):(this.movedX-=this.canvas.offsetParent.offsetLeft,this.movedY-=this.canvas.offsetParent.offsetTop),this.context.clearRect(0,0,this.canvas.width,this.canvas.height),this._drawExternal(),this._drawInternal(),this.StickStatus.xPosition=this.movedX,this.StickStatus.yPosition=this.movedY,this.StickStatus.x=Number((100*((this.movedX-this.centerX)/this.maxMoveStick)).toFixed()),this.StickStatus.y=Number((100*((this.movedY-this.centerY)/this.maxMoveStick)*-1).toFixed()),this.StickStatus.cardinalDirection=this._getCardinalDirection(),this.callback(this.StickStatus))}_onMouseUp(e){this.pressed=!1,this.autoReturnToCenter&&(this.movedX=this.centerX,this.movedY=this.centerY),this.context.clearRect(0,0,this.canvas.width,this.canvas.height),this._drawExternal(),this._drawInternal(),this.StickStatus.xPosition=this.movedX,this.StickStatus.yPosition=this.movedY,this.StickStatus.x=Number((100*((this.movedX-this.centerX)/this.maxMoveStick)).toFixed()),this.StickStatus.y=Number((100*((this.movedY-this.centerY)/this.maxMoveStick)*-1).toFixed()),this.StickStatus.cardinalDirection=this._getCardinalDirection(),this.callback(this.StickStatus)}_getCardinalDirection(){let e="",r=this.movedX-this.centerX,n=this.movedY-this.centerY;return n>=this.directionVerticalLimitNeg&&n<=this.directionVerticalLimitPos&&(e="C"),n<this.directionVerticalLimitNeg&&(e="N"),n>this.directionVerticalLimitPos&&(e="S"),r<this.directionHorizontalLimitNeg&&(e==="C"?e="W":e+="W"),r>this.directionHorizontalLimitPos&&(e==="C"?e="E":e+="E"),e}GetWidth(){return this.canvas.width}GetHeight(){return this.canvas.height}GetPosX(){return this.movedX}GetPosY(){return this.movedY}GetX(){return(100*((this.movedX-this.centerX)/this.maxMoveStick)).toFixed()}GetY(){return(100*((this.movedY-this.centerY)/this.maxMoveStick)*-1).toFixed()}GetDir(){return this._getCardinalDirection()}}var at={},vr;function An(){if(vr)return at;vr=1,Object.defineProperty(at,"__esModule",{value:!0}),at.LanguageTranslator=void 0,at.getChildStyleToPass=t,at.addComponent=e;function t(n,i){var s,a,o="";try{if(n&&i?.length&&(!((s=Object.keys(n))===null||s===void 0)&&s.length)&&(!((a=i?.filter(function(h){return Object.keys(n).includes(h.name)}))===null||a===void 0)&&a.length))for(var l=function(h){var v=i?.filter(function(f){return f.name===h&&f.defaultValue!==n[h]});v&&(o+="".concat(h,":").concat(n[h],";"))},u=0,c=Object.keys(n);u<c.length;u++){var d=c[u];l(d)}}catch(h){console.error("error getting child style to pass",h)}finally{return o}}function e(n){var i,s=((i=n?.repoName.split("/"))===null||i===void 0?void 0:i[1])||n?.repoName;if(!s)throw new Error("wrong componentPath "+n?.repoName);if(!n?.version)throw new Error("wrong version "+n?.version);var a=n?.iifePath||"main.iife.js";if(!document.getElementById(s+"-script"))try{var o=document.createElement("script");if(o.id=s+"-script",o.src="https://cdn.jsdelivr.net/npm/".concat(n.repoName,"@").concat(n.version,"/").concat(a),n?.local)o.src="".concat(n.local);else if(location.href.includes("localhost:6006")){var l=s.split("-")[0];o.src="http://localhost:6006/webcomponents/".concat(s.replace(l+"-",""),"/").concat(a)}document.head.appendChild(o)}catch(u){console.warn(u)}}var r=(function(){function n(i){if(this.lang="",!i?.dictionary)throw new Error("no dictionary provided");this.dictionary=i.dictionary,this.setLang(i?.lang)}return n.prototype.setLang=function(i){i||(i=n.getDefaultLang()),this.lang=i},n.prototype.translateWord=function(i,s){return n.getDictionaryWord(i,this.dictionary,s||this.lang)},n.prototype.translateDate=function(i,s,a){return n.formatDate(i,s,a||this.lang)},n.getDefaultLang=function(){var i,s,a,o,l,u="en";return navigator?.languages&&(!((a=(s=(i=navigator.languages[0])===null||i===void 0?void 0:i.split("-")[0])===null||s===void 0?void 0:s.toLowerCase())===null||a===void 0)&&a.length)&&(u=(l=(o=navigator.languages[0])===null||o===void 0?void 0:o.split("-")[0])===null||l===void 0?void 0:l.toLowerCase()),u},n.getDictionaryWord=function(i,s,a){var o;if(!i)throw new Error("no wordKey provided");if(!s)throw new Error("no dictionary provided");if(a&&(!((o=s[a])===null||o===void 0)&&o[i]))return s[a][i];var l="",u=n.getDefaultLang();if(!a||u!==a){var c=s?.[u];c?.[i]&&(l=c[i])}return l},n.formatDate=function(i,s,a){if(!i)throw new Error("no date provided");if(typeof i.getMonth!="function")throw new Error("wrong date format");var o=new Intl.DateTimeFormat(a||n.getDefaultLang(),s);return o.format(i)},n})();return at.LanguageTranslator=r,at}An();var Fn=(t,e)=>e("up"),Xn=(t,e)=>e("right"),In=(t,e)=>e("down"),Wn=(t,e)=>e("left"),qn=ne('<div class="set svelte-1hlpbb9"><nav class="d-pad svelte-1hlpbb9"><button class="up svelte-1hlpbb9" aria-label="Move up"></button> <button class="right svelte-1hlpbb9" aria-label="Move right"></button> <button class="down svelte-1hlpbb9" aria-label="Move down"></button> <button class="left svelte-1hlpbb9" aria-label="Move left"></button></nav></div>'),Gn=ne('<div id="joystick" class="svelte-1hlpbb9"></div>'),Hn=ne("<div>Unknown type</div>");const Vn={hash:"svelte-1hlpbb9",code:`@import url("https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap");:host {font-family:"Roboto", sans-serif;--hb-pad-joystick-size: 200px;--dpad-radius: 17%;--dpad-radius-in: 20%;--dpad-fg: #ddd;--dpad-fg-hover: #eee;--dpad-bg: #fff;--arrowcolor: #aaa;--tri-sml-a: calc(var(--hb-pad-joystick-size) / 9);--tri-sml-b: calc(var(--hb-pad-joystick-size) / 6);--tri-lrg-a: calc(var(--hb-pad-joystick-size) / 9);--tri-lrg-b: calc(var(--hb-pad-joystick-size) / 6);--dpad-arrow-shift: 5px;--dpad-arrow-move: 35%;}#joystick.svelte-1hlpbb9 {width:var(--hb-pad-joystick-size);height:var(--hb-pad-joystick-size);margin:auto;}.set.svelte-1hlpbb9 {overflow:hidden;}.set.svelte-1hlpbb9 .d-pad:where(.svelte-1hlpbb9) {display:inline-block;}.d-pad.svelte-1hlpbb9 {position:relative;width:var(--hb-pad-joystick-size);height:var(--hb-pad-joystick-size);border-radius:48%;overflow:hidden;}.d-pad.svelte-1hlpbb9:before {content:"";position:absolute;top:50%;left:50%;border-radius:5%;transform:translate(-50%, -50%);width:66.6%;height:66.6%;background:var(--dpad-fg);}.d-pad.svelte-1hlpbb9:after {content:"";position:absolute;display:none;z-index:2;width:20%;height:20%;top:50%;left:50%;background:var(--dpad-fg);border-radius:50%;transform:translate(-50%, -50%);transition:all 0.25s;cursor:pointer;}.d-pad.svelte-1hlpbb9:hover:after {width:30%;height:30%;}.d-pad.svelte-1hlpbb9 button:where(.svelte-1hlpbb9) {cursor:pointer;border:none;display:block;position:absolute;-webkit-tap-highlight-color:rgba(255, 255, 255, 0);width:33.3%;height:43%;line-height:40%;color:#fff;background:var(--dpad-fg);text-align:center;}.d-pad.svelte-1hlpbb9 button:where(.svelte-1hlpbb9):hover {background:var(--dpad-fg-hover);}.d-pad.svelte-1hlpbb9 button:where(.svelte-1hlpbb9):before {content:"";position:absolute;width:0;height:0;border-radius:5px;border-style:solid;transition:all 0.25s;}.d-pad.svelte-1hlpbb9 button:where(.svelte-1hlpbb9):after {content:"";position:absolute;width:102%;height:78%;background:var(--dpad-bg);border-radius:var(--dpad-radius-in);}.d-pad.svelte-1hlpbb9 button.left:where(.svelte-1hlpbb9),
4
4
  .d-pad.svelte-1hlpbb9 button.right:where(.svelte-1hlpbb9) {width:43%;height:33%;}.d-pad.svelte-1hlpbb9 button.left:where(.svelte-1hlpbb9):after,
5
- .d-pad.svelte-1hlpbb9 button.right:where(.svelte-1hlpbb9):after {width:78%;height:102%;}.d-pad.svelte-1hlpbb9 button.up:where(.svelte-1hlpbb9) {top:0;left:50%;transform:translate(-50%, 0);border-radius:var(--dpad-radius) var(--dpad-radius) 50% 50%;}.d-pad.svelte-1hlpbb9 button.up:where(.svelte-1hlpbb9):hover {background:linear-gradient(0deg, var(--dpad-fg) 0%, var(--dpad-fg-hover) 50%);}.d-pad.svelte-1hlpbb9 button.up:where(.svelte-1hlpbb9):after {left:0;top:0;transform:translate(-100%, 0);border-top-left-radius:50%;pointer-events:none;}.d-pad.svelte-1hlpbb9 button.up:where(.svelte-1hlpbb9):before {top:40%;left:50%;transform:translate(-50%, -50%);border-width:0 var(--tri-sml-a) var(--tri-sml-b) var(--tri-sml-a);border-color:transparent transparent var(--arrowcolor) transparent;}.d-pad.svelte-1hlpbb9 button.up:where(.svelte-1hlpbb9):active:before {border-bottom-color:#333;}.d-pad.svelte-1hlpbb9 button.up:where(.svelte-1hlpbb9):hover:before {top:var(--dpad-arrow-move);}.d-pad.svelte-1hlpbb9 button.down:where(.svelte-1hlpbb9) {bottom:0;left:50%;transform:translate(-50%, 0);border-radius:50% 50% var(--dpad-radius) var(--dpad-radius);}.d-pad.svelte-1hlpbb9 button.down:where(.svelte-1hlpbb9):hover {background:linear-gradient(180deg, var(--dpad-fg) 0%, var(--dpad-fg-hover) 50%);}.d-pad.svelte-1hlpbb9 button.down:where(.svelte-1hlpbb9):after {right:0;bottom:0;transform:translate(100%, 0);border-bottom-right-radius:50%;pointer-events:none;}.d-pad.svelte-1hlpbb9 button.down:where(.svelte-1hlpbb9):before {bottom:40%;left:50%;transform:translate(-50%, 50%);border-width:var(--tri-sml-b) var(--tri-sml-a) 0px var(--tri-sml-a);border-color:var(--arrowcolor) transparent transparent transparent;}.d-pad.svelte-1hlpbb9 button.down:where(.svelte-1hlpbb9):active:before {border-top-color:#333;}.d-pad.svelte-1hlpbb9 button.down:where(.svelte-1hlpbb9):hover:before {bottom:var(--dpad-arrow-move);}.d-pad.svelte-1hlpbb9 button.left:where(.svelte-1hlpbb9) {top:50%;left:0;transform:translate(0, -50%);border-radius:var(--dpad-radius) 50% 50% var(--dpad-radius);}.d-pad.svelte-1hlpbb9 button.left:where(.svelte-1hlpbb9):hover {background:linear-gradient(-90deg, var(--dpad-fg) 0%, var(--dpad-fg-hover) 50%);}.d-pad.svelte-1hlpbb9 button.left:where(.svelte-1hlpbb9):after {left:0;bottom:0;transform:translate(0, 100%);border-bottom-left-radius:50%;pointer-events:none;}.d-pad.svelte-1hlpbb9 button.left:where(.svelte-1hlpbb9):before {left:40%;top:50%;transform:translate(-50%, -50%);border-width:var(--tri-sml-a) var(--tri-sml-b) var(--tri-sml-a) 0;border-color:transparent var(--arrowcolor) transparent transparent;}.d-pad.svelte-1hlpbb9 button.left:where(.svelte-1hlpbb9):active:before {border-right-color:#333;}.d-pad.svelte-1hlpbb9 button.left:where(.svelte-1hlpbb9):hover:before {left:var(--dpad-arrow-move);}.d-pad.svelte-1hlpbb9 button.right:where(.svelte-1hlpbb9) {top:50%;right:0;transform:translate(0, -50%);border-radius:50% var(--dpad-radius) var(--dpad-radius) 50%;}.d-pad.svelte-1hlpbb9 button.right:where(.svelte-1hlpbb9):hover {background:linear-gradient(90deg, var(--dpad-fg) 0%, var(--dpad-fg-hover) 50%);}.d-pad.svelte-1hlpbb9 button.right:where(.svelte-1hlpbb9):after {right:0;top:0;transform:translate(0, -100%);border-top-right-radius:50%;pointer-events:none;}.d-pad.svelte-1hlpbb9 button.right:where(.svelte-1hlpbb9):before {right:40%;top:50%;transform:translate(50%, -50%);border-width:var(--tri-sml-a) 0 var(--tri-sml-a) var(--tri-sml-b);border-color:transparent transparent transparent var(--arrowcolor);}.d-pad.svelte-1hlpbb9 button.right:where(.svelte-1hlpbb9):active:before {border-left-color:#333;}.d-pad.svelte-1hlpbb9 button.right:where(.svelte-1hlpbb9):hover:before {right:var(--dpad-arrow-move);}`};function dr(t,e){ye(e,!0),xn(t,qn);function r(f,p){e.$$host.dispatchEvent(new CustomEvent(f,{detail:p}))}let n=ie(e,"id",7,""),s=ie(e,"pad_or_joystick",7,"dpad"),i=ie(e,"joystick_parameters",7,void 0),a;dt({}),Ie(()=>{}),Sn(()=>{const f=e.$$host?.shadowRoot?.querySelector("#joystick");if(s()==="joystick"&&!a&&f?.style){const p="#F2eef6",y="#Ece2f7",k="silver";a=new Yn(f,{parameters:{internalFillColor:i()?.internalFillColor||p,internalStrokeColor:i()?.internalStrokeColor||y,externalStrokeColor:i()?.externalStrokeColor||k},callback:g=>{l({x:g.x,y:g.y,cardinalDirection:g.cardinalDirection})}})}});function o(f){r("sendDirection",{id:n(),direction:f})}function l(f){r("sendJoystickPosition",Object.assign({id:n()},f))}var u={get id(){return n()},set id(f=""){n(f),Lt()},get pad_or_joystick(){return s()},set pad_or_joystick(f="dpad"){s(f),Lt()},get joystick_parameters(){return i()},set joystick_parameters(f=void 0){i(f),Lt()}},h=sr(),c=Xe(h);{var v=f=>{var p=Fn(),y=De(p),k=De(y);k.__click=[An,o];var g=Qt(k,2);g.__click=[jn,o];var T=Qt(g,2);T.__click=[Dn,o];var j=Qt(T,2);j.__click=[Xn,o],me(y),me(p),bt(f,p)},d=f=>{var p=sr(),y=Xe(p);{var k=T=>{var j=In();bt(T,j)},g=T=>{var j=Wn();bt(T,j)};lr(y,T=>{s()==="joystick"?T(k):T(g,!1)},!0)}bt(f,p)};lr(c,f=>{s()==="dpad"?f(v):f(d,!1)})}return bt(t,h),ke(u)}gn(["click"]),customElements.define("hb-pad-joystick",Pn(dr,{id:{},pad_or_joystick:{},joystick_parameters:{}},[],[],!0)),ae.Component=dr,Object.defineProperty(ae,Symbol.toStringTag,{value:"Module"})})(this["pad-joystick"]=this["pad-joystick"]||{});
5
+ .d-pad.svelte-1hlpbb9 button.right:where(.svelte-1hlpbb9):after {width:78%;height:102%;}.d-pad.svelte-1hlpbb9 button.up:where(.svelte-1hlpbb9) {top:0;left:50%;transform:translate(-50%, 0);border-radius:var(--dpad-radius) var(--dpad-radius) 50% 50%;}.d-pad.svelte-1hlpbb9 button.up:where(.svelte-1hlpbb9):hover {background:linear-gradient(0deg, var(--dpad-fg) 0%, var(--dpad-fg-hover) 50%);}.d-pad.svelte-1hlpbb9 button.up:where(.svelte-1hlpbb9):after {left:0;top:0;transform:translate(-100%, 0);border-top-left-radius:50%;pointer-events:none;}.d-pad.svelte-1hlpbb9 button.up:where(.svelte-1hlpbb9):before {top:40%;left:50%;transform:translate(-50%, -50%);border-width:0 var(--tri-sml-a) var(--tri-sml-b) var(--tri-sml-a);border-color:transparent transparent var(--arrowcolor) transparent;}.d-pad.svelte-1hlpbb9 button.up:where(.svelte-1hlpbb9):active:before {border-bottom-color:#333;}.d-pad.svelte-1hlpbb9 button.up:where(.svelte-1hlpbb9):hover:before {top:var(--dpad-arrow-move);}.d-pad.svelte-1hlpbb9 button.down:where(.svelte-1hlpbb9) {bottom:0;left:50%;transform:translate(-50%, 0);border-radius:50% 50% var(--dpad-radius) var(--dpad-radius);}.d-pad.svelte-1hlpbb9 button.down:where(.svelte-1hlpbb9):hover {background:linear-gradient(180deg, var(--dpad-fg) 0%, var(--dpad-fg-hover) 50%);}.d-pad.svelte-1hlpbb9 button.down:where(.svelte-1hlpbb9):after {right:0;bottom:0;transform:translate(100%, 0);border-bottom-right-radius:50%;pointer-events:none;}.d-pad.svelte-1hlpbb9 button.down:where(.svelte-1hlpbb9):before {bottom:40%;left:50%;transform:translate(-50%, 50%);border-width:var(--tri-sml-b) var(--tri-sml-a) 0px var(--tri-sml-a);border-color:var(--arrowcolor) transparent transparent transparent;}.d-pad.svelte-1hlpbb9 button.down:where(.svelte-1hlpbb9):active:before {border-top-color:#333;}.d-pad.svelte-1hlpbb9 button.down:where(.svelte-1hlpbb9):hover:before {bottom:var(--dpad-arrow-move);}.d-pad.svelte-1hlpbb9 button.left:where(.svelte-1hlpbb9) {top:50%;left:0;transform:translate(0, -50%);border-radius:var(--dpad-radius) 50% 50% var(--dpad-radius);}.d-pad.svelte-1hlpbb9 button.left:where(.svelte-1hlpbb9):hover {background:linear-gradient(-90deg, var(--dpad-fg) 0%, var(--dpad-fg-hover) 50%);}.d-pad.svelte-1hlpbb9 button.left:where(.svelte-1hlpbb9):after {left:0;bottom:0;transform:translate(0, 100%);border-bottom-left-radius:50%;pointer-events:none;}.d-pad.svelte-1hlpbb9 button.left:where(.svelte-1hlpbb9):before {left:40%;top:50%;transform:translate(-50%, -50%);border-width:var(--tri-sml-a) var(--tri-sml-b) var(--tri-sml-a) 0;border-color:transparent var(--arrowcolor) transparent transparent;}.d-pad.svelte-1hlpbb9 button.left:where(.svelte-1hlpbb9):active:before {border-right-color:#333;}.d-pad.svelte-1hlpbb9 button.left:where(.svelte-1hlpbb9):hover:before {left:var(--dpad-arrow-move);}.d-pad.svelte-1hlpbb9 button.right:where(.svelte-1hlpbb9) {top:50%;right:0;transform:translate(0, -50%);border-radius:50% var(--dpad-radius) var(--dpad-radius) 50%;}.d-pad.svelte-1hlpbb9 button.right:where(.svelte-1hlpbb9):hover {background:linear-gradient(90deg, var(--dpad-fg) 0%, var(--dpad-fg-hover) 50%);}.d-pad.svelte-1hlpbb9 button.right:where(.svelte-1hlpbb9):after {right:0;top:0;transform:translate(0, -100%);border-top-right-radius:50%;pointer-events:none;}.d-pad.svelte-1hlpbb9 button.right:where(.svelte-1hlpbb9):before {right:40%;top:50%;transform:translate(50%, -50%);border-width:var(--tri-sml-a) 0 var(--tri-sml-a) var(--tri-sml-b);border-color:transparent transparent transparent var(--arrowcolor);}.d-pad.svelte-1hlpbb9 button.right:where(.svelte-1hlpbb9):active:before {border-left-color:#333;}.d-pad.svelte-1hlpbb9 button.right:where(.svelte-1hlpbb9):hover:before {right:var(--dpad-arrow-move);}`};function _r(t,e){ke(e,!0),Tn(t,Vn);function r(f,_){e.$$host.dispatchEvent(new CustomEvent(f,{detail:_}))}let n=se(e,"id",7,""),i=se(e,"pad_or_joystick",7,"dpad"),s=se(e,"joystick_parameters",7,void 0),a;vt({}),We(()=>{}),Cn(()=>{const f=e.$$host?.shadowRoot?.querySelector("#joystick");if(i()==="joystick"&&!a&&f?.style){const _="#F2eef6",y="#Ece2f7",k="silver";a=new Yn(f,{parameters:{internalFillColor:s()?.internalFillColor||_,internalStrokeColor:s()?.internalStrokeColor||y,externalStrokeColor:s()?.externalStrokeColor||k},callback:g=>{l({x:g.x,y:g.y,cardinalDirection:g.cardinalDirection})}})}});function o(f){r("sendDirection",{id:n(),direction:f})}function l(f){r("sendJoystickPosition",Object.assign({id:n()},f))}var u={get id(){return n()},set id(f=""){n(f),Ot()},get pad_or_joystick(){return i()},set pad_or_joystick(f="dpad"){i(f),Ot()},get joystick_parameters(){return s()},set joystick_parameters(f=void 0){s(f),Ot()}},c=ar(),d=Xe(c);{var h=f=>{var _=qn(),y=Fe(_),k=Fe(y);k.__click=[Fn,o];var g=te(k,2);g.__click=[Xn,o];var T=te(g,2);T.__click=[In,o];var Y=te(T,2);Y.__click=[Wn,o],ge(y),ge(_),mt(f,_)},v=f=>{var _=ar(),y=Xe(_);{var k=T=>{var Y=Gn();mt(T,Y)},g=T=>{var Y=Hn();mt(T,Y)};ur(y,T=>{i()==="joystick"?T(k):T(g,!1)},!0)}mt(f,_)};ur(d,f=>{i()==="dpad"?f(h):f(v,!1)})}return mt(t,c),$e(u)}yn(["click"]),customElements.define("hb-pad-joystick",Ln(_r,{id:{},pad_or_joystick:{},joystick_parameters:{}},[],[],!0)),oe.Component=_r,Object.defineProperty(oe,Symbol.toStringTag,{value:"Module"})})(this["pad-joystick"]=this["pad-joystick"]||{});
6
6
  //# sourceMappingURL=main.iife.js.map