dothtml 6.0.2 → 6.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.global.js +1 -1
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.global.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var dot=(()=>{var xe=Object.defineProperty;var dt=Object.getOwnPropertyDescriptor;var ht=Object.getOwnPropertyNames;var ct=Object.prototype.hasOwnProperty;var a=(n,e)=>xe(n,"name",{value:e,configurable:!0});var ut=(n,e)=>{for(var t in e)xe(n,t,{get:e[t],enumerable:!0})},ft=(n,e,t,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of ht(e))!ct.call(n,i)&&i!==t&&xe(n,i,{get:()=>e[i],enumerable:!(s=dt(e,i))||s.enumerable});return n};var pt=n=>ft(xe({},"__esModule",{value:!0}),n);var It={};ut(It,{DotComponent:()=>He,Link:()=>Me,Priority:()=>_,Router:()=>pe,currentHash:()=>Y,currentPath:()=>N,currentSearch:()=>fe,dot:()=>y,generatePath:()=>Le,getGlobalRoutes:()=>Be,initScrollManager:()=>We,matchRoute:()=>ot,navigate:()=>G,previousPath:()=>Q,setGlobalRoutes:()=>rt,useHash:()=>$e,useQueryParams:()=>De});var O="_dotVDom",X=typeof process<"u"?process.env.NODE_ENV!=="production":(()=>{try{return new Function("return import.meta.env?.DEV")()}catch{return!1}})()??!1;var u=class{static{a(this,"Binding")}_source;_transform;get isWritable(){return this._source.isWritable&&(!this._transform||!!this._transform.read)}get value(){return this._get()}_get(){return this._transform?.display?this._transform.display(this._source.value):this._source.value}_set(e){let t=this._transform?.read?this._transform.read(e):e;this._source.value=t}_subscribe(e,t=!1){return this._source._subscribe(this,e,t)}subscribe(e,t=!1){return this._subscribe(e,t)}_unsubscribe(e){this._source.unsubscribe(e)}unsubscribe(e){this._source.unsubscribe(e)}constructor(e){this._source=e}};var H=class{static{a(this,"VMetaNode")}};function ae(n,e){if(n.parentNode!==e.parentNode)throw new Error("Start and end nodes must have the same parent.");let t=n.nextSibling;for(;t&&t!==e;){let s=t.nextSibling;t[O]?t[O]._unrender():t.parentNode?.removeChild(t),t=s}}a(ae,"removeNodesBetween");function Ee(n,e,t=new Map){if(n===e)return!0;if(n==null||e==null||typeof n!="object"||typeof e!="object")return!1;if(t.has(n))return t.get(n)===e;if(t.set(n,e),Array.isArray(n)&&Array.isArray(e)&&n.length!==e.length)return!1;for(let s in n)if(!e.hasOwnProperty(s)||!Ee(n[s],e[s],t))return!1;for(let s in e)if(!n.hasOwnProperty(s))return!1;return!0}a(Ee,"deepEqual");var me=new RegExp("[-+]?[0-9]*\\.?[0-9]+(?:[eE][-+]?[0-9]+)?","g");var f=class{static{a(this,"Vdom")}_dot;_onEnterHook;_onLeaveHook;constructor(e){this._dot=e}async _unrenderAsync(){let t=this._getNodes().find(s=>s instanceof HTMLElement);this._onLeaveHook&&t&&await this._onLeaveHook(t),this._unrender()}_moveBefore(e,t){let s=this._getNodes();if(s.length===0)return;let i=e?.parentElement||t;if(!i)throw new Error("Internal Error: Cannot move nodes without a parent.");for(let o=0;o<s.length;o++)if(s[o]===e)return;let r=(e?.ownerDocument||i.ownerDocument||document).createDocumentFragment();for(let o=0;o<s.length;o++)r.appendChild(s[o]);i.insertBefore(r,e)}__isRendered=!1;get _isRendered(){return this.__isRendered}set _isRendered(e){if(e&&this.__isRendered)throw new Error("Internal Error: Node is already rendered.");if(!e&&!this.__isRendered)throw new Error("Internal Error: Node is not rendered.");this.__isRendered=e}toString(){let e=document.createElement("div");return this._render(e),e.innerHTML}_renderBefore(e){let t=e.ownerDocument.createElement("div");for(this._render(t);t.childNodes.length>0;){let s=t.childNodes[0];s.parentElement.removeChild(s),e.parentElement.insertBefore(s,e)}}_renderAfter(e){if(e.nextSibling)this._renderBefore(e.nextSibling);else{let t=e.ownerDocument.createTextNode("");e.parentElement.appendChild(t),this._renderBefore(t),t.parentElement.removeChild(t)}}_moveTo(e){let t=this._getNodes();for(let s=0;s<t.length;s++)e.appendChild(t[s])}text(e){return null}html(e){return null}md(e){return null}mount(e,t){return null}when(e,t){return null}each(e,t){return null}otherwiseWhen(e,t,s){return null}otherwise(e){return null}attr(e,t){return null}style(e){return null}on(e,t){return null}onEnter(e){return null}onLeave(e){return null}empty(){return null}remove(){}};var k=class extends f{static{a(this,"TextVdom")}_text;textNode=null;observerId=0;constructor(e){super(),this._text=e}_render(e){this._text instanceof u?(this.textNode=e.ownerDocument.createTextNode(this._text._get()??""),this.observerId=this._text._subscribe(this)):this.textNode=e.ownerDocument.createTextNode(`${this._text??""}`),e.appendChild(this.textNode)}_unrender(){this.textNode&&(this.textNode.parentElement&&this.textNode.parentElement.removeChild(this.textNode),this.textNode=null),this.observerId&&this._text instanceof u&&(this._text._unsubscribe(this.observerId),this.observerId=0)}_getNodes(){return this.textNode?[this.textNode]:[]}_getLastChild(){return this}toString(){let e=document.createTextNode((this._text instanceof u?this._text._get():this._text)??""),t=document.createElement("div");return t.appendChild(e),t.innerHTML}};var R=class extends f{static{a(this,"FragmentVdom")}_children=[];constructor(e){super(e)}_render(e){this._isRendered=!0;for(let t=0;t<this._children.length;t++)this._children[t]._render(e)}_unrender(){if(this._isRendered){this._isRendered=!1;for(let e=0;e<this._children.length;e++)this._children[e]._unrender()}}_getNodes(){let e=[];for(let t=0;t<this._children.length;t++)e.push(...this._children[t]._getNodes());return e}_getLastChild(){return this._children[this._children.length-1]||null}};var _=(function(n){return n[n.Immediate=0]="Immediate",n[n.UserBlocking=1]="UserBlocking",n[n.Normal=2]="Normal",n[n.Background=3]="Background",n})({});var mt=class{static{a(this,"Scheduler")}queues=[new Set,new Set,new Set,new Set];isPending=!1;startTime=0;frameYieldMs=5;isSync=!1;isSyncing=!1;onError;channel=typeof MessageChannel<"u"?new MessageChannel:null;constructor(){this.channel&&(this.channel.port1.onmessage=()=>this.workLoop())}enqueue(e,t=_.Normal){e.isQueued||(e.isQueued=!0,this.queues[t].add(e)),t===_.Immediate||this.isSync?this.flushSync():this.scheduleFlush()}scheduleFlush(){this.isPending||(this.isPending=!0,this.channel?this.channel.port2.postMessage(null):setTimeout(()=>this.workLoop(),0))}shouldYield(){return performance.now()-this.startTime>=this.frameYieldMs}workLoop(){this.startTime=performance.now(),this.isPending=!1,this.flushQueues()&&this.scheduleFlush()}flushQueues(){for(let e=_.Immediate;e<=_.Background;e++){let t=this.queues[e];if(t.size===0)continue;let s=Array.from(t);t.clear();for(let i=0;i<s.length;i++){let r=s[i];if(r.isQueued=!1,r.active)try{r.update()&&(r.isQueued=!0,t.add(r))}catch(o){this.onError?this.onError(o):console.error("Scheduler error:",o)}if(this.shouldYield()){for(let o=i+1;o<s.length;o++)t.add(s[o]);return!0}}}for(let e=_.Immediate;e<=_.Background;e++)if(this.queues[e].size>0)return!0;return!1}flushSync(){if(this.isSyncing)return;this.isSyncing=!0,this.isPending=!0;let e=this.shouldYield;this.shouldYield=()=>!1;try{let t=!0;for(;t;){t=!1;for(let s=_.Immediate;s<=_.Background;s++){let i=this.queues[s];if(i.size===0)continue;let r=Array.from(i);i.clear();for(let o of r)if(o.isQueued=!1,o.active)try{o.update()&&(o.isQueued=!0,i.add(o),t=!0)}catch(l){this.onError?this.onError(l):console.error("Scheduler error (sync):",l)}i.size>0&&(t=!0)}}}finally{this.shouldYield=e,this.isPending=!1,this.isSyncing=!1}}setSync(e){this.isSync=e}clear(){for(let e of this.queues)e.clear();this.isPending=!1}},v=new mt;var ee=class n extends f{static{a(this,"CollectionVdom")}static MAX_BATCH_SIZE=128;value;renderCallback;startNode;endNode;observerId=0;mappedItems=[];updateState=null;constructor(e,t,s){super(e),this.value=t,this.renderCallback=s}_render(e){this.value instanceof u&&(this.observerId=this.value._subscribe(this)),this.startNode=e.ownerDocument.createTextNode(""),this.endNode=e.ownerDocument.createTextNode(""),e.appendChild(this.startNode),e.appendChild(this.endNode);let t=v.shouldYield;v.shouldYield=()=>!1;try{this.updateList()}finally{v.shouldYield=t}}_unrender(){this.observerId&&this.value instanceof u&&(this.value._unsubscribe(this.observerId),this.observerId=null);for(let e=0;e<this.mappedItems.length;e++){let t=this.mappedItems[e];t.vdom._unrender(),t.afterNode.parentElement.removeChild(t.afterNode)}this.mappedItems.length=0,this.startNode.parentElement.removeChild(this.startNode),this.endNode.parentElement.removeChild(this.endNode),this.startNode=null,this.endNode=null}_getNodes(){if(!this.startNode)return[];let e=[this.startNode];for(let t=0;t<this.mappedItems.length;t++)e.push(...this.mappedItems[t].vdom._getNodes()),e.push(this.mappedItems[t].afterNode);return e.push(this.endNode),e}_getLastChild(){return this}getTailAppendPrefixLength(e){let t=this.mappedItems;if(t.length===0||e.length<=t.length)return 0;for(let s=0;s<t.length;s++)if(e[s]!==t[s].keyValue)return 0;return t.length}isItemPositionedAfter(e,t){let s=e.vdom._getNodes();if(!s.length||!t.parentElement||s[0]!==t.nextSibling)return!1;let i=s[s.length-1];return e.afterNode===i.nextSibling}reuseExistingItem(e,t,s){if(e.value!==t&&!Ee(e.value,t)){e.vdom._unrender(),e.value=t;let i=this.renderCallback(t,this.value instanceof u?e.observableIndex:s,e.keyValue),r;i instanceof f?r=i:typeof i=="object"&&i?.build?(r=new R(this._dot),r.mount(i)):r=new k(i),r._root&&(r=r._root),e.vdom=r}else e.observableIndex._set(s)}getInsertBeforeAnchor(e,t){for(let s=e;s<t.length;s++)if(t[s].vdom._isRendered){let i=t[s].vdom._getNodes();if(i.length)return i[0]}return this.endNode}countConsecutiveUnrendered(e,t){let s=0;for(;e+s<t.length&&!t[e+s].vdom._isRendered&&s<n.MAX_BATCH_SIZE;)s++;return s}batchRenderNewItems(e,t,s){let i=t.ownerDocument.createDocumentFragment();for(let r of e)r.vdom._render(i),i.appendChild(r.afterNode);t.insertBefore(i,s)}async removeItem(e){await e.vdom._unrenderAsync(),e.afterNode.parentElement&&e.afterNode.parentElement.removeChild(e.afterNode)}updateList(){let e=null;this.value instanceof u?e=this.value._get():e=this.value;let t=Array.isArray(e)?e:Object.values(e);if(this.updateState&&(Ee(this.updateState.newItems,t)||(this.updateState=null)),!this.updateState){let i=null;this.value instanceof u&&(i=this.value._source.key??null);let r=t,o=Array.isArray(e)?r.map((h,c)=>i?h[i]:c):Object.keys(e).map((h,c)=>i?e[h][i]:h),l=this.getTailAppendPrefixLength(o),d=new Map;for(let h=0;h<this.mappedItems.length;h++){let c=this.mappedItems[h];h>=l&&d.set(c.keyValue,c)}this.updateState={newItems:r,newKeys:o,oldMap:d,nextMappedItems:[],currentIndex:0,lastNode:this.startNode,tailAppendPrefix:l,step:"diff"}}let s=this.updateState;if(s.step==="diff"){for(;s.currentIndex<s.newItems.length;){let i=s.newItems[s.currentIndex],r=s.newKeys[s.currentIndex];if(s.currentIndex<s.tailAppendPrefix){let o=this.mappedItems[s.currentIndex];this.reuseExistingItem(o,i,s.currentIndex),s.nextMappedItems.push(o)}else{let o=s.oldMap.get(r);if(o)s.oldMap.delete(r),this.reuseExistingItem(o,i,s.currentIndex),s.nextMappedItems.push(o);else{let d=new p().bind();d._set(s.currentIndex);let h=this.renderCallback(i,this.value instanceof u?d:s.currentIndex,r),c;h instanceof f?c=h:typeof h=="object"&&h?.build?(c=new R(this._dot),c.mount(h)):c=new k(h),c._root&&(c=c._root);let m=this.startNode.ownerDocument.createTextNode("");s.nextMappedItems.push({vdom:c,value:i,keyValue:r,afterNode:m,observableIndex:d})}}if(s.currentIndex++,v.shouldYield())return!0}s.step="cleanup"}if(s.step==="cleanup"){let i=Array.from(s.oldMap.values());for(let r of i)this.removeItem(r);s.step="reorder",s.currentIndex=0,this.mappedItems=[]}if(s.step==="reorder")for(;s.currentIndex<s.nextMappedItems.length;){let i=s.nextMappedItems[s.currentIndex];if(i.vdom._isRendered)this.isItemPositionedAfter(i,s.lastNode)?(s.lastNode=i.afterNode,this.mappedItems.push(i),s.currentIndex++):(i.vdom._moveBefore(s.lastNode.nextSibling,s.lastNode.parentElement),s.lastNode.parentElement.insertBefore(i.afterNode,i.vdom._getNodes().slice(-1)[0].nextSibling),s.lastNode=i.afterNode,this.mappedItems.push(i),s.currentIndex++);else{let r=this.countConsecutiveUnrendered(s.currentIndex,s.nextMappedItems);if(r>=2){let o=s.nextMappedItems.slice(s.currentIndex,s.currentIndex+r),l=s.lastNode.parentElement,d=this.getInsertBeforeAnchor(s.currentIndex+r,s.nextMappedItems);this.batchRenderNewItems(o,l,d);for(let h of o)s.lastNode=h.afterNode,this.mappedItems.push(h);s.currentIndex+=r}else i.vdom._renderAfter(s.lastNode),s.lastNode.parentElement.insertBefore(i.afterNode,i.vdom._getNodes().slice(-1)[0].nextSibling),s.lastNode=i.afterNode,this.mappedItems.push(i),s.currentIndex++}if(v.shouldYield())return!0}return this.updateState=null,!1}};var te=class extends f{static{a(this,"ConditionalVdom")}conditions=[];sealed=!1;renderedIndex=-1;currentUpdatePromise=null;nextIndex=null;constructor(e){super(e)}addCondition(e,t,s=!1){if(this.sealed)throw new Error("Cannot add additional conditions to a sealed block.");this.sealed=s;let i={condition:e,vNode:t,startAnchor:null,endAnchor:null,observerId:0};this.conditions.push(i),this._isRendered&&(this.renderClause(i,this.conditions[0].startAnchor.parentElement),this.renderedIndex==-1&&this.updateConditions())}renderClause(e,t){if(e.startAnchor)throw new Error("Item is already rendered.");e.startAnchor=t.ownerDocument.createTextNode(""),e.endAnchor=t.ownerDocument.createTextNode(""),t.appendChild(e.startAnchor),t.appendChild(e.endAnchor),e.condition instanceof u&&(e.observerId=e.condition._subscribe(this))}_render(e){this._isRendered=!0;for(let t=0;t<this.conditions.length;t++)this.renderClause(this.conditions[t],e);this.updateConditions()}removeCNode(e){e.condition instanceof u&&(e.condition._unsubscribe(e.observerId),e.observerId=0);let t=e.startAnchor,s=e.endAnchor;t.parentElement.removeChild(t),s.parentElement.removeChild(s),e.startAnchor=null,e.endAnchor=null,e.vNode._unrender()}_unrender(){if(this._isRendered){this._isRendered=!1,this.renderedIndex=-1,this.nextIndex=null,this.currentUpdatePromise=null;for(let e=0;e<this.conditions.length;e++){let t=this.conditions[e];this.removeCNode(t)}}}_getNodes(){if(!this._isRendered)return[];let e=[];for(let t=0;t<this.conditions.length;t++){let s=this.conditions[t];e.push(s.startAnchor),t==this.renderedIndex&&e.push(...s.vNode._getNodes()),e.push(s.endAnchor)}return e}_getLastChild(){return this}updateConditions(){let e=-1;for(let t=0;t<this.conditions.length;t++){let s=this.conditions[t];if(s.condition instanceof u?s.condition._get():s.condition){e=t;break}}if(this.currentUpdatePromise){this.nextIndex=e;return}e!=this.renderedIndex&&this.performUpdate(e)}async performUpdate(e){let t=this.renderedIndex;if(this.renderedIndex=e,t!=-1){let s=this.conditions[t];this.currentUpdatePromise=Promise.resolve(s.vNode._unrenderAsync()),await this.currentUpdatePromise,this.currentUpdatePromise=null}if(this.nextIndex!==null){let s=this.nextIndex;if(this.nextIndex=null,s!==this.renderedIndex){this.performUpdate(s);return}}if(this.renderedIndex!=-1){let s=this.conditions[this.renderedIndex];s.vNode._renderBefore(s.endAnchor)}if(this.nextIndex!==null){let s=this.nextIndex;this.nextIndex=null,s!==this.renderedIndex&&this.performUpdate(s)}}};var le=class extends f{static{a(this,"HtmlVdom")}beforeNode;afterNode;_html;observerId=0;constructor(e){super(),this._html=e}updateHtml(e){if(this.beforeNode){ae(this.beforeNode,this.afterNode);let t=this.beforeNode.ownerDocument.createElement("div");for(t.innerHTML=e;t.firstChild;)this.afterNode.parentElement.insertBefore(t.firstChild,this.afterNode)}}_render(e){let t="";this._html instanceof u?(t=this._html._get()??"",this.observerId=this._html._subscribe(this)):t=this._html,this.beforeNode=e.ownerDocument.createTextNode(""),this.afterNode=e.ownerDocument.createTextNode(""),e.appendChild(this.beforeNode),e.appendChild(this.afterNode),this.updateHtml(t??"")}_unrender(){if(this.beforeNode){let e=this.beforeNode.parentElement;ae(this.beforeNode,this.afterNode),e.removeChild(this.beforeNode),e.removeChild(this.afterNode),this.beforeNode=null,this.afterNode=null}this.observerId&&this._html instanceof u&&(this._html._unsubscribe(this.observerId),this.observerId=0)}_getNodes(){if(!this.beforeNode)return[];let e=[this.beforeNode],t=this.beforeNode.nextSibling;for(;t&&t!==this.afterNode;)e.push(t),t=t.nextSibling;return e.push(this.afterNode),e}_getLastChild(){return this}toString(){return this._html instanceof u?this._html._get():this._html}};var se=class{static{a(this,"ReactiveAttr")}elementVdom;attribute;constructor(e,t){this.elementVdom=e,this.attribute=t}};var ge=class{static{a(this,"Subscription")}boundReactive;item;active=!0;isQueued=!1;constructor(e,t){this.boundReactive=e,this.item=t}update(){if(!this.active)return;let e=this.boundReactive._get();if(this.item instanceof k)this.item.textNode.textContent=e??"";else if(this.item._isReactiveVdom)this.item.update(e);else if(this.item instanceof le)this.item.updateHtml(e);else if(this.item instanceof se)this.item.elementVdom.updateReactiveAttr(this.item.attribute,e);else if(this.item instanceof H)this.item.update();else{if(this.item instanceof ee)return this.item.updateList();this.item instanceof te?this.item.updateConditions():this.item instanceof Function&&this.item(e)}}};var K=[];var gt=7,As=gt+1,p=class{static{a(this,"Signal")}bindAs(e){let t=new u(this);return e.call&&e.apply?t._transform={display:e}:t._transform=e,t}bind(){return new u(this)}_value;key;subscribers=new Map;get isWritable(){return!0}constructor(){}get value(){let e=K[K.length-1];return e&&e.addDependency&&e.addDependency(this),this._value}set value(e){this.setValue(e)}getValue(){return this.value}setValue(e,t=_.Normal){this._value!==e&&(this._value=e,this.updater(this._value,t))}updater(e,t=_.Normal){for(let s of this.subscribers.values())s.sync?s.update():(!s.isQueued||t===_.Immediate)&&v.enqueue(s,t)}nextId=1;subscribe(e,t=!1){return new u(this)._subscribe(e,t)}_subscribe(e,t,s=!1){let i=this.nextId++,r=new ge(e,t);return r.sync=s,this.subscribers.set(i,r),i}unsubscribe(e){this.subscribers.has(e)&&(this.subscribers.get(e).active=!1,this.subscribers.delete(e))}_detachBinding(e){this.unsubscribe(e)}refresh(e=_.Normal){let t=this.value;this.updater(t,e)}updateObservers(e=_.Normal){this.refresh(e)}};var ne=class extends H{static{a(this,"AttributeVNode")}attr;value;target;observables={};constructor(e,t){super(),this.attr=e,this.value=t}render(e){this.target=e;for(let t in this.value){let s=this.value[t];if(s instanceof p&&(s=s.bind()),s&&s instanceof u){let i=s._subscribe(this);this.observables[i]=s}}this.update()}update(){if(!this.target)return;let e=[];for(let t in this.value){let s=this.value[t];s&&(s instanceof p&&(s=s.bind()),(!(s instanceof u)||s._get())&&e.push(t))}this.target.setAttribute(this.attr,e.join(" "))}unrender(){this.target=null;for(let e in this.observables)this.observables[e]._unsubscribe(Number(e));this.observables={}}};var qe={color:"color|background-Color|border-Bottom-Color|border-Color|border-Left-Color|border-Right-Color|border-Top-Color|text-Decoration-Color|outline-Color|column-Rule-Color",length:"background-Size|block-Size|border-Bottom-Left-Radius|border-Bottom-Right-Radius|border-Bottom-Width|border-Left-Width|border-Radius|border-Right-Width|border-Top-Left-Radius|border-Top-Right-Radius|border-Top-Width|border-Width|bottom|gap|height|left|margin|margin-Bottom|margin-Left|margin-Right|margin-Top|max-Height|max-Width|min-Height|min-Width|padding|padding-Bottom|padding-Left|padding-Right|padding-Top|right|top|width|flex-Basis|font-Size|text-Indent|letter-Spacing|word-Spacing|border-Spacing|outline-Offset|outline-Width|column-Gap|column-Rule-Width|grid-Column-Gap|grid-Gap|grid-Row-Gap|column-Width|perspective|row-Gap",hybrid:"line-Height|border-Image-Width|border-Image-Outset|tab-Size|flex",url:"background-Image|border-Image|list-Style-Image|content|image-Orientation",transformation:"transform",filter:"filter|backdrop-Filter",time:"animation-Delay|animation-Direction|animation-Duration|transition-Duration|transition-Delay",misc:"appearance|aspect-Ratio|opacity|background|background-Attachment|background-Blend-Mode|background-Position|background-Repeat|background-Clip|background-Origin|border|border-Bottom|border-Bottom-Style|border-Image-Repeat|border-Image-Slice|border-Image-Source|border-Left|border-Left-Style|border-Right|border-Right-Style|border-Style|border-Top|border-Top-Style|box-Decoration-Break|box-Shadow|clear|clip|display|float|overflow|box|overflow-X|overflow-Y|position|visibility|vertical-Align|z-Index|align-Content|align-Items|align-Self|flex-Direction|flex-Flow|flex-Grow|flex-Shrink|flex-Wrap|grid|grid-Area|grid-Auto-Columns|grid-auto-Rows|grid-Column|grid-Column-End|grid-Column-Start|grid-Row|grid-Row-End|grid-Row-Start|grid-Template|grid-Template-Areas|grid-Template-Columns|grid-Template-Rows|justify-Content|order|hanging-Punctuation|hyphens|line-Break|overflow-Wrap|text-Align|text-Align-Last|text-Combine-Upright|text-Justify|text-Transform|white-Space|word-Break|word-Wrap|text-Decoration|text-Decoration-Line|text-Decoration-Style|text-Shadow|text-Underline-Position|font|font-Family|font-Feature-Settings|font-Kerning|font-Language-Override|font-Size-Adjust|font-Stretch|font-Style|font-Synthesis|font-Variant|font-Variant-Alternates|font-Variant-Caps|font-Variant-East-Asian|font-Variant-Ligatures|font-Variant-Numeric|font-Variant-Position|font-Weight|direction|text-Orientation|text-Combine-Upright|unicode-Bidi|user-Select|writing-Mode|border-Collapse|caption-Side|empty-Cells|table-Layout|counter-Increment|counter-Reset|list-Style|list-Style-Position|list-Style-Type|animation|animation-Fill-Mode|animation-Iteration-Count|animation-Name|animation-Play-State|animation-Timing-Function|animation-Timeline|container-Type|container-Name|backface-Visibility|perspective2d|perspective-Origin|transform-Origin|transform-Style|transition|transition-Property|transition-Timing-Function|box-Sizing|cursor|ime-Mode|nav-Down|nav-Index|nav-Left|nav-Right|nav-Up|outline|outline-Style|resize|text-Overflow|break-After|break-Before|break-Inside|column-Count|column-Fill|column-Rule|column-Rule-Style|column-Span|columns|widows|orphans|page-Break-After|page-Break-Before|page-Break-Inside|marks|quotes|image-Rendering|image-Resolution|object-Fit|object-Position|mask|mask-Type|mark|mark-After|mark-Before|phonemes|rest|rest-After|rest-Before|voice-Balance|voice-Duration|voice-Pitch|voice-Pitch-Range|voice-Rate|voice-Stress|voice-Volume|marquee-Direction|marquee-Play-Count|marquee-Speed|marquee-Style|pointer-Events"},yt="Cm|Mm|In|Px|Pt|Pc|Ch|Em|Ex|Lh|Rem|Vh|Vw|Vmin|Vmax|Cqw|Cqh|Cqi|Cqb|Cqmin|Cqmax|P".split("|"),bt="Ms|S".split("|"),_t="Deg|Grad|Rad|Turn".split("|"),wt="Hz|Khz".split("|"),de={};for(let n in qe){let e=qe[n].split("|");for(let t of e){let s=t.split("-").join("");switch(n){case"hybrid":case"length":{for(let i of yt)de[`${s}${i}`]={dotName:s,cssName:t.toLowerCase(),type:n,unit:i=="P"?"%":i.toLowerCase()};break}case"time":{for(let i of bt)de[`${s}${i}`]={dotName:s,cssName:t.toLowerCase(),type:n,unit:i.toLowerCase()};break}case"angle":{for(let i of _t)de[`${s}${i}`]={dotName:s,cssName:t.toLowerCase(),type:n,unit:i.toLowerCase()};break}case"frequency":{for(let i of wt)de[`${s}${i}`]={dotName:s,cssName:t.toLowerCase(),type:n,unit:i.toLowerCase()};break}default:break}de[s]={dotName:s,cssName:t.toLowerCase(),type:n,unit:void 0}}}var ie=de;var C=class{static{a(this,"CssFunctionBuilderVStyle")}funcs=[];propName;constructor(e){this.propName=e}toString(){let e="";for(let t of this.funcs){let s=Array.from(t.args).map(i=>{let r=i.v!==void 0?i.v:i,o=i.f||(l=>`${l}`);return r instanceof u?o(r._get()):r instanceof p?o(r.value):o(r).toString().split(" ").join(", ")}).join(", ");e+=`${t.func}(${s}) `}return e.trim()}appendFunction(e,t){return this.funcs.push({func:e,args:t}),this}};function b(n,e="px"){if(n=n||"0px",n instanceof u&&(n=n._get()),n instanceof p&&(n=n.value),n instanceof Array)return n.map(s=>b(s,e)).join(" ");isNaN(n)||(n=n+e);let t=n.trim().split(" ");if(t.length>1)return t.map(s=>b(s,e)).join(" ");{let s=Number(n.match(me)[0]),i=n.split(me)[1]||e;return`${s}${i}`}}a(b,"formatCssLength");function Ne(n){if(n=n||"0%",n instanceof u&&(n=n._get()),n instanceof p&&(n=n.value),n instanceof Array)return n.map(t=>Ne(t)).join(" ");let e=n.trim().split(" ");return e.length>1?e.map(t=>Ne(t)).join(" "):isNaN(n)?n:`${n}%`}a(Ne,"formatCssPercentage");function je(n){if(typeof n=="number"){let e=0,t=0,s=0,i=1;return s=n&255,n>>=8,t=n&255,n>>=8,e=n&255,`rgb(${e} ${t} ${s})`}else if(typeof n=="string")return n}a(je,"formatCssColor");function P(n){if(n=n||"0deg",n instanceof u&&(n=n._get()),n instanceof p&&(n=n.value),n instanceof Array)return n.map(t=>P(t)).join(" ");isNaN(n)||(n=`${n}deg`);let e=n.trim().split(" ");if(e.length>1)return e.map(t=>P(t)).join(" ");{let t=Number(n.match(me)[0]),s=n.split(me)[1]||"deg";return`${t}${s}`}}a(P,"formatCssAngle");var B=class extends C{static{a(this,"FilterVStyle")}blur(e){return this.appendFunction("blur",[{v:e,f:b}])}brightness(e){return this.appendFunction("brightness",[{v:e,f:Ne}])}contrast(e){return this.appendFunction("contrast",[{v:e,f:b}])}dropShadow(e,t,s,i){return this.appendFunction("drop-shadow",[{v:e,f:b},{v:t,f:b},{v:s,f:b},{v:i,f:je}])}grayscale(e){return this.appendFunction("grayscale",[{v:e,f:b}])}hueRotate(e){return this.appendFunction("hue-rotate",[{v:e,f:b}])}invert(e){return this.appendFunction("invert",[{v:e,f:b}])}opacity(e){return this.appendFunction("opacity",[{v:e,f:b}])}sepia(e){return this.appendFunction("sepia",[{v:e,f:b}])}saturate(e){return this.appendFunction("saturate",[{v:e,f:b}])}};var M=class extends C{static{a(this,"TransformVStyle")}matrix3d(e,t,s,i,r,o,l,d,h,c,m,g,I,$,kt,Lt){return this.appendFunction("matrix3d",arguments)}matrix(e,t,s,i,r,o){return this.appendFunction("matrix",arguments)}translate(e,t){return arguments.length==1?this.appendFunction("translate",[{f:b,v:e}]):this.appendFunction("translate",[{f:b,v:e},{f:b,v:t}])}translate3d(e,t,s){return this.appendFunction("translate3d",[{f:b,v:e},{f:b,v:t},{f:b,v:s}])}translateX(e){return this.appendFunction("translateX",[{f:b,v:e}])}translateY(e){return this.appendFunction("translateY",[{f:b,v:e}])}translateZ(e){return this.appendFunction("translateZ",[{f:b,v:e}])}scale(e,t){return this.appendFunction("scale",[e,t??1])}scale3d(e,t,s){return this.appendFunction("scale3d",[e,t,s])}scaleX(e){return this.appendFunction("scaleX",[e])}scaleY(e){return this.appendFunction("scaleY",[e])}scaleZ(e){return this.appendFunction("scaleZ",[e])}rotate(e){return this.appendFunction("rotate",[{f:P,v:e}])}rotate3d(e,t,s,i){return this.appendFunction("rotate3d",[e,t,s,{f:P,v:i}])}rotate3dDeg(e,t,s,i){return this.rotate3d(e,t,s,i)}rotate3dRad(e,t,s,i){return this.rotate3d(e,t,s,`${i}rad`)}rotate3dGrad(e,t,s,i){return this.rotate3d(e,t,s,`${i}grad`)}rotate3dTurn(e,t,s,i){return this.rotate3d(e,t,s,`${i}turn`)}rotateX(e){return this.appendFunction("rotateX",[{f:P,v:e}])}rotateY(e){return this.appendFunction("rotateY",[{f:P,v:e}])}rotateZ(e){return this.appendFunction("rotateZ",[{f:P,v:e}])}skew(e,t){return arguments.length==1?this.appendFunction("skew",[{f:P,v:e}]):this.appendFunction("skew",[{f:P,v:e},{f:P,v:t}])}skewX(e){return this.appendFunction("skewX",[{f:P,v:e}])}skewY(e){return this.appendFunction("skewY",[{f:P,v:e}])}perspective(e){return this.appendFunction("perspective",[{f:b,v:e}])}};var S=class n{static{a(this,"BaseVStyle")}_isBase=!1;props=[];onUpdate;setProp(e,t){return this._isBase?new n().setProp(e,t):(this.props.push({prop:e,value:t}),this.onUpdate&&this.onUpdate(),this)}_setOnUpdate(e){this.onUpdate=e}variable(e,t){return e.startsWith("--")||(e="--"+e),this.setProp(e,t)}v(e){return e.startsWith("--")||(e="--"+e),`var(${e})`}getProps(){return this.props}};for(let n in ie)S.prototype[n]=function(e){return this.setProp(n,e)};var A=class extends H{static{a(this,"StyleVNode")}target;document;shadowRoot;styleSource;styleElement;observables=[];observableIds=[];isQueued=!1;updateSubscription={active:!0,update:a(()=>{this.isQueued=!1,this.applyStyles()},"update")};constructor(e){super(),this.styleSource=e,this.styleSource instanceof S&&this.styleSource._setOnUpdate(()=>this.update()),this.extractObservables()}extractObservables(){let e=this.styleSource instanceof S?this.styleSource.getProps():this.styleSource;if(Array.isArray(e))for(let t=0;t<e.length;t++){let s=e[t];this.processValue(s.prop,s.value,i=>s.value=i)}else for(let t in e)this.processValue(t,e[t],s=>e[t]=s)}processValue(e,t,s){if(!this.tryExtractObservable(t)&&typeof t=="object"&&t!==null&&!(t instanceof C)){let i;switch(e){case"filter":{i=new B(e);break}case"transform":{i=new M(e);break}}if(i){let r=Array.isArray(t)?t:[t];for(let o of r)for(let l in o){let d=o[l];if(this.tryExtractObservable(d),Array.isArray(d))for(let c of d)this.tryExtractObservable(c);let h=l.replace(/_\d+$/,"");typeof i[h]=="function"&&(Array.isArray(d)?i[h](...d):i[h](d))}s(i)}}}tryExtractObservable(e){if(e instanceof u||e instanceof p){if(this.observables.indexOf(e)===-1&&(this.observables.push(e),this.target)){let t=e.subscribe(()=>this.update());this.observableIds.push(t)}return!0}return!1}render(e,t=window.document,s){this.target=e,this.document=t,this.shadowRoot=s;for(let i of this.observables){let r=i.subscribe(()=>this.update());this.observableIds.push(r)}typeof e=="string"&&(this.styleElement=this.document.createElement("style"),this.shadowRoot?this.shadowRoot.appendChild(this.styleElement):this.document.head.appendChild(this.styleElement)),this.applyStyles()}update(){this.isQueued||(this.isQueued=!0,v.enqueue(this.updateSubscription,_.Normal))}applyStyles(){if(this.target)if(typeof this.target=="string")this.styleElement&&(this.styleElement.textContent=`${this.target} { ${this.getStyleString()} }`);else{this.extractObservables();let e=this.styleSource instanceof S?this.styleSource.getProps():this.styleSource;if(Array.isArray(e))for(let t of e){let s=t.value instanceof u?t.value._get():t.value instanceof p?t.value.value:t.value;this.applySingleStyle(t.prop,s)}else for(let t in e){let s=e[t]instanceof u?e[t]._get():e[t]instanceof p?e[t].value:e[t];this.applySingleStyle(t,s)}}}applySingleStyle(e,t){let s;if(t instanceof C)s=t.toString();else if(typeof t=="object"&&t!==null&&(e==="transform"||e==="filter")){let l=e==="transform"?new M(e):new B(e);this.applyObjectToBuilder(l,t),s=l.toString()}else s=t;let i=e,r,o=ie[e];o&&(i=o.cssName,r=o.unit,(o.type==="length"||o.type==="hybrid")&&typeof s=="number"?o.type==="hybrid"&&r===void 0||(s=b(s,r)):o.unit&&typeof s=="number"&&(s=`${s}${o.unit}`)),this.target instanceof HTMLElement&&this.target.style.setProperty(i,`${s}`)}getStyleString(){let e="",t=this.styleSource instanceof S?this.styleSource.getProps():this.styleSource;if(Array.isArray(t))for(let s of t)e+=this.formatSingleStyle(s.prop,s.value);else for(let s in t)e+=this.formatSingleStyle(s,t[s]);return e}applyObjectToBuilder(e,t){let s=Array.isArray(t)?t:[t];for(let i of s)for(let r in i){let o=i[r],l=r.replace(/_\d+$/,"");typeof e[l]=="function"&&(Array.isArray(o)?e[l](...o):e[l](o))}}formatSingleStyle(e,t){let s=t instanceof u?t._get():t instanceof p?t.value:t;if(s instanceof C)s=s.toString();else if(typeof s=="object"&&s!==null&&(e==="transform"||e==="filter")){let l=e==="transform"?new M(e):new B(e);this.applyObjectToBuilder(l,s),s=l.toString()}let i=e,r,o=ie[e];return o&&(i=o.cssName,r=o.unit,(o.type==="length"||o.type==="hybrid")&&typeof s=="number"?o.type==="hybrid"&&r===void 0||(s=b(s,r)):o.unit&&typeof s=="number"&&(s=`${s}${o.unit}`)),`${i}: ${s}; `}unrender(){for(let e=0;e<this.observableIds.length;e++){let t=this.observableIds[e],s=this.observables[e];s instanceof u?s._unsubscribe(t):s.unsubscribe(t)}this.observableIds=[],this.observables=[],this.styleElement&&(this.styleElement.remove(),this.styleElement=null),this.target=null,this.updateSubscription.active=!1}toString(){return typeof this.target=="string"?`${this.target} { ${this.getStyleString()} }`:this.getStyleString()}};var ye=class{static{a(this,"SyntheticEvent")}nativeEvent;target;currentTarget;type;timeStamp;defaultPrevented;detail;_propagationStopped=!1;_immediatePropagationStopped=!1;constructor(e){this.nativeEvent=e,this.target=e.target,this.currentTarget=e.currentTarget,this.type=e.type,this.timeStamp=e.timeStamp,this.defaultPrevented=e.defaultPrevented,this.detail=e.detail}preventDefault(){this.defaultPrevented=!0,this.nativeEvent.preventDefault()}stopPropagation(){this._propagationStopped=!0,this.nativeEvent.stopPropagation()}stopImmediatePropagation(){this._immediatePropagationStopped=!0,this._propagationStopped=!0,this.nativeEvent.stopImmediatePropagation()}isPropagationStopped(){return this._propagationStopped}isImmediatePropagationStopped(){return this._immediatePropagationStopped}};var q=class n{static{a(this,"EventManager")}static managers=new Map;static getForDocument(e){let t=this.managers.get(e);return t||(t=new n(e),this.managers.set(e,t)),t}document;listeners=new WeakMap;activeEventTypes=new Set;constructor(e){this.document=e}addListener(e,t,s,i=[]){let r=this.listeners.get(e);r||(r=new Map,this.listeners.set(e,r));let o=r.get(t);o||(o=[],r.set(t,o)),o.push({handler:s,modifiers:i}),this.ensureGlobalListener(t)}removeListener(e,t,s){let i=this.listeners.get(e);if(!i)return;let r=i.get(t);if(!r)return;let o=r.findIndex(l=>l.handler===s);o!==-1&&r.splice(o,1),r.length===0&&i.delete(t)}ensureGlobalListener(e){if(this.activeEventTypes.has(e))return;let t=e==="focus"||e==="blur";this.document.addEventListener(e,s=>{this.dispatchEvent(e,s)},t),this.activeEventTypes.add(e)}dispatchEvent(e,t){let s=t.composedPath();if(!s||s.length===0){s=[];let r=t.target;for(;r;)s.push(r),r=r.parentNode||r.host}let i=new ye(t);for(let r of s){if(r===this.document||r===window)continue;let o=this.listeners.get(r);if(!o)continue;let l=o.get(e);if(l){i.currentTarget=r;for(let{handler:d,modifiers:h}of[...l])if(!(h.includes("self")&&t.target!==r)&&(h.includes("stop")&&i.stopPropagation(),h.includes("prevent")&&i.preventDefault(),d(i),h.includes("once")&&this.removeListener(r,e,d),i.isImmediatePropagationStopped()))break;if(i.isPropagationStopped())break}}}};var L=class extends f{static{a(this,"ElementVdom")}_children=null;get children(){return this._children||(this._children=new w(this._dot),this._children._parent=this),this._children}set children(e){this._children=e}element;tag=null;attributes={};events=[];attributeObserverIds=[];childBuilders=[];attrVNodes=[];styleVNodes=[];ref;inputListener;compositionStartListener;compositionEndListener;manualInputAllowed=!0;isComposing=!1;activeBindings={};lastSyncedValues={};constructor(e,t){super(e),this.tag=t}_render(e){this._isRendered=!0,this.element=e.ownerDocument.createElement(this.tag),this.element[O]=this,this.ref&&(typeof this.ref=="function"?this.ref(this.element):this.ref.value=this.element),e.appendChild(this.element),this._children&&this._children._render(this.element);for(let t=0;t<this.events.length;t++){let s=this.events[t];this.renderEvent(s.name,s.callback,s.modifiers)}this.attributes.type!==void 0&&this.renderAttr("type",this.attributes.type,this.element);for(let t in this.attributes)t!=="type"&&this.renderAttr(t,this.attributes[t],this.element);this._onEnterHook&&this._onEnterHook(this.element)}_unrender(){if(!this._isRendered||(this._isRendered=!1,this._children&&this._children._unrender(),!this.element))return;let e=q.getForDocument(this.element.ownerDocument);this.inputListener&&(e.removeListener(this.element,"input",this.inputListener),this.inputListener=null),this.compositionStartListener&&(e.removeListener(this.element,"compositionstart",this.compositionStartListener),this.compositionStartListener=null),this.compositionEndListener&&(e.removeListener(this.element,"compositionend",this.compositionEndListener),this.compositionEndListener=null);for(let t=0;t<this.events.length;t++){let s=this.events[t];e.removeListener(this.element,s.name.toLowerCase(),s.callback)}this.element.parentNode?.removeChild(this.element);for(let t=0;t<this.childBuilders.length;t++)this.childBuilders[t]._unrender();this.childBuilders.length=0;for(let t=0;t<this.attrVNodes.length;t++)this.attrVNodes[t].unrender();this.attrVNodes.length=0;for(let t=0;t<this.styleVNodes.length;t++)this.styleVNodes[t].unrender();this.styleVNodes.length=0;for(let t=0;t<this.attributeObserverIds.length;t++){let s=this.attributeObserverIds[t];s.observable._unsubscribe(s.id)}this.attributeObserverIds.length=0,this.ref&&(typeof this.ref=="function"?this.ref(null):this.ref.value=null),this.element=null}_getNodes(){return this.element?[this.element]:[]}_getLastChild(){return this}toString(){return this.element?this.element.outerHTML:super.toString()}setAttr(e,t){e=(e??"").toLowerCase();let s=e;if(e=="bind"){let r=this.attributes.type;r instanceof u?r=r._get():r instanceof p&&(r=r.value);let o=typeof r=="string"?r.toLowerCase():null;s=this.tag.toLowerCase()=="input"&&(o=="checkbox"||o=="radio")?"checked":"value"}let i=this.attributes[e];if(i instanceof A){i.unrender();let r=this.styleVNodes.indexOf(i);r!==-1&&this.styleVNodes.splice(r,1)}if(i instanceof ne){i.unrender();let r=this.attrVNodes.indexOf(i);r!==-1&&this.attrVNodes.splice(r,1)}for(let r=0;r<this.attributeObserverIds.length;r++){let o=this.attributeObserverIds[r];if(o.attr===e||o.attr===s){o.observable._unsubscribe(o.id),this.attributeObserverIds.splice(r,1);break}}if(t&&typeof t=="object"&&!(t instanceof Array||t instanceof u||t instanceof p||t instanceof S))switch(e){case"style":{t=new A(t);break}case"ref":break;default:{t=new ne(e,t);break}}if(typeof t=="function"&&e==="style"){let r=new S;t(r),t=new A(r)}t instanceof S&&e==="style"&&(t=new A(t)),this.attributes[e]=t,this.element&&this.renderAttr(e,t,this.element)}updateReactiveAttr(e,t){this.element&&this.renderAttr((e??"").toLowerCase(),t,this.element)}renderAttr(e,t,s,i=!1){if(e=="bind"){let r=this.attributes.type;r instanceof u?r=r._get():r instanceof p&&(r=r.value);let o=typeof r=="string"?r.toLowerCase():null;e=this.tag.toLowerCase()=="input"&&(o=="checkbox"||o=="radio")?"checked":"value",i=!0}if(e=="ref")this.ref=t,this.element&&(typeof this.ref=="function"?this.ref(this.element):this.ref.value=this.element);else if(typeof t=="string"||typeof t=="number")e=="value"&&(this.tag.toLowerCase()=="input"||this.tag.toLowerCase()=="textarea"||this.tag.toLowerCase()=="select")?(s.value=t??"",this.lastSyncedValues[e]=t??""):s.setAttribute(e,`${t}`);else if(typeof t=="boolean"||t==null||t==null)e=="checked"&&this.tag.toLowerCase()=="input"?(s.checked=!!t,this.lastSyncedValues[e]=!!t):e=="selected"&&this.tag.toLowerCase()=="option"?s.selected=!!t:e=="value"&&(this.tag.toLowerCase()=="input"||this.tag.toLowerCase()=="textarea"||this.tag.toLowerCase()=="select")&&(s.value=t??"",this.lastSyncedValues[e]=t??""),t?s.setAttribute(e,`${t}`):s.removeAttribute(e);else if(t instanceof Array)s.setAttribute(e,t.join(" "));else if(t instanceof u){if(this.renderAttr(e,t._get(),s,i),!this.attributeObserverIds.some(r=>r.attr===e&&r.observable===t)){let r=t._subscribe(new se(this,e));this.attributeObserverIds.push({id:r,observable:t,attr:e})}if((e=="value"||e=="checked")&&t.isWritable&&i&&(this.activeBindings[e]=t,!this.inputListener)){this.inputListener=o=>{if(!this.isComposing)try{let l=o.target.type==="checkbox"||o.target.type==="radio"?"checked":"value",d=this.activeBindings[l];if(!d)return;let h=this.element[l],c=d._get(),m=this.lastSyncedValues[l];c==m&&h!=m&&d._set(h),this.lastSyncedValues[l]=d._get()}catch(l){console.error("CAUGHT ERROR: "+l.message)}},this.compositionStartListener=()=>{this.isComposing=!0},this.compositionEndListener=o=>{this.isComposing=!1,this.inputListener(o)};let r=q.getForDocument(this.element.ownerDocument);r.addListener(this.element,"input",this.inputListener),r.addListener(this.element,"compositionstart",this.compositionStartListener),r.addListener(this.element,"compositionend",this.compositionEndListener)}}else t instanceof ne?(t.render(s),this.attrVNodes.push(t)):t instanceof A&&(t.render(s),this.styleVNodes.push(t))}addEventListener(e,t,s=[]){this.events.some(i=>i.name===e&&i.callback===t)||(this.events.push({name:e,callback:t,modifiers:s}),this.element&&this.renderEvent(e,t,s))}renderEvent(e,t,s=[]){q.getForDocument(this.element.ownerDocument).addListener(this.element,e.toLowerCase(),t,s)}};var w=class extends f{static{a(this,"ContainerVdom")}_children=[];_parent=null;constructor(e){super(e)}_addChild(e){return this._children.push(e),this._parent&&this._parent instanceof L&&this._parent.element&&e._render(this._parent.element),this}_render(e){this._isRendered=!0;for(let t=0;t<this._children.length;t++)this._children[t]._render(e)}_unrender(){if(this._isRendered){this._isRendered=!1;for(let e=0;e<this._children.length;e++)this._children[e]._unrender()}}_getNodes(){let e=[];for(let t=0;t<this._children.length;t++)e.push(...this._children[t]._getNodes());return e}_getLastChild(){return this._children[this._children.length-1]||null}};var j=class extends p{static{a(this,"Ref")}constructor(){return super(),this._value=null,new Proxy(this,{get(e,t,s){if(t in e)return Reflect.get(e,t,s);let i=e.value;if(i&&typeof i[t]=="function")return(...r)=>i[t].apply(i,r)}})}get element(){return this.value}async ready(){return this.value?this.value:new Promise(e=>{let t=this.subscribe(s=>{s&&(this.unsubscribe(t),e(s))})})}};var Ue={onAbort:1,onBlur:1,onChange:1,onInput:1,onCanPlay:1,onCantPlayThrough:1,onClick:1,onCopy:1,onContextMenu:1,onCueChange:1,onCut:1,onDblClick:1,onDrag:1,onDragEnd:1,onDragEnter:1,onDragLeave:1,onDragOver:1,onDragStart:1,onDrop:1,onDurationChange:1,onEmptied:1,onEnded:1,onError:1,onFocus:1,onHashChange:1,onInvalid:1,onKeyDown:1,onKeyPress:1,onKeyUp:1,onLoad:1,onLoadedData:1,onLoadedMetadata:1,onLoadStart:1,onMouseDown:1,onMouseEnter:1,onMouseLeave:1,onMouseMove:1,onMouseOut:1,onMouseOver:1,onMouseUp:1,onPointerCancel:1,onPointerDown:1,onPointerEnter:1,onPointerLeave:1,onPointerMove:1,onPointerOut:1,onPointerOver:1,onPointerUp:1,onTouchStart:1,onTouchEnd:1,onTouchCancel:1,onTouchMove:1,onMouseWheel:1,onOffline:1,onOnline:1,onPageHide:1,onPagePaste:1,onPageShow:1,onPause:1,onPlay:1,onPlaying:1,onPopState:1,onProgress:1,onRateChange:1,onReset:1,onResize:1,onScroll:1,onSearch:1,onSeeked:1,onSeeking:1,onSelect:1,onStalled:1,onStorage:1,onSubmit:1,onSuspend:1,onTimeUpdate:1,onToggle:1,onUnload:1,onVolumeChange:1,onWaiting:1,onWheel:1};var Ae=a(n=>n instanceof w||n instanceof f||n?._root||n?._children||typeof n=="object"&&n?.build||n instanceof p||n instanceof u||typeof n=="string"||typeof n=="number"||typeof n=="boolean"||Array.isArray(n),"isContent"),U=a((n,e,t)=>{let s=e instanceof L?e.children:e;if(Array.isArray(t))for(let i=0;i<t.length;i++)U(n,e,t[i]);else if(Array.isArray(t?._children)){let i=t._children;if(i&&i.length>0)for(let r=0;r<i.length;r++)s._addChild(i[r])}else if(t?._root)U(n,e,t._root);else if(t instanceof f)s._addChild(t);else if(typeof t=="object"&&t?.build)s.mount(t);else if(t!=null){let i=t;i instanceof p&&(i=i.bind()),i instanceof u?s._addChild(new he(n,i)):s._addChild(new k(i))}},"applyContent"),vt=a((n,e)=>{for(let t in e){let s=e[t];s instanceof p&&!(s instanceof j)&&(s=s.bind());let i=t,r=[];if(t.includes(".")){let l=t.split(".");i=l[0],r=l.slice(1)}if(Ue[i]||i.startsWith("on")&&i[2]&&i[2]===i[2].toUpperCase()){if(typeof e[t]!="function")throw new Error(`Value of event attribute ${t} must be a function.`);n.addEventListener(i.substring(2).toLowerCase(),s,r)}else n.setAttr(t,s)}},"applyAttributes"),Pe=a((n,e,t)=>{let s=new L(n,e);for(let i=0;i<t.length;i++){let r=t[i];Ae(r)?U(n,s,r):r&&typeof r=="object"&&vt(s,r)}return s},"createElement");var ze=new WeakMap;function ce(n,e){let t="";if(n instanceof e.defaultView?.CSSStyleSheet)return n;if(typeof n=="string")t=n;else if(typeof n=="function"){let l=n(null);typeof l=="string"&&(t=l)}let s=ze.get(e);if(s||(s=new Map,ze.set(e,s)),s.has(t))return s.get(t);let i=e.defaultView?.CSSStyleSheet;if(i)try{let o=new i;if(o.replaceSync)return o.replaceSync(t),s.set(t,o),o}catch{}let r=e.createElement("style");return r.innerHTML=t,r}a(ce,"renderStylesheet");var Ie=[],F=a(()=>Ie[Ie.length-1]||null,"getCurrentComponent"),x=a(n=>Ie.push(n),"pushComponent"),E=a(()=>Ie.pop(),"popComponent");var V=class extends p{static{a(this,"Computed")}getter;dependencies=new Map;isQueued=!1;isEvaluating=!1;active=!0;dirty=!0;error=null;get isWritable(){return!1}updateSubscription={active:!0,update:a(()=>{this.isQueued=!1,this.dirty&&this._update()},"update")};constructor(e){super(),this.getter=e,this._update()}get value(){if(this.isEvaluating)throw new Error("Circular dependency detected in computed signal.");if(this.dirty&&this._update(),this.error)throw this.error;return super.value}addDependency(e){this.active&&(this.newDependencies.has(e)||this.newDependencies.add(e))}requestUpdate(){this.active&&(this.dirty=!0,this.isQueued||(this.isQueued=!0,v.enqueue(this.updateSubscription,_.Normal)))}newDependencies=new Set;_update(){if(!this.active)return;if(this.isEvaluating)throw new Error("Circular dependency detected in computed signal.");this.isEvaluating=!0,this.dirty=!1,this.error=null,this.newDependencies.clear(),K.push(this);let e,t=!1;try{e=this.getter()}catch(i){this.error=i,t=!0}finally{K.pop(),this.isEvaluating=!1}t||this.setValue(e);let s=[];for(let[i,r]of this.dependencies)this.newDependencies.has(i)||(i.unsubscribe(r),s.push(i));for(let i of s)this.dependencies.delete(i);for(let i of this.newDependencies)if(!this.dependencies.has(i)){let r=i.subscribe(()=>this.requestUpdate(),!0);this.dependencies.set(i,r)}}dispose(){this.active=!1;for(let[e,t]of this.dependencies)e.unsubscribe(t);this.dependencies.clear()}};var be=class{static{a(this,"KeyframesBuilder")}sheet;steps=[];constructor(e){this.sheet=e}step(e,t){let s=new S;return t(s),this.steps.push({selector:e,style:s}),this}from(e){return this.step("from",e)}to(e){return this.step("to",e)}at(e,t){let s=typeof e=="number"?`${e}%`:e;return this.step(s,t)}toString(e=""){return this.steps.map(t=>`${e}${t.selector} { ${this.sheet.formatPropsForBlock(t.style)} }`).join(`
|
|
1
|
+
var dot=(()=>{var xe=Object.defineProperty;var dt=Object.getOwnPropertyDescriptor;var ht=Object.getOwnPropertyNames;var ct=Object.prototype.hasOwnProperty;var a=(n,e)=>xe(n,"name",{value:e,configurable:!0});var ut=(n,e)=>{for(var t in e)xe(n,t,{get:e[t],enumerable:!0})},ft=(n,e,t,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of ht(e))!ct.call(n,i)&&i!==t&&xe(n,i,{get:()=>e[i],enumerable:!(s=dt(e,i))||s.enumerable});return n};var pt=n=>ft(xe({},"__esModule",{value:!0}),n);var It={};ut(It,{DotComponent:()=>He,Link:()=>Me,Priority:()=>_,Router:()=>pe,currentHash:()=>Y,currentPath:()=>N,currentSearch:()=>fe,dot:()=>y,generatePath:()=>Le,getGlobalRoutes:()=>Be,initScrollManager:()=>We,matchRoute:()=>ot,navigate:()=>G,previousPath:()=>Q,setGlobalRoutes:()=>rt,useHash:()=>$e,useQueryParams:()=>De});var O="_dotVDom",X=typeof process<"u"?process.env.NODE_ENV!=="production":(()=>{try{return new Function("return import.meta.env?.DEV")()}catch{return!1}})()??!1;var u=class{static{a(this,"Binding")}_source;_transform;get isWritable(){return this._source.isWritable&&(!this._transform||!!this._transform.read)}get value(){return this._get()}_get(){return this._transform?.display?this._transform.display(this._source.value):this._source.value}_set(e){let t=this._transform?.read?this._transform.read(e):e;this._source.value=t}_subscribe(e,t=!1){return this._source._subscribe(this,e,t)}subscribe(e,t=!1){return this._subscribe(e,t)}_unsubscribe(e){this._source.unsubscribe(e)}unsubscribe(e){this._source.unsubscribe(e)}constructor(e){this._source=e}};var H=class{static{a(this,"VMetaNode")}};function ae(n,e){if(n.parentNode!==e.parentNode)throw new Error("Start and end nodes must have the same parent.");let t=n.nextSibling;for(;t&&t!==e;){let s=t.nextSibling;t[O]?t[O]._unrender():t.parentNode?.removeChild(t),t=s}}a(ae,"removeNodesBetween");function Ee(n,e,t=new Map){if(n===e)return!0;if(n==null||e==null||typeof n!="object"||typeof e!="object")return!1;if(t.has(n))return t.get(n)===e;if(t.set(n,e),Array.isArray(n)&&Array.isArray(e)&&n.length!==e.length)return!1;for(let s in n)if(!e.hasOwnProperty(s)||!Ee(n[s],e[s],t))return!1;for(let s in e)if(!n.hasOwnProperty(s))return!1;return!0}a(Ee,"deepEqual");var me=new RegExp("[-+]?[0-9]*\\.?[0-9]+(?:[eE][-+]?[0-9]+)?","g");var f=class{static{a(this,"Vdom")}_dot;_onEnterHook;_onLeaveHook;constructor(e){this._dot=e}async _unrenderAsync(){let t=this._getNodes().find(s=>s instanceof HTMLElement);this._onLeaveHook&&t&&await this._onLeaveHook(t),this._unrender()}_moveBefore(e,t){let s=this._getNodes();if(s.length===0)return;let i=e?.parentElement||t;if(!i)throw new Error("Internal Error: Cannot move nodes without a parent.");for(let o=0;o<s.length;o++)if(s[o]===e)return;let r=(e?.ownerDocument||i.ownerDocument||document).createDocumentFragment();for(let o=0;o<s.length;o++)r.appendChild(s[o]);i.insertBefore(r,e)}__isRendered=!1;get _isRendered(){return this.__isRendered}set _isRendered(e){if(e&&this.__isRendered)throw new Error("Internal Error: Node is already rendered.");if(!e&&!this.__isRendered)throw new Error("Internal Error: Node is not rendered.");this.__isRendered=e}toString(){let e=document.createElement("div");return this._render(e),e.innerHTML}_renderBefore(e){let t=e.ownerDocument.createElement("div");for(this._render(t);t.childNodes.length>0;){let s=t.childNodes[0];s.parentElement.removeChild(s),e.parentElement.insertBefore(s,e)}}_renderAfter(e){if(e.nextSibling)this._renderBefore(e.nextSibling);else{let t=e.ownerDocument.createTextNode("");e.parentElement.appendChild(t),this._renderBefore(t),t.parentElement.removeChild(t)}}_moveTo(e){let t=this._getNodes();for(let s=0;s<t.length;s++)e.appendChild(t[s])}text(e){return null}html(e){return null}md(e){return null}mount(e,t){return null}when(e,t){return null}each(e,t){return null}otherwiseWhen(e,t,s){return null}otherwise(e){return null}attr(e,t){return null}style(e){return null}on(e,t){return null}onEnter(e){return null}onLeave(e){return null}empty(){return null}remove(){}};var k=class extends f{static{a(this,"TextVdom")}_text;textNode=null;observerId=0;constructor(e){super(),this._text=e}_render(e){this._text instanceof u?(this.textNode=e.ownerDocument.createTextNode(this._text._get()??""),this.observerId=this._text._subscribe(this)):this.textNode=e.ownerDocument.createTextNode(`${this._text??""}`),e.appendChild(this.textNode)}_unrender(){this.textNode&&(this.textNode.parentElement&&this.textNode.parentElement.removeChild(this.textNode),this.textNode=null),this.observerId&&this._text instanceof u&&(this._text._unsubscribe(this.observerId),this.observerId=0)}_getNodes(){return this.textNode?[this.textNode]:[]}_getLastChild(){return this}toString(){let e=document.createTextNode((this._text instanceof u?this._text._get():this._text)??""),t=document.createElement("div");return t.appendChild(e),t.innerHTML}};var R=class extends f{static{a(this,"FragmentVdom")}_children=[];constructor(e){super(e)}_render(e){this._isRendered=!0;for(let t=0;t<this._children.length;t++)this._children[t]._render(e)}_unrender(){if(this._isRendered){this._isRendered=!1;for(let e=0;e<this._children.length;e++)this._children[e]._unrender()}}_getNodes(){let e=[];for(let t=0;t<this._children.length;t++)e.push(...this._children[t]._getNodes());return e}_getLastChild(){return this._children[this._children.length-1]||null}};var _=(function(n){return n[n.Immediate=0]="Immediate",n[n.UserBlocking=1]="UserBlocking",n[n.Normal=2]="Normal",n[n.Background=3]="Background",n})({});var mt=class{static{a(this,"Scheduler")}queues=[new Set,new Set,new Set,new Set];isPending=!1;startTime=0;frameYieldMs=5;isSync=!1;isSyncing=!1;onError;channel=typeof MessageChannel<"u"?new MessageChannel:null;constructor(){this.channel&&(this.channel.port1.onmessage=()=>this.workLoop())}enqueue(e,t=_.Normal){e.isQueued||(e.isQueued=!0,this.queues[t].add(e)),t===_.Immediate||this.isSync?this.flushSync():this.scheduleFlush()}scheduleFlush(){this.isPending||(this.isPending=!0,this.channel?this.channel.port2.postMessage(null):setTimeout(()=>this.workLoop(),0))}shouldYield(){return performance.now()-this.startTime>=this.frameYieldMs}workLoop(){this.startTime=performance.now(),this.isPending=!1,this.flushQueues()&&this.scheduleFlush()}flushQueues(){for(let e=_.Immediate;e<=_.Background;e++){let t=this.queues[e];if(t.size===0)continue;let s=Array.from(t);t.clear();for(let i=0;i<s.length;i++){let r=s[i];if(r.isQueued=!1,r.active)try{r.update()&&(r.isQueued=!0,t.add(r))}catch(o){this.onError?this.onError(o):console.error("Scheduler error:",o)}if(this.shouldYield()){for(let o=i+1;o<s.length;o++)t.add(s[o]);return!0}}}for(let e=_.Immediate;e<=_.Background;e++)if(this.queues[e].size>0)return!0;return!1}flushSync(){if(this.isSyncing)return;this.isSyncing=!0,this.isPending=!0;let e=this.shouldYield;this.shouldYield=()=>!1;try{let t=!0;for(;t;){t=!1;for(let s=_.Immediate;s<=_.Background;s++){let i=this.queues[s];if(i.size===0)continue;let r=Array.from(i);i.clear();for(let o of r)if(o.isQueued=!1,o.active)try{o.update()&&(o.isQueued=!0,i.add(o),t=!0)}catch(l){this.onError?this.onError(l):console.error("Scheduler error (sync):",l)}i.size>0&&(t=!0)}}}finally{this.shouldYield=e,this.isPending=!1,this.isSyncing=!1}}setSync(e){this.isSync=e}clear(){for(let e of this.queues)e.clear();this.isPending=!1}},v=new mt;var ee=class n extends f{static{a(this,"CollectionVdom")}static MAX_BATCH_SIZE=128;value;renderCallback;startNode;endNode;observerId=0;mappedItems=[];updateState=null;constructor(e,t,s){super(e),this.value=t,this.renderCallback=s}_render(e){this.value instanceof u&&(this.observerId=this.value._subscribe(this)),this.startNode=e.ownerDocument.createTextNode(""),this.endNode=e.ownerDocument.createTextNode(""),e.appendChild(this.startNode),e.appendChild(this.endNode);let t=v.shouldYield;v.shouldYield=()=>!1;try{this.updateList()}finally{v.shouldYield=t}}_unrender(){this.observerId&&this.value instanceof u&&(this.value._unsubscribe(this.observerId),this.observerId=null);for(let e=0;e<this.mappedItems.length;e++){let t=this.mappedItems[e];t.vdom._unrender(),t.afterNode.parentElement.removeChild(t.afterNode)}this.mappedItems.length=0,this.startNode.parentElement.removeChild(this.startNode),this.endNode.parentElement.removeChild(this.endNode),this.startNode=null,this.endNode=null}_getNodes(){if(!this.startNode)return[];let e=[this.startNode];for(let t=0;t<this.mappedItems.length;t++)e.push(...this.mappedItems[t].vdom._getNodes()),e.push(this.mappedItems[t].afterNode);return e.push(this.endNode),e}_getLastChild(){return this}getTailAppendPrefixLength(e){let t=this.mappedItems;if(t.length===0||e.length<=t.length)return 0;for(let s=0;s<t.length;s++)if(e[s]!==t[s].keyValue)return 0;return t.length}isItemPositionedAfter(e,t){let s=e.vdom._getNodes();if(!s.length||!t.parentElement||s[0]!==t.nextSibling)return!1;let i=s[s.length-1];return e.afterNode===i.nextSibling}reuseExistingItem(e,t,s){if(e.value!==t&&!Ee(e.value,t)){e.vdom._unrender(),e.value=t;let i=this.renderCallback(t,this.value instanceof u?e.observableIndex:s,e.keyValue),r;i instanceof f?r=i:typeof i=="object"&&i?.build?(r=new R(this._dot),r.mount(i)):r=new k(i),r._root&&(r=r._root),e.vdom=r}else e.observableIndex._set(s)}getInsertBeforeAnchor(e,t){for(let s=e;s<t.length;s++)if(t[s].vdom._isRendered){let i=t[s].vdom._getNodes();if(i.length)return i[0]}return this.endNode}countConsecutiveUnrendered(e,t){let s=0;for(;e+s<t.length&&!t[e+s].vdom._isRendered&&s<n.MAX_BATCH_SIZE;)s++;return s}batchRenderNewItems(e,t,s){let i=t.ownerDocument.createDocumentFragment();for(let r of e)r.vdom._render(i),i.appendChild(r.afterNode);t.insertBefore(i,s)}async removeItem(e){await e.vdom._unrenderAsync(),e.afterNode.parentElement&&e.afterNode.parentElement.removeChild(e.afterNode)}updateList(){let e=null;this.value instanceof u?e=this.value._get():e=this.value;let t=Array.isArray(e)?e:Object.values(e);if(this.updateState&&(Ee(this.updateState.newItems,t)||(this.updateState=null)),!this.updateState){let i=null;this.value instanceof u&&(i=this.value._source.key??null);let r=t,o=Array.isArray(e)?r.map((h,c)=>i?h[i]:c):Object.keys(e).map((h,c)=>i?e[h][i]:h),l=this.getTailAppendPrefixLength(o),d=new Map;for(let h=0;h<this.mappedItems.length;h++){let c=this.mappedItems[h];h>=l&&d.set(c.keyValue,c)}this.updateState={newItems:r,newKeys:o,oldMap:d,nextMappedItems:[],currentIndex:0,lastNode:this.startNode,tailAppendPrefix:l,step:"diff"}}let s=this.updateState;if(s.step==="diff"){for(;s.currentIndex<s.newItems.length;){let i=s.newItems[s.currentIndex],r=s.newKeys[s.currentIndex];if(s.currentIndex<s.tailAppendPrefix){let o=this.mappedItems[s.currentIndex];this.reuseExistingItem(o,i,s.currentIndex),s.nextMappedItems.push(o)}else{let o=s.oldMap.get(r);if(o)s.oldMap.delete(r),this.reuseExistingItem(o,i,s.currentIndex),s.nextMappedItems.push(o);else{let d=new p().bind();d._set(s.currentIndex);let h=this.renderCallback(i,this.value instanceof u?d:s.currentIndex,r),c;h instanceof f?c=h:typeof h=="object"&&h?.build?(c=new R(this._dot),c.mount(h)):c=new k(h),c._root&&(c=c._root);let m=this.startNode.ownerDocument.createTextNode("");s.nextMappedItems.push({vdom:c,value:i,keyValue:r,afterNode:m,observableIndex:d})}}if(s.currentIndex++,v.shouldYield())return!0}s.step="cleanup"}if(s.step==="cleanup"){let i=Array.from(s.oldMap.values());for(let r of i)this.removeItem(r);s.step="reorder",s.currentIndex=0,this.mappedItems=[]}if(s.step==="reorder")for(;s.currentIndex<s.nextMappedItems.length;){let i=s.nextMappedItems[s.currentIndex];if(i.vdom._isRendered)this.isItemPositionedAfter(i,s.lastNode)?(s.lastNode=i.afterNode,this.mappedItems.push(i),s.currentIndex++):(i.vdom._moveBefore(s.lastNode.nextSibling,s.lastNode.parentElement),s.lastNode.parentElement.insertBefore(i.afterNode,i.vdom._getNodes().slice(-1)[0].nextSibling),s.lastNode=i.afterNode,this.mappedItems.push(i),s.currentIndex++);else{let r=this.countConsecutiveUnrendered(s.currentIndex,s.nextMappedItems);if(r>=2){let o=s.nextMappedItems.slice(s.currentIndex,s.currentIndex+r),l=s.lastNode.parentElement,d=this.getInsertBeforeAnchor(s.currentIndex+r,s.nextMappedItems);this.batchRenderNewItems(o,l,d);for(let h of o)s.lastNode=h.afterNode,this.mappedItems.push(h);s.currentIndex+=r}else i.vdom._renderAfter(s.lastNode),s.lastNode.parentElement.insertBefore(i.afterNode,i.vdom._getNodes().slice(-1)[0].nextSibling),s.lastNode=i.afterNode,this.mappedItems.push(i),s.currentIndex++}if(v.shouldYield())return!0}return this.updateState=null,!1}};var te=class extends f{static{a(this,"ConditionalVdom")}conditions=[];sealed=!1;renderedIndex=-1;currentUpdatePromise=null;nextIndex=null;constructor(e){super(e)}addCondition(e,t,s=!1){if(this.sealed)throw new Error("Cannot add additional conditions to a sealed block.");this.sealed=s;let i={condition:e,vNode:t,startAnchor:null,endAnchor:null,observerId:0};this.conditions.push(i),this._isRendered&&(this.renderClause(i,this.conditions[0].startAnchor.parentElement),this.renderedIndex==-1&&this.updateConditions())}renderClause(e,t){if(e.startAnchor)throw new Error("Item is already rendered.");e.startAnchor=t.ownerDocument.createTextNode(""),e.endAnchor=t.ownerDocument.createTextNode(""),t.appendChild(e.startAnchor),t.appendChild(e.endAnchor),e.condition instanceof u&&(e.observerId=e.condition._subscribe(this))}_render(e){this._isRendered=!0;for(let t=0;t<this.conditions.length;t++)this.renderClause(this.conditions[t],e);this.updateConditions()}removeCNode(e){e.condition instanceof u&&(e.condition._unsubscribe(e.observerId),e.observerId=0);let t=e.startAnchor,s=e.endAnchor;t.parentElement.removeChild(t),s.parentElement.removeChild(s),e.startAnchor=null,e.endAnchor=null,e.vNode._unrender()}_unrender(){if(this._isRendered){this._isRendered=!1,this.renderedIndex=-1,this.nextIndex=null,this.currentUpdatePromise=null;for(let e=0;e<this.conditions.length;e++){let t=this.conditions[e];this.removeCNode(t)}}}_getNodes(){if(!this._isRendered)return[];let e=[];for(let t=0;t<this.conditions.length;t++){let s=this.conditions[t];e.push(s.startAnchor),t==this.renderedIndex&&e.push(...s.vNode._getNodes()),e.push(s.endAnchor)}return e}_getLastChild(){return this}updateConditions(){let e=-1;for(let t=0;t<this.conditions.length;t++){let s=this.conditions[t];if(s.condition instanceof u?s.condition._get():s.condition){e=t;break}}if(this.currentUpdatePromise){this.nextIndex=e;return}e!=this.renderedIndex&&this.performUpdate(e)}async performUpdate(e){let t=this.renderedIndex;if(this.renderedIndex=e,t!=-1){let s=this.conditions[t];this.currentUpdatePromise=Promise.resolve(s.vNode._unrenderAsync()),await this.currentUpdatePromise,this.currentUpdatePromise=null}if(this.nextIndex!==null){let s=this.nextIndex;if(this.nextIndex=null,s!==this.renderedIndex){this.performUpdate(s);return}}if(this.renderedIndex!=-1){let s=this.conditions[this.renderedIndex];s.vNode._renderBefore(s.endAnchor)}if(this.nextIndex!==null){let s=this.nextIndex;this.nextIndex=null,s!==this.renderedIndex&&this.performUpdate(s)}}};var le=class extends f{static{a(this,"HtmlVdom")}beforeNode;afterNode;_html;observerId=0;constructor(e){super(),this._html=e}updateHtml(e){if(this.beforeNode){ae(this.beforeNode,this.afterNode);let t=this.beforeNode.ownerDocument.createElement("div");for(t.innerHTML=e;t.firstChild;)this.afterNode.parentElement.insertBefore(t.firstChild,this.afterNode)}}_render(e){let t="";this._html instanceof u?(t=this._html._get()??"",this.observerId=this._html._subscribe(this)):t=this._html,this.beforeNode=e.ownerDocument.createTextNode(""),this.afterNode=e.ownerDocument.createTextNode(""),e.appendChild(this.beforeNode),e.appendChild(this.afterNode),this.updateHtml(t??"")}_unrender(){if(this.beforeNode){let e=this.beforeNode.parentElement;ae(this.beforeNode,this.afterNode),e.removeChild(this.beforeNode),e.removeChild(this.afterNode),this.beforeNode=null,this.afterNode=null}this.observerId&&this._html instanceof u&&(this._html._unsubscribe(this.observerId),this.observerId=0)}_getNodes(){if(!this.beforeNode)return[];let e=[this.beforeNode],t=this.beforeNode.nextSibling;for(;t&&t!==this.afterNode;)e.push(t),t=t.nextSibling;return e.push(this.afterNode),e}_getLastChild(){return this}toString(){return this._html instanceof u?this._html._get():this._html}};var se=class{static{a(this,"ReactiveAttr")}elementVdom;attribute;constructor(e,t){this.elementVdom=e,this.attribute=t}};var ge=class{static{a(this,"Subscription")}boundReactive;item;active=!0;isQueued=!1;constructor(e,t){this.boundReactive=e,this.item=t}update(){if(!this.active)return;let e=this.boundReactive._get();if(this.item instanceof k)this.item.textNode.textContent=e??"";else if(this.item._isReactiveVdom)this.item.update(e);else if(this.item instanceof le)this.item.updateHtml(e);else if(this.item instanceof se)this.item.elementVdom.updateReactiveAttr(this.item.attribute,e);else if(this.item instanceof H)this.item.update();else{if(this.item instanceof ee)return this.item.updateList();this.item instanceof te?this.item.updateConditions():this.item instanceof Function&&this.item(e)}}};var K=[];var gt=7,As=gt+1,p=class{static{a(this,"Signal")}bindAs(e){let t=new u(this);return e.call&&e.apply?t._transform={display:e}:t._transform=e,t}bind(){return new u(this)}_value;key;subscribers=new Map;get isWritable(){return!0}constructor(){}get value(){let e=K[K.length-1];return e&&e.addDependency&&e.addDependency(this),this._value}set value(e){this.setValue(e)}getValue(){return this.value}setValue(e,t=_.Normal){this._value!==e&&(this._value=e,this.updater(this._value,t))}updater(e,t=_.Normal){for(let s of this.subscribers.values())s.sync?s.update():(!s.isQueued||t===_.Immediate)&&v.enqueue(s,t)}nextId=1;subscribe(e,t=!1){return new u(this)._subscribe(e,t)}_subscribe(e,t,s=!1){let i=this.nextId++,r=new ge(e,t);return r.sync=s,this.subscribers.set(i,r),i}unsubscribe(e){this.subscribers.has(e)&&(this.subscribers.get(e).active=!1,this.subscribers.delete(e))}_detachBinding(e){this.unsubscribe(e)}refresh(e=_.Normal){let t=this.value;this.updater(t,e)}updateObservers(e=_.Normal){this.refresh(e)}};var ne=class extends H{static{a(this,"AttributeVNode")}attr;value;target;observables={};constructor(e,t){super(),this.attr=e,this.value=t}render(e){this.target=e;for(let t in this.value){let s=this.value[t];if(s instanceof p&&(s=s.bind()),s&&s instanceof u){let i=s._subscribe(this);this.observables[i]=s}}this.update()}update(){if(!this.target)return;let e=[];for(let t in this.value){let s=this.value[t];s&&(s instanceof p&&(s=s.bind()),(!(s instanceof u)||s._get())&&e.push(t))}e.length>0?this.target.setAttribute(this.attr,e.join(" ")):this.target.removeAttribute(this.attr)}unrender(){this.target=null;for(let e in this.observables)this.observables[e]._unsubscribe(Number(e));this.observables={}}};var qe={color:"color|background-Color|border-Bottom-Color|border-Color|border-Left-Color|border-Right-Color|border-Top-Color|text-Decoration-Color|outline-Color|column-Rule-Color",length:"background-Size|block-Size|border-Bottom-Left-Radius|border-Bottom-Right-Radius|border-Bottom-Width|border-Left-Width|border-Radius|border-Right-Width|border-Top-Left-Radius|border-Top-Right-Radius|border-Top-Width|border-Width|bottom|gap|height|left|margin|margin-Bottom|margin-Left|margin-Right|margin-Top|max-Height|max-Width|min-Height|min-Width|padding|padding-Bottom|padding-Left|padding-Right|padding-Top|right|top|width|flex-Basis|font-Size|text-Indent|letter-Spacing|word-Spacing|border-Spacing|outline-Offset|outline-Width|column-Gap|column-Rule-Width|grid-Column-Gap|grid-Gap|grid-Row-Gap|column-Width|perspective|row-Gap",hybrid:"line-Height|border-Image-Width|border-Image-Outset|tab-Size|flex",url:"background-Image|border-Image|list-Style-Image|content|image-Orientation",transformation:"transform",filter:"filter|backdrop-Filter",time:"animation-Delay|animation-Direction|animation-Duration|transition-Duration|transition-Delay",misc:"appearance|aspect-Ratio|opacity|background|background-Attachment|background-Blend-Mode|background-Position|background-Repeat|background-Clip|background-Origin|border|border-Bottom|border-Bottom-Style|border-Image-Repeat|border-Image-Slice|border-Image-Source|border-Left|border-Left-Style|border-Right|border-Right-Style|border-Style|border-Top|border-Top-Style|box-Decoration-Break|box-Shadow|clear|clip|display|float|overflow|box|overflow-X|overflow-Y|position|visibility|vertical-Align|z-Index|align-Content|align-Items|align-Self|flex-Direction|flex-Flow|flex-Grow|flex-Shrink|flex-Wrap|grid|grid-Area|grid-Auto-Columns|grid-auto-Rows|grid-Column|grid-Column-End|grid-Column-Start|grid-Row|grid-Row-End|grid-Row-Start|grid-Template|grid-Template-Areas|grid-Template-Columns|grid-Template-Rows|justify-Content|order|hanging-Punctuation|hyphens|line-Break|overflow-Wrap|text-Align|text-Align-Last|text-Combine-Upright|text-Justify|text-Transform|white-Space|word-Break|word-Wrap|text-Decoration|text-Decoration-Line|text-Decoration-Style|text-Shadow|text-Underline-Position|font|font-Family|font-Feature-Settings|font-Kerning|font-Language-Override|font-Size-Adjust|font-Stretch|font-Style|font-Synthesis|font-Variant|font-Variant-Alternates|font-Variant-Caps|font-Variant-East-Asian|font-Variant-Ligatures|font-Variant-Numeric|font-Variant-Position|font-Weight|direction|text-Orientation|text-Combine-Upright|unicode-Bidi|user-Select|writing-Mode|border-Collapse|caption-Side|empty-Cells|table-Layout|counter-Increment|counter-Reset|list-Style|list-Style-Position|list-Style-Type|animation|animation-Fill-Mode|animation-Iteration-Count|animation-Name|animation-Play-State|animation-Timing-Function|animation-Timeline|container-Type|container-Name|backface-Visibility|perspective2d|perspective-Origin|transform-Origin|transform-Style|transition|transition-Property|transition-Timing-Function|box-Sizing|cursor|ime-Mode|nav-Down|nav-Index|nav-Left|nav-Right|nav-Up|outline|outline-Style|resize|text-Overflow|break-After|break-Before|break-Inside|column-Count|column-Fill|column-Rule|column-Rule-Style|column-Span|columns|widows|orphans|page-Break-After|page-Break-Before|page-Break-Inside|marks|quotes|image-Rendering|image-Resolution|object-Fit|object-Position|mask|mask-Type|mark|mark-After|mark-Before|phonemes|rest|rest-After|rest-Before|voice-Balance|voice-Duration|voice-Pitch|voice-Pitch-Range|voice-Rate|voice-Stress|voice-Volume|marquee-Direction|marquee-Play-Count|marquee-Speed|marquee-Style|pointer-Events"},yt="Cm|Mm|In|Px|Pt|Pc|Ch|Em|Ex|Lh|Rem|Vh|Vw|Vmin|Vmax|Cqw|Cqh|Cqi|Cqb|Cqmin|Cqmax|P".split("|"),bt="Ms|S".split("|"),_t="Deg|Grad|Rad|Turn".split("|"),wt="Hz|Khz".split("|"),de={};for(let n in qe){let e=qe[n].split("|");for(let t of e){let s=t.split("-").join("");switch(n){case"hybrid":case"length":{for(let i of yt)de[`${s}${i}`]={dotName:s,cssName:t.toLowerCase(),type:n,unit:i=="P"?"%":i.toLowerCase()};break}case"time":{for(let i of bt)de[`${s}${i}`]={dotName:s,cssName:t.toLowerCase(),type:n,unit:i.toLowerCase()};break}case"angle":{for(let i of _t)de[`${s}${i}`]={dotName:s,cssName:t.toLowerCase(),type:n,unit:i.toLowerCase()};break}case"frequency":{for(let i of wt)de[`${s}${i}`]={dotName:s,cssName:t.toLowerCase(),type:n,unit:i.toLowerCase()};break}default:break}de[s]={dotName:s,cssName:t.toLowerCase(),type:n,unit:void 0}}}var ie=de;var C=class{static{a(this,"CssFunctionBuilderVStyle")}funcs=[];propName;constructor(e){this.propName=e}toString(){let e="";for(let t of this.funcs){let s=Array.from(t.args).map(i=>{let r=i.v!==void 0?i.v:i,o=i.f||(l=>`${l}`);return r instanceof u?o(r._get()):r instanceof p?o(r.value):o(r).toString().split(" ").join(", ")}).join(", ");e+=`${t.func}(${s}) `}return e.trim()}appendFunction(e,t){return this.funcs.push({func:e,args:t}),this}};function b(n,e="px"){if(n=n||"0px",n instanceof u&&(n=n._get()),n instanceof p&&(n=n.value),n instanceof Array)return n.map(s=>b(s,e)).join(" ");isNaN(n)||(n=n+e);let t=n.trim().split(" ");if(t.length>1)return t.map(s=>b(s,e)).join(" ");{let s=Number(n.match(me)[0]),i=n.split(me)[1]||e;return`${s}${i}`}}a(b,"formatCssLength");function Ne(n){if(n=n||"0%",n instanceof u&&(n=n._get()),n instanceof p&&(n=n.value),n instanceof Array)return n.map(t=>Ne(t)).join(" ");let e=n.trim().split(" ");return e.length>1?e.map(t=>Ne(t)).join(" "):isNaN(n)?n:`${n}%`}a(Ne,"formatCssPercentage");function je(n){if(typeof n=="number"){let e=0,t=0,s=0,i=1;return s=n&255,n>>=8,t=n&255,n>>=8,e=n&255,`rgb(${e} ${t} ${s})`}else if(typeof n=="string")return n}a(je,"formatCssColor");function P(n){if(n=n||"0deg",n instanceof u&&(n=n._get()),n instanceof p&&(n=n.value),n instanceof Array)return n.map(t=>P(t)).join(" ");isNaN(n)||(n=`${n}deg`);let e=n.trim().split(" ");if(e.length>1)return e.map(t=>P(t)).join(" ");{let t=Number(n.match(me)[0]),s=n.split(me)[1]||"deg";return`${t}${s}`}}a(P,"formatCssAngle");var B=class extends C{static{a(this,"FilterVStyle")}blur(e){return this.appendFunction("blur",[{v:e,f:b}])}brightness(e){return this.appendFunction("brightness",[{v:e,f:Ne}])}contrast(e){return this.appendFunction("contrast",[{v:e,f:b}])}dropShadow(e,t,s,i){return this.appendFunction("drop-shadow",[{v:e,f:b},{v:t,f:b},{v:s,f:b},{v:i,f:je}])}grayscale(e){return this.appendFunction("grayscale",[{v:e,f:b}])}hueRotate(e){return this.appendFunction("hue-rotate",[{v:e,f:b}])}invert(e){return this.appendFunction("invert",[{v:e,f:b}])}opacity(e){return this.appendFunction("opacity",[{v:e,f:b}])}sepia(e){return this.appendFunction("sepia",[{v:e,f:b}])}saturate(e){return this.appendFunction("saturate",[{v:e,f:b}])}};var M=class extends C{static{a(this,"TransformVStyle")}matrix3d(e,t,s,i,r,o,l,d,h,c,m,g,I,$,kt,Lt){return this.appendFunction("matrix3d",arguments)}matrix(e,t,s,i,r,o){return this.appendFunction("matrix",arguments)}translate(e,t){return arguments.length==1?this.appendFunction("translate",[{f:b,v:e}]):this.appendFunction("translate",[{f:b,v:e},{f:b,v:t}])}translate3d(e,t,s){return this.appendFunction("translate3d",[{f:b,v:e},{f:b,v:t},{f:b,v:s}])}translateX(e){return this.appendFunction("translateX",[{f:b,v:e}])}translateY(e){return this.appendFunction("translateY",[{f:b,v:e}])}translateZ(e){return this.appendFunction("translateZ",[{f:b,v:e}])}scale(e,t){return this.appendFunction("scale",[e,t??1])}scale3d(e,t,s){return this.appendFunction("scale3d",[e,t,s])}scaleX(e){return this.appendFunction("scaleX",[e])}scaleY(e){return this.appendFunction("scaleY",[e])}scaleZ(e){return this.appendFunction("scaleZ",[e])}rotate(e){return this.appendFunction("rotate",[{f:P,v:e}])}rotate3d(e,t,s,i){return this.appendFunction("rotate3d",[e,t,s,{f:P,v:i}])}rotate3dDeg(e,t,s,i){return this.rotate3d(e,t,s,i)}rotate3dRad(e,t,s,i){return this.rotate3d(e,t,s,`${i}rad`)}rotate3dGrad(e,t,s,i){return this.rotate3d(e,t,s,`${i}grad`)}rotate3dTurn(e,t,s,i){return this.rotate3d(e,t,s,`${i}turn`)}rotateX(e){return this.appendFunction("rotateX",[{f:P,v:e}])}rotateY(e){return this.appendFunction("rotateY",[{f:P,v:e}])}rotateZ(e){return this.appendFunction("rotateZ",[{f:P,v:e}])}skew(e,t){return arguments.length==1?this.appendFunction("skew",[{f:P,v:e}]):this.appendFunction("skew",[{f:P,v:e},{f:P,v:t}])}skewX(e){return this.appendFunction("skewX",[{f:P,v:e}])}skewY(e){return this.appendFunction("skewY",[{f:P,v:e}])}perspective(e){return this.appendFunction("perspective",[{f:b,v:e}])}};var S=class n{static{a(this,"BaseVStyle")}_isBase=!1;props=[];onUpdate;setProp(e,t){return this._isBase?new n().setProp(e,t):(this.props.push({prop:e,value:t}),this.onUpdate&&this.onUpdate(),this)}_setOnUpdate(e){this.onUpdate=e}variable(e,t){return e.startsWith("--")||(e="--"+e),this.setProp(e,t)}v(e){return e.startsWith("--")||(e="--"+e),`var(${e})`}getProps(){return this.props}};for(let n in ie)S.prototype[n]=function(e){return this.setProp(n,e)};var A=class extends H{static{a(this,"StyleVNode")}target;document;shadowRoot;styleSource;styleElement;observables=[];observableIds=[];isQueued=!1;updateSubscription={active:!0,update:a(()=>{this.isQueued=!1,this.applyStyles()},"update")};constructor(e){super(),this.styleSource=e,this.styleSource instanceof S&&this.styleSource._setOnUpdate(()=>this.update()),this.extractObservables()}extractObservables(){let e=this.styleSource instanceof S?this.styleSource.getProps():this.styleSource;if(Array.isArray(e))for(let t=0;t<e.length;t++){let s=e[t];this.processValue(s.prop,s.value,i=>s.value=i)}else for(let t in e)this.processValue(t,e[t],s=>e[t]=s)}processValue(e,t,s){if(!this.tryExtractObservable(t)&&typeof t=="object"&&t!==null&&!(t instanceof C)){let i;switch(e){case"filter":{i=new B(e);break}case"transform":{i=new M(e);break}}if(i){let r=Array.isArray(t)?t:[t];for(let o of r)for(let l in o){let d=o[l];if(this.tryExtractObservable(d),Array.isArray(d))for(let c of d)this.tryExtractObservable(c);let h=l.replace(/_\d+$/,"");typeof i[h]=="function"&&(Array.isArray(d)?i[h](...d):i[h](d))}s(i)}}}tryExtractObservable(e){if(e instanceof u||e instanceof p){if(this.observables.indexOf(e)===-1&&(this.observables.push(e),this.target)){let t=e.subscribe(()=>this.update());this.observableIds.push(t)}return!0}return!1}render(e,t=window.document,s){this.target=e,this.document=t,this.shadowRoot=s;for(let i of this.observables){let r=i.subscribe(()=>this.update());this.observableIds.push(r)}typeof e=="string"&&(this.styleElement=this.document.createElement("style"),this.shadowRoot?this.shadowRoot.appendChild(this.styleElement):this.document.head.appendChild(this.styleElement)),this.applyStyles()}update(){this.isQueued||(this.isQueued=!0,v.enqueue(this.updateSubscription,_.Normal))}applyStyles(){if(this.target)if(typeof this.target=="string")this.styleElement&&(this.styleElement.textContent=`${this.target} { ${this.getStyleString()} }`);else{this.extractObservables();let e=this.styleSource instanceof S?this.styleSource.getProps():this.styleSource;if(Array.isArray(e))for(let t of e){let s=t.value instanceof u?t.value._get():t.value instanceof p?t.value.value:t.value;this.applySingleStyle(t.prop,s)}else for(let t in e){let s=e[t]instanceof u?e[t]._get():e[t]instanceof p?e[t].value:e[t];this.applySingleStyle(t,s)}}}applySingleStyle(e,t){let s;if(t instanceof C)s=t.toString();else if(typeof t=="object"&&t!==null&&(e==="transform"||e==="filter")){let l=e==="transform"?new M(e):new B(e);this.applyObjectToBuilder(l,t),s=l.toString()}else s=t;let i=e,r,o=ie[e];o&&(i=o.cssName,r=o.unit,(o.type==="length"||o.type==="hybrid")&&typeof s=="number"?o.type==="hybrid"&&r===void 0||(s=b(s,r)):o.unit&&typeof s=="number"&&(s=`${s}${o.unit}`)),this.target instanceof HTMLElement&&this.target.style.setProperty(i,`${s}`)}getStyleString(){let e="",t=this.styleSource instanceof S?this.styleSource.getProps():this.styleSource;if(Array.isArray(t))for(let s of t)e+=this.formatSingleStyle(s.prop,s.value);else for(let s in t)e+=this.formatSingleStyle(s,t[s]);return e}applyObjectToBuilder(e,t){let s=Array.isArray(t)?t:[t];for(let i of s)for(let r in i){let o=i[r],l=r.replace(/_\d+$/,"");typeof e[l]=="function"&&(Array.isArray(o)?e[l](...o):e[l](o))}}formatSingleStyle(e,t){let s=t instanceof u?t._get():t instanceof p?t.value:t;if(s instanceof C)s=s.toString();else if(typeof s=="object"&&s!==null&&(e==="transform"||e==="filter")){let l=e==="transform"?new M(e):new B(e);this.applyObjectToBuilder(l,s),s=l.toString()}let i=e,r,o=ie[e];return o&&(i=o.cssName,r=o.unit,(o.type==="length"||o.type==="hybrid")&&typeof s=="number"?o.type==="hybrid"&&r===void 0||(s=b(s,r)):o.unit&&typeof s=="number"&&(s=`${s}${o.unit}`)),`${i}: ${s}; `}unrender(){for(let e=0;e<this.observableIds.length;e++){let t=this.observableIds[e],s=this.observables[e];s instanceof u?s._unsubscribe(t):s.unsubscribe(t)}this.observableIds=[],this.observables=[],this.styleElement&&(this.styleElement.remove(),this.styleElement=null),this.target=null,this.updateSubscription.active=!1}toString(){return typeof this.target=="string"?`${this.target} { ${this.getStyleString()} }`:this.getStyleString()}};var ye=class{static{a(this,"SyntheticEvent")}nativeEvent;target;currentTarget;type;timeStamp;defaultPrevented;detail;_propagationStopped=!1;_immediatePropagationStopped=!1;constructor(e){this.nativeEvent=e,this.target=e.target,this.currentTarget=e.currentTarget,this.type=e.type,this.timeStamp=e.timeStamp,this.defaultPrevented=e.defaultPrevented,this.detail=e.detail}preventDefault(){this.defaultPrevented=!0,this.nativeEvent.preventDefault()}stopPropagation(){this._propagationStopped=!0,this.nativeEvent.stopPropagation()}stopImmediatePropagation(){this._immediatePropagationStopped=!0,this._propagationStopped=!0,this.nativeEvent.stopImmediatePropagation()}isPropagationStopped(){return this._propagationStopped}isImmediatePropagationStopped(){return this._immediatePropagationStopped}};var q=class n{static{a(this,"EventManager")}static managers=new Map;static getForDocument(e){let t=this.managers.get(e);return t||(t=new n(e),this.managers.set(e,t)),t}document;listeners=new WeakMap;activeEventTypes=new Set;constructor(e){this.document=e}addListener(e,t,s,i=[]){let r=this.listeners.get(e);r||(r=new Map,this.listeners.set(e,r));let o=r.get(t);o||(o=[],r.set(t,o)),o.push({handler:s,modifiers:i}),this.ensureGlobalListener(t)}removeListener(e,t,s){let i=this.listeners.get(e);if(!i)return;let r=i.get(t);if(!r)return;let o=r.findIndex(l=>l.handler===s);o!==-1&&r.splice(o,1),r.length===0&&i.delete(t)}ensureGlobalListener(e){if(this.activeEventTypes.has(e))return;let t=e==="focus"||e==="blur";this.document.addEventListener(e,s=>{this.dispatchEvent(e,s)},t),this.activeEventTypes.add(e)}dispatchEvent(e,t){let s=t.composedPath();if(!s||s.length===0){s=[];let r=t.target;for(;r;)s.push(r),r=r.parentNode||r.host}let i=new ye(t);for(let r of s){if(r===this.document||r===window)continue;let o=this.listeners.get(r);if(!o)continue;let l=o.get(e);if(l){i.currentTarget=r;for(let{handler:d,modifiers:h}of[...l])if(!(h.includes("self")&&t.target!==r)&&(h.includes("stop")&&i.stopPropagation(),h.includes("prevent")&&i.preventDefault(),d(i),h.includes("once")&&this.removeListener(r,e,d),i.isImmediatePropagationStopped()))break;if(i.isPropagationStopped())break}}}};var L=class extends f{static{a(this,"ElementVdom")}_children=null;get children(){return this._children||(this._children=new w(this._dot),this._children._parent=this),this._children}set children(e){this._children=e}element;tag=null;attributes={};events=[];attributeObserverIds=[];childBuilders=[];attrVNodes=[];styleVNodes=[];ref;inputListener;compositionStartListener;compositionEndListener;manualInputAllowed=!0;isComposing=!1;activeBindings={};lastSyncedValues={};constructor(e,t){super(e),this.tag=t}_render(e){this._isRendered=!0,this.element=e.ownerDocument.createElement(this.tag),this.element[O]=this,this.ref&&(typeof this.ref=="function"?this.ref(this.element):this.ref.value=this.element),e.appendChild(this.element),this._children&&this._children._render(this.element);for(let t=0;t<this.events.length;t++){let s=this.events[t];this.renderEvent(s.name,s.callback,s.modifiers)}this.attributes.type!==void 0&&this.renderAttr("type",this.attributes.type,this.element);for(let t in this.attributes)t!=="type"&&this.renderAttr(t,this.attributes[t],this.element);this._onEnterHook&&this._onEnterHook(this.element)}_unrender(){if(!this._isRendered||(this._isRendered=!1,this._children&&this._children._unrender(),!this.element))return;let e=q.getForDocument(this.element.ownerDocument);this.inputListener&&(e.removeListener(this.element,"input",this.inputListener),this.inputListener=null),this.compositionStartListener&&(e.removeListener(this.element,"compositionstart",this.compositionStartListener),this.compositionStartListener=null),this.compositionEndListener&&(e.removeListener(this.element,"compositionend",this.compositionEndListener),this.compositionEndListener=null);for(let t=0;t<this.events.length;t++){let s=this.events[t];e.removeListener(this.element,s.name.toLowerCase(),s.callback)}this.element.parentNode?.removeChild(this.element);for(let t=0;t<this.childBuilders.length;t++)this.childBuilders[t]._unrender();this.childBuilders.length=0;for(let t=0;t<this.attrVNodes.length;t++)this.attrVNodes[t].unrender();this.attrVNodes.length=0;for(let t=0;t<this.styleVNodes.length;t++)this.styleVNodes[t].unrender();this.styleVNodes.length=0;for(let t=0;t<this.attributeObserverIds.length;t++){let s=this.attributeObserverIds[t];s.observable._unsubscribe(s.id)}this.attributeObserverIds.length=0,this.ref&&(typeof this.ref=="function"?this.ref(null):this.ref.value=null),this.element=null}_getNodes(){return this.element?[this.element]:[]}_getLastChild(){return this}toString(){return this.element?this.element.outerHTML:super.toString()}setAttr(e,t){e=(e??"").toLowerCase();let s=e;if(e=="bind"){let r=this.attributes.type;r instanceof u?r=r._get():r instanceof p&&(r=r.value);let o=typeof r=="string"?r.toLowerCase():null;s=this.tag.toLowerCase()=="input"&&(o=="checkbox"||o=="radio")?"checked":"value"}let i=this.attributes[e];if(i instanceof A){i.unrender();let r=this.styleVNodes.indexOf(i);r!==-1&&this.styleVNodes.splice(r,1)}if(i instanceof ne){i.unrender();let r=this.attrVNodes.indexOf(i);r!==-1&&this.attrVNodes.splice(r,1)}for(let r=0;r<this.attributeObserverIds.length;r++){let o=this.attributeObserverIds[r];if(o.attr===e||o.attr===s){o.observable._unsubscribe(o.id),this.attributeObserverIds.splice(r,1);break}}if(t&&typeof t=="object"&&!(t instanceof Array||t instanceof u||t instanceof p||t instanceof S))switch(e){case"style":{t=new A(t);break}case"ref":break;default:{t=new ne(e,t);break}}if(typeof t=="function"&&e==="style"){let r=new S;t(r),t=new A(r)}t instanceof S&&e==="style"&&(t=new A(t)),this.attributes[e]=t,this.element&&this.renderAttr(e,t,this.element)}updateReactiveAttr(e,t){this.element&&this.renderAttr((e??"").toLowerCase(),t,this.element)}renderAttr(e,t,s,i=!1){if(e=="bind"){let r=this.attributes.type;r instanceof u?r=r._get():r instanceof p&&(r=r.value);let o=typeof r=="string"?r.toLowerCase():null;e=this.tag.toLowerCase()=="input"&&(o=="checkbox"||o=="radio")?"checked":"value",i=!0}if(e=="ref")this.ref=t,this.element&&(typeof this.ref=="function"?this.ref(this.element):this.ref.value=this.element);else if(typeof t=="string"||typeof t=="number")e=="value"&&(this.tag.toLowerCase()=="input"||this.tag.toLowerCase()=="textarea"||this.tag.toLowerCase()=="select")?(s.value=t??"",this.lastSyncedValues[e]=t??""):s.setAttribute(e,`${t}`);else if(typeof t=="boolean"||t==null||t==null)e=="checked"&&this.tag.toLowerCase()=="input"?(s.checked=!!t,this.lastSyncedValues[e]=!!t):e=="selected"&&this.tag.toLowerCase()=="option"?s.selected=!!t:e=="value"&&(this.tag.toLowerCase()=="input"||this.tag.toLowerCase()=="textarea"||this.tag.toLowerCase()=="select")&&(s.value=t??"",this.lastSyncedValues[e]=t??""),t?s.setAttribute(e,`${t}`):s.removeAttribute(e);else if(t instanceof Array)s.setAttribute(e,t.join(" "));else if(t instanceof u){if(this.renderAttr(e,t._get(),s,i),!this.attributeObserverIds.some(r=>r.attr===e&&r.observable===t)){let r=t._subscribe(new se(this,e));this.attributeObserverIds.push({id:r,observable:t,attr:e})}if((e=="value"||e=="checked")&&t.isWritable&&i&&(this.activeBindings[e]=t,!this.inputListener)){this.inputListener=o=>{if(!this.isComposing)try{let l=o.target.type==="checkbox"||o.target.type==="radio"?"checked":"value",d=this.activeBindings[l];if(!d)return;let h=this.element[l],c=d._get(),m=this.lastSyncedValues[l];c==m&&h!=m&&d._set(h),this.lastSyncedValues[l]=d._get()}catch(l){console.error("CAUGHT ERROR: "+l.message)}},this.compositionStartListener=()=>{this.isComposing=!0},this.compositionEndListener=o=>{this.isComposing=!1,this.inputListener(o)};let r=q.getForDocument(this.element.ownerDocument);r.addListener(this.element,"input",this.inputListener),r.addListener(this.element,"compositionstart",this.compositionStartListener),r.addListener(this.element,"compositionend",this.compositionEndListener)}}else t instanceof ne?(t.render(s),this.attrVNodes.push(t)):t instanceof A&&(t.render(s),this.styleVNodes.push(t))}addEventListener(e,t,s=[]){this.events.some(i=>i.name===e&&i.callback===t)||(this.events.push({name:e,callback:t,modifiers:s}),this.element&&this.renderEvent(e,t,s))}renderEvent(e,t,s=[]){q.getForDocument(this.element.ownerDocument).addListener(this.element,e.toLowerCase(),t,s)}};var w=class extends f{static{a(this,"ContainerVdom")}_children=[];_parent=null;constructor(e){super(e)}_addChild(e){return this._children.push(e),this._parent&&this._parent instanceof L&&this._parent.element&&e._render(this._parent.element),this}_render(e){this._isRendered=!0;for(let t=0;t<this._children.length;t++)this._children[t]._render(e)}_unrender(){if(this._isRendered){this._isRendered=!1;for(let e=0;e<this._children.length;e++)this._children[e]._unrender()}}_getNodes(){let e=[];for(let t=0;t<this._children.length;t++)e.push(...this._children[t]._getNodes());return e}_getLastChild(){return this._children[this._children.length-1]||null}};var j=class extends p{static{a(this,"Ref")}constructor(){return super(),this._value=null,new Proxy(this,{get(e,t,s){if(t in e)return Reflect.get(e,t,s);let i=e.value;if(i&&typeof i[t]=="function")return(...r)=>i[t].apply(i,r)}})}get element(){return this.value}async ready(){return this.value?this.value:new Promise(e=>{let t=this.subscribe(s=>{s&&(this.unsubscribe(t),e(s))})})}};var Ue={onAbort:1,onBlur:1,onChange:1,onInput:1,onCanPlay:1,onCantPlayThrough:1,onClick:1,onCopy:1,onContextMenu:1,onCueChange:1,onCut:1,onDblClick:1,onDrag:1,onDragEnd:1,onDragEnter:1,onDragLeave:1,onDragOver:1,onDragStart:1,onDrop:1,onDurationChange:1,onEmptied:1,onEnded:1,onError:1,onFocus:1,onHashChange:1,onInvalid:1,onKeyDown:1,onKeyPress:1,onKeyUp:1,onLoad:1,onLoadedData:1,onLoadedMetadata:1,onLoadStart:1,onMouseDown:1,onMouseEnter:1,onMouseLeave:1,onMouseMove:1,onMouseOut:1,onMouseOver:1,onMouseUp:1,onPointerCancel:1,onPointerDown:1,onPointerEnter:1,onPointerLeave:1,onPointerMove:1,onPointerOut:1,onPointerOver:1,onPointerUp:1,onTouchStart:1,onTouchEnd:1,onTouchCancel:1,onTouchMove:1,onMouseWheel:1,onOffline:1,onOnline:1,onPageHide:1,onPagePaste:1,onPageShow:1,onPause:1,onPlay:1,onPlaying:1,onPopState:1,onProgress:1,onRateChange:1,onReset:1,onResize:1,onScroll:1,onSearch:1,onSeeked:1,onSeeking:1,onSelect:1,onStalled:1,onStorage:1,onSubmit:1,onSuspend:1,onTimeUpdate:1,onToggle:1,onUnload:1,onVolumeChange:1,onWaiting:1,onWheel:1};var Ae=a(n=>n instanceof w||n instanceof f||n?._root||n?._children||typeof n=="object"&&n?.build||n instanceof p||n instanceof u||typeof n=="string"||typeof n=="number"||typeof n=="boolean"||Array.isArray(n),"isContent"),U=a((n,e,t)=>{let s=e instanceof L?e.children:e;if(Array.isArray(t))for(let i=0;i<t.length;i++)U(n,e,t[i]);else if(Array.isArray(t?._children)){let i=t._children;if(i&&i.length>0)for(let r=0;r<i.length;r++)s._addChild(i[r])}else if(t?._root)U(n,e,t._root);else if(t instanceof f)s._addChild(t);else if(typeof t=="object"&&t?.build)s.mount(t);else if(t!=null){let i=t;i instanceof p&&(i=i.bind()),i instanceof u?s._addChild(new he(n,i)):s._addChild(new k(i))}},"applyContent"),vt=a((n,e)=>{for(let t in e){let s=e[t];s instanceof p&&!(s instanceof j)&&(s=s.bind());let i=t,r=[];if(t.includes(".")){let l=t.split(".");i=l[0],r=l.slice(1)}if(Ue[i]||i.startsWith("on")&&i[2]&&i[2]===i[2].toUpperCase()){if(typeof e[t]!="function")throw new Error(`Value of event attribute ${t} must be a function.`);n.addEventListener(i.substring(2).toLowerCase(),s,r)}else n.setAttr(t,s)}},"applyAttributes"),Pe=a((n,e,t)=>{let s=new L(n,e);for(let i=0;i<t.length;i++){let r=t[i];Ae(r)?U(n,s,r):r&&typeof r=="object"&&vt(s,r)}return s},"createElement");var ze=new WeakMap;function ce(n,e){let t="";if(n instanceof e.defaultView?.CSSStyleSheet)return n;if(typeof n=="string")t=n;else if(typeof n=="function"){let l=n(null);typeof l=="string"&&(t=l)}let s=ze.get(e);if(s||(s=new Map,ze.set(e,s)),s.has(t))return s.get(t);let i=e.defaultView?.CSSStyleSheet;if(i)try{let o=new i;if(o.replaceSync)return o.replaceSync(t),s.set(t,o),o}catch{}let r=e.createElement("style");return r.innerHTML=t,r}a(ce,"renderStylesheet");var Ie=[],F=a(()=>Ie[Ie.length-1]||null,"getCurrentComponent"),x=a(n=>Ie.push(n),"pushComponent"),E=a(()=>Ie.pop(),"popComponent");var V=class extends p{static{a(this,"Computed")}getter;dependencies=new Map;isQueued=!1;isEvaluating=!1;active=!0;dirty=!0;error=null;get isWritable(){return!1}updateSubscription={active:!0,update:a(()=>{this.isQueued=!1,this.dirty&&this._update()},"update")};constructor(e){super(),this.getter=e,this._update()}get value(){if(this.isEvaluating)throw new Error("Circular dependency detected in computed signal.");if(this.dirty&&this._update(),this.error)throw this.error;return super.value}addDependency(e){this.active&&(this.newDependencies.has(e)||this.newDependencies.add(e))}requestUpdate(){this.active&&(this.dirty=!0,this.isQueued||(this.isQueued=!0,v.enqueue(this.updateSubscription,_.Normal)))}newDependencies=new Set;_update(){if(!this.active)return;if(this.isEvaluating)throw new Error("Circular dependency detected in computed signal.");this.isEvaluating=!0,this.dirty=!1,this.error=null,this.newDependencies.clear(),K.push(this);let e,t=!1;try{e=this.getter()}catch(i){this.error=i,t=!0}finally{K.pop(),this.isEvaluating=!1}t||this.setValue(e);let s=[];for(let[i,r]of this.dependencies)this.newDependencies.has(i)||(i.unsubscribe(r),s.push(i));for(let i of s)this.dependencies.delete(i);for(let i of this.newDependencies)if(!this.dependencies.has(i)){let r=i.subscribe(()=>this.requestUpdate(),!0);this.dependencies.set(i,r)}}dispose(){this.active=!1;for(let[e,t]of this.dependencies)e.unsubscribe(t);this.dependencies.clear()}};var be=class{static{a(this,"KeyframesBuilder")}sheet;steps=[];constructor(e){this.sheet=e}step(e,t){let s=new S;return t(s),this.steps.push({selector:e,style:s}),this}from(e){return this.step("from",e)}to(e){return this.step("to",e)}at(e,t){let s=typeof e=="number"?`${e}%`:e;return this.step(s,t)}toString(e=""){return this.steps.map(t=>`${e}${t.selector} { ${this.sheet.formatPropsForBlock(t.style)} }`).join(`
|
|
2
2
|
`)}};var z=class n{static{a(this,"StyleSheetBuilder")}rules=[];theme=null;ghostVars=[];varCounter=0;getGhostVars(){return this.ghostVars}setTheme(e){return this.theme=e,this}template(e,...t){return new V(()=>{let s="";for(let i=0;i<e.length;i++)if(s+=e[i],i<t.length){let r=t[i];r instanceof p||r instanceof u?s+=r instanceof u?r._get():r.value:s+=r}return s})}class(e,t){return this.rule(`.${e}`,t)}rule(e,t){let s=new S;return t(s),this.rules.push({type:"rule",selector:e,style:s}),this}selector(e,t){return this.rule(e,t)}media(e,t){let s=new n;return t(s),this.rules.push({type:"media",condition:e,builder:s}),this}container(e,t){let s=new n;return t(s),this.rules.push({type:"container",condition:e,builder:s}),this}supports(e,t){let s=new n;return t(s),this.rules.push({type:"supports",condition:e,builder:s}),this}keyframes(e,t){let s=new be(this);return t(s),this.rules.push({type:"keyframes",name:e,builder:s}),this}v(e){return e.startsWith("--")||(e="--"+e),`var(${e})`}applyObjectToBuilder(e,t){let s=Array.isArray(t)?t:[t];for(let i of s)for(let r in i){let o=i[r],l=r.replace(/_\d+$/,"");typeof e[l]=="function"&&(Array.isArray(o)?e[l](...o):e[l](o))}}formatPropsForBlock(e){return e.getProps().map(t=>{let s=ie[t.prop],i=t.prop,r=t.value;if(typeof r=="object"&&r!==null&&!(r instanceof C)&&!(r instanceof p)&&!(r instanceof u)){let o;switch(t.prop){case"filter":{o=new B(t.prop);break}case"transform":{o=new M(t.prop);break}}o&&(this.applyObjectToBuilder(o,r),r=o)}if(r instanceof p||r instanceof u||r instanceof C){let o=r instanceof p||r instanceof u;if(r instanceof C)for(let l of r.funcs){for(let d of l.args)if(d.v instanceof p||d.v instanceof u||d instanceof p||d instanceof u){o=!0;break}if(o)break}if(o){let l=`--dh-v${++this.varCounter}`,d=r,h=r;(t.prop==="transform"||t.prop==="filter")&&!(d instanceof C)?h=new V(()=>{let c=d instanceof u?d._get():d.value;if(typeof c=="object"&&c!==null){let m=t.prop==="transform"?new M(t.prop):new B(t.prop);return this.applyObjectToBuilder(m,c),m.toString()}return c}):s&&s.unit&&!(d instanceof C)?h=new V(()=>{let c=d instanceof u?d._get():d.value;return typeof c=="number"?`${c}${s.unit}`:c}):s&&(s.type==="length"||s.type==="hybrid")&&!(d instanceof C)?h=new V(()=>{let c=d instanceof u?d._get():d.value;return typeof c=="number"?b(c,s.unit):c}):d instanceof C&&(h=new V(()=>d.toString())),this.ghostVars.push({name:l,value:h}),r=`var(${l})`}}return s&&(i=s.cssName,(s.type==="length"||s.type==="hybrid")&&typeof t.value=="number"?s.type==="hybrid"&&s.unit===void 0||(r=b(t.value,s.unit)):s.unit&&typeof t.value=="number"&&(r=`${t.value}${s.unit}`)),`${i}: ${r};`}).join(" ")}toString(e=""){return this.rules.map(t=>{if(t.type==="media")return`${e}@media ${t.condition} {
|
|
3
3
|
${t.builder.toString(e+" ")}
|
|
4
4
|
${e}}`;if(t.type==="container")return`${e}@container ${t.condition} {
|