essor 0.0.7-beta.6 → 0.0.8
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/LICENSE +20 -20
- package/dist/essor.cjs.js +9 -9
- package/dist/essor.cjs.js.map +1 -1
- package/dist/essor.d.cts +2208 -2208
- package/dist/essor.d.ts +2208 -2208
- package/dist/essor.dev.cjs.js +10 -9
- package/dist/essor.dev.esm.js +10 -9
- package/dist/essor.esm.js +4 -4
- package/dist/essor.esm.js.map +1 -1
- package/package.json +2 -2
- package/types/component.d.ts +18 -18
- package/types/index.d.ts +3 -3
- package/types/jsx.d.ts +2182 -2182
- package/types/node.d.ts +16 -16
package/dist/essor.dev.cjs.js
CHANGED
|
@@ -18,7 +18,7 @@ var __spreadValues = (a, b) => {
|
|
|
18
18
|
};
|
|
19
19
|
|
|
20
20
|
// src/version.ts
|
|
21
|
-
var
|
|
21
|
+
var essor_version = "0.0.7";
|
|
22
22
|
|
|
23
23
|
// ../shared/dist/essor-shared.js
|
|
24
24
|
var isObject = (val) => val !== null && typeof val === "object";
|
|
@@ -37,9 +37,10 @@ function isFalsy(x) {
|
|
|
37
37
|
return x === false || x === null || x === void 0 || x === "";
|
|
38
38
|
}
|
|
39
39
|
var isPrimitive = (val) => ["string", "number", "boolean", "symbol", "undefined"].includes(typeof val) || isNull(val);
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
40
|
+
function isHTMLElement(obj) {
|
|
41
|
+
if (!obj) return false;
|
|
42
|
+
return obj && typeof obj === "object" && obj.nodeType === 1 && typeof obj.nodeName === "string";
|
|
43
|
+
}
|
|
43
44
|
function coerceArray(data) {
|
|
44
45
|
return Array.isArray(data) ? data.flat() : [data];
|
|
45
46
|
}
|
|
@@ -237,7 +238,7 @@ var Signal = class {
|
|
|
237
238
|
return this._value;
|
|
238
239
|
}
|
|
239
240
|
__triggerObject() {
|
|
240
|
-
if (!isPrimitive(this._value) && !
|
|
241
|
+
if (!isPrimitive(this._value) && !isHTMLElement(this._value)) {
|
|
241
242
|
useReactive(this._value);
|
|
242
243
|
}
|
|
243
244
|
}
|
|
@@ -248,7 +249,7 @@ var Signal = class {
|
|
|
248
249
|
}
|
|
249
250
|
if (hasChanged(newValue, this._value)) {
|
|
250
251
|
this._value = newValue;
|
|
251
|
-
if (!isPrimitive(this._value) && !
|
|
252
|
+
if (!isPrimitive(this._value) && !isHTMLElement(this._value)) {
|
|
252
253
|
this.__triggerObject();
|
|
253
254
|
}
|
|
254
255
|
trigger(this, "_sv");
|
|
@@ -983,7 +984,7 @@ var htmlTags = [
|
|
|
983
984
|
function closeHtmlTags(input) {
|
|
984
985
|
const tagStack = [];
|
|
985
986
|
const output = [];
|
|
986
|
-
const tagPattern = /<\/?([\
|
|
987
|
+
const tagPattern = /<\/?([\da-z-]+)([^>]*)>/gi;
|
|
987
988
|
let lastIndex = 0;
|
|
988
989
|
while (true) {
|
|
989
990
|
const match = tagPattern.exec(input);
|
|
@@ -1429,14 +1430,14 @@ function ssgRender(component, root, props = {}) {
|
|
|
1429
1430
|
|
|
1430
1431
|
// src/index.ts
|
|
1431
1432
|
if (globalThis) {
|
|
1432
|
-
globalThis.
|
|
1433
|
+
globalThis.__essor_version__ = essor_version;
|
|
1433
1434
|
}
|
|
1434
1435
|
|
|
1435
1436
|
exports.ComponentNode = ComponentNode;
|
|
1436
1437
|
exports.Fragment = Fragment;
|
|
1437
1438
|
exports.TemplateNode = TemplateNode;
|
|
1438
|
-
exports.__essor_version = __essor_version;
|
|
1439
1439
|
exports.createStore = createStore;
|
|
1440
|
+
exports.essor_version = essor_version;
|
|
1440
1441
|
exports.h = h;
|
|
1441
1442
|
exports.isComputed = isComputed;
|
|
1442
1443
|
exports.isJsxElement = isJsxElement;
|
package/dist/essor.dev.esm.js
CHANGED
|
@@ -16,7 +16,7 @@ var __spreadValues = (a, b) => {
|
|
|
16
16
|
};
|
|
17
17
|
|
|
18
18
|
// src/version.ts
|
|
19
|
-
var
|
|
19
|
+
var essor_version = "0.0.7";
|
|
20
20
|
|
|
21
21
|
// ../shared/dist/essor-shared.js
|
|
22
22
|
var isObject = (val) => val !== null && typeof val === "object";
|
|
@@ -35,9 +35,10 @@ function isFalsy(x) {
|
|
|
35
35
|
return x === false || x === null || x === void 0 || x === "";
|
|
36
36
|
}
|
|
37
37
|
var isPrimitive = (val) => ["string", "number", "boolean", "symbol", "undefined"].includes(typeof val) || isNull(val);
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
38
|
+
function isHTMLElement(obj) {
|
|
39
|
+
if (!obj) return false;
|
|
40
|
+
return obj && typeof obj === "object" && obj.nodeType === 1 && typeof obj.nodeName === "string";
|
|
41
|
+
}
|
|
41
42
|
function coerceArray(data) {
|
|
42
43
|
return Array.isArray(data) ? data.flat() : [data];
|
|
43
44
|
}
|
|
@@ -235,7 +236,7 @@ var Signal = class {
|
|
|
235
236
|
return this._value;
|
|
236
237
|
}
|
|
237
238
|
__triggerObject() {
|
|
238
|
-
if (!isPrimitive(this._value) && !
|
|
239
|
+
if (!isPrimitive(this._value) && !isHTMLElement(this._value)) {
|
|
239
240
|
useReactive(this._value);
|
|
240
241
|
}
|
|
241
242
|
}
|
|
@@ -246,7 +247,7 @@ var Signal = class {
|
|
|
246
247
|
}
|
|
247
248
|
if (hasChanged(newValue, this._value)) {
|
|
248
249
|
this._value = newValue;
|
|
249
|
-
if (!isPrimitive(this._value) && !
|
|
250
|
+
if (!isPrimitive(this._value) && !isHTMLElement(this._value)) {
|
|
250
251
|
this.__triggerObject();
|
|
251
252
|
}
|
|
252
253
|
trigger(this, "_sv");
|
|
@@ -981,7 +982,7 @@ var htmlTags = [
|
|
|
981
982
|
function closeHtmlTags(input) {
|
|
982
983
|
const tagStack = [];
|
|
983
984
|
const output = [];
|
|
984
|
-
const tagPattern = /<\/?([\
|
|
985
|
+
const tagPattern = /<\/?([\da-z-]+)([^>]*)>/gi;
|
|
985
986
|
let lastIndex = 0;
|
|
986
987
|
while (true) {
|
|
987
988
|
const match = tagPattern.exec(input);
|
|
@@ -1427,7 +1428,7 @@ function ssgRender(component, root, props = {}) {
|
|
|
1427
1428
|
|
|
1428
1429
|
// src/index.ts
|
|
1429
1430
|
if (globalThis) {
|
|
1430
|
-
globalThis.
|
|
1431
|
+
globalThis.__essor_version__ = essor_version;
|
|
1431
1432
|
}
|
|
1432
1433
|
|
|
1433
|
-
export { ComponentNode, Fragment, TemplateNode,
|
|
1434
|
+
export { ComponentNode, Fragment, TemplateNode, createStore, essor_version, h, isComputed, isJsxElement, isReactive, isSignal, nextTick, onDestroy, onMount, renderTemplate, renderToString, signalObject, ssgRender, template, unReactive, unSignal, useComputed, useEffect, useInject, useProvide, useReactive, useRef, useSignal, useWatch };
|
package/dist/essor.esm.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
var _e=Object.defineProperty;var me=Object.getOwnPropertySymbols;var Le=Object.prototype.hasOwnProperty,We=Object.prototype.propertyIsEnumerable;var he=(e,t,n)=>t in e?_e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,E=(e,t)=>{for(var n in t||(t={}))Le.call(t,n)&&he(e,n,t[n]);if(me)for(var n of me(t))We.call(t,n)&&he(e,n,t[n]);return e};var ge="0.0.7-beta.5";var k=e=>e!==null&&typeof e=="object";var C=Array.isArray;function U(e){return typeof e=="string"}function He(e){return e===null}function ye(e){return e==null}var p=e=>typeof e=="function";function Z(e){return e===!1||e===null||e===void 0||e===""}var w=e=>["string","number","boolean","symbol","undefined"].includes(typeof e)||He(e),Q=e=>e instanceof HTMLElement||e instanceof SVGElement;function Y(e){return Array.isArray(e)?e.flat():[e]}var J=(e,t)=>e!==t&&(e===e||t===t),Te=Function.prototype;function y(e,t){return U(e)?e.indexOf(t)===0:!1}function M(e,t=new WeakMap){if(e===null||typeof e!="object")return e;if(t.has(e))return t.get(e);if(e instanceof Date)return new Date(e);if(e instanceof RegExp)return new RegExp(e);if(e instanceof Map){let s=new Map;return t.set(e,s),e.forEach((o,i)=>{s.set(M(i,t),M(o,t));}),s}if(e instanceof Set){let s=new Set;return t.set(e,s),e.forEach(o=>{s.add(M(o,t));}),s}let n=Array.isArray(e)?[]:{};t.set(e,n);let r=Object.keys(e);for(let s of r)n[s]=M(e[s],t);return n}function _(e,t,n=new WeakMap){if(w(e)&&w(t))return e===t;if(e===t)return !0;if(e==null||t==null||typeof e!="object"||typeof t!="object"||e.constructor!==t.constructor)return !1;if(n.has(e))return n.get(e)===t;if(n.set(e,t),Array.isArray(e)){if(e.length!==t.length)return !1;for(let[o,i]of e.entries())if(!_(i,t[o],n))return !1;return !0}if(e instanceof Map){if(e.size!==t.size)return !1;for(let[o,i]of e)if(!t.has(o)||!_(i,t.get(o),n))return !1;return !0}if(e instanceof Set){if(e.size!==t.size)return !1;let o=Array.from(e).sort(),i=Array.from(t).sort();for(let[a,c]of o.entries())if(!_(c,i[a],n))return !1;return !0}let r=Object.keys(e),s=new Set(Object.keys(t));if(r.length!==s.size)return !1;for(let o of r)if(!s.has(o)||!_(e[o],t[o],n))return !1;return !0}function I(e,t){return Array.isArray(t)?t.includes(e):p(t)?t(e):!1}var be=e=>e.replaceAll(/[A-Z]+/g,(t,n)=>`${n>0?"-":""}${t.toLocaleLowerCase()}`);var ve=e=>e.charAt(0).toUpperCase()+e.slice(1);var A=null,L=null,te=new WeakMap,ne=new WeakMap,re=new Set,ee=new WeakMap,Pe=["push","pop","shift","unshift","splice","sort","reverse"];function W(e,t){if(!A&&!L)return;let n=ne.get(e);n||(n=new Map,ne.set(e,n));let r=n.get(t);r||(r=new Set,n.set(t,r)),A&&r.add(A);let s=te.get(e);s||(s=new Map,te.set(e,s));let o=s.get(t);o||(o=new Set,s.set(t,o)),L&&o.add(L);}function H(e,t){let n=ne.get(e);if(!n)return;let r=n.get(t);r&&r.forEach(o=>re.has(o)&&o());let s=te.get(e);if(s){let o=s.get(t);o&&o.forEach(i=>i.run());}}var G=class{constructor(t){this._value=t;}valueOf(){return W(this,"_sv"),this.__triggerObject(),this._value}toString(){return W(this,"_sv"),this.__triggerObject(),String(this._value)}toJSON(){return this._value}get value(){return W(this,"_sv"),this.__triggerObject(),this._value}__triggerObject(){!w(this._value)&&!Q(this._value)&&O(this._value);}set value(t){d(t)&&(console.warn("Signal cannot be set to another signal, use .peek() instead"),t=t.peek()),J(t,this._value)&&(this._value=t,!w(this._value)&&!Q(this._value)&&this.__triggerObject(),H(this,"_sv"));}peek(){return this._value}update(){H(this,"_sv");}};function P(e){return d(e)?e:new G(e)}function d(e){return e instanceof G}var D=class{constructor(t){this.fn=t;let n=L;L=this,this._value=this.fn(),L=n;}peek(){return this._value}run(){let t=this.fn();J(t,this._value)&&(this._value=t,H(this,"_cv"));}get value(){return W(this,"_cv"),this._value}};function oe(e){return new D(e)}function X(e){return e instanceof D}function x(e){function t(){let n=A;A=t,e(),A=n;}return re.add(t),t(),()=>{re.delete(t),A=null;}}function se(e,t){return Object.entries(e).reduce((r,[s,o])=>(r[s]=I(s,t)||d(o)?o:P(o),r),{})}function xe(e,t){return e?d(e)?e.peek():C(e)?e.map(n=>xe(n,t)):k(e)?Object.entries(e).reduce((n,[r,s])=>(I(r,t)?n[r]=s:n[r]=d(s)?s.peek():s,n),{}):e:{}}var Ne=Symbol("useReactive");function $(e){return e&&e[Ne]===!0}function $e(e){return $(e)?E({},e):e}function O(e,t){if(!k(e)||$(e))return e;if(ee.has(e))return ee.get(e);Array.isArray(e)&&Pe.forEach(s=>{let o=e[s];W(e,"length"),Object.defineProperties(e,{[s]:{value(...i){let a=o.apply(this,i);return H(e,"length"),a},enumerable:!1,configurable:!0,writable:!0}});});let n={get(s,o,i){if(o===Ne||y(o,"_"))return !0;let a=Reflect.get(s,o,i),c=d(a)?a.value:a;return I(o,t)?c:(W(s,o),k(c)?O(c):c)},set(s,o,i,a){if(I(o,t))return Reflect.set(s,o,i,a),!0;let c=Reflect.get(s,o,a);d(c)&&(c=c.value),d(i)&&(i=i.value);let f=Reflect.set(s,o,i,a);return J(i,c)&&H(s,o),f},deleteProperty(s,o){let i=Reflect.get(s,o),a=Reflect.deleteProperty(s,o);return i!==void 0&&H(s,o),a}},r=new Proxy(e,n);return ee.set(e,r),r}function ie(e,...t){console.warn.apply(console,[`[Essor warn]: ${e}`].concat(t));}function Ke(e,t,n){return Fe(e,t,n)}function Fe(e,t,n){let r,s=n==null?void 0:n.deep;if(d(e)||X(e)?r=()=>e.value:$(e)?r=()=>E({},e):C(e)?r=()=>e.map(c=>d(c)||X(c)?c.value:$(c)?E({},c):p(c)?c():ie("Invalid source",c)):p(e)?r=e:(ie("Invalid source type",e),r=Te),t&&s){let c=r;r=()=>K(c());}let o,i=()=>{let c=M(r());_(c,o)||(t&&t(c,o),o=w(c)?c:M(c));},a=x(i);return n!=null&&n.immediate&&i(),a}function K(e,t=new Set){return !k(e)||t.has(e)||(t.add(e),C(e)?e.forEach(n=>K(n,t)):e instanceof Map?e.forEach((n,r)=>{K(r,t),K(n,t);}):e instanceof Set?e.forEach(n=>K(n,t)):Object.keys(e).forEach(n=>{K(e[n],t);})),e}var z=0,ae=new Map;function Ie(e){let{state:t,getters:n,actions:r}=e,s=E({},t!=null?t:{}),o=O(t!=null?t:{},u=>p(u)),i=[],a=[],f=E({state:o},{patch$(u){Object.assign(o,u),i.forEach(l=>l(o)),a.forEach(l=>l(o));},subscribe$(u){i.push(u);},unsubscribe$(u){let l=i.indexOf(u);l!==-1&&i.splice(l,1);},onAction$(u){a.push(u);},reset$(){Object.assign(o,s);}});for(let u in n){let l=n[u];l&&(f[u]=oe(l.bind(o,o)));}for(let u in r){let l=r[u];l&&(f[u]=l.bind(o));}return ae.set(z,f),++z,f}function Je(e){return function(){return ae.has(z)?ae.get(z):Ie(e)}}var N=class N{constructor(t,n){this.template=t;this.props=n;this.proxyProps={};this.context={};this.emitter=new Set;this.mounted=!1;this.rootNode=null;this.hooks={mounted:new Set,destroy:new Set};this.trackMap=new Map;this.proxyProps=se(n,r=>y(r,"on")||y(r,"update"));}addEventListener(){}removeEventListener(){}get firstChild(){var t,n;return (n=(t=this.rootNode)==null?void 0:t.firstChild)!=null?n:null}get isConnected(){var t,n;return (n=(t=this.rootNode)==null?void 0:t.isConnected)!=null?n:!1}addHook(t,n){var r;(r=this.hooks[t])==null||r.add(n);}getContext(t){return N.context[t]}setContext(t,n){N.context[t]=n;}inheritNode(t){this.context=t.context,this.hooks=t.hooks,Object.assign(this.proxyProps,t.proxyProps),this.rootNode=t.rootNode,this.trackMap=t.trackMap;let n=this.props;this.props=t.props,this.patchProps(n);}unmount(){var t;this.hooks.destroy.forEach(n=>n()),Object.values(this.hooks).forEach(n=>n.clear()),(t=this.rootNode)==null||t.unmount(),this.rootNode=null,this.proxyProps={},this.mounted=!1,this.emitter.forEach(n=>n()),N.context={};}mount(t,n){var s,o,i,a;if(!p(this.template))throw new Error("Template must be a function");if(this.isConnected)return (o=(s=this.rootNode)==null?void 0:s.mount(t,n))!=null?o:[];N.ref=this,this.rootNode=this.template(O(this.proxyProps,["children"])),N.ref=null,this.mounted=!0;let r=(a=(i=this.rootNode)==null?void 0:i.mount(t,n))!=null?a:[];return this.hooks.mounted.forEach(c=>c()),this.patchProps(this.props),r}getNodeTrack(t,n){let r=this.trackMap.get(t);return r||(r={cleanup:()=>{}},this.trackMap.set(t,r)),n||r.cleanup(),r}patchProps(t){var n,r,s,o,i;for(let[a,c]of Object.entries(t))if(y(a,"on")&&((n=this.rootNode)!=null&&n.nodes)){let f=a.slice(2).toLowerCase(),u=c,l=b(this.rootNode.nodes[0],f,u);this.emitter.add(l);}else if(a==="ref")d(c)?t[a].value=(r=this.rootNode)==null?void 0:r.nodes[0]:p(c)&&t[a]((s=this.rootNode)==null?void 0:s.nodes[0]);else if(y(a,"update"))t[a]=d(c)?c.value:c;else if(a!=="children"){let f=(i=(o=this.proxyProps)[a])!=null?i:o[a]=P(c),u=this.getNodeTrack(a);u.cleanup=x(()=>{f.value=p(c)?c():c;});}this.props=t;}};N.ref=null,N.context={};var T=N;function Ge(e,t){return U(e)&&(ke(e)&&(e=Ce(e),t={1:t}),e===""&&(t={0:t}),e=Se(e)),p(e)?new T(e,t):new F(e,t)}function v(e){return e instanceof T||e instanceof F}function Se(e){e=Ee(e);let t=document.createElement("template");return t.innerHTML=e,t}function De(e){return e.children}function ce(e){if(v(e)||e instanceof Node)return e;let t=Z(e)?"":String(e);return document.createTextNode(t)}function S(e,t,n=null){let r=v(n)?n.firstChild:n;v(t)?t.mount(e,r):r?r.before(t):e.append(t);}function j(e){v(e)?e.unmount():e.parentNode&&e.remove();}function ue(e,t,n){S(e,t,n),j(n);}function le(e,t,n){if(t==="class"){typeof n=="string"?e.className=n:Array.isArray(n)?e.className=n.join(" "):n&&typeof n=="object"&&(e.className=Object.entries(n).reduce((r,[s,o])=>r+(o?` ${s}`:""),"").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(s=>{e.style.setProperty(be(s),String(r[s]));});}return}Z(n)?e.removeAttribute(t):n===!0?e.setAttribute(t,""):e.setAttribute(t,String(n));}function we(e,t){if(e instanceof HTMLInputElement){if(e.type==="checkbox")return b(e,"change",()=>{t(!!e.checked);});if(e.type==="date")return b(e,"change",()=>{t(e.value?e.value:"");});if(e.type==="file")return b(e,"change",()=>{e.files&&t(e.files);});if(e.type==="number")return b(e,"input",()=>{let n=Number.parseFloat(e.value);t(Number.isNaN(n)?"":String(n));});if(e.type==="radio")return b(e,"change",()=>{t(e.checked?e.value:"");});if(e.type==="text")return b(e,"input",()=>{t(e.value);})}if(e instanceof HTMLSelectElement)return b(e,"change",()=>{t(e.value);});if(e instanceof HTMLTextAreaElement)return b(e,"input",()=>{t(e.value);})}var Me=Promise.resolve();function Xe(e){return e?Me.then(e):Me}function b(e,t,n){return e.addEventListener(t,n),()=>e.removeEventListener(t,n)}var Ae=["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"],ze=["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"];function Ee(e){let t=[],n=[],r=/<\/?([\dA-Za-z-]+)([^>]*)>/g,s=0;for(;;){let o=r.exec(e);if(!o)break;let[i,a,c]=o,f=i[1]==="/";if(n.push(e.slice(s,o.index)),s=o.index+i.length,f){for(;t.length>0&&t[t.length-1]!==a;){let u=t.pop();u&&n.push(`</${u}>`);}t.length>0&&(t.pop(),n.push(i));}else Ae.includes(a)?n.push(i):(t.push(a),n.push(`<${a}${c}>`));}for(n.push(e.slice(s));t.length>0;){let o=t.pop();o&&n.push(`</${o}>`);}return n.join("")}function ke(e){return ze.includes(e)}function Ce(e){return Ae.includes(e)?`<${e}/>`:`<${e}></${e}>`}function Oe(e,t,n,r){let s=new Map,o=Array.from(t.values()),i=o.length;if(t.size>0&&n.length===0){if(e.childNodes.length===i+(r?1:0))e.innerHTML="",r&&S(e,r);else {let u=document.createRange(),l=o[0],g=v(l)?l.firstChild:l;u.setStartBefore(g),r?u.setEndBefore(r):u.setEndAfter(e),u.deleteContents();}return o.forEach(u=>{v(u)&&u.unmount();}),s}let a=[],c=Ve(n),f=0;for(let[u,l]of n.entries()){let g=o[f],R=B(g,u);for(;g&&!c.has(R);)j(g),t.delete(R),g=o[++f],R=B(g,u);let pe=B(l,u),q=t.get(pe);if(q&&(l=Be(e,q,l)),g)if(g===q)f++;else {let de=document.createComment("");S(e,de,g),a.push([de,l]);}else S(e,l,r);s.set(pe,l);}return a.forEach(([u,l])=>ue(e,l,u)),t.forEach((u,l)=>{u.isConnected&&!s.has(l)&&j(u);}),s}function Be(e,t,n){return t===n?t:v(t)&&v(n)&&t.template===n.template?(n.inheritNode(t),n):t instanceof Text&&n instanceof Text?(t.textContent!==n.textContent&&(t.textContent=n.textContent),t):(ue(e,n,t),n)}function Ve(e){let t=new Map;for(let[n,r]of e.entries()){let s=B(r,n);t.set(s,r);}return t}function B(e,t){let n=e instanceof Element?e.id:void 0,r=n===""?void 0:n;return r!=null?r:`_$${t}$`}var F=class e{constructor(t,n){this.template=t;this.props=n;this.treeMap=new Map;this.mounted=!1;this.nodes=[];this.provides={};this.trackMap=new Map;this.parent=null;}get firstChild(){var t;return (t=this.nodes[0])!=null?t:null}get isConnected(){return this.mounted}addEventListener(){}removeEventListener(){}unmount(){this.trackMap.forEach(t=>{var n,r;(n=t.cleanup)==null||n.call(t),(r=t.lastNodes)==null||r.forEach(s=>{t.isRoot?j(s):s instanceof e&&s.unmount();});}),this.trackMap.clear(),this.treeMap.clear(),this.nodes.forEach(t=>j(t)),this.nodes=[],this.mounted=!1;}mount(t,n){var o;if(this.parent=t,this.isConnected)return this.nodes.forEach(i=>S(t,i,n)),this.nodes;let r=this.template.content.cloneNode(!0),s=r.firstChild;return (o=s==null?void 0:s.hasAttribute)!=null&&o.call(s,"_svg_")&&(s.remove(),s==null||s.childNodes.forEach(i=>{r.append(i);})),this.nodes=Array.from(r.childNodes),this.mapNodeTree(t,r),S(t,r,n),this.patchNodes(this.props),this.mounted=!0,this.nodes}mapNodeTree(t,n){let r=1;this.treeMap.set(0,t);let s=o=>{o.nodeType!==Node.DOCUMENT_FRAGMENT_NODE&&this.treeMap.set(r++,o);let i=o.firstChild;for(;i;)s(i),i=i.nextSibling;};s(n);}patchNodes(t){for(let n in t){let r=Number(n),s=this.treeMap.get(r);if(s){let o=this.props[n];this.patchNode(n,s,o,r===0);}}this.props=t;}getNodeTrack(t,n,r){var o;let s=this.trackMap.get(t);return s||(s={cleanup:()=>{}},n&&(s.lastNodes=new Map),r&&(s.isRoot=!0),this.trackMap.set(t,s)),(o=s.cleanup)==null||o.call(s),s}inheritNode(t){this.mounted=t.mounted,this.nodes=t.nodes,this.trackMap=t.trackMap,this.treeMap=t.treeMap;let n=this.props;this.props=t.props,this.patchNodes(n);}patchNode(t,n,r,s){for(let o in r)if(o==="children"&&r.children)if(C(r.children))r.children.filter(Boolean).forEach((i,a)=>{var R;let[c,f]=C(i)?i:[i,null],u=ye(f)?null:(R=this.treeMap.get(f))!=null?R:null,l=`${t}:${o}:${a}`,g=this.getNodeTrack(l,!0,s);Re(g,n,c,u);});else {let i=`${t}:${o}:0`,a=this.getNodeTrack(i,!0,s);Re(a,n,r.children,null);}else if(o==="ref")d(r[o])?r[o].value=n:p(r[o])&&r[o](n);else if(y(o,"on")){let i=o.slice(2).toLocaleLowerCase(),a=this.getNodeTrack(`${t}:${o}`),c=r[o];a.cleanup=b(n,i,c);}else if(!y(o,"update")){let i=this.getNodeTrack(`${t}:${o}`),a=r[o],c=d(a)?a:P(a);je(i,n,o,c.value);let f=x(()=>{c.value=d(a)?a.value:a,je(i,n,o,c.value);}),u,l=`update${ve(o)}`;r[l]&&(u=we(n,g=>{r[l](g);})),i.cleanup=()=>{f&&f(),u&&u();};}}};function je(e,t,n,r){let s=t;s.setAttribute&&(p(r)?e.cleanup=x(()=>{le(s,n,r());}):le(s,n,r));}function Re(e,t,n,r){p(n)?e.cleanup=x(()=>{let s=Y(n()).map(ce);e.lastNodes=Oe(t,e.lastNodes,s,r);}):Y(n).forEach((s,o)=>{let i=ce(s);e.lastNodes.set(String(o),i),S(t,i,r);});}function qe(e){var t;V("onMounted"),(t=T.ref)==null||t.addHook("mounted",e);}function Ue(e){var t;V("onDestroy"),(t=T.ref)==null||t.addHook("destroy",e);}function V(e){T.ref||console.error(`"${e}" can only be called within the component function body
|
|
2
|
-
and cannot be used in asynchronous or deferred calls.`);}function Ze(e,t){var n;
|
|
1
|
+
var _e=Object.defineProperty;var me=Object.getOwnPropertySymbols;var Le=Object.prototype.hasOwnProperty,We=Object.prototype.propertyIsEnumerable;var he=(e,t,n)=>t in e?_e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,E=(e,t)=>{for(var n in t||(t={}))Le.call(t,n)&&he(e,n,t[n]);if(me)for(var n of me(t))We.call(t,n)&&he(e,n,t[n]);return e};var ge="0.0.7";var k=e=>e!==null&&typeof e=="object";var C=Array.isArray;function U(e){return typeof e=="string"}function Pe(e){return e===null}function ye(e){return e==null}var p=e=>typeof e=="function";function Z(e){return e===!1||e===null||e===void 0||e===""}var w=e=>["string","number","boolean","symbol","undefined"].includes(typeof e)||Pe(e);function Q(e){return e?e&&typeof e=="object"&&e.nodeType===1&&typeof e.nodeName=="string":!1}function Y(e){return Array.isArray(e)?e.flat():[e]}var J=(e,t)=>e!==t&&(e===e||t===t),Te=Function.prototype;function y(e,t){return U(e)?e.indexOf(t)===0:!1}function M(e,t=new WeakMap){if(e===null||typeof e!="object")return e;if(t.has(e))return t.get(e);if(e instanceof Date)return new Date(e);if(e instanceof RegExp)return new RegExp(e);if(e instanceof Map){let s=new Map;return t.set(e,s),e.forEach((o,i)=>{s.set(M(i,t),M(o,t));}),s}if(e instanceof Set){let s=new Set;return t.set(e,s),e.forEach(o=>{s.add(M(o,t));}),s}let n=Array.isArray(e)?[]:{};t.set(e,n);let r=Object.keys(e);for(let s of r)n[s]=M(e[s],t);return n}function _(e,t,n=new WeakMap){if(w(e)&&w(t))return e===t;if(e===t)return !0;if(e==null||t==null||typeof e!="object"||typeof t!="object"||e.constructor!==t.constructor)return !1;if(n.has(e))return n.get(e)===t;if(n.set(e,t),Array.isArray(e)){if(e.length!==t.length)return !1;for(let[o,i]of e.entries())if(!_(i,t[o],n))return !1;return !0}if(e instanceof Map){if(e.size!==t.size)return !1;for(let[o,i]of e)if(!t.has(o)||!_(i,t.get(o),n))return !1;return !0}if(e instanceof Set){if(e.size!==t.size)return !1;let o=Array.from(e).sort(),i=Array.from(t).sort();for(let[a,c]of o.entries())if(!_(c,i[a],n))return !1;return !0}let r=Object.keys(e),s=new Set(Object.keys(t));if(r.length!==s.size)return !1;for(let o of r)if(!s.has(o)||!_(e[o],t[o],n))return !1;return !0}function I(e,t){return Array.isArray(t)?t.includes(e):p(t)?t(e):!1}var be=e=>e.replaceAll(/[A-Z]+/g,(t,n)=>`${n>0?"-":""}${t.toLocaleLowerCase()}`);var ve=e=>e.charAt(0).toUpperCase()+e.slice(1);var A=null,L=null,te=new WeakMap,ne=new WeakMap,re=new Set,ee=new WeakMap,He=["push","pop","shift","unshift","splice","sort","reverse"];function W(e,t){if(!A&&!L)return;let n=ne.get(e);n||(n=new Map,ne.set(e,n));let r=n.get(t);r||(r=new Set,n.set(t,r)),A&&r.add(A);let s=te.get(e);s||(s=new Map,te.set(e,s));let o=s.get(t);o||(o=new Set,s.set(t,o)),L&&o.add(L);}function P(e,t){let n=ne.get(e);if(!n)return;let r=n.get(t);r&&r.forEach(o=>re.has(o)&&o());let s=te.get(e);if(s){let o=s.get(t);o&&o.forEach(i=>i.run());}}var G=class{constructor(t){this._value=t;}valueOf(){return W(this,"_sv"),this.__triggerObject(),this._value}toString(){return W(this,"_sv"),this.__triggerObject(),String(this._value)}toJSON(){return this._value}get value(){return W(this,"_sv"),this.__triggerObject(),this._value}__triggerObject(){!w(this._value)&&!Q(this._value)&&O(this._value);}set value(t){d(t)&&(console.warn("Signal cannot be set to another signal, use .peek() instead"),t=t.peek()),J(t,this._value)&&(this._value=t,!w(this._value)&&!Q(this._value)&&this.__triggerObject(),P(this,"_sv"));}peek(){return this._value}update(){P(this,"_sv");}};function H(e){return d(e)?e:new G(e)}function d(e){return e instanceof G}var D=class{constructor(t){this.fn=t;let n=L;L=this,this._value=this.fn(),L=n;}peek(){return this._value}run(){let t=this.fn();J(t,this._value)&&(this._value=t,P(this,"_cv"));}get value(){return W(this,"_cv"),this._value}};function oe(e){return new D(e)}function X(e){return e instanceof D}function x(e){function t(){let n=A;A=t,e(),A=n;}return re.add(t),t(),()=>{re.delete(t),A=null;}}function se(e,t){return Object.entries(e).reduce((r,[s,o])=>(r[s]=I(s,t)||d(o)?o:H(o),r),{})}function xe(e,t){return e?d(e)?e.peek():C(e)?e.map(n=>xe(n,t)):k(e)?Object.entries(e).reduce((n,[r,s])=>(I(r,t)?n[r]=s:n[r]=d(s)?s.peek():s,n),{}):e:{}}var Ne=Symbol("useReactive");function $(e){return e&&e[Ne]===!0}function $e(e){return $(e)?E({},e):e}function O(e,t){if(!k(e)||$(e))return e;if(ee.has(e))return ee.get(e);Array.isArray(e)&&He.forEach(s=>{let o=e[s];W(e,"length"),Object.defineProperties(e,{[s]:{value(...i){let a=o.apply(this,i);return P(e,"length"),a},enumerable:!1,configurable:!0,writable:!0}});});let n={get(s,o,i){if(o===Ne||y(o,"_"))return !0;let a=Reflect.get(s,o,i),c=d(a)?a.value:a;return I(o,t)?c:(W(s,o),k(c)?O(c):c)},set(s,o,i,a){if(I(o,t))return Reflect.set(s,o,i,a),!0;let c=Reflect.get(s,o,a);d(c)&&(c=c.value),d(i)&&(i=i.value);let f=Reflect.set(s,o,i,a);return J(i,c)&&P(s,o),f},deleteProperty(s,o){let i=Reflect.get(s,o),a=Reflect.deleteProperty(s,o);return i!==void 0&&P(s,o),a}},r=new Proxy(e,n);return ee.set(e,r),r}function ie(e,...t){console.warn.apply(console,[`[Essor warn]: ${e}`].concat(t));}function Ke(e,t,n){return Fe(e,t,n)}function Fe(e,t,n){let r,s=n==null?void 0:n.deep;if(d(e)||X(e)?r=()=>e.value:$(e)?r=()=>E({},e):C(e)?r=()=>e.map(c=>d(c)||X(c)?c.value:$(c)?E({},c):p(c)?c():ie("Invalid source",c)):p(e)?r=e:(ie("Invalid source type",e),r=Te),t&&s){let c=r;r=()=>K(c());}let o,i=()=>{let c=M(r());_(c,o)||(t&&t(c,o),o=w(c)?c:M(c));},a=x(i);return n!=null&&n.immediate&&i(),a}function K(e,t=new Set){return !k(e)||t.has(e)||(t.add(e),C(e)?e.forEach(n=>K(n,t)):e instanceof Map?e.forEach((n,r)=>{K(r,t),K(n,t);}):e instanceof Set?e.forEach(n=>K(n,t)):Object.keys(e).forEach(n=>{K(e[n],t);})),e}var z=0,ae=new Map;function Ie(e){let{state:t,getters:n,actions:r}=e,s=E({},t!=null?t:{}),o=O(t!=null?t:{},u=>p(u)),i=[],a=[],f=E({state:o},{patch$(u){Object.assign(o,u),i.forEach(l=>l(o)),a.forEach(l=>l(o));},subscribe$(u){i.push(u);},unsubscribe$(u){let l=i.indexOf(u);l!==-1&&i.splice(l,1);},onAction$(u){a.push(u);},reset$(){Object.assign(o,s);}});for(let u in n){let l=n[u];l&&(f[u]=oe(l.bind(o,o)));}for(let u in r){let l=r[u];l&&(f[u]=l.bind(o));}return ae.set(z,f),++z,f}function Je(e){return function(){return ae.has(z)?ae.get(z):Ie(e)}}var N=class N{constructor(t,n){this.template=t;this.props=n;this.proxyProps={};this.context={};this.emitter=new Set;this.mounted=!1;this.rootNode=null;this.hooks={mounted:new Set,destroy:new Set};this.trackMap=new Map;this.proxyProps=se(n,r=>y(r,"on")||y(r,"update"));}addEventListener(){}removeEventListener(){}get firstChild(){var t,n;return (n=(t=this.rootNode)==null?void 0:t.firstChild)!=null?n:null}get isConnected(){var t,n;return (n=(t=this.rootNode)==null?void 0:t.isConnected)!=null?n:!1}addHook(t,n){var r;(r=this.hooks[t])==null||r.add(n);}getContext(t){return N.context[t]}setContext(t,n){N.context[t]=n;}inheritNode(t){this.context=t.context,this.hooks=t.hooks,Object.assign(this.proxyProps,t.proxyProps),this.rootNode=t.rootNode,this.trackMap=t.trackMap;let n=this.props;this.props=t.props,this.patchProps(n);}unmount(){var t;this.hooks.destroy.forEach(n=>n()),Object.values(this.hooks).forEach(n=>n.clear()),(t=this.rootNode)==null||t.unmount(),this.rootNode=null,this.proxyProps={},this.mounted=!1,this.emitter.forEach(n=>n()),N.context={};}mount(t,n){var s,o,i,a;if(!p(this.template))throw new Error("Template must be a function");if(this.isConnected)return (o=(s=this.rootNode)==null?void 0:s.mount(t,n))!=null?o:[];N.ref=this,this.rootNode=this.template(O(this.proxyProps,["children"])),N.ref=null,this.mounted=!0;let r=(a=(i=this.rootNode)==null?void 0:i.mount(t,n))!=null?a:[];return this.hooks.mounted.forEach(c=>c()),this.patchProps(this.props),r}getNodeTrack(t,n){let r=this.trackMap.get(t);return r||(r={cleanup:()=>{}},this.trackMap.set(t,r)),n||r.cleanup(),r}patchProps(t){var n,r,s,o,i;for(let[a,c]of Object.entries(t))if(y(a,"on")&&((n=this.rootNode)!=null&&n.nodes)){let f=a.slice(2).toLowerCase(),u=c,l=b(this.rootNode.nodes[0],f,u);this.emitter.add(l);}else if(a==="ref")d(c)?t[a].value=(r=this.rootNode)==null?void 0:r.nodes[0]:p(c)&&t[a]((s=this.rootNode)==null?void 0:s.nodes[0]);else if(y(a,"update"))t[a]=d(c)?c.value:c;else if(a!=="children"){let f=(i=(o=this.proxyProps)[a])!=null?i:o[a]=H(c),u=this.getNodeTrack(a);u.cleanup=x(()=>{f.value=p(c)?c():c;});}this.props=t;}};N.ref=null,N.context={};var T=N;function Ge(e,t){return U(e)&&(ke(e)&&(e=Ce(e),t={1:t}),e===""&&(t={0:t}),e=Se(e)),p(e)?new T(e,t):new F(e,t)}function v(e){return e instanceof T||e instanceof F}function Se(e){e=Ee(e);let t=document.createElement("template");return t.innerHTML=e,t}function De(e){return e.children}function ce(e){if(v(e)||e instanceof Node)return e;let t=Z(e)?"":String(e);return document.createTextNode(t)}function S(e,t,n=null){let r=v(n)?n.firstChild:n;v(t)?t.mount(e,r):r?r.before(t):e.append(t);}function j(e){v(e)?e.unmount():e.parentNode&&e.remove();}function ue(e,t,n){S(e,t,n),j(n);}function le(e,t,n){if(t==="class"){typeof n=="string"?e.className=n:Array.isArray(n)?e.className=n.join(" "):n&&typeof n=="object"&&(e.className=Object.entries(n).reduce((r,[s,o])=>r+(o?` ${s}`:""),"").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(s=>{e.style.setProperty(be(s),String(r[s]));});}return}Z(n)?e.removeAttribute(t):n===!0?e.setAttribute(t,""):e.setAttribute(t,String(n));}function we(e,t){if(e instanceof HTMLInputElement){if(e.type==="checkbox")return b(e,"change",()=>{t(!!e.checked);});if(e.type==="date")return b(e,"change",()=>{t(e.value?e.value:"");});if(e.type==="file")return b(e,"change",()=>{e.files&&t(e.files);});if(e.type==="number")return b(e,"input",()=>{let n=Number.parseFloat(e.value);t(Number.isNaN(n)?"":String(n));});if(e.type==="radio")return b(e,"change",()=>{t(e.checked?e.value:"");});if(e.type==="text")return b(e,"input",()=>{t(e.value);})}if(e instanceof HTMLSelectElement)return b(e,"change",()=>{t(e.value);});if(e instanceof HTMLTextAreaElement)return b(e,"input",()=>{t(e.value);})}var Me=Promise.resolve();function Xe(e){return e?Me.then(e):Me}function b(e,t,n){return e.addEventListener(t,n),()=>e.removeEventListener(t,n)}var Ae=["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"],ze=["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"];function Ee(e){let t=[],n=[],r=/<\/?([\da-z-]+)([^>]*)>/gi,s=0;for(;;){let o=r.exec(e);if(!o)break;let[i,a,c]=o,f=i[1]==="/";if(n.push(e.slice(s,o.index)),s=o.index+i.length,f){for(;t.length>0&&t[t.length-1]!==a;){let u=t.pop();u&&n.push(`</${u}>`);}t.length>0&&(t.pop(),n.push(i));}else Ae.includes(a)?n.push(i):(t.push(a),n.push(`<${a}${c}>`));}for(n.push(e.slice(s));t.length>0;){let o=t.pop();o&&n.push(`</${o}>`);}return n.join("")}function ke(e){return ze.includes(e)}function Ce(e){return Ae.includes(e)?`<${e}/>`:`<${e}></${e}>`}function Oe(e,t,n,r){let s=new Map,o=Array.from(t.values()),i=o.length;if(t.size>0&&n.length===0){if(e.childNodes.length===i+(r?1:0))e.innerHTML="",r&&S(e,r);else {let u=document.createRange(),l=o[0],g=v(l)?l.firstChild:l;u.setStartBefore(g),r?u.setEndBefore(r):u.setEndAfter(e),u.deleteContents();}return o.forEach(u=>{v(u)&&u.unmount();}),s}let a=[],c=qe(n),f=0;for(let[u,l]of n.entries()){let g=o[f],R=B(g,u);for(;g&&!c.has(R);)j(g),t.delete(R),g=o[++f],R=B(g,u);let pe=B(l,u),V=t.get(pe);if(V&&(l=Be(e,V,l)),g)if(g===V)f++;else {let de=document.createComment("");S(e,de,g),a.push([de,l]);}else S(e,l,r);s.set(pe,l);}return a.forEach(([u,l])=>ue(e,l,u)),t.forEach((u,l)=>{u.isConnected&&!s.has(l)&&j(u);}),s}function Be(e,t,n){return t===n?t:v(t)&&v(n)&&t.template===n.template?(n.inheritNode(t),n):t instanceof Text&&n instanceof Text?(t.textContent!==n.textContent&&(t.textContent=n.textContent),t):(ue(e,n,t),n)}function qe(e){let t=new Map;for(let[n,r]of e.entries()){let s=B(r,n);t.set(s,r);}return t}function B(e,t){let n=e instanceof Element?e.id:void 0,r=n===""?void 0:n;return r!=null?r:`_$${t}$`}var F=class e{constructor(t,n){this.template=t;this.props=n;this.treeMap=new Map;this.mounted=!1;this.nodes=[];this.provides={};this.trackMap=new Map;this.parent=null;}get firstChild(){var t;return (t=this.nodes[0])!=null?t:null}get isConnected(){return this.mounted}addEventListener(){}removeEventListener(){}unmount(){this.trackMap.forEach(t=>{var n,r;(n=t.cleanup)==null||n.call(t),(r=t.lastNodes)==null||r.forEach(s=>{t.isRoot?j(s):s instanceof e&&s.unmount();});}),this.trackMap.clear(),this.treeMap.clear(),this.nodes.forEach(t=>j(t)),this.nodes=[],this.mounted=!1;}mount(t,n){var o;if(this.parent=t,this.isConnected)return this.nodes.forEach(i=>S(t,i,n)),this.nodes;let r=this.template.content.cloneNode(!0),s=r.firstChild;return (o=s==null?void 0:s.hasAttribute)!=null&&o.call(s,"_svg_")&&(s.remove(),s==null||s.childNodes.forEach(i=>{r.append(i);})),this.nodes=Array.from(r.childNodes),this.mapNodeTree(t,r),S(t,r,n),this.patchNodes(this.props),this.mounted=!0,this.nodes}mapNodeTree(t,n){let r=1;this.treeMap.set(0,t);let s=o=>{o.nodeType!==Node.DOCUMENT_FRAGMENT_NODE&&this.treeMap.set(r++,o);let i=o.firstChild;for(;i;)s(i),i=i.nextSibling;};s(n);}patchNodes(t){for(let n in t){let r=Number(n),s=this.treeMap.get(r);if(s){let o=this.props[n];this.patchNode(n,s,o,r===0);}}this.props=t;}getNodeTrack(t,n,r){var o;let s=this.trackMap.get(t);return s||(s={cleanup:()=>{}},n&&(s.lastNodes=new Map),r&&(s.isRoot=!0),this.trackMap.set(t,s)),(o=s.cleanup)==null||o.call(s),s}inheritNode(t){this.mounted=t.mounted,this.nodes=t.nodes,this.trackMap=t.trackMap,this.treeMap=t.treeMap;let n=this.props;this.props=t.props,this.patchNodes(n);}patchNode(t,n,r,s){for(let o in r)if(o==="children"&&r.children)if(C(r.children))r.children.filter(Boolean).forEach((i,a)=>{var R;let[c,f]=C(i)?i:[i,null],u=ye(f)?null:(R=this.treeMap.get(f))!=null?R:null,l=`${t}:${o}:${a}`,g=this.getNodeTrack(l,!0,s);Re(g,n,c,u);});else {let i=`${t}:${o}:0`,a=this.getNodeTrack(i,!0,s);Re(a,n,r.children,null);}else if(o==="ref")d(r[o])?r[o].value=n:p(r[o])&&r[o](n);else if(y(o,"on")){let i=o.slice(2).toLocaleLowerCase(),a=this.getNodeTrack(`${t}:${o}`),c=r[o];a.cleanup=b(n,i,c);}else if(!y(o,"update")){let i=this.getNodeTrack(`${t}:${o}`),a=r[o],c=d(a)?a:H(a);je(i,n,o,c.value);let f=x(()=>{c.value=d(a)?a.value:a,je(i,n,o,c.value);}),u,l=`update${ve(o)}`;r[l]&&(u=we(n,g=>{r[l](g);})),i.cleanup=()=>{f&&f(),u&&u();};}}};function je(e,t,n,r){let s=t;s.setAttribute&&(p(r)?e.cleanup=x(()=>{le(s,n,r());}):le(s,n,r));}function Re(e,t,n,r){p(n)?e.cleanup=x(()=>{let s=Y(n()).map(ce);e.lastNodes=Oe(t,e.lastNodes,s,r);}):Y(n).forEach((s,o)=>{let i=ce(s);e.lastNodes.set(String(o),i),S(t,i,r);});}function Ve(e){var t;q("onMounted"),(t=T.ref)==null||t.addHook("mounted",e);}function Ue(e){var t;q("onDestroy"),(t=T.ref)==null||t.addHook("destroy",e);}function q(e){T.ref||console.error(`"${e}" can only be called within the component function body
|
|
2
|
+
and cannot be used in asynchronous or deferred calls.`);}function Ze(e,t){var n;q("useProvide"),(n=T.ref)==null||n.setContext(e,t);}function Qe(e,t){var n;return q("useInject"),((n=T.ref)==null?void 0:n.getContext(e))||t}function Ye(){let e=null;return new Proxy({},{get(t,n){return n==="__is_ref"?!0:e},set(t,n,r){return e=r,!0}})}function et(e){return Object.entries(e).map(([t,n])=>`${t}=${JSON.stringify(escape(String(n)))}`).join(" ")}function fe(e,t){if(p(e))return e(t);let n=Array.isArray(e)?e.reduce((o,i,a)=>(o[a+1]={template:i},o),{}):e,r={},s={};if(k(n))for(let[o,i]of Object.entries(n)){let a=t[o];if(a){for(let c in a)y(c,"on")&&p(a[c])&&delete a[c];if(a.children){for(let[c,f]of a.children)r[f]||(r[f]=[]),r[f].push(c);delete a.children;}}s[o]={template:i.template,prop:a};}return Object.entries(s).map(([o,{template:i,prop:a}])=>{let c=i;return a&&(c+=` ${et(a)}`),r[o]&&(c+=r[o].map(f=>fe(f,a)).join("")),c}).join("")}function gn(e,t){return fe(e,t)}function yn(e,t,n={}){t.innerHTML=fe(e,n);}globalThis&&(globalThis.__essor_version__=ge);
|
|
3
3
|
|
|
4
|
-
export { T as ComponentNode, De as Fragment, F as TemplateNode,
|
|
5
|
-
//# sourceMappingURL=
|
|
4
|
+
export { T as ComponentNode, De as Fragment, F as TemplateNode, Je as createStore, ge as essor_version, Ge as h, X as isComputed, v as isJsxElement, $ as isReactive, d as isSignal, Xe as nextTick, Ue as onDestroy, Ve as onMount, fe as renderTemplate, gn as renderToString, se as signalObject, yn as ssgRender, Se as template, $e as unReactive, xe as unSignal, oe as useComputed, x as useEffect, Qe as useInject, Ze as useProvide, O as useReactive, Ye as useRef, H as useSignal, Ke as useWatch };
|
|
5
|
+
//# sourceMappingURL=essor.esm.js.map
|
|
6
6
|
//# sourceMappingURL=essor.esm.js.map
|