@estjs/template 0.0.15-beta.9 → 0.0.16-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/dist/chunk-3E4EK64L.dev.esm.js +152 -0
- package/dist/chunk-3E4EK64L.dev.esm.js.map +1 -0
- package/dist/chunk-IRDMO5MX.esm.js +2 -0
- package/dist/chunk-IRDMO5MX.esm.js.map +1 -0
- package/dist/internal-Bz6h0aPa.d.cts +84 -0
- package/dist/internal-Bz6h0aPa.d.ts +84 -0
- package/dist/internal.cjs.js +2 -0
- package/dist/internal.cjs.js.map +1 -0
- package/dist/internal.d.cts +1 -0
- package/dist/internal.d.ts +1 -0
- package/dist/internal.dev.cjs.js +110 -0
- package/dist/internal.dev.cjs.js.map +1 -0
- package/dist/internal.dev.esm.js +3 -0
- package/dist/internal.dev.esm.js.map +1 -0
- package/dist/internal.esm.js +2 -0
- package/dist/internal.esm.js.map +1 -0
- package/dist/template.cjs.js +2 -2
- package/dist/template.cjs.js.map +1 -1
- package/dist/template.d.cts +439 -312
- package/dist/template.d.ts +439 -312
- package/dist/template.dev.cjs.js +1523 -1109
- package/dist/template.dev.cjs.js.map +1 -1
- package/dist/template.dev.esm.js +1445 -1178
- package/dist/template.dev.esm.js.map +1 -1
- package/dist/template.esm.js +2 -2
- package/dist/template.esm.js.map +1 -1
- package/package.json +13 -3
package/dist/template.esm.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {isHTMLElement,isPrimitive,isFalsy,error,isHtmlInputElement,isHtmlSelectElement,isHtmlTextAreaElement,isFunction,isObject,startsWith,isString,normalizeClassName,isArray,camelCase,capitalize,isSpecialBooleanAttr,isBooleanAttr,includeBooleanAttr,isSymbol,isUndefined,isPromise,isNumber,coerceArray,isTextNode}from'@estjs/shared';import {effect,shallowReactive,isSignal,isComputed,signal}from'@estjs/signals';var Qe=Object.defineProperty;var Ne=Object.getOwnPropertySymbols;var Ze=Object.prototype.hasOwnProperty,et=Object.prototype.propertyIsEnumerable;var Se=(e,t,o)=>t in e?Qe(e,t,{enumerable:true,configurable:true,writable:true,value:o}):e[t]=o,O=(e,t)=>{for(var o in t||(t={}))Ze.call(t,o)&&Se(e,o,t[o]);if(Ne)for(var o of Ne(t))et.call(t,o)&&Se(e,o,t[o]);return e};var V=(e,t,o)=>new Promise((n,r)=>{var s=c=>{try{a(o.next(c));}catch(f){r(f);}},i=c=>{try{a(o.throw(c));}catch(f){r(f);}},a=c=>c.done?n(c.value):Promise.resolve(c.value).then(s,i);a((o=o.apply(e,t)).next());});var R=null,tt=0;function N(){return R}function ve(e){R=e;}function q(e=R){let t={id:++tt,parent:e,children:null,provides:null,cleanup:null,onMount:null,onUpdate:null,onDestroy:null,isMounted:false,isDestroyed:false};return e&&(e.children||(e.children=new Set),e.children.add(t)),t}function b(e,t){let o=R;R=e;try{return t()}finally{R=o;}}function j(e){var t,o,n,r,s;if(!(!e||e.isDestroyed)){if(e.children)for(;e.children.size>0;){let i=e.children.values().next().value;i&&j(i);}if(e.onDestroy){for(let i of e.onDestroy)try{i();}catch(a){}e.onDestroy.clear();}if(e.cleanup){for(let i of e.cleanup)try{i();}catch(a){}e.cleanup.clear();}(t=e.parent)!=null&&t.children&&e.parent.children.delete(e),(o=e.children)==null||o.clear(),(n=e.provides)==null||n.clear(),(r=e.onMount)==null||r.clear(),(s=e.onUpdate)==null||s.clear(),ve(e.parent),e.parent=null,e.isDestroyed=true;}}function F(e){let t=R;t&&(t.cleanup||(t.cleanup=new Set),t.cleanup.add(e));}var Ee="_$spread$";var xe="http://www.w3.org/2000/svg",B="http://www.w3.org/2000/xlink",J="http://www.w3.org/2000/xmlns/";var Ae=1e3,be=new WeakMap;function Pe(e){let t=be.get(e);if(!t){let o=e.name||"anonymous",n=ke(e.toString()).toString(36);t=`${o}_${n}`,be.set(e,t);}return t}function ke(e){let t=0,o=e.length<100?e.length:100;for(let n=0;n<o;n++)t=Math.trunc((t<<5)-t+e.charCodeAt(n));return t<0?-t:t}var it=0;function Z(e){if(!isFalsy(e)){if(isString(e))return e.length<=Ae?e:`${e.slice(0,Ae-10)}_${ke(e).toString(36)}`;if(isNumber(e))return String(e);if(isSymbol(e)){let t=Symbol.keyFor(e);if(t)return `_s.${t}`;let o=e.description;return o?`_s.${o}`:`${it++}`}return String(e)}}var Q=Symbol("essor.key");function U(e,t){if(m(e)||!e||e.nodeType===Node.DOCUMENT_NODE)return;let o=Z(t);isFalsy(o)?delete e[Q]:e[Q]=o;}function T(e){if(e)return m(e)?e.key:e[Q]}function L(e){if(isHTMLElement(e))return e;if(isPrimitive(e)){let t=isFalsy(e)?"":String(e);return document.createTextNode(t)}return e}function C(e,t){let o=T(e),n=T(t);if(o!==n)return false;let r=m(e),s=m(t);if(r&&s)return e.component===t.component;if(r!==s)return false;if(isPrimitive(e)||isPrimitive(t))return e===t;let i=e,a=t;return i.nodeType!==a.nodeType?false:i.nodeType===Node.ELEMENT_NODE?i.tagName===a.tagName:true}function te(e,t){if(e===t)return true;if(!e||!t||Array.isArray(e)!==Array.isArray(t))return false;for(let o in e)if(e[o]!==t[o])return false;for(let o in t)if(!(o in e))return false;return true}function x(e){if(e)try{if(m(e))e.destroy();else {let t=e;t.parentElement&&t.remove();}}catch(t){error("Failed to remove node:",t);}}function h(e,t,o){if(!(!e||!t))try{let n=m(o)?o.firstChild:o;if(m(t)){t.mount(e,n);return}n?e.insertBefore(t,n):e.appendChild(t);}catch(n){error("Failed to insert node:",n);}}function z(e,t,o){if(!(!e||!t||!o||t===o))try{let n=m(o)?o.beforeNode:o.nextSibling;x(o),h(e,t,n);}catch(n){error("Failed to replace node:",n);}}function A(e){if(e){if(m(e))return e.firstChild;if(!isPrimitive(e))return e}}function Te(e,t){if(m(e)||m(t))return;let o=T(e);o&&!T(t)&&U(t,o);}function M(e,t,o){if(o===t)return t;let n=isHTMLElement(t);if(isHTMLElement(o)&&n){if(o.isEqualNode(t))return t;if(t.tagName===o.tagName){let a=t.attributes,c=o.attributes;for(let f=a.length-1;f>=0;f--){let l=a[f].name;o.hasAttribute(l)||t.removeAttribute(l);}for(let f=0,l=c.length;f<l;f++){let u=c[f];t.getAttribute(u.name)!==u.value&&t.setAttribute(u.name,u.value);}return Te(t,o),t}}if(isTextNode(t)&&isTextNode(o))return t.textContent!==o.textContent&&(t.textContent=o.textContent),Te(t,o),t;let s=m(t),i=m(o);return s&&i&&t.component===o.component?o.update(t):(z(e,o,t),o)}function Le(e,t,o,n){let r=t.length,s=o.length;if(r===0&&s===0)return [];if(r===0){for(let i=0;i<s;i++)h(e,o[i],n);return o}if(s===0){for(let i=0;i<r;i++)x(t[i]);return []}if(r===1&&s===1){let i=t[0],a=o[0];return C(i,a)?(M(e,i,a),o[0]=i):z(e,a,i),o}if(r===2&&s===2){let i=t[0],a=t[1],c=o[0],f=o[1];if(C(i,c)&&C(a,f))return M(e,i,c),M(e,a,f),o[0]=i,o[1]=a,o;if(C(i,f)&&C(a,c)){M(e,i,f),M(e,a,c);let l=A(a),u=A(i);return l&&u&&l.parentNode===e&&e.insertBefore(l,u),o[0]=a,o[1]=i,o}}return ft(e,t,o,n)}function ft(e,t,o,n){let r=0,s=0,i=t.length-1,a=o.length-1,c=t[0],f=t[i],l=o[0],u=o[a];for(;r<=i&&s<=a;)if(!c)c=t[++r];else if(!f)f=t[--i];else if(C(c,l))M(e,c,l),o[s]=c,c=t[++r],l=o[++s];else break;for(;r<=i&&s<=a;)if(!c)c=t[++r];else if(!f)f=t[--i];else if(C(f,u))M(e,f,u),o[a]=f,f=t[--i],u=o[--a];else break;if(r>i){if(s<=a){let y=a+1<o.length?A(o[a+1]):n;for(let v=s;v<=a;v++)h(e,o[v],y);}}else if(s>a)for(let y=r;y<=i;y++){let v=t[y];v&&x(v);}else ut(e,t,o,r,i,s,a,n);return o}function ut(e,t,o,n,r,s,i,a){let c=i-s+1,f;for(let g=s;g<=i;g++){let E=T(o[g]);E!==void 0&&(f||(f=Object.create(null)),f[E]=g);}let l=new Int32Array(c),u=false,y=0,v=0;for(let g=n;g<=r;g++){let E=t[g];if(!E)continue;if(v>=c){x(E);continue}let S,D=T(E);if(D!==void 0&&f&&D in f)S=f[D];else for(let H=s;H<=i;H++)if(l[H-s]===0&&D===void 0&&T(o[H])===void 0&&C(E,o[H])){S=H;break}S===void 0?x(E):(l[S-s]=g+1,S>=y?y=S:u=true,M(e,E,o[S]),o[S]=E,v++);}let P=u?lt(l):[],I=P.length-1,k=a;for(let g=c-1;g>=0;g--){let E=s+g,S=o[E];if(l[g]===0)h(e,S,k),k=A(S)||k;else if(u)if(I<0||g!==P[I]){let D=A(S);D&&D.parentNode===e&&h(e,D,k),k=D||k;}else k=A(S)||k,I--;else k=A(S)||k;}}function lt(e){let t=e.length;if(t===0)return [];if(t===1)return e[0]!==0?[0]:[];let o=[],n=new Int32Array(t),r,s,i,a,c;for(r=0;r<t;r++){let f=e[r];if(f!==0){if(s=o[o.length-1],o.length===0||e[s]<f){n[r]=s,o.push(r);continue}for(i=0,a=o.length-1;i<a;)c=i+a>>1,e[o[c]]<f?i=c+1:a=c;f<e[o[i]]&&(i>0&&(n[r]=o[i-1]),o[i]=r);}}for(i=o.length,a=o[i-1];i-- >0;)o[i]=a,a=n[a];return o}var ne=false;function dt(){ne=true;}function pt(){ne=false;}function w(){return ne}function _(e,t,o,n){e.addEventListener(t,o,n),F(()=>{e.removeEventListener(t,o,n);});}function St(e,t,o,n){isHtmlInputElement(e)?vt(e,n):isHtmlSelectElement(e)?Et(e,n):isHtmlTextAreaElement(e)&&_(e,"input",()=>{n(e.value);});}function vt(e,t){switch(e.type){case "checkbox":_(e,"change",()=>{t(!!e.checked);});break;case "radio":_(e,"change",()=>{t(e.checked?e.value:"");});break;case "file":_(e,"change",()=>{t(e.files);});break;case "number":case "range":_(e,"input",()=>{t(e.value||"");});break;case "date":case "datetime-local":case "month":case "time":case "week":_(e,"change",()=>{t(e.value||"");});break;default:_(e,"input",()=>{t(e.value);});break}}function Et(e,t){_(e,"change",()=>{if(e.multiple){let o=Array.from(e.options).filter(n=>n.selected).map(n=>n.value);t(o);}else t(e.value);});}var Me=true;function xt(e,t,o,n,r){let s=()=>{let i=isFunction(o)?o():o,a=coerceArray(i).map(c=>isFunction(c)?c():c).flatMap(c=>c).map(L);return Me&&w()?(Me=false,r):Le(t,r,a,n)};return e&&!e.isDestroyed?b(e,s):s()}function re(e,t,o){if(!e)return;let n=N(),r=[],s=effect(()=>{r=xt(n,e,t,o,r);});return F(()=>{s(),r.forEach(i=>x(i)),r.length=0;}),r}function At(e,t){let o=t.length,n=new Array(o),r=new Set(t),s=1,i=0,a=c=>{if(c.nodeType!==Node.DOCUMENT_FRAGMENT_NODE){if(r.has(s)&&(n[i++]=c,i===o))return true;s++;}let f=c.firstChild;for(;f;){if(a(f))return true;f=f.nextSibling;}return false};return a(e),n}function bt(e){let t=N();if(t){if(t.isMounted){try{e();}catch(o){}return}t.onMount||(t.onMount=new Set),t.onMount.add(e);}}function _t(e){let t=N();t&&(t.onUpdate||(t.onUpdate=new Set),t.onUpdate.add(e));}function Pt(e){let t=N();t&&(t.onDestroy||(t.onDestroy=new Set),t.onDestroy.add(e));}function Re(e){!e||e.isDestroyed||e.isMounted||(e.isMounted=true,e.onMount&&b(e,()=>{for(let t of e.onMount)try{t();}catch(o){}}));}function Y(e){if(!(!e||e.isDestroyed)&&e.onUpdate)for(let t of e.onUpdate)try{t();}catch(o){}}function ie(e){bt(e);}function se(e){Pt(e);}function kt(e){_t(e);}var Ke;Ke="normal";var G=class{constructor(t,o={}){this.component=t;this.props=o;this.renderedNodes=[];this.scope=null;this.parentNode=void 0;this.beforeNode=void 0;this.reactiveProps={};this.state=0;this.parentScope=null;this[Ke]=true;this.key=o.key?Z(o.key):Pe(t),this.reactiveProps=shallowReactive(O({},o||{})),this.parentScope=N();}get isConnected(){return this.state===2}get firstChild(){for(let t of this.renderedNodes){let o=A(t);if(o)return o}}mount(t,o){var s;if(this.parentNode=t,this.beforeNode=o,this.state=1,this.renderedNodes.length>0){for(let i of this.renderedNodes)h(t,i,o);return this.state=2,this.renderedNodes}let n=(s=this.parentScope)!=null?s:N();this.scope=q(n);let r=b(this.scope,()=>{var c;let i=this.component(this.reactiveProps);return isFunction(i)&&(i=i(this.reactiveProps)),(isSignal(i)||isComputed(i))&&(i=i.value),(c=re(t,i,o))!=null?c:[]});return this.renderedNodes=r,b(this.scope,()=>{this.applyProps(this.props||{});}),this.state=2,this.scope&&Re(this.scope),this.renderedNodes}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.scope=t.scope,this.parentScope=t.parentScope,this.renderedNodes=t.renderedNodes,this.state=t.state,this.reactiveProps=t.reactiveProps,!this.props||Object.keys(this.props).length===0)return !this.isConnected&&this.parentNode?(this.mount(this.parentNode,this.beforeNode),this):(this.scope&&(b(this.scope,()=>{this.applyProps(this.props||{});}),Y(this.scope)),this);let o=false;for(let n in this.props){if(n==="key")continue;let r=this.props[n],s=this.reactiveProps[n];Object.is(s,r)||isObject(s)&&isObject(r)&&te(s,r)||(this.reactiveProps[n]=r,o=true);}return !this.isConnected&&this.parentNode&&this.mount(this.parentNode,this.beforeNode),this.scope&&(o||!this.isConnected)&&(b(this.scope,()=>{this.applyProps(this.props||{});}),o&&Y(this.scope)),this}forceUpdate(){return V(this,null,function*(){if(yield Promise.resolve(),this.state===5||!this.parentNode||!this.scope)return;let t=[...this.renderedNodes];try{b(this.scope,()=>{let o=this.component(this.reactiveProps);isFunction(o)&&(o=o(this.reactiveProps)),(isSignal(o)||isComputed(o))&&(o=o.value);let n=coerceArray(o);if(this.parentNode){let r=this.beforeNode;if(!r&&this.renderedNodes.length>0){let s=this.renderedNodes[this.renderedNodes.length-1],i=A(s);i&&(r=i.nextSibling);}for(let s of this.renderedNodes)x(s);for(let s of n)h(this.parentNode,s,r);this.renderedNodes=n;}}),this.scope&&Y(this.scope);}catch(o){throw this.renderedNodes=t,o}})}destroy(){if(this.state===4||this.state===5)return;this.state=4;let t=this.scope;t&&(j(t),this.scope=null);for(let o of this.renderedNodes)x(o);this.renderedNodes=[],this.parentNode=void 0,this.beforeNode=void 0,this.parentScope=null,this.reactiveProps={},this.props={},this.state=5;}applyProps(t){if(!t)return;let o=this.firstChild;for(let[n,r]of Object.entries(t))if(startsWith(n,"on")&&o){let s=n.slice(2).toLowerCase();isHTMLElement(o)&&_(o,s,r);}else n==="ref"&&isSignal(r)&&(r.value=o);this.props=t;}};function m(e){return !!e&&!!e.normal}function ae(e,t){return m(e)?e:new G(e,t)}function Mt(e){let t,o=()=>{let n=document.createElement("template");n.innerHTML=e;let r=n.content.firstChild;if(!r)throw new Error("Invalid template: empty content");return r};return ()=>(t||(t=o())).cloneNode(true)}function Rt(e,t){let o=isString(t)?document.querySelector(t):t;if(!o){error(`Target element not found: ${t}`);return}o.innerHTML&&(error(`Target element is not empty, it will be delete: ${t}`),o.innerHTML="");let r=ae(e);return r.mount(o),r}function fe(e,t){let o=N();o&&(o.provides||(o.provides=new Map),o.provides.set(e,t));}function ue(e,t){let o=N();if(!o)return t;let n=o;for(;n;){if(n.provides){let r=n.provides.get(e);if(r)return r}n=n.parent;}return t}function Ht(e){let t=e.target,o=`${e.type}`,n=e.target,r=e.currentTarget,s=c=>Object.defineProperty(e,"target",{configurable:true,value:c}),i=()=>{let c=t[`_$${o}`];if(c&&isFunction(c)&&!t.disabled){let f=t[`${o}Data`];if(f?c.call(t,f,e):c.call(t,e),e.cancelBubble)return false}return t.host&&!isString(t.host)&&!t.host._$host&&isFunction(t.contains)&&t.contains(e.target)&&s(t.host),true},a=()=>{for(;i()&&(t=t._$host||t.parentNode||t.host););};if(Object.defineProperty(e,"currentTarget",{configurable:true,get(){return t||document}}),e.composedPath){let c=e.composedPath();s(c[0]);for(let f=0;f<c.length-2&&(t=c[f],!!i());f++){if(t._$host){t=t._$host,a();break}if(t.parentNode===r)break}}else a();s(n);}var $e=Symbol("_$EVENTS");function Ft(e,t=window.document){let o=t,n=o[$e]||(o[$e]=new Set);for(let r of e)n.has(r)||(n.add(r),t.addEventListener(r,Ht));}function Kt(e,t){let o=new Set(t);return new Proxy(e,{get(n,r){if(!o.has(r))return Reflect.get(n,r)},ownKeys(n){return Reflect.ownKeys(n).filter(r=>!o.has(r))},getOwnPropertyDescriptor(n,r){if(!o.has(r))return Reflect.getOwnPropertyDescriptor(n,r)},has(n,r){return o.has(r)?false:Reflect.has(n,r)}})}function Oe(e,t,o,n=false){if(t===o||w())return;let r=W(o),s=W(t);r&&s===r||(r?n?e.setAttribute("class",r):e.className=r:e.removeAttribute("class"));}function W(e){return normalizeClassName(e)}var je=/\s*!important$/,jt=["Webkit","Moz","ms"],le={};function Ye(e,t,o){let n=e.style,r=isString(o);if(!w()){if(o&&r){t!==o&&(n.cssText=o);return}if(!o){t&&e.removeAttribute("style");return}if(t&&!isString(t))for(let s in t)(!o||o[s]==null)&&K(n,s,"");else if(t&&isString(t)){let s=t.split(";");for(let i of s){let a=i.indexOf(":");if(a>0){let c=i.slice(0,a).trim();o&&isObject(o)&&o[c]==null&&K(n,c,"");}}}if(o&&!isString(o))for(let s in o){let i=o[s];(!t||isString(t)||t[s]!==i)&&i!=null&&K(n,s,i);}}}function K(e,t,o){if(isArray(o)){for(let r of o)K(e,t,r);return}if((o==null||o==="")&&(o=""),t.startsWith("--")){e.setProperty(t,o);return}let n=zt(e,t);typeof o=="string"&&je.test(o)?e.setProperty(camelCase(n),o.replace(je,""),"important"):e[n]=o;}function zt(e,t){let o=le[t];if(o)return o;let n=camelCase(t);if(n!=="filter"&&n in e)return le[t]=n;n=capitalize(n);for(let r of jt){let s=r+n;if(s in e)return le[t]=s}return t}function de(e,t,o,n){if(t==="key"){n==null?U(e,void 0):U(e,String(n));return}if(t===Ee){Object.keys(n).forEach(u=>{de(e,u,o==null?void 0:o[u],n==null?void 0:n[u]);});return}if(w())return;let r=(e==null?void 0:e.namespaceURI)===xe,s=r&&t.startsWith("xlink:"),i=r&&t.startsWith("xmlns:"),a=isSpecialBooleanAttr(t)||isBooleanAttr(t);if(o===n)return;let c=t.toLowerCase();if(c.length>2&&c.charCodeAt(0)===111&&c.charCodeAt(1)===110||c==="innerhtml")return;if(n==null){if(s)e.removeAttributeNS(B,t.slice(6));else if(i){let u=t.slice(6);e.removeAttributeNS(J,u);}else e.removeAttribute(t);return}if(s){e.setAttributeNS(B,t,String(n));return}if(i){e.setAttributeNS(J,t,String(n));return}if(a){includeBooleanAttr(n)?e.setAttribute(t,""):e.removeAttribute(t);return}let f=isSymbol(n)?String(n):n;if((c==="href"||c==="src"||c==="xlink:href")&&typeof f=="string"){let u=f.trim().toLowerCase();if(u.startsWith("javascript:")||u.startsWith("data:"))return}if(r)e.setAttribute(t,String(f));else if(t in e)try{e[t]=f;}catch(u){e.setAttribute(t,String(f));}else e.setAttribute(t,String(f));}function Ge(e,t,o,n){if(!(n!=null&&n.delegate))return e.addEventListener(t,o,n),()=>e.removeEventListener(t,o,n);let r=n.delegate,s=a=>{let c=a.target;(c.matches(r)||c.closest(r))&&o.call(e,a);},i=O({},n);return i.delegate=void 0,e.addEventListener(t,s,i),()=>{e.removeEventListener(t,s,i);}}function pe(e){return e==null?void 0:e.children}pe.fragment=true;function We(e){return !!e&&!!e.fragment}function me(e){if(typeof document=="undefined"){let n=e.children;return n?(isArray(n)?n:[n]).map(s=>String(s||"")).join(""):""}let t=document.createComment("portal");t.portal=true;let o=e.children;if(o){let n=isArray(o)?o:[o],r=[];ie(()=>{let s=isString(e.target)?document.querySelector(e.target):e.target;s&&(n.forEach(i=>{if(i!=null){let a=L(i);a&&(h(s,a),r.push(a));}}),F(()=>{r.forEach(i=>{typeof i!="string"&&i.parentNode===s&&s.removeChild(i);});}));});}return t}me.portal=true;function qe(e){return !!e&&!!e.portal}var he=Symbol("SuspenseContext");function ge(e){if(isUndefined(document)){let u=e.fallback;return u?String(u||""):""}let t=document.createElement("div");t.style.display="contents";let o=true,n=0,r=false,s=null,i=()=>{if(!r){for(r=true;t.firstChild;)t.removeChild(t.firstChild);if(e.fallback!=null){let u=L(e.fallback);u&&h(t,u);}}},a=()=>{if(!(!r||!(s||e.children!=null&&!isPromise(e.children)))){for(r=false;t.firstChild;)t.removeChild(t.firstChild);s?c(s):e.children!=null&&!isPromise(e.children)&&c(e.children);}},c=u=>{for(;t.firstChild;)t.removeChild(t.firstChild);if(u==null)return;let y=N();if((isArray(u)?u:[u]).forEach(P=>{if(P!=null){m(P)&&(P.parentContext=y);let I=L(P);I&&h(t,I);}}),r){for(;t.firstChild;)t.removeChild(t.firstChild);if(e.fallback!=null){let P=L(e.fallback);P&&h(t,P);}}},f={register:u=>{n++,i(),u.then(()=>{o&&(n--,n===0&&a());}).catch(y=>{o&&(n--,n===0&&a());});},increment:()=>{n++,i();},decrement:()=>{n--,n===0&&a();}};fe(he,f);let l=e.children;return isPromise(l)?(l.then(u=>{s=u;}).catch(()=>{}),f.register(l)):l!=null?c(l):i(),se(()=>{for(o=false;t.firstChild;)t.removeChild(t.firstChild);}),t}ge.suspense=true;function Be(e){return !!e&&!!e.suspense}function Je(e,t){let o=signal(t==null?void 0:t.initialValue),n=signal(true),r=signal(null),s=signal("pending"),i=0,a=null,c=()=>V(null,null,function*(){let u=++i;n.value=true,s.value="pending",r.value=null;try{let y=e();a=y.then(()=>{}).catch(()=>{});let v=yield y;u===i&&(o.value=v,s.value="ready",n.value=!1);}catch(y){u===i&&(r.value=y instanceof Error?y:new Error(String(y)),s.value="errored",n.value=false);}});c();let f=(()=>{if(n.value&&a){let u=ue(he,null);u&&u.register(a);}return o.value});return f.loading=n,f.error=r,f.state=s,[f,{mutate:u=>{o.value=u,s.value="ready",n.value=false,r.value=null;},refetch:()=>V(null,null,function*(){yield c();})}]}
|
|
2
|
-
export{
|
|
1
|
+
import {c,e,g,a,d,f,b}from'./chunk-IRDMO5MX.esm.js';import {normalizeClassName,isObject,isSpecialBooleanAttr,isBooleanAttr,includeBooleanAttr,isSymbol,isString,isArray,camelCase,capitalize,isBrowser,warn,isPromise,isFunction,isOn,isNull,isUndefined,isNumber,isBoolean,coerceArray,isHTMLElement,isPrimitive,isFalsy}from'@estjs/shared';import {effect,shallowReactive,isSignal,isComputed,signal}from'@estjs/signals';var ue="_$spread$";var ze="http://www.w3.org/2000/svg",we="http://www.w3.org/2000/xlink",xe="http://www.w3.org/2000/xmlns/";var Ae=Symbol(""),ie=Symbol(""),Pe=Symbol(""),We=Symbol("");function G(t,e,n,o){if(e==="key"){o==null?t.removeAttribute(e):t.setAttribute(e,String(o));return}if(e===ue){let f=isObject(n)?n:null,y=isObject(o)?o:null;if(f)for(let h in f)h!==ue&&(!y||!(h in y))&&G(t,h,f[h],null);if(y)for(let h in y)h!==ue&&G(t,h,f==null?void 0:f[h],y[h]);return}let r=(t==null?void 0:t.namespaceURI)===ze,i=r&&e.startsWith("xlink:"),s=r&&e.startsWith("xmlns:"),c=isSpecialBooleanAttr(e)||isBooleanAttr(e);if(n===o||e.length>2&&e.charCodeAt(0)===111&&e.charCodeAt(1)===110)return;let l=e.toLowerCase();if(l==="innerhtml"||l==="srcdoc")return;if(o==null){if(i)t.removeAttributeNS(we,e.slice(6));else if(s){let f=e.slice(6);t.removeAttributeNS(xe,f);}else t.removeAttribute(e);return}if(c){includeBooleanAttr(o)?t.setAttribute(e,""):t.removeAttribute(e);return}let u=isSymbol(o)?String(o):o;if((l==="href"||l==="src"||l==="xlink:href"||l==="action"||l==="formaction"||l==="poster")&&isString(u)){let f=u.trim().toLowerCase();if(f.startsWith("javascript:")||f.startsWith("data:"))return}if(i){t.setAttributeNS(we,e,String(u));return}if(s){t.setAttributeNS(xe,e,String(u));return}if(r)t.setAttribute(e,String(u));else if(e in t)try{t[e]=u;}catch(f){t.setAttribute(e,String(u));}else t.setAttribute(e,String(u));}function fe(t,e,n,o=false){if(e===n)return;let r=de(n);if(!r){t.removeAttribute("class");return}(isString(e)?e:de(e))!==r&&(o?t.setAttribute("class",r):t.className=r);}var de=normalizeClassName;var qe=/\s*!important$/,At=["Webkit","Moz","ms"],ke={};function me(t,e,n){let o=t.style;if(n&&isString(n)){e!==n&&(o.cssText=n);return}if(!n){e&&t.removeAttribute("style");return}if(e&&!isString(e)){let r=e;for(let i in r)(!n||n[i]==null)&&J(o,i,"");}else if(e&&isString(e)){let r=/(?:^|;)\s*([a-z][a-z\d-]*)\s*:/gi,i;for(;(i=r.exec(e))!==null;){let s=i[1].trim();s&&n&&isObject(n)&&n[s]==null&&J(o,s,"");}}if(n&&!isString(n)){let r=n;for(let i in r){let s=r[i];(!e||isString(e)||e[i]!==s)&&s!=null&&J(o,i,s);}}}function J(t,e,n){if(isArray(n)){for(let r of n)J(t,e,r);return}if((n==null||n==="")&&(n=""),e.startsWith("--")){t.setProperty(e,n);return}let o=Pt(t,e);isString(n)&&qe.test(n)?t.setProperty(camelCase(o),n.replace(qe,""),"important"):t[o]=n;}function Pt(t,e){let n=ke[e];if(n)return n;let o=camelCase(e);if(o!=="filter"&&o in t)return ke[e]=o;o=capitalize(o);for(let r of At){let i=r+o;if(i in t)return ke[e]=i}return e}var Te=0;function Ye(){return String(Te++)}function Rt(){Te=0;}var B=false;function le(){return B}var Q=new Map;function Lt(t){let e=t.querySelectorAll("[data-hk]");for(let n of e){let o=n.dataset.hk;o!=null&&!Q.has(o)&&Q.set(o,n);}}var ye=[],se=new Map;function Ft(){if(typeof document=="undefined")return;let t=document.createNodeIterator(document.body,NodeFilter.SHOW_COMMENT),e;for(;e=t.nextNode();){let n=e.data;if(n==="teleport-anchor")ye.push(e);else if(n==="teleport-start"){let o=e.parentElement;if(!o)continue;let r=se.get(o);r||(r=[],se.set(o,r)),r.push(e);}}}function Re(){var t;return (t=ye.shift())!=null?t:null}function Le(t){let e=se.get(t),n=e==null?void 0:e.shift();if(!n)return null;let o=[],r=n.nextSibling;for(;r;){if(r.nodeType===Node.COMMENT_NODE&&r.data==="teleport-end")return {start:n,end:r,nodes:o};o.push(r),r=r.nextSibling;}return null}function Fe(t){B=true,Te=0,Q.clear(),ye.length=0,se.clear(),Lt(t),Ft();}function De(){B=false,Q.clear(),ye.length=0,se.clear();}function Dt(t){if(!isBrowser())return ()=>{throw new Error("[essor] getRenderedElement called in non-browser environment")};let e=null;return ()=>{if(!B)return e||(e=pe(t)),e();let n=Ye(),o=Q.get(n);return o?(Q.delete(n),o):(warn(`[essor] hydration mismatch: no SSR element for key "${n}"`),e||(e=pe(t)),e())}}function Mt(t,e,n,o){B||fe(t,e,n,o);}function It(t,e,n,o){B||G(t,e,n,o);}function Ht(t,e,n){B||me(t,e,n);}function Me(t,e){return e&&e.parentNode===t?e:null}function Je(t,e,n,o){let r=Me(t,o),i=e.length,s=n.length;if(i===0&&s===0)return n;if(i===0){for(let d=0;d<s;d++)D(t,n[d],r);return n}if(s===0){for(let d=0;d<i;d++)U(e[d]);return []}let c=0,l=i-1,u=s-1;for(;c<=l&&c<=u&&e[c]===n[c];)c++;for(;l>=c&&u>=c&&e[l]===n[u];)l--,u--;if(c>l){if(c<=u){let d=u+1,f=Me(t,d<s?n[d]:r);for(let y=c;y<=u;y++)D(t,n[y],f);}}else if(c>u)for(let d=c;d<=l;d++)U(e[d]);else Ot(t,e,n,c,l,u,r);return n}function Ot(t,e,n,o,r,i,s){let c=i-o+1,l=new Map;for(let m=o;m<=i;m++)l.set(n[m],m);let u=new Int32Array(c);u.fill(0);let d=0,f=false,y=0;for(let m=o;m<=r;m++){let p=e[m];if(d>=c){U(p);continue}let a=l.get(p);a===void 0?U(p):(u[a-o]=m+1,a>=y?y=a:f=true,d++);}let h=f?Ie(u):[],N=h.length-1;for(let m=c-1;m>=0;m--){let p=o+m,a=n[p],g=Me(t,p+1<n.length?n[p+1]:s);u[m]===0?D(t,a,g):f&&(N<0||m!==h[N]?D(t,a,g):N--);}}function Ie(t){let e=new Int32Array(t.length),n=[0],o=t.length,r,i,s,c,l;for(r=0;r<o;r++){let u=t[r];if(u!==0){if(i=n[n.length-1],t[i]<u){e[r]=i,n.push(r);continue}for(s=0,c=n.length-1;s<c;)l=s+c>>1,t[n[l]]<u?s=l+1:c=l;u<t[n[s]]&&(s>0&&(e[r]=n[s-1]),n[s]=r);}}for(s=n.length,c=n[s-1];s-- >0;)n[s]=c,c=e[c];return n}function U(t){if(t)if(O(t))t.destroy();else {let e=t;e.parentNode&&e.remove();}}function D(t,e,n){if(!t||!e)return;let o=O(n)?n.firstChild:n;if(O(e)){e.mount(t,o);return}o?t.insertBefore(e,o):t.appendChild(e);}function Z(t){return isHTMLElement(t)?t:isPrimitive(t)?document.createTextNode(isFalsy(t)?"":String(t)):t}function z(t,e$1,n){if(!t)return;let o=c(),r=[],i=true,s=l=>l instanceof Node?[l]:isNull(l)||isUndefined(l)||isString(l)||isNumber(l)||isBoolean(l)?[Z(l)]:coerceArray(l).map(u=>isFunction(u)?u():u).flatMap(u=>u).map(Z),c$1=effect(()=>{let l=()=>{let u=isFunction(e$1)?e$1():e$1,d=s(u);if(i&&le()&&d.every(f=>f instanceof Node&&f.parentNode===t)){r=d,i=false;return}r=Je(t,r,d,n),i=false;};o&&!o.isDestroyed?e(o,l):l();});return g(()=>{c$1.stop();for(let l of r)U(l);r=[];}),r}function Gt(t){return (t==null?void 0:t.firstChild)||null}function Yt(t,e=1){for(;t&&e>0;)t=t.nextSibling,e--;return t||null}function Jt(t,e){if(!t||e<0)return null;let n=t.firstChild;for(;n&&e>0;)n=n.nextSibling,e--;return n||null}function ee(t,e,n,o){if(!(o!=null&&o.delegate))return t.addEventListener(e,n,o),()=>t.removeEventListener(e,n,o);let r=o.delegate,i=u=>{let d=u.target;(d.matches(r)||d.closest(r))&&n.call(t,u);},l=o,{delegate:s}=l,c=a(l,["delegate"]);return t.addEventListener(e,i,c),()=>{t.removeEventListener(e,i,c);}}function He(t,e,n){let o=t[e];o||(o=[],t[e]=o),o.push(n);}function et(t,e,n){let o=t.length;if(o===0)return;let r;for(let i=0;i<o;i++)try{let s=t[i]();if(isPromise(s)){let c=s.catch(l=>{});(r||(r=[])).push(c);}}catch(s){}if(r)return Promise.all(r).then(()=>{})}function Oe(t){let e=c();if(e){if(e.isMounted){try{let n=t();isPromise(n)&&n.catch(o=>{});}catch(n){}return}He(e,"onMount",t);}}function Qt(t){let e=c();e&&He(e,"onUpdate",t);}function te(t){let e=c();e&&He(e,"onDestroy",t);}function tt(t){if(t.isDestroyed)return;if(!t.onMount||t.onMount.length===0){t.isMounted=true;return}let e$1=t.onMount,n=e(t,()=>et(e$1,t.id));return e$1.length=0,t.isMounted=true,n}function nt(t){if(!(t.isDestroyed||!t.onUpdate||t.onUpdate.length===0))return e(t,()=>et(t.onUpdate,t.id))}function rt(t,e,n=false){let o=n?new Set:null;for(let r of Object.getOwnPropertyNames(e))o==null||o.add(r),Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(e,r));if(o)for(let r of Object.getOwnPropertyNames(t))o.has(r)||delete t[r];}function nn(t,e){let n=Object.getOwnPropertyDescriptor(t,e);return n.get?n.get.call(t):n.value}var it;it="normal";var ne=class{constructor(e,n={}){this.component=e;this.props=n;this[it]=true;this.scope=null;this.state=0;this.beforeNode=void 0;this.renderedNodes=[];this.firstChild=void 0;this.parentNode=void 0;this.rootEventCleanups=[];this.parentScope=c();let o={};rt(o,n),this.reactiveProps=shallowReactive(o);}mount(e$1,n){var i;if(this.parentNode=e$1,this.beforeNode=n,this.state=1,this.renderedNodes.length>0){for(let s of this.renderedNodes)D(e$1,s,n);return this.state=2,this.renderedNodes}let o=d((i=this.parentScope)!=null?i:c());this.scope=o;let r=e(o,()=>{var c;let s=this.component(this.reactiveProps);return isFunction(s)&&(s=s(this.reactiveProps)),(isSignal(s)||isComputed(s))&&(s=s.value),(c=z(e$1,s,n))!=null?c:[]});return this.renderedNodes=r,this.firstChild=r[0],this.syncSpecialProps(this.props),this.state=2,tt(o),this.renderedNodes}update(e){this.props=e;let n=this.scope;!n||n.isDestroyed||(rt(this.reactiveProps,e!=null?e:{},true),this.syncSpecialProps(e),nt(n));}forceUpdate(){if(!this.parentNode)return;let e=this.parentNode,n=this.beforeNode;this.destroy(),this.mount(e,n);}destroy(){let e=this.scope;if(!(!e||e.isDestroyed)){this.scope=null,this.releaseSpecialProps(),f(e);for(let n of this.renderedNodes)U(n);this.renderedNodes=[],this.firstChild=void 0,this.parentNode=void 0;}}syncSpecialProps(e){if(!e)return;let n=this.firstChild;if(n){this.releaseSpecialProps();for(let o of Object.getOwnPropertyNames(e)){let r=nn(e,o);if(o==="ref"){this.rootRefCleanup=this.bindRootRef(r,n);continue}if(isOn(o)&&isFunction(r)){let i=o.slice(2).toLowerCase();this.rootEventCleanups.push(ee(n,i,r));}}}}releaseSpecialProps(){for(let e of this.rootEventCleanups)e();this.rootEventCleanups.length=0,this.rootRefCleanup&&(this.rootRefCleanup(),this.rootRefCleanup=void 0);}bindRootRef(e,n){if(isFunction(e))return e(n),()=>e(null);if(isSignal(e)){let o=e.value;return e.value=n,()=>{e.value===n&&(e.value=o);}}}};function O(t){return !!t&&!!t.normal}function he(t,e){return O(t)?t:new ne(t,e)}function pe(t){let e,n=()=>{let o=document.createElement("template");o.innerHTML=t;let r=o.content.firstChild;if(!r)throw new Error("Invalid template: empty content");return r};return ()=>(e||(e=n())).cloneNode(true)}function on(t,e$1){let n=isString(e$1)?document.querySelector(e$1):e$1;if(!n)return;n.innerHTML&&(n.innerHTML="");let r=d(),i;try{e(r,()=>{let s=he(t);O(s)&&(i=s,D(n,s));});}catch(s){throw f(r),s}return {root:i,unmount:()=>{f(r),i==null||i.destroy();}}}function rn(t,e$1){let n=isString(e$1)?document.querySelector(e$1):e$1;if(!n)return;Fe(n);let o=d(),r;try{e(o,()=>{let i=he(t);O(i)&&(r=i,z(n,i));});}catch(i){throw f(o),i}finally{De();}return {root:r,unmount:()=>{f(o),r==null||r.destroy();}}}function je(t,e){let n=c();n&&(n.provides||(n.provides=new Map),n.provides.set(t,e));}function ce(t,e){let n=c();if(!n)return e;let o=n;for(;o;){if(o.provides&&o.provides.has(t))return o.provides.get(t);o=o.parent;}return e}function Ue(t,e){Object.defineProperty(t,"target",{configurable:true,value:e});}function ct(t){let e=t.target,n=t.type,o=t.target,r=t.currentTarget,i=()=>{let c=e[`_$${n}`];if(c&&isFunction(c)&&!e.disabled){let l=e[`${n}Data`];if(l?c.call(e,l,t):c.call(e,t),t.cancelBubble)return false}return e.host&&!isString(e.host)&&!e.host._$host&&isFunction(e.contains)&&e.contains(t.target)&&Ue(t,e.host),true},s=()=>{for(;i()&&(e=e._$host||e.parentNode||e.host););};if(Object.defineProperty(t,"currentTarget",{configurable:true,get(){return e||document}}),t.composedPath){let c=t.composedPath();Ue(t,c[0]);for(let l=0;l<c.length-2&&(e=c[l],!!i());l++){if(e._$host){e=e._$host,s();break}if(e.parentNode===r)break}}else s();Ue(t,o);}var ge=Symbol("_$EVENTS");function ln(t,e=window.document){let n=e,o=n[ge]||(n[ge]=new Set);for(let r of t)o.has(r)||(o.add(r),e.addEventListener(r,ct));}function cn(t=window.document){let e=t,n=e[ge];if(n){for(let o of n.keys())t.removeEventListener(o,ct);delete e[ge];}}function oe(t,e,n,o){let r=ee(t,e,n,o);c()&&g(r);}var fn={event:"change",forceChangeEvent:true,read:t=>t.checked,write:(t,e)=>{let n=t,o=!!e;n.checked!==o&&(n.checked=o);}},mn={event:"change",forceChangeEvent:true,read:t=>{let e=t;return e.checked?e.value:""},write:(t,e)=>{let n=t,o=String(e)===n.value;n.checked!==o&&(n.checked=o);}},pn={event:"change",forceChangeEvent:true,read:t=>t.files,write:()=>{}},yn={event:"input",needsComposition:true,read:t=>t.value,write:(t,e)=>{let n=t,o=e==null?"":String(e);n.value!==o&&(n.value=o);}},hn={event:"change",forceChangeEvent:true,read:t=>{let e=t;return e.multiple?Array.from(e.selectedOptions,n=>n.value):e.value},write:(t,e)=>{let n=t;if(n.multiple){let o=new Set((Array.isArray(e)?e:[]).map(String));for(let r of Array.from(n.options))r.selected=o.has(r.value);}else {let o=e==null?"":String(e);n.value!==o&&(n.value=o);}}},gn={event:"input",needsComposition:true,read:t=>t.value,write:(t,e)=>{let n=t,o=e==null?"":String(e);n.value!==o&&(n.value=o);}};function En(t,e){let n=t.nodeName;if(n==="INPUT"){let o=t.type;return e==="checked"?o==="radio"?mn:fn:e==="files"?pn:yn}return n==="SELECT"?hn:n==="TEXTAREA"?gn:{event:"input",read:o=>o[e],write:(o,r)=>{o[e]=r;}}}function Nn(t,e,n){if(!isString(t))return t;if(e&&(t=t.trim()),n&&t!==""){let o=Number(t);if(!Number.isNaN(o))return o}return t}function vn(t){let e=t.getRootNode();return (e instanceof Document||e instanceof ShadowRoot)&&e.activeElement===t}function Sn(t,e,n,o,r={}){if(!t)return;let i=En(t,e),{trim:s,number:c$1,lazy:l}=r,u=e==="files",d=()=>isFunction(n)?n():n,f=p=>u?p:Nn(p,s,c$1),y=l||i.forceChangeEvent?"change":i.event,h=false,N=()=>{if(h)return;let p=i.read(t);if(p===void 0)return;if(u){o(p);return}let a=f(p);Object.is(d(),a)||o(a);};oe(t,y,N),!l&&!u&&(s||c$1)&&y!=="change"&&oe(t,"change",()=>{i.write(t,f(i.read(t)));}),i.needsComposition&&!l&&(oe(t,"compositionstart",()=>{h=true;}),oe(t,"compositionend",()=>{h&&(h=false,N());}));let m=effect(()=>{let p=d();if(i.needsComposition&&!l&&vn(t)){if(h)return;let a=f(i.read(t));if(Object.is(a,p))return}i.write(t,p);});c()&&g(()=>m.stop());}function Cn(t,e){let n=new Set(e);return new Proxy(t,{get(o,r){if(!n.has(r))return Reflect.get(o,r)},ownKeys(o){return Reflect.ownKeys(o).filter(r=>!n.has(r))},getOwnPropertyDescriptor(o,r){if(!n.has(r))return Reflect.getOwnPropertyDescriptor(o,r)},has(o,r){return n.has(r)?false:Reflect.has(o,r)}})}function at(t){return !t||t.children==null?null:t.children}at[Ae]=true;function bn(t){return !!t&&!!t[Ae]}function Ee(t){let e=isFunction(t.target)?t.target():t.target;return e==null?null:isString(e)?document.querySelector(e):e}function Ne(t){return isFunction(t.disabled)?!!t.disabled():!!t.disabled}function dt(t){if(le()){let d=xn(t);if(d)return d}let e$1=document.createComment("portal");e$1[ie]=true;let{children:n}=t;if(n==null)return e$1;let o=c(),r=null,i=(d$1,f)=>{r=d(o),e(r,()=>{z(d$1,()=>n,f);});},s=()=>{r&&(f(r),r=null);},c$1=(d,f)=>{if(s(),d){let y=e$1.parentNode;if(!y)return;i(y,e$1);return}f&&i(f);},l=false,u=effect(()=>{let d=Ne(t),f=d?null:Ee(t);l&&c$1(d,f);});return Oe(()=>{l=!0;let d=Ne(t),f=d?null:Ee(t);if(d||f){c$1(d,f);return}queueMicrotask(()=>{e$1.parentNode&&c$1(Ne(t),Ee(t));});}),g(()=>{u.stop(),s();}),e$1}dt[ie]=true;function xn(t){if(Ne(t))return null;let e=Re();if(!e)return null;let n=Ee(t);return !n||!Le(n)?null:(e[ie]=true,e)}function An(t){return !!t&&!!t[ie]}function Se(t){for(;t.firstChild;)t.removeChild(t.firstChild);}function ft(t){let e=t;for(;isFunction(e);)e=e();return isSignal(e)||isComputed(e)?ft(e.value):e}var ae=Symbol("SuspenseContext");function mt(t){var N;if(!isBrowser())return (N=t.fallback)!=null?N:"";let e=document.createElement("div");e.style.display="contents";let n=true,o=0,r=false,i=null,s=m=>{let p=ft(m);if(isArray(p)){let a=[];for(let g of p){let v=s(g);isArray(v)?a.push(...v):a.push(v);}return a}return Z(p)},c=m=>{let p=s(m),a=isArray(p)?p:[p];for(let g of a)g!=null&&D(e,g);},l=()=>{Se(e),t.fallback!=null&&c(t.fallback);},u=()=>{r||(r=true,l());},d=()=>{!r||!(i||t.children!=null&&!isPromise(t.children))||(r=false,Se(e),i?f(i):t.children!=null&&!isPromise(t.children)&&f(t.children));},f=m=>{if(r||(Se(e),m==null))return;let p=isArray(m)?m:[m];for(let a of p)a!=null&&c(a);r&&l();},y={register:m=>{o++,u(),m.then(()=>{n&&(o--,o===0&&d());}).catch(p=>{n&&(o--,o===0&&d());});},increment:()=>{o++,u();},decrement:()=>{o=Math.max(0,o-1),o===0&&d();}};je(ae,y);let h=t.children;return isPromise(h)?(h.then(m=>{i=m;}).catch(()=>{}),y.register(h)):h!=null?f(h):u(),te(()=>{n=false,o=0,i=null,Se(e),e.remove();}),e}mt[Pe]=true;function Ln(t){return !!t&&!!t[Pe]}function Fn(t,e){let n=signal(e==null?void 0:e.initialValue),o=signal(true),r=signal(null),i=signal("pending"),s=0,c=null,l=false,u=ce(ae,null),d=()=>b(null,null,function*(){let h=++s;o.value=true,i.value="pending",r.value=null,l=false,u&&u.increment();try{let N=t();c=N,N.catch(()=>{});let m=yield N;h===s&&(n.value=m,i.value="ready",o.value=!1);}catch(N){h===s&&(r.value=N instanceof Error?N:new Error(String(N)),i.value="errored",o.value=false);}finally{u&&u.decrement();}});d();let f=(()=>(!l&&o.value&&c&&u&&(l=true,u.register(c)),n.value));return f.loading=o,f.error=r,f.state=i,[f,{mutate:h=>{n.value=h,i.value="ready",o.value=false,r.value=null;},refetch:()=>b(null,null,function*(){yield d();})}]}function pt(t){return isFunction(t)?t:t.default}function $e(t,e,n){let o=new ne(e,n);return o.mount(t),o}function Mn(t,e={}){let{delay:n=200,timeout:o,ssr:r="blocking",onError:i}=e;if(typeof window=="undefined"){if(r==="client-only"){let p=()=>"";return p.__asyncLoader=t,p.__asyncResolved=()=>null,p}let y=null,h=null,N=()=>h||(h=t().then(p=>{y=pt(p);}).catch(()=>{}),h);N();let m=p=>y?y(p):"";return m.__asyncLoader=N,m.__asyncResolved=()=>y,m}let s=null,c=null,l="pending",u=null;function d(){return u||(u=t().then(y=>{s=pt(y),l="resolved";}).catch(y=>{c=y instanceof Error?y:new Error(String(y)),l="errored",u=null;}),u)}d();function f(y){var W;if(l==="resolved"&&s){let S=document.createElement("div");S.style.display="contents";let M=$e(S,s,y);return g(()=>M.destroy()),S}if(l==="errored"&&c){let S=document.createElement("div");if(S.style.display="contents",e.error){let M=true,R=null,K=(q,E)=>{M&&(R==null||R.destroy(),R=$e(S,q,E));},X=()=>{u=null,l="pending",c=null,e.loading&&K(e.loading),d().then(()=>{M&&(l==="resolved"&&s?K(s,y):l==="errored"&&c&&e.error&&K(e.error,{error:c,retry:X}));});};K(e.error,{error:c,retry:X}),te(()=>{M=false,R==null||R.destroy(),R=null;});}return S}let h=document.createElement("div");h.style.display="contents";let N=true,m=null,p=null,a=null,g$1=(S,M)=>{N&&(m==null||m.destroy(),m=$e(h,S,M));},v=S=>()=>{u=null,l="pending",c=null,e.loading&&g$1(e.loading),d().then(()=>{l==="resolved"&&s?g$1(s,S):l==="errored"&&c&&e.error&&g$1(e.error,{error:c,retry:v(S)});});};te(()=>{N=false,m==null||m.destroy(),m=null,p!=null&&clearTimeout(p),a!=null&&clearTimeout(a);});let w=(W=ce(ae))!=null?W:null,k=S=>g$1(S,y),T=S=>{e.error&&g$1(e.error,{error:S,retry:v(y)});},V=()=>{e.loading&&g$1(e.loading);},j=d().then(()=>{N&&(l==="resolved"&&s?k(s):l==="errored"&&c&&(T(c),i&&i(c,v(y))),p!=null&&clearTimeout(p),a!=null&&clearTimeout(a));});return w&&w.register(j),n>0?p=setTimeout(()=>{N&&l==="pending"&&V();},n):e.loading&&V(),o!=null&&(a=setTimeout(()=>{if(N&&l==="pending"){let S=new Error(`[defineAsyncComponent] Timeout after ${o}ms`);c=S,l="errored",T(S),i&&i(S,v(y));}},o)),h}return f.__asyncLoader=d,f.__asyncResolved=()=>s,f}function yt(t){let e$1=document.createDocumentFragment(),n=document.createComment("");e$1.appendChild(n);let o=[],r=[],i=t.key,s=t.children,c$1=()=>{var g,v;let a=t.each;return isSignal(a)?(g=a.value)!=null?g:[]:isFunction(a)?(v=a())!=null?v:[]:a!=null?a:[]},l=a=>i?i(a):a,u=a=>{if(Array.isArray(a)){let g=[];for(let v of a)g.push(...u(v));return g}return [Z(a)]},d$1=(a,g,v)=>{let w=u(a);for(let k of w)v?g.insertBefore(k,v):g.appendChild(k);return w},f$1=(a,g)=>{if(!t.fallback)return;r=d$1(t.fallback(),a,g);},y=()=>{for(let a of r)a.parentNode&&a.parentNode.removeChild(a);r=[];},h=(a,g,v,w)=>{let k=c(),T=d(k),V=[];return e(T,()=>{V=d$1(s(a,g),v,w);}),{key:l(a),item:a,nodes:V,scope:T}},N=a=>{f(a.scope);for(let g of a.nodes)g.parentNode&&g.parentNode.removeChild(g);},m=effect(()=>{let a=c$1(),g=n.parentNode;if(!g){if(a.length===0)f$1(e$1,n);else {o=new Array(a.length);let v=0;for(let w of a)o[v]=h(w,v,e$1,n),v++;}return}p(g,a);});function p(a,g){let v=o.length,w=g.length;if(w===0){for(let E=0;E<v;E++)N(o[E]);o=[],t.fallback&&r.length===0&&f$1(a,n);return}if(v===0||r.length>0){r.length>0&&y(),o=new Array(w);let E=document.createDocumentFragment();for(let x=0;x<w;x++)o[x]=h(g[x],x,E,null);a.insertBefore(E,n);return}let k=new Map;for(let E=0;E<v;E++){let x=o[E],I=k.get(x.key),$=[x,E];I?I.push($):k.set(x.key,[$]);}let T=new Array(w),V=[],j=null,W=new Int32Array(w),S=false,M=0,R=new Array(w);for(let E=0;E<w;E++)R[E]=l(g[E]);for(let E=0;E<w;E++){let x=g[E],I=R[E],$=k.get(I);if($&&$.length>0){let[re,L]=$.shift();Object.is(re.item,x)?(re.item=x,T[E]=re,W[E]=L+1,L<M?S=true:M=L):(j||(j=document.createDocumentFragment()),N(re),T[E]=h(x,E,j,null));}else j||(j=document.createDocumentFragment()),T[E]=h(x,E,j,null);}for(let E of k.values())for(let[x]of E)V.push(x);for(let E of V)N(E);let K=S?Ie(W):[],X=K.length-1,q=n;for(let E=w-1;E>=0;E--){let I=T[E].nodes;if(!(W[E]===0)&&S&&X>=0&&E===K[X]){X--;for(let L=I.length-1;L>=0;L--)q=I[L];continue}for(let L=I.length-1;L>=0;L--){let be=I[L];be.nextSibling!==q&&a.insertBefore(be,q),q=be;}}o=T;}return g(()=>{m.stop();for(let a of o)N(a);o=[],y(),n.parentNode&&n.parentNode.removeChild(n);}),e$1}yt[We]=true;
|
|
2
|
+
export{ne as Component,yt as For,at as Fragment,dt as Portal,mt as Suspense,ee as addEvent,oe as addEventListener,Fe as beginHydration,Sn as bindElement,Gt as child,cn as clearDelegatedEvents,Re as consumeTeleportAnchor,Le as consumeTeleportBlock,on as createApp,he as createComponent,Fn as createResource,Mn as defineAsyncComponent,ln as delegateEvents,De as endHydration,Ye as getHydrationKey,Dt as getRenderedElement,rn as hydrate,ce as inject,z as insert,O as isComponent,bn as isFragment,le as isHydrating,An as isPortal,Ln as isSuspense,Yt as next,de as normalizeClass,Jt as nthChild,Cn as omitProps,te as onDestroy,Oe as onMount,Qt as onUpdate,G as patchAttr,It as patchAttrHydrate,fe as patchClass,Mt as patchClassHydrate,me as patchStyle,Ht as patchStyleHydrate,je as provide,Rt as resetHydrationKey,J as setStyle,pe as template};//# sourceMappingURL=template.esm.js.map
|
|
3
3
|
//# sourceMappingURL=template.esm.js.map
|