imba
Version:
7 lines (5 loc) • 137 kB
JavaScript
var xa=Object.create,De=Object.defineProperty,Sa=Object.getPrototypeOf,wa=Object.prototype.hasOwnProperty,Ta=Object.getOwnPropertyNames,La=Object.getOwnPropertyDescriptor;var bs=i=>De(i,"__esModule",{value:!0});var Ea=(i,t)=>()=>(t||(t={exports:{}},i(t.exports,t)),t.exports),Ma=(i,t)=>{for(var e in t)De(i,e,{get:t[e],enumerable:!0})},Na=(i,t,e)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Ta(t))!wa.call(i,r)&&r!=="default"&&De(i,r,{get:()=>t[r],enumerable:!(e=La(t,r))||e.enumerable});return i},$=i=>Na(bs(De(i!=null?xa(Sa(i)):{},"default",i&&i.__esModule&&"default"in i?{get:()=>i.default,enumerable:!0}:{value:i,enumerable:!0})),i);var fh=Ea((Yd,Xi)=>{"use strict";var le=typeof Reflect=="object"?Reflect:null,ih=le&&typeof le.apply=="function"?le.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)},$r;le&&typeof le.ownKeys=="function"?$r=le.ownKeys:Object.getOwnPropertySymbols?$r=function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:$r=function(t){return Object.getOwnPropertyNames(t)};function yc(i){console&&console.warn&&console.warn(i)}var sh=Number.isNaN||function(t){return t!==t};function g(){g.init.call(this)}Xi.exports=g;Xi.exports.once=_c;g.EventEmitter=g;g.prototype._events=void 0;g.prototype._eventsCount=0;g.prototype._maxListeners=void 0;var nh=10;function Rr(i){if(typeof i!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof i)}Object.defineProperty(g,"defaultMaxListeners",{enumerable:!0,get:function(){return nh},set:function(i){if(typeof i!="number"||i<0||sh(i))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+i+".");nh=i}});g.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};g.prototype.setMaxListeners=function(t){if(typeof t!="number"||t<0||sh(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 oh(i){return i._maxListeners===void 0?g.defaultMaxListeners:i._maxListeners}g.prototype.getMaxListeners=function(){return oh(this)};g.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")ih(h,this,e);else for(var u=h.length,c=lh(h,u),r=0;r<u;++r)ih(c[r],this,e);return!0};function hh(i,t,e,r){var s,n,o;if(Rr(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=oh(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,yc(l)}return i}g.prototype.addListener=function(t,e){return hh(this,t,e,!1)};g.prototype.on=g.prototype.addListener;g.prototype.prependListener=function(t,e){return hh(this,t,e,!0)};function bc(){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 ah(i,t,e){var r={fired:!1,wrapFn:void 0,target:i,type:t,listener:e},s=bc.bind(r);return s.listener=e,r.wrapFn=s,s}g.prototype.once=function(t,e){return Rr(e),this.on(t,ah(this,t,e)),this};g.prototype.prependOnceListener=function(t,e){return Rr(e),this.prependListener(t,ah(this,t,e)),this};g.prototype.removeListener=function(t,e){var r,s,n,o,l;if(Rr(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():vc(r,n),r.length===1&&(s[t]=r[0]),s.removeListener!==void 0&&this.emit("removeListener",t,l||e)}return this};g.prototype.off=g.prototype.removeListener;g.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 uh(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?xc(s):lh(s,s.length)}g.prototype.listeners=function(t){return uh(this,t,!0)};g.prototype.rawListeners=function(t){return uh(this,t,!1)};g.listenerCount=function(i,t){return typeof i.listenerCount=="function"?i.listenerCount(t):ch.call(i,t)};g.prototype.listenerCount=ch;function ch(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}g.prototype.eventNames=function(){return this._eventsCount>0?$r(this._events):[]};function lh(i,t){for(var e=new Array(t),r=0;r<t;++r)e[r]=i[r];return e}function vc(i,t){for(;t+1<i.length;t++)i[t]=i[t+1];i.pop()}function xc(i){for(var t=new Array(i.length),e=0;e<t.length;++e)t[e]=i[e].listener||i[e];return t}function _c(i,t){return new Promise(function(e,r){function s(){n!==void 0&&i.removeListener("error",n),e([].slice.call(arguments))}var n;t!=="error"&&(n=function(l){i.removeListener(t,s),r(l)},i.once("error",n)),i.once(t,s)})}});bs(exports);Ma(exports,{CUSTOM_TYPES:()=>_i,Comment:()=>nt,Component:()=>At,CustomEvent:()=>P,Document:()=>Z,DocumentFragment:()=>Kt,Easer:()=>Mr,Element:()=>p,ElementRoute:()=>$e,ElementRouteTo:()=>Br,Event:()=>C,EventHandler:()=>Cr,Fragment:()=>yt,HTMLButtonElement:()=>Qt,HTMLElement:()=>O,HTMLHtmlElement:()=>ur,HTMLInputElement:()=>Wt,HTMLLinkElement:()=>fr,HTMLOptionElement:()=>Jt,HTMLScriptElement:()=>cr,HTMLSelectElement:()=>Yt,HTMLStyleElement:()=>dr,HTMLTextAreaElement:()=>Xt,ImbaElement:()=>Ao,IntersectionEventDefaults:()=>Ne,KeyboardEvent:()=>Se,LazyProxy:()=>Be,Location:()=>Ut,Manifest:()=>Xe,MouseEvent:()=>Zt,Node:()=>w,PointerEvent:()=>xe,RenderContext:()=>q,Router:()=>Fe,SVGElement:()=>te,SVGSVGElement:()=>pr,Scheduler:()=>We,ShadowRoot:()=>vi,StyleDeclaration:()=>hr,Text:()=>wt,UIEvent:()=>ve,Window:()=>yi,_dirname_:()=>nn,_filename_:()=>oi,_run_:()=>on,asset:()=>un,autorun:()=>aa,clearInterval:()=>Zr,clearTimeout:()=>ti,colors:()=>Do,commit:()=>H,createAtom:()=>Wh,createComment:()=>ot,createComponent:()=>xi,createDynamic:()=>Jn,createElement:()=>Wn,createFragment:()=>Qn,createIndexedList:()=>xo,createKeyedList:()=>Oo,createLiveFragment:()=>po,createRenderContext:()=>er,createSVGElement:()=>Xn,createSlot:()=>ee,createTextNode:()=>we,customElements:()=>qn,defineTag:()=>Zn,deserializeData:()=>qe,document:()=>lr,emit:()=>A,events:()=>Tl,getDeepPropertyDescriptor:()=>fe,getRenderContext:()=>Sn,getSuperTagType:()=>Un,getTagType:()=>st,get_document:()=>Rt,hooks:()=>Ze,hotkeys:()=>rh,hydrate:()=>Ro,listen:()=>R,manifest:()=>x,mount:()=>Pi,observable:()=>ua,once:()=>k,parseTime:()=>Pt,patchManifest:()=>Ue,process:()=>Qe,proxy:()=>ze,render:()=>zo,renderContext:()=>E,renderer:()=>$t,reportChanged:()=>fa,reportObserved:()=>da,router:()=>Hh,run:()=>ca,scheduler:()=>N,serializeData:()=>vs,serve:()=>sn,servers:()=>xt,setInterval:()=>Jr,setTimeout:()=>Qr,styles:()=>ki,toCamelCase:()=>xs,transitions:()=>Me,unlisten:()=>bt,unmount:()=>Fi,use_dom_bind:()=>Uo,use_dom_teleport:()=>nl,use_dom_transitions:()=>dl,use_events:()=>Ll,use_events_hotkey:()=>eh,use_events_intersect:()=>Vl,use_events_keyboard:()=>Nr,use_events_mouse:()=>ne,use_events_pointer:()=>Ml,use_events_resize:()=>zl,use_events_selection:()=>Kl,use_events_touch:()=>$l,use_hooks:()=>cn,use_router:()=>Ah,use_slots:()=>fo,use_styles:()=>jo,use_window:()=>Bn,αaction:()=>_a,αautorun:()=>ya,αcomputed:()=>pa,αlazy:()=>fn,αobservable:()=>ma,αref:()=>ga});function je(i){let t;return i?(t=i.toIterable)?t.call(i):i:[]}var Dc=Symbol.for("#__initor__"),jc=Symbol.for("#__inited__"),Oa=Symbol.for("#type"),Ge=Symbol.for("#__listeners__"),Ca=/-./g,Be=class{static for(t){return new Proxy({},new this(t))}constructor(t){this.getter=t}get target(){return this.getter()}get(t,e){return this.target[e]}set(t,e,r){return this.target[e]=r,!0}};function ze(i,t={}){return new Proxy(t,new Be(i))}function Pt(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 vs(i){let t=new Map,e=[],r=!1,s=function(h,u){if(u&&u[Oa]&&h!==""){let c=t.get(u);return t.has(u)||(t.set(u,c="$$"+e.length+"$$"),e.push(u)),h==null?u:c}return u},n=JSON.stringify(i,s,2),o=0;for(r=!0;o<e.length;)e[o]=JSON.stringify(e[o],s,2),o++;let l="";for(let h=0,u=je(e),c=u.length;h<c;h++){let a=u[h];l+='"$$'+h+'$$":'+a+`,
`}return n="{"+l+n.slice(1),n}function qe(i,t=null){let e={},r=/\$\$\d+\$\$/,s=function(l){return e[l]||(e[l]=t?t(l):{})},n=function(l,h){if(typeof h=="string"){if(h[0]=="$"&&r.test(h))return s(h)}else if(typeof l=="string"&&l[0]=="$"&&r.test(l)){let u=s(l);return Object.assign(u,h),u}return h};return JSON.parse(i,n)}function Ue(i,t){var e,r,s,n;let o={},l={added:[],changed:[],removed:[],all:[],urls:{}};if(i.assets)for(let h=0,u=je(i.assets),c=u.length;h<c;h++){let a=u[h],d=a.originalPath||a.path;o[d]=a,a.url&&((e=t.urls)[r=a.url]||(e[r]=a))}for(let h=0,u=je(t.assets||[]),c=u.length;h<c;h++){let a=u[h],d=a.originalPath||a.path,m=o[d];a.url&&i.urls&&(i.urls[a.url]=a),m?(m.hash!=a.hash&&(m.invalidated=Date.now(),m.replacedBy=a,a.replaces=m,l.changed.push(a),l.all.push(a),m==i.main&&(l.main=a)),s=o[d],delete o[d]):(l.added.push(a),l.all.push(a))}for(let h=0,u=Object.keys(o),c=u.length,a,d;h<c;h++)a=u[h],d=o[a],d.removed=Date.now(),l.all.push(d);for(let h=0,u=je(l.all),c=u.length;h<c;h++){let a=u[h];(l[n=a.type]||(l[n]=[])).push(a)}return l.removed=Object.values(o),t.changes=l,t}function xs(i){return i.indexOf("-")>=0?i.replace(Ca,function(t){return t.charAt(1).toUpperCase()}):i}function fe(i,t,e){if(!i)return;let r=Object.getOwnPropertyDescriptor(i,t);return r||i==e?r||void 0:fe(Reflect.getPrototypeOf(i),t,e)}var Ss=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 R(i,t,e,r){var s;let n,o,l;return n=i[Ge]||(i[Ge]={}),o=n[t]||(n[t]={}),l=o.tail||(o.tail=o.next={}),l.listener=e,l.path=r,o.tail=l.next={},l}function k(i,t,e){let r=R(i,t,e);return r.times=1,r}function bt(i,t,e,r){let s,n,o=i[Ge];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 A(i,t,e){let r;(r=i[Ge])&&(r[t]&&Ss(t,e,r[t]),r.all&&Ss(t,[t,e],r.all))}function ka(i){let t;return i?(t=i.toIterable)?t.call(i):i:[]}var ws=Symbol.for("#__init__"),Bc=Symbol.for("#__initor__"),zc=Symbol.for("#__inited__"),Ts=Symbol.for("#schedule"),Xr=Symbol.for("#frames"),Ke=Symbol.for("#interval"),Dt=Symbol.for("#stage"),jt=Symbol.for("#scheduled"),Ye=Symbol.for("#version"),Pa=Symbol.for("#fps"),Ls=Symbol.for("#ticker"),Fa=globalThis.requestAnimationFrame||function(i){return globalThis.setTimeout(i,1e3/60)};var qc=1/60,Es=class{constructor(t=null){this[ws](t)}[ws](t=null){var e;this.owner=t&&(e=t.owner)!==void 0?e:null,this.target=t&&(e=t.target)!==void 0?e:null,this.active=t&&(e=t.active)!==void 0?e:!1,this.value=t&&(e=t.value)!==void 0?e:void 0,this.skip=t&&(e=t.skip)!==void 0?e:0,this.last=t&&(e=t.last)!==void 0?e:0}tick(t,e){return this.last=this.owner[Xr],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/(1e3/60)<=2?this.owner.on("raf",this):this[Ke]=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[Ke]&&(globalThis.clearInterval(this[Ke]),this[Ke]=null),this.active=!1,this}},We=class{constructor(){var t=this;this.id=Symbol(),this.queue=[],this.stage=-1,this[Dt]=-1,this[Xr]=0,this[jt]=!1,this[Ye]=0,this.listeners={},this.intervals={},t.commit=function(){return t.add("commit"),t},this[Pa]=0,t.$promise=null,t.$resolve=null,this[Ls]=function(e){return t[jt]=!1,t.tick(e)}}touch(){return this[Ye]++}get version(){return this[Ye]}add(t,e){return(e||this.queue.indexOf(t)==-1)&&this.queue.push(t),this[jt]||this[Ts](),this}get committingΦ(){return this.queue.indexOf("commit")>=0}get syncingΦ(){return this[Dt]==1}listen(t,e){let r=this.listeners[t],s=!r;return r||(r=this.listeners[t]=new Set),r.add(e),t=="raf"&&s&&this.add("raf"),this}unlisten(t,e){var r;let s=this.listeners[t];return s&&s.delete(e),t=="raf"&&s&&s.size==0&&(r=this.listeners.raf,delete this.listeners.raf),this}on(t,e){return this.listen(t,e)}un(t,e){return this.unlisten(t,e)}get promise(){var t=this;return t.$promise||(t.$promise=new Promise(function(e){return t.$resolve=e}))}tick(t){var e=this;let r=this.queue,s=this[Xr]++;if(this.ts||(this.ts=t),this.dt=t-this.ts,this.ts=t,this.queue=[],this[Dt]=1,this[Ye]++,r.length)for(let n=0,o=ka(r),l=o.length;n<l;n++){let h=o[n];typeof h=="string"&&this.listeners[h]?e.listeners[h].forEach(function(u){if(u.tick instanceof Function)return u.tick(e,h);if(u instanceof Function)return u(e,h)}):h instanceof Function?h(e.dt,e):h.tick&&h.tick(e.dt,e)}return this[Dt]=this[jt]?0:-1,e.$promise&&(e.$resolve(e),e.$promise=e.$resolve=null),e.listeners.raf&&e.add("raf"),e}[Ts](){return this[jt]||(this[jt]=!0,this[Dt]==-1&&(this[Dt]=0),Fa(this[Ls])),this}schedule(t,e){var r,s;return e||(e=t[r=this.id]||(t[r]={value:!0})),(e[s=this.id]||(e[s]=new Es({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}},N=new We;function H(){return N.add("commit").promise}function Qr(i,t){return globalThis.setTimeout(function(){i(),H()},t)}function Jr(i,t){return globalThis.setInterval(function(){i(),H()},t)}var Zr=globalThis.clearInterval,ti=globalThis.clearTimeout,de=globalThis.imba||(globalThis.imba={});de.commit=H;de.setTimeout=Qr;de.setInterval=Jr;de.clearInterval=Zr;de.clearTimeout=ti;var Ms=$(require("events")),ft=$(require("fs")),et=$(require("path"));var Ns=Symbol.for("#__initor__"),Os=Symbol.for("#__inited__"),$a=Symbol.for("#refresh"),Cs=Symbol.for("#__init__"),ei=Symbol.for("#manifest"),ks=Symbol.for("#absPath"),ri=Symbol.for("#raw"),Ps=Symbol.for("#watch"),Fs=Symbol(),$s=class{constructor(t){this[ei]=t}get absPath(){return this[ks]||(this[ks]=this[ei].resolve(this))}get name(){return et.default.basename(this.path)}get body(){return this.readSync()}readSync(){return ft.default.readFileSync(this.absPath,"utf-8")}pipe(t){return ft.default.createReadStream(this.absPath).pipe(t)}toString(){return this.url||this.absPath}},Xe=class extends Ms.EventEmitter{static[Cs](){return this.prototype[Ns]=Fs,this}constructor(t={}){var e;super();e=this,this.options=t,this.data={},this.path=t.path,this.refs={},e.reviver=function(r){return new $s(e)},e.init(t.data),this[Ns]===Fs&&this[Os]&&this[Os]()}get srcdir(){return et.default.resolve(et.default.dirname(this.path),this.data.srcdir)}get outdir(){return et.default.resolve(et.default.dirname(this.path),this.data.outdir)}get changes(){return this.data.changes||{}}get inputs(){return this.data.inputs}get outputs(){return this.data.outputs}get assets(){return this.data.assets}get urls(){return this.data.urls||{}}get main(){return this.data.main}get cwd(){return process.cwd()}get raw(){return this.data[ri]}resolve(t){return t._=="input"?et.default.resolve(this.srcdir||this.cwd,t.path):t._=="output"?et.default.resolve(this.outdir,t.path):et.default.resolve(this.cwd,t.path||t)}resolveAssetPath(t){return et.default.resolve(this.outdir,t)}read(t){return ft.default.readFileSync(this.resolve(t),"utf-8")}loadFromFile(t){return ft.default.existsSync(t)?ft.default.readFileSync(t,"utf-8"):"{}"}init(t=null){return(t||this.path)&&this.update(t),this}update(t){if(t==null&&(this.path?t=this.loadFromFile(this.path):console.warn("cannot update manifest without path")),typeof t=="string"){let e=t;t=qe(t,this.reviver),t[ri]=e}return this.data=Ue(this.data||{},t),this.data.changes.all.length&&this.emit("change",this.diff,this),this.data.changes.main&&this.emit("change:main",this.data.main,this),this.data.changes}serializeForBrowser(){return this.data[ri]}[$a](t){return!0}watch(){var t=this;if(this[Ps]!=!0?(this[Ps]=!0,!0):!1)return t.path&&!process.env.IMBA_HMR&&ft.default.watch(this.path,function(e,r){let s=ft.default.existsSync(t.path),n=s&&ft.default.statSync(t.path);s&&t.update()})}on(t,e){return this.watch(),super.on(...arguments)}};Xe[Cs]();var Rs=class{static for(t){return new Proxy({},new this(t))}constructor(t){this.getter=t}get target(){return this.getter()}get(t,e){return this.target[e]}set(t,e,r){return this.target[e]=r,!0}},x=Rs.for(function(){return globalThis[ei]});var si=$(require("cluster")),vt=$(require("fs")),Ft=$(require("path")),Bs=$(require("events"));var ii=$(require("perf_hooks")),Gt=Symbol.for("#spinner"),Xc=Symbol.for("#__initor__"),Qc=Symbol.for("#__inited__"),Ra=Symbol.for("#ctime"),As=Symbol.for("#IMBA_OPTIONS"),Aa={reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29],black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],gray:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},Q={bold:function(i){return"[1m"+i+"[22m"},red:function(i){return"[31m"+i+"[39m"},green:function(i){return"[32m"+i+"[39m"},yellow:function(i){return"[33m"+i+"[39m"},blue:function(i){return"[94m"+i+"[39m"},gray:function(i){return"[90m"+i+"[39m"},white:function(i){return"[37m"+i+"[39m"},f:function(i,t){let e=Aa[i];return"["+e[0]+"m"+t+"["+e[1]+"m"}};Q.warn=Q.yellow;Q.error=Q.red;var pe=process.platform!=="win32"||process.env.CI||process.env.TERM==="xterm-256color",Ha={info:Q.f("yellowBright",pe?"ℹ":"i"),success:Q.green(pe?"✔":"√"),warning:Q.yellow(pe?"⚠":"!!"),error:Q.red(pe?"×":"✖"),debug:Q.blue(pe?"ℹ":"i")},Hs=["debug","info","success","warning","error","silent"],Ia={"-1":"socket","4":"ip4","6":"ip6"};function Va(i){let t=Q.f;return i=i.replace(/https?\:[^\s\n\)\]]+/g,function(e){return t("blueBright",e)}),i=i.replace(/^[\t\s]*\>[^\n]+/gm,function(e){return t("bold",e)}),i=i.replace(/\t/g," "),i=i.replace(/^/gm," "),i}function Is(i,...t){let e=Q.f;return i=i.replace(/\%([\w\.]+)/g,function(r,s){let n=t.shift();if(s=="markdown")return Va(n);if(s=="kb")return e("dim",(n/1e3).toFixed(1)+"kb");if(s=="path"||s=="bold")return e("bold",n);if(s=="dim")return e("dim",n);if(s=="address"){let o=Ia[n.addressType];return n.port?e("blueBright",[n.address||"http://127.0.0.1",n.port].join(":")):e("blueBright",o)}else{if(s=="ms")return e("yellow",Math.round(n)+"ms");if(s=="d")return e("blueBright",n);if(s=="red")return e("redBright",n);if(s=="green")return e("greenBright",n);if(s=="yellow")return e("yellowBright",n);if(s=="ref")return e("yellowBright","#"+(n.id||n));if(s=="elapsed"){n!=null&&t.unshift(n);let o=ii.performance.now();return e("yellow",Math.round(o)+"ms")}else if(s=="heap"){n!=null&&t.unshift(n);let o=process.memoryUsage().heapUsed/1024/1024;return e("yellow",o.toFixed(2)+"mb")}else return n}}),[i,...t]}var Vs=null,Ds=null,js=class{static get main(){return Ds||(Ds=new this)}constructor({prefix:t=null,loglevel:e}={}){this[Ra]=Date.now(),this.prefix=t?Is(...t)[0]:"",this.loglevel=e||process.env.IMBA_LOGLEVEL||globalThis[As]&&globalThis[As].loglevel||"info"}write(t,...e){if(Hs.indexOf(t)<Hs.indexOf(this.loglevel))return this;let r=Ha[t]||t,[s,...n]=Is(...e);return this.prefix&&(s=this.prefix+s),this[Gt]&&this[Gt].isSpinning?(t=="success"&&(this[Gt].clear(),console.log(r+" "+s,...n),this[Gt].frame()),this[Gt].text=s):console.log(r+" "+s,...n)}debug(...t){return this.write("debug",...t)}log(...t){return this.write("info",...t)}info(...t){return this.write("info",...t)}warn(...t){return this.write("warn",...t)}error(...t){return this.write("error",...t)}success(...t){return this.write("success",...t)}ts(...t){return this.write("debug",...t,ii.performance.now())}spinner(){}get[Gt](){return Vs}get proxy(){var t=this;let e=function(...r){return t.info(...r)};return e.info=t.info.bind(t),e.warn=t.warn.bind(t),e.error=t.error.bind(t),e.debug=t.debug.bind(t),e.success=t.success.bind(t),e.ts=t.ts.bind(t),e.logger=t,e}async time(t,e){let r=Date.now();if(e){let s=await e();return this.info(""+t+" %ms",Date.now()-r),s}}},Gs=new js().proxy;var zs=$(require("module")),qs=$(require("http")),ef=$(require("https")),Us=$(require("http2"));function B(i){let t;return i?(t=i.toIterable)?t.call(i):i:[]}var Ks=Symbol.for("#setup"),Ys=Symbol.for("#__initor__"),Ws=Symbol.for("#__inited__"),Xs=Symbol.for("#__init__"),Qs=Symbol.for("#setup?"),Js=Symbol.for("#watch"),Da=Symbol.for("#dom"),ja=Symbol.for("#server"),Ga=Symbol.for("#raw"),Zs=Symbol(),ni={html:{"Content-Type":"text/html"},js:{"Content-Type":"text/javascript"},mjs:{"Content-Type":"text/javascript"},json:{"Content-Type":"application/json"},css:{"Content-Type":"text/css"},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"},bmp:{"Content-Type":"image/bmp"},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"},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"}},z=globalThis.process,tn=class extends Set{call(t,...e){var r;r=[];for(let s of B(this))r.push(s[t](...e));return r}close(t={}){var e;e=[];for(let r of B(this))e.push(r.close(t));return e}reload(t={}){var e;e=[];for(let r of B(this))e.push(r.reload(t));return e}broadcast(t,...e){var r;r=[];for(let s of B(this))r.push(s.broadcast(t,...e));return r}emit(t,e){var r;r=[];for(let s of B(this))r.push(s.emit(t,e));return r}},xt=new tn,Qe=new(class extends Bs.EventEmitter{static[Xs](){return this.prototype[Ys]=Zs,this}constructor(){var t;super(...arguments);t=this,this.autoreload=!1,this.state={},si.default.isWorker&&z.on("message",function(e){if(t.emit("message",e),e[0]=="emit")return t.emit(...e.slice(1))}),this[Ys]===Zs&&this[Ws]&&this[Ws]()}[Ks](){var t=this;if(!!(this[Qs]!=!0?(this[Qs]=!0,!0):!1))return t.on("reloading",function(e){var r;console.log("is reloading - from outside"),t.state.reloading=!0,r=[];for(let s of B(xt))r.push(s.pause());return r}),t.on("reloaded",async function(e){var r;t.state.reloaded=!0,console.log("is reloaded - from outside"),r=[];for(let n of B(xt))r.push(n.close());let s=r;return setTimeout(function(){return z.exit(0)},100),await Promise.all(s),z.exit(0)}),t.on("manifest:change",function(e){if(z.env.IMBA_HMR)return x.update(e)}),t.on("manifest:error",function(e){if(z.env.IMBA_HMR)return x.errors=e,xt.broadcast("errors",x.errors)}),!0}send(t){if(z.send instanceof Function)return z.send(t)}on(t,e){return t=="change"&&this.watch(),super.on(...arguments)}watch(){var t=this;if(this[Js]!=!0?(this[Js]=!0,!0):!1)return x.on("change:main",function(){return t.emit("change",x)})}reload(){if(!(this.isReloading!=!0?(this.isReloading=!0,!0):!1))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")}}[Xs]()),en=class{constructor(t,e={}){this.url=t,[this.path,this.query]=t.split("?"),this.ext=Ft.default.extname(this.path),this.headers={"Content-Type":"text/plain","Access-Control-Allow-Origin":"*","cache-control":"public"},Object.assign(this.headers,ni[this.ext.slice(1)]||{})}respond(t,e){let r=x.urls[this.url],s=this.headers,n=r?x.resolve(r):x.resolveAssetPath("public"+this.path);if(!n)return console.log("found no path for",r,this.url),e.writeHead(404,{}),e.end();if(r&&(r.ttl>0&&(s["cache-control"]="max-age="+r.ttl),r.imports)){let o=[];for(let l=0,h=B(r.imports),u=h.length;l<u;l++){let c=h[l];o.push("<"+c.url+">; rel=modulepreload; as=script")}s.Link=o.join(", ")}return vt.default.access(n,vt.default.constants.R_OK,function(o){if(o)return console.log("could not find path",n),e.writeHead(404,{}),e.end();try{let l=vt.default.createReadStream(n);return e.writeHead(200,s),l.pipe(e)}catch(l){return e.writeHead(503,{}),e.end()}})}createReadStream(){return vt.default.createReadStream(this.path)}pipe(t){return this.createReadStream().pipe(t)}},rn=class{static wrap(t,e={}){return new this(t,e)}constructor(t,e){var r=this;xt.add(this),this.id=Math.random(),this.options=e,this.closed=!1,this.paused=!1,this.server=t,this.clients=new Set,this.stalledResponses=[],this.assetResponders={},z.env.IMBA_PATH&&(this.devtoolsPath=Ft.default.resolve(z.env.IMBA_PATH,"dist","hmr.js")),this.scheme=t instanceof qs.default.Server?"http":"https";let s=this.server._events.request,n=globalThis[Da];t.off("request",s),s[ja]=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+"/";return Gs.info("listening on %bold",h)}),x.on("change",function(o,l){return r.broadcast("manifest",l.data[Ga])}),r.handler=function(o,l){var h;let u=o instanceof Us.Http2ServerRequest,c=o.url,a="/__assets__/";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(c=="/__hmr__.js"&&r.devtoolsPath){let f=vt.default.createReadStream(r.devtoolsPath);return l.writeHead(200,ni.js),f.pipe(l)}if(c=="/__hmr__"){let f={"Content-Type":"text/event-stream","Cache-Control":"no-cache"};return u||(f.Connection="keep-alive"),l.writeHead(200,f),r.clients.add(l),r.broadcast("init",x.serializeForBrowser(),[l]),o.on("close",function(){return r.clients.delete(l)}),!0}if(c.indexOf(a)==0||x.urls[c])return((h=r.assetResponders)[c]||(h[c]=new en(c,r))).respond(o,l);let d=o.headers,m;if(u?m=d[":scheme"]+"://"+d[":authority"]:m=(o.connection.encrypted?"https":"http")+"://"+d.host,e.static){let f=new URL(c,m),y=Ft.default.extname(f.pathname),_=ni[y.slice(1)];if(_){let M=Ft.default.resolve(x.cwd,"."+f.pathname);if(vt.default.existsSync(M)){vt.default.readFile(M,function(X,v){return X?(l.writeHead(500,{}),l.write("Error getting the file: "+X)):(l.writeHead(200,_),l.end(v))});return}}}if(n){let f=new n.Location(o.url,m);return n.Document.create({location:f},function(){return s(o,l)})}else return s(o,l)},t.on("request",r.handler),t.on("close",function(){return console.log("server is closing!!!")}),si.default.isWorker&&(Qe[Ks](),Qe.send("serve"))}broadcast(t,e={},r=this.clients){e=JSON.stringify(e);let s="data: "+e+`
`;for(let n of B(r))n.write("event: "+t+`
`),n.write(`id: imba
`),n.write(s);return this}pause(){return(this.paused!=!0?(this.paused=!0,!0):!1)&&this.broadcast("paused"),this}resume(){if(this.paused!=!1?(this.paused=!1,!0):!1)return this.broadcast("resumed"),this.flushStalledResponses()}flushStalledResponses(){for(let t=0,e=B(this.stalledResponses),r=e.length;t<r;t++)e[t].end();return this.stalledResponses=[]}close(){var t=this;return this.pause(),new Promise(function(e){return t.closed=!0,t.server.close(e),t.flushStalledResponses()})}};function sn(i,...t){return rn.wrap(i,...t)}function oi(i){return Ft.default.resolve(z.cwd(),i)}function nn(i){return Ft.default.dirname(oi(i))}function on(i,t){try{let e=x.srcdir,r=e+"/server.imba",s=require.resolve.paths(e+"/server.imba");return require.main.paths.unshift(...zs.Module._nodeModulePaths(x.srcdir))}catch(e){}}var lf=Symbol.for("#__initor__"),hf=Symbol.for("#__inited__"),ln=Symbol.for("#__init__"),hn=Symbol.for("#warned"),Bt=Symbol.for("#asset"),Je=class{static wrap(t){let e=new Je(t);return new Proxy(e,e)}constructor(t){this.meta=t}get input(){return x.inputs[this.meta.input]}get asset(){return globalThis._MF_?this.meta:this.input?this.input.asset:null}set(t,e,r){return!0}get(t,e){return this.meta.meta&&this.meta.meta[e]!=null?this.meta.meta[e]:this.asset?e=="absPath"&&!this.asset.absPath?this.asset.url:this.asset[e]:((this.meta[hn]!=!0?(this.meta[hn]=!0,!0):!1)&&console.warn("Asset for '"+this.meta.input+"' not found"),e=="valueOf"?function(){return""}:null)}},an=class{constructor(t=null){this[ln](t)}[ln](t=null){this.url=t?t.url:void 0,this.meta=t?t.meta:void 0}adoptNode(t){var e;if((e=this.meta)==null?void 0:e.content){for(let r=this.meta.attributes,s=0,n=Object.keys(r),o=n.length,l,h;s<o;s++)l=n[s],h=r[l],t.setAttribute(l,h);t.innerHTML=this.meta.content}return this}toString(){return this.url}toStyleString(){return"url("+this.url+")"}};function un(i){var t,e;if(i[Bt])return i[Bt];if(i.type=="svg")return i[Bt]||(i[Bt]=new an(i));if(i.input){let r=globalThis._MF_&&globalThis._MF_[i.input];return r&&(Object.assign(i,r),i.toString=function(){return this.absPath}),i[Bt]||(i[Bt]=Je.wrap(i))}return i}var Ze={on:function(i,t){return R(this,i,t)},inited:function(i){return A(this,"inited",[i])}};function cn(){return!0}function fn(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 Ba(i){let t;return i?(t=i.toIterable)?t.call(i):i:[]}var J={"":[-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}]},L={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},li=Object.keys(J);for(let i=0,t=Ba(li),e=t.length;i<e;i++){let r=t[i],s=J[r];s.name=r+"Element",s.up=J[li[s[0]]]}for(let i=0,t=Object.keys(L),e=t.length,r,s;i<e;i++)r=t[i],s=L[r],L[r]=J[li[s]],r.indexOf("svg_")==0&&(L[r.replace("_",":")]=L[r]);var hi=$(require("async_hooks"));var dn=Symbol.for("#toStringDeopt"),mf=Symbol.for("#__initor__"),gf=Symbol.for("#__inited__"),pn=Symbol.for("#symbols"),mn=Symbol.for("#batches"),gn=Symbol.for("#extras"),yn=Symbol.for("#stacks"),zt=class{constructor(t){this.dom=t,this.string=""}contains(t){return this.dom.classList.contains(t)}add(t){return this.contains(t)?this:(this.string+=(this.string?" ":"")+t,this.dom.classList.add(t),this)}remove(t){if(!this.contains(t))return this;let e=new RegExp("(^|\\s)"+t+"(?=\\s|$)","g");return this.string=this.string.replace(e,""),this.dom.classList.remove(t),this}toggle(t,e){return e===void 0&&(e=!this.contains(t)),e?this.add(t):this.remove(t)}incr(t,e=0){var r=this;let s=this.stacks,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){let r=this[pn],s=this[mn],n=!0;if(!r)r=this[pn]=[t],s=this[mn]=[e||""],this.toString=this.valueOf=this[dn];else{let o=r.indexOf(t),l=e||"";o==-1?(r.push(t),s.push(l)):s[o]!=l?s[o]=l:n=!1}n&&(this[gn]=" "+s.join(" "),this.sync())}valueOf(){return this.string}toString(){return this.string}[dn](){return this.string+(this[gn]||"")}sync(){return this.dom.flagSync$()}get stacks(){return this[yn]||(this[yn]={})}};var tr=Symbol.for("#__init__"),_n=Symbol.for("#__initor__"),bn=Symbol.for("#__inited__"),ai=Symbol.for("#getRenderContext"),za=Symbol.for("#getDynamicContext"),vn=Symbol(),E={context:null},xn=class{constructor(t=null){this[tr](t)}[tr](t=null){var e;this.stack=t&&(e=t.stack)!==void 0?e:[]}push(t){return this.stack.push(t)}pop(t){return this.stack.pop()}},$t=new xn,q=class extends Map{static[tr](){return this.prototype[_n]=vn,this}constructor(t,e=null){super();this._=t,this.sym=e,this[_n]===vn&&this[bn]&&this[bn]()}pop(){return E.context=null}[ai](t){let e=this.get(t);return e||this.set(t,e=new q(this._,t)),E.context=e}[za](t,e){return this[ai](t)[ai](e)}run(t){return this.value=t,E.context==this&&(E.context=null),this.get(t)}cache(t){return this.set(this.value,t),t}};q[tr]();function er(i,t=Symbol(),e=i){return E.context=i[t]||(i[t]=new q(e,t))}function Sn(){let i=E.context,t=i||new q(null);return globalThis.DEBUG_IMBA&&!i&&$t.stack.length>0&&console.warn("detected unmemoized nodes in",$t.stack,"see https://imba.io",t),i&&(E.context=null),t}function ui(i){let t;return i?(t=i.toIterable)?t.call(i):i:[]}var rt=Symbol.for("#__initor__"),it=Symbol.for("#__inited__"),U=Symbol.for("#__init__"),ci=Symbol.for("#parent"),wn=Symbol.for("#context"),Tn=Symbol.for("#closestNode"),qa=Symbol.for("#parentNode"),Ua=Symbol.for("##inited"),fi=Symbol.for("#getRenderContext"),Ka=Symbol.for("#getDynamicContext"),di=Symbol.for("#replaceChild"),me=Symbol.for("#appendChild"),Ln=Symbol.for("#removeChild"),St=Symbol.for("#insertInto"),En=Symbol.for("#insertChild"),ge=Symbol.for("#removeFrom"),Mn=Symbol.for("#removeFromDeopt"),qt=Symbol.for("#replaceWith"),Nn=Symbol.for("#replaceWithDeopt"),pi=Symbol.for("#placeholderNode"),Ya=Symbol.for("#attachToParent"),Wa=Symbol.for("#detachFromParent"),Xa=Symbol.for("#placeChild"),Qa=Symbol.for("#beforeReconcile"),Ja=Symbol.for("#afterReconcile"),Za=Symbol.for("#afterVisit"),On=Symbol.for("#document"),rr=Symbol.for("#htmlNodeName"),Cn=Symbol.for("#ImbaElement"),kn=Symbol.for("#flags"),ir=Symbol.for("#scripts"),mi=Symbol.for("#location"),Pn=Symbol.for("##document"),Fn=Symbol.for("##parent"),tu=Symbol.for("##up"),$n=Symbol.for("##context"),ye=Symbol.for("#domNode"),sr=Symbol.for("##placeholderNode"),Rn=Symbol.for("#domDeopt"),eu=Symbol.for("#insertIntoDeopt"),An=Symbol.for("##classList"),nr=Symbol.for("##style"),Hn=Symbol.for("##dataset"),dt=Symbol.for("#asset"),gi=Symbol.for("#innerHTML"),ru=Symbol.for("#isRichElement"),_e=Symbol.for("#src"),iu=Symbol.for("#getSlot"),su=Symbol.for("#cssns"),nu=Symbol.for("#cssid"),ou=Symbol.for("#dom"),In=Symbol(),Vn=Symbol(),Dn=Symbol(),jn=Symbol(),Gn=Symbol(),pt=null,Ut=class extends URL{},yi=class{get document(){return this[On]||(this[On]=new this.Document(this))}get location(){return this.document.location}};function Bn(){return!0}var lu={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},mt=null,hu={},zn=class{define(){return this}get(){return this}upgrade(){}whenDefined(){}},qn=new zn,_i={};function st(i,t){let e=i;if(typeof i=="string"&&(i=J[i]||L[i]||J[i+"Element"]||L["svg_"+i]),i instanceof w)return i;if(!i)return st("HTML");if(i&&!i.klass){class r extends st(i.up){}i.klass=r}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 c=u==1?h:u;r[c]||c=="style"||Object.defineProperty(i.klass.prototype,h,{set:function(a){this.setAttribute(c,a)},get:function(){return this.getAttribute(c)}})}}return i.klass}function Un(i,t,e){let r=st(i,t);if(!(r==e||r.prototype instanceof e||r.prototype[rr])){let n=r.prototype[Cn];if(!n){n=class extends r{static[U](){return this.prototype[rt]=In,this}constructor(){super(...arguments);this.__slots={},this.__F=0,this[rt]===In&&this[it]&&this[it]()}}[U](),r.prototype[Cn]=n;let o=Object.getOwnPropertyDescriptors(e.prototype);Object.defineProperties(n.prototype,o),n.prototype[rr]=i}return n}return r}var or=function(i){let t=typeof i=="string"?i:String(i);return t.indexOf('"')>=0&&(t=t.replace(/\"/g,""")),t},bi=function(i,t){let e=typeof i=="string"?i:String(i);return t=="script"||(e.indexOf('"')>=0&&(e=e.replace(/\"/g,""")),e.indexOf("<")>=0&&(e=e.replace(/\</g,"<")),e.indexOf(">")>=0&&(e=e.replace(/\>/g,">"))),e},Z=class{static create(t,e){let r=new Z;return r[wn]=t,r.location=t.location,pt||(pt=new hi.AsyncLocalStorage),pt.run(r,e),r}constructor(){}get flags(){return this[kn]||(this[kn]=new zt({classList:new be(this)}))}get scripts(){return this[ir]||(this[ir]=[])}set location(t){typeof t=="string"&&(t=new Ut(t)),this[mi]=t}get location(){return this[mi]||(this[mi]=new Ut("http://localhost/"))}createElement(t){let e=st(t),r=new e(t);return r.nodeName=t,r}createElementNS(t,e){if(t=="http://www.w3.org/2000/svg"){let r=st("svg_"+e),s=new r;return s.nodeName=e,s}return this.createElement(e)}createTextNode(t){return new wt(t)}createComment(t){return new nt(t)}createDocumentFragment(){return new Kt}getElementById(t){return null}},Tt=new Z,lr=Tt;function Rt(){var i;return pt&&((i=pt==null?void 0:pt.getStore)==null?void 0:i.call(pt))||Tt}var be=class{constructor(t,e){this.classes=e||[],this.dom=t}add(t){return this.classes.indexOf(t)<0&&this.classes.push(t),this}remove(t){let e=this.classes.indexOf(t);return e>=0&&(this.classes[e]=""),this}toggle(t){return this.contains(t)?this.remove(t):this.add(t),this}contains(t){return this.classes.indexOf(t)>=0}clone(t){return new be(t,this.classes.slice(0))}toString(){return this.classes.join(" ").trim()}},hr=class{constructor(){}removeProperty(t){var e;return e=this[t],delete this[t],e}setProperty(t,e){return this[t]=e}toString(){let t=[];for(let e=this,r=0,s=Object.keys(e),n=s.length,o,l;r<n;r++)o=s[r],l=e[o],l instanceof Function||t.push(""+o+": "+l);return t.join(";")}},ar=class{static wrap(t){return new Proxy(t.attributes,new ar)}set(t,e,r){return t["data-"+e]=r,!0}get(t,e){return t["data-"+e]}},au={get(i,t){let e=i,r;for(;e&&r==null;)(e=e[ci])&&(r=e[t]);return r}},w=class{toString(){return this.outerHTML}get outerHTML(){return""}text$(t){return this.textContent=t,this}get ownerDocument(){return this[Pn]||(this[Pn]=Rt())}get[ci](){return this[Fn]||this.parentNode||this[tu]}get[wn](){return this[$n]||(this[$n]=new Proxy(this,au))}get[Tn](){return this}get[qa](){return this[ci][Tn]}[U](){return this}[Ua](){return this}[fi](t){return er(this,t)}[Ka](t,e){return this[fi](t)[fi](e)}[di](t,e){let r=this[En](t,e);return this[Ln](e),r}[me](t){return t[St](this,null)}[Ln](t){return t[ge](this)}[St](t,e){return e?t.insertBefore(this,e):t.appendChild(this),this}[En](t,e){return t[St](this,e)}[ge](t){return t.removeChild(this)}[Mn](t){return t.removeChild(this[ye]||this)}[qt](t,e){return e[di](t,this)}[Nn](t,e){return e[di](t,this[ye]||this)}get[pi](){return this[sr]||(this[sr]=globalThis.document.createComment("placeholder"))}set[pi](t){let e=this[sr];this[sr]=t,e&&e!=t&&e.parentNode&&e[qt](t)}[Ya](){let t=this[ye],e=t&&t.parentNode;return t&&e&&t!=this&&(this[ye]=null,this[St](e,t),t[ge](e)),this}[Wa](){(this[Rn]!=!0?(this[Rn]=!0,!0):!1)&&(this[qt]=this[Nn],this[ge]=this[Mn],this[St]=this[eu]);let t=this[pi];return this.parentNode&&t!=this&&(t[St](this.parentNode,this),this[ge](this.parentNode)),this[ye]=t,this}[Xa](t,e,r){let s=typeof t;if(s==="undefined"||t===null){if(r&&r instanceof nt)return r;let n=new nt("");return r?r[qt](n,this):n[St](this,null)}if(t===r)return t;if(s!=="object"){let n,o=t;return e&128&&e&256,r?r instanceof wt?(r.textContent=o,r):(n=lr.createTextNode(o),r[qt](n,this),n):(this.appendChild(n=lr.createTextNode(o)),n)}else return r?r[qt](t,this):t[St](this,null)}},w