@benev/tact 0.4.0-1 → 0.4.0-3

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.
@@ -1,6 +1,6 @@
1
- var _s=Object.defineProperty;var Cs=(r,t)=>{for(var e in t)_s(r,e,{get:t[e],enumerable:!0})};function Pr(r){return r.replace(/([a-zA-Z])(?=[A-Z])/g,"$1-").toLowerCase()}function te(r,t={}){let{soft:e=!1,upgrade:o=!0}=t;for(let[s,n]of Object.entries(r)){let i=Pr(s),a=customElements.get(i);e&&a||(customElements.define(i,n),o&&document.querySelectorAll(i).forEach(c=>{c.constructor===HTMLElement&&customElements.upgrade(c)}))}}var ee=globalThis,re=ee.ShadowRoot&&(ee.ShadyCSS===void 0||ee.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,or=Symbol(),zr=new WeakMap,Bt=class{constructor(t,e,o){if(this._$cssResult$=!0,o!==or)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(re&&t===void 0){let o=e!==void 0&&e.length===1;o&&(t=zr.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),o&&zr.set(e,t))}return t}toString(){return this.cssText}},Or=r=>new Bt(typeof r=="string"?r:r+"",void 0,or),b=(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 Bt(e,r,or)},oe=(r,t)=>{if(re)r.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of t){let o=document.createElement("style"),s=ee.litNonce;s!==void 0&&o.setAttribute("nonce",s),o.textContent=e.cssText,r.appendChild(o)}},pt=re?r=>r:r=>r instanceof CSSStyleSheet?(t=>{let e="";for(let o of t.cssRules)e+=o.cssText;return Or(e)})(r):r;var{is:Es,defineProperty:Ms,getOwnPropertyDescriptor:Ps,getOwnPropertyNames:zs,getOwnPropertySymbols:Os,getPrototypeOf:Ts}=Object,se=globalThis,Tr=se.trustedTypes,Bs=Tr?Tr.emptyScript:"",js=se.reactiveElementPolyfillSupport,jt=(r,t)=>r,sr={toAttribute(r,t){switch(t){case Boolean:r=r?Bs: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}},jr=(r,t)=>!Es(r,t),Br={attribute:!0,type:String,converter:sr,reflect:!1,useDefault:!1,hasChanged:jr};Symbol.metadata??=Symbol("metadata"),se.litPropertyMetadata??=new WeakMap;var N=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=Br){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&&Ms(this.prototype,t,s)}}static getPropertyDescriptor(t,e,o){let{get:s,set:n}=Ps(this.prototype,t)??{get(){return this[e]},set(i){this[e]=i}};return{get:s,set(i){let a=s?.call(this);n?.call(this,i),this.requestUpdate(t,a,o)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??Br}static _$Ei(){if(this.hasOwnProperty(jt("elementProperties")))return;let t=Ts(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(jt("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(jt("properties"))){let e=this.properties,o=[...zs(e),...Os(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(pt(s))}else t!==void 0&&e.push(pt(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 oe(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:sr).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:sr;this._$Em=s;let a=i.fromAttribute(e,n.type);this[s]=a??this._$Ej?.get(s)??a,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??jr)(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,a=this[s];i!==!0||this._$AL.has(s)||a===void 0||this.C(s,void 0,n,a)}}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){}};N.elementStyles=[],N.shadowRootOptions={mode:"open"},N[jt("elementProperties")]=new Map,N[jt("finalized")]=new Map,js?.({ReactiveElement:N}),(se.reactiveElementVersions??=[]).push("2.1.2");var ir=globalThis,Dr=r=>r,ne=ir.trustedTypes,Rr=ne?ne.createPolicy("lit-html",{createHTML:r=>r}):void 0,ar="$lit$",I=`lit$${Math.random().toFixed(9).slice(2)}$`,cr="?"+I,Ds=`<${cr}>`,tt=document,Rt=()=>tt.createComment(""),Lt=r=>r===null||typeof r!="object"&&typeof r!="function",lr=Array.isArray,Ur=r=>lr(r)||typeof r?.[Symbol.iterator]=="function",nr=`[
2
- \f\r]`,Dt=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Lr=/-->/g,Nr=/>/g,X=RegExp(`>|${nr}(?:([^\\s"'>=/]+)(${nr}*=${nr}*(?:[^
3
- \f\r"'\`<>=]|("|')|))|$)`,"g"),Ir=/'/g,Hr=/"/g,qr=/^(?:script|style|textarea|title)$/i,ur=r=>(t,...e)=>({_$litType$:r,strings:t,values:e}),h=ur(1),f=ur(2),On=ur(3),et=Symbol.for("lit-noChange"),w=Symbol.for("lit-nothing"),Vr=new WeakMap,Y=tt.createTreeWalker(tt,129);function Wr(r,t){if(!lr(r)||!r.hasOwnProperty("raw"))throw Error("invalid template strings array");return Rr!==void 0?Rr.createHTML(t):t}var Fr=(r,t)=>{let e=r.length-1,o=[],s,n=t===2?"<svg>":t===3?"<math>":"",i=Dt;for(let a=0;a<e;a++){let c=r[a],l,p,u=-1,m=0;for(;m<c.length&&(i.lastIndex=m,p=i.exec(c),p!==null);)m=i.lastIndex,i===Dt?p[1]==="!--"?i=Lr:p[1]!==void 0?i=Nr:p[2]!==void 0?(qr.test(p[2])&&(s=RegExp("</"+p[2],"g")),i=X):p[3]!==void 0&&(i=X):i===X?p[0]===">"?(i=s??Dt,u=-1):p[1]===void 0?u=-2:(u=i.lastIndex-p[2].length,l=p[1],i=p[3]===void 0?X:p[3]==='"'?Hr:Ir):i===Hr||i===Ir?i=X:i===Lr||i===Nr?i=Dt:(i=X,s=void 0);let _=i===X&&r[a+1].startsWith("/>")?" ":"";n+=i===Dt?c+Ds:u>=0?(o.push(l),c.slice(0,u)+ar+c.slice(u)+I+_):c+I+(u===-2?a:_)}return[Wr(r,n+(r[e]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),o]},Nt=class r{constructor({strings:t,_$litType$:e},o){let s;this.parts=[];let n=0,i=0,a=t.length-1,c=this.parts,[l,p]=Fr(t,e);if(this.el=r.createElement(l,o),Y.currentNode=this.el.content,e===2||e===3){let u=this.el.content.firstChild;u.replaceWith(...u.childNodes)}for(;(s=Y.nextNode())!==null&&c.length<a;){if(s.nodeType===1){if(s.hasAttributes())for(let u of s.getAttributeNames())if(u.endsWith(ar)){let m=p[i++],_=s.getAttribute(u).split(I),Q=/([.?@])?(.*)/.exec(m);c.push({type:1,index:n,name:Q[2],strings:_,ctor:Q[1]==="."?ae:Q[1]==="?"?ce:Q[1]==="@"?le:ot}),s.removeAttribute(u)}else u.startsWith(I)&&(c.push({type:6,index:n}),s.removeAttribute(u));if(qr.test(s.tagName)){let u=s.textContent.split(I),m=u.length-1;if(m>0){s.textContent=ne?ne.emptyScript:"";for(let _=0;_<m;_++)s.append(u[_],Rt()),Y.nextNode(),c.push({type:2,index:++n});s.append(u[m],Rt())}}}else if(s.nodeType===8)if(s.data===cr)c.push({type:2,index:n});else{let u=-1;for(;(u=s.data.indexOf(I,u+1))!==-1;)c.push({type:7,index:n}),u+=I.length-1}n++}}static createElement(t,e){let o=tt.createElement("template");return o.innerHTML=t,o}};function rt(r,t,e=r,o){if(t===et)return t;let s=o!==void 0?e._$Co?.[o]:e._$Cl,n=Lt(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=rt(r,s._$AS(r,t.values),s,o)),t}var ie=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??tt).importNode(e,!0);Y.currentNode=s;let n=Y.nextNode(),i=0,a=0,c=o[0];for(;c!==void 0;){if(i===c.index){let l;c.type===2?l=new ht(n,n.nextSibling,this,t):c.type===1?l=new c.ctor(n,c.name,c.strings,this,t):c.type===6&&(l=new ue(n,this,t)),this._$AV.push(l),c=o[++a]}i!==c?.index&&(n=Y.nextNode(),i++)}return Y.currentNode=tt,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++}},ht=class r{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,o,s){this.type=2,this._$AH=w,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=rt(this,t,e),Lt(t)?t===w||t==null||t===""?(this._$AH!==w&&this._$AR(),this._$AH=w):t!==this._$AH&&t!==et&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):Ur(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!==w&&Lt(this._$AH)?this._$AA.nextSibling.data=t:this.T(tt.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=Nt.createElement(Wr(o.h,o.h[0]),this.options)),o);if(this._$AH?._$AD===s)this._$AH.p(e);else{let n=new ie(s,this),i=n.u(this.options);n.p(e),this.T(i),this._$AH=n}}_$AC(t){let e=Vr.get(t.strings);return e===void 0&&Vr.set(t.strings,e=new Nt(t)),e}k(t){lr(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(Rt()),this.O(Rt()),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=Dr(t).nextSibling;Dr(t).remove(),t=o}}setConnected(t){this._$AM===void 0&&(this._$Cv=t,this._$AP?.(t))}},ot=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,o,s,n){this.type=1,this._$AH=w,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=w}_$AI(t,e=this,o,s){let n=this.strings,i=!1;if(n===void 0)t=rt(this,t,e,0),i=!Lt(t)||t!==this._$AH&&t!==et,i&&(this._$AH=t);else{let a=t,c,l;for(t=n[0],c=0;c<n.length-1;c++)l=rt(this,a[o+c],e,c),l===et&&(l=this._$AH[c]),i||=!Lt(l)||l!==this._$AH[c],l===w?t=w:t!==w&&(t+=(l??"")+n[c+1]),this._$AH[c]=l}i&&!s&&this.j(t)}j(t){t===w?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}},ae=class extends ot{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===w?void 0:t}},ce=class extends ot{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==w)}},le=class extends ot{constructor(t,e,o,s,n){super(t,e,o,s,n),this.type=5}_$AI(t,e=this){if((t=rt(this,t,e,0)??w)===et)return;let o=this._$AH,s=t===w&&o!==w||t.capture!==o.capture||t.once!==o.once||t.passive!==o.passive,n=t!==w&&(o===w||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)}},ue=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){rt(this,t)}},Gr={M:ar,P:I,A:cr,C:1,L:Fr,R:ie,D:Ur,V:rt,I:ht,H:ot,N:ce,U:le,B:ae,F:ue},Rs=ir.litHtmlPolyfillSupport;Rs?.(Nt,ht),(ir.litHtmlVersions??=[]).push("3.3.3");var x=(r,t,e)=>{let o=e?.renderBefore??t,s=o._$litPart$;if(s===void 0){let n=e?.renderBefore??null;o._$litPart$=s=new ht(t.insertBefore(Rt(),n),n,void 0,e??{})}return s._$AI(r),s};var pr=globalThis,dt=class extends N{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=x(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return et}};dt._$litElement$=!0,dt.finalized=!0,pr.litElementHydrateSupport?.({LitElement:dt});var Ls=pr.litElementPolyfillSupport;Ls?.({LitElement:dt});(pr.litElementVersions??=[]).push("4.2.2");var P={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},$={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)$.any(r,e,o)},record:(r,t)=>$.entries(r,Object.entries(t))};function Kr(r,t={}){let e=document.createElement(r);return $.record(e,t),e}function Jr(r){let t=document.createDocumentFragment();return x(r,t),t.firstElementChild}function pe(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 Zr(r,t){let e=new MutationObserver(t);return e.observe(r,{attributes:!0}),()=>e.disconnect()}var he=class{element;constructor(t){this.element=t}strings=new Proxy({},{get:(t,e)=>P.string(this.element,e),set:(t,e,o)=>$.string(this.element,e,o)});numbers=new Proxy({},{get:(t,e)=>P.number(this.element,e),set:(t,e,o)=>$.number(this.element,e,o)});booleans=new Proxy({},{get:(t,e)=>P.boolean(this.element,e),set:(t,e,o)=>$.boolean(this.element,e,o)})};var Qr=(r,t,e={})=>new Proxy(t,{get:(o,s)=>{switch(t[s]){case String:return P.string(r,s);case Number:return P.number(r,s);case Boolean:return P.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 $.string(r,s,n);case Number:return $.number(r,s,n);case Boolean:return $.boolean(r,s,n);default:throw new Error(`invalid attribute type for "${s}"`)}}finally{e.afterSet?.(s)}}});function mt(r){let t=new he(r);return{strings:t.strings,numbers:t.numbers,booleans:t.booleans,on:e=>Zr(r,e),spec:(e,o={})=>Qr(r,e,o)}}mt.get=P;mt.set=$;function Xr(r){return new hr(r)}var hr=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 $.entries(t,this.#t),t.append(...this.#e),t}};function ft(r,t=document){let e=t.querySelector(r);if(!e)throw new Error(`element not found (${r})`);return e}function de(r,t=document){return t.querySelector(r)}function me(r,t=document){return Array.from(t.querySelectorAll(r))}var fe=class r{element;#t;constructor(t){this.element=t}in(t){return new r(typeof t=="string"?ft(t,this.element):t)}require(t){return ft(t,this.element)}maybe(t){return de(t,this.element)}all(t){return me(t,this.element)}render(...t){return x(t,this.element)}get attrs(){return this.#t??=mt(this.element)}events(t){return pe(this.element,t)}};function g(r,t=document){return ft(r,t)}g.in=(r,t=document)=>new fe(t).in(r);g.need=ft;g.maybe=de;g.all=me;g.el=Kr;g.elmer=Xr;g.mk=Jr;g.events=pe;g.attrs=mt;g.register=te;g.render=(r,...t)=>x(t,r);var $e={};Cs($e,{DragAndDrops:()=>xr,Drops:()=>yr,files:()=>Gs,hasFiles:()=>Fs,outsideCurrentTarget:()=>qt});var Yr=Object.freeze({eq(r,t){if(r.length!==t.length)return!1;let e=0;for(let o=0;o<r.length;o++)e|=r[o]^t[o];return e===0},random(r){return crypto.getRandomValues(new Uint8Array(r))},concat(r){let t=0;for(let s of r)t+=s.byteLength;let e=new Uint8Array(t),o=0;for(let s of r)e.set(s,o),o+=s.byteLength;return e}});var v=class{lexicon;static lexicons=Object.freeze({base2:{characters:"01"},hex:{characters:"0123456789abcdef",caseInsensitive:!0},base36:{characters:"0123456789abcdefghijklmnopqrstuvwxyz"},base58:{characters:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"},base62:{characters:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"},base64url:{negativePrefix:"~",characters:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"},base64:{characters:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",padding:{character:"=",size:4}}});lookup;negativePrefix;constructor(t){this.lexicon=t,this.lookup=Object.fromEntries([...t.characters].map((o,s)=>[o,s])),this.negativePrefix=t.negativePrefix??"-";let e=this.fromBytes.bind(this);return Object.setPrototypeOf(e,new.target.prototype),Object.assign(e,this),e}toBytes(t){this.lexicon.caseInsensitive&&(t=t.toLowerCase());let e=Math.log2(this.lexicon.characters.length);if(Number.isInteger(e)){let l=0,p=0,u=[];for(let m of t){if(m===this.lexicon.padding?.character)continue;let _=this.lookup[m];if(_===void 0)throw new Error(`Invalid character: ${m}`);for(l=l<<e|_,p+=e;p>=8;)p-=8,u.push(l>>p&255)}return new Uint8Array(u)}let o=0n,s=BigInt(this.lexicon.characters.length);t.startsWith(this.negativePrefix)&&(t=t.slice(this.negativePrefix.length));let n=this.lexicon.characters[0],i=0;for(;t[i]===n;)i++;t=t.slice(i);for(let l of t){let p=this.lookup[l];if(p===void 0)throw new Error(`Invalid character: ${l}`);o=o*s+BigInt(p)}let a=new Uint8Array(i+(o===0n?0:this.countBytes(o))),c=a.length;for(;o>0n;)a[--c]=Number(o%256n),o=o/256n;return a}fromBytes(t){let e=Math.log2(this.lexicon.characters.length);if(Number.isInteger(e)){let c=0,l=0,p="";for(let u of t)for(c=c<<8|u,l+=8;l>=e;){l-=e;let m=c>>l&(1<<e)-1;p+=this.lexicon.characters[m]}if(l>0){let u=c<<e-l&(1<<e)-1;p+=this.lexicon.characters[u]}if(this.lexicon.padding)for(;p.length%this.lexicon.padding.size!==0;)p+=this.lexicon.padding.character;return p}if(t.length===0)return"";let o=this.lexicon.characters[0],s=0;for(;t[s]===0;)s++;let n=0n;for(let c of t.slice(s))n=(n<<8n)+BigInt(c);if(n===0n)return o.repeat(s);let i=BigInt(this.lexicon.characters.length),a="";for(;n>0n;)a=this.lexicon.characters[Number(n%i)]+a,n=n/i;return o.repeat(s)+a}toInteger(t){if(!t)return 0;let e=0n,o=!1,s=BigInt(this.lexicon.characters.length);t.startsWith(this.negativePrefix)&&(t=t.slice(this.negativePrefix.length),o=!0);for(let n of t){let i=this.lookup[n];if(i===void 0)throw new Error(`Invalid character: ${n}`);e=e*s+BigInt(i)}return Number(o?-e:e)}fromInteger(t){t=Math.floor(t);let e=t<0,o=BigInt(e?-t:t);if(o===0n)return this.lexicon.characters[0];let s=BigInt(this.lexicon.characters.length),n="";for(;o>0n;)n=this.lexicon.characters[Number(o%s)]+n,o=o/s;return e?`${this.negativePrefix}${n}`:n}random(t=32){return this.fromBytes(Yr.random(t))}countBytes(t){let e=0;for(;t>0n;)e++,t=t/256n;return e}};var ge=new v(v.lexicons.hex),Li=new v(v.lexicons.base2),Ni=new v(v.lexicons.base36),Ii=new v(v.lexicons.base58),Hi=new v(v.lexicons.base62),Vi=new v(v.lexicons.base64),Ui=new v(v.lexicons.base64url);function to(r,t){let e,o,s=[];function n(){e=[],o&&clearTimeout(o),o=void 0,s=[]}return n(),((...i)=>{e=i,o&&clearTimeout(o);let a=new Promise((c,l)=>{s.push({resolve:c,reject:l})});return o=setTimeout(()=>{Promise.resolve().then(()=>t(...e)).then(c=>{for(let{resolve:l}of s)l(c);n()}).catch(c=>{for(let{reject:l}of s)l(c);n()})},r),a})}function st(){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}function gt(r){let t=null;return((...e)=>(t?t.params=e:(t={params:e,deferred:st()},queueMicrotask(()=>{let{params:o,deferred:s}=t;t=null,Promise.resolve(r(...o)).then(s.resolve).catch(s.reject)})),t.deferred.promise))}function z(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=>z(o,new Set(t))):r.constructor===Object?e=Object.fromEntries(Object.entries(r).map(([o,s])=>[o,z(s,new Set(t))])):r instanceof Map?e=new Map(Array.from(r,([o,s])=>[o,z(s,new Set(t))])):r instanceof Set?e=new Set(Array.from(r,o=>z(o,new Set(t)))):r instanceof Date?e=new Date(r.getTime()):e=r,t.delete(r)):e=r,e}function C(r){return r!=null}var bt=r=>typeof r=="number",xt=r=>typeof r=="string";var It=r=>typeof r=="object"&&r!==null,be=r=>Array.isArray(r);function Ns(r){return r!=null}function Is(r){return r==null}var Zi=Object.freeze({happy:Ns,sad:Is,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 eo=(r,t)=>{function e(o,s,n){if(!It(o)||!It(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[a,c]of o)if(!s.has(a)||!e(c,s.get(a),i))return!1}else if(o instanceof Set&&s instanceof Set){if(o.size!==s.size)return!1;for(let a of o)if(!Array.from(s).some(c=>e(a,c,i)))return!1}else{let a=Object.keys(o),c=Object.keys(s);if(a.length!==c.length)return!1;for(let l of a)if(!c.includes(l)||!e(o[l],s[l],i))return!1}return!0}return e(r,t,[])};function nt(r){function t(e,o){if(!It(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 ro(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 oo(r){if(r.ok)throw new Error("didn't get needed error");return r.error}var Hs=new TextEncoder;function dr(r){return r=Math.imul(r^r>>>15,r|1),r^=r+Math.imul(r^r>>>7,r|61),r^=r>>>14,r>>>0}function Vs(r){let t=2166136261;for(let e of Hs.encode(r))t^=e,t=Math.imul(t,16777619);return dr(t)}function so(...r){let t=2654435769;for(let e of r){let o=typeof e=="string"?Vs(e):e>>>0;t=t+1831565813>>>0,t^=dr(o),t=dr(t)}return t}function k(r,t="got failed"){if(r==null)throw new Error(t);return r}function yt(r,t,e){if(r.has(t))return r.get(t);{let o=e();return r.set(t,o),o}}function Ht(r,t){for(let[e,o]of t)r.set(e,o);return r}function xe(r,t){return t<=0?[]:r.length>t?r.slice(-t):r}async function mr(r){let t=[];for await(let e of r)t.push(e);return t}function wt(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 V(){let r=[],t=()=>{let o=r;r=[];for(let s=o.length-1;s>=0;s--)o[s]()};function e(){t()}return e.dispose=t,e.schedule=(...o)=>(r.push(...o),e),e.own=(o,s)=>(r.push(()=>s(o)),o),e.disposable=o=>(r.push(()=>o.dispose()),o),e.disposables=e.disposable,e}function E(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 vt=class{count;constructor(t=0){this.count=t}next(){return this.count++}};var $t=(r=0)=>new Promise(t=>setTimeout(t,r));var fr=(r,t)=>Object.fromEntries(Object.entries(r).map(([e,o])=>[e,t(o,e)])),Us=(r,t)=>Object.fromEntries(Object.entries(r).filter(([e,o])=>t(o,e)));function qs(r){return{map:t=>no(r,t),filter:t=>io(r,t)}}qs.pipe=Object.freeze({map:r=>(t=>no(t,r)),filter:r=>(t=>io(t,r))});var no=fr,io=Us;function U(r){let t=Ws(),e=o=>t.on(o);return Object.assign(e,t),r&&t.on(r),e}function Ws(){let r=new Set,t,e=()=>t??=st(),o=a=>{let c=t;t=void 0,c?.resolve(a)};return{set:r,on:a=>(r.add(a),()=>{r.delete(a)}),publish:(...a)=>{o(a);for(let c of[...r])c(...a)},publishAsync:async(...a)=>{o(a),await Promise.all([...r].map(async c=>c(...a)))},next:e}}function q(r,...t){let e=r.length-1;return r.slice(0,e).reduce((o,s,n)=>o+s+t[n],"")+r[e]}function kt(r,t,e){return r?t():e?.()}function ye(r,t,e){return C(r)?t(r):e?.()}var we=class{#t=new Set;#e=[];#o=new WeakMap;#r=0;#s=new Set;read(t){this.#e.at(-1)?.add(t)}write(t){let e=this.#o.get(t);if(e){for(let o of e)this.#s.add(o);this.#r===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=yt(this.#o,t,()=>new Set);return o.add(e),()=>{o.delete(e),o.size===0&&this.#o.delete(t)}}batch=t=>{this.#r++;try{return t()}finally{this.#r--,this.#r===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.#s.size>0;){let t=[...this.#s];this.#s.clear();for(let e of t)this.#i(e)}}};var d=globalThis[Symbol.for("e280.tracker.2")]??=new we;function S(r){let t;function e(){return arguments.length===0?(d.read(e),r):(r=arguments[0],d.write(e),t?.publish(r),r)}return e.get=()=>e(),e.set=o=>e(o),e.on=o=>(t??=U())(o),e}var O=class extends Map{get size(){return d.read(this),super.size}[Symbol.iterator](){return d.read(this),super[Symbol.iterator]()}forEach(t){d.read(this);for(let[e,o]of this)t(o,e,this);return this}keys(){return d.read(this),super.keys()}values(){return d.read(this),super.values()}entries(){return d.read(this),super.entries()}has(t){return d.read(this),super.has(t)}get(t){return d.read(this),super.get(t)}set(t,e){return super.set(t,e),d.write(this),this}delete(t){let e=super.delete(t);return d.write(this),e}clear(){return super.clear(),d.write(this),this}};var Vt=class extends Set{get size(){return d.read(this),super.size}[Symbol.iterator](){return d.read(this),super[Symbol.iterator]()}forEach(t){d.read(this);for(let e of this)t(e,e,this);return this}values(){return d.read(this),super.values()}has(t){return d.read(this),super.has(t)}add(t){return super.add(t),d.write(this),this}delete(t){let e=super.delete(t);return d.write(this),e}clear(){return super.clear(),d.write(this),this}};var Fa=d.batch;function co(r){return nt(z(r))}var T=Symbol("optic");var Ut=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 ve=class r{[T];#t;#e;#o;#r=U();constructor(t){this[T]=t,this.#t=z(t.getState()),this.#e=new Ut(()=>z(t.getState())),this.#o=new Ut(()=>co(t.getState()))}get on(){return this.#r.on}update(){let t=this[T].getState();!eo(t,this.#t)&&(this.#e.invalidate(),this.#o.invalidate(),this.#t=z(t),d.write(this),this.#r.set.size&&this.#r.publish(this.#e.get()))}get state(){return d.read(this),this.#e.get()}get frozen(){return d.read(this),this.#o.get()}mutate(t){return this[T].mutate(t)}lens(t){let e=new r({getState:()=>t(this[T].getState()),mutate:o=>this[T].mutate(s=>o(t(s))),registerLens:this[T].registerLens});return this[T].registerLens(e),e}};function lo(r){if(!r.done)throw new Error("wait not done");return ro(r)}function uo(r){if(!r.done)throw new Error("wait not done");return oo(r)}var po=r=>!r.done;var br=r=>r.done&&r.ok;function ho(r,t){let{pending:e=()=>{},ok:o=()=>{},err:s=()=>{}}=t;return po(r)?e():br(r)?o(lo(r)):s(uo(r))}function Fs(r){return!!(r.dataTransfer&&r.dataTransfer.types.includes("Files"))}function Gs(r){return r.dataTransfer?Array.from(r.dataTransfer.files):[]}function qt(r){let t=r.currentTarget,e=r.relatedTarget;return!t||!e||!t.contains(e)}var xr=class{params;$draggy=S(void 0);$droppy=S(void 0);constructor(t){this.params=t}get dragging(){return this.$draggy()}get hovering(){return this.$droppy()}dragzone=t=>({draggable:"true",dragstart:e=>{this.$draggy(t())},dragend:e=>{this.$draggy(void 0),this.$droppy(void 0)}});dropzone=t=>({dragenter:e=>{},dragover:e=>{e.preventDefault(),this.$draggy()?this.$droppy(t()):this.params.backchannelDrops?.dragover(e)},dragleave:e=>{qt(e)&&this.$droppy(void 0),this.params.backchannelDrops?.dragleave(e)},drop:e=>{e.preventDefault();let{acceptDrop:o}=this.params,s=this.$draggy(),n=this.$droppy();try{s&&n?o(e,s,n):this.params.backchannelDrops?.drop(e)}finally{this.$draggy(void 0),this.$droppy(void 0)}}})};var yr=class{params;$indicator=S(!1);constructor(t){this.params=t}dragover=t=>{t.preventDefault(),this.$indicator(this.params.predicate(t))};dragleave=t=>{qt(t)&&this.$indicator(!1)};drop=t=>{t.preventDefault(),this.$indicator(!1),this.params.predicate(t)&&this.params.acceptDrop(t)}};var St=b`
1
+ var _s=Object.defineProperty;var Cs=(r,t)=>{for(var e in t)_s(r,e,{get:t[e],enumerable:!0})};function Pr(r){return r.replace(/([a-zA-Z])(?=[A-Z])/g,"$1-").toLowerCase()}function te(r,t={}){let{soft:e=!1,upgrade:o=!0}=t;for(let[s,n]of Object.entries(r)){let i=Pr(s),a=customElements.get(i);e&&a||(customElements.define(i,n),o&&document.querySelectorAll(i).forEach(c=>{c.constructor===HTMLElement&&customElements.upgrade(c)}))}}var ee=globalThis,re=ee.ShadowRoot&&(ee.ShadyCSS===void 0||ee.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,or=Symbol(),zr=new WeakMap,Bt=class{constructor(t,e,o){if(this._$cssResult$=!0,o!==or)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(re&&t===void 0){let o=e!==void 0&&e.length===1;o&&(t=zr.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),o&&zr.set(e,t))}return t}toString(){return this.cssText}},Or=r=>new Bt(typeof r=="string"?r:r+"",void 0,or),b=(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 Bt(e,r,or)},oe=(r,t)=>{if(re)r.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of t){let o=document.createElement("style"),s=ee.litNonce;s!==void 0&&o.setAttribute("nonce",s),o.textContent=e.cssText,r.appendChild(o)}},pt=re?r=>r:r=>r instanceof CSSStyleSheet?(t=>{let e="";for(let o of t.cssRules)e+=o.cssText;return Or(e)})(r):r;var{is:Es,defineProperty:Ms,getOwnPropertyDescriptor:Ps,getOwnPropertyNames:zs,getOwnPropertySymbols:Os,getPrototypeOf:Ts}=Object,se=globalThis,Tr=se.trustedTypes,Bs=Tr?Tr.emptyScript:"",js=se.reactiveElementPolyfillSupport,jt=(r,t)=>r,sr={toAttribute(r,t){switch(t){case Boolean:r=r?Bs: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}},jr=(r,t)=>!Es(r,t),Br={attribute:!0,type:String,converter:sr,reflect:!1,useDefault:!1,hasChanged:jr};Symbol.metadata??=Symbol("metadata"),se.litPropertyMetadata??=new WeakMap;var N=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=Br){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&&Ms(this.prototype,t,s)}}static getPropertyDescriptor(t,e,o){let{get:s,set:n}=Ps(this.prototype,t)??{get(){return this[e]},set(i){this[e]=i}};return{get:s,set(i){let a=s?.call(this);n?.call(this,i),this.requestUpdate(t,a,o)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??Br}static _$Ei(){if(this.hasOwnProperty(jt("elementProperties")))return;let t=Ts(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(jt("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(jt("properties"))){let e=this.properties,o=[...zs(e),...Os(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(pt(s))}else t!==void 0&&e.push(pt(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 oe(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:sr).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:sr;this._$Em=s;let a=i.fromAttribute(e,n.type);this[s]=a??this._$Ej?.get(s)??a,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??jr)(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,a=this[s];i!==!0||this._$AL.has(s)||a===void 0||this.C(s,void 0,n,a)}}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){}};N.elementStyles=[],N.shadowRootOptions={mode:"open"},N[jt("elementProperties")]=new Map,N[jt("finalized")]=new Map,js?.({ReactiveElement:N}),(se.reactiveElementVersions??=[]).push("2.1.2");var ir=globalThis,Dr=r=>r,ne=ir.trustedTypes,Rr=ne?ne.createPolicy("lit-html",{createHTML:r=>r}):void 0,ar="$lit$",I=`lit$${Math.random().toFixed(9).slice(2)}$`,cr="?"+I,Ds=`<${cr}>`,et=document,Rt=()=>et.createComment(""),Lt=r=>r===null||typeof r!="object"&&typeof r!="function",lr=Array.isArray,Ur=r=>lr(r)||typeof r?.[Symbol.iterator]=="function",nr=`[
2
+ \f\r]`,Dt=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Lr=/-->/g,Nr=/>/g,Y=RegExp(`>|${nr}(?:([^\\s"'>=/]+)(${nr}*=${nr}*(?:[^
3
+ \f\r"'\`<>=]|("|')|))|$)`,"g"),Ir=/'/g,Hr=/"/g,qr=/^(?:script|style|textarea|title)$/i,ur=r=>(t,...e)=>({_$litType$:r,strings:t,values:e}),h=ur(1),f=ur(2),On=ur(3),rt=Symbol.for("lit-noChange"),w=Symbol.for("lit-nothing"),Vr=new WeakMap,tt=et.createTreeWalker(et,129);function Wr(r,t){if(!lr(r)||!r.hasOwnProperty("raw"))throw Error("invalid template strings array");return Rr!==void 0?Rr.createHTML(t):t}var Fr=(r,t)=>{let e=r.length-1,o=[],s,n=t===2?"<svg>":t===3?"<math>":"",i=Dt;for(let a=0;a<e;a++){let c=r[a],l,p,u=-1,m=0;for(;m<c.length&&(i.lastIndex=m,p=i.exec(c),p!==null);)m=i.lastIndex,i===Dt?p[1]==="!--"?i=Lr:p[1]!==void 0?i=Nr:p[2]!==void 0?(qr.test(p[2])&&(s=RegExp("</"+p[2],"g")),i=Y):p[3]!==void 0&&(i=Y):i===Y?p[0]===">"?(i=s??Dt,u=-1):p[1]===void 0?u=-2:(u=i.lastIndex-p[2].length,l=p[1],i=p[3]===void 0?Y:p[3]==='"'?Hr:Ir):i===Hr||i===Ir?i=Y:i===Lr||i===Nr?i=Dt:(i=Y,s=void 0);let _=i===Y&&r[a+1].startsWith("/>")?" ":"";n+=i===Dt?c+Ds:u>=0?(o.push(l),c.slice(0,u)+ar+c.slice(u)+I+_):c+I+(u===-2?a:_)}return[Wr(r,n+(r[e]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),o]},Nt=class r{constructor({strings:t,_$litType$:e},o){let s;this.parts=[];let n=0,i=0,a=t.length-1,c=this.parts,[l,p]=Fr(t,e);if(this.el=r.createElement(l,o),tt.currentNode=this.el.content,e===2||e===3){let u=this.el.content.firstChild;u.replaceWith(...u.childNodes)}for(;(s=tt.nextNode())!==null&&c.length<a;){if(s.nodeType===1){if(s.hasAttributes())for(let u of s.getAttributeNames())if(u.endsWith(ar)){let m=p[i++],_=s.getAttribute(u).split(I),X=/([.?@])?(.*)/.exec(m);c.push({type:1,index:n,name:X[2],strings:_,ctor:X[1]==="."?ae:X[1]==="?"?ce:X[1]==="@"?le:st}),s.removeAttribute(u)}else u.startsWith(I)&&(c.push({type:6,index:n}),s.removeAttribute(u));if(qr.test(s.tagName)){let u=s.textContent.split(I),m=u.length-1;if(m>0){s.textContent=ne?ne.emptyScript:"";for(let _=0;_<m;_++)s.append(u[_],Rt()),tt.nextNode(),c.push({type:2,index:++n});s.append(u[m],Rt())}}}else if(s.nodeType===8)if(s.data===cr)c.push({type:2,index:n});else{let u=-1;for(;(u=s.data.indexOf(I,u+1))!==-1;)c.push({type:7,index:n}),u+=I.length-1}n++}}static createElement(t,e){let o=et.createElement("template");return o.innerHTML=t,o}};function ot(r,t,e=r,o){if(t===rt)return t;let s=o!==void 0?e._$Co?.[o]:e._$Cl,n=Lt(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=ot(r,s._$AS(r,t.values),s,o)),t}var ie=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??et).importNode(e,!0);tt.currentNode=s;let n=tt.nextNode(),i=0,a=0,c=o[0];for(;c!==void 0;){if(i===c.index){let l;c.type===2?l=new ht(n,n.nextSibling,this,t):c.type===1?l=new c.ctor(n,c.name,c.strings,this,t):c.type===6&&(l=new ue(n,this,t)),this._$AV.push(l),c=o[++a]}i!==c?.index&&(n=tt.nextNode(),i++)}return tt.currentNode=et,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++}},ht=class r{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,o,s){this.type=2,this._$AH=w,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=ot(this,t,e),Lt(t)?t===w||t==null||t===""?(this._$AH!==w&&this._$AR(),this._$AH=w):t!==this._$AH&&t!==rt&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):Ur(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!==w&&Lt(this._$AH)?this._$AA.nextSibling.data=t:this.T(et.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=Nt.createElement(Wr(o.h,o.h[0]),this.options)),o);if(this._$AH?._$AD===s)this._$AH.p(e);else{let n=new ie(s,this),i=n.u(this.options);n.p(e),this.T(i),this._$AH=n}}_$AC(t){let e=Vr.get(t.strings);return e===void 0&&Vr.set(t.strings,e=new Nt(t)),e}k(t){lr(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(Rt()),this.O(Rt()),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=Dr(t).nextSibling;Dr(t).remove(),t=o}}setConnected(t){this._$AM===void 0&&(this._$Cv=t,this._$AP?.(t))}},st=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,o,s,n){this.type=1,this._$AH=w,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=w}_$AI(t,e=this,o,s){let n=this.strings,i=!1;if(n===void 0)t=ot(this,t,e,0),i=!Lt(t)||t!==this._$AH&&t!==rt,i&&(this._$AH=t);else{let a=t,c,l;for(t=n[0],c=0;c<n.length-1;c++)l=ot(this,a[o+c],e,c),l===rt&&(l=this._$AH[c]),i||=!Lt(l)||l!==this._$AH[c],l===w?t=w:t!==w&&(t+=(l??"")+n[c+1]),this._$AH[c]=l}i&&!s&&this.j(t)}j(t){t===w?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}},ae=class extends st{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===w?void 0:t}},ce=class extends st{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==w)}},le=class extends st{constructor(t,e,o,s,n){super(t,e,o,s,n),this.type=5}_$AI(t,e=this){if((t=ot(this,t,e,0)??w)===rt)return;let o=this._$AH,s=t===w&&o!==w||t.capture!==o.capture||t.once!==o.once||t.passive!==o.passive,n=t!==w&&(o===w||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)}},ue=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){ot(this,t)}},Gr={M:ar,P:I,A:cr,C:1,L:Fr,R:ie,D:Ur,V:ot,I:ht,H:st,N:ce,U:le,B:ae,F:ue},Rs=ir.litHtmlPolyfillSupport;Rs?.(Nt,ht),(ir.litHtmlVersions??=[]).push("3.3.3");var x=(r,t,e)=>{let o=e?.renderBefore??t,s=o._$litPart$;if(s===void 0){let n=e?.renderBefore??null;o._$litPart$=s=new ht(t.insertBefore(Rt(),n),n,void 0,e??{})}return s._$AI(r),s};var pr=globalThis,dt=class extends N{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=x(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return rt}};dt._$litElement$=!0,dt.finalized=!0,pr.litElementHydrateSupport?.({LitElement:dt});var Ls=pr.litElementPolyfillSupport;Ls?.({LitElement:dt});(pr.litElementVersions??=[]).push("4.2.2");var P={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},$={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)$.any(r,e,o)},record:(r,t)=>$.entries(r,Object.entries(t))};function Kr(r,t={}){let e=document.createElement(r);return $.record(e,t),e}function Jr(r){let t=document.createDocumentFragment();return x(r,t),t.firstElementChild}function pe(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 Zr(r,t){let e=new MutationObserver(t);return e.observe(r,{attributes:!0}),()=>e.disconnect()}var he=class{element;constructor(t){this.element=t}strings=new Proxy({},{get:(t,e)=>P.string(this.element,e),set:(t,e,o)=>$.string(this.element,e,o)});numbers=new Proxy({},{get:(t,e)=>P.number(this.element,e),set:(t,e,o)=>$.number(this.element,e,o)});booleans=new Proxy({},{get:(t,e)=>P.boolean(this.element,e),set:(t,e,o)=>$.boolean(this.element,e,o)})};var Qr=(r,t,e={})=>new Proxy(t,{get:(o,s)=>{switch(t[s]){case String:return P.string(r,s);case Number:return P.number(r,s);case Boolean:return P.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 $.string(r,s,n);case Number:return $.number(r,s,n);case Boolean:return $.boolean(r,s,n);default:throw new Error(`invalid attribute type for "${s}"`)}}finally{e.afterSet?.(s)}}});function mt(r){let t=new he(r);return{strings:t.strings,numbers:t.numbers,booleans:t.booleans,on:e=>Zr(r,e),spec:(e,o={})=>Qr(r,e,o)}}mt.get=P;mt.set=$;function Xr(r){return new hr(r)}var hr=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 $.entries(t,this.#t),t.append(...this.#e),t}};function ft(r,t=document){let e=t.querySelector(r);if(!e)throw new Error(`element not found (${r})`);return e}function de(r,t=document){return t.querySelector(r)}function me(r,t=document){return Array.from(t.querySelectorAll(r))}var fe=class r{element;#t;constructor(t){this.element=t}in(t){return new r(typeof t=="string"?ft(t,this.element):t)}require(t){return ft(t,this.element)}maybe(t){return de(t,this.element)}all(t){return me(t,this.element)}render(...t){return x(t,this.element)}get attrs(){return this.#t??=mt(this.element)}events(t){return pe(this.element,t)}};function g(r,t=document){return ft(r,t)}g.in=(r,t=document)=>new fe(t).in(r);g.need=ft;g.maybe=de;g.all=me;g.el=Kr;g.elmer=Xr;g.mk=Jr;g.events=pe;g.attrs=mt;g.register=te;g.render=(r,...t)=>x(t,r);var $e={};Cs($e,{DragAndDrops:()=>xr,Drops:()=>yr,files:()=>Gs,hasFiles:()=>Fs,outsideCurrentTarget:()=>qt});var Yr=Object.freeze({eq(r,t){if(r.length!==t.length)return!1;let e=0;for(let o=0;o<r.length;o++)e|=r[o]^t[o];return e===0},random(r){return crypto.getRandomValues(new Uint8Array(r))},concat(r){let t=0;for(let s of r)t+=s.byteLength;let e=new Uint8Array(t),o=0;for(let s of r)e.set(s,o),o+=s.byteLength;return e}});var v=class{lexicon;static lexicons=Object.freeze({base2:{characters:"01"},hex:{characters:"0123456789abcdef",caseInsensitive:!0},base36:{characters:"0123456789abcdefghijklmnopqrstuvwxyz"},base58:{characters:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"},base62:{characters:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"},base64url:{negativePrefix:"~",characters:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"},base64:{characters:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",padding:{character:"=",size:4}}});lookup;negativePrefix;constructor(t){this.lexicon=t,this.lookup=Object.fromEntries([...t.characters].map((o,s)=>[o,s])),this.negativePrefix=t.negativePrefix??"-";let e=this.fromBytes.bind(this);return Object.setPrototypeOf(e,new.target.prototype),Object.assign(e,this),e}toBytes(t){this.lexicon.caseInsensitive&&(t=t.toLowerCase());let e=Math.log2(this.lexicon.characters.length);if(Number.isInteger(e)){let l=0,p=0,u=[];for(let m of t){if(m===this.lexicon.padding?.character)continue;let _=this.lookup[m];if(_===void 0)throw new Error(`Invalid character: ${m}`);for(l=l<<e|_,p+=e;p>=8;)p-=8,u.push(l>>p&255)}return new Uint8Array(u)}let o=0n,s=BigInt(this.lexicon.characters.length);t.startsWith(this.negativePrefix)&&(t=t.slice(this.negativePrefix.length));let n=this.lexicon.characters[0],i=0;for(;t[i]===n;)i++;t=t.slice(i);for(let l of t){let p=this.lookup[l];if(p===void 0)throw new Error(`Invalid character: ${l}`);o=o*s+BigInt(p)}let a=new Uint8Array(i+(o===0n?0:this.countBytes(o))),c=a.length;for(;o>0n;)a[--c]=Number(o%256n),o=o/256n;return a}fromBytes(t){let e=Math.log2(this.lexicon.characters.length);if(Number.isInteger(e)){let c=0,l=0,p="";for(let u of t)for(c=c<<8|u,l+=8;l>=e;){l-=e;let m=c>>l&(1<<e)-1;p+=this.lexicon.characters[m]}if(l>0){let u=c<<e-l&(1<<e)-1;p+=this.lexicon.characters[u]}if(this.lexicon.padding)for(;p.length%this.lexicon.padding.size!==0;)p+=this.lexicon.padding.character;return p}if(t.length===0)return"";let o=this.lexicon.characters[0],s=0;for(;t[s]===0;)s++;let n=0n;for(let c of t.slice(s))n=(n<<8n)+BigInt(c);if(n===0n)return o.repeat(s);let i=BigInt(this.lexicon.characters.length),a="";for(;n>0n;)a=this.lexicon.characters[Number(n%i)]+a,n=n/i;return o.repeat(s)+a}toInteger(t){if(!t)return 0;let e=0n,o=!1,s=BigInt(this.lexicon.characters.length);t.startsWith(this.negativePrefix)&&(t=t.slice(this.negativePrefix.length),o=!0);for(let n of t){let i=this.lookup[n];if(i===void 0)throw new Error(`Invalid character: ${n}`);e=e*s+BigInt(i)}return Number(o?-e:e)}fromInteger(t){t=Math.floor(t);let e=t<0,o=BigInt(e?-t:t);if(o===0n)return this.lexicon.characters[0];let s=BigInt(this.lexicon.characters.length),n="";for(;o>0n;)n=this.lexicon.characters[Number(o%s)]+n,o=o/s;return e?`${this.negativePrefix}${n}`:n}random(t=32){return this.fromBytes(Yr.random(t))}countBytes(t){let e=0;for(;t>0n;)e++,t=t/256n;return e}};var ge=new v(v.lexicons.hex),Li=new v(v.lexicons.base2),Ni=new v(v.lexicons.base36),Ii=new v(v.lexicons.base58),Hi=new v(v.lexicons.base62),Vi=new v(v.lexicons.base64),Ui=new v(v.lexicons.base64url);function to(r,t){let e,o,s=[];function n(){e=[],o&&clearTimeout(o),o=void 0,s=[]}return n(),((...i)=>{e=i,o&&clearTimeout(o);let a=new Promise((c,l)=>{s.push({resolve:c,reject:l})});return o=setTimeout(()=>{Promise.resolve().then(()=>t(...e)).then(c=>{for(let{resolve:l}of s)l(c);n()}).catch(c=>{for(let{reject:l}of s)l(c);n()})},r),a})}function nt(){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}function gt(r){let t=null;return((...e)=>(t?t.params=e:(t={params:e,deferred:nt()},queueMicrotask(()=>{let{params:o,deferred:s}=t;t=null,Promise.resolve(r(...o)).then(s.resolve).catch(s.reject)})),t.deferred.promise))}function z(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=>z(o,new Set(t))):r.constructor===Object?e=Object.fromEntries(Object.entries(r).map(([o,s])=>[o,z(s,new Set(t))])):r instanceof Map?e=new Map(Array.from(r,([o,s])=>[o,z(s,new Set(t))])):r instanceof Set?e=new Set(Array.from(r,o=>z(o,new Set(t)))):r instanceof Date?e=new Date(r.getTime()):e=r,t.delete(r)):e=r,e}function C(r){return r!=null}var bt=r=>typeof r=="number",xt=r=>typeof r=="string";var It=r=>typeof r=="object"&&r!==null,be=r=>Array.isArray(r);function Ns(r){return r!=null}function Is(r){return r==null}var Zi=Object.freeze({happy:Ns,sad:Is,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 eo=(r,t)=>{function e(o,s,n){if(!It(o)||!It(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[a,c]of o)if(!s.has(a)||!e(c,s.get(a),i))return!1}else if(o instanceof Set&&s instanceof Set){if(o.size!==s.size)return!1;for(let a of o)if(!Array.from(s).some(c=>e(a,c,i)))return!1}else{let a=Object.keys(o),c=Object.keys(s);if(a.length!==c.length)return!1;for(let l of a)if(!c.includes(l)||!e(o[l],s[l],i))return!1}return!0}return e(r,t,[])};function it(r){function t(e,o){if(!It(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 ro(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 oo(r){if(r.ok)throw new Error("didn't get needed error");return r.error}var Hs=new TextEncoder;function dr(r){return r=Math.imul(r^r>>>15,r|1),r^=r+Math.imul(r^r>>>7,r|61),r^=r>>>14,r>>>0}function Vs(r){let t=2166136261;for(let e of Hs.encode(r))t^=e,t=Math.imul(t,16777619);return dr(t)}function so(...r){let t=2654435769;for(let e of r){let o=typeof e=="string"?Vs(e):e>>>0;t=t+1831565813>>>0,t^=dr(o),t=dr(t)}return t}function k(r,t="got failed"){if(r==null)throw new Error(t);return r}function yt(r,t,e){if(r.has(t))return r.get(t);{let o=e();return r.set(t,o),o}}function Ht(r,t){for(let[e,o]of t)r.set(e,o);return r}function xe(r,t){return t<=0?[]:r.length>t?r.slice(-t):r}async function mr(r){let t=[];for await(let e of r)t.push(e);return t}function wt(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 U(){let r=[],t=()=>{let o=r;r=[];for(let s=o.length-1;s>=0;s--)o[s]()};function e(){t()}return e.dispose=t,e.schedule=(...o)=>(r.push(...o),e),e.own=(o,s)=>(r.push(()=>s(o)),o),e.disposable=o=>(r.push(()=>o.dispose()),o),e.disposables=e.disposable,e}function E(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 vt=class{count;constructor(t=0){this.count=t}next(){return this.count++}};var $t=(r=0)=>new Promise(t=>setTimeout(t,r));var fr=(r,t)=>Object.fromEntries(Object.entries(r).map(([e,o])=>[e,t(o,e)])),Us=(r,t)=>Object.fromEntries(Object.entries(r).filter(([e,o])=>t(o,e)));function qs(r){return{map:t=>no(r,t),filter:t=>io(r,t)}}qs.pipe=Object.freeze({map:r=>(t=>no(t,r)),filter:r=>(t=>io(t,r))});var no=fr,io=Us;function q(r){let t=Ws(),e=o=>t.on(o);return Object.assign(e,t),r&&t.on(r),e}function Ws(){let r=new Set,t,e=()=>t??=nt(),o=a=>{let c=t;t=void 0,c?.resolve(a)};return{set:r,on:a=>(r.add(a),()=>{r.delete(a)}),publish:(...a)=>{o(a);for(let c of[...r])c(...a)},publishAsync:async(...a)=>{o(a),await Promise.all([...r].map(async c=>c(...a)))},next:e}}function W(r,...t){let e=r.length-1;return r.slice(0,e).reduce((o,s,n)=>o+s+t[n],"")+r[e]}function kt(r,t,e){return r?t():e?.()}function ye(r,t,e){return C(r)?t(r):e?.()}var we=class{#t=new Set;#e=[];#o=new WeakMap;#r=0;#s=new Set;read(t){this.#e.at(-1)?.add(t)}write(t){let e=this.#o.get(t);if(e){for(let o of e)this.#s.add(o);this.#r===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=yt(this.#o,t,()=>new Set);return o.add(e),()=>{o.delete(e),o.size===0&&this.#o.delete(t)}}batch=t=>{this.#r++;try{return t()}finally{this.#r--,this.#r===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.#s.size>0;){let t=[...this.#s];this.#s.clear();for(let e of t)this.#i(e)}}};var d=globalThis[Symbol.for("e280.tracker.2")]??=new we;function S(r){let t;function e(){return arguments.length===0?(d.read(e),r):(r=arguments[0],d.write(e),t?.publish(r),r)}return e.get=()=>e(),e.set=o=>e(o),e.on=o=>(t??=q())(o),e}var O=class extends Map{get size(){return d.read(this),super.size}[Symbol.iterator](){return d.read(this),super[Symbol.iterator]()}forEach(t){d.read(this);for(let[e,o]of this)t(o,e,this);return this}keys(){return d.read(this),super.keys()}values(){return d.read(this),super.values()}entries(){return d.read(this),super.entries()}has(t){return d.read(this),super.has(t)}get(t){return d.read(this),super.get(t)}set(t,e){return super.set(t,e),d.write(this),this}delete(t){let e=super.delete(t);return d.write(this),e}clear(){return super.clear(),d.write(this),this}};var Vt=class extends Set{get size(){return d.read(this),super.size}[Symbol.iterator](){return d.read(this),super[Symbol.iterator]()}forEach(t){d.read(this);for(let e of this)t(e,e,this);return this}values(){return d.read(this),super.values()}has(t){return d.read(this),super.has(t)}add(t){return super.add(t),d.write(this),this}delete(t){let e=super.delete(t);return d.write(this),e}clear(){return super.clear(),d.write(this),this}};var Fa=d.batch;function co(r){return it(z(r))}var T=Symbol("optic");var Ut=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 ve=class r{[T];#t;#e;#o;#r=q();constructor(t){this[T]=t,this.#t=z(t.getState()),this.#e=new Ut(()=>z(t.getState())),this.#o=new Ut(()=>co(t.getState()))}get on(){return this.#r.on}update(){let t=this[T].getState();!eo(t,this.#t)&&(this.#e.invalidate(),this.#o.invalidate(),this.#t=z(t),d.write(this),this.#r.set.size&&this.#r.publish(this.#e.get()))}get state(){return d.read(this),this.#e.get()}get frozen(){return d.read(this),this.#o.get()}mutate(t){return this[T].mutate(t)}lens(t){let e=new r({getState:()=>t(this[T].getState()),mutate:o=>this[T].mutate(s=>o(t(s))),registerLens:this[T].registerLens});return this[T].registerLens(e),e}};function lo(r){if(!r.done)throw new Error("wait not done");return ro(r)}function uo(r){if(!r.done)throw new Error("wait not done");return oo(r)}var po=r=>!r.done;var br=r=>r.done&&r.ok;function ho(r,t){let{pending:e=()=>{},ok:o=()=>{},err:s=()=>{}}=t;return po(r)?e():br(r)?o(lo(r)):s(uo(r))}function Fs(r){return!!(r.dataTransfer&&r.dataTransfer.types.includes("Files"))}function Gs(r){return r.dataTransfer?Array.from(r.dataTransfer.files):[]}function qt(r){let t=r.currentTarget,e=r.relatedTarget;return!t||!e||!t.contains(e)}var xr=class{params;$draggy=S(void 0);$droppy=S(void 0);constructor(t){this.params=t}get dragging(){return this.$draggy()}get hovering(){return this.$droppy()}dragzone=t=>({draggable:"true",dragstart:e=>{this.$draggy(t())},dragend:e=>{this.$draggy(void 0),this.$droppy(void 0)}});dropzone=t=>({dragenter:e=>{},dragover:e=>{e.preventDefault(),this.$draggy()?this.$droppy(t()):this.params.backchannelDrops?.dragover(e)},dragleave:e=>{qt(e)&&this.$droppy(void 0),this.params.backchannelDrops?.dragleave(e)},drop:e=>{e.preventDefault();let{acceptDrop:o}=this.params,s=this.$draggy(),n=this.$droppy();try{s&&n?o(e,s,n):this.params.backchannelDrops?.drop(e)}finally{this.$draggy(void 0),this.$droppy(void 0)}}})};var yr=class{params;$indicator=S(!1);constructor(t){this.params=t}dragover=t=>{t.preventDefault(),this.$indicator(this.params.predicate(t))};dragleave=t=>{qt(t)&&this.$indicator(!1)};drop=t=>{t.preventDefault(),this.$indicator(!1),this.params.predicate(t)&&this.params.acceptDrop(t)}};var St=b`
4
4
  * {
5
5
  margin: 0;
6
6
  padding: 0;
@@ -14,18 +14,18 @@ var _s=Object.defineProperty;var Cs=(r,t)=>{for(var e in t)_s(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 ke=class r extends HTMLElement{static register(){g.register({SlyShadow:r},{soft:!0})}connectedCallback(){this.hasAttribute("view")||this.setAttribute("view","")}};var Wt=class{render;count=0;rendered=st();constructor(t){this.render=t}doneRender(){this.count++,this.rendered.resolve(),this.rendered=st()}},W=class extends Wt{host;shadow;constructor(t,e,o){super(t),this.host=e,this.shadow=o}};var wr=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()}}},M=globalThis[Symbol.for("e280.hooks")]??=new wr;var F=class{#t=[];clear(){this.#t.forEach(t=>t()),this.#t=[]}observe(t,e){let{seen:o,value:s}=d.observe(t);this.clear();for(let n of o){let i=d.subscribe(n,e);this.#t.push(i)}return s}};var Se=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 G=class{cx;position=0;values=new Map;mounts=new Se;constructor(t){this.cx=t}};var{I:eu}=Gr;var mo=r=>r.strings===void 0;var fo={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},Ft=r=>(...t)=>({_$litDirective$:r,values:t}),Ae=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 Gt=(r,t)=>{let e=r._$AN;if(e===void 0)return!1;for(let o of e)o._$AO?.(t,!1),Gt(o,t);return!0},_e=r=>{let t,e;do{if((t=r._$AM)===void 0)break;e=t._$AN,e.delete(r),r=t}while(e?.size===0)},go=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),Xs(t)}};function Zs(r){this._$AN!==void 0?(_e(this),this._$AM=r,go(this)):this._$AM=r}function Qs(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++)Gt(o[n],!1),_e(o[n]);else o!=null&&(Gt(o,!1),_e(o));else Gt(this,r)}var Xs=r=>{r.type==fo.CHILD&&(r._$AP??=Qs,r._$AQ??=Zs)},At=class extends Ae{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,e,o){super._$AT(t,e,o),go(this),this.isConnected=t._$AU}_$AO(t,e=!0){t!==this.isConnected&&(this.isConnected=t,t?this.reconnected?.():this.disconnected?.()),e&&(Gt(this,t),_e(this))}setValue(t){if(mo(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 A(r){return Ft(class extends At{#t;#e=new Wt(gt(()=>{if(!this.#t)throw new Error("cannot render before props");if(this.isConnected){let e=this.render(...this.#t);this.setValue(e),this.#e.doneRender()}}));#o=new G(this.#e);#r=new F;update(e,o){let s=super.update(e,o);return this.isConnected&&this.#e.doneRender(),s}render(...e){return this.#t=e,this.#r.observe(()=>M.wrap(this.#o,()=>r(...this.#t)),this.#e.render)}disconnected(){this.#o.mounts.unmountAll(),this.#r.clear()}reconnected(){this.#o.mounts.remountAll(),this.#e.render()}})}function bo(r,t){for(let[e,o]of Object.entries(t))Ys(r,e,o)}function Ys(r,t,e){let o=r.getAttribute(t),s=tn(e);s!==o&&(s===null?r.removeAttribute(t):r.setAttribute(t,s))}function tn(r){return typeof r=="string"?r:typeof r=="number"?r.toString():r?"":null}function en(){ke.register();let r=document.createElement("sly-shadow"),t=r.attachShadow({mode:"open"});return{host:r,shadow:t}}function K(r){return yo(en,r)}K.setup=r=>(t=>yo(r,t));var xo=K;function yo(r,t){let e=Ft(class extends At{#t;#e;#o;#r=new F;constructor(s){super(s);let{host:n,shadow:i}=r(),a=gt(()=>{if(!this.#o)throw new Error("cannot render before props");if(!this.isConnected)return;let c=this.#s(this.#o);x(c,this.#t.shadow),this.#t.doneRender()});this.#t=new W(a,n,i),this.#e=new G(this.#t)}#s(s){return this.#o=s,this.#r.observe(()=>M.wrap(this.#e,()=>t(...this.#o)),this.#t.render)}render({props:s,children:n,attrs:i}){let{host:a}=this.#t;return this.isConnected&&(i&&bo(a,i),x(n,this.#t.host),x(this.#s(s),this.#t.shadow),this.#t.doneRender()),a}disconnected(){x(null,this.#t.shadow),x(null,this.#t.host),this.#e.mounts.unmountAll(),this.#r.clear()}reconnected(){this.#e.mounts.remountAll(),this.#t.render()}});function o(...s){return e({props:s})}return o.with=e,o}function wo(r){return class extends HTMLElement{#t;#e;#o=new F;#r=this.attachShadow({mode:"open"});constructor(){super();let t=gt(()=>{if(!this.isConnected)return;let e=this.#s();x(e,this.#t.shadow),this.#t.doneRender()});this.#t=new W(t,this,this.#r),this.#e=new G(this.#t)}#s(){return this.#o.observe(()=>M.wrap(this.#e,()=>r()),this.#t.render)}render(){x(this.#s(),this.#t.shadow),this.#t.doneRender()}connectedCallback(){this.#e.mounts.remountAll(),this.#t.render()}disconnectedCallback(){this.#e.mounts.unmountAll(),this.#o.clear()}}}function J(r){return[K(r),(...o)=>wo(()=>r(...o))]}function y(r){let{scope:t,position:e}=M.increment();return yt(t.values,e,r)}function Kt(){return M.increment().scope.cx}function Ce(){let r=Kt();if(!(r instanceof W))throw new Error("this hook only works on shadow views (but was called in a light view)");return r}function Jt(){return Ce().host}function it(r){let{scope:t}=M.increment();return y(()=>t.mounts.mount(r))}function $o(){return Ce().shadow}function ko(r,t){oe(r,on(t))}function on(r){let t=[];if(Array.isArray(r)){let e=new Set(r.flat(1/0).reverse());for(let o of e)t.unshift(pt(o))}else r!==void 0&&t.push(pt(r));return t}function B(...r){let t=$o();y(()=>ko(t,r))}function _t(r=""){let t=Jt();y(()=>t.setAttribute("view",r))}function H(r){return y(()=>S(r))}var Ct=B;function So(r){return it(()=>r)}function j(r,t){return()=>nn({hz:r,frames:t})}var nn=K(({hz:r,frames:t})=>{_t("loading"),Ct(St,an);let e=H(0);return it(()=>wt(async()=>{await $t(1e3/r);let o=e()+1;e(o>=t.length?0:o)})),t.at(e())}),an=b`
17
+ `;var ke=class r extends HTMLElement{static register(){g.register({SlyShadow:r},{soft:!0})}connectedCallback(){this.hasAttribute("view")||this.setAttribute("view","")}};var Wt=class{render;count=0;rendered=nt();constructor(t){this.render=t}doneRender(){this.count++,this.rendered.resolve(),this.rendered=nt()}},F=class extends Wt{host;shadow;constructor(t,e,o){super(t),this.host=e,this.shadow=o}};var wr=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()}}},M=globalThis[Symbol.for("e280.hooks")]??=new wr;var G=class{#t=[];clear(){this.#t.forEach(t=>t()),this.#t=[]}observe(t,e){let{seen:o,value:s}=d.observe(t);this.clear();for(let n of o){let i=d.subscribe(n,e);this.#t.push(i)}return s}};var Se=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 K=class{cx;position=0;values=new Map;mounts=new Se;constructor(t){this.cx=t}};var{I:eu}=Gr;var mo=r=>r.strings===void 0;var fo={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},Ft=r=>(...t)=>({_$litDirective$:r,values:t}),Ae=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 Gt=(r,t)=>{let e=r._$AN;if(e===void 0)return!1;for(let o of e)o._$AO?.(t,!1),Gt(o,t);return!0},_e=r=>{let t,e;do{if((t=r._$AM)===void 0)break;e=t._$AN,e.delete(r),r=t}while(e?.size===0)},go=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),Xs(t)}};function Zs(r){this._$AN!==void 0?(_e(this),this._$AM=r,go(this)):this._$AM=r}function Qs(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++)Gt(o[n],!1),_e(o[n]);else o!=null&&(Gt(o,!1),_e(o));else Gt(this,r)}var Xs=r=>{r.type==fo.CHILD&&(r._$AP??=Qs,r._$AQ??=Zs)},At=class extends Ae{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,e,o){super._$AT(t,e,o),go(this),this.isConnected=t._$AU}_$AO(t,e=!0){t!==this.isConnected&&(this.isConnected=t,t?this.reconnected?.():this.disconnected?.()),e&&(Gt(this,t),_e(this))}setValue(t){if(mo(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 A(r){return Ft(class extends At{#t;#e=new Wt(gt(()=>{if(!this.#t)throw new Error("cannot render before props");if(this.isConnected){let e=this.render(...this.#t);this.setValue(e),this.#e.doneRender()}}));#o=new K(this.#e);#r=new G;update(e,o){let s=super.update(e,o);return this.isConnected&&this.#e.doneRender(),s}render(...e){return this.#t=e,this.#r.observe(()=>M.wrap(this.#o,()=>r(...this.#t)),this.#e.render)}disconnected(){this.#o.mounts.unmountAll(),this.#r.clear()}reconnected(){this.#o.mounts.remountAll(),this.#e.render()}})}function bo(r,t){for(let[e,o]of Object.entries(t))Ys(r,e,o)}function Ys(r,t,e){let o=r.getAttribute(t),s=tn(e);s!==o&&(s===null?r.removeAttribute(t):r.setAttribute(t,s))}function tn(r){return typeof r=="string"?r:typeof r=="number"?r.toString():r?"":null}function en(){ke.register();let r=document.createElement("sly-shadow"),t=r.attachShadow({mode:"open"});return{host:r,shadow:t}}function J(r){return yo(en,r)}J.setup=r=>(t=>yo(r,t));var xo=J;function yo(r,t){let e=Ft(class extends At{#t;#e;#o;#r=new G;constructor(s){super(s);let{host:n,shadow:i}=r(),a=gt(()=>{if(!this.#o)throw new Error("cannot render before props");if(!this.isConnected)return;let c=this.#s(this.#o);x(c,this.#t.shadow),this.#t.doneRender()});this.#t=new F(a,n,i),this.#e=new K(this.#t)}#s(s){return this.#o=s,this.#r.observe(()=>M.wrap(this.#e,()=>t(...this.#o)),this.#t.render)}render({props:s,children:n,attrs:i}){let{host:a}=this.#t;return this.isConnected&&(i&&bo(a,i),x(n,this.#t.host),x(this.#s(s),this.#t.shadow),this.#t.doneRender()),a}disconnected(){x(null,this.#t.shadow),x(null,this.#t.host),this.#e.mounts.unmountAll(),this.#r.clear()}reconnected(){this.#e.mounts.remountAll(),this.#t.render()}});function o(...s){return e({props:s})}return o.with=e,o}function wo(r){return class extends HTMLElement{#t;#e;#o=new G;#r=this.attachShadow({mode:"open"});constructor(){super();let t=gt(()=>{if(!this.isConnected)return;let e=this.#s();x(e,this.#t.shadow),this.#t.doneRender()});this.#t=new F(t,this,this.#r),this.#e=new K(this.#t)}#s(){return this.#o.observe(()=>M.wrap(this.#e,()=>r()),this.#t.render)}render(){x(this.#s(),this.#t.shadow),this.#t.doneRender()}connectedCallback(){this.#e.mounts.remountAll(),this.#t.render()}disconnectedCallback(){this.#e.mounts.unmountAll(),this.#o.clear()}}}function Z(r){return[J(r),(...o)=>wo(()=>r(...o))]}function y(r){let{scope:t,position:e}=M.increment();return yt(t.values,e,r)}function Kt(){return M.increment().scope.cx}function Ce(){let r=Kt();if(!(r instanceof F))throw new Error("this hook only works on shadow views (but was called in a light view)");return r}function Jt(){return Ce().host}function at(r){let{scope:t}=M.increment();return y(()=>t.mounts.mount(r))}function $o(){return Ce().shadow}function ko(r,t){oe(r,on(t))}function on(r){let t=[];if(Array.isArray(r)){let e=new Set(r.flat(1/0).reverse());for(let o of e)t.unshift(pt(o))}else r!==void 0&&t.push(pt(r));return t}function B(...r){let t=$o();y(()=>ko(t,r))}function _t(r=""){let t=Jt();y(()=>t.setAttribute("view",r))}function H(r){return y(()=>S(r))}var Ct=B;function So(r){return at(()=>r)}function j(r,t){return()=>nn({hz:r,frames:t})}var nn=J(({hz:r,frames:t})=>{_t("loading"),Ct(St,an);let e=H(0);return at(()=>wt(async()=>{await $t(1e3/r);let o=e()+1;e(o>=t.length?0:o)})),t.at(e())}),an=b`
18
18
  :host {
19
19
  font-family: monospace;
20
20
  white-space: pre;
21
21
  user-select: none;
22
22
  }
23
- `;var D=K(r=>(_t("error"),Ct(St,cn),typeof r=="string"?r:r instanceof Error?h`<strong>${r.name}:</strong> <span>${r.message}</span>`:"error")),cn=b`
23
+ `;var D=J(r=>(_t("error"),Ct(St,cn),typeof r=="string"?r:r instanceof Error?h`<strong>${r.name}:</strong> <span>${r.message}</span>`:"error")),cn=b`
24
24
  :host {
25
25
  font-family: monospace;
26
26
  color: red;
27
27
  }
28
- `;function R(r,t){return(e,o)=>ho(e,{pending:r,err:t,ok:o})}var sd=R(j(10,[" "," ",". ",".. ","..."," .."," ."]),D);var ld=R(j(3,["\u{1F30E}","\u{1F30F}","\u{1F30D}"]),D);var md=R(j(10,["\u{1F312}","\u{1F313}","\u{1F314}","\u{1F315}","\u{1F316}","\u{1F317}","\u{1F318}","\u{1F311}","\u{1F311}","\u{1F311}"]),D);var yd=R(j(16,["|","/","-","\\"]),D);var Sd=R(j(20,[":....",":....","::...",".::..","..::.","...::","....:","....:","...::","..::.",".::..","::..."]),D);var _o=r=>r;var Co=r=>r,Eo=r=>r;var ln=_o({looking:{horizontal:["accumulate","pointer.x"],vertical:["accumulate","pointer.y"]},moving:{forward:"KeyW",backward:"KeyS",leftward:"KeyA",rightward:"KeyD"},interactions:{use:"KeyE"}}),Mo=Eo({standard:{label:"\u2328\uFE0Fstandard",bindings:ln},gamer:{label:"\u{1F3AE}gamer",bindings:{looking:{horizontal:["*",["dt"],"gamepad.axis.3",100],vertical:["*",["dt"],"gamepad.axis.4",100]},moving:{forward:["remap",0,-1,0,1,"gamepad.axis.2"],backward:["remap",0,1,0,1,"gamepad.axis.2"],leftward:["remap",0,-1,0,1,"gamepad.axis.1"],rightward:["remap",0,1,0,1,"gamepad.axis.1"]},interactions:{use:"gamepad.1"}}},micro:{label:"\u{1F9A0}micro",bindings:{looking:{horizontal:["*",["dt"],["+","gamepad.1",["-","gamepad.4"]],100],vertical:["*",["dt"],["+","gamepad.2",["-","gamepad.3"]],100]},moving:{forward:["remap",0,-1,0,1,"gamepad.axis.2"],backward:["remap",0,1,0,1,"gamepad.axis.2"],leftward:["remap",0,-1,0,1,"gamepad.axis.1"],rightward:["remap",0,1,0,1,"gamepad.axis.1"]},interactions:{use:["*","gamepad.5","gamepad.6"]}}}});function Po({start:r,end:t}){if(C(r)&&C(t))return IDBKeyRange.bound(r,t,!1,!0);if(C(r))return IDBKeyRange.lowerBound(r,!1);if(C(t))return IDBKeyRange.upperBound(t,!0)}async function zo(r){return new Promise((t,e)=>{r.onsuccess=()=>t(r.result),r.onerror=()=>e(r.error)})}function Oo({db:r,storeName:t}){let e=o=>(async s=>{let n=r.transaction(t,o),i=n.objectStore(t),a=new Promise((c,l)=>{n.onabort=()=>l(n.error??new Error("transaction aborted")),n.oncomplete=()=>c(void 0)});try{let c=await s(i,zo);return n.commit(),await a,c}catch(c){try{n.abort()}catch{}throw c}});return{readonly:e("readonly"),readwrite:e("readwrite")}}var Ee=class{#t;constructor(t){this.#t=Oo(t)}async commit(t){return this.#t.readwrite(async e=>{for(let[o,s]of t)s===void 0?e.delete(o):e.put(s,o)})}async getMany(t){return this.#t.readonly((e,o)=>Promise.all(t.map(s=>o(e.get(s)))))}async*entries(t={}){t.limit!==0&&(yield*await this.#t.readonly(async(e,o)=>{let s=[],n=t.reverse?"prev":"next",i=e.openCursor(Po(t),n),a=await o(i);for(;a&&(s.push([a.key,a.value]),!(t.limit!==void 0&&s.length>=t.limit));)a.continue(),a=await o(i);return s}))}};var To=(r,t)=>r<t?-1:r>t?1:0;function Bo(r,{start:t,end:e}){return!(t!==void 0&&r<t||e!==void 0&&r>=e)}function*vr(r,t){if(r.limit===0)return;let e=t.filter(([o,s])=>s!==void 0&&Bo(o,r)).sort(([o],[s])=>To(o,s));r.reverse&&e.reverse(),yield*e.slice(0,r.limit??1/0)}var Me=class{#t=new Map;async commit(t){for(let[e,o]of t)o===void 0?this.#t.delete(e):this.#t.set(e,structuredClone(o))}async getMany(t){return t.map(e=>structuredClone(this.#t.get(e)))}async*entries(t={}){yield*vr(t,[...this.#t.entries()].map(([e,o])=>[e,structuredClone(o)]))}};async function jo(r,t=r){return{db:await new Promise((o,s)=>{let n=indexedDB.open(r,1);n.onblocked=()=>s(new Error("idb blocked")),n.onerror=()=>s(n.error),n.onupgradeneeded=()=>n.result.createObjectStore(t),n.onsuccess=()=>o(n.result)}),storeName:t}}var Pe=class{#t;#e;constructor(t,e){this.#t=t,this.#e=e}set(t){return this.#e.set(this.#t,t)}delete(){return this.#e.delete(this.#t)}};var ze=class{kv;key;op;constructor(t,e){this.kv=t,this.key=e,this.op=new Pe(e,t.op)}async set(t){return this.kv.set(this.key,t)}async get(){return this.kv.get(this.key)}async has(){return await this.get()!==void 0}async need(){return k(await this.get(),`key not found "${this.key}"`)}async delete(){return this.kv.set(this.key,void 0)}};var Et=nt({divisor:".",delimiter:":",chunkSize:1024});function Zt(r){for(let t=r.length-1;t>=0;t--){let e=r.charCodeAt(t);if(e<65535)return r.slice(0,t)+String.fromCharCode(e+1)}}var Oe=class{#t;#e=[{}];constructor(t,e){if(this.#t=t,e.length){let o=e.join(Et.divisor),s=o+".",n=o+":";this.#e=[{start:n,end:Zt(n)},{start:s,end:Zt(s)}]}}async count(){let t=0;for(let e of this.#e)for await(let o of this.#t.entries(e))t++;return t}async clear(){let t=[];for(let e of this.#e)for await(let[o]of this.#t.entries(e))t.push([o,void 0]),t.length>=1024&&(await this.#t.commit(t),t=[]);t.length&&await this.#t.commit(t)}};var Te=class{#t;constructor(t){this.#t=t}set(t,e){return[this.#t.prefix(t),e]}delete(t){return[this.#t.prefix(t),void 0]}};var{divisor:pn,delimiter:hn}=Et,Be=class{#t;#e;constructor(t){let{scopes:e}=t;this.#t=e.join(pn)+hn,this.#e=Zt(this.#t)}prefix=t=>this.#t+t;unprefix=t=>t.slice(this.#t.length);scan=t=>{let{start:e,end:o,limit:s,reverse:n}=t;return{start:this.#t+(e??""),end:o===void 0?this.#e:this.#t+o,limit:s,reverse:n}}};function Do(r){let t=r.limit;if(t!==void 0){if(!Number.isInteger(t))throw new Error("scan limit must be integer");if(t<0)throw new Error("scan limit must be positive")}return r}function Lo(r){for(let t of r){if(t==="")throw new Error("invalid scope empty string");Ro(t,"."),Ro(t,":")}return r}function Ro(r,t){if(r.includes(t))throw new Error(`invalid scope "${r}" contains illegal "${t}"`)}var je=class r{op;subtree;#t;#e;#o;#r;constructor(t=new Me,e={}){this.#t=t,this.#r={strict:!1,scopes:[],...e},Lo(this.#r.scopes),this.#e=new Be(this.#r),this.op=new Te(this.#e),this.subtree=new Oe(this.#t,this.#r.scopes),this.#o=this.#r.strict?o=>JSON.parse(JSON.stringify(o)):o=>o}cell(t){return new ze(this,t)}scope(...t){return new r(this.#t,{...this.#r,scopes:[...this.#r.scopes,...t]})}async commit(t){await this.#t.commit(t.map(([e,o])=>[e,o===void 0?void 0:this.#o(o)]))}async set(t,e){return this.commit([this.op.set(t,e)])}async setMany(t){return this.commit(t.map(([e,o])=>this.op.set(e,o)))}async delete(...t){return this.commit(t.map(e=>this.op.delete(e)))}async getMany(t){return t=t.map(e=>this.#e.prefix(e)),(await this.#t.getMany(t)).map(e=>e===void 0?void 0:e)}async get(t){let[e]=await this.getMany([t]);return e}async has(t){return await this.get(t)!==void 0}async need(t){return k(await this.get(t),`key not found "${t}"`)}async needMany(t){let e=await this.getMany(t);for(let[o,s]of t.entries())k(e[o],`key not found "${s}"`);return e}async*entries(t={}){t=Do(this.#e.scan(t));for await(let[e,o]of this.#t.entries(t)){let s=this.#e.unprefix(e);o!==void 0&&(yield[s,o])}}[Symbol.asyncIterator](){return this.entries()}async*keys(t={}){for await(let[e]of this.entries(t))yield e}async*values(t={}){for await(let[,e]of this.entries(t))yield e}async count(t={}){let e=0;for await(let o of this.keys(t))e++;return e}async clear(t={}){let e=[];for await(let[o]of this.entries(t))e.push(this.op.delete(o)),e.length>=Et.chunkSize&&(await this.commit(e),e=[]);e.length&&await this.commit(e)}};function No(r){let e=r.reduce((a,{intents:c})=>a+8+c.byteLength,0),o=new ArrayBuffer(e),s=new DataView(o),n=new Uint8Array(o),i=0;for(let{playerId:a,intents:c}of r)s.setUint32(i,a,!1),i+=4,s.setUint32(i,c.byteLength,!1),i+=4,n.set(new Uint8Array(c),i),i+=c.byteLength;return o}function Re(r,t){let e=4+t.length*6,o=new ArrayBuffer(e),s=new DataView(o),n=0;s.setUint32(n,r,!1),n+=4;for(let i of t)s.setUint16(n,i.id,!1),n+=2,s.setFloat32(n,i.value,!1),n+=4;return o}function at(r){return!!(r===null||xt(r)||bt(r)||be(r))}function ct(r){let t=[];function e(o,s){if(at(o))t.push(s.join("."));else for(let[n,i]of Object.entries(o))e(i,[...s,n])}return e(r,["b"]),so(...t)}var Le=class{bindings;#t;#e=new vt;#o=new Vt;#r=new O;constructor(t){this.bindings=t,this.#t=ct(t)}get playerIds(){return[...this.#r.keys()]}get controllers(){return{unassigned:[...this.#o],assigned:new Map([...this.#r].map(([t,e])=>[t,[...e.controllers]]))}}createPlayer(){let t=this.#e.next();return this.#r.set(t,{controllers:new Vt}),t}deletePlayer(t){return this.#r.get(t)?.controllers.forEach(e=>this.#o.add(e)),this.#r.delete(t),this}add(t){return this.unplug(t),this}remove(t){return this.unplug(t),this.#o.delete(t),this}unplug(t){this.#o.add(t);for(let e of this.#r.values())e.controllers.delete(t);return this}plug(t,e){return e??=this.playerIds.at(-1)??this.createPlayer(),this.unplug(t),k(this.#r.get(e)).controllers.add(t),this.#o.delete(t),this}encode(t,e=performance.now()){let o=new Map,{controllers:s}=k(this.#r.get(t));for(let i of s)for(let a of i.evaluate(e)){let c=o.get(a.id)??0;o.set(a.id,c+a.value)}let n=[...o].filter(([,i])=>i!==0).map(([i,a])=>({id:i,value:a}));return Re(this.#t,n)}encodeAll(t=performance.now()){for(let o of this.#o)o.clear();let e=Array.from(this.#r.keys()).map(o=>({playerId:o,intents:this.encode(o,t)}));return No(e)}};function $r(r,t){let{presets:e,customs:o,fallback:s}=r.profiles;return t===void 0?s.profile:o.get(t)??e.get(t)??k(e.get(s.key))}async function Ne(r,t,e){let{kvs:o,controllers:s,assignments:n}=r;t.bindings=$r(r,e).bindings,n.set(t,e),await ye(s.get(t)?.handle,async i=>{r.preferences.set(i,e),await o.preferences.set(i,e)})}function Io(r,t){return ct(r)===ct(t)}var Ie=class{#t;constructor(t){this.#t=t}#e(t){if(!Io(t,this.#t.bindings))throw new Error("incompatible bindings")}get presets(){return[...this.#t.profiles.presets]}get customs(){return[...this.#t.profiles.customs]}isPreset(t){return this.#t.profiles.presets.has(t)}get(t){return $r(this.#t,t)}async create(t,e){let{kvs:o,profiles:s}=this.#t;this.#e(e.bindings),s.customs.set(t,e),await o.profiles.set(t,e),this.#t.subby.publish()}async clone(t,e){let{label:o,bindings:s}=this.get(e);await this.create(t,{basedOn:e,bindings:s,label:`${o} copy`})}async delete(t){let{kvs:e,assignments:o,profiles:{customs:s,fallback:n}}=this.#t;s.delete(t),await e.profiles.delete(t);for(let[i,a]of o)a===t&&await Ne(this.#t,i,n.key);this.#t.subby.publish()}async update(t,e){let{kvs:o,assignments:s,profiles:{customs:n}}=this.#t;e.bindings&&this.#e(e.bindings);let i=this.get(t),a={...structuredClone(i),...e};n.set(t,a);for(let[c,l]of s)l===t&&(c.bindings=a.bindings);await o.profiles.set(t,a),this.#t.subby.publish()}};function Ho({kv:r,presets:t}){let e=k(Object.keys(t)[0],"missing presets"),o=k(t[e]),s=o.bindings,n={presets:new O,customs:new O,fallback:{key:e,profile:o}};return Ht(n.presets,Object.entries(t)),{subby:U(),kv:r,presets:t,bindings:s,idCounter:new vt,profiles:n,controllers:new O,assignments:new O,preferences:new O,kvs:{profiles:r.scope("profiles"),preferences:r.scope("preferences")}}}var He=class{#t;constructor(t){this.#t=t}async assign(t,e){await Ne(this.#t,t,e),this.#t.subby.publish()}assignedProfileKeyOf(t){let{assignments:e}=this.#t;return e.get(t)??this.#t.profiles.fallback.key}};var Ve=class{#t;profiles;assignments;presets;constructor(t){this.#t=Ho(t),this.profiles=new Ie(this.#t),this.assignments=new He(this.#t),this.presets=t.presets}get on(){return this.#t.subby.on}#e(t){let{preferences:e,assignments:o,controllers:s}=this.#t,n=k(s.get(t)),i=o.get(t)??e.get(n.handle)??n.defaultProfileKey;t.bindings=this.profiles.get(i).bindings,o.set(t,i)}async load(){let{kvs:t,controllers:e,preferences:o,profiles:{customs:s}}=this.#t;s.clear(),Ht(s,await mr(t.profiles)),o.clear(),Ht(o,await mr(t.preferences));for(let n of e.keys())this.#e(n)}get controllers(){return[...this.#t.controllers.keys()]}get fallbackProfileKey(){return this.#t.profiles.fallback.key}meta(t){return this.#t.controllers.get(t)}attach(t,e){let o=this.#t.idCounter.next();this.#t.controllers.set(t,{...e,id:o}),this.#e(t)}detach(t){this.#t.controllers.delete(t),this.#t.assignments.delete(t)}};function Qt(r){let[t,e]=Object.entries(r)[0];return{key:t,profile:e}}async function Vo(r){let t=r.kv??new je(new Ee(await jo("tact","kv"))),e=r.broadcastChannel??new BroadcastChannel("tact"),{maxPlayers:o}=r,{bindings:s}=Qt(r.presets).profile,n=new Le(s),i=new Ve({...r,kv:t});return await i.load(),e.onmessage=()=>i.load(),i.on(()=>e.postMessage({})),Co({hub:n,controls:i,maxPlayers:o})}var kr=1024,Ue=class{dispose;#t;#e=[];constructor(t){this.#t=t,this.dispose=t.onSample(e=>{this.#e.push(e),this.#e.length>kr&&console.warn(`tact sampler exceeded limit ${kr}`),this.#e=xe(this.#e,kr)})}take(){this.#t.poll?.();let t=this.#e;return this.#e=[],t}};var{min:mn,max:fn,abs:gn,sign:bn,floor:Vf,ceil:Uf,pow:qf}=Math;function lt(r,t=0,e=1){return r=mn(r,e),r=fn(r,t),r}function xn(r,t,e,o){let n=(e-t)*r;return o!==void 0&&gn(n)>o&&(n=bn(n)*o),t+n}function yn(r,t,e){return(r-t)/(e-t)}function Uo(r,t,e,o=0,s=1,n=!1){let i=yn(r,t,e);return n&&(i=lt(i)),xn(i,o,s)}var qe=class r{x;y;constructor(t=0,e=0){this.x=t,this.y=e}static new(t=0,e=0){return new this(t,e)}static zero(){return new this}static fill(t){return new this(t,t)}static from(t){return Array.isArray(t)?new this(...t):new this(t.x,t.y)}static magnitudeSquared(t,e){return t*t+e*e}static magnitude(t,e){return Math.sqrt(this.magnitudeSquared(t,e))}static average(...t){return new this().add(...t).divBy(t.length)}static min(...t){return new this(Math.min(...t.map(e=>e.x)),Math.min(...t.map(e=>e.y)))}static max(...t){return new this(Math.max(...t.map(e=>e.x)),Math.max(...t.map(e=>e.y)))}static rotation(t){return new this(Math.cos(t),Math.sin(t))}dup(){return new this.constructor(this.x,this.y)}*[Symbol.iterator](){yield this.x,yield this.y}array(){return[this.x,this.y]}toJSON(){return this.array()}toString(){return`(${this.constructor.name} x${this.x.toFixed(2)}, y${this.y.toFixed(2)})`}fill(t){return this.x=t,this.y=t,this}zero(){return this.fill(0)}set_(t,e){return this.x=t,this.y=e,this}set({x:t,y:e}){return this.x=t,this.y=e,this}from(t){if(Array.isArray(t)){let[e,o]=t;this.x=e,this.y=o}else{let{x:e,y:o}=t;this.x=e,this.y=o}return this}magnitudeSquared(){return r.magnitudeSquared(this.x,this.y)}magnitude(){return r.magnitude(this.x,this.y)}rotation(){return Math.atan2(this.y,this.x)}equals_(t,e){return this.x===t&&this.y===e}equals(...t){return t.every(({x:e,y:o})=>this.equals_(e,o))}near_(t,e,o=1e-6){return Math.abs(this.x-t)<=o&&Math.abs(this.y-e)<=o}near({x:t,y:e},o=1e-6){return this.near_(t,e,o)}dot_(t,e){return this.x*t+this.y*e}dot({x:t,y:e}){return this.dot_(t,e)}distanceSquared_(t,e){return t=this.x-t,e=this.y-e,t*t+e*e}distanceSquared({x:t,y:e}){return this.distanceSquared_(t,e)}distance_(t,e){return Math.sqrt(this.distanceSquared_(t,e))}distance({x:t,y:e}){return this.distance_(t,e)}angleBetween_(t,e){let o=this.dot_(t,e),s=this.magnitude()*r.magnitude(t,e);if(s===0)return 0;let n=lt(o/s,-1,1);return Math.acos(n)}angleBetween({x:t,y:e}){return this.angleBetween_(t,e)}normalize(){return this.divBy(this.magnitude())}half(){return this.divBy(2)}double(){return this.mulBy(2)}abs(){return this.map(t=>Math.abs(t))}rotate(t){let{x:e,y:o}=this;return this.x=e*Math.cos(t)-o*Math.sin(t),this.y=e*Math.sin(t)+o*Math.cos(t),this}perpendicular(){let{x:t,y:e}=this;return this.x=-e,this.y=t,this}clampMagnitude(t){return this.magnitude()>t&&this.normalize().mulBy(t),this}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}map(t){return this.x=t(this.x,0),this.y=t(this.y,1),this}morph(t){let e=t(this);return e&&e!==this&&this.set(e),this}clamp(t={x:0,y:0},e={x:1,y:1}){return this.x=lt(this.x,t.x,e.x),this.y=lt(this.y,t.y,e.y),this}clampBy(t=0,e=1){return this.x=lt(this.x,t,e),this.y=lt(this.y,t,e),this}negate(){return this.map(t=>t*-1)}addBy(t){return this.x+=t,this.y+=t,this}subBy(t){return this.x-=t,this.y-=t,this}mulBy(t){return this.x*=t,this.y*=t,this}scale(t){return this.x*=t,this.y*=t,this}divBy(t){return t===0?this:(this.x/=t,this.y/=t,this)}add_(t,e){return this.x+=t,this.y+=e,this}add(...t){for(let{x:e,y:o}of t)this.add_(e,o);return this}sub_(t,e){return this.x-=t,this.y-=e,this}sub(...t){for(let{x:e,y:o}of t)this.sub_(e,o);return this}mul_(t,e){return this.x*=t,this.y*=e,this}mul(...t){for(let{x:e,y:o}of t)this.mul_(e,o);return this}div_(t,e){return t!==0&&(this.x/=t),e!==0&&(this.y/=e),this}div(...t){for(let{x:e,y:o}of t)this.div_(e,o);return this}lerp_(t,e,o){return this.x+=(t-this.x)*o,this.y+=(e-this.y)*o,this}lerp(t,{x:e,y:o}){return this.lerp_(t,e,o)}reflect_(t,e){let o=2*this.dot_(t,e);return this.x-=o*t,this.y-=o*e,this}reflect({x:t,y:e}){return this.reflect_(t,e)}rotateAroundPoint_(t,e,o){let s=this.x-e,n=this.y-o,i=Math.cos(t),a=Math.sin(t);return this.x=i*s-a*n+e,this.y=a*s+i*n+o,this}rotateAroundPoint(t,{x:e,y:o}){return this.rotateAroundPoint_(t,e,o)}};function ut(r){return r!==0}function Sr(r,t){let e=o=>Sr(r,o);if(t===null)return 0;if(bt(t))return t;if(xt(t)){let o=r.latestValues.get(t)??0;return r.recentSamples.filter(s=>s.code===t).reduce((s,n)=>Math.abs(n.value)>Math.abs(s)?n.value:s,o)}else switch(t[0]){case"accumulate":{let o=t[1],s=0;for(let n of r.recentSamples)n.code===o&&(s+=n.value);return s}case"up":{let o=t[1],s=0,n=r.previousValues.get(o)??0;for(let i of r.recentSamples)i.code===o&&(ut(n)&&!ut(i.value)&&s++,n=i.value);return s}case"down":{let o=t[1],s=0,n=r.previousValues.get(o)??0;for(let i of r.recentSamples)i.code===o&&(!ut(n)&&ut(i.value)&&s++,n=i.value);return s}case"was":{let o=t[1];return r.previousValues.get(o)??0}case"since":{let o=t[1],s=r.previousValues.get(o)??0;return(r.latestValues.get(o)??0)-s}case"if":{let[,o,s,n]=t;return e(o)?e(s):C(n)?e(n):0}case"min":return Math.min(...t.slice(1).map(e));case"max":return Math.max(...t.slice(1).map(e));case"+":return t.slice(1).map(e).reduce((o,s)=>o+s,0);case"*":return t.slice(1).map(e).reduce((o,s)=>o*s,1);case"==":return+(e(t[1])===e(t[2]));case"!=":return+(e(t[1])!==e(t[2]));case">":return+(e(t[1])>e(t[2]));case"<":return+(e(t[1])<e(t[2]));case">=":return+(e(t[1])>=e(t[2]));case"<=":return+(e(t[1])<=e(t[2]));case"!":return+(e(t[1])===0);case"!!":return+(e(t[1])!==0);case"-":{let[,o,...s]=t;if(s.length===0)return-e(o);let n=e(o);for(let i of s)n-=e(i);return n}case"clamp":{let[,o,s,n]=t,i=e(n);return Math.min(s===null?1/0:e(s),Math.max(o===null?-1/0:e(o),i))}case"remap":{let[o,s,n,i,a]=t.slice(1).map(e);return Uo(a,o,s,n,i)}case"dt":return r.dt;case"held":{let[,o,s]=t,n=ut(e(s)),i=r.holding.get(t);return n&&!i&&(i={start:r.clock.time},r.holding.set(t,i)),!n&&i&&(i=void 0,r.holding.delete(t)),i&&r.clock.time-i.start>=o?1:0}case"taps":{let[,o,s,n]=t,i=e(n),a=r.clock.time,c=yt(r.tapping,t,()=>({events:[]}));for(let l=0;l<i;l++)c.events.push(a);return c.events=xe(c.events.filter(l=>l>=a-s),128),c.events.length>=o?(c.events=[],1):0}case"mod":{let[,...o]=t,s=l=>ut(r.latestValues.get(l)??0),n=s("ShiftLeft")||s("ShiftRight"),i=s("ControlLeft")||s("ControlRight"),a=s("AltLeft")||s("AltRight"),c=s("MetaLeft")||s("MetaRight");return o.includes("shift")!==n||o.includes("ctrl")!==i||o.includes("alt")!==a||o.includes("meta")!==c?0:1}default:throw new Error("unknown expression")}}var We=class{time;since=0;last;constructor(t=performance.now()){this.time=t}update(t=performance.now()){this.since=t-(this.time??t),this.last=this.time,this.time=t}};var Fe=class{dt=0;clock=new We;recentSamples=[];latestValues=new Map;previousValues=new Map;holding=new Map;tapping=new Map};function qo(){return{value:0,was:0,sum:0}}function Ar(r){let t=ct(r),e=[],o=[];function s(i){if(at(i)){let a=qo();return e.push(a),o.push(i),a}else return fr(i,s)}let n=s(r);return{hash:t,inputs:n,inputList:e,rootList:o}}var Mt=class{#t;#e;#o;#r;constructor(t){this.#e=nt(structuredClone(t.bindings)),this.#o=Ar(this.#e),this.#t=new Ue(t.source),this.#r=new Fe}get bindings(){return this.#e}set bindings(t){let e=nt(structuredClone(t)),o=Ar(e),s=this.#o.hash;if(o.hash!==s)throw new Error("incompatible bindings");this.#e=e,this.#o.rootList=o.rootList}*evaluate(t=performance.now()){let e=this.#t.take();this.#r.clock.update(t),this.#r.recentSamples=e,this.#r.dt=this.#r.clock.since/1e3;for(let{code:o,value:s}of e)this.#r.latestValues.set(o,s);for(let[o,s]of this.#o.rootList.entries()){let n=Sr(this.#r,s);n!==0&&(yield{id:o,value:n})}for(let{code:o,value:s}of e)this.#r.previousValues.set(o,s)}encode(t=performance.now()){return Re(this.#o.hash,[...this.evaluate(t)])}clear(){this.#t.take()}dispose(){return this.#t.dispose()}};var Ge=class{get;constructor(t){this.get=t}get gamepad(){return this.get()}};function Wo(r,t){let e=r;return()=>{let o=t();return o!=null&&(e=o),e}}function Ke(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 a=()=>navigator.getGamepads()[i.index],c=new Ge(Wo(i,a)),l=r(c);t.set(i.index,{pad:c,dispose:l})}}function s(){for(let[i,{pad:a,dispose:c}]of t)navigator.getGamepads()[a.gamepad.index]?.connected||(c(),t.delete(i))}e();let n=E(window,{gamepadconnected:e,gamepaddisconnected:e});return()=>{n();for(let{dispose:i}of t.values())i();t.clear()}}var L=class{onSample=U();dispose=V()};var Pt=class extends L{pad;#t=new Map;constructor(t){super(),this.pad=t}get gamepad(){return this.pad.gamepad}poll(){let t=this.gamepad;this.#o(t),this.#r(t)}#e(t,e){let o=this.#t.get(t)??0;e!==o&&(this.#t.set(t,e),this.onSample.publish({code:t,value:e}))}#o(t){let e=0;for(let[o,s]of t.buttons.entries()){let n=s.value;this.#e(`gamepad.${o+1}`,n),e=Math.max(e,n)}this.#e("gamepad.any",e>=.9?1:0)}#r(t){for(let[e,o]of t.axes.entries())this.#e(`gamepad.axis.${e+1}`,o)}};function Fo(r,t){return Ke(e=>{let o=new Pt(e),s=new Mt({source:o,bindings:r.bindings});r.plug(s);let n=t?.(s,o);return()=>{r.remove(s),n?.()}})}var Je=class extends L{#t;constructor(...t){super(),this.#t=t;for(let e of t)this.dispose.schedule(e.onSample(o=>this.onSample.publish(o)))}poll(){for(let t of this.#t)t.poll?.()}};var Ze=class{$hex=S("");clear=to(250,()=>{this.$hex.set("")});update(t){this.$hex(ge(new Uint8Array(t))),this.clear()}};function zt(r){return`pointer.${r+1}`}var Qe=class extends L{client=new qe;constructor(t=window){super(),this.dispose.schedule(E(t,this.#t))}#t={pointerdown:t=>{this.onSample.publish({code:zt(t.button),value:1})},pointerup:t=>{this.onSample.publish({code:zt(t.button),value:0})},pointermove:({clientX:t,clientY:e,movementX:o,movementY:s})=>{this.client.set_(t,e),o&&this.onSample.publish({code:"pointer.x",value:o}),s&&this.onSample.publish({code:"pointer.y",value:s})},wheel:({deltaX:t,deltaY:e})=>{t&&this.onSample.publish({code:"pointer.wheel.x",value:t}),e&&this.onSample.publish({code:"pointer.wheel.y",value:e})}}};var Xe=class extends L{#t=new Set;constructor(t=window){super(),this.dispose.schedule(E(t,this.#e)),this.dispose.schedule(E(window,this.#o))}#e={keydown:t=>{t.repeat||(this.#t.size===0&&this.onSample.publish({code:"keyboard.any",value:1}),this.onSample.publish({code:t.code,value:1}),this.#t.add(t.code))},keyup:t=>{this.onSample.publish({code:t.code,value:0}),this.#t.delete(t.code),this.#t.size===0&&this.onSample.publish({code:"keyboard.any",value:0})}};#o={blur:()=>{for(let t of this.#t)this.onSample.publish({code:t,value:0});this.#t.size&&this.onSample.publish({code:"keyboard.any",value:0}),this.#t.clear()}}};var Go=q`@layer core {
28
+ `;function R(r,t){return(e,o)=>ho(e,{pending:r,err:t,ok:o})}var sd=R(j(10,[" "," ",". ",".. ","..."," .."," ."]),D);var ld=R(j(3,["\u{1F30E}","\u{1F30F}","\u{1F30D}"]),D);var md=R(j(10,["\u{1F312}","\u{1F313}","\u{1F314}","\u{1F315}","\u{1F316}","\u{1F317}","\u{1F318}","\u{1F311}","\u{1F311}","\u{1F311}"]),D);var yd=R(j(16,["|","/","-","\\"]),D);var Sd=R(j(20,[":....",":....","::...",".::..","..::.","...::","....:","....:","...::","..::.",".::..","::..."]),D);var _o=r=>r;var Co=r=>r,Eo=r=>r;var ln=_o({looking:{horizontal:["accumulate","pointer.x"],vertical:["accumulate","pointer.y"]},moving:{forward:"KeyW",backward:"KeyS",leftward:"KeyA",rightward:"KeyD"},interactions:{use:"KeyE"}}),Mo=Eo({standard:{label:"\u2328\uFE0Fstandard",bindings:ln},gamer:{label:"\u{1F3AE}gamer",bindings:{looking:{horizontal:["*",["dt"],"gamepad.axis.3",100],vertical:["*",["dt"],"gamepad.axis.4",100]},moving:{forward:["remap",0,-1,0,1,"gamepad.axis.2"],backward:["remap",0,1,0,1,"gamepad.axis.2"],leftward:["remap",0,-1,0,1,"gamepad.axis.1"],rightward:["remap",0,1,0,1,"gamepad.axis.1"]},interactions:{use:"gamepad.1"}}},micro:{label:"\u{1F9A0}micro",bindings:{looking:{horizontal:["*",["dt"],["+","gamepad.1",["-","gamepad.4"]],100],vertical:["*",["dt"],["+","gamepad.2",["-","gamepad.3"]],100]},moving:{forward:["remap",0,-1,0,1,"gamepad.axis.2"],backward:["remap",0,1,0,1,"gamepad.axis.2"],leftward:["remap",0,-1,0,1,"gamepad.axis.1"],rightward:["remap",0,1,0,1,"gamepad.axis.1"]},interactions:{use:["*","gamepad.5","gamepad.6"]}}}});function Po({start:r,end:t}){if(C(r)&&C(t))return IDBKeyRange.bound(r,t,!1,!0);if(C(r))return IDBKeyRange.lowerBound(r,!1);if(C(t))return IDBKeyRange.upperBound(t,!0)}async function zo(r){return new Promise((t,e)=>{r.onsuccess=()=>t(r.result),r.onerror=()=>e(r.error)})}function Oo({db:r,storeName:t}){let e=o=>(async s=>{let n=r.transaction(t,o),i=n.objectStore(t),a=new Promise((c,l)=>{n.onabort=()=>l(n.error??new Error("transaction aborted")),n.oncomplete=()=>c(void 0)});try{let c=await s(i,zo);return n.commit(),await a,c}catch(c){try{n.abort()}catch{}throw c}});return{readonly:e("readonly"),readwrite:e("readwrite")}}var Ee=class{#t;constructor(t){this.#t=Oo(t)}async commit(t){return this.#t.readwrite(async e=>{for(let[o,s]of t)s===void 0?e.delete(o):e.put(s,o)})}async getMany(t){return this.#t.readonly((e,o)=>Promise.all(t.map(s=>o(e.get(s)))))}async*entries(t={}){t.limit!==0&&(yield*await this.#t.readonly(async(e,o)=>{let s=[],n=t.reverse?"prev":"next",i=e.openCursor(Po(t),n),a=await o(i);for(;a&&(s.push([a.key,a.value]),!(t.limit!==void 0&&s.length>=t.limit));)a.continue(),a=await o(i);return s}))}};var To=(r,t)=>r<t?-1:r>t?1:0;function Bo(r,{start:t,end:e}){return!(t!==void 0&&r<t||e!==void 0&&r>=e)}function*vr(r,t){if(r.limit===0)return;let e=t.filter(([o,s])=>s!==void 0&&Bo(o,r)).sort(([o],[s])=>To(o,s));r.reverse&&e.reverse(),yield*e.slice(0,r.limit??1/0)}var Me=class{#t=new Map;async commit(t){for(let[e,o]of t)o===void 0?this.#t.delete(e):this.#t.set(e,structuredClone(o))}async getMany(t){return t.map(e=>structuredClone(this.#t.get(e)))}async*entries(t={}){yield*vr(t,[...this.#t.entries()].map(([e,o])=>[e,structuredClone(o)]))}};async function jo(r,t=r){return{db:await new Promise((o,s)=>{let n=indexedDB.open(r,1);n.onblocked=()=>s(new Error("idb blocked")),n.onerror=()=>s(n.error),n.onupgradeneeded=()=>n.result.createObjectStore(t),n.onsuccess=()=>o(n.result)}),storeName:t}}var Pe=class{#t;#e;constructor(t,e){this.#t=t,this.#e=e}set(t){return this.#e.set(this.#t,t)}delete(){return this.#e.delete(this.#t)}};var ze=class{kv;key;op;constructor(t,e){this.kv=t,this.key=e,this.op=new Pe(e,t.op)}async set(t){return this.kv.set(this.key,t)}async get(){return this.kv.get(this.key)}async has(){return await this.get()!==void 0}async need(){return k(await this.get(),`key not found "${this.key}"`)}async delete(){return this.kv.set(this.key,void 0)}};var Et=it({divisor:".",delimiter:":",chunkSize:1024});function Zt(r){for(let t=r.length-1;t>=0;t--){let e=r.charCodeAt(t);if(e<65535)return r.slice(0,t)+String.fromCharCode(e+1)}}var Oe=class{#t;#e=[{}];constructor(t,e){if(this.#t=t,e.length){let o=e.join(Et.divisor),s=o+".",n=o+":";this.#e=[{start:n,end:Zt(n)},{start:s,end:Zt(s)}]}}async count(){let t=0;for(let e of this.#e)for await(let o of this.#t.entries(e))t++;return t}async clear(){let t=[];for(let e of this.#e)for await(let[o]of this.#t.entries(e))t.push([o,void 0]),t.length>=1024&&(await this.#t.commit(t),t=[]);t.length&&await this.#t.commit(t)}};var Te=class{#t;constructor(t){this.#t=t}set(t,e){return[this.#t.prefix(t),e]}delete(t){return[this.#t.prefix(t),void 0]}};var{divisor:pn,delimiter:hn}=Et,Be=class{#t;#e;constructor(t){let{scopes:e}=t;this.#t=e.join(pn)+hn,this.#e=Zt(this.#t)}prefix=t=>this.#t+t;unprefix=t=>t.slice(this.#t.length);scan=t=>{let{start:e,end:o,limit:s,reverse:n}=t;return{start:this.#t+(e??""),end:o===void 0?this.#e:this.#t+o,limit:s,reverse:n}}};function Do(r){let t=r.limit;if(t!==void 0){if(!Number.isInteger(t))throw new Error("scan limit must be integer");if(t<0)throw new Error("scan limit must be positive")}return r}function Lo(r){for(let t of r){if(t==="")throw new Error("invalid scope empty string");Ro(t,"."),Ro(t,":")}return r}function Ro(r,t){if(r.includes(t))throw new Error(`invalid scope "${r}" contains illegal "${t}"`)}var je=class r{op;subtree;#t;#e;#o;#r;constructor(t=new Me,e={}){this.#t=t,this.#r={strict:!1,scopes:[],...e},Lo(this.#r.scopes),this.#e=new Be(this.#r),this.op=new Te(this.#e),this.subtree=new Oe(this.#t,this.#r.scopes),this.#o=this.#r.strict?o=>JSON.parse(JSON.stringify(o)):o=>o}cell(t){return new ze(this,t)}scope(...t){return new r(this.#t,{...this.#r,scopes:[...this.#r.scopes,...t]})}async commit(t){await this.#t.commit(t.map(([e,o])=>[e,o===void 0?void 0:this.#o(o)]))}async set(t,e){return this.commit([this.op.set(t,e)])}async setMany(t){return this.commit(t.map(([e,o])=>this.op.set(e,o)))}async delete(...t){return this.commit(t.map(e=>this.op.delete(e)))}async getMany(t){return t=t.map(e=>this.#e.prefix(e)),(await this.#t.getMany(t)).map(e=>e===void 0?void 0:e)}async get(t){let[e]=await this.getMany([t]);return e}async has(t){return await this.get(t)!==void 0}async need(t){return k(await this.get(t),`key not found "${t}"`)}async needMany(t){let e=await this.getMany(t);for(let[o,s]of t.entries())k(e[o],`key not found "${s}"`);return e}async*entries(t={}){t=Do(this.#e.scan(t));for await(let[e,o]of this.#t.entries(t)){let s=this.#e.unprefix(e);o!==void 0&&(yield[s,o])}}[Symbol.asyncIterator](){return this.entries()}async*keys(t={}){for await(let[e]of this.entries(t))yield e}async*values(t={}){for await(let[,e]of this.entries(t))yield e}async count(t={}){let e=0;for await(let o of this.keys(t))e++;return e}async clear(t={}){let e=[];for await(let[o]of this.entries(t))e.push(this.op.delete(o)),e.length>=Et.chunkSize&&(await this.commit(e),e=[]);e.length&&await this.commit(e)}};function No(r){let e=r.reduce((a,{intents:c})=>a+8+c.byteLength,0),o=new ArrayBuffer(e),s=new DataView(o),n=new Uint8Array(o),i=0;for(let{playerId:a,intents:c}of r)s.setUint32(i,a,!1),i+=4,s.setUint32(i,c.byteLength,!1),i+=4,n.set(new Uint8Array(c),i),i+=c.byteLength;return o}function Re(r,t){let e=4+t.length*6,o=new ArrayBuffer(e),s=new DataView(o),n=0;s.setUint32(n,r,!1),n+=4;for(let i of t)s.setUint16(n,i.id,!1),n+=2,s.setFloat32(n,i.value,!1),n+=4;return o}function ct(r){return!!(r===null||xt(r)||bt(r)||be(r))}function V(r){let t=[];function e(o,s){if(ct(o))t.push(s.join("."));else for(let[n,i]of Object.entries(o))e(i,[...s,n])}return e(r,["b"]),so(...t)}var Le=class{bindings;#t;#e=new vt;#o=new Vt;#r=new O;constructor(t){this.bindings=t,this.#t=V(t)}get playerIds(){return[...this.#r.keys()]}get controllers(){return{unassigned:[...this.#o],assigned:new Map([...this.#r].map(([t,e])=>[t,[...e.controllers]]))}}createPlayer(){let t=this.#e.next();return this.#r.set(t,{controllers:new Vt}),t}deletePlayer(t){return this.#r.get(t)?.controllers.forEach(e=>this.#o.add(e)),this.#r.delete(t),this}add(t){return this.unplug(t),this}remove(t){return this.unplug(t),this.#o.delete(t),this}unplug(t){this.#o.add(t);for(let e of this.#r.values())e.controllers.delete(t);return this}plug(t,e){return e??=this.playerIds.at(-1)??this.createPlayer(),this.unplug(t),k(this.#r.get(e)).controllers.add(t),this.#o.delete(t),this}encode(t,e=performance.now()){let o=new Map,{controllers:s}=k(this.#r.get(t));for(let i of s)for(let a of i.evaluate(e)){let c=o.get(a.id)??0;o.set(a.id,c+a.value)}let n=[...o].filter(([,i])=>i!==0).map(([i,a])=>({id:i,value:a}));return Re(this.#t,n)}encodeAll(t=performance.now()){for(let o of this.#o)o.clear();let e=Array.from(this.#r.keys()).map(o=>({playerId:o,intents:this.encode(o,t)}));return No(e)}};function $r(r,t){let{presets:e,customs:o,fallback:s}=r.profiles;return t===void 0?s.profile:o.get(t)??e.get(t)??k(e.get(s.key))}async function Ne(r,t,e){let{kvs:o,controllers:s,assignments:n}=r;t.bindings=$r(r,e).bindings,n.set(t,e),await ye(s.get(t)?.handle,async i=>{r.preferences.set(i,e),await o.preferences.set(i,e)})}function Io(r,t){return V(r)===V(t)}var Ie=class{#t;constructor(t){this.#t=t}#e(t){if(!Io(t,this.#t.bindings))throw new Error("incompatible bindings")}get presets(){return[...this.#t.profiles.presets]}get customs(){return[...this.#t.profiles.customs]}isPreset(t){return this.#t.profiles.presets.has(t)}get(t){return $r(this.#t,t)}async create(t,e){let{kvs:o,profiles:s}=this.#t;this.#e(e.bindings),s.customs.set(t,e),await o.profiles.set(t,e),this.#t.subby.publish()}async clone(t,e){let{label:o,bindings:s}=this.get(e);await this.create(t,{basedOn:e,bindings:s,label:`${o} copy`})}async delete(t){let{kvs:e,assignments:o,profiles:{customs:s,fallback:n}}=this.#t;s.delete(t),await e.profiles.delete(t);for(let[i,a]of o)a===t&&await Ne(this.#t,i,n.key);this.#t.subby.publish()}async update(t,e){let{kvs:o,assignments:s,profiles:{customs:n}}=this.#t;e.bindings&&this.#e(e.bindings);let i=this.get(t),a={...structuredClone(i),...e};n.set(t,a);for(let[c,l]of s)l===t&&(c.bindings=a.bindings);await o.profiles.set(t,a),this.#t.subby.publish()}};function Ho(r){let{presets:t}=r,e=k(Object.keys(t)[0],"missing presets"),o=k(t[e]),s=o.bindings,n=r.kv.scope(V(s).toString()),i={presets:new O,customs:new O,fallback:{key:e,profile:o}};return Ht(i.presets,Object.entries(t)),{subby:q(),kv:n,presets:t,bindings:s,idCounter:new vt,profiles:i,controllers:new O,assignments:new O,preferences:new O,kvs:{profiles:n.scope("profiles"),preferences:n.scope("preferences")}}}var He=class{#t;constructor(t){this.#t=t}async assign(t,e){await Ne(this.#t,t,e),this.#t.subby.publish()}assignedProfileKeyOf(t){let{assignments:e}=this.#t;return e.get(t)??this.#t.profiles.fallback.key}};var Ve=class{#t;profiles;assignments;presets;constructor(t){this.#t=Ho(t),this.profiles=new Ie(this.#t),this.assignments=new He(this.#t),this.presets=t.presets}get on(){return this.#t.subby.on}#e(t){let{preferences:e,assignments:o,controllers:s}=this.#t,n=k(s.get(t)),i=o.get(t)??e.get(n.handle)??n.defaultProfileKey;t.bindings=this.profiles.get(i).bindings,o.set(t,i)}async load(){let{kvs:t,controllers:e,preferences:o,profiles:{customs:s}}=this.#t;s.clear(),Ht(s,await mr(t.profiles)),o.clear(),Ht(o,await mr(t.preferences));for(let n of e.keys())this.#e(n)}get controllers(){return[...this.#t.controllers.keys()]}get fallbackProfileKey(){return this.#t.profiles.fallback.key}meta(t){return this.#t.controllers.get(t)}attach(t,e){let o=this.#t.idCounter.next();this.#t.controllers.set(t,{...e,id:o}),this.#e(t)}detach(t){this.#t.controllers.delete(t),this.#t.assignments.delete(t)}};function Qt(r){let[t,e]=Object.entries(r)[0];return{key:t,profile:e}}async function Vo(r){let t=r.kv??new je(new Ee(await jo("tact","kv"))),e=r.broadcastChannel??new BroadcastChannel("tact"),{maxPlayers:o}=r,{bindings:s}=Qt(r.presets).profile,n=new Le(s),i=new Ve({...r,kv:t});return await i.load(),e.onmessage=()=>i.load(),i.on(()=>e.postMessage({})),Co({hub:n,controls:i,maxPlayers:o})}var kr=1024,Ue=class{dispose;#t;#e=[];constructor(t){this.#t=t,this.dispose=t.onSample(e=>{this.#e.push(e),this.#e.length>kr&&console.warn(`tact sampler exceeded limit ${kr}`),this.#e=xe(this.#e,kr)})}take(){this.#t.poll?.();let t=this.#e;return this.#e=[],t}};var{min:mn,max:fn,abs:gn,sign:bn,floor:Uf,ceil:qf,pow:Wf}=Math;function lt(r,t=0,e=1){return r=mn(r,e),r=fn(r,t),r}function xn(r,t,e,o){let n=(e-t)*r;return o!==void 0&&gn(n)>o&&(n=bn(n)*o),t+n}function yn(r,t,e){return(r-t)/(e-t)}function Uo(r,t,e,o=0,s=1,n=!1){let i=yn(r,t,e);return n&&(i=lt(i)),xn(i,o,s)}var qe=class r{x;y;constructor(t=0,e=0){this.x=t,this.y=e}static new(t=0,e=0){return new this(t,e)}static zero(){return new this}static fill(t){return new this(t,t)}static from(t){return Array.isArray(t)?new this(...t):new this(t.x,t.y)}static magnitudeSquared(t,e){return t*t+e*e}static magnitude(t,e){return Math.sqrt(this.magnitudeSquared(t,e))}static average(...t){return new this().add(...t).divBy(t.length)}static min(...t){return new this(Math.min(...t.map(e=>e.x)),Math.min(...t.map(e=>e.y)))}static max(...t){return new this(Math.max(...t.map(e=>e.x)),Math.max(...t.map(e=>e.y)))}static rotation(t){return new this(Math.cos(t),Math.sin(t))}dup(){return new this.constructor(this.x,this.y)}*[Symbol.iterator](){yield this.x,yield this.y}array(){return[this.x,this.y]}toJSON(){return this.array()}toString(){return`(${this.constructor.name} x${this.x.toFixed(2)}, y${this.y.toFixed(2)})`}fill(t){return this.x=t,this.y=t,this}zero(){return this.fill(0)}set_(t,e){return this.x=t,this.y=e,this}set({x:t,y:e}){return this.x=t,this.y=e,this}from(t){if(Array.isArray(t)){let[e,o]=t;this.x=e,this.y=o}else{let{x:e,y:o}=t;this.x=e,this.y=o}return this}magnitudeSquared(){return r.magnitudeSquared(this.x,this.y)}magnitude(){return r.magnitude(this.x,this.y)}rotation(){return Math.atan2(this.y,this.x)}equals_(t,e){return this.x===t&&this.y===e}equals(...t){return t.every(({x:e,y:o})=>this.equals_(e,o))}near_(t,e,o=1e-6){return Math.abs(this.x-t)<=o&&Math.abs(this.y-e)<=o}near({x:t,y:e},o=1e-6){return this.near_(t,e,o)}dot_(t,e){return this.x*t+this.y*e}dot({x:t,y:e}){return this.dot_(t,e)}distanceSquared_(t,e){return t=this.x-t,e=this.y-e,t*t+e*e}distanceSquared({x:t,y:e}){return this.distanceSquared_(t,e)}distance_(t,e){return Math.sqrt(this.distanceSquared_(t,e))}distance({x:t,y:e}){return this.distance_(t,e)}angleBetween_(t,e){let o=this.dot_(t,e),s=this.magnitude()*r.magnitude(t,e);if(s===0)return 0;let n=lt(o/s,-1,1);return Math.acos(n)}angleBetween({x:t,y:e}){return this.angleBetween_(t,e)}normalize(){return this.divBy(this.magnitude())}half(){return this.divBy(2)}double(){return this.mulBy(2)}abs(){return this.map(t=>Math.abs(t))}rotate(t){let{x:e,y:o}=this;return this.x=e*Math.cos(t)-o*Math.sin(t),this.y=e*Math.sin(t)+o*Math.cos(t),this}perpendicular(){let{x:t,y:e}=this;return this.x=-e,this.y=t,this}clampMagnitude(t){return this.magnitude()>t&&this.normalize().mulBy(t),this}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}map(t){return this.x=t(this.x,0),this.y=t(this.y,1),this}morph(t){let e=t(this);return e&&e!==this&&this.set(e),this}clamp(t={x:0,y:0},e={x:1,y:1}){return this.x=lt(this.x,t.x,e.x),this.y=lt(this.y,t.y,e.y),this}clampBy(t=0,e=1){return this.x=lt(this.x,t,e),this.y=lt(this.y,t,e),this}negate(){return this.map(t=>t*-1)}addBy(t){return this.x+=t,this.y+=t,this}subBy(t){return this.x-=t,this.y-=t,this}mulBy(t){return this.x*=t,this.y*=t,this}scale(t){return this.x*=t,this.y*=t,this}divBy(t){return t===0?this:(this.x/=t,this.y/=t,this)}add_(t,e){return this.x+=t,this.y+=e,this}add(...t){for(let{x:e,y:o}of t)this.add_(e,o);return this}sub_(t,e){return this.x-=t,this.y-=e,this}sub(...t){for(let{x:e,y:o}of t)this.sub_(e,o);return this}mul_(t,e){return this.x*=t,this.y*=e,this}mul(...t){for(let{x:e,y:o}of t)this.mul_(e,o);return this}div_(t,e){return t!==0&&(this.x/=t),e!==0&&(this.y/=e),this}div(...t){for(let{x:e,y:o}of t)this.div_(e,o);return this}lerp_(t,e,o){return this.x+=(t-this.x)*o,this.y+=(e-this.y)*o,this}lerp(t,{x:e,y:o}){return this.lerp_(t,e,o)}reflect_(t,e){let o=2*this.dot_(t,e);return this.x-=o*t,this.y-=o*e,this}reflect({x:t,y:e}){return this.reflect_(t,e)}rotateAroundPoint_(t,e,o){let s=this.x-e,n=this.y-o,i=Math.cos(t),a=Math.sin(t);return this.x=i*s-a*n+e,this.y=a*s+i*n+o,this}rotateAroundPoint(t,{x:e,y:o}){return this.rotateAroundPoint_(t,e,o)}};function ut(r){return r!==0}function Sr(r,t){let e=o=>Sr(r,o);if(t===null)return 0;if(bt(t))return t;if(xt(t)){let o=r.latestValues.get(t)??0;return r.recentSamples.filter(s=>s.code===t).reduce((s,n)=>Math.abs(n.value)>Math.abs(s)?n.value:s,o)}else switch(t[0]){case"accumulate":{let o=t[1],s=0;for(let n of r.recentSamples)n.code===o&&(s+=n.value);return s}case"up":{let o=t[1],s=0,n=r.previousValues.get(o)??0;for(let i of r.recentSamples)i.code===o&&(ut(n)&&!ut(i.value)&&s++,n=i.value);return s}case"down":{let o=t[1],s=0,n=r.previousValues.get(o)??0;for(let i of r.recentSamples)i.code===o&&(!ut(n)&&ut(i.value)&&s++,n=i.value);return s}case"was":{let o=t[1];return r.previousValues.get(o)??0}case"since":{let o=t[1],s=r.previousValues.get(o)??0;return(r.latestValues.get(o)??0)-s}case"if":{let[,o,s,n]=t;return e(o)?e(s):C(n)?e(n):0}case"min":return Math.min(...t.slice(1).map(e));case"max":return Math.max(...t.slice(1).map(e));case"+":return t.slice(1).map(e).reduce((o,s)=>o+s,0);case"*":return t.slice(1).map(e).reduce((o,s)=>o*s,1);case"==":return+(e(t[1])===e(t[2]));case"!=":return+(e(t[1])!==e(t[2]));case">":return+(e(t[1])>e(t[2]));case"<":return+(e(t[1])<e(t[2]));case">=":return+(e(t[1])>=e(t[2]));case"<=":return+(e(t[1])<=e(t[2]));case"!":return+(e(t[1])===0);case"!!":return+(e(t[1])!==0);case"-":{let[,o,...s]=t;if(s.length===0)return-e(o);let n=e(o);for(let i of s)n-=e(i);return n}case"clamp":{let[,o,s,n]=t,i=e(n);return Math.min(s===null?1/0:e(s),Math.max(o===null?-1/0:e(o),i))}case"remap":{let[o,s,n,i,a]=t.slice(1).map(e);return Uo(a,o,s,n,i)}case"dt":return r.dt;case"held":{let[,o,s]=t,n=ut(e(s)),i=r.holding.get(t);return n&&!i&&(i={start:r.clock.time},r.holding.set(t,i)),!n&&i&&(i=void 0,r.holding.delete(t)),i&&r.clock.time-i.start>=o?1:0}case"taps":{let[,o,s,n]=t,i=e(n),a=r.clock.time,c=yt(r.tapping,t,()=>({events:[]}));for(let l=0;l<i;l++)c.events.push(a);return c.events=xe(c.events.filter(l=>l>=a-s),128),c.events.length>=o?(c.events=[],1):0}case"mod":{let[,...o]=t,s=l=>ut(r.latestValues.get(l)??0),n=s("ShiftLeft")||s("ShiftRight"),i=s("ControlLeft")||s("ControlRight"),a=s("AltLeft")||s("AltRight"),c=s("MetaLeft")||s("MetaRight");return o.includes("shift")!==n||o.includes("ctrl")!==i||o.includes("alt")!==a||o.includes("meta")!==c?0:1}default:throw new Error("unknown expression")}}var We=class{time;since=0;last;constructor(t=performance.now()){this.time=t}update(t=performance.now()){this.since=t-(this.time??t),this.last=this.time,this.time=t}};var Fe=class{dt=0;clock=new We;recentSamples=[];latestValues=new Map;previousValues=new Map;holding=new Map;tapping=new Map};function qo(){return{value:0,was:0,sum:0}}function Ar(r){let t=V(r),e=[],o=[];function s(i){if(ct(i)){let a=qo();return e.push(a),o.push(i),a}else return fr(i,s)}let n=s(r);return{hash:t,inputs:n,inputList:e,rootList:o}}var Mt=class{#t;#e;#o;#r;constructor(t){this.#e=it(structuredClone(t.bindings)),this.#o=Ar(this.#e),this.#t=new Ue(t.source),this.#r=new Fe}get bindings(){return this.#e}set bindings(t){let e=it(structuredClone(t)),o=Ar(e),s=this.#o.hash;if(o.hash!==s)throw new Error("incompatible bindings");this.#e=e,this.#o.rootList=o.rootList}*evaluate(t=performance.now()){let e=this.#t.take();this.#r.clock.update(t),this.#r.recentSamples=e,this.#r.dt=this.#r.clock.since/1e3;for(let{code:o,value:s}of e)this.#r.latestValues.set(o,s);for(let[o,s]of this.#o.rootList.entries()){let n=Sr(this.#r,s);n!==0&&(yield{id:o,value:n})}for(let{code:o,value:s}of e)this.#r.previousValues.set(o,s)}encode(t=performance.now()){return Re(this.#o.hash,[...this.evaluate(t)])}clear(){this.#t.take()}dispose(){return this.#t.dispose()}};var Ge=class{get;constructor(t){this.get=t}get gamepad(){return this.get()}};function Wo(r,t){let e=r;return()=>{let o=t();return o!=null&&(e=o),e}}function Ke(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 a=()=>navigator.getGamepads()[i.index],c=new Ge(Wo(i,a)),l=r(c);t.set(i.index,{pad:c,dispose:l})}}function s(){for(let[i,{pad:a,dispose:c}]of t)navigator.getGamepads()[a.gamepad.index]?.connected||(c(),t.delete(i))}e();let n=E(window,{gamepadconnected:e,gamepaddisconnected:e});return()=>{n();for(let{dispose:i}of t.values())i();t.clear()}}var L=class{onSample=q();dispose=U()};var Pt=class extends L{pad;#t=new Map;constructor(t){super(),this.pad=t}get gamepad(){return this.pad.gamepad}poll(){let t=this.gamepad;this.#o(t),this.#r(t)}#e(t,e){let o=this.#t.get(t)??0;e!==o&&(this.#t.set(t,e),this.onSample.publish({code:t,value:e}))}#o(t){let e=0;for(let[o,s]of t.buttons.entries()){let n=s.value;this.#e(`gamepad.${o+1}`,n),e=Math.max(e,n)}this.#e("gamepad.any",e>=.9?1:0)}#r(t){for(let[e,o]of t.axes.entries())this.#e(`gamepad.axis.${e+1}`,o)}};function Fo(r,t){return Ke(e=>{let o=new Pt(e),s=new Mt({source:o,bindings:r.bindings});r.plug(s);let n=t?.(s,o);return()=>{r.remove(s),n?.()}})}function Go(r,t){return r.length>t?r.slice(0,t)+"...":r}var Je=class extends L{#t;constructor(...t){super(),this.#t=t;for(let e of t)this.dispose.schedule(e.onSample(o=>this.onSample.publish(o)))}poll(){for(let t of this.#t)t.poll?.()}};var Ze=class{$hex=S("");clear=to(250,()=>{this.$hex.set("")});update(t){this.$hex(ge(new Uint8Array(t))),this.clear()}};function zt(r){return`pointer.${r+1}`}var Qe=class extends L{client=new qe;constructor(t=window){super(),this.dispose.schedule(E(t,this.#t))}#t={pointerdown:t=>{this.onSample.publish({code:zt(t.button),value:1})},pointerup:t=>{this.onSample.publish({code:zt(t.button),value:0})},pointermove:({clientX:t,clientY:e,movementX:o,movementY:s})=>{this.client.set_(t,e),o&&this.onSample.publish({code:"pointer.x",value:o}),s&&this.onSample.publish({code:"pointer.y",value:s})},wheel:({deltaX:t,deltaY:e})=>{t&&this.onSample.publish({code:"pointer.wheel.x",value:t}),e&&this.onSample.publish({code:"pointer.wheel.y",value:e})}}};var Xe=class extends L{#t=new Set;constructor(t=window){super(),this.dispose.schedule(E(t,this.#e)),this.dispose.schedule(E(window,this.#o))}#e={keydown:t=>{t.repeat||(this.#t.size===0&&this.onSample.publish({code:"keyboard.any",value:1}),this.onSample.publish({code:t.code,value:1}),this.#t.add(t.code))},keyup:t=>{this.onSample.publish({code:t.code,value:0}),this.#t.delete(t.code),this.#t.size===0&&this.onSample.publish({code:"keyboard.any",value:0})}};#o={blur:()=>{for(let t of this.#t)this.onSample.publish({code:t,value:0});this.#t.size&&this.onSample.publish({code:"keyboard.any",value:0}),this.#t.clear()}}};var Ko=W`@layer core {
29
29
 
30
30
  ::selection {
31
31
  color: var(--selection);
@@ -55,14 +55,14 @@ a {
55
55
  }
56
56
  }
57
57
 
58
- }`;var Ko=q`@layer vars {
58
+ }`;var Jo=W`@layer vars {
59
59
 
60
60
  :is(:root, :host) {
61
61
  ${vn({bg:"#111",alpha:"#def",rounded:"0.5em",padding:"0.5em",prime:"#d068ff",code:"#3f1",link:"cyan",selection:"white","selection-bg":"#f70",lame:"#8888",angry:"#f50",zesty:"#cf0",happy:"#0fa",calm:"#0af",sad:"#74f",quirky:"#f49","inactive-opacity":"0.5","anim-duration":"150ms"})}
62
62
  }
63
63
 
64
64
  }`;function wn([r,t]){return`--${r}: var(--shiny-${r}, ${t});`}function vn(r){return Object.entries(r).map(wn).join(`
65
- `)}var Jo=q`@layer reset {
65
+ `)}var Zo=W`@layer reset {
66
66
 
67
67
  * {
68
68
  margin: 0;
@@ -78,15 +78,15 @@ a {
78
78
  ::-webkit-scrollbar-thumb { background: #888; border-radius: 1em; }
79
79
  ::-webkit-scrollbar-thumb:hover { background: #999; }
80
80
 
81
- }`;var Zo=q`
81
+ }`;var Qo=W`
82
82
 
83
83
  @layer vars, reset, core, underlay, view, overlay;
84
84
 
85
- ${Ko}
86
85
  ${Jo}
87
- ${Go}
86
+ ${Zo}
87
+ ${Ko}
88
88
 
89
- `;var _r=new CSSStyleSheet;_r.replaceSync(Zo);var Ot=class{length=1;$index=S(0);constructor(t=0){this.$index(t)}clamp(t){return t=Math.min(t,this.length-1),t=Math.max(t,0),t}get index(){return this.clamp(this.$index())}async setIndex(t){return this.$index(t)}async shimmy(t){let e=this.clamp(this.index+t);return this.setIndex(e)}};var Qo=b`@layer view {
89
+ `;var _r=new CSSStyleSheet;_r.replaceSync(Qo);var Ot=class{length=1;$index=S(0);constructor(t=0){this.$index(t)}clamp(t){return t=Math.min(t,this.length-1),t=Math.max(t,0),t}get index(){return this.clamp(this.$index())}async setIndex(t){return this.$index(t)}async shimmy(t){let e=this.clamp(this.index+t);return this.setIndex(e)}};var Xo=b`@layer view {
90
90
 
91
91
  :host {
92
92
  display: inline-flex;
@@ -128,10 +128,10 @@ slot[part="tabs"][data-snug] {
128
128
  }
129
129
  }
130
130
 
131
- } `;var Xo=xo((r={})=>{_t("shiny-tabs"),Ct(_r,Qo);let t=Jt(),e=y(()=>g.attrs(t).spec({index:Number})),o=y(()=>r.control??new Ot(e.index??0)),s=H([]),n=H([]);function i(l){let p=l.currentTarget;s(p.assignedElements())}function a(l){let p=l.currentTarget;n(p.assignedElements())}e.index=o.$index(),o.length=s().length;function c(l,p){let u=o.clamp(l+p);return u===l?!1:u===o.index}for(let[l,p]of s().entries()){let u=l===o.index,m=g.attrs(p);m.booleans.disabled=u,m.booleans["data-snug"]=r.snug,m.booleans["data-tabbed"]=u,m.booleans["data-first"]=l===0,m.booleans["data-last"]=l===o.length-1,m.booleans["data-next-is-tabbed"]=c(l,1),m.booleans["data-previous-is-tabbed"]=c(l,-1),p.onclick=()=>o.setIndex(l)}for(let[l,p]of n().entries()){let u=l===o.index;g.attrs(p).booleans["data-tabbed"]=u,g.attrs(p).booleans.hidden=!u}return h`
131
+ } `;var Yo=xo((r={})=>{_t("shiny-tabs"),Ct(_r,Xo);let t=Jt(),e=y(()=>g.attrs(t).spec({index:Number})),o=y(()=>r.control??new Ot(e.index??0)),s=H([]),n=H([]);function i(l){let p=l.currentTarget;s(p.assignedElements())}function a(l){let p=l.currentTarget;n(p.assignedElements())}e.index=o.$index(),o.length=s().length;function c(l,p){let u=o.clamp(l+p);return u===l?!1:u===o.index}for(let[l,p]of s().entries()){let u=l===o.index,m=g.attrs(p);m.booleans.disabled=u,m.booleans["data-snug"]=r.snug,m.booleans["data-tabbed"]=u,m.booleans["data-first"]=l===0,m.booleans["data-last"]=l===o.length-1,m.booleans["data-next-is-tabbed"]=c(l,1),m.booleans["data-previous-is-tabbed"]=c(l,-1),p.onclick=()=>o.setIndex(l)}for(let[l,p]of n().entries()){let u=l===o.index;g.attrs(p).booleans["data-tabbed"]=u,g.attrs(p).booleans.hidden=!u}return h`
132
132
  <slot part=tabs ?data-snug="${r.snug}" @slotchange="${i}"></slot>
133
133
  <slot part=panels name=panel @slotchange="${a}"></slot>
134
- `});var Yo=b`@layer view {
134
+ `});var ts=b`@layer view {
135
135
 
136
136
  :host {
137
137
  display: block;
@@ -196,7 +196,7 @@ slot[part="tabs"][data-snug] {
196
196
  }
197
197
  }
198
198
 
199
- }`;var Z=b`
199
+ }`;var Q=b`
200
200
  @layer theme, view;
201
201
  @layer theme {
202
202
 
@@ -276,7 +276,7 @@ ${St}
276
276
  --base: var(--tint, var(--prime));
277
277
  font: inherit;
278
278
  color: inherit;
279
- background: transparent;
279
+ background: var(--bg);
280
280
  border: 1px solid var(--base);
281
281
  border-radius: var(--round);
282
282
  padding: var(--nib) var(--pad);
@@ -305,7 +305,7 @@ ${St}
305
305
  box-shadow: inset 0 0 1em oklch(from var(--chill) l c h / 20%);
306
306
  }
307
307
 
308
- }`;var Tt=f`<svg xmlns="http://www.w3.org/2000/svg" width="36" height="36" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="ai ai-GameController"><path d="M9 15l-2.968 2.968A2.362 2.362 0 0 1 2 16.298V15l1.357-6.784A4 4 0 0 1 7.279 5h9.442a4 4 0 0 1 3.922 3.216L22 15v1.297a2.362 2.362 0 0 1-4.032 1.67L15 15H9z"/><path d="M9 5l1 2h4l1-2"/></svg>`;var ts=f`<svg xmlns="http://www.w3.org/2000/svg" width="36" height="36" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="ai ai-SettingsHorizontal"><path d="M3 5h4m14 0H11m-8 7h12m6 0h-2M3 19h2m16 0H9"/><circle cx="9" cy="5" r="2"/><circle cx="17" cy="12" r="2"/><circle cx="7" cy="19" r="2"/></svg>`;var es=b`@layer view {
308
+ }`;var Tt=f`<svg xmlns="http://www.w3.org/2000/svg" width="36" height="36" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="ai ai-GameController"><path d="M9 15l-2.968 2.968A2.362 2.362 0 0 1 2 16.298V15l1.357-6.784A4 4 0 0 1 7.279 5h9.442a4 4 0 0 1 3.922 3.216L22 15v1.297a2.362 2.362 0 0 1-4.032 1.67L15 15H9z"/><path d="M9 5l1 2h4l1-2"/></svg>`;var es=f`<svg xmlns="http://www.w3.org/2000/svg" width="36" height="36" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="ai ai-SettingsHorizontal"><path d="M3 5h4m14 0H11m-8 7h12m6 0h-2M3 19h2m16 0H9"/><circle cx="9" cy="5" r="2"/><circle cx="17" cy="12" r="2"/><circle cx="7" cy="19" r="2"/></svg>`;var rs=b`@layer view {
309
309
 
310
310
  .plate {
311
311
  user-select: none;
@@ -459,7 +459,7 @@ ${St}
459
459
  }
460
460
  }
461
461
 
462
- }`;var rs=f`<svg xmlns="http://www.w3.org/2000/svg" width="36" height="36" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="ai ai-PersonAdd"><circle cx="12" cy="7" r="5"/><path d="M17 22H5.266a2 2 0 0 1-1.985-2.248l.39-3.124A3 3 0 0 1 6.649 14H7"/><path d="M19 14v4"/><path d="M17 16h4"/></svg>`;var Ye=f`<svg xmlns="http://www.w3.org/2000/svg" width="36" height="36" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="ai ai-XSmall"><path d="M17 17L7 7m10 0L7 17"/></svg>`;var Xt=A(r=>{let{dnd:t}=r.context,e=t.dropzone(()=>({playerId:r.playerId}));return h`
462
+ }`;var os=f`<svg xmlns="http://www.w3.org/2000/svg" width="36" height="36" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="ai ai-PersonAdd"><circle cx="12" cy="7" r="5"/><path d="M17 22H5.266a2 2 0 0 1-1.985-2.248l.39-3.124A3 3 0 0 1 6.649 14H7"/><path d="M19 14v4"/><path d="M17 16h4"/></svg>`;var Ye=f`<svg xmlns="http://www.w3.org/2000/svg" width="36" height="36" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="ai ai-XSmall"><path d="M17 17L7 7m10 0L7 17"/></svg>`;var Xt=A(r=>{let{dnd:t}=r.context,e=t.dropzone(()=>({playerId:r.playerId}));return h`
463
463
  <div class="${r.class}"
464
464
  theme-card="${r.themeCard??""}"
465
465
  data-drop-candidate
@@ -471,7 +471,7 @@ ${St}
471
471
 
472
472
  ${r.content}
473
473
  </div>
474
- `});var os=f`<svg xmlns="http://www.w3.org/2000/svg" width="36" height="36" viewBox="0 0 24 24" fill="currentColor" stroke-width="2" class="ai ai-DragVerticalFill"><path fill-rule="evenodd" clip-rule="evenodd" d="M16 2a2 2 0 1 1 0 4 2 2 0 0 1 0-4z"/><path fill-rule="evenodd" clip-rule="evenodd" d="M16 10a2 2 0 1 1 0 4 2 2 0 0 1 0-4z"/><path fill-rule="evenodd" clip-rule="evenodd" d="M8 18a2 2 0 1 1 0 4 2 2 0 0 1 0-4z"/><path fill-rule="evenodd" clip-rule="evenodd" d="M16 18a2 2 0 1 1 0 4 2 2 0 0 1 0-4z"/><path fill-rule="evenodd" clip-rule="evenodd" d="M8 2a2 2 0 1 1 0 4 2 2 0 0 1 0-4z"/><path fill-rule="evenodd" clip-rule="evenodd" d="M8 10a2 2 0 1 1 0 4 2 2 0 0 1 0-4z"/></svg>`;function ss(r){return r*137.508}var tr=A((r,t,e)=>{let{profiles:o}=r.controls;function s(n){let i=n.currentTarget;e(i.value)}return h`
474
+ `});var ss=f`<svg xmlns="http://www.w3.org/2000/svg" width="36" height="36" viewBox="0 0 24 24" fill="currentColor" stroke-width="2" class="ai ai-DragVerticalFill"><path fill-rule="evenodd" clip-rule="evenodd" d="M16 2a2 2 0 1 1 0 4 2 2 0 0 1 0-4z"/><path fill-rule="evenodd" clip-rule="evenodd" d="M16 10a2 2 0 1 1 0 4 2 2 0 0 1 0-4z"/><path fill-rule="evenodd" clip-rule="evenodd" d="M8 18a2 2 0 1 1 0 4 2 2 0 0 1 0-4z"/><path fill-rule="evenodd" clip-rule="evenodd" d="M16 18a2 2 0 1 1 0 4 2 2 0 0 1 0-4z"/><path fill-rule="evenodd" clip-rule="evenodd" d="M8 2a2 2 0 1 1 0 4 2 2 0 0 1 0-4z"/><path fill-rule="evenodd" clip-rule="evenodd" d="M8 10a2 2 0 1 1 0 4 2 2 0 0 1 0-4z"/></svg>`;function ns(r){return r*137.508}var tr=A((r,t,e)=>{let{profiles:o}=r.controls;function s(n){let i=n.currentTarget;e(i.value)}return h`
475
475
  <select
476
476
  part=select
477
477
  theme-select
@@ -494,7 +494,7 @@ ${St}
494
494
  </option>
495
495
  `)}
496
496
  </select>
497
- `});var er=A((r,t)=>{let{deck:e,dnd:o}=r,{controls:s}=e,n=o.dragzone(()=>({controller:t})),i=s.assignments.assignedProfileKeyOf(t),a=s.meta(t)??{id:0,icon:Tt,handle:"controller",name:"controller",tooltip:"",defaultProfileKey:s.fallbackProfileKey},c=`--hue: ${ss(a?.id??0)};`;return h`
497
+ `});var er=A((r,t)=>{let{deck:e,dnd:o}=r,{controls:s}=e,n=o.dragzone(()=>({controller:t})),i=s.assignments.assignedProfileKeyOf(t),a=s.meta(t)??{id:0,icon:Tt,handle:"controller",name:"controller",tooltip:"",defaultProfileKey:s.fallbackProfileKey},c=`--hue: ${ns(a?.id??0)};`;return h`
498
498
  <div class=controller
499
499
  style="${c}"
500
500
  theme-card
@@ -504,7 +504,7 @@ ${St}
504
504
  @dragend="${n.dragend}">
505
505
 
506
506
  <div class=griptape>
507
- ${os}
507
+ ${ss}
508
508
  </div>
509
509
 
510
510
  <h4 class=label title="${a.tooltip}">
@@ -514,7 +514,7 @@ ${St}
514
514
 
515
515
  ${tr(e,i,l=>{s.assignments.assign(t,l)})}
516
516
  </div>
517
- `});var ns=A((r,t,e)=>{let{hub:o}=r.deck,s=()=>o.deletePlayer(t),n=o.controllers.assigned.get(t)??[];return Xt({class:"player",playerId:t,context:r,content:h`
517
+ `});var is=A((r,t,e)=>{let{hub:o}=r.deck,s=()=>o.deletePlayer(t),n=o.controllers.assigned.get(t)??[];return Xt({class:"player",playerId:t,context:r,content:h`
518
518
  <h3>
519
519
  <span>player ${e+1}</span>
520
520
 
@@ -528,14 +528,14 @@ ${St}
528
528
  <div class=controllerlist>
529
529
  ${n.map(i=>er(r,i))}
530
530
  </div>
531
- `})});var Cr=Symbol("droppyNewPlayer");var[is,as]=J(r=>{B(Z,es);let{hub:t}=r,e=t.controllers,o=()=>r.hub.createPlayer(),s=(i,a)=>ns(n,i,a),n=y(()=>({deck:r,dnd:new $e.DragAndDrops({acceptDrop(i,a,c){c.playerId===Cr?t.plug(a.controller,t.createPlayer()):C(c.playerId)?t.plug(a.controller,c.playerId):t.unplug(a.controller)}})}));return h`
531
+ `})});var Cr=Symbol("droppyNewPlayer");var[as,cs]=Z(r=>{B(Q,rs);let{hub:t}=r,e=t.controllers,o=()=>r.hub.createPlayer(),s=(i,a)=>is(n,i,a),n=y(()=>({deck:r,dnd:new $e.DragAndDrops({acceptDrop(i,a,c){c.playerId===Cr?t.plug(a.controller,t.createPlayer()):C(c.playerId)?t.plug(a.controller,c.playerId):t.unplug(a.controller)}})}));return h`
532
532
  <div class=plate ?data-drag-and-drop="${!!n.dnd.dragging}">
533
533
  <div class=playerlist>
534
534
  ${t.playerIds.map(s)}
535
535
 
536
536
  ${kt(t.playerIds.length<r.maxPlayers,()=>Xt({class:"player new",themeCard:"dull",playerId:Cr,context:n,content:h`
537
537
  <button theme-button=naked @click="${o}">
538
- ${rs}
538
+ ${os}
539
539
  <span>add player</span>
540
540
  </button>
541
541
  `}))}
@@ -548,7 +548,7 @@ ${St}
548
548
  `})}
549
549
  </div>
550
550
  </div>
551
- `});var cs=b`@layer view {
551
+ `});var ls=b`@layer view {
552
552
 
553
553
  .plate {
554
554
  display: flex;
@@ -688,7 +688,7 @@ ${St}
688
688
  }
689
689
  }
690
690
 
691
- }`;var ls=f`<svg xmlns="http://www.w3.org/2000/svg" width="36" height="36" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="ai ai-Copy"><path d="M8 4v12a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V7.242a2 2 0 0 0-.602-1.43L16.083 2.57A2 2 0 0 0 14.685 2H10a2 2 0 0 0-2 2z"/><path d="M16 18v2a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h2"/></svg>`;var us=f`<svg xmlns="http://www.w3.org/2000/svg" width="36" height="36" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="ai ai-TrashCan"><path d="M4 6h16l-1.58 14.22A2 2 0 0 1 16.432 22H7.568a2 2 0 0 1-1.988-1.78L4 6z"/><path d="M7.345 3.147A2 2 0 0 1 9.154 2h5.692a2 2 0 0 1 1.81 1.147L18 6H6l1.345-2.853z"/><path d="M2 6h20"/><path d="M10 11v5"/><path d="M14 11v5"/></svg>`;function Er(){return ge.random(16)}var ps=f`<svg xmlns="http://www.w3.org/2000/svg" width="36" height="36" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="ai ai-KeyCap"><path d="M7 3s3 .5 5 .5 5-.5 5-.5l1 9s-3 1-6 1-6-1-6-1l1-9z"/><path d="M3.869 8.147l-.862 10.294c-.03.366.04.733.205 1.06l.197.393A2.01 2.01 0 0 0 5.206 21h13.588a2.01 2.01 0 0 0 1.797-1.106l.197-.392c.165-.328.236-.695.205-1.06l-.862-10.295a3.99 3.99 0 0 0-.79-2.068L17 3s-3 .5-5 .5S6.978 3 6.978 3l-2.32 3.08a3.99 3.99 0 0 0-.79 2.067z"/><path d="M6 12l-2.5 8M18 12l2.5 8"/></svg>`;var hs=f`<svg xmlns="http://www.w3.org/2000/svg" width="36" height="36" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="ai ai-Backspace"><path d="M17 15l-6-6m6 0l-6 6"/><path d="M7.4 4.8A2 2 0 0 1 9 4h11a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H9a2 2 0 0 1-1.6-.8l-4.5-6a2 2 0 0 1 0-2.4l4.5-6z"/></svg>`;var ds=f`<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" class="ai ai-Cross"><path d="M20 20L4 4m16 0L4 20"/></svg>`;function ms(r,t){let e=new Set,o=new Set;function s(a){if(a==="ShiftLeft"||a==="ShiftRight")return"shift";if(a==="ControlLeft"||a==="ControlRight")return"ctrl";if(a==="MetaLeft"||a==="MetaRight")return"meta";if(a==="AltLeft"||a==="AltRight")return"alt"}let n=E(window,{blur:()=>i(),keydown:a=>{if(a.preventDefault(),a.code==="Escape")return i();e.add(a.code),o.add(a.code)},keyup:a=>{if(a.preventDefault(),e.delete(a.code),e.size===0){let c=new Set,l=new Set;for(let p of o){let u=s(p);u?l.add(u):c.add(p)}o.size===0||(c.size===0?r(["*",...o]):l.size>0?r(["*",["mod",...l],...c]):o.size>1?r(["*",...o]):r([...o][0])),i()}}}),i=()=>{n(),t()};return i}function fs(r,t){let{dispose:e,schedule:o}=V();o(t);let s=new Set,n=new Set,i=new Set;return o(E(window,{blur:()=>e()})),o(Ke(a=>{let c=new Pt(a);return s.add(c),c.onSample(l=>{if(l.code!=="gamepad.any")if(l.value>.9)n.add(l.code),i.add(l.code);else{if(!n.delete(l.code))return;n.size===0&&(i.size===1?r([...i][0]):i.size>1&&r(["*",...i]),e())}}),()=>{c.dispose(),s.delete(c)}})),o(wt(async()=>{for(let a of s)a.poll();await $t(16.67)})),e}function gs(r,t){let{dispose:e,schedule:o}=V();o(t);let s=new Set,n=new Set,i=a=>a.composedPath().some(c=>c instanceof Element&&c.matches("button.record"));return o(E(window,{blur:()=>e(),auxclick:a=>a.preventDefault(),mousedown:a=>{if(i(a))return;a.preventDefault();let c=zt(a.button);s.add(c),n.add(c)},mouseup:a=>{let c=zt(a.button);s.delete(c)&&(a.preventDefault(),s.size===0&&(n.size===1?r([...n][0]):n.size>1&&r(["*",...n]),e()))},contextmenu:a=>{a.preventDefault()}})),e}var bs=A((r,t,e,o)=>{let s=H(null),n=()=>s(null),i=()=>{let{dispose:p,schedule:u}=V();u(n),u(ms(t,p)),u(fs(t,p)),u(gs(t,p)),s(p)},a=()=>{s()?.(),n()};function c(){s()?a():i()}function l(){a(),e()}return So(a),h`
691
+ }`;var us=f`<svg xmlns="http://www.w3.org/2000/svg" width="36" height="36" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="ai ai-Copy"><path d="M8 4v12a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V7.242a2 2 0 0 0-.602-1.43L16.083 2.57A2 2 0 0 0 14.685 2H10a2 2 0 0 0-2 2z"/><path d="M16 18v2a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h2"/></svg>`;var ps=f`<svg xmlns="http://www.w3.org/2000/svg" width="36" height="36" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="ai ai-TrashCan"><path d="M4 6h16l-1.58 14.22A2 2 0 0 1 16.432 22H7.568a2 2 0 0 1-1.988-1.78L4 6z"/><path d="M7.345 3.147A2 2 0 0 1 9.154 2h5.692a2 2 0 0 1 1.81 1.147L18 6H6l1.345-2.853z"/><path d="M2 6h20"/><path d="M10 11v5"/><path d="M14 11v5"/></svg>`;function Er(){return ge.random(16)}var hs=f`<svg xmlns="http://www.w3.org/2000/svg" width="36" height="36" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="ai ai-KeyCap"><path d="M7 3s3 .5 5 .5 5-.5 5-.5l1 9s-3 1-6 1-6-1-6-1l1-9z"/><path d="M3.869 8.147l-.862 10.294c-.03.366.04.733.205 1.06l.197.393A2.01 2.01 0 0 0 5.206 21h13.588a2.01 2.01 0 0 0 1.797-1.106l.197-.392c.165-.328.236-.695.205-1.06l-.862-10.295a3.99 3.99 0 0 0-.79-2.068L17 3s-3 .5-5 .5S6.978 3 6.978 3l-2.32 3.08a3.99 3.99 0 0 0-.79 2.067z"/><path d="M6 12l-2.5 8M18 12l2.5 8"/></svg>`;var ds=f`<svg xmlns="http://www.w3.org/2000/svg" width="36" height="36" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="ai ai-Backspace"><path d="M17 15l-6-6m6 0l-6 6"/><path d="M7.4 4.8A2 2 0 0 1 9 4h11a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H9a2 2 0 0 1-1.6-.8l-4.5-6a2 2 0 0 1 0-2.4l4.5-6z"/></svg>`;var ms=f`<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" class="ai ai-Cross"><path d="M20 20L4 4m16 0L4 20"/></svg>`;function fs(r,t){let e=new Set,o=new Set;function s(a){if(a==="ShiftLeft"||a==="ShiftRight")return"shift";if(a==="ControlLeft"||a==="ControlRight")return"ctrl";if(a==="MetaLeft"||a==="MetaRight")return"meta";if(a==="AltLeft"||a==="AltRight")return"alt"}let n=E(window,{blur:()=>i(),keydown:a=>{if(a.preventDefault(),a.code==="Escape")return i();e.add(a.code),o.add(a.code)},keyup:a=>{if(a.preventDefault(),e.delete(a.code),e.size===0){let c=new Set,l=new Set;for(let p of o){let u=s(p);u?l.add(u):c.add(p)}o.size===0||(c.size===0?r(["*",...o]):l.size>0?r(["*",["mod",...l],...c]):o.size>1?r(["*",...o]):r([...o][0])),i()}}}),i=()=>{n(),t()};return i}function gs(r,t){let{dispose:e,schedule:o}=U();o(t);let s=new Set,n=new Set,i=new Set;return o(E(window,{blur:()=>e()})),o(Ke(a=>{let c=new Pt(a);return s.add(c),c.onSample(l=>{if(l.code!=="gamepad.any")if(l.value>.9)n.add(l.code),i.add(l.code);else{if(!n.delete(l.code))return;n.size===0&&(i.size===1?r([...i][0]):i.size>1&&r(["*",...i]),e())}}),()=>{c.dispose(),s.delete(c)}})),o(wt(async()=>{for(let a of s)a.poll();await $t(16.67)})),e}function bs(r,t){let{dispose:e,schedule:o}=U();o(t);let s=new Set,n=new Set,i=a=>a.composedPath().some(c=>c instanceof Element&&c.matches("button.record"));return o(E(window,{blur:()=>e(),auxclick:a=>a.preventDefault(),mousedown:a=>{if(i(a))return;a.preventDefault();let c=zt(a.button);s.add(c),n.add(c)},mouseup:a=>{let c=zt(a.button);s.delete(c)&&(a.preventDefault(),s.size===0&&(n.size===1?r([...n][0]):n.size>1&&r(["*",...n]),e()))},contextmenu:a=>{a.preventDefault()}})),e}var xs=A((r,t,e,o)=>{let s=H(null),n=()=>s(null),i=()=>{let{dispose:p,schedule:u}=U();u(n),u(fs(t,p)),u(gs(t,p)),u(bs(t,p)),s(p)},a=()=>{s()?.(),n()};function c(){s()?a():i()}function l(){a(),e()}return So(a),h`
692
692
  <div class=recorder ?data-recording="${!!s()}">
693
693
  ${o}
694
694
  ${r?null:h`
@@ -697,14 +697,14 @@ ${St}
697
697
  theme-button=naked
698
698
  title="record a keypress"
699
699
  @click=${c}>
700
- ${s()?ds:ps}
700
+ ${s()?ms:hs}
701
701
  </button>
702
702
 
703
703
  <button
704
704
  theme-button=naked
705
705
  title="reset to default"
706
706
  @click=${l}>
707
- ${hs}
707
+ ${ds}
708
708
  </button>
709
709
  `}
710
710
  </div>
@@ -747,7 +747,7 @@ ${St}
747
747
  `}
748
748
  ${t.slice(1).map((o,s)=>Mr(r,o??null,n=>{let i=structuredClone(t);i[s+1]=n,e(i)}))}
749
749
  </div>
750
- `;throw new Error("unknown expression")});function rr(r,t,e,o){return at(t)?Mr(r,t,o):Object.entries(t).map(([s,n])=>at(n)?kn(r,t,e,o,s):$n(r,t,e,o,s))}function $n(r,t,e,o,s){return h`
750
+ `;throw new Error("unknown expression")});function rr(r,t,e,o){return ct(t)?Mr(r,t,o):Object.entries(t).map(([s,n])=>ct(n)?kn(r,t,e,o,s):$n(r,t,e,o,s))}function $n(r,t,e,o,s){return h`
751
751
  <details class=group open>
752
752
  <summary>${s}</summary>
753
753
  <div class=children>
@@ -757,21 +757,21 @@ ${St}
757
757
  `}function kn(r,t,e,o,s){let n=a=>o({...t,[s]:a});return h`
758
758
  <div class=expression>
759
759
  <strong>${s}</strong>
760
- ${bs(r,n,()=>n(e[s]),rr(r,t[s],e[s],n))}
760
+ ${xs(r,n,()=>n(e[s]),rr(r,t[s],e[s],n))}
761
761
  </div>
762
- `}var[xs,ys]=J(r=>{B(Z,cs);let{controls:t,controls:{profiles:e}}=r,o=H(t.fallbackProfileKey),s=e.get(o()),n=e.isPreset(o()),i=s.basedOn?e.get(s.basedOn):s,a=u=>{let m=o();if(e.isPreset(m)){let _=m,Q=Er();m=Q,e.clone(Q,_)}e.update(m,{bindings:u}),o(m)},c=(u,m)=>e.update(u,{label:m}),l=()=>{let u=Er();e.clone(u,o()),o.set(u)},p=()=>{e.delete(o()),o(t.fallbackProfileKey)};return h`
762
+ `}var[ys,ws]=Z(r=>{B(Q,ls);let{controls:t,controls:{profiles:e}}=r,o=H(t.fallbackProfileKey),s=e.get(o()),n=e.isPreset(o()),i=s.basedOn?e.get(s.basedOn):s,a=u=>{let m=o();if(e.isPreset(m)){let _=m,X=Er();m=X,e.clone(X,_)}e.update(m,{bindings:u}),o(m)},c=(u,m)=>e.update(u,{label:m}),l=()=>{let u=Er();e.clone(u,o()),o.set(u)},p=()=>{e.delete(o()),o(t.fallbackProfileKey)};return h`
763
763
  <div class=plate theme-card>
764
764
  <header class=topbar>
765
765
  <div class=corner>
766
766
  ${tr(r,o(),o)}
767
767
 
768
768
  <button title="copy this profile" theme-button=naked @click="${l}">
769
- ${ls}
769
+ ${us}
770
770
  </button>
771
771
 
772
772
  ${n?null:h`
773
773
  <button title="delete this profile" theme-button=naked @click="${p}">
774
- ${us}
774
+ ${ps}
775
775
  </button>
776
776
  `}
777
777
 
@@ -795,24 +795,24 @@ ${St}
795
795
  ${rr(!1,s.bindings,i.bindings,a)}
796
796
  </div>
797
797
  </div>
798
- `});var[by,ws]=J(r=>{B(Z,Yo);let t={slot:"panel"},e=y(()=>new Ot);return y(()=>{window.location.hash.includes("bindings")&&e.setIndex(1)}),h`
798
+ `});var[yy,vs]=Z(r=>{B(Q,ts);let t={slot:"panel"},e=y(()=>new Ot);return y(()=>{window.location.hash.includes("bindings")&&e.setIndex(1)}),h`
799
799
  <div class=deck theme-card>
800
- ${Xo.with({props:[{control:e}],children:h`
800
+ ${Yo.with({props:[{control:e}],children:h`
801
801
  <button theme-button>
802
802
  ${Tt}
803
803
  <span>controllers</span>
804
804
  </button>
805
805
 
806
806
  <button theme-button>
807
- ${ts}
807
+ ${es}
808
808
  <span>customize</span>
809
809
  </button>
810
810
 
811
- ${is.with({attrs:t,props:[r]})}
812
- ${xs.with({attrs:t,props:[r]})}
811
+ ${as.with({attrs:t,props:[r]})}
812
+ ${ys.with({attrs:t,props:[r]})}
813
813
  `})}
814
814
  </div>
815
- `});var vs=b`@layer view {
815
+ `});var $s=b`@layer view {
816
816
 
817
817
  :host {
818
818
  display: block;
@@ -820,19 +820,22 @@ ${St}
820
820
 
821
821
  output {
822
822
  opacity: 0.5;
823
- color: var(--prime);
824
- font-size: 1em;
825
- font-family: monospace;
826
823
  display: block;
827
- overflow-wrap: anywhere;
828
- text-overflow: ellipsis;
824
+
825
+ font-size: 1em;
829
826
  height: 8em;
830
- padding: 0 4em;
827
+
831
828
  overflow: hidden;
829
+ overflow-wrap: anywhere;
830
+
831
+ font-family: monospace;
832
+ color: var(--prime);
833
+ text-overflow: ellipsis;
832
834
  }
833
835
 
834
- }`;var[Ay,$s]=J(r=>(B(Z,vs),h`
836
+ }`;var[Cy,ks]=Z(r=>(B(Q,$s),h`
837
+ <slot></slot>
835
838
  <output class=viz>${r.$hex()}</output>
836
- `));var ks=f`<svg xmlns="http://www.w3.org/2000/svg" width="36" height="36" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="ai ai-Devices"><path d="M10 15H4V6a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v2"/><path d="M2 18h12"/><path d="M14 9.2c0-.663.597-1.2 1.333-1.2h5.334C21.403 8 22 8.537 22 9.2v9.6c0 .663-.597 1.2-1.333 1.2h-5.334C14.597 20 14 19.463 14 18.8V9.2z"/><path d="M18 17h.01"/></svg>`;function Ss(r,t){return r.length>t?r.slice(0,t)+"...":r}async function As(r){let t=await Vo(r),e=new Ze,o={TactDeck:ws(t),TactCustomize:ys(t),TactControllers:as(t),TactVisualizer:$s(e)};function s(a){return Fo(t.hub,(c,l)=>{let p=`${l.pad.gamepad.id} ${l.pad.gamepad.index+1}`;return t.controls.attach(c,{icon:Tt,handle:p,tooltip:p,name:Ss(p,32),defaultProfileKey:a??Qt(t.controls.presets).key}),()=>t.controls.detach(c)})}function n(){let{key:a,profile:c}=Qt(t.controls.presets),l=new Mt({bindings:c.bindings,source:new Je(new Xe,new Qe)});return t.hub.plug(l),t.controls.attach(l,{icon:ks,handle:"standard",name:"mouse/keyboard",tooltip:"",defaultProfileKey:a}),l}function i(){te(o)}return{deck:t,gamepads:s,mouseKeyboard:n,visualizer:e,elements:o,registerElements:i}}var Yt=await As({presets:Mo,maxPlayers:4});Yt.mouseKeyboard();Yt.gamepads("gamer");Yt.registerElements();wt(async()=>{let r=Yt.deck.hub.encodeAll();Yt.visualizer.update(r),await $t(1e3/60)});{let r=g('input[type="color"]');r.value="#ffbb00",r.oninput=()=>document.body.style.setProperty("--tact-prime",r.value)}
839
+ `));var Ss=f`<svg xmlns="http://www.w3.org/2000/svg" width="36" height="36" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="ai ai-Devices"><path d="M10 15H4V6a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v2"/><path d="M2 18h12"/><path d="M14 9.2c0-.663.597-1.2 1.333-1.2h5.334C21.403 8 22 8.537 22 9.2v9.6c0 .663-.597 1.2-1.333 1.2h-5.334C14.597 20 14 19.463 14 18.8V9.2z"/><path d="M18 17h.01"/></svg>`;async function As(r){let t=await Vo(r),e=new Ze,o={TactDeck:vs(t),TactCustomize:ws(t),TactControllers:cs(t),TactVisualizer:ks(e)};function s(a){return Fo(t.hub,(c,l)=>{let p=`${l.pad.gamepad.id} ${l.pad.gamepad.index+1}`;return t.controls.attach(c,{icon:Tt,handle:p,tooltip:p,name:Go(p,32),defaultProfileKey:a??Qt(t.controls.presets).key}),()=>t.controls.detach(c)})}function n(){let{key:a,profile:c}=Qt(t.controls.presets),l=new Mt({bindings:c.bindings,source:new Je(new Xe,new Qe)});return t.hub.plug(l),t.controls.attach(l,{icon:Ss,handle:"standard",name:"mouse/keyboard",tooltip:"",defaultProfileKey:a}),l}function i(){te(o)}return{deck:t,gamepads:s,mouseKeyboard:n,visualizer:e,elements:o,registerElements:i}}var Yt=await As({presets:Mo,maxPlayers:4});Yt.mouseKeyboard();Yt.gamepads("gamer");Yt.registerElements();wt(async()=>{let r=Yt.deck.hub.encodeAll();Yt.visualizer.update(r),await $t(1e3/60)});{let r=g('input[type="color"]');r.value="#ffbb00",r.oninput=()=>document.body.style.setProperty("--tact-prime",r.value)}
837
840
  /*! For license information please see main.bundle.min.js.LEGAL.txt */
838
841
  //# sourceMappingURL=main.bundle.min.js.map