nuclo 0.2.15 → 0.2.17

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/nuclo.mjs CHANGED
@@ -1,2 +1,2 @@
1
- function e(e){return e===null||typeof e!=`object`&&typeof e!=`function`}function t(e){return e instanceof Node?!0:typeof e!=`object`||!e?!1:typeof e.nodeType==`number`}function n(e){return typeof e==`object`&&!!e}function r(e){return n(e)&&`tagName`in e}function i(e){return typeof e==`boolean`}function a(e){return typeof e==`function`}function o(e){return a(e)&&e.length===0}function s(e,t){typeof console<`u`&&console.error(`nuclo: ${e}`,t)}const c=typeof window<`u`&&typeof document<`u`,l=new WeakMap;function u(e,t){let n=l.get(e);n?n.push(t):l.set(e,[t])}function d(e,t){e.removeEventListener(t.type,t.wrapped,t.options)}function f(e,t){let n=l.get(e);if(!n)return;if(t===void 0){for(let t=0;t<n.length;t++)d(e,n[t]);l.delete(e);return}let r=0;for(let i=0;i<n.length;i++){let a=n[i];a.type===t?d(e,a):n[r++]=a}n.length=r,r===0&&l.delete(e)}function p(e,t,n){return function(r){if(!c||!r||typeof r.addEventListener!=`function`)return;let i=r,a=function(n){try{t.call(i,n)}catch(t){s(`Error in '${e}' listener`,t)}};i.addEventListener(e,a,n),u(i,{type:e,wrapped:a,options:n})}}const m=new Set,h=new WeakMap,g=new Set,_=new WeakMap;function v(e,t){let n=h.get(e);if(n){n.info.resolver=t.resolver,n.info.lastValue=t.lastValue,n.info.sanitize=t.sanitize;return}let r=new WeakRef(e);m.add(r),h.set(e,{ref:r,info:t})}function y(e,t){let n=new WeakRef(e);g.add(n),_.set(e,{ref:n,info:t})}function b(e){m.delete(e)}function ee(e){g.delete(e)}function x(e){let t=h.get(e);t&&(m.delete(t.ref),h.delete(e))}function S(e){let t=_.get(e);t&&(g.delete(t.ref),_.delete(e))}const C=new WeakMap,w=new Set,T=new WeakMap,E=typeof FinalizationRegistry<`u`?new FinalizationRegistry(e=>{w.delete(e)}):null;function D(e,t){C.set(e,t);let n=new WeakRef(e);w.add(n),T.set(e,n),E?.register(e,n)}function O(e){C.delete(e);let t=T.get(e);t&&(w.delete(t),T.delete(e))}function te(){let e=[],t=[];for(let n of w){let r=n.deref();r===void 0?t.push(n):e.push(r)}for(let e of t)w.delete(e);return e}function ne(e){return C.get(e)??null}const re=`http://www.w3.org/2000/svg`;function ie(e){return globalThis.document?document.createElement(e):null}function ae(e,t){return globalThis.document?document.createElementNS(e,t):null}function k(e){return globalThis.document?document.createTextNode(e):null}function oe(){return globalThis.document?document.createDocumentFragment():null}function se(e,t){try{return e.appendChild(t),!0}catch(e){return s(`Failed to append child node`,e),!1}}function ce(e){if(e.nodeType===Node.ELEMENT_NODE){let t=e;f(t),S(t),O(t)}else e.nodeType===Node.TEXT_NODE?x(e):e.nodeType===Node.COMMENT_NODE&&O(e);if(e.childNodes&&e.childNodes.length>0)for(let t=0;t<e.childNodes.length;t++)ce(e.childNodes[t])}function A(e){if(!e?.parentNode)return!1;try{return ce(e),e.parentNode.removeChild(e),!0}catch(e){return s(`Failed to remove child node`,e),!1}}function le(e,t,n){try{return e.insertBefore(t,n),!0}catch(e){return s(`Failed to insert node before reference`,e),!1}}function j(e){return globalThis.document?globalThis.document.createComment(e):null}function ue(e,t=`hidden`){return globalThis.document?globalThis.document.createComment(`conditional-${e}-${t}`):null}function de(e,t){let n=j(`${e}-end`);if(!n)throw Error(`Failed to create comment: document not available`);let r=j(`${e}-start-${t}`);if(!r)throw Error(`Failed to create comment: document not available`);return{start:r,end:n}}function fe(e,t){let n=e.nextSibling;for(;n&&n!==t;){let e=n.nextSibling;A(n),n=e}}function pe(e,t){let n=t.parentNode;if(n)for(let r=0;r<e.length;r++)le(n,e[r],t)}function me(e,...t){if(!e)return e;for(let n=0;n<t.length;n++){let r=t[n];if(r!=null){let t;if(typeof r==`string`){let e=k(r);if(e)t=e;else continue}else t=r;se(e,t)}}return e}function M(e){return e?.isConnected===!0}function he(e,t){if(!e?.parentNode)return!1;try{return e.parentNode.replaceChild(t,e),!0}catch(e){return s(`Error replacing conditional node`,e),!1}}function ge(e){return e}function _e(e,t,n){let r=ge(e),i=r.appendChild.bind(r),a=r.insertBefore.bind(r);r.appendChild=function(e){return a(e,t)};try{return n()}finally{r.appendChild=i}}function ve(e,t,n){try{if(n==null||n===``)return e.style[t]=``,!0;let r=String(n);return e.style[t]=r,!0}catch{return!1}}const ye={};let be=!1;function xe(e){let t=e.target;if(!t||typeof Node>`u`||!(t instanceof Node))return;let n=t;for(;n;){if(n instanceof Element){let e=_.get(n);e&&(M(n)?Ee(e.info):(ee(e.ref),_.delete(n)))}n=n.parentNode}}function Se(){be||typeof document>`u`||typeof document.addEventListener!=`function`||(document.addEventListener(`update`,xe,!0),be=!0)}function Ce(e){let t=_.get(e);if(t)return t.info;let n={attributeResolvers:[]};return y(e,n),n}function we(e){return typeof e!=`object`||!e}function Te(e){let t;try{t=e.resolver()}catch(t){s(`Failed to resolve reactive attribute: ${e.key}`,t);return}let n=we(t);if(!(n&&Object.is(t,e.lastValue)))try{e.applyValue(t),e.lastValue=n?t:ye}catch(t){s(`Failed to apply reactive attribute: ${e.key}`,t)}}function Ee(e){let t=e.attributeResolvers;for(let e=0;e<t.length;e++)Te(t[e])}function De(e,t,n,r){if(!(e instanceof Element)||!t||typeof n!=`function`){s(`Invalid parameters for registerAttributeResolver`);return}let i={key:t,resolver:n,applyValue:r,lastValue:ye};if(!c){Te(i);return}Se();let a=Ce(e).attributeResolvers,o=!1;for(let e=0;e<a.length;e++)if(a[e].key===t){a[e]=i,o=!0;break}o||a.push(i),Te(i)}function Oe(e){let t=[];for(let n of g){let r=n.deref();if(r===void 0){t.push(n);continue}let i=_.get(r);if(!i){t.push(n);continue}if(!M(r)){_.delete(r),t.push(n);continue}e&&!e.contains(r)||Ee(i.info)}for(let e of t)ee(e)}function ke(e,t){if(!(!e?.style||!t))for(let n in t)ve(e,n,t[n])||s(`Failed to set style property '${n}'`)}function Ae(e,t){e&&(a(t)?De(e,`style`,t,function(t){ke(e,t)}):ke(e,t))}const N=new WeakMap,je=new WeakSet;function P(e,t){let n=t.length,r=0;for(let i=0;i<=n;i++)(i===n||t.charCodeAt(i)===32)&&(i>r&&e.add(t.substring(r,i)),r=i+1)}function Me(e){let t=``;for(let n of e)t&&(t+=` `),t+=n;return t}function Ne(e){if(e.className&&!N.has(e)){let t=new Set;P(t,e.className),N.set(e,t)}je.add(e)}function Pe(e){return je.has(e)}function Fe(e,t){if(!t)return;let n=N.get(e);n||(n=new Set,N.set(e,n)),P(n,t)}function Ie(e,t){let n=N.get(e);if(!n||n.size===0){let n=t||``;e.className!==n&&(e.className=n);return}if(!t){e.className=Me(n);return}let r=Me(n),i=t.length,a=0;for(let e=0;e<=i;e++)if(e===i||t.charCodeAt(e)===32){if(e>a){let i=t.substring(a,e);n.has(i)||(r+=` `+i)}a=e+1}e.className=r}function Le(e,t){if(!t)return;let n=e.className;if(n&&n!==t){let r=new Set;P(r,n),P(r,t),e.className=Me(r)}else e.className=t}function Re(e,t,n){if(typeof e!=`function`){s(`Invalid resolver provided to createReactiveTextNode`);let e=k(``);if(!e)throw Error(`Failed to create text node: document not available`);return e}let r;if(arguments.length>1)r=t;else try{r=e()}catch(e){s(`Failed to evaluate reactive text resolver`,e),r=``}let i=r===void 0?``:String(r),a=k(i);if(!a)throw Error(`Failed to create text node: document not available`);return c&&v(a,{resolver:e,lastValue:i,sanitize:n}),a}function ze(e){let t=[];for(let n of m){let r=n.deref();if(r===void 0){t.push(n);continue}let i=h.get(r);if(!i){t.push(n);continue}let a=i.info;if(!M(r)){h.delete(r),t.push(n);continue}if(e&&!e.contains(r))continue;let o;try{o=a.resolver()}catch(e){s(`Failed to update reactive text node`,e),o=void 0}let c=a.sanitize?o==null||typeof o==`object`||typeof o==`function`?``:String(o):o===void 0?``:String(o);c!==a.lastValue&&(r.textContent=c,a.lastValue=c)}for(let e of t)b(e)}function Be(e,t,n,r){if(n!=null){if(r&&t===`className`&&e instanceof HTMLElement){Le(e,String(n));return}if(e instanceof Element&&e.namespaceURI===`http://www.w3.org/2000/svg`)e.setAttribute(t,String(n));else if(t in e)try{e[t]=n}catch{e instanceof Element&&e.setAttribute(t,String(n))}else e instanceof Element&&e.setAttribute(t,String(n))}}function Ve(e,t,n,r=!1){if(n!=null){if(t===`style`){Ae(e,n);return}if(a(n)){let r=String(t);if(r.charCodeAt(0)===111&&r.charCodeAt(1)===110){e[r]=n;return}if(n.length===0){let t=n;r===`className`&&e instanceof HTMLElement?(Ne(e),De(e,r,t,function(t){Ie(e,String(t||``))})):De(e,r,t,function(t){Be(e,r,t,!1)});return}}if(t===`className`&&e instanceof HTMLElement&&Pe(e)){let t=String(n||``);t&&(Fe(e,t),Le(e,t));return}Be(e,String(t),n,r)}}function F(e,t,n=!0){if(t)for(let r of Object.keys(t)){let i=t[r];Ve(e,r,i,n&&r===`className`)}}let I=!1,He=new WeakMap;function L(){return I}function Ue(){return!1}function We(){I=!0,He=new WeakMap}function Ge(){I=!1}function Ke(e){let t=I;I=!1;try{return e()}finally{I=t}}function R(e){let t=He.get(e);return t===void 0?e.firstChild:t}function z(e,t){He.set(e,t)}function qe(e){return e.nodeType===3&&!/\S/.test(e.textContent||``)}function B(e){let t=R(e),n=!1;for(;t&&qe(t);)t=t.nextSibling,n=!0;n&&z(e,t)}function V(e){let t=R(e);return t&&z(e,t.nextSibling),t}function Je(e,t){if(!I)return null;B(e);let n=R(e);return n&&n.nodeType===1&&n.tagName.toLowerCase()===t?V(e):null}function Ye(e,t){if(!t)return;let n=R(e);for(;n;){let r=n===t?null:n.nextSibling;e.removeChild(n),n=r}z(e,null)}const H=new WeakMap;function Xe(e){return n(e)&&!t(e)&&`className`in e&&typeof e.className==`string`&&Object.keys(e).length===1}function Ze(e){B(e);let t=R(e);return!!t&&t.nodeType===8&&t.textContent?.trimStart().startsWith(`text-`)===!0}function Qe(e,t){let n=R(e);if(n&&n.nodeType===3)return V(e),n.textContent!==t&&(n.textContent=t),n;let r=k(t);return r?(e.insertBefore(r,n),z(e,n),r):null}function U(r,i,c){if(i==null)return null;if(a(i)){if(o(i))try{let t=H.get(i);if(t||(t={value:i(),error:!1},H.set(i,t)),t.error)return et(c,()=>``);let n=t.value;if(Xe(n))return F(r,{className:()=>{let e=i();return Xe(e)?e.className:``}}),null;if(e(n)){let e=i,t=n??``;if(L()&&Ze(r)){let n=r;V(n);let i=String(t),a=Qe(n,i);return a&&v(a,{resolver:e,lastValue:i,sanitize:!0}),null}return et(c,e,t,!0)}return null}catch(e){return H.set(i,{value:void 0,error:!0}),s(`Error evaluating reactive text function:`,e),et(c,()=>``)}let a=i(r,c);return a==null?null:e(a)?tt(c,a):t(a)?a:(n(a)&&F(r,a),null)}let l=i;if(e(l)){if(L()&&Ze(r)){let e=r;return V(e),Qe(e,String(l)),null}return tt(c,l)}return t(l)?l:(F(r,l),null)}function $e(e,t){if(c&&!L()&&!Ue())return t;let n=oe();if(!n)throw Error(`Failed to create document fragment: document not available`);let r=j(` text-${e} `);return r&&n.appendChild(r),t&&n.appendChild(t),n}function et(e,t,n,r){return $e(e,Re(t,n,r))}function tt(e,t){return $e(e,k(String(t)))}const nt=Symbol(`nuclo.factory.tag`),rt=Symbol(`nuclo.factory.mods`);let it=0;function at(e,t,n){e[nt]=t,e[rt]=n}function W(e){return typeof e==`function`?e[rt]:void 0}function G(e){return typeof e==`function`?e[nt]:void 0}function ot(){return it>0}function st(e){it++;try{return e()}finally{it--}}function K(e,t,n=0){if(!t||t.length===0)return;let r=n,i=e;for(let n=0;n<t.length;n+=1){let a=t[n];if(a==null)continue;let o=U(e,a,r);o&&(o.parentNode!==i&&i.appendChild(o),r+=1)}}function ct(e,t){let n=ie(e);return K(n,t,0),n}function lt(e,t){let n=ae(re,e);if(!n)throw Error(`Failed to create SVG element: ${e}`);return K(n,t,0),n}function ut(e,...t){if(ot()){let n=function(){return null};return at(n,e,t),n}let n=function(n,r=0){let i=n,a=i?Je(i,e):null,o=a??ie(e),s=o,c=a?s.lastChild:null;return K(o,t,r),a&&Ye(s,c),o};return at(n,e,t),n}function dt(e,...t){if(ot()){let n=function(){return null};return at(n,e,t),n}return function(n,r=0){let i=n,a=i?Je(i,e):null,o=a??ae(`http://www.w3.org/2000/svg`,e);if(!o)throw Error(`Failed to create SVG element: ${e}`);let s=o,c=a?s.lastChild:null;return K(o,t,r),a&&Ye(s,c),o}}function ft(e){return(...t)=>ut(e,...t)}function pt(e){return(...t)=>dt(e,...t)}const mt=`a.abbr.address.area.article.aside.audio.b.base.bdi.bdo.blockquote.body.br.button.canvas.caption.cite.code.col.colgroup.data.datalist.dd.del.details.dfn.dialog.div.dl.dt.em.embed.fieldset.figcaption.figure.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.iframe.img.input.ins.kbd.label.legend.li.link.main.map.mark.menu.meta.meter.nav.noscript.object.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.script.search.section.select.slot.small.source.span.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.title.tr.track.u.ul.var.video.wbr`.split(`.`),ht=`a.animate.animateMotion.animateTransform.circle.clipPath.defs.desc.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.image.line.linearGradient.marker.mask.metadata.mpath.path.pattern.polygon.polyline.radialGradient.rect.script.set.stop.style.svg.switch.symbol.text.textPath.title.tspan.use.view`.split(`.`),gt=[`area`,`base`,`br`,`col`,`embed`,`hr`,`img`,`input`,`link`,`meta`,`source`,`track`,`wbr`];function _t(e,t){if(t in e&&typeof e[t]!=`function`)return;let n=ft(t);e[t]=n,t===`var`&&(e.var_=n)}function vt(e,t){let n=`${t}Svg`;n in e||(e[n]=pt(t))}function yt(e=globalThis){let t=`__nuclo_tags_registered`;if(!e[t]){for(let t=0;t<ht.length;t++)vt(e,ht[t]);for(let t=0;t<mt.length;t++)_t(e,mt[t]);e[t]=!0}}function q(e,t,n){if(a(e)){let i=e(t,n);return i&&r(i)?i:null}return e&&r(e)?e:null}function bt(e){return e.charCodeAt(0)===111&&e.charCodeAt(1)===110}function xt(e,n){let r=[],i=0;for(let e=0;e<n.length;e++){let a=n[e];if(a==null){r.push({kind:4});continue}let o=typeof a;if(o===`function`){let e=W(a);if(e!==void 0){let t=G(a);if(!t)return null;let n=xt(t,e);if(!n)return null;r.push({kind:3,child:n});continue}if(a.length===0){let e;try{e=a(),H.set(a,{value:e,error:!1})}catch{return null}if(e==null||typeof e!=`object`&&typeof e!=`function`){r.push({kind:2});continue}return null}return null}if(o===`object`){if(t(a))return null;let e=a,n=Object.keys(e),o=[];for(let t=0;t<n.length;t++){let r=n[t],a=e[r];if(a==null){o.push({key:r,kind:3,prop:!1});continue}if(r===`style`)return null;let s=typeof a;if(s===`function`){if(bt(r)){o.push({key:r,kind:1,prop:!1});continue}if(r===`className`&&a.length===0){if(i++)return null;o.push({key:r,kind:2,prop:!1});continue}return null}if(s===`object`||r===`className`&&i++)return null;o.push({key:r,kind:0,prop:!1,value:a})}r.push({kind:0,keys:o});continue}r.push({kind:1})}return{tag:e,slots:r}}function St(e,t){let n=e.slots,r=t.firstChild;for(let e=0;e<n.length;e++){let i=n[e];switch(i.kind){case 0:{let e=i.keys;for(let n=0;n<e.length;n++){let r=e[n];r.kind===0?r.prop=r.key in t:r.kind===2&&(t.className=``)}break}case 1:case 2:r&&=r.nextSibling;break;case 3:if(!r)return;St(i.child,r),r=r.nextSibling;break}}}function Ct(e,t,n,r){let i=e.slots;if(t.length!==i.length)return!1;let a=n.firstChild;for(let e=0;e<i.length;e++){let o=i[e],s=t[e];switch(o.kind){case 0:{if(typeof s!=`object`||!s)return!1;let e=s,t=o.keys;if(Object.keys(e).length!==t.length)return!1;for(let i=0;i<t.length;i++){let a=t[i],o=e[a.key];switch(a.kind){case 0:if(o==null||typeof o==`object`||typeof o==`function`)return!1;if(o===a.value)break;if(a.prop){let e=n;e[a.key]!==o&&(e[a.key]=o)}else{let e=String(o);n.getAttribute(a.key)!==e&&n.setAttribute(a.key,e)}break;case 1:if(typeof o!=`function`)return!1;n[a.key]=o;break;case 2:{if(typeof o!=`function`||o.length!==0)return!1;let e=o,t;try{t=e()}catch{return!1}let i=t?String(t):``;i&&(n.className=i),r.push({kind:1,node:n,fn:e,last:i});break}case 3:if(o!=null)return!1;break}}break}case 1:if(s==null||typeof s==`object`||typeof s==`function`||!a)return!1;a.nodeValue=String(s),a=a.nextSibling;break;case 2:{if(typeof s!=`function`||s.length!==0||W(s)!==void 0||!a)return!1;let e;try{e=s()}catch{return!1}if(e!=null&&(typeof e==`object`||typeof e==`function`))return!1;let t=e==null?``:String(e),n=a;n.nodeValue=t,r.push({kind:0,node:n,fn:s,last:t}),a=n.nextSibling;break}case 3:{let e=W(s);if(e===void 0||G(s)!==o.child.tag||!a||!Ct(o.child,e,a,r))return!1;a=a.nextSibling;break}case 4:if(s!=null)return!1;break}}return!0}function wt(e,t,n,r){let i=e.slots;if(t.length!==i.length)return!1;let a=n.firstChild;for(let e=0;e<i.length;e++){let o=i[e],s=t[e];switch(o.kind){case 0:{if(typeof s!=`object`||!s)return!1;let e=s,t=o.keys,i=0;for(let a in e){if(i>=t.length)return!1;let o=t[i];if(o.key!==a)return!1;i++;let s=e[a];if(o.kind===2){if(typeof s!=`function`||s.length!==0)return!1;S(n),r.push({kind:1,node:n,fn:s,last:n.className})}}if(i!==t.length)return!1;break}case 1:if(!a)return!1;a=a.nextSibling;break;case 2:{if(typeof s!=`function`||s.length!==0||!a||a.nodeType!==3)return!1;let e=a;x(e),r.push({kind:0,node:e,fn:s,last:e.nodeValue??``}),a=e.nextSibling;break}case 3:{let e=W(s);if(e===void 0||G(s)!==o.child.tag||!a||!wt(o.child,e,a,r))return!1;a=a.nextSibling;break}case 4:if(s!=null)return!1;break}}return!0}function Tt(e){for(let t=0;t<e.length;t++){let n=e[t],r;try{r=n.fn()}catch{continue}if(n.kind===0){let e=r==null||typeof r==`object`||typeof r==`function`?``:String(r);e!==n.last&&(n.node.nodeValue=e,n.last=e)}else{let e=r?String(r):``;e!==n.last&&(n.node.className=e,n.last=e)}}}function Et(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}const J=new Set,Dt=new WeakMap,Ot=typeof FinalizationRegistry<`u`?new FinalizationRegistry(e=>{J.delete(e)}):null;let Y=0;function kt(e,t){let n=new WeakRef(e);J.add(n),Dt.set(e,t),Ot?.register(e,n)}function At(e){return Array.isArray(e)?e:Array.from(e)}function jt(e){if(typeof e!=`object`||!e)return!1;let t=e.element;return!!t&&typeof Node<`u`&&t instanceof Node}function Mt(e,t,n){e.lastRenderLeaves=null,e.lastRenderRefresh=null;let r=e.template,i=c&&!L()&&!Ue(),a=r&&i?st(()=>e.renderItem(t,n)):e.renderItem(t,n);if(jt(a))return e.lastRenderRefresh=typeof a.update==`function`?a.update:null,a.element;if(r!==null&&i){let i=W(a);if(i!==void 0){if(r===void 0){let t=G(a),r=t?xt(t,i):null,o=q(a,e.host,n);if(r&&o){let t=o.cloneNode(!0);St(r,t);let n=[];if(wt(r,i,o,n))n.length>0&&(e.lastRenderLeaves=n);else return e.template=null,e.lastRenderLeaves=null,o;e.template={tmpl:r,skeleton:t}}else e.template=null;return o}let o=r.skeleton.cloneNode(!0),s=[];if(Ct(r.tmpl,i,o,s))return s.length>0&&(e.lastRenderLeaves=s),o;e.template=null,e.lastRenderLeaves=null;let c=e.renderItem(t,n);return jt(c)?(e.lastRenderRefresh=typeof c.update==`function`?c.update:null,c.element):q(c,e.host,n)}else if(r===void 0)e.template=null;else{e.template=null;let r=e.renderItem(t,n);return jt(r)?(e.lastRenderRefresh=typeof r.update==`function`?r.update:null,r.element):q(r,e.host,n)}}return q(a,e.host,n)}function Nt(e){A(e.element)}function Pt(e,t,n,r){if(n.parentNode!==t||r.parentNode!==t)return!1;if(c&&t.firstChild===n&&t.lastChild===r)return t.textContent=``,t.appendChild(n),t.appendChild(r),!0;for(let n=0;n<e.length;n++){let r=e[n].element;r&&r.parentNode===t&&t.removeChild(r)}return!0}function Ft(e){let t=e.length;if(t===0)return[];let n=Array(t),r=[];for(let i=0;i<t;i++){let t=e[i],a=0,o=r.length;for(;a<o;){let n=a+o>>1;e[r[n]]<t?a=n+1:o=n}n[i]=a>0?r[a-1]:-1,a===r.length?r.push(i):r[a]=i}let i=r.length,a=r[i-1],o=Array(i);for(;i>0;)o[--i]=a,a=n[a];return o}function It(e,t,n,r,i,a,o){let s=oe(),c=0;for(let l=r;l<i;l++){let r=n[l],i=Mt(e,r,l);if(!i)continue;let u=e.lastRenderLeaves;o.push({item:r,element:i,dyn:u,refresh:e.lastRenderRefresh,dynCreatedAt:u?e.currentFlushEpoch:void 0});let d=i;s?(s.appendChild(d),c++):t.insertBefore(d,a)}s&&c>0&&t.insertBefore(s,a)}function Lt(e){let{startMarker:t,endMarker:n}=e,r=t.parentNode??e.host,i=At(e.itemsProvider());if(Et(e.lastSyncedItems,i))return;let a=e.records,o=a.length,s=i.length;if(s===0){if(o>0&&!Pt(a,r,t,n))for(let e=0;e<o;e++)Nt(a[e]);e.records=[],e.lastSyncedItems=[],e.allRecordsCreatedAt=void 0;return}let c=0,l=Math.min(o,s);for(;c<l&&a[c].item===i[c];)c++;let u=0,d=l-c;for(;u<d&&a[o-1-u].item===i[s-1-u];)u++;let f=c,p=o-u,m=c,h=s-u;if(f===p){let t=p<o?a[p].element:n;if(p===o)It(e,r,i,m,h,t,a),e.allRecordsCreatedAt=o===0?e.currentFlushEpoch:void 0;else{let n=[];It(e,r,i,m,h,t,n),e.records=a.slice(0,f).concat(n,a.slice(f)),e.allRecordsCreatedAt=void 0}e.lastSyncedItems=i.slice();return}if(m===h){for(let e=f;e<p;e++)Nt(a[e]);a.splice(f,p-f),e.allRecordsCreatedAt=void 0,e.lastSyncedItems=i.slice();return}let g=p-f,_=h-m,v=Array(_).fill(-1),y=new Uint8Array(g),b=0,ee=Math.min(p,h);for(let e=c;e<ee;e++)a[e].item===i[e]&&(v[e-m]=e,y[e-f]=1,b++);let x=new Map;for(let e=f;e<p;e++){if(y[e-f])continue;let t=a[e].item,n=x.get(t);n===void 0?x.set(t,e):typeof n==`number`?x.set(t,[n,e]):n.push(e)}for(let e=0;e<_;e++){if(v[e]!==-1)continue;let t=x.get(i[m+e]);if(t===void 0)continue;let n;typeof t==`number`?(n=t,x.delete(i[m+e])):(n=t.shift(),t.length===0&&x.delete(i[m+e])),v[e]=n,y[n-f]=1,b++}if(b===0&&f===0&&p===o){if(!Pt(a,r,t,n))for(let e=0;e<o;e++)Nt(a[e]);let c=[];It(e,r,i,0,s,n,c),e.records=c,e.allRecordsCreatedAt=e.currentFlushEpoch,e.lastSyncedItems=i.slice();return}for(let e=f;e<p;e++)y[e-f]||Nt(a[e]);let S=null;if(b>0){let e=[],t=[];for(let n=0;n<_;n++)v[n]!==-1&&(e.push(v[n]),t.push(n));S=new Uint8Array(_);let n=Ft(e);for(let e=0;e<n.length;e++)S[t[n[e]]]=1}let C=Array(_),w=0,T=p<o?a[p].element:n,E=null;for(let t=_-1;t>=0;t--){let n=v[t];if(n===-1){let n=i[m+t],a=Mt(e,n,m+t);if(!a){C[t]=null,w++;continue}let o=e.lastRenderLeaves;C[t]={item:n,element:a,dyn:o,refresh:e.lastRenderRefresh,dynCreatedAt:o?e.currentFlushEpoch:void 0};let s=a;E||=oe(),E?E.insertBefore(s,E.firstChild):(r.insertBefore(s,T),T=s);continue}let o=a[n];C[t]=o;let s=o.element;if(E&&E.firstChild){let e=E.firstChild;r.insertBefore(E,T),T=e,E=null}(!S||!S[t])&&r.insertBefore(s,T),T=s}E&&E.firstChild&&r.insertBefore(E,T);let D=Array(f+(_-w)+(o-p)),O=0;for(let e=0;e<f;e++)D[O++]=a[e];for(let e=0;e<_;e++){let t=C[e];t&&(D[O++]=t)}for(let e=p;e<o;e++)D[O++]=a[e];e.records=D,e.allRecordsCreatedAt=void 0,e.lastSyncedItems=i.slice()}function Rt(e,t,n,r){return L()?Bt(e,t,n,r):zt(e,t,n,r)}function zt(e,t,n,r){let{start:i,end:a}=de(`list`,r),o={itemsProvider:e,renderItem:t,startMarker:i,endMarker:a,records:[],host:n,lastSyncedItems:[]},s=n;return s.appendChild(i),s.appendChild(a),Lt(o),c&&kt(i,o),o}function Bt(e,t,n,r){let i=n;B(i);let a=R(i);if(!a||a.nodeType!==8||!a.textContent?.startsWith(`list-start-`))return zt(e,t,n,r);let o=V(i),s=0,l=R(i);for(;l;){if(l.nodeType===8){let e=l.textContent||``;if(e.startsWith(`list-start-`))s++;else if(e===`list-end`){if(s===0)break;s--}}l=l.nextSibling}let u=l;if(!u){let e=j(`list-end`);e&&(i.insertBefore(e,o.nextSibling),u=e)}if(!u)return zt(e,t,n,r);let d=At(e()),f=[];for(let e=0;e<d.length;e++){let r=t(d[e],e),i=jt(r)?r:null,a=i?i.element:q(r,n,e);a&&f.push({item:d[e],element:a,refresh:i&&typeof i.update==`function`?i.update:void 0})}let p=R(i);for(;p&&p!==u;){let e=p.nextSibling;A(p),p=e}let m=u;for(let e=f.length-1;e>=0;e--){let t=f[e].element;(t.parentNode!==i||t.nextSibling!==m)&&i.insertBefore(t,m),m=t}z(i,u.nextSibling);let h={itemsProvider:e,renderItem:t,startMarker:o,endMarker:u,records:f,host:n,lastSyncedItems:d.slice()};return c&&kt(o,h),h}function Vt(e){for(let t=0;t<e.records.length;t++){let n=e.records[t];n.element=null,n.item=null,n.dyn=null,n.refresh=null,delete n.dynCreatedAt}e.records=[],e.lastSyncedItems=[],e.allRecordsCreatedAt=void 0}function Ht(e){let t=[];Y++;for(let n of J){let r=n.deref();if(!r){t.push(n);continue}let i=Dt.get(r);if(!i){t.push(n);continue}if(!M(r)||!M(i.endMarker)){Vt(i),Dt.delete(r),t.push(n);continue}if(e&&!e.contains(r))continue;i.currentFlushEpoch=Y;try{Lt(i)}finally{i.currentFlushEpoch=void 0}if(i.allRecordsCreatedAt===Y)continue;let a=i.records;for(let e=0;e<a.length;e++){if(a[e].dynCreatedAt===Y)continue;let t=a[e].refresh;t&&t();let n=a[e].dyn;n&&Tt(n)}}for(let e of t)J.delete(e)}function Ut(e,t){return function(n,r){return Rt(e,t,n,r).startMarker}}function Wt(e,t){try{return e()}catch(e){if(t)return t(e),!1;throw e}}function Gt(e,t){return typeof e==`function`?Wt(e,t):!!e}const Kt=new Set,qt=new WeakMap,Jt=typeof FinalizationRegistry<`u`?new FinalizationRegistry(e=>{Kt.delete(e)}):null;function Yt(e,t){for(let t=0;t<e.length;t++)if(Gt(e[t].condition))return t;return t.length>0?-1:null}function Xt(e){let{groups:t,elseContent:n,host:r,index:i,endMarker:a}=e,o=Yt(t,n);o!==e.activeIndex&&(fe(e.startMarker,e.endMarker),e.activeIndex=o,o!==null&&pe(en(o>=0?t[o].content:n,r,i,a),a))}function Zt(e){let t=new WeakRef(e.startMarker);Kt.add(t),qt.set(e.startMarker,e),Jt?.register(e.startMarker,t)}function Qt(e){let t=[];for(let n of Kt){let r=n.deref();if(r===void 0){t.push(n);continue}let i=qt.get(r);if(!i){t.push(n);continue}if(!M(r)||!M(i.endMarker)){qt.delete(r),t.push(n);continue}if(!(e&&!e.contains(r)))try{i.update()}catch(e){s(`when() branch threw during update; unregistering this conditional`,e),qt.delete(r),t.push(n)}}for(let e of t)Kt.delete(e)}function $t(e,t,n,r){return a(e)?o(e)?(H.delete(e),U(t,e,n)):_e(t,r,()=>{let r=U(t,e,n);return r&&!r.parentNode?r:null}):U(t,e,n)}function en(e,t,n,r){let i=[];for(let a of e){let e=$t(a,t,n,r);e&&i.push(e)}return i}function tn(e,t){return`when-start-${e}-b${t===null?`n`:t}`}function nn(e){let t=/-b(n|-?\d+)$/.exec(e||``);if(t)return t[1]===`n`?null:parseInt(t[1],10)}var rn=class e{groups=[];elseContent=[];constructor(e,...t){this.groups.push({condition:e,content:t})}cloneWith(t,n){let r=Object.create(e.prototype);return r.groups=[...this.groups],t&&r.groups.push(t),r.elseContent=n??[...this.elseContent],r}when(e,...t){return this.groups.push({condition:e,content:t}),this}else(...e){return this.elseContent=e,this}render(e,t){return globalThis.document?L()?this.hydrateRender(e,t):this.freshRender(e,t):null}freshRender(e,t){let{start:n,end:r}=de(`when`,t),i=this.createRuntimeFromMarkers(e,t,n,r),a=ge(e);return a.appendChild(n),a.appendChild(r),Xt(i),n.textContent=tn(t,i.activeIndex),n}hydrateRender(e,t){let n=e;B(n);let r=R(n);if(!r||r.nodeType!==8||!r.textContent?.startsWith(`when-start-`))return this.freshRender(e,t);let i=V(n),a=0,o=R(n);for(;o;){if(o.nodeType===8){let e=o.textContent||``;if(e.startsWith(`when-start-`))a++;else if(e===`when-end`){if(a===0)break;a--}}o=o.nextSibling}let s=o,c=!1;if(!s){let e=j(`when-end`);if(!e)return i;n.insertBefore(e,i.nextSibling),s=e,c=!0}let l=Yt(this.groups,this.elseContent),u=nn(i.textContent);if(!c&&(u===void 0||u===l)){if(l!==null){let n=l>=0?this.groups[l].content:this.elseContent;for(let r of n)U(e,r,t)}}else if(fe(i,s),l!==null){let n=l>=0?this.groups[l].content:this.elseContent,r=s;Ke(()=>{pe(en(n,e,t,r),r)})}return z(n,s.nextSibling),this.createRuntimeFromMarkers(e,t,i,s,l),i}createRuntimeFromMarkers(e,t,n,r,i=null){let a={startMarker:n,endMarker:r,host:e,index:t,groups:[...this.groups],elseContent:[...this.elseContent],activeIndex:i,update:function(){Xt(a)}};return c&&Zt(a),a}};function an(e){return Object.assign(function(t,n){return e.render(t,n)},{when:function(t,...n){return an(e.cloneWith({condition:t,content:n}))},else:function(...t){return an(e.cloneWith(void 0,t))}})}function on(e,...t){return an(new rn(e,...t))}function sn(e){try{return e.isSvg?lt(e.tagName,e.modifiers):ct(e.tagName,e.modifiers)}catch(t){if(s(`Error applying modifiers in conditional element "${e.tagName}"`,t),e.isSvg){let n=ae(re,e.tagName);if(!n)throw Error(`Failed to create SVG element: ${e.tagName}`,{cause:t});return n}let n=ie(e.tagName);if(!n)throw Error(`Failed to create element: ${e.tagName}`,{cause:t});return n}}function cn(e){let t=ne(e);if(!t)return;let n=Wt(t.condition,e=>{s(`Error evaluating conditional condition`,e)}),r=e.nodeType===Node.ELEMENT_NODE;if(n&&!r){let n=sn(t);D(n,t),he(e,n)}else if(!n&&r){let n=ue(t.tagName);n&&(D(n,t),he(e,n))}}function ln(e){if(c)try{let t=te();for(let n of t){if(!n.isConnected){O(n);continue}e&&!e.contains(n)||cn(n)}}catch(e){s(`Error during conditional elements update`,e)}}const un=new Map;function dn(e){let t=[],n=new Set;for(let r of e){if(typeof r!=`string`)continue;let e=r.trim();e&&(n.has(e)||(n.add(e),t.push(e)))}return t}function fn(e,t){let n=un.get(e);n||(n=new Set,un.set(e,n)),n.add(new WeakRef(t))}function pn(e){let t=dn(e);if(t.length===0)return[];let n=new Set;for(let e of t){let t=un.get(e);if(!t)continue;let r=[];for(let e of t){let t=e.deref();if(t===void 0){r.push(e);continue}if(!M(t)){r.push(e);continue}n.add(t)}for(let e of r)t.delete(e);t.size===0&&un.delete(e)}return Array.from(n)}function mn(...e){let t=dn(e);return function(e){if(c&&e instanceof Element)for(let n of t)fn(n,e)}}const hn=[Ht,Qt,ln,Oe,ze,_n];function gn(...e){let t;if(e.length>0){let n=pn(e);if(n.length===1){let e=n[0];t={roots:n,contains:t=>e.contains(t)}}else t={roots:n,contains:e=>{for(let t of n)if(t.contains(e))return!0;return!1}}}for(let e of hn)e(t)}function _n(e){if(typeof document>`u`)return;let t=e?e.roots:[document.body??document];for(let e of t)try{e.dispatchEvent(new Event(`update`,{bubbles:!0}))}catch(e){s(`Error dispatching global update event`,e)}}function vn(e,t,n=0){let r=t||document.body,i=e(r,n);return r.appendChild(i),i}function yn(e,t){let n=t||document.body,r=n;We();try{let t=e(n,0),i=t;if(i&&i.nodeType===1&&i.parentNode!==r){let e=R(r);if(e){let t=e.nextSibling;r.insertBefore(i,e),A(e),z(r,t)}else r.appendChild(i),z(r,null)}return t}finally{Ge()}}let bn=null;function xn(e){bn=e}const Sn=new Map,Cn=new Map,wn=new Set,Tn=[],X=new Map;let Z=null,Q=null,En=null,Dn=0;const On=new Map;function kn(e){for(let t of e)X.has(t)||X.set(t,[])}function An(e,t){try{let n=e.cssRules.length;e.insertRule(t+`{}`,n);let r=e.cssRules[n];return On.set(t,r),r}catch{return null}}function jn(e,t){try{e.insertRule(t,Dn),Dn++}catch{}}function Mn(){if(typeof document>`u`||typeof document.getElementById!=`function`)return null;if(Q&&En===document&&Q.ownerNode&&Q.ownerNode.isConnected)return Q;let e=document.getElementById(`nuclo-styles`);if(e||(e=document.createElement(`style`),e.id=`nuclo-styles`,document.head.appendChild(e)),Q=e.sheet,En=document,On.clear(),Dn=0,!Q)return null;for(let e of Tn)jn(Q,e);for(let[e,t]of X){let n=An(Q,e);if(n)for(let e of t)try{n.insertRule(e,n.cssRules.length)}catch{}}return Q}function Nn(e,t){if(t===void 0)Tn.push(e);else{let n=X.get(t);n||(n=[],X.set(t,n)),n.push(e)}Z=null,bn?.(t===void 0?e:t+`{`+e+`}`);let n=Mn();if(n)if(t===void 0)jn(n,e);else{let r=On.get(t)??An(n,t);if(r)try{r.insertRule(e,r.cssRules.length)}catch{}}}function Pn(e){let t=2166136261,n=2128831035;for(let r=0;r<e.length;r++){let i=e.charCodeAt(r);t=Math.imul(t^i,16777619),n=Math.imul(n^i,2246822507)}return(t>>>0).toString(36)+((n>>>9)%1296).toString(36)}function Fn(e,t,n,r){let i=(e??``)+`|`+t+`|`+n+`:`+r,a=Sn.get(i);return a===void 0?(a=`n`+Pn(i),Sn.set(i,a),Cn.set(a,(e??``)+`|`+t+`|`+n),Nn(`.`+a+t+`{`+n+`:`+r+`}`,e),a):(Mn(),a)}function In(e){return Cn.get(e)}function Ln(e,t){if(wn.has(e)){Mn();return}wn.add(e),Nn(t,void 0)}function Rn(){if(Z!==null)return Z;let e=Tn.join(``);for(let[t,n]of X)n.length>0&&(e+=t+`{`+n.join(``)+`}`);return Z=e,e}function zn(){Sn.clear(),Cn.clear(),wn.clear(),Tn.length=0,X.clear(),On.clear(),Z=null,Dn=0,Q=null,En=null,typeof document<`u`&&document.getElementById(`nuclo-styles`)?.remove()}const Bn={hover:`:hover`,focus:`:focus`,focusVisible:`:focus-visible`,focusWithin:`:focus-within`,active:`:active`,visited:`:visited`,disabled:`:disabled`,enabled:`:enabled`,checked:`:checked`,required:`:required`,invalid:`:invalid`,valid:`:valid`,readOnly:`:read-only`,first:`:first-child`,last:`:last-child`,only:`:only-child`,odd:`:nth-child(odd)`,even:`:nth-child(even)`,empty:`:empty`,placeholderShown:`:placeholder-shown`,placeholder:`::placeholder`,before:`::before`,after:`::after`,selection:`::selection`,marker:`::marker`,firstLine:`::first-line`,firstLetter:`::first-letter`},Vn={bg:[`background`],p:[`padding`],px:[`padding-left`,`padding-right`],py:[`padding-top`,`padding-bottom`],pt:[`padding-top`],pr:[`padding-right`],pb:[`padding-bottom`],pl:[`padding-left`],m:[`margin`],mx:[`margin-left`,`margin-right`],my:[`margin-top`,`margin-bottom`],mt:[`margin-top`],mr:[`margin-right`],mb:[`margin-bottom`],ml:[`margin-left`],w:[`width`],h:[`height`],minW:[`min-width`],maxW:[`max-width`],minH:[`min-height`],maxH:[`max-height`],size:[`width`,`height`],text:[`font-size`],font:[`font-family`],weight:[`font-weight`],leading:[`line-height`],tracking:[`letter-spacing`],align:[`text-align`],items:[`align-items`],justify:[`justify-content`],z:[`z-index`],rounded:[`border-radius`],shadow:[`box-shadow`],select:[`user-select`]},Hn={row:{display:`flex`,"flex-direction":`row`},col:{display:`flex`,"flex-direction":`column`},center:{"align-items":`center`,"justify-content":`center`},truncate:{overflow:`hidden`,"text-overflow":`ellipsis`,"white-space":`nowrap`}},Un={background:`colors`,"background-color":`colors`,color:`colors`,"border-color":`colors`,"border-top-color":`colors`,"border-right-color":`colors`,"border-bottom-color":`colors`,"border-left-color":`colors`,"outline-color":`colors`,"caret-color":`colors`,"text-decoration-color":`colors`,"font-family":`fonts`,"box-shadow":`shadows`,"border-radius":`radii`},Wn=new Set([`z-index`,`opacity`,`font-weight`,`line-height`,`flex`,`flex-grow`,`flex-shrink`,`order`,`aspect-ratio`,`zoom`,`scale`,`column-count`,`orphans`,`widows`,`tab-size`,`animation-iteration-count`,`grid-column`,`grid-row`]),Gn=new Map;function Kn(e){let t=Gn.get(e);return t===void 0&&(t=e.replace(/[A-Z]/g,e=>`-`+e.toLowerCase()),Gn.set(e,t)),t}function qn(e){return e.charCodeAt(0)===64?e:`@media `+e}function Jn(e,t){return e!==void 0&&e.startsWith(`@media`)&&t.startsWith(`@media`)?e+` and`+t.slice(6):t}function Yn(e){let t={className:e};return Object.defineProperty(t,"toString",{value:()=>e,enumerable:!1}),t}function Xn(e,t){for(let n of e)if(n)if(typeof n==`string`)for(let e of n.split(` `))e&&t.set(In(e)??e,e);else if(Array.isArray(n))Xn(n,t);else for(let e of n.className.split(` `))e&&t.set(In(e)??e,e)}function $(...e){let t=new Map;Xn(e,t);let n=``;for(let e of t.values())n+=(n?` `:``)+e;return Yn(n)}function Zn(e={}){let t=e.screens??{};kn(Object.values(t).map(qn));let n=new WeakMap;function r(t,n){if(typeof n==`number`)return n===0||Wn.has(t)?String(n):n+`px`;let r=Un[t];if(r!==void 0){let t=e[r]?.[n];if(t!==void 0)return t}return n}function i(e,n,a,o){for(let s in e){let c=e[s];if(c==null||c===!1)continue;if(typeof c==`object`){if(s===`raw`){let e=c;for(let t in e)o.push(Fn(n,a,t,r(t,e[t])));continue}let e=Bn[s];if(e!==void 0){i(c,n,a+e,o);continue}let l=t[s];if(l!==void 0){i(c,Jn(n,qn(l)),a,o);continue}let u=s.charCodeAt(0);if(u===38){i(c,n,a+s.slice(1),o);continue}if(u===64){i(c,Jn(n,s),a,o);continue}continue}if(c===!0){let e=Hn[s];if(e)for(let t in e)o.push(Fn(n,a,t,e[t]));continue}let l=Vn[s];if(l!==void 0)for(let e of l)o.push(Fn(n,a,e,r(e,c)));else{let e=Kn(s);o.push(Fn(n,a,e,r(e,c)))}}}function a(e){let t=n.get(e);if(t)return t;let r=[];i(e,void 0,``,r);let a=Yn(r.join(` `));return n.set(e,a),a}function o(e){let t=``,n=(e,n)=>{t+=(t?`;`:``)+e+`:`+n};for(let t in e){let i=e[t];if(i==null||i===!1)continue;if(t===`raw`&&typeof i==`object`){let e=i;for(let t in e)n(t,r(t,e[t]));continue}if(typeof i==`object`)continue;if(i===!0){let e=Hn[t];if(e)for(let t in e)n(t,e[t]);continue}let a=Vn[t];if(a!==void 0)for(let e of a)n(e,r(e,i));else{let e=Kn(t);n(e,r(e,i))}}return t}function s(e){let t=``;for(let n in e)t+=n+`{`+o(e[n])+`}`;let n=`nk`+Pn(t);return Ln(n,`@keyframes `+n+`{`+t+`}`),n}function c(e,t){let n=e+`{`+o(t)+`}`;Ln(`g|`+n,n)}function l(e){let t=e=>e===!0?`true`:e===!1?`false`:String(e),n=e.variants??{},r=Object.keys(n),i=e.defaultVariants??{},o=e.base?a(e.base):null,s={};for(let e of r){let t=n[e],r={};for(let e in t)r[e]=a(t[e]);s[e]=r}let c=(e.compoundVariants??[]).map(e=>{let{css:n,...r}=e,i={};for(let e in r)i[e]=t(r[e]);return{conditions:i,result:a(n)}}),l=new Map;return function(e){let n={};for(let a of r){let r=(e?e[a]:void 0)??i[a];r!=null&&(n[a]=t(r))}let a=``;for(let e of r)a+=e+`=`+(n[e]??``)+`;`;let u=l.get(a);if(u)return u;let d=[];o&&d.push(o);for(let e of r){let t=n[e];if(t!==void 0){let n=s[e][t];n&&d.push(n)}}for(let e of c){let t=!0;for(let r in e.conditions)if(n[r]!==e.conditions[r]){t=!1;break}t&&d.push(e.result)}let f=$(...d);return l.set(a,f),f}}return{css:a,cx:$,variants:l,keyframes:s,globalStyle:c,theme:e}}const Qn=Zn({}),$n=Qn.css,er=Qn.variants,tr=Qn.keyframes,nr=Qn.globalStyle;function rr(){yt();let e=globalThis;e.list=Ut,e.update=gn,e.when=on,e.on=p,e.scope=mn,e.render=vn,e.hydrate=yn,e.createCss=Zn,e.css=$n,e.cx=$,e.variants=er,e.keyframes=tr,e.globalStyle=nr}rr();export{mt as HTML_TAGS,gt as SELF_CLOSING_TAGS,ht as SVG_TAGS,me as appendChildren,F as applyAttributes,U as applyNodeModifier,j as createComment,ue as createConditionalComment,Zn as createCss,ct as createHtmlElementWithModifiers,ft as createHtmlTagBuilder,lt as createSvgElementWithModifiers,pt as createSvgTagBuilder,$n as css,$ as cx,Rn as getCssText,nr as globalStyle,yn as hydrate,rr as initializeRuntime,i as isBoolean,c as isBrowser,a as isFunction,t as isNode,n as isObject,e as isPrimitive,r as isTagLike,o as isZeroArityFunction,tr as keyframes,Ut as list,p as on,yt as registerGlobalTagBuilders,vn as render,he as replaceNodeSafely,zn as resetStyles,mn as scope,xn as setSSRCollector,gn as update,er as variants,on as when};
1
+ function e(e){return e===null||typeof e!=`object`&&typeof e!=`function`}function t(e){return e instanceof Node?!0:typeof e!=`object`||!e?!1:typeof e.nodeType==`number`}function n(e){return typeof e==`object`&&!!e}function r(e){return n(e)&&`tagName`in e}function i(e){return typeof e==`boolean`}function a(e){return typeof e==`function`}function o(e){return a(e)&&e.length===0}function s(e,t){typeof console<`u`&&console.error(`nuclo: ${e}`,t)}const c=typeof window<`u`&&typeof document<`u`,l=new WeakMap;function u(e,t){let n=l.get(e);n?n.push(t):l.set(e,[t])}function d(e,t){e.removeEventListener(t.type,t.wrapped,t.options)}function f(e,t){let n=l.get(e);if(!n)return;if(t===void 0){for(let t=0;t<n.length;t++)d(e,n[t]);l.delete(e);return}let r=0;for(let i=0;i<n.length;i++){let a=n[i];a.type===t?d(e,a):n[r++]=a}n.length=r,r===0&&l.delete(e)}function p(e,t,n){return function(r){if(!c||!r||typeof r.addEventListener!=`function`)return;let i=r,a=function(n){try{t.call(i,n)}catch(t){s(`Error in '${e}' listener`,t)}};i.addEventListener(e,a,n),u(i,{type:e,wrapped:a,options:n})}}const m=new Set,h=new WeakMap,g=new Set,_=new WeakMap;function v(e,t){let n=h.get(e);if(n){n.info.resolver=t.resolver,n.info.lastValue=t.lastValue,n.info.sanitize=t.sanitize;return}let r=new WeakRef(e);m.add(r),h.set(e,{ref:r,info:t})}function y(e,t){let n=new WeakRef(e);g.add(n),_.set(e,{ref:n,info:t})}function b(e){m.delete(e)}function ee(e){g.delete(e)}function x(e){let t=h.get(e);t&&(m.delete(t.ref),h.delete(e))}function S(e){let t=_.get(e);t&&(g.delete(t.ref),_.delete(e))}const C=new WeakMap,w=new Set,T=new WeakMap,E=typeof FinalizationRegistry<`u`?new FinalizationRegistry(e=>{w.delete(e)}):null;function D(e,t){C.set(e,t);let n=new WeakRef(e);w.add(n),T.set(e,n),E?.register(e,n)}function O(e){C.delete(e);let t=T.get(e);t&&(w.delete(t),T.delete(e))}function te(){let e=[],t=[];for(let n of w){let r=n.deref();r===void 0?t.push(n):e.push(r)}for(let e of t)w.delete(e);return e}function ne(e){return C.get(e)??null}const re=`http://www.w3.org/2000/svg`;function ie(e){return globalThis.document?document.createElement(e):null}function ae(e,t){return globalThis.document?document.createElementNS(e,t):null}function k(e){return globalThis.document?document.createTextNode(e):null}function oe(){return globalThis.document?document.createDocumentFragment():null}function se(e,t){try{return e.appendChild(t),!0}catch(e){return s(`Failed to append child node`,e),!1}}function ce(e){if(e.nodeType===Node.ELEMENT_NODE){let t=e;f(t),S(t),O(t)}else e.nodeType===Node.TEXT_NODE?x(e):e.nodeType===Node.COMMENT_NODE&&O(e);if(e.childNodes&&e.childNodes.length>0)for(let t=0;t<e.childNodes.length;t++)ce(e.childNodes[t])}function A(e){if(!e?.parentNode)return!1;try{return ce(e),e.parentNode.removeChild(e),!0}catch(e){return s(`Failed to remove child node`,e),!1}}function le(e,t,n){try{return e.insertBefore(t,n),!0}catch(e){return s(`Failed to insert node before reference`,e),!1}}function j(e){return globalThis.document?globalThis.document.createComment(e):null}function ue(e,t=`hidden`){return globalThis.document?globalThis.document.createComment(`conditional-${e}-${t}`):null}function de(e,t){let n=j(`${e}-end`);if(!n)throw Error(`Failed to create comment: document not available`);let r=j(`${e}-start-${t}`);if(!r)throw Error(`Failed to create comment: document not available`);return{start:r,end:n}}function fe(e,t){let n=e.nextSibling;for(;n&&n!==t;){let e=n.nextSibling;A(n),n=e}}function pe(e,t){let n=t.parentNode;if(n)for(let r=0;r<e.length;r++)le(n,e[r],t)}function me(e,...t){if(!e)return e;for(let n=0;n<t.length;n++){let r=t[n];if(r!=null){let t;if(typeof r==`string`){let e=k(r);if(e)t=e;else continue}else t=r;se(e,t)}}return e}function M(e){return e?.isConnected===!0}function he(e,t){if(!e?.parentNode)return!1;try{return e.parentNode.replaceChild(t,e),!0}catch(e){return s(`Error replacing conditional node`,e),!1}}function ge(e){return e}function _e(e,t,n){let r=ge(e),i=r.appendChild.bind(r),a=r.insertBefore.bind(r);r.appendChild=function(e){return a(e,t)};try{return n()}finally{r.appendChild=i}}function ve(e,t,n){try{if(n==null||n===``)return e.style[t]=``,!0;let r=String(n);return e.style[t]=r,!0}catch{return!1}}const ye={};let be=!1;function xe(e){let t=e.target;if(!t||typeof Node>`u`||!(t instanceof Node))return;let n=t;for(;n;){if(n instanceof Element){let e=_.get(n);e&&(M(n)?Ee(e.info):(ee(e.ref),_.delete(n)))}n=n.parentNode}}function Se(){be||typeof document>`u`||typeof document.addEventListener!=`function`||(document.addEventListener(`update`,xe,!0),be=!0)}function Ce(e){let t=_.get(e);if(t)return t.info;let n={attributeResolvers:[]};return y(e,n),n}function we(e){return typeof e!=`object`||!e}function Te(e){let t;try{t=e.resolver()}catch(t){s(`Failed to resolve reactive attribute: ${e.key}`,t);return}let n=we(t);if(!(n&&Object.is(t,e.lastValue)))try{e.applyValue(t),e.lastValue=n?t:ye}catch(t){s(`Failed to apply reactive attribute: ${e.key}`,t)}}function Ee(e){let t=e.attributeResolvers;for(let e=0;e<t.length;e++)Te(t[e])}function De(e,t,n,r){if(!(e instanceof Element)||!t||typeof n!=`function`){s(`Invalid parameters for registerAttributeResolver`);return}let i={key:t,resolver:n,applyValue:r,lastValue:ye};if(!c){Te(i);return}Se();let a=Ce(e).attributeResolvers,o=!1;for(let e=0;e<a.length;e++)if(a[e].key===t){a[e]=i,o=!0;break}o||a.push(i),Te(i)}function Oe(e){let t=[];for(let n of g){let r=n.deref();if(r===void 0){t.push(n);continue}let i=_.get(r);if(!i){t.push(n);continue}if(!M(r)){_.delete(r),t.push(n);continue}e&&!e.contains(r)||Ee(i.info)}for(let e of t)ee(e)}function ke(e,t){if(!(!e?.style||!t))for(let n in t)ve(e,n,t[n])||s(`Failed to set style property '${n}'`)}function Ae(e,t){e&&(a(t)?De(e,`style`,t,function(t){ke(e,t)}):ke(e,t))}const N=new WeakMap,je=new WeakSet;function Me(e,t){let n=t.length,r=0;for(let i=0;i<=n;i++)(i===n||t.charCodeAt(i)===32)&&(i>r&&e.add(t.substring(r,i)),r=i+1)}function Ne(e){let t=``;for(let n of e)t&&(t+=` `),t+=n;return t}function Pe(e){if(e.className&&!N.has(e)){let t=new Set;Me(t,e.className),N.set(e,t)}je.add(e)}function Fe(e){return je.has(e)}function Ie(e,t){if(!t)return;let n=N.get(e);n||(n=new Set,N.set(e,n)),Me(n,t)}function Le(e,t){let n=N.get(e);if(!n||n.size===0){let n=t||``;e.className!==n&&(e.className=n);return}if(!t){e.className=Ne(n);return}let r=Ne(n),i=t.length,a=0;for(let e=0;e<=i;e++)if(e===i||t.charCodeAt(e)===32){if(e>a){let i=t.substring(a,e);n.has(i)||(r+=` `+i)}a=e+1}e.className=r}function Re(e,t){if(!t)return;let n=e.className;if(n&&n!==t){let r=new Set;Me(r,n),Me(r,t),e.className=Ne(r)}else e.className=t}function ze(e,t,n){if(typeof e!=`function`){s(`Invalid resolver provided to createReactiveTextNode`);let e=k(``);if(!e)throw Error(`Failed to create text node: document not available`);return e}let r;if(arguments.length>1)r=t;else try{r=e()}catch(e){s(`Failed to evaluate reactive text resolver`,e),r=``}let i=r===void 0?``:String(r),a=k(i);if(!a)throw Error(`Failed to create text node: document not available`);return c&&v(a,{resolver:e,lastValue:i,sanitize:n}),a}function Be(e){let t=[];for(let n of m){let r=n.deref();if(r===void 0){t.push(n);continue}let i=h.get(r);if(!i){t.push(n);continue}let a=i.info;if(!M(r)){h.delete(r),t.push(n);continue}if(e&&!e.contains(r))continue;let o;try{o=a.resolver()}catch(e){s(`Failed to update reactive text node`,e),o=void 0}let c=a.sanitize?o==null||typeof o==`object`||typeof o==`function`?``:String(o):o===void 0?``:String(o);c!==a.lastValue&&(r.textContent=c,a.lastValue=c)}for(let e of t)b(e)}function Ve(e,t,n,r){if(n!=null){if(r&&t===`className`&&e instanceof HTMLElement){Re(e,String(n));return}if(e instanceof Element&&e.namespaceURI===`http://www.w3.org/2000/svg`)e.setAttribute(t,String(n));else if(t in e)try{e[t]=n}catch{e instanceof Element&&e.setAttribute(t,String(n))}else e instanceof Element&&e.setAttribute(t,String(n))}}function He(e,t,n,r=!1){if(n!=null){if(t===`style`){Ae(e,n);return}if(a(n)){let r=String(t);if(r.charCodeAt(0)===111&&r.charCodeAt(1)===110){e[r]=n;return}if(n.length===0){let t=n;r===`className`&&e instanceof HTMLElement?(Pe(e),De(e,r,t,function(t){Le(e,String(t||``))})):De(e,r,t,function(t){Ve(e,r,t,!1)});return}}if(t===`className`&&e instanceof HTMLElement&&Fe(e)){let t=String(n||``);t&&(Ie(e,t),Re(e,t));return}Ve(e,String(t),n,r)}}function Ue(e,t,n=!0){if(t)for(let r in t){let i=r,a=t[r];He(e,i,a,n&&i===`className`)}}let P=!1,We=new WeakMap;function F(){return P}function Ge(){return!1}function Ke(){P=!0,We=new WeakMap}function qe(){P=!1}function Je(e){let t=P;P=!1;try{return e()}finally{P=t}}function I(e){let t=We.get(e);return t===void 0?e.firstChild:t}function L(e,t){We.set(e,t)}function Ye(e){return e.nodeType===3&&!/\S/.test(e.textContent||``)}function R(e){let t=I(e),n=!1;for(;t&&Ye(t);)t=t.nextSibling,n=!0;n&&L(e,t)}function z(e){let t=I(e);return t&&L(e,t.nextSibling),t}function Xe(e,t){if(!P)return null;R(e);let n=I(e);return n&&n.nodeType===1&&n.tagName.toLowerCase()===t?z(e):null}function Ze(e,t){if(!t)return;let n=I(e);for(;n;){let r=n===t?null:n.nextSibling;e.removeChild(n),n=r}L(e,null)}const B=new WeakMap;function Qe(e){return n(e)&&!t(e)&&`className`in e&&typeof e.className==`string`&&Object.keys(e).length===1}function $e(e){R(e);let t=I(e);return!!t&&t.nodeType===8&&t.textContent?.trimStart().startsWith(`text-`)===!0}function et(e,t){let n=I(e);if(n&&n.nodeType===3)return z(e),n.textContent!==t&&(n.textContent=t),n;let r=k(t);return r?(e.insertBefore(r,n),L(e,n),r):null}function V(r,i,c){if(i==null)return null;if(a(i)){if(o(i))try{let t=B.get(i);if(t||(t={value:i(),error:!1},B.set(i,t)),t.error)return nt(c,()=>``);let n=t.value;if(Qe(n))return Ue(r,{className:()=>{let e=i();return Qe(e)?e.className:``}}),null;if(e(n)){let e=i,t=n??``;if(F()&&$e(r)){let n=r;z(n);let i=String(t),a=et(n,i);return a&&v(a,{resolver:e,lastValue:i,sanitize:!0}),null}return nt(c,e,t,!0)}return null}catch(e){return B.set(i,{value:void 0,error:!0}),s(`Error evaluating reactive text function:`,e),nt(c,()=>``)}let a=i(r,c);return a==null?null:e(a)?rt(c,a):t(a)?a:(n(a)&&Ue(r,a),null)}let l=i;if(e(l)){if(F()&&$e(r)){let e=r;return z(e),et(e,String(l)),null}return rt(c,l)}return t(l)?l:(Ue(r,l),null)}function tt(e,t){if(c&&!F()&&!Ge())return t;let n=oe();if(!n)throw Error(`Failed to create document fragment: document not available`);let r=j(` text-${e} `);return r&&n.appendChild(r),t&&n.appendChild(t),n}function nt(e,t,n,r){return tt(e,ze(t,n,r))}function rt(e,t){return tt(e,k(String(t)))}const it=Symbol(`nuclo.factory.tag`),at=Symbol(`nuclo.factory.mods`);let H=0;const ot=[];let st=0;function ct(){return st>=ot.length&&ot.push(()=>null),ot[st++]}function lt(e,t,n){e[it]=t,e[at]=n}function U(e){return typeof e==`function`?e[at]:void 0}function W(e){return typeof e==`function`?e[it]:void 0}function ut(){return H>0}function dt(e,t,n){let r=H===0;H++,r&&(st=0);try{return e(t,n)}finally{H--}}function G(e,t,n=0){if(!t||t.length===0)return;let r=n,i=e;for(let n=0;n<t.length;n+=1){let a=t[n];if(a==null)continue;let o=V(e,a,r);o&&(o.parentNode!==i&&i.appendChild(o),r+=1)}}function ft(e,t){let n=ie(e);if(!n)throw Error(`Failed to create element: ${e}`);return G(n,t,0),n}function pt(e,t){let n=ae(re,e);if(!n)throw Error(`Failed to create SVG element: ${e}`);return G(n,t,0),n}function mt(e,t){if(ut()){let n=ct();return lt(n,e,t),n}let n=function(n,r=0){let i=n,a=i?Xe(i,e):null,o=a??ie(e);if(!o)throw Error(`Failed to create element: ${e}`);let s=o,c=a?s.lastChild:null;return G(o,t,r),a&&Ze(s,c),o};return lt(n,e,t),n}function ht(e,t){if(ut()){let n=ct();return lt(n,e,t),n}return function(n,r=0){let i=n,a=i?Xe(i,e):null,o=a??ae(`http://www.w3.org/2000/svg`,e);if(!o)throw Error(`Failed to create SVG element: ${e}`);let s=o,c=a?s.lastChild:null;return G(o,t,r),a&&Ze(s,c),o}}function gt(e){return(...t)=>mt(e,t)}function _t(e){return(...t)=>ht(e,t)}const vt=`a.abbr.address.area.article.aside.audio.b.base.bdi.bdo.blockquote.body.br.button.canvas.caption.cite.code.col.colgroup.data.datalist.dd.del.details.dfn.dialog.div.dl.dt.em.embed.fieldset.figcaption.figure.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.iframe.img.input.ins.kbd.label.legend.li.link.main.map.mark.menu.meta.meter.nav.noscript.object.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.script.search.section.select.slot.small.source.span.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.title.tr.track.u.ul.var.video.wbr`.split(`.`),yt=`a.animate.animateMotion.animateTransform.circle.clipPath.defs.desc.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.image.line.linearGradient.marker.mask.metadata.mpath.path.pattern.polygon.polyline.radialGradient.rect.script.set.stop.style.svg.switch.symbol.text.textPath.title.tspan.use.view`.split(`.`),bt=[`area`,`base`,`br`,`col`,`embed`,`hr`,`img`,`input`,`link`,`meta`,`source`,`track`,`wbr`];function xt(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!0,get(){let r=n();return Object.defineProperty(e,t,{value:r,configurable:!0,enumerable:!0,writable:!0}),r},set(n){Object.defineProperty(e,t,{value:n,configurable:!0,enumerable:!0,writable:!0})}})}function St(e,t){t in e&&typeof e[t]!=`function`||(xt(e,t,()=>gt(t)),t===`var`&&xt(e,`var_`,()=>gt(t)))}function Ct(e,t){let n=`${t}Svg`;n in e||xt(e,n,()=>_t(t))}function wt(e=globalThis){let t=`__nuclo_tags_registered`;if(!e[t]){for(let t=0;t<yt.length;t++)Ct(e,yt[t]);for(let t=0;t<vt.length;t++)St(e,vt[t]);e[t]=!0}}function K(e,t,n){if(a(e)){let i=e(t,n);return i&&r(i)?i:null}return e&&r(e)?e:null}function Tt(e){return e.charCodeAt(0)===111&&e.charCodeAt(1)===110}function Et(e,n){let r=[],i=0;for(let e=0;e<n.length;e++){let a=n[e];if(a==null){r.push({kind:4});continue}let o=typeof a;if(o===`function`){let e=U(a);if(e!==void 0){let t=W(a);if(!t)return null;let n=Et(t,e);if(!n)return null;r.push({kind:3,child:n});continue}if(a.length===0){let e;try{e=a(),B.set(a,{value:e,error:!1})}catch{return null}if(e==null||typeof e!=`object`&&typeof e!=`function`){r.push({kind:2});continue}return null}return null}if(o===`object`){if(t(a))return null;let e=a,n=Object.keys(e),o=[];for(let t=0;t<n.length;t++){let r=n[t],a=e[r];if(a==null){o.push({key:r,kind:3,prop:!1});continue}if(r===`style`)return null;let s=typeof a;if(s===`function`){if(Tt(r)){o.push({key:r,kind:1,prop:!1});continue}if(r===`className`&&a.length===0){if(i++)return null;o.push({key:r,kind:2,prop:!1});continue}return null}if(s===`object`||r===`className`&&i++)return null;o.push({key:r,kind:0,prop:!1,value:a})}r.push({kind:0,keys:o});continue}r.push({kind:1})}return{tag:e,slots:r}}function Dt(e,t){let n=e.slots,r=t.firstChild;for(let e=0;e<n.length;e++){let i=n[e];switch(i.kind){case 0:{let e=i.keys;for(let n=0;n<e.length;n++){let r=e[n];r.kind===0?r.prop=r.key in t:r.kind===2&&(t.className=``)}break}case 1:case 2:r&&=r.nextSibling;break;case 3:if(!r)return;Dt(i.child,r),r=r.nextSibling;break}}}function Ot(e,t,n,r){let i=e.slots;if(t.length!==i.length)return!1;let a=n.firstChild;for(let e=0;e<i.length;e++){let o=i[e],s=t[e];switch(o.kind){case 0:{if(typeof s!=`object`||!s)return!1;let e=s,t=o.keys,i=0;for(let t in e)i++;if(i!==t.length)return!1;for(let i=0;i<t.length;i++){let a=t[i],o=e[a.key];switch(a.kind){case 0:if(o==null||typeof o==`object`||typeof o==`function`)return!1;if(o===a.value)break;if(a.prop){let e=n;e[a.key]!==o&&(e[a.key]=o)}else{let e=String(o);n.getAttribute(a.key)!==e&&n.setAttribute(a.key,e)}break;case 1:if(typeof o!=`function`)return!1;n[a.key]=o;break;case 2:{if(typeof o!=`function`||o.length!==0)return!1;let e=o,t;try{t=e()}catch{return!1}let i=t?String(t):``;i&&(n.className=i),r.push({kind:1,node:n,fn:e,last:i});break}case 3:if(o!=null)return!1;break}}break}case 1:if(s==null||typeof s==`object`||typeof s==`function`||!a)return!1;a.nodeValue=String(s),a=a.nextSibling;break;case 2:{if(typeof s!=`function`||s.length!==0||U(s)!==void 0||!a)return!1;let e;try{e=s()}catch{return!1}if(e!=null&&(typeof e==`object`||typeof e==`function`))return!1;let t=e==null?``:String(e),n=a;n.nodeValue=t,r.push({kind:0,node:n,fn:s,last:t}),a=n.nextSibling;break}case 3:{let e=U(s);if(e===void 0||W(s)!==o.child.tag||!a||!Ot(o.child,e,a,r))return!1;a=a.nextSibling;break}case 4:if(s!=null)return!1;break}}return!0}function kt(e,t,n,r){let i=e.slots;if(t.length!==i.length)return!1;let a=n.firstChild;for(let e=0;e<i.length;e++){let o=i[e],s=t[e];switch(o.kind){case 0:{if(typeof s!=`object`||!s)return!1;let e=s,t=o.keys,i=0;for(let a in e){if(i>=t.length)return!1;let o=t[i];if(o.key!==a)return!1;i++;let s=e[a];if(o.kind===2){if(typeof s!=`function`||s.length!==0)return!1;S(n),r.push({kind:1,node:n,fn:s,last:n.className})}}if(i!==t.length)return!1;break}case 1:if(!a)return!1;a=a.nextSibling;break;case 2:{if(typeof s!=`function`||s.length!==0||!a||a.nodeType!==3)return!1;let e=a;x(e),r.push({kind:0,node:e,fn:s,last:e.nodeValue??``}),a=e.nextSibling;break}case 3:{let e=U(s);if(e===void 0||W(s)!==o.child.tag||!a||!kt(o.child,e,a,r))return!1;a=a.nextSibling;break}case 4:if(s!=null)return!1;break}}return!0}function At(e){for(let t=0;t<e.length;t++){let n=e[t],r;try{r=n.fn()}catch{continue}if(n.kind===0){let e=r==null||typeof r==`object`||typeof r==`function`?``:String(r);e!==n.last&&(n.node.nodeValue=e,n.last=e)}else{let e=r?String(r):``;e!==n.last&&(n.node.className=e,n.last=e)}}}function jt(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}const Mt=new Set,Nt=new WeakMap,Pt=typeof FinalizationRegistry<`u`?new FinalizationRegistry(e=>{Mt.delete(e)}):null;let q=0;function Ft(e,t){let n=new WeakRef(e);Mt.add(n),Nt.set(e,t),Pt?.register(e,n)}function It(e){return Array.isArray(e)?e:Array.from(e)}function Lt(e){if(typeof e!=`object`||!e)return!1;let t=e.element;return!!t&&typeof Node<`u`&&t instanceof Node}function Rt(e,t,n){let r=e.renderItem(t,n);return Lt(r)?(e.lastRenderRefresh=typeof r.update==`function`?r.update:null,r.element):K(r,e.host,n)}function zt(e,t,n){e.lastRenderLeaves=null,e.lastRenderRefresh=null;let r=e.template,i=c&&!F()&&!Ge(),a=r&&i?dt(e.renderItem,t,n):e.renderItem(t,n);if(Lt(a))return e.lastRenderRefresh=typeof a.update==`function`?a.update:null,a.element;if(r!==null&&i){let i=U(a);if(i!==void 0){if(r===void 0){let t=W(a),r=t?Et(t,i):null,o=K(a,e.host,n);if(r&&o){let t=o.cloneNode(!0);Dt(r,t);let n=[];if(kt(r,i,o,n))n.length>0&&(e.lastRenderLeaves=n);else return e.template=null,e.lastRenderLeaves=null,o;e.template={tmpl:r,skeleton:t}}else e.template=null;return o}let o=r.skeleton.cloneNode(!0),s=[];return Ot(r.tmpl,i,o,s)?(s.length>0&&(e.lastRenderLeaves=s),o):(e.template=null,Rt(e,t,n))}else if(r===void 0)e.template=null;else return e.template=null,Rt(e,t,n)}return K(a,e.host,n)}function J(e){A(e.element)}function Bt(e,t,n,r){if(n.parentNode!==t||r.parentNode!==t)return!1;if(c&&t.firstChild===n&&t.lastChild===r)return t.textContent=``,t.appendChild(n),t.appendChild(r),!0;for(let n=0;n<e.length;n++){let r=e[n].element;r&&r.parentNode===t&&t.removeChild(r)}return!0}function Vt(e){let t=e.length;if(t===0)return[];let n=Array(t),r=[];for(let i=0;i<t;i++){let t=e[i],a=0,o=r.length;for(;a<o;){let n=a+o>>1;e[r[n]]<t?a=n+1:o=n}n[i]=a>0?r[a-1]:-1,a===r.length?r.push(i):r[a]=i}let i=r.length,a=r[i-1],o=Array(i);for(;i>0;)o[--i]=a,a=n[a];return o}function Ht(e,t,n,r,i,a,o){let s=oe(),c=0;for(let l=r;l<i;l++){let r=n[l],i=zt(e,r,l);if(!i)continue;let u=e.lastRenderLeaves;o.push({item:r,element:i,dyn:u,refresh:e.lastRenderRefresh,dynCreatedAt:u?e.currentFlushEpoch:void 0});let d=i;s?(s.appendChild(d),c++):t.insertBefore(d,a)}s&&c>0&&t.insertBefore(s,a)}function Ut(e){let{startMarker:t,endMarker:n}=e,r=t.parentNode??e.host,i=It(e.itemsProvider());if(jt(e.lastSyncedItems,i))return;let a=e.records,o=a.length,s=i.length;if(s===0){if(o>0&&!Bt(a,r,t,n))for(let e=0;e<o;e++)J(a[e]);e.records=[],e.lastSyncedItems=[],e.allRecordsCreatedAt=void 0;return}let c=0,l=Math.min(o,s);for(;c<l&&a[c].item===i[c];)c++;let u=0,d=l-c;for(;u<d&&a[o-1-u].item===i[s-1-u];)u++;let f=c,p=o-u,m=c,h=s-u;if(f===p){let t=p<o?a[p].element:n;if(p===o)Ht(e,r,i,m,h,t,a),e.allRecordsCreatedAt=o===0?e.currentFlushEpoch:void 0;else{let n=[];Ht(e,r,i,m,h,t,n),e.records=a.slice(0,f).concat(n,a.slice(f)),e.allRecordsCreatedAt=void 0}e.lastSyncedItems=i.slice();return}if(m===h){for(let e=f;e<p;e++)J(a[e]);a.splice(f,p-f),e.allRecordsCreatedAt=void 0,e.lastSyncedItems=i.slice();return}let g=p-f,_=h-m,v=Array(_).fill(-1),y=new Uint8Array(g),b=0,ee=Math.min(p,h);for(let e=c;e<ee;e++)a[e].item===i[e]&&(v[e-m]=e,y[e-f]=1,b++);let x=new Map;for(let e=f;e<p;e++){if(y[e-f])continue;let t=a[e].item,n=x.get(t);n===void 0?x.set(t,e):typeof n==`number`?x.set(t,[n,e]):n.push(e)}for(let e=0;e<_;e++){if(v[e]!==-1)continue;let t=x.get(i[m+e]);if(t===void 0)continue;let n;typeof t==`number`?(n=t,x.delete(i[m+e])):(n=t.shift(),t.length===0&&x.delete(i[m+e])),v[e]=n,y[n-f]=1,b++}if(b===0&&f===0&&p===o){if(!Bt(a,r,t,n))for(let e=0;e<o;e++)J(a[e]);let c=[];Ht(e,r,i,0,s,n,c),e.records=c,e.allRecordsCreatedAt=e.currentFlushEpoch,e.lastSyncedItems=i.slice();return}for(let e=f;e<p;e++)y[e-f]||J(a[e]);let S=null;if(b>0){let e=[],t=[];for(let n=0;n<_;n++)v[n]!==-1&&(e.push(v[n]),t.push(n));S=new Uint8Array(_);let n=Vt(e);for(let e=0;e<n.length;e++)S[t[n[e]]]=1}let C=Array(_),w=0,T=p<o?a[p].element:n,E=null;for(let t=_-1;t>=0;t--){let n=v[t];if(n===-1){let n=i[m+t],a=zt(e,n,m+t);if(!a){C[t]=null,w++;continue}let o=e.lastRenderLeaves;C[t]={item:n,element:a,dyn:o,refresh:e.lastRenderRefresh,dynCreatedAt:o?e.currentFlushEpoch:void 0};let s=a;E||=oe(),E?E.insertBefore(s,E.firstChild):(r.insertBefore(s,T),T=s);continue}let o=a[n];C[t]=o;let s=o.element;if(E&&E.firstChild){let e=E.firstChild;r.insertBefore(E,T),T=e,E=null}(!S||!S[t])&&r.insertBefore(s,T),T=s}E&&E.firstChild&&r.insertBefore(E,T);let D=Array(f+(_-w)+(o-p)),O=0;for(let e=0;e<f;e++)D[O++]=a[e];for(let e=0;e<_;e++){let t=C[e];t&&(D[O++]=t)}for(let e=p;e<o;e++)D[O++]=a[e];e.records=D,e.allRecordsCreatedAt=void 0,e.lastSyncedItems=i.slice()}function Wt(e,t,n,r){return F()?Kt(e,t,n,r):Gt(e,t,n,r)}function Gt(e,t,n,r){let{start:i,end:a}=de(`list`,r),o={itemsProvider:e,renderItem:t,startMarker:i,endMarker:a,records:[],host:n,lastSyncedItems:[]},s=n;return s.appendChild(i),s.appendChild(a),Ut(o),c&&Ft(i,o),o}function Kt(e,t,n,r){let i=n;R(i);let a=I(i);if(!a||a.nodeType!==8||!a.textContent?.startsWith(`list-start-`))return Gt(e,t,n,r);let o=z(i),s=0,l=I(i);for(;l;){if(l.nodeType===8){let e=l.textContent||``;if(e.startsWith(`list-start-`))s++;else if(e===`list-end`){if(s===0)break;s--}}l=l.nextSibling}let u=l;if(!u){let e=j(`list-end`);e&&(i.insertBefore(e,o.nextSibling),u=e)}if(!u)return Gt(e,t,n,r);let d=It(e()),f=[];for(let e=0;e<d.length;e++){let r=t(d[e],e),i=Lt(r)?r:null,a=i?i.element:K(r,n,e);a&&f.push({item:d[e],element:a,refresh:i&&typeof i.update==`function`?i.update:void 0})}let p=I(i);for(;p&&p!==u;){let e=p.nextSibling;A(p),p=e}let m=u;for(let e=f.length-1;e>=0;e--){let t=f[e].element;(t.parentNode!==i||t.nextSibling!==m)&&i.insertBefore(t,m),m=t}L(i,u.nextSibling);let h={itemsProvider:e,renderItem:t,startMarker:o,endMarker:u,records:f,host:n,lastSyncedItems:d.slice()};return c&&Ft(o,h),h}function qt(e){for(let t=0;t<e.records.length;t++){let n=e.records[t];n.element=null,n.item=null,n.dyn=null,n.refresh=null,delete n.dynCreatedAt}e.records=[],e.lastSyncedItems=[],e.allRecordsCreatedAt=void 0}function Jt(e){let t=[];q++;for(let n of Mt){let r=n.deref();if(!r){t.push(n);continue}let i=Nt.get(r);if(!i){t.push(n);continue}if(!M(r)||!M(i.endMarker)){qt(i),Nt.delete(r),t.push(n);continue}if(e&&!e.contains(r))continue;i.currentFlushEpoch=q;try{Ut(i)}finally{i.currentFlushEpoch=void 0}if(i.allRecordsCreatedAt===q)continue;let a=i.records;for(let e=0;e<a.length;e++){if(a[e].dynCreatedAt===q)continue;let t=a[e].refresh;t&&t();let n=a[e].dyn;n&&At(n)}}for(let e of t)Mt.delete(e)}function Yt(e,t){return function(n,r){return Wt(e,t,n,r).startMarker}}function Xt(e,t){try{return e()}catch(e){if(t)return t(e),!1;throw e}}function Zt(e,t){return typeof e==`function`?Xt(e,t):!!e}const Qt=new Set,$t=new WeakMap,en=typeof FinalizationRegistry<`u`?new FinalizationRegistry(e=>{Qt.delete(e)}):null;function tn(e,t){for(let t=0;t<e.length;t++)if(Zt(e[t].condition))return t;return t.length>0?-1:null}function nn(e){let{groups:t,elseContent:n,host:r,index:i,endMarker:a}=e,o=tn(t,n);o!==e.activeIndex&&(fe(e.startMarker,e.endMarker),e.activeIndex=o,o!==null&&pe(sn(o>=0?t[o].content:n,r,i,a),a))}function rn(e){let t=new WeakRef(e.startMarker);Qt.add(t),$t.set(e.startMarker,e),en?.register(e.startMarker,t)}function an(e){let t=[];for(let n of Qt){let r=n.deref();if(r===void 0){t.push(n);continue}let i=$t.get(r);if(!i){t.push(n);continue}if(!M(r)||!M(i.endMarker)){$t.delete(r),t.push(n);continue}if(!(e&&!e.contains(r)))try{i.update()}catch(e){s(`when() branch threw during update; unregistering this conditional`,e),$t.delete(r),t.push(n)}}for(let e of t)Qt.delete(e)}function on(e,t,n,r){return a(e)?o(e)?(B.delete(e),V(t,e,n)):_e(t,r,()=>{let r=V(t,e,n);return r&&!r.parentNode?r:null}):V(t,e,n)}function sn(e,t,n,r){let i=[];for(let a of e){let e=on(a,t,n,r);e&&i.push(e)}return i}function cn(e,t){return`when-start-${e}-b${t===null?`n`:t}`}function ln(e){let t=/-b(n|-?\d+)$/.exec(e||``);if(t)return t[1]===`n`?null:parseInt(t[1],10)}var un=class e{groups=[];elseContent=[];constructor(e,...t){this.groups.push({condition:e,content:t})}cloneWith(t,n){let r=Object.create(e.prototype);return r.groups=[...this.groups],t&&r.groups.push(t),r.elseContent=n??[...this.elseContent],r}when(e,...t){return this.groups.push({condition:e,content:t}),this}else(...e){return this.elseContent=e,this}render(e,t){return globalThis.document?F()?this.hydrateRender(e,t):this.freshRender(e,t):null}freshRender(e,t){let{start:n,end:r}=de(`when`,t),i=this.createRuntimeFromMarkers(e,t,n,r),a=ge(e);return a.appendChild(n),a.appendChild(r),nn(i),n.textContent=cn(t,i.activeIndex),n}hydrateRender(e,t){let n=e;R(n);let r=I(n);if(!r||r.nodeType!==8||!r.textContent?.startsWith(`when-start-`))return this.freshRender(e,t);let i=z(n),a=0,o=I(n);for(;o;){if(o.nodeType===8){let e=o.textContent||``;if(e.startsWith(`when-start-`))a++;else if(e===`when-end`){if(a===0)break;a--}}o=o.nextSibling}let s=o,c=!1;if(!s){let e=j(`when-end`);if(!e)return i;n.insertBefore(e,i.nextSibling),s=e,c=!0}let l=tn(this.groups,this.elseContent),u=ln(i.textContent);if(!c&&(u===void 0||u===l)){if(l!==null){let n=l>=0?this.groups[l].content:this.elseContent;for(let r of n)V(e,r,t)}}else if(fe(i,s),l!==null){let n=l>=0?this.groups[l].content:this.elseContent,r=s;Je(()=>{pe(sn(n,e,t,r),r)})}return L(n,s.nextSibling),this.createRuntimeFromMarkers(e,t,i,s,l),i}createRuntimeFromMarkers(e,t,n,r,i=null){let a={startMarker:n,endMarker:r,host:e,index:t,groups:[...this.groups],elseContent:[...this.elseContent],activeIndex:i,update:function(){nn(a)}};return c&&rn(a),a}};function dn(e){return Object.assign(function(t,n){return e.render(t,n)},{when:function(t,...n){return dn(e.cloneWith({condition:t,content:n}))},else:function(...t){return dn(e.cloneWith(void 0,t))}})}function fn(e,...t){return dn(new un(e,...t))}function pn(e){try{return e.isSvg?pt(e.tagName,e.modifiers):ft(e.tagName,e.modifiers)}catch(t){if(s(`Error applying modifiers in conditional element "${e.tagName}"`,t),e.isSvg){let n=ae(re,e.tagName);if(!n)throw Error(`Failed to create SVG element: ${e.tagName}`,{cause:t});return n}let n=ie(e.tagName);if(!n)throw Error(`Failed to create element: ${e.tagName}`,{cause:t});return n}}function mn(e){let t=ne(e);if(!t)return;let n=Xt(t.condition,e=>{s(`Error evaluating conditional condition`,e)}),r=e.nodeType===Node.ELEMENT_NODE;if(n&&!r){let n=pn(t);D(n,t),he(e,n)}else if(!n&&r){let n=ue(t.tagName);n&&(D(n,t),he(e,n))}}function hn(e){if(c)try{let t=te();for(let n of t){if(!n.isConnected){O(n);continue}e&&!e.contains(n)||mn(n)}}catch(e){s(`Error during conditional elements update`,e)}}const gn=new Map;function _n(e){let t=[],n=new Set;for(let r of e){if(typeof r!=`string`)continue;let e=r.trim();e&&(n.has(e)||(n.add(e),t.push(e)))}return t}function vn(e,t){let n=gn.get(e);n||(n=new Set,gn.set(e,n)),n.add(new WeakRef(t))}function yn(e){let t=_n(e);if(t.length===0)return[];let n=new Set;for(let e of t){let t=gn.get(e);if(!t)continue;let r=[];for(let e of t){let t=e.deref();if(t===void 0){r.push(e);continue}if(!M(t)){r.push(e);continue}n.add(t)}for(let e of r)t.delete(e);t.size===0&&gn.delete(e)}return Array.from(n)}function bn(...e){let t=_n(e);return function(e){if(c&&e instanceof Element)for(let n of t)vn(n,e)}}const xn=[Jt,an,hn,Oe,Be,Cn];function Sn(...e){let t;if(e.length>0){let n=yn(e);if(n.length===1){let e=n[0];t={roots:n,contains:t=>e.contains(t)}}else t={roots:n,contains:e=>{for(let t of n)if(t.contains(e))return!0;return!1}}}for(let e of xn)e(t)}function Cn(e){if(typeof document>`u`)return;let t=e?e.roots:[document.body??document];for(let e of t)try{e.dispatchEvent(new Event(`update`,{bubbles:!0}))}catch(e){s(`Error dispatching global update event`,e)}}function wn(e,t,n=0){let r=t||document.body,i=e(r,n);return r.appendChild(i),i}function Tn(e,t){let n=t||document.body,r=n;Ke();try{let t=e(n,0),i=t;if(i&&i.nodeType===1&&i.parentNode!==r){let e=I(r);if(e){let t=e.nextSibling;r.insertBefore(i,e),A(e),L(r,t)}else r.appendChild(i),L(r,null)}return t}finally{qe()}}let En=null;function Dn(e){En=e}const On=new Map,kn=new Map,An=new Set,jn=[],Y=new Map;let X=null,Z=null,Mn=null,Q=0;const Nn=new Map;function Pn(e){for(let t of e)Y.has(t)||Y.set(t,[])}function Fn(e,t){try{let n=e.cssRules.length;e.insertRule(t+`{}`,n);let r=e.cssRules[n];return Nn.set(t,r),r}catch{return null}}function In(e,t){try{e.insertRule(t,Q),Q++}catch{}}function Ln(){if(typeof document>`u`||typeof document.getElementById!=`function`)return null;if(Z&&Mn===document&&Z.ownerNode&&Z.ownerNode.isConnected)return Z;let e=document.getElementById(`nuclo-styles`);if(e||(e=document.createElement(`style`),e.id=`nuclo-styles`,document.head.appendChild(e)),Z=e.sheet,Mn=document,Nn.clear(),Q=0,!Z)return null;for(let e of jn)In(Z,e);for(let[e,t]of Y){let n=Fn(Z,e);if(n)for(let e of t)try{n.insertRule(e,n.cssRules.length)}catch{}}return Z}function Rn(e,t){if(t===void 0)jn.push(e);else{let n=Y.get(t);n||(n=[],Y.set(t,n)),n.push(e)}X=null,En?.(t===void 0?e:t+`{`+e+`}`);let n=Ln();if(n)if(t===void 0)In(n,e);else{let r=Nn.get(t)??Fn(n,t);if(r)try{r.insertRule(e,r.cssRules.length)}catch{}}}function zn(e){let t=2166136261,n=2128831035;for(let r=0;r<e.length;r++){let i=e.charCodeAt(r);t=Math.imul(t^i,16777619),n=Math.imul(n^i,2246822507)}return(t>>>0).toString(36)+((n>>>9)%1296).toString(36)}function Bn(e,t,n,r){let i=(e??``)+`|`+t+`|`+n+`:`+r,a=On.get(i);return a===void 0?(a=`n`+zn(i),On.set(i,a),kn.set(a,(e??``)+`|`+t+`|`+n),Rn(`.`+a+t+`{`+n+`:`+r+`}`,e),a):(Ln(),a)}function Vn(e){return kn.get(e)}function Hn(e,t){if(An.has(e)){Ln();return}An.add(e),Rn(t,void 0)}function Un(){if(X!==null)return X;let e=jn.join(``);for(let[t,n]of Y)n.length>0&&(e+=t+`{`+n.join(``)+`}`);return X=e,e}function Wn(){On.clear(),kn.clear(),An.clear(),jn.length=0,Y.clear(),Nn.clear(),X=null,Q=0,Z=null,Mn=null,typeof document<`u`&&document.getElementById(`nuclo-styles`)?.remove()}const Gn={hover:`:hover`,focus:`:focus`,focusVisible:`:focus-visible`,focusWithin:`:focus-within`,active:`:active`,visited:`:visited`,disabled:`:disabled`,enabled:`:enabled`,checked:`:checked`,required:`:required`,invalid:`:invalid`,valid:`:valid`,readOnly:`:read-only`,first:`:first-child`,last:`:last-child`,only:`:only-child`,odd:`:nth-child(odd)`,even:`:nth-child(even)`,empty:`:empty`,placeholderShown:`:placeholder-shown`,placeholder:`::placeholder`,before:`::before`,after:`::after`,selection:`::selection`,marker:`::marker`,firstLine:`::first-line`,firstLetter:`::first-letter`},Kn={bg:[`background`],p:[`padding`],px:[`padding-left`,`padding-right`],py:[`padding-top`,`padding-bottom`],pt:[`padding-top`],pr:[`padding-right`],pb:[`padding-bottom`],pl:[`padding-left`],m:[`margin`],mx:[`margin-left`,`margin-right`],my:[`margin-top`,`margin-bottom`],mt:[`margin-top`],mr:[`margin-right`],mb:[`margin-bottom`],ml:[`margin-left`],w:[`width`],h:[`height`],minW:[`min-width`],maxW:[`max-width`],minH:[`min-height`],maxH:[`max-height`],size:[`width`,`height`],text:[`font-size`],font:[`font-family`],weight:[`font-weight`],leading:[`line-height`],tracking:[`letter-spacing`],align:[`text-align`],items:[`align-items`],justify:[`justify-content`],z:[`z-index`],rounded:[`border-radius`],shadow:[`box-shadow`],select:[`user-select`]},qn={row:{display:`flex`,"flex-direction":`row`},col:{display:`flex`,"flex-direction":`column`},center:{"align-items":`center`,"justify-content":`center`},truncate:{overflow:`hidden`,"text-overflow":`ellipsis`,"white-space":`nowrap`}},Jn={background:`colors`,"background-color":`colors`,color:`colors`,"border-color":`colors`,"border-top-color":`colors`,"border-right-color":`colors`,"border-bottom-color":`colors`,"border-left-color":`colors`,"outline-color":`colors`,"caret-color":`colors`,"text-decoration-color":`colors`,"font-family":`fonts`,"box-shadow":`shadows`,"border-radius":`radii`},Yn=new Set([`z-index`,`opacity`,`font-weight`,`line-height`,`flex`,`flex-grow`,`flex-shrink`,`order`,`aspect-ratio`,`zoom`,`scale`,`column-count`,`orphans`,`widows`,`tab-size`,`animation-iteration-count`,`grid-column`,`grid-row`]),Xn=new Map;function Zn(e){let t=Xn.get(e);return t===void 0&&(t=e.replace(/[A-Z]/g,e=>`-`+e.toLowerCase()),Xn.set(e,t)),t}function Qn(e){return e.charCodeAt(0)===64?e:`@media `+e}function $n(e,t){return e!==void 0&&e.startsWith(`@media`)&&t.startsWith(`@media`)?e+` and`+t.slice(6):t}function er(e){let t={className:e};return Object.defineProperty(t,"toString",{value:()=>e,enumerable:!1}),t}function tr(e,t){for(let n of e)if(n)if(typeof n==`string`)for(let e of n.split(` `))e&&t.set(Vn(e)??e,e);else if(Array.isArray(n))tr(n,t);else for(let e of n.className.split(` `))e&&t.set(Vn(e)??e,e)}function nr(...e){let t=new Map;tr(e,t);let n=``;for(let e of t.values())n+=(n?` `:``)+e;return er(n)}function rr(e={}){let t=e.screens??{};Pn(Object.values(t).map(Qn));let n=new WeakMap;function r(t,n){if(typeof n==`number`)return n===0||Yn.has(t)?String(n):n+`px`;let r=Jn[t];if(r!==void 0){let t=e[r]?.[n];if(t!==void 0)return t}return n}function i(e,n,a,o){for(let s in e){let c=e[s];if(c==null||c===!1)continue;if(typeof c==`object`){if(s===`raw`){let e=c;for(let t in e)o.push(Bn(n,a,t,r(t,e[t])));continue}let e=Gn[s];if(e!==void 0){i(c,n,a+e,o);continue}let l=t[s];if(l!==void 0){i(c,$n(n,Qn(l)),a,o);continue}let u=s.charCodeAt(0);if(u===38){i(c,n,a+s.slice(1),o);continue}if(u===64){i(c,$n(n,s),a,o);continue}continue}if(c===!0){let e=qn[s];if(e)for(let t in e)o.push(Bn(n,a,t,e[t]));continue}let l=Kn[s];if(l!==void 0)for(let e of l)o.push(Bn(n,a,e,r(e,c)));else{let e=Zn(s);o.push(Bn(n,a,e,r(e,c)))}}}function a(e){let t=n.get(e);if(t)return t;let r=[];i(e,void 0,``,r);let a=er(r.join(` `));return n.set(e,a),a}function o(e){let t=``,n=(e,n)=>{t+=(t?`;`:``)+e+`:`+n};for(let t in e){let i=e[t];if(i==null||i===!1)continue;if(t===`raw`&&typeof i==`object`){let e=i;for(let t in e)n(t,r(t,e[t]));continue}if(typeof i==`object`)continue;if(i===!0){let e=qn[t];if(e)for(let t in e)n(t,e[t]);continue}let a=Kn[t];if(a!==void 0)for(let e of a)n(e,r(e,i));else{let e=Zn(t);n(e,r(e,i))}}return t}function s(e){let t=``;for(let n in e)t+=n+`{`+o(e[n])+`}`;let n=`nk`+zn(t);return Hn(n,`@keyframes `+n+`{`+t+`}`),n}function c(e,t){let n=e+`{`+o(t)+`}`;Hn(`g|`+n,n)}function l(e){let t=e=>e===!0?`true`:e===!1?`false`:String(e),n=e.variants??{},r=Object.keys(n),i=e.defaultVariants??{},o=e.base?a(e.base):null,s={};for(let e of r){let t=n[e],r={};for(let e in t)r[e]=a(t[e]);s[e]=r}let c=(e.compoundVariants??[]).map(e=>{let{css:n,...r}=e,i={};for(let e in r)i[e]=t(r[e]);return{conditions:i,result:a(n)}}),l=new Map;return function(e){let n={};for(let a of r){let r=(e?e[a]:void 0)??i[a];r!=null&&(n[a]=t(r))}let a=``;for(let e of r)a+=e+`=`+(n[e]??``)+`;`;let u=l.get(a);if(u)return u;let d=[];o&&d.push(o);for(let e of r){let t=n[e];if(t!==void 0){let n=s[e][t];n&&d.push(n)}}for(let e of c){let t=!0;for(let r in e.conditions)if(n[r]!==e.conditions[r]){t=!1;break}t&&d.push(e.result)}let f=nr(...d);return l.set(a,f),f}}return{css:a,cx:nr,variants:l,keyframes:s,globalStyle:c,theme:e}}let ir;function $(){return ir??=rr({})}const ar=e=>$().css(e),or=e=>$().variants(e),sr=e=>$().keyframes(e),cr=(e,t)=>$().globalStyle(e,t);function lr(){wt();let e=globalThis;e.list=Yt,e.update=Sn,e.when=fn,e.on=p,e.scope=bn,e.render=wn,e.hydrate=Tn,e.createCss=rr,e.css=ar,e.cx=nr,e.variants=or,e.keyframes=sr,e.globalStyle=cr}lr();export{vt as HTML_TAGS,bt as SELF_CLOSING_TAGS,yt as SVG_TAGS,me as appendChildren,Ue as applyAttributes,V as applyNodeModifier,j as createComment,ue as createConditionalComment,rr as createCss,ft as createHtmlElementWithModifiers,gt as createHtmlTagBuilder,pt as createSvgElementWithModifiers,_t as createSvgTagBuilder,ar as css,nr as cx,Un as getCssText,cr as globalStyle,Tn as hydrate,lr as initializeRuntime,i as isBoolean,c as isBrowser,a as isFunction,t as isNode,n as isObject,e as isPrimitive,r as isTagLike,o as isZeroArityFunction,sr as keyframes,Yt as list,p as on,wt as registerGlobalTagBuilders,wn as render,he as replaceNodeSafely,Wn as resetStyles,bn as scope,Dn as setSSRCollector,Sn as update,or as variants,fn as when};
2
2
  //# sourceMappingURL=nuclo.mjs.map