essor 0.0.14-beta.9 → 0.0.15-beta.1
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/README.md +27 -0
- package/dist/essor.cjs.js +10 -6
- package/dist/essor.cjs.js.map +1 -1
- package/dist/essor.d.cts +3 -3
- package/dist/essor.d.ts +3 -3
- package/dist/essor.dev.cjs.js +3493 -1454
- package/dist/essor.dev.cjs.js.map +1 -0
- package/dist/essor.dev.esm.js +3439 -1439
- package/dist/essor.dev.esm.js.map +1 -0
- package/dist/essor.esm.js +10 -6
- package/dist/essor.esm.js.map +1 -1
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# @estjs/core
|
|
2
|
+
|
|
3
|
+
The core runtime for the **Essor** framework. It provides the application initialization logic and integrates the reactivity system with the rendering engine.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install essor
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
```tsx
|
|
14
|
+
import { createApp, signal } from 'essor';
|
|
15
|
+
|
|
16
|
+
function App() {
|
|
17
|
+
const count = signal(0);
|
|
18
|
+
return <button onclick={() => count.value++}>{count.value}</button>;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
createApp(App, document.body);
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
## License
|
|
26
|
+
|
|
27
|
+
MIT
|
package/dist/essor.cjs.js
CHANGED
|
@@ -1,17 +1,21 @@
|
|
|
1
1
|
'use strict';/**
|
|
2
|
-
* essor v0.0.
|
|
2
|
+
* essor v0.0.15-beta.1
|
|
3
|
+
* build time 2025-12-08T09:49:28.862Z
|
|
3
4
|
* (c) 2023-Present jiangxd <jiangxd2016@gmail.com>
|
|
4
5
|
* @license MIT
|
|
5
6
|
**/
|
|
6
|
-
var Lt="0.0.14-beta.9";var C=t=>t!==null&&typeof t=="object";var m=Array.isArray;function J(t){return typeof t=="string"}function ae(t){return t===null}function kt(t){return typeof t=="symbol"}function Y(t){return k.call(t)==="[object Set]"}function rt(t){return k.call(t)==="[object WeakMap]"}function nt(t){return k.call(t)==="[object WeakSet]"}function Z(t){return k.call(t)==="[object Map]"}function It(t){return t==null}var d=t=>typeof t=="function";function st(t){return t===!1||t===null||t===void 0}var Ht=t=>["string","number","boolean","symbol","undefined"].includes(typeof t)||ae(t);function Ft(t){return t?t&&typeof t=="object"&&t.nodeType===1&&typeof t.nodeName=="string":!1}var M=t=>k.call(t)==="[object Object]";function it(t){return J(t)?!Number.isNaN(Number(t)):!1}var k=Object.prototype.toString;var le=Object.prototype.hasOwnProperty,Q=(t,e)=>le.call(t,e);function ot(t){return m(t)?t.flat():[t]}var P=(t,e)=>t!==e&&(t===t||e===e),ct=Function.prototype;function O(t,e){return J(t)?t.indexOf(e)===0:!1}function Kt(t){return t.replaceAll(/["&'<>]/g,e=>{switch(e){case"&":return "&";case"<":return "<";case">":return ">";case'"':return """;case"'":return "'";default:return e}})}function I(t,e){return m(e)?e.includes(t):d(e)?e(t):!1}var at=t=>{let e=Object.create(null);return r=>e[r]||(e[r]=t(r))},ue=/\B([A-Z])/g,Dt=at(t=>t.replaceAll(ue,"-$1").toLowerCase()),Wt=at(t=>t.charAt(0).toUpperCase()+t.slice(1));function x(t,...e){console.warn.apply(console,[`[Essor warn]: ${t}`].concat(e));}var he=Object.defineProperty,pe=Object.defineProperties,de=Object.getOwnPropertyDescriptors,Gt=Object.getOwnPropertySymbols,me=Object.prototype.hasOwnProperty,ge=Object.prototype.propertyIsEnumerable,Bt=(t,e,r)=>e in t?he(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,F=(t,e)=>{for(var r in e||(e={}))me.call(e,r)&&Bt(t,r,e[r]);if(Gt)for(var r of Gt(e))ge.call(e,r)&&Bt(t,r,e[r]);return t},ve=(t,e)=>pe(t,de(e)),ft=[],ht=[],zt=Promise.resolve(),pt=!1;function Nt(t){return t?zt.then(t):zt}function Ne(t){ft.includes(t)||(ft.push(t),Zt());}function Zt(){pt||(pt=!0,Nt(_e));}function Ee(t){be(t,ht);}function be(t,e){e.includes(t)||(e.push(t),Zt());}function _e(){pt=!1,Se();let t;for(;t=ft.shift();)t&&t();}function Se(){for(;ht.length>0;){let t=ht.shift();t&&t();}}function ye(t,e){return e==="sync"?()=>t():e==="pre"?()=>Ee(t):()=>{Nt(()=>Ne(t));}}var S=null,dt=new WeakMap,lt=new WeakMap,K=Symbol("ReactiveSymbol"),D=Symbol("__raw"),ut=Symbol("SignalValueKey"),Ut=Symbol("ComputedValueKey"),mt=Symbol("ReactiveArrayKey"),N=Symbol("ReactiveCollectionKey"),R=Symbol("ReactiveWeakCollectionKey"),gt=!1,V=new Set;function h(t,e){if(!S)return;let r=dt.get(t);r||(r=new Map,dt.set(t,r));let n=r.get(e);n||(n=new Set,r.set(e,n)),n.add(S);}function v(t,e){let r=dt.get(t);if(!r)return;let n=r.get(e);n&&n.forEach(s=>{if(Q(s,"active")&&!s.active){n.delete(s);return}gt?V.add(s):s();});}var Qt=class{constructor(t,e=!1){this.__signal=!0,this.__shallow=e,this.__value=t;}get value(){return h(this,ut),C(this.__value)&&!this.__shallow?B(this.__value):this.__value}set value(t){g(t)&&(t=t.peek()),P(t,this.__value)&&(this.__value=t,v(this,ut));}trigger(){v(this,ut);}peek(){return this.__value}};function Et(t){return g(t)?t:new Qt(t)}function bt(t){return new Qt(t,!0)}function g(t){return !!(t&&(t!=null&&t.__signal))}var Ce=class{constructor(t){this.fn=t,this.__computed=!0;let e=S;S=this.run.bind(this),this.__value=this.fn(),S=e;}peek(){return this.__value}run(){let t=this.fn();P(t,this.__value)&&(this.__value=t,v(this,Ut));}get value(){return h(this,Ut),this.__value}};function Te(t){return new Ce(t)}function Vt(t){return !!(t&&t.__computed)}function W(t,e={}){let{flush:r="pre",onTrack:n,onTrigger:s}=e;function i(){let a=S;S=i.init?i:i.scheduler,t(),s&&s(),S=a;}let o=ye(i,r);return i.scheduler=o,i.init=!0,i.active=!0,n&&n(),i(),()=>{i.active=!1,S=null;}}function te(t,e){return !t||!C(t)?(x("initialValues must be an object,will return initial value!",t),t):Object.entries(t).reduce((n,[s,i])=>(n[s]=I(s,e)||g(i)?i:Et(i),n),{})}function f(t){return t&&(G(t)?t[D]:g(t)?t.peek():m(t)?t.map(e=>f(e)):M(t)?Object.fromEntries(Object.entries(t).map(([e,r])=>[e,f(r)])):t)}function G(t){return !!(t&&typeof t=="object"&&t[K])}function _t(t,e){return B(t,!1,e)}function ir(t,e){return B(t,!0,e)}var we=(t,e)=>({get(r,n,s){if(n===K)return !0;if(n===D)return r;let i=Reflect.get(r,n,s),o=g(i)?i.value:i;return I(n,e)?o:(h(r,n),C(o)&&!t?B(o):o)},set(r,n,s,i){if(I(n,e))return Reflect.set(r,n,s,i),!0;let o=Reflect.get(r,n,i);g(o)&&(o=o.value),g(s)&&(s=s.value);let a=Reflect.set(r,n,s,i);return P(s,o)&&v(r,n),a},deleteProperty(r,n){let s=Reflect.get(r,n),i=Reflect.deleteProperty(r,n);return s!==void 0&&v(r,n),i}}),qt=Me();function Me(){let t={};return ["includes","indexOf","lastIndexOf"].forEach(e=>{t[e]=function(...r){let n=f(this);for(let i=0,o=this.length;i<o;i++)h(n,`${i}`);let s=n[e](...r);return s===-1||s===!1?n[e](...r):s};}),["push","pop","shift","unshift","splice","sort","reverse"].forEach(e=>{t[e]=function(...r){let n=f(this),s=n[e].apply(this,r);return v(n,mt),s};}),["forEach","map","filter","reduce","reduceRight","some","every","find","findIndex","findLast","findLastIndex","entries","keys","values"].forEach(e=>{t[e]=function(...r){let n=f(this);return h(n,mt),n[e].apply(this,r)};}),t}var Pe=(t,e)=>({get(r,n,s){if(n===K)return !0;if(n===D)return r;if(qt.hasOwnProperty(n))return Reflect.get(qt,n,s);let i=Reflect.get(r,n,s);return I(n,e)?i:(it(n)&&h(r,n),h(r,"length"),C(i)&&!t?B(i):i)},set(r,n,s,i){let o=Reflect.get(r,n,i),a=Reflect.set(r,n,s,i);return P(s,o)&&(it(n)&&v(r,n),(n==="length"||!o)&&v(r,"length")),a}}),Oe={get(t,e){return e===K?!0:e===D?t:((e===Symbol.iterator||e==="size")&&h(t,N),Reflect.get(Q(Xt,e)&&e in t?Xt:t,e,t))}},xe={get(t,e){return e===K?!0:e===D?t:Reflect.get(Q(Jt,e)&&e in t?Jt:t,e,t)}},Xt={get(t){let e=f(this);return h(e,N),e.get(t)},set(t,e){let r=f(this),n=r.set(t,e);return v(r,N),n},add(t){let e=f(this),r=e.add(t);return v(e,N),r},has(t){let e=f(this);return h(e,N),e.has(t)},delete(t){let e=f(this),r=e.has(t),n=e.delete(t);return r&&v(e,N),n},clear(){let t=f(this),e=t.size>0,r=t.clear();return e&&v(t,N),r},forEach(t,e){let r=f(this);h(r,N),r.forEach((n,s)=>{t.call(e,n,s,r);});},get size(){let t=f(this);return h(t,N),t.size},keys(){let t=f(this);return h(t,N),t.keys()},values(){let t=f(this);return h(t,N),t.values()},entries(){let t=f(this);return h(t,N),t.entries()},[Symbol.iterator](){let t=f(this);return h(t,N),t[Symbol.iterator]()}},Jt={get(t){let e=f(this);return h(e,R),e.get(t)},set(t,e){let r=f(this),n=r.set(t,e);return v(r,R),n},add(t){let e=f(this),r=e.add(t);return v(e,R),r},has(t){let e=f(this);return h(e,R),e.has(t)},delete(t){let e=f(this),r=e.delete(t);return v(e,R),r}};function B(t,e=!1,r){if(!C(t)||G(t))return t;if(lt.has(t))return lt.get(t);let n;m(t)?(h(t,mt),n=Pe(e,r)):Y(t)||Z(t)?(h(t,N),n=Oe):nt(t)||rt(t)?(h(t,R),n=xe):n=we(e,r);let s=new Proxy(t,n);return lt.set(t,s),s}function or(t){if(!G(t)){x("clearReactive: argument must be a reactive object");return}if(rt(t)||nt(t)){x("clearReactive: WeakMap and WeakSet are not clearable");return}Re(()=>{m(t)?t.length=0:Y(t)||Z(t)?t.clear():C(t)&&Object.keys(t).forEach(e=>{delete t[e];});});}function Re(t){try{gt=!0,t();}finally{gt=!1,$e();}}function $e(){V.size>0&&(V.forEach(t=>t()),V.clear());}function cr(t,e,r){return Le(t,e,r)}var Yt=void 0,tt,vt=!1;function Ae(t){tt=t,vt||(vt=!0,Nt(je));}function je(){tt&&tt(),tt=null,vt=!1;}function Le(t,e,{deep:r,immediate:n}={}){let s,i=m(t);if(g(t)||Vt(t))s=()=>t.value;else if(G(t))s=()=>F({},t);else if(i)s=()=>t.map(c=>ke(c));else if(d(t))s=t;else return x("Invalid source type",t),ct;if(e&&r){let c=s,l=r===!0?1/0:r;s=()=>H(c(),l);}let o=i?Array.from({length:t.length}).fill(Yt):Yt,a=!1,p=()=>{let c=s();P(c,o)&&(n&&e&&(e(c,o),o=c),a&&e&&Ae(()=>{e(c,o),o=c;}),!a&&(o=c));},u=W(p,{flush:"sync"});return a=!0,n&&p(),u}function ke(t){return g(t)||Vt(t)?t.value:G(t)?F({},t):d(t)?t():(x("Invalid source",t),ct)}function H(t,e=1/0,r){if(e<=0||!C(t)||(r=r||new Set,r.has(t)))return t;if(r.add(t),e--,g(t))H(t.value,e,r);else if(m(t))for(let n of t)H(n,e,r);else if(Y(t)||Z(t))t.forEach(n=>{H(n,e,r);});else if(M(t))for(let n in t)H(t[n],e,r);return t}function Ie(t){let{state:e,getters:r,actions:n}=t,s=F({},e),i=_t(e),o=[],a=[],p={patch$(c){Object.assign(i,c),o.forEach(l=>l(i)),a.forEach(l=>l(i));},subscribe$(c){o.push(c);},unsubscribe$(c){let l=o.indexOf(c);l!==-1&&o.splice(l,1);},onAction$(c){a.push(c);},reset$(){Object.assign(i,s);}},u=F(ve(F({},i),{state:i}),p);if(r)for(let c in r){let l=r[c];l&&Object.defineProperty(u,c,{get(){return Te(()=>l.call(u,i)).value},enumerable:!0,configurable:!0});}if(n)for(let c in n){let l=n[c];l&&(u[c]=function(...j){let q=l.apply(i,j);return a.forEach(L=>L(i)),q});}return u}function ar(t){return function(){let e;typeof t=="function"?e=He(t):e=t;let r=Ie(e);return typeof t=="function"&&Object.keys(e.actions||{}).forEach(n=>{r[n]=e.actions[n].bind(r);}),r}}function He(t){let e=new t,r=Object.create(null),n={},s={};return Object.getOwnPropertyNames(e).forEach(i=>{r[i]=e[i];}),Object.getOwnPropertyNames(t.prototype).forEach(i=>{let o=Object.getOwnPropertyDescriptor(t.prototype,i);o&&(typeof o.get=="function"?n[i]=function(){return o.get.call(this)}:typeof o.value=="function"&&i!=="constructor"&&(s[i]=function(...a){return o.value.apply(this,a)}));}),{state:r,getters:n,actions:s}}var yt="on",Ct="update",w="children",Tt="",Pt="0",Fe="1",ne="ref",St=" __PLACEHOLDER__ ",Ke=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;}},_=new Ke,se=new Map;function De(t,e){se.set(t,{index:e});}function We(t){var e;return (e=se.get(t))==null?void 0:e.index}var Ot=class z{constructor(){this.hooks={mounted:new Set,destroy:new Set};}addEventListener(){}removeEventListener(){}addHook(e,r){var n;(n=this.hooks[e])==null||n.add(r);}getContext(e){return z.context[e]}setContext(e,r){z.context[e]=r;}initRef(){z.ref=this;}removeRef(){z.ref=null;}clearHooks(){Object.values(this.hooks).forEach(e=>e.clear());}};Ot.ref=null;Ot.context={};var E=Ot;function wt(t){return t instanceof xt}var $=1,xt=class extends E{constructor(t,e={},r){super(),this.template=t,this.props=e,this.key=r,De(t,$),this.templates=this.processTemplate();}processTemplate(){if(m(this.template)){let t=this.template.join(St);return this.processHtmlString(t).split(St)}return []}processHtmlString(t){return t.replaceAll(/(<[^>]+>)|([^<]+)/g,(e,r,n)=>r?r.includes("data-ci")?e:r.replace(/<\s*([\da-z]+)(\s[^>]*)?>/i,(s,i,o)=>`<${i} data-ci="${$}"${o||""}>`):n&&n.replace(St,"").trim()?`<!--0-${$}-->${n}<!$>`:e)}mount(){this.initRef();let t=this.render();return this.removeRef(),t}render(){if(d(this.template)){let t=this.template(this.props);return wt(t)?t.mount():String(t)}return this.renderTemplate()}renderTemplate(){return Object.entries(this.props).forEach(([t,e])=>{let r=e.children;this.normalizeProps(e);let n=this.templates.findIndex(s=>s.includes(`data-hk="${t}"`));r&&this.renderChildren(r,n),this.templates[n]=this.templates[n].replace(`data-hk="${t}"`,`data-hk="${t}" ${this.generateAttributes(e)}`);}),this.templates.join("")}normalizeProps(t){Object.entries(t).forEach(([e,r])=>{e===w||d(r)?delete t[e]:g(r)&&(t[e]=r.value);});}generateAttributes(t){return Object.entries(t).filter(([e,r])=>e!==w&&!d(r)).map(([e,r])=>`${e}="${Kt(String(r))}"`).join(" ")}renderChildren(t,e){t.forEach(([r])=>{$++;let n=this.renderChild(r);this.templates[e]+=n;});}renderChild(t){if(d(t))return this.renderChild(t(this.props));if(g(t))return `<!--1-${$}-->${t.value}<!$>`;if(wt(t)){let e=t.mount();return d(e)?e(this.props):ce(e)}else return `<!--1-${$}-->${t}<!$>`}},ie="area,base,br,col,embed,hr,img,input,link,meta,param,source,track,wbr".split(",");function ee(t){if(y(t)||t instanceof Node||wt(t))return t;let e=st(t)?"":String(t);return document.createTextNode(e)}function T(t,e,r=null){let n=y(r)?r.firstChild:r,s=_.isSSR;y(e)?e.mount(t,n):n&&!s?n.before(e):s||t.append(e);}function U(t){y(t)?t.unmount():t.parentNode&&t.remove();}function oe(t,e,r){T(t,e,r),U(r);}function re(t,e,r){e==="class"?Ge(t,r):e==="style"?Be(t,r):ze(t,e,r);}function Ge(t,e){typeof e=="string"?t.className=e:m(e)?t.className=e.join(" "):e&&typeof e=="object"&&(t.className=Object.entries(e).reduce((r,[n,s])=>r+(s?` ${n}`:""),"").trim());}function Be(t,e){typeof e=="string"?t.style.cssText=e:e&&typeof e=="object"&&Object.entries(e).forEach(([n,s])=>{t.style.setProperty(Dt(n),String(s));});}function ze(t,e,r){st(r)?t.removeAttribute(e):r===!0?t.setAttribute(e,""):t instanceof HTMLInputElement&&e==="value"?t.value=String(r):t.setAttribute(e,String(r));}function Ue(t,e){if(t instanceof HTMLInputElement)switch(t.type){case"checkbox":return b(t,"change",()=>{e(!!t.checked);});case"date":return b(t,"change",()=>{e(t.value?t.value:"");});case"file":return b(t,"change",()=>{t.files&&e(t.files);});case"number":return b(t,"input",()=>{let r=Number.parseFloat(t.value);e(Number.isNaN(r)?"":String(r));});case"radio":return b(t,"change",()=>{e(t.checked?t.value:"");});case"text":return b(t,"input",()=>{e(t.value);})}if(t instanceof HTMLSelectElement)return b(t,"change",()=>{e(t.value);});if(t instanceof HTMLTextAreaElement)return b(t,"input",()=>{e(t.value);})}function b(t,e,r){return t.addEventListener(e,r),()=>t.removeEventListener(e,r)}function qe(t){let e=[],r=[],n=/<\/?([\da-z-]+)([^>]*)>/gi,s=0;for(;;){let i=n.exec(t);if(!i)break;let[o,a]=i,p=o[1]==="/";if(r.push(t.slice(s,i.index)),s=i.index+o.length,p){for(;e.length>0&&e[e.length-1]!==a;){let u=e.pop();u&&r.push(`</${u}>`);}e.length>0&&e.pop();}else ie.includes(a)||e.push(a);r.push(o);}for(r.push(t.slice(s));e.length>0;){let i=e.pop();i&&r.push(`</${i}>`);}return r.join("")}function Xe(t){return ie.includes(t)?`<${t}/>`:`<${t}></${t}>`}function ce(t){return g(t)?t.value:t}var Rt=class extends E{constructor(t,e,r){super(),this.template=t,this.props=e,this.key=r,this.emitter=new Set,this.rootNode=null,this.trackMap=new Map,this.key||(this.key=e&&e.key),this.proxyProps=this.createProxyProps(e);}createProxyProps(t){return t?te(t,e=>O(e,yt)||O(e,Ct)||e===w):{}}get firstChild(){var t,e;return (e=(t=this.rootNode)==null?void 0:t.firstChild)!=null?e:null}get isConnected(){var t,e;return (e=(t=this.rootNode)==null?void 0:t.isConnected)!=null?e:!1}mount(t,e){var r,n,s,i;if(!d(this.template))throw new Error("Template must be a function");if(this.isConnected)return (n=(r=this.rootNode)==null?void 0:r.mount(t,e))!=null?n:[];this.initRef(),this.rootNode=this.template(_t(this.proxyProps,[w]));let o=(i=(s=this.rootNode)==null?void 0:s.mount(t,e))!=null?i:[];return this.callMountHooks(),this.patchProps(this.props),this.removeRef(),o}unmount(){var t;this.callDestroyHooks(),this.clearHooks(),(t=this.rootNode)==null||t.unmount(),this.rootNode=null,this.proxyProps={},this.clearEmitter();}callMountHooks(){this.hooks.mounted.forEach(t=>t());}callDestroyHooks(){this.hooks.destroy.forEach(t=>t());}clearEmitter(){for(let t of this.emitter)t();this.emitter.clear();}inheritNode(t){Object.assign(this.proxyProps,t.proxyProps),this.rootNode=t.rootNode,this.trackMap=t.trackMap,this.hooks=t.hooks;let e=this.props;this.props=t.props,this.patchProps(e);}getNodeTrack(t){let e=this.trackMap.get(t);return e||(e={cleanup:()=>{}},this.trackMap.set(t,e)),e.cleanup(),e}patchProps(t){var e;if(t){for(let[r,n]of Object.entries(t))O(r,yt)&&((e=this.rootNode)!=null&&e.firstChild)?this.patchEventListener(r,n):r===ne?this.patchRef(n):O(r,Ct)?this.patchUpdateHandler(r,n):r!==w&&this.patchNormalProp(r,n);this.props=t;}}patchEventListener(t,e){let r=t.slice(2).toLowerCase(),n=b(this.rootNode.nodes[0],r,e);this.emitter.add(n);}patchRef(t){var e,r;t.value=(r=(e=this.rootNode)==null?void 0:e.firstChild)!=null?r:null;}patchUpdateHandler(t,e){this.props[t]=ce(e);}patchNormalProp(t,e){var r,n;let s=(n=(r=this.proxyProps)[t])!=null?n:r[t]=Et(e),i=this.getNodeTrack(t);i.cleanup=W(()=>{s.value=d(e)?e():e;});}};function Je(t,e,r,n){let s=new Map,i=Array.from(e.values());if(i.length&&r.length===0)return Ye(t,i,n),s;let o=[],a=Qe(r),p=0;for(let[u,c]of r.entries()){let l=i[p],j=A(l,u);for(;l&&!a.has(j);)U(l),e.delete(j),l=i[++p],j=A(l,u);let q=A(c,u),L=e.get(q);if(L&&(c=Ze(t,L,c)),l)if(l===L)p++;else {let jt=document.createComment("");T(t,jt,l),o.push([jt,c]);}else T(t,c,n);s.set(q,c);}return o.forEach(([u,c])=>{oe(t,c,u);}),e.forEach((u,c)=>{u.isConnected&&!s.has(c)&&U(u);}),s}function Ye(t,e,r){if(t.childNodes.length===e.length+(r?1:0))t.innerHTML="",r&&T(t,r);else {let n=document.createRange(),s=e[0],i=y(s)?s.firstChild:s;n.setStartBefore(i),r?n.setEndBefore(r):n.setEndAfter(t),n.deleteContents();}e.forEach(n=>{y(n)&&n.unmount();});}function Ze(t,e,r){return e===r?e:y(e)&&y(r)&&e.template===r.template?(r.inheritNode(e),r):e instanceof Text&&r instanceof Text?(e.textContent!==r.textContent&&(e.textContent=r.textContent),e):(oe(t,r,e),r)}function Qe(t){let e=new Map;for(let[r,n]of t.entries()){let s=A(n,r);e.set(s,n);}return e}function A(t,e){if(y(t)){let r=t.key;if(r!=null)return String(r)}return `_$${e}$`}var Mt=class{constructor(t,e,r){this.template=t,this.props=e,this.key=r,this.treeMap=new Map,this.mounted=!1,this.nodes=[],this.trackMap=new Map,this.bindValueKeys=[],this.parent=null,this.key||(this.key=e&&e.key),_.isSSR&&(this.componentIndex=We(this.template));}get firstChild(){var t;return (t=this.nodes[0])!=null?t:null}get isConnected(){return this.mounted}addEventListener(){}removeEventListener(){}mount(t,e){var r;if(this.parent=t,this.isConnected)return this.nodes.forEach(i=>T(t,i,e)),this.nodes;m(this.template)&&(this.template=At(this.template.join("")));let n=this.template.content.cloneNode(!0),s=n.firstChild;return (r=s==null?void 0:s.hasAttribute)!=null&&r.call(s,"_svg_")&&(s.remove(),s.childNodes.forEach(i=>{n.append(i);})),this.nodes=Array.from(n.childNodes),_.isSSR?this.mapSSGNodeTree(t):this.mapNodeTree(t,n),T(t,n,e),this.patchProps(this.props),this.mounted=!0,this.nodes}unmount(){var t,e;if(this.trackMap.forEach(r=>{r.cleanup&&r.cleanup();}),this.trackMap.clear(),this.treeMap.clear(),this.nodes.forEach(r=>U(r)),!this.template.innerHTML&&!this.nodes.length){let r=(e=(t=this.props)==null?void 0:t[Pt])==null?void 0:e.children;r&&(m(r)?r.forEach(n=>{this.deleteFragmentTextNode(n);}):this.deleteFragmentTextNode(r));}this.nodes=[],this.mounted=!1;}deleteFragmentTextNode(t){Ht(t)?this.parent&&this.parent.childNodes.length&&this.parent.childNodes.forEach(e=>{e.nodeType===Node.TEXT_NODE&&e.textContent===`${t}`&&this.parent.removeChild(e);}):U(t);}inheritNode(t){this.mounted=t.mounted,this.nodes=t.nodes,this.trackMap=t.trackMap,this.treeMap=t.treeMap;let e=this.props;this.props=t.props,this.patchProps(e);}mapSSGNodeTree(t){this.treeMap.set(0,t),this.walkNodeTree(t,this.handleSSGNode.bind(this));}mapNodeTree(t,e){let r=1;this.treeMap.set(0,t);let n=s=>{s.nodeType!==Node.DOCUMENT_FRAGMENT_NODE&&this.treeMap.set(r++,s);};this.walkNodeTree(e,n);}walkNodeTree(t,e){t.nodeType!==Node.DOCUMENT_FRAGMENT_NODE&&e(t);let r=t.firstChild;for(;r;)this.walkNodeTree(r,e),r=r.nextSibling;}handleSSGNode(t){var e;if(t.nodeType===Node.COMMENT_NODE){let[r,n]=((e=t.textContent)==null?void 0:e.split("-"))||[];if(+r==0&&+n===this.componentIndex){let s=t.nextSibling;this.treeMap.set(+n,s);}}else if(t.nodeType!==Node.TEXT_NODE){let{ci:r="-1",hk:n}=(t==null?void 0:t.dataset)||{};n&&+r===this.componentIndex&&this.treeMap.set(+n,t);}}patchProps(t){t&&(Object.entries(t).forEach(([e,r])=>{let n=Number(e),s=this.treeMap.get(n);s&&this.patchProp(e,s,r,n===0);}),this.props=t);}patchProp(t,e,r,n){r&&Object.entries(r).forEach(([s,i])=>{if(s===w&&i)this.patchChildren(t,e,i,n);else if(s===ne)r[s].value=e;else if(O(s,yt))this.patchEventListener(t,e,s,i);else {if(this.bindValueKeys.includes(s))return;let o=this.getBindUpdateValue(r,t,s);this.patchAttribute(t,e,s,i,o);}});}getBindUpdateValue(t,e,r){let n=`${Ct}${Wt(r)}`;if(n&&t[n]&&d(t[n]))return this.bindValueKeys.push(n),t[n]}patchChildren(t,e,r,n){if(m(r))r.filter(Boolean).forEach((s,i)=>{var o;let[a,p]=m(s)?s:[s,null],u=It(p)?null:(o=this.treeMap.get(p))!=null?o:null,c=`${t}:${w}:${i}`,l=this.getNodeTrack(c,!0,n);this.patchChild(l,e,a,u);});else {let s=`${t}:${w}:0`,i=this.getNodeTrack(s,!0,n);this.patchChild(i,e,r,null);}}patchEventListener(t,e,r,n){let s=r.slice(2).toLowerCase(),i=this.getNodeTrack(`${t}:${r}`);i.cleanup=b(e,s,n);}patchAttribute(t,e,r,n,s){let i=this.getNodeTrack(`${t}:${r}`),o=d(n)?n():n,a=g(o)?o:bt(o);re(e,r,a.value);let p=W(()=>{let c=d(n)?n():n;M(c)&&M(a.peek())&&JSON.stringify(a.value)===JSON.stringify(c)||(a.value=g(c)?c.value:c,re(e,r,a.value));}),u;s&&Ft(e)&&(u=Ue(e,c=>{s(c);})),i.cleanup=()=>{p&&p(),u&&u();};}getNodeTrack(t,e,r){let n=this.trackMap.get(t);return n||(n={cleanup:()=>{}},e&&(n.lastNodes=new Map),r&&(n.isRoot=!0),this.trackMap.set(t,n)),n.cleanup&&n.cleanup(),n}patchChild(t,e,r,n){d(r)?t.cleanup=W(()=>{let s=ot(r()).map(ee);_.isSSR?t.lastNodes=this.reconcileChildren(e,s,n):t.lastNodes=Je(e,t.lastNodes,s,n);}):ot(r).forEach((s,i)=>{let o=ee(s),a=A(o,i);_.isSSR?t.lastNodes=this.reconcileChildren(e,[o],n):(t.lastNodes.set(a,o),T(e,o,n));});}reconcileChildren(t,e,r){let n=new Map,s=Array.from(t.childNodes).filter(i=>{var o,a;return i.nodeType===Node.TEXT_NODE&&((o=i.previousSibling)==null?void 0:o.nodeType)===Node.COMMENT_NODE&&((a=i.nextSibling)==null?void 0:a.nodeType)===Node.COMMENT_NODE});return e.forEach((i,o)=>{let a=A(i,o);i.nodeType===Node.TEXT_NODE?s.forEach(p=>{i.textContent===p.textContent&&t.replaceChild(i,p);}):T(t,i,r),n.set(a,i);}),n}};function $t(t,e,r){if(J(t)){let n=t===Tt,s=n?Tt:Xe(t);return e={[n?Pt:Fe]:e},new Mt(At(s),e,r)}return d(t)?new Rt(t,e,r):new Mt(t,e,r)}function mr(t){return t instanceof Rt}function y(t){return t instanceof Rt||t instanceof Mt}function At(t){let e=document.createElement("template");return e.innerHTML=qe(t),e}function gr(t){return $t(At(Tt),{[Pt]:{children:m(t.children)?t.children.filter(Boolean):[t.children]}})}function vr(t){et("onMounted"),E.ref&&E.ref.addHook("mounted",t);}function Nr(t){et("onDestroy"),E.ref&&E.ref.addHook("destroy",t);}function et(t,e){E.ref||console.error(`"${t}"(key: ${kt(e)?e.toString():e}) can only be called within the component function body
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
var Jt="0.0.15-beta.1";var d=t=>t!==null&&typeof t=="object";function ft(t){return J.call(t)==="[object Promise]"}var M=Array.isArray;function v(t){return typeof t=="string"}function Tt(t){return typeof t=="number"}function ar(t){return t===null}function Lt(t){return typeof t=="symbol"}function ht(t){return J.call(t)==="[object Set]"}function Zt(t){return J.call(t)==="[object WeakMap]"}function Qt(t){return J.call(t)==="[object WeakSet]"}function dt(t){return J.call(t)==="[object Map]"}function Ct(t){return t==null}var S=t=>typeof t=="function";function pt(t){return t===false||t===null||t===void 0}var te=t=>["string","number","boolean","symbol","undefined"].includes(typeof t)||ar(t);function et(t){return t instanceof HTMLElement}var ee=t=>J.call(t)==="[object Object]";function Pt(t){return !v(t)||t===""?false:!Number.isNaN(Number(t))}function re(t){return typeof t=="undefined"}var J=Object.prototype.toString,cr=Object.prototype.hasOwnProperty;var rt=(t,e)=>cr.call(t,e);function ne(t){return M(t)?t:[t]}var L=(t,e)=>!Object.is(t,e);function ie(t,e){return v(t)?t.indexOf(e)===0:false}var It=t=>{let e=Object.create(null);return(r=>e[r]||(e[r]=t(r)))};var lr=/\B([A-Z])/g,oe=It(t=>t.replaceAll(lr,"-$1").toLowerCase()),ur=/[_-](\w)/g,Mt=It(t=>(t=t.replaceAll(/^[_-]+|[_-]+$/g,""),t=t.replaceAll(/[_-]+/g,"-"),t.replaceAll(ur,(e,r)=>r.toUpperCase()))),se=It(t=>t.charAt(0).toUpperCase()+t.slice(1));function m(t,...e){console.warn(`[Essor warn]: ${t}`,...e);}function Rt(t,...e){console.info(`[Essor info]: ${t}`,...e);}function p(t,...e){console.error(`[Essor error]: ${t}`,...e);}var fr=/["&'<>]/;function hr(t){let e=`${t}`,r=fr.exec(e);if(!r)return e;let n="",i,o,s=0;for(o=r.index;o<e.length;o++){switch(e.charCodeAt(o)){case 34:i=""";break;case 38:i="&";break;case 39:i="'";break;case 60:i="<";break;case 62:i=">";break;default:continue}s!==o&&(n+=e.slice(s,o)),s=o+1,n+=i;}return s!==o?n+e.slice(s,o):n}function $(t){let e=Object.create(null);for(let r of t.split(","))e[r]=1;return r=>r in e}var ae="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",ce=$(ae),le=$(`${ae},async,autofocus,autoplay,controls,default,defer,disabled,hidden,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected`);function ue(t){return !!t||t===""}$("accept,accept-charset,accesskey,action,align,allow,alt,async,autocapitalize,autocomplete,autofocus,autoplay,background,bgcolor,border,buffered,capture,challenge,charset,checked,cite,class,code,codebase,color,cols,colspan,content,contenteditable,contextmenu,controls,coords,crossorigin,csp,data,datetime,decoding,default,defer,dir,dirname,disabled,download,draggable,dropzone,enctype,enterkeyhint,for,form,formaction,formenctype,formmethod,formnovalidate,formtarget,headers,height,hidden,high,href,hreflang,http-equiv,icon,id,importance,inert,integrity,ismap,itemprop,keytype,kind,label,lang,language,loading,list,loop,low,manifest,max,maxlength,minlength,media,min,multiple,muted,name,novalidate,open,optimum,pattern,ping,placeholder,poster,preload,radiogroup,readonly,referrerpolicy,rel,required,reversed,rows,rowspan,sandbox,scope,scoped,selected,shape,size,sizes,slot,span,spellcheck,src,srcdoc,srclang,srcset,start,step,style,summary,tabindex,target,title,translate,type,usemap,value,width,wrap");$("xmlns,accent-height,accumulate,additive,alignment-baseline,alphabetic,amplitude,arabic-form,ascent,attributeName,attributeType,azimuth,baseFrequency,baseline-shift,baseProfile,bbox,begin,bias,by,calcMode,cap-height,class,clip,clipPathUnits,clip-path,clip-rule,color,color-interpolation,color-interpolation-filters,color-profile,color-rendering,contentScriptType,contentStyleType,crossorigin,cursor,cx,cy,d,decelerate,descent,diffuseConstant,direction,display,divisor,dominant-baseline,dur,dx,dy,edgeMode,elevation,enable-background,end,exponent,fill,fill-opacity,fill-rule,filter,filterRes,filterUnits,flood-color,flood-opacity,font-family,font-size,font-size-adjust,font-stretch,font-style,font-variant,font-weight,format,from,fr,fx,fy,g1,g2,glyph-name,glyph-orientation-horizontal,glyph-orientation-vertical,glyphRef,gradientTransform,gradientUnits,hanging,height,href,hreflang,horiz-adv-x,horiz-origin-x,id,ideographic,image-rendering,in,in2,intercept,k,k1,k2,k3,k4,kernelMatrix,kernelUnitLength,kerning,keyPoints,keySplines,keyTimes,lang,lengthAdjust,letter-spacing,lighting-color,limitingConeAngle,local,marker-end,marker-mid,marker-start,markerHeight,markerUnits,markerWidth,mask,maskContentUnits,maskUnits,mathematical,max,media,method,min,mode,name,numOctaves,offset,opacity,operator,order,orient,orientation,origin,overflow,overline-position,overline-thickness,panose-1,paint-order,path,pathLength,patternContentUnits,patternTransform,patternUnits,ping,pointer-events,points,pointsAtX,pointsAtY,pointsAtZ,preserveAlpha,preserveAspectRatio,primitiveUnits,r,radius,referrerPolicy,refX,refY,rel,rendering-intent,repeatCount,repeatDur,requiredExtensions,requiredFeatures,restart,result,rotate,rx,ry,scale,seed,shape-rendering,slope,spacing,specularConstant,specularExponent,speed,spreadMethod,startOffset,stdDeviation,stemh,stemv,stitchTiles,stop-color,stop-opacity,strikethrough-position,strikethrough-thickness,string,stroke,stroke-dasharray,stroke-dashoffset,stroke-linecap,stroke-linejoin,stroke-miterlimit,stroke-opacity,stroke-width,style,surfaceScale,systemLanguage,tabindex,tableValues,target,targetX,targetY,text-anchor,text-decoration,text-rendering,textLength,to,transform,transform-origin,type,u1,u2,underline-position,underline-thickness,unicode,unicode-bidi,unicode-range,units-per-em,v-alphabetic,v-hanging,v-ideographic,v-mathematical,values,vector-effect,version,vert-adv-y,vert-origin-x,vert-origin-y,viewBox,viewTarget,visibility,width,widths,word-spacing,writing-mode,x,x-height,x1,x2,xChannelSelector,xlink:actuate,xlink:arcrole,xlink:href,xlink:role,xlink:show,xlink:title,xlink:type,xmlns:xlink,xml:base,xml:lang,xml:space,y,y1,y2,yChannelSelector,z,zoomAndPan");var dr="html,body,base,head,link,meta,style,title,address,article,aside,footer,header,hgroup,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,summary,template,blockquote,iframe,tfoot",pr="svg,animate,animateMotion,animateTransform,circle,clipPath,color-profile,defs,desc,discard,ellipse,feBlend,feColorMatrix,feComponentTransfer,feComposite,feConvolveMatrix,feDiffuseLighting,feDisplacementMap,feDistantLight,feDropShadow,feFlood,feFuncA,feFuncB,feFuncG,feFuncR,feGaussianBlur,feImage,feMerge,feMergeNode,feMorphology,feOffset,fePointLight,feSpecularLighting,feSpotLight,feTile,feTurbulence,filter,foreignObject,g,hatch,hatchpath,image,line,linearGradient,marker,mask,mesh,meshgradient,meshpatch,meshrow,metadata,mpath,path,pattern,polygon,polyline,radialGradient,rect,set,solidcolor,stop,switch,symbol,text,textPath,title,tspan,unknown,use,view",mr="annotation,annotation-xml,maction,maligngroup,malignmark,math,menclose,merror,mfenced,mfrac,mfraction,mglyph,mi,mlabeledtr,mlongdiv,mmultiscripts,mn,mo,mover,mpadded,mphantom,mprescripts,mroot,mrow,ms,mscarries,mscarry,msgroup,msline,mspace,msqrt,msrow,mstack,mstyle,msub,msubsup,msup,mtable,mtd,mtext,mtr,munder,munderover,none,semantics",gr="beforeinput,click,dblclick,contextmenu,focusin,focusout,input,keydown,keyup,mousedown,mousemove,mouseout,mouseover,mouseup,pointerdown,pointermove,pointerout,pointerover,pointerup,touchend,touchmove,touchstart",vr="area,base,br,col,embed,hr,img,input,link,meta,param,source,track,wbr",yr="area,base,br,col,embed,hr,img,input,link,meta,param,source,track,wbr";$(dr);$(pr);$(mr);$(vr);$(yr);$(gr);var br=Object.defineProperty,Sr=Object.defineProperties,Er=Object.getOwnPropertyDescriptors,fe=Object.getOwnPropertySymbols,wr=Object.prototype.hasOwnProperty,_r=Object.prototype.propertyIsEnumerable,he=(t,e,r)=>e in t?br(t,e,{enumerable:true,configurable:true,writable:true,value:r}):t[e]=r,Ot=(t,e)=>{for(var r in e||(e={}))wr.call(e,r)&&he(t,r,e[r]);if(fe)for(var r of fe(e))_r.call(e,r)&&he(t,r,e[r]);return t},xr=(t,e)=>Sr(t,Er(e)),k={SET:"SET",ADD:"ADD",DELETE:"DELETE",CLEAR:"CLEAR"},de=Symbol("Signal_Key"),vt=Symbol("Array_Key"),C=Symbol("Collection_Key"),nt=Symbol("WeakCollection_Key"),B=Symbol("Array_Iterate_Key");function Ae(t){let e=t.nextSubLink,r;t:do{let n=t.subNode,i=n.flag&64,o=n.flag&2,s=n.flag&-65;if(s&60?s&48||(s&12?s&4?!(s&48)&&Ar(t,n)?(n.flag=i|o|(s|8|32),s&=1):(s=0,n.flag=i|o):n.flag=i|o|(s&-9|32):(s=0,n.flag=i|o)):n.flag=i|o|s|32,n.flag&2&&Te(n),s&1){let a=n.subLink;if(a){let c=(t=a).nextSubLink;c&&(r={value:e,prev:r},e=c);continue}}if(e){t=e,e=t.nextSubLink;continue}for(;r;)if(t=r.value,r=r.prev,t){e=t.nextSubLink;continue t}break}while(true)}function ke(t){for(;t;){let e=t.subNode,r=e.flag&64,n=e.flag&-65;if(!(n&16)&&n&33){let i=r|n&-33|16;e.flag=i,i&2&&Te(e),n&1&&e.subLink&&ke(e.subLink);}t=t.nextSubLink;}}function Te(t){t.active&&t.notify();}var mt=0,R,ot=false;function Le(t,e){if(ot)return;let r=e.depLinkTail;if(r&&r.depNode===t)return r;let n=r?r.nextDepLink:e.depLink;if(n&&n.depNode===t)return n.version=mt,e.depLinkTail=n,n;let i=t.subLinkTail;if(i&&i.version===mt&&i.subNode===e)return e.depLinkTail=i,i;let o={version:mt,depNode:t,subNode:e,prevSubLink:i,nextSubLink:void 0,prevDepLink:r,nextDepLink:n};return n&&(n.prevDepLink=o),r?r.nextDepLink=o:e.depLink=o,i?i.nextSubLink=o:t.subLink=o,t.subLinkTail=o,e.depLinkTail=o,e.onTrack&&S(e==null?void 0:e.onTrack)&&e.onTrack({effect:e,target:t,type:"get",key:void 0}),o}function yt(t,e=t.subNode){let r=t.depNode,n=t.prevSubLink,i=t.nextSubLink,o=t.prevDepLink,s=t.nextDepLink;if(s?s.prevDepLink=o:e.depLinkTail=o,o?o.nextDepLink=s:e.depLink=s,i?i.prevSubLink=n:r.subLinkTail=n,n)n.nextSubLink=i;else if(r.subLink=i,i===void 0){let a=r.depLink;for(;a;)a=yt(a,r);r.depLinkTail=void 0,r.flag|=16,r.depLink&&p("[Link] Cascading cleanup failed: depNode still has dependency links. This indicates a bug in the unlinking logic.");}return t.depNode=void 0,t.subNode=void 0,t.prevSubLink=void 0,t.nextSubLink=void 0,t.prevDepLink=void 0,t.nextDepLink=void 0,s}function Ce(t,e){let r=[{link:t,owner:e}],n=[];for(;r.length>0;){let i=r.pop(),o=i.link,s=i.owner;for(;o;){let a=o.depNode,c=a.flag;if(s.flag&16)return true;if((c&17)===17){let l=a.subLink;l&&l.nextSubLink&&Kt(l);for(let u of n)u.flag&32&&(u.flag=u.flag&-33|16);return true}(c&33)===33?a.depLink?(n.push(a),r.push({link:a.depLink,owner:a})):a.flag&=-33:c&32&&(a.flag&=-33),o=o.nextDepLink;}}for(let i of n)i.flag&=-33;return e.flag&32&&(e.flag&=-33),false}function Kt(t){for(;t;){let e=t.subNode,r=e.flag&64,n=e.flag&-65;(n&48)===32&&(e.flag=r|n|16),t=t.nextSubLink;}}function Nt(t){let e=R;return R=t,e}function Pe(t){return mt++,t.depLinkTail=void 0,t.flag=t.flag&-57|4,Nt(t)}function Ie(t,e){R=e;let r=t.depLinkTail,n=r?r.nextDepLink:t.depLink;for(;n;)n=yt(n,t);t.flag&=-5;}function Yn(t){let e=Nt(void 0),r=ot;ot=true;try{return t()}finally{ot=r,Nt(e);}}function Ar(t,e){let r=e.depLinkTail;for(;r;){if(r===t)return true;r=r.prevDepLink;}return false}var jt=new WeakMap;function g(t,e){if(!R||ot)return;let r=jt.get(t);r||(r=new Map,jt.set(t,r));let n=r.get(e);n||(n=new Set,r.set(e,n)),n.has(R)||(n.add(R),S(R.onTrack)&&R.onTrack({effect:R,target:t,type:"get",key:e}));}function x(t,e,r,n){let i=jt.get(t);if(!i)return;let o=new Set;if(r!==void 0)if(Array.isArray(r))r.forEach(s=>{let a=i.get(s);a&&a.forEach(c=>o.add(c));});else {let s=i.get(r);s&&s.forEach(a=>o.add(a));}if(e==="ADD"||e==="DELETE"||e==="CLEAR"){let s=Symbol("iterate"),a=Symbol("arrayIterate"),c=Array.isArray(t)?a:s,l=i.get(c);l&&l.forEach(u=>o.add(u));}o.forEach(s=>{var a;S(s.onTrigger)&&s.onTrigger({effect:s,target:t,type:e,key:r,newValue:n}),s.flag&2?(a=s.notify)==null||a.call(s):s.flag&1&&(s.flag|=16,s.subLink&&Ae(s.subLink));});}var pe=new WeakMap;function h(t){if(!t||!d(t))return t;let e=t._RAW;return e?h(e):E(t)?h(t.peek()):t}var me=kr();function kr(){let t={};return ["includes","indexOf","lastIndexOf"].forEach(e=>{t[e]=function(...r){let n=h(this);g(n,B);let i=n[e](...r);if((i===-1||i===false)&&r.length>0){let o=r.map(s=>h(s));i=n[e](...o);}return i};}),["find","findIndex","findLast","findLastIndex"].forEach(e=>{t[e]=function(...r){let n=h(this),i=N(this);g(n,B);let o=n[e](...r);return (e==="find"||e==="findLast")&&d(o)&&!i?w(o):o};}),["push","pop","shift","unshift","splice","sort","reverse","fill","copyWithin"].forEach(e=>{t[e]=function(...r){let n=h(this),i=Array.prototype[e].apply(n,r);return x(n,k.SET,vt),x(n,k.SET,B),i};}),["toReversed","toSorted","toSpliced"].forEach(e=>{t[e]=function(...r){let n=h(this),i=N(this);if(g(n,B),e==="toSpliced")for(let s=0,a=n.length;s<a;s++)g(n,`${s}`);let o=Array.prototype[e].apply(n,r);return Array.isArray(o)?o.map(s=>d(s)?w(s,i):s):o};}),["concat","slice","filter","map","flatMap","flat"].forEach(e=>{t[e]=function(...r){let n=h(this);return g(n,B),Array.prototype[e].apply(n,r)};}),["join","toString","toLocaleString"].forEach(e=>{t[e]=function(...r){let n=h(this);return g(n,B),Array.prototype[e].apply(n,r)};}),["values","keys","entries",Symbol.iterator].forEach(e=>{t[e]=function(){let r=h(this),n=N(this);g(r,vt);let i=e===Symbol.iterator?r[Symbol.iterator]():r[e]();return {next(){let{value:o,done:s}=i.next();return s?{value:o,done:s}:Array.isArray(o)?{value:o.map(a=>d(a)?w(a,n):a),done:s}:{value:d(o)?w(o,n):o,done:s}},[Symbol.iterator](){return this}}};}),t}var Me=t=>({get:(e,r,n)=>{if(r==="_RAW")return e;if(r==="_IS_REACTIVE")return true;if(r==="_IS_SHALLOW")return t;if(rt(me,r))return me[r];let i=Reflect.get(e,r,n);return Pt(r)&&g(e,r),g(e,vt),d(i)&&!t?w(i):i},set:(e,r,n,i)=>{let o=Reflect.get(e,r,i),s=Reflect.set(e,r,n,i);return L(n,o)&&(Pt(r)?x(e,k.SET,[r,B,vt]):x(e,k.SET,r)),s}}),Tr=Me(true),Lr=Me(false),Cr={get(t,e){return e==="_IS_REACTIVE"?true:e==="_RAW"?t:Reflect.get(rt(ge,e)?ge:t,e,t)}},Pr={get(t,e){return e==="_IS_REACTIVE"?true:e==="_RAW"?t:Reflect.get(rt(ve,e)&&e in t?ve:t,e,t)}},ge={get(t){let e=h(this);g(e,C);let r=e.get(t);return d(r)&&!N(this)?w(r):r},set(t,e){let r=h(this),n=r.has(t),i=r.get(t),o=h(e);return r.set(t,o),(!n||L(i,o))&&x(r,k.SET,C),this},add(t){let e=h(this),r=h(t),n=e.has(r);return e.add(r),n?x(e,k.SET,C):x(e,k.ADD,C),this},has(t){let e=h(this);g(e,C);let r=e.has(t);return !r&&d(t)?e.has(h(t)):r},delete(t){let e=h(this),r=e.has(t),n=e.delete(t);return !n&&d(t)&&(n=e.delete(h(t))),(r||n)&&x(e,k.DELETE,C),n},clear(){let t=h(this),e=t.size>0,r=t.clear();return e&&x(t,k.CLEAR,C),r},forEach(t,e){let r=h(this),n=N(this);g(r,C),r.forEach((i,o)=>{let s=n||!d(i)?i:w(i),a=n||!d(o)?o:w(o);t.call(e,s,a,this);});},[Symbol.iterator](){let t=h(this),e=N(this);g(t,C);let r=t[Symbol.iterator]();return {next(){let{value:n,done:i}=r.next();return i?{value:n,done:i}:e?{value:n,done:i}:Array.isArray(n)?{value:n.map(o=>d(o)?w(o):o),done:i}:{value:d(n)?w(n):n,done:i}},[Symbol.iterator](){return this}}},get size(){let t=h(this);return g(t,C),t.size},keys(){let t=h(this),e=N(this);g(t,C);let r=t.keys();return {next(){let{value:n,done:i}=r.next();return i?{value:n,done:i}:{value:e||!d(n)?n:w(n),done:i}},[Symbol.iterator](){return this}}},values(){let t=h(this),e=N(this);g(t,C);let r=t.values();return {next(){let{value:n,done:i}=r.next();return i?{value:n,done:i}:{value:e||!d(n)?n:w(n),done:i}},[Symbol.iterator](){return this}}},entries(){let t=h(this),e=N(this);g(t,C);let r=t.entries();return {next(){let{value:n,done:i}=r.next();return i?{value:n,done:i}:e?{value:n,done:i}:{value:n.map(o=>d(o)?w(o):o),done:i}},[Symbol.iterator](){return this}}}},ve={get(t){let e=h(this);g(e,nt);let r=e.get(t);return r===void 0&&V(t)&&(r=e.get(h(t))),d(r)&&!N(this)?w(r):r},set(t,e){let r=h(this),n=h(t),i=r.has(n),o=r.get(n),s=h(e);return r.set(n,s),(!i||L(o,s))&&x(r,k.SET,nt),this},add(t){let e=h(this),r=h(t),n=e.has(r);return e.add(r),n||x(e,k.ADD,nt),this},has(t){let e=h(this);g(e,nt);let r=e.has(t);return !r&&V(t)&&(r=e.has(h(t))),r},delete(t){let e=h(this),r=h(t),n=e.has(r),i=e.delete(r);return (n||i)&&x(e,k.DELETE,nt),i}},Ir=t=>({get(e,r,n){if(r==="_RAW")return e;if(r==="_IS_REACTIVE")return true;if(r==="_IS_SHALLOW")return t;let i=Reflect.get(e,r,n),o=E(i)?i.value:i;return g(e,r),d(o)&&!t?w(o):o},set:(e,r,n,i)=>{let o=Reflect.get(e,r,i),s=Reflect.set(e,r,h(n),i);return L(n,o)&&x(e,k.SET,r,n),s},deleteProperty:(e,r)=>{let n=rt(e,r),i=Reflect.deleteProperty(e,r);return n&&i&&x(e,k.DELETE,r,void 0),i}});function w(t,e=false){if(!d(t)||V(t))return t;let r=pe.get(t);if(r)return r;let n;M(t)?n=e?Tr:Lr:ht(t)||dt(t)?n=Cr:Zt(t)||Qt(t)?n=Pr:n=Ir(e);let i=new Proxy(t,n);return pe.set(t,i),i}function V(t){return !!(t&&t._IS_REACTIVE)}function bt(t){return V(t)?(m("[Reactive] Target is already reactive. Returning existing reactive proxy to avoid double wrapping."),t):E(t)?(m("[Reactive] Creating a reactive proxy from a signal is not recommended. Use the signal directly or access its value property."),t):w(t)}function St(t){return V(t)?(N(t)?m("[ShallowReactive] Target is already a shallow reactive proxy. Returning existing proxy to avoid double wrapping."):m("[ShallowReactive] Target is already a deep reactive proxy. Cannot convert deep reactive to shallow reactive. Returning existing proxy."),t):E(t)?(m("[ShallowReactive] Creating a reactive proxy from a signal is not recommended. Use the signal directly or access its value property."),t):w(t,true)}function N(t){return !!(t&&t._IS_SHALLOW)}var Gn=t=>d(t)?bt(t):t,Re;Re="_IS_SIGNAL";var Ft=class{constructor(t,e=false){this.flag=1,this[Re]=true,this._oldValue=this._rawValue=t,e?this._value=d(t)?St(t):t:this._value=d(t)?bt(t):t,this._IS_SHALLOW=e;}get dep(){return this}get value(){let t=R;if(t&&Le(this,t),this.flag&16&&this.shouldUpdate()){let e=this.subLink;e&&Kt(e);}return this._value}set value(t){if(E(t)&&(m("Setting a signal value to another signal is not recommended. The value will be unwrapped automatically."),t=t.peek()),t=h(t),!L(this._rawValue,t))return;this.flag|=16,this._rawValue=t,this._IS_SHALLOW?this._value=d(t)?St(t):t:this._value=d(t)?bt(t):t;let r=this.subLink;r&&Ae(r);}shouldUpdate(){return this.flag&=-17,L(this._oldValue,this._oldValue=this._rawValue)}peek(){return this._value}set(t){this.value=t;}update(t){let e=t(this.peek());E(e)?(m("Returning a signal from an update function is not recommended. The value will be unwrapped."),this.value=e.peek()):this.value=e;}};function st(t){return E(t)?(m("Creating a signal with another signal is not recommended. The value will be unwrapped."),t):new Ft(t)}function Xn(t){return E(t)&&(m("Creating a shallow signal with another signal is not recommended. The value will be unwrapped."),t=t.peek()),new Ft(t,true)}function E(t){return !!t&&!!t._IS_SIGNAL}var gt=new Set,$t=new Set,Mr=Promise.resolve(),Dt=false;function Rr(t){return t?new Promise((e,r)=>{queueMicrotask(()=>{try{t(),e();}catch(n){r(n);}});}):Mr}function Et(t){gt.add(t),Oe();}function Oe(){Dt||(Dt=true,Rr(Ne));}function Or(t){$t.add(t),Oe();}function Ne(){for(Dt=false,Nr();gt.size>0;){let t=Array.from(gt);gt.clear();for(let e of t)try{e();}catch(r){p("Error executing queued job:",r);}}}function Nr(){let t=Array.from($t);$t.clear();for(let e of t)try{e();}catch(r){p("Error executing pre-flush callback:",r);}}function jr(t,e){switch(e){case "sync":return ()=>t();case "pre":return ()=>Or(t);case "post":return ()=>Et(t);default:return m(`Invalid flush timing: ${e}. Defaulting to 'post'.`),()=>Et(t)}}var W=0;function ye(t){$r();try{return t()}finally{Dr();}}function $r(){W++;}function Dr(){if(W===0){m("[Batch] endBatch() called without matching startBatch(). This may indicate unbalanced batch calls in your code.");return}--W===0&&(Ne(),W!==0&&p(`[Batch] Batch depth is not zero after endBatch(). Current depth: ${W}. This indicates a bug in batch management.`));}function Kr(){return W>0}function Jn(){return W}var je;je="_IS_EFFECT";var Fr=class{constructor(t,e){this.flag=18,this[je]=true,this._active=true,this.fn=t,e&&(this.scheduler=e.flush||e.scheduler,this.onStop=e.onStop,this.onTrack=e.onTrack,this.onTrigger=e.onTrigger);}get active(){return this._active}get dirty(){let t=this.flag;if(t&16)return true;if(t&32){if(this.depLink&&Ce(this.depLink,this))return this.flag=t&-33|16,true;this.flag=t&-33;}return false}pause(){this.flag|=256;}resume(){let e=this.flag&-257;this.flag=e;let r=(e&16)!==0,n=(e&32)!==0;(r||n)&&this.notify();}run(){if(!this._active)return this.fn();let t=this.flag;this.flag=t&-17|1024;let e=Pe(this);try{return this.fn()}catch(r){throw this.flag|=16,r}finally{this.flag&=-1025,Ie(this,e);}}getJob(){return this._job||(this._job=()=>this.run()),this._job}notify(){let t=this.flag;!this._active||t&1296||(this.flag=t|16,this.onTrigger&&this.onTrigger({effect:this,target:{},type:"set"}),this.scheduler?S(this.scheduler)?this.scheduler(this):jr(()=>this.run(),this.scheduler)():Kr()?Et(this.getJob()):this.run());}stop(){if(!this._active){m("[Effect] Attempting to stop an already stopped effect.");return}this._active=false;let t=this.depLink;for(;t;)t=yt(t,this);let e=this.subLink;for(;e;)e=yt(e);this._job=void 0,this.depLinkTail=void 0,this.subLinkTail=void 0,this.depLink&&p("[Effect] Cleanup verification failed: depLink not cleared. This indicates a memory leak in the dependency tracking system."),this.subLink&&p("[Effect] Cleanup verification failed: subLink not cleared. This indicates a memory leak in the subscription system."),this.onStop&&this.onStop();}};function wt(t,e){let r=new Fr(t,e);try{r.run();}catch(i){throw r.stop(),p("[Effect] Effect failed during initial execution and has been stopped. Fix the error in your effect function.",i),i}let n=()=>r.run();return n.effect=r,n.stop=()=>r.stop(),n}function Zn(t){t.effect.stop();}function Qn(t){return !!(t&&t._IS_EFFECT)}function ti(t,e,r){let n=e;return wt(()=>{n=t(n);},r)}var it=Symbol("computed-no-value"),$e;$e="_IS_COMPUTED";var be=class{constructor(t,e,r,n){this.flag=17,this[$e]=true,this._value=it,this.getter=t,this.setter=e,this.onTrack=r,this.onTrigger=n,this.flag|=16;}get value(){R&&Le(this,R);let t=this.flag,e=this._value!==it;return e&&!(t&48)?this._value:!e||t&16?(this.recompute(),this._value):(t&32&&(this.depLink&&Ce(this.depLink,this)?this.recompute():this.flag=t&-33),this._value)}set value(t){this.setter?this.setter(t):m(`[Computed] Cannot set readonly computed value. Provide a setter in the computed options to make it writable.
|
|
8
|
+
Example: computed({ get: () => value, set: (v) => { ... } })`);}peek(){return this._value===it&&this.recompute(),this._value}recompute(){let t=this._value,e=t!==it,r=Pe(this);try{let n=this.getter(),i=this.flag,o=-49;!e||L(t,n)?(this._value=n,this.flag=i&o,this.onTrigger&&this.onTrigger({effect:this,target:this,type:"set",key:"value",newValue:n}),this.subLink&&ke(this.subLink)):this.flag=i&o;}catch(n){throw this.flag&=-49,p("[Computed] Error occurred while computing value. Check your getter function for errors.",n),n}finally{Ie(this,r);}}shouldUpdate(){let t=this._value!==it,e=this._value;return this.recompute(),t?L(this._value,e):true}};function zr(t){if(Y(t))return m("[Computed] Creating a computed from another computed is not recommended. The existing computed will be returned to avoid unnecessary wrapping."),t;if(!t)throw new Error("[Computed] Invalid argument: computed() requires a getter function or options object.");if(S(t))return new be(t);if(ee(t)){let{get:e,set:r,onTrack:n,onTrigger:i}=t;if(!e)throw new Error(`[Computed] Invalid options: getter function is required.
|
|
9
|
+
Usage: computed({ get: () => value, set: (v) => { ... } })`);if(!S(e))throw new TypeError(`[Computed] Invalid options: getter must be a function.
|
|
10
|
+
Received: ${typeof e}`);return new be(e,r,n,i)}throw new Error(`[Computed] Invalid argument: expected a function or options object.
|
|
11
|
+
Received: ${typeof t}`)}function Y(t){return !!t&&!!t._IS_COMPUTED}function Hr(t){if(!t.state)throw m("Store state is required"),new Error("Store state is required");let{state:e,getters:r,actions:n}=t,i=Ot({},e),o=bt(e),s=new Set,a=new Set,c={patch$(u){if(!u){m("Patch payload is required");return}ye(()=>{Object.assign(o,u);}),s.forEach(f=>f(o)),a.forEach(f=>f(o));},subscribe$(u){if(!u){m("Subscribe callback is required");return}s.add(u);},unsubscribe$(u){s.delete(u);},onAction$(u){if(!u){m("Action callback is required");return}a.add(u);},reset$(){ye(()=>{Object.assign(o,i);}),s.forEach(u=>u(o)),a.forEach(u=>u(o));}},l=Ot(xr(Ot({},o),{state:o}),c);if(r)for(let u in r){let f=r[u];f&&Object.defineProperty(l,u,{get(){return zr(()=>f.call(l,o)).value},enumerable:true,configurable:true});}if(n)for(let u in n){let f=n[u];f&&(l[u]=(...y)=>{let b=f.apply(o,y);return a.forEach(I=>I(o)),b});}return l}function qr(t){let e=new t,r=Object.create(null),n={},i={};return Object.getOwnPropertyNames(e).forEach(o=>{r[o]=e[o];}),Object.getOwnPropertyNames(t.prototype).forEach(o=>{let s=Object.getOwnPropertyDescriptor(t.prototype,o);s&&(typeof s.get=="function"?n[o]=function(){return s.get.call(this)}:typeof s.value=="function"&&o!=="constructor"&&(i[o]=function(...a){return s.value.apply(this,a)}));}),{state:r,getters:n,actions:i}}function ei(t){if(!t)throw m("Store definition is required"),new Error("Store definition is required");return ()=>{let e;typeof t=="function"?e=qr(t):e=t;let r=Hr(e);return typeof t=="function"&&Object.keys(e.actions||{}).forEach(n=>{r[n]=e.actions[n].bind(r);}),r}}var Se,Ee,we=class extends(Ee=Ft,Se="_IS_REF",Ee){constructor(t){super(t,true),this[Se]=true;}get value(){return g(this,de),this._value}set value(t){E(t)&&(t=t.value),De(t)&&(t=t.value),L(this._value,t)&&(this._value=t,this.subLink&&Kt(this.subLink),x(this,"SET",de));}};function ri(t=void 0){return De(t)?(Rt("Creating a ref with another ref is not recommended. The value will be unwrapped."),t):E(t)?(Rt("Creating a ref with a signal is not recommended. The value will be unwrapped."),new we(t.peek())):new we(t)}function De(t){return !!t&&!!t._IS_REF}var _e={},xe=new WeakMap;function F(t,e=new Set){if(!d(t)||e.has(t))return t;if(e.add(t),E(t)||Y(t))return F(t.value,e);if(Array.isArray(t))for(let r of t)F(r,e);else dt(t)?(t.forEach(r=>{F(r,e);}),t.keys(),t.values()):ht(t)?(t.forEach(r=>{F(r,e);}),t.values()):Object.keys(t).forEach(r=>{F(t[r],e);});return t}function Z(t){if(!d(t))return t;if(Array.isArray(t))return t.map(r=>Z(r));if(dt(t)){let r=new Map;return t.forEach((n,i)=>{r.set(i,Z(n));}),r}if(ht(t)){let r=new Set;return t.forEach(n=>{r.add(Z(n));}),r}let e={};for(let r of Object.keys(t))e[r]=Z(t[r]);return e}function Ur(t){return Array.isArray(t)?()=>t.map(e=>E(e)||Y(e)?e.value:V(e)?F(e):S(e)?e():e):S(t)?t:E(t)?()=>t.value:d(t)&&"value"in t?()=>t.value:V(t)?()=>F(t):()=>t}function ni(t,e,r={}){let{immediate:n=false,deep:i=false}=r,o=_e,s=Ur(t),a=()=>{let l=c.effect;if(!l.run)return;let u=l.run();L(u,o)&&(e(u,o===_e?void 0:o),o=Z(u));},c=wt(()=>{let l=s();return i&&F(l),l},{scheduler:()=>Et(a)});return n?a():o=Z(c.effect.run()),()=>{c.stop();let l=xe.get(c.effect);l&&(l.forEach(u=>u()),xe.delete(c.effect));}}var Br=Object.defineProperty,Ke=Object.getOwnPropertySymbols,Wr=Object.prototype.hasOwnProperty,Vr=Object.prototype.propertyIsEnumerable,Fe=(t,e,r)=>e in t?Br(t,e,{enumerable:true,configurable:true,writable:true,value:r}):t[e]=r,Ut=(t,e)=>{for(var r in e||(e={}))Wr.call(e,r)&&Fe(t,r,e[r]);if(Ke)for(var r of Ke(e))Vr.call(e,r)&&Fe(t,r,e[r]);return t},Bt=(t,e,r)=>new Promise((n,i)=>{var o=c=>{try{a(r.next(c));}catch(l){i(l);}},s=c=>{try{a(r.throw(c));}catch(l){i(l);}},a=c=>c.done?n(c.value):Promise.resolve(c.value).then(o,s);a((r=r.apply(t,e)).next());}),at=null,Ge=[],Yr=0;function Gr(t=null){let e={id:++Yr,parent:t,provides:new Map,cleanup:new Set,mount:new Set,update:new Set,destroy:new Set,isMount:false,isDestroy:false,children:new Set};return t&&t.children.add(e),e}function q(){return at}function _t(t){at&&Ge.push(at),at=t;}function zt(){at=Ge.pop()||null;}function Xe(t){if(!t||t.isDestroy)return;Array.from(t.children).forEach(Xe),Xr(t);}function Xr(t){if(!(!t||t.isDestroy)){t.parent&&(t.parent.children.delete(t),t.parent=null);try{t.cleanup.forEach(e=>e()),t.cleanup.clear(),t.mount.clear(),t.update.clear(),t.destroy.clear(),t.provides.clear(),t.children.clear();}catch(e){p("Error during context cleanup:",e);}t.isDestroy=true;}}var K={mount:"mount",destroy:"destroy",update:"update"};function Gt(t,e){let r=q();if(!r){p(`Cannot register ${t} hook outside component context`);return}if(!K[t]){p(`Invalid lifecycle type: ${t}`);return}if(t===K.mount&&r.isMount){try{e();}catch(n){p(`Error in ${t} hook:`,n);}return}r[t].add(e);}function xt(t){let e=q();if(!e){p(`Cannot trigger ${t} hook outside component context`);return}let r=e[t];r!=null&&r.size&&r.forEach(n=>{try{n();}catch(i){p(`Error in ${t} lifecycle hook:`,i);}});}function Jr(t){Gt(K.mount,t);}function Zr(t){Gt(K.destroy,t);}function hi(t){Gt(K.update,t);}var Qr="on",Je="ref",tn="key",en="http://www.w3.org/2000/svg",ze="http://www.w3.org/2000/xlink",He="http://www.w3.org/2000/xmlns/",qe=/^\d+-\d+$/,Ht=1e3,Ue=new WeakMap;function rn(t){let e=Ue.get(t);if(!e){let r=t.name||"anonymous",n=Ze(t.toString()).toString(36);e=`${r}_${n}`,Ue.set(t,e);}return e}function Ze(t){let e=0,r=t.length<100?t.length:100;for(let n=0;n<r;n++)e=Math.trunc((e<<5)-e+t.charCodeAt(n));return e<0?-e:e}var nn=0;function Qe(t){if(!pt(t)){if(v(t))return t.length<=Ht?t:(m(`[Key System] Key length exceeds ${Ht} characters. Consider using a shorter identifier.`),`${t.slice(0,Ht-10)}_${Ze(t).toString(36)}`);if(Tt(t)){{if(t!==t){m("[Key System] NaN cannot be used as a key");return}if(!Number.isFinite(t)){m("[Key System] Infinity cannot be used as a key");return}}return String(t)}if(Lt(t)){let e=Symbol.keyFor(t);if(e)return `_s.${e}`;let r=t.description;return r?`_s.${r}`:`${nn++}`}return String(t)}}var Wt=Symbol("essor.key");function Vt(t,e){if(T(t))return;if(!t||t.nodeType===Node.DOCUMENT_NODE){m("[Key System] Cannot set key on invalid node");return}let r=Qe(e);pt(r)?delete t[Wt]:t[Wt]=r;}function G(t){if(t)return T(t)?t.key:t[Wt]}function X(t){if(t)try{if(T(t))t.destroy();else {let e=t;e.parentElement&&e.remove();}}catch(e){p("Failed to remove node:",e);}}function P(t,e,r=null){if(!(!t||!e))try{let n=T(r)?r.firstChild:r;if(T(e)){e.mount(t,n);return}n?t.insertBefore(e,n):(e||p("insertNode: child is not a Node",e),t.appendChild(e));}catch(n){p("Failed to insert node:",n);}}function Xt(t,e,r){if(!(!t||!e||!r||e===r))try{P(t,e,r),X(r);}catch(n){p("Failed to replace node:",n);}}function ct(t){return t?T(t)?t.firstChild:t:null}function z(t,e){let r=G(t),n=G(e);if(r!==n)return false;let i=T(t),o=T(e);if(i&&o)return t.component===e.component;if(i!==o)return false;let s=t,a=e;return s.nodeType!==a.nodeType?false:s.nodeType===Node.ELEMENT_NODE?s.tagName===a.tagName:true}function Q(t){if(et(t))return t;if(te(t)){let e=pt(t)?"":String(t);return document.createTextNode(e)}return t}function on(t){return t instanceof HTMLInputElement}function sn(t){return t instanceof HTMLSelectElement}function an(t){return t instanceof HTMLTextAreaElement}function Be(t){return t instanceof Text}function cn(t,e){if(t===e)return true;if(!t||!e||Array.isArray(t)!==Array.isArray(e))return false;for(let r in t)if(t[r]!==e[r])return false;for(let r in e)if(!(r in t))return false;return true}function We(t,e){if(T(t)||T(e))return;let r=G(t);r&&!G(e)&&Vt(e,r);}function H(t,e,r){if(r===e)return e;let n=et(e);if(et(r)&&n){if(r.isEqualNode(e))return e;if(e.tagName===r.tagName){let a=e.attributes,c=r.attributes;for(let l=a.length-1;l>=0;l--){let u=a[l].name;r.hasAttribute(u)||e.removeAttribute(u);}for(let l=0,u=c.length;l<u;l++){let f=c[l];e.getAttribute(f.name)!==f.value&&e.setAttribute(f.name,f.value);}return We(e,r),e}}if(Be(e)&&Be(r))return e.textContent!==r.textContent&&(e.textContent=r.textContent),We(e,r),e;let o=T(e),s=T(r);return o&&s&&e.component===r.component?r.update(e):(Xt(t,r,e),r)}function ln(t,e,r,n){let i=e.length,o=r.length;if(i===0&&o===0)return [];if(i===0){let s=document.createDocumentFragment();for(let a=0;a<o;a++)P(s,r[a]);return P(t,s,n),r}if(o===0){for(let s=0;s<i;s++)X(e[s]);return []}if(i===1&&o===1){let s=e[0],a=r[0];return z(s,a)?(H(t,s,a),r[0]=s):Xt(t,a,s),r}if(i===2&&o===2){let s=e[0],a=e[1],c=r[0],l=r[1];if(z(s,c)&&z(a,l))return H(t,s,c),H(t,a,l),r[0]=s,r[1]=a,r;if(z(s,l)&&z(a,c)){H(t,s,l),H(t,a,c);let u=ct(a),f=ct(s);return u&&f&&u.parentNode===t&&t.insertBefore(u,f),r[0]=a,r[1]=s,r}}return un(t,e,r,n)}function un(t,e,r,n){let i=0,o=0,s=e.length-1,a=r.length-1,c=e[0],l=e[s],u=r[0],f=r[a];for(;i<=s&&o<=a;)if(!c)c=e[++i];else if(!l)l=e[--s];else if(z(c,u))H(t,c,u),r[o]=c,c=e[++i],u=r[++o];else break;for(;i<=s&&o<=a;)if(!c)c=e[++i];else if(!l)l=e[--s];else if(z(l,f))H(t,l,f),r[a]=l,l=e[--s],f=r[--a];else break;if(i>s){if(o<=a){let y=a+1<r.length?ct(r[a+1]):n;for(let b=o;b<=a;b++)P(t,r[b],y);}}else if(o>a)for(let y=i;y<=s;y++){let b=e[y];b&&X(b);}else fn(t,e,r,i,s,o,a,n);return r}function fn(t,e,r,n,i,o,s,a){let c=s-o+1,l=r.length,u;for(let _=o;_<=s;_++){let A=G(r[_]);A!==void 0&&(u||(u=Object.create(null)),u[A]=_);}let f=new Int32Array(c),y=false,b=0,I=0;for(let _=n;_<=i;_++){let A=e[_];if(!A)continue;if(I>=c){X(A);continue}let O,U=G(A);if(U!==void 0&&u&&U in u)O=u[U];else for(let j=o;j<=s;j++)if(f[j-o]===0&&U===void 0&&G(r[j])===void 0&&z(A,r[j])){O=j;break}O===void 0?X(A):(f[O-o]=_+1,O>=b?b=O:y=true,H(t,A,r[O]),r[O]=A,I++);}let tt=y?hn(f):[],kt=tt.length-1;for(let _=c-1;_>=0;_--){let A=o+_,O=r[A],U=A+1<l?ct(r[A+1]):a;if(f[_]===0)P(t,O,U);else if(y)if(kt<0||_!==tt[kt]){let j=ct(O);j&&j.parentNode===t&&P(t,j,U);}else kt--;}}function hn(t){let e=t.length;if(e===0)return [];if(e===1)return t[0]!==0?[0]:[];let r=[],n=new Int32Array(e),i,o,s,a,c;for(i=0;i<e;i++){let l=t[i];if(l!==0){if(o=r[r.length-1],r.length===0||t[o]<l){n[i]=o,r.push(i);continue}for(s=0,a=r.length-1;s<a;)c=s+a>>1,t[r[c]]<l?s=c+1:a=c;l<t[r[s]]&&(s>0&&(n[i]=r[s-1]),r[s]=i);}}for(s=r.length,a=r[s-1];s-- >0;)r[s]=a,a=n[a];return r}function D(t,e,r,n){t.addEventListener(e,r,n);let i=q();i&&i.cleanup.add(()=>{t.removeEventListener(e,r,n);});}function di(t,e,r,n){if(on(t))switch(t.type){case "checkbox":D(t,"change",()=>{n(!!t.checked);});break;case "radio":D(t,"change",()=>{n(t.checked?t.value:"");});break;case "file":D(t,"change",()=>{n(t.files);});break;case "number":case "range":D(t,"input",()=>{n(t.value||"");});break;case "date":case "datetime-local":case "month":case "time":case "week":D(t,"change",()=>{n(t.value||"");});break;default:D(t,"input",()=>{n(t.value);});break}else sn(t)?D(t,"change",()=>{if(t.multiple){let i=Array.from(t.options).filter(o=>o.selected).map(o=>o.value);n(i);}else n(t.value);}):an(t)&&D(t,"input",()=>{n(t.value);});}function pi(t,e,r,n){if(!t)return;let i=q();if(!i)return;let o=[],s=wt(()=>{let a=S(e)?e():e,c=ne(a).map(Q);o=ln(t,o,c,r);});i.cleanup.add(()=>{s(),n!=null&&n.preserveOnCleanup||o.forEach(a=>X(a)),o.length=0;});}function dn(t,e){let r=e.length,n=new Array(r),i=new Set(e),o=1,s=0,a=c=>{if(c.nodeType!==Node.DOCUMENT_FRAGMENT_NODE){if(i.has(o)&&(n[s++]=c,s===r))return true;o++;}let l=c.firstChild;for(;l;){if(a(l))return true;l=l.nextSibling;}return false};return a(t),n}var tr;tr="normal";var pn=class{constructor(t,e){if(this.component=t,this.props=e,this.renderedNode=null,this.componentContext=null,this.parentNode=null,this.beforeNode=null,this.reactiveProps={},this._propSnapshots={},this.state=0,this.context=null,this.parentContext=null,this[tr]=true,this.key=e!=null&&e.key?Qe(e.key):rn(t),this.reactiveProps=St(Ut({},this.props||{})),this.parentContext=q(),this.props)for(let r in this.props){let n=this.props[r];d(n)&&n!==null&&(this._propSnapshots[r]=Array.isArray(n)?[...n]:Ut({},n));}}get isConnected(){return this.state===2}get firstChild(){var t;return (t=this.renderedNode)!=null?t:null}mount(t,e){if(this.parentNode=t,this.beforeNode=e||null,this.state=1,this.renderedNode)return P(t,this.renderedNode,e),this.renderedNode;this.componentContext=Gr(this.parentContext),_t(this.componentContext);let r=this.component(this.reactiveProps);return S(r)&&(r=r(this.reactiveProps)),(E(r)||Y(r))&&(r=r.value),this.renderedNode=r,P(t,this.renderedNode,e),this.applyProps(this.props||{}),this.state=2,this.componentContext&&(this.componentContext.isMount=true),xt(K.mount),this.renderedNode}update(t){if(this.key!==t.key)return this.mount(t.parentNode,t.beforeNode),this;if(this.parentNode=t.parentNode,this.beforeNode=t.beforeNode,this.componentContext=t.componentContext,this.renderedNode=t.renderedNode,this.state=t.state,this.reactiveProps=t.reactiveProps,this._propSnapshots=t._propSnapshots,this.props)for(let e in this.props){if(e==="key")continue;let r=this.props[e],n=this.reactiveProps[e];if(d(r)&&r!==null){let i=this._propSnapshots[e];if(!i||!cn(r,i)){let o=Array.isArray(r)?r.slice():Object.assign({},r);this.reactiveProps[e]=o,this._propSnapshots[e]=o;}}else L(r,n)&&(this.reactiveProps[e]=r,this._propSnapshots[e]&&delete this._propSnapshots[e]);}return !this.isConnected&&this.parentNode&&this.mount(this.parentNode,this.beforeNode),this.componentContext&&(_t(this.componentContext),this.applyProps(this.props||{}),xt(K.update),zt()),this}forceUpdate(){return Bt(this,null,function*(){if(this.state===5||!this.parentNode||!this.componentContext)return;let t=this.renderedNode,e;try{this.componentContext&&_t(this.componentContext),e=this.component(this.reactiveProps),S(e)&&(e=e(this.reactiveProps)),(E(e)||Y(e))&&(e=e.value),t&&e&&t!==e&&this.parentNode&&(Xt(this.parentNode,e,t),this.renderedNode=e),yield xt(K.update);}catch(r){throw p("Force update failed:",r),r}finally{this.componentContext&&zt();}})}destroy(){if(this.state===4||this.state===5)return;this.state=4;let t=this.componentContext;t&&(_t(t),xt(K.destroy),Xe(t),this.componentContext=null,zt());let e=this.renderedNode;e&&X(e),this.renderedNode=null,this.parentNode=null,this.beforeNode=null,this.reactiveProps={},this.props=void 0,this.state=5;}applyProps(t){if(t){for(let[e,r]of Object.entries(t))if(ie(e,Qr)&&this.renderedNode){let n=e.slice(2).toLowerCase();et(this.renderedNode)&&D(this.renderedNode,n,r);}else e===Je&&E(r)&&(r.value=this.renderedNode);this.props=t;}}};function T(t){return !!t&&!!t.normal}function er(t,e){return T(t)?t:new pn(t,e)}function mn(t){let e,r=()=>{let n=document.createElement("template");n.innerHTML=t;let i=n.content.firstChild;if(!i)throw new Error("Invalid template: empty content");return i};return ()=>(e||(e=r())).cloneNode(true)}function mi(t,e){let r=v(e)?document.querySelector(e):e;if(!r){p(`Target element not found: ${e}`);return}r.innerHTML&&(p(`Target element is not empty, it will be delete: ${e}`),r.innerHTML="");let i=er(t);return i.mount(r),i}function gn(t,e){let r=q();if(!r){p("provide must be called within a template");return}r.provides.set(t,e);}function vn(t,e){let r=q();if(!r)return p("inject must be called within a template"),e;let n=r;for(;n;){let i=n.provides.get(t);if(!Ct(i))return i;n=n.parent;}return e}function yn(t){let e=t.target,r=`${t.type}`,n=t.target,i=t.currentTarget,o=c=>Object.defineProperty(t,"target",{configurable:true,value:c}),s=()=>{let c=e[`_$${r}`];if(c&&S(c)&&!e.disabled){let l=e[`${r}Data`];if(l?c.call(e,l,t):c.call(e,t),t.cancelBubble)return false}return e.host&&!v(e.host)&&!e.host._$host&&S(e.contains)&&e.contains(t.target)&&o(e.host),true},a=()=>{for(;s()&&(e=e._$host||e.parentNode||e.host););};if(Object.defineProperty(t,"currentTarget",{configurable:true,get(){return e||document}}),t.composedPath){let c=t.composedPath();o(c[0]);for(let l=0;l<c.length-2&&(e=c[l],!!s());l++){if(e._$host){e=e._$host,a();break}if(e.parentNode===i)break}}else a();o(n);}var Ve=Symbol("_$EVENTS");function gi(t,e=window.document){let r=e,n=r[Ve]||(r[Ve]=new Set);for(let i of t)n.has(i)||(n.add(i),e.addEventListener(i,yn));}function vi(t,e,r,n=false){if(e===r)return;let i=Yt(r),o=Yt(e);i&&o===i||(i?n?t.setAttribute("class",i):t.className=i:t.removeAttribute("class"));}function Yt(t){if(t==null)return "";if(typeof t=="string")return t.trim();if(M(t))return t.map(Yt).filter(Boolean).join(" ");if(d(t)){let e=[];for(let r in t)t[r]&&e.push(r);return e.join(" ")}return String(t).trim()}var Ye=/\s*!important$/,bn=["Webkit","Moz","ms"],qt={};function yi(t,e,r){let n=t.style,i=v(r);if(r&&i){e!==r&&(n.cssText=r);return}if(!r){e&&t.removeAttribute("style");return}if(e&&!v(e))for(let o in e)(!r||r[o]==null)&&At(n,o,"");else if(e&&v(e)){let o=e.split(";");for(let s of o){let a=s.indexOf(":");if(a>0){let c=s.slice(0,a).trim();r&&d(r)&&r[c]==null&&At(n,c,"");}}}if(r&&!v(r))for(let o in r){let s=r[o];(!e||v(e)||e[o]!==s)&&s!=null&&At(n,o,s);}}function At(t,e,r){if(M(r)){for(let i of r)At(t,e,i);return}if((r==null||r==="")&&(r=""),e.startsWith("--")){t.setProperty(e,r);return}let n=Sn(t,e);typeof r=="string"&&Ye.test(r)?t.setProperty(Mt(n),r.replace(Ye,""),"important"):t[n]=r;}function Sn(t,e){let r=qt[e];if(r)return r;let n=Mt(e);if(n!=="filter"&&n in t)return qt[e]=n;n=se(n);for(let i of bn){let o=i+n;if(o in t)return qt[e]=o}return e}function bi(t,e,r,n){if(e===Je){r.value=t;return}if(e===tn){n==null?Vt(t,void 0):Vt(t,String(n));return}let i=(t==null?void 0:t.namespaceURI)===en,o=i&&e.startsWith("xlink:"),s=i&&e.startsWith("xmlns:"),a=ce(e)||le(e);if(r===n)return;let c=e.toLowerCase();if(/^on[a-z]+/.test(c)||c==="innerhtml")return;if(n==null){if(o)t.removeAttributeNS(ze,e.slice(6));else if(s){let f=e.slice(6);t.removeAttributeNS(He,f);}else t.removeAttribute(e);return}if(o){t.setAttributeNS(ze,e,String(n));return}if(s){t.setAttributeNS(He,e,String(n));return}if(a){ue(n)?t.setAttribute(e,""):t.removeAttribute(e);return}let l=Lt(n)?String(n):n;if((c==="href"||c==="src"||c==="xlink:href")&&typeof l=="string"){let f=l.trim().toLowerCase();if(f.startsWith("javascript:")||f.startsWith("data:"))return}if(i)t.setAttribute(e,String(l));else if(e in t)try{t[e]=l;}catch(f){t.setAttribute(e,String(l));}else t.setAttribute(e,String(l));}function Si(t,e,r,n){if(!(n!=null&&n.delegate))return t.addEventListener(e,r,n),()=>t.removeEventListener(e,r,n);let i=n.delegate,o=a=>{let c=a.target;(c.matches(i)||c.closest(i))&&r.call(t,a);},s=Ut({},n);return s.delegate=void 0,t.addEventListener(e,o,s),()=>{t.removeEventListener(e,o,s);}}function En(t){if(typeof document=="undefined"){let n=t.children;return n?(Array.isArray(n)?n:[n]).map(o=>String(o||"")).join(""):""}let e=document.createDocumentFragment(),r=t.children;return r&&(Array.isArray(r)?r:[r]).forEach(i=>{if(i!=null){let o=Q(i);o&&P(e,o);}}),e}En.fragment=true;function Ei(t){return !!t&&!!t.fragment}function wn(t){if(typeof document=="undefined"){let r=t.children;return r?(M(r)?r:[r]).map(i=>String(i||"")).join(""):""}let e=document.createComment("portal");return e.portal=true,Jr(()=>{let r=v(t.target)?document.querySelector(t.target):t.target;if(!r){m(`[Portal] Target element not found: ${t.target}`);return}let n=t.children;n&&(M(n)?n:[n]).forEach(o=>{if(o!=null){let s=Q(o);s&&P(r,s);}});}),e}wn.portal=true;function wi(t){return !!t&&!!t.portal}var rr=Symbol("SuspenseContext");function _n(t){if(re(document)){let f=t.fallback;return f?String(f||""):""}let e=document.createElement("div");e.style.display="contents";let r=true,n=0,i=false,o=null,s=()=>{if(!i){for(i=true;e.firstChild;)e.removeChild(e.firstChild);if(t.fallback!=null){let f=Q(t.fallback);f&&P(e,f);}}},a=()=>{if(!(!i||!(o||t.children!=null&&!ft(t.children)))){for(i=false;e.firstChild;)e.removeChild(e.firstChild);o?c(o):t.children!=null&&!ft(t.children)&&c(t.children);}},c=f=>{for(;e.firstChild;)e.removeChild(e.firstChild);if(f==null)return;let y=q();if((M(f)?f:[f]).forEach(I=>{if(I!=null){T(I)&&(I.parentContext=y);let tt=Q(I);tt&&P(e,tt);}}),i){for(;e.firstChild;)e.removeChild(e.firstChild);if(t.fallback!=null){let I=Q(t.fallback);I&&P(e,I);}}},l={register:f=>{n++,s(),f.then(()=>{r&&(n--,n===0&&a());}).catch(y=>{m("[Suspense] Resource failed:",y),r&&(n--,n===0&&a());});},increment:()=>{n++,s();},decrement:()=>{n--,n===0&&a();}};gn(rr,l);let u=t.children;return ft(u)?(u.then(f=>{o=f;}).catch(()=>{}),l.register(u)):u!=null?c(u):s(),Zr(()=>{for(r=false;e.firstChild;)e.removeChild(e.firstChild);}),e}_n.suspense=true;function _i(t){return !!t&&!!t.suspense}function xi(t,e){let r=st(e==null?void 0:e.initialValue),n=st(true),i=st(null),o=st("pending"),s=0,a=null,c=()=>Bt(null,null,function*(){let f=++s;n.value=true,o.value="pending",i.value=null;let y=t();a=y.then(()=>{});try{let b=yield y;f===s&&(r.value=b,o.value="ready",n.value=!1);}catch(b){f===s&&(i.value=b instanceof Error?b:new Error(String(b)),o.value="errored",n.value=false);}});c();let l=(()=>{if(n.value&&a){let f=vn(rr,null);f&&f.register(a);}return r.value});return l.loading=n,l.error=i,l.state=o,[l,{mutate:f=>{r.value=f,o.value="ready",n.value=false,i.value=null;},refetch:()=>Bt(null,null,function*(){yield c();})}]}var nr=0;function xn(){return `${nr++}`}function ir(){nr=0;}function lt(t,e=false){return Ct(t)?"":v(t)?t:M(t)?t.map(r=>lt(r,e)).join(""):S(t)?lt(t(),e):String(t)}function An(t,e){let r=/^<([a-z]+)(\s*)([^>]*)>/i,n=/data-idx="(\d+)"/g,i=/<!--(.*?)-->/g;return t.replace(r,`<$1$2$3 data-hk="${e}">`).replaceAll(n,`data-idx="${e}-$1"`).replaceAll(i,`<!--${e}-$1-->`)}function Ai(t,e){if(!S(t))return p("Component must be a function"),"";ir();let r=t(e);return lt(r)}function ki(t,e,...r){let n="",i=0;for(let s of t)if(n+=s,i<r.length){let a=r[i++];a&&(n+=lt(a));}return An(n,e)}function Ti(t,e={}){if(!S(t))return p("create ssg component: Component is not a function"),"";let r=t(e);return lt(r)}function or(t){if(M(t)){let e={};for(let r of t){let n=v(r)?Cn(r):or(r);if(n)for(let i in n)e[i]=n[i];}return e}if(v(t)||d(t))return t}var kn=/;(?![^(]*\))/g,Tn=/:([\s\S]+)/,Ln=/\/\*[\s\S]*?\*\//g;function Cn(t){let e={};return t.replaceAll(Ln,"").split(kn).forEach(r=>{if(r){let n=r.split(Tn);n.length>1&&(e[n[0].trim()]=n[1].trim());}}),e}function Pn(t){if(!t)return "";if(v(t))return t;let e="";for(let r in t){let n=t[r];if(v(n)||Tt(n)){let i=r.startsWith("--")?r:oe(r);e+=`${i}:${n};`;}}return e}function sr(t){let e="";if(v(t))e=t;else if(M(t))for(let r of t){let n=sr(r);n&&(e+=`${n} `);}else if(d(t))for(let r in t)t[r]&&(e+=`${r} `);return e.trim()}function In(t,e,r){if(E(e)||Y(e))return In(t,e.value);if(!e&&e!==0)return "";if(t==="style"){let n=or(e);return n?v(n)?` style="${n}"`:` style="${Pn(n)}"`:""}if(t==="class"){let n=sr(e);return n?` class="${n}"`:""}return t.startsWith("on")?"":e===true?` ${t}`:` ${t}="${e}"`}function Li(t){return ()=>{let e=xn();return document.querySelector(`[data-hk="${e}"]`)||mn(t)()}}function Ci(t,e){let r=t.dataset.hk;if(!r)return dn(t,e);let n=[],i=t.querySelectorAll(`[data-idx^="${r}"]`);i.length>0&&n.push(...Array.from(i).filter(c=>{let l=c.dataset.idx;return l!==null&&qe.test(l)}).map(c=>{let l=c.dataset.idx||"",[u,f]=l.split("-");return {hk:u,idx:f,node:c}}));let o=[],s=c=>{if(c.nodeType===Node.COMMENT_NODE&&c.textContent&&qe.test(c.textContent)){let[u,f]=c.textContent.split("-");o.push({hk:u,idx:f,node:c});}let l=c.firstChild;for(;l;)s(l),l=l.nextSibling;};s(t),n.push(...o);let a=[t];return e.forEach(c=>{let l=n.find(u=>u.idx===String(c));l&&a.push(l.node);}),a}function Pi(t,e,r={}){ir();try{let n=v(e)?document.querySelector(e):e;if(!n){p("Hydration error: Root element not found");return}let i=er(t,r);return i.mount(n),i}catch(n){p("Hydration error:",n);return}}globalThis&&(globalThis.__essor_version__=Jt);/**
|
|
12
|
+
* @estjs/signals v0.0.15-beta.1
|
|
9
13
|
* (c) 2023-Present jiangxd <jiangxd2016@gmail.com>
|
|
10
14
|
* @license MIT
|
|
11
15
|
**/
|
|
12
16
|
/**
|
|
13
|
-
* @estjs/template v0.0.
|
|
17
|
+
* @estjs/template v0.0.15-beta.1
|
|
14
18
|
* (c) 2023-Present jiangxd <jiangxd2016@gmail.com>
|
|
15
19
|
* @license MIT
|
|
16
|
-
**/exports.Fragment=
|
|
20
|
+
**/exports.Component=pn;exports.Fragment=En;exports.Portal=wn;exports.Suspense=_n;exports.SuspenseContext=rr;exports.TriggerOpTypes=k;exports.__version=Jt;exports.addEvent=Si;exports.addEventListener=D;exports.batch=ye;exports.bindElement=di;exports.computed=zr;exports.createApp=mi;exports.createComponent=er;exports.createResource=xi;exports.createSSGComponent=Ti;exports.createStore=ei;exports.delegateEvents=gi;exports.effect=wt;exports.endBatch=Dr;exports.escapeHTML=hr;exports.getBatchDepth=Jn;exports.getHydrationKey=xn;exports.getRenderedElement=Li;exports.hydrate=Pi;exports.inject=vn;exports.insert=pi;exports.isBatching=Kr;exports.isComponent=T;exports.isComputed=Y;exports.isEffect=Qn;exports.isFragment=Ei;exports.isPortal=wi;exports.isReactive=V;exports.isRef=De;exports.isShallow=N;exports.isSignal=E;exports.isSuspense=_i;exports.mapNodes=dn;exports.mapSSRNodes=Ci;exports.memoEffect=ti;exports.nextTick=Rr;exports.normalizeClass=Yt;exports.onDestroy=Zr;exports.onMount=Jr;exports.onUpdate=hi;exports.patchAttr=bi;exports.patchClass=vi;exports.patchStyle=yi;exports.provide=gn;exports.queueJob=Et;exports.queuePreFlushCb=Or;exports.reactive=bt;exports.ref=ri;exports.render=ki;exports.renderToString=Ai;exports.setSSGAttr=In;exports.setStyle=At;exports.shallowReactive=St;exports.shallowSignal=Xn;exports.signal=st;exports.startBatch=$r;exports.stop=Zn;exports.template=mn;exports.toRaw=h;exports.toReactive=Gn;exports.trigger=x;exports.untrack=Yn;exports.watch=ni;//# sourceMappingURL=essor.cjs.js.map
|
|
17
21
|
//# sourceMappingURL=essor.cjs.js.map
|