nuclo 0.2.34 → 0.2.35
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/element/factory-meta.d.ts +2 -0
- package/dist/element/factory-meta.d.ts.map +1 -1
- package/dist/list/runtime.d.ts.map +1 -1
- package/dist/nuclo.cjs +1 -1
- package/dist/nuclo.cjs.map +1 -1
- package/dist/nuclo.mjs +1 -1
- package/dist/nuclo.mjs.map +1 -1
- package/dist/nuclo.umd.js +1 -1
- package/dist/nuclo.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/nuclo.umd.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports):typeof define==`function`&&define.amd?define([`exports`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.Nuclo={}))})(this,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e){return e===null||typeof e!=`object`&&typeof e!=`function`}function n(e){return e instanceof Node?!0:typeof e!=`object`||!e?!1:typeof e.nodeType==`number`}function r(e){return typeof e==`object`&&!!e}function i(e){return r(e)&&`tagName`in e}function a(e){return typeof e==`boolean`}function o(e){return typeof e==`function`}function s(e){return o(e)&&e.length===0}function c(e,t){typeof console<`u`&&console.error(`nuclo: ${e}`,t)}let l=typeof window<`u`&&typeof document<`u`,u=!1,d=/* @__PURE__ */ new WeakMap;function f(){return u}function p(){return!1}function m(){u=!0,d=/* @__PURE__ */ new WeakMap}function h(){u=!1}function ee(e){let t=u;u=!1;try{return e()}finally{u=t}}function g(e){let t=d.get(e);return t===void 0?e.firstChild:t}function _(e,t){d.set(e,t)}function v(e){return e.nodeType===3&&!/\S/.test(e.textContent||``)}function y(e){let t=g(e),n=!1;for(;t&&v(t);)t=t.nextSibling,n=!0;n&&_(e,t)}function b(e){let t=g(e);return t&&_(e,t.nextSibling),t}function x(e,t){if(!u)return null;y(e);let n=g(e);return n&&n.nodeType===1&&n.tagName.toLowerCase()===t?b(e):null}function S(e,t){if(!t)return;let n=g(e);for(;n;){let r=n===t?null:n.nextSibling;e.removeChild(n),n=r}_(e,null)}let C=/* @__PURE__ */ new WeakMap,w=0,T=[];function E(){return!l||p()}function D(e){let t=C.get(e);return t||(t={mount:null,destroy:null,state:0,queued:!1},C.set(e,t),w++),t}function O(e,t){return e===null?t:Array.isArray(e)?(e.push(t),e):[e,t]}function te(e,t){t.queued||t.state!==0||(t.queued=!0,T.push(new WeakRef(e)))}function ne(e,t){if(E())return;let n=D(e);n.state!==2&&(n.mount=O(n.mount,t),te(e,n))}function re(e,t){if(E())return;let n=D(e);n.state!==2&&(n.destroy=O(n.destroy,t),te(e,n))}function ie(e,t,n){if(n.state===1)try{let r=t(e);typeof r==`function`&&(C.get(e)?.state===2?ae(e,r):n.destroy=O(n.destroy,r))}catch(e){c(`Error in mount callback`,e)}}function ae(e,t){try{t(e)}catch(e){c(`Error in destroy callback`,e)}}function oe(e){let t=C.get(e);if(!t||(t.queued=!1,t.state!==0))return;t.state=1;let n=t.mount;if(t.mount=null,n!==null){if(Array.isArray(n))for(let r=0;r<n.length;r++)ie(e,n[r],t);else ie(e,n,t)}}function se(){if(T.length===0)return;let e=T;T=[];for(let t=0;t<e.length;t++){let n=e[t].deref();n&&oe(n)}}function ce(e){let t=C.get(e);if(!t||t.state===2)return;let n=t.state===1;if(t.state=2,w--,n){let n=t.destroy;if(n!==null){if(Array.isArray(n))for(let t=0;t<n.length;t++)ae(e,n[t]);else ae(e,n)}}t.mount=null,t.destroy=null}function le(){return w>0}let k=/* @__PURE__ */ new WeakMap;function ue(e,t){let n=k.get(e);n?Array.isArray(n)?n.includes(t)||n.push(t):n!==t&&k.set(e,[n,t]):k.set(e,t)}function A(e,t){e.removeEventListener(t.type,t.wrapped,t.capture)}function de(e,t){let n=k.get(e);if(!n)return;if(t===void 0){if(Array.isArray(n))for(let t=0;t<n.length;t++)A(e,n[t]);else A(e,n);k.delete(e);return}if(!Array.isArray(n)){n.type===t&&(A(e,n),k.delete(e));return}let r=0;for(let i=0;i<n.length;i++){let a=n[i];a.type===t?A(e,a):n[r++]=a}r===0?k.delete(e):r===1?k.set(e,n[0]):n.length=r}function fe(e){}function pe(e,t){return l?function(n){if(!n)return;let r=n;e===`mount`?ne(r,t):re(r,t)}:fe}function me(e,t,n){return{type:e,wrapped:function(n){let r=this;try{t.call(r,n)}catch(t){c(`Error in '${e}' listener`,t)}},capture:n}}function he(e,t,n){if(e===`mount`||e===`destroy`)return pe(e,t);if(!l)return fe;let r=me(e,t,n===!0||typeof n==`object`&&!!n&&n.capture===!0);return function(t){if(!t||typeof t.addEventListener!=`function`)return;let i=t;i.addEventListener(e,r.wrapped,n),ue(i,r)}}let j=/* @__PURE__ */ new Set,M=/* @__PURE__ */ new WeakMap,N=/* @__PURE__ */ new Set,P=/* @__PURE__ */ new WeakMap;function ge(e,t){let n=M.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);j.add(r),M.set(e,{ref:r,info:t})}function _e(e,t){let n=P.get(e);if(n){n.info=t;return}let r=new WeakRef(e);N.add(r),P.set(e,{ref:r,info:t})}function ve(e){j.delete(e)}function F(e){N.delete(e)}function ye(e){let t=M.get(e);t&&(j.delete(t.ref),M.delete(e))}function be(e){let t=P.get(e);t&&(N.delete(t.ref),P.delete(e))}let xe=/* @__PURE__ */ new WeakMap,I=/* @__PURE__ */ new Set,Se=/* @__PURE__ */ new WeakMap,Ce=typeof FinalizationRegistry<`u`?new FinalizationRegistry(e=>{I.delete(e)}):null;function we(e,t){if(xe.set(e,t),Se.has(e))return;let n=new WeakRef(e);I.add(n),Se.set(e,n),Ce?.register(e,n,n)}function Te(e){xe.delete(e);let t=Se.get(e);t&&(I.delete(t),Ce?.unregister(t),Se.delete(e))}function Ee(){let e=[];for(let t of I){let n=t.deref();n===void 0?I.delete(t):e.push(n)}return e}function De(e){return xe.get(e)??null}let Oe=`http://www.w3.org/2000/svg`;function ke(e){return globalThis.document?document.createElement(e):null}function Ae(e,t){return globalThis.document?document.createElementNS(e,t):null}function L(e){return globalThis.document?document.createTextNode(e):null}function je(){return globalThis.document?document.createDocumentFragment():null}function Me(e,t){try{return e.appendChild(t),!0}catch(e){return c(`Failed to append child node`,e),!1}}function Ne(e){if(e.nodeType===Node.ELEMENT_NODE){let t=e;de(t),be(t),Te(t)}else e.nodeType===Node.TEXT_NODE?ye(e):e.nodeType===Node.COMMENT_NODE&&Te(e);let t=le()?Array.from(e.childNodes):e.childNodes;for(let e=0;e<t.length;e++)Ne(t[e]);e.nodeType===Node.ELEMENT_NODE&&ce(e)}function Pe(e){if(!le())return;let t=Array.from(e.childNodes);for(let e=0;e<t.length;e++)Pe(t[e]);e.nodeType===Node.ELEMENT_NODE&&ce(e)}function R(e){if(!e?.parentNode)return!1;try{return Ne(e),e.parentNode?.removeChild(e),!0}catch(e){return c(`Failed to remove child node`,e),!1}}function Fe(e,t,n){try{return e.insertBefore(t,n),!0}catch(e){return c(`Failed to insert node before reference`,e),!1}}function z(e){return globalThis.document?globalThis.document.createComment(e):null}function Ie(e,t=`hidden`){return globalThis.document?globalThis.document.createComment(`conditional-${e}-${t}`):null}function Le(e,t){let n=z(`${e}-end`);if(!n)throw Error(`Failed to create comment: document not available`);let r=z(`${e}-start-${t}`);if(!r)throw Error(`Failed to create comment: document not available`);return{start:r,end:n}}function Re(e,t){let n=e.nextSibling;for(;n&&n!==t;){let e=n.nextSibling;R(n),n=e}}function ze(e,t){let n=t.parentNode;if(n)for(let r=0;r<e.length;r++)Fe(n,e[r],t)}function Be(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=L(r);if(e)t=e;else continue}else t=r;Me(e,t)}}return e}function B(e){return e?.isConnected===!0}function Ve(e,t){if(!e?.parentNode)return!1;try{return e.parentNode.replaceChild(t,e),!0}catch(e){return c(`Error replacing conditional node`,e),!1}}function He(e){return e}function Ue(e,t,n){let r=He(e),i=Object.getOwnPropertyDescriptor(r,`appendChild`),a=r.insertBefore;r.appendChild=function(e){return a.call(r,e,t)};try{return n()}finally{i?Object.defineProperty(r,"appendChild",i):Reflect.deleteProperty(r,`appendChild`)}}function We(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}}let Ge={},Ke=!1;function qe(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=P.get(n);e&&(B(n)?Qe(e.info):(F(e.ref),P.delete(n)))}n=n.parentNode}}function Je(){Ke||typeof document<`u`&&typeof document.addEventListener==`function`&&(document.addEventListener(`update`,qe,!0),Ke=!0)}function Ye(e){let t=P.get(e);if(t)return t.info;let n={attributeResolvers:[]};return _e(e,n),n}function Xe(e){return typeof e!=`object`||!e}function Ze(e){let t;try{t=e.resolver()}catch(t){c(`Failed to resolve reactive attribute: ${e.key}`,t);return}let n=Xe(t);if(!(n&&Object.is(t,e.lastValue)))try{e.applyValue(t),e.lastValue=n?t:Ge}catch(t){c(`Failed to apply reactive attribute: ${e.key}`,t)}}function Qe(e){let t=e.attributeResolvers;for(let e=0;e<t.length;e++)Ze(t[e])}function $e(e,t,n,r){if(!(e instanceof Element)||!t||typeof n!=`function`){c(`Invalid parameters for registerAttributeResolver`);return}let i={key:t,resolver:n,applyValue:r,lastValue:Ge};if(!l){Ze(i);return}Je();let a=Ye(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),Ze(i)}function et(e){for(let t of N){let n=t.deref();if(n===void 0){F(t);continue}let r=P.get(n);if(!r){F(t);continue}if(!B(n)){P.delete(n),F(t);continue}(!e||e.contains(n))&&Qe(r.info)}}function tt(e,t){if(e?.style&&t)for(let n in t)We(e,n,t[n])||c(`Failed to set style property '${n}'`)}function nt(e,t){e&&(o(t)?$e(e,`style`,t,function(t){tt(e,t)}):tt(e,t))}let rt=/* @__PURE__ */ new Set([`onMount`,`onDestroy`]),it=/* @__PURE__ */ new WeakMap;function at(e){if(e.length<=2||e.charCodeAt(0)!==111||e.charCodeAt(1)!==110)return null;let t=e.charCodeAt(2);return t<65||t>90||rt.has(e)?null:e===`onDoubleClick`?`ondblclick`:e.toLowerCase()}function ot(e,t,n){if(t in e){e[t]=n;return}let r=t.slice(2),i=it.get(e);if(i){for(let t=0;t<i.length;t+=2){if(i[t]!==r)continue;let a=i[t+1];if(a===n)return;e.removeEventListener(r,a),e.addEventListener(r,n),i[t+1]=n;return}e.addEventListener(r,n),i.push(r,n);return}e.addEventListener(r,n),it.set(e,[r,n])}let V=/* @__PURE__ */ new WeakMap,st=/* @__PURE__ */ new WeakSet;function H(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 ct(e){let t=``;for(let n of e)t&&(t+=` `),t+=n;return t}function lt(e){if(e.className&&!V.has(e)){let t=/* @__PURE__ */ new Set;H(t,e.className),V.set(e,t)}st.add(e)}function ut(e){return st.has(e)}function dt(e,t){if(!t)return;let n=V.get(e);n||(n=/* @__PURE__ */ new Set,V.set(e,n)),H(n,t)}function ft(e,t){let n=V.get(e);if(!n||n.size===0){let n=t||``;e.className!==n&&(e.className=n);return}if(!t){e.className=ct(n);return}let r=ct(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 pt(e,t){if(!t)return;let n=e.className;if(n&&n!==t){let r=/* @__PURE__ */ new Set;H(r,n),H(r,t),e.className=ct(r)}else e.className=t}function mt(e,t,n){if(typeof e!=`function`){c(`Invalid resolver provided to createReactiveTextNode`);let e=L(``);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){c(`Failed to evaluate reactive text resolver`,e),r=``}let i=r===void 0?``:String(r),a=L(i);if(!a)throw Error(`Failed to create text node: document not available`);return l&&ge(a,{resolver:e,lastValue:i,sanitize:n}),a}function ht(e){for(let t of j){let n=t.deref();if(n===void 0){ve(t);continue}let r=M.get(n);if(!r){ve(t);continue}let i=r.info;if(!B(n)){M.delete(n),ve(t);continue}if(e&&!e.contains(n))continue;let a;try{a=i.resolver()}catch(e){c(`Failed to update reactive text node`,e),a=void 0}let o=i.sanitize?a==null||typeof a==`object`||typeof a==`function`?``:String(a):a===void 0?``:String(a);o!==i.lastValue&&(n.textContent=o,i.lastValue=o)}}function gt(e,t,n,r){if(n!=null){if(r&&t===`className`&&e instanceof HTMLElement){pt(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 _t(e,t,n,r=!1){if(n==null)return;let i=t;if(i===`style`){nt(e,n);return}if(o(n)){if(i===`onMount`){ne(e,n);return}if(i===`onDestroy`){re(e,n);return}if(i===`onClick`){e.onclick=n;return}if(i.charCodeAt(0)===111&&i.charCodeAt(1)===110){let t=at(i);if(t){ot(e,t,n);return}if(i in e){e[i]=n;return}}if(n.length===0){let t=n;i===`className`&&e instanceof HTMLElement?(lt(e),$e(e,i,t,function(t){ft(e,String(t||``))})):$e(e,i,t,function(t){gt(e,i,t,!1)});return}}if(i===`className`&&e instanceof HTMLElement&&ut(e)){let t=String(n||``);t&&(dt(e,t),pt(e,t));return}gt(e,i,n,r)}function U(e,t,n=!0){if(t)for(let r in t){let i=r,a=t[r];_t(e,i,a,n&&i===`className`)}}let W=/* @__PURE__ */ new WeakMap;function vt(e){return r(e)&&!n(e)&&`className`in e&&typeof e.className==`string`&&Object.keys(e).length===1}function yt(e){y(e);let t=g(e);return!!t&&t.nodeType===8&&t.textContent?.trimStart().startsWith(`text-`)===!0}function bt(e,t){let n=g(e);if(n&&n.nodeType===3)return b(e),n.textContent!==t&&(n.textContent=t),n;let r=L(t);return r?(e.insertBefore(r,n),_(e,n),r):null}function G(e,i,a){if(i==null)return null;if(o(i)){if(s(i))try{let n=W.get(i);if(n||(n={value:i(),error:!1},W.set(i,n)),n.error)return St(a,()=>``);let r=n.value;if(vt(r))return U(e,{className:()=>{let e=i();return vt(e)?e.className:``}}),null;if(t(r)){let t=i,n=r??``;if(f()&&yt(e)){let r=e;b(r);let i=String(n),a=bt(r,i);return a&&ge(a,{resolver:t,lastValue:i,sanitize:!0}),null}return St(a,t,n,!0)}return null}catch(e){return W.set(i,{value:void 0,error:!0}),c(`Error evaluating reactive text function:`,e),St(a,()=>``)}let o=i(e,a);return o==null?null:t(o)?Ct(a,o):n(o)?o:(r(o)&&U(e,o),null)}let l=i;if(t(l)){if(f()&&yt(e)){let t=e;return b(t),bt(t,String(l)),null}return Ct(a,l)}return n(l)?l:(U(e,l),null)}function xt(e,t){if(l&&!f()&&!p())return t;let n=je();if(!n)throw Error(`Failed to create document fragment: document not available`);let r=z(` text-${e} `);return r&&n.appendChild(r),t&&n.appendChild(t),n}function St(e,t,n,r){return xt(e,mt(t,n,r))}function Ct(e,t){return xt(e,L(String(t)))}let wt=Symbol(`nuclo.factory.tag`),Tt=Symbol(`nuclo.factory.mods`),K=0,Et=[],Dt=0;function Ot(){return Dt>=Et.length&&Et.push(()=>null),Et[Dt++]}function kt(e,t,n){e[wt]=t,e[Tt]=n}function q(e){return typeof e==`function`?e[Tt]:void 0}function J(e){return typeof e==`function`?e[wt]:void 0}function At(){return K>0}function jt(e,t,n){let r=K===0;K++,r&&(Dt=0);try{return e(t,n)}finally{K--}}function Mt(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=G(e,a,r);o&&(o.parentNode!==i&&i.appendChild(o),r+=1)}}function Nt(e,t){let n=ke(e);if(!n)throw Error(`Failed to create element: ${e}`);return Mt(n,t,0),n}function Pt(e,t){let n=Ae(Oe,e);if(!n)throw Error(`Failed to create SVG element: ${e}`);return Mt(n,t,0),n}function Ft(e,t){if(At()){let n=Ot();return kt(n,e,t),n}let n=function(n,r=0){let i=n,a=i?x(i,e):null,o=a??ke(e);if(!o)throw Error(`Failed to create element: ${e}`);let s=o,c=a?s.lastChild:null;return Mt(o,t,r),a&&S(s,c),o};return kt(n,e,t),n}function It(e,t){if(At()){let n=Ot();return kt(n,e,t),n}return function(n,r=0){let i=n,a=i?x(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 Mt(o,t,r),a&&S(s,c),o}}function Lt(e){return(...t)=>Ft(e,t)}function Rt(e){return(...t)=>It(e,t)}let zt=/* @__PURE__ */ `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(`.`),Bt=/* @__PURE__ */ `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(`.`),Vt=[`area`,`base`,`br`,`col`,`embed`,`hr`,`img`,`input`,`link`,`meta`,`source`,`track`,`wbr`];function Ht(e,t,n,r){Object.defineProperty(e,t,{configurable:!0,enumerable:!0,get(){let i=r(n);return Object.defineProperty(e,t,{value:i,configurable:!0,enumerable:!0,writable:!0}),i},set(n){Object.defineProperty(e,t,{value:n,configurable:!0,enumerable:!0,writable:!0})}})}function Ut(e,t){t in e&&typeof e[t]!=`function`||(Ht(e,t,t,Lt),t===`var`&&Ht(e,`var_`,t,Lt))}function Wt(e,t){let n=`${t}Svg`;n in e||Ht(e,n,t,Rt)}function Gt(e=globalThis){let t=`__nuclo_tags_registered`;if(!e[t]){for(let t=0;t<Bt.length;t++)Wt(e,Bt[t]);for(let t=0;t<zt.length;t++)Ut(e,zt[t]);e[t]=!0}}function Kt(e,t,n){if(o(e)){let r=e(t,n);return r&&i(r)?r:null}return e&&i(e)?e:null}function qt(e,t){let r=[],i=0;for(let e=0;e<t.length;e++){let a=t[e];if(a==null){r.push({kind:4});continue}let o=typeof a;if(o===`function`){let e=q(a);if(e!==void 0){let t=J(a);if(!t)return null;let n=qt(t,e);if(!n)return null;r.push({kind:3,child:n});continue}if(a.length===0){let e;try{e=a(),W.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(n(a))return null;let e=a,t=Object.keys(e),o=[];for(let n=0;n<t.length;n++){let r=t[n],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`){let e=at(r);if(e){o.push({key:r,kind:1,prop:!1,value:e});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 Jt(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;Jt(i.child,r),r=r.nextSibling}}}function Yt(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;let e=a.value;e===`onclick`?n.onclick=o:ot(n,e,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}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||q(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=q(s);if(e===void 0||J(s)!==o.child.tag||!a||!Yt(o.child,e,a,r))return!1;a=a.nextSibling;break}case 4:if(s!=null)return!1}}return!0}function Xt(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;be(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;ye(e),r.push({kind:0,node:e,fn:s,last:e.nodeValue??``}),a=e.nextSibling;break}case 3:{let e=q(s);if(e===void 0||J(s)!==o.child.tag||!a||!Xt(o.child,e,a,r))return!1;a=a.nextSibling;break}case 4:if(s!=null)return!1}}return!0}function Zt(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 Qt(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}let $t=/* @__PURE__ */ new Set,en=/* @__PURE__ */ new WeakMap,tn=typeof FinalizationRegistry<`u`?new FinalizationRegistry(e=>{$t.delete(e)}):null,nn=0;function rn(e,t){let n=new WeakRef(e);$t.add(n),en.set(e,t),tn?.register(e,n)}function an(e){return Array.isArray(e)?e:Array.from(e)}function on(e){if(typeof e!=`object`||!e)return!1;let t=e.element;return!!t&&typeof Node<`u`&&t instanceof Node}function sn(e,t,n){let r=e.renderItem(t,n);return on(r)?(e.lastRenderRefresh=typeof r.update==`function`?r.update:null,r.element):Kt(r,e.host,n)}function cn(e,t,n){e.lastRenderLeaves=null,e.lastRenderRefresh=null;let r=e.template,i=l&&!f()&&!p(),a=r&&i?jt(e.renderItem,t,n):e.renderItem(t,n);if(on(a))return e.lastRenderRefresh=typeof a.update==`function`?a.update:null,a.element;if(r!==null&&i){let i=q(a);if(i!==void 0){if(r===void 0){let t=J(a),r=t?qt(t,i):null,o=Kt(a,e.host,n);if(r&&o){let t=o.cloneNode(!0);Jt(r,t);let n=[];if(Xt(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 Yt(r.tmpl,i,o,s)?(s.length>0&&(e.lastRenderLeaves=s),o):(e.template=null,sn(e,t,n))}if(r===void 0)e.template=null;else return e.template=null,sn(e,t,n)}return Kt(a,e.host,n)}function ln(e){R(e.element)}function un(e,t,n,r){if(n.parentNode!==t||r.parentNode!==t)return!1;if(le())for(let t=0;t<e.length;t++){let n=e[t].element;n&&Pe(n)}if(l&&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 dn(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 fn(e,t,n,r,i,a,o){let s=je(),c=0;for(let l=r;l<i;l++){let r=n[l],i=cn(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 pn(e){let{startMarker:t,endMarker:n}=e,r=t.parentNode??e.host,i=an(e.itemsProvider());if(Qt(e.lastSyncedItems,i))return;let a=e.records,o=a.length,s=i.length;if(s===0){if(o>0&&!un(a,r,t,n))for(let e=0;e<o;e++)ln(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)fn(e,r,i,m,h,t,a),e.allRecordsCreatedAt=o===0?e.currentFlushEpoch:void 0;else{let n=[];fn(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++)ln(a[e]);a.splice(f,p-f),e.allRecordsCreatedAt=void 0,e.lastSyncedItems=i.slice();return}let ee=p-f,g=h-m,_=Array(g).fill(-1),v=new Uint8Array(ee),y=0,b=Math.min(p,h);for(let e=c;e<b;e++)a[e].item===i[e]&&(_[e-m]=e,v[e-f]=1,y++);let x=/* @__PURE__ */ new Map;for(let e=f;e<p;e++){if(v[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<g;e++){if(_[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])),_[e]=n,v[n-f]=1,y++}if(y===0&&f===0&&p===o){if(!un(a,r,t,n))for(let e=0;e<o;e++)ln(a[e]);let c=[];fn(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++)v[e-f]||ln(a[e]);let S=null;if(y>0){let e=[],t=[];for(let n=0;n<g;n++)_[n]!==-1&&(e.push(_[n]),t.push(n));S=new Uint8Array(g);let n=dn(e);for(let e=0;e<n.length;e++)S[t[n[e]]]=1}let C=Array(g),w=0,T=p<o?a[p].element:n,E=null;for(let t=g-1;t>=0;t--){let n=_[t];if(n===-1){let n=i[m+t],a=cn(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||=je(),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+(g-w)+(o-p)),O=0;for(let e=0;e<f;e++)D[O++]=a[e];for(let e=0;e<g;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 mn(e,t,n,r){return f()?gn(e,t,n,r):hn(e,t,n,r)}function hn(e,t,n,r){let{start:i,end:a}=Le(`list`,r),o={itemsProvider:e,renderItem:t,startMarker:i,endMarker:a,records:[],host:n,lastSyncedItems:[]},s=n;return s.appendChild(i),s.appendChild(a),pn(o),l&&rn(i,o),o}function gn(e,t,n,r){let i=n;y(i);let a=g(i);if(!a||a.nodeType!==8||!a.textContent?.startsWith(`list-start-`))return hn(e,t,n,r);let o=b(i),s=0,c=g(i);for(;c;){if(c.nodeType===8){let e=c.textContent||``;if(e.startsWith(`list-start-`))s++;else if(e===`list-end`){if(s===0)break;s--}}c=c.nextSibling}let u=c;if(!u){let e=z(`list-end`);e&&(i.insertBefore(e,o.nextSibling),u=e)}if(!u)return hn(e,t,n,r);let d=an(e()),f=[];for(let e=0;e<d.length;e++){let r=t(d[e],e),i=on(r)?r:null,a=i?i.element:Kt(r,n,e);a&&f.push({item:d[e],element:a,refresh:i&&typeof i.update==`function`?i.update:void 0})}let p=g(i);for(;p&&p!==u;){let e=p.nextSibling;R(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}_(i,u.nextSibling);let h={itemsProvider:e,renderItem:t,startMarker:o,endMarker:u,records:f,host:n,lastSyncedItems:d.slice()};return l&&rn(o,h),h}function _n(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 vn(e){let t=[];nn++;for(let n of $t){let r=n.deref();if(!r){t.push(n);continue}let i=en.get(r);if(!i){t.push(n);continue}if(!B(r)||!B(i.endMarker)){_n(i),en.delete(r),t.push(n);continue}if(e&&!e.contains(r))continue;i.currentFlushEpoch=nn;try{pn(i)}finally{i.currentFlushEpoch=void 0}if(i.allRecordsCreatedAt===nn)continue;let a=i.records;for(let e=0;e<a.length;e++){if(a[e].dynCreatedAt===nn)continue;let t=a[e].refresh;t&&t();let n=a[e].dyn;n&&Zt(n)}}for(let e of t)$t.delete(e)}function yn(e,t){return function(n,r){return mn(e,t,n,r).startMarker}}function bn(e,t){try{return e()}catch(e){if(t)return t(e),!1;throw e}}function xn(e,t){return typeof e==`function`?bn(e,t):!!e}let Sn=/* @__PURE__ */ new Set,Cn=/* @__PURE__ */ new WeakMap,wn=typeof FinalizationRegistry<`u`?new FinalizationRegistry(e=>{Sn.delete(e)}):null;function Tn(e,t){for(let t=0;t<e.length;t++)if(xn(e[t].condition))return t;return t.length>0?-1:null}function En(e){let{groups:t,elseContent:n,host:r,index:i,endMarker:a}=e,o=Tn(t,n);o===e.activeIndex||(Re(e.startMarker,e.endMarker),e.activeIndex=o,o===null)||ze(An(o>=0?t[o].content:n,r,i,a),a)}function Dn(e){let t=new WeakRef(e.startMarker);Sn.add(t),Cn.set(e.startMarker,e),wn?.register(e.startMarker,t)}function On(e){let t=[];for(let n of Sn){let r=n.deref();if(r===void 0){t.push(n);continue}let i=Cn.get(r);if(!i){t.push(n);continue}if(!B(r)||!B(i.endMarker)){Cn.delete(r),t.push(n);continue}if(!e||e.contains(r))try{i.update()}catch(e){c(`when() branch threw during update; unregistering this conditional`,e),Cn.delete(r),t.push(n)}}for(let e of t)Sn.delete(e)}function kn(e,t,n,r){return o(e)?s(e)?(W.delete(e),G(t,e,n)):Ue(t,r,()=>{let r=G(t,e,n);return r&&!r.parentNode?r:null}):G(t,e,n)}function An(e,t,n,r){let i=[];for(let a of e){let e=kn(a,t,n,r);e&&i.push(e)}return i}function jn(e,t){return`when-start-${e}-b${t===null?`n`:t}`}function Mn(e){let t=/-b(n|-?\d+)$/.exec(e||``);if(t)return t[1]===`n`?null:parseInt(t[1],10)}var Nn=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}=Le(`when`,t),i=this.createRuntimeFromMarkers(e,t,n,r),a=He(e);return a.appendChild(n),a.appendChild(r),En(i),n.textContent=jn(t,i.activeIndex),n}hydrateRender(e,t){let n=e;y(n);let r=g(n);if(!r||r.nodeType!==8||!r.textContent?.startsWith(`when-start-`))return this.freshRender(e,t);let i=b(n),a=0,o=g(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=z(`when-end`);if(!e)return i;n.insertBefore(e,i.nextSibling),s=e,c=!0}let l=Tn(this.groups,this.elseContent),u=Mn(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)G(e,r,t)}}else if(Re(i,s),l!==null){let n=l>=0?this.groups[l].content:this.elseContent,r=s;ee(()=>{ze(An(n,e,t,r),r)})}return _(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(){En(a)}};return l&&Dn(a),a}};function Pn(e){return Object.assign(function(t,n){return e.render(t,n)},{when:function(t,...n){return Pn(e.cloneWith({condition:t,content:n}))},else:function(...t){return Pn(e.cloneWith(void 0,t))}})}function Fn(e,...t){return Pn(new Nn(e,...t))}function In(e){try{return e.isSvg?Pt(e.tagName,e.modifiers):Nt(e.tagName,e.modifiers)}catch(t){if(c(`Error applying modifiers in conditional element "${e.tagName}"`,t),e.isSvg){let n=Ae(Oe,e.tagName);if(!n)throw Error(`Failed to create SVG element: ${e.tagName}`,{cause:t});return n}let n=ke(e.tagName);if(!n)throw Error(`Failed to create element: ${e.tagName}`,{cause:t});return n}}function Ln(e){let t=De(e);if(!t)return;let n=bn(t.condition,e=>{c(`Error evaluating conditional condition`,e)}),r=e.nodeType===Node.ELEMENT_NODE;if(n&&!r){let n=In(t);we(n,t),Ve(e,n)}else if(!n&&r){let n=Ie(t.tagName);n&&(Pe(e),we(n,t),Ve(e,n))}}function Rn(e){if(l)try{let t=Ee();for(let n of t){if(!n.isConnected){Te(n);continue}(!e||e.contains(n))&&Ln(n)}}catch(e){c(`Error during conditional elements update`,e)}}let zn=/* @__PURE__ */ new Map;function Bn(e){let t=[],n=/* @__PURE__ */ 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=zn.get(e);n||(n=/* @__PURE__ */ new Set,zn.set(e,n)),n.add(new WeakRef(t))}function Hn(e){let t=Bn(e);if(t.length===0)return[];let n=/* @__PURE__ */ new Set;for(let e of t){let t=zn.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(!B(t)){r.push(e);continue}n.add(t)}for(let e of r)t.delete(e);t.size===0&&zn.delete(e)}return Array.from(n)}function Un(...e){let t=Bn(e);return function(e){if(l&&e instanceof Element)for(let n of t)Vn(n,e)}}let Wn=[vn,On,Rn,et,ht,Kn];function Gn(...e){let t;if(e.length>0){let n=Hn(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 Wn)e(t);se()}function Kn(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){c(`Error dispatching global update event`,e)}}function qn(e,t,n=0){let r=t||document.body,i=e(r,n);return r.appendChild(i),se(),i}function Jn(e,t){let n=t||document.body,r=n;m();let i;try{i=e(n,0);let t=i;if(t&&t.nodeType===1&&t.parentNode!==r){let e=g(r);if(e){let n=e.nextSibling;r.insertBefore(t,e),R(e),_(r,n)}else r.appendChild(t),_(r,null)}}finally{h()}return se(),i}function Yn(){return{ssrCollector:null,atomCache:/* @__PURE__ */ new Map,atomMeta:/* @__PURE__ */ new Map,rawKeys:/* @__PURE__ */ new Set,baseRules:[],queryRules:/* @__PURE__ */ new Map,styleEpoch:0,cssTextCache:null,sheet:null,sheetDocument:null,baseRuleCount:0,groupRules:/* @__PURE__ */ new Map,externalRules:null,hasExternalGroups:!1}}let Xn=Symbol.for(`nuclo.style.engine.v1`),Zn=globalThis,Qn;function Y(){return Qn??=Zn[Xn]??(Zn[Xn]=Yn())}function $n(e){let t=Y();t.ssrCollector=e}function er(e){for(let t of e){let e=Y();e.queryRules.has(t)||e.queryRules.set(t,[])}}function tr(e,t){let n=Y();try{let r=e.cssRules.length;e.insertRule(t+`{}`,r);let i=e.cssRules[r];return n.groupRules.set(t,i),n.groupRules.set(X(i),i),i}catch{return null}}let nr=/* @__PURE__ */ new WeakMap;function X(e){let t=nr.get(e);if(t!==void 0)return t;let n=e.cssText,r=n.indexOf(`{`),i=(r===-1?n:n.slice(0,r)).trim();return nr.set(e,i),i}function rr(e){return e instanceof CSSStyleRule?e.selectorText:X(e)}function ir(e,t){return(e===void 0?`-`:`+`+e.length+`:`+e)+t.length+`:`+t}function ar(e,t){let n=Y();if(!n.externalRules)return;let r=ir(t,rr(e)),i=n.externalRules.get(r);i||(i=/* @__PURE__ */ new Set,n.externalRules.set(r,i)),i.add(e.cssText)}function or(e,t){let n=Y();if(!n.externalRules)return!1;let r=ir(t,rr(e)),i=n.externalRules.get(r);return i?.delete(e.cssText)?(i.size===0&&n.externalRules.delete(r),n.externalRules.size===0&&(n.externalRules=null),!0):!1}function sr(e){let t=Y();for(let n=0;n<e.length;n++){let r=e[n];if(r instanceof CSSStyleRule){ar(r,void 0);continue}let i=X(r);if(`cssRules`in r&&!i.startsWith(`@keyframes`)){let e=r;t.hasExternalGroups=!0,t.groupRules.set(i,e);for(let t=0;t<e.cssRules.length;t++)ar(e.cssRules[t],i)}else ar(r,void 0)}}function cr(e,t){let n=Y();try{e.insertRule(t,n.baseRuleCount);let r=e.cssRules[n.baseRuleCount];if(or(r,void 0)){e.deleteRule(n.baseRuleCount);return}n.baseRuleCount++}catch{}}function lr(e,t){let n=Y();try{let r=e.cssRules.length;e.insertRule(t,r);let i=e.cssRules[r];n.externalRules&&or(i,X(e))&&e.deleteRule(r)}catch{}}function ur(e,t){let n=Y(),r=n.groupRules.get(t);if(r)return r;if(!n.hasExternalGroups)return tr(e,t);try{let r=e.cssRules.length;e.insertRule(t+`{}`,r);let i=X(e.cssRules[r]);e.deleteRule(r);let a=n.groupRules.get(i);if(a)return n.groupRules.set(t,a),a}catch{return null}return tr(e,t)}function Z(){let e=Y();if(typeof document>`u`||typeof document.getElementById!=`function`)return null;if(e.sheet&&e.sheetDocument===document&&e.sheet.ownerNode&&e.sheet.ownerNode.isConnected)return e.sheet;let t=document.getElementById(`nuclo-styles`),n;if(t?.tagName===`STYLE`?n=t:(n=document.createElement(`style`),n.id=`nuclo-styles`,t?t.replaceWith(n):document.head.appendChild(n)),e.sheet=n.sheet,e.sheetDocument=document,e.groupRules.clear(),e.baseRuleCount=0,e.externalRules=null,e.hasExternalGroups=!1,!e.sheet)return null;if(e.sheet.cssRules.length>0){let t=0;for(;t<e.sheet.cssRules.length;){let n=e.sheet.cssRules[t];if(!(n instanceof CSSStyleRule)&&`cssRules`in n&&!X(n).startsWith(`@keyframes`))break;t++}e.baseRuleCount=t,e.externalRules=/* @__PURE__ */ new Map,sr(e.sheet.cssRules)}for(let t of e.baseRules)cr(e.sheet,t);for(let[t,n]of e.queryRules){let r=ur(e.sheet,t);if(r)for(let e of n)lr(r,e)}return e.sheet}function dr(e,t){let n=Y(),r=Z();if(t===void 0)n.baseRules.push(e);else{let r=n.queryRules.get(t);r||(r=[],n.queryRules.set(t,r)),r.push(e)}if(n.cssTextCache=null,r){if(t===void 0)cr(r,e);else{let n=ur(r,t);n&&lr(n,e)}}n.ssrCollector?.(t===void 0?e:t+`{`+e+`}`)}function fr(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 pr(e,t){return(e===void 0?`-`:`+`+e.length+`:`+e)+t.length+`:`+t}function mr(e,t){return e+t.length+`:`+t}function hr(e,t){let n=``,r=0;for(let i=0;i<e.length;i++){let a=e.charCodeAt(i);if(a===92&&i+1<e.length){n+=e[i]+e[++i];continue}if(r!==0){n+=e[i],a===r&&(r=0);continue}a===34||a===39?(r=a,n+=e[i]):n+=a===38?t:e[i]}return n}function gr(e,t){let n=`.`+e;return n+hr(t,n)}function _r(e){if(e.length===0||e===`-`)return!1;for(let t=0;t<e.length;t++){let n=e.charCodeAt(t);if(!(n>=97&&n<=122||n>=65&&n<=90||n===45||n===95||t>0&&n>=48&&n<=57))return!1}if(e.charCodeAt(0)===45&&e.length>1){let t=e.charCodeAt(1);if(t>=48&&t<=57)return!1}return!0}function vr(e,t,n,r,i=!1){let a=Y(),o=pr(e,t);for(let[e,t]of n)o=mr(mr(o,e),t);r!==void 0&&!_r(r)&&(console.warn(`[nuclo] css() name ${JSON.stringify(r)} is not a valid CSS class name (letters, digits, - and _ only, not starting with a digit); falling back to a generated name.`),r=void 0);let s=r===void 0?`a`+o:`n`+mr(``,r)+o,c=a.atomCache.get(s);if(c!==void 0)return Z(),c;r===void 0?c=`n`+fr(s):(c=i?r:r+`-`+fr(s),a.atomMeta.has(c)&&console.warn(`[nuclo] css() name ${JSON.stringify(c)} is already used by a different style. Both rules are emitted under the same class, so they will override each other — rename one.`));let l=``;for(let[e,t]of n)l+=(l?`;`:``)+e+`:`+t;return a.atomCache.set(s,c),a.atomMeta.set(c,{query:e,suffix:t,decls:n,name:r}),dr(gr(c,t)+`{`+l+`}`,e),c}function yr(e,t,n,r,i=!1){return vr(e,t,n,r,i)}function br(e,t){let n=Y(),r=n.atomMeta.get(e),i=n.atomMeta.get(t);if(!r||!i)return t;let a=[...r.decls,...i.decls],o=/* @__PURE__ */ new Map;for(let e=0;e<a.length;e++)o.set(a[e][0],e);let s=a.filter((e,t)=>o.get(e[0])===t);return vr(r.query,r.suffix,s,r.name??i.name)}function xr(e){let t=Y().atomMeta.get(e);return t===void 0?void 0:pr(t.query,t.suffix)}function Sr(){return(Qn??Zn[Xn])?.styleEpoch??0}function Cr(e,t){let n=Y();if(n.rawKeys.has(e)){Z();return}n.rawKeys.add(e),dr(t,void 0)}function wr(){let e=Y();if(e.cssTextCache!==null)return e.cssTextCache;let t=e.baseRules.join(``);for(let[n,r]of e.queryRules)r.length>0&&(t+=n+`{`+r.join(``)+`}`);return e.cssTextCache=t,t}function Tr(){let e=Y();e.atomCache.clear(),e.atomMeta.clear(),e.rawKeys.clear(),e.baseRules.length=0,e.queryRules.clear(),e.groupRules.clear(),e.cssTextCache=null,e.baseRuleCount=0,e.sheet=null,e.sheetDocument=null,e.externalRules=null,e.hasExternalGroups=!1,e.styleEpoch++,typeof document<`u`&&document.getElementById(`nuclo-styles`)?.remove()}let Er={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`},Dr={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`]},Or={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`}},kr={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`},Ar=/* @__PURE__ */ 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`]),jr=/* @__PURE__ */ new Map;function Mr(e){if(!/[A-Z]/.test(e))return e;let t=jr.get(e);return t===void 0&&(t=e.replace(/[A-Z]/g,e=>`-`+e.toLowerCase()),jr.size>=512&&jr.clear(),jr.set(e,t)),t}function Nr(e){return e.charCodeAt(0)===64?e:`@media `+e}function Pr(e,t){return e!==void 0&&e.startsWith(`@media`)&&t.startsWith(`@media`)?e+` and`+t.slice(6):t}function Fr(e,t){for(let n in t){let r=t[n],i=e[n];e[n]=typeof r==`object`&&r&&!Array.isArray(r)&&typeof i==`object`&&i&&!Array.isArray(i)?Fr({...i},r):r}return e}var Ir=class{className;constructor(e){this.className=e}toString(){return this.className}};function Q(e){return new Ir(e)}function Lr(e,t){let n=xr(t);if(n===void 0){e.set(t,t);return}let r=e.get(n);r===void 0||r===t?e.set(n,t):e.set(n,br(r,t))}function Rr(e,t){let n=0;for(let r=0;r<=e.length;r++){let i=r===e.length?32:e.charCodeAt(r);(i===32||i===9||i===10||i===12||i===13)&&(r>n&&Lr(t,e.slice(n,r)),n=r+1)}}function zr(e,t){for(let n of e)n&&(typeof n==`string`?Rr(n,t):Array.isArray(n)?zr(n,t):Rr(n.className,t))}function Br(e){let t=/* @__PURE__ */ new Map;zr(e,t);let n=``;for(let e of t.values())n+=(n?` `:``)+e;return n}let Vr=/* @__PURE__ */ new WeakMap;function Hr(e){return!!e&&typeof e==`object`&&!Array.isArray(e)}function Ur(...e){if(e.length===0)return Q(``);if(e.length===1){let t=e[0];if(!t)return Q(``);if(!Array.isArray(t)){let e=typeof t==`string`?t:t.className;if(!/[\t\n\f\r ]/.test(e))return Q(e)}}if(e.length===2&&Hr(e[0])&&Hr(e[1])){let t=e[0],n=e[1],r=Sr(),i=Vr.get(t),a=i?.get(n);if(a!==void 0&&a.epoch===r&&a.first===e[0].className&&a.second===e[1].className)return Z(),a.result;let o=Q(Br(e)),s=i??/* @__PURE__ */ new WeakMap;return s.set(n,{epoch:r,first:e[0].className,second:e[1].className,result:o}),i||Vr.set(t,s),o}return Q(Br(e))}function Wr(e={}){let t=e.screens??{};er(Object.values(t).map(Nr));let n=/* @__PURE__ */ new WeakMap;function r(t,n){if(typeof n==`number`)return n===0||Ar.has(t)?String(n):n+`px`;let r=kr[t];if(r!==void 0){let t=e[r]?.[n];if(t!==void 0)return t}return n}function i(e,t,n){let r=(t===void 0?`-`:`+`+t.length+`:`+t)+n.length+`:`+n,i=e.get(r);return i||(i={query:t,suffix:n,decls:[]},e.set(r,i)),i}function a(e,n,o,s){for(let c in e){let l=e[c];if(l==null||l===!1)continue;if(typeof l==`object`){if(c===`raw`){let e=l,t=i(s,n,o).decls;for(let n in e)t.push([n,r(n,e[n])]);continue}let e=Er[c];if(e!==void 0){a(l,n,o+e,s);continue}let u=t[c];if(u!==void 0){a(l,Pr(n,Nr(u)),o,s);continue}let d=c.charCodeAt(0);if(d===38){a(l,n,hr(c,`&`+o).slice(1),s);continue}if(d===64){a(l,Pr(n,c),o,s);continue}continue}if(l===!0){let e=Or[c];if(e){let t=i(s,n,o).decls;for(let n in e)t.push([n,e[n]])}continue}let u=Dr[c];if(u!==void 0){let e=i(s,n,o).decls;for(let t of u)e.push([t,r(t,l)])}else{let e=Mr(c);i(s,n,o).decls.push([e,r(e,l)])}}}function o(e,t){let r=typeof e==`string`,i=r?t:e,o=r?e:void 0;if(i==null)return Q(``);let s=Sr(),c=n.get(i);if(c!==void 0&&c.epoch===s&&c.name===o)return Z(),c.result;let l=/* @__PURE__ */ new Map;a(i,void 0,``,l);let u=[];for(let e of l.values()){if(e.decls.length===0)continue;let t=e.query===void 0&&e.suffix===``;u.push(yr(e.query,e.suffix,e.decls,o,t))}let d=Q(u.join(` `));return n.set(i,{epoch:s,name:o,result:d}),d}function s(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=Or[t];if(e)for(let t in e)n(t,e[t]);continue}let a=Dr[t];if(a!==void 0)for(let e of a)n(e,r(e,i));else{let e=Mr(t);n(e,r(e,i))}}return t}function c(e){let t=``;for(let n in e)t+=n+`{`+s(e[n])+`}`;let n=`nk`+fr(t);return Cr(n,`@keyframes `+n+`{`+t+`}`),n}function l(e,t){let n=e+`{`+s(t)+`}`;Cr(`g|`+n,n)}function u(e){let t=e=>e===!0?`true`:e===!1?`false`:String(e),n=e.variants??{},r=Object.keys(n),i=e.defaultVariants??{},a=e.base??null,s=(e.compoundVariants??[]).map(e=>{let{css:n,...r}=e,i={};for(let e in r)i[e]=t(r[e]);return{conditions:i,style:n}}),c=/* @__PURE__ */ new Map,l=Sr();return function(e){let u=Sr();l!==u&&(c.clear(),l=u);let d={};for(let n of r){let r=(e?e[n]:void 0)??i[n];r!=null&&(d[n]=t(r))}let f=``;for(let e of r){let t=d[e];f+=e.length+`:`+e,f+=t===void 0?`-`:`+`+t.length+`:`+t}let p=c.get(f);if(p)return Z(),p;let m={};a&&(m=Fr(m,a));for(let e of r){let t=d[e];if(t!==void 0){let r=n[e][t];r&&(m=Fr(m,r))}}for(let e of s){let t=!0;for(let n in e.conditions)if(d[n]!==e.conditions[n]){t=!1;break}t&&(m=Fr(m,e.style))}let h=o(m);return c.set(f,h),h}}return{css:o,cx:Ur,variants:u,keyframes:c,globalStyle:l,theme:e}}let Gr;function $(){return Gr??=Wr({})}let Kr=(e,t)=>typeof e==`string`?$().css(e,t):$().css(e),qr=e=>$().variants(e),Jr=e=>$().keyframes(e),Yr=(e,t)=>$().globalStyle(e,t);function Xr(){Gt();let e=globalThis;e.list=yn,e.update=Gn,e.when=Fn,e.on=he,e.scope=Un,e.render=qn,e.hydrate=Jn,e.createCss=Wr,e.css=Kr,e.cx=Ur,e.variants=qr,e.keyframes=Jr,e.globalStyle=Yr}Xr(),e.HTML_TAGS=zt,e.SELF_CLOSING_TAGS=Vt,e.SVG_TAGS=Bt,e.appendChildren=Be,e.applyAttributes=U,e.applyNodeModifier=G,e.createComment=z,e.createConditionalComment=Ie,e.createCss=Wr,e.createHtmlElementWithModifiers=Nt,e.createHtmlTagBuilder=Lt,e.createSvgElementWithModifiers=Pt,e.createSvgTagBuilder=Rt,e.css=Kr,e.cx=Ur,e.getCssText=wr,e.globalStyle=Yr,e.hydrate=Jn,e.initializeRuntime=Xr,e.isBoolean=a,e.isBrowser=l,e.isFunction=o,e.isNode=n,e.isObject=r,e.isPrimitive=t,e.isTagLike=i,e.isZeroArityFunction=s,e.keyframes=Jr,e.list=yn,e.on=he,e.registerGlobalTagBuilders=Gt,e.render=qn,e.replaceNodeSafely=Ve,e.resetStyles=Tr,e.scope=Un,e.setSSRCollector=$n,e.update=Gn,e.variants=qr,e.when=Fn});
|
|
1
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports):typeof define==`function`&&define.amd?define([`exports`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.Nuclo={}))})(this,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e){return e===null||typeof e!=`object`&&typeof e!=`function`}function n(e){return e instanceof Node?!0:typeof e!=`object`||!e?!1:typeof e.nodeType==`number`}function r(e){return typeof e==`object`&&!!e}function i(e){return r(e)&&`tagName`in e}function a(e){return typeof e==`boolean`}function o(e){return typeof e==`function`}function s(e){return o(e)&&e.length===0}function c(e,t){typeof console<`u`&&console.error(`nuclo: ${e}`,t)}let l=typeof window<`u`&&typeof document<`u`,u=!1,d=/* @__PURE__ */ new WeakMap;function f(){return u}function p(){return!1}function m(){u=!0,d=/* @__PURE__ */ new WeakMap}function h(){u=!1}function ee(e){let t=u;u=!1;try{return e()}finally{u=t}}function g(e){let t=d.get(e);return t===void 0?e.firstChild:t}function _(e,t){d.set(e,t)}function v(e){return e.nodeType===3&&!/\S/.test(e.textContent||``)}function y(e){let t=g(e),n=!1;for(;t&&v(t);)t=t.nextSibling,n=!0;n&&_(e,t)}function b(e){let t=g(e);return t&&_(e,t.nextSibling),t}function x(e,t){if(!u)return null;y(e);let n=g(e);return n&&n.nodeType===1&&n.tagName.toLowerCase()===t?b(e):null}function S(e,t){if(!t)return;let n=g(e);for(;n;){let r=n===t?null:n.nextSibling;e.removeChild(n),n=r}_(e,null)}let C=/* @__PURE__ */ new WeakMap,w=0,T=[];function E(){return!l||p()}function D(e){let t=C.get(e);return t||(t={mount:null,destroy:null,state:0,queued:!1},C.set(e,t),w++),t}function O(e,t){return e===null?t:Array.isArray(e)?(e.push(t),e):[e,t]}function te(e,t){t.queued||t.state!==0||(t.queued=!0,T.push(new WeakRef(e)))}function ne(e,t){if(E())return;let n=D(e);n.state!==2&&(n.mount=O(n.mount,t),te(e,n))}function re(e,t){if(E())return;let n=D(e);n.state!==2&&(n.destroy=O(n.destroy,t),te(e,n))}function ie(e,t,n){if(n.state===1)try{let r=t(e);typeof r==`function`&&(C.get(e)?.state===2?ae(e,r):n.destroy=O(n.destroy,r))}catch(e){c(`Error in mount callback`,e)}}function ae(e,t){try{t(e)}catch(e){c(`Error in destroy callback`,e)}}function oe(e){let t=C.get(e);if(!t||(t.queued=!1,t.state!==0))return;t.state=1;let n=t.mount;if(t.mount=null,n!==null){if(Array.isArray(n))for(let r=0;r<n.length;r++)ie(e,n[r],t);else ie(e,n,t)}}function se(){if(T.length===0)return;let e=T;T=[];for(let t=0;t<e.length;t++){let n=e[t].deref();n&&oe(n)}}function ce(e){let t=C.get(e);if(!t||t.state===2)return;let n=t.state===1;if(t.state=2,w--,n){let n=t.destroy;if(n!==null){if(Array.isArray(n))for(let t=0;t<n.length;t++)ae(e,n[t]);else ae(e,n)}}t.mount=null,t.destroy=null}function le(){return w>0}let k=/* @__PURE__ */ new WeakMap;function ue(e,t){let n=k.get(e);n?Array.isArray(n)?n.includes(t)||n.push(t):n!==t&&k.set(e,[n,t]):k.set(e,t)}function A(e,t){e.removeEventListener(t.type,t.wrapped,t.capture)}function de(e,t){let n=k.get(e);if(!n)return;if(t===void 0){if(Array.isArray(n))for(let t=0;t<n.length;t++)A(e,n[t]);else A(e,n);k.delete(e);return}if(!Array.isArray(n)){n.type===t&&(A(e,n),k.delete(e));return}let r=0;for(let i=0;i<n.length;i++){let a=n[i];a.type===t?A(e,a):n[r++]=a}r===0?k.delete(e):r===1?k.set(e,n[0]):n.length=r}function fe(e){}function pe(e,t){return l?function(n){if(!n)return;let r=n;e===`mount`?ne(r,t):re(r,t)}:fe}function me(e,t,n){return{type:e,wrapped:function(n){let r=this;try{t.call(r,n)}catch(t){c(`Error in '${e}' listener`,t)}},capture:n}}function he(e,t,n){if(e===`mount`||e===`destroy`)return pe(e,t);if(!l)return fe;let r=me(e,t,n===!0||typeof n==`object`&&!!n&&n.capture===!0);return function(t){if(!t||typeof t.addEventListener!=`function`)return;let i=t;i.addEventListener(e,r.wrapped,n),ue(i,r)}}let j=/* @__PURE__ */ new Set,M=/* @__PURE__ */ new WeakMap,N=/* @__PURE__ */ new Set,P=/* @__PURE__ */ new WeakMap;function ge(e,t){let n=M.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);j.add(r),M.set(e,{ref:r,info:t})}function _e(e,t){let n=P.get(e);if(n){n.info=t;return}let r=new WeakRef(e);N.add(r),P.set(e,{ref:r,info:t})}function ve(e){j.delete(e)}function ye(e){N.delete(e)}function be(e){let t=M.get(e);t&&(j.delete(t.ref),M.delete(e))}function xe(e){let t=P.get(e);t&&(N.delete(t.ref),P.delete(e))}let Se=/* @__PURE__ */ new WeakMap,F=/* @__PURE__ */ new Set,Ce=/* @__PURE__ */ new WeakMap,we=typeof FinalizationRegistry<`u`?new FinalizationRegistry(e=>{F.delete(e)}):null;function Te(e,t){if(Se.set(e,t),Ce.has(e))return;let n=new WeakRef(e);F.add(n),Ce.set(e,n),we?.register(e,n,n)}function Ee(e){Se.delete(e);let t=Ce.get(e);t&&(F.delete(t),we?.unregister(t),Ce.delete(e))}function De(){let e=[];for(let t of F){let n=t.deref();n===void 0?F.delete(t):e.push(n)}return e}function Oe(e){return Se.get(e)??null}let ke=`http://www.w3.org/2000/svg`;function Ae(e){return globalThis.document?document.createElement(e):null}function je(e,t){return globalThis.document?document.createElementNS(e,t):null}function I(e){return globalThis.document?document.createTextNode(e):null}function Me(){return globalThis.document?document.createDocumentFragment():null}function Ne(e,t){try{return e.appendChild(t),!0}catch(e){return c(`Failed to append child node`,e),!1}}function Pe(e){if(e.nodeType===Node.ELEMENT_NODE){let t=e;de(t),xe(t),Ee(t)}else e.nodeType===Node.TEXT_NODE?be(e):e.nodeType===Node.COMMENT_NODE&&Ee(e);let t=le()?Array.from(e.childNodes):e.childNodes;for(let e=0;e<t.length;e++)Pe(t[e]);e.nodeType===Node.ELEMENT_NODE&&ce(e)}function Fe(e){if(!le())return;let t=Array.from(e.childNodes);for(let e=0;e<t.length;e++)Fe(t[e]);e.nodeType===Node.ELEMENT_NODE&&ce(e)}function L(e){if(!e?.parentNode)return!1;try{return Pe(e),e.parentNode?.removeChild(e),!0}catch(e){return c(`Failed to remove child node`,e),!1}}function Ie(e,t,n){try{return e.insertBefore(t,n),!0}catch(e){return c(`Failed to insert node before reference`,e),!1}}function R(e){return globalThis.document?globalThis.document.createComment(e):null}function Le(e,t=`hidden`){return globalThis.document?globalThis.document.createComment(`conditional-${e}-${t}`):null}function Re(e,t){let n=R(`${e}-end`);if(!n)throw Error(`Failed to create comment: document not available`);let r=R(`${e}-start-${t}`);if(!r)throw Error(`Failed to create comment: document not available`);return{start:r,end:n}}function ze(e,t){let n=e.nextSibling;for(;n&&n!==t;){let e=n.nextSibling;L(n),n=e}}function Be(e,t){let n=t.parentNode;if(n)for(let r=0;r<e.length;r++)Ie(n,e[r],t)}function Ve(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=I(r);if(e)t=e;else continue}else t=r;Ne(e,t)}}return e}function z(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 c(`Error replacing conditional node`,e),!1}}function Ue(e){return e}function We(e,t,n){let r=Ue(e),i=Object.getOwnPropertyDescriptor(r,`appendChild`),a=r.insertBefore;r.appendChild=function(e){return a.call(r,e,t)};try{return n()}finally{i?Object.defineProperty(r,"appendChild",i):Reflect.deleteProperty(r,`appendChild`)}}function Ge(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}}let Ke={},qe=!1;function Je(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=P.get(n);e&&(z(n)?$e(e.info):(ye(e.ref),P.delete(n)))}n=n.parentNode}}function Ye(){qe||typeof document<`u`&&typeof document.addEventListener==`function`&&(document.addEventListener(`update`,Je,!0),qe=!0)}function Xe(e){let t=P.get(e);if(t)return t.info;let n={attributeResolvers:[]};return _e(e,n),n}function Ze(e){return typeof e!=`object`||!e}function Qe(e){let t;try{t=e.resolver()}catch(t){c(`Failed to resolve reactive attribute: ${e.key}`,t);return}let n=Ze(t);if(!(n&&Object.is(t,e.lastValue)))try{e.applyValue(t),e.lastValue=n?t:Ke}catch(t){c(`Failed to apply reactive attribute: ${e.key}`,t)}}function $e(e){let t=e.attributeResolvers;for(let e=0;e<t.length;e++)Qe(t[e])}function et(e,t,n,r){if(!(e instanceof Element)||!t||typeof n!=`function`){c(`Invalid parameters for registerAttributeResolver`);return}let i={key:t,resolver:n,applyValue:r,lastValue:Ke};if(!l){Qe(i);return}Ye();let a=Xe(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),Qe(i)}function tt(e){for(let t of N){let n=t.deref();if(n===void 0){ye(t);continue}let r=P.get(n);if(!r){ye(t);continue}if(!z(n)){P.delete(n),ye(t);continue}(!e||e.contains(n))&&$e(r.info)}}function nt(e,t){if(e?.style&&t)for(let n in t)Ge(e,n,t[n])||c(`Failed to set style property '${n}'`)}function rt(e,t){e&&(o(t)?et(e,`style`,t,function(t){nt(e,t)}):nt(e,t))}let it=/* @__PURE__ */ new Set([`onMount`,`onDestroy`]),at=/* @__PURE__ */ new WeakMap;function ot(e){if(e.length<=2||e.charCodeAt(0)!==111||e.charCodeAt(1)!==110)return null;let t=e.charCodeAt(2);return t<65||t>90||it.has(e)?null:e===`onDoubleClick`?`ondblclick`:e.toLowerCase()}function st(e,t,n){if(t in e){e[t]=n;return}let r=t.slice(2),i=at.get(e);if(i){for(let t=0;t<i.length;t+=2){if(i[t]!==r)continue;let a=i[t+1];if(a===n)return;e.removeEventListener(r,a),e.addEventListener(r,n),i[t+1]=n;return}e.addEventListener(r,n),i.push(r,n);return}e.addEventListener(r,n),at.set(e,[r,n])}let B=/* @__PURE__ */ new WeakMap,ct=/* @__PURE__ */ new WeakSet;function V(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 lt(e){let t=``;for(let n of e)t&&(t+=` `),t+=n;return t}function ut(e){if(e.className&&!B.has(e)){let t=/* @__PURE__ */ new Set;V(t,e.className),B.set(e,t)}ct.add(e)}function dt(e){return ct.has(e)}function ft(e,t){if(!t)return;let n=B.get(e);n||(n=/* @__PURE__ */ new Set,B.set(e,n)),V(n,t)}function pt(e,t){let n=B.get(e);if(!n||n.size===0){let n=t||``;e.className!==n&&(e.className=n);return}if(!t){e.className=lt(n);return}let r=lt(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 mt(e,t){if(!t)return;let n=e.className;if(n&&n!==t){let r=/* @__PURE__ */ new Set;V(r,n),V(r,t),e.className=lt(r)}else e.className=t}function ht(e,t,n){if(typeof e!=`function`){c(`Invalid resolver provided to createReactiveTextNode`);let e=I(``);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){c(`Failed to evaluate reactive text resolver`,e),r=``}let i=r===void 0?``:String(r),a=I(i);if(!a)throw Error(`Failed to create text node: document not available`);return l&&ge(a,{resolver:e,lastValue:i,sanitize:n}),a}function gt(e){for(let t of j){let n=t.deref();if(n===void 0){ve(t);continue}let r=M.get(n);if(!r){ve(t);continue}let i=r.info;if(!z(n)){M.delete(n),ve(t);continue}if(e&&!e.contains(n))continue;let a;try{a=i.resolver()}catch(e){c(`Failed to update reactive text node`,e),a=void 0}let o=i.sanitize?a==null||typeof a==`object`||typeof a==`function`?``:String(a):a===void 0?``:String(a);o!==i.lastValue&&(n.textContent=o,i.lastValue=o)}}function _t(e,t,n,r){if(n!=null){if(r&&t===`className`&&e instanceof HTMLElement){mt(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 vt(e,t,n,r=!1){if(n==null)return;let i=t;if(i===`style`){rt(e,n);return}if(o(n)){if(i===`onMount`){ne(e,n);return}if(i===`onDestroy`){re(e,n);return}if(i===`onClick`){e.onclick=n;return}if(i.charCodeAt(0)===111&&i.charCodeAt(1)===110){let t=ot(i);if(t){st(e,t,n);return}if(i in e){e[i]=n;return}}if(n.length===0){let t=n;i===`className`&&e instanceof HTMLElement?(ut(e),et(e,i,t,function(t){pt(e,String(t||``))})):et(e,i,t,function(t){_t(e,i,t,!1)});return}}if(i===`className`&&e instanceof HTMLElement&&dt(e)){let t=String(n||``);t&&(ft(e,t),mt(e,t));return}_t(e,i,n,r)}function H(e,t,n=!0){if(t)for(let r in t){let i=r,a=t[r];vt(e,i,a,n&&i===`className`)}}let U=/* @__PURE__ */ new WeakMap;function yt(e){return r(e)&&!n(e)&&`className`in e&&typeof e.className==`string`&&Object.keys(e).length===1}function bt(e){y(e);let t=g(e);return!!t&&t.nodeType===8&&t.textContent?.trimStart().startsWith(`text-`)===!0}function xt(e,t){let n=g(e);if(n&&n.nodeType===3)return b(e),n.textContent!==t&&(n.textContent=t),n;let r=I(t);return r?(e.insertBefore(r,n),_(e,n),r):null}function W(e,i,a){if(i==null)return null;if(o(i)){if(s(i))try{let n=U.get(i);if(n||(n={value:i(),error:!1},U.set(i,n)),n.error)return Ct(a,()=>``);let r=n.value;if(yt(r))return H(e,{className:()=>{let e=i();return yt(e)?e.className:``}}),null;if(t(r)){let t=i,n=r??``;if(f()&&bt(e)){let r=e;b(r);let i=String(n),a=xt(r,i);return a&&ge(a,{resolver:t,lastValue:i,sanitize:!0}),null}return Ct(a,t,n,!0)}return null}catch(e){return U.set(i,{value:void 0,error:!0}),c(`Error evaluating reactive text function:`,e),Ct(a,()=>``)}let o=i(e,a);return o==null?null:t(o)?wt(a,o):n(o)?o:(r(o)&&H(e,o),null)}let l=i;if(t(l)){if(f()&&bt(e)){let t=e;return b(t),xt(t,String(l)),null}return wt(a,l)}return n(l)?l:(H(e,l),null)}function St(e,t){if(l&&!f()&&!p())return t;let n=Me();if(!n)throw Error(`Failed to create document fragment: document not available`);let r=R(` text-${e} `);return r&&n.appendChild(r),t&&n.appendChild(t),n}function Ct(e,t,n,r){return St(e,ht(t,n,r))}function wt(e,t){return St(e,I(String(t)))}let Tt=Symbol(`nuclo.factory.tag`),Et=Symbol(`nuclo.factory.mods`),Dt=0,G=[],K=0;function Ot(){return K>=G.length&&G.push(()=>null),G[K++]}function kt(e,t,n){e[Tt]=t,e[Et]=n}function q(e){return typeof e==`function`?e[Et]:void 0}function J(e){return typeof e==`function`?e[Tt]:void 0}function At(){return Dt>0}function jt(e,t,n){Dt++;try{return e(t,n)}finally{Dt--}}function Mt(){return K}function Nt(e){for(;K>e;){let e=G[--K];e[Tt]=void 0,e[Et]=void 0}}function Pt(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=W(e,a,r);o&&(o.parentNode!==i&&i.appendChild(o),r+=1)}}function Ft(e,t){let n=Ae(e);if(!n)throw Error(`Failed to create element: ${e}`);return Pt(n,t,0),n}function It(e,t){let n=je(ke,e);if(!n)throw Error(`Failed to create SVG element: ${e}`);return Pt(n,t,0),n}function Lt(e,t){if(At()){let n=Ot();return kt(n,e,t),n}let n=function(n,r=0){let i=n,a=i?x(i,e):null,o=a??Ae(e);if(!o)throw Error(`Failed to create element: ${e}`);let s=o,c=a?s.lastChild:null;return Pt(o,t,r),a&&S(s,c),o};return kt(n,e,t),n}function Rt(e,t){if(At()){let n=Ot();return kt(n,e,t),n}return function(n,r=0){let i=n,a=i?x(i,e):null,o=a??je(`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 Pt(o,t,r),a&&S(s,c),o}}function zt(e){return(...t)=>Lt(e,t)}function Bt(e){return(...t)=>Rt(e,t)}let Vt=/* @__PURE__ */ `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=/* @__PURE__ */ `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(`.`),Ut=[`area`,`base`,`br`,`col`,`embed`,`hr`,`img`,`input`,`link`,`meta`,`source`,`track`,`wbr`];function Wt(e,t,n,r){Object.defineProperty(e,t,{configurable:!0,enumerable:!0,get(){let i=r(n);return Object.defineProperty(e,t,{value:i,configurable:!0,enumerable:!0,writable:!0}),i},set(n){Object.defineProperty(e,t,{value:n,configurable:!0,enumerable:!0,writable:!0})}})}function Gt(e,t){t in e&&typeof e[t]!=`function`||(Wt(e,t,t,zt),t===`var`&&Wt(e,`var_`,t,zt))}function Kt(e,t){let n=`${t}Svg`;n in e||Wt(e,n,t,Bt)}function qt(e=globalThis){let t=`__nuclo_tags_registered`;if(!e[t]){for(let t=0;t<Ht.length;t++)Kt(e,Ht[t]);for(let t=0;t<Vt.length;t++)Gt(e,Vt[t]);e[t]=!0}}function Jt(e,t,n){if(o(e)){let r=e(t,n);return r&&i(r)?r:null}return e&&i(e)?e:null}function Yt(e,t){let r=[],i=0;for(let e=0;e<t.length;e++){let a=t[e];if(a==null){r.push({kind:4});continue}let o=typeof a;if(o===`function`){let e=q(a);if(e!==void 0){let t=J(a);if(!t)return null;let n=Yt(t,e);if(!n)return null;r.push({kind:3,child:n});continue}if(a.length===0){let e;try{e=a(),U.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(n(a))return null;let e=a,t=Object.keys(e),o=[];for(let n=0;n<t.length;n++){let r=t[n],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`){let e=ot(r);if(e){o.push({key:r,kind:1,prop:!1,value:e});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 Xt(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;Xt(i.child,r),r=r.nextSibling}}}function Zt(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;let e=a.value;e===`onclick`?n.onclick=o:st(n,e,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}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||q(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=q(s);if(e===void 0||J(s)!==o.child.tag||!a||!Zt(o.child,e,a,r))return!1;a=a.nextSibling;break}case 4:if(s!=null)return!1}}return!0}function Qt(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;xe(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;be(e),r.push({kind:0,node:e,fn:s,last:e.nodeValue??``}),a=e.nextSibling;break}case 3:{let e=q(s);if(e===void 0||J(s)!==o.child.tag||!a||!Qt(o.child,e,a,r))return!1;a=a.nextSibling;break}case 4:if(s!=null)return!1}}return!0}function $t(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 en(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}let tn=/* @__PURE__ */ new Set,nn=/* @__PURE__ */ new WeakMap,rn=typeof FinalizationRegistry<`u`?new FinalizationRegistry(e=>{tn.delete(e)}):null,an=0;function on(e,t){let n=new WeakRef(e);tn.add(n),nn.set(e,t),rn?.register(e,n)}function sn(e){return Array.isArray(e)?e:Array.from(e)}function cn(e){if(typeof e!=`object`||!e)return!1;let t=e.element;return!!t&&typeof Node<`u`&&t instanceof Node}function ln(e,t,n){let r=e.renderItem(t,n);return cn(r)?(e.lastRenderRefresh=typeof r.update==`function`?r.update:null,r.element):Jt(r,e.host,n)}function un(e,t,n){let r=Mt();try{return dn(e,t,n)}finally{Nt(r)}}function dn(e,t,n){e.lastRenderLeaves=null,e.lastRenderRefresh=null;let r=e.template,i=l&&!f()&&!p(),a=r&&i?jt(e.renderItem,t,n):e.renderItem(t,n);if(cn(a))return e.lastRenderRefresh=typeof a.update==`function`?a.update:null,a.element;if(r!==null&&i){let i=q(a);if(i!==void 0){if(r===void 0){let t=J(a),r=t?Yt(t,i):null,o=Jt(a,e.host,n);if(r&&o){let t=o.cloneNode(!0);Xt(r,t);let n=[];if(Qt(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 J(a)===r.tmpl.tag&&Zt(r.tmpl,i,o,s)?(s.length>0&&(e.lastRenderLeaves=s),o):(e.template=null,ln(e,t,n))}if(r===void 0)e.template=null;else return e.template=null,ln(e,t,n)}return Jt(a,e.host,n)}function fn(e){L(e.element)}function pn(e,t,n,r){if(n.parentNode!==t||r.parentNode!==t)return!1;if(le())for(let t=0;t<e.length;t++){let n=e[t].element;n&&Fe(n)}if(l&&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 mn(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 hn(e,t,n,r,i,a,o){let s=Me(),c=0;for(let l=r;l<i;l++){let r=n[l],i=un(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}),e.lastRenderLeaves=null,e.lastRenderRefresh=null;let d=i;s?(s.appendChild(d),c++):t.insertBefore(d,a)}s&&c>0&&t.insertBefore(s,a)}function gn(e){let{startMarker:t,endMarker:n}=e,r=t.parentNode??e.host,i=sn(e.itemsProvider());if(en(e.lastSyncedItems,i))return;let a=e.records,o=a.length,s=i.length;if(s===0){if(o>0&&!pn(a,r,t,n))for(let e=0;e<o;e++)fn(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)hn(e,r,i,m,h,t,a),e.allRecordsCreatedAt=o===0?e.currentFlushEpoch:void 0;else{let n=[];hn(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++)fn(a[e]);a.splice(f,p-f),e.allRecordsCreatedAt=void 0,e.lastSyncedItems=i.slice();return}let ee=p-f,g=h-m,_=Array(g).fill(-1),v=new Uint8Array(ee),y=0,b=Math.min(p,h);for(let e=c;e<b;e++)a[e].item===i[e]&&(_[e-m]=e,v[e-f]=1,y++);let x=/* @__PURE__ */ new Map;for(let e=p-1;e>=f;e--){if(v[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<g;e++){if(_[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.pop(),t.length===0&&x.delete(i[m+e])),_[e]=n,v[n-f]=1,y++}if(y===0&&f===0&&p===o){if(!pn(a,r,t,n))for(let e=0;e<o;e++)fn(a[e]);let c=[];hn(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++)v[e-f]||fn(a[e]);let S=null;if(y>0){let e=[],t=[];for(let n=0;n<g;n++)_[n]!==-1&&(e.push(_[n]),t.push(n));S=new Uint8Array(g);let n=mn(e);for(let e=0;e<n.length;e++)S[t[n[e]]]=1}let C=Array(g),w=0,T=p<o?a[p].element:n,E=null;for(let t=g-1;t>=0;t--){let n=_[t];if(n===-1){let n=i[m+t],a=un(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},e.lastRenderLeaves=null,e.lastRenderRefresh=null;let s=a;E||=Me(),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+(g-w)+(o-p)),O=0;for(let e=0;e<f;e++)D[O++]=a[e];for(let e=0;e<g;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 _n(e,t,n,r){return f()?yn(e,t,n,r):vn(e,t,n,r)}function vn(e,t,n,r){let{start:i,end:a}=Re(`list`,r),o={itemsProvider:e,renderItem:t,startMarker:i,endMarker:a,records:[],host:n,lastSyncedItems:[]},s=n;return s.appendChild(i),s.appendChild(a),gn(o),l&&on(i,o),o}function yn(e,t,n,r){let i=n;y(i);let a=g(i);if(!a||a.nodeType!==8||!a.textContent?.startsWith(`list-start-`))return vn(e,t,n,r);let o=b(i),s=0,c=g(i);for(;c;){if(c.nodeType===8){let e=c.textContent||``;if(e.startsWith(`list-start-`))s++;else if(e===`list-end`){if(s===0)break;s--}}c=c.nextSibling}let u=c;if(!u){let e=R(`list-end`);e&&(i.insertBefore(e,o.nextSibling),u=e)}if(!u)return vn(e,t,n,r);let d=sn(e()),f=[];for(let e=0;e<d.length;e++){let r=t(d[e],e),i=cn(r)?r:null,a=i?i.element:Jt(r,n,e);a&&f.push({item:d[e],element:a,refresh:i&&typeof i.update==`function`?i.update:void 0})}let p=g(i);for(;p&&p!==u;){let e=p.nextSibling;L(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}_(i,u.nextSibling);let h={itemsProvider:e,renderItem:t,startMarker:o,endMarker:u,records:f,host:n,lastSyncedItems:d.slice()};return l&&on(o,h),h}function bn(e){e.template=null,e.lastRenderLeaves=null,e.lastRenderRefresh=null;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 xn(e){let t=[];an++;for(let n of tn){let r=n.deref();if(!r){t.push(n);continue}let i=nn.get(r);if(!i){t.push(n);continue}if(!z(r)||!z(i.endMarker)){bn(i),nn.delete(r),t.push(n);continue}if(e&&!e.contains(r))continue;i.currentFlushEpoch=an;try{gn(i)}finally{i.currentFlushEpoch=void 0}if(i.allRecordsCreatedAt===an)continue;let a=i.records;for(let e=0;e<a.length;e++){if(a[e].dynCreatedAt===an)continue;let t=a[e].refresh;t&&t();let n=a[e].dyn;n&&$t(n)}}for(let e of t)tn.delete(e)}function Sn(e,t){return function(n,r){return _n(e,t,n,r).startMarker}}function Cn(e,t){try{return e()}catch(e){if(t)return t(e),!1;throw e}}function wn(e,t){return typeof e==`function`?Cn(e,t):!!e}let Tn=/* @__PURE__ */ new Set,En=/* @__PURE__ */ new WeakMap,Dn=typeof FinalizationRegistry<`u`?new FinalizationRegistry(e=>{Tn.delete(e)}):null;function On(e,t){for(let t=0;t<e.length;t++)if(wn(e[t].condition))return t;return t.length>0?-1:null}function kn(e){let{groups:t,elseContent:n,host:r,index:i,endMarker:a}=e,o=On(t,n);o===e.activeIndex||(ze(e.startMarker,e.endMarker),e.activeIndex=o,o===null)||Be(Nn(o>=0?t[o].content:n,r,i,a),a)}function An(e){let t=new WeakRef(e.startMarker);Tn.add(t),En.set(e.startMarker,e),Dn?.register(e.startMarker,t)}function jn(e){let t=[];for(let n of Tn){let r=n.deref();if(r===void 0){t.push(n);continue}let i=En.get(r);if(!i){t.push(n);continue}if(!z(r)||!z(i.endMarker)){En.delete(r),t.push(n);continue}if(!e||e.contains(r))try{i.update()}catch(e){c(`when() branch threw during update; unregistering this conditional`,e),En.delete(r),t.push(n)}}for(let e of t)Tn.delete(e)}function Mn(e,t,n,r){return o(e)?s(e)?(U.delete(e),W(t,e,n)):We(t,r,()=>{let r=W(t,e,n);return r&&!r.parentNode?r:null}):W(t,e,n)}function Nn(e,t,n,r){let i=[];for(let a of e){let e=Mn(a,t,n,r);e&&i.push(e)}return i}function Pn(e,t){return`when-start-${e}-b${t===null?`n`:t}`}function Fn(e){let t=/-b(n|-?\d+)$/.exec(e||``);if(t)return t[1]===`n`?null:parseInt(t[1],10)}var In=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}=Re(`when`,t),i=this.createRuntimeFromMarkers(e,t,n,r),a=Ue(e);return a.appendChild(n),a.appendChild(r),kn(i),n.textContent=Pn(t,i.activeIndex),n}hydrateRender(e,t){let n=e;y(n);let r=g(n);if(!r||r.nodeType!==8||!r.textContent?.startsWith(`when-start-`))return this.freshRender(e,t);let i=b(n),a=0,o=g(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=R(`when-end`);if(!e)return i;n.insertBefore(e,i.nextSibling),s=e,c=!0}let l=On(this.groups,this.elseContent),u=Fn(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)W(e,r,t)}}else if(ze(i,s),l!==null){let n=l>=0?this.groups[l].content:this.elseContent,r=s;ee(()=>{Be(Nn(n,e,t,r),r)})}return _(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(){kn(a)}};return l&&An(a),a}};function Ln(e){return Object.assign(function(t,n){return e.render(t,n)},{when:function(t,...n){return Ln(e.cloneWith({condition:t,content:n}))},else:function(...t){return Ln(e.cloneWith(void 0,t))}})}function Rn(e,...t){return Ln(new In(e,...t))}function zn(e){try{return e.isSvg?It(e.tagName,e.modifiers):Ft(e.tagName,e.modifiers)}catch(t){if(c(`Error applying modifiers in conditional element "${e.tagName}"`,t),e.isSvg){let n=je(ke,e.tagName);if(!n)throw Error(`Failed to create SVG element: ${e.tagName}`,{cause:t});return n}let n=Ae(e.tagName);if(!n)throw Error(`Failed to create element: ${e.tagName}`,{cause:t});return n}}function Bn(e){let t=Oe(e);if(!t)return;let n=Cn(t.condition,e=>{c(`Error evaluating conditional condition`,e)}),r=e.nodeType===Node.ELEMENT_NODE;if(n&&!r){let n=zn(t);Te(n,t),He(e,n)}else if(!n&&r){let n=Le(t.tagName);n&&(Fe(e),Te(n,t),He(e,n))}}function Vn(e){if(l)try{let t=De();for(let n of t){if(!n.isConnected){Ee(n);continue}(!e||e.contains(n))&&Bn(n)}}catch(e){c(`Error during conditional elements update`,e)}}let Hn=/* @__PURE__ */ new Map;function Un(e){let t=[],n=/* @__PURE__ */ 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 Wn(e,t){let n=Hn.get(e);n||(n=/* @__PURE__ */ new Set,Hn.set(e,n)),n.add(new WeakRef(t))}function Gn(e){let t=Un(e);if(t.length===0)return[];let n=/* @__PURE__ */ new Set;for(let e of t){let t=Hn.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(!z(t)){r.push(e);continue}n.add(t)}for(let e of r)t.delete(e);t.size===0&&Hn.delete(e)}return Array.from(n)}function Kn(...e){let t=Un(e);return function(e){if(l&&e instanceof Element)for(let n of t)Wn(n,e)}}let qn=[xn,jn,Vn,tt,gt,Yn];function Jn(...e){let t;if(e.length>0){let n=Gn(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 qn)e(t);se()}function Yn(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){c(`Error dispatching global update event`,e)}}function Xn(e,t,n=0){let r=t||document.body,i=e(r,n);return r.appendChild(i),se(),i}function Zn(e,t){let n=t||document.body,r=n;m();let i;try{i=e(n,0);let t=i;if(t&&t.nodeType===1&&t.parentNode!==r){let e=g(r);if(e){let n=e.nextSibling;r.insertBefore(t,e),L(e),_(r,n)}else r.appendChild(t),_(r,null)}}finally{h()}return se(),i}function Qn(){return{ssrCollector:null,atomCache:/* @__PURE__ */ new Map,atomMeta:/* @__PURE__ */ new Map,rawKeys:/* @__PURE__ */ new Set,baseRules:[],queryRules:/* @__PURE__ */ new Map,styleEpoch:0,cssTextCache:null,sheet:null,sheetDocument:null,baseRuleCount:0,groupRules:/* @__PURE__ */ new Map,externalRules:null,hasExternalGroups:!1}}let $n=Symbol.for(`nuclo.style.engine.v1`),er=globalThis,tr;function Y(){return tr??=er[$n]??(er[$n]=Qn())}function nr(e){let t=Y();t.ssrCollector=e}function rr(e){for(let t of e){let e=Y();e.queryRules.has(t)||e.queryRules.set(t,[])}}function ir(e,t){let n=Y();try{let r=e.cssRules.length;e.insertRule(t+`{}`,r);let i=e.cssRules[r];return n.groupRules.set(t,i),n.groupRules.set(X(i),i),i}catch{return null}}let ar=/* @__PURE__ */ new WeakMap;function X(e){let t=ar.get(e);if(t!==void 0)return t;let n=e.cssText,r=n.indexOf(`{`),i=(r===-1?n:n.slice(0,r)).trim();return ar.set(e,i),i}function or(e){return e instanceof CSSStyleRule?e.selectorText:X(e)}function sr(e,t){return(e===void 0?`-`:`+`+e.length+`:`+e)+t.length+`:`+t}function cr(e,t){let n=Y();if(!n.externalRules)return;let r=sr(t,or(e)),i=n.externalRules.get(r);i||(i=/* @__PURE__ */ new Set,n.externalRules.set(r,i)),i.add(e.cssText)}function lr(e,t){let n=Y();if(!n.externalRules)return!1;let r=sr(t,or(e)),i=n.externalRules.get(r);return i?.delete(e.cssText)?(i.size===0&&n.externalRules.delete(r),n.externalRules.size===0&&(n.externalRules=null),!0):!1}function ur(e){let t=Y();for(let n=0;n<e.length;n++){let r=e[n];if(r instanceof CSSStyleRule){cr(r,void 0);continue}let i=X(r);if(`cssRules`in r&&!i.startsWith(`@keyframes`)){let e=r;t.hasExternalGroups=!0,t.groupRules.set(i,e);for(let t=0;t<e.cssRules.length;t++)cr(e.cssRules[t],i)}else cr(r,void 0)}}function dr(e,t){let n=Y();try{e.insertRule(t,n.baseRuleCount);let r=e.cssRules[n.baseRuleCount];if(lr(r,void 0)){e.deleteRule(n.baseRuleCount);return}n.baseRuleCount++}catch{}}function fr(e,t){let n=Y();try{let r=e.cssRules.length;e.insertRule(t,r);let i=e.cssRules[r];n.externalRules&&lr(i,X(e))&&e.deleteRule(r)}catch{}}function pr(e,t){let n=Y(),r=n.groupRules.get(t);if(r)return r;if(!n.hasExternalGroups)return ir(e,t);try{let r=e.cssRules.length;e.insertRule(t+`{}`,r);let i=X(e.cssRules[r]);e.deleteRule(r);let a=n.groupRules.get(i);if(a)return n.groupRules.set(t,a),a}catch{return null}return ir(e,t)}function Z(){let e=Y();if(typeof document>`u`||typeof document.getElementById!=`function`)return null;if(e.sheet&&e.sheetDocument===document&&e.sheet.ownerNode&&e.sheet.ownerNode.isConnected)return e.sheet;let t=document.getElementById(`nuclo-styles`),n;if(t?.tagName===`STYLE`?n=t:(n=document.createElement(`style`),n.id=`nuclo-styles`,t?t.replaceWith(n):document.head.appendChild(n)),e.sheet=n.sheet,e.sheetDocument=document,e.groupRules.clear(),e.baseRuleCount=0,e.externalRules=null,e.hasExternalGroups=!1,!e.sheet)return null;if(e.sheet.cssRules.length>0){let t=0;for(;t<e.sheet.cssRules.length;){let n=e.sheet.cssRules[t];if(!(n instanceof CSSStyleRule)&&`cssRules`in n&&!X(n).startsWith(`@keyframes`))break;t++}e.baseRuleCount=t,e.externalRules=/* @__PURE__ */ new Map,ur(e.sheet.cssRules)}for(let t of e.baseRules)dr(e.sheet,t);for(let[t,n]of e.queryRules){let r=pr(e.sheet,t);if(r)for(let e of n)fr(r,e)}return e.sheet}function mr(e,t){let n=Y(),r=Z();if(t===void 0)n.baseRules.push(e);else{let r=n.queryRules.get(t);r||(r=[],n.queryRules.set(t,r)),r.push(e)}if(n.cssTextCache=null,r){if(t===void 0)dr(r,e);else{let n=pr(r,t);n&&fr(n,e)}}n.ssrCollector?.(t===void 0?e:t+`{`+e+`}`)}function hr(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 gr(e,t){return(e===void 0?`-`:`+`+e.length+`:`+e)+t.length+`:`+t}function _r(e,t){return e+t.length+`:`+t}function vr(e,t){let n=``,r=0;for(let i=0;i<e.length;i++){let a=e.charCodeAt(i);if(a===92&&i+1<e.length){n+=e[i]+e[++i];continue}if(r!==0){n+=e[i],a===r&&(r=0);continue}a===34||a===39?(r=a,n+=e[i]):n+=a===38?t:e[i]}return n}function yr(e,t){let n=`.`+e;return n+vr(t,n)}function br(e){if(e.length===0||e===`-`)return!1;for(let t=0;t<e.length;t++){let n=e.charCodeAt(t);if(!(n>=97&&n<=122||n>=65&&n<=90||n===45||n===95||t>0&&n>=48&&n<=57))return!1}if(e.charCodeAt(0)===45&&e.length>1){let t=e.charCodeAt(1);if(t>=48&&t<=57)return!1}return!0}function xr(e,t,n,r,i=!1){let a=Y(),o=gr(e,t);for(let[e,t]of n)o=_r(_r(o,e),t);r!==void 0&&!br(r)&&(console.warn(`[nuclo] css() name ${JSON.stringify(r)} is not a valid CSS class name (letters, digits, - and _ only, not starting with a digit); falling back to a generated name.`),r=void 0);let s=r===void 0?`a`+o:`n`+_r(``,r)+o,c=a.atomCache.get(s);if(c!==void 0)return Z(),c;r===void 0?c=`n`+hr(s):(c=i?r:r+`-`+hr(s),a.atomMeta.has(c)&&console.warn(`[nuclo] css() name ${JSON.stringify(c)} is already used by a different style. Both rules are emitted under the same class, so they will override each other — rename one.`));let l=``;for(let[e,t]of n)l+=(l?`;`:``)+e+`:`+t;return a.atomCache.set(s,c),a.atomMeta.set(c,{query:e,suffix:t,decls:n,name:r}),mr(yr(c,t)+`{`+l+`}`,e),c}function Sr(e,t,n,r,i=!1){return xr(e,t,n,r,i)}function Cr(e,t){let n=Y(),r=n.atomMeta.get(e),i=n.atomMeta.get(t);if(!r||!i)return t;let a=[...r.decls,...i.decls],o=/* @__PURE__ */ new Map;for(let e=0;e<a.length;e++)o.set(a[e][0],e);let s=a.filter((e,t)=>o.get(e[0])===t);return xr(r.query,r.suffix,s,r.name??i.name)}function wr(e){let t=Y().atomMeta.get(e);return t===void 0?void 0:gr(t.query,t.suffix)}function Tr(){return(tr??er[$n])?.styleEpoch??0}function Er(e,t){let n=Y();if(n.rawKeys.has(e)){Z();return}n.rawKeys.add(e),mr(t,void 0)}function Dr(){let e=Y();if(e.cssTextCache!==null)return e.cssTextCache;let t=e.baseRules.join(``);for(let[n,r]of e.queryRules)r.length>0&&(t+=n+`{`+r.join(``)+`}`);return e.cssTextCache=t,t}function Or(){let e=Y();e.atomCache.clear(),e.atomMeta.clear(),e.rawKeys.clear(),e.baseRules.length=0,e.queryRules.clear(),e.groupRules.clear(),e.cssTextCache=null,e.baseRuleCount=0,e.sheet=null,e.sheetDocument=null,e.externalRules=null,e.hasExternalGroups=!1,e.styleEpoch++,typeof document<`u`&&document.getElementById(`nuclo-styles`)?.remove()}let kr={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`},Ar={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`]},jr={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`}},Mr={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`},Nr=/* @__PURE__ */ 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`]),Pr=/* @__PURE__ */ new Map;function Fr(e){if(!/[A-Z]/.test(e))return e;let t=Pr.get(e);return t===void 0&&(t=e.replace(/[A-Z]/g,e=>`-`+e.toLowerCase()),Pr.size>=512&&Pr.clear(),Pr.set(e,t)),t}function Ir(e){return e.charCodeAt(0)===64?e:`@media `+e}function Lr(e,t){return e!==void 0&&e.startsWith(`@media`)&&t.startsWith(`@media`)?e+` and`+t.slice(6):t}function Rr(e,t){for(let n in t){let r=t[n],i=e[n];e[n]=typeof r==`object`&&r&&!Array.isArray(r)&&typeof i==`object`&&i&&!Array.isArray(i)?Rr({...i},r):r}return e}var zr=class{className;constructor(e){this.className=e}toString(){return this.className}};function Q(e){return new zr(e)}function Br(e,t){let n=wr(t);if(n===void 0){e.set(t,t);return}let r=e.get(n);r===void 0||r===t?e.set(n,t):e.set(n,Cr(r,t))}function Vr(e,t){let n=0;for(let r=0;r<=e.length;r++){let i=r===e.length?32:e.charCodeAt(r);(i===32||i===9||i===10||i===12||i===13)&&(r>n&&Br(t,e.slice(n,r)),n=r+1)}}function Hr(e,t){for(let n of e)n&&(typeof n==`string`?Vr(n,t):Array.isArray(n)?Hr(n,t):Vr(n.className,t))}function Ur(e){let t=/* @__PURE__ */ new Map;Hr(e,t);let n=``;for(let e of t.values())n+=(n?` `:``)+e;return n}let Wr=/* @__PURE__ */ new WeakMap;function Gr(e){return!!e&&typeof e==`object`&&!Array.isArray(e)}function Kr(...e){if(e.length===0)return Q(``);if(e.length===1){let t=e[0];if(!t)return Q(``);if(!Array.isArray(t)){let e=typeof t==`string`?t:t.className;if(!/[\t\n\f\r ]/.test(e))return Q(e)}}if(e.length===2&&Gr(e[0])&&Gr(e[1])){let t=e[0],n=e[1],r=Tr(),i=Wr.get(t),a=i?.get(n);if(a!==void 0&&a.epoch===r&&a.first===e[0].className&&a.second===e[1].className)return Z(),a.result;let o=Q(Ur(e)),s=i??/* @__PURE__ */ new WeakMap;return s.set(n,{epoch:r,first:e[0].className,second:e[1].className,result:o}),i||Wr.set(t,s),o}return Q(Ur(e))}function qr(e={}){let t=e.screens??{};rr(Object.values(t).map(Ir));let n=/* @__PURE__ */ new WeakMap;function r(t,n){if(typeof n==`number`)return n===0||Nr.has(t)?String(n):n+`px`;let r=Mr[t];if(r!==void 0){let t=e[r]?.[n];if(t!==void 0)return t}return n}function i(e,t,n){let r=(t===void 0?`-`:`+`+t.length+`:`+t)+n.length+`:`+n,i=e.get(r);return i||(i={query:t,suffix:n,decls:[]},e.set(r,i)),i}function a(e,n,o,s){for(let c in e){let l=e[c];if(l==null||l===!1)continue;if(typeof l==`object`){if(c===`raw`){let e=l,t=i(s,n,o).decls;for(let n in e)t.push([n,r(n,e[n])]);continue}let e=kr[c];if(e!==void 0){a(l,n,o+e,s);continue}let u=t[c];if(u!==void 0){a(l,Lr(n,Ir(u)),o,s);continue}let d=c.charCodeAt(0);if(d===38){a(l,n,vr(c,`&`+o).slice(1),s);continue}if(d===64){a(l,Lr(n,c),o,s);continue}continue}if(l===!0){let e=jr[c];if(e){let t=i(s,n,o).decls;for(let n in e)t.push([n,e[n]])}continue}let u=Ar[c];if(u!==void 0){let e=i(s,n,o).decls;for(let t of u)e.push([t,r(t,l)])}else{let e=Fr(c);i(s,n,o).decls.push([e,r(e,l)])}}}function o(e,t){let r=typeof e==`string`,i=r?t:e,o=r?e:void 0;if(i==null)return Q(``);let s=Tr(),c=n.get(i);if(c!==void 0&&c.epoch===s&&c.name===o)return Z(),c.result;let l=/* @__PURE__ */ new Map;a(i,void 0,``,l);let u=[];for(let e of l.values()){if(e.decls.length===0)continue;let t=e.query===void 0&&e.suffix===``;u.push(Sr(e.query,e.suffix,e.decls,o,t))}let d=Q(u.join(` `));return n.set(i,{epoch:s,name:o,result:d}),d}function s(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=jr[t];if(e)for(let t in e)n(t,e[t]);continue}let a=Ar[t];if(a!==void 0)for(let e of a)n(e,r(e,i));else{let e=Fr(t);n(e,r(e,i))}}return t}function c(e){let t=``;for(let n in e)t+=n+`{`+s(e[n])+`}`;let n=`nk`+hr(t);return Er(n,`@keyframes `+n+`{`+t+`}`),n}function l(e,t){let n=e+`{`+s(t)+`}`;Er(`g|`+n,n)}function u(e){let t=e=>e===!0?`true`:e===!1?`false`:String(e),n=e.variants??{},r=Object.keys(n),i=e.defaultVariants??{},a=e.base??null,s=(e.compoundVariants??[]).map(e=>{let{css:n,...r}=e,i={};for(let e in r)i[e]=t(r[e]);return{conditions:i,style:n}}),c=/* @__PURE__ */ new Map,l=Tr();return function(e){let u=Tr();l!==u&&(c.clear(),l=u);let d={};for(let n of r){let r=(e?e[n]:void 0)??i[n];r!=null&&(d[n]=t(r))}let f=``;for(let e of r){let t=d[e];f+=e.length+`:`+e,f+=t===void 0?`-`:`+`+t.length+`:`+t}let p=c.get(f);if(p)return Z(),p;let m={};a&&(m=Rr(m,a));for(let e of r){let t=d[e];if(t!==void 0){let r=n[e][t];r&&(m=Rr(m,r))}}for(let e of s){let t=!0;for(let n in e.conditions)if(d[n]!==e.conditions[n]){t=!1;break}t&&(m=Rr(m,e.style))}let h=o(m);return c.set(f,h),h}}return{css:o,cx:Kr,variants:u,keyframes:c,globalStyle:l,theme:e}}let Jr;function $(){return Jr??=qr({})}let Yr=(e,t)=>typeof e==`string`?$().css(e,t):$().css(e),Xr=e=>$().variants(e),Zr=e=>$().keyframes(e),Qr=(e,t)=>$().globalStyle(e,t);function $r(){qt();let e=globalThis;e.list=Sn,e.update=Jn,e.when=Rn,e.on=he,e.scope=Kn,e.render=Xn,e.hydrate=Zn,e.createCss=qr,e.css=Yr,e.cx=Kr,e.variants=Xr,e.keyframes=Zr,e.globalStyle=Qr}$r(),e.HTML_TAGS=Vt,e.SELF_CLOSING_TAGS=Ut,e.SVG_TAGS=Ht,e.appendChildren=Ve,e.applyAttributes=H,e.applyNodeModifier=W,e.createComment=R,e.createConditionalComment=Le,e.createCss=qr,e.createHtmlElementWithModifiers=Ft,e.createHtmlTagBuilder=zt,e.createSvgElementWithModifiers=It,e.createSvgTagBuilder=Bt,e.css=Yr,e.cx=Kr,e.getCssText=Dr,e.globalStyle=Qr,e.hydrate=Zn,e.initializeRuntime=$r,e.isBoolean=a,e.isBrowser=l,e.isFunction=o,e.isNode=n,e.isObject=r,e.isPrimitive=t,e.isTagLike=i,e.isZeroArityFunction=s,e.keyframes=Zr,e.list=Sn,e.on=he,e.registerGlobalTagBuilders=qt,e.render=Xn,e.replaceNodeSafely=He,e.resetStyles=Or,e.scope=Kn,e.setSSRCollector=nr,e.update=Jn,e.variants=Xr,e.when=Rn});
|
|
2
2
|
//# sourceMappingURL=nuclo.umd.js.map
|