UNPKG

imba

Version:

Intuitive and powerful language for building webapps that fly

6 lines (4 loc) 152 kB
var rc=Object.create;var De=Object.defineProperty;var ic=Object.getOwnPropertyDescriptor;var nc=Object.getOwnPropertyNames;var oc=Object.getPrototypeOf,lc=Object.prototype.hasOwnProperty;var ac=(r,t)=>{for(var e in t)De(r,e,{get:t[e],enumerable:!0})},Ui=(r,t,e,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of nc(t))!lc.call(r,i)&&i!==e&&De(r,i,{get:()=>t[i],enumerable:!(s=ic(t,i))||s.enumerable});return r};var se=(r,t,e)=>(e=r!=null?rc(oc(r)):{},Ui(t||!r||!r.__esModule?De(e,"default",{value:r,enumerable:!0}):e,r)),hc=r=>Ui(De({},"__esModule",{value:!0}),r);var cg={};ac(cg,{Accessor:()=>Gi,Action:()=>Ws,CUSTOM_TYPES:()=>xi,ClassFlags:()=>pt,Comment:()=>$t,Component:()=>He,ComputedType:()=>Di,CustomEvent:()=>G,Document:()=>Ce,DocumentFragment:()=>Fs,EaseGroup:()=>gu,Easer:()=>Fi,Element:()=>S,ElementRoute:()=>Ks,ElementRouteTo:()=>Vi,Emitter:()=>Ne,Event:()=>Y,EventHandler:()=>Us,FocusEvent:()=>Mi,Fragment:()=>Jt,HAS:()=>xh,HTMLButtonElement:()=>Vs,HTMLElement:()=>R,HTMLHtmlElement:()=>Ti,HTMLInputElement:()=>As,HTMLLinkElement:()=>Li,HTMLOptionElement:()=>js,HTMLScriptElement:()=>wi,HTMLSelectElement:()=>Hs,HTMLStyleElement:()=>Ei,HTMLTextAreaElement:()=>Rs,ImbaElement:()=>uu,IntersectionEventDefaults:()=>Re,KeyboardEvent:()=>ki,LazyProxy:()=>ai,Location:()=>ke,MouseEvent:()=>Ds,Node:()=>D,OBSERVED:()=>T,ObservableArray:()=>ji,PointerEvent:()=>Ni,Queue:()=>bi,Ref:()=>te,RenderContext:()=>Xt,Router:()=>Ri,SVGElement:()=>Ie,SVGSVGElement:()=>Ci,Scheduler:()=>ui,ShadowRoot:()=>Zh,StyleDeclaration:()=>_i,Text:()=>Oe,Touch:()=>Ai,UIEvent:()=>Pe,Window:()=>qh,__has__$:()=>ri,__hooks__$:()=>ks,__imba__$:()=>Cs,__init__$:()=>Ct,__inited__$:()=>si,__initor__$:()=>Ns,__meta__$:()=>ii,__mixin__$:()=>ph,__patch__$:()=>mh,__served__:()=>Oh,accessor:()=>Xu,afterReconcile$:()=>bh,afterVisit$:()=>yh,appendChild$:()=>gh,atomic:()=>Hu,augment$:()=>Kt,autorun:()=>Pu,awaits:()=>Iu,beforeReconcile$:()=>vh,clearInterval:()=>fi,clearTimeout:()=>mi,colors:()=>cu,commit:()=>A,createAtom:()=>$u,createComment:()=>Pt,createComponent:()=>Oi,createDynamic:()=>ru,createElement:()=>tu,createFragment:()=>su,createIndexedList:()=>lu,createKeyedList:()=>au,createLiveFragment:()=>ou,createRef:()=>Gu,createRenderContext:()=>Ps,createSVGElement:()=>eu,createSlot:()=>Fe,createTextNode:()=>Gs,customElements:()=>Wh,decorate$:()=>Mh,defineConfig:()=>Ph,defineTag:()=>iu,descriptor:()=>Qu,devlog$:()=>Eh,disposeObservables:()=>Bu,document:()=>Is,emit:()=>ht,env:()=>vi,events:()=>vu,extend$:()=>Os,getComputed:()=>zu,getDeepPropertyDescriptor:()=>$s,getRenderContext:()=>Uh,getSuperTagType:()=>Yh,getTagType:()=>ut,get_document:()=>Qt,has$:()=>wh,hooks:()=>pi,hotkeys:()=>Mu,hydrate:()=>hu,hydrator:()=>Bs,idx$:()=>Lh,inited$:()=>Ch,is$:()=>_h,isa$:()=>Th,iterable$:()=>li,listen:()=>at,locals:()=>Zu,logFormatter:()=>Si,matcher:()=>ni,memofunc:()=>Dh,mount:()=>Pi,multi$:()=>Nh,observable:()=>Fu,once:()=>H,parseTime:()=>Wt,proxy:()=>hi,register$:()=>h,render:()=>fu,renderContext:()=>E,renderer:()=>W,reportChanged:()=>Vu,reportInvalidated:()=>ju,reportObserved:()=>Du,router:()=>Cu,run:()=>Au,rx:()=>Zt,scheduler:()=>C,serve:()=>jh,session:()=>tc,setInterval:()=>di,setTimeout:()=>ci,spy:()=>Ru,statics$:()=>oi,styles:()=>$i,sup$:()=>kh,toCamelCase:()=>$h,transitions:()=>Ae,unlisten:()=>Yt,unmount:()=>Ii,up$:()=>Sh,use_devlog:()=>Gh,use_dom_bind:()=>mu,use_dom_teleport:()=>pu,use_dom_transitions:()=>yu,use_events:()=>bu,use_events_hotkey:()=>Eu,use_events_intersect:()=>_u,use_events_keyboard:()=>Hi,use_events_mouse:()=>zs,use_events_mutate:()=>wu,use_events_pointer:()=>Su,use_events_resize:()=>Tu,use_events_selection:()=>Lu,use_events_touch:()=>xu,use_hooks:()=>Ih,use_router:()=>ku,use_slots:()=>nu,use_styles:()=>du,use_window:()=>Kh,\u03B1action:()=>Yu,\u03B1autorun:()=>Wu,\u03B1bound:()=>Hh,\u03B1computed:()=>Uu,\u03B1lazy:()=>Fh,\u03B1observable:()=>qu,\u03B1prop:()=>Ju,\u03B1ref:()=>Ku,\u03B1thenable:()=>Ah});module.exports=hc(cg);var gi=se(require("cluster")),K=se(require("fs")),Ot=se(require("path")),Rh=require("events"),yi=se(require("path")),Vh=se(require("http")),Bh=require("async_hooks"),Ct=Symbol.for("#__init__"),Ns=Symbol.for("#__initor__"),si=Symbol.for("#__inited__"),ks=Symbol.for("#__hooks__"),mh=Symbol.for("#__patch__"),ri=Symbol.for("#has"),ii=Symbol.for("#meta"),Cs=Symbol.for("imba"),ph=Symbol.for("#__mixin__"),ni=Symbol.for("#matcher"),Ge=Symbol.for("#L"),gh=Symbol.for("#appendChild"),yh=Symbol.for("#afterVisit"),vh=Symbol.for("#beforeReconcile"),bh=Symbol.for("#afterReconcile"),Sh=Symbol.for("##up"),xh={SUPERCALLS:8,CONSTRUCTOR:16},pt={IsExtension:1,IsTag:2,HasDescriptors:4,HasSuperCalls:8,HasConstructor:16,HasFields:32,HasMixins:64,HasInitor:128,HasDecorators:256,IsObjectExtension:512,IsMixin:1024},It=new Map,uc=globalThis[Cs]||(globalThis[Cs]={counter:0,classes:It});function wt(r,t={}){return It.has(r)||It.set(r,{symbol:Symbol(r.name),parent:Object.getPrototypeOf(r.prototype)?.constructor,for:r,uses:null,inits:null,id:uc.counter++,...t}),It.get(r)}var qi=new WeakMap;function _h(r,t){return r==t||t?.[ni]?.(r)}function Th(r,t){return typeof t=="string"?typeof r===t:t?.[Symbol.hasInstance]?.(r)}function wh(r,t){return t?.[ri]?.(r)??t?.includes?.(r)??t?.has?.(r)??!1}function Lh(r,t){return t?.indexOf?t.indexOf(r):Array.prototype.indexOf.call(r,t)}function Eh(r,t,...e){return t&&t[Ge]instanceof Function?r=t[Ge](r,t,...e):globalThis[Ge]instanceof Function&&(r=globalThis[Ge](r,t,...e)),r}function oi(r){return qi.get(r)||qi.set(r,{}).get(r)}function li(r){return r?.toIterable?.()||r}function Mh(r,t,e,s){let i,n=arguments.length,o=r.length,l=n<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,e):s;for(;o>0;)(i=r[--o])&&(l=(n<3?i(l):n>3?i(t,e,l):i(t,e))||l);return n>3&&l&&Object.defineProperty(t,e,l),l}function cc(r,t){if(!r||!t)return!1;if(r.get)return t.get===r.get;if(r.set)return t.set===r.set;if(r.value)return r.value===t.value}function Os(r,t,e,s={}){let i=r.constructor;!e&&t&&(e=Object.getOwnPropertyDescriptors(t),delete e.constructor,e[Ct]&&(console.warn(`Cannot define plain fields when extending class ${i.name}`),delete e[Ct]));let n=wt(i);if(n&&n.augments){let o=new Map;for(let l of Object.keys(e)){let a=Object.getOwnPropertyDescriptor(r,l);for(let u of n.augments){let d=o.get(u);d||o.set(u,d={});let c=Object.getOwnPropertyDescriptor(u.prototype,l);c&&!cc(a,c)?console.warn("wont extend",l,c,a):d[l]=e[l]}}for(let[l,a]of o)Object.keys(a).length&&Os(l.prototype,null,a)}return Object.defineProperties(r,e),r}function Kt(r,t){let e=wt(r),s=wt(t),i=s.parent;for(;i&&wt(i)?.flags&pt.IsMixin;){Kt(r,i),i=null;break}if(i&&!(r.prototype instanceof i))throw new Error(`Mixin ${t.name} has superclass not present in target class`);if(!s.augments){s.augments=new Set;let o=s.ref=Symbol(t.name),l=Object[Symbol.hasInstance];t.prototype[o]=!0,Object.defineProperty(t,Symbol.hasInstance,{value:function(a){return this===t?a&&!!a[o]:l.call(this,a)}})}if(r.prototype[s.ref])return r;if(s.uses)for(let o of s.uses)Kt(r,o);s.augments.add(r),e.uses||(e.uses=[]),e.uses.push(t);let n=Object.getOwnPropertyDescriptors(t.prototype);return delete n.constructor,n[Ct]&&(e.inits||(e.inits=[]),e.inits.push(t.prototype[Ct]),delete n[Ct]),Object.defineProperties(r.prototype,n),t?.mixed instanceof Function&&t.mixed(r),r}function Nh(r,t,...e){let s=t?class extends t{}:class{},i=wt(s,{symbol:r});for(let n of e)Kt(s,n);return s.prototype[r]=function(n,o,l){if(i.inits)for(let a of i.inits)a.call(this,n,!1,l)},s}var X={cache:{},self:null,target:null,proxy:new Proxy({},{apply:(r,t,e)=>Reflect.apply(X.target,t,e),get:(r,t)=>{let e=Reflect.get(X.target,t,X.self);return e instanceof Function?e.bind(X.self):e},set:(r,t,e,s)=>Reflect.set(X.target,t,e,X.self)})};function kh(r,t){return X.self=r,X.target=X.cache[t],X.proxy}function h(r,t,e,s,i=null){let n=Object.getPrototypeOf(r.prototype),o=(s&(pt.HasMixins|pt.IsExtension))==pt.HasMixins,l;if(o&&(It.set(r,It.get(n.constructor)),n=Object.getPrototypeOf(n)),i){let u=s&pt.IsObjectExtension?i:i.prototype,d=wt(r);if(d.uses){i===u&&console.warn("Cannot extend object with mixins");for(let c of d.uses)Kt(i,c)}return s&pt.HasSuperCalls&&(X.cache[t]=Object.create(Object.getPrototypeOf(u),Object.getOwnPropertyDescriptors(u))),Os(u,r.prototype),i}let a=n?.constructor;if(l=wt(r,{symbol:t}),Object.defineProperty(r,ii,{value:l,enumerable:!1,configurable:!0}),e&&r.name!==e&&Object.defineProperty(r,"name",{value:e,configurable:!0}),l.flags=s,s&pt.HasConstructor&&(r.prototype[Ns]=t),l.uses)for(let u of l.uses)u.mixes?.(r);return a?.inherited instanceof Function&&a.inherited(r),r}function Ch(r,t){r[Ns]===t&&(r[si]?.(),r[ks]&&r[ks].inited(r))}var Be=Symbol.for("#__listeners__"),dc=/-./g,Oh=new Set,fc=Symbol(),Ki=class{static for(t){return new Proxy({},new this(t))}constructor(t){this.getter=t}get target(){return this.getter()}get(t,e){return this.target[e]}set(t,e,s){return this.target[e]=s,!0}};h(Ki,fc,"LazyProxy",16);var ai=Ki;function hi(r,t={}){return new Proxy(t,new ai(r))}function Wt(r){let t=typeof r;if(t=="number")return r;if(t=="string"){if(/^\d+fps$/.test(r))return 1e3/parseFloat(r);if(/^([-+]?[\d\.]+)s$/.test(r))return parseFloat(r)*1e3;if(/^([-+]?[\d\.]+)ms$/.test(r))return parseFloat(r)}return null}function $h(r){return r.indexOf("-")>=0?r.replace(dc,function(t){return t.charAt(1).toUpperCase()}):r}function $s(r,t,e){if(!r)return;let s=Object.getOwnPropertyDescriptor(r,t);return s||r==e?s||void 0:$s(Reflect.getPrototypeOf(r),t,e)}var Wi=function(r,t,e){let s,i,n;for(;(s=e)&&(e=e.next);)(i=e.listener)&&(e.path&&i[e.path]?n=t?i[e.path].apply(i,t):i[e.path]():n=t?i.apply(e,t):i.call(e)),e.times&&--e.times<=0&&(s.next=e.next,e.listener=null)};function at(r,t,e,s){let i,n,o;return i=r[Be]||(r[Be]={}),n=i[t]||(i[t]={}),o=n.tail||(n.tail=n.next={}),o.listener=e,o.path=s,n.tail=o.next={},o}function H(r,t,e){let s=at(r,t,e);return s.times=1,s}function Yt(r,t,e,s){if(!e)return;let i,n,o=r[Be];if(o&&(i=o[t])){for(;(n=i)&&(i=i.next);)if(i==e||i.listener==e){n.next=i.next,i.listener=null;break}}}function ht(r,t,e=null){let s;(s=r[Be])&&(s[t]&&Wi(t,e,s[t]),s.all&&Wi(t,[t,e],s.all))}var mc=Symbol(),Yi=class{emit(t,...e){return ht(this,t,e)}on(t,...e){return at(this,t,...e)}once(t,...e){return H(this,t,...e)}un(t,...e){return Yt(this,t,...e)}};h(Yi,mc,"Emitter",0);var Ne=Yi;function Ph(r){return r}function Qs(r,t){return typeof t=="string"?typeof r===t:t[Symbol.hasInstance]?.(r)}function pc(r){let t;return r&&((t=r.toIterable)?t.call(r):r)}var Xi=Symbol.for("#__init__"),Qi=Symbol.for("#schedule"),Js=Symbol.for("#frames"),ze=Symbol.for("#interval"),Ft=Symbol.for("#stage"),Ht=Symbol.for("#scheduled"),Ue=Symbol.for("#version"),gc=Symbol.for("#fps"),Ji=Symbol.for("#ticker"),yc=globalThis.requestAnimationFrame||function(r){return globalThis.setTimeout(r,1e3/60)},pg=1/60,vc=Symbol(),Zi=class{constructor(t=null){this[Xi](t)}[Xi](t=null,e=!0,s=!0){var i;this.owner=t&&(i=t.owner)!==void 0?i:null,this.target=t&&(i=t.target)!==void 0?i:null,this.active=t&&(i=t.active)!==void 0?i:!1,this.value=t&&(i=t.value)!==void 0?i:void 0,this.skip=t&&(i=t.skip)!==void 0?i:0,this.last=t&&(i=t.last)!==void 0?i:0}tick(t,e){return this.last=this.owner[Js],this.target.tick(this,e),1}update(t,e){let s=this.active,i=t.value;return this.value!=i&&(this.deactivate(),this.value=i),(this.value||s||e)&&this.activate(),this}queue(){this.owner.add(this)}activate(){return this.value===!0?this.owner.on("commit",this):this.value===!1||typeof this.value=="number"&&(this.value/16.666666666666668<=2?this.owner.on("raf",this):this[ze]=globalThis.setInterval(this.queue.bind(this),this.value)),this.active=!0,this}deactivate(){return this.value===!0&&this.owner.un("commit",this),this.owner.un("raf",this),this[ze]&&(globalThis.clearInterval(this[ze]),this[ze]=null),this.active=!1,this}};h(Zi,vc,"Scheduled",16);var bc=Zi,Sc=Symbol(),tn=class{constructor(){var t=this;this.id=Symbol(),this.queue=[],this.stage=-1,this[Ft]=-1,this[Js]=0,this[Ht]=!1,this[Ue]=0,this.listeners={},this.intervals={},this.commit=function(){return t.add("commit"),t},this[gc]=0,this.$promise=null,this.$resolve=null,this[Ji]=function(e){return t[Ht]=!1,t.tick(e)}}touch(){return this[Ue]++}get version(){return this[Ue]}add(t,e=!1){return(e||this.queue.indexOf(t)==-1)&&this.queue.push(t),this[Ht]||this[Qi](),this}get committing\u03A6(){return this.queue.indexOf("commit")>=0}get syncing\u03A6(){return this[Ft]==1}listen(t,e){let s=this.listeners[t],i=!s;return s||(s=this.listeners[t]=new Set),s.add(e),t=="raf"&&i&&this.add("raf"),this}unlisten(t,e){var s;let i=this.listeners[t];return i&&i.delete(e),t=="raf"&&i&&i.size==0&&(s=this.listeners.raf,delete this.listeners.raf),this}on(t,e){return this.listen(t,e)}un(t,e){return this.unlisten(t,e)}get promise(){var t=this;return this.$promise||(this.$promise=new Promise(function(e){return t.$resolve=e}))}tick(t){var e=this;let s=this.queue,i=this[Js]++;if(this.ts||(this.ts=t),this.dt=t-this.ts,this.ts=t,this.queue=[],this[Ft]=1,this[Ue]++,s.length)for(let n=0,o=pc(s),l=o.length;n<l;n++){let a=o[n];typeof a=="string"&&this.listeners[a]?this.listeners[a].forEach(function(u){if(Qs(u.tick,Function))return u.tick(e,a);if(Qs(u,Function))return u(e,a)}):Qs(a,Function)?a(this.dt,this):a.tick&&a.tick(this.dt,this)}return this[Ft]=this[Ht]?0:-1,this.$promise&&(this.$resolve(this),this.$promise=this.$resolve=null),this.listeners.raf&&this.add("raf"),this}[Qi](){return this[Ht]||(this[Ht]=!0,this[Ft]==-1&&(this[Ft]=0),yc(this[Ji])),this}schedule(t,e){var s,i;return e||(e=t[s=this.id]||(t[s]={value:!0})),(e[i=this.id]||(e[i]=new bc({owner:this,target:t}))).update(e,!0)}unschedule(t,e={}){e||(e=t[this.id]);let s=e&&e[this.id];return s&&s.active&&s.deactivate(),this}};h(tn,Sc,"Scheduler",16);var ui=tn,C=new ui;function A(){return C.add("commit").promise}function ci(r,t){return globalThis.setTimeout(function(){r(),A()},t)}function di(r,t){return globalThis.setInterval(function(){r(),A()},t)}var fi=globalThis.clearInterval,mi=globalThis.clearTimeout,re=globalThis.imba||(globalThis.imba={});re.commit=A,re.setTimeout=ci,re.setInterval=di,re.clearInterval=fi,re.clearTimeout=mi;var pi={on:function(r,t){return at(this,r,t)},inited:function(r){return ht(this,"inited",[r])}};function Ih(){return!0}function en(r,t){return typeof t=="string"?typeof r===t:t[Symbol.hasInstance]?.(r)}function Fh(r,t,e){if(e.get){let s=e.get;e.get=function(){let i=s.call(this);return Object.defineProperty(this,t,{enumerable:!1,value:i}),i}}return e}function Hh(r,t,e){var s,i;if(en(e.value,Function)){let n=e.value;e.get=function(){if(this==r)return n;let o=n.bind(this);return Object.defineProperty(this,t,{enumerable:!1,value:o}),o},s=e.value,delete e.value,i=e.writable,delete e.writable}return e}var sn=new WeakMap;function Ah(r,t,e){let s=this[0]||{},i=e.value,n=Symbol(),o=new WeakMap,l=sn.get(r),a=s.timeout||20*1e3,u=""+(r.constructor?.name||"")+"."+String(typeof t=="symbol"?t.description:t);if(l||sn.set(r,l={}),l.key)throw new Error("@thenable "+u+" not allowed - @thenable "+l.key+" already defined");if(!en(i,Function))throw new Error("@thenable "+u+" only supports functions");if(i.length>0)throw new Error("@thenable "+u+" methods cannot be called with arguments");let d=function(g){return console.trace("@thenable "+u+" took more than "+a+"ms - make sure method does not return self.",g)},c=function(g){let f=o.get(g);return f||o.set(g,f={}),f},m=function(g,f){let p=this,v=c(p);return(v.promise||(v.promise=new Promise(function(w,O){let gt=s.timeout!==!1?setTimeout(d,s.timeout||2e4,p):null,L=function($){return gt&&clearTimeout(gt),v.met=!0,v.error=$,console.trace("@thenable "+u+" threw error",$),O($)};return p[t]().then(function(){return gt&&clearTimeout(gt),v.met=!0,w(p)},L)}))).then(g,f)};return Object.defineProperty(r,"then",{enumerable:!1,configurable:!0,get:function(){return c(this).met?null:m}}),e.value=function(g){let f=c(this);return f.wrapped??(f.wrapped=Promise.resolve(i.call(this,f))),f.wrapped},e.value.reset=function(g){let f=c(g);o.delete(g)},e.value.check=c,e}var xc=Symbol(),Zs,vi=new(Zs=class{get rootDir(){return process.env.IMBA_OUTDIR||yi.default.dirname(process.env.pm_exec_path||process.argv[1])}get publicPath(){return yi.default.resolve(this.rootDir,process.env.IMBA_PUBDIR||globalThis.IMBA_PUBDIR||"public")}},h(Zs,xc,"Env",0),Zs);function B(r){let t;return r&&((t=r.toIterable)?t.call(r):r)}function rn(r,t){return typeof t=="string"?typeof r===t:t[Symbol.hasInstance]?.(r)}var nn=Symbol.for("#setup"),on=Symbol.for("#setup?"),_c=Symbol.for("#dom"),Tc=Symbol.for("#server"),ie={html:{"Content-Type":"text/html; charset=utf-8"},txt:{"Content-Type":"text/plain; charset=utf-8"},js:{"Content-Type":"text/javascript; charset=utf-8"},cjs:{"Content-Type":"text/javascript; charset=utf-8"},mjs:{"Content-Type":"text/javascript; charset=utf-8"},json:{"Content-Type":"application/json; charset=utf-8"},css:{"Content-Type":"text/css; charset=utf-8"},map:{"Content-Type":"application/json; charset=utf-8"},otf:{"Content-Type":"font/otf"},ttf:{"Content-Type":"font/ttf"},woff:{"Content-Type":"font/woff"},woff2:{"Content-Type":"font/woff2"},svg:{"Content-Type":"image/svg+xml"},avif:{"Content-Type":"image/avif"},gif:{"Content-Type":"image/gif"},png:{"Content-Type":"image/png"},apng:{"Content-Type":"image/apng"},webp:{"Content-Type":"image/webp"},jpg:{"Content-Type":"image/jpeg"},jpeg:{"Content-Type":"image/jpeg"},ico:{"Content-Type":"image/x-icon"},bmp:{"Content-Type":"image/bmp"},pdf:{"Content-Type":"application/pdf"},webm:{"Content-Type":"video/webm"},weba:{"Content-Type":"audio/webm"},avi:{"Content-Type":"video/x-msvideo"},mp3:{"Content-Type":"audio/mpeg"},mp4:{"Content-Type":"video/mp4"},m4a:{"Content-Type":"audio/m4a"},mov:{"Content-Type":"video/quicktime"},wmv:{"Content-Type":"video/x-ms-wmv"},mpeg:{"Content-Type":"video/mpeg"},wav:{"Content-Type":"audio/wav"},ogg:{"Content-Type":"audio/ogg"},ogv:{"Content-Type":"video/ogg"},oga:{"Content-Type":"audio/ogg"},opus:{"Content-Type":"audio/opus"}},ln={id:Date.now()},V=globalThis.process,wc=Symbol(),an=class extends Set{call(t,...e){var s;s=[];for(let i of B(this))s.push(i[t](...e));return s}close(t={}){var e;e=[];for(let s of B(this))e.push(s.close(t));return e}reload(t={}){var e;e=[];for(let s of B(this))e.push(s.reload(t));return e}broadcast(t,...e){var s;s=[];for(let i of B(this))s.push(i.broadcast(t,...e));return s}emit(t,e){var s;s=[];for(let i of B(this))s.push(i.emit(t,e));return s}sseEnd(){let t=[];for(let e of B(this))for(let s of B(e.clients))t.push(new Promise(function(i){return s.on("finish",i),s.end()}));return Promise.all(t)}};h(an,wc,"Servers",0);var Lc=an,Lt=new Lc,Ec=Symbol(),tr,hn=new(tr=class extends Rh.EventEmitter{constructor(){var r;super(...arguments),r=this,this.autoreload=!1,this.state={},globalThis.IMBA_RUN&&(gi.default.isWorker?V.on("message",function(t){if(r.emit("message",t),t[0]=="emit")return r.emit(...t.slice(1))}):V.on("message",function(t){if(t[0]=="emit")return r.emit(...t.slice(1))}))}[nn](){var r=this;if(this[on]!=!0&&(this[on]=!0,!0))return this.on("rebuild",function(t){let e=globalThis.IMBA_MANIFEST;return globalThis.IMBA_MANIFEST=t,Lt.broadcast("rebuild",t)}),this.on("reloadHard",async function(t){return Lt.broadcast("reloadHard",t),await Lt.sseEnd(),V.exit(0)}),this.on("reloading",function(t){var e;r.state.reloading=!0,e=[];for(let s of B(Lt))e.push(s.pause());return e}),this.on("reloaded",async function(t){var e;r.state.reloaded=!0,Lt.broadcast("reloaded"),await new Promise(function(i){return setTimeout(i,100)}),e=[];for(let i of B(Lt))e.push(i.close());let s=e;return setTimeout(function(){return V.exit(0)},100),await Promise.all(s),V.exit(0)}),!0}send(r){if(rn(V.send,Function))return V.send(r)}on(r,t){return super.on(...arguments)}reload(){if(!(this.isReloading!=!0&&(this.isReloading=!0,!0)))return this;if(this.state.reloading=!0,!V.env.IMBA_SERVE){console.warn("not possible to gracefully reload servers not started via imba start");return}this.send("reload")}},h(tr,Ec,"Process",24),tr);function un(r,t=[],e=0){let s=globalThis.IMBA_MANIFEST[r];if(t.indexOf(r)>=0)return t;if(s?.imports)for(let i=0,n=B(s?.imports),o=n.length;i<o;i++){let l=n[i];t.push(l),un(l,t,e+1)}return t}var Mc=Symbol(),cn=class{constructor(t,e,s={}){this.server=t,this.url=e,[this.pathname,this.query]=e.split("?"),this.ext=Ot.default.extname(this.pathname),this.headers={"Content-Type":"text/plain","Access-Control-Allow-Origin":"*","cache-control":"public, max-age=31536000"},Object.assign(this.headers,t.options.assetHeaders||{}),Object.assign(this.headers,ie[this.ext.slice(1)]||{}),this.headers["max-age"]=864e5,s.imports&&t.options.preload!==!1&&(this.headers.Link=un(e).map(function(i){return"<"+i+">; rel=modulepreload; as=script"}).join(", ")),this.path=t.localPathForUrl(e)}respond(t,e){var s=this;return K.default.access(this.path,K.default.constants.R_OK,function(i){if(i)return e.writeHead(404,{}),e.end();try{if(s.server.options.setHeaders&&s.server.options.setHeaders(e,s.path),globalThis.BUN)return K.default.readFile(s.path,function(n,o){return e.writeHead(200,s.headers),e.end(o)});{let n=K.default.createReadStream(s.path);return e.writeHead(200,s.headers),n.pipe(e)}}catch{return e.writeHead(503,{}),e.end()}})}createReadStream(){return K.default.createReadStream(this.path)}pipe(t){return this.createReadStream().pipe(t)}};h(cn,Mc,"AssetResponder",16);var Nc=cn,kc=Symbol(),dn=class{static wrap(t,e={}){return new this(t,e)}localPathForUrl(t){var e;let s,i,n=t.replace(/\?.*$/,"");return(e=this.urlToLocalPathMap)[n]??(e[n]=(s=Ot.default.resolve(vi.publicPath,"."+n),i=K.default.existsSync(s)&&s,!i&&this.staticDir&&(s=Ot.default.resolve(this.staticDir,"."+n),i=K.default.existsSync(s)&&s),i))}headersForAsset(t){let e,s=Ot.default.extname(t);return e=Object.assign({"Content-Type":"text/plain","Access-Control-Allow-Origin":"*","cache-control":"public"},ie[s.slice(1)]||{})}get manifest(){return globalThis.IMBA_MANIFEST||{}}constructor(t,e={}){var s=this;Lt.add(this),this.id=Math.random(),this.startedAt=Date.now(),this.options=e,this.closed=!1,this.paused=!1,this.server=t,this.clients=new Set,this.stalledResponses=[],this.assetResponders={},this.urlToLocalPathMap={},this.publicExistsMap={},this.staticDir=globalThis.IMBA_STATICDIR||"",V.env.IMBA_PATH&&(this.devtoolsPath=Ot.default.resolve(V.env.IMBA_PATH,"hmr.js")),this.scheme=rn(t,Vh.default.Server)?"http":"https";let i=this.server._events.request,n=globalThis[_c];t.off("request",i),i[Tc]=this,t.on("listening",function(){let o=s.server.address(),l=o.address;(l=="::"||l=="0.0.0.0")&&(l="localhost");let a=""+s.scheme+"://"+l+":"+o.port+"/";if(!V.env.IMBA_CLUSTER)return console.log("listening on "+a)}),globalThis.IMBA_HMR&&(globalThis.IMBA_HMR_PATH="/__hmr__.js"),this.handler=function(o,l){var a;let u,d=o.constructor.name=="Http2ServerRequest",c=o.url;if(s.paused||s.closed)return l.statusCode=302,l.setHeader("Location",o.url),d||l.setHeader("Connection","close"),s.closed?(d&&o.stream.session.close(),l.end()):s.stalledResponses.push(l);if(c=="/__imba__.mjs"){l.writeHead(200,ie.mjs);let p=Ot.default.resolve(V.env.IMBA_PATH,"dist","imba.mjs");return K.default.createReadStream(p).pipe(l)}if(globalThis.IMBA_HMR){if(c=="/__hmr__.json")return l.writeHead(200,ie.json),l.end(JSON.stringify(ln));if(c=="/__hmr__.js"&&s.devtoolsPath){let p=K.default.createReadStream(s.devtoolsPath);return l.writeHead(200,ie.js),p.pipe(l)}if(c=="/__hmr__"){let p={"Content-Type":"text/event-stream","Cache-Control":"no-cache"};return d||(p.Connection="keep-alive"),l.writeHead(200,p),s.clients.add(l),s.broadcast("init",globalThis.IMBA_MANIFEST,[l]),s.broadcast("state",ln,[l]),o.on("close",function(){return s.clients.delete(l)}),!0}}let m=o.headers,g;d?g=m[":scheme"]+"://"+m[":authority"]:g=(o.connection.encrypted?"https":"http")+"://"+m.host;let f=s.manifest[c];if(f&&s.localPathForUrl(c))return((a=s.assetResponders)[c]||(a[c]=new Nc(s,c,f))).respond(o,l);if((c.match(/\.[A-Z\d]{8}\./)||c.match(/\.\w{1,4}($|\?)/))&&(u=s.localPathForUrl(c)))try{let p=s.headersForAsset(u);if(e.setHeaders&&e.setHeaders(l,u),globalThis.BUN)return K.default.readFile(u,function(v,w){return v?(l.writeHead(500,{}),l.write("Error getting the file: "+v)):(l.writeHead(200,p),l.end(w))});{let v=K.default.createReadStream(u);return l.writeHead(200,p),v.pipe(l)}}catch{return l.writeHead(503,{}),l.end()}if(n){let p=new n.Location(o.url,g);return n.Document.create({location:p},function(){return i(o,l)})}else return i(o,l)},t.on("request",this.handler),t.on("close",function(){return console.log("server is closing!")}),globalThis.IMBA_RUN&&(gi.default.isWorker||V.env.IMBA_WATCH)&&(hn[nn](),hn.send("serve"))}broadcast(t,e={},s=this.clients){e=JSON.stringify(e);let i="data: "+e+` `;for(let n of B(s))n.write("event: "+t+` `),n.write(`id: imba `),n.write(i);return this}pause(){return this.paused!=!0&&(this.paused=!0,!0)&&this.broadcast("paused"),this}resume(){if(this.paused!=!1&&(this.paused=!1,!0))return this.broadcast("resumed"),this.flushStalledResponses()}flushStalledResponses(){for(let t=0,e=B(this.stalledResponses),s=e.length;t<s;t++)e[t].end();return this.stalledResponses=[]}close(){var t=this;return this.pause(),new Promise(function(e){return t.closed=!0,t.server.close(e),t.flushStalledResponses()})}};h(dn,kc,"Server",16);var Cc=dn;function jh(r,...t){return Cc.wrap(r,...t)}var fn={};function Dh(r,t,e){if(t!=null){let s=fn[r]||(fn[r]=new WeakMap);return s.get(t)||s.set(t,(e.memoized=r)&&e).get(t)}return e}function Oc(r,t){return typeof t=="string"?typeof r===t:t[Symbol.hasInstance]?.(r)}var qe=Symbol.for("#idler"),ne=Symbol.for("#resolve"),$c=Symbol(),mn=class extends Set{constructor(){super(),this[qe]=Promise.resolve(this)}emit(t,...e){return ht(this,t,e)}on(t,...e){return at(this,t,...e)}once(t,...e){return H(this,t,...e)}un(t,...e){return Yt(this,t,...e)}add(t){var e=this;if(Oc(t,Function)&&(t=t()),!this.has(t)){let s=this.size==0;super.add(t),s&&(this[qe]=this[ne]=null,this.emit("busy",this)),this.emit("add",t,this);let i=function(){return e.delete(t)};t.then(i,i)}return t}delete(t){return super.delete(t)?(this.emit("delete",t,this),this.size==0&&(this[ne]&&(this[ne](!0),this[ne]=null),this.emit("idle",this)),!0):!1}get idle(){var t=this;return this[qe]||(this[qe]=new Promise(function(e){return t.size==0?e(!0):t[ne]=e}))}get idle\u03A6(){return this.size==0}then(t,e){return this.idle.then(t,e)}};h(mn,$c,"Queue",24);var bi=mn;function Si(r,t){let e=[],s=[];for(let i=0,n=li(r),o=n.length;i<o;i++){let l=n[i];if(i%2!=0)continue;let a=r[i+1];l==""?(s.push("%s"),e.push("\x1B[40m\x1B[32m"+a+"\x1B[0m")):(s.push("%s %O"),e.push("\x1B[44m\x1B[97m"+l+"\x1B[0m"),e.push(a))}return[s.join(" "),...e]}var er=Symbol.for("#L");function Gh(){return globalThis[er]||(globalThis[er]=globalThis[er]||Si),!0}function Pc(r){let t;return r&&((t=r.toIterable)?t.call(r):r)}var Z={"":[-1,{id:1,slot:1,part:1,elementTiming:"elementtiming"}],HTML:[-1,{title:1,lang:1,translate:1,dir:1,accessKey:"accesskey",draggable:1,spellcheck:1,autocapitalize:1,inputMode:"inputmode",style:1,tabIndex:"tabindex",enterKeyHint:"enterkeyhint"}],HTMLAnchor:[1,{target:1,download:1,ping:1,rel:1,relList:"rel",hreflang:1,type:1,referrerPolicy:"referrerpolicy",coords:1,charset:1,name:1,rev:1,shape:1,href:1}],HTMLArea:[1,{alt:1,coords:1,download:1,shape:1,target:1,ping:1,rel:1,relList:"rel",referrerPolicy:"referrerpolicy",href:1}],HTMLMedia:[1,{src:1,crossOrigin:"crossorigin",preload:1,controlsList:"controlslist"}],HTMLAudio:[4,{}],HTMLBase:[1,{href:1,target:1}],HTMLQuote:[1,{cite:1}],HTMLBody:[1,{text:1,link:1,vLink:"vlink",aLink:"alink",bgColor:"bgcolor",background:1}],HTMLBR:[1,{clear:1}],HTMLButton:[1,{formAction:"formaction",formEnctype:"formenctype",formMethod:"formmethod",formTarget:"formtarget",name:1,type:1,value:1}],HTMLCanvas:[1,{width:1,height:1}],HTMLTableCaption:[1,{align:1}],HTMLTableCol:[1,{span:1,align:1,ch:"char",chOff:"charoff",vAlign:"valign",width:1}],HTMLData:[1,{value:1}],HTMLDataList:[1,{}],HTMLMod:[1,{cite:1,dateTime:"datetime"}],HTMLDetails:[1,{}],HTMLDialog:[1,{}],HTMLDiv:[1,{align:1}],HTMLDList:[1,{}],HTMLEmbed:[1,{src:1,type:1,width:1,height:1,align:1,name:1}],HTMLFieldSet:[1,{name:1}],HTMLForm:[1,{acceptCharset:"accept-charset",action:1,autocomplete:1,enctype:1,encoding:"enctype",method:1,name:1,target:1}],HTMLHeading:[1,{align:1}],HTMLHead:[1,{}],HTMLHR:[1,{align:1,color:1,size:1,width:1}],HTMLHtml:[1,{version:1}],HTMLIFrame:[1,{src:1,srcdoc:1,name:1,sandbox:1,width:1,height:1,referrerPolicy:"referrerpolicy",csp:1,allow:1,align:1,scrolling:1,frameBorder:"frameborder",longDesc:"longdesc",marginHeight:"marginheight",marginWidth:"marginwidth",loading:1}],HTMLImage:[1,{alt:1,src:1,srcset:1,sizes:1,crossOrigin:"crossorigin",useMap:"usemap",width:1,height:1,referrerPolicy:"referrerpolicy",decoding:1,name:1,lowsrc:1,align:1,hspace:1,vspace:1,longDesc:"longdesc",border:1,loading:1}],HTMLInput:[1,{accept:1,alt:1,autocomplete:1,dirName:"dirname",formAction:"formaction",formEnctype:"formenctype",formMethod:"formmethod",formTarget:"formtarget",height:1,max:1,maxLength:"maxlength",min:1,minLength:"minlength",name:1,pattern:1,placeholder:1,src:1,step:1,type:1,defaultValue:"value",value:1,width:1,align:1,useMap:"usemap",required:1}],HTMLLabel:[1,{htmlFor:"for"}],HTMLLegend:[1,{align:1}],HTMLLI:[1,{value:1,type:1}],HTMLLink:[1,{href:1,crossOrigin:"crossorigin",rel:1,relList:"rel",media:1,hreflang:1,type:1,as:1,referrerPolicy:"referrerpolicy",sizes:1,imageSrcset:"imagesrcset",imageSizes:"imagesizes",charset:1,rev:1,target:1,integrity:1}],HTMLMap:[1,{name:1}],HTMLMenu:[1,{}],HTMLMeta:[1,{name:1,httpEquiv:"http-equiv",content:1,scheme:1,property:1,charset:1}],HTMLMeter:[1,{value:1,min:1,max:1,low:1,high:1,optimum:1}],HTMLObject:[1,{data:1,type:1,name:1,useMap:"usemap",width:1,height:1,align:1,archive:1,code:1,hspace:1,standby:1,vspace:1,codeBase:"codebase",codeType:"codetype",border:1}],HTMLOList:[1,{start:1,type:1}],HTMLOptGroup:[1,{label:1}],HTMLOption:[1,{label:1,value:1}],HTMLOutput:[1,{htmlFor:"for",name:1}],HTMLParagraph:[1,{align:1}],HTMLParam:[1,{name:1,value:1,type:1,valueType:"valuetype"}],HTMLPicture:[1,{}],HTMLPre:[1,{width:1}],HTMLProgress:[1,{value:1,max:1}],HTMLScript:[1,{src:1,type:1,charset:1,crossOrigin:"crossorigin",referrerPolicy:"referrerpolicy",event:1,htmlFor:"for",integrity:1,defer:1,async:1}],HTMLSelect:[1,{autocomplete:1,name:1,size:1,value:1,required:1}],HTMLSlot:[1,{name:1}],HTMLSource:[1,{src:1,type:1,srcset:1,sizes:1,media:1}],HTMLSpan:[1,{}],HTMLStyle:[1,{media:1,type:1}],HTMLTable:[1,{align:1,border:1,frame:1,rules:1,summary:1,width:1,bgColor:"bgcolor",cellPadding:"cellpadding",cellSpacing:"cellspacing"}],HTMLTableSection:[1,{align:1,ch:"char",chOff:"charoff",vAlign:"valign"}],HTMLTableCell:[1,{colSpan:"colspan",rowSpan:"rowspan",headers:1,align:1,axis:1,height:1,width:1,ch:"char",chOff:"charoff",vAlign:"valign",bgColor:"bgcolor",abbr:1,scope:1}],HTMLTemplate:[1,{}],HTMLTextArea:[1,{autocomplete:1,cols:1,dirName:"dirname",maxLength:"maxlength",minLength:"minlength",name:1,placeholder:1,rows:1,wrap:1}],HTMLTime:[1,{dateTime:"datetime"}],HTMLTitle:[1,{}],HTMLTableRow:[1,{align:1,ch:"char",chOff:"charoff",vAlign:"valign",bgColor:"bgcolor"}],HTMLTrack:[1,{kind:1,src:1,srclang:1,label:1}],HTMLUList:[1,{type:1}],HTMLVideo:[4,{width:1,height:1,poster:1}],SVG:[-1,{}],SVGGraphics:[66,{transform:1}],SVGA:[67,{}],SVGAnimation:[66,{}],SVGAnimate:[69,{}],SVGAnimateMotion:[69,{}],SVGAnimateTransform:[69,{}],SVGGeometry:[67,{}],SVGCircle:[73,{cx:1,cy:1,r:1}],SVGClipPath:[67,{clipPathUnits:1}],SVGDefs:[67,{}],SVGDesc:[66,{}],SVGDiscard:[66,{}],SVGEllipse:[73,{cx:1,cy:1,rx:1,ry:1}],SVGFEBlend:[66,{mode:1,x:1,y:1,width:1,height:1}],SVGFEColorMatrix:[66,{type:1,values:1,x:1,y:1,width:1,height:1}],SVGFEComponentTransfer:[66,{x:1,y:1,width:1,height:1}],SVGFEComposite:[66,{operator:1,x:1,y:1,width:1,height:1}],SVGFEConvolveMatrix:[66,{orderX:1,orderY:1,kernelMatrix:1,divisor:1,edgeMode:1,x:1,y:1,width:1,height:1}],SVGFEDiffuseLighting:[66,{surfaceScale:1,diffuseConstant:1,x:1,y:1,width:1,height:1}],SVGFEDisplacementMap:[66,{xChannelSelector:1,yChannelSelector:1,x:1,y:1,width:1,height:1}],SVGFEDistantLight:[66,{}],SVGFEDropShadow:[66,{dx:1,dy:1,stdDeviationX:1,stdDeviationY:1,x:1,y:1,width:1,height:1}],SVGFEFlood:[66,{x:1,y:1,width:1,height:1}],SVGComponentTransferFunction:[66,{type:1,tableValues:1,slope:1,amplitude:1,exponent:1}],SVGFEFuncA:[90,{}],SVGFEFuncB:[90,{}],SVGFEFuncG:[90,{}],SVGFEFuncR:[90,{}],SVGFEGaussianBlur:[66,{x:1,y:1,width:1,height:1}],SVGFEImage:[66,{preserveAspectRatio:1,x:1,y:1,width:1,height:1}],SVGFEMerge:[66,{x:1,y:1,width:1,height:1}],SVGFEMergeNode:[66,{}],SVGFEMorphology:[66,{operator:1,x:1,y:1,width:1,height:1}],SVGFEOffset:[66,{x:1,y:1,width:1,height:1}],SVGFEPointLight:[66,{}],SVGFESpecularLighting:[66,{surfaceScale:1,specularConstant:1,specularExponent:1,x:1,y:1,width:1,height:1}],SVGFESpotLight:[66,{specularExponent:1}],SVGFETile:[66,{x:1,y:1,width:1,height:1}],SVGFETurbulence:[66,{numOctaves:1,stitchTiles:1,type:1,x:1,y:1,width:1,height:1}],SVGFilter:[66,{filterUnits:1,primitiveUnits:1,x:1,y:1,width:1,height:1}],SVGForeignObject:[67,{x:1,y:1,width:1,height:1}],SVGG:[67,{}],SVGImage:[67,{x:1,y:1,width:1,height:1,preserveAspectRatio:1}],SVGLine:[73,{x1:1,y1:1,x2:1,y2:1}],SVGGradient:[66,{gradientUnits:1,gradientTransform:1,spreadMethod:1}],SVGLinearGradient:[111,{x1:1,y1:1,x2:1,y2:1}],SVGMarker:[66,{refX:1,refY:1,markerUnits:1,markerWidth:1,markerHeight:1,orientType:1,orientAngle:1,viewBox:1,preserveAspectRatio:1}],SVGMask:[66,{maskUnits:1,maskContentUnits:1,x:1,y:1,width:1,height:1}],SVGMetadata:[66,{}],SVGMPath:[66,{}],SVGPath:[73,{}],SVGPattern:[66,{patternUnits:1,patternContentUnits:1,patternTransform:1,x:1,y:1,width:1,height:1,viewBox:1,preserveAspectRatio:1}],SVGPolygon:[73,{}],SVGPolyline:[73,{}],SVGRadialGradient:[111,{cx:1,cy:1,r:1,fx:1,fy:1,fr:1}],SVGRect:[73,{x:1,y:1,width:1,height:1,rx:1,ry:1}],SVGScript:[66,{}],SVGSet:[69,{}],SVGStop:[66,{}],SVGStyle:[66,{}],SVGSVG:[67,{x:1,y:1,width:1,height:1,viewBox:1,preserveAspectRatio:1}],SVGSwitch:[67,{}],SVGSymbol:[66,{viewBox:1,preserveAspectRatio:1}],SVGTextContent:[67,{textLength:1,lengthAdjust:1}],SVGTextPositioning:[130,{x:1,y:1,dx:1,dy:1,rotate:1}],SVGText:[131,{}],SVGTextPath:[130,{startOffset:1,method:1,spacing:1}],SVGTitle:[66,{}],SVGTSpan:[131,{}],SVGUse:[67,{x:1,y:1,width:1,height:1}],SVGView:[66,{viewBox:1,preserveAspectRatio:1}]},M={a:2,abbr:1,address:1,area:3,article:1,aside:1,audio:5,b:1,base:6,bdi:1,bdo:1,blockquote:7,body:8,br:9,button:10,canvas:11,caption:12,cite:1,code:1,col:13,colgroup:13,data:14,datalist:15,dd:1,del:16,details:17,dfn:1,dialog:18,div:19,dl:20,dt:1,em:1,embed:21,fieldset:22,figcaption:1,figure:1,footer:1,form:23,h1:24,h2:24,h3:24,h4:24,h5:24,h6:24,head:25,header:1,hgroup:1,hr:26,html:27,i:1,iframe:28,img:29,input:30,ins:16,kbd:1,label:31,legend:32,li:33,link:34,main:1,map:35,mark:1,menu:36,meta:37,meter:38,nav:1,noscript:1,object:39,ol:40,optgroup:41,option:42,output:43,p:44,param:45,picture:46,pre:47,progress:48,q:7,rp:1,rt:1,ruby:1,s:1,samp:1,script:49,section:1,select:50,slot:51,small:1,source:52,span:53,strike:1,strong:1,style:54,sub:1,summary:1,sup:1,table:55,tbody:56,td:57,template:58,textarea:59,tfoot:56,th:57,thead:56,time:60,title:61,tr:62,track:63,u:1,ul:64,var:1,video:65,wbr:1,svg_a:68,svg_animate:70,svg_animateMotion:71,svg_animateTransform:72,svg_audio:66,svg_canvas:66,svg_circle:74,svg_clipPath:75,svg_defs:76,svg_desc:77,svg_discard:78,svg_ellipse:79,svg_feBlend:80,svg_feColorMatrix:81,svg_feComponentTransfer:82,svg_feComposite:83,svg_feConvolveMatrix:84,svg_feDiffuseLighting:85,svg_feDisplacementMap:86,svg_feDistantLight:87,svg_feDropShadow:88,svg_feFlood:89,svg_feFuncA:91,svg_feFuncB:92,svg_feFuncG:93,svg_feFuncR:94,svg_feGaussianBlur:95,svg_feImage:96,svg_feMerge:97,svg_feMergeNode:98,svg_feMorphology:99,svg_feOffset:100,svg_fePointLight:101,svg_feSpecularLighting:102,svg_feSpotLight:103,svg_feTile:104,svg_feTurbulence:105,svg_filter:106,svg_foreignObject:107,svg_g:108,svg_iframe:66,svg_image:109,svg_line:110,svg_linearGradient:112,svg_marker:113,svg_mask:114,svg_metadata:115,svg_mpath:116,svg_path:117,svg_pattern:118,svg_polygon:119,svg_polyline:120,svg_radialGradient:121,svg_rect:122,svg_script:123,svg_set:124,svg_stop:125,svg_style:126,svg_svg:127,svg_switch:128,svg_symbol:129,svg_text:132,svg_textPath:133,svg_title:134,svg_tspan:135,svg_unknown:66,svg_use:136,svg_video:66,svg_view:137},sr=Object.keys(Z);for(let r=0,t=Pc(sr),e=t.length;r<e;r++){let s=t[r],i=Z[s];i.name=s+"Element",i.up=Z[sr[i[0]]]}for(let r=0,t=Object.keys(M),e=t.length,s,i;r<e;r++)s=t[r],i=M[s],M[s]=Z[sr[i]],s.indexOf("svg_")==0&&(M[s.replace("_",":")]=M[s]);var pn=Symbol.for("#toStringDeopt"),Ke=Symbol.for("#named"),gn=Symbol.for("#symbols"),yn=Symbol.for("#batches"),vn=Symbol.for("#extras"),bn=Symbol.for("#stacks"),Ic=Symbol(),Sn=class{constructor(t){this.dom=t,this.string=""}contains(t){return this.dom.classList.contains(t)}has(t){return this.dom.classList.contains(t)}add(t){return this.contains(t)?this:(this.string+=(this.string?" ":"")+t,this.dom.classList.add(t),this)}set(t,e){this[Ke]||(this[Ke]={});let s=this[Ke][t];return s!=e&&(s&&this.decr(s),e&&this.incr(e),this[Ke][t]=e),this}remove(t){if(!this.contains(t))return this;let e=new RegExp("(^|\\s)"+t+"(?=\\s|$)","g");return this.string=this.string.replace(e,""),this.dom.classList.remove(t),this}toggle(t,e){return e===void 0&&(e=!this.contains(t)),e?this.add(t):this.remove(t)}incr(t,e=0){var s=this;let i=this.stacks,n=i[t]||0;return n<1&&this.add(t),e>0&&setTimeout(function(){return s.decr(t)},e),i[t]=Math.max(n,0)+1}decr(t){let e=this.stacks,s=e[t]||0;return s==1&&this.remove(t),e[t]=Math.max(s,1)-1}reconcile(t,e,s){let i=this[gn],n=this[yn],o=!0;if(!i)i=this[gn]=[t],n=this[yn]=[e||""],s&&(this.dom.className||"").indexOf(s)==-1&&(i.push(t),n.push(s)),this.toString=this.valueOf=this[pn];else{let l=i.indexOf(t),a=e||"";l==-1?(i.push(t),n.push(a),s&&(this.dom.className||"").indexOf(s)==-1&&(i.push(t),n.push(s))):n[l]!=a?n[l]=a:o=!1}o&&(this[vn]=" "+n.join(" "),this.sync())}valueOf(){return this.string}toString(){return this.string}[pn](){return this.string+(this[vn]||"")}sync(){return this.dom.flagSync$()}get stacks(){return this[bn]||(this[bn]={})}};h(Sn,Ic,"Flags",16);var rr=Sn,xn=Symbol.for("#__init__"),ir=Symbol.for("#getRenderContext"),Fc=Symbol.for("#getDynamicContext"),Hc=Symbol.for("#removeFromCache"),E={context:null,document:null,createTextNode:function(r){return globalThis.document.createTextNode(r)}},Ac=Symbol(),_n=class{constructor(t=null){this[xn](t)}[xn](t=null,e=!0,s=!0){var i;this.stack=t&&(i=t.stack)!==void 0?i:[],this.moving=t&&(i=t.moving)!==void 0?i:new Set}push(t){return this.stack.push(t)}pop(t){return this.stack.pop()}};h(_n,Ac,"Renderer",16);var Rc=_n,W=new Rc,Vc=Symbol(),Tn=class zh extends Map{constructor(t,e=null){super(),this._=t,this.sym=e}pop(){return E.context=null}[ir](t){let e=this.get(t);return e||this.set(t,e=new zh(this._,t)),E.context=e}[Fc](t,e){return this[ir](t)[ir](e)}[Hc](t){let e=this[t];return e&&(this.delete(e),this[t]=null,this.value==e&&(this.value=null)),this}run(t,e=1){if(this.value=t,E.context==this&&(E.context=null),typeof t=="number"&&(t=String(t)),typeof t=="string"&&e==0){let s=this.text||(this.text=E.createTextNode(t));return t!=s.textContent&&(s.textContent=t),s}return this.get(t)}cache(t){return this.set(this.value,t),t}};h(Tn,Vc,"RenderContext",16);var Xt=Tn;function Ps(r,t=Symbol(),e=r){return E.context=r[t]||(r[t]=new Xt(e,t))}function Uh(){let r=E.context,t=r||new Xt(null);return globalThis.DEBUG_IMBA&&!r&&W.stack.length>0&&console.trace("detected unmemoized nodes in",W.stack.slice(0),"see https://imba.io",t),r&&(E.context=null),t}function Q(r,t){return typeof t=="string"?typeof r===t:t[Symbol.hasInstance]?.(r)}function oe(r){let t;return r&&((t=r.toIterable)?t.call(r):r)}var nr=Symbol.for("#parent"),wn=Symbol.for("#context"),Ln=Symbol.for("#closestNode"),jc=Symbol.for("#parentNode"),Et=Symbol.for("#__init__"),Dc=Symbol.for("##inited"),or=Symbol.for("#getRenderContext"),Gc=Symbol.for("#getDynamicContext"),lr=Symbol.for("#replaceChild"),le=Symbol.for("#appendChild"),En=Symbol.for("#removeChild"),yt=Symbol.for("#insertInto"),Mn=Symbol.for("#insertChild"),ae=Symbol.for("#removeFrom"),Nn=Symbol.for("#removeFromDeopt"),At=Symbol.for("#replaceWith"),kn=Symbol.for("#replaceWithDeopt"),ar=Symbol.for("#placeholderNode"),Bc=Symbol.for("#attachToParent"),zc=Symbol.for("#detachFromParent"),Uc=Symbol.for("#placeChild"),qc=Symbol.for("#beforeReconcile"),Kc=Symbol.for("#afterReconcile"),Wc=Symbol.for("#afterVisit"),Yc=Symbol.for("#visitContext"),Cn=Symbol.for("#document"),We=Symbol.for("#htmlNodeName"),On=Symbol.for("#ImbaElement"),$n=Symbol.for("#flags"),Ye=Symbol.for("#scripts"),hr=Symbol.for("#location"),Pn=Symbol.for("##document"),In=Symbol.for("##parent"),Xc=Symbol.for("##up"),Fn=Symbol.for("##context"),he=Symbol.for("#domNode"),Xe=Symbol.for("##placeholderNode"),Hn=Symbol.for("#domDeopt"),Qc=Symbol.for("#insertIntoDeopt"),An=Symbol.for("##classList"),Qe=Symbol.for("##style"),Rn=Symbol.for("##dataset"),ct=Symbol.for("#asset"),ur=Symbol.for("#innerHTML"),Je=Symbol.for("##visitContext"),Jc=Symbol.for("#isRichElement"),ue=Symbol.for("#src"),Zc=Symbol.for("#getSlot"),td=Symbol.for("#cssns"),ed=Symbol.for("#cssid"),sd=Symbol.for("#dom"),rd={},ce=null,id=Symbol(),Vn=class extends URL{};h(Vn,id,"Location",0);var ke=Vn,nd=Symbol(),jn=class{get document(){return this[Cn]||(this[Cn]=new this.Document(this))}get location(){return this.document.location}};h(jn,nd,"Window",0);var qh=jn;function Kh(){return globalThis.imba.uses_window=!0,!0}var od={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},dt=null,Dn={},ld=Symbol(),Gn=class{define(){return this}get(){return this}upgrade(){}whenDefined(){}};h(Gn,ld,"CustomElementRegistry",0);var ad=Gn,Wh=new ad,xi={};function ut(r,t){let e=r;if(typeof r=="string"&&(r=Z[r]||M[r]||Z[r+"Element"]||M["svg_"+r]),Q(r,D))return r;if(!r)return ut("HTML");if(r&&!r.klass){let s=Symbol(),i=class extends ut(r.up){};h(i,s,"element",0);let n=i;r.klass=n}if(r&&!r.idl){r.idl=!0;let s=Object.getOwnPropertyDescriptors(r.klass.prototype);for(let i=r[1],n=0,o=Object.keys(i),l=o.length,a,u;n<l;n++){a=o[n],u=i[a];let d=u==1?a:u;s[d]||d=="style"||Object.defineProperty(r.klass.prototype,a,{set:function(c){this.setAttribute(d,c)},get:function(){return this.getAttribute(d)}})}}return r.klass}function Yh(r,t,e){var s;let i=ut(r,t);if(!(i==e||Q(i.prototype,e)||i.prototype[We])){let n=i.prototype[On];if(!n){let o=Symbol();n=(s=class extends i{constructor(){super(...arguments),this.__slots={},this.__F=0}},h(s,o,"CustomBuiltInElement",16),s),i.prototype[On]=n;let l=Object.getOwnPropertyDescriptors(e.prototype);Object.defineProperties(n.prototype,l),n.prototype[We]=r}return n}return i}var Ze=function(r){let t=typeof r=="string"?r:String(r);return t.indexOf('"')>=0&&(t=t.replace(/\"/g,"&quot;")),t},cr=function(r,t){let e=typeof r=="string"?r:String(r);return t=="script"||t=="style"||(e.indexOf('"')>=0&&(e=e.replace(/\"/g,"&quot;")),e.indexOf("<")>=0&&(e=e.replace(/\</g,"&lt;")),e.indexOf(">")>=0&&(e=e.replace(/\>/g,"&gt;"))),e},hd=Symbol(),Bn=class Xh{static create(t,e){let s=new Xh;return s[wn]=t,s.location=t.location,ce||(ce=new Bh.AsyncLocalStorage),ce.run(s,e),s}constructor(){}get flags(){return this[$n]||(this[$n]=new rr({classList:new Un(this)}))}get scripts(){return this[Ye]||(this[Ye]=[])}set location(t){typeof t=="string"&&(t=new ke(t)),this[hr]=t}get location(){return this[hr]||(this[hr]=new ke("http://localhost/"))}createElement(t){let e=ut(t),s=new e(t);return s.nodeName=t,s}createElementNS(t,e){if(t=="http://www.w3.org/2000/svg"){let s=ut("svg_"+e),i=new s;return i.nodeName=e,i}return this.createElement(e)}createTextNode(t){return new Oe(t)}createComment(t){return new $t(t)}createDocumentFragment(){return new Fs}getElementById(t){return null}};h(Bn,hd,"Document",16);var Ce=Bn,tt=new Ce;E.createTextNode=function(r){return tt.createTextNode(r)};var Is=tt;function Qt(){return ce&&ce?.getStore?.()||tt}var ud=Symbol(),zn=class Qh{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 Qh(t,this.classes.slice(0))}toString(){return this.classes.join(" ").trim()}};h(zn,ud,"DOMTokenList",16);var Un=zn,cd=Symbol(),qn=class{constructor(){}removeProperty(t){var e;return e=this[t],delete this[t],e}setProperty(t,e){return this[t]=e}toString(){let t=[];for(let e=this,s=0,i=Object.keys(e),n=i.length,o,l;s<n;s++)o=i[s],l=e[o],Q(l,Function)||t.push(""+o+": "+l);return t.join(";")}};h(qn,cd,"StyleDeclaration",16);var _i=qn,dd=Symbol(),Kn=class Jh{static wrap(t){return new Proxy(t.attributes,new Jh)}set(t,e,s){return t["data-"+e]=s,!0}get(t,e){return t["data-"+e]}};h(Kn,dd,"DataSet",0);var fd=Kn,md={get(r,t){let e=r,s;for(;e&&s==null;)(e=e[nr])&&(s=e[t]);return s}},pd=Symbol(),Wn=class{toString(){return this.outerHTML}get outerHTML(){return""}text$(t){return this.textContent=t,this}get ownerDocument(){return this[Pn]||(this[Pn]=Qt())}get[nr](){return this[In]||this.parentNode||this[Xc]}get[wn](){return this[Fn]||(this[Fn]=new Proxy(this,md))}get[Ln](){return this}get[jc](){return this[nr]?.[Ln]}[Et](){return this}[Dc](){return this}[or](t){return Ps(this,t)}[Gc](t,e){return this[or](t)[or](e)}[lr](t,e){let s=this[Mn](t,e);return this[En](e),s}[le](t){return t[yt](this,null)}[En](t){return t[ae](this)}[yt](t,e){return e?t.insertBefore(this,e):t.appendChild(this),this}[Mn](t,e){return t[yt](this,e)}[ae](t){return t.removeChild(this)}[Nn](t){return t.removeChild(this[he]||this)}[At](t,e){return e[lr](t,this)}[kn](t,e){return e[lr](t,this[he]||this)}get[ar](){return this[Xe]||(this[Xe]=tt.createComment("placeholder"))}set[ar](t){let e=this[Xe];this[Xe]=t,e&&e!=t&&e.parentNode&&e[At](t)}[Bc](){let t=this[he],e=t&&t.parentNode;return t&&e&&t!=this&&(this[he]=null,this[yt](e,t),t[ae](e)),this}[zc](){this[Hn]!=!0&&(this[Hn]=!0,!0)&&(this[At]=this[kn],this[ae]=this[Nn],this[yt]=this[Qc]);let t=this[ar];return this.parentNode&&t!=this&&(t[yt](this.parentNode,this),this[ae](this.parentNode)),this[he]=t,this}[Uc](t,e,s){let i=typeof t;if(i==="undefined"||t===null){if(s&&Q(s,$t))return s;let n=new $t("");return s?s[At](n,this):n[yt](this,null)}if(t===s)return t;if(i!=="object"){let n,o=t;return e&128&&e&256,s?Q(s,Oe)?(s.textContent=o,s):(n=Is.createTextNode(o),s[At](n,this),n):(this.appendChild(n=Is.createTextNode(o)),n)}else return s?s[At](t,this):t[yt](this,null)}};h(Wn,pd,"Node",0);var D=Wn,gd=Symbol(),Yn=class extends D{constructor(t){super(),this.textContent=t??""}get outerHTML(){return this.textContent}};h(Yn,gd,"Text",16);var Oe=Yn,yd=Symbol(),Xn=class extends D{constructor(t){super(),this.value=t}get outerHTML(){return"<!-- "+cr(this.value)+" -->"}toString(){return this.tag&&this.tag.toNodeString?this.tag.toNodeString():this.outerHTML}};h(Xn,yd,"Comment",16);var $t=Xn,vd=Symbol(),Qn=class $e extends D{constructor(t){super(),this.nodeName=t,this.childNodes=[],this.attributes={}}emit(t,e,s={bubbles:!0}){console.warn("Element#emit not supported on node")}get classList(){return this[An]||(this[An]=new Un(this))}get style(){return this[Qe]||(this[Qe]=new _i)}get dataset(){return this[Rn]||(this[Rn]=fd.wrap(this))}get richValue(){return this.value}set richValue(t){this.value=t}set asset(t){this[ct]=t}get asset(){return this[ct]}appendChild(t){return this.childNodes.push(t),t.parentNode=this,t}removeChild(t){let e=this.childNodes.indexOf(t);return e>=0&&this.childNodes.splice(e,1),this}replaceChild(t,e){let s=this.childNodes.indexOf(e);return s>=0&&(this.childNodes.splice(s,1,t),t.parentNode=this),e}insertBefore(t,e){let s=this.childNodes.indexOf(e);return this.childNodes.splice(s,0,t),this}setAttribute(t,e){return this.attributes[t]=e,this}setAttributeNS(t,e,s){return this.setAttribute(t+":"+e,s)}getAttribute(t){return this.attributes?this.attributes[t]:void 0}getAttributeNS(t,e){return this.getAttribute(t+":"+e)}removeAttribute(t){var e;return e=this.attributes[t],delete this.attributes[t],!0}addEventListener(){return this}removeEventListener(){return this}resolve(){return this}set innerHTML(t){this[ur]=t}get innerHTML(){let t="";if(this[ur])return this[ur];if(this.textContent!=null)return cr(this.textContent,this.nodeName);for(let e=0,s=oe(this.childNodes),i=s.length;e<i;e++){let n=s[e];typeof n=="string"?t+=cr(n,this.nodeName):Q(n,Number)?t+=""+n:n&&(t+=n.outerHTML)}return t}get outerHTML(){let t=this.nodeName,e=this[We],s=""+t;e&&(s=""+e+" is='"+t+"'",t=e);let i,n=this.id,o=this.classList.toString();this.dehydrate&&(o=o?"_ssr_ "+o:"_ssr_",this.dehydrate()),n&&(s+=' id="'+Ze(n)+'"'),o&&(s+=' class="'+Ze(o)+'"');for(let l=this.attributes,a=0,u=Object.keys(l),d=u.length,c,m;a<d;a++)c=u[a],m=l[c],!(c=="id"&&n)&&(s+=" "+c+'="'+Ze(m)+'"');return this[Qe]&&(s+=' style="'+Ze(this[Qe].toString())+'"'),od[t]?"<"+s+">":"<"+s+">"+this.innerHTML+"</"+t+">"}get firstChild(){return this.childNodes[0]}get lastChild(){return this.childNodes[this.childNodes.length-1]}get firstElementChild(){let t=this.childNodes.length,e=0;for(;e<t;){let s=this.childNodes[e++];if(Q(s,$e))return s}return null}get lastElementChild(){let t=this.childNodes.length;for(;t>0;){let e=this.childNodes[--t];if(Q(e,$e))return e}return null}get className(){return this.classList.toString()}set className(t){this.classList.classes=(t||"").split(" "),this.classList.toString()}log(...t){return console.log(...t)}text$(t){return this.textContent=t,this}[qc](){return this}[Kc](){return this}[Wc](){this.render&&this.render(),this[Je]&&(this[Je]=null)}get[Yc](){return this[Je]||(this[Je]={})}get flags