UNPKG

imba

Version:

Intuitive and powerful language for building webapps that fly

22 lines 153 kB
var ic=Object.create;var De=Object.defineProperty;var nc=Object.getOwnPropertyDescriptor;var oc=Object.getOwnPropertyNames;var lc=Object.getPrototypeOf,ac=Object.prototype.hasOwnProperty;var hc=(r,t)=>{for(var e in t)De(r,e,{get:t[e],enumerable:!0})},qi=(r,t,e,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of oc(t))!ac.call(r,i)&&i!==e&&De(r,i,{get:()=>t[i],enumerable:!(s=nc(t,i))||s.enumerable});return r};var se=(r,t,e)=>(e=r!=null?ic(lc(r)):{},qi(t||!r||!r.__esModule?De(e,"default",{value:r,enumerable:!0}):e,r)),uc=r=>qi(De({},"__esModule",{value:!0}),r);var dg={};hc(dg,{Accessor:()=>Bi,Action:()=>Xs,CUSTOM_TYPES:()=>_i,ClassFlags:()=>pt,Comment:()=>$t,Component:()=>Fe,ComputedType:()=>Gi,CustomEvent:()=>G,Document:()=>Ce,DocumentFragment:()=>As,EaseGroup:()=>yu,Easer:()=>Fi,Element:()=>S,ElementRoute:()=>Ys,ElementRouteTo:()=>ji,Emitter:()=>Ne,Event:()=>Y,EventHandler:()=>Ks,FocusEvent:()=>Ni,Fragment:()=>Jt,HAS:()=>xh,HTMLButtonElement:()=>Ds,HTMLElement:()=>R,HTMLHtmlElement:()=>wi,HTMLInputElement:()=>Vs,HTMLLinkElement:()=>Ei,HTMLOptionElement:()=>Gs,HTMLScriptElement:()=>Li,HTMLSelectElement:()=>Rs,HTMLStyleElement:()=>Mi,HTMLTextAreaElement:()=>js,ImbaElement:()=>cu,IntersectionEventDefaults:()=>Re,KeyboardEvent:()=>Ci,LazyProxy:()=>hi,Location:()=>ke,MouseEvent:()=>Bs,Node:()=>D,OBSERVED:()=>T,ObservableArray:()=>Di,PointerEvent:()=>ki,Queue:()=>Si,Ref:()=>te,RenderContext:()=>Xt,Router:()=>Vi,SVGElement:()=>Ie,SVGSVGElement:()=>Oi,Scheduler:()=>ci,ShadowRoot:()=>tu,StyleDeclaration:()=>Ti,Text:()=>Oe,Touch:()=>Ri,UIEvent:()=>Pe,Window:()=>Kh,__has__$:()=>ni,__hooks__$:()=>Cs,__imba__$:()=>Os,__init__$:()=>Ct,__inited__$:()=>ii,__initor__$:()=>ks,__meta__$:()=>oi,__mixin__$:()=>ph,__patch__$:()=>mh,__served__:()=>Oh,accessor:()=>Qu,afterReconcile$:()=>bh,afterVisit$:()=>yh,appendChild$:()=>gh,atomic:()=>Au,augment$:()=>Kt,autorun:()=>Iu,awaits:()=>Hu,beforeReconcile$:()=>vh,clearInterval:()=>mi,clearTimeout:()=>pi,colors:()=>du,commit:()=>A,createAtom:()=>Pu,createComment:()=>Pt,createComponent:()=>$i,createDynamic:()=>iu,createElement:()=>eu,createFragment:()=>ru,createIndexedList:()=>au,createKeyedList:()=>hu,createLiveFragment:()=>lu,createRef:()=>Bu,createRenderContext:()=>Hs,createSVGElement:()=>su,createSlot:()=>He,createTextNode:()=>zs,customElements:()=>Yh,decorate$:()=>Mh,defineConfig:()=>Ph,defineTag:()=>nu,descriptor:()=>Ju,devlog$:()=>Eh,disposeObservables:()=>zu,document:()=>Fs,emit:()=>ht,env:()=>bi,events:()=>bu,extend$:()=>Ps,getComputed:()=>Uu,getDeepPropertyDescriptor:()=>Is,getRenderContext:()=>qh,getSuperTagType:()=>Xh,getTagType:()=>ut,get_document:()=>Qt,has$:()=>wh,hooks:()=>gi,hotkeys:()=>Nu,hydrate:()=>uu,hydrator:()=>Us,idx$:()=>Lh,inited$:()=>Ch,is$:()=>_h,isa$:()=>Th,iterable$:()=>$s,listen:()=>at,locals:()=>tc,logFormatter:()=>xi,matcher:()=>li,memofunc:()=>Dh,memofuncv:()=>Gh,mount:()=>Ii,multi$:()=>Nh,observable:()=>Fu,once:()=>F,parseTime:()=>Wt,proxy:()=>ui,register$:()=>u,render:()=>mu,renderContext:()=>E,renderer:()=>W,reportChanged:()=>ju,reportInvalidated:()=>Du,reportObserved:()=>Gu,router:()=>Ou,run:()=>Ru,rx:()=>Zt,scheduler:()=>C,serve:()=>jh,session:()=>ec,setInterval:()=>fi,setTimeout:()=>di,spy:()=>Vu,statics$:()=>ai,styles:()=>Pi,sup$:()=>kh,toCamelCase:()=>$h,transitions:()=>Ae,unlisten:()=>Yt,unmount:()=>Hi,up$:()=>Sh,use_devlog:()=>Bh,use_dom_bind:()=>pu,use_dom_teleport:()=>gu,use_dom_transitions:()=>vu,use_events:()=>Su,use_events_hotkey:()=>Mu,use_events_intersect:()=>Tu,use_events_keyboard:()=>Ai,use_events_mouse:()=>qs,use_events_mutate:()=>Lu,use_events_pointer:()=>xu,use_events_resize:()=>wu,use_events_selection:()=>Eu,use_events_touch:()=>_u,use_hooks:()=>Ih,use_router:()=>Cu,use_slots:()=>ou,use_styles:()=>fu,use_window:()=>Wh,\u03B1action:()=>Xu,\u03B1autorun:()=>Yu,\u03B1bound:()=>Fh,\u03B1computed:()=>qu,\u03B1lazy:()=>Hh,\u03B1observable:()=>Ku,\u03B1prop:()=>Zu,\u03B1ref:()=>Wu,\u03B1thenable:()=>Ah});module.exports=uc(dg);var yi=se(require("cluster")),K=se(require("fs")),Ot=se(require("path")),Rh=require("events"),vi=se(require("path")),Vh=se(require("http")),zh=require("async_hooks"),Ct=Symbol.for("#__init__"),ks=Symbol.for("#__initor__"),ii=Symbol.for("#__inited__"),Cs=Symbol.for("#__hooks__"),mh=Symbol.for("#__patch__"),ni=Symbol.for("#has"),oi=Symbol.for("#meta"),Os=Symbol.for("imba"),ph=Symbol.for("#__mixin__"),li=Symbol.for("#matcher"),Ge=Symbol.for("#L"),gh=Symbol.for("#appendChild"),yh=Symbol.for("#afterVisit"),vh=Symbol.for("#beforeReconcile"),bh=Symbol.for("#afterReconcile"),Sh=Symbol.for("##up"),xh={SUPERCALLS:8,CONSTRUCTOR:16},pt={IsExtension:1,IsTag:2,HasDescriptors:4,HasSuperCalls:8,HasConstructor:16,HasFields:32,HasMixins:64,HasInitor:128,HasDecorators:256,IsObjectExtension:512,IsMixin:1024},It=new Map,cc=globalThis[Os]||(globalThis[Os]={counter:0,classes:It});function wt(r,t={}){return It.has(r)||It.set(r,{symbol:Symbol(r.name),parent:Object.getPrototypeOf(r.prototype)?.constructor,for:r,uses:null,inits:null,id:cc.counter++,...t}),It.get(r)}var Ki=new WeakMap;function _h(r,t){return r==t||t?.[li]?.(r)}function Th(r,t){return typeof t=="string"?typeof r===t:t?.[Symbol.hasInstance]?.(r)}function wh(r,t){return t?.[ni]?.(r)??t?.includes?.(r)??t?.has?.(r)??!1}function Lh(r,t){return t?.indexOf?t.indexOf(r):Array.prototype.indexOf.call(r,t)}function Eh(r,t,...e){return t&&t[Ge]instanceof Function?r=t[Ge](r,t,...e):globalThis[Ge]instanceof Function&&(r=globalThis[Ge](r,t,...e)),r}function ai(r){return Ki.get(r)||Ki.set(r,{}).get(r)}function $s(r){return r?.toIterable?.()||r}function Mh(r,t,e,s){let i,n=arguments.length,o=r.length,l=n<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,e):s;for(;o>0;)(i=r[--o])&&(l=(n<3?i(l):n>3?i(t,e,l):i(t,e))||l);return n>3&&l&&Object.defineProperty(t,e,l),l}function dc(r,t){if(!r||!t)return!1;if(r.get)return t.get===r.get;if(r.set)return t.set===r.set;if(r.value)return r.value===t.value}function Ps(r,t,e,s={}){let i=r.constructor;!e&&t&&(e=Object.getOwnPropertyDescriptors(t),delete e.constructor,e[Ct]&&(console.warn(`Cannot define plain fields when extending class ${i.name}`),delete e[Ct]));let n=wt(i);if(n&&n.augments){let o=new Map;for(let l of Object.keys(e)){let a=Object.getOwnPropertyDescriptor(r,l);for(let h of n.augments){let d=o.get(h);d||o.set(h,d={});let c=Object.getOwnPropertyDescriptor(h.prototype,l);c&&!dc(a,c)?console.warn("wont extend",l,c,a):d[l]=e[l]}}for(let[l,a]of o)Object.keys(a).length&&Ps(l.prototype,null,a)}return Object.defineProperties(r,e),r}function Kt(r,t){let e=wt(r),s=wt(t),i=s.parent;for(;i&&wt(i)?.flags&pt.IsMixin;){Kt(r,i),i=null;break}if(i&&!(r.prototype instanceof i))throw new Error(`Mixin ${t.name} has superclass not present in target class`);if(!s.augments){s.augments=new Set;let o=s.ref=Symbol(t.name),l=Object[Symbol.hasInstance];t.prototype[o]=!0,Object.defineProperty(t,Symbol.hasInstance,{value:function(a){return this===t?a&&!!a[o]:l.call(this,a)}})}if(r.prototype[s.ref])return r;if(s.uses)for(let o of s.uses)Kt(r,o);s.augments.add(r),e.uses||(e.uses=[]),e.uses.push(t);let n=Object.getOwnPropertyDescriptors(t.prototype);return delete n.constructor,n[Ct]&&(e.inits||(e.inits=[]),e.inits.push(t.prototype[Ct]),delete n[Ct]),Object.defineProperties(r.prototype,n),t?.mixed instanceof Function&&t.mixed(r),r}function Nh(r,t,...e){let s=t?class extends t{}:class{},i=wt(s,{symbol:r});for(let n of e)Kt(s,n);return s.prototype[r]=function(n,o,l){if(i.inits)for(let a of i.inits)a.call(this,n,!1,l)},s}var X={cache:{},self:null,target:null,proxy:new Proxy({},{apply:(r,t,e)=>Reflect.apply(X.target,t,e),get:(r,t)=>{let e=Reflect.get(X.target,t,X.self);return e instanceof Function?e.bind(X.self):e},set:(r,t,e,s)=>Reflect.set(X.target,t,e,X.self)})};function kh(r,t){return X.self=r,X.target=X.cache[t],X.proxy}function u(r,t,e,s,i=null){let n=Object.getPrototypeOf(r.prototype),o=(s&(pt.HasMixins|pt.IsExtension))==pt.HasMixins,l;if(o&&(It.set(r,It.get(n.constructor)),n=Object.getPrototypeOf(n)),i){let h=s&pt.IsObjectExtension?i:i.prototype,d=wt(r);if(d.uses){i===h&&console.warn("Cannot extend object with mixins");for(let c of d.uses)Kt(i,c)}return s&pt.HasSuperCalls&&(X.cache[t]=Object.create(Object.getPrototypeOf(h),Object.getOwnPropertyDescriptors(h))),Ps(h,r.prototype),i}let a=n?.constructor;if(l=wt(r,{symbol:t}),Object.defineProperty(r,oi,{value:l,enumerable:!1,configurable:!0}),e&&r.name!==e&&Object.defineProperty(r,"name",{value:e,configurable:!0}),l.flags=s,s&pt.HasConstructor&&(r.prototype[ks]=t),l.uses)for(let h of l.uses)h.mixes?.(r);return a?.inherited instanceof Function&&a.inherited(r),r}function Ch(r,t){r[ks]===t&&(r[ii]?.(),r[Cs]&&r[Cs].inited(r))}var Be=Symbol.for("#__listeners__"),fc=/-./g,Oh=new Set,mc=Symbol(),Wi=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,s){return this.target[e]=s,!0}};u(Wi,mc,"LazyProxy",16);var hi=Wi;function ui(r,t={}){return new Proxy(t,new hi(r))}function Wt(r){let t=typeof r;if(t=="number")return r;if(t=="string"){if(/^\d+fps$/.test(r))return 1e3/parseFloat(r);if(/^([-+]?[\d\.]+)s$/.test(r))return parseFloat(r)*1e3;if(/^([-+]?[\d\.]+)ms$/.test(r))return parseFloat(r)}return null}function $h(r){return r.indexOf("-")>=0?r.replace(fc,function(t){return t.charAt(1).toUpperCase()}):r}function Is(r,t,e){if(!r)return;let s=Object.getOwnPropertyDescriptor(r,t);return s||r==e?s||void 0:Is(Reflect.getPrototypeOf(r),t,e)}var Yi=function(r,t,e){let s,i,n;for(;(s=e)&&(e=e.next);)(i=e.listener)&&(e.path&&i[e.path]?n=t?i[e.path].apply(i,t):i[e.path]():n=t?i.apply(e,t):i.call(e)),e.times&&--e.times<=0&&(s.next=e.next,e.listener=null)};function at(r,t,e,s){let i,n,o;return i=r[Be]||(r[Be]={}),n=i[t]||(i[t]={}),o=n.tail||(n.tail=n.next={}),o.listener=e,o.path=s,n.tail=o.next={},o}function F(r,t,e){let s=at(r,t,e);return s.times=1,s}function Yt(r,t,e,s){if(!e)return;let i,n,o=r[Be];if(o&&(i=o[t])){for(;(n=i)&&(i=i.next);)if(i==e||i.listener==e){n.next=i.next,i.listener=null;break}}}function ht(r,t,e=null){let s;(s=r[Be])&&(s[t]&&Yi(t,e,s[t]),s.all&&Yi(t,[t,e],s.all))}var pc=Symbol(),Xi=class{emit(t,...e){return ht(this,t,e)}on(t,...e){return at(this,t,...e)}once(t,...e){return F(this,t,...e)}un(t,...e){return Yt(this,t,...e)}};u(Xi,pc,"Emitter",0);var Ne=Xi;function Ph(r){return r}function Zs(r,t){return typeof t=="string"?typeof r===t:t[Symbol.hasInstance]?.(r)}function gc(r){let t;return r&&((t=r.toIterable)?t.call(r):r)}var Qi=Symbol.for("#__init__"),Ji=Symbol.for("#schedule"),tr=Symbol.for("#frames"),ze=Symbol.for("#interval"),Ht=Symbol.for("#stage"),Ft=Symbol.for("#scheduled"),Ue=Symbol.for("#version"),yc=Symbol.for("#fps"),Zi=Symbol.for("#ticker"),vc=globalThis.requestAnimationFrame||function(r){return globalThis.setTimeout(r,1e3/60)},gg=1/60,bc=Symbol(),tn=class{constructor(t=null){this[Qi](t)}[Qi](t=null,e=!0,s=!0){var i;this.owner=t&&(i=t.owner)!==void 0?i:null,this.target=t&&(i=t.target)!==void 0?i:null,this.active=t&&(i=t.active)!==void 0?i:!1,this.value=t&&(i=t.value)!==void 0?i:void 0,this.skip=t&&(i=t.skip)!==void 0?i:0,this.last=t&&(i=t.last)!==void 0?i:0}tick(t,e){return this.last=this.owner[tr],this.target.tick(this,e),1}update(t,e){let s=this.active,i=t.value;return this.value!=i&&(this.deactivate(),this.value=i),(this.value||s||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[ze]=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[ze]&&(globalThis.clearInterval(this[ze]),this[ze]=null),this.active=!1,this}};u(tn,bc,"Scheduled",16);var Sc=tn,xc=Symbol(),en=class{constructor(){var t=this;this.id=Symbol(),this.queue=[],this.stage=-1,this[Ht]=-1,this[tr]=0,this[Ft]=!1,this[Ue]=0,this.listeners={},this.intervals={},this.commit=function(){return t.add("commit"),t},this[yc]=0,this.$promise=null,this.$resolve=null,this[Zi]=function(e){return t[Ft]=!1,t.tick(e)}}touch(){return this[Ue]++}get version(){return this[Ue]}add(t,e=!1){return(e||this.queue.indexOf(t)==-1)&&this.queue.push(t),this[Ft]||this[Ji](),this}get committing\u03A6(){return this.queue.indexOf("commit")>=0}get syncing\u03A6(){return this[Ht]==1}listen(t,e){let s=this.listeners[t],i=!s;return s||(s=this.listeners[t]=new Set),s.add(e),t=="raf"&&i&&this.add("raf"),this}unlisten(t,e){var s;let i=this.listeners[t];return i&&i.delete(e),t=="raf"&&i&&i.size==0&&(s=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 this.$promise||(this.$promise=new Promise(function(e){return t.$resolve=e}))}tick(t){var e=this;let s=this.queue,i=this[tr]++;if(this.ts||(this.ts=t),this.dt=t-this.ts,this.ts=t,this.queue=[],this[Ht]=1,this[Ue]++,s.length)for(let n=0,o=gc(s),l=o.length;n<l;n++){let a=o[n];typeof a=="string"&&this.listeners[a]?this.listeners[a].forEach(function(h){if(Zs(h.tick,Function))return h.tick(e,a);if(Zs(h,Function))return h(e,a)}):Zs(a,Function)?a(this.dt,this):a.tick&&a.tick(this.dt,this)}return this[Ht]=this[Ft]?0:-1,this.$promise&&(this.$resolve(this),this.$promise=this.$resolve=null),this.listeners.raf&&this.add("raf"),this}[Ji](){return this[Ft]||(this[Ft]=!0,this[Ht]==-1&&(this[Ht]=0),vc(this[Zi])),this}schedule(t,e){var s,i;return e||(e=t[s=this.id]||(t[s]={value:!0})),(e[i=this.id]||(e[i]=new Sc({owner:this,target:t}))).update(e,!0)}unschedule(t,e={}){e||(e=t[this.id]);let s=e&&e[this.id];return s&&s.active&&s.deactivate(),this}};u(en,xc,"Scheduler",16);var ci=en,C=new ci;function A(){return C.add("commit").promise}function di(r,t){return globalThis.setTimeout(function(){r(),A()},t)}function fi(r,t){return globalThis.setInterval(function(){r(),A()},t)}var mi=globalThis.clearInterval,pi=globalThis.clearTimeout,re=globalThis.imba||(globalThis.imba={});re.commit=A,re.setTimeout=di,re.setInterval=fi,re.clearInterval=mi,re.clearTimeout=pi;var gi={on:function(r,t){return at(this,r,t)},inited:function(r){return ht(this,"inited",[r])}};function Ih(){return!0}function sn(r,t){return typeof t=="string"?typeof r===t:t[Symbol.hasInstance]?.(r)}function Hh(r,t,e){if(e.get){let s=e.get;e.get=function(){let i=s.call(this);return Object.defineProperty(this,t,{enumerable:!1,value:i}),i}}return e}function Fh(r,t,e){var s,i;if(sn(e.value,Function)){let n=e.value;e.get=function(){if(this==r)return n;let o=n.bind(this);return Object.defineProperty(this,t,{enumerable:!1,value:o}),o},s=e.value,delete e.value,i=e.writable,delete e.writable}return e}var rn=new WeakMap;function Ah(r,t,e){let s=this[0]||{},i=e.value,n=Symbol(),o=new WeakMap,l=rn.get(r),a=s.timeout||20*1e3,h=""+(r.constructor?.name||"")+"."+String(typeof t=="symbol"?t.description:t);if(l||rn.set(r,l={}),l.key)throw new Error("@thenable "+h+" not allowed - @thenable "+l.key+" already defined");if(!sn(i,Function))throw new Error("@thenable "+h+" only supports functions");if(i.length>0)throw new Error("@thenable "+h+" methods cannot be called with arguments");let d=function(g){return console.trace("@thenable "+h+" took more than "+a+"ms - make sure method does not return self.",g)},c=function(g){let f=o.get(g);return f||o.set(g,f={}),f},m=function(g,f){let p=this,y=c(p);return(y.promise||(y.promise=new Promise(function(w,O){let gt=s.timeout!==!1?setTimeout(d,s.timeout||2e4,p):null,L=function($){return gt&&clearTimeout(gt),y.met=!0,y.error=$,y.promise=null,y.wrapped=null,console.trace("@thenable "+h+" threw error",$),O($)};return p[t]().then(function(){return gt&&clearTimeout(gt),y.met=!0,y.promise=null,y.wrapped=null,w(p)},L)}))).then(g,f)};return Object.defineProperty(r,"then",{enumerable:!1,configurable:!0,get:function(){return c(this).met?null:m}}),e.value=function(g){let f=c(this);return f.met?f.error?Promise.reject(f.error):Promise.resolve(this):(f.wrapped??(f.wrapped=Promise.resolve(i.call(this,f))),f.wrapped)},e.value.reset=function(g){let f=c(g);o.delete(g)},e.value.check=c,e}var _c=Symbol(),er,bi=new(er=class{get rootDir(){return process.env.IMBA_OUTDIR||vi.default.dirname(process.env.pm_exec_path||process.argv[1])}get publicPath(){return vi.default.resolve(this.rootDir,process.env.IMBA_PUBDIR||globalThis.IMBA_PUBDIR||"public")}},u(er,_c,"Env",0),er);function B(r){let t;return r&&((t=r.toIterable)?t.call(r):r)}function nn(r,t){return typeof t=="string"?typeof r===t:t[Symbol.hasInstance]?.(r)}var on=Symbol.for("#setup"),ln=Symbol.for("#setup?"),Tc=Symbol.for("#dom"),wc=Symbol.for("#server"),ie={html:{"Content-Type":"text/html; charset=utf-8"},txt:{"Content-Type":"text/plain; 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"}},an={id:Date.now()},V=globalThis.process,Lc=Symbol(),hn=class extends Set{call(t,...e){var s;s=[];for(let i of B(this))s.push(i[t](...e));return s}close(t={}){var e;e=[];for(let s of B(this))e.push(s.close(t));return e}reload(t={}){var e;e=[];for(let s of B(this))e.push(s.reload(t));return e}broadcast(t,...e){var s;s=[];for(let i of B(this))s.push(i.broadcast(t,...e));return s}emit(t,e){var s;s=[];for(let i of B(this))s.push(i.emit(t,e));return s}sseEnd(){let t=[];for(let e of B(this))for(let s of B(e.clients))t.push(new Promise(function(i){return s.on("finish",i),s.end()}));return Promise.all(t)}};u(hn,Lc,"Servers",0);var Ec=hn,Lt=new Ec,Mc=Symbol(),sr,un=new(sr=class extends Rh.EventEmitter{constructor(){var r;super(...arguments),r=this,this.autoreload=!1,this.state={},globalThis.IMBA_RUN&&(yi.default.isWorker?V.on("message",function(t){if(r.emit("message",t),t[0]=="emit")return r.emit(...t.slice(1))}):V.on("message",function(t){if(t[0]=="emit")return r.emit(...t.slice(1))}))}[on](){var r=this;if(this[ln]!=!0&&(this[ln]=!0,!0))return this.on("rebuild",function(t){let e=globalThis.IMBA_MANIFEST;return globalThis.IMBA_MANIFEST=t,Lt.broadcast("rebuild",t)}),this.on("reloadHard",async function(t){return Lt.broadcast("reloadHard",t),await Lt.sseEnd(),V.exit(0)}),this.on("reloading",function(t){var e;r.state.reloading=!0,e=[];for(let s of B(Lt))e.push(s.pause());return e}),this.on("reloaded",async function(t){var e;r.state.reloaded=!0,Lt.broadcast("reloaded"),await new Promise(function(i){return setTimeout(i,100)}),e=[];for(let i of B(Lt))e.push(i.close());let s=e;return setTimeout(function(){return V.exit(0)},100),await Promise.all(s),V.exit(0)}),!0}send(r){if(nn(V.send,Function))return V.send(r)}on(r,t){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")}},u(sr,Mc,"Process",24),sr);function cn(r,t=[],e=0){let s=globalThis.IMBA_MANIFEST[r];if(t.indexOf(r)>=0)return t;if(s?.imports)for(let i=0,n=B(s?.imports),o=n.length;i<o;i++){let l=n[i];t.push(l),cn(l,t,e+1)}return t}var Nc=Symbol(),dn=class{constructor(t,e,s={}){this.server=t,this.url=e,[this.pathname,this.query]=e.split("?"),this.ext=Ot.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,ie[this.ext.slice(1)]||{}),this.headers["max-age"]=864e5,s.imports&&t.options.preload!==!1&&(this.headers.Link=cn(e).map(function(i){return"<"+i+">; rel=modulepreload; as=script"}).join(", ")),this.path=t.localPathForUrl(e)}respond(t,e){var s=this;return K.default.access(this.path,K.default.constants.R_OK,function(i){if(i)return e.writeHead(404,{}),e.end();try{if(s.server.options.setHeaders&&s.server.options.setHeaders(e,s.path),globalThis.BUN)return K.default.readFile(s.path,function(n,o){return e.writeHead(200,s.headers),e.end(o)});{let n=K.default.createReadStream(s.path);return e.writeHead(200,s.headers),n.pipe(e)}}catch{return e.writeHead(503,{}),e.end()}})}createReadStream(){return K.default.createReadStream(this.path)}pipe(t){return this.createReadStream().pipe(t)}};u(dn,Nc,"AssetResponder",16);var kc=dn,Cc=Symbol(),fn=class{static wrap(t,e={}){return new this(t,e)}localPathForUrl(t){var e;let s,i,n=t.replace(/\?.*$/,"");return(e=this.urlToLocalPathMap)[n]??(e[n]=(s=Ot.default.resolve(bi.publicPath,"."+n),i=K.default.existsSync(s)&&s,!i&&this.staticDir&&(s=Ot.default.resolve(this.staticDir,"."+n),i=K.default.existsSync(s)&&s),i))}headersForAsset(t){let e,s=Ot.default.extname(t);return e=Object.assign({"Content-Type":"text/plain","Access-Control-Allow-Origin":"*","cache-control":"public"},ie[s.slice(1)]||{})}get manifest(){return globalThis.IMBA_MANIFEST||{}}constructor(t,e={}){var s=this;Lt.add(this),this.id=Math.random(),this.startedAt=Date.now(),this.options=e,this.closed=!1,this.paused=!1,this.server=t,this.clients=new Set,this.stalledResponses=[],this.assetResponders={},this.urlToLocalPathMap={},this.publicExistsMap={},this.staticDir=globalThis.IMBA_STATICDIR||"",V.env.IMBA_PATH&&(this.devtoolsPath=Ot.default.resolve(V.env.IMBA_PATH,"hmr.js")),this.scheme=nn(t,Vh.default.Server)?"http":"https";let i=this.server._events.request,n=globalThis[Tc];t.off("request",i),i[wc]=this,t.on("listening",function(){let o=s.server.address(),l=o.address;(l=="::"||l=="0.0.0.0")&&(l="localhost");let a=""+s.scheme+"://"+l+":"+o.port+"/";if(!V.env.IMBA_CLUSTER)return console.log("listening on "+a)}),globalThis.IMBA_HMR&&(globalThis.IMBA_HMR_PATH="/__hmr__.js"),this.handler=function(o,l){var a;let h,d=o.constructor.name=="Http2ServerRequest",c=o.url;if(s.paused||s.closed)return l.statusCode=302,l.setHeader("Location",o.url),d||l.setHeader("Connection","close"),s.closed?(d&&o.stream.session.close(),l.end()):s.stalledResponses.push(l);if(c=="/__imba__.mjs"){l.writeHead(200,ie.mjs);let p=Ot.default.resolve(V.env.IMBA_PATH,"dist","imba.mjs");return K.default.createReadStream(p).pipe(l)}if(globalThis.IMBA_HMR){if(c=="/__hmr__.json")return l.writeHead(200,ie.json),l.end(JSON.stringify(an));if(c=="/__hmr__.js"&&s.devtoolsPath){let p=K.default.createReadStream(s.devtoolsPath);return l.writeHead(200,ie.js),p.pipe(l)}if(c=="/__hmr__"){let p={"Content-Type":"text/event-stream","Cache-Control":"no-cache"};return d||(p.Connection="keep-alive"),l.writeHead(200,p),s.clients.add(l),s.broadcast("init",globalThis.IMBA_MANIFEST,[l]),s.broadcast("state",an,[l]),o.on("close",function(){return s.clients.delete(l)}),!0}}let m=o.headers,g;d?g=m[":scheme"]+"://"+m[":authority"]:g=(o.connection.encrypted?"https":"http")+"://"+m.host;let f=s.manifest[c];if(f&&s.localPathForUrl(c))return((a=s.assetResponders)[c]||(a[c]=new kc(s,c,f))).respond(o,l);if((c.match(/\.[A-Z\d]{8}\./)||c.match(/\.\w{1,4}($|\?)/))&&(h=s.localPathForUrl(c)))try{let p=s.headersForAsset(h);if(e.setHeaders&&e.setHeaders(l,h),globalThis.BUN)return K.default.readFile(h,function(y,w){return y?(l.writeHead(500,{}),l.write("Error getting the file: "+y)):(l.writeHead(200,p),l.end(w))});{let y=K.default.createReadStream(h);return l.writeHead(200,p),y.pipe(l)}}catch{return l.writeHead(503,{}),l.end()}if(n){let p=new n.Location(o.url,g);return n.Document.create({location:p},function(){return i(o,l)})}else return i(o,l)},t.on("request",this.handler),t.on("close",function(){return console.log("server is closing!")}),globalThis.IMBA_RUN&&(yi.default.isWorker||V.env.IMBA_WATCH)&&(un[on](),un.send("serve"))}broadcast(t,e={},s=this.clients){e=JSON.stringify(e);let i="data: "+e+`


`;for(let n of B(s))n.write("event: "+t+`
`),n.write(`id: imba
`),n.write(i);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=B(this.stalledResponses),s=e.length;t<s;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()})}};u(fn,Cc,"Server",16);var Oc=fn;function jh(r,...t){return Oc.wrap(r,...t)}var qe={};function Dh(r,t,e){if(t!=null){let s=qe[r]||(qe[r]=new WeakMap);return s.get(t)||s.set(t,(e.memoized=r)&&e).get(t)}return e}function Gh(r,t,e,s){let i=qe[r]||(qe[r]=new WeakMap),n=i.get(t);n||i.set(t,n={f:null,o:null,p:null});for(let o=0,l=$s(s),a=l.length;o<a;o++){let h=l[o],d=h!==null&&(typeof h=="object"||typeof h=="function")?n.o||(n.o=new WeakMap):n.p||(n.p=new Map),c=d.get(h);c||d.set(h,c={f:null,o:null,p:null}),n=c}return n.f||(n.f=(e.memoized=r)&&e)}function $c(r,t){return typeof t=="string"?typeof r===t:t[Symbol.hasInstance]?.(r)}var Ke=Symbol.for("#idler"),ne=Symbol.for("#resolve"),Pc=Symbol(),mn=class extends Set{constructor(){super(),this[Ke]=Promise.resolve(this)}emit(t,...e){return ht(this,t,e)}on(t,...e){return at(this,t,...e)}once(t,...e){return F(this,t,...e)}un(t,...e){return Yt(this,t,...e)}add(t){var e=this;if($c(t,Function)&&(t=t()),!this.has(t)){let s=this.size==0;super.add(t),s&&(this[Ke]=this[ne]=null,this.emit("busy",this)),this.emit("add",t,this);let i=function(){return e.delete(t)};t.then(i,i)}return t}delete(t){return super.delete(t)?(this.emit("delete",t,this),this.size==0&&(this[ne]&&(this[ne](!0),this[ne]=null),this.emit("idle",this)),!0):!1}get idle(){var t=this;return this[Ke]||(this[Ke]=new Promise(function(e){return t.size==0?e(!0):t[ne]=e}))}get idle\u03A6(){return this.size==0}then(t,e){return this.idle.then(t,e)}};u(mn,Pc,"Queue",24);var Si=mn;function xi(r,t){let e=[],s=[];for(let i=0,n=$s(r),o=n.length;i<o;i++){let l=n[i];if(i%2!=0)continue;let a=r[i+1];l==""?(s.push("%s"),e.push("\x1B[40m\x1B[32m"+a+"\x1B[0m")):(s.push("%s %O"),e.push("\x1B[44m\x1B[97m"+l+"\x1B[0m"),e.push(a))}return[s.join(" "),...e]}var rr=Symbol.for("#L");function Bh(){return globalThis[rr]||(globalThis[rr]=globalThis[rr]||xi),!0}function Ic(r){let t;return r&&((t=r.toIterable)?t.call(r):r)}var Z={"":[-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}]},M={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},ir=Object.keys(Z);for(let r=0,t=Ic(ir),e=t.length;r<e;r++){let s=t[r],i=Z[s];i.name=s+"Element",i.up=Z[ir[i[0]]]}for(let r=0,t=Object.keys(M),e=t.length,s,i;r<e;r++)s=t[r],i=M[s],M[s]=Z[ir[i]],s.indexOf("svg_")==0&&(M[s.replace("_",":")]=M[s]);var pn=Symbol.for("#toStringDeopt"),We=Symbol.for("#named"),gn=Symbol.for("#symbols"),yn=Symbol.for("#batches"),vn=Symbol.for("#extras"),bn=Symbol.for("#stacks"),Hc=Symbol(),Sn=class{constructor(t){this.dom=t,this.string=""}contains(t){return this.dom.classList.contains(t)}has(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)}set(t,e){this[We]||(this[We]={});let s=this[We][t];return s!=e&&(s&&this.decr(s),e&&this.incr(e),this[We][t]=e),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 s=this;let i=this.stacks,n=i[t]||0;return n<1&&this.add(t),e>0&&setTimeout(function(){return s.decr(t)},e),i[t]=Math.max(n,0)+1}decr(t){let e=this.stacks,s=e[t]||0;return s==1&&this.remove(t),e[t]=Math.max(s,1)-1}reconcile(t,e,s){let i=this[gn],n=this[yn],o=!0;if(!i)i=this[gn]=[t],n=this[yn]=[e||""],s&&(this.dom.className||"").indexOf(s)==-1&&(i.push(t),n.push(s)),this.toString=this.valueOf=this[pn];else{let l=i.indexOf(t),a=e||"";l==-1?(i.push(t),n.push(a),s&&(this.dom.className||"").indexOf(s)==-1&&(i.push(t),n.push(s))):n[l]!=a?n[l]=a:o=!1}o&&(this[vn]=" "+n.join(" "),this.sync())}valueOf(){return this.string}toString(){return this.string}[pn](){return this.string+(this[vn]||"")}sync(){return this.dom.flagSync$()}get stacks(){return this[bn]||(this[bn]={})}};u(Sn,Hc,"Flags",16);var nr=Sn,xn=Symbol.for("#__init__"),or=Symbol.for("#getRenderContext"),Fc=Symbol.for("#getDynamicContext"),Ac=Symbol.for("#removeFromCache"),E={context:null,document:null,createTextNode:function(r){return globalThis.document.createTextNode(r)}},Rc=Symbol(),_n=class{constructor(t=null){this[xn](t)}[xn](t=null,e=!0,s=!0){var i;this.stack=t&&(i=t.stack)!==void 0?i:[],this.moving=t&&(i=t.moving)!==void 0?i:new Set}push(t){return this.stack.push(t)}pop(t){return this.stack.pop()}};u(_n,Rc,"Renderer",16);var Vc=_n,W=new Vc,jc=Symbol(),Tn=class Uh extends Map{constructor(t,e=null){super(),this._=t,this.sym=e}pop(){return E.context=null}[or](t){let e=this.get(t);return e||this.set(t,e=new Uh(this._,t)),E.context=e}[Fc](t,e){return this[or](t)[or](e)}[Ac](t){let e=this[t];return e&&(this.delete(e),this[t]=null,this.value==e&&(this.value=null)),this}run(t,e=1){if(this.value=t,E.context==this&&(E.context=null),e==0){let s=t;if(typeof s=="number"&&(s=String(s)),typeof s=="string"){let i=this.text||(this.text=E.createTextNode(s));return s!=i.textContent&&(i.textContent=s),i}}return this.get(t)}cache(t){return this.set(this.value,t),t}};u(Tn,jc,"RenderContext",16);var Xt=Tn;function Hs(r,t=Symbol(),e=r){return E.context=r[t]||(r[t]=new Xt(e,t))}function qh(){let r=E.context,t=r||new Xt(null);return globalThis.DEBUG_IMBA&&!r&&W.stack.length>0&&console.trace("detected unmemoized nodes in",W.stack.slice(0),"see https://imba.io",t),r&&(E.context=null),t}function Q(r,t){return typeof t=="string"?typeof r===t:t[Symbol.hasInstance]?.(r)}function oe(r){let t;return r&&((t=r.toIterable)?t.call(r):r)}var lr=Symbol.for("#parent"),wn=Symbol.for("#context"),Ln=Symbol.for("#closestNode"),Dc=Symbol.for("#parentNode"),Et=Symbol.for("#__init__"),Gc=Symbol.for("##inited"),ar=Symbol.for("#getRenderContext"),Bc=Symbol.for("#getDynamicContext"),hr=Symbol.for("#replaceChild"),le=Symbol.for("#appendChild"),En=Symbol.for("#removeChild"),yt=Symbol.for("#insertInto"),Mn=Symbol.for("#insertChild"),ae=Symbol.for("#removeFrom"),Nn=Symbol.for("#removeFromDeopt"),At=Symbol.for("#replaceWith"),kn=Symbol.for("#replaceWithDeopt"),ur=Symbol.for("#placeholderNode"),zc=Symbol.for("#attachToParent"),Uc=Symbol.for("#detachFromParent"),qc=Symbol.for("#placeChild"),Kc=Symbol.for("#beforeReconcile"),Wc=Symbol.for("#afterReconcile"),Yc=Symbol.for("#afterVisit"),Xc=Symbol.for("#visitContext"),Cn=Symbol.for("#document"),Ye=Symbol.for("#htmlNodeName"),On=Symbol.for("#ImbaElement"),$n=Symbol.for("#flags"),Xe=Symbol.for("#scripts"),cr=Symbol.for("#location"),Pn=Symbol.for("##document"),In=Symbol.for("##parent"),Qc=Symbol.for("##up"),Hn=Symbol.for("##context"),he=Symbol.for("#domNode"),Qe=Symbol.for("##placeholderNode"),Fn=Symbol.for("#domDeopt"),Jc=Symbol.for("#insertIntoDeopt"),An=Symbol.for("##classList"),Je=Symbol.for("##style"),Rn=Symbol.for("##dataset"),ct=Symbol.for("#asset"),dr=Symbol.for("#innerHTML"),Ze=Symbol.for("##visitContext"),Zc=Symbol.for("#isRichElement"),ue=Symbol.for("#src"),td=Symbol.for("#getSlot"),ed=Symbol.for("#cssns"),sd=Symbol.for("#cssid"),rd=Symbol.for("#dom"),id={},ce=null,nd=Symbol(),Vn=class extends URL{};u(Vn,nd,"Location",0);var ke=Vn,od=Symbol(),jn=class{get document(){return this[Cn]||(this[Cn]=new this.Document(this))}get location(){return this.document.location}};u(jn,od,"Window",0);var Kh=jn;function Wh(){return globalThis.imba.uses_window=!0,!0}var ld={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},dt=null,Dn={},ad=Symbol(),Gn=class{define(){return this}get(){return this}upgrade(){}whenDefined(){}};u(Gn,ad,"CustomElementRegistry",0);var hd=Gn,Yh=new hd,_i={};function ut(r,t){let e=r;if(typeof r=="string"&&(r=Z[r]||M[r]||Z[r+"Element"]||M["svg_"+r]),Q(r,D))return r;if(!r)return ut("HTML");if(r&&!r.klass){let s=Symbol(),i=class extends ut(r.up){};u(i,s,"element",0);let n=i;r.klass=n}if(r&&!r.idl){r.idl=!0;let s=Object.getOwnPropertyDescriptors(r.klass.prototype);for(let i=r[1],n=0,o=Object.keys(i),l=o.length,a,h;n<l;n++){a=o[n],h=i[a];let d=h==1?a:h;s[d]||d=="style"||Object.defineProperty(r.klass.prototype,a,{set:function(c){this.setAttribute(d,c)},get:function(){return this.getAttribute(d)}})}}return r.klass}function Xh(r,t,e){var s;let i=ut(r,t);if(!(i==e||Q(i.prototype,e)||i.prototype[Ye])){let n=i.prototype[On];if(!n){let o=Symbol();n=(s=class extends i{constructor(){super(...arguments),this.__slots={},this.__F=0}},u(s,o,"CustomBuiltInElement",16),s),i.prototype[On]=n;let l=Object.getOwnPropertyDescriptors(e.prototype);Object.defineProperties(n.prototype,l),n.prototype[Ye]=r}return n}return i}var ts=function(r){let t=typeof r=="string"?r:String(r);return t.indexOf('"')>=0&&(t=t.replace(/\"/g,"&quot;")),t},fr=function(r,t){let e=typeof r=="string"?r:String(r);return t=="script"||t=="style"||(e.indexOf('"')>=0&&(e=e.replace(/\"/g,"&quot;")),e.indexOf("<")>=0&&(e=e.replace(/\</g,"&lt;")),e.indexOf(">")>=0&&(e=e.replace(/\>/g,"&gt;"))),e},ud=Symbol(),Bn=class Qh{static create(t,e){let s=new Qh;return s[wn]=t,s.location=t.location,ce||(ce=new zh.AsyncLocalStorage),ce.run(s,e),s}constructor(){}get flags(){return this[$n]||(this[$n]=new nr({classList:new Un(this)}))}get scripts(){return this[Xe]||(this[Xe]=[])}set location(t){typeof t=="string"&&(t=new ke(t)),this[cr]=t}get location(){return this[cr]||(this[cr]=new ke("http://localhost/"))}createElement(t){let e=ut(t),s=new e(t);return s.nodeName=t,s}createElementNS(t,e){if(t=="http://www.w3.org/2000/svg"){let s=ut("svg_"+e),i=new s;return i.nodeName=e,i}return this.createElement(e)}createTextNode(t){return new Oe(t)}createComment(t){return new $t(t)}createDocumentFragment(){return new As}getElementById(t){return null}};u(Bn,ud,"Document",16);var Ce=Bn,tt=new Ce;E.createTextNode=function(r){return tt.createTextNode(r)};var Fs=tt;function Qt(){return ce&&ce?.getStore?.()||tt}var cd=Symbol(),zn=class Jh{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 Jh(t,this.classes.slice(0))}toString(){return this.classes.join(" ").trim()}};u(zn,cd,"DOMTokenList",16);var Un=zn,dd=Symbol(),qn=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,s=0,i=Object.keys(e),n=i.length,o,l;s<n;s++)o=i[s],l=e[o],Q(l,Function)||t.push(""+o+": "+l);return t.join(";")}};u(qn,dd,"StyleDeclaration",16);var Ti=qn,fd=Symbol(),Kn=class Zh{static wrap(t){return new Proxy(t.attributes,new Zh)}set(t,e,s){return t["data-"+e]=s,!0}get(t,e){return t["data-"+e]}};u(Kn,fd,"DataSet",0);var md=Kn,pd={get(r,t){let e=r,s;for(;e&&s==null;)(e=e[lr])&&(s=e[t]);return s}},gd=Symbol(),Wn=class{toString(){return this.outerHTML}get outerHTML(){return""}text$(t){return this.textContent=t,this}get ownerDocument(){return this[Pn]||(this[Pn]=Qt())}get[lr](){return this[In]||this.parentNode||this[Qc]}get[wn](){return this[Hn]||(this[Hn]=new Proxy(this,pd))}get[Ln](){return this}get[Dc](){return this[lr]?.[Ln]}[Et](){return this}[Gc](){return this}[ar](t){return Hs(this,t)}[Bc](t,e){return this[ar](t)[ar](e)}[hr](t,e){let s=this[Mn](t,e);return this[En](e),s}[le](t){return t[yt](this,null)}[En](t){return t[ae](this)}[yt](t,e){return e?t.insertBefore(this,e):t.appendChild(this),this}[Mn](t,e){return t[yt](this,e)}[ae](t){return t.removeChild(this)}[Nn](t){return t.removeChild(this[he]||this)}[At](t,e){return e[hr](t,this)}[kn](t,e){return e[hr](t,this[he]||this)}get[ur](){return this[Qe]||(this[Qe]=tt.createComment("placeholder"))}set[ur](t){let e=this[Qe];this[Qe]=t,e&&e!=t&&e.parentNode&&e[At](t)}[zc](){let t=this[he],e=t&&t.parentNode;return t&&e&&t!=this&&(this[he]=null,this[yt](e,t),t[ae](e)),this}[Uc](){this[Fn]!=!0&&(this[Fn]=!0,!0)&&(this[At]=this[kn],this[ae]=this[Nn],this[yt]=this[Jc]);let t=this[ur];return this.parentNode&&t!=this&&(t[yt](this.parentNode,this),this[ae](this.parentNode)),this[he]=t,this}[qc](t,e,s){let i=typeof t;if(i==="undefined"||t===null){if(s&&Q(s,$t))return s;let n=new $t("");return s?s[At](n,this):n[yt](this,null)}if(t===s)return t;if(i!=="object"){let n,o=t;return e&128&&e&256,s?Q(s,Oe)?(s.textContent=o,s):(n=Fs.createTextNode(o),s[At](n,this),n):(this.appendChild(n=Fs.createTextNode(o)),n)}else return s?s[At](t,this):t[yt](this,null)}};u(Wn,gd,"Node",0);var D=Wn,yd=Symbol(),Yn=class extends D{constructor(t){super(),this.textContent=t??""}get outerHTML(){return this.textContent}};u(Yn,yd,"Text",16);var Oe=Yn,vd=Symbol(),Xn=class extends D{constructor(t){super(),this.value=t}get outerHTML(){return"<!-- "+fr(this.value)+" -->"}toString(){return this.tag&&this.tag.toNodeString?this.tag.toNodeString():this.outerHTML}};u(Xn,vd,"Comment",16);var $t=Xn,bd=Symbol(),Qn=class $e extends D{constructor(t){super(),this.nodeName=t,this.childNodes=[],this.attributes={}}emit(t,e,s={bubbles:!0}){console.warn("Element#emit not supported on node")}get classList(){return this[An]||(this[An]=new Un(this))}get style(){return this[Je]||(this[Je]=new Ti)}get dataset(){return this[Rn]||(this[Rn]=md.wrap(this))}get richValue(){return this.value}set richValue(t){this.value=t}set asset(t){this[ct]=t}get asset(){return this[ct]}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 s=this.childNodes.indexOf(e);return s>=0&&(this.childNodes.splice(s,1,t),t.parentNode=this),e}insertBefore(t,e){let s=this.childNodes.indexOf(e);return this.childNodes.splice(s,0,t),this}setAttribute(t,e){var s;return e==null?(s=this.attributes[t],delete this.attributes[t]):this.attributes[t]=e,this}setAttributeNS(t,e,s){return this.setAttribute(t+":"+e,s)}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[dr]=t}get innerHTML(){let t="";if(this[dr])return this[dr];if(this.textContent!=null)return fr(this.textContent,this.nodeName);for(let e=0,s=oe(this.childNodes),i=s.length;e<i;e++){let n=s[e];typeof n=="string"?t+=fr(n,this.nodeName):Q(n,Number)?t+=""+n:n&&(t+=n.outerHTML)}return t}get outerHTML(){let t=this.nodeName,e=this[Ye],s=""+t;e&&(s=""+e+" is='"+t+"'",t=e);let i,n=this.id,o=this.classList.toString();this.dehydrate&&(o=o?"_ssr_ "+o:"_ssr_",this.dehydrate()),n&&(s+=' id="'+ts(n)+'"'),o&&(s+=' class="'+ts(o)+'"');for(let l=this.attributes,a=0,h=Object.keys(l),d=h.length,c,m;a<d;a++)c=h[a],m=l[c],!(c=="id"&&n)&&(s+=" "+c+'="'+ts(m)+'"');return this[Je]&&(s+=' style="'+ts(this[Je].toString())+'"'),ld[t]?"<"+s+">":"<"+s+">"+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 s=this.childNodes[e++];if(Q(s,$e))return s}return null}get lastElementChild(){let t=this.childNodes.length;for(;t>0;){let e=this.childNodes[--t];if(Q(e,$e))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}[Kc](){return this}[Wc](){return this}[Yc](){this.render&&this.render(),this[Ze]&&(this[Ze]=null)}get[Xc](){return this[Ze]||(this[Ze]={})}get flags(){return this.$flags||(this.$flags=new nr(this),this.flag$==$e.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}flagIf$(){return this}flagDeopt$(){var t=this;this.flag$=this.flagExt$,this.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 s=Is(this,t,$e);!s||!s.set?this.setAttribute(t,e):this[t]=e}};u(Qn,bd,"Element",16);var S=Qn;S.prototype.setns$=S.prototype.setAttributeNS,S.prototype[Zc]=!0;var Sd=Symbol(),Jn=class extends S{constructor(){super(null)}get outerHTML(){return this.innerHTML}};u(Jn,Sd,"DocumentFragment",16);var As=Jn,xd=Symbol(),Zn=class extends As{get outerHTML(){return this.innerHTML}};u(Zn,xd,"ShadowRoot",0);var tu=Zn,_d=Symbol(),to=class extends S{};u(to,_d,"HTMLElement",0);var R=to,Td=Symbol(),eo=class extends R{constructor(){super(...arguments),super[Et]||this[Et]()}[Et](t=null,e=!0,s=!0){e&&super[Et]&&super[Et](...arguments),this.hmr=t?t.hmr:void 0}get scripts(){return this[Xe]||(this[Xe]=[])}get outerHTML(){let t=dt;dt=this;let e=super.outerHTML,s=new Set,i=[],n=[];if(globalThis.IMBA_HMR_PATH&&this.hmr!==!1&&n.push("<script src='/__hmr__.js'><\/script>"),globalThis.__vite_manifest__)for(let o=0,l=oe(this.scripts),a=l.length;o<a;o++){let h=l[o];if(this.src=globalThis.__vite_manifest__[h.src]){n.push('<script type="module" src="'+this.src.file+'"><\/script>');for(let d=0,c=oe(this.src.css),m=c.length;d<m;d++){let g=c[d];s.add({url:g})}}}else globalThis.__vite__&&n.push(`<link rel='stylesheet' id='imba-dev-ssr' href='.dev-ssr/all.css'>
<script>addEventListener('DOMContentLoaded', (event) => {
	document.getElementById("imba-dev-ssr").remove()
});<\/script>`);if(!this.styles){for(let o=0,l=oe(this.scripts),a=l.length;o<a;o++){let h=l[o].src,d=id[h];d&&d.css&&s.add(d.css)}for(let o of oe(s))n.push("<link rel='stylesheet' href='"+o.url+"'>")}if(dt=t,n.length){let o=e.indexOf("</head>");o==-1&&(o=e.indexOf("<body>")),o==-1&&(o=0),e=e.slice(0,o)+`
`+n.join(`
`)+`
`+e.slice(o)}return"<!DOCTYPE html>"+e}};u(eo,Td,"HTMLHtmlElement",24);var wi=eo,wd=Symbol(),so=class extends R{};u(so,wd,"HTMLSelectElement",0);var Rs=so,Ld=Symbol(),ro=class extends R{};u(ro,Ld,"HTMLInputElement",0);var Vs=ro,Ed=Symbol(),io=class extends R{};u(io,Ed,"HTMLTextAreaElement",0);var js=io,Md=Symbol(),no=class extends R{};u(no,Md,"HTMLButtonElement",0);var Ds=no,Nd=Symbol(),oo=class extends R{};u(oo,Nd,"HTMLOptionElement",0);var Gs=oo,kd=Symbol(),lo=class extends R{get outerHTML(){return dt&&((dt.scripts||(dt.scripts=[])).push(this),globalThis.__vite_manifest__&&globalThis.__vite_manifest__[this.src])?"":(this[ct]&&(this[ct].js?(this.setAttribute("src",this[ct].js.url),this.setAttribute("type","module")):console.warn("could not find browser entrypoint for "+this[ct].path)),super.outerHTML)}};u(lo,kd,"HTMLScriptElement",8);var Li=lo,Cd=Symbol(),ao=class extends R{get outerHTML(){if(this[ct]){let t=this.getAttribute("rel"),e;t=="stylesheet"&&((e=this[ct].css.url)||console.warn("could not find stylesheet for "+this[ct].path)),e&&this.setAttribute("href",e)}return super.outerHTML}};u(ao,Cd,"HTMLLinkElement",8);var Ei=ao,Od=Symbol(),ho=class extends R{set src(t){this[ue]!=t&&(this[ue]=t)}get src(){return this[ue]}get outerHTML(){if(dt&&this.src&&(dt.styles||(dt.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}};u(ho,Od,"HTMLStyleElement",8);var Mi=ho,$d=Symbol(),uo=class{};u(uo,$d,"Event",0);var Y=uo,Pd=Symbol(),co=class extends Y{};u(co,Pd,"UIEvent",0);var Pe=co,Id=Symbol(),fo=class extends Pe{};u(fo,Id,"FocusEvent",0);var Ni=fo,Hd=Symbol(),mo=class extends Pe{};u(mo,Hd,"MouseEvent",0);var Bs=mo,Fd=Symbol(),po=class extends Bs{};u(po,Fd,"PointerEvent",0);var ki=po,Ad=Symbol(),go=class extends Pe{};u(go,Ad,"KeyboardEvent",0);var Ci=go,Rd=Symbol(),yo=class extends Y{};u(yo,Rd,"CustomEvent",0);var G=yo,vo={};function bo(r,t,e){if(!r)return e[t]=null;if(e[t]!==void 0)return e[t];let s=Object.getOwnPropertyDescriptor(r,t);return s!==void 0||r==Ie?e[t]=s||null:bo(Reflect.getPrototypeOf(r),t,e)}var Vd=Symbol(),So=class extends S{set$(t,e){var s;let i=vo[s=this.nodeName]||(vo[s]={}),n=bo(this,t,i);!n||!n.set?this.setAttribute(t,e):this[t]=e}};u(So,Vd,"SVGElement",0);var Ie=So,jd=Symbol(),xo=class extends Ie{set src(t){if(this[ue]!=t&&(this[ue]=t,!0)){if(t&&t.adoptNode)t.adoptNode(this);else if(t&&t.type=="svg"){if(t.attributes)for(let e=t.attributes,s=0,i=Object.keys(e),n=i.length,o,l;s<n;s++)o=i[s],l=e[o],this.setAttribute(o,l);this.innerHTML=t.content}}}};u(xo,jd,"SVGSVGElement",0);var Oi=xo;Z[""].klass=S,Z.HTML.klass=R,Z.SVG.klass=Ie,M.html.klass=wi,M.select.klass=Rs,M.input.klass=Vs,M.textarea.klass=js,M.button.klass=Ds,M.option.klass=Gs,M.script.klass=Li,M.style.klass=Mi,M.link.klass=Ei,M.svg_svg.klass=Oi,ut(""),ut("HTML"),ut("SVG");function eu(r,t,e,s){let i=tt.createElement(r);return e&&(i.className=e),s!==null&&i.text$(s),t&&t[le]&&t[le](i),i}function su(r,t,e,s,i){let n=tt.createElementNS("http://www.w3.org/2000/svg",r);return e&&(n.className=e),t&&t[le]&&t[le](n),s&&(n.textContent=s),n}function Pt(r){return tt.createComment(r)}function zs(r){return tt.createTextNode(r)}function ru(){return tt.createDocumentFragment()}function $i(r,t,e,s,i){let n;return typeof r!="string"&&(Q(r.prototype,R)?(n=new r,n.nodeName=r.nodeName):r&&r.nodeName&&(r=r.nodeName)),n||(n=tt.createElement(Dn[r]||r)),n[In]=t,n[Et](),s!==null&&n[td]("__").text$(s),(e||n.flags$ns)&&n.flag$(e||""),n}function iu(r,t,e,s){if(r==null||r==null)return Pt("");if(Q(r,D))return r;if(typeof r=="string"||r&&Q(r.prototype,D))return $i(r,t,e,s)}function nu(r,t,e={}){Z[r]=_i[r]={idl:!0,name:r,klass:t};let s=t.nodeName=r,i=t.prototype;if(r.indexOf("-")==-1&&(s=t.nodeName=""+r+"-tag",Dn[r]=s),e.extends&&(i[Ye]=e.extends),e.cssns){let n=(i._ns_||"")+" "+e.cssns;i._ns_=n.trim()+" ",i[ed]=e.cssns}if(e.cssid){let n=(i.flags$ns||"")+" "+e.cssid;i[sd]=e.cssid,i.flags$ns=n.trim()+" "}return t}globalThis[rd]={Location:ke,Document:Ce};function de(r,t){return typeof t=="string"?typeof r===t:t[Symbol.hasInstance]?.(r)}function mr(r){let t;return r&&((t=r.toIterable)?t.call(r):r)}var es=Symbol.for("#parent"),_o=Symbol.for("#closestNode"),Dd=Symbol.for("#isRichElement"),Gd=Symbol.for("#afterVisit"),Bd=Symbol.for("#getRenderContext"),To=Symbol.for("#appendChild"),wo=Symbol.for("#removeChild"),Lo=Symbol.for("#replaceChild"),ft=Symbol.for("#insertInto"),ss=Symbol.for("#replaceWith"),Eo=Symbol.for("#insertChild"),rs=Symbol.for("#removeFrom"),Mo=Symbol.for("#placeChild"),zd=Symbol.for("#registerFunctionalSlot"),Ud=Symbol.for("#getFunctionalSlot"),No=Symbol.for("#getSlot"),pr=Symbol.for("##parent"),Mt=Symbol.for("##up"),ko=Symbol.for("##flags"),qd=Symbol.for("#domFlags"),z=Symbol.for("#end"),Co=Symbol.for("#textContent"),is=Symbol.for("#textNode"),gr=Symbol.for("#functionalSlots");function ou(){return!0}var Kd=Symbol(),Oo=class{constructor(){this.childNodes=[]}log(...t){}hasChildNodes(){return!1}set[es](t){this[pr]=t}get[es](){return this[pr]||this[Mt]}get[_o](){return this[es][_o]}get[Dd](){return!0}get flags(){return this[ko]||(this[ko]=new nr(this))}flagSync$(){return this}[Gd](){return this}[Bd](t){return Hs(this,t)}};u(Oo,Kd,"Fragment",16);var Jt=Oo,Wd=0,Yd=Symbol(),$o=class extends Jt{constructor(t,e){super(...arguments),this[Mt]=e,this.parentNode=null,this[qd]=t,this.childNodes=[],this[z]=Pt("slot"+Wd++),e&&e[To](this)}get[es](){return this[pr]||this.parentNode||this[Mt]}set textContent(t){this[Co]=t}get textContent(){return this[Co]}hasChildNodes(){for(let t=0,e=mr(this.childNodes),s=e.length;t<s;t++){let i=e[t];if(de(i,Jt)&&i.hasChildNodes()||!de(i,$t)&&de(i,D))return!0}return!1}text$(t){return this[is]?this[is].textContent=t:this[is]=this[Mo](t),this[is]}appendChild(t){return this.parentNode&&t[ft](this.parentNode,this[z]),this.childNodes.push(t)}[To](t){return this.parentNode?t[ft](this.parentNode,this[z]):t[Mt]??(t[Mt]=this[Mt]||this),this.childNodes.push(t)}insertBefore(t,e){this.parentNode&&this.parentNode[Eo](t,e);let s=this.childNodes.indexOf(e);return s>=0&&this.childNodes.splice(s,0,t),t}[wo](t){this.parentNode&&this.parentNode[wo](t);let e=this.childNodes.indexOf(t);e>=0&&this.childNodes.splice(e,1)}[Lo](t,e){this.parentNode&&this.parentNode[Lo](t,e);let s=this.childNodes.indexOf(e);return this.childNodes[s]=t,t}[ft](t,e){let s=this.parentNode;if(this.parentNode!=t&&(this.parentNode=t,!0)){this[z]&&(e=this[z][ft](t,e));for(let i=0,n=mr(this.childNodes),o=n.length;i<o;i++)n[i][ft](t,e)}return this}[ss](t,e){let s=t[ft](e,this[z]);return this[rs](e),s}[Eo](t,e){if(this.parentNode&&this.insertBefore(t,e||this[z]),e){let s=this.childNodes.indexOf(e);s>=0&&this.childNodes.splice(s,0,t)}else this.childNodes.push(t);return t}[rs](t){for(let e=0,s=mr(this.childNodes),i=s.length;e<i;e++)s[e][rs](t);return this[z]&&this[z][rs](t),this.parentNode=null,this}[Mo](t,e,s){let i=this.parentNode,n=typeof t;if(n==="undefined"||t===null){if(s&&de(s,$t))return s;let o=Pt("");if(s){let l=this.childNodes.indexOf(s);return this.childNodes.splice(l,1,o),i&&s[ss](o,i),o}return this.childNodes.push(o),i&&o[ft](i,this[z]),o}if(t===s)return t;if(n!=="object"){let o,l=t;if(s){if(de(s,Oe))return s.textContent=l,s;{o=zs(l);let a=this.childNodes.indexOf(s);return this.childNodes.splice(a,1,o),i&&s[ss](o,i),o}}else return this.childNodes.push(o=zs(l)),i&&o[ft](i,this[z]),o}else if(s){let o=this.childNodes.indexOf(s);return this.childNodes.splice(o,1,t),i&&s[ss](t,i),t}else return this.childNodes.push(t),i&&t[ft](i,this[z]),t}};u($o,Yd,"VirtualFragment",16);var Po=$o;function lu(r,t){return new Po(r,t)}function He(r,t){let e=new Po(r,null);return e[Mt]=t,e}var Xd=Symbol(),Io=class{[zd](t){let e=this[gr]||(this[gr]={});return e[t]||(e[t]=He(0,this))}[Ud](t,e){let s=this[gr];return s&&s[t]||this[No](t,e)}[No](t,e){var s;return t=="__"&&!this.render||!this.__slots?this:(s=this.__slots)[t]||(s[t]=He(0,this))}};u(Io,Xd,"Node",1,D);var ry=Io;function Qd(r){let t;return r&&((t=r.toIterable)?t.call(r):r)}var Jd=Symbol.for("#afterVisit"),ns=Symbol.for("#insertInto"),Ho=Symbol.for("#appendChild"),Zd=Symbol.for("#replaceWith"),yr=Symbol.for("#removeFrom"),tf=Symbol.for("#domFlags"),ef=Symbol.for("##parent"),vt=Symbol.for("#end"),sf=Symbol.for("#removeChild"),rf=Symbol.for("#insertChild"),nf=Symbol(),Fo=class extends Jt{constructor(t,e){super(...arguments),this[tf]=t,this[ef]=e,t&256||(this[vt]=Pt("list")),this.$=this.childNodes,this.length=0,e&&e[Ho](this)}hasChildNodes(){return this.length!=0}[Jd](t){let e=this.length;if(this.length=t,e==t)return;let s=this.parentNode;if(!s)return;let i=this.childNodes,n=this[vt];if(e>t)for(;e>t;)s[sf](i[--e]);else if(t>e)for(;t>e;)s[rf](i[e++],n);this.length=t}[ns](t,e){this.parentNode=t,this[vt]&&this[vt][ns](t,e),e=this[vt];for(let s=0,i=Qd(this.childNodes),n=i.length;s<n;s++){let o=i[s];if(s==this.length)break;o[ns](t,e)}return this}[Ho](t){}[Zd](t,e){let s=t[ns](e,this[vt]);return this[yr](e),s}[yr](t){let e=this.length;for(;e>0;)this.childNodes[--e][yr](t);this[vt]&&t.removeChild(this[vt]),this.parentNode=null}};u(Fo,nf,"IndexedTagFragment",16);var of=Fo;function au(r,t){return new of(r,t)}function Ao(r){let t;return r&&((t=r.toIterable)?t.call(r):r)}var vr=Symbol.for("#appendChild"),os=Symbol.for("#insertChild"),lf=Symbol.for("#replaceWith"),ls=Symbol.for("#insertInto"),br=Symbol.for("#removeFrom"),af=Symbol.for("#afterVisit"),as=Symbol.for("#domFlags"),Ro=Symbol.for("##parent"),bt=Symbol.for("#end"),Vo=Symbol.for("#removeChild"),hf=Symbol(),jo=class extends Jt{constructor(t,e){super(...arguments),this[as]=t,this[Ro]=e,this.changes=new Map,this.dirty=!1,this.array=this.childNodes,this.$=new Xt(this,Symbol()),t&256||(this[bt]=Pt("map")),e&&e[vr](this)}[vr](t){if(this.parentNode)return this.parentNode[os](t,this[bt])}hasChildNodes(){return this.childNodes.length!=0}push(t,e){if(!(this[as]&1)){this.array.push(t),this[vr](t);return}let s=this.array[e];if(s!==t){this.dirty=!0;let i=this.array.indexOf(t),n=this.changes.get(t);i===-1?(this.array.splice(e,0,t),this.insertChild(t,e,i)):i===e+1?(s&&this.changes.set(s,-1),this.array.splice(e,1)):(i>=0&&this.array.splice(i,1),this.array.splice(e,0,t),this.moveChild(t,e,i)),n==-1&&this.changes.delete(t)}}insertChild(t,e,s){let i=this.parentNode;if(i)if(e>0){let n=this.array[e-1];i[os](t,n.nextSibling)}else i[os](t,this.childNodes[e+1]||this[bt])}moveChild(t,e,s){return this.insertChild(t,e,s)}removeChild(t,e){t.parentNode&&t[br](t.parentNode)}[os](t,e){}[lf](t,e){let s=t[ls](e,this[bt]);return this[br](e),s}[ls](t,e){this[Ro]=t;let s=this.parentNode;if(t!=s){this.parentNode=t;for(let i=0,n=Ao(this.array),o=n.length;i<o;i++)n[i][ls](t,e);this[bt]&&this[bt][ls](t,e)}return this}[br](t){for(let e=0,s=Ao(this.array),i=s.length;e<i;e++){let n=s[e];t[Vo](n)}return this[bt]&&t[Vo](this[bt]),this.parentNode=null}[af](t){var e=this;if(!(this[as]&1)){this[as]|=1;return}if(this.dirty&&(this.changes.forEach(function(s,i){if(s==-1)return e.removeChild(i)}),this.changes.clear(),this.dirty=!1),this.array.length>t)for(;this.array.length>t;){let s=this.array.pop();this.removeChild(s)}}};u(jo,hf,"KeyedTagFragment",16);var uf=jo;function hu(r,t){return new uf(r,t)}function Do(r,t){return typeof t=="string"?typeof r===t:t[Symbol.hasInstance]?.(r)}function cf(r){let t;return r&&((t=r.toIterable)?t.call(r):r)}var hs=Symbol.for("#__init__"),df=Symbol.for("##inited"),ff=Symbol.for("#afterVisit"),mf=Symbol.for("#insertInto"),pf=Symbol.for("#insertIntoDeopt"),gf=Symbol.for("#beforeReconcile"),yf=Symbol.for("#afterReconcile"),Go=Symbol.for("#__hooks__"),Rt=Symbol.for("#autorender"),us=Symbol.for("##visitContext"),Bo=Symbol.for("#domNode"),vf=Symbol(),Sr,Us=new(Sr=class{constructor(r=null){this[hs](r)}[hs](r=null,t=!0,e=!0){var s;this.items=r&&(s=r.items)!==void 0?s:[],this.current=r&&(s=r.current)!==void 0?s:null,this.lastQueued=r&&(s=r.lastQueued)!==void 0?s:null,this.tests=r&&(s=r.tests)!==void 0?s:0}flush(){let r=null;for(;r=this.items.shift();){if(!r.parentNode||r.hydrated\u03A6)continue;let t=this.current;this.current=r,r.__F|=1024;try{r.connectedCallback()}catch(e){console.error(e)}this.current=t}}queue(r){var t=this;let e=this.items.length,s=0,i=this.lastQueued;this.lastQueued=r;let n=D.DOCUMENT_POSITION_PRECEDING,o=D.DOCUMENT_POSITION_FOLLOWING;if(e){let l=this.items.indexOf(i),a=l,h=function(c,m){return t.tests++,c.compareDocumentPosition(m)};(l==-1||i.nodeName!=r.nodeName)&&(a=l=0);let d=this.items[a];for(;d&&h(d,r)&o;)d=this.items[++a];if(a!=l)d?this.items.splice(a,0,r):this.items.push(r);else{for(;d&&h(d,r)&n;)d=this.items[--a];a!=l&&(d?this.items.splice(a+1,0,r):this.items.unshift(r))}}else this.items.push(r),this.current||globalThis.queueMicrotask(this.flush.bind(this))}},u(Sr,vf,null,16),Sr);function uu(){return Us.flush()}var bf=Symbol(),zo=class extends R{constructor(){super(),this.flags$ns&&(this.flag$=this.flagExt$),this.setup$(),this.build()}setup$(){return this.__slots={},this.__F=0}[hs](){return this.__F|=3,this}[df](){if(this[Go])return this[Go].inited(this)}flag$(t){this.className=this.flags$ext=t}build(){return this}awaken(){return this}mount(){return this}remount(){return this.mount(),this}unmount(){return this}rendered(){return this}dehydrate(){return this}hydrate(){return this.autoschedule=!0,this}tick(t,e){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[Rt]||(this[Rt]={});e.value=t,this.mounted\u03A6&&C.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}get scheduler(){return C}schedule(){return C.on("commit",this),this.__F|=128,this}unschedule(){return C.un("commit",this),this.__F&=-129,this}async suspend(t=null){let e=this.flags.incr("@suspended");return this.__F|=4096,Do(t,Function)&&(await t(),this.unsuspend()),this}unsuspend(){return this.flags.decr("@suspended")==0&&(this.__F&=-4097,this.commit()),this}[ff](){if(this.visit(),this[us])return this[us]=null}[mf](t,e=null){if(this.mounted\u03A6&&t.moveBefore)t.moveBefore(this,e);else{let s=(this.__F&32)!=0&&t==this.parentNode;s&&W.moving.add(this),e?t.insertBefore(this,e):t.appendChild(this),s&&W.moving.delete(this)}return this}[pf](t,e){if(this.mounted\u03A6&&t.moveBefore)t.moveBefore(this[Bo]||this,e);else{let s=this[Bo]||this,i=(this.__F&32)!=0&&t==this.parentNode;i&&W.moving.add(this),e?t.insertBefore(s,e):t.appendChild(s),i&&W.moving.delete(this)}return this}[gf](){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&&W.push(this),this[us]&&(this[us]=null),this}[yf](){return globalThis.DEBUG_IMBA&&W.pop(this),this}connectedMoveCallback(){this.remount()}connectedCallback(){let t=this.__F,e=t&1,s=t&8;if(t&16384){this.__F=t&-16385,this.remount();return}if(!e&&!(t&1024)){Us.queue(this);return}if(t&48)return;this.__F|=16,e||this[hs](),t&2||(this.flags$ext=this.className,this.__F|=2,this.hydrate(),this.commit()),s||(this.awaken(),this.__F|=8),ht(this,"mount",[this]);let i=this.mount();return i&&Do(i.then,Function)&&i.then(C.commit),t=this.__F=(this.__F|32)&-17,t&64&&this.schedule(),this[Rt]&&C.schedule(this,this[Rt]),this}disconnectedCallback(){if(!(this.__F&16384)){if(W.moving.size){for(let t of cf(W.moving))if(t?.contains?.(this)){this.__F|=16384;return}}if(this.__F=this.__F&-49,this.__F&128&&this.unschedule(),ht(this,"unmount",[this]),this.unmount(),this[Rt])return C.unschedule(this,this[Rt])}}dataForTagName(t){}};u(zo,bf,"Component",16);var Fe=zo,cu=Fe;function Sf(r,t){return typeof t=="string"?typeof r===t:t[Symbol.hasInstance]?.(r)}var Uo=Symbol.for("#__init__"),xf={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},qo={prefix:1,suffix:1,content:1},xr={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]]},_f=new RegExp("^("+Object.keys(xr).join("|")+")(\\d+(?:\\.\\d+)?)$"),Tf=/^([xyz])$/,wf=/^([tlbr]|size|[whtlbr]|[mps][tlbrxy]?|[rcxy]?[gs])$/,Lf=`*,::before,::after {
box-sizing: border-box;
border-width: 0;
border-style: solid;
border-color: currentColor;
}`,Ef=Symbol(),Ko=class{constructor(t=null){this[Uo](t)}[Uo](t=null,e=!0,s=!0){var i;this.entries=t&&(i=t.entries)!==void 0?i:{}}register(t,e){let s=this.entries[t];s?s&&(s.css=e,s.node&&(s.node.textContent=e)):(s=this.entries[t]={sourceId:t,css:e},this.entries.resets||this.register("resets",Lf))}toString(){return Object.values(this.entries).map(function(t){return t.css}).join(`

`)}toValue(t,e,s,i=null){let n;qo[s]&&(t=String(t));let o=typeof t;if(o=="number"){if(e||(Tf.test(s)?e="px":wf.test(s)?e="u":s=="rotate"&&(e="turn",t=(t%1).toFixed(4))),e)return xf[e]?t+e:e=="u"?t*4+"px":"calc(var(--u_"+e+",1px) * "+t+")"}else if(o=="string"){if(s&&qo[s]&&t[0]!='"'&&t[0]!="'"&&(t.indexOf('"')>=0?t.indexOf("'")==-1&&(t="'"+t+"'"):t='"'+t+'"'),n=t.match(_f)){let l=xr[n[1]][parseInt(n[2])],a="100%";if(typeof i=="number"?a=i+"%":typeof i=="string"&&(a=i),l)return"hsla("+l[0]+","+l[1]+"%,"+l[2]+"%,"+a+")"}}else if(t&&Sf(t.toStyleString,Function))return t.toStyleString();return t}parseDimension(t){if(typeof t=="string"){let[e,s,i]=t.match(/^([-+]?[\d\.]+)(%|\w+)$/);return[parseFloat(s),i]}else if(typeof t=="number")return[t]}};u(Ko,Ef,"Styles",16);var Mf=Ko,Pi=new Mf,du=Object.keys(xr);function fu(){return globalThis.imba.uses_styles=!0,!0}var Nf=Symbol(),Wo=class{css$(t,e,s){return this.style[t]=e}css$var(t,e,s,i,n=null){let o=Pi.toValue(e,s,i,n);this.style.setProperty(t,o)}};u(Wo,Nf,"Element",1,S);var hy=Wo;function kf(r,t){return typeof t=="string"?typeof r===t:t[Symbol.hasInstance]?.(r)}var Yo=Symbol.for("#insertInto"),Xo=Symbol.for("#removeFrom");function mu(r,t={}){let e=E.context;E.context=t;let s=r(t);return E.context==t&&(E.context=e),s}function Ii(r,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(r)}function Hi(r){return r&&r[Xo]&&r.parentNode&&r[Xo](r.parentNode),r}var Qo=globalThis.imba||(globalThis.imba={});Qo.mount=Ii,Qo.unmount=Hi;function et(r,t){return typeof t=="string"?typeof r===t:t[Symbol.hasInstance]?.(r)}function fe(r){let t;return r&&((t=r.toIterable)?t.call(r):r)}var me=Symbol.for("##onchange"),pe=Symbol.for("#afterVisit"),ge=Symbol.for("##oninput"),cs=Symbol.for("##onclick"),ye=Symbol.for("##bound"),St=Symbol.for("##visitContext");function pu(){return globalThis.imba.uses_dom_bind=!0,!0}var Cf={INPUT:!0,SELECT:!0,TEXTAREA:!0,BUTTON:!0},_r=function(r){return et(r,Array)||r&&et(r.has,Function)},Tr=function(r,t){return r==t?!0:et(r,Array)?r.indexOf(t)>=0:r&&et(r.has,Function)?r.has(t):r&&et(r.contains,Function)?r.contains(t):!1},wr=function(r,t){if(et(r,Array))return r.push(t);if(r&&et(r.add,Function))return r.add(t)},Lr=function(r,t){if(et(r,Array)){let e=r.indexOf(t);if(e>=0)return r.splice(e,1)}else if(r&&et(r.delete,Function))return r.delete(t)};function Of(r){function t(){return r[0]?r[0][r[1]]:void 0}function e(s){return r[0]?r[0][r[1]]=s:null}return{get:t,set:e}}var $f=Symbol(),Jo=class{getRichValue(){return this.value}setRichValue(t){return this.value=t}bind$(t,e){let s=e||[];return t=="data"&&!this[ye]&&Cf[this.nodeName]&&(this[ye]=!0,this[me]&&this.addEventListener("change",this[me]=this[me].bind(this)),this[ge]&&this.addEventListener("input",this[ge]=this[ge].bind(this),{capture:!0}),this[cs]&&this.addEventListener("click",this[cs]=this[cs].bind(this),{capture:!0})),Object.defineProperty(this,t,et(s,Array)?Of(s):s),s}};u(Jo,$f,"Element",1,S);var cy=Jo;Object.defineProperty(S.prototype,"richValue",{get:function(){return this.getRichValue()},set:function(r){return this.setRichValue(r)}});var Pf=Symbol(),Zo=class{[me](t){let e=this.data,s=this.$$value;this.$$value=void 0;let i=this.getRichValue();if(this.multiple){if(s)for(let n=0,o=fe(s),l=o.length;n<l;n++){let a=o[n];i.indexOf(a)==-1&&Lr(e,a)}for(let n=0,o=fe(i),l=o.length;n<l;n++){let a=o[n];(!s||s.indexOf(a)==-1)&&wr(e,a)}}else this.data=i[0];return A(),this}getRichValue(){var t;if(this.$$value)return this.$$value;t=[];for(let e=0,s=fe(this.selectedOptions),i=s.length;e<i;e++){let n=s[e];t.push(n.richValue)}return this.$$value=t}syncValue(){let t=this.data;if(this.multiple){let e=[];for(let s=0,i=fe(this.options||[]),n=i.length;s<n;s++){let o=i[s],l=o.richValue,a=Tr(t,l);o.selected=a,a&&e.push(l)}this.$$value=e}else for(let e=0,s=fe(this.options||[]),i=s.length;e<i;e++){let n=s[e].richValue;if(n==t){this.$$value=[n],this.selectedIndex=e;break}}}[pe](){if(this.syncValue(),this[St])return this[St]=null}};u(Zo,Pf,"HTMLSelectElement",1,Rs);var fy=Zo,If=Symbol(),tl=class{setRichValue(t){return this.$$value=t,this.value=t}getRichValue(){return this.$$value!==void 0?this.$$value:this.value}};u(tl,If,"HTMLOptionElement",1,Gs);var py=tl,Hf=Symbol(),el=class{setRichValue(t){return this.$$value=t,this.value=t}getRichValue(){return this.$$value!==void 0?this.$$value:this.value}[ge](t){return this.data=this.value,A()}[pe](){let t=this.data;if(t==null&&(t=""),this[ye]&&this.value!=t&&(this.value=t),this[St])return this[St]=null}};u(el,Hf,"HTMLTextAreaElement",1,js);var yy=el,Ff=Symbol(),sl=class{[ge](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,A()}[me](t){let e=this.data,s=this.richValue;if(this.type=="checkbox"||this.type=="radio"){let i=this.checked;_r(e)?i?wr(e,s):Lr(e,s):this.data=i?s:!1}return A()}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 s=this.valueAsNumber;Number.isNaN(s)&&(s=Number(t.replace(/\,/,".")+0)),Number.isNaN(s)&&(s=null),t=s}else e=="checkbox"&&(t==null||t==="on")&&(t=!0);return t}[pe](){if(this[ye]){let t=this.type;if(t=="checkbox"||t=="radio"){let e=this.data;e===!0||e===!1||e==null?this.checked=!!e:this.checked=Tr(e,this.richValue)}else this.richValue=this.data}this[St]&&(this[St]=null)}};u(sl,Ff,"HTMLInputElement",1,Vs);var by=sl,Af=Symbol(),rl=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}[cs](t){let e=this.data,s=this.checked,i=this.richValue;return _r(e)?s?Lr(e,i):wr(e,i):this.$$value==null?this.data=!s:this.data=s?null:i,this[pe](),A()}[pe](){if(this[ye]){let t=this.data,e=this.$$value==null?!0:this.$$value;_r(t)?this.checked=Tr(t,e):this.checked=t==e}this[St]&&(this[St]=null)}};u(rl,Af,"HTMLButtonElement",1,Ds);var xy=rl;function Rf(r,t){return typeof t=="string"?typeof r===t:t[Symbol.hasInstance]?.(r)}function il(r){let t;return r&&((t=r.toIterable)?t.call(r):r)}var Vf=Symbol.for("#getSlot"),jf=Symbol.for("#container"),Df=Symbol.for("#afterVisit"),ve=Symbol.for("#__init__"),ds=Symbol.for("#listeners"),st=Symbol.for("#slot"),Gf=Symbol.for("#parent"),j=Symbol.for("##container"),Er=Symbol.for("#domTarget"),nl=Symbol.for("#insertInto"),Bf=Symbol.for("#removeFrom"),zf=Symbol.for("#teleport"),Uf=Symbol.for("#self"),qf=Symbol.for("#target"),Kf=Symbol(),ol=class extends Fe{constructor(){super(...arguments),super[ve]||this[ve]()}[ve](t=null,e=!0,s=!0){e&&super[ve]&&super[ve](...arguments),this.to=t?t.to:void 0}build(){return this[ds]=[],this.win=globalThis,this.doc=globalThis.document}setup(){return this.setAttribute("style","display:none !important;")}[Vf](t,e){return this[st]||(this[st]=He(0,this[Gf])),this[st]}get[jf](){if(!this[j]){let t=this.className;this[j]=this.doc.createElement("div"),this[j].className=t,this[j].style.cssText="display:contents !important;"}return this[j]}get domTarget(){return this[Er]||(this[Er]=Rf(this.to,S)?this.to:this.closest(this.to)||this.doc.querySelector(this.to))}get eventTarget(){return this.domTarget}get style(){return this[j]?this[j].style:super.style}get classList(){return this[j]?this[j].classList:super.classList}get className(){return this[j]?this[j].className:super.className}set className(t){this[j]?this[j].className=t:super.className=t}[Df](){if(this.mounted\u03A6&&this[st]&&!this[st].parentNode)return this[st][nl](this.target)}mount(){for(let e=0,s=il(this[ds]),i=s.length;e<i;e++){let[n,o,l]=s[e];this.eventTarget.addEventListener(n,o,l)}let t=this.domTarget;return this[st]&&this[st][nl](t),this}unmount(){for(let t=0,e=il(this[ds]),s=e.length;t<s;t++){let[i,n,o]=e[t];this.eventTarget.removeEventListener(i,n,o)}return this[st]&&this[st][Bf](this.domTarget),this[Er]=null,this}addEventListener(t,e,s={}){if(e[zf]=this,e[Uf]=this,this[ds].push([t,e,s]),this.mounted\u03A6&&this.eventTarget?.addEventListener)return this.eventTarget.addEventListener(t,e,s)}};u(ol,Kf,"TeleportHook",24);var ll=ol,Wf=Symbol(),al=class extends ll{get domTarget(){return this.doc.body}get eventTarget(){return this.win}addEventListener(t,e,s={}){return e[qf]=this.domTarget.parentNode,super.addEventListener(...arguments)}on$resize(t,e,s,i){return this.addEventListener("resize",s,i),s}};u(al,Wf,"GlobalHook",8);var Yf=al;globalThis.customElements&&(globalThis.customElements.define("i-teleport",ll),globalThis.customElements.define("i-global",Yf));function gu(){return globalThis.imba.uses_dom_teleport=!0,!0}function J(r){let t;return r&&((t=r.toIterable)?t.call(r):r)}function Xf(r,t){return typeof t=="string"?typeof r===t:t[Symbol.hasInstance]?.(r)}var rt=Symbol.for("#__init__"),hl=Symbol.for("#imba"),fs=Symbol.for("#insertInto"),ms=Symbol.for("#removeFrom"),Qf=Symbol.for("#all"),be=Symbol.for("#phase"),it=Symbol.for("#nodes"),Jf=Symbol.for("#sizes"),Vt=Symbol.for("#linked"),ul=Symbol.for("#mode"),cl=Symbol.for("#enabled"),Zf=Symbol.for("#easer"),jt=Symbol.for("#group"),Mr=Symbol.for("#_easer_"),Nr=Symbol(),tm=Symbol(),dl=class extends Ne{constructor(){super(...arguments),super[rt]||this[rt]()}[rt](t=null,e=!0,s=!0){var i;e&&super[rt]&&super[rt](...arguments),this.selectors=t&&(i=t.selectors)!==void 0?i:{}}addSelectors(t,e){var s;return((s=this.selectors)[e]||(s[e]=[])).push(...t),!0}getSelectors(...t){let e=[];for(let s=0,i=J(t),n=i.length;s<n;s++){let o=i[s];this.selectors[o]&&e.push(...this.selectors[o])}return e&&e.length?e.join(","):null}nodesForBase(t,e="transition"){let s=[t],i=(this.selectors[e]||[]).join(",");if(i=="")return s;let n=t.querySelectorAll(i);for(let o=0,l=J(n),a=l.length;o<a;o++){let h=l[o];h.closest("._ease_")==t&&s.push(h)}return s[Qf]=n,s}nodesWithSize(t,e="in"){let s=this.getSelectors("_off_sized","_"+e+"_sized");return s?t.filter(function(i){return i.matches(s)}):[]}};u(dl,tm,"Transitions",16);var em=dl,Ae=new em,sm=globalThis.imba||(globalThis.imba={});sm.transitions=Ae;var rm=Symbol(),fl=class extends Ne{[rt](t=null,e=!0,s=!0){var i;e&&super[rt]&&super[rt](...arguments),this.flushing\u03A6=t&&(i=t.flushing\u03A6)!==void 0?i:!1,this.mutations=t&&(i=t.mutations)!==void 0?i:[]}constructor(t){super(),super[rt]||this[rt](),this.callback=t}insert(t,e,s){return this.mutations.push({target:t,addedNodes:[e],removedNodes:[],nextSibling:s})}remove(t,e){return this.mutations.push({target:t,addedNodes:[],removedNodes:[e]})}flush(){let t=this.mutations.slice(0);if(!t.length)return this;this.mutations=[],Xf(this.callback,Function)&&this.callback(t),this.emit("start",this,t),this.flushing\u03A6=!0;for(let e of J(t)){for(let s of J(e.addedNodes))s[fs](e.target,e.nextSibling);for(let s of J(e.removedNodes))s[ms](e.target)}return this.flushing\u03A6=!1,this.emit("end",this,t)}};u(fl,rm,"EaseGroup",16);var yu=fl,im=Symbol(),ml=class extends Ne{constructor(t){super(),this.dom=t,this[be]=null,this[it]=[],this[Jf]=new Map}log(...t){}get flags(){return this.dom.flags}link(t){return this[Vt]||(this[Vt]=new Set),this[Vt].add(t)}unlink(t){return this[Vt].delete(t)}flag(t){for(let e=0,s=J(this[it]),i=s.length;e<i;e++)s[e].flags.add(t);return this}unflag(t){for(let e=0,s=J(this[it]),i=s.length;e<i;e++)s[e].flags.remove(t);return this}commit(){return this.dom.offsetWidth}enable(t){return t&&(this[ul]=t),this[cl]!=!0&&(this[cl]=!0,!0)?(this.dom[fs]=this[fs].bind(this),this.dom[ms]=this[ms].bind(this),this.flags.add("_ease_")):this}disable(){return this.flags.remove("_ease_"),!0}supports\u039Esize\u039Ekeywords(){var t=ai(this);return t[Nr]??(t[Nr]={support:CSS.supports("interpolate-size","allow-keywords")&&globalThis.window.getComputedStyle(globalThis.document.body)["interpolate-size"]=="allow-keywords"}),t[Nr].support}set phase(t){let e=this[be];this[be]!=t&&(this[be]=t,!0)&&(e&&this.unflag("@"+e),t&&this.flag("@"+t),t?this.flags.add("_easing_"):this.flags.remove("_easing_"),t||(this.unflag("@out"),this.unflag("@in"),this.unflag("@off"),this[it]=null),t=="enter"&&e=="leave"&&(this.dom?.emit?.("outcancel"),this.dom?.transition\u039Eout\u039Ecancel?.(this)),t=="leave"&&e=="enter"&&(this.dom?.emit?.("incancel"),this.dom?.transition\u039Ein\u039Ecancel?.(this)),t=="enter"&&(this.dom?.emit?.("in"),this.dom?.transition\u039Ein?.(this)),t=="leave"&&(this.dom?.emit?.("out"),this.dom?.transition\u039Eout?.(this)),e=="leave"&&!t&&(this.dom?.emit?.("outend"),this.dom?.transition\u039Eout\u039Eend?.(this)),e=="enter"&&!t&&(this.dom?.emit?.("inend"),this.dom?.transition\u039Ein\u039Eend?.(this)))}get phase(){return this[be]}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 s={before:Qt().getAnimations()};return this.commit(),t(),this.commit(),s.after=Qt().getAnimations(),s.fresh=s.after.filter(function(i){return s.before.indexOf(i)==-1}),s.deep=s.fresh.filter(function(i){let n;return!!((n=i.effect.target)&&n.closest("._ease_")!=e.dom)}),s.own=s.fresh.filter(function(i){return s.deep.indexOf(i)==-1}),s.own.length?s.finished=new Promise(function(i){let n=new Set(s.own),o=function(){if(n.delete(this),n.size==0)return i()};for(let l=0,a=J(s.own),h=a.length;l<h;l++){let d=a[l];d[Zf]=e,d.addEventListener("finish",o,{once:!0}),d.addEventListener("cancel",o,{once:!0})}}):s.finished=Promise.resolve(!0),s}getAnimatedNodes(){let t=Ae.nodesForBase(this.dom);return this[Vt]&&(t=t.concat(Array.from(this[Vt]))),t}getNodeSizes(t="in",e=this[it]){let s=Ae.nodesWithSize(e,t),i=new Map;for(let n=0,o=J(s),l=o.length;n<l;n++){let a=o[n],h=(this&&this[hl]||globalThis[hl]).window.getComputedStyle(a);i.set(a,{width:h.width,height:h.height})}return i}applyNodeSizes(t){for(let[e,s]of J(t))e.style.width=s.width,e.style.height=s.height;return t}clearNodeSizes(t){if(t){for(let[e,s]of J(t))e.style.removeProperty("width"),e.style.removeProperty("height");return t}}[fs](t,e){var s=this;if(this[jt]&&!this[jt].flushing\u03A6)return this[jt].insert(t,this.dom,e),this.dom;let i;if(this.entering\u03A6)return this.dom;let n=function(){if(i&&s.clearNodeSizes(i),s.entering\u03A6)return s.phase=null};if(this.leaving\u03A6)return this.track(function(){return s.phase="enter",s.unflag("@off"),s.unflag("@out")}).finished.then(n,function(l){return s.log("error cancel leave",l)}),this.dom;let o=Qt().contains(t);return e?this.dom.nextSibling!=e&&t.insertBefore(this.dom,e):this.dom.parentNode!=t&&t.appendChild(this.dom),this[it]=this.getAnimatedNodes(),this.flag("_instant_"),this.unflag("@out"),this.commit(),this.supports\u039Esize\u039Ekeywords()||(i=this[it].sized=this.getNodeSizes("in")),this.dom?.transition\u039Ein\u039Einit?.(this),this.flag("@off"),this.flag("@in"),this.flag("@enter"),this.commit(),this.unflag("_instant_"),this.track(function(){return s.phase="enter",i&&s.applyNodeSizes(i),s.unflag("@off"),s.unflag("@in")}).finished.then(n,function(l){return i&&s.clearNodeSizes(i),s.log("cancelled insert into",l)}),this.dom}[ms](t){var e=this;if(this[jt]&&!this[jt].flushing\u03A6){this[jt].remove(t,this.dom);return}if(this.leaving\u03A6)return;let s,i=function(){if(e.phase=="leave")return e.dom.emit("easeoutend",{}),t.removeChild(e.dom),e.phase=null};if(this.entering\u03A6&&this[ul]!="forward"){let o=this.track(function(){if(e.flag("@off"),e.flag("@in"),e.unflag("@out"),e.phase="leave",e[it].sized)return e.clearNodeSizes(e[it].sized)});this.log("cancel enter anims own",o.own,o),o.finished.then(i,function(l){return e.log("error cancel entering",l)});return}this[it]=this.getAnimatedNodes(),this.supports\u039Esize\u039Ekeywords()||(s=this.getNodeSizes("out"),this.applyNodeSizes(s)),this.flag("@leave");let n=this.track(function(){if(e.phase="leave",e.flag("@off"),e.flag("@out"),s)return e.clearNodeSizes(s)});if(!n.own.length){i();return}n.finished.then(i,function(){return!0})}};u(ml,im,"Easer",16);var Fi=ml,nm=Symbol(),pl=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[Mr]||(this[Mr]=new Fi(this))}set ease(t){if(t==!1){this[Mr]?.disable?.();return}this.ease.enable(t)}};u(pl,nm,"Element",1,S);var Ny=pl;function vu(){return globalThis.imba.uses_dom_transitions=!0,!0}function Ai(){return globalThis.imba.uses_events_keyboard=!0,!0}var om=Symbol(),gl=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}\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}};u(gl,om,"KeyboardEvent",1,Ci);var Cy=gl;function qs(){return globalThis.imba.uses_events_mouse=!0,!0}var lm=Symbol(),yl=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}};u(yl,lm,"MouseEvent",1,Bs);var $y=yl;function nt(r,t){return typeof t=="string"?typeof r===t:t[Symbol.hasInstance]?.(r)}function kr(r){let t;return r&&((t=r.toIterable)?t.call(r):r)}var am=Symbol.for("#extendType"),hm=Symbol.for("#modifierState"),ps=Symbol.for("#sharedModifierState"),vl=Symbol.for("#onceHandlerEnd"),bl=Symbol.for("#extendDescriptors"),N=Symbol.for("#context"),gs=Symbol.for("#defaultPrevented"),Cr=Symbol.for("#stopPropagation"),Sl=Symbol.for("#self"),um=Symbol.for("#target"),cm=Symbol.for("#teleport");Ai(),qs();var dm=Symbol(),xl=class{[am](t){var e,s;let i=t[bl]||(t[bl]=(e=Object.getOwnPropertyDescriptors(t.prototype),s=e.constructor,delete e.constructor,e));return Object.defineProperties(this,i)}};u(xl,dm,"CustomEvent",1,G);var Iy=xl,fm=Symbol(),_l=class{get original(){return this.originalEvent||this}get[hm](){var t,e;return(t=this[N])[e=this[N].step]||(t[e]={})}get[ps](){var t,e;return(t=this[N].handler)[e=this[N].step]||(t[e]={})}[vl](t){return F(this[N],"end",t)}\u03B1sel(t){return!!this.target.matches(String(t))}\u03B1closest(t){return!!this.target.closest(String(t))}\u03B1prevent(){return this[gs]=!0,this.preventDefault(),!0}\u03B1trap(){return this[Cr]=!0,this.stopImmediatePropagation(),this[gs]=!0,this.preventDefault(),!0}\u03B1focin(t){let e=this[N].element;return e=nt(t,S)?t:t?e.closest(t):e,e?.contains?.(globalThis.document.activeElement)}\u03B1log(...t){return console.info(...t),!0}\u03B1trusted(){return!!this.isTrusted}\u03B1untrusted(){return!this.isTrusted}\u03B1if(t){return!!t}\u03B1wait(t=250){return new Promise(function(e){return setTimeout(e,Wt(t))})}\u03B1self(){return this.target==this[N].element}\u03B1cooldown(t=250){let e=this[ps];return e.active?!1:(e.active=!0,e.target=this[N].element,e.target.flags.incr("cooldown"),this[vl](function(){return setTimeout(function(){return e.target.flags.decr("cooldown"),e.active=!1},Wt(t))}),!0)}\u03B1throttle(t=250,e="throttled"){let s=this[ps];return s.active?(s.next&&s.next(!1),new Promise(function(i){return s.next=function(n){return s.next=null,i(n)}})):(s.active=!0,s.el||(s.el=this[N].element),e&&s.el.flags.incr(e),F(this[N],"end",function(){let i=Wt(t);return s.interval=setInterval(function(){s.next?s.next(!0):(clearInterval(s.interval),e&&s.el.flags.decr(e),s.active=!1)},i)}),!0)}\u03B1debounce(t=250){let e=this[ps],s=this;return e.queue||(e.queue=[]),e.queue.push(e.last=s),new Promise(function(i){return setTimeout(function(){return e.last==s?(s.debounced=e.queue,e.last=null,e.queue=[],i(!0)):i(!1)},Wt(t))})}\u03B1flag(t,e){let{element:s,step:i,state:n,id:o,current:l}=this[N],a=nt(e,S)?e:e?s.closest(e):s;if(!a)return!0;this[N].commit=!0,n[i]=o,a.flags.incr(t);let h=Date.now();return F(l,"end",function(){let d=Date.now()-h,c=Math.max(250-d,0);return setTimeout(function(){return a.flags.decr(t)},c)}),!0}\u03B1busy(t){return this.\u03B1flag("busy",t)}\u03B1outside(){let{handler:t}=this[N];if(t&&t[Sl])return!t[Sl].parentNode.contains(this.target)}async \u03B1post(t,e={}){return await globalThis.fetch(t,{method:"POST",...e})}async \u03B1fetch(t,e={}){return await globalThis.fetch(t,e)}};u(_l,fm,"Event",1,Y);var Fy=_l,mm=Symbol(),Tl=class{\u03B1self(){let t=this[N].element;return this.type=="focusout"?this.relatedTarget&&!t.contains(this.relatedTarget):this.type=="focusin"?!this.relatedTarget||!t.contains(this.relatedTarget):this.target==t}};u(Tl,mm,"FocusEvent",1,Ni);var Ry=Tl,bu={};function Su(){return globalThis.imba.uses_events=!0,!0}var pm=Symbol(),wl=class{constructor(t,e){this.params=t,this.closure=e}getHandlerForMethod(t,e){return t?t[e]?t:this.getHandlerForMethod(t.parentNode,e):null}abortCurrentHandlers(){if(this.currentEvents)for(let t of kr(this.currentEvents))t.aborted=!0,t?.resolver?.(!0);return this}emit(t,...e){return ht(this,t,e)}on(t,...e){return at(this,t,...e)}once(t,...e){return F(this,t,...e)}un(t,...e){return Yt(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){if(this.disabled)return;let e=this[um]||t.currentTarget,s=this.params,i=null,n=s.silence||s.silent;this.count||(this.count=0),this.state||(this.state={});let o=this.lastState={element:e,event:t,modifiers:s,handler:this,id:++this.count,step:-1,state:this.state,commit:null,called:!1,current:null,aborted:!1};if(o.current=o,t.handle$mod&&t.handle$mod.apply(o,s.options||[])==!1)return;let l=Y[this.type+"$handle"]||Y[t.type+"$handle"]||this.guard;if(!(l&&l.apply(o,s.options||[])==!1)){this.currentEvents||(this.currentEvents=new Set),this.currentEvents.add(o);for(let a=0,h=Object.keys(s),d=h.length,c,m;a<d&&(c=h[a],m=s[c],!o.aborted);a++){if(o.step++,c[0]=="_")continue;c.indexOf("~")>0&&(c=c.split("~")[0]);let g=null,f=[t,o],p,y=null,w,O=!1,gt=typeof c=="string";if(c[0]=="$"&&c[1]=="_"&&nt(m[0],Function))t[N]=o,c=m[0],o.called=!0,c.passive||(o.commit=!0),f=[t,o].concat(m.slice(1)),y=e;else if(nt(m,Array)){f=m.slice(),g=f;for(let L=0,$=kr(f),Ve=$.length;L<Ve;L++){let ee=$[L];if(typeof ee=="string"&&ee[0]=="~"&&ee[1]=="$"){let zi=ee.slice(2).split("."),je=o[zi.shift()]||t;for(let Js=0,Ui=kr(zi),sc=Ui.length;Js<sc;Js++){let rc=Ui[Js];je=je?je[rc]:void 0}f[L]=je}}}if(typeof c=="string"&&(w=c.match(/^(emit|flag|mod|moved|pin|fit|refit|map|remap|css)-(.+)$/))&&(g||(g=f=[]),f.unshift(w[2]),c=w[1]),c=="trap")t[Cr]=!0,t.stopImmediatePropagation(),t[gs]=!0,t.preventDefault();else if(c=="stop")t[Cr]=!0,t.stopImmediatePropagation();else if(c=="prevent")t[gs]=!0,t.preventDefault();else if(c=="commit")o.commit=!0;else if(c=="once")e.removeEventListener(t.type,this);else{if(c=="options"||c=="silence"||c=="silent")continue;if(c=="emit"){let L=f[0],$=f[1];o.called=!0;let Ve=new G(L,{bubbles:!0,detail:$});Ve.originalEvent=t;let ee=(this[cm]||e).dispatchEvent(Ve)}else if(typeof c=="string"){c[0]=="!"&&(O=!0,c=c.slice(1));let L="\u03B1"+c,$=t[L];$||($=this.type&&Y[this.type+"$"+c+"$mod"]),$||($=t[c+"$mod"]||Y[t.type+"$"+c]||Y[c+"$mod"]),nt($,Function)?(c=$,y=o,f=g||[],t[L]&&(y=t,t[N]=o)):c[0]=="_"?(c=c.slice(1),y=this.closure):y=this.getHandlerForMethod(e,c)}}try{nt(c,Function)?p=c.apply(y||e,f):y&&(p=y[c].apply(y,f)),p&&nt(p.then,Function)&&p!=C.$promise&&(o.commit&&!n&&C.commit(),p=await p)}catch(L){i=L;break}if(O&&p===!0||!O&&p===!1)break;o.value=p}if(ht(o,"end",o),o.commit&&!n&&C.commit(),this.currentEvents.delete(o),this.currentEvents.size==0&&this.emit("idle"),i!=null){if(this.type!="error"){let a=nt(i,Error)?i.message:i,h=new G("error",{detail:a,bubbles:!0,cancelable:!0});h.error=i,h.originalEvent=t;let d=e.dispatchEvent(h);if(h.defaultPrevented)return}throw i}return o}}};u(wl,pm,"EventHandler",16);var Ks=wl,gm=Symbol(),Ll=class{on$(t,e,s){let i="on$"+t,n=e.capture||!1,o=e.passive,l,a=n;return o&&(a={passive:o,capture:n}),nt(this[i],Function)?(this[i].length>2&&(l=new Ks(e,s)),l=this[i](e,s,l,a)):(l=new Ks(e,s),this.addEventListener(t,l,a)),l}on$error(t,e,s,i){return t.options?.length&&(s.guard=function(...n){let o=this.event.error;return!!n.find(function(l){return nt(o,l)})}),this.addEventListener("error",s,i),s}};u(Ll,gm,"Element",1,S);var Dy=Ll;function ym(r,t){return typeof t=="string"?typeof r===t:t[Symbol.hasInstance]?.(r)}var vm=Symbol(),Or,El=new(Or=class{get ios\u03A6(){let r=globalThis.navigator.platform||"";return!!(r.match(/iPhone|iPod|iPad/)||r=="MacIntel"&&globalThis.navigator.maxTouchPoints>2)}},u(Or,vm,null,0),Or);function $r(r,t){let e=t;return ym(r,Element)?r:typeof r=="string"?r=="this"||r==""?e:r=="up"?e.parentNode:r=="op"?e.offsetParent:e.closest(r)||e.querySelector(r)||globalThis.document.querySelector(r):null}function Dt(r){if(typeof r=="string"){let[t,e,s]=r.match(/^([-+]?[\d\.]+)(%|\w+)$/);return[parseFloat(e),s]}else if(typeof r=="number")return[r]}function Pr(r,t=1){let e=1/t;return Math.round(r*e)/e}function bm(r,t,e){return t>e?Math.max(e,Math.min(t,r)):Math.min(e,Math.max(t,r))}function Ml(r,t,e,s,i=.1){let[n,o]=Dt(e),[l,a]=Dt(s),[h,d]=Dt(i);return o=="%"&&(n=(t-r)*(n/100)),a=="%"&&(l=(t-r)*(l/100)),d=="%"&&(h=(l-n)*(h/100)),function(c,m){let g=(c-r)/(t-r),f=n+(l-n)*g;return i&&(f=Pr(f,h)),m&&(f=bm(f,n,l)),f}}qs();function xu(){return globalThis.imba.uses_events_pointer=!0,!0}var Sm=Symbol(),Nl=class{\u03B1primary(){return!!this.isPrimary&&(this.pointerType!="mouse"||this.button==0)}\u03B1secondary(){return!this.isPrimary&&this.button!=0}\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}};u(Nl,Sm,"PointerEvent",1,ki);var By=Nl;function Gt(r,t){return typeof t=="string"?typeof r===t:t[Symbol.hasInstance]?.(r)}var kl=Symbol.for("#capture"),ot=Symbol.for("#step"),xm=Symbol.for("#cancel"),Ir=Symbol.for("#reframe"),Cl=Symbol.for("#mods"),Hr=Symbol.for("#dx"),Fr=Symbol.for("#dy"),xt=Symbol.for("#context"),ys=Symbol.for("#locked"),Ol=Symbol.for("#teardown"),$l=Symbol.for("#x"),Pl=Symbol.for("#y"),_m=Symbol.for("#pinTarget");function _u(){return globalThis.imba.uses_events_touch=!0,!0}var Il=null,Tm=Symbol(),Hl=class{constructor(t,e,s){this.phase="init",this.events=[],this.originalEvent=t,this.handler=e,this.target=this.currentTarget=s,this[Cl]={}}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[Hr]==null?this.event.x-this.start.x:this[Hr]}get dy(){return this[Fr]==null?this.event.y-this.start.y:this[Fr]}get dr(){return Math.sqrt(this.dx*this.dx+this.dy*this.dy)}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 ht(this,t,e)}on(t,...e){return at(this,t,...e)}once(t,...e){return F(this,t,...e)}un(t,...e){return Yt(this,t,...e)}\u03B1flag(t,e){let{element:s}=this[xt],i=Date.now(),n=Gt(e,S)?e:e?s.closest(e):s;return this[ot].setup!=!0&&(this[ot].setup=!0,!0)&&(n.flags.incr(t),F(this,"end",function(){return n.flags.decr(t)})),!0}\u03B1lock(){return this[kl](),!0}[kl](){if(this[ys]!=!0&&(this[ys]=!0,!0))return this[xt].element.setPointerCapture(this.pointerId)}get[ot](){var t,e;return(t=this[Cl])[e=this[xt].step]||(t[e]={})}[xm](){return this[Ol]()}\u03B1moved(t,e){let s=this[ot],{element:i,state:n,event:o}=this[xt];if(!s.setup){let c=t||4;typeof t=="string"&&t.match(/^(up|down|left|right|x|y)$/)&&(s.dir=t,c=e||4),typeof e=="string"&&e.match(/^(up|down|left|right|x|y)$/)&&(s.dir=e),s.setup=!0;let[m,g]=Dt(c);s.threshold=m,s.sy=m,s.x0=this.x,s.y0=this.y,s.dir||(s.dir="dist"),s.x=s.left=s.right=s.y=s.up=s.down=s.dist=0,g&&g!="px"&&console.warn("only px threshold allowed in @touch.moved")}if(s.active)return!0;if(s.cancelled)return!1;let l=s.threshold,a=this.x-s.x0,h=this.y-s.y0;s.x=Math.max(s.x,Math.abs(a)),s.y=Math.max(s.y,Math.abs(h)),s.left=Math.max(s.left,-a),s.right=Math.max(s.right,a),s.up=Math.max(s.up,-h),s.down=Math.max(s.down,h),s.dist=Math.max(s.dist,Math.sqrt(a*a+h*h));let d=s[s.dir];if(d>l&&d>=s.x&&d>=s.y){s.active=!0;let c=n.pinTarget;return i.flags.incr("@move"),c&&c.flags.incr("@move"),this.preventDefault(),F(this,"end",function(){return c&&c.flags.decr("@move"),i.flags.decr("@move")}),!0}else if(s.x>l||s.y>l)return s.cancelled=!0,!1;return!1}\u03B1hold(t=250){var e=this;let s=this[ot],i=this[xt].element;if(s.cancelled)return!1;if(s.setup&&!s.active){let n=this.clientX,o=this.clientY,l=n-s.x,a=o-s.y;Math.sqrt(l*l+a*a)>5&&!s.cancelled&&(clearTimeout(s.timeout),s.cancelled=!0)}if(s.setup!=!0&&(s.setup=!0,!0)){s.active=!1,s.x=this.clientX,s.y=this.clientY;let n;return s.timeout=setTimeout(function(){return s.active=!0,e.preventDefault(),i.flags.incr("@hold"),n&&n(!0),n=null},t),F(this,"end",function(){return s.active&&i.flags.decr("@hold"),clearTimeout(s.timeout),n&&n(!1),n=null}),new Promise(function(o){return n=o})}return s.active}\u03B1sync(t,e="x",s="y"){let i=this[ot];return i.setup!=!0&&(i.setup=!0,!0)?(i.x=t[e]||0,i.y=t[s]||0,i.tx=this.x,i.ty=this.y):(e&&(t[e]=i.x+(this.x-i.tx)),s&&(t[s]=i.y+(this.y-i.ty))),this[xt].commit=!0,!0}\u03B1apply(t,e="x",s="y"){return e&&(t[e]=this.x),s&&(t[s]=this.y),this[xt].commit=!0,!0}\u03B1css(t="x",e="y"){let s=this[ot];if(s.setup!=!0&&(s.setup=!0,!0))s.el=this[xt].element,s.x=s.el[$l]||0,s.y=s.el[Pl]||0,s.tx=this.x,s.ty=this.y;else{let i=s.el[$l]=s.x+(this.x-s.tx),n=s.el[Pl]=s.y+(this.y-s.ty);t&&s.el.style.setProperty("--x",i+"px"),e&&s.el.style.setProperty("--y",n+"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&&(this.pointerType!="mouse"||this.originalEvent.button==0)}\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=Pr(this.x,t),this.y=Pr(this.y,e),!0}[Ir](...t){let e=this[ot];if(e.setup!=!0&&(e.setup=!0,!0)){let s=this.target,i=t.length,n=t[0],o=0,l="100%",a=0,h=typeof n;h=="number"||h=="string"&&/^([-+]?\d[\d\.]*)(%|\w+)$/.test(n)||Gt(n,Array)?n=null:h=="string"&&(n=="this"||n==""?n=s:n=="up"?n=s.parentNode:n=="op"?n=s.offsetParent:n=s.closest(n)||s.querySelector(n)),n==null&&(i++,t.unshift(n=s)),i==2?a=t[1]:i>2&&([o,l,a=0]=t.slice(1));let d=n.getBoundingClientRect();Gt(o,Array)||(o=[o,o]),Gt(l,Array)||(l=[l,l]),Gt(a,Array)||(a=[a,a]),e.rect=d,e.x=Ml(d.left,d.right,o[0],l[0],a[0]),e.y=Ml(d.top,d.bottom,o[1],l[1],a[1]),this.x0=this.x=e.x(this.x,e.clamp),this.y0=this.y=e.y(this.y,e.clamp)}else{let s=this.x=e.x(this.x,e.clamp),i=this.y=e.y(this.y,e.clamp);this[Hr]=s-this.x0,this[Fr]=i-this.y0}return!0}\u03B1fit(...t){return this[ot].clamp=!0,this[Ir](...t)}\u03B1reframe(...t){return this[Ir](...t)}\u03B1pin(...t){let e=this[ot];if(e.setup!=!0&&(e.setup=!0,!0)){let s=$r(t[0],this.target);Gt(s,S)||t.unshift(s=this.target);let i=t[1]||0,n=t[2]??(t[2]=i),o=s.getBoundingClientRect();e.x=this.clientX-(o.left+o.width*i),e.y=this.clientY-(o.top+o.height*n),s&&(this[_m]=s,s.flags.incr("_touch_"),F(this,"end",function(){return s.flags.decr("_touch_")}))}return this.x-=e.x,this.y-=e.y,!0}};u(Hl,Tm,"Touch",16);var Ri=Hl,wm=Symbol(),Fl=class{on$touch(t,e,s,i){return s.type="touch",this.addEventListener("pointerdown",s,{passive:!1}),El.ios\u03A6&&globalThis.parent!=globalThis&&Il!=!0&&(Il=!0,!0)&&globalThis.parent.postMessage("setupTouchFix"),s}};u(Fl,wm,"Element",1,S);var qy=Fl;Y.touch$handle=function(){let r=this.event,t=this.element,e=this.state.pointerId,s=this.modifiers,i=this.handler,n=El.ios\u03A6;if(this.current=this.state,e!=null)return e==r.pointerId;if(s.ctrl&&!r.ctrlKey||s.alt&&!r.altKey||s.meta&&!r.metaKey||s.shift&&!r.shiftKey||s.if&&!s.if[0]||s.self&&r.target!=t||s.primary&&!r.isPrimary||s.pen&&r.pointerType!="pen"||s.mouse&&r.pointerType!="mouse"||s.touch&&r.pointerType!="touch"||s.sel&&!r.target.matches(String(s.sel[0]))||s["!sel"]&&r.target.matches(String(s["!sel"][0])))return;let o=this.state=i.state=this.current=new Ri(r,i,t);e=o.pointerId;let l=function(f){return f.preventDefault(),!1},a=null,h=Symbol(),d=function(f){let p=o.clientX,y=o.clientY,w=f.clientX,O=f.clientY;(o[ys]||o.defaultPrevented)&&(f.pointerId==o.pointerId||p==w&&y==O)&&(f.preventDefault(),f.stopPropagation()),d&&(globalThis.removeEventListener("click",d,{capture:!0}),d=null)},c=function(f){if(!(o.type=="touchmove"&&f.changedTouches[0].identifier!=e)&&(o.defaultPrevented||o[ys]))return f.preventDefault()},m=function(f){let p=f.type,y=o.phase;if(f.pointerId&&o.pointerId!=f.pointerId||f[h])return;f[h]=!0;let w=p=="pointerup"||p=="pointercancel";if(f.pressure==0&&f.pointerType=="mouse"&&p=="pointermove"&&o.originalEvent.pressure>0)return a(f);p=="pointercancel"?(o.x=o.clientX,o.y=o.clientY):(o.x=f.clientX,o.y=f.clientY),o.event=f,w&&(o.phase="ended");try{i.handleEvent(o)}catch{}if(y=="init"&&!w&&(o.phase="active"),w&&a)return a(f)},g=!1;return a=function(f){if(!g&&(g=!0,t.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&&t.style.removeProperty("touch-action"),i.state={},globalThis.removeEventListener("pointermove",m,{passive:!!s.passive}),globalThis.removeEventListener("pointerup",m),globalThis.removeEventListener("pointercancel",m),setTimeout(function(){if(d&&(globalThis.removeEventListener("click",d,{capture:!0}),d=null),n&&c)return globalThis.removeEventListener("touchend",c),globalThis.removeEventListener("touchmove",c,{passive:!1}),c=null},100),!s.passive))return globalThis.document.removeEventListener("selectstart",l,{capture:!0})},o[Ol]=a,s.passive||(i.prevents||(i.prevents=0),i.prevents++,t.style.setProperty("touch-action","none"),t.offsetWidth),t.flags.incr("_touch_"),globalThis.addEventListener("pointermove",m,{passive:!!s.passive}),globalThis.addEventListener("pointerup",m),globalThis.addEventListener("pointercancel",m),globalThis.addEventListener("click",d,{capture:!0}),n&&!s.passive&&(globalThis.addEventListener("touchend",c),globalThis.addEventListener("touchmove",c,{passive:!1})),s.passive||globalThis.document.addEventListener("selectstart",l,{capture:!0}),m(r),!1};function Lm(r){let t;return r&&((t=r.toIterable)?t.call(r):r)}function Ky(r,t){return typeof t=="string"?typeof r===t:t[Symbol.hasInstance]?.(r)}var Em=Symbol.for("#context"),Mm=Symbol.for("#extendType");function Tu(){return globalThis.imba.uses_events_intersect=!0,!0}var Al=new(globalThis.WeakMap||Map),Re={threshold:[0]},Nm={};Y.intersect$handle=function(){let r=this.event.detail.observer;return this.modifiers._observer==r};var km=Symbol(),Rl=class extends G{\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:s,step:i}=this[Em],n=$r(e||"",this.target);return this.isIntersecting&&!s[i]?(n.flags.incr(t),s[i]=!0):s[i]&&!this.isIntersecting&&(n.flags.decr(t),s[i]=!1),!0}};u(Rl,km,"IntersectionEvent",0);var Cm=Rl;function Om(r,t){return function(e,s){let i=s.prevRatios||(s.prevRatios=new WeakMap);for(let n=0,o=Lm(e),l=o.length;n<l;n++){let a=o[n],h=i.get(a.target)||0,d=a.intersectionRatio,c={entry:a,ratio:d,from:h,delta:d-h,observer:s},m=new G(r,{bubbles:!1,detail:c});m[Mm](Cm),m.entry=a,m.isIntersecting=a.isIntersecting,m.delta=c.delta,m.ratio=c.ratio,i.set(a.target,d),a.target.dispatchEvent(m)}}}function Yy(r=Re){let t=r.threshold.join("-")+r.rootMargin;!r.root&&Re.root&&(r.root||(r.root=Re.root));let e=r.root||Nm,s=Al.get(e);return s||Al.set(e,s={}),s[t]||(s[t]=new IntersectionObserver(Om("intersect",t),r))}var $m=Symbol(),Vl=class{on$intersect(t,e,s,i){}};u(Vl,$m,"Element",1,S);var Qy=Vl;function Pm(r){let t;return r&&((t=r.toIterable)?t.call(r):r)}var jl=Symbol.for("#width"),Dl=Symbol.for("#height"),Im=Symbol.for("#extendType");function wu(){return globalThis.imba.uses_events_resize=!0,!0}var vs=null,Hm=Symbol(),Gl=class extends G{\u03B1css(t="1elw",e="1elh",s="",i=""){let n=this.entry?.target;if(s=="px"&&(i=s,s=""),n&&n.offsetParent){let o=Dt(t),l=Dt(e),a=$r(s,n),h=o?"--u_"+o[1]:"--"+t,d=l?"--u_"+l[1]:"--"+e,c=o?this.width/o[0]:this.width,m=l?this.height/l[0]:this.height;a.style.setProperty(h,c+i),a.style.setProperty(d,m+i)}return!0}get width(){return this[jl]??(this[jl]=this.entry.target.offsetWidth)}get height(){return this[Dl]??(this[Dl]=this.entry.target.offsetHeight)}};u(Gl,Hm,"ResizeEvent",0);var Fm=Gl;function Am(){return globalThis.ResizeObserver||vs||(console.warn(":resize not supported in this browser"),vs={observe:function(){return!0}}),globalThis.imbaResizeObserver=vs||(vs=new ResizeObserver(function(r){for(let t=0,e=Pm(r),s=e.length;t<s;t++){let i=e[t],n=new G("resize",{bubbles:!1,detail:i});n.entry=i,n.rect=i.contentRect,n[Im](Fm),i.target.dispatchEvent(n);let o=new G("resized",{bubbles:!0,detail:i});i.target.dispatchEvent(o)}}))}var Rm=Symbol(),Bl=class{on$resize(t,e,s,i){return Am().observe(this),this.addEventListener("resize",s,i),s}};u(Bl,Rm,"Element",1,S);var tv=Bl;function Vm(r,t){return typeof t=="string"?typeof r===t:t[Symbol.hasInstance]?.(r)}var jm=Symbol.for("#extendType"),Dm=Symbol.for("#options");function Lu(){return globalThis.imba.uses_events_mutate=!0,!0}var Gm=Symbol(),zl=class extends G{};u(zl,Gm,"MutationEvent",0);var Bm=zl,zm=Symbol(),Ul=class{on$mutate(t,e,s,i){var n=this,o,l,a,h;s.observer||(s.observer=new MutationObserver(function(c){let m=new G("mutate",{bubbles:!!t.bubble,detail:c});return m[jm](Bm),n.dispatchEvent(m)}));let d=s[Dm]={};return t.subtree&&(o=t.subtree,delete t.subtree,d.subtree=!0),t.text&&(l=t.text,delete t.text,d.characterData=!0,d.characterDataOldValue=!0),t.childList&&(a=t.childList,delete t.childList,d.childList=!0),t.attributes&&(Vm(t.attributes,Array)&&(d.attributeFilter=t.attributes),h=t.attributes,delete t.attributes,d.attributes=!0),!d.attributes&&!d.childList&&(d.childList=!0),s.observer.observe(this,d),this.addEventListener("mutate",s,i),s}};u(Ul,zm,"Element",1,S);var rv=Ul;function Eu(){return globalThis.imba.uses_events_selection=!0,!0}var Ar,ql=Symbol();function Um(){if(!Ar)return Ar=function(r){if(r[ql])return;r[ql]=!0;let t=globalThis.document.activeElement;if(t&&t.matches("input,textarea")){let e=new G("selection",{detail:{start:t.selectionStart,end:t.selectionEnd}});return t.dispatchEvent(e)}},globalThis.document.addEventListener("selectionchange",Ar)}var qm=Symbol(),Kl=class{on$selection(t,e,s,i){return Um(),this.addEventListener("selection",s,i),s}};u(Kl,qm,"Element",1,S);var nv=Kl,Wl=Symbol.for("#string"),Yl=Symbol.for("#html"),_t={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"}}};_t.auto=_t.win;var Rr={};function Xl(r,t="auto"){let e=""+r+":"+t;if(Rr[e])return Rr[e];let s=_t[t]||_t.win,i=r.split(" ").map(function(n){return n.split("+").sort(function(o,l){return s.order.indexOf(l)-s.order.indexOf(o)}).map(function(o){let l=s.labels[o]||o;return l=l[0].toUpperCase()+(l.slice(1)||"")})});return Rr[e]=i}function Km(r,t){let e=Xl(r,t),s=_t[t]||_t.win;return e[Wl]||(e[Wl]=e.map(function(i){return i.join(s.sep)}).join(" "))}function Wm(r,t){let e=Xl(r,t),s=_t[t]||_t.win;return e[Yl]||(e[Yl]=e.map(function(i){return"<kbd>"+i.map(function(n){return"<kbd>"+n+"</kbd>"}).join("")+"</kbd>"}).join(" "))}function Mu(){return globalThis.imba.uses_events_hotkey=!0,!0}var Ym=Symbol(),Vr,Nu=new(Vr=class{humanize(r,t="auto"){return Km(r,t)}htmlify(r,t="auto"){return Wm(r,t)}},u(Vr,Ym,"HotKeyManager",0),Vr),Bt=typeof Reflect=="object"?Reflect:null,Ql=Bt&&typeof Bt.apply=="function"?Bt.apply:function(r,t,e){return Function.prototype.apply.call(r,t,e)},bs;Bt&&typeof Bt.ownKeys=="function"?bs=Bt.ownKeys:Object.getOwnPropertySymbols?bs=function(r){return Object.getOwnPropertyNames(r).concat(Object.getOwnPropertySymbols(r))}:bs=function(r){return Object.getOwnPropertyNames(r)};function Xm(r){console&&console.warn&&console.warn(r)}var Jl=Number.isNaN||function(r){return r!==r};function b(){b.init.call(this)}b.EventEmitter=b,b.prototype._events=void 0,b.prototype._eventsCount=0,b.prototype._maxListeners=void 0;var Zl=10;function Ss(r){if(typeof r!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof r)}Object.defineProperty(b,"defaultMaxListeners",{enumerable:!0,get:function(){return Zl},set:function(r){if(typeof r!="number"||r<0||Jl(r))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+r+".");Zl=r}}),b.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},b.prototype.setMaxListeners=function(r){if(typeof r!="number"||r<0||Jl(r))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+r+".");return this._maxListeners=r,this};function ta(r){return r._maxListeners===void 0?b.defaultMaxListeners:r._maxListeners}b.prototype.getMaxListeners=function(){return ta(this)},b.prototype.emit=function(r){for(var t=[],e=1;e<arguments.length;e++)t.push(arguments[e]);var s=r==="error",i=this._events;if(i!==void 0)s=s&&i.error===void 0;else if(!s)return!1;if(s){var n;if(t.length>0&&(n=t[0]),n instanceof Error)throw n;var o=new Error("Unhandled error."+(n?" ("+n.message+")":""));throw o.context=n,o}var l=i[r];if(l===void 0)return!1;if(typeof l=="function")Ql(l,this,t);else for(var a=l.length,h=na(l,a),e=0;e<a;++e)Ql(h[e],this,t);return!0};function ea(r,t,e,s){var i,n,o;if(Ss(e),n=r._events,n===void 0?(n=r._events=Object.create(null),r._eventsCount=0):(n.newListener!==void 0&&(r.emit("newListener",t,e.listener?e.listener:e),n=r._events),o=n[t]),o===void 0)o=n[t]=e,++r._eventsCount;else if(typeof o=="function"?o=n[t]=s?[e,o]:[o,e]:s?o.unshift(e):o.push(e),i=ta(r),i>0&&o.length>i&&!o.warned){o.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=r,l.type=t,l.count=o.length,Xm(l)}return r}b.prototype.addListener=function(r,t){return ea(this,r,t,!1)},b.prototype.on=b.prototype.addListener,b.prototype.prependListener=function(r,t){return ea(this,r,t,!0)};function Qm(){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 sa(r,t,e){var s={fired:!1,wrapFn:void 0,target:r,type:t,listener:e},i=Qm.bind(s);return i.listener=e,s.wrapFn=i,i}b.prototype.once=function(r,t){return Ss(t),this.on(r,sa(this,r,t)),this},b.prototype.prependOnceListener=function(r,t){return Ss(t),this.prependListener(r,sa(this,r,t)),this},b.prototype.removeListener=function(r,t){var e,s,i,n,o;if(Ss(t),s=this._events,s===void 0)return this;if(e=s[r],e===void 0)return this;if(e===t||e.listener===t)--this._eventsCount===0?this._events=Object.create(null):(delete s[r],s.removeListener&&this.emit("removeListener",r,e.listener||t));else if(typeof e!="function"){for(i=-1,n=e.length-1;n>=0;n--)if(e[n]===t||e[n].listener===t){o=e[n].listener,i=n;break}if(i<0)return this;i===0?e.shift():Jm(e,i),e.length===1&&(s[r]=e[0]),s.removeListener!==void 0&&this.emit("removeListener",r,o||t)}return this},b.prototype.off=b.prototype.removeListener,b.prototype.removeAllListeners=function(r){var t,e,s;if(e=this._events,e===void 0)return this;if(e.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):e[r]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete e[r]),this;if(arguments.length===0){var i=Object.keys(e),n;for(s=0;s<i.length;++s)n=i[s],n!=="removeListener"&&this.removeAllListeners(n);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(t=e[r],typeof t=="function")this.removeListener(r,t);else if(t!==void 0)for(s=t.length-1;s>=0;s--)this.removeListener(r,t[s]);return this};function ra(r,t,e){var s=r._events;if(s===void 0)return[];var i=s[t];return i===void 0?[]:typeof i=="function"?e?[i.listener||i]:[i]:e?Zm(i):na(i,i.length)}b.prototype.listeners=function(r){return ra(this,r,!0)},b.prototype.rawListeners=function(r){return ra(this,r,!1)},b.listenerCount=function(r,t){return typeof r.listenerCount=="function"?r.listenerCount(t):ia.call(r,t)},b.prototype.listenerCount=ia;function ia(r){var t=this._events;if(t!==void 0){var e=t[r];if(typeof e=="function")return 1;if(e!==void 0)return e.length}return 0}b.prototype.eventNames=function(){return this._eventsCount>0?bs(this._events):[]};function na(r,t){for(var e=new Array(t),s=0;s<t;++s)e[s]=r[s];return e}function Jm(r,t){for(;t+1<r.length;t++)r[t]=r[t+1];r.pop()}function Zm(r){for(var t=new Array(r.length),e=0;e<t.length;++e)t[e]=r[e].listener||r[e];return t}function jr(r,t){return typeof t=="string"?typeof r===t:t[Symbol.hasInstance]?.(r)}var Dr=Symbol.for("#getQueryParam"),oa=Symbol.for("#setQueryParam"),la=Symbol.for("#query"),tp=Symbol(),aa=class Ws{static parse(t,e){return jr(t,Ws)?t:new Ws(t,e)}constructor(t,e){this.router=e,this.parse(t)}parse(t){let e;return jr(t,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(jr(t,Object))for(let e=0,s=Object.keys(t),i=s.length,n,o;e<i;e++)n=s[e],o=t[n],this.searchParams.set(n,o);else typeof t=="string"&&this.parse(t);return this}clone(){return new Ws(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[la]||(this[la]=new Proxy({},{get:this[Dr].bind(this),set:this[oa].bind(this)}))}toString(){return this.href}[Dr](t,e){return this.searchParams.get(e)}[oa](t,e,s){let i=this[Dr](t,e)??"";return s=s??"",i!=s&&(s==null||s==""?this.searchParams.delete(e):this.searchParams.set(e,s),this.active\u03A6&&(this.router.history.replaceState({},null,this.path),this.router.touch())),!0}};u(aa,tp,"Location",16);var Gr=aa,ep=Symbol(),ha=class{constructor(t){this.router=t,this.stack=[],this.pos=-1}pushState(t,e,s){return this.stack.length=Math.max(this.pos,0),this.stack[++this.pos]=[t,e,s],this}replaceState(t,e,s){return this.stack.length=this.pos,this.stack[this.pos]=[t,e,s]}popState(){return this.stack.length=this.pos+1,this.pos-=1,this.stack.pop()}currentState(){return this.stack[this.pos]}slice(){return[]}};u(ha,ep,"History",16);var sp=ha,rp=Symbol(),ua=class{constructor(t,e,s,i){this.params=i,this.router=t,e&&(this.location=Gr.parse(e),this.original=this.location.clone()),this.referrer=s}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}};u(ua,rp,"Request",16);var ca=ua;function da(r){let t;return r&&((t=r.toIterable)?t.call(r):r)}var xs=Symbol.for("#routes"),Br=Symbol.for("#match"),ip=Symbol.for("#symbol"),fa=Symbol.for("#matches"),zr=new Map,Ur={},ma={},np=/.*/;function op(r){if(!zr.has(r)){let t=new Map;return zr.set(r,t),t}return zr.get(r)}function lp(r,t){let e=op(r);if(!e.has(t)){let s=Object.create(r);return Object.assign(s,t),e.set(t,s),s}return e.get(t)}var ap=Symbol(),pa=class{};u(pa,ap,"Match",0);var hp=pa;function up(r){if(Ur[r])return Ur[r];let t=Ur[r]={url:r},e=r.indexOf("?"),s=r.indexOf("#");if(s>=0&&(t.hash=r.slice(s+1),r=t.url=r.slice(0,s)),e>=0){let i=t.query=r.slice(e+1);r=r.slice(0,e),t.query=ma[i]||(ma[i]=new URLSearchParams(i))}return t.path=r,t}var cp=Symbol(),ga=class{constructor(t){this.router=t,this.fullPath="",this[xs]={},this[Br]=new hp,this[Br].path=""}route(t){var e;return(e=this[xs])[t]||(e[t]=new mp(this.router,t,this))}match(){return this[Br]}resolve(t){return"/"}};u(ga,cp,"RootRoute",16);var dp=ga,fp=Symbol(),ya=class ku{constructor(t,e,s){this.parent=s||t.rootRoute,this.router=t,this.status=200,this.path=e,this[ip]=Symbol(),this[fa]={},this[xs]={}}route(t){var e;return(e=this[xs])[t]||(e[t]=new ku(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 i=t.split("?");t=i.shift(),this.query={};for(let n=0,o=da(i.join("?").split("&")),l=o.length;n<l;n++){let a=o[n];if(!a)continue;let[h,d]=a.split("=");h[0]=="!"&&(this.dynamic=!0,h=h.slice(1),d=!1),d===""&&(d=!1),d&&d[0]==":"&&(this.dynamic=!0),this.query[h]=d||d!==!1}}if(t=t.replace(/\:(\w+|\*)(\.)?/g,function(i,n,o){e.dynamic=!0,n!="*"&&e.groups.push(n);let l=e.router.matchers[n]||(o?"([^/#.?]+)":"([^/#?]+)");return o?""+l+".":l}),t==""&&this.query)return;if(t=="*")return this.regex=np,this;t="^"+t;let s=t[t.length-1];(s=="$"||s=="/")&&(t=t.slice(0,-1)+"(?=/?[#?]|/?$)"),s!="/"&&s!="$"&&t!="^/"&&(t=t+"(?=[/#?]|$)"),this.regex=new RegExp(t)}match(t=this.router.path){var e;let s,i=this.parent.match(t);if(!i)return null;let n=up(t),o=n.url,l="";if(i.path&&n.path.indexOf(i.path)==0&&(l=i.path+"/",o=o.slice(l.length)),s=this.regex?o.match(this.regex):[""]){let a=l+s[0],h=[this.$path],d={};if(this.groups.length)for(let g=0,f=da(s),p=f.length,y;g<p;g++){let w=f[g];(y=this.groups[g-1])&&(d[y]=w,h.push(w))}if(this.query)for(let g=this.query,f=0,p=Object.keys(g),y=p.length,w,O;f<y;f++){w=p[f],O=g[w];let gt=w,L=n.query?.get?.(w);if(O===!1){if(L)return null;h.push("1");continue}if(O[0]==":"&&(gt=O.slice(1),O=!0),O==!0&&L||O==L)d[gt]=L,h.push(L);else return null}let c=h.join("*");d=(e=this[fa])[c]||(e[c]=d);let m=lp(i,d);return m.path=a,m}return null}resolve(t=this.router.path){if(this.raw[0]=="/"&&!this.dynamic)return this.raw.replace(/\$/g,"");let e=this.parent.match(t),s=this.parent.resolve(t),i;if(this.dynamic){let n=this.match(t);return n?n.path:null}return this.raw[0]=="?"?i=(s||"/")+this.raw:i=s+"/"+this.raw,i.replace(/\$/g,"").replace(/\/\/+/g,"/")}};u(ya,fp,"Route",16);var mp=ya;function va(r,t){return typeof t=="string"?typeof r===t:t[Symbol.hasInstance]?.(r)}var qr=Symbol.for("#enter"),Kr=Symbol.for("#resolved"),_s=Symbol.for("#leave"),ba=Symbol.for("#afterVisitRouted"),Sa=Symbol.for("#afterVisitRouteTo"),Wr=Symbol.for("#doc"),mt=Symbol.for("#version"),pp=Symbol.for("#routes"),xa=Symbol.for("#origin"),Yr=Symbol.for("#request"),_a=Symbol.for("#hash"),U=Symbol.for("#routeTo"),Se=Symbol.for("#path"),lt=Symbol.for("#match"),xe=Symbol.for("#options"),gp=Symbol.for("#cache"),Ta=Symbol.for("#unmatched"),Tt=Symbol.for("#active"),yp=Symbol.for("#resolvedPath"),vp=Symbol.for("#dataKey"),bp=Symbol.for("#activeKey"),_e=Symbol.for("#urlKey"),zt=Symbol.for("#dataMap"),Ut=Symbol.for("#href"),I=Symbol.for("#route"),wa=Symbol.for("#context"),La=Symbol.for("#afterVisit"),Ea=Symbol.for("#routeHandler"),Sp=Symbol.for("#parentNode"),xp=Symbol.for("#visitContext"),Ma=Symbol.for("##visitContext"),_p=Symbol.for("#attachToParent"),Tp=Symbol.for("#detachFromParent"),Na=Symbol.for("#router");function Cu(){return globalThis.imba.use_router=!0,!0}var Ou=ui(function(){return globalThis.document.router}),wp=Symbol(),ka=class extends b{constructor(t,e={}){super(),this[Wr]=t,this[mt]=0,this[pp]={},this.aliases={},this.redirects={},this.rules={},this.matchers={},this.options=e,this.busy=[],this.queue=new Si,this.root=new dp(this),this.location=new Gr(e.url||t.location.href,this),this.history=new sp(this),this.mode=e.mode||"history",this.setup()}get origin(){return this[xa]||(this[xa]=this[Wr].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[mt]++}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[Yr]}pushState(t,e,s){return this.history.pushState(t,e||null,String(s))}replaceState(t,e,s){return this.history.replaceState(t,e||null,String(s))}refresh(t={}){if(this.refreshing)return;this.refreshing=!0;let e=this.location,s=Gr.parse(t.location||this.realpath,this),i=t.mode,n=this[Yr];if(!s.equals(e)||!n||t.state){let o=new ca(this,s,e,t);this[Yr]=o,this.emit("beforechange",o),o.aborted&&(!o.forceAbort&&globalThis.window.confirm("Are you sure you want to leave? You might have unsaved changes")?o.aborted=!1:i=="pop"?this.pushState(this.state,null,String(e)):i=="replace"&&this.replaceState(this.state,null,String(e))),o.aborted||(this.location=o.location,i=="push"?this.pushState(o.state,null,String(this.location)):i=="replace"?this.replaceState(o.state,null,String(this.location)):i=="pop"&&(this.history.index=t.index),this.refreshing=!1,this.emit("change",o),this.touch(),A())}return this.refreshing=!1,this}onpopstate(t){let e=this.history.index,s=e,i={pop:!0,index:0,from:e,mode:"pop"};try{if(typeof t.state=="string"){let[n,o]=t.state.split("|");s=i.index=parseInt(o),s<e?i.revert=this.history.slice(s+1,e+1).reverse():s>e&&(i.apply=this.history.slice(e+1,s+1))}}catch{}return this.refresh(i),this}onbeforeunload(t){let e=new ca(this,null,this.location,{mode:"unload"});if(this.emit("beforechange",e),e.aborted)return!0}onhashchange(t){return this.emit("hashchange",this[_a]=this[Wr].location.hash),A()}setup(){return this}onclick(t){if(t.metaKey||t.altKey)return;let e=null,s=null,i=t.target;for(;i&&(!e||!s);)!e&&i.nodeName=="A"&&(e=i),!s&&i[U]&&(s=i),i=i.parentNode;if(e&&s!=e&&(!s||s.contains(e))){let n=e.getAttribute("href");n&&!n.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[U]&&e[U].resolve();let s=e.getAttribute("href"),i=new URL(e.href),n=i.href.slice(i.origin.length),o=this.realpath.split("#")[0],l=n.split("#")[0];return o==l?globalThis.document.location.hash=i.hash:e[U]?e[U].go():this.go(n),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(va(t,Object)){e=[];for(let s=0,i=Object.keys(t),n=i.length,o,l;s<n;s++)o=i[s],l=t[o],e.push([o,globalThis.encodeURI(l)].join("="));return e.join("&")}return t||""}get hash(){return this[_a]}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 s=this.location.clone().update(t),i=this.history.buildState(e,s.path,!0);return this.refresh({push:!0,mode:"push",location:s,state:i,apply:[i]}),this}replace(t,e=null){typeof t=="object"&&e===null&&(e=t,t=this.path);let s=this.location.clone().update(t),i=this.history.buildState(e,s.path,!1);return this.refresh({replace:!0,mode:"replace",location:s,state:i,apply:[i]})}};u(ka,wp,"Router",16);var Vi=ka,Lp=Symbol(),Ca=class{constructor(t,e,s,i={}){this.parent=s,this.node=t,this[Se]=e,this[lt]=null,this[xe]=i,this[gp]={},this[Ta]={},this[Tt]=null,this[yp]=null,this[vp]=Symbol(),this[bp]=Symbol(),this[_e]=Symbol()}get router(){return this.node.ownerDocument.router}get route(){return((this.parent?this.parent.route:this.router)||this.router)?.route?.(this[Se])}get match(){return this[lt]}get params(){return this[lt]||this[Ta]}get state(){let t=this[zt]||(this[zt]=new Map),e=this.params,s=this[zt].get(e);return s||this[zt].set(e,s={}),s}set state(t){(this[zt]||(this[zt]=new Map)).set(this.params,t)}set path(t){this[Se]!=t&&(this[Se]=t,!0)&&this.router.touch()}get path(){return this[Se]}get isActive(){return!!this[Tt]}get active\u03A6(){return!!this[Tt]}resolve(){let t=this.router[mt];if(!(this[mt]!=t&&(this[mt]=t,!0)))return;let e=this.route,s=this[xe],i=this.router.path,n=e.match(i),o=this[Tt],l=this[lt],a=n!=l,h=n&&n[this[_e]];return n&&(this[Tt]=!0,this[lt]=n,n[this[_e]]=i),n&&(a||h!=i||!o)&&this[Kr](n,l,h),!o&&n&&this[qr](),!n&&(o||o===null)&&(this[Tt]=!1,this[_s]()),this[lt]}[qr](){return this.node.flags.remove("not-routed"),this.node.flags.add("routed"),this.node?.routeDidEnter?.(this)}[Kr](t,e,s=""){return this.node?.routeDidResolve?.(this,t,e,s)}[_s](){return this.node.flags.add("not-routed"),this.node.flags.remove("routed"),this.node?.routeDidLeave?.(this)}};u(Ca,Lp,"ElementRoute",16);var Ys=Ca,Ep=Symbol(),Oa=class extends Ys{[qr](){return this}[Kr](){return this}[_s](){return this}resolve(){let t=this.router[mt];if(!(this[mt]!=t&&(this[mt]=t,!0)))return;let e=this[xe],s=this.route,i=this.router.path,n=this.route.resolve(i),o=this.route.match(i);o&&(this[lt]=o,this[lt][this[_e]]=i),e.sticky&&this[lt]&&(n=this[lt][this[_e]]),this[Ut]!=n&&(this[Ut]=n,!0)&&this.node.nodeName=="A"&&this.node.setAttribute("href",n),this.node.flags.toggle("active",!!o)}get url(){return this.resolve(),globalThis.location.origin+this[Ut]}go(){return this.resolve(),this[xe]&&this[xe].replace?this.router.replace(this[Ut]):this.router.path==this[Ut]?!0:this.router.go(this[Ut])}};u(Oa,Ep,"ElementRouteTo",0);var ji=Oa,Mp=Symbol(),$a=class{get router(){return this.ownerDocument.router}};u($a,Mp,"Node",1,D);var mv=$a,Np=Symbol(),Pa=class{set route(t){if(t==null)return;if(this[I]){this[I].path=t;return}let e=t[0]!="/"?this[wa].route:null;this[I]=new Ys(this,t,e,this.route__),this[La]=this[ba]}get route(){return this[I]}set route\u039Eto(t){var e=this;if(t==null)return;if(this[U]){this[U].path=t;return}let s=t[0]!="/"?this[wa].route:null;this[I]=this[U]=new ji(this,t,s,this.routeTo__),this[La]=this[Sa],this.onclick=function(i){if(!i.altKey&&!i.metaKey&&!i[Ea])return i.preventDefault(),i[Ea]=e[U],e[U].go()}}[ba](){if(this[I]){let t=this[Sp],e=t&&t[xp];if(e&&e.matchedRoute&&e.matchedRoute!=this[I]){this[I][Tt]!=!1&&(this[I][Tt]=!1,!0)&&(this[I][_s](),this[I][mt]=-1);return}if(this[I].resolve(),this[I].active\u03A6)e.matchedRoute=this[I];else return}if(this.visit&&this.visit(),this[Ma])return this[Ma]=null}[Sa](){if(this[U]&&this[U].resolve(),this.visit)return this.visit()}routeDidEnter(t){return this[_p]()}routeDidLeave(t){return this[Tp]()}routeDidResolve(t,e,s){var i=this;va(this.routed,Function)&&e!=s&&this.router.queue.add(async function(){i.suspend();let n=await i.routed(e,t.state,s);return i.unsuspend()})}};u(Pa,Np,"Element",1,S);var gv=Pa,kp=Symbol(),Ia=class{get router(){return this[Na]||(this[Na]=new Vi(this))}};u(Ia,kp,"Document",1,Ce);var vv=Ia;function Ts(r,t){return typeof t=="string"?typeof r===t:t[Symbol.hasInstance]?.(r)}function P(r){let t;return r&&((t=r.toIterable)?t.call(r):r)}var Te=Symbol.for("##reactive"),Nt=Symbol.for("##referenced"),we=Symbol.for("##dereferenced"),ws=Symbol.for("#map"),Ha=Symbol.for("#__init__"),Ls=Symbol.for("#child"),Xr=Symbol.for("##spy"),Le=Symbol.for("#reactions"),Qr=Symbol.for("#promise"),x={TOUCHING:2,STALE:4,OBJECT:8,RUNNING:16,INVALIDATING:32,POSSIBLY_STALE:64,AUTORUN:128,DEACTIVATED:256},_=0,Fa=!1,kt=null,Cp=0,Aa=1,Jr={META:new Map,VALUE:new Map,REF:new Map},H,Zt={root:null,ctx:null,get context(){return v},get atomics(){return kt},get ownref(){return k},flush(){if(v==H)return H.flush()}},k=Symbol.for("~"),Ra=Symbol.for("~~"),Zr=function(r,t){return t.has(r)||t.set(r,Symbol()),t.get(r)},Es=function(r){return typeof r=="symbol"?Zr(r,Jr.VALUE):Symbol.for(r)},ti=function(r){return typeof r=="symbol"?Zr(r,Jr.META):Symbol.for("#"+r+"__")},Ms=function(r){return typeof r=="symbol"?Zr(r,Jr.REF):Symbol.for("~"+r)},T=function(r,t){return _&&v.add(r[k]),t},q=function(r,t){return r[k].$$invalidated(0),t},qt=function(r,t,e){let s=r[k];return s||(s=r[k]=new te,Object.defineProperties(r,e)),t&&s.addSubscriber(t),r},ei=function(r,t){let e=r[k];return e&&e.removeSubscriber(t),r},Op=Symbol(),Va=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.idx,s=this.array[e];if(s===t)++this.idx;else{if(e>0&&this.array[e-1]===t)return;let i=this.array.indexOf(t),n=this.changes.get(t);if(i===-1)this.array.splice(e,0,t),this.changes.set(t,1),this.idx++;else{if(i<e)return;i===e+1?(s&&this.changes.set(s,-1),this.array.splice(e,1),++this.idx):(i>e&&this.array.splice(i,1),this.array.splice(e,0,t))}n==-1&&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()}};u(Va,Op,"ArrayPatcher",16);var $p=Va;function si(r){var t,e;let s=Object.getOwnPropertyDescriptors(r.prototype);return t=s.name,delete s.name,e=s.constructor,delete s.constructor,s}function Pp(){if(Fa!=!0&&(Fa=!0,!0))return gi.on("inited",function(r){let t=r[Ra];if(t){let e=globalThis.Node&&Ts(r,globalThis.Node),s=r[k]||(r[k]={});for(let i=0,n=Object.keys(t),o=n.length,l,a;i<o;i++){l=n[i],a=t[l];let h=s[l]=new Me(r[l],r,a);e||h.call()}e&&(at(r,"mount",function(){for(let i=0,n=P(Object.values(s)),o=n.length;i<o;i++){let l=n[i];Ts(l,Me)&&l.activate()}}),at(r,"unmount",function(){for(let i=0,n=P(Object.values(s)),o=n.length;i<o;i++){let l=n[i];Ts(l,Me)&&l.deactivate()}}))}})}function Ip(r,t=Ra){return r.hasOwnProperty(t)||(r[t]=Object.assign({},r[t]||{})),r[t]}var Hp=Symbol(),ja=class $u{constructor(t,e=0){this.depth=e,this.parent=t,this.target=null,this.spy=null,this.patcher=new $p}get active\u03A6(){return v==this}get root\u03A6(){return this==H}get snapshot(){let t=[],e=this[Ls];for(;e&&e.target;)t.push({depth:e.depth,target:e.target,beacon:e.beacon}),e=e[Ls];return t}reset(t){this.target=t,this.beacon=t.beacon;let e=this.spy=t[Xr];return this.tracking=e?e.tracking??!0:!0,this.patcher.reset(t.observing||(t.observing=[])),e&&e?.enter?.(this),this}add(t,e){this.tracking&&t&&this.beacon&&this.patcher.push(t),this.spy&&this.spy?.observed?.(this,t,e)}react(t){return this.spy&&this.spy?.react?.(this,t),H.reactions.add(t)}push(t){return Zt.ctx=v=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[s,i]of P(e))i===1?s.addSubscriber(this.beacon):s.removeSubscriber(this.beacon)}return this.spy&&this.spy?.leave?.(this),this.patcher.cleanup(),this.target=this.beacon=null,v=this.parent,v==H?(H.flush(),Zt.ctx=null):Zt.ctx=v,t}get child(){return this[Ls]||(this[Ls]=new $u(this,this.depth+1))}get reactions(){return this[Le]||(this[Le]=new Set)}flush(){if(!this[Le])return;let t=this[Le];this[Le]=null;for(let e of P(t))e.call()}};u(ja,Hp,"Context",16);var Fp=ja,Ap=Symbol(),Da=class extends Fp{add(){return!0}};u(Da,Ap,"Root",0);var Rp=Da,v=H=Zt.root=new Rp(null,0),Vp=function(){return v.tracking=!1},Ga=function(r,t,e,s,i){let n=r[e],o=r[i];return o||(o=r[i]=new te(s,t,n)),v.add(o,r),n},Ba=function(r,t,e,s,i,n){let o=r[e];if(s!=o){r[e]=s;let l=r[n];l&&l.changed(0,s,o)}},jp=Symbol(),za=class{constructor(t,e,s){return this.id=Aa++,this.observer=null,this.observers=null,this.v=0,this.o=t||null,s&&s[Nt]&&s[Nt](this),this}get $$v(){return this.v}changed(t,e,s){if(Cp++,this.v++,s&&s[we]&&s[we](this,e),e&&e[Nt]&&e[Nt](this,s),this.observer&&this.observer.$$invalidated(t+1,this,e,s),this.observers)for(let i of P(this.observers))i.$$invalidated(t+1,this,e,s);v==H&&v.flush()}invalidated(t,e){return console.warn("Ref.invalidated is deprecated - use $$invalidated"),this.$$invalidated(t,e)}$$invalidated(t,e){if(kt)return kt.add(this),!0;if(this.v++,t>30){console.warn("Ref observer chain too deep",this,e);return}if(this.observer&&this.observer.$$invalidated(t+1,this),this.observers)for(let s of P(this.observers))s.$$invalidated(t+1,this);return t==0&&v==H&&v.flush(),!0}addSubscriber(t){this.observer?(this.observers||(this.observers=new Set),this.observers.add(t)):this.observer=t}removeSubscriber(t){this.observer==t&&(this.observer=null);let e=this.observers;e&&e.delete(t)}reportChanged(){return this.changed(0)}reportObserved(t){return v.add(this,t)}};u(za,jp,"Ref",16);var te=za;function Pu(r){return new te(null,r,null)}var Dp=Symbol(),Ua=class extends Array{push(){return q(this,super.push(...arguments))}pop(){return q(this,super.pop(...arguments))}unshift(){return q(this,super.unshift(...arguments))}shift(){return q(this,super.shift(...arguments))}splice(){return q(this,super.splice(...arguments))}at(){return T(this,super.at(...arguments))}map(){return T(this,super.map(...arguments))}flatMap(){return T(this,super.flatMap(...arguments))}flat(){return T(this,super.flat(...arguments))}filter(){return T(this,super.filter(...arguments))}find(){return T(this,super.find(...arguments))}slice(){return T(this,super.slice(...arguments))}sort(){return T(this,super.sort(...arguments))}get len(){return T(this,this.length)}set len(t){this.length=t,q(this)}toIterable(){return _&&v.add(this[k]),this}[Symbol.iterator](){return T(this,super[Symbol.iterator](...arguments))}};u(Ua,Dp,"ObservableArray",8);var Di=Ua,qa=si(Di),Gp=Symbol(),Ka=class{get len(){return this.length}set len(t){this.length=t}get[Te](){return qt(this,null,qa)}[Nt](t){return qt(this,t,qa)}[we](t){return ei(this,t)}};u(Ka,Gp,"Array",1,Array);var wv=Ka,Wa=Set.prototype.has,Bp=Symbol(),Ya=class extends Set{has(){return T(this,super.has(...arguments))}keys(){return T(this,super.keys(...arguments))}values(){return T(this,super.values(...arguments))}entries(){return T(this,super.entries(...arguments))}add(t){return Wa.call(this,t)?this:q(this,super.add(...arguments))}delete(t){return Wa.call(this,t)?q(this,super.delete(...arguments)):this}clear(){return this.size?q(this,super.clear(...arguments)):this}};u(Ya,Bp,"ObservableSet",8);var zp=Ya,Xa=si(zp),Up=Symbol(),Qa=class{get[Te](){return qt(this,null,Xa)}[Nt](t){return qt(this,t,Xa)}[we](t){return ei(this,t)}};u(Qa,Up,"Set",1,Set);var Mv=Qa,qp=Symbol(),Ja=class extends Map{get(){return T(this,super.get(...arguments))}has(){return T(this,super.has(...arguments))}keys(){return T(this,super.keys(...arguments))}values(){return T(this,super.values(...arguments))}entries(){return T(this,super.entries(...arguments))}set(){return q(this,super.set(...arguments))}clear(){return q(this,super.clear(...arguments))}delete(){return q(this,super.delete(...arguments))}};u(Ja,qp,"ObservableMap",8);var Kp=Ja,Za=si(Kp),Wp=Symbol(),th=class{get[Te](){return qt(this,null,Za)}[Nt](t){return qt(this,t,Za)}[we](t){return ei(this,t)}};u(th,Wp,"Map",1,Map);var Cv=th,Yp=Symbol(),eh=class{constructor(t,e={}){var s=this;this.name=t,this.options=e;let i=this.key=Es(t),n=Ms(t),o=this.descriptor={enumerable:e.enumerable??!0,configurable:!1,get:function(){return _?Ga(this,t,i,s,n):this[i]},set:function(a){return _||this[n]?Ba(this,t,i,a,s,n):this[i]=a}},l=this.lazyDescriptor={enumerable:!1,configurable:!0,get:function(){return _?(Object.defineProperty(this,t,o),this[t]):this[i]},set:function(a){return this[i]=a,this[n]=null,Object.defineProperty(this,t,o)}}}};u(eh,Yp,"PropertyType",16);var Xp=eh,Qp=Symbol(),sh=class{constructor(t=null){this[Ha](t)}[Ha](t=null,e=!0,s=!0){var i;this[ws]=t&&(i=t[ws])!==void 0?i:new Map}for(t){let e=this[ws].get(t);return e||this[ws].set(t,e=[]),e}get(t){let e=this.for(t);return e[k]||e[Te],_&&T(e),e}add(t,e){return this.for(t).push(e)}delete(t,e){let s=this.for(t),i=s.indexOf(e);s.splice(i,1)}};u(sh,Qp,"RefIndex",16);var Jp=sh,Zp=Symbol(),rh=class{constructor(t,e){var s=this;this.name=t,this.key=e,this.index=new Jp;let i=Ms(t),n=this.descriptor={enumerable:!0,configurable:!1,get:function(){return _?Ga(this,t,e,s,i):this[e]},set:function(l){let a=this[e];if(_||this[i]?Ba(this,t,e,l,s,i):this[e]=l,a!=l&&(a&&s.index.delete(a,this),l))return s.index.add(l,this)}},o=this.lazyDescriptor={set:function(l){return this[e]=l,l&&s.index.add(l,this),Object.defineProperty(this,t,n),this[i]=null}}}where(t){return this.index.get(t)}};u(rh,Zp,"RefType",16);var tg=rh,eg=Symbol(),ih=class{constructor(t,e,s,i){this.observing=null,this.observers=null,this.flags=68,this.target=t,this.func=e,this.vkey=s,this.type=i,this.v=0}get beacon(){return this}addSubscriber(t){if(t==this){console.warn("@computed depends on itself");return}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,s=e?e.indexOf(t):-1;s>=0&&e.splice(s,1)}$$invalidated(t,e){if(this.flags|=x.STALE|x.POSSIBLY_STALE,t>40){console.warn("Memo invalidated observer chain too deep",this,e);return}if(this.observer&&this.observer.$$invalidated(t+1,this),!!this.observers){for(let s=0,i=P(this.observers),n=i.length;s<n;s++)i[s].$$invalidated(t+1,this);return this}}deactivate(){if(this.observing)for(let t=0,e=P(this.observing),s=e.length;t<s;t++)e[t].removeSubscriber(this);return this.observing=null,this}value(){if(_&&v.add(this),!(this.flags&x.POSSIBLY_STALE))return this.target[this.vkey];_++,this.flags|=x.RUNNING,v.push(this);let t=this.func.call(this.target);v.pop(this);let e=this.target[this.vkey],s=!1;if(t&&e&&t.constructor===e.constructor&&t instanceof Array){let i=t.length;if(i!=e.length)s=!0;else{let n=0;for(;n<i;){if(t[n]!=e[n]){s=!0;break}n++}}}else s=t!==e;return this.target[this.vkey]=t,this.flags&=~(x.STALE|x.POSSIBLY_STALE|x.RUNNING),s&&this.v++,_--,t}};u(ih,eg,"Memo",16);var Ee=ih,sg=Symbol(),nh=class{constructor(t,e){var s=this;this.name=t;let i=Ms(t),n=Es(t),o=this.descriptor={enumerable:!1,configurable:!1,get:function(){return this[i].value()}},l=this.lazyDescriptor={enumerable:!1,configurable:!0,get:function(){let a=this[i]=new Ee(this,e,n,s.type);return Object.defineProperty(this,t,o),a.value()}}}};u(nh,sg,"ComputedType",16);var Gi=nh,rg=Symbol(),oh=class{get beacon(){return this}constructor(t,e,s={}){this.cb=t,this.context=e,this.options=s,this.flags=0,this.id=Aa++,this.cachedComputedVersions=new WeakMap,this.checkComputedValues=new Set,this.observing=[],this.timeout=null}get running\u03A6(){return this.flags&x.RUNNING}$$invalidated(t,e){e instanceof Ee?(this.flags|=x.POSSIBLY_STALE,this.checkComputedValues?.add?.(e)):this.flags|=x.STALE,this.observing&&v.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=P(this.observing),s=e.length;t<s;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?",H.snapshot,this),this.flags&x.POSSIBLY_STALE&&!(this.flags&x.STALE)){let e=!1;for(let s of P(this.checkComputedValues)){let i=this.cachedComputedVersions.get(s);s.value();let n=s.v;if(i!=n){e=!0;break}}if(!e){this.flags&=~x.POSSIBLY_STALE,this.checkComputedValues.clear();return}}if(this.options.delay){clearTimeout(this.timeout);let e=this.options.delay;typeof e!="number"&&(e=1e3),this.timeout=setTimeout(function(){return t.run()},e);return}return this.run()}run(){_++,this.flags|=x.RUNNING;let t=v.push(this),e=this.cb.call(this.context,Vp),s=v.pop(this);this.observing=s,this.checkComputedValues.clear();for(let i=0,n=P(s),o=n.length;i<o;i++){let l=n[i];l instanceof Ee&&this.cachedComputedVersions.set(l,l.v)}return this.flags&=~(x.RUNNING|x.STALE|x.POSSIBLY_STALE),_--,e}dispose(){return this.deactivate(),this.cb=this.context=this.options=null,this}};u(oh,rg,"Reaction",16);var Me=oh,ig=Symbol(),lh=class extends Me{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[Qr]||(this[Qr]=new Promise(function(s){return e.resolve=function(i){return e.deactivate(),e.resolved=i,s(i)}})),this[Qr].then(...t))}run(){_++,this.flags|=x.RUNNING;let t=v.push(this),e=this.cb.call(this.context),s=v.pop(this);this.observing=s,this.checkComputedValues.clear();for(let i=0,n=P(s),o=n.length;i<o;i++){let l=n[i];l instanceof Ee&&this.cachedComputedVersions.set(l,l.v)}return this.flags&=~(x.RUNNING|x.STALE|x.POSSIBLY_STALE),_--,e!=!1&&e!=null&&e!=null&&this.resolve(e),e}};u(lh,ig,"Awaits",0);var ng=lh,og=Symbol(),ah=class{constructor(t,e){this.scope=e,this.cb=t}get ctx(){return v}run(t=this.scope,e=[],s=!1){v.push(this);try{s&&_++;let i=this.cb.apply(t,e);return s&&_--,v.pop(this),i}catch(i){throw s&&_--,v.pop(this),i}}};u(ah,og,"Action",16);var Xs=ah;function Iu(r,t={}){let e=new Me(r,globalThis,t);return e.call(),e}function Hu(r,t={}){let e=new ng(r,globalThis,t);return e.call(),e}function Fu(r){return r[Te]}function Au(r){let t=kt,e;if(t)return r();{let s=kt=new Set;try{e=r()}catch(i){kt=null;for(let n of P(s))n.$$invalidated(1,s);throw H==v&&H.flush(),i}kt=null;for(let i of P(s))i.$$invalidated(1,s);return H==v&&H.flush(),e}}function Ru(r){return new Xs(r,globalThis).run()}function Vu(r,t,e=null){r[Xr]||(r[Xr]=r),v.push(r);try{_++;let s=e?t.call(e,r):t(r,e);return _--,v.pop(r),s}catch(s){throw _--,v.pop(r),s}}function ju(r){return r&&r[k]&&r[k].$$invalidated(0),r}function Du(r){return r&&r[k]&&r[k].$$invalidated(0),r}function Gu(r,t){return r&&r[k]&&r[k].reportObserved(t),r}function Bu(r=x.OBJECT){return new te}function zu(r){let t=Object.getOwnPropertySymbols(r);for(let e=0,s=P(t),i=s.length;e<i;e++){let n=s[e];Ts(r[n],Ee)&&r[n].deactivate()}return r}function Uu(r,t){return r[Ms(t)]}function qu(r,t,e){let s=ti(t);return(r[s]=new Gi(t,e.get)).lazyDescriptor}function Ku(r,t,e){let s=ti(t),i=Es(t),n=this[0]||{},o=r[s]=new Xp(t,n);return e?(Object.defineProperty(r,i,Object.assign({},e)),o.lazyDescriptor):(Object.defineProperty(r,t,o.lazyDescriptor),null)}function Wu(r,t,e){let s=ti(t);return r.constructor[t],(r[s]=new tg(t,Es(t))).lazyDescriptor}function Yu(r,t,e){let s=Ip(r),i=this[0]||{};return i.flags=x.AUTORUN,Pp(),s[t]=i,e}function Xu(r,t,e){if(e.value){let s=new Xs(e.value,null);e.value=function(){return s.run(this,arguments)}}return e}function lg(r,t){return typeof t=="string"?typeof r===t:t[Symbol.hasInstance]?.(r)}function ag(r){let t;return r&&((t=r.toIterable)?t.call(r):r)}var hh=Symbol.for("#__init__"),Ns=Symbol.for("#watchers");function Qu(r,t,e,s,i,n){return r&&lg(r.$accessor,Function)?r=r.$accessor(t,e,s,i,n):n[i]=r,r&&!r?.$init&&(r.$init=r.$set||function(){return!0}),r}function Ju(r){return r}var hg=Symbol(),uh=class{constructor(t=null){this[hh](t)}[hh](t=null,e=!0,s=!0){var i;this.local=t&&(i=t.local)!==void 0?i:!1,this.session=t&&(i=t.session)!==void 0?i:!1,this.weak=t&&(i=t.weak)!==void 0?i:!1}watch(t){return(this[Ns]||(this[Ns]=[])).push(t)}$get(t,e){return t[e]}$set(t,e,s,i){if(this[Ns]){let n=this.$get(e,s,i);if(n!=t){e[s]=t;for(let o=0,l=ag(this[Ns]),a=l.length;o<a;o++){let h=l[o].call(e,t,n,this)}}}else e[s]=t}$accessor(t,e,s,i,n){return n[i]=this}};u(uh,hg,"Accessor",16);var Bi=uh;function Zu(){return new Bi}function ch(r,t){return typeof t=="string"?typeof r===t:t[Symbol.hasInstance]?.(r)}function ug(r){let t;return r&&((t=r.toIterable)?t.call(r):r)}function ri(){return function(){return!0}}var cg=Symbol(),dh=class Qs{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(ch(this.store,Qs))return this.store.getItem(e);if(this.local&&this.cache.rich[e]!=null)return this.cache.rich[e];let s=this.store.getItem(e);if(s!=null)return this.cache.raw[e]==s?this.cache.rich[e]:(this.cache.raw[e]=s,this.cache.rich[e]=this.deserialize(s,e))}setItem(t,e){var s,i;let n=String(this.ns)+":"+t;if(ch(this.store,Qs))return this.store.setItem(n,e);let o=this.cache.rich[n],l=typeof e;if(this.local&&(this.cache.rich[n]=e),o!==e||l=="object"){let a=this.store.getItem(n);if(e==null)return this.store.removeItem(n),s=this.cache.rich[n],delete this.cache.rich[n],i=this.cache.raw[n],delete this.cache.raw[n],A();{let h=this.serialize(e,n);if(this.cache.rich[n]=e,this.cache.raw[n]=h,a!=h)return this.store.setItem(n,h),A()}}}removeItem(t){var e;let s=String(this.ns)+":"+t;return e=this.cache[s],delete this.cache[s],this.store.removeItem(s)}get(t,e,s){return this.getItem(e)}set(t,e,s,i){return this.setItem(e,s),!0}apply(t,e,[s]){let i=this.children.get(s);return i||this.children.set(s,i=new Proxy(ri(),new Qs(this,s))),i}deleteProperty(t,e){return this.removeItem(e),!0}ownKeys(t){let e=["prototype"],s=this.ns+":";for(let i=0,n=ug(Object.keys(this.store)),o=n.length;i<o;i++){let l=n[i];l.indexOf(s)==0&&e.push(l.slice(s.length))}return e}};u(dh,cg,"Storage",16);var fh=dh,tc=new Proxy(ri(),new fh(globalThis.localStorage)),ec=new Proxy(ri(),new fh(globalThis.sessionStorage));