Time slots app prototype
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

18 lines
131 KiB

var sa=Object.create;var Ne=Object.defineProperty;var ia=Object.getOwnPropertyDescriptor;var na=Object.getOwnPropertyNames;var oa=Object.getPrototypeOf,ha=Object.prototype.hasOwnProperty;var aa=(t,e)=>{for(var r in e)Ne(t,r,{get:e[r],enumerable:!0})},si=(t,e,r,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of na(e))!ha.call(t,i)&&i!==r&&Ne(t,i,{get:()=>e[i],enumerable:!(s=ia(e,i))||s.enumerable});return t};var Wt=(t,e,r)=>(r=t!=null?sa(oa(t)):{},si(e||!t||!t.__esModule?Ne(r,"default",{value:t,enumerable:!0}):r,t)),la=t=>si(Ne({},"__esModule",{value:!0}),t);var Sc={};aa(Sc,{Accessor:()=>ri,CUSTOM_TYPES:()=>Ds,Comment:()=>Nt,Component:()=>xe,CustomEvent:()=>Z,Document:()=>Pt,DocumentFragment:()=>be,Easer:()=>Sr,Element:()=>x,ElementRoute:()=>wr,ElementRouteTo:()=>ei,Emitter:()=>lr,Event:()=>X,EventHandler:()=>ti,Fragment:()=>Yt,HTMLButtonElement:()=>mr,HTMLElement:()=>H,HTMLHtmlElement:()=>cr,HTMLInputElement:()=>fr,HTMLLinkElement:()=>zs,HTMLOptionElement:()=>gr,HTMLScriptElement:()=>Bs,HTMLSelectElement:()=>dr,HTMLStyleElement:()=>Us,HTMLTextAreaElement:()=>pr,ImbaElement:()=>_h,IntersectionEventDefaults:()=>Te,KeyboardEvent:()=>Ks,LazyProxy:()=>Cs,Location:()=>ve,MouseEvent:()=>vr,Node:()=>A,PointerEvent:()=>qs,RenderContext:()=>Lt,Router:()=>xr,SVGElement:()=>Se,SVGSVGElement:()=>Ys,Scheduler:()=>ks,ShadowRoot:()=>uh,StyleDeclaration:()=>Gs,Text:()=>Kt,UIEvent:()=>yr,Window:()=>oh,accessor:()=>Qh,autorun:()=>Rh,awaits:()=>Dh,clearInterval:()=>Is,clearTimeout:()=>As,colors:()=>xh,commit:()=>I,createAtom:()=>Vh,createComment:()=>kt,createComponent:()=>Ws,createDynamic:()=>ph,createElement:()=>ch,createFragment:()=>fh,createIndexedList:()=>vh,createKeyedList:()=>bh,createLiveFragment:()=>yh,createRenderContext:()=>Rs,createSVGElement:()=>dh,createSlot:()=>_e,createTextNode:()=>br,customElements:()=>ah,defineTag:()=>mh,descriptor:()=>Jh,document:()=>ur,emit:()=>ot,env:()=>sh,events:()=>Oh,getDeepPropertyDescriptor:()=>ar,getRenderContext:()=>nh,getSuperTagType:()=>lh,getTagType:()=>ht,get_document:()=>qt,hooks:()=>Hs,hotkeys:()=>Ah,hydrate:()=>Sh,listen:()=>nt,locals:()=>ta,mount:()=>Qs,observable:()=>Gh,once:()=>B,parseTime:()=>Bt,proxy:()=>Ps,render:()=>Th,renderContext:()=>k,renderer:()=>Ut,reportChanged:()=>zh,reportObserved:()=>Uh,router:()=>jh,run:()=>Bh,scheduler:()=>z,serve:()=>rh,session:()=>ea,setInterval:()=>Fs,setTimeout:()=>$s,styles:()=>Xs,toCamelCase:()=>Qo,transitions:()=>we,unlisten:()=>zt,unmount:()=>Js,use_dom_bind:()=>Lh,use_dom_teleport:()=>Nh,use_dom_transitions:()=>Mh,use_events:()=>Eh,use_events_hotkey:()=>Ih,use_events_intersect:()=>kh,use_events_keyboard:()=>Zs,use_events_mouse:()=>_r,use_events_pointer:()=>Ch,use_events_resize:()=>$h,use_events_selection:()=>Fh,use_events_touch:()=>Ph,use_hooks:()=>Jo,use_router:()=>Hh,use_slots:()=>gh,use_styles:()=>wh,use_window:()=>hh,\u03B1action:()=>Xh,\u03B1autorun:()=>Wh,\u03B1computed:()=>qh,\u03B1lazy:()=>Zo,\u03B1observable:()=>Kh,\u03B1prop:()=>Zh,\u03B1ref:()=>Yh});module.exports=la(Sc);var js=Wt(require("cluster")),J=Wt(require("fs")),Tt=Wt(require("path")),th=require("events"),eh=Wt(require("http")),Vs=Wt(require("path")),ih=require("async_hooks"),ua=Object.create,ii=Object.defineProperty,ca=Object.getOwnPropertyDescriptor,da=Object.getOwnPropertyNames,fa=Object.getPrototypeOf,pa=Object.prototype.hasOwnProperty,ma=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),ga=(t,e,r,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of da(e))!pa.call(t,i)&&i!==r&&ii(t,i,{get:()=>e[i],enumerable:!(s=ca(e,i))||s.enumerable});return t},ya=(t,e,r)=>(r=t!=null?ua(fa(t)):{},ga(e||!t||!t.__esModule?ii(r,"default",{value:t,enumerable:!0}):r,t)),va=ma((t,e)=>{"use strict";var r=typeof Reflect=="object"?Reflect:null,s=r&&typeof r.apply=="function"?r.apply:function(u,d,f){return Function.prototype.apply.call(u,d,f)},i;r&&typeof r.ownKeys=="function"?i=r.ownKeys:Object.getOwnPropertySymbols?i=function(u){return Object.getOwnPropertyNames(u).concat(Object.getOwnPropertySymbols(u))}:i=function(u){return Object.getOwnPropertyNames(u)};function n(u){console&&console.warn&&console.warn(u)}var o=Number.isNaN||function(u){return u!==u};function h(){h.init.call(this)}e.exports=h,e.exports.once=E,h.EventEmitter=h,h.prototype._events=void 0,h.prototype._eventsCount=0,h.prototype._maxListeners=void 0;var l=10;function c(u){if(typeof u!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof u)}Object.defineProperty(h,"defaultMaxListeners",{enumerable:!0,get:function(){return l},set:function(u){if(typeof u!="number"||u<0||o(u))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+u+".");l=u}}),h.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},h.prototype.setMaxListeners=function(u){if(typeof u!="number"||u<0||o(u))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+u+".");return this._maxListeners=u,this};function a(u){return u._maxListeners===void 0?h.defaultMaxListeners:u._maxListeners}h.prototype.getMaxListeners=function(){return a(this)},h.prototype.emit=function(u){for(var d=[],f=1;f<arguments.length;f++)d.push(arguments[f]);var g=u==="error",y=this._events;if(y!==void 0)g=g&&y.error===void 0;else if(!g)return!1;if(g){var b;if(d.length>0&&(b=d[0]),b instanceof Error)throw b;var w=new Error("Unhandled error."+(b?" ("+b.message+")":""));throw w.context=b,w}var j=y[u];if(j===void 0)return!1;if(typeof j=="function")s(j,this,d);else for(var Le=j.length,ra=N(j,Le),f=0;f<Le;++f)s(ra[f],this,d);return!0};function v(u,d,f,g){var y,b,w;if(c(f),b=u._events,b===void 0?(b=u._events=Object.create(null),u._eventsCount=0):(b.newListener!==void 0&&(u.emit("newListener",d,f.listener?f.listener:f),b=u._events),w=b[d]),w===void 0)w=b[d]=f,++u._eventsCount;else if(typeof w=="function"?w=b[d]=g?[f,w]:[w,f]:g?w.unshift(f):w.push(f),y=a(u),y>0&&w.length>y&&!w.warned){w.warned=!0;var j=new Error("Possible EventEmitter memory leak detected. "+w.length+" "+String(d)+" listeners added. Use emitter.setMaxListeners() to increase limit");j.name="MaxListenersExceededWarning",j.emitter=u,j.type=d,j.count=w.length,n(j)}return u}h.prototype.addListener=function(u,d){return v(this,u,d,!1)},h.prototype.on=h.prototype.addListener,h.prototype.prependListener=function(u,d){return v(this,u,d,!0)};function m(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function S(u,d,f){var g={fired:!1,wrapFn:void 0,target:u,type:d,listener:f},y=m.bind(g);return y.listener=f,g.wrapFn=y,y}h.prototype.once=function(u,d){return c(d),this.on(u,S(this,u,d)),this},h.prototype.prependOnceListener=function(u,d){return c(d),this.prependListener(u,S(this,u,d)),this},h.prototype.removeListener=function(u,d){var f,g,y,b,w;if(c(d),g=this._events,g===void 0)return this;if(f=g[u],f===void 0)return this;if(f===d||f.listener===d)--this._eventsCount===0?this._events=Object.create(null):(delete g[u],g.removeListener&&this.emit("removeListener",u,f.listener||d));else if(typeof f!="function"){for(y=-1,b=f.length-1;b>=0;b--)if(f[b]===d||f[b].listener===d){w=f[b].listener,y=b;break}if(y<0)return this;y===0?f.shift():O(f,y),f.length===1&&(g[u]=f[0]),g.removeListener!==void 0&&this.emit("removeListener",u,w||d)}return this},h.prototype.off=h.prototype.removeListener,h.prototype.removeAllListeners=function(u){var d,f,g;if(f=this._events,f===void 0)return this;if(f.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):f[u]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete f[u]),this;if(arguments.length===0){var y=Object.keys(f),b;for(g=0;g<y.length;++g)b=y[g],b!=="removeListener"&&this.removeAllListeners(b);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(d=f[u],typeof d=="function")this.removeListener(u,d);else if(d!==void 0)for(g=d.length-1;g>=0;g--)this.removeListener(u,d[g]);return this};function p(u,d,f){var g=u._events;if(g===void 0)return[];var y=g[d];return y===void 0?[]:typeof y=="function"?f?[y.listener||y]:[y]:f?Mt(y):N(y,y.length)}h.prototype.listeners=function(u){return p(this,u,!0)},h.prototype.rawListeners=function(u){return p(this,u,!1)},h.listenerCount=function(u,d){return typeof u.listenerCount=="function"?u.listenerCount(d):_.call(u,d)},h.prototype.listenerCount=_;function _(u){var d=this._events;if(d!==void 0){var f=d[u];if(typeof f=="function")return 1;if(f!==void 0)return f.length}return 0}h.prototype.eventNames=function(){return this._eventsCount>0?i(this._events):[]};function N(u,d){for(var f=new Array(d),g=0;g<d;++g)f[g]=u[g];return f}function O(u,d){for(;d+1<u.length;d++)u[d]=u[d+1];u.pop()}function Mt(u){for(var d=new Array(u.length),f=0;f<d.length;++f)d[f]=u[f].listener||u[f];return d}function E(u,d){return new Promise(function(f,g){function y(){b!==void 0&&u.removeListener("error",b),f([].slice.call(arguments))}var b;d!=="error"&&(b=function(w){u.removeListener(d,y),g(w)},u.once("error",b)),u.once(d,y)})}}),Me=Symbol.for("#__listeners__"),ba=/-./g,Cs=class{static for(t){return new Proxy({},new this(t))}constructor(t){this.getter=t}get target(){return this.getter()}get(t,e){return this.target[e]}set(t,e,r){return this.target[e]=r,!0}};function Ps(t,e={}){return new Proxy(e,new Cs(t))}function Bt(t){let e=typeof t;if(e=="number")return t;if(e=="string"){if(/^\d+fps$/.test(t))return 1e3/parseFloat(t);if(/^([-+]?[\d\.]+)s$/.test(t))return parseFloat(t)*1e3;if(/^([-+]?[\d\.]+)ms$/.test(t))return parseFloat(t)}return null}function Qo(t){return t.indexOf("-")>=0?t.replace(ba,function(e){return e.charAt(1).toUpperCase()}):t}function ar(t,e,r){if(!t)return;let s=Object.getOwnPropertyDescriptor(t,e);return s||t==r?s||void 0:ar(Reflect.getPrototypeOf(t),e,r)}var ni=function(t,e,r){let s,i,n;for(;(s=r)&&(r=r.next);)(i=r.listener)&&(r.path&&i[r.path]?n=e?i[r.path].apply(i,e):i[r.path]():n=e?i.apply(r,e):i.call(r)),r.times&&--r.times<=0&&(s.next=r.next,r.listener=null)};function nt(t,e,r,s){var i;let n,o,h;return n=t[Me]||(t[Me]={}),o=n[e]||(n[e]={}),h=o.tail||(o.tail=o.next={}),h.listener=r,h.path=s,o.tail=h.next={},h}function B(t,e,r){let s=nt(t,e,r);return s.times=1,s}function zt(t,e,r,s){let i,n,o=t[Me];if(!!o&&(i=o[e])){for(;(n=i)&&(i=i.next);)if(i==r||i.listener==r){n.next=i.next,i.listener=null;break}}}function ot(t,e,r){let s;(s=t[Me])&&(s[e]&&ni(e,r,s[e]),s.all&&ni(e,[e,r],s.all))}var lr=class{emit(t,...e){return ot(this,t,e)}on(t,...e){return nt(this,t,...e)}once(t,...e){return B(this,t,...e)}un(t,...e){return zt(this,t,...e)}};function Sa(t){let e;return t?(e=t.toIterable)?e.call(t):t:[]}var oi=Symbol.for("#__init__"),hi=Symbol.for("#schedule"),Tr=Symbol.for("#frames"),Oe=Symbol.for("#interval"),$t=Symbol.for("#stage"),Ft=Symbol.for("#scheduled"),Ee=Symbol.for("#version"),_a=Symbol.for("#fps"),ai=Symbol.for("#ticker"),xa=globalThis.requestAnimationFrame||function(t){return globalThis.setTimeout(t,1e3/60)},xc=1/60,wa=class{constructor(t=null){this[oi](t)}[oi](t=null){var e;this.owner=t&&(e=t.owner)!==void 0?e:null,this.target=t&&(e=t.target)!==void 0?e:null,this.active=t&&(e=t.active)!==void 0?e:!1,this.value=t&&(e=t.value)!==void 0?e:void 0,this.skip=t&&(e=t.skip)!==void 0?e:0,this.last=t&&(e=t.last)!==void 0?e:0}tick(t,e){return this.last=this.owner[Tr],this.target.tick(this,e),1}update(t,e){let r=this.active,s=t.value;return this.value!=s&&(this.deactivate(),this.value=s),(this.value||r||e)&&this.activate(),this}queue(){this.owner.add(this)}activate(){return this.value===!0?this.owner.on("commit",this):this.value===!1||typeof this.value=="number"&&(this.value/16.666666666666668<=2?this.owner.on("raf",this):this[Oe]=globalThis.setInterval(this.queue.bind(this),this.value)),this.active=!0,this}deactivate(){return this.value===!0&&this.owner.un("commit",this),this.owner.un("raf",this),this[Oe]&&(globalThis.clearInterval(this[Oe]),this[Oe]=null),this.active=!1,this}},ks=class{constructor(){var t=this;this.id=Symbol(),this.queue=[],this.stage=-1,this[$t]=-1,this[Tr]=0,this[Ft]=!1,this[Ee]=0,this.listeners={},this.intervals={},t.commit=function(){return t.add("commit"),t},this[_a]=0,t.$promise=null,t.$resolve=null,this[ai]=function(e){return t[Ft]=!1,t.tick(e)}}touch(){return this[Ee]++}get version(){return this[Ee]}add(t,e){return(e||this.queue.indexOf(t)==-1)&&this.queue.push(t),this[Ft]||this[hi](),this}get committing\u03A6(){return this.queue.indexOf("commit")>=0}get syncing\u03A6(){return this[$t]==1}listen(t,e){let r=this.listeners[t],s=!r;return r||(r=this.listeners[t]=new Set),r.add(e),t=="raf"&&s&&this.add("raf"),this}unlisten(t,e){var r;let s=this.listeners[t];return s&&s.delete(e),t=="raf"&&s&&s.size==0&&(r=this.listeners.raf,delete this.listeners.raf),this}on(t,e){return this.listen(t,e)}un(t,e){return this.unlisten(t,e)}get promise(){var t=this;return t.$promise||(t.$promise=new Promise(function(e){return t.$resolve=e}))}tick(t){var e=this;let r=this.queue,s=this[Tr]++;if(this.ts||(this.ts=t),this.dt=t-this.ts,this.ts=t,this.queue=[],this[$t]=1,this[Ee]++,r.length)for(let i=0,n=Sa(r),o=n.length;i<o;i++){let h=n[i];typeof h=="string"&&this.listeners[h]?e.listeners[h].forEach(function(l){if(l.tick instanceof Function)return l.tick(e,h);if(l instanceof Function)return l(e,h)}):h instanceof Function?h(e.dt,e):h.tick&&h.tick(e.dt,e)}return this[$t]=this[Ft]?0:-1,e.$promise&&(e.$resolve(e),e.$promise=e.$resolve=null),e.listeners.raf&&e.add("raf"),e}[hi](){return this[Ft]||(this[Ft]=!0,this[$t]==-1&&(this[$t]=0),xa(this[ai])),this}schedule(t,e){var r,s;return e||(e=t[r=this.id]||(t[r]={value:!0})),(e[s=this.id]||(e[s]=new wa({owner:this,target:t}))).update(e,!0)}unschedule(t,e={}){e||(e=t[this.id]);let r=e&&e[this.id];return r&&r.active&&r.deactivate(),this}},z=new ks;function I(){return z.add("commit").promise}function $s(t,e){return globalThis.setTimeout(function(){t(),I()},e)}function Fs(t,e){return globalThis.setInterval(function(){t(),I()},e)}var Is=globalThis.clearInterval,As=globalThis.clearTimeout,Xt=globalThis.imba||(globalThis.imba={});Xt.commit=I,Xt.setTimeout=$s,Xt.setInterval=Fs,Xt.clearInterval=Is,Xt.clearTimeout=As;var Hs={on:function(t,e){return nt(this,t,e)},inited:function(t){return ot(this,"inited",[t])}};function Jo(){return!0}function Zo(t,e,r){if(r.get){let s=r.get;r.get=function(){let i=s.call(this);return Object.defineProperty(this,e,{enumerable:!1,value:i}),i}}return r}function tt(t){let e;return t?(e=t.toIterable)?e.call(t):t:[]}var li=Symbol.for("#setup"),ui=Symbol.for("#__initor__"),ci=Symbol.for("#__inited__"),di=Symbol.for("#__init__"),fi=Symbol.for("#setup?"),Ta=Symbol.for("#dom"),La=Symbol.for("#server"),pi=Symbol(),Lr={html:{"Content-Type":"text/html; charset=utf-8"},js:{"Content-Type":"text/javascript; charset=utf-8"},cjs:{"Content-Type":"text/javascript; charset=utf-8"},mjs:{"Content-Type":"text/javascript; charset=utf-8"},json:{"Content-Type":"application/json; charset=utf-8"},css:{"Content-Type":"text/css; charset=utf-8"},map:{"Content-Type":"application/json; charset=utf-8"},otf:{"Content-Type":"font/otf"},ttf:{"Content-Type":"font/ttf"},woff:{"Content-Type":"font/woff"},woff2:{"Content-Type":"font/woff2"},svg:{"Content-Type":"image/svg+xml"},avif:{"Content-Type":"image/avif"},gif:{"Content-Type":"image/gif"},png:{"Content-Type":"image/png"},apng:{"Content-Type":"image/apng"},webp:{"Content-Type":"image/webp"},jpg:{"Content-Type":"image/jpeg"},jpeg:{"Content-Type":"image/jpeg"},ico:{"Content-Type":"image/x-icon"},bmp:{"Content-Type":"image/bmp"},pdf:{"Content-Type":"application/pdf"},webm:{"Content-Type":"video/webm"},weba:{"Content-Type":"audio/webm"},avi:{"Content-Type":"video/x-msvideo"},mp3:{"Content-Type":"audio/mpeg"},mp4:{"Content-Type":"video/mp4"},m4a:{"Content-Type":"audio/m4a"},mov:{"Content-Type":"video/quicktime"},wmv:{"Content-Type":"video/x-ms-wmv"},mpeg:{"Content-Type":"video/mpeg"},wav:{"Content-Type":"audio/wav"},ogg:{"Content-Type":"audio/ogg"},ogv:{"Content-Type":"video/ogg"},oga:{"Content-Type":"audio/ogg"},opus:{"Content-Type":"audio/opus"}},V=globalThis.process,Na=class extends Set{call(t,...e){var r;r=[];for(let s of tt(this))r.push(s[t](...e));return r}close(t={}){var e;e=[];for(let r of tt(this))e.push(r.close(t));return e}reload(t={}){var e;e=[];for(let r of tt(this))e.push(r.reload(t));return e}broadcast(t,...e){var r;r=[];for(let s of tt(this))r.push(s.broadcast(t,...e));return r}emit(t,e){var r;r=[];for(let s of tt(this))r.push(s.emit(t,e));return r}},Qt=new Na,mi=new(class extends th.EventEmitter{static[di](){return this.prototype[ui]=pi,this}constructor(){var t;super(...arguments),t=this,this.autoreload=!1,this.state={},globalThis.IMBA_RUN&&js.default.isWorker&&V.on("message",function(e){if(t.emit("message",e),e[0]=="emit")return t.emit(...e.slice(1))}),this[ui]===pi&&this[ci]&&this[ci]()}[li](){var t=this;if(this[fi]!=!0&&(this[fi]=!0,!0))return this.on("rebuild",function(e){let r=globalThis.IMBA_MANIFEST;return globalThis.IMBA_MANIFEST=e,Qt.broadcast("rebuild",e)}),t.on("reloading",function(e){var r;t.state.reloading=!0,r=[];for(let s of tt(Qt))r.push(s.pause());return r}),t.on("reloaded",async function(e){var r;t.state.reloaded=!0,Qt.broadcast("reloaded"),await new Promise(function(i){return setTimeout(i,100)}),r=[];for(let i of tt(Qt))r.push(i.close());let s=r;return setTimeout(function(){return V.exit(0)},100),await Promise.all(s),V.exit(0)}),!0}send(t){if(V.send instanceof Function)return V.send(t)}on(t,e){return super.on(...arguments)}reload(){if(!(this.isReloading!=!0&&(this.isReloading=!0,!0)))return this;if(this.state.reloading=!0,!V.env.IMBA_SERVE){console.warn("not possible to gracefully reload servers not started via imba start");return}this.send("reload")}}[di]());function gi(t,e=[],r=0){let s=globalThis.IMBA_MANIFEST[t];if(e.indexOf(t)>=0)return e;if(s?.imports)for(let i=0,n=tt(s?.imports),o=n.length;i<o;i++){let h=n[i];e.push(h),gi(h,e,r+1)}return e}var Ma=class{constructor(t,e,r={}){this.server=t,this.url=e,[this.pathname,this.query]=e.split("?"),this.ext=Tt.default.extname(this.pathname),this.headers={"Content-Type":"text/plain","Access-Control-Allow-Origin":"*","cache-control":"public, max-age=31536000"},Object.assign(this.headers,t.options.assetHeaders||{}),Object.assign(this.headers,Lr[this.ext.slice(1)]||{}),this.headers["max-age"]=864e5,r.imports&&t.options.preload!==!1&&(this.headers.Link=gi(e).map(function(s){return"<"+s+">; rel=modulepreload; as=script"}).join(", ")),this.path=t.localPathForUrl(e)}respond(t,e){var r=this;return J.default.access(this.path,J.default.constants.R_OK,function(s){if(s)return e.writeHead(404,{}),e.end();try{if(r.server.options.setHeaders&&r.server.options.setHeaders(e,r.path),globalThis.BUN)return J.default.readFile(r.path,function(i,n){return e.writeHead(200,r.headers),e.end(n)});{let i=J.default.createReadStream(r.path);return e.writeHead(200,r.headers),i.pipe(e)}}catch{return e.writeHead(503,{}),e.end()}})}createReadStream(){return J.default.createReadStream(this.path)}pipe(t){return this.createReadStream().pipe(t)}},Oa=class{static wrap(t,e={}){return new this(t,e)}localPathForUrl(t){var e,r,s;let i=t.replace(/\?.*$/,"");return(e=this.urlToLocalPathMap)[i]==null?e[i]=(r=Tt.default.resolve(this.publicPath,"."+i),s=J.default.existsSync(r)&&r,!s&&this.staticDir&&(r=Tt.default.resolve(this.staticDir,"."+i),s=J.default.existsSync(r)&&r),s):e[i]}headersForAsset(t){let e,r=Tt.default.extname(t);return e=Object.assign({"Content-Type":"text/plain","Access-Control-Allow-Origin":"*","cache-control":"public"},Lr[r.slice(1)]||{})}get manifest(){return globalThis.IMBA_MANIFEST||{}}constructor(t,e={}){var r=this;Qt.add(this),this.id=Math.random(),this.options=e,this.closed=!1,this.paused=!1,this.server=t,this.clients=new Set,this.stalledResponses=[],this.assetResponders={},this.urlToLocalPathMap={},this.publicExistsMap={};try{this.rootDir=V.env.IMBA_OUTDIR||Tt.default.dirname(V.env.pm_exec_path||V.argv[1])}catch{}try{this.publicPath=Tt.default.resolve(this.rootDir,V.env.IMBA_PUBDIR||globalThis.IMBA_PUBDIR||"public")}catch{}this.staticDir=globalThis.IMBA_STATICDIR||"",V.env.IMBA_PATH&&(this.devtoolsPath=Tt.default.resolve(V.env.IMBA_PATH,"dist","hmr.js")),this.scheme=t instanceof eh.default.Server?"http":"https";let s=this.server._events.request,i=globalThis[Ta];t.off("request",s),s[La]=this,t.on("listening",function(){let n=r.server.address(),o=n.address;(o=="::"||o=="0.0.0.0")&&(o="localhost");let h=""+r.scheme+"://"+o+":"+n.port+"/";if(!V.env.IMBA_CLUSTER)return console.log("listening on "+h)}),globalThis.IMBA_HMR&&(globalThis.IMBA_HMR_PATH="/__hmr__.js"),r.handler=function(n,o){var h,l;let c=n.constructor.name=="Http2ServerRequest",a=n.url;if(r.paused||r.closed)return o.statusCode=302,o.setHeader("Location",n.url),c||o.setHeader("Connection","close"),r.closed?(c&&n.stream.session.close(),o.end()):r.stalledResponses.push(o);if(globalThis.IMBA_HMR){if(a=="/__hmr__.js"&&r.devtoolsPath){let p=J.default.createReadStream(r.devtoolsPath);return o.writeHead(200,Lr.js),p.pipe(o)}if(a=="/__hmr__"){let p={"Content-Type":"text/event-stream","Cache-Control":"no-cache"};return c||(p.Connection="keep-alive"),o.writeHead(200,p),r.clients.add(o),r.broadcast("init",globalThis.IMBA_MANIFEST,[o]),n.on("close",function(){return r.clients.delete(o)}),!0}}let v=n.headers,m;c?m=v[":scheme"]+"://"+v[":authority"]:m=(n.connection.encrypted?"https":"http")+"://"+v.host;let S=r.manifest[a];if(S&&r.localPathForUrl(a))return((l=r.assetResponders)[a]||(l[a]=new Ma(r,a,S))).respond(n,o);if((a.match(/\.[A-Z\d]{8}\./)||a.match(/\.\w{1,4}($|\?)/))&&(h=r.localPathForUrl(a)))try{let p=r.headersForAsset(h);if(e.setHeaders&&e.setHeaders(o,h),globalThis.BUN)return J.default.readFile(h,function(_,N){return _?(o.writeHead(500,{}),o.write("Error getting the file: "+_)):(o.writeHead(200,p),o.end(N))});{let _=J.default.createReadStream(h);return o.writeHead(200,p),_.pipe(o)}}catch{return o.writeHead(503,{}),o.end()}if(i){let p=new i.Location(n.url,m);return i.Document.create({location:p},function(){return s(n,o)})}else return s(n,o)},t.on("request",r.handler),t.on("close",function(){return console.log("server is closing!!!")}),globalThis.IMBA_RUN&&js.default.isWorker&&(mi[li](),mi.send("serve"))}broadcast(t,e={},r=this.clients){e=JSON.stringify(e);let s="data: "+e+`
`;for(let i of tt(r))i.write("event: "+t+`
`),i.write(`id: imba
`),i.write(s);return this}pause(){return this.paused!=!0&&(this.paused=!0,!0)&&this.broadcast("paused"),this}resume(){if(this.paused!=!1&&(this.paused=!1,!0))return this.broadcast("resumed"),this.flushStalledResponses()}flushStalledResponses(){for(let t=0,e=tt(this.stalledResponses),r=e.length;t<r;t++)e[t].end();return this.stalledResponses=[]}close(){var t=this;return this.pause(),new Promise(function(e){return t.closed=!0,t.server.close(e),t.flushStalledResponses()})}};function rh(t,...e){return Oa.wrap(t,...e)}var sh=new class{get rootDir(){return process.env.IMBA_OUTDIR||Vs.default.dirname(process.env.pm_exec_path||process.argv[1])}get publicPath(){return Vs.default.resolve(this.rootDir,process.env.IMBA_PUBDIR||globalThis.IMBA_PUBDIR||"public")}};function Ea(t){let e;return t?(e=t.toIterable)?e.call(t):t:[]}var et={"":[-1,{id:1,slot:1,part:1,elementTiming:"elementtiming"}],HTML:[-1,{title:1,lang:1,translate:1,dir:1,accessKey:"accesskey",draggable:1,spellcheck:1,autocapitalize:1,inputMode:"inputmode",style:1,tabIndex:"tabindex",enterKeyHint:"enterkeyhint"}],HTMLAnchor:[1,{target:1,download:1,ping:1,rel:1,relList:"rel",hreflang:1,type:1,referrerPolicy:"referrerpolicy",coords:1,charset:1,name:1,rev:1,shape:1,href:1}],HTMLArea:[1,{alt:1,coords:1,download:1,shape:1,target:1,ping:1,rel:1,relList:"rel",referrerPolicy:"referrerpolicy",href:1}],HTMLMedia:[1,{src:1,crossOrigin:"crossorigin",preload:1,controlsList:"controlslist"}],HTMLAudio:[4,{}],HTMLBase:[1,{href:1,target:1}],HTMLQuote:[1,{cite:1}],HTMLBody:[1,{text:1,link:1,vLink:"vlink",aLink:"alink",bgColor:"bgcolor",background:1}],HTMLBR:[1,{clear:1}],HTMLButton:[1,{formAction:"formaction",formEnctype:"formenctype",formMethod:"formmethod",formTarget:"formtarget",name:1,type:1,value:1}],HTMLCanvas:[1,{width:1,height:1}],HTMLTableCaption:[1,{align:1}],HTMLTableCol:[1,{span:1,align:1,ch:"char",chOff:"charoff",vAlign:"valign",width:1}],HTMLData:[1,{value:1}],HTMLDataList:[1,{}],HTMLMod:[1,{cite:1,dateTime:"datetime"}],HTMLDetails:[1,{}],HTMLDialog:[1,{}],HTMLDiv:[1,{align:1}],HTMLDList:[1,{}],HTMLEmbed:[1,{src:1,type:1,width:1,height:1,align:1,name:1}],HTMLFieldSet:[1,{name:1}],HTMLForm:[1,{acceptCharset:"accept-charset",action:1,autocomplete:1,enctype:1,encoding:"enctype",method:1,name:1,target:1}],HTMLHeading:[1,{align:1}],HTMLHead:[1,{}],HTMLHR:[1,{align:1,color:1,size:1,width:1}],HTMLHtml:[1,{version:1}],HTMLIFrame:[1,{src:1,srcdoc:1,name:1,sandbox:1,width:1,height:1,referrerPolicy:"referrerpolicy",csp:1,allow:1,align:1,scrolling:1,frameBorder:"frameborder",longDesc:"longdesc",marginHeight:"marginheight",marginWidth:"marginwidth",loading:1}],HTMLImage:[1,{alt:1,src:1,srcset:1,sizes:1,crossOrigin:"crossorigin",useMap:"usemap",width:1,height:1,referrerPolicy:"referrerpolicy",decoding:1,name:1,lowsrc:1,align:1,hspace:1,vspace:1,longDesc:"longdesc",border:1,loading:1}],HTMLInput:[1,{accept:1,alt:1,autocomplete:1,dirName:"dirname",formAction:"formaction",formEnctype:"formenctype",formMethod:"formmethod",formTarget:"formtarget",height:1,max:1,maxLength:"maxlength",min:1,minLength:"minlength",name:1,pattern:1,placeholder:1,src:1,step:1,type:1,defaultValue:"value",value:1,width:1,align:1,useMap:"usemap",required:1}],HTMLLabel:[1,{htmlFor:"for"}],HTMLLegend:[1,{align:1}],HTMLLI:[1,{value:1,type:1}],HTMLLink:[1,{href:1,crossOrigin:"crossorigin",rel:1,relList:"rel",media:1,hreflang:1,type:1,as:1,referrerPolicy:"referrerpolicy",sizes:1,imageSrcset:"imagesrcset",imageSizes:"imagesizes",charset:1,rev:1,target:1,integrity:1}],HTMLMap:[1,{name:1}],HTMLMenu:[1,{}],HTMLMeta:[1,{name:1,httpEquiv:"http-equiv",content:1,scheme:1,property:1,charset:1}],HTMLMeter:[1,{value:1,min:1,max:1,low:1,high:1,optimum:1}],HTMLObject:[1,{data:1,type:1,name:1,useMap:"usemap",width:1,height:1,align:1,archive:1,code:1,hspace:1,standby:1,vspace:1,codeBase:"codebase",codeType:"codetype",border:1}],HTMLOList:[1,{start:1,type:1}],HTMLOptGroup:[1,{label:1}],HTMLOption:[1,{label:1,value:1}],HTMLOutput:[1,{htmlFor:"for",name:1}],HTMLParagraph:[1,{align:1}],HTMLParam:[1,{name:1,value:1,type:1,valueType:"valuetype"}],HTMLPicture:[1,{}],HTMLPre:[1,{width:1}],HTMLProgress:[1,{value:1,max:1}],HTMLScript:[1,{src:1,type:1,charset:1,crossOrigin:"crossorigin",referrerPolicy:"referrerpolicy",event:1,htmlFor:"for",integrity:1,defer:1,async:1}],HTMLSelect:[1,{autocomplete:1,name:1,size:1,value:1,required:1}],HTMLSlot:[1,{name:1}],HTMLSource:[1,{src:1,type:1,srcset:1,sizes:1,media:1}],HTMLSpan:[1,{}],HTMLStyle:[1,{media:1,type:1}],HTMLTable:[1,{align:1,border:1,frame:1,rules:1,summary:1,width:1,bgColor:"bgcolor",cellPadding:"cellpadding",cellSpacing:"cellspacing"}],HTMLTableSection:[1,{align:1,ch:"char",chOff:"charoff",vAlign:"valign"}],HTMLTableCell:[1,{colSpan:"colspan",rowSpan:"rowspan",headers:1,align:1,axis:1,height:1,width:1,ch:"char",chOff:"charoff",vAlign:"valign",bgColor:"bgcolor",abbr:1,scope:1}],HTMLTemplate:[1,{}],HTMLTextArea:[1,{autocomplete:1,cols:1,dirName:"dirname",maxLength:"maxlength",minLength:"minlength",name:1,placeholder:1,rows:1,wrap:1}],HTMLTime:[1,{dateTime:"datetime"}],HTMLTitle:[1,{}],HTMLTableRow:[1,{align:1,ch:"char",chOff:"charoff",vAlign:"valign",bgColor:"bgcolor"}],HTMLTrack:[1,{kind:1,src:1,srclang:1,label:1}],HTMLUList:[1,{type:1}],HTMLVideo:[4,{width:1,height:1,poster:1}],SVG:[-1,{}],SVGGraphics:[66,{transform:1}],SVGA:[67,{}],SVGAnimation:[66,{}],SVGAnimate:[69,{}],SVGAnimateMotion:[69,{}],SVGAnimateTransform:[69,{}],SVGGeometry:[67,{}],SVGCircle:[73,{cx:1,cy:1,r:1}],SVGClipPath:[67,{clipPathUnits:1}],SVGDefs:[67,{}],SVGDesc:[66,{}],SVGDiscard:[66,{}],SVGEllipse:[73,{cx:1,cy:1,rx:1,ry:1}],SVGFEBlend:[66,{mode:1,x:1,y:1,width:1,height:1}],SVGFEColorMatrix:[66,{type:1,values:1,x:1,y:1,width:1,height:1}],SVGFEComponentTransfer:[66,{x:1,y:1,width:1,height:1}],SVGFEComposite:[66,{operator:1,x:1,y:1,width:1,height:1}],SVGFEConvolveMatrix:[66,{orderX:1,orderY:1,kernelMatrix:1,divisor:1,edgeMode:1,x:1,y:1,width:1,height:1}],SVGFEDiffuseLighting:[66,{surfaceScale:1,diffuseConstant:1,x:1,y:1,width:1,height:1}],SVGFEDisplacementMap:[66,{xChannelSelector:1,yChannelSelector:1,x:1,y:1,width:1,height:1}],SVGFEDistantLight:[66,{}],SVGFEDropShadow:[66,{dx:1,dy:1,stdDeviationX:1,stdDeviationY:1,x:1,y:1,width:1,height:1}],SVGFEFlood:[66,{x:1,y:1,width:1,height:1}],SVGComponentTransferFunction:[66,{type:1,tableValues:1,slope:1,amplitude:1,exponent:1}],SVGFEFuncA:[90,{}],SVGFEFuncB:[90,{}],SVGFEFuncG:[90,{}],SVGFEFuncR:[90,{}],SVGFEGaussianBlur:[66,{x:1,y:1,width:1,height:1}],SVGFEImage:[66,{preserveAspectRatio:1,x:1,y:1,width:1,height:1}],SVGFEMerge:[66,{x:1,y:1,width:1,height:1}],SVGFEMergeNode:[66,{}],SVGFEMorphology:[66,{operator:1,x:1,y:1,width:1,height:1}],SVGFEOffset:[66,{x:1,y:1,width:1,height:1}],SVGFEPointLight:[66,{}],SVGFESpecularLighting:[66,{surfaceScale:1,specularConstant:1,specularExponent:1,x:1,y:1,width:1,height:1}],SVGFESpotLight:[66,{specularExponent:1}],SVGFETile:[66,{x:1,y:1,width:1,height:1}],SVGFETurbulence:[66,{numOctaves:1,stitchTiles:1,type:1,x:1,y:1,width:1,height:1}],SVGFilter:[66,{filterUnits:1,primitiveUnits:1,x:1,y:1,width:1,height:1}],SVGForeignObject:[67,{x:1,y:1,width:1,height:1}],SVGG:[67,{}],SVGImage:[67,{x:1,y:1,width:1,height:1,preserveAspectRatio:1}],SVGLine:[73,{x1:1,y1:1,x2:1,y2:1}],SVGGradient:[66,{gradientUnits:1,gradientTransform:1,spreadMethod:1}],SVGLinearGradient:[111,{x1:1,y1:1,x2:1,y2:1}],SVGMarker:[66,{refX:1,refY:1,markerUnits:1,markerWidth:1,markerHeight:1,orientType:1,orientAngle:1,viewBox:1,preserveAspectRatio:1}],SVGMask:[66,{maskUnits:1,maskContentUnits:1,x:1,y:1,width:1,height:1}],SVGMetadata:[66,{}],SVGMPath:[66,{}],SVGPath:[73,{}],SVGPattern:[66,{patternUnits:1,patternContentUnits:1,patternTransform:1,x:1,y:1,width:1,height:1,viewBox:1,preserveAspectRatio:1}],SVGPolygon:[73,{}],SVGPolyline:[73,{}],SVGRadialGradient:[111,{cx:1,cy:1,r:1,fx:1,fy:1,fr:1}],SVGRect:[73,{x:1,y:1,width:1,height:1,rx:1,ry:1}],SVGScript:[66,{}],SVGSet:[69,{}],SVGStop:[66,{}],SVGStyle:[66,{}],SVGSVG:[67,{x:1,y:1,width:1,height:1,viewBox:1,preserveAspectRatio:1}],SVGSwitch:[67,{}],SVGSymbol:[66,{viewBox:1,preserveAspectRatio:1}],SVGTextContent:[67,{textLength:1,lengthAdjust:1}],SVGTextPositioning:[130,{x:1,y:1,dx:1,dy:1,rotate:1}],SVGText:[131,{}],SVGTextPath:[130,{startOffset:1,method:1,spacing:1}],SVGTitle:[66,{}],SVGTSpan:[131,{}],SVGUse:[67,{x:1,y:1,width:1,height:1}],SVGView:[66,{viewBox:1,preserveAspectRatio:1}]},P={a:2,abbr:1,address:1,area:3,article:1,aside:1,audio:5,b:1,base:6,bdi:1,bdo:1,blockquote:7,body:8,br:9,button:10,canvas:11,caption:12,cite:1,code:1,col:13,colgroup:13,data:14,datalist:15,dd:1,del:16,details:17,dfn:1,dialog:18,div:19,dl:20,dt:1,em:1,embed:21,fieldset:22,figcaption:1,figure:1,footer:1,form:23,h1:24,h2:24,h3:24,h4:24,h5:24,h6:24,head:25,header:1,hgroup:1,hr:26,html:27,i:1,iframe:28,img:29,input:30,ins:16,kbd:1,label:31,legend:32,li:33,link:34,main:1,map:35,mark:1,menu:36,meta:37,meter:38,nav:1,noscript:1,object:39,ol:40,optgroup:41,option:42,output:43,p:44,param:45,picture:46,pre:47,progress:48,q:7,rp:1,rt:1,ruby:1,s:1,samp:1,script:49,section:1,select:50,slot:51,small:1,source:52,span:53,strike:1,strong:1,style:54,sub:1,summary:1,sup:1,table:55,tbody:56,td:57,template:58,textarea:59,tfoot:56,th:57,thead:56,time:60,title:61,tr:62,track:63,u:1,ul:64,var:1,video:65,wbr:1,svg_a:68,svg_animate:70,svg_animateMotion:71,svg_animateTransform:72,svg_audio:66,svg_canvas:66,svg_circle:74,svg_clipPath:75,svg_defs:76,svg_desc:77,svg_discard:78,svg_ellipse:79,svg_feBlend:80,svg_feColorMatrix:81,svg_feComponentTransfer:82,svg_feComposite:83,svg_feConvolveMatrix:84,svg_feDiffuseLighting:85,svg_feDisplacementMap:86,svg_feDistantLight:87,svg_feDropShadow:88,svg_feFlood:89,svg_feFuncA:91,svg_feFuncB:92,svg_feFuncG:93,svg_feFuncR:94,svg_feGaussianBlur:95,svg_feImage:96,svg_feMerge:97,svg_feMergeNode:98,svg_feMorphology:99,svg_feOffset:100,svg_fePointLight:101,svg_feSpecularLighting:102,svg_feSpotLight:103,svg_feTile:104,svg_feTurbulence:105,svg_filter:106,svg_foreignObject:107,svg_g:108,svg_iframe:66,svg_image:109,svg_line:110,svg_linearGradient:112,svg_marker:113,svg_mask:114,svg_metadata:115,svg_mpath:116,svg_path:117,svg_pattern:118,svg_polygon:119,svg_polyline:120,svg_radialGradient:121,svg_rect:122,svg_script:123,svg_set:124,svg_stop:125,svg_style:126,svg_svg:127,svg_switch:128,svg_symbol:129,svg_text:132,svg_textPath:133,svg_title:134,svg_tspan:135,svg_unknown:66,svg_use:136,svg_video:66,svg_view:137},Nr=Object.keys(et);for(let t=0,e=Ea(Nr),r=e.length;t<r;t++){let s=e[t],i=et[s];i.name=s+"Element",i.up=et[Nr[i[0]]]}for(let t=0,e=Object.keys(P),r=e.length,s,i;t<r;t++)s=e[t],i=P[s],P[s]=et[Nr[i]],s.indexOf("svg_")==0&&(P[s.replace("_",":")]=P[s]);var yi=Symbol.for("#toStringDeopt"),vi=Symbol.for("#symbols"),bi=Symbol.for("#batches"),Si=Symbol.for("#extras"),_i=Symbol.for("#stacks"),Mr=class{constructor(t){this.dom=t,this.string=""}contains(t){return this.dom.classList.contains(t)}add(t){return this.contains(t)?this:(this.string+=(this.string?" ":"")+t,this.dom.classList.add(t),this)}remove(t){if(!this.contains(t))return this;let e=new RegExp("(^|\\s)"+t+"(?=\\s|$)","g");return this.string=this.string.replace(e,""),this.dom.classList.remove(t),this}toggle(t,e){return e===void 0&&(e=!this.contains(t)),e?this.add(t):this.remove(t)}incr(t,e=0){var r=this;let s=this.stacks,i=s[t]||0;return i<1&&this.add(t),e>0&&setTimeout(function(){return r.decr(t)},e),s[t]=Math.max(i,0)+1}decr(t){let e=this.stacks,r=e[t]||0;return r==1&&this.remove(t),e[t]=Math.max(r,1)-1}reconcile(t,e){let r=this[vi],s=this[bi],i=!0;if(!r)r=this[vi]=[t],s=this[bi]=[e||""],this.toString=this.valueOf=this[yi];else{let n=r.indexOf(t),o=e||"";n==-1?(r.push(t),s.push(o)):s[n]!=o?s[n]=o:i=!1}i&&(this[Si]=" "+s.join(" "),this.sync())}valueOf(){return this.string}toString(){return this.string}[yi](){return this.string+(this[Si]||"")}sync(){return this.dom.flagSync$()}get stacks(){return this[_i]||(this[_i]={})}},Ce=Symbol.for("#__init__"),xi=Symbol.for("#__initor__"),wi=Symbol.for("#__inited__"),Or=Symbol.for("#getRenderContext"),Ca=Symbol.for("#getDynamicContext"),Ti=Symbol(),k={context:null},Pa=class{constructor(t=null){this[Ce](t)}[Ce](t=null){var e;this.stack=t&&(e=t.stack)!==void 0?e:[]}push(t){return this.stack.push(t)}pop(t){return this.stack.pop()}},Ut=new Pa,Lt=class extends Map{static[Ce](){return this.prototype[xi]=Ti,this}constructor(t,e=null){super(),this._=t,this.sym=e,this[xi]===Ti&&this[wi]&&this[wi]()}pop(){return k.context=null}[Or](t){let e=this.get(t);return e||this.set(t,e=new Lt(this._,t)),k.context=e}[Ca](t,e){return this[Or](t)[Or](e)}run(t){return this.value=t,k.context==this&&(k.context=null),this.get(t)}cache(t){return this.set(this.value,t),t}};Lt[Ce]();function Rs(t,e=Symbol(),r=t){return k.context=t[e]||(t[e]=new Lt(r,e))}function nh(){let t=k.context,e=t||new Lt(null);return globalThis.DEBUG_IMBA&&!t&&Ut.stack.length>0&&console.warn("detected unmemoized nodes in",Ut.stack.slice(0),"see https://imba.io",e),t&&(k.context=null),e}function Er(t){let e;return t?(e=t.toIterable)?e.call(t):t:[]}var U=Symbol.for("#__initor__"),q=Symbol.for("#__inited__"),C=Symbol.for("#__init__"),Cr=Symbol.for("#parent"),Li=Symbol.for("#context"),Ni=Symbol.for("#closestNode"),ka=Symbol.for("#parentNode"),$a=Symbol.for("##inited"),Pr=Symbol.for("#getRenderContext"),Fa=Symbol.for("#getDynamicContext"),kr=Symbol.for("#replaceChild"),Jt=Symbol.for("#appendChild"),Mi=Symbol.for("#removeChild"),mt=Symbol.for("#insertInto"),Oi=Symbol.for("#insertChild"),Zt=Symbol.for("#removeFrom"),Ei=Symbol.for("#removeFromDeopt"),It=Symbol.for("#replaceWith"),Ci=Symbol.for("#replaceWithDeopt"),$r=Symbol.for("#placeholderNode"),Ia=Symbol.for("#attachToParent"),Aa=Symbol.for("#detachFromParent"),Ha=Symbol.for("#placeChild"),ja=Symbol.for("#beforeReconcile"),Va=Symbol.for("#afterReconcile"),Ra=Symbol.for("#afterVisit"),Da=Symbol.for("#visitContext"),Pi=Symbol.for("#document"),Pe=Symbol.for("#htmlNodeName"),ki=Symbol.for("#ImbaElement"),$i=Symbol.for("#flags"),ke=Symbol.for("#scripts"),Fr=Symbol.for("#location"),Fi=Symbol.for("##document"),Ii=Symbol.for("##parent"),Ga=Symbol.for("##up"),Ai=Symbol.for("##context"),te=Symbol.for("#domNode"),$e=Symbol.for("##placeholderNode"),Hi=Symbol.for("#domDeopt"),Ba=Symbol.for("#insertIntoDeopt"),ji=Symbol.for("##classList"),Fe=Symbol.for("##style"),Vi=Symbol.for("##dataset"),at=Symbol.for("#asset"),Ir=Symbol.for("#innerHTML"),Ie=Symbol.for("##visitContext"),za=Symbol.for("#isRichElement"),ee=Symbol.for("#src"),Ua=Symbol.for("#getSlot"),qa=Symbol.for("#cssns"),Ka=Symbol.for("#cssid"),Ya=Symbol.for("#dom"),Ri=Symbol(),Di=Symbol(),Gi=Symbol(),Bi=Symbol(),zi=Symbol(),Ui=Symbol(),Wa={},re=null,ve=class extends URL{},oh=class{get document(){return this[Pi]||(this[Pi]=new this.Document(this))}get location(){return this.document.location}};function hh(){return!0}var Xa={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},lt=null,qi={},Qa=class{define(){return this}get(){return this}upgrade(){}whenDefined(){}},ah=new Qa,Ds={};function ht(t,e){let r=t;if(typeof t=="string"&&(t=et[t]||P[t]||et[t+"Element"]||P["svg_"+t]),t instanceof A)return t;if(!t)return ht("HTML");if(t&&!t.klass){class s extends ht(t.up){}t.klass=s}if(t&&!t.idl){t.idl=!0;let s=Object.getOwnPropertyDescriptors(t.klass.prototype);for(let i=t[1],n=0,o=Object.keys(i),h=o.length,l,c;n<h;n++){l=o[n],c=i[l];let a=c==1?l:c;s[a]||a=="style"||Object.defineProperty(t.klass.prototype,l,{set:function(v){this.setAttribute(a,v)},get:function(){return this.getAttribute(a)}})}}return t.klass}function lh(t,e,r){let s=ht(t,e);if(!(s==r||s.prototype instanceof r||s.prototype[Pe])){let i=s.prototype[ki];if(!i){i=class extends s{static[C](){return this.prototype[U]=Ri,this}constructor(){super(...arguments),this.__slots={},this.__F=0,this[U]===Ri&&this[q]&&this[q]()}}[C](),s.prototype[ki]=i;let n=Object.getOwnPropertyDescriptors(r.prototype);Object.defineProperties(i.prototype,n),i.prototype[Pe]=t}return i}return s}var Ae=function(t){let e=typeof t=="string"?t:String(t);return e.indexOf('"')>=0&&(e=e.replace(/\"/g,"&quot;")),e},Ar=function(t,e){let r=typeof t=="string"?t:String(t);return e=="script"||(r.indexOf('"')>=0&&(r=r.replace(/\"/g,"&quot;")),r.indexOf("<")>=0&&(r=r.replace(/\</g,"&lt;")),r.indexOf(">")>=0&&(r=r.replace(/\>/g,"&gt;"))),r},Pt=class{static create(t,e){let r=new Pt;return r[Li]=t,r.location=t.location,re||(re=new ih.AsyncLocalStorage),re.run(r,e),r}constructor(){}get flags(){return this[$i]||(this[$i]=new Mr({classList:new Hr(this)}))}get scripts(){return this[ke]||(this[ke]=[])}set location(t){typeof t=="string"&&(t=new ve(t)),this[Fr]=t}get location(){return this[Fr]||(this[Fr]=new ve("http://localhost/"))}createElement(t){let e=ht(t),r=new e(t);return r.nodeName=t,r}createElementNS(t,e){if(t=="http://www.w3.org/2000/svg"){let r=ht("svg_"+e),s=new r;return s.nodeName=e,s}return this.createElement(e)}createTextNode(t){return new Kt(t)}createComment(t){return new Nt(t)}createDocumentFragment(){return new be}getElementById(t){return null}},ut=new Pt,ur=ut;function qt(){return re&&re?.getStore?.()||ut}var Hr=class{constructor(t,e){this.classes=e||[],this.dom=t}add(t){return this.classes.indexOf(t)<0&&this.classes.push(t),this}remove(t){let e=this.classes.indexOf(t);return e>=0&&(this.classes[e]=""),this}toggle(t){return this.contains(t)?this.remove(t):this.add(t),this}contains(t){return this.classes.indexOf(t)>=0}clone(t){return new Hr(t,this.classes.slice(0))}toString(){return this.classes.join(" ").trim()}},Gs=class{constructor(){}removeProperty(t){var e;return e=this[t],delete this[t],e}setProperty(t,e){return this[t]=e}toString(){let t=[];for(let e=this,r=0,s=Object.keys(e),i=s.length,n,o;r<i;r++)n=s[r],o=e[n],o instanceof Function||t.push(""+n+": "+o);return t.join(";")}},Ki=class{static wrap(t){return new Proxy(t.attributes,new Ki)}set(t,e,r){return t["data-"+e]=r,!0}get(t,e){return t["data-"+e]}},Ja={get(t,e){let r=t,s;for(;r&&s==null;)(r=r[Cr])&&(s=r[e]);return s}},A=class{toString(){return this.outerHTML}get outerHTML(){return""}text$(t){return this.textContent=t,this}get ownerDocument(){return this[Fi]||(this[Fi]=qt())}get[Cr](){return this[Ii]||this.parentNode||this[Ga]}get[Li](){return this[Ai]||(this[Ai]=new Proxy(this,Ja))}get[Ni](){return this}get[ka](){return this[Cr][Ni]}[C](){return this}[$a](){return this}[Pr](t){return Rs(this,t)}[Fa](t,e){return this[Pr](t)[Pr](e)}[kr](t,e){let r=this[Oi](t,e);return this[Mi](e),r}[Jt](t){return t[mt](this,null)}[Mi](t){return t[Zt](this)}[mt](t,e){return e?t.insertBefore(this,e):t.appendChild(this),this}[Oi](t,e){return t[mt](this,e)}[Zt](t){return t.removeChild(this)}[Ei](t){return t.removeChild(this[te]||this)}[It](t,e){return e[kr](t,this)}[Ci](t,e){return e[kr](t,this[te]||this)}get[$r](){return this[$e]||(this[$e]=ut.createComment("placeholder"))}set[$r](t){let e=this[$e];this[$e]=t,e&&e!=t&&e.parentNode&&e[It](t)}[Ia](){let t=this[te],e=t&&t.parentNode;return t&&e&&t!=this&&(this[te]=null,this[mt](e,t),t[Zt](e)),this}[Aa](){this[Hi]!=!0&&(this[Hi]=!0,!0)&&(this[It]=this[Ci],this[Zt]=this[Ei],this[mt]=this[Ba]);let t=this[$r];return this.parentNode&&t!=this&&(t[mt](this.parentNode,this),this[Zt](this.parentNode)),this[te]=t,this}[Ha](t,e,r){let s=typeof t;if(s==="undefined"||t===null){if(r&&r instanceof Nt)return r;let i=new Nt("");return r?r[It](i,this):i[mt](this,null)}if(t===r)return t;if(s!=="object"){let i,n=t;return e&128&&e&256,r?r instanceof Kt?(r.textContent=n,r):(i=ur.createTextNode(n),r[It](i,this),i):(this.appendChild(i=ur.createTextNode(n)),i)}else return r?r[It](t,this):t[mt](this,null)}},Kt=class extends A{static[C](){return this.prototype[U]=Di,this}constructor(t){super(),this.textContent=t??"",this[U]===Di&&this[q]&&this[q]()}get outerHTML(){return this.textContent}};Kt[C]();var Nt=class extends A{static[C](){return this.prototype[U]=Gi,this}constructor(t){super(),this.value=t,this[U]===Gi&&this[q]&&this[q]()}get outerHTML(){return"<!-- "+Ar(this.value)+" -->"}toString(){return this.tag&&this.tag.toNodeString?this.tag.toNodeString():this.outerHTML}};Nt[C]();var x=class extends A{static[C](){return this.prototype[U]=Bi,this}constructor(t){super(),this.nodeName=t,this.childNodes=[],this.attributes={},this[U]===Bi&&this[q]&&this[q]()}emit(t,e,r={bubbles:!0}){console.warn("Element#emit not supported on node")}get classList(){return this[ji]||(this[ji]=new Hr(this))}get style(){return this[Fe]||(this[Fe]=new Gs)}get dataset(){return this[Vi]||(this[Vi]=Ki.wrap(this))}get richValue(){return this.value}set richValue(t){this.value=t}set asset(t){this[at]=t}get asset(){return this[at]}flag$(){return this}flagIf$(){return this}appendChild(t){return this.childNodes.push(t),t.parentNode=this,t}removeChild(t){let e=this.childNodes.indexOf(t);return e>=0&&this.childNodes.splice(e,1),this}replaceChild(t,e){let r=this.childNodes.indexOf(e);return r>=0&&(this.childNodes.splice(r,1,t),t.parentNode=this),e}insertBefore(t,e){let r=this.childNodes.indexOf(e);return this.childNodes.splice(r,0,t),this}setAttribute(t,e){return this.attributes[t]=e,this}setAttributeNS(t,e,r){return this.setAttribute(t+":"+e,r)}getAttribute(t){return this.attributes?this.attributes[t]:void 0}getAttributeNS(t,e){return this.getAttribute(t+":"+e)}removeAttribute(t){var e;return e=this.attributes[t],delete this.attributes[t],!0}addEventListener(){return this}removeEventListener(){return this}resolve(){return this}set innerHTML(t){this[Ir]=t}get innerHTML(){let t="";if(this[Ir])return this[Ir];if(this.textContent!=null)return Ar(this.textContent);for(let e=0,r=Er(this.childNodes),s=r.length;e<s;e++){let i=r[e];typeof i=="string"||i instanceof String?t+=Ar(i,this.nodeName):typeof i=="number"||i instanceof Number?t+=""+i:i&&(t+=i.outerHTML)}return t}get outerHTML(){let t=this.nodeName,e=this[Pe],r=""+t;e&&(r=""+e+" is='"+t+"'",t=e);let s,i=this.classList.toString();this.dehydrate&&(i=i?"_ssr_ "+i:"_ssr_",this.dehydrate()),(s=this.id)&&(r+=' id="'+Ae(s)+'"'),i&&(r+=' class="'+Ae(i)+'"');for(let n=this.attributes,o=0,h=Object.keys(n),l=h.length,c,a;o<l;o++)c=h[o],a=n[c],r+=" "+c+'="'+Ae(a)+'"';return this[Fe]&&(r+=' style="'+Ae(this[Fe].toString())+'"'),Xa[t]?"<"+r+">":"<"+r+">"+this.innerHTML+"</"+t+">"}get firstChild(){return this.childNodes[0]}get lastChild(){return this.childNodes[this.childNodes.length-1]}get firstElementChild(){let t=this.childNodes.length,e=0;for(;e<t;){let r=this.childNodes[e++];if(r instanceof x)return r}return null}get lastElementChild(){let t=this.childNodes.length;for(;t>0;){let e=this.childNodes[--t];if(e instanceof x)return e}return null}get className(){return this.classList.toString()}set className(t){this.classList.classes=(t||"").split(" "),this.classList.toString()}log(...t){return console.log(...t)}text$(t){return this.textContent=t,this}[ja](){return this}[Va](){return this}[Ra](){this.render&&this.render(),this[Ie]&&(this[Ie]=null)}get[Da](){return this[Ie]||(this[Ie]={})}get flags(){return this.$flags||(this.$flags=new Mr(this),this.flag$==x.prototype.flag$&&(this.flags$ext=this.className),this.flagDeopt$()),this.$flags}flag$(t){let e=this.flags$ns;this.className=e?e+(this.flags$ext=t):this.flags$ext=t}flagDeopt$(){var t=this;this.flag$=this.flagExt$,t.flagSelf$=function(e){return t.flagSync$(t.flags$own=e)}}flagExt$(t){return this.flagSync$(this.flags$ext=t)}flagSelf$(t){return this.flagDeopt$(),this.flagSelf$(t)}flagSync$(){return this.className=(this.flags$ns||"")+(this.flags$ext||"")+" "+(this.flags$own||"")+" "+(this.$flags||"")}set$(t,e){let r=ar(this,t,x);!r||!r.set?this.setAttribute(t,e):this[t]=e}};x[C](),x.prototype.setns$=x.prototype.setAttributeNS,x.prototype[za]=!0;var be=class extends x{static[C](){return this.prototype[U]=zi,this}constructor(){super(null),this[U]===zi&&this[q]&&this[q]()}get outerHTML(){return this.innerHTML}};be[C]();var uh=class extends be{get outerHTML(){return this.innerHTML}},H=class extends x{},cr=class extends H{static[C](){return this.prototype[U]=Ui,this}constructor(){super(...arguments),super[C]||this[C](),this[U]===Ui&&this[q]&&this[q]()}[C](t=null){super[C]&&super[C](...arguments),this.hmr=t?t.hmr:void 0}get scripts(){return this[ke]||(this[ke]=[])}get outerHTML(){let t=lt;lt=this;let e=super.outerHTML,r=new Set,s=[],i=[];if(globalThis.IMBA_HMR_PATH&&this.hmr!==!1&&i.push("<script src='/__hmr__.js'><\/script>"),!this.styles){for(let n=0,o=Er(this.scripts),h=o.length;n<h;n++){let l=o[n].src,c=Wa[l];c&&c.css&&r.add(c.css)}for(let n of Er(r))i.push("<link rel='stylesheet' href='"+n.url+"'>")}if(lt=t,i.length){let n=e.indexOf("</head>");n==-1&&(n=e.indexOf("<body>")),n==-1&&(n=0),e=e.slice(0,n)+`
`+i.join(`
`)+`
`+e.slice(n)}return"<!DOCTYPE html>"+e}};cr[C]();var dr=class extends H{},fr=class extends H{},pr=class extends H{},mr=class extends H{},gr=class extends H{},Bs=class extends H{get outerHTML(){return lt&&(lt.scripts||(lt.scripts=[])).push(this),this[at]&&(this[at].js?(this.setAttribute("src",this[at].js.url),this.setAttribute("type","module")):console.warn("could not find browser entrypoint for "+this[at].path)),super.outerHTML}},zs=class extends H{get outerHTML(){if(this[at]){let t=this.getAttribute("rel"),e;t=="stylesheet"&&((e=this[at].css.url)||console.warn("could not find stylesheet for "+this[at].path)),e&&this.setAttribute("href",e)}return super.outerHTML}},Us=class extends H{set src(t){this[ee]!=t&&(this[ee]=t)}get src(){return this[ee]}get outerHTML(){if(lt&&this.src&&(lt.styles||(lt.styles=[])).push(this),this.src){this.nodeName="link",this.setAttribute("rel","stylesheet"),this.setAttribute("href",String(this.src));let t=super.outerHTML;return this.nodeName="style",t}return super.outerHTML}},X=class{},yr=class extends X{},vr=class extends yr{},qs=class extends vr{},Ks=class extends yr{},Z=class extends X{},Yi={};function Wi(t,e,r){if(!t)return r[e]=null;if(r[e]!==void 0)return r[e];let s=Object.getOwnPropertyDescriptor(t,e);return s!==void 0||t==Se?r[e]=s||null:Wi(Reflect.getPrototypeOf(t),e,r)}var Se=class extends x{set$(t,e){var r;let s=Yi[r=this.nodeName]||(Yi[r]={}),i=Wi(this,t,s);!i||!i.set?this.setAttribute(t,e):this[t]=e}},Ys=class extends Se{set src(t){if(this[ee]!=t&&(this[ee]=t,!0)){if(t&&t.adoptNode)t.adoptNode(this);else if(t&&t.type=="svg"){if(t.attributes)for(let e=t.attributes,r=0,s=Object.keys(e),i=s.length,n,o;r<i;r++)n=s[r],o=e[n],this.setAttribute(n,o);this.innerHTML=t.content}}}};et[""].klass=x,et.HTML.klass=H,et.SVG.klass=Se,P.html.klass=cr,P.select.klass=dr,P.input.klass=fr,P.textarea.klass=pr,P.button.klass=mr,P.option.klass=gr,P.script.klass=Bs,P.style.klass=Us,P.link.klass=zs,P.svg_svg.klass=Ys,ht(""),ht("HTML"),ht("SVG");function ch(t,e,r,s){let i=ut.createElement(t);return r&&(i.className=r),s!==null&&i.text$(s),e&&e[Jt]&&e[Jt](i),i}function dh(t,e,r,s,i){let n=ut.createElementNS("http://www.w3.org/2000/svg",t);return r&&(n.className=r),e&&e[Jt]&&e[Jt](n),s&&(n.textContent=s),n}function kt(t){return ut.createComment(t)}function br(t){return ut.createTextNode(t)}function fh(){return ut.createDocumentFragment()}function Ws(t,e,r,s,i){let n;return typeof t!="string"&&(t.prototype instanceof H?(n=new t,n.nodeName=t.nodeName):t&&t.nodeName&&(t=t.nodeName)),n||(n=ut.createElement(qi[t]||t)),n[Ii]=e,n[C](),s!==null&&n[Ua]("__").text$(s),(r||n.flags$ns)&&n.flag$(r||""),n}function ph(t,e,r,s){if(t==null||t==null)return kt("");if(t instanceof A)return t;if(typeof t=="string"||t&&t.prototype instanceof A)return Ws(t,e,r,s)}function mh(t,e,r={}){et[t]=Ds[t]={idl:!0,name:t,klass:e};let s=e.nodeName=t,i=e.prototype;if(t.indexOf("-")==-1&&(s=e.nodeName=""+t+"-tag",qi[t]=s),r.extends&&(i[Pe]=r.extends),r.cssns){let n=(i._ns_||"")+" "+r.cssns;i._ns_=n.trim()+" ",i[qa]=r.cssns}if(r.cssid){let n=(i.flags$ns||"")+" "+r.cssid;i[Ka]=r.cssid,i.flags$ns=n.trim()+" "}return e}globalThis[Ya]={Location:ve,Document:Pt};function jr(t){let e;return t?(e=t.toIterable)?e.call(t):t:[]}function Za(t,e){let r=Object.getOwnPropertyDescriptors(e);return delete r.constructor,Object.defineProperties(t,r),t}var He=Symbol.for("#parent"),Xi=Symbol.for("#closestNode"),tl=Symbol.for("#isRichElement"),el=Symbol.for("#afterVisit"),Qi=Symbol.for("#__initor__"),Ji=Symbol.for("#__inited__"),Zi=Symbol.for("#appendChild"),tn=Symbol.for("#removeChild"),en=Symbol.for("#replaceChild"),ct=Symbol.for("#insertInto"),je=Symbol.for("#replaceWith"),rn=Symbol.for("#insertChild"),Ve=Symbol.for("#removeFrom"),sn=Symbol.for("#placeChild"),nn=Symbol.for("#__init__"),rl=Symbol.for("#registerFunctionalSlot"),sl=Symbol.for("#getFunctionalSlot"),on=Symbol.for("#getSlot"),Vr=Symbol.for("##parent"),gt=Symbol.for("##up"),hn=Symbol.for("##flags"),il=Symbol.for("#domFlags"),K=Symbol.for("#end"),an=Symbol.for("#textContent"),Re=Symbol.for("#textNode"),Rr=Symbol.for("#functionalSlots"),ln=Symbol();function gh(){return!0}var Yt=class{constructor(){this.childNodes=[]}log(...t){}hasChildNodes(){return!1}set[He](t){this[Vr]=t}get[He](){return this[Vr]||this[gt]}get[Xi](){return this[He][Xi]}get[tl](){return!0}get flags(){return this[hn]||(this[hn]=new Mr(this))}flagSync$(){return this}[el](){return this}},nl=0,Dr=class extends Yt{static[nn](){return this.prototype[Qi]=ln,this}constructor(t,e){super(...arguments),this[gt]=e,this.parentNode=null,this[il]=t,this.childNodes=[],this[K]=kt("slot"+nl++),e&&e[Zi](this),this[Qi]===ln&&this[Ji]&&this[Ji]()}get[He](){return this[Vr]||this.parentNode||this[gt]}set textContent(t){this[an]=t}get textContent(){return this[an]}hasChildNodes(){for(let t=0,e=jr(this.childNodes),r=e.length;t<r;t++){let s=e[t];if(s instanceof Yt&&s.hasChildNodes()||!(s instanceof Nt)&&s instanceof A)return!0}return!1}text$(t){return this[Re]?this[Re].textContent=t:this[Re]=this[sn](t),this[Re]}appendChild(t){return this.parentNode&&t[ct](this.parentNode,this[K]),this.childNodes.push(t)}[Zi](t){var e;return this.parentNode?t[ct](this.parentNode,this[K]):t[gt]==null?t[gt]=this[gt]||this:t[gt],this.childNodes.push(t)}insertBefore(t,e){this.parentNode&&this.parentNode[rn](t,e);let r=this.childNodes.indexOf(e);return r>=0&&this.childNodes.splice(r,0,t),t}[tn](t){this.parentNode&&this.parentNode[tn](t);let e=this.childNodes.indexOf(t);e>=0&&this.childNodes.splice(e,1)}[en](t,e){this.parentNode&&this.parentNode[en](t,e);let r=this.childNodes.indexOf(e);return this.childNodes[r]=t,t}[ct](t,e){let r=this.parentNode;if(this.parentNode!=t&&(this.parentNode=t,!0)){this[K]&&(e=this[K][ct](t,e));for(let s=0,i=jr(this.childNodes),n=i.length;s<n;s++)i[s][ct](t,e)}return this}[je](t,e){let r=t[ct](e,this[K]);return this[Ve](e),r}[rn](t,e){if(this.parentNode&&this.insertBefore(t,e||this[K]),e){let r=this.childNodes.indexOf(e);r>=0&&this.childNodes.splice(r,0,t)}else this.childNodes.push(t);return t}[Ve](t){for(let e=0,r=jr(this.childNodes),s=r.length;e<s;e++)r[e][Ve](t);return this[K]&&this[K][Ve](t),this.parentNode=null,this}[sn](t,e,r){let s=this.parentNode,i=typeof t;if(i==="undefined"||t===null){if(r&&r instanceof Nt)return r;let n=kt("");if(r){let o=this.childNodes.indexOf(r);return this.childNodes.splice(o,1,n),s&&r[je](n,s),n}return this.childNodes.push(n),s&&n[ct](s,this[K]),n}if(t===r)return t;if(i!=="object"){let n,o=t;if(r){if(r instanceof Kt)return r.textContent=o,r;{n=br(o);let h=this.childNodes.indexOf(r);return this.childNodes.splice(h,1,n),s&&r[je](n,s),n}}else return this.childNodes.push(n=br(o)),s&&n[ct](s,this[K]),n}else if(r){let n=this.childNodes.indexOf(r);return this.childNodes.splice(n,1,t),s&&r[je](t,s),t}else return this.childNodes.push(t),s&&t[ct](s,this[K]),t}};Dr[nn]();function yh(t,e){return new Dr(t,e)}function _e(t,e){let r=new Dr(t,null);return r[gt]=e,r}var ol=class{[rl](t){let e=this[Rr]||(this[Rr]={});return e[t]||(e[t]=_e(0,this))}[sl](t,e){let r=this[Rr];return r&&r[t]||this[on](t,e)}[on](t,e){var r;return t=="__"&&!this.render?this:(r=this.__slots)[t]||(r[t]=_e(0,this))}};Za(A.prototype,ol.prototype);function hl(t){let e;return t?(e=t.toIterable)?e.call(t):t:[]}var al=Symbol.for("#afterVisit"),De=Symbol.for("#insertInto"),un=Symbol.for("#appendChild"),ll=Symbol.for("#replaceWith"),Gr=Symbol.for("#removeFrom"),cn=Symbol.for("#__initor__"),dn=Symbol.for("#__inited__"),fn=Symbol.for("#__init__"),ul=Symbol.for("#domFlags"),cl=Symbol.for("##parent"),yt=Symbol.for("#end"),dl=Symbol.for("#removeChild"),fl=Symbol.for("#insertChild"),pn=Symbol(),mn=class extends Yt{static[fn](){return this.prototype[cn]=pn,this}constructor(t,e){super(...arguments),this[ul]=t,this[cl]=e,t&256||(this[yt]=kt("list")),this.$=this.childNodes,this.length=0,e&&e[un](this),this[cn]===pn&&this[dn]&&this[dn]()}hasChildNodes(){return this.length!=0}[al](t){let e=this.length;if(this.length=t,e==t)return;let r=this.parentNode;if(!r)return;let s=this.childNodes,i=this[yt];if(e>t)for(;e>t;)r[dl](s[--e]);else if(t>e)for(;t>e;)r[fl](s[e++],i);this.length=t}[De](t,e){this.parentNode=t,this[yt]&&this[yt][De](t,e),e=this[yt];for(let r=0,s=hl(this.childNodes),i=s.length;r<i;r++){let n=s[r];if(r==this.length)break;n[De](t,e)}return this}[un](t){}[ll](t,e){let r=t[De](e,this[yt]);return this[Gr](e),r}[Gr](t){let e=this.length;for(;e>0;)this.childNodes[--e][Gr](t);this[yt]&&t.removeChild(this[yt]),this.parentNode=null}};mn[fn]();function vh(t,e){return new mn(t,e)}function gn(t){let e;return t?(e=t.toIterable)?e.call(t):t:[]}var Br=Symbol.for("#appendChild"),Ge=Symbol.for("#insertChild"),pl=Symbol.for("#replaceWith"),Be=Symbol.for("#insertInto"),zr=Symbol.for("#removeFrom"),ml=Symbol.for("#afterVisit"),yn=Symbol.for("#__initor__"),vn=Symbol.for("#__inited__"),bn=Symbol.for("#__init__"),ze=Symbol.for("#domFlags"),Sn=Symbol.for("##parent"),vt=Symbol.for("#end"),_n=Symbol.for("#removeChild"),xn=Symbol(),wn=class extends Yt{static[bn](){return this.prototype[yn]=xn,this}constructor(t,e){super(...arguments),this[ze]=t,this[Sn]=e,this.changes=new Map,this.dirty=!1,this.array=this.childNodes,this.$=new Lt(this,Symbol()),t&256||(this[vt]=kt("map")),e&&e[Br](this),this[yn]===xn&&this[vn]&&this[vn]()}[Br](t){if(this.parentNode)return this.parentNode[Ge](t,this[vt])}hasChildNodes(){return this.childNodes.length!=0}push(t,e){if(!(this[ze]&1)){this.array.push(t),this[Br](t);return}let r=this.array[e];if(r!==t){this.dirty=!0;let s=this.array.indexOf(t),i=this.changes.get(t);s===-1?(this.array.splice(e,0,t),this.insertChild(t,e,s)):s===e+1?(r&&this.changes.set(r,-1),this.array.splice(e,1)):(s>=0&&this.array.splice(s,1),this.array.splice(e,0,t),this.moveChild(t,e,s)),i==-1&&this.changes.delete(t)}}insertChild(t,e,r){let s=this.parentNode;if(s)if(e>0){let i=this.array[e-1];s[Ge](t,i.nextSibling)}else s[Ge](t,this.childNodes[e+1]||this[vt])}moveChild(t,e,r){return this.insertChild(t,e,r)}removeChild(t,e){t.parentNode&&t[zr](t.parentNode)}[Ge](t,e){}[pl](t,e){let r=t[Be](e,this[vt]);return this[zr](e),r}[Be](t,e){this[Sn]=t;let r=this.parentNode;if(t!=r){this.parentNode=t;for(let s=0,i=gn(this.array),n=i.length;s<n;s++)i[s][Be](t,e);this[vt]&&this[vt][Be](t,e)}return this}[zr](t){for(let e=0,r=gn(this.array),s=r.length;e<s;e++){let i=r[e];t[_n](i)}return this[vt]&&t[_n](this[vt]),this.parentNode=null}[ml](t){var e=this;if(!(this[ze]&1)){this[ze]|=1;return}if(this.dirty&&(e.changes.forEach(function(r,s){if(r==-1)return e.removeChild(s)}),e.changes.clear(),e.dirty=!1),e.array.length>t)for(;e.array.length>t;){let r=e.array.pop();e.removeChild(r)}}};wn[bn]();function bh(t,e){return new wn(t,e)}var At=Symbol.for("#__init__"),Tn=Symbol.for("#__initor__"),Ln=Symbol.for("#__inited__"),gl=Symbol.for("##inited"),yl=Symbol.for("#afterVisit"),vl=Symbol.for("#beforeReconcile"),bl=Symbol.for("#afterReconcile"),Nn=Symbol.for("#__hooks__"),Ht=Symbol.for("#autorender"),Ue=Symbol.for("##visitContext"),Mn=Symbol(),On=new class{constructor(t=null){this[At](t)}[At](t=null){var e;this.items=t&&(e=t.items)!==void 0?e:[],this.current=t&&(e=t.current)!==void 0?e:null,this.lastQueued=t&&(e=t.lastQueued)!==void 0?e:null,this.tests=t&&(e=t.tests)!==void 0?e:0}flush(){let t=null;for(;t=this.items.shift();){if(!t.parentNode||t.hydrated\u03A6)continue;let e=this.current;this.current=t,t.__F|=1024,t.connectedCallback(),this.current=e}}queue(t){var e=this;let r=this.items.length,s=0,i=this.lastQueued;this.lastQueued=t;let n=A.DOCUMENT_POSITION_PRECEDING,o=A.DOCUMENT_POSITION_FOLLOWING;if(r){let h=this.items.indexOf(i),l=h,c=function(v,m){return e.tests++,v.compareDocumentPosition(m)};(h==-1||i.nodeName!=t.nodeName)&&(l=h=0);let a=e.items[l];for(;a&&c(a,t)&o;)a=e.items[++l];if(l!=h)a?e.items.splice(l,0,t):e.items.push(t);else{for(;a&&c(a,t)&n;)a=e.items[--l];l!=h&&(a?e.items.splice(l+1,0,t):e.items.unshift(t))}}else e.items.push(t),e.current||globalThis.queueMicrotask(e.flush.bind(e))}};function Sh(){return On.flush()}var xe=class extends H{static[At](){return this.prototype[Tn]=Mn,this}constructor(){super(),this.flags$ns&&(this.flag$=this.flagExt$),this.setup$(),this.build(),this[Tn]===Mn&&this[Ln]&&this[Ln]()}setup$(){return this.__slots={},this.__F=0}[At](){return this.__F|=3,this}[gl](){if(this[Nn])return this[Nn].inited(this)}flag$(t){this.className=this.flags$ext=t}build(){return this}awaken(){return this}mount(){return this}unmount(){return this}rendered(){return this}dehydrate(){return this}hydrate(){return this.autoschedule=!0,this}tick(){return this.commit()}visit(){return this.commit()}commit(){return this.render\u03A6?(this.__F|=256,this.render&&this.render(),this.rendered(),this.__F=(this.__F|512)&-257&-8193):(this.__F|=8192,this)}get autoschedule(){return(this.__F&64)!=0}set autoschedule(t){t?this.__F|=64:this.__F&=-65}set autorender(t){let e=this[Ht]||(this[Ht]={});e.value=t,this.mounted\u03A6&&z.schedule(this,e)}get render\u03A6(){return!this.suspended\u03A6}get mounting\u03A6(){return(this.__F&16)!=0}get mounted\u03A6(){return(this.__F&32)!=0}get awakened\u03A6(){return(this.__F&8)!=0}get rendered\u03A6(){return(this.__F&512)!=0}get suspended\u03A6(){return(this.__F&4096)!=0}get rendering\u03A6(){return(this.__F&256)!=0}get scheduled\u03A6(){return(this.__F&128)!=0}get hydrated\u03A6(){return(this.__F&2)!=0}get ssr\u03A6(){return(this.__F&1024)!=0}schedule(){return z.on("commit",this),this.__F|=128,this}unschedule(){return z.un("commit",this),this.__F&=-129,this}async suspend(t=null){let e=this.flags.incr("@suspended");return this.__F|=4096,t instanceof Function&&(await t(),this.unsuspend()),this}unsuspend(){return this.flags.decr("@suspended")==0&&(this.__F&=-4097,this.commit()),this}[yl](){if(this.visit(),this[Ue])return this[Ue]=null}[vl](){return this.__F&1024&&(this.__F=this.__F&-1025,this.classList.remove("_ssr_"),this.flags$ext&&this.flags$ext.indexOf("_ssr_")==0&&(this.flags$ext=this.flags$ext.slice(5)),this.__F&512||(this.innerHTML="")),globalThis.DEBUG_IMBA&&Ut.push(this),this[Ue]&&(this[Ue]=null),this}[bl](){return globalThis.DEBUG_IMBA&&Ut.pop(this),this}connectedCallback(){let t=this.__F,e=t&1,r=t&8;if(!e&&!(t&1024)){On.queue(this);return}if(t&48)return;this.__F|=16,e||this[At](),t&2||(this.flags$ext=this.className,this.__F|=2,this.hydrate(),this.commit()),r||(this.awaken(),this.__F|=8),ot(this,"mount");let s=this.mount();return s&&s.then instanceof Function&&s.then(z.commit),t=this.__F=(this.__F|32)&-17,t&64&&this.schedule(),this[Ht]&&z.schedule(this,this[Ht]),this}disconnectedCallback(){if(this.__F=this.__F&-49,this.__F&128&&this.unschedule(),ot(this,"unmount"),this.unmount(),this[Ht])return z.unschedule(this,this[Ht])}};xe[At]();var _h=xe;function Sl(t,e){let r=Object.getOwnPropertyDescriptors(e);return delete r.constructor,Object.defineProperties(t,r),t}var En=Symbol.for("#__init__"),_l={cm:1,mm:1,Q:1,pc:1,pt:1,px:1,em:1,ex:1,ch:1,rem:1,vw:1,vh:1,vmin:1,vmax:1,s:1,ms:1,fr:1,"%":1,in:1,turn:1,grad:1,rad:1,deg:1,Hz:1,kHz:1},Cn={prefix:1,suffix:1,content:1},Ur={rose:[[356,100,97],[356,100,95],[353,96,90],[353,96,82],[351,95,71],[350,89,60],[347,77,50],[345,83,41],[343,80,35],[342,75,30]],pink:[[327,73,97],[326,78,95],[326,85,90],[327,87,82],[329,86,70],[330,81,60],[333,71,51],[335,78,42],[336,74,35],[336,69,30]],fuchsia:[[289,100,98],[287,100,95],[288,96,91],[291,93,83],[292,91,73],[292,84,61],[293,69,49],[295,72,40],[295,70,33],[297,64,28]],purple:[[270,100,98],[269,100,95],[269,100,92],[269,97,85],[270,95,75],[271,91,65],[271,81,56],[272,72,47],[273,67,39],[274,66,32]],violet:[[250,100,98],[251,91,95],[251,95,92],[252,95,85],[255,92,76],[258,90,66],[262,83,58],[263,70,50],[263,69,42],[264,67,35]],indigo:[[226,100,97],[226,100,94],[228,96,89],[230,94,82],[234,89,74],[239,84,67],[243,75,59],[245,58,51],[244,55,41],[242,47,34]],blue:[[214,100,97],[214,95,93],[213,97,87],[212,96,78],[213,94,68],[217,91,60],[221,83,53],[224,76,48],[226,71,40],[224,64,33]],sky:[[204,100,97],[204,94,94],[201,94,86],[199,95,74],[198,93,60],[199,89,48],[200,98,39],[201,96,32],[201,90,27],[202,80,24]],cyan:[[183,100,96],[185,96,90],[186,94,82],[187,92,69],[188,86,53],[189,94,43],[192,91,36],[193,82,31],[194,70,27],[196,64,24]],teal:[[166,76,97],[167,85,89],[168,84,78],[171,77,64],[172,66,50],[173,80,40],[175,84,32],[175,77,26],[176,69,22],[176,61,19]],emerald:[[152,81,96],[149,80,90],[152,76,80],[156,72,67],[158,64,52],[160,84,39],[161,94,30],[163,94,24],[163,88,20],[164,86,16]],green:[[138,76,97],[141,84,93],[141,79,85],[142,77,73],[142,69,58],[142,71,45],[142,76,36],[142,72,29],[143,64,24],[144,61,20]],lime:[[78,92,95],[80,89,89],[81,88,80],[82,85,67],[83,78,55],[84,81,44],[85,85,35],[86,78,27],[86,69,23],[88,61,20]],yellow:[[55,92,95],[55,97,88],[53,98,77],[50,98,64],[48,96,53],[45,93,47],[41,96,40],[35,92,33],[32,81,29],[28,73,26]],amber:[[48,100,96],[48,96,89],[48,97,77],[46,97,65],[43,96,56],[38,92,50],[32,95,44],[26,90,37],[23,83,31],[22,78,26]],orange:[[33,100,96],[34,100,92],[32,98,83],[31,97,72],[27,96,61],[25,95,53],[21,90,48],[17,88,40],[15,79,34],[15,75,28]],red:[[0,86,97],[0,93,94],[0,96,89],[0,94,82],[0,91,71],[0,84,60],[0,72,51],[0,74,42],[0,70,35],[0,63,31]],warmer:[[60,9,98],[60,5,96],[20,6,90],[24,6,83],[24,5,64],[25,5,45],[33,5,32],[30,6,25],[12,6,15],[24,10,10]],warm:[[0,0,98],[0,0,96],[0,0,90],[0,0,83],[0,0,64],[0,0,45],[0,0,32],[0,0,25],[0,0,15],[0,0,9]],gray:[[0,0,98],[240,5,96],[240,6,90],[240,5,84],[240,5,65],[240,4,46],[240,5,34],[240,5,26],[240,4,16],[240,6,10]],cool:[[210,20,98],[220,14,96],[220,13,91],[216,12,84],[218,11,65],[220,9,46],[215,14,34],[217,19,27],[215,28,17],[221,39,11]],cooler:[[210,40,98],[210,40,96],[214,32,91],[213,27,84],[215,20,65],[215,16,47],[215,19,35],[215,25,27],[217,33,17],[222,47,11]]},xl=new RegExp("^("+Object.keys(Ur).join("|")+")(\\d+(?:\\.\\d+)?)$"),wl=/^([xyz])$/,Tl=/^([tlbr]|size|[whtlbr]|[mps][tlbrxy]?|[rcxy]?[gs])$/,Ll=`*,::before,::after {
box-sizing: border-box;
border-width: 0;
border-style: solid;
border-color: currentColor;
}`,Nl=class{constructor(t=null){this[En](t)}[En](t=null){var e;this.entries=t&&(e=t.entries)!==void 0?e:{}}register(t,e){let r=this.entries[t];r?r&&(r.css=e,r.node&&(r.node.textContent=e)):(r=this.entries[t]={sourceId:t,css:e},this.entries.resets||this.register("resets",Ll))}toString(){return Object.values(this.entries).map(function(t){return t.css}).join(`
`)}toValue(t,e,r,s=null){let i;Cn[r]&&(t=String(t));let n=typeof t;if(n=="number"){if(e||(wl.test(r)?e="px":Tl.test(r)?e="u":r=="rotate"&&(e="turn",t=(t%1).toFixed(4))),e)return _l[e]?t+e:e=="u"?t*4+"px":"calc(var(--u_"+e+",1px) * "+t+")"}else if(n=="string"){if(r&&Cn[r]&&t[0]!='"'&&t[0]!="'"&&(t.indexOf('"')>=0?t.indexOf("'")==-1&&(t="'"+t+"'"):t='"'+t+'"'),i=t.match(xl)){let o=Ur[i[1]][parseInt(i[2])],h="100%";if(typeof s=="number"?h=s+"%":typeof s=="string"&&(h=s),o)return"hsla("+o[0]+","+o[1]+"%,"+o[2]+"%,"+h+")"}}else if(t&&t.toStyleString instanceof Function)return t.toStyleString();return t}parseDimension(t){if(typeof t=="string"){let[e,r,s]=t.match(/^([-+]?[\d\.]+)(%|\w+)$/);return[parseFloat(r),s]}else if(typeof t=="number")return[t]}},Xs=new Nl,xh=Object.keys(Ur);function wh(){return!0}var Ml=class{css$(t,e,r){return this.style[t]=e}css$var(t,e,r,s,i=null){let n=Xs.toValue(e,r,s,i);this.style.setProperty(t,n)}};Sl(x.prototype,Ml.prototype);var Ol=Symbol.for("#insertInto"),Pn=Symbol.for("#removeFrom");function Th(t,e={}){let r=k.context;k.context=e;let s=t(e);return k.context==e&&(k.context=r),s}function Qs(t,e){return console.error(`imba.mount not supported on server.
To spawn a dev-server for an imba client run:
> imba serve my-imba-file.imba`),String(t)}function Js(t){return t&&t[Pn]&&t[Pn](t.parentNode),t}var kn=globalThis.imba||(globalThis.imba={});kn.mount=Qs,kn.unmount=Js;function jt(t,e){let r=Object.getOwnPropertyDescriptors(e);return delete r.constructor,Object.defineProperties(t,r),t}function se(t){let e;return t?(e=t.toIterable)?e.call(t):t:[]}var ie=Symbol.for("##onchange"),ne=Symbol.for("#afterVisit"),oe=Symbol.for("##oninput"),qe=Symbol.for("##onclick"),he=Symbol.for("##bound"),bt=Symbol.for("##visitContext");function Lh(){return!0}var El={INPUT:!0,SELECT:!0,TEXTAREA:!0,BUTTON:!0},qr=function(t){return t instanceof Array||t&&t.has instanceof Function},Kr=function(t,e){return t==e?!0:t instanceof Array?t.indexOf(e)>=0:t&&t.has instanceof Function?t.has(e):t&&t.contains instanceof Function?t.contains(e):!1},Yr=function(t,e){if(t instanceof Array)return t.push(e);if(t&&t.add instanceof Function)return t.add(e)},Wr=function(t,e){if(t instanceof Array){let r=t.indexOf(e);if(r>=0)return t.splice(r,1)}else if(t&&t.delete instanceof Function)return t.delete(e)};function Cl(t){function e(){return t[0]?t[0][t[1]]:void 0}function r(s){return t[0]?t[0][t[1]]=s:null}return{get:e,set:r}}var Pl=class{getRichValue(){return this.value}setRichValue(t){return this.value=t}bind$(t,e){let r=e||[];return t=="data"&&!this[he]&&El[this.nodeName]&&(this[he]=!0,this[ie]&&this.addEventListener("change",this[ie]=this[ie].bind(this)),this[oe]&&this.addEventListener("input",this[oe]=this[oe].bind(this),{capture:!0}),this[qe]&&this.addEventListener("click",this[qe]=this[qe].bind(this),{capture:!0})),Object.defineProperty(this,t,r instanceof Array?Cl(r):r),r}};jt(x.prototype,Pl.prototype),Object.defineProperty(x.prototype,"richValue",{get:function(){return this.getRichValue()},set:function(t){return this.setRichValue(t)}});var kl=class{[ie](t){let e=this.data,r=this.$$value;this.$$value=void 0;let s=this.getRichValue();if(this.multiple){if(r)for(let i=0,n=se(r),o=n.length;i<o;i++){let h=n[i];s.indexOf(h)==-1&&Wr(e,h)}for(let i=0,n=se(s),o=n.length;i<o;i++){let h=n[i];(!r||r.indexOf(h)==-1)&&Yr(e,h)}}else this.data=s[0];return I(),this}getRichValue(){var t;if(this.$$value)return this.$$value;t=[];for(let e=0,r=se(this.selectedOptions),s=r.length;e<s;e++){let i=r[e];t.push(i.richValue)}return this.$$value=t}syncValue(){let t=this.data;if(this.multiple){let e=[];for(let r=0,s=se(this.options),i=s.length;r<i;r++){let n=s[r],o=n.richValue,h=Kr(t,o);n.selected=h,h&&e.push(o)}this.$$value=e}else for(let e=0,r=se(this.options),s=r.length;e<s;e++){let i=r[e].richValue;if(i==t){this.$$value=[i],this.selectedIndex=e;break}}}[ne](){if(this.syncValue(),this[bt])return this[bt]=null}};jt(dr.prototype,kl.prototype);var $l=class{setRichValue(t){return this.$$value=t,this.value=t}getRichValue(){return this.$$value!==void 0?this.$$value:this.value}};jt(gr.prototype,$l.prototype);var Fl=class{setRichValue(t){return this.$$value=t,this.value=t}getRichValue(){return this.$$value!==void 0?this.$$value:this.value}[oe](t){return this.data=this.value,I()}[ne](){let t=this.data;if(t==null&&(t=""),this[he]&&this.value!=t&&(this.value=t),this[bt])return this[bt]=null}};jt(pr.prototype,Fl.prototype);var Il=class{[oe](t){let e=this.type;if(!(e=="checkbox"||e=="radio")&&!(e=="number"&&Number.isNaN(this.valueAsNumber)))return this.$$value=void 0,this.data=this.richValue,I()}[ie](t){let e=this.data,r=this.richValue;if(this.type=="checkbox"||this.type=="radio"){let s=this.checked;qr(e)?s?Yr(e,r):Wr(e,r):this.data=s?r:!1}return I()}setRichValue(t){this.$$value!==t&&(this.$$value=t,this.value!==t&&(this.value=t))}getRichValue(){if(this.$$value!==void 0)return this.$$value;let t=this.value,e=this.type;if(e=="range"||e=="number"){let r=this.valueAsNumber;Number.isNaN(r)&&(r=Number(t.replace(/\,/,".")+0)),Number.isNaN(r)&&(r=null),t=r}else e=="checkbox"&&(t==null||t==="on")&&(t=!0);return t}[ne](){if(this[he]){let t=this.type;if(t=="checkbox"||t=="radio"){let e=this.data;e===!0||e===!1||e==null?this.checked=!!e:this.checked=Kr(e,this.richValue)}else this.richValue=this.data}this[bt]&&(this[bt]=null)}};jt(fr.prototype,Il.prototype);var Al=class{get checked(){return this.$checked}set checked(t){t!=this.$checked&&(this.$checked=t,this.flags.toggle("checked",!!t))}setRichValue(t){return this.$$value=t,this.value=t}getRichValue(){return this.$$value!==void 0?this.$$value:this.value}[qe](t){let e=this.data,r=this.checked,s=this.richValue;return qr(e)?r?Wr(e,s):Yr(e,s):this.$$value==null?this.data=!r:this.data=r?null:s,this[ne](),I()}[ne](){if(this[he]){let t=this.data,e=this.$$value==null?!0:this.$$value;qr(t)?this.checked=Kr(t,e):this.checked=t==e}this[bt]&&(this[bt]=null)}};jt(mr.prototype,Al.prototype);function $n(t){let e;return t?(e=t.toIterable)?e.call(t):t:[]}var Hl=Symbol.for("#getSlot"),jl=Symbol.for("#container"),Vl=Symbol.for("#afterVisit"),Ot=Symbol.for("#__init__"),Fn=Symbol.for("#__initor__"),In=Symbol.for("#__inited__"),Ke=Symbol.for("#listeners"),rt=Symbol.for("#slot"),Rl=Symbol.for("#parent"),R=Symbol.for("##container"),Xr=Symbol.for("#domTarget"),An=Symbol.for("#insertInto"),Dl=Symbol.for("#removeFrom"),Gl=Symbol.for("#teleport"),Bl=Symbol.for("#self"),zl=Symbol.for("#target"),Hn=Symbol(),Qr=class extends xe{static[Ot](){return this.prototype[Fn]=Hn,this}constructor(){super(...arguments),super[Ot]||this[Ot](),this[Fn]===Hn&&this[In]&&this[In]()}[Ot](t=null){super[Ot]&&super[Ot](...arguments),this.to=t?t.to:void 0}build(){return this[Ke]=[],this.win=globalThis,this.doc=globalThis.document}setup(){return this.setAttribute("style","display:none !important;")}[Hl](t,e){return this[rt]||(this[rt]=_e(0,this[Rl])),this[rt]}get[jl](){if(!this[R]){let t=this.className;this[R]=this.doc.createElement("div"),this[R].className=t,this[R].style.cssText="display:contents !important;"}return this[R]}get domTarget(){return this[Xr]||(this[Xr]=this.to instanceof x?this.to:this.closest(this.to)||this.doc.querySelector(this.to))}get eventTarget(){return this.domTarget}get style(){return this[R]?this[R].style:super.style}get classList(){return this[R]?this[R].classList:super.classList}get className(){return this[R]?this[R].className:super.className}set className(t){this[R]?this[R].className=t:super.className=t}[Vl](){if(this.mounted\u03A6&&this[rt]&&!this[rt].parentNode)return this[rt][An](this.target)}mount(){for(let e=0,r=$n(this[Ke]),s=r.length;e<s;e++){let[i,n,o]=r[e];this.eventTarget.addEventListener(i,n,o)}let t=this.domTarget;return this[rt]&&this[rt][An](t),this}unmount(){for(let t=0,e=$n(this[Ke]),r=e.length;t<r;t++){let[s,i,n]=e[t];this.eventTarget.removeEventListener(s,i,n)}return this[rt]&&this[rt][Dl](this.domTarget),this[Xr]=null,this}addEventListener(t,e,r={}){if(e[Gl]=this,e[Bl]=this,this[Ke].push([t,e,r]),this.mounted\u03A6&&this.eventTarget?.addEventListener)return this.eventTarget.addEventListener(t,e,r)}};Qr[Ot]();var Ul=class extends Qr{get domTarget(){return this.doc.body}get eventTarget(){return this.win}addEventListener(t,e,r={}){return e[zl]=this.domTarget.parentNode,super.addEventListener(...arguments)}on$resize(t,e,r,s){return this.addEventListener("resize",r,s),r}};globalThis.customElements&&(globalThis.customElements.define("i-teleport",Qr),globalThis.customElements.define("i-global",Ul));function Nh(){return!0}function St(t){let e;return t?(e=t.toIterable)?e.call(t):t:[]}function ql(t,e){let r=Object.getOwnPropertyDescriptors(e);return delete r.constructor,Object.defineProperties(t,r),t}var dt=Symbol.for("#__init__"),Ye=Symbol.for("#__initor__"),We=Symbol.for("#__inited__"),jn=Symbol.for("#imba"),Jr=Symbol.for("#insertInto"),Zr=Symbol.for("#removeFrom"),Kl=Symbol.for("#all"),ae=Symbol.for("#phase"),ft=Symbol.for("#nodes"),Yl=Symbol.for("#sizes"),Vn=Symbol.for("#mode"),Rn=Symbol.for("#enabled"),Wl=Symbol.for("#easer"),Dn=Symbol.for("#anims"),ts=Symbol.for("#_easer_"),Gn=Symbol(),Bn=Symbol(),zn=class extends lr{static[dt](){return this.prototype[Ye]=Gn,this}constructor(){super(...arguments),super[dt]||this[dt](),this[Ye]===Gn&&this[We]&&this[We]()}[dt](t=null){var e;super[dt]&&super[dt](...arguments),this.selectors=t&&(e=t.selectors)!==void 0?e:{}}addSelectors(t,e){var r;return((r=this.selectors)[e]||(r[e]=[])).push(...t),!0}getSelectors(...t){let e=[];for(let r=0,s=St(t),i=s.length;r<i;r++){let n=s[r];this.selectors[n]&&e.push(...this.selectors[n])}return e&&e.length?e.join(","):null}nodesForBase(t,e="transition"){let r=[t],s=(this.selectors[e]||[]).join(",");if(s=="")return r;let i=t.querySelectorAll(s);for(let n=0,o=St(i),h=o.length;n<h;n++){let l=o[n];l.closest("._ease_")==t&&r.push(l)}return r[Kl]=i,r}nodesWithSize(t,e="in"){let r=this.getSelectors("_off_sized","_"+e+"_sized");return r?t.filter(function(s){return s.matches(r)}):[]}};zn[dt]();var we=new zn,Xl=globalThis.imba||(globalThis.imba={});Xl.transitions=we;var Sr=class extends lr{static[dt](){return this.prototype[Ye]=Bn,this}constructor(t){super(),this.dom=t,this[ae]=null,this[ft]=[],this[Yl]=new Map,this[Ye]===Bn&&this[We]&&this[We]()}log(...t){}get flags(){return this.dom.flags}flag(t){for(let e=0,r=St(this[ft]),s=r.length;e<s;e++)r[e].flags.add(t);return this}unflag(t){for(let e=0,r=St(this[ft]),s=r.length;e<s;e++)r[e].flags.remove(t);return this}commit(){return this.dom.offsetWidth}enable(t){return t&&(this[Vn]=t),this[Rn]!=!0&&(this[Rn]=!0,!0)?(this.dom[Jr]=this[Jr].bind(this),this.dom[Zr]=this[Zr].bind(this),this.flags.add("_ease_")):this}disable(){return this.flags.remove("_ease_"),!0}set phase(t){let e=this[ae];this[ae]!=t&&(this[ae]=t,!0)&&(e&&this.unflag("@"+e),t&&this.flag("@"+t),t||(this.unflag("@out"),this.unflag("@in"),this.unflag("@off"),this[ft]=null),t=="enter"&&e=="leave"&&this.dom?.transition\u039Eout\u039Ecancel?.(this),t=="leave"&&e=="enter"&&this.dom?.transition\u039Ein\u039Ecancel?.(this),t=="enter"&&this.dom?.transition\u039Ein?.(this),t=="leave"&&this.dom?.transition\u039Eout?.(this),e=="leave"&&!t&&this.dom?.transition\u039Eout\u039Eend?.(this),e=="enter"&&!t&&this.dom?.transition\u039Ein\u039Eend?.(this))}get phase(){return this[ae]}get leaving\u03A6(){return this.phase=="leave"}get entering\u03A6(){return this.phase=="enter"}get idle\u03A6(){return this.phase==null}track(t){var e=this;let r={before:qt().getAnimations()};return this.commit(),t(),this.commit(),r.after=qt().getAnimations(),r.fresh=r.after.filter(function(s){return r.before.indexOf(s)==-1}),r.deep=r.fresh.filter(function(s){let i;return!!((i=s.effect.target)&&i.closest("._ease_")!=e.dom)}),r.own=r.fresh.filter(function(s){return r.deep.indexOf(s)==-1}),r.own.length?r.finished=new Promise(function(s){let i=new Set(r.own),n=function(){if(i.delete(this),i.size==0)return s()};for(let o=0,h=St(r.own),l=h.length;o<l;o++){let c=h[o];c[Wl]=e,c.addEventListener("finish",n,{once:!0}),c.addEventListener("cancel",n,{once:!0})}}):r.finished=Promise.resolve(!0),r}getAnimatedNodes(){return we.nodesForBase(this.dom)}getNodeSizes(t="in",e=this[ft]){let r=we.nodesWithSize(e,t),s=new Map;for(let i=0,n=St(r),o=n.length;i<o;i++){let h=n[i],l=(this&&this[jn]||globalThis[jn]).window.getComputedStyle(h);s.set(h,{width:l.width,height:l.height})}return s}applyNodeSizes(t){for(let[e,r]of St(t))e.style.width=r.width,e.style.height=r.height;return t}clearNodeSizes(t){if(t){for(let[e,r]of St(t))e.style.removeProperty("width"),e.style.removeProperty("height");return t}}[Jr](t,e){var r=this;let s;if(this.entering\u03A6)return this.dom;let i=function(){if(s&&r.clearNodeSizes(s),r.entering\u03A6)return r.phase=null};if(r.leaving\u03A6)return r.track(function(){return r.phase="enter",r.unflag("@off"),r.unflag("@out")}).finished.then(i,function(o){return r.log("error cancel leave",o)}),r.dom;let n=qt().contains(t);return e?t.insertBefore(r.dom,e):t.appendChild(r.dom),this[ft]=r.getAnimatedNodes(),r.flag("_instant_"),r.unflag("@out"),r.commit(),s=this[ft].sized=r.getNodeSizes("in"),r.dom?.transition\u039Ein\u039Einit?.(r),r.flag("@off"),r.flag("@in"),r.flag("@enter"),r.commit(),r.unflag("_instant_"),(this[Dn]=r.track(function(){return r.phase="enter",r.applyNodeSizes(s),r.unflag("@off"),r.unflag("@in")})).finished.then(i,function(o){return r.clearNodeSizes(s),r.log("cancelled insert into",o)}),r.dom}[Zr](t){var e=this;if(this.leaving\u03A6)return;let r,s=function(){if(e.phase=="leave")return e.dom.emit("easeoutend",{}),t.removeChild(e.dom),e.phase=null};if(e.entering\u03A6&&this[Vn]!="forward"){let n=e.track(function(){return e.flag("@off"),e.flag("@in"),e.unflag("@out"),e.phase="leave",e.clearNodeSizes(e[ft].sized)});e.log("cancel enter anims own",n.own,n),n.finished.then(s,function(o){return e.log("error cancel entering",o)});return}this[ft]=e.getAnimatedNodes(),r=e.getNodeSizes("out"),e.applyNodeSizes(r),e.flag("@leave");let i=this[Dn]=e.track(function(){return e.phase="leave",e.flag("@off"),e.flag("@out"),e.clearNodeSizes(r)});if(!i.own.length){s();return}i.finished.then(s,function(){return!0})}};Sr[dt]();var Ql=class{transition\u039Ein\u039Einit(t){return!0}transition\u039Ein(t){return!0}transition\u039Ein\u039Eend(t){return!0}transition\u039Ein\u039Ecancel(t){return!0}transition\u039Eout(t){return!0}transition\u039Eout\u039Eend(t){return!0}transition\u039Eout\u039Ecancel(t){return!0}get ease(){return this[ts]||(this[ts]=new Sr(this))}set ease(t){if(t==!1){this[ts]?.disable?.();return}this.ease.enable(t)}};ql(x.prototype,Ql.prototype);function Mh(){return!0}function Jl(t,e){let r=Object.getOwnPropertyDescriptors(e);return delete r.constructor,Object.defineProperties(t,r),t}function Zs(){return!0}var Zl=class{\u03B1esc(){return this.keyCode==27}\u03B1tab(){return this.keyCode==9}\u03B1enter(){return this.keyCode==13}\u03B1space(){return this.keyCode==32}\u03B1up(){return this.keyCode==38}\u03B1down(){return this.keyCode==40}\u03B1left(){return this.keyCode==37}\u03B1right(){return this.keyCode==39}\u03B1del(){return this.keyCode==8||this.keyCode==46}\u03B1key(t){if(typeof t=="string")return this.key==t;if(typeof t=="number")return this.keyCode==t}};Jl(Ks.prototype,Zl.prototype);function tu(t,e){let r=Object.getOwnPropertyDescriptors(e);return delete r.constructor,Object.defineProperties(t,r),t}function _r(){return!0}var eu=class{\u03B1left(){return this.button==0}\u03B1middle(){return this.button==1}\u03B1right(){return this.button==2}\u03B1shift(){return!!this.shiftKey}\u03B1alt(){return!!this.altKey}\u03B1ctrl(){return!!this.ctrlKey}\u03B1meta(){return!!this.metaKey}\u03B1mod(){let t=globalThis.navigator.platform;return/^(Mac|iPhone|iPad|iPod)/.test(t||"")?!!this.metaKey:!!this.ctrlKey}};tu(vr.prototype,eu.prototype);function es(t,e){let r=Object.getOwnPropertyDescriptors(e);return delete r.constructor,Object.defineProperties(t,r),t}function Un(t){let e;return t?(e=t.toIterable)?e.call(t):t:[]}var ru=Symbol.for("#extendType"),su=Symbol.for("#modifierState"),Xe=Symbol.for("#sharedModifierState"),qn=Symbol.for("#onceHandlerEnd"),Kn=Symbol.for("#extendDescriptors"),D=Symbol.for("#context"),Yn=Symbol.for("#self"),iu=Symbol.for("#target"),Wn=Symbol.for("#stopPropagation"),Xn=Symbol.for("#defaultPrevented"),nu=Symbol.for("#teleport");Zs(),_r();var ou=class{[ru](t){var e,r,s;let i=t[Kn]||(t[Kn]=(r=Object.getOwnPropertyDescriptors(t.prototype),s=r.constructor,delete r.constructor,r));return Object.defineProperties(this,i)}};es(Z.prototype,ou.prototype);var hu=class{get[su](){var t,e;return(t=this[D])[e=this[D].step]||(t[e]={})}get[Xe](){var t,e;return(t=this[D].handler)[e=this[D].step]||(t[e]={})}[qn](t){return B(this[D],"end",t)}\u03B1sel(t){return!!this.target.matches(String(t))}\u03B1closest(t){return!!this.target.closest(String(t))}\u03B1log(...t){return console.info(...t),!0}\u03B1trusted(){return!!this.isTrusted}\u03B1if(t){return!!t}\u03B1wait(t=250){return new Promise(function(e){return setTimeout(e,Bt(t))})}\u03B1self(){return this.target==this[D].element}\u03B1cooldown(t=250){let e=this[Xe];return e.active?!1:(e.active=!0,e.target=this[D].element,e.target.flags.incr("cooldown"),this[qn](function(){return setTimeout(function(){return e.target.flags.decr("cooldown"),e.active=!1},Bt(t))}),!0)}\u03B1throttle(t=250){let e=this[Xe];return e.active?(e.next&&e.next(!1),new Promise(function(r){return e.next=function(s){return e.next=null,r(s)}})):(e.active=!0,e.el||(e.el=this[D].element),e.el.flags.incr("throttled"),B(this[D],"end",function(){let r=Bt(t);return e.interval=setInterval(function(){e.next?e.next(!0):(clearInterval(e.interval),e.el.flags.decr("throttled"),e.active=!1)},r)}),!0)}\u03B1debounce(t=250){let e=this[Xe],r=this;return e.queue||(e.queue=[]),e.queue.push(e.last=r),new Promise(function(s){return setTimeout(function(){return e.last==r?(r.debounced=e.queue,e.last=null,e.queue=[],s(!0)):s(!1)},Bt(t))})}\u03B1flag(t,e){let{element:r,step:s,state:i,id:n,current:o}=this[D],h=e instanceof x?e:e?r.closest(e):r;if(!h)return!0;this[D].commit=!0,i[s]=n,h.flags.incr(t);let l=Date.now();return B(o,"end",function(){let c=Date.now()-l,a=Math.max(250-c,0);return setTimeout(function(){return h.flags.decr(t)},a)}),!0}\u03B1busy(t){return this.\u03B1flag("busy",t)}\u03B1outside(){let{handler:t}=this[D];if(t&&t[Yn])return!t[Yn].parentNode.contains(this.target)}};es(X.prototype,hu.prototype);var Oh={};function Eh(){return!0}var ti=class{constructor(t,e){this.params=t,this.closure=e}getHandlerForMethod(t,e){return t?t[e]?t:this.getHandlerForMethod(t.parentNode,e):null}emit(t,...e){return ot(this,t,e)}on(t,...e){return nt(this,t,...e)}once(t,...e){return B(this,t,...e)}un(t,...e){return zt(this,t,...e)}get passive\u03A6(){return this.params.passive}get capture\u03A6(){return this.params.capture}get silent\u03A6(){return this.params.silent}get global\u03A6(){return this.params.global}async handleEvent(t){let e=this[iu]||t.currentTarget,r=this.params,s=null,i=r.silence||r.silent;this.count||(this.count=0),this.state||(this.state={});let n={element:e,event:t,modifiers:r,handler:this,id:++this.count,step:-1,state:this.state,commit:null,current:null};if(n.current=n,t.handle$mod&&t.handle$mod.apply(n,r.options||[])==!1)return;let o=X[this.type+"$handle"]||X[t.type+"$handle"]||t.handle$mod||this.guard;if(!(o&&o.apply(n,r.options||[])==!1)){this.currentEvents||(this.currentEvents=new Set),this.currentEvents.add(t);for(let h=0,l=Object.keys(r),c=l.length,a,v;h<c;h++){if(a=l[h],v=r[a],n.step++,a[0]=="_")continue;a.indexOf("~")>0&&(a=a.split("~")[0]);let m=null,S=[t,n],p,_=null,N,O=!1,Mt=typeof a=="string";if(a[0]=="$"&&a[1]=="_"&&v[0]instanceof Function)a=v[0],a.passive||(n.commit=!0),S=[t,n].concat(v.slice(1)),_=e;else if(v instanceof Array){S=v.slice(),m=S;for(let E=0,u=Un(S),d=u.length;E<d;E++){let f=u[E];if(typeof f=="string"&&f[0]=="~"&&f[1]=="$"){let g=f.slice(2).split("."),y=n[g.shift()]||t;for(let b=0,w=Un(g),j=w.length;b<j;b++){let Le=w[b];y=y?y[Le]:void 0}S[E]=y}}}if(typeof a=="string"&&(N=a.match(/^(emit|flag|mod|moved|pin|fit|refit|map|remap|css)-(.+)$/))&&(m||(m=S=[]),S.unshift(N[2]),a=N[1]),a=="trap")t[Wn]=!0,t.stopImmediatePropagation(),t[Xn]=!0,t.preventDefault();else if(a=="stop")t[Wn]=!0,t.stopImmediatePropagation();else if(a=="prevent")t[Xn]=!0,t.preventDefault();else if(a=="commit")n.commit=!0;else if(a=="once")e.removeEventListener(t.type,this);else{if(a=="options"||a=="silence"||a=="silent")continue;if(a=="emit"){let E=S[0],u=S[1],d=new Z(E,{bubbles:!0,detail:u});d.originalEvent=t;let f=(this[nu]||e).dispatchEvent(d)}else if(typeof a=="string"){a[0]=="!"&&(O=!0,a=a.slice(1));let E="\u03B1"+a,u=t[E];u||(u=this.type&&X[this.type+"$"+a+"$mod"]),u||(u=t[a+"$mod"]||X[t.type+"$"+a]||X[a+"$mod"]),u instanceof Function?(a=u,_=n,S=m||[],t[E]&&(_=t,t[D]=n)):a[0]=="_"?(a=a.slice(1),_=this.closure):_=this.getHandlerForMethod(e,a)}}try{a instanceof Function?p=a.apply(_||e,S):_&&(p=_[a].apply(_,S)),p&&p.then instanceof Function&&p!=z.$promise&&(n.commit&&!i&&z.commit(),p=await p)}catch(E){s=E;break}if(O&&p===!0||!O&&p===!1)break;n.value=p}if(ot(n,"end",n),n.commit&&!i&&z.commit(),this.currentEvents.delete(t),this.currentEvents.size==0&&this.emit("idle"),s!=null){if(this.type!="error"){let h=s instanceof Error?s.message:s,l=new Z("error",{detail:h,bubbles:!0,cancelable:!0});l.error=s,l.originalEvent=t;let c=e.dispatchEvent(l);if(l.defaultPrevented)return}throw s}}}},au=class{on$(t,e,r){let s="on$"+t,i;i=new ti(e,r);let n=e.capture||!1,o=e.passive,h=n;return o&&(h={passive:o,capture:n}),this[s]instanceof Function?i=this[s](e,r,i,h):this.addEventListener(t,i,h),i}on$error(t,e,r,s){return t.options?.length&&(r.guard=function(...i){let n=this.event.error;return!!i.find(function(o){return n instanceof o})}),this.addEventListener("error",r,s),r}};es(x.prototype,au.prototype);var Qn=new class{get ios\u03A6(){let t=globalThis.navigator.platform||"";return!!(t.match(/iPhone|iPod|iPad/)||t=="MacIntel"&&globalThis.navigator.maxTouchPoints>2)}};function rs(t,e){let r=e;return t instanceof Element?t:typeof t=="string"?t=="this"||t==""?r:t=="up"?r.parentNode:t=="op"?r.offsetParent:r.closest(t)||r.querySelector(t)||globalThis.document.querySelector(t):null}function Vt(t){if(typeof t=="string"){let[e,r,s]=t.match(/^([-+]?[\d\.]+)(%|\w+)$/);return[parseFloat(r),s]}else if(typeof t=="number")return[t]}function ss(t,e=1){let r=1/e;return Math.round(t*r)/r}function lu(t,e,r){return e>r?Math.max(r,Math.min(e,t)):Math.min(r,Math.max(e,t))}function Jn(t,e,r,s,i=.1){let[n,o]=Vt(r),[h,l]=Vt(s),[c,a]=Vt(i);return o=="%"&&(n=(e-t)*(n/100)),l=="%"&&(h=(e-t)*(h/100)),a=="%"&&(c=(h-n)*(c/100)),function(v,m){let S=(v-t)/(e-t),p=n+(h-n)*S;return i&&(p=ss(p,c)),m&&(p=lu(p,n,h)),p}}function uu(t,e){let r=Object.getOwnPropertyDescriptors(e);return delete r.constructor,Object.defineProperties(t,r),t}_r();function Ch(){return!0}var cu=class{\u03B1primary(){return!!this.isPrimary}\u03B1mouse(){return this.pointerType=="mouse"}\u03B1pen(){return this.pointerType=="pen"}\u03B1touch(){return this.pointerType=="touch"}\u03B1pressure(t=.5){return this.pressure>=t}\u03B1lock(){return!0}};uu(qs.prototype,cu.prototype);function du(t,e){let r=Object.getOwnPropertyDescriptors(e);return delete r.constructor,Object.defineProperties(t,r),t}var Zn=Symbol.for("#capture"),st=Symbol.for("#step"),fu=Symbol.for("#cancel"),is=Symbol.for("#reframe"),to=Symbol.for("#mods"),ns=Symbol.for("#dx"),os=Symbol.for("#dy"),_t=Symbol.for("#context"),Qe=Symbol.for("#locked"),eo=Symbol.for("#teardown"),ro=Symbol.for("#x"),so=Symbol.for("#y"),pu=Symbol.for("#pinTarget");function Ph(){return!0}var io=null,mu=class{constructor(t,e,r){this.phase="init",this.events=[],this.originalEvent=t,this.handler=e,this.target=this.currentTarget=r,this[to]={}}set event(t){this.events.push(t)}get ctrlKey(){return this.originalEvent.ctrlKey}get altKey(){return this.originalEvent.altKey}get shiftKey(){return this.originalEvent.shiftKey}get metaKey(){return this.originalEvent.metaKey}get isPrimary(){return this.originalEvent.isPrimary}get pointerType(){return this.originalEvent.pointerType}get start(){return this.originalEvent}get originalTarget(){return this.originalEvent.target}get event(){return this.events[this.events.length-1]}get elapsed(){return this.event.timeStamp-this.events[0].timeStamp}get type(){return this.event.type}get pointerId(){return this.originalEvent.pointerId}get pressure(){return this.event.pressure}get clientX(){return this.event.clientX}get clientY(){return this.event.clientY}get offsetX(){return this.event.offsetX}get offsetY(){return this.event.offsetY}get active\u03A6(){return this.phase!="ended"}get ended\u03A6(){return this.phase=="ended"}get dx(){return this[ns]==null?this.event.x-this.start.x:this[ns]}get dy(){return this[os]==null?this.event.y-this.start.y:this[os]}stopImmediatePropagation(){return this.cancelBubble=!0,this.event.stopImmediatePropagation(),this}stopPropagation(){return this.cancelBubble=!0,this.event.stopPropagation(),this}preventDefault(){return this.defaultPrevented=!0,this.event.preventDefault()}emit(t,...e){return ot(this,t,e)}on(t,...e){return nt(this,t,...e)}once(t,...e){return B(this,t,...e)}un(t,...e){return zt(this,t,...e)}\u03B1flag(t,e){let{element:r}=this[_t],s=Date.now(),i=e instanceof x?e:e?r.closest(e):r;return this[st].setup!=!0&&(this[st].setup=!0,!0)&&(i.flags.incr(t),B(this,"end",function(){return i.flags.decr(t)})),!0}\u03B1lock(){return this[Zn](),!0}[Zn](){if(this[Qe]!=!0&&(this[Qe]=!0,!0))return this[_t].element.setPointerCapture(this.pointerId)}get[st](){var t,e;return(t=this[to])[e=this[_t].step]||(t[e]={})}[fu](){return this[eo]()}\u03B1moved(t,e){let r=this[st],{element:s,state:i,event:n}=this[_t];if(!r.setup){let a=t||4;typeof t=="string"&&t.match(/^(up|down|left|right|x|y)$/)&&(r.dir=t,a=e||4),typeof e=="string"&&e.match(/^(up|down|left|right|x|y)$/)&&(r.dir=e),r.setup=!0;let[v,m]=Vt(a);r.threshold=v,r.sy=v,r.x0=this.x,r.y0=this.y,r.dir||(r.dir="dist"),r.x=r.left=r.right=r.y=r.up=r.down=r.dist=0,m&&m!="px"&&console.warn("only px threshold allowed in @touch.moved")}if(r.active)return!0;if(r.cancelled)return!1;let o=r.threshold,h=this.x-r.x0,l=this.y-r.y0;r.x=Math.max(r.x,Math.abs(h)),r.y=Math.max(r.y,Math.abs(l)),r.left=Math.max(r.left,-h),r.right=Math.max(r.right,h),r.up=Math.max(r.up,-l),r.down=Math.max(r.down,l),r.dist=Math.max(r.dist,Math.sqrt(h*h+l*l));let c=r[r.dir];if(c>o&&c>=r.x&&c>=r.y){r.active=!0;let a=i.pinTarget;return s.flags.incr("@move"),a&&a.flags.incr("@move"),this.preventDefault(),B(this,"end",function(){return a&&a.flags.decr("@move"),s.flags.decr("@move")}),!0}else if(r.x>o||r.y>o)return r.cancelled=!0,!1;return!1}\u03B1hold(t=250){var e=this;let r=this[st],s=this[_t].element;if(r.cancelled)return!1;if(r.setup&&!r.active){let i=this.clientX,n=this.clientY,o=i-r.x,h=n-r.y;Math.sqrt(o*o+h*h)>5&&!r.cancelled&&(clearTimeout(r.timeout),r.cancelled=!0)}if(r.setup!=!0&&(r.setup=!0,!0)){r.active=!1,r.x=this.clientX,r.y=this.clientY;let i;return r.timeout=setTimeout(function(){return r.active=!0,e.preventDefault(),s.flags.incr("@hold"),i&&i(!0),i=null},t),B(e,"end",function(){return r.active&&s.flags.decr("@hold"),clearTimeout(r.timeout),i&&i(!1),i=null}),new Promise(function(n){return i=n})}return r.active}\u03B1sync(t,e="x",r="y"){let s=this[st];return s.setup!=!0&&(s.setup=!0,!0)?(s.x=t[e]||0,s.y=t[r]||0,s.tx=this.x,s.ty=this.y):(e&&(t[e]=s.x+(this.x-s.tx)),r&&(t[r]=s.y+(this.y-s.ty))),this[_t].commit=!0,!0}\u03B1apply(t,e="x",r="y"){return e&&(t[e]=this.x),r&&(t[r]=this.y),this[_t].commit=!0,!0}\u03B1css(t="x",e="y"){let r=this[st];if(r.setup!=!0&&(r.setup=!0,!0))r.el=this[_t].element,r.x=r.el[ro]||0,r.y=r.el[so]||0,r.tx=this.x,r.ty=this.y;else{let s=r.el[ro]=r.x+(this.x-r.tx),i=r.el[so]=r.y+(this.y-r.ty);t&&r.el.style.setProperty("--x",s+"px"),e&&r.el.style.setProperty("--y",i+"px")}return!0}\u03B1end(){return this.phase=="ended"}\u03B1shift(){return!!this.shiftKey}\u03B1alt(){return!!this.altKey}\u03B1ctrl(){return!!this.ctrlKey}\u03B1meta(){return!!this.metaKey}\u03B1primary(){return!!this.isPrimary}\u03B1mouse(){return this.pointerType=="mouse"}\u03B1pen(){return this.pointerType=="pen"}\u03B1touch(){return this.pointerType=="touch"}\u03B1pressure(t=.5){return this.pressure>=t}\u03B1log(...t){return console.info(...t),!0}\u03B1left(){return this.originalEvent.button==0}\u03B1middle(){return this.originalEvent.button==1}\u03B1right(){return this.originalEvent.button==2}\u03B1round(t=1,e=t){return this.x=ss(this.x,t),this.y=ss(this.y,e),!0}[is](...t){let e=this[st];if(e.setup!=!0&&(e.setup=!0,!0)){let r=this.target,s=t.length,i=t[0],n=0,o="100%",h=0,l=typeof i;l=="number"||l=="string"&&/^([-+]?\d[\d\.]*)(%|\w+)$/.test(i)||i instanceof Array?i=null:l=="string"&&(i=="this"||i==""?i=r:i=="up"?i=r.parentNode:i=="op"?i=r.offsetParent:i=r.closest(i)||r.querySelector(i)),i==null&&(s++,t.unshift(i=r)),s==2?h=t[1]:s>2&&([n,o,h=0]=t.slice(1));let c=i.getBoundingClientRect();n instanceof Array||(n=[n,n]),o instanceof Array||(o=[o,o]),h instanceof Array||(h=[h,h]),e.rect=c,e.x=Jn(c.left,c.right,n[0],o[0],h[0]),e.y=Jn(c.top,c.bottom,n[1],o[1],h[1]),this.x0=this.x=e.x(this.x,e.clamp),this.y0=this.y=e.y(this.y,e.clamp)}else{let r=this.x=e.x(this.x,e.clamp),s=this.y=e.y(this.y,e.clamp);this[ns]=r-this.x0,this[os]=s-this.y0}return!0}\u03B1fit(...t){return this[st].clamp=!0,this[is](...t)}\u03B1reframe(...t){return this[is](...t)}\u03B1pin(...t){let e=this[st];if(e.setup!=!0&&(e.setup=!0,!0)){let r=rs(t[0],this.target);r instanceof x||t.unshift(r=this.target);let s=t[1]||0,i=t[2]==null?t[2]=s:t[2],n=r.getBoundingClientRect();e.x=this.clientX-(n.left+n.width*s),e.y=this.clientY-(n.top+n.height*i),r&&(this[pu]=r,r.flags.incr("_touch_"),B(this,"end",function(){return r.flags.decr("_touch_")}))}return this.x-=e.x,this.y-=e.y,!0}},gu=class{on$touch(t,e,r,s){return r.type="touch",this.addEventListener("pointerdown",r,{passive:!1}),Qn.ios\u03A6&&globalThis.parent!=globalThis&&io!=!0&&(io=!0,!0)&&globalThis.parent.postMessage("setupTouchFix"),r}};du(x.prototype,gu.prototype),X.touch$handle=function(){let t=this.event,e=this.element,r=this.state.pointerId,s=this.modifiers,i=this.handler,n=Qn.ios\u03A6;if(this.current=this.state,r!=null)return r==t.pointerId;if(s.ctrl&&!t.ctrlKey||s.alt&&!t.altKey||s.meta&&!t.metaKey||s.shift&&!t.shiftKey||s.if&&!s.if[0]||s.self&&t.target!=e||s.primary&&!t.isPrimary||s.pen&&t.pointerType!="pen"||s.mouse&&t.pointerType!="mouse"||s.touch&&t.pointerType!="touch"||s.sel&&!t.target.matches(String(s.sel[0])))return;let o=this.state=i.state=this.current=new mu(t,i,e);r=o.pointerId;let h=function(p){return p.preventDefault(),!1},l=null,c=Symbol(),a=function(p){let _=o.clientX,N=o.clientY,O=p.clientX,Mt=p.clientY;(o[Qe]||o.defaultPrevented)&&(p.pointerId==o.pointerId||_==O&&N==Mt)&&(p.preventDefault(),p.stopPropagation()),a&&(globalThis.removeEventListener("click",a,{capture:!0}),a=null)},v=function(p){if(!(o.type=="touchmove"&&p.changedTouches[0].identifier!=r)&&(o.defaultPrevented||o[Qe]))return p.preventDefault()},m=function(p){let _=p.type,N=o.phase;if(p.pointerId&&o.pointerId!=p.pointerId||p[c])return;p[c]=!0;let O=_=="pointerup"||_=="pointercancel";if(p.pressure==0&&p.pointerType=="mouse"&&_=="pointermove"&&o.originalEvent.pressure>0)return l(p);_=="pointercancel"?(o.x=o.clientX,o.y=o.clientY):(o.x=p.clientX,o.y=p.clientY),o.event=p,O&&(o.phase="ended");try{i.handleEvent(o)}catch{}if(N=="init"&&!O&&(o.phase="active"),O&&l)return l(p)},S=!1;return l=function(p){if(!S&&(S=!0,e.flags.decr("_touch_"),o.phase!="ended"&&(o.phase="ended",o.x=o.clientX,o.y=o.clientY,i.handleEvent(o)),o.emit("end"),s.passive||--i.prevents==0&&e.style.removeProperty("touch-action"),i.state={},globalThis.removeEventListener("pointermove",m,{passive:!!s.passive}),globalThis.removeEventListener("pointerup",m),globalThis.removeEventListener("pointercancel",m),setTimeout(function(){if(a&&(globalThis.removeEventListener("click",a,{capture:!0}),a=null),n&&v)return globalThis.removeEventListener("touchend",v),globalThis.removeEventListener("touchmove",v,{passive:!1}),v=null},100),!s.passive))return globalThis.document.removeEventListener("selectstart",h,{capture:!0})},o[eo]=l,s.passive||(i.prevents||(i.prevents=0),i.prevents++,e.style.setProperty("touch-action","none"),e.offsetWidth),e.flags.incr("_touch_"),globalThis.addEventListener("pointermove",m,{passive:!!s.passive}),globalThis.addEventListener("pointerup",m),globalThis.addEventListener("pointercancel",m),globalThis.addEventListener("click",a,{capture:!0}),n&&!s.passive&&(globalThis.addEventListener("touchend",v),globalThis.addEventListener("touchmove",v,{passive:!1})),s.passive||globalThis.document.addEventListener("selectstart",h,{capture:!0}),m(t),!1};function no(t){let e;return t?(e=t.toIterable)?e.call(t):t:[]}function yu(t,e){let r=Object.getOwnPropertyDescriptors(e);return delete r.constructor,Object.defineProperties(t,r),t}var vu=Symbol.for("#context"),bu=Symbol.for("#extendType");function kh(){return!0}var oo=new(globalThis.WeakMap||Map),Te={threshold:[0]},Su={};X.intersect$handle=function(){let t=this.event.detail.observer;return this.modifiers._observer==t};var _u=class extends Z{\u03B1in(){return this.delta>=0&&this.entry.isIntersecting}\u03B1out(){return this.delta<0}\u03B1css(t="ratio"){return this.target.style.setProperty("--ratio",this.ratio),!0}\u03B1flag(t,e){let{state:r,step:s}=this[vu],i=rs(e||"",this.target);return this.isIntersecting&&!r[s]?(i.flags.incr(t),r[s]=!0):r[s]&&!this.isIntersecting&&(i.flags.decr(t),r[s]=!1),!0}};function xu(t,e){return function(r,s){let i=s.prevRatios||(s.prevRatios=new WeakMap);for(let n=0,o=no(r),h=o.length;n<h;n++){let l=o[n],c=i.get(l.target)||0,a=l.intersectionRatio,v={entry:l,ratio:a,from:c,delta:a-c,observer:s},m=new Z(t,{bubbles:!1,detail:v});m[bu](_u),m.entry=l,m.isIntersecting=l.isIntersecting,m.delta=v.delta,m.ratio=v.ratio,i.set(l.target,a),l.target.dispatchEvent(m)}}}function ho(t=Te){let e=t.threshold.join("-")+t.rootMargin;!t.root&&Te.root&&(t.root||(t.root=Te.root));let r=t.root||Su,s=oo.get(r);return s||oo.set(r,s={}),s[e]||(s[e]=new IntersectionObserver(xu("intersect",e),t))}var wu=class{on$intersect(t,e,r,s){let i;if(t.options){let n=[],o={threshold:n};for(let h=0,l=no(t.options),c=l.length;h<c;h++){let a=l[h];a instanceof x||a instanceof Pt?o.root=a:typeof a=="number"?n.push(a):typeof a=="string"?o.rootMargin=a:typeof a=="object"&&Object.assign(o,a)}if(n.length==1){let h=n[0];if(h>1)for(n[0]=0;n.length<h;)n.push(n.length/(h-1))}n.length==0&&n.push(0),i=ho(o)}else i=ho();return t._observer=i,i.observe(this),this.addEventListener("intersect",r,s),r}};yu(x.prototype,wu.prototype);function Tu(t){let e;return t?(e=t.toIterable)?e.call(t):t:[]}function Lu(t,e){let r=Object.getOwnPropertyDescriptors(e);return delete r.constructor,Object.defineProperties(t,r),t}var hs=Symbol.for("#width"),as=Symbol.for("#height"),Nu=Symbol.for("#extendType");function $h(){return!0}var Je=null,Mu=class extends Z{\u03B1css(t="1elw",e="1elh",r=""){let s=this.target;if(s.offsetParent){let i=Vt(t),n=Vt(e),o=rs(r,s),h=i?"--u_"+i[1]:"--"+t,l=n?"--u_"+n[1]:"--"+e,c=i?this.width/i[0]:this.width,a=n?this.height/n[0]:this.height;o.style.setProperty(h,c),o.style.setProperty(l,a)}return!0}get width(){return this[hs]==null?this[hs]=this.entry.target.offsetWidth:this[hs]}get height(){return this[as]==null?this[as]=this.entry.target.offsetHeight:this[as]}};function Ou(){return globalThis.ResizeObserver||Je||(console.warn(":resize not supported in this browser"),Je={observe:function(){return!0}}),Je||(Je=new ResizeObserver(function(t){for(let e=0,r=Tu(t),s=r.length;e<s;e++){let i=r[e],n=new Z("resize",{bubbles:!1,detail:i});n.entry=i,n.rect=i.contentRect,n[Nu](Mu),i.target.dispatchEvent(n);let o=new Z("resized",{bubbles:!0,detail:i});i.target.dispatchEvent(o)}}))}var Eu=class{on$resize(t,e,r,s){return Ou().observe(this),this.addEventListener("resize",r,s),r}};Lu(x.prototype,Eu.prototype);function Cu(t,e){let r=Object.getOwnPropertyDescriptors(e);return delete r.constructor,Object.defineProperties(t,r),t}function Fh(){return!0}var ls,ao=Symbol();function Pu(){if(!ls)return ls=function(t){if(t[ao])return;t[ao]=!0;let e=globalThis.document.activeElement;if(e&&e.matches("input,textarea")){let r=new Z("selection",{detail:{start:e.selectionStart,end:e.selectionEnd}});return e.dispatchEvent(r)}},globalThis.document.addEventListener("selectionchange",ls)}var ku=class{on$selection(t,e,r,s){return Pu(),this.addEventListener("selection",r,s),r}};Cu(x.prototype,ku.prototype);var lo=Symbol.for("#string"),uo=Symbol.for("#html"),xt={win:{sep:"+",name:"win",order:["meta","ctrl","mod","alt","option","shift"].reverse(),labels:{option:"alt",mod:"ctrl",meta:"win"}},mac:{sep:"",name:"mac",order:["ctrl","alt","option","shift","mod","command"].reverse(),labels:{left:"\u2192",up:"\u2191",down:"\u2193",right:"\u2190",plus:"+",tab:"\u21E5",meta:"\u2318",mod:"\u2318",ctrl:"\u2303",option:"\u2325",alt:"\u2325",del:"\u2326",shift:"\u21E7",enter:"\u21A9",esc:"\u238B",backspace:"\u232B"}}};xt.auto=xt.win;var us={};function co(t,e="auto"){let r=""+t+":"+e;if(us[r])return us[r];let s=xt[e]||xt.win,i=t.split(" ").map(function(n){return n.split("+").sort(function(o,h){return s.order.indexOf(h)-s.order.indexOf(o)}).map(function(o){let h=s.labels[o]||o;return h=h[0].toUpperCase()+(h.slice(1)||"")})});return us[r]=i}function $u(t,e){var r;let s=co(t,e),i=xt[e]||xt.win;return s[lo]||(s[lo]=s.map(function(n){return n.join(i.sep)}).join(" "))}function Fu(t,e){var r;let s=co(t,e),i=xt[e]||xt.win;return s[uo]||(s[uo]=s.map(function(n){return"<kbd>"+n.map(function(o){return"<kbd>"+o+"</kbd>"}).join("")+"</kbd>"}).join(" "))}function Ih(){return!0}var Ah=new class{humanize(t,e="auto"){return $u(t,e)}htmlify(t,e="auto"){return Fu(t,e)}},Iu=ya(va()),cs=Symbol.for("#getQueryParam"),fo=Symbol.for("#setQueryParam"),po=Symbol.for("#query"),Rt=class{static parse(t,e){return t instanceof Rt?t:new Rt(t,e)}constructor(t,e){this.router=e,this.parse(t)}parse(t){let e;return t instanceof URL||(t=new URL(t,this.router.origin)),(e=this.router?.aliases[t.pathname])&&(t.pathname=e),this.url=t,this}get active\u03A6(){return this.router.location==this}reparse(){return this.parse(this.url)}get searchParams(){return this.url.searchParams}search(){let t=this.searchParams?this.searchParams.toString():"";return t?"?"+t:""}update(t){if(t instanceof Object)for(let e=0,r=Object.keys(t),s=r.length,i,n;e<s;e++)i=r[e],n=t[i],this.searchParams.set(i,n);else typeof t=="string"&&this.parse(t);return this}clone(){return new Rt(this.url.href,this.router)}equals(t){return this.toString()==String(t)}get href(){return this.url.href}get path(){return this.url.href.slice(this.url.origin.length)}get pathname(){return this.url.pathname}get query(){return this[po]||(this[po]=new Proxy({},{get:this[cs].bind(this),set:this[fo].bind(this)}))}toString(){return this.href}[cs](t,e){return this.searchParams.get(e)}[fo](t,e,r){return this[cs](t,e)!=r&&(r==null||r==""?this.searchParams.delete(e):this.searchParams.set(e,r),this.active\u03A6&&(this.router.history.replaceState({},null,this.url.toString()),this.router.touch())),!0}},Au=class{constructor(t){this.router=t,this.stack=[],this.pos=-1}pushState(t,e,r){return this.stack.length=Math.max(this.pos,0),this.stack[++this.pos]=[t,e,r],this}replaceState(t,e,r){return this.stack.length=this.pos,this.stack[this.pos]=[t,e,r]}popState(){return this.stack.length=this.pos+1,this.pos-=1,this.stack.pop()}currentState(){return this.stack[this.pos]}slice(){return[]}},mo=class{constructor(t,e,r,s){this.params=s,this.router=t,e&&(this.location=Rt.parse(e),this.original=this.location.clone()),this.referrer=r}get apply(){return this.params.apply||[]}get revert(){return this.params.revert||[]}get state(){return this.params.state}get mode(){return this.params.mode}redirect(t){return this.location?.update?.(t),this}get path(){return this.location?.path}get url(){return this.location?.toString?.()}set path(t){this.location.path=t}abort(t=!1){return this.aborted=!0,t&&(this.forceAbort=t),this}match(t){return this.location?this.router.route(t).match(this.path):null}};function go(t){let e;return t?(e=t.toIterable)?e.call(t):t:[]}var Ze=Symbol.for("#routes"),ds=Symbol.for("#match"),Hu=Symbol.for("#symbol"),yo=Symbol.for("#matches"),fs=new Map,ps={},vo={},ju=/.*/;function Vu(t){if(!fs.has(t)){let e=new Map;return fs.set(t,e),e}return fs.get(t)}function Ru(t,e){let r=Vu(t);if(!r.has(e)){let s=Object.create(t);return Object.assign(s,e),r.set(e,s),s}return r.get(e)}var Du=class{};function Gu(t){if(ps[t])return ps[t];let e=ps[t]={url:t},r=t.indexOf("?"),s=t.indexOf("#");if(s>=0&&(e.hash=t.slice(s+1),t=e.url=t.slice(0,s)),r>=0){let i=e.query=t.slice(r+1);t=t.slice(0,r),e.query=vo[i]||(vo[i]=new URLSearchParams(i))}return e.path=t,e}var Bu=class{constructor(t){this.router=t,this.fullPath="",this[Ze]={},this[ds]=new Du,this[ds].path=""}route(t){var e;return(e=this[Ze])[t]||(e[t]=new bo(this.router,t,this))}match(){return this[ds]}resolve(t){return"/"}},bo=class{constructor(t,e,r){this.parent=r||t.rootRoute,this.router=t,this.status=200,this.path=e,this[Hu]=Symbol(),this[yo]={},this[Ze]={}}route(t){var e;return(e=this[Ze])[t]||(e[t]=new bo(this.router,t,this))}get fullPath(){return""+this.parent.fullPath+"/"+this.$path}load(t){return this.router.queue.add(t)}set path(t){var e=this;if(this.$path==t)return;if(this.raw=t,this.$path=t,this.groups=[],this.cache={},this.dynamic=!1,t.indexOf("?")>=0){let s=t.split("?");t=s.shift(),this.query={};for(let i=0,n=go(s.join("?").split("&")),o=n.length;i<o;i++){let h=n[i];if(!h)continue;let[l,c]=h.split("=");l[0]=="!"&&(this.dynamic=!0,l=l.slice(1),c=!1),c===""&&(c=!1),c&&c[0]==":"&&(this.dynamic=!0),this.query[l]=c||c!==!1}}if(t=t.replace(/\:(\w+|\*)(\.)?/g,function(s,i,n){e.dynamic=!0,i!="*"&&e.groups.push(i);let o=e.router.matchers[i]||(n?"([^/#.?]+)":"([^/#?]+)");return n?""+o+".":o}),t==""&&e.query)return;if(t=="*")return e.regex=ju,e;t="^"+t;let r=t[t.length-1];(r=="$"||r=="/")&&(t=t.slice(0,-1)+"(?=/?[#?]|/?$)"),r!="/"&&r!="$"&&t!="^/"&&(t=t+"(?=[/#?]|$)"),e.regex=new RegExp(t)}match(t=this.router.path){var e,r;let s=this.parent.match(t);if(!s)return null;let i=Gu(t),n=i.url,o="";if(s.path&&i.path.indexOf(s.path)==0&&(o=s.path+"/",n=n.slice(o.length)),e=this.regex?n.match(this.regex):[""]){let h=o+e[0],l=[this.$path],c={};if(this.groups.length)for(let m=0,S=go(e),p=S.length,_;m<p;m++){let N=S[m];(_=this.groups[m-1])&&(c[_]=N,l.push(N))}if(this.query)for(let m=this.query,S=0,p=Object.keys(m),_=p.length,N,O;S<_;S++){N=p[S],O=m[N];let Mt=N,E=i.query?.get?.(N);if(O===!1){if(E)return null;l.push("1");continue}if(O[0]==":"&&(Mt=O.slice(1),O=!0),O==!0&&E||O==E)c[Mt]=E,l.push(E);else return null}let a=l.join("*");c=(r=this[yo])[a]||(r[a]=c);let v=Ru(s,c);return v.path=h,v}return null}resolve(t=this.router.path){if(this.raw[0]=="/"&&!this.dynamic)return this.raw.replace(/\$/g,"");let e=this.parent.match(t),r=this.parent.resolve(t),s;if(this.dynamic){let i=this.match(t);return i?i.path:null}return this.raw[0]=="?"?s=(r||"/")+this.raw:s=r+"/"+this.raw,s.replace(/\$/g,"").replace(/\/\/+/g,"/")}},So=Symbol.for("#__initor__"),_o=Symbol.for("#__inited__"),xo=Symbol.for("#__init__"),tr=Symbol.for("#idler"),le=Symbol.for("#resolve"),wo=Symbol(),To=class extends Set{static[xo](){return this.prototype[So]=wo,this}constructor(){super(),this[tr]=Promise.resolve(this),this[So]===wo&&this[_o]&&this[_o]()}emit(t,...e){return ot(this,t,e)}on(t,...e){return nt(this,t,...e)}once(t,...e){return B(this,t,...e)}un(t,...e){return zt(this,t,...e)}add(t){var e=this;if(t instanceof Function&&(t=t()),!this.has(t)){t.then(function(){return e.delete(t)});let r=e.size==0;super.add(t),r&&(this[tr]=this[le]=null,e.emit("busy",e))}return t}delete(t){return super.delete(t)?(this.size==0&&(this[le]&&(this[le](this),this[le]=null),this.emit("idle",this)),!0):!1}get idle(){var t=this;return this[tr]||(this[tr]=new Promise(function(e){return t[le]=e}))}};To[xo]();function ms(t,e){let r=Object.getOwnPropertyDescriptors(e);return delete r.constructor,Object.defineProperties(t,r),t}var Lo=Symbol.for("#__initor__"),No=Symbol.for("#__inited__"),Mo=Symbol.for("#__init__"),gs=Symbol.for("#enter"),ys=Symbol.for("#resolved"),er=Symbol.for("#leave"),Oo=Symbol.for("#afterVisitRouted"),Eo=Symbol.for("#afterVisitRouteTo"),Co=Symbol.for("#router"),vs=Symbol.for("#doc"),pt=Symbol.for("#version"),zu=Symbol.for("#routes"),Po=Symbol.for("#origin"),bs=Symbol.for("#request"),ko=Symbol.for("#hash"),Y=Symbol.for("#routeTo"),ue=Symbol.for("#path"),it=Symbol.for("#match"),ce=Symbol.for("#options"),Uu=Symbol.for("#cache"),$o=Symbol.for("#unmatched"),wt=Symbol.for("#active"),qu=Symbol.for("#resolvedPath"),Ku=Symbol.for("#dataKey"),Yu=Symbol.for("#activeKey"),de=Symbol.for("#urlKey"),Dt=Symbol.for("#dataMap"),rr=Symbol.for("#href"),F=Symbol.for("#route"),Fo=Symbol.for("#context"),Io=Symbol.for("#afterVisit"),Ao=Symbol.for("#routeHandler"),Wu=Symbol.for("#parentNode"),Xu=Symbol.for("#visitContext"),Ho=Symbol.for("##visitContext"),Qu=Symbol.for("#attachToParent"),Ju=Symbol.for("#detachFromParent"),jo=Symbol(),Zu=class{get router(){return this[Co]||(this[Co]=new xr(this))}};ms(Pt.prototype,Zu.prototype);function Hh(){return!0}var jh=Ps(function(){return globalThis.document.router}),xr=class extends Iu.EventEmitter{static[Mo](){return this.prototype[Lo]=jo,this}constructor(t,e={}){super(),this[vs]=t,this[pt]=0,this[zu]={},this.aliases={},this.redirects={},this.rules={},this.matchers={},this.options=e,this.busy=[],this.queue=new To,this.root=new Bu(this),this.location=new Rt(e.url||t.location.href,this),this.history=new Au(this),this.mode=e.mode||"history",this.setup(),this[Lo]===jo&&this[No]&&this[No]()}get origin(){return this[Po]||(this[Po]=this[vs].location.origin)}get query(){return this.location.query}init(){return this.refresh({mode:"replace"}),this}alias(t,e){return this.aliases[t]=e,this.location.reparse(),this}touch(){return this[pt]++}option(t,e){return e==null?this.options[t]:(this.options[t]=e,this)}get realpath(){return this.location.path}get state(){return this.history.state}get states(){return this.history.currentStates}set state(t){}get ctx(){return this[bs]}pushState(t,e,r){return this.history.pushState(t,e||null,String(r))}replaceState(t,e,r){return this.history.replaceState(t,e||null,String(r))}refresh(t={}){if(this.refreshing)return;this.refreshing=!0;let e=this.location,r=Rt.parse(t.location||this.realpath,this),s=t.mode,i=this[bs];if(!r.equals(e)||!i||t.state){let n=new mo(this,r,e,t);this[bs]=n,this.emit("beforechange",n),n.aborted&&(!n.forceAbort&&globalThis.window.confirm("Are you sure you want to leave? You might have unsaved changes")?n.aborted=!1:s=="pop"?this.pushState(this.state,null,String(e)):s=="replace"&&this.replaceState(this.state,null,String(e))),n.aborted||(this.location=n.location,s=="push"?this.pushState(n.state,null,String(this.location)):s=="replace"?this.replaceState(n.state,null,String(this.location)):s=="pop"&&(this.history.index=t.index),this.emit("change",n),this.touch(),I())}return this.refreshing=!1,this}onpopstate(t){let e=this.history.index,r=e,s={pop:!0,index:0,from:e,mode:"pop"};try{if(typeof t.state=="string"){let[i,n]=t.state.split("|");r=s.index=parseInt(n),r<e?s.revert=this.history.slice(r+1,e+1).reverse():r>e&&(s.apply=this.history.slice(e+1,r+1))}}catch{}return this.refresh(s),this}onbeforeunload(t){let e=new mo(this,null,this.location,{mode:"unload"});if(this.emit("beforechange",e),e.aborted)return!0}onhashchange(t){return this.emit("hashchange",this[ko]=this[vs].location.hash),I()}setup(){return this}onclick(t){if(t.metaKey||t.altKey)return;let e=null,r=null,s=t.target;for(;s&&(!e||!r);)!e&&s.nodeName=="A"&&(e=s),!r&&s[Y]&&(r=s),s=s.parentNode;if(e&&r!=e&&(!r||r.contains(e))){let i=e.getAttribute("href");i&&!i.match(/\:\/\//)&&(!e.getAttribute("target")||e.getAttribute("target")=="_self")&&!e.classList.contains("external")&&e.addEventListener("click",this.onclicklink.bind(this),{once:!0})}return!0}onclicklink(t){let e=t.currentTarget||t.target;e[Y]&&e[Y].resolve();let r=e.getAttribute("href"),s=new URL(e.href),i=s.href.slice(s.origin.length),n=this.realpath.split("#")[0],o=i.split("#")[0];return n==o?globalThis.document.location.hash=s.hash:e[Y]?e[Y].go():this.go(i),t.stopPropagation(),t.preventDefault()}get url(){return this.location.url}get path(){let t=this.location.path;return this.aliases[t]||t}get pathname(){return this.location.pathname}serializeParams(t){var e;if(t instanceof Object){e=[];for(let r=0,s=Object.keys(t),i=s.length,n,o;r<i;r++)n=s[r],o=t[n],e.push([n,globalThis.encodeURI(o)].join("="));return e.join("&")}return t||""}get hash(){return this[ko]}set hash(t){}match(t){return this.route(t).match(this.path)}route(t){return this.root.route(t)}go(t,e=null){if(typeof t=="object"&&e===null&&(e=t,t=this.path),typeof t=="number")return globalThis.history.go(t),this;let r=this.location.clone().update(t),s=this.history.buildState(e,r.path,!0);return this.refresh({push:!0,mode:"push",location:r,state:s,apply:[s]}),this}replace(t,e=null){typeof t=="object"&&e===null&&(e=t,t=this.path);let r=this.location.clone().update(t),s=this.history.buildState(e,r.path,!1);return this.refresh({replace:!0,mode:"replace",location:r,state:s,apply:[s]})}};xr[Mo]();var wr=class{constructor(t,e,r,s={}){this.parent=r,this.node=t,this[ue]=e,this[it]=null,this[ce]=s,this[Uu]={},this[$o]={},this[wt]=null,this[qu]=null,this[Ku]=Symbol(),this[Yu]=Symbol(),this[de]=Symbol()}get router(){return this.node.ownerDocument.router}get route(){return(this.parent?this.parent.route:this.router).route(this[ue])}get match(){return this[it]}get params(){return this[it]||this[$o]}get state(){let t=this[Dt]||(this[Dt]=new Map),e=this.params,r=this[Dt].get(e);return r||this[Dt].set(e,r={}),r}set state(t){(this[Dt]||(this[Dt]=new Map)).set(this.params,t)}set path(t){this[ue]!=t&&(this[ue]=t,!0)&&this.router.touch()}get path(){return this[ue]}get isActive(){return!!this[wt]}get active\u03A6(){return!!this[wt]}resolve(){let t=this.router[pt];if(!(this[pt]!=t&&(this[pt]=t,!0)))return;let e=this.route,r=this[ce],s=this.router.path,i=e.match(s),n=this[wt],o=this[it],h=i!=o,l=i&&i[this[de]];return i&&(this[wt]=!0,this[it]=i,i[this[de]]=s),i&&(h||l!=s||!n)&&this[ys](i,o,l),!n&&i&&this[gs](),!i&&(n||n===null)&&(this[wt]=!1,this[er]()),this[it]}[gs](){return this.node.flags.remove("not-routed"),this.node.flags.add("routed"),this.node?.routeDidEnter?.(this)}[ys](t,e,r=""){return this.node?.routeDidResolve?.(this,t,e,r)}[er](){return this.node.flags.add("not-routed"),this.node.flags.remove("routed"),this.node?.routeDidLeave?.(this)}},ei=class extends wr{[gs](){return this}[ys](){return this}[er](){return this}resolve(){let t=this.router[pt];if(!(this[pt]!=t&&(this[pt]=t,!0)))return;let e=this[ce],r=this.route,s=this.router.path,i=this.route.resolve(s),n=this.route.match(s);n&&(this[it]=n,this[it][this[de]]=s),e.sticky&&this[it]&&(i=this[it][this[de]]),this[rr]!=i&&(this[rr]=i,!0)&&this.node.nodeName=="A"&&this.node.setAttribute("href",i),this.node.flags.toggle("active",!!n)}go(){return this.resolve(),this[ce]&&this[ce].replace?this.router.replace(this[rr]):this.router.go(this[rr])}},tc=class{get router(){return this.ownerDocument.router}};ms(A.prototype,tc.prototype);var ec=class{set route(t){if(this[F]){this[F].path=t;return}let e=t[0]!="/"?this[Fo].route:null;this[F]=new wr(this,t,e,this.route__),this[Io]=this[Oo]}get route(){return this[F]}set route\u039Eto(t){var e=this;if(this[Y]){this[Y].path=t;return}let r=t[0]!="/"?this[Fo].route:null;this[F]=this[Y]=new ei(this,t,r,this.routeTo__),this[Io]=this[Eo],e.onclick=function(s){if(!s.altKey&&!s.metaKey&&!s[Ao])return s.preventDefault(),s[Ao]=e[Y],e[Y].go()}}[Oo](){if(this[F]){let t=this[Wu],e=t&&t[Xu];if(e&&e.matchedRoute&&e.matchedRoute!=this[F]){this[F][wt]!=!1&&(this[F][wt]=!1,!0)&&(this[F][er](),this[F][pt]=-1);return}if(this[F].resolve(),this[F].active\u03A6)e.matchedRoute=this[F];else return}if(this.visit&&this.visit(),this[Ho])return this[Ho]=null}[Eo](){if(this[Y]&&this[Y].resolve(),this.visit)return this.visit()}routeDidEnter(t){return this[Qu]()}routeDidLeave(t){return this[Ju]()}routeDidResolve(t,e,r){var s=this;this.routed instanceof Function&&e!=r&&s.router.queue.add(async function(){s.suspend();let i=await s.routed(e,t.state,r);return s.unsuspend()})}};ms(x.prototype,ec.prototype);function Q(t){let e;return t?(e=t.toIterable)?e.call(t):t:[]}function Ss(t,e){let r=Object.getOwnPropertyDescriptors(e);return delete r.constructor,Object.defineProperties(t,r),t}var fe=Symbol.for("##reactive"),Et=Symbol.for("##referenced"),pe=Symbol.for("##dereferenced"),sr=Symbol.for("#map"),Vo=Symbol.for("#__init__"),ir=Symbol.for("#child"),me=Symbol.for("#reactions"),_s=Symbol.for("#promise"),L={TOUCHING:1<<1,STALE:1<<2,OBJECT:1<<3,RUNNING:1<<4,INVALIDATING:1<<5,POSSIBLY_STALE:1<<6,AUTORUN:1<<7},$=0,Ro=!1,rc=0,Do=1,xs={META:new Map,VALUE:new Map,REF:new Map},G=Symbol.for("~"),Go=Symbol.for("~~"),ws=function(t,e){return e.has(t)||e.set(t,Symbol()),e.get(t)},nr=function(t){return typeof t=="symbol"?ws(t,xs.VALUE):Symbol.for(t)},Ts=function(t){return typeof t=="symbol"?ws(t,xs.META):Symbol.for("#"+t+"__")},Ls=function(t){return typeof t=="symbol"?ws(t,xs.REF):Symbol.for("~"+t)},M=function(t,e){return $&&T.add(t[G]),e},W=function(t,e){return t[G].invalidated(0),e},Gt=function(t,e,r){let s=t[G];return s||(s=t[G]=new Os(L.OBJECT),Object.defineProperties(t,r)),e&&s.addSubscriber(e),t},Ns=function(t,e){let r=t[G];return r&&r.removeSubscriber(e),t},sc=class{constructor(t){this.changes=new Map,this.cleanup(),t&&this.reset(t)}reset(t=[]){return this.array=t,this.initialLength=t.length}cleanup(){return this.idx=0,this.array=null,this.changes.clear(),this.dirty=!1}push(t){if(this.initialLength==0){this.array.indexOf(t)<0&&(this.changes.set(t,1),this.array.push(t),this.idx++);return}let e=this.array[this.idx];if(e===t)return++this.idx;{let r=this.array.indexOf(t),s=this.changes.get(t);if(r===-1)this.array.splice(this.idx,0,t),this.changes.set(t,1),this.idx++;else if(r===this.idx+1)e&&this.changes.set(e,-1),this.array.splice(this.idx,1),++this.idx;else{if(r<this.idx)return;r>this.idx&&this.array.splice(r,1),this.array.splice(this.idx,0,t)}if(s==-1)return this.changes.delete(t)}}end(){if(this.array.length>=this.idx)for(;this.array.length>this.idx;)this.changes.set(this.array.pop(),-1);return this.array}patch(){return this.end()}};function Ms(t){var e,r;let s=Object.getOwnPropertyDescriptors(t.prototype);return e=s.name,delete s.name,r=s.constructor,delete s.constructor,s}function ic(){if(Ro!=!0&&(Ro=!0,!0))return Hs.on("inited",function(t){let e=t[Go];if(e){let r=t instanceof A,s=t[G]||(t[G]={});for(let i=0,n=Object.keys(e),o=n.length,h,l;i<o;i++){h=n[i],l=e[h];let c=s[h]=new ge(t[h],t,l);r||c.call()}r&&(nt(t,"mount",function(){var i;i=[];for(let n=0,o=Q(Object.values(s)),h=o.length;n<h;n++){let l=o[n];i.push(l instanceof ge&&l.activate())}return i}),nt(t,"unmount",function(){var i;i=[];for(let n=0,o=Q(Object.values(s)),h=o.length;n<h;n++){let l=o[n];i.push(l instanceof ge&&l.deactivate())}return i}))}})}function nc(t,e=Go){return t.hasOwnProperty(e)||(t[e]=Object.assign({},t[e]||{})),t[e]}var Bo=class{constructor(t,e=0){this.depth=e,this.parent=t,this.target=null,this.patcher=new sc}get active\u03A6(){return T==this}get root\u03A6(){return this==Ct}get snapshot(){let t=[],e=this[ir];for(;e&&e.target;)t.push({depth:e.depth,target:e.target,beacon:e.beacon}),e=e[ir];return t}reset(t){return this.tracking=!0,this.target=t,this.beacon=t.beacon,this.patcher.reset(t.observing||(t.observing=[])),this}add(t){if(this.tracking&&t)return this.patcher.push(t)}react(t){return Ct.reactions.add(t)}push(t){return T=this.child.reset(t)}pop(){let t=null;if(this.beacon){t=this.patcher.end();let e=this.patcher.changes;if(e.size)for(let[r,s]of Q(e))s===1?r.addSubscriber(this.beacon):r.removeSubscriber(this.beacon)}return this.patcher.cleanup(),this.target=this.beacon=null,T=this.parent,T==Ct&&Ct.flush(),t}get child(){return this[ir]||(this[ir]=new Bo(this,this.depth+1))}get reactions(){return this[me]||(this[me]=new Set)}flush(){if(!this[me])return;let t=this[me];this[me]=null;for(let e of Q(t))e.call()}},oc=class extends Bo{add(){return!0}},T=new oc(null,0),Ct=T,hc=function(){return T.tracking=!1},zo=function(t,e,r,s,i){let n=t[r],o=t[i];return o||(o=t[i]=new Os(0,s,n,e)),T.add(o,t),n},Uo=function(t,e,r,s,i,n){let o=t[r];if(s!=o){t[r]=s;let h=t[n];h&&h.changed(0,s,o)}},Os=class{constructor(t,e,r,s){return this.id=Do++,this.observer=null,this.observers=null,r&&r[Et]&&r[Et](this),this}changed(t,e,r){if(rc++,r&&r[pe]&&r[pe](this,e),e&&e[Et]&&e[Et](this,r),this.observer&&this.observer.invalidated(t+1,this,e,r),this.observers)for(let s=0,i=Q(this.observers),n=i.length;s<n;s++)i[s].invalidated(t+1,this,e,r);T==Ct&&T.flush()}invalidated(t,e){if(this.observer&&this.observer.invalidated(t+1,this),this.observers)for(let r=0,s=Q(this.observers),i=s.length;r<i;r++)s[r].invalidated(t+1,this);return t==0&&T==Ct&&T.flush(),!0}addSubscriber(t){this.observer?(this.observers||(this.observers=[]),this.observers.push(t)):this.observer=t}removeSubscriber(t){if(this.observer==t)return this.observer=null;let e=this.observers,r=e.indexOf(t);r>=0&&e.splice(r,1)}reportChanged(){return this.changed(0)}reportObserved(){return T.add(this)}};function Vh(t){return new Os(null,null,null,t)}var ac=class extends Array{push(){return W(this,super.push(...arguments))}pop(){return W(this,super.pop(...arguments))}unshift(){return W(this,super.unshift(...arguments))}shift(){return W(this,super.shift(...arguments))}splice(){return W(this,super.splice(...arguments))}at(){return M(this,super.at(...arguments))}map(){return M(this,super.map(...arguments))}flatMap(){return M(this,super.flatMap(...arguments))}flat(){return M(this,super.flat(...arguments))}filter(){return M(this,super.filter(...arguments))}find(){return M(this,super.find(...arguments))}slice(){return M(this,super.slice(...arguments))}sort(){return M(this,super.sort(...arguments))}get len(){return M(this,this.length)}set len(t){this.length=t,W(this)}toIterable(){return $&&T.add(this[G]),this}[Symbol.iterator](){return M(this,super[Symbol.iterator](...arguments))}},qo=Ms(ac),lc=class{get len(){return this.length}set len(t){this.length=t}get[fe](){return Gt(this,null,qo)}[Et](t){return Gt(this,t,qo)}[pe](t){return Ns(this,t)}};Ss(Array.prototype,lc.prototype);var uc=class extends Set{has(){return M(this,super.has(...arguments))}keys(){return M(this,super.keys(...arguments))}values(){return M(this,super.values(...arguments))}entries(){return M(this,super.entries(...arguments))}add(){return W(this,super.add(...arguments))}clear(){return W(this,super.clear(...arguments))}delete(){return W(this,super.delete(...arguments))}},Ko=Ms(uc),cc=class{get[fe](){return Gt(this,null,Ko)}[Et](t){return Gt(this,t,Ko)}[pe](t){return Ns(this,t)}};Ss(Set.prototype,cc.prototype);var dc=class extends Map{get(){return M(this,super.get(...arguments))}has(){return M(this,super.has(...arguments))}keys(){return M(this,super.keys(...arguments))}values(){return M(this,super.values(...arguments))}entries(){return M(this,super.entries(...arguments))}set(){return W(this,super.set(...arguments))}clear(){return W(this,super.clear(...arguments))}delete(){return W(this,super.delete(...arguments))}},Yo=Ms(dc),fc=class{get[fe](){return Gt(this,null,Yo)}[Et](t){return Gt(this,t,Yo)}[pe](t){return Ns(this,t)}};Ss(Map.prototype,fc.prototype);var pc=class{constructor(t,e={}){var r=this,s;this.name=t,this.options=e;let i=this.key=nr(t),n=Ls(t),o=r.descriptor={enumerable:(s=e.enumerable)!=null?s:!0,configurable:!1,get:function(){return $?zo(this,t,i,r,n):this[i]},set:function(l){return $||!!this[n]?Uo(this,t,i,l,r,n):this[i]=l}},h=r.lazyDescriptor={enumerable:!1,configurable:!0,get:function(){return $?(Object.defineProperty(this,t,o),this[t]):this[i]},set:function(l){return this[i]=l,this[n]=null,Object.defineProperty(this,t,o)}}}},mc=class{constructor(t=null){this[Vo](t)}[Vo](t=null){var e;this[sr]=t&&(e=t[sr])!==void 0?e:new Map}for(t){let e=this[sr].get(t);return e||this[sr].set(t,e=[]),e}get(t){let e=this.for(t);return e[G]||e[fe],$&&M(e),e}add(t,e){return this.for(t).push(e)}delete(t,e){let r=this.for(t),s=r.indexOf(e);r.splice(s,1)}},gc=class{constructor(t,e){var r=this;this.name=t,this.key=e,this.index=new mc;let s=Ls(t),i=r.descriptor={enumerable:!0,configurable:!1,get:function(){return $?zo(this,t,e,r,s):this[e]},set:function(o){let h=this[e];if($||!!this[s]?Uo(this,t,e,o,r,s):this[e]=o,h!=o&&(h&&r.index.delete(h,this),o))return r.index.add(o,this)}},n=r.lazyDescriptor={set:function(o){return this[e]=o,o&&r.index.add(o,this),Object.defineProperty(this,t,i),this[s]=null}}}where(t){return this.index.get(t)}},or=class{constructor(t,e,r){this.observing=null,this.observers=null,this.flags=68,this.target=t,this.func=e,this.vkey=r,this.version=0}get beacon(){return this}addSubscriber(t){this.observer?(this.observers||(this.observers=[]),this.observers.push(t)):this.observer=t}removeSubscriber(t){if(this.observer==t)return this.observer=null;let e=this.observers,r=e.indexOf(this);r>=0&&e.splice(r,1)}invalidated(t,e){if(this.flags|=L.STALE|L.POSSIBLY_STALE,this.observer&&this.observer.invalidated(t,this),!!this.observers){for(let r=0,s=Q(this.observers),i=s.length;r<i;r++)s[r].invalidated(t,this);return this}}value(){if($&&T.add(this),(this.flags&L.POSSIBLY_STALE)==0)return this.target[this.vkey];$++,this.flags|=L.RUNNING,T.push(this);let t=this.func.call(this.target);T.pop(this);let e=this.target[this.vkey];return this.target[this.vkey]=t,this.flags&=~(L.STALE|L.POSSIBLY_STALE|L.RUNNING),t!==e&&this.version++,$--,t}},yc=class{constructor(t,e){this.name=t;let r=Ls(t),s=nr(t),i=this.descriptor={enumerable:!1,configurable:!1,get:function(){return this[r].value()}},n=this.lazyDescriptor={enumerable:!1,get:function(){let o=this[r]=new or(this,e,s);return Object.defineProperty(this,t,i),o.value()}}}},ge=class{get beacon(){return this}constructor(t,e,r={}){this.cb=t,this.context=e,this.options=r,this.flags=0,this.id=Do++,this.cachedComputedVersions=new WeakMap,this.checkComputedValues=new Set,this.observing=[],this.timeout=null}get running\u03A6(){return this.flags&L.RUNNING}invalidated(t,e){return e instanceof or?(this.flags|=L.POSSIBLY_STALE,this.checkComputedValues.add(e)):this.flags|=L.STALE,T.react(this)}activate(){return this.observing=[],this.cachedComputedVersions=new WeakMap,this.checkComputedValues=new Set,this.call(),this}deactivate(){if(this.timeout&&clearTimeout(this.timeout),this.observing)for(let t=0,e=Q(this.observing),r=e.length;t<r;t++)e[t].removeSubscriber(this);return this.observing=this.checkComputedValues=this.cachedComputedVersions=null,this}call(){var t=this;if($&&console.warn("should not call reaction inside an autorunning context?",Ct.snapshot),this.flags&L.POSSIBLY_STALE&&(this.flags&L.STALE)==0){let e=!1;for(let r of Q(this.checkComputedValues)){let s=this.cachedComputedVersions.get(r);r.value();let i=r.version;if(s!=i){e=!0;break}}if(!e){this.flags&=~L.POSSIBLY_STALE,this.checkComputedValues.clear();return}}if(this.options.delay){clearTimeout(this.timeout);let e=this.options.delay;typeof e!="number"&&(e=1e3),t.timeout=setTimeout(function(){return t.run()},e);return}return t.run()}run(){$++,this.flags|=L.RUNNING;let t=T.push(this),e=this.cb.call(this.context,hc),r=T.pop(this);this.observing=r,this.checkComputedValues.clear();for(let s=0,i=Q(r),n=i.length;s<n;s++){let o=i[s];o instanceof or&&this.cachedComputedVersions.set(o,o.version)}return this.flags&=~(L.RUNNING|L.STALE|L.POSSIBLY_STALE),$--,e}dispose(){return this.deactivate(),this.cb=this.context=this.options=null,this}},vc=class extends ge{resolve(t){return this.deactivate(),this.resolved=t}then(...t){var e=this;return this.resolved!==void 0?Promise.resolve(this.resolved).then(...t):(this[_s]||(this[_s]=new Promise(function(r){return e.resolve=function(s){return e.deactivate(),e.resolved=s,r(s)}})),this[_s].then(...t))}run(){$++,this.flags|=L.RUNNING;let t=T.push(this),e=this.cb.call(this.context),r=T.pop(this);this.observing=r,this.checkComputedValues.clear();for(let s=0,i=Q(r),n=i.length;s<n;s++){let o=i[s];o instanceof or&&this.cachedComputedVersions.set(o,o.version)}return this.flags&=~(L.RUNNING|L.STALE|L.POSSIBLY_STALE),$--,e!=!1&&e!=null&&e!=null&&this.resolve(e),e}},Wo=class{constructor(t,e){this.context=e,this.cb=t}run(t=this.context,e=[]){T.push(this);try{let r=this.cb.apply(t,e);return T.pop(this),r}catch(r){throw T.pop(this),r}}};function Rh(t,e={}){let r=new ge(t,globalThis,e);return r.call(),r}function Dh(t,e={}){let r=new vc(t,globalThis,e);return r.call(),r}function Gh(t){return t[fe]}function Bh(t){return new Wo(t,globalThis).run()}function zh(t){return t&&t[G]&&t[G].invalidated(0),t}function Uh(t){return t&&t[G]&&t[G].reportObserved(),t}function qh(t,e,r){let s=Ts(e);return(t[s]=new yc(e,r.get)).lazyDescriptor}function Kh(t,e,r){let s=Ts(e),i=nr(e),n=this[0]||{},o=t[s]=new pc(e,n);return r?(Object.defineProperty(t,i,Object.assign({},r)),o.lazyDescriptor):(Object.defineProperty(t,e,o.lazyDescriptor),null)}function Yh(t,e,r){let s=Ts(e);return t.constructor[e],(t[s]=new gc(e,nr(e))).lazyDescriptor}function Wh(t,e,r){let s=nc(t),i=this[0]||{};return i.flags=L.AUTORUN,ic(),s[e]=i,r}function Xh(t,e,r){if(r.value){let s=new Wo(r.value,null);r.value=function(){return s.run(this,arguments)}}return r}function bc(t){let e;return t?(e=t.toIterable)?e.call(t):t:[]}var Xo=Symbol.for("#__init__"),hr=Symbol.for("#watchers");function Qh(t,e,r,s,i,n){return t&&t.$accessor instanceof Function?t=t.$accessor(e,r,s,i,n):n[i]=t,t&&!t.$init&&(t.$init=t.$set||function(){return!0}),t}function Jh(t,e,r=[]){return e.prototype?new e(...r):e.apply(t,r)}var ri=class{constructor(t=null){this[Xo](t)}[Xo](t=null){var e;this.local=t&&(e=t.local)!==void 0?e:!1,this.session=t&&(e=t.session)!==void 0?e:!1,this.weak=t&&(e=t.weak)!==void 0?e:!1}watch(t){return(this[hr]||(this[hr]=[])).push(t)}$get(t,e){return t[e]}$set(t,e,r,s){if(this[hr]){let i=this.$get(e,r,s);if(i!=t){e[r]=t;for(let n=0,o=bc(this[hr]),h=o.length;n<h;n++){let l=o[n].call(e,t,i,this)}}}else e[r]=t}$accessor(t,e,r,s,i){return i[s]=this}};function Zh(){return new ri}var Es=function(){return!0},ye=class{constructor(t,e=""){this.store=t||{},this.cache={raw:{},rich:{}},this.ns=e,this.local=t==globalThis.sessionStorage,this.children=new Map}serialize(t,e){return JSON.stringify(t)}deserialize(t,e){return JSON.parse(t)}getItem(t){let e=String(this.ns)+":"+t;if(this.store instanceof ye)return this.store.getItem(e);if(this.local&&this.cache.rich[e]!=null)return this.cache.rich[e];let r=this.store.getItem(e);if(r!=null)return this.cache.raw[e]==r?this.cache.rich[e]:(this.cache.raw[e]=r,this.cache.rich[e]=this.deserialize(r,e))}setItem(t,e){var r,s;let i=String(this.ns)+":"+t;if(this.store instanceof ye)return this.store.setItem(i,e);let n=this.cache.rich[i],o=typeof e;if(this.local&&(this.cache.rich[i]=e),n!==e||o=="object"){let h=this.store.getItem(i);if(e==null)return this.store.removeItem(i),r=this.cache.rich[i],delete this.cache.rich[i],s=this.cache.raw[i],delete this.cache.raw[i],I();{let l=this.serialize(e,i);if(this.cache.rich[i]=e,this.cache.raw[i]=l,h!=l)return this.store.setItem(i,l),I()}}}get(t,e,r){return this.getItem(e)}set(t,e,r,s){return this.setItem(e,r),!0}apply(t,e,[r]){let s=this.children.get(r);return s||this.children.set(r,s=new Proxy(Es,new ye(this,r))),s}deleteProperty(t,e){var r;let s=this.ns+e;return r=this.cache[s],delete this.cache[s],this.store.removeItem(s)}},ta=new Proxy(Es,new ye(globalThis.localStorage)),ea=new Proxy(Es,new ye(globalThis.sessionStorage));