UNPKG

imba

Version:

Intuitive and powerful language for building webapps that fly

22 lines 155 kB
var Cu=Object.create;var Sr=Object.defineProperty;var Nu=Object.getOwnPropertyDescriptor;var Eu=Object.getOwnPropertyNames;var Mu=Object.getPrototypeOf,Ou=Object.prototype.hasOwnProperty;var Pu=(i,t)=>{for(var e in t)Sr(i,e,{get:t[e],enumerable:!0})},Vl=(i,t,e,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of Eu(t))!Ou.call(i,s)&&s!==e&&Sr(i,s,{get:()=>t[s],enumerable:!(r=Nu(t,s))||r.enumerable});return i};var Me=(i,t,e)=>(e=i!=null?Cu(Mu(i)):{},Vl(t||!i||!i.__esModule?Sr(e,"default",{value:i,enumerable:!0}):e,i)),Iu=i=>Vl(Sr({},"__esModule",{value:!0}),i);var kg={};Pu(kg,{Accessor:()=>Vi,Action:()=>br,CUSTOM_TYPES:()=>Th,ClassFlags:()=>xt,Comment:()=>mt,Component:()=>Ct,ComputedType:()=>Fi,CustomEvent:()=>C,Document:()=>pt,DocumentFragment:()=>Ye,EaseGroup:()=>Bn,Easer:()=>pi,Element:()=>y,ElementRoute:()=>pr,ElementRouteTo:()=>Ei,Emitter:()=>Ft,Event:()=>A,EventHandler:()=>ar,FocusEvent:()=>Xe,Fragment:()=>bt,HAS:()=>ju,HTMLButtonElement:()=>ue,HTMLElement:()=>F,HTMLHtmlElement:()=>Hr,HTMLInputElement:()=>he,HTMLLinkElement:()=>Dr,HTMLOptionElement:()=>ce,HTMLScriptElement:()=>Vr,HTMLSelectElement:()=>le,HTMLStyleElement:()=>jr,HTMLTextAreaElement:()=>ae,ImbaElement:()=>Sd,IntersectionEventDefaults:()=>$i,KeyboardEvent:()=>Je,LazyProxy:()=>Tr,Location:()=>oe,MouseEvent:()=>de,Node:()=>O,OBSERVED:()=>_,ObservableArray:()=>ki,PointerEvent:()=>Qe,Queue:()=>He,Ref:()=>Wt,RenderContext:()=>ct,Router:()=>Ni,SVGElement:()=>pe,SVGSVGElement:()=>Gr,Scheduler:()=>Er,ShadowRoot:()=>Fs,StyleDeclaration:()=>Rr,Text:()=>jt,Touch:()=>vi,UIEvent:()=>fe,Window:()=>Ms,__has__$:()=>Gl,__hooks__$:()=>Gi,__imba__$:()=>_r,__init__$:()=>Xt,__inited__$:()=>jl,__initor__$:()=>zi,__meta__$:()=>zl,__mixin__$:()=>Fu,__patch__$:()=>ku,__served__:()=>tc,accessor:()=>Lg,afterReconcile$:()=>Vu,afterVisit$:()=>Ru,appendChild$:()=>Au,atomic:()=>ug,augment$:()=>Oe,autorun:()=>lg,awaits:()=>hg,beforeReconcile$:()=>Hu,clearInterval:()=>Ql,clearTimeout:()=>Jl,colors:()=>Md,commit:()=>k,createAtom:()=>Km,createComment:()=>gt,createComponent:()=>Ch,createDynamic:()=>Vf,createElement:()=>Af,createFragment:()=>Hf,createIndexedList:()=>ld,createKeyedList:()=>cd,createLiveFragment:()=>Qf,createRef:()=>gg,createRenderContext:()=>De,createSVGElement:()=>Rf,createSlot:()=>tr,createTextNode:()=>Kr,customElements:()=>sf,decorate$:()=>Wu,defineConfig:()=>sc,defineTag:()=>Df,descriptor:()=>Cg,devlog$:()=>qu,disposeObservables:()=>yg,document:()=>Is,emit:()=>D,env:()=>rs,events:()=>xp,extend$:()=>Ui,getComputed:()=>bg,getDeepPropertyDescriptor:()=>Lr,getRenderContext:()=>Ic,getSuperTagType:()=>nf,getTagType:()=>dt,get_document:()=>me,has$:()=>Uu,hooks:()=>ts,hotkeys:()=>nm,hydrate:()=>$d,hydrator:()=>_n,idx$:()=>Ku,inited$:()=>Ju,is$:()=>zu,isa$:()=>Bu,iterable$:()=>Pe,listen:()=>V,locals:()=>Pg,logFormatter:()=>ah,matcher:()=>Bl,memofunc:()=>Sc,memofuncv:()=>wc,mount:()=>Xh,multi$:()=>Xu,observable:()=>ag,once:()=>M,parseTime:()=>Jt,proxy:()=>Ki,register$:()=>a,render:()=>kd,renderContext:()=>L,renderer:()=>q,reportChanged:()=>dg,reportInvalidated:()=>pg,reportObserved:()=>mg,router:()=>Om,run:()=>cg,rx:()=>gr,scheduler:()=>N,serve:()=>xc,session:()=>Ig,setInterval:()=>Xl,setTimeout:()=>Yl,spy:()=>fg,statics$:()=>Bi,styles:()=>qh,sup$:()=>Qu,toCamelCase:()=>rc,transitions:()=>di,unlisten:()=>St,unmount:()=>Qh,up$:()=>Du,use_devlog:()=>Lc,use_dom_bind:()=>Fd,use_dom_teleport:()=>ep,use_dom_transitions:()=>cp,use_events:()=>Sp,use_events_hotkey:()=>im,use_events_intersect:()=>Rp,use_events_keyboard:()=>Yn,use_events_mouse:()=>hr,use_events_mutate:()=>Qp,use_events_pointer:()=>Np,use_events_resize:()=>Bp,use_events_selection:()=>tm,use_events_touch:()=>Pp,use_hooks:()=>uc,use_router:()=>Mm,use_slots:()=>qf,use_styles:()=>Od,use_window:()=>tf,αaction:()=>wg,αautorun:()=>Sg,αbound:()=>fc,αcomputed:()=>vg,αlazy:()=>cc,αobservable:()=>$g,αprop:()=>Eg,αref:()=>xg,αthenable:()=>dc});module.exports=Iu(kg);var Xt=Symbol.for("#__init__"),zi=Symbol.for("#__initor__"),jl=Symbol.for("#__inited__"),Gi=Symbol.for("#__hooks__"),ku=Symbol.for("#__patch__"),Gl=Symbol.for("#has"),zl=Symbol.for("#meta"),_r=Symbol.for("imba"),Fu=Symbol.for("#__mixin__"),Bl=Symbol.for("#matcher"),wr=Symbol.for("#L"),Au=Symbol.for("#appendChild"),Ru=Symbol.for("#afterVisit"),Hu=Symbol.for("#beforeReconcile"),Vu=Symbol.for("#afterReconcile"),Du=Symbol.for("##up"),ju={SUPERCALLS:8,CONSTRUCTOR:16},xt={IsExtension:1,IsTag:2,HasDescriptors:4,HasSuperCalls:8,HasConstructor:16,HasFields:32,HasMixins:64,HasInitor:128,HasDecorators:256,IsObjectExtension:512,IsMixin:1024},Qt=new Map,Gu=globalThis[_r]||(globalThis[_r]={counter:0,classes:Qt});function kt(i,t={}){return Qt.has(i)||Qt.set(i,{symbol:Symbol(i.name),parent:Object.getPrototypeOf(i.prototype)?.constructor,for:i,uses:null,inits:null,id:Gu.counter++,...t}),Qt.get(i)}var Dl=new WeakMap;function zu(i,t){return i==t||t?.[Bl]?.(i)}function Bu(i,t){return typeof t=="string"?typeof i===t:t?.[Symbol.hasInstance]?.(i)}function Uu(i,t){return t?.[Gl]?.(i)??t?.includes?.(i)??t?.has?.(i)??!1}function Ku(i,t){return t?.indexOf?t.indexOf(i):Array.prototype.indexOf.call(i,t)}function qu(i,t,...e){return t&&t[wr]instanceof Function?i=t[wr](i,t,...e):globalThis[wr]instanceof Function&&(i=globalThis[wr](i,t,...e)),i}function Bi(i){return Dl.get(i)||Dl.set(i,{}).get(i)}function Pe(i){return i?.toIterable?.()||i}function Wu(i,t,e,r){let s,n=arguments.length,o=i.length,l=n<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,e):r;for(;o>0;)(s=i[--o])&&(l=(n<3?s(l):n>3?s(t,e,l):s(t,e))||l);return n>3&&l&&Object.defineProperty(t,e,l),l}function Yu(i,t){if(!i||!t)return!1;if(i.get)return t.get===i.get;if(i.set)return t.set===i.set;if(i.value)return i.value===t.value}function Ui(i,t,e,r={}){let s=i.constructor;!e&&t&&(e=Object.getOwnPropertyDescriptors(t),delete e.constructor,e[Xt]&&(console.warn(`Cannot define plain fields when extending class ${s.name}`),delete e[Xt]));let n=kt(s);if(n&&n.augments){let o=new Map;for(let l of Object.keys(e)){let h=Object.getOwnPropertyDescriptor(i,l);for(let u of n.augments){let f=o.get(u);f||o.set(u,f={});let c=Object.getOwnPropertyDescriptor(u.prototype,l);c&&!Yu(h,c)?console.warn("wont extend",l,c,h):f[l]=e[l]}}for(let[l,h]of o)Object.keys(h).length&&Ui(l.prototype,null,h)}return Object.defineProperties(i,e),i}function Oe(i,t){let e=kt(i),r=kt(t),s=r.parent;for(;s&&kt(s)?.flags&xt.IsMixin;){Oe(i,s),s=null;break}if(s&&!(i.prototype instanceof s))throw new Error(`Mixin ${t.name} has superclass not present in target class`);if(!r.augments){r.augments=new Set;let o=r.ref=Symbol(t.name),l=Object[Symbol.hasInstance];t.prototype[o]=!0,Object.defineProperty(t,Symbol.hasInstance,{value:function(h){return this===t?h&&!!h[o]:l.call(this,h)}})}if(i.prototype[r.ref])return i;if(r.uses)for(let o of r.uses)Oe(i,o);r.augments.add(i),e.uses||(e.uses=[]),e.uses.push(t);let n=Object.getOwnPropertyDescriptors(t.prototype);return delete n.constructor,n[Xt]&&(e.inits||(e.inits=[]),e.inits.push(t.prototype[Xt]),delete n[Xt]),Object.defineProperties(i.prototype,n),t?.mixed instanceof Function&&t.mixed(i),i}function Xu(i,t,...e){let r=t?class extends t{}:class{},s=kt(r,{symbol:i});for(let n of e)Oe(r,n);return r.prototype[i]=function(n,o,l){if(s.inits)for(let h of s.inits)h.call(this,n,!1,l)},r}var J={cache:{},self:null,target:null,proxy:new Proxy({},{apply:(i,t,e)=>Reflect.apply(J.target,t,e),get:(i,t)=>{let e=Reflect.get(J.target,t,J.self);return e instanceof Function?e.bind(J.self):e},set:(i,t,e,r)=>Reflect.set(J.target,t,e,J.self)})};function Qu(i,t){return J.self=i,J.target=J.cache[t],J.proxy}function a(i,t,e,r,s=null){let n=Object.getPrototypeOf(i.prototype),o=(r&(xt.HasMixins|xt.IsExtension))==xt.HasMixins,l;if(o&&(Qt.set(i,Qt.get(n.constructor)),n=Object.getPrototypeOf(n)),s){let u=r&xt.IsObjectExtension?s:s.prototype,f=kt(i);if(f.uses){s===u&&console.warn("Cannot extend object with mixins");for(let c of f.uses)Oe(s,c)}return r&xt.HasSuperCalls&&(J.cache[t]=Object.create(Object.getPrototypeOf(u),Object.getOwnPropertyDescriptors(u))),Ui(u,i.prototype),s}let h=n?.constructor;if(l=kt(i,{symbol:t}),Object.defineProperty(i,zl,{value:l,enumerable:!1,configurable:!0}),e&&i.name!==e&&Object.defineProperty(i,"name",{value:e,configurable:!0}),l.flags=r,r&xt.HasConstructor&&(i.prototype[zi]=t),l.uses)for(let u of l.uses)u.mixes?.(i);return h?.inherited instanceof Function&&h.inherited(i),i}function Ju(i,t){i[zi]===t&&(i[jl]?.(),i[Gi]&&i[Gi].inited(i))}var Ie=Symbol.for("#__listeners__"),Zu=/-./g,tc=new Set,ec=Symbol(),qi=class qi{static for(t){return new Proxy({},new this(t))}constructor(t){this.getter=t}get target(){return this.getter()}get(t,e){return this.target[e]}set(t,e,r){return this.target[e]=r,!0}};a(qi,ec,"LazyProxy",16);var Tr=qi;function Ki(i,t={}){return new Proxy(t,new Tr(i))}function Jt(i){let t=typeof i;if(t=="number")return i;if(t=="string"){if(/^\d+fps$/.test(i))return 1e3/parseFloat(i);if(/^([-+]?[\d\.]+)s$/.test(i))return parseFloat(i)*1e3;if(/^([-+]?[\d\.]+)ms$/.test(i))return parseFloat(i)}return null}function rc(i){return i.indexOf("-")>=0?i.replace(Zu,function(t){return t.charAt(1).toUpperCase()}):i}function Lr(i,t,e){if(!i)return;let r=Object.getOwnPropertyDescriptor(i,t);return r||i==e?r||void 0:Lr(Reflect.getPrototypeOf(i),t,e)}var Ul=function(i,t,e){let r,s,n;for(;(r=e)&&(e=e.next);)(s=e.listener)&&(e.path&&s[e.path]?n=t?s[e.path].apply(s,t):s[e.path]():n=t?s.apply(e,t):s.call(e)),e.times&&--e.times<=0&&(r.next=e.next,e.listener=null)};function V(i,t,e,r){let s,n,o;return s=i[Ie]||(i[Ie]={}),n=s[t]||(s[t]={}),o=n.tail||(n.tail=n.next={}),o.listener=e,o.path=r,n.tail=o.next={},o}function M(i,t,e){let r=V(i,t,e);return r.times=1,r}function St(i,t,e,r){if(!e)return;let s,n,o=i[Ie];if(o&&(s=o[t])){for(;(n=s)&&(s=s.next);)if(s==e||s.listener==e){n.next=s.next,s.listener=null;break}}}function D(i,t,e=null){let r;(r=i[Ie])&&(r[t]&&Ul(t,e,r[t]),r.all&&Ul(t,[t,e],r.all))}var ic=Symbol(),Wi=class Wi{emit(t,...e){return D(this,t,e)}on(t,...e){return V(this,t,...e)}once(t,...e){return M(this,t,...e)}un(t,...e){return St(this,t,...e)}};a(Wi,ic,"Emitter",0);var Ft=Wi;function sc(i){return i}function Yi(i,t){return typeof t=="string"?typeof i===t:t[Symbol.hasInstance]?.(i)}function nc(i){let t;return i&&((t=i.toIterable)?t.call(i):i)}var Kl=Symbol.for("#__init__"),ql=Symbol.for("#schedule"),Xi=Symbol.for("#frames"),Cr=Symbol.for("#interval"),Zt=Symbol.for("#stage"),te=Symbol.for("#scheduled"),Nr=Symbol.for("#version"),oc=Symbol.for("#fps"),Wl=Symbol.for("#ticker"),lc=globalThis.requestAnimationFrame||function(i){return globalThis.setTimeout(i,1e3/60)};var Gg=1/60,hc=Symbol(),Ji=class Ji{constructor(t=null){this[Kl](t)}[Kl](t=null,e=!0,r=!0){var s;this.owner=t&&(s=t.owner)!==void 0?s:null,this.target=t&&(s=t.target)!==void 0?s:null,this.active=t&&(s=t.active)!==void 0?s:!1,this.value=t&&(s=t.value)!==void 0?s:void 0,this.skip=t&&(s=t.skip)!==void 0?s:0,this.last=t&&(s=t.last)!==void 0?s:0}tick(t,e){return this.last=this.owner[Xi],this.target.tick(this,e),1}update(t,e){let r=this.active,s=t.value;return this.value!=s&&(this.deactivate(),this.value=s),(this.value||r||e)&&this.activate(),this}queue(){this.owner.add(this)}activate(){return this.value===!0?this.owner.on("commit",this):this.value===!1||typeof this.value=="number"&&(this.value/16.666666666666668<=2?this.owner.on("raf",this):this[Cr]=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[Cr]&&(globalThis.clearInterval(this[Cr]),this[Cr]=null),this.active=!1,this}};a(Ji,hc,"Scheduled",16);var Qi=Ji,ac=Symbol(),Zi=class Zi{constructor(){var t=this;this.id=Symbol(),this.queue=[],this.stage=-1,this[Zt]=-1,this[Xi]=0,this[te]=!1,this[Nr]=0,this.listeners={},this.intervals={},this.commit=function(){return t.add("commit"),t},this[oc]=0,this.$promise=null,this.$resolve=null,this[Wl]=function(e){return t[te]=!1,t.tick(e)}}touch(){return this[Nr]++}get version(){return this[Nr]}add(t,e=!1){return(e||this.queue.indexOf(t)==-1)&&this.queue.push(t),this[te]||this[ql](),this}get committingΦ(){return this.queue.indexOf("commit")>=0}get syncingΦ(){return this[Zt]==1}listen(t,e){let r=this.listeners[t],s=!r;return r||(r=this.listeners[t]=new Set),r.add(e),t=="raf"&&s&&this.add("raf"),this}unlisten(t,e){var r;let s=this.listeners[t];return s&&s.delete(e),t=="raf"&&s&&s.size==0&&(r=this.listeners.raf,delete this.listeners.raf),this}on(t,e){return this.listen(t,e)}un(t,e){return this.unlisten(t,e)}get promise(){var t=this;return this.$promise||(this.$promise=new Promise(function(e){return t.$resolve=e}))}tick(t){var e=this;let r=this.queue,s=this[Xi]++;if(this.ts||(this.ts=t),this.dt=t-this.ts,this.ts=t,this.queue=[],this[Zt]=1,this[Nr]++,r.length)for(let n=0,o=nc(r),l=o.length;n<l;n++){let h=o[n];typeof h=="string"&&this.listeners[h]?this.listeners[h].forEach(function(u){if(Yi(u.tick,Function))return u.tick(e,h);if(Yi(u,Function))return u(e,h)}):Yi(h,Function)?h(this.dt,this):h.tick&&h.tick(this.dt,this)}return this[Zt]=this[te]?0:-1,this.$promise&&(this.$resolve(this),this.$promise=this.$resolve=null),this.listeners.raf&&this.add("raf"),this}[ql](){return this[te]||(this[te]=!0,this[Zt]==-1&&(this[Zt]=0),lc(this[Wl])),this}schedule(t,e){var s,n;return e||(e=t[s=this.id]||(t[s]={value:!0})),(e[n=this.id]||(e[n]=new Qi({owner:this,target:t}))).update(e,!0)}unschedule(t,e={}){e||(e=t[this.id]);let r=e&&e[this.id];return r&&r.active&&r.deactivate(),this}};a(Zi,ac,"Scheduler",16);var Er=Zi,N=new Er;function k(){return N.add("commit").promise}function Yl(i,t){return globalThis.setTimeout(function(){i(),k()},t)}function Xl(i,t){return globalThis.setInterval(function(){i(),k()},t)}var Ql=globalThis.clearInterval,Jl=globalThis.clearTimeout,ke=globalThis.imba||(globalThis.imba={});ke.commit=k;ke.setTimeout=Yl;ke.setInterval=Xl;ke.clearInterval=Ql;ke.clearTimeout=Jl;var ts={on:function(i,t){return V(this,i,t)},inited:function(i){return D(this,"inited",[i])}};function uc(){return!0}function th(i,t){return typeof t=="string"?typeof i===t:t[Symbol.hasInstance]?.(i)}function cc(i,t,e){if(e.get){let r=e.get;e.get=function(){let s=r.call(this);return Object.defineProperty(this,t,{enumerable:!1,value:s}),s}}return e}function fc(i,t,e){var r,s;if(th(e.value,Function)){let n=e.value;e.get=function(){if(this==i)return n;let o=n.bind(this);return Object.defineProperty(this,t,{enumerable:!1,value:o}),o},r=e.value,delete e.value,s=e.writable,delete e.writable}return e}var Zl=new WeakMap;function dc(i,t,e){let r=this[0]||{},s=e.value,n=Symbol(),o=new WeakMap,l=Zl.get(i),h=r.timeout||20*1e3,u=""+(i.constructor?.name||"")+"."+String(typeof t=="symbol"?t.description:t);if(l||Zl.set(i,l={}),l.key)throw new Error("@thenable "+u+" not allowed - @thenable "+l.key+" already defined");if(!th(s,Function))throw new Error("@thenable "+u+" only supports functions");if(s.length>0)throw new Error("@thenable "+u+" methods cannot be called with arguments");let f=function(g){return console.trace("@thenable "+u+" took more than "+h+"ms - make sure method does not return self.",g)},c=function(g){let d=o.get(g);return d||o.set(g,d={}),d},p=function(g,d){let m=this,b=c(m);return(b.promise||(b.promise=new Promise(function(I,Ne){let S=r.timeout!==!1?setTimeout(f,r.timeout||2e4,m):null,Q=function($t){return S&&clearTimeout(S),b.met=!0,b.error=$t,b.promise=null,b.wrapped=null,console.trace("@thenable "+u+" threw error",$t),Ne($t)};return m[t]().then(function(){return S&&clearTimeout(S),b.met=!0,b.promise=null,b.wrapped=null,I(m)},Q)}))).then(g,d)};return Object.defineProperty(i,"then",{enumerable:!1,configurable:!0,get:function(){return c(this).met?null:p}}),e.value=function(g){let d=c(this);return d.met?d.error?Promise.reject(d.error):Promise.resolve(this):(d.wrapped??(d.wrapped=Promise.resolve(s.call(this,d))),d.wrapped)},e.value.reset=function(g){let d=c(g);o.delete(g)},e.value.check=c,e}var os=Me(require("cluster")),K=Me(require("fs")),Rt=Me(require("path")),oh=require("events");var es=Me(require("path")),pc=Symbol(),ee,rs=new(ee=class{get rootDir(){return process.env.IMBA_OUTDIR||es.default.dirname(process.env.pm_exec_path||process.argv[1])}get publicPath(){return es.default.resolve(this.rootDir,process.env.IMBA_PUBDIR||globalThis.IMBA_PUBDIR||"public")}},a(ee,pc,"Env",0),ee);var lh=Me(require("http"));function U(i){let t;return i&&((t=i.toIterable)?t.call(i):i)}function sh(i,t){return typeof t=="string"?typeof i===t:t[Symbol.hasInstance]?.(i)}var nh=Symbol.for("#setup"),eh=Symbol.for("#setup?"),mc=Symbol.for("#dom"),gc=Symbol.for("#server"),Fe={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"}},rh={id:Date.now()},z=globalThis.process,yc=Symbol(),ls=class ls extends Set{call(t,...e){var r;r=[];for(let s of U(this))r.push(s[t](...e));return r}close(t={}){var e;e=[];for(let r of U(this))e.push(r.close(t));return e}reload(t={}){var e;e=[];for(let r of U(this))e.push(r.reload(t));return e}broadcast(t,...e){var r;r=[];for(let s of U(this))r.push(s.broadcast(t,...e));return r}emit(t,e){var r;r=[];for(let s of U(this))r.push(s.emit(t,e));return r}sseEnd(){let t=[];for(let e of U(this))for(let r of U(e.clients))t.push(new Promise(function(s){return r.on("finish",s),r.end()}));return Promise.all(t)}};a(ls,yc,"Servers",0);var is=ls,At=new is,bc=Symbol(),re,ih=new(re=class extends oh.EventEmitter{constructor(){var t;super(...arguments),t=this,this.autoreload=!1,this.state={},globalThis.IMBA_RUN&&(os.default.isWorker?z.on("message",function(e){if(t.emit("message",e),e[0]=="emit")return t.emit(...e.slice(1))}):z.on("message",function(e){if(e[0]=="emit")return t.emit(...e.slice(1))}))}[nh](){var t=this;if(this[eh]!=!0&&(this[eh]=!0,!0))return this.on("rebuild",function(e){let r=globalThis.IMBA_MANIFEST;return globalThis.IMBA_MANIFEST=e,At.broadcast("rebuild",e)}),this.on("reloadHard",async function(e){return At.broadcast("reloadHard",e),await At.sseEnd(),z.exit(0)}),this.on("reloading",function(e){var r;t.state.reloading=!0,r=[];for(let s of U(At))r.push(s.pause());return r}),this.on("reloaded",async function(e){var r;t.state.reloaded=!0,At.broadcast("reloaded"),await new Promise(function(n){return setTimeout(n,100)}),r=[];for(let n of U(At))r.push(n.close());let s=r;return setTimeout(function(){return z.exit(0)},100),await Promise.all(s),z.exit(0)}),!0}send(t){if(sh(z.send,Function))return z.send(t)}on(t,e){return super.on(...arguments)}reload(){if(!(this.isReloading!=!0&&(this.isReloading=!0,!0)))return this;if(this.state.reloading=!0,!z.env.IMBA_SERVE){console.warn("not possible to gracefully reload servers not started via imba start");return}this.send("reload")}},a(re,bc,"Process",24),re);function hh(i,t=[],e=0){let r=globalThis.IMBA_MANIFEST[i];if(t.indexOf(i)>=0)return t;if(r?.imports)for(let s=0,n=U(r?.imports),o=n.length;s<o;s++){let l=n[s];t.push(l),hh(l,t,e+1)}return t}var vc=Symbol(),hs=class hs{constructor(t,e,r={}){this.server=t,this.url=e,[this.pathname,this.query]=e.split("?"),this.ext=Rt.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,Fe[this.ext.slice(1)]||{}),this.headers["max-age"]=864e5,r.imports&&t.options.preload!==!1&&(this.headers.Link=hh(e).map(function(s){return"<"+s+">; rel=modulepreload; as=script"}).join(", ")),this.path=t.localPathForUrl(e)}respond(t,e){var r=this;return K.default.access(this.path,K.default.constants.R_OK,function(s){if(s)return e.writeHead(404,{}),e.end();try{if(r.server.options.setHeaders&&r.server.options.setHeaders(e,r.path),globalThis.BUN)return K.default.readFile(r.path,function(n,o){return e.writeHead(200,r.headers),e.end(o)});{let n=K.default.createReadStream(r.path);return e.writeHead(200,r.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)}};a(hs,vc,"AssetResponder",16);var ss=hs,$c=Symbol(),as=class as{static wrap(t,e={}){return new this(t,e)}localPathForUrl(t){var n;let e,r,s=t.replace(/\?.*$/,"");return(n=this.urlToLocalPathMap)[s]??(n[s]=(e=Rt.default.resolve(rs.publicPath,"."+s),r=K.default.existsSync(e)&&e,!r&&this.staticDir&&(e=Rt.default.resolve(this.staticDir,"."+s),r=K.default.existsSync(e)&&e),r))}headersForAsset(t){let e,r=Rt.default.extname(t);return e=Object.assign({"Content-Type":"text/plain","Access-Control-Allow-Origin":"*","cache-control":"public"},Fe[r.slice(1)]||{})}get manifest(){return globalThis.IMBA_MANIFEST||{}}constructor(t,e={}){var r=this;At.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||"",z.env.IMBA_PATH&&(this.devtoolsPath=Rt.default.resolve(z.env.IMBA_PATH,"hmr.js")),this.scheme=sh(t,lh.default.Server)?"http":"https";let s=this.server._events.request,n=globalThis[mc];t.off("request",s),s[gc]=this,t.on("listening",function(){let o=r.server.address(),l=o.address;(l=="::"||l=="0.0.0.0")&&(l="localhost");let h=""+r.scheme+"://"+l+":"+o.port+"/";if(!z.env.IMBA_CLUSTER)return console.log("listening on "+h)}),globalThis.IMBA_HMR&&(globalThis.IMBA_HMR_PATH="/__hmr__.js"),this.handler=function(o,l){var d;let h,u=o.constructor.name=="Http2ServerRequest",f=o.url;if(r.paused||r.closed)return l.statusCode=302,l.setHeader("Location",o.url),u||l.setHeader("Connection","close"),r.closed?(u&&o.stream.session.close(),l.end()):r.stalledResponses.push(l);if(f=="/__imba__.mjs"){l.writeHead(200,Fe.mjs);let m=Rt.default.resolve(z.env.IMBA_PATH,"dist","imba.mjs");return K.default.createReadStream(m).pipe(l)}if(globalThis.IMBA_HMR){if(f=="/__hmr__.json")return l.writeHead(200,Fe.json),l.end(JSON.stringify(rh));if(f=="/__hmr__.js"&&r.devtoolsPath){let m=K.default.createReadStream(r.devtoolsPath);return l.writeHead(200,Fe.js),m.pipe(l)}if(f=="/__hmr__"){let m={"Content-Type":"text/event-stream","Cache-Control":"no-cache"};return u||(m.Connection="keep-alive"),l.writeHead(200,m),r.clients.add(l),r.broadcast("init",globalThis.IMBA_MANIFEST,[l]),r.broadcast("state",rh,[l]),o.on("close",function(){return r.clients.delete(l)}),!0}}let c=o.headers,p;u?p=c[":scheme"]+"://"+c[":authority"]:p=(o.connection.encrypted?"https":"http")+"://"+c.host;let g=r.manifest[f];if(g&&r.localPathForUrl(f))return((d=r.assetResponders)[f]||(d[f]=new ss(r,f,g))).respond(o,l);if((f.match(/\.[A-Z\d]{8}\./)||f.match(/\.\w{1,4}($|\?)/))&&(h=r.localPathForUrl(f)))try{let m=r.headersForAsset(h);if(e.setHeaders&&e.setHeaders(l,h),globalThis.BUN)return K.default.readFile(h,function(b,T){return b?(l.writeHead(500,{}),l.write("Error getting the file: "+b)):(l.writeHead(200,m),l.end(T))});{let b=K.default.createReadStream(h);return l.writeHead(200,m),b.pipe(l)}}catch{return l.writeHead(503,{}),l.end()}if(n){let m=new n.Location(o.url,p);return n.Document.create({location:m},function(){return s(o,l)})}else return s(o,l)},t.on("request",this.handler),t.on("close",function(){return console.log("server is closing!")}),globalThis.IMBA_RUN&&(os.default.isWorker||z.env.IMBA_WATCH)&&(ih[nh](),ih.send("serve"))}broadcast(t,e={},r=this.clients){e=JSON.stringify(e);let s="data: "+e+`


`;for(let n of U(r))n.write("event: "+t+`
`),n.write(`id: imba
`),n.write(s);return this}pause(){return this.paused!=!0&&(this.paused=!0,!0)&&this.broadcast("paused"),this}resume(){if(this.paused!=!1&&(this.paused=!1,!0))return this.broadcast("resumed"),this.flushStalledResponses()}flushStalledResponses(){for(let t=0,e=U(this.stalledResponses),r=e.length;t<r;t++)e[t].end();return this.stalledResponses=[]}close(){var t=this;return this.pause(),new Promise(function(e){return t.closed=!0,t.server.close(e),t.flushStalledResponses()})}};a(as,$c,"Server",16);var ns=as;function xc(i,...t){return ns.wrap(i,...t)}var ie={};function Sc(i,t,e){if(t!=null){let r=ie[i]||(ie[i]=new WeakMap);return r.get(t)||r.set(t,(e.memoized=i)&&e).get(t)}return e}function wc(i,t,e,r){let s=ie[i]||(ie[i]=new WeakMap),n=s.get(t);n||s.set(t,n={f:null,o:null,p:null});for(let o=0,l=Pe(r),h=l.length;o<h;o++){let u=l[o],c=u!==null&&(typeof u=="object"||typeof u=="function")?n.o||(n.o=new WeakMap):n.p||(n.p=new Map),p=c.get(u);p||c.set(u,p={f:null,o:null,p:null}),n=p}return n.f||(n.f=(e.memoized=i)&&e)}function _c(i,t){return typeof t=="string"?typeof i===t:t[Symbol.hasInstance]?.(i)}var Ae=Symbol.for("#idler"),Re=Symbol.for("#resolve"),Tc=Symbol(),us=class us extends Set{constructor(){super(),this[Ae]=Promise.resolve(this)}emit(t,...e){return D(this,t,e)}on(t,...e){return V(this,t,...e)}once(t,...e){return M(this,t,...e)}un(t,...e){return St(this,t,...e)}add(t){var e=this;if(_c(t,Function)&&(t=t()),!this.has(t)){let r=this.size==0;super.add(t),r&&(this[Ae]=this[Re]=null,this.emit("busy",this)),this.emit("add",t,this);let s=function(){return e.delete(t)};t.then(s,s)}return t}delete(t){return super.delete(t)?(this.emit("delete",t,this),this.size==0&&(this[Re]&&(this[Re](!0),this[Re]=null),this.emit("idle",this)),!0):!1}get idle(){var t=this;return this[Ae]||(this[Ae]=new Promise(function(e){return t.size==0?e(!0):t[Re]=e}))}get idleΦ(){return this.size==0}then(t,e){return this.idle.then(t,e)}};a(us,Tc,"Queue",24);var He=us;function ah(i,t){let e=[],r=[];for(let s=0,n=Pe(i),o=n.length;s<o;s++){let l=n[s];if(s%2!=0)continue;let h=i[s+1];l==""?(r.push("%s"),e.push(""+"\x1B[40m\x1B[32m"+h+"\x1B[0m")):(r.push("%s %O"),e.push("\x1B[44m\x1B[97m"+l+"\x1B[0m"),e.push(h))}return[r.join(" "),...e]}var Mr=Symbol.for("#L");function Lc(){return globalThis[Mr]||(globalThis[Mr]=globalThis[Mr]||ah),!0}function Cc(i){let t;return i&&((t=i.toIterable)?t.call(i):i)}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}]},E={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},cs=Object.keys(Z);for(let i=0,t=Cc(cs),e=t.length;i<e;i++){let r=t[i],s=Z[r];s.name=r+"Element",s.up=Z[cs[s[0]]]}for(let i=0,t=Object.keys(E),e=t.length,r,s;i<e;i++)r=t[i],s=E[r],E[r]=Z[cs[s]],r.indexOf("svg_")==0&&(E[r.replace("_",":")]=E[r]);var fs=require("async_hooks");var uh=Symbol.for("#toStringDeopt"),Ve=Symbol.for("#named"),ch=Symbol.for("#symbols"),fh=Symbol.for("#batches"),dh=Symbol.for("#extras"),ds=Symbol.for("#stacks"),Nc=Symbol(),ps=class ps{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[Ve]||(this[Ve]={});let r=this[Ve][t];return r!=e&&(r&&this.decr(r),e&&this.incr(e),this[Ve][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 r=this;let s=this.stacks,n=s[t]||0;return n<1&&this.add(t),e>0&&setTimeout(function(){return r.decr(t)},e),s[t]=Math.max(n,0)+1}decr(t){let e=this.stacks,r=e[t]||0;return r==1&&this.remove(t),e[t]=Math.max(r,1)-1}reconcile(t,e,r){let s=this[ch],n=this[fh],o=!0;if(!s)s=this[ch]=[t],n=this[fh]=[e||""],r&&(this.dom.className||"").indexOf(r)==-1&&(s.push(t),n.push(r)),this.toString=this.valueOf=this[uh];else{let l=s.indexOf(t),h=e||"";l==-1?(s.push(t),n.push(h),r&&(this.dom.className||"").indexOf(r)==-1&&(s.push(t),n.push(r))):n[l]!=h?n[l]=h:o=!1}o&&(this[dh]=" "+n.join(" "),this.sync())}valueOf(){return this.string}toString(){return this.string}[uh](){return this.string+(this[dh]||"")}sync(){return this.dom.flagSync$()}get stacks(){return this[ds]||(this[ds]={})}};a(ps,Nc,"Flags",16);var Ht=ps;var ph=Symbol.for("#__init__"),ms=Symbol.for("#getRenderContext"),Ec=Symbol.for("#getDynamicContext"),Mc=Symbol.for("#removeFromCache"),L={context:null,document:null,createTextNode:function(i){return globalThis.document.createTextNode(i)}},Oc=Symbol(),ys=class ys{constructor(t=null){this[ph](t)}[ph](t=null,e=!0,r=!0){var s;this.stack=t&&(s=t.stack)!==void 0?s:[],this.moving=t&&(s=t.moving)!==void 0?s:new Set}push(t){return this.stack.push(t)}pop(t){return this.stack.pop()}};a(ys,Oc,"Renderer",16);var gs=ys,q=new gs,Pc=Symbol(),Or=class Or extends Map{constructor(t,e=null){super(),this._=t,this.sym=e}pop(){return L.context=null}[ms](t){let e=this.get(t);return e||this.set(t,e=new Or(this._,t)),L.context=e}[Ec](t,e){return this[ms](t)[ms](e)}[Mc](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,L.context==this&&(L.context=null),e==0){let r=t;if(typeof r=="number"&&(r=String(r)),typeof r=="string"){let s=this.text||(this.text=L.createTextNode(r));return r!=s.textContent&&(s.textContent=r),s}}return this.get(t)}cache(t){return this.set(this.value,t),t}};a(Or,Pc,"RenderContext",16);var ct=Or;function De(i,t=Symbol(),e=i){return L.context=i[t]||(i[t]=new ct(e,t))}function Ic(){let i=L.context,t=i||new ct(null);return globalThis.DEBUG_IMBA&&!i&&q.stack.length>0&&console.trace("detected unmemoized nodes in",q.stack.slice(0),"see https://imba.io",t),i&&(L.context=null),t}function et(i,t){return typeof t=="string"?typeof i===t:t[Symbol.hasInstance]?.(i)}function Ke(i){let t;return i&&((t=i.toIterable)?t.call(i):i)}var Es=Symbol.for("#parent"),Sh=Symbol.for("#context"),mh=Symbol.for("#closestNode"),kc=Symbol.for("#parentNode"),Vt=Symbol.for("#__init__"),Fc=Symbol.for("##inited"),bs=Symbol.for("#getRenderContext"),Ac=Symbol.for("#getDynamicContext"),vs=Symbol.for("#replaceChild"),We=Symbol.for("#appendChild"),gh=Symbol.for("#removeChild"),wt=Symbol.for("#insertInto"),yh=Symbol.for("#insertChild"),je=Symbol.for("#removeFrom"),bh=Symbol.for("#removeFromDeopt"),se=Symbol.for("#replaceWith"),vh=Symbol.for("#replaceWithDeopt"),$s=Symbol.for("#placeholderNode"),Rc=Symbol.for("#attachToParent"),Hc=Symbol.for("#detachFromParent"),Vc=Symbol.for("#placeChild"),Dc=Symbol.for("#beforeReconcile"),jc=Symbol.for("#afterReconcile"),Gc=Symbol.for("#afterVisit"),zc=Symbol.for("#visitContext"),xs=Symbol.for("#document"),kr=Symbol.for("#htmlNodeName"),$h=Symbol.for("#ImbaElement"),Ss=Symbol.for("#flags"),ne=Symbol.for("#scripts"),Pr=Symbol.for("#location"),ws=Symbol.for("##document"),wh=Symbol.for("##parent"),Bc=Symbol.for("##up"),_s=Symbol.for("##context"),Ge=Symbol.for("#domNode"),ze=Symbol.for("##placeholderNode"),xh=Symbol.for("#domDeopt"),Uc=Symbol.for("#insertIntoDeopt"),Ts=Symbol.for("##classList"),Be=Symbol.for("##style"),Ls=Symbol.for("##dataset"),ft=Symbol.for("#asset"),Cs=Symbol.for("#innerHTML"),Ue=Symbol.for("##visitContext"),Kc=Symbol.for("#isRichElement"),qe=Symbol.for("#src"),qc=Symbol.for("#getSlot"),Wc=Symbol.for("#cssns"),Yc=Symbol.for("#cssid"),Xc=Symbol.for("#dom"),Qc={},Fr=null,Jc=Symbol(),As=class As extends URL{};a(As,Jc,"Location",0);var oe=As,Zc=Symbol(),Rs=class Rs{get document(){return this[xs]||(this[xs]=new this.Document(this))}get location(){return this.document.location}};a(Rs,Zc,"Window",0);var Ms=Rs;function tf(){return globalThis.imba.uses_window=!0,!0}var ef={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},tt=null,_h={},rf=Symbol(),Hs=class Hs{define(){return this}get(){return this}upgrade(){}whenDefined(){}};a(Hs,rf,"CustomElementRegistry",0);var Os=Hs,sf=new Os,Th={};function dt(i,t){let e=i;if(typeof i=="string"&&(i=Z[i]||E[i]||Z[i+"Element"]||E["svg_"+i]),et(i,O))return i;if(!i)return dt("HTML");if(i&&!i.klass){let r=Symbol(),n=class n extends dt(i.up){};a(n,r,"element",0);let s=n;i.klass=s}if(i&&!i.idl){i.idl=!0;let r=Object.getOwnPropertyDescriptors(i.klass.prototype);for(let s=i[1],n=0,o=Object.keys(s),l=o.length,h,u;n<l;n++){h=o[n],u=s[h];let f=u==1?h:u;r[f]||f=="style"||Object.defineProperty(i.klass.prototype,h,{set:function(c){this.setAttribute(f,c)},get:function(){return this.getAttribute(f)}})}}return i.klass}function nf(i,t,e){var n;let r=dt(i,t);if(!(r==e||et(r.prototype,e)||r.prototype[kr])){let o=r.prototype[$h];if(!o){let l=Symbol();o=(n=class extends r{constructor(){super(...arguments),this.__slots={},this.__F=0}},a(n,l,"CustomBuiltInElement",16),n),r.prototype[$h]=o;let h=Object.getOwnPropertyDescriptors(e.prototype);Object.defineProperties(o.prototype,h),o.prototype[kr]=i}return o}return r}var Ir=function(i){let t=typeof i=="string"?i:String(i);return t.indexOf('"')>=0&&(t=t.replace(/\"/g,"&quot;")),t},Ps=function(i,t){let e=typeof i=="string"?i:String(i);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},of=Symbol(),zr=class zr{static create(t,e){let r=new zr;return r[Sh]=t,r.location=t.location,Fr||(Fr=new fs.AsyncLocalStorage),Fr.run(r,e),r}constructor(){}get flags(){return this[Ss]||(this[Ss]=new Ht({classList:new Ar(this)}))}get scripts(){return this[ne]||(this[ne]=[])}set location(t){typeof t=="string"&&(t=new oe(t)),this[Pr]=t}get location(){return this[Pr]||(this[Pr]=new oe("http://localhost/"))}createElement(t){let e=dt(t),r=new e(t);return r.nodeName=t,r}createElementNS(t,e){if(t=="http://www.w3.org/2000/svg"){let r=dt("svg_"+e),s=new r;return s.nodeName=e,s}return this.createElement(e)}createTextNode(t){return new jt(t)}createComment(t){return new mt(t)}createDocumentFragment(){return new Ye}getElementById(t){return null}};a(zr,of,"Document",16);var pt=zr,st=new pt;L.createTextNode=function(i){return st.createTextNode(i)};var Is=st;function me(){return Fr&&Fr?.getStore?.()||st}var lf=Symbol(),Br=class Br{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 Br(t,this.classes.slice(0))}toString(){return this.classes.join(" ").trim()}};a(Br,lf,"DOMTokenList",16);var Ar=Br,hf=Symbol(),Vs=class Vs{constructor(){}removeProperty(t){var e;return e=this[t],delete this[t],e}setProperty(t,e){return this[t]=e}toString(){let t=[];for(let e=this,r=0,s=Object.keys(e),n=s.length,o,l;r<n;r++)o=s[r],l=e[o],et(l,Function)||t.push(""+o+": "+l);return t.join(";")}};a(Vs,hf,"StyleDeclaration",16);var Rr=Vs,af=Symbol(),Ur=class Ur{static wrap(t){return new Proxy(t.attributes,new Ur)}set(t,e,r){return t["data-"+e]=r,!0}get(t,e){return t["data-"+e]}};a(Ur,af,"DataSet",0);var ks=Ur,uf={get(i,t){let e=i,r;for(;e&&r==null;)(e=e[Es])&&(r=e[t]);return r}},cf=Symbol(),Ds=class Ds{toString(){return this.outerHTML}get outerHTML(){return""}text$(t){return this.textContent=t,this}get ownerDocument(){return this[ws]||(this[ws]=me())}get[Es](){return this[wh]||this.parentNode||this[Bc]}get[Sh](){return this[_s]||(this[_s]=new Proxy(this,uf))}get[mh](){return this}get[kc](){return this[Es]?.[mh]}[Vt](){return this}[Fc](){return this}[bs](t){return De(this,t)}[Ac](t,e){return this[bs](t)[bs](e)}[vs](t,e){let r=this[yh](t,e);return this[gh](e),r}[We](t){return t[wt](this,null)}[gh](t){return t[je](this)}[wt](t,e){return e?t.insertBefore(this,e):t.appendChild(this),this}[yh](t,e){return t[wt](this,e)}[je](t){return t.removeChild(this)}[bh](t){return t.removeChild(this[Ge]||this)}[se](t,e){return e[vs](t,this)}[vh](t,e){return e[vs](t,this[Ge]||this)}get[$s](){return this[ze]||(this[ze]=st.createComment("placeholder"))}set[$s](t){let e=this[ze];this[ze]=t,e&&e!=t&&e.parentNode&&e[se](t)}[Rc](){let t=this[Ge],e=t&&t.parentNode;return t&&e&&t!=this&&(this[Ge]=null,this[wt](e,t),t[je](e)),this}[Hc](){this[xh]!=!0&&(this[xh]=!0,!0)&&(this[se]=this[vh],this[je]=this[bh],this[wt]=this[Uc]);let t=this[$s];return this.parentNode&&t!=this&&(t[wt](this.parentNode,this),this[je](this.parentNode)),this[Ge]=t,this}[Vc](t,e,r){let s=typeof t;if(s==="undefined"||t===null){if(r&&et(r,mt))return r;let n=new mt("");return r?r[se](n,this):n[wt](this,null)}if(t===r)return t;if(s!=="object"){let n,o=t;return e&128&&e&256,r?et(r,jt)?(r.textContent=o,r):(n=Is.createTextNode(o),r[se](n,this),n):(this.appendChild(n=Is.createTextNode(o)),n)}else return r?r[se](t,this):t[wt](this,null)}};a(Ds,cf,"Node",0);var O=Ds,ff=Symbol(),js=class js extends O{constructor(t){super(),this.textContent=t??""}get outerHTML(){return this.textContent}};a(js,ff,"Text",16);var jt=js,df=Symbol(),Gs=class Gs extends O{constructor(t){super(),this.value=t}get outerHTML(){return"<!-- "+Ps(this.value)+" -->"}toString(){return this.tag&&this.tag.toNodeString?this.tag.toNodeString():this.outerHTML}};a(Gs,df,"Comment",16);var mt=Gs,pf=Symbol(),Dt=class Dt extends O{constructor(t){super(),this.nodeName=t,this.childNodes=[],this.attributes={}}emit(t,e,r={bubbles:!0}){console.warn("Element#emit not supported on node")}get classList(){return this[Ts]||(this[Ts]=new Ar(this))}get style(){return this[Be]||(this[Be]=new Rr)}get dataset(){return this[Ls]||(this[Ls]=ks.wrap(this))}get richValue(){return this.value}set richValue(t){this.value=t}set asset(t){this[ft]=t}get asset(){return this[ft]}appendChild(t){return this.childNodes.push(t),t.parentNode=this,t}removeChild(t){let e=this.childNodes.indexOf(t);return e>=0&&this.childNodes.splice(e,1),this}replaceChild(t,e){let r=this.childNodes.indexOf(e);return r>=0&&(this.childNodes.splice(r,1,t),t.parentNode=this),e}insertBefore(t,e){let r=this.childNodes.indexOf(e);return this.childNodes.splice(r,0,t),this}setAttribute(t,e){var r;return e==null?(r=this.attributes[t],delete this.attributes[t]):this.attributes[t]=e,this}setAttributeNS(t,e,r){return this.setAttribute(t+":"+e,r)}getAttribute(t){return this.attributes?this.attributes[t]:void 0}getAttributeNS(t,e){return this.getAttribute(t+":"+e)}removeAttribute(t){var e;return e=this.attributes[t],delete this.attributes[t],!0}addEventListener(){return this}removeEventListener(){return this}resolve(){return this}set innerHTML(t){this[Cs]=t}get innerHTML(){let t="";if(this[Cs])return this[Cs];if(this.textContent!=null)return Ps(this.textContent,this.nodeName);for(let e=0,r=Ke(this.childNodes),s=r.length;e<s;e++){let n=r[e];typeof n=="string"?t+=Ps(n,this.nodeName):et(n,Number)?t+=""+n:n&&(t+=n.outerHTML)}return t}get outerHTML(){let t=this.nodeName,e=this[kr],r=""+t;e&&(r=""+e+" is='"+t+"'",t=e);let s,n=this.id,o=this.classList.toString();this.dehydrate&&(o=o?"_ssr_ "+o:"_ssr_",this.dehydrate()),n&&(r+=' id="'+Ir(n)+'"'),o&&(r+=' class="'+Ir(o)+'"');for(let l=this.attributes,h=0,u=Object.keys(l),f=u.length,c,p;h<f;h++)c=u[h],p=l[c],!(c=="id"&&n)&&(r+=" "+c+'="'+Ir(p)+'"');return this[Be]&&(r+=' style="'+Ir(this[Be].toString())+'"'),ef[t]?"<"+r+">":"<"+r+">"+this.innerHTML+"</"+t+">"}get firstChild(){return this.childNodes[0]}get lastChild(){return this.childNodes[this.childNodes.length-1]}get firstElementChild(){let t=this.childNodes.length,e=0;for(;e<t;){let r=this.childNodes[e++];if(et(r,Dt))return r}return null}get lastElementChild(){let t=this.childNodes.length;for(;t>0;){let e=this.childNodes[--t];if(et(e,Dt))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}[Dc](){return this}[jc](){return this}[Gc](){this.render&&this.render(),this[Ue]&&(this[Ue]=null)}get[zc](){return this[Ue]||(this[Ue]={})}get flags(){return this.$flags||(this.$flags=new Ht(this),this.flag$==Dt.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 r=Lr(this,t,Dt);!r||!r.set?this.setAttribute(t,e):this[t]=e}};a(Dt,pf,"Element",16);var y=Dt;y.prototype.setns$=y.prototype.setAttributeNS;y.prototype[Kc]=!0;var mf=Symbol(),zs=class zs extends y{constructor(){super(null)}get outerHTML(){return this.innerHTML}};a(zs,mf,"DocumentFragment",16);var Ye=zs,gf=Symbol(),Bs=class Bs extends Ye{get outerHTML(){return this.innerHTML}};a(Bs,gf,"ShadowRoot",0);var Fs=Bs,yf=Symbol(),Us=class Us extends y{};a(Us,yf,"HTMLElement",0);var F=Us,bf=Symbol(),Ks=class Ks extends F{constructor(){super(...arguments),super[Vt]||this[Vt]()}[Vt](t=null,e=!0,r=!0){e&&super[Vt]&&super[Vt](...arguments),this.hmr=t?t.hmr:void 0}get scripts(){return this[ne]||(this[ne]=[])}get outerHTML(){let t=tt;tt=this;let e=super.outerHTML,r=new Set,s=[],n=[];if(globalThis.IMBA_HMR_PATH&&this.hmr!==!1&&n.push("<script src='/__hmr__.js'></script>"),globalThis.__vite_manifest__)for(let o=0,l=Ke(this.scripts),h=l.length;o<h;o++){let u=l[o];if(this.src=globalThis.__vite_manifest__[u.src]){n.push('<script type="module" src="'+this.src.file+'"></script>');for(let f=0,c=Ke(this.src.css),p=c.length;f<p;f++){let g=c[f];r.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=Ke(this.scripts),h=l.length;o<h;o++){let f=l[o].src,c=Qc[f];c&&c.css&&r.add(c.css)}for(let o of Ke(r))n.push("<link rel='stylesheet' href='"+o.url+"'>")}if(tt=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}};a(Ks,bf,"HTMLHtmlElement",24);var Hr=Ks,vf=Symbol(),qs=class qs extends F{};a(qs,vf,"HTMLSelectElement",0);var le=qs,$f=Symbol(),Ws=class Ws extends F{};a(Ws,$f,"HTMLInputElement",0);var he=Ws,xf=Symbol(),Ys=class Ys extends F{};a(Ys,xf,"HTMLTextAreaElement",0);var ae=Ys,Sf=Symbol(),Xs=class Xs extends F{};a(Xs,Sf,"HTMLButtonElement",0);var ue=Xs,wf=Symbol(),Qs=class Qs extends F{};a(Qs,wf,"HTMLOptionElement",0);var ce=Qs,_f=Symbol(),Js=class Js extends F{get outerHTML(){return tt&&((tt.scripts||(tt.scripts=[])).push(this),globalThis.__vite_manifest__&&globalThis.__vite_manifest__[this.src])?"":(this[ft]&&(this[ft].js?(this.setAttribute("src",this[ft].js.url),this.setAttribute("type","module")):console.warn("could not find browser entrypoint for "+this[ft].path)),super.outerHTML)}};a(Js,_f,"HTMLScriptElement",8);var Vr=Js,Tf=Symbol(),Zs=class Zs extends F{get outerHTML(){if(this[ft]){let t=this.getAttribute("rel"),e;t=="stylesheet"&&((e=this[ft].css.url)||console.warn("could not find stylesheet for "+this[ft].path)),e&&this.setAttribute("href",e)}return super.outerHTML}};a(Zs,Tf,"HTMLLinkElement",8);var Dr=Zs,Lf=Symbol(),tn=class tn extends F{set src(t){this[qe]!=t&&(this[qe]=t)}get src(){return this[qe]}get outerHTML(){if(tt&&this.src&&(tt.styles||(tt.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}};a(tn,Lf,"HTMLStyleElement",8);var jr=tn,Cf=Symbol(),en=class en{};a(en,Cf,"Event",0);var A=en,Nf=Symbol(),rn=class rn extends A{};a(rn,Nf,"UIEvent",0);var fe=rn,Ef=Symbol(),sn=class sn extends fe{};a(sn,Ef,"FocusEvent",0);var Xe=sn,Mf=Symbol(),nn=class nn extends fe{};a(nn,Mf,"MouseEvent",0);var de=nn,Of=Symbol(),on=class on extends de{};a(on,Of,"PointerEvent",0);var Qe=on,Pf=Symbol(),ln=class ln extends fe{};a(ln,Pf,"KeyboardEvent",0);var Je=ln,If=Symbol(),hn=class hn extends A{};a(hn,If,"CustomEvent",0);var C=hn,Ns={};function Lh(i,t,e){if(!i)return e[t]=null;if(e[t]!==void 0)return e[t];let r=Object.getOwnPropertyDescriptor(i,t);return r!==void 0||i==pe?e[t]=r||null:Lh(Reflect.getPrototypeOf(i),t,e)}var kf=Symbol(),an=class an extends y{set$(t,e){var n;let r=Ns[n=this.nodeName]||(Ns[n]={}),s=Lh(this,t,r);!s||!s.set?this.setAttribute(t,e):this[t]=e}};a(an,kf,"SVGElement",0);var pe=an,Ff=Symbol(),un=class un extends pe{set src(t){if(this[qe]!=t&&(this[qe]=t,!0)){if(t&&t.adoptNode)t.adoptNode(this);else if(t&&t.type=="svg"){if(t.attributes)for(let e=t.attributes,r=0,s=Object.keys(e),n=s.length,o,l;r<n;r++)o=s[r],l=e[o],this.setAttribute(o,l);this.innerHTML=t.content}}}};a(un,Ff,"SVGSVGElement",0);var Gr=un;Z[""].klass=y;Z.HTML.klass=F;Z.SVG.klass=pe;E.html.klass=Hr;E.select.klass=le;E.input.klass=he;E.textarea.klass=ae;E.button.klass=ue;E.option.klass=ce;E.script.klass=Vr;E.style.klass=jr;E.link.klass=Dr;E.svg_svg.klass=Gr;dt("");dt("HTML");dt("SVG");function Af(i,t,e,r){let s=st.createElement(i);return e&&(s.className=e),r!==null&&s.text$(r),t&&t[We]&&t[We](s),s}function Rf(i,t,e,r,s){let n=st.createElementNS("http://www.w3.org/2000/svg",i);return e&&(n.className=e),t&&t[We]&&t[We](n),r&&(n.textContent=r),n}function gt(i){return st.createComment(i)}function Kr(i){return st.createTextNode(i)}function Hf(){return st.createDocumentFragment()}function Ch(i,t,e,r,s){let n;return typeof i!="string"&&(et(i.prototype,F)?(n=new i,n.nodeName=i.nodeName):i&&i.nodeName&&(i=i.nodeName)),n||(n=st.createElement(_h[i]||i)),n[wh]=t,n[Vt](),r!==null&&n[qc]("__").text$(r),(e||n.flags$ns)&&n.flag$(e||""),n}function Vf(i,t,e,r){if(i==null||i==null)return gt("");if(et(i,O))return i;if(typeof i=="string"||i&&et(i.prototype,O))return Ch(i,t,e,r)}function Df(i,t,e={}){Z[i]=Th[i]={idl:!0,name:i,klass:t};let r=t.nodeName=i,s=t.prototype;if(i.indexOf("-")==-1&&(r=t.nodeName=""+i+"-tag",_h[i]=r),e.extends&&(s[kr]=e.extends),e.cssns){let n=(s._ns_||"")+" "+e.cssns;s._ns_=n.trim()+" ",s[Wc]=e.cssns}if(e.cssid){let n=(s.flags$ns||"")+" "+e.cssid;s[Yc]=e.cssid,s.flags$ns=n.trim()+" "}return t}globalThis[Xc]={Location:oe,Document:pt};function Ze(i,t){return typeof t=="string"?typeof i===t:t[Symbol.hasInstance]?.(i)}function cn(i){let t;return i&&((t=i.toIterable)?t.call(i):i)}var Qr=Symbol.for("#parent"),Nh=Symbol.for("#closestNode"),jf=Symbol.for("#isRichElement"),Gf=Symbol.for("#afterVisit"),zf=Symbol.for("#getRenderContext"),Eh=Symbol.for("#appendChild"),Mh=Symbol.for("#removeChild"),Oh=Symbol.for("#replaceChild"),yt=Symbol.for("#insertInto"),qr=Symbol.for("#replaceWith"),Ph=Symbol.for("#insertChild"),Wr=Symbol.for("#removeFrom"),Ih=Symbol.for("#placeChild"),Bf=Symbol.for("#registerFunctionalSlot"),Uf=Symbol.for("#getFunctionalSlot"),kh=Symbol.for("#getSlot"),dn=Symbol.for("##parent"),_t=Symbol.for("##up"),fn=Symbol.for("##flags"),Kf=Symbol.for("#domFlags"),W=Symbol.for("#end"),Fh=Symbol.for("#textContent"),Yr=Symbol.for("#textNode"),Xr=Symbol.for("#functionalSlots");function qf(){return!0}var Wf=Symbol(),pn=class pn{constructor(){this.childNodes=[]}log(...t){}hasChildNodes(){return!1}set[Qr](t){this[dn]=t}get[Qr](){return this[dn]||this[_t]}get[Nh](){return this[Qr][Nh]}get[jf](){return!0}get flags(){return this[fn]||(this[fn]=new Ht(this))}flagSync$(){return this}[Gf](){return this}[zf](t){return De(this,t)}};a(pn,Wf,"Fragment",16);var bt=pn,Yf=0,Xf=Symbol(),mn=class mn extends bt{constructor(t,e){super(...arguments),this[_t]=e,this.parentNode=null,this[Kf]=t,this.childNodes=[],this[W]=gt("slot"+Yf++),e&&e[Eh](this)}get[Qr](){return this[dn]||this.parentNode||this[_t]}set textContent(t){this[Fh]=t}get textContent(){return this[Fh]}hasChildNodes(){for(let t=0,e=cn(this.childNodes),r=e.length;t<r;t++){let s=e[t];if(Ze(s,bt)&&s.hasChildNodes())return!0;if(!Ze(s,mt)){if(Ze(s,O))return!0}}return!1}text$(t){return this[Yr]?this[Yr].textContent=t:this[Yr]=this[Ih](t),this[Yr]}appendChild(t){return this.parentNode&&t[yt](this.parentNode,this[W]),this.childNodes.push(t)}[Eh](t){return this.parentNode?t[yt](this.parentNode,this[W]):t[_t]??(t[_t]=this[_t]||this),this.childNodes.push(t)}insertBefore(t,e){this.parentNode&&this.parentNode[Ph](t,e);let r=this.childNodes.indexOf(e);return r>=0&&this.childNodes.splice(r,0,t),t}[Mh](t){this.parentNode&&this.parentNode[Mh](t);let e=this.childNodes.indexOf(t);e>=0&&this.childNodes.splice(e,1)}[Oh](t,e){this.parentNode&&this.parentNode[Oh](t,e);let r=this.childNodes.indexOf(e);return this.childNodes[r]=t,t}[yt](t,e){let r=this.parentNode;if(this.parentNode!=t&&(this.parentNode=t,!0)){this[W]&&(e=this[W][yt](t,e));for(let s=0,n=cn(this.childNodes),o=n.length;s<o;s++)n[s][yt](t,e)}return this}[qr](t,e){let r=t[yt](e,this[W]);return this[Wr](e),r}[Ph](t,e){if(this.parentNode&&this.insertBefore(t,e||this[W]),e){let r=this.childNodes.indexOf(e);r>=0&&this.childNodes.splice(r,0,t)}else this.childNodes.push(t);return t}[Wr](t){for(let e=0,r=cn(this.childNodes),s=r.length;e<s;e++)r[e][Wr](t);return this[W]&&this[W][Wr](t),this.parentNode=null,this}[Ih](t,e,r){let s=this.parentNode,n=typeof t;if(n==="undefined"||t===null){if(r&&Ze(r,mt))return r;let o=gt("");if(r){let l=this.childNodes.indexOf(r);return this.childNodes.splice(l,1,o),s&&r[qr](o,s),o}return this.childNodes.push(o),s&&o[yt](s,this[W]),o}if(t===r)return t;if(n!=="object"){let o,l=t;if(r){if(Ze(r,jt))return r.textContent=l,r;{o=Kr(l);let h=this.childNodes.indexOf(r);return this.childNodes.splice(h,1,o),s&&r[qr](o,s),o}}else return this.childNodes.push(o=Kr(l)),s&&o[yt](s,this[W]),o}else if(r){let o=this.childNodes.indexOf(r);return this.childNodes.splice(o,1,t),s&&r[qr](t,s),t}else return this.childNodes.push(t),s&&t[yt](s,this[W]),t}};a(mn,Xf,"VirtualFragment",16);var Jr=mn;function Qf(i,t){return new Jr(i,t)}function tr(i,t){let e=new Jr(i,null);return e[_t]=t,e}var Jf=Symbol(),gn=class gn{[Bf](t){let e=this[Xr]||(this[Xr]={});return e[t]||(e[t]=tr(0,this))}[Uf](t,e){let r=this[Xr];return r&&r[t]||this[kh](t,e)}[kh](t,e){var r;return t=="__"&&!this.render||!this.__slots?this:(r=this.__slots)[t]||(r[t]=tr(0,this))}};a(gn,Jf,"Node",1,O);var Ah=gn;function Zf(i){let t;return i&&((t=i.toIterable)?t.call(i):i)}var td=Symbol.for("#afterVisit"),Zr=Symbol.for("#insertInto"),Rh=Symbol.for("#appendChild"),ed=Symbol.for("#replaceWith"),yn=Symbol.for("#removeFrom"),rd=Symbol.for("#domFlags"),id=Symbol.for("##parent"),Tt=Symbol.for("#end"),sd=Symbol.for("#removeChild"),nd=Symbol.for("#insertChild"),od=Symbol(),vn=class vn extends bt{constructor(t,e){super(...arguments),this[rd]=t,this[id]=e,t&256||(this[Tt]=gt("list")),this.$=this.childNodes,this.length=0,e&&e[Rh](this)}hasChildNodes(){return this.length!=0}[td](t){let e=this.length;if(this.length=t,e==t)return;let r=this.parentNode;if(!r)return;let s=this.childNodes,n=this[Tt];if(e>t)for(;e>t;)r[sd](s[--e]);else if(t>e)for(;t>e;)r[nd](s[e++],n);this.length=t}[Zr](t,e){this.parentNode=t,this[Tt]&&this[Tt][Zr](t,e),e=this[Tt];for(let r=0,s=Zf(this.childNodes),n=s.length;r<n;r++){let o=s[r];if(r==this.length)break;o[Zr](t,e)}return this}[Rh](t){}[ed](t,e){let r=t[Zr](e,this[Tt]);return this[yn](e),r}[yn](t){let e=this.length;for(;e>0;)this.childNodes[--e][yn](t);this[Tt]&&t.removeChild(this[Tt]),this.parentNode=null}};a(vn,od,"IndexedTagFragment",16);var bn=vn;function ld(i,t){return new bn(i,t)}function Hh(i){let t;return i&&((t=i.toIterable)?t.call(i):i)}var $n=Symbol.for("#appendChild"),ti=Symbol.for("#insertChild"),hd=Symbol.for("#replaceWith"),ei=Symbol.for("#insertInto"),xn=Symbol.for("#removeFrom"),ad=Symbol.for("#afterVisit"),ri=Symbol.for("#domFlags"),Vh=Symbol.for("##parent"),Lt=Symbol.for("#end"),Dh=Symbol.for("#removeChild"),ud=Symbol(),wn=class wn extends bt{constructor(t,e){super(...arguments),this[ri]=t,this[Vh]=e,this.changes=new Map,this.dirty=!1,this.array=this.childNodes,this.$=new ct(this,Symbol()),t&256||(this[Lt]=gt("map")),e&&e[$n](this)}[$n](t){if(this.parentNode)return this.parentNode[ti](t,this[Lt])}hasChildNodes(){return this.childNodes.length!=0}push(t,e){if(!(this[ri]&1)){this.array.push(t),this[$n](t);return}let r=this.array[e];if(r!==t){this.dirty=!0;let s=this.array.indexOf(t),n=this.changes.get(t);s===-1?(this.array.splice(e,0,t),this.insertChild(t,e,s)):s===e+1?(r&&this.changes.set(r,-1),this.array.splice(e,1)):(s>=0&&this.array.splice(s,1),this.array.splice(e,0,t),this.moveChild(t,e,s)),n==-1&&this.changes.delete(t)}}insertChild(t,e,r){let s=this.parentNode;if(s)if(e>0){let n=this.array[e-1];s[ti](t,n.nextSibling)}else s[ti](t,this.childNodes[e+1]||this[Lt])}moveChild(t,e,r){return this.insertChild(t,e,r)}removeChild(t,e){t.parentNode&&t[xn](t.parentNode)}[ti](t,e){}[hd](t,e){let r=t[ei](e,this[Lt]);return this[xn](e),r}[ei](t,e){this[Vh]=t;let r=this.parentNode;if(t!=r){this.parentNode=t;for(let s=0,n=Hh(this.array),o=n.length;s<o;s++)n[s][ei](t,e);this[Lt]&&this[Lt][ei](t,e)}return this}[xn](t){for(let e=0,r=Hh(this.array),s=r.length;e<s;e++){let n=r[e];t[Dh](n)}return this[Lt]&&t[Dh](this[Lt]),this.parentNode=null}[ad](t){var e=this;if(!(this[ri]&1)){this[ri]|=1;return}if(this.dirty&&(this.changes.forEach(function(r,s){if(r==-1)return e.removeChild(s)}),this.changes.clear(),this.dirty=!1),this.array.length>t)for(;this.array.length>t;){let r=this.array.pop();this.removeChild(r)}}};a(wn,ud,"KeyedTagFragment",16);var Sn=wn;function cd(i,t){return new Sn(i,t)}function jh(i,t){return typeof t=="string"?typeof i===t:t[Symbol.hasInstance]?.(i)}function fd(i){let t;return i&&((t=i.toIterable)?t.call(i):i)}var si=Symbol.for("#__init__"),dd=Symbol.for("##inited"),pd=Symbol.for("#afterVisit"),md=Symbol.for("#insertInto"),gd=Symbol.for("#insertIntoDeopt"),yd=Symbol.for("#beforeReconcile"),bd=Symbol.for("#afterReconcile"),Gh=Symbol.for("#__hooks__"),Gt=Symbol.for("#autorender"),ii=Symbol.for("##visitContext"),zh=Symbol.for("#domNode"),vd=Symbol(),ge,_n=new(ge=class{constructor(t=null){this[si](t)}[si](t=null,e=!0,r=!0){var s;this.items=t&&(s=t.items)!==void 0?s:[],this.current=t&&(s=t.current)!==void 0?s:null,this.lastQueued=t&&(s=t.lastQueued)!==void 0?s:null,this.tests=t&&(s=t.tests)!==void 0?s:0}flush(){let t=null;for(;t=this.items.shift();){if(!t.parentNode||t.hydratedΦ)continue;let e=this.current;this.current=t,t.__F|=1024;try{t.connectedCallback()}catch(r){console.error(r)}this.current=e}}queue(t){var e=this;let r=this.items.length,s=0,n=this.lastQueued;this.lastQueued=t;let o=O.DOCUMENT_POSITION_PRECEDING,l=O.DOCUMENT_POSITION_FOLLOWING;if(r){let h=this.items.indexOf(n),u=h,f=function(p,g){return e.tests++,p.compareDocumentPosition(g)};(h==-1||n.nodeName!=t.nodeName)&&(u=h=0);let c=this.items[u];for(;c&&f(c,t)&l;)c=this.items[++u];if(u!=h)c?this.items.splice(u,0,t):this.items.push(t);else{for(;c&&f(c,t)&o;)c=this.items[--u];u!=h&&(c?this.items.splice(u+1,0,t):this.items.unshift(t))}}else this.items.push(t),this.current||globalThis.queueMicrotask(this.flush.bind(this))}},a(ge,vd,null,16),ge);function $d(){return _n.flush()}var xd=Symbol(),Tn=class Tn extends F{constructor(){super(),this.flags$ns&&(this.flag$=this.flagExt$),this.setup$(),this.build()}setup$(){return this.__slots={},this.__F=0}[si](){return this.__F|=3,this}[dd](){if(this[Gh])return this[Gh].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Φ?(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[Gt]||(this[Gt]={});e.value=t,this.mountedΦ&&N.schedule(this,e)}get renderΦ(){return!this.suspendedΦ}get mountingΦ(){return(this.__F&16)!=0}get mountedΦ(){return(this.__F&32)!=0}get awakenedΦ(){return(this.__F&8)!=0}get renderedΦ(){return(this.__F&512)!=0}get suspendedΦ(){return(this.__F&4096)!=0}get renderingΦ(){return(this.__F&256)!=0}get scheduledΦ(){return(this.__F&128)!=0}get hydratedΦ(){return(this.__F&2)!=0}get ssrΦ(){return(this.__F&1024)!=0}get scheduler(){return N}schedule(){return N.on("commit",this),this.__F|=128,this}unschedule(){return N.un("commit",this),this.__F&=-129,this}async suspend(t=null){let e=this.flags.incr("@suspended");return this.__F|=4096,jh(t,Function)&&(await t(),this.unsuspend()),this}unsuspend(){return this.flags.decr("@suspended")==0&&(this.__F&=-4097,this.commit()),this}[pd](){if(this.visit(),this[ii])return this[ii]=null}[md](t,e=null){if(this.mountedΦ&&t.moveBefore)t.moveBefore(this,e);else{let r=(this.__F&32)!=0&&t==this.parentNode;r&&q.moving.add(this),e?t.insertBefore(this,e):t.appendChild(this),r&&q.moving.delete(this)}return this}[gd](t,e){if(this.mountedΦ&&t.moveBefore)t.moveBefore(this[zh]||this,e);else{let r=this[zh]||this,s=(this.__F&32)!=0&&t==this.parentNode;s&&q.moving.add(this),e?t.insertBefore(r,e):t.appendChild(r),s&&q.moving.delete(this)}return this}[yd](){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&&q.push(this),this[ii]&&(this[ii]=null),this}[bd](){return globalThis.DEBUG_IMBA&&q.pop(this),this}connectedMoveCallback(){this.remount()}connectedCallback(){let t=this.__F,e=t&1,r=t&8;if(t&16384){this.__F=t&-16385,this.remount();return}if(!e&&!(t&1024)){_n.queue(this);return}if(t&48)return;this.__F|=16,e||this[si](),t&2||(this.flags$ext=this.className,this.__F|=2,this.hydrate(),this.commit()),r||(this.awaken(),this.__F|=8),D(this,"mount",[this]);let s=this.mount();return s&&jh(s.then,Function)&&s.then(N.commit),t=this.__F=(this.__F|32)&-17,t&64&&this.schedule(),this[Gt]&&N.schedule(this,this[Gt]),this}disconnectedCallback(){if(!(this.__F&16384)){if(q.moving.size){for(let t of fd(q.moving))if(t?.contains?.(this)){this.__F|=16384;return}}if(this.__F=this.__F&-49,this.__F&128&&this.unschedule(),D(this,"unmount",[this]),this.unmount(),this[Gt])return N.unschedule(this,this[Gt])}}dataForTagName(t){}};a(Tn,xd,"Component",16);var Ct=Tn,Sd=Ct;function wd(i,t){return typeof t=="string"?typeof i===t:t[Symbol.hasInstance]?.(i)}var Bh=Symbol.for("#__init__"),_d={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};var Uh={prefix:1,suffix:1,content:1},Cn={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]]},Td=new RegExp("^("+Object.keys(Cn).join("|")+")(\\d+(?:\\.\\d+)?)$"),Ld=/^([xyz])$/,Cd=/^([tlbr]|size|[whtlbr]|[mps][tlbrxy]?|[rcxy]?[gs])$/,Nd=`*,::before,::after {
box-sizing: border-box;
border-width: 0;
border-style: solid;
border-color: currentColor;
}`,Ed=Symbol(),Nn=class Nn{constructor(t=null){this[Bh](t)}[Bh](t=null,e=!0,r=!0){var s;this.entries=t&&(s=t.entries)!==void 0?s:{}}register(t,e){let r=this.entries[t];r?r&&(r.css=e,r.node&&(r.node.textContent=e)):(r=this.entries[t]={sourceId:t,css:e},this.entries.resets||this.register("resets",Nd))}toString(){return Object.values(this.entries).map(function(t){return t.css}).join(`

`)}toValue(t,e,r,s=null){let n;Uh[r]&&(t=String(t));let o=typeof t;if(o=="number"){if(e||(Ld.test(r)?e="px":Cd.test(r)?e="u":r=="rotate"&&(e="turn",t=(t%1).toFixed(4))),e)return _d[e]?t+e:e=="u"?t*4+"px":"calc(var(--u_"+e+",1px) * "+t+")"}else if(o=="string"){if(r&&Uh[r]&&t[0]!='"'&&t[0]!="'"&&(t.indexOf('"')>=0?t.indexOf("'")==-1&&(t="'"+t+"'"):t='"'+t+'"'),n=t.match(Td)){let h=Cn[n[1]][parseInt(n[2])],u="100%";if(typeof s=="number"?u=s+"%":typeof s=="string"&&(u=s),h)return"hsla("+h[0]+","+h[1]+"%,"+h[2]+"%,"+u+")"}}else if(t&&wd(t.toStyleString,Function))return t.toStyleString();return t}parseDimension(t){if(typeof t=="string"){let[e,r,s]=t.match(/^([-+]?[\d\.]+)(%|\w+)$/);return[parseFloat(r),s]}else if(typeof t=="number")return[t]}};a(Nn,Ed,"Styles",16);var Ln=Nn,qh=new Ln,Md=Object.keys(Cn);function Od(){return globalThis.imba.uses_styles=!0,!0}var Pd=Symbol(),En=class En{css$(t,e,r){return this.style[t]=e}css$var(t,e,r,s,n=null){let o=qh.toValue(e,r,s,n);this.style.setProperty(t,o)}};a(En,Pd,"Element",1,y);var Kh=En;function Id(i,t){return typeof t=="string"?typeof i===t:t[Symbol.hasInstance]?.(i)}var Wh=Symbol.for("#insertInto"),Yh=Symbol.for("#removeFrom");function kd(i,t={}){let e=L.context;L.context=t;let r=i(t);return L.context==t&&(L.context=e),r}function Xh(i,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(i);let r=t||globalThis.document.body,s=i;if(Id(i,Function)){let n=i,o=e.tick||(e.tick=function(){let l=e.context||(e.context=new ct(r,null)),h=L.context;L.context=l;let u=i(l,e);return L.context==l&&(L.context=h),e.node!=u&&(e.node&&globalThis.imba.unmount(e.node),u?((e.node=u)[Wh](r),u.tick==Ct.prototype.tick&&(u.tick=e.tick,u.scheduledΦ),M(u,"unmount",function(){if(e.node==u)return e.node=null,N.unlisten("commit",e.tick)})):(e.node=u,N.unlisten("commit",e.tick))),u});return N.listen("commit",o),o()}else s.__F|=64;return s[Wh](r),s}function Qh(i){return i&&i[Yh]&&i.parentNode&&i[Yh](i.parentNode),i}var Jh=globalThis.imba||(globalThis.imba={});Jh.mount=Xh;Jh.unmount=Qh;function nt(i,t){return typeof t=="string"?typeof i===t:t[Symbol.hasInstance]?.(i)}function er(i){let t;return i&&((t=i.toIterable)?t.call(i):i)}var rr=Symbol.for("##onchange"),sr=Symbol.for("#afterVisit"),ir=Symbol.for("##oninput"),ni=Symbol.for("##onclick"),nr=Symbol.for("##bound"),Nt=Symbol.for("##visitContext");function Fd(){return globalThis.imba.uses_dom_bind=!0,!0}var Ad={INPUT:!0,SELECT:!0,TEXTAREA:!0,BUTTON:!0},Mn=function(i){return nt(i,Array)||i&&nt(i.has,Function)},On=function(i,t){return i==t?!0:nt(i,Array)?i.indexOf(t)>=0:i&&nt(i.has,Function)?i.has(t):i&&nt(i.contains,Function)?i.contains(t):!1},Pn=function(i,t){if(nt(i,Array))return i.push(t);if(i&&nt(i.add,Function))return i.add(t)},In=function(i,t){if(nt(i,Array)){let e=i.indexOf(t);if(e>=0)return i.splice(e,1)}else if(i&&nt(i.delete,Function))return i.delete(t)};function Rd(i){function t(){return i[0]?i[0][i[1]]:void 0}function e(r){return i[0]?i[0][i[1]]=r:null}return{get:t,set:e}}var Hd=Symbol(),kn=class kn{getRichValue(){return this.value}setRichValue(t){return this.value=t}bind$(t,e){let r=e||[];return t=="data"&&!this[nr]&&Ad[this.nodeName]&&(this[nr]=!0,this[rr]&&this.addEventListener("change",this[rr]=this[rr].bind(this)),this[ir]&&this.addEventListener("input",this[ir]=this[ir].bind(this),{capture:!0}),this[ni]&&this.addEventListener("click",this[ni]=this[ni].bind(this),{capture:!0})),Object.defineProperty(this,t,nt(r,Array)?Rd(r):r),r}};a(kn,Hd,"Element",1,y);var Zh=kn;Object.defineProperty(y.prototype,"richValue",{get:function(){return this.getRichValue()},set:function(i){return this.setRichValue(i)}});var Vd=Symbol(),Fn=class Fn{[rr](t){let e=this.data,r=this.$$value;this.$$value=void 0;let s=this.getRichValue();if(this.multiple){if(r)for(let n=0,o=er(r),l=o.length;n<l;n++){let h=o[n];s.indexOf(h)==-1&&In(e,h)}for(let n=0,o=er(s),l=o.length;n<l;n++){let h=o[n];(!r||r.indexOf(h)==-1)&&Pn(e,h)}}else this.data=s[0];return k(),this}getRichValue(){var t;if(this.$$value)return this.$$value;t=[];for(let e=0,r=er(this.selectedOptions),s=r.length;e<s;e++){let n=r[e];t.push(n.richValue)}return this.$$value=t}syncValue(){let t=this.data;if(this.multiple){let e=[];for(let r=0,s=er(this.options||[]),n=s.length;r<n;r++){let o=s[r],l=o.richValue,h=On(t,l);o.selected=h,h&&e.push(l)}this.$$value=e}else for(let e=0,r=er(this.options||[]),s=r.length;e<s;e++){let o=r[e].richValue;if(o==t){this.$$value=[o],this.selectedIndex=e;break}}}[sr](){if(this.syncValue(),this[Nt])return this[Nt]=null}};a(Fn,Vd,"HTMLSelectElement",1,le);var ta=Fn,Dd=Symbol(),An=class An{setRichValue(t){return this.$$value=t,this.value=t}getRichValue(){return this.$$value!==void 0?this.$$value:this.value}};a(An,Dd,"HTMLOptionElement",1,ce);var ea=An,jd=Symbol(),Rn=class Rn{setRichValue(t){return this.$$value=t,this.value=t}getRichValue(){return this.$$value!==void 0?this.$$value:this.value}[ir](t){return this.data=this.value,k()}[sr](){let t=this.data;if(t==null&&(t=""),this[nr]&&this.value!=t&&(this.value=t),this[Nt])return this[Nt]=null}};a(Rn,jd,"HTMLTextAreaElement",1,ae);var ra=Rn,Gd=Symbol(),Hn=class Hn{[ir](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,k()}[rr](t){let e=this.data,r=this.richValue;if(this.type=="checkbox"||this.type=="radio"){let s=this.checked;Mn(e)?s?Pn(e,r):In(e,r):this.data=s?r:!1}return k()}setRichValue(t){this.$$value!==t&&(this.$$value=t,this.value!==t&&(this.value=t))}getRichValue(){if(this.$$value!==void 0)return this.$$value;let t=this.value,e=this.type;if(e=="range"||e=="number"){let r=this.valueAsNumber;Number.isNaN(r)&&(r=Number(t.replace(/\,/,".")+0)),Number.isNaN(r)&&(r=null),t=r}else e=="checkbox"&&(t==null||t==="on")&&(t=!0);return t}[sr](){if(this[nr]){let t=this.type;if(t=="checkbox"||t=="radio"){let e=this.data;e===!0||e===!1||e==null?this.checked=!!e:this.checked=On(e,this.richValue)}else this.richValue=this.data}this[Nt]&&(this[Nt]=null)}};a(Hn,Gd,"HTMLInputElement",1,he);var ia=Hn,zd=Symbol(),Vn=class Vn{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}[ni](t){let e=this.data,r=this.checked,s=this.richValue;return Mn(e)?r?In(e,s):Pn(e,s):this.$$value==null?this.data=!r:this.data=r?null:s,this[sr](),k()}[sr](){if(this[nr]){let t=this.data,e=this.$$value==null?!0:this.$$value;Mn(t)?this.checked=On(t,e):this.checked=t==e}this[Nt]&&(this[Nt]=null)}};a(Vn,zd,"HTMLButtonElement",1,ue);var sa=Vn;function Bd(i,t){return typeof t=="string"?typeof i===t:t[Symbol.hasInstance]?.(i)}function na(i){let t;return i&&((t=i.toIterable)?t.call(i):i)}var Ud=Symbol.for("#getSlot"),Kd=Symbol.for("#container"),qd=Symbol.for("#afterVisit"),or=Symbol.for("#__init__"),oi=Symbol.for("#listeners"),rt=Symbol.for("#slot"),Wd=Symbol.for("#parent"),B=Symbol.for("##container"),li=Symbol.for("#domTarget"),oa=Symbol.for("#insertInto"),Yd=Symbol.for("#removeFrom"),Xd=Symbol.for("#teleport"),Qd=Symbol.for("#self"),Jd=Symbol.for("#target"),Zd=Symbol(),jn=class jn extends Ct{constructor(){super(...arguments),super[or]||this[or]()}[or](t=null,e=!0,r=!0){e&&super[or]&&super[or](...arguments),this.to=t?t.to:void 0}build(){return this[oi]=[],this.win=globalThis,this.doc=globalThis.document}setup(){return this.setAttribute("style","display:none !important;")}[Ud](t,e){return this[rt]||(this[rt]=tr(0,this[Wd])),this[rt]}get[Kd](){if(!this[B]){let t=this.className;this[B]=this.doc.createElement("div"),this[B].className=t,this[B].style.cssText="display:contents !important;"}return this[B]}get domTarget(){return this[li]||(this[li]=Bd(this.to,y)?this.to:this.closest(this.to)||this.doc.querySelector(this.to))}get eventTarget(){return this.domTarget}get style(){return this[B]?this[B].style:super.style}get classList(){return this[B]?this[B].classList:super.classList}get className(){return this[B]?this[B].className:super.className}set className(t){this[B]?this[B].className=t:super.className=t}[qd](){if(this.mountedΦ&&this[rt]&&!this[rt].parentNode)return this[rt][oa](this.target)}mount(){for(let e=0,r=na(this[oi]),s=r.length;e<s;e++){let[n,o,l]=r[e];this.eventTarget.addEventListener(n,o,l)}let t=this.domTarget;return this[rt]&&this[rt][oa](t),this}unmount(){for(let t=0,e=na(this[oi]),r=e.length;t<r;t++){let[s,n,o]=e[t];this.eventTarget.removeEventListener(s,n,o)}return this[rt]&&this[rt][Yd](this.domTarget),this[li]=null,this}addEventListener(t,e,r={}){if(e[Xd]=this,e[Qd]=this,this[oi].push([t,e,r]),this.mountedΦ&&this.eventTarget?.addEventListener)return this.eventTarget.addEventListener(t,e,r)}};a(jn,Zd,"TeleportHook",24);var hi=jn,tp=Symbol(),Gn=class Gn extends hi{get domTarget(){return this.doc.body}get eventTarget(){return this.win}addEventListener(t,e,r={}){return e[Jd]=this.domTarget.parentNode,super.addEventListener(...arguments)}on$resize(t,e,r,s){return this.addEventListener("resize",r,s),r}};a(Gn,tp,"GlobalHook",8);var Dn=Gn;globalThis.customElements&&(globalThis.customElements.define("i-teleport",hi),globalThis.customElements.define("i-global",Dn));function ep(){return globalThis.imba.uses_dom_teleport=!0,!0}function it(i){let t;return i&&((t=i.toIterable)?t.call(i):i)}function rp(i,t){return typeof t=="string"?typeof i===t:t[Symbol.hasInstance]?.(i)}var lt=Symbol.for("#__init__"),la=Symbol.for("#imba"),ci=Symbol.for("#insertInto"),fi=Symbol.for("#removeFrom"),ip=Symbol.for("#all"),lr=Symbol.for("#phase"),ot=Symbol.for("#nodes"),sp=Symbol.for("#sizes"),zt=Symbol.for("#linked"),ha=Symbol.for("#mode"),aa=Symbol.for("#enabled"),np=Symbol.for("#easer"),ye=Symbol.for("#group"),ai=Symbol.for("#_easer_"),ui=Symbol();var op=Symbol(),Un=class Un extends Ft{constructor(){super(...arguments),super[lt]||this[lt]()}[lt](t=null,e=!0,r=!0){var s;e&&super[lt]&&super[lt](...arguments),this.selectors=t&&(s=t.selectors)!==void 0?s:{}}addSelectors(t,e){var s;return((s=this.selectors)[e]||(s[e]=[])).push(...t),!0}getSelectors(...t){let e=[];for(let r=0,s=it(t),n=s.length;r<n;r++){let o=s[r];this.selectors[o]&&e.push(...this.selectors[o])}return e&&e.length?e.join(","):null}nodesForBase(t,e="transition"){let r=[t],s=(this.selectors[e]||[]).join(",");if(s=="")return r;let n=t.querySelectorAll(s);for(let o=0,l=it(n),h=l.length;o<h;o++){let u=l[o];u.closest("._ease_")==t&&r.push(u)}return r[ip]=n,r}nodesWithSize(t,e="in"){let r=this.getSelectors("_off_sized","_"+e+"_sized");return r?t.filter(function(s){return s.matches(r)}):[]}};a(Un,op,"Transitions",16);var zn=Un,di=new zn,lp=globalThis.imba||(globalThis.imba={});lp.transitions=di;var hp=Symbol(),Kn=class Kn extends Ft{[lt](t=null,e=!0,r=!0){var s;e&&super[lt]&&super[lt](...arguments),this.flushingΦ=t&&(s=t.flushingΦ)!==void 0?s:!1,this.mutations=t&&(s=t.mutations)!==void 0?s:[]}constructor(t){super(),super[lt]||this[lt](),this.callback=t}insert(t,e,r){return this.mutations.push({target:t,addedNodes:[e],removedNodes:[],nextSibling:r})}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=[],rp(this.callback,Function)&&this.callback(t),this.emit("start",this,t),this.flushingΦ=!0;for(let e of it(t)){for(let r of it(e.addedNodes))r[ci](e.target,e.nextSibling);for(let r of it(e.removedNodes))r[fi](e.target)}return this.flushingΦ=!1,this.emit("end",this,t)}};a(Kn,hp,"EaseGroup",16);var Bn=Kn,ap=Symbol(),qn=class qn extends Ft{constructor(t){super(),this.dom=t,this[lr]=null,this[ot]=[],this[sp]=new Map}log(...t){}get flags(){return this.dom.flags}link(t){return this[zt]||(this[zt]=new Set),this[zt].add(t)}unlink(t){return this[zt].delete(t)}flag(t){for(let e=0,r=it(this[ot]),s=r.length;e<s;e++)r[e].flags.add(t);return this}unflag(t){for(let e=0,r=it(this[ot]),s=r.length;e<s;e++)r[e].flags.remove(t);return this}commit(){return this.dom.offsetWidth}enable(t){return t&&(this[ha]=t),this[aa]!=!0&&(this[aa]=!0,!0)?(this.dom[ci]=this[ci].bind(this),this.dom[fi]=this[fi].bind(this),this.flags.add("_ease_")):this}disable(){return this.flags.remove("_ease_"),!0}supportsΞsizeΞkeywords(){var t=Bi(this);return t[ui]??(t[ui]={support:CSS.supports("interpolate-size","allow-keywords")&&globalThis.window.getComputedStyle(globalThis.document.body)["interpolate-size"]=="allow-keywords"}),t[ui].support}set phase(t){let e=this[lr];this[lr]!=t&&(this[lr]=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[ot]=null),t=="enter"&&e=="leave"&&(this.dom?.emit?.("outcancel"),this.dom?.transitionΞoutΞcancel?.(this)),t=="leave"&&e=="enter"&&(this.dom?.emit?.("incancel"),this.dom?.transitionΞinΞcancel?.(this)),t=="enter"&&(this.dom?.emit?.("in"),this.dom?.transitionΞin?.(this)),t=="leave"&&(this.dom?.emit?.("out"),this.dom?.transitionΞout?.(this)),e=="leave"&&!t&&(this.dom?.emit?.("outend"),this.dom?.transitionΞoutΞend?.(this)),e=="enter"&&!t&&(this.dom?.emit?.("inend"),this.dom?.transitionΞinΞend?.(this)))}get phase(){return this[lr]}get leavingΦ(){return this.phase=="leave"}get enteringΦ(){return this.phase=="enter"}get idleΦ(){return this.phase==null}track(t){var e=this;let r={before:me().getAnimations()};return this.commit(),t(),this.commit(),r.after=me().getAnimations(),r.fresh=r.after.filter(function(s){return r.before.indexOf(s)==-1}),r.deep=r.fresh.filter(function(s){let n;return!!((n=s.effect.target)&&n.closest("._ease_")!=e.dom)}),r.own=r.fresh.filter(function(s){return r.deep.indexOf(s)==-1}),r.own.length?r.finished=new Promise(function(s){let n=new Set(r.own),o=function(){if(n.delete(this),n.size==0)return s()};for(let l=0,h=it(r.own),u=h.length;l<u;l++){let f=h[l];f[np]=e,f.addEventListener("finish",o,{once:!0}),f.addEventListener("cancel",o,{once:!0})}}):r.finished=Promise.resolve(!0),r}getAnimatedNodes(){let t=di.nodesForBase(this.dom);return this[zt]&&(t=t.concat(Array.from(this[zt]))),t}getNodeSizes(t="in",e=this[ot]){let r=di.nodesWithSize(e,t),s=new Map;for(let n=0,o=it(r),l=o.length;n<l;n++){let h=o[n],u=(this&&this[la]||globalThis[la]).window.getComputedStyle(h);s.set(h,{width:u.width,height:u.height})}return s}applyNodeSizes(t){for(let[e,r]of it(t))e.style.width=r.width,e.style.height=r.height;return t}clearNodeSizes(t){if(t){for(let[e,r]of it(t))e.style.removeProperty("width"),e.style.removeProperty("height");return t}}[ci](t,e){var r=this;if(this[ye]&&!this[ye].flushingΦ)return this[ye].insert(t,this.dom,e),this.dom;let s;if(this.enteringΦ)return this.dom;let n=function(){if(s&&r.clearNodeSizes(s),r.enteringΦ)return r.phase=null};if(this.leavingΦ)return this.track(function(){return r.phase="enter",r.unflag("@off"),r.unflag("@out")}).finished.then(n,function(u){return r.log("error cancel leave",u)}),this.dom;let o=me().contains(t);return e?this.dom.nextSibling!=e&&t.insertBefore(this.dom,e):this.dom.parentNode!=t&&t.appendChild(this.dom),this[ot]=this.getAnimatedNodes(),this.flag("_instant_"),this.unflag("@out"),this.commit(),this.supportsΞsizeΞkeywords()||(s=this[ot].sized=this.getNodeSizes("in")),this.dom?.transitionΞinΞinit?.(this),this.flag("@off"),this.flag("@in"),this.flag("@enter"),this.commit(),this.unflag("_instant_"),this.track(function(){return r.phase="enter",s&&r.applyNodeSizes(s),r.unflag("@off"),r.unflag("@in")}).finished.then(n,function(h){return s&&r.clearNodeSizes(s),r.log("cancelled insert into",h)}),this.dom}[fi](t){var e=this;if(this[ye]&&!this[ye].flushingΦ){this[ye].remove(t,this.dom);return}if(this.leavingΦ)return;let r,s=function(){if(e.phase=="leave")return e.dom.emit("easeoutend",{}),t.removeChild(e.dom),e.phase=null};if(this.enteringΦ&&this[ha]!="forward"){let o=this.track(function(){if(e.flag("@off"),e.flag("@in"),e.unflag("@out"),e.phase="leave",e[ot].sized)return e.clearNodeSizes(e[ot].sized)});this.log("cancel enter anims own",o.own,o),o.finished.then(s,function(l){return e.log("error cancel entering",l)});return}this[ot]=this.getAnimatedNodes(),this.supportsΞsizeΞkeywords()||(r=this.getNodeSizes("out"),this.applyNodeSizes(r)),this.flag("@leave");let n=this.track(function(){if(e.phase="leave",e.flag("@off"),e.flag("@out"),r)return e.clearNodeSizes(r)});if(!n.own.length){s();return}n.finished.then(s,function(){return!0})}};a(qn,ap,"Easer",16);var pi=qn,up=Symbol(),Wn=class Wn{transitionΞinΞinit(t){return!0}transitionΞin(t){return!0}transitionΞinΞend(t){return!0}transitionΞinΞcancel(t){return!0}transitionΞout(t){return!0}transitionΞoutΞend(t){return!0}transitionΞoutΞcancel(t){return!0}get ease(){return this[ai]||(this[ai]=new pi(this))}set ease(t){if(t==!1){this[ai]?.disable?.();return}this.ease.enable(t)}};a(Wn,up,"Element",1,y);var ua=Wn;function cp(){return globalThis.imba.uses_dom_transitions=!0,!0}function Yn(){return globalThis.imba.uses_events_keyboard=!0,!0}var fp=Symbol(),Xn=class Xn{αesc(){return this.keyCode==27}αtab(){return this.keyCode==9}αenter(){return this.keyCode==13}αspace(){return this.keyCode==32}αup(){return this.keyCode==38}αdown(){return this.keyCode==40}αleft(){return this.keyCode==37}αright(){return this.keyCode==39}αdel(){return this.keyCode==8||this.keyCode==46}αkey(t){if(typeof t=="string")return this.key==t;if(typeof t=="number")return this.keyCode==t}αshift(){return!!this.shiftKey}αalt(){return!!this.altKey}αctrl(){return!!this.ctrlKey}αmeta(){return!!this.metaKey}αmod(){let t=globalThis.navigator.platform;return/^(Mac|iPhone|iPad|iPod)/.test(t||"")?!!this.metaKey:!!this.ctrlKey}};a(Xn,fp,"KeyboardEvent",1,Je);var ca=Xn;function hr(){return globalThis.imba.uses_events_mouse=!0,!0}var dp=Symbol(),Qn=class Qn{αleft(){return this.button==0}αmiddle(){return this.button==1}αright(){return this.button==2}αshift(){return!!this.shiftKey}αalt(){return!!this.altKey}αctrl(){return!!this.ctrlKey}αmeta(){return!!this.metaKey}αmod(){let t=globalThis.navigator.platform;return/^(Mac|iPhone|iPad|iPod)/.test(t||"")?!!this.metaKey:!!this.ctrlKey}};a(Qn,dp,"MouseEvent",1,de);var fa=Qn;function ht(i,t){return typeof t=="string"?typeof i===t:t[Symbol.hasInstance]?.(i)}function Jn(i){let t;return i&&((t=i.toIterable)?t.call(i):i)}var pp=Symbol.for("#extendType"),mp=Symbol.for("#modifierState"),mi=Symbol.for("#sharedModifierState"),da=Symbol.for("#onceHandlerEnd"),Zn=Symbol.for("#extendDescriptors"),R=Symbol.for("#context"),gi=Symbol.for("#defaultPrevented"),to=Symbol.for("#stopPropagation"),pa=Symbol.for("#self"),gp=Symbol.for("#target"),yp=Symbol.for("#teleport");Yn();hr();var bp=Symbol(),eo=class eo{[pp](t){var e,r;let s=t[Zn]||(t[Zn]=(e=Object.getOwnPropertyDescriptors(t.prototype),r=e.constructor,delete e.constructor,e));return Object.defineProperties(this,s)}};a(eo,bp,"CustomEvent",1,C);var ma=eo,vp=Symbol(),ro=class ro{get original(){return this.originalEvent||this}get[mp](){var t,e;return(t=this[R])[e=this[R].step]||(t[e]={})}get[mi](){var t,e;return(t=this[R].handler)[e=this[R].step]||(t[e]={})}[da](t){return M(this[R],"end",t)}αsel(t){return!!this.target.matches(String(t))}αclosest(t){return!!this.target.closest(String(t))}αprevent(){return this[gi]=!0,this.preventDefault(),!0}αtrap(){return this[to]=!0,this.stopImmediatePropagation(),this[gi]=!0,this.preventDefault(),!0}αfocin(t){let e=this[R].element;return e=ht(t,y)?t:t?e.closest(t):e,e?.contains?.(globalThis.document.activeElement)}αlog(...t){return console.info(...t),!0}αtrusted(){return!!this.isTrusted}αuntrusted(){return!this.isTrusted}αif(t){return!!t}αwait(t=250){return new Promise(function(e){return setTimeout(e,Jt(t))})}αself(){return this.target==this[R].element}αcooldown(t=250){let e=this[mi];return e.active?!1:(e.active=!0,e.target=this[R].element,e.target.flags.incr("cooldown"),this[da](function(){return setTimeout(function(){return e.target.flags.decr("cooldown"),e.active=!1},Jt(t))}),!0)}αthrottle(t=250,e="throttled"){let r=this[mi];return r.active?(r.next&&r.next(!1),new Promise(function(s){return r.next=function(n){return r.next=null,s(n)}})):(r.active=!0,r.el||(r.el=this[R].element),e&&r.el.flags.incr(e),M(this[R],"end",function(){let s=Jt(t);return r.interval=setInterval(function(){r.next?r.next(!0):(clearInterval(r.interval),e&&r.el.flags.decr(e),r.active=!1)},s)}),!0)}αdebounce(t=250){let e=this[mi],r=this;return e.queue||(e.queue=[]),e.queue.push(e.last=r),new Promise(function(s){return setTimeout(function(){return e.last==r?(r.debounced=e.queue,e.last=null,e.queue=[],s(!0)):s(!1)},Jt(t))})}αflag(t,e){let{element:r,step:s,state:n,id:o,current:l}=this[R],h=ht(e,y)?e:e?r.closest(e):r;if(!h)return!0;this[R].commit=!0,n[s]=o,h.flags.incr(t);let u=Date.now();return M(l,"end",function(){let f=Date.now()-u,c=Math.max(250-f,0);return setTimeout(function(){return h.flags.decr(t)},c)}),!0}αbusy(t){return this.αflag("busy",t)}αoutside(){let{handler:t}=this[R];if(t&&t[pa])return!t[pa].parentNode.contains(this.target)}async αpost(t,e={}){return await globalThis.fetch(t,{method:"POST",...e})}async αfetch(t,e={}){return await globalThis.fetch(t,e)}};a(ro,vp,"Event",1,A);var ga=ro,$p=Symbol(),io=class io{αself(){let t=this[R].element;return this.type=="focusout"?this.relatedTarget&&!t.contains(this.relatedTarget):this.type=="focusin"?!this.relatedTarget||!t.contains(this.relatedTarget):this.target==t}};a(io,$p,"FocusEvent",1,Xe);var ya=io,xp={};function Sp(){return globalThis.imba.uses_events=!0,!0}var wp=Symbol(),so=class so{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 Jn(this.currentEvents))t.aborted=!0,t?.resolver?.(!0);return this}emit(t,...e){return D(this,t,e)}on(t,...e){return V(this,t,...e)}once(t,...e){return M(this,t,...e)}un(t,...e){return St(this,t,...e)}get passiveΦ(){return this.params.passive}get captureΦ(){return this.params.capture}get silentΦ(){return this.params.silent}get globalΦ(){return this.params.global}async handleEvent(t){if(this.disabled)return;let e=this[gp]||t.currentTarget,r=this.params,s=null,n=r.silence||r.silent;this.count||(this.count=0),this.state||(this.state={});let o=this.lastState={element:e,event:t,modifiers:r,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,r.options||[])==!1)return;let l=A[this.type+"$handle"]||A[t.type+"$handle"]||this.guard;if(!(l&&l.apply(o,r.options||[])==!1)){this.currentEvents||(this.currentEvents=new Set),this.currentEvents.add(o);for(let h=0,u=Object.keys(r),f=u.length,c,p;h<f&&(c=u[h],p=r[c],!o.aborted);h++){if(o.step++,c[0]=="_")continue;c.indexOf("~")>0&&(c=c.split("~")[0]);let g=null,d=[t,o],m,b=null,T,I=!1,Ne=typeof c=="string";if(c[0]=="$"&&c[1]=="_"&&ht(p[0],Function))t[R]=o,c=p[0],o.called=!0,c.passive||(o.commit=!0),d=[t,o].concat(p.slice(1)),b=e;else if(ht(p,Array)){d=p.slice(),g=d;for(let S=0,Q=Jn(d),$t=Q.length;S<$t;S++){let Ee=Q[S];if(typeof Ee=="string"&&Ee[0]=="~"&&Ee[1]=="$"){let Rl=Ee.slice(2).split("."),xr=o[Rl.shift()]||t;for(let ji=0,Hl=Jn(Rl),Tu=Hl.length;ji<Tu;ji++){let Lu=Hl[ji];xr=xr?xr[Lu]:void 0}d[S]=xr}}}if(typeof c=="string"&&(T=c.match(/^(emit|flag|mod|moved|pin|fit|refit|map|remap|css)-(.+)$/))&&(g||(g=d=[]),d.unshift(T[2]),c=T[1]),c=="trap")t[to]=!0,t.stopImmediatePropagation(),t[gi]=!0,t.preventDefault();else if(c=="stop")t[to]=!0,t.stopImmediatePropagation();else if(c=="prevent")t[gi]=!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 S=d[0],Q=d[1];o.called=!0;let $t=new C(S,{bubbles:!0,detail:Q});$t.originalEvent=t;let _u=(this[yp]||e).dispatchEvent($t)}else if(typeof c=="string"){c[0]=="!"&&(I=!0,c=c.slice(1));let S="α"+c,Q=t[S];Q||(Q=this.type&&A[this.type+"$"+c+"$mod"]),Q||(Q=t[c+"$mod"]||A[t.type+"$"+c]||A[c+"$mod"]),ht(Q,Function)?(c=Q,b=o,d=g||[],t[S]&&(b=t,t[R]=o)):c[0]=="_"?(c=c.slice(1),b=this.closure):b=this.getHandlerForMethod(e,c)}}try{ht(c,Function)?m=c.apply(b||e,d):b&&(m=b[c].apply(b,d)),m&&ht(m.then,Function)&&m!=N.$promise&&(o.commit&&!n&&N.commit(),m=await m)}catch(S){s=S;break}if(I&&m===!0||!I&&m===!1)break;o.value=m}if(D(o,"end",o),o.commit&&!n&&N.commit(),this.currentEvents.delete(o),this.currentEvents.size==0&&this.emit("idle"),s!=null){if(this.type!="error"){let h=ht(s,Error)?s.message:s,u=new C("error",{detail:h,bubbles:!0,cancelable:!0});u.error=s,u.originalEvent=t;let f=e.dispatchEvent(u);if(u.defaultPrevented)return}throw s}return o}}};a(so,wp,"EventHandler",16);var ar=so,_p=Symbol(),no=class no{on$(t,e,r){let s="on$"+t,n=e.capture||!1,o=e.passive,l,h=n;return o&&(h={passive:o,capture:n}),ht(this[s],Function)?(this[s].length>2&&(l=new ar(e,r)),l=this[s](e,r,l,h)):(l=new ar(e,r),this.addEventListener(t,l,h)),l}on$error(t,e,r,s){return t.options?.length&&(r.guard=function(...n){let o=this.event.error;return!!n.find(function(h){return ht(o,h)})}),this.addEventListener("error",r,s),r}};a(no,_p,"Element",1,y);var ba=no;function Tp(i,t){return typeof t=="string"?typeof i===t:t[Symbol.hasInstance]?.(i)}var Lp=Symbol(),be,oo=new(be=class{get iosΦ(){let t=globalThis.navigator.platform||"";return!!(t.match(/iPhone|iPod|iPad/)||t=="MacIntel"&&globalThis.navigator.maxTouchPoints>2)}},a(be,Lp,null,0),be);function ve(i,t){let e=t;return Tp(i,Element)?i:typeof i=="string"?i=="this"||i==""?e:i=="up"?e.parentNode:i=="op"?e.offsetParent:e.closest(i)||e.querySelector(i)||globalThis.document.querySelector(i):null}function Et(i){if(typeof i=="string"){let[t,e,r]=i.match(/^([-+]?[\d\.]+)(%|\w+)$/);return[parseFloat(e),r]}else if(typeof i=="number")return[i]}function yi(i,t=1){let e=1/t;return Math.round(i*e)/e}function Cp(i,t,e){return t>e?Math.max(e,Math.min(t,i)):Math.min(e,Math.max(t,i))}function lo(i,t,e,r,s=.1){let[n,o]=Et(e),[l,h]=Et(r),[u,f]=Et(s);return o=="%"&&(n=(t-i)*(n/100)),h=="%"&&(l=(t-i)*(l/100)),f=="%"&&(u=(l-n)*(u/100)),function(c,p){let g=(c-i)/(t-i),d=n+(l-n)*g;return s&&(d=yi(d,u)),p&&(d=Cp(d,n,l)),d}}hr();function Np(){return globalThis.imba.uses_events_pointer=!0,!0}var Ep=Symbol(),ao=class ao{αprimary(){return!!this.isPrimary&&(this.pointerType!="mouse"||this.button==0)}αsecondary(){return!this.isPrimary&&this.button!=0}αmouse(){return this.pointerType=="mouse"}αpen(){return this.pointerType=="pen"}αtouch(){return this.pointerType=="touch"}αpressure(t=.5){return this.pressure>=t}αlock(){return!0}};a(ao,Ep,"PointerEvent",1,Qe);var va=ao;function $e(i,t){return typeof t=="string"?typeof i===t:t[Symbol.hasInstance]?.(i)}var $a=Symbol.for("#capture"),at=Symbol.for("#step"),Mp=Symbol.for("#cancel"),uo=Symbol.for("#reframe"),xa=Symbol.for("#mods"),co=Symbol.for("#dx"),fo=Symbol.for("#dy"),Mt=Symbol.for("#context"),bi=Symbol.for("#locked"),La=Symbol.for("#teardown"),Sa=Symbol.for("#x"),wa=Symbol.for("#y"),Op=Symbol.for("#pinTarget");function Pp(){return globalThis.imba.uses_events_touch=!0,!0}var _a=null,Ip=Symbol(),po=class po{constructor(t,e,r){this.phase="init",this.events=[],this.originalEvent=t,this.handler=e,this.target=this.currentTarget=r,this[xa]={}}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Φ(){return this.phase!="ended"}get endedΦ(){return this.phase=="ended"}get dx(){return this[co]==null?this.event.x-this.start.x:this[co]}get dy(){return this[fo]==null?this.event.y-this.start.y:this[fo]}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 D(this,t,e)}on(t,...e){return V(this,t,...e)}once(t,...e){return M(this,t,...e)}un(t,...e){return St(this,t,...e)}αflag(t,e){let{element:r}=this[Mt],s=Date.now(),n=$e(e,y)?e:e?r.closest(e):r;return this[at].setup!=!0&&(this[at].setup=!0,!0)&&(n.flags.incr(t),M(this,"end",function(){return n.flags.decr(t)})),!0}αlock(){return this[$a](),!0}[$a](){if(this[bi]!=!0&&(this[bi]=!0,!0))return this[Mt].element.setPointerCapture(this.pointerId)}get[at](){var t,e;return(t=this[xa])[e=this[Mt].step]||(t[e]={})}[Mp](){return this[La]()}αmoved(t,e){let r=this[at],{element:s,state:n,event:o}=this[Mt];if(!r.setup){let c=t||4;typeof t=="string"&&t.match(/^(up|down|left|right|x|y)$/)&&(r.dir=t,c=e||4),typeof e=="string"&&e.match(/^(up|down|left|right|x|y)$/)&&(r.dir=e),r.setup=!0;let[p,g]=Et(c);r.threshold=p,r.sy=p,r.x0=this.x,r.y0=this.y,r.dir||(r.dir="dist"),r.x=r.left=r.right=r.y=r.up=r.down=r.dist=0,g&&g!="px"&&console.warn("only px threshold allowed in @touch.moved")}if(r.active)return!0;if(r.cancelled)return!1;let l=r.threshold,h=this.x-r.x0,u=this.y-r.y0;r.x=Math.max(r.x,Math.abs(h)),r.y=Math.max(r.y,Math.abs(u)),r.left=Math.max(r.left,-h),r.right=Math.max(r.right,h),r.up=Math.max(r.up,-u),r.down=Math.max(r.down,u),r.dist=Math.max(r.dist,Math.sqrt(h*h+u*u));let f=r[r.dir];if(f>l&&f>=r.x&&f>=r.y){r.active=!0;let c=n.pinTarget;return s.flags.incr("@move"),c&&c.flags.incr("@move"),this.preventDefault(),M(this,"end",function(){return c&&c.flags.decr("@move"),s.flags.decr("@move")}),!0}else if(r.x>l||r.y>l)return r.cancelled=!0,!1;return!1}αhold(t=250){var e=this;let r=this[at],s=this[Mt].element;if(r.cancelled)return!1;if(r.setup&&!r.active){let n=this.clientX,o=this.clientY,l=n-r.x,h=o-r.y;Math.sqrt(l*l+h*h)>5&&!r.cancelled&&(clearTimeout(r.timeout),r.cancelled=!0)}if(r.setup!=!0&&(r.setup=!0,!0)){r.active=!1,r.x=this.clientX,r.y=this.clientY;let n;return r.timeout=setTimeout(function(){return r.active=!0,e.preventDefault(),s.flags.incr("@hold"),n&&n(!0),n=null},t),M(this,"end",function(){return r.active&&s.flags.decr("@hold"),clearTimeout(r.timeout),n&&n(!1),n=null}),new Promise(function(o){return n=o})}return r.active}αsync(t,e="x",r="y"){let s=this[at];return s.setup!=!0&&(s.setup=!0,!0)?(s.x=t[e]||0,s.y=t[r]||0,s.tx=this.x,s.ty=this.y):(e&&(t[e]=s.x+(this.x-s.tx)),r&&(t[r]=s.y+(this.y-s.ty))),this[Mt].commit=!0,!0}αapply(t,e="x",r="y"){return e&&(t[e]=this.x),r&&(t[r]=this.y),this[Mt].commit=!0,!0}αcss(t="x",e="y"){let r=this[at];if(r.setup!=!0&&(r.setup=!0,!0))r.el=this[Mt].element,r.x=r.el[Sa]||0,r.y=r.el[wa]||0,r.tx=this.x,r.ty=this.y;else{let s=r.el[Sa]=r.x+(this.x-r.tx),n=r.el[wa]=r.y+(this.y-r.ty);t&&r.el.style.setProperty("--x",s+"px"),e&&r.el.style.setProperty("--y",n+"px")}return!0}αend(){return this.phase=="ended"}αshift(){return!!this.shiftKey}αalt(){return!!this.altKey}αctrl(){return!!this.ctrlKey}αmeta(){return!!this.metaKey}αprimary(){return!!this.isPrimary&&(this.pointerType!="mouse"||this.originalEvent.button==0)}αmouse(){return this.pointerType=="mouse"}αpen(){return this.pointerType=="pen"}αtouch(){return this.pointerType=="touch"}αpressure(t=.5){return this.pressure>=t}αlog(...t){return console.info(...t),!0}αleft(){return this.originalEvent.button==0}αmiddle(){return this.originalEvent.button==1}αright(){return this.originalEvent.button==2}αround(t=1,e=t){return this.x=yi(this.x,t),this.y=yi(this.y,e),!0}[uo](...t){let e=this[at];if(e.setup!=!0&&(e.setup=!0,!0)){let r=this.target,s=t.length,n=t[0],o=0,l="100%",h=0,u=typeof n;u=="number"||u=="string"&&/^([-+]?\d[\d\.]*)(%|\w+)$/.test(n)||$e(n,Array)?n=null:u=="string"&&(n=="this"||n==""?n=r:n=="up"?n=r.parentNode:n=="op"?n=r.offsetParent:n=r.closest(n)||r.querySelector(n)),n==null&&(s++,t.unshift(n=r)),s==2?h=t[1]:s>2&&([o,l,h=0]=t.slice(1));let f=n.getBoundingClientRect();$e(o,Array)||(o=[o,o]),$e(l,Array)||(l=[l,l]),$e(h,Array)||(h=[h,h]),e.rect=f,e.x=lo(f.left,f.right,o[0],l[0],h[0]),e.y=lo(f.top,f.bottom,o[1],l[1],h[1]),this.x0=this.x=e.x(this.x,e.clamp),this.y0=this.y=e.y(this.y,e.clamp)}else{let r=this.x=e.x(this.x,e.clamp),s=this.y=e.y(this.y,e.clamp);this[co]=r-this.x0,this[fo]=s-this.y0}return!0}αfit(...t){return this[at].clamp=!0,this[uo](...t)}αreframe(...t){return this[uo](...t)}αpin(...t){let e=this[at];if(e.setup!=!0&&(e.setup=!0,!0)){let r=ve(t[0],this.target);$e(r,y)||t.unshift(r=this.target);let s=t[1]||0,n=t[2]??(t[2]=s),o=r.getBoundingClientRect();e.x=this.clientX-(o.left+o.width*s),e.y=this.clientY-(o.top+o.height*n),r&&(this[Op]=r,r.flags.incr("_touch_"),M(this,"end",function(){return r.flags.decr("_touch_")}))}return this.x-=e.x,this.y-=e.y,!0}};a(po,Ip,"Touch",16);var vi=po,kp=Symbol(),mo=class mo{on$touch(t,e,r,s){return r.type="touch",this.addEventListener("pointerdown",r,{passive:!1}),oo.iosΦ&&globalThis.parent!=globalThis&&_a!=!0&&(_a=!0,!0)&&globalThis.parent.postMessage("setupTouchFix"),r}};a(mo,kp,"Element",1,y);var Ta=mo;A.touch$handle=function(){let i=this.event,t=this.element,e=this.state.pointerId,r=this.modifiers,s=this.handler,n=oo.iosΦ;if(this.current=this.state,e!=null)return e==i.pointerId;if(r.ctrl&&!i.ctrlKey||r.alt&&!i.altKey||r.meta&&!i.metaKey||r.shift&&!i.shiftKey||r.if&&!r.if[0]||r.self&&i.target!=t||r.primary&&!i.isPrimary||r.pen&&i.pointerType!="pen"||r.mouse&&i.pointerType!="mouse"||r.touch&&i.pointerType!="touch"||r.sel&&!i.target.matches(String(r.sel[0]))||r["!sel"]&&i.target.matches(String(r["!sel"][0])))return;let o=this.state=s.state=this.current=new vi(i,s,t);e=o.pointerId;let l=function(d){return d.preventDefault(),!1},h=null,u=Symbol(),f=function(d){let m=o.clientX,b=o.clientY,T=d.clientX,I=d.clientY;(o[bi]||o.defaultPrevented)&&(d.pointerId==o.pointerId||m==T&&b==I)&&(d.preventDefault(),d.stopPropagation()),f&&(globalThis.removeEventListener("click",f,{capture:!0}),f=null)},c=function(d){if(!(o.type=="touchmove"&&d.changedTouches[0].identifier!=e)&&(o.defaultPrevented||o[bi]))return d.preventDefault()},p=function(d){let m=d.type,b=o.phase;if(d.pointerId&&o.pointerId!=d.pointerId||d[u])return;d[u]=!0;let T=m=="pointerup"||m=="pointercancel";if(d.pressure==0&&d.pointerType=="mouse"&&m=="pointermove"&&o.originalEvent.pressure>0)return h(d);m=="pointercancel"?(o.x=o.clientX,o.y=o.clientY):(o.x=d.clientX,o.y=d.clientY),o.event=d,T&&(o.phase="ended");try{s.handleEvent(o)}catch{}if(b=="init"&&!T&&(o.phase="active"),T&&h)return h(d)},g=!1;return h=function(d){if(!g&&(g=!0,t.flags.decr("_touch_"),o.phase!="ended"&&(o.phase="ended",o.x=o.clientX,o.y=o.clientY,s.handleEvent(o)),o.emit("end"),r.passive||--s.prevents==0&&t.style.removeProperty("touch-action"),s.state={},globalThis.removeEventListener("pointermove",p,{passive:!!r.passive}),globalThis.removeEventListener("pointerup",p),globalThis.removeEventListener("pointercancel",p),setTimeout(function(){if(f&&(globalThis.removeEventListener("click",f,{capture:!0}),f=null),n&&c)return globalThis.removeEventListener("touchend",c),globalThis.removeEventListener("touchmove",c,{passive:!1}),c=null},100),!r.passive))return globalThis.document.removeEventListener("selectstart",l,{capture:!0})},o[La]=h,r.passive||(s.prevents||(s.prevents=0),s.prevents++,t.style.setProperty("touch-action","none"),t.offsetWidth),t.flags.incr("_touch_"),globalThis.addEventListener("pointermove",p,{passive:!!r.passive}),globalThis.addEventListener("pointerup",p),globalThis.addEventListener("pointercancel",p),globalThis.addEventListener("click",f,{capture:!0}),n&&!r.passive&&(globalThis.addEventListener("touchend",c),globalThis.addEventListener("touchmove",c,{passive:!1})),r.passive||globalThis.document.addEventListener("selectstart",l,{capture:!0}),p(i),!1};function Oa(i){let t;return i&&((t=i.toIterable)?t.call(i):i)}function Ca(i,t){return typeof t=="string"?typeof i===t:t[Symbol.hasInstance]?.(i)}var Fp=Symbol.for("#context"),Ap=Symbol.for("#extendType");function Rp(){return globalThis.imba.uses_events_intersect=!0,!0}var Na=new(globalThis.WeakMap||Map),$i={threshold:[0]},Hp={};A.intersect$handle=function(){let i=this.event.detail.observer;return this.modifiers._observer==i};var Vp=Symbol(),yo=class yo extends C{αin(){return this.delta>=0&&this.entry.isIntersecting}αout(){return this.delta<0}αcss(t="ratio"){return this.target.style.setProperty("--ratio",this.ratio),!0}αflag(t,e){let{state:r,step:s}=this[Fp],n=ve(e||"",this.target);return this.isIntersecting&&!r[s]?(n.flags.incr(t),r[s]=!0):r[s]&&!this.isIntersecting&&(n.flags.decr(t),r[s]=!1),!0}};a(yo,Vp,"IntersectionEvent",0);var go=yo;function Dp(i,t){return function(e,r){let s=r.prevRatios||(r.prevRatios=new WeakMap);for(let n=0,o=Oa(e),l=o.length;n<l;n++){let h=o[n],u=s.get(h.target)||0,f=h.intersectionRatio,c={entry:h,ratio:f,from:u,delta:f-u,observer:r},p=new C(i,{bubbles:!1,detail:c});p[Ap](go),p.entry=h,p.isIntersecting=h.isIntersecting,p.delta=c.delta,p.ratio=c.ratio,s.set(h.target,f),h.target.dispatchEvent(p)}}}function Ea(i=$i){let t=i.threshold.join("-")+i.rootMargin;!i.root&&$i.root&&(i.root||(i.root=$i.root));let e=i.root||Hp,r=Na.get(e);return r||Na.set(e,r={}),r[t]||(r[t]=new IntersectionObserver(Dp("intersect",t),i))}var jp=Symbol(),bo=class bo{on$intersect(t,e,r,s){}};a(bo,jp,"Element",1,y);var Ma=bo;function Gp(i){let t;return i&&((t=i.toIterable)?t.call(i):i)}var vo=Symbol.for("#width"),$o=Symbol.for("#height"),zp=Symbol.for("#extendType");function Bp(){return globalThis.imba.uses_events_resize=!0,!0}var xo=null,Up=Symbol(),wo=class wo extends C{αcss(t="1elw",e="1elh",r="",s=""){let n=this.entry?.target;if(r=="px"&&(s=r,r=""),n&&n.offsetParent){let o=Et(t),l=Et(e),h=ve(r,n),u=o?"--u_"+o[1]:"--"+t,f=l?"--u_"+l[1]:"--"+e,c=o?this.width/o[0]:this.width,p=l?this.height/l[0]:this.height;h.style.setProperty(u,c+s),h.style.setProperty(f,p+s)}return!0}get width(){return this[vo]??(this[vo]=this.entry.target.offsetWidth)}get height(){return this[$o]??(this[$o]=this.entry.target.offsetHeight)}};a(wo,Up,"ResizeEvent",0);var So=wo;function Kp(){return globalThis.ResizeObserver||xo||(console.warn(":resize not supported in this browser"),xo={observe:function(){return!0}}),globalThis.imbaResizeObserver=xo||(xo=new ResizeObserver(function(i){for(let t=0,e=Gp(i),r=e.length;t<r;t++){let s=e[t],n=new C("resize",{bubbles:!1,detail:s});n.entry=s,n.rect=s.contentRect,n[zp](So),s.target.dispatchEvent(n);let o=new C("resized",{bubbles:!0,detail:s});s.target.dispatchEvent(o)}}))}var qp=Symbol(),_o=class _o{on$resize(t,e,r,s){return Kp().observe(this),this.addEventListener("resize",r,s),r}};a(_o,qp,"Element",1,y);var Pa=_o;function Wp(i,t){return typeof t=="string"?typeof i===t:t[Symbol.hasInstance]?.(i)}var Yp=Symbol.for("#extendType"),Xp=Symbol.for("#options");function Qp(){return globalThis.imba.uses_events_mutate=!0,!0}var Jp=Symbol(),Lo=class Lo extends C{};a(Lo,Jp,"MutationEvent",0);var To=Lo,Zp=Symbol(),Co=class Co{on$mutate(t,e,r,s){var n=this,o,l,h,u;r.observer||(r.observer=new MutationObserver(function(c){let p=new C("mutate",{bubbles:!!t.bubble,detail:c});return p[Yp](To),n.dispatchEvent(p)}));let f=r[Xp]={};return t.subtree&&(o=t.subtree,delete t.subtree,f.subtree=!0),t.text&&(l=t.text,delete t.text,f.characterData=!0,f.characterDataOldValue=!0),t.childList&&(h=t.childList,delete t.childList,f.childList=!0),t.attributes&&(Wp(t.attributes,Array)&&(f.attributeFilter=t.attributes),u=t.attributes,delete t.attributes,f.attributes=!0),!f.attributes&&!f.childList&&(f.childList=!0),r.observer.observe(this,f),this.addEventListener("mutate",r,s),r}};a(Co,Zp,"Element",1,y);var Ia=Co;function tm(){return globalThis.imba.uses_events_selection=!0,!0}var No,ka=Symbol();function em(){if(!No)return No=function(i){if(i[ka])return;i[ka]=!0;let t=globalThis.document.activeElement;if(t&&t.matches("input,textarea")){let e=new C("selection",{detail:{start:t.selectionStart,end:t.selectionEnd}});return t.dispatchEvent(e)}},globalThis.document.addEventListener("selectionchange",No)}var rm=Symbol(),Eo=class Eo{on$selection(t,e,r,s){return em(),this.addEventListener("selection",r,s),r}};a(Eo,rm,"Element",1,y);var Fa=Eo;var Mo=Symbol.for("#string"),Oo=Symbol.for("#html"),Ot={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:"→",up:"↑",down:"↓",right:"←",plus:"+",tab:"⇥",meta:"⌘",mod:"⌘",ctrl:"⌃",option:"⌥",alt:"⌥",del:"⌦",shift:"⇧",enter:"↩",esc:"⎋",backspace:"⌫"}}};Ot.auto=Ot.win;var Po={};function Aa(i,t="auto"){let e=""+i+":"+t;if(Po[e])return Po[e];let r=Ot[t]||Ot.win,s=i.split(" ").map(function(n){return n.split("+").sort(function(u,f){return r.order.indexOf(f)-r.order.indexOf(u)}).map(function(u){let f=r.labels[u]||u;return f=f[0].toUpperCase()+(f.slice(1)||"")})});return Po[e]=s}function Ra(i,t){let e=Aa(i,t),r=Ot[t]||Ot.win;return e[Mo]||(e[Mo]=e.map(function(s){return s.join(r.sep)}).join(" "))}function Ha(i,t){let e=Aa(i,t),r=Ot[t]||Ot.win;return e[Oo]||(e[Oo]=e.map(function(s){return"<kbd>"+s.map(function(n){return"<kbd>"+n+"</kbd>"}).join("")+"</kbd>"}).join(" "))}function im(){return globalThis.imba.uses_events_hotkey=!0,!0}var sm=Symbol(),xe,nm=new(xe=class{humanize(t,e="auto"){return Ra(t,e)}htmlify(t,e="auto"){return Ha(t,e)}},a(xe,sm,"HotKeyManager",0),xe);var Se=typeof Reflect=="object"?Reflect:null,Va=Se&&typeof Se.apply=="function"?Se.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)},xi;Se&&typeof Se.ownKeys=="function"?xi=Se.ownKeys:Object.getOwnPropertySymbols?xi=function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:xi=function(t){return Object.getOwnPropertyNames(t)};function om(i){console&&console.warn&&console.warn(i)}var ja=Number.isNaN||function(t){return t!==t};function $(){$.init.call(this)}$.EventEmitter=$;$.prototype._events=void 0;$.prototype._eventsCount=0;$.prototype._maxListeners=void 0;var Da=10;function Si(i){if(typeof i!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof i)}Object.defineProperty($,"defaultMaxListeners",{enumerable:!0,get:function(){return Da},set:function(i){if(typeof i!="number"||i<0||ja(i))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+i+".");Da=i}});$.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};$.prototype.setMaxListeners=function(t){if(typeof t!="number"||t<0||ja(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this};function Ga(i){return i._maxListeners===void 0?$.defaultMaxListeners:i._maxListeners}$.prototype.getMaxListeners=function(){return Ga(this)};$.prototype.emit=function(t){for(var e=[],r=1;r<arguments.length;r++)e.push(arguments[r]);var s=t==="error",n=this._events;if(n!==void 0)s=s&&n.error===void 0;else if(!s)return!1;if(s){var o;if(e.length>0&&(o=e[0]),o instanceof Error)throw o;var l=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw l.context=o,l}var h=n[t];if(h===void 0)return!1;if(typeof h=="function")Va(h,this,e);else for(var u=h.length,f=qa(h,u),r=0;r<u;++r)Va(f[r],this,e);return!0};function za(i,t,e,r){var s,n,o;if(Si(e),n=i._events,n===void 0?(n=i._events=Object.create(null),i._eventsCount=0):(n.newListener!==void 0&&(i.emit("newListener",t,e.listener?e.listener:e),n=i._events),o=n[t]),o===void 0)o=n[t]=e,++i._eventsCount;else if(typeof o=="function"?o=n[t]=r?[e,o]:[o,e]:r?o.unshift(e):o.push(e),s=Ga(i),s>0&&o.length>s&&!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=i,l.type=t,l.count=o.length,om(l)}return i}$.prototype.addListener=function(t,e){return za(this,t,e,!1)};$.prototype.on=$.prototype.addListener;$.prototype.prependListener=function(t,e){return za(this,t,e,!0)};function lm(){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 Ba(i,t,e){var r={fired:!1,wrapFn:void 0,target:i,type:t,listener:e},s=lm.bind(r);return s.listener=e,r.wrapFn=s,s}$.prototype.once=function(t,e){return Si(e),this.on(t,Ba(this,t,e)),this};$.prototype.prependOnceListener=function(t,e){return Si(e),this.prependListener(t,Ba(this,t,e)),this};$.prototype.removeListener=function(t,e){var r,s,n,o,l;if(Si(e),s=this._events,s===void 0)return this;if(r=s[t],r===void 0)return this;if(r===e||r.listener===e)--this._eventsCount===0?this._events=Object.create(null):(delete s[t],s.removeListener&&this.emit("removeListener",t,r.listener||e));else if(typeof r!="function"){for(n=-1,o=r.length-1;o>=0;o--)if(r[o]===e||r[o].listener===e){l=r[o].listener,n=o;break}if(n<0)return this;n===0?r.shift():hm(r,n),r.length===1&&(s[t]=r[0]),s.removeListener!==void 0&&this.emit("removeListener",t,l||e)}return this};$.prototype.off=$.prototype.removeListener;$.prototype.removeAllListeners=function(t){var e,r,s;if(r=this._events,r===void 0)return this;if(r.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):r[t]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete r[t]),this;if(arguments.length===0){var n=Object.keys(r),o;for(s=0;s<n.length;++s)o=n[s],o!=="removeListener"&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(e=r[t],typeof e=="function")this.removeListener(t,e);else if(e!==void 0)for(s=e.length-1;s>=0;s--)this.removeListener(t,e[s]);return this};function Ua(i,t,e){var r=i._events;if(r===void 0)return[];var s=r[t];return s===void 0?[]:typeof s=="function"?e?[s.listener||s]:[s]:e?am(s):qa(s,s.length)}$.prototype.listeners=function(t){return Ua(this,t,!0)};$.prototype.rawListeners=function(t){return Ua(this,t,!1)};$.listenerCount=function(i,t){return typeof i.listenerCount=="function"?i.listenerCount(t):Ka.call(i,t)};$.prototype.listenerCount=Ka;function Ka(i){var t=this._events;if(t!==void 0){var e=t[i];if(typeof e=="function")return 1;if(e!==void 0)return e.length}return 0}$.prototype.eventNames=function(){return this._eventsCount>0?xi(this._events):[]};function qa(i,t){for(var e=new Array(t),r=0;r<t;++r)e[r]=i[r];return e}function hm(i,t){for(;t+1<i.length;t++)i[t]=i[t+1];i.pop()}function am(i){for(var t=new Array(i.length),e=0;e<t.length;++e)t[e]=i[e].listener||i[e];return t}function Io(i,t){return typeof t=="string"?typeof i===t:t[Symbol.hasInstance]?.(i)}var ko=Symbol.for("#getQueryParam"),Wa=Symbol.for("#setQueryParam"),Fo=Symbol.for("#query");var um=Symbol(),we=class we{static parse(t,e){return Io(t,we)?t:new we(t,e)}constructor(t,e){this.router=e,this.parse(t)}parse(t){let e;return Io(t,URL)||(t=new URL(t,this.router.origin)),(e=this.router?.aliases[t.pathname])&&(t.pathname=e),this.url=t,this}get activeΦ(){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(Io(t,Object))for(let e=0,r=Object.keys(t),s=r.length,n,o;e<s;e++)n=r[e],o=t[n],this.searchParams.set(n,o);else typeof t=="string"&&this.parse(t);return this}clone(){return new we(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[Fo]||(this[Fo]=new Proxy({},{get:this[ko].bind(this),set:this[Wa].bind(this)}))}toString(){return this.href}[ko](t,e){return this.searchParams.get(e)}[Wa](t,e,r){let s=this[ko](t,e)??"";return r=r??"",s!=r&&(r==null||r==""?this.searchParams.delete(e):this.searchParams.set(e,r),this.activeΦ&&(this.router.history.replaceState({},null,this.path),this.router.touch())),!0}};a(we,um,"Location",16);var Bt=we;var cm=Symbol(),Ao=class Ao{constructor(t){this.router=t,this.stack=[],this.pos=-1}pushState(t,e,r){return this.stack.length=Math.max(this.pos,0),this.stack[++this.pos]=[t,e,r],this}replaceState(t,e,r){return this.stack.length=this.pos,this.stack[this.pos]=[t,e,r]}popState(){return this.stack.length=this.pos+1,this.pos-=1,this.stack.pop()}currentState(){return this.stack[this.pos]}slice(){return[]}};a(Ao,cm,"History",16);var wi=Ao;var fm=Symbol(),Ro=class Ro{constructor(t,e,r,s){this.params=s,this.router=t,e&&(this.location=Bt.parse(e),this.original=this.location.clone()),this.referrer=r}get apply(){return this.params.apply||[]}get revert(){return this.params.revert||[]}get state(){return this.params.state}get mode(){return this.params.mode}redirect(t){return this.location?.update?.(t),this}get path(){return this.location?.path}get url(){return this.location?.toString?.()}set path(t){this.location.path=t}abort(t=!1){return this.aborted=!0,t&&(this.forceAbort=t),this}match(t){return this.location?this.router.route(t).match(this.path):null}};a(Ro,fm,"Request",16);var ur=Ro;function Ya(i){let t;return i&&((t=i.toIterable)?t.call(i):i)}var _i=Symbol.for("#routes"),Ho=Symbol.for("#match"),dm=Symbol.for("#symbol"),Xa=Symbol.for("#matches"),Vo=new Map,Do={},jo={},pm=/.*/;function mm(i){if(!Vo.has(i)){let t=new Map;return Vo.set(i,t),t}return Vo.get(i)}function gm(i,t){let e=mm(i);if(!e.has(t)){let r=Object.create(i);return Object.assign(r,t),e.set(t,r),r}return e.get(t)}var ym=Symbol(),Bo=class Bo{};a(Bo,ym,"Match",0);var Go=Bo;function bm(i){if(Do[i])return Do[i];let t=Do[i]={url:i},e=i.indexOf("?"),r=i.indexOf("#");if(r>=0&&(t.hash=i.slice(r+1),i=t.url=i.slice(0,r)),e>=0){let s=t.query=i.slice(e+1);i=i.slice(0,e),t.query=jo[s]||(jo[s]=new URLSearchParams(s))}return t.path=i,t}var vm=Symbol(),Uo=class Uo{constructor(t){this.router=t,this.fullPath="",this[_i]={},this[Ho]=new Go,this[Ho].path=""}route(t){var e;return(e=this[_i])[t]||(e[t]=new zo(this.router,t,this))}match(){return this[Ho]}resolve(t){return"/"}};a(Uo,vm,"RootRoute",16);var Ti=Uo,$m=Symbol(),Li=class Li{constructor(t,e,r){this.parent=r||t.rootRoute,this.router=t,this.status=200,this.path=e,this[dm]=Symbol(),this[Xa]={},this[_i]={}}route(t){var e;return(e=this[_i])[t]||(e[t]=new Li(this.router,t,this))}get fullPath(){return""+this.parent.fullPath+"/"+this.$path}load(t){return this.router.queue.add(t)}set path(t){var e=this;if(this.$path==t)return;if(this.raw=t,this.$path=t,this.groups=[],this.cache={},this.dynamic=!1,t.indexOf("?")>=0){let s=t.split("?");t=s.shift(),this.query={};for(let n=0,o=Ya(s.join("?").split("&")),l=o.length;n<l;n++){let h=o[n];if(!h)continue;let[u,f]=h.split("=");u[0]=="!"&&(this.dynamic=!0,u=u.slice(1),f=!1),f===""&&(f=!1),f&&f[0]==":"&&(this.dynamic=!0),this.query[u]=f||f!==!1}}if(t=t.replace(/\:(\w+|\*)(\.)?/g,function(s,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=pm,this;t="^"+t;let r=t[t.length-1];(r=="$"||r=="/")&&(t=t.slice(0,-1)+"(?=/?[#?]|/?$)"),r!="/"&&r!="$"&&t!="^/"&&(t=t+"(?=[/#?]|$)"),this.regex=new RegExp(t)}match(t=this.router.path){var l;let e,r=this.parent.match(t);if(!r)return null;let s=bm(t),n=s.url,o="";if(r.path&&s.path.indexOf(r.path)==0&&(o=r.path+"/",n=n.slice(o.length)),e=this.regex?n.match(this.regex):[""]){let h=o+e[0],u=[this.$path],f={};if(this.groups.length)for(let g=0,d=Ya(e),m=d.length,b;g<m;g++){let T=d[g];(b=this.groups[g-1])&&(f[b]=T,u.push(T))}if(this.query)for(let g=this.query,d=0,m=Object.keys(g),b=m.length,T,I;d<b;d++){T=m[d],I=g[T];let Ne=T,S=s.query?.get?.(T);if(I===!1){if(S)return null;u.push("1");continue}if(I[0]==":"&&(Ne=I.slice(1),I=!0),I==!0&&S||I==S)f[Ne]=S,u.push(S);else return null}let c=u.join("*");f=(l=this[Xa])[c]||(l[c]=f);let p=gm(r,f);return p.path=h,p}return null}resolve(t=this.router.path){if(this.raw[0]=="/"&&!this.dynamic)return this.raw.replace(/\$/g,"");let e=this.parent.match(t),r=this.parent.resolve(t),s;if(this.dynamic){let n=this.match(t);return n?n.path:null}return this.raw[0]=="?"?s=(r||"/")+this.raw:s=r+"/"+this.raw,s.replace(/\$/g,"").replace(/\/\/+/g,"/")}};a(Li,$m,"Route",16);var zo=Li;function hu(i,t){return typeof t=="string"?typeof i===t:t[Symbol.hasInstance]?.(i)}var Xo=Symbol.for("#enter"),Qo=Symbol.for("#resolved"),Ci=Symbol.for("#leave"),Qa=Symbol.for("#afterVisitRouted"),Ja=Symbol.for("#afterVisitRouteTo"),Ko=Symbol.for("#doc"),vt=Symbol.for("#version"),xm=Symbol.for("#routes"),qo=Symbol.for("#origin"),Wo=Symbol.for("#request"),Za=Symbol.for("#hash"),Y=Symbol.for("#routeTo"),cr=Symbol.for("#path"),ut=Symbol.for("#match"),fr=Symbol.for("#options"),Sm=Symbol.for("#cache"),tu=Symbol.for("#unmatched"),It=Symbol.for("#active"),wm=Symbol.for("#resolvedPath"),_m=Symbol.for("#dataKey"),Tm=Symbol.for("#activeKey"),dr=Symbol.for("#urlKey"),Pt=Symbol.for("#dataMap"),_e=Symbol.for("#href"),j=Symbol.for("#route"),eu=Symbol.for("#context"),ru=Symbol.for("#afterVisit"),iu=Symbol.for("#routeHandler"),Lm=Symbol.for("#parentNode"),Cm=Symbol.for("#visitContext"),su=Symbol.for("##visitContext"),Nm=Symbol.for("#attachToParent"),Em=Symbol.for("#detachFromParent"),Yo=Symbol.for("#router");function Mm(){return globalThis.imba.use_router=!0,!0}var Om=Ki(function(){return globalThis.document.router}),Pm=Symbol(),Jo=class Jo extends ${constructor(t,e={}){super(),this[Ko]=t,this[vt]=0,this[xm]={},this.aliases={},this.redirects={},this.rules={},this.matchers={},this.options=e,this.busy=[],this.queue=new He,this.root=new Ti(this),this.location=new Bt(e.url||t.location.href,this),this.history=new wi(this),this.mode=e.mode||"history",this.setup()}get origin(){return this[qo]||(this[qo]=this[Ko].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[vt]++}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[Wo]}pushState(t,e,r){return this.history.pushState(t,e||null,String(r))}replaceState(t,e,r){return this.history.replaceState(t,e||null,String(r))}refresh(t={}){if(this.refreshing)return;this.refreshing=!0;let e=this.location,r=Bt.parse(t.location||this.realpath,this),s=t.mode,n=this[Wo];if(!r.equals(e)||!n||t.state){let o=new ur(this,r,e,t);this[Wo]=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:s=="pop"?this.pushState(this.state,null,String(e)):s=="replace"&&this.replaceState(this.state,null,String(e))),o.aborted||(this.location=o.location,s=="push"?this.pushState(o.state,null,String(this.location)):s=="replace"?this.replaceState(o.state,null,String(this.location)):s=="pop"&&(this.history.index=t.index),this.refreshing=!1,this.emit("change",o),this.touch(),k())}return this.refreshing=!1,this}onpopstate(t){let e=this.history.index,r=e,s={pop:!0,index:0,from:e,mode:"pop"};try{if(typeof t.state=="string"){let[n,o]=t.state.split("|");r=s.index=parseInt(o),r<e?s.revert=this.history.slice(r+1,e+1).reverse():r>e&&(s.apply=this.history.slice(e+1,r+1))}}catch{}return this.refresh(s),this}onbeforeunload(t){let e=new ur(this,null,this.location,{mode:"unload"});if(this.emit("beforechange",e),e.aborted)return!0}onhashchange(t){return this.emit("hashchange",this[Za]=this[Ko].location.hash),k()}setup(){return this}onclick(t){if(t.metaKey||t.altKey)return;let e=null,r=null,s=t.target;for(;s&&(!e||!r);)!e&&s.nodeName=="A"&&(e=s),!r&&s[Y]&&(r=s),s=s.parentNode;if(e&&r!=e&&(!r||r.contains(e))){let 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[Y]&&e[Y].resolve();let r=e.getAttribute("href"),s=new URL(e.href),n=s.href.slice(s.origin.length),o=this.realpath.split("#")[0],l=n.split("#")[0];return o==l?globalThis.document.location.hash=s.hash:e[Y]?e[Y].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(hu(t,Object)){e=[];for(let s=0,n=Object.keys(t),o=n.length,l,h;s<o;s++)l=n[s],h=t[l],e.push([l,globalThis.encodeURI(h)].join("="));return e.join("&")}return t||""}get hash(){return this[Za]}set hash(t){}match(t){return this.route(t).match(this.path)}route(t){return this.root.route(t)}go(t,e=null){if(typeof t=="object"&&e===null&&(e=t,t=this.path),typeof t=="number")return globalThis.history.go(t),this;let r=this.location.clone().update(t),s=this.history.buildState(e,r.path,!0);return this.refresh({push:!0,mode:"push",location:r,state:s,apply:[s]}),this}replace(t,e=null){typeof t=="object"&&e===null&&(e=t,t=this.path);let r=this.location.clone().update(t),s=this.history.buildState(e,r.path,!1);return this.refresh({replace:!0,mode:"replace",location:r,state:s,apply:[s]})}};a(Jo,Pm,"Router",16);var Ni=Jo,Im=Symbol(),Zo=class Zo{constructor(t,e,r,s={}){this.parent=r,this.node=t,this[cr]=e,this[ut]=null,this[fr]=s,this[Sm]={},this[tu]={},this[It]=null,this[wm]=null,this[_m]=Symbol(),this[Tm]=Symbol(),this[dr]=Symbol()}get router(){return this.node.ownerDocument.router}get route(){return((this.parent?this.parent.route:this.router)||this.router)?.route?.(this[cr])}get match(){return this[ut]}get params(){return this[ut]||this[tu]}get state(){let t=this[Pt]||(this[Pt]=new Map),e=this.params,r=this[Pt].get(e);return r||this[Pt].set(e,r={}),r}set state(t){(this[Pt]||(this[Pt]=new Map)).set(this.params,t)}set path(t){this[cr]!=t&&(this[cr]=t,!0)&&this.router.touch()}get path(){return this[cr]}get isActive(){return!!this[It]}get activeΦ(){return!!this[It]}resolve(){let t=this.router[vt];if(!(this[vt]!=t&&(this[vt]=t,!0)))return;let e=this.route,r=this[fr],s=this.router.path,n=e.match(s),o=this[It],l=this[ut],h=n!=l,u=n&&n[this[dr]];return n&&(this[It]=!0,this[ut]=n,n[this[dr]]=s),n&&(h||u!=s||!o)&&this[Qo](n,l,u),!o&&n&&this[Xo](),!n&&(o||o===null)&&(this[It]=!1,this[Ci]()),this[ut]}[Xo](){return this.node.flags.remove("not-routed"),this.node.flags.add("routed"),this.node?.routeDidEnter?.(this)}[Qo](t,e,r=""){return this.node?.routeDidResolve?.(this,t,e,r)}[Ci](){return this.node.flags.add("not-routed"),this.node.flags.remove("routed"),this.node?.routeDidLeave?.(this)}};a(Zo,Im,"ElementRoute",16);var pr=Zo,km=Symbol(),tl=class tl extends pr{[Xo](){return this}[Qo](){return this}[Ci](){return this}resolve(){let t=this.router[vt];if(!(this[vt]!=t&&(this[vt]=t,!0)))return;let e=this[fr],r=this.route,s=this.router.path,n=this.route.resolve(s),o=this.route.match(s);o&&(this[ut]=o,this[ut][this[dr]]=s),e.sticky&&this[ut]&&(n=this[ut][this[dr]]),this[_e]!=n&&(this[_e]=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[_e]}go(){return this.resolve(),this[fr]&&this[fr].replace?this.router.replace(this[_e]):this.router.path==this[_e]?!0:this.router.go(this[_e])}};a(tl,km,"ElementRouteTo",0);var Ei=tl,Fm=Symbol(),el=class el{get router(){return this.ownerDocument.router}};a(el,Fm,"Node",1,O);var nu=el,Am=Symbol(),rl=class rl{set route(t){if(t==null)return;if(this[j]){this[j].path=t;return}let e=t[0]!="/"?this[eu].route:null;this[j]=new pr(this,t,e,this.route__),this[ru]=this[Qa]}get route(){return this[j]}set routeΞto(t){var e=this;if(t==null)return;if(this[Y]){this[Y].path=t;return}let r=t[0]!="/"?this[eu].route:null;this[j]=this[Y]=new Ei(this,t,r,this.routeTo__),this[ru]=this[Ja],this.onclick=function(s){if(!s.altKey&&!s.metaKey&&!s[iu])return s.preventDefault(),s[iu]=e[Y],e[Y].go()}}[Qa](){if(this[j]){let t=this[Lm],e=t&&t[Cm];if(e&&e.matchedRoute&&e.matchedRoute!=this[j]){this[j][It]!=!1&&(this[j][It]=!1,!0)&&(this[j][Ci](),this[j][vt]=-1);return}if(this[j].resolve(),this[j].activeΦ)e.matchedRoute=this[j];else return}if(this.visit&&this.visit(),this[su])return this[su]=null}[Ja](){if(this[Y]&&this[Y].resolve(),this.visit)return this.visit()}routeDidEnter(t){return this[Nm]()}routeDidLeave(t){return this[Em]()}routeDidResolve(t,e,r){var s=this;hu(this.routed,Function)&&e!=r&&this.router.queue.add(async function(){s.suspend();let n=await s.routed(e,t.state,r);return s.unsuspend()})}};a(rl,Am,"Element",1,y);var ou=rl,Rm=Symbol(),il=class il{get router(){return this[Yo]||(this[Yo]=new Ni(this))}};a(il,Rm,"Document",1,pt);var lu=il;function Pi(i,t){return typeof t=="string"?typeof i===t:t[Symbol.hasInstance]?.(i)}function H(i){let t;return i&&((t=i.toIterable)?t.call(i):i)}var vr=Symbol.for("##reactive"),Ut=Symbol.for("##referenced"),yr=Symbol.for("##dereferenced"),Mi=Symbol.for("#map"),au=Symbol.for("#__init__"),mr=Symbol.for("#child"),Ii=Symbol.for("##spy"),Te=Symbol.for("#reactions"),Oi=Symbol.for("#promise"),x={TOUCHING:2,STALE:4,OBJECT:8,RUNNING:16,INVALIDATING:32,POSSIBLY_STALE:64,AUTORUN:128,DEACTIVATED:256},w=0,uu=!1,Kt=null;var Hm=0,bu=1,dl={META:new Map,VALUE:new Map,REF:new Map},G,gr={root:null,ctx:null,get context(){return v},get atomics(){return Kt},get ownref(){return P},flush(){if(v==G)return G.flush()}},P=Symbol.for("~"),vu=Symbol.for("~~"),pl=function(i,t){return t.has(i)||t.set(i,Symbol()),t.get(i)},Ri=function(i){return typeof i=="symbol"?pl(i,dl.VALUE):Symbol.for(i)},ml=function(i){return typeof i=="symbol"?pl(i,dl.META):Symbol.for("#"+i+"__")},Hi=function(i){return typeof i=="symbol"?pl(i,dl.REF):Symbol.for("~"+i)},_=function(i,t){return w&&v.add(i[P]),t},X=function(i,t){return i[P].$$invalidated(0),t},Le=function(i,t,e){let r=i[P];return r||(r=i[P]=new Wt,Object.defineProperties(i,e)),t&&r.addSubscriber(t),i},gl=function(i,t){let e=i[P];return e&&e.removeSubscriber(t),i},Vm=Symbol(),bl=class bl{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,r=this.array[e];if(r===t)++this.idx;else{if(e>0&&this.array[e-1]===t)return;let s=this.array.indexOf(t),n=this.changes.get(t);if(s===-1)this.array.splice(e,0,t),this.changes.set(t,1),this.idx++;else{if(s<e)return;s===e+1?(r&&this.changes.set(r,-1),this.array.splice(e,1),++this.idx):(s>e&&this.array.splice(s,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()}};a(bl,Vm,"ArrayPatcher",16);var sl=bl;function yl(i){var t,e;let r=Object.getOwnPropertyDescriptors(i.prototype);return t=r.name,delete r.name,e=r.constructor,delete r.constructor,r}function Dm(){if(uu!=!0&&(uu=!0,!0))return ts.on("inited",function(i){let t=i[vu];if(t){let e=globalThis.Node&&Pi(i,globalThis.Node),r=i[P]||(i[P]={});for(let s=0,n=Object.keys(t),o=n.length,l,h;s<o;s++){l=n[s],h=t[l];let u=r[l]=new qt(i[l],i,h);e||u.call()}e&&(V(i,"mount",function(){for(let s=0,n=H(Object.values(r)),o=n.length;s<o;s++){let l=n[s];Pi(l,qt)&&l.activate()}}),V(i,"unmount",function(){for(let s=0,n=H(Object.values(r)),o=n.length;s<o;s++){let l=n[s];Pi(l,qt)&&l.deactivate()}}))}})}function jm(i,t=vu){return i.hasOwnProperty(t)||(i[t]=Object.assign({},i[t]||{})),i[t]}var Gm=Symbol(),Ai=class Ai{constructor(t,e=0){this.depth=e,this.parent=t,this.target=null,this.spy=null,this.patcher=new sl}get activeΦ(){return v==this}get rootΦ(){return this==G}get snapshot(){let t=[],e=this[mr];for(;e&&e.target;)t.push({depth:e.depth,target:e.target,beacon:e.beacon}),e=e[mr];return t}reset(t){this.target=t,this.beacon=t.beacon;let e=this.spy=t[Ii];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),G.reactions.add(t)}push(t){return gr.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,n]of H(e))n===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==G?(G.flush(),gr.ctx=null):gr.ctx=v,t}get child(){return this[mr]||(this[mr]=new Ai(this,this.depth+1))}get reactions(){return this[Te]||(this[Te]=new Set)}flush(){if(!this[Te])return;let t=this[Te];this[Te]=null;for(let e of H(t))e.call()}};a(Ai,Gm,"Context",16);var nl=Ai,zm=Symbol(),vl=class vl extends nl{add(){return!0}};a(vl,zm,"Root",0);var ol=vl,v=G=gr.root=new ol(null,0),Bm=function(){return v.tracking=!1},$u=function(i,t,e,r,s){let n=i[e],o=i[s];return o||(o=i[s]=new Wt(r,t,n)),v.add(o,i),n},xu=function(i,t,e,r,s,n){let o=i[e];if(r!=o){i[e]=r;let l=i[n];l&&l.changed(0,r,o)}},Um=Symbol(),$l=class $l{constructor(t,e,r){return this.id=bu++,this.observer=null,this.observers=null,this.v=0,this.o=t||null,r&&r[Ut]&&r[Ut](this),this}get $$v(){return this.v}changed(t,e,r){if(Hm++,this.v++,r&&r[yr]&&r[yr](this,e),e&&e[Ut]&&e[Ut](this,r),this.observer&&this.observer.$$invalidated(t+1,this,e,r),this.observers)for(let s of H(this.observers))s.$$invalidated(t+1,this,e,r);v==G&&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 r of H(this.observers))r.$$invalidated(t+1,this);return t==0&&v==G&&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)}};a($l,Um,"Ref",16);var Wt=$l;function Km(i){return new Wt(null,i,null)}var qm=Symbol(),xl=class xl extends Array{push(){return X(this,super.push(...arguments))}pop(){return X(this,super.pop(...arguments))}unshift(){return X(this,super.unshift(...arguments))}shift(){return X(this,super.shift(...arguments))}splice(){return X(this,super.splice(...arguments))}at(){return _(this,super.at(...arguments))}map(){return _(this,super.map(...arguments))}flatMap(){return _(this,super.flatMap(...arguments))}flat(){return _(this,super.flat(...arguments))}filter(){return _(this,super.filter(...arguments))}find(){return _(this,super.find(...arguments))}slice(){return _(this,super.slice(...arguments))}sort(){return _(this,super.sort(...arguments))}get len(){return _(this,this.length)}set len(t){this.length=t,X(this)}toIterable(){return w&&v.add(this[P]),this}[Symbol.iterator](){return _(this,super[Symbol.iterator](...arguments))}};a(xl,qm,"ObservableArray",8);var ki=xl,cu=yl(ki),Wm=Symbol(),Sl=class Sl{get len(){return this.length}set len(t){this.length=t}get[vr](){return Le(this,null,cu)}[Ut](t){return Le(this,t,cu)}[yr](t){return gl(this,t)}};a(Sl,Wm,"Array",1,Array);var fu=Sl,du=Set.prototype.has,Ym=Symbol(),wl=class wl extends Set{has(){return _(this,super.has(...arguments))}keys(){return _(this,super.keys(...arguments))}values(){return _(this,super.values(...arguments))}entries(){return _(this,super.entries(...arguments))}add(t){return du.call(this,t)?this:X(this,super.add(...arguments))}delete(t){return du.call(this,t)?X(this,super.delete(...arguments)):this}clear(){return this.size?X(this,super.clear(...arguments)):this}};a(wl,Ym,"ObservableSet",8);var ll=wl,pu=yl(ll),Xm=Symbol(),_l=class _l{get[vr](){return Le(this,null,pu)}[Ut](t){return Le(this,t,pu)}[yr](t){return gl(this,t)}};a(_l,Xm,"Set",1,Set);var mu=_l,Qm=Symbol(),Tl=class Tl extends Map{get(){return _(this,super.get(...arguments))}has(){return _(this,super.has(...arguments))}keys(){return _(this,super.keys(...arguments))}values(){return _(this,super.values(...arguments))}entries(){return _(this,super.entries(...arguments))}set(){return X(this,super.set(...arguments))}clear(){return X(this,super.clear(...arguments))}delete(){return X(this,super.delete(...arguments))}};a(Tl,Qm,"ObservableMap",8);var hl=Tl,gu=yl(hl),Jm=Symbol(),Ll=class Ll{get[vr](){return Le(this,null,gu)}[Ut](t){return Le(this,t,gu)}[yr](t){return gl(this,t)}};a(Ll,Jm,"Map",1,Map);var yu=Ll,Zm=Symbol(),Cl=class Cl{constructor(t,e={}){var r=this;this.name=t,this.options=e;let s=this.key=Ri(t),n=Hi(t),o=this.descriptor={enumerable:e.enumerable??!0,configurable:!1,get:function(){return w?$u(this,t,s,r,n):this[s]},set:function(h){return w||this[n]?xu(this,t,s,h,r,n):this[s]=h}},l=this.lazyDescriptor={enumerable:!1,configurable:!0,get:function(){return w?(Object.defineProperty(this,t,o),this[t]):this[s]},set:function(h){return this[s]=h,this[n]=null,Object.defineProperty(this,t,o)}}}};a(Cl,Zm,"PropertyType",16);var al=Cl,tg=Symbol(),Nl=class Nl{constructor(t=null){this[au](t)}[au](t=null,e=!0,r=!0){var s;this[Mi]=t&&(s=t[Mi])!==void 0?s:new Map}for(t){let e=this[Mi].get(t);return e||this[Mi].set(t,e=[]),e}get(t){let e=this.for(t);return e[P]||e[vr],w&&_(e),e}add(t,e){return this.for(t).push(e)}delete(t,e){let r=this.for(t),s=r.indexOf(e);r.splice(s,1)}};a(Nl,tg,"RefIndex",16);var ul=Nl,eg=Symbol(),El=class El{constructor(t,e){var r=this;this.name=t,this.key=e,this.index=new ul;let s=Hi(t),n=this.descriptor={enumerable:!0,configurable:!1,get:function(){return w?$u(this,t,e,r,s):this[e]},set:function(l){let h=this[e];if(w||this[s]?xu(this,t,e,l,r,s):this[e]=l,h!=l&&(h&&r.index.delete(h,this),l))return r.index.add(l,this)}},o=this.lazyDescriptor={set:function(l){return this[e]=l,l&&r.index.add(l,this),Object.defineProperty(this,t,n),this[s]=null}}}where(t){return this.index.get(t)}};a(El,eg,"RefType",16);var cl=El,rg=Symbol(),Ml=class Ml{constructor(t,e,r,s){this.observing=null,this.observers=null,this.flags=68,this.target=t,this.func=e,this.vkey=r,this.type=s,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,r=e?e.indexOf(t):-1;r>=0&&e.splice(r,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 r=0,s=H(this.observers),n=s.length;r<n;r++)s[r].$$invalidated(t+1,this);return this}}deactivate(){if(this.observing)for(let t=0,e=H(this.observing),r=e.length;t<r;t++)e[t].removeSubscriber(this);return this.observing=null,this}value(){if(w&&v.add(this),!(this.flags&x.POSSIBLY_STALE))return this.target[this.vkey];w++,this.flags|=x.RUNNING,v.push(this);let t=this.func.call(this.target);v.pop(this);let e=this.target[this.vkey],r=!1;if(t&&e&&t.constructor===e.constructor&&t instanceof Array){let s=t.length;if(s!=e.length)r=!0;else{let n=0;for(;n<s;){if(t[n]!=e[n]){r=!0;break}n++}}}else r=t!==e;return this.target[this.vkey]=t,this.flags&=~(x.STALE|x.POSSIBLY_STALE|x.RUNNING),r&&this.v++,w--,t}};a(Ml,rg,"Memo",16);var Yt=Ml,ig=Symbol(),Ol=class Ol{constructor(t,e){var r=this;this.name=t;let s=Hi(t),n=Ri(t),o=this.descriptor={enumerable:!1,configurable:!1,get:function(){return this[s].value()}},l=this.lazyDescriptor={enumerable:!1,configurable:!0,get:function(){let h=this[s]=new Yt(this,e,n,r.type);return Object.defineProperty(this,t,o),h.value()}}}};a(Ol,ig,"ComputedType",16);var Fi=Ol,sg=Symbol(),Pl=class Pl{get beacon(){return this}constructor(t,e,r={}){this.cb=t,this.context=e,this.options=r,this.flags=0,this.id=bu++,this.cachedComputedVersions=new WeakMap,this.checkComputedValues=new Set,this.observing=[],this.timeout=null}get runningΦ(){return this.flags&x.RUNNING}$$invalidated(t,e){e instanceof Yt?(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=H(this.observing),r=e.length;t<r;t++)e[t].removeSubscriber(this);return this.observing=this.checkComputedValues=this.cachedComputedVersions=null,this}call(){var t=this;if(w&&console.warn("should not call reaction inside an autorunning context?",G.snapshot,this),this.flags&x.POSSIBLY_STALE&&!(this.flags&x.STALE)){let e=!1;for(let r of H(this.checkComputedValues)){let s=this.cachedComputedVersions.get(r);r.value();let n=r.v;if(s!=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(){w++,this.flags|=x.RUNNING;let t=v.push(this),e=this.cb.call(this.context,Bm),r=v.pop(this);this.observing=r,this.checkComputedValues.clear();for(let s=0,n=H(r),o=n.length;s<o;s++){let l=n[s];l instanceof Yt&&this.cachedComputedVersions.set(l,l.v)}return this.flags&=~(x.RUNNING|x.STALE|x.POSSIBLY_STALE),w--,e}dispose(){return this.deactivate(),this.cb=this.context=this.options=null,this}};a(Pl,sg,"Reaction",16);var qt=Pl,ng=Symbol(),Il=class Il extends qt{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[Oi]||(this[Oi]=new Promise(function(r){return e.resolve=function(s){return e.deactivate(),e.resolved=s,r(s)}})),this[Oi].then(...t))}run(){w++,this.flags|=x.RUNNING;let t=v.push(this),e=this.cb.call(this.context),r=v.pop(this);this.observing=r,this.checkComputedValues.clear();for(let s=0,n=H(r),o=n.length;s<o;s++){let l=n[s];l instanceof Yt&&this.cachedComputedVersions.set(l,l.v)}return this.flags&=~(x.RUNNING|x.STALE|x.POSSIBLY_STALE),w--,e!=!1&&e!=null&&e!=null&&this.resolve(e),e}};a(Il,ng,"Awaits",0);var fl=Il,og=Symbol(),kl=class kl{constructor(t,e){this.scope=e,this.cb=t}get ctx(){return v}run(t=this.scope,e=[],r=!1){v.push(this);try{r&&w++;let s=this.cb.apply(t,e);return r&&w--,v.pop(this),s}catch(s){throw r&&w--,v.pop(this),s}}};a(kl,og,"Action",16);var br=kl;function lg(i,t={}){let e=new qt(i,globalThis,t);return e.call(),e}function hg(i,t={}){let e=new fl(i,globalThis,t);return e.call(),e}function ag(i){return i[vr]}function ug(i){let t=Kt,e;if(t)return i();{let r=Kt=new Set;try{e=i()}catch(s){Kt=null;for(let n of H(r))n.$$invalidated(1,r);throw G==v&&G.flush(),s}Kt=null;for(let s of H(r))s.$$invalidated(1,r);return G==v&&G.flush(),e}}function cg(i){return new br(i,globalThis).run()}function fg(i,t,e=null){i[Ii]||(i[Ii]=i),v.push(i);try{w++;let r=e?t.call(e,i):t(i,e);return w--,v.pop(i),r}catch(r){throw w--,v.pop(i),r}}function dg(i){return i&&i[P]&&i[P].$$invalidated(0),i}function pg(i){return i&&i[P]&&i[P].$$invalidated(0),i}function mg(i,t){return i&&i[P]&&i[P].reportObserved(t),i}function gg(i=x.OBJECT){return new Wt}function yg(i){let t=Object.getOwnPropertySymbols(i);for(let e=0,r=H(t),s=r.length;e<s;e++){let n=r[e];Pi(i[n],Yt)&&i[n].deactivate()}return i}function bg(i,t){return i[Hi(t)]}function vg(i,t,e){let r=ml(t);return(i[r]=new Fi(t,e.get)).lazyDescriptor}function $g(i,t,e){let r=ml(t),s=Ri(t),n=this[0]||{},o=i[r]=new al(t,n);return e?(Object.defineProperty(i,s,Object.assign({},e)),o.lazyDescriptor):(Object.defineProperty(i,t,o.lazyDescriptor),null)}function xg(i,t,e){let r=ml(t);return i.constructor[t],(i[r]=new cl(t,Ri(t))).lazyDescriptor}function Sg(i,t,e){let r=jm(i),s=this[0]||{};return s.flags=x.AUTORUN,Dm(),r[t]=s,e}function wg(i,t,e){if(e.value){let r=new br(e.value,null);e.value=function(){return r.run(this,arguments)}}return e}function _g(i,t){return typeof t=="string"?typeof i===t:t[Symbol.hasInstance]?.(i)}function Tg(i){let t;return i&&((t=i.toIterable)?t.call(i):i)}var Su=Symbol.for("#__init__"),$r=Symbol.for("#watchers");function Lg(i,t,e,r,s,n){return i&&_g(i.$accessor,Function)?i=i.$accessor(t,e,r,s,n):n[s]=i,i&&!i?.$init&&(i.$init=i.$set||function(){return!0}),i}function Cg(i){return i}var Ng=Symbol(),Fl=class Fl{constructor(t=null){this[Su](t)}[Su](t=null,e=!0,r=!0){var s;this.local=t&&(s=t.local)!==void 0?s:!1,this.session=t&&(s=t.session)!==void 0?s:!1,this.weak=t&&(s=t.weak)!==void 0?s:!1}watch(t){return(this[$r]||(this[$r]=[])).push(t)}$get(t,e){return t[e]}$set(t,e,r,s){if(this[$r]){let n=this.$get(e,r,s);if(n!=t){e[r]=t;for(let o=0,l=Tg(this[$r]),h=l.length;o<h;o++){let f=l[o].call(e,t,n,this)}}}else e[r]=t}$accessor(t,e,r,s,n){return n[s]=this}};a(Fl,Ng,"Accessor",16);var Vi=Fl;function Eg(){return new Vi}function wu(i,t){return typeof t=="string"?typeof i===t:t[Symbol.hasInstance]?.(i)}function Mg(i){let t;return i&&((t=i.toIterable)?t.call(i):i)}function Al(){return function(){return!0}}var Og=Symbol(),Ce=class Ce{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(wu(this.store,Ce))return this.store.getItem(e);if(this.local&&this.cache.rich[e]!=null)return this.cache.rich[e];let r=this.store.getItem(e);if(r!=null)return this.cache.raw[e]==r?this.cache.rich[e]:(this.cache.raw[e]=r,this.cache.rich[e]=this.deserialize(r,e))}setItem(t,e){var r,s;let n=String(this.ns)+":"+t;if(wu(this.store,Ce))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 h=this.store.getItem(n);if(e==null)return this.store.removeItem(n),r=this.cache.rich[n],delete this.cache.rich[n],s=this.cache.raw[n],delete this.cache.raw[n],k();{let u=this.serialize(e,n);if(this.cache.rich[n]=e,this.cache.raw[n]=u,h!=u)return this.store.setItem(n,u),k()}}}removeItem(t){var e;let r=String(this.ns)+":"+t;return e=this.cache[r],delete this.cache[r],this.store.removeItem(r)}get(t,e,r){return this.getItem(e)}set(t,e,r,s){return this.setItem(e,r),!0}apply(t,e,[r]){let s=this.children.get(r);return s||this.children.set(r,s=new Proxy(Al(),new Ce(this,r))),s}deleteProperty(t,e){return this.removeItem(e),!0}ownKeys(t){let e=["prototype"],r=this.ns+":";for(let s=0,n=Mg(Object.keys(this.store)),o=n.length;s<o;s++){let l=n[s];l.indexOf(r)==0&&e.push(l.slice(r.length))}return e}};a(Ce,Og,"Storage",16);var Di=Ce,Pg=new Proxy(Al(),new Di(globalThis.localStorage)),Ig=new Proxy(Al(),new Di(globalThis.sessionStorage));0&&(module.exports={Accessor,Action,CUSTOM_TYPES,ClassFlags,Comment,Component,ComputedType,CustomEvent,Document,DocumentFragment,EaseGroup,Easer,Element,ElementRoute,ElementRouteTo,Emitter,Event,EventHandler,FocusEvent,Fragment,HAS,HTMLButtonElement,HTMLElement,HTMLHtmlElement,HTMLInputElement,HTMLLinkElement,HTMLOptionElement,HTMLScriptElement,HTMLSelectElement,HTMLStyleElement,HTMLTextAreaElement,ImbaElement,IntersectionEventDefaults,KeyboardEvent,LazyProxy,Location,MouseEvent,Node,OBSERVED,ObservableArray,PointerEvent,Queue,Ref,RenderContext,Router,SVGElement,SVGSVGElement,Scheduler,ShadowRoot,StyleDeclaration,Text,Touch,UIEvent,Window,__has__$,__hooks__$,__imba__$,__init__$,__inited__$,__initor__$,__meta__$,__mixin__$,__patch__$,__served__,accessor,afterReconcile$,afterVisit$,appendChild$,atomic,augment$,autorun,awaits,beforeReconcile$,clearInterval,clearTimeout,colors,commit,createAtom,createComment,createComponent,createDynamic,createElement,createFragment,createIndexedList,createKeyedList,createLiveFragment,createRef,createRenderContext,createSVGElement,createSlot,createTextNode,customElements,decorate$,defineConfig,defineTag,descriptor,devlog$,disposeObservables,document,emit,env,events,extend$,getComputed,getDeepPropertyDescriptor,getRenderContext,getSuperTagType,getTagType,get_document,has$,hooks,hotkeys,hydrate,hydrator,idx$,inited$,is$,isa$,iterable$,listen,locals,logFormatter,matcher,memofunc,memofuncv,mount,multi$,observable,once,parseTime,proxy,register$,render,renderContext,renderer,reportChanged,reportInvalidated,reportObserved,router,run,rx,scheduler,serve,session,setInterval,setTimeout,spy,statics$,styles,sup$,toCamelCase,transitions,unlisten,unmount,up$,use_devlog,use_dom_bind,use_dom_teleport,use_dom_transitions,use_events,use_events_hotkey,use_events_intersect,use_events_keyboard,use_events_mouse,use_events_mutate,use_events_pointer,use_events_resize,use_events_selection,use_events_touch,use_hooks,use_router,use_slots,use_styles,use_window,αaction,αautorun,αbound,αcomputed,αlazy,αobservable,αprop,αref,αthenable});