const u={context:void 0,registry:void 0};function T(e){u.context=e}function de(){return{...u.context,id:`${u.context.id}${u.context.count++}-`,count:0}}const he=(e,t)=>e===t,pe=Symbol("solid-track"),j={equals:he};let z=re;const $=1,I=2,ee={owned:null,cleanups:null,context:null,owner:null};var d=null;let q=null,ge=null,p=null,y=null,C=null,V=0;function F(e,t){const n=p,s=d,i=e.length===0,l=t===void 0?s:t,f=i?ee:{owned:null,cleanups:null,context:l?l.context:null,owner:l},o=i?e:()=>e(()=>L(()=>Y(f)));d=f,p=null;try{return B(o,!0)}finally{p=n,d=s}}function R(e,t){t=t?Object.assign({},j,t):j;const n={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0},s=i=>(typeof i=="function"&&(i=i(n.value)),le(n,i));return[ie.bind(n),s]}function M(e,t,n){const s=W(e,t,!1,$);P(s)}function je(e,t,n){z=Ce;const s=W(e,t,!1,$),i=_&&se(_);i&&(s.suspense=i),s.user=!0,C?C.push(s):P(s)}function H(e,t,n){n=n?Object.assign({},j,n):j;const s=W(e,t,!0,0);return s.observers=null,s.observerSlots=null,s.comparator=n.equals||void 0,P(s),ie.bind(s)}function L(e){if(p===null)return e();const t=p;p=null;try{return e()}finally{p=t}}function te(e){return d===null||(d.cleanups===null?d.cleanups=[e]:d.cleanups.push(e)),e}function ye(){return d}function be(e){C.push.apply(C,e),e.length=0}function ne(e,t){const n=Symbol("context");return{id:n,Provider:Ee(n),defaultValue:e}}function se(e){return d&&d.context&&d.context[e.id]!==void 0?d.context[e.id]:e.defaultValue}function we(e){const t=H(e),n=H(()=>G(t()));return n.toArray=()=>{const s=n();return Array.isArray(s)?s:s!=null?[s]:[]},n}let _;function xe(){return _||(_=ne())}function ie(){if(this.sources&&this.state)if(this.state===$)P(this);else{const e=y;y=null,B(()=>U(this),!1),y=e}if(p){const e=this.observers?this.observers.length:0;p.sources?(p.sources.push(this),p.sourceSlots.push(e)):(p.sources=[this],p.sourceSlots=[e]),this.observers?(this.observers.push(p),this.observerSlots.push(p.sources.length-1)):(this.observers=[p],this.observerSlots=[p.sources.length-1])}return this.value}function le(e,t,n){let s=e.value;return(!e.comparator||!e.comparator(s,t))&&(e.value=t,e.observers&&e.observers.length&&B(()=>{for(let i=0;i1e6)throw y=[],new Error},!1)),t}function P(e){if(!e.fn)return;Y(e);const t=V;Ae(e,e.value,t)}function Ae(e,t,n){let s;const i=d,l=p;p=d=e;try{s=e.fn(t)}catch(f){return e.pure&&(e.state=$,e.owned&&e.owned.forEach(Y),e.owned=null),e.updatedAt=n+1,fe(f)}finally{p=l,d=i}(!e.updatedAt||e.updatedAt<=n)&&(e.updatedAt!=null&&"observers"in e?le(e,s):e.value=s,e.updatedAt=n)}function W(e,t,n,s=$,i){const l={fn:e,state:s,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:d,context:d?d.context:null,pure:n};return d===null||d!==ee&&(d.owned?d.owned.push(l):d.owned=[l]),l}function O(e){if(e.state===0)return;if(e.state===I)return U(e);if(e.suspense&&L(e.suspense.inFallback))return e.suspense.effects.push(e);const t=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt=0;n--)if(e=t[n],e.state===$)P(e);else if(e.state===I){const s=y;y=null,B(()=>U(e,t[0]),!1),y=s}}function B(e,t){if(y)return e();let n=!1;t||(y=[]),C?n=!0:C=[],V++;try{const s=e();return Se(n),s}catch(s){n||(C=null),y=null,fe(s)}}function Se(e){if(y&&(re(y),y=null),e)return;const t=C;C=null,t.length&&B(()=>z(t),!1)}function re(e){for(let t=0;t=0;t--)Y(e.owned[t]);e.owned=null}if(e.cleanups){for(t=e.cleanups.length-1;t>=0;t--)e.cleanups[t]();e.cleanups=null}e.state=0}function me(e){return e instanceof Error?e:new Error(typeof e=="string"?e:"Unknown error",{cause:e})}function fe(e,t=d){throw me(e)}function G(e){if(typeof e=="function"&&!e.length)return G(e());if(Array.isArray(e)){const t=[];for(let n=0;ni=L(()=>(d.context={...d.context,[e]:s.value},we(()=>s.children))),void 0),i}}const ve=Symbol("fallback");function Q(e){for(let t=0;t1?[]:null;return te(()=>Q(l)),()=>{let c=e()||[],a,r;return c[pe],L(()=>{let h=c.length,g,x,A,v,m,w,S,E,N;if(h===0)f!==0&&(Q(l),l=[],s=[],i=[],f=0,o&&(o=[])),n.fallback&&(s=[ve],i[0]=F(ae=>(l[0]=ae,n.fallback())),f=1);else if(f===0){for(i=new Array(h),r=0;r=w&&E>=w&&s[S]===c[E];S--,E--)A[E]=i[S],v[E]=l[S],o&&(m[E]=o[S]);for(g=new Map,x=new Array(E+1),r=E;r>=w;r--)N=c[r],a=g.get(N),x[r]=a===void 0?-1:a,g.set(N,r);for(a=w;a<=S;a++)N=s[a],r=g.get(N),r!==void 0&&r!==-1?(A[r]=i[a],v[r]=l[a],o&&(m[r]=o[a]),r=x[r],g.set(N,r)):l[a]();for(r=w;re(t||{}));return T(n),s}return L(()=>e(t||{}))}function Ie(e){const t="fallback"in e&&{fallback:()=>e.fallback};return H($e(()=>e.each,e.children,t||void 0))}const ke=ne();function Me(e){let t=0,n,s,i,l,f;const[o,c]=R(!1),a=xe(),r={increment:()=>{++t===1&&c(!0)},decrement:()=>{--t===0&&c(!1)},inFallback:o,effects:[],resolved:!1},b=ye();if(u.context&&u.load){const x=u.context.id+u.context.count;let A=u.load(x);if(A&&(typeof A!="object"||A.status!=="success"?i=A:u.gather(x)),i&&i!=="$$f"){const[v,m]=R(void 0,{equals:!1});l=v,i.then(()=>{if(u.done)return m();u.gather(x),T(s),m(),T()},w=>{f=w,m()})}}const h=se(ke);h&&(n=h.register(r.inFallback));let g;return te(()=>g&&g()),Ne(a.Provider,{value:r,get children(){return H(()=>{if(f)throw f;if(s=u.context,l)return l(),l=void 0;s&&i==="$$f"&&T();const x=H(()=>e.children);return H(A=>{const v=r.inFallback(),{showContent:m=!0,showFallback:w=!0}=n?n():{};if((!v||i&&i!=="$$f")&&m)return r.resolved=!0,g&&g(),g=s=i=void 0,be(r.effects),x();if(w)return g?A:F(S=>(g=S,s&&(T({id:s.id+"f",count:0}),s=void 0),e.fallback),b)})})}})}function He(e,t,n){let s=n.length,i=t.length,l=s,f=0,o=0,c=t[i-1].nextSibling,a=null;for(;fr-o){const x=t[f];for(;o{i=l,t===document?e():Fe(t,e(),t.firstChild?null:void 0,n)},s.owner),()=>{i(),t.textContent=""}}function _e(e,t,n){let s;const i=()=>{const f=document.createElement("template");return f.innerHTML=e,f.content.firstChild},l=()=>(s||(s=i())).cloneNode(!0);return l.cloneNode=l,l}function Oe(e,t=window.document){const n=t[X]||(t[X]=new Set);for(let s=0,i=e.length;sD(e,t(),i,n),s)}function Pe(e,t,n={}){u.completed=globalThis._$HY.completed,u.events=globalThis._$HY.events,u.load=i=>globalThis._$HY.r[i],u.has=i=>i in globalThis._$HY.r,u.gather=i=>Z(t,i),u.registry=new Map,u.context={id:n.renderId||"",count:0},Z(t,n.renderId);const s=Le(e,t,[...t.childNodes],n);return u.context=null,s}function Ye(e){let t,n;return!u.context||!(t=u.registry.get(n=Be()))?e():(u.completed&&u.completed.add(t),u.registry.delete(n),t)}function qe(e){let t=e,n=0,s=[];if(u.context)for(;t;){if(t.nodeType===8){const i=t.nodeValue;if(i==="$")n++;else if(i==="/"){if(n===0)return[t,s];n--}}s.push(t),t=t.nextSibling}return[t,s]}function Re(){u.events&&!u.events.queued&&(queueMicrotask(()=>{const{completed:e,events:t}=u;for(t.queued=!1;t.length;){const[n,s]=t[0];if(!e.has(n))return;ce(s),t.shift()}}),u.events.queued=!0)}function ce(e){const t=`$$${e.type}`;let n=e.composedPath&&e.composedPath()[0]||e.target;for(e.target!==n&&Object.defineProperty(e,"target",{configurable:!0,value:n}),Object.defineProperty(e,"currentTarget",{configurable:!0,get(){return n||document}}),u.registry&&!u.done&&(u.done=_$HY.done=!0);n;){const s=n[t];if(s&&!n.disabled){const i=n[`${t}Data`];if(i!==void 0?s.call(n,i,e):s.call(n,e),e.cancelBubble)return}n=n._$host||n.parentNode||n.host}}function D(e,t,n,s,i){const l=!!u.context&&e.isConnected;if(l){!n&&(n=[...e.childNodes]);let c=[];for(let a=0;a{let c=t();for(;typeof c=="function";)c=c();n=D(e,c,n,s)}),()=>n;if(Array.isArray(t)){const c=[],a=n&&Array.isArray(n);if(K(c,t,n,i))return M(()=>n=D(e,c,n,s,!0)),()=>n;if(l){if(!c.length)return n;if(s===void 0)return[...e.childNodes];let r=c[0],b=[r];for(;(r=r.nextSibling)!==s;)b.push(r);return n=b}if(c.length===0){if(n=k(e,n,s),o)return n}else a?n.length===0?J(e,c,s):He(e,n,c):(n&&k(e),J(e,c));n=c}else if(t.nodeType){if(l&&t.parentNode)return n=o?[t]:t;if(Array.isArray(n)){if(o)return n=k(e,n,s,t);k(e,n,null,t)}else n==null||n===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t}}return n}function K(e,t,n,s){let i=!1;for(let l=0,f=t.length;l=0;f--){const o=t[f];if(i!==o){const c=o.parentNode===e;!l&&!f?c?e.replaceChild(i,o):e.insertBefore(i,n):c&&o.remove()}else l=!0}}else e.insertBefore(i,n);return[i]}function Z(e,t){const n=e.querySelectorAll("*[data-hk]");for(let s=0;s(Te(),Pe(...e));export{Ie as F,Me as S,je as a,qe as b,R as c,Oe as d,Ne as e,M as f,Ye as g,Ve as h,Fe as i,Ge as j,Le as k,H as l,Ue as m,Re as r,De as s,_e as t};