jsswift 1.0.54 → 2.0.0
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/AI.md +10 -2
- package/README.md +2 -2
- package/dist/css/animation.css +36 -36
- package/dist/css/base.css +374 -374
- package/dist/css/docs.css +54 -54
- package/dist/css/fonts-nunito.css +2 -2
- package/dist/css/min-ui.css +1 -1
- package/dist/css/responsive-base.css +549 -549
- package/dist/css/responsive.css +3225 -3225
- package/dist/css/ui-components.css +2902 -2930
- package/dist/css/ui-light.css +3853 -3881
- package/dist/css/ui-light.min.css +1 -1
- package/dist/css/ui.css +6530 -6558
- package/dist/css/ui.min.css +1 -1
- package/dist/documentions/AI.md +10 -2
- package/dist/documentions/README.md +1 -0
- package/dist/documentions/application-rules.md +2 -2
- package/dist/documentions/components/toolbar.md +1 -1
- package/dist/documentions/examples/crud.md +5 -3
- package/dist/documentions/getting-started.md +4 -0
- package/dist/documentions/knowledge-map.json +22 -1
- package/dist/documentions/ui/themes.md +39 -0
- package/dist/jsswift.js +5685 -12485
- package/dist/jsswift.min.js +12 -12
- package/dist/min-jsswift.js +12 -12
- package/package.json +2 -2
package/dist/jsswift.min.js
CHANGED
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
(()=>{var Ds,$s,uo,fo,At,xs,T,Un,ps;window.JSswift=window.JSswift||{};const Q=window.JSswift;window._=window.JSswift,Q.config=Q.config||{};const bt=typeof globalThis!="undefined"&&globalThis.JSswift_setting?globalThis.JSswift_setting:{};Q.config.debug=(Ds=bt.modeDev)!=null?Ds:!1,Q.isDev=function(){return Q.config.debug},Q.uiNormalizeArgs=function(l){let I={},J=l;return l.length>0&&typeof l[0]=="object"&&l[0]!==null&&!l[0].nodeType&&!Array.isArray(l[0])&&!(l[0]instanceof Function)&&(I=l[0],J=l.slice(1)),{props:I,children:J}},Q.uiSizes=["xxs","xs","sm","md","lg","xl","xxl","xxxl"],Q.uiColors=["primary","secondary","success","warning","danger","info","light","dark"],Q.meta=Q.meta||{version:"1.0.23",policy:{sourceOfTruth:"docDevelop/reference/core.md",syncRule:"Quando cambia un modulo core, aggiornare sia questo meta sia docDevelop/reference/core.md."},modules:{render:{description:"Bridge props -> DOM per hyperscript _, attributi, class, style, eventi e children reattivi.",entrypoints:["createElement","setProp","bindProp"],status:"milestone-3-closed",knownLimits:["Il mini-terzo-giro e il successivo micro-giro avanzato hanno chiuso style dinamico, eventi, children e props/attr speciali, ma restano altri edge case avanzati da esplorare.","Gli eventi ora supportano composizione base di listener multipli, ma non hanno ancora delegation o diff avanzato.","Restano da esplorare edge case avanzati del renderer oltre ai giri gia coperti dai test."]},reactive:{description:"Core minimale signal/effect usato come base della reattivita.",entrypoints:["JSswift.reactive.signal","JSswift.reactive.effect","JSswift.reactive.computed","JSswift.reactive.untracked","JSswift.reactive.batch"],status:"milestone-2-closed",knownLimits:["La protezione loop copre i loop sincroni per singolo effect, non ancora i cicli complessi tra effect multipli.","Il batching sincrono ora esiste, ma manca ancora scheduling configurabile oltre il flush immediato a fine batch.","Mancano primitive avanzate per controllare scheduling e transazioni asincrone."]},rod:{description:"Layer reattivo di alto livello per binding DOM, model e interpolazioni.",entrypoints:["_.rod","JSswift.rodBind","JSswift.rodModel"],status:"milestone-2-closed",knownLimits:["Va chiarito meglio il rapporto con JSswift.reactive oltre al primo riallineamento strutturale.","Restano casi avanzati di model/binding da esplorare oltre al primo giro coperto dai test.","Il modulo e piu pulito internamente ma non e ancora il punto finale della convergenza con il renderer."]},mount:{description:"Mount, component instances e cleanup automatico del tree DOM.",entrypoints:["JSswift.mount","JSswift.component","JSswift.enableAutoCleanup"],status:"milestone-2-closed",knownLimits:["Il lifecycle e piu pulito internamente ma resta da chiarire meglio la semantica su multi-mount e cloni.","Restano da esplorare edge case avanzati del cleanup automatico fuori dal primo giro gia coperto."]},platform:{description:"Moduli applicativi nel core: overlay, store, auth, http, router, UI meta.",entrypoints:["JSswift.overlay","JSswift.store","JSswift.plugins.auth","JSswift.http","JSswift.router","JSswift.ui.meta"],status:"milestone-2-closed",knownLimits:["Il secondo giro ha ripulito i moduli interni, ma mancano ancora demo separate per modulo e una validazione piu formale di alcune superfici pubbliche.","Esiste una demo browser aggregata del blocco platform, ma non ancora demo separate per ogni modulo.","Mancano configurazione pubblica piu coerente e confini piu netti tra auth, http e router.","Il registry UI meta non ha ancora validazione formale del suo shape."]}}},Q.omit=(l,I)=>{const J={},$=new Set(I||[]);for(const D in l||{})$.has(D)||(J[D]=l[D]);return J},Q._cleanupRegistry=new WeakMap,Q._registerCleanup=function(l,I){if(!l||typeof I!="function")return I;const J=Q._cleanupRegistry.get(l)||[];return J.push(I),Q._cleanupRegistry.set(l,J),I},Q.dom={q(l,I=document){return I.querySelector(l)},qa(l,I=document){return Array.from(I.querySelectorAll(l))},attr(l,I,J){return l?J===void 0?l.getAttribute(I):(J===null?l.removeAttribute(I):l.setAttribute(I,String(J)),l):null}},(()=>{let l=[],I=!1;function J(){if(I)return;I=!0;const $=l.slice();l.length=0;for(const D of $)try{D()}catch(me){console.error("[JSswift.ready] error:",me)}}Q.ready=function($){typeof $=="function"&&(I||document.readyState==="interactive"||document.readyState==="complete"?queueMicrotask(()=>{try{$()}catch(D){console.error("[JSswift.ready] error:",D)}}):l.push($))},document.addEventListener("DOMContentLoaded",J,{once:!0})})(),Q.reactive=(()=>{let l=null;const I=[],J=100;let $=0,D="sync",me="sync",G=!1;const pe=new Set;function Ee(Ne){const Fe=Ne==null?void 0:Ne.flush;if(Fe==null||Fe==="sync")return"sync";if(Fe==="microtask")return"microtask";throw new Error("JSswift.reactive.batch: options.flush must be 'sync' or 'microtask'")}function ve(){for(;pe.size;){const Ne=Array.from(pe);pe.clear(),Ne.forEach(Fe=>Fe())}}function xe(){G||(G=!0,queueMicrotask(()=>{G=!1,me="sync",ve()}))}function Le(Ne){const Fe=Array.from(Ne);if($>0||me==="microtask"){Fe.forEach(ut=>pe.add(ut)),$===0&&me==="microtask"&&xe();return}Fe.forEach(ut=>ut())}function Re(Ne){if(Ne&&(Ne._deps.size&&(Ne._deps.forEach(Fe=>Fe.delete(Ne._runner)),Ne._deps.clear()),typeof Ne._cleanup=="function")){const Fe=Ne._cleanup;Ne._cleanup=null;try{Fe()}catch(ut){console.error("[JSswift.reactive.effect] cleanup error:",ut)}}}function Ue(Ne){if(!(!Ne||!Ne.active)){Re(Ne),I.push(Ne),l=Ne;try{const Fe=dt=>{Ne._cleanup=typeof dt=="function"?dt:null},ut=Ne.fn.length>0?Ne.fn(Fe):Ne.fn();typeof ut=="function"&&(Ne._cleanup=ut)}finally{I.pop(),l=I[I.length-1]||null}}}function et(Ne){if(typeof Ne!="function")return()=>{};const Fe={fn:Ne,active:!0,_deps:new Set,_cleanup:null,_runner:null,_running:!1,_queued:!1},ut=()=>{if(!Fe.active)return;if(Fe._running){Fe._queued=!0;return}Fe._running=!0;let dt=0;try{do if(Fe._queued=!1,Ue(Fe),dt++,dt>=J){Fe._queued=!1,console.warn("[JSswift.reactive.effect] loop guard triggered: too many synchronous reruns",{max:J,effect:Ne.name||"anonymous"});break}while(Fe.active&&Fe._queued)}finally{Fe._running=!1}};return Fe._runner=ut,ut(),()=>{Fe.active&&(Fe.active=!1,Re(Fe))}}function yt(Ne){let Fe=Ne;const ut=new Set;function dt(){return l&&l.active&&(ut.add(l._runner),l._deps.add(ut)),Fe}function kt(Wt){Fe=Wt,Le(ut)}function It(){ut.clear()}return[dt,kt,It]}function st(Ne){if(typeof Ne!="function")throw new Error("JSswift.reactive.computed: fn must be a function");const[Fe,ut,dt]=yt(void 0),kt=et(()=>{ut(Ne())}),It=()=>Fe();return It.dispose=()=>{kt(),dt()},It.peek=()=>Fe(),It.type="computed",It}function tt(Ne){if(typeof Ne!="function")throw new Error("JSswift.reactive.untracked: fn must be a function");const Fe=l;l=null;try{return Ne()}finally{l=Fe}}function Pe(Ne,Fe){if(typeof Ne!="function")throw new Error("JSswift.reactive.batch: fn must be a function");const ut=Ee(Fe);$===0?D=ut:ut==="microtask"&&(D="microtask"),$+=1;try{return Ne()}finally{if($-=1,$===0){const dt=D==="microtask"||me==="microtask";D="sync",dt?(me="microtask",xe()):ve()}}}return{signal:yt,effect:et,computed:st,untracked:tt,batch:Pe}})(),Q._overlayShared=(()=>{const l=["button:not([disabled])","[href]","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","[tabindex]:not([tabindex='-1'])"].join(",");function I(me,G){const pe=me();if(pe&&pe.isConnected)return pe;let Ee=document.getElementById("cms-overlay-root");return!Ee&&(document!=null&&document.body)&&(Ee=document.createElement("div"),Ee.id="cms-overlay-root",Ee.className="cms-overlay-root",document.body.appendChild(Ee)),!document.body&&!Ee&&Q.ready(()=>{let ve=document.getElementById("cms-overlay-root");ve||(ve=document.createElement("div"),ve.id="cms-overlay-root",ve.className="cms-overlay-root",document.body.appendChild(ve)),G(ve)}),G(Ee),Ee}function J(me){var pe;const G=me.querySelector(l);(pe=G==null?void 0:G.focus)==null||pe.call(G)}function $(me,G){if(me.key!=="Tab")return;const pe=Array.from(G.querySelectorAll(l)).filter(Le=>Le.offsetParent!==null);if(!pe.length)return;const Ee=pe[0],ve=pe[pe.length-1],xe=document.activeElement;me.shiftKey&&xe===Ee?(me.preventDefault(),ve.focus()):!me.shiftKey&&xe===ve&&(me.preventDefault(),Ee.focus())}function D(me,G){var xt,Ge,Mn,on,On,an;if(!G.anchorEl)return;const pe=G.anchorEl.getBoundingClientRect(),Ee=me.getBoundingClientRect(),ve=window.visualViewport||null,xe=Math.max(0,Number(ve==null?void 0:ve.offsetLeft)||0),Le=Math.max(0,Number(ve==null?void 0:ve.offsetTop)||0),Re=Math.max(Number(ve==null?void 0:ve.width)||0,window.innerWidth||0,((xt=document.documentElement)==null?void 0:xt.clientWidth)||0),Ue=Math.max(Number(ve==null?void 0:ve.height)||0,window.innerHeight||0,((Ge=document.documentElement)==null?void 0:Ge.clientHeight)||0),et=Number((on=(Mn=G.viewportGutter)!=null?Mn:G.gutter)!=null?on:8),yt=Number.isFinite(et)?Math.max(0,et):8,st=Number((On=G.offsetX)!=null?On:0),tt=Number((an=G.offsetY)!=null?an:8),Pe=Number.isFinite(st)?st:0,Ne=Number.isFinite(tt)?tt:8,Fe=(gn,yn,zn)=>!Number.isFinite(gn)||(Number.isFinite(yn)||(yn=0),Number.isFinite(zn)||(zn=yn),zn<yn)?yn:Math.min(Math.max(gn,yn),zn),ut=String(G.placement||"bottom-start").toLowerCase(),[dt,kt]=ut.split("-"),It=["top","bottom","left","right"].includes(dt)?dt:"bottom",Wt=["start","end","center"].includes(kt)?kt:"start",Qe={top:"bottom",bottom:"top",left:"right",right:"left"}[It]||"top",St=It==="top"||It==="bottom",_t=Ee.width,Tt=Ee.height,Ve=gn=>{let yn=pe.left+Pe,zn=pe.top+Ne;return gn==="top"||gn==="bottom"?(Wt==="center"?yn=pe.left+(pe.width-_t)/2+Pe:Wt==="end"&&(yn=pe.right-_t+Pe),zn=gn==="top"?pe.top-Tt-Ne:pe.bottom+Ne):(Wt==="center"?zn=pe.top+(pe.height-Tt)/2+Ne:Wt==="end"&&(zn=pe.bottom-Tt+Ne),yn=gn==="left"?pe.left-_t-Pe:pe.right+Pe),{left:yn,top:zn}},ot=gn=>gn==="top"?pe.top-Ne-yt:gn==="bottom"?Ue-pe.bottom-Ne-yt:gn==="left"?pe.left-Pe-yt:Re-pe.right-Pe-yt,zt=ot(It),$t=ot(Qe),ht=(St?Tt:_t)>zt&&$t>zt?Qe:It,Ke=Ve(ht),o=xe+yt,Pt=Le+yt,Z=Math.max(o,xe+Re-_t-yt),Kt=Math.max(Pt,Le+Ue-Tt-yt),ye=Fe(Ke.left,o,Z),jt=Fe(Ke.top,Pt,Kt);me.style.position="fixed",me.style.left=`${ye}px`,me.style.top=`${jt}px`}return{ensureRoot:I,focusFirst:J,trapFocus:$,applyAnchoredPosition:D}})(),Q.overlay=(()=>{let l=0;const I=new Map;let J=null;const{ensureRoot:$,focusFirst:D,trapFocus:me,applyAnchoredPosition:G}=Q._overlayShared,pe=()=>$(()=>J,st=>{J=st});let Ee=0;const ve=()=>{Ee++,Ee===1&&document.documentElement.classList.add("cms-scroll-locked")},xe=()=>{Ee=Math.max(0,Ee-1),Ee===0&&document.documentElement.classList.remove("cms-scroll-locked")},Le=()=>{let st=null;for(const tt of I.values())st=tt;return st},Re=st=>{var Pe;let tt=st;for(;tt&&tt!==document;){if(tt.nodeType===1&&((Pe=tt.getAttribute)==null?void 0:Pe.call(tt,"data-cms-overlay-portal"))==="true")return!0;tt=tt.parentNode}return!1},Ue=(st,tt={})=>{var ot,zt,$t,Ct;const Pe=`ov_${++l}`,Ne={id:Pe,opts:tt,isOpen:!0,anchorEl:tt.anchorEl||null,placement:tt.placement||"bottom-start",onClose:typeof tt.onClose=="function"?tt.onClose:null,overlay:null,panel:null,backdrop:null,reposition:null,_positionCleanup:null,_positionFrame:null,_panelResizeObserver:null,_cleanup:null},Fe=document.createElement("div");Fe.className=["cms-overlay",tt.type?`type-${tt.type}`:""].filter(Boolean).join(" "),Fe.dataset.id=Pe;const ut=document.createElement("div");ut.className="cms-overlay-backdrop",tt.backdrop||(ut.style.display="none");const dt=document.createElement("div");dt.className=["cms-overlay-panel",tt.className].filter(Boolean).join(" "),dt.tabIndex=-1;const kt=typeof st=="function"?st({close:()=>et(Pe)}):st,It=Q.ui.slot(kt);Array.isArray(It)?It.forEach(ht=>ht&&dt.appendChild(ht)):It&&dt.appendChild(It),Fe.appendChild(ut),Fe.appendChild(dt);const Wt=pe();if(!Wt)return{id:Pe,close:()=>et(Pe),panel:dt,overlay:Fe};Wt.appendChild(Fe),Ne.overlay=Fe,Ne.panel=dt,Ne.backdrop=ut,I.set(Pe,Ne),tt.lockScroll&&ve(),tt.autoFocus!==!1&&setTimeout(()=>{dt.isConnected&&I.get(Pe)===Ne&&!dt.contains(document.activeElement)&&D(dt)},0);const Qe=(ht=null)=>{ht&&typeof ht=="object"&&Object.assign(Ne.opts,ht),G(dt,Ne.opts)},St=()=>{if(!tt.anchorEl)return;const ht=globalThis.requestAnimationFrame||(Ke=>setTimeout(()=>Ke(Date.now()),0));Ne._positionFrame==null&&(Ne._positionFrame=ht(()=>{Ne._positionFrame=null,Qe()}))};if(Ne.reposition=Qe,tt.anchorEl){Qe(),St();const ht=St;if(window.addEventListener("resize",ht),window.addEventListener("scroll",ht,!0),(zt=(ot=window.visualViewport)==null?void 0:ot.addEventListener)==null||zt.call(ot,"resize",ht),(Ct=($t=window.visualViewport)==null?void 0:$t.addEventListener)==null||Ct.call($t,"scroll",ht),typeof ResizeObserver=="function"){const Ke=new ResizeObserver(St);Ke.observe(dt),Ne._panelResizeObserver=Ke}Ne._positionCleanup=()=>{var o,Pt,Z,Kt,ye,jt;const Ke=globalThis.cancelAnimationFrame||clearTimeout;Ne._positionFrame!=null&&(Ke(Ne._positionFrame),Ne._positionFrame=null),(Pt=(o=Ne._panelResizeObserver)==null?void 0:o.disconnect)==null||Pt.call(o),Ne._panelResizeObserver=null,window.removeEventListener("resize",ht),window.removeEventListener("scroll",ht,!0),(Kt=(Z=window.visualViewport)==null?void 0:Z.removeEventListener)==null||Kt.call(Z,"resize",ht),(jt=(ye=window.visualViewport)==null?void 0:ye.removeEventListener)==null||jt.call(ye,"scroll",ht)}}const _t=ht=>{const Ke=Le();!Ke||Ke.id!==Pe||tt.closeOnOutside!==!1&&(Re(ht.target)||dt.contains(ht.target)||et(Pe))};document.addEventListener("mousedown",_t,!0);const Tt=ht=>{const Ke=Le();!Ke||Ke.id!==Pe||(tt.trapFocus&&me(ht,dt),ht.key==="Escape"&&tt.closeOnEsc!==!1&&(ht.preventDefault(),et(Pe)))};document.addEventListener("keydown",Tt,!0),ut.addEventListener("click",()=>{tt.closeOnBackdrop!==!1&&et(Pe)}),Ne._cleanup=()=>{var ht;document.removeEventListener("mousedown",_t,!0),document.removeEventListener("keydown",Tt,!0),(ht=Ne._positionCleanup)==null||ht.call(Ne)};const Ve=1e3+I.size*10;return Fe.style.zIndex=String(Ve),{id:Pe,close:()=>et(Pe),panel:dt,overlay:Fe,reposition:Qe}},et=st=>{var Pe,Ne,Fe;const tt=I.get(st);tt&&(I.delete(st),(Pe=tt._cleanup)==null||Pe.call(tt),tt.opts.lockScroll&&xe(),typeof Bt=="function"&&Bt(tt.overlay),(Ne=tt.overlay)==null||Ne.remove(),(Fe=tt.onClose)==null||Fe.call(tt))};return{open:Ue,close:et,closeTop:()=>{const st=Le();st&&et(st.id)},root:J,_stack:I}})();function gs(l,I={}){const{isSVG:J=!1,normalizeClass:$=Pe=>String(Pe!=null?Pe:""),isContentProp:D=()=>!1,autoValueTags:me=new Set(["INPUT","TEXTAREA","SELECT"])}=I;function G(Pe){if(J||!(Pe in l))return!1;try{return typeof l[Pe]=="boolean"}catch(Ne){return!1}}function pe(Pe){return J||Pe.startsWith("data-")||Pe.startsWith("aria-")||!(Pe in l)}function Ee(Pe,Ne){if(Ne==null){l.removeAttribute(Pe);return}if(Ne===!1){if(Pe.startsWith("aria-")){l.setAttribute(Pe,"false");return}l.removeAttribute(Pe);return}if(Ne===!0&&!J&&!Pe.startsWith("aria-")&&!Pe.startsWith("data-")){l.setAttribute(Pe,"");return}l.setAttribute(Pe,String(Ne))}function ve(Pe,Ne){if(Pe==null)return;const Fe=String(Pe),ut=Fe.startsWith("--")||Fe.includes("-");if(Ne==null||Ne===!1||Ne===""){ut?l.style.removeProperty(Fe):l.style[Fe]="";return}if(ut){l.style.setProperty(Fe,String(Ne));return}l.style[Fe]=Ne}function xe(Pe){const Ne=$(Pe);if(Ne==null||Ne===!1||Ne===""){l.removeAttribute("class");return}l.setAttribute("class",String(Ne))}function Le(Pe,Ne){const Fe=!!Ne;l[Pe]=Fe,Fe?l.setAttribute(Pe,""):l.removeAttribute(Pe)}function Re(Pe){if(D(Pe)){l[Pe]="";return}if(Pe==="class"){l.removeAttribute("class");return}if(Pe==="style"){l.removeAttribute("style");return}if(G(Pe)){try{l[Pe]=!1}catch(Ne){}l.removeAttribute(Pe);return}if(l.removeAttribute(Pe),!pe(Pe))try{typeof l[Pe]=="string"&&(l[Pe]="")}catch(Ne){}}function Ue(Pe){!Pe||typeof Pe!="object"||Object.entries(Pe).forEach(([Ne,Fe])=>{ve(Ne,Fe)})}function et(Pe,Ne){if(D(Pe)){l[Pe]=Ne!=null?Ne:"";return}if(Pe==="class"){xe(Ne);return}if(Pe==="style"){if(Ne==null||Ne===!1){Re(Pe);return}if(typeof Ne=="object"){Ue(Ne);return}}if(G(Pe)){Le(Pe,Ne);return}if(Ne==null||Ne===!1){Re(Pe);return}if(pe(Pe)){Ee(Pe,Ne);return}l[Pe]=Ne}function yt(Pe,Ne){const Fe=String(Pe).split(".");let ut=l;for(let dt=0;dt<Fe.length-1;dt++)if(ut=ut==null?void 0:ut[Fe[dt]],!ut)return;ut[Fe[Fe.length-1]]=Ne}function st(Pe){return Pe?Pe==="auto"||Pe.startsWith("attr:")||Pe.startsWith("@")||Pe.startsWith("style.")||Pe.includes("."):!1}function tt(Pe,Ne){if(!Pe||Pe==="auto"){me.has(l.tagName)?et("value",Ne):l.textContent=Ne!=null?Ne:"";return}if(Pe.startsWith("attr:")){Ee(Pe.slice(5),Ne);return}if(Pe.startsWith("@")){Ee(Pe.slice(1),Ne);return}if(Pe.startsWith("style.")){ve(Pe.slice(6),Ne);return}if(Pe.includes(".")){yt(Pe,Ne);return}et(Pe,Ne)}return{isBooleanDomProp:G,isAttributeOnlyProp:pe,isBindingValueKey:st,setAttributeValue:Ee,setStyleEntry:ve,setClassValue:xe,setBooleanProp:Le,removeProp:Re,applyStyleObject:Ue,setProp:et,setPathValue:yt,applyBindingValue:tt}}function Bn(l){const I=[],J=$=>{if(!($==null||$===!1)){if(typeof $=="function"){J($());return}if($&&$.type==="rod"){J($.value);return}if(Array.isArray($)){$.forEach(J);return}if(typeof $=="object"){Object.entries($).forEach(([D,me])=>{let G=me;typeof G=="function"?G=G():G&&G.type==="rod"&&(G=G.value),J(G?D:null)});return}$!==!0&&String($).split(/\s+/).forEach(D=>{D&&I.push(D)})}};return J(l),I.length?Array.from(new Set(I)).join(" "):""}function ys(l){return l==null||l===!1?!1:typeof l=="function"||l&&l.type==="rod"?!0:Array.isArray(l)?l.some(ys):typeof l=="object"?Object.values(l).some(ys):!1}function rs(l,I){return l==null||l===!1?!1:typeof l=="function"||I(l)?!0:typeof l!="object"||Array.isArray(l)||l.nodeType?!1:Object.values(l).some(J=>rs(J,I))}function as(l,I){let J=l;if(typeof J=="function"?J=J():I(J)&&(J=J.value),!J||typeof J!="object"||Array.isArray(J)||J.nodeType)return null;const $={};return Object.entries(J).forEach(([D,me])=>{let G=me;typeof G=="function"?G=G():I(G)&&(G=G.value),$[D]=G}),$}function zs(l){let I=new Set;function J(D){I.forEach(me=>{D.has(me)||l(me,null)}),I=D}function $(D,me){const G=as(D,me);if(!G){J(new Set);return}const pe=new Set(Object.keys(G));J(pe),Object.entries(G).forEach(([Ee,ve])=>{l(Ee,ve)})}return{apply:$}}function Ys(l){return typeof l=="string"&&(l.startsWith("on:")||l.startsWith("on")&&l.length>2)}const wn=128,Jn=[];function Ps(l,I){Jn.push({rod:l,value:String(I!=null?I:"")}),Jn.length>wn&&Jn.splice(0,Jn.length-wn)}function jn(){if(!Jn.length)return null;const l=Jn.slice();return Jn.length=0,{items:l,index:0}}function cs(l,I){if(!I||!l||I.index>=I.items.length)return null;const J=[],$=String(l);let D=0,me=I.index,G=!1;for(;me<I.items.length;){const pe=I.items[me],Ee=pe.value;if(!Ee)break;const ve=$.indexOf(Ee,D);if(ve===-1)break;ve>D&&J.push($.slice(D,ve)),J.push(pe.rod),D=ve+Ee.length,me++,G=!0}return G?(D<$.length&&J.push($.slice(D)),I.index=me,J):null}function Xs(l){var J;let I="";for(const $ of l)typeof $=="string"?I+=$:I+=(J=$==null?void 0:$.value)!=null?J:"";return I}function No(l){if(l.startsWith("on:"))return l.slice(3);const I=l.slice(2);return I?I==="DoubleClick"?"dblclick":I.toLowerCase():""}function us(l){return l==null||l===!1?!1:l===!0?{capture:!0}:typeof l=="boolean"?l:typeof l=="object"?{capture:!!l.capture,passive:!!l.passive,once:!!l.once}:!1}function Qs(l,I){const J=us(l),$=us(I);return typeof J=="boolean"||typeof $=="boolean"?J===$:!!J&&!!$&&J.capture===$.capture&&J.passive===$.passive&&J.once===$.once}function Xn(l,I){return Array.isArray(l)?l.some(J=>Xn(J,I)):I(l)?!0:!l||typeof l!="object"||Array.isArray(l)||l.nodeType?!1:Array.isArray(l.handlers)?l.handlers.some(J=>Xn(J,I))||I(l.options)||typeof l.options=="function":Array.isArray(l.listeners)?l.listeners.some(J=>Xn(J,I))||I(l.options)||typeof l.options=="function":I(l.handler)||I(l.listener)||I(l.fn)||I(l.options)||typeof l.options=="function"}function Qn(l,I,J){var $,D,me,G,pe,Ee,ve;if(l==null||l===!1)return[];if(typeof l=="function")return[{handler:l,options:us(J!=null?J:!1)}];if(I(l))return Qn(l.value,I,J);if(Array.isArray(l))return l.flatMap(xe=>Qn(xe,I,J));if(typeof l=="object"&&!Array.isArray(l)&&!l.nodeType){if(Array.isArray(l.handlers)||Array.isArray(l.listeners)){const Re=l.handlers||l.listeners||[],Ue=(D=($=l.options)!=null?$:J)!=null?D:!1;return Re.flatMap(et=>Qn(et,I,Ue))}let xe=(pe=(G=(me=l.handler)!=null?me:l.listener)!=null?G:l.fn)!=null?pe:null,Le=(ve=(Ee=l.options)!=null?Ee:J)!=null?ve:!1;return I(xe)&&(xe=xe.value),I(Le)&&(Le=Le.value),typeof Le=="function"&&(Le=Le()),typeof xe=="function"?[{handler:xe,options:us(Le)}]:[]}return[]}function Ao(l,I){return Qn(l,I)}function Zs(l,I,J,$){const D=No(I);if(!D)return;const me={listeners:[]},G=()=>{me.listeners.forEach(Ee=>{l.removeEventListener(D,Ee.dispatch,Ee.options)}),me.listeners=[]},pe=Ee=>{const ve=Ao(Ee,$);me.listeners.length===ve.length&&me.listeners.every((Le,Re)=>{const Ue=ve[Re];return Le.handler===Ue.handler&&Qs(Le.options,Ue.options)})||(G(),ve.forEach(Le=>{const Re={handler:Le.handler,options:Le.options,dispatch:null};Re.dispatch=Ue=>{if(typeof Re.handler=="function"){const et=Re.handler.call(l,Ue);return Re.options&&typeof Re.options=="object"&&Re.options.once&&(l.removeEventListener(D,Re.dispatch,Re.options),me.listeners=me.listeners.filter(yt=>yt!==Re)),et}},l.addEventListener(D,Re.dispatch,Re.options),me.listeners.push(Re)}))};if(Q._registerCleanup(l,G),$(J)){const Ee=Q.reactive.effect(()=>{pe(J.value)});Q._registerCleanup(l,Ee);return}if(Xn(J,$)){const Ee=Q.reactive.effect(()=>{pe(J)});Q._registerCleanup(l,Ee);return}pe(J)}function eo(l,I={}){const{isRod:J=()=>!1,interpolationCursor:$=null}=I;function D(xe){const Le=document.createTextNode(""),Re=Q.rodBind(Le,xe);return Q._registerCleanup(Le,Re),Le}function me(xe){l.appendChild(D(xe))}function G(xe){const Le=document.createTextNode("");l.appendChild(Le);const Re=Q.reactive.effect(()=>{Le.textContent=Xs(xe)});Q._registerCleanup(Le,Re)}function pe(xe){const Le=[],Re=Ue=>{if(!(Ue==null||Ue===!1)){if(Array.isArray(Ue)){Ue.forEach(Re);return}if(typeof Ue=="string"){Le.push(document.createTextNode(Ue));return}if(typeof Ue=="number"){Le.push(document.createTextNode(String(Ue)));return}if(typeof Ue!="boolean"){if(J(Ue)){Le.push(D(Ue));return}if(Ue!=null&&Ue.nodeType){Le.push(Ue);return}Le.push(document.createTextNode(String(Ue)))}}};return Re(xe),Le}function Ee(xe){const Le=document.createComment("dyn");l.appendChild(Le);let Re=[];const Ue=Q.reactive.effect(()=>{Re.forEach(tt=>{Bt(tt),tt.parentNode&&tt.parentNode.removeChild(tt)}),Re=[];const et=Le.parentNode;if(!et)return;const yt=pe(xe());if(!yt.length)return;const st=document.createDocumentFragment();yt.forEach(tt=>st.appendChild(tt)),et.insertBefore(st,Le.nextSibling),Re=yt});Q._registerCleanup(Le,()=>{Ue(),Re.forEach(et=>Bt(et)),Re=[]})}function ve(xe){if(xe!=null){if(Array.isArray(xe)){for(const Le of xe)ve(Le);return}if(typeof xe=="string"){const Le=cs(xe,$);Le?G(Le):l.appendChild(document.createTextNode(xe));return}if(typeof xe=="number"){l.appendChild(document.createTextNode(String(xe)));return}if(typeof xe=="function"){Ee(xe);return}if(J(xe)){me(xe);return}xe.nodeType&&l.appendChild(xe)}}return{appendRodText:me,appendInterpolatedText:G,appendDynamicChild:Ee,appendChildValue:ve}}function to(l,I={}){const{el:J,isRod:$=()=>!1,interpolationCursor:D=null,appendChildValue:me=()=>{},appendRodText:G=()=>{},appendInterpolatedText:pe=()=>{},appendDynamicChild:Ee=()=>{},bindProp:ve=()=>{}}=I;for(const xe of l)if(xe!=null){if(Array.isArray(xe)){me(xe);continue}if(typeof xe=="string"){const Le=cs(xe,D);Le?pe(Le):J.appendChild(document.createTextNode(xe));continue}if(typeof xe=="number"){J.appendChild(document.createTextNode(String(xe)));continue}if(typeof xe=="function"){Ee(xe);continue}if($(xe)){G(xe);continue}if(xe.nodeType){J.appendChild(xe);continue}if(typeof xe=="object")for(const[Le,Re]of Object.entries(xe)){if(typeof Re=="string"){const Ue=cs(Re,D);if(Ue){ve(Le,()=>Xs(Ue));continue}}if(Le==="class"){ve(Le,Re);continue}if(Le==="style"&&typeof Re=="object"&&Re!==null&&!$(Re)){ve(Le,Re);continue}ve(Le,Re)}}}const no="http://www.w3.org/2000/svg",Ts=new Set(["svg","g","path","circle","ellipse","line","rect","polygon","polyline","text","tspan","defs","linearGradient","radialGradient","stop","use","symbol","clipPath","mask","pattern","filter","feGaussianBlur","feOffset","feBlend","feColorMatrix"]);function ds(l){return l==="innerHTML"||l==="innerText"||l==="textContent"||l==="value"}function so(l,...I){const J=Ts.has(l),$=l==="text"&&!J?document.createTextNode(""):J?document.createElementNS(no,l):document.createElement(l),D=Ve=>!!Ve&&Ve.type==="rod",me=jn(),G=eo($,{isRod:D,interpolationCursor:me}),{appendRodText:pe,appendInterpolatedText:Ee,appendDynamicChild:ve,appendChildValue:xe}=G,Le=gs($,{isSVG:J,normalizeClass:Bn,isContentProp:ds}),{isBooleanDomProp:Re,isBindingValueKey:Ue,applyBindingValue:et,setStyleEntry:yt,setProp:st,setClassValue:tt}=Le;function Pe(Ve){const ot=Q.reactive.effect(Ve);return Q._registerCleanup($,ot),ot}function Ne(Ve){if(String((Ve==null?void 0:Ve.tagName)||"").toLowerCase()!=="input")return!1;const ot=String((Ve==null?void 0:Ve.type)||"").toLowerCase();return ot==="range"||ot==="number"}function Fe(Ve){return String((Ve==null?void 0:Ve.tagName)||"").toLowerCase()!=="input"?"":String((Ve==null?void 0:Ve.type)||"").toLowerCase()}function ut(Ve){return String((Ve==null?void 0:Ve.tagName)||"").toLowerCase()==="select"&&!Ve.multiple}function dt(Ve){return String((Ve==null?void 0:Ve.tagName)||"").toLowerCase()==="input"&&String((Ve==null?void 0:Ve.type)||"").toLowerCase()==="file"}function kt(Ve,ot,zt){Pe(()=>{var ht;const Ct=(ht=ot.value)!=null?ht:"";Ve.value!==String(Ct)&&st("value",Ct)});const $t=()=>{let Ct=Ve.value;const ht=Fe(Ve),Ke=typeof ot.value=="number"||ot.value==null;if(ut(Ve)&&Ve.value==="")Ct=null;else if(Ne(Ve)&&Ke)if(ht==="number"&&Ve.value==="")Ct=null;else{const o=typeof Ve.valueAsNumber=="number"&&!Number.isNaN(Ve.valueAsNumber)?Ve.valueAsNumber:Number(Ve.value);Ct=Number.isNaN(o)?ht==="number"?null:0:o}ot.value!==Ct&&(ot.value=Ct)};Ve.addEventListener(zt,$t),Q._registerCleanup(Ve,()=>{Ve.removeEventListener(zt,$t)})}function It(Ve,ot){Pe(()=>{const $t=!!ot.value;!!Ve.checked!==$t&&st("checked",$t)});const zt=()=>{const $t=!!Ve.checked;ot.value!==$t&&(ot.value=$t)};Ve.addEventListener("change",zt),Q._registerCleanup(Ve,()=>{Ve.removeEventListener("change",zt)})}function Wt(Ve,ot){const zt=()=>{var Ct;return String((Ct=Ve.value)!=null?Ct:"on")};Pe(()=>{const ht=(ot.value==null?null:String(ot.value))===zt();!!Ve.checked!==ht&&st("checked",ht)});const $t=()=>{if(!Ve.checked)return;const Ct=zt();ot.value!==Ct&&(ot.value=Ct)};Ve.addEventListener("change",$t),Q._registerCleanup(Ve,()=>{Ve.removeEventListener("change",$t)})}function Qe(Ve,ot){const zt=()=>{const Ct=Ve.files;return Ct==null?[]:Array.isArray(Ct)?Ct.slice():typeof Ct.length=="number"?Array.from(Ct):[Ct]};Pe(()=>{const Ct=ot.value;(Ct==null||Array.isArray(Ct)&&Ct.length===0)&&(Ve.value!==""&&st("value",""),Array.isArray(Ve.files)&&(Ve.files=[]))});const $t=()=>{const Ct=zt();ot.value=Ct};Ve.addEventListener("change",$t),Q._registerCleanup(Ve,()=>{Ve.removeEventListener("change",$t)})}function St(Ve,ot){const zt=()=>Array.from(Ve.childNodes||[]).filter(ht=>(ht==null?void 0:ht.tagName)==="OPTION"&&ht.selected).map(ht=>{var Ke;return String((Ke=ht.value)!=null?Ke:"")}),$t=()=>{const ht=Array.isArray(ot.value)?ot.value.map(o=>String(o)):[],Ke=new Set(ht);Array.from(Ve.childNodes||[]).forEach(o=>{var Z;if((o==null?void 0:o.tagName)!=="OPTION")return;const Pt=Ke.has(String((Z=o.value)!=null?Z:""));!!o.selected!==Pt&&(o.selected=Pt,Pt?o.setAttribute("selected",""):o.removeAttribute("selected"))})};Pe($t),Ve._cmsApplySelectedValues=$t,queueMicrotask($t);const Ct=()=>{const ht=zt(),Ke=Array.isArray(ot.value)?ot.value.map(o=>String(o)):[];Ke.length===ht.length&&Ke.every((o,Pt)=>o===ht[Pt])||(ot.value=ht)};Ve.addEventListener("change",Ct),Q._registerCleanup(Ve,()=>{Ve.removeEventListener("change",Ct)})}function _t(Ve,ot){Pe(()=>{const ht=!!ot.value;!!Ve.selected!==ht&&st("selected",ht)});let zt=null;const $t=()=>{const ht=!!Ve.selected;ot.value!==ht&&(ot.value=ht)};queueMicrotask(()=>{var ht;zt||((ht=Ve.parentNode)==null?void 0:ht.tagName)!=="SELECT"||(zt=Ve.parentNode,zt.addEventListener("change",$t))}),Q._registerCleanup(Ve,()=>{zt==null||zt.removeEventListener("change",$t)})}function Tt(Ve,ot){if(Ys(Ve)){Zs($,Ve,ot,D);return}if(Ve==="class"){if(ys(ot)){Pe(()=>{tt(Bn(ot))});return}tt(Bn(ot));return}if(Ve==="style"&&ot&&typeof ot=="object"){const zt=zs(yt);if(rs(ot,D)){Pe(()=>{zt.apply(ot,D)});return}zt.apply(ot,D);return}if(Ve==="style"&&(typeof ot=="function"||D(ot))){const zt=zs(yt);Pe(()=>{zt.apply(ot,D)});return}if(Ue(Ve)&&typeof ot=="function"){Pe(()=>{et(Ve,ot())});return}if(Ue(Ve)&&!D(ot)){et(Ve,ot);return}if(typeof ot=="function"){Pe(()=>{st(Ve,ot())});return}if(Ve==="value"&&D(ot)&&(l==="input"||l==="textarea"||l==="select")){if(l==="select"&&$.multiple){St($,ot);return}kt($,ot,l==="select"?"change":"input");return}if(Ve==="checked"&&D(ot)&&l==="input"){if(String($.type||"").toLowerCase()==="radio"){Wt($,ot);return}It($,ot);return}if(Ve==="files"&&D(ot)&&dt($)){Qe($,ot);return}if(Ve==="selected"&&D(ot)&&l==="option"){_t($,ot);return}if(ds(Ve)&&D(ot)){Pe(()=>{st(Ve,ot.value)});return}if(D(ot)){const zt=Q.rodBind($,ot,{key:Ve});Q._registerCleanup($,zt);return}st(Ve,ot)}return to(I,{el:$,isRod:D,interpolationCursor:me,appendChildValue:xe,appendRodText:pe,appendInterpolatedText:Ee,appendDynamicChild:ve,bindProp:Tt}),l==="select"&&typeof $._cmsApplySelectedValues=="function"&&$._cmsApplySelectedValues(),$}const Wo={},oo=["html","head","title","base","link","meta","style","body","header","footer","main","section","article","aside","nav","h1","h2","h3","h4","h5","h6","p","div","span","pre","blockquote","hr","br","address","a","abbr","b","bdi","bdo","cite","code","data","dfn","em","i","kbd","mark","q","rp","rt","ruby","s","samp","small","strong","sub","sup","time","u","var","wbr","ul","ol","li","dl","dt","dd","table","caption","colgroup","col","thead","tbody","tfoot","tr","th","td","form","label","input","textarea","button","select","option","optgroup","fieldset","legend","datalist","output","progress","meter","img","picture","source","iframe","embed","object","param","audio","video","track","details","summary","dialog","script","noscript","canvas","template","slot","svg","g","path","circle","ellipse","line","rect","polygon","polyline","text","tspan","defs","linearGradient","radialGradient","stop","use","symbol","clipPath","mask","pattern","filter","feGaussianBlur","feOffset","feBlend","feColorMatrix"];oo.forEach(l=>{window._[l]=(...I)=>so(l,...I)}),_.DOM_ELEMENTS=oo,_.fragment=(...l)=>l,_.dynamic=function(l){const I=document.createComment("dyn"),J=document.createDocumentFragment();J.appendChild(I);let $=null;return Q.reactive.effect(()=>{const D=l();if($&&$.parentNode&&$.parentNode.removeChild($),$=null,D==null)return;let me=D;(typeof D=="string"||typeof D=="number")&&(me=document.createTextNode(String(D)));const G=I.parentNode;G&&me&&me.nodeType&&(G.insertBefore(me,I.nextSibling),$=me)}),J};function io(){let l=!1;const I=new Set;function J(){var D,me,G;l=!1,(D=Q.debug)==null||D.inc("rodFlushes"),(me=Q.perf)==null||me.inc("rodFlushes"),(G=Q.perf)==null||G.mark("rod:flush");const $=Array.from(I);I.clear();for(const pe of $)try{pe()}catch(Ee){console.error("[rod] flush error:",Ee)}}return function(D){I.add(D),l||(l=!0,queueMicrotask(J))}}const Uo=io();function lo(l,I,J){if(!l)return;if(l.nodeType===3){l.textContent=J!=null?J:"";return}gs(l,{isSVG:l.namespaceURI===no,normalizeClass:Bn,isContentProp:ds}).applyBindingValue(I,J)}function Lo(l){return{type:"rod",value:l,_bindings:[],_actions:[],_disposeHooks:[],_disposed:!1,_silentDepth:0,_pending:!1,bindings(){return this._bindings.map(J=>({el:J.el,key:J.key}))},onDispose(J){return typeof J=="function"&&this._disposeHooks.push(J),this},_bind(J,$={key:"auto"}){var G;if(this._disposed)return()=>{};if(!J)return()=>{};const D={el:J,key:(G=$==null?void 0:$.key)!=null?G:"auto"};return this._bindings.some(pe=>pe.el===D.el&&pe.key===D.key)||this._bindings.push(D),lo(D.el,D.key,this.value),()=>{this._bindings=this._bindings.filter(pe=>!(pe.el===D.el&&pe.key===D.key))}},action(J){return!this._disposed&&typeof J=="function"&&this._actions.push(J),this},_setSilent(J){this._silentDepth++;try{this.value=J}finally{this._silentDepth--}return this},_scheduleNotify(){this._disposed||this._pending||(this._pending=!0,Uo(()=>{this._pending=!1,this._notifyNow()}))},_notifyNow(){var $,D,me,G,pe;if(this._disposed)return;const J=performance.now();($=Q.perf)==null||$.inc("rodNotifies"),this._bindings=this._bindings.filter(Ee=>{const ve=Ee.el;return ve?ve.nodeType===3?!!ve.parentNode:ve.isConnected!==!1:!1});for(const Ee of this._bindings)lo(Ee.el,Ee.key,this.value);if(!(this._silentDepth>0)){for(const Ee of this._actions)try{Ee(this.value)}catch(ve){console.error("[rod] action error:",ve)}(D=Q.debug)==null||D.inc("rodNotifies"),(pe=Q.perf)==null||pe.tick("rod:notify",performance.now()-J,{bindings:((me=this._bindings)==null?void 0:me.length)||0,actions:((G=this._actions)==null?void 0:G.length)||0})}},dispose(){if(!this._disposed){this._disposed=!0;for(const J of this._disposeHooks)try{J()}catch($){console.error("[rod] dispose hook error:",$)}this._bindings.length=0,this._actions.length=0,this._disposeHooks.length=0}}}}function fs(l,I="value"){var G;let J=l[I],$=null,D=null,me=null;return(G=Q==null?void 0:Q.reactive)!=null&&G.signal&&([$,D,me]=Q.reactive.signal(J),me&&typeof l.onDispose=="function"&&l.onDispose(me)),Object.defineProperty(l,I,{get(){return $?$():J},set(pe){D?D(pe):J=pe,l._scheduleNotify()},configurable:!0}),typeof l.val!="function"&&Object.defineProperty(l,"val",{value(pe){return arguments.length?(this.value=pe,pe):this.value},configurable:!0}),l[Symbol.toPrimitive]||Object.defineProperty(l,Symbol.toPrimitive,{value(pe){const Ee=this.value;if(Ee==null)return Ee;const ve=typeof Ee;return pe==="number"?Number(Ee):(ve!=="symbol"&&Ps(this,Ee),ve==="string"||ve==="number"||ve==="boolean"||ve==="bigint"||ve==="symbol"?Ee:String(Ee))},configurable:!0}),l.valueOf||Object.defineProperty(l,"valueOf",{value(){return this.value},configurable:!0}),l.toString||Object.defineProperty(l,"toString",{value(){return String(this.value)},configurable:!0}),l}_.rod=function(I,J="value"){const $=Lo(I);return fs($,J),Q.rod._all=Q.rod._all||new Set,Q.rod._all.add($),typeof $.onDispose=="function"&&$.onDispose(()=>Q.rod._all.delete($)),$},Q.rodBind=function(l,I,J={key:"auto"}){var $,D,me;if(($=Q.debug)==null||$.inc("rodBinds"),!l)return(D=Q.debug)==null||D.inc("rodBindNull"),(me=Q.debug)==null||me.warn("rodBind: target element \xE8 null/undefined",J),()=>{};if(!I||I.type!=="rod")throw new Error("JSswift.rodBind: react must be a rod object");return I._bind(l,J)},Q.rodFromSignal=function(l,I){const J=_.rod(l());let $=!1;const D=Q.reactive.effect(()=>{const G=J.value,pe=Q.reactive.untracked(()=>l());if(!$&&pe!==G){$=!0;try{I(G)}finally{$=!1}}}),me=Q.reactive.effect(()=>{const G=l();if(Q.reactive.untracked(()=>J.value)!==G){$=!0;try{J._setSilent(G)}finally{$=!1}}});return typeof J.onDispose=="function"&&(J.onDispose(D),J.onDispose(me)),J};function In(l){if(!l||!l.tagName)return null;const I=l.tagName.toLowerCase();if(I==="input"){const J=(l.type||"text").toLowerCase();return J==="checkbox"?"checkbox":J==="radio"?"radio":J==="number"?"number":"text"}return I==="select"?l.multiple?"select-multiple":"select":null}Q.rodModel=function(l,I,J={}){var Ue,et,yt;if(!I||I.type!=="rod")throw new Error("[JSswift.rodModel] rodObj deve essere un rod");const $=Array.isArray(l)||l instanceof NodeList?Array.from(l):[l],D=(Ue=J.event)!=null?Ue:"change",me=(et=J.parse)!=null?et:(st=>st),G=(yt=J.format)!=null?yt:(st=>st);let pe=!1;const Ee=[],ve=st=>{for(const tt of $){if(!tt)continue;switch(In(tt)){case"checkbox":tt.checked=!!st;break;case"radio":tt.checked=tt.value==st;break;case"select":tt.value=st!=null?st:"";break;case"select-multiple":const Ne=Array.isArray(st)?st.map(String):[];for(const Fe of tt.options)Fe.selected=Ne.includes(Fe.value);break;default:tt.value=st!=null?st:""}}},xe=st=>{if(!pe){pe=!0;try{ve(G(st))}finally{pe=!1}}};I.action(xe),ve(G(I.value));for(const st of $){if(!st)continue;const tt=In(st),Pe=()=>{if(pe)return;let Ne;switch(tt){case"checkbox":Ne=st.checked;break;case"radio":if(!st.checked)return;Ne=st.value;break;case"select":Ne=st.value;break;case"select-multiple":Ne=Array.from(st.selectedOptions).map(Fe=>Fe.value);break;case"number":Ne=me(st.value===""?null:Number(st.value));break;default:Ne=me(st.value)}pe=!0;try{I.value!==Ne&&(I.value=Ne)}finally{pe=!1}};st.addEventListener(D,Pe),Ee.push(()=>st.removeEventListener(D,Pe))}let Le=!1;const Re=()=>{var Pe,Ne,Fe,ut;if(Le)return;Le=!0,Ee.splice(0).forEach(dt=>dt());const st=(Ne=(Pe=I._actions)==null?void 0:Pe.indexOf(xe))!=null?Ne:-1;st>=0&&I._actions.splice(st,1);const tt=(ut=(Fe=I._disposeHooks)==null?void 0:Fe.indexOf(Re))!=null?ut:-1;tt>=0&&!I._disposed&&I._disposeHooks.splice(tt,1)};return typeof I.onDispose=="function"&&I.onDispose(Re),Re},Q.signalModel=function(l,I,J,$={}){const D=Q.rodFromSignal(I,J),me=Q.rodModel(l,D,$);return()=>{me(),D.dispose()}};function Bt(l){if(!l)return;const I=Q._cleanupRegistry.get(l);if(I){for(const J of I)try{J()}catch($){console.error("[cleanup] error:",$)}Q._cleanupRegistry.delete(l)}if(l.childNodes&&l.childNodes.length)for(const J of l.childNodes)Bt(J)}function Io(l){const I=J=>typeof J=="string"?Q.dom.q(J):J;return Array.isArray(l)?l.map(I).filter(Boolean):[I(l)].filter(Boolean)}function bs(l){const I=[],J=[],$=D=>{if(D!=null){if(typeof D=="function"){$(D());return}if(D&&typeof D=="object"&&"node"in D){typeof D.dispose=="function"&&J.push(D.dispose),$(D.node);return}if(Array.isArray(D)){for(const me of D)$(me);return}if(typeof D=="string"||typeof D=="number"){I.push(document.createTextNode(String(D)));return}if(D.nodeType){I.push(D);return}console.warn("[JSswift.mount] contenuto non supportato:",D)}};return $(l),{nodes:I,disposers:J}}function Zn(l=[],I="[JSswift.mount] dispose error:"){let J=!1;return()=>{if(!J){J=!0;for(const $ of l)try{$()}catch(D){console.error(I,D)}}}}function ws(l=[],I=null){return Zn([...I?[I]:[],...l],"[component] dispose error:")}Q.mount=function(l,I,J={}){var Ee;const $=Io(l),D=(Ee=J.clear)!=null?Ee:!0,me=$.length>1;if($.length===0)return console.warn("[JSswift.mount] nessun target valido:",l),()=>{};const G=[];for(const ve of $){if(D)for(;ve.firstChild;)Bt(ve.firstChild),ve.removeChild(ve.firstChild);const{nodes:xe,disposers:Le}=bs(I);let Re=xe;me&&typeof I!="function"&&(Re=xe.map(et=>et.cloneNode(!0)),Le.length&&console.warn("[JSswift.mount] multi-target con dispose: usa content come function per istanze separate."));const Ue=Zn(Le);for(const et of Re)ve.appendChild(et);G.push({root:ve,nodes:Re,dispose:Ue});for(const et of Re)!et||!et.nodeType||Q._registerCleanup(et,Ue)}return()=>{var ve;for(const xe of G){for(const Le of xe.nodes)Le&&(Bt(Le),Le.parentNode===xe.root&&xe.root.removeChild(Le));(ve=xe.dispose)==null||ve.call(xe)}}},Q.component=function(l){if(typeof l!="function")throw new Error("JSswift.component: renderFn must be a function");return function(J={}){const $=[],me=l(J,{onDispose(G){typeof G=="function"&&$.push(G)}});return me&&typeof me=="object"&&"node"in me?{node:me.node,dispose:ws($,typeof me.dispose=="function"?me.dispose:null)}:{node:me,dispose:ws($)}}},Q.enableAutoCleanup=function(){if(Q._autoCleanupEnabled)return;Q._autoCleanupEnabled=!0;const l=new MutationObserver(I=>{for(const J of I)for(const $ of J.removedNodes)Bt($)});l.observe(document.body,{childList:!0,subtree:!0}),Q._cleanupObserver=l},Q.debug=(()=>{const l={rodFlushes:0,rodNotifies:0,rodBinds:0,rodBindNull:0,rodBindDup:0};function I(){return!!Q.config.debug}function J(...Ee){I()&&console.log("[JSswift]",...Ee)}function $(...Ee){I()&&console.warn("[JSswift]",...Ee)}function D(...Ee){console.error("[JSswift]",...Ee)}function me(Ee,ve=1){l[Ee]||(l[Ee]=0),l[Ee]+=ve}function G(){return{...l}}function pe(){for(const Ee of Object.keys(l))l[Ee]=0}return{enabled:I,log:J,warn:$,error:D,inc:me,stats:G,reset:pe}})(),Q.perf=(()=>{let l=!1;const I={effectsRun:0,effectsSlow:0,rodNotifies:0,rodFlushes:0,domWrites:0,httpRequests:0},J=[],$=[],D={timelineMax:200,slowEffectMs:8};function me(){return typeof performance!="undefined"&&performance.now?performance.now():Date.now()}function G(Fe,ut=0,dt=null){l&&(J.push({t:Date.now(),type:Fe,ms:ut,meta:dt}),J.length>D.timelineMax&&J.shift())}function pe(Fe,ut=1){l&&(I[Fe]=(I[Fe]||0)+ut)}function Ee(Fe,ut){l&&($.push({t:Date.now(),ms:Fe,meta:ut}),$.length>100&&$.shift())}let ve=null;function xe(){ve||(ve=Q.reactive.effect,Q.reactive.effect=function(Fe,ut){return ve((...kt)=>{const It=me();pe("effectsRun");try{return Fe(...kt)}finally{const Wt=me()-It;Wt>=D.slowEffectMs?(pe("effectsSlow"),Ee(Wt,ut||Fe.name||"effect"),G("effect:slow",Wt,ut||Fe.name||null)):G("effect",Wt,ut||Fe.name||null)}})})}function Le(){ve&&(Q.reactive.effect=ve,ve=null)}function Re(Fe=!0){return l=!!Fe,l?xe():Le(),l}function Ue(){for(const Fe of Object.keys(I))I[Fe]=0;J.length=0,$.length=0}function et(){return{enabled:l,...I,slowEffectMs:D.slowEffectMs,timelineSize:J.length}}function yt(){return J.slice()}function st(Fe=D.slowEffectMs){return $.filter(ut=>ut.ms>=Fe).slice().sort((ut,dt)=>dt.ms-ut.ms)}function tt(Fe,ut){const dt=me();try{return ut()}finally{const kt=me()-dt;G("time:"+Fe,kt,Fe)}}function Pe(Fe,ut){G(Fe,0,ut)}function Ne(Fe,ut,dt){G(Fe,ut,dt)}return{enable:Re,reset:Ue,stats:et,timeline:yt,slowEffects:st,time:tt,mark:Pe,tick:Ne,inc:pe,cfg:D}})(),Q.rod=Q.rod||{},Q.rod.inspect=function(l,I="rod"){if(!l||l.type!=="rod")return console.warn("[JSswift.rod.inspect] non \xE8 un rod:",l),null;const J=typeof l.bindings=="function"?l.bindings():[],$={label:I,value:l.value,bindingsCount:J.length,bindings:J.map(D=>{var me,G,pe,Ee,ve,xe,Le;return{key:D.key,el:((me=D.el)==null?void 0:me.nodeType)===3?"#text":(G=D.el)==null?void 0:G.tagName,id:((pe=D.el)==null?void 0:pe.id)||null,className:((Ee=D.el)==null?void 0:Ee.className)||null,isConnected:((ve=D.el)==null?void 0:ve.nodeType)===3?!!D.el.parentNode:(Le=(xe=D.el)==null?void 0:xe.isConnected)!=null?Le:null}}),actionsCount:Array.isArray(l._actions)?l._actions.length:null,disposed:!!l._disposed};return Q.config.debug?(console.groupCollapsed(`[JSswift.rod.inspect] ${I}`),console.log($),console.groupEnd()):console.log($),$},Q.rod.inspectAll=function(){const l=Q.rod._all?Array.from(Q.rod._all):[];return l.forEach((I,J)=>Q.rod.inspect(I,`rod#${J+1}`)),l.length},Q._storeShared=(()=>{function l(me){return`${me.storage}::${me.prefix}`}function I(me,G){function pe(Le={}){var Ue,et;const Re={storage:(Ue=Le.storage)!=null?Ue:me.storage,prefix:(et=Le.prefix)!=null?et:me.prefix};return G.set(l(Re),Re),Re}function Ee(Le=null){var Ue;return(typeof Le=="string"?Le:(Ue=Le==null?void 0:Le.storage)!=null?Ue:me.storage)==="session"?window.sessionStorage:window.localStorage}function ve(Le,Re=null){return(Re||pe()).prefix+Le}function xe(Le,Re=null){const Ue=Re||pe();return`${l(Ue)}::${Le}`}return{getScope:pe,getStorage:Ee,fullKey:ve,channelKey:xe}}function J(me){try{return JSON.parse(me)}catch(G){return}}function $(me){try{return JSON.stringify(me)}catch(G){return}}function D(me,...G){const pe=`${me.storage}::${me.prefix}::`;for(const Ee of G)for(const ve of Array.from(Ee.keys()))ve.startsWith(pe)&&Ee.delete(ve)}return{createScopeTools:I,safeParse:J,safeStringify:$,clearScopedMapEntries:D}})(),Q.store=(()=>{const l={prefix:"JSswift:",storage:"local",syncTabs:!0,writeDelay:0},I=new Map,J=new Map,$=new Map,D=new Map;let me=!1;const{createScopeTools:G,safeParse:pe,safeStringify:Ee,clearScopedMapEntries:ve}=Q._storeShared,{getScope:xe,getStorage:Le,fullKey:Re,channelKey:Ue}=G(l,D);function et(Qe,St,_t=null){var ot;const Tt=_t||xe(),Ve=J.get(Ue(Qe,Tt));if(Ve)for(const zt of Ve)try{(ot=Q.reactive)!=null&&ot.untracked?Q.reactive.untracked(()=>zt(St)):zt(St)}catch($t){console.error("[store] watcher error:",$t)}}function yt(){me=!1;for(const[Qe,St]of Array.from($.entries())){$.delete(Qe);const _t=I.get(Qe),Tt=Ee(_t);if(Tt===void 0)continue;const Ve=Le(St.scope);try{Ve.setItem(Re(St.key,St.scope),Tt)}catch(ot){console.error("[store] write error:",ot)}}}function st(Qe,St=null){const _t=St||xe();$.set(Ue(Qe,_t),{key:Qe,scope:_t}),!me&&(me=!0,l.writeDelay>0?setTimeout(yt,l.writeDelay):queueMicrotask(yt))}function tt(Qe,St=null){const _t=St||xe(),Ve=Le(_t).getItem(Re(Qe,_t));if(Ve!=null)return pe(Ve)}function Pe(Qe,St,_t=null){const Tt=_t||xe(),Ve=Ue(Qe,Tt);if(I.has(Ve))return I.get(Ve);const ot=tt(Qe,Tt);return ot!==void 0?(I.set(Ve,ot),ot):St}function Ne(Qe,St,_t=null){const Tt=_t||xe();return I.set(Ue(Qe,Tt),St),st(Qe,Tt),et(Qe,St,Tt),St}function Fe(Qe,St=null){const _t=St||xe(),Tt=Ue(Qe,_t);I.delete(Tt),$.delete(Tt);try{Le(_t).removeItem(Re(Qe,_t))}catch(Ve){}et(Qe,void 0,_t)}function ut(Qe={}){const St=xe(Qe),_t=Le(St),Tt=[];for(let Ve=0;Ve<_t.length;Ve++){const ot=_t.key(Ve);ot&&ot.startsWith(St.prefix)&&Tt.push(ot)}for(const Ve of Tt)_t.removeItem(Ve);ve(St,I,$,J)}function dt(Qe,St,_t=null){if(typeof St!="function")return()=>{};const Tt=_t||xe(),Ve=Ue(Qe,Tt);return J.has(Ve)||J.set(Ve,new Set),J.get(Ve).add(St),()=>{var ot;return(ot=J.get(Ve))==null?void 0:ot.delete(St)}}function kt(Qe,St,_t={}){const Tt=xe({storage:_t.storage,prefix:_t.prefix}),Ve=Pe(Qe,St,Tt),[ot,zt,$t]=Q.reactive.signal(Ve),Ct=Q.reactive.effect(()=>{const o=ot();Ne(Qe,o,Tt)}),ht=dt(Qe,o=>{ot()!==o&&zt(o)},Tt);return[ot,zt,()=>{try{Ct==null||Ct()}catch(o){}try{ht==null||ht()}catch(o){}try{$t==null||$t()}catch(o){}}]}xe(),l.syncTabs&&window.addEventListener("storage",Qe=>{if(!(!Qe.key||!Qe.storageArea))for(const St of D.values()){if(Le(St)!==Qe.storageArea||!Qe.key.startsWith(St.prefix))continue;const _t=Qe.key.slice(St.prefix.length),Tt=Qe.newValue==null?void 0:pe(Qe.newValue),Ve=Ue(_t,St);Tt===void 0?I.delete(Ve):I.set(Ve,Tt),et(_t,Tt,St)}});function It(Qe={}){Object.assign(l,Qe),xe()}function Wt(){return{prefix:l.prefix,storage:l.storage,syncTabs:l.syncTabs,cacheSize:I.size,scopeCount:D.size}}return{configure:It,stats:Wt,get:Pe,set:Ne,remove:Fe,clear:ut,watch:dt,signal:kt}})(),Q.store.computed=function(l){if(typeof l!="function")throw new Error("store.computed: fn must be a function");return Q.reactive.computed(l)},Q.store.migrate=function(l,I,J={}){var pe,Ee;const $=(pe=J.versionKey)!=null?pe:"__version",D=Number((Ee=Q.store.get($,0))!=null?Ee:0),me=Number(l!=null?l:0);if(!Number.isFinite(me)||me<0)throw new Error("store.migrate: targetVersion non valido");if(D>=me)return{from:D,to:me,applied:0};let G=0;for(let ve=D;ve<me;ve++){const xe=I==null?void 0:I[ve];if(typeof xe=="function")try{xe(Q.store)}catch(Le){console.error("[store.migrate] step error at version",ve,Le)}G++,Q.store.set($,ve+1)}return{from:D,to:me,applied:G}},Q.store.model=function(l,I,J,$={}){if(typeof I!="string"||!I)throw new Error("store.model: key deve essere una stringa non vuota");const[D,me,G]=Q.store.signal(I,J,{storage:$.storage,prefix:$.prefix}),pe=Q.rodFromSignal(D,me),Ee=Q.rodModel(l,pe,{event:$.event,parse:$.parse,format:$.format});return()=>{var ve;try{Ee==null||Ee()}catch(xe){}try{G==null||G()}catch(xe){}try{(ve=pe.dispose)==null||ve.call(pe)}catch(xe){}}},Q.store.bind=function(l,I,J,$={}){var me;let D=l;return typeof l=="string"&&(l.includes("[")||l.includes(" ")?D=document.querySelectorAll(l):D=Q.dom.q(l)),D?Q.store.model(D,I,J,$):((me=Q.config)!=null&&me.debug&&console.warn("[store.bind] target non trovato:",l),()=>{})},Q.store.bindAll=function(l,I={},J={}){if(typeof l=="string"&&(l=Q.dom.q(l)),!l||!l.querySelectorAll)return console.warn("[store.bindAll] form non valido:",l),()=>{};const $=[];for(const[D,me]of Object.entries(I)){const G=l.querySelectorAll(`[name="${D}"]`);if(!G.length)continue;const pe=Q.store.model(G.length===1?G[0]:G,D,me,J);$.push(pe)}return()=>$.forEach(D=>D())},Q.store.inspect=function(){const l={...Q.store.stats(),keys:Array.from((function(){const I=Q.store.stats().storage==="session"?sessionStorage:localStorage,J=[];for(let $=0;$<I.length;$++){const D=I.key($);D&&D.startsWith(Q.store.stats().prefix)&&J.push(D.replace(Q.store.stats().prefix,""))}return J})())};return console.groupCollapsed("[JSswift.store.inspect]"),console.table(l.keys),console.log(l),console.groupEnd(),l},Q.store.autoForm=function(l,I={},J={}){var D;const $=Q.store.bindAll(l,I,J);return(D=Q.config)!=null&&D.debug&&console.log("[store.autoForm] autosave attivo:",I),$},Q.useStore=function(l,I,J,$={}){const[D,me,G]=Q.store.signal(l,I,$);return J&&typeof J.onDispose=="function"&&typeof G=="function"&&J.onDispose(G),[D,me]},Q._plugins=new Set,Q.usePlugin=function(l,I){var J;if(l){if(Q._plugins.has(l)){(J=Q.config)!=null&&J.debug&&console.warn("[JSswift.usePlugin] plugin gi\xE0 installato:",l.name||l);return}if(typeof l=="function"){l(Q,I),Q._plugins.add(l);return}if(l&&typeof l.install=="function"){l.install(Q,I),Q._plugins.add(l);return}console.warn("[JSswift.usePlugin] plugin non valido:",l)}},Q.plugins=Q.plugins||{},Q.plugins.debug={install(l){l.config.debug=!0,console.log("[JSswift] Debug mode ON")}},Q.plugins.forms={install(l){const I={};l.forms={validate(J,$={},D={}){var xe,Le;if(typeof J=="string"&&(J=l.dom.q(J)),!J||!J.querySelectorAll)return console.warn("[forms.validate] form non valido:",J),null;const me={mode:D.mode||"input",showMessages:(xe=D.showMessages)!=null?xe:!0,submitGuard:(Le=D.submitGuard)!=null?Le:!0,errorClass:D.errorClass||"is-invalid",validClass:D.validClass||"is-valid",messageClass:D.messageClass||"form-error"},G={};for(const[Re,Ue]of Object.entries($)){const et=J.querySelectorAll(`[name="${Re}"]`);if(!et.length)continue;const[yt,st]=l.reactive.signal(null);G[Re]={getErr:yt,setErr:st,els:et};let tt=null;me.showMessages&&(tt=document.createElement("div"),tt.className=me.messageClass,et[et.length-1].after(tt));const Pe=()=>{let Ne;const Fe=et[0];if(Fe.type==="checkbox")Ne=Fe.checked;else if(Fe.type==="radio"){const kt=Array.from(et).find(It=>It.checked);Ne=kt?kt.value:null}else Ne=Fe.value;let ut=!0;try{ut=Ue(Ne)}catch(kt){ut=kt.message||"Errore di validazione"}const dt=ut===!0?null:typeof ut=="string"?ut:"Valore non valido";return st(dt),!dt};for(const Ne of et)Ne.addEventListener(me.mode,Pe);l.reactive.effect(()=>{const Ne=yt();for(const Fe of et)Fe.classList.toggle(me.errorClass,!!Ne),Fe.classList.toggle(me.validClass,!Ne);tt&&(tt.textContent=Ne||"",tt.style.display=Ne?"block":"none")}),Pe()}const pe=l.store.computed(()=>Object.values(G).every(Re=>!Re.getErr())),Ee=Re=>{let Ue=!0;for(const et of Object.values(G)){const yt=et.els[0];yt&&yt.dispatchEvent(new Event(me.mode,{bubbles:!0})),et.getErr()&&(Ue=!1)}!Ue&&me.submitGuard&&(Re.preventDefault(),Re.stopPropagation())};me.submitGuard&&J.addEventListener("submit",Ee);const ve=()=>{me.submitGuard&&J.removeEventListener("submit",Ee)};return I[J]={isValid:pe,dispose:ve},{isValid:pe,dispose:ve}}}}},Q._authShared=(()=>{function l($){const D=()=>{var G;return((G=$())==null?void 0:G.roles)||[]},me=()=>{var G;return((G=$())==null?void 0:G.permissions)||[]};return{roles:D,perms:me,hasRole:G=>D().includes(G),can:G=>me().includes(G),canAny:G=>G.some(pe=>D().includes(pe)||me().includes(pe)),canAll:G=>G.every(pe=>D().includes(pe)||me().includes(pe))}}function I($,D){return D.some(me=>typeof me=="string"?$.startsWith(me):me instanceof RegExp?me.test($):!1)}function J($,D){if(!$||!D)return;let me=!1;function G(){return Date.now()}function pe(Re){if(!Re||typeof Re!="string")return null;const Ue=Re.split(".");if(Ue.length<2)return null;try{const et=Ue[1].replace(/-/g,"+").replace(/_/g,"/"),yt=decodeURIComponent(atob(et).split("").map(st=>"%"+st.charCodeAt(0).toString(16).padStart(2,"0")).join(""));return JSON.parse(yt)}catch(et){return null}}function Ee(){var Re,Ue,et,yt;if(typeof D._getState=="function"){const st=D._getState();return st&&typeof st=="object"?st:{user:(Ue=(Re=D.user)==null?void 0:Re.call(D))!=null?Ue:null}}return{user:(yt=(et=D.user)==null?void 0:et.call(D))!=null?yt:null}}function ve(){var Pe,Ne,Fe;const Re=Ee()||{},Ue=(Ne=Re.user)!=null?Ne:(Pe=D.user)==null?void 0:Pe.call(D),et=(Ue==null?void 0:Ue.name)||(Ue==null?void 0:Ue.email)||(Ue==null?void 0:Ue.id)||"anon",yt=!!((Fe=D.isAuth)!=null&&Fe.call(D)),st=Re.expiresAt||null,tt=st?st-G():null;return yt?`AUTH \u2705 user=${et}${st?` expiresIn=${Math.round(tt/1e3)}s`:""}`:`AUTH \u274C user=${et}`}function xe(Re="auth"){var It,Wt,Qe;const Ue=Ee()||{},et=(Wt=Ue.user)!=null?Wt:(It=D.user)==null?void 0:It.call(D),yt=(et==null?void 0:et.roles)||[],st=(et==null?void 0:et.permissions)||[],tt=Ue.accessToken||null,Pe=Ue.refreshToken||null,Ne=tt?pe(tt):null,Fe=Ue.expiresAt||(Ne!=null&&Ne.exp?Ne.exp*1e3:null),ut=G(),dt=Fe?Fe-ut:null,kt={label:Re,isAuth:!!((Qe=D.isAuth)!=null&&Qe.call(D)),user:et,roles:yt,permissions:st,has:{role:St=>{var _t;return!!((_t=D.hasRole)!=null&&_t.call(D,St))},can:St=>{var _t;return!!((_t=D.can)!=null&&_t.call(D,St))}},token:{hasAccess:!!tt,hasRefresh:!!Pe,expiresAt:Fe,expiresInSec:dt==null?null:Math.round(dt/1e3),decodedJWT:Ne}};return console.groupCollapsed(`[JSswift.auth.inspect] ${Re}`),console.log("status:",ve()),console.log(kt),dt!=null&&(dt<=0?console.warn("\u26A0\uFE0F Access token scaduto."):dt<6e4&&console.warn("\u26A0\uFE0F Access token in scadenza (<60s).")),console.groupEnd(),kt}function Le(Re=!0){me=!!Re,console.log("[JSswift.auth.trace]",me?"ON":"OFF")}if(typeof D.fetch=="function"&&!D._fetchWrapped){const Re=D.fetch.bind(D);D.fetch=async(...Ue)=>{const et=await Re(...Ue);if(me)try{console.log("[auth.fetch]",et.status,Ue[0])}catch(yt){}return et},D._fetchWrapped=!0}D.decodeJWT=pe,D.status=ve,D.inspect=xe,D.trace=Le}return{createPermissionApi:l,matchesProtectedPath:I,attachDevTools:J}})(),Q.plugins.auth={install(l,I={}){var ut;const{createPermissionApi:J,matchesProtectedPath:$,attachDevTools:D}=Q._authShared,me={key:I.key||"auth",loginRoute:I.loginRoute||"/login",protected:I.protected||[],autoRedirect:(ut=I.autoRedirect)!=null?ut:!0,endpoints:I.endpoints||{login:"/api/login",refresh:"/api/refresh",logout:"/api/logout"},fetchOptions:I.fetchOptions||{},tokenHeader:I.tokenHeader||"Authorization",tokenPrefix:I.tokenPrefix||"Bearer ",refreshMargin:I.refreshMargin||3e4},[G,pe]=l.store.signal(me.key,null),Ee=()=>{var dt;return((dt=G())==null?void 0:dt.user)||null},ve=()=>{var dt;return!!((dt=G())!=null&&dt.accessToken)},{hasRole:xe,can:Le,canAny:Re,canAll:Ue}=J(Ee);let et=!1,yt=[];function st(){const dt=G();return dt!=null&&dt.expiresAt?Date.now()>dt.expiresAt-me.refreshMargin:!1}async function tt(){var dt;if(et)return new Promise((kt,It)=>yt.push({res:kt,rej:It}));et=!0;try{const kt=await fetch(me.endpoints.refresh,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({refreshToken:(dt=G())==null?void 0:dt.refreshToken})});if(!kt.ok)throw new Error("Refresh failed");const It=await kt.json();return pe({...G(),...It}),yt.forEach(Wt=>Wt.res(!0)),yt=[],!0}catch(kt){throw yt.forEach(It=>It.rej(kt)),yt=[],pe(null),me.autoRedirect&&l.router.navigate(me.loginRoute),kt}finally{et=!1}}async function Pe(dt){const kt=await fetch(me.endpoints.login,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(dt)});if(!kt.ok)throw new Error("Login failed");const It=await kt.json();return pe(It),It}async function Ne(){try{await fetch(me.endpoints.logout,{method:"POST"})}catch(dt){}pe(null),me.autoRedirect&&l.router.navigate(me.loginRoute)}async function Fe(dt,kt={}){var St;st()&&await tt();const It=G(),Wt=new Headers(kt.headers||{});It!=null&&It.accessToken&&Wt.set(me.tokenHeader,me.tokenPrefix+It.accessToken);const Qe=await fetch(dt,{...me.fetchOptions,...kt,headers:Wt});return Qe.status===401&&((St=G())!=null&&St.refreshToken)&&!kt._authRetried?(await tt(),Fe(dt,{...kt,_authRetried:!0})):Qe}l.router.beforeEach(dt=>{const kt=dt.path;return $(kt,me.protected)&&!ve()?me.loginRoute:!0}),l.auth={user:Ee,isAuth:ve,hasRole:xe,can:Le,canAny:Re,canAll:Ue,loginAsync:Pe,logoutAsync:Ne,fetch:Fe,_getState:G},l.useAuth=function(dt){return dt&&dt.onDispose,l.auth},D(Q,l.auth)}},Q._httpShared=(()=>{function l(ve){var Tt;const xe=ve.reactive,[Le,Re]=xe.signal(0),[Ue,et]=xe.signal("idle"),[yt,st]=xe.signal(null),[tt,Pe]=xe.signal(null),[Ne,Fe]=xe.signal(null),[ut,dt]=xe.signal(0),[kt,It]=xe.signal(0);let Wt=0;function Qe(Ve){const ot=++Wt,zt=Date.now();return Re(Le()+1),et("pending"),Fe(null),Pe(null),st({id:ot,url:Ve.url,method:Ve.method,meta:Ve.meta,timeout:Ve.timeout,retry:Ve.retry,startedAt:zt}),It(zt),ot}function St(Ve,ot,zt,$t){const Ct=Date.now();Re(Math.max(0,Le()-1)),Ve===Wt&&(zt?(et("error"),Fe(zt),Pe(null)):ot?(et("success"),Fe(null),Pe({id:Ve,status:ot.status,ok:ot.ok,headers:ot.headers,url:ot.url,receivedAt:Ct,raw:ot})):(et("idle"),Fe(null),Pe(null)),dt(Math.max(0,Number($t||0)))),It(Ct)}return{state:{inFlight:Le,status:Ue,isLoading:(Tt=ve.store)!=null&&Tt.computed?ve.store.computed(()=>Le()>0):()=>Le()>0,lastRequest:yt,lastResponse:tt,lastError:Ne,lastDuration:ut,lastUpdated:kt,reset(){Re(0),et("idle"),st(null),Pe(null),Fe(null),dt(0),It(Date.now())}},markStart:Qe,markEnd:St}}function I(ve,xe){if(!ve||/^https?:\/\//i.test(xe))return xe;const Le=ve.endsWith("/")?ve.slice(0,-1):ve,Re=xe.startsWith("/")?xe:"/"+xe;return Le+Re}function J(ve){return new Promise(xe=>setTimeout(xe,ve))}function $(ve,xe){return ve?!0:xe?xe.status===429||xe.status>=500&&xe.status<=599:!1}function D(ve,xe){if(!ve&&!xe)return{signal:void 0,cancel:()=>{}};const Le=new AbortController,Re=Le.signal;let Ue=null;ve>0&&(Ue=setTimeout(()=>Le.abort(new Error("timeout")),ve));const et=()=>Le.abort(xe.reason||new Error("aborted"));return xe&&(xe.aborted?et():xe.addEventListener("abort",et,{once:!0})),{signal:Re,cancel:()=>{var st;Ue&&clearTimeout(Ue),xe&&((st=xe.removeEventListener)==null||st.call(xe,"abort",et))}}}function me(ve,xe,Le={}){var yt,st,tt;const Re=typeof xe=="string"?I(ve.baseURL,xe):xe,Ue=(Le.method||"GET").toUpperCase(),et=new Headers(ve.headers);return Le.headers&&new Headers(Le.headers).forEach((Pe,Ne)=>et.set(Ne,Pe)),{url:Re,method:Ue,headers:et,body:Le.body,credentials:(yt=Le.credentials)!=null?yt:ve.credentials,signal:Le.signal,timeout:(st=Le.timeout)!=null?st:ve.timeout,retry:(tt=Le.retry)!=null?tt:ve.retry,meta:Le.meta||{}}}async function G(ve,...xe){var Re;let Le=xe[0];for(const Ue of ve)Le=(Re=await Ue(Le,...xe.slice(1)))!=null?Re:Le;return Le}function pe(ve,xe){return{ok:ve.ok,status:ve.status,headers:ve.headers,raw:ve,req:xe,async json(){let Le=null,Re=null;try{Le=await ve.json()}catch(Ue){Le=null}return ve.ok||(Re=Le!=null?Le:{status:ve.status}),{data:Le,error:Re,ok:ve.ok,status:ve.status}},async jsonStrict(){const{data:Le,error:Re}=await this.json();if(Re){const Ue=new Error(`HTTP error ${ve.status} ${(xe==null?void 0:xe.method)||""} ${(xe==null?void 0:xe.url)||""}`.trim());throw Ue.status=ve.status,Ue.data=Le,Ue.req={url:xe==null?void 0:xe.url,method:xe==null?void 0:xe.method,meta:xe==null?void 0:xe.meta},Ue}return{data:Le,ok:!0,status:ve.status}},async text(){let Le="";try{Le=await ve.text()}catch(Re){}return{text:Le,ok:ve.ok,status:ve.status}},async textStrict(){const Le=await this.text();if(!Le.ok){const Re=new Error("HTTP error "+ve.status);throw Re.status=ve.status,Re.text=Le.text,Re}return Le}}}function Ee(ve,xe,Le,Re,Ue={}){const et=new Headers(Ue.headers||{});return et.has("Content-Type")||et.set("Content-Type","application/json"),ve(Le,{...Ue,method:xe,headers:et,body:Re==null?void 0:JSON.stringify(Re)})}return{createReactiveState:l,joinURL:I,sleep:J,isRetryable:$,makeAbort:D,normalizeRequest:me,runHooks:G,wrapResponse:pe,withJSON:Ee}})();const{createReactiveState:Rn,sleep:Hn,isRetryable:vs,makeAbort:Ss,normalizeRequest:ms,runHooks:Js,wrapResponse:ro,withJSON:es}=Q._httpShared,Wn=typeof globalThis!="undefined"&&globalThis.JSswift_setting?globalThis.JSswift_setting:{},ao={baseURL:(($s=Wn.http)==null?void 0:$s.baseURL)||"",timeout:(fo=(uo=Wn.http)==null?void 0:uo.timeout)!=null?fo:0,retry:((At=Wn.http)==null?void 0:At.retry)||{attempts:0,delay:250,factor:2},headers:((xs=Wn.http)==null?void 0:xs.headers)||{},credentials:(T=Wn.http)==null?void 0:T.credentials,debug:(Un=Wn.debug)!=null?Un:!1},Rs=Rn(Q),Cs=()=>typeof performance!="undefined"&&performance.now?performance.now():Date.now(),En={beforeRequest:new Set,afterResponse:new Set,onError:new Set};async function co(l){const I=Q.auth&&typeof Q.auth.fetch=="function"?Q.auth.fetch.bind(Q.auth):fetch,J={method:l.method,headers:l.headers,body:l.body,credentials:l.credentials,signal:l.signal};return I(l.url,J)}async function hn(l,I={}){var Ue,et,yt;let J=ms(ao,l,I);J=await Js(En.beforeRequest,J);const $=Rs.markStart(J),D=Cs(),me=J.retry||{attempts:0,delay:250,factor:2},G=Math.max(0,Number(me.attempts||0));let pe=Math.max(0,Number(me.delay||0));const Ee=Math.max(1,Number(me.factor||2));let ve=null,xe=null,Le=null,Re=null;try{for(let st=0;st<=G;st++){ve=null,xe=null;const{signal:tt,cancel:Pe}=Ss(J.timeout,I.signal),Ne={...J,signal:tt},Fe=Cs();try{ao.debug&&console.log("[http.request]",Ne.method,Ne.url),(Ue=Q.perf)==null||Ue.inc("httpRequests"),(et=Q.perf)==null||et.mark("http:req",{url:J.url,method:J.method});const ut=await co(Ne);xe=ut;const dt=await Js(En.afterResponse,ut,Ne),kt=Cs()-Fe;if((yt=Q.perf)==null||yt.tick("http:res",kt,{status:ut.status,url:J.url}),st<G&&vs(null,dt)){Pe(),await Hn(pe),pe=Math.round(pe*Ee);continue}return Pe(),Le=dt,ro(dt,Ne)}catch(ut){ve=ut,Pe();for(const dt of En.onError)try{dt(ut,Ne)}catch(kt){}if(st<G&&vs(ut,null)){await Hn(pe),pe=Math.round(pe*Ee);continue}throw Re=ut,ut}}}finally{const st=Cs()-D;Rs.markEnd($,Le,Re,st)}if(ve)throw ve;return ro(xe,J)}Q.http={},Q.http.request=hn,Q.http.state=()=>Rs.state,Q.http.get=(l,I)=>hn(l,{...I,method:"GET"}),Q.http.del=(l,I)=>hn(l,{...I,method:"DELETE"}),Q.http.post=(l,I,J)=>es(hn,"POST",l,I,J),Q.http.put=(l,I,J)=>es(hn,"PUT",l,I,J),Q.http.patch=(l,I,J)=>es(hn,"PATCH",l,I,J),Q.http.getJSON=async(l,I)=>(await hn(l,{...I,method:"GET"})).jsonStrict(),Q.http.delJSON=async(l,I)=>(await hn(l,{...I,method:"DELETE"})).jsonStrict(),Q.http.postJSON=async(l,I,J)=>(await es(hn,"POST",l,I,J)).jsonStrict(),Q.http.putJSON=async(l,I,J)=>(await es(hn,"PUT",l,I,J)).jsonStrict(),Q.http.patchJSON=async(l,I,J)=>(await es(hn,"PATCH",l,I,J)).jsonStrict(),Q.http.onBefore=function(l){return En.beforeRequest.add(l),()=>En.beforeRequest.delete(l)},Q.http.onAfter=function(l){return En.afterResponse.add(l),()=>En.afterResponse.delete(l)},Q.http.onError=function(l){return En.onError.add(l),()=>En.onError.delete(l)},window._http=Q.http,Q.useRouter=function(l){const I=Q.router;return l&&l.onDispose,{navigate:I.navigate,back:()=>history.back(),forward:()=>history.forward(),get current(){return I}}},Q.useRoute=function(l){const[I,J]=Q.reactive.signal(""),[$,D]=Q.reactive.signal({}),[me,G]=Q.reactive.signal({}),[pe,Ee]=Q.reactive.signal(""),ve=Le=>{J(Le.path||""),D(Le.params||{}),G(Le.query||{}),Ee(Le.hash||"")},xe=Q.router.subscribe(ve);return l&&typeof l.onDispose=="function"&&l.onDispose(xe),{path:I,params:$,query:me,hash:pe}},Q._routerShared=(()=>{function l(pe){return pe?(pe.startsWith("/")||(pe="/"+pe),pe.length>1&&pe.endsWith("/")&&(pe=pe.slice(0,-1)),pe):"/"}function I(pe,Ee=""){if(Ee&&pe.startsWith(Ee)){const ve=pe.slice(Ee.length)||"/";return l(ve)}return l(pe)}function J(pe){pe=l(pe);const Ee=[],ve=pe.replace(/([.+*?=^!${}()[\]|/\\])/g,"\\$1").replace(/\\\/:([A-Za-z0-9_]+)/g,(xe,Le)=>(Ee.push(Le),"\\/([^\\/]+)"));return{pattern:pe,regex:new RegExp("^"+ve+"$"),keys:Ee}}function $(pe){const Ee={};return new URLSearchParams(pe||"").forEach((xe,Le)=>{Ee[Le]===void 0?Ee[Le]=xe:Array.isArray(Ee[Le])?Ee[Le].push(xe):Ee[Le]=[Ee[Le],xe]}),Ee}function D(pe){const Ee=[];for(const ve of pe)if(Ee.push({...ve,_parent:null}),ve.children&&ve.children.length)for(const xe of ve.children)Ee.push({...xe,_parent:ve});return Ee.sort((ve,xe)=>xe.path.length-ve.path.length),Ee}function me(pe,Ee){const ve=l(pe),xe=D(Ee);for(const Le of xe){const Re=Le._compiled.regex.exec(ve);if(!Re)continue;const Ue={};return Le._compiled.keys.forEach((et,yt)=>{Ue[et]=decodeURIComponent(Re[yt+1])}),{route:Le,params:Ue,parent:Le._parent||null}}return null}function G(pe,Ee,ve=50){pe.push({at:Date.now(),path:Ee.path,params:Ee.params,query:Ee.query,hash:Ee.hash}),pe.length>ve&&pe.shift()}return{normalizePath:l,stripBase:I,compilePattern:J,parseQuery:$,flattenRoutes:D,matchRoute:me,pushHistoryEntry:G}})(),Q._uiMetaShared=(()=>{function l(G){return{hasTabPanel:typeof G.TabPanel=="function",Card:typeof G.Card=="function"?G.Card:(...pe)=>G.div({class:"cms-doc-card"},...pe),Chip:typeof G.Chip=="function"?G.Chip:(pe,Ee)=>G.span({class:"cms-chip cms-chip-fallback"},Ee)}}function I(G){return G?Array.isArray(G)?G.join(" | "):String(G):"\u2014"}function J(G,pe,Ee){return G.div({class:"cms-doc-meta"},G.div({class:"cms-doc-meta-head"},G.div({class:"cms-doc-meta-name"},pe.name),G.div({class:"cms-doc-meta-types"},...pe.type?String(pe.type).split("|").map(ve=>Ee({color:"secondary",dense:!0,outline:!0},ve)):[G.span("\u2014")])),G.div({class:"cms-doc-meta-grid"},G.div({class:"cms-doc-meta-block"},G.div({class:"cms-doc-meta-label"},"Default"),G.div({class:"cms-doc-meta-value"},pe.default==null?"\u2014":String(pe.default))),G.div({class:"cms-doc-meta-block"},G.div({class:"cms-doc-meta-label"},"Values"),G.div({class:"cms-doc-meta-value"},I(pe.values)))),G.div({class:"cms-doc-meta-block"},G.div({class:"cms-doc-meta-label"},"Description"),G.div({class:"cms-doc-meta-value"},pe.description||"\u2014")))}function $(G,pe){return G.div({class:"cms-doc-fallback"},pe.map(Ee=>G.div({class:"cms-doc-fallback-item"},G.h4({class:"cms-doc-fallback-title"},Ee.label||Ee.name),Ee.content)))}function D(G,pe){return pe?Array.isArray(pe)?pe.map(Ee=>({name:Ee.name,wrap:!0,label:Ee.name,content:G.div({class:"cms-p-md"},Ee.description)})):Object.entries(pe).map(([Ee,ve])=>({name:Ee,wrap:!0,label:Ee,content:G.div({class:"cms-p-md"},ve)})):[]}function me(G,pe){return pe?Array.isArray(pe)?pe.map(Ee=>({name:Ee.name,wrap:!0,label:Ee.type,content:Ee.description})):Object.entries(pe).map(([Ee,ve])=>({name:Ee,wrap:!0,label:Ee,content:G.div({class:"cms-doc-meta"},G.div({class:"cms-doc-meta-head"},G.div({class:"cms-doc-meta-name"},Ee)),G.div({class:"cms-doc-meta-grid"},G.div({class:"cms-doc-meta-block"},G.div({class:"cms-doc-meta-label"},"Type"),G.div({class:"cms-doc-meta-value"},ve.type||"\u2014"))),G.div({class:"cms-doc-meta-block"},G.div({class:"cms-doc-meta-label"},"Description"),G.div({class:"cms-doc-meta-value"},ve.description||"\u2014")))})):[]}return{resolveDocComponents:l,renderMetaItem:J,renderTabGroupFallback:$,normalizeEventRows:D,normalizeSlotRows:me}})(),Q.ui=Q.ui||{},Q.ui.meta=Q.ui.meta||{},Q.ui.slot=function(I,J={}){const $=Q.ui,{as:D="node",wrap:me="span",iconProps:G=null,filter:pe=!0}=J,Ee=Re=>document.createTextNode(String(Re)),ve=Re=>_.span(String(Re)),xe=Re=>{if(Re==null||Re===!1)return null;if(typeof Re=="function")return Re;if(Array.isArray(Re))return Re.flatMap(xe).filter(Boolean);if(Re&&typeof Re=="object"&&Re.nodeType)return Re;if(typeof Re=="string"||typeof Re=="number"||typeof Re=="boolean"){const Ue=String(Re);return D==="icon"&&$.Icon?$.Icon(Ue,{class:"cms-slot-icon",...G||{}}):me==="text"?Ee(Ue):me==="span"?ve(Ue):Ue}return me==="text"?Ee(Re):me==="span"?ve(Re):String(Re)},Le=xe(I);return pe&&Array.isArray(Le)?Le.filter(Boolean):Le},Q.ui.slots=function(...I){const J=[];for(const $ of I){const D=Q.ui.slot($);D&&(Array.isArray(D)?J.push(...D):J.push(D))}return J},Q.docTable=l=>{var tt;if(!Q.isDev())return _.div();const{resolveDocComponents:I,renderMetaItem:J,renderTabGroupFallback:$,normalizeEventRows:D,normalizeSlotRows:me}=Q._uiMetaShared,G=(tt=Q.ui.meta)==null?void 0:tt[l];if(!G)return _.div({class:"cms-muted"},`Meta non trovata: ${l}`);const{hasTabPanel:pe,Card:Ee,Chip:ve}=I(_),xe={};Object.entries(G.props||{}).forEach(([Pe,Ne])=>{const Fe=Ne.category||"general";xe[Fe]||(xe[Fe]=[]),xe[Fe].push({name:Pe,...Ne})});const Le=Object.keys(xe).map(Pe=>{const Ne=xe[Pe].map(Fe=>({name:Fe.name,wrap:!0,label:Fe.name,content:J(_,Fe,ve)}));return{name:Pe,wrap:!0,label:Pe,content:pe?_.TabPanel({orientation:"vertical",animated:!0,radius:"0 0 0 var(--cms-r-default)",tabs:Ne}):$(_,Ne)}}),Re=D(_,G.events),Ue=me(_,G.slots),et=_.rod(null),yt=[];Ue.length&&yt.push({name:"Slots",wrap:!0,label:"Slots",content:pe?_.TabPanel({animated:!0,radius:"0 0 0 var(--cms-r-default)",orientation:"vertical",tabs:Ue}):$(_,Ue)}),Le.length&&yt.push(...Le),Re.length&&yt.push({name:"Events",wrap:!0,label:"Events",content:pe?_.TabPanel({animated:!0,radius:"0 0 0 var(--cms-r-default)",orientation:"vertical",tabs:Re}):$(_,Re)});const st="general";return yt.sort((Pe,Ne)=>Pe.name===st?-1:Ne.name===st?1:Pe.name.localeCompare(Ne.name)),Ee({class:"cms-doc-table"},_.div({class:"cms-doc-table-header"},_.div({class:"cms-doc-table-title"},`_.${l}`),G.signature?_.div({class:"cms-doc-table-signature"},String(G.signature).replaceAll("UI.","_.")):null),yt.length?_.h4({class:"cms-doc-table-section-title"},Le.length?"Props":"Documentation"):_.p({class:"cms-muted"},"Nessuna documentazione strutturata disponibile."),yt.length?pe?_.TabPanel({border:!0,animated:!0,orientation:"horizontal",tabs:yt,model:et}):$(_,yt):null,G.returns?_.p({class:"cms-muted",style:{marginTop:"14px"}},`Returns: ${G.returns}`):null)},Q.ui.inspect=l=>{var I;return console.log(((I=Q.ui.meta)==null?void 0:I[l])||"meta not found")},Q.ui.can=function(l,I,J,$=null){var G,pe;const D=Q.useAuth?Q.useAuth(l):Q.auth;return D?(typeof I=="function"?!!I(D):((G=D.can)==null?void 0:G.call(D,I))||((pe=D.hasRole)==null?void 0:pe.call(D,I)))?typeof J=="function"?J():J:typeof $=="function"?$():$:typeof $=="function"?$():null},Q.ui.canAny=function(l,I,J,$=null){var G;const D=Q.useAuth?Q.useAuth(l):Q.auth;return!!((G=D==null?void 0:D.canAny)!=null&&G.call(D,I))?typeof J=="function"?J():J:typeof $=="function"?$():$},Q.ui.canAll=function(l,I,J,$=null){var G;const D=Q.useAuth?Q.useAuth(l):Q.auth;return!!((G=D==null?void 0:D.canAll)!=null&&G.call(D,I))?typeof J=="function"?J():J:typeof $=="function"?$():$},Q.Can=function(I,J){var me,G;const $=Q.useAuth?Q.useAuth(J):Q.auth;return(()=>{var pe,Ee,ve,xe;return $?I.when&&typeof I.when=="function"?!!I.when($):I.perm?!!((pe=$.can)!=null&&pe.call($,I.perm)):I.role?!!((Ee=$.hasRole)!=null&&Ee.call($,I.role)):I.any?!!((ve=$.canAny)!=null&&ve.call($,I.any)):I.all?!!((xe=$.canAll)!=null&&xe.call($,I.all)):!1:!1})()?typeof I.then=="function"?I.then():(me=I.then)!=null?me:null:typeof I.else=="function"?I.else():(G=I.else)!=null?G:null},Q.router=(()=>{let l="history",I=[],J=null,$=null,D="",me=null,G=null,pe=[],Ee=!1;const{normalizePath:ve,stripBase:xe,compilePattern:Le,parseQuery:Re,matchRoute:Ue,pushHistoryEntry:et}=Q._routerShared,yt={setOutlet:{description:"imposta il contenitore del router"},setBase:{description:"imposta il base path del router"},add:{description:"per aggiungere la route"},notFound:{description:"imposta la view 404"},beforeEach:{description:"hook prima di ogni navigazione"},start:{description:"avvia il router"},navigate:{description:"naviga verso una route"},subscribe:{description:"sottoscrive agli aggiornamenti di route"},current:{description:"ritorna l'URL corrente"},isActive:{description:"verifica se una route e\u0300 attiva"},status:{description:"stringa di stato router"},inspect:{description:"stampa info diagnostiche"},trace:{description:"abilita/disabilita tracing"},history:{description:"ritorna la history interna"},setURLOnly:{description:"aggiorna solo l'URL del browser senza render/meta"}};function st(Ke,{replace:o=!1}={}){const Pt=typeof Ke=="string"?new URL(Ke,window.location.origin):Ke,Z=Pt.pathname+Pt.search+Pt.hash;if(l==="hash"||l==="auto"){if(history.pushState){const ye="#"+Z;o?history.replaceState({},"",ye):history.pushState({},"",ye);return}const Kt="#"+Z;o?window.location.replace(Kt):window.location.hash=Kt;return}o?history.replaceState({},"",D+Z):history.pushState({},"",D+Z)}function tt(){if(l==="hash"){const Ke=window.location.hash||"#/",o=Ke.startsWith("#")?Ke.slice(1):Ke;return new URL(o,window.location.origin)}if(l==="auto"&&window.location.hash.startsWith("#/")){const Ke=window.location.hash.slice(1);return new URL(Ke,window.location.origin)}return new URL(window.location.href)}function Pe(Ke,o=!1){if(l==="hash"||l==="auto"&&!history.pushState){const Pt="#"+(Ke.pathname+Ke.search+Ke.hash);o?window.location.replace(Pt):window.location.hash=Pt;return}o?history.replaceState({},"",D+Ke.pathname+Ke.search+Ke.hash):history.pushState({},"",D+Ke.pathname+Ke.search+Ke.hash)}function Ne(Ke){l=Ke||"history"}function Fe(Ke){return xe(Ke,D)}function ut(Ke){if(!Ke)return!1;const o=G?G.path:Fe(tt().pathname);let Pt=Ke;typeof Pt=="string"&&(Pt.includes("?")||Pt.includes("#")||Pt.includes("://"))&&(Pt=new URL(Pt,window.location.origin).pathname);const Z=Fe(Pt);return Z.includes(":")?Le(Z).regex.test(o):Z===o}async function dt(Ke,{replace:o=!1}={}){if(!J){console.warn("[router] outlet non impostato. Usa JSswift.router.setOutlet('#app').");return}const Pt=typeof Ke=="string"?new URL(Ke,window.location.origin):Ke;Ee&&console.log("[router.navigate]",Pt.toString());const Z=Pt.pathname+Pt.search+Pt.hash;Pe(Pt,o);const Kt=Fe(Pt.pathname),ye=Ue(Kt,I),jt={path:Kt,fullPath:Z,params:ye?ye.params:{},query:Re(Pt.search),hash:Pt.hash||"",navigate:kt,outlet:J};if(me){const on=await me(jt);if(on===!1)return;if(typeof on=="string"){kt(on,{replace:!0});return}}if(typeof $=="function"){try{$()}catch(on){console.error("[router] unmount error:",on)}$=null}if(!ye){const on=I._notFound;on?$=Q.mount(J,()=>on(jt),{clear:!0}):$=Q.mount(J,_.div("404"),{clear:!0}),ot(jt),G=jt,et(pe,jt);return}const xt=ye.route.view,Ge=ye.parent;let Mn=null;if(jt.renderChild=on=>{if(!jt._child)return null;const On=typeof on=="string"?jt.outlet.querySelector(on):on;return On?(Mn=Q.mount(On,()=>jt._child.view(jt._child.ctx),{clear:!0}),Mn):(console.warn("[router] child outlet non trovato:",on),null)},Ge){const on=ye.route,On={...jt,params:{...jt.params}};jt._child={view:on.view,ctx:On},$=Q.mount(J,()=>Ge.view(jt),{clear:!0})}else jt._child=null,$=Q.mount(J,()=>xt(jt),{clear:!0});ot(jt),G=jt,et(pe,jt)}function kt(Ke,o={}){const Pt=new URL(Ke,window.location.origin);dt(Pt,o)}function It(){window.addEventListener("popstate",()=>{dt(tt(),{replace:!0})}),window.addEventListener("hashchange",()=>{(l==="hash"||l==="auto")&&dt(tt(),{replace:!0})}),document.addEventListener("click",Ke=>{var jt,xt;const o=(xt=(jt=Ke.target)==null?void 0:jt.closest)==null?void 0:xt.call(jt,"a");if(!o||Ke.defaultPrevented||Ke.button!==0||Ke.metaKey||Ke.ctrlKey||Ke.shiftKey||Ke.altKey||o.hasAttribute("download")||o.target&&o.target!=="_self")return;const Pt=o.getAttribute("href");if(!Pt||Pt.startsWith("mailto:")||Pt.startsWith("tel:"))return;const Z=new URL(Pt,window.location.origin);if(Z.origin!==window.location.origin)return;const Kt=new URL(window.location.href);Z.pathname+Z.search===Kt.pathname+Kt.search&&Z.hash||(Ke.preventDefault(),kt(Z.pathname+Z.search+Z.hash))}),dt(tt(),{replace:!0})}function Wt(Ke){return J=typeof Ke=="string"?Q.dom.q(Ke):Ke,J}function Qe(Ke){D=Ke?ve(Ke):"",D==="/"&&(D="")}function St(Ke,o,Pt=null){const Z=Le(Ke),Kt={path:Z.pattern,view:o,_compiled:Z,children:[]};if(Array.isArray(Pt))for(const ye of Pt){const[jt,xt,Ge]=ye,Mn=ve(Z.pattern+"/"+(jt||"").replace(/^\//,""));Kt.children.push({path:Mn,view:xt,_compiled:Le(Mn),children:Array.isArray(Ge)?Ge:[]})}I.push(Kt)}function _t(Ke){I._notFound=Ke}function Tt(Ke){me=Ke}let Ve=new Set;function ot(Ke){for(const o of Ve)try{o(Ke)}catch(Pt){console.error("[router] listener error:",Pt)}}function zt(){if(!G)return"ROUTER \u23F3 not ready";const Ke=Object.keys(G.query||{}).length?"?":"";return`ROUTER ${G.path}${Ke} ${G.hash||""}`}function $t(Ke="router"){if(!G)return console.warn("[router.inspect] nessuna route attiva"),null;const o={label:Ke,mode:typeof l!="undefined"?l:"unknown",base:D,path:G.path,params:G.params,query:G.query,hash:G.hash,outlet:J,timestamp:new Date().toISOString()};return console.groupCollapsed(`[JSswift.router.inspect] ${Ke}`),console.log(o),console.log("history:",pe.slice()),console.groupEnd(),o}function Ct(Ke=!0){Ee=!!Ke,console.log("[JSswift.router.trace]",Ee?"ON":"OFF")}function ht(){return pe.slice()}return{meta:yt,setOutlet:Wt,setBase:Qe,add:St,setURLOnly:st,notFound:_t,beforeEach:Tt,start:It,navigate:kt,isActive:ut,subscribe(Ke){return Ve.add(Ke),()=>Ve.delete(Ke)},current(){return tt?tt():new URL(window.location.href)},status:zt,inspect:$t,trace:Ct,history:ht}})(),(ps=Q.config)!=null&&ps.debug&&(window.$router=Q.router),Q.signal=Q.reactive.signal,Q.effect=Q.reactive.effect,Q.computed=Q.reactive.computed,Q.untracked=Q.reactive.untracked,Q.batch=Q.reactive.batch;function ts(l){return l==null?null:String(l).trim()||null}function vn(l){const I=Array.isArray(l)?l:typeof l=="string"?l.split(","):[],J=[],$=new Set;for(const D of I){const me=ts(D);!me||$.has(me)||($.add(me),J.push(me))}return J}function Ms(){var l;return typeof document!="undefined"&&document.documentElement?document.documentElement:(l=Q.dom)!=null&&l.q?Q.dom.q("html"):null}function Ae(){try{return typeof globalThis!="undefined"&&globalThis.localStorage||null}catch(l){return null}}function xn(){var l;return ts((l=Q.theme)==null?void 0:l.storageKey)||"jsswift:theme"}function Os(){const l=Ae();if(!l)return null;try{return ts(l.getItem(xn()))}catch(I){return null}}function Eo(l){const I=Ae();if(I)try{l==null?I.removeItem(xn()):I.setItem(xn(),l)}catch(J){}}function Fs(l){var $,D,me,G,pe;const I=Ms(),J=[l,($=Q.theme)==null?void 0:$.themes,(D=Q.config)==null?void 0:D.themes,typeof globalThis!="undefined"?(me=globalThis.JSswift_setting)==null?void 0:me.themes:null,typeof globalThis!="undefined"?(G=globalThis.JSswift_setting)==null?void 0:G.themeList:null,(pe=I==null?void 0:I.getAttribute)==null?void 0:pe.call(I,"data-themes")];for(const Ee of J){const ve=vn(Ee);if(ve.length)return ve}return[]}Q.theme=Q.theme||{},Q.theme.storageKey=xn(),vn(Q.theme.themes).length||(Q.theme.themes=Fs()),Q.setTheme=function(l,I={}){const J=ts(l),$=Ms();return $&&(J==null?$.removeAttribute("data-theme"):$.setAttribute("data-theme",J)),I.persist!==!1&&Eo(J),$},Q.getTheme=function(l={}){var D;const I=Ms(),J=ts((D=I==null?void 0:I.getAttribute)==null?void 0:D.call(I,"data-theme"));if(J)return J;if(l.storage===!1)return null;const $=Os();return $&&I&&l.sync!==!1&&I.setAttribute("data-theme",$),$},Q.toggleTheme=function(l,I={}){const J=Fs(l),$=J.length?J:vn([Q.getTheme({sync:!1}),"light","dark"]),D=Q.getTheme({sync:!1}),me=ts(I.fallback)||$[0]||"light",G=D?$.indexOf(D):-1,pe=G>=0?$[(G+1)%$.length]:me;return Q.theme.themes=$.slice(),Q.setTheme(pe,I),pe};const zo=Os();zo&&Q.setTheme(zo,{persist:!1})})(),(function(bt){var di;bt.ui=bt.ui||{},bt.services=bt.services||{},bt.services.notify=bt.services.notify||{};const gs=Symbol("cms.ui.rodPathRaw"),Bn=Symbol("cms.ui.rodPathEnhanced"),ys=Symbol("cms.ui.rodPathPatchedH"),rs=Symbol("cms.ui.rodPathWrappedUI"),as=new WeakMap,zs=new WeakMap,Ys=new WeakMap,wn=[],Jn=t=>{if(typeof t=="number")return Number.isInteger(t)&&t>=0;if(typeof t!="string"||t===""||t[0]==="-"||t.includes("."))return!1;const e=Number(t);return Number.isInteger(e)&&e>=0&&String(e)===t},Ps=t=>{const e=typeof t;return e==="string"||e==="number"||e==="boolean"||e==="bigint"},jn=t=>{if(!t||typeof t!="object")return!1;const e=Object.getPrototypeOf(t);return e===Object.prototype||e===null};let cs=!1;const Xs=()=>{cs||(cs=!0,queueMicrotask(()=>{cs=!1,wn.length=0}))},No=t=>{wn.push(t),wn.length>128&&wn.splice(0,wn.length-128),Xs()},us=()=>{if(!wn.length)return null;const t=wn.slice();return wn.length=0,{items:t,index:0}},Qs=(t,e)=>{if(!t)return null;const n=t.items[t.index];return!n||!Object.is(n.value,e)?null:(t.index+=1,n)},Xn=t=>t&&typeof t=="object"&&t[gs]?t[gs]:t,Qn=(t,e)=>{const n=as.get(t);if(!n)return;let s=n.rawGet();for(const i of e){if(s==null)return;s=s[i]}return s},Ao=(t,e,n)=>{const s=as.get(t);if(!s)return;const i=Xn(n);if(!e.length){if(Object.is(s.rawGet(),i))return;s.rawSet(i);return}let c=s.rawGet();(!c||typeof c!="object")&&(c=Jn(e[0])?[]:{});let S=c;for(let u=0;u<e.length-1;u++){const a=e[u];let b=S[a];if(!b||typeof b!="object"){const M=e[u+1];b=Jn(M)?[]:{},S[a]=b}S=b}Object.is(S[e[e.length-1]],i)||(S[e[e.length-1]]=i,s.rawSet(c))},Zs=(t,e)=>[()=>Qn(t,e),n=>Ao(t,e,n)],eo=(t,e,n=[])=>{if(!e||typeof e!="object")return e;let s=zs.get(t);s||(s=new WeakMap,zs.set(t,s));const i=s.get(e);if(i)return i;const c=new Proxy(e,{get(S,u,a){if(u===gs)return S;const b=Reflect.get(S,u,a);if(typeof u=="symbol")return b;const M=n.concat(u);return b&&typeof b=="object"?eo(t,b,M):typeof b=="function"?b.bind(a):(Ps(b)&&No({rod:t,path:M,value:b}),b)},set(S,u,a,b){const M=Xn(a),N=Reflect.get(S,u,b);if(Object.is(N,M))return!0;const C=Reflect.set(S,u,M,b);if(C){const z=as.get(t);z==null||z.rawSet(z.rawGet())}return C},deleteProperty(S,u){const a=Reflect.has(S,u),b=Reflect.deleteProperty(S,u);if(b&&a){const M=as.get(t);M==null||M.rawSet(M.rawGet())}return b}});return s.set(e,c),c},to=t=>{if(!t||typeof t!="object"||t.type!=="rod"||t[Bn])return t;const e=Object.getOwnPropertyDescriptor(t,"value");if(!e||typeof e.get!="function"||typeof e.set!="function")return t;const n=()=>e.get.call(t),s=i=>e.set.call(t,Xn(i));return as.set(t,{rawGet:n,rawSet:s}),Object.defineProperty(t,"value",{get(){const i=n();return!i||typeof i!="object"?i:eo(t,i,[])},set(i){s(i)},configurable:!0}),Object.defineProperty(t,Bn,{value:!0,configurable:!1}),t},no=()=>{if(typeof window._.rod!="function"||window._.rod[Bn])return;const t=window._.rod,e=function(...s){return to(t(...s))};Object.defineProperty(e,Bn,{value:!0,configurable:!1}),window._.rod=e};bt.ui.withoutRodPathCapture=t=>{const e=wn.length;try{return t()}finally{wn.length=e}};const Ts=(t,e,n="")=>{if(Array.isArray(t)){let c=!1;const S=t.map(u=>{const a=Ts(u,e,"");return a!==u&&(c=!0),a});return c?S:t}if(Ps(t)){const c=Qs(e,t);return c?n==="model"?Zs(c.rod,c.path):()=>Qn(c.rod,c.path):t}if(!jn(t))return t;let s=!1;const i={};for(const c of Object.keys(t)){const S=Ts(t[c],e,c);i[c]=S,S!==t[c]&&(s=!0)}return s?i:t},ds=(t,e,n="")=>{if(Array.isArray(t)){let c=!1;const S=t.map(u=>{const a=ds(u,e,"");return a!==u&&(c=!0),a});return c?S:t}if(Ps(t)){const c=Qs(e,t);return c?n==="model"?Zs(c.rod,c.path):()=>Qn(c.rod,c.path):t}if(!jn(t))return t;let s=!1;const i={};for(const c of Object.keys(t)){const u=c==="model"||c==="children"?ds(t[c],e,c):t[c];i[c]=u,u!==t[c]&&(s=!0)}return s?i:t},so=t=>{if(typeof t!="function"||t[rs])return t;const e=Ys.get(t);if(e)return e;const n=function(...i){const c=us();if(!c)return t.apply(this,i);let S=!1;const u=i.map(a=>{const b=ds(a,c,"");return b!==a&&(S=!0),b});return t.apply(this,S?u:i)};return Object.defineProperty(n,rs,{value:!0,configurable:!1}),Ys.set(t,n),n},Wo=()=>{const t=bt.ui;if(!(!t||t[rs])){Object.defineProperty(t,rs,{value:!0,configurable:!1});for(const e of Object.keys(t))typeof t[e]=="function"&&(t[e]=so(t[e]));bt.ui=new Proxy(t,{get(e,n,s){return Reflect.get(e,n,s)},set(e,n,s,i){const c=typeof s=="function"?so(s):s;return Reflect.set(e,n,c,i)}})}},oo=()=>{if(!window._||window._[ys])return;Object.defineProperty(window._,ys,{value:!0,configurable:!1});const t=new Set(["rod","rodBind","rodFromSignal"]);for(const e of Object.keys(window._)){if(t.has(e))continue;const n=window._[e];typeof n=="function"&&(window._[e]=function(...i){const c=us();if(!c)return n.apply(this,i);let S=!1;const u=i.map(a=>{const b=Ts(a,c,"");return b!==a&&(S=!0),b});return n.apply(this,S?u:i)})}};no(),((di=JSswift.rod)==null?void 0:di._all)instanceof Set&&JSswift.rod._all.forEach(t=>to(t)),oo(),Wo();const io={error:"danger",danger:"danger",warn:"warning",warning:"warning",success:"success",info:"info",primary:"primary",secondary:"secondary",light:"light",dark:"dark"},Uo=new Set(Object.values(io)),lo=new Set(["none","xxs","xs","sm","md","lg","xl","xxl","xxxl","full"]),Lo=new Set(["none","sm","md","lg"]),fs={xxs:{font:"9px",pad:"2px 5px"},xs:{font:"10px",pad:"2px 6px"},sm:{font:"11px",pad:"2px 7px"},md:{font:"12px",pad:"2px 8px"},lg:{font:"13px",pad:"3px 10px"},xl:{font:"14px",pad:"4px 12px"},xxl:{font:"15px",pad:"5px 14px"},xxxl:{font:"16px",pad:"6px 16px"}},In=t=>{if(t.indexOf("-")>-1)return!0},Bt=t=>{if(!t)return"";const e=String(t).toLowerCase();return io[e]||""},Io=t=>{if(t==null)return null;const e=String(t).toLowerCase();return e==="full"?"xxxl":lo.has(e)?e:null},bs=t=>{if(t===!0)return"sm";if(t==null||t===!1)return null;const e=String(t).toLowerCase();return Lo.has(e)?e:null},Zn=t=>t&&typeof t=="object"&&!t.nodeType&&!Array.isArray(t)&&!(t instanceof Function),ws=t=>t&&t.nodeType===1&&String(t.tagName||"").toLowerCase()==="li",Rn=t=>t==null||t===!1||t===""?[]:Array.isArray(t)?t:[t];JSswift.isUIPlainObject=Zn,JSswift.isListItemNode=ws,JSswift.asNodeArray=Rn;const Hn=[{key:"mobile",aliases:["mobile","mobil"],prefix:"cms-"},{key:"tablet",aliases:["tablet"],prefix:"cms-tablet-"},{key:"pc",aliases:["pc","desktop"],prefix:"cms-pc-"}],vs=Hn.flatMap(t=>t.aliases),Ss=(t,e)=>Object.prototype.hasOwnProperty.call(t||{},e),ms=(t={},e)=>{if(!e)return null;for(const n of e.aliases){if(!Ss(t,n))continue;const s=o(t[n]);if(Zn(s))return s}return null},Js=(t={},e)=>{const n=Array.isArray(e)?e:[e];return Hn.some(s=>{const i=ms(t,s);return!!i&&n.some(c=>Ss(i,c))})},ro=t=>String(t).trim().toLowerCase().replace(/\s+/g,"-"),es=(t={},e=[])=>{const n=[];for(const s of Hn){const i=ms(t,s);if(i)for(const c of e){const S=Array.isArray(c.prop)?c.prop:[c.prop];let u=!1,a,b="";for(const C of S)if(Ss(i,C)){a=o(i[C]),b=C,u=!0;break}if(!u||a==null||a===""||a===!1&&!c.allowFalse)continue;const M=typeof c.map=="function"?c.map(a,{propName:b,props:i,device:s,rule:c}):`${c.class}-${ro(a)}`,N=Array.isArray(M)?M:[M];for(const C of N)C&&n.push(String(C).startsWith("cms-")?C:`${s.prefix}${C}`)}}return n},Wn=(t={})=>Hn.some(e=>!!ms(t,e)),ao=(t={},e=[])=>{for(const n of e){if(!Ss(t,n))continue;const s=o(t[n]);if(!(s==null||s===""))return s}},Rs=(t,e={})=>{var n;return t==null||t===""||t===!1&&!e.allowFalse?"":typeof e.mapValue=="function"?e.mapValue(t,e):typeof t=="number"?e.number==="raw"?String(t):`${t}px`:e.token&&typeof t=="string"&&((n=JSswift.uiSizes)!=null&&n.includes(t))?`var(--cms-${e.token}-${t})`:String(t)},Cs=(t,e,n)=>{!t||n==null||n===""||(typeof t.setProperty=="function"?t.setProperty(e,n):t[e]=n)},En=(t,e)=>t==="mobile"?`cms-rsp-${e}`:`cms-rsp-${t}-${e}`,co=(t,e)=>{var n;if(!(!t||!e)){if((n=t.classList)!=null&&n.add){t.classList.add(e);return}t.class=Z([t.class,e])}},hn=(t,e={},n=[])=>{if(!t||!e||!Wn(e))return t;const s=t.style||{};let i=!1;for(const c of n){const S=Array.isArray(c.prop)?c.prop:[c.prop],u=(a,b)=>{const M=ao(b,S),N=Rs(M,c);if(!N)return;const C=c.var||c.css,z=a==="mobile"?"--cms-rsp-":`--cms-rsp-${a}-`;Cs(s,`${z}${C}`,N),co(t,En(a,C)),i=!0};u("mobile",e);for(const a of Hn){const b=ms(e,a);b&&u(a.key,b)}}return i&&(t.nodeType||(t.style=s),co(t,"cms-rsp")),t};JSswift.uiResponsiveDevices=Hn,JSswift.uiResponsiveOmitProps=vs,JSswift.uiResponsivePropsFor=ms,JSswift.uiResponsiveHasConfig=Wn,JSswift.uiResponsiveHasProp=Js,JSswift.uiResponsiveClasses=es,JSswift.uiApplyResponsiveProps=hn;const ts=JSswift.omit;JSswift.omit=(t,e=[])=>{const n=Array.isArray(e)?e.concat(vs):vs;return ts(t,n)};const vn=(t={})=>{var s;const e=[],n={};if(e.push(ye(t.clickable,"cms-clickable"),ye(t.dense,"cms-dense"),ye(t.flat,"cms-flat"),ye(t.border,"cms-border"),ye(t.glossy,"cms-glossy"),ye(t.glow,"cms-glow"),ye(t.glass,"cms-glass"),ye(t.shadow,"cms-shadow"),ye(t.outline,"cms-outline"),ye(t.rounded,"cms-rounded"),ye(t.gradient,"cms-gradient"),ye(t.textGradient,"cms-text-gradient"),ye(t.lightShadow,"cms-light-shadow")),Ke(t.color))e.push(()=>{const i=o(t.color),c=Bt(i);return c?`cms-state-${c}`:""}),n.backgroundColor=()=>{const i=o(t.color);return Bt(i)?"":i&&In(String(i))?`var(--cms-${i})`:i||""};else{const i=Bt(t.color);i?e.push(`cms-state-${i}`):t.color&&In(t.color)?n.backgroundColor=`var(--cms-${t.color})`:t.color&&(n.backgroundColor=t.color)}if(Ke(t.textColor)?n.color=()=>{const i=o(t.textColor);return i&&In(String(i))?`var(--cms-${i})`:i||""}:t.textColor&&In(t.textColor)?n.color=`var(--cms-${t.textColor})`:t.textColor&&(n.color=t.textColor),Ke(t.size))e.push(()=>{var c;const i=o(t.size);return typeof i=="string"&&((c=JSswift.uiSizes)!=null&&c.includes(i))?`cms-size-${i}`:""});else{const i=t.size;typeof i=="string"&&((s=JSswift.uiSizes)!=null&&s.includes(i))&&e.push(`cms-size-${i}`)}if(Ke(t.shadow))e.push(()=>{const i=o(t.shadow),c=bs(i);return c?`cms-shadow-${c}`:""}),n.boxShadow=()=>{const i=o(t.shadow);return bs(i)||i==null||i===!1?"":typeof i=="string"?i:""};else{const i=bs(t.shadow);i?e.push(`cms-shadow-${i}`):t.shadow&&typeof t.shadow=="string"&&(n.boxShadow=t.shadow)}e.length&&(t.class=Z([t.class,...e])),Object.keys(n).length&&(t.style={...n,...t.style||{}})},Ms=JSswift.uiNormalizeArgs;JSswift.uiNormalizeArgs=function(t){const e=Ms(t),n=e.props||{};if(n&&Object.prototype.hasOwnProperty.call(n,"children")){const s=n.children;(!e.children||e.children.length===0)&&(e.children=Array.isArray(s)?s:[s]),delete n.children}return vn(n),e};const Ae=window._;function xn(t){if(!t)return null;if(!Array.isArray(t))return t;const e=[],n=t.slice();for(;n.length;){const s=n.shift();s&&(Array.isArray(s)?n.unshift(...s):e.push(s))}return e.length?e:null}const Os={padding:"p",paddingTop:"p",paddingRight:"p",paddingBottom:"p",paddingLeft:"p",paddingInline:"p",paddingInlineStart:"p",paddingInlineEnd:"p",paddingBlock:"p",paddingBlockStart:"p",paddingBlockEnd:"p",margin:"m",marginTop:"m",marginRight:"m",marginBottom:"m",marginLeft:"m",marginInline:"m",marginInlineStart:"m",marginInlineEnd:"m",marginBlock:"m",marginBlockStart:"m",marginBlockEnd:"m",width:"w",minWidth:"w",maxWidth:"w",height:"h",minHeight:"h",maxHeight:"h"},Eo=t=>t===!0?"wrap":t===!1?"nowrap":String(t),Fs=t=>typeof t=="number"?`repeat(${Math.max(1,Math.round(t))}, minmax(0, 1fr))`:String(t),Ds=[{prop:"display",css:"display",var:"display"},{prop:"direction",css:"flex-direction",var:"flex-direction"},{prop:"wrap",css:"flex-wrap",var:"flex-wrap",allowFalse:!0,mapValue:Eo},{prop:"align",css:"align-items",var:"align-items"},{prop:"justify",css:"justify-content",var:"justify-content"},{prop:"self",css:"align-self",var:"align-self"},{prop:"justifySelf",css:"justify-self",var:"justify-self"},{prop:"place",css:"place-items",var:"place-items"},{prop:"placeSelf",css:"place-self",var:"place-self"},{prop:["cols","columns"],css:"grid-template-columns",var:"grid-template-columns",mapValue:Fs},{prop:"rows",css:"grid-template-rows",var:"grid-template-rows",mapValue:Fs},{prop:"flow",css:"grid-auto-flow",var:"grid-auto-flow",mapValue:t=>String(t).trim().toLowerCase().replace("-"," ")},{prop:"autoRows",css:"grid-auto-rows",var:"grid-auto-rows"},{prop:["span","gridColumn"],css:"grid-column",var:"grid-column",number:"raw"},{prop:["row","rowSpan"],css:"grid-row",var:"grid-row",number:"raw"},{prop:"area",css:"grid-area",var:"grid-area"},{prop:"gap",css:"gap",var:"gap",token:"gap"},{prop:"rowGap",css:"row-gap",var:"row-gap",token:"gap"},{prop:["columnGap","colGap"],css:"column-gap",var:"column-gap",token:"gap"},{prop:"width",css:"width",var:"width",token:"w"},{prop:"minWidth",css:"min-width",var:"min-width",token:"min-w"},{prop:"maxWidth",css:"max-width",var:"max-width",token:"max-w"},{prop:"height",css:"height",var:"height",token:"h"},{prop:"minHeight",css:"min-height",var:"min-height",token:"min-h"},{prop:"maxHeight",css:"max-height",var:"max-height",token:"max-h"},{prop:"padding",css:"padding",var:"padding",token:"p"},{prop:"paddingLeft",css:"padding-left",var:"padding-left",token:"p"},{prop:"paddingRight",css:"padding-right",var:"padding-right",token:"p"},{prop:"paddingTop",css:"padding-top",var:"padding-top",token:"p"},{prop:"paddingBottom",css:"padding-bottom",var:"padding-bottom",token:"p"},{prop:"margin",css:"margin",var:"margin",token:"m"},{prop:"marginLeft",css:"margin-left",var:"margin-left",token:"m"},{prop:"marginRight",css:"margin-right",var:"margin-right",token:"m"},{prop:"marginTop",css:"margin-top",var:"margin-top",token:"m"},{prop:"marginBottom",css:"margin-bottom",var:"margin-bottom",token:"m"},{prop:"fontSize",css:"font-size",var:"font-size",token:"f"},{prop:"fontWeight",css:"font-weight",var:"font-weight",token:"fw",number:"raw"},{prop:"lineHeight",css:"line-height",var:"line-height",token:"lh",number:"raw"},{prop:"letterSpacing",css:"letter-spacing",var:"letter-spacing",token:"ls"},{prop:["borderRadius","radius"],css:"border-radius",var:"border-radius",token:"r"},{prop:"overflow",css:"overflow",var:"overflow"},{prop:"order",css:"order",var:"order",number:"raw"}],$s=Ds.filter(t=>{const e=Array.isArray(t.prop)?t.prop:[t.prop];return e.some(n=>Object.prototype.hasOwnProperty.call(Os,n))||e.includes("fontSize")||e.includes("fontWeight")||e.includes("lineHeight")||e.includes("letterSpacing")||e.includes("borderRadius")||e.includes("radius")});JSswift.uiResponsiveStyleRules=Ds,JSswift.uiResponsiveCommonStyleRules=$s;const uo=t=>t.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`),fo=(t,e,n,s)=>{e==null||e===!1||e===""||t.style.setProperty(uo(n),Ne(e,s))};function At(t,e){e.size&&(typeof e.size=="number"?t.style.setProperty("--cms-font-size",`${e.size}px`):JSswift.uiSizes.includes(e.size)&&t.style.setProperty("--cms-font-size",`var(--cms-font-size-${e.size})`)),Object.entries(Os).forEach(([n,s])=>{Js(e,n)||fo(t,e[n],n,s)}),hn(t,e,$s),e.gradient&&typeof e.gradient=="number"&&t.style.setProperty("--set-gradient-deg",`${e.gradient}deg`),e.radius&&(typeof e.radius=="number"?t.style.setProperty("--set-border-radius",`${e.radius}px`):JSswift.uiSizes.includes(e.radius)?t.style.setProperty("--set-border-radius",`var(--cms-r-${e.radius})`):t.style.setProperty("--set-border-radius",`${e.radius}`))}function xs(t={},...e){const n=document.createElement("option");t&&typeof t=="object"&&(t.value!=null&&(n.value=String(t.value)),t.label!=null&&(n.label=String(t.label)),t.disabled!=null&&(n.disabled=!!t.disabled),t.selected!=null&&(n.selected=!!t.selected),t.class!=null&&(n.className=String(t.class)));const s=e.flat?e.flat(1/0):e;return s.length?s.forEach(i=>{i==null||i===!1||(i instanceof Node?n.appendChild(i):n.appendChild(document.createTextNode(String(i))))}):t&&t.text!=null&&(n.textContent=String(t.text)),n}JSswift.ui.getSlot=(t,e)=>t&&Object.prototype.hasOwnProperty.call(t,e)?t[e]:null,JSswift.ui.renderSlot=(t,e,n,s)=>{const i=JSswift.ui.getSlot(t,e),S=i!=null?typeof i=="function"?i(n||{}):i:s;return S==null?null:xn(JSswift.ui.slot(S))};const T=(t,e,n,s)=>{const i=JSswift.ui.renderSlot(t,e,n,s);return i?Array.isArray(i)?i:[i]:[]},Un=new Set;let ps=!1;const l=new Set(["ctrl","alt","shift","meta"]),I={control:"ctrl",ctl:"ctrl",option:"alt",opt:"alt",command:"meta",cmd:"meta","\u2318":"meta","\u2303":"ctrl","\u2325":"alt","\u21E7":"shift",esc:"escape",return:"enter",plus:"+",spacebar:"space",up:"arrowup",down:"arrowdown",left:"arrowleft",right:"arrowright",del:"delete"},J={ctrl:"Ctrl",alt:"Alt",shift:"Shift",meta:"Meta",escape:"Esc",enter:"Enter",tab:"Tab",space:"Space",backspace:"Backspace",delete:"Del",arrowup:"Up",arrowdown:"Down",arrowleft:"Left",arrowright:"Right",pageup:"PgUp",pagedown:"PgDn"},$=()=>{if(typeof navigator=="undefined")return!1;const t=String(navigator.platform||navigator.userAgent||"");return/(mac|iphone|ipad|ipod)/i.test(t)},D=t=>{if(t==null)return"";const e=String(t).trim().toLowerCase();return e?I[e]||e:""},me=t=>{if(t==null||t===!1)return null;const e=String(t).trim();if(!e)return null;const n=e.split("+").map(D).filter(Boolean);if(!n.length)return null;const s={raw:e,key:"",ctrl:!1,alt:!1,shift:!1,meta:!1};return n.forEach(i=>{if(i==="mod"){$()?s.meta=!0:s.ctrl=!0;return}if(l.has(i)){s[i]=!0;return}s.key=i}),s.key?s:null},G=t=>t==null||t===!1?[]:(Array.isArray(t)?t:[t]).map(n=>{var i,c,S;if(n==null||n===!1)return null;if(typeof n=="object"&&!Array.isArray(n)){const u=me((S=(c=(i=n.shortcode)!=null?i:n.shortcut)!=null?c:n.keys)!=null?S:n.key);return u?{...n,...u}:null}const s=me(n);return s?{...s}:null}).filter(Boolean),pe=(t={})=>{var e,n,s;return G((s=(n=(e=t.shortcode)!=null?e:t.shortcut)!=null?n:t.hotkey)!=null?s:t.keys)},Ee=(t={})=>t.showShortcode===!0||t.showShortcut===!0,ve=t=>{const e=D(t);if(!e)return"";const n={...J};return $()&&(n.alt="Option",n.meta="Cmd"),n[e]?n[e]:e.length===1?e.toUpperCase():e.replace(/(^|[-_ ])(\w)/g,(s,i,c)=>`${i}${c.toUpperCase()}`)},xe=t=>{if(!t)return"";const e=[];return t.ctrl&&e.push(ve("ctrl")),t.alt&&e.push(ve("alt")),t.shift&&e.push(ve("shift")),t.meta&&e.push(ve("meta")),e.push(ve(t.key)),e.filter(Boolean).join("+")},Le=t=>(Array.isArray(t)?t:[]).map(xe).filter(Boolean).join(" / "),Re=(t={},e={})=>{const n=pe(t);if(!Ee(t)||!n.length||typeof document=="undefined")return null;const s=document.createElement("span");return s.className=e.className||"cms-shortcode",s.setAttribute("aria-hidden","true"),s.textContent=Le(n),s},Ue=t=>{const e=(t==null?void 0:t.nodeType)===1?t:t==null?void 0:t.parentElement;if(!e||typeof e.closest!="function")return!1;if(e.isContentEditable)return!0;const n=e.closest("input, textarea, select, [contenteditable], [contenteditable='true'], [contenteditable='plaintext-only']");return!(!n||"disabled"in n&&n.disabled)},et=(t,e)=>!t||!e||!!t.ctrlKey!=!!e.ctrl||!!t.altKey!=!!e.alt||!!t.shiftKey!=!!e.shift||!!t.metaKey!=!!e.meta?!1:D(t.key)===e.key,yt=()=>{Un.size||!ps||typeof document=="undefined"||(document.removeEventListener("keydown",st,!0),ps=!1)};function st(t){var s,i,c,S,u,a;if(!Un.size||!t||t.defaultPrevented||t.isComposing)return;const e=Ue(t.target),n=Array.from(Un);for(let b=n.length-1;b>=0;b-=1){const M=n[b],N=M==null?void 0:M.anchor;if(!N||!N.isConnected){Un.delete(M);continue}if(((s=M.isEnabled)==null?void 0:s.call(M))===!1)continue;const C=M.specs.find(ge=>{var ne,he;const B=(he=(ne=ge.allowInEditable)!=null?ne:M.allowInEditable)!=null?he:!1;return e&&!B?!1:et(t,ge)});if(!C)continue;const z=(c=(i=C.preventDefault)!=null?i:M.preventDefault)!=null?c:!0,U=(u=(S=C.stopPropagation)!=null?S:M.stopPropagation)!=null?u:!0;if(z&&t.preventDefault(),U&&t.stopPropagation(),((a=M.action)==null?void 0:a.call(M,t,C,N))!==!1)break}yt()}const tt=(t,e={},n={})=>{var S,u;const s=pe(e);if(!t||!s.length||typeof document=="undefined")return null;const i={anchor:t,specs:s,action:typeof n.action=="function"?n.action:()=>{var a;return(a=t.click)==null?void 0:a.call(t)},isEnabled:typeof n.isEnabled=="function"?n.isEnabled:null,allowInEditable:!!n.allowInEditable,preventDefault:(S=n.preventDefault)!=null?S:!0,stopPropagation:(u=n.stopPropagation)!=null?u:!0};Un.add(i),ps||(document.addEventListener("keydown",st,!0),ps=!0);const c=()=>{Un.delete(i),yt()};return JSswift._registerCleanup(t,c),c},Pe=(t,e={})=>{var n;if(!t||typeof t.focus!="function")return!1;try{t.focus({preventScroll:(n=e.preventScroll)!=null?n:!0})}catch(s){t.focus()}if(e.selectText&&typeof t.select=="function")try{t.select()}catch(s){}return!0},Ne=(t,e="size")=>typeof t=="number"?t+"px":JSswift.uiSizes.includes(t)?`var(--cms-${e}-${t})`:t,Fe=(t,e=JSswift.uiSizes)=>n=>{const s=String(n).trim();return e!=null&&e.includes(s)?`${t}-${s}`:""},ut=t=>e=>`${t}-${String(e).trim().toLowerCase().replace(/\s+/g,"-")}`,dt=t=>{if(t===!0)return"wrap-wrap";if(t===!1)return"wrap-nowrap";const e=String(t).trim().toLowerCase();return e==="false"||e==="no"||e==="none"?"wrap-nowrap":e==="reverse"?"wrap-reverse":`wrap-${e}`},kt=(t,e,n)=>t?e:n,It=t=>{const e=o(t);if(e==null||e==="")return"";if(e==="auto")return"col-auto";if(e===!0)return"col-24";const n=Number(e);if(Number.isFinite(n)&&n>0)return`col-${Math.max(1,Math.min(24,Math.round(n)))}`;if(typeof e=="string"){const s=e.trim();if(/^\d+$/.test(s))return`col-${Math.max(1,Math.min(24,Number(s)))}`}return""},Wt=t=>{const e=Number(t);return Number.isFinite(e)&&e>0?`grid-cols-${Math.max(1,Math.min(24,Math.round(e)))}`:""},Qe=(t,e)=>{const n=Array.isArray(e)?e:[e];return JSswift.uiResponsiveDevices.some(s=>{const i=JSswift.uiResponsivePropsFor(t,s);return!!i&&n.some(c=>Object.prototype.hasOwnProperty.call(i,c))})},St=t=>JSswift.uiResponsiveDevices.find(e=>e.key===t),_t=[{prop:"gap",class:"gap",map:Fe("gap")},{prop:"rowGap",class:"gap-y",map:Fe("gap-y")},{prop:["columnGap","colGap"],class:"gap-x",map:Fe("gap-x")},{prop:"direction",class:"dir",map:ut("dir")},{prop:"wrap",class:"wrap",allowFalse:!0,map:dt},{prop:"align",class:"align",map:ut("align")},{prop:"justify",class:"justify",map:ut("justify")},{prop:"width",class:"w",map:Fe("w")},{prop:"minWidth",class:"min-w",map:Fe("min-w")},{prop:"maxWidth",class:"max-w",map:Fe("max-w")},{prop:"height",class:"h",map:Fe("h")},{prop:"minHeight",class:"min-h",map:Fe("min-h")},{prop:"maxHeight",class:"max-h",map:Fe("max-h")},{prop:"padding",class:"p",map:Fe("p")},{prop:"margin",class:"m",map:Fe("m")}],Tt=_t.filter(t=>{const e=Array.isArray(t.prop)?t.prop:[t.prop];return!e.includes("align")&&!e.includes("justify")}),Ve=[{prop:["col","span"],class:"col",map:It},{prop:"auto",class:"col",map:t=>t?"col-auto":""},{prop:"inline",class:"display",allowFalse:!0,map:t=>kt(t,"display-inline-flex","display-flex")},{prop:"self",class:"self",map:ut("self")},..._t],ot=[{prop:["cols","columns"],class:"grid-cols",map:Wt},{prop:"inline",class:"display",allowFalse:!0,map:t=>kt(t,"display-inline-grid","display-grid")},{prop:"flow",class:"grid-flow",map:t=>`grid-flow-${String(t).trim().toLowerCase().replace(/\s+/g,"-")}`},..._t],zt=[{prop:"inline",class:"display",allowFalse:!0,map:t=>kt(t,"display-inline-flex","display-flex")},{prop:"direction",class:"dir",map:ut("dir")},{prop:"contentAlign",class:"align",map:ut("align")},{prop:"contentJustify",class:"justify",map:ut("justify")},{prop:"align",class:"self",map:ut("self")},{prop:"justify",class:"justify-self",map:ut("justify-self")},{prop:"place",class:"place-self",map:ut("place-self")},...Tt],$t=(JSswift.uiResponsiveStyleRules||[]).filter(t=>{const e=Array.isArray(t.prop)?t.prop:[t.prop];return!e.includes("span")&&!e.includes("gridColumn")});Ae.Row=(...t)=>{var h,m,y,j,X;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=(d,k,g={})=>{const P=Array.isArray(d)?d:[d];for(const K of P)if(JSswift.ui.getSlot(s,K)!=null)return T(s,K,g,k);return k==null?[]:T(null,"default",g,k)},c=d=>{var k;return d==null||d===!1||d===""?"":typeof d=="number"?`${d}px`:typeof d=="string"&&((k=JSswift.uiSizes)!=null&&k.includes(d))?`var(--cms-s-${d})`:String(d)},S=d=>{var k;return d==null||d===!1||d===""?"":typeof d=="number"?`${d}px`:typeof d=="string"&&((k=JSswift.uiSizes)!=null&&k.includes(d))?`var(--cms-w-${d})`:String(d)},u=JSswift.omit(e,["slots","start","left","startClass","body","center","bodyClass","centerClass","end","right","endClass","align","justify","wrap","gap","rowGap","columnGap","direction","reverse","inline","full","width","minWidth","maxWidth",...JSswift.uiResponsiveOmitProps]);u.class=Z(["cms-row",JSswift.uiResponsiveClasses({mobile:e},_t),JSswift.uiResponsiveClasses(e,_t),e.class]);const a={...e.style||{}},b=xt([e.direction,e.reverse],()=>{const d=o(e.direction);return d!=null&&d!==""?String(d):o(e.reverse)?"row-reverse":""}),M=Ge(e.align),N=Ge(e.justify),C=Ge(e.wrap,d=>typeof d=="boolean"?d?"wrap":"nowrap":String(d)),z=Ge(e.gap,c),U=Ge(e.rowGap,c),W=Ge(e.columnGap,c),ge=Ge(e.inline,d=>d?"inline-flex":"flex"),B=Ge(e.width,S),ne=Ge(e.minWidth,S),he=Ge(e.maxWidth,S),q=Ge(e.full,d=>d?"100%":"",""),se=xt([e.inline,e.full,e.width],()=>{const d=!!o(e.inline),k=!!o(e.full),g=o(e.width)!=null&&o(e.width)!==!1&&o(e.width)!=="";return!d||k||g?"":"max-content"});b!=null&&!Qe(e,"direction")&&(a.flexDirection=b),M!=null&&!Qe(e,"align")&&(a.alignItems=M),N!=null&&!Qe(e,"justify")&&(a.justifyContent=N),C!=null&&!Qe(e,"wrap")&&(a.flexWrap=C),z!=null&&!Qe(e,"gap")&&(a.gap=z),U!=null&&!Qe(e,"rowGap")&&(a.rowGap=U),W!=null&&!Qe(e,"columnGap")&&(a.columnGap=W),ge!=null&&(a.display=ge),se!=null&&(a.width=se),B!=null&&!Qe(e,"width")&&(a.width=B),ne!=null&&!Qe(e,"minWidth")&&(a.minWidth=ne),he!=null&&!Qe(e,"maxWidth")&&(a.maxWidth=he),q!=null&&(a.width=q),Object.keys(a).length&&(u.style=a),JSswift.uiApplyResponsiveProps(u,e,JSswift.uiResponsiveStyleRules);const le={props:e},fe=i(["start","left"],(h=e.start)!=null?h:e.left,le),be=i(["body","center","default"],(y=(m=e.body)!=null?m:e.center)!=null?y:n,le),re=i(["end","right"],(j=e.end)!=null?j:e.right,le);if(!(fe.length||re.length||e.body!=null||e.center!=null||e.startClass||e.bodyClass||e.centerClass||e.endClass||JSswift.ui.getSlot(s,"start")!=null||JSswift.ui.getSlot(s,"left")!=null||JSswift.ui.getSlot(s,"body")!=null||JSswift.ui.getSlot(s,"center")!=null||JSswift.ui.getSlot(s,"end")!=null||JSswift.ui.getSlot(s,"right")!=null)){const d=T(s,"default",le,n),k=_.div(u,...d);return At(k,e),k}const O={display:"flex",alignItems:"inherit",gap:"inherit",flexWrap:"inherit",minWidth:0},Y=(X=e.bodyClass)!=null?X:e.centerClass,oe=xt([e.direction,e.reverse],()=>(o(e.direction)||(o(e.reverse)?"row-reverse":"row"))==="row"?"auto":""),we=[fe.length?_.div({class:Z(["cms-row-start",e.startClass]),style:{...O}},...fe):null,be.length?_.div({class:Z(["cms-row-body",Y]),style:{...O,flex:"1 1 auto"}},...be):null,re.length?_.div({class:Z(["cms-row-end",e.endClass]),style:{...O,justifyContent:"flex-end",marginInlineStart:oe}},...re):null].filter(Boolean),R=_.div(u,...we);return At(R,e),R};function Ct(t){return Array.isArray(t)&&(t.length===2||t.length===3&&typeof t[2]=="function")&&typeof t[0]=="function"&&typeof t[1]=="function"}function ht(t){return!!t&&t.type==="rod"}function Ke(t){return typeof t=="function"||ht(t)||Ct(t)}function o(t){return typeof t=="function"?t():ht(t)?t.value:Ct(t)?t[0]():t}function Pt(t){const e=Array.isArray(t)?[...t]:[t];for(;e.length;){const n=e.pop();if(Ke(n))return!0;Array.isArray(n)&&e.push(...n)}return!1}function Z(t){const e=Pt(t),n=()=>{const s=[],i=Array.isArray(t)?[...t]:[t];for(;i.length;){const c=i.shift();if(c==null||c===!1)continue;const S=o(c);if(!(S==null||S===!1||S==="")){if(Array.isArray(S)){i.unshift(...S);continue}s.push(S)}}return s.join(" ")};return e?n:n()}function Kt(t){const e=Z(t);return typeof e=="function"?e():e}function ye(t,e,n=""){return Ke(t)?()=>o(t)?e:n:t?e:n}function jt(t,e,n=""){return Ke(t)?()=>{const s=o(t);return s==null||s===""?"":`${e}${s}${n}`}:t==null||t===""?"":`${e}${t}${n}`}function xt(t,e){return(Array.isArray(t)?t:[t]).some(Ke)?()=>e():e()}function Ge(t,e,n=""){return Ke(t)?()=>{const s=o(t);return s==null||s===!1?n:e?e(s):s}:t==null||t===!1?null:e?e(t):t}JSswift.uiIsReactive=Ke,JSswift.uiUnwrap=o,JSswift.uiClass=Z,JSswift.uiClassStatic=Kt,JSswift.uiWhen=ye,JSswift.uiClassValue=jt,JSswift.uiComputed=xt,JSswift.uiStyleValue=Ge,Ae.Col=(...t)=>{var P,K,ee,Ce,E,p;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=A=>Object.prototype.hasOwnProperty.call(e,A),c=(A,L,ae={})=>{const ke=Array.isArray(A)?A:[A];for(const Te of ke)if(JSswift.ui.getSlot(s,Te)!=null)return T(s,Te,ae,L);return L==null?[]:T(null,"default",ae,L)},S=A=>{var L;return A==null||A===!1||A===""?"":typeof A=="number"?`${A}px`:typeof A=="string"&&((L=JSswift.uiSizes)!=null&&L.includes(A))?`var(--cms-s-${A})`:String(A)},u=A=>{var L;return A==null||A===!1||A===""?"":typeof A=="string"&&((L=JSswift.uiSizes)!=null&&L.includes(A))?Ne(A,"size"):gt(A)},a=(A,L)=>{const ae=o(A);if(ae==null||ae===!1||ae==="")return"";if(ae==="auto")return L==="cms-col-"?"cms-col-auto":"";if(ae===!0)return`${L}24`;const ke=Number(ae);if(Number.isFinite(ke)&&ke>0)return`${L}${Math.max(1,Math.min(24,Math.round(ke)))}`;if(typeof ae=="string"){const Te=ae.trim();if(!Te)return"";if(Te.startsWith(L))return Te;if(/^\d+$/.test(Te))return`${L}${Math.max(1,Math.min(24,Number(Te)))}`}return""},b=()=>{const A=o(e.flex);if(A!=null&&A!==!1&&A!=="")return String(A);if(o(e.fill))return"1 1 auto";const L=i("grow"),ae=i("shrink"),ke=i("basis");if(!L&&!ae&&!ke)return"";const Te=L?o(e.grow):0,ze=ae?o(e.shrink):1,V=ke?u(o(e.basis)):"auto";return`${Te} ${ze} ${V||"auto"}`},M=xt([e.auto,e.col,e.span],()=>{if(o(e.auto))return"cms-col-auto";const A=i("span")?e.span:e.col;return a(A,"cms-col-")||"cms-col"}),N=JSswift.omit(e,["slots","col","span","sm","md","lg","auto","size","width","minWidth","maxWidth","height","minHeight","maxHeight","gap","rowGap","columnGap","align","justify","inline","center","stack","flex","fill","grow","shrink","basis","self","order","scroll","start","top","header","before","startClass","topClass","headerClass","body","content","bodyClass","contentClass","end","bottom","footer","after","endClass","bottomClass","footerClass",...JSswift.uiResponsiveOmitProps]),C={...e.style||{}};!Qe(e,"minWidth")&&C.minWidth==null&&(C.minWidth=0);const z=Ge(e.gap,S),U=Ge(e.rowGap,S),W=Ge(e.columnGap,S),ge=Ge(e.align),B=Ge(e.justify),ne=i("width")?e.width:e.size,he=Ge(ne,u),q=Ge(e.minWidth,u),se=Ge(e.maxWidth,u),le=Ge(e.height,u),fe=Ge(e.minHeight,u),be=Ge(e.maxHeight,u),re=Ge(e.self),ue=Ge(e.order,A=>String(A)),O=Ge(e.scroll,A=>A?"auto":"",""),Y=xt([e.flex,e.fill,e.grow,e.shrink,e.basis],b),oe=xt([e.center,e.align,e.justify],()=>!!o(e.center)&&(o(e.align)==null||o(e.align)==="")&&(o(e.justify)==null||o(e.justify)===""));Y!=null&&Y!==""&&(C.flex=Y),re!=null&&!Qe(e,"self")&&(C.alignSelf=re),ue!=null&&(C.order=ue),O!=null&&O!==""&&(C.overflow=O),he!=null&&he!==""&&!Qe(e,["width","size"])&&(C.width=he,!i("flex")&&!i("fill")&&!i("grow")&&!i("shrink")&&!i("basis")&&(C.flex="0 0 auto")),q!=null&&!Qe(e,"minWidth")&&(C.minWidth=q),se!=null&&!Qe(e,"maxWidth")&&(C.maxWidth=se),le!=null&&!Qe(e,"height")&&(C.height=le),fe!=null&&!Qe(e,"minHeight")&&(C.minHeight=fe),be!=null&&!Qe(e,"maxHeight")&&(C.maxHeight=be),Object.keys(C).length&&(N.style=C);const we={props:e},R=c(["start","top","header","before"],(ee=(K=(P=e.start)!=null?P:e.top)!=null?K:e.header)!=null?ee:e.before,we),h=i("body")?e.body:i("content")?e.content:n,m=c(["body","content","default"],h,we),y=c(["end","bottom","footer","after"],(p=(E=(Ce=e.end)!=null?Ce:e.bottom)!=null?E:e.footer)!=null?p:e.after,we),j=R.length||y.length||i("start")||i("top")||i("header")||i("before")||i("body")||i("content")||i("end")||i("bottom")||i("footer")||i("after")||e.startClass||e.bodyClass||e.contentClass||e.endClass||e.topClass||e.headerClass||e.bottomClass||e.footerClass||JSswift.ui.getSlot(s,"start")!=null||JSswift.ui.getSlot(s,"top")!=null||JSswift.ui.getSlot(s,"header")!=null||JSswift.ui.getSlot(s,"before")!=null||JSswift.ui.getSlot(s,"body")!=null||JSswift.ui.getSlot(s,"content")!=null||JSswift.ui.getSlot(s,"end")!=null||JSswift.ui.getSlot(s,"bottom")!=null||JSswift.ui.getSlot(s,"footer")!=null||JSswift.ui.getSlot(s,"after")!=null,X=xt([e.stack,e.gap,e.rowGap,e.columnGap,e.align,e.justify,e.center],()=>o(e.stack)||j||[o(e.gap),o(e.rowGap),o(e.columnGap),o(e.align),o(e.justify)].some(L=>L!=null&&L!==!1&&L!=="")?!0:!!o(e.center));if(N.class=Z(["cms-col",M,xt(e.sm,()=>a(e.sm,"cms-sm-col-")),xt(e.md,()=>a(e.md,"cms-md-col-")),xt(e.lg,()=>a(e.lg,"cms-lg-col-")),JSswift.uiResponsiveClasses({mobile:e},Ve),JSswift.uiResponsiveClasses(e,Ve),ye(X,"cms-col-flex"),ye(e.inline,"cms-col-inline"),e.class]),z!=null&&!Qe(e,"gap")&&(C.gap=z),U!=null&&!Qe(e,"rowGap")&&(C.rowGap=U),W!=null&&!Qe(e,"columnGap")&&(C.columnGap=W),ge!=null&&!Qe(e,"align")?C.alignItems=ge:oe!=null&&oe!==""&&(C.alignItems=oe?"center":""),B!=null&&!Qe(e,"justify")?C.justifyContent=B:oe!=null&&oe!==""&&(C.justifyContent=oe?"center":""),Object.keys(C).length&&(N.style=C),JSswift.uiApplyResponsiveProps(N,e,JSswift.uiResponsiveStyleRules),!j){const A=_.div(N,...T(s,"default",we,n));return At(A,e),A}const d={display:"flex",flexDirection:"column",gap:"inherit",minWidth:0},k=[R.length?_.div({class:Z(["cms-col-start",e.startClass,e.topClass,e.headerClass]),style:{...d}},...R):null,m.length?_.div({class:Z(["cms-col-body",e.bodyClass,e.contentClass]),style:{...d,flex:"1 1 auto"}},...m):null,y.length?_.div({class:Z(["cms-col-end",e.endClass,e.bottomClass,e.footerClass]),style:{...d}},...y):null].filter(Boolean),g=_.div(N,...k);return At(g,e),g},Ae.Spacer=(...t)=>{const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=JSswift.omit(e,["slots"]);i.class=Z(["cms-spacer",e.class]);const c=T(s,"default",{},n);return _.div(i,...c)},Ae.Container=(...t)=>{var y,j,X,d;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i={...e},c=k=>Object.prototype.hasOwnProperty.call(e,k),S={xxs:"360px",xs:"480px",sm:"640px",md:"820px",lg:"1100px",xl:"1280px",xxl:"1440px",narrow:"760px",prose:"760px",wide:"1360px"},u=k=>{if(k==null||k===!1||k==="")return"";if(typeof k=="number")return`${k}px`;const g=String(k).trim().toLowerCase();return g?g==="full"||g==="fluid"?"100%":S[g]||String(k):""},a=k=>{var g;return k==null||k===!1||k===""?"":typeof k=="number"?`${k}px`:typeof k=="string"&&((g=JSswift.uiSizes)!=null&&g.includes(k))?`var(--cms-s-${k})`:String(k)},b=k=>{if(k==null||k===!1||k==="")return"";if(typeof k=="number"&&Number.isFinite(k))return`repeat(${Math.max(1,Math.floor(k))}, minmax(0, 1fr))`;const g=String(k).trim();return g?/^\d+$/.test(g)?`repeat(${Math.max(1,Number(g))}, minmax(0, 1fr))`:g:""},M=k=>k==null||k===""?"":k===!0?"wrap":k===!1?"nowrap":String(k),N={props:e},C=(k,g)=>{if(!(g==null||g===!1)){if(Array.isArray(g)){g.forEach(P=>C(k,P));return}if(g!=null&&g.nodeType){k.appendChild(g);return}k.appendChild(document.createTextNode(String(g)))}},z=(k,g)=>{const P=JSswift.ui.getSlot(s,k);if(P!=null)return T(s,k,N,null);if(typeof g=="function"){const K=_.div({class:`cms-container-slot-${k}`});return JSswift.reactive.effect(()=>{const ee=xn(JSswift.ui.slot(g(N)));K.replaceChildren(),Array.isArray(ee)?ee.forEach(Ce=>C(K,Ce)):C(K,ee)},`UI.Container:${k}`),[K]}return T(s,k,N,g)},U=c("content")?e.content:n!=null&&n.length?n:null,W=z("before",(y=e.before)!=null?y:e.top),ge=z("header",e.header),B=[...z("left",e.left),...z("start",e.start)],ne=z("body",c("body")?e.body:null),he=(()=>{const k=z("content",c("content")?e.content:null);return k.length?k:z("default",U)})(),q=[...z("right",e.right),...z("end",e.end)],se=z("footer",e.footer),le=z("after",(j=e.after)!=null?j:e.bottom),fe=W.length||ge.length||B.length||q.length||se.length||le.length||JSswift.ui.getSlot(s,"before")!=null||JSswift.ui.getSlot(s,"header")!=null||JSswift.ui.getSlot(s,"left")!=null||JSswift.ui.getSlot(s,"start")!=null||JSswift.ui.getSlot(s,"right")!=null||JSswift.ui.getSlot(s,"end")!=null||JSswift.ui.getSlot(s,"footer")!=null||JSswift.ui.getSlot(s,"after")!=null,be=!!fe||ne.length>0&&(JSswift.ui.getSlot(s,"body")!=null||fe),re=()=>{var g;const k=String(o((g=e.layout)!=null?g:e.display)||"").trim().toLowerCase();return["flex","grid","stack"].includes(k)?k:["inline","inline-flex","inlineflex"].includes(k)||o(e.inline)?"inline":o(e.grid)||o(e.cols)!=null?"grid":k==="block"?"block":o(e.direction)!=null||o(e.wrap)!=null||o(e.align)!=null||o(e.justify)!=null||o(e.gap)!=null||B.length||q.length?"flex":"block"},ue=xt([e.layout,e.display,e.inline,e.grid,e.cols,e.direction,e.wrap,e.align,e.justify,e.gap],()=>{const k=re();return k==="block"?"":`is-${k}`}),O={...i.style||{}},Y=(k,g)=>{g!=null&&(O[k]=g)};Y("maxWidth",xt([e.maxWidth,e.fluid],()=>o(e.fluid)?"none":u(o(e.maxWidth))||"")),Y("width",Ge(e.width,u)),Y("minWidth",Ge(e.minWidth,u)),Y("--cms-container-padding",Ge(e.padding,a)),Y("--cms-container-padding-x",Ge((X=e.paddingX)!=null?X:e.gutter,a)),Y("--cms-container-padding-y",Ge(e.paddingY,a)),Y("--cms-container-gap",Ge(e.gap,a)),Y("--cms-container-section-gap",Ge((d=e.sectionGap)!=null?d:e.gap,a)),Y("--cms-container-cols",Ge(e.cols,b)),Y("--cms-container-align",Ge(e.align,k=>String(k))),Y("--cms-container-justify",Ge(e.justify,k=>String(k))),Y("--cms-container-direction",Ge(e.direction,k=>String(k))),Y("--cms-container-wrap",Ge(e.wrap,M));const oe=JSswift.omit(i,["after","afterClass","align","as","before","beforeClass","body","bodyClass","bottom","cols","content","contentClass","direction","display","end","endClass","fluid","footer","footerClass","gap","grid","gutter","header","headerClass","inline","justify","layout","left","mainClass","maxWidth","minWidth","padding","paddingX","paddingY","right","sectionGap","slots","start","startClass","tag","top","width","wrap"]);oe.class=Z(["cms-container",ye(e.fluid,"is-fluid"),ye(be,"has-structure"),be?"":ue,i.class]),oe.style=O,JSswift.uiApplyResponsiveProps(oe,e,JSswift.uiResponsiveStyleRules);const we=(k,g,P)=>g.length?_.div({class:Z(["cms-container-section",`cms-container-${k}`,P])},...g):null,R=ne.length?_.div({class:Z(["cms-container-body",be?ue:"",e.bodyClass])},...ne):B.length||he.length||q.length?_.div({class:Z(["cms-container-body",be?ue:"",e.bodyClass])},we("start",B,e.startClass),he.length?_.div({class:Z(["cms-container-main",e.mainClass,e.contentClass])},...he):null,we("end",q,e.endClass)):null,h=(()=>{var g;const k=String(o((g=e.tag)!=null?g:e.as)||"div").toLowerCase();return typeof _[k]=="function"?_[k]:_.div})(),m=be?h(oe,we("before",W,e.beforeClass),we("header",ge,e.headerClass),R,we("footer",se,e.footerClass),we("after",le,e.afterClass)):h(oe,...ne.length?ne:he);return At(m,e),m},Ae.Card=(...t)=>{var Ce,E;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i={...e};vn(i);const c=(p,A)=>{var L;return!!(p&&p.nodeType===1&&((L=p.classList)!=null&&L.contains(`cms-card-${A}`)))},u=(p=>p==null?null:typeof p=="string"?Ae.Icon({name:p,size:e.iconSize||e.size||"lg"}):JSswift.ui.slot(p,{as:"icon"}))(e.icon),a=e.image?_.img({src:e.image,alt:e.imageAlt||"",class:Z(["cms-card-cover-media",e.imageClass]),style:e.imageStyle}):e.cover,b={dense:!!o(e.dense),flat:!!o(e.flat),clickable:!!o(e.clickable),to:o(e.to)||null},M=T(s,"default",b,n!=null&&n.length?n:[]),N={identifier:[],cover:[],media:[],header:[],body:[],footer:[],actions:[]},C=[];M.forEach(p=>{c(p,"identifier")?N.identifier.push(p):c(p,"cover")?N.cover.push(p):c(p,"media")?N.media.push(p):c(p,"header")?N.header.push(p):c(p,"body")?N.body.push(p):c(p,"footer")?N.footer.push(p):c(p,"actions")?N.actions.push(p):C.push(p)});const z=T(s,"identifier",b,e.identifier),U=T(s,"cover",b,a),W=T(s,"media",b,e.media),ge=T(s,"eyebrow",b,(Ce=e.eyebrow)!=null?Ce:e.kicker),B=T(s,"title",b,e.title),ne=T(s,"subtitle",b,e.subtitle),he=T(s,"header",b,e.header),q=T(s,"icon",b,u),se=T(s,"aside",b,(E=e.aside)!=null?E:e.headerAside),le=T(s,"body",b,e.body),fe=T(s,"footer",b,e.footer),be=T(s,"actions",b,e.actions),re=z.length?_.div({class:Z(["cms-card-identifier",e.identifierClass])},...z):null,ue=U.length?_.div({class:Z(["cms-card-cover",e.coverClass])},...U):null,O=W.length?_.div({class:Z(["cms-card-media",e.mediaClass])},...W):null,oe=q.length||ge.length||B.length||ne.length||he.length||se.length?_.div({class:Z(["cms-card-header",e.headerClass])},_.div({class:"cms-card-head"},q.length?_.div({class:"cms-card-icon"},...q):null,_.div({class:"cms-card-head-main"},ge.length?_.div({class:Z(["cms-card-eyebrow",e.eyebrowClass])},...ge):null,B.length?_.div({class:Z(["cms-card-title",e.titleClass])},...B):null,ne.length?_.div({class:Z(["cms-card-subtitle",e.subtitleClass])},...ne):null,he.length?_.div({class:Z(["cms-card-header-content",e.headerContentClass])},...he):null),se.length?_.div({class:Z(["cms-card-aside",e.asideClass])},...se):null)):null,we=[...le,...C],R=we.length?_.div({class:Z(["cms-card-body",e.bodyClass])},...we):null,h=[...be,...N.actions],m=fe.length||h.length?_.div({class:Z(["cms-card-footer",e.footerClass])},...fe,h.length?_.div({class:"cms-card-actions"},...h):null):null,y=xt([e.clickable,e.to],()=>o(e.clickable)||o(e.to)?"cms-card-clickable":""),j=z.length||N.identifier.length,X=U.length||N.cover.length||W.length||N.media.length,d=JSswift.omit(i,["actions","aside","asideClass","body","bodyClass","clickable","cover","coverClass","coverHeight","dense","eyebrow","eyebrowClass","flat","footer","footerClass","header","headerAside","headerClass","headerContentClass","icon","iconSize","identifier","identifierClass","image","imageAlt","imageClass","imageStyle","kicker","media","mediaClass","slots","subtitle","subtitleClass","title","titleClass","to","display","direction","wrap","align","justify","gap","rowGap","columnGap","cols","columns"]);d.class=Z(["cms-panel","cms-card","cms-clear-set","cms-singularity",ye(e.flat,"cms-card-flat"),ye(e.dense,"cms-card-dense"),ye(j,"cms-card-has-identifier"),ye(X,"cms-card-has-top-visual"),y,i.class]),d.style={...i.style||{}},e.coverHeight!=null&&(d.style["--cms-card-cover-height"]=gt(o(e.coverHeight))),JSswift.uiApplyResponsiveProps(d,e,JSswift.uiResponsiveStyleRules);const k=e.onClick,g=e.onKeydown,P=p=>{var L;if(k==null||k(p),p.defaultPrevented)return;const A=o(e.to);A&&((L=JSswift.router)!=null&&L.navigate)&&(p.preventDefault(),JSswift.router.navigate(A))},K=p=>{g==null||g(p),!p.defaultPrevented&&(p.key==="Enter"||p.key===" ")&&(p.preventDefault(),P(p))};(o(e.clickable)||o(e.to))&&(d.onClick=P,d.onKeydown=K,d.tabIndex==null&&(d.tabIndex=0),d.role==null&&(d.role="button"));const ee=_.div(d,re,...N.identifier,ue,...N.cover,O,...N.media,oe,...N.header,R,...N.body,m,...N.footer);return At(ee,e),ee},Ae.Btn=(...t)=>{var ue;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=xt([e.color,e.state],()=>{const O=o(e.color)||o(e.state)||"";return["primary","secondary","warning","danger","success","info","light","dark"].includes(O)?O:o(e.state)||""}),c=Z(["cms-clear-set","cms-btn","cms-singularity","cms-clickable",i,ye(e.outline,"outline"),e.class]),S=JSswift.omit(e,["icon","iconRight","label","loading","loadingText","disabled","outline","iconAlign","slots","shortcode","shortcut","hotkey","showShortcode","showShortcut"]);S.class=c;const u=()=>!!o(e.loading),a=()=>!!o(e.disabled)||u(),b=e.icon!=null?typeof e.icon=="string"?Ae.Icon({name:e.icon}):e.icon:null,M=e.iconRight!=null?typeof e.iconRight=="string"?Ae.Icon({name:e.iconRight}):e.iconRight:null,N=JSswift.ui.renderSlot(s,"icon",{},b),C=JSswift.ui.renderSlot(s,"iconRight",{},M),z=JSswift.ui.renderSlot(s,"label",{},e.label),U=T(s,"default",{},n),W=[],ge=O=>{O&&(Array.isArray(O)?W.push(...O):W.push(O))},B=e.iconAlign;(B==="after"||B==="right")&&!M?(ge(z),U.length&&W.push(...U),ge(N)):(ge(N),ge(z),U.length&&W.push(...U)),ge(C),ge(Re(e,{className:"cms-shortcode cms-btn-shortcode"})),W.length===0&&W.push(_.span("Button"));const he=_.span({class:"cms-btn-loading",hidden:!0}),q=_.span({class:"cms-btn-content"},...W);let se=!1;const le=()=>{const O=Ae.Spinner?Ae.Spinner({size:e.loadingSize||e.spinnerSize||16,thickness:e.loadingThickness||2,color:e.loadingColor||"currentColor",label:e.loadingText||null,"aria-label":e.loadingText?null:"Loading"}):_.span({class:"cms-muted",style:{marginRight:"8px"}},e.loadingText||"Loading");return T(null,"default",{},JSswift.ui.renderSlot(s,"loading",{},O))},fe=O=>{var h;if((h=e.onPointerDown)==null||h.call(e,O),a()||!(O!=null&&O.currentTarget))return;const Y=O.currentTarget,oe=Y.getBoundingClientRect(),we=typeof O.clientX=="number"?O.clientX-oe.left:oe.width/2,R=typeof O.clientY=="number"?O.clientY-oe.top:oe.height/2;Y.style.setProperty("--cms-burst-x",`${we}px`),Y.style.setProperty("--cms-burst-y",`${R}px`),Y.classList.remove("cms-btn-burst"),Y.offsetWidth,Y.classList.add("cms-btn-burst")},be=_.button({...S,disabled:a(),onClick:O=>{var Y,oe;return a()?((Y=O==null?void 0:O.preventDefault)==null||Y.call(O),!1):(oe=e.onClick)==null?void 0:oe.call(e,O)},onPointerDown:fe,"aria-disabled":a()?"true":null,"aria-busy":u()?"true":null},he,q),re=JSswift.reactive.effect(()=>{const O=u(),Y=a();be.disabled=Y,be.classList.toggle("is-loading",O),be.setAttribute("aria-disabled",Y?"true":"false"),O?be.setAttribute("aria-busy","true"):be.removeAttribute("aria-busy"),he.hidden=!O,O!==se&&(he.replaceChildren(...O?le():[]),se=O)},"UI.Btn:state");return(ue=JSswift._registerCleanup)==null||ue.call(JSswift,be,re),At(be,e),tt(be,e,{isEnabled:()=>!a(),action:()=>{if(a())return!1;be.click()}}),be},Ae.Button=Ae.Btn,JSswift.ui.Btn=Ae.Btn,JSswift.ui.Button=Ae.Button;let Mn=0;Ae.FormField=(t={})=>{var ue,O,Y,oe,we,R,h;vn(t);const e=t.slots||{},n=xt([t.color,t.state],()=>{const m=o(t.color)||o(t.state)||"";return["primary","secondary","warning","danger","success","info","light","dark"].includes(m)?m:o(t.state)||""}),s=_.div({class:Z(["cms-clear-field-set","cms-field","cms-singularity-field",n,ye(t.fill,"cms-field-fill"),ye(t.outline,"outline"),t.wrapClass,t.class])}),i=T(e,"topLabel",{},t.topLabel);i.length&&s.appendChild(_.div({class:"cms-field-label"},...i));const c=t.multi||t.multiple,S=typeof t.control=="function"?t.control():t.control,u=()=>{if(typeof t.hasValue=="function")return!!t.hasValue();if(t.hasValue!=null)return!!o(t.hasValue);const m=t.getValue?t.getValue():null;return!(m==null||m==="")},a=()=>JSswift.reactive.untracked(u),b=()=>{var m,y;t.disabled||t.readonly||((m=t.onClear)==null||m.call(t),(y=t.onFocus)==null||y.call(t))},M=JSswift.ui.renderSlot(e,"control",{control:S,clear:b,disabled:!!t.disabled,readonly:!!t.readonly,hasValue:a()},null);let N=null,C=null;if(M)N=Array.isArray(M)?_.div({class:"cms-control"},...M):M;else{N=_.div({class:"cms-control"});const m=_.div({class:"cms-addon cms-addon-left"}),y=t.icon!=null?typeof t.icon=="string"?Ae.Icon({name:t.icon}):t.icon:null,j=JSswift.ui.renderSlot(e,"icon",{},y),X=JSswift.ui.renderSlot(e,"prefix",{},t.prefix);T(null,"default",{},j).forEach(A=>m.appendChild(A)),T(null,"default",{},X).forEach(A=>m.appendChild(A)),m.childNodes.length&&N.appendChild(m);const d=_.div({class:"cms-mid"+(m.childNodes.length>0?" cms-with-left":""),style:{position:"relative",flex:"1",minWidth:"0"}});S&&d.appendChild(S);const k=T(e,"label",{},t.label);if(k.length){const A=_.div({class:Z(["cms-float-label",ye(c,"cms-multiselect")])},...k);d.appendChild(A)}N.appendChild(d);const g=t.clearable?_.div({class:"cms-clear",title:"Clear",onClick:b},Ae.Icon({name:"close"})):null,P=JSswift.ui.renderSlot(e,"clear",{disabled:!!t.disabled,readonly:!!t.readonly,hasValue:a()},g);P&&(P.onclick=A=>{A.stopPropagation(),b()},T(null,"default",{},P).forEach(A=>N.appendChild(A))),C=g,C&&((ue=t.clearable)!=null&&ue.action)&&t.clearable.action(A=>A?C.classList.remove("cms-d-none"):C.classList.add("cms-d-none"));const K=_.div({class:"cms-addon cms-addon-right"}),ee=t.iconRight!=null?typeof t.iconRight=="string"?Ae.Icon({name:t.iconRight}):t.iconRight:null,Ce=JSswift.ui.renderSlot(e,"iconRight",{},ee),E=JSswift.ui.renderSlot(e,"suffix",{},t.suffix),p=JSswift.ui.renderSlot(e,"shortcode",{props:t},Re(t,{className:"cms-shortcode cms-field-shortcode"}));T(null,"default",{},E).forEach(A=>K.appendChild(A)),T(null,"default",{},Ce).forEach(A=>K.appendChild(A)),T(null,"default",{},p).forEach(A=>K.appendChild(A)),K.childNodes.length&&(N.appendChild(K),d.classList.add("cms-with-right"))}const z=m=>m&&(m&&typeof m.action=="function"?m.value:Array.isArray(m)&&typeof m[0]=="function"?m[0]():typeof m=="function"?m():m),U=m=>m==null||m===!1||m===""?!1:Array.isArray(m)?m.length>0:!0;let W=null;const ge=`jsswift-field-message-${++Mn}`,B=()=>{if(!(S!=null&&S.setAttribute))return;const m=[o(t.ariaDescribedBy),W==null?void 0:W.id].filter(Boolean).join(" ").trim();m?S.setAttribute("aria-describedby",[...new Set(m.split(/\s+/))].join(" ")):S.removeAttribute("aria-describedby")};s._syncDescription=B;const ne=()=>{const m=[{key:"error",value:z(t.error),slot:"errorMessage",className:"cms-error"},{key:"warning",value:z(t.warning),slot:"warning",className:"cms-warning"},{key:"success",value:z(t.success),slot:"success",className:"cms-success"},{key:"note",value:z(t.note),slot:"note",className:"cms-note"},{key:"hint",value:z(t.hint),slot:"hint",className:"cms-hint"}];let y=null;for(const g of m)if(U(g.value)){y=g;break}const j={error:m[0].value,warning:m[1].value,success:m[2].value,note:m[3].value,hint:m[4].value,props:t},X=y?T(e,y.slot,j,y.value):[],d=X.length?_.div({id:ge,class:y==null?void 0:y.className},...X):null;["error","warning","success","note"].forEach(g=>{var P;return(P=N==null?void 0:N.classList)==null?void 0:P.toggle(g,(y==null?void 0:y.key)===g)}),W?d?W.replaceWith(d):W.remove():d&&s.appendChild(d),W=d,B()},he=()=>{var y;const m=u();(y=N==null?void 0:N.classList)==null||y.toggle("has-value",m),C&&(C.style.display=m?"":"none")};JSswift.reactive.untracked(he),(O=N==null?void 0:N.classList)==null||O.toggle("disabled",!!t.disabled),s.appendChild(N);const q=JSswift.ui.getSlot(e,"errorMessage"),se=JSswift.ui.getSlot(e,"warning"),le=JSswift.ui.getSlot(e,"success"),fe=JSswift.ui.getSlot(e,"note"),be=JSswift.ui.getSlot(e,"hint");if(!!((Y=t.error)!=null&&Y.action||(oe=t.warning)!=null&&oe.action||(we=t.success)!=null&&we.action||(R=t.note)!=null&&R.action||(h=t.hint)!=null&&h.action)||Array.isArray(t.error)&&typeof t.error[0]=="function"||Array.isArray(t.warning)&&typeof t.warning[0]=="function"||Array.isArray(t.success)&&typeof t.success[0]=="function"||Array.isArray(t.note)&&typeof t.note[0]=="function"||Array.isArray(t.hint)&&typeof t.hint[0]=="function"||typeof t.error=="function"||typeof t.warning=="function"||typeof t.success=="function"||typeof t.note=="function"||typeof t.hint=="function"||typeof q=="function"||typeof se=="function"||typeof le=="function"||typeof fe=="function"||typeof be=="function"){const m=JSswift.reactive.effect(()=>{ne()},"UI.FormField:message");JSswift._registerCleanup(s,m)}else ne();return s._refresh=he,s._control=N,s._el=S,s},Ae.InputRaw=(t={})=>{var z;const e=_.input({class:Z(["cms-input-raw",t.class]),type:t.type||"text",name:t.name,placeholder:t.placeholder,autocomplete:t.autocomplete,value:t.value});let n=!1;const s=new Set,i=(U,W)=>{if(n)return;const ge=setTimeout(()=>{s.delete(ge),n||U()},W);s.add(ge)};let c=(z=e.value)!=null?z:"";const S=()=>{var W;const U=(W=e.value)!=null?W:"";U!==c&&(c=U,e.dispatchEvent(new Event("input",{bubbles:!0})),e.dispatchEvent(new Event("change",{bubbles:!0})))};let u=null,a=!1;const b=()=>{if(n||a)return;a=!0;let U=0;const W=()=>{if(S(),U+=1,U>=10){a=!1;return}i(W,120)};i(W,40)},M=()=>{n||u||(u=setInterval(()=>{if(document.activeElement!==e){clearInterval(u),u=null;return}S()},250))},N=()=>{u&&(clearInterval(u),u=null)};e.addEventListener("input",()=>{var U;c=(U=e.value)!=null?U:""}),e.addEventListener("change",()=>{var U;c=(U=e.value)!=null?U:""}),e.addEventListener("animationstart",U=>{U.animationName==="cms-autofill"&&(S(),M(),b())}),e.addEventListener("focus",()=>{M(),b(),i(S,50)}),e.addEventListener("blur",()=>{N(),i(S,0)}),i(S,0),b(),JSswift._registerCleanup(e,()=>{n=!0,N(),s.forEach(clearTimeout),s.clear()});const C=t.model;if(C){if(typeof C=="object"&&typeof C._bind=="function")JSswift._registerCleanup(e,bt.rodModel(e,C));else if(Array.isArray(C)&&typeof C[0]=="function"&&typeof C[1]=="function"){const U=JSswift.reactive.untracked(()=>bt.signalModel(e,C[0],C[1]));JSswift._registerCleanup(e,U)}}return tt(e,t,{isEnabled:()=>!e.disabled,action:()=>Pe(e,{selectText:!!t.selectOnShortcode})}),e};function on(t,e,n,s=!1){t.focus=S=>e.focus(S);const i=(S,u)=>{u==null||u===!1?e.removeAttribute(S):e.setAttribute(S,String(u))},c=JSswift.reactive.effect(()=>{var b,M;const S=(b=o(n.ariaLabel))!=null?b:typeof n.label=="string"?n.label:null;i("aria-label",S),i("aria-labelledby",o(n.ariaLabelledBy)),(M=t._syncDescription)==null||M.call(t);const u=n.ariaInvalid==null?!!o(n.error):!!o(n.ariaInvalid);e.setAttribute("aria-invalid",String(u));const a=!!o(n.required);if(e.setAttribute("aria-required",String(a)),s){e.required=a;for(const N of["min","max","step","pattern","minLength","maxLength"])i(N.toLowerCase(),o(n[N]))}},"UI.Field:controlAttributes");JSswift._registerCleanup(t,c)}Ae.Input=(t={})=>{var ne,he,q;const e=t.slots||{},n={...t,label:(ne=t.label)!=null?ne:t.placeholder},s=_.input({class:Z(["cms-input",t.class]),type:t.type||"text",name:t.name,autocomplete:t.autocomplete,inputmode:t.inputmode,value:(he=t.value)!=null?he:"",disabled:!!t.disabled,readOnly:!!t.readonly});let i=!1;const c=new Set,S=(se,le)=>{if(i)return;const fe=setTimeout(()=>{c.delete(fe),i||se()},le);c.add(fe)};let u=(q=s.value)!=null?q:"";const a=()=>{var le;const se=(le=s.value)!=null?le:"";se!==u&&(u=se,s.dispatchEvent(new Event("input",{bubbles:!0})),s.dispatchEvent(new Event("change",{bubbles:!0})))};let b=null,M=!1;const N=()=>{if(i||M)return;M=!0;let se=0;const le=()=>{if(a(),se+=1,se>=10){M=!1;return}S(le,120)};S(le,40)},C=()=>{i||b||(b=setInterval(()=>{if(document.activeElement!==s){clearInterval(b),b=null;return}a()},250))},z=()=>{b&&(clearInterval(b),b=null)};s.addEventListener("input",()=>{var se,le;u=(se=s.value)!=null?se:"",(le=t.onInput)==null||le.call(t,s.value)}),s.addEventListener("change",()=>{var se,le;u=(se=s.value)!=null?se:"",(le=t.onChange)==null||le.call(t,s.value)}),s.addEventListener("focus",se=>{var le;(le=t.onFocus)==null||le.call(t,se),C(),N(),S(a,50)}),s.addEventListener("blur",se=>{var le;(le=t.onBlur)==null||le.call(t,se),z(),S(a,0)}),s.addEventListener("animationstart",se=>{se.animationName==="cms-autofill"&&(a(),C(),N())}),S(a,0),N(),JSswift._registerCleanup(s,()=>{i=!0,z(),c.forEach(clearTimeout),c.clear()});const U=t.model;if(U){const se=le=>{var oe;let fe=!1;const be=we=>{const R=we!=null?we:"";s.value!==R&&(s.value=R,u=R)},re=we=>{if(!fe){fe=!0;try{be(we)}finally{fe=!1}}};le.action(re),JSswift.reactive.untracked(()=>be(le.value));const ue=we=>{if(fe||we!=null&&we.isComposing)return;const R=s.value;if(le.value!==R){fe=!0;try{le.value=R}finally{fe=!1}}};s.addEventListener("input",ue),s.addEventListener("compositionend",ue);let O=!1;const Y=()=>{var h,m,y,j;if(O)return;O=!0,s.removeEventListener("input",ue),s.removeEventListener("compositionend",ue);const we=(m=(h=le._actions)==null?void 0:h.indexOf(re))!=null?m:-1;we>=0&&le._actions.splice(we,1);const R=(j=(y=le._disposeHooks)==null?void 0:y.indexOf(Y))!=null?j:-1;R>=0&&!le._disposed&&le._disposeHooks.splice(R,1)};(oe=le.onDispose)==null||oe.call(le,Y),JSswift._registerCleanup(s,Y)};if(typeof U=="object"&&typeof U._bind=="function")se(U);else if(Array.isArray(U)&&typeof U[0]=="function"&&typeof U[1]=="function"){const le=JSswift.reactive.untracked(()=>JSswift.rodFromSignal(U[0],U[1]));se(le),JSswift._registerCleanup(s,()=>le.dispose())}}const W=JSswift.ui.renderSlot(e,"input",{input:s,props:t},s),ge=Array.isArray(W)?_.div({style:{display:"contents"}},...W):W,B=Ae.FormField({...n,control:ge,getValue:()=>s.value,onClear:()=>{s.disabled||s.readOnly||(s.value="",s.dispatchEvent(new Event("input",{bubbles:!0})))},onFocus:()=>s.focus()});return s.addEventListener("input",()=>{var se;return(se=B._refresh)==null?void 0:se.call(B)}),s.addEventListener("change",()=>{var se;return(se=B._refresh)==null?void 0:se.call(B)}),B._input=s,on(B,s,t,!0),tt(s,t,{isEnabled:()=>!s.disabled,action:()=>Pe(s,{selectText:!!t.selectOnShortcode})}),B},Ae.Textarea=(t={})=>{var b,M,N,C;const e=t.slots||{},n={...t,label:(b=t.label)!=null?b:t.placeholder,wrapClass:Z(["cms-textarea-field",t.wrapClass])},s=_.textarea({class:Z(["cms-input","cms-textarea",t.class]),name:t.name,autocomplete:t.autocomplete,inputmode:t.inputmode,rows:t.rows,cols:t.cols,maxLength:(M=t.maxLength)!=null?M:t.maxlength,minLength:(N=t.minLength)!=null?N:t.minlength,wrap:t.wrap,value:(C=t.value)!=null?C:"",disabled:!!t.disabled,readOnly:!!t.readonly});s.addEventListener("input",()=>{var z;(z=t.onInput)==null||z.call(t,s.value)}),s.addEventListener("change",()=>{var z;(z=t.onChange)==null||z.call(t,s.value)}),s.addEventListener("focus",z=>{var U;(U=t.onFocus)==null||U.call(t,z)}),s.addEventListener("blur",z=>{var U;(U=t.onBlur)==null||U.call(t,z)});const i=t.model;if(i){const z=U=>{var se;let W=!1;const ge=le=>{const fe=le!=null?le:"";s.value!==fe&&(s.value=fe)},B=le=>{if(!W){W=!0;try{ge(le)}finally{W=!1}}};U.action(B),JSswift.reactive.untracked(()=>ge(U.value));const ne=le=>{if(W||le!=null&&le.isComposing)return;const fe=s.value;if(U.value!==fe){W=!0;try{U.value=fe}finally{W=!1}}};s.addEventListener("input",ne),s.addEventListener("compositionend",ne);let he=!1;const q=()=>{var be,re,ue,O;if(he)return;he=!0,s.removeEventListener("input",ne),s.removeEventListener("compositionend",ne);const le=(re=(be=U._actions)==null?void 0:be.indexOf(B))!=null?re:-1;le>=0&&U._actions.splice(le,1);const fe=(O=(ue=U._disposeHooks)==null?void 0:ue.indexOf(q))!=null?O:-1;fe>=0&&!U._disposed&&U._disposeHooks.splice(fe,1)};(se=U.onDispose)==null||se.call(U,q),JSswift._registerCleanup(s,q)};if(typeof i=="object"&&typeof i._bind=="function")z(i);else if(Array.isArray(i)&&typeof i[0]=="function"&&typeof i[1]=="function"){const U=JSswift.reactive.untracked(()=>JSswift.rodFromSignal(i[0],i[1]));z(U),JSswift._registerCleanup(s,()=>U.dispose())}}const c=JSswift.ui.getSlot(e,"textarea")!=null?"textarea":"input",S=JSswift.ui.renderSlot(e,c,{textarea:s,input:s,props:t},s),u=Array.isArray(S)?_.div({style:{display:"contents"}},...S):S,a=Ae.FormField({...n,control:u,getValue:()=>s.value,onClear:()=>{s.disabled||s.readOnly||(s.value="",s.dispatchEvent(new Event("input",{bubbles:!0})))},onFocus:()=>s.focus()});return s.addEventListener("input",()=>{var z;return(z=a._refresh)==null?void 0:z.call(a)}),s.addEventListener("change",()=>{var z;return(z=a._refresh)==null?void 0:z.call(a)}),a._input=s,a._textarea=s,tt(s,t,{isEnabled:()=>!s.disabled,action:()=>Pe(s,{selectText:!!t.selectOnShortcode})}),a};function On(){const t=[];return{effect:(e,n)=>{const s=JSswift.reactive.effect(e,n);return t.push(s),s},action:(e,n)=>{e.action(n),t.push(()=>{var i,c;const s=(c=(i=e._actions)==null?void 0:i.indexOf(n))!=null?c:-1;s>=0&&e._actions.splice(s,1)})},dispose:()=>t.splice(0).forEach(e=>e())}}Ae.Search=(t={})=>{var ie,$e;const e=On();let n=!1;const s=t.slots||{},i=F=>!!F&&(typeof F=="object"&&typeof F._bind=="function"||Ct(F)),c=i(t.model)?t.model:i(t.value)?t.value:null,S=c?typeof c=="object"&&typeof c._bind=="function"?c.value:c[0]():o(t.value),[u,a]=JSswift.reactive.signal(S==null?"":String(S)),[b,M]=JSswift.reactive.signal(!1),[N,C]=JSswift.reactive.signal(!1),[z,U]=JSswift.reactive.signal(null),[W,ge]=JSswift.reactive.signal([]),[B,ne]=JSswift.reactive.signal(-1),he=`cms-search-${Math.random().toString(36).slice(2,10)}`,q=new Map;let se=null,le=null,fe=null,be=0,re=0,ue=!1,O=-1,Y=[];const oe=(F,f)=>{const r=Number(o(F));return Number.isFinite(r)?r:f},we=(F,f=!1)=>{const r=o(F);return r==null?f:!!r},R=()=>we(t.disabled,!1),h=()=>we(t.readonly,!1),m=()=>Math.max(0,oe(t.minLength,t.endpoint?1:0)),y=()=>Math.max(0,oe(t.debounce,250)),j=F=>{var r,x,de,Be,He;const f=t.getLabel||t.labelOf;return typeof f=="function"?f(F):F==null?"":typeof F=="string"||typeof F=="number"?String(F):(He=(Be=(de=(x=(r=F.label)!=null?r:F.title)!=null?x:F.name)!=null?de:F.text)!=null?Be:F.value)!=null?He:""},X=F=>{var r,x,de;const f=t.getValue||t.valueOf;return typeof f=="function"?f(F):F==null?"":typeof F=="string"||typeof F=="number"?F:(de=(x=(r=F.value)!=null?r:F.id)!=null?x:F.key)!=null?de:j(F)},d=F=>Array.isArray(F)?F:!F||typeof F!="object"?[]:Array.isArray(F.items)?F.items:Array.isArray(F.results)?F.results:Array.isArray(F.data)?F.data:[],k=async(F,f)=>{const r=typeof F=="function"?F(f,{props:t}):o(F);return r&&typeof r.then=="function"?await r:r},g=(F,f)=>{const r=typeof F=="function"?F(f,{props:t}):o(F);if(!r)return"";const x=String(r),de=new URL(x,window.location.href),Be=o(t.queryParam)||"q";Be&&de.searchParams.set(Be,f);const He=typeof t.params=="function"?t.params(f,{props:t}):o(t.params);return He&&typeof He=="object"&&Object.keys(He).forEach(Se=>{const Oe=o(He[Se]);Oe==null||Oe===!1||de.searchParams.set(Se,String(Oe))}),de.toString()},P=(F,f={})=>{var x,de;const r=F==null?"":String(F);u()!==r&&a(r),Ie.value!==r&&(Ie.value=r),se&&!f.fromModel&&se(r),f.fromModel||(x=t.onInput)==null||x.call(t,r,f.event),(de=We==null?void 0:We._refresh)==null||de.call(We)},K=()=>{M(!1),ne(-1)},ee=()=>N()||z()||W().length?!0:u().trim().length>=m()?!!(t.emptyText||JSswift.ui.getSlot(s,"empty")!=null):!!(t.startText||JSswift.ui.getSlot(s,"empty")!=null),Ce=()=>{R()||ee()&&(M(!0),V())},E=()=>{ge([]),U(null),ne(-1)},p=async(F,f={})=>{var Oe,at,nt,Ze,wt,Nt;if(n)return;const r=F==null?"":String(F).trim(),x=++be,de=o((Oe=t.endpoint)!=null?Oe:t.url),Be=(nt=(at=t.items)!=null?at:t.options)!=null?nt:t.suggestions;if(fe&&(fe.abort(),fe=null),r.length<m()){C(!1),E(),f.open&&ee()?Ce():ee()||K();return}const He=t.cache!==!1,Se=`${de||"local"}::${r}`;if(He&&q.has(Se)){ge(q.get(Se)),U(null),C(!1),ne(q.get(Se).length?0:-1),f.open!==!1&&Ce();return}C(!0),U(null),f.open!==!1&&Ce(),(Ze=t.onSearch)==null||Ze.call(t,r);try{let Et;if(de){fe=new AbortController;const vt=g(de,r),Dt=await fetch(vt,{method:"GET",headers:t.headers,credentials:t.credentials,signal:fe.signal});if(!Dt.ok)throw new Error(`Search request failed (${Dt.status})`);Et=await(t.parseResponse||(Ht=>Ht.json()))(Dt)}else if(Be!=null){const vt=d(await k(Be,r)),Dt=t.filter||((ft,Ht)=>String(j(ft)).toLowerCase().includes(Ht.toLowerCase()));Et=vt.filter(ft=>Dt(ft,r))}else Et=[];if(n||x!==be)return;const Rt=typeof t.mapResponse=="function"?t.mapResponse(Et,r):d(Et),Mt=d(Rt);He&&q.set(Se,Mt),ge(Mt),ne(Mt.length?0:-1),(wt=t.onResults)==null||wt.call(t,Mt,r)}catch(Et){if((Et==null?void 0:Et.name)==="AbortError"||n||x!==be)return;U(Et),ge([]),ne(-1),(Nt=t.onError)==null||Nt.call(t,Et,r)}finally{!n&&x===be&&(C(!1),fe=null,V())}},A=(F,f={})=>{if(n)return;le&&clearTimeout(le);const r=f.immediate?0:y();le=setTimeout(()=>{le=null,p(F,f)},r)},L=F=>{var r;const f=u();(r=t.onSubmit)==null||r.call(t,f,F),t.submitOnEnter!==!1&&A(f,{immediate:!0,open:!0})},ae=(F,f)=>{var de;if(!F)return;const r=X(F),x=j(F);t.commitValue==="value"?P(r,{event:f}):t.commitValue!==!1&&P(x,{event:f}),(de=t.onSelect)==null||de.call(t,F,{value:r,label:x,query:u(),event:f}),t.closeOnSelect!==!1&&K()},ke=F=>{const f=W();if(!f.length)return;const r=B(),x=r<0?F>0?0:f.length-1:Math.max(0,Math.min(f.length-1,r+F));ne(x)},Te=F=>{const f=F==null?"":String(F),r=u().trim();if(!r||t.highlight===!1)return[document.createTextNode(f)];const x=f.toLowerCase().indexOf(r.toLowerCase());return x<0?[document.createTextNode(f)]:[document.createTextNode(f.slice(0,x)),_.mark({class:"cms-search-highlight"},f.slice(x,x+r.length)),document.createTextNode(f.slice(x+r.length))]},ze=F=>{var x,de;const f=j(F),r=F&&typeof F=="object"?(de=(x=F.description)!=null?x:F.subtitle)!=null?de:F.note:null;return _.div({class:"cms-search-result-content"},_.div({class:"cms-search-result-label"},...Te(f)),r?_.div({class:"cms-search-result-description"},String(r)):null)},V=()=>{!b()||rt.parentNode!==document.body||re||(re=requestAnimationFrame(()=>{if(re=0,!b()||!Xe.isConnected||rt.parentNode!==document.body)return;const F=Xe.getBoundingClientRect(),f=6,r=8,x=Math.max(180,window.innerWidth-r*2),de=Math.min(Math.max(F.width,oe(t.minMenuWidth,260)),x),Be=Math.max(r,Math.min(F.left,window.innerWidth-de-r));rt.style.width=`${de}px`,rt.style.left=`${Be}px`,rt.style.right="auto";const He=rt.getBoundingClientRect().height||0,Se=window.innerHeight-F.bottom-f-r,Oe=F.top-f-r;let nt=Se<180&&Oe>Se?F.top-f-He:F.bottom+f;nt=Math.max(r,Math.min(nt,window.innerHeight-He-r)),rt.style.top=`${nt}px`}))},H=()=>{ue||(ue=!0,window.addEventListener("resize",V),window.addEventListener("scroll",V,!0))},te=()=>{ue&&(ue=!1,window.removeEventListener("resize",V),window.removeEventListener("scroll",V,!0))},De=()=>{rt.parentNode!==document.body&&(re&&(cancelAnimationFrame(re),re=0),rt.classList.add("portal"),rt.style.display="block",document.body.appendChild(rt),H(),V())},je=()=>{re&&(cancelAnimationFrame(re),re=0),te(),rt.parentNode!==Xe&&Xe.appendChild(rt),rt.classList.remove("portal"),rt.style.display="",rt.style.position="",rt.style.top="",rt.style.left="",rt.style.right="",rt.style.width=""},_e=t.label!=null||JSswift.ui.getSlot(s,"label")!=null,Me=()=>{if(!_e){Ie.placeholder=o(t.placeholder)||"";return}Ie.placeholder=document.activeElement===Ie&&o(t.placeholder)||""},Ie=_.input({id:t.id,class:Z(["cms-input","cms-search-input",t.inputClass]),type:"search",name:t.name,placeholder:_e?"":t.placeholder,autocomplete:t.autocomplete||"off",inputmode:t.inputmode,value:u(),disabled:R(),readOnly:h(),role:"combobox","aria-autocomplete":"list","aria-expanded":"false","aria-controls":`${he}-list`}),Ye=_.div({id:`${he}-list`,class:"cms-search-results",role:"listbox"}),rt=_.div({class:Z(["cms-search-menu","cms-singularity-menu-select",t.menuClass,ye(t.fill,"cms-select-menu-fill")]),"data-cms-overlay-portal":"true",onClick:F=>F.stopPropagation()},Ye),Xe=_.div({class:Z(["cms-search",t.class]),role:"presentation"},Ie,rt);let We=null;if(c){if(typeof c=="object"&&typeof c._bind=="function")e.action(c,F=>P(F,{fromModel:!0})),se=F=>{c.value!==F&&(c.value=F)};else if(Array.isArray(c)&&typeof c[0]=="function"&&typeof c[1]=="function"){const F=c[0],f=c[1];e.effect(()=>{P(F(),{fromModel:!0})},"UI.Search:model"),se=r=>f(r)}}else Ke(t.value)&&e.effect(()=>{P(o(t.value),{fromModel:!0})},"UI.Search:value");Ie.addEventListener("input",F=>{P(Ie.value,{event:F}),t.searchOnInput!==!1&&A(Ie.value,{open:!0})}),Ie.addEventListener("change",F=>{var f;return(f=t.onChange)==null?void 0:f.call(t,Ie.value,F)}),Ie.addEventListener("focus",F=>{var f;Me(),(f=t.onFocus)==null||f.call(t,F),t.openOnFocus!==!1&&(t.searchOnFocus&&!W().length?A(Ie.value,{immediate:!0,open:!0}):Ce())}),Ie.addEventListener("blur",F=>{var f;Me(),(f=t.onBlur)==null||f.call(t,F)}),Ie.addEventListener("keydown",F=>{if(R()||h())return;const f=b(),r=W(),x=B();if(F.key==="Escape"){f&&(F.preventDefault(),K());return}if(F.key==="ArrowDown"){F.preventDefault(),f?ke(1):(Ce(),r.length||A(Ie.value,{immediate:!0,open:!0}));return}if(F.key==="ArrowUp"){F.preventDefault(),f?ke(-1):Ce();return}if(F.key==="Home"&&f&&r.length&&(F.metaKey||F.ctrlKey)){F.preventDefault(),ne(0);return}if(F.key==="End"&&f&&r.length&&(F.metaKey||F.ctrlKey)){F.preventDefault(),ne(r.length-1);return}F.key==="Enter"&&(f&&x>=0&&r[x]?(F.preventDefault(),ae(r[x],F)):L(F))});const w=F=>{if(!Xe.isConnected)return;const f=F.target;Xe.contains(f)||rt.contains(f)||K()};return document.addEventListener("click",w,!0),e.effect(()=>{const F=b();Xe.classList.toggle("open",F),Ie.setAttribute("aria-expanded",F?"true":"false"),F?De():je()},"UI.Search:open"),e.effect(()=>{const F=R(),f=h();Xe.classList.toggle("disabled",F),Xe.classList.toggle("readonly",f),Ie.disabled=F,Ie.readOnly=f},"UI.Search:disabled"),e.effect(()=>{const F=N(),f=z(),r=W(),x=u();if(Ye.innerHTML="",Y=[],O=-1,F){const de=JSswift.ui.renderSlot(s,"loading",{query:x},t.loadingText||"Caricamento...");Ye.appendChild(_.div({class:"cms-search-empty is-loading"},...T(null,"default",{},de)))}else if(f){const de=JSswift.ui.renderSlot(s,"error",{error:f,query:x},t.errorText||"Errore ricerca");Ye.appendChild(_.div({class:"cms-search-empty is-error"},...T(null,"default",{},de)))}else if(r.length)r.forEach((de,Be)=>{const Se=j(de),Oe=X(de),at=wt=>ae(de,wt),nt=JSswift.ui.renderSlot(s,"result",{item:de,index:Be,active:!1,label:Se,value:Oe,query:x,select:at},ze(de)),Ze=_.div({id:`${he}-result-${Be}`,class:Z(["cms-search-result",""]),role:"option","aria-selected":"false",onMouseEnter:()=>ne(Be),onMouseDown:wt=>wt.preventDefault(),onClick:at},...T(null,"default",{},nt));Ye.appendChild(Ze),Y[Be]=Ze});else{const Be=x.trim().length>=m()?t.emptyText||"Nessun risultato":t.startText||"",He=JSswift.ui.renderSlot(s,"empty",{query:x},Be);(Be||JSswift.ui.getSlot(s,"empty")!=null)&&Ye.appendChild(_.div({class:"cms-search-empty"},...T(null,"default",{},He)))}ee()||K(),V()},"UI.Search:render"),e.effect(()=>{const F=B();F!==O&&(Y[O]&&(Y[O].classList.remove("active"),Y[O].setAttribute("aria-selected","false")),Y[F]?(Y[F].classList.add("active"),Y[F].setAttribute("aria-selected","true"),Y[F].scrollIntoView({block:"nearest"}),Ie.setAttribute("aria-activedescendant",`${he}-result-${F}`)):Ie.removeAttribute("aria-activedescendant"),O=F)},"UI.Search:active"),We=Ae.FormField({...t,icon:(ie=t.icon)!=null?ie:"search",wrapClass:Z(["cms-search-field",t.wrapClass]),control:Xe,getValue:()=>u(),onClear:()=>{var F;R()||h()||(P("",{}),E(),(F=t.onClear)==null||F.call(t))},onFocus:()=>Ie.focus()}),Ie.addEventListener("input",()=>{var F;return(F=We._refresh)==null?void 0:F.call(We)}),Ie.addEventListener("change",()=>{var F;return(F=We._refresh)==null?void 0:F.call(We)}),We._input=Ie,We._search=Xe,We._open=Ce,We._close=K,We._searchNow=()=>p(u(),{immediate:!0,open:!0}),We._getResults=W,We._setValue=F=>P(F,{}),We._dispose=()=>{n||(n=!0,e.dispose(),be++,q.clear(),document.removeEventListener("click",w,!0),le&&clearTimeout(le),fe&&fe.abort(),je())},($e=JSswift._registerCleanup)==null||$e.call(JSswift,We,We._dispose),tt(Ie,t,{isEnabled:()=>!Ie.disabled,action:()=>Pe(Ie,{selectText:!!t.selectOnShortcode})}),(t.autoSearch||t.searchOnMount)&&A(u(),{immediate:!0,open:!1}),We},Ae.Select=(t={})=>{var $e,F;const e=On();let n=!1;const s={...t,label:($e=t.label)!=null?$e:t.placeholder},i=t.filterable,c=!!t.multiple||!!t.multi,S=!!t.allowCustom||!!t.allowCustomValue,u=t.slots||{},a=f=>!!f&&(typeof f=="object"&&typeof f._bind=="function"||Ct(f)),b=a(t.model)?t.model:a(t.value)?t.value:null,M=f=>Array.isArray(f)?f.slice():f==null||f===""?[]:[f],N=f=>c?M(f):f,C=b?JSswift.reactive.untracked(()=>typeof b=="object"&&typeof b._bind=="function"?b.value:b[0]()):t.value,[z,U]=JSswift.reactive.signal(!1),[W,ge]=JSswift.reactive.signal(""),[B,ne]=JSswift.reactive.signal(c?M(C):C!=null?C:""),[he,q]=JSswift.reactive.signal(!1),[se,le]=JSswift.reactive.signal([]),[fe,be]=JSswift.reactive.signal([]),[re,ue]=JSswift.reactive.signal(-1);let O=null;if(b){if(typeof b=="object"&&typeof b._bind=="function")JSswift.reactive.untracked(()=>ne(N(b.value))),e.action(b,f=>ne(N(f))),O=f=>{const r=N(f);b.value!==r&&(b.value=r)};else if(Array.isArray(b)&&typeof b[0]=="function"&&typeof b[1]=="function"){const f=b[0],r=b[1];JSswift.reactive.untracked(()=>{e.effect(()=>{ne(N(f()))},"UI.Select:model")}),O=x=>r(N(x))}}function Y(){var f;return typeof t.disabled=="function"?t.disabled():typeof t.disabled=="boolean"?t.disabled:(f=t==null?void 0:t.disabled)!=null&&f.action?t.disabled.value:!1}function oe(f){var r,x,de,Be;if(f==null)return null;if(typeof f=="string"||typeof f=="number")return{type:"option",label:String(f),value:f,disabled:!1};if(typeof f=="object"){if(Array.isArray(f.options))return{type:"group",label:String((r=f.label)!=null?r:""),options:f.options};const He=(x=f.label)!=null?x:f.value!=null?String(f.value):"";return{type:"option",label:String(He),value:(Be=(de=f.value)!=null?de:f.label)!=null?Be:"",disabled:!!f.disabled}}return{type:"option",label:String(f),value:f,disabled:!1}}function we(f){const x=(Array.isArray(f)?f:[]).map(oe).filter(Boolean),de=[],Be=[];for(const He of x)if(He.type==="group"){de.push({type:"group",label:He.label});const Se=(He.options||[]).map(oe).filter(Boolean).filter(Oe=>Oe.type==="option");for(const Oe of Se)de.push(Oe),Be.push(Oe)}else de.push(He),Be.push(He);le(de),be(Be)}async function R(){if(n)return;const f=t.options;let r;try{const x=typeof f=="function"?JSswift.ui.withoutRodPathCapture(()=>f()):f;x&&typeof x.then=="function"?(q(!0),r=await x):r=x,n||we(r)}catch(x){if(n)return;console.error("[UI.Select] options load error:",x),we([])}finally{n||q(!1)}}function h(f){var x;const r=N(f);ne(r),O&&O(r),(x=t.onChange)==null||x.call(t,r)}function m(f){const r=M(B()),de=r.some(Be=>Be==f)?r.filter(Be=>Be!=f):[...r,f];h(de)}function y(f,r=!1){c?(m(f),r&&j()):(h(f),X())}function j(){ge(""),p&&(p.value="")}function X(){U(!1),j(),ue(-1)}async function d(){if(n||Y()||(U(!0),await R(),n))return;const f=B(),r=fe();let x=-1;if(c){const de=M(f);for(const Be of de)if(x=r.findIndex(He=>He.value==Be&&!He.disabled),x>=0)break}else x=r.findIndex(de=>de.value==f&&!de.disabled);x<0&&(x=r.findIndex(de=>!de.disabled)),ue(x),p&&setTimeout(()=>p.focus(),0)}function k(){z()?X():d()}const g=_.div({class:Z(["cms-select",c?"multiple":"",t.class]),tabIndex:Y()?-1:0,role:"combobox","aria-expanded":"false","aria-disabled":Y()?"true":"false"}),P=_.div({class:Z(["cms-select-value",c?"cms-select-value-multi":""])});e.effect(()=>{const f=fe();if(P.innerHTML="",c){const r=M(B());for(const x of r){const de=f.find(Oe=>Oe.value==x),Be=de?de.label:x==null?"":String(x);let He=!1;const Se=Ae.Chip({label:Be,dense:!0,color:t.chipColor||t.color,icon:t.chipIcon||null,iconRight:t.chipIconRight||null,glossy:t.glossy,glow:t.glow,glass:t.chipGlass||t.glass,class:t.chipClass,flat:t.flat,rounded:t.rounded,outline:t.outline,shadow:t.chipShadow,lightShadow:t.lightShadow,gloss:t.gloss,border:t.border,size:t.chipSize,removable:!0,onRemove:Oe=>{var at,nt,Ze;(at=Oe==null?void 0:Oe.preventDefault)==null||at.call(Oe),(nt=Oe==null?void 0:Oe.stopPropagation)==null||nt.call(Oe),(Ze=Oe==null?void 0:Oe.stopImmediatePropagation)==null||Ze.call(Oe),!He&&(He=!0,m(x))}});P.appendChild(Se)}}else{const r=B(),x=f.find(de=>de.value==r);P.textContent=x?x.label:r==null||r===""?"":String(r)}},"UI.Select:value");const K=_.div({class:"cms-select-arrow"});e.effect(()=>{const f=JSswift.ui.renderSlot(u,"arrow",{open:z()},Ae.Icon("#chevron-down"));K.innerHTML="",T(null,"default",{},f).forEach(r=>K.appendChild(r))},"UI.Select:arrow");const ee=_.div({class:"cms-select-control",onClick:k},P,K),Ce=_.div({class:"cms-select-options",role:"listbox","aria-multiselectable":c?"true":"false"}),E=_.div({class:"cms-select-filter cms-d-none"});let p=null;const A=_.input({class:"cms-input",type:"text",placeholder:t.filterPlaceholder||"Cerca...",onInput:f=>ge(f.target.value||"")}),L=()=>{const f=JSswift.ui.renderSlot(u,"filter",{value:W(),setValue:x=>{const de=x==null?"":String(x);ge(de),p&&"value"in p&&(p.value=de)},close:X},A);E.innerHTML="";const r=T(null,"default",{},f);r.forEach(x=>E.appendChild(x)),p=r.length===1&&r[0]&&r[0].tagName==="INPUT"?r[0]:null,p&&(p.value=W()||"")};JSswift.reactive.untracked(L),e.effect(()=>{const f=W()||"";p&&"value"in p&&p.value!==f&&(p.value=f)},"UI.Select:filterValue"),typeof i=="boolean"?i?E.classList.remove("cms-d-none"):E.classList.add("cms-d-none"):i!=null&&i.action&&(e.action(i,f=>{f?E.classList.remove("cms-d-none"):E.classList.add("cms-d-none")}),i.value?E.classList.remove("cms-d-none"):E.classList.add("cms-d-none"));const ae={...t};vn(ae);const ke=xt([ae.color,ae.state],()=>{const f=o(ae.color)||o(ae.state)||"";return["primary","secondary","warning","danger","success","info","light","dark"].includes(f)?f:o(ae.state)||""}),Te=_.div({class:Z(["cms-select-menu","cms-singularity-menu-select",ke,ae.class,ye(t.fill,"cms-select-menu-fill")]),"data-cms-overlay-portal":"true",onClick:f=>f.stopPropagation()},E,Ce);let ze=0,V=!1;const H=()=>{!z()||Te.parentNode!==document.body||ze||(ze=requestAnimationFrame(()=>{if(ze=0,!z()||!g.isConnected||Te.parentNode!==document.body)return;const f=g.getBoundingClientRect(),r=6,x=8,de=Math.max(160,window.innerWidth-x*2),Be=Math.min(Math.max(f.width,180),de),He=Math.max(x,Math.min(f.left,window.innerWidth-Be-x));Te.style.width=`${Be}px`,Te.style.left=`${He}px`,Te.style.right="auto",Te.style.marginTop="0";const Se=Te.getBoundingClientRect().height||0,Oe=window.innerHeight-f.bottom-r-x,at=f.top-r-x;let Ze=Oe<180&&at>Oe?f.top-r-Se:f.bottom+r;Ze=Math.max(x,Math.min(Ze,window.innerHeight-Se-x)),Te.style.top=`${Ze}px`}))},te=()=>{V||(V=!0,window.addEventListener("resize",H),window.addEventListener("scroll",H,!0))},De=()=>{V&&(V=!1,window.removeEventListener("resize",H),window.removeEventListener("scroll",H,!0))},je=()=>{Te.parentNode!==document.body&&(ze&&(cancelAnimationFrame(ze),ze=0),Te.classList.add("portal"),Te.style.display="block",document.body.appendChild(Te),te(),H())},_e=()=>{ze&&(cancelAnimationFrame(ze),ze=0),De(),Te.parentNode!==g&&g.appendChild(Te),Te.classList.remove("portal"),Te.style.display="",Te.style.position="",Te.style.top="",Te.style.left="",Te.style.right="",Te.style.width="",Te.style.marginTop=""};g.appendChild(ee),g.appendChild(Te),e.effect(()=>{const f=z();g.classList.toggle("open",f),g.setAttribute("aria-expanded",f?"true":"false"),f?je():_e()},"UI.Select:open"),e.effect(()=>{const f=Y();g.classList.toggle("disabled",f),g.tabIndex=f?-1:0,g.setAttribute("aria-disabled",f?"true":"false")},"UI.Select:disabled");let Me=[],Ie=-1,Ye=-1;function rt(){var r;const f=re();Ye=f,f!==Ie&&(Me[Ie]&&Me[Ie].classList.remove("active"),Me[f]&&Me[f].classList.add("active"),Ie=f,f>=0&&((r=Me[f])==null||r.scrollIntoView({block:"nearest"})))}e.effect(()=>{const f=se(),r=fe(),x=(W()||"").toLowerCase().trim(),de=B(),Be=c?M(de):[de],He=he(),Se=Ye;Ce.innerHTML="",Me=[],Ie=-1;const Oe=[];let at=0;const nt=Ze=>{const wt=Be.some(ft=>ft==Ze.value),Nt=!!Ze.disabled,Et=["cms-select-option",wt?"selected":"",Nt?"disabled":""].filter(Boolean).join(" "),Rt=()=>{c?m(Ze.value):(h(Ze.value),X())},Mt=JSswift.ui.renderSlot(u,"option",{opt:Ze,selected:wt,active:at===Se,disabled:Nt,select:Rt},Ze.label),vt=T(null,"default",{},Mt),Dt=_.div({class:Et,"data-flat-index":String(at),onClick:Nt?null:Rt},...vt);Oe.push(Dt),Me[at]=Dt,at++};if(x){const Ze=r.filter(wt=>wt.label.toLowerCase().includes(x));if(Ze.length===0){const wt=JSswift.ui.renderSlot(u,"empty",{filter:x},t.emptyText||"Nessuna opzione");Ce.appendChild(_.div({class:"cms-select-empty"},...T(null,"default",{},wt))),z()&&H();return}for(const wt of Ze)nt(wt)}else{let Ze=!1;for(const wt of f)if(wt.type==="group"){const Nt=JSswift.ui.renderSlot(u,"group",{label:wt.label},wt.label);Oe.push(_.div({class:"cms-select-group"},...T(null,"default",{},Nt)))}else Ze=!0,nt(wt);if(!Ze){const wt=JSswift.ui.renderSlot(u,"empty",{filter:x},t.emptyText||"Nessuna opzione");Ce.appendChild(_.div({class:"cms-select-empty"},...T(null,"default",{},wt))),z()&&H();return}}if(He){const Ze=JSswift.ui.renderSlot(u,"loading",{},"Caricamento...");Ce.appendChild(_.div({class:"cms-select-empty"},...T(null,"default",{},Ze))),z()&&H();return}for(const Ze of Oe)Ce.appendChild(Ze);rt(),z()&&H()},"UI.Select:render"),e.effect(()=>{rt()},"UI.Select:paintActive");const Xe=f=>{if(!g.isConnected)return;const r=f.target;g.contains(r)||Te.contains(r)||X()};document.addEventListener("click",Xe,!0);const We=f=>{if(Y())return;const r=z(),x=fe(),de=re(),Be=p&&f.target===p,He=(Oe,at)=>{let nt=Oe;for(;nt>=0&&nt<x.length;){if(!x[nt].disabled)return nt;nt+=at}return-1},Se=Oe=>{if(!Oe)return null;const at=Oe.toLowerCase();let nt=x.find(Ze=>String(Ze.label).toLowerCase()===at||String(Ze.value).toLowerCase()===at);return nt||(nt=x.find(Ze=>String(Ze.label).toLowerCase().includes(at))),nt&&!nt.disabled?nt:null};if(f.key==="Escape"){r&&(f.preventDefault(),X());return}if(Be&&(f.key==="Enter"||f.key===" ")){const Oe=(W()||"").trim();if(Oe){const at=Se(Oe);if(at){f.preventDefault(),y(at.value,!0);return}if(S&&f.key==="Enter"){f.preventDefault(),y(Oe,!0);return}if(f.key==="Enter"){f.preventDefault();return}}if(f.key===" ")return}if(f.key==="Enter"||f.key===" "){if(f.preventDefault(),!r){d();return}de>=0&&x[de]&&!x[de].disabled&&(c?m(x[de].value):(h(x[de].value),X()));return}if(f.key==="ArrowDown"){if(f.preventDefault(),!r){d();return}const Oe=He(de<0?0:de+1,1);Oe>=0&&ue(Oe);return}if(f.key==="ArrowUp"){if(f.preventDefault(),!r){d();return}const Oe=He(de<0?x.length-1:de-1,-1);Oe>=0&&ue(Oe);return}if(f.key==="Home"){if(!r)return;f.preventDefault();const Oe=He(0,1);Oe>=0&&ue(Oe);return}if(f.key==="End"){if(!r)return;f.preventDefault();const Oe=He(x.length-1,-1);Oe>=0&&ue(Oe);return}};g.addEventListener("keydown",We),E.addEventListener("keydown",We),g._dispose=()=>{n||(n=!0,e.dispose(),document.removeEventListener("click",Xe,!0),g.removeEventListener("keydown",We),E.removeEventListener("keydown",We),_e())};const w=()=>{const f=B();return c?Array.isArray(f)&&f.length>0:f==null?!1:f!==""?!0:fe().some(r=>r.value==="")},ie=Ae.FormField({...s,control:g,clearable:t.clearable,disabled:Y(),readonly:!1,hasValue:w,getValue:()=>{const f=B();return c?Array.isArray(f)&&f.length?f:"":f},onClear:()=>{Y()||(h(c?[]:null),X())},onFocus:()=>{d()}});return e.effect(()=>{var f;(f=ie._refresh)==null||f.call(ie)},"UI.Select:fieldRefresh"),on(ie,g,t),ie._select=g,ie._dispose=g._dispose,(F=JSswift._registerCleanup)==null||F.call(JSswift,ie,ie._dispose),tt(ie,t,{isEnabled:()=>!Y(),action:()=>{if(Y())return!1;Pe(g),d()}}),R(),ie},Ae.Upload=(t={})=>{var We;vn(t);const e=t.slots||{},[n,s]=JSswift.reactive.signal([]),[i,c]=JSswift.reactive.signal(!1),[S,u]=JSswift.reactive.signal(!1),[a,b]=JSswift.reactive.signal(null);let M=0,N=!1;const C=()=>!!o(t.disabled)||!!o(t.readonly),z=()=>t.multiple!==!1&&t.single!==!0,U=()=>{var w,ie;return["form","native","submit","external"].includes(String(o((ie=(w=t.submitMode)!=null?w:t.modeSubmit)!=null?ie:t.uploadMode)||"").toLowerCase())},W=()=>{var w;return o((w=t.showBrowse)!=null?w:t.browseButton)!==!1},ge=()=>{var w;return!U()&&o((w=t.showUpload)!=null?w:t.uploadButton)!==!1},B=()=>{var w;return o((w=t.showClear)!=null?w:t.clearButton)!==!1},ne=()=>{var w;return o((w=t.showFiles)!=null?w:t.files)!==!1},he=()=>{const w=Bt(o(t.state)||o(t.status));return w?`cms-state-${w}`:""},q=()=>t.fieldName||t.paramName||t.name||"file",se=()=>{var w;return Math.max(1,Number(o((w=t.parallelUploads)!=null?w:t.parallel)||1))},le=()=>{var ie,$e,F,f;const w=o(t.retry);return w===!0?{attempts:2,delay:350,factor:2}:w?{attempts:Math.max(0,Number(($e=(ie=w.attempts)!=null?ie:w.retries)!=null?$e:0)),delay:Math.max(0,Number((F=w.delay)!=null?F:350)),factor:Math.max(1,Number((f=w.factor)!=null?f:2))}:{attempts:0,delay:350,factor:2}},fe=w=>w?Array.isArray(w)?w:Array.from(w):[],be=w=>{const ie=Number(w||0);return ie<1024?`${ie} B`:ie<1024*1024?`${(ie/1024).toFixed(1)} KB`:ie<1024*1024*1024?`${(ie/1024/1024).toFixed(1)} MB`:`${(ie/1024/1024/1024).toFixed(1)} GB`},re=()=>{var w;return String(o((w=t.acceptedFiles)!=null?w:t.accept)||"").trim()},ue=w=>{const ie=re();if(!ie)return!0;const $e=String(w.name||"").toLowerCase(),F=String(w.type||"").toLowerCase();return ie.split(",").map(f=>f.trim().toLowerCase()).filter(Boolean).some(f=>f.startsWith(".")?$e.endsWith(f):f.endsWith("/*")?F.startsWith(f.slice(0,-1)):F===f)},O=()=>n().filter(w=>w.status!=="rejected"&&w.status!=="removed"),Y=(w=0)=>O().reduce((ie,$e)=>ie+Number($e.size||0),w),oe=()=>{var w;s(n().slice()),H.classList.toggle("is-busy",n().some(ie=>ie.status==="uploading")),H.classList.toggle("has-files",n().some(ie=>ie.status!=="removed")),(w=t.onChange)==null||w.call(t,n().slice(),te)},we=(w,ie,$e=null)=>{var f;const F={id:`upload_${Date.now()}_${++M}`,file:w,name:(w==null?void 0:w.name)||"file",size:Number((w==null?void 0:w.size)||0),type:(w==null?void 0:w.type)||"",status:"rejected",progress:0,error:ie,detail:$e,attempts:0,response:null,xhr:null};return n().push(F),(f=t.onRejected)==null||f.call(t,F,{reason:ie,detail:$e,api:te}),F},R=async(w,ie)=>{const $e=t.maxFiles==null?null:Number(o(t.maxFiles)),F=t.maxFileSize==null?null:Number(o(t.maxFileSize)),f=t.minFileSize==null?null:Number(o(t.minFileSize)),r=t.maxTotalSize==null?null:Number(o(t.maxTotalSize));if($e!=null&&ie>$e)return"max-files";if(F!=null&&Number(w.size||0)>F)return"max-file-size";if(f!=null&&Number(w.size||0)<f)return"min-file-size";if(r!=null&&Y(Number(w.size||0))>r)return"max-total-size";if(!ue(w))return"accept";const x=t.filter||t.acceptFile||t.validate;if(typeof x=="function"){const de=await x(w,{files:n().slice(),api:te});if(de===!1)return"filter";if(typeof de=="string")return de}return null},h=async()=>{for(const w of n()){if(w.status!=="rejected"||w.error!=="max-files")continue;const ie=await R(w.file,O().length+1);if(ie){w.error=ie;continue}w.status="queued",w.progress=0,w.error=null,w.detail=null}},m=w=>({id:`upload_${Date.now()}_${++M}`,file:w,name:(w==null?void 0:w.name)||"file",size:Number((w==null?void 0:w.size)||0),type:(w==null?void 0:w.type)||"",status:"queued",progress:0,bytesUploaded:0,error:null,detail:null,attempts:0,response:null,xhr:null}),y=async(w,ie={})=>{var f;if(C())return[];b(null);const $e=fe(w),F=[];!z()&&$e.length&&j({silent:!0});for(const r of $e){const x=await R(r,O().length+1);if(x){we(r,x);continue}const de=m(r);if(n().push(de),F.push(de),(f=t.onAdded)==null||f.call(t,de,{file:r,meta:ie,api:te}),!z())break}return oe(),F.length&&t.autoUpload&&!U()&&p(),F},j=(w={})=>{var ie;for(const $e of n())$e.status==="uploading"&&d($e),$e.status="removed";s([]),b(null),oe(),w.silent||(ie=t.onClear)==null||ie.call(t,te)},X=async w=>{var F;const ie=typeof w=="string"?n().find(f=>f.id===w):w;if(!ie)return;ie.status==="uploading"&&d(ie);const $e=n().filter(f=>f!==ie);s($e),await h(),oe(),(F=t.onRemove)==null||F.call(t,ie,{api:te})},d=w=>{var $e,F,f;const ie=typeof w=="string"?n().find(r=>r.id===w):w;!ie||ie.status!=="uploading"||(ie.status="canceled",ie.error="canceled",(F=($e=ie.xhr)==null?void 0:$e.abort)==null||F.call($e),(f=t.onCancel)==null||f.call(t,ie,{api:te}),oe())},k=()=>n().filter(w=>w.status==="uploading").forEach(d),g=async w=>{var $e,F;const ie={url:o(t.url),method:o(t.method||"POST"),headers:t.headers,formFields:t.formFields||t.fields,fieldName:q(),withCredentials:!!o(($e=t.withCredentials)!=null?$e:t.credentials),sendRaw:!!o(t.sendRaw)};if(typeof t.factory=="function")try{const f=await t.factory(w.file,{item:w,files:n().slice(),api:te});if(f&&typeof f=="object")Object.assign(ie,f);else if(f!=null)throw new Error("factory must return an object")}catch(f){throw(F=t.onFactoryFailed)==null||F.call(t,f,{item:w,api:te}),f}return ie},P=(w,ie,$e)=>{const F=typeof ie=="function"?ie($e.file,{item:$e,api:te}):ie;F&&(F instanceof Headers?F.forEach((f,r)=>w.setRequestHeader(r,f)):Array.isArray(F)?F.forEach(f=>{Array.isArray(f)?w.setRequestHeader(f[0],f[1]):f!=null&&f.name&&w.setRequestHeader(f.name,f.value)}):typeof F=="object"&&Object.keys(F).forEach(f=>w.setRequestHeader(f,F[f])))},K=(w,ie,$e)=>{const F=typeof ie=="function"?ie($e.file,{item:$e,api:te}):ie;F&&(Array.isArray(F)?F.forEach(f=>{Array.isArray(f)?w.append(f[0],f[1]):f!=null&&f.name&&w.append(f.name,f.value)}):typeof F=="object"&&Object.keys(F).forEach(f=>w.append(f,F[f])))},ee=(w,ie)=>new Promise(($e,F)=>{if(!ie.url){F(new Error("UI.Upload: url is required"));return}if(typeof XMLHttpRequest!="function"){F(new Error("UI.Upload: XMLHttpRequest is not available"));return}const f=new XMLHttpRequest;w.xhr=f,f.open(String(ie.method||"POST").toUpperCase(),ie.url,!0),f.withCredentials=!!ie.withCredentials,P(f,ie.headers,w),f.upload.onprogress=x=>{var de;x.lengthComputable&&(w.bytesUploaded=x.loaded,w.progress=Math.max(0,Math.min(100,Math.round(x.loaded/x.total*100))),(de=t.onProgress)==null||de.call(t,w,{event:x,api:te}),oe())},f.onload=()=>{const x=f.status>=200&&f.status<300,de={status:f.status,text:f.responseText,xhr:f};x?$e(de):F(Object.assign(new Error(`HTTP error ${f.status}`),{response:de}))},f.onerror=()=>F(new Error("network-error")),f.onabort=()=>F(new Error("canceled"));const r=ie.sendRaw?w.file:(()=>{const x=new FormData;return K(x,ie.formFields,w),x.append(ie.fieldName||"file",w.file,w.name),x})();f.send(r)}),Ce=async w=>{var F,f,r,x,de,Be;const ie=le();let $e=ie.delay;w.status="uploading",w.error=null,w.progress=Math.max(0,w.progress||0),(F=t.onStart)==null||F.call(t,w,{api:te}),oe();for(let He=0;He<=ie.attempts;He++){w.attempts=He+1;try{const Se=await g(w),Oe=typeof t.upload=="function"||typeof t.uploader=="function"?await(t.upload||t.uploader)(w.file,{item:w,options:Se,progress:at=>{var nt;w.progress=Math.max(0,Math.min(100,Number(at)||0)),(nt=t.onProgress)==null||nt.call(t,w,{api:te}),oe()},api:te}):await ee(w,Se);return w.status="done",w.progress=100,w.response=Oe,w.xhr=null,(f=t.onSuccess)==null||f.call(t,w,{response:Oe,api:te}),(r=t.onComplete)==null||r.call(t,w,{response:Oe,api:te}),oe(),w}catch(Se){if(String((Se==null?void 0:Se.message)||Se)==="canceled"||w.status==="canceled")return w.status="canceled",w.error="canceled",w.xhr=null,(x=t.onComplete)==null||x.call(t,w,{error:Se,api:te}),oe(),w;if(He<ie.attempts){await new Promise(Oe=>setTimeout(Oe,$e)),$e=Math.round($e*ie.factor);continue}return w.status="error",w.error=Se,w.xhr=null,b(Se),(de=t.onError)==null||de.call(t,w,{error:Se,api:te}),(Be=t.onComplete)==null||Be.call(t,w,{error:Se,api:te}),oe(),w}}return w},E=()=>{var F;if(N||C())return;const w=n().filter(f=>f.status==="uploading").length,ie=Math.max(0,se()-w),$e=n().filter(f=>f.status==="queued").slice(0,ie);if(!$e.length){const f=n().some(r=>r.status==="uploading");u(f),f||(F=t.onFinish)==null||F.call(t,n().slice(),{api:te});return}u(!0),$e.forEach(f=>{Ce(f).finally(()=>E())})},p=(w=null)=>{(w?fe(w):n().filter($e=>["queued","error","canceled"].includes($e.status))).forEach($e=>{const F=typeof $e=="string"?n().find(f=>f.id===$e):$e;F&&F.status!=="uploading"&&F.status!=="done"&&F.status!=="rejected"&&(F.status="queued",F.progress=0,F.error=null)}),oe(),E()},A=w=>p([w]),L=()=>{C()||ae.click()},ae=_.input({type:"file",class:"cms-upload-input",name:q(),accept:re()||null,multiple:z(),capture:t.capture||null,disabled:C(),onChange:w=>{y(w.target.files,{event:w,source:"browse"}),w.target.value=""}}),ke=_.div({class:"cms-upload-list"}),Te=_.div({class:"cms-upload-summary"}),ze=_.div({class:"cms-upload-actions"});let V=he();const H=_.div({class:Z(["cms-upload","cms-singularity",V,ye(t.box||t.variant==="box","cms-upload-box"),ye(t.compact,"is-compact"),ye(U(),"is-form-mode"),ye(!ne(),"is-files-hidden"),t.class]),tabindex:C()?"-1":"0",role:"group","aria-disabled":C()?"true":"false"}),te={addFiles:y,browse:L,upload:p,retry:A,retryAll:()=>p(n().filter(w=>w.status==="error"||w.status==="canceled")),remove:X,clear:j,abort:d,abortAll:k,files:()=>n().slice(),state:()=>({files:n().slice(),busy:S(),dragging:i(),error:a()}),reset:j},De=()=>{const w={api:te,files:n().slice(),busy:S(),disabled:C(),submitMode:U()?"form":"upload"},ie=[];return W()&&ie.push(JSswift.ui.renderSlot(e,"browse",w,Ae.Btn({size:"sm",icon:"folder_open",label:t.browseText||"Browse",onClick:L}))),ge()&&ie.push(JSswift.ui.renderSlot(e,"upload",w,Ae.Btn({size:"sm",color:"primary",icon:"upload",label:t.uploadText||"Upload",loading:S(),disabled:C()||!n().some($e=>["queued","error","canceled"].includes($e.status)),onClick:()=>p()}))),B()&&ie.push(JSswift.ui.renderSlot(e,"clear",w,Ae.Btn({size:"sm",color:"secondary",outline:!0,icon:"delete",label:t.clearText||"Clear",disabled:C()||!n().length,onClick:()=>j()}))),T(e,"actions",w,ie)},je=(w,ie)=>{var r;const $e={item:w,file:w.file,index:ie,api:te,remove:()=>X(w),retry:()=>A(w),abort:()=>d(w)},F=_.div({class:Z(["cms-upload-file",`is-${w.status}`])},_.div({class:"cms-upload-file-icon"},Ae.Icon({name:w.status==="done"?"check_circle":w.status==="error"||w.status==="rejected"?"error":"description"})),_.div({class:"cms-upload-file-main"},_.div({class:"cms-upload-file-name"},...T(e,"fileName",$e,w.name)),_.div({class:"cms-upload-file-meta"},...T(e,"fileMeta",$e,w.error?String(((r=w.error)==null?void 0:r.message)||w.error):w.status==="queued"?"Queued":w.status)),_.div({class:"cms-upload-progress",role:"progressbar","aria-valuemin":"0","aria-valuemax":"100","aria-valuenow":String(w.progress||0)},_.div({class:"cms-upload-progress-bar",style:{width:`${w.progress||0}%`}}))),_.div({class:"cms-upload-file-trailing"},_.div({class:"cms-upload-file-size"},be(w.size)),_.div({class:"cms-upload-file-actions"},...T(e,"fileActions",$e,[w.status==="uploading"?Ae.Btn({size:"sm",outline:!0,icon:"close","aria-label":"Cancel",onClick:()=>d(w)}):null,w.status==="error"||w.status==="canceled"?Ae.Btn({size:"sm",outline:!0,icon:"refresh","aria-label":"Retry",onClick:()=>A(w)}):null,Ae.Btn({size:"sm",dense:!0,outline:!0,icon:"delete","aria-label":"Remove",onClick:()=>X(w)})])))),f=JSswift.ui.renderSlot(e,"file",$e,F);return _.div({class:"cms-upload-file-wrap","data-status":w.status,"data-id":w.id},...T(null,"default",{},f))},_e=()=>{const w=n();if(ze.replaceChildren(...De()),ke.replaceChildren(),Te.hidden=!ne(),ke.hidden=!ne(),w.length)w.forEach(($e,F)=>ke.appendChild(je($e,F)));else{const $e=JSswift.ui.renderSlot(e,"empty",{api:te},t.emptyText||"No files selected");ke.appendChild(_.div({class:"cms-upload-empty"},...T(null,"default",{},$e)))}const ie=w.filter($e=>$e.status!=="rejected"&&$e.status!=="removed");Te.textContent=`${ie.length} file \u2022 ${be(ie.reduce(($e,F)=>$e+Number(F.size||0),0))}`},Me=JSswift.ui.renderSlot(e,"icon",{api:te},Ae.Icon({name:t.icon||"cloud_upload"})),Ie=JSswift.ui.renderSlot(e,"title",{api:te},t.title||"Upload files"),Ye=JSswift.ui.renderSlot(e,"subtitle",{api:te},t.subtitle||(re()?`Accepted: ${re()}`:"Drag files here or browse from your device")),rt=_.div({class:"cms-upload-dropzone",onClick:w=>{var ie,$e;($e=(ie=w.target)==null?void 0:ie.closest)!=null&&$e.call(ie,".cms-upload-actions, .cms-upload-list")||t.clickable!==!1&&L()},onDragenter:w=>{t.drag===!1||C()||(w.preventDefault(),c(!0),H.classList.add("is-dragging"))},onDragover:w=>{t.drag===!1||C()||w.preventDefault()},onDragleave:w=>{w.currentTarget===w.target&&(c(!1),H.classList.remove("is-dragging"))},onDrop:w=>{var ie,$e;t.drag===!1||C()||(w.preventDefault(),c(!1),H.classList.remove("is-dragging"),(ie=t.onDrop)==null||ie.call(t,w,{api:te}),y((($e=w.dataTransfer)==null?void 0:$e.files)||[],{event:w,source:"drop"}))}},_.div({class:"cms-upload-head"},_.div({class:"cms-upload-icon"},...T(null,"default",{},Me)),_.div({class:"cms-upload-copy"},_.div({class:"cms-upload-title"},...T(null,"default",{},Ie)),_.div({class:"cms-upload-subtitle"},...T(null,"default",{},Ye))),ze),Te,ke),Xe=JSswift.ui.renderSlot(e,"header",{api:te},null);return T(null,"default",{},Xe).forEach(w=>H.appendChild(w)),H.appendChild(ae),T(e,"default",{api:te,dropzone:rt},rt).forEach(w=>H.appendChild(w)),JSswift.reactive.effect(()=>{_e()},"UI.Upload:render"),JSswift.reactive.effect(()=>{H.classList.toggle("is-disabled",C()),H.classList.toggle("is-form-mode",U()),H.classList.toggle("is-files-hidden",!ne());const w=he();w!==V&&(V&&H.classList.remove(V),w&&H.classList.add(w),V=w),H.setAttribute("aria-disabled",C()?"true":"false"),ae.disabled=C(),ae.multiple=z(),ae.name=q()},"UI.Upload:disabled"),H._upload=te,H._addFiles=y,H._browse=L,H._uploadFiles=p,H._input=ae,H._dispose=()=>{N||(N=!0,k())},(We=JSswift._registerCleanup)==null||We.call(JSswift,H,H._dispose),H},Ae.BoxUpload=(t={})=>Ae.Upload({...t,box:!0}),Ae.boxUpload=(t={})=>Ae.BoxUpload(t),JSswift.ui.Upload=Ae.Upload,JSswift.ui.BoxUpload=Ae.BoxUpload,JSswift.ui.boxUpload=Ae.boxUpload;function an(t,e){if(!t)return null;if(typeof t=="object"&&typeof t._bind=="function")return{get:()=>t.value,set:n=>{t.value!==n&&(t.value=n)},watch:n=>{var s;return(s=t.action)==null||s.call(t,n),()=>{var c,S;const i=(S=(c=t._actions)==null?void 0:c.indexOf(n))!=null?S:-1;i>=0&&t._actions.splice(i,1)}}};if(Array.isArray(t)&&typeof t[0]=="function"&&typeof t[1]=="function"){const n=t[0],s=t[1];return{get:n,set:s,watch:i=>bt.reactive.effect(()=>{i(n())},e||"UI:model")}}return null}const gn={classic:{side:"left",nav:"top",rows:["header","nav","body","footer"]},classicright:{side:"right",nav:"top",rows:["header","nav","body","footer"]},sidebarfullleft:{side:"left",fullSide:!0,nav:"top",rows:["header","nav","body","footer"]},sidebarfullright:{side:"right",fullSide:!0,nav:"top",rows:["header","nav","body","footer"]},appshell:{side:"left",nav:"top",rows:["header","nav","body","footer"]},dashboard:{side:"left",nav:"top",rows:["header","nav","body","footer"]},website:{side:null,nav:"top",rows:["header","nav","body","footer"]},documentation:{side:"right",nav:"left",rows:["header","body","footer"]},landing:{side:null,nav:null,rows:["header","body","footer"]}},yn=t=>{const e=o(t);return e==null||e===!1||e===""?"":String(e).trim().toLowerCase().replace(/[\s_-]+/g,"")},zn=(t,e)=>{if(!t||!e.main)return null;const n=t.side||(e.aside?"left":null),s=t.nav||(e.nav?"top":null),i=!!e.aside&&!!n,c=!!e.nav&&!!s,a=[c&&s==="left"?"nav":i&&n==="left"?"aside":".","main",c&&s==="right"?"nav":i&&n==="right"?"aside":"."],b=[],M=[...t.rows||[]];if(c&&s==="top"&&!M.includes("nav")){const N=M.indexOf("body");M.splice(N>=0?N:M.length,0,"nav")}for(const N of M)N==="header"&&e.header?b.push(t.fullSide&&i&&n==="left"?["aside","header","header"]:t.fullSide&&i&&n==="right"?["header","header","aside"]:["header","header","header"]):N==="nav"&&c&&s==="top"?b.push(t.fullSide&&i&&n==="left"?["aside","nav","nav"]:t.fullSide&&i&&n==="right"?["nav","nav","aside"]:["nav","nav","nav"]):N==="body"?b.push(a):N==="footer"&&e.footer&&b.push(t.fullSide&&i&&n==="left"?["aside","footer","footer"]:t.fullSide&&i&&n==="right"?["footer","footer","aside"]:["footer","footer","footer"]);return b.length?b.map(N=>`"${N.join(" ")}"`).join(" "):null};Ae.Layout=(...t)=>{var os,is,ls;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=(qe,pt)=>!!qe&&Object.prototype.hasOwnProperty.call(qe,pt),c=()=>typeof window=="undefined"?1024:window.innerWidth,S=()=>{const qe=c(),pt=JSswift.uiResponsivePropsFor(e,St("mobile"))||{},Ft=qe>=768?JSswift.uiResponsivePropsFor(e,St("tablet"))||{}:{},Gt=qe>=1024?JSswift.uiResponsivePropsFor(e,St("pc"))||{}:{};return{...pt,...Ft,...Gt}},u=(...qe)=>{for(const pt of qe)if(i(e,pt))return e[pt]},a=(...qe)=>{const pt=S();for(const Ft of qe)if(i(pt,Ft))return pt[Ft];return u(...qe)},b=(...qe)=>{const pt=JSswift.uiResponsivePropsFor(e,St(te()))||{};for(const Ft of qe)if(i(pt,Ft))return pt[Ft];return u(...qe)},M=()=>yn(b("disposition","layoutDisposition","layout")),N=()=>{const qe=o(a("mode","layoutMode"));if(qe==null||qe===!1||qe==="")return"";const pt=String(qe).trim().toLowerCase();return pt==="global"||pt==="local"?pt:""},C=(qe,pt=null)=>qe==null||qe===!1||qe===""?pt:typeof qe=="number"?`${qe}px`:String(qe),z=(qe,pt=null)=>{if(qe==null||qe===!1||qe==="")return pt;if(typeof qe=="number"&&Number.isFinite(qe))return qe;const Ft=Number.parseFloat(String(qe));return Number.isFinite(Ft)?Ft:pt},U=qe=>{const pt=o(qe);return pt==null||pt===!1||pt===""?null:Array.isArray(pt)?pt.map(Ft=>`"${Array.isArray(Ft)?Ft.join(" "):String(Ft)}"`).join(" "):String(pt)},W=(qe,pt=null,Ft=null)=>{let Gt=Number.isFinite(qe)?qe:0;return Number.isFinite(pt)&&(Gt=Math.max(pt,Gt)),Number.isFinite(Ft)&&(Gt=Math.min(Ft,Gt)),Gt},ge=u("header","headerContent"),B=u("aside","drawer"),ne=u("nav","asideRight","drawerRight"),he=u("page","main","content","body"),q=u("footer","footerContent"),se=()=>o(a("drawerEnabled","asideEnabled")),le=()=>o(a("navEnabled","asideRightEnabled","rightAsideEnabled")),fe=()=>se()!==!1,be=()=>le()===!0||o(a("noNav"))===!1,re=()=>o(a("noDrawer"))===!0||se()===!1||B===!1,ue=()=>o(a("noNav"))===!0||le()===!1||ne===!1,O=()=>o(a("drawerFloating"))===!0,Y=()=>o(a("navFloating"))===!0,oe=()=>o(a("drawerResizable"))===!0,we=()=>o(a("navResizable"))===!0,R=()=>z(o(a("drawerMinWidth")),180),h=()=>z(o(a("drawerMaxWidth")),null),m=()=>z(o(a("navMinWidth")),180),y=()=>z(o(a("navMaxWidth")),null),j=z(o(a("drawerWidth")),280),X=z((os=o(a("navWidth")))!=null?os:o(a("asideRightWidth")),280),[d,k]=JSswift.reactive.signal(W(j,R(),h())),[g,P]=JSswift.reactive.signal(W(X,m(),y())),K=an(e.drawerOpen,"UI.Layout:drawerOpen"),ee=K?!!K.get():typeof e.drawerOpen=="boolean"?!!e.drawerOpen:!0,[Ce,E]=JSswift.reactive.signal(ee),p=qe=>{const pt=!!qe;Ce()!==pt&&E(pt),K==null||K.set(pt)},A=(is=K==null?void 0:K.watch)==null?void 0:is.call(K,()=>{const qe=!!K.get();Ce()!==qe&&E(qe)}),L=an(e.navOpen,"UI.Layout:navOpen"),ae=L?!!L.get():typeof e.navOpen=="boolean"?!!e.navOpen:!0,[ke,Te]=JSswift.reactive.signal(ae),ze=qe=>{const pt=!!qe;ke()!==pt&&Te(pt),L==null||L.set(pt)},V=(ls=L==null?void 0:L.watch)==null?void 0:ls.call(L,()=>{const qe=!!L.get();ke()!==qe&&Te(qe)}),H=()=>{var Gt,tn,sn;const qe=Number((Gt=o(a("layoutBreakpoint")))!=null?Gt:0),pt=Number((tn=o(a("drawerBreakpoint")))!=null?tn:qe||1024),Ft=Number((sn=o(a("navBreakpoint")))!=null?sn:qe||pt);return Math.max(pt,Ft,0)},te=()=>{const qe=c();return qe>=1024?"pc":qe>=768?"tablet":"mobile"},[De,je]=JSswift.reactive.signal(!1),[_e,Me]=JSswift.reactive.signal(te()),Ie=()=>{typeof window!="undefined"&&(Me(te()),je(window.innerWidth<H()))};typeof window!="undefined"&&(Ie(),window.addEventListener("resize",Ie));const Ye=()=>({props:e,openAside:()=>p(!0),closeAside:()=>p(!1),toggleAside:()=>p(!Ce()),openNav:()=>ze(!0),closeNav:()=>ze(!1),toggleNav:()=>ze(!ke()),isDrawerOpen:()=>!!Ce(),isNavOpen:()=>!!ke(),isMobile:()=>!!De(),isDrawerFloating:()=>O(),isNavFloating:()=>Y()}),rt=(qe,pt)=>{const Ft=Ye();for(const tn of qe){if(!i(s,tn))continue;const sn=typeof s[tn]=="function"?s[tn](Ft):s[tn];return T(null,"default",Ft,sn)}const Gt=typeof pt=="function"?pt(Ft):pt;return T(null,"default",Ft,Gt)},Xe=he!==void 0?he:n,We=Z(["cms-app","cms-layout",JSswift.uiResponsiveClasses({mobile:e},_t),JSswift.uiResponsiveClasses(e,_t),e.class]),w=JSswift.omit(e,["header","headerContent","aside","drawer","nav","asideRight","drawerRight","page","main","content","body","footer","footerContent","noDrawer","drawerEnabled","asideEnabled","noNav","navEnabled","asideRightEnabled","rightAsideEnabled","drawerOpen","navOpen","layoutBreakpoint","drawerBreakpoint","navBreakpoint","drawerWidth","navWidth","asideRightWidth","drawerResizable","drawerMinWidth","drawerMaxWidth","navResizable","navMinWidth","navMaxWidth","drawerPeek","navPeek","asideRightPeek","drawerFloating","navFloating","overlayClose","escClose","stickyHeader","stickyFooter","stickyAside","stickyNav","tagPage","mode","layoutMode","disposition","layoutDisposition","layout","shellClass","headerClass","asideClass","navClass","pageClass","footerClass","overlayClass","gap","headerOffset","minHeight","areas","gridTemplateAreas","templateAreas","slots"]);w.class=We,w.style={...e.style||{}},JSswift.uiApplyResponsiveProps(w,e,JSswift.uiResponsiveStyleRules);const ie=_.div(w);A&&JSswift._registerCleanup(ie,A),V&&JSswift._registerCleanup(ie,V);const F=o(a("tagPage"))===!0?{header:"header",aside:"aside",nav:"nav",page:"main",footer:"footer"}:{header:"div",aside:"div",nav:"div",page:"div",footer:"div"},f=_.div({class:Z(["cms-layout-shell-grid",e.shellClass])}),r=_[F.header]({class:Z(["cms-layout-section","cms-layout-header","header",ye(e.stickyHeader,"sticky"),e.headerClass])}),x=_[F.aside]({class:Z(["cms-layout-section","cms-layout-aside","aside",ye(e.stickyAside!==!1,"sticky"),e.asideClass]),role:"navigation","aria-hidden":"true"}),de=_.div({class:"cms-layout-panel-body cms-layout-aside-body"}),Be=_.div({class:"cms-layout-resize-handle cms-layout-resize-handle-drawer","aria-hidden":"true"});x.appendChild(de),x.appendChild(Be);const He=_[F.nav]({class:Z(["cms-layout-section","cms-layout-nav","nav",ye(e.stickyNav,"sticky"),e.navClass]),role:F.nav==="nav"?null:"complementary","aria-hidden":"true"}),Se=_.div({class:"cms-layout-panel-body cms-layout-nav-body"}),Oe=_.div({class:"cms-layout-resize-handle cms-layout-resize-handle-nav","aria-hidden":"true"});He.appendChild(Se),He.appendChild(Oe);const at=_[F.page]({class:Z(["cms-layout-section","cms-layout-main","main",e.pageClass]),role:F.page==="main"?null:"main"}),nt=_[F.footer]({class:Z(["cms-layout-section","cms-layout-footer","footer",ye(e.stickyFooter,"sticky"),e.footerClass])});f.appendChild(r),f.appendChild(x),f.appendChild(at),f.appendChild(He),f.appendChild(nt),ie.appendChild(f);const Ze=_.div({class:Z(["cms-aside-overlay",e.overlayClass]),onClick:()=>{o(a("overlayClose"))!==!1&&(Ce()&&p(!1),ke()&&ze(!1))}});ie.appendChild(Ze);let wt=!1,Nt=!1,Et=!1,Rt=!1,Mt=!1,vt=null,Dt=null;const ft=qe=>{!qe||typeof qe!="object"||(typeof qe._dispose=="function"&&qe._dispose(),!(!qe.childNodes||!qe.childNodes.length)&&Array.from(qe.childNodes).forEach(ft))},Ht=qe=>{qe&&Array.from(qe.childNodes).forEach(pt=>{ft(pt),pt.remove()})},qt=qe=>{const pt=Ye(),Ft=typeof qe=="function"?qe(pt):qe;return T(null,"default",pt,Ft)},Xt=()=>{const qe=wt?r.getBoundingClientRect().height:0;ie.style.setProperty("--layout-header-height",`${qe}px`)},Ot=(qe,pt)=>(Ht(qe),pt.forEach(Ft=>qe.appendChild(Ft)),pt.length>0),Qt=()=>{var Gt,tn,sn,v,ce,Je;ie.style.setProperty("--cms-layout-drawer-width",C((Gt=o(a("drawerWidth")))!=null?Gt:280,"280px")),ie.style.setProperty("--cms-layout-nav-width",C((sn=(tn=o(a("navWidth")))!=null?tn:o(a("asideRightWidth")))!=null?sn:280,"280px")),ie.style.setProperty("--cms-layout-drawer-peek",C((v=o(a("drawerPeek")))!=null?v:20,"20px")),ie.style.setProperty("--cms-layout-nav-peek",C((Je=(ce=o(a("navPeek")))!=null?ce:o(a("asideRightPeek")))!=null?Je:20,"20px"));const qe=C(o(a("gap")),null);qe!=null?ie.style.setProperty("--cms-layout-gap",qe):ie.style.removeProperty("--cms-layout-gap");const pt=C(o(a("headerOffset")),null);pt!=null&&ie.style.setProperty("--layout-header-height",pt);const Ft=C(o(a("minHeight")),null);Ft!=null?ie.style.setProperty("--cms-layout-min-height",Ft):ie.style.removeProperty("--cms-layout-min-height")},cn=()=>{if(oe()){const qe=W(d(),R(),h());qe!==d()&&k(qe),ie.style.setProperty("--cms-layout-drawer-width",`${qe}px`)}if(we()){const qe=W(g(),m(),y());qe!==g()&&P(qe),ie.style.setProperty("--cms-layout-nav-width",`${qe}px`)}},un=(qe,pt)=>{if(pt.button!==0)return;const Ft=qe==="drawer"?x:He;if(Ft.hidden)return;const Gt=qe==="drawer"?d:g,tn=qe==="drawer"?k:P,sn=qe==="drawer"?R:m,v=qe==="drawer"?h:y,ce=Ft.getBoundingClientRect(),Je=ce.width||Gt(),it=ct=>{const mt=qe==="drawer"?ct.clientX-ce.left:ce.right-ct.clientX;tn(W(mt||Je,sn(),v())),cn(),en()},lt=()=>{ie.classList.remove("is-resizing-layout"),document.removeEventListener("pointermove",it,!0),document.removeEventListener("pointerup",lt,!0),Dt=null};ie.classList.add("is-resizing-layout"),document.addEventListener("pointermove",it,!0),document.addEventListener("pointerup",lt,!0),Dt=lt,pt.preventDefault()},Zt=qe=>un("drawer",qe),pn=qe=>un("nav",qe);Be.addEventListener("pointerdown",Zt),Oe.addEventListener("pointerdown",pn);const en=()=>{const qe=!!De(),pt=!!Ce(),Ft=!!ke(),Gt=!re()&&fe()&&Nt,tn=!ue()&&be()&&Et,sn=Gt&&(qe||O()),v=tn&&(qe||Y()),ce=Gt&&pt,Je=tn&&Ft,it=ce&&!sn,lt=Je&&!v,ct=it&&oe(),mt=lt&&we(),Jt=ce&&sn||Je&&v;Qt(),cn(),ie.classList.toggle("is-mobile",qe),ie.classList.toggle("drawer-open",ce),ie.classList.toggle("nav-open",Je),ie.classList.toggle("no-drawer",!Gt),ie.classList.toggle("no-nav",!tn),ie.classList.toggle("has-header",wt),ie.classList.toggle("has-drawer",Gt),ie.classList.toggle("has-nav",tn),ie.classList.toggle("has-footer",Mt),ie.classList.toggle("drawer-floating",sn),ie.classList.toggle("nav-floating",v);const Yt=M(),ln=Yt?N():"";ie.dataset.disposition=Yt||"",ie.dataset.layoutMode=ln||"",ie.classList.toggle("has-disposition",!!Yt),ie.classList.toggle("mode-local",ln==="local"),ie.classList.toggle("mode-global",ln==="global"),r.classList.toggle("sticky",o(a("stickyHeader"))===!0),nt.classList.toggle("sticky",o(a("stickyFooter"))===!0),x.classList.toggle("sticky",o(a("stickyAside"))!==!1),He.classList.toggle("sticky",o(a("stickyNav"))===!0),r.hidden=!wt,nt.hidden=!Mt,at.hidden=!Rt,Ze.hidden=!(sn||v),Ze.classList.toggle("show",Jt),x.hidden=!Gt||!ce&&!sn,x.classList.toggle("open",ce),x.classList.toggle("is-floating",sn),x.classList.toggle("is-resizable",ct),x.setAttribute("aria-hidden",ce?"false":"true"),Be.hidden=!ct,He.hidden=!tn||!Je&&!v,He.classList.toggle("open",Je),He.classList.toggle("is-floating",v),He.classList.toggle("is-resizable",mt),He.setAttribute("aria-hidden",Je?"false":"true"),Oe.hidden=!mt;const nn=gn[Yt]||null,An=(nn==null?void 0:nn.side)||(it&&nn?"left":null),Sn=(nn==null?void 0:nn.nav)||(lt&&nn?"top":null),mn=it?nn?An:"left":"",Tn=lt?nn?Sn==="left"||Sn==="right"?Sn:"":"right":"";ie.classList.toggle("drawer-left",Gt&&An==="left"),ie.classList.toggle("drawer-right",Gt&&An==="right"),ie.classList.toggle("nav-top",lt&&Sn==="top"),ie.classList.toggle("nav-side",lt&&(Tn==="left"||Tn==="right")),f.style.gridTemplateColumns=[mn==="left"?"minmax(0, var(--cms-layout-drawer-width))":Tn==="left"?"minmax(0, var(--cms-layout-nav-width))":"0px","minmax(0, 1fr)",mn==="right"?"minmax(0, var(--cms-layout-drawer-width))":Tn==="right"?"minmax(0, var(--cms-layout-nav-width))":"0px"].join(" ");const qn=['"header header header"',`"${it?"aside":"."} main ${lt?"nav":"."}"`,'"footer footer footer"'].join(" "),Yn=zn(gn[Yt],{header:wt,aside:it,nav:lt,main:Rt,footer:Mt});f.style.gridTemplateAreas=U(b("areas","gridTemplateAreas","templateAreas"))||Yn||qn},rn=(qe,pt)=>(wt=Ot(r,qt(qe)),Xt(),en(),pt&&JSswift.router.setURLOnly(pt),r),Vn=(qe,pt)=>(Nt=Ot(de,qt(qe)),Nt||p(!1),en(),pt&&JSswift.router.setURLOnly(pt),x),dn=(qe,pt)=>(Et=Ot(Se,qt(qe)),Et||ze(!1),en(),pt&&JSswift.router.setURLOnly(pt),He),hs=(qe,pt)=>(Rt=Ot(at,qt(qe)),en(),pt&&JSswift.router.setURLOnly(pt),at),As=(qe,pt)=>(Mt=Ot(nt,qt(qe)),en(),pt&&JSswift.router.setURLOnly(pt),nt);wt=Ot(r,rt(["header"],ge)),Nt=Ot(de,B===!1?[]:rt(["aside","drawer"],B)),Et=Ot(Se,ne===!1?[]:rt(["nav","asideRight","drawerRight"],ne)),Rt=Ot(at,rt(["page","main","default"],Xe)),Mt=Ot(nt,rt(["footer"],q)),typeof ResizeObserver!="undefined"&&(vt=new ResizeObserver(()=>Xt()),vt.observe(r)),Xt(),JSswift.reactive.effect(()=>{_e(),De(),Ce(),ke(),en()},"UI.Layout:state");const ss=qe=>{o(a("escClose"))!==!1&&(!De()&&!O()&&!Y()||!Ce()&&!ke()||qe.key==="Escape"&&(qe.preventDefault(),Ce()&&p(!1),ke()&&ze(!1)))};return typeof document!="undefined"&&document.addEventListener("keydown",ss,!0),ie.openAside=()=>p(!0),ie.closeAside=()=>p(!1),ie.toggleAside=()=>p(!Ce()),ie.openNav=()=>ze(!0),ie.closeNav=()=>ze(!1),ie.toggleNav=()=>ze(!ke()),ie.isDrawerOpen=()=>!!Ce(),ie.isNavOpen=()=>!!ke(),ie.isMobile=()=>!!De(),ie.header=()=>r,ie.aside=()=>x,ie.drawer=()=>x,ie.nav=()=>He,ie.page=()=>at,ie.main=()=>at,ie.footer=()=>nt,ie.headerUpdate=rn,ie.asideUpdate=Vn,ie.drawerUpdate=Vn,ie.navUpdate=dn,ie.pageUpdate=hs,ie.mainUpdate=hs,ie.footerUpdate=As,ie.reflow=en,ie._dispose=()=>{var qe;typeof window!="undefined"&&window.removeEventListener("resize",Ie),typeof document!="undefined"&&document.removeEventListener("keydown",ss,!0),Be.removeEventListener("pointerdown",Zt),Oe.removeEventListener("pointerdown",pn),Dt==null||Dt(),(qe=vt==null?void 0:vt.disconnect)==null||qe.call(vt)},At(ie,e),en(),ie},Ae.Footer=(...t)=>{var we,R,h;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=m=>Object.prototype.hasOwnProperty.call(e,m),c={props:e},S=(m,y)=>{if(!(y==null||y===!1)){if(Array.isArray(y)){y.forEach(j=>S(m,j));return}if(y!=null&&y.nodeType){m.appendChild(y);return}m.appendChild(document.createTextNode(String(y)))}},u=(m,y,j=X=>X)=>{const X=JSswift.ui.getSlot(s,m);if(X!=null)return T(s,m,c,null);if(typeof y=="function"){const d=new Set(["eyebrow","title","subtitle"]),k=_[d.has(m)?"span":"div"]({class:`cms-footer-slot-${m}`});return JSswift.reactive.effect(()=>{const g=j(y(c)),P=xn(JSswift.ui.slot(g));k.replaceChildren(),Array.isArray(P)?P.forEach(K=>S(k,K)):S(k,P)},`UI.Footer:${m}`),[k]}return T(s,m,c,j(y))},a=(m,y="icon",j=e.iconSize||e.size||"md")=>m==null||m===!1?null:typeof m=="string"?Ae.Icon({name:m,size:j}):JSswift.ui.slot(m,{as:y}),b=i("left")?e.left:e.start,M=i("right")?e.right:e.end,N=i("title")?e.title:e.label,C=(R=(we=e.subtitle)!=null?we:e.description)!=null?R:e.note,z=i("content")?e.content:i("body")?e.body:n!=null&&n.length?n:null,U=[...u("left",b),...u("start",null)],W=u("icon",e.icon,a),ge=u("eyebrow",(h=e.eyebrow)!=null?h:e.kicker),B=u("title",N),ne=u("subtitle",C),he=u("meta",e.meta),q=(()=>{const m=u("content",null);return m.length?m:u("default",z)})(),se=[...u("center",null),...u("body",null)],le=[...u("right",M),...u("end",null)],fe=u("actions",e.actions),be=_.div({class:Z(["cms-footer-body",e.bodyClass,e.centerClass])},_.div({class:"cms-footer-heading"},W.length?_.div({class:"cms-footer-icon"},...W):null,_.div({class:"cms-footer-copy"},ge.length?_.div({class:Z(["cms-footer-eyebrow",e.eyebrowClass])},...ge):null,B.length?_.div({class:Z(["cms-footer-title",e.titleClass])},...B):null,ne.length?_.div({class:Z(["cms-footer-subtitle",e.subtitleClass])},...ne):null,q.length?_.div({class:Z(["cms-footer-content",e.contentClass])},...q):null),he.length?_.div({class:Z(["cms-footer-meta",e.metaClass])},...he):null)),re=[];se.length?re.push(_.div({class:Z(["cms-footer-body",e.bodyClass,e.centerClass])},...se)):(W.length||ge.length||B.length||ne.length||q.length||he.length)&&re.push(be),(le.length||fe.length)&&re.push(_.div({class:Z(["cms-footer-end",e.endClass])},...le,...fe.length?[_.div({class:Z(["cms-footer-actions",e.actionsClass])},...fe)]:[]));const ue=JSswift.omit(e,["actions","actionsClass","align","body","bodyClass","center","centerClass","content","contentClass","dense","description","divider","elevated","end","endClass","eyebrow","eyebrowClass","gap","icon","iconSize","kicker","label","left","meta","metaClass","minHeight","note","right","slots","stack","start","startClass","sticky","subtitle","subtitleClass","title","titleClass","wrap","justify"]);ue.class=Z(["cms-panel","cms-footer","cms-singularity",ye(e.sticky,"sticky"),ye(e.dense,"dense"),ye(e.elevated,"elevated"),ye(e.divider!==!1,"divider"),ye(e.stack,"stack"),jt(e.align,"align-"),e.class]),ue.style={...e.style||{}};const O=Ge(e.justify);O!=null&&(ue.style.justifyContent=O);const Y=Ge(e.wrap,m=>m?"wrap":"nowrap");Y!=null&&(ue.style.flexWrap=Y),e.gap!=null&&(ue.style["--cms-footer-gap"]=gt(o(e.gap))),e.minHeight!=null&&(ue.style.minHeight=gt(o(e.minHeight))),JSswift.uiApplyResponsiveProps(ue,e,JSswift.uiResponsiveStyleRules);const oe=_.footer(ue,...U.length?[_.div({class:Z(["cms-footer-start",e.startClass])},...U)]:[],...re.length?[_.div({class:"cms-footer-main"},...re)]:[]);return At(oe,e),oe};const pl=t=>{const e=[];for(const n of t||[]){const s=xn(JSswift.ui.slot(n));s&&(Array.isArray(s)?e.push(...s):e.push(s))}return e},Vs=(t,e)=>{const n=xn(JSswift.ui.slot(t,e));return n?Array.isArray(n)?n:[n]:[]},gt=t=>{var e;return typeof t=="number"?`${t}px`:typeof t=="string"&&((e=JSswift.uiSizes)!=null&&e.includes(t))?`var(--cms-size-${t})`:String(t)};Ae.Toolbar=(...t)=>{var y,j,X,d,k,g,P,K;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=(ee,Ce,E={})=>{const p=Array.isArray(ee)?ee:[ee];for(const A of p)if(JSswift.ui.getSlot(s,A)!=null)return T(s,A,E,Ce);return Ce==null?[]:T(null,"default",E,Ce)},c=ee=>(Array.isArray(ee)?ee:[ee]).some(E=>JSswift.ui.getSlot(s,E)!=null),S={props:e},u=i(["before"],e.before,S),a=i(["start","left"],(y=e.start)!=null?y:e.left,S),b=i(["center","body","content","default"],(d=(X=(j=e.center)!=null?j:e.body)!=null?X:e.content)!=null?d:n,S),M=i(["end","right","actions"],(g=(k=e.end)!=null?k:e.right)!=null?g:e.actions,S),N=i(["after"],e.after,S),C=i(["title"],e.title,S),z=i(["subtitle"],e.subtitle,S),U=i(["meta"],e.meta,S),W=!!(u.length||a.length||M.length||N.length||C.length||z.length||U.length||e.before!=null||e.start!=null||e.left!=null||e.end!=null||e.right!=null||e.actions!=null||e.after!=null||e.title!=null||e.subtitle!=null||e.meta!=null||e.body!=null||e.center!=null||e.content!=null||e.beforeClass||e.startClass||e.bodyClass||e.centerClass||e.contentClass||e.endClass||e.afterClass||e.titleClass||e.subtitleClass||e.metaClass||e.copyClass||c(["before","start","left","center","body","content","end","right","actions","after","title","subtitle","meta"])),ge=Z(["cms-toolbar",ye(W,"structured"),ye(e.dense,"dense"),ye(e.divider,"divider"),ye(e.elevated,"elevated"),ye(e.sticky,"sticky"),e.class]),B=JSswift.omit(e,["actions","after","afterClass","align","before","beforeClass","body","bodyClass","center","centerClass","content","contentClass","copyClass","dense","divider","elevated","end","endClass","gap","justify","left","meta","metaClass","right","size","slots","start","startClass","sticky","subtitle","subtitleClass","title","titleClass","wrap"]);B.class=ge;const ne={...e.style||{}};ne.display=ne.display||"flex";const he=Ge(e.align),q=Ge(e.justify),se=Ge(e.wrap,ee=>typeof ee=="boolean"?ee?"wrap":"nowrap":String(ee),"wrap"),le=Ge(e.gap,gt,"var(--cms-s-md)"),fe=Qe(e,"gap");ne["--cms-toolbar-gap"]=le!=null?le:"var(--cms-s-md)",fe||(ne.gap=ne.gap||"var(--cms-toolbar-gap)");const be={xxs:"4px 6px",xs:"6px 8px",sm:"6px 10px",md:"10px 12px",lg:"12px 16px",xl:"14px 18px",xxl:"16px 20px"},re=Ge(e.size,ee=>be[ee]||"");if(re!=null&&(ne.padding=re),W?(ne.flexDirection=ne.flexDirection||"column",ne.alignItems=ne.alignItems||"stretch"):(he!=null&&(ne.alignItems=he),q!=null&&(ne.justifyContent=q),se!=null&&(ne.flexWrap=se)),Object.keys(ne).length&&(B.style=ne),JSswift.uiApplyResponsiveProps(B,e,JSswift.uiResponsiveStyleRules),!W){const ee=T(s,"default",S,n),Ce=_.div(B,...ee);return At(Ce,e),Ce}const ue=(K=(P=e.bodyClass)!=null?P:e.centerClass)!=null?K:e.contentClass,O=xt([e.justify],()=>{const ee=o(e.justify);return!ee||ee==="flex-start"?"auto":""}),Y={display:"flex",alignItems:"inherit",gap:"var(--cms-toolbar-gap)",flexWrap:"inherit",minWidth:0},oe={};he!=null&&(oe.alignItems=he),q!=null&&(oe.justifyContent=q),se!=null&&(oe.flexWrap=se);const we=U.length||C.length||z.length?_.div({class:Z(["cms-toolbar-copy",e.copyClass])},U.length?_.div({class:Z(["cms-toolbar-meta",e.metaClass])},...U):null,C.length?_.div({class:Z(["cms-toolbar-title",e.titleClass])},...C):null,z.length?_.div({class:Z(["cms-toolbar-subtitle",e.subtitleClass])},...z):null):null,R=!!(a.length||we||b.length||M.length),h=[u.length?_.div({class:Z(["cms-toolbar-before",e.beforeClass]),style:{...Y}},...u):null,R?_.div({class:"cms-toolbar-main",style:oe},a.length?_.div({class:Z(["cms-toolbar-start",e.startClass]),style:{...Y}},...a):null,we||b.length?_.div({class:Z(["cms-toolbar-center",ue]),style:{...Y,flex:"1 1 240px"}},we,...b):null,M.length?_.div({class:Z(["cms-toolbar-end",e.endClass]),style:{...Y,justifyContent:"flex-end",marginInlineStart:O}},...M):null):null,N.length?_.div({class:Z(["cms-toolbar-after",e.afterClass]),style:{...Y}},...N):null].filter(Boolean),m=_.div(B,...h);return At(m,e),m};const Fi=t=>{var e;return t&&t.nodeType===1&&((e=t.classList)==null?void 0:e.contains("cms-grid-col"))};Ae.Grid=(...t)=>{var m,y,j,X;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=o(e.items),c=Array.isArray(i)?i:i==null?[]:[i],S=(d={})=>{const k=e.itemProps||{},g={...k,...d};return g.class=Z([k.class,e.itemClass,d.class]),g.style={...k.style||{},...e.itemStyle||{},...d.style||{}},g},u=(d,k={})=>{if(d==null||d===!1)return[];if(Fi(d))return[d];if(Zn(d)){const g=d.children!=null?Rn(d.children):d.content!=null?Rn(d.content):d.node!=null?Rn(d.node):d.label!=null?Rn(d.label):[];return[Ae.GridCol(S(d),...g)]}return Array.isArray(d)?[Ae.GridCol(S(k),...d)]:[Ae.GridCol(S(k),d)]},a=(d,k,g,P=!0)=>{if(d==null||d===!1)return[];const K=Zn(d)?d:{};if(P){const ee={item:d,index:k,count:g,first:k===0,last:k===g-1},Ce=T(s,"item",ee,null);if(Ce.length)return Ce.flatMap(E=>u(E,K))}return u(d,K)},b=[];c.forEach((d,k)=>{b.push(...a(d,k,c.length))}),T(s,"default",{items:c,count:c.length},n).forEach(d=>{b.push(...u(d))}),b.length||T(s,"empty",{items:c,count:0},e.empty).forEach(k=>{const g=u(k,{style:{gridColumn:"1 / -1"}});b.push(...g)});const N=Z(["cms-grid",JSswift.uiResponsiveClasses({mobile:e},ot),JSswift.uiResponsiveClasses(e,ot),ye(e.dense,"dense"),ye(e.inline,"cms-grid-inline"),ye(e.debug,"cms-grid-debug"),e.class]),C=JSswift.omit(e,["gap","rowGap","columnGap","colGap","cols","columns","rows","areas","align","justify","alignItems","justifyItems","placeItems","placeContent","dense","flow","inline","debug","autoFit","autoFill","min","max","autoRows","items","itemClass","itemStyle","itemProps","empty","slots","full","width","minWidth","maxWidth","padding",...JSswift.uiResponsiveOmitProps]);C.class=N;const z={...e.style||{}};(m=JSswift.uiResponsiveHasConfig)!=null&&m.call(JSswift,e)&&e.display==null&&!Qe(e,"display")&&z.display==null&&(z.display=e.inline?"inline-grid":"grid");const U=Ge(e.gap,gt);U!=null&&!Qe(e,"gap")&&(z["--cms-grid-gap"]=U,z.gap=U);const W=Ge(e.rowGap,gt);W!=null&&!Qe(e,"rowGap")&&(z.rowGap=W);const ge=Ge((y=e.columnGap)!=null?y:e.colGap,gt);ge!=null&&!Qe(e,["columnGap","colGap"])&&(z.columnGap=ge);const B=Ge(e.max,gt,"1fr"),ne=Ge(e.min,gt);if(ne!=null){const d=o(e.autoFill)?"auto-fill":"auto-fit";z.gridTemplateColumns=`repeat(${d}, minmax(${ne}, ${B||"1fr"}))`}else{const d=Ge((j=e.columns)!=null?j:e.cols,k=>typeof k=="number"?`repeat(${k}, minmax(0, 1fr))`:String(k));d!=null&&!Qe(e,["cols","columns"])&&(z.gridTemplateColumns=d)}const he=Ge(e.rows,d=>typeof d=="number"?`repeat(${d}, minmax(0, auto))`:String(d));he!=null&&(z.gridTemplateRows=he);const q=Ge(e.autoRows,gt);q!=null&&(z.gridAutoRows=q);const se=Ge(e.flow,d=>{const k=String(d);return e.dense&&!k.includes("dense")?`${k} dense`:k});se!=null&&!Qe(e,"flow")&&(z.gridAutoFlow=se);const le=Ge(e.areas,d=>Array.isArray(d)?d.map(k=>`"${Array.isArray(k)?k.join(" "):String(k)}"`).join(" "):String(d));le!=null&&(z.gridTemplateAreas=le);const fe=Ge((X=e.align)!=null?X:e.alignItems);fe!=null&&!Qe(e,["align","alignItems"])&&(z.alignItems=fe);const be=Ge(e.justify);be!=null&&!Qe(e,"justify")&&(z.justifyContent=be);const re=Ge(e.justifyItems);re!=null&&(z.justifyItems=re);const ue=Ge(e.placeItems);ue!=null&&(z.placeItems=ue);const O=Ge(e.placeContent);O!=null&&(z.placeContent=O);const Y=Ge(e.width,gt);Y!=null&&!Qe(e,"width")&&(z.width=Y),o(e.full)===!0&&(z.width="100%");const oe=Ge(e.minWidth,gt);oe!=null&&!Qe(e,"minWidth")&&(z.minWidth=oe);const we=Ge(e.maxWidth,gt);we!=null&&!Qe(e,"maxWidth")&&(z.maxWidth=we);const R=Ge(e.padding,gt);R!=null&&!Qe(e,"padding")&&(z.padding=R),Object.keys(z).length&&(C.style=z),JSswift.uiApplyResponsiveProps(C,e,JSswift.uiResponsiveStyleRules);const h=_.div(C,...b);return At(h,e),h},Ae.GridCol=(...t)=>{var Ye,rt,Xe,We,w,ie,$e,F;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=f=>Object.prototype.hasOwnProperty.call(e,f),c=(f,r,x={})=>{const de=Array.isArray(f)?f:[f];for(const Be of de)if(JSswift.ui.getSlot(s,Be)!=null)return T(s,Be,x,r);return r==null?[]:T(null,"default",x,r)},S=f=>{var r;return f==null||f===!1||f===""?"":typeof f=="string"&&((r=JSswift.uiSizes)!=null&&r.includes(f))?`var(--cms-s-${f})`:gt(f)},u=f=>{var r;return f==null||f===!1||f===""?"":typeof f=="string"&&((r=JSswift.uiSizes)!=null&&r.includes(f))?Ne(f,"size"):gt(f)},a={...e.style||{}},b=f=>{if(f==null||f==="")return null;if(f==="auto")return"auto";if(f==="full"||f===!0)return"1 / -1";const r=Number(f);if(Number.isFinite(r)&&r>0){const x=Math.max(1,Math.round(r));return`span ${x} / span ${x}`}return String(f)},M=f=>{if(f==null||f==="")return null;if(f==="full"||f===!0)return"1 / -1";const r=Number(f);if(Number.isFinite(r)&&r>0){const x=Math.max(1,Math.round(r));return`span ${x} / span ${x}`}return String(f)},N=i("span")?e.span:e.col,C=Ge(N,b),z=Ge(e.sm,b),U=Ge(e.md,b),W=Ge(e.lg,b),ge=JSswift.uiResponsivePropsFor(e,St("tablet"))||{},B=JSswift.uiResponsivePropsFor(e,St("pc"))||{},ne=(Ye=ge.span)!=null?Ye:ge.col,he=(rt=B.span)!=null?rt:B.col,q=Ge(ne,b),se=Ge(he,b),le=Ge(e.rowSpan,M),fe=Ge(e.row,M),be=Ge(e.area),re=Ge(e.align),ue=Ge(e.justify),O=Ge(e.place),Y=Ge(e.gap,S),oe=Ge(e.rowGap,S),we=Ge(e.columnGap,S),R=Ge(e.padding,S),h=Ge(e.width,u),m=Ge(e.minHeight,u),y=Ge(e.height,u),j=Ge(e.maxHeight,u),X=Ge(e.contentAlign),d=Ge(e.contentJustify),k=Ge(e.direction),g=Ge(e.scroll,f=>f===!0?"auto":String(f),""),P=Ge(e.fullHeight,f=>f?"100%":"",""),K=xt([e.center,e.contentAlign,e.contentJustify],()=>!!o(e.center)&&(o(e.contentAlign)==null||o(e.contentAlign)==="")&&(o(e.contentJustify)==null||o(e.contentJustify)==="")),ee={props:e},Ce=c(["start","top","header","before"],(w=(We=(Xe=e.start)!=null?Xe:e.top)!=null?We:e.header)!=null?w:e.before,ee),E=i("body")?e.body:i("content")?e.content:n,p=c(["body","content","default"],E,ee),A=c(["end","bottom","footer","after"],(F=($e=(ie=e.end)!=null?ie:e.bottom)!=null?$e:e.footer)!=null?F:e.after,ee),L=Ce.length||A.length||i("start")||i("top")||i("header")||i("before")||i("body")||i("content")||i("end")||i("bottom")||i("footer")||i("after")||e.startClass||e.bodyClass||e.contentClass||e.endClass||e.topClass||e.headerClass||e.bottomClass||e.footerClass||JSswift.ui.getSlot(s,"start")!=null||JSswift.ui.getSlot(s,"top")!=null||JSswift.ui.getSlot(s,"header")!=null||JSswift.ui.getSlot(s,"before")!=null||JSswift.ui.getSlot(s,"body")!=null||JSswift.ui.getSlot(s,"content")!=null||JSswift.ui.getSlot(s,"end")!=null||JSswift.ui.getSlot(s,"bottom")!=null||JSswift.ui.getSlot(s,"footer")!=null||JSswift.ui.getSlot(s,"after")!=null,ae=xt([e.stack,e.gap,e.rowGap,e.columnGap,e.contentAlign,e.contentJustify,e.direction,e.center],()=>L||o(e.stack)||[o(e.gap),o(e.rowGap),o(e.columnGap),o(e.contentAlign),o(e.contentJustify),o(e.direction)].some(r=>r!=null&&r!==!1&&r!=="")?!0:!!o(e.center)),ke=xt([e.panel,e.color,e.clickable,e.border,e.glossy,e.glow,e.glass,e.shadow,e.outline,e.gradient,e.textGradient,e.lightShadow,e.radius],()=>!!(o(e.panel)||o(e.color)||o(e.clickable)||o(e.border)||o(e.glossy)||o(e.glow)||o(e.glass)||o(e.shadow)||o(e.outline)||o(e.gradient)||o(e.textGradient)||o(e.lightShadow)||o(e.radius))?["cms-clear-set","cms-singularity","cms-grid-col-surface"]:[]),Te=Z(["cms-grid-col",ke,JSswift.uiResponsiveClasses({mobile:e},zt),JSswift.uiResponsiveClasses(e,zt),ye(e.panel,"cms-grid-col-panel"),ye(e.auto,"is-auto"),ye(ae,"cms-grid-col-stack"),ye(e.inline,"cms-grid-col-inline"),ye(K,"cms-grid-col-center"),e.class]),ze=JSswift.omit(e,["span","col","sm","md","lg","auto","row","rowSpan","area","align","justify","place","gap","rowGap","columnGap","padding","width","height","minHeight","maxHeight","fullHeight","stack","inline","direction","contentAlign","contentJustify","center","scroll","panel","to","start","top","header","before","startClass","topClass","headerClass","body","content","bodyClass","contentClass","end","bottom","footer","after","endClass","bottomClass","footerClass","slots","style","clickable","dense","flat","border","glossy","glow","glass","shadow","outline","rounded","gradient","textGradient","lightShadow","color","textColor","size","radius",...JSswift.uiResponsiveOmitProps]);ze.class=Te,a["--cms-grid-col-base"]==null&&(a["--cms-grid-col-base"]="auto"),a["--cms-grid-col-tablet"]==null&&(a["--cms-grid-col-tablet"]="var(--cms-grid-col-base, auto)"),a["--cms-grid-col-pc"]==null&&(a["--cms-grid-col-pc"]="var(--cms-grid-col-tablet, var(--cms-grid-col-base, auto))"),o(e.auto)===!0?a["--cms-grid-col-base"]="auto":C!=null&&(a["--cms-grid-col-base"]=C),z!=null&&(a["--cms-grid-col-sm"]=z),U!=null&&(a["--cms-grid-col-md"]=U),W!=null&&(a["--cms-grid-col-lg"]=W),q!=null&&(a["--cms-grid-col-tablet"]=q),se!=null&&(a["--cms-grid-col-pc"]=se),le!=null?a.gridRow=le:fe!=null&&(a.gridRow=fe),be!=null&&(a.gridArea=be),re!=null&&!Qe(e,"align")&&(a.alignSelf=re),ue!=null&&!Qe(e,"justify")&&(a.justifySelf=ue),O!=null&&!Qe(e,"place")&&(a.placeSelf=O),Y!=null&&!Qe(e,"gap")&&(a.gap=Y),oe!=null&&!Qe(e,"rowGap")&&(a.rowGap=oe),we!=null&&!Qe(e,"columnGap")&&(a.columnGap=we),R!=null&&!Qe(e,"padding")&&(a.padding=R),h!=null&&!Qe(e,"width")&&(a.width=h),P!=null&&P!==""?a.height=P:y!=null&&!Qe(e,"height")&&(a.height=y),m!=null&&!Qe(e,"minHeight")&&(a.minHeight=m),j!=null&&!Qe(e,"maxHeight")&&(a.maxHeight=j),k!=null&&!Qe(e,"direction")&&(a.flexDirection=k),X!=null&&!Qe(e,"contentAlign")?a.alignItems=X:K!=null&&K!==""&&(a.alignItems=K?"center":""),d!=null&&!Qe(e,"contentJustify")?a.justifyContent=d:K!=null&&K!==""&&(a.justifyContent=K?"center":""),g!=null&&g!==""&&(a.overflow=g),Object.keys(a).length&&(ze.style=a),JSswift.uiApplyResponsiveProps(ze,e,$t);const V=e.onClick,H=e.onKeydown,te=!!(o(e.clickable)||o(e.to)),De=f=>{var x;if(V==null||V(f),f.defaultPrevented)return;const r=o(e.to);r&&((x=JSswift.router)!=null&&x.navigate)&&(f.preventDefault(),JSswift.router.navigate(r))},je=f=>{H==null||H(f),!f.defaultPrevented&&(f.key==="Enter"||f.key===" ")&&(f.preventDefault(),De(f))};if(te&&(ze.onClick=De,ze.onKeydown=je,ze.tabIndex==null&&(ze.tabIndex=0),ze.role==null&&(ze.role="button")),!L){const f=_.div(ze,...T(s,"default",ee,n));return At(f,e),f}const _e={display:"flex",flexDirection:"column",gap:"inherit",minWidth:0},Me=[Ce.length?_.div({class:Z(["cms-grid-col-start",e.startClass,e.topClass,e.headerClass]),style:{..._e}},...Ce):null,p.length?_.div({class:Z(["cms-grid-col-body",e.bodyClass,e.contentClass]),style:{..._e,flex:"1 1 auto"}},...p):null,A.length?_.div({class:Z(["cms-grid-col-end",e.endClass,e.bottomClass,e.footerClass]),style:{..._e}},...A):null].filter(Boolean),Ie=_.div(ze,...Me);return At(Ie,e),Ie},Ae.Icon=(...t)=>{var fe,be;let e={},n=[],s="home",i=!1;const c=t[0],S=t[1],u=re=>re&&typeof re=="object"&&!re.nodeType&&!Array.isArray(re)&&!(re instanceof Function);typeof c=="string"?(s=c,i=!0,u(S)?(e=S,t.length>2&&(n=t.slice(2))):t.length>1&&(n=t.slice(1))):u(c)?(e=c,c.name!=null&&(s=c.name,i=!0),t.length>1&&(n=t.slice(1))):t.length&&(n=t),!i&&n.length&&(s=n.length===1?n[0]:n),vn(e);const a=e.slots||{},b=o(e.size),M=o(e.color),N=String(s).endsWith("-fill"),C={...e.style||{}},z=xt(e.size,()=>{const re=o(e.size);return typeof re=="string"&&fs[re]?re:""}),U=!!(e.color||e.clickable||e.border||e.glossy||e.glow||e.glass||e.shadow||e.outline||e.gradient||e.textGradient||e.lightShadow||e.radius),W={"chevron-down":{viewBox:"0 0 24 24",paths:[{d:"M6 9l6 6l6 -6",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"}]}},ge=re=>{const ue=W[re];return ue?_.svg({width:"100%",height:"100%",viewBox:ue.viewBox,fill:"none","aria-hidden":"true",focusable:"false"},...ue.paths.map(O=>_.path(O))):null},B=re=>{const ue=o(e.tooltip);if(ue==null||ue===!1||!Ae.Tooltip)return re;const O=u(ue)?{...ue}:{text:ue};return u(e.tooltipProps)&&Object.assign(O,e.tooltipProps),Ae.Tooltip({...O,target:re})},ne=Z(["cms-icon","material-icons",...U?["cms-clear-set","cms-singularity"]:[],z,e.class]),he=JSswift.omit(e,["name","size","class","style","label","border","color","icon","iconRight","removable","onRemove","dense","flat","glossy","outline","slots","spriteUrl","tooltip","tooltipProps"]);if(he.class=ne,Object.keys(C).length&&(he.style=C),typeof s=="function"||s&&typeof s=="object"){const re=JSswift.ui.renderSlot(a,"default",{},s),ue=T(null,"default",{},re),O=_.span({...he,"data-icon":"custom"},...ue);return At(O,e),B(O)}const q=String(s),se=q.includes("#")?q:"";let le=null;if(se){const re=e.spriteUrl||((fe=JSswift.config)==null?void 0:fe.iconSpriteUrl)||(typeof globalThis!="undefined"?(be=globalThis.JSswift_setting)==null?void 0:be.iconSpriteUrl:null),ue=se.slice(se.indexOf("#")+1),O=re?_.svg({width:"100%",height:"100%"},_.use({href:re+se})):ge(ue)||_.svg({width:"100%",height:"100%"},_.use({href:se}));N&&(O.style.fill="currentColor"),le=_.span({...he,"data-icon":q},O,...n)}else le=_.span({...he,"data-icon":q},q,...n);if(b!=null){let re=b;JSswift.uiSizes.includes(b)&&(re=`var(--cms-icon-size-${b})`),re=typeof re=="number"?re+"px":String(re),le.style.setProperty("--set-icon-size",re)}return At(le,e),B(le)},Ae.Badge=(...t)=>{const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=xt(e.size,()=>{const W=o(e.size);return typeof W=="string"&&fs[W]?`cms-size-${W}`:""}),c=Z(["cms-clear-set","cms-badge","cms-singularity",i,ye(e.outline,"outline"),e.class]),S=JSswift.omit(e,["label","color","outline","size","slots","notification","iconSize","topLeft","topRight","bottomLeft","bottomRight","left","right"]);S.class=c;const u={...e.style||{}};if(e.size){const W=o(e.size);typeof W=="string"&&fs[W]||(u.fontSize=gt(e.size))}S.style=u;const a=(W,ge,B)=>{const ne=Array.isArray(W)?W:[W];for(const he of ne)if(JSswift.ui.getSlot(s,he)!=null)return T(s,he,ge,B);return B==null||B===!1||B===""?[]:T(null,"default",ge,B)},b=()=>{var ge;const W=o((ge=e.iconSize)!=null?ge:e.size);return typeof W=="number"?Math.max(10,Math.round(W*.85)):typeof W=="string"&&{xxs:10,xs:11,sm:12,md:13,lg:14,xl:16,xxl:18,xxxl:20}[W]||14},M=(W,ge)=>{const B=o(W);return B==null||B===!1||B===""?null:typeof B=="string"?Ae.Icon({name:B,size:b()}):JSswift.ui.slot(B,{as:ge})},N=(W,ge,B)=>_.dynamic(()=>{const ne=M(e[ge],B),he=a(W,{position:B},ne);return he.length?_.span({class:`cms-badge-anchor cms-badge-anchor-${B}`,"data-badge-slot":B},...he):null}),C=_.dynamic(()=>{const W=o(e.label);let ge=a(["label"],{},W);return ge.length||(ge=a(["default"],{},n)),_.span({class:"cms-badge-content"},_.span({class:"cms-badge-label"},...ge.length?ge:[""]))}),z=_.dynamic(()=>{const W=o(e.notification),ge=W==null||W===!1||W===""?null:W,B=a(["notification"],{notification:W},ge);return B.length?_.span({class:"cms-badge-notification","data-badge-slot":"notification","aria-label":typeof W=="number"?`${W} notifications`:null},...B):null}),U=_.span(N(["left"],"left","left"),N(["centerLeft","center-left"],"centerLeft","center-left"),S,C,N(["topLeft","top-left"],"topLeft","top-left"),N(["topRight","top-right"],"topRight","top-right"),N(["bottomLeft","bottom-left"],"bottomLeft","bottom-left"),N(["bottomRight","bottom-right"],"bottomRight","bottom-right"),N(["centerRight","center-right"],"centerRight","center-right"),N(["right"],"right","right"),z);return(e.topLeft||e.centerLeft||e.bottomLeft)&&U.style.setProperty("padding-left","15px"),(e.topRight||e.centerRight||e.bottomRight)&&U.style.setProperty("padding-right","15px"),At(U,e),U};const Di=t=>{if(t==null||t===!1)return"";const e=String(t).replace(/[._-]+/g," ").replace(/\s+/g," ").trim();if(!e)return"";const n=e.split(" ").filter(Boolean);return n.length?n.length===1?n[0].replace(/[^a-z0-9]/gi,"").slice(0,2).toUpperCase():n.slice(0,2).map(s=>s.charAt(0).toUpperCase()).join(""):""},Go=(t,e)=>{const n=t==null||t===!0?e:t;if(n==null||n===!1)return Bt(e);const s=String(n).toLowerCase();return s==="online"||s==="available"||s==="active"?"success":s==="away"||s==="pending"?"warning":s==="busy"||s==="dnd"||s==="blocked"?"danger":s==="offline"||s==="idle"?"secondary":Bt(s)||Bt(e)},Ko=(t,e="cms-avatar-badge")=>t==null||t===!1?null:t instanceof Node||Array.isArray(t)||typeof t=="function"?t:t===!0?_.span({class:e}):_.span({class:e},String(t)),$i=(t,e)=>{if(t==null||t===!1){if(!e)return null;const s=Go(null,e);return _.span({class:Z(["cms-avatar-status",s?`cms-state-${s}`:""])})}if(t instanceof Node||Array.isArray(t)||typeof t=="function")return t;const n=Go(t,e);return t===!0||n?_.span({class:Z(["cms-avatar-status",n?`cms-state-${n}`:""])}):Ko(t,"cms-avatar-badge")},mo=(t,e)=>!e||!e.length?null:_.span({class:Z(["cms-avatar-anchor",t])},...e);Ae.Avatar=(...t)=>{var y,j,X;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=xt(e.size,()=>{var k;const d=o(e.size);return typeof d=="string"&&((k=JSswift.uiSizes)!=null&&k.includes(d))?`cms-size-${d}`:""}),c=xt([e.color,e.state],()=>{const d=o(e.color)||o(e.state)||"",k=Bt(d);return k?`cms-state-${k}`:""}),S=Z(["cms-clear-set","cms-avatar","cms-singularity",i,c,ye(e.square,"cms-avatar-square"),ye(e.elevated,"elevated"),e.class]),u=JSswift.omit(e,["src","srcset","srcSet","sizes","alt","label","name","initials","text","size","fontSize","textSize","radius","rounded","square","elevated","icon","iconSize","media","fit","badge","notification","status","statusColor","presence","topLeft","topRight","bottomLeft","bottomRight","slots"]);u.class=S;const a={...e.style||{}},b=Ge(e.size,d=>{var k;return typeof d=="string"&&((k=JSswift.uiSizes)!=null&&k.includes(d))?"":gt(d)},"");b!=null&&(a.width=b,a.height=b);const M=(y=e.fontSize)!=null?y:e.textSize,N=M!=null?Ge(M,gt):Ge(e.size,d=>{var k;return typeof d=="string"&&((k=JSswift.uiSizes)!=null&&k.includes(d))?"":`clamp(11px, calc(${gt(d)} * 0.34), 28px)`},"");N!=null&&(a.fontSize=N);const C=Ge(e.radius,d=>{const k=Io(d);return k==="xxxl"?"999px":k?`var(--cms-r-${k})`:typeof d=="number"?`${d}px`:String(d)});C!=null&&(a["--set-border-radius"]=C),u.style=a;const z={props:e},U=xt([e.alt,e.label,e.name,e.text],()=>{const d=o(e.alt)||o(e.label)||o(e.name)||o(e.text)||"avatar";return String(d)}),W=e.icon!=null?typeof e.icon=="string"?Ae.Icon({name:e.icon,size:e.iconSize||e.size||"sm"}):JSswift.ui.slot(e.icon,{as:"icon"}):null,ge=xt([e.initials,e.text,e.label,e.name],()=>{var g,P;const d=(g=o(e.initials))!=null?g:o(e.text);if(d!=null)return d;const k=(P=o(e.label))!=null?P:o(e.name);return typeof k=="string"?Di(k):k}),B=Ko(o((j=e.badge)!=null?j:e.notification)),ne=$i(o((X=e.status)!=null?X:e.presence),o(e.statusColor));let he=T(s,"media",z,e.media);if(!he.length&&e.src){const d={class:"cms-avatar-img",src:e.src,alt:U,sizes:e.sizes,style:{}};e.srcset!=null&&(d.srcset=e.srcset),e.srcSet!=null&&(d.srcset=e.srcSet);const k=Ge(e.fit);k!=null&&(d.style.objectFit=k),he=[_.img(d)]}const q=T(s,"default",z,n),se=T(s,"fallback",z,null),le=T(s,"label",z,ge),fe=T(s,"icon",z,W),be=he.length?he:q.length?q:se.length?se:le.length?le:fe.length?fe:["?"],re=he.length?"cms-avatar-media":"cms-avatar-fallback",ue=_.span({class:"cms-avatar-body"},_.span({class:re},...be));let O=T(s,"topLeft",z,e.topLeft),Y=T(s,"topRight",z,e.topRight),oe=T(s,"bottomLeft",z,e.bottomLeft),we=T(s,"bottomRight",z,e.bottomRight);const R=T(s,"badge",z,B),h=T(s,"status",z,ne);!Y.length&&R.length&&(Y=R),!we.length&&h.length&&(we=h);const m=_.div(u,ue,mo("cms-avatar-anchor-top-left",O),mo("cms-avatar-anchor-top-right",Y),mo("cms-avatar-anchor-bottom-left",oe),mo("cms-avatar-anchor-bottom-right",we));return At(m,e),m},Ae.Chip=(...t)=>{var ge,B,ne,he;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=xt(e.size,()=>{const q=o(e.size);return typeof q=="string"&&fs[q]?q:""}),c=Z(["cms-clear-set","cms-chip","cms-singularity",i,e.class]),S=JSswift.omit(e,["label","border","color","icon","iconRight","removable","onRemove","dense","flat","glossy","outline","slots"]);S.class=c,S.style={...e.style||{}};const u=e.icon?typeof e.icon=="string"?Ae.Icon({name:e.icon,size:(ge=e==null?void 0:e.size)!=null?ge:null}):JSswift.ui.slot(e.icon,{as:"icon"}):null,a=e.iconRight?typeof e.iconRight=="string"?Ae.Icon({name:e.iconRight,size:(B=e==null?void 0:e.size)!=null?B:null}):JSswift.ui.slot(e.iconRight,{as:"iconRight"}):null,b=JSswift.ui.renderSlot(s,"icon",{},u),M=JSswift.ui.renderSlot(s,"iconRight",{},a),N=T(s,"label",{},e.label),C=N.length?N:T(s,"default",{},n),z=T(null,"default",{},b),U=T(null,"default",{},M),W=_.span(S,...z,...C.length?C:[""],...U);if(e.removable){const q=Ae.Btn({class:"cms-chip-remove",onClick:e.onRemove,size:(ne=e==null?void 0:e.size)!=null?ne:null},Ae.Icon({size:(he=e==null?void 0:e.size)!=null?he:null,name:"close"}));W.appendChild(q),q.onclick=()=>{e.onRemove&&e.onRemove(),W.remove()}}return At(W,e),W},Ae.Stat=(...t)=>{var fe,be;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=()=>Bt(o(e.state)||o(e.color)||""),c=xt([e.state,e.color],()=>{const re=i();return re?`cms-state-${re}`:""}),S=xt(e.trend,()=>{const re=String(o(e.trend)||"").toLowerCase();return["up","positive","success","gain","increase"].includes(re)?"is-positive":["down","negative","danger","loss","decrease"].includes(re)?"is-negative":["flat","neutral","steady","stable"].includes(re)?"is-neutral":""}),u={...e},a=JSswift.omit(u,["actions","aside","delta","eyebrow","footer","icon","iconSize","label","meta","note","slots","state","subtitle","title","trend","value"]);a.class=Z(["cms-clear-set","cms-stat","cms-singularity",c,S,u.class]),a.style={...u.style||{}};const b=(re,ue,O={})=>T(s,re,O,ue),M=e.icon==null?null:typeof e.icon=="string"?Ae.Icon({name:e.icon,size:e.iconSize||"md"}):JSswift.ui.slot(e.icon,{as:"icon"}),N=b("eyebrow",e.eyebrow),C=b("label",(fe=e.label)!=null?fe:e.title),z=b("value",e.value),U=b("note",(be=e.note)!=null?be:e.subtitle),W=b("meta",e.meta),ge=b("delta",e.delta,{trend:e.trend}),B=b("icon",M),ne=b("aside",e.aside),he=b("footer",e.footer),q=b("actions",e.actions),se=b("default",n),le=_.article(a,_.div({class:"cms-stat-head"},_.div({class:"cms-stat-lead"},B.length?_.div({class:"cms-stat-icon"},...B):null,_.div({class:"cms-stat-copy"},N.length?_.div({class:"cms-stat-eyebrow"},...N):null,C.length?_.div({class:"cms-stat-label"},...C):null)),ne.length?_.div({class:"cms-stat-aside"},...ne):null),_.div({class:"cms-stat-body"},z.length?_.div({class:"cms-stat-value"},...z):null,ge.length?_.div({class:"cms-stat-delta"},...ge):null,U.length?_.div({class:"cms-stat-note"},...U):null,W.length?_.div({class:"cms-stat-meta"},...W):null,se.length?_.div({class:"cms-stat-extra"},...se):null),he.length||q.length?_.div({class:"cms-stat-footer"},he.length?_.div({class:"cms-stat-footer-copy"},...he):null,q.length?_.div({class:"cms-stat-actions"},...q):null):null);return At(le,e),le},Ae.Kpi=(...t)=>{var fe,be;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=()=>Bt(o(e.state)||o(e.color)||""),c=xt([e.state,e.color],()=>{const re=i();return re?`cms-state-${re}`:""}),S={...e},u=JSswift.omit(S,["actions","aside","delta","eyebrow","footer","icon","iconSize","label","media","meta","note","slots","state","subtitle","title","trend","value"]);u.class=Z(["cms-clear-set","cms-kpi","cms-singularity",c,S.class]),u.style={...S.style||{}};const a=(re,ue,O={})=>T(s,re,O,ue),b=e.icon==null?null:typeof e.icon=="string"?Ae.Icon({name:e.icon,size:e.iconSize||"lg"}):JSswift.ui.slot(e.icon,{as:"icon"}),M=a("eyebrow",e.eyebrow),N=a("title",(fe=e.title)!=null?fe:e.label),C=a("value",e.value),z=a("delta",e.delta,{trend:e.trend}),U=a("note",(be=e.note)!=null?be:e.subtitle),W=a("meta",e.meta),ge=a("icon",b),B=a("aside",e.aside),ne=a("media",e.media),he=a("footer",e.footer),q=a("actions",e.actions),se=a("default",n),le=_.section(u,_.div({class:"cms-kpi-head"},_.div({class:"cms-kpi-title-wrap"},ge.length?_.div({class:"cms-kpi-icon"},...ge):null,_.div({class:"cms-kpi-copy"},M.length?_.div({class:"cms-kpi-eyebrow"},...M):null,N.length?_.div({class:"cms-kpi-title"},...N):null)),B.length?_.div({class:"cms-kpi-aside"},...B):null),_.div({class:"cms-kpi-core"},_.div({class:"cms-kpi-value-wrap"},C.length?_.div({class:"cms-kpi-value"},...C):null,z.length?_.div({class:"cms-kpi-delta"},...z):null),U.length?_.div({class:"cms-kpi-note"},...U):null,W.length?_.div({class:"cms-kpi-meta"},...W):null,ne.length?_.div({class:"cms-kpi-media"},...ne):null,se.length?_.div({class:"cms-kpi-extra"},...se):null),he.length||q.length?_.div({class:"cms-kpi-footer"},he.length?_.div({class:"cms-kpi-footer-copy"},...he):null,q.length?_.div({class:"cms-kpi-actions"},...q):null):null);return At(le,e),le};const Vi=(t,e=180)=>{const n=getComputedStyle(t).transitionDuration;if(!n)return e;const s=n.split(",")[0].trim();if(!s)return e;const i=s.includes("ms")?parseFloat(s):parseFloat(s)*1e3;return Number.isFinite(i)?i:e},_s=t=>{!(t!=null&&t.overlay)||!(t!=null&&t.panel)||(t.overlay.classList.add("enter"),t.panel.classList.add("enter"),requestAnimationFrame(()=>{!(t!=null&&t.overlay)||!(t!=null&&t.panel)||(t.overlay.classList.add("entered"),t.panel.classList.add("entered"),t.overlay.classList.remove("enter"),t.panel.classList.remove("enter"))}))},ks=(t,e)=>{if(!(t!=null&&t.overlay)||!(t!=null&&t.panel)){e==null||e();return}if(t._closing)return;t._closing=!0,t.overlay.classList.add("leave"),t.panel.classList.add("leave");const n=()=>{t._closed||(t._closed=!0,e==null||e())},s=c=>{c.target===t.panel&&(t.panel.removeEventListener("transitionend",s),n())};t.panel.addEventListener("transitionend",s);const i=Vi(t.panel,180);setTimeout(n,i+40)};Ae.List=(...t)=>{var B;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=!!o((B=e.number)!=null?B:e.ordered),c=o(e.marker),S=o(e.items),u=Array.isArray(S)?S:S==null?[]:[S],a=(ne={})=>{const he=e.itemProps||{},q={...he,...ne};return e.divider!=null&&q.divider==null&&(q.divider=e.divider),q.class=Z([he.class,e.itemClass,ne.class]),q.style={...he.style||{},...e.itemStyle||{},...ne.style||{}},q},b=ne=>{if(ne==null||ne===!1)return[];if(ws(ne))return[ne];if(Zn(ne)){const he=ne.children!=null?Rn(ne.children):ne.content!=null?Rn(ne.content):Rn(ne.node);return[Ae.Item(a(ne),...he)]}return Array.isArray(ne)?[Ae.Item(a(),...ne)]:ne!=null&&ne.nodeType?[Ae.Item(a(),ne)]:[Ae.Item(a(),ne)]},M=(ne,he,q,se=!0)=>{if(ne==null||ne===!1)return[];if(se){const le={item:ne,index:he,count:q,first:he===0,last:he===q-1},fe=T(s,"item",le,null);if(fe.length)return fe.flatMap(be=>b(be))}return b(ne)},N=[];u.forEach((ne,he)=>{N.push(...M(ne,he,u.length))});const C=T(s,"default",{items:u,count:u.length},n);if(C.forEach((ne,he)=>{N.push(...M(ne,u.length+he,u.length+C.length,!1))}),!N.length){const ne=T(s,"empty",{items:u,count:0},e.empty);ne.length&&(ne.length===1&&ws(ne[0])?N.push(ne[0]):N.push(Ae.Item({class:"cms-item-empty",flat:!0},...ne)))}const z=Z(["cms-list",ye(e.dense,"dense"),ye(e.divider,"divider"),ye(c===!1||c==="none","cms-list-no-marker"),e.class]),U=JSswift.omit(e,["dense","divider","slots","number","ordered","items","itemClass","itemStyle","itemProps","empty","marker","gap"]);U.class=z,U.style={...e.style||{}};const W=Ge(e.gap,gt);return W!=null&&(U.style["--cms-list-gap"]=W),c!=null&&c!==!1&&c!==!0&&c!=="none"&&(U.style.listStyleType=String(c)),_[i?"ol":"ul"](U,...N)},Ae.Item=(...t)=>{var R,h,m,y,j,X,d,k;const{props:e,children:n}=JSswift.uiNormalizeArgs(t);e.state!=null&&e.color==null&&(e.color=e.state),vn(e);const s=e.slots||{},i=xt([e.clickable,e.to],()=>!!(o(e.clickable)||o(e.to))),c=xt([e.active,e.selected],()=>!!(o(e.active)||o(e.selected))),S=!!(e.color!=null||e.outline||e.border||e.glossy||e.glow||e.glass||e.shadow||e.gradient||e.textGradient||e.lightShadow||e.radius||e.rounded||e.flat),u=(g,P,K)=>{const ee=o(g);return ee==null||ee===!1||ee===""?null:typeof ee=="string"?Ae.Icon({name:ee,size:P||"sm"}):JSswift.ui.slot(ee,{as:K})},a=T(s,"icon",{},u(e.icon,e.iconSize||e.size,"icon")),b=T(s,"title",{},(R=e.title)!=null?R:e.label),M=T(s,"subtitle",{},(m=(h=e.subtitle)!=null?h:e.caption)!=null?m:e.description),N=T(s,"meta",{},(y=e.meta)!=null?y:e.eyebrow),C=T(s,"body",{},(j=e.body)!=null?j:e.content),z=T(s,"default",{},n),U=T(s,"actions",{},(X=e.actions)!=null?X:e.footer),W=(k=(d=e.aside)!=null?d:e.trailing)!=null?k:u(e.iconRight,e.iconSize||e.size,"iconRight"),ge=T(s,"aside",{},W),B=[...C,...z],ne=!(S||e.clickable||e.to||a.length||b.length||M.length||N.length||U.length||ge.length||C.length),he=Z(["cms-item",ye(e.divider,"divider"),ye(S,"cms-clear-set"),ye(S,"cms-singularity"),ye(S,"cms-item-surface"),ye(ne,"cms-item-inline"),ye(i,"cms-item-clickable"),ye(c,"is-active"),ye(e.disabled,"is-disabled"),e.class]),q=JSswift.omit(e,["divider","slots","label","title","subtitle","caption","description","meta","eyebrow","body","content","children","node","icon","iconRight","iconSize","aside","trailing","actions","footer","clickable","to","active","selected","disabled","state","color","size","outline","flat","border","glossy","glow","glass","gradient","textGradient","lightShadow","shadow","rounded","radius","textColor","dense"]);q.class=he,q.style={...e.style||{}};const se=e.onClick,le=e.onKeydown,fe=g=>{var K;if(se==null||se(g),g.defaultPrevented||o(e.disabled))return;const P=o(e.to);P&&((K=JSswift.router)!=null&&K.navigate)&&(g.preventDefault(),JSswift.router.navigate(P))},be=g=>{le==null||le(g),!(g.defaultPrevented||o(e.disabled))&&(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),fe(g))};o(e.disabled)&&(q["aria-disabled"]="true"),(o(e.clickable)||o(e.to))&&(q.onClick=fe,q.onKeydown=be,q.tabIndex==null&&(q.tabIndex=o(e.disabled)?-1:0),q.role==null&&(q.role="button"));const re=b.length?_.div({class:"cms-item-title"},...b):null,ue=M.length?_.div({class:"cms-item-subtitle"},...M):null,O=N.length?_.div({class:"cms-item-meta"},...N):null,Y=B.length?_.div({class:Z(["cms-item-body",ye(!(b.length||M.length||N.length),"is-standalone")])},...B):null,oe=U.length?_.div({class:"cms-item-actions"},...U):null,we=_.li(q,_.div({class:"cms-item-row"},a.length?_.div({class:"cms-item-icon"},...a):null,_.div({class:"cms-item-main"},O,re,ue,Y,oe),ge.length?_.div({class:"cms-item-aside"},...ge):null));return At(we,e),we},Ae.Separator=(...t)=>{const{props:e}=JSswift.uiNormalizeArgs(t),n=Z(["cms-separator",ye(e.vertical,"vertical"),e.class]),s=JSswift.omit(e,["vertical","size","slots"]);s.class=n;const i={borderColor:"var(--cms-border)",...e.style||{}},c=o(e.size),S=o(e.vertical);if(c!=null){const u=gt(c);S?i.width=u:i.height=u}return s.style=i,_.hr(s)},Ae.Banner=(...t)=>{var we;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=()=>Bt(o(e.type)||o(e.state)||""),c={state:i,dismissible:()=>!!o(e.dismissible)},S=xt([e.type,e.state],()=>i()),u=xt(e.variant,()=>{const R=String(o(e.variant)||"").toLowerCase();return["solid","outline","ghost"].includes(R)?`cms-banner-${R}`:""}),a=xt([e.actionsPlacement,e.stack],()=>String(o(e.actionsPlacement)||"").toLowerCase()==="bottom"||o(e.stack)?"cms-banner-actions-bottom":""),b=xt(e.stack,()=>o(e.stack)?"cms-banner-stack":""),M={...e},N=JSswift.omit(M,["actions","actionsPlacement","accent","aside","body","closeLabel","description","dismiss","dismissible","icon","iconSize","message","meta","onDismiss","slots","stack","state","subtitle","title","type","variant"]);N.class=Z(["cms-clear-set","cms-banner","cms-singularity",S,u,a,b,M.class]),N.style={...M.style||{}};const C=R=>{if(R==null||R==="")return"";const h=o(R);if(h==null||h==="")return"";const m=String(h);return In(m)?`var(--cms-${m})`:m};(e.accent!=null||Ke(e.accent))&&(N.style["--cms-banner-accent"]=()=>C(e.accent),N.style["--cms-banner-border"]=()=>{const R=C(e.accent);return R?`color-mix(in srgb, ${R} 38%, var(--cms-border-color))`:""},N.style["--cms-banner-bg"]=()=>{const R=C(e.accent);return R?`color-mix(in srgb, ${R} 14%, var(--cms-panel))`:""},N.style["--cms-banner-color"]=()=>{const R=C(e.accent);return R?`color-mix(in srgb, ${R} 78%, white)`:""});const z={success:"check_circle",warning:"warning",danger:"error",info:"info",primary:"bolt",secondary:"campaign",dark:"shield",light:"notifications"},U=(()=>{if(e.icon===!1||e.icon===null)return null;if(e.icon!=null)return typeof e.icon=="string"?Ae.Icon({name:e.icon,size:e.iconSize||e.size||"md"}):JSswift.ui.slot(e.icon,{as:"icon"});const R=i(),h=R?z[R]:null;return h?Ae.Icon({name:h,size:e.iconSize||e.size||"md"}):null})(),W=T(s,"title",c,e.title),ge=T(s,"message",c,e.message!=null?e.message:n),B=T(s,"description",c,(we=e.description)!=null?we:e.subtitle),ne=T(s,"meta",c,e.meta),he=T(s,"default",c,e.body!=null?[e.body,...n||[]]:e.message!=null?n:null),q=T(s,"icon",c,U),se=T(s,"aside",c,e.aside),le=T(s,"actions",c,e.actions),fe=T(s,"dismiss",c,e.dismiss),be=String(o(e.actionsPlacement)||"").toLowerCase()==="bottom"||!!o(e.stack),re=!!o(e.dismissible)||!!e.onDismiss;let ue=null;const O=re?Ae.Btn({class:"cms-banner-close",outline:!0,size:e.size||"sm","aria-label":e.closeLabel||"Chiudi banner",onClick:R=>{var h;(h=e.onDismiss)==null||h.call(e,R),!R.defaultPrevented&&(ue==null||ue.remove())}},Ae.Icon({name:"close",size:e.size||"sm"})):null,Y=[...se,...be?[]:le,...fe.length?fe:O?[O]:[]];ue=_.div(N,q.length?_.div({class:"cms-banner-icon"},...q):null,_.div({class:"cms-banner-body"},_.div({class:"cms-banner-copy"},W.length?_.div({class:"cms-banner-title"},...W):null,ge.length?_.div({class:"cms-banner-message"},...ge):null,B.length?_.div({class:"cms-banner-description"},...B):null,he.length?_.div({class:"cms-banner-extra"},...he):null,ne.length?_.div({class:"cms-banner-meta"},...ne):null),be&&le.length?_.div({class:"cms-banner-actions"},...le):null),Y.length?_.div({class:"cms-banner-side"},...Y):null);const oe=N.role||(()=>{const R=i();return R==="danger"||R==="warning"?"alert":"status"})();return ue.setAttribute("role",oe),At(ue,e),ue},Ae.Alert=(...t)=>{var q;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=()=>Bt(o(e.type)||o(e.state)||o(e.color)||"warning"),c=xt([e.type,e.state,e.color],()=>{const se=i();return se?`cms-state-${se}`:""}),S={...e},u=JSswift.omit(S,["actions","aside","closeLabel","description","dismiss","dismissible","icon","iconSize","message","meta","onDismiss","slots","state","subtitle","title","type","variant"]);u.class=Z(["cms-clear-set","cms-alert","cms-singularity",c,ye(e.dismissible,"is-dismissible"),S.class]),u.style={...S.style||{}};const a={success:"check_circle",warning:"warning",danger:"error",info:"info",primary:"bolt",secondary:"campaign",dark:"shield",light:"notifications"},b=(()=>{if(e.icon===!1||e.icon===null)return null;if(e.icon!=null)return typeof e.icon=="string"?Ae.Icon({name:e.icon,size:e.iconSize||"sm"}):JSswift.ui.slot(e.icon,{as:"icon"});const se=a[i()]||a.warning;return Ae.Icon({name:se,size:e.iconSize||"sm"})})(),M=T(s,"title",{},e.title),N=T(s,"message",{},e.message!=null?e.message:n),C=T(s,"description",{},(q=e.description)!=null?q:e.subtitle),z=T(s,"meta",{},e.meta),U=T(s,"actions",{},e.actions),W=T(s,"aside",{},e.aside),ge=T(s,"icon",{},b),B=T(s,"dismiss",{},e.dismiss);let ne=null;const he=e.dismissible||e.onDismiss?Ae.Btn({class:"cms-alert-close",outline:!0,size:"sm","aria-label":e.closeLabel||"Chiudi alert",onClick:se=>{var le;(le=e.onDismiss)==null||le.call(e,se),!se.defaultPrevented&&(ne==null||ne.remove())}},Ae.Icon({name:"close",size:"sm"})):null;return ne=_.div(u,ge.length?_.div({class:"cms-alert-icon"},...ge):null,_.div({class:"cms-alert-body"},M.length?_.div({class:"cms-alert-title"},...M):null,N.length?_.div({class:"cms-alert-message"},...N):null,C.length?_.div({class:"cms-alert-description"},...C):null,z.length?_.div({class:"cms-alert-meta"},...z):null,U.length?_.div({class:"cms-alert-actions"},...U):null),W.length||B.length||he?_.div({class:"cms-alert-side"},...W,...B.length?B:he?[he]:[]):null),ne.setAttribute("role",i()==="danger"||i()==="warning"?"alert":"status"),At(ne,e),ne},Ae.EmptyState=(...t)=>{var he;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=()=>Bt(o(e.state)||o(e.color)||""),c=xt([e.state,e.color],()=>{const q=i();return q?`cms-state-${q}`:""}),S={...e},u=JSswift.omit(S,["actions","description","eyebrow","icon","iconSize","illustration","media","message","meta","slots","state","title"]);u.class=Z(["cms-clear-set","cms-empty-state","cms-singularity",c,ye(e.compact,"compact"),ye(e.inline,"inline"),S.class]),u.style={...S.style||{}};const a=e.icon===!1?null:e.icon!=null?typeof e.icon=="string"?Ae.Icon({name:e.icon,size:e.iconSize||"xl"}):JSswift.ui.slot(e.icon,{as:"icon"}):Ae.Icon({name:"inbox",size:e.iconSize||"xl"}),b=T(s,"illustration",{},(he=e.illustration)!=null?he:e.media),M=T(s,"icon",{},a),N=T(s,"eyebrow",{},e.eyebrow),C=T(s,"title",{},e.title),z=T(s,"message",{},e.message!=null?e.message:n),U=T(s,"description",{},e.description),W=T(s,"meta",{},e.meta),ge=T(s,"actions",{},e.actions),B=T(s,"default",{},e.message!=null?n:null),ne=_.section(u,b.length?_.div({class:"cms-empty-state-illustration"},...b):null,M.length?_.div({class:"cms-empty-state-icon"},...M):null,N.length?_.div({class:"cms-empty-state-eyebrow"},...N):null,C.length?_.div({class:"cms-empty-state-title"},...C):null,z.length?_.div({class:"cms-empty-state-message"},...z):null,U.length?_.div({class:"cms-empty-state-description"},...U):null,W.length?_.div({class:"cms-empty-state-meta"},...W):null,B.length?_.div({class:"cms-empty-state-extra"},...B):null,ge.length?_.div({class:"cms-empty-state-actions"},...ge):null);return At(ne,e),ne};let Gn="jsswift:drawer-open";const qo=new Set,Po=new Map,ns=(t=Gn)=>{const e=JSswift==null?void 0:JSswift.store;if(e!=null&&e.get){const n=e.get(t,void 0);if(typeof n=="boolean")return n}try{return localStorage.getItem(t)==="1"}catch(n){return!1}},Bi=(t,e=Gn)=>{const n=JSswift==null?void 0:JSswift.store;if(n!=null&&n.set){n.set(e,!!t);return}try{localStorage.setItem(e,t?"1":"0")}catch(s){}};let _n=ns();const Fn=(t,e=Gn)=>{_n=!!t;const n=Po.get(e);if(n&&n.size)n.forEach(s=>s==null?void 0:s.classList.toggle("open",_n));else{const s=document.querySelector(".cms-drawer");s&&s.classList.toggle("open",_n)}return qo.forEach(s=>{if(!s)return;if(typeof s.update=="function"){s.update(_n);return}const{el:i,openIcon:c,closeIcon:S}=s;i&&(i.textContent=_n?c:S)}),Bi(_n,e),_n};Ae.Tooltip=(...t)=>{var oe,we;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{};let i=null,c=null,S=null,u=null;const a=R=>Object.prototype.hasOwnProperty.call(e,R),b=a("target")||a("anchorEl")||a("triggerEl"),M=e.target||e.anchorEl||e.triggerEl||(n&&n.length?n[0]:null),N=(R,h)=>{const m=o(R);if(m==null||m==="")return h;const y=Number(m);return Number.isFinite(y)?y:h},C=()=>{clearTimeout(c),clearTimeout(S),c=null,S=null},z=()=>N(e.delay,350),U=()=>N(e.hideDelay,o(e.interactive)?120:0),W=()=>{if(C(),!i)return;const R=i;i=null,ks(R,()=>JSswift.overlay.close(R.id))},B=(R=>{if(R==null||R===!0)return new Set(["hover","focus"]);if(R===!1)return new Set(["manual"]);const h=Array.isArray(R)?R:String(R).split(/[\s,|/]+/),m=new Set;return h.forEach(y=>{const j=String(y||"").trim().toLowerCase();j&&(j==="mouseenter"||j==="mouseover"?m.add("hover"):j==="blur"||j==="focusin"?m.add("focus"):j==="tap"?m.add("click"):m.add(j))}),m.size?m:new Set(["manual"])})((we=(oe=e.trigger)!=null?oe:e.triggers)!=null?we:a("open")?"manual":null),ne=B.has("hover"),he=B.has("focus"),q=B.has("click"),se=B.has("manual")||!ne&&!he&&!q,le=()=>{var K,ee,Ce,E,p,A;const R={anchorEl:u||M||null,close:()=>W(),hide:()=>W(),isOpen:()=>!!i},h=e.icon?typeof e.icon=="string"?Ae.Icon({name:e.icon,size:e.iconSize||e.size||"sm"}):JSswift.ui.slot(e.icon,{as:"icon"}):null,m=T(s,"title",R,(K=e.title)!=null?K:e.heading),y=T(s,"icon",R,h),j=T(s,"footer",R,(ee=e.footer)!=null?ee:e.actions);let X=(A=(p=(E=(Ce=e.content)!=null?Ce:e.text)!=null?E:e.body)!=null?p:e.description)!=null?A:e.label;X==null&&(b?X=n:M&&n&&n.length>1?X=n.slice(1):M||(X=n));let d=T(s,"content",R,X);d.length||(d=T(s,"default",R,X));const k=d.length?_.div({class:"cms-tooltip-body"},...d):null,g=y.length||m.length?_.div({class:"cms-tooltip-head"},y.length?_.div({class:"cms-tooltip-icon"},...y):null,_.div({class:"cms-tooltip-head-main"},m.length?_.div({class:"cms-tooltip-title"},...m):null,k)):k,P=j.length?_.div({class:"cms-tooltip-footer"},...j):null;return _.div({class:"cms-tooltip-content"},...[g,P].filter(Boolean))},fe=R=>{var d,k,g,P,K,ee;const h=R||u;if(!h||o(e.disabled))return null;if(i&&i._anchorEl===h)return i;i&&W();const m=(d=e.closeOnOutside)!=null?d:q||o(e.interactive),y=(k=e.closeOnEsc)!=null?k:q||o(e.interactive);let j=null;if(i=JSswift.overlay.open(()=>le(),{type:"tooltip",anchorEl:h,placement:e.placement||"top",offsetX:(g=e.offsetX)!=null?g:0,offsetY:(K=(P=e.offsetY)!=null?P:e.offset)!=null?K:8,backdrop:!1,lockScroll:!1,trapFocus:!1,closeOnOutside:m,closeOnBackdrop:!1,closeOnEsc:y,autoFocus:!1,className:Kt(["cms-tooltip",ye(e.interactive,"interactive"),e.class,e.panelClass]),onClose:()=>{var Ce,E;(Ce=j==null?void 0:j._tooltipCleanup)==null||Ce.call(j),i===j&&(i=null),(E=e.onClose)==null||E.call(e)}}),!(i!=null&&i.panel))return i;const X=i;if(j=X,X._anchorEl=h,X.panel.dataset.placement=String(o(e.placement||"top")),e.maxWidth!=null&&(X.panel.style.maxWidth=gt(o(e.maxWidth))),e.minWidth!=null&&(X.panel.style.minWidth=gt(o(e.minWidth))),e.width!=null&&(X.panel.style.width=gt(o(e.width))),e.style&&Object.assign(X.panel.style,e.style),At(X.panel,e),o(e.interactive)){const Ce=()=>{clearTimeout(S),S=null},E=()=>re(),p=A=>{const L=A.target;L&&L.closest&&L.closest("[data-tooltip-close]")&&W()};X.panel.addEventListener("mouseenter",Ce),X.panel.addEventListener("mouseleave",E),X.panel.addEventListener("focusin",Ce),X.panel.addEventListener("focusout",E),X.panel.addEventListener("click",p),X._tooltipCleanup=()=>{var A,L,ae,ke,Te;(A=X.panel)==null||A.removeEventListener("mouseenter",Ce),(L=X.panel)==null||L.removeEventListener("mouseleave",E),(ae=X.panel)==null||ae.removeEventListener("focusin",Ce),(ke=X.panel)==null||ke.removeEventListener("focusout",E),(Te=X.panel)==null||Te.removeEventListener("click",p)}}return _s(X),(ee=e.onOpen)==null||ee.call(e,X),X},be=R=>{clearTimeout(S),S=null,clearTimeout(c),c=setTimeout(()=>fe(R),z())},re=(R=!1)=>{if(clearTimeout(c),c=null,!!i){if(clearTimeout(S),R){W();return}S=setTimeout(()=>W(),U())}},ue=R=>{i?re(!0):fe(R)},O=()=>!!i,Y=R=>{if(!R)return()=>{};u=R;const h=[],m=()=>{C(),h.forEach(y=>y())};if(a("open"))return Ke(e.open)?JSswift.reactive.effect(()=>{u&&(o(e.open)?fe(u):re(!0))},"UI.Tooltip:open"):e.open===!0?fe(R):e.open===!1&&re(!0),m;if(se||o(e.disabled))return m;if(ne){const y=()=>be(R),j=()=>re();R.addEventListener("mouseenter",y),R.addEventListener("mouseleave",j),h.push(()=>{R.removeEventListener("mouseenter",y),R.removeEventListener("mouseleave",j)})}if(he){const y=()=>be(R),j=()=>re();R.addEventListener("focus",y),R.addEventListener("blur",j),h.push(()=>{R.removeEventListener("focus",y),R.removeEventListener("blur",j)})}if(q){const y=j=>{var X;(X=e.onTriggerClick)==null||X.call(e,j),!j.defaultPrevented&&ue(R)};R.addEventListener("click",y),h.push(()=>R.removeEventListener("click",y))}return m};if(M){const R=Z(["cms-tooltip-wrap",e.wrapClass,e.targetClass]),h=JSswift.omit(e,["actions","anchorEl","body","closeOnEsc","closeOnOutside","content","delay","description","disabled","footer","heading","hideDelay","icon","iconSize","interactive","label","maxWidth","minWidth","offset","offsetX","offsetY","onClose","onOpen","onTriggerClick","open","panelClass","placement","slots","style","target","targetClass","targetStyle","text","title","trigger","triggerEl","triggers","width","wrapClass","wrapStyle"]);h.class=R,h.style={display:"inline-flex",alignItems:"center",...e.wrapStyle||e.targetStyle||{}};const m=JSswift.ui.renderSlot(s,"target",{open:()=>fe(u),show:()=>be(u),hide:()=>re(!0),toggle:()=>ue(u),isOpen:O},M),y=_.span(h,...T(null,"default",{},m));return Y(y),y._tooltip={bind:Y,open:fe,show:be,hide:re,close:W,toggle:ue,isOpen:O},y}return{bind:Y,open:fe,show:be,hide:re,close:W,toggle:ue,isOpen:O}};const To=(t,e,n={})=>{var R;const{props:s,children:i}=JSswift.uiNormalizeArgs(e),c=s.slots||{},S=t==="radio",u=n.appearance==="toggle",a=!S,b=s.id||`cms-${t}-`+Math.random().toString(36).slice(2),M=an(s.model,n.modelName||(S?"UI.Radio:model":"UI.Checkbox:model")),N=JSswift.omit(s,["model","label","checked","class","style","dense","onChange","onInput","slots","icon","iconOn","iconOff","iconStandby","checkedIcon","uncheckedIcon","standbyIcon","indeterminateIcon","inputClass","iconSize","color","size","outline","behavior","mode","flat","glossy","glow","glass","gradient","textGradient","lightShadow","shadow","rounded","radius","textColor","clickable","border","shortcode","shortcut","hotkey","showShortcode","showShortcut"]);N.type=t,N.id=b,S&&s.name!=null&&(N.name=s.name),N.class=Z([`cms-${t}`,"cms-choice-input",s.inputClass]);const C=_.input(N),z=T(c,"label",{},s.label),U=z.length?z:T(c,"default",{},i),W=Re(s,{className:"cms-shortcode cms-choice-shortcode"}),ge=W?[...U,W]:U,B=JSswift.omit(s,["model","label","checked","onChange","onInput","value","name","id","type","dense","inputClass","slots","icon","iconOn","iconOff","iconStandby","checkedIcon","uncheckedIcon","standbyIcon","indeterminateIcon","iconSize","color","size","behavior","mode","outline","flat","glossy","glow","glass","gradient","textGradient","lightShadow","shadow","rounded","radius","textColor","clickable","border","shortcode","shortcut","hotkey","showShortcode","showShortcut"]);B.class=Z(["cms-clear-set","cms-singularity-check","cms-choice-wrap",`cms-${t}-wrap`,ye(u,"cms-toggle-wrap"),ye(u&&S,"cms-toggle-radio-wrap"),ye(u&&!S,"cms-toggle-checkbox-wrap"),ye(s.dense,"dense"),s.class]),B.style={...s.style||{}};const ne=o(s.size);ne!=null&&!(typeof ne=="string"&&((R=JSswift.uiSizes)!=null&&R.includes(ne)))&&(B.style["--cms-choice-size"]=gt(ne));const he=_.span({class:Z(["cms-choice-mark",S?"cms-choice-radio-mark":"cms-choice-checkbox-mark",ye(u,"cms-toggle-mark")])}),q=u?_.span({class:"cms-toggle-thumb"}):he;u&&he.appendChild(q);const se=ge.length?_.span({class:"cms-choice-label"},...ge):null,le=_.label(B,C,he,se);At(le,s);const fe=s.iconSize?s.iconSize:s.size,be=u?null:S?"radio_button_checked":"check",re=u?null:S?"radio_button_unchecked":null,ue=u||S?null:"indeterminate_check_box",O=h=>{if(S)return C.checked=h==s.value,C.checked;const m=h==null?null:!!h;return C.checked=m===!0,C.indeterminate=a&&m==null,m},Y=()=>!S&&a&&C.indeterminate?null:!!C.checked,oe=h=>h===!0?s.checkedIcon!=null?s.checkedIcon:s.icon!=null?s.icon:be:h===!1?s.uncheckedIcon!=null?s.uncheckedIcon:re:s.indeterminateIcon!=null?s.indeterminateIcon:s.standbyIcon!=null?s.standbyIcon:s.iconStandby!=null?s.iconStandby:ue,we=()=>{const h=Y(),m=h===!0;for(;q.firstChild;)q.removeChild(q.firstChild);le.classList.toggle("is-checked",m),le.classList.toggle("is-indeterminate",h==null),le.classList.toggle("is-disabled",!!C.disabled),m&&(s.checkedIcon||s.icon)?le.classList.toggle("toggle-default",!1):m&&!s.checkedIcon||h==null&&!s.standbyIcon?le.classList.toggle("toggle-default",!0):h==null&&s.standbyIcon?le.classList.toggle("toggle-default",!1):C.disabled===!1&&!s.uncheckedIcon?le.classList.toggle("toggle-default",!0):le.classList.toggle("toggle-default",!1),u&&(h==null?q.style.transform="translateX(calc((var(--cms-toggle-width) - var(--cms-toggle-thumb-size) - 1px) / 2))":q.style.removeProperty("transform"));const y={checked:m,state:h,indeterminate:h==null,value:s.value,id:b,type:t};let j=null;if(h===!0?(j=JSswift.ui.renderSlot(c,"checkedIcon",y,null),j==null&&(j=JSswift.ui.renderSlot(c,"iconOn",y,null))):h===!1?(j=JSswift.ui.renderSlot(c,"uncheckedIcon",y,null),j==null&&(j=JSswift.ui.renderSlot(c,"iconOff",y,null))):(j=JSswift.ui.renderSlot(c,"indeterminateIcon",y,null),j==null&&(j=JSswift.ui.renderSlot(c,"standbyIcon",y,null)),j==null&&(j=JSswift.ui.renderSlot(c,"iconStandby",y,null))),j==null&&(j=JSswift.ui.renderSlot(c,"icon",y,null)),j==null){const X=oe(h);typeof X=="string"?j=Ae.Icon({name:X,size:fe,...u?{textColor:s.color,outline:!0}:{}}):X!=null&&(j=JSswift.ui.slot(X,{checked:m,state:h,indeterminate:h==null,as:h===!0?"checkedIcon":h===!1?"uncheckedIcon":"indeterminateIcon"}))}T(null,"default",{},j).forEach(X=>q.appendChild(X))};return M?(O(M.get()),M.watch(h=>{O(h),we()},S?"UI.Radio:watch":"UI.Checkbox:watch"),C.addEventListener("change",h=>{var m,y;if(S)C.checked&&(M.set(s.value),(m=s.onChange)==null||m.call(s,s.value,h));else{const j=Y();M.set(j),(y=s.onChange)==null||y.call(s,j,h)}we()})):(O(S?s.checked===!0?s.value:void 0:s.checked),C.addEventListener("change",h=>{var m,y;S?(m=s.onChange)==null||m.call(s,s.value,h):(y=s.onChange)==null||y.call(s,Y(),h),we()})),s.onInput&&C.addEventListener("input",h=>{var m,y;S?(m=s.onInput)==null||m.call(s,s.value,h):(y=s.onInput)==null||y.call(s,Y(),h)}),we(),tt(le,s,{isEnabled:()=>!C.disabled,action:()=>{if(C.disabled)return!1;Pe(C),C.click()}}),le};Ae.Checkbox=(...t)=>To("checkbox",t),Ae.Radio=(...t)=>To("radio",t),Ae.Toggle=(...t)=>{var s,i,c;const{props:e}=JSswift.uiNormalizeArgs(t),n=String((c=(i=(s=e.behavior)!=null?s:e.mode)!=null?i:e.type)!=null?c:"checkbox").toLowerCase()==="radio"?"radio":"checkbox";return To(n,t,{appearance:"toggle",modelName:"UI.Toggle:model"})},Ae.Slider=(...t)=>{var ae,ke,Te,ze,V;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=e.model||(Ct(e.value)||ht(e.value)?e.value:null),c=an(i,"UI.Slider:model"),S=JSswift.omit(e,["model","value","class","style","onChange","onInput","slots","label","icon","iconRight","thumbIcon","iconThumb","pointIcon","markers","markerLabels","labelMarks","leftLabel","rightLabel","startLabel","endLabel","minLabel","maxLabel","withQItem","qitem","item","itemClass","itemStyle","showValue","thumbLabel","labelValue","selectionColor","trackColor","thumbColor","inputClass","readonly","size"]);S.type="range",S.class=Z(["cms-slider-input",e.inputClass]);const u=_.input(S),a={...e.style||{}},b=o(e.size);if(b!=null){const H=typeof b=="string"&&((ae=JSswift.uiSizes)!=null&&ae.includes(b))?`var(--cms-size-${b})`:gt(b);a["--cms-slider-size"]=H,a["--cms-slider-track-size"]=`max(4px, calc(${H} / 4))`,a["--cms-slider-box-height"]=`calc(${H} * 1.5)`,a["--cms-slider-marker-size"]=`max(6px, calc(${H} / 3))`}const M=_.label({class:Z(["cms-clear-set","cms-singularity-check","cms-slider-wrap",ye(e.dense,"dense"),e.class]),style:a});At(M,e);const N=_.div({class:"cms-slider-header"}),C=_.span({class:"cms-slider-label"}),z=_.span({class:"cms-slider-value"});N.append(C,z);const U=_.div({class:"cms-slider-body"}),W=_.span({class:"cms-slider-icon cms-slider-icon-left"}),ge=_.span({class:"cms-slider-edge-label cms-slider-edge-label-left"}),B=_.div({class:"cms-slider-main"}),ne=_.div({class:"cms-slider-box",style:{minHeight:"var(--cms-slider-box-height, 36px)"}}),he=_.span({class:"cms-slider-rail",style:{height:"var(--cms-slider-track-size, 6px)"}}),q=_.span({class:"cms-slider-selection",style:{height:"var(--cms-slider-track-size, 6px)"}}),se=_.span({class:"cms-slider-thumb",style:{width:"var(--cms-slider-size, 24px)",height:"var(--cms-slider-size, 24px)"}}),le=_.span({class:"cms-slider-thumb-icon"}),fe=_.span({class:"cms-slider-thumb-label"});se.append(fe,le);const be=_.div({class:"cms-slider-markers"}),re=_.span({class:"cms-slider-edge-label cms-slider-edge-label-right"}),ue=_.span({class:"cms-slider-icon cms-slider-icon-right"});ne.append(he,q,se,u),B.append(ne,be),U.append(W,ge,B,re,ue),M.append(N,U);const O=H=>{for(;H.firstChild;)H.removeChild(H.firstChild)},Y=(H,te,De="")=>{O(H),(te||[]).forEach(je=>H.appendChild(je)),H.style.display=H.childNodes.length?De:"none"},oe=H=>Ct(H)||ht(H)?o(H):H,we=(H,te={})=>Vs(oe(H),te),R=(H,te,De={})=>{var _e,Me;const je=oe(H);return je==null?[]:typeof je=="string"?[Ae.Icon({name:je,size:(Me=(_e=e.iconSize)!=null?_e:e.size)!=null?Me:16})]:we(je,{...De,as:te})},h=(H,te)=>{const De=Number(H);return Number.isFinite(De)?De:te},m=()=>h(o(e.min),0),y=()=>{const H=m(),te=h(o(e.max),100);return te<H?H:te},j=()=>{const H=o(e.step);if(H==="any")return"any";const te=h(H,1);return te>0?te:1},X=H=>{if(H==="any")return 0;const te=String(H);if(te.includes("e-"))return Number(te.split("e-")[1]||0);const De=te.indexOf(".");return De===-1?0:te.length-De-1},d=H=>{const te=m(),De=y(),je=j();let _e=h(H,te);if(je!=="any"){_e=te+Math.round((_e-te)/je)*je;const Me=X(je);Me>0&&(_e=Number(_e.toFixed(Me)))}return Math.min(De,Math.max(te,_e))},k=H=>{const te=m(),je=y()-te;if(!je)return 0;const _e=(d(H)-te)/je,Me=o(e.reverse)?1-_e:_e;return Math.max(0,Math.min(1,Me))},[g,P]=JSswift.reactive.signal(d(c?c.get():(Te=(ke=o(e.value))!=null?ke:o(e.min))!=null?Te:0)),K=(H,te={})=>{const De=d(H);return g()!==De&&P(De),String(u.value)!==String(De)&&(u.value=String(De)),c&&te.fromModel!==!0&&c.set(De),De},ee=()=>{var Me;const H=o(e.markers),te=!!o((Me=e.markerLabels)!=null?Me:e.labelMarks);if(!H)return[];const De=m(),je=y(),_e=(Ie,Ye)=>{var Xe,We,w,ie,$e,F,f,r;if(Ie==null)return null;if(typeof Ie=="object"&&!Array.isArray(Ie)){const x=d((w=(We=(Xe=Ie.value)!=null?Xe:Ie.position)!=null?We:Ie.at)!=null?w:De);return{key:(ie=Ie.key)!=null?ie:`marker-${Ye}-${x}`,value:x,label:($e=Ie.label)!=null?$e:te?String(x):null,icon:(F=Ie.icon)!=null?F:null,className:(r=(f=Ie.class)!=null?f:Ie.className)!=null?r:""}}const rt=d(Ie);return{key:`marker-${Ye}-${rt}`,value:rt,label:te?String(Ie):null,icon:null,className:""}};if(Array.isArray(H))return H.map((Ie,Ye)=>_e(Ie,Ye)).filter(Boolean);if(typeof H=="number"&&H>1){const Ie=Math.floor(H),Ye=Ie>1?(je-De)/(Ie-1):0;return Array.from({length:Ie},(rt,Xe)=>_e(De+Ye*Xe,Xe)).filter(Boolean)}if(H===!0){const Ie=j();if(Ie==="any")return[_e(De,0),_e(je,1)].filter(Boolean);const Ye=Math.floor((je-De)/Ie)+1;return Ye>24?[_e(De,0),_e((De+je)/2,1),_e(je,2)].filter(Boolean):Array.from({length:Ye},(rt,Xe)=>_e(De+Ie*Xe,Xe)).filter(Boolean)}return typeof H=="object"?Object.keys(H).map((Ie,Ye)=>_e({value:Number(Ie),label:H[Ie]},Ye)).filter(Boolean):[]},Ce=()=>{O(be);const H=ee();be.style.display=H.length?"block":"none",be.style.minHeight=H.some(te=>te.label!=null&&te.label!=="")?"30px":"10px",H.forEach(te=>{const De=k(te.value),je=o(e.reverse)?g()<=te.value:g()>=te.value,_e=_.button({type:"button",class:Z(["cms-slider-marker",te.className,ye(()=>je,"active")]),style:{left:`${De*100}%`,color:je?o(e.color)||"var(--cms-primary)":"var(--cms-muted)",cursor:o(e.disabled)||o(e.readonly)?"default":"pointer"},disabled:!!o(e.disabled)||!!o(e.readonly),onClick:()=>{var w,ie;if(o(e.disabled)||o(e.readonly))return;const We=K(te.value);(w=e.onInput)==null||w.call(e,We),(ie=e.onChange)==null||ie.call(e,We)}}),Me={marker:te,active:je,value:te.value,current:g(),input:u};let Ie=JSswift.ui.renderSlot(s,"marker",Me,null);Ie==null&&te.icon!=null&&(Ie=typeof te.icon=="string"?Ae.Icon({name:te.icon,size:12}):JSswift.ui.slot(te.icon,{...Me,as:"marker"}));const Ye=_.span({class:"cms-slider-marker-tick",style:{width:"var(--cms-slider-marker-size, 8px)",height:"var(--cms-slider-marker-size, 8px)",background:je?o(e.color)||"var(--cms-primary)":"var(--cms-border-color)"}}),rt=Ie==null?[Ye]:T(null,"default",Me,Ie),Xe=te.label==null?T(s,"markerLabel",Me,null):T(s,"markerLabel",Me,te.label);rt.forEach(We=>_e.appendChild(We)),Xe.length&&_e.appendChild(_.span({class:"cms-slider-marker-label"},...Xe)),be.appendChild(_e)})},E=()=>{var Me;const H={value:g(),input:u,props:e};let te=T(s,"label",H,oe(e.label));te.length||(te=T(s,"default",H,n)),Y(C,te,"inline-flex");const De=o(e.showValue),je=De===!1?null:(Me=oe(e.labelValue))!=null?Me:g(),_e=De||oe(e.labelValue)!=null?T(s,"value",H,je):[];Y(z,_e,"inline-flex"),N.style.display=C.childNodes.length||z.childNodes.length?"flex":"none"},p=()=>{var Ye,rt,Xe,We;const H={value:g(),input:u,props:e},te=T(s,"icon",H,null),De=te.length?te:R(e.icon,"icon",H);Y(W,De,"inline-flex");const je=T(s,"iconRight",H,null),_e=je.length?je:R(e.iconRight,"iconRight",H);Y(ue,_e,"inline-flex");const Me=oe((rt=(Ye=e.startLabel)!=null?Ye:e.leftLabel)!=null?rt:e.minLabel),Ie=oe((We=(Xe=e.endLabel)!=null?Xe:e.rightLabel)!=null?We:e.maxLabel);Y(ge,T(s,"startLabel",H,Me),"inline-flex"),Y(re,T(s,"endLabel",H,Ie),"inline-flex")},A=()=>{var Me,Ie,Ye,rt;const H={value:g(),input:u,props:e},te=T(s,"thumbIcon",H,null),De=(Ie=(Me=e.thumbIcon)!=null?Me:e.iconThumb)!=null?Ie:e.pointIcon;Y(le,te.length?te:R(De,"thumbIcon",H),"inline-flex");const je=(rt=(Ye=oe(e.thumbLabel))!=null?Ye:oe(e.labelValue))!=null?rt:o(e.showValue)?String(g()):null,_e=T(s,"thumbLabel",H,je);Y(fe,_e,"inline-flex")},L=()=>{const H=d(g()),te=m(),De=y(),je=j(),Me=`${k(H)*100}%`,Ie=o(e.color)||o(e.selectionColor)||"var(--cms-primary)",Ye=o(e.trackColor)||"var(--cms-border-color)",rt=o(e.thumbColor)||Ie,Xe=!!o(e.readonly),We=!!o(e.disabled);u.min=String(te),u.max=String(De),u.step=je==="any"?"any":String(je),u.disabled=We,u.value=String(H),he.style.background=Ye,q.style.background=Ie,q.style.width=Me,se.style.left=Me,se.style.borderColor=rt,se.style.color=rt,fe.style.background=Ie,M.classList.toggle("is-disabled",We),M.classList.toggle("is-readonly",Xe),M.classList.toggle("has-markers",be.childNodes.length>0)};if(c?(K(c.get(),{fromModel:!0}),c.watch(H=>{K(H,{fromModel:!0})},"UI.Slider:watch")):Ke(e.value)?JSswift.reactive.effect(()=>{K(o(e.value),{fromModel:!0})},"UI.Slider:value"):K((V=(ze=e.value)!=null?ze:e.min)!=null?V:0,{fromModel:!0}),u.addEventListener("input",H=>{var De;if(o(e.disabled)||o(e.readonly)){u.value=String(g());return}const te=K(u.value);(De=e.onInput)==null||De.call(e,te,H)}),u.addEventListener("change",H=>{var De;if(o(e.disabled)||o(e.readonly)){u.value=String(g());return}const te=K(u.value);(De=e.onChange)==null||De.call(e,te,H)}),JSswift.reactive.effect(()=>{E(),p(),A(),Ce(),L()},"UI.Slider:render"),M._input=u,M._getValue=g,M._setValue=H=>K(H),e.withQItem||e.qitem||e.item===!0){const H=Ae.Item({class:Z(["cms-slider-item",e.itemClass]),style:e.itemStyle},M);return H._input=u,H._slider=M,H._getValue=g,H._setValue=M._setValue,H}return M},Ae.Rating=(...t)=>{var g;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=e.model||(Ct(e.value)||ht(e.value)?e.value:null),c=an(i,"UI.Rating:model"),S=e.id||"cms-rating-"+Math.random().toString(36).slice(2),u=JSswift.omit(e,["model","value","max","class","style","dense","readonly","disabled","clearable","half","allowHalf","noDimming","label","slots","onChange","onInput","onHover","icon","checkedIcon","uncheckedIcon","halfIcon","hoveredIcon","iconSelected","iconHalf","iconHovered","iconOn","iconOff","iconSize","color","colorSelected","colorHalf","colorHovered","colorInactive","activeColor","halfColor","hoverColor","size","gap","tabindex","tabIndex","inputClass"]);u.type="hidden",u.id=S,e.name!=null&&(u.name=e.name),u.class=Z(["cms-rating-input","cms-choice-input",e.inputClass]);const a=_.input(u),b=JSswift.omit(e,["model","value","max","id","name","type","class","style","dense","readonly","disabled","clearable","half","allowHalf","noDimming","label","slots","onChange","onInput","onHover","icon","checkedIcon","uncheckedIcon","halfIcon","hoveredIcon","iconSelected","iconHalf","iconHovered","iconOn","iconOff","iconSize","color","colorSelected","colorHalf","colorHovered","colorInactive","activeColor","halfColor","hoverColor","size","gap","tabindex","tabIndex","inputClass"]);b.class=Z(["cms-clear-set","cms-singularity-check","cms-choice-wrap","cms-rating","cms-rating-wrap",ye(e.dense,"dense"),e.class]),b.style={...e.style||{}};const M=o(e.size);M!=null&&!(typeof M=="string"&&((g=JSswift.uiSizes)!=null&&g.includes(M)))&&(b.style["--cms-rating-size"]=gt(M));const N=o(e.gap);N!=null&&(b.style["--cms-rating-gap"]=gt(N));const C=_.span({class:"cms-rating-control",onMouseleave:P=>{var K;oe!=null&&(oe=null,d(),(K=e.onHover)==null||K.call(e,ue(),P))},onKeydown:P=>{if(!re())return;const K=se()?.5:1,ee=ue();let Ce=ee;switch(P.key){case"ArrowRight":case"ArrowUp":Ce=ee+K;break;case"ArrowLeft":case"ArrowDown":Ce=ee-K;break;case"Home":Ce=o(e.clearable)?0:K;break;case"End":Ce=q();break;case"Delete":case"Backspace":case"0":if(!o(e.clearable))return;Ce=0;break;case" ":case"Enter":Ce=ee||(o(e.clearable)?K:Math.max(K,1));break;default:return}P.preventDefault(),k(Ce,P,{emit:!0})}}),z=_.span({class:"cms-choice-label cms-rating-label"}),U=_.label(b,a,C,z);At(U,e);const W=P=>{for(;P.firstChild;)P.removeChild(P.firstChild)},ge=(P,K,ee="")=>{W(P),(K||[]).forEach(Ce=>P.appendChild(Ce)),P.style.display=P.childNodes.length?ee:"none"},B=P=>Ct(P)||ht(P)?o(P):P,ne=(P,K={})=>Vs(B(P),K),he=(P,K,ee={})=>{var E,p;const Ce=B(P);return Ce==null?[]:typeof Ce=="string"?[Ae.Icon({name:Ce,color:e.color,size:(p=(E=e.iconSize)!=null?E:e.size)!=null?p:16})]:ne(Ce,{...ee,as:K})},q=()=>{var K;const P=Number((K=o(e.max))!=null?K:5);return Number.isFinite(P)&&P>0?Math.max(1,Math.round(P)):5},se=()=>{var P;return!!o((P=e.half)!=null?P:e.allowHalf)},le=(P,K=q())=>{let ee=Number(o(P));Number.isFinite(ee)||(ee=0),ee=Math.min(K,Math.max(0,ee));const Ce=se()?.5:1;return Math.round(ee/Ce)*Ce},fe=()=>!!o(e.disabled),be=()=>!!o(e.readonly),re=()=>!fe()&&!be(),ue=()=>le(c?c.get():Y),O=P=>{const K=P>0?String(P):"";a.value=K,a.setAttribute("value",K),a.disabled=fe()};let Y=le(c?c.get():o(e.value)),oe=null,we=0,R=[];const h=(P,K)=>{if(!se())return le(P);const ee=K.currentTarget.getBoundingClientRect(),Ce=K.clientX-ee.left<=ee.width/2;return le(Ce?P-.5:P)},m=(P,K)=>P>=K?"full":se()&&P>=K-.5?"half":"empty",y=(P,K)=>{var A,L,ae,ke,Te,ze,V,H,te,De,je,_e,Me,Ie,Ye;const ee=o((ae=(L=(A=e.colorSelected)!=null?A:e.activeColor)!=null?L:e.color)!=null?ae:e.textColor)||"var(--cms-warning, #f0b429)",Ce=o((H=(V=(ze=(Te=(ke=e.colorHalf)!=null?ke:e.halfColor)!=null?Te:e.colorSelected)!=null?ze:e.activeColor)!=null?V:e.color)!=null?H:e.textColor)||ee,E=o((Me=(_e=(je=(De=(te=e.colorHovered)!=null?te:e.hoverColor)!=null?De:e.colorSelected)!=null?je:e.activeColor)!=null?_e:e.color)!=null?Me:e.textColor)||ee,p=o((Ye=(Ie=e.colorInactive)!=null?Ie:e.colorOff)!=null?Ye:e.color)||"var(--cms-muted)";return K?E:P==="full"?ee:P==="half"?Ce:p},j=P=>{var E,p,A,L,ae,ke,Te,ze,V,H,te,De,je,_e,Me;const K=[];P.hovered&&P.state!=="empty"&&K.push("hoveredIcon","iconHovered"),P.state==="full"?K.push("checkedIcon","selectedIcon","iconSelected","iconOn"):P.state==="half"?K.push("halfIcon","iconHalf"):K.push("uncheckedIcon","iconOff"),K.push("icon","item","star");for(const Ie of K){const Ye=T(s,Ie,P,null);if(Ye.length)return Ye}let ee=null,Ce="icon";return P.hovered&&P.state!=="empty"&&(ee=(E=e.hoveredIcon)!=null?E:e.iconHovered,Ce="hoveredIcon"),ee==null&&P.state==="full"?(ee=(ae=(L=(A=(p=e.checkedIcon)!=null?p:e.iconSelected)!=null?A:e.iconOn)!=null?L:e.icon)!=null?ae:"star",Ce="checkedIcon"):ee==null&&P.state==="half"?(ee=(H=(V=(ze=(Te=(ke=e.halfIcon)!=null?ke:e.iconHalf)!=null?Te:e.checkedIcon)!=null?ze:e.iconSelected)!=null?V:e.icon)!=null?H:"star_half",Ce="halfIcon"):ee==null&&(ee=(Me=(te=e.uncheckedIcon)!=null?te:e.iconOff)!=null?Me:o(e.noDimming)?(_e=(je=(De=e.icon)!=null?De:e.checkedIcon)!=null?je:e.iconSelected)!=null?_e:"star":"star_border",Ce="uncheckedIcon"),he(ee,Ce,P)},X=()=>{const P=q();if(we!==P){we=P,R=[],W(C);for(let K=1;K<=P;K++){const ee=_.span({class:"cms-rating-item-icon"}),Ce=_.span({class:"cms-rating-item",role:"radio",tabIndex:-1,onMousemove:E=>{var A;if(!re())return;const p=h(K,E);oe!==p&&(oe=p,d(),(A=e.onHover)==null||A.call(e,p,E))},onClick:E=>{if(!re())return;let p=h(K,E);o(e.clearable)&&p===ue()&&(p=0),k(p,E,{emit:!0})}},ee);R.push({item:Ce,iconHost:ee,index:K}),C.appendChild(Ce)}}},d=()=>{var ke,Te;X();const P=q(),K=ue(),ee=oe==null?K:le(oe,P),Ce=fe(),E=be(),p=!!o(e.clearable),A=!!o(e.noDimming);U.classList.toggle("is-disabled",Ce),U.classList.toggle("is-readonly",E),U.classList.toggle("is-hovering",oe!=null),U.classList.toggle("is-clearable",p),U.classList.toggle("is-half",se()),U.classList.toggle("no-dimming",A);const L=Number((Te=o((ke=e.tabindex)!=null?ke:e.tabIndex))!=null?Te:0);C.tabIndex=Ce?-1:L,C.setAttribute("role","slider"),C.setAttribute("aria-valuemin","0"),C.setAttribute("aria-valuemax",String(P)),C.setAttribute("aria-valuenow",String(K)),C.setAttribute("aria-disabled",Ce?"true":"false"),C.setAttribute("aria-readonly",E?"true":"false"),O(K);const ae=T(s,"label",{value:K,max:P,disabled:Ce,readonly:E,clearable:p},e.label!=null?B(e.label):n);ge(z,ae,"inline-flex"),R.forEach(({item:ze,iconHost:V,index:H})=>{const te=m(ee,H),De=oe!=null&&te!=="empty",je={index:H,max:P,value:K,displayValue:ee,state:te,active:te!=="empty",checked:te==="full",half:te==="half",hovered:De,disabled:Ce,readonly:E,clearable:p,setValue:_e=>k(_e,null,{emit:!1})};ze.className=Kt(["cms-rating-item",`is-${te}`,ye(De,"is-hovered")]),ze.style.color=y(te,De),ze.style.opacity=te==="empty"&&!A?"0.48":"1",ze.setAttribute("aria-checked",String(K===H)),ge(V,j(je),"inline-flex")})},k=(P,K,ee={})=>{var p,A;const Ce=le(P),E=ue();return Y=Ce,oe=null,c&&ee.fromModel!==!0&&c.set(Ce),O(Ce),d(),ee.emit!==!1&&Ce!==E&&((p=e.onInput)==null||p.call(e,Ce,K),(A=e.onChange)==null||A.call(e,Ce,K)),Ce};return U._input=a,U._rating=C,U._getValue=ue,U._setValue=P=>k(P,null,{emit:!1}),c&&c.watch(P=>{const K=le(P);serializeValue(K)!==serializeValue(Y)&&(Y=K,oe=null,O(Y),d())},"UI.Rating:watch"),JSswift.reactive.effect(()=>{!c&&e.value!=null&&(Y=le(o(e.value))),d()},"UI.Rating:render"),U};const Ut=t=>t?{hour:Number(t.hour)||0,minute:Number(t.minute)||0,second:Number(t.second)||0}:null,Dn=t=>String(Math.max(0,Number(t)||0)).padStart(2,"0"),Pn=(t,e={})=>{var u,a,b,M,N,C,z,U,W,ge,B,ne,he,q,se;if(t==null||t==="")return null;let n=null,s=null,i=0,c=null;if(t instanceof Date&&!Number.isNaN(t.getTime()))n=t.getHours(),s=t.getMinutes(),i=t.getSeconds();else if(typeof t=="number"&&Number.isFinite(t)){const le=Math.max(0,Math.floor(t));n=Math.floor(le/3600)%24,s=Math.floor(le/60)%60,i=le%60}else if(typeof t=="object"){if(t.time!=null||t.value!=null)return Pn((u=t.time)!=null?u:t.value,e);n=Number((M=(b=(a=t.hour)!=null?a:t.hours)!=null?b:t.h)!=null?M:t.hh),s=Number((U=(z=(C=(N=t.minute)!=null?N:t.minutes)!=null?C:t.min)!=null?z:t.mm)!=null?U:0),i=Number((ne=(B=(ge=(W=t.second)!=null?W:t.seconds)!=null?ge:t.sec)!=null?B:t.ss)!=null?ne:0),c=(se=(q=(he=t.meridiem)!=null?he:t.ampm)!=null?q:t.period)!=null?se:null}else if(typeof t=="string"){const le=t.trim();if(!le)return null;const fe=le.match(/^(\d{1,2})(\d{2})(\d{2})?$/),be=le.match(/(\d{1,2}):(\d{1,2})(?::(\d{1,2}))?\s*([ap]m)?/i);if(be)n=Number(be[1]),s=Number(be[2]),i=be[3]!=null?Number(be[3]):0,c=be[4]||null;else if(fe)n=Number(fe[1]),s=Number(fe[2]),i=fe[3]!=null?Number(fe[3]):0;else return null}else return null;if(!Number.isFinite(n)||!Number.isFinite(s)||!Number.isFinite(i))return null;if(c){const le=String(c).toLowerCase();le==="pm"&&n<12&&(n+=12),le==="am"&&n===12&&(n=0)}if(n<0||n>23||s<0||s>59||i<0||i>59)return null;const S={hour:Math.floor(n),minute:Math.floor(s),second:Math.floor(i)};return Yo(S,e)},Kn=(t,e={})=>{const n=t&&typeof t=="object"&&t.hour!=null?Ut(t):Pn(t,e);if(!n)return"";const s=e.withSeconds===!0||Number(n.second||0)>0;return`${Dn(n.hour)}:${Dn(n.minute)}${s?`:${Dn(n.second)}`:""}`},po=(t,e)=>{const n=Kn(t,{withSeconds:!0}),s=Kn(e,{withSeconds:!0});return!n&&!s?0:n?s?n<s?-1:n>s?1:0:1:-1};function Yo(t,e={}){if(!t)return null;const n=Ut(t),s=e.min!=null?Pn(e.min,{withSeconds:!0}):null,i=e.max!=null?Pn(e.max,{withSeconds:!0}):null;return s&&po(n,s)<0?Ut(s):i&&po(n,i)>0?Ut(i):n}const kn=(t,e={})=>t==null||t===""?null:t instanceof Date?Pn(t,e):typeof t=="object"?Pn(t.time!=null?t.time:t,e):typeof t=="string"||typeof t=="number"?Pn(t,e):null,ho=(t,e={})=>{var u;const n=Pn(t,e);if(!n)return"";const s=e.withSeconds===!0||Number(n.second||0)>0;if(!!!o((u=e.use12h)!=null?u:e.ampm))return`${Dn(n.hour)}:${Dn(n.minute)}${s?`:${Dn(n.second)}`:""}`;const c=n.hour>=12?"PM":"AM",S=n.hour%12||12;return`${Dn(S)}:${Dn(n.minute)}${s?`:${Dn(n.second)}`:""} ${c}`},ji=(t,e,n={})=>{if(!t)return"";const s=Kn(e,n);return s?`${t}T${s}`:t},Jo=(t,e)=>{const n=Math.max(1,Math.min(e+1,Math.round(Number(t)||1))),s=[];for(let i=0;i<=e;i+=n)s.push(i);return s},Xo=(t={})=>{const{props:e={},slots:n={},value:s=null,withSeconds:i=!1,minuteStep:c=5,secondStep:S=5,disabled:u=!1,readonly:a=!1,embedded:b=!1,className:M="",slotPrefix:N="",shortcuts:C=null,onSelect:z=null}=t,U=Pn(s,{withSeconds:i,min:e.min,max:e.max}),W=U||Pn(new Date,{withSeconds:i,min:e.min,max:e.max})||{hour:0,minute:0,second:0},ge=U?Ut(U):null,B=re=>N?`${N}${re[0].toUpperCase()}${re.slice(1)}`:null,ne=(re,ue,O)=>{const Y=[B(re),re].filter(Boolean);for(const oe of Y){if(JSswift.ui.getSlot(n,oe)==null)continue;const R=JSswift.ui.renderSlot(n,oe,ue,O);if(R!=null)return R}return JSswift.ui.slot(O,ue)},he=re=>{let ue=ne("point",re,null);return ue==null&&t.pointIcon!=null&&re.selected&&(ue=typeof t.pointIcon=="string"?Ae.Icon({name:t.pointIcon,size:b?10:12}):JSswift.ui.slot(t.pointIcon,re)),T(null,"default",re,ue)},q=(re,ue)=>{const O={hour:W.hour,minute:W.minute,second:i?W.second:0};return O[re]=ue,O},se=_.div({class:Z(["cms-time-section",ye(b,"is-embedded"),ye(i,"has-seconds"),M])}),le=o(C)||[];if(Array.isArray(le)&&le.length){const re=_.div({class:"cms-time-shortcuts"});le.forEach((ue,O)=>{var h,m,y;if(!ue)return;const Y=typeof ue.value=="function"?ue.value({now:Kn(new Date,{withSeconds:i})}):ue.value,oe=Pn(Y,{withSeconds:i,min:e.min,max:e.max});if(!oe)return;const we={item:ue,index:O,value:Kn(oe,{withSeconds:i}),displayValue:ho(oe,{withSeconds:i,use12h:(h=e.use12h)!=null?h:e.ampm})},R=ne("shortcut",we,(y=(m=ue.label)!=null?m:ue.text)!=null?y:we.displayValue);re.appendChild(_.button({type:"button",class:Z(["cms-time-shortcut",ye(!!ge&&po(oe,ge)===0,"is-selected")]),disabled:u||a,onClick:()=>z==null?void 0:z(oe,{shortcut:ue,index:O})},...T(null,"default",we,R)))}),re.childNodes.length&&se.appendChild(re)}const fe=_.div({class:"cms-time-columns"}),be=(re,ue,O)=>{const Y=_.div({class:"cms-time-column","data-time-part":ue}),oe=_.div({class:"cms-time-options"});return O.forEach(we=>{var k;const R=q(ue,we),h=Yo(R,{withSeconds:i,min:e.min,max:e.max}),m=u||a||po(h,R)!==0,y=!!ge&&ge[ue]===we,j={part:ue,selected:y,disabled:m,value:we,label:Dn(we),timeValue:Kn(h,{withSeconds:i}),displayValue:ho(h,{withSeconds:i,use12h:(k=e.use12h)!=null?k:e.ampm})},X=ne("option",j,j.label),d=y?he(j):[];oe.appendChild(_.button({type:"button",class:Z(["cms-time-option",ye(y,"is-selected"),ye(m,"is-disabled")]),disabled:m,onClick:()=>z==null?void 0:z(h,{part:ue,optionValue:we})},_.span({class:"cms-time-option-label"},...T(null,"default",j,X)),d.length?_.span({class:"cms-time-option-point"},...d):null))}),Y.appendChild(oe),Y};return fe.appendChild(be(o(e.hoursLabel)||"Ore","hour",Jo(1,23))),fe.appendChild(be(o(e.minutesLabel)||"Min","minute",Jo(c,59))),i&&fe.appendChild(be(o(e.secondsLabel)||"Sec","second",Jo(S,59))),se.appendChild(fe),se},go=t=>{if(!t)return null;const e={};return t.querySelectorAll(".cms-time-column").forEach((n,s)=>{const i=n.getAttribute("data-time-part")||String(s);e[i]=n.scrollTop}),e},Qo=(t,e={})=>{var i;if(!t)return;const n=e.scrollState||null,s=(i=e.behavior)!=null?i:"smooth";t.querySelectorAll(".cms-time-column").forEach((c,S)=>{const u=c.getAttribute("data-time-part")||String(S),a=n&&Number.isFinite(n[u])?n[u]:null;a!=null&&(c.scrollTop=a);const b=c.querySelector(".cms-time-option.is-selected");if(!b)return;const M=Math.max(0,c.scrollHeight-c.clientHeight),N=b.offsetTop-(c.clientHeight-b.offsetHeight)/2,C=Math.max(0,Math.min(M,N));if(Math.abs(c.scrollTop-C)<1){c.scrollTop=C;return}if(s&&typeof c.scrollTo=="function"){c.scrollTo({top:C,behavior:s});return}c.scrollTop=C})},Zo=(t,e={})=>{var hs,As,ss,os,is,ls,qe,pt,Ft,Gt,tn,sn;const{props:n,children:s}=JSswift.uiNormalizeArgs(t),i=e.calendar===!0,c=n.slots||{},S=xt(n.size,()=>{const v=String(o(n.size)||"").toLowerCase();return["xs","sm","md","lg","xl"].includes(v)?`cms-size-${v}`:""}),u=String(o((os=(ss=n.mode)!=null?ss:o((As=(hs=n.rangeMultiple)!=null?hs:n.multipleRange)!=null?As:n.multiRange)?"range-multiple":null)!=null?os:n.range&&n.multiple?"range-multiple":n.range?"range":n.multiple?"multiple":"single")).toLowerCase(),a=["range-multiple","multiple-range","rangemultiple","multiplerange","range_multiple","multiple_range","multi-range","multi_range","ranges"].includes(u)?"range-multiple":u==="range"?"range":u==="multiple"?"multiple":"single",b=n.model||(Ct(n.value)||ht(n.value)?n.value:null),M=an(b,i?"UI.Calendar:model":"UI.Datepicker:model"),N=M?M.get():o(n.value),C=o((is=n.rangeAs)!=null?is:n.rangeModel)==="array"||Array.isArray(N),z=o((ls=n.rangeMultipleAs)!=null?ls:n.multipleRangeAs)==="array"||Array.isArray(N)&&Array.isArray(N[0]),U=()=>{var v,ce,Je;return a==="single"&&!!o((Je=(ce=(v=n.withTime)!=null?v:n.time)!=null?ce:n.timePicker)!=null?Je:n.enableTime)},W=()=>{var ce,Je,it,lt,ct,mt,Jt,Yt;const v=Kn(kn((Je=(ce=o(n.timeValue))!=null?ce:M?M.get():o(n.value))!=null?Je:N,{withSeconds:!0}),{withSeconds:!0});return{withSeconds:!!o((lt=(it=n.timeWithSeconds)!=null?it:n.withSeconds)!=null?lt:n.showSeconds)||/:\d{2}:\d{2}$/.test(v)||/:\d{2}:\d{2}$/.test(o(n.timeFormat)||""),min:o((ct=n.timeMin)!=null?ct:n.minTime),max:o((mt=n.timeMax)!=null?mt:n.maxTime),use12h:o((Yt=(Jt=n.time12h)!=null?Jt:n.use12h)!=null?Yt:n.ampm)}},ge=()=>{var ce,Je;const v=Number(o((Je=(ce=n.timeMinuteStep)!=null?ce:n.minuteStep)!=null?Je:5));return Math.max(1,Math.min(30,Number.isFinite(v)?v:5))},B=()=>{var ce,Je;const v=Number(o((Je=(ce=n.timeSecondStep)!=null?ce:n.secondStep)!=null?Je:5));return Math.max(1,Math.min(30,Number.isFinite(v)?v:5))},ne=v=>String(v).padStart(2,"0"),he=(v,ce,Je)=>{const it=new Date(v,ce,Je);return it.getFullYear()!==v||it.getMonth()!==ce||it.getDate()!==Je?null:it},q=v=>!(v instanceof Date)||Number.isNaN(v.getTime())?null:`${v.getFullYear()}-${ne(v.getMonth()+1)}-${ne(v.getDate())}`,se=v=>{if(typeof v!="string")return null;const ce=v.match(/^(\d{4})-(\d{2})-(\d{2})$/);if(!ce)return null;const Je=Number(ce[1]),it=Number(ce[2])-1,lt=Number(ce[3]),ct=new Date(Je,it,lt);return ct.getFullYear()!==Je||ct.getMonth()!==it||ct.getDate()!==lt?null:ct},le=(v,ce)=>{const Je=se(v);return Je?(Je.setDate(Je.getDate()+ce),q(Je)):null},fe=(v,ce)=>new Date(v.getFullYear(),v.getMonth()+ce,1),be=v=>{if(v instanceof Date&&!Number.isNaN(v.getTime()))return new Date(v.getFullYear(),v.getMonth(),1);const ce=d(v),Je=se(ce);return Je?new Date(Je.getFullYear(),Je.getMonth(),1):new Date},re=()=>q(new Date),ue=(v,ce)=>!!v&&!!ce&&v===ce,O=(v,ce)=>v==null&&ce==null?0:v==null?-1:ce==null?1:v<ce?-1:v>ce?1:0,Y=(v,ce)=>{const Je=se(v),it=se(ce);return!Je||!it?0:Math.round((it.getTime()-Je.getTime())/864e5)},oe=v=>Array.isArray(v)?v.slice():v==null||v===""?[]:[v],we=v=>({from:(v==null?void 0:v.from)||null,to:(v==null?void 0:v.to)||null}),R=v=>Array.isArray(v)?v.map(we):[],h=v=>{const ce=we(v);return C?[ce.from,ce.to]:ce},m=v=>R(v).map(ce=>z?[ce.from,ce.to]:ce),y=v=>a==="multiple"?Array.isArray(v)?v.slice():[]:a==="range"?we(v):a==="range-multiple"?R(v):v||null,j=v=>a==="multiple"?Array.isArray(v)?v.slice():[]:a==="range"?h(v):a==="range-multiple"?m(v):v||"",X=v=>JSON.stringify(j(v)),d=v=>{if(v==null||v==="")return null;if(v instanceof Date)return q(v);if(typeof v=="number")return q(new Date(v));if(typeof v!="string")return typeof v=="object"&&v.date!=null?d(v.date):null;const ce=v.trim();if(!ce)return null;const Je=ce.match(/^(\d{4})-(\d{1,2})-(\d{1,2})(?:$|[T\s])/);if(Je){const mt=he(Number(Je[1]),Number(Je[2])-1,Number(Je[3]));return q(mt)}const it=ce.match(/^(\d{1,2})[\/.\-](\d{1,2})[\/.\-](\d{2,4})$/);if(it){const mt=it[3].length===2?2e3+Number(it[3]):Number(it[3]),Jt=he(mt,Number(it[2])-1,Number(it[1]));return q(Jt)}if(/^\d{1,4}$/.test(ce))return null;const lt=new Date(ce);if(Number.isNaN(lt.getTime()))return null;const ct=ce.match(/(?:^|[^\d])(\d{4})(?!\d)/);return ct&<.getFullYear()!==Number(ct[1])?null:q(lt)},k=v=>{var it,lt,ct,mt,Jt,Yt;if(v==null||v==="")return{from:null,to:null};let ce=null,Je=null;if(Array.isArray(v))ce=d(v[0]),Je=d(v[1]);else if(typeof v=="object")ce=d((ct=(lt=(it=v.from)!=null?it:v.start)!=null?lt:v.dateFrom)!=null?ct:v.departure),Je=d((Yt=(Jt=(mt=v.to)!=null?mt:v.end)!=null?Jt:v.dateTo)!=null?Yt:v.return);else{const ln=String(v).match(/\d{4}-\d{1,2}-\d{1,2}|\d{1,2}[\/.\-]\d{1,2}[\/.\-]\d{2,4}/g)||[];ce=d(ln[0]),Je=d(ln[1])}return ce&&Je&&ce>Je&&([ce,Je]=[Je,ce]),{from:ce,to:Je}},g=v=>{const ce=[],Je=new Set,it=lt=>{const ct=k(lt);if(!ct.from)return;const mt=`${ct.from||""}|${ct.to||""}`;Je.has(mt)||(Je.add(mt),ce.push(ct))};if(v==null||v==="")return ce;if(Array.isArray(v))if(v.every(ct=>ct==null||typeof ct=="string"||typeof ct=="number"||ct instanceof Date)){const ct=v.map(d).filter(Boolean);for(let mt=0;mt<ct.length;mt+=2)it({from:ct[mt],to:ct[mt+1]||null})}else v.forEach(ct=>it(ct));else if(typeof v=="object"&&Array.isArray(v.ranges))v.ranges.forEach(lt=>it(lt));else if(typeof v=="object")it(v);else{const ct=(String(v).match(/\d{4}-\d{1,2}-\d{1,2}|\d{1,2}[\/.\-]\d{1,2}[\/.\-]\d{2,4}/g)||[]).map(d).filter(Boolean);for(let mt=0;mt<ct.length;mt+=2)it({from:ct[mt],to:ct[mt+1]||null})}return ce.sort((lt,ct)=>O(lt.from,ct.from)||O(lt.to,ct.to))},P=v=>{const ce=[];return oe(v).forEach(Je=>{const it=d(Je);it&&!ce.includes(it)&&ce.push(it)}),ce.sort()},K=v=>a==="range"?k(v):a==="range-multiple"?g(v):a==="multiple"?P(v):d(v),ee=()=>{var v;return d(o((v=n.min)!=null?v:n.minDate))},Ce=()=>{var v;return d(o((v=n.max)!=null?v:n.maxDate))},E=()=>o(n.locale)||void 0,p=()=>{var ce,Je;const v=Number(o((Je=(ce=n.firstDayOfWeek)!=null?ce:n.weekStart)!=null?Je:1));return Number.isFinite(v)?(v%7+7)%7:1},A=()=>{var Je;const v=a==="range"||a==="range-multiple"?2:1,ce=Number((Je=o(n.monthsToShow))!=null?Je:v);return Math.max(1,Math.min(4,Number.isFinite(ce)?ce:v))},L=()=>{const v=ee(),ce=Ce();let Je=d(o(n.defaultMonth))||re();return v&&Je<v&&(Je=v),ce&&Je>ce&&(Je=ce),Je||v||ce||re()},ae=()=>o(n.confirm)?We:Xe,ke=v=>{const ce=se(v);return ce?{date:v,value:v,year:ce.getFullYear(),month:ce.getMonth()+1,day:ce.getDate(),weekday:ce.getDay(),today:ue(v,re())}:{date:v,value:v}},Te=(v,ce)=>v==null?!1:Array.isArray(v)?v.some(Je=>d(Je)===ce):v instanceof Set?v.has(ce):typeof v=="function"?!!v(ce,ke(ce)):typeof v=="string"||v instanceof Date||typeof v=="number"?d(v)===ce:!1,ze=v=>{var Yt,ln,nn,An,Sn,mn,Tn,qn,Yn,Ls,js,Hs,Ws;if(!v)return!1;const ce=ee(),Je=Ce();if(ce&&v<ce||Je&&v>Je)return!1;const it=o((ln=(Yt=n.options)!=null?Yt:n.enableDates)!=null?ln:n.allowedDates);if(it!=null&&!Te(it,v))return!1;const lt=o((An=(nn=n.disableDates)!=null?nn:n.disabledDates)!=null?An:n.notAllowedDates);if(lt!=null&&Te(lt,v))return!1;const ct=(Sn=se(v))==null?void 0:Sn.getDay();if(Array.isArray(o((mn=n.allowedWeekdays)!=null?mn:n.weekdays))&&ct!=null&&!o((Tn=n.allowedWeekdays)!=null?Tn:n.weekdays).map(Es=>Number(Es)).includes(ct)||o(n.weekdaysOnly)&&(ct===0||ct===6)||o(n.weekendsOnly)&&ct!=null&&ct!==0&&ct!==6)return!1;const mt=ae(),Jt=a==="range"?mt!=null&&mt.from&&!(mt!=null&&mt.to)?mt:null:a==="range-multiple"&&Array.isArray(mt)&&mt.length&&(qn=mt[mt.length-1])!=null&&qn.from&&!((Yn=mt[mt.length-1])!=null&&Yn.to)?mt[mt.length-1]:null;if(Jt!=null&&Jt.from){const Is=Math.abs(Y(Jt.from,v)),Es=Number(o((js=(Ls=n.minRange)!=null?Ls:n.minDays)!=null?js:n.minNights)),Us=Number(o((Ws=(Hs=n.maxRange)!=null?Hs:n.maxDays)!=null?Ws:n.maxNights));if(Number.isFinite(Es)&&Is<Es||Number.isFinite(Us)&&Is>Us)return!1}return!0},V=v=>{var it,lt;if(!v)return"";const ce=se(v);return!ce||String(o((lt=(it=n.displayMask)!=null?it:n.mask)!=null?lt:"")||"").toLowerCase()==="iso"||o(n.isoDisplay)===!0?v:new Intl.DateTimeFormat(E(),{year:"numeric",month:"short",day:"2-digit"}).format(ce)},H=(v,ce=w)=>{if(a==="range-multiple")return!Array.isArray(v)||!v.length?"":v.length>2&&o(n.compactMultiple)!==!1?`${v.length} ${o(n.multipleRangeLabel)||"intervalli selezionati"}`:v.map(lt=>{const ct=lt!=null&<.from?V(lt.from):"",mt=lt!=null&<.to?V(lt.to):"";return ct&&mt?`${ct} -> ${mt}`:ct||mt||""}).filter(Boolean).join("; ");if(a==="multiple")return!Array.isArray(v)||!v.length?"":v.length>3&&o(n.compactMultiple)!==!1?`${v.length} ${o(n.multipleLabel)||"date selezionate"}`:v.map(V).join(", ");if(a==="range"){const lt=v!=null&&v.from?V(v.from):"",ct=v!=null&&v.to?V(v.to):"";return lt&&ct?`${lt} -> ${ct}`:lt||ct||""}const Je=V(v);if(!U())return Je;const it=rt(ce);return[Je,it].filter(Boolean).join(" \u2022 ")},te=v=>(String(v||"").match(/\d{4}-\d{1,2}-\d{1,2}|\d{1,2}[\/.\-]\d{1,2}[\/.\-]\d{2,4}/g)||[]).map(d).filter(Boolean),De=v=>{if(v==null||v==="")return a==="multiple"||a==="range-multiple"?[]:a==="range"?{from:null,to:null}:null;const ce=te(v);if(a==="range-multiple"){const Je=[];for(let it=0;it<ce.length;it+=2)ce[it]&&Je.push({from:ce[it],to:ce[it+1]||null});return Je}return a==="multiple"?ce:a==="range"?{from:ce[0]||null,to:ce[1]||null}:ce[0]||d(v)},je=()=>a==="multiple"||a==="range-multiple"?[]:a==="range"?{from:null,to:null}:null,_e=(v,ce=null)=>{var mt;if(!U())return null;const Je=W(),it=o(n.timeValue),lt=v!=null?v:it,ct=kn(lt,Je);return Ut((mt=ct!=null?ct:ce)!=null?mt:null)},Me=()=>o(n.confirm)?ie:w,Ie=(v=Xe,ce=w)=>a==="single"&&U()?ji(v||null,ce,W()):j(v),Ye=(v=Xe,ce=w)=>JSON.stringify(Ie(v,ce)),rt=v=>ho(v,W());let Xe=K(N),We=y(Xe),w=_e(N,kn(o(n.timeValue),W())),ie=Ut(w),$e=null,F=null,f=be(a==="range"?(Xe==null?void 0:Xe.from)||(Xe==null?void 0:Xe.to)||L():a==="range-multiple"?((qe=Xe==null?void 0:Xe[Xe.length-1])==null?void 0:qe.from)||((pt=Xe==null?void 0:Xe[Xe.length-1])==null?void 0:pt.to)||L():a==="multiple"?Xe[0]||L():Xe||L()),r=null,x=null;const de=v=>{const ce=v instanceof Date?v:se(d(v));if(!ce)return-1;const Je=ce.getFullYear(),it=ce.getMonth();for(let lt=0;lt<A();lt+=1){const ct=fe(f,lt);if(ct.getFullYear()===Je&&ct.getMonth()===it)return lt}return-1},Be={...n,label:(Ft=n.label)!=null?Ft:n.placeholder},He=Be.label!=null||JSswift.ui.getSlot(c,"label")!=null,Se=a==="range"?"Seleziona andata e ritorno":a==="range-multiple"?"Seleziona intervalli":a==="multiple"?"Seleziona date":"Seleziona data",Oe=i?null:_.input({class:Z(["cms-input","cms-date-display",S,ye(n.manualInput,"is-manual"),n.inputClass]),type:"text",autocomplete:"off",placeholder:He?"":(Gt=n.placeholder)!=null?Gt:Se,readOnly:!o(n.manualInput),disabled:!!o(n.disabled),value:H(Xe,w)}),at=_.div({style:{display:"contents"}}),nt=i?null:_.div({class:"cms-date-control",style:{display:"contents"}},Oe,at),Ze=i?null:Ae.FormField({...Be,iconRight:(tn=n.iconRight)!=null?tn:"calendar_month",control:nt,getValue:()=>Oe.value,onClear:()=>{o(n.disabled)||o(n.readonly)||(Rt(je(),null),r&&dn())},onFocus:()=>Oe.focus()}),wt=(v,ce={})=>{var lt,ct;const Je=ce.focusIso||(a==="range"?(v==null?void 0:v.from)||(v==null?void 0:v.to)||L():a==="range-multiple"?((lt=v==null?void 0:v[v.length-1])==null?void 0:lt.from)||((ct=v==null?void 0:v[v.length-1])==null?void 0:ct.to)||L():a==="multiple"?(v==null?void 0:v[0])||L():v||L());let it=be(Je);if(ce.preserveMonthOffset){const mt=Number.isInteger(ce.visibleMonthOffset)?ce.visibleMonthOffset:de(ce.anchorIso||ce.focusIso||Je);mt>0&&(it=fe(it,-mt))}f=it},Nt=()=>{at.replaceChildren();const v=o(n.name);if(!v)return;const ce=(lt,ct)=>{at.appendChild(_.input({type:"hidden",name:lt,value:ct!=null?ct:""}))},Je=Xe;if(a==="single"){ce(v,Ie(Je,w));return}if(a==="range"){ce(o(n.nameFrom)||`${v}_from`,(Je==null?void 0:Je.from)||""),ce(o(n.nameTo)||`${v}_to`,(Je==null?void 0:Je.to)||"");return}if(a==="range-multiple"){const lt=Array.isArray(Je)?Je:[],ct=/\[\]$/.test(o(n.nameFrom)||"")?o(n.nameFrom):`${o(n.nameFrom)||`${v}_from`}[]`,mt=/\[\]$/.test(o(n.nameTo)||"")?o(n.nameTo):`${o(n.nameTo)||`${v}_to`}[]`;lt.forEach(Jt=>{ce(ct,(Jt==null?void 0:Jt.from)||""),ce(mt,(Jt==null?void 0:Jt.to)||"")});return}const it=/\[\]$/.test(v)?v:`${v}[]`;(Array.isArray(Je)?Je:[]).forEach(lt=>ce(it,lt))},Et=()=>{var v;i||(Oe.readOnly=!o(n.manualInput),Oe.disabled=!!o(n.disabled),Oe.setAttribute("aria-expanded",r?"true":"false"),Oe.value=H(Xe,w),Nt(),(v=Ze==null?void 0:Ze._refresh)==null||v.call(Ze))},Rt=(v,ce,Je={})=>{var Jt,Yt,ln;const it=K(v),lt=U()?Ut((Jt=kn(Je.timeValue!=null?Je.timeValue:Je.preserveTime?Me():v,W()))!=null?Jt:Je.preserveTime?Me():null):null,ct=Ye(Xe,w);Xe=y(it),We=y(it),U()&&(w=Ut(lt),ie=Ut(lt)),$e=null,wt(it,Je),Et(),rn(),M&&Je.fromModel!==!0&&M.set(Ie(it,lt));const mt=Ye(it,lt);if(Je.emit!==!1&&mt!==ct){const nn=Ie(it,lt);(Yt=n.onInput)==null||Yt.call(n,nn,ce),(ln=n.onChange)==null||ln.call(n,nn,ce)}return it},Mt=(v,ce,Je={})=>{var mt,Jt;if(!U())return null;const it=Ut(kn(v,W()));if(o(n.confirm)&&Je.commit!==!0)return ie=it,rn(),it;const lt=Ye(Xe,w);w=Ut(it),ie=Ut(it),Et(),rn(),M&&Je.fromModel!==!0&&M.set(Ie(Xe,it));const ct=Ye(Xe,it);if(Je.emit!==!1&&ct!==lt){const Yt=Ie(Xe,it);(mt=n.onInput)==null||mt.call(n,Yt,ce),(Jt=n.onChange)==null||Jt.call(n,Yt,ce)}return it},vt=(v,ce,Je={})=>{if(o(n.confirm)){We=y(K(v)),U()&&(Je.timeValue!=null||Je.preserveTime)&&(ie=Ut(kn(Je.timeValue!=null?Je.timeValue:Me(),W()))),$e=null,wt(We,Je),rn();return}Rt(v,ce,Je)},Dt=()=>{const v=ae();if(a==="range")return!(v!=null&&v.from)||v!=null&&v.to||!$e?v:O(v.from,$e)<=0?{from:v.from,to:$e}:{from:$e,to:v.from};if(a==="range-multiple"){const ce=Array.isArray(v)&&v.length?v[v.length-1]:null;return!(ce!=null&&ce.from)||ce!=null&&ce.to||!$e?ce:O(ce.from,$e)<=0?{from:ce.from,to:$e}:{from:$e,to:ce.from}}return v},ft=()=>{if(a==="range"){const v=Dt();return v!=null&&v.from?[v]:[]}if(a==="range-multiple"){const v=Array.isArray(ae())?ae():[];if(!v.length)return[];const ce=Dt();return ce!=null&&ce.from?[...v.slice(0,-1),ce]:v}return[]},Ht=v=>{const ce=ae();return a==="multiple"?ce.includes(v):a==="range-multiple"?Array.isArray(ce)&&ce.some(Je=>ue(Je==null?void 0:Je.from,v)||ue(Je==null?void 0:Je.to,v)):a==="range"?ue(ce==null?void 0:ce.from,v)||ue(ce==null?void 0:ce.to,v):ue(ce,v)},qt=v=>a!=="range"&&a!=="range-multiple"?!1:ft().some(ce=>(ce==null?void 0:ce.from)&&(ce==null?void 0:ce.to)&&v>=ce.from&&v<=ce.to),Xt=(v,ce={})=>{const Je=ae(),it=a==="range"?Je:a==="range-multiple"&&Array.isArray(Je)&&Je.length?Je[Je.length-1]:null;!(it!=null&&it.from)||it!=null&&it.to||$e===v||($e=v,ce.render!==!1&&rn())},Ot=()=>i||o(n.confirm)||n.closeOnSelect===!1?!1:a==="multiple"||a==="range-multiple"?!!n.closeOnSelect:!0,Qt=(v,ce,Je={})=>{var lt;if(!ze(v)||o(n.disabled)||o(n.readonly))return;const it={focusIso:v,anchorIso:v,preserveTime:U(),timeValue:Me(),preserveMonthOffset:!!r&&A()>1,visibleMonthOffset:Number.isInteger(Je.visibleMonthOffset)?Je.visibleMonthOffset:null};if(a==="multiple"){const ct=P(ae()),mt=ct.includes(v)?ct.filter(Jt=>Jt!==v):[...ct,v];vt(mt.sort(),ce,it),Ot()&&dn();return}if(a==="range"){const ct=y(ae());let mt;!ct.from||ct.from&&ct.to?mt={from:v,to:null}:O(v,ct.from)<0?mt={from:v,to:ct.from}:mt={from:ct.from,to:v},vt(mt,ce,it),mt.to&&Ot()&&dn();return}if(a==="range-multiple"){const ct=g(ae()),mt=ct.length?ct[ct.length-1]:null;let Jt;!(mt!=null&&mt.from)||mt!=null&&mt.to?Jt=[...ct,{from:v,to:null}]:O(v,mt.from)<0?Jt=[...ct.slice(0,-1),{from:v,to:mt.from}]:Jt=[...ct.slice(0,-1),{from:mt.from,to:v}],vt(Jt,ce,it),(lt=Jt[Jt.length-1])!=null&<.to&&Ot()&&dn();return}vt(v,ce,it),Ot()&&dn()},cn=()=>{F=null,Rt(je(),null,{timeValue:null})},un=()=>{const v=re();if(!ze(v)){wt(v),rn();return}if(a==="range"){const ce=le(v,1),Je=ce&&ze(ce)?{from:v,to:ce}:{from:v,to:null};vt(Je,null);return}if(a==="range-multiple"){const ce=le(v,1),Je=ce&&ze(ce)?[{from:v,to:ce}]:[{from:v,to:null}];vt(Je,null);return}if(a==="multiple"){vt([v],null);return}vt(v,null,{preserveTime:U(),timeValue:Me()})},Zt=(v={})=>{Qo(x,v)},pn=()=>{if(!U())return;const v=go(x);Mt(new Date,null,{commit:!o(n.confirm)}),Zt({scrollState:v}),!o(n.confirm)&&n.closeOnSelect===!0&&dn()},en=()=>{o(n.confirm)&&(Rt(We,null,{timeValue:ie,preserveTime:!0}),n.closeOnSelect!==!1&&dn())},rn=()=>{var fi,mi,pi,hi,gi,yi,bi,wi,vi,Si,Ci,xi,_i,ki,Ni,Ai,Li,Ii,Ei;if(!x)return;const v=E(),ce=new Intl.DateTimeFormat(v,{month:"long",year:"numeric"}),Je=new Intl.DateTimeFormat(v,{weekday:"short"}),it=Array.from({length:7},(Lt,Vt)=>{const Ln=(p()+Vt)%7;return Je.format(new Date(2024,0,7+Ln))}),lt=ae(),ct=Lt=>{let Vt=JSswift.ui.renderSlot(c,"point",Lt,null);return Vt==null&&(Vt=JSswift.ui.renderSlot(c,"dayPoint",Lt,null)),Vt==null&&n.pointIcon!=null&&(Lt.selected||Lt.inRange||Lt.today)&&(Vt=typeof n.pointIcon=="string"?Ae.Icon({name:n.pointIcon,size:10}):JSswift.ui.slot(n.pointIcon,Lt)),T(null,"default",Lt,Vt)},mt=(Lt,Vt)=>{const Ln=Lt.getFullYear(),Gs=Lt.getMonth(),Ks=new Date(Ln,Gs,1),_o=(Ks.getDay()-p()+7)%7,$o=new Date(Ln,Gs,1-_o),ko=_.div({class:"cms-date-month"});ko.appendChild(_.div({class:"cms-date-month-title"},ce.format(Ks)));const zi=_.div({class:"cms-date-weekdays"});it.forEach(qs=>zi.appendChild(_.div({class:"cms-date-weekday"},qs))),ko.appendChild(zi);const Pi=_.div({class:"cms-date-grid"});for(let qs=0;qs<42;qs+=1){const Vo=new Date($o.getFullYear(),$o.getMonth(),$o.getDate()+qs),Cn=q(Vo),Ti=Vo.getMonth()===Gs,Ji=Ht(Cn),Ri=qt(Cn),Mi=(a==="range"||a==="range-multiple")&&ft().some(bn=>ue(bn==null?void 0:bn.from,Cn)),Oi=(a==="range"||a==="range-multiple")&&ft().some(bn=>ue(bn==null?void 0:bn.to,Cn)),Bo=!ze(Cn),jo={...ke(Cn),selected:Ji,inRange:Ri,rangeStart:Mi,rangeEnd:Oi,disabled:Bo,outside:!Ti,value:lt,select:()=>Qt(Cn,null,{visibleMonthOffset:Vt})},Ho=ct(jo),dl=JSswift.ui.renderSlot(c,"day",jo,String(Vo.getDate())),fl=T(null,"default",jo,dl),ml=_.button({type:"button",class:Z(["cms-date-day",ye(!Ti,"is-outside"),ye(Ji,"is-selected"),ye(Ri,"is-in-range"),ye(Mi,"is-range-start"),ye(Oi,"is-range-end"),ye(Bo,"is-disabled"),ye(ue(Cn,re()),"is-today"),ye(Ho.length,"has-point")]),disabled:Bo,onMouseDown:bn=>{bn.button===0&&(F=Cn,bn.preventDefault(),Qt(Cn,bn,{visibleMonthOffset:Vt}))},onClick:bn=>{if(F!=null&&bn.detail!==0){F=null;return}F=null,Qt(Cn,bn,{visibleMonthOffset:Vt})},onMouseEnter:()=>Xt(Cn),onFocus:()=>Xt(Cn,{render:!1})},_.span({class:"cms-date-day-label"},...fl),Ho.length?_.span({class:"cms-date-day-point"},...Ho):null);Pi.appendChild(ml)}return ko.appendChild(Pi),ko},Jt=ee(),Yt=Ce(),ln=[f.getFullYear(),(fi=se(re()))==null?void 0:fi.getFullYear(),(mi=se(Jt))==null?void 0:mi.getFullYear(),(pi=se(Yt))==null?void 0:pi.getFullYear(),(hi=se(o(n.defaultMonth)))==null?void 0:hi.getFullYear()];a==="range"?ln.push((gi=se(lt==null?void 0:lt.from))==null?void 0:gi.getFullYear(),(yi=se(lt==null?void 0:lt.to))==null?void 0:yi.getFullYear()):a==="range-multiple"?lt.forEach(Lt=>{var Vt,Ln;ln.push((Vt=se(Lt==null?void 0:Lt.from))==null?void 0:Vt.getFullYear(),(Ln=se(Lt==null?void 0:Lt.to))==null?void 0:Ln.getFullYear())}):a==="multiple"?lt.forEach(Lt=>{var Vt;return ln.push((Vt=se(Lt))==null?void 0:Vt.getFullYear())}):ln.push((bi=se(lt))==null?void 0:bi.getFullYear());const nn=ln.filter(Lt=>Number.isFinite(Lt)),An=(nn.length?Math.min(...nn):f.getFullYear())-100,Sn=(nn.length?Math.max(...nn):f.getFullYear())+50,mn=Number(o((Si=(vi=n.yearStart)!=null?vi:Jt?(wi=se(Jt))==null?void 0:wi.getFullYear():null)!=null?Si:An)),Tn=Number(o((_i=(xi=n.yearEnd)!=null?xi:Yt?(Ci=se(Yt))==null?void 0:Ci.getFullYear():null)!=null?_i:Sn)),qn=_.select({class:"cms-date-select",value:String(f.getMonth()),onChange:Lt=>{var Vt;f=new Date(f.getFullYear(),Number(Lt.currentTarget.value),1),(Vt=n.onNavigate)==null||Vt.call(n,{month:f.getMonth()+1,year:f.getFullYear()}),rn()}},...Array.from({length:12},(Lt,Vt)=>xs({value:String(Vt)},new Intl.DateTimeFormat(v,{month:"long"}).format(new Date(2024,Vt,1))))),Yn=_.select({class:"cms-date-select cms-date-select-year",value:String(f.getFullYear()),onChange:Lt=>{var Vt;f=new Date(Number(Lt.currentTarget.value),f.getMonth(),1),(Vt=n.onNavigate)==null||Vt.call(n,{month:f.getMonth()+1,year:f.getFullYear()}),rn()}},...Array.from({length:Math.max(1,Tn-mn+1)},(Lt,Vt)=>{const Ln=mn+Vt;return xs({value:String(Ln)},String(Ln))})),Ls=_.div({class:"cms-date-header"},_.button({type:"button",class:"cms-date-nav",onClick:()=>{var Lt;f=fe(f,-1),(Lt=n.onNavigate)==null||Lt.call(n,{month:f.getMonth()+1,year:f.getFullYear()}),rn()}},Ae.Icon({name:"chevron_left",size:16})),_.div({class:"cms-date-header-center"},qn,Yn),_.button({type:"button",class:"cms-date-nav",onClick:()=>{var Lt;f=fe(f,1),(Lt=n.onNavigate)==null||Lt.call(n,{month:f.getMonth()+1,year:f.getFullYear()}),rn()}},Ae.Icon({name:"chevron_right",size:16}))),js=_.div({class:"cms-date-shortcuts"}),Hs=o((ki=n.shortcuts)!=null?ki:n.presets)||[];Hs.forEach((Lt,Vt)=>{var Ks,_o;if(!Lt)return;const Ln=typeof Lt.value=="function"?Lt.value({today:re()}):Lt.value,Gs=(_o=(Ks=Lt.label)!=null?Ks:Lt.text)!=null?_o:`Preset ${Vt+1}`;js.appendChild(_.button({type:"button",class:"cms-date-shortcut",onClick:()=>vt(Ln,null,{preserveTime:U(),timeValue:Me()})},Gs))});const Ws=_.div({class:"cms-date-months"});for(let Lt=0;Lt<A();Lt+=1)Ws.appendChild(mt(fe(f,Lt),Lt));const Is=H(lt,Me()),Es=_.div({class:"cms-date-value"},...T(c,"value",{value:lt,displayValue:Is,mode:a,timeValue:Me()},Is||T(c,"default",{},s))),Us=_.div({class:"cms-time-header"}),il=_.div({class:"cms-time-columns-2"},_.div({class:"cms-time-column-title"},o(n.hoursLabel)||"Ore"),_.div({class:"cms-time-column-title"},o(n.minutesLabel)||"Min"));Us.appendChild(il);const ll=U()?Xo({props:{min:o((Ni=n.timeMin)!=null?Ni:n.minTime),max:o((Ai=n.timeMax)!=null?Ai:n.maxTime),use12h:o((Ii=(Li=n.time12h)!=null?Li:n.use12h)!=null?Ii:n.ampm),hoursLabel:o(n.timeHoursLabel)||"Ore",minutesLabel:o(n.timeMinutesLabel)||"Min",secondsLabel:o(n.timeSecondsLabel)||"Sec"},slots:c,slotPrefix:"time",value:Me(),withSeconds:!1,minuteStep:1,secondStep:B(),disabled:!!o(n.disabled),readonly:!!o(n.readonly),embedded:!0,pointIcon:o(n.timePointIcon),shortcuts:o((Ei=n.timeShortcuts)!=null?Ei:n.timePresets),onSelect:Lt=>{const Vt=go(x);Mt(Lt,null),Zt({scrollState:Vt})}}):null,rl=_.div({class:"cms-date-footer-info"},Es),al=_.div({class:Z(["cms-date-footer",ye(U(),"has-time")])},rl,_.div({class:"cms-date-actions"},_.button({type:"button",class:"cms-date-action",onClick:un},o(n.todayLabel)||"Oggi"),o(n.clearable)!==!1?_.button({type:"button",class:"cms-date-action",onClick:cn},o(n.clearLabel)||"Reset"):null,o(n.confirm)?_.button({type:"button",class:"cms-date-action is-primary",onClick:en},o(n.applyLabel)||"Applica"):null)),cl=_.div(_.button({type:"button",class:"cms-date-action cms-w-lg",onClick:pn},o(n.nowLabel)||"Ora")),ul=U()?_.div({class:"cms-date-time"},Us,ll,cl):null;x.replaceChildren(_.div({class:"cms-date-panel-root",onKeydown:Lt=>{var Vt;Lt.key==="Escape"&&(Lt.preventDefault(),i?(Vt=n.onEscape)==null||Vt.call(n,Lt):dn())}},Ls,Hs.length?js:null,_.div({class:"cms-data-time"},Ws,ul),al))};function Vn(){var v,ce,Je,it;return r||o(n.disabled)||o(n.readonly)||(We=y(Xe),ie=Ut(w),$e=null,F=null,wt(We),r=JSswift.overlay.open(({close:lt})=>{var Jt;const ct=a==="range"||a==="range-multiple"?2:1,mt=Number((Jt=o(n.monthsToShow))!=null?Jt:ct);return x=_.div({class:Kt(["cms-date-panel",o(S),ye(mt>1,"multi-month"),n.panelClass])}),rn(),x},{type:"date",anchorEl:Ze._control||Oe,placement:n.placement||"bottom-start",offsetX:(v=n.offsetX)!=null?v:0,offsetY:(Je=(ce=n.offsetY)!=null?ce:n.offset)!=null?Je:8,backdrop:!1,lockScroll:!1,trapFocus:!1,closeOnOutside:n.closeOnOutside!==!1,closeOnBackdrop:!1,closeOnEsc:!0,autoFocus:!1,className:Kt(["cms-date-overlay",n.panelClass,ye(U(),"has-time")]),onClose:()=>{var lt;r=null,x=null,$e=null,Et(),(lt=n.onClose)==null||lt.call(n)}}),n.panelStyle&&Object.assign(r.panel.style,n.panelStyle),_s(r),Et(),(it=n.onOpen)==null||it.call(n)),r}function dn(){if(!r)return;F=null;const v=r;ks(v,()=>JSswift.overlay.close(v.id))}if(i){const v=a==="range"||a==="range-multiple"?2:1,ce=Number((sn=o(n.monthsToShow))!=null?sn:v);x=_.div({class:Kt(["cms-date-panel","cms-date-calendar",o(S),ye(ce>1,"multi-month"),n.panelClass,n.class]),style:n.style})}return i||Oe.addEventListener("focus",v=>{var ce;(ce=n.onFocus)==null||ce.call(n,v),n.openOnFocus!==!1&&Vn()}),i||Oe.addEventListener("click",v=>{var ce;(ce=n.onClick)==null||ce.call(n,v),Vn()}),i||Oe.addEventListener("keydown",v=>{if(v.key==="Escape"){r&&(v.preventDefault(),dn());return}(v.key==="ArrowDown"||v.key==="Enter"||v.key===" ")&&(v.preventDefault(),Vn()),(v.key==="Backspace"||v.key==="Delete")&&!o(n.manualInput)&&o(n.clearable)!==!1&&(v.preventDefault(),cn())}),!i&&o(n.manualInput)?(Oe.addEventListener("input",v=>{var ce;(ce=n.onTyping)==null||ce.call(n,Oe.value,v)}),Oe.addEventListener("change",v=>{const ce=De(Oe.value);Rt(ce,v,{timeValue:kn(Oe.value,W()),preserveTime:!kn(Oe.value,W())})}),Oe.addEventListener("blur",v=>{var Je;(Je=n.onBlur)==null||Je.call(n,v);const ce=De(Oe.value);Oe.value===""?cn():Rt(ce,v,{timeValue:kn(Oe.value,W()),preserveTime:!kn(Oe.value,W())})})):i||Oe.addEventListener("blur",v=>{var ce;return(ce=n.onBlur)==null?void 0:ce.call(n,v)}),M&&M.watch(v=>{const ce=K(v),Je=_e(v);Ye(ce,Je)!==Ye(Xe,w)&&(Xe=ce,We=y(Xe),w=Ut(Je),ie=Ut(Je),$e=null,wt(Xe),Et(),rn())},i?"UI.Calendar:watch":"UI.Datepicker:watch"),JSswift.reactive.effect(()=>{!M&&n.value!=null?(Xe=K(o(n.value)),We=y(Xe),w=_e(o(n.value)),ie=Ut(w)):U()&&n.timeValue!=null&&(w=_e(o(n.timeValue)),ie=Ut(w)),Et(),rn(),r&&o(n.disabled)&&dn()},i?"UI.Calendar:render":"UI.Datepicker:render"),i?(x._calendar=x,x._date=x,x._getValue=()=>Ie(Xe,w),x._setValue=v=>Rt(v,null,{emit:!1,timeValue:_e(v)}),x._clear=cn,x._select=v=>{const ce=d(v);ce&&Qt(ce,null)},x._time=()=>Ut(w),x):(Ze._input=Oe,Ze._date=Oe,Ze._open=Vn,Ze._close=dn,Ze._getValue=()=>Ie(Xe,w),Ze._setValue=v=>Rt(v,null,{emit:!1,timeValue:_e(v)}),Ze._time=()=>Ut(w),Ze._panel=()=>(r==null?void 0:r.panel)||null,Ze)};Ae.Datepicker=(...t)=>Zo(t),Ae.Calendar=(...t)=>Zo(t,{calendar:!0}),Ae.Date=Ae.Datepicker,JSswift.ui.Datepicker=Ae.Datepicker,JSswift.ui.Calendar=Ae.Calendar,JSswift.ui.Date=Ae.Date,Ae.Time=(...t)=>{var X,d,k;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=xt(e.size,()=>{const g=String(o(e.size)||"").toLowerCase();return["xs","sm","md","lg","xl"].includes(g)?`cms-size-${g}`:""}),c=()=>{var P,K,ee,Ce,E;const g=Kn(kn(b?b.get():(P=o(e.value))!=null?P:M,{withSeconds:!0}),{withSeconds:!0});return{withSeconds:!!o((K=e.withSeconds)!=null?K:e.showSeconds)||/:\d{2}:\d{2}$/.test(g),min:o((ee=e.min)!=null?ee:e.minTime),max:o((Ce=e.max)!=null?Ce:e.maxTime),use12h:o((E=e.use12h)!=null?E:e.ampm)}},S=()=>{var P;const g=Number(o((P=e.minuteStep)!=null?P:1));return Math.max(1,Math.min(30,Number.isFinite(g)?g:5))},u=()=>{var P;const g=Number(o((P=e.secondStep)!=null?P:1));return Math.max(1,Math.min(30,Number.isFinite(g)?g:5))},a=e.model||(Ct(e.value)||ht(e.value)?e.value:null),b=an(a,"UI.Time:model"),M=b?b.get():o(e.value),N=g=>kn(g,c()),C=g=>ho(g,c()),z=g=>Kn(g,c()),U=g=>JSON.stringify(z(g));let W=Ut(N(M)),ge=Ut(W),B=null,ne=null;const he={...e,label:(X=e.label)!=null?X:e.placeholder},q=he.label!=null||JSswift.ui.getSlot(s,"label")!=null,se=_.input({class:Z(["cms-input","cms-time-display",i,ye(e.manualInput,"is-manual"),e.inputClass]),type:"text",autocomplete:"off",placeholder:q?"":(d=e.placeholder)!=null?d:"Seleziona orario",readOnly:!o(e.manualInput),disabled:!!o(e.disabled),value:C(W)});se.setAttribute("aria-haspopup","dialog");const le=_.div({style:{display:"contents"}}),fe=_.div({class:"cms-time-control",style:{display:"contents"}},se,le),be=Ae.FormField({...he,iconRight:(k=e.iconRight)!=null?k:"schedule",control:fe,getValue:()=>se.value,onClear:()=>{o(e.disabled)||o(e.readonly)||(Y(null,null,{commit:!0}),B&&j())},onFocus:()=>se.focus()}),re=()=>o(e.confirm)?ge:W,ue=()=>{le.replaceChildren();const g=o(e.name);g&&le.appendChild(_.input({type:"hidden",name:g,value:z(W)}))},O=()=>{var g;se.readOnly=!o(e.manualInput),se.disabled=!!o(e.disabled),se.setAttribute("aria-expanded",B?"true":"false"),se.value=C(W),ue(),(g=be._refresh)==null||g.call(be)},Y=(g,P,K={})=>{var p,A;const ee=Ut(N(g));if(o(e.confirm)&&K.commit!==!0)return ge=Ut(ee),m(),ee;const Ce=U(W);W=Ut(ee),ge=Ut(ee),O(),m(),b&&K.fromModel!==!0&&b.set(z(ee));const E=U(ee);if(K.emit!==!1&&E!==Ce){const L=z(ee);(p=e.onInput)==null||p.call(e,L,P),(A=e.onChange)==null||A.call(e,L,P)}return ee},oe=g=>o(e.confirm)||e.closeOnSelect!==!0?!1:c().withSeconds?(g==null?void 0:g.part)==="second":(g==null?void 0:g.part)==="minute",we=(g={})=>{Qo(ne,g)},R=()=>{const g=go(ne);Y(new Date,null,{commit:!o(e.confirm)}),we({scrollState:g}),!o(e.confirm)&&e.closeOnSelect===!0&&j()},h=()=>{o(e.confirm)&&(Y(ge,null,{commit:!0}),e.closeOnSelect!==!1&&j())},m=()=>{var A,L,ae,ke;if(!ne)return;const g=re(),P=C(g),K=_.div({class:"cms-time-header"}),ee=_.div({class:"cms-time-columns"},_.div({class:"cms-time-column-title"},o(e.hoursLabel)||"Ore"),_.div({class:"cms-time-column-title"},o(e.minutesLabel)||"Min")),Ce=c().withSeconds;Ce&&ee.appendChild(_.div({class:"cms-time-column-title"},o(e.secondsLabel)||"Sec")),K.appendChild(ee);const E=Xo({props:{min:o((A=e.min)!=null?A:e.minTime),max:o((L=e.max)!=null?L:e.maxTime),use12h:o((ae=e.use12h)!=null?ae:e.ampm),hoursLabel:o(e.hoursLabel)||"Ore",minutesLabel:o(e.minutesLabel)||"Min",secondsLabel:o(e.secondsLabel)||"Sec"},slots:s,value:g,withSeconds:Ce,minuteStep:S(),secondStep:u(),disabled:!!o(e.disabled),readonly:!!o(e.readonly),pointIcon:o(e.pointIcon),shortcuts:o((ke=e.shortcuts)!=null?ke:e.presets),onSelect:(Te,ze)=>{const V=go(ne);Y(Te,null),we({scrollState:V}),oe(ze)&&j()}}),p=_.div({class:"cms-time-footer"},_.div({class:"cms-time-value"},...T(s,"value",{value:g,displayValue:P},P||T(s,"default",{},n))),_.div({class:"cms-time-actions"},_.button({type:"button",class:"cms-time-action",onClick:R},o(e.nowLabel)||"Ora"),o(e.clearable)!==!1?_.button({type:"button",class:"cms-time-action",onClick:()=>Y(null,null,{commit:!o(e.confirm)})},o(e.clearLabel)||"Reset"):null,o(e.confirm)?_.button({type:"button",class:"cms-time-action is-primary",onClick:h},o(e.applyLabel)||"Applica"):null));ne.replaceChildren(_.div({class:"cms-time-panel-root",onKeydown:Te=>{Te.key==="Escape"&&(Te.preventDefault(),j())}},K,E,p))};function y(){var g,P,K,ee;return B||o(e.disabled)||o(e.readonly)||(ge=Ut(W),B=JSswift.overlay.open(()=>(ne=_.div({class:Kt(["cms-time-panel",o(i),e.panelClass])}),m(),ne),{type:"time",anchorEl:be._control||se,placement:e.placement||"bottom-start",offsetX:(g=e.offsetX)!=null?g:0,offsetY:(K=(P=e.offsetY)!=null?P:e.offset)!=null?K:8,backdrop:!1,lockScroll:!1,trapFocus:!1,closeOnOutside:e.closeOnOutside!==!1,closeOnBackdrop:!1,closeOnEsc:!0,autoFocus:!1,className:Kt(["cms-time-overlay",e.panelClass]),onClose:()=>{var Ce;B=null,ne=null,O(),(Ce=e.onClose)==null||Ce.call(e)}}),e.panelStyle&&Object.assign(B.panel.style,e.panelStyle),_s(B),we(),O(),(ee=e.onOpen)==null||ee.call(e)),B}function j(){if(!B)return;const g=B;ks(g,()=>JSswift.overlay.close(g.id))}return se.addEventListener("focus",g=>{var P;(P=e.onFocus)==null||P.call(e,g),e.openOnFocus!==!1&&y()}),se.addEventListener("click",g=>{var P;(P=e.onClick)==null||P.call(e,g),y()}),se.addEventListener("keydown",g=>{if(g.key==="Escape"){B&&(g.preventDefault(),j());return}(g.key==="ArrowDown"||g.key==="Enter"||g.key===" ")&&(g.preventDefault(),y()),(g.key==="Backspace"||g.key==="Delete")&&!o(e.manualInput)&&o(e.clearable)!==!1&&(g.preventDefault(),Y(null,g,{commit:!0}))}),o(e.manualInput)?(se.addEventListener("input",g=>{var P;return(P=e.onTyping)==null?void 0:P.call(e,se.value,g)}),se.addEventListener("change",g=>Y(se.value,g)),se.addEventListener("blur",g=>{var P;(P=e.onBlur)==null||P.call(e,g),se.value===""?Y(null,g):Y(se.value,g)})):se.addEventListener("blur",g=>{var P;return(P=e.onBlur)==null?void 0:P.call(e,g)}),b&&b.watch(g=>{const P=Ut(N(g));U(P)!==U(W)&&(W=Ut(P),ge=Ut(P),O(),m())},"UI.Time:watch"),JSswift.reactive.effect(()=>{!b&&e.value!=null&&(W=Ut(N(o(e.value))),ge=Ut(W)),O(),m(),B&&o(e.disabled)&&j()},"UI.Time:render"),be._input=se,be._time=se,be._open=y,be._close=j,be._getValue=()=>z(W),be._setValue=g=>Y(g,null,{emit:!1,commit:!0}),be._panel=()=>(B==null?void 0:B.panel)||null,be},Ae.Tabs=(...t)=>{var A,L,ae,ke,Te,ze;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=(V,H)=>!!V&&Object.prototype.hasOwnProperty.call(V,H),c=V=>String(o(V)||"horizontal").toLowerCase()==="vertical"?"vertical":"horizontal",S=V=>{const H=String(o(V)||"").toLowerCase();return H==="pills"||H==="pill"?"pills":H==="soft"||H==="card"?"soft":"line"},u=V=>{var te;const H=o(V);return H==null||H===""?null:(te=JSswift.uiColors)!=null&&te.includes(H)?`var(--cms-${H})`:String(H)},a=(V,H)=>Object.is(V,H)||V!=null&&H!=null&&V==H,b=an(e.model,"UI.Tabs:model"),M=c(e.orientation||e.orient||e.direction),N=S(e.variant||(e.pills?"pills":e.soft?"soft":"line")),C=!!o((L=(A=e.fill)!=null?A:e.navFill)!=null?L:e.stretch),z=!!o(e.wrap),U=!!o(e.disabled),W=e.id||"cms-tabs-"+Math.random().toString(36).slice(2,9),ge=o((ae=e.tabs)!=null?ae:e.items)||[],B=(Array.isArray(ge)?ge:[ge]).map((V,H)=>{var _e,Me,Ie,Ye,rt,Xe,We,w,ie,$e,F,f,r,x;if(V==null)return null;if(typeof V!="object")return{raw:V,index:H,value:V,labelFallback:V,noteFallback:null,iconFallback:null,badgeFallback:null,disabled:!1,hidden:!1};const te=(Xe=(rt=(Ye=(Ie=(Me=(_e=V.value)!=null?_e:V.name)!=null?Me:V.id)!=null?Ie:V.key)!=null?Ye:V.label)!=null?rt:V.title)!=null?Xe:`tab-${H}`,De=($e=(ie=(w=(We=V.label)!=null?We:V.title)!=null?w:V.name)!=null?ie:V.value)!=null?$e:`Tab ${H+1}`,je=i(V,"badge")?V.badge:i(V,"counter")?V.counter:null;return{...V,raw:V,index:H,value:te,labelFallback:De,noteFallback:(r=(f=(F=V.note)!=null?F:V.subtitle)!=null?f:V.description)!=null?r:null,iconFallback:(x=V.icon)!=null?x:null,badgeFallback:je}}).filter(Boolean).filter(V=>V.hidden!==!0&&V.visible!==!1),ne=B.find(V=>!V.disabled)||null,he=V=>B.findIndex(H=>a(H.value,V)),q=(V,H)=>{var De;if(!B.length)return-1;let te=V;for(let je=0;je<B.length;je+=1)if(te+=H,te<0?te=B.length-1:te>=B.length&&(te=0),!((De=B[te])!=null&&De.disabled))return te;return-1},se=(V,H=!1)=>{var De,je;const te=he(V);return te>=0&&!((De=B[te])!=null&&De.disabled)?B[te].value:H?(je=ne==null?void 0:ne.value)!=null?je:null:V!=null?V:null},le=se(b?b.get():i(e,"value")?o(e.value):(ke=e.defaultValue)!=null?ke:e.default,!0),[fe,be]=JSswift.reactive.signal(le),re=Z(["cms-clear-set","cms-tabs","cms-singularity",M,`variant-${N}`,ye(e.dense,"dense"),ye(C,"fill"),ye(z,"wrap"),ye(U,"disabled"),e.class]),ue=JSswift.omit(e,["tabs","items","value","defaultValue","default","model","orientation","orient","direction","variant","pills","soft","fill","navFill","stretch","wrap","dense","disabled","slots","empty","gap","tabGap","align","justify","color","state","navClass","navStyle","barClass","barStyle","tabClass","tabStyle","itemClass","itemStyle","class","style"]);ue.class=re,ue.style={...e.style||{}},e.gap!=null&&(ue.style["--cms-tabs-gap"]=gt(e.gap)),e.tabGap!=null&&(ue.style["--cms-tabs-tab-gap"]=gt(e.tabGap));const O=u((Te=e.color)!=null?Te:e.state);O&&(ue.style["--cms-tabs-accent"]=O);const Y=_.div(ue),oe=_.div({class:Z(["cms-tabs-bar",e.barClass]),style:{alignItems:e.align||(M==="vertical"?"stretch":"center"),justifyContent:e.justify||"flex-start",...e.barStyle||{}}}),we=_.div({class:Z(["cms-tabs-nav",e.navClass]),style:e.navStyle||null,role:"tablist","aria-orientation":M}),R=[],h=()=>he(fe()),m=()=>{const V=h();return V>=0?B[V]:null},y=()=>({tabs:B,value:fe(),active:fe(),activeIndex:h(),activeTab:m(),orientation:M,variant:N,select:(V,H)=>g(V,{event:H,emit:!0}),next:()=>K(),prev:()=>ee()}),j=(V,H,te)=>({...y(),tab:V,index:H,active:te,disabled:!!V.disabled,select:De=>P(H,{event:De,emit:!0})}),X=V=>{var te;const H=(te=R[V])==null?void 0:te.btn;!H||typeof H.focus!="function"||requestAnimationFrame(()=>H.focus())},d=V=>{const H=he(V);Y.dataset.value=V==null?"":String(V),Y.dataset.activeIndex=H>=0?String(H):"",R.forEach(({btn:te,item:De,tab:je,index:_e})=>{const Me=_e===H;De.classList.toggle("active",Me),De.classList.toggle("disabled",!!(je.disabled||U)),te.classList.toggle("active",Me),te.setAttribute("aria-selected",Me?"true":"false"),te.setAttribute("tabindex",Me?"0":"-1")})},k=V=>{be(V),d(V)},g=(V,H={})=>{if(U)return null;const te=he(V);return te<0?null:P(te,H)},P=(V,H={})=>{var Me,Ie;const te=B[V];if(!te||te.disabled||U)return null;const De=te.value,je=fe(),_e=!a(je,De);return k(De),b&&!a(b.get(),De)&&b.set(De),H.focus&&X(V),H.event&&((Me=te.onClick)==null||Me.call(te,De,H.event,te,V)),_e&&H.emit!==!1&&((Ie=e.onChange)==null||Ie.call(e,De,te,H.event||null,V)),te},K=()=>{const V=q(h()<0?-1:h(),1);V>=0&&P(V,{emit:!0,focus:!0})},ee=()=>{const V=h()<0?0:h(),H=q(V,-1);H>=0&&P(H,{emit:!0,focus:!0})},Ce=(V,H)=>{var f,r,x,de,Be,He;const te=H===h(),De=j(V,H,te),je=`${W}-tab-${H}`,_e=V.iconFallback!=null?typeof V.iconFallback=="string"?Ae.Icon({name:V.iconFallback,size:(x=(r=(f=V.iconSize)!=null?f:V.size)!=null?r:e.size)!=null?x:null}):V.iconFallback:null,Me=T(s,"icon",De,_e),Ie=T(null,"default",{},JSswift.ui.renderSlot(s,"label",De,V.labelFallback)),Ye=T(s,"note",De,V.noteFallback),rt=T(s,"badge",De,V.badgeFallback),Xe=_.span({class:"cms-tabs-tab-inner"},Me.length?_.span({class:"cms-tabs-tab-icon"},...Me):null,_.span({class:"cms-tabs-tab-copy"},_.span({class:"cms-tabs-tab-label"},...Ie.length?Ie:[""]),Ye.length?_.span({class:"cms-tabs-tab-note"},...Ye):null),rt.length?_.span({class:"cms-tabs-tab-badge"},...rt):null),We=T(s,"tab",{...De,tabId:je,label:Ie,icon:Me,note:Ye,badge:rt},Xe),w=Se=>{var Ze;if(V.disabled||U)return;const Oe=Se.key;if(Oe==="Enter"||Oe===" "){Se.preventDefault(),P(H,{event:Se,emit:!0});return}if(Oe==="Home"){Se.preventDefault();const wt=B.findIndex(Nt=>!Nt.disabled);wt>=0&&P(wt,{event:Se,emit:!0,focus:!0});return}if(Oe==="End"){Se.preventDefault();let wt=-1;for(let Nt=B.length-1;Nt>=0;Nt-=1)if(!((Ze=B[Nt])!=null&&Ze.disabled)){wt=Nt;break}wt>=0&&P(wt,{event:Se,emit:!0,focus:!0});return}const at=M==="vertical"?["ArrowUp"]:["ArrowLeft"],nt=M==="vertical"?["ArrowDown"]:["ArrowRight"];if(at.includes(Oe)){Se.preventDefault();const wt=q(H,-1);wt>=0&&P(wt,{event:Se,emit:!0,focus:!0});return}if(nt.includes(Oe)){Se.preventDefault();const wt=q(H,1);wt>=0&&P(wt,{event:Se,emit:!0,focus:!0})}},ie=u((de=V.color)!=null?de:V.state),$e=_.div({class:Z(["cms-tabs-item",ye(te,"active"),ye(V.disabled||U,"disabled"),e.itemClass,V.itemClass]),style:{...ie?{"--cms-tabs-item-accent":ie}:{},...e.itemStyle||{},...V.itemStyle||{}},"data-name":String(V.value)}),F=Ae.Btn({class:Z(["cms-tabs-tab",ye(te,"active"),ye(V.disabled||U,"disabled"),e.tabClass,V.tabClass||V.class]),type:"button",id:je,role:"tab",disabled:!!(V.disabled||U),"aria-selected":te?"true":"false",tabindex:te?"0":"-1",size:(He=(Be=V.size)!=null?Be:e.size)!=null?He:null,style:{...e.tabStyle||{},...V.tabStyle||{}},onClick:Se=>{P(H,{event:Se,emit:!0})},onKeydown:w},...We);return $e.appendChild(F),$e.appendChild(_.span({class:"tab-indicator"})),R[H]={tab:V,index:H,item:$e,btn:F},$e};if(B.length){const V=B.map((te,De)=>Ce(te,De)),H=JSswift.ui.renderSlot(s,"nav",{...y(),nodes:V},V);T(null,"default",{},H).forEach(te=>we.appendChild(te))}else T(s,"empty",y(),(ze=e.empty)!=null?ze:_.div({class:"cms-tabs-empty"},"Nessuna tab disponibile.")).forEach(V=>we.appendChild(V));const E=y(),p=[...T(null,"default",{},JSswift.ui.renderSlot(s,"extra",E,null)),...T(s,"default",E,n)];return oe.appendChild(we),p.length&&oe.appendChild(_.div({class:"cms-tabs-extra"},...p)),Y.appendChild(oe),k(le),b?b.watch(V=>{k(se(V,!0))},"UI.Tabs:watch"):Ke(e.value)&&bt.reactive.effect(()=>{k(se(o(e.value),!0))},"UI.Tabs:value"),Y._getValue=()=>fe(),Y._setValue=V=>g(V,{emit:!0}),Y._select=V=>g(V,{emit:!0}),Y._next=()=>K(),Y._prev=()=>ee(),Y._getTabs=()=>B.slice(),At(Y,e),Y},Ae.RouteTab=(...t)=>{var X,d,k,g,P,K,ee,Ce,E,p,A,L,ae,ke,Te;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=JSswift.router||(bt==null?void 0:bt.router)||null,c=ze=>Object.prototype.hasOwnProperty.call(e,ze),S=c("active")||c("selected"),u=ze=>{const V=String(o(ze)||"").toLowerCase();return V==="pill"||V==="pills"?"pills":V==="soft"||V==="card"?"soft":"line"},a=ze=>{var H;const V=o(ze);return V==null||V===""?null:(H=JSswift.uiColors)!=null&&H.includes(V)?`var(--cms-${V})`:String(V)},b=ze=>{if(ze==null||ze==="")return"";try{return new URL(String(ze),window.location.origin).pathname||""}catch(V){return String(ze).split(/[?#]/)[0]||""}},M=ze=>o(e.external)===!0?!0:ze?/^(mailto:|tel:|https?:\/\/|\/\/)/i.test(String(ze)):!1,N=()=>{var ze;return o((ze=e.href)!=null?ze:e.to)||"#"},C=()=>{var ze;return o((ze=e.to)!=null?ze:e.href)||""},z=()=>{try{if(i!=null&&i.current)return i.current().pathname||window.location.pathname||""}catch(ze){}return window.location.pathname||""},U=()=>{var _e,Me,Ie;const ze=C();if(!ze)return!1;const V=o((Me=(_e=e.match)!=null?_e:e.activeMatch)!=null?Me:e.routeMatch),H=String(o((Ie=e.matchMode)!=null?Ie:e.startsWith?"startsWith":e.exact?"exact":"")||"").toLowerCase(),te=z();if(typeof V=="function")return!!V({currentPath:te,to:ze,href:N(),router:i,props:e});if(V instanceof RegExp)return V.test(te);const De=b(typeof V=="string"&&!["exact","startsWith","prefix","section"].includes(V.toLowerCase())?V:ze);if(!De)return!1;const je=H||(typeof V=="string"&&["startsWith","prefix","section"].includes(V.toLowerCase())?"startsWith":"exact");return je==="startswith"||je==="prefix"||je==="section"?te===De||te.startsWith(`${De}/`):i!=null&&i.isActive?!!i.isActive(ze):te===De},W=()=>!!o(e.disabled);let ge=null;const B=()=>{var ze;return ge!=null?!!ge:S?!!o((ze=e.active)!=null?ze:e.selected):U()},ne=u(e.variant||(e.pills?"pills":e.soft?"soft":"line")),he=!o(e.color)&&o(e.state)?Bt(o(e.state)):"",q=he?`cms-state-${he}`:"",se=JSswift.omit(e,["active","selected","label","title","text","to","icon","iconRight","iconSize","note","subtitle","caption","description","badge","counter","count","aside","trailing","slots","state","color","dense","outline","flat","glossy","glow","glass","gradient","textGradient","lightShadow","shadow","rounded","radius","textColor","variant","pills","soft","block","fill","match","matchMode","activeMatch","routeMatch","exact","startsWith","external","onNavigate"]);se.href=N(),se.class=Z(["cms-route-tab","cms-clear-set","cms-singularity",`variant-${ne}`,ye((X=e.block)!=null?X:e.fill,"block"),ye(e.dense,"dense"),q,e.class]),se.style={...e.style||{}};const le=a((d=e.color)!=null?d:e.state);le&&(se.style["--cms-route-tab-accent"]=le);const fe=(g=(k=e.iconSize)!=null?k:e.size)!=null?g:null,be=(ze,V)=>{const H=o(ze);return H==null||H===!1||H===""?null:typeof H=="string"?Ae.Icon({name:H,size:fe}):JSswift.ui.slot(H,{as:V})},re=()=>({active:B(),disabled:W(),href:N(),to:C(),external:M(N()),navigate:ze=>{var te,De;if(W())return!1;const V=C();return!M(N())&&V&&(i!=null&&i.navigate)?(ze!=null&&ze.preventDefault&&ze.preventDefault(),i.navigate(V),(te=e.onNavigate)==null||te.call(e,V,ze||null),!0):((De=e.onNavigate)==null||De.call(e,V||N(),ze||null),!1)}}),ue=T(s,"icon",re(),be(e.icon,"icon")),O=T(s,"label",re(),(ee=(K=(P=e.label)!=null?P:e.title)!=null?K:e.text)!=null?ee:n),Y=T(s,"note",re(),(p=(E=(Ce=e.note)!=null?Ce:e.subtitle)!=null?E:e.caption)!=null?p:e.description),oe=T(s,"badge",re(),(L=(A=e.badge)!=null?A:e.counter)!=null?L:e.count),we=T(s,"aside",re(),(ke=(ae=e.aside)!=null?ae:e.trailing)!=null?ke:be(e.iconRight,"iconRight")),R=T(s,"default",re(),(Te=e.content)!=null?Te:e.body),h=_.span({class:"cms-route-tab-inner"},ue.length?_.span({class:"cms-route-tab-icon"},...ue):null,_.span({class:"cms-route-tab-copy"},_.span({class:"cms-route-tab-label"},...O.length?O:[C()||N()||""]),Y.length?_.span({class:"cms-route-tab-note"},...Y):null,R.length?_.span({class:"cms-route-tab-extra"},...R):null),oe.length?_.span({class:"cms-route-tab-badge"},...oe):null,we.length?_.span({class:"cms-route-tab-aside"},...we):null),m=_.a(se,h);At(m,e);const y=()=>{const ze=B(),V=W(),H=N(),te=M(H);m.classList.toggle("active",ze),m.classList.toggle("is-disabled",V),m.classList.toggle("is-external",te),ze?m.setAttribute("aria-current",String(o(e.ariaCurrent)||"page")):m.removeAttribute("aria-current"),m.setAttribute("href",H||"#"),V?(m.setAttribute("aria-disabled","true"),m.tabIndex=-1):(m.removeAttribute("aria-disabled"),!c("tabIndex")&&!c("tabindex")&&m.removeAttribute("tabindex")),C()?m.dataset.to=String(C()):delete m.dataset.to,te&&m.target==="_blank"&&!m.rel&&(m.rel="noopener noreferrer")},j=e.onClick;return m.onclick=ze=>{if(j==null||j(ze),!ze.defaultPrevented){if(W()){ze.preventDefault();return}re().navigate(ze)}},!S&&C()&&(i!=null&&i.subscribe)&&i.subscribe(()=>y()),JSswift.reactive.effect(()=>{y()},"UI.RouteTab:render"),m._isActive=()=>B(),m._setActive=ze=>(ge=ze==null?null:!!ze,y(),m),m._navigate=ze=>re().navigate(ze),m},Ae.Breadcrumbs=(...t)=>{const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=JSswift.router||(bt==null?void 0:bt.router)||null,c=an(e.model,"UI.Breadcrumbs:model"),S=xt(e.size,()=>{var Y;const O=o(e.size);return typeof O=="string"&&((Y=JSswift.uiSizes)!=null&&Y.includes(O))?`cms-size-${O}`:""}),u=xt(e.variant,()=>{const O=String(o(e.variant||(e.pills?"pills":e.soft?"soft":"line"))||"").toLowerCase();return O==="pill"||O==="pills"?"variant-pills":O==="soft"||O==="card"?"variant-soft":"variant-line"}),a=xt([e.wrap,e.nowrap],()=>o(e.wrap)===!1||o(e.nowrap)?"no-wrap":""),b=_.nav({class:Z(["cms-breadcrumbs","cms-clear-set",S,u,a,ye(e.dense,"dense"),e.class]),style:{...e.style||{}},role:"navigation","aria-label":e.ariaLabel||"Breadcrumb"}),M=_.div({class:"cms-breadcrumbs-before"}),N=_.ol({class:"cms-breadcrumbs-list"}),C=_.div({class:"cms-breadcrumbs-after"});b.appendChild(M),b.appendChild(N),b.appendChild(C);const z=O=>{var oe;const Y=o(O);return Y==null||Y===""?null:(oe=JSswift.uiColors)!=null&&oe.includes(Y)?`var(--cms-${Y})`:String(Y)},U=O=>{var oe;if(!O)return!1;if(o(O.external)===!0)return!0;const Y=o((oe=O.href)!=null?oe:O.to);return Y?/^(mailto:|tel:|https?:\/\/|\/\/)/i.test(String(Y)):!1},W=O=>O!=null&&O.nodeType&&O.cloneNode?O.cloneNode(!0):O,ge=(O,Y)=>{O.innerHTML="",Y.forEach(oe=>O.appendChild(oe))},B=(O,Y,oe,we,R=null)=>{const h=JSswift.ui.getSlot(O,Y)!=null?T(O,Y,oe,we):[];return h.length?h:R&&JSswift.ui.getSlot(O,R)!=null?T(O,R,oe,we):T(null,"default",oe,we)},ne=(O,Y,oe)=>{const we=o(O);return we==null||we===!1||we===""?null:typeof we=="string"?Ae.Icon({name:we,size:Y}):JSswift.ui.slot(we,{as:oe})},he=()=>{var R,h;const O=c?c.get():o((h=(R=e.items)!=null?R:e.value)!=null?h:e.breadcrumbs),Y=[],oe=m=>{if(!(m==null||m===!1)){if(Array.isArray(m)){m.forEach(oe);return}if(typeof m=="string"||typeof m=="number"){Y.push({label:String(m)});return}if(m!=null&&m.nodeType||typeof m=="function"){Y.push({label:m});return}Y.push(m)}},we=o(e.home);return we&&oe(we===!0?{label:"Home",to:"/",icon:"home"}:we),oe(O),!Y.length&&(n!=null&&n.length)&&n.forEach(m=>oe(m)),Y.filter(m=>!o(m==null?void 0:m.hidden))},q=O=>{const Y=O.findIndex(oe=>{var we,R;return!!o((R=(we=oe==null?void 0:oe.current)!=null?we:oe==null?void 0:oe.active)!=null?R:oe==null?void 0:oe.selected)});return Y>-1?Y:o(e.autoCurrent)===!1?-1:O.length?O.length-1:-1},se=O=>{var y,j,X,d,k,g,P;const Y=Number(o((X=(j=(y=e.max)!=null?y:e.maxItems)!=null?j:e.collapseAfter)!=null?X:e.collapse)),oe=Number.isFinite(Y)?Math.max(0,Math.trunc(Y)):0;if(!oe||oe<3||O.length<=oe)return O.map((K,ee)=>({type:"item",item:K,index:ee,key:`item-${ee}`}));let we=Number(o((k=(d=e.leadingCount)!=null?d:e.keepStart)!=null?k:1)),R=Number(o((P=(g=e.trailingCount)!=null?g:e.keepEnd)!=null?P:Math.max(1,oe-2)));if(we=Number.isFinite(we)?Math.max(1,Math.trunc(we)):1,R=Number.isFinite(R)?Math.max(1,Math.trunc(R)):Math.max(1,oe-2),we+R+1>oe&&(R=Math.max(1,oe-we-1),we+R+1>oe&&(we=Math.max(1,oe-R-1))),we+R>=O.length)return O.map((K,ee)=>({type:"item",item:K,index:ee,key:`item-${ee}`}));const h=[];for(let K=0;K<we;K++)h.push({type:"item",item:O[K],index:K,key:`item-${K}`});const m=O.slice(we,O.length-R);h.push({type:"collapsed",key:`collapsed-${we}-${O.length-R}`,items:m,from:we,to:O.length-R-1});for(let K=O.length-R;K<O.length;K++)h.push({type:"item",item:O[K],index:K,key:`item-${K}`});return h},le=(O,Y=null)=>{var R,h,m,y,j;if(!O)return!1;const oe=o((R=O.href)!=null?R:O.to)||"",we=o(O.to)||"";return!U(O)&&we&&(i!=null&&i.navigate)?(Y!=null&&Y.preventDefault&&Y.preventDefault(),i.navigate(we),(h=O.onNavigate)==null||h.call(O,we,Y||null),(m=e.onNavigate)==null||m.call(e,we,O,Y||null),!0):((y=O.onNavigate)==null||y.call(O,we||oe,Y||null),(j=e.onNavigate)==null||j.call(e,we||oe,O,Y||null),!1)},fe=(O,Y,oe)=>{var j,X,d;const we=O,R=oe[Y+1]||null,h={index:Y,entry:O,previous:we,next:R},m=W(o((d=(X=(O==null?void 0:O.type)==="item"?(j=O.item)==null?void 0:j.separator:null)!=null?X:e.separator)!=null?d:"/")),y=B(s,"separator",h,m);return _.li({class:"cms-breadcrumbs-separator-item","aria-hidden":"true"},_.span({class:"cms-breadcrumbs-separator"},...y))},be=(O,Y,oe)=>{const we={type:"collapsed",collapsed:!0,items:Y,hiddenItems:O.items,currentIndex:oe,from:O.from,to:O.to},R=_.span({class:"cms-breadcrumb cms-breadcrumb-collapsed"},_.span({class:"cms-breadcrumb-inner"},_.span({class:"cms-breadcrumb-copy"},_.span({class:"cms-breadcrumb-label"},String(o(e.collapsedLabel)||"\u2026"))))),h=B(s,"collapsed",we,R,"item");return _.li({class:"cms-breadcrumbs-entry is-collapsed"},...h)},re=(O,Y,oe,we)=>{var _e,Me,Ie,Ye,rt,Xe,We,w,ie,$e,F,f,r,x,de,Be,He,Se,Oe,at,nt,Ze,wt,Nt,Et,Rt;const R=O.item||{},h=R.slots?{...s,...R.slots}:s,m=o((_e=R.href)!=null?_e:R.to)||"",y=!!o(R.disabled),j=O.index===oe,X=(Ye=(Ie=(Me=R.iconSize)!=null?Me:e.itemSize)!=null?Ie:e.size)!=null?Ye:null,d=z((We=(Xe=(rt=R.color)!=null?rt:R.state)!=null?Xe:e.color)!=null?We:e.state),k=!o(R.color)&&o(R.state)?Bt(o(R.state)):"",g=(f=(F=($e=(ie=(w=R.label)!=null?w:R.title)!=null?ie:R.text)!=null?$e:R.to)!=null?F:R.href)!=null?f:"",P=(de=(x=(r=R.note)!=null?r:R.subtitle)!=null?x:R.caption)!=null?de:R.description,K=(He=(Be=R.badge)!=null?Be:R.counter)!=null?He:R.count,ee=(Oe=(Se=R.aside)!=null?Se:R.trailing)!=null?Oe:ne(R.iconRight,X,"iconRight"),Ce=(at=R.content)!=null?at:R.body,E={item:R,index:O.index,visibleIndex:we,total:Y.length,current:j,active:j,disabled:y,href:m,to:o(R.to)||"",external:U(R),isFirst:O.index===0,isLast:O.index===Y.length-1,navigate:Mt=>le(R,Mt)},p=B(h,"icon",E,ne(R.icon,X,"icon")),A=B(h,"label",E,g),L=B(h,"note",E,P),ae=B(h,"badge",E,K),ke=B(h,"aside",E,ee),Te=B(h,"default",E,Ce),ze=_.span({class:"cms-breadcrumb-inner"},p.length?_.span({class:"cms-breadcrumb-icon"},...p):null,_.span({class:"cms-breadcrumb-copy"},_.span({class:"cms-breadcrumb-label"},...A.length?A:[m||""]),L.length?_.span({class:"cms-breadcrumb-note"},...L):null,Te.length?_.span({class:"cms-breadcrumb-extra"},...Te):null),ae.length?_.span({class:"cms-breadcrumb-badge"},...ae):null,ke.length?_.span({class:"cms-breadcrumb-aside"},...ke):null),V=!y&&(!j||!!o((nt=R.linkCurrent)!=null?nt:e.linkCurrent)),H={class:Z(["cms-breadcrumb","cms-clear-set","cms-singularity",ye(j,"is-current"),ye(j,"active"),ye(y,"is-disabled"),k?`cms-state-${k}`:"",R.class]),style:{...R.style||{}},"aria-current":j?String(o((Ze=R.ariaCurrent)!=null?Ze:e.ariaCurrent)||"page"):null};d&&(H.style["--cms-breadcrumb-accent"]=d);let te=null;V&&m?(te=_.a({...H,href:m,target:R.target,rel:R.rel,onClick:Mt=>{var vt,Dt;(vt=R.onClick)==null||vt.call(R,Mt,E),(Dt=e.onItemClick)==null||Dt.call(e,R,E,Mt),!Mt.defaultPrevented&&E.navigate(Mt)}},ze),E.external&&te.target==="_blank"&&!te.rel&&(te.rel="noopener noreferrer")):V&&typeof R.onClick=="function"?te=_.button({...H,type:R.type||"button",onClick:Mt=>{var vt,Dt;(vt=R.onClick)==null||vt.call(R,Mt,E),(Dt=e.onItemClick)==null||Dt.call(e,R,E,Mt)}},ze):te=_.span({...H,"aria-disabled":y?"true":null},ze),At(te,{size:(Nt=(wt=R.size)!=null?wt:e.itemSize)!=null?Nt:e.size,radius:(Et=R.radius)!=null?Et:e.radius,gradient:(Rt=R.gradient)!=null?Rt:e.gradient});const je=B(h,"item",E,te);return _.li({class:Z(["cms-breadcrumbs-entry",ye(j,"is-current"),ye(y,"is-disabled")])},...je)},ue=()=>{var h;const O=he(),Y=q(O),oe=se(O),we=z((h=e.color)!=null?h:e.state);b.classList.toggle("is-empty",O.length===0),we?b.style.setProperty("--cms-breadcrumb-accent",we):b.style.removeProperty("--cms-breadcrumb-accent");const R={items:O,visibleItems:oe,currentIndex:Y,count:O.length,collapsed:oe.some(m=>m.type==="collapsed")};if(ge(M,B(s,"before",R,e.before)),ge(C,B(s,"after",R,e.after)),N.innerHTML="",!O.length){const m=B(s,"empty",R,e.empty);m.length&&N.appendChild(_.li({class:"cms-breadcrumbs-entry is-empty"},...m));return}oe.forEach((m,y)=>{y>0&&N.appendChild(fe(oe[y-1],y-1,oe)),N.appendChild(m.type==="collapsed"?be(m,O,Y):re(m,O,Y,y))})};return bt.reactive.effect(()=>{ue()},"UI.Breadcrumbs:render"),b.getItems=()=>he(),b.getVisibleItems=()=>se(he()),b.refresh=()=>(ue(),b),b.setItems=O=>(c?c.set(O):e.items=O,ue(),b),At(b,e),b},Ae.Pagination=(...t)=>{const{props:e}=JSswift.uiNormalizeArgs(t),n=e.slots||{},s=an(e.model,"UI.Pagination:model"),i=xt(e.size,()=>{const d=o(e.size);return typeof d=="string"&&fs[d]?`cms-size-${d}`:""}),c=_.nav({class:Z(["cms-pagination","cms-clear-set",i,ye(e.dense,"dense"),ye(e.simple,"is-simple"),ye(e.disabled,"is-disabled"),e.class]),style:{...e.style||{}},role:"navigation","aria-label":e.ariaLabel||"Pagination"}),S=_.div({class:"cms-pagination-controls"}),u=_.div({class:"cms-pagination-start"}),a=_.div({class:"cms-pagination-pages"}),b=_.div({class:"cms-pagination-end"}),M=_.div({class:"cms-pagination-summary"});S.appendChild(u),S.appendChild(a),S.appendChild(b),c.appendChild(S),c.appendChild(M);let N=1,C=1;const z=(d,k=0)=>{const g=o(d);if(g==null||g==="")return k;const P=Number(g);return Number.isFinite(P)?Math.trunc(P):k},U=(d,k=W())=>{const g=Number(d),P=Number.isFinite(g)?Math.trunc(g):1;return Math.min(Math.max(P||1,1),Math.max(1,k||1))},W=()=>{var P,K,ee,Ce,E,p,A;const d=z((ee=(K=(P=e.max)!=null?P:e.pages)!=null?K:e.pageCount)!=null?ee:e.totalPages,0);if(d>0)return d;const k=z((E=(Ce=e.total)!=null?Ce:e.totalItems)!=null?E:e.count,0),g=z((A=(p=e.pageSize)!=null?p:e.perPage)!=null?A:e.limit,0);return k>=0&&g>0?Math.max(1,Math.ceil(k/g)):1},ge=()=>{var d,k,g;return z(s?s.get():(g=(k=(d=e.page)!=null?d:e.value)!=null?k:e.current)!=null?g:e.currentPage,1)},B=()=>{var d,k;return Math.max(0,z((k=(d=e.siblings)!=null?d:e.siblingCount)!=null?k:e.window,1))},ne=()=>{var d,k;return Math.max(0,z((k=(d=e.boundaryCount)!=null?d:e.boundaries)!=null?k:e.edges,1))},he=()=>!!o(e.disabled),q=()=>{var d;return o((d=e.showSummary)!=null?d:e.showLabel)!==!1},se=()=>o(e.showPages)!==!1&&!o(e.simple),le=()=>o(e.showPrev)!==!1,fe=()=>o(e.showNext)!==!1,be=()=>!!o(e.showEdges),re=()=>{const d=o(e.showFirst);return d==null?be():!!d},ue=()=>{const d=o(e.showLast);return d==null?be():!!d},O=()=>!!o(e.hideOnSinglePage),Y=()=>{var g,P;const d=o((P=(g=e.total)!=null?g:e.totalItems)!=null?P:e.count);if(d==null||d==="")return null;const k=Number(d);return Number.isFinite(k)?Math.max(0,Math.trunc(k)):null},oe=()=>{var g,P;const d=o((P=(g=e.pageSize)!=null?g:e.perPage)!=null?P:e.limit);if(d==null||d==="")return null;const k=Number(d);return Number.isFinite(k)&&k>0?Math.trunc(k):null},we=(d=N,k=C)=>{const g=Y(),P=oe(),K=g!=null&&P?g===0?0:(d-1)*P+1:null,ee=g!=null&&P?Math.min(g,d*P):null;return{page:d,value:d,current:d,currentPage:d,pages:k,max:k,total:g,pageSize:P,from:K,to:ee,disabled:he(),isFirst:d<=1,isLast:d>=k,canPrev:d>1,canNext:d<k,setPage:(Ce,E)=>X(Ce,E),prev:Ce=>X(d-1,Ce),next:Ce=>X(d+1,Ce),first:Ce=>X(1,Ce),last:Ce=>X(k,Ce)}},R=(d,k)=>{if(k<=0)return[];const g=[],P=new Set,K=ne(),ee=B();for(let E=1;E<=Math.min(K,k);E++)P.add(E);for(let E=Math.max(1,d-ee);E<=Math.min(k,d+ee);E++)P.add(E);for(let E=Math.max(1,k-K+1);E<=k;E++)P.add(E);let Ce=0;for(let E=1;E<=k;E++)P.has(E)&&(Ce&&E-Ce>1&&g.push({type:"ellipsis",key:`ellipsis-${Ce}-${E}`}),g.push({type:"page",page:E,key:`page-${E}`}),Ce=E);return g.length||g.push({type:"page",page:1,key:"page-1"}),g},h=(d,k,g,P=null)=>{const K=JSswift.ui.getSlot(n,d)!=null?T(n,d,g,k):[];return K.length?K:P&&JSswift.ui.getSlot(n,P)!=null?T(n,P,g,k):T(null,"default",g,k)},m=(d,k)=>{d.innerHTML="",k.forEach(g=>d.appendChild(g))},y=(d,k,g,P={})=>{var ee;const K={...we(),kind:d,active:!!P.active};return Ae.Btn({class:Z(["cms-pagination-btn",`cms-pagination-${d}`,ye(P.active,"active"),P.class]),size:e.itemSize||e.size||(e.dense?"sm":"md"),color:P.active?e.color||e.state||"primary":P.color||null,outline:P.active?!1:(ee=P.outline)!=null?ee:!0,disabled:he()||!!P.disabled,"aria-current":P.active?"page":null,onClick:Ce=>{he()||P.disabled||g==null||g(Ce)}},...h(d,k,K,d==="summary"?"label":d==="page"?"item":null))},j=(d,k)=>{N=U(d,k),C=Math.max(1,k||1);const g=we(N,C);c.style.display=O()&&C<=1?"none":"",M.style.display=q()?"":"none",a.style.display=se()?"":"none",u.innerHTML="",a.innerHTML="",b.innerHTML="";const P=h("start",e.start,g);P.length&&u.appendChild(_.div({class:"cms-pagination-extra cms-pagination-extra-start"},...P)),re()&&u.appendChild(y("first","\xAB",Ce=>X(1,Ce),{disabled:N<=1})),le()&&u.appendChild(y("prev","Prev",Ce=>X(N-1,Ce),{disabled:N<=1})),se()&&R(N,C).forEach(Ce=>{if(Ce.type==="ellipsis"){const A={...g,kind:"ellipsis"},L=h("ellipsis","\u2026",A);a.appendChild(_.span({class:"cms-pagination-ellipsis","aria-hidden":"true"},...L));return}const E=Ce.page,p={...g,page:E,value:E,item:Ce,active:E===N};a.appendChild(Ae.Btn({class:Z(["cms-pagination-btn","cms-pagination-page-btn",ye(E===N,"active")]),size:e.itemSize||e.size||(e.dense?"sm":"md"),color:E===N?e.color||e.state||"primary":null,outline:E!==N,disabled:he(),"aria-current":E===N?"page":null,onClick:A=>X(E,A)},...h("page",String(E),p,"item")))}),fe()&&b.appendChild(y("next","Next",Ce=>X(N+1,Ce),{disabled:N>=C})),ue()&&b.appendChild(y("last","\xBB",Ce=>X(C,Ce),{disabled:N>=C}));const K=h("end",e.end,g);K.length&&b.appendChild(_.div({class:"cms-pagination-extra cms-pagination-extra-end"},...K));let ee=`Pagina ${N} di ${C}`;g.total!=null&&g.pageSize&&(ee=g.total===0?"0 risultati":`${g.from}-${g.to} di ${g.total}`),m(M,h("summary",ee,g,"label"))},X=(d,k=null)=>{var K,ee;const g=W(),P=U(d,g);return P===N&&g===C||(j(P,g),s&&s.get()!==P&&s.set(P),(K=e.onChange)==null||K.call(e,P,we(P,g),k),(ee=e.onPageChange)==null||ee.call(e,P,we(P,g),k)),P};return bt.reactive.effect(()=>{const d=W(),k=ge(),g=U(k,d);j(g,d),s&&k!==g&&s.set(g)},"UI.Pagination:sync"),c.getPage=()=>N,c.getPages=()=>C,c.setPage=d=>X(d),c.prev=()=>X(N-1),c.next=()=>X(N+1),c.first=()=>X(1),c.last=()=>X(C),At(c,e),c},Ae.Spinner=(...t)=>{var he;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=(q,se,le)=>{if(Ke(q))return()=>{const be=o(q);if(be==null||be===!1||be==="")return le;const re=se?se(be):be;return re==null||re===""?le:re};if(q==null||q===!1||q==="")return le;const fe=se?se(q):q;return fe==null||fe===""?le:fe},c=q=>{if(q==null||q===!1||q===""||Bt(q))return"";const le=String(q).trim();return le?le.startsWith("#")||le.startsWith("rgb(")||le.startsWith("rgba(")||le.startsWith("hsl(")||le.startsWith("hsla(")||le.startsWith("var(")?le:In(le)?`var(--cms-${le})`:le:""},S=xt(e.state,()=>{const q=Bt(o(e.state));return q?`cms-state-${q}`:""}),u=Z(["cms-spinner",S,ye(e.vertical,"vertical"),ye(e.reverse,"reverse"),ye(e.center,"center"),ye(e.block,"block"),ye(e.pause||e.paused,"paused"),e.class]),a=JSswift.omit(e,["ariaLabel","block","center","color","indicatorClass","indicatorStyle","label","note","pause","paused","reverse","size","slots","speed","state","thickness","trackColor","vertical"]);a.class=u;const b={...e.style||{}};e.color!=null&&Object.prototype.hasOwnProperty.call(b,"backgroundColor")&&delete b.backgroundColor,a.style=b,a.role==null&&(a.role="status"),a["aria-live"]==null&&(a["aria-live"]="polite"),a["aria-busy"]==null&&(a["aria-busy"]="true");const M={props:e},N=T(s,"label",M,e.label),C=T(s,"default",M,n),z=T(s,"note",M,e.note),U=N.length||C.length||z.length;if(!U){const q=o((he=e.ariaLabel)!=null?he:e["aria-label"]);q?a["aria-label"]=q:a["aria-label"]==null&&(a["aria-label"]="Loading")}const W=_.span({class:Z(["cms-spinner-indicator",e.indicatorClass]),style:{"--cms-spinner-size":i(e.size,gt,"18px"),"--cms-spinner-thickness":i(e.thickness,gt,"2px"),"--cms-spinner-speed":i(e.speed,q=>typeof q=="number"?`${q}ms`:String(q),"900ms"),"--cms-spinner-color":i(e.color,c,"var(--set-border-color, var(--cms-primary))"),"--cms-spinner-track":i(e.trackColor,c,"color-mix(in srgb, var(--cms-spinner-color) 18%, transparent)"),...e.indicatorStyle||{}},"aria-hidden":"true"}),ge=T(s,"indicator",M,W),B=[];ge.length&&B.push(...ge),U&&B.push(_.div({class:"cms-spinner-content"},N.length?_.div({class:"cms-spinner-label"},...N):null,C.length?_.div({class:"cms-spinner-copy"},...C):null,z.length?_.div({class:"cms-spinner-note"},...z):null));const ne=_.div(a,...B);return At(ne,e),ne},Ae.Progress=(...t)=>{var L,ae,ke,Te,ze,V,H,te,De,je;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=e.model||(Ct(e.value)||ht(e.value)?e.value:null),c=an(i,"UI.Progress:model"),S=xt([e.state,e.color],()=>{const _e=Bt(o(e.state)||o(e.color));return _e?`cms-state-${_e}`:""}),u=(_e,Me)=>{const Ie=Number(_e);return Number.isFinite(Ie)?Ie:Me},a=()=>u(o(e.min),0),b=()=>{const _e=a(),Me=u(o(e.max),100);return Me<_e?_e:Me},M=()=>{var Me,Ie;const _e=o((Ie=(Me=e.height)!=null?Me:e.thickness)!=null?Ie:e.size);return _e==null||_e===""?"8px":typeof _e=="number"?`${_e}px`:typeof _e=="string"?{xxs:"4px",xs:"6px",sm:"8px",md:"10px",lg:"12px",xl:"14px",xxl:"16px",xxxl:"18px"}[_e]||_e:"8px"},N=(_e,Me="")=>{const Ie=o(_e);if(Ie==null||Ie===!1||Ie==="")return Me;const Ye=Bt(Ie);return Ye?`var(--cms-${Ye})`:typeof Ie=="string"&&In(Ie)?`var(--cms-${Ie})`:String(Ie)},C=_e=>{const Me=a(),Ie=b(),Ye=u(_e,Me);return Math.min(Ie,Math.max(Me,Ye))},z=_e=>{const Me=a(),Ye=b()-Me;if(!Ye)return 0;const rt=(C(_e)-Me)/Ye,Xe=o(e.reverse)?1-rt:rt;return Math.max(0,Math.min(1,Xe))},U=_e=>{const Me=C(_e);return Me<se()?se():Me},W=(_e,Me,Ie)=>{const Ye=e.formatValue;if(typeof Ye=="function"){const rt=Ye(_e,Me,Ie);if(rt!=null)return rt}return`${Math.round(Me)}%`},ge=_e=>{for(;_e.firstChild;)_e.removeChild(_e.firstChild)},B=(_e,Me,Ie="flex")=>{ge(_e),(Me||[]).forEach(Ye=>{if(!(Ye==null||Ye===!1)){if(Ye instanceof Node){_e.appendChild(Ye);return}_e.appendChild(document.createTextNode(String(Ye)))}}),_e.style.display=_e.childNodes.length?Ie:"none"},ne=(_e,Me={})=>Vs(o(_e),Me),he=(_e,Me,Ie={})=>{var rt;const Ye=o(_e);return Ye==null||Ye===!1||Ye===""?[]:typeof Ye=="string"?[Ae.Icon({name:Ye,size:(rt=e.iconSize)!=null?rt:16})]:ne(Ye,{...Ie,as:Me})},q=_e=>ht(_e)||Ct(_e)?o(_e):typeof _e=="function"&&_e.length===0?_e():_e,[se,le]=JSswift.reactive.signal(C(c?c.get():(ae=(L=o(e.value))!=null?L:o(e.min))!=null?ae:0)),[fe,be]=JSswift.reactive.signal(U((ze=o(e.buffer))!=null?ze:c?c.get():(Te=(ke=o(e.value))!=null?ke:o(e.min))!=null?Te:0)),re=(_e,Me={})=>{const Ie=C(_e);return se()!==Ie&&le(Ie),fe()<Ie&&be(Ie),c&&Me.fromModel!==!0&&c.set(Ie),Ie},ue=_e=>{const Me=U(_e);return fe()!==Me&&be(Me),Me},O=JSswift.omit(e,["model","value","min","max","buffer","class","style","slots","label","note","showValue","valueLabel","insideLabel","formatValue","icon","iconRight","iconSize","startLabel","endLabel","leftLabel","rightLabel","trackColor","bufferColor","height","thickness","size","state","color","reverse","striped","animated","indeterminate","ariaLabel","ariaValueText","width","dense","outline","flat","border","glossy","glow","glass","shadow","gradient","textGradient","lightShadow","radius","rounded","textColor"]),Y={width:o(e.width)||"100%",...e.style||{}},oe=o(e.color);(oe!=null||Ke(e.color))&&!Bt(oe||"")&&delete Y.backgroundColor,O.class=Z(["cms-progress-wrap",ye(e.dense,"dense"),ye(e.reverse,"is-reverse"),ye(e.indeterminate,"is-indeterminate"),S,e.class]),O.style=Y;const we=_.div({class:"cms-progress-header"}),R=_.div({class:"cms-progress-heading"}),h=_.div({class:"cms-progress-label"}),m=_.div({class:"cms-progress-note"}),y=_.div({class:"cms-progress-value"});R.append(h,m),we.append(R,y);const j=_.div({class:"cms-progress-body"}),X=_.span({class:"cms-progress-edge-label cms-progress-edge-label-left"}),d=_.div({class:"cms-progress",role:"progressbar"}),k=_.span({class:"cms-progress-buffer"}),g=_.span({class:Z(["cms-progress-bar","cms-singularity",S,ye(e.outline,"cms-outline"),ye(e.flat,"cms-flat"),ye(e.border,"cms-border"),ye(e.glossy,"cms-glossy"),ye(e.glow,"cms-glow"),ye(e.glass,"cms-glass"),ye(e.shadow,"cms-shadow"),xt(e.shadow,()=>{const _e=bs(o(e.shadow));return _e?`cms-shadow-${_e}`:""}),ye(e.gradient,"cms-gradient"),ye(e.textGradient,"cms-text-gradient"),ye(e.lightShadow,"cms-light-shadow"),ye(e.striped,"is-striped"),ye(e.animated||e.indeterminate,"is-animated")])}),P=_.span({class:"cms-progress-bar-label"});g.appendChild(P),d.append(k,g);const K=_.span({class:"cms-progress-edge-label cms-progress-edge-label-right"});j.append(X,d,K);const ee=_.div(O,we,j);At(g,e);const Ce=()=>{const _e=se(),Me=z(_e)*100,Ie={value:_e,percent:Me,min:a(),max:b(),buffer:fe(),progress:ee,track:d,bar:g,props:e},Ye=T(s,"icon",Ie,null),rt=Ye.length?[]:he(e.icon,"icon",Ie),Xe=T(s,"label",Ie,q(e.label)),We=Xe.length?Xe:T(s,"default",Ie,n),w=T(s,"iconRight",Ie,null),ie=w.length?[]:he(e.iconRight,"iconRight",Ie),$e=T(s,"note",Ie,q(e.note)),F=e.valueLabel!=null?q(e.valueLabel):W(_e,Me,Ie),f=o(e.showValue),r=f===!0||e.valueLabel!=null||JSswift.ui.getSlot(s,"value")!=null?T(s,"value",Ie,F):[];B(h,[...rt,...Ye,...We,...ie,...w],"inline-flex"),B(m,$e,"block"),B(y,f==="inside"?[]:r,"inline-flex"),we.style.display=h.childNodes.length||m.childNodes.length||y.childNodes.length?"flex":"none"},E=()=>{var Xe,We;const _e=se(),Me=z(_e)*100,Ie={value:_e,percent:Me,min:a(),max:b(),buffer:fe(),progress:ee,track:d,bar:g,props:e},Ye=q((Xe=e.startLabel)!=null?Xe:e.leftLabel),rt=q((We=e.endLabel)!=null?We:e.rightLabel);B(X,T(s,"startLabel",Ie,Ye),"inline-flex"),B(K,T(s,"endLabel",Ie,rt),"inline-flex")},p=()=>{const _e=se(),Me=z(_e)*100,Ie={value:_e,percent:Me,min:a(),max:b(),buffer:fe(),progress:ee,track:d,bar:g,props:e},Ye=o(e.showValue),rt=e.insideLabel!=null?q(e.insideLabel):W(_e,Me,Ie),Xe=Ye==="inside"||e.insideLabel!=null||JSswift.ui.getSlot(s,"inside")!=null?T(s,"inside",Ie,rt):[];B(P,Xe,"inline-flex")},A=()=>{const _e=se(),Me=fe(),Ie=a(),Ye=b(),rt=z(_e)*100,Xe=z(Me)*100,We=N(e.color,""),w=N(e.trackColor,We?`color-mix(in srgb, ${We} 14%, transparent)`:"rgba(255,255,255,0.08)"),ie=N(e.bufferColor,We?`color-mix(in srgb, ${We} 30%, transparent)`:"rgba(255,255,255,0.16)"),$e=o(e.ariaLabel),F=o(e.ariaValueText),f=!!o(e.indeterminate),r=o(e.radius);ee.style.width=o(e.width)||"100%",ee.style.setProperty("--cms-progress-height",M()),r!=null?typeof r=="number"?ee.style.setProperty("--cms-progress-radius",`${r}px`):typeof r=="string"&&JSswift.uiSizes.includes(r)?ee.style.setProperty("--cms-progress-radius",`var(--cms-r-${r})`):ee.style.setProperty("--cms-progress-radius",String(r)):ee.style.removeProperty("--cms-progress-radius"),d.style.background=w,k.style.background=ie,k.style.width=`${Xe}%`,We&&!Bt(o(e.state)||o(e.color))?(g.style.setProperty("--set-background-color",We),g.style.setProperty("--set-border-color",We),g.style.setProperty("--set-color",o(e.textColor)||"var(--cms-on-primary, #fff)")):Bt(o(e.state)||o(e.color))?(g.style.removeProperty("--set-background-color"),g.style.removeProperty("--set-border-color"),g.style.removeProperty("--set-color")):(g.style.setProperty("--set-background-color","var(--cms-primary)"),g.style.setProperty("--set-border-color","var(--cms-primary)"),g.style.setProperty("--set-color",o(e.textColor)||"var(--cms-on-primary, #fff)")),f?(g.style.width="",d.removeAttribute("aria-valuenow"),d.removeAttribute("aria-valuemin"),d.removeAttribute("aria-valuemax")):(g.style.width=`${rt}%`,d.setAttribute("aria-valuemin",String(Ie)),d.setAttribute("aria-valuemax",String(Ye)),d.setAttribute("aria-valuenow",String(_e))),$e!=null?d.setAttribute("aria-label",String($e)):typeof o(e.label)=="string"?d.setAttribute("aria-label",String(o(e.label))):d.removeAttribute("aria-label"),F!=null?d.setAttribute("aria-valuetext",String(F)):f?d.removeAttribute("aria-valuetext"):d.setAttribute("aria-valuetext",W(_e,rt,{value:_e,percent:rt,min:Ie,max:Ye,buffer:Me,progress:ee,track:d,bar:g,props:e})),ee.classList.toggle("has-start-label",X.childNodes.length>0),ee.classList.toggle("has-end-label",K.childNodes.length>0),ee.classList.toggle("has-inside-label",P.childNodes.length>0)};return c?(re(c.get(),{fromModel:!0}),c.watch(_e=>{re(_e,{fromModel:!0})},"UI.Progress:watch")):Ke(e.value)?JSswift.reactive.effect(()=>{re(o(e.value),{fromModel:!0})},"UI.Progress:value"):re((H=(V=e.value)!=null?V:e.min)!=null?H:0,{fromModel:!0}),Ke(e.buffer)?JSswift.reactive.effect(()=>{ue(o(e.buffer))},"UI.Progress:buffer"):ue((je=(De=(te=e.buffer)!=null?te:e.value)!=null?De:e.min)!=null?je:0),JSswift.reactive.effect(()=>{Ce(),E(),p(),A()},"UI.Progress:render"),ee._track=d,ee._bar=g,ee._buffer=k,ee._getValue=se,ee._getBuffer=fe,ee._setValue=_e=>re(_e),ee._setBuffer=_e=>ue(_e),ee},Ae.LoadingBar=function(...e){var p,A;const{props:n,children:s}=JSswift.uiNormalizeArgs(e),i=(L,ae)=>{const ke=Number(L);return Number.isFinite(ke)?ke:ae},c=()=>i(o(n.min),0),S=()=>{const L=c(),ae=i(o(n.max),100);return ae<L?L:ae},u=L=>{const ae=c(),ke=S(),Te=i(L,ae);return Math.min(ke,Math.max(ae,Te))},a=(L,ae="")=>L==null||L===!1||L===""?ae:typeof L=="number"?`${L}px`:String(L),b=L=>{const ae=o(L);return!ae||ae===document?document.body:typeof ae=="string"?document.querySelector(ae)||document.body:ae&&ae.body instanceof HTMLElement?ae.body:ae instanceof HTMLElement?ae:document.body},M=n.model||(Ct(n.value)||ht(n.value)?n.value:null),N=an(M,"UI.LoadingBar:model"),C=Ct(n.buffer)||ht(n.buffer)?n.buffer:null,z=an(C,"UI.LoadingBar:buffer"),U=N?N.get():(p=o(n.value))!=null?p:c(),W=z?z.get():(A=o(n.buffer))!=null?A:U,[ge,B]=JSswift.reactive.signal(u(U)),[ne,he]=JSswift.reactive.signal(Math.max(u(W),u(U))),[q,se]=JSswift.reactive.signal(n.visible!=null?!!o(n.visible):u(U)>c()||!!o(n.indeterminate));let le=null,fe=null;const be=()=>{le&&(clearInterval(le),le=null)},re=()=>{fe&&(clearTimeout(fe),fe=null)},ue=(L,ae={})=>{const ke=!!L;return q()!==ke&&se(ke),ae.fromExternal!==!0&&typeof n.onVisibleChange=="function"&&n.onVisibleChange(ke),ke},O=(L,ae={})=>{const ke=u(L);return ge()!==ke&&B(ke),ne()<ke&&(he(ke),z&&ae.fromExternal!==!0&&z.set(ke)),N&&ae.fromExternal!==!0&&N.set(ke),ke},Y=(L,ae={})=>{const ke=Math.max(O(ge(),{fromExternal:!0}),u(L));return ne()!==ke&&he(ke),z&&ae.fromExternal!==!0&&z.set(ke),ke},oe=(L=ge())=>{n.visible==null&&(o(n.indeterminate)||L>c()?ue(!0):o(n.hideOnZero)!==!1&&ue(!1))},we=()=>{if(be(),o(n.trickle)===!1||o(n.indeterminate))return;const L=i(o(n.trickleInterval),280);L<=0||(le=setInterval(()=>{var ze,V;const ae=ge(),ke=u((V=(ze=o(n.trickleTo))!=null?ze:o(n.trickleMax))!=null?V:92);if(ae>=ke)return;const Te=i(o(n.trickleStep),ae<45?12:ae<75?7:3);O(Math.min(ke,ae+Te))},L))},R=JSswift.omit(n,["model","value","min","max","buffer","class","style","slots","label","note","showValue","valueLabel","insideLabel","formatValue","icon","iconRight","iconSize","startLabel","endLabel","leftLabel","rightLabel","trackColor","bufferColor","height","thickness","size","state","color","reverse","striped","animated","indeterminate","ariaLabel","ariaValueText","width","dense","outline","flat","border","glossy","glow","glass","shadow","gradient","textGradient","lightShadow","radius","rounded","textColor","target","mount","position","top","right","bottom","left","inset","zIndex","visible","autoStart","hideOnZero","startValue","step","trickle","trickleStep","trickleInterval","trickleMax","trickleTo","doneValue","doneDelay","hideDelay","resetValue","progressClass","progressStyle","onVisibleChange"]);R.class=Z(["cms-loading-bar",n.class]),R.style={...n.style||{}};const h=JSswift.omit(n,["target","mount","position","top","right","bottom","left","inset","zIndex","visible","autoStart","hideOnZero","startValue","step","trickle","trickleStep","trickleInterval","trickleMax","trickleTo","doneValue","doneDelay","hideDelay","resetValue","progressClass","progressStyle","onVisibleChange"]);h.class=Z(["cms-loading-bar-progress",n.progressClass,h.class]),h.style={...n.progressStyle||{}},h.value=[ge,B],h.buffer=[ne,he],h.dense==null&&(h.dense=!0),h.height==null&&h.thickness==null&&h.size==null&&(h.height=3),h.width==null&&(h.width="100%");const m=_.div(R),y=Ae.Progress(h,...s);m.appendChild(y);const j=L=>{re();const ae=O(L);return oe(ae),m},X=L=>{re();const ae=Y(L);return oe(ae),m},d=(L=(ae=>(ae=o(n.step))!=null?ae:8)())=>{re();const ke=ge(),Te=O(ke+i(L,0));return oe(Te),m},k=(L=(ae=>(ae=o(n.startValue))!=null?ae:12)())=>{re();const ke=Math.max(ge(),u(L));return O(ke),Y(Math.max(ne(),ke)),oe(ke),we(),m},g=(L=(ae=>(ae=o(n.resetValue))!=null?ae:c())())=>{re(),be();const ke=u(L);return Y(ke),O(ke),oe(ke),m},P=(L=(ae=>(ae=o(n.doneValue))!=null?ae:S())())=>{var ze;re(),be();const ke=u(L);Y(ke),O(ke),oe(ke);const Te=Math.max(0,i((ze=o(n.hideDelay))!=null?ze:o(n.doneDelay),220));return fe=setTimeout(()=>{g()},Te),m},K=(...L)=>P(...L),ee=()=>(ue(!0),m),Ce=()=>(re(),be(),ue(!1),m),E=()=>(re(),be(),m.remove(),null);return m.el=m,m._progress=y,m.get=()=>ge(),m.getBuffer=()=>ne(),m.set=j,m.setBuffer=X,m.inc=d,m.start=k,m.done=P,m.complete=P,m.stop=K,m.reset=g,m.show=ee,m.hide=Ce,m.destroy=E,m._dispose=E,N?N.watch(L=>{O(L,{fromExternal:!0}),oe(u(L))},"UI.LoadingBar:watch"):Ke(n.value)&&JSswift.reactive.effect(()=>{const L=u(o(n.value));O(L,{fromExternal:!0}),oe(L)},"UI.LoadingBar:value"),z?z.watch(L=>{Y(L,{fromExternal:!0})},"UI.LoadingBar:bufferWatch"):Ke(n.buffer)&&JSswift.reactive.effect(()=>{Y(o(n.buffer),{fromExternal:!0})},"UI.LoadingBar:buffer"),JSswift.reactive.effect(()=>{const L=c(),ae=S(),ke=Math.min(ae,Math.max(L,ge())),Te=Math.max(ke,Math.min(ae,Math.max(L,ne())));ke!==ge()&&B(ke),Te!==ne()&&he(Te)},"UI.LoadingBar:range"),JSswift.reactive.effect(()=>{n.visible!=null&&ue(o(n.visible),{fromExternal:!0})},"UI.LoadingBar:visible"),JSswift.reactive.effect(()=>{var je;const L=o(n.position)||"fixed",ae=o(n.inset),ke=o(n.top),Te=o(n.right),ze=o(n.bottom),V=o(n.left),H=o(n.width),te=n.visible!=null?!!o(n.visible):q(),De=L==="static"||L==="relative";m.classList.toggle("is-visible",te),m.classList.toggle("is-inline",De),m.classList.toggle("has-track",!!o(n.trackColor)),m.style.position=L,m.style.zIndex=String((je=o(n.zIndex))!=null?je:10002),m.style.width=a(H,De?"100%":""),ae!=null&&ae!==""?(m.style.inset=a(ae),m.style.removeProperty("top"),m.style.removeProperty("right"),m.style.removeProperty("bottom"),m.style.removeProperty("left")):(m.style.removeProperty("inset"),!De&&L!=="sticky"?(m.style.top=a(ke,"0px"),m.style.right=a(Te,H==null||H===""?"0px":""),m.style.bottom=a(ze,""),m.style.left=a(V,"0px")):(m.style.top=a(ke,""),m.style.right=a(Te,""),m.style.bottom=a(ze,""),m.style.left=a(V,"")))},"UI.LoadingBar:layout"),At(m,n),o(n.mount)!==!1&&b(n.target).appendChild(m),o(n.autoStart)&&k(),m};const ei=new Set(["top-left","top-center","top-right","bottom-left","bottom-center","bottom-right"]),Hi=new Set(["soft","solid","outline"]),Wi={success:"Success",warning:"Warning",danger:"Error",info:"Info",primary:"Notice",secondary:"Notice",light:"Notice",dark:"Notice"},Ui={success:"check_circle",warning:"warning",danger:"error",info:"info",primary:"bolt",secondary:"notifications",light:"notifications",dark:"shield"},ti=t=>{const e=String(o(t)||"").trim().toLowerCase();return e?ei.has(e)?e:e==="top"?"top-right":e==="bottom"?"bottom-right":e==="left"?"bottom-left":e==="right"?"bottom-right":e==="center"?"bottom-center":"bottom-right":"bottom-right"},Gi=t=>{const e=String(o(t)||"").trim().toLowerCase();return Hi.has(e)?e:"soft"},Ki=(t,e)=>{const n=o(t);if(n===!1||n===null)return 0;if(n===!0||n===""||n===void 0)return e==="danger"?3500:2500;const s=Number(n);return Number.isFinite(s)&&s>=0?s:e==="danger"?3500:2500},$n=(t={},e="")=>{var u,a,b,M,N,C,z,U,W,ge,B,ne,he,q;const n=jn(t)?{...t}:{message:t},s=Bt(o(e)||o(n.type)||o(n.state)||o(n.color)||"info")||"info",i=Ki((a=(u=n.timeout)!=null?u:n.duration)!=null?a:n.delay,s),c=(N=(M=(b=n.closable)!=null?b:n.dismissible)!=null?M:n.dismiss!=null)!=null?N:i===0,S=n.title===void 0?n.label===void 0?Wi[s]:n.label:n.title;return{...n,type:s,state:s,title:S,message:(U=(z=(C=n.message)!=null?C:n.content)!=null?z:n.text)!=null?U:null,description:(B=(ge=(W=n.description)!=null?W:n.subtitle)!=null?ge:n.note)!=null?B:null,meta:(he=(ne=n.meta)!=null?ne:n.caption)!=null?he:null,body:(q=n.body)!=null?q:null,timeout:i,closable:!!c,dismissLabel:n.dismissLabel||n.closeLabel||"Chiudi notifica",position:ti(n.position),variant:Gi(n.variant),slots:n.slots||{},role:n.role||(s==="danger"||s==="warning"?"alert":"status")}},ni=(t,e="",n="")=>{if(!t.length)return $n(n?{type:e,title:n}:{type:e});if(jn(t[0])){const{props:u,children:a}=JSswift.uiNormalizeArgs(t),b={...u};return!b.type&&!b.state&&!b.color&&e&&(b.type=e),b.title==null&&n&&(b.title=n),a.length&&(b.message==null&&b.description==null&&b.body==null&&a.length===1?b.message=a[0]:b.body==null&&(b.body=a.length===1?a[0]:a)),$n(b,e)}const[s,i,c]=t;let S={};return jn(i)?S={...i,message:s}:jn(c)?S={...c,message:s,title:i}:S={message:s,title:i},e&&!S.type&&!S.state&&!S.color&&(S.type=e),S.title==null&&n&&(S.title=n),$n(S,e)},Nn=(t,e)=>(...n)=>{var s,i;return(i=(s=bt.services.notify)==null?void 0:s.show)==null?void 0:i.call(s,ni(n,t,e))},yo=(t,e,n)=>{if(t===!1)return!1;if(typeof t=="function"){const s=t();return yo(s,e,n)}return jn(t)?t:t!=null?{message:t,title:n}:{message:e,title:n}};Ae.Notify=(...t)=>{var e,n;return(n=(e=bt.services.notify)==null?void 0:e.show)==null?void 0:n.call(e,ni(t))},Ae.Notify.show=Ae.Notify,Ae.Notify.success=Nn("success","Success"),Ae.Notify.error=Nn("danger","Error"),Ae.Notify.warning=Nn("warning","Warning"),Ae.Notify.info=Nn("info","Info"),Ae.Notify.primary=Nn("primary","Notice"),Ae.Notify.secondary=Nn("secondary","Notice"),Ae.Notify.remove=t=>{var e,n;return(n=(e=bt.services.notify)==null?void 0:e.remove)==null?void 0:n.call(e,t)},Ae.Notify.clear=()=>{var t,e;return(e=(t=bt.services.notify)==null?void 0:t.clear)==null?void 0:e.call(t)},Ae.Notify.update=(t,e={})=>{var n,s;return(s=(n=bt.services.notify)==null?void 0:n.update)==null?void 0:s.call(n,t,e)},Ae.Notify.promise=async(t,e={})=>{var i,c,S,u,a,b,M,N,C,z,U,W,ge,B;const n=e.loading===!1?!1:yo(typeof e.loading=="function"?()=>e.loading():e.loading,"Operazione in corso...","In corso"),s=n===!1?null:(c=(i=bt.services.notify)==null?void 0:i.show)==null?void 0:c.call(i,$n({type:"info",timeout:0,closable:!1,...n},"info"));try{const he=await(typeof t=="function"?t():t),q=yo(typeof e.success=="function"?()=>e.success(he):e.success,"Operazione completata con successo.","Completato");return q!==!1?s!=null?(u=(S=bt.services.notify)==null?void 0:S.update)==null||u.call(S,s,$n(q,"success")):(b=(a=bt.services.notify)==null?void 0:a.show)==null||b.call(a,$n(q,"success")):s!=null&&((N=(M=bt.services.notify)==null?void 0:M.remove)==null||N.call(M,s)),he}catch(ne){const he=yo(typeof e.error=="function"?()=>e.error(ne):e.error,(ne==null?void 0:ne.message)||"Operazione fallita.","Errore");throw he!==!1?s!=null?(z=(C=bt.services.notify)==null?void 0:C.update)==null||z.call(C,s,$n(he,"danger")):(W=(U=bt.services.notify)==null?void 0:U.show)==null||W.call(U,$n(he,"danger")):s!=null&&((B=(ge=bt.services.notify)==null?void 0:ge.remove)==null||B.call(ge,s)),ne}},Ae.Header=(...t)=>{var k,g,P,K,ee,Ce,E;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i={...e};vn(i);const c=p=>Object.prototype.hasOwnProperty.call(e,p),S=(k=e.drawerStateKey)!=null?k:Gn;S&&(Gn=S,_n=ns(S));const u=()=>ns(S),a=()=>Fn(!0,S),b=()=>Fn(!1,S),M=()=>Fn(!u(),S),N={props:e,stateKey:S,isDrawerOpen:u,openDrawer:a,closeDrawer:b,toggleDrawer:M,toggleAside:M},C=(p,A)=>{if(!(A==null||A===!1)){if(Array.isArray(A)){A.forEach(L=>C(p,L));return}if(A!=null&&A.nodeType){p.appendChild(A);return}p.appendChild(document.createTextNode(String(A)))}},z=(p,A,L=ae=>ae)=>{const ae=JSswift.ui.getSlot(s,p);if(ae!=null)return T(s,p,N,null);if(typeof A=="function"){const ke=new Set(["eyebrow","title","subtitle"]),Te=_[ke.has(p)?"span":"div"]({class:`cms-header-slot-${p}`});return JSswift.reactive.effect(()=>{const ze=L(A(N)),V=xn(JSswift.ui.slot(ze));Te.replaceChildren(),Array.isArray(V)?V.forEach(H=>C(Te,H)):C(Te,V)},`UI.Header:${p}`),[Te]}return T(s,p,N,L(A))},U=(p,A="icon",L=e.iconSize||e.size||"md")=>p==null||p===!1?null:typeof p=="string"?Ae.Icon({name:p,size:L}):JSswift.ui.slot(p,{as:A}),W=p=>{var L,ae;const A=p?(L=e.drawerOpenIcon)!=null?L:"\u2715":(ae=e.drawerCloseIcon)!=null?ae:"\u2630";return A==null||A===!1?null:typeof A=="string"?A:JSswift.ui.slot(A,{as:p?"drawerOpenIcon":"drawerCloseIcon"})},ge=_.span({class:"cms-header-toggle-icon"}),B=p=>{const A=T(null,"default",N,W(p));ge.replaceChildren(...A.length?A:[""])};B(u());const ne=Ae.Btn({class:"cms-header-toggle",outline:!0,size:(P=(g=e.toggleSize)!=null?g:e.size)!=null?P:"sm",onClick:M,"aria-label":e.toggleLabel||"Toggle navigation"},ge);e.left==null&&e.left!==!1&&!JSswift.ui.getSlot(s,"left")&&qo.add({update:B});const he=e.left===!1?null:e.left!=null?e.left:ne,q=c("title")?e.title:(K=e.label)!=null?K:"App",se=(Ce=(ee=e.subtitle)!=null?ee:e.description)!=null?Ce:"",le=c("right")?e.right:e.end,fe=c("content")?e.content:c("body")?e.body:n!=null&&n.length?n:null,be=[...z("left",he),...z("start",null)],re=z("icon",e.icon,U),ue=z("eyebrow",(E=e.eyebrow)!=null?E:e.kicker),O=z("title",q),Y=z("subtitle",se),oe=z("meta",e.meta),we=(()=>{const p=z("content",null);return p.length?p:z("default",fe)})(),R=[...z("center",null),...z("body",null)],h=[...z("right",le),...z("end",null)],m=z("actions",e.actions),y=_.div({class:Z(["cms-header-body",e.bodyClass,e.centerClass])},_.div({class:"cms-header-heading"},re.length?_.div({class:"cms-header-icon"},...re):null,_.div({class:"cms-header-copy"},ue.length?_.div({class:Z(["cms-header-eyebrow",e.eyebrowClass])},...ue):null,O.length?_.div({class:Z(["cms-header-title",e.titleClass])},...O):null,Y.length?_.div({class:Z(["cms-header-subtitle",e.subtitleClass])},...Y):null,we.length?_.div({class:Z(["cms-header-content",e.contentClass])},...we):null),oe.length?_.div({class:Z(["cms-header-meta",e.metaClass])},...oe):null)),j=[...h,...m.length?[_.div({class:Z(["cms-header-actions",e.actionsClass])},...m)]:[]],X=JSswift.omit(i,["actions","actionsClass","body","bodyClass","centerClass","content","contentClass","description","divider","drawerCloseIcon","drawerOpenIcon","drawerStateKey","elevated","end","eyebrow","eyebrowClass","icon","iconSize","kicker","label","left","meta","metaClass","right","slots","stack","sticky","subtitle","subtitleClass","title","titleClass","toggleLabel","toggleSize","gap","minHeight","startClass","endClass"]);X.class=Z(["cms-panel","cms-header","cms-singularity",ye(e.sticky!==!1,"sticky"),ye(e.stack,"stack"),ye(e.elevated,"elevated"),ye(e.divider!==!1,"divider"),i.class]),X.style={...i.style||{}},e.gap!=null&&(X.style["--cms-header-gap"]=gt(o(e.gap))),e.minHeight!=null&&(X.style.minHeight=gt(o(e.minHeight)));const d=_.div(X,...be.length?[_.div({class:Z(["cms-header-start",e.startClass])},...be)]:[],_.div({class:"cms-header-main"},...R.length?[_.div({class:Z(["cms-header-body",e.bodyClass,e.centerClass])},...R)]:[y],...j.length?[_.div({class:Z(["cms-header-end",e.endClass])},...j)]:[]));return At(d,e),d},Ae.Drawer=(...t)=>{var Ie,Ye,rt,Xe,We,w,ie,$e,F,f;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i={...e},c=r=>Object.prototype.hasOwnProperty.call(e,r),S=(Ie=e.stateKey)!=null?Ie:Gn;S&&(Gn=S,_n=ns(S));const u=()=>ns(S),a=()=>Fn(!0,S),b=()=>Fn(!1,S),M=()=>Fn(!u(),S),N={props:e,stateKey:S,isDrawerOpen:u,openDrawer:a,closeDrawer:b,toggleDrawer:M,toggleAside:M},C=JSswift==null?void 0:JSswift.store,z=!!(C!=null&&C.get&&(C!=null&&C.set)),U=`${S}:groups`,W=`${S}:active`;let ge=z?C.get(U,{})||{}:{},B=z&&(Ye=C.get(W,null))!=null?Ye:null;const ne=new Map,he=new Map,q=r=>{const x=o(r);return x==null||x===!1?[]:Array.isArray(x)?x.flat(1/0):[x]},se=(r,x,de=N)=>{const Be=Array.isArray(r)?r:[r];for(const He of Be)if(JSswift.ui.getSlot(s,He)!=null)return T(s,He,de,x);return x==null?[]:T(null,"default",de,o(x))},le=r=>(Array.isArray(r)?r:[r]).some(de=>JSswift.ui.getSlot(s,de)!=null),fe=r=>{if(typeof o(r.external)=="boolean")return!!o(r.external);const x=o(r.href||r.to||r.link||"");return/^(https?:)?\/\//.test(x)},be=(rt=e.closeOnSelect)!=null?rt:!0,re=r=>!!be&&o(r.keepOpen)!==!0,ue=(We=(Xe=e.itemIconSize)!=null?Xe:e.size)!=null?We:"md",O=(w=e.groupOpenIcon)!=null?w:"arrow_drop_up",Y=(ie=e.groupCloseIcon)!=null?ie:"arrow_drop_down",oe=r=>!!r&&B===r,we=r=>!!r&&!!B&&(B===r||B.startsWith(`${r}::`)),R=()=>{ne.forEach(({el:r,baseActive:x},de)=>{const Be=!!x||oe(de);r.classList.toggle("active",Be),Be?r.setAttribute("aria-current","page"):r.removeAttribute("aria-current")}),he.forEach(({wrap:r,toggle:x,baseActive:de},Be)=>{const He=!!de||we(Be);r.classList.toggle("active",He),x.classList.toggle("active",He)})},h=r=>{B=r||null,z&&C.set(W,B),R()},m=(r,x)=>{if(o(r.active)!=null)return!!o(r.active);if(o(r.current)!=null)return!!o(r.current);if(!x||fe(r))return!1;try{if(x.startsWith("#"))return window.location.hash===x;const de=`${window.location.pathname}${window.location.search}${window.location.hash}`;return x===de||x===window.location.pathname}catch(de){return!1}},y=(r,x,de)=>m(r,x)||oe(de),j=(r=[],x=0,de=[])=>q(r).some((Be,He)=>{var Nt,Et,Rt,Mt,vt;const Se=o(Be);if(!Se||typeof Se!="object"||Se.nodeType)return!1;const Oe=o(Se.href||Se.to||Se.link||""),at=(vt=o((Mt=(Rt=(Et=(Nt=Se.label)!=null?Nt:Se.title)!=null?Et:Se.text)!=null?Rt:Oe)!=null?Mt:null))!=null?vt:`item-${x}-${He}`,nt=g(Se,at,x,He),Ze=de.concat(nt).join("::");if(y(Se,Oe,Ze))return!0;const wt=Se.items||Se.children||Se.sub;return j(wt,x+1,de.concat(nt))}),X=(r,x={})=>{var He;const de=o(r);if(de==null||de===!1)return[];const Be=typeof de=="string"?Ae.Icon({name:de,size:(He=x.iconSize)!=null?He:ue}):JSswift.ui.slot(de,{...x,as:"icon"});return T(null,"default",x,Be)},d=(r,x,de={})=>{const Be=X(r,de);return Be.length?[_.span({class:Z(["cms-drawer-item-icon",x])},...Be)]:[]},k=r=>{const x=o(r.iconPosition)||"left",de=Object.prototype.hasOwnProperty.call(r,"iconLeft")?r.iconLeft:x!=="right"?r.icon:null,Be=Object.prototype.hasOwnProperty.call(r,"iconRight")?r.iconRight:x==="right"?r.icon:null;return{left:de,right:Be}},g=(r,x,de,Be)=>o(r.key||r.id||r.to||r.href||x||`item-${de}-${Be}`),P=(r,x)=>z&&Object.prototype.hasOwnProperty.call(ge,r)?!!ge[r]:x,K=(r,x)=>{z&&(ge={...ge,[r]:!!x},C.set(U,ge))},ee=()=>{const r={...N,area:"header"},x=se(["headerIcon","icon"],e.icon,r),de=se(["eyebrow"],e.eyebrow,r),Be=se(["title"],e.title,r),He=se(["subtitle"],e.subtitle,r),Se=se(["meta"],e.meta,r),Oe=se(["content"],e.content,r),at=se(["actions"],e.actions,r),nt=c("header")?T(null,"default",r,o(e.header)):[],Ze=x.length||de.length||Be.length||He.length||Se.length||Oe.length||at.length;return!Ze&&!nt.length?[]:Ze?[_.div({class:Z(["cms-drawer-header",e.headerClass])},...x.length?[_.div({class:"cms-drawer-header-icon"},...x)]:[],_.div({class:"cms-drawer-header-body"},...de.length?[_.div({class:"cms-drawer-header-eyebrow"},...de)]:[],...Be.length?[_.div({class:"cms-drawer-header-title"},...Be)]:[],...He.length?[_.div({class:"cms-drawer-header-subtitle"},...He)]:[],...Se.length?[_.div({class:"cms-drawer-header-meta"},...Se)]:[],...Oe.length?[_.div({class:"cms-drawer-header-content"},...Oe)]:[],...nt.length?[_.div({class:"cms-drawer-header-extra"},...nt)]:[]),...at.length?[_.div({class:"cms-drawer-header-actions"},...at)]:[])]:nt},Ce=(r,x,de)=>{var Se,Oe;return!(((Se=r.onClick)==null?void 0:Se.call(r,de,x))===!1||de!=null&&de.defaultPrevented||((Oe=e.onSelect)==null?void 0:Oe.call(e,r,x,de))===!1||de!=null&&de.defaultPrevented)},E=(r,x,de={})=>{const Be=x.hasChildren?"group":"item",He=T(s,`${Be}Label`,x,x.label),Se=T(s,`${Be}Note`,x,x.note),Oe=T(s,`${Be}Badge`,x,x.badge),at=T(s,`${Be}Aside`,x,x.aside),nt=T(s,`${Be}Content`,x,x.content),Ze=[];return(He.length||Se.length||Oe.length||at.length)&&Ze.push(_.div({class:"cms-drawer-item-top"},_.div({class:"cms-drawer-item-copy"},...He.length?[_.div({class:"cms-drawer-item-label"},...He)]:[],...Se.length?[_.div({class:"cms-drawer-item-note"},...Se)]:[]),...Oe.length||at.length?[_.div({class:"cms-drawer-item-meta"},...Oe.length?[_.div({class:"cms-drawer-item-badge"},...Oe)]:[],...at.length?[_.div({class:"cms-drawer-item-aside"},...at)]:[])]:[])),nt.length&&Ze.push(_.div({class:"cms-drawer-item-content"},...nt)),[...de.start||[],...d(x.iconLeft,"left",x),...Ze.length?[_.div({class:"cms-drawer-item-main"},...Ze)]:[],...d(x.iconRight,"right",x),...de.end||[]]},p=(r=[],x=0,de=[])=>q(r).map((Be,He)=>{var os,is,ls,qe,pt,Ft,Gt,tn,sn,v,ce;const Se=o(Be);if(Se==null||Se===!1)return null;if(Se.nodeType||typeof Se!="object"||Array.isArray(Se))return _.div({class:"cms-drawer-custom","data-level":String(x)},...T(null,"default",{...N,item:Se,level:x,index:He,path:de},Se));if(o(Se.hidden)===!0||o(Se.visible)===!1)return null;const Oe=q(Se.items||Se.children||Se.sub),at=o(Se.href||Se.to||Se.link||null),nt=o((qe=(ls=(is=(os=Se.label)!=null?os:Se.title)!=null?is:Se.text)!=null?ls:at)!=null?qe:null),Ze=nt!=null?nt:`item-${x}-${He}`,wt=o((Gt=(Ft=(pt=Se.note)!=null?pt:Se.subtitle)!=null?Ft:Se.description)!=null?Gt:null),Nt=o((tn=Se.badge)!=null?tn:null),Et=o((v=(sn=Se.aside)!=null?sn:Se.meta)!=null?v:null),Rt=o((ce=Se.content)!=null?ce:null),Mt=g(Se,Ze,x,He),vt=de.concat(Mt).join("::"),{left:Dt,right:ft}=k(Se),Ht=Bt(o(Se.state)||o(Se.color)||""),qt=m(Se,at),Xt=qt||oe(vt),Ot=!!o(Se.disabled),Qt={...N,item:Se,index:He,level:x,path:de,label:Ze,note:wt,badge:Nt,aside:Et,content:Rt,itemStateKey:vt,iconLeft:Dt,iconRight:ft,iconSize:o(Se.iconSize)||ue,active:Xt,disabled:Ot,hasChildren:!1},cn=o(Se.divider)===!0||Se.type==="divider"||Se.type==="separator",un=o(Se.section)===!0||Se.type==="section"||Se.type==="heading"||Se.type==="label",Zt=Se.type==="content"||Se.type==="custom"||!at&&!Oe.length&&!o(Se.button)&&Se.type!=="button"&&nt==null&&Rt!=null;if(cn)return _.div({class:Z(["cms-drawer-separator",Se.class]),"data-level":String(x)});if(un){const Je=T(s,"sectionLabel",Qt,Ze||Rt);return _.div({class:Z(["cms-drawer-section-label",Se.class]),"data-level":String(x)},...Je)}if(Zt){const Je=T(s,"item",Qt,Rt!=null?Rt:Ze);return _.div({class:Z(["cms-drawer-custom",Ht?`cms-drawer-tone-${Ht}`:"",Se.class]),style:Se.style,"data-level":String(x)},...Je)}if(Oe.length){const Je=qt||j(Oe,x+1,de.concat(Mt)),it=Je||we(vt);let lt=P(vt,!!o(Se.expanded)||!!o(Se.open)||it);const ct=_.span({class:"cms-drawer-group-icon"}),mt={...Qt,active:it,hasChildren:!0,isOpen:()=>lt,setOpen:mn=>Sn(mn),toggle:()=>Sn(!lt)},Jt=()=>{var qn,Yn;const mn=lt?(qn=Se.openIcon)!=null?qn:O:(Yn=Se.closeIcon)!=null?Yn:Y,Tn=o(lt?Se.iconSidePosition||Se.openIconSide||Se.openIconPosition||"right":Se.iconSidePosition||Se.closeIconSide||Se.closeIconPosition||"right")==="left"?"left":"right";ct.innerHTML="",ct.className=`cms-drawer-group-icon ${Tn}`,X(mn,{...mt,as:"toggleIcon"}).forEach(Ls=>ct.appendChild(Ls))},Yt=_.button({type:"button",class:Z(["cms-drawer-group-toggle","cms-drawer-entry",lt?"open":"",it?"active":"",Ot?"is-disabled":"",Ht?`cms-drawer-tone-${Ht}`:"",Se.class]),style:Se.style,"data-level":String(x),"aria-expanded":String(lt),"aria-disabled":Ot?"true":null,onClick:mn=>{if(Ot){mn.preventDefault();return}h(vt),Sn(!lt)}},...E(Se,mt,{start:o(Se.iconSidePosition||Se.openIconSide||Se.closeIconSide||Se.openIconPosition||Se.closeIconPosition||"right")==="left"?[ct]:[],end:o(Se.iconSidePosition||Se.openIconSide||Se.closeIconSide||Se.openIconPosition||Se.closeIconPosition||"right")==="right"?[ct]:[]})),ln=T(s,"group",mt,null),nn=_.div({class:"cms-drawer-group-items"},...p(Oe,x+1,de.concat(Mt))),An=_.div({class:Z(["cms-drawer-group",lt?"open":"",it?"active":"",Ht?`cms-drawer-tone-${Ht}`:""]),"data-level":String(x)},...ln.length?ln:[Yt],nn),Sn=mn=>{lt=!!mn,An.classList.toggle("open",lt),Yt.classList.toggle("open",lt),Yt.setAttribute("aria-expanded",String(lt)),Jt(),K(vt,lt)};return he.set(vt,{wrap:An,toggle:Yt,baseActive:Je}),Jt(),An}const pn=T(s,"item",Qt,null),en=o(Se.button)===!0||Se.type==="button"||!at&&typeof Se.onClick=="function",rn={class:Z(["cms-drawer-entry",en?"cms-drawer-btn":"cms-drawer-link",Xt?"active":"",Ot?"is-disabled":"",Ht?`cms-drawer-tone-${Ht}`:"",Se.class]),style:Se.style,"data-level":String(x),"aria-current":Xt?"page":null,"aria-disabled":Ot?"true":null},Vn=pn.length?pn:E(Se,Qt);if(en){const Je=_.button({...rn,type:Se.buttonType||"button",disabled:Ot,onClick:it=>{if(Ot){it.preventDefault();return}Ce(Se,Qt,it)&&(h(vt),re(Se)&&b())}},...Vn);return ne.set(vt,{el:Je,baseActive:qt}),Je}const dn=fe(Se),hs=dn?o(Se.target)||"_blank":o(Se.target),As=dn?o(Se.rel)||"noopener noreferrer":o(Se.rel),ss=_.a({...rn,href:at||"#",target:hs||null,rel:As||null,tabIndex:Ot?-1:null,onClick:Je=>{var it;if(Ot){Je.preventDefault();return}Ce(Se,Qt,Je)&&(!dn&&Se.to&&((it=bt.router)!=null&&it.navigate)&&(Je.preventDefault(),bt.router.navigate(Se.to)),re(Se)&&b())}},...Vn);return ne.set(vt,{el:ss,baseActive:qt}),ss}).filter(Boolean),A=se(["before","beforeItems"],($e=e.before)!=null?$e:e.beforeItems),L=le(["body"])?se(["body"],null):[],ae=p(e.items||[]),ke=se(["default"],n),Te=se(["after","afterItems"],(F=e.after)!=null?F:e.afterItems),ze=L.length?L:[...A,...ae,...ke,...Te],V=c("empty")||c("emptyText")?(f=e.empty)!=null?f:_.div({class:Z(["cms-drawer-empty",e.emptyClass])},e.emptyText||"Nessun contenuto"):_.div({class:Z(["cms-drawer-empty",e.emptyClass])},"Nessun contenuto"),H=se(["header"],ee()),te=se(["footer"],e.footer),De=ze.length?ze:se(["empty"],V),je=JSswift.omit(i,["items","header","footer","before","beforeItems","after","afterItems","title","subtitle","eyebrow","icon","content","meta","actions","empty","emptyText","closeOnSelect","groupOpenIcon","groupCloseIcon","stateKey","sticky","slots","headerClass","bodyClass","footerClass","emptyClass","itemIconSize","gap","indent","padding","minHeight","maxHeight","width","onSelect"]);je.class=Z(["cms-panel","cms-drawer",_n?"open":"",ye(e.sticky,"sticky"),i.class]),je.style={...i.style||{}},e.gap!=null&&(je.style["--cms-drawer-gap"]=gt(o(e.gap))),e.indent!=null&&(je.style["--cms-drawer-indent"]=gt(o(e.indent))),e.padding!=null&&(je.style["--cms-drawer-padding"]=gt(o(e.padding))),e.width!=null&&(je.style.width=gt(o(e.width))),e.minHeight!=null&&(je.style.minHeight=gt(o(e.minHeight))),e.maxHeight!=null&&(je.style.maxHeight=gt(o(e.maxHeight)));const _e=_.div(je,...H.length?H:[],_.div({class:Z(["cms-drawer-body",e.bodyClass])},...De),...te.length?[_.div({class:Z(["cms-drawer-footer",e.footerClass])},...te)]:[]),Me=Po.get(S)||new Set;return Me.add(_e),Po.set(S,Me),Fn(_n,S),_e.isDrawerOpen=u,_e.openDrawer=a,_e.closeDrawer=b,_e.toggleDrawer=M,_e.setActiveItem=h,At(_e,e),R(),_e},Ae.Page=(...t)=>{var y,j,X,d;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i={...e},c=(k,g)=>{var P;return!!(k&&k.nodeType===1&&((P=k.classList)!=null&&P.contains(`cms-page-${g}`)))},S=k=>k==null?null:typeof k=="string"?Ae.Icon({name:k,size:e.iconSize||e.size||"xl"}):JSswift.ui.slot(k,{as:"icon"}),u={dense:!!o(e.dense),flat:!!o(e.flat),centered:!!o(e.centered),narrow:!!o(e.narrow)},a=(k,g)=>{if(!(g==null||g===!1)){if(Array.isArray(g)){g.forEach(P=>a(k,P));return}if(g!=null&&g.nodeType){k.appendChild(g);return}k.appendChild(document.createTextNode(String(g)))}},b=(k,g,P=K=>K)=>{const K=JSswift.ui.getSlot(s,k);if(K!=null)return T(s,k,u,null);if(typeof g=="function"){const ee=new Set(["eyebrow","title","subtitle"]),Ce=_[ee.has(k)?"span":"div"]({class:`cms-page-slot-${k}`});return JSswift.reactive.effect(()=>{const E=P(g(u)),p=xn(JSswift.ui.slot(E));Ce.replaceChildren(),Array.isArray(p)?p.forEach(A=>a(Ce,A)):a(Ce,p)},`UI.Page:${k}`),[Ce]}return T(s,k,u,P(g))},M=T(s,"default",u,n!=null&&n.length?n:[]),N={hero:[],header:[],body:[],footer:[],actions:[]},C=[];M.forEach(k=>{c(k,"hero")?N.hero.push(k):c(k,"header")?N.header.push(k):c(k,"body")?N.body.push(k):c(k,"footer")?N.footer.push(k):c(k,"actions")?N.actions.push(k):C.push(k)});const z=b("icon",e.icon,S),U=b("hero",(y=e.hero)!=null?y:e.banner),W=b("eyebrow",(j=e.eyebrow)!=null?j:e.kicker),ge=b("title",e.title),B=b("subtitle",(X=e.subtitle)!=null?X:e.description),ne=b("header",e.header),he=b("aside",e.aside),q=b("body",(d=e.body)!=null?d:e.content),se=b("footer",e.footer),le=b("actions",e.actions),fe=U.length?_.div({class:Z(["cms-page-hero",e.heroClass])},...U):null,be=z.length||W.length||ge.length||B.length||ne.length||he.length,re=be?_.div({class:Z(["cms-page-header",e.headerClass])},_.div({class:"cms-page-head"},z.length?_.div({class:Z(["cms-page-icon",e.iconClass])},...z):null,_.div({class:"cms-page-head-main"},W.length?_.div({class:Z(["cms-page-eyebrow",e.eyebrowClass])},...W):null,ge.length?_.div({class:Z(["cms-page-title",e.titleClass])},...ge):null,B.length?_.div({class:Z(["cms-page-subtitle",e.subtitleClass])},...B):null,ne.length?_.div({class:Z(["cms-page-header-content",e.headerContentClass])},...ne):null),he.length?_.div({class:Z(["cms-page-aside",e.asideClass])},...he):null)):null,ue=[...q,...C],O=ue.length?_.div({class:Z(["cms-page-body",e.bodyClass])},...ue):null,Y=[...le,...N.actions],oe=se.length||Y.length?_.div({class:Z(["cms-page-footer",e.footerClass])},...se,Y.length?_.div({class:"cms-page-actions"},...Y):null):null,we=!!(U.length||N.hero.length),R=!!(be||N.header.length),h=JSswift.omit(i,["actions","aside","asideClass","banner","body","bodyClass","centered","content","dense","description","eyebrow","eyebrowClass","flat","footer","footerClass","gap","header","headerClass","headerContentClass","headerGap","hero","heroClass","heroPadding","icon","iconClass","iconSize","kicker","maxWidth","minHeight","narrow","padding","size","slots","subtitle","subtitleClass","title","titleClass"]);h.class=Z(["cms-panel","cms-page",ye(e.dense,"dense"),ye(e.flat,"cms-page-flat"),ye(e.centered,"cms-page-centered"),ye(e.narrow,"cms-page-narrow"),ye(we,"cms-page-has-hero"),ye(R,"cms-page-has-header"),i.class]),h.style={...i.style||{}},(e.gap!=null||Ke(e.gap))&&(h.style["--cms-page-gap"]=Ge(e.gap,gt)),(e.padding!=null||Ke(e.padding))&&(h.style["--cms-page-padding"]=Ge(e.padding,gt)),(e.maxWidth!=null||Ke(e.maxWidth))&&(h.style["--cms-page-max-width"]=Ge(e.maxWidth,gt)),(e.minHeight!=null||Ke(e.minHeight))&&(h.style["--cms-page-min-height"]=Ge(e.minHeight,gt)),(e.headerGap!=null||Ke(e.headerGap))&&(h.style["--cms-page-header-gap"]=Ge(e.headerGap,gt)),(e.heroPadding!=null||Ke(e.heroPadding))&&(h.style["--cms-page-hero-padding"]=Ge(e.heroPadding,gt));const m=_.div(h,fe,...N.hero,re,...N.header,O,...N.body,oe,...N.footer);return At(m,e),m},Ae.AppShell=(...t)=>{var k,g;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=(P,K)=>!!P&&Object.prototype.hasOwnProperty.call(P,K),c=o(e.noDrawer)===!0||e.drawer===!1,S=o(e.reverse)===!0,u=o(e.stack)===!0,a=(g=(k=e.drawerStateKey)!=null?k:e.stateKey)!=null?g:Gn;a&&(Gn=a,_n=ns(a));const b={props:e,noDrawer:c,stateKey:a,isDrawerOpen:()=>ns(a),openDrawer:()=>Fn(!0,a),closeDrawer:()=>Fn(!1,a),toggleDrawer:()=>Fn(!ns(a),a)},M=e.headerProps&&typeof e.headerProps=="object"?{...e.headerProps}:{};let N=e.header;!i(e,"header")&&(Object.keys(M).length||i(e,"title")||i(e,"subtitle")||i(e,"left")||i(e,"right"))&&(!i(M,"title")&&i(e,"title")&&(M.title=e.title),!i(M,"subtitle")&&i(e,"subtitle")&&(M.subtitle=e.subtitle),!i(M,"left")&&i(e,"left")&&(M.left=e.left),!i(M,"right")&&i(e,"right")&&(M.right=e.right),i(M,"drawerStateKey")||(M.drawerStateKey=a),c&&!i(M,"left")&&(M.left=!1),N=Ae.Header(M));const C=e.drawerProps&&typeof e.drawerProps=="object"?{...e.drawerProps}:{},z=i(e,"drawerItems")?e.drawerItems:e.items,U=i(e,"drawerHeader")?e.drawerHeader:void 0;let W=e.drawer;!i(e,"drawer")&&!c&&(Object.keys(C).length||z!=null||U!=null)&&(!i(C,"items")&&z!=null&&(C.items=z),!i(C,"header")&&U!=null&&(C.header=U),i(C,"stateKey")||(C.stateKey=a),W=Ae.Drawer(C));const ge=e.pageProps&&typeof e.pageProps=="object"?{...e.pageProps}:{},B=i(e,"content")?e.content:n,ne=T(s,"default",b,B);let he=e.page;!i(e,"page")&&(Object.keys(ge).length||ne.length)&&(he=Ae.Page(ge,...ne));const q=e.footerProps&&typeof e.footerProps=="object"?{...e.footerProps}:{},se=i(e,"footerContent")?e.footerContent:void 0;let le=e.footer;!i(e,"footer")&&(Object.keys(q).length||se!=null)&&(le=Ae.Footer(q,...T(null,"default",b,se)));const fe=T(s,"header",b,N),be=c?[]:T(s,"drawer",b,W),re=T(s,"page",b,he),ue=T(s,"footer",b,le),O=Z(["cms-app","cms-app-shell",ye(c,"no-drawer"),ye(S,"is-reverse"),ye(u,"is-stack"),ye(e.flush,"is-flush"),ye(e.divider,"is-divider"),e.class]),Y=JSswift.omit(e,["header","drawer","page","footer","content","title","subtitle","left","right","items","drawerItems","drawerHeader","headerProps","drawerProps","pageProps","footerProps","footerContent","noDrawer","reverse","stack","flush","divider","drawerStateKey","stateKey","drawerWidth","gap","padding","slots"]);Y.class=O,Y.style={...e.style||{}};const oe=Ge(e.drawerWidth,gt);oe!=null&&(Y.style["--cms-app-shell-drawer-width"]=oe);const we=Ge(e.gap,gt);we!=null&&(Y.style["--cms-app-shell-gap"]=we);const R=Ge(e.padding,gt);R!=null&&(Y.style["--cms-app-shell-padding"]=R);const h=fe.length?_.div({class:"cms-app-shell-header-slot"},...fe):null,m=be.length?_.div({class:"cms-app-shell-drawer-slot"},...be):null,y=re.length?_.div({class:"cms-app-shell-page-slot"},...re):null,j=ue.length?_.div({class:"cms-app-shell-footer-slot"},...ue):null,X=S?[y,m]:[m,y],d=_.div(Y,...h?[h]:[],_.div({class:"cms-app-shell-body"},...X.filter(Boolean)),...j?[j]:[]);return d.openDrawer=b.openDrawer,d.closeDrawer=b.closeDrawer,d.toggleDrawer=b.toggleDrawer,d.isDrawerOpen=b.isDrawerOpen,d.header=h,d.drawer=m,d.page=y,d.footer=j,At(d,e),d},Ae.Parallax=function(...e){var P,K;const{props:n,children:s}=JSswift.uiNormalizeArgs(e),i=n.slots||{},c={...n};c.color!=null&&c.textColor==null&&(c.textColor=c.color),delete c.color,vn(c);const S=xt(n.state,()=>{const ee=Bt(o(n.state));return ee?`cms-state-${ee}`:""}),u=ee=>{if(ee==null||ee===!1||ee==="")return"";const Ce=String(ee);return In(Ce)?`var(--cms-${Ce})`:Ce},a=()=>{const ee=o(n.background);if(ee)return String(ee);const Ce=o(n.image)||o(n.src)||"";if(!Ce)return"linear-gradient(120deg, #1b2c5a, #2f6d8f, #2a8f5c)";const E=String(Ce);return/^url\(/i.test(E)||/gradient\(/i.test(E)||/^var\(/i.test(E)?E:`url(${E})`},b=(ee,Ce)=>{const E=Number(o(ee));return Number.isFinite(E)?E:Ce},M={speed:()=>{var ee;return(ee=o(n.speed))!=null?ee:.18},state:()=>o(n.state)||"",disabled:()=>!!o(n.disabled)},N=T(i,"badge",M,n.badge),C=T(i,"background",M,n.backgroundContent),z=T(i,"eyebrow",M,(P=n.eyebrow)!=null?P:n.kicker),U=T(i,"title",M,n.title),W=T(i,"subtitle",M,n.subtitle),ge=T(i,"header",M,n.header),B=T(i,"aside",M,n.aside),ne=T(i,"media",M,n.media),he=T(i,"content",M,(K=n.content)!=null?K:n.body),q=T(i,"default",M,s!=null&&s.length?s:[]),se=T(i,"footer",M,n.footer),le=T(i,"actions",M,n.actions),fe=[...he,...q],be=N.length?_.div({class:Z(["cms-parallax-badge",n.badgeClass])},...N):null,re=z.length||U.length||W.length||ge.length||B.length,ue=re?_.div({class:Z(["cms-parallax-header",n.headerClass])},_.div({class:"cms-parallax-head"},_.div({class:"cms-parallax-head-main"},z.length?_.div({class:Z(["cms-parallax-eyebrow",n.eyebrowClass])},...z):null,U.length?_.div({class:Z(["cms-parallax-title",n.titleClass])},...U):null,W.length?_.div({class:Z(["cms-parallax-subtitle",n.subtitleClass])},...W):null,ge.length?_.div({class:Z(["cms-parallax-header-content",n.headerContentClass])},...ge):null),B.length?_.div({class:Z(["cms-parallax-aside",n.asideClass])},...B):null)):null,O=ne.length?_.div({class:Z(["cms-parallax-media",n.mediaClass])},...ne):null,Y=fe.length?_.div({class:Z(["cms-parallax-body",n.bodyClass])},...fe):null,oe=se.length||le.length?_.div({class:Z(["cms-parallax-footer",n.footerClass])},se.length?_.div({class:"cms-parallax-footer-content"},...se):null,le.length?_.div({class:"cms-parallax-actions"},...le):null):null,we=JSswift.omit(c,["actions","align","aside","asideClass","background","backgroundContent","backgroundContentClass","badge","badgeClass","bgClass","bgPosition","bgRepeat","bgSize","body","bodyClass","color","content","contentClass","contentMaxWidth","disabled","eyebrow","eyebrowClass","footer","footerClass","gap","header","headerClass","headerContentClass","height","image","imageAlt","imageClass","innerClass","justify","kicker","maxOffset","media","mediaClass","minHeight","overlay","padding","slots","speed","src","startTop","state","subtitle","subtitleClass","textColor","title","titleClass"]);we.class=Z(["cms-parallax","cms-singularity",S,ye(n.disabled,"cms-parallax-static"),ye(be,"cms-parallax-has-badge"),ye(re,"cms-parallax-has-header"),c.class]),we.style={...c.style||{}},n.height!=null&&(we.style["--cms-parallax-height"]=Ge(n.height,gt)),n.minHeight!=null&&(we.style["--cms-parallax-min-height"]=Ge(n.minHeight,gt)),n.padding!=null&&(we.style["--cms-parallax-padding"]=Ge(n.padding,gt)),n.gap!=null&&(we.style["--cms-parallax-gap"]=Ge(n.gap,gt)),n.contentMaxWidth!=null&&(we.style["--cms-parallax-content-max-width"]=Ge(n.contentMaxWidth,gt)),n.justify!=null&&(we.style["--cms-parallax-justify"]=Ge(n.justify)),n.align!=null&&(we.style["--cms-parallax-align"]=Ge(n.align)),n.color!=null&&(we.style["--cms-parallax-color"]=Ge(n.color,u)),n.overlay!=null&&(we.style["--cms-parallax-overlay"]=Ge(n.overlay)),n.bgPosition!=null&&(we.style["--cms-parallax-position"]=Ge(n.bgPosition)),n.bgSize!=null&&(we.style["--cms-parallax-size"]=Ge(n.bgSize)),n.bgRepeat!=null&&(we.style["--cms-parallax-repeat"]=Ge(n.bgRepeat)),we.style["--cms-parallax-image"]=Ke(n.background)||Ke(n.image)||Ke(n.src)?()=>a():a();const R=_.div({class:Z(["cms-parallax-bg",n.bgClass])},C.length?_.div({class:Z(["cms-parallax-bg-content",n.backgroundContentClass])},...C):null),h=_.div({class:Z(["cms-parallax-content",n.contentClass,n.innerClass])},be,ue,O,Y,oe),m=_.div(we,R,h);let y=!1,j=!1,X=null;const d=()=>{var ee;y||(y=!0,typeof window!="undefined"&&(window.removeEventListener("scroll",g),window.removeEventListener("resize",g)),(ee=X==null?void 0:X.disconnect)==null||ee.call(X),X=null)},k=()=>{if(y)return;if(!m.isConnected){d();return}if(o(n.disabled)){R.style.transform="translate3d(0, 0, 0)",m.style.setProperty("--cms-parallax-offset","0px");return}const ee=m.getBoundingClientRect(),Ce=b(n.speed,.18),E=Math.abs(b(n.maxOffset,96)),p=o(n.startTop),A=p!=null&&p!==""?(ee.top-b(n.startTop,0))*Ce:((typeof window!="undefined"&&(window.innerHeight||document.documentElement.clientHeight)||0)/2-(ee.top+ee.height/2))*Ce,ae=`${(E>0?Math.max(-E,Math.min(E,A)):A).toFixed(2)}px`;R.style.transform=`translate3d(0, ${ae}, 0)`,m.style.setProperty("--cms-parallax-offset",ae)};function g(){y||j||(j=!0,requestAnimationFrame(()=>{j=!1,k()}))}return typeof window!="undefined"&&(window.addEventListener("scroll",g,{passive:!0}),window.addEventListener("resize",g),typeof ResizeObserver!="undefined"&&(X=new ResizeObserver(()=>{g()}),X.observe(m)),requestAnimationFrame(()=>{g()}),setTimeout(()=>{g()},90)),m.refresh=()=>(g(),m),m.update=m.refresh,m.destroy=()=>(d(),m.remove(),null),m._dispose=d,At(m,n),m};const[bo,wo]=bt.reactive.signal([]),vo=new Map;function Ro(t){const e=vo.get(t);e&&(clearTimeout(e),vo.delete(t))}function Mo(t){return t?(Ro(t),wo(bo().filter(e=>e.id!==t)),t):null}function qi(){for(const t of vo.keys())Ro(t);wo([])}function si(t){t!=null&&t.id&&(Ro(t.id),t.timeout>0&&vo.set(t.id,setTimeout(()=>{Mo(t.id)},t.timeout)))}function oi(t,e={}){if(!t)return null;let n=null;return wo(bo().map(s=>s.id!==t?s:(n=$n({...s,...e,id:s.id},e.type||e.state||e.color||s.type),n))),n&&si(n),(n==null?void 0:n.id)||null}function Yi(t){const e=()=>Mo(t.id),n=(ge={})=>oi(t.id,ge),s={toast:t,id:t.id,close:e,update:n},i=ge=>typeof ge=="function"?ge(s):ge,c=(()=>{if(t.icon===!1||t.icon===null)return null;if(t.icon!=null){const B=i(t.icon);return typeof B=="string"?Ae.Icon({name:B,size:"sm"}):JSswift.ui.slot(B,{as:"icon"})}const ge=Ui[t.type];return ge?Ae.Icon({name:ge,size:"sm"}):null})(),S=T(t.slots,"icon",s,c),u=T(t.slots,"title",s,i(t.title)),a=T(t.slots,"message",s,i(t.message)),b=T(t.slots,"description",s,i(t.description)),M=T(t.slots,"meta",s,i(t.meta)),N=T(t.slots,"actions",s,i(t.actions)),C=T(t.slots,"default",s,i(t.body)),z=T(t.slots,"dismiss",s,i(t.dismiss)),U=z.length?z:t.closable?[Ae.Btn({class:"cms-toast-close",outline:!0,size:"xs","aria-label":t.dismissLabel,onClick:e},Ae.Icon({name:"close",size:"xs"}))]:[],W=_.div({class:Z(["cms-toast",`cms-toast-${t.type}`,`cms-toast-${t.variant}`,ye(t.closable,"is-closable"),t.class]),style:t.style||{},role:t.role},S.length?_.div({class:"cms-toast-icon"},...S):null,_.div({class:"cms-toast-main"},_.div({class:"cms-toast-copy"},u.length?_.div({class:"cms-toast-title"},...u):null,a.length?_.div({class:"cms-toast-message"},...a):null,b.length?_.div({class:"cms-toast-description"},...b):null,C.length?_.div({class:"cms-toast-body"},...C):null,M.length?_.div({class:"cms-toast-meta"},...M):null),N.length?_.div({class:"cms-toast-actions"},...N):null),U.length?_.div({class:"cms-toast-dismiss"},...U):null);return At(W,t),W}function Xi(){let t=document.querySelector(".cms-toast-layer");return t||(t=document.createElement("div"),t.className="cms-toast-layer",document.body.appendChild(t),bt.reactive.effect(()=>{const e=bo();t.innerHTML="";const n=new Map;for(const s of e){const i=ti(s.position);n.has(i)||n.set(i,[]),n.get(i).push(s)}for(const s of ei){const i=n.get(s);if(!(i!=null&&i.length))continue;const c=_.div({class:Z(["cms-toast-wrap",`is-${s}`])},...i.map(S=>Yi(S)));t.appendChild(c)}},"JSswiftUI:toasts"),t)}function Qi(t={}){Xi();const e=$n(t);return e.id=e.id||Math.random().toString(36).slice(2),wo([...bo().filter(n=>n.id!==e.id),e]),si(e),e.id}bt.services.notify.show=Qi,bt.services.notify.success=Nn("success","Success"),bt.services.notify.error=Nn("danger","Error"),bt.services.notify.warning=Nn("warning","Warning"),bt.services.notify.info=Nn("info","Info"),bt.services.notify.primary=Nn("primary","Notice"),bt.services.notify.secondary=Nn("secondary","Notice"),bt.services.notify.update=oi,bt.services.notify.remove=Mo,bt.services.notify.clear=qi,bt.services.notify.promise=Ae.Notify.promise,bt.notify=bt.services.notify,JSswift.form=JSswift.form||{},JSswift.form._isPromise=t=>t&&typeof t.then=="function",JSswift.form._normalizeRules=t=>{const e={};for(const n in t||{}){const s=t[n];e[n]=Array.isArray(s)?s:[s]}return e},JSswift.form._runRule=async(t,e,n)=>{let s=t,i=null;t&&typeof t=="object"&&typeof t.rule=="function"&&(s=t.rule,i=t.message||null);const c=s?s(e,n):!0,S=JSswift.form._isPromise(c)?await c:c;return S===!0?null:typeof S=="string"?S:S===!1?i||"Valore non valido":S?null:i||"Valore non valido"},JSswift.useForm=(t={})=>{const e=t.model||{},n=JSswift.form._normalizeRules(t.rules||{}),s=t.validateOn||"submit",i=t.initial||null,c=_.rod({}),S=_.rod({}),u=_.rod(!1),a=_.rod(null),b=()=>e&&typeof e=="object"&&"value"in e?e.value||{}:e,M=fe=>{if(e&&typeof e=="object"&&"value"in e)e.value=fe;else{const be=e||{};for(const re in be)delete be[re];Object.assign(be,fe)}},N=fe=>{const be=b();return be?be[fe]:void 0},C=(fe,be)=>{const re={...b()||{}};re[fe]=be,M(re)},z=(fe,be)=>{const re={...c.value||{}};be?re[fe]=be:delete re[fe],c.value=re},U=fe=>(c.value||{})[fe]||null,W=fe=>{S.value={...S.value||{},[fe]:!0}},ge=fe=>!!(S.value||{})[fe],B=async fe=>{const be=n[fe]||[];if(!be.length)return z(fe,null),!0;const re=N(fe),ue={name:fe,value:re,model:b(),form:le};for(const O of be){if(!O)continue;const Y=await JSswift.form._runRule(O,re,ue);if(Y)return z(fe,Y),!1}return z(fe,null),!0},ne=async()=>{a.value=null;const fe=Object.keys(n);let be=!0;for(const re of fe)await B(re)||(be=!1);return be},le={model:e,errors:c,touched:S,submitting:u,submitError:a,getValue:N,setValue:C,getError:U,setError:z,touch:W,isTouched:ge,field:(fe,be={})=>{var j;const re=_.rod("");(j=re.action)==null||j.call(re,X=>{C(fe,X)});const ue=()=>s==="submit"||s==="input"||s==="blur"?!0:ge(fe);let O=null,Y=!1,oe=!1;const we=async()=>{Y||(Y=!0,W(fe),(s==="blur"||s==="input")&&await B(fe),setTimeout(()=>{Y=!1},0))},R=X=>{O&&(O===X.target||O.contains&&O.contains(X.target)||(we(),O=null,oe&&(oe=!1,document.removeEventListener("pointerdown",R,!0))))},h=()=>{oe||(oe=!0,document.addEventListener("pointerdown",R,!0))},m=async()=>{O=document.activeElement,Y=!1,h(),s==="input"&&await B(fe)},y=async()=>{await we(),O=null,oe&&(oe=!1,document.removeEventListener("pointerdown",R,!0))};return{name:fe,model:re,get value(){return re.value},set value(X){re.value=X},error:()=>ue()?U(fe):null,success:be.success||null,warning:be.warning||null,note:be.note||null,touch:()=>W(fe),validate:()=>B(fe),onInput:m,onBlur:y,hint:be.hint||null}},validateField:B,validate:ne,reset:()=>{a.value=null,c.value={},S.value={},i&&M({...i||{}})},submit:async fe=>{u.value=!0,a.value=null;try{return await ne()?{ok:!0,result:await(fe==null?void 0:fe(b(),le))}:{ok:!1,reason:"validation"}}catch(be){return console.error("[useForm] submit error:",be),a.value=be&&be.message?be.message:String(be),{ok:!1,reason:"exception",error:be}}finally{u.value=!1}}};return le},Ae.Form=(...t)=>{const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.form,i=e.onSubmit,c=Z(["cms-form",e.class]),S=JSswift.omit(e,["form","onSubmit"]);S.class=c;const u=_.form({...S,onSubmit:async b=>{b.preventDefault(),s&&await s.submit(i||(async()=>{}))}}),a=[];for(const b of n||[]){const M=typeof b=="function"?b(s):b,N=JSswift.ui.slot(M);N&&(Array.isArray(N)?a.push(...N):a.push(N))}return a.forEach(b=>u.appendChild(b)),s&&s.submitting&&JSswift.reactive.effect(()=>{u.classList.toggle("is-submitting",!!s.submitting.value)},"UI.Form:submitting"),u},bt.services=bt.services||{},bt.services.dialog=bt.services.dialog||{},bt.dialog=bt.services.dialog;let Ns=null;function ii(){return Ns||(Ns=document.createElement("div"),Ns.setAttribute("data-cms-modal-root","true"),document.body.appendChild(Ns),Ns)}Ae.cardHeader=(...t)=>{const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=Z(["cms-card-header",ye(e.divider,"divider"),e.class]),c=JSswift.omit(e,["divider","align","justify","gap","wrap","direction","slots"]);c.class=i;const S={...e.style||{}},u=Ge(e.align);u!=null&&!Qe(e,"align")&&(S.alignItems=u);const a=Ge(e.justify);a!=null&&!Qe(e,"justify")&&(S.justifyContent=a);const b=Ge(e.wrap,z=>z?"wrap":"nowrap");b!=null&&!Qe(e,"wrap")&&(S.flexWrap=b);const M=Ge(e.direction);M!=null&&!Qe(e,"direction")&&(S.flexDirection=M);const N=Ge(e.gap,gt);N!=null&&!Qe(e,"gap")&&(S.gap=N),Object.keys(S).length&&(c.style=S),JSswift.uiApplyResponsiveProps(c,e,JSswift.uiResponsiveStyleRules);const C=_.div(c,...T(s,"default",{},n));return At(C,e),C},Ae.cardBody=(...t)=>{const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=Z(["cms-card-body",e.class]),c=JSswift.omit(e,["slots","display","direction","wrap","align","justify","gap","rowGap","columnGap","padding","width"]);c.class=i,JSswift.uiApplyResponsiveProps(c,e,JSswift.uiResponsiveStyleRules);const S=_.div(c,...T(s,"default",{},n));return At(S,e),S},Ae.cardFooter=(...t)=>{const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=Z(["cms-card-footer",ye(e.divider,"divider"),e.class]),c=JSswift.omit(e,["divider","align","justify","gap","wrap","direction","slots"]);c.class=i;const S={...e.style||{}},u=Ge(e.align);u!=null&&!Qe(e,"align")&&(S.alignItems=u);const a=Ge(e.justify);a!=null&&!Qe(e,"justify")&&(S.justifyContent=a);const b=Ge(e.wrap,z=>z?"wrap":"nowrap");b!=null&&!Qe(e,"wrap")&&(S.flexWrap=b);const M=Ge(e.direction);M!=null&&!Qe(e,"direction")&&(S.flexDirection=M);const N=Ge(e.gap,gt);N!=null&&!Qe(e,"gap")&&(S.gap=N),Object.keys(S).length&&(c.style=S),JSswift.uiApplyResponsiveProps(c,e,JSswift.uiResponsiveStyleRules);const C=_.div(c,...T(s,"default",{},n));return At(C,e),C},Ae.Dialog=(...t)=>{const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=["primary","secondary","warning","danger","success","info","light","dark"],c=["xs","sm","md","lg","xl","full"];let S={...e},u=null,a=null;const b=(h,m)=>typeof h=="function"?h(m):h,M=h=>String(h||"").split(/\s+/).filter(Boolean),N=(h,m,y)=>{if(!h)return;const j=h[m]||[];j.length&&h.classList.remove(...j);const X=(y||[]).filter(Boolean);X.length&&h.classList.add(...X),h[m]=X},C=(h,m,y,j=X=>X)=>{if(h){if(y==null||y===""){h.style.removeProperty(m);return}h.style.setProperty(m,j(y))}},z=()=>{var d,k,g,P,K,ee;const h=window.visualViewport,m=Math.max(0,Math.round((d=h==null?void 0:h.offsetLeft)!=null?d:0)),y=Math.max(0,Math.round((k=h==null?void 0:h.offsetTop)!=null?k:0)),j=Math.max(0,Math.round((P=(g=h==null?void 0:h.width)!=null?g:window.innerWidth)!=null?P:0)),X=Math.max(0,Math.round((ee=(K=h==null?void 0:h.height)!=null?K:window.innerHeight)!=null?ee:0));return{left:m,top:y,width:j,height:X}},U=h=>{if(!(h!=null&&h.panel))return;const{left:m,top:y,width:j,height:X}=z();C(h.panel,"position","fixed"),C(h.panel,"inset",0,d=>`${d}px`),C(h.panel,"top",y,d=>`${d}px`),C(h.panel,"left",m,d=>`${d}px`),C(h.panel,"right","auto"),C(h.panel,"bottom","auto"),C(h.panel,"width",j,d=>`${d}px`),C(h.panel,"height",X,d=>`${d}px`),C(h.panel,"min-height",X,d=>`${d}px`),C(h.panel,"max-width",j,d=>`${d}px`),C(h.panel,"max-height",X,d=>`${d}px`),C(h.panel,"min-width",0,d=>`${d}px`),C(h.panel,"margin",0,d=>`${d}px`),C(h.panel,"box-sizing","border-box"),C(h.panel,"border-width",0,d=>`${d}px`),C(h.panel,"border-radius",0,d=>`${d}px`),C(h.panel,"transform","none"),C(h.panel,"overflow","hidden"),C(h.panel,"--cms-dialog-fullscreen-left",m,d=>`${d}px`),C(h.panel,"--cms-dialog-fullscreen-top",y,d=>`${d}px`),C(h.panel,"--cms-dialog-fullscreen-width",j,d=>`${d}px`),C(h.panel,"--cms-dialog-fullscreen-height",X,d=>`${d}px`)},W=h=>{h!=null&&h.panel&&(C(h.panel,"position",null),C(h.panel,"inset",null),C(h.panel,"top",null),C(h.panel,"left",null),C(h.panel,"right",null),C(h.panel,"bottom",null),C(h.panel,"width",null),C(h.panel,"height",null),C(h.panel,"min-height",null),C(h.panel,"max-width",null),C(h.panel,"max-height",null),C(h.panel,"min-width",null),C(h.panel,"margin",null),C(h.panel,"box-sizing",null),C(h.panel,"border-width",null),C(h.panel,"border-radius",null),C(h.panel,"transform",null),C(h.panel,"overflow",null),C(h.panel,"--cms-dialog-fullscreen-left",null),C(h.panel,"--cms-dialog-fullscreen-top",null),C(h.panel,"--cms-dialog-fullscreen-width",null),C(h.panel,"--cms-dialog-fullscreen-height",null))},ge=(h,m)=>{var g,P,K,ee,Ce;if(!h)return;if((g=h._dialogViewportCleanup)==null||g.call(h),h._dialogViewportCleanup=null,!m){W(h);return}let y=null;const j=globalThis.requestAnimationFrame||(E=>setTimeout(()=>E(Date.now()),0)),X=globalThis.cancelAnimationFrame||clearTimeout,d=()=>U(h),k=()=>{y!=null&&X(y),y=j(()=>{y=null,d()})};d(),k(),window.addEventListener("resize",d),window.addEventListener("orientationchange",k),(K=(P=window.visualViewport)==null?void 0:P.addEventListener)==null||K.call(P,"resize",d),(Ce=(ee=window.visualViewport)==null?void 0:ee.addEventListener)==null||Ce.call(ee,"scroll",k),h._dialogViewportCleanup=()=>{var E,p,A,L;y!=null&&(X(y),y=null),window.removeEventListener("resize",d),window.removeEventListener("orientationchange",k),(p=(E=window.visualViewport)==null?void 0:E.removeEventListener)==null||p.call(E,"resize",d),(L=(A=window.visualViewport)==null?void 0:A.removeEventListener)==null||L.call(A,"scroll",k)}},B=()=>S,ne=h=>{var y;const m=o((y=h.state)!=null?y:h.color);return m?i.includes(m)?m:String(m):""},he=h=>{const m=o(h.size);return typeof m=="string"&&c.includes(m)?m:""},q=h=>{var y,j,X;const m=String(o((X=(j=(y=h.actionsAlign)!=null?y:h.footerAlign)!=null?j:h.alignActions)!=null?X:"end")).toLowerCase();return["start","left"].includes(m)?"start":["center","middle"].includes(m)?"center":["between","space-between"].includes(m)?"between":["stretch","full"].includes(m)?"stretch":"end"},se=h=>{var y,j,X;const m=String(o((X=(j=(y=h.align)!=null?y:h.verticalAlign)!=null?j:h.position)!=null?X:"center")).toLowerCase();return["top","start","flex-start"].includes(m)?"cms-dialog-align-top":["bottom","end","flex-end"].includes(m)?"cms-dialog-align-bottom":""},le=h=>{var y,j;return((j=(y=h.closable)!=null?y:h.dismissible)!=null?j:h.closeButton)!==!1},fe=()=>{var ae,ke,Te,ze,V,H,te,De;const h=B(),m={close:Y,dismiss:Y,open:O,toggle:we,update:ue,isOpen:oe,entry:()=>u,props:h},y=h.icon!=null?typeof h.icon=="string"?Ae.Icon({name:h.icon,size:h.iconSize||"md"}):JSswift.ui.slot(h.icon,{as:"icon"}):null,j=T(s,"eyebrow",m,b(h.eyebrow,m)),X=T(s,"title",m,b((ke=(ae=h.title)!=null?ae:h.heading)!=null?ke:h.header,m)),d=T(s,"subtitle",m,b((Te=h.subtitle)!=null?Te:h.description,m)),k=T(s,"icon",m,y),g=T(s,"header",m,b((ze=h.headerContent)!=null?ze:h.head,m)),P=le(h)?T(s,"close",m,Ae.Btn({class:"cms-dialog-close",size:"sm",outline:!0,"aria-label":h.closeLabel||"Chiudi dialog","data-dialog-close":!0},Ae.Icon({name:h.closeIcon||"close",size:"sm"}))):[],K=(te=(H=(V=h.content)!=null?V:h.body)!=null?H:h.message)!=null?te:n&&n.length?n:null;let ee=T(s,"content",m,b(K,m));ee.length||(ee=T(s,"body",m,b(K,m))),ee.length||(ee=T(s,"default",m,b(K,m)));const Ce=b((De=h.footer)!=null?De:h.actions,m);let E=T(s,"footer",m,Ce);E.length||(E=T(s,"actions",m,Ce));let p=null;g.length?p=_.div({class:"cms-dialog-head cms-dialog-head-custom"},...g):(j.length||X.length||d.length||k.length||P.length)&&(p=_.div({class:"cms-dialog-head"},k.length?_.div({class:"cms-dialog-icon"},...k):null,_.div({class:"cms-dialog-head-main"},j.length?_.div({class:"cms-dialog-eyebrow"},...j):null,X.length?_.div({class:"cms-dialog-title"},...X):null,d.length?_.div({class:"cms-dialog-subtitle"},...d):null),P.length?_.div({class:"cms-dialog-close-wrap"},...P):null));const A=_.div({class:Z(["cms-dialog-body",h.bodyClass])},...ee),L=E.length?_.div({class:Z(["cms-dialog-actions",`is-${q(h)}`,ye(h.stackActions,"is-stacked"),h.actionsClass,h.footerClass])},...E):null;return _.div({class:Z(["cms-dialog-shell",ye(!!p,"has-head"),ye(!!L,"has-footer"),ye(h.divider!==!1,"with-divider")])},...[p,A,L].filter(Boolean))},be=h=>{var X;if(!(h!=null&&h.panel))return;const m=B(),y=ne(m),j=he(m);N(h.panel,"_dialogClassTokens",["cms-dialog","cms-singularity","cms-clear-set",j?`cms-dialog-${j}`:"",y,y?`cms-state-${y}`:"",o(m.fullscreen)?"fullscreen":"",o(m.scrollable)?"scrollable":"",o(m.stickyHeader)?"sticky-head":"",o(m.stickyActions)?"sticky-actions":"",o(m.borderless)?"borderless":"",...M(m.class),...M(m.panelClass)]),N(h.overlay,"_dialogOverlayClassTokens",[se(m),o(m.backdropBlur)?"cms-dialog-overlay-blur":"",...M(m.overlayClass)]),C(h.panel,"--cms-dialog-width",o(m.width),gt),C(h.panel,"--cms-dialog-min-width",o(m.minWidth),gt),C(h.panel,"--cms-dialog-max-width",o(m.maxWidth),gt),C(h.panel,"--cms-dialog-max-height",o(m.maxHeight),gt),C(h.panel,"--cms-dialog-body-max-height",o((X=m.bodyMaxHeight)!=null?X:m.contentMaxHeight),gt),m.style&&Object.assign(h.panel.style,m.style),At(h.panel,m),ge(h,o(m.fullscreen)),h.panel.setAttribute("role",m.role||"dialog"),h.panel.setAttribute("aria-modal",m.modal===!1?"false":"true"),m.ariaLabel?h.panel.setAttribute("aria-label",m.ariaLabel):h.panel.removeAttribute("aria-label")},re=()=>{u!=null&&u.panel&&u.panel.replaceChildren(fe())},ue=(h={})=>(h&&typeof h=="object"&&(S={...S,...h}),u&&(be(u),re()),R),O=(h=null)=>{var X,d,k,g,P;if(h&&typeof h=="object"&&(S={...S,...h}),u)return be(u),re(),u;a=document.activeElement;const m=B(),y=m.persistent===!0;u=JSswift.overlay.open(()=>fe(),{type:"dialog",backdrop:m.backdrop!==!1,lockScroll:m.lockScroll!==!1,trapFocus:m.trapFocus!==!1,autoFocus:m.autoFocus!==!1,closeOnOutside:(X=m.closeOnOutside)!=null?X:!y,closeOnBackdrop:(d=m.closeOnBackdrop)!=null?d:!y,closeOnEsc:(k=m.closeOnEsc)!=null?k:!y,className:Kt(["cms-dialog"]),onClose:()=>{var K,ee,Ce,E;(K=u==null?void 0:u._dialogViewportCleanup)==null||K.call(u),(ee=u==null?void 0:u.panel)==null||ee.removeEventListener("click",j),u=null,(E=(Ce=B()).onClose)==null||E.call(Ce),a&&typeof a.focus=="function"&&setTimeout(()=>a.focus(),0)}});const j=K=>{const ee=K.target;ee&&ee.closest&&ee.closest("[data-dialog-close]")&&Y()};return u.panel.addEventListener("click",j),be(u),_s(u),(P=(g=B()).onOpen)==null||P.call(g,u),u},Y=()=>{if(!u)return;const h=u;ks(h,()=>JSswift.overlay.close(h.id))},oe=()=>!!u,we=(h=null)=>oe()?(Y(),null):O(h),R={open:O,close:Y,toggle:we,update:ue,isOpen:oe,entry:()=>u,props:()=>({...S})};return R},Ae.TabPanel=(...t)=>{var je,_e,Me,Ie,Ye,rt,Xe,We,w,ie,$e,F,f;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=Array.isArray(e.tabs)?e.tabs:Array.isArray(e.items)?e.items:[],c=an(e.model,"UI.TabPanel:model"),S=e.id||"cms-tabpanel-"+Math.random().toString(36).slice(2,9),u=r=>String(o(r)||"vertical").toLowerCase()==="horizontal"?"horizontal":"vertical",a=r=>String(o(r)||"before").toLowerCase()==="after"?"after":"before",b=r=>{const x=String(o(r)||"").toLowerCase();return x==="pills"||x==="pill"?"pills":x==="soft"||x==="card"?"soft":"line"},M=r=>{const x=o(r);return x==null||x===""?null:JSswift.uiColors.includes(x)?`var(--cms-${x})`:String(x)},N=u(e.orientation||e.orient||e.direction),C=a(e.navPosition||e.barPosition||e.position),z=b(e.variant||(e.pills?"pills":e.soft?"soft":"line")),U=!!e.wrap,W=!!e.swipeable,ge=!!e.infinite,B=!!e.animated,ne=!!((_e=(je=e.navFill)!=null?je:e.fill)!=null?_e:e.stretch),he=!!e.disabled,q=o((Me=e.transitionDuration)!=null?Me:e["transition-duration"]),se=(()=>{if(q==null)return 220;if(typeof q=="number")return q;const r=parseFloat(q);return Number.isFinite(r)?r:220})(),le=o((Ie=e.transitionEasing)!=null?Ie:e["transition-easing"])||"ease",fe=(rt=(Ye=e.transitionPrev)!=null?Ye:e["transition-prev"])!=null?rt:null,be=(We=(Xe=e.transitionNext)!=null?Xe:e["transition-next"])!=null?We:null,re=M((w=e.color)!=null?w:e.state),ue=i.map((r,x)=>{var Ze,wt,Nt,Et,Rt,Mt,vt,Dt,ft,Ht,qt,Xt,Ot,Qt,cn,un;if(r==null)return null;if(typeof r!="object")return{name:r,labelFallback:r,panelFallback:null,noteFallback:null,iconFallback:null,badgeFallback:null,hidden:!1,raw:r,index:x};const de=(Mt=(Rt=(Et=(Nt=(wt=(Ze=r.name)!=null?Ze:r.value)!=null?wt:r.id)!=null?Nt:r.key)!=null?Et:r.label)!=null?Rt:r.title)!=null?Mt:`tab-${x}`,Be=r.label!=null||r.title!=null,He=Be?(vt=r.label)!=null?vt:r.title:r.children!=null&&r.content==null&&r.panel==null?r.children:(ft=(Dt=r.name)!=null?Dt:r.value)!=null?ft:`Tab ${x+1}`,Se=(Xt=(qt=(Ht=r.content)!=null?Ht:r.panel)!=null?qt:r.body)!=null?Xt:Be?r.children:null,Oe=(cn=(Qt=(Ot=r.note)!=null?Ot:r.subtitle)!=null?Qt:r.description)!=null?cn:null,at=(un=r.icon)!=null?un:null,nt=Object.prototype.hasOwnProperty.call(r,"badge")?r.badge:Object.prototype.hasOwnProperty.call(r,"counter")?r.counter:null;return{...r,name:de,labelFallback:He,panelFallback:Se,noteFallback:Oe,iconFallback:at,badgeFallback:nt,index:x}}).filter(Boolean).filter(r=>r.hidden!==!0&&r.visible!==!1),O=Z(["cms-clear-set","cms-tabpanel","cms-singularity",N,`variant-${z}`,ye(U,"wrap"),ye(B,"animated"),ye(ne,"nav-fill"),ye(he,"disabled"),ye(C==="after","nav-after"),e.class]),Y=JSswift.omit(e,["tabs","items","value","default","defaultValue","model","orientation","orient","direction","navPosition","barPosition","position","variant","pills","soft","navFill","fill","stretch","wrap","swipeable","infinite","animated","transitionDuration","transition-duration","transitionEasing","transition-easing","transitionPrev","transition-prev","transitionNext","transition-next","slots","empty","tabClass","tabStyle","panelClass","panelStyle","navClass","panelsClass","class","style"]);Y.class=O,Y.style=e.style;const oe=_.div(Y);B&&(oe.style.setProperty("--cms-tabpanel-duration",`${se}ms`),oe.style.setProperty("--cms-tabpanel-easing",le)),re&&oe.style.setProperty("--cms-tabpanel-accent",re);const we=_.div({class:Z(["cms-tabpanel-nav",e.navClass]),role:"tablist","aria-orientation":N}),R=_.div({class:Z(["cms-tabpanel-panels",e.panelsClass])}),h=[],m=[];let y=-1;const j=()=>N==="horizontal",X=(r,x,de)=>({tab:r,name:r.name,index:x,active:de,value:r.name,select:()=>Te(x),next:()=>V(),prev:()=>H()}),d=(r,x,de=!1)=>{var He;if(!ue.length)return-1;let Be=r;for(let Se=0;Se<ue.length;Se+=1){if(Be+=x,Be>=ue.length){if(!de)return-1;Be=0}else if(Be<0){if(!de)return-1;Be=ue.length-1}if(!((He=ue[Be])!=null&&He.disabled))return Be}return-1},k=r=>{var de;const x=(de=h[r])==null?void 0:de.btn;!x||typeof x.focus!="function"||requestAnimationFrame(()=>x.focus())},g=(r,x,de)=>{const Be=X(r,x,de),He=JSswift.ui.renderSlot(s,"label",Be,r.labelFallback);return T(null,"default",{},He)},P=(r,x)=>{var Dt,ft,Ht,qt,Xt;const de=x===y,Be=`${S}-tab-${x}`,He=`${S}-panel-${x}`,Se=X(r,x,de),Oe=g(r,x,de),at=r.iconFallback!=null?typeof r.iconFallback=="string"?Ae.Icon({name:r.iconFallback,size:(Ht=(ft=(Dt=r.iconSize)!=null?Dt:r.size)!=null?ft:e.size)!=null?Ht:null}):r.iconFallback:null,nt=T(s,"icon",Se,at),Ze=T(s,"note",Se,r.noteFallback),wt=T(s,"badge",Se,r.badgeFallback),Nt=_.span({class:"cms-tabpanel-tab-inner"},nt.length?_.span({class:"cms-tabpanel-tab-icon"},...nt):null,_.span({class:"cms-tabpanel-tab-copy"},_.span({class:"cms-tabpanel-tab-label"},...Oe.length?Oe:[""]),Ze.length?_.span({class:"cms-tabpanel-tab-note"},...Ze):null),wt.length?_.span({class:"cms-tabpanel-tab-badge"},...wt):null),Et=T(s,"tab",{...Se,label:Oe,icon:nt,note:Ze,badge:wt,tabId:Be,panelId:He},Nt),Rt=Ot=>{if(he||r.disabled)return;const Qt=Ot.key;if(Qt==="Enter"||Qt===" "){Ot.preventDefault(),Te(x);return}if(Qt==="Home"){Ot.preventDefault();const Zt=ue.findIndex(pn=>!pn.disabled);Zt>=0&&(Te(Zt),k(Zt));return}if(Qt==="End"){Ot.preventDefault();const Zt=(()=>{var pn;for(let en=ue.length-1;en>=0;en-=1)if(!((pn=ue[en])!=null&&pn.disabled))return en;return-1})();Zt>=0&&(Te(Zt),k(Zt));return}const cn=j()?["ArrowLeft"]:["ArrowUp"],un=j()?["ArrowRight"]:["ArrowDown"];if(cn.includes(Qt)){Ot.preventDefault();const Zt=d(x,-1,ge);Zt>=0&&(Te(Zt,{dir:"prev"}),k(Zt));return}if(un.includes(Qt)){Ot.preventDefault();const Zt=d(x,1,ge);Zt>=0&&(Te(Zt,{dir:"next"}),k(Zt))}},Mt=Ae.Btn({class:Z(["cms-tabpanel-tab",ye(de,"active"),ye(r.disabled||he,"disabled"),e.tabClass,r.tabClass||r.class]),type:"button",id:Be,role:"tab",disabled:!!(r.disabled||he),"aria-selected":de?"true":"false","aria-controls":He,tabindex:de?"0":"-1",outline:z==="pills"&&!de,color:z==="pills"&&de?r.color||e.color||e.state||"primary":null,size:(Xt=(qt=r.size)!=null?qt:e.size)!=null?Xt:null,style:{...e.tabStyle||{},...r.tabStyle||{}},onClick:()=>{r.disabled||he||Te(x)},onKeydown:Rt},...Et),vt=_.div({class:Z(["cms-tabpanel-nav-btn",ye(de,"active"),r.navClass]),"data-name":r.name},Mt,_.span({class:"tab-indicator"}));return h[x]={btn:Mt,wrap:vt,index:x},vt},K=(r,x)=>{const de=x===y,Be=`${S}-tab-${x}`,He=`${S}-panel-${x}`,Se=X(r,x,de),Oe=JSswift.ui.renderSlot(s,"panel",Se,r.panelFallback),at=_.div({class:Z(["cms-tabpanel-panel",ye(de,"active"),e.panelClass,r.panelClass]),style:{...e.panelStyle||{},...r.panelStyle||{}},"data-name":r.name,role:"tabpanel",id:He,tabindex:0,"aria-labelledby":Be,"aria-hidden":de?"false":"true"},...T(null,"default",{},Oe));return m[x]=at,at},ee=ue.map((r,x)=>P(r,x)),Ce=JSswift.ui.renderSlot(s,"nav",{tabs:ue,active:()=>{var r;return y>=0?(r=ue[y])==null?void 0:r.name:null},activeIndex:()=>y,activeTab:()=>y>=0?ue[y]:null,select:r=>{typeof r=="number"?Te(r):ze(r)},next:()=>V(),prev:()=>H(),nodes:ee,orientation:N,position:C,variant:z},ee);T(null,"default",{},Ce).forEach(r=>we.appendChild(r)),ue.length?ue.forEach((r,x)=>R.appendChild(K(r,x))):T(s,"empty",{tabs:ue},(ie=e.empty)!=null?ie:_.div({class:"cms-tabpanel-empty"},"Nessun contenuto disponibile.")).forEach(x=>R.appendChild(x));const E=r=>{if(!B)return;const x=r==="next"?"18px":"-18px",de=r==="next"?"-18px":"18px";oe.style.setProperty("--cms-tabpanel-enter",x),oe.style.setProperty("--cms-tabpanel-leave",de)},p=()=>{const r=[];fe&&r.push(...String(fe).split(/\s+/)),be&&r.push(...String(be).split(/\s+/)),r.length&&R.classList.remove(...r.filter(Boolean))},A=r=>{p();const x=r==="prev"?fe:be;if(!x)return;const de=String(x).split(/\s+/).filter(Boolean);de.length&&(R.classList.add(...de),setTimeout(()=>R.classList.remove(...de),se+40))},L=r=>{var Be;const x=h.find(({btn:He})=>He.classList.contains("active")),de=(Be=x==null?void 0:x.btn.parentNode)==null?void 0:Be.getBoundingClientRect();h.forEach(({btn:He,index:Se})=>{const Oe=Se===r,at=He.parentNode;if(!at)return;const nt=at.getBoundingClientRect();at.isConnected&&de&&(at.style.setProperty("--nav-pos-x",de.left-nt.left+"px"),at.style.setProperty("--nav-pos-y",de.top-nt.top+"px")),at.classList.toggle("active",Oe),He.classList.toggle("active",Oe),He.setAttribute("aria-selected",Oe?"true":"false"),He.setAttribute("tabindex",Oe?"0":"-1")})},ae=(r,x,de)=>{E(de),m.forEach((Be,He)=>{if(!Be)return;const Se=He===x,Oe=He===r;Se?(Be.classList.add("active"),Be.classList.remove("leaving"),Be.setAttribute("aria-hidden","false")):(Be.classList.remove("active"),Be.setAttribute("aria-hidden","true"),B&&Oe?(Be.classList.add("leaving"),setTimeout(()=>Be.classList.remove("leaving"),se+40)):Be.classList.remove("leaving"))})},ke=(r,x)=>r<0||r===x||ge&&r===ue.length-1&&x===0?"next":ge&&r===0&&x===ue.length-1?"prev":x>r?"next":"prev",Te=(r,x={})=>{var Se,Oe;if(r==null||r<0||r>=ue.length||(Se=ue[r])!=null&&Se.disabled)return;const de=y;if(de===r)return;y=r;const Be=ue[r],He=x.dir||ke(de,r);c&&!x.fromModel&&c.set(Be.name),L(r),ae(de,r,He),A(He),oe.dataset.active=String(Be.name),(Oe=e.onChange)==null||Oe.call(e,Be.name,Be,r)},ze=(r,x={})=>{if(!ue.length)return;const de=ue.findIndex(Be=>Be.name==r);de!==-1&&Te(de,x)},V=()=>{if(!ue.length)return;const r=y<0?ue.findIndex(x=>!x.disabled):d(y,1,ge);r<0||Te(r,{dir:"next"})},H=()=>{if(!ue.length)return;const r=y<0?(()=>{var x;for(let de=ue.length-1;de>=0;de-=1)if(!((x=ue[de])!=null&&x.disabled))return de;return-1})():d(y,-1,ge);r<0||Te(r,{dir:"prev"})};if(W){let r=0,x=0,de=!1;const Be=42;R.addEventListener("pointerdown",He=>{He.button!=null&&He.button!==0||(de=!0,r=He.clientX,x=He.clientY)}),R.addEventListener("pointerup",He=>{if(!de)return;de=!1;const Se=He.clientX-r,Oe=He.clientY-x;Math.abs(Se)<Be||Math.abs(Se)<Math.abs(Oe)||(Se<0?V():H())}),R.addEventListener("pointercancel",()=>{de=!1}),R.addEventListener("pointerleave",()=>{de=!1})}const te=c?c.get():(f=(F=($e=e.value)!=null?$e:e.defaultValue)!=null?F:e.default)!=null?f:null;if(ue.length){const r=ue.findIndex(x=>x.name==te);if(r>=0)Te(r,{fromModel:!0});else{const x=ue.findIndex(de=>!de.disabled);x>=0&&(Te(x,{fromModel:!0}),c&&c.set(ue[x].name))}}return c&&c.watch(r=>ze(r,{fromModel:!0}),"UI.TabPanel:watch"),C==="after"?(oe.appendChild(R),oe.appendChild(we)):(oe.appendChild(we),oe.appendChild(R)),T(s,"default",{},n).forEach(r=>oe.appendChild(r)),At(oe,e),oe._tabs=()=>ue.slice(),oe._active=()=>y>=0?ue[y]:null,oe._getValue=()=>{var r;return y>=0?(r=ue[y])==null?void 0:r.name:null},oe._setValue=r=>ze(r),oe._select=r=>{typeof r=="number"?Te(r):ze(r)},oe._next=V,oe._prev=H,oe};function Zi(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function Oo({title:t,message:e,contentNode:n,okText:s,cancelText:i,showCancel:c,onOk:S,onCancel:u,persistent:a}){ii();const b=_.div({class:"cms-dialog-backdrop",onClick:W=>{W.target===b&&a!==!0&&(u==null||u())}}),M=T(null,"default",{},t),N=T(null,"default",{},e),C=T(null,"default",{},n),z=_.div({class:"cms-dialog cms-panel"},M.length?_.h3(...M):null,N.length?_.p(...N):null,...C,_.div({class:"cms-dialog-actions"},c?JSswift.ui.Btn({onClick:u},i||"Annulla"):null,JSswift.ui.Btn({color:"primary",onClick:S},s||"OK")));b.appendChild(z),ii().appendChild(b);const U=W=>{W.key==="Escape"&&(u==null||u())};return document.addEventListener("keydown",U,{once:!0}),{backdrop:b,close:()=>Zi(b)}}bt.dialog.alert=function(t,e={}){return new Promise(n=>{const{backdrop:s,close:i}=Oo({title:e.title||"Info",message:t,okText:e.okText||"OK",showCancel:!1,persistent:e.persistent,onOk:()=>{i(),n(!0)},onCancel:()=>{i(),n(!0)}})})},bt.dialog.confirm=function(t={}){return new Promise(e=>{const{close:n}=Oo({title:t.title||"Conferma",message:t.message||"",okText:t.okText||"Conferma",cancelText:t.cancelText||"Annulla",showCancel:!0,persistent:t.persistent,onOk:()=>{n(),e(!0)},onCancel:()=>{n(),e(!1)}})})},bt.dialog.prompt=function(t={}){return new Promise(e=>{const n=JSswift.ui.Input({class:"cms-dialog-input",type:t.type||"text",placeholder:t.placeholder||""});t.value!=null&&(n.value=String(t.value));const{close:s}=Oo({title:t.title||"Inserisci valore",message:t.message||"",okText:t.okText||"OK",cancelText:t.cancelText||"Annulla",showCancel:!0,contentNode:_.div(n),persistent:t.persistent,onOk:()=>{const i=n.value;s(),e(i)},onCancel:()=>{s(),e(null)}});setTimeout(()=>n.focus(),0)})},bt.services=bt.services||{},bt.services.loading=bt.services.loading||{},bt.loading=bt.services.loading;let fn=null,Bs=0;function li(){if(fn)return fn;fn=document.createElement("div"),fn.className="cms-loading-backdrop",fn.style.cssText=`
|
|
1
|
+
(()=>{var jl,wt,zs,ms,as,Ps,cs,ts,Ts;window.JSswift=window.JSswift||{};const ne=window.JSswift;window._=window.JSswift,ne.config=ne.config||{};const An=typeof globalThis!="undefined"&&globalThis.JSswift_setting?globalThis.JSswift_setting:{};ne.config.debug=(jl=An.modeDev)!=null?jl:!1,ne.isDev=function(){return ne.config.debug},ne.uiNormalizeArgs=function(u){let R={},V=u;return u.length>0&&typeof u[0]=="object"&&u[0]!==null&&!u[0].nodeType&&!Array.isArray(u[0])&&!(u[0]instanceof Function)&&(R=u[0],V=u.slice(1)),{props:R,children:V}},ne.uiSizes=["xxs","xs","sm","md","lg","xl","xxl","xxxl"],ne.uiColors=["primary","secondary","success","warning","danger","info","light","dark"],ne.meta=ne.meta||{version:"1.0.23",policy:{sourceOfTruth:"docDevelop/reference/core.md",syncRule:"Quando cambia un modulo core, aggiornare sia questo meta sia docDevelop/reference/core.md."},modules:{render:{description:"Bridge props -> DOM per hyperscript _, attributi, class, style, eventi e children reattivi.",entrypoints:["createElement","setProp","bindProp"],status:"milestone-3-closed",knownLimits:["Il mini-terzo-giro e il successivo micro-giro avanzato hanno chiuso style dinamico, eventi, children e props/attr speciali, ma restano altri edge case avanzati da esplorare.","Gli eventi ora supportano composizione base di listener multipli, ma non hanno ancora delegation o diff avanzato.","Restano da esplorare edge case avanzati del renderer oltre ai giri gia coperti dai test."]},reactive:{description:"Core minimale signal/effect usato come base della reattivita.",entrypoints:["JSswift.reactive.signal","JSswift.reactive.effect","JSswift.reactive.computed","JSswift.reactive.untracked","JSswift.reactive.batch"],status:"milestone-2-closed",knownLimits:["La protezione loop copre i loop sincroni per singolo effect, non ancora i cicli complessi tra effect multipli.","Il batching sincrono ora esiste, ma manca ancora scheduling configurabile oltre il flush immediato a fine batch.","Mancano primitive avanzate per controllare scheduling e transazioni asincrone."]},rod:{description:"Layer reattivo di alto livello per binding DOM, model e interpolazioni.",entrypoints:["_.rod","JSswift.rodBind","JSswift.rodModel"],status:"milestone-2-closed",knownLimits:["Va chiarito meglio il rapporto con JSswift.reactive oltre al primo riallineamento strutturale.","Restano casi avanzati di model/binding da esplorare oltre al primo giro coperto dai test.","Il modulo e piu pulito internamente ma non e ancora il punto finale della convergenza con il renderer."]},mount:{description:"Mount, component instances e cleanup automatico del tree DOM.",entrypoints:["JSswift.mount","JSswift.component","JSswift.enableAutoCleanup"],status:"milestone-2-closed",knownLimits:["Il lifecycle e piu pulito internamente ma resta da chiarire meglio la semantica su multi-mount e cloni.","Restano da esplorare edge case avanzati del cleanup automatico fuori dal primo giro gia coperto."]},platform:{description:"Moduli applicativi nel core: overlay, store, auth, http, router, UI meta.",entrypoints:["JSswift.overlay","JSswift.store","JSswift.plugins.auth","JSswift.http","JSswift.router","JSswift.ui.meta"],status:"milestone-2-closed",knownLimits:["Il secondo giro ha ripulito i moduli interni, ma mancano ancora demo separate per modulo e una validazione piu formale di alcune superfici pubbliche.","Esiste una demo browser aggregata del blocco platform, ma non ancora demo separate per ogni modulo.","Mancano configurazione pubblica piu coerente e confini piu netti tra auth, http e router.","Il registry UI meta non ha ancora validazione formale del suo shape."]}}},ne.omit=(u,R)=>{const V={},q=new Set(R||[]);for(const G in u||{})q.has(G)||(V[G]=u[G]);return V},ne._cleanupRegistry=new WeakMap,ne._registerCleanup=function(u,R){if(!u||typeof R!="function")return R;const V=ne._cleanupRegistry.get(u)||[];return V.push(R),ne._cleanupRegistry.set(u,V),R},ne.dom={q(u,R=document){return R.querySelector(u)},qa(u,R=document){return Array.from(R.querySelectorAll(u))},attr(u,R,V){return u?V===void 0?u.getAttribute(R):(V===null?u.removeAttribute(R):u.setAttribute(R,String(V)),u):null}},(()=>{let u=[],R=!1;function V(){if(R)return;R=!0;const q=u.slice();u.length=0;for(const G of q)try{G()}catch(ce){console.error("[JSswift.ready] error:",ce)}}ne.ready=function(q){typeof q=="function"&&(R||document.readyState==="interactive"||document.readyState==="complete"?queueMicrotask(()=>{try{q()}catch(G){console.error("[JSswift.ready] error:",G)}}):u.push(q))},document.addEventListener("DOMContentLoaded",V,{once:!0})})(),ne.reactive=(()=>{let u=null;const R=[],V=100;let q=0,G="sync",ce="sync",se=!1;const ye=new Set;function ke(ze){const $e=ze==null?void 0:ze.flush;if($e==null||$e==="sync")return"sync";if($e==="microtask")return"microtask";throw new Error("JSswift.reactive.batch: options.flush must be 'sync' or 'microtask'")}function je(){for(;ye.size;){const ze=Array.from(ye);ye.clear(),ze.forEach($e=>$e())}}function Ce(){se||(se=!0,queueMicrotask(()=>{se=!1,ce="sync",je()}))}function Ae(ze){const $e=Array.from(ze);if(q>0||ce==="microtask"){$e.forEach(lt=>ye.add(lt)),q===0&&ce==="microtask"&&Ce();return}$e.forEach(lt=>lt())}function Ee(ze){if(ze&&(ze._deps.size&&(ze._deps.forEach($e=>$e.delete(ze._runner)),ze._deps.clear()),typeof ze._cleanup=="function")){const $e=ze._cleanup;ze._cleanup=null;try{$e()}catch(lt){console.error("[JSswift.reactive.effect] cleanup error:",lt)}}}function He(ze){if(!(!ze||!ze.active)){Ee(ze),R.push(ze),u=ze;try{const $e=at=>{ze._cleanup=typeof at=="function"?at:null},lt=ze.fn.length>0?ze.fn($e):ze.fn();typeof lt=="function"&&(ze._cleanup=lt)}finally{R.pop(),u=R[R.length-1]||null}}}function it(ze){if(typeof ze!="function")return()=>{};const $e={fn:ze,active:!0,_deps:new Set,_cleanup:null,_runner:null,_running:!1,_queued:!1},lt=()=>{if(!$e.active)return;if($e._running){$e._queued=!0;return}$e._running=!0;let at=0;try{do if($e._queued=!1,He($e),at++,at>=V){$e._queued=!1,console.warn("[JSswift.reactive.effect] loop guard triggered: too many synchronous reruns",{max:V,effect:ze.name||"anonymous"});break}while($e.active&&$e._queued)}finally{$e._running=!1}};return $e._runner=lt,lt(),()=>{$e.active&&($e.active=!1,Ee($e))}}function jt(ze){let $e=ze;const lt=new Set;function at(){return u&&u.active&&(lt.add(u._runner),u._deps.add(lt)),$e}function St(Ot){$e=Ot,Ae(lt)}function Lt(){lt.clear()}return[at,St,Lt]}function Qe(ze){if(typeof ze!="function")throw new Error("JSswift.reactive.computed: fn must be a function");const[$e,lt,at]=jt(void 0),St=it(()=>{lt(ze())}),Lt=()=>$e();return Lt.dispose=()=>{St(),at()},Lt.peek=()=>$e(),Lt.type="computed",Lt}function ut(ze){if(typeof ze!="function")throw new Error("JSswift.reactive.untracked: fn must be a function");const $e=u;u=null;try{return ze()}finally{u=$e}}function Me(ze,$e){if(typeof ze!="function")throw new Error("JSswift.reactive.batch: fn must be a function");const lt=ke($e);q===0?G=lt:lt==="microtask"&&(G="microtask"),q+=1;try{return ze()}finally{if(q-=1,q===0){const at=G==="microtask"||ce==="microtask";G="sync",at?(ce="microtask",Ce()):je()}}}return{signal:jt,effect:it,computed:Qe,untracked:ut,batch:Me}})(),ne._overlayShared=(()=>{const u=["button:not([disabled])","[href]","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","[tabindex]:not([tabindex='-1'])"].join(",");function R(ce,se){const ye=ce();if(ye&&ye.isConnected)return ye;let ke=document.getElementById("jss-overlay-root");return!ke&&(document!=null&&document.body)&&(ke=document.createElement("div"),ke.id="jss-overlay-root",ke.className="jss-overlay-root",document.body.appendChild(ke)),!document.body&&!ke&&ne.ready(()=>{let je=document.getElementById("jss-overlay-root");je||(je=document.createElement("div"),je.id="jss-overlay-root",je.className="jss-overlay-root",document.body.appendChild(je)),se(je)}),se(ke),ke}function V(ce){var se;const ye=ce.querySelector(u);(se=ye==null?void 0:ye.focus)==null||se.call(ye)}function q(ce,se){if(ce.key!=="Tab")return;const ye=Array.from(se.querySelectorAll(u)).filter(Ae=>Ae.offsetParent!==null);if(!ye.length)return;const ke=ye[0],je=ye[ye.length-1],Ce=document.activeElement;ce.shiftKey&&Ce===ke?(ce.preventDefault(),je.focus()):!ce.shiftKey&&Ce===je&&(ce.preventDefault(),ke.focus())}function G(ce,se){var ye,ke,je,Ce,Ae,Ee;if(!se.anchorEl)return;const He=se.anchorEl.getBoundingClientRect(),it=ce.getBoundingClientRect(),jt=window.visualViewport||null,Qe=Math.max(0,Number(jt==null?void 0:jt.offsetLeft)||0),ut=Math.max(0,Number(jt==null?void 0:jt.offsetTop)||0),Me=Math.max(Number(jt==null?void 0:jt.width)||0,window.innerWidth||0,((ye=document.documentElement)==null?void 0:ye.clientWidth)||0),ze=Math.max(Number(jt==null?void 0:jt.height)||0,window.innerHeight||0,((ke=document.documentElement)==null?void 0:ke.clientHeight)||0),$e=Number((Ce=(je=se.viewportGutter)!=null?je:se.gutter)!=null?Ce:8),lt=Number.isFinite($e)?Math.max(0,$e):8,at=Number((Ae=se.offsetX)!=null?Ae:0),St=Number((Ee=se.offsetY)!=null?Ee:8),Lt=Number.isFinite(at)?at:0,Ot=Number.isFinite(St)?St:8,Ct=(en,yn,Mn)=>!Number.isFinite(en)||(Number.isFinite(yn)||(yn=0),Number.isFinite(Mn)||(Mn=yn),Mn<yn)?yn:Math.min(Math.max(en,yn),Mn),nt=String(se.placement||"bottom-start").toLowerCase(),[kt,Rt]=nt.split("-"),Ve=["top","bottom","left","right"].includes(kt)?kt:"bottom",st=["start","end","center"].includes(Rt)?Rt:"start",Jt={top:"bottom",bottom:"top",left:"right",right:"left"}[Ve]||"top",Vt=Ve==="top"||Ve==="bottom",Pt=it.width,yt=it.height,rt=en=>{let yn=He.left+Lt,Mn=He.top+Ot;return en==="top"||en==="bottom"?(st==="center"?yn=He.left+(He.width-Pt)/2+Lt:st==="end"&&(yn=He.right-Pt+Lt),Mn=en==="top"?He.top-yt-Ot:He.bottom+Ot):(st==="center"?Mn=He.top+(He.height-yt)/2+Ot:st==="end"&&(Mn=He.bottom-yt+Ot),yn=en==="left"?He.left-Pt-Lt:He.right+Lt),{left:yn,top:Mn}},ht=en=>en==="top"?He.top-Ot-lt:en==="bottom"?ze-He.bottom-Ot-lt:en==="left"?He.left-Lt-lt:Me-He.right-Lt-lt,o=ht(Ve),Kt=ht(Jt),Bt=(Vt?yt:Pt)>o&&Kt>o?Jt:Ve,pe=rt(Bt),$n=Qe+lt,xt=ut+lt,qe=Math.max($n,Qe+Me-Pt-lt),on=Math.max(xt,ut+ze-yt-lt),Kn=Ct(pe.left,$n,qe),al=Ct(pe.top,xt,on);ce.style.position="fixed",ce.style.left=`${Kn}px`,ce.style.top=`${al}px`}return{ensureRoot:R,focusFirst:V,trapFocus:q,applyAnchoredPosition:G}})(),ne.overlay=(()=>{let u=0;const R=new Map;let V=null;const{ensureRoot:q,focusFirst:G,trapFocus:ce,applyAnchoredPosition:se}=ne._overlayShared,ye=()=>q(()=>V,Qe=>{V=Qe});let ke=0;const je=()=>{ke++,ke===1&&document.documentElement.classList.add("jss-scroll-locked")},Ce=()=>{ke=Math.max(0,ke-1),ke===0&&document.documentElement.classList.remove("jss-scroll-locked")},Ae=()=>{let Qe=null;for(const ut of R.values())Qe=ut;return Qe},Ee=Qe=>{var ut;let Me=Qe;for(;Me&&Me!==document;){if(Me.nodeType===1&&((ut=Me.getAttribute)==null?void 0:ut.call(Me,"data-jss-overlay-portal"))==="true")return!0;Me=Me.parentNode}return!1},He=(Qe,ut={})=>{var Me,ze,$e,lt;const at=`ov_${++u}`,St={id:at,opts:ut,isOpen:!0,anchorEl:ut.anchorEl||null,placement:ut.placement||"bottom-start",onClose:typeof ut.onClose=="function"?ut.onClose:null,overlay:null,panel:null,backdrop:null,reposition:null,_positionCleanup:null,_positionFrame:null,_panelResizeObserver:null,_cleanup:null},Lt=document.createElement("div");Lt.className=["jss-overlay",ut.type?`type-${ut.type}`:""].filter(Boolean).join(" "),Lt.dataset.id=at;const Ot=document.createElement("div");Ot.className="jss-overlay-backdrop",ut.backdrop||(Ot.style.display="none");const Ct=document.createElement("div");Ct.className=["jss-overlay-panel",ut.className].filter(Boolean).join(" "),Ct.tabIndex=-1;const nt=typeof Qe=="function"?Qe({close:()=>it(at)}):Qe,kt=ne.ui.slot(nt);Array.isArray(kt)?kt.forEach(yt=>yt&&Ct.appendChild(yt)):kt&&Ct.appendChild(kt),Lt.appendChild(Ot),Lt.appendChild(Ct);const Rt=ye();if(!Rt)return{id:at,close:()=>it(at),panel:Ct,overlay:Lt};Rt.appendChild(Lt),St.overlay=Lt,St.panel=Ct,St.backdrop=Ot,R.set(at,St),ut.lockScroll&&je(),ut.autoFocus!==!1&&setTimeout(()=>{Ct.isConnected&&R.get(at)===St&&!Ct.contains(document.activeElement)&&G(Ct)},0);const Ve=(yt=null)=>{yt&&typeof yt=="object"&&Object.assign(St.opts,yt),se(Ct,St.opts)},st=()=>{if(!ut.anchorEl)return;const yt=globalThis.requestAnimationFrame||(rt=>setTimeout(()=>rt(Date.now()),0));St._positionFrame==null&&(St._positionFrame=yt(()=>{St._positionFrame=null,Ve()}))};if(St.reposition=Ve,ut.anchorEl){Ve(),st();const yt=st;if(window.addEventListener("resize",yt),window.addEventListener("scroll",yt,!0),(ze=(Me=window.visualViewport)==null?void 0:Me.addEventListener)==null||ze.call(Me,"resize",yt),(lt=($e=window.visualViewport)==null?void 0:$e.addEventListener)==null||lt.call($e,"scroll",yt),typeof ResizeObserver=="function"){const rt=new ResizeObserver(st);rt.observe(Ct),St._panelResizeObserver=rt}St._positionCleanup=()=>{var rt,ht,o,Kt,re,Bt;const pe=globalThis.cancelAnimationFrame||clearTimeout;St._positionFrame!=null&&(pe(St._positionFrame),St._positionFrame=null),(ht=(rt=St._panelResizeObserver)==null?void 0:rt.disconnect)==null||ht.call(rt),St._panelResizeObserver=null,window.removeEventListener("resize",yt),window.removeEventListener("scroll",yt,!0),(Kt=(o=window.visualViewport)==null?void 0:o.removeEventListener)==null||Kt.call(o,"resize",yt),(Bt=(re=window.visualViewport)==null?void 0:re.removeEventListener)==null||Bt.call(re,"scroll",yt)}}const Jt=yt=>{const rt=Ae();!rt||rt.id!==at||ut.closeOnOutside!==!1&&(Ee(yt.target)||Ct.contains(yt.target)||it(at))};document.addEventListener("mousedown",Jt,!0);const Vt=yt=>{const rt=Ae();!rt||rt.id!==at||(ut.trapFocus&&ce(yt,Ct),yt.key==="Escape"&&ut.closeOnEsc!==!1&&(yt.preventDefault(),it(at)))};document.addEventListener("keydown",Vt,!0),Ot.addEventListener("click",()=>{ut.closeOnBackdrop!==!1&&it(at)}),St._cleanup=()=>{var yt;document.removeEventListener("mousedown",Jt,!0),document.removeEventListener("keydown",Vt,!0),(yt=St._positionCleanup)==null||yt.call(St)};const Pt=1e3+R.size*10;return Lt.style.zIndex=String(Pt),{id:at,close:()=>it(at),panel:Ct,overlay:Lt,reposition:Ve}},it=Qe=>{var ut,Me,ze;const $e=R.get(Qe);$e&&(R.delete(Qe),(ut=$e._cleanup)==null||ut.call($e),$e.opts.lockScroll&&Ce(),typeof Sn=="function"&&Sn($e.overlay),(Me=$e.overlay)==null||Me.remove(),(ze=$e.onClose)==null||ze.call($e))};return{open:He,close:it,closeTop:()=>{const Qe=Ae();Qe&&it(Qe.id)},root:V,_stack:R}})();function Rs(u,R={}){const{isSVG:V=!1,normalizeClass:q=Me=>String(Me!=null?Me:""),isContentProp:G=()=>!1,autoValueTags:ce=new Set(["INPUT","TEXTAREA","SELECT"])}=R;function se(Me){if(V||!(Me in u))return!1;try{return typeof u[Me]=="boolean"}catch(ze){return!1}}function ye(Me){return V||Me.startsWith("data-")||Me.startsWith("aria-")||!(Me in u)}function ke(Me,ze){if(ze==null){u.removeAttribute(Me);return}if(ze===!1){if(Me.startsWith("aria-")){u.setAttribute(Me,"false");return}u.removeAttribute(Me);return}if(ze===!0&&!V&&!Me.startsWith("aria-")&&!Me.startsWith("data-")){u.setAttribute(Me,"");return}u.setAttribute(Me,String(ze))}function je(Me,ze){if(Me==null)return;const $e=String(Me),lt=$e.startsWith("--")||$e.includes("-");if(ze==null||ze===!1||ze===""){lt?u.style.removeProperty($e):u.style[$e]="";return}if(lt){u.style.setProperty($e,String(ze));return}u.style[$e]=ze}function Ce(Me){const ze=q(Me);if(ze==null||ze===!1||ze===""){u.removeAttribute("class");return}u.setAttribute("class",String(ze))}function Ae(Me,ze){const $e=!!ze;u[Me]=$e,$e?u.setAttribute(Me,""):u.removeAttribute(Me)}function Ee(Me){if(G(Me)){u[Me]="";return}if(Me==="class"){u.removeAttribute("class");return}if(Me==="style"){u.removeAttribute("style");return}if(se(Me)){try{u[Me]=!1}catch(ze){}u.removeAttribute(Me);return}if(u.removeAttribute(Me),!ye(Me))try{typeof u[Me]=="string"&&(u[Me]="")}catch(ze){}}function He(Me){!Me||typeof Me!="object"||Object.entries(Me).forEach(([ze,$e])=>{je(ze,$e)})}function it(Me,ze){if(G(Me)){u[Me]=ze!=null?ze:"";return}if(Me==="class"){Ce(ze);return}if(Me==="style"){if(ze==null||ze===!1){Ee(Me);return}if(typeof ze=="object"){He(ze);return}}if(se(Me)){Ae(Me,ze);return}if(ze==null||ze===!1){Ee(Me);return}if(ye(Me)){ke(Me,ze);return}u[Me]=ze}function jt(Me,ze){const $e=String(Me).split(".");let lt=u;for(let at=0;at<$e.length-1;at++)if(lt=lt==null?void 0:lt[$e[at]],!lt)return;lt[$e[$e.length-1]]=ze}function Qe(Me){return Me?Me==="auto"||Me.startsWith("attr:")||Me.startsWith("@")||Me.startsWith("style.")||Me.includes("."):!1}function ut(Me,ze){if(!Me||Me==="auto"){ce.has(u.tagName)?it("value",ze):u.textContent=ze!=null?ze:"";return}if(Me.startsWith("attr:")){ke(Me.slice(5),ze);return}if(Me.startsWith("@")){ke(Me.slice(1),ze);return}if(Me.startsWith("style.")){je(Me.slice(6),ze);return}if(Me.includes(".")){jt(Me,ze);return}it(Me,ze)}return{isBooleanDomProp:se,isAttributeOnlyProp:ye,isBindingValueKey:Qe,setAttributeValue:ke,setStyleEntry:je,setClassValue:Ce,setBooleanProp:Ae,removeProp:Ee,applyStyleObject:He,setProp:it,setPathValue:jt,applyBindingValue:ut}}function ns(u){const R=[],V=q=>{if(!(q==null||q===!1)){if(typeof q=="function"){V(q());return}if(q&&q.type==="rod"){V(q.value);return}if(Array.isArray(q)){q.forEach(V);return}if(typeof q=="object"){Object.entries(q).forEach(([G,ce])=>{let se=ce;typeof se=="function"?se=se():se&&se.type==="rod"&&(se=se.value),V(se?G:null)});return}q!==!0&&String(q).split(/\s+/).forEach(G=>{G&&R.push(G)})}};return V(u),R.length?Array.from(new Set(R)).join(" "):""}function Rn(u){return u==null||u===!1?!1:typeof u=="function"||u&&u.type==="rod"?!0:Array.isArray(u)?u.some(Rn):typeof u=="object"?Object.values(u).some(Rn):!1}function ys(u,R){return u==null||u===!1?!1:typeof u=="function"||R(u)?!0:typeof u!="object"||Array.isArray(u)||u.nodeType?!1:Object.values(u).some(V=>ys(V,R))}function Cl(u,R){let V=u;if(typeof V=="function"?V=V():R(V)&&(V=V.value),!V||typeof V!="object"||Array.isArray(V)||V.nodeType)return null;const q={};return Object.entries(V).forEach(([G,ce])=>{let se=ce;typeof se=="function"?se=se():R(se)&&(se=se.value),q[G]=se}),q}function qs(u){let R=new Set;function V(G){R.forEach(ce=>{G.has(ce)||u(ce,null)}),R=G}function q(G,ce){const se=Cl(G,ce);if(!se){V(new Set);return}const ye=new Set(Object.keys(se));V(ye),Object.entries(se).forEach(([ke,je])=>{u(ke,je)})}return{apply:q}}function Ys(u){return typeof u=="string"&&(u.startsWith("on:")||u.startsWith("on")&&u.length>2)}const Js=128,Jn=[];function Ms(u,R){Jn.push({rod:u,value:String(R!=null?R:"")}),Jn.length>Js&&Jn.splice(0,Jn.length-Js)}function xl(){if(!Jn.length)return null;const u=Jn.slice();return Jn.length=0,{items:u,index:0}}function bs(u,R){if(!R||!u||R.index>=R.items.length)return null;const V=[],q=String(u);let G=0,ce=R.index,se=!1;for(;ce<R.items.length;){const ye=R.items[ce],ke=ye.value;if(!ke)break;const je=q.indexOf(ke,G);if(je===-1)break;je>G&&V.push(q.slice(G,je)),V.push(ye.rod),G=je+ke.length,ce++,se=!0}return se?(G<q.length&&V.push(q.slice(G)),R.index=ce,V):null}function Os(u){var R;let V="";for(const q of u)typeof q=="string"?V+=q:V+=(R=q==null?void 0:q.value)!=null?R:"";return V}function Xs(u){if(u.startsWith("on:"))return u.slice(3);const R=u.slice(2);return R?R==="DoubleClick"?"dblclick":R.toLowerCase():""}function vs(u){return u==null||u===!1?!1:u===!0?{capture:!0}:typeof u=="boolean"?u:typeof u=="object"?{capture:!!u.capture,passive:!!u.passive,once:!!u.once}:!1}function Fs(u,R){const V=vs(u),q=vs(R);return typeof V=="boolean"||typeof q=="boolean"?V===q:!!V&&!!q&&V.capture===q.capture&&V.passive===q.passive&&V.once===q.once}function ss(u,R){return Array.isArray(u)?u.some(V=>ss(V,R)):R(u)?!0:!u||typeof u!="object"||Array.isArray(u)||u.nodeType?!1:Array.isArray(u.handlers)?u.handlers.some(V=>ss(V,R))||R(u.options)||typeof u.options=="function":Array.isArray(u.listeners)?u.listeners.some(V=>ss(V,R))||R(u.options)||typeof u.options=="function":R(u.handler)||R(u.listener)||R(u.fn)||R(u.options)||typeof u.options=="function"}function us(u,R,V){var q,G,ce,se,ye,ke,je;if(u==null||u===!1)return[];if(typeof u=="function")return[{handler:u,options:vs(V!=null?V:!1)}];if(R(u))return us(u.value,R,V);if(Array.isArray(u))return u.flatMap(Ce=>us(Ce,R,V));if(typeof u=="object"&&!Array.isArray(u)&&!u.nodeType){if(Array.isArray(u.handlers)||Array.isArray(u.listeners)){const Ee=u.handlers||u.listeners||[],He=(G=(q=u.options)!=null?q:V)!=null?G:!1;return Ee.flatMap(it=>us(it,R,He))}let Ce=(ye=(se=(ce=u.handler)!=null?ce:u.listener)!=null?se:u.fn)!=null?ye:null,Ae=(je=(ke=u.options)!=null?ke:V)!=null?je:!1;return R(Ce)&&(Ce=Ce.value),R(Ae)&&(Ae=Ae.value),typeof Ae=="function"&&(Ae=Ae()),typeof Ce=="function"?[{handler:Ce,options:vs(Ae)}]:[]}return[]}function kl(u,R){return us(u,R)}function Nl(u,R,V,q){const G=Xs(R);if(!G)return;const ce={listeners:[]},se=()=>{ce.listeners.forEach(ke=>{u.removeEventListener(G,ke.dispatch,ke.options)}),ce.listeners=[]},ye=ke=>{const je=kl(ke,q);ce.listeners.length===je.length&&ce.listeners.every((Ae,Ee)=>{const He=je[Ee];return Ae.handler===He.handler&&Fs(Ae.options,He.options)})||(se(),je.forEach(Ae=>{const Ee={handler:Ae.handler,options:Ae.options,dispatch:null};Ee.dispatch=He=>{if(typeof Ee.handler=="function"){const it=Ee.handler.call(u,He);return Ee.options&&typeof Ee.options=="object"&&Ee.options.once&&(u.removeEventListener(G,Ee.dispatch,Ee.options),ce.listeners=ce.listeners.filter(jt=>jt!==Ee)),it}},u.addEventListener(G,Ee.dispatch,Ee.options),ce.listeners.push(Ee)}))};if(ne._registerCleanup(u,se),q(V)){const ke=ne.reactive.effect(()=>{ye(V.value)});ne._registerCleanup(u,ke);return}if(ss(V,q)){const ke=ne.reactive.effect(()=>{ye(V)});ne._registerCleanup(u,ke);return}ye(V)}function Qs(u,R={}){const{isRod:V=()=>!1,interpolationCursor:q=null}=R;function G(Ce){const Ae=document.createTextNode(""),Ee=ne.rodBind(Ae,Ce);return ne._registerCleanup(Ae,Ee),Ae}function ce(Ce){u.appendChild(G(Ce))}function se(Ce){const Ae=document.createTextNode("");u.appendChild(Ae);const Ee=ne.reactive.effect(()=>{Ae.textContent=Os(Ce)});ne._registerCleanup(Ae,Ee)}function ye(Ce){const Ae=[],Ee=He=>{if(!(He==null||He===!1)){if(Array.isArray(He)){He.forEach(Ee);return}if(typeof He=="string"){Ae.push(document.createTextNode(He));return}if(typeof He=="number"){Ae.push(document.createTextNode(String(He)));return}if(typeof He!="boolean"){if(V(He)){Ae.push(G(He));return}if(He!=null&&He.nodeType){Ae.push(He);return}Ae.push(document.createTextNode(String(He)))}}};return Ee(Ce),Ae}function ke(Ce){const Ae=document.createComment("dyn");u.appendChild(Ae);let Ee=[];const He=ne.reactive.effect(()=>{Ee.forEach(ut=>{Sn(ut),ut.parentNode&&ut.parentNode.removeChild(ut)}),Ee=[];const it=Ae.parentNode;if(!it)return;const jt=ye(Ce());if(!jt.length)return;const Qe=document.createDocumentFragment();jt.forEach(ut=>Qe.appendChild(ut)),it.insertBefore(Qe,Ae.nextSibling),Ee=jt});ne._registerCleanup(Ae,()=>{He(),Ee.forEach(it=>Sn(it)),Ee=[]})}function je(Ce){if(Ce!=null){if(Array.isArray(Ce)){for(const Ae of Ce)je(Ae);return}if(typeof Ce=="string"){const Ae=bs(Ce,q);Ae?se(Ae):u.appendChild(document.createTextNode(Ce));return}if(typeof Ce=="number"){u.appendChild(document.createTextNode(String(Ce)));return}if(typeof Ce=="function"){ke(Ce);return}if(V(Ce)){ce(Ce);return}Ce.nodeType&&u.appendChild(Ce)}}return{appendRodText:ce,appendInterpolatedText:se,appendDynamicChild:ke,appendChildValue:je}}function ql(u,R={}){const{el:V,isRod:q=()=>!1,interpolationCursor:G=null,appendChildValue:ce=()=>{},appendRodText:se=()=>{},appendInterpolatedText:ye=()=>{},appendDynamicChild:ke=()=>{},bindProp:je=()=>{}}=R;for(const Ce of u)if(Ce!=null){if(Array.isArray(Ce)){ce(Ce);continue}if(typeof Ce=="string"){const Ae=bs(Ce,G);Ae?ye(Ae):V.appendChild(document.createTextNode(Ce));continue}if(typeof Ce=="number"){V.appendChild(document.createTextNode(String(Ce)));continue}if(typeof Ce=="function"){ke(Ce);continue}if(q(Ce)){se(Ce);continue}if(Ce.nodeType){V.appendChild(Ce);continue}if(typeof Ce=="object")for(const[Ae,Ee]of Object.entries(Ce)){if(typeof Ee=="string"){const He=bs(Ee,G);if(He){je(Ae,()=>Os(He));continue}}if(Ae==="class"){je(Ae,Ee);continue}if(Ae==="style"&&typeof Ee=="object"&&Ee!==null&&!q(Ee)){je(Ae,Ee);continue}je(Ae,Ee)}}}const Zs="http://www.w3.org/2000/svg",Al=new Set(["svg","g","path","circle","ellipse","line","rect","polygon","polyline","text","tspan","defs","linearGradient","radialGradient","stop","use","symbol","clipPath","mask","pattern","filter","feGaussianBlur","feOffset","feBlend","feColorMatrix"]);function Un(u){return u==="innerHTML"||u==="innerText"||u==="textContent"||u==="value"}function Fn(u,...R){const V=Al.has(u),q=u==="text"&&!V?document.createTextNode(""):V?document.createElementNS(Zs,u):document.createElement(u),G=Ve=>!!Ve&&Ve.type==="rod",ce=xl(),se=Qs(q,{isRod:G,interpolationCursor:ce}),{appendRodText:ye,appendInterpolatedText:ke,appendDynamicChild:je,appendChildValue:Ce}=se,Ae=Rs(q,{isSVG:V,normalizeClass:ns,isContentProp:Un}),{isBooleanDomProp:Ee,isBindingValueKey:He,applyBindingValue:it,setStyleEntry:jt,setProp:Qe,setClassValue:ut}=Ae;function Me(Ve){const st=ne.reactive.effect(Ve);return ne._registerCleanup(q,st),st}function ze(Ve){if(String((Ve==null?void 0:Ve.tagName)||"").toLowerCase()!=="input")return!1;const st=String((Ve==null?void 0:Ve.type)||"").toLowerCase();return st==="range"||st==="number"}function $e(Ve){return String((Ve==null?void 0:Ve.tagName)||"").toLowerCase()!=="input"?"":String((Ve==null?void 0:Ve.type)||"").toLowerCase()}function lt(Ve){return String((Ve==null?void 0:Ve.tagName)||"").toLowerCase()==="select"&&!Ve.multiple}function at(Ve){return String((Ve==null?void 0:Ve.tagName)||"").toLowerCase()==="input"&&String((Ve==null?void 0:Ve.type)||"").toLowerCase()==="file"}function St(Ve,st,Jt){Me(()=>{var Pt;const yt=(Pt=st.value)!=null?Pt:"";Ve.value!==String(yt)&&Qe("value",yt)});const Vt=()=>{let Pt=Ve.value;const yt=$e(Ve),rt=typeof st.value=="number"||st.value==null;if(lt(Ve)&&Ve.value==="")Pt=null;else if(ze(Ve)&&rt)if(yt==="number"&&Ve.value==="")Pt=null;else{const ht=typeof Ve.valueAsNumber=="number"&&!Number.isNaN(Ve.valueAsNumber)?Ve.valueAsNumber:Number(Ve.value);Pt=Number.isNaN(ht)?yt==="number"?null:0:ht}st.value!==Pt&&(st.value=Pt)};Ve.addEventListener(Jt,Vt),ne._registerCleanup(Ve,()=>{Ve.removeEventListener(Jt,Vt)})}function Lt(Ve,st){Me(()=>{const Vt=!!st.value;!!Ve.checked!==Vt&&Qe("checked",Vt)});const Jt=()=>{const Vt=!!Ve.checked;st.value!==Vt&&(st.value=Vt)};Ve.addEventListener("change",Jt),ne._registerCleanup(Ve,()=>{Ve.removeEventListener("change",Jt)})}function Ot(Ve,st){const Jt=()=>{var Pt;return String((Pt=Ve.value)!=null?Pt:"on")};Me(()=>{const yt=(st.value==null?null:String(st.value))===Jt();!!Ve.checked!==yt&&Qe("checked",yt)});const Vt=()=>{if(!Ve.checked)return;const Pt=Jt();st.value!==Pt&&(st.value=Pt)};Ve.addEventListener("change",Vt),ne._registerCleanup(Ve,()=>{Ve.removeEventListener("change",Vt)})}function Ct(Ve,st){const Jt=()=>{const Pt=Ve.files;return Pt==null?[]:Array.isArray(Pt)?Pt.slice():typeof Pt.length=="number"?Array.from(Pt):[Pt]};Me(()=>{const Pt=st.value;(Pt==null||Array.isArray(Pt)&&Pt.length===0)&&(Ve.value!==""&&Qe("value",""),Array.isArray(Ve.files)&&(Ve.files=[]))});const Vt=()=>{const Pt=Jt();st.value=Pt};Ve.addEventListener("change",Vt),ne._registerCleanup(Ve,()=>{Ve.removeEventListener("change",Vt)})}function nt(Ve,st){const Jt=()=>Array.from(Ve.childNodes||[]).filter(yt=>(yt==null?void 0:yt.tagName)==="OPTION"&&yt.selected).map(yt=>{var rt;return String((rt=yt.value)!=null?rt:"")}),Vt=()=>{const yt=Array.isArray(st.value)?st.value.map(ht=>String(ht)):[],rt=new Set(yt);Array.from(Ve.childNodes||[]).forEach(ht=>{var o;if((ht==null?void 0:ht.tagName)!=="OPTION")return;const Kt=rt.has(String((o=ht.value)!=null?o:""));!!ht.selected!==Kt&&(ht.selected=Kt,Kt?ht.setAttribute("selected",""):ht.removeAttribute("selected"))})};Me(Vt),Ve._jssApplySelectedValues=Vt,queueMicrotask(Vt);const Pt=()=>{const yt=Jt(),rt=Array.isArray(st.value)?st.value.map(ht=>String(ht)):[];rt.length===yt.length&&rt.every((ht,o)=>ht===yt[o])||(st.value=yt)};Ve.addEventListener("change",Pt),ne._registerCleanup(Ve,()=>{Ve.removeEventListener("change",Pt)})}function kt(Ve,st){Me(()=>{const yt=!!st.value;!!Ve.selected!==yt&&Qe("selected",yt)});let Jt=null;const Vt=()=>{const yt=!!Ve.selected;st.value!==yt&&(st.value=yt)};queueMicrotask(()=>{var yt;Jt||((yt=Ve.parentNode)==null?void 0:yt.tagName)!=="SELECT"||(Jt=Ve.parentNode,Jt.addEventListener("change",Vt))}),ne._registerCleanup(Ve,()=>{Jt==null||Jt.removeEventListener("change",Vt)})}function Rt(Ve,st){if(Ys(Ve)){Nl(q,Ve,st,G);return}if(Ve==="class"){if(Rn(st)){Me(()=>{ut(ns(st))});return}ut(ns(st));return}if(Ve==="style"&&st&&typeof st=="object"){const Jt=qs(jt);if(ys(st,G)){Me(()=>{Jt.apply(st,G)});return}Jt.apply(st,G);return}if(Ve==="style"&&(typeof st=="function"||G(st))){const Jt=qs(jt);Me(()=>{Jt.apply(st,G)});return}if(He(Ve)&&typeof st=="function"){Me(()=>{it(Ve,st())});return}if(He(Ve)&&!G(st)){it(Ve,st);return}if(typeof st=="function"){Me(()=>{Qe(Ve,st())});return}if(Ve==="value"&&G(st)&&(u==="input"||u==="textarea"||u==="select")){if(u==="select"&&q.multiple){nt(q,st);return}St(q,st,u==="select"?"change":"input");return}if(Ve==="checked"&&G(st)&&u==="input"){if(String(q.type||"").toLowerCase()==="radio"){Ot(q,st);return}Lt(q,st);return}if(Ve==="files"&&G(st)&&at(q)){Ct(q,st);return}if(Ve==="selected"&&G(st)&&u==="option"){kt(q,st);return}if(Un(Ve)&&G(st)){Me(()=>{Qe(Ve,st.value)});return}if(G(st)){const Jt=ne.rodBind(q,st,{key:Ve});ne._registerCleanup(q,Jt);return}Qe(Ve,st)}return ql(R,{el:q,isRod:G,interpolationCursor:ce,appendChildValue:Ce,appendRodText:ye,appendInterpolatedText:ke,appendDynamicChild:je,bindProp:Rt}),u==="select"&&typeof q._jssApplySelectedValues=="function"&&q._jssApplySelectedValues(),q}const sn={},el=["html","head","title","base","link","meta","style","body","header","footer","main","section","article","aside","nav","h1","h2","h3","h4","h5","h6","p","div","span","pre","blockquote","hr","br","address","a","abbr","b","bdi","bdo","cite","code","data","dfn","em","i","kbd","mark","q","rp","rt","ruby","s","samp","small","strong","sub","sup","time","u","var","wbr","ul","ol","li","dl","dt","dd","table","caption","colgroup","col","thead","tbody","tfoot","tr","th","td","form","label","input","textarea","button","select","option","optgroup","fieldset","legend","datalist","output","progress","meter","img","picture","source","iframe","embed","object","param","audio","video","track","details","summary","dialog","script","noscript","canvas","template","slot","svg","g","path","circle","ellipse","line","rect","polygon","polyline","text","tspan","defs","linearGradient","radialGradient","stop","use","symbol","clipPath","mask","pattern","filter","feGaussianBlur","feOffset","feBlend","feColorMatrix"];el.forEach(u=>{window._[u]=(...R)=>Fn(u,...R)}),_.DOM_ELEMENTS=el,_.fragment=(...u)=>u,_.dynamic=function(u){const R=document.createComment("dyn"),V=document.createDocumentFragment();V.appendChild(R);let q=null;return ne.reactive.effect(()=>{const G=u();if(q&&q.parentNode&&q.parentNode.removeChild(q),q=null,G==null)return;let ce=G;(typeof G=="string"||typeof G=="number")&&(ce=document.createTextNode(String(G)));const se=R.parentNode;se&&ce&&ce.nodeType&&(se.insertBefore(ce,R.nextSibling),q=ce)}),V};function ws(){let u=!1;const R=new Set;function V(){var q,G,ce;u=!1,(q=ne.debug)==null||q.inc("rodFlushes"),(G=ne.perf)==null||G.inc("rodFlushes"),(ce=ne.perf)==null||ce.mark("rod:flush");const se=Array.from(R);R.clear();for(const ye of se)try{ye()}catch(ke){console.error("[rod] flush error:",ke)}}return function(G){R.add(G),u||(u=!0,queueMicrotask(V))}}const ds=ws();function _s(u,R,V){if(!u)return;if(u.nodeType===3){u.textContent=V!=null?V:"";return}Rs(u,{isSVG:u.namespaceURI===Zs,normalizeClass:ns,isContentProp:Un}).applyBindingValue(R,V)}function Dn(u){return{type:"rod",value:u,_bindings:[],_actions:[],_disposeHooks:[],_disposed:!1,_silentDepth:0,_pending:!1,bindings(){return this._bindings.map(V=>({el:V.el,key:V.key}))},onDispose(V){return typeof V=="function"&&this._disposeHooks.push(V),this},_bind(V,q={key:"auto"}){var G;if(this._disposed)return()=>{};if(!V)return()=>{};const ce={el:V,key:(G=q==null?void 0:q.key)!=null?G:"auto"};return this._bindings.some(ye=>ye.el===ce.el&&ye.key===ce.key)||this._bindings.push(ce),_s(ce.el,ce.key,this.value),()=>{this._bindings=this._bindings.filter(ye=>!(ye.el===ce.el&&ye.key===ce.key))}},action(V){return!this._disposed&&typeof V=="function"&&this._actions.push(V),this},_setSilent(V){this._silentDepth++;try{this.value=V}finally{this._silentDepth--}return this},_scheduleNotify(){this._disposed||this._pending||(this._pending=!0,ds(()=>{this._pending=!1,this._notifyNow()}))},_notifyNow(){var V,q,G,ce,se;if(this._disposed)return;const ye=performance.now();(V=ne.perf)==null||V.inc("rodNotifies"),this._bindings=this._bindings.filter(ke=>{const je=ke.el;return je?je.nodeType===3?!!je.parentNode:je.isConnected!==!1:!1});for(const ke of this._bindings)_s(ke.el,ke.key,this.value);if(!(this._silentDepth>0)){for(const ke of this._actions)try{ke(this.value)}catch(je){console.error("[rod] action error:",je)}(q=ne.debug)==null||q.inc("rodNotifies"),(se=ne.perf)==null||se.tick("rod:notify",performance.now()-ye,{bindings:((G=this._bindings)==null?void 0:G.length)||0,actions:((ce=this._actions)==null?void 0:ce.length)||0})}},dispose(){if(!this._disposed){this._disposed=!0;for(const V of this._disposeHooks)try{V()}catch(q){console.error("[rod] dispose hook error:",q)}this._bindings.length=0,this._actions.length=0,this._disposeHooks.length=0}}}}function ls(u,R="value"){var V;let q=u[R],G=null,ce=null,se=null;return(V=ne==null?void 0:ne.reactive)!=null&&V.signal&&([G,ce,se]=ne.reactive.signal(q),se&&typeof u.onDispose=="function"&&u.onDispose(se)),Object.defineProperty(u,R,{get(){return G?G():q},set(ye){ce?ce(ye):q=ye,u._scheduleNotify()},configurable:!0}),typeof u.val!="function"&&Object.defineProperty(u,"val",{value(ye){return arguments.length?(this.value=ye,ye):this.value},configurable:!0}),u[Symbol.toPrimitive]||Object.defineProperty(u,Symbol.toPrimitive,{value(ye){const ke=this.value;if(ke==null)return ke;const je=typeof ke;return ye==="number"?Number(ke):(je!=="symbol"&&Ms(this,ke),je==="string"||je==="number"||je==="boolean"||je==="bigint"||je==="symbol"?ke:String(ke))},configurable:!0}),u.valueOf||Object.defineProperty(u,"valueOf",{value(){return this.value},configurable:!0}),u.toString||Object.defineProperty(u,"toString",{value(){return String(this.value)},configurable:!0}),u}_.rod=function(R,V="value"){const q=Dn(R);return ls(q,V),ne.rod._all=ne.rod._all||new Set,ne.rod._all.add(q),typeof q.onDispose=="function"&&q.onDispose(()=>ne.rod._all.delete(q)),q},ne.rodBind=function(u,R,V={key:"auto"}){var q,G,ce;if((q=ne.debug)==null||q.inc("rodBinds"),!u)return(G=ne.debug)==null||G.inc("rodBindNull"),(ce=ne.debug)==null||ce.warn("rodBind: target element \xE8 null/undefined",V),()=>{};if(!R||R.type!=="rod")throw new Error("JSswift.rodBind: react must be a rod object");return R._bind(u,V)},ne.rodFromSignal=function(u,R){const V=_.rod(u());let q=!1;const G=ne.reactive.effect(()=>{const se=V.value,ye=ne.reactive.untracked(()=>u());if(!q&&ye!==se){q=!0;try{R(se)}finally{q=!1}}}),ce=ne.reactive.effect(()=>{const se=u();if(ne.reactive.untracked(()=>V.value)!==se){q=!0;try{V._setSilent(se)}finally{q=!1}}});return typeof V.onDispose=="function"&&(V.onDispose(G),V.onDispose(ce)),V};function Ss(u){if(!u||!u.tagName)return null;const R=u.tagName.toLowerCase();if(R==="input"){const V=(u.type||"text").toLowerCase();return V==="checkbox"?"checkbox":V==="radio"?"radio":V==="number"?"number":"text"}return R==="select"?u.multiple?"select-multiple":"select":null}ne.rodModel=function(u,R,V={}){var q,G,ce;if(!R||R.type!=="rod")throw new Error("[JSswift.rodModel] rodObj deve essere un rod");const se=Array.isArray(u)||u instanceof NodeList?Array.from(u):[u],ye=(q=V.event)!=null?q:"change",ke=(G=V.parse)!=null?G:(Qe=>Qe),je=(ce=V.format)!=null?ce:(Qe=>Qe);let Ce=!1;const Ae=[],Ee=Qe=>{for(const ut of se){if(!ut)continue;switch(Ss(ut)){case"checkbox":ut.checked=!!Qe;break;case"radio":ut.checked=ut.value==Qe;break;case"select":ut.value=Qe!=null?Qe:"";break;case"select-multiple":const ze=Array.isArray(Qe)?Qe.map(String):[];for(const $e of ut.options)$e.selected=ze.includes($e.value);break;default:ut.value=Qe!=null?Qe:""}}},He=Qe=>{if(!Ce){Ce=!0;try{Ee(je(Qe))}finally{Ce=!1}}};R.action(He),Ee(je(R.value));for(const Qe of se){if(!Qe)continue;const ut=Ss(Qe),Me=()=>{if(Ce)return;let ze;switch(ut){case"checkbox":ze=Qe.checked;break;case"radio":if(!Qe.checked)return;ze=Qe.value;break;case"select":ze=Qe.value;break;case"select-multiple":ze=Array.from(Qe.selectedOptions).map($e=>$e.value);break;case"number":ze=ke(Qe.value===""?null:Number(Qe.value));break;default:ze=ke(Qe.value)}Ce=!0;try{R.value!==ze&&(R.value=ze)}finally{Ce=!1}};Qe.addEventListener(ye,Me),Ae.push(()=>Qe.removeEventListener(ye,Me))}let it=!1;const jt=()=>{var Qe,ut,Me,ze;if(it)return;it=!0,Ae.splice(0).forEach(at=>at());const $e=(ut=(Qe=R._actions)==null?void 0:Qe.indexOf(He))!=null?ut:-1;$e>=0&&R._actions.splice($e,1);const lt=(ze=(Me=R._disposeHooks)==null?void 0:Me.indexOf(jt))!=null?ze:-1;lt>=0&&!R._disposed&&R._disposeHooks.splice(lt,1)};return typeof R.onDispose=="function"&&R.onDispose(jt),jt},ne.signalModel=function(u,R,V,q={}){const G=ne.rodFromSignal(R,V),ce=ne.rodModel(u,G,q);return()=>{ce(),G.dispose()}};function Sn(u){var R;if(!u)return;const V=(R=u.childNodes)!=null&&R.length?Array.from(u.childNodes):[],q=ne._cleanupRegistry.get(u);if(q){ne._cleanupRegistry.delete(u);for(const G of q)try{G()}catch(ce){console.error("[cleanup] error:",ce)}}for(const G of V)Sn(G)}function fs(u){const R=V=>typeof V=="string"?ne.dom.q(V):V;return Array.isArray(u)?u.map(R).filter(Boolean):[R(u)].filter(Boolean)}function tl(u){const R=[],V=[],q=G=>{if(G!=null){if(typeof G=="function"){q(G());return}if(G&&typeof G=="object"&&"node"in G){typeof G.dispose=="function"&&V.push(G.dispose),q(G.node);return}if(Array.isArray(G)){for(const ce of G)q(ce);return}if(typeof G=="string"||typeof G=="number"){R.push(document.createTextNode(String(G)));return}if(G.nodeType){R.push(G);return}console.warn("[JSswift.mount] contenuto non supportato:",G)}};return q(u),{nodes:R,disposers:V}}function nl(u=[],R="[JSswift.mount] dispose error:"){let V=!1;return()=>{if(!V){V=!0;for(const q of u)try{q()}catch(G){console.error(R,G)}}}}function sl(u=[],R=null){return nl([...R?[R]:[],...u],"[component] dispose error:")}ne.mount=function(u,R,V={}){var q;const G=fs(u),ce=(q=V.clear)!=null?q:!0,se=G.length>1;if(G.length===0)return console.warn("[JSswift.mount] nessun target valido:",u),()=>{};const ye=[];for(const je of G){if(ce)for(;je.firstChild;)Sn(je.firstChild),je.removeChild(je.firstChild);const{nodes:Ce,disposers:Ae}=tl(R);let Ee=Ce;se&&typeof R!="function"&&(Ee=Ce.map(it=>it.cloneNode(!0)),Ae.length&&console.warn("[JSswift.mount] multi-target con dispose: usa content come function per istanze separate."));const He=nl(Ae);for(const it of Ee)je.appendChild(it);ye.push({root:je,nodes:Ee,dispose:He});for(const it of Ee)!it||!it.nodeType||ne._registerCleanup(it,He)}return()=>{var je;for(const Ce of ye){for(const Ae of Ce.nodes)Ae&&(Sn(Ae),Ae.parentNode===Ce.root&&Ce.root.removeChild(Ae));(je=Ce.dispose)==null||je.call(Ce)}}},ne.component=function(u){if(typeof u!="function")throw new Error("JSswift.component: renderFn must be a function");return function(V={}){const q=[],ce=u(V,{onDispose(se){typeof se=="function"&&q.push(se)}});return ce&&typeof ce=="object"&&"node"in ce?{node:ce.node,dispose:sl(q,typeof ce.dispose=="function"?ce.dispose:null)}:{node:ce,dispose:sl(q)}}},ne.enableAutoCleanup=function(){if(ne._autoCleanupEnabled)return;ne._autoCleanupEnabled=!0;const u=new MutationObserver(R=>{for(const V of R)for(const q of V.removedNodes)Sn(q)});u.observe(document.body,{childList:!0,subtree:!0}),ne._cleanupObserver=u},ne.debug=(()=>{const u={rodFlushes:0,rodNotifies:0,rodBinds:0,rodBindNull:0,rodBindDup:0};function R(){return!!ne.config.debug}function V(...ke){R()&&console.log("[JSswift]",...ke)}function q(...ke){R()&&console.warn("[JSswift]",...ke)}function G(...ke){console.error("[JSswift]",...ke)}function ce(ke,je=1){u[ke]||(u[ke]=0),u[ke]+=je}function se(){return{...u}}function ye(){for(const ke of Object.keys(u))u[ke]=0}return{enabled:R,log:V,warn:q,error:G,inc:ce,stats:se,reset:ye}})(),ne.perf=(()=>{let u=!1;const R={effectsRun:0,effectsSlow:0,rodNotifies:0,rodFlushes:0,domWrites:0,httpRequests:0},V=[],q=[],G={timelineMax:200,slowEffectMs:8};function ce(){return typeof performance!="undefined"&&performance.now?performance.now():Date.now()}function se($e,lt=0,at=null){u&&(V.push({t:Date.now(),type:$e,ms:lt,meta:at}),V.length>G.timelineMax&&V.shift())}function ye($e,lt=1){u&&(R[$e]=(R[$e]||0)+lt)}function ke($e,lt){u&&(q.push({t:Date.now(),ms:$e,meta:lt}),q.length>100&&q.shift())}let je=null;function Ce(){je||(je=ne.reactive.effect,ne.reactive.effect=function($e,lt){return je((...St)=>{const Lt=ce();ye("effectsRun");try{return $e(...St)}finally{const Ot=ce()-Lt;Ot>=G.slowEffectMs?(ye("effectsSlow"),ke(Ot,lt||$e.name||"effect"),se("effect:slow",Ot,lt||$e.name||null)):se("effect",Ot,lt||$e.name||null)}})})}function Ae(){je&&(ne.reactive.effect=je,je=null)}function Ee($e=!0){return u=!!$e,u?Ce():Ae(),u}function He(){for(const $e of Object.keys(R))R[$e]=0;V.length=0,q.length=0}function it(){return{enabled:u,...R,slowEffectMs:G.slowEffectMs,timelineSize:V.length}}function jt(){return V.slice()}function Qe($e=G.slowEffectMs){return q.filter(lt=>lt.ms>=$e).slice().sort((lt,at)=>at.ms-lt.ms)}function ut($e,lt){const at=ce();try{return lt()}finally{const St=ce()-at;se("time:"+$e,St,$e)}}function Me($e,lt){se($e,0,lt)}function ze($e,lt,at){se($e,lt,at)}return{enable:Ee,reset:He,stats:it,timeline:jt,slowEffects:Qe,time:ut,mark:Me,tick:ze,inc:ye,cfg:G}})(),ne.rod=ne.rod||{},ne.rod.inspect=function(u,R="rod"){if(!u||u.type!=="rod")return console.warn("[JSswift.rod.inspect] non \xE8 un rod:",u),null;const V=typeof u.bindings=="function"?u.bindings():[],q={label:R,value:u.value,bindingsCount:V.length,bindings:V.map(G=>{var ce,se,ye,ke,je,Ce,Ae;return{key:G.key,el:((ce=G.el)==null?void 0:ce.nodeType)===3?"#text":(se=G.el)==null?void 0:se.tagName,id:((ye=G.el)==null?void 0:ye.id)||null,className:((ke=G.el)==null?void 0:ke.className)||null,isConnected:((je=G.el)==null?void 0:je.nodeType)===3?!!G.el.parentNode:(Ae=(Ce=G.el)==null?void 0:Ce.isConnected)!=null?Ae:null}}),actionsCount:Array.isArray(u._actions)?u._actions.length:null,disposed:!!u._disposed};return ne.config.debug?(console.groupCollapsed(`[JSswift.rod.inspect] ${R}`),console.log(q),console.groupEnd()):console.log(q),q},ne.rod.inspectAll=function(){const u=ne.rod._all?Array.from(ne.rod._all):[];return u.forEach((R,V)=>ne.rod.inspect(R,`rod#${V+1}`)),u.length},ne._storeShared=(()=>{function u(ce){return`${ce.storage}::${ce.prefix}`}function R(ce,se){function ye(Ae={}){var Ee,He;const it={storage:(Ee=Ae.storage)!=null?Ee:ce.storage,prefix:(He=Ae.prefix)!=null?He:ce.prefix};return se.set(u(it),it),it}function ke(Ae=null){var Ee;return(typeof Ae=="string"?Ae:(Ee=Ae==null?void 0:Ae.storage)!=null?Ee:ce.storage)==="session"?window.sessionStorage:window.localStorage}function je(Ae,Ee=null){return(Ee||ye()).prefix+Ae}function Ce(Ae,Ee=null){const He=Ee||ye();return`${u(He)}::${Ae}`}return{getScope:ye,getStorage:ke,fullKey:je,channelKey:Ce}}function V(ce){try{return JSON.parse(ce)}catch(se){return}}function q(ce){try{return JSON.stringify(ce)}catch(se){return}}function G(ce,...se){const ye=`${ce.storage}::${ce.prefix}::`;for(const ke of se)for(const je of Array.from(ke.keys()))je.startsWith(ye)&&ke.delete(je)}return{createScopeTools:R,safeParse:V,safeStringify:q,clearScopedMapEntries:G}})(),ne.store=(()=>{const u={prefix:"JSswift:",storage:"local",syncTabs:!0,writeDelay:0},R=new Map,V=new Map,q=new Map,G=new Map;let ce=!1;const{createScopeTools:se,safeParse:ye,safeStringify:ke,clearScopedMapEntries:je}=ne._storeShared,{getScope:Ce,getStorage:Ae,fullKey:Ee,channelKey:He}=se(u,G);function it(Ct,nt,kt=null){var Rt;const Ve=kt||Ce(),st=V.get(He(Ct,Ve));if(st)for(const Jt of st)try{(Rt=ne.reactive)!=null&&Rt.untracked?ne.reactive.untracked(()=>Jt(nt)):Jt(nt)}catch(Vt){console.error("[store] watcher error:",Vt)}}function jt(){ce=!1;for(const[Ct,nt]of Array.from(q.entries())){q.delete(Ct);const kt=R.get(Ct),Rt=ke(kt);if(Rt===void 0)continue;const Ve=Ae(nt.scope);try{Ve.setItem(Ee(nt.key,nt.scope),Rt)}catch(st){console.error("[store] write error:",st)}}}function Qe(Ct,nt=null){const kt=nt||Ce();q.set(He(Ct,kt),{key:Ct,scope:kt}),!ce&&(ce=!0,u.writeDelay>0?setTimeout(jt,u.writeDelay):queueMicrotask(jt))}function ut(Ct,nt=null){const kt=nt||Ce(),Ve=Ae(kt).getItem(Ee(Ct,kt));if(Ve!=null)return ye(Ve)}function Me(Ct,nt,kt=null){const Rt=kt||Ce(),Ve=He(Ct,Rt);if(R.has(Ve))return R.get(Ve);const st=ut(Ct,Rt);return st!==void 0?(R.set(Ve,st),st):nt}function ze(Ct,nt,kt=null){const Rt=kt||Ce();return R.set(He(Ct,Rt),nt),Qe(Ct,Rt),it(Ct,nt,Rt),nt}function $e(Ct,nt=null){const kt=nt||Ce(),Rt=He(Ct,kt);R.delete(Rt),q.delete(Rt);try{Ae(kt).removeItem(Ee(Ct,kt))}catch(Ve){}it(Ct,void 0,kt)}function lt(Ct={}){const nt=Ce(Ct),kt=Ae(nt),Rt=[];for(let Ve=0;Ve<kt.length;Ve++){const st=kt.key(Ve);st&&st.startsWith(nt.prefix)&&Rt.push(st)}for(const Ve of Rt)kt.removeItem(Ve);je(nt,R,q,V)}function at(Ct,nt,kt=null){if(typeof nt!="function")return()=>{};const Rt=kt||Ce(),Ve=He(Ct,Rt);return V.has(Ve)||V.set(Ve,new Set),V.get(Ve).add(nt),()=>{var st;return(st=V.get(Ve))==null?void 0:st.delete(nt)}}function St(Ct,nt,kt={}){const Rt=Ce({storage:kt.storage,prefix:kt.prefix}),Ve=Me(Ct,nt,Rt),[st,Jt,Vt]=ne.reactive.signal(Ve),Pt=ne.reactive.effect(()=>{const ht=st();ze(Ct,ht,Rt)}),yt=at(Ct,ht=>{st()!==ht&&Jt(ht)},Rt);return[st,Jt,()=>{try{Pt==null||Pt()}catch(ht){}try{yt==null||yt()}catch(ht){}try{Vt==null||Vt()}catch(ht){}}]}Ce(),u.syncTabs&&window.addEventListener("storage",Ct=>{if(!(!Ct.key||!Ct.storageArea))for(const nt of G.values()){if(Ae(nt)!==Ct.storageArea||!Ct.key.startsWith(nt.prefix))continue;const kt=Ct.key.slice(nt.prefix.length),Rt=Ct.newValue==null?void 0:ye(Ct.newValue),Ve=He(kt,nt);Rt===void 0?R.delete(Ve):R.set(Ve,Rt),it(kt,Rt,nt)}});function Lt(Ct={}){Object.assign(u,Ct),Ce()}function Ot(){return{prefix:u.prefix,storage:u.storage,syncTabs:u.syncTabs,cacheSize:R.size,scopeCount:G.size}}return{configure:Lt,stats:Ot,get:Me,set:ze,remove:$e,clear:lt,watch:at,signal:St}})(),ne.store.computed=function(u){if(typeof u!="function")throw new Error("store.computed: fn must be a function");return ne.reactive.computed(u)},ne.store.migrate=function(u,R,V={}){var q,G;const ce=(q=V.versionKey)!=null?q:"__version",se=Number((G=ne.store.get(ce,0))!=null?G:0),ye=Number(u!=null?u:0);if(!Number.isFinite(ye)||ye<0)throw new Error("store.migrate: targetVersion non valido");if(se>=ye)return{from:se,to:ye,applied:0};let ke=0;for(let je=se;je<ye;je++){const Ce=R==null?void 0:R[je];if(typeof Ce=="function")try{Ce(ne.store)}catch(Ae){console.error("[store.migrate] step error at version",je,Ae)}ke++,ne.store.set(ce,je+1)}return{from:se,to:ye,applied:ke}},ne.store.model=function(u,R,V,q={}){if(typeof R!="string"||!R)throw new Error("store.model: key deve essere una stringa non vuota");const[G,ce,se]=ne.store.signal(R,V,{storage:q.storage,prefix:q.prefix}),ye=ne.rodFromSignal(G,ce),ke=ne.rodModel(u,ye,{event:q.event,parse:q.parse,format:q.format});return()=>{var je;try{ke==null||ke()}catch(Ce){}try{se==null||se()}catch(Ce){}try{(je=ye.dispose)==null||je.call(ye)}catch(Ce){}}},ne.store.bind=function(u,R,V,q={}){var G;let ce=u;return typeof u=="string"&&(u.includes("[")||u.includes(" ")?ce=document.querySelectorAll(u):ce=ne.dom.q(u)),ce?ne.store.model(ce,R,V,q):((G=ne.config)!=null&&G.debug&&console.warn("[store.bind] target non trovato:",u),()=>{})},ne.store.bindAll=function(u,R={},V={}){if(typeof u=="string"&&(u=ne.dom.q(u)),!u||!u.querySelectorAll)return console.warn("[store.bindAll] form non valido:",u),()=>{};const q=[];for(const[G,ce]of Object.entries(R)){const se=u.querySelectorAll(`[name="${G}"]`);if(!se.length)continue;const ye=ne.store.model(se.length===1?se[0]:se,G,ce,V);q.push(ye)}return()=>q.forEach(G=>G())},ne.store.inspect=function(){const u={...ne.store.stats(),keys:Array.from((function(){const R=ne.store.stats().storage==="session"?sessionStorage:localStorage,V=[];for(let q=0;q<R.length;q++){const G=R.key(q);G&&G.startsWith(ne.store.stats().prefix)&&V.push(G.replace(ne.store.stats().prefix,""))}return V})())};return console.groupCollapsed("[JSswift.store.inspect]"),console.table(u.keys),console.log(u),console.groupEnd(),u},ne.store.autoForm=function(u,R={},V={}){var q;const G=ne.store.bindAll(u,R,V);return(q=ne.config)!=null&&q.debug&&console.log("[store.autoForm] autosave attivo:",R),G},ne.useStore=function(u,R,V,q={}){const[G,ce,se]=ne.store.signal(u,R,q);return V&&typeof V.onDispose=="function"&&typeof se=="function"&&V.onDispose(se),[G,ce]},ne._plugins=new Set,ne.usePlugin=function(u,R){var V;if(u){if(ne._plugins.has(u)){(V=ne.config)!=null&&V.debug&&console.warn("[JSswift.usePlugin] plugin gi\xE0 installato:",u.name||u);return}if(typeof u=="function"){u(ne,R),ne._plugins.add(u);return}if(u&&typeof u.install=="function"){u.install(ne,R),ne._plugins.add(u);return}console.warn("[JSswift.usePlugin] plugin non valido:",u)}},ne.plugins=ne.plugins||{},ne.plugins.debug={install(u){u.config.debug=!0,console.log("[JSswift] Debug mode ON")}},ne.plugins.forms={install(u){const R={};u.forms={validate(V,q={},G={}){var ce,se;if(typeof V=="string"&&(V=u.dom.q(V)),!V||!V.querySelectorAll)return console.warn("[forms.validate] form non valido:",V),null;const ye={mode:G.mode||"input",showMessages:(ce=G.showMessages)!=null?ce:!0,submitGuard:(se=G.submitGuard)!=null?se:!0,errorClass:G.errorClass||"is-invalid",validClass:G.validClass||"is-valid",messageClass:G.messageClass||"form-error"},ke={};for(const[Ee,He]of Object.entries(q)){const it=V.querySelectorAll(`[name="${Ee}"]`);if(!it.length)continue;const[jt,Qe]=u.reactive.signal(null);ke[Ee]={getErr:jt,setErr:Qe,els:it};let ut=null;ye.showMessages&&(ut=document.createElement("div"),ut.className=ye.messageClass,it[it.length-1].after(ut));const Me=()=>{let ze;const $e=it[0];if($e.type==="checkbox")ze=$e.checked;else if($e.type==="radio"){const St=Array.from(it).find(Lt=>Lt.checked);ze=St?St.value:null}else ze=$e.value;let lt=!0;try{lt=He(ze)}catch(St){lt=St.message||"Errore di validazione"}const at=lt===!0?null:typeof lt=="string"?lt:"Valore non valido";return Qe(at),!at};for(const ze of it)ze.addEventListener(ye.mode,Me);u.reactive.effect(()=>{const ze=jt();for(const $e of it)$e.classList.toggle(ye.errorClass,!!ze),$e.classList.toggle(ye.validClass,!ze);ut&&(ut.textContent=ze||"",ut.style.display=ze?"block":"none")}),Me()}const je=u.store.computed(()=>Object.values(ke).every(Ee=>!Ee.getErr())),Ce=Ee=>{let He=!0;for(const it of Object.values(ke)){const jt=it.els[0];jt&&jt.dispatchEvent(new Event(ye.mode,{bubbles:!0})),it.getErr()&&(He=!1)}!He&&ye.submitGuard&&(Ee.preventDefault(),Ee.stopPropagation())};ye.submitGuard&&V.addEventListener("submit",Ce);const Ae=()=>{ye.submitGuard&&V.removeEventListener("submit",Ce)};return R[V]={isValid:je,dispose:Ae},{isValid:je,dispose:Ae}}}}},ne._authShared=(()=>{function u(q){const G=()=>{var se;return((se=q())==null?void 0:se.roles)||[]},ce=()=>{var se;return((se=q())==null?void 0:se.permissions)||[]};return{roles:G,perms:ce,hasRole:se=>G().includes(se),can:se=>ce().includes(se),canAny:se=>se.some(ye=>G().includes(ye)||ce().includes(ye)),canAll:se=>se.every(ye=>G().includes(ye)||ce().includes(ye))}}function R(q,G){return G.some(ce=>typeof ce=="string"?q.startsWith(ce):ce instanceof RegExp?ce.test(q):!1)}function V(q,G){if(!q||!G)return;let ce=!1;function se(){return Date.now()}function ye(Ee){if(!Ee||typeof Ee!="string")return null;const He=Ee.split(".");if(He.length<2)return null;try{const it=He[1].replace(/-/g,"+").replace(/_/g,"/"),jt=decodeURIComponent(atob(it).split("").map(Qe=>"%"+Qe.charCodeAt(0).toString(16).padStart(2,"0")).join(""));return JSON.parse(jt)}catch(it){return null}}function ke(){var Ee,He,it,jt;if(typeof G._getState=="function"){const Qe=G._getState();return Qe&&typeof Qe=="object"?Qe:{user:(He=(Ee=G.user)==null?void 0:Ee.call(G))!=null?He:null}}return{user:(jt=(it=G.user)==null?void 0:it.call(G))!=null?jt:null}}function je(){var Ee,He,it;const jt=ke()||{},Qe=(He=jt.user)!=null?He:(Ee=G.user)==null?void 0:Ee.call(G),ut=(Qe==null?void 0:Qe.name)||(Qe==null?void 0:Qe.email)||(Qe==null?void 0:Qe.id)||"anon",Me=!!((it=G.isAuth)!=null&&it.call(G)),ze=jt.expiresAt||null,$e=ze?ze-se():null;return Me?`AUTH \u2705 user=${ut}${ze?` expiresIn=${Math.round($e/1e3)}s`:""}`:`AUTH \u274C user=${ut}`}function Ce(Ee="auth"){var He,it,jt;const Qe=ke()||{},ut=(it=Qe.user)!=null?it:(He=G.user)==null?void 0:He.call(G),Me=(ut==null?void 0:ut.roles)||[],ze=(ut==null?void 0:ut.permissions)||[],$e=Qe.accessToken||null,lt=Qe.refreshToken||null,at=$e?ye($e):null,St=Qe.expiresAt||(at!=null&&at.exp?at.exp*1e3:null),Lt=se(),Ot=St?St-Lt:null,Ct={label:Ee,isAuth:!!((jt=G.isAuth)!=null&&jt.call(G)),user:ut,roles:Me,permissions:ze,has:{role:nt=>{var kt;return!!((kt=G.hasRole)!=null&&kt.call(G,nt))},can:nt=>{var kt;return!!((kt=G.can)!=null&&kt.call(G,nt))}},token:{hasAccess:!!$e,hasRefresh:!!lt,expiresAt:St,expiresInSec:Ot==null?null:Math.round(Ot/1e3),decodedJWT:at}};return console.groupCollapsed(`[JSswift.auth.inspect] ${Ee}`),console.log("status:",je()),console.log(Ct),Ot!=null&&(Ot<=0?console.warn("\u26A0\uFE0F Access token scaduto."):Ot<6e4&&console.warn("\u26A0\uFE0F Access token in scadenza (<60s).")),console.groupEnd(),Ct}function Ae(Ee=!0){ce=!!Ee,console.log("[JSswift.auth.trace]",ce?"ON":"OFF")}if(typeof G.fetch=="function"&&!G._fetchWrapped){const Ee=G.fetch.bind(G);G.fetch=async(...He)=>{const it=await Ee(...He);if(ce)try{console.log("[auth.fetch]",it.status,He[0])}catch(jt){}return it},G._fetchWrapped=!0}G.decodeJWT=ye,G.status=je,G.inspect=Ce,G.trace=Ae}return{createPermissionApi:u,matchesProtectedPath:R,attachDevTools:V}})(),ne.plugins.auth={install(u,R={}){var V;const{createPermissionApi:q,matchesProtectedPath:G,attachDevTools:ce}=ne._authShared,se={key:R.key||"auth",loginRoute:R.loginRoute||"/login",protected:R.protected||[],autoRedirect:(V=R.autoRedirect)!=null?V:!0,endpoints:R.endpoints||{login:"/api/login",refresh:"/api/refresh",logout:"/api/logout"},fetchOptions:R.fetchOptions||{},tokenHeader:R.tokenHeader||"Authorization",tokenPrefix:R.tokenPrefix||"Bearer ",refreshMargin:R.refreshMargin||3e4},[ye,ke]=u.store.signal(se.key,null),je=()=>{var at;return((at=ye())==null?void 0:at.user)||null},Ce=()=>{var at;return!!((at=ye())!=null&&at.accessToken)},{hasRole:Ae,can:Ee,canAny:He,canAll:it}=q(je);let jt=!1,Qe=[];function ut(){const at=ye();return at!=null&&at.expiresAt?Date.now()>at.expiresAt-se.refreshMargin:!1}async function Me(){var at;if(jt)return new Promise((St,Lt)=>Qe.push({res:St,rej:Lt}));jt=!0;try{const St=await fetch(se.endpoints.refresh,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({refreshToken:(at=ye())==null?void 0:at.refreshToken})});if(!St.ok)throw new Error("Refresh failed");const Lt=await St.json();return ke({...ye(),...Lt}),Qe.forEach(Ot=>Ot.res(!0)),Qe=[],!0}catch(St){throw Qe.forEach(Lt=>Lt.rej(St)),Qe=[],ke(null),se.autoRedirect&&u.router.navigate(se.loginRoute),St}finally{jt=!1}}async function ze(at){const St=await fetch(se.endpoints.login,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(at)});if(!St.ok)throw new Error("Login failed");const Lt=await St.json();return ke(Lt),Lt}async function $e(){try{await fetch(se.endpoints.logout,{method:"POST"})}catch(at){}ke(null),se.autoRedirect&&u.router.navigate(se.loginRoute)}async function lt(at,St={}){var Lt;ut()&&await Me();const Ot=ye(),Ct=new Headers(St.headers||{});Ot!=null&&Ot.accessToken&&Ct.set(se.tokenHeader,se.tokenPrefix+Ot.accessToken);const nt=await fetch(at,{...se.fetchOptions,...St,headers:Ct});return nt.status===401&&((Lt=ye())!=null&&Lt.refreshToken)&&!St._authRetried?(await Me(),lt(at,{...St,_authRetried:!0})):nt}u.router.beforeEach(at=>{const St=at.path;return G(St,se.protected)&&!Ce()?se.loginRoute:!0}),u.auth={user:je,isAuth:Ce,hasRole:Ae,can:Ee,canAny:He,canAll:it,loginAsync:ze,logoutAsync:$e,fetch:lt,_getState:ye},u.useAuth=function(at){return at&&at.onDispose,u.auth},ce(ne,u.auth)}},ne._httpShared=(()=>{function u(je){var Ce;const Ae=je.reactive,[Ee,He]=Ae.signal(0),[it,jt]=Ae.signal("idle"),[Qe,ut]=Ae.signal(null),[Me,ze]=Ae.signal(null),[$e,lt]=Ae.signal(null),[at,St]=Ae.signal(0),[Lt,Ot]=Ae.signal(0);let Ct=0;function nt(Ve){const st=++Ct,Jt=Date.now();return He(Ee()+1),jt("pending"),lt(null),ze(null),ut({id:st,url:Ve.url,method:Ve.method,meta:Ve.meta,timeout:Ve.timeout,retry:Ve.retry,startedAt:Jt}),Ot(Jt),st}function kt(Ve,st,Jt,Vt){const Pt=Date.now();He(Math.max(0,Ee()-1)),Ve===Ct&&(Jt?(jt("error"),lt(Jt),ze(null)):st?(jt("success"),lt(null),ze({id:Ve,status:st.status,ok:st.ok,headers:st.headers,url:st.url,receivedAt:Pt,raw:st})):(jt("idle"),lt(null),ze(null)),St(Math.max(0,Number(Vt||0)))),Ot(Pt)}return{state:{inFlight:Ee,status:it,isLoading:(Ce=je.store)!=null&&Ce.computed?je.store.computed(()=>Ee()>0):()=>Ee()>0,lastRequest:Qe,lastResponse:Me,lastError:$e,lastDuration:at,lastUpdated:Lt,reset(){He(0),jt("idle"),ut(null),ze(null),lt(null),St(0),Ot(Date.now())}},markStart:nt,markEnd:kt}}function R(je,Ce){if(!je||/^https?:\/\//i.test(Ce))return Ce;const Ae=je.endsWith("/")?je.slice(0,-1):je,Ee=Ce.startsWith("/")?Ce:"/"+Ce;return Ae+Ee}function V(je){return new Promise(Ce=>setTimeout(Ce,je))}function q(je,Ce){return je?!0:Ce?Ce.status===429||Ce.status>=500&&Ce.status<=599:!1}function G(je,Ce){if(!je&&!Ce)return{signal:void 0,cancel:()=>{}};const Ae=new AbortController,Ee=Ae.signal;let He=null;je>0&&(He=setTimeout(()=>Ae.abort(new Error("timeout")),je));const it=()=>Ae.abort(Ce.reason||new Error("aborted"));return Ce&&(Ce.aborted?it():Ce.addEventListener("abort",it,{once:!0})),{signal:Ee,cancel:()=>{var Qe;He&&clearTimeout(He),Ce&&((Qe=Ce.removeEventListener)==null||Qe.call(Ce,"abort",it))}}}function ce(je,Ce,Ae={}){var Ee,He,it;const jt=typeof Ce=="string"?R(je.baseURL,Ce):Ce,Qe=(Ae.method||"GET").toUpperCase(),ut=new Headers(je.headers);return Ae.headers&&new Headers(Ae.headers).forEach((Me,ze)=>ut.set(ze,Me)),{url:jt,method:Qe,headers:ut,body:Ae.body,credentials:(Ee=Ae.credentials)!=null?Ee:je.credentials,signal:Ae.signal,timeout:(He=Ae.timeout)!=null?He:je.timeout,retry:(it=Ae.retry)!=null?it:je.retry,meta:Ae.meta||{}}}async function se(je,...Ce){var Ae;let Ee=Ce[0];for(const He of je)Ee=(Ae=await He(Ee,...Ce.slice(1)))!=null?Ae:Ee;return Ee}function ye(je,Ce){return{ok:je.ok,status:je.status,headers:je.headers,raw:je,req:Ce,async json(){let Ae=null,Ee=null;try{Ae=await je.json()}catch(He){Ae=null}return je.ok||(Ee=Ae!=null?Ae:{status:je.status}),{data:Ae,error:Ee,ok:je.ok,status:je.status}},async jsonStrict(){const{data:Ae,error:Ee}=await this.json();if(Ee){const He=new Error(`HTTP error ${je.status} ${(Ce==null?void 0:Ce.method)||""} ${(Ce==null?void 0:Ce.url)||""}`.trim());throw He.status=je.status,He.data=Ae,He.req={url:Ce==null?void 0:Ce.url,method:Ce==null?void 0:Ce.method,meta:Ce==null?void 0:Ce.meta},He}return{data:Ae,ok:!0,status:je.status}},async text(){let Ae="";try{Ae=await je.text()}catch(Ee){}return{text:Ae,ok:je.ok,status:je.status}},async textStrict(){const Ae=await this.text();if(!Ae.ok){const Ee=new Error("HTTP error "+je.status);throw Ee.status=je.status,Ee.text=Ae.text,Ee}return Ae}}}function ke(je,Ce,Ae,Ee,He={}){const it=new Headers(He.headers||{});return it.has("Content-Type")||it.set("Content-Type","application/json"),je(Ae,{...He,method:Ce,headers:it,body:Ee==null?void 0:JSON.stringify(Ee)})}return{createReactiveState:u,joinURL:R,sleep:V,isRetryable:q,makeAbort:G,normalizeRequest:ce,runHooks:se,wrapResponse:ye,withJSON:ke}})();const{createReactiveState:Ll,sleep:ll,isRetryable:ol,makeAbort:El,normalizeRequest:Il,runHooks:Ds,wrapResponse:$s,withJSON:os}=ne._httpShared,pn=typeof globalThis!="undefined"&&globalThis.JSswift_setting?globalThis.JSswift_setting:{},il={baseURL:((wt=pn.http)==null?void 0:wt.baseURL)||"",timeout:(ms=(zs=pn.http)==null?void 0:zs.timeout)!=null?ms:0,retry:((as=pn.http)==null?void 0:as.retry)||{attempts:0,delay:250,factor:2},headers:((Ps=pn.http)==null?void 0:Ps.headers)||{},credentials:(cs=pn.http)==null?void 0:cs.credentials,debug:(ts=pn.debug)!=null?ts:!1},xe=Ll(ne),Ln=()=>typeof performance!="undefined"&&performance.now?performance.now():Date.now(),En={beforeRequest:new Set,afterResponse:new Set,onError:new Set};async function zl(u){const R=ne.auth&&typeof ne.auth.fetch=="function"?ne.auth.fetch.bind(ne.auth):fetch,V={method:u.method,headers:u.headers,body:u.body,credentials:u.credentials,signal:u.signal};return R(u.url,V)}async function vn(u,R={}){var V,q,G;let ce=Il(il,u,R);ce=await Ds(En.beforeRequest,ce);const se=xe.markStart(ce),ye=Ln(),ke=ce.retry||{attempts:0,delay:250,factor:2},je=Math.max(0,Number(ke.attempts||0));let Ce=Math.max(0,Number(ke.delay||0));const Ae=Math.max(1,Number(ke.factor||2));let Ee=null,He=null,it=null,jt=null;try{for(let Qe=0;Qe<=je;Qe++){Ee=null,He=null;const{signal:ut,cancel:Me}=El(ce.timeout,R.signal),ze={...ce,signal:ut},$e=Ln();try{il.debug&&console.log("[http.request]",ze.method,ze.url),(V=ne.perf)==null||V.inc("httpRequests"),(q=ne.perf)==null||q.mark("http:req",{url:ce.url,method:ce.method});const lt=await zl(ze);He=lt;const at=await Ds(En.afterResponse,lt,ze),St=Ln()-$e;if((G=ne.perf)==null||G.tick("http:res",St,{status:lt.status,url:ce.url}),Qe<je&&ol(null,at)){Me(),await ll(Ce),Ce=Math.round(Ce*Ae);continue}return Me(),it=at,$s(at,ze)}catch(lt){Ee=lt,Me();for(const at of En.onError)try{at(lt,ze)}catch(St){}if(Qe<je&&ol(lt,null)){await ll(Ce),Ce=Math.round(Ce*Ae);continue}throw jt=lt,lt}}}finally{const Qe=Ln()-ye;xe.markEnd(se,it,jt,Qe)}if(Ee)throw Ee;return $s(He,ce)}ne.http={},ne.http.request=vn,ne.http.state=()=>xe.state,ne.http.get=(u,R)=>vn(u,{...R,method:"GET"}),ne.http.del=(u,R)=>vn(u,{...R,method:"DELETE"}),ne.http.post=(u,R,V)=>os(vn,"POST",u,R,V),ne.http.put=(u,R,V)=>os(vn,"PUT",u,R,V),ne.http.patch=(u,R,V)=>os(vn,"PATCH",u,R,V),ne.http.getJSON=async(u,R)=>(await vn(u,{...R,method:"GET"})).jsonStrict(),ne.http.delJSON=async(u,R)=>(await vn(u,{...R,method:"DELETE"})).jsonStrict(),ne.http.postJSON=async(u,R,V)=>(await os(vn,"POST",u,R,V)).jsonStrict(),ne.http.putJSON=async(u,R,V)=>(await os(vn,"PUT",u,R,V)).jsonStrict(),ne.http.patchJSON=async(u,R,V)=>(await os(vn,"PATCH",u,R,V)).jsonStrict(),ne.http.onBefore=function(u){return En.beforeRequest.add(u),()=>En.beforeRequest.delete(u)},ne.http.onAfter=function(u){return En.afterResponse.add(u),()=>En.afterResponse.delete(u)},ne.http.onError=function(u){return En.onError.add(u),()=>En.onError.delete(u)},window._http=ne.http,ne.useRouter=function(u){const R=ne.router;return u&&u.onDispose,{navigate:R.navigate,back:()=>history.back(),forward:()=>history.forward(),get current(){return R}}},ne.useRoute=function(u){const[R,V]=ne.reactive.signal(""),[q,G]=ne.reactive.signal({}),[ce,se]=ne.reactive.signal({}),[ye,ke]=ne.reactive.signal(""),je=Ae=>{V(Ae.path||""),G(Ae.params||{}),se(Ae.query||{}),ke(Ae.hash||"")},Ce=ne.router.subscribe(je);return u&&typeof u.onDispose=="function"&&u.onDispose(Ce),{path:R,params:q,query:ce,hash:ye}},ne._routerShared=(()=>{function u(ye){return ye?(ye.startsWith("/")||(ye="/"+ye),ye.length>1&&ye.endsWith("/")&&(ye=ye.slice(0,-1)),ye):"/"}function R(ye,ke=""){if(ke&&ye.startsWith(ke)){const je=ye.slice(ke.length)||"/";return u(je)}return u(ye)}function V(ye){ye=u(ye);const ke=[],je=ye.replace(/([.+*?=^!${}()[\]|/\\])/g,"\\$1").replace(/\\\/:([A-Za-z0-9_]+)/g,(Ce,Ae)=>(ke.push(Ae),"\\/([^\\/]+)"));return{pattern:ye,regex:new RegExp("^"+je+"$"),keys:ke}}function q(ye){const ke={};return new URLSearchParams(ye||"").forEach((Ce,Ae)=>{ke[Ae]===void 0?ke[Ae]=Ce:Array.isArray(ke[Ae])?ke[Ae].push(Ce):ke[Ae]=[ke[Ae],Ce]}),ke}function G(ye){const ke=[];for(const je of ye)if(ke.push({...je,_parent:null}),je.children&&je.children.length)for(const Ce of je.children)ke.push({...Ce,_parent:je});return ke.sort((je,Ce)=>Ce.path.length-je.path.length),ke}function ce(ye,ke){const je=u(ye),Ce=G(ke);for(const Ae of Ce){const Ee=Ae._compiled.regex.exec(je);if(!Ee)continue;const He={};return Ae._compiled.keys.forEach((it,jt)=>{He[it]=decodeURIComponent(Ee[jt+1])}),{route:Ae,params:He,parent:Ae._parent||null}}return null}function se(ye,ke,je=50){ye.push({at:Date.now(),path:ke.path,params:ke.params,query:ke.query,hash:ke.hash}),ye.length>je&&ye.shift()}return{normalizePath:u,stripBase:R,compilePattern:V,parseQuery:q,flattenRoutes:G,matchRoute:ce,pushHistoryEntry:se}})(),ne._uiMetaShared=(()=>{function u(se){return{hasTabPanel:typeof se.TabPanel=="function",Card:typeof se.Card=="function"?se.Card:(...ye)=>se.div({class:"jss-doc-card"},...ye),Chip:typeof se.Chip=="function"?se.Chip:(ye,ke)=>se.span({class:"jss-chip jss-chip-fallback"},ke)}}function R(se){return se?Array.isArray(se)?se.join(" | "):String(se):"\u2014"}function V(se,ye,ke){return se.div({class:"jss-doc-meta"},se.div({class:"jss-doc-meta-head"},se.div({class:"jss-doc-meta-name"},ye.name),se.div({class:"jss-doc-meta-types"},...ye.type?String(ye.type).split("|").map(je=>ke({color:"secondary",dense:!0,outline:!0},je)):[se.span("\u2014")])),se.div({class:"jss-doc-meta-grid"},se.div({class:"jss-doc-meta-block"},se.div({class:"jss-doc-meta-label"},"Default"),se.div({class:"jss-doc-meta-value"},ye.default==null?"\u2014":String(ye.default))),se.div({class:"jss-doc-meta-block"},se.div({class:"jss-doc-meta-label"},"Values"),se.div({class:"jss-doc-meta-value"},R(ye.values)))),se.div({class:"jss-doc-meta-block"},se.div({class:"jss-doc-meta-label"},"Description"),se.div({class:"jss-doc-meta-value"},ye.description||"\u2014")))}function q(se,ye){return se.div({class:"jss-doc-fallback"},ye.map(ke=>se.div({class:"jss-doc-fallback-item"},se.h4({class:"jss-doc-fallback-title"},ke.label||ke.name),ke.content)))}function G(se,ye){return ye?Array.isArray(ye)?ye.map(ke=>({name:ke.name,wrap:!0,label:ke.name,content:se.div({class:"jss-p-md"},ke.description)})):Object.entries(ye).map(([ke,je])=>({name:ke,wrap:!0,label:ke,content:se.div({class:"jss-p-md"},je)})):[]}function ce(se,ye){return ye?Array.isArray(ye)?ye.map(ke=>({name:ke.name,wrap:!0,label:ke.type,content:ke.description})):Object.entries(ye).map(([ke,je])=>({name:ke,wrap:!0,label:ke,content:se.div({class:"jss-doc-meta"},se.div({class:"jss-doc-meta-head"},se.div({class:"jss-doc-meta-name"},ke)),se.div({class:"jss-doc-meta-grid"},se.div({class:"jss-doc-meta-block"},se.div({class:"jss-doc-meta-label"},"Type"),se.div({class:"jss-doc-meta-value"},je.type||"\u2014"))),se.div({class:"jss-doc-meta-block"},se.div({class:"jss-doc-meta-label"},"Description"),se.div({class:"jss-doc-meta-value"},je.description||"\u2014")))})):[]}return{resolveDocComponents:u,renderMetaItem:V,renderTabGroupFallback:q,normalizeEventRows:G,normalizeSlotRows:ce}})(),ne.ui=ne.ui||{},ne.ui.meta=ne.ui.meta||{},ne.ui.slot=function(R,V={}){const q=ne.ui,{as:G="node",wrap:ce="span",iconProps:se=null,filter:ye=!0}=V,ke=Ee=>document.createTextNode(String(Ee)),je=Ee=>_.span(String(Ee)),Ce=Ee=>{if(Ee==null||Ee===!1)return null;if(typeof Ee=="function")return Ee;if(Array.isArray(Ee))return Ee.flatMap(Ce).filter(Boolean);if(Ee&&typeof Ee=="object"&&Ee.nodeType)return Ee;if(typeof Ee=="string"||typeof Ee=="number"||typeof Ee=="boolean"){const He=String(Ee);return G==="icon"&&q.Icon?q.Icon(He,{class:"jss-slot-icon",...se||{}}):ce==="text"?ke(He):ce==="span"?je(He):He}return ce==="text"?ke(Ee):ce==="span"?je(Ee):String(Ee)},Ae=Ce(R);return ye&&Array.isArray(Ae)?Ae.filter(Boolean):Ae},ne.ui.slots=function(...R){const V=[];for(const q of R){const G=ne.ui.slot(q);G&&(Array.isArray(G)?V.push(...G):V.push(G))}return V},ne.docTable=u=>{var R;if(!ne.isDev())return _.div();const{resolveDocComponents:V,renderMetaItem:q,renderTabGroupFallback:G,normalizeEventRows:ce,normalizeSlotRows:se}=ne._uiMetaShared,ye=(R=ne.ui.meta)==null?void 0:R[u];if(!ye)return _.div({class:"jss-muted"},`Meta non trovata: ${u}`);const{hasTabPanel:ke,Card:je,Chip:Ce}=V(_),Ae={};Object.entries(ye.props||{}).forEach(([Me,ze])=>{const $e=ze.category||"general";Ae[$e]||(Ae[$e]=[]),Ae[$e].push({name:Me,...ze})});const Ee=Object.keys(Ae).map(Me=>{const ze=Ae[Me].map($e=>({name:$e.name,wrap:!0,label:$e.name,content:q(_,$e,Ce)}));return{name:Me,wrap:!0,label:Me,content:ke?_.TabPanel({orientation:"vertical",animated:!0,radius:"0 0 0 var(--jss-r-default)",tabs:ze}):G(_,ze)}}),He=ce(_,ye.events),it=se(_,ye.slots),jt=_.rod(null),Qe=[];it.length&&Qe.push({name:"Slots",wrap:!0,label:"Slots",content:ke?_.TabPanel({animated:!0,radius:"0 0 0 var(--jss-r-default)",orientation:"vertical",tabs:it}):G(_,it)}),Ee.length&&Qe.push(...Ee),He.length&&Qe.push({name:"Events",wrap:!0,label:"Events",content:ke?_.TabPanel({animated:!0,radius:"0 0 0 var(--jss-r-default)",orientation:"vertical",tabs:He}):G(_,He)});const ut="general";return Qe.sort((Me,ze)=>Me.name===ut?-1:ze.name===ut?1:Me.name.localeCompare(ze.name)),je({class:"jss-doc-table"},_.div({class:"jss-doc-table-header"},_.div({class:"jss-doc-table-title"},`_.${u}`),ye.signature?_.div({class:"jss-doc-table-signature"},String(ye.signature).replaceAll("UI.","_.")):null),Qe.length?_.h4({class:"jss-doc-table-section-title"},Ee.length?"Props":"Documentation"):_.p({class:"jss-muted"},"Nessuna documentazione strutturata disponibile."),Qe.length?ke?_.TabPanel({border:!0,animated:!0,orientation:"horizontal",tabs:Qe,model:jt}):G(_,Qe):null,ye.returns?_.p({class:"jss-muted",style:{marginTop:"14px"}},`Returns: ${ye.returns}`):null)},ne.ui.inspect=u=>{var R;return console.log(((R=ne.ui.meta)==null?void 0:R[u])||"meta not found")},ne.ui.can=function(u,R,V,q=null){var G,ce;const se=ne.useAuth?ne.useAuth(u):ne.auth;return se?(typeof R=="function"?!!R(se):((G=se.can)==null?void 0:G.call(se,R))||((ce=se.hasRole)==null?void 0:ce.call(se,R)))?typeof V=="function"?V():V:typeof q=="function"?q():q:typeof q=="function"?q():null},ne.ui.canAny=function(u,R,V,q=null){var G;const ce=ne.useAuth?ne.useAuth(u):ne.auth;return!!((G=ce==null?void 0:ce.canAny)!=null&&G.call(ce,R))?typeof V=="function"?V():V:typeof q=="function"?q():q},ne.ui.canAll=function(u,R,V,q=null){var G;const ce=ne.useAuth?ne.useAuth(u):ne.auth;return!!((G=ce==null?void 0:ce.canAll)!=null&&G.call(ce,R))?typeof V=="function"?V():V:typeof q=="function"?q():q},ne.Can=function(R,V){var q,G;const ce=ne.useAuth?ne.useAuth(V):ne.auth;return(()=>{var ye,ke,je,Ce;return ce?R.when&&typeof R.when=="function"?!!R.when(ce):R.perm?!!((ye=ce.can)!=null&&ye.call(ce,R.perm)):R.role?!!((ke=ce.hasRole)!=null&&ke.call(ce,R.role)):R.any?!!((je=ce.canAny)!=null&&je.call(ce,R.any)):R.all?!!((Ce=ce.canAll)!=null&&Ce.call(ce,R.all)):!1:!1})()?typeof R.then=="function"?R.then():(q=R.then)!=null?q:null:typeof R.else=="function"?R.else():(G=R.else)!=null?G:null},ne.router=(()=>{let u="history",R=[],V=null,q=null,G="",ce=null,se=null,ye=[],ke=!1;const{normalizePath:je,stripBase:Ce,compilePattern:Ae,parseQuery:Ee,matchRoute:He,pushHistoryEntry:it}=ne._routerShared,jt={setOutlet:{description:"imposta il contenitore del router"},setBase:{description:"imposta il base path del router"},add:{description:"per aggiungere la route"},notFound:{description:"imposta la view 404"},beforeEach:{description:"hook prima di ogni navigazione"},start:{description:"avvia il router"},navigate:{description:"naviga verso una route"},subscribe:{description:"sottoscrive agli aggiornamenti di route"},current:{description:"ritorna l'URL corrente"},isActive:{description:"verifica se una route e\u0300 attiva"},status:{description:"stringa di stato router"},inspect:{description:"stampa info diagnostiche"},trace:{description:"abilita/disabilita tracing"},history:{description:"ritorna la history interna"},setURLOnly:{description:"aggiorna solo l'URL del browser senza render/meta"}};function Qe(rt,{replace:ht=!1}={}){const o=typeof rt=="string"?new URL(rt,window.location.origin):rt,Kt=o.pathname+o.search+o.hash;if(u==="hash"||u==="auto"){if(history.pushState){const Bt="#"+Kt;ht?history.replaceState({},"",Bt):history.pushState({},"",Bt);return}const re="#"+Kt;ht?window.location.replace(re):window.location.hash=re;return}ht?history.replaceState({},"",G+Kt):history.pushState({},"",G+Kt)}function ut(){if(u==="hash"){const rt=window.location.hash||"#/",ht=rt.startsWith("#")?rt.slice(1):rt;return new URL(ht,window.location.origin)}if(u==="auto"&&window.location.hash.startsWith("#/")){const rt=window.location.hash.slice(1);return new URL(rt,window.location.origin)}return new URL(window.location.href)}function Me(rt,ht=!1){if(u==="hash"||u==="auto"&&!history.pushState){const o="#"+(rt.pathname+rt.search+rt.hash);ht?window.location.replace(o):window.location.hash=o;return}ht?history.replaceState({},"",G+rt.pathname+rt.search+rt.hash):history.pushState({},"",G+rt.pathname+rt.search+rt.hash)}function ze(rt){u=rt||"history"}function $e(rt){return Ce(rt,G)}function lt(rt){if(!rt)return!1;const ht=se?se.path:$e(ut().pathname);let o=rt;typeof o=="string"&&(o.includes("?")||o.includes("#")||o.includes("://"))&&(o=new URL(o,window.location.origin).pathname);const Kt=$e(o);return Kt.includes(":")?Ae(Kt).regex.test(ht):Kt===ht}async function at(rt,{replace:ht=!1}={}){if(!V){console.warn("[router] outlet non impostato. Usa JSswift.router.setOutlet('#app').");return}const o=typeof rt=="string"?new URL(rt,window.location.origin):rt;ke&&console.log("[router.navigate]",o.toString());const Kt=o.pathname+o.search+o.hash;Me(o,ht);const re=$e(o.pathname),Bt=He(re,R),pe={path:re,fullPath:Kt,params:Bt?Bt.params:{},query:Ee(o.search),hash:o.hash||"",navigate:St,outlet:V};if(ce){const on=await ce(pe);if(on===!1)return;if(typeof on=="string"){St(on,{replace:!0});return}}if(typeof q=="function"){try{q()}catch(on){console.error("[router] unmount error:",on)}q=null}if(!Bt){const on=R._notFound;on?q=ne.mount(V,()=>on(pe),{clear:!0}):q=ne.mount(V,_.div("404"),{clear:!0}),st(pe),se=pe,it(ye,pe);return}const $n=Bt.route.view,xt=Bt.parent;let qe=null;if(pe.renderChild=on=>{if(!pe._child)return null;const Kn=typeof on=="string"?pe.outlet.querySelector(on):on;return Kn?(qe=ne.mount(Kn,()=>pe._child.view(pe._child.ctx),{clear:!0}),qe):(console.warn("[router] child outlet non trovato:",on),null)},xt){const on=Bt.route,Kn={...pe,params:{...pe.params}};pe._child={view:on.view,ctx:Kn},q=ne.mount(V,()=>xt.view(pe),{clear:!0})}else pe._child=null,q=ne.mount(V,()=>$n(pe),{clear:!0});st(pe),se=pe,it(ye,pe)}function St(rt,ht={}){const o=new URL(rt,window.location.origin);at(o,ht)}function Lt(){window.addEventListener("popstate",()=>{at(ut(),{replace:!0})}),window.addEventListener("hashchange",()=>{(u==="hash"||u==="auto")&&at(ut(),{replace:!0})}),document.addEventListener("click",rt=>{var ht,o;const Kt=(o=(ht=rt.target)==null?void 0:ht.closest)==null?void 0:o.call(ht,"a");if(!Kt||rt.defaultPrevented||rt.button!==0||rt.metaKey||rt.ctrlKey||rt.shiftKey||rt.altKey||Kt.hasAttribute("download")||Kt.target&&Kt.target!=="_self")return;const re=Kt.getAttribute("href");if(!re||re.startsWith("mailto:")||re.startsWith("tel:"))return;const Bt=new URL(re,window.location.origin);if(Bt.origin!==window.location.origin)return;const pe=new URL(window.location.href);Bt.pathname+Bt.search===pe.pathname+pe.search&&Bt.hash||(rt.preventDefault(),St(Bt.pathname+Bt.search+Bt.hash))}),at(ut(),{replace:!0})}function Ot(rt){return V=typeof rt=="string"?ne.dom.q(rt):rt,V}function Ct(rt){G=rt?je(rt):"",G==="/"&&(G="")}function nt(rt,ht,o=null){const Kt=Ae(rt),re={path:Kt.pattern,view:ht,_compiled:Kt,children:[]};if(Array.isArray(o))for(const Bt of o){const[pe,$n,xt]=Bt,qe=je(Kt.pattern+"/"+(pe||"").replace(/^\//,""));re.children.push({path:qe,view:$n,_compiled:Ae(qe),children:Array.isArray(xt)?xt:[]})}R.push(re)}function kt(rt){R._notFound=rt}function Rt(rt){ce=rt}let Ve=new Set;function st(rt){for(const ht of Ve)try{ht(rt)}catch(o){console.error("[router] listener error:",o)}}function Jt(){if(!se)return"ROUTER \u23F3 not ready";const rt=Object.keys(se.query||{}).length?"?":"";return`ROUTER ${se.path}${rt} ${se.hash||""}`}function Vt(rt="router"){if(!se)return console.warn("[router.inspect] nessuna route attiva"),null;const ht={label:rt,mode:typeof u!="undefined"?u:"unknown",base:G,path:se.path,params:se.params,query:se.query,hash:se.hash,outlet:V,timestamp:new Date().toISOString()};return console.groupCollapsed(`[JSswift.router.inspect] ${rt}`),console.log(ht),console.log("history:",ye.slice()),console.groupEnd(),ht}function Pt(rt=!0){ke=!!rt,console.log("[JSswift.router.trace]",ke?"ON":"OFF")}function yt(){return ye.slice()}return{meta:jt,setOutlet:Ot,setBase:Ct,add:nt,setURLOnly:Qe,notFound:kt,beforeEach:Rt,start:Lt,navigate:St,isActive:lt,subscribe(rt){return Ve.add(rt),()=>Ve.delete(rt)},current(){return ut?ut():new URL(window.location.href)},status:Jt,inspect:Vt,trace:Pt,history:yt}})(),(Ts=ne.config)!=null&&Ts.debug&&(window.$router=ne.router),ne.signal=ne.reactive.signal,ne.effect=ne.reactive.effect,ne.computed=ne.reactive.computed,ne.untracked=ne.reactive.untracked,ne.batch=ne.reactive.batch;function ps(u){return u==null?null:String(u).trim()||null}function js(u){const R=Array.isArray(u)?u:typeof u=="string"?u.split(","):[],V=[],q=new Set;for(const G of R){const ce=ps(G);!ce||q.has(ce)||(q.add(ce),V.push(ce))}return V}function Cs(){var u;return typeof document!="undefined"&&document.documentElement?document.documentElement:(u=ne.dom)!=null&&u.q?ne.dom.q("html"):null}function rl(){try{return typeof globalThis!="undefined"&&globalThis.localStorage||null}catch(u){return null}}function xs(){var u;return ps((u=ne.theme)==null?void 0:u.storageKey)||"jsswift:theme"}function Et(){const u=rl();if(!u)return null;try{return ps(u.getItem(xs()))}catch(R){return null}}function Vs(u){const R=rl();if(R)try{u==null?R.removeItem(xs()):R.setItem(xs(),u)}catch(V){}}function D(u){var R,V,q,G,ce;const se=Cs(),ye=[u,(R=ne.theme)==null?void 0:R.themes,(V=ne.config)==null?void 0:V.themes,typeof globalThis!="undefined"?(q=globalThis.JSswift_setting)==null?void 0:q.themes:null,typeof globalThis!="undefined"?(G=globalThis.JSswift_setting)==null?void 0:G.themeList:null,(ce=se==null?void 0:se.getAttribute)==null?void 0:ce.call(se,"data-themes")];for(const ke of ye){const je=js(ke);if(je.length)return je}return[]}ne.theme=ne.theme||{},ne.theme.storageKey=xs(),js(ne.theme.themes).length||(ne.theme.themes=D()),ne.setTheme=function(u,R={}){const V=ps(u),q=Cs();return q&&(V==null?q.removeAttribute("data-theme"):q.setAttribute("data-theme",V)),R.persist!==!1&&Vs(V),q},ne.getTheme=function(u={}){var R;const V=Cs(),q=ps((R=V==null?void 0:V.getAttribute)==null?void 0:R.call(V,"data-theme"));if(q)return q;if(u.storage===!1)return null;const G=Et();return G&&V&&u.sync!==!1&&V.setAttribute("data-theme",G),G},ne.toggleTheme=function(u,R={}){const V=D(u),q=V.length?V:js([ne.getTheme({sync:!1}),"light","dark"]),G=ne.getTheme({sync:!1}),ce=ps(R.fallback)||q[0]||"light",se=G?q.indexOf(G):-1,ye=se>=0?q[(se+1)%q.length]:ce;return ne.theme.themes=q.slice(),ne.setTheme(ye,R),ye};const Gn=Et();Gn&&ne.setTheme(Gn,{persist:!1})})(),(function(wt){var zs;wt.ui=wt.ui||{},wt.services=wt.services||{},wt.services.notify=wt.services.notify||{};const ms=Symbol("jss.ui.rodPathRaw"),as=Symbol("jss.ui.rodPathEnhanced"),Ps=Symbol("jss.ui.rodPathPatchedH"),cs=Symbol("jss.ui.rodPathWrappedUI"),ts=new WeakMap,Ts=new WeakMap,ne=new WeakMap,An=[],Rs=e=>{if(typeof e=="number")return Number.isInteger(e)&&e>=0;if(typeof e!="string"||e===""||e[0]==="-"||e.includes("."))return!1;const t=Number(e);return Number.isInteger(t)&&t>=0&&String(t)===e},ns=e=>{const t=typeof e;return t==="string"||t==="number"||t==="boolean"||t==="bigint"},Rn=e=>{if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null};let ys=!1;const Cl=()=>{ys||(ys=!0,queueMicrotask(()=>{ys=!1,An.length=0}))},qs=e=>{An.push(e),An.length>128&&An.splice(0,An.length-128),Cl()},Ys=()=>{if(!An.length)return null;const e=An.slice();return An.length=0,{items:e,index:0}},Js=(e,t)=>{if(!e)return null;const s=e.items[e.index];return!s||!Object.is(s.value,t)?null:(e.index+=1,s)},Jn=e=>e&&typeof e=="object"&&e[ms]?e[ms]:e,Ms=(e,t)=>{const s=ts.get(e);if(!s)return;let l=s.rawGet();for(const n of t){if(l==null)return;l=l[n]}return l},xl=(e,t,s)=>{const l=ts.get(e);if(!l)return;const n=Jn(s);if(!t.length){if(Object.is(l.rawGet(),n))return;l.rawSet(n);return}let i=l.rawGet();(!i||typeof i!="object")&&(i=Rs(t[0])?[]:{});let c=i;for(let a=0;a<t.length-1;a++){const v=t[a];let r=c[v];if(!r||typeof r!="object"){const z=t[a+1];r=Rs(z)?[]:{},c[v]=r}c=r}Object.is(c[t[t.length-1]],n)||(c[t[t.length-1]]=n,l.rawSet(i))},bs=(e,t)=>[()=>Ms(e,t),s=>xl(e,t,s)],Os=(e,t,s=[])=>{if(!t||typeof t!="object")return t;let l=Ts.get(e);l||(l=new WeakMap,Ts.set(e,l));const n=l.get(t);if(n)return n;const i=new Proxy(t,{get(c,a,v){if(a===ms)return c;const r=Reflect.get(c,a,v);if(typeof a=="symbol")return r;const z=s.concat(a);return r&&typeof r=="object"?Os(e,r,z):typeof r=="function"?r.bind(v):(ns(r)&&qs({rod:e,path:z,value:r}),r)},set(c,a,v,r){const z=Jn(v),d=Reflect.get(c,a,r);if(Object.is(d,z))return!0;const k=Reflect.set(c,a,z,r);if(k){const N=ts.get(e);N==null||N.rawSet(N.rawGet())}return k},deleteProperty(c,a){const v=Reflect.has(c,a),r=Reflect.deleteProperty(c,a);if(r&&v){const z=ts.get(e);z==null||z.rawSet(z.rawGet())}return r}});return l.set(t,i),i},Xs=e=>{if(!e||typeof e!="object"||e.type!=="rod"||e[as])return e;const t=Object.getOwnPropertyDescriptor(e,"value");if(!t||typeof t.get!="function"||typeof t.set!="function")return e;const s=()=>t.get.call(e),l=n=>t.set.call(e,Jn(n));return ts.set(e,{rawGet:s,rawSet:l}),Object.defineProperty(e,"value",{get(){const n=s();return!n||typeof n!="object"?n:Os(e,n,[])},set(n){l(n)},configurable:!0}),Object.defineProperty(e,as,{value:!0,configurable:!1}),e},vs=()=>{if(typeof window._.rod!="function"||window._.rod[as])return;const e=window._.rod,t=function(...l){return Xs(e(...l))};Object.defineProperty(t,as,{value:!0,configurable:!1}),window._.rod=t};wt.ui.withoutRodPathCapture=e=>{const t=An.length;try{return e()}finally{An.length=t}};const Fs=(e,t,s="")=>{if(Array.isArray(e)){let i=!1;const c=e.map(a=>{const v=Fs(a,t,"");return v!==a&&(i=!0),v});return i?c:e}if(ns(e)){const i=Js(t,e);return i?s==="model"?bs(i.rod,i.path):()=>Ms(i.rod,i.path):e}if(!Rn(e))return e;let l=!1;const n={};for(const i of Object.keys(e)){const c=Fs(e[i],t,i);n[i]=c,c!==e[i]&&(l=!0)}return l?n:e},ss=(e,t,s="")=>{if(Array.isArray(e)){let i=!1;const c=e.map(a=>{const v=ss(a,t,"");return v!==a&&(i=!0),v});return i?c:e}if(ns(e)){const i=Js(t,e);return i?s==="model"?bs(i.rod,i.path):()=>Ms(i.rod,i.path):e}if(!Rn(e))return e;let l=!1;const n={};for(const i of Object.keys(e)){const a=i==="model"||i==="children"?ss(e[i],t,i):e[i];n[i]=a,a!==e[i]&&(l=!0)}return l?n:e},us=e=>{if(typeof e!="function"||e[cs])return e;const t=ne.get(e);if(t)return t;const s=function(...n){const i=Ys();if(!i)return e.apply(this,n);let c=!1;const a=n.map(v=>{const r=ss(v,i,"");return r!==v&&(c=!0),r});return e.apply(this,c?a:n)};return Object.defineProperty(s,cs,{value:!0,configurable:!1}),ne.set(e,s),s},kl=()=>{const e=wt.ui;if(!(!e||e[cs])){Object.defineProperty(e,cs,{value:!0,configurable:!1});for(const t of Object.keys(e))typeof e[t]=="function"&&(e[t]=us(e[t]));wt.ui=new Proxy(e,{get(t,s,l){return Reflect.get(t,s,l)},set(t,s,l,n){const i=typeof l=="function"?us(l):l;return Reflect.set(t,s,i,n)}})}},Nl=()=>{if(!window._||window._[Ps])return;Object.defineProperty(window._,Ps,{value:!0,configurable:!1});const e=new Set(["rod","rodBind","rodFromSignal"]);for(const t of Object.keys(window._)){if(e.has(t))continue;const s=window._[t];typeof s=="function"&&(window._[t]=function(...n){const i=Ys();if(!i)return s.apply(this,n);let c=!1;const a=n.map(v=>{const r=Fs(v,i,"");return r!==v&&(c=!0),r});return s.apply(this,c?a:n)})}};vs(),((zs=JSswift.rod)==null?void 0:zs._all)instanceof Set&&JSswift.rod._all.forEach(e=>Xs(e)),Nl(),kl();const Qs={error:"danger",danger:"danger",warn:"warning",warning:"warning",success:"success",info:"info",primary:"primary",secondary:"secondary",light:"light",dark:"dark"},ql=new Set(Object.values(Qs)),Zs=new Set(["none","xxs","xs","sm","md","lg","xl","xxl","xxxl","full"]),Al=new Set(["none","sm","md","lg"]),Un={xxs:{font:"9px",pad:"2px 5px"},xs:{font:"10px",pad:"2px 6px"},sm:{font:"11px",pad:"2px 7px"},md:{font:"12px",pad:"2px 8px"},lg:{font:"13px",pad:"3px 10px"},xl:{font:"14px",pad:"4px 12px"},xxl:{font:"15px",pad:"5px 14px"},xxxl:{font:"16px",pad:"6px 16px"}},Fn=e=>{if(e.indexOf("-")>-1)return!0},sn=e=>{if(!e)return"";const t=String(e).toLowerCase();return Qs[t]||""},el=e=>{if(e==null)return null;const t=String(e).toLowerCase();return t==="full"?"xxxl":Zs.has(t)?t:null},ws=e=>{if(e===!0)return"sm";if(e==null||e===!1)return null;const t=String(e).toLowerCase();return Al.has(t)?t:null},ds=e=>e&&typeof e=="object"&&!e.nodeType&&!Array.isArray(e)&&!(e instanceof Function),_s=e=>e&&e.nodeType===1&&String(e.tagName||"").toLowerCase()==="li",Dn=e=>e==null||e===!1||e===""?[]:Array.isArray(e)?e:[e];JSswift.isUIPlainObject=ds,JSswift.isListItemNode=_s,JSswift.asNodeArray=Dn;const ls=[{key:"mobile",aliases:["mobile","mobil"],prefix:"jss-"},{key:"tablet",aliases:["tablet"],prefix:"jss-tablet-"},{key:"pc",aliases:["pc","desktop"],prefix:"jss-pc-"}],Ss=ls.flatMap(e=>e.aliases),Sn=(e,t)=>Object.prototype.hasOwnProperty.call(e||{},t),fs=(e={},t)=>{if(!t)return null;for(const s of t.aliases){if(!Sn(e,s))continue;const l=o(e[s]);if(ds(l))return l}return null},tl=(e={},t)=>{const s=Array.isArray(t)?t:[t];return ls.some(l=>{const n=fs(e,l);return!!n&&s.some(i=>Sn(n,i))})},nl=e=>String(e).trim().toLowerCase().replace(/\s+/g,"-"),sl=(e={},t=[])=>{const s=[];for(const l of ls){const n=fs(e,l);if(n)for(const i of t){const c=Array.isArray(i.prop)?i.prop:[i.prop];let a=!1,v,r="";for(const k of c)if(Sn(n,k)){v=o(n[k]),r=k,a=!0;break}if(!a||v==null||v===""||v===!1&&!i.allowFalse)continue;const z=typeof i.map=="function"?i.map(v,{propName:r,props:n,device:l,rule:i}):`${i.class}-${nl(v)}`,d=Array.isArray(z)?z:[z];for(const k of d)k&&s.push(String(k).startsWith("jss-")?k:`${l.prefix}${k}`)}}return s},Ll=(e={})=>ls.some(t=>!!fs(e,t)),ll=(e={},t=[])=>{for(const s of t){if(!Sn(e,s))continue;const l=o(e[s]);if(!(l==null||l===""))return l}},ol=(e,t={})=>{var s;return e==null||e===""||e===!1&&!t.allowFalse?"":typeof t.mapValue=="function"?t.mapValue(e,t):typeof e=="number"?t.number==="raw"?String(e):`${e}px`:t.token&&typeof e=="string"&&((s=JSswift.uiSizes)!=null&&s.includes(e))?`var(--jss-${t.token}-${e})`:String(e)},El=(e,t,s)=>{!e||s==null||s===""||(typeof e.setProperty=="function"?e.setProperty(t,s):e[t]=s)},Il=(e,t)=>e==="mobile"?`jss-rsp-${t}`:`jss-rsp-${e}-${t}`,Ds=(e,t)=>{var s;if(!(!e||!t)){if((s=e.classList)!=null&&s.add){e.classList.add(t);return}e.class=re([e.class,t])}},$s=(e,t={},s=[])=>{if(!e||!t)return e;const l=[];for(const c of ls){const a=fs(t,c);a&&l.push([c.key,a])}if(!l.length)return e;const n=e.style||{};let i=!1;for(const c of s){const a=Array.isArray(c.prop)?c.prop:[c.prop],v=(r,z)=>{const d=ll(z,a),k=ol(d,c);if(!k)return;const N=c.var||c.css,p=r==="mobile"?"--jss-rsp-":`--jss-rsp-${r}-`;El(n,`${p}${N}`,k),Ds(e,Il(r,N)),i=!0};v("mobile",t);for(const[r,z]of l)v(r,z)}return i&&(e.nodeType||(e.style=n),Ds(e,"jss-rsp")),e};JSswift.uiResponsiveDevices=ls,JSswift.uiResponsiveOmitProps=Ss,JSswift.uiResponsivePropsFor=fs,JSswift.uiResponsiveHasConfig=Ll,JSswift.uiResponsiveHasProp=tl,JSswift.uiResponsiveClasses=sl,JSswift.uiApplyResponsiveProps=$s;const os=JSswift.omit;JSswift.omit=(e,t=[])=>{const s=Array.isArray(t)?t.concat(Ss):Ss;return os(e,s)};const pn=(e={})=>{var t;const s=[],l={};if(s.push(pe(e.clickable,"jss-clickable"),pe(e.dense,"jss-dense"),pe(e.flat,"jss-flat"),pe(e.border,"jss-border"),pe(e.glossy,"jss-glossy"),pe(e.glow,"jss-glow"),pe(e.glass,"jss-glass"),pe(e.shadow,"jss-shadow"),pe(e.outline,"jss-outline"),pe(e.rounded,"jss-rounded"),pe(e.gradient,"jss-gradient"),pe(e.textGradient,"jss-text-gradient"),pe(e.lightShadow,"jss-light-shadow")),ht(e.color))s.push(()=>{const n=o(e.color),i=sn(n);return i?`jss-state-${i}`:""}),l.backgroundColor=()=>{const n=o(e.color);return sn(n)?"":n&&Fn(String(n))?`var(--jss-${n})`:n||""};else{const n=sn(e.color);n?s.push(`jss-state-${n}`):e.color&&Fn(e.color)?l.backgroundColor=`var(--jss-${e.color})`:e.color&&(l.backgroundColor=e.color)}if(ht(e.textColor)?l.color=()=>{const n=o(e.textColor);return n&&Fn(String(n))?`var(--jss-${n})`:n||""}:e.textColor&&Fn(e.textColor)?l.color=`var(--jss-${e.textColor})`:e.textColor&&(l.color=e.textColor),ht(e.size))s.push(()=>{var n;const i=o(e.size);return typeof i=="string"&&((n=JSswift.uiSizes)!=null&&n.includes(i))?`jss-size-${i}`:""});else{const n=e.size;typeof n=="string"&&((t=JSswift.uiSizes)!=null&&t.includes(n))&&s.push(`jss-size-${n}`)}if(ht(e.shadow))s.push(()=>{const n=o(e.shadow),i=ws(n);return i?`jss-shadow-${i}`:""}),l.boxShadow=()=>{const n=o(e.shadow);return ws(n)||n==null||n===!1?"":typeof n=="string"?n:""};else{const n=ws(e.shadow);n?s.push(`jss-shadow-${n}`):e.shadow&&typeof e.shadow=="string"&&(l.boxShadow=e.shadow)}s.length&&(e.class=re([e.class,...s])),Object.keys(l).length&&(e.style={...l,...e.style||{}})},il=JSswift.uiNormalizeArgs;JSswift.uiNormalizeArgs=function(e){const t=il(e),s=t.props||{};if(s&&Object.prototype.hasOwnProperty.call(s,"children")){const l=s.children;(!t.children||t.children.length===0)&&(t.children=Array.isArray(l)?l:[l]),delete s.children}return pn(s),t};const xe=window._;function Ln(e){if(!e)return null;if(!Array.isArray(e))return e;const t=[],s=e.slice();for(;s.length;){const l=s.shift();l&&(Array.isArray(l)?s.unshift(...l):t.push(l))}return t.length?t:null}const En={padding:"p",paddingTop:"p",paddingRight:"p",paddingBottom:"p",paddingLeft:"p",paddingInline:"p",paddingInlineStart:"p",paddingInlineEnd:"p",paddingBlock:"p",paddingBlockStart:"p",paddingBlockEnd:"p",margin:"m",marginTop:"m",marginRight:"m",marginBottom:"m",marginLeft:"m",marginInline:"m",marginInlineStart:"m",marginInlineEnd:"m",marginBlock:"m",marginBlockStart:"m",marginBlockEnd:"m",width:"w",minWidth:"w",maxWidth:"w",height:"h",minHeight:"h",maxHeight:"h"},zl=e=>e===!0?"wrap":e===!1?"nowrap":String(e),vn=e=>typeof e=="number"?`repeat(${Math.max(1,Math.round(e))}, minmax(0, 1fr))`:String(e),js=[{prop:"display",css:"display",var:"display"},{prop:"direction",css:"flex-direction",var:"flex-direction"},{prop:"wrap",css:"flex-wrap",var:"flex-wrap",allowFalse:!0,mapValue:zl},{prop:"align",css:"align-items",var:"align-items"},{prop:"justify",css:"justify-content",var:"justify-content"},{prop:"self",css:"align-self",var:"align-self"},{prop:"justifySelf",css:"justify-self",var:"justify-self"},{prop:"place",css:"place-items",var:"place-items"},{prop:"placeSelf",css:"place-self",var:"place-self"},{prop:["cols","columns"],css:"grid-template-columns",var:"grid-template-columns",mapValue:vn},{prop:"rows",css:"grid-template-rows",var:"grid-template-rows",mapValue:vn},{prop:"flow",css:"grid-auto-flow",var:"grid-auto-flow",mapValue:e=>String(e).trim().toLowerCase().replace("-"," ")},{prop:"autoRows",css:"grid-auto-rows",var:"grid-auto-rows"},{prop:["span","gridColumn"],css:"grid-column",var:"grid-column",number:"raw"},{prop:["row","rowSpan"],css:"grid-row",var:"grid-row",number:"raw"},{prop:"area",css:"grid-area",var:"grid-area"},{prop:"gap",css:"gap",var:"gap",token:"gap"},{prop:"rowGap",css:"row-gap",var:"row-gap",token:"gap"},{prop:["columnGap","colGap"],css:"column-gap",var:"column-gap",token:"gap"},{prop:"width",css:"width",var:"width",token:"w"},{prop:"minWidth",css:"min-width",var:"min-width",token:"min-w"},{prop:"maxWidth",css:"max-width",var:"max-width",token:"max-w"},{prop:"height",css:"height",var:"height",token:"h"},{prop:"minHeight",css:"min-height",var:"min-height",token:"min-h"},{prop:"maxHeight",css:"max-height",var:"max-height",token:"max-h"},{prop:"padding",css:"padding",var:"padding",token:"p"},{prop:"paddingLeft",css:"padding-left",var:"padding-left",token:"p"},{prop:"paddingRight",css:"padding-right",var:"padding-right",token:"p"},{prop:"paddingTop",css:"padding-top",var:"padding-top",token:"p"},{prop:"paddingBottom",css:"padding-bottom",var:"padding-bottom",token:"p"},{prop:"margin",css:"margin",var:"margin",token:"m"},{prop:"marginLeft",css:"margin-left",var:"margin-left",token:"m"},{prop:"marginRight",css:"margin-right",var:"margin-right",token:"m"},{prop:"marginTop",css:"margin-top",var:"margin-top",token:"m"},{prop:"marginBottom",css:"margin-bottom",var:"margin-bottom",token:"m"},{prop:"fontSize",css:"font-size",var:"font-size",token:"f"},{prop:"fontWeight",css:"font-weight",var:"font-weight",token:"fw",number:"raw"},{prop:"lineHeight",css:"line-height",var:"line-height",token:"lh",number:"raw"},{prop:"letterSpacing",css:"letter-spacing",var:"letter-spacing",token:"ls"},{prop:["borderRadius","radius"],css:"border-radius",var:"border-radius",token:"r"},{prop:"overflow",css:"overflow",var:"overflow"},{prop:"order",css:"order",var:"order",number:"raw"}],Cs=js.filter(e=>{const t=Array.isArray(e.prop)?e.prop:[e.prop];return t.some(s=>Object.prototype.hasOwnProperty.call(En,s))||t.includes("fontSize")||t.includes("fontWeight")||t.includes("lineHeight")||t.includes("letterSpacing")||t.includes("borderRadius")||t.includes("radius")});JSswift.uiResponsiveStyleRules=js,JSswift.uiResponsiveCommonStyleRules=Cs;const rl=e=>e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`),xs=(e,t,s,l)=>{t==null||t===!1||t===""||e.style.setProperty(rl(s),$e(t,l))};function Et(e,t){t.size&&(typeof t.size=="number"?e.style.setProperty("--jss-font-size",`${t.size}px`):JSswift.uiSizes.includes(t.size)&&e.style.setProperty("--jss-font-size",`var(--jss-font-size-${t.size})`)),Object.entries(En).forEach(([s,l])=>{tl(t,s)||xs(e,t[s],s,l)}),$s(e,t,Cs),t.gradient&&typeof t.gradient=="number"&&e.style.setProperty("--set-gradient-deg",`${t.gradient}deg`),t.radius&&(typeof t.radius=="number"?e.style.setProperty("--set-border-radius",`${t.radius}px`):JSswift.uiSizes.includes(t.radius)?e.style.setProperty("--set-border-radius",`var(--jss-r-${t.radius})`):e.style.setProperty("--set-border-radius",`${t.radius}`))}function Vs(e={},...t){const s=document.createElement("option");e&&typeof e=="object"&&(e.value!=null&&(s.value=String(e.value)),e.label!=null&&(s.label=String(e.label)),e.disabled!=null&&(s.disabled=!!e.disabled),e.selected!=null&&(s.selected=!!e.selected),e.class!=null&&(s.className=String(e.class)));const l=t.flat?t.flat(1/0):t;return l.length?l.forEach(n=>{n==null||n===!1||(n instanceof Node?s.appendChild(n):s.appendChild(document.createTextNode(String(n))))}):e&&e.text!=null&&(s.textContent=String(e.text)),s}JSswift.ui.getSlot=(e,t)=>e&&Object.prototype.hasOwnProperty.call(e,t)?e[t]:null,JSswift.ui.renderSlot=(e,t,s,l)=>{const n=JSswift.ui.getSlot(e,t),c=n!=null?typeof n=="function"?n(s||{}):n:l;return c==null?null:Ln(JSswift.ui.slot(c))};const D=(e,t,s,l)=>{const n=JSswift.ui.renderSlot(e,t,s,l);return n?Array.isArray(n)?n:[n]:[]},Gn=new Set;let u=!1;const R=new Set(["ctrl","alt","shift","meta"]),V={control:"ctrl",ctl:"ctrl",option:"alt",opt:"alt",command:"meta",cmd:"meta","\u2318":"meta","\u2303":"ctrl","\u2325":"alt","\u21E7":"shift",esc:"escape",return:"enter",plus:"+",spacebar:"space",up:"arrowup",down:"arrowdown",left:"arrowleft",right:"arrowright",del:"delete"},q={ctrl:"Ctrl",alt:"Alt",shift:"Shift",meta:"Meta",escape:"Esc",enter:"Enter",tab:"Tab",space:"Space",backspace:"Backspace",delete:"Del",arrowup:"Up",arrowdown:"Down",arrowleft:"Left",arrowright:"Right",pageup:"PgUp",pagedown:"PgDn"},G=()=>{if(typeof navigator=="undefined")return!1;const e=String(navigator.platform||navigator.userAgent||"");return/(mac|iphone|ipad|ipod)/i.test(e)},ce=e=>{if(e==null)return"";const t=String(e).trim().toLowerCase();return t?V[t]||t:""},se=e=>{if(e==null||e===!1)return null;const t=String(e).trim();if(!t)return null;const s=t.split("+").map(ce).filter(Boolean);if(!s.length)return null;const l={raw:t,key:"",ctrl:!1,alt:!1,shift:!1,meta:!1};return s.forEach(n=>{if(n==="mod"){G()?l.meta=!0:l.ctrl=!0;return}if(R.has(n)){l[n]=!0;return}l.key=n}),l.key?l:null},ye=e=>e==null||e===!1?[]:(Array.isArray(e)?e:[e]).map(s=>{var l,n,i;if(s==null||s===!1)return null;if(typeof s=="object"&&!Array.isArray(s)){const a=se((i=(n=(l=s.shortcode)!=null?l:s.shortcut)!=null?n:s.keys)!=null?i:s.key);return a?{...s,...a}:null}const c=se(s);return c?{...c}:null}).filter(Boolean),ke=(e={})=>{var t,s,l;return ye((l=(s=(t=e.shortcode)!=null?t:e.shortcut)!=null?s:e.hotkey)!=null?l:e.keys)},je=(e={})=>e.showShortcode===!0||e.showShortcut===!0,Ce=e=>{const t=ce(e);if(!t)return"";const s={...q};return G()&&(s.alt="Option",s.meta="Cmd"),s[t]?s[t]:t.length===1?t.toUpperCase():t.replace(/(^|[-_ ])(\w)/g,(l,n,i)=>`${n}${i.toUpperCase()}`)},Ae=e=>{if(!e)return"";const t=[];return e.ctrl&&t.push(Ce("ctrl")),e.alt&&t.push(Ce("alt")),e.shift&&t.push(Ce("shift")),e.meta&&t.push(Ce("meta")),t.push(Ce(e.key)),t.filter(Boolean).join("+")},Ee=e=>(Array.isArray(e)?e:[]).map(Ae).filter(Boolean).join(" / "),He=(e={},t={})=>{const s=ke(e);if(!je(e)||!s.length||typeof document=="undefined")return null;const l=document.createElement("span");return l.className=t.className||"jss-shortcode",l.setAttribute("aria-hidden","true"),l.textContent=Ee(s),l},it=e=>{const t=(e==null?void 0:e.nodeType)===1?e:e==null?void 0:e.parentElement;if(!t||typeof t.closest!="function")return!1;if(t.isContentEditable)return!0;const s=t.closest("input, textarea, select, [contenteditable], [contenteditable='true'], [contenteditable='plaintext-only']");return!(!s||"disabled"in s&&s.disabled)},jt=(e,t)=>!e||!t||!!e.ctrlKey!=!!t.ctrl||!!e.altKey!=!!t.alt||!!e.shiftKey!=!!t.shift||!!e.metaKey!=!!t.meta?!1:ce(e.key)===t.key,Qe=()=>{Gn.size||!u||typeof document=="undefined"||(document.removeEventListener("keydown",ut,!0),u=!1)};function ut(e){var t,s,l,n,i,c;if(!Gn.size||!e||e.defaultPrevented||e.isComposing)return;const a=it(e.target),v=Array.from(Gn);for(let r=v.length-1;r>=0;r-=1){const z=v[r],d=z==null?void 0:z.anchor;if(!d||!d.isConnected){Gn.delete(z);continue}if(((t=z.isEnabled)==null?void 0:t.call(z))===!1)continue;const k=z.specs.find(w=>{var $,B;const te=(B=($=w.allowInEditable)!=null?$:z.allowInEditable)!=null?B:!1;return a&&!te?!1:jt(e,w)});if(!k)continue;const N=(l=(s=k.preventDefault)!=null?s:z.preventDefault)!=null?l:!0,p=(i=(n=k.stopPropagation)!=null?n:z.stopPropagation)!=null?i:!0;if(N&&e.preventDefault(),p&&e.stopPropagation(),((c=z.action)==null?void 0:c.call(z,e,k,d))!==!1)break}Qe()}const Me=(e,t={},s={})=>{var l,n;const i=ke(t);if(!e||!i.length||typeof document=="undefined")return null;const c={anchor:e,specs:i,action:typeof s.action=="function"?s.action:()=>{var v;return(v=e.click)==null?void 0:v.call(e)},isEnabled:typeof s.isEnabled=="function"?s.isEnabled:null,allowInEditable:!!s.allowInEditable,preventDefault:(l=s.preventDefault)!=null?l:!0,stopPropagation:(n=s.stopPropagation)!=null?n:!0};Gn.add(c),u||(document.addEventListener("keydown",ut,!0),u=!0);const a=()=>{Gn.delete(c),Qe()};return JSswift._registerCleanup(e,a),a},ze=(e,t={})=>{var s;if(!e||typeof e.focus!="function")return!1;try{e.focus({preventScroll:(s=t.preventScroll)!=null?s:!0})}catch(l){e.focus()}if(t.selectText&&typeof e.select=="function")try{e.select()}catch(l){}return!0},$e=(e,t="size")=>typeof e=="number"?e+"px":JSswift.uiSizes.includes(e)?`var(--jss-${t}-${e})`:e,lt=(e,t=JSswift.uiSizes)=>s=>{const l=String(s).trim();return t!=null&&t.includes(l)?`${e}-${l}`:""},at=e=>t=>`${e}-${String(t).trim().toLowerCase().replace(/\s+/g,"-")}`,St=e=>{if(e===!0)return"wrap-wrap";if(e===!1)return"wrap-nowrap";const t=String(e).trim().toLowerCase();return t==="false"||t==="no"||t==="none"?"wrap-nowrap":t==="reverse"?"wrap-reverse":`wrap-${t}`},Lt=(e,t,s)=>e?t:s,Ot=e=>{const t=o(e);if(t==null||t==="")return"";if(t==="auto")return"col-auto";if(t===!0)return"col-24";const s=Number(t);if(Number.isFinite(s)&&s>0)return`col-${Math.max(1,Math.min(24,Math.round(s)))}`;if(typeof t=="string"){const l=t.trim();if(/^\d+$/.test(l))return`col-${Math.max(1,Math.min(24,Number(l)))}`}return""},Ct=e=>{const t=Number(e);return Number.isFinite(t)&&t>0?`grid-cols-${Math.max(1,Math.min(24,Math.round(t)))}`:""},nt=(e,t)=>{const s=Array.isArray(t)?t:[t];return JSswift.uiResponsiveDevices.some(l=>{const n=JSswift.uiResponsivePropsFor(e,l);return!!n&&s.some(i=>Object.prototype.hasOwnProperty.call(n,i))})},kt=e=>JSswift.uiResponsiveDevices.find(t=>t.key===e),Rt=[{prop:"gap",class:"gap",map:lt("gap")},{prop:"rowGap",class:"gap-y",map:lt("gap-y")},{prop:["columnGap","colGap"],class:"gap-x",map:lt("gap-x")},{prop:"direction",class:"dir",map:at("dir")},{prop:"wrap",class:"wrap",allowFalse:!0,map:St},{prop:"align",class:"align",map:at("align")},{prop:"justify",class:"justify",map:at("justify")},{prop:"width",class:"w",map:lt("w")},{prop:"minWidth",class:"min-w",map:lt("min-w")},{prop:"maxWidth",class:"max-w",map:lt("max-w")},{prop:"height",class:"h",map:lt("h")},{prop:"minHeight",class:"min-h",map:lt("min-h")},{prop:"maxHeight",class:"max-h",map:lt("max-h")},{prop:"padding",class:"p",map:lt("p")},{prop:"margin",class:"m",map:lt("m")}],Ve=Rt.filter(e=>{const t=Array.isArray(e.prop)?e.prop:[e.prop];return!t.includes("align")&&!t.includes("justify")}),st=[{prop:["col","span"],class:"col",map:Ot},{prop:"auto",class:"col",map:e=>e?"col-auto":""},{prop:"inline",class:"display",allowFalse:!0,map:e=>Lt(e,"display-inline-flex","display-flex")},{prop:"self",class:"self",map:at("self")},...Rt],Jt=[{prop:["cols","columns"],class:"grid-cols",map:Ct},{prop:"inline",class:"display",allowFalse:!0,map:e=>Lt(e,"display-inline-grid","display-grid")},{prop:"flow",class:"grid-flow",map:e=>`grid-flow-${String(e).trim().toLowerCase().replace(/\s+/g,"-")}`},...Rt],Vt=[{prop:"inline",class:"display",allowFalse:!0,map:e=>Lt(e,"display-inline-flex","display-flex")},{prop:"direction",class:"dir",map:at("dir")},{prop:"contentAlign",class:"align",map:at("align")},{prop:"contentJustify",class:"justify",map:at("justify")},{prop:"align",class:"self",map:at("self")},{prop:"justify",class:"justify-self",map:at("justify-self")},{prop:"place",class:"place-self",map:at("place-self")},...Ve],Pt=(JSswift.uiResponsiveStyleRules||[]).filter(e=>{const t=Array.isArray(e.prop)?e.prop:[e.prop];return!t.includes("span")&&!t.includes("gridColumn")});xe.Row=(...e)=>{var t,s,l,n,i;const{props:c,children:a}=JSswift.uiNormalizeArgs(e),v=c.slots||{},r=(m,b,g={})=>{const T=Array.isArray(m)?m:[m];for(const Y of T)if(JSswift.ui.getSlot(v,Y)!=null)return D(v,Y,g,b);return b==null?[]:D(null,"default",g,b)},z=m=>{var b;return m==null||m===!1||m===""?"":typeof m=="number"?`${m}px`:typeof m=="string"&&((b=JSswift.uiSizes)!=null&&b.includes(m))?`var(--jss-s-${m})`:String(m)},d=m=>{var b;return m==null||m===!1||m===""?"":typeof m=="number"?`${m}px`:typeof m=="string"&&((b=JSswift.uiSizes)!=null&&b.includes(m))?`var(--jss-w-${m})`:String(m)},k=JSswift.omit(c,["slots","start","left","startClass","body","center","bodyClass","centerClass","end","right","endClass","align","justify","wrap","gap","rowGap","columnGap","direction","reverse","inline","full","width","minWidth","maxWidth",...JSswift.uiResponsiveOmitProps]);k.class=re(["jss-row",JSswift.uiResponsiveClasses({mobile:c},Rt),JSswift.uiResponsiveClasses(c,Rt),c.class]);const N={...c.style||{}},p=xt([c.direction,c.reverse],()=>{const m=o(c.direction);return m!=null&&m!==""?String(m):o(c.reverse)?"row-reverse":""}),U=qe(c.align),w=qe(c.justify),$=qe(c.wrap,m=>typeof m=="boolean"?m?"wrap":"nowrap":String(m)),B=qe(c.gap,z),te=qe(c.rowGap,z),E=qe(c.columnGap,z),ve=qe(c.inline,m=>m?"inline-flex":"flex"),le=qe(c.width,d),ie=qe(c.minWidth,d),ge=qe(c.maxWidth,d),ue=qe(c.full,m=>m?"100%":"",""),fe=xt([c.inline,c.full,c.width],()=>{const m=!!o(c.inline),b=!!o(c.full),g=o(c.width)!=null&&o(c.width)!==!1&&o(c.width)!=="";return!m||b||g?"":"max-content"});p!=null&&!nt(c,"direction")&&(N.flexDirection=p),U!=null&&!nt(c,"align")&&(N.alignItems=U),w!=null&&!nt(c,"justify")&&(N.justifyContent=w),$!=null&&!nt(c,"wrap")&&(N.flexWrap=$),B!=null&&!nt(c,"gap")&&(N.gap=B),te!=null&&!nt(c,"rowGap")&&(N.rowGap=te),E!=null&&!nt(c,"columnGap")&&(N.columnGap=E),ve!=null&&(N.display=ve),fe!=null&&(N.width=fe),le!=null&&!nt(c,"width")&&(N.width=le),ie!=null&&!nt(c,"minWidth")&&(N.minWidth=ie),ge!=null&&!nt(c,"maxWidth")&&(N.maxWidth=ge),ue!=null&&(N.width=ue),Object.keys(N).length&&(k.style=N),JSswift.uiApplyResponsiveProps(k,c,JSswift.uiResponsiveStyleRules);const M={props:c},me=r(["start","left"],(t=c.start)!=null?t:c.left,M),be=r(["body","center","default"],(l=(s=c.body)!=null?s:c.center)!=null?l:a,M),de=r(["end","right"],(n=c.end)!=null?n:c.right,M);if(!(me.length||de.length||c.body!=null||c.center!=null||c.startClass||c.bodyClass||c.centerClass||c.endClass||JSswift.ui.getSlot(v,"start")!=null||JSswift.ui.getSlot(v,"left")!=null||JSswift.ui.getSlot(v,"body")!=null||JSswift.ui.getSlot(v,"center")!=null||JSswift.ui.getSlot(v,"end")!=null||JSswift.ui.getSlot(v,"right")!=null)){const m=D(v,"default",M,a),b=_.div(k,...m);return Et(b,c),b}const j={display:"flex",alignItems:"inherit",gap:"inherit",flexWrap:"inherit",minWidth:0},I=(i=c.bodyClass)!=null?i:c.centerClass,y=xt([c.direction,c.reverse],()=>(o(c.direction)||(o(c.reverse)?"row-reverse":"row"))==="row"?"auto":""),P=[me.length?_.div({class:re(["jss-row-start",c.startClass]),style:{...j}},...me):null,be.length?_.div({class:re(["jss-row-body",I]),style:{...j,flex:"1 1 auto"}},...be):null,de.length?_.div({class:re(["jss-row-end",c.endClass]),style:{...j,justifyContent:"flex-end",marginInlineStart:y}},...de):null].filter(Boolean),Q=_.div(k,...P);return Et(Q,c),Q};function yt(e){return Array.isArray(e)&&(e.length===2||e.length===3&&typeof e[2]=="function")&&typeof e[0]=="function"&&typeof e[1]=="function"}function rt(e){return!!e&&e.type==="rod"}function ht(e){return typeof e=="function"||rt(e)||yt(e)}function o(e){return typeof e=="function"?e():rt(e)?e.value:yt(e)?e[0]():e}function Kt(e){const t=Array.isArray(e)?[...e]:[e];for(;t.length;){const s=t.pop();if(ht(s))return!0;Array.isArray(s)&&t.push(...s)}return!1}function re(e){const t=Kt(e),s=()=>{const l=[],n=Array.isArray(e)?[...e]:[e];for(;n.length;){const i=n.shift();if(i==null||i===!1)continue;const c=o(i);if(!(c==null||c===!1||c==="")){if(Array.isArray(c)){n.unshift(...c);continue}l.push(c)}}return l.join(" ")};return t?s:s()}function Bt(e){const t=re(e);return typeof t=="function"?t():t}function pe(e,t,s=""){return ht(e)?()=>o(e)?t:s:e?t:s}function $n(e,t,s=""){return ht(e)?()=>{const l=o(e);return l==null||l===""?"":`${t}${l}${s}`}:e==null||e===""?"":`${t}${e}${s}`}function xt(e,t){return(Array.isArray(e)?e:[e]).some(ht)?()=>t():t()}function qe(e,t,s=""){return ht(e)?()=>{const l=o(e);return l==null||l===!1?s:t?t(l):l}:e==null||e===!1?null:t?t(e):e}JSswift.uiIsReactive=ht,JSswift.uiUnwrap=o,JSswift.uiClass=re,JSswift.uiClassStatic=Bt,JSswift.uiWhen=pe,JSswift.uiClassValue=$n,JSswift.uiComputed=xt,JSswift.uiStyleValue=qe,xe.Col=(...e)=>{var t,s,l,n,i,c;const{props:a,children:v}=JSswift.uiNormalizeArgs(e),r=a.slots||{},z=L=>Object.prototype.hasOwnProperty.call(a,L),d=(L,O,X={})=>{const we=Array.isArray(L)?L:[L];for(const Be of we)if(JSswift.ui.getSlot(r,Be)!=null)return D(r,Be,X,O);return O==null?[]:D(null,"default",X,O)},k=L=>{var O;return L==null||L===!1||L===""?"":typeof L=="number"?`${L}px`:typeof L=="string"&&((O=JSswift.uiSizes)!=null&&O.includes(L))?`var(--jss-s-${L})`:String(L)},N=L=>{var O;return L==null||L===!1||L===""?"":typeof L=="string"&&((O=JSswift.uiSizes)!=null&&O.includes(L))?$e(L,"size"):vt(L)},p=(L,O)=>{const X=o(L);if(X==null||X===!1||X==="")return"";if(X==="auto")return O==="jss-col-"?"jss-col-auto":"";if(X===!0)return`${O}24`;const we=Number(X);if(Number.isFinite(we)&&we>0)return`${O}${Math.max(1,Math.min(24,Math.round(we)))}`;if(typeof X=="string"){const Be=X.trim();if(!Be)return"";if(Be.startsWith(O))return Be;if(/^\d+$/.test(Be))return`${O}${Math.max(1,Math.min(24,Number(Be)))}`}return""},U=()=>{const L=o(a.flex);if(L!=null&&L!==!1&&L!=="")return String(L);if(o(a.fill))return"1 1 auto";const O=z("grow"),X=z("shrink"),we=z("basis");if(!O&&!X&&!we)return"";const Be=O?o(a.grow):0,Ue=X?o(a.shrink):1,H=we?N(o(a.basis)):"auto";return`${Be} ${Ue} ${H||"auto"}`},w=xt([a.auto,a.col,a.span],()=>{if(o(a.auto))return"jss-col-auto";const L=z("span")?a.span:a.col;return p(L,"jss-col-")||"jss-col"}),$=JSswift.omit(a,["slots","col","span","sm","md","lg","auto","size","width","minWidth","maxWidth","height","minHeight","maxHeight","gap","rowGap","columnGap","align","justify","inline","center","stack","flex","fill","grow","shrink","basis","self","order","scroll","start","top","header","before","startClass","topClass","headerClass","body","content","bodyClass","contentClass","end","bottom","footer","after","endClass","bottomClass","footerClass",...JSswift.uiResponsiveOmitProps]),B={...a.style||{}};!nt(a,"minWidth")&&B.minWidth==null&&(B.minWidth=0);const te=qe(a.gap,k),E=qe(a.rowGap,k),ve=qe(a.columnGap,k),le=qe(a.align),ie=qe(a.justify),ge=z("width")?a.width:a.size,ue=qe(ge,N),fe=qe(a.minWidth,N),M=qe(a.maxWidth,N),me=qe(a.height,N),be=qe(a.minHeight,N),de=qe(a.maxHeight,N),Z=qe(a.self),j=qe(a.order,L=>String(L)),I=qe(a.scroll,L=>L?"auto":"",""),y=xt([a.flex,a.fill,a.grow,a.shrink,a.basis],U),P=xt([a.center,a.align,a.justify],()=>!!o(a.center)&&(o(a.align)==null||o(a.align)==="")&&(o(a.justify)==null||o(a.justify)===""));y!=null&&y!==""&&(B.flex=y),Z!=null&&!nt(a,"self")&&(B.alignSelf=Z),j!=null&&(B.order=j),I!=null&&I!==""&&(B.overflow=I),ue!=null&&ue!==""&&!nt(a,["width","size"])&&(B.width=ue,!z("flex")&&!z("fill")&&!z("grow")&&!z("shrink")&&!z("basis")&&(B.flex="0 0 auto")),fe!=null&&!nt(a,"minWidth")&&(B.minWidth=fe),M!=null&&!nt(a,"maxWidth")&&(B.maxWidth=M),me!=null&&!nt(a,"height")&&(B.height=me),be!=null&&!nt(a,"minHeight")&&(B.minHeight=be),de!=null&&!nt(a,"maxHeight")&&(B.maxHeight=de),Object.keys(B).length&&($.style=B);const Q={props:a},m=d(["start","top","header","before"],(l=(s=(t=a.start)!=null?t:a.top)!=null?s:a.header)!=null?l:a.before,Q),b=z("body")?a.body:z("content")?a.content:v,g=d(["body","content","default"],b,Q),T=d(["end","bottom","footer","after"],(c=(i=(n=a.end)!=null?n:a.bottom)!=null?i:a.footer)!=null?c:a.after,Q),Y=m.length||T.length||z("start")||z("top")||z("header")||z("before")||z("body")||z("content")||z("end")||z("bottom")||z("footer")||z("after")||a.startClass||a.bodyClass||a.contentClass||a.endClass||a.topClass||a.headerClass||a.bottomClass||a.footerClass||JSswift.ui.getSlot(r,"start")!=null||JSswift.ui.getSlot(r,"top")!=null||JSswift.ui.getSlot(r,"header")!=null||JSswift.ui.getSlot(r,"before")!=null||JSswift.ui.getSlot(r,"body")!=null||JSswift.ui.getSlot(r,"content")!=null||JSswift.ui.getSlot(r,"end")!=null||JSswift.ui.getSlot(r,"bottom")!=null||JSswift.ui.getSlot(r,"footer")!=null||JSswift.ui.getSlot(r,"after")!=null,K=xt([a.stack,a.gap,a.rowGap,a.columnGap,a.align,a.justify,a.center],()=>o(a.stack)||Y||[o(a.gap),o(a.rowGap),o(a.columnGap),o(a.align),o(a.justify)].some(O=>O!=null&&O!==!1&&O!=="")?!0:!!o(a.center));if($.class=re(["jss-col",w,xt(a.sm,()=>p(a.sm,"jss-sm-col-")),xt(a.md,()=>p(a.md,"jss-md-col-")),xt(a.lg,()=>p(a.lg,"jss-lg-col-")),JSswift.uiResponsiveClasses({mobile:a},st),JSswift.uiResponsiveClasses(a,st),pe(K,"jss-col-flex"),pe(a.inline,"jss-col-inline"),a.class]),te!=null&&!nt(a,"gap")&&(B.gap=te),E!=null&&!nt(a,"rowGap")&&(B.rowGap=E),ve!=null&&!nt(a,"columnGap")&&(B.columnGap=ve),le!=null&&!nt(a,"align")?B.alignItems=le:P!=null&&P!==""&&(B.alignItems=P?"center":""),ie!=null&&!nt(a,"justify")?B.justifyContent=ie:P!=null&&P!==""&&(B.justifyContent=P?"center":""),Object.keys(B).length&&($.style=B),JSswift.uiApplyResponsiveProps($,a,JSswift.uiResponsiveStyleRules),!Y){const L=_.div($,...D(r,"default",Q,v));return Et(L,a),L}const _e={display:"flex",flexDirection:"column",gap:"inherit",minWidth:0},J=[m.length?_.div({class:re(["jss-col-start",a.startClass,a.topClass,a.headerClass]),style:{..._e}},...m):null,g.length?_.div({class:re(["jss-col-body",a.bodyClass,a.contentClass]),style:{..._e,flex:"1 1 auto"}},...g):null,T.length?_.div({class:re(["jss-col-end",a.endClass,a.bottomClass,a.footerClass]),style:{..._e}},...T):null].filter(Boolean),A=_.div($,...J);return Et(A,a),A},xe.Spacer=(...e)=>{const{props:t,children:s}=JSswift.uiNormalizeArgs(e),l=t.slots||{},n=JSswift.omit(t,["slots"]);n.class=re(["jss-spacer",t.class]);const i=D(l,"default",{},s);return _.div(n,...i)},xe.Container=(...e)=>{var t,s,l,n;const{props:i,children:c}=JSswift.uiNormalizeArgs(e),a=i.slots||{},v={...i},r=b=>Object.prototype.hasOwnProperty.call(i,b),z={xxs:"360px",xs:"480px",sm:"640px",md:"820px",lg:"1100px",xl:"1280px",xxl:"1440px",narrow:"760px",prose:"760px",wide:"1360px"},d=b=>{if(b==null||b===!1||b==="")return"";if(typeof b=="number")return`${b}px`;const g=String(b).trim().toLowerCase();return g?g==="full"||g==="fluid"?"100%":z[g]||String(b):""},k=b=>{var g;return b==null||b===!1||b===""?"":typeof b=="number"?`${b}px`:typeof b=="string"&&((g=JSswift.uiSizes)!=null&&g.includes(b))?`var(--jss-s-${b})`:String(b)},N=b=>{if(b==null||b===!1||b==="")return"";if(typeof b=="number"&&Number.isFinite(b))return`repeat(${Math.max(1,Math.floor(b))}, minmax(0, 1fr))`;const g=String(b).trim();return g?/^\d+$/.test(g)?`repeat(${Math.max(1,Number(g))}, minmax(0, 1fr))`:g:""},p=b=>b==null||b===""?"":b===!0?"wrap":b===!1?"nowrap":String(b),U={props:i},w=(b,g)=>{if(!(g==null||g===!1)){if(Array.isArray(g)){g.forEach(T=>w(b,T));return}if(g!=null&&g.nodeType){b.appendChild(g);return}b.appendChild(document.createTextNode(String(g)))}},$=(b,g)=>{const T=JSswift.ui.getSlot(a,b);if(T!=null)return D(a,b,U,null);if(typeof g=="function"){const Y=_.div({class:`jss-container-slot-${b}`});return JSswift.reactive.effect(()=>{const K=Ln(JSswift.ui.slot(g(U)));Y.replaceChildren(),Array.isArray(K)?K.forEach(_e=>w(Y,_e)):w(Y,K)},`UI.Container:${b}`),[Y]}return D(a,b,U,g)},B=r("content")?i.content:c!=null&&c.length?c:null,te=$("before",(t=i.before)!=null?t:i.top),E=$("header",i.header),ve=[...$("left",i.left),...$("start",i.start)],le=$("body",r("body")?i.body:null),ie=(()=>{const b=$("content",r("content")?i.content:null);return b.length?b:$("default",B)})(),ge=[...$("right",i.right),...$("end",i.end)],ue=$("footer",i.footer),fe=$("after",(s=i.after)!=null?s:i.bottom),M=te.length||E.length||ve.length||ge.length||ue.length||fe.length||JSswift.ui.getSlot(a,"before")!=null||JSswift.ui.getSlot(a,"header")!=null||JSswift.ui.getSlot(a,"left")!=null||JSswift.ui.getSlot(a,"start")!=null||JSswift.ui.getSlot(a,"right")!=null||JSswift.ui.getSlot(a,"end")!=null||JSswift.ui.getSlot(a,"footer")!=null||JSswift.ui.getSlot(a,"after")!=null,me=!!M||le.length>0&&(JSswift.ui.getSlot(a,"body")!=null||M),be=()=>{var b;const g=String(o((b=i.layout)!=null?b:i.display)||"").trim().toLowerCase();return["flex","grid","stack"].includes(g)?g:["inline","inline-flex","inlineflex"].includes(g)||o(i.inline)?"inline":o(i.grid)||o(i.cols)!=null?"grid":g==="block"?"block":o(i.direction)!=null||o(i.wrap)!=null||o(i.align)!=null||o(i.justify)!=null||o(i.gap)!=null||ve.length||ge.length?"flex":"block"},de=xt([i.layout,i.display,i.inline,i.grid,i.cols,i.direction,i.wrap,i.align,i.justify,i.gap],()=>{const b=be();return b==="block"?"":`is-${b}`}),Z={...v.style||{}},j=(b,g)=>{g!=null&&(Z[b]=g)};j("maxWidth",xt([i.maxWidth,i.fluid],()=>o(i.fluid)?"none":d(o(i.maxWidth))||"")),j("width",qe(i.width,d)),j("minWidth",qe(i.minWidth,d)),j("--jss-container-padding",qe(i.padding,k)),j("--jss-container-padding-x",qe((l=i.paddingX)!=null?l:i.gutter,k)),j("--jss-container-padding-y",qe(i.paddingY,k)),j("--jss-container-gap",qe(i.gap,k)),j("--jss-container-section-gap",qe((n=i.sectionGap)!=null?n:i.gap,k)),j("--jss-container-cols",qe(i.cols,N)),j("--jss-container-align",qe(i.align,b=>String(b))),j("--jss-container-justify",qe(i.justify,b=>String(b))),j("--jss-container-direction",qe(i.direction,b=>String(b))),j("--jss-container-wrap",qe(i.wrap,p));const I=JSswift.omit(v,["after","afterClass","align","as","before","beforeClass","body","bodyClass","bottom","cols","content","contentClass","direction","display","end","endClass","fluid","footer","footerClass","gap","grid","gutter","header","headerClass","inline","justify","layout","left","mainClass","maxWidth","minWidth","padding","paddingX","paddingY","right","sectionGap","slots","start","startClass","tag","top","width","wrap"]);I.class=re(["jss-container",pe(i.fluid,"is-fluid"),pe(me,"has-structure"),me?"":de,v.class]),I.style=Z,JSswift.uiApplyResponsiveProps(I,i,JSswift.uiResponsiveStyleRules);const y=(b,g,T)=>g.length?_.div({class:re(["jss-container-section",`jss-container-${b}`,T])},...g):null,P=le.length?_.div({class:re(["jss-container-body",me?de:"",i.bodyClass])},...le):ve.length||ie.length||ge.length?_.div({class:re(["jss-container-body",me?de:"",i.bodyClass])},y("start",ve,i.startClass),ie.length?_.div({class:re(["jss-container-main",i.mainClass,i.contentClass])},...ie):null,y("end",ge,i.endClass)):null,Q=(()=>{var b;const g=String(o((b=i.tag)!=null?b:i.as)||"div").toLowerCase();return typeof _[g]=="function"?_[g]:_.div})(),m=me?Q(I,y("before",te,i.beforeClass),y("header",E,i.headerClass),P,y("footer",ue,i.footerClass),y("after",fe,i.afterClass)):Q(I,...le.length?le:ie);return Et(m,i),m},xe.Card=(...e)=>{var t,s;const{props:l,children:n}=JSswift.uiNormalizeArgs(e),i=l.slots||{},c={...l};pn(c);const a=(A,L)=>{var O;return!!(A&&A.nodeType===1&&((O=A.classList)!=null&&O.contains(`jss-card-${L}`)))},r=(A=>A==null?null:typeof A=="string"?xe.Icon({name:A,size:l.iconSize||l.size||"lg"}):JSswift.ui.slot(A,{as:"icon"}))(l.icon),z=l.image?_.img({src:l.image,alt:l.imageAlt||"",class:re(["jss-card-cover-media",l.imageClass]),style:l.imageStyle}):l.cover,d={dense:!!o(l.dense),flat:!!o(l.flat),clickable:!!o(l.clickable),to:o(l.to)||null},k=D(i,"default",d,n!=null&&n.length?n:[]),N={identifier:[],cover:[],media:[],header:[],body:[],footer:[],actions:[]},p=[];k.forEach(A=>{a(A,"identifier")?N.identifier.push(A):a(A,"cover")?N.cover.push(A):a(A,"media")?N.media.push(A):a(A,"header")?N.header.push(A):a(A,"body")?N.body.push(A):a(A,"footer")?N.footer.push(A):a(A,"actions")?N.actions.push(A):p.push(A)});const U=D(i,"identifier",d,l.identifier),w=D(i,"cover",d,z),$=D(i,"media",d,l.media),B=D(i,"eyebrow",d,(t=l.eyebrow)!=null?t:l.kicker),te=D(i,"title",d,l.title),E=D(i,"subtitle",d,l.subtitle),ve=D(i,"header",d,l.header),le=D(i,"icon",d,r),ie=D(i,"aside",d,(s=l.aside)!=null?s:l.headerAside),ge=D(i,"body",d,l.body),ue=D(i,"footer",d,l.footer),fe=D(i,"actions",d,l.actions),M=U.length?_.div({class:re(["jss-card-identifier",l.identifierClass])},...U):null,me=w.length?_.div({class:re(["jss-card-cover",l.coverClass])},...w):null,be=$.length?_.div({class:re(["jss-card-media",l.mediaClass])},...$):null,Z=le.length||B.length||te.length||E.length||ve.length||ie.length?_.div({class:re(["jss-card-header",l.headerClass])},_.div({class:"jss-card-head"},le.length?_.div({class:"jss-card-icon"},...le):null,_.div({class:"jss-card-head-main"},B.length?_.div({class:re(["jss-card-eyebrow",l.eyebrowClass])},...B):null,te.length?_.div({class:re(["jss-card-title",l.titleClass])},...te):null,E.length?_.div({class:re(["jss-card-subtitle",l.subtitleClass])},...E):null,ve.length?_.div({class:re(["jss-card-header-content",l.headerContentClass])},...ve):null),ie.length?_.div({class:re(["jss-card-aside",l.asideClass])},...ie):null)):null,j=[...ge,...p],I=j.length?_.div({class:re(["jss-card-body",l.bodyClass])},...j):null,y=[...fe,...N.actions],P=ue.length||y.length?_.div({class:re(["jss-card-footer",l.footerClass])},...ue,y.length?_.div({class:"jss-card-actions"},...y):null):null,Q=xt([l.clickable,l.to],()=>o(l.clickable)||o(l.to)?"jss-card-clickable":""),m=U.length||N.identifier.length,b=w.length||N.cover.length||$.length||N.media.length,g=JSswift.omit(c,["actions","aside","asideClass","body","bodyClass","clickable","cover","coverClass","coverHeight","dense","eyebrow","eyebrowClass","flat","footer","footerClass","header","headerAside","headerClass","headerContentClass","icon","iconSize","identifier","identifierClass","image","imageAlt","imageClass","imageStyle","kicker","media","mediaClass","slots","subtitle","subtitleClass","title","titleClass","to","display","direction","wrap","align","justify","gap","rowGap","columnGap","cols","columns"]);g.class=re(["jss-panel","jss-card","jss-clear-set","jss-singularity",pe(l.flat,"jss-card-flat"),pe(l.dense,"jss-card-dense"),pe(m,"jss-card-has-identifier"),pe(b,"jss-card-has-top-visual"),Q,c.class]),g.style={...c.style||{}},l.coverHeight!=null&&(g.style["--jss-card-cover-height"]=vt(o(l.coverHeight))),JSswift.uiApplyResponsiveProps(g,l,JSswift.uiResponsiveStyleRules);const T=l.onClick,Y=l.onKeydown,K=A=>{var L;if(T==null||T(A),A.defaultPrevented)return;const O=o(l.to);O&&((L=JSswift.router)!=null&&L.navigate)&&(A.preventDefault(),JSswift.router.navigate(O))},_e=A=>{Y==null||Y(A),!A.defaultPrevented&&(A.key==="Enter"||A.key===" ")&&(A.preventDefault(),K(A))};(o(l.clickable)||o(l.to))&&(g.onClick=K,g.onKeydown=_e,g.tabIndex==null&&(g.tabIndex=0),g.role==null&&(g.role="button"));const J=_.div(g,M,...N.identifier,me,...N.cover,be,...N.media,Z,...N.header,I,...N.body,P,...N.footer);return Et(J,l),J},xe.Btn=(...e)=>{var t;const{props:s,children:l}=JSswift.uiNormalizeArgs(e),n=s.slots||{},i=xt([s.color,s.state],()=>{const M=o(s.color)||o(s.state)||"";return["primary","secondary","warning","danger","success","info","light","dark"].includes(M)?M:o(s.state)||""}),c=re(["jss-clear-set","jss-btn","jss-singularity","jss-clickable",i,pe(s.outline,"outline"),s.class]),a=JSswift.omit(s,["icon","iconRight","label","loading","loadingText","disabled","outline","iconAlign","slots","shortcode","shortcut","hotkey","showShortcode","showShortcut"]);a.class=c;const v=()=>!!o(s.loading),r=()=>!!o(s.disabled)||v(),z=s.icon!=null?typeof s.icon=="string"?xe.Icon({name:s.icon}):s.icon:null,d=s.iconRight!=null?typeof s.iconRight=="string"?xe.Icon({name:s.iconRight}):s.iconRight:null,k=JSswift.ui.renderSlot(n,"icon",{},z),N=JSswift.ui.renderSlot(n,"iconRight",{},d),p=JSswift.ui.renderSlot(n,"label",{},s.label),U=D(n,"default",{},l),w=[],$=M=>{M&&(Array.isArray(M)?w.push(...M):w.push(M))},B=s.iconAlign;(B==="after"||B==="right")&&!d?($(p),U.length&&w.push(...U),$(k)):($(k),$(p),U.length&&w.push(...U)),$(N),$(He(s,{className:"jss-shortcode jss-btn-shortcode"})),w.length===0&&w.push(_.span("Button"));const E=_.span({class:"jss-btn-loading",hidden:!0}),ve=_.span({class:"jss-btn-content"},...w);let le=!1;const ie=()=>{const M=xe.Spinner?xe.Spinner({size:s.loadingSize||s.spinnerSize||16,thickness:s.loadingThickness||2,color:s.loadingColor||"currentColor",label:s.loadingText||null,"aria-label":s.loadingText?null:"Loading"}):_.span({class:"jss-muted",style:{marginRight:"8px"}},s.loadingText||"Loading");return D(null,"default",{},JSswift.ui.renderSlot(n,"loading",{},M))},ge=M=>{var me;if((me=s.onPointerDown)==null||me.call(s,M),r()||!(M!=null&&M.currentTarget))return;const be=M.currentTarget,de=be.getBoundingClientRect(),Z=typeof M.clientX=="number"?M.clientX-de.left:de.width/2,j=typeof M.clientY=="number"?M.clientY-de.top:de.height/2;be.style.setProperty("--jss-burst-x",`${Z}px`),be.style.setProperty("--jss-burst-y",`${j}px`),be.classList.remove("jss-btn-burst"),be.offsetWidth,be.classList.add("jss-btn-burst")},ue=_.button({...a,disabled:r(),onClick:M=>{var me,be;return r()?((me=M==null?void 0:M.preventDefault)==null||me.call(M),!1):(be=s.onClick)==null?void 0:be.call(s,M)},onPointerDown:ge,"aria-disabled":r()?"true":null,"aria-busy":v()?"true":null},E,ve),fe=JSswift.reactive.effect(()=>{const M=v(),me=r();ue.disabled=me,ue.classList.toggle("is-loading",M),ue.setAttribute("aria-disabled",me?"true":"false"),M?ue.setAttribute("aria-busy","true"):ue.removeAttribute("aria-busy"),E.hidden=!M,M!==le&&(E.replaceChildren(...M?ie():[]),le=M)},"UI.Btn:state");return(t=JSswift._registerCleanup)==null||t.call(JSswift,ue,fe),Et(ue,s),Me(ue,s,{isEnabled:()=>!r(),action:()=>{if(r())return!1;ue.click()}}),ue},xe.Button=xe.Btn,JSswift.ui.Btn=xe.Btn,JSswift.ui.Button=xe.Button;let on=0;xe.FormField=(e={})=>{var t,s,l,n,i,c,a;pn(e);const v=e.slots||{},r=xt([e.color,e.state],()=>{const I=o(e.color)||o(e.state)||"";return["primary","secondary","warning","danger","success","info","light","dark"].includes(I)?I:o(e.state)||""}),z=_.div({class:re(["jss-clear-field-set","jss-field","jss-singularity-field",r,pe(e.fill,"jss-field-fill"),pe(e.outline,"outline"),e.wrapClass,e.class])}),d=D(v,"topLabel",{},e.topLabel);d.length&&z.appendChild(_.div({class:"jss-field-label"},...d));const k=e.multi||e.multiple,N=typeof e.control=="function"?e.control():e.control,p=()=>{if(typeof e.hasValue=="function")return!!e.hasValue();if(e.hasValue!=null)return!!o(e.hasValue);const I=e.getValue?e.getValue():null;return!(I==null||I==="")},U=()=>JSswift.reactive.untracked(p),w=()=>{var I,y;e.disabled||e.readonly||((I=e.onClear)==null||I.call(e),(y=e.onFocus)==null||y.call(e))},$=JSswift.ui.renderSlot(v,"control",{control:N,clear:w,disabled:!!e.disabled,readonly:!!e.readonly,hasValue:U()},null);let B=null,te=null;if($)B=Array.isArray($)?_.div({class:"jss-control"},...$):$;else{B=_.div({class:"jss-control"});const I=_.div({class:"jss-addon jss-addon-left"}),y=e.icon!=null?typeof e.icon=="string"?xe.Icon({name:e.icon}):e.icon:null,P=JSswift.ui.renderSlot(v,"icon",{},y),Q=JSswift.ui.renderSlot(v,"prefix",{},e.prefix);D(null,"default",{},P).forEach(L=>I.appendChild(L)),D(null,"default",{},Q).forEach(L=>I.appendChild(L)),I.childNodes.length&&B.appendChild(I);const m=_.div({class:"jss-mid"+(I.childNodes.length>0?" jss-with-left":""),style:{position:"relative",flex:"1",minWidth:"0"}});N&&m.appendChild(N);const b=D(v,"label",{},e.label);if(b.length){const L=_.div({class:re(["jss-float-label",pe(k,"jss-multiselect")])},...b);m.appendChild(L)}B.appendChild(m);const g=e.clearable?_.div({class:"jss-clear",title:"Clear",onClick:w},xe.Icon({name:"close"})):null,T=JSswift.ui.renderSlot(v,"clear",{disabled:!!e.disabled,readonly:!!e.readonly,hasValue:U()},g);T&&(T.onclick=L=>{L.stopPropagation(),w()},D(null,"default",{},T).forEach(L=>B.appendChild(L))),te=g,te&&((t=e.clearable)!=null&&t.action)&&e.clearable.action(L=>L?te.classList.remove("jss-d-none"):te.classList.add("jss-d-none"));const Y=_.div({class:"jss-addon jss-addon-right"}),K=e.iconRight!=null?typeof e.iconRight=="string"?xe.Icon({name:e.iconRight}):e.iconRight:null,_e=JSswift.ui.renderSlot(v,"iconRight",{},K),J=JSswift.ui.renderSlot(v,"suffix",{},e.suffix),A=JSswift.ui.renderSlot(v,"shortcode",{props:e},He(e,{className:"jss-shortcode jss-field-shortcode"}));D(null,"default",{},J).forEach(L=>Y.appendChild(L)),D(null,"default",{},_e).forEach(L=>Y.appendChild(L)),D(null,"default",{},A).forEach(L=>Y.appendChild(L)),Y.childNodes.length&&(B.appendChild(Y),m.classList.add("jss-with-right"))}const E=I=>I&&(I&&typeof I.action=="function"?I.value:Array.isArray(I)&&typeof I[0]=="function"?I[0]():typeof I=="function"?I():I),ve=I=>I==null||I===!1||I===""?!1:Array.isArray(I)?I.length>0:!0;let le=null;const ie=`jsswift-field-message-${++on}`,ge=()=>{if(!(N!=null&&N.setAttribute))return;const I=[o(e.ariaDescribedBy),le==null?void 0:le.id].filter(Boolean).join(" ").trim();I?N.setAttribute("aria-describedby",[...new Set(I.split(/\s+/))].join(" ")):N.removeAttribute("aria-describedby")};z._syncDescription=ge;const ue=()=>{const I=[{key:"error",value:E(e.error),slot:"errorMessage",className:"jss-error"},{key:"warning",value:E(e.warning),slot:"warning",className:"jss-warning"},{key:"success",value:E(e.success),slot:"success",className:"jss-success"},{key:"note",value:E(e.note),slot:"note",className:"jss-note"},{key:"hint",value:E(e.hint),slot:"hint",className:"jss-hint"}];let y=null;for(const g of I)if(ve(g.value)){y=g;break}const P={error:I[0].value,warning:I[1].value,success:I[2].value,note:I[3].value,hint:I[4].value,props:e},Q=y?D(v,y.slot,P,y.value):[],m=Q.length?_.div({id:ie,class:y==null?void 0:y.className},...Q):null;["error","warning","success","note"].forEach(g=>{var T;return(T=B==null?void 0:B.classList)==null?void 0:T.toggle(g,(y==null?void 0:y.key)===g)}),le?m?le.replaceWith(m):le.remove():m&&z.appendChild(m),le=m,ge()},fe=()=>{var I;const y=p();(I=B==null?void 0:B.classList)==null||I.toggle("has-value",y),te&&(te.style.display=y?"":"none")};JSswift.reactive.untracked(fe),(s=B==null?void 0:B.classList)==null||s.toggle("disabled",!!e.disabled),z.appendChild(B);const M=JSswift.ui.getSlot(v,"errorMessage"),me=JSswift.ui.getSlot(v,"warning"),be=JSswift.ui.getSlot(v,"success"),de=JSswift.ui.getSlot(v,"note"),Z=JSswift.ui.getSlot(v,"hint");if(!!((l=e.error)!=null&&l.action||(n=e.warning)!=null&&n.action||(i=e.success)!=null&&i.action||(c=e.note)!=null&&c.action||(a=e.hint)!=null&&a.action)||Array.isArray(e.error)&&typeof e.error[0]=="function"||Array.isArray(e.warning)&&typeof e.warning[0]=="function"||Array.isArray(e.success)&&typeof e.success[0]=="function"||Array.isArray(e.note)&&typeof e.note[0]=="function"||Array.isArray(e.hint)&&typeof e.hint[0]=="function"||typeof e.error=="function"||typeof e.warning=="function"||typeof e.success=="function"||typeof e.note=="function"||typeof e.hint=="function"||typeof M=="function"||typeof me=="function"||typeof be=="function"||typeof de=="function"||typeof Z=="function"){const I=JSswift.reactive.effect(()=>{ue()},"UI.FormField:message");JSswift._registerCleanup(z,I)}else ue();return z._refresh=fe,z._control=B,z._el=N,z},xe.InputRaw=(e={})=>{var t;const s=_.input({class:re(["jss-input-raw",e.class]),type:e.type||"text",name:e.name,placeholder:e.placeholder,autocomplete:e.autocomplete,value:e.value});let l=!1;const n=new Set,i=(p,U)=>{if(l)return;const w=setTimeout(()=>{n.delete(w),l||p()},U);n.add(w)};let c=(t=s.value)!=null?t:"";const a=()=>{var p;const U=(p=s.value)!=null?p:"";U!==c&&(c=U,s.dispatchEvent(new Event("input",{bubbles:!0})),s.dispatchEvent(new Event("change",{bubbles:!0})))};let v=null,r=!1;const z=()=>{if(l||r)return;r=!0;let p=0;const U=()=>{if(a(),p+=1,p>=10){r=!1;return}i(U,120)};i(U,40)},d=()=>{l||v||(v=setInterval(()=>{if(document.activeElement!==s){clearInterval(v),v=null;return}a()},250))},k=()=>{v&&(clearInterval(v),v=null)};s.addEventListener("input",()=>{var p;c=(p=s.value)!=null?p:""}),s.addEventListener("change",()=>{var p;c=(p=s.value)!=null?p:""}),s.addEventListener("animationstart",p=>{p.animationName==="jss-autofill"&&(a(),d(),z())}),s.addEventListener("focus",()=>{d(),z(),i(a,50)}),s.addEventListener("blur",()=>{k(),i(a,0)}),i(a,0),z(),JSswift._registerCleanup(s,()=>{l=!0,k(),n.forEach(clearTimeout),n.clear()});const N=e.model;if(N){if(typeof N=="object"&&typeof N._bind=="function")JSswift._registerCleanup(s,wt.rodModel(s,N));else if(Array.isArray(N)&&typeof N[0]=="function"&&typeof N[1]=="function"){const p=JSswift.reactive.untracked(()=>wt.signalModel(s,N[0],N[1]));JSswift._registerCleanup(s,p)}}return Me(s,e,{isEnabled:()=>!s.disabled,action:()=>ze(s,{selectText:!!e.selectOnShortcode})}),s};function Kn(e,t,s,l=!1){e.focus=c=>t.focus(c);const n=(c,a)=>{a==null||a===!1?t.removeAttribute(c):t.setAttribute(c,String(a))},i=JSswift.reactive.effect(()=>{var c,a;const v=(c=o(s.ariaLabel))!=null?c:typeof s.label=="string"?s.label:null;n("aria-label",v),n("aria-labelledby",o(s.ariaLabelledBy)),(a=e._syncDescription)==null||a.call(e);const r=s.ariaInvalid==null?!!o(s.error):!!o(s.ariaInvalid);t.setAttribute("aria-invalid",String(r));const z=!!o(s.required);if(t.setAttribute("aria-required",String(z)),l){t.required=z;for(const d of["min","max","step","pattern","minLength","maxLength"])n(d.toLowerCase(),o(s[d]))}},"UI.Field:controlAttributes");JSswift._registerCleanup(e,i)}xe.Input=(e={})=>{var t,s,l;const n=e.slots||{},i={...e,label:(t=e.label)!=null?t:e.placeholder},c=_.input({class:re(["jss-input",e.class]),type:e.type||"text",name:e.name,autocomplete:e.autocomplete,inputmode:e.inputmode,value:(s=e.value)!=null?s:"",disabled:!!e.disabled,readOnly:!!e.readonly});let a=!1;const v=new Set,r=(ve,le)=>{if(a)return;const ie=setTimeout(()=>{v.delete(ie),a||ve()},le);v.add(ie)};let z=(l=c.value)!=null?l:"";const d=()=>{var ve;const le=(ve=c.value)!=null?ve:"";le!==z&&(z=le,c.dispatchEvent(new Event("input",{bubbles:!0})),c.dispatchEvent(new Event("change",{bubbles:!0})))};let k=null,N=!1;const p=()=>{if(a||N)return;N=!0;let ve=0;const le=()=>{if(d(),ve+=1,ve>=10){N=!1;return}r(le,120)};r(le,40)},U=()=>{a||k||(k=setInterval(()=>{if(document.activeElement!==c){clearInterval(k),k=null;return}d()},250))},w=()=>{k&&(clearInterval(k),k=null)};c.addEventListener("input",()=>{var ve,le;z=(ve=c.value)!=null?ve:"",(le=e.onInput)==null||le.call(e,c.value)}),c.addEventListener("change",()=>{var ve,le;z=(ve=c.value)!=null?ve:"",(le=e.onChange)==null||le.call(e,c.value)}),c.addEventListener("focus",ve=>{var le;(le=e.onFocus)==null||le.call(e,ve),U(),p(),r(d,50)}),c.addEventListener("blur",ve=>{var le;(le=e.onBlur)==null||le.call(e,ve),w(),r(d,0)}),c.addEventListener("animationstart",ve=>{ve.animationName==="jss-autofill"&&(d(),U(),p())}),r(d,0),p(),JSswift._registerCleanup(c,()=>{a=!0,w(),v.forEach(clearTimeout),v.clear()});const $=e.model;if($){const ve=le=>{var ie;let ge=!1;const ue=de=>{const Z=de!=null?de:"";c.value!==Z&&(c.value=Z,z=Z)},fe=de=>{if(!ge){ge=!0;try{ue(de)}finally{ge=!1}}};le.action(fe),JSswift.reactive.untracked(()=>ue(le.value));const M=de=>{if(ge||de!=null&&de.isComposing)return;const Z=c.value;if(le.value!==Z){ge=!0;try{le.value=Z}finally{ge=!1}}};c.addEventListener("input",M),c.addEventListener("compositionend",M);let me=!1;const be=()=>{var de,Z,j,I;if(me)return;me=!0,c.removeEventListener("input",M),c.removeEventListener("compositionend",M);const y=(Z=(de=le._actions)==null?void 0:de.indexOf(fe))!=null?Z:-1;y>=0&&le._actions.splice(y,1);const P=(I=(j=le._disposeHooks)==null?void 0:j.indexOf(be))!=null?I:-1;P>=0&&!le._disposed&&le._disposeHooks.splice(P,1)};(ie=le.onDispose)==null||ie.call(le,be),JSswift._registerCleanup(c,be)};if(typeof $=="object"&&typeof $._bind=="function")ve($);else if(Array.isArray($)&&typeof $[0]=="function"&&typeof $[1]=="function"){const le=JSswift.reactive.untracked(()=>JSswift.rodFromSignal($[0],$[1]));ve(le),JSswift._registerCleanup(c,()=>le.dispose())}}const B=JSswift.ui.renderSlot(n,"input",{input:c,props:e},c),te=Array.isArray(B)?_.div({style:{display:"contents"}},...B):B,E=xe.FormField({...i,control:te,getValue:()=>c.value,onClear:()=>{c.disabled||c.readOnly||(c.value="",c.dispatchEvent(new Event("input",{bubbles:!0})))},onFocus:()=>c.focus()});return c.addEventListener("input",()=>{var ve;return(ve=E._refresh)==null?void 0:ve.call(E)}),c.addEventListener("change",()=>{var ve;return(ve=E._refresh)==null?void 0:ve.call(E)}),E._input=c,Kn(E,c,e,!0),Me(c,e,{isEnabled:()=>!c.disabled,action:()=>ze(c,{selectText:!!e.selectOnShortcode})}),E},xe.Textarea=(e={})=>{var t,s,l,n;const i=e.slots||{},c={...e,label:(t=e.label)!=null?t:e.placeholder,wrapClass:re(["jss-textarea-field",e.wrapClass])},a=_.textarea({class:re(["jss-input","jss-textarea",e.class]),name:e.name,autocomplete:e.autocomplete,inputmode:e.inputmode,rows:e.rows,cols:e.cols,maxLength:(s=e.maxLength)!=null?s:e.maxlength,minLength:(l=e.minLength)!=null?l:e.minlength,wrap:e.wrap,value:(n=e.value)!=null?n:"",disabled:!!e.disabled,readOnly:!!e.readonly});a.addEventListener("input",()=>{var N;(N=e.onInput)==null||N.call(e,a.value)}),a.addEventListener("change",()=>{var N;(N=e.onChange)==null||N.call(e,a.value)}),a.addEventListener("focus",N=>{var p;(p=e.onFocus)==null||p.call(e,N)}),a.addEventListener("blur",N=>{var p;(p=e.onBlur)==null||p.call(e,N)});const v=e.model;if(v){const N=p=>{var U;let w=!1;const $=le=>{const ie=le!=null?le:"";a.value!==ie&&(a.value=ie)},B=le=>{if(!w){w=!0;try{$(le)}finally{w=!1}}};p.action(B),JSswift.reactive.untracked(()=>$(p.value));const te=le=>{if(w||le!=null&&le.isComposing)return;const ie=a.value;if(p.value!==ie){w=!0;try{p.value=ie}finally{w=!1}}};a.addEventListener("input",te),a.addEventListener("compositionend",te);let E=!1;const ve=()=>{var le,ie,ge,ue;if(E)return;E=!0,a.removeEventListener("input",te),a.removeEventListener("compositionend",te);const fe=(ie=(le=p._actions)==null?void 0:le.indexOf(B))!=null?ie:-1;fe>=0&&p._actions.splice(fe,1);const M=(ue=(ge=p._disposeHooks)==null?void 0:ge.indexOf(ve))!=null?ue:-1;M>=0&&!p._disposed&&p._disposeHooks.splice(M,1)};(U=p.onDispose)==null||U.call(p,ve),JSswift._registerCleanup(a,ve)};if(typeof v=="object"&&typeof v._bind=="function")N(v);else if(Array.isArray(v)&&typeof v[0]=="function"&&typeof v[1]=="function"){const p=JSswift.reactive.untracked(()=>JSswift.rodFromSignal(v[0],v[1]));N(p),JSswift._registerCleanup(a,()=>p.dispose())}}const r=JSswift.ui.getSlot(i,"textarea")!=null?"textarea":"input",z=JSswift.ui.renderSlot(i,r,{textarea:a,input:a,props:e},a),d=Array.isArray(z)?_.div({style:{display:"contents"}},...z):z,k=xe.FormField({...c,control:d,getValue:()=>a.value,onClear:()=>{a.disabled||a.readOnly||(a.value="",a.dispatchEvent(new Event("input",{bubbles:!0})))},onFocus:()=>a.focus()});return a.addEventListener("input",()=>{var N;return(N=k._refresh)==null?void 0:N.call(k)}),a.addEventListener("change",()=>{var N;return(N=k._refresh)==null?void 0:N.call(k)}),k._input=a,k._textarea=a,Me(a,e,{isEnabled:()=>!a.disabled,action:()=>ze(a,{selectText:!!e.selectOnShortcode})}),k};function al(){const e=[];return{effect:(t,s)=>{const l=JSswift.reactive.effect(t,s);return e.push(l),l},action:(t,s)=>{t.action(s),e.push(()=>{var l,n;const i=(n=(l=t._actions)==null?void 0:l.indexOf(s))!=null?n:-1;i>=0&&t._actions.splice(i,1)})},dispose:()=>e.splice(0).forEach(t=>t())}}xe.Search=(e={})=>{var t,s;const l=al();let n=!1;const i=e.slots||{},c=F=>!!F&&(typeof F=="object"&&typeof F._bind=="function"||yt(F)),a=c(e.model)?e.model:c(e.value)?e.value:null,v=a?typeof a=="object"&&typeof a._bind=="function"?a.value:a[0]():o(e.value),[r,z]=JSswift.reactive.signal(v==null?"":String(v)),[d,k]=JSswift.reactive.signal(!1),[N,p]=JSswift.reactive.signal(!1),[U,w]=JSswift.reactive.signal(null),[$,B]=JSswift.reactive.signal([]),[te,E]=JSswift.reactive.signal(-1),ve=`jss-search-${Math.random().toString(36).slice(2,10)}`,le=new Map;let ie=null,ge=null,ue=null,fe=0,M=0,me=!1,be=-1,de=[];const Z=(F,f)=>{const h=Number(o(F));return Number.isFinite(h)?h:f},j=(F,f=!1)=>{const h=o(F);return h==null?f:!!h},I=()=>j(e.disabled,!1),y=()=>j(e.readonly,!1),P=()=>Math.max(0,Z(e.minLength,e.endpoint?1:0)),Q=()=>Math.max(0,Z(e.debounce,250)),m=F=>{var f,h,x,ae,Oe;const De=e.getLabel||e.labelOf;return typeof De=="function"?De(F):F==null?"":typeof F=="string"||typeof F=="number"?String(F):(Oe=(ae=(x=(h=(f=F.label)!=null?f:F.title)!=null?h:F.name)!=null?x:F.text)!=null?ae:F.value)!=null?Oe:""},b=F=>{var f,h,x;const ae=e.getValue||e.valueOf;return typeof ae=="function"?ae(F):F==null?"":typeof F=="string"||typeof F=="number"?F:(x=(h=(f=F.value)!=null?f:F.id)!=null?h:F.key)!=null?x:m(F)},g=F=>Array.isArray(F)?F:!F||typeof F!="object"?[]:Array.isArray(F.items)?F.items:Array.isArray(F.results)?F.results:Array.isArray(F.data)?F.data:[],T=async(F,f)=>{const h=typeof F=="function"?F(f,{props:e}):o(F);return h&&typeof h.then=="function"?await h:h},Y=(F,f)=>{const h=typeof F=="function"?F(f,{props:e}):o(F);if(!h)return"";const x=String(h),ae=new URL(x,window.location.href),Oe=o(e.queryParam)||"q";Oe&&ae.searchParams.set(Oe,f);const De=typeof e.params=="function"?e.params(f,{props:e}):o(e.params);return De&&typeof De=="object"&&Object.keys(De).forEach(Ge=>{const Ke=o(De[Ge]);Ke==null||Ke===!1||ae.searchParams.set(Ge,String(Ke))}),ae.toString()},K=(F,f={})=>{var h,x;const ae=F==null?"":String(F);r()!==ae&&z(ae),Ye.value!==ae&&(Ye.value=ae),ie&&!f.fromModel&&ie(ae),f.fromModel||(h=e.onInput)==null||h.call(e,ae,f.event),(x=Se==null?void 0:Se._refresh)==null||x.call(Se)},_e=()=>{k(!1),E(-1)},J=()=>N()||U()||$().length?!0:r().trim().length>=P()?!!(e.emptyText||JSswift.ui.getSlot(i,"empty")!=null):!!(e.startText||JSswift.ui.getSlot(i,"empty")!=null),A=()=>{I()||J()&&(k(!0),ee())},L=()=>{B([]),w(null),E(-1)},O=async(F,f={})=>{var h,x,ae,Oe,De,Ge;if(n)return;const Ke=F==null?"":String(F).trim(),We=++fe,et=o((h=e.endpoint)!=null?h:e.url),tt=(ae=(x=e.items)!=null?x:e.options)!=null?ae:e.suggestions;if(ue&&(ue.abort(),ue=null),Ke.length<P()){p(!1),L(),f.open&&J()?A():J()||_e();return}const dt=e.cache!==!1,gt=`${et||"local"}::${Ke}`;if(dt&&le.has(gt)){B(le.get(gt)),w(null),p(!1),E(le.get(gt).length?0:-1),f.open!==!1&&A();return}p(!0),w(null),f.open!==!1&&A(),(Oe=e.onSearch)==null||Oe.call(e,Ke);try{let At;if(et){ue=new AbortController;const zt=Y(et,Ke),Xe=await fetch(zt,{method:"GET",headers:e.headers,credentials:e.credentials,signal:ue.signal});if(!Xe.ok)throw new Error(`Search request failed (${Xe.status})`);At=await(e.parseResponse||(Nt=>Nt.json()))(Xe)}else if(tt!=null){const zt=g(await T(tt,Ke)),Xe=e.filter||((mt,Nt)=>String(m(mt)).toLowerCase().includes(Nt.toLowerCase()));At=zt.filter(mt=>Xe(mt,Ke))}else At=[];if(n||We!==fe)return;const It=typeof e.mapResponse=="function"?e.mapResponse(At,Ke):g(At),$t=g(It);dt&&le.set(gt,$t),B($t),E($t.length?0:-1),(De=e.onResults)==null||De.call(e,$t,Ke)}catch(At){if((At==null?void 0:At.name)==="AbortError"||n||We!==fe)return;w(At),B([]),E(-1),(Ge=e.onError)==null||Ge.call(e,At,Ke)}finally{!n&&We===fe&&(p(!1),ue=null,ee())}},X=(F,f={})=>{if(n)return;ge&&clearTimeout(ge);const h=f.immediate?0:Q();ge=setTimeout(()=>{ge=null,O(F,f)},h)},we=F=>{var f;const h=r();(f=e.onSubmit)==null||f.call(e,h,F),e.submitOnEnter!==!1&&X(h,{immediate:!0,open:!0})},Be=(F,f)=>{var h;if(!F)return;const x=b(F),ae=m(F);e.commitValue==="value"?K(x,{event:f}):e.commitValue!==!1&&K(ae,{event:f}),(h=e.onSelect)==null||h.call(e,F,{value:x,label:ae,query:r(),event:f}),e.closeOnSelect!==!1&&_e()},Ue=F=>{const f=$();if(!f.length)return;const h=te(),x=h<0?F>0?0:f.length-1:Math.max(0,Math.min(f.length-1,h+F));E(x)},H=F=>{const f=F==null?"":String(F),h=r().trim();if(!h||e.highlight===!1)return[document.createTextNode(f)];const x=f.toLowerCase().indexOf(h.toLowerCase());return x<0?[document.createTextNode(f)]:[document.createTextNode(f.slice(0,x)),_.mark({class:"jss-search-highlight"},f.slice(x,x+h.length)),document.createTextNode(f.slice(x+h.length))]},W=F=>{var f,h;const x=m(F),ae=F&&typeof F=="object"?(h=(f=F.description)!=null?f:F.subtitle)!=null?h:F.note:null;return _.div({class:"jss-search-result-content"},_.div({class:"jss-search-result-label"},...H(x)),ae?_.div({class:"jss-search-result-description"},String(ae)):null)},ee=()=>{!d()||Re.parentNode!==document.body||M||(M=requestAnimationFrame(()=>{if(M=0,!d()||!C.isConnected||Re.parentNode!==document.body)return;const F=C.getBoundingClientRect(),f=6,h=8,x=Math.max(180,window.innerWidth-h*2),ae=Math.min(Math.max(F.width,Z(e.minMenuWidth,260)),x),Oe=Math.max(h,Math.min(F.left,window.innerWidth-ae-h));Re.style.width=`${ae}px`,Re.style.left=`${Oe}px`,Re.style.right="auto";const De=Re.getBoundingClientRect().height||0,Ge=window.innerHeight-F.bottom-f-h,Ke=F.top-f-h;let et=Ge<180&&Ke>Ge?F.top-f-De:F.bottom+f;et=Math.max(h,Math.min(et,window.innerHeight-De-h)),Re.style.top=`${et}px`}))},Ne=()=>{me||(me=!0,window.addEventListener("resize",ee),window.addEventListener("scroll",ee,!0))},Te=()=>{me&&(me=!1,window.removeEventListener("resize",ee),window.removeEventListener("scroll",ee,!0))},oe=()=>{Re.parentNode!==document.body&&(M&&(cancelAnimationFrame(M),M=0),Re.classList.add("portal"),Re.style.display="block",document.body.appendChild(Re),Ne(),ee())},Pe=()=>{M&&(cancelAnimationFrame(M),M=0),Te(),Re.parentNode!==C&&C.appendChild(Re),Re.classList.remove("portal"),Re.style.display="",Re.style.position="",Re.style.top="",Re.style.left="",Re.style.right="",Re.style.width=""},Ie=e.label!=null||JSswift.ui.getSlot(i,"label")!=null,Le=()=>{if(!Ie){Ye.placeholder=o(e.placeholder)||"";return}Ye.placeholder=document.activeElement===Ye&&o(e.placeholder)||""},Ye=_.input({id:e.id,class:re(["jss-input","jss-search-input",e.inputClass]),type:"search",name:e.name,placeholder:Ie?"":e.placeholder,autocomplete:e.autocomplete||"off",inputmode:e.inputmode,value:r(),disabled:I(),readOnly:y(),role:"combobox","aria-autocomplete":"list","aria-expanded":"false","aria-controls":`${ve}-list`}),ct=_.div({id:`${ve}-list`,class:"jss-search-results",role:"listbox"}),Re=_.div({class:re(["jss-search-menu","jss-singularity-menu-select",e.menuClass,pe(e.fill,"jss-select-menu-fill")]),"data-jss-overlay-portal":"true",onClick:F=>F.stopPropagation()},ct),C=_.div({class:re(["jss-search",e.class]),role:"presentation"},Ye,Re);let Se=null;if(a){if(typeof a=="object"&&typeof a._bind=="function")l.action(a,F=>K(F,{fromModel:!0})),ie=F=>{a.value!==F&&(a.value=F)};else if(Array.isArray(a)&&typeof a[0]=="function"&&typeof a[1]=="function"){const F=a[0],f=a[1];l.effect(()=>{K(F(),{fromModel:!0})},"UI.Search:model"),ie=h=>f(h)}}else ht(e.value)&&l.effect(()=>{K(o(e.value),{fromModel:!0})},"UI.Search:value");Ye.addEventListener("input",F=>{K(Ye.value,{event:F}),e.searchOnInput!==!1&&X(Ye.value,{open:!0})}),Ye.addEventListener("change",F=>{var f;return(f=e.onChange)==null?void 0:f.call(e,Ye.value,F)}),Ye.addEventListener("focus",F=>{var f;Le(),(f=e.onFocus)==null||f.call(e,F),e.openOnFocus!==!1&&(e.searchOnFocus&&!$().length?X(Ye.value,{immediate:!0,open:!0}):A())}),Ye.addEventListener("blur",F=>{var f;Le(),(f=e.onBlur)==null||f.call(e,F)}),Ye.addEventListener("keydown",F=>{if(I()||y())return;const f=d(),h=$(),x=te();if(F.key==="Escape"){f&&(F.preventDefault(),_e());return}if(F.key==="ArrowDown"){F.preventDefault(),f?Ue(1):(A(),h.length||X(Ye.value,{immediate:!0,open:!0}));return}if(F.key==="ArrowUp"){F.preventDefault(),f?Ue(-1):A();return}if(F.key==="Home"&&f&&h.length&&(F.metaKey||F.ctrlKey)){F.preventDefault(),E(0);return}if(F.key==="End"&&f&&h.length&&(F.metaKey||F.ctrlKey)){F.preventDefault(),E(h.length-1);return}F.key==="Enter"&&(f&&x>=0&&h[x]?(F.preventDefault(),Be(h[x],F)):we(F))});const Fe=F=>{if(!C.isConnected)return;const f=F.target;C.contains(f)||Re.contains(f)||_e()};return document.addEventListener("click",Fe,!0),l.effect(()=>{const F=d();C.classList.toggle("open",F),Ye.setAttribute("aria-expanded",F?"true":"false"),F?oe():Pe()},"UI.Search:open"),l.effect(()=>{const F=I(),f=y();C.classList.toggle("disabled",F),C.classList.toggle("readonly",f),Ye.disabled=F,Ye.readOnly=f},"UI.Search:disabled"),l.effect(()=>{const F=N(),f=U(),h=$(),x=r();if(ct.innerHTML="",de=[],be=-1,F){const ae=JSswift.ui.renderSlot(i,"loading",{query:x},e.loadingText||"Caricamento...");ct.appendChild(_.div({class:"jss-search-empty is-loading"},...D(null,"default",{},ae)))}else if(f){const ae=JSswift.ui.renderSlot(i,"error",{error:f,query:x},e.errorText||"Errore ricerca");ct.appendChild(_.div({class:"jss-search-empty is-error"},...D(null,"default",{},ae)))}else if(h.length)h.forEach((ae,Oe)=>{const Ge=m(ae),Ke=b(ae),We=dt=>Be(ae,dt),et=JSswift.ui.renderSlot(i,"result",{item:ae,index:Oe,active:!1,label:Ge,value:Ke,query:x,select:We},W(ae)),tt=_.div({id:`${ve}-result-${Oe}`,class:re(["jss-search-result",""]),role:"option","aria-selected":"false",onMouseEnter:()=>E(Oe),onMouseDown:dt=>dt.preventDefault(),onClick:We},...D(null,"default",{},et));ct.appendChild(tt),de[Oe]=tt});else{const Oe=x.trim().length>=P()?e.emptyText||"Nessun risultato":e.startText||"",De=JSswift.ui.renderSlot(i,"empty",{query:x},Oe);(Oe||JSswift.ui.getSlot(i,"empty")!=null)&&ct.appendChild(_.div({class:"jss-search-empty"},...D(null,"default",{},De)))}J()||_e(),ee()},"UI.Search:render"),l.effect(()=>{const F=te();F!==be&&(de[be]&&(de[be].classList.remove("active"),de[be].setAttribute("aria-selected","false")),de[F]?(de[F].classList.add("active"),de[F].setAttribute("aria-selected","true"),de[F].scrollIntoView({block:"nearest"}),Ye.setAttribute("aria-activedescendant",`${ve}-result-${F}`)):Ye.removeAttribute("aria-activedescendant"),be=F)},"UI.Search:active"),Se=xe.FormField({...e,icon:(t=e.icon)!=null?t:"search",wrapClass:re(["jss-search-field",e.wrapClass]),control:C,getValue:()=>r(),onClear:()=>{var F;I()||y()||(K("",{}),L(),(F=e.onClear)==null||F.call(e))},onFocus:()=>Ye.focus()}),Ye.addEventListener("input",()=>{var F;return(F=Se._refresh)==null?void 0:F.call(Se)}),Ye.addEventListener("change",()=>{var F;return(F=Se._refresh)==null?void 0:F.call(Se)}),Se._input=Ye,Se._search=C,Se._open=A,Se._close=_e,Se._searchNow=()=>O(r(),{immediate:!0,open:!0}),Se._getResults=$,Se._setValue=F=>K(F,{}),Se._dispose=()=>{n||(n=!0,l.dispose(),fe++,le.clear(),document.removeEventListener("click",Fe,!0),ge&&clearTimeout(ge),ue&&ue.abort(),Pe())},(s=JSswift._registerCleanup)==null||s.call(JSswift,Se,Se._dispose),Me(Ye,e,{isEnabled:()=>!Ye.disabled,action:()=>ze(Ye,{selectText:!!e.selectOnShortcode})}),(e.autoSearch||e.searchOnMount)&&X(r(),{immediate:!0,open:!1}),Se},xe.Select=(e={})=>{var t,s;const l=al();let n=!1;const i={...e,label:(t=e.label)!=null?t:e.placeholder},c=e.filterable,a=!!e.multiple||!!e.multi,v=!!e.allowCustom||!!e.allowCustomValue,r=e.slots||{},z=f=>!!f&&(typeof f=="object"&&typeof f._bind=="function"||yt(f)),d=z(e.model)?e.model:z(e.value)?e.value:null,k=f=>Array.isArray(f)?f.slice():f==null||f===""?[]:[f],N=f=>a?k(f):f,p=d?JSswift.reactive.untracked(()=>typeof d=="object"&&typeof d._bind=="function"?d.value:d[0]()):e.value,[U,w]=JSswift.reactive.signal(!1),[$,B]=JSswift.reactive.signal(""),[te,E]=JSswift.reactive.signal(a?k(p):p!=null?p:""),[ve,le]=JSswift.reactive.signal(!1),[ie,ge]=JSswift.reactive.signal([]),[ue,fe]=JSswift.reactive.signal([]),[M,me]=JSswift.reactive.signal(-1);let be=null;if(d){if(typeof d=="object"&&typeof d._bind=="function")JSswift.reactive.untracked(()=>E(N(d.value))),l.action(d,f=>E(N(f))),be=f=>{const h=N(f);d.value!==h&&(d.value=h)};else if(Array.isArray(d)&&typeof d[0]=="function"&&typeof d[1]=="function"){const f=d[0],h=d[1];JSswift.reactive.untracked(()=>{l.effect(()=>{E(N(f()))},"UI.Select:model")}),be=x=>h(N(x))}}function de(){var f;return typeof e.disabled=="function"?e.disabled():typeof e.disabled=="boolean"?e.disabled:(f=e==null?void 0:e.disabled)!=null&&f.action?e.disabled.value:!1}function Z(f){var h,x,ae,Oe;if(f==null)return null;if(typeof f=="string"||typeof f=="number")return{type:"option",label:String(f),value:f,disabled:!1};if(typeof f=="object"){if(Array.isArray(f.options))return{type:"group",label:String((h=f.label)!=null?h:""),options:f.options};const De=(x=f.label)!=null?x:f.value!=null?String(f.value):"";return{type:"option",label:String(De),value:(Oe=(ae=f.value)!=null?ae:f.label)!=null?Oe:"",disabled:!!f.disabled}}return{type:"option",label:String(f),value:f,disabled:!1}}function j(f){const x=(Array.isArray(f)?f:[]).map(Z).filter(Boolean),ae=[],Oe=[];for(const De of x)if(De.type==="group"){ae.push({type:"group",label:De.label});const Ge=(De.options||[]).map(Z).filter(Boolean).filter(Ke=>Ke.type==="option");for(const Ke of Ge)ae.push(Ke),Oe.push(Ke)}else ae.push(De),Oe.push(De);ge(ae),fe(Oe)}async function I(){if(n)return;const f=e.options;let h;try{const x=typeof f=="function"?JSswift.ui.withoutRodPathCapture(()=>f()):f;x&&typeof x.then=="function"?(le(!0),h=await x):h=x,n||j(h)}catch(x){if(n)return;console.error("[UI.Select] options load error:",x),j([])}finally{n||le(!1)}}function y(f){var h;const x=N(f);E(x),be&&be(x),(h=e.onChange)==null||h.call(e,x)}function P(f){const h=k(te()),ae=h.some(Oe=>Oe==f)?h.filter(Oe=>Oe!=f):[...h,f];y(ae)}function Q(f,h=!1){a?(P(f),h&&m()):(y(f),b())}function m(){B(""),O&&(O.value="")}function b(){w(!1),m(),me(-1)}async function g(){if(n||de()||(w(!0),await I(),n))return;const f=te(),h=ue();let x=-1;if(a){const ae=k(f);for(const Oe of ae)if(x=h.findIndex(De=>De.value==Oe&&!De.disabled),x>=0)break}else x=h.findIndex(ae=>ae.value==f&&!ae.disabled);x<0&&(x=h.findIndex(ae=>!ae.disabled)),me(x),O&&setTimeout(()=>O.focus(),0)}function T(){U()?b():g()}const Y=_.div({class:re(["jss-select",a?"multiple":"",e.class]),tabIndex:de()?-1:0,role:"combobox","aria-expanded":"false","aria-disabled":de()?"true":"false"}),K=_.div({class:re(["jss-select-value",a?"jss-select-value-multi":""])});l.effect(()=>{const f=ue();if(K.innerHTML="",a){const h=k(te());for(const x of h){const ae=f.find(Ke=>Ke.value==x),Oe=ae?ae.label:x==null?"":String(x);let De=!1;const Ge=xe.Chip({label:Oe,dense:!0,color:e.chipColor||e.color,icon:e.chipIcon||null,iconRight:e.chipIconRight||null,glossy:e.glossy,glow:e.glow,glass:e.chipGlass||e.glass,class:e.chipClass,flat:e.flat,rounded:e.rounded,outline:e.outline,shadow:e.chipShadow,lightShadow:e.lightShadow,gloss:e.gloss,border:e.border,size:e.chipSize,removable:!0,onRemove:Ke=>{var We,et,tt;(We=Ke==null?void 0:Ke.preventDefault)==null||We.call(Ke),(et=Ke==null?void 0:Ke.stopPropagation)==null||et.call(Ke),(tt=Ke==null?void 0:Ke.stopImmediatePropagation)==null||tt.call(Ke),!De&&(De=!0,P(x))}});K.appendChild(Ge)}}else{const h=te(),x=f.find(ae=>ae.value==h);K.textContent=x?x.label:h==null||h===""?"":String(h)}},"UI.Select:value");const _e=_.div({class:"jss-select-arrow"});l.effect(()=>{const f=JSswift.ui.renderSlot(r,"arrow",{open:U()},xe.Icon("#chevron-down"));_e.innerHTML="",D(null,"default",{},f).forEach(h=>_e.appendChild(h))},"UI.Select:arrow");const J=_.div({class:"jss-select-control",onClick:T},K,_e),A=_.div({class:"jss-select-options",role:"listbox","aria-multiselectable":a?"true":"false"}),L=_.div({class:"jss-select-filter jss-d-none"});let O=null;const X=_.input({class:"jss-input",type:"text",placeholder:e.filterPlaceholder||"Cerca...",onInput:f=>B(f.target.value||"")}),we=()=>{const f=JSswift.ui.renderSlot(r,"filter",{value:$(),setValue:x=>{const ae=x==null?"":String(x);B(ae),O&&"value"in O&&(O.value=ae)},close:b},X);L.innerHTML="";const h=D(null,"default",{},f);h.forEach(x=>L.appendChild(x)),O=h.length===1&&h[0]&&h[0].tagName==="INPUT"?h[0]:null,O&&(O.value=$()||"")};JSswift.reactive.untracked(we),l.effect(()=>{const f=$()||"";O&&"value"in O&&O.value!==f&&(O.value=f)},"UI.Select:filterValue"),typeof c=="boolean"?c?L.classList.remove("jss-d-none"):L.classList.add("jss-d-none"):c!=null&&c.action&&(l.action(c,f=>{f?L.classList.remove("jss-d-none"):L.classList.add("jss-d-none")}),c.value?L.classList.remove("jss-d-none"):L.classList.add("jss-d-none"));const Be={...e};pn(Be);const Ue=xt([Be.color,Be.state],()=>{const f=o(Be.color)||o(Be.state)||"";return["primary","secondary","warning","danger","success","info","light","dark"].includes(f)?f:o(Be.state)||""}),H=_.div({class:re(["jss-select-menu","jss-singularity-menu-select",Ue,Be.class,pe(e.fill,"jss-select-menu-fill")]),"data-jss-overlay-portal":"true",onClick:f=>f.stopPropagation()},L,A);let W=0,ee=!1;const Ne=()=>{!U()||H.parentNode!==document.body||W||(W=requestAnimationFrame(()=>{if(W=0,!U()||!Y.isConnected||H.parentNode!==document.body)return;const f=Y.getBoundingClientRect(),h=6,x=8,ae=Math.max(160,window.innerWidth-x*2),Oe=Math.min(Math.max(f.width,180),ae),De=Math.max(x,Math.min(f.left,window.innerWidth-Oe-x));H.style.width=`${Oe}px`,H.style.left=`${De}px`,H.style.right="auto",H.style.marginTop="0";const Ge=H.getBoundingClientRect().height||0,Ke=window.innerHeight-f.bottom-h-x,We=f.top-h-x;let tt=Ke<180&&We>Ke?f.top-h-Ge:f.bottom+h;tt=Math.max(x,Math.min(tt,window.innerHeight-Ge-x)),H.style.top=`${tt}px`}))},Te=()=>{ee||(ee=!0,window.addEventListener("resize",Ne),window.addEventListener("scroll",Ne,!0))},oe=()=>{ee&&(ee=!1,window.removeEventListener("resize",Ne),window.removeEventListener("scroll",Ne,!0))},Pe=()=>{H.parentNode!==document.body&&(W&&(cancelAnimationFrame(W),W=0),H.classList.add("portal"),H.style.display="block",document.body.appendChild(H),Te(),Ne())},Ie=()=>{W&&(cancelAnimationFrame(W),W=0),oe(),H.parentNode!==Y&&Y.appendChild(H),H.classList.remove("portal"),H.style.display="",H.style.position="",H.style.top="",H.style.left="",H.style.right="",H.style.width="",H.style.marginTop=""};Y.appendChild(J),Y.appendChild(H),l.effect(()=>{const f=U();Y.classList.toggle("open",f),Y.setAttribute("aria-expanded",f?"true":"false"),f?Pe():Ie()},"UI.Select:open"),l.effect(()=>{const f=de();Y.classList.toggle("disabled",f),Y.tabIndex=f?-1:0,Y.setAttribute("aria-disabled",f?"true":"false")},"UI.Select:disabled");let Le=[],Ye=-1,ct=-1;function Re(){var f;const h=M();ct=h,h!==Ye&&(Le[Ye]&&Le[Ye].classList.remove("active"),Le[h]&&Le[h].classList.add("active"),Ye=h,h>=0&&((f=Le[h])==null||f.scrollIntoView({block:"nearest"})))}l.effect(()=>{const f=ie(),h=ue(),x=($()||"").toLowerCase().trim(),ae=te(),Oe=a?k(ae):[ae],De=ve(),Ge=ct;A.innerHTML="",Le=[],Ye=-1;const Ke=[];let We=0;const et=tt=>{const dt=Oe.some(mt=>mt==tt.value),gt=!!tt.disabled,At=["jss-select-option",dt?"selected":"",gt?"disabled":""].filter(Boolean).join(" "),It=()=>{a?P(tt.value):(y(tt.value),b())},$t=JSswift.ui.renderSlot(r,"option",{opt:tt,selected:dt,active:We===Ge,disabled:gt,select:It},tt.label),zt=D(null,"default",{},$t),Xe=_.div({class:At,"data-flat-index":String(We),onClick:gt?null:It},...zt);Ke.push(Xe),Le[We]=Xe,We++};if(x){const tt=h.filter(dt=>dt.label.toLowerCase().includes(x));if(tt.length===0){const dt=JSswift.ui.renderSlot(r,"empty",{filter:x},e.emptyText||"Nessuna opzione");A.appendChild(_.div({class:"jss-select-empty"},...D(null,"default",{},dt))),U()&&Ne();return}for(const dt of tt)et(dt)}else{let tt=!1;for(const dt of f)if(dt.type==="group"){const gt=JSswift.ui.renderSlot(r,"group",{label:dt.label},dt.label);Ke.push(_.div({class:"jss-select-group"},...D(null,"default",{},gt)))}else tt=!0,et(dt);if(!tt){const dt=JSswift.ui.renderSlot(r,"empty",{filter:x},e.emptyText||"Nessuna opzione");A.appendChild(_.div({class:"jss-select-empty"},...D(null,"default",{},dt))),U()&&Ne();return}}if(De){const tt=JSswift.ui.renderSlot(r,"loading",{},"Caricamento...");A.appendChild(_.div({class:"jss-select-empty"},...D(null,"default",{},tt))),U()&&Ne();return}for(const tt of Ke)A.appendChild(tt);Re(),U()&&Ne()},"UI.Select:render"),l.effect(()=>{Re()},"UI.Select:paintActive");const C=f=>{if(!Y.isConnected)return;const h=f.target;Y.contains(h)||H.contains(h)||b()};document.addEventListener("click",C,!0);const Se=f=>{if(de())return;const h=U(),x=ue(),ae=M(),Oe=O&&f.target===O,De=(Ke,We)=>{let et=Ke;for(;et>=0&&et<x.length;){if(!x[et].disabled)return et;et+=We}return-1},Ge=Ke=>{if(!Ke)return null;const We=Ke.toLowerCase();let et=x.find(tt=>String(tt.label).toLowerCase()===We||String(tt.value).toLowerCase()===We);return et||(et=x.find(tt=>String(tt.label).toLowerCase().includes(We))),et&&!et.disabled?et:null};if(f.key==="Escape"){h&&(f.preventDefault(),b());return}if(Oe&&(f.key==="Enter"||f.key===" ")){const Ke=($()||"").trim();if(Ke){const We=Ge(Ke);if(We){f.preventDefault(),Q(We.value,!0);return}if(v&&f.key==="Enter"){f.preventDefault(),Q(Ke,!0);return}if(f.key==="Enter"){f.preventDefault();return}}if(f.key===" ")return}if(f.key==="Enter"||f.key===" "){if(f.preventDefault(),!h){g();return}ae>=0&&x[ae]&&!x[ae].disabled&&(a?P(x[ae].value):(y(x[ae].value),b()));return}if(f.key==="ArrowDown"){if(f.preventDefault(),!h){g();return}const Ke=De(ae<0?0:ae+1,1);Ke>=0&&me(Ke);return}if(f.key==="ArrowUp"){if(f.preventDefault(),!h){g();return}const Ke=De(ae<0?x.length-1:ae-1,-1);Ke>=0&&me(Ke);return}if(f.key==="Home"){if(!h)return;f.preventDefault();const Ke=De(0,1);Ke>=0&&me(Ke);return}if(f.key==="End"){if(!h)return;f.preventDefault();const Ke=De(x.length-1,-1);Ke>=0&&me(Ke);return}};Y.addEventListener("keydown",Se),L.addEventListener("keydown",Se),Y._dispose=()=>{n||(n=!0,l.dispose(),document.removeEventListener("click",C,!0),Y.removeEventListener("keydown",Se),L.removeEventListener("keydown",Se),Ie())};const Fe=()=>{const f=te();return a?Array.isArray(f)&&f.length>0:f==null?!1:f!==""?!0:ue().some(h=>h.value==="")},F=xe.FormField({...i,control:Y,clearable:e.clearable,disabled:de(),readonly:!1,hasValue:Fe,getValue:()=>{const f=te();return a?Array.isArray(f)&&f.length?f:"":f},onClear:()=>{de()||(y(a?[]:null),b())},onFocus:()=>{g()}});return l.effect(()=>{var f;(f=F._refresh)==null||f.call(F)},"UI.Select:fieldRefresh"),Kn(F,Y,e),F._select=Y,F._dispose=Y._dispose,(s=JSswift._registerCleanup)==null||s.call(JSswift,F,F._dispose),Me(F,e,{isEnabled:()=>!de(),action:()=>{if(de())return!1;ze(Y),g()}}),I(),F},xe.Upload=(e={})=>{var t;pn(e);const s=e.slots||{},[l,n]=JSswift.reactive.signal([]),[i,c]=JSswift.reactive.signal(!1),[a,v]=JSswift.reactive.signal(!1),[r,z]=JSswift.reactive.signal(null);let d=0,k=!1;const N=()=>!!o(e.disabled)||!!o(e.readonly),p=()=>e.multiple!==!1&&e.single!==!0,U=()=>{var C,Se;return["form","native","submit","external"].includes(String(o((Se=(C=e.submitMode)!=null?C:e.modeSubmit)!=null?Se:e.uploadMode)||"").toLowerCase())},w=()=>{var C;return o((C=e.showBrowse)!=null?C:e.browseButton)!==!1},$=()=>{var C;return!U()&&o((C=e.showUpload)!=null?C:e.uploadButton)!==!1},B=()=>{var C;return o((C=e.showClear)!=null?C:e.clearButton)!==!1},te=()=>{var C;return o((C=e.showFiles)!=null?C:e.files)!==!1},E=()=>{const C=sn(o(e.state)||o(e.status));return C?`jss-state-${C}`:""},ve=()=>e.fieldName||e.paramName||e.name||"file",le=()=>{var C;return Math.max(1,Number(o((C=e.parallelUploads)!=null?C:e.parallel)||1))},ie=()=>{var C,Se,Fe,F;const f=o(e.retry);return f===!0?{attempts:2,delay:350,factor:2}:f?{attempts:Math.max(0,Number((Se=(C=f.attempts)!=null?C:f.retries)!=null?Se:0)),delay:Math.max(0,Number((Fe=f.delay)!=null?Fe:350)),factor:Math.max(1,Number((F=f.factor)!=null?F:2))}:{attempts:0,delay:350,factor:2}},ge=C=>C?Array.isArray(C)?C:Array.from(C):[],ue=C=>{const Se=Number(C||0);return Se<1024?`${Se} B`:Se<1024*1024?`${(Se/1024).toFixed(1)} KB`:Se<1024*1024*1024?`${(Se/1024/1024).toFixed(1)} MB`:`${(Se/1024/1024/1024).toFixed(1)} GB`},fe=()=>{var C;return String(o((C=e.acceptedFiles)!=null?C:e.accept)||"").trim()},M=C=>{const Se=fe();if(!Se)return!0;const Fe=String(C.name||"").toLowerCase(),F=String(C.type||"").toLowerCase();return Se.split(",").map(f=>f.trim().toLowerCase()).filter(Boolean).some(f=>f.startsWith(".")?Fe.endsWith(f):f.endsWith("/*")?F.startsWith(f.slice(0,-1)):F===f)},me=()=>l().filter(C=>C.status!=="rejected"&&C.status!=="removed"),be=(C=0)=>me().reduce((Se,Fe)=>Se+Number(Fe.size||0),C),de=()=>{var C;n(l().slice()),ee.classList.toggle("is-busy",l().some(Se=>Se.status==="uploading")),ee.classList.toggle("has-files",l().some(Se=>Se.status!=="removed")),(C=e.onChange)==null||C.call(e,l().slice(),Ne)},Z=(C,Se,Fe=null)=>{var F;const f={id:`upload_${Date.now()}_${++d}`,file:C,name:(C==null?void 0:C.name)||"file",size:Number((C==null?void 0:C.size)||0),type:(C==null?void 0:C.type)||"",status:"rejected",progress:0,error:Se,detail:Fe,attempts:0,response:null,xhr:null};return l().push(f),(F=e.onRejected)==null||F.call(e,f,{reason:Se,detail:Fe,api:Ne}),f},j=async(C,Se)=>{const Fe=e.maxFiles==null?null:Number(o(e.maxFiles)),F=e.maxFileSize==null?null:Number(o(e.maxFileSize)),f=e.minFileSize==null?null:Number(o(e.minFileSize)),h=e.maxTotalSize==null?null:Number(o(e.maxTotalSize));if(Fe!=null&&Se>Fe)return"max-files";if(F!=null&&Number(C.size||0)>F)return"max-file-size";if(f!=null&&Number(C.size||0)<f)return"min-file-size";if(h!=null&&be(Number(C.size||0))>h)return"max-total-size";if(!M(C))return"accept";const x=e.filter||e.acceptFile||e.validate;if(typeof x=="function"){const ae=await x(C,{files:l().slice(),api:Ne});if(ae===!1)return"filter";if(typeof ae=="string")return ae}return null},I=async()=>{for(const C of l()){if(C.status!=="rejected"||C.error!=="max-files")continue;const Se=await j(C.file,me().length+1);if(Se){C.error=Se;continue}C.status="queued",C.progress=0,C.error=null,C.detail=null}},y=C=>({id:`upload_${Date.now()}_${++d}`,file:C,name:(C==null?void 0:C.name)||"file",size:Number((C==null?void 0:C.size)||0),type:(C==null?void 0:C.type)||"",status:"queued",progress:0,bytesUploaded:0,error:null,detail:null,attempts:0,response:null,xhr:null}),P=async(C,Se={})=>{var Fe;if(N())return[];z(null);const F=ge(C),f=[];!p()&&F.length&&Q({silent:!0});for(const h of F){const x=await j(h,me().length+1);if(x){Z(h,x);continue}const ae=y(h);if(l().push(ae),f.push(ae),(Fe=e.onAdded)==null||Fe.call(e,ae,{file:h,meta:Se,api:Ne}),!p())break}return de(),f.length&&e.autoUpload&&!U()&&L(),f},Q=(C={})=>{var Se;for(const Fe of l())Fe.status==="uploading"&&b(Fe),Fe.status="removed";n([]),z(null),de(),C.silent||(Se=e.onClear)==null||Se.call(e,Ne)},m=async C=>{var Se;const Fe=typeof C=="string"?l().find(f=>f.id===C):C;if(!Fe)return;Fe.status==="uploading"&&b(Fe);const F=l().filter(f=>f!==Fe);n(F),await I(),de(),(Se=e.onRemove)==null||Se.call(e,Fe,{api:Ne})},b=C=>{var Se,Fe,F;const f=typeof C=="string"?l().find(h=>h.id===C):C;!f||f.status!=="uploading"||(f.status="canceled",f.error="canceled",(Fe=(Se=f.xhr)==null?void 0:Se.abort)==null||Fe.call(Se),(F=e.onCancel)==null||F.call(e,f,{api:Ne}),de())},g=()=>l().filter(C=>C.status==="uploading").forEach(b),T=async C=>{var Se,Fe;const F={url:o(e.url),method:o(e.method||"POST"),headers:e.headers,formFields:e.formFields||e.fields,fieldName:ve(),withCredentials:!!o((Se=e.withCredentials)!=null?Se:e.credentials),sendRaw:!!o(e.sendRaw)};if(typeof e.factory=="function")try{const f=await e.factory(C.file,{item:C,files:l().slice(),api:Ne});if(f&&typeof f=="object")Object.assign(F,f);else if(f!=null)throw new Error("factory must return an object")}catch(f){throw(Fe=e.onFactoryFailed)==null||Fe.call(e,f,{item:C,api:Ne}),f}return F},Y=(C,Se,Fe)=>{const F=typeof Se=="function"?Se(Fe.file,{item:Fe,api:Ne}):Se;F&&(F instanceof Headers?F.forEach((f,h)=>C.setRequestHeader(h,f)):Array.isArray(F)?F.forEach(f=>{Array.isArray(f)?C.setRequestHeader(f[0],f[1]):f!=null&&f.name&&C.setRequestHeader(f.name,f.value)}):typeof F=="object"&&Object.keys(F).forEach(f=>C.setRequestHeader(f,F[f])))},K=(C,Se,Fe)=>{const F=typeof Se=="function"?Se(Fe.file,{item:Fe,api:Ne}):Se;F&&(Array.isArray(F)?F.forEach(f=>{Array.isArray(f)?C.append(f[0],f[1]):f!=null&&f.name&&C.append(f.name,f.value)}):typeof F=="object"&&Object.keys(F).forEach(f=>C.append(f,F[f])))},_e=(C,Se)=>new Promise((Fe,F)=>{if(!Se.url){F(new Error("UI.Upload: url is required"));return}if(typeof XMLHttpRequest!="function"){F(new Error("UI.Upload: XMLHttpRequest is not available"));return}const f=new XMLHttpRequest;C.xhr=f,f.open(String(Se.method||"POST").toUpperCase(),Se.url,!0),f.withCredentials=!!Se.withCredentials,Y(f,Se.headers,C),f.upload.onprogress=x=>{var ae;x.lengthComputable&&(C.bytesUploaded=x.loaded,C.progress=Math.max(0,Math.min(100,Math.round(x.loaded/x.total*100))),(ae=e.onProgress)==null||ae.call(e,C,{event:x,api:Ne}),de())},f.onload=()=>{const x=f.status>=200&&f.status<300,ae={status:f.status,text:f.responseText,xhr:f};x?Fe(ae):F(Object.assign(new Error(`HTTP error ${f.status}`),{response:ae}))},f.onerror=()=>F(new Error("network-error")),f.onabort=()=>F(new Error("canceled"));const h=Se.sendRaw?C.file:(()=>{const x=new FormData;return K(x,Se.formFields,C),x.append(Se.fieldName||"file",C.file,C.name),x})();f.send(h)}),J=async C=>{var Se,Fe,F,f,h,x;const ae=ie();let Oe=ae.delay;C.status="uploading",C.error=null,C.progress=Math.max(0,C.progress||0),(Se=e.onStart)==null||Se.call(e,C,{api:Ne}),de();for(let De=0;De<=ae.attempts;De++){C.attempts=De+1;try{const Ge=await T(C),Ke=typeof e.upload=="function"||typeof e.uploader=="function"?await(e.upload||e.uploader)(C.file,{item:C,options:Ge,progress:We=>{var et;C.progress=Math.max(0,Math.min(100,Number(We)||0)),(et=e.onProgress)==null||et.call(e,C,{api:Ne}),de()},api:Ne}):await _e(C,Ge);return C.status="done",C.progress=100,C.response=Ke,C.xhr=null,(Fe=e.onSuccess)==null||Fe.call(e,C,{response:Ke,api:Ne}),(F=e.onComplete)==null||F.call(e,C,{response:Ke,api:Ne}),de(),C}catch(Ge){if(String((Ge==null?void 0:Ge.message)||Ge)==="canceled"||C.status==="canceled")return C.status="canceled",C.error="canceled",C.xhr=null,(f=e.onComplete)==null||f.call(e,C,{error:Ge,api:Ne}),de(),C;if(De<ae.attempts){await new Promise(Ke=>setTimeout(Ke,Oe)),Oe=Math.round(Oe*ae.factor);continue}return C.status="error",C.error=Ge,C.xhr=null,z(Ge),(h=e.onError)==null||h.call(e,C,{error:Ge,api:Ne}),(x=e.onComplete)==null||x.call(e,C,{error:Ge,api:Ne}),de(),C}}return C},A=()=>{var C;if(k||N())return;const Se=l().filter(f=>f.status==="uploading").length,Fe=Math.max(0,le()-Se),F=l().filter(f=>f.status==="queued").slice(0,Fe);if(!F.length){const f=l().some(h=>h.status==="uploading");v(f),f||(C=e.onFinish)==null||C.call(e,l().slice(),{api:Ne});return}v(!0),F.forEach(f=>{J(f).finally(()=>A())})},L=(C=null)=>{(C?ge(C):l().filter(Fe=>["queued","error","canceled"].includes(Fe.status))).forEach(Fe=>{const F=typeof Fe=="string"?l().find(f=>f.id===Fe):Fe;F&&F.status!=="uploading"&&F.status!=="done"&&F.status!=="rejected"&&(F.status="queued",F.progress=0,F.error=null)}),de(),A()},O=C=>L([C]),X=()=>{N()||we.click()},we=_.input({type:"file",class:"jss-upload-input",name:ve(),accept:fe()||null,multiple:p(),capture:e.capture||null,disabled:N(),onChange:C=>{P(C.target.files,{event:C,source:"browse"}),C.target.value=""}}),Be=_.div({class:"jss-upload-list"}),Ue=_.div({class:"jss-upload-summary"}),H=_.div({class:"jss-upload-actions"});let W=E();const ee=_.div({class:re(["jss-upload","jss-singularity",W,pe(e.box||e.variant==="box","jss-upload-box"),pe(e.compact,"is-compact"),pe(U(),"is-form-mode"),pe(!te(),"is-files-hidden"),e.class]),tabindex:N()?"-1":"0",role:"group","aria-disabled":N()?"true":"false"}),Ne={addFiles:P,browse:X,upload:L,retry:O,retryAll:()=>L(l().filter(C=>C.status==="error"||C.status==="canceled")),remove:m,clear:Q,abort:b,abortAll:g,files:()=>l().slice(),state:()=>({files:l().slice(),busy:a(),dragging:i(),error:r()}),reset:Q},Te=()=>{const C={api:Ne,files:l().slice(),busy:a(),disabled:N(),submitMode:U()?"form":"upload"},Se=[];return w()&&Se.push(JSswift.ui.renderSlot(s,"browse",C,xe.Btn({size:"sm",icon:"folder_open",label:e.browseText||"Browse",onClick:X}))),$()&&Se.push(JSswift.ui.renderSlot(s,"upload",C,xe.Btn({size:"sm",color:"primary",icon:"upload",label:e.uploadText||"Upload",loading:a(),disabled:N()||!l().some(Fe=>["queued","error","canceled"].includes(Fe.status)),onClick:()=>L()}))),B()&&Se.push(JSswift.ui.renderSlot(s,"clear",C,xe.Btn({size:"sm",color:"secondary",outline:!0,icon:"delete",label:e.clearText||"Clear",disabled:N()||!l().length,onClick:()=>Q()}))),D(s,"actions",C,Se)},oe=(C,Se)=>{var Fe;const F={item:C,file:C.file,index:Se,api:Ne,remove:()=>m(C),retry:()=>O(C),abort:()=>b(C)},f=_.div({class:re(["jss-upload-file",`is-${C.status}`])},_.div({class:"jss-upload-file-icon"},xe.Icon({name:C.status==="done"?"check_circle":C.status==="error"||C.status==="rejected"?"error":"description"})),_.div({class:"jss-upload-file-main"},_.div({class:"jss-upload-file-name"},...D(s,"fileName",F,C.name)),_.div({class:"jss-upload-file-meta"},...D(s,"fileMeta",F,C.error?String(((Fe=C.error)==null?void 0:Fe.message)||C.error):C.status==="queued"?"Queued":C.status)),_.div({class:"jss-upload-progress",role:"progressbar","aria-valuemin":"0","aria-valuemax":"100","aria-valuenow":String(C.progress||0)},_.div({class:"jss-upload-progress-bar",style:{width:`${C.progress||0}%`}}))),_.div({class:"jss-upload-file-trailing"},_.div({class:"jss-upload-file-size"},ue(C.size)),_.div({class:"jss-upload-file-actions"},...D(s,"fileActions",F,[C.status==="uploading"?xe.Btn({size:"sm",outline:!0,icon:"close","aria-label":"Cancel",onClick:()=>b(C)}):null,C.status==="error"||C.status==="canceled"?xe.Btn({size:"sm",outline:!0,icon:"refresh","aria-label":"Retry",onClick:()=>O(C)}):null,xe.Btn({size:"sm",dense:!0,outline:!0,icon:"delete","aria-label":"Remove",onClick:()=>m(C)})])))),h=JSswift.ui.renderSlot(s,"file",F,f);return _.div({class:"jss-upload-file-wrap","data-status":C.status,"data-id":C.id},...D(null,"default",{},h))},Pe=()=>{const C=l();if(H.replaceChildren(...Te()),Be.replaceChildren(),Ue.hidden=!te(),Be.hidden=!te(),C.length)C.forEach((Fe,F)=>Be.appendChild(oe(Fe,F)));else{const Fe=JSswift.ui.renderSlot(s,"empty",{api:Ne},e.emptyText||"No files selected");Be.appendChild(_.div({class:"jss-upload-empty"},...D(null,"default",{},Fe)))}const Se=C.filter(Fe=>Fe.status!=="rejected"&&Fe.status!=="removed");Ue.textContent=`${Se.length} file \u2022 ${ue(Se.reduce((Fe,F)=>Fe+Number(F.size||0),0))}`},Ie=JSswift.ui.renderSlot(s,"icon",{api:Ne},xe.Icon({name:e.icon||"cloud_upload"})),Le=JSswift.ui.renderSlot(s,"title",{api:Ne},e.title||"Upload files"),Ye=JSswift.ui.renderSlot(s,"subtitle",{api:Ne},e.subtitle||(fe()?`Accepted: ${fe()}`:"Drag files here or browse from your device")),ct=_.div({class:"jss-upload-dropzone",onClick:C=>{var Se,Fe;(Fe=(Se=C.target)==null?void 0:Se.closest)!=null&&Fe.call(Se,".jss-upload-actions, .jss-upload-list")||e.clickable!==!1&&X()},onDragenter:C=>{e.drag===!1||N()||(C.preventDefault(),c(!0),ee.classList.add("is-dragging"))},onDragover:C=>{e.drag===!1||N()||C.preventDefault()},onDragleave:C=>{C.currentTarget===C.target&&(c(!1),ee.classList.remove("is-dragging"))},onDrop:C=>{var Se,Fe;e.drag===!1||N()||(C.preventDefault(),c(!1),ee.classList.remove("is-dragging"),(Se=e.onDrop)==null||Se.call(e,C,{api:Ne}),P(((Fe=C.dataTransfer)==null?void 0:Fe.files)||[],{event:C,source:"drop"}))}},_.div({class:"jss-upload-head"},_.div({class:"jss-upload-icon"},...D(null,"default",{},Ie)),_.div({class:"jss-upload-copy"},_.div({class:"jss-upload-title"},...D(null,"default",{},Le)),_.div({class:"jss-upload-subtitle"},...D(null,"default",{},Ye))),H),Ue,Be),Re=JSswift.ui.renderSlot(s,"header",{api:Ne},null);return D(null,"default",{},Re).forEach(C=>ee.appendChild(C)),ee.appendChild(we),D(s,"default",{api:Ne,dropzone:ct},ct).forEach(C=>ee.appendChild(C)),JSswift.reactive.effect(()=>{Pe()},"UI.Upload:render"),JSswift.reactive.effect(()=>{ee.classList.toggle("is-disabled",N()),ee.classList.toggle("is-form-mode",U()),ee.classList.toggle("is-files-hidden",!te());const C=E();C!==W&&(W&&ee.classList.remove(W),C&&ee.classList.add(C),W=C),ee.setAttribute("aria-disabled",N()?"true":"false"),we.disabled=N(),we.multiple=p(),we.name=ve()},"UI.Upload:disabled"),ee._upload=Ne,ee._addFiles=P,ee._browse=X,ee._uploadFiles=L,ee._input=we,ee._dispose=()=>{k||(k=!0,g())},(t=JSswift._registerCleanup)==null||t.call(JSswift,ee,ee._dispose),ee},xe.BoxUpload=(e={})=>xe.Upload({...e,box:!0}),xe.boxUpload=(e={})=>xe.BoxUpload(e),JSswift.ui.Upload=xe.Upload,JSswift.ui.BoxUpload=xe.BoxUpload,JSswift.ui.boxUpload=xe.boxUpload;function en(e,t){if(!e)return null;if(typeof e=="object"&&typeof e._bind=="function")return{get:()=>e.value,set:s=>{e.value!==s&&(e.value=s)},watch:s=>{var l;return(l=e.action)==null||l.call(e,s),()=>{var n,i;const c=(i=(n=e._actions)==null?void 0:n.indexOf(s))!=null?i:-1;c>=0&&e._actions.splice(c,1)}}};if(Array.isArray(e)&&typeof e[0]=="function"&&typeof e[1]=="function"){const s=e[0],l=e[1];return{get:s,set:l,watch:n=>wt.reactive.effect(()=>{n(s())},t||"UI:model")}}return null}const yn={classic:{side:"left",nav:"top",rows:["header","nav","body","footer"]},classicright:{side:"right",nav:"top",rows:["header","nav","body","footer"]},sidebarfullleft:{side:"left",fullSide:!0,nav:"top",rows:["header","nav","body","footer"]},sidebarfullright:{side:"right",fullSide:!0,nav:"top",rows:["header","nav","body","footer"]},appshell:{side:"left",nav:"top",rows:["header","nav","body","footer"]},dashboard:{side:"left",nav:"top",rows:["header","nav","body","footer"]},website:{side:null,nav:"top",rows:["header","nav","body","footer"]},documentation:{side:"right",nav:"left",rows:["header","body","footer"]},landing:{side:null,nav:null,rows:["header","body","footer"]}},Mn=e=>{const t=o(e);return t==null||t===!1||t===""?"":String(t).trim().toLowerCase().replace(/[\s_-]+/g,"")},Ao=(e,t)=>{if(!e||!t.main)return null;const s=e.side||(t.aside?"left":null),l=e.nav||(t.nav?"top":null),n=!!t.aside&&!!s,i=!!t.nav&&!!l,v=[i&&l==="left"?"nav":n&&s==="left"?"aside":".","main",i&&l==="right"?"nav":n&&s==="right"?"aside":"."],r=[],z=[...e.rows||[]];if(i&&l==="top"&&!z.includes("nav")){const d=z.indexOf("body");z.splice(d>=0?d:z.length,0,"nav")}for(const d of z)d==="header"&&t.header?r.push(e.fullSide&&n&&s==="left"?["aside","header","header"]:e.fullSide&&n&&s==="right"?["header","header","aside"]:["header","header","header"]):d==="nav"&&i&&l==="top"?r.push(e.fullSide&&n&&s==="left"?["aside","nav","nav"]:e.fullSide&&n&&s==="right"?["nav","nav","aside"]:["nav","nav","nav"]):d==="body"?r.push(v):d==="footer"&&t.footer&&r.push(e.fullSide&&n&&s==="left"?["aside","footer","footer"]:e.fullSide&&n&&s==="right"?["footer","footer","aside"]:["footer","footer","footer"]);return r.length?r.map(d=>`"${d.join(" ")}"`).join(" "):null};xe.Layout=(...e)=>{var t,s,l;const{props:n,children:i}=JSswift.uiNormalizeArgs(e),c=n.slots||{},a=(Ze,bt)=>!!Ze&&Object.prototype.hasOwnProperty.call(Ze,bt),v=()=>typeof window=="undefined"?1024:window.innerWidth,r=()=>{const Ze=v(),bt=JSswift.uiResponsivePropsFor(n,kt("mobile"))||{},Ft=Ze>=768?JSswift.uiResponsivePropsFor(n,kt("tablet"))||{}:{},Dt=Ze>=1024?JSswift.uiResponsivePropsFor(n,kt("pc"))||{}:{};return{...bt,...Ft,...Dt}},z=(...Ze)=>{for(const bt of Ze)if(a(n,bt))return n[bt]},d=(...Ze)=>{const bt=r();for(const Ft of Ze)if(a(bt,Ft))return bt[Ft];return z(...Ze)},k=(...Ze)=>{const bt=JSswift.uiResponsivePropsFor(n,kt(oe()))||{};for(const Ft of Ze)if(a(bt,Ft))return bt[Ft];return z(...Ze)},N=()=>Mn(k("disposition","layoutDisposition","layout")),p=()=>{const Ze=o(d("mode","layoutMode"));if(Ze==null||Ze===!1||Ze==="")return"";const bt=String(Ze).trim().toLowerCase();return bt==="global"||bt==="local"?bt:""},U=(Ze,bt=null)=>Ze==null||Ze===!1||Ze===""?bt:typeof Ze=="number"?`${Ze}px`:String(Ze),w=(Ze,bt=null)=>{if(Ze==null||Ze===!1||Ze==="")return bt;if(typeof Ze=="number"&&Number.isFinite(Ze))return Ze;const Ft=Number.parseFloat(String(Ze));return Number.isFinite(Ft)?Ft:bt},$=Ze=>{const bt=o(Ze);return bt==null||bt===!1||bt===""?null:Array.isArray(bt)?bt.map(Ft=>`"${Array.isArray(Ft)?Ft.join(" "):String(Ft)}"`).join(" "):String(bt)},B=(Ze,bt=null,Ft=null)=>{let Dt=Number.isFinite(Ze)?Ze:0;return Number.isFinite(bt)&&(Dt=Math.max(bt,Dt)),Number.isFinite(Ft)&&(Dt=Math.min(Ft,Dt)),Dt},te=z("header","headerContent"),E=z("aside","drawer"),ve=z("nav","asideRight","drawerRight"),le=z("page","main","content","body"),ie=z("footer","footerContent"),ge=()=>o(d("drawerEnabled","asideEnabled")),ue=()=>o(d("navEnabled","asideRightEnabled","rightAsideEnabled")),fe=()=>ge()!==!1,M=()=>ue()===!0||o(d("noNav"))===!1,me=()=>o(d("noDrawer"))===!0||ge()===!1||E===!1,be=()=>o(d("noNav"))===!0||ue()===!1||ve===!1,de=()=>o(d("drawerFloating"))===!0,Z=()=>o(d("navFloating"))===!0,j=()=>o(d("drawerResizable"))===!0,I=()=>o(d("navResizable"))===!0,y=()=>w(o(d("drawerMinWidth")),180),P=()=>w(o(d("drawerMaxWidth")),null),Q=()=>w(o(d("navMinWidth")),180),m=()=>w(o(d("navMaxWidth")),null),b=w(o(d("drawerWidth")),280),g=w((t=o(d("navWidth")))!=null?t:o(d("asideRightWidth")),280),[T,Y]=JSswift.reactive.signal(B(b,y(),P())),[K,_e]=JSswift.reactive.signal(B(g,Q(),m())),J=en(n.drawerOpen,"UI.Layout:drawerOpen"),A=J?!!J.get():typeof n.drawerOpen=="boolean"?!!n.drawerOpen:!0,[L,O]=JSswift.reactive.signal(A),X=Ze=>{const bt=!!Ze;L()!==bt&&O(bt),J==null||J.set(bt)},we=(s=J==null?void 0:J.watch)==null?void 0:s.call(J,()=>{const Ze=!!J.get();L()!==Ze&&O(Ze)}),Be=en(n.navOpen,"UI.Layout:navOpen"),Ue=Be?!!Be.get():typeof n.navOpen=="boolean"?!!n.navOpen:!0,[H,W]=JSswift.reactive.signal(Ue),ee=Ze=>{const bt=!!Ze;H()!==bt&&W(bt),Be==null||Be.set(bt)},Ne=(l=Be==null?void 0:Be.watch)==null?void 0:l.call(Be,()=>{const Ze=!!Be.get();H()!==Ze&&W(Ze)}),Te=()=>{var Ze,bt,Ft;const Dt=Number((Ze=o(d("layoutBreakpoint")))!=null?Ze:0),nn=Number((bt=o(d("drawerBreakpoint")))!=null?bt:Dt||1024),Qt=Number((Ft=o(d("navBreakpoint")))!=null?Ft:Dt||nn);return Math.max(nn,Qt,0)},oe=()=>{const Ze=v();return Ze>=1024?"pc":Ze>=768?"tablet":"mobile"},[Pe,Ie]=JSswift.reactive.signal(!1),[Le,Ye]=JSswift.reactive.signal(oe()),ct=()=>{typeof window!="undefined"&&(Ye(oe()),Ie(window.innerWidth<Te()))};typeof window!="undefined"&&(ct(),window.addEventListener("resize",ct));const Re=()=>({props:n,openAside:()=>X(!0),closeAside:()=>X(!1),toggleAside:()=>X(!L()),openNav:()=>ee(!0),closeNav:()=>ee(!1),toggleNav:()=>ee(!H()),isDrawerOpen:()=>!!L(),isNavOpen:()=>!!H(),isMobile:()=>!!Pe(),isDrawerFloating:()=>de(),isNavFloating:()=>Z()}),C=(Ze,bt)=>{const Ft=Re();for(const nn of Ze){if(!a(c,nn))continue;const Qt=typeof c[nn]=="function"?c[nn](Ft):c[nn];return D(null,"default",Ft,Qt)}const Dt=typeof bt=="function"?bt(Ft):bt;return D(null,"default",Ft,Dt)},Se=le!==void 0?le:i,Fe=re(["jss-app","jss-layout",JSswift.uiResponsiveClasses({mobile:n},Rt),JSswift.uiResponsiveClasses(n,Rt),n.class]),F=JSswift.omit(n,["header","headerContent","aside","drawer","nav","asideRight","drawerRight","page","main","content","body","footer","footerContent","noDrawer","drawerEnabled","asideEnabled","noNav","navEnabled","asideRightEnabled","rightAsideEnabled","drawerOpen","navOpen","layoutBreakpoint","drawerBreakpoint","navBreakpoint","drawerWidth","navWidth","asideRightWidth","drawerResizable","drawerMinWidth","drawerMaxWidth","navResizable","navMinWidth","navMaxWidth","drawerPeek","navPeek","asideRightPeek","drawerFloating","navFloating","overlayClose","escClose","stickyHeader","stickyFooter","stickyAside","stickyNav","tagPage","mode","layoutMode","disposition","layoutDisposition","layout","shellClass","headerClass","asideClass","navClass","pageClass","footerClass","overlayClass","gap","headerOffset","minHeight","areas","gridTemplateAreas","templateAreas","slots"]);F.class=Fe,F.style={...n.style||{}},JSswift.uiApplyResponsiveProps(F,n,JSswift.uiResponsiveStyleRules);const f=_.div(F);we&&JSswift._registerCleanup(f,we),Ne&&JSswift._registerCleanup(f,Ne);const x=o(d("tagPage"))===!0?{header:"header",aside:"aside",nav:"nav",page:"main",footer:"footer"}:{header:"div",aside:"div",nav:"div",page:"div",footer:"div"},ae=_.div({class:re(["jss-layout-shell-grid",n.shellClass])}),Oe=_[x.header]({class:re(["jss-layout-section","jss-layout-header","header",pe(n.stickyHeader,"sticky"),n.headerClass])}),De=_[x.aside]({class:re(["jss-layout-section","jss-layout-aside","aside",pe(n.stickyAside!==!1,"sticky"),n.asideClass]),role:"navigation","aria-hidden":"true"}),Ge=_.div({class:"jss-layout-panel-body jss-layout-aside-body"}),Ke=_.div({class:"jss-layout-resize-handle jss-layout-resize-handle-drawer","aria-hidden":"true"});De.appendChild(Ge),De.appendChild(Ke);const We=_[x.nav]({class:re(["jss-layout-section","jss-layout-nav","nav",pe(n.stickyNav,"sticky"),n.navClass]),role:x.nav==="nav"?null:"complementary","aria-hidden":"true"}),et=_.div({class:"jss-layout-panel-body jss-layout-nav-body"}),tt=_.div({class:"jss-layout-resize-handle jss-layout-resize-handle-nav","aria-hidden":"true"});We.appendChild(et),We.appendChild(tt);const dt=_[x.page]({class:re(["jss-layout-section","jss-layout-main","main",n.pageClass]),role:x.page==="main"?null:"main"}),gt=_[x.footer]({class:re(["jss-layout-section","jss-layout-footer","footer",pe(n.stickyFooter,"sticky"),n.footerClass])});ae.appendChild(Oe),ae.appendChild(De),ae.appendChild(dt),ae.appendChild(We),ae.appendChild(gt),f.appendChild(ae);const At=_.div({class:re(["jss-aside-overlay",n.overlayClass]),onClick:()=>{o(d("overlayClose"))!==!1&&(L()&&X(!1),H()&&ee(!1))}});f.appendChild(At);let It=!1,$t=!1,zt=!1,Xe=!1,mt=!1,Nt=null,Zt=null;const rn=Ze=>{!Ze||typeof Ze!="object"||(typeof Ze._dispose=="function"&&Ze._dispose(),!(!Ze.childNodes||!Ze.childNodes.length)&&Array.from(Ze.childNodes).forEach(rn))},qt=Ze=>{Ze&&Array.from(Ze.childNodes).forEach(bt=>{rn(bt),bt.remove()})},Yt=Ze=>{const bt=Re(),Ft=typeof Ze=="function"?Ze(bt):Ze;return D(null,"default",bt,Ft)},cn=()=>{const Ze=It?Oe.getBoundingClientRect().height:0;f.style.setProperty("--layout-header-height",`${Ze}px`)},Xt=(Ze,bt)=>(qt(Ze),bt.forEach(Ft=>Ze.appendChild(Ft)),bt.length>0),Ut=()=>{var Ze,bt,Ft,Dt,nn,Qt;f.style.setProperty("--jss-layout-drawer-width",U((Ze=o(d("drawerWidth")))!=null?Ze:280,"280px")),f.style.setProperty("--jss-layout-nav-width",U((Ft=(bt=o(d("navWidth")))!=null?bt:o(d("asideRightWidth")))!=null?Ft:280,"280px")),f.style.setProperty("--jss-layout-drawer-peek",U((Dt=o(d("drawerPeek")))!=null?Dt:20,"20px")),f.style.setProperty("--jss-layout-nav-peek",U((Qt=(nn=o(d("navPeek")))!=null?nn:o(d("asideRightPeek")))!=null?Qt:20,"20px"));const S=U(o(d("gap")),null);S!=null?f.style.setProperty("--jss-layout-gap",S):f.style.removeProperty("--jss-layout-gap");const he=U(o(d("headerOffset")),null);he!=null&&f.style.setProperty("--layout-header-height",he);const Je=U(o(d("minHeight")),null);Je!=null?f.style.setProperty("--jss-layout-min-height",Je):f.style.removeProperty("--jss-layout-min-height")},tn=()=>{if(j()){const Ze=B(T(),y(),P());Ze!==T()&&Y(Ze),f.style.setProperty("--jss-layout-drawer-width",`${Ze}px`)}if(I()){const Ze=B(K(),Q(),m());Ze!==K()&&_e(Ze),f.style.setProperty("--jss-layout-nav-width",`${Ze}px`)}},ln=(Ze,bt)=>{if(bt.button!==0)return;const Ft=Ze==="drawer"?De:We;if(Ft.hidden)return;const Dt=Ze==="drawer"?T:K,nn=Ze==="drawer"?Y:_e,Qt=Ze==="drawer"?y:Q,S=Ze==="drawer"?P:m,he=Ft.getBoundingClientRect(),Je=he.width||Dt(),ft=ot=>{const _t=Ze==="drawer"?ot.clientX-he.left:he.right-ot.clientX;nn(B(_t||Je,Qt(),S())),tn(),gn()},pt=()=>{f.classList.remove("is-resizing-layout"),document.removeEventListener("pointermove",ft,!0),document.removeEventListener("pointerup",pt,!0),Zt=null};f.classList.add("is-resizing-layout"),document.addEventListener("pointermove",ft,!0),document.addEventListener("pointerup",pt,!0),Zt=pt,bt.preventDefault()},Xn=Ze=>ln("drawer",Ze),bn=Ze=>ln("nav",Ze);Ke.addEventListener("pointerdown",Xn),tt.addEventListener("pointerdown",bn);const gn=()=>{const Ze=!!Pe(),bt=!!L(),Ft=!!H(),Dt=!me()&&fe()&&$t,nn=!be()&&M()&&zt,Qt=Dt&&(Ze||de()),S=nn&&(Ze||Z()),he=Dt&&bt,Je=nn&&Ft,ft=he&&!Qt,pt=Je&&!S,ot=ft&&j(),_t=pt&&I(),Mt=he&&Qt||Je&&S;Ut(),tn(),f.classList.toggle("is-mobile",Ze),f.classList.toggle("drawer-open",he),f.classList.toggle("nav-open",Je),f.classList.toggle("no-drawer",!Dt),f.classList.toggle("no-nav",!nn),f.classList.toggle("has-header",It),f.classList.toggle("has-drawer",Dt),f.classList.toggle("has-nav",nn),f.classList.toggle("has-footer",mt),f.classList.toggle("drawer-floating",Qt),f.classList.toggle("nav-floating",S);const Gt=N(),un=Gt?p():"";f.dataset.disposition=Gt||"",f.dataset.layoutMode=un||"",f.classList.toggle("has-disposition",!!Gt),f.classList.toggle("mode-local",un==="local"),f.classList.toggle("mode-global",un==="global"),Oe.classList.toggle("sticky",o(d("stickyHeader"))===!0),gt.classList.toggle("sticky",o(d("stickyFooter"))===!0),De.classList.toggle("sticky",o(d("stickyAside"))!==!1),We.classList.toggle("sticky",o(d("stickyNav"))===!0),Oe.hidden=!It,gt.hidden=!mt,dt.hidden=!Xe,At.hidden=!(Qt||S),At.classList.toggle("show",Mt),De.hidden=!Dt||!he&&!Qt,De.classList.toggle("open",he),De.classList.toggle("is-floating",Qt),De.classList.toggle("is-resizable",ot),De.setAttribute("aria-hidden",he?"false":"true"),Ke.hidden=!ot,We.hidden=!nn||!Je&&!S,We.classList.toggle("open",Je),We.classList.toggle("is-floating",S),We.classList.toggle("is-resizable",_t),We.setAttribute("aria-hidden",Je?"false":"true"),tt.hidden=!_t;const an=yn[Gt]||null,jn=(an==null?void 0:an.side)||(ft&&an?"left":null),_n=(an==null?void 0:an.nav)||(pt&&an?"top":null),dn=ft?an?jn:"left":"",Cn=pt?an?_n==="left"||_n==="right"?_n:"":"right":"";f.classList.toggle("drawer-left",Dt&&jn==="left"),f.classList.toggle("drawer-right",Dt&&jn==="right"),f.classList.toggle("nav-top",pt&&_n==="top"),f.classList.toggle("nav-side",pt&&(Cn==="left"||Cn==="right")),ae.style.gridTemplateColumns=[dn==="left"?"minmax(0, var(--jss-layout-drawer-width))":Cn==="left"?"minmax(0, var(--jss-layout-nav-width))":"0px","minmax(0, 1fr)",dn==="right"?"minmax(0, var(--jss-layout-drawer-width))":Cn==="right"?"minmax(0, var(--jss-layout-nav-width))":"0px"].join(" ");const Zn=['"header header header"',`"${ft?"aside":"."} main ${pt?"nav":"."}"`,'"footer footer footer"'].join(" "),es=Ao(yn[Gt],{header:It,aside:ft,nav:pt,main:Xe,footer:mt});ae.style.gridTemplateAreas=$(k("areas","gridTemplateAreas","templateAreas"))||es||Zn},hs=(Ze,bt)=>(It=Xt(Oe,Yt(Ze)),cn(),gn(),bt&&JSswift.router.setURLOnly(bt),Oe),mn=(Ze,bt)=>($t=Xt(Ge,Yt(Ze)),$t||X(!1),gn(),bt&&JSswift.router.setURLOnly(bt),De),wn=(Ze,bt)=>(zt=Xt(et,Yt(Ze)),zt||ee(!1),gn(),bt&&JSswift.router.setURLOnly(bt),We),Qn=(Ze,bt)=>(Xe=Xt(dt,Yt(Ze)),gn(),bt&&JSswift.router.setURLOnly(bt),dt),rs=(Ze,bt)=>(mt=Xt(gt,Yt(Ze)),gn(),bt&&JSswift.router.setURLOnly(bt),gt);It=Xt(Oe,C(["header"],te)),$t=Xt(Ge,E===!1?[]:C(["aside","drawer"],E)),zt=Xt(et,ve===!1?[]:C(["nav","asideRight","drawerRight"],ve)),Xe=Xt(dt,C(["page","main","default"],Se)),mt=Xt(gt,C(["footer"],ie)),typeof ResizeObserver!="undefined"&&(Nt=new ResizeObserver(()=>cn()),Nt.observe(Oe)),cn(),JSswift.reactive.effect(()=>{Le(),Pe(),L(),H(),gn()},"UI.Layout:state");const Ls=Ze=>{o(d("escClose"))!==!1&&(!Pe()&&!de()&&!Z()||!L()&&!H()||Ze.key==="Escape"&&(Ze.preventDefault(),L()&&X(!1),H()&&ee(!1)))};return typeof document!="undefined"&&document.addEventListener("keydown",Ls,!0),f.openAside=()=>X(!0),f.closeAside=()=>X(!1),f.toggleAside=()=>X(!L()),f.openNav=()=>ee(!0),f.closeNav=()=>ee(!1),f.toggleNav=()=>ee(!H()),f.isDrawerOpen=()=>!!L(),f.isNavOpen=()=>!!H(),f.isMobile=()=>!!Pe(),f.header=()=>Oe,f.aside=()=>De,f.drawer=()=>De,f.nav=()=>We,f.page=()=>dt,f.main=()=>dt,f.footer=()=>gt,f.headerUpdate=hs,f.asideUpdate=mn,f.drawerUpdate=mn,f.navUpdate=wn,f.pageUpdate=Qn,f.mainUpdate=Qn,f.footerUpdate=rs,f.reflow=gn,f._dispose=()=>{var Ze;typeof window!="undefined"&&window.removeEventListener("resize",ct),typeof document!="undefined"&&document.removeEventListener("keydown",Ls,!0),Ke.removeEventListener("pointerdown",Xn),tt.removeEventListener("pointerdown",bn),Zt==null||Zt(),(Ze=Nt==null?void 0:Nt.disconnect)==null||Ze.call(Nt)},Et(f,n),gn(),f},xe.Footer=(...e)=>{var t,s,l;const{props:n,children:i}=JSswift.uiNormalizeArgs(e),c=n.slots||{},a=I=>Object.prototype.hasOwnProperty.call(n,I),v={props:n},r=(I,y)=>{if(!(y==null||y===!1)){if(Array.isArray(y)){y.forEach(P=>r(I,P));return}if(y!=null&&y.nodeType){I.appendChild(y);return}I.appendChild(document.createTextNode(String(y)))}},z=(I,y,P=Q=>Q)=>{const Q=JSswift.ui.getSlot(c,I);if(Q!=null)return D(c,I,v,null);if(typeof y=="function"){const m=new Set(["eyebrow","title","subtitle"]),b=_[m.has(I)?"span":"div"]({class:`jss-footer-slot-${I}`});return JSswift.reactive.effect(()=>{const g=P(y(v)),T=Ln(JSswift.ui.slot(g));b.replaceChildren(),Array.isArray(T)?T.forEach(Y=>r(b,Y)):r(b,T)},`UI.Footer:${I}`),[b]}return D(c,I,v,P(y))},d=(I,y="icon",P=n.iconSize||n.size||"md")=>I==null||I===!1?null:typeof I=="string"?xe.Icon({name:I,size:P}):JSswift.ui.slot(I,{as:y}),k=a("left")?n.left:n.start,N=a("right")?n.right:n.end,p=a("title")?n.title:n.label,U=(s=(t=n.subtitle)!=null?t:n.description)!=null?s:n.note,w=a("content")?n.content:a("body")?n.body:i!=null&&i.length?i:null,$=[...z("left",k),...z("start",null)],B=z("icon",n.icon,d),te=z("eyebrow",(l=n.eyebrow)!=null?l:n.kicker),E=z("title",p),ve=z("subtitle",U),le=z("meta",n.meta),ie=(()=>{const I=z("content",null);return I.length?I:z("default",w)})(),ge=[...z("center",null),...z("body",null)],ue=[...z("right",N),...z("end",null)],fe=z("actions",n.actions),M=_.div({class:re(["jss-footer-body",n.bodyClass,n.centerClass])},_.div({class:"jss-footer-heading"},B.length?_.div({class:"jss-footer-icon"},...B):null,_.div({class:"jss-footer-copy"},te.length?_.div({class:re(["jss-footer-eyebrow",n.eyebrowClass])},...te):null,E.length?_.div({class:re(["jss-footer-title",n.titleClass])},...E):null,ve.length?_.div({class:re(["jss-footer-subtitle",n.subtitleClass])},...ve):null,ie.length?_.div({class:re(["jss-footer-content",n.contentClass])},...ie):null),le.length?_.div({class:re(["jss-footer-meta",n.metaClass])},...le):null)),me=[];ge.length?me.push(_.div({class:re(["jss-footer-body",n.bodyClass,n.centerClass])},...ge)):(B.length||te.length||E.length||ve.length||ie.length||le.length)&&me.push(M),(ue.length||fe.length)&&me.push(_.div({class:re(["jss-footer-end",n.endClass])},...ue,...fe.length?[_.div({class:re(["jss-footer-actions",n.actionsClass])},...fe)]:[]));const be=JSswift.omit(n,["actions","actionsClass","align","body","bodyClass","center","centerClass","content","contentClass","dense","description","divider","elevated","end","endClass","eyebrow","eyebrowClass","gap","icon","iconSize","kicker","label","left","meta","metaClass","minHeight","note","right","slots","stack","start","startClass","sticky","subtitle","subtitleClass","title","titleClass","wrap","justify"]);be.class=re(["jss-panel","jss-footer","jss-singularity",pe(n.sticky,"sticky"),pe(n.dense,"dense"),pe(n.elevated,"elevated"),pe(n.divider!==!1,"divider"),pe(n.stack,"stack"),$n(n.align,"align-"),n.class]),be.style={...n.style||{}};const de=qe(n.justify);de!=null&&(be.style.justifyContent=de);const Z=qe(n.wrap,I=>I?"wrap":"nowrap");Z!=null&&(be.style.flexWrap=Z),n.gap!=null&&(be.style["--jss-footer-gap"]=vt(o(n.gap))),n.minHeight!=null&&(be.style.minHeight=vt(o(n.minHeight))),JSswift.uiApplyResponsiveProps(be,n,JSswift.uiResponsiveStyleRules);const j=_.footer(be,...$.length?[_.div({class:re(["jss-footer-start",n.startClass])},...$)]:[],...me.length?[_.div({class:"jss-footer-main"},...me)]:[]);return Et(j,n),j};const hi=e=>{const t=[];for(const s of e||[]){const l=Ln(JSswift.ui.slot(s));l&&(Array.isArray(l)?t.push(...l):t.push(l))}return t},Bs=(e,t)=>{const s=Ln(JSswift.ui.slot(e,t));return s?Array.isArray(s)?s:[s]:[]},vt=e=>{var t;return typeof e=="number"?`${e}px`:typeof e=="string"&&((t=JSswift.uiSizes)!=null&&t.includes(e))?`var(--jss-size-${e})`:String(e)};xe.Toolbar=(...e)=>{var t,s,l,n,i,c,a,v;const{props:r,children:z}=JSswift.uiNormalizeArgs(e),d=r.slots||{},k=(K,_e,J={})=>{const A=Array.isArray(K)?K:[K];for(const L of A)if(JSswift.ui.getSlot(d,L)!=null)return D(d,L,J,_e);return _e==null?[]:D(null,"default",J,_e)},N=K=>(Array.isArray(K)?K:[K]).some(J=>JSswift.ui.getSlot(d,J)!=null),p={props:r},U=k(["before"],r.before,p),w=k(["start","left"],(t=r.start)!=null?t:r.left,p),$=k(["center","body","content","default"],(n=(l=(s=r.center)!=null?s:r.body)!=null?l:r.content)!=null?n:z,p),B=k(["end","right","actions"],(c=(i=r.end)!=null?i:r.right)!=null?c:r.actions,p),te=k(["after"],r.after,p),E=k(["title"],r.title,p),ve=k(["subtitle"],r.subtitle,p),le=k(["meta"],r.meta,p),ie=!!(U.length||w.length||B.length||te.length||E.length||ve.length||le.length||r.before!=null||r.start!=null||r.left!=null||r.end!=null||r.right!=null||r.actions!=null||r.after!=null||r.title!=null||r.subtitle!=null||r.meta!=null||r.body!=null||r.center!=null||r.content!=null||r.beforeClass||r.startClass||r.bodyClass||r.centerClass||r.contentClass||r.endClass||r.afterClass||r.titleClass||r.subtitleClass||r.metaClass||r.copyClass||N(["before","start","left","center","body","content","end","right","actions","after","title","subtitle","meta"])),ge=re(["jss-toolbar",pe(ie,"structured"),pe(r.dense,"dense"),pe(r.divider,"divider"),pe(r.elevated,"elevated"),pe(r.sticky,"sticky"),r.class]),ue=JSswift.omit(r,["actions","after","afterClass","align","before","beforeClass","body","bodyClass","center","centerClass","content","contentClass","copyClass","dense","divider","elevated","end","endClass","gap","justify","left","meta","metaClass","right","size","slots","start","startClass","sticky","subtitle","subtitleClass","title","titleClass","wrap"]);ue.class=ge;const fe={...r.style||{}};fe.display=fe.display||"flex";const M=qe(r.align),me=qe(r.justify),be=qe(r.wrap,K=>typeof K=="boolean"?K?"wrap":"nowrap":String(K),"wrap"),de=qe(r.gap,vt,"var(--jss-s-md)"),Z=nt(r,"gap");fe["--jss-toolbar-gap"]=de!=null?de:"var(--jss-s-md)",Z||(fe.gap=fe.gap||"var(--jss-toolbar-gap)");const j={xxs:"4px 6px",xs:"6px 8px",sm:"6px 10px",md:"10px 12px",lg:"12px 16px",xl:"14px 18px",xxl:"16px 20px"},I=qe(r.size,K=>j[K]||"");if(I!=null&&(fe.padding=I),ie?(fe.flexDirection=fe.flexDirection||"column",fe.alignItems=fe.alignItems||"stretch"):(M!=null&&(fe.alignItems=M),me!=null&&(fe.justifyContent=me),be!=null&&(fe.flexWrap=be)),Object.keys(fe).length&&(ue.style=fe),JSswift.uiApplyResponsiveProps(ue,r,JSswift.uiResponsiveStyleRules),!ie){const K=D(d,"default",p,z),_e=_.div(ue,...K);return Et(_e,r),_e}const y=(v=(a=r.bodyClass)!=null?a:r.centerClass)!=null?v:r.contentClass,P=xt([r.justify],()=>{const K=o(r.justify);return!K||K==="flex-start"?"auto":""}),Q={display:"flex",alignItems:"inherit",gap:"var(--jss-toolbar-gap)",flexWrap:"inherit",minWidth:0},m={};M!=null&&(m.alignItems=M),me!=null&&(m.justifyContent=me),be!=null&&(m.flexWrap=be);const b=le.length||E.length||ve.length?_.div({class:re(["jss-toolbar-copy",r.copyClass])},le.length?_.div({class:re(["jss-toolbar-meta",r.metaClass])},...le):null,E.length?_.div({class:re(["jss-toolbar-title",r.titleClass])},...E):null,ve.length?_.div({class:re(["jss-toolbar-subtitle",r.subtitleClass])},...ve):null):null,g=!!(w.length||b||$.length||B.length),T=[U.length?_.div({class:re(["jss-toolbar-before",r.beforeClass]),style:{...Q}},...U):null,g?_.div({class:"jss-toolbar-main",style:m},w.length?_.div({class:re(["jss-toolbar-start",r.startClass]),style:{...Q}},...w):null,b||$.length?_.div({class:re(["jss-toolbar-center",y]),style:{...Q,flex:"1 1 240px"}},b,...$):null,B.length?_.div({class:re(["jss-toolbar-end",r.endClass]),style:{...Q,justifyContent:"flex-end",marginInlineStart:P}},...B):null):null,te.length?_.div({class:re(["jss-toolbar-after",r.afterClass]),style:{...Q}},...te):null].filter(Boolean),Y=_.div(ue,...T);return Et(Y,r),Y};const Lo=e=>{var t;return e&&e.nodeType===1&&((t=e.classList)==null?void 0:t.contains("jss-grid-col"))};xe.Grid=(...e)=>{var t,s,l,n;const{props:i,children:c}=JSswift.uiNormalizeArgs(e),a=i.slots||{},v=o(i.items),r=Array.isArray(v)?v:v==null?[]:[v],z=(m={})=>{const b=i.itemProps||{},g={...b,...m};return g.class=re([b.class,i.itemClass,m.class]),g.style={...b.style||{},...i.itemStyle||{},...m.style||{}},g},d=(m,b={})=>{if(m==null||m===!1)return[];if(Lo(m))return[m];if(ds(m)){const g=m.children!=null?Dn(m.children):m.content!=null?Dn(m.content):m.node!=null?Dn(m.node):m.label!=null?Dn(m.label):[];return[xe.GridCol(z(m),...g)]}return Array.isArray(m)?[xe.GridCol(z(b),...m)]:[xe.GridCol(z(b),m)]},k=(m,b,g,T=!0)=>{if(m==null||m===!1)return[];const Y=ds(m)?m:{};if(T){const K={item:m,index:b,count:g,first:b===0,last:b===g-1},_e=D(a,"item",K,null);if(_e.length)return _e.flatMap(J=>d(J,Y))}return d(m,Y)},N=[];r.forEach((m,b)=>{N.push(...k(m,b,r.length))}),D(a,"default",{items:r,count:r.length},c).forEach(m=>{N.push(...d(m))}),N.length||D(a,"empty",{items:r,count:0},i.empty).forEach(b=>{const g=d(b,{style:{gridColumn:"1 / -1"}});N.push(...g)});const U=re(["jss-grid",JSswift.uiResponsiveClasses({mobile:i},Jt),JSswift.uiResponsiveClasses(i,Jt),pe(i.dense,"dense"),pe(i.inline,"jss-grid-inline"),pe(i.debug,"jss-grid-debug"),i.class]),w=JSswift.omit(i,["gap","rowGap","columnGap","colGap","cols","columns","rows","areas","align","justify","alignItems","justifyItems","placeItems","placeContent","dense","flow","inline","debug","autoFit","autoFill","min","max","autoRows","items","itemClass","itemStyle","itemProps","empty","slots","full","width","minWidth","maxWidth","padding",...JSswift.uiResponsiveOmitProps]);w.class=U;const $={...i.style||{}};(t=JSswift.uiResponsiveHasConfig)!=null&&t.call(JSswift,i)&&i.display==null&&!nt(i,"display")&&$.display==null&&($.display=i.inline?"inline-grid":"grid");const B=qe(i.gap,vt);B!=null&&!nt(i,"gap")&&($["--jss-grid-gap"]=B,$.gap=B);const te=qe(i.rowGap,vt);te!=null&&!nt(i,"rowGap")&&($.rowGap=te);const E=qe((s=i.columnGap)!=null?s:i.colGap,vt);E!=null&&!nt(i,["columnGap","colGap"])&&($.columnGap=E);const ve=qe(i.max,vt,"1fr"),le=qe(i.min,vt);if(le!=null){const m=o(i.autoFill)?"auto-fill":"auto-fit";$.gridTemplateColumns=`repeat(${m}, minmax(${le}, ${ve||"1fr"}))`}else{const m=qe((l=i.columns)!=null?l:i.cols,b=>typeof b=="number"?`repeat(${b}, minmax(0, 1fr))`:String(b));m!=null&&!nt(i,["cols","columns"])&&($.gridTemplateColumns=m)}const ie=qe(i.rows,m=>typeof m=="number"?`repeat(${m}, minmax(0, auto))`:String(m));ie!=null&&($.gridTemplateRows=ie);const ge=qe(i.autoRows,vt);ge!=null&&($.gridAutoRows=ge);const ue=qe(i.flow,m=>{const b=String(m);return i.dense&&!b.includes("dense")?`${b} dense`:b});ue!=null&&!nt(i,"flow")&&($.gridAutoFlow=ue);const fe=qe(i.areas,m=>Array.isArray(m)?m.map(b=>`"${Array.isArray(b)?b.join(" "):String(b)}"`).join(" "):String(m));fe!=null&&($.gridTemplateAreas=fe);const M=qe((n=i.align)!=null?n:i.alignItems);M!=null&&!nt(i,["align","alignItems"])&&($.alignItems=M);const me=qe(i.justify);me!=null&&!nt(i,"justify")&&($.justifyContent=me);const be=qe(i.justifyItems);be!=null&&($.justifyItems=be);const de=qe(i.placeItems);de!=null&&($.placeItems=de);const Z=qe(i.placeContent);Z!=null&&($.placeContent=Z);const j=qe(i.width,vt);j!=null&&!nt(i,"width")&&($.width=j),o(i.full)===!0&&($.width="100%");const I=qe(i.minWidth,vt);I!=null&&!nt(i,"minWidth")&&($.minWidth=I);const y=qe(i.maxWidth,vt);y!=null&&!nt(i,"maxWidth")&&($.maxWidth=y);const P=qe(i.padding,vt);P!=null&&!nt(i,"padding")&&($.padding=P),Object.keys($).length&&(w.style=$),JSswift.uiApplyResponsiveProps(w,i,JSswift.uiResponsiveStyleRules);const Q=_.div(w,...N);return Et(Q,i),Q},xe.GridCol=(...e)=>{var t,s,l,n,i,c,a,v;const{props:r,children:z}=JSswift.uiNormalizeArgs(e),d=r.slots||{},k=f=>Object.prototype.hasOwnProperty.call(r,f),N=(f,h,x={})=>{const ae=Array.isArray(f)?f:[f];for(const Oe of ae)if(JSswift.ui.getSlot(d,Oe)!=null)return D(d,Oe,x,h);return h==null?[]:D(null,"default",x,h)},p=f=>{var h;return f==null||f===!1||f===""?"":typeof f=="string"&&((h=JSswift.uiSizes)!=null&&h.includes(f))?`var(--jss-s-${f})`:vt(f)},U=f=>{var h;return f==null||f===!1||f===""?"":typeof f=="string"&&((h=JSswift.uiSizes)!=null&&h.includes(f))?$e(f,"size"):vt(f)},w={...r.style||{}},$=f=>{if(f==null||f==="")return null;if(f==="auto")return"auto";if(f==="full"||f===!0)return"1 / -1";const h=Number(f);if(Number.isFinite(h)&&h>0){const x=Math.max(1,Math.round(h));return`span ${x} / span ${x}`}return String(f)},B=f=>{if(f==null||f==="")return null;if(f==="full"||f===!0)return"1 / -1";const h=Number(f);if(Number.isFinite(h)&&h>0){const x=Math.max(1,Math.round(h));return`span ${x} / span ${x}`}return String(f)},te=k("span")?r.span:r.col,E=qe(te,$),ve=qe(r.sm,$),le=qe(r.md,$),ie=qe(r.lg,$),ge=JSswift.uiResponsivePropsFor(r,kt("tablet"))||{},ue=JSswift.uiResponsivePropsFor(r,kt("pc"))||{},fe=(t=ge.span)!=null?t:ge.col,M=(s=ue.span)!=null?s:ue.col,me=qe(fe,$),be=qe(M,$),de=qe(r.rowSpan,B),Z=qe(r.row,B),j=qe(r.area),I=qe(r.align),y=qe(r.justify),P=qe(r.place),Q=qe(r.gap,p),m=qe(r.rowGap,p),b=qe(r.columnGap,p),g=qe(r.padding,p),T=qe(r.width,U),Y=qe(r.minHeight,U),K=qe(r.height,U),_e=qe(r.maxHeight,U),J=qe(r.contentAlign),A=qe(r.contentJustify),L=qe(r.direction),O=qe(r.scroll,f=>f===!0?"auto":String(f),""),X=qe(r.fullHeight,f=>f?"100%":"",""),we=xt([r.center,r.contentAlign,r.contentJustify],()=>!!o(r.center)&&(o(r.contentAlign)==null||o(r.contentAlign)==="")&&(o(r.contentJustify)==null||o(r.contentJustify)==="")),Be={props:r},Ue=N(["start","top","header","before"],(i=(n=(l=r.start)!=null?l:r.top)!=null?n:r.header)!=null?i:r.before,Be),H=k("body")?r.body:k("content")?r.content:z,W=N(["body","content","default"],H,Be),ee=N(["end","bottom","footer","after"],(v=(a=(c=r.end)!=null?c:r.bottom)!=null?a:r.footer)!=null?v:r.after,Be),Ne=Ue.length||ee.length||k("start")||k("top")||k("header")||k("before")||k("body")||k("content")||k("end")||k("bottom")||k("footer")||k("after")||r.startClass||r.bodyClass||r.contentClass||r.endClass||r.topClass||r.headerClass||r.bottomClass||r.footerClass||JSswift.ui.getSlot(d,"start")!=null||JSswift.ui.getSlot(d,"top")!=null||JSswift.ui.getSlot(d,"header")!=null||JSswift.ui.getSlot(d,"before")!=null||JSswift.ui.getSlot(d,"body")!=null||JSswift.ui.getSlot(d,"content")!=null||JSswift.ui.getSlot(d,"end")!=null||JSswift.ui.getSlot(d,"bottom")!=null||JSswift.ui.getSlot(d,"footer")!=null||JSswift.ui.getSlot(d,"after")!=null,Te=xt([r.stack,r.gap,r.rowGap,r.columnGap,r.contentAlign,r.contentJustify,r.direction,r.center],()=>Ne||o(r.stack)||[o(r.gap),o(r.rowGap),o(r.columnGap),o(r.contentAlign),o(r.contentJustify),o(r.direction)].some(h=>h!=null&&h!==!1&&h!=="")?!0:!!o(r.center)),oe=xt([r.panel,r.color,r.clickable,r.border,r.glossy,r.glow,r.glass,r.shadow,r.outline,r.gradient,r.textGradient,r.lightShadow,r.radius],()=>!!(o(r.panel)||o(r.color)||o(r.clickable)||o(r.border)||o(r.glossy)||o(r.glow)||o(r.glass)||o(r.shadow)||o(r.outline)||o(r.gradient)||o(r.textGradient)||o(r.lightShadow)||o(r.radius))?["jss-clear-set","jss-singularity","jss-grid-col-surface"]:[]),Pe=re(["jss-grid-col",oe,JSswift.uiResponsiveClasses({mobile:r},Vt),JSswift.uiResponsiveClasses(r,Vt),pe(r.panel,"jss-grid-col-panel"),pe(r.auto,"is-auto"),pe(Te,"jss-grid-col-stack"),pe(r.inline,"jss-grid-col-inline"),pe(we,"jss-grid-col-center"),r.class]),Ie=JSswift.omit(r,["span","col","sm","md","lg","auto","row","rowSpan","area","align","justify","place","gap","rowGap","columnGap","padding","width","height","minHeight","maxHeight","fullHeight","stack","inline","direction","contentAlign","contentJustify","center","scroll","panel","to","start","top","header","before","startClass","topClass","headerClass","body","content","bodyClass","contentClass","end","bottom","footer","after","endClass","bottomClass","footerClass","slots","style","clickable","dense","flat","border","glossy","glow","glass","shadow","outline","rounded","gradient","textGradient","lightShadow","color","textColor","size","radius",...JSswift.uiResponsiveOmitProps]);Ie.class=Pe,w["--jss-grid-col-base"]==null&&(w["--jss-grid-col-base"]="auto"),w["--jss-grid-col-tablet"]==null&&(w["--jss-grid-col-tablet"]="var(--jss-grid-col-base, auto)"),w["--jss-grid-col-pc"]==null&&(w["--jss-grid-col-pc"]="var(--jss-grid-col-tablet, var(--jss-grid-col-base, auto))"),o(r.auto)===!0?w["--jss-grid-col-base"]="auto":E!=null&&(w["--jss-grid-col-base"]=E),ve!=null&&(w["--jss-grid-col-sm"]=ve),le!=null&&(w["--jss-grid-col-md"]=le),ie!=null&&(w["--jss-grid-col-lg"]=ie),me!=null&&(w["--jss-grid-col-tablet"]=me),be!=null&&(w["--jss-grid-col-pc"]=be),de!=null?w.gridRow=de:Z!=null&&(w.gridRow=Z),j!=null&&(w.gridArea=j),I!=null&&!nt(r,"align")&&(w.alignSelf=I),y!=null&&!nt(r,"justify")&&(w.justifySelf=y),P!=null&&!nt(r,"place")&&(w.placeSelf=P),Q!=null&&!nt(r,"gap")&&(w.gap=Q),m!=null&&!nt(r,"rowGap")&&(w.rowGap=m),b!=null&&!nt(r,"columnGap")&&(w.columnGap=b),g!=null&&!nt(r,"padding")&&(w.padding=g),T!=null&&!nt(r,"width")&&(w.width=T),X!=null&&X!==""?w.height=X:K!=null&&!nt(r,"height")&&(w.height=K),Y!=null&&!nt(r,"minHeight")&&(w.minHeight=Y),_e!=null&&!nt(r,"maxHeight")&&(w.maxHeight=_e),L!=null&&!nt(r,"direction")&&(w.flexDirection=L),J!=null&&!nt(r,"contentAlign")?w.alignItems=J:we!=null&&we!==""&&(w.alignItems=we?"center":""),A!=null&&!nt(r,"contentJustify")?w.justifyContent=A:we!=null&&we!==""&&(w.justifyContent=we?"center":""),O!=null&&O!==""&&(w.overflow=O),Object.keys(w).length&&(Ie.style=w),JSswift.uiApplyResponsiveProps(Ie,r,Pt);const Le=r.onClick,Ye=r.onKeydown,ct=!!(o(r.clickable)||o(r.to)),Re=f=>{var h;if(Le==null||Le(f),f.defaultPrevented)return;const x=o(r.to);x&&((h=JSswift.router)!=null&&h.navigate)&&(f.preventDefault(),JSswift.router.navigate(x))},C=f=>{Ye==null||Ye(f),!f.defaultPrevented&&(f.key==="Enter"||f.key===" ")&&(f.preventDefault(),Re(f))};if(ct&&(Ie.onClick=Re,Ie.onKeydown=C,Ie.tabIndex==null&&(Ie.tabIndex=0),Ie.role==null&&(Ie.role="button")),!Ne){const f=_.div(Ie,...D(d,"default",Be,z));return Et(f,r),f}const Se={display:"flex",flexDirection:"column",gap:"inherit",minWidth:0},Fe=[Ue.length?_.div({class:re(["jss-grid-col-start",r.startClass,r.topClass,r.headerClass]),style:{...Se}},...Ue):null,W.length?_.div({class:re(["jss-grid-col-body",r.bodyClass,r.contentClass]),style:{...Se,flex:"1 1 auto"}},...W):null,ee.length?_.div({class:re(["jss-grid-col-end",r.endClass,r.bottomClass,r.footerClass]),style:{...Se}},...ee):null].filter(Boolean),F=_.div(Ie,...Fe);return Et(F,r),F},xe.Icon=(...e)=>{var t,s;let l={},n=[],i="home",c=!1;const a=e[0],v=e[1],r=ue=>ue&&typeof ue=="object"&&!ue.nodeType&&!Array.isArray(ue)&&!(ue instanceof Function);typeof a=="string"?(i=a,c=!0,r(v)?(l=v,e.length>2&&(n=e.slice(2))):e.length>1&&(n=e.slice(1))):r(a)?(l=a,a.name!=null&&(i=a.name,c=!0),e.length>1&&(n=e.slice(1))):e.length&&(n=e),!c&&n.length&&(i=n.length===1?n[0]:n),pn(l);const z=l.slots||{},d=o(l.size),k=o(l.color),N=String(i).endsWith("-fill"),p={...l.style||{}},U=xt(l.size,()=>{const ue=o(l.size);return typeof ue=="string"&&Un[ue]?ue:""}),w=!!(l.color||l.clickable||l.border||l.glossy||l.glow||l.glass||l.shadow||l.outline||l.gradient||l.textGradient||l.lightShadow||l.radius),$={"chevron-down":{viewBox:"0 0 24 24",paths:[{d:"M6 9l6 6l6 -6",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"}]}},B=ue=>{const fe=$[ue];return fe?_.svg({width:"100%",height:"100%",viewBox:fe.viewBox,fill:"none","aria-hidden":"true",focusable:"false"},...fe.paths.map(M=>_.path(M))):null},te=ue=>{const fe=o(l.tooltip);if(fe==null||fe===!1||!xe.Tooltip)return ue;const M=r(fe)?{...fe}:{text:fe};return r(l.tooltipProps)&&Object.assign(M,l.tooltipProps),xe.Tooltip({...M,target:ue})},E=re(["jss-icon","material-icons",...w?["jss-clear-set","jss-singularity"]:[],U,l.class]),ve=JSswift.omit(l,["name","size","class","style","label","border","color","icon","iconRight","removable","onRemove","dense","flat","glossy","outline","slots","spriteUrl","tooltip","tooltipProps"]);if(ve.class=E,Object.keys(p).length&&(ve.style=p),typeof i=="function"||i&&typeof i=="object"){const ue=JSswift.ui.renderSlot(z,"default",{},i),fe=D(null,"default",{},ue),M=_.span({...ve,"data-icon":"custom"},...fe);return Et(M,l),te(M)}const le=String(i),ie=le.includes("#")?le:"";let ge=null;if(ie){const ue=l.spriteUrl||((t=JSswift.config)==null?void 0:t.iconSpriteUrl)||(typeof globalThis!="undefined"?(s=globalThis.JSswift_setting)==null?void 0:s.iconSpriteUrl:null),fe=ie.slice(ie.indexOf("#")+1),M=ue?_.svg({width:"100%",height:"100%"},_.use({href:ue+ie})):B(fe)||_.svg({width:"100%",height:"100%"},_.use({href:ie}));N&&(M.style.fill="currentColor"),ge=_.span({...ve,"data-icon":le},M,...n)}else ge=_.span({...ve,"data-icon":le},le,...n);if(d!=null){let ue=d;JSswift.uiSizes.includes(d)&&(ue=`var(--jss-icon-size-${d})`),ue=typeof ue=="number"?ue+"px":String(ue),ge.style.setProperty("--set-icon-size",ue)}return Et(ge,l),te(ge)},xe.Badge=(...e)=>{const{props:t,children:s}=JSswift.uiNormalizeArgs(e),l=t.slots||{},n=xt(t.size,()=>{const U=o(t.size);return typeof U=="string"&&Un[U]?`jss-size-${U}`:""}),i=re(["jss-clear-set","jss-badge","jss-singularity",n,pe(t.outline,"outline"),t.class]),c=JSswift.omit(t,["label","color","outline","size","slots","notification","iconSize","topLeft","topRight","bottomLeft","bottomRight","left","right"]);c.class=i;const a={...t.style||{}};if(t.size){const U=o(t.size);typeof U=="string"&&Un[U]||(a.fontSize=vt(t.size))}c.style=a;const v=(U,w,$)=>{const B=Array.isArray(U)?U:[U];for(const te of B)if(JSswift.ui.getSlot(l,te)!=null)return D(l,te,w,$);return $==null||$===!1||$===""?[]:D(null,"default",w,$)},r=()=>{var U;const w=o((U=t.iconSize)!=null?U:t.size);return typeof w=="number"?Math.max(10,Math.round(w*.85)):typeof w=="string"&&{xxs:10,xs:11,sm:12,md:13,lg:14,xl:16,xxl:18,xxxl:20}[w]||14},z=(U,w)=>{const $=o(U);return $==null||$===!1||$===""?null:typeof $=="string"?xe.Icon({name:$,size:r()}):JSswift.ui.slot($,{as:w})},d=(U,w,$)=>_.dynamic(()=>{const B=z(t[w],$),te=v(U,{position:$},B);return te.length?_.span({class:`jss-badge-anchor jss-badge-anchor-${$}`,"data-badge-slot":$},...te):null}),k=_.dynamic(()=>{const U=o(t.label);let w=v(["label"],{},U);return w.length||(w=v(["default"],{},s)),_.span({class:"jss-badge-content"},_.span({class:"jss-badge-label"},...w.length?w:[""]))}),N=_.dynamic(()=>{const U=o(t.notification),w=U==null||U===!1||U===""?null:U,$=v(["notification"],{notification:U},w);return $.length?_.span({class:"jss-badge-notification","data-badge-slot":"notification","aria-label":typeof U=="number"?`${U} notifications`:null},...$):null}),p=_.span(d(["left"],"left","left"),d(["centerLeft","center-left"],"centerLeft","center-left"),c,k,d(["topLeft","top-left"],"topLeft","top-left"),d(["topRight","top-right"],"topRight","top-right"),d(["bottomLeft","bottom-left"],"bottomLeft","bottom-left"),d(["bottomRight","bottom-right"],"bottomRight","bottom-right"),d(["centerRight","center-right"],"centerRight","center-right"),d(["right"],"right","right"),N);return(t.topLeft||t.centerLeft||t.bottomLeft)&&p.style.setProperty("padding-left","15px"),(t.topRight||t.centerRight||t.bottomRight)&&p.style.setProperty("padding-right","15px"),Et(p,t),p};const Eo=e=>{if(e==null||e===!1)return"";const t=String(e).replace(/[._-]+/g," ").replace(/\s+/g," ").trim();if(!t)return"";const s=t.split(" ").filter(Boolean);return s.length?s.length===1?s[0].replace(/[^a-z0-9]/gi,"").slice(0,2).toUpperCase():s.slice(0,2).map(l=>l.charAt(0).toUpperCase()).join(""):""},Yl=(e,t)=>{const s=e==null||e===!0?t:e;if(s==null||s===!1)return sn(t);const l=String(s).toLowerCase();return l==="online"||l==="available"||l==="active"?"success":l==="away"||l==="pending"?"warning":l==="busy"||l==="dnd"||l==="blocked"?"danger":l==="offline"||l==="idle"?"secondary":sn(l)||sn(t)},Xl=(e,t="jss-avatar-badge")=>e==null||e===!1?null:e instanceof Node||Array.isArray(e)||typeof e=="function"?e:e===!0?_.span({class:t}):_.span({class:t},String(e)),Io=(e,t)=>{if(e==null||e===!1){if(!t)return null;const l=Yl(null,t);return _.span({class:re(["jss-avatar-status",l?`jss-state-${l}`:""])})}if(e instanceof Node||Array.isArray(e)||typeof e=="function")return e;const s=Yl(e,t);return e===!0||s?_.span({class:re(["jss-avatar-status",s?`jss-state-${s}`:""])}):Xl(e,"jss-avatar-badge")},cl=(e,t)=>!t||!t.length?null:_.span({class:re(["jss-avatar-anchor",e])},...t);xe.Avatar=(...e)=>{var t,s,l;const{props:n,children:i}=JSswift.uiNormalizeArgs(e),c=n.slots||{},a=xt(n.size,()=>{var m;const b=o(n.size);return typeof b=="string"&&((m=JSswift.uiSizes)!=null&&m.includes(b))?`jss-size-${b}`:""}),v=xt([n.color,n.state],()=>{const m=o(n.color)||o(n.state)||"",b=sn(m);return b?`jss-state-${b}`:""}),r=re(["jss-clear-set","jss-avatar","jss-singularity",a,v,pe(n.square,"jss-avatar-square"),pe(n.elevated,"elevated"),n.class]),z=JSswift.omit(n,["src","srcset","srcSet","sizes","alt","label","name","initials","text","size","fontSize","textSize","radius","rounded","square","elevated","icon","iconSize","media","fit","badge","notification","status","statusColor","presence","topLeft","topRight","bottomLeft","bottomRight","slots"]);z.class=r;const d={...n.style||{}},k=qe(n.size,m=>{var b;return typeof m=="string"&&((b=JSswift.uiSizes)!=null&&b.includes(m))?"":vt(m)},"");k!=null&&(d.width=k,d.height=k);const N=(t=n.fontSize)!=null?t:n.textSize,p=N!=null?qe(N,vt):qe(n.size,m=>{var b;return typeof m=="string"&&((b=JSswift.uiSizes)!=null&&b.includes(m))?"":`clamp(11px, calc(${vt(m)} * 0.34), 28px)`},"");p!=null&&(d.fontSize=p);const U=qe(n.radius,m=>{const b=el(m);return b==="xxxl"?"999px":b?`var(--jss-r-${b})`:typeof m=="number"?`${m}px`:String(m)});U!=null&&(d["--set-border-radius"]=U),z.style=d;const w={props:n},$=xt([n.alt,n.label,n.name,n.text],()=>{const m=o(n.alt)||o(n.label)||o(n.name)||o(n.text)||"avatar";return String(m)}),B=n.icon!=null?typeof n.icon=="string"?xe.Icon({name:n.icon,size:n.iconSize||n.size||"sm"}):JSswift.ui.slot(n.icon,{as:"icon"}):null,te=xt([n.initials,n.text,n.label,n.name],()=>{var m,b;const g=(m=o(n.initials))!=null?m:o(n.text);if(g!=null)return g;const T=(b=o(n.label))!=null?b:o(n.name);return typeof T=="string"?Eo(T):T}),E=Xl(o((s=n.badge)!=null?s:n.notification)),ve=Io(o((l=n.status)!=null?l:n.presence),o(n.statusColor));let le=D(c,"media",w,n.media);if(!le.length&&n.src){const m={class:"jss-avatar-img",src:n.src,alt:$,sizes:n.sizes,style:{}};n.srcset!=null&&(m.srcset=n.srcset),n.srcSet!=null&&(m.srcset=n.srcSet);const b=qe(n.fit);b!=null&&(m.style.objectFit=b),le=[_.img(m)]}const ie=D(c,"default",w,i),ge=D(c,"fallback",w,null),ue=D(c,"label",w,te),fe=D(c,"icon",w,B),M=le.length?le:ie.length?ie:ge.length?ge:ue.length?ue:fe.length?fe:["?"],me=le.length?"jss-avatar-media":"jss-avatar-fallback",be=_.span({class:"jss-avatar-body"},_.span({class:me},...M));let de=D(c,"topLeft",w,n.topLeft),Z=D(c,"topRight",w,n.topRight),j=D(c,"bottomLeft",w,n.bottomLeft),I=D(c,"bottomRight",w,n.bottomRight);const y=D(c,"badge",w,E),P=D(c,"status",w,ve);!Z.length&&y.length&&(Z=y),!I.length&&P.length&&(I=P);const Q=_.div(z,be,cl("jss-avatar-anchor-top-left",de),cl("jss-avatar-anchor-top-right",Z),cl("jss-avatar-anchor-bottom-left",j),cl("jss-avatar-anchor-bottom-right",I));return Et(Q,n),Q},xe.Chip=(...e)=>{var t,s,l,n;const{props:i,children:c}=JSswift.uiNormalizeArgs(e),a=i.slots||{},v=xt(i.size,()=>{const E=o(i.size);return typeof E=="string"&&Un[E]?E:""}),r=re(["jss-clear-set","jss-chip","jss-singularity",v,i.class]),z=JSswift.omit(i,["label","border","color","icon","iconRight","removable","onRemove","dense","flat","glossy","outline","slots"]);z.class=r,z.style={...i.style||{}};const d=i.icon?typeof i.icon=="string"?xe.Icon({name:i.icon,size:(t=i==null?void 0:i.size)!=null?t:null}):JSswift.ui.slot(i.icon,{as:"icon"}):null,k=i.iconRight?typeof i.iconRight=="string"?xe.Icon({name:i.iconRight,size:(s=i==null?void 0:i.size)!=null?s:null}):JSswift.ui.slot(i.iconRight,{as:"iconRight"}):null,N=JSswift.ui.renderSlot(a,"icon",{},d),p=JSswift.ui.renderSlot(a,"iconRight",{},k),U=D(a,"label",{},i.label),w=U.length?U:D(a,"default",{},c),$=D(null,"default",{},N),B=D(null,"default",{},p),te=_.span(z,...$,...w.length?w:[""],...B);if(i.removable){const E=xe.Btn({class:"jss-chip-remove",onClick:i.onRemove,size:(l=i==null?void 0:i.size)!=null?l:null},xe.Icon({size:(n=i==null?void 0:i.size)!=null?n:null,name:"close"}));te.appendChild(E),E.onclick=()=>{i.onRemove&&i.onRemove(),te.remove()}}return Et(te,i),te},xe.Stat=(...e)=>{var t,s;const{props:l,children:n}=JSswift.uiNormalizeArgs(e),i=l.slots||{},c=()=>sn(o(l.state)||o(l.color)||""),a=xt([l.state,l.color],()=>{const ue=c();return ue?`jss-state-${ue}`:""}),v=xt(l.trend,()=>{const ue=String(o(l.trend)||"").toLowerCase();return["up","positive","success","gain","increase"].includes(ue)?"is-positive":["down","negative","danger","loss","decrease"].includes(ue)?"is-negative":["flat","neutral","steady","stable"].includes(ue)?"is-neutral":""}),r={...l},z=JSswift.omit(r,["actions","aside","delta","eyebrow","footer","icon","iconSize","label","meta","note","slots","state","subtitle","title","trend","value"]);z.class=re(["jss-clear-set","jss-stat","jss-singularity",a,v,r.class]),z.style={...r.style||{}};const d=(ue,fe,M={})=>D(i,ue,M,fe),k=l.icon==null?null:typeof l.icon=="string"?xe.Icon({name:l.icon,size:l.iconSize||"md"}):JSswift.ui.slot(l.icon,{as:"icon"}),N=d("eyebrow",l.eyebrow),p=d("label",(t=l.label)!=null?t:l.title),U=d("value",l.value),w=d("note",(s=l.note)!=null?s:l.subtitle),$=d("meta",l.meta),B=d("delta",l.delta,{trend:l.trend}),te=d("icon",k),E=d("aside",l.aside),ve=d("footer",l.footer),le=d("actions",l.actions),ie=d("default",n),ge=_.article(z,_.div({class:"jss-stat-head"},_.div({class:"jss-stat-lead"},te.length?_.div({class:"jss-stat-icon"},...te):null,_.div({class:"jss-stat-copy"},N.length?_.div({class:"jss-stat-eyebrow"},...N):null,p.length?_.div({class:"jss-stat-label"},...p):null)),E.length?_.div({class:"jss-stat-aside"},...E):null),_.div({class:"jss-stat-body"},U.length?_.div({class:"jss-stat-value"},...U):null,B.length?_.div({class:"jss-stat-delta"},...B):null,w.length?_.div({class:"jss-stat-note"},...w):null,$.length?_.div({class:"jss-stat-meta"},...$):null,ie.length?_.div({class:"jss-stat-extra"},...ie):null),ve.length||le.length?_.div({class:"jss-stat-footer"},ve.length?_.div({class:"jss-stat-footer-copy"},...ve):null,le.length?_.div({class:"jss-stat-actions"},...le):null):null);return Et(ge,l),ge},xe.Kpi=(...e)=>{var t,s;const{props:l,children:n}=JSswift.uiNormalizeArgs(e),i=l.slots||{},c=()=>sn(o(l.state)||o(l.color)||""),a=xt([l.state,l.color],()=>{const ue=c();return ue?`jss-state-${ue}`:""}),v={...l},r=JSswift.omit(v,["actions","aside","delta","eyebrow","footer","icon","iconSize","label","media","meta","note","slots","state","subtitle","title","trend","value"]);r.class=re(["jss-clear-set","jss-kpi","jss-singularity",a,v.class]),r.style={...v.style||{}};const z=(ue,fe,M={})=>D(i,ue,M,fe),d=l.icon==null?null:typeof l.icon=="string"?xe.Icon({name:l.icon,size:l.iconSize||"lg"}):JSswift.ui.slot(l.icon,{as:"icon"}),k=z("eyebrow",l.eyebrow),N=z("title",(t=l.title)!=null?t:l.label),p=z("value",l.value),U=z("delta",l.delta,{trend:l.trend}),w=z("note",(s=l.note)!=null?s:l.subtitle),$=z("meta",l.meta),B=z("icon",d),te=z("aside",l.aside),E=z("media",l.media),ve=z("footer",l.footer),le=z("actions",l.actions),ie=z("default",n),ge=_.section(r,_.div({class:"jss-kpi-head"},_.div({class:"jss-kpi-title-wrap"},B.length?_.div({class:"jss-kpi-icon"},...B):null,_.div({class:"jss-kpi-copy"},k.length?_.div({class:"jss-kpi-eyebrow"},...k):null,N.length?_.div({class:"jss-kpi-title"},...N):null)),te.length?_.div({class:"jss-kpi-aside"},...te):null),_.div({class:"jss-kpi-core"},_.div({class:"jss-kpi-value-wrap"},p.length?_.div({class:"jss-kpi-value"},...p):null,U.length?_.div({class:"jss-kpi-delta"},...U):null),w.length?_.div({class:"jss-kpi-note"},...w):null,$.length?_.div({class:"jss-kpi-meta"},...$):null,E.length?_.div({class:"jss-kpi-media"},...E):null,ie.length?_.div({class:"jss-kpi-extra"},...ie):null),ve.length||le.length?_.div({class:"jss-kpi-footer"},ve.length?_.div({class:"jss-kpi-footer-copy"},...ve):null,le.length?_.div({class:"jss-kpi-actions"},...le):null):null);return Et(ge,l),ge};const zo=(e,t=180)=>{const s=getComputedStyle(e).transitionDuration;if(!s)return t;const l=s.split(",")[0].trim();if(!l)return t;const n=l.includes("ms")?parseFloat(l):parseFloat(l)*1e3;return Number.isFinite(n)?n:t},ks=e=>{!(e!=null&&e.overlay)||!(e!=null&&e.panel)||(e.overlay.classList.add("enter"),e.panel.classList.add("enter"),requestAnimationFrame(()=>{!(e!=null&&e.overlay)||!(e!=null&&e.panel)||(e.overlay.classList.add("entered"),e.panel.classList.add("entered"),e.overlay.classList.remove("enter"),e.panel.classList.remove("enter"))}))},Ns=(e,t)=>{if(!(e!=null&&e.overlay)||!(e!=null&&e.panel)){t==null||t();return}if(e._closing)return;e._closing=!0,e.overlay.classList.add("leave"),e.panel.classList.add("leave");const s=()=>{e._closed||(e._closed=!0,t==null||t())},l=i=>{i.target===e.panel&&(e.panel.removeEventListener("transitionend",l),s())};e.panel.addEventListener("transitionend",l);const n=zo(e.panel,180);setTimeout(s,n+40)};xe.List=(...e)=>{var t;const{props:s,children:l}=JSswift.uiNormalizeArgs(e),n=s.slots||{},i=!!o((t=s.number)!=null?t:s.ordered),c=o(s.marker),a=o(s.items),v=Array.isArray(a)?a:a==null?[]:[a],r=(B={})=>{const te=s.itemProps||{},E={...te,...B};return s.divider!=null&&E.divider==null&&(E.divider=s.divider),E.class=re([te.class,s.itemClass,B.class]),E.style={...te.style||{},...s.itemStyle||{},...B.style||{}},E},z=B=>{if(B==null||B===!1)return[];if(_s(B))return[B];if(ds(B)){const te=B.children!=null?Dn(B.children):B.content!=null?Dn(B.content):Dn(B.node);return[xe.Item(r(B),...te)]}return Array.isArray(B)?[xe.Item(r(),...B)]:B!=null&&B.nodeType?[xe.Item(r(),B)]:[xe.Item(r(),B)]},d=(B,te,E,ve=!0)=>{if(B==null||B===!1)return[];if(ve){const le={item:B,index:te,count:E,first:te===0,last:te===E-1},ie=D(n,"item",le,null);if(ie.length)return ie.flatMap(ge=>z(ge))}return z(B)},k=[];v.forEach((B,te)=>{k.push(...d(B,te,v.length))});const N=D(n,"default",{items:v,count:v.length},l);if(N.forEach((B,te)=>{k.push(...d(B,v.length+te,v.length+N.length,!1))}),!k.length){const B=D(n,"empty",{items:v,count:0},s.empty);B.length&&(B.length===1&&_s(B[0])?k.push(B[0]):k.push(xe.Item({class:"jss-item-empty",flat:!0},...B)))}const p=re(["jss-list",pe(s.dense,"dense"),pe(s.divider,"divider"),pe(c===!1||c==="none","jss-list-no-marker"),s.class]),U=JSswift.omit(s,["dense","divider","slots","number","ordered","items","itemClass","itemStyle","itemProps","empty","marker","gap"]);U.class=p,U.style={...s.style||{}};const w=qe(s.gap,vt);return w!=null&&(U.style["--jss-list-gap"]=w),c!=null&&c!==!1&&c!==!0&&c!=="none"&&(U.style.listStyleType=String(c)),_[i?"ol":"ul"](U,...k)},xe.Item=(...e)=>{var t,s,l,n,i,c,a,v;const{props:r,children:z}=JSswift.uiNormalizeArgs(e);r.state!=null&&r.color==null&&(r.color=r.state),pn(r);const d=r.slots||{},k=xt([r.clickable,r.to],()=>!!(o(r.clickable)||o(r.to))),N=xt([r.active,r.selected],()=>!!(o(r.active)||o(r.selected))),p=!!(r.color!=null||r.outline||r.border||r.glossy||r.glow||r.glass||r.shadow||r.gradient||r.textGradient||r.lightShadow||r.radius||r.rounded||r.flat),U=(g,T,Y)=>{const K=o(g);return K==null||K===!1||K===""?null:typeof K=="string"?xe.Icon({name:K,size:T||"sm"}):JSswift.ui.slot(K,{as:Y})},w=D(d,"icon",{},U(r.icon,r.iconSize||r.size,"icon")),$=D(d,"title",{},(t=r.title)!=null?t:r.label),B=D(d,"subtitle",{},(l=(s=r.subtitle)!=null?s:r.caption)!=null?l:r.description),te=D(d,"meta",{},(n=r.meta)!=null?n:r.eyebrow),E=D(d,"body",{},(i=r.body)!=null?i:r.content),ve=D(d,"default",{},z),le=D(d,"actions",{},(c=r.actions)!=null?c:r.footer),ie=(v=(a=r.aside)!=null?a:r.trailing)!=null?v:U(r.iconRight,r.iconSize||r.size,"iconRight"),ge=D(d,"aside",{},ie),ue=[...E,...ve],fe=!(p||r.clickable||r.to||w.length||$.length||B.length||te.length||le.length||ge.length||E.length),M=re(["jss-item",pe(r.divider,"divider"),pe(p,"jss-clear-set"),pe(p,"jss-singularity"),pe(p,"jss-item-surface"),pe(fe,"jss-item-inline"),pe(k,"jss-item-clickable"),pe(N,"is-active"),pe(r.disabled,"is-disabled"),r.class]),me=JSswift.omit(r,["divider","slots","label","title","subtitle","caption","description","meta","eyebrow","body","content","children","node","icon","iconRight","iconSize","aside","trailing","actions","footer","clickable","to","active","selected","disabled","state","color","size","outline","flat","border","glossy","glow","glass","gradient","textGradient","lightShadow","shadow","rounded","radius","textColor","dense"]);me.class=M,me.style={...r.style||{}};const be=r.onClick,de=r.onKeydown,Z=g=>{var T;if(be==null||be(g),g.defaultPrevented||o(r.disabled))return;const Y=o(r.to);Y&&((T=JSswift.router)!=null&&T.navigate)&&(g.preventDefault(),JSswift.router.navigate(Y))},j=g=>{de==null||de(g),!(g.defaultPrevented||o(r.disabled))&&(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),Z(g))};o(r.disabled)&&(me["aria-disabled"]="true"),(o(r.clickable)||o(r.to))&&(me.onClick=Z,me.onKeydown=j,me.tabIndex==null&&(me.tabIndex=o(r.disabled)?-1:0),me.role==null&&(me.role="button"));const I=$.length?_.div({class:"jss-item-title"},...$):null,y=B.length?_.div({class:"jss-item-subtitle"},...B):null,P=te.length?_.div({class:"jss-item-meta"},...te):null,Q=ue.length?_.div({class:re(["jss-item-body",pe(!($.length||B.length||te.length),"is-standalone")])},...ue):null,m=le.length?_.div({class:"jss-item-actions"},...le):null,b=_.li(me,_.div({class:"jss-item-row"},w.length?_.div({class:"jss-item-icon"},...w):null,_.div({class:"jss-item-main"},P,I,y,Q,m),ge.length?_.div({class:"jss-item-aside"},...ge):null));return Et(b,r),b},xe.Separator=(...e)=>{const{props:t}=JSswift.uiNormalizeArgs(e),s=re(["jss-separator",pe(t.vertical,"vertical"),t.class]),l=JSswift.omit(t,["vertical","size","slots"]);l.class=s;const n={borderColor:"var(--jss-border)",...t.style||{}},i=o(t.size),c=o(t.vertical);if(i!=null){const a=vt(i);c?n.width=a:n.height=a}return l.style=n,_.hr(l)},xe.Banner=(...e)=>{var t;const{props:s,children:l}=JSswift.uiNormalizeArgs(e),n=s.slots||{},i=()=>sn(o(s.type)||o(s.state)||""),c={state:i,dismissible:()=>!!o(s.dismissible)},a=xt([s.type,s.state],()=>i()),v=xt(s.variant,()=>{const Z=String(o(s.variant)||"").toLowerCase();return["solid","outline","ghost"].includes(Z)?`jss-banner-${Z}`:""}),r=xt([s.actionsPlacement,s.stack],()=>String(o(s.actionsPlacement)||"").toLowerCase()==="bottom"||o(s.stack)?"jss-banner-actions-bottom":""),z=xt(s.stack,()=>o(s.stack)?"jss-banner-stack":""),d={...s},k=JSswift.omit(d,["actions","actionsPlacement","accent","aside","body","closeLabel","description","dismiss","dismissible","icon","iconSize","message","meta","onDismiss","slots","stack","state","subtitle","title","type","variant"]);k.class=re(["jss-clear-set","jss-banner","jss-singularity",a,v,r,z,d.class]),k.style={...d.style||{}};const N=Z=>{if(Z==null||Z==="")return"";const j=o(Z);if(j==null||j==="")return"";const I=String(j);return Fn(I)?`var(--jss-${I})`:I};(s.accent!=null||ht(s.accent))&&(k.style["--jss-banner-accent"]=()=>N(s.accent),k.style["--jss-banner-border"]=()=>{const Z=N(s.accent);return Z?`color-mix(in srgb, ${Z} 38%, var(--jss-border-color))`:""},k.style["--jss-banner-bg"]=()=>{const Z=N(s.accent);return Z?`color-mix(in srgb, ${Z} 14%, var(--jss-panel))`:""},k.style["--jss-banner-color"]=()=>{const Z=N(s.accent);return Z?`color-mix(in srgb, ${Z} 78%, white)`:""});const p={success:"check_circle",warning:"warning",danger:"error",info:"info",primary:"bolt",secondary:"campaign",dark:"shield",light:"notifications"},U=(()=>{if(s.icon===!1||s.icon===null)return null;if(s.icon!=null)return typeof s.icon=="string"?xe.Icon({name:s.icon,size:s.iconSize||s.size||"md"}):JSswift.ui.slot(s.icon,{as:"icon"});const Z=i(),j=Z?p[Z]:null;return j?xe.Icon({name:j,size:s.iconSize||s.size||"md"}):null})(),w=D(n,"title",c,s.title),$=D(n,"message",c,s.message!=null?s.message:l),B=D(n,"description",c,(t=s.description)!=null?t:s.subtitle),te=D(n,"meta",c,s.meta),E=D(n,"default",c,s.body!=null?[s.body,...l||[]]:s.message!=null?l:null),ve=D(n,"icon",c,U),le=D(n,"aside",c,s.aside),ie=D(n,"actions",c,s.actions),ge=D(n,"dismiss",c,s.dismiss),ue=String(o(s.actionsPlacement)||"").toLowerCase()==="bottom"||!!o(s.stack),fe=!!o(s.dismissible)||!!s.onDismiss;let M=null;const me=fe?xe.Btn({class:"jss-banner-close",outline:!0,size:s.size||"sm","aria-label":s.closeLabel||"Chiudi banner",onClick:Z=>{var j;(j=s.onDismiss)==null||j.call(s,Z),!Z.defaultPrevented&&(M==null||M.remove())}},xe.Icon({name:"close",size:s.size||"sm"})):null,be=[...le,...ue?[]:ie,...ge.length?ge:me?[me]:[]];M=_.div(k,ve.length?_.div({class:"jss-banner-icon"},...ve):null,_.div({class:"jss-banner-body"},_.div({class:"jss-banner-copy"},w.length?_.div({class:"jss-banner-title"},...w):null,$.length?_.div({class:"jss-banner-message"},...$):null,B.length?_.div({class:"jss-banner-description"},...B):null,E.length?_.div({class:"jss-banner-extra"},...E):null,te.length?_.div({class:"jss-banner-meta"},...te):null),ue&&ie.length?_.div({class:"jss-banner-actions"},...ie):null),be.length?_.div({class:"jss-banner-side"},...be):null);const de=k.role||(()=>{const Z=i();return Z==="danger"||Z==="warning"?"alert":"status"})();return M.setAttribute("role",de),Et(M,s),M},xe.Alert=(...e)=>{var t;const{props:s,children:l}=JSswift.uiNormalizeArgs(e),n=s.slots||{},i=()=>sn(o(s.type)||o(s.state)||o(s.color)||"warning"),c=xt([s.type,s.state,s.color],()=>{const ve=i();return ve?`jss-state-${ve}`:""}),a={...s},v=JSswift.omit(a,["actions","aside","closeLabel","description","dismiss","dismissible","icon","iconSize","message","meta","onDismiss","slots","state","subtitle","title","type","variant"]);v.class=re(["jss-clear-set","jss-alert","jss-singularity",c,pe(s.dismissible,"is-dismissible"),a.class]),v.style={...a.style||{}};const r={success:"check_circle",warning:"warning",danger:"error",info:"info",primary:"bolt",secondary:"campaign",dark:"shield",light:"notifications"},z=(()=>{if(s.icon===!1||s.icon===null)return null;if(s.icon!=null)return typeof s.icon=="string"?xe.Icon({name:s.icon,size:s.iconSize||"sm"}):JSswift.ui.slot(s.icon,{as:"icon"});const ve=r[i()]||r.warning;return xe.Icon({name:ve,size:s.iconSize||"sm"})})(),d=D(n,"title",{},s.title),k=D(n,"message",{},s.message!=null?s.message:l),N=D(n,"description",{},(t=s.description)!=null?t:s.subtitle),p=D(n,"meta",{},s.meta),U=D(n,"actions",{},s.actions),w=D(n,"aside",{},s.aside),$=D(n,"icon",{},z),B=D(n,"dismiss",{},s.dismiss);let te=null;const E=s.dismissible||s.onDismiss?xe.Btn({class:"jss-alert-close",outline:!0,size:"sm","aria-label":s.closeLabel||"Chiudi alert",onClick:ve=>{var le;(le=s.onDismiss)==null||le.call(s,ve),!ve.defaultPrevented&&(te==null||te.remove())}},xe.Icon({name:"close",size:"sm"})):null;return te=_.div(v,$.length?_.div({class:"jss-alert-icon"},...$):null,_.div({class:"jss-alert-body"},d.length?_.div({class:"jss-alert-title"},...d):null,k.length?_.div({class:"jss-alert-message"},...k):null,N.length?_.div({class:"jss-alert-description"},...N):null,p.length?_.div({class:"jss-alert-meta"},...p):null,U.length?_.div({class:"jss-alert-actions"},...U):null),w.length||B.length||E?_.div({class:"jss-alert-side"},...w,...B.length?B:E?[E]:[]):null),te.setAttribute("role",i()==="danger"||i()==="warning"?"alert":"status"),Et(te,s),te},xe.EmptyState=(...e)=>{var t;const{props:s,children:l}=JSswift.uiNormalizeArgs(e),n=s.slots||{},i=()=>sn(o(s.state)||o(s.color)||""),c=xt([s.state,s.color],()=>{const E=i();return E?`jss-state-${E}`:""}),a={...s},v=JSswift.omit(a,["actions","description","eyebrow","icon","iconSize","illustration","media","message","meta","slots","state","title"]);v.class=re(["jss-clear-set","jss-empty-state","jss-singularity",c,pe(s.compact,"compact"),pe(s.inline,"inline"),a.class]),v.style={...a.style||{}};const r=s.icon===!1?null:s.icon!=null?typeof s.icon=="string"?xe.Icon({name:s.icon,size:s.iconSize||"xl"}):JSswift.ui.slot(s.icon,{as:"icon"}):xe.Icon({name:"inbox",size:s.iconSize||"xl"}),z=D(n,"illustration",{},(t=s.illustration)!=null?t:s.media),d=D(n,"icon",{},r),k=D(n,"eyebrow",{},s.eyebrow),N=D(n,"title",{},s.title),p=D(n,"message",{},s.message!=null?s.message:l),U=D(n,"description",{},s.description),w=D(n,"meta",{},s.meta),$=D(n,"actions",{},s.actions),B=D(n,"default",{},s.message!=null?l:null),te=_.section(v,z.length?_.div({class:"jss-empty-state-illustration"},...z):null,d.length?_.div({class:"jss-empty-state-icon"},...d):null,k.length?_.div({class:"jss-empty-state-eyebrow"},...k):null,N.length?_.div({class:"jss-empty-state-title"},...N):null,p.length?_.div({class:"jss-empty-state-message"},...p):null,U.length?_.div({class:"jss-empty-state-description"},...U):null,w.length?_.div({class:"jss-empty-state-meta"},...w):null,B.length?_.div({class:"jss-empty-state-extra"},...B):null,$.length?_.div({class:"jss-empty-state-actions"},...$):null);return Et(te,s),te};let qn="jsswift:drawer-open";const Ql=new Set,Pl=new Map,is=(e=qn)=>{const t=JSswift==null?void 0:JSswift.store;if(t!=null&&t.get){const s=t.get(e,void 0);if(typeof s=="boolean")return s}try{return localStorage.getItem(e)==="1"}catch(s){return!1}},Po=(e,t=qn)=>{const s=JSswift==null?void 0:JSswift.store;if(s!=null&&s.set){s.set(t,!!e);return}try{localStorage.setItem(t,e?"1":"0")}catch(l){}};let In=is();const Vn=(e,t=qn)=>{In=!!e;const s=Pl.get(t);if(s&&s.size)s.forEach(l=>l==null?void 0:l.classList.toggle("open",In));else{const l=document.querySelector(".jss-drawer");l&&l.classList.toggle("open",In)}return Ql.forEach(l=>{if(!l)return;if(typeof l.update=="function"){l.update(In);return}const{el:n,openIcon:i,closeIcon:c}=l;n&&(n.textContent=In?i:c)}),Po(In,t),In};xe.Tooltip=(...e)=>{var t,s;const{props:l,children:n}=JSswift.uiNormalizeArgs(e),i=l.slots||{};let c=null,a=null,v=null,r=null;const z=Z=>Object.prototype.hasOwnProperty.call(l,Z),d=z("target")||z("anchorEl")||z("triggerEl"),k=l.target||l.anchorEl||l.triggerEl||(n&&n.length?n[0]:null),N=(Z,j)=>{const I=o(Z);if(I==null||I==="")return j;const y=Number(I);return Number.isFinite(y)?y:j},p=()=>{clearTimeout(a),clearTimeout(v),a=null,v=null},U=()=>N(l.delay,350),w=()=>N(l.hideDelay,o(l.interactive)?120:0),$=()=>{if(p(),!c)return;const Z=c;c=null,Ns(Z,()=>JSswift.overlay.close(Z.id))},te=(Z=>{if(Z==null||Z===!0)return new Set(["hover","focus"]);if(Z===!1)return new Set(["manual"]);const j=Array.isArray(Z)?Z:String(Z).split(/[\s,|/]+/),I=new Set;return j.forEach(y=>{const P=String(y||"").trim().toLowerCase();P&&(P==="mouseenter"||P==="mouseover"?I.add("hover"):P==="blur"||P==="focusin"?I.add("focus"):P==="tap"?I.add("click"):I.add(P))}),I.size?I:new Set(["manual"])})((s=(t=l.trigger)!=null?t:l.triggers)!=null?s:z("open")?"manual":null),E=te.has("hover"),ve=te.has("focus"),le=te.has("click"),ie=te.has("manual")||!E&&!ve&&!le,ge=()=>{var Z,j,I,y,P,Q;const m={anchorEl:r||k||null,close:()=>$(),hide:()=>$(),isOpen:()=>!!c},b=l.icon?typeof l.icon=="string"?xe.Icon({name:l.icon,size:l.iconSize||l.size||"sm"}):JSswift.ui.slot(l.icon,{as:"icon"}):null,g=D(i,"title",m,(Z=l.title)!=null?Z:l.heading),T=D(i,"icon",m,b),Y=D(i,"footer",m,(j=l.footer)!=null?j:l.actions);let K=(Q=(P=(y=(I=l.content)!=null?I:l.text)!=null?y:l.body)!=null?P:l.description)!=null?Q:l.label;K==null&&(d?K=n:k&&n&&n.length>1?K=n.slice(1):k||(K=n));let _e=D(i,"content",m,K);_e.length||(_e=D(i,"default",m,K));const J=_e.length?_.div({class:"jss-tooltip-body"},..._e):null,A=T.length||g.length?_.div({class:"jss-tooltip-head"},T.length?_.div({class:"jss-tooltip-icon"},...T):null,_.div({class:"jss-tooltip-head-main"},g.length?_.div({class:"jss-tooltip-title"},...g):null,J)):J,L=Y.length?_.div({class:"jss-tooltip-footer"},...Y):null;return _.div({class:"jss-tooltip-content"},...[A,L].filter(Boolean))},ue=Z=>{var j,I,y,P,Q,m;const b=Z||r;if(!b||o(l.disabled))return null;if(c&&c._anchorEl===b)return c;c&&$();const g=(j=l.closeOnOutside)!=null?j:le||o(l.interactive),T=(I=l.closeOnEsc)!=null?I:le||o(l.interactive);let Y=null;if(c=JSswift.overlay.open(()=>ge(),{type:"tooltip",anchorEl:b,placement:l.placement||"top",offsetX:(y=l.offsetX)!=null?y:0,offsetY:(Q=(P=l.offsetY)!=null?P:l.offset)!=null?Q:8,backdrop:!1,lockScroll:!1,trapFocus:!1,closeOnOutside:g,closeOnBackdrop:!1,closeOnEsc:T,autoFocus:!1,className:Bt(["jss-tooltip",pe(l.interactive,"interactive"),l.class,l.panelClass]),onClose:()=>{var _e,J;(_e=Y==null?void 0:Y._tooltipCleanup)==null||_e.call(Y),c===Y&&(c=null),(J=l.onClose)==null||J.call(l)}}),!(c!=null&&c.panel))return c;const K=c;if(Y=K,K._anchorEl=b,K.panel.dataset.placement=String(o(l.placement||"top")),l.maxWidth!=null&&(K.panel.style.maxWidth=vt(o(l.maxWidth))),l.minWidth!=null&&(K.panel.style.minWidth=vt(o(l.minWidth))),l.width!=null&&(K.panel.style.width=vt(o(l.width))),l.style&&Object.assign(K.panel.style,l.style),Et(K.panel,l),o(l.interactive)){const _e=()=>{clearTimeout(v),v=null},J=()=>M(),A=L=>{const O=L.target;O&&O.closest&&O.closest("[data-tooltip-close]")&&$()};K.panel.addEventListener("mouseenter",_e),K.panel.addEventListener("mouseleave",J),K.panel.addEventListener("focusin",_e),K.panel.addEventListener("focusout",J),K.panel.addEventListener("click",A),K._tooltipCleanup=()=>{var L,O,X,we,Be;(L=K.panel)==null||L.removeEventListener("mouseenter",_e),(O=K.panel)==null||O.removeEventListener("mouseleave",J),(X=K.panel)==null||X.removeEventListener("focusin",_e),(we=K.panel)==null||we.removeEventListener("focusout",J),(Be=K.panel)==null||Be.removeEventListener("click",A)}}return ks(K),(m=l.onOpen)==null||m.call(l,K),K},fe=Z=>{clearTimeout(v),v=null,clearTimeout(a),a=setTimeout(()=>ue(Z),U())},M=(Z=!1)=>{if(clearTimeout(a),a=null,!!c){if(clearTimeout(v),Z){$();return}v=setTimeout(()=>$(),w())}},me=Z=>{c?M(!0):ue(Z)},be=()=>!!c,de=Z=>{if(!Z)return()=>{};r=Z;const j=[],I=()=>{p(),j.forEach(y=>y())};if(z("open"))return ht(l.open)?JSswift.reactive.effect(()=>{r&&(o(l.open)?ue(r):M(!0))},"UI.Tooltip:open"):l.open===!0?ue(Z):l.open===!1&&M(!0),I;if(ie||o(l.disabled))return I;if(E){const y=()=>fe(Z),P=()=>M();Z.addEventListener("mouseenter",y),Z.addEventListener("mouseleave",P),j.push(()=>{Z.removeEventListener("mouseenter",y),Z.removeEventListener("mouseleave",P)})}if(ve){const y=()=>fe(Z),P=()=>M();Z.addEventListener("focus",y),Z.addEventListener("blur",P),j.push(()=>{Z.removeEventListener("focus",y),Z.removeEventListener("blur",P)})}if(le){const y=P=>{var Q;(Q=l.onTriggerClick)==null||Q.call(l,P),!P.defaultPrevented&&me(Z)};Z.addEventListener("click",y),j.push(()=>Z.removeEventListener("click",y))}return I};if(k){const Z=re(["jss-tooltip-wrap",l.wrapClass,l.targetClass]),j=JSswift.omit(l,["actions","anchorEl","body","closeOnEsc","closeOnOutside","content","delay","description","disabled","footer","heading","hideDelay","icon","iconSize","interactive","label","maxWidth","minWidth","offset","offsetX","offsetY","onClose","onOpen","onTriggerClick","open","panelClass","placement","slots","style","target","targetClass","targetStyle","text","title","trigger","triggerEl","triggers","width","wrapClass","wrapStyle"]);j.class=Z,j.style={display:"inline-flex",alignItems:"center",...l.wrapStyle||l.targetStyle||{}};const I=JSswift.ui.renderSlot(i,"target",{open:()=>ue(r),show:()=>fe(r),hide:()=>M(!0),toggle:()=>me(r),isOpen:be},k),y=_.span(j,...D(null,"default",{},I));return de(y),y._tooltip={bind:de,open:ue,show:fe,hide:M,close:$,toggle:me,isOpen:be},y}return{bind:de,open:ue,show:fe,hide:M,close:$,toggle:me,isOpen:be}};const Tl=(e,t,s={})=>{var l;const{props:n,children:i}=JSswift.uiNormalizeArgs(t),c=n.slots||{},a=e==="radio",v=s.appearance==="toggle",r=!a,z=n.id||`jss-${e}-`+Math.random().toString(36).slice(2),d=en(n.model,s.modelName||(a?"UI.Radio:model":"UI.Checkbox:model")),k=JSswift.omit(n,["model","label","checked","class","style","dense","onChange","onInput","slots","icon","iconOn","iconOff","iconStandby","checkedIcon","uncheckedIcon","standbyIcon","indeterminateIcon","inputClass","iconSize","color","size","outline","behavior","mode","flat","glossy","glow","glass","gradient","textGradient","lightShadow","shadow","rounded","radius","textColor","clickable","border","shortcode","shortcut","hotkey","showShortcode","showShortcut"]);k.type=e,k.id=z,a&&n.name!=null&&(k.name=n.name),k.class=re([`jss-${e}`,"jss-choice-input",n.inputClass]);const N=_.input(k),p=D(c,"label",{},n.label),U=p.length?p:D(c,"default",{},i),w=He(n,{className:"jss-shortcode jss-choice-shortcode"}),$=w?[...U,w]:U,B=JSswift.omit(n,["model","label","checked","onChange","onInput","value","name","id","type","dense","inputClass","slots","icon","iconOn","iconOff","iconStandby","checkedIcon","uncheckedIcon","standbyIcon","indeterminateIcon","iconSize","color","size","behavior","mode","outline","flat","glossy","glow","glass","gradient","textGradient","lightShadow","shadow","rounded","radius","textColor","clickable","border","shortcode","shortcut","hotkey","showShortcode","showShortcut"]);B.class=re(["jss-clear-set","jss-singularity-check","jss-choice-wrap",`jss-${e}-wrap`,pe(v,"jss-toggle-wrap"),pe(v&&a,"jss-toggle-radio-wrap"),pe(v&&!a,"jss-toggle-checkbox-wrap"),pe(n.dense,"dense"),n.class]),B.style={...n.style||{}};const te=o(n.size);te!=null&&!(typeof te=="string"&&((l=JSswift.uiSizes)!=null&&l.includes(te)))&&(B.style["--jss-choice-size"]=vt(te));const E=_.span({class:re(["jss-choice-mark",a?"jss-choice-radio-mark":"jss-choice-checkbox-mark",pe(v,"jss-toggle-mark")])}),ve=v?_.span({class:"jss-toggle-thumb"}):E;v&&E.appendChild(ve);const le=$.length?_.span({class:"jss-choice-label"},...$):null,ie=_.label(B,N,E,le);Et(ie,n);const ge=n.iconSize?n.iconSize:n.size,ue=v?null:a?"radio_button_checked":"check",fe=v?null:a?"radio_button_unchecked":null,M=v||a?null:"indeterminate_check_box",me=j=>{if(a)return N.checked=j==n.value,N.checked;const I=j==null?null:!!j;return N.checked=I===!0,N.indeterminate=r&&I==null,I},be=()=>!a&&r&&N.indeterminate?null:!!N.checked,de=j=>j===!0?n.checkedIcon!=null?n.checkedIcon:n.icon!=null?n.icon:ue:j===!1?n.uncheckedIcon!=null?n.uncheckedIcon:fe:n.indeterminateIcon!=null?n.indeterminateIcon:n.standbyIcon!=null?n.standbyIcon:n.iconStandby!=null?n.iconStandby:M,Z=()=>{const j=be(),I=j===!0;for(;ve.firstChild;)ve.removeChild(ve.firstChild);ie.classList.toggle("is-checked",I),ie.classList.toggle("is-indeterminate",j==null),ie.classList.toggle("is-disabled",!!N.disabled),I&&(n.checkedIcon||n.icon)?ie.classList.toggle("toggle-default",!1):I&&!n.checkedIcon||j==null&&!n.standbyIcon?ie.classList.toggle("toggle-default",!0):j==null&&n.standbyIcon?ie.classList.toggle("toggle-default",!1):N.disabled===!1&&!n.uncheckedIcon?ie.classList.toggle("toggle-default",!0):ie.classList.toggle("toggle-default",!1),v&&(j==null?ve.style.transform="translateX(calc((var(--jss-toggle-width) - var(--jss-toggle-thumb-size) - 1px) / 2))":ve.style.removeProperty("transform"));const y={checked:I,state:j,indeterminate:j==null,value:n.value,id:z,type:e};let P=null;if(j===!0?(P=JSswift.ui.renderSlot(c,"checkedIcon",y,null),P==null&&(P=JSswift.ui.renderSlot(c,"iconOn",y,null))):j===!1?(P=JSswift.ui.renderSlot(c,"uncheckedIcon",y,null),P==null&&(P=JSswift.ui.renderSlot(c,"iconOff",y,null))):(P=JSswift.ui.renderSlot(c,"indeterminateIcon",y,null),P==null&&(P=JSswift.ui.renderSlot(c,"standbyIcon",y,null)),P==null&&(P=JSswift.ui.renderSlot(c,"iconStandby",y,null))),P==null&&(P=JSswift.ui.renderSlot(c,"icon",y,null)),P==null){const Q=de(j);typeof Q=="string"?P=xe.Icon({name:Q,size:ge,...v?{textColor:n.color,outline:!0}:{}}):Q!=null&&(P=JSswift.ui.slot(Q,{checked:I,state:j,indeterminate:j==null,as:j===!0?"checkedIcon":j===!1?"uncheckedIcon":"indeterminateIcon"}))}D(null,"default",{},P).forEach(Q=>ve.appendChild(Q))};return d?(me(d.get()),d.watch(j=>{me(j),Z()},a?"UI.Radio:watch":"UI.Checkbox:watch"),N.addEventListener("change",j=>{var I,y;if(a)N.checked&&(d.set(n.value),(I=n.onChange)==null||I.call(n,n.value,j));else{const P=be();d.set(P),(y=n.onChange)==null||y.call(n,P,j)}Z()})):(me(a?n.checked===!0?n.value:void 0:n.checked),N.addEventListener("change",j=>{var I,y;a?(I=n.onChange)==null||I.call(n,n.value,j):(y=n.onChange)==null||y.call(n,be(),j),Z()})),n.onInput&&N.addEventListener("input",j=>{var I,y;a?(I=n.onInput)==null||I.call(n,n.value,j):(y=n.onInput)==null||y.call(n,be(),j)}),Z(),Me(ie,n,{isEnabled:()=>!N.disabled,action:()=>{if(N.disabled)return!1;ze(N),N.click()}}),ie};xe.Checkbox=(...e)=>Tl("checkbox",e),xe.Radio=(...e)=>Tl("radio",e),xe.Toggle=(...e)=>{var t,s,l;const{props:n}=JSswift.uiNormalizeArgs(e),i=String((l=(s=(t=n.behavior)!=null?t:n.mode)!=null?s:n.type)!=null?l:"checkbox").toLowerCase()==="radio"?"radio":"checkbox";return Tl(i,e,{appearance:"toggle",modelName:"UI.Toggle:model"})},xe.Slider=(...e)=>{var t,s,l,n,i;const{props:c,children:a}=JSswift.uiNormalizeArgs(e),v=c.slots||{},r=c.model||(yt(c.value)||rt(c.value)?c.value:null),z=en(r,"UI.Slider:model"),d=JSswift.omit(c,["model","value","class","style","onChange","onInput","slots","label","icon","iconRight","thumbIcon","iconThumb","pointIcon","markers","markerLabels","labelMarks","leftLabel","rightLabel","startLabel","endLabel","minLabel","maxLabel","withQItem","qitem","item","itemClass","itemStyle","showValue","thumbLabel","labelValue","selectionColor","trackColor","thumbColor","inputClass","readonly","size"]);d.type="range",d.class=re(["jss-slider-input",c.inputClass]);const k=_.input(d),N={...c.style||{}},p=o(c.size);if(p!=null){const W=typeof p=="string"&&((t=JSswift.uiSizes)!=null&&t.includes(p))?`var(--jss-size-${p})`:vt(p);N["--jss-slider-size"]=W,N["--jss-slider-track-size"]=`max(4px, calc(${W} / 4))`,N["--jss-slider-box-height"]=`calc(${W} * 1.5)`,N["--jss-slider-marker-size"]=`max(6px, calc(${W} / 3))`}const U=_.label({class:re(["jss-clear-set","jss-singularity-check","jss-slider-wrap",pe(c.dense,"dense"),c.class]),style:N});Et(U,c);const w=_.div({class:"jss-slider-header"}),$=_.span({class:"jss-slider-label"}),B=_.span({class:"jss-slider-value"});w.append($,B);const te=_.div({class:"jss-slider-body"}),E=_.span({class:"jss-slider-icon jss-slider-icon-left"}),ve=_.span({class:"jss-slider-edge-label jss-slider-edge-label-left"}),le=_.div({class:"jss-slider-main"}),ie=_.div({class:"jss-slider-box",style:{minHeight:"var(--jss-slider-box-height, 36px)"}}),ge=_.span({class:"jss-slider-rail",style:{height:"var(--jss-slider-track-size, 6px)"}}),ue=_.span({class:"jss-slider-selection",style:{height:"var(--jss-slider-track-size, 6px)"}}),fe=_.span({class:"jss-slider-thumb",style:{width:"var(--jss-slider-size, 24px)",height:"var(--jss-slider-size, 24px)"}}),M=_.span({class:"jss-slider-thumb-icon"}),me=_.span({class:"jss-slider-thumb-label"});fe.append(me,M);const be=_.div({class:"jss-slider-markers"}),de=_.span({class:"jss-slider-edge-label jss-slider-edge-label-right"}),Z=_.span({class:"jss-slider-icon jss-slider-icon-right"});ie.append(ge,ue,fe,k),le.append(ie,be),te.append(E,ve,le,de,Z),U.append(w,te);const j=W=>{for(;W.firstChild;)W.removeChild(W.firstChild)},I=(W,ee,Ne="")=>{j(W),(ee||[]).forEach(Te=>W.appendChild(Te)),W.style.display=W.childNodes.length?Ne:"none"},y=W=>yt(W)||rt(W)?o(W):W,P=(W,ee={})=>Bs(y(W),ee),Q=(W,ee,Ne={})=>{var Te,oe;const Pe=y(W);return Pe==null?[]:typeof Pe=="string"?[xe.Icon({name:Pe,size:(oe=(Te=c.iconSize)!=null?Te:c.size)!=null?oe:16})]:P(Pe,{...Ne,as:ee})},m=(W,ee)=>{const Ne=Number(W);return Number.isFinite(Ne)?Ne:ee},b=()=>m(o(c.min),0),g=()=>{const W=b(),ee=m(o(c.max),100);return ee<W?W:ee},T=()=>{const W=o(c.step);if(W==="any")return"any";const ee=m(W,1);return ee>0?ee:1},Y=W=>{if(W==="any")return 0;const ee=String(W);if(ee.includes("e-"))return Number(ee.split("e-")[1]||0);const Ne=ee.indexOf(".");return Ne===-1?0:ee.length-Ne-1},K=W=>{const ee=b(),Ne=g(),Te=T();let oe=m(W,ee);if(Te!=="any"){oe=ee+Math.round((oe-ee)/Te)*Te;const Pe=Y(Te);Pe>0&&(oe=Number(oe.toFixed(Pe)))}return Math.min(Ne,Math.max(ee,oe))},_e=W=>{const ee=b(),Te=g()-ee;if(!Te)return 0;const oe=(K(W)-ee)/Te,Pe=o(c.reverse)?1-oe:oe;return Math.max(0,Math.min(1,Pe))},[J,A]=JSswift.reactive.signal(K(z?z.get():(l=(s=o(c.value))!=null?s:o(c.min))!=null?l:0)),L=(W,ee={})=>{const Ne=K(W);return J()!==Ne&&A(Ne),String(k.value)!==String(Ne)&&(k.value=String(Ne)),z&&ee.fromModel!==!0&&z.set(Ne),Ne},O=()=>{var W;const ee=o(c.markers),Ne=!!o((W=c.markerLabels)!=null?W:c.labelMarks);if(!ee)return[];const Te=b(),oe=g(),Pe=(Ie,Le)=>{var Ye,ct,Re,C,Se,Fe,F,f;if(Ie==null)return null;if(typeof Ie=="object"&&!Array.isArray(Ie)){const x=K((Re=(ct=(Ye=Ie.value)!=null?Ye:Ie.position)!=null?ct:Ie.at)!=null?Re:Te);return{key:(C=Ie.key)!=null?C:`marker-${Le}-${x}`,value:x,label:(Se=Ie.label)!=null?Se:Ne?String(x):null,icon:(Fe=Ie.icon)!=null?Fe:null,className:(f=(F=Ie.class)!=null?F:Ie.className)!=null?f:""}}const h=K(Ie);return{key:`marker-${Le}-${h}`,value:h,label:Ne?String(Ie):null,icon:null,className:""}};if(Array.isArray(ee))return ee.map((Ie,Le)=>Pe(Ie,Le)).filter(Boolean);if(typeof ee=="number"&&ee>1){const Ie=Math.floor(ee),Le=Ie>1?(oe-Te)/(Ie-1):0;return Array.from({length:Ie},(Ye,ct)=>Pe(Te+Le*ct,ct)).filter(Boolean)}if(ee===!0){const Ie=T();if(Ie==="any")return[Pe(Te,0),Pe(oe,1)].filter(Boolean);const Le=Math.floor((oe-Te)/Ie)+1;return Le>24?[Pe(Te,0),Pe((Te+oe)/2,1),Pe(oe,2)].filter(Boolean):Array.from({length:Le},(Ye,ct)=>Pe(Te+Ie*ct,ct)).filter(Boolean)}return typeof ee=="object"?Object.keys(ee).map((Ie,Le)=>Pe({value:Number(Ie),label:ee[Ie]},Le)).filter(Boolean):[]},X=()=>{j(be);const W=O();be.style.display=W.length?"block":"none",be.style.minHeight=W.some(ee=>ee.label!=null&&ee.label!=="")?"30px":"10px",W.forEach(ee=>{const Ne=_e(ee.value),Te=o(c.reverse)?J()<=ee.value:J()>=ee.value,oe=_.button({type:"button",class:re(["jss-slider-marker",ee.className,pe(()=>Te,"active")]),style:{left:`${Ne*100}%`,color:Te?o(c.color)||"var(--jss-primary)":"var(--jss-muted)",cursor:o(c.disabled)||o(c.readonly)?"default":"pointer"},disabled:!!o(c.disabled)||!!o(c.readonly),onClick:()=>{var Re,C;if(o(c.disabled)||o(c.readonly))return;const Se=L(ee.value);(Re=c.onInput)==null||Re.call(c,Se),(C=c.onChange)==null||C.call(c,Se)}}),Pe={marker:ee,active:Te,value:ee.value,current:J(),input:k};let Ie=JSswift.ui.renderSlot(v,"marker",Pe,null);Ie==null&&ee.icon!=null&&(Ie=typeof ee.icon=="string"?xe.Icon({name:ee.icon,size:12}):JSswift.ui.slot(ee.icon,{...Pe,as:"marker"}));const Le=_.span({class:"jss-slider-marker-tick",style:{width:"var(--jss-slider-marker-size, 8px)",height:"var(--jss-slider-marker-size, 8px)",background:Te?o(c.color)||"var(--jss-primary)":"var(--jss-border-color)"}}),Ye=Ie==null?[Le]:D(null,"default",Pe,Ie),ct=ee.label==null?D(v,"markerLabel",Pe,null):D(v,"markerLabel",Pe,ee.label);Ye.forEach(Re=>oe.appendChild(Re)),ct.length&&oe.appendChild(_.span({class:"jss-slider-marker-label"},...ct)),be.appendChild(oe)})},we=()=>{var W;const ee={value:J(),input:k,props:c};let Ne=D(v,"label",ee,y(c.label));Ne.length||(Ne=D(v,"default",ee,a)),I($,Ne,"inline-flex");const Te=o(c.showValue),oe=Te===!1?null:(W=y(c.labelValue))!=null?W:J(),Pe=Te||y(c.labelValue)!=null?D(v,"value",ee,oe):[];I(B,Pe,"inline-flex"),w.style.display=$.childNodes.length||B.childNodes.length?"flex":"none"},Be=()=>{var W,ee,Ne,Te;const oe={value:J(),input:k,props:c},Pe=D(v,"icon",oe,null),Ie=Pe.length?Pe:Q(c.icon,"icon",oe);I(E,Ie,"inline-flex");const Le=D(v,"iconRight",oe,null),Ye=Le.length?Le:Q(c.iconRight,"iconRight",oe);I(Z,Ye,"inline-flex");const ct=y((ee=(W=c.startLabel)!=null?W:c.leftLabel)!=null?ee:c.minLabel),Re=y((Te=(Ne=c.endLabel)!=null?Ne:c.rightLabel)!=null?Te:c.maxLabel);I(ve,D(v,"startLabel",oe,ct),"inline-flex"),I(de,D(v,"endLabel",oe,Re),"inline-flex")},Ue=()=>{var W,ee,Ne,Te;const oe={value:J(),input:k,props:c},Pe=D(v,"thumbIcon",oe,null),Ie=(ee=(W=c.thumbIcon)!=null?W:c.iconThumb)!=null?ee:c.pointIcon;I(M,Pe.length?Pe:Q(Ie,"thumbIcon",oe),"inline-flex");const Le=(Te=(Ne=y(c.thumbLabel))!=null?Ne:y(c.labelValue))!=null?Te:o(c.showValue)?String(J()):null,Ye=D(v,"thumbLabel",oe,Le);I(me,Ye,"inline-flex")},H=()=>{const W=K(J()),ee=b(),Ne=g(),Te=T(),Pe=`${_e(W)*100}%`,Ie=o(c.color)||o(c.selectionColor)||"var(--jss-primary)",Le=o(c.trackColor)||"var(--jss-border-color)",Ye=o(c.thumbColor)||Ie,ct=!!o(c.readonly),Re=!!o(c.disabled);k.min=String(ee),k.max=String(Ne),k.step=Te==="any"?"any":String(Te),k.disabled=Re,k.value=String(W),ge.style.background=Le,ue.style.background=Ie,ue.style.width=Pe,fe.style.left=Pe,fe.style.borderColor=Ye,fe.style.color=Ye,me.style.background=Ie,U.classList.toggle("is-disabled",Re),U.classList.toggle("is-readonly",ct),U.classList.toggle("has-markers",be.childNodes.length>0)};if(z?(L(z.get(),{fromModel:!0}),z.watch(W=>{L(W,{fromModel:!0})},"UI.Slider:watch")):ht(c.value)?JSswift.reactive.effect(()=>{L(o(c.value),{fromModel:!0})},"UI.Slider:value"):L((i=(n=c.value)!=null?n:c.min)!=null?i:0,{fromModel:!0}),k.addEventListener("input",W=>{var ee;if(o(c.disabled)||o(c.readonly)){k.value=String(J());return}const Ne=L(k.value);(ee=c.onInput)==null||ee.call(c,Ne,W)}),k.addEventListener("change",W=>{var ee;if(o(c.disabled)||o(c.readonly)){k.value=String(J());return}const Ne=L(k.value);(ee=c.onChange)==null||ee.call(c,Ne,W)}),JSswift.reactive.effect(()=>{we(),Be(),Ue(),X(),H()},"UI.Slider:render"),U._input=k,U._getValue=J,U._setValue=W=>L(W),c.withQItem||c.qitem||c.item===!0){const W=xe.Item({class:re(["jss-slider-item",c.itemClass]),style:c.itemStyle},U);return W._input=k,W._slider=U,W._getValue=J,W._setValue=U._setValue,W}return U},xe.Rating=(...e)=>{var t;const{props:s,children:l}=JSswift.uiNormalizeArgs(e),n=s.slots||{},i=s.model||(yt(s.value)||rt(s.value)?s.value:null),c=en(i,"UI.Rating:model"),a=s.id||"jss-rating-"+Math.random().toString(36).slice(2),v=JSswift.omit(s,["model","value","max","class","style","dense","readonly","disabled","clearable","half","allowHalf","noDimming","label","slots","onChange","onInput","onHover","icon","checkedIcon","uncheckedIcon","halfIcon","hoveredIcon","iconSelected","iconHalf","iconHovered","iconOn","iconOff","iconSize","color","colorSelected","colorHalf","colorHovered","colorInactive","activeColor","halfColor","hoverColor","size","gap","tabindex","tabIndex","inputClass"]);v.type="hidden",v.id=a,s.name!=null&&(v.name=s.name),v.class=re(["jss-rating-input","jss-choice-input",s.inputClass]);const r=_.input(v),z=JSswift.omit(s,["model","value","max","id","name","type","class","style","dense","readonly","disabled","clearable","half","allowHalf","noDimming","label","slots","onChange","onInput","onHover","icon","checkedIcon","uncheckedIcon","halfIcon","hoveredIcon","iconSelected","iconHalf","iconHovered","iconOn","iconOff","iconSize","color","colorSelected","colorHalf","colorHovered","colorInactive","activeColor","halfColor","hoverColor","size","gap","tabindex","tabIndex","inputClass"]);z.class=re(["jss-clear-set","jss-singularity-check","jss-choice-wrap","jss-rating","jss-rating-wrap",pe(s.dense,"dense"),s.class]),z.style={...s.style||{}};const d=o(s.size);d!=null&&!(typeof d=="string"&&((t=JSswift.uiSizes)!=null&&t.includes(d)))&&(z.style["--jss-rating-size"]=vt(d));const k=o(s.gap);k!=null&&(z.style["--jss-rating-gap"]=vt(k));const N=_.span({class:"jss-rating-control",onMouseleave:T=>{var Y;de!=null&&(de=null,b(),(Y=s.onHover)==null||Y.call(s,M(),T))},onKeydown:T=>{if(!fe())return;const Y=le()?.5:1,K=M();let _e=K;switch(T.key){case"ArrowRight":case"ArrowUp":_e=K+Y;break;case"ArrowLeft":case"ArrowDown":_e=K-Y;break;case"Home":_e=o(s.clearable)?0:Y;break;case"End":_e=ve();break;case"Delete":case"Backspace":case"0":if(!o(s.clearable))return;_e=0;break;case" ":case"Enter":_e=K||(o(s.clearable)?Y:Math.max(Y,1));break;default:return}T.preventDefault(),g(_e,T,{emit:!0})}}),p=_.span({class:"jss-choice-label jss-rating-label"}),U=_.label(z,r,N,p);Et(U,s);const w=T=>{for(;T.firstChild;)T.removeChild(T.firstChild)},$=(T,Y,K="")=>{w(T),(Y||[]).forEach(_e=>T.appendChild(_e)),T.style.display=T.childNodes.length?K:"none"},B=T=>yt(T)||rt(T)?o(T):T,te=(T,Y={})=>Bs(B(T),Y),E=(T,Y,K={})=>{var _e,J;const A=B(T);return A==null?[]:typeof A=="string"?[xe.Icon({name:A,color:s.color,size:(J=(_e=s.iconSize)!=null?_e:s.size)!=null?J:16})]:te(A,{...K,as:Y})},ve=()=>{var T;const Y=Number((T=o(s.max))!=null?T:5);return Number.isFinite(Y)&&Y>0?Math.max(1,Math.round(Y)):5},le=()=>{var T;return!!o((T=s.half)!=null?T:s.allowHalf)},ie=(T,Y=ve())=>{let K=Number(o(T));Number.isFinite(K)||(K=0),K=Math.min(Y,Math.max(0,K));const _e=le()?.5:1;return Math.round(K/_e)*_e},ge=()=>!!o(s.disabled),ue=()=>!!o(s.readonly),fe=()=>!ge()&&!ue(),M=()=>ie(c?c.get():be),me=T=>{const Y=T>0?String(T):"";r.value=Y,r.setAttribute("value",Y),r.disabled=ge()};let be=ie(c?c.get():o(s.value)),de=null,Z=0,j=[];const I=(T,Y)=>{if(!le())return ie(T);const K=Y.currentTarget.getBoundingClientRect(),_e=Y.clientX-K.left<=K.width/2;return ie(_e?T-.5:T)},y=(T,Y)=>T>=Y?"full":le()&&T>=Y-.5?"half":"empty",P=(T,Y)=>{var K,_e,J,A,L,O,X,we,Be,Ue,H,W,ee,Ne,Te;const oe=o((J=(_e=(K=s.colorSelected)!=null?K:s.activeColor)!=null?_e:s.color)!=null?J:s.textColor)||"var(--jss-warning, #f0b429)",Pe=o((we=(X=(O=(L=(A=s.colorHalf)!=null?A:s.halfColor)!=null?L:s.colorSelected)!=null?O:s.activeColor)!=null?X:s.color)!=null?we:s.textColor)||oe,Ie=o((ee=(W=(H=(Ue=(Be=s.colorHovered)!=null?Be:s.hoverColor)!=null?Ue:s.colorSelected)!=null?H:s.activeColor)!=null?W:s.color)!=null?ee:s.textColor)||oe,Le=o((Te=(Ne=s.colorInactive)!=null?Ne:s.colorOff)!=null?Te:s.color)||"var(--jss-muted)";return Y?Ie:T==="full"?oe:T==="half"?Pe:Le},Q=T=>{var Y,K,_e,J,A,L,O,X,we,Be,Ue,H,W,ee,Ne;const Te=[];T.hovered&&T.state!=="empty"&&Te.push("hoveredIcon","iconHovered"),T.state==="full"?Te.push("checkedIcon","selectedIcon","iconSelected","iconOn"):T.state==="half"?Te.push("halfIcon","iconHalf"):Te.push("uncheckedIcon","iconOff"),Te.push("icon","item","star");for(const Ie of Te){const Le=D(n,Ie,T,null);if(Le.length)return Le}let oe=null,Pe="icon";return T.hovered&&T.state!=="empty"&&(oe=(Y=s.hoveredIcon)!=null?Y:s.iconHovered,Pe="hoveredIcon"),oe==null&&T.state==="full"?(oe=(A=(J=(_e=(K=s.checkedIcon)!=null?K:s.iconSelected)!=null?_e:s.iconOn)!=null?J:s.icon)!=null?A:"star",Pe="checkedIcon"):oe==null&&T.state==="half"?(oe=(Be=(we=(X=(O=(L=s.halfIcon)!=null?L:s.iconHalf)!=null?O:s.checkedIcon)!=null?X:s.iconSelected)!=null?we:s.icon)!=null?Be:"star_half",Pe="halfIcon"):oe==null&&(oe=(Ne=(Ue=s.uncheckedIcon)!=null?Ue:s.iconOff)!=null?Ne:o(s.noDimming)?(ee=(W=(H=s.icon)!=null?H:s.checkedIcon)!=null?W:s.iconSelected)!=null?ee:"star":"star_border",Pe="uncheckedIcon"),E(oe,Pe,T)},m=()=>{const T=ve();if(Z!==T){Z=T,j=[],w(N);for(let Y=1;Y<=T;Y++){const K=_.span({class:"jss-rating-item-icon"}),_e=_.span({class:"jss-rating-item",role:"radio",tabIndex:-1,onMousemove:J=>{var A;if(!fe())return;const L=I(Y,J);de!==L&&(de=L,b(),(A=s.onHover)==null||A.call(s,L,J))},onClick:J=>{if(!fe())return;let A=I(Y,J);o(s.clearable)&&A===M()&&(A=0),g(A,J,{emit:!0})}},K);j.push({item:_e,iconHost:K,index:Y}),N.appendChild(_e)}}},b=()=>{var T,Y;m();const K=ve(),_e=M(),J=de==null?_e:ie(de,K),A=ge(),L=ue(),O=!!o(s.clearable),X=!!o(s.noDimming);U.classList.toggle("is-disabled",A),U.classList.toggle("is-readonly",L),U.classList.toggle("is-hovering",de!=null),U.classList.toggle("is-clearable",O),U.classList.toggle("is-half",le()),U.classList.toggle("no-dimming",X);const we=Number((Y=o((T=s.tabindex)!=null?T:s.tabIndex))!=null?Y:0);N.tabIndex=A?-1:we,N.setAttribute("role","slider"),N.setAttribute("aria-valuemin","0"),N.setAttribute("aria-valuemax",String(K)),N.setAttribute("aria-valuenow",String(_e)),N.setAttribute("aria-disabled",A?"true":"false"),N.setAttribute("aria-readonly",L?"true":"false"),me(_e);const Be=D(n,"label",{value:_e,max:K,disabled:A,readonly:L,clearable:O},s.label!=null?B(s.label):l);$(p,Be,"inline-flex"),j.forEach(({item:Ue,iconHost:H,index:W})=>{const ee=y(J,W),Ne=de!=null&&ee!=="empty",Te={index:W,max:K,value:_e,displayValue:J,state:ee,active:ee!=="empty",checked:ee==="full",half:ee==="half",hovered:Ne,disabled:A,readonly:L,clearable:O,setValue:oe=>g(oe,null,{emit:!1})};Ue.className=Bt(["jss-rating-item",`is-${ee}`,pe(Ne,"is-hovered")]),Ue.style.color=P(ee,Ne),Ue.style.opacity=ee==="empty"&&!X?"0.48":"1",Ue.setAttribute("aria-checked",String(_e===W)),$(H,Q(Te),"inline-flex")})},g=(T,Y,K={})=>{var _e,J;const A=ie(T),L=M();return be=A,de=null,c&&K.fromModel!==!0&&c.set(A),me(A),b(),K.emit!==!1&&A!==L&&((_e=s.onInput)==null||_e.call(s,A,Y),(J=s.onChange)==null||J.call(s,A,Y)),A};return U._input=r,U._rating=N,U._getValue=M,U._setValue=T=>g(T,null,{emit:!1}),c&&c.watch(T=>{const Y=ie(T);serializeValue(Y)!==serializeValue(be)&&(be=Y,de=null,me(be),b())},"UI.Rating:watch"),JSswift.reactive.effect(()=>{!c&&s.value!=null&&(be=ie(o(s.value))),b()},"UI.Rating:render"),U};const Wt=e=>e?{hour:Number(e.hour)||0,minute:Number(e.minute)||0,second:Number(e.second)||0}:null,Bn=e=>String(Math.max(0,Number(e)||0)).padStart(2,"0"),On=(e,t={})=>{var s,l,n,i,c,a,v,r,z,d,k,N,p,U,w;if(e==null||e==="")return null;let $=null,B=null,te=0,E=null;if(e instanceof Date&&!Number.isNaN(e.getTime()))$=e.getHours(),B=e.getMinutes(),te=e.getSeconds();else if(typeof e=="number"&&Number.isFinite(e)){const le=Math.max(0,Math.floor(e));$=Math.floor(le/3600)%24,B=Math.floor(le/60)%60,te=le%60}else if(typeof e=="object"){if(e.time!=null||e.value!=null)return On((s=e.time)!=null?s:e.value,t);$=Number((i=(n=(l=e.hour)!=null?l:e.hours)!=null?n:e.h)!=null?i:e.hh),B=Number((r=(v=(a=(c=e.minute)!=null?c:e.minutes)!=null?a:e.min)!=null?v:e.mm)!=null?r:0),te=Number((N=(k=(d=(z=e.second)!=null?z:e.seconds)!=null?d:e.sec)!=null?k:e.ss)!=null?N:0),E=(w=(U=(p=e.meridiem)!=null?p:e.ampm)!=null?U:e.period)!=null?w:null}else if(typeof e=="string"){const le=e.trim();if(!le)return null;const ie=le.match(/^(\d{1,2})(\d{2})(\d{2})?$/),ge=le.match(/(\d{1,2}):(\d{1,2})(?::(\d{1,2}))?\s*([ap]m)?/i);if(ge)$=Number(ge[1]),B=Number(ge[2]),te=ge[3]!=null?Number(ge[3]):0,E=ge[4]||null;else if(ie)$=Number(ie[1]),B=Number(ie[2]),te=ie[3]!=null?Number(ie[3]):0;else return null}else return null;if(!Number.isFinite($)||!Number.isFinite(B)||!Number.isFinite(te))return null;if(E){const le=String(E).toLowerCase();le==="pm"&&$<12&&($+=12),le==="am"&&$===12&&($=0)}if($<0||$>23||B<0||B>59||te<0||te>59)return null;const ve={hour:Math.floor($),minute:Math.floor(B),second:Math.floor(te)};return Zl(ve,t)},Yn=(e,t={})=>{const s=e&&typeof e=="object"&&e.hour!=null?Wt(e):On(e,t);if(!s)return"";const l=t.withSeconds===!0||Number(s.second||0)>0;return`${Bn(s.hour)}:${Bn(s.minute)}${l?`:${Bn(s.second)}`:""}`},ul=(e,t)=>{const s=Yn(e,{withSeconds:!0}),l=Yn(t,{withSeconds:!0});return!s&&!l?0:s?l?s<l?-1:s>l?1:0:1:-1};function Zl(e,t={}){if(!e)return null;const s=Wt(e),l=t.min!=null?On(t.min,{withSeconds:!0}):null,n=t.max!=null?On(t.max,{withSeconds:!0}):null;return l&&ul(s,l)<0?Wt(l):n&&ul(s,n)>0?Wt(n):s}const zn=(e,t={})=>e==null||e===""?null:e instanceof Date?On(e,t):typeof e=="object"?On(e.time!=null?e.time:e,t):typeof e=="string"||typeof e=="number"?On(e,t):null,dl=(e,t={})=>{var s;const l=On(e,t);if(!l)return"";const n=t.withSeconds===!0||Number(l.second||0)>0;if(!!!o((s=t.use12h)!=null?s:t.ampm))return`${Bn(l.hour)}:${Bn(l.minute)}${n?`:${Bn(l.second)}`:""}`;const c=l.hour>=12?"PM":"AM",a=l.hour%12||12;return`${Bn(a)}:${Bn(l.minute)}${n?`:${Bn(l.second)}`:""} ${c}`},To=(e,t,s={})=>{if(!e)return"";const l=Yn(t,s);return l?`${e}T${l}`:e},Rl=(e,t)=>{const s=Math.max(1,Math.min(t+1,Math.round(Number(e)||1))),l=[];for(let n=0;n<=t;n+=s)l.push(n);return l},eo=(e={})=>{const{props:t={},slots:s={},value:l=null,withSeconds:n=!1,minuteStep:i=5,secondStep:c=5,disabled:a=!1,readonly:v=!1,embedded:r=!1,className:z="",slotPrefix:d="",shortcuts:k=null,onSelect:N=null}=e,p=On(l,{withSeconds:n,min:t.min,max:t.max}),U=p||On(new Date,{withSeconds:n,min:t.min,max:t.max})||{hour:0,minute:0,second:0},w=p?Wt(p):null,$=ue=>d?`${d}${ue[0].toUpperCase()}${ue.slice(1)}`:null,B=(ue,fe,M)=>{const me=[$(ue),ue].filter(Boolean);for(const be of me){if(JSswift.ui.getSlot(s,be)==null)continue;const Z=JSswift.ui.renderSlot(s,be,fe,M);if(Z!=null)return Z}return JSswift.ui.slot(M,fe)},te=ue=>{let fe=B("point",ue,null);return fe==null&&e.pointIcon!=null&&ue.selected&&(fe=typeof e.pointIcon=="string"?xe.Icon({name:e.pointIcon,size:r?10:12}):JSswift.ui.slot(e.pointIcon,ue)),D(null,"default",ue,fe)},E=(ue,fe)=>{const M={hour:U.hour,minute:U.minute,second:n?U.second:0};return M[ue]=fe,M},ve=_.div({class:re(["jss-time-section",pe(r,"is-embedded"),pe(n,"has-seconds"),z])}),le=o(k)||[];if(Array.isArray(le)&&le.length){const ue=_.div({class:"jss-time-shortcuts"});le.forEach((fe,M)=>{var me,be,de;if(!fe)return;const Z=typeof fe.value=="function"?fe.value({now:Yn(new Date,{withSeconds:n})}):fe.value,j=On(Z,{withSeconds:n,min:t.min,max:t.max});if(!j)return;const I={item:fe,index:M,value:Yn(j,{withSeconds:n}),displayValue:dl(j,{withSeconds:n,use12h:(me=t.use12h)!=null?me:t.ampm})},y=B("shortcut",I,(de=(be=fe.label)!=null?be:fe.text)!=null?de:I.displayValue);ue.appendChild(_.button({type:"button",class:re(["jss-time-shortcut",pe(!!w&&ul(j,w)===0,"is-selected")]),disabled:a||v,onClick:()=>N==null?void 0:N(j,{shortcut:fe,index:M})},...D(null,"default",I,y)))}),ue.childNodes.length&&ve.appendChild(ue)}const ie=_.div({class:"jss-time-columns"}),ge=(ue,fe,M)=>{const me=_.div({class:"jss-time-column","data-time-part":fe}),be=_.div({class:"jss-time-options"});return M.forEach(de=>{var Z;const j=E(fe,de),I=Zl(j,{withSeconds:n,min:t.min,max:t.max}),y=a||v||ul(I,j)!==0,P=!!w&&w[fe]===de,Q={part:fe,selected:P,disabled:y,value:de,label:Bn(de),timeValue:Yn(I,{withSeconds:n}),displayValue:dl(I,{withSeconds:n,use12h:(Z=t.use12h)!=null?Z:t.ampm})},m=B("option",Q,Q.label),b=P?te(Q):[];be.appendChild(_.button({type:"button",class:re(["jss-time-option",pe(P,"is-selected"),pe(y,"is-disabled")]),disabled:y,onClick:()=>N==null?void 0:N(I,{part:fe,optionValue:de})},_.span({class:"jss-time-option-label"},...D(null,"default",Q,m)),b.length?_.span({class:"jss-time-option-point"},...b):null))}),me.appendChild(be),me};return ie.appendChild(ge(o(t.hoursLabel)||"Ore","hour",Rl(1,23))),ie.appendChild(ge(o(t.minutesLabel)||"Min","minute",Rl(i,59))),n&&ie.appendChild(ge(o(t.secondsLabel)||"Sec","second",Rl(c,59))),ve.appendChild(ie),ve},fl=e=>{if(!e)return null;const t={};return e.querySelectorAll(".jss-time-column").forEach((s,l)=>{const n=s.getAttribute("data-time-part")||String(l);t[n]=s.scrollTop}),t},to=(e,t={})=>{var s;if(!e)return;const l=t.scrollState||null,n=(s=t.behavior)!=null?s:"smooth";e.querySelectorAll(".jss-time-column").forEach((i,c)=>{const a=i.getAttribute("data-time-part")||String(c),v=l&&Number.isFinite(l[a])?l[a]:null;v!=null&&(i.scrollTop=v);const r=i.querySelector(".jss-time-option.is-selected");if(!r)return;const z=Math.max(0,i.scrollHeight-i.clientHeight),d=r.offsetTop-(i.clientHeight-r.offsetHeight)/2,k=Math.max(0,Math.min(z,d));if(Math.abs(i.scrollTop-k)<1){i.scrollTop=k;return}if(n&&typeof i.scrollTo=="function"){i.scrollTo({top:k,behavior:n});return}i.scrollTop=k})},no=(e,t={})=>{var s,l,n,i,c,a,v,r,z,d,k,N;const{props:p,children:U}=JSswift.uiNormalizeArgs(e),w=t.calendar===!0,$=p.slots||{},B=xt(p.size,()=>{const S=String(o(p.size)||"").toLowerCase();return["xs","sm","md","lg","xl"].includes(S)?`jss-size-${S}`:""}),te=String(o((i=(n=p.mode)!=null?n:o((l=(s=p.rangeMultiple)!=null?s:p.multipleRange)!=null?l:p.multiRange)?"range-multiple":null)!=null?i:p.range&&p.multiple?"range-multiple":p.range?"range":p.multiple?"multiple":"single")).toLowerCase(),E=["range-multiple","multiple-range","rangemultiple","multiplerange","range_multiple","multiple_range","multi-range","multi_range","ranges"].includes(te)?"range-multiple":te==="range"?"range":te==="multiple"?"multiple":"single",ve=p.model||(yt(p.value)||rt(p.value)?p.value:null),le=en(ve,w?"UI.Calendar:model":"UI.Datepicker:model"),ie=le?le.get():o(p.value),ge=o((c=p.rangeAs)!=null?c:p.rangeModel)==="array"||Array.isArray(ie),ue=o((a=p.rangeMultipleAs)!=null?a:p.multipleRangeAs)==="array"||Array.isArray(ie)&&Array.isArray(ie[0]),fe=()=>{var S,he,Je;return E==="single"&&!!o((Je=(he=(S=p.withTime)!=null?S:p.time)!=null?he:p.timePicker)!=null?Je:p.enableTime)},M=()=>{var S,he,Je,ft,pt,ot,_t,Mt;const Gt=Yn(zn((he=(S=o(p.timeValue))!=null?S:le?le.get():o(p.value))!=null?he:ie,{withSeconds:!0}),{withSeconds:!0});return{withSeconds:!!o((ft=(Je=p.timeWithSeconds)!=null?Je:p.withSeconds)!=null?ft:p.showSeconds)||/:\d{2}:\d{2}$/.test(Gt)||/:\d{2}:\d{2}$/.test(o(p.timeFormat)||""),min:o((pt=p.timeMin)!=null?pt:p.minTime),max:o((ot=p.timeMax)!=null?ot:p.maxTime),use12h:o((Mt=(_t=p.time12h)!=null?_t:p.use12h)!=null?Mt:p.ampm)}},me=()=>{var S,he;const Je=Number(o((he=(S=p.timeMinuteStep)!=null?S:p.minuteStep)!=null?he:5));return Math.max(1,Math.min(30,Number.isFinite(Je)?Je:5))},be=()=>{var S,he;const Je=Number(o((he=(S=p.timeSecondStep)!=null?S:p.secondStep)!=null?he:5));return Math.max(1,Math.min(30,Number.isFinite(Je)?Je:5))},de=S=>String(S).padStart(2,"0"),Z=(S,he,Je)=>{const ft=new Date(S,he,Je);return ft.getFullYear()!==S||ft.getMonth()!==he||ft.getDate()!==Je?null:ft},j=S=>!(S instanceof Date)||Number.isNaN(S.getTime())?null:`${S.getFullYear()}-${de(S.getMonth()+1)}-${de(S.getDate())}`,I=S=>{if(typeof S!="string")return null;const he=S.match(/^(\d{4})-(\d{2})-(\d{2})$/);if(!he)return null;const Je=Number(he[1]),ft=Number(he[2])-1,pt=Number(he[3]),ot=new Date(Je,ft,pt);return ot.getFullYear()!==Je||ot.getMonth()!==ft||ot.getDate()!==pt?null:ot},y=(S,he)=>{const Je=I(S);return Je?(Je.setDate(Je.getDate()+he),j(Je)):null},P=(S,he)=>new Date(S.getFullYear(),S.getMonth()+he,1),Q=S=>{if(S instanceof Date&&!Number.isNaN(S.getTime()))return new Date(S.getFullYear(),S.getMonth(),1);const he=we(S),Je=I(he);return Je?new Date(Je.getFullYear(),Je.getMonth(),1):new Date},m=()=>j(new Date),b=(S,he)=>!!S&&!!he&&S===he,g=(S,he)=>S==null&&he==null?0:S==null?-1:he==null?1:S<he?-1:S>he?1:0,T=(S,he)=>{const Je=I(S),ft=I(he);return!Je||!ft?0:Math.round((ft.getTime()-Je.getTime())/864e5)},Y=S=>Array.isArray(S)?S.slice():S==null||S===""?[]:[S],K=S=>({from:(S==null?void 0:S.from)||null,to:(S==null?void 0:S.to)||null}),_e=S=>Array.isArray(S)?S.map(K):[],J=S=>{const he=K(S);return ge?[he.from,he.to]:he},A=S=>_e(S).map(he=>ue?[he.from,he.to]:he),L=S=>E==="multiple"?Array.isArray(S)?S.slice():[]:E==="range"?K(S):E==="range-multiple"?_e(S):S||null,O=S=>E==="multiple"?Array.isArray(S)?S.slice():[]:E==="range"?J(S):E==="range-multiple"?A(S):S||"",X=S=>JSON.stringify(O(S)),we=S=>{if(S==null||S==="")return null;if(S instanceof Date)return j(S);if(typeof S=="number")return j(new Date(S));if(typeof S!="string")return typeof S=="object"&&S.date!=null?we(S.date):null;const he=S.trim();if(!he)return null;const Je=he.match(/^(\d{4})-(\d{1,2})-(\d{1,2})(?:$|[T\s])/);if(Je){const _t=Z(Number(Je[1]),Number(Je[2])-1,Number(Je[3]));return j(_t)}const ft=he.match(/^(\d{1,2})[\/.\-](\d{1,2})[\/.\-](\d{2,4})$/);if(ft){const _t=ft[3].length===2?2e3+Number(ft[3]):Number(ft[3]),Mt=Z(_t,Number(ft[2])-1,Number(ft[1]));return j(Mt)}if(/^\d{1,4}$/.test(he))return null;const pt=new Date(he);if(Number.isNaN(pt.getTime()))return null;const ot=he.match(/(?:^|[^\d])(\d{4})(?!\d)/);return ot&&pt.getFullYear()!==Number(ot[1])?null:j(pt)},Be=S=>{var he,Je,ft,pt,ot,_t;if(S==null||S==="")return{from:null,to:null};let Mt=null,Gt=null;if(Array.isArray(S))Mt=we(S[0]),Gt=we(S[1]);else if(typeof S=="object")Mt=we((ft=(Je=(he=S.from)!=null?he:S.start)!=null?Je:S.dateFrom)!=null?ft:S.departure),Gt=we((_t=(ot=(pt=S.to)!=null?pt:S.end)!=null?ot:S.dateTo)!=null?_t:S.return);else{const un=String(S).match(/\d{4}-\d{1,2}-\d{1,2}|\d{1,2}[\/.\-]\d{1,2}[\/.\-]\d{2,4}/g)||[];Mt=we(un[0]),Gt=we(un[1])}return Mt&&Gt&&Mt>Gt&&([Mt,Gt]=[Gt,Mt]),{from:Mt,to:Gt}},Ue=S=>{const he=[],Je=new Set,ft=pt=>{const ot=Be(pt);if(!ot.from)return;const _t=`${ot.from||""}|${ot.to||""}`;Je.has(_t)||(Je.add(_t),he.push(ot))};if(S==null||S==="")return he;if(Array.isArray(S))if(S.every(ot=>ot==null||typeof ot=="string"||typeof ot=="number"||ot instanceof Date)){const ot=S.map(we).filter(Boolean);for(let _t=0;_t<ot.length;_t+=2)ft({from:ot[_t],to:ot[_t+1]||null})}else S.forEach(ot=>ft(ot));else if(typeof S=="object"&&Array.isArray(S.ranges))S.ranges.forEach(pt=>ft(pt));else if(typeof S=="object")ft(S);else{const ot=(String(S).match(/\d{4}-\d{1,2}-\d{1,2}|\d{1,2}[\/.\-]\d{1,2}[\/.\-]\d{2,4}/g)||[]).map(we).filter(Boolean);for(let _t=0;_t<ot.length;_t+=2)ft({from:ot[_t],to:ot[_t+1]||null})}return he.sort((pt,ot)=>g(pt.from,ot.from)||g(pt.to,ot.to))},H=S=>{const he=[];return Y(S).forEach(Je=>{const ft=we(Je);ft&&!he.includes(ft)&&he.push(ft)}),he.sort()},W=S=>E==="range"?Be(S):E==="range-multiple"?Ue(S):E==="multiple"?H(S):we(S),ee=()=>{var S;return we(o((S=p.min)!=null?S:p.minDate))},Ne=()=>{var S;return we(o((S=p.max)!=null?S:p.maxDate))},Te=()=>o(p.locale)||void 0,oe=()=>{var S,he;const Je=Number(o((he=(S=p.firstDayOfWeek)!=null?S:p.weekStart)!=null?he:1));return Number.isFinite(Je)?(Je%7+7)%7:1},Pe=()=>{var S;const he=E==="range"||E==="range-multiple"?2:1,Je=Number((S=o(p.monthsToShow))!=null?S:he);return Math.max(1,Math.min(4,Number.isFinite(Je)?Je:he))},Ie=()=>{const S=ee(),he=Ne();let Je=we(o(p.defaultMonth))||m();return S&&Je<S&&(Je=S),he&&Je>he&&(Je=he),Je||S||he||m()},Le=()=>o(p.confirm)?Ke:Ge,Ye=S=>{const he=I(S);return he?{date:S,value:S,year:he.getFullYear(),month:he.getMonth()+1,day:he.getDate(),weekday:he.getDay(),today:b(S,m())}:{date:S,value:S}},ct=(S,he)=>S==null?!1:Array.isArray(S)?S.some(Je=>we(Je)===he):S instanceof Set?S.has(he):typeof S=="function"?!!S(he,Ye(he)):typeof S=="string"||S instanceof Date||typeof S=="number"?we(S)===he:!1,Re=S=>{var he,Je,ft,pt,ot,_t,Mt,Gt,un,an,jn,_n,dn;if(!S)return!1;const Cn=ee(),Zn=Ne();if(Cn&&S<Cn||Zn&&S>Zn)return!1;const es=o((Je=(he=p.options)!=null?he:p.enableDates)!=null?Je:p.allowedDates);if(es!=null&&!ct(es,S))return!1;const gs=o((pt=(ft=p.disableDates)!=null?ft:p.disabledDates)!=null?pt:p.notAllowedDates);if(gs!=null&&ct(gs,S))return!1;const Wn=(ot=I(S))==null?void 0:ot.getDay();if(Array.isArray(o((_t=p.allowedWeekdays)!=null?_t:p.weekdays))&&Wn!=null&&!o((Mt=p.allowedWeekdays)!=null?Mt:p.weekdays).map(Es=>Number(Es)).includes(Wn)||o(p.weekdaysOnly)&&(Wn===0||Wn===6)||o(p.weekendsOnly)&&Wn!=null&&Wn!==0&&Wn!==6)return!1;const fn=Le(),Ws=E==="range"?fn!=null&&fn.from&&!(fn!=null&&fn.to)?fn:null:E==="range-multiple"&&Array.isArray(fn)&&fn.length&&(Gt=fn[fn.length-1])!=null&&Gt.from&&!((un=fn[fn.length-1])!=null&&un.to)?fn[fn.length-1]:null;if(Ws!=null&&Ws.from){const Us=Math.abs(T(Ws.from,S)),Es=Number(o((jn=(an=p.minRange)!=null?an:p.minDays)!=null?jn:p.minNights)),xn=Number(o((dn=(_n=p.maxRange)!=null?_n:p.maxDays)!=null?dn:p.maxNights));if(Number.isFinite(Es)&&Us<Es||Number.isFinite(xn)&&Us>xn)return!1}return!0},C=S=>{var he,Je;if(!S)return"";const ft=I(S);return!ft||String(o((Je=(he=p.displayMask)!=null?he:p.mask)!=null?Je:"")||"").toLowerCase()==="iso"||o(p.isoDisplay)===!0?S:new Intl.DateTimeFormat(Te(),{year:"numeric",month:"short",day:"2-digit"}).format(ft)},Se=(S,he=We)=>{if(E==="range-multiple")return!Array.isArray(S)||!S.length?"":S.length>2&&o(p.compactMultiple)!==!1?`${S.length} ${o(p.multipleRangeLabel)||"intervalli selezionati"}`:S.map(pt=>{const ot=pt!=null&&pt.from?C(pt.from):"",_t=pt!=null&&pt.to?C(pt.to):"";return ot&&_t?`${ot} -> ${_t}`:ot||_t||""}).filter(Boolean).join("; ");if(E==="multiple")return!Array.isArray(S)||!S.length?"":S.length>3&&o(p.compactMultiple)!==!1?`${S.length} ${o(p.multipleLabel)||"date selezionate"}`:S.map(C).join(", ");if(E==="range"){const pt=S!=null&&S.from?C(S.from):"",ot=S!=null&&S.to?C(S.to):"";return pt&&ot?`${pt} -> ${ot}`:pt||ot||""}const Je=C(S);if(!fe())return Je;const ft=De(he);return[Je,ft].filter(Boolean).join(" \u2022 ")},Fe=S=>(String(S||"").match(/\d{4}-\d{1,2}-\d{1,2}|\d{1,2}[\/.\-]\d{1,2}[\/.\-]\d{2,4}/g)||[]).map(we).filter(Boolean),F=S=>{if(S==null||S==="")return E==="multiple"||E==="range-multiple"?[]:E==="range"?{from:null,to:null}:null;const he=Fe(S);if(E==="range-multiple"){const Je=[];for(let ft=0;ft<he.length;ft+=2)he[ft]&&Je.push({from:he[ft],to:he[ft+1]||null});return Je}return E==="multiple"?he:E==="range"?{from:he[0]||null,to:he[1]||null}:he[0]||we(S)},f=()=>E==="multiple"||E==="range-multiple"?[]:E==="range"?{from:null,to:null}:null,h=(S,he=null)=>{var Je;if(!fe())return null;const ft=M(),pt=o(p.timeValue),ot=S!=null?S:pt,_t=zn(ot,ft);return Wt((Je=_t!=null?_t:he)!=null?Je:null)},x=()=>o(p.confirm)?et:We,ae=(S=Ge,he=We)=>E==="single"&&fe()?To(S||null,he,M()):O(S),Oe=(S=Ge,he=We)=>JSON.stringify(ae(S,he)),De=S=>dl(S,M());let Ge=W(ie),Ke=L(Ge),We=h(ie,zn(o(p.timeValue),M())),et=Wt(We),tt=null,dt=null,gt=Q(E==="range"?(Ge==null?void 0:Ge.from)||(Ge==null?void 0:Ge.to)||Ie():E==="range-multiple"?((v=Ge==null?void 0:Ge[Ge.length-1])==null?void 0:v.from)||((r=Ge==null?void 0:Ge[Ge.length-1])==null?void 0:r.to)||Ie():E==="multiple"?Ge[0]||Ie():Ge||Ie()),At=null,It=null;const $t=S=>{const he=S instanceof Date?S:I(we(S));if(!he)return-1;const Je=he.getFullYear(),ft=he.getMonth();for(let pt=0;pt<Pe();pt+=1){const ot=P(gt,pt);if(ot.getFullYear()===Je&&ot.getMonth()===ft)return pt}return-1},zt={...p,label:(z=p.label)!=null?z:p.placeholder},Xe=zt.label!=null||JSswift.ui.getSlot($,"label")!=null,mt=E==="range"?"Seleziona andata e ritorno":E==="range-multiple"?"Seleziona intervalli":E==="multiple"?"Seleziona date":"Seleziona data",Nt=w?null:_.input({class:re(["jss-input","jss-date-display",B,pe(p.manualInput,"is-manual"),p.inputClass]),type:"text",autocomplete:"off",placeholder:Xe?"":(d=p.placeholder)!=null?d:mt,readOnly:!o(p.manualInput),disabled:!!o(p.disabled),value:Se(Ge,We)}),Zt=_.div({style:{display:"contents"}}),rn=w?null:_.div({class:"jss-date-control",style:{display:"contents"}},Nt,Zt),qt=w?null:xe.FormField({...zt,iconRight:(k=p.iconRight)!=null?k:"calendar_month",control:rn,getValue:()=>Nt.value,onClear:()=>{o(p.disabled)||o(p.readonly)||(Ut(f(),null),At&&Qt())},onFocus:()=>Nt.focus()}),Yt=(S,he={})=>{var Je,ft;const pt=he.focusIso||(E==="range"?(S==null?void 0:S.from)||(S==null?void 0:S.to)||Ie():E==="range-multiple"?((Je=S==null?void 0:S[S.length-1])==null?void 0:Je.from)||((ft=S==null?void 0:S[S.length-1])==null?void 0:ft.to)||Ie():E==="multiple"?(S==null?void 0:S[0])||Ie():S||Ie());let ot=Q(pt);if(he.preserveMonthOffset){const _t=Number.isInteger(he.visibleMonthOffset)?he.visibleMonthOffset:$t(he.anchorIso||he.focusIso||pt);_t>0&&(ot=P(ot,-_t))}gt=ot},cn=()=>{Zt.replaceChildren();const S=o(p.name);if(!S)return;const he=(pt,ot)=>{Zt.appendChild(_.input({type:"hidden",name:pt,value:ot!=null?ot:""}))},Je=Ge;if(E==="single"){he(S,ae(Je,We));return}if(E==="range"){he(o(p.nameFrom)||`${S}_from`,(Je==null?void 0:Je.from)||""),he(o(p.nameTo)||`${S}_to`,(Je==null?void 0:Je.to)||"");return}if(E==="range-multiple"){const pt=Array.isArray(Je)?Je:[],ot=/\[\]$/.test(o(p.nameFrom)||"")?o(p.nameFrom):`${o(p.nameFrom)||`${S}_from`}[]`,_t=/\[\]$/.test(o(p.nameTo)||"")?o(p.nameTo):`${o(p.nameTo)||`${S}_to`}[]`;pt.forEach(Mt=>{he(ot,(Mt==null?void 0:Mt.from)||""),he(_t,(Mt==null?void 0:Mt.to)||"")});return}const ft=/\[\]$/.test(S)?S:`${S}[]`;(Array.isArray(Je)?Je:[]).forEach(pt=>he(ft,pt))},Xt=()=>{var S;w||(Nt.readOnly=!o(p.manualInput),Nt.disabled=!!o(p.disabled),Nt.setAttribute("aria-expanded",At?"true":"false"),Nt.value=Se(Ge,We),cn(),(S=qt==null?void 0:qt._refresh)==null||S.call(qt))},Ut=(S,he,Je={})=>{var ft,pt,ot;const _t=W(S),Mt=fe()?Wt((ft=zn(Je.timeValue!=null?Je.timeValue:Je.preserveTime?x():S,M()))!=null?ft:Je.preserveTime?x():null):null,Gt=Oe(Ge,We);Ge=L(_t),Ke=L(_t),fe()&&(We=Wt(Mt),et=Wt(Mt)),tt=null,Yt(_t,Je),Xt(),Dt(),le&&Je.fromModel!==!0&&le.set(ae(_t,Mt));const un=Oe(_t,Mt);if(Je.emit!==!1&&un!==Gt){const an=ae(_t,Mt);(pt=p.onInput)==null||pt.call(p,an,he),(ot=p.onChange)==null||ot.call(p,an,he)}return _t},tn=(S,he,Je={})=>{var ft,pt;if(!fe())return null;const ot=Wt(zn(S,M()));if(o(p.confirm)&&Je.commit!==!0)return et=ot,Dt(),ot;const _t=Oe(Ge,We);We=Wt(ot),et=Wt(ot),Xt(),Dt(),le&&Je.fromModel!==!0&&le.set(ae(Ge,ot));const Mt=Oe(Ge,ot);if(Je.emit!==!1&&Mt!==_t){const Gt=ae(Ge,ot);(ft=p.onInput)==null||ft.call(p,Gt,he),(pt=p.onChange)==null||pt.call(p,Gt,he)}return ot},ln=(S,he,Je={})=>{if(o(p.confirm)){Ke=L(W(S)),fe()&&(Je.timeValue!=null||Je.preserveTime)&&(et=Wt(zn(Je.timeValue!=null?Je.timeValue:x(),M()))),tt=null,Yt(Ke,Je),Dt();return}Ut(S,he,Je)},Xn=()=>{const S=Le();if(E==="range")return!(S!=null&&S.from)||S!=null&&S.to||!tt?S:g(S.from,tt)<=0?{from:S.from,to:tt}:{from:tt,to:S.from};if(E==="range-multiple"){const he=Array.isArray(S)&&S.length?S[S.length-1]:null;return!(he!=null&&he.from)||he!=null&&he.to||!tt?he:g(he.from,tt)<=0?{from:he.from,to:tt}:{from:tt,to:he.from}}return S},bn=()=>{if(E==="range"){const S=Xn();return S!=null&&S.from?[S]:[]}if(E==="range-multiple"){const S=Array.isArray(Le())?Le():[];if(!S.length)return[];const he=Xn();return he!=null&&he.from?[...S.slice(0,-1),he]:S}return[]},gn=S=>{const he=Le();return E==="multiple"?he.includes(S):E==="range-multiple"?Array.isArray(he)&&he.some(Je=>b(Je==null?void 0:Je.from,S)||b(Je==null?void 0:Je.to,S)):E==="range"?b(he==null?void 0:he.from,S)||b(he==null?void 0:he.to,S):b(he,S)},hs=S=>E!=="range"&&E!=="range-multiple"?!1:bn().some(he=>(he==null?void 0:he.from)&&(he==null?void 0:he.to)&&S>=he.from&&S<=he.to),mn=(S,he={})=>{const Je=Le(),ft=E==="range"?Je:E==="range-multiple"&&Array.isArray(Je)&&Je.length?Je[Je.length-1]:null;!(ft!=null&&ft.from)||ft!=null&&ft.to||tt===S||(tt=S,he.render!==!1&&Dt())},wn=()=>w||o(p.confirm)||p.closeOnSelect===!1?!1:E==="multiple"||E==="range-multiple"?!!p.closeOnSelect:!0,Qn=(S,he,Je={})=>{var ft;if(!Re(S)||o(p.disabled)||o(p.readonly))return;const pt={focusIso:S,anchorIso:S,preserveTime:fe(),timeValue:x(),preserveMonthOffset:!!At&&Pe()>1,visibleMonthOffset:Number.isInteger(Je.visibleMonthOffset)?Je.visibleMonthOffset:null};if(E==="multiple"){const ot=H(Le()),_t=ot.includes(S)?ot.filter(Mt=>Mt!==S):[...ot,S];ln(_t.sort(),he,pt),wn()&&Qt();return}if(E==="range"){const ot=L(Le());let _t;!ot.from||ot.from&&ot.to?_t={from:S,to:null}:g(S,ot.from)<0?_t={from:S,to:ot.from}:_t={from:ot.from,to:S},ln(_t,he,pt),_t.to&&wn()&&Qt();return}if(E==="range-multiple"){const ot=Ue(Le()),_t=ot.length?ot[ot.length-1]:null;let Mt;!(_t!=null&&_t.from)||_t!=null&&_t.to?Mt=[...ot,{from:S,to:null}]:g(S,_t.from)<0?Mt=[...ot.slice(0,-1),{from:S,to:_t.from}]:Mt=[...ot.slice(0,-1),{from:_t.from,to:S}],ln(Mt,he,pt),(ft=Mt[Mt.length-1])!=null&&ft.to&&wn()&&Qt();return}ln(S,he,pt),wn()&&Qt()},rs=()=>{dt=null,Ut(f(),null,{timeValue:null})},Ls=()=>{const S=m();if(!Re(S)){Yt(S),Dt();return}if(E==="range"){const he=y(S,1),Je=he&&Re(he)?{from:S,to:he}:{from:S,to:null};ln(Je,null);return}if(E==="range-multiple"){const he=y(S,1),Je=he&&Re(he)?[{from:S,to:he}]:[{from:S,to:null}];ln(Je,null);return}if(E==="multiple"){ln([S],null);return}ln(S,null,{preserveTime:fe(),timeValue:x()})},Ze=(S={})=>{to(It,S)},bt=()=>{if(!fe())return;const S=fl(It);tn(new Date,null,{commit:!o(p.confirm)}),Ze({scrollState:S}),!o(p.confirm)&&p.closeOnSelect===!0&&Qt()},Ft=()=>{o(p.confirm)&&(Ut(Ke,null,{timeValue:et,preserveTime:!0}),p.closeOnSelect!==!1&&Qt())},Dt=()=>{var S,he,Je,ft,pt,ot,_t,Mt,Gt,un,an,jn,_n,dn,Cn,Zn,es,gs,Wn;if(!It)return;const fn=Te(),Ws=new Intl.DateTimeFormat(fn,{month:"long",year:"numeric"}),Us=new Intl.DateTimeFormat(fn,{weekday:"short"}),Es=Array.from({length:7},(Tt,Ht)=>{const kn=(oe()+Ht)%7;return Us.format(new Date(2024,0,7+kn))}),xn=Le(),Yo=Tt=>{let Ht=JSswift.ui.renderSlot($,"point",Tt,null);return Ht==null&&(Ht=JSswift.ui.renderSlot($,"dayPoint",Tt,null)),Ht==null&&p.pointIcon!=null&&(Tt.selected||Tt.inRange||Tt.today)&&(Ht=typeof p.pointIcon=="string"?xe.Icon({name:p.pointIcon,size:10}):JSswift.ui.slot(p.pointIcon,Tt)),D(null,"default",Tt,Ht)},Xo=(Tt,Ht)=>{const kn=Tt.getFullYear(),Is=Tt.getMonth(),_l=new Date(kn,Is,1),Bl=(_l.getDay()-oe()+7)%7,Hl=new Date(kn,Is,1-Bl),Sl=_.div({class:"jss-date-month"});Sl.appendChild(_.div({class:"jss-date-month-title"},Ws.format(_l)));const _o=_.div({class:"jss-date-weekdays"});Es.forEach(Ks=>_o.appendChild(_.div({class:"jss-date-weekday"},Ks))),Sl.appendChild(_o);const So=_.div({class:"jss-date-grid"});for(let Ks=0;Ks<42;Ks+=1){const Wl=new Date(Hl.getFullYear(),Hl.getMonth(),Hl.getDate()+Ks),Nn=j(Wl),jo=Wl.getMonth()===Is,Co=gn(Nn),xo=hs(Nn),ko=(E==="range"||E==="range-multiple")&&bn().some(Tn=>b(Tn==null?void 0:Tn.from,Nn)),No=(E==="range"||E==="range-multiple")&&bn().some(Tn=>b(Tn==null?void 0:Tn.to,Nn)),Ul=!Re(Nn),Gl={...Ye(Nn),selected:Co,inRange:xo,rangeStart:ko,rangeEnd:No,disabled:Ul,outside:!jo,value:xn,select:()=>Qn(Nn,null,{visibleMonthOffset:Ht})},Kl=Yo(Gl),di=JSswift.ui.renderSlot($,"day",Gl,String(Wl.getDate())),fi=D(null,"default",Gl,di),pi=_.button({type:"button",class:re(["jss-date-day",pe(!jo,"is-outside"),pe(Co,"is-selected"),pe(xo,"is-in-range"),pe(ko,"is-range-start"),pe(No,"is-range-end"),pe(Ul,"is-disabled"),pe(b(Nn,m()),"is-today"),pe(Kl.length,"has-point")]),disabled:Ul,onMouseDown:Tn=>{Tn.button===0&&(dt=Nn,Tn.preventDefault(),Qn(Nn,Tn,{visibleMonthOffset:Ht}))},onClick:Tn=>{if(dt!=null&&Tn.detail!==0){dt=null;return}dt=null,Qn(Nn,Tn,{visibleMonthOffset:Ht})},onMouseEnter:()=>mn(Nn),onFocus:()=>mn(Nn,{render:!1})},_.span({class:"jss-date-day-label"},...fi),Kl.length?_.span({class:"jss-date-day-point"},...Kl):null);So.appendChild(pi)}return Sl.appendChild(So),Sl},$l=ee(),Vl=Ne(),Gs=[gt.getFullYear(),(S=I(m()))==null?void 0:S.getFullYear(),(he=I($l))==null?void 0:he.getFullYear(),(Je=I(Vl))==null?void 0:Je.getFullYear(),(ft=I(o(p.defaultMonth)))==null?void 0:ft.getFullYear()];E==="range"?Gs.push((pt=I(xn==null?void 0:xn.from))==null?void 0:pt.getFullYear(),(ot=I(xn==null?void 0:xn.to))==null?void 0:ot.getFullYear()):E==="range-multiple"?xn.forEach(Tt=>{var Ht,kn;Gs.push((Ht=I(Tt==null?void 0:Tt.from))==null?void 0:Ht.getFullYear(),(kn=I(Tt==null?void 0:Tt.to))==null?void 0:kn.getFullYear())}):E==="multiple"?xn.forEach(Tt=>{var Ht;return Gs.push((Ht=I(Tt))==null?void 0:Ht.getFullYear())}):Gs.push((_t=I(xn))==null?void 0:_t.getFullYear());const wl=Gs.filter(Tt=>Number.isFinite(Tt)),Qo=(wl.length?Math.min(...wl):gt.getFullYear())-100,Zo=(wl.length?Math.max(...wl):gt.getFullYear())+50,go=Number(o((un=(Gt=p.yearStart)!=null?Gt:$l?(Mt=I($l))==null?void 0:Mt.getFullYear():null)!=null?un:Qo)),ei=Number(o((_n=(jn=p.yearEnd)!=null?jn:Vl?(an=I(Vl))==null?void 0:an.getFullYear():null)!=null?_n:Zo)),ti=_.select({class:"jss-date-select",value:String(gt.getMonth()),onChange:Tt=>{var Ht;gt=new Date(gt.getFullYear(),Number(Tt.currentTarget.value),1),(Ht=p.onNavigate)==null||Ht.call(p,{month:gt.getMonth()+1,year:gt.getFullYear()}),Dt()}},...Array.from({length:12},(Tt,Ht)=>Vs({value:String(Ht)},new Intl.DateTimeFormat(fn,{month:"long"}).format(new Date(2024,Ht,1))))),ni=_.select({class:"jss-date-select jss-date-select-year",value:String(gt.getFullYear()),onChange:Tt=>{var Ht;gt=new Date(Number(Tt.currentTarget.value),gt.getMonth(),1),(Ht=p.onNavigate)==null||Ht.call(p,{month:gt.getMonth()+1,year:gt.getFullYear()}),Dt()}},...Array.from({length:Math.max(1,ei-go+1)},(Tt,Ht)=>{const kn=go+Ht;return Vs({value:String(kn)},String(kn))})),si=_.div({class:"jss-date-header"},_.button({type:"button",class:"jss-date-nav",onClick:()=>{var Tt;gt=P(gt,-1),(Tt=p.onNavigate)==null||Tt.call(p,{month:gt.getMonth()+1,year:gt.getFullYear()}),Dt()}},xe.Icon({name:"chevron_left",size:16})),_.div({class:"jss-date-header-center"},ti,ni),_.button({type:"button",class:"jss-date-nav",onClick:()=>{var Tt;gt=P(gt,1),(Tt=p.onNavigate)==null||Tt.call(p,{month:gt.getMonth()+1,year:gt.getFullYear()}),Dt()}},xe.Icon({name:"chevron_right",size:16}))),mo=_.div({class:"jss-date-shortcuts"}),yo=o((dn=p.shortcuts)!=null?dn:p.presets)||[];yo.forEach((Tt,Ht)=>{var kn,Is;if(!Tt)return;const _l=typeof Tt.value=="function"?Tt.value({today:m()}):Tt.value,Bl=(Is=(kn=Tt.label)!=null?kn:Tt.text)!=null?Is:`Preset ${Ht+1}`;mo.appendChild(_.button({type:"button",class:"jss-date-shortcut",onClick:()=>ln(_l,null,{preserveTime:fe(),timeValue:x()})},Bl))});const bo=_.div({class:"jss-date-months"});for(let Tt=0;Tt<Pe();Tt+=1)bo.appendChild(Xo(P(gt,Tt),Tt));const vo=Se(xn,x()),li=_.div({class:"jss-date-value"},...D($,"value",{value:xn,displayValue:vo,mode:E,timeValue:x()},vo||D($,"default",{},U))),wo=_.div({class:"jss-time-header"}),oi=_.div({class:"jss-time-columns-2"},_.div({class:"jss-time-column-title"},o(p.hoursLabel)||"Ore"),_.div({class:"jss-time-column-title"},o(p.minutesLabel)||"Min"));wo.appendChild(oi);const ii=fe()?eo({props:{min:o((Cn=p.timeMin)!=null?Cn:p.minTime),max:o((Zn=p.timeMax)!=null?Zn:p.maxTime),use12h:o((gs=(es=p.time12h)!=null?es:p.use12h)!=null?gs:p.ampm),hoursLabel:o(p.timeHoursLabel)||"Ore",minutesLabel:o(p.timeMinutesLabel)||"Min",secondsLabel:o(p.timeSecondsLabel)||"Sec"},slots:$,slotPrefix:"time",value:x(),withSeconds:!1,minuteStep:1,secondStep:be(),disabled:!!o(p.disabled),readonly:!!o(p.readonly),embedded:!0,pointIcon:o(p.timePointIcon),shortcuts:o((Wn=p.timeShortcuts)!=null?Wn:p.timePresets),onSelect:Tt=>{const Ht=fl(It);tn(Tt,null),Ze({scrollState:Ht})}}):null,ri=_.div({class:"jss-date-footer-info"},li),ai=_.div({class:re(["jss-date-footer",pe(fe(),"has-time")])},ri,_.div({class:"jss-date-actions"},_.button({type:"button",class:"jss-date-action",onClick:Ls},o(p.todayLabel)||"Oggi"),o(p.clearable)!==!1?_.button({type:"button",class:"jss-date-action",onClick:rs},o(p.clearLabel)||"Reset"):null,o(p.confirm)?_.button({type:"button",class:"jss-date-action is-primary",onClick:Ft},o(p.applyLabel)||"Applica"):null)),ci=_.div(_.button({type:"button",class:"jss-date-action jss-w-lg",onClick:bt},o(p.nowLabel)||"Ora")),ui=fe()?_.div({class:"jss-date-time"},wo,ii,ci):null;It.replaceChildren(_.div({class:"jss-date-panel-root",onKeydown:Tt=>{var Ht;Tt.key==="Escape"&&(Tt.preventDefault(),w?(Ht=p.onEscape)==null||Ht.call(p,Tt):Qt())}},si,yo.length?mo:null,_.div({class:"jss-data-time"},bo,ui),ai))};function nn(){var S,he,Je,ft;return At||o(p.disabled)||o(p.readonly)||(Ke=L(Ge),et=Wt(We),tt=null,dt=null,Yt(Ke),At=JSswift.overlay.open(({close:pt})=>{var ot;const _t=E==="range"||E==="range-multiple"?2:1,Mt=Number((ot=o(p.monthsToShow))!=null?ot:_t);return It=_.div({class:Bt(["jss-date-panel",o(B),pe(Mt>1,"multi-month"),p.panelClass])}),Dt(),It},{type:"date",anchorEl:qt._control||Nt,placement:p.placement||"bottom-start",offsetX:(S=p.offsetX)!=null?S:0,offsetY:(Je=(he=p.offsetY)!=null?he:p.offset)!=null?Je:8,backdrop:!1,lockScroll:!1,trapFocus:!1,closeOnOutside:p.closeOnOutside!==!1,closeOnBackdrop:!1,closeOnEsc:!0,autoFocus:!1,className:Bt(["jss-date-overlay",p.panelClass,pe(fe(),"has-time")]),onClose:()=>{var pt;At=null,It=null,tt=null,Xt(),(pt=p.onClose)==null||pt.call(p)}}),p.panelStyle&&Object.assign(At.panel.style,p.panelStyle),ks(At),Xt(),(ft=p.onOpen)==null||ft.call(p)),At}function Qt(){if(!At)return;dt=null;const S=At;Ns(S,()=>JSswift.overlay.close(S.id))}if(w){const S=E==="range"||E==="range-multiple"?2:1,he=Number((N=o(p.monthsToShow))!=null?N:S);It=_.div({class:Bt(["jss-date-panel","jss-date-calendar",o(B),pe(he>1,"multi-month"),p.panelClass,p.class]),style:p.style})}return w||Nt.addEventListener("focus",S=>{var he;(he=p.onFocus)==null||he.call(p,S),p.openOnFocus!==!1&&nn()}),w||Nt.addEventListener("click",S=>{var he;(he=p.onClick)==null||he.call(p,S),nn()}),w||Nt.addEventListener("keydown",S=>{if(S.key==="Escape"){At&&(S.preventDefault(),Qt());return}(S.key==="ArrowDown"||S.key==="Enter"||S.key===" ")&&(S.preventDefault(),nn()),(S.key==="Backspace"||S.key==="Delete")&&!o(p.manualInput)&&o(p.clearable)!==!1&&(S.preventDefault(),rs())}),!w&&o(p.manualInput)?(Nt.addEventListener("input",S=>{var he;(he=p.onTyping)==null||he.call(p,Nt.value,S)}),Nt.addEventListener("change",S=>{const he=F(Nt.value);Ut(he,S,{timeValue:zn(Nt.value,M()),preserveTime:!zn(Nt.value,M())})}),Nt.addEventListener("blur",S=>{var he;(he=p.onBlur)==null||he.call(p,S);const Je=F(Nt.value);Nt.value===""?rs():Ut(Je,S,{timeValue:zn(Nt.value,M()),preserveTime:!zn(Nt.value,M())})})):w||Nt.addEventListener("blur",S=>{var he;return(he=p.onBlur)==null?void 0:he.call(p,S)}),le&&le.watch(S=>{const he=W(S),Je=h(S);Oe(he,Je)!==Oe(Ge,We)&&(Ge=he,Ke=L(Ge),We=Wt(Je),et=Wt(Je),tt=null,Yt(Ge),Xt(),Dt())},w?"UI.Calendar:watch":"UI.Datepicker:watch"),JSswift.reactive.effect(()=>{!le&&p.value!=null?(Ge=W(o(p.value)),Ke=L(Ge),We=h(o(p.value)),et=Wt(We)):fe()&&p.timeValue!=null&&(We=h(o(p.timeValue)),et=Wt(We)),Xt(),Dt(),At&&o(p.disabled)&&Qt()},w?"UI.Calendar:render":"UI.Datepicker:render"),w?(It._calendar=It,It._date=It,It._getValue=()=>ae(Ge,We),It._setValue=S=>Ut(S,null,{emit:!1,timeValue:h(S)}),It._clear=rs,It._select=S=>{const he=we(S);he&&Qn(he,null)},It._time=()=>Wt(We),It):(qt._input=Nt,qt._date=Nt,qt._open=nn,qt._close=Qt,qt._getValue=()=>ae(Ge,We),qt._setValue=S=>Ut(S,null,{emit:!1,timeValue:h(S)}),qt._time=()=>Wt(We),qt._panel=()=>(At==null?void 0:At.panel)||null,qt)};xe.Datepicker=(...e)=>no(e),xe.Calendar=(...e)=>no(e,{calendar:!0}),xe.Date=xe.Datepicker,JSswift.ui.Datepicker=xe.Datepicker,JSswift.ui.Calendar=xe.Calendar,JSswift.ui.Date=xe.Date,xe.Time=(...e)=>{var t,s,l;const{props:n,children:i}=JSswift.uiNormalizeArgs(e),c=n.slots||{},a=xt(n.size,()=>{const g=String(o(n.size)||"").toLowerCase();return["xs","sm","md","lg","xl"].includes(g)?`jss-size-${g}`:""}),v=()=>{var g,T,Y,K,_e;const J=Yn(zn(k?k.get():(g=o(n.value))!=null?g:N,{withSeconds:!0}),{withSeconds:!0});return{withSeconds:!!o((T=n.withSeconds)!=null?T:n.showSeconds)||/:\d{2}:\d{2}$/.test(J),min:o((Y=n.min)!=null?Y:n.minTime),max:o((K=n.max)!=null?K:n.maxTime),use12h:o((_e=n.use12h)!=null?_e:n.ampm)}},r=()=>{var g;const T=Number(o((g=n.minuteStep)!=null?g:1));return Math.max(1,Math.min(30,Number.isFinite(T)?T:5))},z=()=>{var g;const T=Number(o((g=n.secondStep)!=null?g:1));return Math.max(1,Math.min(30,Number.isFinite(T)?T:5))},d=n.model||(yt(n.value)||rt(n.value)?n.value:null),k=en(d,"UI.Time:model"),N=k?k.get():o(n.value),p=g=>zn(g,v()),U=g=>dl(g,v()),w=g=>Yn(g,v()),$=g=>JSON.stringify(w(g));let B=Wt(p(N)),te=Wt(B),E=null,ve=null;const le={...n,label:(t=n.label)!=null?t:n.placeholder},ie=le.label!=null||JSswift.ui.getSlot(c,"label")!=null,ge=_.input({class:re(["jss-input","jss-time-display",a,pe(n.manualInput,"is-manual"),n.inputClass]),type:"text",autocomplete:"off",placeholder:ie?"":(s=n.placeholder)!=null?s:"Seleziona orario",readOnly:!o(n.manualInput),disabled:!!o(n.disabled),value:U(B)});ge.setAttribute("aria-haspopup","dialog");const ue=_.div({style:{display:"contents"}}),fe=_.div({class:"jss-time-control",style:{display:"contents"}},ge,ue),M=xe.FormField({...le,iconRight:(l=n.iconRight)!=null?l:"schedule",control:fe,getValue:()=>ge.value,onClear:()=>{o(n.disabled)||o(n.readonly)||(Z(null,null,{commit:!0}),E&&b())},onFocus:()=>ge.focus()}),me=()=>o(n.confirm)?te:B,be=()=>{ue.replaceChildren();const g=o(n.name);g&&ue.appendChild(_.input({type:"hidden",name:g,value:w(B)}))},de=()=>{var g;ge.readOnly=!o(n.manualInput),ge.disabled=!!o(n.disabled),ge.setAttribute("aria-expanded",E?"true":"false"),ge.value=U(B),be(),(g=M._refresh)==null||g.call(M)},Z=(g,T,Y={})=>{var K,_e;const J=Wt(p(g));if(o(n.confirm)&&Y.commit!==!0)return te=Wt(J),Q(),J;const A=$(B);B=Wt(J),te=Wt(J),de(),Q(),k&&Y.fromModel!==!0&&k.set(w(J));const L=$(J);if(Y.emit!==!1&&L!==A){const O=w(J);(K=n.onInput)==null||K.call(n,O,T),(_e=n.onChange)==null||_e.call(n,O,T)}return J},j=g=>o(n.confirm)||n.closeOnSelect!==!0?!1:v().withSeconds?(g==null?void 0:g.part)==="second":(g==null?void 0:g.part)==="minute",I=(g={})=>{to(ve,g)},y=()=>{const g=fl(ve);Z(new Date,null,{commit:!o(n.confirm)}),I({scrollState:g}),!o(n.confirm)&&n.closeOnSelect===!0&&b()},P=()=>{o(n.confirm)&&(Z(te,null,{commit:!0}),n.closeOnSelect!==!1&&b())},Q=()=>{var g,T,Y,K;if(!ve)return;const _e=me(),J=U(_e),A=_.div({class:"jss-time-header"}),L=_.div({class:"jss-time-columns"},_.div({class:"jss-time-column-title"},o(n.hoursLabel)||"Ore"),_.div({class:"jss-time-column-title"},o(n.minutesLabel)||"Min")),O=v().withSeconds;O&&L.appendChild(_.div({class:"jss-time-column-title"},o(n.secondsLabel)||"Sec")),A.appendChild(L);const X=eo({props:{min:o((g=n.min)!=null?g:n.minTime),max:o((T=n.max)!=null?T:n.maxTime),use12h:o((Y=n.use12h)!=null?Y:n.ampm),hoursLabel:o(n.hoursLabel)||"Ore",minutesLabel:o(n.minutesLabel)||"Min",secondsLabel:o(n.secondsLabel)||"Sec"},slots:c,value:_e,withSeconds:O,minuteStep:r(),secondStep:z(),disabled:!!o(n.disabled),readonly:!!o(n.readonly),pointIcon:o(n.pointIcon),shortcuts:o((K=n.shortcuts)!=null?K:n.presets),onSelect:(Be,Ue)=>{const H=fl(ve);Z(Be,null),I({scrollState:H}),j(Ue)&&b()}}),we=_.div({class:"jss-time-footer"},_.div({class:"jss-time-value"},...D(c,"value",{value:_e,displayValue:J},J||D(c,"default",{},i))),_.div({class:"jss-time-actions"},_.button({type:"button",class:"jss-time-action",onClick:y},o(n.nowLabel)||"Ora"),o(n.clearable)!==!1?_.button({type:"button",class:"jss-time-action",onClick:()=>Z(null,null,{commit:!o(n.confirm)})},o(n.clearLabel)||"Reset"):null,o(n.confirm)?_.button({type:"button",class:"jss-time-action is-primary",onClick:P},o(n.applyLabel)||"Applica"):null));ve.replaceChildren(_.div({class:"jss-time-panel-root",onKeydown:Be=>{Be.key==="Escape"&&(Be.preventDefault(),b())}},A,X,we))};function m(){var g,T,Y,K;return E||o(n.disabled)||o(n.readonly)||(te=Wt(B),E=JSswift.overlay.open(()=>(ve=_.div({class:Bt(["jss-time-panel",o(a),n.panelClass])}),Q(),ve),{type:"time",anchorEl:M._control||ge,placement:n.placement||"bottom-start",offsetX:(g=n.offsetX)!=null?g:0,offsetY:(Y=(T=n.offsetY)!=null?T:n.offset)!=null?Y:8,backdrop:!1,lockScroll:!1,trapFocus:!1,closeOnOutside:n.closeOnOutside!==!1,closeOnBackdrop:!1,closeOnEsc:!0,autoFocus:!1,className:Bt(["jss-time-overlay",n.panelClass]),onClose:()=>{var _e;E=null,ve=null,de(),(_e=n.onClose)==null||_e.call(n)}}),n.panelStyle&&Object.assign(E.panel.style,n.panelStyle),ks(E),I(),de(),(K=n.onOpen)==null||K.call(n)),E}function b(){if(!E)return;const g=E;Ns(g,()=>JSswift.overlay.close(g.id))}return ge.addEventListener("focus",g=>{var T;(T=n.onFocus)==null||T.call(n,g),n.openOnFocus!==!1&&m()}),ge.addEventListener("click",g=>{var T;(T=n.onClick)==null||T.call(n,g),m()}),ge.addEventListener("keydown",g=>{if(g.key==="Escape"){E&&(g.preventDefault(),b());return}(g.key==="ArrowDown"||g.key==="Enter"||g.key===" ")&&(g.preventDefault(),m()),(g.key==="Backspace"||g.key==="Delete")&&!o(n.manualInput)&&o(n.clearable)!==!1&&(g.preventDefault(),Z(null,g,{commit:!0}))}),o(n.manualInput)?(ge.addEventListener("input",g=>{var T;return(T=n.onTyping)==null?void 0:T.call(n,ge.value,g)}),ge.addEventListener("change",g=>Z(ge.value,g)),ge.addEventListener("blur",g=>{var T;(T=n.onBlur)==null||T.call(n,g),ge.value===""?Z(null,g):Z(ge.value,g)})):ge.addEventListener("blur",g=>{var T;return(T=n.onBlur)==null?void 0:T.call(n,g)}),k&&k.watch(g=>{const T=Wt(p(g));$(T)!==$(B)&&(B=Wt(T),te=Wt(T),de(),Q())},"UI.Time:watch"),JSswift.reactive.effect(()=>{!k&&n.value!=null&&(B=Wt(p(o(n.value))),te=Wt(B)),de(),Q(),E&&o(n.disabled)&&b()},"UI.Time:render"),M._input=ge,M._time=ge,M._open=m,M._close=b,M._getValue=()=>w(B),M._setValue=g=>Z(g,null,{emit:!1,commit:!0}),M._panel=()=>(E==null?void 0:E.panel)||null,M},xe.Tabs=(...e)=>{var t,s,l,n,i,c;const{props:a,children:v}=JSswift.uiNormalizeArgs(e),r=a.slots||{},z=(H,W)=>!!H&&Object.prototype.hasOwnProperty.call(H,W),d=H=>String(o(H)||"horizontal").toLowerCase()==="vertical"?"vertical":"horizontal",k=H=>{const W=String(o(H)||"").toLowerCase();return W==="pills"||W==="pill"?"pills":W==="soft"||W==="card"?"soft":"line"},N=H=>{var W;const ee=o(H);return ee==null||ee===""?null:(W=JSswift.uiColors)!=null&&W.includes(ee)?`var(--jss-${ee})`:String(ee)},p=(H,W)=>Object.is(H,W)||H!=null&&W!=null&&H==W,U=en(a.model,"UI.Tabs:model"),w=d(a.orientation||a.orient||a.direction),$=k(a.variant||(a.pills?"pills":a.soft?"soft":"line")),B=!!o((s=(t=a.fill)!=null?t:a.navFill)!=null?s:a.stretch),te=!!o(a.wrap),E=!!o(a.disabled),ve=a.id||"jss-tabs-"+Math.random().toString(36).slice(2,9),le=o((l=a.tabs)!=null?l:a.items)||[],ie=(Array.isArray(le)?le:[le]).map((H,W)=>{var ee,Ne,Te,oe,Pe,Ie,Le,Ye,ct,Re,C,Se,Fe,F;if(H==null)return null;if(typeof H!="object")return{raw:H,index:W,value:H,labelFallback:H,noteFallback:null,iconFallback:null,badgeFallback:null,disabled:!1,hidden:!1};const f=(Ie=(Pe=(oe=(Te=(Ne=(ee=H.value)!=null?ee:H.name)!=null?Ne:H.id)!=null?Te:H.key)!=null?oe:H.label)!=null?Pe:H.title)!=null?Ie:`tab-${W}`,h=(Re=(ct=(Ye=(Le=H.label)!=null?Le:H.title)!=null?Ye:H.name)!=null?ct:H.value)!=null?Re:`Tab ${W+1}`,x=z(H,"badge")?H.badge:z(H,"counter")?H.counter:null;return{...H,raw:H,index:W,value:f,labelFallback:h,noteFallback:(Fe=(Se=(C=H.note)!=null?C:H.subtitle)!=null?Se:H.description)!=null?Fe:null,iconFallback:(F=H.icon)!=null?F:null,badgeFallback:x}}).filter(Boolean).filter(H=>H.hidden!==!0&&H.visible!==!1),ge=ie.find(H=>!H.disabled)||null,ue=H=>ie.findIndex(W=>p(W.value,H)),fe=(H,W)=>{var ee;if(!ie.length)return-1;let Ne=H;for(let Te=0;Te<ie.length;Te+=1)if(Ne+=W,Ne<0?Ne=ie.length-1:Ne>=ie.length&&(Ne=0),!((ee=ie[Ne])!=null&&ee.disabled))return Ne;return-1},M=(H,W=!1)=>{var ee,Ne;const Te=ue(H);return Te>=0&&!((ee=ie[Te])!=null&&ee.disabled)?ie[Te].value:W?(Ne=ge==null?void 0:ge.value)!=null?Ne:null:H!=null?H:null},me=M(U?U.get():z(a,"value")?o(a.value):(n=a.defaultValue)!=null?n:a.default,!0),[be,de]=JSswift.reactive.signal(me),Z=re(["jss-clear-set","jss-tabs","jss-singularity",w,`variant-${$}`,pe(a.dense,"dense"),pe(B,"fill"),pe(te,"wrap"),pe(E,"disabled"),a.class]),j=JSswift.omit(a,["tabs","items","value","defaultValue","default","model","orientation","orient","direction","variant","pills","soft","fill","navFill","stretch","wrap","dense","disabled","slots","empty","gap","tabGap","align","justify","color","state","navClass","navStyle","barClass","barStyle","tabClass","tabStyle","itemClass","itemStyle","class","style"]);j.class=Z,j.style={...a.style||{}},a.gap!=null&&(j.style["--jss-tabs-gap"]=vt(a.gap)),a.tabGap!=null&&(j.style["--jss-tabs-tab-gap"]=vt(a.tabGap));const I=N((i=a.color)!=null?i:a.state);I&&(j.style["--jss-tabs-accent"]=I);const y=_.div(j),P=_.div({class:re(["jss-tabs-bar",a.barClass]),style:{alignItems:a.align||(w==="vertical"?"stretch":"center"),justifyContent:a.justify||"flex-start",...a.barStyle||{}}}),Q=_.div({class:re(["jss-tabs-nav",a.navClass]),style:a.navStyle||null,role:"tablist","aria-orientation":w}),m=[],b=()=>ue(be()),g=()=>{const H=b();return H>=0?ie[H]:null},T=()=>({tabs:ie,value:be(),active:be(),activeIndex:b(),activeTab:g(),orientation:w,variant:$,select:(H,W)=>A(H,{event:W,emit:!0}),next:()=>O(),prev:()=>X()}),Y=(H,W,ee)=>({...T(),tab:H,index:W,active:ee,disabled:!!H.disabled,select:Ne=>L(W,{event:Ne,emit:!0})}),K=H=>{var W;const ee=(W=m[H])==null?void 0:W.btn;!ee||typeof ee.focus!="function"||requestAnimationFrame(()=>ee.focus())},_e=H=>{const W=ue(H);y.dataset.value=H==null?"":String(H),y.dataset.activeIndex=W>=0?String(W):"",m.forEach(({btn:ee,item:Ne,tab:Te,index:oe})=>{const Pe=oe===W;Ne.classList.toggle("active",Pe),Ne.classList.toggle("disabled",!!(Te.disabled||E)),ee.classList.toggle("active",Pe),ee.setAttribute("aria-selected",Pe?"true":"false"),ee.setAttribute("tabindex",Pe?"0":"-1")})},J=H=>{de(H),_e(H)},A=(H,W={})=>{if(E)return null;const ee=ue(H);return ee<0?null:L(ee,W)},L=(H,W={})=>{var ee,Ne;const Te=ie[H];if(!Te||Te.disabled||E)return null;const oe=Te.value,Pe=be(),Ie=!p(Pe,oe);return J(oe),U&&!p(U.get(),oe)&&U.set(oe),W.focus&&K(H),W.event&&((ee=Te.onClick)==null||ee.call(Te,oe,W.event,Te,H)),Ie&&W.emit!==!1&&((Ne=a.onChange)==null||Ne.call(a,oe,Te,W.event||null,H)),Te},O=()=>{const H=fe(b()<0?-1:b(),1);H>=0&&L(H,{emit:!0,focus:!0})},X=()=>{const H=b()<0?0:b(),W=fe(H,-1);W>=0&&L(W,{emit:!0,focus:!0})},we=(H,W)=>{var ee,Ne,Te,oe,Pe,Ie;const Le=W===b(),Ye=Y(H,W,Le),ct=`${ve}-tab-${W}`,Re=H.iconFallback!=null?typeof H.iconFallback=="string"?xe.Icon({name:H.iconFallback,size:(Te=(Ne=(ee=H.iconSize)!=null?ee:H.size)!=null?Ne:a.size)!=null?Te:null}):H.iconFallback:null,C=D(r,"icon",Ye,Re),Se=D(null,"default",{},JSswift.ui.renderSlot(r,"label",Ye,H.labelFallback)),Fe=D(r,"note",Ye,H.noteFallback),F=D(r,"badge",Ye,H.badgeFallback),f=_.span({class:"jss-tabs-tab-inner"},C.length?_.span({class:"jss-tabs-tab-icon"},...C):null,_.span({class:"jss-tabs-tab-copy"},_.span({class:"jss-tabs-tab-label"},...Se.length?Se:[""]),Fe.length?_.span({class:"jss-tabs-tab-note"},...Fe):null),F.length?_.span({class:"jss-tabs-tab-badge"},...F):null),h=D(r,"tab",{...Ye,tabId:ct,label:Se,icon:C,note:Fe,badge:F},f),x=Ge=>{var Ke;if(H.disabled||E)return;const We=Ge.key;if(We==="Enter"||We===" "){Ge.preventDefault(),L(W,{event:Ge,emit:!0});return}if(We==="Home"){Ge.preventDefault();const dt=ie.findIndex(gt=>!gt.disabled);dt>=0&&L(dt,{event:Ge,emit:!0,focus:!0});return}if(We==="End"){Ge.preventDefault();let dt=-1;for(let gt=ie.length-1;gt>=0;gt-=1)if(!((Ke=ie[gt])!=null&&Ke.disabled)){dt=gt;break}dt>=0&&L(dt,{event:Ge,emit:!0,focus:!0});return}const et=w==="vertical"?["ArrowUp"]:["ArrowLeft"],tt=w==="vertical"?["ArrowDown"]:["ArrowRight"];if(et.includes(We)){Ge.preventDefault();const dt=fe(W,-1);dt>=0&&L(dt,{event:Ge,emit:!0,focus:!0});return}if(tt.includes(We)){Ge.preventDefault();const dt=fe(W,1);dt>=0&&L(dt,{event:Ge,emit:!0,focus:!0})}},ae=N((oe=H.color)!=null?oe:H.state),Oe=_.div({class:re(["jss-tabs-item",pe(Le,"active"),pe(H.disabled||E,"disabled"),a.itemClass,H.itemClass]),style:{...ae?{"--jss-tabs-item-accent":ae}:{},...a.itemStyle||{},...H.itemStyle||{}},"data-name":String(H.value)}),De=xe.Btn({class:re(["jss-tabs-tab",pe(Le,"active"),pe(H.disabled||E,"disabled"),a.tabClass,H.tabClass||H.class]),type:"button",id:ct,role:"tab",disabled:!!(H.disabled||E),"aria-selected":Le?"true":"false",tabindex:Le?"0":"-1",size:(Ie=(Pe=H.size)!=null?Pe:a.size)!=null?Ie:null,style:{...a.tabStyle||{},...H.tabStyle||{}},onClick:Ge=>{L(W,{event:Ge,emit:!0})},onKeydown:x},...h);return Oe.appendChild(De),Oe.appendChild(_.span({class:"tab-indicator"})),m[W]={tab:H,index:W,item:Oe,btn:De},Oe};if(ie.length){const H=ie.map((ee,Ne)=>we(ee,Ne)),W=JSswift.ui.renderSlot(r,"nav",{...T(),nodes:H},H);D(null,"default",{},W).forEach(ee=>Q.appendChild(ee))}else D(r,"empty",T(),(c=a.empty)!=null?c:_.div({class:"jss-tabs-empty"},"Nessuna tab disponibile.")).forEach(H=>Q.appendChild(H));const Be=T(),Ue=[...D(null,"default",{},JSswift.ui.renderSlot(r,"extra",Be,null)),...D(r,"default",Be,v)];return P.appendChild(Q),Ue.length&&P.appendChild(_.div({class:"jss-tabs-extra"},...Ue)),y.appendChild(P),J(me),U?U.watch(H=>{J(M(H,!0))},"UI.Tabs:watch"):ht(a.value)&&wt.reactive.effect(()=>{J(M(o(a.value),!0))},"UI.Tabs:value"),y._getValue=()=>be(),y._setValue=H=>A(H,{emit:!0}),y._select=H=>A(H,{emit:!0}),y._next=()=>O(),y._prev=()=>X(),y._getTabs=()=>ie.slice(),Et(y,a),y},xe.RouteTab=(...e)=>{var t,s,l,n,i,c,a,v,r,z,d,k,N,p,U;const{props:w,children:$}=JSswift.uiNormalizeArgs(e),B=w.slots||{},te=JSswift.router||(wt==null?void 0:wt.router)||null,E=Ue=>Object.prototype.hasOwnProperty.call(w,Ue),ve=E("active")||E("selected"),le=Ue=>{const H=String(o(Ue)||"").toLowerCase();return H==="pill"||H==="pills"?"pills":H==="soft"||H==="card"?"soft":"line"},ie=Ue=>{var H;const W=o(Ue);return W==null||W===""?null:(H=JSswift.uiColors)!=null&&H.includes(W)?`var(--jss-${W})`:String(W)},ge=Ue=>{if(Ue==null||Ue==="")return"";try{return new URL(String(Ue),window.location.origin).pathname||""}catch(H){return String(Ue).split(/[?#]/)[0]||""}},ue=Ue=>o(w.external)===!0?!0:Ue?/^(mailto:|tel:|https?:\/\/|\/\/)/i.test(String(Ue)):!1,fe=()=>{var Ue;return o((Ue=w.href)!=null?Ue:w.to)||"#"},M=()=>{var Ue;return o((Ue=w.to)!=null?Ue:w.href)||""},me=()=>{try{if(te!=null&&te.current)return te.current().pathname||window.location.pathname||""}catch(Ue){}return window.location.pathname||""},be=()=>{var Ue,H,W;const ee=M();if(!ee)return!1;const Ne=o((H=(Ue=w.match)!=null?Ue:w.activeMatch)!=null?H:w.routeMatch),Te=String(o((W=w.matchMode)!=null?W:w.startsWith?"startsWith":w.exact?"exact":"")||"").toLowerCase(),oe=me();if(typeof Ne=="function")return!!Ne({currentPath:oe,to:ee,href:fe(),router:te,props:w});if(Ne instanceof RegExp)return Ne.test(oe);const Pe=ge(typeof Ne=="string"&&!["exact","startsWith","prefix","section"].includes(Ne.toLowerCase())?Ne:ee);if(!Pe)return!1;const Ie=Te||(typeof Ne=="string"&&["startsWith","prefix","section"].includes(Ne.toLowerCase())?"startsWith":"exact");return Ie==="startswith"||Ie==="prefix"||Ie==="section"?oe===Pe||oe.startsWith(`${Pe}/`):te!=null&&te.isActive?!!te.isActive(ee):oe===Pe},de=()=>!!o(w.disabled);let Z=null;const j=()=>{var Ue;return Z!=null?!!Z:ve?!!o((Ue=w.active)!=null?Ue:w.selected):be()},I=le(w.variant||(w.pills?"pills":w.soft?"soft":"line")),y=!o(w.color)&&o(w.state)?sn(o(w.state)):"",P=y?`jss-state-${y}`:"",Q=JSswift.omit(w,["active","selected","label","title","text","to","icon","iconRight","iconSize","note","subtitle","caption","description","badge","counter","count","aside","trailing","slots","state","color","dense","outline","flat","glossy","glow","glass","gradient","textGradient","lightShadow","shadow","rounded","radius","textColor","variant","pills","soft","block","fill","match","matchMode","activeMatch","routeMatch","exact","startsWith","external","onNavigate"]);Q.href=fe(),Q.class=re(["jss-route-tab","jss-clear-set","jss-singularity",`variant-${I}`,pe((t=w.block)!=null?t:w.fill,"block"),pe(w.dense,"dense"),P,w.class]),Q.style={...w.style||{}};const m=ie((s=w.color)!=null?s:w.state);m&&(Q.style["--jss-route-tab-accent"]=m);const b=(n=(l=w.iconSize)!=null?l:w.size)!=null?n:null,g=(Ue,H)=>{const W=o(Ue);return W==null||W===!1||W===""?null:typeof W=="string"?xe.Icon({name:W,size:b}):JSswift.ui.slot(W,{as:H})},T=()=>({active:j(),disabled:de(),href:fe(),to:M(),external:ue(fe()),navigate:Ue=>{var H,W;if(de())return!1;const ee=M();return!ue(fe())&&ee&&(te!=null&&te.navigate)?(Ue!=null&&Ue.preventDefault&&Ue.preventDefault(),te.navigate(ee),(H=w.onNavigate)==null||H.call(w,ee,Ue||null),!0):((W=w.onNavigate)==null||W.call(w,ee||fe(),Ue||null),!1)}}),Y=D(B,"icon",T(),g(w.icon,"icon")),K=D(B,"label",T(),(a=(c=(i=w.label)!=null?i:w.title)!=null?c:w.text)!=null?a:$),_e=D(B,"note",T(),(z=(r=(v=w.note)!=null?v:w.subtitle)!=null?r:w.caption)!=null?z:w.description),J=D(B,"badge",T(),(k=(d=w.badge)!=null?d:w.counter)!=null?k:w.count),A=D(B,"aside",T(),(p=(N=w.aside)!=null?N:w.trailing)!=null?p:g(w.iconRight,"iconRight")),L=D(B,"default",T(),(U=w.content)!=null?U:w.body),O=_.span({class:"jss-route-tab-inner"},Y.length?_.span({class:"jss-route-tab-icon"},...Y):null,_.span({class:"jss-route-tab-copy"},_.span({class:"jss-route-tab-label"},...K.length?K:[M()||fe()||""]),_e.length?_.span({class:"jss-route-tab-note"},..._e):null,L.length?_.span({class:"jss-route-tab-extra"},...L):null),J.length?_.span({class:"jss-route-tab-badge"},...J):null,A.length?_.span({class:"jss-route-tab-aside"},...A):null),X=_.a(Q,O);Et(X,w);const we=()=>{const Ue=j(),H=de(),W=fe(),ee=ue(W);X.classList.toggle("active",Ue),X.classList.toggle("is-disabled",H),X.classList.toggle("is-external",ee),Ue?X.setAttribute("aria-current",String(o(w.ariaCurrent)||"page")):X.removeAttribute("aria-current"),X.setAttribute("href",W||"#"),H?(X.setAttribute("aria-disabled","true"),X.tabIndex=-1):(X.removeAttribute("aria-disabled"),!E("tabIndex")&&!E("tabindex")&&X.removeAttribute("tabindex")),M()?X.dataset.to=String(M()):delete X.dataset.to,ee&&X.target==="_blank"&&!X.rel&&(X.rel="noopener noreferrer")},Be=w.onClick;return X.onclick=Ue=>{if(Be==null||Be(Ue),!Ue.defaultPrevented){if(de()){Ue.preventDefault();return}T().navigate(Ue)}},!ve&&M()&&(te!=null&&te.subscribe)&&te.subscribe(()=>we()),JSswift.reactive.effect(()=>{we()},"UI.RouteTab:render"),X._isActive=()=>j(),X._setActive=Ue=>(Z=Ue==null?null:!!Ue,we(),X),X._navigate=Ue=>T().navigate(Ue),X},xe.Breadcrumbs=(...e)=>{const{props:t,children:s}=JSswift.uiNormalizeArgs(e),l=t.slots||{},n=JSswift.router||(wt==null?void 0:wt.router)||null,i=en(t.model,"UI.Breadcrumbs:model"),c=xt(t.size,()=>{var M;const me=o(t.size);return typeof me=="string"&&((M=JSswift.uiSizes)!=null&&M.includes(me))?`jss-size-${me}`:""}),a=xt(t.variant,()=>{const M=String(o(t.variant||(t.pills?"pills":t.soft?"soft":"line"))||"").toLowerCase();return M==="pill"||M==="pills"?"variant-pills":M==="soft"||M==="card"?"variant-soft":"variant-line"}),v=xt([t.wrap,t.nowrap],()=>o(t.wrap)===!1||o(t.nowrap)?"no-wrap":""),r=_.nav({class:re(["jss-breadcrumbs","jss-clear-set",c,a,v,pe(t.dense,"dense"),t.class]),style:{...t.style||{}},role:"navigation","aria-label":t.ariaLabel||"Breadcrumb"}),z=_.div({class:"jss-breadcrumbs-before"}),d=_.ol({class:"jss-breadcrumbs-list"}),k=_.div({class:"jss-breadcrumbs-after"});r.appendChild(z),r.appendChild(d),r.appendChild(k);const N=M=>{var me;const be=o(M);return be==null||be===""?null:(me=JSswift.uiColors)!=null&&me.includes(be)?`var(--jss-${be})`:String(be)},p=M=>{var me;if(!M)return!1;if(o(M.external)===!0)return!0;const be=o((me=M.href)!=null?me:M.to);return be?/^(mailto:|tel:|https?:\/\/|\/\/)/i.test(String(be)):!1},U=M=>M!=null&&M.nodeType&&M.cloneNode?M.cloneNode(!0):M,w=(M,me)=>{M.innerHTML="",me.forEach(be=>M.appendChild(be))},$=(M,me,be,de,Z=null)=>{const j=JSswift.ui.getSlot(M,me)!=null?D(M,me,be,de):[];return j.length?j:Z&&JSswift.ui.getSlot(M,Z)!=null?D(M,Z,be,de):D(null,"default",be,de)},B=(M,me,be)=>{const de=o(M);return de==null||de===!1||de===""?null:typeof de=="string"?xe.Icon({name:de,size:me}):JSswift.ui.slot(de,{as:be})},te=()=>{var M,me;const be=i?i.get():o((me=(M=t.items)!=null?M:t.value)!=null?me:t.breadcrumbs),de=[],Z=I=>{if(!(I==null||I===!1)){if(Array.isArray(I)){I.forEach(Z);return}if(typeof I=="string"||typeof I=="number"){de.push({label:String(I)});return}if(I!=null&&I.nodeType||typeof I=="function"){de.push({label:I});return}de.push(I)}},j=o(t.home);return j&&Z(j===!0?{label:"Home",to:"/",icon:"home"}:j),Z(be),!de.length&&(s!=null&&s.length)&&s.forEach(I=>Z(I)),de.filter(I=>!o(I==null?void 0:I.hidden))},E=M=>{const me=M.findIndex(be=>{var de,Z;return!!o((Z=(de=be==null?void 0:be.current)!=null?de:be==null?void 0:be.active)!=null?Z:be==null?void 0:be.selected)});return me>-1?me:o(t.autoCurrent)===!1?-1:M.length?M.length-1:-1},ve=M=>{var me,be,de,Z,j,I,y;const P=Number(o((de=(be=(me=t.max)!=null?me:t.maxItems)!=null?be:t.collapseAfter)!=null?de:t.collapse)),Q=Number.isFinite(P)?Math.max(0,Math.trunc(P)):0;if(!Q||Q<3||M.length<=Q)return M.map((Y,K)=>({type:"item",item:Y,index:K,key:`item-${K}`}));let m=Number(o((j=(Z=t.leadingCount)!=null?Z:t.keepStart)!=null?j:1)),b=Number(o((y=(I=t.trailingCount)!=null?I:t.keepEnd)!=null?y:Math.max(1,Q-2)));if(m=Number.isFinite(m)?Math.max(1,Math.trunc(m)):1,b=Number.isFinite(b)?Math.max(1,Math.trunc(b)):Math.max(1,Q-2),m+b+1>Q&&(b=Math.max(1,Q-m-1),m+b+1>Q&&(m=Math.max(1,Q-b-1))),m+b>=M.length)return M.map((Y,K)=>({type:"item",item:Y,index:K,key:`item-${K}`}));const g=[];for(let Y=0;Y<m;Y++)g.push({type:"item",item:M[Y],index:Y,key:`item-${Y}`});const T=M.slice(m,M.length-b);g.push({type:"collapsed",key:`collapsed-${m}-${M.length-b}`,items:T,from:m,to:M.length-b-1});for(let Y=M.length-b;Y<M.length;Y++)g.push({type:"item",item:M[Y],index:Y,key:`item-${Y}`});return g},le=(M,me=null)=>{var be,de,Z,j,I;if(!M)return!1;const y=o((be=M.href)!=null?be:M.to)||"",P=o(M.to)||"";return!p(M)&&P&&(n!=null&&n.navigate)?(me!=null&&me.preventDefault&&me.preventDefault(),n.navigate(P),(de=M.onNavigate)==null||de.call(M,P,me||null),(Z=t.onNavigate)==null||Z.call(t,P,M,me||null),!0):((j=M.onNavigate)==null||j.call(M,P||y,me||null),(I=t.onNavigate)==null||I.call(t,P||y,M,me||null),!1)},ie=(M,me,be)=>{var de,Z,j;const I=M,y=be[me+1]||null,P={index:me,entry:M,previous:I,next:y},Q=U(o((j=(Z=(M==null?void 0:M.type)==="item"?(de=M.item)==null?void 0:de.separator:null)!=null?Z:t.separator)!=null?j:"/")),m=$(l,"separator",P,Q);return _.li({class:"jss-breadcrumbs-separator-item","aria-hidden":"true"},_.span({class:"jss-breadcrumbs-separator"},...m))},ge=(M,me,be)=>{const de={type:"collapsed",collapsed:!0,items:me,hiddenItems:M.items,currentIndex:be,from:M.from,to:M.to},Z=_.span({class:"jss-breadcrumb jss-breadcrumb-collapsed"},_.span({class:"jss-breadcrumb-inner"},_.span({class:"jss-breadcrumb-copy"},_.span({class:"jss-breadcrumb-label"},String(o(t.collapsedLabel)||"\u2026"))))),j=$(l,"collapsed",de,Z,"item");return _.li({class:"jss-breadcrumbs-entry is-collapsed"},...j)},ue=(M,me,be,de)=>{var Z,j,I,y,P,Q,m,b,g,T,Y,K,_e,J,A,L,O,X,we,Be,Ue,H,W,ee,Ne,Te;const oe=M.item||{},Pe=oe.slots?{...l,...oe.slots}:l,Ie=o((Z=oe.href)!=null?Z:oe.to)||"",Le=!!o(oe.disabled),Ye=M.index===be,ct=(y=(I=(j=oe.iconSize)!=null?j:t.itemSize)!=null?I:t.size)!=null?y:null,Re=N((m=(Q=(P=oe.color)!=null?P:oe.state)!=null?Q:t.color)!=null?m:t.state),C=!o(oe.color)&&o(oe.state)?sn(o(oe.state)):"",Se=(K=(Y=(T=(g=(b=oe.label)!=null?b:oe.title)!=null?g:oe.text)!=null?T:oe.to)!=null?Y:oe.href)!=null?K:"",Fe=(A=(J=(_e=oe.note)!=null?_e:oe.subtitle)!=null?J:oe.caption)!=null?A:oe.description,F=(O=(L=oe.badge)!=null?L:oe.counter)!=null?O:oe.count,f=(we=(X=oe.aside)!=null?X:oe.trailing)!=null?we:B(oe.iconRight,ct,"iconRight"),h=(Be=oe.content)!=null?Be:oe.body,x={item:oe,index:M.index,visibleIndex:de,total:me.length,current:Ye,active:Ye,disabled:Le,href:Ie,to:o(oe.to)||"",external:p(oe),isFirst:M.index===0,isLast:M.index===me.length-1,navigate:$t=>le(oe,$t)},ae=$(Pe,"icon",x,B(oe.icon,ct,"icon")),Oe=$(Pe,"label",x,Se),De=$(Pe,"note",x,Fe),Ge=$(Pe,"badge",x,F),Ke=$(Pe,"aside",x,f),We=$(Pe,"default",x,h),et=_.span({class:"jss-breadcrumb-inner"},ae.length?_.span({class:"jss-breadcrumb-icon"},...ae):null,_.span({class:"jss-breadcrumb-copy"},_.span({class:"jss-breadcrumb-label"},...Oe.length?Oe:[Ie||""]),De.length?_.span({class:"jss-breadcrumb-note"},...De):null,We.length?_.span({class:"jss-breadcrumb-extra"},...We):null),Ge.length?_.span({class:"jss-breadcrumb-badge"},...Ge):null,Ke.length?_.span({class:"jss-breadcrumb-aside"},...Ke):null),tt=!Le&&(!Ye||!!o((Ue=oe.linkCurrent)!=null?Ue:t.linkCurrent)),dt={class:re(["jss-breadcrumb","jss-clear-set","jss-singularity",pe(Ye,"is-current"),pe(Ye,"active"),pe(Le,"is-disabled"),C?`jss-state-${C}`:"",oe.class]),style:{...oe.style||{}},"aria-current":Ye?String(o((H=oe.ariaCurrent)!=null?H:t.ariaCurrent)||"page"):null};Re&&(dt.style["--jss-breadcrumb-accent"]=Re);let gt=null;tt&&Ie?(gt=_.a({...dt,href:Ie,target:oe.target,rel:oe.rel,onClick:$t=>{var zt,Xe;(zt=oe.onClick)==null||zt.call(oe,$t,x),(Xe=t.onItemClick)==null||Xe.call(t,oe,x,$t),!$t.defaultPrevented&&x.navigate($t)}},et),x.external&>.target==="_blank"&&!gt.rel&&(gt.rel="noopener noreferrer")):tt&&typeof oe.onClick=="function"?gt=_.button({...dt,type:oe.type||"button",onClick:$t=>{var zt,Xe;(zt=oe.onClick)==null||zt.call(oe,$t,x),(Xe=t.onItemClick)==null||Xe.call(t,oe,x,$t)}},et):gt=_.span({...dt,"aria-disabled":Le?"true":null},et),Et(gt,{size:(ee=(W=oe.size)!=null?W:t.itemSize)!=null?ee:t.size,radius:(Ne=oe.radius)!=null?Ne:t.radius,gradient:(Te=oe.gradient)!=null?Te:t.gradient});const It=$(Pe,"item",x,gt);return _.li({class:re(["jss-breadcrumbs-entry",pe(Ye,"is-current"),pe(Le,"is-disabled")])},...It)},fe=()=>{var M;const me=te(),be=E(me),de=ve(me),Z=N((M=t.color)!=null?M:t.state);r.classList.toggle("is-empty",me.length===0),Z?r.style.setProperty("--jss-breadcrumb-accent",Z):r.style.removeProperty("--jss-breadcrumb-accent");const j={items:me,visibleItems:de,currentIndex:be,count:me.length,collapsed:de.some(I=>I.type==="collapsed")};if(w(z,$(l,"before",j,t.before)),w(k,$(l,"after",j,t.after)),d.innerHTML="",!me.length){const I=$(l,"empty",j,t.empty);I.length&&d.appendChild(_.li({class:"jss-breadcrumbs-entry is-empty"},...I));return}de.forEach((I,y)=>{y>0&&d.appendChild(ie(de[y-1],y-1,de)),d.appendChild(I.type==="collapsed"?ge(I,me,be):ue(I,me,be,y))})};return wt.reactive.effect(()=>{fe()},"UI.Breadcrumbs:render"),r.getItems=()=>te(),r.getVisibleItems=()=>ve(te()),r.refresh=()=>(fe(),r),r.setItems=M=>(i?i.set(M):t.items=M,fe(),r),Et(r,t),r},xe.Pagination=(...e)=>{const{props:t}=JSswift.uiNormalizeArgs(e),s=t.slots||{},l=en(t.model,"UI.Pagination:model"),n=xt(t.size,()=>{const m=o(t.size);return typeof m=="string"&&Un[m]?`jss-size-${m}`:""}),i=_.nav({class:re(["jss-pagination","jss-clear-set",n,pe(t.dense,"dense"),pe(t.simple,"is-simple"),pe(t.disabled,"is-disabled"),t.class]),style:{...t.style||{}},role:"navigation","aria-label":t.ariaLabel||"Pagination"}),c=_.div({class:"jss-pagination-controls"}),a=_.div({class:"jss-pagination-start"}),v=_.div({class:"jss-pagination-pages"}),r=_.div({class:"jss-pagination-end"}),z=_.div({class:"jss-pagination-summary"});c.appendChild(a),c.appendChild(v),c.appendChild(r),i.appendChild(c),i.appendChild(z);let d=1,k=1;const N=(m,b=0)=>{const g=o(m);if(g==null||g==="")return b;const T=Number(g);return Number.isFinite(T)?Math.trunc(T):b},p=(m,b=U())=>{const g=Number(m),T=Number.isFinite(g)?Math.trunc(g):1;return Math.min(Math.max(T||1,1),Math.max(1,b||1))},U=()=>{var m,b,g,T,Y,K,_e;const J=N((g=(b=(m=t.max)!=null?m:t.pages)!=null?b:t.pageCount)!=null?g:t.totalPages,0);if(J>0)return J;const A=N((Y=(T=t.total)!=null?T:t.totalItems)!=null?Y:t.count,0),L=N((_e=(K=t.pageSize)!=null?K:t.perPage)!=null?_e:t.limit,0);return A>=0&&L>0?Math.max(1,Math.ceil(A/L)):1},w=()=>{var m,b,g;return N(l?l.get():(g=(b=(m=t.page)!=null?m:t.value)!=null?b:t.current)!=null?g:t.currentPage,1)},$=()=>{var m,b;return Math.max(0,N((b=(m=t.siblings)!=null?m:t.siblingCount)!=null?b:t.window,1))},B=()=>{var m,b;return Math.max(0,N((b=(m=t.boundaryCount)!=null?m:t.boundaries)!=null?b:t.edges,1))},te=()=>!!o(t.disabled),E=()=>{var m;return o((m=t.showSummary)!=null?m:t.showLabel)!==!1},ve=()=>o(t.showPages)!==!1&&!o(t.simple),le=()=>o(t.showPrev)!==!1,ie=()=>o(t.showNext)!==!1,ge=()=>!!o(t.showEdges),ue=()=>{const m=o(t.showFirst);return m==null?ge():!!m},fe=()=>{const m=o(t.showLast);return m==null?ge():!!m},M=()=>!!o(t.hideOnSinglePage),me=()=>{var m,b;const g=o((b=(m=t.total)!=null?m:t.totalItems)!=null?b:t.count);if(g==null||g==="")return null;const T=Number(g);return Number.isFinite(T)?Math.max(0,Math.trunc(T)):null},be=()=>{var m,b;const g=o((b=(m=t.pageSize)!=null?m:t.perPage)!=null?b:t.limit);if(g==null||g==="")return null;const T=Number(g);return Number.isFinite(T)&&T>0?Math.trunc(T):null},de=(m=d,b=k)=>{const g=me(),T=be(),Y=g!=null&&T?g===0?0:(m-1)*T+1:null,K=g!=null&&T?Math.min(g,m*T):null;return{page:m,value:m,current:m,currentPage:m,pages:b,max:b,total:g,pageSize:T,from:Y,to:K,disabled:te(),isFirst:m<=1,isLast:m>=b,canPrev:m>1,canNext:m<b,setPage:(_e,J)=>Q(_e,J),prev:_e=>Q(m-1,_e),next:_e=>Q(m+1,_e),first:_e=>Q(1,_e),last:_e=>Q(b,_e)}},Z=(m,b)=>{if(b<=0)return[];const g=[],T=new Set,Y=B(),K=$();for(let J=1;J<=Math.min(Y,b);J++)T.add(J);for(let J=Math.max(1,m-K);J<=Math.min(b,m+K);J++)T.add(J);for(let J=Math.max(1,b-Y+1);J<=b;J++)T.add(J);let _e=0;for(let J=1;J<=b;J++)T.has(J)&&(_e&&J-_e>1&&g.push({type:"ellipsis",key:`ellipsis-${_e}-${J}`}),g.push({type:"page",page:J,key:`page-${J}`}),_e=J);return g.length||g.push({type:"page",page:1,key:"page-1"}),g},j=(m,b,g,T=null)=>{const Y=JSswift.ui.getSlot(s,m)!=null?D(s,m,g,b):[];return Y.length?Y:T&&JSswift.ui.getSlot(s,T)!=null?D(s,T,g,b):D(null,"default",g,b)},I=(m,b)=>{m.innerHTML="",b.forEach(g=>m.appendChild(g))},y=(m,b,g,T={})=>{var Y;const K={...de(),kind:m,active:!!T.active};return xe.Btn({class:re(["jss-pagination-btn",`jss-pagination-${m}`,pe(T.active,"active"),T.class]),size:t.itemSize||t.size||(t.dense?"sm":"md"),color:T.active?t.color||t.state||"primary":T.color||null,outline:T.active?!1:(Y=T.outline)!=null?Y:!0,disabled:te()||!!T.disabled,"aria-current":T.active?"page":null,onClick:_e=>{te()||T.disabled||g==null||g(_e)}},...j(m,b,K,m==="summary"?"label":m==="page"?"item":null))},P=(m,b)=>{d=p(m,b),k=Math.max(1,b||1);const g=de(d,k);i.style.display=M()&&k<=1?"none":"",z.style.display=E()?"":"none",v.style.display=ve()?"":"none",a.innerHTML="",v.innerHTML="",r.innerHTML="";const T=j("start",t.start,g);T.length&&a.appendChild(_.div({class:"jss-pagination-extra jss-pagination-extra-start"},...T)),ue()&&a.appendChild(y("first","\xAB",_e=>Q(1,_e),{disabled:d<=1})),le()&&a.appendChild(y("prev","Prev",_e=>Q(d-1,_e),{disabled:d<=1})),ve()&&Z(d,k).forEach(_e=>{if(_e.type==="ellipsis"){const L={...g,kind:"ellipsis"},O=j("ellipsis","\u2026",L);v.appendChild(_.span({class:"jss-pagination-ellipsis","aria-hidden":"true"},...O));return}const J=_e.page,A={...g,page:J,value:J,item:_e,active:J===d};v.appendChild(xe.Btn({class:re(["jss-pagination-btn","jss-pagination-page-btn",pe(J===d,"active")]),size:t.itemSize||t.size||(t.dense?"sm":"md"),color:J===d?t.color||t.state||"primary":null,outline:J!==d,disabled:te(),"aria-current":J===d?"page":null,onClick:L=>Q(J,L)},...j("page",String(J),A,"item")))}),ie()&&r.appendChild(y("next","Next",_e=>Q(d+1,_e),{disabled:d>=k})),fe()&&r.appendChild(y("last","\xBB",_e=>Q(k,_e),{disabled:d>=k}));const Y=j("end",t.end,g);Y.length&&r.appendChild(_.div({class:"jss-pagination-extra jss-pagination-extra-end"},...Y));let K=`Pagina ${d} di ${k}`;g.total!=null&&g.pageSize&&(K=g.total===0?"0 risultati":`${g.from}-${g.to} di ${g.total}`),I(z,j("summary",K,g,"label"))},Q=(m,b=null)=>{var g,T;const Y=U(),K=p(m,Y);return K===d&&Y===k||(P(K,Y),l&&l.get()!==K&&l.set(K),(g=t.onChange)==null||g.call(t,K,de(K,Y),b),(T=t.onPageChange)==null||T.call(t,K,de(K,Y),b)),K};return wt.reactive.effect(()=>{const m=U(),b=w(),g=p(b,m);P(g,m),l&&b!==g&&l.set(g)},"UI.Pagination:sync"),i.getPage=()=>d,i.getPages=()=>k,i.setPage=m=>Q(m),i.prev=()=>Q(d-1),i.next=()=>Q(d+1),i.first=()=>Q(1),i.last=()=>Q(k),Et(i,t),i},xe.Spinner=(...e)=>{var t;const{props:s,children:l}=JSswift.uiNormalizeArgs(e),n=s.slots||{},i=(E,ve,le)=>{if(ht(E))return()=>{const ge=o(E);if(ge==null||ge===!1||ge==="")return le;const ue=ve?ve(ge):ge;return ue==null||ue===""?le:ue};if(E==null||E===!1||E==="")return le;const ie=ve?ve(E):E;return ie==null||ie===""?le:ie},c=E=>{if(E==null||E===!1||E===""||sn(E))return"";const le=String(E).trim();return le?le.startsWith("#")||le.startsWith("rgb(")||le.startsWith("rgba(")||le.startsWith("hsl(")||le.startsWith("hsla(")||le.startsWith("var(")?le:Fn(le)?`var(--jss-${le})`:le:""},a=xt(s.state,()=>{const E=sn(o(s.state));return E?`jss-state-${E}`:""}),v=re(["jss-spinner",a,pe(s.vertical,"vertical"),pe(s.reverse,"reverse"),pe(s.center,"center"),pe(s.block,"block"),pe(s.pause||s.paused,"paused"),s.class]),r=JSswift.omit(s,["ariaLabel","block","center","color","indicatorClass","indicatorStyle","label","note","pause","paused","reverse","size","slots","speed","state","thickness","trackColor","vertical"]);r.class=v;const z={...s.style||{}};s.color!=null&&Object.prototype.hasOwnProperty.call(z,"backgroundColor")&&delete z.backgroundColor,r.style=z,r.role==null&&(r.role="status"),r["aria-live"]==null&&(r["aria-live"]="polite"),r["aria-busy"]==null&&(r["aria-busy"]="true");const d={props:s},k=D(n,"label",d,s.label),N=D(n,"default",d,l),p=D(n,"note",d,s.note),U=k.length||N.length||p.length;if(!U){const E=o((t=s.ariaLabel)!=null?t:s["aria-label"]);E?r["aria-label"]=E:r["aria-label"]==null&&(r["aria-label"]="Loading")}const w=_.span({class:re(["jss-spinner-indicator",s.indicatorClass]),style:{"--jss-spinner-size":i(s.size,vt,"18px"),"--jss-spinner-thickness":i(s.thickness,vt,"2px"),"--jss-spinner-speed":i(s.speed,E=>typeof E=="number"?`${E}ms`:String(E),"900ms"),"--jss-spinner-color":i(s.color,c,"var(--set-border-color, var(--jss-primary))"),"--jss-spinner-track":i(s.trackColor,c,"color-mix(in srgb, var(--jss-spinner-color) 18%, transparent)"),...s.indicatorStyle||{}},"aria-hidden":"true"}),$=D(n,"indicator",d,w),B=[];$.length&&B.push(...$),U&&B.push(_.div({class:"jss-spinner-content"},k.length?_.div({class:"jss-spinner-label"},...k):null,N.length?_.div({class:"jss-spinner-copy"},...N):null,p.length?_.div({class:"jss-spinner-note"},...p):null));const te=_.div(r,...B);return Et(te,s),te},xe.Progress=(...e)=>{var t,s,l,n,i,c,a,v,r,z;const{props:d,children:k}=JSswift.uiNormalizeArgs(e),N=d.slots||{},p=d.model||(yt(d.value)||rt(d.value)?d.value:null),U=en(p,"UI.Progress:model"),w=xt([d.state,d.color],()=>{const oe=sn(o(d.state)||o(d.color));return oe?`jss-state-${oe}`:""}),$=(oe,Pe)=>{const Ie=Number(oe);return Number.isFinite(Ie)?Ie:Pe},B=()=>$(o(d.min),0),te=()=>{const oe=B(),Pe=$(o(d.max),100);return Pe<oe?oe:Pe},E=()=>{var oe,Pe;const Ie=o((Pe=(oe=d.height)!=null?oe:d.thickness)!=null?Pe:d.size);return Ie==null||Ie===""?"8px":typeof Ie=="number"?`${Ie}px`:typeof Ie=="string"?{xxs:"4px",xs:"6px",sm:"8px",md:"10px",lg:"12px",xl:"14px",xxl:"16px",xxxl:"18px"}[Ie]||Ie:"8px"},ve=(oe,Pe="")=>{const Ie=o(oe);if(Ie==null||Ie===!1||Ie==="")return Pe;const Le=sn(Ie);return Le?`var(--jss-${Le})`:typeof Ie=="string"&&Fn(Ie)?`var(--jss-${Ie})`:String(Ie)},le=oe=>{const Pe=B(),Ie=te(),Le=$(oe,Pe);return Math.min(Ie,Math.max(Pe,Le))},ie=oe=>{const Pe=B(),Le=te()-Pe;if(!Le)return 0;const Ye=(le(oe)-Pe)/Le,ct=o(d.reverse)?1-Ye:Ye;return Math.max(0,Math.min(1,ct))},ge=oe=>{const Pe=le(oe);return Pe<Z()?Z():Pe},ue=(oe,Pe,Ie)=>{const Le=d.formatValue;if(typeof Le=="function"){const Ye=Le(oe,Pe,Ie);if(Ye!=null)return Ye}return`${Math.round(Pe)}%`},fe=oe=>{for(;oe.firstChild;)oe.removeChild(oe.firstChild)},M=(oe,Pe,Ie="flex")=>{fe(oe),(Pe||[]).forEach(Le=>{if(!(Le==null||Le===!1)){if(Le instanceof Node){oe.appendChild(Le);return}oe.appendChild(document.createTextNode(String(Le)))}}),oe.style.display=oe.childNodes.length?Ie:"none"},me=(oe,Pe={})=>Bs(o(oe),Pe),be=(oe,Pe,Ie={})=>{var Le;const Ye=o(oe);return Ye==null||Ye===!1||Ye===""?[]:typeof Ye=="string"?[xe.Icon({name:Ye,size:(Le=d.iconSize)!=null?Le:16})]:me(Ye,{...Ie,as:Pe})},de=oe=>rt(oe)||yt(oe)?o(oe):typeof oe=="function"&&oe.length===0?oe():oe,[Z,j]=JSswift.reactive.signal(le(U?U.get():(s=(t=o(d.value))!=null?t:o(d.min))!=null?s:0)),[I,y]=JSswift.reactive.signal(ge((i=o(d.buffer))!=null?i:U?U.get():(n=(l=o(d.value))!=null?l:o(d.min))!=null?n:0)),P=(oe,Pe={})=>{const Ie=le(oe);return Z()!==Ie&&j(Ie),I()<Ie&&y(Ie),U&&Pe.fromModel!==!0&&U.set(Ie),Ie},Q=oe=>{const Pe=ge(oe);return I()!==Pe&&y(Pe),Pe},m=JSswift.omit(d,["model","value","min","max","buffer","class","style","slots","label","note","showValue","valueLabel","insideLabel","formatValue","icon","iconRight","iconSize","startLabel","endLabel","leftLabel","rightLabel","trackColor","bufferColor","height","thickness","size","state","color","reverse","striped","animated","indeterminate","ariaLabel","ariaValueText","width","dense","outline","flat","border","glossy","glow","glass","shadow","gradient","textGradient","lightShadow","radius","rounded","textColor"]),b={width:o(d.width)||"100%",...d.style||{}},g=o(d.color);(g!=null||ht(d.color))&&!sn(g||"")&&delete b.backgroundColor,m.class=re(["jss-progress-wrap",pe(d.dense,"dense"),pe(d.reverse,"is-reverse"),pe(d.indeterminate,"is-indeterminate"),w,d.class]),m.style=b;const T=_.div({class:"jss-progress-header"}),Y=_.div({class:"jss-progress-heading"}),K=_.div({class:"jss-progress-label"}),_e=_.div({class:"jss-progress-note"}),J=_.div({class:"jss-progress-value"});Y.append(K,_e),T.append(Y,J);const A=_.div({class:"jss-progress-body"}),L=_.span({class:"jss-progress-edge-label jss-progress-edge-label-left"}),O=_.div({class:"jss-progress",role:"progressbar"}),X=_.span({class:"jss-progress-buffer"}),we=_.span({class:re(["jss-progress-bar","jss-singularity",w,pe(d.outline,"jss-outline"),pe(d.flat,"jss-flat"),pe(d.border,"jss-border"),pe(d.glossy,"jss-glossy"),pe(d.glow,"jss-glow"),pe(d.glass,"jss-glass"),pe(d.shadow,"jss-shadow"),xt(d.shadow,()=>{const oe=ws(o(d.shadow));return oe?`jss-shadow-${oe}`:""}),pe(d.gradient,"jss-gradient"),pe(d.textGradient,"jss-text-gradient"),pe(d.lightShadow,"jss-light-shadow"),pe(d.striped,"is-striped"),pe(d.animated||d.indeterminate,"is-animated")])}),Be=_.span({class:"jss-progress-bar-label"});we.appendChild(Be),O.append(X,we);const Ue=_.span({class:"jss-progress-edge-label jss-progress-edge-label-right"});A.append(L,O,Ue);const H=_.div(m,T,A);Et(we,d);const W=()=>{const oe=Z(),Pe=ie(oe)*100,Ie={value:oe,percent:Pe,min:B(),max:te(),buffer:I(),progress:H,track:O,bar:we,props:d},Le=D(N,"icon",Ie,null),Ye=Le.length?[]:be(d.icon,"icon",Ie),ct=D(N,"label",Ie,de(d.label)),Re=ct.length?ct:D(N,"default",Ie,k),C=D(N,"iconRight",Ie,null),Se=C.length?[]:be(d.iconRight,"iconRight",Ie),Fe=D(N,"note",Ie,de(d.note)),F=d.valueLabel!=null?de(d.valueLabel):ue(oe,Pe,Ie),f=o(d.showValue),h=f===!0||d.valueLabel!=null||JSswift.ui.getSlot(N,"value")!=null?D(N,"value",Ie,F):[];M(K,[...Ye,...Le,...Re,...Se,...C],"inline-flex"),M(_e,Fe,"block"),M(J,f==="inside"?[]:h,"inline-flex"),T.style.display=K.childNodes.length||_e.childNodes.length||J.childNodes.length?"flex":"none"},ee=()=>{var oe,Pe;const Ie=Z(),Le=ie(Ie)*100,Ye={value:Ie,percent:Le,min:B(),max:te(),buffer:I(),progress:H,track:O,bar:we,props:d},ct=de((oe=d.startLabel)!=null?oe:d.leftLabel),Re=de((Pe=d.endLabel)!=null?Pe:d.rightLabel);M(L,D(N,"startLabel",Ye,ct),"inline-flex"),M(Ue,D(N,"endLabel",Ye,Re),"inline-flex")},Ne=()=>{const oe=Z(),Pe=ie(oe)*100,Ie={value:oe,percent:Pe,min:B(),max:te(),buffer:I(),progress:H,track:O,bar:we,props:d},Le=o(d.showValue),Ye=d.insideLabel!=null?de(d.insideLabel):ue(oe,Pe,Ie),ct=Le==="inside"||d.insideLabel!=null||JSswift.ui.getSlot(N,"inside")!=null?D(N,"inside",Ie,Ye):[];M(Be,ct,"inline-flex")},Te=()=>{const oe=Z(),Pe=I(),Ie=B(),Le=te(),Ye=ie(oe)*100,ct=ie(Pe)*100,Re=ve(d.color,""),C=ve(d.trackColor,Re?`color-mix(in srgb, ${Re} 14%, transparent)`:"rgba(255,255,255,0.08)"),Se=ve(d.bufferColor,Re?`color-mix(in srgb, ${Re} 30%, transparent)`:"rgba(255,255,255,0.16)"),Fe=o(d.ariaLabel),F=o(d.ariaValueText),f=!!o(d.indeterminate),h=o(d.radius);H.style.width=o(d.width)||"100%",H.style.setProperty("--jss-progress-height",E()),h!=null?typeof h=="number"?H.style.setProperty("--jss-progress-radius",`${h}px`):typeof h=="string"&&JSswift.uiSizes.includes(h)?H.style.setProperty("--jss-progress-radius",`var(--jss-r-${h})`):H.style.setProperty("--jss-progress-radius",String(h)):H.style.removeProperty("--jss-progress-radius"),O.style.background=C,X.style.background=Se,X.style.width=`${ct}%`,Re&&!sn(o(d.state)||o(d.color))?(we.style.setProperty("--set-background-color",Re),we.style.setProperty("--set-border-color",Re),we.style.setProperty("--set-color",o(d.textColor)||"var(--jss-on-primary, #fff)")):sn(o(d.state)||o(d.color))?(we.style.removeProperty("--set-background-color"),we.style.removeProperty("--set-border-color"),we.style.removeProperty("--set-color")):(we.style.setProperty("--set-background-color","var(--jss-primary)"),we.style.setProperty("--set-border-color","var(--jss-primary)"),we.style.setProperty("--set-color",o(d.textColor)||"var(--jss-on-primary, #fff)")),f?(we.style.width="",O.removeAttribute("aria-valuenow"),O.removeAttribute("aria-valuemin"),O.removeAttribute("aria-valuemax")):(we.style.width=`${Ye}%`,O.setAttribute("aria-valuemin",String(Ie)),O.setAttribute("aria-valuemax",String(Le)),O.setAttribute("aria-valuenow",String(oe))),Fe!=null?O.setAttribute("aria-label",String(Fe)):typeof o(d.label)=="string"?O.setAttribute("aria-label",String(o(d.label))):O.removeAttribute("aria-label"),F!=null?O.setAttribute("aria-valuetext",String(F)):f?O.removeAttribute("aria-valuetext"):O.setAttribute("aria-valuetext",ue(oe,Ye,{value:oe,percent:Ye,min:Ie,max:Le,buffer:Pe,progress:H,track:O,bar:we,props:d})),H.classList.toggle("has-start-label",L.childNodes.length>0),H.classList.toggle("has-end-label",Ue.childNodes.length>0),H.classList.toggle("has-inside-label",Be.childNodes.length>0)};return U?(P(U.get(),{fromModel:!0}),U.watch(oe=>{P(oe,{fromModel:!0})},"UI.Progress:watch")):ht(d.value)?JSswift.reactive.effect(()=>{P(o(d.value),{fromModel:!0})},"UI.Progress:value"):P((a=(c=d.value)!=null?c:d.min)!=null?a:0,{fromModel:!0}),ht(d.buffer)?JSswift.reactive.effect(()=>{Q(o(d.buffer))},"UI.Progress:buffer"):Q((z=(r=(v=d.buffer)!=null?v:d.value)!=null?r:d.min)!=null?z:0),JSswift.reactive.effect(()=>{W(),ee(),Ne(),Te()},"UI.Progress:render"),H._track=O,H._bar=we,H._buffer=X,H._getValue=Z,H._getBuffer=I,H._setValue=oe=>P(oe),H._setBuffer=oe=>Q(oe),H},xe.LoadingBar=function(...t){var s,l;const{props:n,children:i}=JSswift.uiNormalizeArgs(t),c=(O,X)=>{const we=Number(O);return Number.isFinite(we)?we:X},a=()=>c(o(n.min),0),v=()=>{const O=a(),X=c(o(n.max),100);return X<O?O:X},r=O=>{const X=a(),we=v(),Be=c(O,X);return Math.min(we,Math.max(X,Be))},z=(O,X="")=>O==null||O===!1||O===""?X:typeof O=="number"?`${O}px`:String(O),d=O=>{const X=o(O);return!X||X===document?document.body:typeof X=="string"?document.querySelector(X)||document.body:X&&X.body instanceof HTMLElement?X.body:X instanceof HTMLElement?X:document.body},k=n.model||(yt(n.value)||rt(n.value)?n.value:null),N=en(k,"UI.LoadingBar:model"),p=yt(n.buffer)||rt(n.buffer)?n.buffer:null,U=en(p,"UI.LoadingBar:buffer"),w=N?N.get():(s=o(n.value))!=null?s:a(),$=U?U.get():(l=o(n.buffer))!=null?l:w,[B,te]=JSswift.reactive.signal(r(w)),[E,ve]=JSswift.reactive.signal(Math.max(r($),r(w))),[le,ie]=JSswift.reactive.signal(n.visible!=null?!!o(n.visible):r(w)>a()||!!o(n.indeterminate));let ge=null,ue=null;const fe=()=>{ge&&(clearInterval(ge),ge=null)},M=()=>{ue&&(clearTimeout(ue),ue=null)},me=(O,X={})=>{const we=!!O;return le()!==we&&ie(we),X.fromExternal!==!0&&typeof n.onVisibleChange=="function"&&n.onVisibleChange(we),we},be=(O,X={})=>{const we=r(O);return B()!==we&&te(we),E()<we&&(ve(we),U&&X.fromExternal!==!0&&U.set(we)),N&&X.fromExternal!==!0&&N.set(we),we},de=(O,X={})=>{const we=Math.max(be(B(),{fromExternal:!0}),r(O));return E()!==we&&ve(we),U&&X.fromExternal!==!0&&U.set(we),we},Z=(O=B())=>{n.visible==null&&(o(n.indeterminate)||O>a()?me(!0):o(n.hideOnZero)!==!1&&me(!1))},j=()=>{if(fe(),o(n.trickle)===!1||o(n.indeterminate))return;const O=c(o(n.trickleInterval),280);O<=0||(ge=setInterval(()=>{var X,we;const Be=B(),Ue=r((we=(X=o(n.trickleTo))!=null?X:o(n.trickleMax))!=null?we:92);if(Be>=Ue)return;const H=c(o(n.trickleStep),Be<45?12:Be<75?7:3);be(Math.min(Ue,Be+H))},O))},I=JSswift.omit(n,["model","value","min","max","buffer","class","style","slots","label","note","showValue","valueLabel","insideLabel","formatValue","icon","iconRight","iconSize","startLabel","endLabel","leftLabel","rightLabel","trackColor","bufferColor","height","thickness","size","state","color","reverse","striped","animated","indeterminate","ariaLabel","ariaValueText","width","dense","outline","flat","border","glossy","glow","glass","shadow","gradient","textGradient","lightShadow","radius","rounded","textColor","target","mount","position","top","right","bottom","left","inset","zIndex","visible","autoStart","hideOnZero","startValue","step","trickle","trickleStep","trickleInterval","trickleMax","trickleTo","doneValue","doneDelay","hideDelay","resetValue","progressClass","progressStyle","onVisibleChange"]);I.class=re(["jss-loading-bar",n.class]),I.style={...n.style||{}};const y=JSswift.omit(n,["target","mount","position","top","right","bottom","left","inset","zIndex","visible","autoStart","hideOnZero","startValue","step","trickle","trickleStep","trickleInterval","trickleMax","trickleTo","doneValue","doneDelay","hideDelay","resetValue","progressClass","progressStyle","onVisibleChange"]);y.class=re(["jss-loading-bar-progress",n.progressClass,y.class]),y.style={...n.progressStyle||{}},y.value=[B,te],y.buffer=[E,ve],y.dense==null&&(y.dense=!0),y.height==null&&y.thickness==null&&y.size==null&&(y.height=3),y.width==null&&(y.width="100%");const P=_.div(I),Q=xe.Progress(y,...i);P.appendChild(Q);const m=O=>{M();const X=be(O);return Z(X),P},b=O=>{M();const X=de(O);return Z(X),P},g=(O=(X=>(X=o(n.step))!=null?X:8)())=>{M();const X=B(),we=be(X+c(O,0));return Z(we),P},T=(O=(X=>(X=o(n.startValue))!=null?X:12)())=>{M();const X=Math.max(B(),r(O));return be(X),de(Math.max(E(),X)),Z(X),j(),P},Y=(O=(X=>(X=o(n.resetValue))!=null?X:a())())=>{M(),fe();const X=r(O);return de(X),be(X),Z(X),P},K=(O=(X=>(X=o(n.doneValue))!=null?X:v())())=>{var X;M(),fe();const we=r(O);de(we),be(we),Z(we);const Be=Math.max(0,c((X=o(n.hideDelay))!=null?X:o(n.doneDelay),220));return ue=setTimeout(()=>{Y()},Be),P},_e=(...O)=>K(...O),J=()=>(me(!0),P),A=()=>(M(),fe(),me(!1),P),L=()=>(M(),fe(),P.remove(),null);return P.el=P,P._progress=Q,P.get=()=>B(),P.getBuffer=()=>E(),P.set=m,P.setBuffer=b,P.inc=g,P.start=T,P.done=K,P.complete=K,P.stop=_e,P.reset=Y,P.show=J,P.hide=A,P.destroy=L,P._dispose=L,N?N.watch(O=>{be(O,{fromExternal:!0}),Z(r(O))},"UI.LoadingBar:watch"):ht(n.value)&&JSswift.reactive.effect(()=>{const O=r(o(n.value));be(O,{fromExternal:!0}),Z(O)},"UI.LoadingBar:value"),U?U.watch(O=>{de(O,{fromExternal:!0})},"UI.LoadingBar:bufferWatch"):ht(n.buffer)&&JSswift.reactive.effect(()=>{de(o(n.buffer),{fromExternal:!0})},"UI.LoadingBar:buffer"),JSswift.reactive.effect(()=>{const O=a(),X=v(),we=Math.min(X,Math.max(O,B())),Be=Math.max(we,Math.min(X,Math.max(O,E())));we!==B()&&te(we),Be!==E()&&ve(Be)},"UI.LoadingBar:range"),JSswift.reactive.effect(()=>{n.visible!=null&&me(o(n.visible),{fromExternal:!0})},"UI.LoadingBar:visible"),JSswift.reactive.effect(()=>{var O;const X=o(n.position)||"fixed",we=o(n.inset),Be=o(n.top),Ue=o(n.right),H=o(n.bottom),W=o(n.left),ee=o(n.width),Ne=n.visible!=null?!!o(n.visible):le(),Te=X==="static"||X==="relative";P.classList.toggle("is-visible",Ne),P.classList.toggle("is-inline",Te),P.classList.toggle("has-track",!!o(n.trackColor)),P.style.position=X,P.style.zIndex=String((O=o(n.zIndex))!=null?O:10002),P.style.width=z(ee,Te?"100%":""),we!=null&&we!==""?(P.style.inset=z(we),P.style.removeProperty("top"),P.style.removeProperty("right"),P.style.removeProperty("bottom"),P.style.removeProperty("left")):(P.style.removeProperty("inset"),!Te&&X!=="sticky"?(P.style.top=z(Be,"0px"),P.style.right=z(Ue,ee==null||ee===""?"0px":""),P.style.bottom=z(H,""),P.style.left=z(W,"0px")):(P.style.top=z(Be,""),P.style.right=z(Ue,""),P.style.bottom=z(H,""),P.style.left=z(W,"")))},"UI.LoadingBar:layout"),Et(P,n),o(n.mount)!==!1&&d(n.target).appendChild(P),o(n.autoStart)&&T(),P};const so=new Set(["top-left","top-center","top-right","bottom-left","bottom-center","bottom-right"]),Ro=new Set(["soft","solid","outline"]),Jo={success:"Success",warning:"Warning",danger:"Error",info:"Info",primary:"Notice",secondary:"Notice",light:"Notice",dark:"Notice"},Mo={success:"check_circle",warning:"warning",danger:"error",info:"info",primary:"bolt",secondary:"notifications",light:"notifications",dark:"shield"},lo=e=>{const t=String(o(e)||"").trim().toLowerCase();return t?so.has(t)?t:t==="top"?"top-right":t==="bottom"?"bottom-right":t==="left"?"bottom-left":t==="right"?"bottom-right":t==="center"?"bottom-center":"bottom-right":"bottom-right"},Oo=e=>{const t=String(o(e)||"").trim().toLowerCase();return Ro.has(t)?t:"soft"},Fo=(e,t)=>{const s=o(e);if(s===!1||s===null)return 0;if(s===!0||s===""||s===void 0)return t==="danger"?3500:2500;const l=Number(s);return Number.isFinite(l)&&l>=0?l:t==="danger"?3500:2500},Hn=(e={},t="")=>{var s,l,n,i,c,a,v,r,z,d,k,N,p,U;const w=Rn(e)?{...e}:{message:e},$=sn(o(t)||o(w.type)||o(w.state)||o(w.color)||"info")||"info",B=Fo((l=(s=w.timeout)!=null?s:w.duration)!=null?l:w.delay,$),te=(c=(i=(n=w.closable)!=null?n:w.dismissible)!=null?i:w.dismiss!=null)!=null?c:B===0,E=w.title===void 0?w.label===void 0?Jo[$]:w.label:w.title;return{...w,type:$,state:$,title:E,message:(r=(v=(a=w.message)!=null?a:w.content)!=null?v:w.text)!=null?r:null,description:(k=(d=(z=w.description)!=null?z:w.subtitle)!=null?d:w.note)!=null?k:null,meta:(p=(N=w.meta)!=null?N:w.caption)!=null?p:null,body:(U=w.body)!=null?U:null,timeout:B,closable:!!te,dismissLabel:w.dismissLabel||w.closeLabel||"Chiudi notifica",position:lo(w.position),variant:Oo(w.variant),slots:w.slots||{},role:w.role||($==="danger"||$==="warning"?"alert":"status")}},oo=(e,t="",s="")=>{if(!e.length)return Hn(s?{type:t,title:s}:{type:t});if(Rn(e[0])){const{props:a,children:v}=JSswift.uiNormalizeArgs(e),r={...a};return!r.type&&!r.state&&!r.color&&t&&(r.type=t),r.title==null&&s&&(r.title=s),v.length&&(r.message==null&&r.description==null&&r.body==null&&v.length===1?r.message=v[0]:r.body==null&&(r.body=v.length===1?v[0]:v)),Hn(r,t)}const[l,n,i]=e;let c={};return Rn(n)?c={...n,message:l}:Rn(i)?c={...i,message:l,title:n}:c={message:l,title:n},t&&!c.type&&!c.state&&!c.color&&(c.type=t),c.title==null&&s&&(c.title=s),Hn(c,t)},Pn=(e,t)=>(...s)=>{var l,n;return(n=(l=wt.services.notify)==null?void 0:l.show)==null?void 0:n.call(l,oo(s,e,t))},pl=(e,t,s)=>{if(e===!1)return!1;if(typeof e=="function"){const l=e();return pl(l,t,s)}return Rn(e)?e:e!=null?{message:e,title:s}:{message:t,title:s}};xe.Notify=(...e)=>{var t,s;return(s=(t=wt.services.notify)==null?void 0:t.show)==null?void 0:s.call(t,oo(e))},xe.Notify.show=xe.Notify,xe.Notify.success=Pn("success","Success"),xe.Notify.error=Pn("danger","Error"),xe.Notify.warning=Pn("warning","Warning"),xe.Notify.info=Pn("info","Info"),xe.Notify.primary=Pn("primary","Notice"),xe.Notify.secondary=Pn("secondary","Notice"),xe.Notify.remove=e=>{var t,s;return(s=(t=wt.services.notify)==null?void 0:t.remove)==null?void 0:s.call(t,e)},xe.Notify.clear=()=>{var e,t;return(t=(e=wt.services.notify)==null?void 0:e.clear)==null?void 0:t.call(e)},xe.Notify.update=(e,t={})=>{var s,l;return(l=(s=wt.services.notify)==null?void 0:s.update)==null?void 0:l.call(s,e,t)},xe.Notify.promise=async(e,t={})=>{var s,l,n,i,c,a,v,r,z,d,k,N,p,U;const w=t.loading===!1?!1:pl(typeof t.loading=="function"?()=>t.loading():t.loading,"Operazione in corso...","In corso"),$=w===!1?null:(l=(s=wt.services.notify)==null?void 0:s.show)==null?void 0:l.call(s,Hn({type:"info",timeout:0,closable:!1,...w},"info"));try{const te=await(typeof e=="function"?e():e),E=pl(typeof t.success=="function"?()=>t.success(te):t.success,"Operazione completata con successo.","Completato");return E!==!1?$!=null?(i=(n=wt.services.notify)==null?void 0:n.update)==null||i.call(n,$,Hn(E,"success")):(a=(c=wt.services.notify)==null?void 0:c.show)==null||a.call(c,Hn(E,"success")):$!=null&&((r=(v=wt.services.notify)==null?void 0:v.remove)==null||r.call(v,$)),te}catch(B){const te=pl(typeof t.error=="function"?()=>t.error(B):t.error,(B==null?void 0:B.message)||"Operazione fallita.","Errore");throw te!==!1?$!=null?(d=(z=wt.services.notify)==null?void 0:z.update)==null||d.call(z,$,Hn(te,"danger")):(N=(k=wt.services.notify)==null?void 0:k.show)==null||N.call(k,Hn(te,"danger")):$!=null&&((U=(p=wt.services.notify)==null?void 0:p.remove)==null||U.call(p,$)),B}},xe.Header=(...e)=>{var t,s,l,n,i,c,a;const{props:v,children:r}=JSswift.uiNormalizeArgs(e),z=v.slots||{},d={...v};pn(d);const k=A=>Object.prototype.hasOwnProperty.call(v,A),N=(t=v.drawerStateKey)!=null?t:qn;N&&(qn=N,In=is(N));const p=()=>is(N),U=()=>Vn(!0,N),w=()=>Vn(!1,N),$=()=>Vn(!p(),N),B={props:v,stateKey:N,isDrawerOpen:p,openDrawer:U,closeDrawer:w,toggleDrawer:$,toggleAside:$},te=(A,L)=>{if(!(L==null||L===!1)){if(Array.isArray(L)){L.forEach(O=>te(A,O));return}if(L!=null&&L.nodeType){A.appendChild(L);return}A.appendChild(document.createTextNode(String(L)))}},E=(A,L,O=X=>X)=>{const X=JSswift.ui.getSlot(z,A);if(X!=null)return D(z,A,B,null);if(typeof L=="function"){const we=new Set(["eyebrow","title","subtitle"]),Be=_[we.has(A)?"span":"div"]({class:`jss-header-slot-${A}`});return JSswift.reactive.effect(()=>{const Ue=O(L(B)),H=Ln(JSswift.ui.slot(Ue));Be.replaceChildren(),Array.isArray(H)?H.forEach(W=>te(Be,W)):te(Be,H)},`UI.Header:${A}`),[Be]}return D(z,A,B,O(L))},ve=(A,L="icon",O=v.iconSize||v.size||"md")=>A==null||A===!1?null:typeof A=="string"?xe.Icon({name:A,size:O}):JSswift.ui.slot(A,{as:L}),le=A=>{var L,O;const X=A?(L=v.drawerOpenIcon)!=null?L:"\u2715":(O=v.drawerCloseIcon)!=null?O:"\u2630";return X==null||X===!1?null:typeof X=="string"?X:JSswift.ui.slot(X,{as:A?"drawerOpenIcon":"drawerCloseIcon"})},ie=_.span({class:"jss-header-toggle-icon"}),ge=A=>{const L=D(null,"default",B,le(A));ie.replaceChildren(...L.length?L:[""])};ge(p());const ue=xe.Btn({class:"jss-header-toggle",outline:!0,size:(l=(s=v.toggleSize)!=null?s:v.size)!=null?l:"sm",onClick:$,"aria-label":v.toggleLabel||"Toggle navigation"},ie);v.left==null&&v.left!==!1&&!JSswift.ui.getSlot(z,"left")&&Ql.add({update:ge});const fe=v.left===!1?null:v.left!=null?v.left:ue,M=k("title")?v.title:(n=v.label)!=null?n:"App",me=(c=(i=v.subtitle)!=null?i:v.description)!=null?c:"",be=k("right")?v.right:v.end,de=k("content")?v.content:k("body")?v.body:r!=null&&r.length?r:null,Z=[...E("left",fe),...E("start",null)],j=E("icon",v.icon,ve),I=E("eyebrow",(a=v.eyebrow)!=null?a:v.kicker),y=E("title",M),P=E("subtitle",me),Q=E("meta",v.meta),m=(()=>{const A=E("content",null);return A.length?A:E("default",de)})(),b=[...E("center",null),...E("body",null)],g=[...E("right",be),...E("end",null)],T=E("actions",v.actions),Y=_.div({class:re(["jss-header-body",v.bodyClass,v.centerClass])},_.div({class:"jss-header-heading"},j.length?_.div({class:"jss-header-icon"},...j):null,_.div({class:"jss-header-copy"},I.length?_.div({class:re(["jss-header-eyebrow",v.eyebrowClass])},...I):null,y.length?_.div({class:re(["jss-header-title",v.titleClass])},...y):null,P.length?_.div({class:re(["jss-header-subtitle",v.subtitleClass])},...P):null,m.length?_.div({class:re(["jss-header-content",v.contentClass])},...m):null),Q.length?_.div({class:re(["jss-header-meta",v.metaClass])},...Q):null)),K=[...g,...T.length?[_.div({class:re(["jss-header-actions",v.actionsClass])},...T)]:[]],_e=JSswift.omit(d,["actions","actionsClass","body","bodyClass","centerClass","content","contentClass","description","divider","drawerCloseIcon","drawerOpenIcon","drawerStateKey","elevated","end","eyebrow","eyebrowClass","icon","iconSize","kicker","label","left","meta","metaClass","right","slots","stack","sticky","subtitle","subtitleClass","title","titleClass","toggleLabel","toggleSize","gap","minHeight","startClass","endClass"]);_e.class=re(["jss-panel","jss-header","jss-singularity",pe(v.sticky!==!1,"sticky"),pe(v.stack,"stack"),pe(v.elevated,"elevated"),pe(v.divider!==!1,"divider"),d.class]),_e.style={...d.style||{}},v.gap!=null&&(_e.style["--jss-header-gap"]=vt(o(v.gap))),v.minHeight!=null&&(_e.style.minHeight=vt(o(v.minHeight)));const J=_.div(_e,...Z.length?[_.div({class:re(["jss-header-start",v.startClass])},...Z)]:[],_.div({class:"jss-header-main"},...b.length?[_.div({class:re(["jss-header-body",v.bodyClass,v.centerClass])},...b)]:[Y],...K.length?[_.div({class:re(["jss-header-end",v.endClass])},...K)]:[]));return Et(J,v),J},xe.Drawer=(...e)=>{var t,s,l,n,i,c,a,v,r,z;const{props:d,children:k}=JSswift.uiNormalizeArgs(e),N=d.slots||{},p={...d},U=h=>Object.prototype.hasOwnProperty.call(d,h),w=(t=d.stateKey)!=null?t:qn;w&&(qn=w,In=is(w));const $=()=>is(w),B=()=>Vn(!0,w),te=()=>Vn(!1,w),E=()=>Vn(!$(),w),ve={props:d,stateKey:w,isDrawerOpen:$,openDrawer:B,closeDrawer:te,toggleDrawer:E,toggleAside:E},le=JSswift==null?void 0:JSswift.store,ie=!!(le!=null&&le.get&&(le!=null&&le.set)),ge=`${w}:groups`,ue=`${w}:active`;let fe=ie?le.get(ge,{})||{}:{},M=ie&&(s=le.get(ue,null))!=null?s:null;const me=new Map,be=new Map,de=h=>{const x=o(h);return x==null||x===!1?[]:Array.isArray(x)?x.flat(1/0):[x]},Z=(h,x,ae=ve)=>{const Oe=Array.isArray(h)?h:[h];for(const De of Oe)if(JSswift.ui.getSlot(N,De)!=null)return D(N,De,ae,x);return x==null?[]:D(null,"default",ae,o(x))},j=h=>(Array.isArray(h)?h:[h]).some(ae=>JSswift.ui.getSlot(N,ae)!=null),I=h=>{if(typeof o(h.external)=="boolean")return!!o(h.external);const x=o(h.href||h.to||h.link||"");return/^(https?:)?\/\//.test(x)},y=(l=d.closeOnSelect)!=null?l:!0,P=h=>!!y&&o(h.keepOpen)!==!0,Q=(i=(n=d.itemIconSize)!=null?n:d.size)!=null?i:"md",m=(c=d.groupOpenIcon)!=null?c:"arrow_drop_up",b=(a=d.groupCloseIcon)!=null?a:"arrow_drop_down",g=h=>!!h&&M===h,T=h=>!!h&&!!M&&(M===h||M.startsWith(`${h}::`)),Y=()=>{me.forEach(({el:h,baseActive:x},ae)=>{const Oe=!!x||g(ae);h.classList.toggle("active",Oe),Oe?h.setAttribute("aria-current","page"):h.removeAttribute("aria-current")}),be.forEach(({wrap:h,toggle:x,baseActive:ae},Oe)=>{const De=!!ae||T(Oe);h.classList.toggle("active",De),x.classList.toggle("active",De)})},K=h=>{M=h||null,ie&&le.set(ue,M),Y()},_e=(h,x)=>{if(o(h.active)!=null)return!!o(h.active);if(o(h.current)!=null)return!!o(h.current);if(!x||I(h))return!1;try{if(x.startsWith("#"))return window.location.hash===x;const ae=`${window.location.pathname}${window.location.search}${window.location.hash}`;return x===ae||x===window.location.pathname}catch(ae){return!1}},J=(h,x,ae)=>_e(h,x)||g(ae),A=(h=[],x=0,ae=[])=>de(h).some((Oe,De)=>{var Ge,Ke,We,et,tt;const dt=o(Oe);if(!dt||typeof dt!="object"||dt.nodeType)return!1;const gt=o(dt.href||dt.to||dt.link||""),At=(tt=o((et=(We=(Ke=(Ge=dt.label)!=null?Ge:dt.title)!=null?Ke:dt.text)!=null?We:gt)!=null?et:null))!=null?tt:`item-${x}-${De}`,It=we(dt,At,x,De),$t=ae.concat(It).join("::");if(J(dt,gt,$t))return!0;const zt=dt.items||dt.children||dt.sub;return A(zt,x+1,ae.concat(It))}),L=(h,x={})=>{var ae;const Oe=o(h);if(Oe==null||Oe===!1)return[];const De=typeof Oe=="string"?xe.Icon({name:Oe,size:(ae=x.iconSize)!=null?ae:Q}):JSswift.ui.slot(Oe,{...x,as:"icon"});return D(null,"default",x,De)},O=(h,x,ae={})=>{const Oe=L(h,ae);return Oe.length?[_.span({class:re(["jss-drawer-item-icon",x])},...Oe)]:[]},X=h=>{const x=o(h.iconPosition)||"left",ae=Object.prototype.hasOwnProperty.call(h,"iconLeft")?h.iconLeft:x!=="right"?h.icon:null,Oe=Object.prototype.hasOwnProperty.call(h,"iconRight")?h.iconRight:x==="right"?h.icon:null;return{left:ae,right:Oe}},we=(h,x,ae,Oe)=>o(h.key||h.id||h.to||h.href||x||`item-${ae}-${Oe}`),Be=(h,x)=>ie&&Object.prototype.hasOwnProperty.call(fe,h)?!!fe[h]:x,Ue=(h,x)=>{ie&&(fe={...fe,[h]:!!x},le.set(ge,fe))},H=()=>{const h={...ve,area:"header"},x=Z(["headerIcon","icon"],d.icon,h),ae=Z(["eyebrow"],d.eyebrow,h),Oe=Z(["title"],d.title,h),De=Z(["subtitle"],d.subtitle,h),Ge=Z(["meta"],d.meta,h),Ke=Z(["content"],d.content,h),We=Z(["actions"],d.actions,h),et=U("header")?D(null,"default",h,o(d.header)):[],tt=x.length||ae.length||Oe.length||De.length||Ge.length||Ke.length||We.length;return!tt&&!et.length?[]:tt?[_.div({class:re(["jss-drawer-header",d.headerClass])},...x.length?[_.div({class:"jss-drawer-header-icon"},...x)]:[],_.div({class:"jss-drawer-header-body"},...ae.length?[_.div({class:"jss-drawer-header-eyebrow"},...ae)]:[],...Oe.length?[_.div({class:"jss-drawer-header-title"},...Oe)]:[],...De.length?[_.div({class:"jss-drawer-header-subtitle"},...De)]:[],...Ge.length?[_.div({class:"jss-drawer-header-meta"},...Ge)]:[],...Ke.length?[_.div({class:"jss-drawer-header-content"},...Ke)]:[],...et.length?[_.div({class:"jss-drawer-header-extra"},...et)]:[]),...We.length?[_.div({class:"jss-drawer-header-actions"},...We)]:[])]:et},W=(h,x,ae)=>{var Oe,De;return!(((Oe=h.onClick)==null?void 0:Oe.call(h,ae,x))===!1||ae!=null&&ae.defaultPrevented||((De=d.onSelect)==null?void 0:De.call(d,h,x,ae))===!1||ae!=null&&ae.defaultPrevented)},ee=(h,x,ae={})=>{const Oe=x.hasChildren?"group":"item",De=D(N,`${Oe}Label`,x,x.label),Ge=D(N,`${Oe}Note`,x,x.note),Ke=D(N,`${Oe}Badge`,x,x.badge),We=D(N,`${Oe}Aside`,x,x.aside),et=D(N,`${Oe}Content`,x,x.content),tt=[];return(De.length||Ge.length||Ke.length||We.length)&&tt.push(_.div({class:"jss-drawer-item-top"},_.div({class:"jss-drawer-item-copy"},...De.length?[_.div({class:"jss-drawer-item-label"},...De)]:[],...Ge.length?[_.div({class:"jss-drawer-item-note"},...Ge)]:[]),...Ke.length||We.length?[_.div({class:"jss-drawer-item-meta"},...Ke.length?[_.div({class:"jss-drawer-item-badge"},...Ke)]:[],...We.length?[_.div({class:"jss-drawer-item-aside"},...We)]:[])]:[])),et.length&&tt.push(_.div({class:"jss-drawer-item-content"},...et)),[...ae.start||[],...O(x.iconLeft,"left",x),...tt.length?[_.div({class:"jss-drawer-item-main"},...tt)]:[],...O(x.iconRight,"right",x),...ae.end||[]]},Ne=(h=[],x=0,ae=[])=>de(h).map((Oe,De)=>{var Ge,Ke,We,et,tt,dt,gt,At,It,$t,zt;const Xe=o(Oe);if(Xe==null||Xe===!1)return null;if(Xe.nodeType||typeof Xe!="object"||Array.isArray(Xe))return _.div({class:"jss-drawer-custom","data-level":String(x)},...D(null,"default",{...ve,item:Xe,level:x,index:De,path:ae},Xe));if(o(Xe.hidden)===!0||o(Xe.visible)===!1)return null;const mt=de(Xe.items||Xe.children||Xe.sub),Nt=o(Xe.href||Xe.to||Xe.link||null),Zt=o((et=(We=(Ke=(Ge=Xe.label)!=null?Ge:Xe.title)!=null?Ke:Xe.text)!=null?We:Nt)!=null?et:null),rn=Zt!=null?Zt:`item-${x}-${De}`,qt=o((gt=(dt=(tt=Xe.note)!=null?tt:Xe.subtitle)!=null?dt:Xe.description)!=null?gt:null),Yt=o((At=Xe.badge)!=null?At:null),cn=o(($t=(It=Xe.aside)!=null?It:Xe.meta)!=null?$t:null),Xt=o((zt=Xe.content)!=null?zt:null),Ut=we(Xe,rn,x,De),tn=ae.concat(Ut).join("::"),{left:ln,right:Xn}=X(Xe),bn=sn(o(Xe.state)||o(Xe.color)||""),gn=_e(Xe,Nt),hs=gn||g(tn),mn=!!o(Xe.disabled),wn={...ve,item:Xe,index:De,level:x,path:ae,label:rn,note:qt,badge:Yt,aside:cn,content:Xt,itemStateKey:tn,iconLeft:ln,iconRight:Xn,iconSize:o(Xe.iconSize)||Q,active:hs,disabled:mn,hasChildren:!1},Qn=o(Xe.divider)===!0||Xe.type==="divider"||Xe.type==="separator",rs=o(Xe.section)===!0||Xe.type==="section"||Xe.type==="heading"||Xe.type==="label",Ls=Xe.type==="content"||Xe.type==="custom"||!Nt&&!mt.length&&!o(Xe.button)&&Xe.type!=="button"&&Zt==null&&Xt!=null;if(Qn)return _.div({class:re(["jss-drawer-separator",Xe.class]),"data-level":String(x)});if(rs){const Je=D(N,"sectionLabel",wn,rn||Xt);return _.div({class:re(["jss-drawer-section-label",Xe.class]),"data-level":String(x)},...Je)}if(Ls){const Je=D(N,"item",wn,Xt!=null?Xt:rn);return _.div({class:re(["jss-drawer-custom",bn?`jss-drawer-tone-${bn}`:"",Xe.class]),style:Xe.style,"data-level":String(x)},...Je)}if(mt.length){const Je=gn||A(mt,x+1,ae.concat(Ut)),ft=Je||T(tn);let pt=Be(tn,!!o(Xe.expanded)||!!o(Xe.open)||ft);const ot=_.span({class:"jss-drawer-group-icon"}),_t={...wn,active:ft,hasChildren:!0,isOpen:()=>pt,setOpen:dn=>_n(dn),toggle:()=>_n(!pt)},Mt=()=>{var dn,Cn;const Zn=pt?(dn=Xe.openIcon)!=null?dn:m:(Cn=Xe.closeIcon)!=null?Cn:b,es=o(pt?Xe.iconSidePosition||Xe.openIconSide||Xe.openIconPosition||"right":Xe.iconSidePosition||Xe.closeIconSide||Xe.closeIconPosition||"right")==="left"?"left":"right";ot.innerHTML="",ot.className=`jss-drawer-group-icon ${es}`,L(Zn,{..._t,as:"toggleIcon"}).forEach(gs=>ot.appendChild(gs))},Gt=_.button({type:"button",class:re(["jss-drawer-group-toggle","jss-drawer-entry",pt?"open":"",ft?"active":"",mn?"is-disabled":"",bn?`jss-drawer-tone-${bn}`:"",Xe.class]),style:Xe.style,"data-level":String(x),"aria-expanded":String(pt),"aria-disabled":mn?"true":null,onClick:dn=>{if(mn){dn.preventDefault();return}K(tn),_n(!pt)}},...ee(Xe,_t,{start:o(Xe.iconSidePosition||Xe.openIconSide||Xe.closeIconSide||Xe.openIconPosition||Xe.closeIconPosition||"right")==="left"?[ot]:[],end:o(Xe.iconSidePosition||Xe.openIconSide||Xe.closeIconSide||Xe.openIconPosition||Xe.closeIconPosition||"right")==="right"?[ot]:[]})),un=D(N,"group",_t,null),an=_.div({class:"jss-drawer-group-items"},...Ne(mt,x+1,ae.concat(Ut))),jn=_.div({class:re(["jss-drawer-group",pt?"open":"",ft?"active":"",bn?`jss-drawer-tone-${bn}`:""]),"data-level":String(x)},...un.length?un:[Gt],an),_n=dn=>{pt=!!dn,jn.classList.toggle("open",pt),Gt.classList.toggle("open",pt),Gt.setAttribute("aria-expanded",String(pt)),Mt(),Ue(tn,pt)};return be.set(tn,{wrap:jn,toggle:Gt,baseActive:Je}),Mt(),jn}const Ze=D(N,"item",wn,null),bt=o(Xe.button)===!0||Xe.type==="button"||!Nt&&typeof Xe.onClick=="function",Ft={class:re(["jss-drawer-entry",bt?"jss-drawer-btn":"jss-drawer-link",hs?"active":"",mn?"is-disabled":"",bn?`jss-drawer-tone-${bn}`:"",Xe.class]),style:Xe.style,"data-level":String(x),"aria-current":hs?"page":null,"aria-disabled":mn?"true":null},Dt=Ze.length?Ze:ee(Xe,wn);if(bt){const Je=_.button({...Ft,type:Xe.buttonType||"button",disabled:mn,onClick:ft=>{if(mn){ft.preventDefault();return}W(Xe,wn,ft)&&(K(tn),P(Xe)&&te())}},...Dt);return me.set(tn,{el:Je,baseActive:gn}),Je}const nn=I(Xe),Qt=nn?o(Xe.target)||"_blank":o(Xe.target),S=nn?o(Xe.rel)||"noopener noreferrer":o(Xe.rel),he=_.a({...Ft,href:Nt||"#",target:Qt||null,rel:S||null,tabIndex:mn?-1:null,onClick:Je=>{var ft;if(mn){Je.preventDefault();return}W(Xe,wn,Je)&&(!nn&&Xe.to&&((ft=wt.router)!=null&&ft.navigate)&&(Je.preventDefault(),wt.router.navigate(Xe.to)),P(Xe)&&te())}},...Dt);return me.set(tn,{el:he,baseActive:gn}),he}).filter(Boolean),Te=Z(["before","beforeItems"],(v=d.before)!=null?v:d.beforeItems),oe=j(["body"])?Z(["body"],null):[],Pe=Ne(d.items||[]),Ie=Z(["default"],k),Le=Z(["after","afterItems"],(r=d.after)!=null?r:d.afterItems),Ye=oe.length?oe:[...Te,...Pe,...Ie,...Le],ct=U("empty")||U("emptyText")?(z=d.empty)!=null?z:_.div({class:re(["jss-drawer-empty",d.emptyClass])},d.emptyText||"Nessun contenuto"):_.div({class:re(["jss-drawer-empty",d.emptyClass])},"Nessun contenuto"),Re=Z(["header"],H()),C=Z(["footer"],d.footer),Se=Ye.length?Ye:Z(["empty"],ct),Fe=JSswift.omit(p,["items","header","footer","before","beforeItems","after","afterItems","title","subtitle","eyebrow","icon","content","meta","actions","empty","emptyText","closeOnSelect","groupOpenIcon","groupCloseIcon","stateKey","sticky","slots","headerClass","bodyClass","footerClass","emptyClass","itemIconSize","gap","indent","padding","minHeight","maxHeight","width","onSelect"]);Fe.class=re(["jss-panel","jss-drawer",In?"open":"",pe(d.sticky,"sticky"),p.class]),Fe.style={...p.style||{}},d.gap!=null&&(Fe.style["--jss-drawer-gap"]=vt(o(d.gap))),d.indent!=null&&(Fe.style["--jss-drawer-indent"]=vt(o(d.indent))),d.padding!=null&&(Fe.style["--jss-drawer-padding"]=vt(o(d.padding))),d.width!=null&&(Fe.style.width=vt(o(d.width))),d.minHeight!=null&&(Fe.style.minHeight=vt(o(d.minHeight))),d.maxHeight!=null&&(Fe.style.maxHeight=vt(o(d.maxHeight)));const F=_.div(Fe,...Re.length?Re:[],_.div({class:re(["jss-drawer-body",d.bodyClass])},...Se),...C.length?[_.div({class:re(["jss-drawer-footer",d.footerClass])},...C)]:[]),f=Pl.get(w)||new Set;return f.add(F),Pl.set(w,f),Vn(In,w),F.isDrawerOpen=$,F.openDrawer=B,F.closeDrawer=te,F.toggleDrawer=E,F.setActiveItem=K,Et(F,d),Y(),F},xe.Page=(...e)=>{var t,s,l,n;const{props:i,children:c}=JSswift.uiNormalizeArgs(e),a=i.slots||{},v={...i},r=(b,g)=>{var T;return!!(b&&b.nodeType===1&&((T=b.classList)!=null&&T.contains(`jss-page-${g}`)))},z=b=>b==null?null:typeof b=="string"?xe.Icon({name:b,size:i.iconSize||i.size||"xl"}):JSswift.ui.slot(b,{as:"icon"}),d={dense:!!o(i.dense),flat:!!o(i.flat),centered:!!o(i.centered),narrow:!!o(i.narrow)},k=(b,g)=>{if(!(g==null||g===!1)){if(Array.isArray(g)){g.forEach(T=>k(b,T));return}if(g!=null&&g.nodeType){b.appendChild(g);return}b.appendChild(document.createTextNode(String(g)))}},N=(b,g,T=Y=>Y)=>{const Y=JSswift.ui.getSlot(a,b);if(Y!=null)return D(a,b,d,null);if(typeof g=="function"){const K=new Set(["eyebrow","title","subtitle"]),_e=_[K.has(b)?"span":"div"]({class:`jss-page-slot-${b}`});return JSswift.reactive.effect(()=>{const J=T(g(d)),A=Ln(JSswift.ui.slot(J));_e.replaceChildren(),Array.isArray(A)?A.forEach(L=>k(_e,L)):k(_e,A)},`UI.Page:${b}`),[_e]}return D(a,b,d,T(g))},p=D(a,"default",d,c!=null&&c.length?c:[]),U={hero:[],header:[],body:[],footer:[],actions:[]},w=[];p.forEach(b=>{r(b,"hero")?U.hero.push(b):r(b,"header")?U.header.push(b):r(b,"body")?U.body.push(b):r(b,"footer")?U.footer.push(b):r(b,"actions")?U.actions.push(b):w.push(b)});const $=N("icon",i.icon,z),B=N("hero",(t=i.hero)!=null?t:i.banner),te=N("eyebrow",(s=i.eyebrow)!=null?s:i.kicker),E=N("title",i.title),ve=N("subtitle",(l=i.subtitle)!=null?l:i.description),le=N("header",i.header),ie=N("aside",i.aside),ge=N("body",(n=i.body)!=null?n:i.content),ue=N("footer",i.footer),fe=N("actions",i.actions),M=B.length?_.div({class:re(["jss-page-hero",i.heroClass])},...B):null,me=$.length||te.length||E.length||ve.length||le.length||ie.length,be=me?_.div({class:re(["jss-page-header",i.headerClass])},_.div({class:"jss-page-head"},$.length?_.div({class:re(["jss-page-icon",i.iconClass])},...$):null,_.div({class:"jss-page-head-main"},te.length?_.div({class:re(["jss-page-eyebrow",i.eyebrowClass])},...te):null,E.length?_.div({class:re(["jss-page-title",i.titleClass])},...E):null,ve.length?_.div({class:re(["jss-page-subtitle",i.subtitleClass])},...ve):null,le.length?_.div({class:re(["jss-page-header-content",i.headerContentClass])},...le):null),ie.length?_.div({class:re(["jss-page-aside",i.asideClass])},...ie):null)):null,de=[...ge,...w],Z=de.length?_.div({class:re(["jss-page-body",i.bodyClass])},...de):null,j=[...fe,...U.actions],I=ue.length||j.length?_.div({class:re(["jss-page-footer",i.footerClass])},...ue,j.length?_.div({class:"jss-page-actions"},...j):null):null,y=!!(B.length||U.hero.length),P=!!(me||U.header.length),Q=JSswift.omit(v,["actions","aside","asideClass","banner","body","bodyClass","centered","content","dense","description","eyebrow","eyebrowClass","flat","footer","footerClass","gap","header","headerClass","headerContentClass","headerGap","hero","heroClass","heroPadding","icon","iconClass","iconSize","kicker","maxWidth","minHeight","narrow","padding","size","slots","subtitle","subtitleClass","title","titleClass"]);Q.class=re(["jss-panel","jss-page",pe(i.dense,"dense"),pe(i.flat,"jss-page-flat"),pe(i.centered,"jss-page-centered"),pe(i.narrow,"jss-page-narrow"),pe(y,"jss-page-has-hero"),pe(P,"jss-page-has-header"),v.class]),Q.style={...v.style||{}},(i.gap!=null||ht(i.gap))&&(Q.style["--jss-page-gap"]=qe(i.gap,vt)),(i.padding!=null||ht(i.padding))&&(Q.style["--jss-page-padding"]=qe(i.padding,vt)),(i.maxWidth!=null||ht(i.maxWidth))&&(Q.style["--jss-page-max-width"]=qe(i.maxWidth,vt)),(i.minHeight!=null||ht(i.minHeight))&&(Q.style["--jss-page-min-height"]=qe(i.minHeight,vt)),(i.headerGap!=null||ht(i.headerGap))&&(Q.style["--jss-page-header-gap"]=qe(i.headerGap,vt)),(i.heroPadding!=null||ht(i.heroPadding))&&(Q.style["--jss-page-hero-padding"]=qe(i.heroPadding,vt));const m=_.div(Q,M,...U.hero,be,...U.header,Z,...U.body,I,...U.footer);return Et(m,i),m},xe.AppShell=(...e)=>{var t,s;const{props:l,children:n}=JSswift.uiNormalizeArgs(e),i=l.slots||{},c=(T,Y)=>!!T&&Object.prototype.hasOwnProperty.call(T,Y),a=o(l.noDrawer)===!0||l.drawer===!1,v=o(l.reverse)===!0,r=o(l.stack)===!0,z=(s=(t=l.drawerStateKey)!=null?t:l.stateKey)!=null?s:qn;z&&(qn=z,In=is(z));const d={props:l,noDrawer:a,stateKey:z,isDrawerOpen:()=>is(z),openDrawer:()=>Vn(!0,z),closeDrawer:()=>Vn(!1,z),toggleDrawer:()=>Vn(!is(z),z)},k=l.headerProps&&typeof l.headerProps=="object"?{...l.headerProps}:{};let N=l.header;!c(l,"header")&&(Object.keys(k).length||c(l,"title")||c(l,"subtitle")||c(l,"left")||c(l,"right"))&&(!c(k,"title")&&c(l,"title")&&(k.title=l.title),!c(k,"subtitle")&&c(l,"subtitle")&&(k.subtitle=l.subtitle),!c(k,"left")&&c(l,"left")&&(k.left=l.left),!c(k,"right")&&c(l,"right")&&(k.right=l.right),c(k,"drawerStateKey")||(k.drawerStateKey=z),a&&!c(k,"left")&&(k.left=!1),N=xe.Header(k));const p=l.drawerProps&&typeof l.drawerProps=="object"?{...l.drawerProps}:{},U=c(l,"drawerItems")?l.drawerItems:l.items,w=c(l,"drawerHeader")?l.drawerHeader:void 0;let $=l.drawer;!c(l,"drawer")&&!a&&(Object.keys(p).length||U!=null||w!=null)&&(!c(p,"items")&&U!=null&&(p.items=U),!c(p,"header")&&w!=null&&(p.header=w),c(p,"stateKey")||(p.stateKey=z),$=xe.Drawer(p));const B=l.pageProps&&typeof l.pageProps=="object"?{...l.pageProps}:{},te=c(l,"content")?l.content:n,E=D(i,"default",d,te);let ve=l.page;!c(l,"page")&&(Object.keys(B).length||E.length)&&(ve=xe.Page(B,...E));const le=l.footerProps&&typeof l.footerProps=="object"?{...l.footerProps}:{},ie=c(l,"footerContent")?l.footerContent:void 0;let ge=l.footer;!c(l,"footer")&&(Object.keys(le).length||ie!=null)&&(ge=xe.Footer(le,...D(null,"default",d,ie)));const ue=D(i,"header",d,N),fe=a?[]:D(i,"drawer",d,$),M=D(i,"page",d,ve),me=D(i,"footer",d,ge),be=re(["jss-app","jss-app-shell",pe(a,"no-drawer"),pe(v,"is-reverse"),pe(r,"is-stack"),pe(l.flush,"is-flush"),pe(l.divider,"is-divider"),l.class]),de=JSswift.omit(l,["header","drawer","page","footer","content","title","subtitle","left","right","items","drawerItems","drawerHeader","headerProps","drawerProps","pageProps","footerProps","footerContent","noDrawer","reverse","stack","flush","divider","drawerStateKey","stateKey","drawerWidth","gap","padding","slots"]);de.class=be,de.style={...l.style||{}};const Z=qe(l.drawerWidth,vt);Z!=null&&(de.style["--jss-app-shell-drawer-width"]=Z);const j=qe(l.gap,vt);j!=null&&(de.style["--jss-app-shell-gap"]=j);const I=qe(l.padding,vt);I!=null&&(de.style["--jss-app-shell-padding"]=I);const y=ue.length?_.div({class:"jss-app-shell-header-slot"},...ue):null,P=fe.length?_.div({class:"jss-app-shell-drawer-slot"},...fe):null,Q=M.length?_.div({class:"jss-app-shell-page-slot"},...M):null,m=me.length?_.div({class:"jss-app-shell-footer-slot"},...me):null,b=v?[Q,P]:[P,Q],g=_.div(de,...y?[y]:[],_.div({class:"jss-app-shell-body"},...b.filter(Boolean)),...m?[m]:[]);return g.openDrawer=d.openDrawer,g.closeDrawer=d.closeDrawer,g.toggleDrawer=d.toggleDrawer,g.isDrawerOpen=d.isDrawerOpen,g.header=y,g.drawer=P,g.page=Q,g.footer=m,Et(g,l),g},xe.Parallax=function(...t){var s,l;const{props:n,children:i}=JSswift.uiNormalizeArgs(t),c=n.slots||{},a={...n};a.color!=null&&a.textColor==null&&(a.textColor=a.color),delete a.color,pn(a);const v=xt(n.state,()=>{const K=sn(o(n.state));return K?`jss-state-${K}`:""}),r=K=>{if(K==null||K===!1||K==="")return"";const _e=String(K);return Fn(_e)?`var(--jss-${_e})`:_e},z=()=>{const K=o(n.background);if(K)return String(K);const _e=o(n.image)||o(n.src)||"";if(!_e)return"linear-gradient(120deg, #1b2c5a, #2f6d8f, #2a8f5c)";const J=String(_e);return/^url\(/i.test(J)||/gradient\(/i.test(J)||/^var\(/i.test(J)?J:`url(${J})`},d=(K,_e)=>{const J=Number(o(K));return Number.isFinite(J)?J:_e},k={speed:()=>{var K;return(K=o(n.speed))!=null?K:.18},state:()=>o(n.state)||"",disabled:()=>!!o(n.disabled)},N=D(c,"badge",k,n.badge),p=D(c,"background",k,n.backgroundContent),U=D(c,"eyebrow",k,(s=n.eyebrow)!=null?s:n.kicker),w=D(c,"title",k,n.title),$=D(c,"subtitle",k,n.subtitle),B=D(c,"header",k,n.header),te=D(c,"aside",k,n.aside),E=D(c,"media",k,n.media),ve=D(c,"content",k,(l=n.content)!=null?l:n.body),le=D(c,"default",k,i!=null&&i.length?i:[]),ie=D(c,"footer",k,n.footer),ge=D(c,"actions",k,n.actions),ue=[...ve,...le],fe=N.length?_.div({class:re(["jss-parallax-badge",n.badgeClass])},...N):null,M=U.length||w.length||$.length||B.length||te.length,me=M?_.div({class:re(["jss-parallax-header",n.headerClass])},_.div({class:"jss-parallax-head"},_.div({class:"jss-parallax-head-main"},U.length?_.div({class:re(["jss-parallax-eyebrow",n.eyebrowClass])},...U):null,w.length?_.div({class:re(["jss-parallax-title",n.titleClass])},...w):null,$.length?_.div({class:re(["jss-parallax-subtitle",n.subtitleClass])},...$):null,B.length?_.div({class:re(["jss-parallax-header-content",n.headerContentClass])},...B):null),te.length?_.div({class:re(["jss-parallax-aside",n.asideClass])},...te):null)):null,be=E.length?_.div({class:re(["jss-parallax-media",n.mediaClass])},...E):null,de=ue.length?_.div({class:re(["jss-parallax-body",n.bodyClass])},...ue):null,Z=ie.length||ge.length?_.div({class:re(["jss-parallax-footer",n.footerClass])},ie.length?_.div({class:"jss-parallax-footer-content"},...ie):null,ge.length?_.div({class:"jss-parallax-actions"},...ge):null):null,j=JSswift.omit(a,["actions","align","aside","asideClass","background","backgroundContent","backgroundContentClass","badge","badgeClass","bgClass","bgPosition","bgRepeat","bgSize","body","bodyClass","color","content","contentClass","contentMaxWidth","disabled","eyebrow","eyebrowClass","footer","footerClass","gap","header","headerClass","headerContentClass","height","image","imageAlt","imageClass","innerClass","justify","kicker","maxOffset","media","mediaClass","minHeight","overlay","padding","slots","speed","src","startTop","state","subtitle","subtitleClass","textColor","title","titleClass"]);j.class=re(["jss-parallax","jss-singularity",v,pe(n.disabled,"jss-parallax-static"),pe(fe,"jss-parallax-has-badge"),pe(M,"jss-parallax-has-header"),a.class]),j.style={...a.style||{}},n.height!=null&&(j.style["--jss-parallax-height"]=qe(n.height,vt)),n.minHeight!=null&&(j.style["--jss-parallax-min-height"]=qe(n.minHeight,vt)),n.padding!=null&&(j.style["--jss-parallax-padding"]=qe(n.padding,vt)),n.gap!=null&&(j.style["--jss-parallax-gap"]=qe(n.gap,vt)),n.contentMaxWidth!=null&&(j.style["--jss-parallax-content-max-width"]=qe(n.contentMaxWidth,vt)),n.justify!=null&&(j.style["--jss-parallax-justify"]=qe(n.justify)),n.align!=null&&(j.style["--jss-parallax-align"]=qe(n.align)),n.color!=null&&(j.style["--jss-parallax-color"]=qe(n.color,r)),n.overlay!=null&&(j.style["--jss-parallax-overlay"]=qe(n.overlay)),n.bgPosition!=null&&(j.style["--jss-parallax-position"]=qe(n.bgPosition)),n.bgSize!=null&&(j.style["--jss-parallax-size"]=qe(n.bgSize)),n.bgRepeat!=null&&(j.style["--jss-parallax-repeat"]=qe(n.bgRepeat)),j.style["--jss-parallax-image"]=ht(n.background)||ht(n.image)||ht(n.src)?()=>z():z();const I=_.div({class:re(["jss-parallax-bg",n.bgClass])},p.length?_.div({class:re(["jss-parallax-bg-content",n.backgroundContentClass])},...p):null),y=_.div({class:re(["jss-parallax-content",n.contentClass,n.innerClass])},fe,me,be,de,Z),P=_.div(j,I,y);let Q=!1,m=!1,b=null;const g=()=>{var K;Q||(Q=!0,typeof window!="undefined"&&(window.removeEventListener("scroll",Y),window.removeEventListener("resize",Y)),(K=b==null?void 0:b.disconnect)==null||K.call(b),b=null)},T=()=>{if(Q)return;if(!P.isConnected){g();return}if(o(n.disabled)){I.style.transform="translate3d(0, 0, 0)",P.style.setProperty("--jss-parallax-offset","0px");return}const K=P.getBoundingClientRect(),_e=d(n.speed,.18),J=Math.abs(d(n.maxOffset,96)),A=o(n.startTop),L=A!=null&&A!==""?(K.top-d(n.startTop,0))*_e:((typeof window!="undefined"&&(window.innerHeight||document.documentElement.clientHeight)||0)/2-(K.top+K.height/2))*_e,X=`${(J>0?Math.max(-J,Math.min(J,L)):L).toFixed(2)}px`;I.style.transform=`translate3d(0, ${X}, 0)`,P.style.setProperty("--jss-parallax-offset",X)};function Y(){Q||m||(m=!0,requestAnimationFrame(()=>{m=!1,T()}))}return typeof window!="undefined"&&(window.addEventListener("scroll",Y,{passive:!0}),window.addEventListener("resize",Y),typeof ResizeObserver!="undefined"&&(b=new ResizeObserver(()=>{Y()}),b.observe(P)),requestAnimationFrame(()=>{Y()}),setTimeout(()=>{Y()},90)),P.refresh=()=>(Y(),P),P.update=P.refresh,P.destroy=()=>(g(),P.remove(),null),P._dispose=g,Et(P,n),P};const[hl,gl]=wt.reactive.signal([]),ml=new Map;function Jl(e){const t=ml.get(e);t&&(clearTimeout(t),ml.delete(e))}function Ml(e){return e?(Jl(e),gl(hl().filter(t=>t.id!==e)),e):null}function Do(){for(const e of ml.keys())Jl(e);gl([])}function io(e){e!=null&&e.id&&(Jl(e.id),e.timeout>0&&ml.set(e.id,setTimeout(()=>{Ml(e.id)},e.timeout)))}function ro(e,t={}){if(!e)return null;let s=null;return gl(hl().map(l=>l.id!==e?l:(s=Hn({...l,...t,id:l.id},t.type||t.state||t.color||l.type),s))),s&&io(s),(s==null?void 0:s.id)||null}function $o(e){const t=()=>Ml(e.id),s=(w={})=>ro(e.id,w),l={toast:e,id:e.id,close:t,update:s},n=w=>typeof w=="function"?w(l):w,i=(()=>{if(e.icon===!1||e.icon===null)return null;if(e.icon!=null){const $=n(e.icon);return typeof $=="string"?xe.Icon({name:$,size:"sm"}):JSswift.ui.slot($,{as:"icon"})}const w=Mo[e.type];return w?xe.Icon({name:w,size:"sm"}):null})(),c=D(e.slots,"icon",l,i),a=D(e.slots,"title",l,n(e.title)),v=D(e.slots,"message",l,n(e.message)),r=D(e.slots,"description",l,n(e.description)),z=D(e.slots,"meta",l,n(e.meta)),d=D(e.slots,"actions",l,n(e.actions)),k=D(e.slots,"default",l,n(e.body)),N=D(e.slots,"dismiss",l,n(e.dismiss)),p=N.length?N:e.closable?[xe.Btn({class:"jss-toast-close",outline:!0,size:"xs","aria-label":e.dismissLabel,onClick:t},xe.Icon({name:"close",size:"xs"}))]:[],U=_.div({class:re(["jss-toast",`jss-toast-${e.type}`,`jss-toast-${e.variant}`,pe(e.closable,"is-closable"),e.class]),style:e.style||{},role:e.role},c.length?_.div({class:"jss-toast-icon"},...c):null,_.div({class:"jss-toast-main"},_.div({class:"jss-toast-copy"},a.length?_.div({class:"jss-toast-title"},...a):null,v.length?_.div({class:"jss-toast-message"},...v):null,r.length?_.div({class:"jss-toast-description"},...r):null,k.length?_.div({class:"jss-toast-body"},...k):null,z.length?_.div({class:"jss-toast-meta"},...z):null),d.length?_.div({class:"jss-toast-actions"},...d):null),p.length?_.div({class:"jss-toast-dismiss"},...p):null);return Et(U,e),U}function Vo(){let e=document.querySelector(".jss-toast-layer");return e||(e=document.createElement("div"),e.className="jss-toast-layer",document.body.appendChild(e),wt.reactive.effect(()=>{const t=hl();e.innerHTML="";const s=new Map;for(const l of t){const n=lo(l.position);s.has(n)||s.set(n,[]),s.get(n).push(l)}for(const l of so){const n=s.get(l);if(!(n!=null&&n.length))continue;const i=_.div({class:re(["jss-toast-wrap",`is-${l}`])},...n.map(c=>$o(c)));e.appendChild(i)}},"JSswiftUI:toasts"),e)}function Bo(e={}){Vo();const t=Hn(e);return t.id=t.id||Math.random().toString(36).slice(2),gl([...hl().filter(s=>s.id!==t.id),t]),io(t),t.id}wt.services.notify.show=Bo,wt.services.notify.success=Pn("success","Success"),wt.services.notify.error=Pn("danger","Error"),wt.services.notify.warning=Pn("warning","Warning"),wt.services.notify.info=Pn("info","Info"),wt.services.notify.primary=Pn("primary","Notice"),wt.services.notify.secondary=Pn("secondary","Notice"),wt.services.notify.update=ro,wt.services.notify.remove=Ml,wt.services.notify.clear=Do,wt.services.notify.promise=xe.Notify.promise,wt.notify=wt.services.notify,JSswift.form=JSswift.form||{},JSswift.form._isPromise=e=>e&&typeof e.then=="function",JSswift.form._normalizeRules=e=>{const t={};for(const s in e||{}){const l=e[s];t[s]=Array.isArray(l)?l:[l]}return t},JSswift.form._runRule=async(e,t,s)=>{let l=e,n=null;e&&typeof e=="object"&&typeof e.rule=="function"&&(l=e.rule,n=e.message||null);const i=l?l(t,s):!0,c=JSswift.form._isPromise(i)?await i:i;return c===!0?null:typeof c=="string"?c:c===!1?n||"Valore non valido":c?null:n||"Valore non valido"},JSswift.useForm=(e={})=>{const t=e.model||{},s=JSswift.form._normalizeRules(e.rules||{}),l=e.validateOn||"submit",n=e.initial||null,i=_.rod({}),c=_.rod({}),a=_.rod(!1),v=_.rod(null),r=()=>t&&typeof t=="object"&&"value"in t?t.value||{}:t,z=ie=>{if(t&&typeof t=="object"&&"value"in t)t.value=ie;else{const ge=t||{};for(const ue in ge)delete ge[ue];Object.assign(ge,ie)}},d=ie=>{const ge=r();return ge?ge[ie]:void 0},k=(ie,ge)=>{const ue={...r()||{}};ue[ie]=ge,z(ue)},N=(ie,ge)=>{const ue={...i.value||{}};ge?ue[ie]=ge:delete ue[ie],i.value=ue},p=ie=>(i.value||{})[ie]||null,U=ie=>{c.value={...c.value||{},[ie]:!0}},w=ie=>!!(c.value||{})[ie],$=async ie=>{const ge=s[ie]||[];if(!ge.length)return N(ie,null),!0;const ue=d(ie),fe={name:ie,value:ue,model:r(),form:le};for(const M of ge){if(!M)continue;const me=await JSswift.form._runRule(M,ue,fe);if(me)return N(ie,me),!1}return N(ie,null),!0},B=async()=>{v.value=null;const ie=Object.keys(s);let ge=!0;for(const ue of ie)await $(ue)||(ge=!1);return ge},le={model:t,errors:i,touched:c,submitting:a,submitError:v,getValue:d,setValue:k,getError:p,setError:N,touch:U,isTouched:w,field:(ie,ge={})=>{var ue;const fe=_.rod("");(ue=fe.action)==null||ue.call(fe,Q=>{k(ie,Q)});const M=()=>l==="submit"||l==="input"||l==="blur"?!0:w(ie);let me=null,be=!1,de=!1;const Z=async()=>{be||(be=!0,U(ie),(l==="blur"||l==="input")&&await $(ie),setTimeout(()=>{be=!1},0))},j=Q=>{me&&(me===Q.target||me.contains&&me.contains(Q.target)||(Z(),me=null,de&&(de=!1,document.removeEventListener("pointerdown",j,!0))))},I=()=>{de||(de=!0,document.addEventListener("pointerdown",j,!0))},y=async()=>{me=document.activeElement,be=!1,I(),l==="input"&&await $(ie)},P=async()=>{await Z(),me=null,de&&(de=!1,document.removeEventListener("pointerdown",j,!0))};return{name:ie,model:fe,get value(){return fe.value},set value(Q){fe.value=Q},error:()=>M()?p(ie):null,success:ge.success||null,warning:ge.warning||null,note:ge.note||null,touch:()=>U(ie),validate:()=>$(ie),onInput:y,onBlur:P,hint:ge.hint||null}},validateField:$,validate:B,reset:()=>{v.value=null,i.value={},c.value={},n&&z({...n||{}})},submit:async ie=>{a.value=!0,v.value=null;try{return await B()?{ok:!0,result:await(ie==null?void 0:ie(r(),le))}:{ok:!1,reason:"validation"}}catch(ge){return console.error("[useForm] submit error:",ge),v.value=ge&&ge.message?ge.message:String(ge),{ok:!1,reason:"exception",error:ge}}finally{a.value=!1}}};return le},xe.Form=(...e)=>{const{props:t,children:s}=JSswift.uiNormalizeArgs(e),l=t.form,n=t.onSubmit,i=re(["jss-form",t.class]),c=JSswift.omit(t,["form","onSubmit"]);c.class=i;const a=_.form({...c,onSubmit:async r=>{r.preventDefault(),l&&await l.submit(n||(async()=>{}))}}),v=[];for(const r of s||[]){const z=typeof r=="function"?r(l):r,d=JSswift.ui.slot(z);d&&(Array.isArray(d)?v.push(...d):v.push(d))}return v.forEach(r=>a.appendChild(r)),l&&l.submitting&&JSswift.reactive.effect(()=>{a.classList.toggle("is-submitting",!!l.submitting.value)},"UI.Form:submitting"),a},wt.services=wt.services||{},wt.services.dialog=wt.services.dialog||{},wt.dialog=wt.services.dialog;let As=null;function ao(){return As||(As=document.createElement("div"),As.setAttribute("data-jss-modal-root","true"),document.body.appendChild(As),As)}xe.cardHeader=(...e)=>{const{props:t,children:s}=JSswift.uiNormalizeArgs(e),l=t.slots||{},n=re(["jss-card-header",pe(t.divider,"divider"),t.class]),i=JSswift.omit(t,["divider","align","justify","gap","wrap","direction","slots"]);i.class=n;const c={...t.style||{}},a=qe(t.align);a!=null&&!nt(t,"align")&&(c.alignItems=a);const v=qe(t.justify);v!=null&&!nt(t,"justify")&&(c.justifyContent=v);const r=qe(t.wrap,N=>N?"wrap":"nowrap");r!=null&&!nt(t,"wrap")&&(c.flexWrap=r);const z=qe(t.direction);z!=null&&!nt(t,"direction")&&(c.flexDirection=z);const d=qe(t.gap,vt);d!=null&&!nt(t,"gap")&&(c.gap=d),Object.keys(c).length&&(i.style=c),JSswift.uiApplyResponsiveProps(i,t,JSswift.uiResponsiveStyleRules);const k=_.div(i,...D(l,"default",{},s));return Et(k,t),k},xe.cardBody=(...e)=>{const{props:t,children:s}=JSswift.uiNormalizeArgs(e),l=t.slots||{},n=re(["jss-card-body",t.class]),i=JSswift.omit(t,["slots","display","direction","wrap","align","justify","gap","rowGap","columnGap","padding","width"]);i.class=n,JSswift.uiApplyResponsiveProps(i,t,JSswift.uiResponsiveStyleRules);const c=_.div(i,...D(l,"default",{},s));return Et(c,t),c},xe.cardFooter=(...e)=>{const{props:t,children:s}=JSswift.uiNormalizeArgs(e),l=t.slots||{},n=re(["jss-card-footer",pe(t.divider,"divider"),t.class]),i=JSswift.omit(t,["divider","align","justify","gap","wrap","direction","slots"]);i.class=n;const c={...t.style||{}},a=qe(t.align);a!=null&&!nt(t,"align")&&(c.alignItems=a);const v=qe(t.justify);v!=null&&!nt(t,"justify")&&(c.justifyContent=v);const r=qe(t.wrap,N=>N?"wrap":"nowrap");r!=null&&!nt(t,"wrap")&&(c.flexWrap=r);const z=qe(t.direction);z!=null&&!nt(t,"direction")&&(c.flexDirection=z);const d=qe(t.gap,vt);d!=null&&!nt(t,"gap")&&(c.gap=d),Object.keys(c).length&&(i.style=c),JSswift.uiApplyResponsiveProps(i,t,JSswift.uiResponsiveStyleRules);const k=_.div(i,...D(l,"default",{},s));return Et(k,t),k},xe.Dialog=(...e)=>{const{props:t,children:s}=JSswift.uiNormalizeArgs(e),l=t.slots||{},n=["primary","secondary","warning","danger","success","info","light","dark"],i=["xs","sm","md","lg","xl","full"];let c={...t},a=null,v=null;const r=(j,I)=>typeof j=="function"?j(I):j,z=j=>String(j||"").split(/\s+/).filter(Boolean),d=(j,I,y)=>{if(!j)return;const P=j[I]||[];P.length&&j.classList.remove(...P);const Q=(y||[]).filter(Boolean);Q.length&&j.classList.add(...Q),j[I]=Q},k=(j,I,y,P=Q=>Q)=>{if(j){if(y==null||y===""){j.style.removeProperty(I);return}j.style.setProperty(I,P(y))}},N=()=>{var j,I,y,P,Q,m;const b=window.visualViewport,g=Math.max(0,Math.round((j=b==null?void 0:b.offsetLeft)!=null?j:0)),T=Math.max(0,Math.round((I=b==null?void 0:b.offsetTop)!=null?I:0)),Y=Math.max(0,Math.round((P=(y=b==null?void 0:b.width)!=null?y:window.innerWidth)!=null?P:0)),K=Math.max(0,Math.round((m=(Q=b==null?void 0:b.height)!=null?Q:window.innerHeight)!=null?m:0));return{left:g,top:T,width:Y,height:K}},p=j=>{if(!(j!=null&&j.panel))return;const{left:I,top:y,width:P,height:Q}=N();k(j.panel,"position","fixed"),k(j.panel,"inset",0,m=>`${m}px`),k(j.panel,"top",y,m=>`${m}px`),k(j.panel,"left",I,m=>`${m}px`),k(j.panel,"right","auto"),k(j.panel,"bottom","auto"),k(j.panel,"width",P,m=>`${m}px`),k(j.panel,"height",Q,m=>`${m}px`),k(j.panel,"min-height",Q,m=>`${m}px`),k(j.panel,"max-width",P,m=>`${m}px`),k(j.panel,"max-height",Q,m=>`${m}px`),k(j.panel,"min-width",0,m=>`${m}px`),k(j.panel,"margin",0,m=>`${m}px`),k(j.panel,"box-sizing","border-box"),k(j.panel,"border-width",0,m=>`${m}px`),k(j.panel,"border-radius",0,m=>`${m}px`),k(j.panel,"transform","none"),k(j.panel,"overflow","hidden"),k(j.panel,"--jss-dialog-fullscreen-left",I,m=>`${m}px`),k(j.panel,"--jss-dialog-fullscreen-top",y,m=>`${m}px`),k(j.panel,"--jss-dialog-fullscreen-width",P,m=>`${m}px`),k(j.panel,"--jss-dialog-fullscreen-height",Q,m=>`${m}px`)},U=j=>{j!=null&&j.panel&&(k(j.panel,"position",null),k(j.panel,"inset",null),k(j.panel,"top",null),k(j.panel,"left",null),k(j.panel,"right",null),k(j.panel,"bottom",null),k(j.panel,"width",null),k(j.panel,"height",null),k(j.panel,"min-height",null),k(j.panel,"max-width",null),k(j.panel,"max-height",null),k(j.panel,"min-width",null),k(j.panel,"margin",null),k(j.panel,"box-sizing",null),k(j.panel,"border-width",null),k(j.panel,"border-radius",null),k(j.panel,"transform",null),k(j.panel,"overflow",null),k(j.panel,"--jss-dialog-fullscreen-left",null),k(j.panel,"--jss-dialog-fullscreen-top",null),k(j.panel,"--jss-dialog-fullscreen-width",null),k(j.panel,"--jss-dialog-fullscreen-height",null))},w=(j,I)=>{var y,P,Q,m,b;if(!j)return;if((y=j._dialogViewportCleanup)==null||y.call(j),j._dialogViewportCleanup=null,!I){U(j);return}let g=null;const T=globalThis.requestAnimationFrame||(J=>setTimeout(()=>J(Date.now()),0)),Y=globalThis.cancelAnimationFrame||clearTimeout,K=()=>p(j),_e=()=>{g!=null&&Y(g),g=T(()=>{g=null,K()})};K(),_e(),window.addEventListener("resize",K),window.addEventListener("orientationchange",_e),(Q=(P=window.visualViewport)==null?void 0:P.addEventListener)==null||Q.call(P,"resize",K),(b=(m=window.visualViewport)==null?void 0:m.addEventListener)==null||b.call(m,"scroll",_e),j._dialogViewportCleanup=()=>{var J,A,L,O;g!=null&&(Y(g),g=null),window.removeEventListener("resize",K),window.removeEventListener("orientationchange",_e),(A=(J=window.visualViewport)==null?void 0:J.removeEventListener)==null||A.call(J,"resize",K),(O=(L=window.visualViewport)==null?void 0:L.removeEventListener)==null||O.call(L,"scroll",_e)}},$=()=>c,B=j=>{var I;const y=o((I=j.state)!=null?I:j.color);return y?n.includes(y)?y:String(y):""},te=j=>{const I=o(j.size);return typeof I=="string"&&i.includes(I)?I:""},E=j=>{var I,y,P;const Q=String(o((P=(y=(I=j.actionsAlign)!=null?I:j.footerAlign)!=null?y:j.alignActions)!=null?P:"end")).toLowerCase();return["start","left"].includes(Q)?"start":["center","middle"].includes(Q)?"center":["between","space-between"].includes(Q)?"between":["stretch","full"].includes(Q)?"stretch":"end"},ve=j=>{var I,y,P;const Q=String(o((P=(y=(I=j.align)!=null?I:j.verticalAlign)!=null?y:j.position)!=null?P:"center")).toLowerCase();return["top","start","flex-start"].includes(Q)?"jss-dialog-align-top":["bottom","end","flex-end"].includes(Q)?"jss-dialog-align-bottom":""},le=j=>{var I,y;return((y=(I=j.closable)!=null?I:j.dismissible)!=null?y:j.closeButton)!==!1},ie=()=>{var j,I,y,P,Q,m,b,g;const T=$(),Y={close:me,dismiss:me,open:M,toggle:de,update:fe,isOpen:be,entry:()=>a,props:T},K=T.icon!=null?typeof T.icon=="string"?xe.Icon({name:T.icon,size:T.iconSize||"md"}):JSswift.ui.slot(T.icon,{as:"icon"}):null,_e=D(l,"eyebrow",Y,r(T.eyebrow,Y)),J=D(l,"title",Y,r((I=(j=T.title)!=null?j:T.heading)!=null?I:T.header,Y)),A=D(l,"subtitle",Y,r((y=T.subtitle)!=null?y:T.description,Y)),L=D(l,"icon",Y,K),O=D(l,"header",Y,r((P=T.headerContent)!=null?P:T.head,Y)),X=le(T)?D(l,"close",Y,xe.Btn({class:"jss-dialog-close",size:"sm",outline:!0,"aria-label":T.closeLabel||"Chiudi dialog","data-dialog-close":!0},xe.Icon({name:T.closeIcon||"close",size:"sm"}))):[],we=(b=(m=(Q=T.content)!=null?Q:T.body)!=null?m:T.message)!=null?b:s&&s.length?s:null;let Be=D(l,"content",Y,r(we,Y));Be.length||(Be=D(l,"body",Y,r(we,Y))),Be.length||(Be=D(l,"default",Y,r(we,Y)));const Ue=r((g=T.footer)!=null?g:T.actions,Y);let H=D(l,"footer",Y,Ue);H.length||(H=D(l,"actions",Y,Ue));let W=null;O.length?W=_.div({class:"jss-dialog-head jss-dialog-head-custom"},...O):(_e.length||J.length||A.length||L.length||X.length)&&(W=_.div({class:"jss-dialog-head"},L.length?_.div({class:"jss-dialog-icon"},...L):null,_.div({class:"jss-dialog-head-main"},_e.length?_.div({class:"jss-dialog-eyebrow"},..._e):null,J.length?_.div({class:"jss-dialog-title"},...J):null,A.length?_.div({class:"jss-dialog-subtitle"},...A):null),X.length?_.div({class:"jss-dialog-close-wrap"},...X):null));const ee=_.div({class:re(["jss-dialog-body",T.bodyClass])},...Be),Ne=H.length?_.div({class:re(["jss-dialog-actions",`is-${E(T)}`,pe(T.stackActions,"is-stacked"),T.actionsClass,T.footerClass])},...H):null;return _.div({class:re(["jss-dialog-shell",pe(!!W,"has-head"),pe(!!Ne,"has-footer"),pe(T.divider!==!1,"with-divider")])},...[W,ee,Ne].filter(Boolean))},ge=j=>{var I;if(!(j!=null&&j.panel))return;const y=$(),P=B(y),Q=te(y);d(j.panel,"_dialogClassTokens",["jss-dialog","jss-singularity","jss-clear-set",Q?`jss-dialog-${Q}`:"",P,P?`jss-state-${P}`:"",o(y.fullscreen)?"fullscreen":"",o(y.scrollable)?"scrollable":"",o(y.stickyHeader)?"sticky-head":"",o(y.stickyActions)?"sticky-actions":"",o(y.borderless)?"borderless":"",...z(y.class),...z(y.panelClass)]),d(j.overlay,"_dialogOverlayClassTokens",[ve(y),o(y.backdropBlur)?"jss-dialog-overlay-blur":"",...z(y.overlayClass)]),k(j.panel,"--jss-dialog-width",o(y.width),vt),k(j.panel,"--jss-dialog-min-width",o(y.minWidth),vt),k(j.panel,"--jss-dialog-max-width",o(y.maxWidth),vt),k(j.panel,"--jss-dialog-max-height",o(y.maxHeight),vt),k(j.panel,"--jss-dialog-body-max-height",o((I=y.bodyMaxHeight)!=null?I:y.contentMaxHeight),vt),y.style&&Object.assign(j.panel.style,y.style),Et(j.panel,y),w(j,o(y.fullscreen)),j.panel.setAttribute("role",y.role||"dialog"),j.panel.setAttribute("aria-modal",y.modal===!1?"false":"true"),y.ariaLabel?j.panel.setAttribute("aria-label",y.ariaLabel):j.panel.removeAttribute("aria-label")},ue=()=>{a!=null&&a.panel&&a.panel.replaceChildren(ie())},fe=(j={})=>(j&&typeof j=="object"&&(c={...c,...j}),a&&(ge(a),ue()),Z),M=(j=null)=>{var I,y,P,Q,m;if(j&&typeof j=="object"&&(c={...c,...j}),a)return ge(a),ue(),a;v=document.activeElement;const b=$(),g=b.persistent===!0;a=JSswift.overlay.open(()=>ie(),{type:"dialog",backdrop:b.backdrop!==!1,lockScroll:b.lockScroll!==!1,trapFocus:b.trapFocus!==!1,autoFocus:b.autoFocus!==!1,closeOnOutside:(I=b.closeOnOutside)!=null?I:!g,closeOnBackdrop:(y=b.closeOnBackdrop)!=null?y:!g,closeOnEsc:(P=b.closeOnEsc)!=null?P:!g,className:Bt(["jss-dialog"]),onClose:()=>{var Y,K,_e,J;(Y=a==null?void 0:a._dialogViewportCleanup)==null||Y.call(a),(K=a==null?void 0:a.panel)==null||K.removeEventListener("click",T),a=null,(J=(_e=$()).onClose)==null||J.call(_e),v&&typeof v.focus=="function"&&setTimeout(()=>v.focus(),0)}});const T=Y=>{const K=Y.target;K&&K.closest&&K.closest("[data-dialog-close]")&&me()};return a.panel.addEventListener("click",T),ge(a),ks(a),(m=(Q=$()).onOpen)==null||m.call(Q,a),a},me=()=>{if(!a)return;const j=a;Ns(j,()=>JSswift.overlay.close(j.id))},be=()=>!!a,de=(j=null)=>be()?(me(),null):M(j),Z={open:M,close:me,toggle:de,update:fe,isOpen:be,entry:()=>a,props:()=>({...c})};return Z},xe.TabPanel=(...e)=>{var t,s,l,n,i,c,a,v,r,z,d,k,N;const{props:p,children:U}=JSswift.uiNormalizeArgs(e),w=p.slots||{},$=Array.isArray(p.tabs)?p.tabs:Array.isArray(p.items)?p.items:[],B=en(p.model,"UI.TabPanel:model"),te=p.id||"jss-tabpanel-"+Math.random().toString(36).slice(2,9),E=h=>String(o(h)||"vertical").toLowerCase()==="horizontal"?"horizontal":"vertical",ve=h=>String(o(h)||"before").toLowerCase()==="after"?"after":"before",le=h=>{const x=String(o(h)||"").toLowerCase();return x==="pills"||x==="pill"?"pills":x==="soft"||x==="card"?"soft":"line"},ie=h=>{const x=o(h);return x==null||x===""?null:JSswift.uiColors.includes(x)?`var(--jss-${x})`:String(x)},ge=E(p.orientation||p.orient||p.direction),ue=ve(p.navPosition||p.barPosition||p.position),fe=le(p.variant||(p.pills?"pills":p.soft?"soft":"line")),M=!!p.wrap,me=!!p.swipeable,be=!!p.infinite,de=!!p.animated,Z=!!((s=(t=p.navFill)!=null?t:p.fill)!=null?s:p.stretch),j=!!p.disabled,I=o((l=p.transitionDuration)!=null?l:p["transition-duration"]),y=(()=>{if(I==null)return 220;if(typeof I=="number")return I;const h=parseFloat(I);return Number.isFinite(h)?h:220})(),P=o((n=p.transitionEasing)!=null?n:p["transition-easing"])||"ease",Q=(c=(i=p.transitionPrev)!=null?i:p["transition-prev"])!=null?c:null,m=(v=(a=p.transitionNext)!=null?a:p["transition-next"])!=null?v:null,b=ie((r=p.color)!=null?r:p.state),g=$.map((h,x)=>{var ae,Oe,De,Ge,Ke,We,et,tt,dt,gt,At,It,$t,zt,Xe,mt;if(h==null)return null;if(typeof h!="object")return{name:h,labelFallback:h,panelFallback:null,noteFallback:null,iconFallback:null,badgeFallback:null,hidden:!1,raw:h,index:x};const Nt=(We=(Ke=(Ge=(De=(Oe=(ae=h.name)!=null?ae:h.value)!=null?Oe:h.id)!=null?De:h.key)!=null?Ge:h.label)!=null?Ke:h.title)!=null?We:`tab-${x}`,Zt=h.label!=null||h.title!=null,rn=Zt?(et=h.label)!=null?et:h.title:h.children!=null&&h.content==null&&h.panel==null?h.children:(dt=(tt=h.name)!=null?tt:h.value)!=null?dt:`Tab ${x+1}`,qt=(It=(At=(gt=h.content)!=null?gt:h.panel)!=null?At:h.body)!=null?It:Zt?h.children:null,Yt=(Xe=(zt=($t=h.note)!=null?$t:h.subtitle)!=null?zt:h.description)!=null?Xe:null,cn=(mt=h.icon)!=null?mt:null,Xt=Object.prototype.hasOwnProperty.call(h,"badge")?h.badge:Object.prototype.hasOwnProperty.call(h,"counter")?h.counter:null;return{...h,name:Nt,labelFallback:rn,panelFallback:qt,noteFallback:Yt,iconFallback:cn,badgeFallback:Xt,index:x}}).filter(Boolean).filter(h=>h.hidden!==!0&&h.visible!==!1),T=re(["jss-clear-set","jss-tabpanel","jss-singularity",ge,`variant-${fe}`,pe(M,"wrap"),pe(de,"animated"),pe(Z,"nav-fill"),pe(j,"disabled"),pe(ue==="after","nav-after"),p.class]),Y=JSswift.omit(p,["tabs","items","value","default","defaultValue","model","orientation","orient","direction","navPosition","barPosition","position","variant","pills","soft","navFill","fill","stretch","wrap","swipeable","infinite","animated","transitionDuration","transition-duration","transitionEasing","transition-easing","transitionPrev","transition-prev","transitionNext","transition-next","slots","empty","tabClass","tabStyle","panelClass","panelStyle","navClass","panelsClass","class","style"]);Y.class=T,Y.style=p.style;const K=_.div(Y);de&&(K.style.setProperty("--jss-tabpanel-duration",`${y}ms`),K.style.setProperty("--jss-tabpanel-easing",P)),b&&K.style.setProperty("--jss-tabpanel-accent",b);const _e=_.div({class:re(["jss-tabpanel-nav",p.navClass]),role:"tablist","aria-orientation":ge}),J=_.div({class:re(["jss-tabpanel-panels",p.panelsClass])}),A=[],L=[];let O=-1;const X=()=>ge==="horizontal",we=(h,x,ae)=>({tab:h,name:h.name,index:x,active:ae,value:h.name,select:()=>Re(x),next:()=>Se(),prev:()=>Fe()}),Be=(h,x,ae=!1)=>{var Oe;if(!g.length)return-1;let De=h;for(let Ge=0;Ge<g.length;Ge+=1){if(De+=x,De>=g.length){if(!ae)return-1;De=0}else if(De<0){if(!ae)return-1;De=g.length-1}if(!((Oe=g[De])!=null&&Oe.disabled))return De}return-1},Ue=h=>{var x;const ae=(x=A[h])==null?void 0:x.btn;!ae||typeof ae.focus!="function"||requestAnimationFrame(()=>ae.focus())},H=(h,x,ae)=>{const Oe=we(h,x,ae),De=JSswift.ui.renderSlot(w,"label",Oe,h.labelFallback);return D(null,"default",{},De)},W=(h,x)=>{var ae,Oe,De,Ge,Ke;const We=x===O,et=`${te}-tab-${x}`,tt=`${te}-panel-${x}`,dt=we(h,x,We),gt=H(h,x,We),At=h.iconFallback!=null?typeof h.iconFallback=="string"?xe.Icon({name:h.iconFallback,size:(De=(Oe=(ae=h.iconSize)!=null?ae:h.size)!=null?Oe:p.size)!=null?De:null}):h.iconFallback:null,It=D(w,"icon",dt,At),$t=D(w,"note",dt,h.noteFallback),zt=D(w,"badge",dt,h.badgeFallback),Xe=_.span({class:"jss-tabpanel-tab-inner"},It.length?_.span({class:"jss-tabpanel-tab-icon"},...It):null,_.span({class:"jss-tabpanel-tab-copy"},_.span({class:"jss-tabpanel-tab-label"},...gt.length?gt:[""]),$t.length?_.span({class:"jss-tabpanel-tab-note"},...$t):null),zt.length?_.span({class:"jss-tabpanel-tab-badge"},...zt):null),mt=D(w,"tab",{...dt,label:gt,icon:It,note:$t,badge:zt,tabId:et,panelId:tt},Xe),Nt=qt=>{if(j||h.disabled)return;const Yt=qt.key;if(Yt==="Enter"||Yt===" "){qt.preventDefault(),Re(x);return}if(Yt==="Home"){qt.preventDefault();const Ut=g.findIndex(tn=>!tn.disabled);Ut>=0&&(Re(Ut),Ue(Ut));return}if(Yt==="End"){qt.preventDefault();const Ut=(()=>{var tn;for(let ln=g.length-1;ln>=0;ln-=1)if(!((tn=g[ln])!=null&&tn.disabled))return ln;return-1})();Ut>=0&&(Re(Ut),Ue(Ut));return}const cn=X()?["ArrowLeft"]:["ArrowUp"],Xt=X()?["ArrowRight"]:["ArrowDown"];if(cn.includes(Yt)){qt.preventDefault();const Ut=Be(x,-1,be);Ut>=0&&(Re(Ut,{dir:"prev"}),Ue(Ut));return}if(Xt.includes(Yt)){qt.preventDefault();const Ut=Be(x,1,be);Ut>=0&&(Re(Ut,{dir:"next"}),Ue(Ut))}},Zt=xe.Btn({class:re(["jss-tabpanel-tab",pe(We,"active"),pe(h.disabled||j,"disabled"),p.tabClass,h.tabClass||h.class]),type:"button",id:et,role:"tab",disabled:!!(h.disabled||j),"aria-selected":We?"true":"false","aria-controls":tt,tabindex:We?"0":"-1",outline:fe==="pills"&&!We,color:fe==="pills"&&We?h.color||p.color||p.state||"primary":null,size:(Ke=(Ge=h.size)!=null?Ge:p.size)!=null?Ke:null,style:{...p.tabStyle||{},...h.tabStyle||{}},onClick:()=>{h.disabled||j||Re(x)},onKeydown:Nt},...mt),rn=_.div({class:re(["jss-tabpanel-nav-btn",pe(We,"active"),h.navClass]),"data-name":h.name},Zt,_.span({class:"tab-indicator"}));return A[x]={btn:Zt,wrap:rn,index:x},rn},ee=(h,x)=>{const ae=x===O,Oe=`${te}-tab-${x}`,De=`${te}-panel-${x}`,Ge=we(h,x,ae),Ke=JSswift.ui.renderSlot(w,"panel",Ge,h.panelFallback),We=_.div({class:re(["jss-tabpanel-panel",pe(ae,"active"),p.panelClass,h.panelClass]),style:{...p.panelStyle||{},...h.panelStyle||{}},"data-name":h.name,role:"tabpanel",id:De,tabindex:0,"aria-labelledby":Oe,"aria-hidden":ae?"false":"true"},...D(null,"default",{},Ke));return L[x]=We,We},Ne=g.map((h,x)=>W(h,x)),Te=JSswift.ui.renderSlot(w,"nav",{tabs:g,active:()=>{var h;return O>=0?(h=g[O])==null?void 0:h.name:null},activeIndex:()=>O,activeTab:()=>O>=0?g[O]:null,select:h=>{typeof h=="number"?Re(h):C(h)},next:()=>Se(),prev:()=>Fe(),nodes:Ne,orientation:ge,position:ue,variant:fe},Ne);D(null,"default",{},Te).forEach(h=>_e.appendChild(h)),g.length?g.forEach((h,x)=>J.appendChild(ee(h,x))):D(w,"empty",{tabs:g},(z=p.empty)!=null?z:_.div({class:"jss-tabpanel-empty"},"Nessun contenuto disponibile.")).forEach(x=>J.appendChild(x));const oe=h=>{if(!de)return;const x=h==="next"?"18px":"-18px",ae=h==="next"?"-18px":"18px";K.style.setProperty("--jss-tabpanel-enter",x),K.style.setProperty("--jss-tabpanel-leave",ae)},Pe=()=>{const h=[];Q&&h.push(...String(Q).split(/\s+/)),m&&h.push(...String(m).split(/\s+/)),h.length&&J.classList.remove(...h.filter(Boolean))},Ie=h=>{Pe();const x=h==="prev"?Q:m;if(!x)return;const ae=String(x).split(/\s+/).filter(Boolean);ae.length&&(J.classList.add(...ae),setTimeout(()=>J.classList.remove(...ae),y+40))},Le=h=>{var x;const ae=A.find(({btn:De})=>De.classList.contains("active")),Oe=(x=ae==null?void 0:ae.btn.parentNode)==null?void 0:x.getBoundingClientRect();A.forEach(({btn:De,index:Ge})=>{const Ke=Ge===h,We=De.parentNode;if(!We)return;const et=We.getBoundingClientRect();We.isConnected&&Oe&&(We.style.setProperty("--nav-pos-x",Oe.left-et.left+"px"),We.style.setProperty("--nav-pos-y",Oe.top-et.top+"px")),We.classList.toggle("active",Ke),De.classList.toggle("active",Ke),De.setAttribute("aria-selected",Ke?"true":"false"),De.setAttribute("tabindex",Ke?"0":"-1")})},Ye=(h,x,ae)=>{oe(ae),L.forEach((Oe,De)=>{if(!Oe)return;const Ge=De===x,Ke=De===h;Ge?(Oe.classList.add("active"),Oe.classList.remove("leaving"),Oe.setAttribute("aria-hidden","false")):(Oe.classList.remove("active"),Oe.setAttribute("aria-hidden","true"),de&&Ke?(Oe.classList.add("leaving"),setTimeout(()=>Oe.classList.remove("leaving"),y+40)):Oe.classList.remove("leaving"))})},ct=(h,x)=>h<0||h===x||be&&h===g.length-1&&x===0?"next":be&&h===0&&x===g.length-1?"prev":x>h?"next":"prev",Re=(h,x={})=>{var ae,Oe;if(h==null||h<0||h>=g.length||(ae=g[h])!=null&&ae.disabled)return;const De=O;if(De===h)return;O=h;const Ge=g[h],Ke=x.dir||ct(De,h);B&&!x.fromModel&&B.set(Ge.name),Le(h),Ye(De,h,Ke),Ie(Ke),K.dataset.active=String(Ge.name),(Oe=p.onChange)==null||Oe.call(p,Ge.name,Ge,h)},C=(h,x={})=>{if(!g.length)return;const ae=g.findIndex(Oe=>Oe.name==h);ae!==-1&&Re(ae,x)},Se=()=>{if(!g.length)return;const h=O<0?g.findIndex(x=>!x.disabled):Be(O,1,be);h<0||Re(h,{dir:"next"})},Fe=()=>{if(!g.length)return;const h=O<0?(()=>{var x;for(let ae=g.length-1;ae>=0;ae-=1)if(!((x=g[ae])!=null&&x.disabled))return ae;return-1})():Be(O,-1,be);h<0||Re(h,{dir:"prev"})};if(me){let h=0,x=0,ae=!1;const Oe=42;J.addEventListener("pointerdown",De=>{De.button!=null&&De.button!==0||(ae=!0,h=De.clientX,x=De.clientY)}),J.addEventListener("pointerup",De=>{if(!ae)return;ae=!1;const Ge=De.clientX-h,Ke=De.clientY-x;Math.abs(Ge)<Oe||Math.abs(Ge)<Math.abs(Ke)||(Ge<0?Se():Fe())}),J.addEventListener("pointercancel",()=>{ae=!1}),J.addEventListener("pointerleave",()=>{ae=!1})}const F=B?B.get():(N=(k=(d=p.value)!=null?d:p.defaultValue)!=null?k:p.default)!=null?N:null;if(g.length){const h=g.findIndex(x=>x.name==F);if(h>=0)Re(h,{fromModel:!0});else{const x=g.findIndex(ae=>!ae.disabled);x>=0&&(Re(x,{fromModel:!0}),B&&B.set(g[x].name))}}return B&&B.watch(h=>C(h,{fromModel:!0}),"UI.TabPanel:watch"),ue==="after"?(K.appendChild(J),K.appendChild(_e)):(K.appendChild(_e),K.appendChild(J)),D(w,"default",{},U).forEach(h=>K.appendChild(h)),Et(K,p),K._tabs=()=>g.slice(),K._active=()=>O>=0?g[O]:null,K._getValue=()=>{var h;return O>=0?(h=g[O])==null?void 0:h.name:null},K._setValue=h=>C(h),K._select=h=>{typeof h=="number"?Re(h):C(h)},K._next=Se,K._prev=Fe,K};function Ho(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function Ol({title:e,message:t,contentNode:s,okText:l,cancelText:n,showCancel:i,onOk:c,onCancel:a,persistent:v}){ao();const r=_.div({class:"jss-dialog-backdrop",onClick:U=>{U.target===r&&v!==!0&&(a==null||a())}}),z=D(null,"default",{},e),d=D(null,"default",{},t),k=D(null,"default",{},s),N=_.div({class:"jss-dialog jss-panel"},z.length?_.h3(...z):null,d.length?_.p(...d):null,...k,_.div({class:"jss-dialog-actions"},i?JSswift.ui.Btn({onClick:a},n||"Annulla"):null,JSswift.ui.Btn({color:"primary",onClick:c},l||"OK")));r.appendChild(N),ao().appendChild(r);const p=U=>{U.key==="Escape"&&(a==null||a())};return document.addEventListener("keydown",p,{once:!0}),{backdrop:r,close:()=>Ho(r)}}wt.dialog.alert=function(e,t={}){return new Promise(s=>{const{backdrop:l,close:n}=Ol({title:t.title||"Info",message:e,okText:t.okText||"OK",showCancel:!1,persistent:t.persistent,onOk:()=>{n(),s(!0)},onCancel:()=>{n(),s(!0)}})})},wt.dialog.confirm=function(e={}){return new Promise(t=>{const{close:s}=Ol({title:e.title||"Conferma",message:e.message||"",okText:e.okText||"Conferma",cancelText:e.cancelText||"Annulla",showCancel:!0,persistent:e.persistent,onOk:()=>{s(),t(!0)},onCancel:()=>{s(),t(!1)}})})},wt.dialog.prompt=function(e={}){return new Promise(t=>{const s=JSswift.ui.Input({class:"jss-dialog-input",type:e.type||"text",placeholder:e.placeholder||""});e.value!=null&&(s.value=String(e.value));const{close:l}=Ol({title:e.title||"Inserisci valore",message:e.message||"",okText:e.okText||"OK",cancelText:e.cancelText||"Annulla",showCancel:!0,contentNode:_.div(s),persistent:e.persistent,onOk:()=>{const n=s.value;l(),t(n)},onCancel:()=>{l(),t(null)}});setTimeout(()=>s.focus(),0)})},wt.services=wt.services||{},wt.services.loading=wt.services.loading||{},wt.loading=wt.services.loading;let hn=null,Hs=0;function co(){if(hn)return hn;hn=document.createElement("div"),hn.className="jss-loading-backdrop",hn.style.cssText=`
|
|
2
2
|
position: fixed; inset: 0;
|
|
3
3
|
background: rgba(0,0,0,0.45);
|
|
4
4
|
display: none;
|
|
5
5
|
align-items: center; justify-content: center;
|
|
6
6
|
z-index: 10001;
|
|
7
7
|
padding: 14px;
|
|
8
|
-
`;const
|
|
8
|
+
`;const e=document.createElement("div");e.className="jss-panel jss-loading-card",e.style.cssText=`
|
|
9
9
|
padding: 14px 16px;
|
|
10
|
-
border-radius: var(--
|
|
10
|
+
border-radius: var(--jss-r-lg);
|
|
11
11
|
min-width: 260px;
|
|
12
12
|
display:flex; gap: 12px; align-items:center;
|
|
13
13
|
flex-direction: column;
|
|
14
|
-
`;const
|
|
14
|
+
`;const t=document.createElement("div");t.className="jss-loading-spinner",t.style.cssText=`
|
|
15
15
|
width: 18px; height: 18px;
|
|
16
16
|
border-radius: 50%;
|
|
17
17
|
border: 2px solid rgba(255,255,255,0.25);
|
|
18
|
-
border-top-color: var(--
|
|
19
|
-
animation:
|
|
20
|
-
`;const
|
|
18
|
+
border-top-color: var(--jss-primary);
|
|
19
|
+
animation: jssSpin 0.9s linear infinite;
|
|
20
|
+
`;const s=document.createElement("div");s.className="jss-muted jss-loading-text",s.textContent="Loading...";const l=document.createElement("div");l.className="jss-loading-progress",l.style.cssText=`
|
|
21
21
|
width: 100%;
|
|
22
22
|
height: 6px;
|
|
23
23
|
border-radius: 999px;
|
|
24
24
|
overflow: hidden;
|
|
25
25
|
background: rgba(255,255,255,0.08);
|
|
26
26
|
display: none;
|
|
27
|
-
`;const
|
|
27
|
+
`;const n=document.createElement("div");n.className="jss-loading-progress-bar",n.style.cssText=`
|
|
28
28
|
height: 100%;
|
|
29
29
|
width: 0%;
|
|
30
|
-
background: var(--
|
|
30
|
+
background: var(--jss-primary);
|
|
31
31
|
transition: width 200ms ease;
|
|
32
|
-
`,
|
|
33
|
-
@keyframes
|
|
34
|
-
`,document.head.appendChild(S),fn._textNode=n,fn._spinner=e,fn._progressWrap=s,fn._progressBar=i,fn._progressActive=!1,fn}function ri(t,e){if(typeof t=="object"&&t!==null)return{...t};const n=e&&typeof e=="object"?e:{};return typeof e=="string"&&(t==null||typeof t=="number")?{...n,message:e}:{...n,message:t}}function ai(t,e){const n=e==="progress";t._spinner.style.display=n?"none":"",t._progressWrap.style.display=n?"block":"none",t._mode=e}bt.loading.show=function(t="Loading...",e={}){const n=li(),s=ri(t,e);Bs++,n._progressActive=!1,n._textNode.textContent=s.message||"Loading...",ai(n,"spinner"),s.spinner===!1&&(n._spinner.style.display="none"),n.style.display="flex"},bt.loading.hide=function(){fn&&(Bs=Math.max(0,Bs-1),Bs===0&&(fn.style.display="none",fn._progressActive=!1))},bt.loading.progress=function(t=0,e={}){var c;const n=li();typeof t=="object"&&t!==null&&(e=t,t=(c=t.value)!=null?c:0);const s=ri(null,e);n._progressActive||(Bs++,n._progressActive=!0);const i=Math.max(0,Math.min(100,Number(t!=null?t:0)));n._textNode.textContent=s.message||"Loading...",n._progressBar.style.width=i+"%",ai(n,"progress"),n.style.display="flex"},bt.loading.wrap=async function(t,e){bt.loading.show(t);try{return await e()}finally{bt.loading.hide()}};function el(t){return typeof t=="function"?t():t||[]}function Fo(t,e){if(!(t==null||e==null))return typeof e!="string"||e.indexOf(".")<0?t==null?void 0:t[e]:e.split(".").reduce((n,s)=>n==null?n:n[s],t)}function tl(t,e){return t==null&&e==null?0:t==null?-1:e==null?1:typeof t=="number"&&typeof e=="number"?t-e:String(t).localeCompare(String(e),void 0,{numeric:!0,sensitivity:"base"})}function nl(t){const e=el(t);return Array.isArray(e)?e:[]}function ci(t){var e,n,s,i;return(i=(s=(n=(e=t==null?void 0:t.label)!=null?e:t==null?void 0:t.title)!=null?n:t==null?void 0:t.header)!=null?s:t==null?void 0:t.key)!=null?i:""}function Do(t,e){var n,s;return(s=(n=t==null?void 0:t.sortKey)!=null?n:t==null?void 0:t.key)!=null?s:`__col_${e}`}function ui(t,e){return t.find((n,s)=>Do(n,s)===e||(n==null?void 0:n.key)===e)||null}function So(t,e,n){return t?typeof t.get=="function"?t.get(e,{row:e,rowIndex:n,col:t}):typeof t.value=="function"?t.value(e,{row:e,rowIndex:n,col:t}):typeof t.key=="string"?Fo(e,t.key):t.key!=null?e==null?void 0:e[t.key]:e:e}function Co(t,e){return typeof t=="function"?t(e)||{}:t||{}}function xo(t){if(t==null)return"";if(typeof t=="string"||typeof t=="number"||typeof t=="boolean")return String(t);if(Array.isArray(t))return t.map(xo).filter(Boolean).join(" ");if(typeof Node!="undefined"&&t instanceof Node)return t.textContent||"";if(typeof t=="object"){if(typeof t.textContent=="string")return t.textContent;try{return JSON.stringify(t)}catch(e){return""}}return String(t)}function sl(t,e){const s=(Array.isArray(t)?t:e).map(i=>Number(i)).filter(i=>Number.isFinite(i)&&i>0);return s.length?Array.from(new Set(s)):e}function ol(t,e,n,s){const i=s.searchBy||s.searchPredicate;if(typeof i=="function")return!!i(t,{query:n,columns:e});const c=String(n||"").trim().toLowerCase().split(/\s+/).filter(Boolean);if(!c.length)return!0;const S=Array.isArray(s.searchKeys)&&s.searchKeys.length?s.searchKeys:e.filter(b=>(b==null?void 0:b.searchable)!==!1).map(b=>{var M;return(M=b==null?void 0:b.searchKey)!=null?M:b==null?void 0:b.key}).filter(Boolean),u=[];if(S.length)for(const b of S)if(typeof b=="function")u.push(xo(b(t)));else{const M=e.find(N=>(N==null?void 0:N.key)===b||(N==null?void 0:N.searchKey)===b);u.push(xo(M?So(M,t,-1):Fo(t,b)))}else u.push(xo(t));const a=u.join(" ").toLowerCase();return c.every(b=>a.includes(b))}Ae.Table=(...t)=>{var Ie,Ye,rt,Xe;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=Array.isArray(e.columns)?e.columns:[],c=sl(e.pageSizeOptions,[5,10,20,50]),S=Number((Ye=(Ie=e.pageSize)!=null?Ie:c[0])!=null?Ye:10)||10,u=Array.from(new Set([...c,S])).sort((We,w)=>We-w),a=e.initialSort||(e.sortBy?{key:e.sortBy,dir:e.sortDir==="desc"?"desc":"asc"}:null),b=e.searchable===!0||typeof e.searchable=="string"||e.searchPlaceholder!=null||e.search!=null||e.query!=null||!!e.searchModel||!!e.queryModel||Array.isArray(e.searchKeys)||typeof e.searchBy=="function"||typeof e.searchPredicate=="function",M=an(e.searchModel||e.queryModel,"UI.Table:query"),[N,C]=bt.reactive.signal(Math.max(1,Number(e.page||1)||1)),[z,U]=bt.reactive.signal(S),[W,ge]=bt.reactive.signal(a),[B,ne]=bt.reactive.signal(String((Xe=M?M.get():(rt=e.search)!=null?rt:e.query)!=null?Xe:"")),he=We=>{const w=String(We!=null?We:"");ne(w),M&&M.set(w),C(1)},q=We=>{const w=Number(We)||S;U(w),C(1)},se=(We,w)=>{const ie=Do(We,w),$e=W();!$e||$e.key!==ie&&$e.key!==(We==null?void 0:We.key)?ge({key:ie,dir:"asc"}):$e.dir==="asc"?ge({key:ie,dir:"desc"}):ge(null),C(1)};let le=null,fe;M&&(fe=M.watch(We=>{const w=String(We!=null?We:"");ne(w),le&&le.value!==w&&(le.value=w),C(1)},"UI.Table:queryWatch"));const be=JSswift.omit(e,["columns","rows","rowKey","loading","page","pageSize","pageSizeOptions","pagination","initialSort","sortBy","sortDir","search","query","searchable","searchPlaceholder","searchKeys","searchBy","searchPredicate","searchModel","queryModel","filter","actions","actionsLabel","emptyText","loadingText","onRowClick","onRowDblClick","tableClass","tableStyle","cardClass","dense","striped","hover","stickyHeader","toolbar","toolbarStart","toolbarEnd","caption","footer","status","rowClass","rowAttrs","minTableWidth","hideHeader","hideFooter","hideStatus","slots","body"]);be.class=Z(["cms-table-card",e.class,e.cardClass]),e.dense!=null&&(be.dense=e.dense);const re=_.div({class:"cms-table-shell"}),ue=T(s,"default",{},n);ue.length&&re.appendChild(_.div({class:"cms-table-lead"},...ue));const O=T(s,"toolbarStart",{},e.toolbarStart),Y=T(s,"toolbar",{},e.toolbar),oe=T(s,"toolbarEnd",{},e.toolbarEnd),we=_.div({class:"cms-table-toolbar"}),R=_.div({class:"cms-table-toolbar-main"}),h=_.div({class:"cms-table-toolbar-side"});O.forEach(We=>R.appendChild(We)),Y.forEach(We=>R.appendChild(We));const m=T(s,"search",{query:B(),getQuery:B,setQuery:he},null);if(m.length)m.forEach(We=>h.appendChild(We));else if(b){le=_.input({type:"search",class:"cms-input",placeholder:typeof e.searchable=="string"?e.searchable:e.searchPlaceholder||"Cerca nella tabella",value:String(B()||"")}),le.addEventListener("input",()=>he(le.value));const We=Ae.Btn({class:"cms-table-search-clear",outline:!0,onClick:()=>{le&&(le.value=""),he("")}},"Reset");h.appendChild(_.div({class:"cms-singularity cms-table-search"},_.span({class:"cms-table-search-icon","aria-hidden":"true"},"\u2315"),le,We))}oe.forEach(We=>h.appendChild(We)),(R.childNodes.length||h.childNodes.length)&&(we.appendChild(R),we.appendChild(h),re.appendChild(we));const y=_.div({class:"cms-singularity cms-table-chip"},""),j=_.div({class:"cms-singularity cms-table-chip"},""),X=_.div({class:"cms-singularity cms-table-chip"},""),d=T(s,"status",{},e.status),k=_.div({class:"cms-table-status"},y,j,X,...d);e.hideStatus!==!0&&re.appendChild(k);const g=T(s,"caption",{},e.caption);g.length&&re.appendChild(_.div({class:"cms-table-caption"},...g));const P=_.thead(),K=_.tbody(),ee=!!e.actions||!!s.actions,Ce=Z(["cms-table",ye(e.dense,"dense"),ye(e.striped,"striped"),ye(e.hover!==!1,"hover"),ye(e.stickyHeader!==!1,"sticky-head"),e.tableClass]),E={...e.tableStyle||{}};e.minTableWidth!=null&&(E["--cms-table-min-width"]=gt(e.minTableWidth));const p=_.table({class:Ce,style:E},P,K),A=_.div({class:"cms-singularity cms-table-wrap"},p);re.appendChild(A);const L=_.div({class:"cms-singularity cms-table-chip"},""),ae=_.div({class:"cms-singularity cms-table-chip"},""),ke=Ae.Btn({outline:!0,onClick:()=>C(Math.max(1,N()-1))},"\u2039"),Te=Ae.Btn({outline:!0,onClick:()=>C(N()+1)},"\u203A"),ze=_.div({class:"cms-singularity cms-table-chip"},""),V=_.select({class:"cms-input cms-table-size-select"},...u.map(We=>xs({value:String(We)},String(We))));V.value=String(z()),V.addEventListener("change",()=>q(V.value));const H=T(s,"footer",{},e.footer),te=_.div({class:"cms-table-foot"},_.div({class:"cms-table-foot-main"},L,ae,_.label({class:"cms-table-size"},_.span("Righe"),V)),_.div({class:"cms-table-foot-extra"},...H,_.div({class:"cms-table-pager"},ke,ze,Te)));e.hideFooter!==!0&&re.appendChild(te);const De=()=>{if(P.innerHTML="",e.hideHeader)return;const We=_.tr();if(i.forEach((w,ie)=>{var Se,Oe;const $e={col:w,colIndex:ie,sort:W()},F={...Co(w==null?void 0:w.style,{...$e,header:!0}),...Co((Se=w==null?void 0:w.headerStyle)!=null?Se:w==null?void 0:w.thStyle,{...$e,header:!0})};(w==null?void 0:w.width)!=null&&(F.width=gt(w.width)),(w==null?void 0:w.minWidth)!=null&&(F.minWidth=gt(w.minWidth)),(w==null?void 0:w.maxWidth)!=null&&(F.maxWidth=gt(w.maxWidth)),w!=null&&w.align&&(F.textAlign=w.align);let f=T(w==null?void 0:w.slots,"header",$e,null);if(!f.length){const at=typeof(w==null?void 0:w.header)=="function"?w.header($e):(Oe=w==null?void 0:w.header)!=null?Oe:ci(w);f=T(s,"header",$e,at)}const r=W(),x=Do(w,ie),de=(w==null?void 0:w.sortable)!==!1&&((w==null?void 0:w.key)!=null||typeof(w==null?void 0:w.get)=="function"||typeof(w==null?void 0:w.compare)=="function"),Be=!!r&&(r.key===x||r.key===(w==null?void 0:w.key)),He=_.th({class:Z(["cms-table-head-cell",ye(w==null?void 0:w.nowrap,"is-nowrap"),ye(de,"cms-table-sortable"),ye(Be,"is-sorted"),w==null?void 0:w.headerClass]),style:F});de?He.appendChild(_.button({type:"button",class:"cms-table-head-button",onClick:()=>se(w,ie)},_.span({class:"cms-table-head-label"},...f),_.span({class:"cms-table-head-arrow","aria-hidden":"true"},Be?r.dir==="asc"?"\u2191":"\u2193":"\u2195"))):f.forEach(at=>He.appendChild(at)),We.appendChild(He)}),ee){const w=T(s,"actionsHeader",{},e.actionsLabel||"Azioni");We.appendChild(_.th({class:"cms-table-head-cell cms-table-head-actions",style:{textAlign:"right"}},...w))}P.appendChild(We)},je=(We,w)=>{const ie={columns:i,count:i.length},$e=T(s,We,ie,w),F=String(i.length+(ee?1:0));K.appendChild(_.tr(_.td({colSpan:F,class:"cms-table-state"},...$e)))},_e=bt.reactive.effect(()=>{const We=nl(e.rows),w=String(B()||"").trim(),ie=W(),$e=typeof e.loading=="function"?!!e.loading():!!e.loading,F=e.pagination!==!1;if(De(),K.innerHTML="",le&&le.value!==B()&&(le.value=B()),V.value!==String(z())&&(V.value=String(z())),$e){y.textContent="Caricamento in corso",j.style.display="none",X.style.display="none",L.textContent="Loading\u2026",ae.textContent="",ze.textContent="Pagina 1",ke.disabled=!0,Te.disabled=!0,je("loading",e.loadingText||"Loading...");return}let f=We.slice();const r=f.length;if(typeof e.filter=="function"&&(f=f.filter((nt,Ze)=>e.filter(nt,{row:nt,index:Ze,query:w,rows:We,columns:i}))),w&&(f=f.filter(nt=>ol(nt,i,w,e))),ie){const nt=ui(i,ie.key);nt&&f.sort((Ze,wt)=>{const Nt=So(nt,Ze,-1),Et=So(nt,wt,-1),Rt=typeof nt.compare=="function"?nt.compare(Nt,Et,Ze,wt):tl(Nt,Et);return ie.dir==="asc"?Rt:-Rt})}const x=f.length,de=Math.max(1,Number(z())||S),Be=F?Math.max(1,Math.ceil(x/de)):1,He=F?Math.min(N(),Be):1;He!==N()&&C(He);const Se=F?(He-1)*de:0,Oe=F?Se+de:x,at=f.slice(Se,Oe);if(y.textContent=x===r?`${x} righe`:`${x} di ${r} righe`,j.textContent=w?`Ricerca: ${w}`:"",j.style.display=w?"":"none",ie){const nt=ui(i,ie.key);X.textContent=nt?`Ordine: ${ci(nt)} ${ie.dir==="asc"?"\u2191":"\u2193"}`:"",X.style.display=nt?"":"none"}else X.style.display="none";if(L.textContent=x?`${Se+1}-${Math.min(Oe,x)} di ${x}`:"0 risultati",ae.textContent=x!==r?`Dataset totale ${r}`:`Page size ${de}`,ze.textContent=F?`Pagina ${He} / ${Be}`:"Tutte le righe",ke.disabled=!F||He<=1,Te.disabled=!F||He>=Be,V.disabled=!F,V.parentNode.style.display=F?"":"none",at.length===0){je("empty",e.emptyText||"Nessun dato");return}for(let nt=0;nt<at.length;nt++){const Ze=at[nt],wt=Se+nt,Nt={row:Ze,rowIndex:wt,pageIndex:nt},Et=typeof e.rowAttrs=="function"?e.rowAttrs(Ze,Nt)||{}:e.rowAttrs||{},Rt=typeof e.rowClass=="function"?e.rowClass(Ze,Nt):e.rowClass,Mt=!!(e.onRowClick||e.onRowDblClick),vt=_.tr({...Et,class:Z(["cms-table-row",Rt,Et.class,ye(Mt,"is-clickable")])});if(e.rowKey){const ft=typeof e.rowKey=="function"?e.rowKey(Ze,Nt):Fo(Ze,e.rowKey);ft!=null&&(vt.dataset.key=String(ft))}const Dt=ft=>{const Ht=ft==null?void 0:ft.target;return!!(Ht&&Ht.closest&&Ht.closest("button, a, input, select, textarea, label, [data-table-action]"))};if(e.onRowClick&&vt.addEventListener("click",ft=>{Dt(ft)||e.onRowClick(Ze,Nt,ft)}),e.onRowDblClick&&vt.addEventListener("dblclick",ft=>{Dt(ft)||e.onRowDblClick(Ze,Nt,ft)}),i.forEach((ft,Ht)=>{var Zt,pn;const qt=So(ft,Ze,wt),Xt={...Nt,col:ft,colIndex:Ht,value:qt},Ot={...Co(ft==null?void 0:ft.style,Xt),...Co((Zt=ft==null?void 0:ft.cellStyle)!=null?Zt:ft==null?void 0:ft.tdStyle,Xt)};ft!=null&&ft.align&&(Ot.textAlign=ft.align),(ft==null?void 0:ft.width)!=null&&(Ot.width=gt(ft.width)),(ft==null?void 0:ft.minWidth)!=null&&(Ot.minWidth=gt(ft.minWidth)),(ft==null?void 0:ft.maxWidth)!=null&&(Ot.maxWidth=gt(ft.maxWidth));const Qt=typeof(ft==null?void 0:ft.cellClass)=="function"?ft.cellClass(Ze,Xt):(ft==null?void 0:ft.cellClass)||(ft==null?void 0:ft.class),cn=_.td({class:Z(["cms-table-cell",Qt,ye(ft==null?void 0:ft.nowrap,"is-nowrap")]),style:Ot});let un=T(ft==null?void 0:ft.slots,"cell",Xt,null);if(!un.length){const en=typeof(ft==null?void 0:ft.render)=="function"?ft.render(Ze,Xt):typeof(ft==null?void 0:ft.format)=="function"?ft.format(qt,Ze,Xt):qt,rn=en==null?(pn=ft==null?void 0:ft.emptyText)!=null?pn:"":en;un=T(s,"cell",Xt,rn)}un.length||(un=[""]),un.forEach(en=>cn.appendChild(en)),vt.appendChild(cn)}),ee){const ft={...Nt},Ht=typeof e.actions=="function"?e.actions(Ze,Nt):e.actions;let qt=T(s,"actions",ft,Ht);qt.length||(qt=T(null,"default",ft,Ht)),vt.appendChild(_.td({class:"cms-table-cell cms-table-cell-actions",style:{textAlign:"right"}},_.div({class:"cms-table-actions"},...qt)))}K.appendChild(vt)}},"UI.Table:render");be.body=re;const Me=Ae.Card(be);return JSswift._registerCleanup(Me,_e),fe&&JSswift._registerCleanup(Me,fe),Me},Ae.Menu=(...t)=>{const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=["primary","secondary","warning","danger","success","info","light","dark"],c=["xs","sm","md","lg","xl"];let S={...e},u=null,a=null,b=null,M=null,N=null;const C=(p,A)=>Object.prototype.hasOwnProperty.call(p||{},A),z=(p,A)=>typeof p=="function"?p(A):p,U=p=>String(p||"").split(/\s+/).filter(Boolean),W=p=>p&&typeof p=="object"&&!p.nodeType&&!Array.isArray(p)&&!(p instanceof Function),ge=p=>!!p&&typeof p=="object"&&(p.nodeType===1||typeof p.getBoundingClientRect=="function"),B=()=>{clearTimeout(M),clearTimeout(N),M=null,N=null},ne=(p,A,L)=>{if(!p)return;const ae=p[A]||[];ae.length&&p.classList.remove(...ae);const ke=(L||[]).filter(Boolean);ke.length&&p.classList.add(...ke),p[A]=ke},he=(p,A,L,ae=ke=>ke)=>{if(p){if(L==null||L===""){p.style.removeProperty(A);return}p.style.setProperty(A,ae(L))}},q=()=>S||{},se=p=>{var L;const A=String(o((L=p.state)!=null?L:p.color)||"").toLowerCase();return i.includes(A)?A:""},le=p=>{const A=String(o(p.size)||"").toLowerCase();return c.includes(A)?A:""},fe=p=>{var A,L;return String(o((L=(A=p.placement)!=null?A:p.position)!=null?L:"bottom-start"))},be=()=>{var L;const p=o((L=q().delay)!=null?L:q().showDelay),A=Number(p);return Number.isFinite(A)?Math.max(0,A):0},re=()=>{const p=o(q().hideDelay),A=Number(p);return Number.isFinite(A)?Math.max(0,A):80},ue=(p=null)=>{var L,ae,ke;if(p)return p;const A=q();return a||o((ke=(ae=(L=A.anchorEl)!=null?L:A.triggerEl)!=null?ae:A.target)!=null?ke:A.anchor)||null},O=p=>{if(p==null||p===!0)return new Set(["click"]);if(p===!1)return new Set(["manual"]);const A=Array.isArray(p)?p:String(p).split(/[\s,|/]+/),L=new Set;return A.forEach(ae=>{const ke=String(ae||"").trim().toLowerCase();ke&&(ke==="mouseenter"||ke==="mouseover"?L.add("hover"):ke==="blur"||ke==="focusin"?L.add("focus"):ke==="tap"?L.add("click"):L.add(ke))}),L.size?L:new Set(["manual"])},Y=(p,A)=>{var ke,Te,ze;let L=null,ae=null;if(ge(p))L=p,W(A)&&(ae=A);else if(W(p)){ae=p;const V=(ze=(Te=(ke=p.anchorEl)!=null?ke:p.triggerEl)!=null?Te:p.target)!=null?ze:p.anchor;ge(V)&&(L=V)}else p!=null&&(L=p);return{anchorEl:L,nextProps:ae}},oe=(p=u==null?void 0:u.panel)=>{var A;return Array.from(((A=p==null?void 0:p.querySelectorAll)==null?void 0:A.call(p,"[data-menu-item]:not([disabled]):not([tabindex='-1']), .cms-menu-item:not([disabled]):not([tabindex='-1']), [role='menuitem']:not([disabled]):not([tabindex='-1']), a[href]:not([tabindex='-1']), button:not([disabled]):not([tabindex='-1'])"))||[]).filter(L=>L.offsetParent!==null&&L.getAttribute("aria-hidden")!=="true")},we=()=>{o(q().autoFocus)!==!1&&setTimeout(()=>{const p=oe();if(!p.length)return;(p.find(L=>L.classList.contains("is-active")||L.classList.contains("is-selected")||L.classList.contains("is-checked"))||p[0]).focus()},0)},R=(p,A,L="sm")=>{const ae=z(p,A);return ae==null?[]:typeof ae=="string"?[Ae.Icon({name:ae,size:L})]:Vs(ae,{...A,as:"icon"})},h=(p,A)=>{var de,Be,He,Se,Oe,at,nt,Ze,wt,Nt,Et,Rt,Mt;const L=z(p,A);if(L==null||L===!1)return[];if(Array.isArray(L))return L.flatMap((vt,Dt)=>h(vt,{...A,index:Dt}));if(typeof L=="function")return h(L(A),A);if(L!=null&&L.nodeType)return[L];if(typeof L=="string"||typeof L=="number")return h({label:L},A);if(!W(L))return Vs(L,{...A,as:"item"});const ae=String((Be=(de=L.type)!=null?de:L.kind)!=null?Be:"").toLowerCase();if(ae==="separator"||ae==="divider"||L.separator===!0||L.divider===!0)return[_.div({class:"cms-menu-divider",role:"separator"})];const ke=(He=L.items)!=null?He:L.children;if((ae==="group"||ae==="section"||Array.isArray(ke))&&ke!=null){const vt={...A,item:L},Dt=T(s,"groupLabel",vt,z((Se=L.label)!=null?Se:L.title,vt)),ft=h(ke,vt);return ft.length?[_.div({class:Z(["cms-menu-group",L.class])},Dt.length?_.div({class:"cms-menu-group-label"},...Dt):null,_.div({class:"cms-menu-group-items"},...ft))]:[]}const Te={...A,item:L,close:X,dismiss:X,open:k,toggle:K,update:d,isOpen:ee,entry:()=>u,anchorEl:ue(),props:q()},ze=!!o(L.disabled),V=L.checked==null?null:!!o(L.checked),H=!!o((Oe=L.active)!=null?Oe:L.selected),te=se(L),De=o(L.href),je=o(L.to),_e=C(L,"closeOnSelect")?!!o(L.closeOnSelect):L.keepOpen===!0?!1:q().closeOnSelect!==!1,Me=L.role||(V!=null?"menuitemcheckbox":"menuitem"),Ie=R(L.icon,Te),Ye=R((at=L.iconRight)!=null?at:L.endIcon,Te),rt=T(s,"itemTitle",Te,z((nt=L.title)!=null?nt:L.label,Te)),Xe=T(s,"itemSubtitle",Te,z((Ze=L.subtitle)!=null?Ze:L.description,Te)),We=T(s,"itemShortcut",Te,z(L.shortcut,Te)),w=T(s,"itemBadge",Te,z(L.badge,Te)),ie=T(s,"item",Te,z((Nt=(wt=L.content)!=null?wt:L.body)!=null?Nt:L.render,Te)),$e=[...w,...We,...V===!0&&!Ye.length&&!w.length?[_.span({class:"cms-menu-entry-check"},Ae.Icon({name:L.checkedIcon||"check",size:"sm"}))]:[],...Ye],f={class:Z(["cms-menu-entry","cms-menu-item",te?`cms-state-${te}`:"",ye(H,"is-active"),ye(V===!0,"is-checked"),ye(ze,"is-disabled"),L.class]),role:Me,tabIndex:ze?-1:(Et=L.tabIndex)!=null?Et:-1,"data-menu-item":!0,"data-menu-select":_e?"true":"false","data-menu-close":L.close===!0?"true":null,"data-menu-keep-open":_e?null:"true","aria-disabled":ze?"true":null,"aria-checked":V==null?null:String(V),title:(Mt=(Rt=L.titleAttr)!=null?Rt:L.tooltip)!=null?Mt:null,type:De?null:"button",href:De||null,target:L.target||null,rel:L.rel||(L.target==="_blank"?"noopener noreferrer":null),onClick:vt=>{var ft,Ht,qt,Xt;if(ze){vt.preventDefault(),vt.stopPropagation();return}(Ht=(ft=q()).onItemClick)==null||Ht.call(ft,L,Te,vt);const Dt=(qt=L.onClick)==null?void 0:qt.call(L,Te,vt);vt.defaultPrevented||(je&&((Xt=JSswift.router)!=null&&Xt.navigate)&&(vt.preventDefault(),JSswift.router.navigate(je)),Dt!==!1&&_e&&X())}};L.attrs&&typeof L.attrs=="object"&&Object.assign(f,L.attrs);const r=De?_.a:_.button,x=ie.length?ie:[rt.length?_.div({class:"cms-menu-entry-title"},...rt):null,Xe.length?_.div({class:"cms-menu-entry-subtitle"},...Xe):null].filter(Boolean);return[r(f,Ie.length?_.span({class:"cms-menu-entry-icon"},...Ie):null,_.span({class:"cms-menu-entry-main"},...x),$e.length?_.span({class:"cms-menu-entry-aside"},...$e):null)]},m=()=>{var rt,Xe,We,w,ie,$e,F;const p=q(),A={close:X,dismiss:X,open:k,toggle:K,update:d,isOpen:ee,entry:()=>u,anchorEl:ue(),props:p},L=R(p.icon,A,p.iconSize||"md"),ae=T(s,"eyebrow",A,z(p.eyebrow,A)),ke=T(s,"title",A,z((Xe=(rt=p.title)!=null?rt:p.heading)!=null?Xe:p.label,A)),Te=T(s,"subtitle",A,z((We=p.subtitle)!=null?We:p.description,A)),ze=T(s,"before",A,z(p.before,A)),V=T(s,"header",A,z(p.header,A)),H=T(s,"after",A,z(p.after,A)),te=T(s,"footer",A,z(p.footer,A)),De=T(s,"status",A,z(p.status,A));let je=(w=p.content)!=null?w:p.body;je==null&&n&&n.length&&(je=n);let _e=T(s,"content",A,z(je,A));_e.length||(_e=T(s,"body",A,z(je,A))),_e.length||(_e=T(s,"default",A,z(je,A)));const Me=h(($e=(ie=p.items)!=null?ie:p.actionsList)!=null?$e:p.entries,A),Ie=Me.length?[]:T(s,"empty",A,z((F=p.empty)!=null?F:p.emptyText,A));let Ye=null;return V.length?Ye=_.div({class:Z(["cms-menu-head","cms-menu-head-custom",p.headerClass])},...V):(L.length||ae.length||ke.length||Te.length)&&(Ye=_.div({class:Z(["cms-menu-head",p.headerClass])},L.length?_.div({class:"cms-menu-head-icon"},...L):null,_.div({class:"cms-menu-head-main"},ae.length?_.div({class:"cms-menu-eyebrow"},...ae):null,ke.length?_.div({class:"cms-menu-title"},...ke):null,Te.length?_.div({class:"cms-menu-subtitle"},...Te):null))),_.div({class:Z(["cms-menu","cms-menu-shell",ye(p.dense,"dense"),ye(Me.length>0,"has-items"),ye(te.length>0||De.length>0,"has-footer"),p.class]),style:p.style||{},role:p.role||"menu","aria-label":p.ariaLabel||null},ze.length?_.div({class:"cms-menu-before"},...ze):null,Ye,_e.length?_.div({class:Z(["cms-menu-content",p.contentClass])},..._e):null,Me.length?_.div({class:Z(["cms-menu-items",p.itemsClass])},...Me):null,!Me.length&&Ie.length?_.div({class:"cms-menu-empty"},...Ie):null,H.length?_.div({class:"cms-menu-after"},...H):null,De.length||te.length?_.div({class:Z(["cms-menu-footer",p.footerClass])},De.length?_.div({class:"cms-menu-status"},...De):null,te.length?_.div({class:"cms-menu-footer-actions"},...te):null):null)},y=p=>{var ke;if(!(p!=null&&p.panel))return;const A=q(),L=se(A),ae=le(A);ne(p.panel,"_menuClassTokens",["cms-menu-panel","cms-clear-set","cms-singularity",ae?`cms-menu-${ae}`:"",L?`cms-state-${L}`:"",o(A.outline)?"outline":"",...U(A.panelClass)]),ne(p.overlay,"_menuOverlayClassTokens",[...U(A.overlayClass)]),p.panel.dataset.placement=fe(A),he(p.panel,"--cms-menu-width",o(A.width),gt),he(p.panel,"--cms-menu-min-width",o(A.minWidth),gt),he(p.panel,"--cms-menu-max-width",o(A.maxWidth),gt),he(p.panel,"--cms-menu-max-height",o(A.maxHeight),gt),he(p.panel,"--cms-menu-body-max-height",o((ke=A.bodyMaxHeight)!=null?ke:A.contentMaxHeight),gt),A.panelStyle&&Object.assign(p.panel.style,A.panelStyle),At(p.panel,A)},j=()=>{u!=null&&u.panel&&u.panel.replaceChildren(m())},X=()=>{if(B(),!u)return;const p=u;u=null,ks(p,()=>JSswift.overlay.close(p.id))},d=(p={})=>{var A,L,ae,ke;if(p&&typeof p=="object"&&(S={...S,...p}),u){const Te=q();y(u),j(),(ke=u.reposition)==null||ke.call(u,{anchorEl:u._anchorEl,placement:fe(Te),offsetX:(A=Te.offsetX)!=null?A:0,offsetY:(ae=(L=Te.offsetY)!=null?L:Te.offset)!=null?ae:8}),we()}return E},k=(p=null,A=null)=>{var Ye,rt,Xe,We,w,ie,$e,F,f,r,x,de,Be,He,Se,Oe;B();const{anchorEl:L,nextProps:ae}=Y(p,A);ae&&(S={...S,...ae});const ke=q(),Te=ue(L);if(!Te||o(ke.disabled))return null;if(u&&u._anchorEl===Te){const at=q();return y(u),j(),(We=u.reposition)==null||We.call(u,{anchorEl:u._anchorEl,placement:fe(at),offsetX:(Ye=at.offsetX)!=null?Ye:0,offsetY:(Xe=(rt=at.offsetY)!=null?rt:at.offset)!=null?Xe:8}),we(),u}u&&X(),b=document.activeElement;let ze=null;if(u=JSswift.overlay.open(()=>m(),{type:"menu",anchorEl:Te,placement:fe(ke),offsetX:(w=ke.offsetX)!=null?w:0,offsetY:($e=(ie=ke.offsetY)!=null?ie:ke.offset)!=null?$e:8,backdrop:ke.backdrop===!0,lockScroll:ke.lockScroll===!0,trapFocus:ke.trapFocus===!0,autoFocus:!1,closeOnOutside:ke.closeOnOutside!==!1,closeOnBackdrop:(F=ke.closeOnBackdrop)!=null?F:ke.backdrop===!0,closeOnEsc:ke.closeOnEsc!==!1,className:Kt(["cms-menu-panel"]),onClose:()=>{var at,nt,Ze;(at=ze==null?void 0:ze._menuCleanup)==null||at.call(ze),(Ze=(nt=q()).onClose)==null||Ze.call(nt,ze),q().returnFocus!==!1&&b&&typeof b.focus=="function"&&setTimeout(()=>b.focus(),0)}}),!(u!=null&&u.panel))return u;const V=u;ze=V,V._anchorEl=Te;const H=()=>{clearTimeout(N),N=null},te=()=>{P()},De=at=>{const nt=at.target;if(!nt||!nt.closest)return;if(nt.closest("[data-menu-close]")){X();return}if(q().closeOnSelect===!1)return;const Ze=nt.closest("[data-menu-item], [data-menu-select], .cms-menu-item, [role='menuitem'], [role='menuitemcheckbox'], [role='menuitemradio'], a[href], button:not([disabled])");Ze&&(Ze.closest("[data-menu-keep-open]")||Ze.getAttribute("data-menu-select")!=="false"&&X())},je=at=>{if(at.key==="Escape"){at.preventDefault(),X();return}if(!["ArrowDown","ArrowUp","Home","End"].includes(at.key))return;const nt=oe(V.panel);if(!nt.length)return;at.preventDefault();const Ze=nt.indexOf(document.activeElement);if(at.key==="Home"){nt[0].focus();return}if(at.key==="End"){nt[nt.length-1].focus();return}const wt=at.key==="ArrowDown"?1:-1,Nt=Ze<0?wt>0?0:nt.length-1:(Ze+wt+nt.length)%nt.length;nt[Nt].focus()};V.panel.addEventListener("click",De),V.panel.addEventListener("keydown",je);const _e=O((r=(f=ke.trigger)!=null?f:ke.triggers)!=null?r:C(ke,"open")?"manual":null),Me=_e.has("hover"),Ie=_e.has("focus");return(Me||Ie)&&(V.panel.addEventListener("mouseenter",H),V.panel.addEventListener("mouseleave",te),V.panel.addEventListener("focusin",H),V.panel.addEventListener("focusout",te)),V._menuCleanup=()=>{var at,nt,Ze,wt,Nt,Et;(at=V.panel)==null||at.removeEventListener("click",De),(nt=V.panel)==null||nt.removeEventListener("keydown",je),(Ze=V.panel)==null||Ze.removeEventListener("mouseenter",H),(wt=V.panel)==null||wt.removeEventListener("mouseleave",te),(Nt=V.panel)==null||Nt.removeEventListener("focusin",H),(Et=V.panel)==null||Et.removeEventListener("focusout",te)},y(V),(He=V.reposition)==null||He.call(V,{anchorEl:Te,placement:fe(ke),offsetX:(x=ke.offsetX)!=null?x:0,offsetY:(Be=(de=ke.offsetY)!=null?de:ke.offset)!=null?Be:8}),_s(V),(Oe=(Se=q()).onOpen)==null||Oe.call(Se,V),we(),V},g=(p,A=null)=>{clearTimeout(N),N=null,clearTimeout(M),M=setTimeout(()=>k(p,A),be())},P=(p=!1)=>{if(clearTimeout(M),M=null,!!u){if(clearTimeout(N),p){X();return}N=setTimeout(()=>X(),re())}},K=(p=null,A=null)=>ee()?(X(),null):k(p,A),ee=()=>!!u,E={open:k,close:X,show:g,hide:P,toggle:K,update:d,bind:p=>{var te,De;if(!p)return()=>{};a=p;const A=q(),L=O((De=(te=A.trigger)!=null?te:A.triggers)!=null?De:C(A,"open")?"manual":null),ae=L.has("hover"),ke=L.has("focus"),Te=L.has("click"),ze=L.has("manual")||!ae&&!ke&&!Te,V=[],H=()=>{B(),V.forEach(je=>je()),a===p&&(a=null)};if(C(A,"open"))return Ke(A.open)?JSswift.reactive.effect(()=>{a&&(o(q().open)?k(a):P(!0))},"UI.Menu:open"):A.open===!0?k(p):A.open===!1&&P(!0),H;if(ze||o(A.disabled))return H;if(ae){const je=()=>g(p),_e=()=>P();p.addEventListener("mouseenter",je),p.addEventListener("mouseleave",_e),V.push(()=>{p.removeEventListener("mouseenter",je),p.removeEventListener("mouseleave",_e)})}if(ke){const je=()=>g(p),_e=()=>P();p.addEventListener("focus",je),p.addEventListener("blur",_e),V.push(()=>{p.removeEventListener("focus",je),p.removeEventListener("blur",_e)})}if(Te){const je=_e=>{var Me,Ie;(Ie=(Me=q()).onTriggerClick)==null||Ie.call(Me,_e),!_e.defaultPrevented&&K(p)};p.addEventListener("click",je),V.push(()=>p.removeEventListener("click",je))}return H},isOpen:ee,entry:()=>u,props:()=>({...S})};return E},Ae.Popover=(...t)=>{const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=["primary","secondary","warning","danger","success","info","light","dark"],c=["xs","sm","md","lg","xl"];let S={...e},u=null,a=null,b=null,M=null,N=null;const C=(E,p)=>Object.prototype.hasOwnProperty.call(E||{},p),z=(E,p)=>typeof E=="function"?E(p):E,U=E=>String(E||"").split(/\s+/).filter(Boolean),W=E=>E&&typeof E=="object"&&!E.nodeType&&!Array.isArray(E)&&!(E instanceof Function),ge=E=>!!E&&typeof E=="object"&&(E.nodeType===1||typeof E.getBoundingClientRect=="function"),B=()=>{clearTimeout(M),clearTimeout(N),M=null,N=null},ne=(E,p,A)=>{if(!E)return;const L=E[p]||[];L.length&&E.classList.remove(...L);const ae=(A||[]).filter(Boolean);ae.length&&E.classList.add(...ae),E[p]=ae},he=(E,p,A,L=ae=>ae)=>{if(E){if(A==null||A===""){E.style.removeProperty(p);return}E.style.setProperty(p,L(A))}},q=()=>S,se=E=>{var A;const p=o((A=E.state)!=null?A:E.color);return p?i.includes(p)?p:String(p):""},le=E=>{const p=o(E.size);return typeof p=="string"&&c.includes(p)?p:""},fe=E=>{var A,L,ae;const p=String(o((ae=(L=(A=E.actionsAlign)!=null?A:E.footerAlign)!=null?L:E.alignActions)!=null?ae:"end")).toLowerCase();return["start","left"].includes(p)?"start":["center","middle"].includes(p)?"center":["between","space-between"].includes(p)?"between":["stretch","full"].includes(p)?"stretch":"end"},be=E=>{var p,A;return String(o((A=(p=E.placement)!=null?p:E.position)!=null?A:"bottom-start"))},re=(E,p)=>{const A=o(E);if(A==null||A==="")return p;const L=Number(A);return Number.isFinite(L)?L:p},ue=()=>re(q().delay,0),O=()=>re(q().hideDelay,120),Y=E=>{var A,L;return((L=(A=E.closable)!=null?A:E.dismissible)!=null?L:E.closeButton)===!0},oe=(E=null)=>{var A,L,ae;if(E)return E;const p=q();return a||o((ae=(L=(A=p.anchorEl)!=null?A:p.triggerEl)!=null?L:p.target)!=null?ae:p.anchor)||null},we=E=>{if(E==null||E===!0)return new Set(["click"]);if(E===!1)return new Set(["manual"]);const p=Array.isArray(E)?E:String(E).split(/[\s,|/]+/),A=new Set;return p.forEach(L=>{const ae=String(L||"").trim().toLowerCase();ae&&(ae==="mouseenter"||ae==="mouseover"?A.add("hover"):ae==="blur"||ae==="focusin"?A.add("focus"):ae==="tap"?A.add("click"):A.add(ae))}),A.size?A:new Set(["manual"])},R=(E,p)=>{var ae,ke,Te;let A=null,L=null;if(ge(E))A=E,W(p)&&(L=p);else if(W(E)){L=E;const ze=(Te=(ke=(ae=E.anchorEl)!=null?ae:E.triggerEl)!=null?ke:E.target)!=null?Te:E.anchor;ge(ze)&&(A=ze)}else E!=null&&(A=E);return{anchorEl:A,nextProps:L}},h=()=>{var Ie,Ye,rt,Xe,We,w,ie,$e,F;const E=q(),p={close:j,dismiss:j,open:d,toggle:P,update:X,isOpen:K,entry:()=>u,anchorEl:oe(),props:E},A=E.icon!=null?typeof E.icon=="string"?Ae.Icon({name:E.icon,size:E.iconSize||"md"}):JSswift.ui.slot(E.icon,{as:"icon"}):null,L=T(s,"eyebrow",p,z(E.eyebrow,p)),ae=T(s,"title",p,z((Ye=(Ie=E.title)!=null?Ie:E.heading)!=null?Ye:E.label,p)),ke=T(s,"subtitle",p,z((rt=E.subtitle)!=null?rt:E.description,p)),Te=T(s,"icon",p,A),ze=T(s,"header",p,z((We=(Xe=E.headerContent)!=null?Xe:E.head)!=null?We:E.header,p)),V=Y(E)?T(s,"close",p,Ae.Btn({class:"cms-dialog-close",size:"sm",outline:!0,"aria-label":E.closeLabel||"Chiudi popover","data-popover-close":!0},Ae.Icon({name:E.closeIcon||"close",size:"sm"}))):[];let H=($e=(ie=(w=E.content)!=null?w:E.body)!=null?ie:E.message)!=null?$e:E.text;H==null&&n&&n.length&&(H=n);let te=T(s,"content",p,z(H,p));te.length||(te=T(s,"body",p,z(H,p))),te.length||(te=T(s,"default",p,z(H,p)));const De=z((F=E.footer)!=null?F:E.actions,p);let je=T(s,"footer",p,De);je.length||(je=T(s,"actions",p,De));let _e=null;ze.length?_e=_.div({class:"cms-dialog-head cms-dialog-head-custom"},...ze):(L.length||ae.length||ke.length||Te.length||V.length)&&(_e=_.div({class:"cms-dialog-head"},Te.length?_.div({class:"cms-dialog-icon"},...Te):null,_.div({class:"cms-dialog-head-main"},L.length?_.div({class:"cms-dialog-eyebrow"},...L):null,ae.length?_.div({class:"cms-dialog-title"},...ae):null,ke.length?_.div({class:"cms-dialog-subtitle"},...ke):null),V.length?_.div({class:"cms-dialog-close-wrap"},...V):null));const Me=[];return _e&&Me.push(_e),te.length&&Me.push(_.div({class:Z(["cms-dialog-body",E.bodyClass])},...te)),je.length&&Me.push(_.div({class:Z(["cms-dialog-actions",`is-${fe(E)}`,ye(E.stackActions,"is-stacked"),E.actionsClass,E.footerClass])},...je)),Me.length||Me.push(_.div({class:Z(["cms-dialog-body",E.bodyClass])})),_.div({class:Z(["cms-dialog-shell","cms-popover-shell",ye(!!_e,"has-head"),ye(je.length>0,"has-footer"),ye(E.divider!==!1,"with-divider")])},...Me)},m=E=>{var ae;if(!(E!=null&&E.panel))return;const p=q(),A=se(p),L=le(p);ne(E.panel,"_popoverClassTokens",["cms-dialog","cms-popover","cms-singularity","cms-clear-set",L?`cms-dialog-${L}`:"",A,A?`cms-state-${A}`:"",o(p.scrollable)?"scrollable":"",o(p.stickyHeader)?"sticky-head":"",o(p.stickyActions)?"sticky-actions":"",o(p.borderless)?"borderless":"",...U(p.class),...U(p.panelClass)]),ne(E.overlay,"_popoverOverlayClassTokens",[...U(p.overlayClass)]),E.panel.dataset.placement=be(p),he(E.panel,"--cms-dialog-width",o(p.width),gt),he(E.panel,"--cms-dialog-min-width",o(p.minWidth),gt),he(E.panel,"--cms-dialog-max-width",o(p.maxWidth),gt),he(E.panel,"--cms-dialog-max-height",o(p.maxHeight),gt),he(E.panel,"--cms-dialog-body-max-height",o((ae=p.bodyMaxHeight)!=null?ae:p.contentMaxHeight),gt),p.style&&Object.assign(E.panel.style,p.style),At(E.panel,p),E.panel.setAttribute("role",p.role||"dialog"),E.panel.setAttribute("aria-modal",p.modal===!0?"true":"false"),p.ariaLabel?E.panel.setAttribute("aria-label",p.ariaLabel):E.panel.removeAttribute("aria-label")},y=()=>{u!=null&&u.panel&&u.panel.replaceChildren(h())},j=()=>{if(B(),!u)return;const E=u;u=null,ks(E,()=>JSswift.overlay.close(E.id))},X=(E={})=>(E&&typeof E=="object"&&(S={...S,...E}),u&&(m(u),y()),Ce),d=(E=null,p=null)=>{var Me,Ie,Ye,rt,Xe,We,w,ie;B();const{anchorEl:A,nextProps:L}=R(E,p);L&&(S={...S,...L});const ae=q(),ke=oe(A);if(!ke||o(ae.disabled))return null;if(u&&u._anchorEl===ke)return m(u),y(),u;u&&j(),b=document.activeElement;const Te=we((Ie=(Me=ae.trigger)!=null?Me:ae.triggers)!=null?Ie:C(ae,"open")?"manual":null),ze=Te.has("hover"),V=Te.has("focus");let H=null;if(u=JSswift.overlay.open(()=>h(),{type:"popover",anchorEl:ke,placement:be(ae),offsetX:(Ye=ae.offsetX)!=null?Ye:0,offsetY:(Xe=(rt=ae.offsetY)!=null?rt:ae.offset)!=null?Xe:10,backdrop:ae.backdrop===!0,lockScroll:ae.lockScroll===!0,trapFocus:ae.trapFocus===!0,autoFocus:ae.autoFocus===!0,closeOnOutside:ae.closeOnOutside!==!1,closeOnBackdrop:(We=ae.closeOnBackdrop)!=null?We:ae.backdrop===!0,closeOnEsc:ae.closeOnEsc!==!1,className:Kt(["cms-dialog","cms-popover"]),onClose:()=>{var $e,F,f;($e=H==null?void 0:H._popoverCleanup)==null||$e.call(H),(f=(F=q()).onClose)==null||f.call(F,H),q().returnFocus!==!1&&b&&typeof b.focus=="function"&&setTimeout(()=>b.focus(),0)}}),!(u!=null&&u.panel))return u;const te=u;H=te,te._anchorEl=ke;const De=()=>{clearTimeout(N),N=null},je=()=>{!ze&&!V||g()},_e=$e=>{const F=$e.target;if(!(!F||!F.closest)){if(F.closest("[data-popover-close]")||F.closest("[data-dialog-close]")){j();return}q().closeOnSelect===!0&&F.closest("[data-popover-select]")&&j()}};return te.panel.addEventListener("click",_e),(ze||V)&&(te.panel.addEventListener("mouseenter",De),te.panel.addEventListener("mouseleave",je),te.panel.addEventListener("focusin",De),te.panel.addEventListener("focusout",je)),te._popoverCleanup=()=>{var $e,F,f,r,x;($e=te.panel)==null||$e.removeEventListener("click",_e),(F=te.panel)==null||F.removeEventListener("mouseenter",De),(f=te.panel)==null||f.removeEventListener("mouseleave",je),(r=te.panel)==null||r.removeEventListener("focusin",De),(x=te.panel)==null||x.removeEventListener("focusout",je)},m(te),_s(te),(ie=(w=q()).onOpen)==null||ie.call(w,te),te},k=(E,p=null)=>{clearTimeout(N),N=null,clearTimeout(M),M=setTimeout(()=>d(E,p),ue())},g=(E=!1)=>{if(clearTimeout(M),M=null,!!u){if(clearTimeout(N),E){j();return}N=setTimeout(()=>j(),O())}},P=(E=null,p=null)=>K()?(j(),null):d(E,p),K=()=>!!u,Ce={open:d,close:j,show:k,hide:g,toggle:P,update:X,bind:E=>{var H,te;if(!E)return()=>{};a=E;const p=q(),A=we((te=(H=p.trigger)!=null?H:p.triggers)!=null?te:C(p,"open")?"manual":null),L=A.has("hover"),ae=A.has("focus"),ke=A.has("click"),Te=A.has("manual")||!L&&!ae&&!ke,ze=[],V=()=>{B(),ze.forEach(De=>De()),a===E&&(a=null)};if(C(p,"open"))return Ke(p.open)?JSswift.reactive.effect(()=>{a&&(o(q().open)?d(a):g(!0))},"UI.Popover:open"):p.open===!0?d(E):p.open===!1&&g(!0),V;if(Te||o(p.disabled))return V;if(L){const De=()=>k(E),je=()=>g();E.addEventListener("mouseenter",De),E.addEventListener("mouseleave",je),ze.push(()=>{E.removeEventListener("mouseenter",De),E.removeEventListener("mouseleave",je)})}if(ae){const De=()=>k(E),je=()=>g();E.addEventListener("focus",De),E.addEventListener("blur",je),ze.push(()=>{E.removeEventListener("focus",De),E.removeEventListener("blur",je)})}if(ke){const De=je=>{var _e,Me;(Me=(_e=q()).onTriggerClick)==null||Me.call(_e,je),!je.defaultPrevented&&P(E)};E.addEventListener("click",De),ze.push(()=>E.removeEventListener("click",De))}return V},isOpen:K,entry:()=>u,props:()=>({...S})};return Ce},Ae.ContextMenu=(...t)=>{const{props:e,children:n}=JSswift.uiNormalizeArgs(t);let s={...e},i=null,c=null,S=null;const u=y=>y&&typeof y=="object"&&!y.nodeType&&!Array.isArray(y)&&!(y instanceof Function),a=y=>!!y&&typeof y=="object"&&(y.nodeType===1||typeof y.getBoundingClientRect=="function"),b=y=>!!y&&typeof y=="object"&&("clientX"in y||"type"in y||"target"in y||"currentTarget"in y),M=y=>!!y&&Number.isFinite(Number(y.x))&&Number.isFinite(Number(y.y)),N=()=>s,C=(y,j)=>{const X=Number(y),d=Number(j);return!Number.isFinite(X)||!Number.isFinite(d)?null:{x:X,y:d}},z=y=>y?{_cmsContextPoint:y,getBoundingClientRect:()=>({top:y.y,bottom:y.y,left:y.x,right:y.x,width:0,height:0})}:null,U=y=>{if(!a(y))return null;const j=y.getBoundingClientRect();return C(j.left+Math.min(j.width/2,24),j.top+Math.min(j.height/2,24))},W=y=>{var j,X,d,k;return o((k=(d=(X=(j=y==null?void 0:y.anchorEl)!=null?j:y==null?void 0:y.triggerEl)!=null?X:y==null?void 0:y.target)!=null?d:y==null?void 0:y.anchor)!=null?k:null)},ge=(y,j=null)=>{if(!y)return U(j||S);const X=C(y.clientX,y.clientY);if(X)return X;const d=W({anchorEl:j||y.currentTarget||y.target||S});return U(d)},B=(y={})=>{if(!u(y))return{};const j={...y};return delete j.event,delete j.point,delete j.x,delete j.y,j},ne=()=>{var j,X,d;const y=N();return{...y,trigger:"manual",placement:y.placement||"bottom-start",offsetX:(j=y.offsetX)!=null?j:0,offsetY:(d=(X=y.offsetY)!=null?X:y.offset)!=null?d:4,closeOnOutside:y.closeOnOutside!==!1,closeOnEsc:y.closeOnEsc!==!1,role:y.role||"menu",ariaLabel:y.ariaLabel||y.title||"Context menu",class:Z(["cms-context-menu-shell",y.class]),panelClass:Z(["cms-context-menu-panel",y.panelClass])}},he=Ae.Menu(ne(),...n),q=(y=null,j=null,X=null)=>{let d=null,k=null,g=null;if(b(y))d=ge(y,S),g=u(j)?B(j):null;else if(typeof y=="number"||typeof j=="number")d=C(y,j),g=u(X)?B(X):null;else if(M(y))d=C(y.x,y.y),g=u(j)?B(j):null;else if(a(y))k=y,g=u(j)?B(j):null;else if(u(y)){const P=M(y.point)?y.point:M(y)?y:null,K=W(y),ee=y.event;d=P?C(P.x,P.y):ge(ee,K||S),k=K&&a(K)?K:null,g={...B(y),...u(j)?B(j):{}}}else i&&(d={...i});return{point:d,anchor:k,nextProps:g}},se=(y,j=null)=>{c=y||c,i=j||y&&y._cmsContextPoint||i},le=(y=null)=>{u(y)&&Object.keys(y).length&&(s={...s,...y})},fe=(y=null,j=null)=>{if(j)return z(j);if(y&&a(y))return y;const X=W(N());return a(X)?X:i?z(i):a(c)?c:a(S)?S:null},be=(y=null,j=null,X=null)=>{const{point:d,anchor:k,nextProps:g}=q(y,j,X);le(g);const P=fe(k,d);return P?(se(P,d),he.open(P,ne())):null},re=(y,j,X=null)=>be(y,j,X),ue=(y,j=null)=>be(y,j),O=()=>(he.close(),m),Y=(y=!0)=>(y===!1?he.hide(!1):he.close(),m),oe=(y=null,j=null,X=null)=>be(y,j,X),we=(y=null,j=null,X=null)=>he.isOpen()?(O(),null):be(y,j,X),R=(y={})=>(le(B(y)),he.update(ne()),m),m={open:be,openAt:re,openFromEvent:ue,show:oe,hide:Y,close:O,toggle:we,update:R,bind:(y,j=null)=>{if(!y)return()=>{};const X=u(j)?B(j):null,d=g=>{var K,ee;S=y,g.preventDefault(),!(((ee=(K=N()).onTrigger)==null?void 0:ee.call(K,g,{element:y,open:be,close:O,update:R}))===!1||o(N().disabled))&&be({event:g,anchorEl:y},X)},k=g=>{var K,ee;g.key!=="ContextMenu"&&!(g.shiftKey&&g.key==="F10")||(S=y,g.preventDefault(),((ee=(K=N()).onTrigger)==null?void 0:ee.call(K,g,{element:y,open:be,close:O,update:R}))===!1||o(N().disabled))||be({event:g,anchorEl:y},X)};return y.addEventListener("contextmenu",d),y.addEventListener("keydown",k),()=>{y.removeEventListener("contextmenu",d),y.removeEventListener("keydown",k)}},isOpen:he.isOpen,entry:he.entry,props:()=>({...s})};return m}})(JSswift);
|
|
32
|
+
`,l.appendChild(n);const i=document.createElement("div");i.style.cssText="display:flex; gap: 12px; align-items:center; width: 100%;",i.appendChild(t),i.appendChild(s),e.appendChild(i),e.appendChild(l),hn.appendChild(e),document.body.appendChild(hn);const c=document.createElement("style");return c.textContent=`
|
|
33
|
+
@keyframes jssSpin { to { transform: rotate(360deg); } }
|
|
34
|
+
`,document.head.appendChild(c),hn._textNode=s,hn._spinner=t,hn._progressWrap=l,hn._progressBar=n,hn._progressActive=!1,hn}function uo(e,t){if(typeof e=="object"&&e!==null)return{...e};const s=t&&typeof t=="object"?t:{};return typeof t=="string"&&(e==null||typeof e=="number")?{...s,message:t}:{...s,message:e}}function fo(e,t){const s=t==="progress";e._spinner.style.display=s?"none":"",e._progressWrap.style.display=s?"block":"none",e._mode=t}wt.loading.show=function(e="Loading...",t={}){const s=co(),l=uo(e,t);Hs++,s._progressActive=!1,s._textNode.textContent=l.message||"Loading...",fo(s,"spinner"),l.spinner===!1&&(s._spinner.style.display="none"),s.style.display="flex"},wt.loading.hide=function(){hn&&(Hs=Math.max(0,Hs-1),Hs===0&&(hn.style.display="none",hn._progressActive=!1))},wt.loading.progress=function(e=0,t={}){var s;const l=co();typeof e=="object"&&e!==null&&(t=e,e=(s=e.value)!=null?s:0);const n=uo(null,t);l._progressActive||(Hs++,l._progressActive=!0);const i=Math.max(0,Math.min(100,Number(e!=null?e:0)));l._textNode.textContent=n.message||"Loading...",l._progressBar.style.width=i+"%",fo(l,"progress"),l.style.display="flex"},wt.loading.wrap=async function(e,t){wt.loading.show(e);try{return await t()}finally{wt.loading.hide()}};function Wo(e){return typeof e=="function"?e():e||[]}function Fl(e,t){if(!(e==null||t==null))return typeof t!="string"||t.indexOf(".")<0?e==null?void 0:e[t]:t.split(".").reduce((s,l)=>s==null?s:s[l],e)}function Uo(e,t){return e==null&&t==null?0:e==null?-1:t==null?1:typeof e=="number"&&typeof t=="number"?e-t:String(e).localeCompare(String(t),void 0,{numeric:!0,sensitivity:"base"})}function Go(e){const t=Wo(e);return Array.isArray(t)?t:[]}function po(e){var t,s,l,n;return(n=(l=(s=(t=e==null?void 0:e.label)!=null?t:e==null?void 0:e.title)!=null?s:e==null?void 0:e.header)!=null?l:e==null?void 0:e.key)!=null?n:""}function Dl(e,t){var s,l;return(l=(s=e==null?void 0:e.sortKey)!=null?s:e==null?void 0:e.key)!=null?l:`__col_${t}`}function ho(e,t){return e.find((s,l)=>Dl(s,l)===t||(s==null?void 0:s.key)===t)||null}function yl(e,t,s){return e?typeof e.get=="function"?e.get(t,{row:t,rowIndex:s,col:e}):typeof e.value=="function"?e.value(t,{row:t,rowIndex:s,col:e}):typeof e.key=="string"?Fl(t,e.key):e.key!=null?t==null?void 0:t[e.key]:t:t}function bl(e,t){return typeof e=="function"?e(t)||{}:e||{}}function vl(e){if(e==null)return"";if(typeof e=="string"||typeof e=="number"||typeof e=="boolean")return String(e);if(Array.isArray(e))return e.map(vl).filter(Boolean).join(" ");if(typeof Node!="undefined"&&e instanceof Node)return e.textContent||"";if(typeof e=="object"){if(typeof e.textContent=="string")return e.textContent;try{return JSON.stringify(e)}catch(t){return""}}return String(e)}function Ko(e,t){const l=(Array.isArray(e)?e:t).map(n=>Number(n)).filter(n=>Number.isFinite(n)&&n>0);return l.length?Array.from(new Set(l)):t}function qo(e,t,s,l){const n=l.searchBy||l.searchPredicate;if(typeof n=="function")return!!n(e,{query:s,columns:t});const i=String(s||"").trim().toLowerCase().split(/\s+/).filter(Boolean);if(!i.length)return!0;const c=Array.isArray(l.searchKeys)&&l.searchKeys.length?l.searchKeys:t.filter(r=>(r==null?void 0:r.searchable)!==!1).map(r=>{var z;return(z=r==null?void 0:r.searchKey)!=null?z:r==null?void 0:r.key}).filter(Boolean),a=[];if(c.length)for(const r of c)if(typeof r=="function")a.push(vl(r(e)));else{const z=t.find(d=>(d==null?void 0:d.key)===r||(d==null?void 0:d.searchKey)===r);a.push(vl(z?yl(z,e,-1):Fl(e,r)))}else a.push(vl(e));const v=a.join(" ").toLowerCase();return i.every(r=>v.includes(r))}xe.Table=(...e)=>{var t,s,l,n;const{props:i,children:c}=JSswift.uiNormalizeArgs(e),a=i.slots||{},v=Array.isArray(i.columns)?i.columns:[],r=Ko(i.pageSizeOptions,[5,10,20,50]),z=Number((s=(t=i.pageSize)!=null?t:r[0])!=null?s:10)||10,d=Array.from(new Set([...r,z])).sort((Re,C)=>Re-C),k=i.initialSort||(i.sortBy?{key:i.sortBy,dir:i.sortDir==="desc"?"desc":"asc"}:null),N=i.searchable===!0||typeof i.searchable=="string"||i.searchPlaceholder!=null||i.search!=null||i.query!=null||!!i.searchModel||!!i.queryModel||Array.isArray(i.searchKeys)||typeof i.searchBy=="function"||typeof i.searchPredicate=="function",p=en(i.searchModel||i.queryModel,"UI.Table:query"),[U,w]=wt.reactive.signal(Math.max(1,Number(i.page||1)||1)),[$,B]=wt.reactive.signal(z),[te,E]=wt.reactive.signal(k),[ve,le]=wt.reactive.signal(String((n=p?p.get():(l=i.search)!=null?l:i.query)!=null?n:"")),ie=Re=>{const C=String(Re!=null?Re:"");le(C),p&&p.set(C),w(1)},ge=Re=>{const C=Number(Re)||z;B(C),w(1)},ue=(Re,C)=>{const Se=Dl(Re,C),Fe=te();!Fe||Fe.key!==Se&&Fe.key!==(Re==null?void 0:Re.key)?E({key:Se,dir:"asc"}):Fe.dir==="asc"?E({key:Se,dir:"desc"}):E(null),w(1)};let fe=null,M;p&&(M=p.watch(Re=>{const C=String(Re!=null?Re:"");le(C),fe&&fe.value!==C&&(fe.value=C),w(1)},"UI.Table:queryWatch"));const me=JSswift.omit(i,["columns","rows","rowKey","loading","page","pageSize","pageSizeOptions","pagination","initialSort","sortBy","sortDir","search","query","searchable","searchPlaceholder","searchKeys","searchBy","searchPredicate","searchModel","queryModel","filter","actions","actionsLabel","emptyText","loadingText","onRowClick","onRowDblClick","tableClass","tableStyle","cardClass","dense","striped","hover","stickyHeader","toolbar","toolbarStart","toolbarEnd","caption","footer","status","rowClass","rowAttrs","minTableWidth","hideHeader","hideFooter","hideStatus","slots","body"]);me.class=re(["jss-table-card",i.class,i.cardClass]),i.dense!=null&&(me.dense=i.dense);const be=_.div({class:"jss-table-shell"}),de=D(a,"default",{},c);de.length&&be.appendChild(_.div({class:"jss-table-lead"},...de));const Z=D(a,"toolbarStart",{},i.toolbarStart),j=D(a,"toolbar",{},i.toolbar),I=D(a,"toolbarEnd",{},i.toolbarEnd),y=_.div({class:"jss-table-toolbar"}),P=_.div({class:"jss-table-toolbar-main"}),Q=_.div({class:"jss-table-toolbar-side"});Z.forEach(Re=>P.appendChild(Re)),j.forEach(Re=>P.appendChild(Re));const m=D(a,"search",{query:ve(),getQuery:ve,setQuery:ie},null);if(m.length)m.forEach(Re=>Q.appendChild(Re));else if(N){fe=_.input({type:"search",class:"jss-input",placeholder:typeof i.searchable=="string"?i.searchable:i.searchPlaceholder||"Cerca nella tabella",value:String(ve()||"")}),fe.addEventListener("input",()=>ie(fe.value));const Re=xe.Btn({class:"jss-table-search-clear",outline:!0,onClick:()=>{fe&&(fe.value=""),ie("")}},"Reset");Q.appendChild(_.div({class:"jss-singularity jss-table-search"},_.span({class:"jss-table-search-icon","aria-hidden":"true"},"\u2315"),fe,Re))}I.forEach(Re=>Q.appendChild(Re)),(P.childNodes.length||Q.childNodes.length)&&(y.appendChild(P),y.appendChild(Q),be.appendChild(y));const b=_.div({class:"jss-singularity jss-table-chip"},""),g=_.div({class:"jss-singularity jss-table-chip"},""),T=_.div({class:"jss-singularity jss-table-chip"},""),Y=D(a,"status",{},i.status),K=_.div({class:"jss-table-status"},b,g,T,...Y);i.hideStatus!==!0&&be.appendChild(K);const _e=D(a,"caption",{},i.caption);_e.length&&be.appendChild(_.div({class:"jss-table-caption"},..._e));const J=_.thead(),A=_.tbody(),L=!!i.actions||!!a.actions,O=re(["jss-table",pe(i.dense,"dense"),pe(i.striped,"striped"),pe(i.hover!==!1,"hover"),pe(i.stickyHeader!==!1,"sticky-head"),i.tableClass]),X={...i.tableStyle||{}};i.minTableWidth!=null&&(X["--jss-table-min-width"]=vt(i.minTableWidth));const we=_.table({class:O,style:X},J,A),Be=_.div({class:"jss-singularity jss-table-wrap"},we);be.appendChild(Be);const Ue=_.div({class:"jss-singularity jss-table-chip"},""),H=_.div({class:"jss-singularity jss-table-chip"},""),W=xe.Btn({outline:!0,onClick:()=>w(Math.max(1,U()-1))},"\u2039"),ee=xe.Btn({outline:!0,onClick:()=>w(U()+1)},"\u203A"),Ne=_.div({class:"jss-singularity jss-table-chip"},""),Te=_.select({class:"jss-input jss-table-size-select"},...d.map(Re=>Vs({value:String(Re)},String(Re))));Te.value=String($()),Te.addEventListener("change",()=>ge(Te.value));const oe=D(a,"footer",{},i.footer),Pe=_.div({class:"jss-table-foot"},_.div({class:"jss-table-foot-main"},Ue,H,_.label({class:"jss-table-size"},_.span("Righe"),Te)),_.div({class:"jss-table-foot-extra"},...oe,_.div({class:"jss-table-pager"},W,Ne,ee)));i.hideFooter!==!0&&be.appendChild(Pe);const Ie=()=>{if(J.innerHTML="",i.hideHeader)return;const Re=_.tr();if(v.forEach((C,Se)=>{var Fe,F;const f={col:C,colIndex:Se,sort:te()},h={...bl(C==null?void 0:C.style,{...f,header:!0}),...bl((Fe=C==null?void 0:C.headerStyle)!=null?Fe:C==null?void 0:C.thStyle,{...f,header:!0})};(C==null?void 0:C.width)!=null&&(h.width=vt(C.width)),(C==null?void 0:C.minWidth)!=null&&(h.minWidth=vt(C.minWidth)),(C==null?void 0:C.maxWidth)!=null&&(h.maxWidth=vt(C.maxWidth)),C!=null&&C.align&&(h.textAlign=C.align);let x=D(C==null?void 0:C.slots,"header",f,null);if(!x.length){const We=typeof(C==null?void 0:C.header)=="function"?C.header(f):(F=C==null?void 0:C.header)!=null?F:po(C);x=D(a,"header",f,We)}const ae=te(),Oe=Dl(C,Se),De=(C==null?void 0:C.sortable)!==!1&&((C==null?void 0:C.key)!=null||typeof(C==null?void 0:C.get)=="function"||typeof(C==null?void 0:C.compare)=="function"),Ge=!!ae&&(ae.key===Oe||ae.key===(C==null?void 0:C.key)),Ke=_.th({class:re(["jss-table-head-cell",pe(C==null?void 0:C.nowrap,"is-nowrap"),pe(De,"jss-table-sortable"),pe(Ge,"is-sorted"),C==null?void 0:C.headerClass]),style:h});De?Ke.appendChild(_.button({type:"button",class:"jss-table-head-button",onClick:()=>ue(C,Se)},_.span({class:"jss-table-head-label"},...x),_.span({class:"jss-table-head-arrow","aria-hidden":"true"},Ge?ae.dir==="asc"?"\u2191":"\u2193":"\u2195"))):x.forEach(We=>Ke.appendChild(We)),Re.appendChild(Ke)}),L){const C=D(a,"actionsHeader",{},i.actionsLabel||"Azioni");Re.appendChild(_.th({class:"jss-table-head-cell jss-table-head-actions",style:{textAlign:"right"}},...C))}J.appendChild(Re)},Le=(Re,C)=>{const Se={columns:v,count:v.length},Fe=D(a,Re,Se,C),F=String(v.length+(L?1:0));A.appendChild(_.tr(_.td({colSpan:F,class:"jss-table-state"},...Fe)))},Ye=wt.reactive.effect(()=>{const Re=Go(i.rows),C=String(ve()||"").trim(),Se=te(),Fe=typeof i.loading=="function"?!!i.loading():!!i.loading,F=i.pagination!==!1;if(Ie(),A.innerHTML="",fe&&fe.value!==ve()&&(fe.value=ve()),Te.value!==String($())&&(Te.value=String($())),Fe){b.textContent="Caricamento in corso",g.style.display="none",T.style.display="none",Ue.textContent="Loading\u2026",H.textContent="",Ne.textContent="Pagina 1",W.disabled=!0,ee.disabled=!0,Le("loading",i.loadingText||"Loading...");return}let f=Re.slice();const h=f.length;if(typeof i.filter=="function"&&(f=f.filter((et,tt)=>i.filter(et,{row:et,index:tt,query:C,rows:Re,columns:v}))),C&&(f=f.filter(et=>qo(et,v,C,i))),Se){const et=ho(v,Se.key);et&&f.sort((tt,dt)=>{const gt=yl(et,tt,-1),At=yl(et,dt,-1),It=typeof et.compare=="function"?et.compare(gt,At,tt,dt):Uo(gt,At);return Se.dir==="asc"?It:-It})}const x=f.length,ae=Math.max(1,Number($())||z),Oe=F?Math.max(1,Math.ceil(x/ae)):1,De=F?Math.min(U(),Oe):1;De!==U()&&w(De);const Ge=F?(De-1)*ae:0,Ke=F?Ge+ae:x,We=f.slice(Ge,Ke);if(b.textContent=x===h?`${x} righe`:`${x} di ${h} righe`,g.textContent=C?`Ricerca: ${C}`:"",g.style.display=C?"":"none",Se){const et=ho(v,Se.key);T.textContent=et?`Ordine: ${po(et)} ${Se.dir==="asc"?"\u2191":"\u2193"}`:"",T.style.display=et?"":"none"}else T.style.display="none";if(Ue.textContent=x?`${Ge+1}-${Math.min(Ke,x)} di ${x}`:"0 risultati",H.textContent=x!==h?`Dataset totale ${h}`:`Page size ${ae}`,Ne.textContent=F?`Pagina ${De} / ${Oe}`:"Tutte le righe",W.disabled=!F||De<=1,ee.disabled=!F||De>=Oe,Te.disabled=!F,Te.parentNode.style.display=F?"":"none",We.length===0){Le("empty",i.emptyText||"Nessun dato");return}for(let et=0;et<We.length;et++){const tt=We[et],dt=Ge+et,gt={row:tt,rowIndex:dt,pageIndex:et},At=typeof i.rowAttrs=="function"?i.rowAttrs(tt,gt)||{}:i.rowAttrs||{},It=typeof i.rowClass=="function"?i.rowClass(tt,gt):i.rowClass,$t=!!(i.onRowClick||i.onRowDblClick),zt=_.tr({...At,class:re(["jss-table-row",It,At.class,pe($t,"is-clickable")])});if(i.rowKey){const mt=typeof i.rowKey=="function"?i.rowKey(tt,gt):Fl(tt,i.rowKey);mt!=null&&(zt.dataset.key=String(mt))}const Xe=mt=>{const Nt=mt==null?void 0:mt.target;return!!(Nt&&Nt.closest&&Nt.closest("button, a, input, select, textarea, label, [data-table-action]"))};if(i.onRowClick&&zt.addEventListener("click",mt=>{Xe(mt)||i.onRowClick(tt,gt,mt)}),i.onRowDblClick&&zt.addEventListener("dblclick",mt=>{Xe(mt)||i.onRowDblClick(tt,gt,mt)}),v.forEach((mt,Nt)=>{var Zt,rn;const qt=yl(mt,tt,dt),Yt={...gt,col:mt,colIndex:Nt,value:qt},cn={...bl(mt==null?void 0:mt.style,Yt),...bl((Zt=mt==null?void 0:mt.cellStyle)!=null?Zt:mt==null?void 0:mt.tdStyle,Yt)};mt!=null&&mt.align&&(cn.textAlign=mt.align),(mt==null?void 0:mt.width)!=null&&(cn.width=vt(mt.width)),(mt==null?void 0:mt.minWidth)!=null&&(cn.minWidth=vt(mt.minWidth)),(mt==null?void 0:mt.maxWidth)!=null&&(cn.maxWidth=vt(mt.maxWidth));const Xt=typeof(mt==null?void 0:mt.cellClass)=="function"?mt.cellClass(tt,Yt):(mt==null?void 0:mt.cellClass)||(mt==null?void 0:mt.class),Ut=_.td({class:re(["jss-table-cell",Xt,pe(mt==null?void 0:mt.nowrap,"is-nowrap")]),style:cn});let tn=D(mt==null?void 0:mt.slots,"cell",Yt,null);if(!tn.length){const ln=typeof(mt==null?void 0:mt.render)=="function"?mt.render(tt,Yt):typeof(mt==null?void 0:mt.format)=="function"?mt.format(qt,tt,Yt):qt,Xn=ln==null?(rn=mt==null?void 0:mt.emptyText)!=null?rn:"":ln;tn=D(a,"cell",Yt,Xn)}tn.length||(tn=[""]),tn.forEach(ln=>Ut.appendChild(ln)),zt.appendChild(Ut)}),L){const mt={...gt},Nt=typeof i.actions=="function"?i.actions(tt,gt):i.actions;let Zt=D(a,"actions",mt,Nt);Zt.length||(Zt=D(null,"default",mt,Nt)),zt.appendChild(_.td({class:"jss-table-cell jss-table-cell-actions",style:{textAlign:"right"}},_.div({class:"jss-table-actions"},...Zt)))}A.appendChild(zt)}},"UI.Table:render");me.body=be;const ct=xe.Card(me);return JSswift._registerCleanup(ct,Ye),M&&JSswift._registerCleanup(ct,M),ct},xe.Menu=(...e)=>{const{props:t,children:s}=JSswift.uiNormalizeArgs(e),l=t.slots||{},n=["primary","secondary","warning","danger","success","info","light","dark"],i=["xs","sm","md","lg","xl"];let c={...t},a=null,v=null,r=null,z=null,d=null;const k=(A,L)=>Object.prototype.hasOwnProperty.call(A||{},L),N=(A,L)=>typeof A=="function"?A(L):A,p=A=>String(A||"").split(/\s+/).filter(Boolean),U=A=>A&&typeof A=="object"&&!A.nodeType&&!Array.isArray(A)&&!(A instanceof Function),w=A=>!!A&&typeof A=="object"&&(A.nodeType===1||typeof A.getBoundingClientRect=="function"),$=()=>{clearTimeout(z),clearTimeout(d),z=null,d=null},B=(A,L,O)=>{if(!A)return;const X=A[L]||[];X.length&&A.classList.remove(...X);const we=(O||[]).filter(Boolean);we.length&&A.classList.add(...we),A[L]=we},te=(A,L,O,X=we=>we)=>{if(A){if(O==null||O===""){A.style.removeProperty(L);return}A.style.setProperty(L,X(O))}},E=()=>c||{},ve=A=>{var L;const O=String(o((L=A.state)!=null?L:A.color)||"").toLowerCase();return n.includes(O)?O:""},le=A=>{const L=String(o(A.size)||"").toLowerCase();return i.includes(L)?L:""},ie=A=>{var L,O;return String(o((O=(L=A.placement)!=null?L:A.position)!=null?O:"bottom-start"))},ge=()=>{var A;const L=o((A=E().delay)!=null?A:E().showDelay),O=Number(L);return Number.isFinite(O)?Math.max(0,O):0},ue=()=>{const A=o(E().hideDelay),L=Number(A);return Number.isFinite(L)?Math.max(0,L):80},fe=(A=null)=>{var L,O,X;if(A)return A;const we=E();return v||o((X=(O=(L=we.anchorEl)!=null?L:we.triggerEl)!=null?O:we.target)!=null?X:we.anchor)||null},M=A=>{if(A==null||A===!0)return new Set(["click"]);if(A===!1)return new Set(["manual"]);const L=Array.isArray(A)?A:String(A).split(/[\s,|/]+/),O=new Set;return L.forEach(X=>{const we=String(X||"").trim().toLowerCase();we&&(we==="mouseenter"||we==="mouseover"?O.add("hover"):we==="blur"||we==="focusin"?O.add("focus"):we==="tap"?O.add("click"):O.add(we))}),O.size?O:new Set(["manual"])},me=(A,L)=>{var O,X,we;let Be=null,Ue=null;if(w(A))Be=A,U(L)&&(Ue=L);else if(U(A)){Ue=A;const H=(we=(X=(O=A.anchorEl)!=null?O:A.triggerEl)!=null?X:A.target)!=null?we:A.anchor;w(H)&&(Be=H)}else A!=null&&(Be=A);return{anchorEl:Be,nextProps:Ue}},be=(A=a==null?void 0:a.panel)=>{var L;return Array.from(((L=A==null?void 0:A.querySelectorAll)==null?void 0:L.call(A,"[data-menu-item]:not([disabled]):not([tabindex='-1']), .jss-menu-item:not([disabled]):not([tabindex='-1']), [role='menuitem']:not([disabled]):not([tabindex='-1']), a[href]:not([tabindex='-1']), button:not([disabled]):not([tabindex='-1'])"))||[]).filter(O=>O.offsetParent!==null&&O.getAttribute("aria-hidden")!=="true")},de=()=>{o(E().autoFocus)!==!1&&setTimeout(()=>{const A=be();if(!A.length)return;(A.find(O=>O.classList.contains("is-active")||O.classList.contains("is-selected")||O.classList.contains("is-checked"))||A[0]).focus()},0)},Z=(A,L,O="sm")=>{const X=N(A,L);return X==null?[]:typeof X=="string"?[xe.Icon({name:X,size:O})]:Bs(X,{...L,as:"icon"})},j=(A,L)=>{var O,X,we,Be,Ue,H,W,ee,Ne,Te,oe,Pe,Ie;const Le=N(A,L);if(Le==null||Le===!1)return[];if(Array.isArray(Le))return Le.flatMap((zt,Xe)=>j(zt,{...L,index:Xe}));if(typeof Le=="function")return j(Le(L),L);if(Le!=null&&Le.nodeType)return[Le];if(typeof Le=="string"||typeof Le=="number")return j({label:Le},L);if(!U(Le))return Bs(Le,{...L,as:"item"});const Ye=String((X=(O=Le.type)!=null?O:Le.kind)!=null?X:"").toLowerCase();if(Ye==="separator"||Ye==="divider"||Le.separator===!0||Le.divider===!0)return[_.div({class:"jss-menu-divider",role:"separator"})];const ct=(we=Le.items)!=null?we:Le.children;if((Ye==="group"||Ye==="section"||Array.isArray(ct))&&ct!=null){const zt={...L,item:Le},Xe=D(l,"groupLabel",zt,N((Be=Le.label)!=null?Be:Le.title,zt)),mt=j(ct,zt);return mt.length?[_.div({class:re(["jss-menu-group",Le.class])},Xe.length?_.div({class:"jss-menu-group-label"},...Xe):null,_.div({class:"jss-menu-group-items"},...mt))]:[]}const Re={...L,item:Le,close:Q,dismiss:Q,open:b,toggle:Y,update:m,isOpen:K,entry:()=>a,anchorEl:fe(),props:E()},C=!!o(Le.disabled),Se=Le.checked==null?null:!!o(Le.checked),Fe=!!o((Ue=Le.active)!=null?Ue:Le.selected),F=ve(Le),f=o(Le.href),h=o(Le.to),x=k(Le,"closeOnSelect")?!!o(Le.closeOnSelect):Le.keepOpen===!0?!1:E().closeOnSelect!==!1,ae=Le.role||(Se!=null?"menuitemcheckbox":"menuitem"),Oe=Z(Le.icon,Re),De=Z((H=Le.iconRight)!=null?H:Le.endIcon,Re),Ge=D(l,"itemTitle",Re,N((W=Le.title)!=null?W:Le.label,Re)),Ke=D(l,"itemSubtitle",Re,N((ee=Le.subtitle)!=null?ee:Le.description,Re)),We=D(l,"itemShortcut",Re,N(Le.shortcut,Re)),et=D(l,"itemBadge",Re,N(Le.badge,Re)),tt=D(l,"item",Re,N((Te=(Ne=Le.content)!=null?Ne:Le.body)!=null?Te:Le.render,Re)),dt=[...et,...We,...Se===!0&&!De.length&&!et.length?[_.span({class:"jss-menu-entry-check"},xe.Icon({name:Le.checkedIcon||"check",size:"sm"}))]:[],...De],At={class:re(["jss-menu-entry","jss-menu-item",F?`jss-state-${F}`:"",pe(Fe,"is-active"),pe(Se===!0,"is-checked"),pe(C,"is-disabled"),Le.class]),role:ae,tabIndex:C?-1:(oe=Le.tabIndex)!=null?oe:-1,"data-menu-item":!0,"data-menu-select":x?"true":"false","data-menu-close":Le.close===!0?"true":null,"data-menu-keep-open":x?null:"true","aria-disabled":C?"true":null,"aria-checked":Se==null?null:String(Se),title:(Ie=(Pe=Le.titleAttr)!=null?Pe:Le.tooltip)!=null?Ie:null,type:f?null:"button",href:f||null,target:Le.target||null,rel:Le.rel||(Le.target==="_blank"?"noopener noreferrer":null),onClick:zt=>{var Xe,mt,Nt,Zt;if(C){zt.preventDefault(),zt.stopPropagation();return}(mt=(Xe=E()).onItemClick)==null||mt.call(Xe,Le,Re,zt);const rn=(Nt=Le.onClick)==null?void 0:Nt.call(Le,Re,zt);zt.defaultPrevented||(h&&((Zt=JSswift.router)!=null&&Zt.navigate)&&(zt.preventDefault(),JSswift.router.navigate(h)),rn!==!1&&x&&Q())}};Le.attrs&&typeof Le.attrs=="object"&&Object.assign(At,Le.attrs);const It=f?_.a:_.button,$t=tt.length?tt:[Ge.length?_.div({class:"jss-menu-entry-title"},...Ge):null,Ke.length?_.div({class:"jss-menu-entry-subtitle"},...Ke):null].filter(Boolean);return[It(At,Oe.length?_.span({class:"jss-menu-entry-icon"},...Oe):null,_.span({class:"jss-menu-entry-main"},...$t),dt.length?_.span({class:"jss-menu-entry-aside"},...dt):null)]},I=()=>{var A,L,O,X,we,Be,Ue;const H=E(),W={close:Q,dismiss:Q,open:b,toggle:Y,update:m,isOpen:K,entry:()=>a,anchorEl:fe(),props:H},ee=Z(H.icon,W,H.iconSize||"md"),Ne=D(l,"eyebrow",W,N(H.eyebrow,W)),Te=D(l,"title",W,N((L=(A=H.title)!=null?A:H.heading)!=null?L:H.label,W)),oe=D(l,"subtitle",W,N((O=H.subtitle)!=null?O:H.description,W)),Pe=D(l,"before",W,N(H.before,W)),Ie=D(l,"header",W,N(H.header,W)),Le=D(l,"after",W,N(H.after,W)),Ye=D(l,"footer",W,N(H.footer,W)),ct=D(l,"status",W,N(H.status,W));let Re=(X=H.content)!=null?X:H.body;Re==null&&s&&s.length&&(Re=s);let C=D(l,"content",W,N(Re,W));C.length||(C=D(l,"body",W,N(Re,W))),C.length||(C=D(l,"default",W,N(Re,W)));const Se=j((Be=(we=H.items)!=null?we:H.actionsList)!=null?Be:H.entries,W),Fe=Se.length?[]:D(l,"empty",W,N((Ue=H.empty)!=null?Ue:H.emptyText,W));let F=null;return Ie.length?F=_.div({class:re(["jss-menu-head","jss-menu-head-custom",H.headerClass])},...Ie):(ee.length||Ne.length||Te.length||oe.length)&&(F=_.div({class:re(["jss-menu-head",H.headerClass])},ee.length?_.div({class:"jss-menu-head-icon"},...ee):null,_.div({class:"jss-menu-head-main"},Ne.length?_.div({class:"jss-menu-eyebrow"},...Ne):null,Te.length?_.div({class:"jss-menu-title"},...Te):null,oe.length?_.div({class:"jss-menu-subtitle"},...oe):null))),_.div({class:re(["jss-menu","jss-menu-shell",pe(H.dense,"dense"),pe(Se.length>0,"has-items"),pe(Ye.length>0||ct.length>0,"has-footer"),H.class]),style:H.style||{},role:H.role||"menu","aria-label":H.ariaLabel||null},Pe.length?_.div({class:"jss-menu-before"},...Pe):null,F,C.length?_.div({class:re(["jss-menu-content",H.contentClass])},...C):null,Se.length?_.div({class:re(["jss-menu-items",H.itemsClass])},...Se):null,!Se.length&&Fe.length?_.div({class:"jss-menu-empty"},...Fe):null,Le.length?_.div({class:"jss-menu-after"},...Le):null,ct.length||Ye.length?_.div({class:re(["jss-menu-footer",H.footerClass])},ct.length?_.div({class:"jss-menu-status"},...ct):null,Ye.length?_.div({class:"jss-menu-footer-actions"},...Ye):null):null)},y=A=>{var L;if(!(A!=null&&A.panel))return;const O=E(),X=ve(O),we=le(O);B(A.panel,"_menuClassTokens",["jss-menu-panel","jss-clear-set","jss-singularity",we?`jss-menu-${we}`:"",X?`jss-state-${X}`:"",o(O.outline)?"outline":"",...p(O.panelClass)]),B(A.overlay,"_menuOverlayClassTokens",[...p(O.overlayClass)]),A.panel.dataset.placement=ie(O),te(A.panel,"--jss-menu-width",o(O.width),vt),te(A.panel,"--jss-menu-min-width",o(O.minWidth),vt),te(A.panel,"--jss-menu-max-width",o(O.maxWidth),vt),te(A.panel,"--jss-menu-max-height",o(O.maxHeight),vt),te(A.panel,"--jss-menu-body-max-height",o((L=O.bodyMaxHeight)!=null?L:O.contentMaxHeight),vt),O.panelStyle&&Object.assign(A.panel.style,O.panelStyle),Et(A.panel,O)},P=()=>{a!=null&&a.panel&&a.panel.replaceChildren(I())},Q=()=>{if($(),!a)return;const A=a;a=null,Ns(A,()=>JSswift.overlay.close(A.id))},m=(A={})=>{var L,O,X,we;if(A&&typeof A=="object"&&(c={...c,...A}),a){const Be=E();y(a),P(),(we=a.reposition)==null||we.call(a,{anchorEl:a._anchorEl,placement:ie(Be),offsetX:(L=Be.offsetX)!=null?L:0,offsetY:(X=(O=Be.offsetY)!=null?O:Be.offset)!=null?X:8}),de()}return J},b=(A=null,L=null)=>{var O,X,we,Be,Ue,H,W,ee,Ne,Te,oe,Pe,Ie,Le,Ye,ct;$();const{anchorEl:Re,nextProps:C}=me(A,L);C&&(c={...c,...C});const Se=E(),Fe=fe(Re);if(!Fe||o(Se.disabled))return null;if(a&&a._anchorEl===Fe){const We=E();return y(a),P(),(Be=a.reposition)==null||Be.call(a,{anchorEl:a._anchorEl,placement:ie(We),offsetX:(O=We.offsetX)!=null?O:0,offsetY:(we=(X=We.offsetY)!=null?X:We.offset)!=null?we:8}),de(),a}a&&Q(),r=document.activeElement;let F=null;if(a=JSswift.overlay.open(()=>I(),{type:"menu",anchorEl:Fe,placement:ie(Se),offsetX:(Ue=Se.offsetX)!=null?Ue:0,offsetY:(W=(H=Se.offsetY)!=null?H:Se.offset)!=null?W:8,backdrop:Se.backdrop===!0,lockScroll:Se.lockScroll===!0,trapFocus:Se.trapFocus===!0,autoFocus:!1,closeOnOutside:Se.closeOnOutside!==!1,closeOnBackdrop:(ee=Se.closeOnBackdrop)!=null?ee:Se.backdrop===!0,closeOnEsc:Se.closeOnEsc!==!1,className:Bt(["jss-menu-panel"]),onClose:()=>{var We,et,tt;(We=F==null?void 0:F._menuCleanup)==null||We.call(F),(tt=(et=E()).onClose)==null||tt.call(et,F),E().returnFocus!==!1&&r&&typeof r.focus=="function"&&setTimeout(()=>r.focus(),0)}}),!(a!=null&&a.panel))return a;const f=a;F=f,f._anchorEl=Fe;const h=()=>{clearTimeout(d),d=null},x=()=>{T()},ae=We=>{const et=We.target;if(!et||!et.closest)return;if(et.closest("[data-menu-close]")){Q();return}if(E().closeOnSelect===!1)return;const tt=et.closest("[data-menu-item], [data-menu-select], .jss-menu-item, [role='menuitem'], [role='menuitemcheckbox'], [role='menuitemradio'], a[href], button:not([disabled])");tt&&(tt.closest("[data-menu-keep-open]")||tt.getAttribute("data-menu-select")!=="false"&&Q())},Oe=We=>{if(We.key==="Escape"){We.preventDefault(),Q();return}if(!["ArrowDown","ArrowUp","Home","End"].includes(We.key))return;const et=be(f.panel);if(!et.length)return;We.preventDefault();const tt=et.indexOf(document.activeElement);if(We.key==="Home"){et[0].focus();return}if(We.key==="End"){et[et.length-1].focus();return}const dt=We.key==="ArrowDown"?1:-1,gt=tt<0?dt>0?0:et.length-1:(tt+dt+et.length)%et.length;et[gt].focus()};f.panel.addEventListener("click",ae),f.panel.addEventListener("keydown",Oe);const De=M((Te=(Ne=Se.trigger)!=null?Ne:Se.triggers)!=null?Te:k(Se,"open")?"manual":null),Ge=De.has("hover"),Ke=De.has("focus");return(Ge||Ke)&&(f.panel.addEventListener("mouseenter",h),f.panel.addEventListener("mouseleave",x),f.panel.addEventListener("focusin",h),f.panel.addEventListener("focusout",x)),f._menuCleanup=()=>{var We,et,tt,dt,gt,At;(We=f.panel)==null||We.removeEventListener("click",ae),(et=f.panel)==null||et.removeEventListener("keydown",Oe),(tt=f.panel)==null||tt.removeEventListener("mouseenter",h),(dt=f.panel)==null||dt.removeEventListener("mouseleave",x),(gt=f.panel)==null||gt.removeEventListener("focusin",h),(At=f.panel)==null||At.removeEventListener("focusout",x)},y(f),(Le=f.reposition)==null||Le.call(f,{anchorEl:Fe,placement:ie(Se),offsetX:(oe=Se.offsetX)!=null?oe:0,offsetY:(Ie=(Pe=Se.offsetY)!=null?Pe:Se.offset)!=null?Ie:8}),ks(f),(ct=(Ye=E()).onOpen)==null||ct.call(Ye,f),de(),f},g=(A,L=null)=>{clearTimeout(d),d=null,clearTimeout(z),z=setTimeout(()=>b(A,L),ge())},T=(A=!1)=>{if(clearTimeout(z),z=null,!!a){if(clearTimeout(d),A){Q();return}d=setTimeout(()=>Q(),ue())}},Y=(A=null,L=null)=>K()?(Q(),null):b(A,L),K=()=>!!a,J={open:b,close:Q,show:g,hide:T,toggle:Y,update:m,bind:A=>{var L,O;if(!A)return()=>{};v=A;const X=E(),we=M((O=(L=X.trigger)!=null?L:X.triggers)!=null?O:k(X,"open")?"manual":null),Be=we.has("hover"),Ue=we.has("focus"),H=we.has("click"),W=we.has("manual")||!Be&&!Ue&&!H,ee=[],Ne=()=>{$(),ee.forEach(Te=>Te()),v===A&&(v=null)};if(k(X,"open"))return ht(X.open)?JSswift.reactive.effect(()=>{v&&(o(E().open)?b(v):T(!0))},"UI.Menu:open"):X.open===!0?b(A):X.open===!1&&T(!0),Ne;if(W||o(X.disabled))return Ne;if(Be){const Te=()=>g(A),oe=()=>T();A.addEventListener("mouseenter",Te),A.addEventListener("mouseleave",oe),ee.push(()=>{A.removeEventListener("mouseenter",Te),A.removeEventListener("mouseleave",oe)})}if(Ue){const Te=()=>g(A),oe=()=>T();A.addEventListener("focus",Te),A.addEventListener("blur",oe),ee.push(()=>{A.removeEventListener("focus",Te),A.removeEventListener("blur",oe)})}if(H){const Te=oe=>{var Pe,Ie;(Ie=(Pe=E()).onTriggerClick)==null||Ie.call(Pe,oe),!oe.defaultPrevented&&Y(A)};A.addEventListener("click",Te),ee.push(()=>A.removeEventListener("click",Te))}return Ne},isOpen:K,entry:()=>a,props:()=>({...c})};return J},xe.Popover=(...e)=>{const{props:t,children:s}=JSswift.uiNormalizeArgs(e),l=t.slots||{},n=["primary","secondary","warning","danger","success","info","light","dark"],i=["xs","sm","md","lg","xl"];let c={...t},a=null,v=null,r=null,z=null,d=null;const k=(J,A)=>Object.prototype.hasOwnProperty.call(J||{},A),N=(J,A)=>typeof J=="function"?J(A):J,p=J=>String(J||"").split(/\s+/).filter(Boolean),U=J=>J&&typeof J=="object"&&!J.nodeType&&!Array.isArray(J)&&!(J instanceof Function),w=J=>!!J&&typeof J=="object"&&(J.nodeType===1||typeof J.getBoundingClientRect=="function"),$=()=>{clearTimeout(z),clearTimeout(d),z=null,d=null},B=(J,A,L)=>{if(!J)return;const O=J[A]||[];O.length&&J.classList.remove(...O);const X=(L||[]).filter(Boolean);X.length&&J.classList.add(...X),J[A]=X},te=(J,A,L,O=X=>X)=>{if(J){if(L==null||L===""){J.style.removeProperty(A);return}J.style.setProperty(A,O(L))}},E=()=>c,ve=J=>{var A;const L=o((A=J.state)!=null?A:J.color);return L?n.includes(L)?L:String(L):""},le=J=>{const A=o(J.size);return typeof A=="string"&&i.includes(A)?A:""},ie=J=>{var A,L,O;const X=String(o((O=(L=(A=J.actionsAlign)!=null?A:J.footerAlign)!=null?L:J.alignActions)!=null?O:"end")).toLowerCase();return["start","left"].includes(X)?"start":["center","middle"].includes(X)?"center":["between","space-between"].includes(X)?"between":["stretch","full"].includes(X)?"stretch":"end"},ge=J=>{var A,L;return String(o((L=(A=J.placement)!=null?A:J.position)!=null?L:"bottom-start"))},ue=(J,A)=>{const L=o(J);if(L==null||L==="")return A;const O=Number(L);return Number.isFinite(O)?O:A},fe=()=>ue(E().delay,0),M=()=>ue(E().hideDelay,120),me=J=>{var A,L;return((L=(A=J.closable)!=null?A:J.dismissible)!=null?L:J.closeButton)===!0},be=(J=null)=>{var A,L,O;if(J)return J;const X=E();return v||o((O=(L=(A=X.anchorEl)!=null?A:X.triggerEl)!=null?L:X.target)!=null?O:X.anchor)||null},de=J=>{if(J==null||J===!0)return new Set(["click"]);if(J===!1)return new Set(["manual"]);const A=Array.isArray(J)?J:String(J).split(/[\s,|/]+/),L=new Set;return A.forEach(O=>{const X=String(O||"").trim().toLowerCase();X&&(X==="mouseenter"||X==="mouseover"?L.add("hover"):X==="blur"||X==="focusin"?L.add("focus"):X==="tap"?L.add("click"):L.add(X))}),L.size?L:new Set(["manual"])},Z=(J,A)=>{var L,O,X;let we=null,Be=null;if(w(J))we=J,U(A)&&(Be=A);else if(U(J)){Be=J;const Ue=(X=(O=(L=J.anchorEl)!=null?L:J.triggerEl)!=null?O:J.target)!=null?X:J.anchor;w(Ue)&&(we=Ue)}else J!=null&&(we=J);return{anchorEl:we,nextProps:Be}},j=()=>{var J,A,L,O,X,we,Be,Ue,H;const W=E(),ee={close:P,dismiss:P,open:m,toggle:T,update:Q,isOpen:Y,entry:()=>a,anchorEl:be(),props:W},Ne=W.icon!=null?typeof W.icon=="string"?xe.Icon({name:W.icon,size:W.iconSize||"md"}):JSswift.ui.slot(W.icon,{as:"icon"}):null,Te=D(l,"eyebrow",ee,N(W.eyebrow,ee)),oe=D(l,"title",ee,N((A=(J=W.title)!=null?J:W.heading)!=null?A:W.label,ee)),Pe=D(l,"subtitle",ee,N((L=W.subtitle)!=null?L:W.description,ee)),Ie=D(l,"icon",ee,Ne),Le=D(l,"header",ee,N((X=(O=W.headerContent)!=null?O:W.head)!=null?X:W.header,ee)),Ye=me(W)?D(l,"close",ee,xe.Btn({class:"jss-dialog-close",size:"sm",outline:!0,"aria-label":W.closeLabel||"Chiudi popover","data-popover-close":!0},xe.Icon({name:W.closeIcon||"close",size:"sm"}))):[];let ct=(Ue=(Be=(we=W.content)!=null?we:W.body)!=null?Be:W.message)!=null?Ue:W.text;ct==null&&s&&s.length&&(ct=s);let Re=D(l,"content",ee,N(ct,ee));Re.length||(Re=D(l,"body",ee,N(ct,ee))),Re.length||(Re=D(l,"default",ee,N(ct,ee)));const C=N((H=W.footer)!=null?H:W.actions,ee);let Se=D(l,"footer",ee,C);Se.length||(Se=D(l,"actions",ee,C));let Fe=null;Le.length?Fe=_.div({class:"jss-dialog-head jss-dialog-head-custom"},...Le):(Te.length||oe.length||Pe.length||Ie.length||Ye.length)&&(Fe=_.div({class:"jss-dialog-head"},Ie.length?_.div({class:"jss-dialog-icon"},...Ie):null,_.div({class:"jss-dialog-head-main"},Te.length?_.div({class:"jss-dialog-eyebrow"},...Te):null,oe.length?_.div({class:"jss-dialog-title"},...oe):null,Pe.length?_.div({class:"jss-dialog-subtitle"},...Pe):null),Ye.length?_.div({class:"jss-dialog-close-wrap"},...Ye):null));const F=[];return Fe&&F.push(Fe),Re.length&&F.push(_.div({class:re(["jss-dialog-body",W.bodyClass])},...Re)),Se.length&&F.push(_.div({class:re(["jss-dialog-actions",`is-${ie(W)}`,pe(W.stackActions,"is-stacked"),W.actionsClass,W.footerClass])},...Se)),F.length||F.push(_.div({class:re(["jss-dialog-body",W.bodyClass])})),_.div({class:re(["jss-dialog-shell","jss-popover-shell",pe(!!Fe,"has-head"),pe(Se.length>0,"has-footer"),pe(W.divider!==!1,"with-divider")])},...F)},I=J=>{var A;if(!(J!=null&&J.panel))return;const L=E(),O=ve(L),X=le(L);B(J.panel,"_popoverClassTokens",["jss-dialog","jss-popover","jss-singularity","jss-clear-set",X?`jss-dialog-${X}`:"",O,O?`jss-state-${O}`:"",o(L.scrollable)?"scrollable":"",o(L.stickyHeader)?"sticky-head":"",o(L.stickyActions)?"sticky-actions":"",o(L.borderless)?"borderless":"",...p(L.class),...p(L.panelClass)]),B(J.overlay,"_popoverOverlayClassTokens",[...p(L.overlayClass)]),J.panel.dataset.placement=ge(L),te(J.panel,"--jss-dialog-width",o(L.width),vt),te(J.panel,"--jss-dialog-min-width",o(L.minWidth),vt),te(J.panel,"--jss-dialog-max-width",o(L.maxWidth),vt),te(J.panel,"--jss-dialog-max-height",o(L.maxHeight),vt),te(J.panel,"--jss-dialog-body-max-height",o((A=L.bodyMaxHeight)!=null?A:L.contentMaxHeight),vt),L.style&&Object.assign(J.panel.style,L.style),Et(J.panel,L),J.panel.setAttribute("role",L.role||"dialog"),J.panel.setAttribute("aria-modal",L.modal===!0?"true":"false"),L.ariaLabel?J.panel.setAttribute("aria-label",L.ariaLabel):J.panel.removeAttribute("aria-label")},y=()=>{a!=null&&a.panel&&a.panel.replaceChildren(j())},P=()=>{if($(),!a)return;const J=a;a=null,Ns(J,()=>JSswift.overlay.close(J.id))},Q=(J={})=>(J&&typeof J=="object"&&(c={...c,...J}),a&&(I(a),y()),_e),m=(J=null,A=null)=>{var L,O,X,we,Be,Ue,H,W;$();const{anchorEl:ee,nextProps:Ne}=Z(J,A);Ne&&(c={...c,...Ne});const Te=E(),oe=be(ee);if(!oe||o(Te.disabled))return null;if(a&&a._anchorEl===oe)return I(a),y(),a;a&&P(),r=document.activeElement;const Pe=de((O=(L=Te.trigger)!=null?L:Te.triggers)!=null?O:k(Te,"open")?"manual":null),Ie=Pe.has("hover"),Le=Pe.has("focus");let Ye=null;if(a=JSswift.overlay.open(()=>j(),{type:"popover",anchorEl:oe,placement:ge(Te),offsetX:(X=Te.offsetX)!=null?X:0,offsetY:(Be=(we=Te.offsetY)!=null?we:Te.offset)!=null?Be:10,backdrop:Te.backdrop===!0,lockScroll:Te.lockScroll===!0,trapFocus:Te.trapFocus===!0,autoFocus:Te.autoFocus===!0,closeOnOutside:Te.closeOnOutside!==!1,closeOnBackdrop:(Ue=Te.closeOnBackdrop)!=null?Ue:Te.backdrop===!0,closeOnEsc:Te.closeOnEsc!==!1,className:Bt(["jss-dialog","jss-popover"]),onClose:()=>{var Fe,F,f;(Fe=Ye==null?void 0:Ye._popoverCleanup)==null||Fe.call(Ye),(f=(F=E()).onClose)==null||f.call(F,Ye),E().returnFocus!==!1&&r&&typeof r.focus=="function"&&setTimeout(()=>r.focus(),0)}}),!(a!=null&&a.panel))return a;const ct=a;Ye=ct,ct._anchorEl=oe;const Re=()=>{clearTimeout(d),d=null},C=()=>{!Ie&&!Le||g()},Se=Fe=>{const F=Fe.target;if(!(!F||!F.closest)){if(F.closest("[data-popover-close]")||F.closest("[data-dialog-close]")){P();return}E().closeOnSelect===!0&&F.closest("[data-popover-select]")&&P()}};return ct.panel.addEventListener("click",Se),(Ie||Le)&&(ct.panel.addEventListener("mouseenter",Re),ct.panel.addEventListener("mouseleave",C),ct.panel.addEventListener("focusin",Re),ct.panel.addEventListener("focusout",C)),ct._popoverCleanup=()=>{var Fe,F,f,h,x;(Fe=ct.panel)==null||Fe.removeEventListener("click",Se),(F=ct.panel)==null||F.removeEventListener("mouseenter",Re),(f=ct.panel)==null||f.removeEventListener("mouseleave",C),(h=ct.panel)==null||h.removeEventListener("focusin",Re),(x=ct.panel)==null||x.removeEventListener("focusout",C)},I(ct),ks(ct),(W=(H=E()).onOpen)==null||W.call(H,ct),ct},b=(J,A=null)=>{clearTimeout(d),d=null,clearTimeout(z),z=setTimeout(()=>m(J,A),fe())},g=(J=!1)=>{if(clearTimeout(z),z=null,!!a){if(clearTimeout(d),J){P();return}d=setTimeout(()=>P(),M())}},T=(J=null,A=null)=>Y()?(P(),null):m(J,A),Y=()=>!!a,_e={open:m,close:P,show:b,hide:g,toggle:T,update:Q,bind:J=>{var A,L;if(!J)return()=>{};v=J;const O=E(),X=de((L=(A=O.trigger)!=null?A:O.triggers)!=null?L:k(O,"open")?"manual":null),we=X.has("hover"),Be=X.has("focus"),Ue=X.has("click"),H=X.has("manual")||!we&&!Be&&!Ue,W=[],ee=()=>{$(),W.forEach(Ne=>Ne()),v===J&&(v=null)};if(k(O,"open"))return ht(O.open)?JSswift.reactive.effect(()=>{v&&(o(E().open)?m(v):g(!0))},"UI.Popover:open"):O.open===!0?m(J):O.open===!1&&g(!0),ee;if(H||o(O.disabled))return ee;if(we){const Ne=()=>b(J),Te=()=>g();J.addEventListener("mouseenter",Ne),J.addEventListener("mouseleave",Te),W.push(()=>{J.removeEventListener("mouseenter",Ne),J.removeEventListener("mouseleave",Te)})}if(Be){const Ne=()=>b(J),Te=()=>g();J.addEventListener("focus",Ne),J.addEventListener("blur",Te),W.push(()=>{J.removeEventListener("focus",Ne),J.removeEventListener("blur",Te)})}if(Ue){const Ne=Te=>{var oe,Pe;(Pe=(oe=E()).onTriggerClick)==null||Pe.call(oe,Te),!Te.defaultPrevented&&T(J)};J.addEventListener("click",Ne),W.push(()=>J.removeEventListener("click",Ne))}return ee},isOpen:Y,entry:()=>a,props:()=>({...c})};return _e},xe.ContextMenu=(...e)=>{const{props:t,children:s}=JSswift.uiNormalizeArgs(e);let l={...t},n=null,i=null,c=null;const a=y=>y&&typeof y=="object"&&!y.nodeType&&!Array.isArray(y)&&!(y instanceof Function),v=y=>!!y&&typeof y=="object"&&(y.nodeType===1||typeof y.getBoundingClientRect=="function"),r=y=>!!y&&typeof y=="object"&&("clientX"in y||"type"in y||"target"in y||"currentTarget"in y),z=y=>!!y&&Number.isFinite(Number(y.x))&&Number.isFinite(Number(y.y)),d=()=>l,k=(y,P)=>{const Q=Number(y),m=Number(P);return!Number.isFinite(Q)||!Number.isFinite(m)?null:{x:Q,y:m}},N=y=>y?{_jssContextPoint:y,getBoundingClientRect:()=>({top:y.y,bottom:y.y,left:y.x,right:y.x,width:0,height:0})}:null,p=y=>{if(!v(y))return null;const P=y.getBoundingClientRect();return k(P.left+Math.min(P.width/2,24),P.top+Math.min(P.height/2,24))},U=y=>{var P,Q,m,b;return o((b=(m=(Q=(P=y==null?void 0:y.anchorEl)!=null?P:y==null?void 0:y.triggerEl)!=null?Q:y==null?void 0:y.target)!=null?m:y==null?void 0:y.anchor)!=null?b:null)},w=(y,P=null)=>{if(!y)return p(P||c);const Q=k(y.clientX,y.clientY);if(Q)return Q;const m=U({anchorEl:P||y.currentTarget||y.target||c});return p(m)},$=(y={})=>{if(!a(y))return{};const P={...y};return delete P.event,delete P.point,delete P.x,delete P.y,P},B=()=>{var y,P,Q;const m=d();return{...m,trigger:"manual",placement:m.placement||"bottom-start",offsetX:(y=m.offsetX)!=null?y:0,offsetY:(Q=(P=m.offsetY)!=null?P:m.offset)!=null?Q:4,closeOnOutside:m.closeOnOutside!==!1,closeOnEsc:m.closeOnEsc!==!1,role:m.role||"menu",ariaLabel:m.ariaLabel||m.title||"Context menu",class:re(["jss-context-menu-shell",m.class]),panelClass:re(["jss-context-menu-panel",m.panelClass])}},te=xe.Menu(B(),...s),E=(y=null,P=null,Q=null)=>{let m=null,b=null,g=null;if(r(y))m=w(y,c),g=a(P)?$(P):null;else if(typeof y=="number"||typeof P=="number")m=k(y,P),g=a(Q)?$(Q):null;else if(z(y))m=k(y.x,y.y),g=a(P)?$(P):null;else if(v(y))b=y,g=a(P)?$(P):null;else if(a(y)){const T=z(y.point)?y.point:z(y)?y:null,Y=U(y),K=y.event;m=T?k(T.x,T.y):w(K,Y||c),b=Y&&v(Y)?Y:null,g={...$(y),...a(P)?$(P):{}}}else n&&(m={...n});return{point:m,anchor:b,nextProps:g}},ve=(y,P=null)=>{i=y||i,n=P||y&&y._jssContextPoint||n},le=(y=null)=>{a(y)&&Object.keys(y).length&&(l={...l,...y})},ie=(y=null,P=null)=>{if(P)return N(P);if(y&&v(y))return y;const Q=U(d());return v(Q)?Q:n?N(n):v(i)?i:v(c)?c:null},ge=(y=null,P=null,Q=null)=>{const{point:m,anchor:b,nextProps:g}=E(y,P,Q);le(g);const T=ie(b,m);return T?(ve(T,m),te.open(T,B())):null},ue=(y,P,Q=null)=>ge(y,P,Q),fe=(y,P=null)=>ge(y,P),M=()=>(te.close(),I),me=(y=!0)=>(y===!1?te.hide(!1):te.close(),I),be=(y=null,P=null,Q=null)=>ge(y,P,Q),de=(y=null,P=null,Q=null)=>te.isOpen()?(M(),null):ge(y,P,Q),Z=(y={})=>(le($(y)),te.update(B()),I),I={open:ge,openAt:ue,openFromEvent:fe,show:be,hide:me,close:M,toggle:de,update:Z,bind:(y,P=null)=>{if(!y)return()=>{};const Q=a(P)?$(P):null,m=g=>{var T,Y;c=y,g.preventDefault(),!(((Y=(T=d()).onTrigger)==null?void 0:Y.call(T,g,{element:y,open:ge,close:M,update:Z}))===!1||o(d().disabled))&&ge({event:g,anchorEl:y},Q)},b=g=>{var T,Y;g.key!=="ContextMenu"&&!(g.shiftKey&&g.key==="F10")||(c=y,g.preventDefault(),((Y=(T=d()).onTrigger)==null?void 0:Y.call(T,g,{element:y,open:ge,close:M,update:Z}))===!1||o(d().disabled))||ge({event:g,anchorEl:y},Q)};return y.addEventListener("contextmenu",m),y.addEventListener("keydown",b),()=>{y.removeEventListener("contextmenu",m),y.removeEventListener("keydown",b)}},isOpen:te.isOpen,entry:te.entry,props:()=>({...l})};return I}})(JSswift);
|