@benev/tact 0.3.0-3 → 0.3.0-5

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.
@@ -3,8 +3,8 @@ import { disposer, ev } from "@e280/stz";
3
3
  import { SamplerDevice } from "./sampler.js";
4
4
  import { splitAxis } from "../utils/split-axis.js";
5
5
  export class PointerDevice extends SamplerDevice {
6
- client = new Vec2(0, 0);
7
- movement = new Vec2(0, 0);
6
+ client = new Vec2();
7
+ movement = new Vec2();
8
8
  dispose = disposer();
9
9
  constructor(target = window) {
10
10
  super();
@@ -60,21 +60,13 @@ export class PointerDevice extends SamplerDevice {
60
60
  yield* super.samples();
61
61
  }
62
62
  #specialPreProcessing() {
63
- const [x, y] = this.movement;
64
- const [left, right] = splitAxis(x);
63
+ const { x, y } = this.movement;
64
+ const [right, left] = splitAxis(x);
65
65
  const [down, up] = splitAxis(y);
66
- if (x) {
67
- if (x >= 0)
68
- this.setSample(`pointer.move.right`, Math.abs(right));
69
- else
70
- this.setSample(`pointer.move.left`, Math.abs(left));
71
- }
72
- if (y) {
73
- if (y >= 0)
74
- this.setSample(`pointer.move.up`, Math.abs(up));
75
- else
76
- this.setSample(`pointer.move.down`, Math.abs(down));
77
- }
66
+ this.setSample("pointer.move.left", left);
67
+ this.setSample("pointer.move.right", right);
68
+ this.setSample("pointer.move.up", up);
69
+ this.setSample("pointer.move.down", down);
78
70
  this.movement.set_(0, 0);
79
71
  }
80
72
  }
