essor 0.0.13-beta.6 → 0.0.13-beta.7

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/essor.cjs.js CHANGED
@@ -1,18 +1,18 @@
1
1
  'use strict';
2
2
 
3
3
  /**
4
- * essor v0.0.13-beta.6
4
+ * essor v0.0.13-beta.7
5
5
  * (c) 2023-Present jiangxd <jiangxd2016@gmail.com>
6
6
  * @license MIT
7
7
  **/
8
- var we="0.0.13-beta.6";var E=e=>e!==null&&typeof e=="object";var g=Array.isArray;function G(e){return typeof e=="string"}function nt(e){return e===null}function Me(e){return typeof e=="symbol"}function B(e){return R.call(e)==="[object Set]"}function Q(e){return R.call(e)==="[object WeakMap]"}function Y(e){return R.call(e)==="[object WeakSet]"}function K(e){return R.call(e)==="[object Map]"}function ke(e){return e==null}var m=e=>typeof e=="function";function ee(e){return e===!1||e===null||e===void 0}var xe=e=>["string","number","boolean","symbol","undefined"].includes(typeof e)||nt(e);var te=e=>R.call(e)==="[object Object]";function ne(e){return G(e)?!Number.isNaN(Number(e)):!1}var R=Object.prototype.toString;var rt=Object.prototype.hasOwnProperty,q=(e,t)=>rt.call(e,t);function re(e){return g(e)?e.flat():[e]}var M=(e,t)=>e!==t&&(e===e||t===t),ie=Function.prototype;function k(e,t){return G(e)?e.indexOf(t)===0:!1}function Te(e){return e.replaceAll(/["&'<>]/g,t=>{switch(t){case"&":return "&amp;";case"<":return "&lt;";case">":return "&gt;";case'"':return "&quot;";case"'":return "&#039;";default:return t}})}function P(e,t){return g(t)?t.includes(e):m(t)?t(e):!1}var Oe=e=>e.replaceAll(/[A-Z]+/g,(t,n)=>`${n>0?"-":""}${t.toLocaleLowerCase()}`);var $e=e=>e.charAt(0).toUpperCase()+e.slice(1);function se(e,...t){console.warn.apply(console,[`[Essor warn]: ${e}`].concat(t));}var it=Object.defineProperty,je=Object.getOwnPropertySymbols,st=Object.prototype.hasOwnProperty,ot=Object.prototype.propertyIsEnumerable,Re=(e,t,n)=>t in e?it(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,V=(e,t)=>{for(var n in t||(t={}))st.call(t,n)&&Re(e,n,t[n]);if(je)for(var n of je(t))ot.call(t,n)&&Re(e,n,t[n]);return e},le=[],ae=[],Pe=Promise.resolve(),ce=!1;function pe(e){return e?Pe.then(e):Pe}function lt(e){le.includes(e)||(le.push(e),ze());}function ze(){ce||(ce=!0,pe(ut));}function at(e){ct(e,ae);}function ct(e,t){t.includes(e)||(t.push(e),ze());}function ut(){ce=!1,ft();let e;for(;e=le.shift();)e&&e();}function ft(){for(;ae.length>0;){let e=ae.shift();e&&e();}}function ht(e,t){return t==="sync"?()=>e():t==="pre"?()=>at(e):()=>{pe(()=>lt(e));}}var y=null,ue=new WeakMap,oe=new WeakMap,L=Symbol(""),I=Symbol(""),Ae=Symbol(""),Le=Symbol(""),fe=Symbol(""),v=Symbol(""),x=Symbol(""),he=!1,U=new Set;function h(e,t){if(!y)return;let n=ue.get(e);n||(n=new Map,ue.set(e,n));let r=n.get(t);r||(r=new Set,n.set(t,r)),y&&r.add(y);}function b(e,t){let n=ue.get(e);if(!n)return;let r=n.get(t);r&&r.forEach(i=>{if(q(i,"active")&&!i.active){r.delete(i);return}he?U.add(i):i();});}var me=class{constructor(e,t=!1){this.__signal=!0,this.__shallow=t,this.__value=e;}get value(){return h(this,Ae),E(this.__value)&&!this.__shallow?D(this.__value):this.__value}set value(e){p(e)&&(e=e.peek()),M(e,this.__value)&&(this.__value=e,b(this,Ae));}peek(){return this.__value}};function ge(e){return p(e)?e:new me(e)}function Ut(e){return new me(e,!0)}function We(e){return new me(e,!0)}function p(e){return !!(e&&e!=null&&e.__signal)}var dt=class{constructor(e){this.fn=e,this.__computed=!0;let t=y;y=this.run.bind(this),this.__value=this.fn(),y=t;}peek(){return this.__value}run(){let e=this.fn();M(e,this.__value)&&(this.__value=e,b(this,Le));}get value(){return h(this,Le),this.__value}};function pt(e){return new dt(e)}function Ge(e){return !!(e&&e.__computed)}function T(e,t={}){let{flush:n="pre",onTrack:r,onTrigger:i}=t;function s(){let l=y;y=s.init?s:s.scheduler,e(),i&&i(),y=l;}let o=ht(s,n);return s.scheduler=o,s.init=!0,s.active=!0,r&&r(),s(),()=>{s.active=!1,y=null;}}function Xt(e,t){return !e||!E(e)?e:Object.entries(e).reduce((n,[r,i])=>(n[r]=P(r,t)||p(i)?i:ge(i),n),{})}function f(e){return e&&(H(e)?e[I]:p(e)?e.peek():g(e)?e.map(t=>f(t)):te(e)?Object.fromEntries(Object.entries(e).map(([t,n])=>[t,f(n)])):e)}function H(e){return !!(e&&typeof e=="object"&&e[L])}function ve(e,t){return D(e,!1,t)}function Vt(e,t){return D(e,!0,t)}var mt=(e,t)=>({get(n,r,i){if(r===L)return !0;if(r===I)return n;let s=Reflect.get(n,r,i),o=p(s)?s.value:s;return P(r,t)?o:(h(n,r),E(o)&&!e?D(o):o)},set(n,r,i,s){if(P(r,t))return Reflect.set(n,r,i,s),!0;let o=Reflect.get(n,r,s);p(o)&&(o=o.value),p(i)&&(i=i.value);let l=Reflect.set(n,r,i,s);return M(i,o)&&b(n,r),l},deleteProperty(n,r){let i=Reflect.get(n,r),s=Reflect.deleteProperty(n,r);return i!==void 0&&b(n,r),s}}),Ie=gt();function gt(){let e={};return ["includes","indexOf","lastIndexOf"].forEach(t=>{e[t]=function(...n){let r=f(this);for(let s=0,o=this.length;s<o;s++)h(r,`${s}`);let i=r[t](...n);return i===-1||i===!1?r[t](...n):i};}),["push","pop","shift","unshift","splice","sort","reverse"].forEach(t=>{e[t]=function(...n){let r=f(this),i=r[t].apply(this,n);return b(r,fe),i};}),["forEach","map","filter","reduce","reduceRight","some","every","find","findIndex","findLast","findLastIndex","entries","keys","values"].forEach(t=>{e[t]=function(...n){let r=f(this);return h(r,fe),r[t].apply(this,n)};}),e}var vt=(e,t)=>({get(n,r,i){if(r===L)return !0;if(r===I)return n;if(Ie.hasOwnProperty(r))return Reflect.get(Ie,r,i);let s=Reflect.get(n,r,i);return P(r,t)?s:(ne(r)&&h(n,r),h(n,"length"),E(s)&&!e?D(s):s)},set(n,r,i,s){let o=Reflect.get(n,r,s),l=Reflect.set(n,r,i,s);return M(i,o)&&(ne(r)&&b(n,r),(r==="length"||!o)&&b(n,"length")),l}}),bt={get(e,t){return t===L?!0:t===I?e:((t===Symbol.iterator||t==="size")&&h(e,v),Reflect.get(q(He,t)&&t in e?He:e,t,e))}},yt={get(e,t){return t===L?!0:t===I?e:Reflect.get(q(De,t)&&t in e?De:e,t,e)}},He={get(e){let t=f(this);return h(t,v),t.get(e)},set(e,t){let n=f(this),r=n.set(e,t);return b(n,v),r},add(e){let t=f(this),n=t.add(e);return b(t,v),n},has(e){let t=f(this);return h(t,v),t.has(e)},delete(e){let t=f(this),n=t.has(e),r=t.delete(e);return n&&b(t,v),r},clear(){let e=f(this),t=e.size>0,n=e.clear();return t&&b(e,v),n},forEach(e,t){let n=f(this);h(n,v),n.forEach((r,i)=>{e.call(t,r,i,n);});},get size(){let e=f(this);return h(e,v),e.size},keys(){let e=f(this);return h(e,v),e.keys()},values(){let e=f(this);return h(e,v),e.values()},entries(){let e=f(this);return h(e,v),e.entries()},[Symbol.iterator](){let e=f(this);return h(e,v),e[Symbol.iterator]()}},De={get(e){let t=f(this);return h(t,x),t.get(e)},set(e,t){let n=f(this),r=n.set(e,t);return b(n,x),r},add(e){let t=f(this),n=t.add(e);return b(t,x),n},has(e){let t=f(this);return h(t,x),t.has(e)},delete(e){let t=f(this),n=t.delete(e);return b(t,x),n}};function D(e,t=!1,n){if(!E(e)||H(e))return e;if(oe.has(e))return oe.get(e);let r;g(e)?(h(e,fe),r=vt(t,n)):B(e)||K(e)?(h(e,v),r=bt):Y(e)||Q(e)?(h(e,x),r=yt):r=mt(t,n);let i=new Proxy(e,r);return oe.set(e,i),i}function Jt(e){H(e)&&(Q(e)||Y(e)||Nt(()=>{g(e)?e.length=0:B(e)||K(e)?e.clear():E(e)&&Object.keys(e).forEach(t=>{delete e[t];});}));}function Nt(e){try{he=!0,e();}finally{he=!1,St();}}function St(){U.size>0&&(U.forEach(e=>e()),U.clear());}function Zt(e,t,n){return Ct(e,t,n)}var Fe=void 0,X,de=!1;function _t(e){X=e,de||(de=!0,pe(Et));}function Et(){X==null||X(),X=null,de=!1;}function Ct(e,t,{deep:n,immediate:r}={}){let i,s=g(e);if(p(e)||Ge(e))i=()=>e.value;else if(H(e))i=()=>V({},e);else if(s)i=()=>e.map(a=>wt(a));else if(m(e))i=e;else return se("Invalid source type",e),ie;if(t&&n){let a=i,d=n===!0?1/0:n;i=()=>A(a(),d);}let o=s?Array.from({length:e.length}).fill(Fe):Fe,l=!1,u=()=>{let a=i();M(a,o)&&(r&&t&&(t(a,o),o=a),l&&t&&_t(()=>{t(a,o),o=a;}),!l&&(o=a));},c=T(u,{flush:"sync"});return l=!0,r&&u(),c}function wt(e){return p(e)||Ge(e)?e.value:H(e)?V({},e):m(e)?e():(se("Invalid source",e),ie)}function A(e,t=1/0,n){if(t<=0||!E(e)||(n=n||new Set,n.has(e)))return e;if(n.add(e),t--,p(e))A(e.value,t,n);else if(g(e))for(let r of e)A(r,t,n);else if(B(e)||K(e))e.forEach(r=>{A(r,t,n);});else if(te(e))for(let r in e)A(e[r],t,n);return e}function Mt(e){let{state:t,getters:n,actions:r}=e,i=V({},t!=null?t:{}),s=ve(t!=null?t:{}),o=[],l=[],u=V({state:s},{patch$(c){Object.assign(s,c),o.forEach(a=>a(s)),l.forEach(a=>a(s));},subscribe$(c){o.push(c);},unsubscribe$(c){let a=o.indexOf(c);a!==-1&&o.splice(a,1);},onAction$(c){l.push(c);},reset$(){Object.assign(s,i);}});for(let c in n){let a=n[c];a&&Object.defineProperty(u,c,{get(){return pt(a.bind(s,s)).value},enumerable:!0,configurable:!0});}for(let c in r){let a=r[c];a&&(u[c]=a.bind(s));}return u}function Qt(e){return function(){return Mt(e)}}var Ve=new Map,kt=class{constructor(){this.renderMode=0;}get isSSG(){return this.renderMode===1}get isSSR(){return this.renderMode===2}get isClient(){return this.renderMode===0}setSSR(){this.renderMode=2;}setSSG(){this.renderMode=1;}setClient(){this.renderMode=0;}},S=new kt;function xt(e,t){Ve.set(e,{index:t});}function Tt(e){return Ve.get(e).index}var be=class F{constructor(){this.hooks={mounted:new Set,destroy:new Set};}addEventListener(){}removeEventListener(){}addHook(t,n){var r;(r=this.hooks[t])==null||r.add(n);}getContext(t){return F.context[t]}setContext(t,n){F.context[t]=n;}initRef(){F.ref=this;}removeRef(){F.ref=null;}clearHooks(){Object.values(this.hooks).forEach(t=>t.clear());}};be.ref=null;be.context={};var w=be;function ye(e){return e instanceof Ne}var O=1,Ne=class extends w{constructor(e,t={},n){if(super(),this.template=e,this.props=t,this.key=n,xt(e,O),g(this.template)){let r=" __PLACEHOLDER__ ",s=this.template.join(r).replaceAll(/(<[^>]+>)|([^<]+)/g,(o,l,u)=>l?l.includes("data-ci")?o:l.replace(/<\s*([\da-z]+)(\s[^>]*)?>/i,(c,a,d)=>`<${a} data-ci="${O}"${d||""}>`):u&&u.replace(r,"").trim()?`<!--0-${O}-->${u}<!$>`:o);this.template=s.split(r);}}mount(){this.initRef();let e=this.render();return this.removeRef(),e}render(){if(m(this.template)){let t=this.template(this.props);return ye(t)?t.mount():String(t)}let e=this.template;return Object.keys(this.props).forEach(t=>{let n=this.props[t],r=n.children;Ot(n);let i=e.findIndex(s=>s.includes(`data-hk="${t}"`));r&&r.forEach(([s])=>{O++;let o=Je(s,n);this.template[i]+=o;}),this.template[i].replaceAll(`data-hk="${t}"`,`data-hk="${t}" ${$t(n)}`);}),e.join("")}};function Ot(e){Object.entries(e).forEach(([t,n])=>{t==="children"||m(n)?delete e[t]:p(n)&&(e[t]=n.value);});}function $t(e){return Object.entries(e).filter(([t,n])=>t!=="children"&&!m(n)).map(([t,n])=>`${t}="${Te(String(n))}"`).join(" ")}function Je(e,t){if(m(e))return Je(e(t),t);if(p(e))return `<!--1-${O}-->${e.value}<!$>`;if(ye(e)){let n=e.mount();return m(n)?n(t):Ye(n)}else return `<!--1-${O}-->${e}<!$>`}var Ze="area,base,br,col,embed,hr,img,input,link,meta,param,source,track,wbr".split(","),jt="a,abbr,acronym,address,applet,area,article,aside,audio,b,base,basefont,bdi,bdo,bgsound,big,blink,blockquote,body,br,button,canvas,caption,center,cite,code,col,colgroup,command,content,data,datalist,dd,del,details,dfn,dialog,dir,div,dl,dt,em,embed,fieldset,figcaption,figure,font,footer,form,frame,frameset,h1,h2,h3,h4,h5,h6,head,header,hgroup,hr,html,i,iframe,image,img,input,ins,kbd,keygen,label,legend,li,link,listing,main,map,mark,marquee,menu,menuitem,meta,meter,nav,nobr,noframes,noscript,object,ol,optgroup,option,output,p,param,picture,plaintext,pre,progress,q,rb,rp,rt,rtc,ruby,s,samp,script,section,select,shadow,small,source,spacer,span,strike,strong,style,sub,summary,sup,table,tbody,td,template,textarea,tfoot,th,thead,time,title,tr,track,tt,u,ul,var,video,wbr,xmp".split(",");function Be(e){if(_(e)||e instanceof Node||ye(e))return e;let t=ee(e)?"":String(e);return document.createTextNode(t)}function C(e,t,n=null){let r=_(n)?n.firstChild:n,i=S.isSSR;_(t)?t.mount(e,r):r&&!i?r.before(t):i||e.append(t);}function z(e){_(e)?e.unmount():e.parentNode&&e.remove();}function Qe(e,t,n){C(e,t,n),z(n);}function Ke(e,t,n){if(t==="class"){typeof n=="string"?e.className=n:g(n)?e.className=n.join(" "):n&&typeof n=="object"&&(e.className=Object.entries(n).reduce((r,[i,s])=>r+(s?` ${i}`:""),"").trim());return}if(t==="style"){if(typeof n=="string")e.style.cssText=n;else if(n&&typeof n=="object"){let r=n;Object.keys(r).forEach(i=>{e.style.setProperty(Oe(i),String(r[i]));});}return}ee(n)?e.removeAttribute(t):n===!0?e.setAttribute(t,""):e instanceof HTMLInputElement&&t==="value"?e.value=String(n):e.setAttribute(t,String(n));}function Rt(e,t){if(e instanceof HTMLInputElement)switch(e.type){case"checkbox":return N(e,"change",()=>{t(!!e.checked);});case"date":return N(e,"change",()=>{t(e.value?e.value:"");});case"file":return N(e,"change",()=>{e.files&&t(e.files);});case"number":return N(e,"input",()=>{let n=Number.parseFloat(e.value);t(Number.isNaN(n)?"":String(n));});case"radio":return N(e,"change",()=>{t(e.checked?e.value:"");});case"text":return N(e,"input",()=>{t(e.value);})}if(e instanceof HTMLSelectElement)return N(e,"change",()=>{t(e.value);});if(e instanceof HTMLTextAreaElement)return N(e,"input",()=>{t(e.value);})}Promise.resolve();function N(e,t,n){return e.addEventListener(t,n),()=>e.removeEventListener(t,n)}function Pt(e){let t=[],n=[],r=/<\/?([\da-z-]+)([^>]*)>/gi,i=0;for(;;){let s=r.exec(e);if(!s)break;let[o,l]=s,u=o[1]==="/";if(n.push(e.slice(i,s.index)),i=s.index+o.length,u){for(;t.length>0&&t[t.length-1]!==l;){let c=t.pop();c&&n.push(`</${c}>`);}t.length>0&&t.pop();}else Ze.includes(l)||t.push(l);n.push(o);}for(n.push(e.slice(i));t.length>0;){let s=t.pop();s&&n.push(`</${s}>`);}return n.join("")}function At(e){return jt.includes(e)}function Lt(e){return Ze.includes(e)?`<${e}/>`:`<${e}></${e}>`}function Ye(e){return p(e)?e.value:e}var Se=class extends w{constructor(e,t,n){super(),this.template=e,this.props=t,this.key=n,this.emitter=new Set,this.rootNode=null,this.trackMap=new Map,this.proxyProps=t?ve(t,r=>k(r,"on")||k(r,"update")||r==="children"):{};}get firstChild(){var e,t;return (t=(e=this.rootNode)==null?void 0:e.firstChild)!=null?t:null}get isConnected(){var e,t;return (t=(e=this.rootNode)==null?void 0:e.isConnected)!=null?t:!1}mount(e,t){var n,r,i,s;if(!m(this.template))throw new Error("Template must be a function");if(this.isConnected)return (r=(n=this.rootNode)==null?void 0:n.mount(e,t))!=null?r:[];this.initRef(),this.rootNode=this.template(this.proxyProps);let o=(s=(i=this.rootNode)==null?void 0:i.mount(e,t))!=null?s:[];return this.hooks.mounted.forEach(l=>l()),this.patchProps(this.props),this.removeRef(),o}unmount(){var e;this.hooks.destroy.forEach(t=>t()),this.clearHooks(),(e=this.rootNode)==null||e.unmount(),this.rootNode=null,this.proxyProps={};for(let t of this.emitter)t();this.emitter.clear();}inheritNode(e){Object.assign(this.proxyProps,e.proxyProps),this.rootNode=e.rootNode,this.trackMap=e.trackMap,this.hooks=e.hooks;let t=this.props;this.props=e.props,this.patchProps(t);}getNodeTrack(e){let t=this.trackMap.get(e);return t||(t={cleanup:()=>{}},this.trackMap.set(e,t)),t.cleanup(),t}patchProps(e){var t,n;if(e){for(let[r,i]of Object.entries(e))if(k(r,"on")&&((t=this.rootNode)!=null&&t.firstChild)){let s=r.slice(2).toLowerCase(),o=N(this.rootNode.nodes[0],s,i);this.emitter.add(o);}else if(r==="ref")i.value=(n=this.rootNode)==null?void 0:n.firstChild;else if(k(r,"update"))this.props[r]=Ye(i);else if(r!=="children"){let s=this.getNodeTrack(r);s.cleanup=T(()=>{this.proxyProps[r]=m(i)?i():i;});}this.props=e;}}};function It(e,t,n,r){let i=new Map,s=Array.from(t.values());if(s.length&&n.length===0)return Ht(e,s,r),i;let o=[],l=Ft(n),u=0;for(let[c,a]of n.entries()){let d=s[u],j=$(d,c);for(;d&&!l.has(j);)z(d),t.delete(j),d=s[++u],j=$(d,c);let Ee=$(a,c),Z=t.get(Ee);if(Z&&(a=Dt(e,Z,a)),d)if(d===Z)u++;else {let Ce=document.createComment("");C(e,Ce,d),o.push([Ce,a]);}else C(e,a,r);i.set(Ee,a);}return o.forEach(([c,a])=>{Qe(e,a,c);}),t.forEach((c,a)=>{c.isConnected&&!i.has(a)&&z(c);}),i}function Ht(e,t,n){if(e.childNodes.length===t.length+(n?1:0))e.innerHTML="",n&&C(e,n);else {let r=document.createRange(),i=t[0],s=_(i)?i.firstChild:i;r.setStartBefore(s),n?r.setEndBefore(n):r.setEndAfter(e),r.deleteContents();}t.forEach(r=>{_(r)&&r.unmount();});}function Dt(e,t,n){return t===n?t:_(t)&&_(n)&&t.template===n.template?(n.inheritNode(t),n):t instanceof Text&&n instanceof Text?(t.textContent!==n.textContent&&(t.textContent=n.textContent),t):(Qe(e,n,t),n)}function Ft(e){let t=new Map;for(let[n,r]of e.entries()){let i=$(r,n);t.set(i,r);}return t}function $(e,t){if(_(e)){let n=e.key;if(n!=null)return String(n)}return `_$${t}$`}var et=class{constructor(e,t,n){this.template=e,this.props=t,this.key=n,this.treeMap=new Map,this.mounted=!1,this.nodes=[],this.trackMap=new Map,this.bindValueKeys=[],this.parent=null,this.key||(this.key=t==null?void 0:t.key),S.isSSR&&(this.componentIndex=Tt(this.template));}addEventListener(){}removeEventListener(){}get firstChild(){var e;return (e=this.nodes[0])!=null?e:null}get isConnected(){return this.mounted}mount(e,t){var n;if(this.parent=e,this.isConnected)return this.nodes.forEach(s=>C(e,s,t)),this.nodes;g(this.template)&&(this.template=tt(this.template.join("")));let r=this.template.content.cloneNode(!0),i=r.firstChild;return (n=i==null?void 0:i.hasAttribute)!=null&&n.call(i,"_svg_")&&(i.remove(),i==null||i.childNodes.forEach(s=>{r.append(s);})),this.nodes=Array.from(r.childNodes),S.isSSR?this.mapSSGNodeTree(e):this.mapNodeTree(e,r),C(e,r,t),this.patchProps(this.props),this.mounted=!0,this.nodes}unmount(){this.trackMap.forEach(e=>{var t;(t=e.cleanup)==null||t.call(e);}),this.trackMap.clear(),this.treeMap.clear(),this.nodes.forEach(e=>z(e)),!this.template.innerHTML&&!this.nodes.length&&this.props&&this.props[0].children.forEach(e=>{var t;xe(e)?(t=this.parent)==null||t.childNodes.forEach(n=>{var r;n.nodeType===Node.TEXT_NODE&&n.textContent===`${e}`&&((r=this.parent)==null||r.removeChild(n));}):z(e);}),this.nodes=[],this.mounted=!1;}patchProps(e){e&&(Object.entries(e).forEach(([t,n])=>{let r=Number(t),i=this.treeMap.get(r);i&&this.patchProp(t,i,n,r===0);}),this.props=e);}inheritNode(e){this.mounted=e.mounted,this.nodes=e.nodes,this.trackMap=e.trackMap,this.treeMap=e.treeMap;let t=this.props;this.props=e.props,this.patchProps(t);}mapSSGNodeTree(e){this.treeMap.set(0,e);let t=n=>{var r;if(n.nodeType!==Node.DOCUMENT_FRAGMENT_NODE){if(n.nodeType===Node.COMMENT_NODE){let[s,o]=((r=n.textContent)==null?void 0:r.split("-"))||"";if(+s==0&&+o===this.componentIndex){let l=n.nextSibling;this.treeMap.set(+o,l);}}else if(n.nodeType!==Node.TEXT_NODE){let{ci:s="-1",hk:o}=(n==null?void 0:n.dataset)||{};o&&+s===this.componentIndex&&this.treeMap.set(+o,n);}}let i=n.firstChild;for(;i;)t(i),i=i.nextSibling;};t(e);}mapNodeTree(e,t){let n=1;this.treeMap.set(0,e);let r=i=>{i.nodeType!==Node.DOCUMENT_FRAGMENT_NODE&&this.treeMap.set(n++,i);let s=i.firstChild;for(;s;)r(s),s=s.nextSibling;};r(t);}getNodeTrack(e,t,n){var r;let i=this.trackMap.get(e);return i||(i={cleanup:()=>{}},t&&(i.lastNodes=new Map),n&&(i.isRoot=!0),this.trackMap.set(e,i)),(r=i.cleanup)==null||r.call(i),i}patchProp(e,t,n,r){for(let i in n)if(i==="children"&&n.children)if(g(n.children))n.children.filter(Boolean).forEach((s,o)=>{var l;let[u,c]=g(s)?s:[s,null],a=ke(c)?null:(l=this.treeMap.get(c))!=null?l:null,d=`${e}:${i}:${o}`,j=this.getNodeTrack(d,!0,r);qe(j,t,u,a);});else {let s=`${e}:${i}:0`,o=this.getNodeTrack(s,!0,r);qe(o,t,n.children,null);}else if(i==="ref")n[i].value=t;else if(k(i,"on")){let s=i.slice(2).toLocaleLowerCase(),o=this.getNodeTrack(`${e}:${i}`),l=n[i];o.cleanup=N(t,s,l);}else {let s=`update${$e(i)}`;if(this.bindValueKeys.includes(i))break;n[s]&&this.bindValueKeys.push(s);let o=this.getNodeTrack(`${e}:${i}`),l=n[i],u=p(l)?l:ge(l);Xe(o,t,i,u.value);let c=T(()=>{u.value=p(l)?l.value:l,Xe(o,t,i,u.value);}),a;n[s]&&!zt(i)&&(a=Rt(t,d=>{n[s](d);})),o.cleanup=()=>{c&&c(),a&&a();};}}};function qe(e,t,n,r){m(n)?e.cleanup=T(()=>{let i=re(n()).map(Be);S.isSSR?e.lastNodes=Ue(t,i,r):e.lastNodes=It(t,e.lastNodes,i,r),console.log(e.lastNodes,i);}):re(n).forEach((i,s)=>{let o=Be(i),l=$(o,s);S.isSSR?e.lastNodes=Ue(t,[o],r):(e.lastNodes.set(l,o),C(t,o,r));});}function Ue(e,t,n){let r=new Map,i=Array.from(e.childNodes).filter(s=>{var o,l;return s.nodeType===Node.TEXT_NODE&&((o=s.previousSibling)==null?void 0:o.nodeType)===Node.COMMENT_NODE&&((l=s.nextSibling)==null?void 0:l.nodeType)===Node.COMMENT_NODE});return t.forEach((s,o)=>{let l=$(s,o);s.nodeType===Node.TEXT_NODE?i.forEach(u=>{s.textContent===u.textContent&&e.replaceChild(s,u);}):C(e,s,n),r.set(l,s);}),r}function Xe(e,t,n,r){let i=t;i.setAttribute&&(m(r)?e.cleanup=T(()=>{Ke(i,n,r());}):Ke(i,n,r));}function _e(e,t,n){return G(e)&&(At(e)?(e=Lt(e),t={1:t}):e===""&&(t={0:t}),e=tt(e)),m(e)?new Se(e,t,n):new et(e,t,n)}function zt(e){return e instanceof Se}function _(e){return e instanceof Se||e instanceof et}function tt(e){let t=document.createElement("template");return t.innerHTML=Pt(e),t}function on(e){return _e("",{children:Array.isArray(e.children)?e.children.filter(Boolean):[e.children]})}function ln(e){var t;J("onMounted"),(t=w.ref)==null||t.addHook("mounted",e);}function an(e){var t;J("onDestroy"),(t=w.ref)==null||t.addHook("destroy",e);}function J(e,t){w.ref||console.error(`"${e}"(key: ${Me(t)?t.toString():t}) can only be called within the component function body
8
+ var we="0.0.13-beta.7";var E=e=>e!==null&&typeof e=="object";var g=Array.isArray;function G(e){return typeof e=="string"}function nt(e){return e===null}function Me(e){return typeof e=="symbol"}function B(e){return R.call(e)==="[object Set]"}function Q(e){return R.call(e)==="[object WeakMap]"}function Y(e){return R.call(e)==="[object WeakSet]"}function K(e){return R.call(e)==="[object Map]"}function ke(e){return e==null}var m=e=>typeof e=="function";function ee(e){return e===!1||e===null||e===void 0}var xe=e=>["string","number","boolean","symbol","undefined"].includes(typeof e)||nt(e);var te=e=>R.call(e)==="[object Object]";function ne(e){return G(e)?!Number.isNaN(Number(e)):!1}var R=Object.prototype.toString;var rt=Object.prototype.hasOwnProperty,q=(e,t)=>rt.call(e,t);function re(e){return g(e)?e.flat():[e]}var M=(e,t)=>e!==t&&(e===e||t===t),ie=Function.prototype;function k(e,t){return G(e)?e.indexOf(t)===0:!1}function Te(e){return e.replaceAll(/["&'<>]/g,t=>{switch(t){case"&":return "&amp;";case"<":return "&lt;";case">":return "&gt;";case'"':return "&quot;";case"'":return "&#039;";default:return t}})}function P(e,t){return g(t)?t.includes(e):m(t)?t(e):!1}var Oe=e=>e.replaceAll(/[A-Z]+/g,(t,n)=>`${n>0?"-":""}${t.toLocaleLowerCase()}`);var $e=e=>e.charAt(0).toUpperCase()+e.slice(1);function se(e,...t){console.warn.apply(console,[`[Essor warn]: ${e}`].concat(t));}var it=Object.defineProperty,je=Object.getOwnPropertySymbols,st=Object.prototype.hasOwnProperty,ot=Object.prototype.propertyIsEnumerable,Re=(e,t,n)=>t in e?it(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,V=(e,t)=>{for(var n in t||(t={}))st.call(t,n)&&Re(e,n,t[n]);if(je)for(var n of je(t))ot.call(t,n)&&Re(e,n,t[n]);return e},le=[],ae=[],Pe=Promise.resolve(),ce=!1;function pe(e){return e?Pe.then(e):Pe}function lt(e){le.includes(e)||(le.push(e),ze());}function ze(){ce||(ce=!0,pe(ut));}function at(e){ct(e,ae);}function ct(e,t){t.includes(e)||(t.push(e),ze());}function ut(){ce=!1,ft();let e;for(;e=le.shift();)e&&e();}function ft(){for(;ae.length>0;){let e=ae.shift();e&&e();}}function ht(e,t){return t==="sync"?()=>e():t==="pre"?()=>at(e):()=>{pe(()=>lt(e));}}var y=null,ue=new WeakMap,oe=new WeakMap,L=Symbol(""),I=Symbol(""),Ae=Symbol(""),Le=Symbol(""),fe=Symbol(""),v=Symbol(""),x=Symbol(""),he=!1,U=new Set;function h(e,t){if(!y)return;let n=ue.get(e);n||(n=new Map,ue.set(e,n));let r=n.get(t);r||(r=new Set,n.set(t,r)),y&&r.add(y);}function b(e,t){let n=ue.get(e);if(!n)return;let r=n.get(t);r&&r.forEach(i=>{if(q(i,"active")&&!i.active){r.delete(i);return}he?U.add(i):i();});}var me=class{constructor(e,t=!1){this.__signal=!0,this.__shallow=t,this.__value=e;}get value(){return h(this,Ae),E(this.__value)&&!this.__shallow?D(this.__value):this.__value}set value(e){p(e)&&(e=e.peek()),M(e,this.__value)&&(this.__value=e,b(this,Ae));}peek(){return this.__value}};function ge(e){return p(e)?e:new me(e)}function Ut(e){return new me(e,!0)}function We(e){return new me(e,!0)}function p(e){return !!(e&&e!=null&&e.__signal)}var dt=class{constructor(e){this.fn=e,this.__computed=!0;let t=y;y=this.run.bind(this),this.__value=this.fn(),y=t;}peek(){return this.__value}run(){let e=this.fn();M(e,this.__value)&&(this.__value=e,b(this,Le));}get value(){return h(this,Le),this.__value}};function pt(e){return new dt(e)}function Ge(e){return !!(e&&e.__computed)}function T(e,t={}){let{flush:n="pre",onTrack:r,onTrigger:i}=t;function s(){let l=y;y=s.init?s:s.scheduler,e(),i&&i(),y=l;}let o=ht(s,n);return s.scheduler=o,s.init=!0,s.active=!0,r&&r(),s(),()=>{s.active=!1,y=null;}}function Xt(e,t){return !e||!E(e)?e:Object.entries(e).reduce((n,[r,i])=>(n[r]=P(r,t)||p(i)?i:ge(i),n),{})}function f(e){return e&&(H(e)?e[I]:p(e)?e.peek():g(e)?e.map(t=>f(t)):te(e)?Object.fromEntries(Object.entries(e).map(([t,n])=>[t,f(n)])):e)}function H(e){return !!(e&&typeof e=="object"&&e[L])}function ve(e,t){return D(e,!1,t)}function Vt(e,t){return D(e,!0,t)}var mt=(e,t)=>({get(n,r,i){if(r===L)return !0;if(r===I)return n;let s=Reflect.get(n,r,i),o=p(s)?s.value:s;return P(r,t)?o:(h(n,r),E(o)&&!e?D(o):o)},set(n,r,i,s){if(P(r,t))return Reflect.set(n,r,i,s),!0;let o=Reflect.get(n,r,s);p(o)&&(o=o.value),p(i)&&(i=i.value);let l=Reflect.set(n,r,i,s);return M(i,o)&&b(n,r),l},deleteProperty(n,r){let i=Reflect.get(n,r),s=Reflect.deleteProperty(n,r);return i!==void 0&&b(n,r),s}}),Ie=gt();function gt(){let e={};return ["includes","indexOf","lastIndexOf"].forEach(t=>{e[t]=function(...n){let r=f(this);for(let s=0,o=this.length;s<o;s++)h(r,`${s}`);let i=r[t](...n);return i===-1||i===!1?r[t](...n):i};}),["push","pop","shift","unshift","splice","sort","reverse"].forEach(t=>{e[t]=function(...n){let r=f(this),i=r[t].apply(this,n);return b(r,fe),i};}),["forEach","map","filter","reduce","reduceRight","some","every","find","findIndex","findLast","findLastIndex","entries","keys","values"].forEach(t=>{e[t]=function(...n){let r=f(this);return h(r,fe),r[t].apply(this,n)};}),e}var vt=(e,t)=>({get(n,r,i){if(r===L)return !0;if(r===I)return n;if(Ie.hasOwnProperty(r))return Reflect.get(Ie,r,i);let s=Reflect.get(n,r,i);return P(r,t)?s:(ne(r)&&h(n,r),h(n,"length"),E(s)&&!e?D(s):s)},set(n,r,i,s){let o=Reflect.get(n,r,s),l=Reflect.set(n,r,i,s);return M(i,o)&&(ne(r)&&b(n,r),(r==="length"||!o)&&b(n,"length")),l}}),bt={get(e,t){return t===L?!0:t===I?e:((t===Symbol.iterator||t==="size")&&h(e,v),Reflect.get(q(He,t)&&t in e?He:e,t,e))}},yt={get(e,t){return t===L?!0:t===I?e:Reflect.get(q(De,t)&&t in e?De:e,t,e)}},He={get(e){let t=f(this);return h(t,v),t.get(e)},set(e,t){let n=f(this),r=n.set(e,t);return b(n,v),r},add(e){let t=f(this),n=t.add(e);return b(t,v),n},has(e){let t=f(this);return h(t,v),t.has(e)},delete(e){let t=f(this),n=t.has(e),r=t.delete(e);return n&&b(t,v),r},clear(){let e=f(this),t=e.size>0,n=e.clear();return t&&b(e,v),n},forEach(e,t){let n=f(this);h(n,v),n.forEach((r,i)=>{e.call(t,r,i,n);});},get size(){let e=f(this);return h(e,v),e.size},keys(){let e=f(this);return h(e,v),e.keys()},values(){let e=f(this);return h(e,v),e.values()},entries(){let e=f(this);return h(e,v),e.entries()},[Symbol.iterator](){let e=f(this);return h(e,v),e[Symbol.iterator]()}},De={get(e){let t=f(this);return h(t,x),t.get(e)},set(e,t){let n=f(this),r=n.set(e,t);return b(n,x),r},add(e){let t=f(this),n=t.add(e);return b(t,x),n},has(e){let t=f(this);return h(t,x),t.has(e)},delete(e){let t=f(this),n=t.delete(e);return b(t,x),n}};function D(e,t=!1,n){if(!E(e)||H(e))return e;if(oe.has(e))return oe.get(e);let r;g(e)?(h(e,fe),r=vt(t,n)):B(e)||K(e)?(h(e,v),r=bt):Y(e)||Q(e)?(h(e,x),r=yt):r=mt(t,n);let i=new Proxy(e,r);return oe.set(e,i),i}function Jt(e){H(e)&&(Q(e)||Y(e)||Nt(()=>{g(e)?e.length=0:B(e)||K(e)?e.clear():E(e)&&Object.keys(e).forEach(t=>{delete e[t];});}));}function Nt(e){try{he=!0,e();}finally{he=!1,St();}}function St(){U.size>0&&(U.forEach(e=>e()),U.clear());}function Zt(e,t,n){return Ct(e,t,n)}var Fe=void 0,X,de=!1;function _t(e){X=e,de||(de=!0,pe(Et));}function Et(){X==null||X(),X=null,de=!1;}function Ct(e,t,{deep:n,immediate:r}={}){let i,s=g(e);if(p(e)||Ge(e))i=()=>e.value;else if(H(e))i=()=>V({},e);else if(s)i=()=>e.map(a=>wt(a));else if(m(e))i=e;else return se("Invalid source type",e),ie;if(t&&n){let a=i,d=n===!0?1/0:n;i=()=>A(a(),d);}let o=s?Array.from({length:e.length}).fill(Fe):Fe,l=!1,u=()=>{let a=i();M(a,o)&&(r&&t&&(t(a,o),o=a),l&&t&&_t(()=>{t(a,o),o=a;}),!l&&(o=a));},c=T(u,{flush:"sync"});return l=!0,r&&u(),c}function wt(e){return p(e)||Ge(e)?e.value:H(e)?V({},e):m(e)?e():(se("Invalid source",e),ie)}function A(e,t=1/0,n){if(t<=0||!E(e)||(n=n||new Set,n.has(e)))return e;if(n.add(e),t--,p(e))A(e.value,t,n);else if(g(e))for(let r of e)A(r,t,n);else if(B(e)||K(e))e.forEach(r=>{A(r,t,n);});else if(te(e))for(let r in e)A(e[r],t,n);return e}function Mt(e){let{state:t,getters:n,actions:r}=e,i=V({},t!=null?t:{}),s=ve(t!=null?t:{}),o=[],l=[],u=V({state:s},{patch$(c){Object.assign(s,c),o.forEach(a=>a(s)),l.forEach(a=>a(s));},subscribe$(c){o.push(c);},unsubscribe$(c){let a=o.indexOf(c);a!==-1&&o.splice(a,1);},onAction$(c){l.push(c);},reset$(){Object.assign(s,i);}});for(let c in n){let a=n[c];a&&Object.defineProperty(u,c,{get(){return pt(a.bind(s,s)).value},enumerable:!0,configurable:!0});}for(let c in r){let a=r[c];a&&(u[c]=a.bind(s));}return u}function Qt(e){return function(){return Mt(e)}}var Ve=new Map,kt=class{constructor(){this.renderMode=0;}get isSSG(){return this.renderMode===1}get isSSR(){return this.renderMode===2}get isClient(){return this.renderMode===0}setSSR(){this.renderMode=2;}setSSG(){this.renderMode=1;}setClient(){this.renderMode=0;}},S=new kt;function xt(e,t){Ve.set(e,{index:t});}function Tt(e){return Ve.get(e).index}var be=class F{constructor(){this.hooks={mounted:new Set,destroy:new Set};}addEventListener(){}removeEventListener(){}addHook(t,n){var r;(r=this.hooks[t])==null||r.add(n);}getContext(t){return F.context[t]}setContext(t,n){F.context[t]=n;}initRef(){F.ref=this;}removeRef(){F.ref=null;}clearHooks(){Object.values(this.hooks).forEach(t=>t.clear());}};be.ref=null;be.context={};var w=be;function ye(e){return e instanceof Ne}var O=1,Ne=class extends w{constructor(e,t={},n){if(super(),this.template=e,this.props=t,this.key=n,xt(e,O),g(this.template)){let r=" __PLACEHOLDER__ ",s=this.template.join(r).replaceAll(/(<[^>]+>)|([^<]+)/g,(o,l,u)=>l?l.includes("data-ci")?o:l.replace(/<\s*([\da-z]+)(\s[^>]*)?>/i,(c,a,d)=>`<${a} data-ci="${O}"${d||""}>`):u&&u.replace(r,"").trim()?`<!--0-${O}-->${u}<!$>`:o);this.template=s.split(r);}}mount(){this.initRef();let e=this.render();return this.removeRef(),e}render(){if(m(this.template)){let t=this.template(this.props);return ye(t)?t.mount():String(t)}let e=this.template;return Object.keys(this.props).forEach(t=>{let n=this.props[t],r=n.children;Ot(n);let i=e.findIndex(s=>s.includes(`data-hk="${t}"`));r&&r.forEach(([s])=>{O++;let o=Je(s,n);this.template[i]+=o;}),this.template[i].replaceAll(`data-hk="${t}"`,`data-hk="${t}" ${$t(n)}`);}),e.join("")}};function Ot(e){Object.entries(e).forEach(([t,n])=>{t==="children"||m(n)?delete e[t]:p(n)&&(e[t]=n.value);});}function $t(e){return Object.entries(e).filter(([t,n])=>t!=="children"&&!m(n)).map(([t,n])=>`${t}="${Te(String(n))}"`).join(" ")}function Je(e,t){if(m(e))return Je(e(t),t);if(p(e))return `<!--1-${O}-->${e.value}<!$>`;if(ye(e)){let n=e.mount();return m(n)?n(t):Ye(n)}else return `<!--1-${O}-->${e}<!$>`}var Ze="area,base,br,col,embed,hr,img,input,link,meta,param,source,track,wbr".split(","),jt="a,abbr,acronym,address,applet,area,article,aside,audio,b,base,basefont,bdi,bdo,bgsound,big,blink,blockquote,body,br,button,canvas,caption,center,cite,code,col,colgroup,command,content,data,datalist,dd,del,details,dfn,dialog,dir,div,dl,dt,em,embed,fieldset,figcaption,figure,font,footer,form,frame,frameset,h1,h2,h3,h4,h5,h6,head,header,hgroup,hr,html,i,iframe,image,img,input,ins,kbd,keygen,label,legend,li,link,listing,main,map,mark,marquee,menu,menuitem,meta,meter,nav,nobr,noframes,noscript,object,ol,optgroup,option,output,p,param,picture,plaintext,pre,progress,q,rb,rp,rt,rtc,ruby,s,samp,script,section,select,shadow,small,source,spacer,span,strike,strong,style,sub,summary,sup,table,tbody,td,template,textarea,tfoot,th,thead,time,title,tr,track,tt,u,ul,var,video,wbr,xmp".split(",");function Be(e){if(_(e)||e instanceof Node||ye(e))return e;let t=ee(e)?"":String(e);return document.createTextNode(t)}function C(e,t,n=null){let r=_(n)?n.firstChild:n,i=S.isSSR;_(t)?t.mount(e,r):r&&!i?r.before(t):i||e.append(t);}function z(e){_(e)?e.unmount():e.parentNode&&e.remove();}function Qe(e,t,n){C(e,t,n),z(n);}function Ke(e,t,n){if(t==="class"){typeof n=="string"?e.className=n:g(n)?e.className=n.join(" "):n&&typeof n=="object"&&(e.className=Object.entries(n).reduce((r,[i,s])=>r+(s?` ${i}`:""),"").trim());return}if(t==="style"){if(typeof n=="string")e.style.cssText=n;else if(n&&typeof n=="object"){let r=n;Object.keys(r).forEach(i=>{e.style.setProperty(Oe(i),String(r[i]));});}return}ee(n)?e.removeAttribute(t):n===!0?e.setAttribute(t,""):e instanceof HTMLInputElement&&t==="value"?e.value=String(n):e.setAttribute(t,String(n));}function Rt(e,t){if(e instanceof HTMLInputElement)switch(e.type){case"checkbox":return N(e,"change",()=>{t(!!e.checked);});case"date":return N(e,"change",()=>{t(e.value?e.value:"");});case"file":return N(e,"change",()=>{e.files&&t(e.files);});case"number":return N(e,"input",()=>{let n=Number.parseFloat(e.value);t(Number.isNaN(n)?"":String(n));});case"radio":return N(e,"change",()=>{t(e.checked?e.value:"");});case"text":return N(e,"input",()=>{t(e.value);})}if(e instanceof HTMLSelectElement)return N(e,"change",()=>{t(e.value);});if(e instanceof HTMLTextAreaElement)return N(e,"input",()=>{t(e.value);})}Promise.resolve();function N(e,t,n){return e.addEventListener(t,n),()=>e.removeEventListener(t,n)}function Pt(e){let t=[],n=[],r=/<\/?([\da-z-]+)([^>]*)>/gi,i=0;for(;;){let s=r.exec(e);if(!s)break;let[o,l]=s,u=o[1]==="/";if(n.push(e.slice(i,s.index)),i=s.index+o.length,u){for(;t.length>0&&t[t.length-1]!==l;){let c=t.pop();c&&n.push(`</${c}>`);}t.length>0&&t.pop();}else Ze.includes(l)||t.push(l);n.push(o);}for(n.push(e.slice(i));t.length>0;){let s=t.pop();s&&n.push(`</${s}>`);}return n.join("")}function At(e){return jt.includes(e)}function Lt(e){return Ze.includes(e)?`<${e}/>`:`<${e}></${e}>`}function Ye(e){return p(e)?e.value:e}var Se=class extends w{constructor(e,t,n){super(),this.template=e,this.props=t,this.key=n,this.emitter=new Set,this.rootNode=null,this.trackMap=new Map,this.proxyProps=t?ve(t,r=>k(r,"on")||k(r,"update")||r==="children"):{};}get firstChild(){var e,t;return (t=(e=this.rootNode)==null?void 0:e.firstChild)!=null?t:null}get isConnected(){var e,t;return (t=(e=this.rootNode)==null?void 0:e.isConnected)!=null?t:!1}mount(e,t){var n,r,i,s;if(!m(this.template))throw new Error("Template must be a function");if(this.isConnected)return (r=(n=this.rootNode)==null?void 0:n.mount(e,t))!=null?r:[];this.initRef(),this.rootNode=this.template(this.proxyProps);let o=(s=(i=this.rootNode)==null?void 0:i.mount(e,t))!=null?s:[];return this.hooks.mounted.forEach(l=>l()),this.patchProps(this.props),this.removeRef(),o}unmount(){var e;this.hooks.destroy.forEach(t=>t()),this.clearHooks(),(e=this.rootNode)==null||e.unmount(),this.rootNode=null,this.proxyProps={};for(let t of this.emitter)t();this.emitter.clear();}inheritNode(e){Object.assign(this.proxyProps,e.proxyProps),this.rootNode=e.rootNode,this.trackMap=e.trackMap,this.hooks=e.hooks;let t=this.props;this.props=e.props,this.patchProps(t);}getNodeTrack(e){let t=this.trackMap.get(e);return t||(t={cleanup:()=>{}},this.trackMap.set(e,t)),t.cleanup(),t}patchProps(e){var t,n;if(e){for(let[r,i]of Object.entries(e))if(k(r,"on")&&((t=this.rootNode)!=null&&t.firstChild)){let s=r.slice(2).toLowerCase(),o=N(this.rootNode.nodes[0],s,i);this.emitter.add(o);}else if(r==="ref")i.value=(n=this.rootNode)==null?void 0:n.firstChild;else if(k(r,"update"))this.props[r]=Ye(i);else if(r!=="children"){let s=this.getNodeTrack(r);s.cleanup=T(()=>{this.proxyProps[r]=m(i)?i():i;});}this.props=e;}}};function It(e,t,n,r){let i=new Map,s=Array.from(t.values());if(s.length&&n.length===0)return Ht(e,s,r),i;let o=[],l=Ft(n),u=0;for(let[c,a]of n.entries()){let d=s[u],j=$(d,c);for(;d&&!l.has(j);)z(d),t.delete(j),d=s[++u],j=$(d,c);let Ee=$(a,c),Z=t.get(Ee);if(Z&&(a=Dt(e,Z,a)),d)if(d===Z)u++;else {let Ce=document.createComment("");C(e,Ce,d),o.push([Ce,a]);}else C(e,a,r);i.set(Ee,a);}return o.forEach(([c,a])=>{Qe(e,a,c);}),t.forEach((c,a)=>{c.isConnected&&!i.has(a)&&z(c);}),i}function Ht(e,t,n){if(e.childNodes.length===t.length+(n?1:0))e.innerHTML="",n&&C(e,n);else {let r=document.createRange(),i=t[0],s=_(i)?i.firstChild:i;r.setStartBefore(s),n?r.setEndBefore(n):r.setEndAfter(e),r.deleteContents();}t.forEach(r=>{_(r)&&r.unmount();});}function Dt(e,t,n){return t===n?t:_(t)&&_(n)&&t.template===n.template?(n.inheritNode(t),n):t instanceof Text&&n instanceof Text?(t.textContent!==n.textContent&&(t.textContent=n.textContent),t):(Qe(e,n,t),n)}function Ft(e){let t=new Map;for(let[n,r]of e.entries()){let i=$(r,n);t.set(i,r);}return t}function $(e,t){if(_(e)){let n=e.key;if(n!=null)return String(n)}return `_$${t}$`}var et=class{constructor(e,t,n){this.template=e,this.props=t,this.key=n,this.treeMap=new Map,this.mounted=!1,this.nodes=[],this.trackMap=new Map,this.bindValueKeys=[],this.parent=null,this.key||(this.key=t==null?void 0:t.key),S.isSSR&&(this.componentIndex=Tt(this.template));}addEventListener(){}removeEventListener(){}get firstChild(){var e;return (e=this.nodes[0])!=null?e:null}get isConnected(){return this.mounted}mount(e,t){var n;if(this.parent=e,this.isConnected)return this.nodes.forEach(s=>C(e,s,t)),this.nodes;g(this.template)&&(this.template=tt(this.template.join("")));let r=this.template.content.cloneNode(!0),i=r.firstChild;return (n=i==null?void 0:i.hasAttribute)!=null&&n.call(i,"_svg_")&&(i.remove(),i==null||i.childNodes.forEach(s=>{r.append(s);})),this.nodes=Array.from(r.childNodes),S.isSSR?this.mapSSGNodeTree(e):this.mapNodeTree(e,r),C(e,r,t),this.patchProps(this.props),this.mounted=!0,this.nodes}unmount(){var e,t;this.trackMap.forEach(n=>{var r;(r=n.cleanup)==null||r.call(n);}),this.trackMap.clear(),this.treeMap.clear(),this.nodes.forEach(n=>z(n)),!this.template.innerHTML&&!this.nodes.length&&(t=(e=this.props)==null?void 0:e[0])!=null&&t.children&&this.props[0].children.forEach(n=>{var r;xe(n)?(r=this.parent)==null||r.childNodes.forEach(i=>{var s;i.nodeType===Node.TEXT_NODE&&i.textContent===`${n}`&&((s=this.parent)==null||s.removeChild(i));}):z(n);}),this.nodes=[],this.mounted=!1;}patchProps(e){e&&(Object.entries(e).forEach(([t,n])=>{let r=Number(t),i=this.treeMap.get(r);i&&this.patchProp(t,i,n,r===0);}),this.props=e);}inheritNode(e){this.mounted=e.mounted,this.nodes=e.nodes,this.trackMap=e.trackMap,this.treeMap=e.treeMap;let t=this.props;this.props=e.props,this.patchProps(t);}mapSSGNodeTree(e){this.treeMap.set(0,e);let t=n=>{var r;if(n.nodeType!==Node.DOCUMENT_FRAGMENT_NODE){if(n.nodeType===Node.COMMENT_NODE){let[s,o]=((r=n.textContent)==null?void 0:r.split("-"))||"";if(+s==0&&+o===this.componentIndex){let l=n.nextSibling;this.treeMap.set(+o,l);}}else if(n.nodeType!==Node.TEXT_NODE){let{ci:s="-1",hk:o}=(n==null?void 0:n.dataset)||{};o&&+s===this.componentIndex&&this.treeMap.set(+o,n);}}let i=n.firstChild;for(;i;)t(i),i=i.nextSibling;};t(e);}mapNodeTree(e,t){let n=1;this.treeMap.set(0,e);let r=i=>{i.nodeType!==Node.DOCUMENT_FRAGMENT_NODE&&this.treeMap.set(n++,i);let s=i.firstChild;for(;s;)r(s),s=s.nextSibling;};r(t);}getNodeTrack(e,t,n){var r;let i=this.trackMap.get(e);return i||(i={cleanup:()=>{}},t&&(i.lastNodes=new Map),n&&(i.isRoot=!0),this.trackMap.set(e,i)),(r=i.cleanup)==null||r.call(i),i}patchProp(e,t,n,r){for(let i in n)if(i==="children"&&n.children)if(g(n.children))n.children.filter(Boolean).forEach((s,o)=>{var l;let[u,c]=g(s)?s:[s,null],a=ke(c)?null:(l=this.treeMap.get(c))!=null?l:null,d=`${e}:${i}:${o}`,j=this.getNodeTrack(d,!0,r);qe(j,t,u,a);});else {let s=`${e}:${i}:0`,o=this.getNodeTrack(s,!0,r);qe(o,t,n.children,null);}else if(i==="ref")n[i].value=t;else if(k(i,"on")){let s=i.slice(2).toLocaleLowerCase(),o=this.getNodeTrack(`${e}:${i}`),l=n[i];o.cleanup=N(t,s,l);}else {let s=`update${$e(i)}`;if(this.bindValueKeys.includes(i))break;n[s]&&this.bindValueKeys.push(s);let o=this.getNodeTrack(`${e}:${i}`),l=n[i],u=p(l)?l:ge(l);Xe(o,t,i,u.value);let c=T(()=>{u.value=p(l)?l.value:l,Xe(o,t,i,u.value);}),a;n[s]&&!zt(i)&&(a=Rt(t,d=>{n[s](d);})),o.cleanup=()=>{c&&c(),a&&a();};}}};function qe(e,t,n,r){m(n)?e.cleanup=T(()=>{let i=re(n()).map(Be);S.isSSR?e.lastNodes=Ue(t,i,r):e.lastNodes=It(t,e.lastNodes,i,r);}):re(n).forEach((i,s)=>{let o=Be(i),l=$(o,s);S.isSSR?e.lastNodes=Ue(t,[o],r):(e.lastNodes.set(l,o),C(t,o,r));});}function Ue(e,t,n){let r=new Map,i=Array.from(e.childNodes).filter(s=>{var o,l;return s.nodeType===Node.TEXT_NODE&&((o=s.previousSibling)==null?void 0:o.nodeType)===Node.COMMENT_NODE&&((l=s.nextSibling)==null?void 0:l.nodeType)===Node.COMMENT_NODE});return t.forEach((s,o)=>{let l=$(s,o);s.nodeType===Node.TEXT_NODE?i.forEach(u=>{s.textContent===u.textContent&&e.replaceChild(s,u);}):C(e,s,n),r.set(l,s);}),r}function Xe(e,t,n,r){let i=t;i.setAttribute&&(m(r)?e.cleanup=T(()=>{Ke(i,n,r());}):Ke(i,n,r));}function _e(e,t,n){return G(e)&&(At(e)?(e=Lt(e),t={1:t}):e===""&&(t={0:t}),e=tt(e)),m(e)?new Se(e,t,n):new et(e,t,n)}function zt(e){return e instanceof Se}function _(e){return e instanceof Se||e instanceof et}function tt(e){let t=document.createElement("template");return t.innerHTML=Pt(e),t}function on(e){return _e("",{children:Array.isArray(e.children)?e.children.filter(Boolean):[e.children]})}function ln(e){var t;J("onMounted"),(t=w.ref)==null||t.addHook("mounted",e);}function an(e){var t;J("onDestroy"),(t=w.ref)==null||t.addHook("destroy",e);}function J(e,t){w.ref||console.error(`"${e}"(key: ${Me(t)?t.toString():t}) can only be called within the component function body
9
9
  and cannot be used in asynchronous or deferred calls.`);}function cn(e,t){var n;J("useProvide",e),(n=w.ref)==null||n.setContext(e,t);}function un(e,t){var n;return J("useInject",e),((n=w.ref)==null?void 0:n.getContext(e))||t}function fn(){return We(null)}function hn(e,t){S.setSSG();let r=new Ne(e,t||{}).mount();return S.setClient(),r}function dn(e,t){let n=typeof t=="string"?document.querySelector(t):t;if(!n)throw new Error(`Could not find container: ${t}`);S.setSSR(),_e(e).mount(n),S.setClient();}function pn(e,t){return S.isSSG?new Ne(e,t):_e(e,t)}globalThis&&(globalThis.__essor_version__=we);/**
10
- * @estjs/signal v0.0.13-beta.6
10
+ * @estjs/signal v0.0.13-beta.7
11
11
  * (c) 2023-Present jiangxd <jiangxd2016@gmail.com>
12
12
  * @license MIT
13
13
  **/
14
14
  /**
15
- * @estjs/template v0.0.13-beta.6
15
+ * @estjs/template v0.0.13-beta.7
16
16
  * (c) 2023-Present jiangxd <jiangxd2016@gmail.com>
17
17
  * @license MIT
18
18
  **/