@@ -1 +1 @@
1
- {"version":3,"file":"pointer.js","sourceRoot":"","sources":["../../s/device/pointer.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,IAAI,EAAC,MAAM,aAAa,CAAA;AAChC,OAAO,EAAC,QAAQ,EAAE,EAAE,EAAC,MAAM,WAAW,CAAA;AACtC,OAAO,EAAC,aAAa,EAAC,MAAM,cAAc,CAAA;AAC1C,OAAO,EAAC,SAAS,EAAC,MAAM,wBAAwB,CAAA;AAEhD,MAAM,OAAO,aAAc,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B,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,GAAG,SAAS,CAAC,CAAC,CAAC,CAAA;QAClC,MAAM,CAAC,IAAI,EAAE,EAAE,CAAC,GAAG,SAAS,CAAC,CAAC,CAAC,CAAA;QAE/B,IAAI,CAAC,SAAS,CAAC,mBAAmB,EAAE,IAAI,CAAC,CAAA;QACzC,IAAI,CAAC,SAAS,CAAC,oBAAoB,EAAE,KAAK,CAAC,CAAA;QAC3C,IAAI,CAAC,SAAS,CAAC,iBAAiB,EAAE,EAAE,CAAC,CAAA;QACrC,IAAI,CAAC,SAAS,CAAC,mBAAmB,EAAE,IAAI,CAAC,CAAA;QAEzC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;IACzB,CAAC;CACD"}
@@ -10,7 +10,7 @@
10
10
 
11
11
  <link rel="icon" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><text y='0.9em' font-size='90'>🎮</text></svg>"/>
12
12
  <link rel="stylesheet" href="main.css?v=875383d23fac"/>
13
- <script type="module" src="main.bundle.min.js?v=028f0adf0490"></script>
13
+ <script type="module" src="main.bundle.min.js?v=dc52fa86a5b6"></script>
14
14
 
15
15
 
16
16
  <meta property="og:type" content="website"/>
@@ -26,7 +26,7 @@
26
26
  <header>
27
27
  <h1>
28
28
  <strong>@benev/tact gamepad</strong>
29
- <small>v0.3.0-3</small>
29
+ <small>v0.3.0-5</small>
30
30
  </h1>
31
31
  </header>
32
32
 
@@ -1,6 +1,6 @@
1
- var er=Object.defineProperty;var rr=(r,t)=>{for(var e in t)er(r,e,{get:t[e],enumerable:!0})};var ct=globalThis,pt=ct.ShadowRoot&&(ct.ShadyCSS===void 0||ct.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Vt=Symbol(),ie=new WeakMap,J=class{constructor(t,e,o){if(this._$cssResult$=!0,o!==Vt)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o,e=this.t;if(pt&&t===void 0){let o=e!==void 0&&e.length===1;o&&(t=ie.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),o&&ie.set(e,t))}return t}toString(){return this.cssText}},ae=r=>new J(typeof r=="string"?r:r+"",void 0,Vt),E=(r,...t)=>{let e=r.length===1?r[0]:t.reduce((o,s,n)=>o+(i=>{if(i._$cssResult$===!0)return i.cssText;if(typeof i=="number")return i;throw Error("Value passed to 'css' function must be a 'css' function result: "+i+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+r[n+1],r[0]);return new J(e,r,Vt)},ut=(r,t)=>{if(pt)r.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of t){let o=document.createElement("style"),s=ct.litNonce;s!==void 0&&o.setAttribute("nonce",s),o.textContent=e.cssText,r.appendChild(o)}},W=pt?r=>r:r=>r instanceof CSSStyleSheet?(t=>{let e="";for(let o of t.cssRules)e+=o.cssText;return ae(e)})(r):r;var{is:or,defineProperty:sr,getOwnPropertyDescriptor:nr,getOwnPropertyNames:ir,getOwnPropertySymbols:ar,getPrototypeOf:cr}=Object,ht=globalThis,ce=ht.trustedTypes,pr=ce?ce.emptyScript:"",ur=ht.reactiveElementPolyfillSupport,K=(r,t)=>r,Ft={toAttribute(r,t){switch(t){case Boolean:r=r?pr:null;break;case Object:case Array:r=r==null?r:JSON.stringify(r)}return r},fromAttribute(r,t){let e=r;switch(t){case Boolean:e=r!==null;break;case Number:e=r===null?null:Number(r);break;case Object:case Array:try{e=JSON.parse(r)}catch{e=null}}return e}},ue=(r,t)=>!or(r,t),pe={attribute:!0,type:String,converter:Ft,reflect:!1,useDefault:!1,hasChanged:ue};Symbol.metadata??=Symbol("metadata"),ht.litPropertyMetadata??=new WeakMap;var C=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=pe){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){let o=Symbol(),s=this.getPropertyDescriptor(t,o,e);s!==void 0&&sr(this.prototype,t,s)}}static getPropertyDescriptor(t,e,o){let{get:s,set:n}=nr(this.prototype,t)??{get(){return this[e]},set(i){this[e]=i}};return{get:s,set(i){let c=s?.call(this);n?.call(this,i),this.requestUpdate(t,c,o)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??pe}static _$Ei(){if(this.hasOwnProperty(K("elementProperties")))return;let t=cr(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(K("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(K("properties"))){let e=this.properties,o=[...ir(e),...ar(e)];for(let s of o)this.createProperty(s,e[s])}let t=this[Symbol.metadata];if(t!==null){let e=litPropertyMetadata.get(t);if(e!==void 0)for(let[o,s]of e)this.elementProperties.set(o,s)}this._$Eh=new Map;for(let[e,o]of this.elementProperties){let s=this._$Eu(e,o);s!==void 0&&this._$Eh.set(s,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let o=new Set(t.flat(1/0).reverse());for(let s of o)e.unshift(W(s))}else t!==void 0&&e.push(W(t));return e}static _$Eu(t,e){let o=e.attribute;return o===!1?void 0:typeof o=="string"?o:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){let t=new Map,e=this.constructor.elementProperties;for(let o of e.keys())this.hasOwnProperty(o)&&(t.set(o,this[o]),delete this[o]);t.size>0&&(this._$Ep=t)}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return ut(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,o){this._$AK(t,o)}_$ET(t,e){let o=this.constructor.elementProperties.get(t),s=this.constructor._$Eu(t,o);if(s!==void 0&&o.reflect===!0){let n=(o.converter?.toAttribute!==void 0?o.converter:Ft).toAttribute(e,o.type);this._$Em=t,n==null?this.removeAttribute(s):this.setAttribute(s,n),this._$Em=null}}_$AK(t,e){let o=this.constructor,s=o._$Eh.get(t);if(s!==void 0&&this._$Em!==s){let n=o.getPropertyOptions(s),i=typeof n.converter=="function"?{fromAttribute:n.converter}:n.converter?.fromAttribute!==void 0?n.converter:Ft;this._$Em=s;let c=i.fromAttribute(e,n.type);this[s]=c??this._$Ej?.get(s)??c,this._$Em=null}}requestUpdate(t,e,o,s=!1,n){if(t!==void 0){let i=this.constructor;if(s===!1&&(n=this[t]),o??=i.getPropertyOptions(t),!((o.hasChanged??ue)(n,e)||o.useDefault&&o.reflect&&n===this._$Ej?.get(t)&&!this.hasAttribute(i._$Eu(t,o))))return;this.C(t,e,o)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(t,e,{useDefault:o,reflect:s,wrapped:n},i){o&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,i??e??this[t]),n!==!0||i!==void 0)||(this._$AL.has(t)||(this.hasUpdated||o||(e=void 0),this._$AL.set(t,e)),s===!0&&this._$Em!==t&&(this._$Eq??=new Set).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[s,n]of this._$Ep)this[s]=n;this._$Ep=void 0}let o=this.constructor.elementProperties;if(o.size>0)for(let[s,n]of o){let{wrapped:i}=n,c=this[s];i!==!0||this._$AL.has(s)||c===void 0||this.C(s,void 0,n,c)}}let t=!1,e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(o=>o.hostUpdate?.()),this.update(e)):this._$EM()}catch(o){throw t=!1,this._$EM(),o}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&=this._$Eq.forEach(e=>this._$ET(e,this[e])),this._$EM()}updated(t){}firstUpdated(t){}};C.elementStyles=[],C.shadowRootOptions={mode:"open"},C[K("elementProperties")]=new Map,C[K("finalized")]=new Map,ur?.({ReactiveElement:C}),(ht.reactiveElementVersions??=[]).push("2.1.2");var Kt=globalThis,he=r=>r,ft=Kt.trustedTypes,fe=ft?ft.createPolicy("lit-html",{createHTML:r=>r}):void 0,Zt="$lit$",k=`lit$${Math.random().toFixed(9).slice(2)}$`,Qt="?"+k,hr=`<${Qt}>`,H=document,Q=()=>H.createComment(""),Y=r=>r===null||typeof r!="object"&&typeof r!="function",Yt=Array.isArray,ye=r=>Yt(r)||typeof r?.[Symbol.iterator]=="function",Jt=`[
2
- \f\r]`,Z=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,le=/-->/g,me=/>/g,R=RegExp(`>|${Jt}(?:([^\\s"'>=/]+)(${Jt}*=${Jt}*(?:[^
3
- \f\r"'\`<>=]|("|')|))|$)`,"g"),de=/'/g,ge=/"/g,$e=/^(?:script|style|textarea|title)$/i,Xt=r=>(t,...e)=>({_$litType$:r,strings:t,values:e}),j=Xt(1),Br=Xt(2),Wr=Xt(3),L=Symbol.for("lit-noChange"),l=Symbol.for("lit-nothing"),xe=new WeakMap,N=H.createTreeWalker(H,129);function be(r,t){if(!Yt(r)||!r.hasOwnProperty("raw"))throw Error("invalid template strings array");return fe!==void 0?fe.createHTML(t):t}var we=(r,t)=>{let e=r.length-1,o=[],s,n=t===2?"<svg>":t===3?"<math>":"",i=Z;for(let c=0;c<e;c++){let a=r[c],u,f,h=-1,y=0;for(;y<a.length&&(i.lastIndex=y,f=i.exec(a),f!==null);)y=i.lastIndex,i===Z?f[1]==="!--"?i=le:f[1]!==void 0?i=me:f[2]!==void 0?($e.test(f[2])&&(s=RegExp("</"+f[2],"g")),i=R):f[3]!==void 0&&(i=R):i===R?f[0]===">"?(i=s??Z,h=-1):f[1]===void 0?h=-2:(h=i.lastIndex-f[2].length,u=f[1],i=f[3]===void 0?R:f[3]==='"'?ge:de):i===ge||i===de?i=R:i===le||i===me?i=Z:(i=R,s=void 0);let O=i===R&&r[c+1].startsWith("/>")?" ":"";n+=i===Z?a+hr:h>=0?(o.push(u),a.slice(0,h)+Zt+a.slice(h)+k+O):a+k+(h===-2?c:O)}return[be(r,n+(r[e]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),o]},X=class r{constructor({strings:t,_$litType$:e},o){let s;this.parts=[];let n=0,i=0,c=t.length-1,a=this.parts,[u,f]=we(t,e);if(this.el=r.createElement(u,o),N.currentNode=this.el.content,e===2||e===3){let h=this.el.content.firstChild;h.replaceWith(...h.childNodes)}for(;(s=N.nextNode())!==null&&a.length<c;){if(s.nodeType===1){if(s.hasAttributes())for(let h of s.getAttributeNames())if(h.endsWith(Zt)){let y=f[i++],O=s.getAttribute(h).split(k),at=/([.?@])?(.*)/.exec(y);a.push({type:1,index:n,name:at[2],strings:O,ctor:at[1]==="."?mt:at[1]==="?"?dt:at[1]==="@"?gt:U}),s.removeAttribute(h)}else h.startsWith(k)&&(a.push({type:6,index:n}),s.removeAttribute(h));if($e.test(s.tagName)){let h=s.textContent.split(k),y=h.length-1;if(y>0){s.textContent=ft?ft.emptyScript:"";for(let O=0;O<y;O++)s.append(h[O],Q()),N.nextNode(),a.push({type:2,index:++n});s.append(h[y],Q())}}}else if(s.nodeType===8)if(s.data===Qt)a.push({type:2,index:n});else{let h=-1;for(;(h=s.data.indexOf(k,h+1))!==-1;)a.push({type:7,index:n}),h+=k.length-1}n++}}static createElement(t,e){let o=H.createElement("template");return o.innerHTML=t,o}};function D(r,t,e=r,o){if(t===L)return t;let s=o!==void 0?e._$Co?.[o]:e._$Cl,n=Y(t)?void 0:t._$litDirective$;return s?.constructor!==n&&(s?._$AO?.(!1),n===void 0?s=void 0:(s=new n(r),s._$AT(r,e,o)),o!==void 0?(e._$Co??=[])[o]=s:e._$Cl=s),s!==void 0&&(t=D(r,s._$AS(r,t.values),s,o)),t}var lt=class{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){let{el:{content:e},parts:o}=this._$AD,s=(t?.creationScope??H).importNode(e,!0);N.currentNode=s;let n=N.nextNode(),i=0,c=0,a=o[0];for(;a!==void 0;){if(i===a.index){let u;a.type===2?u=new I(n,n.nextSibling,this,t):a.type===1?u=new a.ctor(n,a.name,a.strings,this,t):a.type===6&&(u=new xt(n,this,t)),this._$AV.push(u),a=o[++c]}i!==a?.index&&(n=N.nextNode(),i++)}return N.currentNode=H,s}p(t){let e=0;for(let o of this._$AV)o!==void 0&&(o.strings!==void 0?(o._$AI(t,o,e),e+=o.strings.length-2):o._$AI(t[e])),e++}},I=class r{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,o,s){this.type=2,this._$AH=l,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=o,this.options=s,this._$Cv=s?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode,e=this._$AM;return e!==void 0&&t?.nodeType===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=D(this,t,e),Y(t)?t===l||t==null||t===""?(this._$AH!==l&&this._$AR(),this._$AH=l):t!==this._$AH&&t!==L&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):ye(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==l&&Y(this._$AH)?this._$AA.nextSibling.data=t:this.T(H.createTextNode(t)),this._$AH=t}$(t){let{values:e,_$litType$:o}=t,s=typeof o=="number"?this._$AC(t):(o.el===void 0&&(o.el=X.createElement(be(o.h,o.h[0]),this.options)),o);if(this._$AH?._$AD===s)this._$AH.p(e);else{let n=new lt(s,this),i=n.u(this.options);n.p(e),this.T(i),this._$AH=n}}_$AC(t){let e=xe.get(t.strings);return e===void 0&&xe.set(t.strings,e=new X(t)),e}k(t){Yt(this._$AH)||(this._$AH=[],this._$AR());let e=this._$AH,o,s=0;for(let n of t)s===e.length?e.push(o=new r(this.O(Q()),this.O(Q()),this,this.options)):o=e[s],o._$AI(n),s++;s<e.length&&(this._$AR(o&&o._$AB.nextSibling,s),e.length=s)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t!==this._$AB;){let o=he(t).nextSibling;he(t).remove(),t=o}}setConnected(t){this._$AM===void 0&&(this._$Cv=t,this._$AP?.(t))}},U=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,o,s,n){this.type=1,this._$AH=l,this._$AN=void 0,this.element=t,this.name=e,this._$AM=s,this.options=n,o.length>2||o[0]!==""||o[1]!==""?(this._$AH=Array(o.length-1).fill(new String),this.strings=o):this._$AH=l}_$AI(t,e=this,o,s){let n=this.strings,i=!1;if(n===void 0)t=D(this,t,e,0),i=!Y(t)||t!==this._$AH&&t!==L,i&&(this._$AH=t);else{let c=t,a,u;for(t=n[0],a=0;a<n.length-1;a++)u=D(this,c[o+a],e,a),u===L&&(u=this._$AH[a]),i||=!Y(u)||u!==this._$AH[a],u===l?t=l:t!==l&&(t+=(u??"")+n[a+1]),this._$AH[a]=u}i&&!s&&this.j(t)}j(t){t===l?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}},mt=class extends U{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===l?void 0:t}},dt=class extends U{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==l)}},gt=class extends U{constructor(t,e,o,s,n){super(t,e,o,s,n),this.type=5}_$AI(t,e=this){if((t=D(this,t,e,0)??l)===L)return;let o=this._$AH,s=t===l&&o!==l||t.capture!==o.capture||t.once!==o.once||t.passive!==o.passive,n=t!==l&&(o===l||s);s&&this.element.removeEventListener(this.name,this,o),n&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}},xt=class{constructor(t,e,o){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=o}get _$AU(){return this._$AM._$AU}_$AI(t){D(this,t)}},Ae={M:Zt,P:k,A:Qt,C:1,L:we,R:lt,D:ye,V:D,I,H:U,N:dt,U:gt,B:mt,F:xt},fr=Kt.litHtmlPolyfillSupport;fr?.(X,I),(Kt.litHtmlVersions??=[]).push("3.3.3");var m=(r,t,e)=>{let o=e?.renderBefore??t,s=o._$litPart$;if(s===void 0){let n=e?.renderBefore??null;o._$litPart$=s=new I(t.insertBefore(Q(),n),n,void 0,e??{})}return s._$AI(r),s};var te=globalThis,G=class extends C{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){let e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=m(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return L}};G._$litElement$=!0,G.finalized=!0,te.litElementHydrateSupport?.({LitElement:G});var lr=te.litElementPolyfillSupport;lr?.({LitElement:G});(te.litElementVersions??=[]).push("4.2.2");var b={string:(r,t)=>r.getAttribute(t)??void 0,number:(r,t)=>{let e=r.getAttribute(t);return e===null||!e?void 0:Number(e)},boolean:(r,t)=>r.getAttribute(t)!==null},d={string:(r,t,e)=>(e===void 0?r.removeAttribute(t):r.setAttribute(t,e),!0),number:(r,t,e)=>(e===void 0?r.removeAttribute(t):r.setAttribute(t,e.toString()),!0),boolean:(r,t,e)=>(e?r.setAttribute(t,""):r.removeAttribute(t),!0),any:(r,t,e)=>{e==null?r.removeAttribute(t):typeof e=="string"?r.setAttribute(t,e):typeof e=="number"?r.setAttribute(t,e.toString()):typeof e=="boolean"?e===!0?r.setAttribute(t,""):r.removeAttribute(t):console.warn(`invalid attribute "${t}" type is "${typeof e}"`)},entries:(r,t)=>{for(let[e,o]of t)d.any(r,e,o)},record:(r,t)=>d.entries(r,Object.entries(t))};function _e(r,t={}){let e=document.createElement(r);return d.record(e,t),e}function ve(r){let t=document.createDocumentFragment();return m(r,t),t.firstElementChild}function yt(r,t){let e=[];for(let[o,s]of Object.entries(t))if(typeof s=="function")r.addEventListener(o,s),e.push(()=>r.removeEventListener(o,s));else{let[n,i]=s;r.addEventListener(o,i,n),e.push(()=>r.removeEventListener(o,i))}return()=>e.forEach(o=>o())}function Se(r,t){let e=new MutationObserver(t);return e.observe(r,{attributes:!0}),()=>e.disconnect()}var $t=class{element;constructor(t){this.element=t}strings=new Proxy({},{get:(t,e)=>b.string(this.element,e),set:(t,e,o)=>d.string(this.element,e,o)});numbers=new Proxy({},{get:(t,e)=>b.number(this.element,e),set:(t,e,o)=>d.number(this.element,e,o)});booleans=new Proxy({},{get:(t,e)=>b.boolean(this.element,e),set:(t,e,o)=>d.boolean(this.element,e,o)})};var Ee=(r,t,e={})=>new Proxy(t,{get:(o,s)=>{switch(t[s]){case String:return b.string(r,s);case Number:return b.number(r,s);case Boolean:return b.boolean(r,s);default:throw new Error(`invalid attribute type for "${s}"`)}},set:(o,s,n)=>{try{switch(e.beforeSet?.(s),t[s]){case String:return d.string(r,s,n);case Number:return d.number(r,s,n);case Boolean:return d.boolean(r,s,n);default:throw new Error(`invalid attribute type for "${s}"`)}}finally{e.afterSet?.(s)}}});function V(r){let t=new $t(r);return{strings:t.strings,numbers:t.numbers,booleans:t.booleans,on:e=>Se(r,e),spec:(e,o={})=>Ee(r,e,o)}}V.get=b;V.set=d;function Ce(r){return new ee(r)}var ee=class{tagName;#t=new Map;#e=[];constructor(t){this.tagName=t}attr(t,e=!0){return this.#t.set(t,e),this}attrs(t){for(let[e,o]of Object.entries(t))this.attr(e,o);return this}children(...t){return this.#e.push(...t),this}done(){let t=document.createElement(this.tagName);return d.entries(t,this.#t),t.append(...this.#e),t}};function F(r,t=document){let e=t.querySelector(r);if(!e)throw new Error(`element not found (${r})`);return e}function bt(r,t=document){return t.querySelector(r)}function wt(r,t=document){return Array.from(t.querySelectorAll(r))}var At=class r{element;#t;constructor(t){this.element=t}in(t){return new r(typeof t=="string"?F(t,this.element):t)}require(t){return F(t,this.element)}maybe(t){return bt(t,this.element)}all(t){return wt(t,this.element)}render(...t){return m(t,this.element)}get attrs(){return this.#t??=V(this.element)}events(t){return yt(this.element,t)}};function ke(r){return r.replace(/([a-zA-Z])(?=[A-Z])/g,"$1-").toLowerCase()}function Me(r,t={}){let{soft:e=!1,upgrade:o=!0}=t;for(let[s,n]of Object.entries(r)){let i=ke(s),c=customElements.get(i);e&&c||(customElements.define(i,n),o&&document.querySelectorAll(i).forEach(a=>{a.constructor===HTMLElement&&customElements.upgrade(a)}))}}function g(r,t=document){return F(r,t)}g.in=(r,t=document)=>new At(t).in(r);g.need=F;g.maybe=bt;g.all=wt;g.el=_e;g.elmer=Ce;g.mk=ve;g.events=yt;g.attrs=V;g.register=Me;g.render=(r,...t)=>m(t,r);function z(){let r,t,e=new Promise((s,n)=>{r=s,t=n});function o(s){return s.then(r).catch(t),e}return{promise:e,resolve:r,reject:t,entangle:o}}function _t(r){let t=null;return((...e)=>(t?t.params=e:(t={params:e,deferred:z()},queueMicrotask(()=>{let{params:o,deferred:s}=t;t=null,Promise.resolve(r(...o)).then(s.resolve).catch(s.reject)})),t.deferred.promise))}var w={};rr(w,{clone:()=>tt,equal:()=>gr,freeze:()=>xr});function tt(r,t=new Set){if(t.has(r))throw new Error("cannot clone circular reference");let e;return typeof r=="function"||r!==null&&typeof r=="object"?(t.add(r),Array.isArray(r)?e=r.map(o=>tt(o,new Set(t))):r.constructor===Object?e=Object.fromEntries(Object.entries(r).map(([o,s])=>[o,tt(s,new Set(t))])):r instanceof Map?e=new Map(Array.from(r,([o,s])=>[o,tt(s,new Set(t))])):r instanceof Set?e=new Set(Array.from(r,o=>tt(o,new Set(t)))):r instanceof Date?e=new Date(r.getTime()):e=r,t.delete(r)):e=r,e}function mr(r){return r!=null}function dr(r){return r==null}var et=Object.freeze({happy:mr,sad:dr,boolean:r=>typeof r=="boolean",number:r=>typeof r=="number",string:r=>typeof r=="string",bigint:r=>typeof r=="bigint",object:r=>typeof r=="object"&&r!==null,array:r=>Array.isArray(r),fn:r=>typeof r=="function",symbol:r=>typeof r=="symbol"});var gr=(r,t)=>{function e(o,s,n){if(!et.object(o)||!et.object(s))return o===s;if(n.includes(o))throw new Error("forbidden circularity detected in deep equal comparison");let i=[...n,o];if(o instanceof Map&&s instanceof Map){if(o.size!==s.size)return!1;for(let[c,a]of o)if(!s.has(c)||!e(a,s.get(c),i))return!1}else if(o instanceof Set&&s instanceof Set){if(o.size!==s.size)return!1;for(let c of o)if(!Array.from(s).some(a=>e(c,a,i)))return!1}else{let c=Object.keys(o),a=Object.keys(s);if(c.length!==a.length)return!1;for(let u of c)if(!a.includes(u)||!e(o[u],s[u],i))return!1}return!0}return e(r,t,[])};function xr(r){function t(e,o){if(!et.object(e)||o.includes(e))return e;let s=[...o,e];if(e instanceof Map)for(let n of e.entries())for(let i of n)t(i,s);else if(e instanceof Set)for(let n of e)t(n,s);else if(Array.isArray(e))for(let n of e)t(n,s);else for(let n of Object.values(e))t(n,s);return Object.freeze(e)}return t(r,[])}function Oe(r){if(r.ok)return r.value;let{error:t}=r;throw t instanceof Error?t:typeof t=="string"?new Error(t):new Error("unknown")}function Pe(r){if(r.ok)throw new Error("didn't get needed error");return r.error}function vt(r,t,e){if(r.has(t))return r.get(t);{let o=e();return r.set(t,o),o}}function St(r){let t,e=!1,o=()=>{e=!0,clearTimeout(t)},s=async()=>{e||(await r(o),!e&&(t=setTimeout(s,0)))};return s(),o}function Te(r,t){let e=Object.entries(t);for(let[o,s]of e)r.addEventListener(o,s);return()=>{for(let[o,s]of e)r.removeEventListener(o,s)}}var Et=(r=0)=>new Promise(t=>setTimeout(t,r));function yr(){let r=new Set;async function t(...a){await Promise.all([...r].map(u=>u(...a)))}function e(a){return r.add(a),()=>{r.delete(a)}}async function o(...a){return t(...a)}function s(a){return e(a)}async function n(a){let{promise:u,resolve:f}=z(),h=s(async(...y)=>{a&&await a(...y),f(y),h()});return u}function i(){r.clear()}let c={pub:o,sub:s,publish:t,subscribe:e,on:e,next:n,clear:i};return Object.assign(s,c),Object.assign(o,c),c}function Re(r){let t=yr();return r&&t.sub(r),t.sub}var Ct=class{#t=new Set;#e=[];#r=new WeakMap;#s=0;#o=new Set;read(t){this.#e.at(-1)?.add(t)}write(t){let e=this.#r.get(t);if(e){for(let o of e)this.#o.add(o);this.#s===0&&this.#n()}}observe(t){let e=new Set;this.#e.push(e);try{let o=t();return{seen:e,value:o}}finally{this.#e.pop()}}subscribe(t,e){let o=vt(this.#r,t,()=>new Set);return o.add(e),()=>{o.delete(e),o.size===0&&this.#r.delete(t)}}batch=t=>{this.#s++;try{return t()}finally{this.#s--,this.#s===0&&this.#n()}};#i(t){if(this.#t.has(t))throw new Error("circularity forbidden");this.#t.add(t);try{t()}finally{this.#t.delete(t)}}#n(){for(;this.#o.size>0;){let t=[...this.#o];this.#o.clear();for(let e of t)this.#i(e)}}};var p=globalThis[Symbol.for("e280.tracker.2")]??=new Ct;function P(r){return function t(){return arguments.length===0?(p.read(t),r):(r=arguments[0],p.write(t),r)}}var kt=class extends Map{get size(){return p.read(this),super.size}[Symbol.iterator](){return p.read(this),super[Symbol.iterator]()}forEach(t){p.read(this);for(let[e,o]of this)t(o,e,this);return this}keys(){return p.read(this),super.keys()}values(){return p.read(this),super.values()}entries(){return p.read(this),super.entries()}has(t){return p.read(this),super.has(t)}get(t){return p.read(this),super.get(t)}set(t,e){return super.set(t,e),p.write(this),this}delete(t){let e=super.delete(t);return p.write(this),e}clear(){return super.clear(),p.write(this),this}};var Mt=class extends Set{get size(){return p.read(this),super.size}[Symbol.iterator](){return p.read(this),super[Symbol.iterator]()}forEach(t){p.read(this);for(let e of this)t(e,e,this);return this}values(){return p.read(this),super.values()}has(t){return p.read(this),super.has(t)}add(t){return super.add(t),p.write(this),this}delete(t){let e=super.delete(t);return p.write(this),e}clear(){return super.clear(),p.write(this),this}};var Hs=p.batch;function Ne(r){return w.freeze(w.clone(r))}var A=Symbol("optic");var rt=class{calculate;#t=!1;#e;constructor(t){this.calculate=t,this.#e=t()}get(){return this.#t&&(this.#t=!1,this.#e=this.calculate()),this.#e}invalidate(){this.#t=!0}};var Ot=class r{[A];#t;#e;#r;constructor(t){this[A]=t,this.#t=w.clone(t.getState()),this.#e=new rt(()=>w.clone(t.getState())),this.#r=new rt(()=>Ne(t.getState()))}update(){let t=this[A].getState();!w.equal(t,this.#t)&&(this.#e.invalidate(),this.#r.invalidate(),this.#t=w.clone(t),p.write(this))}get state(){return p.read(this),this.#e.get()}get frozen(){return p.read(this),this.#r.get()}mutate(t){return this[A].mutate(t)}lens(t){let e=new r({getState:()=>t(this[A].getState()),mutate:o=>this[A].mutate(s=>o(t(s))),registerLens:this[A].registerLens});return this[A].registerLens(e),e}};function He(r){if(!r.done)throw new Error("wait not done");return Oe(r)}function Le(r){if(!r.done)throw new Error("wait not done");return Pe(r)}var De=r=>!r.done;var oe=r=>r.done&&r.ok;function Ue(r,t){let{pending:e=()=>{},ok:o=()=>{},err:s=()=>{}}=t;return De(r)?e():oe(r)?o(He(r)):s(Le(r))}var Pt=E`
1
+ var nr=Object.defineProperty;var ir=(r,t)=>{for(var e in t)nr(r,e,{get:t[e],enumerable:!0})};var ct=globalThis,pt=ct.ShadowRoot&&(ct.ShadyCSS===void 0||ct.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Wt=Symbol(),oe=new WeakMap,F=class{constructor(t,e,o){if(this._$cssResult$=!0,o!==Wt)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o,e=this.t;if(pt&&t===void 0){let o=e!==void 0&&e.length===1;o&&(t=oe.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),o&&oe.set(e,t))}return t}toString(){return this.cssText}},se=r=>new F(typeof r=="string"?r:r+"",void 0,Wt),E=(r,...t)=>{let e=r.length===1?r[0]:t.reduce((o,s,n)=>o+(i=>{if(i._$cssResult$===!0)return i.cssText;if(typeof i=="number")return i;throw Error("Value passed to 'css' function must be a 'css' function result: "+i+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+r[n+1],r[0]);return new F(e,r,Wt)},ut=(r,t)=>{if(pt)r.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of t){let o=document.createElement("style"),s=ct.litNonce;s!==void 0&&o.setAttribute("nonce",s),o.textContent=e.cssText,r.appendChild(o)}},B=pt?r=>r:r=>r instanceof CSSStyleSheet?(t=>{let e="";for(let o of t.cssRules)e+=o.cssText;return se(e)})(r):r;var{is:ar,defineProperty:cr,getOwnPropertyDescriptor:pr,getOwnPropertyNames:ur,getOwnPropertySymbols:fr,getPrototypeOf:hr}=Object,ft=globalThis,ne=ft.trustedTypes,lr=ne?ne.emptyScript:"",mr=ft.reactiveElementPolyfillSupport,J=(r,t)=>r,It={toAttribute(r,t){switch(t){case Boolean:r=r?lr:null;break;case Object:case Array:r=r==null?r:JSON.stringify(r)}return r},fromAttribute(r,t){let e=r;switch(t){case Boolean:e=r!==null;break;case Number:e=r===null?null:Number(r);break;case Object:case Array:try{e=JSON.parse(r)}catch{e=null}}return e}},ae=(r,t)=>!ar(r,t),ie={attribute:!0,type:String,converter:It,reflect:!1,useDefault:!1,hasChanged:ae};Symbol.metadata??=Symbol("metadata"),ft.litPropertyMetadata??=new WeakMap;var C=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=ie){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){let o=Symbol(),s=this.getPropertyDescriptor(t,o,e);s!==void 0&&cr(this.prototype,t,s)}}static getPropertyDescriptor(t,e,o){let{get:s,set:n}=pr(this.prototype,t)??{get(){return this[e]},set(i){this[e]=i}};return{get:s,set(i){let c=s?.call(this);n?.call(this,i),this.requestUpdate(t,c,o)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??ie}static _$Ei(){if(this.hasOwnProperty(J("elementProperties")))return;let t=hr(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(J("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(J("properties"))){let e=this.properties,o=[...ur(e),...fr(e)];for(let s of o)this.createProperty(s,e[s])}let t=this[Symbol.metadata];if(t!==null){let e=litPropertyMetadata.get(t);if(e!==void 0)for(let[o,s]of e)this.elementProperties.set(o,s)}this._$Eh=new Map;for(let[e,o]of this.elementProperties){let s=this._$Eu(e,o);s!==void 0&&this._$Eh.set(s,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let o=new Set(t.flat(1/0).reverse());for(let s of o)e.unshift(B(s))}else t!==void 0&&e.push(B(t));return e}static _$Eu(t,e){let o=e.attribute;return o===!1?void 0:typeof o=="string"?o:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){let t=new Map,e=this.constructor.elementProperties;for(let o of e.keys())this.hasOwnProperty(o)&&(t.set(o,this[o]),delete this[o]);t.size>0&&(this._$Ep=t)}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return ut(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,o){this._$AK(t,o)}_$ET(t,e){let o=this.constructor.elementProperties.get(t),s=this.constructor._$Eu(t,o);if(s!==void 0&&o.reflect===!0){let n=(o.converter?.toAttribute!==void 0?o.converter:It).toAttribute(e,o.type);this._$Em=t,n==null?this.removeAttribute(s):this.setAttribute(s,n),this._$Em=null}}_$AK(t,e){let o=this.constructor,s=o._$Eh.get(t);if(s!==void 0&&this._$Em!==s){let n=o.getPropertyOptions(s),i=typeof n.converter=="function"?{fromAttribute:n.converter}:n.converter?.fromAttribute!==void 0?n.converter:It;this._$Em=s;let c=i.fromAttribute(e,n.type);this[s]=c??this._$Ej?.get(s)??c,this._$Em=null}}requestUpdate(t,e,o,s=!1,n){if(t!==void 0){let i=this.constructor;if(s===!1&&(n=this[t]),o??=i.getPropertyOptions(t),!((o.hasChanged??ae)(n,e)||o.useDefault&&o.reflect&&n===this._$Ej?.get(t)&&!this.hasAttribute(i._$Eu(t,o))))return;this.C(t,e,o)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(t,e,{useDefault:o,reflect:s,wrapped:n},i){o&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,i??e??this[t]),n!==!0||i!==void 0)||(this._$AL.has(t)||(this.hasUpdated||o||(e=void 0),this._$AL.set(t,e)),s===!0&&this._$Em!==t&&(this._$Eq??=new Set).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[s,n]of this._$Ep)this[s]=n;this._$Ep=void 0}let o=this.constructor.elementProperties;if(o.size>0)for(let[s,n]of o){let{wrapped:i}=n,c=this[s];i!==!0||this._$AL.has(s)||c===void 0||this.C(s,void 0,n,c)}}let t=!1,e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(o=>o.hostUpdate?.()),this.update(e)):this._$EM()}catch(o){throw t=!1,this._$EM(),o}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&=this._$Eq.forEach(e=>this._$ET(e,this[e])),this._$EM()}updated(t){}firstUpdated(t){}};C.elementStyles=[],C.shadowRootOptions={mode:"open"},C[J("elementProperties")]=new Map,C[J("finalized")]=new Map,mr?.({ReactiveElement:C}),(ft.reactiveElementVersions??=[]).push("2.1.2");var Vt=globalThis,ce=r=>r,ht=Vt.trustedTypes,pe=ht?ht.createPolicy("lit-html",{createHTML:r=>r}):void 0,Ft="$lit$",k=`lit$${Math.random().toFixed(9).slice(2)}$`,Jt="?"+k,dr=`<${Jt}>`,H=document,Z=()=>H.createComment(""),Q=r=>r===null||typeof r!="object"&&typeof r!="function",Kt=Array.isArray,de=r=>Kt(r)||typeof r?.[Symbol.iterator]=="function",Gt=`[
2
+ \f\r]`,K=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,ue=/-->/g,fe=/>/g,R=RegExp(`>|${Gt}(?:([^\\s"'>=/]+)(${Gt}*=${Gt}*(?:[^
3
+ \f\r"'\`<>=]|("|')|))|$)`,"g"),he=/'/g,le=/"/g,ge=/^(?:script|style|textarea|title)$/i,Zt=r=>(t,...e)=>({_$litType$:r,strings:t,values:e}),j=Zt(1),Vr=Zt(2),Fr=Zt(3),L=Symbol.for("lit-noChange"),l=Symbol.for("lit-nothing"),me=new WeakMap,N=H.createTreeWalker(H,129);function xe(r,t){if(!Kt(r)||!r.hasOwnProperty("raw"))throw Error("invalid template strings array");return pe!==void 0?pe.createHTML(t):t}var ye=(r,t)=>{let e=r.length-1,o=[],s,n=t===2?"<svg>":t===3?"<math>":"",i=K;for(let c=0;c<e;c++){let a=r[c],u,h,f=-1,y=0;for(;y<a.length&&(i.lastIndex=y,h=i.exec(a),h!==null);)y=i.lastIndex,i===K?h[1]==="!--"?i=ue:h[1]!==void 0?i=fe:h[2]!==void 0?(ge.test(h[2])&&(s=RegExp("</"+h[2],"g")),i=R):h[3]!==void 0&&(i=R):i===R?h[0]===">"?(i=s??K,f=-1):h[1]===void 0?f=-2:(f=i.lastIndex-h[2].length,u=h[1],i=h[3]===void 0?R:h[3]==='"'?le:he):i===le||i===he?i=R:i===ue||i===fe?i=K:(i=R,s=void 0);let T=i===R&&r[c+1].startsWith("/>")?" ":"";n+=i===K?a+dr:f>=0?(o.push(u),a.slice(0,f)+Ft+a.slice(f)+k+T):a+k+(f===-2?c:T)}return[xe(r,n+(r[e]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),o]},Y=class r{constructor({strings:t,_$litType$:e},o){let s;this.parts=[];let n=0,i=0,c=t.length-1,a=this.parts,[u,h]=ye(t,e);if(this.el=r.createElement(u,o),N.currentNode=this.el.content,e===2||e===3){let f=this.el.content.firstChild;f.replaceWith(...f.childNodes)}for(;(s=N.nextNode())!==null&&a.length<c;){if(s.nodeType===1){if(s.hasAttributes())for(let f of s.getAttributeNames())if(f.endsWith(Ft)){let y=h[i++],T=s.getAttribute(f).split(k),at=/([.?@])?(.*)/.exec(y);a.push({type:1,index:n,name:at[2],strings:T,ctor:at[1]==="."?mt:at[1]==="?"?dt:at[1]==="@"?gt:U}),s.removeAttribute(f)}else f.startsWith(k)&&(a.push({type:6,index:n}),s.removeAttribute(f));if(ge.test(s.tagName)){let f=s.textContent.split(k),y=f.length-1;if(y>0){s.textContent=ht?ht.emptyScript:"";for(let T=0;T<y;T++)s.append(f[T],Z()),N.nextNode(),a.push({type:2,index:++n});s.append(f[y],Z())}}}else if(s.nodeType===8)if(s.data===Jt)a.push({type:2,index:n});else{let f=-1;for(;(f=s.data.indexOf(k,f+1))!==-1;)a.push({type:7,index:n}),f+=k.length-1}n++}}static createElement(t,e){let o=H.createElement("template");return o.innerHTML=t,o}};function D(r,t,e=r,o){if(t===L)return t;let s=o!==void 0?e._$Co?.[o]:e._$Cl,n=Q(t)?void 0:t._$litDirective$;return s?.constructor!==n&&(s?._$AO?.(!1),n===void 0?s=void 0:(s=new n(r),s._$AT(r,e,o)),o!==void 0?(e._$Co??=[])[o]=s:e._$Cl=s),s!==void 0&&(t=D(r,s._$AS(r,t.values),s,o)),t}var lt=class{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){let{el:{content:e},parts:o}=this._$AD,s=(t?.creationScope??H).importNode(e,!0);N.currentNode=s;let n=N.nextNode(),i=0,c=0,a=o[0];for(;a!==void 0;){if(i===a.index){let u;a.type===2?u=new W(n,n.nextSibling,this,t):a.type===1?u=new a.ctor(n,a.name,a.strings,this,t):a.type===6&&(u=new xt(n,this,t)),this._$AV.push(u),a=o[++c]}i!==a?.index&&(n=N.nextNode(),i++)}return N.currentNode=H,s}p(t){let e=0;for(let o of this._$AV)o!==void 0&&(o.strings!==void 0?(o._$AI(t,o,e),e+=o.strings.length-2):o._$AI(t[e])),e++}},W=class r{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,o,s){this.type=2,this._$AH=l,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=o,this.options=s,this._$Cv=s?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode,e=this._$AM;return e!==void 0&&t?.nodeType===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=D(this,t,e),Q(t)?t===l||t==null||t===""?(this._$AH!==l&&this._$AR(),this._$AH=l):t!==this._$AH&&t!==L&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):de(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==l&&Q(this._$AH)?this._$AA.nextSibling.data=t:this.T(H.createTextNode(t)),this._$AH=t}$(t){let{values:e,_$litType$:o}=t,s=typeof o=="number"?this._$AC(t):(o.el===void 0&&(o.el=Y.createElement(xe(o.h,o.h[0]),this.options)),o);if(this._$AH?._$AD===s)this._$AH.p(e);else{let n=new lt(s,this),i=n.u(this.options);n.p(e),this.T(i),this._$AH=n}}_$AC(t){let e=me.get(t.strings);return e===void 0&&me.set(t.strings,e=new Y(t)),e}k(t){Kt(this._$AH)||(this._$AH=[],this._$AR());let e=this._$AH,o,s=0;for(let n of t)s===e.length?e.push(o=new r(this.O(Z()),this.O(Z()),this,this.options)):o=e[s],o._$AI(n),s++;s<e.length&&(this._$AR(o&&o._$AB.nextSibling,s),e.length=s)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t!==this._$AB;){let o=ce(t).nextSibling;ce(t).remove(),t=o}}setConnected(t){this._$AM===void 0&&(this._$Cv=t,this._$AP?.(t))}},U=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,o,s,n){this.type=1,this._$AH=l,this._$AN=void 0,this.element=t,this.name=e,this._$AM=s,this.options=n,o.length>2||o[0]!==""||o[1]!==""?(this._$AH=Array(o.length-1).fill(new String),this.strings=o):this._$AH=l}_$AI(t,e=this,o,s){let n=this.strings,i=!1;if(n===void 0)t=D(this,t,e,0),i=!Q(t)||t!==this._$AH&&t!==L,i&&(this._$AH=t);else{let c=t,a,u;for(t=n[0],a=0;a<n.length-1;a++)u=D(this,c[o+a],e,a),u===L&&(u=this._$AH[a]),i||=!Q(u)||u!==this._$AH[a],u===l?t=l:t!==l&&(t+=(u??"")+n[a+1]),this._$AH[a]=u}i&&!s&&this.j(t)}j(t){t===l?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}},mt=class extends U{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===l?void 0:t}},dt=class extends U{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==l)}},gt=class extends U{constructor(t,e,o,s,n){super(t,e,o,s,n),this.type=5}_$AI(t,e=this){if((t=D(this,t,e,0)??l)===L)return;let o=this._$AH,s=t===l&&o!==l||t.capture!==o.capture||t.once!==o.once||t.passive!==o.passive,n=t!==l&&(o===l||s);s&&this.element.removeEventListener(this.name,this,o),n&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}},xt=class{constructor(t,e,o){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=o}get _$AU(){return this._$AM._$AU}_$AI(t){D(this,t)}},$e={M:Ft,P:k,A:Jt,C:1,L:ye,R:lt,D:de,V:D,I:W,H:U,N:dt,U:gt,B:mt,F:xt},gr=Vt.litHtmlPolyfillSupport;gr?.(Y,W),(Vt.litHtmlVersions??=[]).push("3.3.3");var m=(r,t,e)=>{let o=e?.renderBefore??t,s=o._$litPart$;if(s===void 0){let n=e?.renderBefore??null;o._$litPart$=s=new W(t.insertBefore(Z(),n),n,void 0,e??{})}return s._$AI(r),s};var Qt=globalThis,I=class extends C{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){let e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=m(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return L}};I._$litElement$=!0,I.finalized=!0,Qt.litElementHydrateSupport?.({LitElement:I});var xr=Qt.litElementPolyfillSupport;xr?.({LitElement:I});(Qt.litElementVersions??=[]).push("4.2.2");var b={string:(r,t)=>r.getAttribute(t)??void 0,number:(r,t)=>{let e=r.getAttribute(t);return e===null||!e?void 0:Number(e)},boolean:(r,t)=>r.getAttribute(t)!==null},d={string:(r,t,e)=>(e===void 0?r.removeAttribute(t):r.setAttribute(t,e),!0),number:(r,t,e)=>(e===void 0?r.removeAttribute(t):r.setAttribute(t,e.toString()),!0),boolean:(r,t,e)=>(e?r.setAttribute(t,""):r.removeAttribute(t),!0),any:(r,t,e)=>{e==null?r.removeAttribute(t):typeof e=="string"?r.setAttribute(t,e):typeof e=="number"?r.setAttribute(t,e.toString()):typeof e=="boolean"?e===!0?r.setAttribute(t,""):r.removeAttribute(t):console.warn(`invalid attribute "${t}" type is "${typeof e}"`)},entries:(r,t)=>{for(let[e,o]of t)d.any(r,e,o)},record:(r,t)=>d.entries(r,Object.entries(t))};function be(r,t={}){let e=document.createElement(r);return d.record(e,t),e}function we(r){let t=document.createDocumentFragment();return m(r,t),t.firstElementChild}function yt(r,t){let e=[];for(let[o,s]of Object.entries(t))if(typeof s=="function")r.addEventListener(o,s),e.push(()=>r.removeEventListener(o,s));else{let[n,i]=s;r.addEventListener(o,i,n),e.push(()=>r.removeEventListener(o,i))}return()=>e.forEach(o=>o())}function Ae(r,t){let e=new MutationObserver(t);return e.observe(r,{attributes:!0}),()=>e.disconnect()}var $t=class{element;constructor(t){this.element=t}strings=new Proxy({},{get:(t,e)=>b.string(this.element,e),set:(t,e,o)=>d.string(this.element,e,o)});numbers=new Proxy({},{get:(t,e)=>b.number(this.element,e),set:(t,e,o)=>d.number(this.element,e,o)});booleans=new Proxy({},{get:(t,e)=>b.boolean(this.element,e),set:(t,e,o)=>d.boolean(this.element,e,o)})};var _e=(r,t,e={})=>new Proxy(t,{get:(o,s)=>{switch(t[s]){case String:return b.string(r,s);case Number:return b.number(r,s);case Boolean:return b.boolean(r,s);default:throw new Error(`invalid attribute type for "${s}"`)}},set:(o,s,n)=>{try{switch(e.beforeSet?.(s),t[s]){case String:return d.string(r,s,n);case Number:return d.number(r,s,n);case Boolean:return d.boolean(r,s,n);default:throw new Error(`invalid attribute type for "${s}"`)}}finally{e.afterSet?.(s)}}});function G(r){let t=new $t(r);return{strings:t.strings,numbers:t.numbers,booleans:t.booleans,on:e=>Ae(r,e),spec:(e,o={})=>_e(r,e,o)}}G.get=b;G.set=d;function ve(r){return new Yt(r)}var Yt=class{tagName;#t=new Map;#e=[];constructor(t){this.tagName=t}attr(t,e=!0){return this.#t.set(t,e),this}attrs(t){for(let[e,o]of Object.entries(t))this.attr(e,o);return this}children(...t){return this.#e.push(...t),this}done(){let t=document.createElement(this.tagName);return d.entries(t,this.#t),t.append(...this.#e),t}};function V(r,t=document){let e=t.querySelector(r);if(!e)throw new Error(`element not found (${r})`);return e}function bt(r,t=document){return t.querySelector(r)}function wt(r,t=document){return Array.from(t.querySelectorAll(r))}var At=class r{element;#t;constructor(t){this.element=t}in(t){return new r(typeof t=="string"?V(t,this.element):t)}require(t){return V(t,this.element)}maybe(t){return bt(t,this.element)}all(t){return wt(t,this.element)}render(...t){return m(t,this.element)}get attrs(){return this.#t??=G(this.element)}events(t){return yt(this.element,t)}};function Se(r){return r.replace(/([a-zA-Z])(?=[A-Z])/g,"$1-").toLowerCase()}function Ee(r,t={}){let{soft:e=!1,upgrade:o=!0}=t;for(let[s,n]of Object.entries(r)){let i=Se(s),c=customElements.get(i);e&&c||(customElements.define(i,n),o&&document.querySelectorAll(i).forEach(a=>{a.constructor===HTMLElement&&customElements.upgrade(a)}))}}function g(r,t=document){return V(r,t)}g.in=(r,t=document)=>new At(t).in(r);g.need=V;g.maybe=bt;g.all=wt;g.el=be;g.elmer=ve;g.mk=we;g.events=yt;g.attrs=G;g.register=Ee;g.render=(r,...t)=>m(t,r);function Ce(){let r,t,e=new Promise((o,s)=>{r=o,t=s});return e.resolve=r,e.reject=t,e.promise=e,e.entangle=o=>(o.then(r,t),e),e}var w={};ir(w,{clone:()=>X,equal:()=>br,freeze:()=>wr});function X(r,t=new Set){if(t.has(r))throw new Error("cannot clone circular reference");let e;return typeof r=="function"||r!==null&&typeof r=="object"?(t.add(r),Array.isArray(r)?e=r.map(o=>X(o,new Set(t))):r.constructor===Object?e=Object.fromEntries(Object.entries(r).map(([o,s])=>[o,X(s,new Set(t))])):r instanceof Map?e=new Map(Array.from(r,([o,s])=>[o,X(s,new Set(t))])):r instanceof Set?e=new Set(Array.from(r,o=>X(o,new Set(t)))):r instanceof Date?e=new Date(r.getTime()):e=r,t.delete(r)):e=r,e}function yr(r){return r!=null}function $r(r){return r==null}var tt=Object.freeze({happy:yr,sad:$r,boolean:r=>typeof r=="boolean",number:r=>typeof r=="number",string:r=>typeof r=="string",bigint:r=>typeof r=="bigint",object:r=>typeof r=="object"&&r!==null,array:r=>Array.isArray(r),fn:r=>typeof r=="function",symbol:r=>typeof r=="symbol"});var br=(r,t)=>{function e(o,s,n){if(!tt.object(o)||!tt.object(s))return o===s;if(n.includes(o))throw new Error("forbidden circularity detected in deep equal comparison");let i=[...n,o];if(o instanceof Map&&s instanceof Map){if(o.size!==s.size)return!1;for(let[c,a]of o)if(!s.has(c)||!e(a,s.get(c),i))return!1}else if(o instanceof Set&&s instanceof Set){if(o.size!==s.size)return!1;for(let c of o)if(!Array.from(s).some(a=>e(c,a,i)))return!1}else{let c=Object.keys(o),a=Object.keys(s);if(c.length!==a.length)return!1;for(let u of c)if(!a.includes(u)||!e(o[u],s[u],i))return!1}return!0}return e(r,t,[])};function wr(r){function t(e,o){if(!tt.object(e)||o.includes(e))return e;let s=[...o,e];if(e instanceof Map)for(let n of e.entries())for(let i of n)t(i,s);else if(e instanceof Set)for(let n of e)t(n,s);else if(Array.isArray(e))for(let n of e)t(n,s);else for(let n of Object.values(e))t(n,s);return Object.freeze(e)}return t(r,[])}function ke(r){if(r.ok)return r.value;let{error:t}=r;throw t instanceof Error?t:typeof t=="string"?new Error(t):new Error("unknown")}function Me(r){if(r.ok)throw new Error("didn't get needed error");return r.error}function Te(r,t,e){if(r.has(t))return r.get(t);{let o=e();return r.set(t,o),o}}function Pe(r){let t,e=!1,o=()=>{e=!0,clearTimeout(t)},s=async()=>{e||(await r(o),!e&&(t=setTimeout(s,0)))};return s(),o}function Oe(r,t){let e=Object.entries(t);for(let[o,s]of e)r.addEventListener(o,s);return()=>{for(let[o,s]of e)r.removeEventListener(o,s)}}var Re=(r=0)=>new Promise(t=>setTimeout(t,r));function Ar(){let r=new Set;async function t(...a){await Promise.all([...r].map(u=>u(...a)))}function e(a){return r.add(a),()=>{r.delete(a)}}async function o(...a){return t(...a)}function s(a){return e(a)}async function n(a){let{promise:u,resolve:h}=Ce(),f=s(async(...y)=>{a&&await a(...y),h(y),f()});return u}function i(){r.clear()}let c={pub:o,sub:s,publish:t,subscribe:e,on:e,next:n,clear:i};return Object.assign(s,c),Object.assign(o,c),c}function Ne(r){let t=Ar();return r&&t.sub(r),t.sub}var _t=class{#t=new Set;#e=[];#r=new WeakMap;#s=0;#o=new Set;read(t){this.#e.at(-1)?.add(t)}write(t){let e=this.#r.get(t);if(e){for(let o of e)this.#o.add(o);this.#s===0&&this.#n()}}observe(t){let e=new Set;this.#e.push(e);try{let o=t();return{seen:e,value:o}}finally{this.#e.pop()}}subscribe(t,e){let o=Te(this.#r,t,()=>new Set);return o.add(e),()=>{o.delete(e),o.size===0&&this.#r.delete(t)}}batch=t=>{this.#s++;try{return t()}finally{this.#s--,this.#s===0&&this.#n()}};#i(t){if(this.#t.has(t))throw new Error("circularity forbidden");this.#t.add(t);try{t()}finally{this.#t.delete(t)}}#n(){for(;this.#o.size>0;){let t=[...this.#o];this.#o.clear();for(let e of t)this.#i(e)}}};var p=globalThis[Symbol.for("e280.tracker.2")]??=new _t;function P(r){function t(){return arguments.length===0?(p.read(t),r):(r=arguments[0],p.write(t),r)}return t.get=()=>t(),t.set=e=>t(e),t}var vt=class extends Map{get size(){return p.read(this),super.size}[Symbol.iterator](){return p.read(this),super[Symbol.iterator]()}forEach(t){p.read(this);for(let[e,o]of this)t(o,e,this);return this}keys(){return p.read(this),super.keys()}values(){return p.read(this),super.values()}entries(){return p.read(this),super.entries()}has(t){return p.read(this),super.has(t)}get(t){return p.read(this),super.get(t)}set(t,e){return super.set(t,e),p.write(this),this}delete(t){let e=super.delete(t);return p.write(this),e}clear(){return super.clear(),p.write(this),this}};var St=class extends Set{get size(){return p.read(this),super.size}[Symbol.iterator](){return p.read(this),super[Symbol.iterator]()}forEach(t){p.read(this);for(let e of this)t(e,e,this);return this}values(){return p.read(this),super.values()}has(t){return p.read(this),super.has(t)}add(t){return super.add(t),p.write(this),this}delete(t){let e=super.delete(t);return p.write(this),e}clear(){return super.clear(),p.write(this),this}};var Ds=p.batch;function He(r){return w.freeze(w.clone(r))}var A=Symbol("optic");var et=class{calculate;#t=!1;#e;constructor(t){this.calculate=t,this.#e=t()}get(){return this.#t&&(this.#t=!1,this.#e=this.calculate()),this.#e}invalidate(){this.#t=!0}};var Et=class r{[A];#t;#e;#r;constructor(t){this[A]=t,this.#t=w.clone(t.getState()),this.#e=new et(()=>w.clone(t.getState())),this.#r=new et(()=>He(t.getState()))}update(){let t=this[A].getState();!w.equal(t,this.#t)&&(this.#e.invalidate(),this.#r.invalidate(),this.#t=w.clone(t),p.write(this))}get state(){return p.read(this),this.#e.get()}get frozen(){return p.read(this),this.#r.get()}mutate(t){return this[A].mutate(t)}lens(t){let e=new r({getState:()=>t(this[A].getState()),mutate:o=>this[A].mutate(s=>o(t(s))),registerLens:this[A].registerLens});return this[A].registerLens(e),e}};function Le(r){if(!r.done)throw new Error("wait not done");return ke(r)}function De(r){if(!r.done)throw new Error("wait not done");return Me(r)}var Ue=r=>!r.done;var te=r=>r.done&&r.ok;function je(r,t){let{pending:e=()=>{},ok:o=()=>{},err:s=()=>{}}=t;return Ue(r)?e():te(r)?o(Le(r)):s(De(r))}function rt(){let r,t,e=new Promise((s,n)=>{r=s,t=n});function o(s){return s.then(r).catch(t),e}return{promise:e,resolve:r,reject:t,entangle:o}}function Ct(r){let t=null;return((...e)=>(t?t.params=e:(t={params:e,deferred:rt()},queueMicrotask(()=>{let{params:o,deferred:s}=t;t=null,Promise.resolve(r(...o)).then(s.resolve).catch(s.reject)})),t.deferred.promise))}function ze(r,t,e){if(r.has(t))return r.get(t);{let o=e();return r.set(t,o),o}}function qe(r){let t,e=!1,o=()=>{e=!0,clearTimeout(t)},s=async()=>{e||(await r(o),!e&&(t=setTimeout(s,0)))};return s(),o}var Be=(r=0)=>new Promise(t=>setTimeout(t,r));var kt=E`
4
4
  * {
5
5
  margin: 0;
6
6
  padding: 0;
@@ -14,18 +14,18 @@ var er=Object.defineProperty;var rr=(r,t)=>{for(var e in t)er(r,e,{get:t[e],enum
14
14
  ::-webkit-scrollbar-track { background: transparent; }
15
15
  ::-webkit-scrollbar-thumb { background: #888; border-radius: 1em; }
16
16
  ::-webkit-scrollbar-thumb:hover { background: #999; }
17
- `;var Tt=class r extends HTMLElement{static register(){g.register({SlyShadow:r},{soft:!0})}connectedCallback(){this.hasAttribute("view")||this.setAttribute("view","")}};var Rt=class{render;count=0;rendered=z();constructor(t){this.render=t}doneRender(){this.count++,this.rendered.resolve(),this.rendered=z()}},T=class extends Rt{host;shadow;constructor(t,e,o){super(t),this.host=e,this.shadow=o}};var se=class{#t=[];get scope(){let t=this.#t.at(-1);if(!t)throw new Error("hooks must be called within a render fn");return t}increment(){let t=this.scope,e=t.position++;return{scope:t,position:e}}wrap(t,e){t.position=0,this.#t.push(t);try{return e()}finally{this.#t.pop()}}},$=globalThis[Symbol.for("e280.hooks")]??=new se;var q=class{#t=[];clear(){this.#t.forEach(t=>t()),this.#t=[]}observe(t,e){let{seen:o,value:s}=p.observe(t);this.clear();for(let n of o){let i=p.subscribe(n,e);this.#t.push(i)}return s}};var Nt=class{#t=[];#e=[];mount(t){this.#t.push(t),this.#e.push(t())}unmountAll(){for(let t of this.#e)t();this.#e=[]}remountAll(){for(let t of this.#t)this.#e.push(t())}};var B=class{cx;position=0;values=new Map;mounts=new Nt;constructor(t){this.cx=t}};var{I:Gi}=Ae;var je=r=>r.strings===void 0;var ze={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},Lt=r=>(...t)=>({_$litDirective$:r,values:t}),Ht=class{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,o){this._$Ct=t,this._$AM=e,this._$Ci=o}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}};var ot=(r,t)=>{let e=r._$AN;if(e===void 0)return!1;for(let o of e)o._$AO?.(t,!1),ot(o,t);return!0},Dt=r=>{let t,e;do{if((t=r._$AM)===void 0)break;e=t._$AN,e.delete(r),r=t}while(e?.size===0)},qe=r=>{for(let t;t=r._$AM;r=t){let e=t._$AN;if(e===void 0)t._$AN=e=new Set;else if(e.has(r))break;e.add(r),Cr(t)}};function Sr(r){this._$AN!==void 0?(Dt(this),this._$AM=r,qe(this)):this._$AM=r}function Er(r,t=!1,e=0){let o=this._$AH,s=this._$AN;if(s!==void 0&&s.size!==0)if(t)if(Array.isArray(o))for(let n=e;n<o.length;n++)ot(o[n],!1),Dt(o[n]);else o!=null&&(ot(o,!1),Dt(o));else ot(this,r)}var Cr=r=>{r.type==ze.CHILD&&(r._$AP??=Er,r._$AQ??=Sr)},st=class extends Ht{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,e,o){super._$AT(t,e,o),qe(this),this.isConnected=t._$AU}_$AO(t,e=!0){t!==this.isConnected&&(this.isConnected=t,t?this.reconnected?.():this.disconnected?.()),e&&(ot(this,t),Dt(this))}setValue(t){if(je(this._$Ct))this._$Ct._$AI(t,this);else{let e=[...this._$Ct._$AH];e[this._$Ci]=t,this._$Ct._$AI(e,this,0)}}disconnected(){}reconnected(){}};function Be(r){return class extends HTMLElement{#t;#e;#r=new q;#s=this.attachShadow({mode:"open"});constructor(){super();let t=_t(()=>{if(!this.isConnected)return;let e=this.#o();m(e,this.#t.shadow),this.#t.doneRender()});this.#t=new T(t,this,this.#s),this.#e=new B(this.#t)}#o(){return this.#r.observe(()=>$.wrap(this.#e,()=>r()),this.#t.render)}render(){m(this.#o(),this.#t.shadow),this.#t.doneRender()}connectedCallback(){this.#e.mounts.remountAll(),this.#t.render()}disconnectedCallback(){this.#e.mounts.unmountAll(),this.#r.clear()}}}function x(r){let{scope:t,position:e}=$.increment();return vt(t.values,e,r)}function nt(){return $.increment().scope.cx}function Ut(){let r=nt();if(!(r instanceof T))throw new Error("this hook only works on shadow views (but was called in a light view)");return r}function ne(){return Ut().host}function M(r){let{scope:t}=$.increment();return x(()=>t.mounts.mount(r))}function Ie(){return Ut().shadow}function Ge(r,t){ut(r,Mr(t))}function Mr(r){let t=[];if(Array.isArray(r)){let e=new Set(r.flat(1/0).reverse());for(let o of e)t.unshift(W(o))}else r!==void 0&&t.push(W(r));return t}function jt(...r){let t=Ie();x(()=>Ge(t,r))}function zt(r=""){let t=ne();x(()=>t.setAttribute("view",r))}function Ve(r){return x(()=>P(r))}var qt=jt;function Je(r,t){for(let[e,o]of Object.entries(t))Pr(r,e,o)}function Pr(r,t,e){let o=r.getAttribute(t),s=Tr(e);s!==o&&(s===null?r.removeAttribute(t):r.setAttribute(t,s))}function Tr(r){return typeof r=="string"?r:typeof r=="number"?r.toString():r?"":null}function Rr(){Tt.register();let r=document.createElement("sly-shadow"),t=r.attachShadow({mode:"open"});return{host:r,shadow:t}}function it(r){return Ke(Rr,r)}it.setup=r=>(t=>Ke(r,t));function Ke(r,t){let e=Lt(class extends st{#t;#e;#r;#s=new q;constructor(s){super(s);let{host:n,shadow:i}=r(),c=_t(()=>{if(!this.#r)throw new Error("cannot render before props");if(!this.isConnected)return;let a=this.#o(this.#r);m(a,this.#t.shadow),this.#t.doneRender()});this.#t=new T(c,n,i),this.#e=new B(this.#t)}#o(s){return this.#r=s,this.#s.observe(()=>$.wrap(this.#e,()=>t(...this.#r)),this.#t.render)}render({props:s,children:n,attrs:i}){let{host:c}=this.#t;return this.isConnected&&(i&&Je(c,i),m(n,this.#t.host),m(this.#o(s),this.#t.shadow),this.#t.doneRender()),c}disconnected(){m(null,this.#t.shadow),m(null,this.#t.host),this.#e.mounts.unmountAll(),this.#s.clear()}reconnected(){this.#e.mounts.remountAll(),this.#t.render()}});function o(...s){return e({props:s})}return o.with=e,o}function _(r,t){return()=>Nr({hz:r,frames:t})}var Nr=it(({hz:r,frames:t})=>{zt("loading"),qt(Pt,Hr);let e=Ve(0);return M(()=>St(async()=>{await Et(1e3/r);let o=e()+1;e(o>=t.length?0:o)})),t.at(e())}),Hr=E`
17
+ `;var Mt=class r extends HTMLElement{static register(){g.register({SlyShadow:r},{soft:!0})}connectedCallback(){this.hasAttribute("view")||this.setAttribute("view","")}};var Tt=class{render;count=0;rendered=rt();constructor(t){this.render=t}doneRender(){this.count++,this.rendered.resolve(),this.rendered=rt()}},O=class extends Tt{host;shadow;constructor(t,e,o){super(t),this.host=e,this.shadow=o}};var ee=class{#t=[];get scope(){let t=this.#t.at(-1);if(!t)throw new Error("hooks must be called within a render fn");return t}increment(){let t=this.scope,e=t.position++;return{scope:t,position:e}}wrap(t,e){t.position=0,this.#t.push(t);try{return e()}finally{this.#t.pop()}}},$=globalThis[Symbol.for("e280.hooks")]??=new ee;var z=class{#t=[];clear(){this.#t.forEach(t=>t()),this.#t=[]}observe(t,e){let{seen:o,value:s}=p.observe(t);this.clear();for(let n of o){let i=p.subscribe(n,e);this.#t.push(i)}return s}};var Pt=class{#t=[];#e=[];mount(t){this.#t.push(t),this.#e.push(t())}unmountAll(){for(let t of this.#e)t();this.#e=[]}remountAll(){for(let t of this.#t)this.#e.push(t())}};var q=class{cx;position=0;values=new Map;mounts=new Pt;constructor(t){this.cx=t}};var{I:Xi}=$e;var We=r=>r.strings===void 0;var Ie={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},Rt=r=>(...t)=>({_$litDirective$:r,values:t}),Ot=class{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,o){this._$Ct=t,this._$AM=e,this._$Ci=o}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}};var ot=(r,t)=>{let e=r._$AN;if(e===void 0)return!1;for(let o of e)o._$AO?.(t,!1),ot(o,t);return!0},Nt=r=>{let t,e;do{if((t=r._$AM)===void 0)break;e=t._$AN,e.delete(r),r=t}while(e?.size===0)},Ge=r=>{for(let t;t=r._$AM;r=t){let e=t._$AN;if(e===void 0)t._$AN=e=new Set;else if(e.has(r))break;e.add(r),Pr(t)}};function Mr(r){this._$AN!==void 0?(Nt(this),this._$AM=r,Ge(this)):this._$AM=r}function Tr(r,t=!1,e=0){let o=this._$AH,s=this._$AN;if(s!==void 0&&s.size!==0)if(t)if(Array.isArray(o))for(let n=e;n<o.length;n++)ot(o[n],!1),Nt(o[n]);else o!=null&&(ot(o,!1),Nt(o));else ot(this,r)}var Pr=r=>{r.type==Ie.CHILD&&(r._$AP??=Tr,r._$AQ??=Mr)},st=class extends Ot{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,e,o){super._$AT(t,e,o),Ge(this),this.isConnected=t._$AU}_$AO(t,e=!0){t!==this.isConnected&&(this.isConnected=t,t?this.reconnected?.():this.disconnected?.()),e&&(ot(this,t),Nt(this))}setValue(t){if(We(this._$Ct))this._$Ct._$AI(t,this);else{let e=[...this._$Ct._$AH];e[this._$Ci]=t,this._$Ct._$AI(e,this,0)}}disconnected(){}reconnected(){}};function Ve(r){return class extends HTMLElement{#t;#e;#r=new z;#s=this.attachShadow({mode:"open"});constructor(){super();let t=Ct(()=>{if(!this.isConnected)return;let e=this.#o();m(e,this.#t.shadow),this.#t.doneRender()});this.#t=new O(t,this,this.#s),this.#e=new q(this.#t)}#o(){return this.#r.observe(()=>$.wrap(this.#e,()=>r()),this.#t.render)}render(){m(this.#o(),this.#t.shadow),this.#t.doneRender()}connectedCallback(){this.#e.mounts.remountAll(),this.#t.render()}disconnectedCallback(){this.#e.mounts.unmountAll(),this.#r.clear()}}}function x(r){let{scope:t,position:e}=$.increment();return ze(t.values,e,r)}function nt(){return $.increment().scope.cx}function Ht(){let r=nt();if(!(r instanceof O))throw new Error("this hook only works on shadow views (but was called in a light view)");return r}function re(){return Ht().host}function M(r){let{scope:t}=$.increment();return x(()=>t.mounts.mount(r))}function Je(){return Ht().shadow}function Ke(r,t){ut(r,Rr(t))}function Rr(r){let t=[];if(Array.isArray(r)){let e=new Set(r.flat(1/0).reverse());for(let o of e)t.unshift(B(o))}else r!==void 0&&t.push(B(r));return t}function Lt(...r){let t=Je();x(()=>Ke(t,r))}function Dt(r=""){let t=re();x(()=>t.setAttribute("view",r))}function Ze(r){return x(()=>P(r))}var Ut=Lt;function Ye(r,t){for(let[e,o]of Object.entries(t))Hr(r,e,o)}function Hr(r,t,e){let o=r.getAttribute(t),s=Lr(e);s!==o&&(s===null?r.removeAttribute(t):r.setAttribute(t,s))}function Lr(r){return typeof r=="string"?r:typeof r=="number"?r.toString():r?"":null}function Dr(){Mt.register();let r=document.createElement("sly-shadow"),t=r.attachShadow({mode:"open"});return{host:r,shadow:t}}function it(r){return Xe(Dr,r)}it.setup=r=>(t=>Xe(r,t));function Xe(r,t){let e=Rt(class extends st{#t;#e;#r;#s=new z;constructor(s){super(s);let{host:n,shadow:i}=r(),c=Ct(()=>{if(!this.#r)throw new Error("cannot render before props");if(!this.isConnected)return;let a=this.#o(this.#r);m(a,this.#t.shadow),this.#t.doneRender()});this.#t=new O(c,n,i),this.#e=new q(this.#t)}#o(s){return this.#r=s,this.#s.observe(()=>$.wrap(this.#e,()=>t(...this.#r)),this.#t.render)}render({props:s,children:n,attrs:i}){let{host:c}=this.#t;return this.isConnected&&(i&&Ye(c,i),m(n,this.#t.host),m(this.#o(s),this.#t.shadow),this.#t.doneRender()),c}disconnected(){m(null,this.#t.shadow),m(null,this.#t.host),this.#e.mounts.unmountAll(),this.#s.clear()}reconnected(){this.#e.mounts.remountAll(),this.#t.render()}});function o(...s){return e({props:s})}return o.with=e,o}function _(r,t){return()=>Ur({hz:r,frames:t})}var Ur=it(({hz:r,frames:t})=>{Dt("loading"),Ut(kt,jr);let e=Ze(0);return M(()=>qe(async()=>{await Be(1e3/r);let o=e()+1;e(o>=t.length?0:o)})),t.at(e())}),jr=E`
18
18
  :host {
19
19
  font-family: monospace;
20
20
  white-space: pre;
21
21
  user-select: none;
22
22
  }
23
- `;var v=it(r=>(zt("error"),qt(Pt,Lr),typeof r=="string"?r:r instanceof Error?j`<strong>${r.name}:</strong> <span>${r.message}</span>`:"error")),Lr=E`
23
+ `;var v=it(r=>(Dt("error"),Ut(kt,zr),typeof r=="string"?r:r instanceof Error?j`<strong>${r.name}:</strong> <span>${r.message}</span>`:"error")),zr=E`
24
24
  :host {
25
25
  font-family: monospace;
26
26
  color: red;
27
27
  }
28
- `;function S(r,t){return(e,o)=>Ue(e,{pending:r,err:t,ok:o})}var Up=S(_(10,[" "," ",". ",".. ","..."," .."," ."]),v);var Wp=S(_(3,["\u{1F30E}","\u{1F30F}","\u{1F30D}"]),v);var Jp=S(_(10,["\u{1F312}","\u{1F313}","\u{1F314}","\u{1F315}","\u{1F316}","\u{1F317}","\u{1F318}","\u{1F311}","\u{1F311}","\u{1F311}"]),v);var Xp=S(_(16,["|","/","-","\\"]),v);var su=S(_(20,[":....",":....","::...",".::..","..::.","...::","....:","....:","...::","..::.",".::..","::..."]),v);var Ze=E`
28
+ `;function S(r,t){return(e,o)=>je(e,{pending:r,err:t,ok:o})}var Vp=S(_(10,[" "," ",". ",".. ","..."," .."," ."]),v);var Qp=S(_(3,["\u{1F30E}","\u{1F30F}","\u{1F30D}"]),v);var ru=S(_(10,["\u{1F312}","\u{1F313}","\u{1F314}","\u{1F315}","\u{1F316}","\u{1F317}","\u{1F318}","\u{1F311}","\u{1F311}","\u{1F311}"]),v);var au=S(_(16,["|","/","-","\\"]),v);var hu=S(_(20,[":....",":....","::...",".::..","..::.","...::","....:","....:","...::","..::.",".::..","::..."]),v);var tr=E`
29
29
 
30
30
  * {
31
31
  padding: 0;
@@ -94,7 +94,7 @@ var er=Object.defineProperty;var rr=(r,t)=>{for(var e in t)er(r,e,{get:t[e],enum
94
94
  }
95
95
  }
96
96
 
97
- `;var Bt=class{get;constructor(t){this.get=t}get gamepad(){return this.get()}};function Qe(r,t){let e=r;return()=>{let o=t();return o!=null&&(e=o),e}}function Ye(r){let t=new Map;function e(){o(),s()}function o(){for(let i of navigator.getGamepads())if(i?.connected&&!t.has(i.index)){let c=()=>navigator.getGamepads()[i.index],a=new Bt(Qe(i,c)),u=r(a);t.set(i.index,{pad:a,dispose:u})}}function s(){for(let[i,{pad:c,dispose:a}]of t)navigator.getGamepads()[c.gamepad.index]?.connected||(a(),t.delete(i))}e();let n=Te(window,{gamepadconnected:e,gamepaddisconnected:e});return()=>{n();for(let{dispose:i}of t.values())i();t.clear()}}var Wt=class extends Map{constructor(t){if(super(),t)for(let[e,o]of t)this.set(e,o)}zero(){for(let t of this.keys())this.set(t,0);return this}merge([t,e]){let o=this.get(t)??0;return e>o&&this.set(t,e),this}};var It=class{on=Re();sampleMap=new Wt;setSample(t,e){return this.sampleMap.set(t,e),this.on.pub(t,e),this}zero(){for(let t of this.sampleMap.keys())this.setSample(t,0)}*samples(){yield*this.sampleMap}};function Xe(r){return r>=0?[r,0]:[0,Math.abs(r)]}var Gt=class extends It{pad;constructor(t){super(),this.pad=t}get gamepad(){return this.pad.gamepad}*samples(){this.#t(this.pad.gamepad),this.#e(this.pad.gamepad),yield*super.samples()}#t(t){let e=0;for(let[o,s]of t.buttons.entries()){let n=o+1,i=s.value;e=Math.max(e,i),this.setSample(`gamepad.button.${n}`,i)}this.setSample("gamepad.button.any",e)}#e(t){for(let[e,o]of t.axes.entries()){let s=e+1;this.setSample(`gamepad.axis.${s}`,o);let[n,i]=Xe(o);this.setSample(`gamepad.axis.${s}.neg`,n),this.setSample(`gamepad.axis.${s}.pos`,i)}}};var tr=Be(()=>{jt(Ze);let r=x(()=>new Mt);M(()=>Ye(e=>{let s={device:new Gt(e),samples:new kt};return r.add(s),()=>r.delete(s)})),M(()=>St(async()=>{for(let e of r)for(let[o,s]of e.device.samples())e.samples.set(o,s);await Et(1e3/60)}));let t=([e,o])=>j`
97
+ `;var jt=class{get;constructor(t){this.get=t}get gamepad(){return this.get()}};function er(r,t){let e=r;return()=>{let o=t();return o!=null&&(e=o),e}}function rr(r){let t=new Map;function e(){o(),s()}function o(){for(let i of navigator.getGamepads())if(i?.connected&&!t.has(i.index)){let c=()=>navigator.getGamepads()[i.index],a=new jt(er(i,c)),u=r(a);t.set(i.index,{pad:a,dispose:u})}}function s(){for(let[i,{pad:c,dispose:a}]of t)navigator.getGamepads()[c.gamepad.index]?.connected||(a(),t.delete(i))}e();let n=Oe(window,{gamepadconnected:e,gamepaddisconnected:e});return()=>{n();for(let{dispose:i}of t.values())i();t.clear()}}var zt=class extends Map{constructor(t){if(super(),t)for(let[e,o]of t)this.set(e,o)}zero(){for(let t of this.keys())this.set(t,0);return this}merge([t,e]){let o=this.get(t)??0;return e>o&&this.set(t,e),this}};var qt=class{on=Ne();sampleMap=new zt;setSample(t,e){return this.sampleMap.set(t,e),this.on.pub(t,e),this}zero(){for(let t of this.sampleMap.keys())this.setSample(t,0)}*samples(){yield*this.sampleMap}};function or(r){return r>=0?[r,0]:[0,Math.abs(r)]}var Bt=class extends qt{pad;constructor(t){super(),this.pad=t}get gamepad(){return this.pad.gamepad}*samples(){this.#t(this.pad.gamepad),this.#e(this.pad.gamepad),yield*super.samples()}#t(t){let e=0;for(let[o,s]of t.buttons.entries()){let n=o+1,i=s.value;e=Math.max(e,i),this.setSample(`gamepad.button.${n}`,i)}this.setSample("gamepad.button.any",e)}#e(t){for(let[e,o]of t.axes.entries()){let s=e+1;this.setSample(`gamepad.axis.${s}`,o);let[n,i]=or(o);this.setSample(`gamepad.axis.${s}.neg`,n),this.setSample(`gamepad.axis.${s}.pos`,i)}}};var sr=Ve(()=>{Lt(tr);let r=x(()=>new St);M(()=>rr(e=>{let s={device:new Bt(e),samples:new vt};return r.add(s),()=>r.delete(s)})),M(()=>Pe(async()=>{for(let e of r)for(let[o,s]of e.device.samples())e.samples.set(o,s);await Re(1e3/60)}));let t=([e,o])=>j`
98
98
  <li style="${`--percent: ${o*100}%;`}">
99
99
  <span>${e}</span>
100
100
  <span>${o.toFixed(3)}</span>
@@ -121,6 +121,6 @@ var er=Object.defineProperty;var rr=(r,t)=>{for(var e in t)er(r,e,{get:t[e],enum
121
121
  <h2>no gamepads detected :(</h2>
122
122
  `}
123
123
  </div>
124
- `});g.register({GamepadApp:tr});
124
+ `});g.register({GamepadApp:sr});
125
125
  /*! For license information please see main.bundle.min.js.LEGAL.txt */
126
126
  //# sourceMappingURL=main.bundle.min.js.map