@zuzjs/ui 1.0.35 → 1.0.37

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,13 +1,13 @@
1
- import {f,e,g,d,h,c}from'./chunk-ZRRWTL7H.js';export{e as PACKAGE_NAME,f as cleanProps,g as splitAtoms}from'./chunk-ZRRWTL7H.js';import {createContext,forwardRef,useMemo,Fragment,useEffect,useRef,useImperativeHandle,useState,useCallback,createElement,isValidElement,useId,useLayoutEffect,useContext,startTransition}from'react';import {useDelayed,useScrollbar,useDebounce,useImage,useResizeObserver,useLineChart,useImageCropper,CropShape,useNetworkStatus,useCommandActions,useCarousel,useTimer,useDimensions,useMediaPlayer,AnchorType,useAnchorPosition,KeyCode,useShortcuts}from'@zuzjs/hooks';import {createPortal}from'react-dom';import {jsx,jsxs,Fragment as Fragment$1}from'react/jsx-runtime';import {MD5,uuid,withPost,_,clamp,timeSince,checkPasswordStrength,PubSub,toHash,numberInRange}from'@zuzjs/core';import {addPropsToChildren}from'@zuzjs/core/react';import {startOfMonth,endOfMonth,startOfWeek,endOfWeek,eachDayOfInterval,format,isSameMonth,isSameDay,isToday,addHours,addDays,addWeeks}from'date-fns';var sr={Circle:"CIRCLE",Square:"SQUARE"},wu={Default:"DEFAULT",Circle:"CIRCLE"},Su={Light:"light",Dark:"dark",System:"system"},Ne={Default:"DEFAULT",Switch:"SWITCH"},nt={Auto:"auto",Top:"top",Bottom:"bottom",Left:"left",Right:"right"},re=nt,st=AnchorType,Cu=st,U={XSmall:"xs",Small:"sm",Medium:"md",Large:"lg",XLarge:"xl"},Tu={Asc:"ASC",Desc:"DESC"},Pu={String:"STRING",Number:"NUMBER",Boolean:"BOOLEAN",Array:"ARRAY",Object:"OBJECT",Date:"DATE",Time:"TIME",DateTime:"DATETIME",File:"FILE"},Ru={Dots:"DOTS"},Be={IPV4:"IPV4",IPV6:"IPV6",Email:"EMAIL",Uri:"URI",Password:"PASSWORD",MatchField:"MATCHFIELD",Pattern:"*",GreaterThan:"GREATER_THAN"},xe={Success:"success",Error:"error",Warning:"warning",Info:"info"},q={Spring:"SPRING",Liquid:"LIQUID",EaseInOut:"EASEINOUT",EaseOutBack:"EASEOUTBACK",Bounce:"BOUNCE"},Y={FadeIn:"FADE_IN",ScaleIn:"SCALE_IN",SlideInTop:"SLIDE_FROM_TOP",SlideInRight:"SLIDE_FROM_RIGHT",SlideInBottom:"SLIDE_FROM_BOTTOM",SlideInLeft:"SLIDE_FROM_LEFT"},Iu={Success:"success",Error:"error",Idle:"idle",Dead:"dead"},be={Dialog:"DIALOG",Default:"DEFAULT",Error:"ERROR",Success:"SUCCESS",Warn:"WARN",Promise:"PROMISE"},Ue=be,Jt={Left:"LEFT",Right:"RIGHT",Center:"CENTER"},ar=Jt,Nu={Bar:"BAR",Ring:"RING"},jt={Default:"range",Text:"number"},eo={Default:"DEFAULT",Card:"CARD"},Tt={Gooey:"gooey"},ce={Left:"LEFT",Right:"RIGHT",Top:"TOP",Bottom:"BOTTOM"};var ir=Symbol.for("zuz.global.map"),lr=t=>{globalThis[ir]=t;},fa=()=>globalThis[ir]||{},to=t=>{let n=Array.isArray(t)?t.join(" "):t;if(!n||typeof n!="string")return "";let e$1=fa();return process.env.NODE_ENV==="development"&&Object.keys(e$1).length===0&&console.warn(`[${e}] No utility map detected. Classes will not be hashed. `,"Ensure you call setZuzMap() or use <ThemeProvider zuzMap={...} />."),g(n).filter(Boolean).map(o=>{let s=o.match(/^([&@][\w-]+)\((.*)\)$/);if(s){let[a,u,f]=s;return g(f).map(l=>{let c=`${u}(${l})`;return e$1[c]||l}).join(" ")}return e$1[o]||o}).join(" ")},qu=t=>{let n=Array.isArray(t)?t.join(" "):t;return !n||typeof n!="string"?"":to(n)},cr=t=>{let n={};for(let e in t){let r=t[e];if(e.startsWith("--")){n[e]=r;continue}let o=d[e]?.toString()??e;if(o==="x"||o==="translateX"){let s=n.translate?.split(" ")??["0px","0px"];n.translate=`${h.addUnitsSafely(e,r)} ${s[1]??"0px"}`;}else if(o==="y"||o==="translateY"){let s=n.translate?.split(" ")??["0px","0px"];n.translate=`${s[0]??"0px"} ${h.addUnitsSafely(e,r)}`;}else c.includes(o)?n[o]=h.addUnitsSafely(e,r):n[o]=r;}return n},oo=t=>{if(!t)return "linear";switch(t.toUpperCase()){case q.Bounce:return "var(--bounce)";case q.Liquid:return "var(--liquid)";case q.Spring:return "var(--spring)";case q.EaseInOut:return "ease-in-out";case q.EaseOutBack:return "ease-out-back";default:return "linear"}},at=(t,n=0)=>{let e={},r={},o=n||20;switch(t){case Y.SlideInLeft:case Y.SlideInRight:e={"--fx-x":t===Y.SlideInLeft?`-${o}px`:`${o}px`,opacity:0},r={"--fx-x":"0px",opacity:1};break;case Y.SlideInTop:case Y.SlideInBottom:e={"--fx-y":t===Y.SlideInTop?`-${o}px`:`${o}px`,opacity:0},r={"--fx-y":"0px",opacity:1};break;case Y.ScaleIn:e={scale:0,opacity:0},r={scale:1,opacity:1};break;case Y.FadeIn:e={opacity:0},r={opacity:1};break}return {from:e,to:r}},Xu=(t,n,e)=>{let{from:r,to:o}=at(t);return n?{...r,...o}:e?r:o};var ga=(t,n)=>{let e=useRef([]),r=useRef(false);return useEffect(()=>{t?.when||(r.current=false);},[t?.transition]),useEffect(()=>{let o=n?.current;if(!o||!t||!t.clearAtEnd)return;let s=a=>{e.current.includes(a.propertyName)&&t.clearAtEnd===true&&(o.style.transform="",o.style.filter="",e.current.forEach(u=>o.style.removeProperty(u)));};return o.addEventListener("transitionend",s),()=>o.removeEventListener("transitionend",s)},[t,n]),useEffect(()=>{if(typeof window>"u"||!n?.current)return;let o=n.current;(t?.scroll||t?.mouse)&&(o.style.willChange="transform",o.style.translate="var(--fx-x, 0px) var(--fx-y, 0px)",o.style.transition=`translate 0.1s ${t.curve?oo(t.curve):"var(--spring)"}`);},[t,n]),useMemo(()=>{if(!t)return {style:{}};let{transition:o,from:s,to:a,exit:u,when:f,duration:l=.3,delay:c=0,curve:p,watch:i=[]}=t,g=f===false&&!r.current;f===true&&(r.current=true);let T={},{from:y,to:S}=o?at(o):{from:s||{},to:a||{}};T=f===void 0?{...y,...S}:f?{...S}:u||y;let I=oo(p),R=[],P=cr(T);e.current=Object.keys(P);let h={...P};return Object.keys(P).forEach(C=>{let b=C.startsWith("--")?"all":C;R.includes(b)||R.push(`${b} ${l}s ${I} ${c}s`);}),i.forEach(C=>{R.includes(C)||R.push(`${C} 0.1s ${I} 0s`);}),{style:{...h,transition:g?"none":R.join(", "),opacity:g?0:h.opacity,pointerEvents:g?"none":h.pointerEvents}}},[t,t?.when,t?.watch])},me=ga;var Pt=null,ha=(t,n)=>{let{as:e,fx:r,transition:o,skeleton:s,className:a,propsToRemove:u,draggable:f$1,dragOptions:l,style:c,...p}=t||{},i=typeof window<"u",g={},T={};if(f$1&&i&&!Pt&&(import('@zuzjs/hooks').then(R=>{Pt=R.useDrag;}).catch(R=>{console.error("Error loading useDrag:",R);}),Pt)){let R=Pt(l);g={onMouseDown:R.onMouseDown},T={transform:`translate(${R.position.x}px, ${R.position.y}px)`};}let y=o?{transition:o,duration:.3}:r||{},{style:S}=me(y,n),I=to(e??"");return {style:{...c,...S,...T},className:[a||"",I||"",s?.enabled?"--skeleton":"",f$1?"--draggable":""].join(" ").trim(),rest:{...g,...f(p,u?[...u,"skeleton"]:["skeleton"])}}},B=ha;var ur="(prefers-color-scheme: dark)",ba=typeof window>"u",dr=createContext(void 0),ao=t=>{let n=useContext(dr);if(!n){if(t===true)return;throw new Error("useColorScheme must be used within a ThemeProvider")}return n},X=ao,va=({children:t,storageKey:n="--ucs",forceTheme:e,zuzMap:r,...o})=>(r&&lr(r),jsx(wa,{storageKey:n,forceTheme:e,...o,children:t})),wa=({children:t,storageKey:n,forceTheme:e,...r})=>{let[o,s]=useState(()=>e||fr(n,"system")),[a,u]=useState(()=>e||fr(n)),f=i=>(i||(i=window.matchMedia(ur)),i.matches?"dark":"light"),l=useCallback(i=>{let g=i=="system"?f():i,T=document.documentElement;T.setAttribute("color-scheme",g),T.style.colorScheme=g,u(g);},[f]),c=useCallback(i=>{s(i),localStorage.setItem(n,i),l(i);},[o]),p=useCallback(i=>{let g=f(i);u(g),o==="system"&&l("system");},[o]);return useEffect(()=>{o==null&&window.localStorage.getItem(n);},[o]),useEffect(()=>{window.matchMedia(ur).addEventListener("change",p);},[p]),useEffect(()=>{let i=g=>{g.key==n&&(g.newValue?c(g.newValue):c("system"));};return window.addEventListener("storage",i),()=>window.removeEventListener("storage",i)},[c]),useEffect(()=>{l(e||o||"system");},[o]),jsxs(dr,{value:{colorScheme:o,resolvedScheme:a,setColorScheme:c,...r},children:[e?null:jsx("script",{suppressHydrationWarning:true,dangerouslySetInnerHTML:{__html:`const el = document.documentElement
1
+ import {f,e,g,d,h,c}from'./chunk-HPG2IJFH.js';export{e as PACKAGE_NAME,f as cleanProps,g as splitAtoms}from'./chunk-HPG2IJFH.js';import {createContext,forwardRef,useMemo,Fragment,useEffect,useRef,useImperativeHandle,useState,useCallback,createElement,isValidElement,useId,useLayoutEffect,useContext,startTransition}from'react';import {useDelayed,useScrollbar,useDebounce,useImage,useResizeObserver,useLineChart,useImageCropper,CropShape,useNetworkStatus,useCommandActions,useCarousel,useTimer,useMediaPlayer,AnchorType,useAnchorPosition,KeyCode,useShortcuts}from'@zuzjs/hooks';import {createPortal}from'react-dom';import {jsx,jsxs,Fragment as Fragment$1}from'react/jsx-runtime';import {MD5,uuid,withPost,_,clamp,timeSince,checkPasswordStrength,PubSub,toHash,numberInRange}from'@zuzjs/core';import {addPropsToChildren}from'@zuzjs/core/react';import {startOfMonth,endOfMonth,startOfWeek,endOfWeek,eachDayOfInterval,format,isSameMonth,isSameDay,isToday,addHours,addDays,addWeeks}from'date-fns';var lr={Circle:"CIRCLE",Square:"SQUARE"},Pu={Default:"DEFAULT",Circle:"CIRCLE"},Ru={Light:"light",Dark:"dark",System:"system"},Ee={Default:"DEFAULT",Switch:"SWITCH"},ct={Auto:"auto",Top:"top",Bottom:"bottom",Left:"left",Right:"right"},le=ct,mt=AnchorType,Iu=mt,K={XSmall:"xs",Small:"sm",Medium:"md",Large:"lg",XLarge:"xl"},Nu={Asc:"ASC",Desc:"DESC"},Bu={String:"STRING",Number:"NUMBER",Boolean:"BOOLEAN",Array:"ARRAY",Object:"OBJECT",Date:"DATE",Time:"TIME",DateTime:"DATETIME",File:"FILE"},Eu={Dots:"DOTS"},Le={IPV4:"IPV4",IPV6:"IPV6",Email:"EMAIL",Uri:"URI",Password:"PASSWORD",MatchField:"MATCHFIELD",Pattern:"*",GreaterThan:"GREATER_THAN"},be={Success:"success",Error:"error",Warning:"warning",Info:"info"},q={Spring:"SPRING",Liquid:"LIQUID",EaseInOut:"EASEINOUT",EaseOutBack:"EASEOUTBACK",Bounce:"BOUNCE"},G={FadeIn:"FADE_IN",ScaleIn:"SCALE_IN",SlideInTop:"SLIDE_FROM_TOP",SlideInRight:"SLIDE_FROM_RIGHT",SlideInBottom:"SLIDE_FROM_BOTTOM",SlideInLeft:"SLIDE_FROM_LEFT"},Lu={Success:"success",Error:"error",Idle:"idle",Dead:"dead"},ve={Dialog:"DIALOG",Default:"DEFAULT",Error:"ERROR",Success:"SUCCESS",Warn:"WARN",Promise:"PROMISE"},Ye=ve,eo={Left:"LEFT",Right:"RIGHT",Center:"CENTER"},cr=eo,Mu={Bar:"BAR",Ring:"RING"},to={Default:"range",Text:"number"},oo={Default:"DEFAULT",Card:"CARD"},It={Gooey:"gooey"},ue={Left:"LEFT",Right:"RIGHT",Top:"TOP",Bottom:"BOTTOM"};var mr=Symbol.for("zuz.global.map"),pr=t=>{globalThis[mr]=t;},ua=()=>globalThis[mr]||{},ro=t=>{let n=Array.isArray(t)?t.join(" "):t;if(!n||typeof n!="string")return "";let e$1=ua();return process.env.NODE_ENV==="development"&&Object.keys(e$1).length===0&&console.warn(`[${e}] No utility map detected. Classes will not be hashed. `,"Ensure you call setZuzMap() or use <ThemeProvider zuzMap={...} />."),g(n).filter(Boolean).map(o=>{let s=o.match(/^([&@][\w-]+)\((.*)\)$/);if(s){let[a,u,f]=s;return g(f).map(l=>{let c=`${u}(${l})`;return e$1[c]||l}).join(" ")}return e$1[o]||o}).join(" ")},Qu=t=>{let n=Array.isArray(t)?t.join(" "):t;return !n||typeof n!="string"?"":ro(n)},ur=t=>{let n={};for(let e in t){let r=t[e];if(e.startsWith("--")){n[e]=r;continue}let o=d[e]?.toString()??e;if(o==="x"||o==="translateX"){let s=n.translate?.split(" ")??["0px","0px"];n.translate=`${h.addUnitsSafely(e,r)} ${s[1]??"0px"}`;}else if(o==="y"||o==="translateY"){let s=n.translate?.split(" ")??["0px","0px"];n.translate=`${s[0]??"0px"} ${h.addUnitsSafely(e,r)}`;}else c.includes(o)?n[o]=h.addUnitsSafely(e,r):n[o]=r;}return n},no=t=>{if(!t)return "linear";switch(t.toUpperCase()){case q.Bounce:return "var(--bounce)";case q.Liquid:return "var(--liquid)";case q.Spring:return "var(--spring)";case q.EaseInOut:return "ease-in-out";case q.EaseOutBack:return "ease-out-back";default:return "linear"}},pt=(t,n=0,e=0)=>{let r={},o={},s=n||20,a=e||0;switch(t){case G.SlideInLeft:case G.SlideInRight:r={"--fx-x":t===G.SlideInLeft?`-${s}px`:`${s}px`,opacity:0},o={"--fx-x":`${a}px`,opacity:1};break;case G.SlideInTop:case G.SlideInBottom:r={"--fx-y":t===G.SlideInTop?`-${s}px`:`${s}px`,opacity:0},o={"--fx-y":`${a}px`,opacity:1};break;case G.ScaleIn:r={scale:0,opacity:0},o={scale:1,opacity:1};break;case G.FadeIn:r={opacity:0},o={opacity:1};break}return {from:r,to:o}},Ju=(t,n,e)=>{let{from:r,to:o}=pt(t);return n?{...r,...o}:e?r:o};var da=(t,n)=>{let e=useRef([]),r=useRef(false);return useEffect(()=>{t?.when||(r.current=false);},[t?.transition]),useEffect(()=>{let o=n?.current;if(!o||!t||!t.clearAtEnd)return;let s=a=>{e.current.includes(a.propertyName)&&t.clearAtEnd===true&&(o.style.transform="",o.style.filter="",e.current.forEach(u=>o.style.removeProperty(u)));};return o.addEventListener("transitionend",s),()=>o.removeEventListener("transitionend",s)},[t,n]),useEffect(()=>{if(typeof window>"u"||!n?.current)return;let o=n.current;(t?.scroll||t?.mouse)&&(o.style.willChange="transform",o.style.translate="var(--fx-x, 0px) var(--fx-y, 0px)",o.style.transition=`translate 0.1s ${t.curve?no(t.curve):"var(--spring)"}`);},[t,n]),useMemo(()=>{if(!t)return {style:{}};let{transition:o,from:s,to:a,exit:u,when:f,duration:l=.3,delay:c=0,curve:m,margin:i=0,offset:g=20,watch:T=[]}=t,b=f===false&&!r.current;f===true&&(r.current=true);let S={},{from:I,to:R}=o?pt(o,g,i):{from:s||{},to:a||{}};S=f===void 0?{...I,...R}:f?{...R}:u||I;let P=no(m),h=[],C=ur(S);e.current=Object.keys(C);let y={...C};return Object.keys(C).forEach(x=>{let N=x.startsWith("--")?"all":x;h.includes(N)||h.push(`${N} ${l}s ${P} ${c}s`);}),T.forEach(x=>{h.includes(x)||h.push(`${x} 0.1s ${P} 0s`);}),{style:{...y,transition:b?"none":h.join(", "),opacity:b?0:y.opacity,pointerEvents:b?"none":y.pointerEvents}}},[t,t?.when,t?.watch])},ce=da;var Nt=null,ga=(t,n)=>{let{as:e,fx:r,transition:o,skeleton:s,className:a,propsToRemove:u,draggable:f$1,dragOptions:l,style:c,...m}=t||{},i=typeof window<"u",g={},T={};if(f$1&&i&&!Nt&&(import('@zuzjs/hooks').then(R=>{Nt=R.useDrag;}).catch(R=>{console.error("Error loading useDrag:",R);}),Nt)){let R=Nt(l);g={onMouseDown:R.onMouseDown},T={transform:`translate(${R.position.x}px, ${R.position.y}px)`};}let b=o?{transition:o,duration:.3}:r||{},{style:S}=ce(b,n),I=ro(e??"");return {style:{...c,...S,...T},className:[a||"",I||"",s?.enabled?"--skeleton":"",f$1?"--draggable":""].join(" ").trim(),rest:{...g,...f(m,u?[...u,"skeleton"]:["skeleton"])}}},B=ga;var gr="(prefers-color-scheme: dark)",xa=typeof window>"u",yr=createContext(void 0),lo=t=>{let n=useContext(yr);if(!n){if(t===true)return;throw new Error("useColorScheme must be used within a ThemeProvider")}return n},X=lo,ba=({children:t,storageKey:n="--ucs",forceTheme:e,zuzMap:r,...o})=>(r&&pr(r),jsx(va,{storageKey:n,forceTheme:e,...o,children:t})),va=({children:t,storageKey:n,forceTheme:e,...r})=>{let[o,s]=useState(()=>e||hr(n,"system")),[a,u]=useState(()=>e||hr(n)),f=i=>(i||(i=window.matchMedia(gr)),i.matches?"dark":"light"),l=useCallback(i=>{let g=i=="system"?f():i,T=document.documentElement;T.setAttribute("color-scheme",g),T.style.colorScheme=g,u(g);},[f]),c=useCallback(i=>{s(i),localStorage.setItem(n,i),l(i);},[o]),m=useCallback(i=>{let g=f(i);u(g),o==="system"&&l("system");},[o]);return useEffect(()=>{o==null&&window.localStorage.getItem(n);},[o]),useEffect(()=>{window.matchMedia(gr).addEventListener("change",m);},[m]),useEffect(()=>{let i=g=>{g.key==n&&(g.newValue?c(g.newValue):c("system"));};return window.addEventListener("storage",i),()=>window.removeEventListener("storage",i)},[c]),useEffect(()=>{l(e||o||"system");},[o]),jsxs(yr,{value:{colorScheme:o,resolvedScheme:a,setColorScheme:c,...r},children:[e?null:jsx("script",{suppressHydrationWarning:true,dangerouslySetInnerHTML:{__html:`const el = document.documentElement
2
2
  const themes = ['light', 'dark']
3
3
  let theme = localStorage.getItem(\`${n}\`) || "system";
4
4
  if (theme === "system") {
5
5
  theme = window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
6
6
  }
7
7
  document.documentElement.setAttribute("color-scheme", theme);
8
- document.documentElement.style.colorScheme = theme;`}}),jsx(io,{children:t})]})},fr=(t,n)=>{if(ba)return;let e;try{e=localStorage.getItem(t)||void 0;}catch{}return e||n};var gr=({ref:t,...n})=>{let{style:e,...r}=n,{style:o,className:s,rest:a}=B(r);return jsx("span",{ref:t,style:e,className:s,...a})};gr.displayName="Zuz.Span";var te=gr;var yr=forwardRef((t,n)=>{let{name:e,pathCount:r,variant:o,color:s,...a}=t,{variant:u}=X(true),{className:f,style:l,rest:c}=B(a);return jsx("div",{style:{color:s,...l},className:`icon-${e} --icon --${o||u||U.Small} ${f}`.trim(),ref:n,...c,children:Array(r||0).fill(0).map((p,i)=>jsx(te,{className:`path${i+1}`},`${e}-layer-${i}`))})});yr.displayName="Zuz.Icon";var ee=yr;var le={Simple:"SIMPLE",Roller:"ROLLER",Wave:"Wave"};var xr=t=>{let{type:n,variant:e,color:r,...o}=t,{className:s,style:a,rest:u}=B(o),{spinner:f}=X(true),l=()=>{switch(n||f?.type||le.Simple){case le.Simple:return null;case le.Wave:return jsxs(Fragment$1,{children:[jsx(m,{as:"--bar --bar1"}),jsx(m,{as:"--bar --bar2"}),jsx(m,{as:"--bar --bar3"})]});case le.Roller:return null}};return jsx(m,{className:`${s} --spinner --${(n||f?.type||le.Simple).toLowerCase()} --${e||f?.variant||U.Small}`.trim(),style:{...a},...u,children:l()})};xr.displayName="Zuz.Spinner";var ve=xr;var Nt={Loading:"loading",Normal:"normal"};var vr=({ref:t,...n})=>{let{reset:e,kind:r="solid",variant:o,icon:s,iconSize:a,children:u,withLabel:f,spinner:l,state:c,disabled:p,...i}=n,{style:g,className:T,rest:y}=B(i),{variant:S}=X(true);return jsxs("button",{className:`--button --${r} --${o||S} flex aic ${e?"":"jcc"} ${s?"--with-icon":""} ${T}`.trim().replace(/\s+/g," "),style:g,ref:t,disabled:c==Nt.Loading||n.skeleton?.enabled||p,...y,children:[c==Nt.Loading&&jsx(ve,{variant:o||S,type:l||le.Simple}),(!c||c==Nt.Normal)&&jsxs(Fragment$1,{children:[s&&jsx(ee,{variant:a,name:s}),f===true?jsx(te,{children:u}):u]})]})};vr.displayName="Zuz.Button";var $=vr;var Sr=forwardRef((t,n)=>{let{h:e,html:r,children:o,lines:s,...a}=t,{style:u,className:f,rest:l}=B(a),c=`h${t.h||1}`;return jsx(c,{ref:n,style:u,className:f,...l,children:r?jsx(te,{dangerouslySetInnerHTML:{__html:r}}):o})});Sr.displayName="Zuz.Text";var V=Sr;var Ba=t=>{let{label:n,labelColor:e,icon:r,iconColor:o,index:s,className:a,onSelect:u}=t;return n=="-"?jsx(m,{className:"--line"}):jsxs($,{reset:true,onClick:f=>u?.(t),className:`--item ${a||""}`.trim(),children:[jsx(m,{as:"--icon",children:jsx(ee,{name:r,className:"--ico",style:o?{color:o}:{}})}),jsx(V,{className:"--lbl flex aic",style:e?{color:e}:{},children:n})]})},Cr=Ba;var Rr=({ref:t,...n})=>{let{id:e,as:r,fx:o,offsetX:s,offsetY:a,parent:u,event:f,arrow:l,when:c,items:p,header:i,footer:g,origin:T=st.TopRight,...y}=n,[S,I]=useState(false),[R,P]=useState(p||[]),{position:h,targetRef:C,calculatedAnchor:b}=useAnchorPosition(u?.current,f,{offsetX:s,offsetY:a,preferredAnchor:T}),N=u&&h.top>u.current.getBoundingClientRect().bottom?"--arrow-top":"--arrow-bottom",D=useMemo(()=>{let W=b.toLowerCase();return W.includes("left")?"--arrow-left":W.includes("right")?"--arrow-right":"--arrow-center"},[b]),k=h.top!==0||h.left!==0;useEffect(()=>{c&&k?I(true):c||I(false);},[c,k]);let{className:A,style:L,rest:H}=B(y),z=me({...o?.transition?{transition:o.transition??Y.SlideInBottom}:{from:{opacity:0,scale:.8,y:-10},to:{opacity:1,scale:1,y:0}},curve:o?.curve??q.EaseInOut,duration:o?.duration??.05,when:S&&k});return jsxs(m,{ref:C,className:`--contextmenu ${l||u!=null?`--has-arrow ${N} ${D}`:""} abs flex cols ${A}`.trim(),"aria-hidden":!S,style:{...L,...z.style,top:h.top,left:h.left,visibility:k?"visible":"hidden",transformOrigin:b},...H,children:[typeof i=="function"?createElement(i):i,R.map((W,d)=>jsx(Cr,{...W,index:d},`context-${W.label.toLowerCase()}-${d}`)),typeof g=="function"?createElement(g):g]})};Rr.displayName="Zuz.ContextMenu";var co=Rr;var Ir=forwardRef((t,n)=>{let{children:e,fx:r,when:o,fxDelay:s,fxStep:a,classToIgnore:u,...f}=t,l=X(true),c=useDelayed(),p=r||l?.group?.fx,i=s||l?.group?.fxDelay,g=a||l?.group?.fxStep,T=u||l?.group?.classToIgnore||"-fx",y=useMemo(()=>p?addPropsToChildren(e,S=>{if(S.type===Fragment)return false;let I=S.props||{},R="fx"in I,P=I.as?Array.isArray(I.as)?I.as.join(" "):I.as:I.className||"",h=typeof P=="string"&&P.includes(T);return !R&&!h},S=>({fx:{...p,delay:(i||0)+S*(g||.1),when:o??(r?.when||c)}})):e,[e,o,c,p]);return jsx(m,{className:"--group",ref:n,...f,children:y})});Ir.displayName="Zuz.Group";var mo=Ir;var Br=forwardRef((t,n)=>{let{message:e,spinner:r,spinnerSize:o,color:s,when:a,hideMessage:u,...f}=t,{className:l,style:c,rest:p}=B(f),{spinner:i}=X(true);return "when"in t&&t.when==false?null:jsxs(mo,{fx:{transition:Y.SlideInBottom,curve:q.Liquid,duration:.5},fxDelay:.1,fxStep:.05,className:`--cover flex aic jcc cols abs fill nope nous ${l}`.trim(),style:{...c,backgroundColor:"var(--cover-bg)"},...p,children:[jsx(ve,{variant:o||i?.variant||U.Small,type:r||i?.type||le.Simple}),!u&&jsx(V,{className:"--label",style:{color:"var(--cover-label)"},children:e||"loading"})]})});Br.displayName="Zuz.Cover";var Te=Br;var Er=forwardRef((t,n)=>{let{when:e,...r}=t;return jsx(m,{ref:n,"aria-hidden":!e,className:"--overlay fixed fill",fx:{transition:Y.FadeIn,when:e},...r})});Er.displayName="Zuz.Overlay";var Ve=Er;var Ga=({action:t,render:n=true,message:e=""})=>jsx(m,{as:`--body flex aic rel ${t?"":"--no-action"}`.trim(),children:n?e:null}),Lr=Ga;var qa=({action:t,actionPosition:n,dialogID:e,variant:r})=>jsx(m,{as:`--footer flex aic rel ${n?n==ar.Center?"jcc":"":"jce"}`.trim(),children:t.map((o,s)=>jsx($,{variant:r,onClick:a=>o.handler?o.handler():o.onClick?o.onClick():console.log("onClick Handler missing"),as:"--action",children:o.label},`dialog-${e}-action-${o.key}`))}),kr=qa;var Xa={colorSchemeLight:jsxs("svg",{width:"24",height:"24",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",color:"currentcolor",shapeRendering:"geometricPrecision",viewBox:"0 0 24 24",children:[jsx("circle",{cx:"12",cy:"12",r:"5"}),jsx("path",{d:"M12 1v2M12 21v2M4.22 4.22l1.42 1.42M18.36 18.36l1.42 1.42M1 12h2M21 12h2M4.22 19.78l1.42-1.42M18.36 5.64l1.42-1.42"})]}),colorSchemeSystem:jsxs("svg",{width:"24",height:"24",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",color:"currentcolor",shapeRendering:"geometricPrecision",viewBox:"0 0 24 24",children:[jsx("rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",ry:"2"}),jsx("path",{d:"M8 21h8M12 17v4"})]}),colorSchemeDark:jsx("svg",{width:"24",height:"24",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",color:"currentcolor",shapeRendering:"geometricPrecision",viewBox:"0 0 24 24",children:jsx("path",{d:"M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79"})}),arrowDown:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:jsx("path",{d:"M17.919 8.18H6.079c-.96 0-1.44 1.16-.76 1.84l5.18 5.18c.83.83 2.18.83 3.01 0l1.97-1.97 3.21-3.21c.67-.68.19-1.84-.77-1.84z"})}),arrowUp:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:jsx("path",{d:"M18.68 13.978l-3.21-3.21-1.96-1.97a2.13 2.13 0 00-3.01 0l-5.18 5.18c-.68.68-.19 1.84.76 1.84h11.84c.96 0 1.44-1.16.76-1.84z"})}),search:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 34 34",children:jsx("path",{d:"M27.414,24.586l-5.077-5.077C23.386,17.928,24,16.035,24,14c0-5.514-4.486-10-10-10S4,8.486,4,14 s4.486,10,10,10c2.035,0,3.928-0.614,5.509-1.663l5.077,5.077c0.78,0.781,2.048,0.781,2.828,0 C28.195,26.633,28.195,25.367,27.414,24.586z M7,14c0-3.86,3.14-7,7-7s7,3.14,7,7s-3.14,7-7,7S7,17.86,7,14z"})}),close:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:jsx("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})}),eye:jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:[jsx("path",{fill:"#333",d:"M12 20.5c-4.299 0-8.24-3.023-10.544-8.086a1 1 0 010-.828C3.759 6.523 7.701 3.5 12 3.5s8.24 3.023 10.544 8.086a1.001 1.001 0 010 .828 18.14 18.14 0 01-1.391 2.52 1 1 0 11-1.666-1.106A15.87 15.87 0 0020.529 12C18.543 7.92 15.379 5.5 12 5.5S5.457 7.92 3.471 12c1.986 4.08 5.15 6.5 8.529 6.5a7.964 7.964 0 005.036-1.92 1 1 0 111.265 1.55A9.94 9.94 0 0112 20.5z"}),jsx("path",{fill:"#333",d:"M12 16a4.004 4.004 0 01-3.929-4.756 1 1 0 011.965.375A2 2 0 1014 12a2.034 2.034 0 00-2.053-1.999 1.04 1.04 0 01-1.043-.947.963.963 0 01.902-1.05L12 8a4 4 0 010 8z"})]}),eyeSlash:jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:[jsx("path",{fill:"#333",d:"M12 15c-4.132 0-7.98-1.214-10.294-3.249a1 1 0 111.32-1.502C4.986 11.972 8.34 13 12 13s7.014-1.028 8.974-2.751a1 1 0 111.32 1.502C19.98 13.786 16.132 15 12 15z"}),jsx("path",{fill:"#333",d:"M12 18a1 1 0 01-1-1v-3a1 1 0 012 0v3a1 1 0 01-1 1zM7.749 17.667a.964.964 0 01-.17-.014 1 1 0 01-.817-1.155l.505-2.935a1 1 0 111.97.339l-.504 2.935a1 1 0 01-.984.83zM3.636 16.306a1.001 1.001 0 01-.942-1.336l.978-2.745a1 1 0 111.884.672l-.978 2.745a1 1 0 01-.942.664zM16.251 17.667a1 1 0 01-.984-.83l-.505-2.935a1 1 0 011.97-.339l.506 2.935a1 1 0 01-.816 1.155.964.964 0 01-.17.014zM20.364 16.306a1 1 0 01-.942-.664l-.978-2.745a1 1 0 111.884-.672l.978 2.745a1.001 1.001 0 01-.942 1.336z"})]}),check:jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[" ",jsx("path",{d:"M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"})," "]}),[xe.Info]:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",children:jsx("path",{fill:"#292D32",d:"M21.56 10.738l-1.35-1.58c-.25-.3-.46-.86-.46-1.26v-1.7c0-1.06-.87-1.93-1.93-1.93h-1.7c-.4 0-.97-.21-1.27-.46l-1.58-1.35c-.69-.59-1.82-.59-2.51 0l-1.6 1.35c-.3.25-.86.46-1.26.46H6.17c-1.06 0-1.93.87-1.93 1.93v1.7c0 .39-.2.95-.45 1.25l-1.35 1.59c-.58.7-.58 1.82 0 2.5l1.35 1.59c.25.29.45.86.45 1.25v1.71c0 1.06.87 1.93 1.93 1.93h1.74c.39 0 .96.21 1.26.46l1.58 1.35c.69.59 1.82.59 2.51 0l1.58-1.35c.3-.25.86-.46 1.26-.46h1.7c1.06 0 1.93-.87 1.93-1.93v-1.7c0-.4.21-.96.46-1.26l1.35-1.58c.61-.68.61-1.81.02-2.51zm-10.31-2.61c0-.41.34-.75.75-.75s.75.34.75.75v4.83c0 .41-.34.75-.75.75s-.75-.34-.75-.75v-4.83zm.75 8.74c-.55 0-1-.45-1-1s.44-1 1-1c.55 0 1 .45 1 1s-.44 1-1 1z"})}),[xe.Warning]:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",children:jsx("path",{fill:"#292D32",d:"M19.51 5.85l-5.94-3.43c-.97-.56-2.17-.56-3.15 0L4.49 5.85a3.15 3.15 0 00-1.57 2.73v6.84c0 1.12.6 2.16 1.57 2.73l5.94 3.43c.97.56 2.17.56 3.15 0l5.94-3.43a3.15 3.15 0 001.57-2.73V8.58a3.192 3.192 0 00-1.58-2.73zm-8.26 1.9c0-.41.34-.75.75-.75s.75.34.75.75V13c0 .41-.34.75-.75.75s-.75-.34-.75-.75V7.75zm1.67 8.88c-.05.12-.12.23-.21.33a.99.99 0 01-1.09.21c-.13-.05-.23-.12-.33-.21-.09-.1-.16-.21-.22-.33a.986.986 0 01-.07-.38c0-.26.1-.52.29-.71.1-.09.2-.16.33-.21.37-.16.81-.07 1.09.21.09.1.16.2.21.33.05.12.08.25.08.38s-.03.26-.08.38z"})}),[xe.Error]:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",children:jsx("path",{d:"M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"})}),[xe.Success]:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",children:jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"})}),layers:jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 24 24",fill:"none",children:[jsx("path",{d:"M19.3697 4.89109L13.5097 2.28109C12.6497 1.90109 11.3497 1.90109 10.4897 2.28109L4.62969 4.89109C3.14969 5.55109 2.92969 6.45109 2.92969 6.93109C2.92969 7.41109 3.14969 8.31109 4.62969 8.97109L10.4897 11.5811C10.9197 11.7711 11.4597 11.8711 11.9997 11.8711C12.5397 11.8711 13.0797 11.7711 13.5097 11.5811L19.3697 8.97109C20.8497 8.31109 21.0697 7.41109 21.0697 6.93109C21.0697 6.45109 20.8597 5.55109 19.3697 4.89109Z",fill:"#292D32"}),jsx("path",{d:"M12.0003 17.04C11.6203 17.04 11.2403 16.96 10.8903 16.81L4.15031 13.81C3.12031 13.35 2.32031 12.12 2.32031 10.99C2.32031 10.58 2.65031 10.25 3.06031 10.25C3.47031 10.25 3.80031 10.58 3.80031 10.99C3.80031 11.53 4.25031 12.23 4.75031 12.45L11.4903 15.45C11.8103 15.59 12.1803 15.59 12.5003 15.45L19.2403 12.45C19.7403 12.23 20.1903 11.54 20.1903 10.99C20.1903 10.58 20.5203 10.25 20.9303 10.25C21.3403 10.25 21.6703 10.58 21.6703 10.99C21.6703 12.11 20.8703 13.35 19.8403 13.81L13.1003 16.81C12.7603 16.96 12.3803 17.04 12.0003 17.04Z",fill:"#292D32"}),jsx("path",{d:"M12.0003 22.0009C11.6203 22.0009 11.2403 21.9209 10.8903 21.7709L4.15031 18.7709C3.04031 18.2809 2.32031 17.1709 2.32031 15.9509C2.32031 15.5409 2.65031 15.2109 3.06031 15.2109C3.47031 15.2109 3.80031 15.5409 3.80031 15.9509C3.80031 16.5809 4.17031 17.1509 4.75031 17.4109L11.4903 20.4109C11.8103 20.5509 12.1803 20.5509 12.5003 20.4109L19.2403 17.4109C19.8103 17.1609 20.1903 16.5809 20.1903 15.9509C20.1903 15.5409 20.5203 15.2109 20.9303 15.2109C21.3403 15.2109 21.6703 15.5409 21.6703 15.9509C21.6703 17.1709 20.9503 18.2709 19.8403 18.7709L13.1003 21.7709C12.7603 21.9209 12.3803 22.0009 12.0003 22.0009Z",fill:"#292D32"})]}),play:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:jsx("path",{d:"M8 5v14l11-7z"})}),pause:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:jsx("path",{d:"M6 19h4V5H6zm8-14v14h4V5z"})}),next:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:jsx("path",{d:"m6 18 8.5-6L6 6zM16 6v12h2V6z"})}),prev:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:jsx("path",{d:"M6 6h2v12H6zm3.5 6 8.5 6V6z"})}),volumeHigh:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:jsx("path",{fill:"#292D32",d:"M22 11.25h-1.25V10c0-.41-.34-.75-.75-.75s-.75.34-.75.75v1.25H18c-.41 0-.75.34-.75.75s.34.75.75.75h1.25V14c0 .41.34.75.75.75s.75-.34.75-.75v-1.25H22c.41 0 .75-.34.75-.75s-.34-.75-.75-.75M14.02 3.782c-1.12-.62-2.55-.46-4.01.45l-2.92 1.83c-.2.12-.43.19-.66.19H5c-2.42 0-3.75 1.33-3.75 3.75v4c0 2.42 1.33 3.75 3.75 3.75h1.4300000000000002c.23 0 .46.07.66.19l2.92 1.83c.88.55 1.74.82 2.54.82a3 3 0 0 0 1.47-.37c1.11-.62 1.73-1.91 1.73-3.63v-9.18c0-1.72-.62-3.01-1.73-3.63"})}),volumeMute:jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[jsx("path",{fill:"#292D32",d:"M18 16.75a.75.75 0 0 1-.6-1.2 5.93 5.93 0 0 0 .72-5.84.75.75 0 0 1 .4-.98c.38-.16.82.02.98.4 1.02 2.42.67 5.23-.9 7.33-.15.19-.37.29-.6.29"}),jsx("path",{fill:"#292D32",d:"M19.828 19.25a.75.75 0 0 1-.6-1.2c2.14-2.85 2.61-6.67 1.23-9.96a.75.75 0 0 1 .4-.98c.38-.16.82.02.98.4 1.59 3.78 1.05 8.16-1.41 11.44-.14.2-.37.3-.6.3M14.04 12.958c.63-.63 1.71-.18 1.71.71v2.93c0 1.72-.62 3.01-1.73 3.63a3 3 0 0 1-1.47.37c-.8 0-1.66-.27-2.54-.82l-.64-.4c-.54-.34-.63-1.1-.18-1.55zM21.77 2.229c-.3-.3-.79-.3-1.09 0l-4.95 4.95c-.06-1.6-.66-2.8-1.72-3.39-1.12-.62-2.55-.46-4.01.45l-2.91 1.82c-.2.12-.43.19-.66.19H5c-2.42 0-3.75 1.33-3.75 3.75v4c0 2.42 1.33 3.75 3.75 3.75h.16l-2.94 2.94c-.3.3-.3.79 0 1.09.16.14.35.22.55.22s.39-.08.54-.23l18.46-18.46c.31-.3.31-.78 0-1.08"})]}),plus:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:jsx("path",{d:"M28 14H18V4a2 2 0 0 0-4 0v10H4a2 2 0 0 0 0 4h10v10a2 2 0 0 0 4 0V18h10a2 2 0 0 0 0-4"})}),add:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:jsx("path",{d:"M12 2C6.49 2 2 6.49 2 12s4.49 10 10 10 10-4.49 10-10S17.51 2 12 2m4 10.75h-3.25V16c0 .41-.34.75-.75.75s-.75-.34-.75-.75v-3.25H8c-.41 0-.75-.34-.75-.75s.34-.75.75-.75h3.25V8c0-.41.34-.75.75-.75s.75.34.75.75v3.25H16c.41 0 .75.34.75.75s-.34.75-.75.75"})}),chevronUp:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 24 24",children:jsx("path",{d:"m7 14 5-5 5 5z"})}),chevronBottom:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 24 24",children:jsx("path",{d:"m7 10 5 5 5-5z"})}),chevronRight:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 24 24",children:jsx("path",{d:"m10 17 5-5-5-5v10z"})}),chevronLeft:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 24 24",children:jsx("path",{d:"m14 7-5 5 5 5V7z"})}),chevronRightOutline:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 24 24",children:jsx("path",{d:"M8.59 16.59 13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"})}),chevronLeftOutline:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 24 24",children:jsx("path",{d:"M15.41 16.59 10.83 12l4.58-4.59L14 6l-6 6 6 6 1.41-1.41z"})}),chevronUpOutline:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 24 24",children:jsx("path",{d:"M7.41 15.41 12 10.83l4.59 4.58L18 14l-6-6-6 6z"})}),chevronDownOutline:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 24 24",children:jsx("path",{d:"M7.41 8.59 12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z"})}),bezier:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 24 24",fill:"none",children:jsx("path",{d:"M19.14 7.72C19.43 8.47 20.15 9 21 9C22.1 9 23 8.1 23 7C23 5.9 22.1 5 21 5C20.15 5 19.43 5.53 19.14 6.28C19.09 6.27 19.05 6.25 19 6.25H15V5.5C15 4.68 14.32 4 13.5 4H10.5C9.68 4 9 4.68 9 5.5V6.25H5C4.95 6.25 4.91 6.27 4.86 6.28C4.57 5.53 3.85 5 3 5C1.9 5 1 5.9 1 7C1 8.1 1.9 9 3 9C3.85 9 4.57 8.47 4.86 7.72C4.91 7.73 4.95 7.75 5 7.75H7.57C5.52 9.27 4.25 11.79 4.25 14.5C4.25 14.67 4.26 14.83 4.28 15H4C3.17 15 2.5 15.67 2.5 16.5V18.5C2.5 19.33 3.17 20 4 20H6C6.22 20 6.42 19.95 6.61 19.86C7.13 19.64 7.5 19.11 7.5 18.5V16.5C7.5 15.67 6.83 15 6 15H5.77C5.77 14.97 5.78 14.94 5.78 14.91C5.76 14.77 5.76 14.64 5.76 14.5C5.76 12.03 7.03 9.77 9.02 8.6C9.06 9.37 9.71 10 10.5 10H13.5C14.29 10 14.94 9.37 14.99 8.6C16.98 9.77 18.25 12.04 18.25 14.5C18.25 14.64 18.24 14.77 18.23 14.91C18.23 14.94 18.24 14.97 18.24 15H18C17.17 15 16.5 15.67 16.5 16.5V18.5C16.5 19.11 16.87 19.64 17.39 19.86C17.58 19.95 17.78 20 18 20H20C20.83 20 21.5 19.33 21.5 18.5V16.5C21.5 15.67 20.83 15 20 15H19.72C19.74 14.83 19.75 14.67 19.75 14.5C19.75 11.79 18.48 9.27 16.43 7.75H19C19.05 7.75 19.09 7.73 19.14 7.72Z",fill:"#292D32"})}),mouse:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 24 24",fill:"none",children:jsx("path",{d:"M13.2978 2.11468C13.0064 2.06339 12.75 2.29593 12.75 2.59185V5.45262C12.75 5.65098 12.8709 5.82564 13.0359 5.93583C13.5391 6.27202 13.87 6.84597 13.87 7.49906V9.49906C13.87 10.5291 13.03 11.3791 12 11.3791C10.96 11.3791 10.12 10.5291 10.12 9.49906V7.49906C10.12 6.84578 10.4583 6.27168 10.9639 5.93554C11.1291 5.82572 11.25 5.65098 11.25 5.45262V2.59249C11.25 2.29634 10.9935 2.0637 10.7019 2.11513C9.15243 2.38834 7.76579 3.13327 6.7 4.19906C5.34 5.55906 4.5 7.43906 4.5 9.49906V14.4991C4.5 18.6291 7.87 21.9991 12 21.9991C16.13 21.9991 19.5 18.6291 19.5 14.4991V9.49906C19.5 5.80857 16.813 2.73328 13.2978 2.11468Z",fill:"#292D32"})}),addKey:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 24 24",fill:"none",children:jsx("path",{d:"M20.9498 14.55L14.5598 20.94C13.1598 22.34 10.8598 22.34 9.44977 20.94L3.05977 14.55C1.65977 13.15 1.65977 10.85 3.05977 9.44L9.44977 3.05C10.8498 1.65 13.1498 1.65 14.5598 3.05L20.9498 9.44C22.3498 10.85 22.3498 13.15 20.9498 14.55Z",fill:"#292D32"})}),calendar:jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[jsx("path",{fill:"#292D32",d:"M8.25 5.75c-.41 0-.75-.34-.75-.75V2c0-.41.34-.75.75-.75S9 1.59 9 2v3c0 .41-.34.75-.75.75M15.75 5.75c-.41 0-.75-.34-.75-.75V2c0-.41.34-.75.75-.75s.75.34.75.75v3c0 .41-.34.75-.75.75M12 14.09c.52 0 .9-.31.9-.8 0-.5-.38-.79-.9-.79s-.9.29-.9.79c0 .49.38.8.9.8M12 17c.629 0 1.14-.416 1.14-.93 0-.513-.511-.93-1.14-.93-.63 0-1.14.417-1.14.93s.51.93 1.14.93"}),jsx("path",{fill:"#292D32",d:"M19.57 4.5c-.66-.49-1.61-.02-1.61.81v.1c0 1.17-.84 2.25-2.01 2.37-1.35.14-2.49-.92-2.49-2.24V4.5c0-.55-.45-1-1-1h-.92c-.55 0-1 .45-1 1v1.04c0 .79-.41 1.49-1.03 1.88-.09.06-.19.11-.29.16q-.135.075-.3.12c-.12.04-.25.07-.39.08q-.24.03-.48 0c-.14-.01-.27-.04-.39-.08q-.15-.045-.3-.12c-.1-.05-.2-.1-.29-.16-.63-.44-1.03-1.2-1.03-2.01v-.1c0-.77-.82-1.23-1.47-.9-.01.01-.02.01-.03.02-.04.02-.07.04-.11.07-.03.03-.07.05-.1.08-.28.22-.53.47-.74.74-.11.12-.2.25-.28.38a3.498 3.498 0 0 0-.27.46c-.02.02-.03.03-.03.05-.06.12-.12.24-.16.37-.03.05-.04.09-.06.14-.06.15-.1.3-.14.45-.04.14-.07.29-.09.44a5.902 5.902 0 0 0-.06.76v8.76A4.87 4.87 0 0 0 7.37 22h9.26a4.87 4.87 0 0 0 4.87-4.87V8.37c0-1.59-.76-2.98-1.93-3.87M12 18.25c-1.55 0-2.5-.77-2.5-2.01 0-.68.35-1.27.96-1.62-.44-.31-.73-.77-.73-1.4 0-1.3 1.04-1.97 2.27-1.97s2.26.67 2.26 1.97c0 .63-.28 1.09-.73 1.4.62.35.97.94.97 1.62 0 1.24-.96 2.01-2.5 2.01"})]}),done:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:jsx("path",{d:"M9 16.2 4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4z"})}),doneAll:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:jsx("path",{d:"m18 7-1.41-1.41-6.34 6.34 1.41 1.41zm4.24-1.41L11.66 16.17 7.48 12l-1.41 1.41L11.66 19l12-12zM.41 13.41 6 19l1.41-1.41L1.83 12z"})}),pending:jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[jsx("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2M12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"}),jsx("path",{d:"M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z"})]})},O=Xa;var Ya=({title:t="Alert",onClose:n})=>jsxs(m,{as:"--head flex aic rel",children:[jsx(m,{as:`--${t?"title":"dot"} flex aic jcc rel`,children:t}),jsx($,{onClick:e=>n(),className:"--closer abs center-v",children:O.close})]}),Dr=Ya;var $r=({ref:t,...n})=>{let{index:e,id:r,title:o,message:s,transition:a,curve:u,speed:f,type:l,action:c,actionPosition:p,spinner:i,loadingMessage:g,variant:T,inBackground:y,forceClose:S,forceLoading:I,onClose:R,onShow:P,onHide:h,...C}=n,b=useMemo(()=>uuid(12),[]),[x,N]=useState(o||""),[D,k]=useState(s||""),[A,L]=useState(l||Ue.Dialog),[H,z]=useState(false),[W,d]=useState(true),[E,_]=useState(c||null),[G,F]=useState(false),{variant:K,spinner:Q,dialog:J}=X(true),j=T||J?.variant||K||U.Small,{style:de,className:oe,rest:ge}=B(C),we=useRef(null),Se=me({when:H,duration:f||J?.speed||.3,delay:J?.delay||.1,transition:a||J?.transition||Y.SlideInBottom,curve:u||J?.curve||q.EaseInOut,watch:["scale","filter","transform"]}),ae=()=>{z(false),R(r);};useEffect(()=>{L(Ue.Dialog),k(s),N(x),E&&_(E.reduce((se,he)=>(se.push({...he,key:he.key||uuid(12)}),se),[])),z(true),setTimeout(()=>P?P():()=>{},500);},[]),useEffect(()=>{S&&ae();},[S]),useEffect(()=>{I!=null&&F(I);},[I]);let Z=useMemo(()=>1e4+e*10,[e]);return jsxs(Fragment$1,{children:[jsx(Ve,{style:{zIndex:Z},when:H}),jsxs(m,{as:`--dialog --${(l??Ue.Default).toLowerCase()} ${H?"--visible":""} ${oe} fixed abc`.trim(),style:{...Se.style,zIndex:Z+1,pointerEvents:y==true?"none":"auto",...y==true?{scale:"0.92",filter:"blur(2px)"}:{}},...ge,ref:we,children:[jsx(Dr,{title:x,onClose:ae}),jsx(Lr,{message:D,render:W,action:E}),E&&E.length>0&&jsx(kr,{variant:j,action:E,dialogID:b,actionPosition:p}),jsx(Te,{when:G,spinner:i||J?.spinner||Q?.type||le.Simple,message:g||J?.loadingMessage})]})]})};$r.displayName="Zuz.Dialog";var uo=$r;var fo=class{stack=[];SCROLL_CLASS="--no-scroll";updateScrollLock(){typeof window>"u"||(this.stack.length>0?document.body.classList.add(this.SCROLL_CLASS):document.body.classList.remove(this.SCROLL_CLASS));}isTop(n){return this.stack[this.stack.length-1]===n}push(n){this.stack.includes(n)||(this.stack.push(n),this.updateScrollLock());}pop(n){this.stack=this.stack.filter(e=>e!==n),this.updateScrollLock();}handleEscape(){let n=this.stack[this.stack.length-1];return n?(n(),true):false}get count(){return this.stack.length}},lt=new fo;var zr=forwardRef((t,n)=>{let{speed:e,style:r,...o}=t,{rootRef:s,containerRef:a,thumbY:u,thumbX:f,onScrollY:l,onScrollX:c}=useScrollbar(e||1),{style:p,className:i,rest:g}=B(o);return useEffect(()=>{let T=a.current;if(!T)return;let y=()=>{window.dispatchEvent(new Event("resize"));};return T.addEventListener("scroll",y),()=>T.removeEventListener("scroll",y)},[]),jsxs(m,{ref:s,className:i.trim(),as:"--scrollview rel",children:[jsx(m,{as:`--scroll-content ${i}`.trim(),ref:a,style:r||{},children:g.children}),jsx(m,{as:"--scroll-track --track-y --abs",children:jsx(m,{as:"--scroll-thumb --abs",ref:u,onMouseDown:l})}),jsx(m,{as:"--scroll-track --track-x --abs",children:jsx(m,{as:"--scroll-thumb --abs",ref:f,onMouseDown:c})})]})});zr.displayName="Zuz.ScrollView";var go=zr;var _r=({ref:t,...n})=>{let{id:e,index:r,from:o,speed:s,children:a,margin:u,animation:f,prerender:l,inBackground:c,forceClose:p,forceLoading:i,onClose:g,...T}=n,{drawer:y}=X(true),[S,I]=useState(a),[R,P]=useState(false),[h,C]=useState(l??(y?.prerender||true)),[b,x]=useState(false),N=()=>{P(false),g?.(e??-1);},{className:D,style:k,rest:A}=B(T),L=useMemo(()=>[{keys:[KeyCode.Escape],callback:()=>{lt.isTop(N)&&N();}}],[R]);useShortcuts(L),useEffect(()=>{I(a);},[a]),useEffect(()=>(R?lt.push(N):lt.pop(N),()=>lt.pop(N)),[R]),useEffect(()=>{P(true);},[]),useEffect(()=>{p&&N();},[p]),useEffect(()=>{i!=null&&x(i);},[i]);let H=o||y?.from||ce.Left,z=useMemo(()=>{switch(H){case ce.Left:return {from:{x:"-100vw"},to:{x:0}};case ce.Right:return {from:{x:"100vw"},to:{x:0}};case ce.Top:return {from:{y:"-100vh"},to:{y:0}};case ce.Bottom:return {from:{y:"100vh"},to:{y:0}};default:return {from:{x:"-100vw"},to:{x:0}}}},[o,y?.from]),W=me({from:{...z.from,opacity:0},to:{...z.to,opacity:1},when:R,curve:f||y?.animation||q.EaseInOut,duration:s||y?.speed||.5,watch:["scale","filter"]}),d=useMemo(()=>1e4+(r||1)*10,[r]);return jsxs(Fragment$1,{children:[jsx(Ve,{onClick:E=>{R&&N();},when:R,style:{zIndex:d}}),jsxs(m,{ref:t,"aria-hidden":!R,className:`--drawer flex cols ${D} --${H.toLowerCase()} fixed`,style:{...k,...W.style,"--m":`${u||y?.margin||0}px`,zIndex:d+1,pointerEvents:c==true?"none":"auto",...c==true?{scale:"0.92",filter:"blur(2px)"}:{}},...A,children:[o==ce.Top||o==ce.Bottom?jsx(m,{className:"--handle"}):null,jsxs(go,{as:"rel",children:[h||R?S:null,jsx(Te,{when:b})]})]})]})};_r.displayName="Zuz.Drawer";var bo=_r;var Zr=forwardRef((t,n)=>{let{progress:e,type:r,animated:o,...s}=t,a=useRef(null);useImperativeHandle(n,()=>({setProgress:c=>{a.current.style.width=`${c*100}%`,a.current.setAttribute("data-value",c+"");},getProgress:()=>+(a.current.getAttribute("data-value")||0)}),[]),useEffect(()=>{e&&a.current&&(o?setTimeout(()=>a.current.style.width=`${e*100}%`,500):a.current.style.width=`${e*100}%`,a.current.setAttribute("data-value",e+""));},[e,a.current]);let{className:u,style:f,rest:l}=B(s);return jsx(m,{className:`--progress ${o?"--animated":""} flex rel ${u}`.trim(),style:f,...l,children:jsx(m,{ref:a,className:"--bar rel"})})});Zr.displayName="Zuz.ProgressBar";var $e=Zr;var Lt=(s=>(s.Default="default",s.Success="success",s.Error="error",s.Warn="warn",s.Promise="promise",s))(Lt||{}),Mt=(a=>(a.TopLeft="TopLeft",a.TopCenter="TopCenter",a.TopRight="TopRight",a.BottomLeft="BottomLeft",a.BottomCenter="BottomCenter",a.BottomRight="BottomRight",a))(Mt||{}),Kr=(e=>(e.Stack="stack",e.Individual="individual",e))(Kr||{}),Wr={success:"Action Successful",error:"Something Went Wrong",warn:"Heads Up",default:"Notice"};var pi=t=>{let{index:n,id:e,type:r,icon:o,title:s,message:a,duration:u,sticky:f=false,actions:l=[],position:c,style:p,isHovered:i,total:g,progress:T,forceClose:y,variant:S,onClick:I,onClose:R}=t,[P,h]=useState(false),[C,b]=useState(false),{toast:x}=X(true),N=C||y,D=c||x?.position||"TopCenter",k=r||x?.type||"default",A=p||x?.style||"stack",L=u||x?.duration||4,H=T||x?.progress||false,z=useRef(L*1e3),W=useRef(void 0),d=useRef(void 0),E=useRef(null),_=me({when:P&&!N,duration:.3,transition:x?.transition||(D.includes("Top")?Y.SlideInTop:D.includes("Bottom")?Y.SlideInBottom:D.includes("Left")?Y.SlideInLeft:Y.SlideInRight),curve:x?.curve||q.EaseInOut,watch:["transform","opacity","scale","filter"]});useEffect(()=>{h(true);let oe=ge=>{if(d.current!==void 0){let we=ge-d.current;if(!i&&!f&&!N&&(z.current-=we,E.current)){let Se=Math.max(0,z.current/(L*1e3)*100);E.current?.setProgress?.(Se/100);}}d.current=ge,z.current<=0?b(true):W.current=requestAnimationFrame(oe);};return W.current=requestAnimationFrame(oe),()=>{W.current&&cancelAnimationFrame(W.current);}},[i,f,N,L]),useEffect(()=>{if(N){let oe=setTimeout(()=>{R?.(e);},350);return ()=>clearTimeout(oe)}},[N,e]);let G=A==="stack",F=i?n*65:n*8,K=i?1:Math.max(.85,1-n*.05),Q=i?1:Math.max(.4,1-n*.2),J=()=>{I?I():(!l||l.length===0)&&b(true);},j=_.style.transform||"translate(0, 0)",de=N?j:`${j} translateY(${D.includes("Top")?F:-F}px) scale(${K})`;return jsxs(m,{onClick:J,as:`--snack --${N?"hidden":"visible"} --${S||x?.variant||U.Medium} --${k} --${D.toLowerCase()} abs flex aic`,style:{..._.style,zIndex:1e3-n,pointerEvents:N?"none":"auto",opacity:N?_.style.opacity:Q,transform:de,filter:!N&&G&&!i&&n>0?"blur(1px)":"none",cursor:!l||l.length===0?"pointer":"default",transition:`${_.style.transition}, transform 0.3s ease, opacity 0.3s ease`},children:[jsx(m,{as:"--ico flex aic jcc",children:o?jsx(ee,{name:o}):jsx(m,{as:"--no-icon"})}),jsxs(m,{as:"--meta flex cols",children:[jsx(V,{as:"--tt",children:s||Wr[r]}),jsx(V,{as:"--tm",children:a})]}),l&&l.length>0&&jsx(m,{as:"--actions flex gap:5",children:l.map((oe,ge)=>jsx($,{as:"--snack-btn bold",onClick:we=>{we.stopPropagation(),oe.onClick();},children:oe.label},ge))}),H&&jsx($e,{as:"abs",ref:E})]})},vo=pi;var pe=createContext(null),yi=({ref:t,...n})=>{let r=useContext(pe)?.depth??0,[o,s]=useState(null),[a,u]=useState(null),[f,l]=useState(false),[c,p]=useState([]),i=useDelayed(),g=useRef(0),T=()=>++g.current,y=()=>{l(false),setTimeout(()=>u(null),200);};useImperativeHandle(t,()=>({add(h){let C=T(),b={id:C,...h};return p(x=>[...x,b]),C},openMenu(h){l(false),setTimeout(()=>{u({id:T(),type:"menu",props:h}),l(true);},16);},remove(h){p(C=>C.map(b=>b.id===h?{...b,props:{...b.props,forceClose:true}}:b)),a?.id===h&&y();},loading(h,C){p(b=>b.map(x=>x.id===h?{...x,props:{...x.props,forceLoading:C}}:x)),a?.id===h&&y();},clear(h){p(c.filter(C=>C.type!=h));}})),useEffect(()=>{if(a&&f){let h=()=>y();return document.addEventListener("click",h),()=>document.removeEventListener("click",h)}},[a,f,y]);let S=h=>{setTimeout(()=>{p(C=>C.filter(b=>b.id!==h)),a?.id===h&&u(null);},250);},I=useMemo(()=>[...c.filter(h=>h.type!="toast")],[c]);if(!i)return null;let R=c.filter(h=>h.type=="toast").reverse(),P=Object.values(Mt);return createPortal(jsxs(m,{as:"--zuz-layers-wrapper fixed fill nope",style:{zIndex:9999+r},children:[I.map((h,C)=>{let b=C<I.length-1;return h.type==="dialog"?jsx(uo,{onClose:S,index:C,id:h.id,...h.props,inBackground:b},`layer-${h.type}-${h.id}`):h.type==="drawer"?jsx(bo,{onClose:S,index:C,id:h.id,...h.props,inBackground:b},`layer-${h.type}-${h.id}`):null}),P.map(h=>{let C=R.filter(b=>(b.props.position||"TopCenter")===h);return C.length===0?null:jsx(m,{onMouseEnter:()=>s(h),onMouseLeave:()=>s(null),as:`--toast-container fixed --${h.toLowerCase()} flex cols`,style:{pointerEvents:"auto",zIndex:"var(--max-z-index)"},children:C.map((b,x)=>jsx(vo,{index:x,total:C.length,isHovered:o===h,onClose:S,id:b.id,...b.props},b.id))},h)}),a&&jsx(m,{as:"--zuz-layer-menus fixed fill nope",style:{zIndex:"var(--max-z-index)"},children:jsx(co,{onClose:y,when:f,...a.props},`menu-${a.id}`)})]}),document.body)},xi=({children:t})=>{let n=useContext(pe),e=n?n.depth+1:0,r=useRef(null),o=useMemo(()=>({add:s=>r.current?.add(s),openMenu:s=>r.current?.openMenu(s),remove:s=>r.current?.remove(s),loading:(s,a)=>r.current?.loading(s,a),clear:s=>r.current?.clear(s),depth:e,isSubLayer:!!n}),[n]);return jsxs(pe.Provider,{value:o,children:[t,jsx(yi,{ref:r})]})},io=xi;var vi=()=>{let t=useContext(pe);if(!t)throw new Error("useContextMenu must be used inside <LayersProvider>");return {showContextMenu:(r,o,s)=>{r.preventDefault(),t.openMenu({event:r,items:o,origin:s});},showMenu:(r,{items:o,origin:s,offsetX:a,offsetY:u,transition:f,curve:l,arrow:c,duration:p,header:i,footer:g})=>{t.openMenu({fx:{transition:f,curve:l,duration:p},parent:r,items:o,origin:s||st.TopCenter,offsetX:a,offsetY:u,arrow:c,header:i,footer:g});},hide:t.clear}},wi=vi;var Ci=()=>{let t=useContext(pe);if(!t)throw new Error("useDialog must be used inside <LayersProvider>");let n=()=>t.clear("dialog"),e=s=>t.remove(s),r=(s,a)=>t.loading(s,a);return {clearAll:n,show:s=>{let a=t.add({type:"dialog",props:{...s,type:Ue.Dialog}});return {id:a,setLoading:u=>r(a,u),hide:()=>e(a)}},hide:e}},Ti=Ci;var Ri=()=>{let t=useContext(pe);if(!t)throw new Error("useDialog must be used inside <LayersProvider>");let n=()=>t.clear("drawer"),e=s=>t.remove(s),r=(s,a)=>t.loading(s,a),o=s=>{let a=t.add({type:"drawer",props:s});return {id:a,setLoading:u=>r(a,u),close:()=>e(a)}};return {clearAll:n,open:s=>o({children:s}),right:s=>o({children:s,from:ce.Right}),left:s=>o({children:s,from:ce.Left}),top:s=>o({children:s,from:ce.Top}),bottom:s=>o({children:s,from:ce.Bottom}),close:e}},Ii=Ri;var Bi=(t,n,e={})=>{let[r,o]=useState(null),[s,a]=useState(false),{duration:u=.25,curve:f=q.EaseOutBack,borderRadius:l={from:40,to:24},targetWidth:c=320}=e;return useLayoutEffect(()=>{n&&t.current?(o(t.current.getBoundingClientRect()),a(true)):n||a(false);},[n,t]),{style:me({from:{opacity:0,width:r?.width,height:r?.height,borderRadius:l.from},to:{opacity:1,width:c,height:"auto",borderRadius:l.to},curve:f,duration:u,when:s&&n}).style,isMeasured:s,sourceRect:r}},Ei=Bi;var Oi=(t,n={})=>{let{offset:e=8,direction:r="bottom",container:o=null,triggerRef:s=null}=n,a=useRef(null),u=useCallback(()=>{let f=t.current;if(!f)return;let l=s?.current||f.parentElement;if(!l){console.warn("usePosition: No trigger element found. Positioning may not work.");return}let c=f.getBoundingClientRect(),p=l.getBoundingClientRect(),i,g;o?(i=o.getBoundingClientRect(),g="absolute"):(window.getComputedStyle(f).position==="fixed"?g="fixed":g="absolute",g==="fixed"?i={top:0,left:0,right:window.innerWidth,bottom:window.innerHeight,width:window.innerWidth,height:window.innerHeight}:i={top:0,left:0,right:window.innerWidth,bottom:window.innerHeight,width:window.innerWidth,height:window.innerHeight}),f.style.position!==g&&(f.style.position=g),a.current=g;let S=0,I=0;switch(r){case "top":S=p.top-c.height-e,I=p.left,S<i.top&&p.bottom+c.height+e<=i.bottom&&(S=p.bottom+e);break;case "bottom":S=p.bottom+e,I=p.left,S+c.height>i.bottom&&p.top-c.height-e>=i.top&&(S=p.top-c.height-e);break;case "left":S=p.top,I=p.left-c.width-e,I<i.left&&p.right+c.width+e<=i.right&&(I=p.right+e);break;case "right":S=p.top,I=p.right+e,I+c.width>i.right&&p.left-c.width-e>=i.left&&(I=p.left-c.width-e);break}if(S=Math.max(i.top,Math.min(S,i.bottom-c.height)),I=Math.max(i.left,Math.min(I,i.right-c.width)),a.current==="fixed")f.style.top=`${S}px`,f.style.left=`${I}px`;else {let R;f.offsetParent?R=f.offsetParent.getBoundingClientRect():R={top:0,left:0};let P=S-R.top+window.scrollY,h=I-R.left+window.scrollX;f.style.top=`${P}px`,f.style.left=`${h}px`;}},[t,s,e,r,o]);return useEffect(()=>{let f=t.current;if(!f)return;let l=s?.current||f.parentElement;if(!l){console.warn("usePosition: No trigger element found. Positioning may not work.");return}let c=new ResizeObserver(u);return c.observe(f),l&&c.observe(l),u(),window.addEventListener("resize",u),window.addEventListener("scroll",u,true),()=>{c.disconnect(),l&&c.disconnect(),window.removeEventListener("resize",u),window.removeEventListener("scroll",u,true);}},[t,r,e,o,s]),{postion:a.current,reposition:u}},pt=Oi;var Hi=()=>{let t=useContext(pe);if(!t)throw new Error("useToast must be used inside <LayersProvider>");let n=(p,i)=>t.add({type:"toast",props:{...i,type:p}}),r=p=>t.remove(p),l=(p,i,g)=>{let T=n(p,{...i,sticky:i.sticky??false,actions:[{label:g?.label||"Ok",onClick:()=>{g?.onClick?.(),r(T);}}]});return T},c=(p,i,g,T)=>{let y=n(p,{...i,sticky:true,actions:[{label:T?.label||"Cancel",onClick:()=>{T?.onClick?.(),r(y);}},{label:g?.label||"Ok",onClick:()=>{g?.onClick?.(),r(y);}}]});return y};return {ok:(p,i)=>l("default",p,i),success:(p,i)=>l("success",p,i),error:(p,i)=>l("error",p,i),confirm:(p,i,g)=>c("default",p,i,g),warn:(p,i)=>l("warn",p,i)}},Vi=Hi;var $i=()=>{let t=useContext(pe);if(!t)throw new Error("useToast must be used inside <LayersProvider>");let n=(l,c)=>t.add({type:"toast",props:{...c,type:l}});return {show:(l,c,p,i)=>n("default",{title:l,message:c,icon:p,duration:i}),hide:l=>t.remove(l),success:(l,c,p,i)=>n("success",{title:l,message:c,icon:p,duration:i}),error:(l,c,p,i)=>n("error",{title:l,message:c,icon:p,duration:i}),warn:(l,c,p,i)=>n("warn",{title:l,message:c,icon:p,duration:i}),promise:(l,c,p,i)=>n("promise",{title:l,message:c,icon:p,duration:i}),clearAll:()=>t.clear("toast")}},wo=$i;var en=({ref:t,style:n,...e})=>{let r=useRef(null),o=useMemo(()=>t&&typeof t!="function"&&t.current?t:r,[t]),{style:s,className:a,rest:u}=B(e,o);return jsx("div",{ref:t||r,style:{...s,...n||{}},className:a,...u})};en.displayName="Zuz.Box";var m=en;var on=forwardRef((t,n)=>{let{title:e,message:r,...o}=t,[s,a]=useState(false);return jsxs(m,{className:"--accordion flex cols",...o,children:[jsxs($,{onClick:u=>a(!s),className:`--toggle flex aic ${s?"--open":""}`.trim(),children:[jsx(V,{className:"--label flex",children:e}),jsx(m,{className:"--arrow flex",children:s?O.arrowUp:O.arrowDown})]}),s&&jsx(m,{className:"--detail",children:r})]})});on.displayName="Zuz.Accordion";var Wi=on;var Gi=({label:t,icon:n,onClick:e,idx:r,selected:o})=>jsx($,{onClick:e,onMouseMove:s=>document.documentElement.style.setProperty("--tip-m",`${r}`),className:`--action ${o?"--selected":""} aic jcc rel`.trim(),children:typeof n=="string"?jsx(ee,{name:n}):n}),nn=Gi;var sn=forwardRef((t,n)=>{let{items:e,name:r,selected:o,position:s,...a}=t,u=useRef(null),[f,l]=useState(o||e[0].tag||0),c=useCallback(({x:S,y:I})=>{if(u.current){let R=u.current.getBoundingClientRect();document.documentElement.style.setProperty("--tip-x",`${S-R.left}`),document.documentElement.style.setProperty("--tip-y",`${I-R.top}`),document.documentElement.style.setProperty("--tip-s","1");}},[]),p=useCallback(()=>{u.current&&(u.current.removeEventListener("pointerleave",p),u.current.removeEventListener("pointermove",c),document.documentElement.style.setProperty("--tip-s","0"));},[]),i=useCallback(()=>{u.current&&(u.current.addEventListener("pointerleave",p),u.current.addEventListener("pointermove",c));},[]);useEffect(()=>{u.current&&(document.documentElement.style.setProperty("--tip-w",e.reduce((S,I)=>I.label.length>S.length?I.label:S,"").length.toString()),document.documentElement.style.setProperty("--tip-s","0"),document.documentElement.style.setProperty("--tip-l",`${e.length}`),u.current?.addEventListener("pointerenter",i));},[]);let{className:g,style:T,rest:y}=B(a);return jsxs(m,{ref:u,style:T,className:[`--actionbar flex aic ${g}`,`${!s||s==re.Auto?"rel":`--${s}`}`].join(" ").trim(),...y,children:[e.map((S,I)=>jsx(nn,{selected:f===S.tag||o==I,...S,idx:I},`actionbar-action-${S.label.toLowerCase().replace(/\s+/g,"-")}`)),jsx(m,{className:"--tip abs",children:jsx(m,{className:"--track flex aic",children:e.map(({label:S})=>jsx(m,{className:"--lb",children:S},`tool-tip-${S.toLowerCase().replace(/\s+/g,"-")}`))})})]})});sn.displayName="Zuz.ActionBar";var Qi=sn;var ln=forwardRef((t,n)=>{let{type:e,icon:r,title:o,message:s,iconSize:a,...u}=t,{className:f,style:l,rest:c}=B(u);return jsxs(m,{className:`--alert --${e||xe.Info} flex aic ${f}`.trim(),style:l,...c,children:[jsx(m,{className:`--icon icon-${r||"auto-matic"}`,style:a?{fontSize:a,width:a,height:a}:{},children:!r&&O[e||xe.Info]}),jsxs(m,{className:"--meta flex cols",children:[jsx(V,{className:`--title ${s?"--tm":""}`,children:o||"Lorem ipsum dolor sit amet, consectetur adipiscing elit."}),s&&jsx(V,{className:"--message",h:2,children:s})]})]})});ln.displayName="Zuz.Alert";var el=ln;var cn=({ref:t,...n})=>{let{variant:e,numeric:r,onConfirm:o,...s}=n,{style:a,className:u,rest:f}=B(s),{variant:l}=X(true),c=p=>{r&&(p.currentTarget.value=p.currentTarget.value.replace(/[^0-9.]/g,"").replace(/(\..*?)\..*/g,"$1"));};return jsx("input",{className:`--input --${e||l} flex ${u}`.trim(),style:a,onInput:c,onKeyDown:p=>{p.key=="Enter"&&o?.(p.currentTarget.value);},ref:t,...f})};cn.displayName="Zuz.Input";var ne=cn;var pn=t=>{let{meta:n,children:e}=t,r=useDelayed(),{label:o,icon:s,...a}=isValidElement(n)?{}:n,{className:u,style:f,rest:l}=B({...a,...a.animate?{animate:{...a.animate,when:r}}:{}});return isValidElement(n)?jsx("li",{style:f,className:u,children:n}):jsxs("li",{style:f,className:u,...l,children:[e,typeof n=="string"?n:o]})};pn.displayName="Zuz.ListItem";var un=pn;var dn=forwardRef((t,n)=>{let{items:e,variant:r,direction:o,seperator:s,ol:a,...u}=t,{className:f,style:l,rest:c}=B(u),p=a==true?"ol":"ul";return createElement(p,{className:`--list --${r||U.Small} flex ${o??"cols"} ${f}`.trim(),style:l,ref:n,...c,children:e.map((i,g,T)=>{let y=`${typeof i=="string"?`li-${String(i)}`:isValidElement(i)?`li-${i.key}`||`${g}-${MD5(i.toString())}`:i.label}-${g}`;return jsxs(Fragment,{children:[jsx(un,{meta:i}),s&&T[g+1]?jsx("li",{className:"--list-seperator",children:s},`spt-${g+1}-${y}`):null]},y)})})});dn.displayName="Zuz.List";var _e=dn;var hn=forwardRef((t,n)=>{let{fx:e,action:r,data:o,withStyle:s,onChange:a,...u}=t,{className:f}=B({as:s||""}),{style:l}=B(u),[c,p]=useState(false),[i,g]=useState(o||[]),T=useRef(null),y=useRef(null),S=useRef(null),I=useMemo(()=>u.name||uuid(12),[]),[R,P]=useState(null),[h,C]=useState(null),[b,x]=useState([]),D=useDebounce(d=>{d.target.value==""?(p(false),g([])):r&&d.target.value.trim()!=""&&withPost(r,{query:d.target.value}).then(E=>{"items"in E&&_(E.items).isArray()?(g(E.items),C(d.target.value),x(E.items)):console.error("Action Response should contain items array"),P(null);}).catch(E=>{P(null),g([]);});},250),k=()=>{if(y.current){let d=y.current.getBoundingClientRect(),E=window.innerHeight-d.bottom,_=d.top;if(S.current){let G=S.current;E<G.offsetHeight&&_>E?(G.style.top="auto",G.style.bottom=`${d.height}px`,G.style.maxHeight=`${_-150}px`):(G.style.top=`${d.height+5}px`,G.style.bottom="auto",G.style.maxHeight=`${E-150}px`);}}},A=d=>{if(i.length>0){if((d.key==="ArrowDown"||d.key==="ArrowUp")&&(d.preventDefault(),d.stopPropagation()),d.key==="Escape")P(null),p(false),g([]);else if(d.key==="ArrowDown")P(E=>{let _=E===null||E===i.length-1?0:E+1;return H(_),_});else if(d.key==="ArrowUp")P(E=>{let _=E===null||E===0?i.length-1:E-1;return H(_),_});else if(d.key==="Enter"&&R!==null){let E=i[R];T.current&&(T.current.value=E,p(false),g([]));}}},L=d=>{T.current&&(T.current.value=d,p(false),g([]));},H=d=>{let E=i[d];if(E&&T.current&&(T.current.value=E,T.current.setSelectionRange(E.length,E.length)),S.current){let G=S.current.children[d];G&&G.scrollIntoView({block:"nearest"});}},z=d=>{y.current&&!y.current.contains(d.target)&&(p(false),g([]));},W=()=>{T.current&&T.current.value===h&&(g(b),P(null),k());};return useEffect(()=>(window.addEventListener("resize",k),window.addEventListener("scroll",k,true),document.addEventListener("mousedown",z),()=>{window.removeEventListener("resize",k),window.removeEventListener("scroll",k,true),document.removeEventListener("mousedown",z);}),[]),useEffect(()=>{k();},[i]),jsxs(m,{style:l,ref:y,className:`--autocomplete --${t.size||U.Small} flex aic rel ${f}`.trim(),children:[jsx(ne,{ref:T,autoComplete:"off",onChange:D,onKeyDown:A,onFocus:W,...u}),jsx(m,{className:"--arrow rel flex aic jcc",children:i.length>0?O.arrowUp:O.arrowDown}),i.length>0&&jsx(_e,{id:I,ref:S,className:"--suggestion-list flex cols abs",items:i.map((d,E)=>({label:d,onClick:_=>{_.preventDefault(),_.stopPropagation(),L(d);},className:R===E?"--current":"",animate:{transition:Y.SlideInBottom,curve:q.EaseInOut,delay:clamp(.02*E,.02,.5)}}))})]})});hn.displayName="Zuz.AutoComplete";var xl=hn;var yn=forwardRef((t,n)=>{let e=useRef(null),r=useMemo(()=>n&&typeof n!="function"&&n.current?n:e,[n]),{style:o,className:s,rest:a}=B(t,r);return !a.src||a.src==""?null:jsx("img",{ref:r,style:o,className:`${s} flex`,...a})});yn.displayName="Zuz.Image";var Fe=yn;var xn=forwardRef((t,n)=>{let{src:e,variant:r,type:o,crossOrigin:s,referrerPolicy:a,fx:u,as:f,alt:l,color:c,style:p,...i}=t,[g,T,y]=useImage(e??"",s,a),{className:S,style:I,rest:R}=B({fx:u,as:f});return jsx(m,{className:`--avatar --${r||U.Small} --${(o||sr.Circle).toLowerCase()} rel flex aic jcc ${S}`.trim(),style:{background:c||"var(--primary)",...p,...I},...R,children:e?jsx(Fe,{src:g,crossOrigin:s,referrerPolicy:a,...i}):jsx(V,{className:"--avatar-label",children:(l?l.charAt(0):"A").toUpperCase()})})});xn.displayName="Zuz.Avatar";var Rl=xn;var Il=({size:t=5,type:n="dead",label:e="",variant:r=U.Small,loading:o=false,spinner:s,...a})=>{let{style:u,className:f,rest:l}=B(a);return jsxs(m,{style:{..._(e).isEmpty()?{"--badge-size":t}:{},...u},as:`--badge --${r} --${n} rel flex aic jcc ${f}`.trim(),children:[jsx(m,{fx:{transition:Y.FadeIn,curve:q.Liquid,duration:.5,when:o},as:"abs abc",children:jsx(ve,{type:s})}),_(e).isEmpty()?jsx(m,{as:`--dot --${n}`}):jsx(V,{as:"--label",children:e})]})},Nl=Il;var Fl=[{label:"Today",getDate:()=>new Date,getDateFormat:()=>format(new Date,"EEE")},{label:"Later",getDate:()=>new Date,getDateFormat:()=>format(addHours(new Date,2),"hh:mm a")},{label:"Tomorrow",getDate:()=>addDays(new Date,1),getDateFormat:()=>format(addDays(new Date,1),"EEE")},{label:"This weekend",getDate:()=>{let t=new Date,n=t.getDay();return addDays(t,(6-n)%7||6)},getDateFormat:()=>{let t=new Date,n=t.getDay();return format(addDays(t,(6-n)%7||6),"EEE, MMM d")}},{label:"Next week",getDateFormat:()=>format(addWeeks(new Date,1),"EEE, MMM d"),getDate:()=>addWeeks(new Date,1)},{label:"Next weekend",getDateFormat:()=>format(addWeeks(new Date,1),"d MMM"),getDate:()=>addWeeks(new Date,1)},{label:"2 weeks",getDateFormat:()=>format(addWeeks(new Date,2),"d MMM"),getDate:()=>addWeeks(new Date,2)},{label:"4 weeks",getDateFormat:()=>format(addWeeks(new Date,4),"d MMM"),getDate:()=>addWeeks(new Date,4)}],Zl=t=>{let n=new Set;return t.filter(e=>{if(e.label=="Later")return true;let r=e.getDate().toISOString().split("T")[0];return n.has(r)?false:(n.add(r),true)})},vn=forwardRef((t,n)=>{let{defaultValue:e,variant:r,onChange:o,...s}=t,{style:a,className:u,rest:f}=B(s),[l,c]=useState(e||new Date),p=startOfMonth(l),i=endOfMonth(l),g=startOfWeek(p),T=endOfWeek(i),y=useMemo(()=>eachDayOfInterval({start:g,end:T}),[g,T]),S=P=>{o?.(P),c(P);},I=()=>{c(P=>new Date(P.getFullYear(),P.getMonth()-1));},R=()=>{c(P=>new Date(P.getFullYear(),P.getMonth()+1));};return jsxs(m,{as:`--calendar flex --${r||"sm"} ${u}`,style:a,children:[jsx(m,{as:"--calendar-quick-select flex cols flex:1",children:Zl(Fl).map(P=>{let h=P.getDate();return jsxs($,{onClick:()=>S(h),as:["--calendar-quick-option flex aic gap:5"],children:[jsx(V,{as:"flex:1",children:P.label}),jsx(V,{as:"tar",children:P.getDateFormat()})]},`--dtp-option-label-${P.label}`)})}),jsxs(m,{as:"--calendar-selector flex cols flex:1",children:[jsxs(m,{as:"--calendar-head flex aic jcc gap:4",children:[jsx(V,{as:"flex:1 --calendar-cm bold",children:format(l,"MMMM yyyy")}),jsx($,{onClick:I,as:"--calendar-chevron",children:O.chevronUpOutline}),jsx($,{onClick:R,as:"--calendar-chevron",children:O.chevronDownOutline})]}),jsxs(m,{as:"--calendar-days gap:4",children:[["Su","Mo","Tu","We","Th","Fr","Sa"].map(P=>jsx(V,{as:"--calendar-day",children:P},`--calendar-hd-${P}`)),y.map((P,h)=>{let C=isSameMonth(P,l),b=isSameDay(P,l),x=isToday(P);return jsx($,{disabled:!C,onClick:()=>S(P),as:["--calendar-day --calendar-dd",`${b?"--calendar-dd-selected":""}`,`${x?"--calendar-dd-current":""}`],children:format(P,"d")},`--calendar-day-${h}-${P.getFullYear()}-${P.getMonth()}-${P.getDay()}`)})]})]})]})});vn.displayName="Zuz.Calendar";var No=vn;var At=(e=>(e.Table="table",e.Gooey="gooey",e))(At||{});var Tn=({ref:t,...n})=>{let{itemCount:e,itemsPerPage:r,startPage:o,pageRange:s,paginationStyle:a,breakLabel:u,prevLabel:f,nextLabel:l,hash:c,loading:p,seperator:i,renderOnZeroPageCount:g,asDots:T,progressBar:y,onPageChange:S,...I}=n,R=useRef(null),P=useMemo(()=>toHash(numberInRange(4,8)),[]),h=useCallback(d=>`${toHash(d,c||6,P)}${i||""}${P}`,[P]),C=useMemo(()=>u||"...",[u]),b=useRef(null),[x,N]=useState({id:c?o?typeof o=="number"?h(o):o:1:o||1,label:o||1});useImperativeHandle(t,()=>({setPage:d=>N(d),getPage:d=>x,setProgress:d=>b.current?.setProgress?.(d),getProgress:()=>b.current?.getProgress?.()??0}),[b.current]);let{style:D,className:k,rest:A}=B(I),L=useCallback(d=>typeof d=="number"?d:+d.label,[]);if(!e)throw new Error('"itemCount" prop is required');let H=useMemo(()=>Math.ceil(e/r),[e,r]),z=useMemo(()=>{let d=[],E=Math.max(L(x)-(s||2),1),_=Math.min(L(x)+(s||2),H);E>1&&d.push({id:c?h(1):1,label:1}),E>2&&d.push({id:-1,label:C});for(let G=E;G<=_;G++)d.push({id:c?h(G):G,label:G});return _<H-1&&d.push({id:-1,label:C}),_<H&&d.push({id:c?h(H):H,label:H}),d},[x]),W=useCallback(d=>{let E=d;+E.label<1||+E.label>H||(N(E),S?.(E));},[e,r,x]);return z.length<=1&&(g??false)===false?null:jsxs(m,{ref:R,as:`--pagination ${T===true?"--as-dots":""} --pgt-${a||"table"} flex aic w:100% jcc ${k}`,children:[jsx(m,{as:"flex flex:1 aic --pgt-btns",children:(z.length>1?z:[{id:1,label:1},{id:-1,label:C}]).map((d,E,_)=>{let G=(typeof d=="string"?d:d.label)==L(x);return jsx($,{disabled:d.id==-1||L(x)==+d.label,className:G?"--current-page":"",onClick:F=>W(d),children:T===true?y===true&&G?jsx($e,{ref:b}):"":typeof d=="string"?d:d.label},`--pg-${E}-${d.id}`)})}),jsx(m,{as:"flex aic jcc flex:1 --pagination-label",children:[`Showing ${(L(x)-1)*r+1} - `,`${Math.min(L(x)*r,e)} of ${e} items`].join(" ")}),jsxs(m,{as:"flex aic jce flex:1 --pgt-btns --pgt-nav",children:[jsx($,{disabled:L(x)<=1,onClick:d=>W({id:c?h(L(x)-1):L(x)-1,label:L(x)-1}),children:O.chevronLeftOutline}),jsx($,{disabled:z.length<=1||L(x)==L(z[z.length-1]),onClick:d=>W({id:c?h(L(x)+1):L(x)+1,label:L(x)+1}),children:O.chevronRightOutline})]})]})};Tn.displayName="Zuz.Pagination";var dt=Tn;function Ql(t,n){let{items:e,renderItem:r,effect:o="slide",loop:s=true,loopMode:a="infinite",startIndex:u=0,useKeys:f=true,useWheel:l=true,spacing:c=160,rotation:p=20,scaleStep:i=.15,blur:g=4,animation:T="power",showDots:y=false,autoPlay:S=false,autoPlaySpeed:I=3,onChange:R,...P}=t,{className:h,style:C}=B(P),b=useRef(null),x=I/(I>=1e3?1e3:1),N=useCarousel({total:e.length,initialIndex:u,loop:s,useKeys:f,useWheel:l,onChange:H=>{b.current?.setPage({id:H+1,label:H+1}),b.current?.setProgress(0),R?.(H);}}),{pause:D,resume:k,reset:A}=useTimer({duration:x,autoStart:S===true,onProgress:H=>{S===true&&b.current?.setProgress(1-H);},onExpired:()=>{S===true&&N.next(),A();}}),L={...C,"--carousel-spacing":`${c}px`,"--carousel-rotation":`${p}deg`,"--carousel-blur":`${g}px`,"--carousel-scale-step":i,"--active-index":N.index,"--carousel-transition":`var(--${T})`};return jsxs(m,{ref:n,className:`--carousel --effect-${o} --loop-${a} flex cols aic jcc ${h}`.trim(),style:L,children:[jsx(m,{className:"--carousel-stage rel fill flex aic jcc",children:e.map((H,z)=>{let W=z-N.index;if(a==="infinite"){let E=e.length;W=((W+E/2)%E+E)%E-E/2;}let d=z===N.index;return jsx(m,{onMouseEnter:()=>d&&D(),onMouseLeave:()=>d&&k(),className:`--carousel-item-wrapper abs ${d?"--is-active":""}`,style:{"--offset":W,zIndex:d?100:100-Math.abs(W),display:Math.abs(W)>5?"none":"flex"},children:r(H,z,N.index)},z)})}),y&&jsx(dt,{ref:b,itemCount:e.length,itemsPerPage:1,startPage:u+1,pageRange:e.length,paginationStyle:"gooey",onPageChange:H=>N.goTo(+H.label-1),asDots:true,progressBar:true})]})}var Jl=forwardRef(Ql),jl=Jl;var Pn=(n=>(n.Line="line",n))(Pn||{});var Nn=forwardRef((t,n)=>{let{data:e,width:r,height:o,lineColor:s,strokeWidth:a=2,gradientStartColor:u,gradientEndColor:f,animated:l,animDuration:c=2,animDelay:p=0,padding:i=0,type:g,...T}=t,{className:y,style:S,rest:I}=B(T),R=useRef(null),P=useResizeObserver(R.current?.parentElement||R),h=typeof r=="number"?r:P.width,C=typeof o=="number"?o:P.height,b={width:h,height:C},x=useId(),{pathD:N,areaPathD:D}=useLineChart(e,b,i+(a||2)),k=useRef(null),A=useRef(null),[L,H]=useState(0),[z,W]=useState(0);return useEffect(()=>{l&&(k.current&&H(k.current.getTotalLength()),A.current&&W(A.current.getTotalLength()));},[l,N,D,h,C]),jsx(m,{ref:R,as:`--chart --${g||"line"}-chart ${y}`.trim(),style:{...S,width:r,height:o},...I,children:h>0&&C>0&&jsxs("svg",{viewBox:`0 0 ${h} ${C}`,preserveAspectRatio:"xMidYMid meet",children:[jsx("defs",{children:jsxs("linearGradient",{id:x,x1:"0%",y1:"0%",x2:"0%",y2:"100%",children:[jsx("stop",{offset:"0%",stopColor:u}),jsx("stop",{offset:"100%",stopColor:f})]})}),jsx("path",{ref:A,d:D,fill:`url(#${x})`,stroke:"none",style:l?{strokeDasharray:z,strokeDashoffset:z}:{},children:l&&jsx("animate",{attributeName:"stroke-dashoffset",from:z,to:"0",dur:`${c||2}s`,begin:`${p||0}s`,fill:"freeze"})}),jsx("path",{ref:k,d:N,fill:"none",stroke:s,strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round",style:l?{strokeDasharray:L,strokeDashoffset:L}:{},children:l&&jsx("animate",{attributeName:"stroke-dashoffset",from:L,to:"0",dur:`${c||2}s`,begin:`${p||0}s`,fill:"freeze"})})]})})});Nn.displayName="Zuz.Chart";var ac=Nn;var Bn=(o=>(o[o.Sending=0]="Sending",o[o.Sent=1]="Sent",o[o.Delivered=2]="Delivered",o[o.Read=3]="Read",o))(Bn||{}),En=(l=>(l.Image="img",l.Video="vid",l.Audio="audio",l.Link="link",l.Document="doc",l.Location="loc",l.Contact="contact",l.Event="event",l.Poll="poll",l))(En||{});var Ln=forwardRef((t,n)=>{let{text:e,media:r,side:o="me",status:s=1,timeStamp:a=Date.now(),arrow:u=true,...f}=t,{className:l,style:c,rest:p}=B(f);return jsx(m,{className:`--bubble-wrapper flex --bw-${o}`.trim(),children:jsxs(m,{className:`--bubble --bubble-${o} ${r?`--with-media --bma-${r.type}`:""} rel flex cols ${u==true?"--b-arrow":""} ${l}`.trim(),style:{...c},...p,children:[e&&jsx(V,{className:"--bubble-text",children:e}),r?r.type=="audio"?jsxs(m,{as:"flex aic --bubble-audio",children:[jsx(te,{className:"--bm-action",children:O.play}),jsx($e,{progress:.7}),jsx(V,{className:"--bm-dur",children:r.duration??"00:13"})]}):r.type=="img"?jsx(m,{as:"--bubble-image",children:jsx(Fe,{src:r.source})}):null:null,jsxs(m,{as:"flex aie jce --bubble-stats",children:[jsx(V,{className:"--bubble-stamp tar",children:timeSince(a)}),o=="me"&&jsx(te,{className:`--bubble-status --bs-${s}`,children:s==0?O.pending:s==1?O.done:s==2?O.doneAll:O.doneAll})]})]})})});Ln.displayName="Zuz.Bubble";var cc=Ln;var Mn=forwardRef((t,n)=>{let{style:e,className:r,rest:o}=B(t);return jsx("label",{ref:n,style:e,className:r,...o})});Mn.displayName="Zuz.Label";var gt=Mn;var kn=forwardRef((t,n)=>{let{name:e,required:r,type:o,value:s,size:a,variant:u,checked:f,onSwitch:l,...c}=t,[p,i]=useState(f||false),g=useRef(null),{variant:T}=X(true);return useImperativeHandle(n,()=>({setChecked(y,S=true){i(y),g.current&&(g.current.checked=y),S&&l&&l(y,s||"cb");},toggle(y=true){g.current&&(g.current.checked=!p),y&&l&&l&&l(!p,s||"cb"),i(!p);}})),jsxs(gt,{className:`--${(o||Ne.Default).toLowerCase()} ${!o||o==Ne.Default?"--checkbox":"--switch"} --${u||T||U.Small} flex aic jcc ${p?"is-checked":""} rel`.trim(),...c,children:[(!o||o==Ne.Default)&&O.check,jsx(ne,{ref:g,defaultChecked:p,value:s||"cb",type:"checkbox",className:"abs",name:e,required:r||false,onChange:y=>{l&&l(y.target.checked,s||"cb"),i(y.target.checked);}})]})});kn.displayName="Zuz.CheckBox";var ht=kn;var bc=({ref:t,...n})=>{let{code:e,lang:r="tsx",showLines:o=false,highlight:s="",as:a,fx:u,...f}=n,l=useRef(null),{className:c,style:p,rest:i}=B({as:`rel p:20 br:8 bg:shade-1 overflow:auto font:mono ${a}`,fx:u},l),g=useMemo(()=>{let y=new Set;return s.split(",").forEach(S=>{if(S.includes("-")){let[I,R]=S.split("-").map(Number);for(let P=I;P<=R;P++)y.add(P);}else S&&y.add(Number(S));}),y},[s]),T=useMemo(()=>{let y=e.split(`
9
- `);for(;y.length>0&&y[0].trim()==="";)y.shift();for(;y.length>0&&y[y.length-1].trim()==="";)y.pop();let S=y[0]?.match(/^\s*/)?.[0].length||0,I=y.map(P=>{let h=P.match(/^\s*/)?.[0].length||0,C=Math.min(h,S);return P.slice(C)}),R=[{name:"comm",re:/\/\/.*/g},{name:"str",re:/(["'`])(?:(?=(\\?))\2.)*?\1/g},{name:"key",re:/\b(const|let|var|export|default|import|from|return|if|else|switch|case|break|as|type|interface|class|extends|await|async|new|void|typeof)\b/g},{name:"tag",re:/(&lt;\/?[A-Z][\w\.]*|&gt;)/g},{name:"var",re:/(?<!&lt;\/|&lt;)\b[A-Z]\w*\b/g},{name:"fn",re:/\b([a-z_]\w*)(?=\s*\()/gi},{name:"prop",re:/\.([a-z_]\w*)\b/gi},{name:"num",re:/\b\d+\b(?![#|A-Z|a-z|_|ZUZ])/g}];return I.map((P,h)=>{let C=P.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),b=g.has(h+1),x=[];R.forEach(N=>{C=C.replace(N.re,D=>{let k=`ZUZ_ID_${x.length}_ZUZ`;return x.push(`<span class="--token-${N.name}">${D}</span>`),k});});for(let N=x.length-1;N>=0;N--)C=C.replace(`ZUZ_ID_${N}_ZUZ`,x[N]);return `<div class="--code-line ${o==true?"--with-ln":""} ${b?"--is-highlighted":""}">
8
+ document.documentElement.style.colorScheme = theme;`}}),jsx(co,{children:t})]})},hr=(t,n)=>{if(xa)return;let e;try{e=localStorage.getItem(t)||void 0;}catch{}return e||n};var xr=({ref:t,...n})=>{let{style:e,...r}=n,{style:o,className:s,rest:a}=B(r);return jsx("span",{ref:t,style:e,className:s,...a})};xr.displayName="Zuz.Span";var oe=xr;var vr=forwardRef((t,n)=>{let{name:e,pathCount:r,variant:o,color:s,...a}=t,{variant:u}=X(true),{className:f,style:l,rest:c}=B(a);return jsx("div",{style:{color:s,...l},className:`icon-${e} --icon --${o||u||K.Small} ${f}`.trim(),ref:n,...c,children:Array(r||0).fill(0).map((m,i)=>jsx(oe,{className:`path${i+1}`},`${e}-layer-${i}`))})});vr.displayName="Zuz.Icon";var J=vr;var me={Simple:"SIMPLE",Roller:"ROLLER",Wave:"Wave"};var wr=t=>{let{type:n,variant:e,color:r,...o}=t,{className:s,style:a,rest:u}=B(o),{spinner:f}=X(true),l=()=>{switch(n||f?.type||me.Simple){case me.Simple:return null;case me.Wave:return jsxs(Fragment$1,{children:[jsx(p,{as:"--bar --bar1"}),jsx(p,{as:"--bar --bar2"}),jsx(p,{as:"--bar --bar3"})]});case me.Roller:return null}};return jsx(p,{className:`${s} --spinner --${(n||f?.type||me.Simple).toLowerCase()} --${e||f?.variant||K.Small}`.trim(),style:{...a},...u,children:l()})};wr.displayName="Zuz.Spinner";var we=wr;var Lt={Loading:"loading",Normal:"normal"};var Cr=({ref:t,...n})=>{let{reset:e,kind:r="solid",variant:o,icon:s,iconSize:a,children:u,withLabel:f,spinner:l,state:c,disabled:m,...i}=n,{style:g,className:T,rest:b}=B(i),{variant:S}=X(true);return jsxs("button",{className:`--button --${r} --${o||S} flex aic ${e?"":"jcc"} ${s?"--with-icon":""} ${T}`.trim().replace(/\s+/g," "),style:g,ref:t,disabled:c==Lt.Loading||n.skeleton?.enabled||m,...b,children:[c==Lt.Loading&&jsx(we,{variant:o||S,type:l||me.Simple}),(!c||c==Lt.Normal)&&jsxs(Fragment$1,{children:[s&&jsx(J,{variant:a,name:s}),f===true?jsx(oe,{children:u}):u]})]})};Cr.displayName="Zuz.Button";var z=Cr;var Pr=forwardRef((t,n)=>{let{h:e,html:r,children:o,lines:s,...a}=t,{style:u,className:f,rest:l}=B(a),c=`h${t.h||1}`;return jsx(c,{ref:n,style:u,className:f,...l,children:r?jsx(oe,{dangerouslySetInnerHTML:{__html:r}}):o})});Pr.displayName="Zuz.Text";var $=Pr;var Na=t=>{let{label:n,labelColor:e,icon:r,iconColor:o,index:s,className:a,onSelect:u}=t;return n=="-"?jsx(p,{className:"--line"}):jsxs(z,{reset:true,onClick:f=>u?.(t),className:`--item ${a||""}`.trim(),children:[jsx(p,{as:"--icon",children:jsx(J,{name:r,className:"--ico",style:o?{color:o}:{}})}),jsx($,{className:"--lbl flex aic",style:e?{color:e}:{},children:n})]})},Rr=Na;var Br=({ref:t,...n})=>{let{id:e,as:r,fx:o,offsetX:s,offsetY:a,parent:u,event:f,arrow:l,when:c,items:m,header:i,footer:g,origin:T=mt.TopRight,...b}=n,[S,I]=useState(false),[R,P]=useState(m||[]),{position:h,targetRef:C,calculatedAnchor:y}=useAnchorPosition(u?.current,f,{offsetX:s,offsetY:a,preferredAnchor:T}),N=u&&h.top>u.current.getBoundingClientRect().bottom?"--arrow-top":"--arrow-bottom",D=useMemo(()=>{let W=y.toLowerCase();return W.includes("left")?"--arrow-left":W.includes("right")?"--arrow-right":"--arrow-center"},[y]),L=h.top!==0||h.left!==0;useEffect(()=>{c&&L?I(true):c||I(false);},[c,L]);let{className:A,style:M,rest:H}=B(b),V=ce({...o?.transition?{transition:o.transition??G.SlideInBottom}:{from:{opacity:0,scale:.8,y:-10},to:{opacity:1,scale:1,y:0}},curve:o?.curve??q.EaseInOut,duration:o?.duration??.05,when:S&&L});return jsxs(p,{ref:C,className:`--contextmenu ${l||u!=null?`--has-arrow ${N} ${D}`:""} abs flex cols ${A}`.trim(),"aria-hidden":!S,style:{...M,...V.style,top:h.top,left:h.left,visibility:L?"visible":"hidden",transformOrigin:y},...H,children:[typeof i=="function"?createElement(i):i,R.map((W,d)=>jsx(Rr,{...W,index:d},`context-${W.label.toLowerCase()}-${d}`)),typeof g=="function"?createElement(g):g]})};Br.displayName="Zuz.ContextMenu";var po=Br;var Er=forwardRef((t,n)=>{let{children:e,fx:r,when:o,fxDelay:s,fxStep:a,classToIgnore:u,...f}=t,l=X(true),c=useDelayed(),m=r||l?.group?.fx,i=s||l?.group?.fxDelay,g=a||l?.group?.fxStep,T=u||l?.group?.classToIgnore||"-fx",b=useMemo(()=>m?addPropsToChildren(e,S=>{if(S.type===Fragment)return false;let I=S.props||{},R="fx"in I,P=I.as?Array.isArray(I.as)?I.as.join(" "):I.as:I.className||"",h=typeof P=="string"&&P.includes(T);return !R&&!h},S=>({fx:{...m,delay:(i||0)+S*(g||.1),when:o??(r?.when||c)}})):e,[e,o,c,m]);return jsx(p,{className:"--group",ref:n,...f,children:b})});Er.displayName="Zuz.Group";var uo=Er;var Mr=forwardRef((t,n)=>{let{message:e,spinner:r,spinnerSize:o,color:s,when:a,hideMessage:u,...f}=t,{className:l,style:c,rest:m}=B(f),{spinner:i}=X(true);return "when"in t&&t.when==false?null:jsxs(uo,{fx:{transition:G.SlideInBottom,curve:q.Liquid,duration:.5},fxDelay:.1,fxStep:.05,className:`--cover flex aic jcc cols abs fill nope nous ${l}`.trim(),style:{...c,backgroundColor:"var(--cover-bg)"},...m,children:[jsx(we,{variant:o||i?.variant||K.Small,type:r||i?.type||me.Simple}),!u&&jsx($,{className:"--label",style:{color:"var(--cover-label)"},children:e||"loading"})]})});Mr.displayName="Zuz.Cover";var Re=Mr;var fo=class{stack=[];SCROLL_CLASS="--no-scroll";updateScrollLock(){typeof window>"u"||(this.stack.length>0?document.body.classList.add(this.SCROLL_CLASS):document.body.classList.remove(this.SCROLL_CLASS));}isTop(n){return this.stack[this.stack.length-1]===n}push(n){this.stack.includes(n)||(this.stack.push(n),this.updateScrollLock());}pop(n){this.stack=this.stack.filter(e=>e!==n),this.updateScrollLock();}handleEscape(){let n=this.stack[this.stack.length-1];return n?(n(),true):false}get count(){return this.stack.length}},$e=new fo;var kr=forwardRef((t,n)=>{let{when:e,...r}=t;return jsx(p,{ref:n,"aria-hidden":!e,className:"--overlay fixed fill",fx:{transition:G.FadeIn,when:e},...r})});kr.displayName="Zuz.Overlay";var ze=kr;var Wa=({action:t,render:n=true,message:e=""})=>jsx(p,{as:`--body flex aic rel ${t?"":"--no-action"}`.trim(),children:n?e:null}),Or=Wa;var Ga=({action:t,actionPosition:n,dialogID:e,variant:r})=>jsx(p,{as:`--footer flex aic rel ${n?n==cr.Center?"jcc":"":"jce"}`.trim(),children:t.map((o,s)=>jsx(z,{variant:r,onClick:a=>o.handler?o.handler():o.onClick?o.onClick():console.log("onClick Handler missing"),as:"--action",children:o.label},`dialog-${e}-action-${o.key}`))}),Hr=Ga;var qa={colorSchemeLight:jsxs("svg",{width:"24",height:"24",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",color:"currentcolor",shapeRendering:"geometricPrecision",viewBox:"0 0 24 24",children:[jsx("circle",{cx:"12",cy:"12",r:"5"}),jsx("path",{d:"M12 1v2M12 21v2M4.22 4.22l1.42 1.42M18.36 18.36l1.42 1.42M1 12h2M21 12h2M4.22 19.78l1.42-1.42M18.36 5.64l1.42-1.42"})]}),colorSchemeSystem:jsxs("svg",{width:"24",height:"24",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",color:"currentcolor",shapeRendering:"geometricPrecision",viewBox:"0 0 24 24",children:[jsx("rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",ry:"2"}),jsx("path",{d:"M8 21h8M12 17v4"})]}),colorSchemeDark:jsx("svg",{width:"24",height:"24",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",color:"currentcolor",shapeRendering:"geometricPrecision",viewBox:"0 0 24 24",children:jsx("path",{d:"M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79"})}),arrowDown:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:jsx("path",{d:"M17.919 8.18H6.079c-.96 0-1.44 1.16-.76 1.84l5.18 5.18c.83.83 2.18.83 3.01 0l1.97-1.97 3.21-3.21c.67-.68.19-1.84-.77-1.84z"})}),arrowUp:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:jsx("path",{d:"M18.68 13.978l-3.21-3.21-1.96-1.97a2.13 2.13 0 00-3.01 0l-5.18 5.18c-.68.68-.19 1.84.76 1.84h11.84c.96 0 1.44-1.16.76-1.84z"})}),search:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 34 34",children:jsx("path",{d:"M27.414,24.586l-5.077-5.077C23.386,17.928,24,16.035,24,14c0-5.514-4.486-10-10-10S4,8.486,4,14 s4.486,10,10,10c2.035,0,3.928-0.614,5.509-1.663l5.077,5.077c0.78,0.781,2.048,0.781,2.828,0 C28.195,26.633,28.195,25.367,27.414,24.586z M7,14c0-3.86,3.14-7,7-7s7,3.14,7,7s-3.14,7-7,7S7,17.86,7,14z"})}),close:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:jsx("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})}),eye:jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:[jsx("path",{fill:"#333",d:"M12 20.5c-4.299 0-8.24-3.023-10.544-8.086a1 1 0 010-.828C3.759 6.523 7.701 3.5 12 3.5s8.24 3.023 10.544 8.086a1.001 1.001 0 010 .828 18.14 18.14 0 01-1.391 2.52 1 1 0 11-1.666-1.106A15.87 15.87 0 0020.529 12C18.543 7.92 15.379 5.5 12 5.5S5.457 7.92 3.471 12c1.986 4.08 5.15 6.5 8.529 6.5a7.964 7.964 0 005.036-1.92 1 1 0 111.265 1.55A9.94 9.94 0 0112 20.5z"}),jsx("path",{fill:"#333",d:"M12 16a4.004 4.004 0 01-3.929-4.756 1 1 0 011.965.375A2 2 0 1014 12a2.034 2.034 0 00-2.053-1.999 1.04 1.04 0 01-1.043-.947.963.963 0 01.902-1.05L12 8a4 4 0 010 8z"})]}),eyeSlash:jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:[jsx("path",{fill:"#333",d:"M12 15c-4.132 0-7.98-1.214-10.294-3.249a1 1 0 111.32-1.502C4.986 11.972 8.34 13 12 13s7.014-1.028 8.974-2.751a1 1 0 111.32 1.502C19.98 13.786 16.132 15 12 15z"}),jsx("path",{fill:"#333",d:"M12 18a1 1 0 01-1-1v-3a1 1 0 012 0v3a1 1 0 01-1 1zM7.749 17.667a.964.964 0 01-.17-.014 1 1 0 01-.817-1.155l.505-2.935a1 1 0 111.97.339l-.504 2.935a1 1 0 01-.984.83zM3.636 16.306a1.001 1.001 0 01-.942-1.336l.978-2.745a1 1 0 111.884.672l-.978 2.745a1 1 0 01-.942.664zM16.251 17.667a1 1 0 01-.984-.83l-.505-2.935a1 1 0 011.97-.339l.506 2.935a1 1 0 01-.816 1.155.964.964 0 01-.17.014zM20.364 16.306a1 1 0 01-.942-.664l-.978-2.745a1 1 0 111.884-.672l.978 2.745a1.001 1.001 0 01-.942 1.336z"})]}),check:jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[" ",jsx("path",{d:"M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"})," "]}),[be.Info]:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",children:jsx("path",{fill:"#292D32",d:"M21.56 10.738l-1.35-1.58c-.25-.3-.46-.86-.46-1.26v-1.7c0-1.06-.87-1.93-1.93-1.93h-1.7c-.4 0-.97-.21-1.27-.46l-1.58-1.35c-.69-.59-1.82-.59-2.51 0l-1.6 1.35c-.3.25-.86.46-1.26.46H6.17c-1.06 0-1.93.87-1.93 1.93v1.7c0 .39-.2.95-.45 1.25l-1.35 1.59c-.58.7-.58 1.82 0 2.5l1.35 1.59c.25.29.45.86.45 1.25v1.71c0 1.06.87 1.93 1.93 1.93h1.74c.39 0 .96.21 1.26.46l1.58 1.35c.69.59 1.82.59 2.51 0l1.58-1.35c.3-.25.86-.46 1.26-.46h1.7c1.06 0 1.93-.87 1.93-1.93v-1.7c0-.4.21-.96.46-1.26l1.35-1.58c.61-.68.61-1.81.02-2.51zm-10.31-2.61c0-.41.34-.75.75-.75s.75.34.75.75v4.83c0 .41-.34.75-.75.75s-.75-.34-.75-.75v-4.83zm.75 8.74c-.55 0-1-.45-1-1s.44-1 1-1c.55 0 1 .45 1 1s-.44 1-1 1z"})}),[be.Warning]:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",children:jsx("path",{fill:"#292D32",d:"M19.51 5.85l-5.94-3.43c-.97-.56-2.17-.56-3.15 0L4.49 5.85a3.15 3.15 0 00-1.57 2.73v6.84c0 1.12.6 2.16 1.57 2.73l5.94 3.43c.97.56 2.17.56 3.15 0l5.94-3.43a3.15 3.15 0 001.57-2.73V8.58a3.192 3.192 0 00-1.58-2.73zm-8.26 1.9c0-.41.34-.75.75-.75s.75.34.75.75V13c0 .41-.34.75-.75.75s-.75-.34-.75-.75V7.75zm1.67 8.88c-.05.12-.12.23-.21.33a.99.99 0 01-1.09.21c-.13-.05-.23-.12-.33-.21-.09-.1-.16-.21-.22-.33a.986.986 0 01-.07-.38c0-.26.1-.52.29-.71.1-.09.2-.16.33-.21.37-.16.81-.07 1.09.21.09.1.16.2.21.33.05.12.08.25.08.38s-.03.26-.08.38z"})}),[be.Error]:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",children:jsx("path",{d:"M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"})}),[be.Success]:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",children:jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"})}),layers:jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 24 24",fill:"none",children:[jsx("path",{d:"M19.3697 4.89109L13.5097 2.28109C12.6497 1.90109 11.3497 1.90109 10.4897 2.28109L4.62969 4.89109C3.14969 5.55109 2.92969 6.45109 2.92969 6.93109C2.92969 7.41109 3.14969 8.31109 4.62969 8.97109L10.4897 11.5811C10.9197 11.7711 11.4597 11.8711 11.9997 11.8711C12.5397 11.8711 13.0797 11.7711 13.5097 11.5811L19.3697 8.97109C20.8497 8.31109 21.0697 7.41109 21.0697 6.93109C21.0697 6.45109 20.8597 5.55109 19.3697 4.89109Z",fill:"#292D32"}),jsx("path",{d:"M12.0003 17.04C11.6203 17.04 11.2403 16.96 10.8903 16.81L4.15031 13.81C3.12031 13.35 2.32031 12.12 2.32031 10.99C2.32031 10.58 2.65031 10.25 3.06031 10.25C3.47031 10.25 3.80031 10.58 3.80031 10.99C3.80031 11.53 4.25031 12.23 4.75031 12.45L11.4903 15.45C11.8103 15.59 12.1803 15.59 12.5003 15.45L19.2403 12.45C19.7403 12.23 20.1903 11.54 20.1903 10.99C20.1903 10.58 20.5203 10.25 20.9303 10.25C21.3403 10.25 21.6703 10.58 21.6703 10.99C21.6703 12.11 20.8703 13.35 19.8403 13.81L13.1003 16.81C12.7603 16.96 12.3803 17.04 12.0003 17.04Z",fill:"#292D32"}),jsx("path",{d:"M12.0003 22.0009C11.6203 22.0009 11.2403 21.9209 10.8903 21.7709L4.15031 18.7709C3.04031 18.2809 2.32031 17.1709 2.32031 15.9509C2.32031 15.5409 2.65031 15.2109 3.06031 15.2109C3.47031 15.2109 3.80031 15.5409 3.80031 15.9509C3.80031 16.5809 4.17031 17.1509 4.75031 17.4109L11.4903 20.4109C11.8103 20.5509 12.1803 20.5509 12.5003 20.4109L19.2403 17.4109C19.8103 17.1609 20.1903 16.5809 20.1903 15.9509C20.1903 15.5409 20.5203 15.2109 20.9303 15.2109C21.3403 15.2109 21.6703 15.5409 21.6703 15.9509C21.6703 17.1709 20.9503 18.2709 19.8403 18.7709L13.1003 21.7709C12.7603 21.9209 12.3803 22.0009 12.0003 22.0009Z",fill:"#292D32"})]}),play:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:jsx("path",{d:"M8 5v14l11-7z"})}),pause:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:jsx("path",{d:"M6 19h4V5H6zm8-14v14h4V5z"})}),next:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:jsx("path",{d:"m6 18 8.5-6L6 6zM16 6v12h2V6z"})}),prev:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:jsx("path",{d:"M6 6h2v12H6zm3.5 6 8.5 6V6z"})}),volumeHigh:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:jsx("path",{fill:"#292D32",d:"M22 11.25h-1.25V10c0-.41-.34-.75-.75-.75s-.75.34-.75.75v1.25H18c-.41 0-.75.34-.75.75s.34.75.75.75h1.25V14c0 .41.34.75.75.75s.75-.34.75-.75v-1.25H22c.41 0 .75-.34.75-.75s-.34-.75-.75-.75M14.02 3.782c-1.12-.62-2.55-.46-4.01.45l-2.92 1.83c-.2.12-.43.19-.66.19H5c-2.42 0-3.75 1.33-3.75 3.75v4c0 2.42 1.33 3.75 3.75 3.75h1.4300000000000002c.23 0 .46.07.66.19l2.92 1.83c.88.55 1.74.82 2.54.82a3 3 0 0 0 1.47-.37c1.11-.62 1.73-1.91 1.73-3.63v-9.18c0-1.72-.62-3.01-1.73-3.63"})}),volumeMute:jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[jsx("path",{fill:"#292D32",d:"M18 16.75a.75.75 0 0 1-.6-1.2 5.93 5.93 0 0 0 .72-5.84.75.75 0 0 1 .4-.98c.38-.16.82.02.98.4 1.02 2.42.67 5.23-.9 7.33-.15.19-.37.29-.6.29"}),jsx("path",{fill:"#292D32",d:"M19.828 19.25a.75.75 0 0 1-.6-1.2c2.14-2.85 2.61-6.67 1.23-9.96a.75.75 0 0 1 .4-.98c.38-.16.82.02.98.4 1.59 3.78 1.05 8.16-1.41 11.44-.14.2-.37.3-.6.3M14.04 12.958c.63-.63 1.71-.18 1.71.71v2.93c0 1.72-.62 3.01-1.73 3.63a3 3 0 0 1-1.47.37c-.8 0-1.66-.27-2.54-.82l-.64-.4c-.54-.34-.63-1.1-.18-1.55zM21.77 2.229c-.3-.3-.79-.3-1.09 0l-4.95 4.95c-.06-1.6-.66-2.8-1.72-3.39-1.12-.62-2.55-.46-4.01.45l-2.91 1.82c-.2.12-.43.19-.66.19H5c-2.42 0-3.75 1.33-3.75 3.75v4c0 2.42 1.33 3.75 3.75 3.75h.16l-2.94 2.94c-.3.3-.3.79 0 1.09.16.14.35.22.55.22s.39-.08.54-.23l18.46-18.46c.31-.3.31-.78 0-1.08"})]}),plus:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:jsx("path",{d:"M28 14H18V4a2 2 0 0 0-4 0v10H4a2 2 0 0 0 0 4h10v10a2 2 0 0 0 4 0V18h10a2 2 0 0 0 0-4"})}),add:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:jsx("path",{d:"M12 2C6.49 2 2 6.49 2 12s4.49 10 10 10 10-4.49 10-10S17.51 2 12 2m4 10.75h-3.25V16c0 .41-.34.75-.75.75s-.75-.34-.75-.75v-3.25H8c-.41 0-.75-.34-.75-.75s.34-.75.75-.75h3.25V8c0-.41.34-.75.75-.75s.75.34.75.75v3.25H16c.41 0 .75.34.75.75s-.34.75-.75.75"})}),chevronUp:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 24 24",children:jsx("path",{d:"m7 14 5-5 5 5z"})}),chevronBottom:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 24 24",children:jsx("path",{d:"m7 10 5 5 5-5z"})}),chevronRight:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 24 24",children:jsx("path",{d:"m10 17 5-5-5-5v10z"})}),chevronLeft:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 24 24",children:jsx("path",{d:"m14 7-5 5 5 5V7z"})}),chevronRightOutline:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 24 24",children:jsx("path",{d:"M8.59 16.59 13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"})}),chevronLeftOutline:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 24 24",children:jsx("path",{d:"M15.41 16.59 10.83 12l4.58-4.59L14 6l-6 6 6 6 1.41-1.41z"})}),chevronUpOutline:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 24 24",children:jsx("path",{d:"M7.41 15.41 12 10.83l4.59 4.58L18 14l-6-6-6 6z"})}),chevronDownOutline:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 24 24",children:jsx("path",{d:"M7.41 8.59 12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z"})}),bezier:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 24 24",fill:"none",children:jsx("path",{d:"M19.14 7.72C19.43 8.47 20.15 9 21 9C22.1 9 23 8.1 23 7C23 5.9 22.1 5 21 5C20.15 5 19.43 5.53 19.14 6.28C19.09 6.27 19.05 6.25 19 6.25H15V5.5C15 4.68 14.32 4 13.5 4H10.5C9.68 4 9 4.68 9 5.5V6.25H5C4.95 6.25 4.91 6.27 4.86 6.28C4.57 5.53 3.85 5 3 5C1.9 5 1 5.9 1 7C1 8.1 1.9 9 3 9C3.85 9 4.57 8.47 4.86 7.72C4.91 7.73 4.95 7.75 5 7.75H7.57C5.52 9.27 4.25 11.79 4.25 14.5C4.25 14.67 4.26 14.83 4.28 15H4C3.17 15 2.5 15.67 2.5 16.5V18.5C2.5 19.33 3.17 20 4 20H6C6.22 20 6.42 19.95 6.61 19.86C7.13 19.64 7.5 19.11 7.5 18.5V16.5C7.5 15.67 6.83 15 6 15H5.77C5.77 14.97 5.78 14.94 5.78 14.91C5.76 14.77 5.76 14.64 5.76 14.5C5.76 12.03 7.03 9.77 9.02 8.6C9.06 9.37 9.71 10 10.5 10H13.5C14.29 10 14.94 9.37 14.99 8.6C16.98 9.77 18.25 12.04 18.25 14.5C18.25 14.64 18.24 14.77 18.23 14.91C18.23 14.94 18.24 14.97 18.24 15H18C17.17 15 16.5 15.67 16.5 16.5V18.5C16.5 19.11 16.87 19.64 17.39 19.86C17.58 19.95 17.78 20 18 20H20C20.83 20 21.5 19.33 21.5 18.5V16.5C21.5 15.67 20.83 15 20 15H19.72C19.74 14.83 19.75 14.67 19.75 14.5C19.75 11.79 18.48 9.27 16.43 7.75H19C19.05 7.75 19.09 7.73 19.14 7.72Z",fill:"#292D32"})}),mouse:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 24 24",fill:"none",children:jsx("path",{d:"M13.2978 2.11468C13.0064 2.06339 12.75 2.29593 12.75 2.59185V5.45262C12.75 5.65098 12.8709 5.82564 13.0359 5.93583C13.5391 6.27202 13.87 6.84597 13.87 7.49906V9.49906C13.87 10.5291 13.03 11.3791 12 11.3791C10.96 11.3791 10.12 10.5291 10.12 9.49906V7.49906C10.12 6.84578 10.4583 6.27168 10.9639 5.93554C11.1291 5.82572 11.25 5.65098 11.25 5.45262V2.59249C11.25 2.29634 10.9935 2.0637 10.7019 2.11513C9.15243 2.38834 7.76579 3.13327 6.7 4.19906C5.34 5.55906 4.5 7.43906 4.5 9.49906V14.4991C4.5 18.6291 7.87 21.9991 12 21.9991C16.13 21.9991 19.5 18.6291 19.5 14.4991V9.49906C19.5 5.80857 16.813 2.73328 13.2978 2.11468Z",fill:"#292D32"})}),addKey:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 24 24",fill:"none",children:jsx("path",{d:"M20.9498 14.55L14.5598 20.94C13.1598 22.34 10.8598 22.34 9.44977 20.94L3.05977 14.55C1.65977 13.15 1.65977 10.85 3.05977 9.44L9.44977 3.05C10.8498 1.65 13.1498 1.65 14.5598 3.05L20.9498 9.44C22.3498 10.85 22.3498 13.15 20.9498 14.55Z",fill:"#292D32"})}),calendar:jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[jsx("path",{fill:"#292D32",d:"M8.25 5.75c-.41 0-.75-.34-.75-.75V2c0-.41.34-.75.75-.75S9 1.59 9 2v3c0 .41-.34.75-.75.75M15.75 5.75c-.41 0-.75-.34-.75-.75V2c0-.41.34-.75.75-.75s.75.34.75.75v3c0 .41-.34.75-.75.75M12 14.09c.52 0 .9-.31.9-.8 0-.5-.38-.79-.9-.79s-.9.29-.9.79c0 .49.38.8.9.8M12 17c.629 0 1.14-.416 1.14-.93 0-.513-.511-.93-1.14-.93-.63 0-1.14.417-1.14.93s.51.93 1.14.93"}),jsx("path",{fill:"#292D32",d:"M19.57 4.5c-.66-.49-1.61-.02-1.61.81v.1c0 1.17-.84 2.25-2.01 2.37-1.35.14-2.49-.92-2.49-2.24V4.5c0-.55-.45-1-1-1h-.92c-.55 0-1 .45-1 1v1.04c0 .79-.41 1.49-1.03 1.88-.09.06-.19.11-.29.16q-.135.075-.3.12c-.12.04-.25.07-.39.08q-.24.03-.48 0c-.14-.01-.27-.04-.39-.08q-.15-.045-.3-.12c-.1-.05-.2-.1-.29-.16-.63-.44-1.03-1.2-1.03-2.01v-.1c0-.77-.82-1.23-1.47-.9-.01.01-.02.01-.03.02-.04.02-.07.04-.11.07-.03.03-.07.05-.1.08-.28.22-.53.47-.74.74-.11.12-.2.25-.28.38a3.498 3.498 0 0 0-.27.46c-.02.02-.03.03-.03.05-.06.12-.12.24-.16.37-.03.05-.04.09-.06.14-.06.15-.1.3-.14.45-.04.14-.07.29-.09.44a5.902 5.902 0 0 0-.06.76v8.76A4.87 4.87 0 0 0 7.37 22h9.26a4.87 4.87 0 0 0 4.87-4.87V8.37c0-1.59-.76-2.98-1.93-3.87M12 18.25c-1.55 0-2.5-.77-2.5-2.01 0-.68.35-1.27.96-1.62-.44-.31-.73-.77-.73-1.4 0-1.3 1.04-1.97 2.27-1.97s2.26.67 2.26 1.97c0 .63-.28 1.09-.73 1.4.62.35.97.94.97 1.62 0 1.24-.96 2.01-2.5 2.01"})]}),done:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:jsx("path",{d:"M9 16.2 4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4z"})}),doneAll:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:jsx("path",{d:"m18 7-1.41-1.41-6.34 6.34 1.41 1.41zm4.24-1.41L11.66 16.17 7.48 12l-1.41 1.41L11.66 19l12-12zM.41 13.41 6 19l1.41-1.41L1.83 12z"})}),pending:jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[jsx("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2M12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"}),jsx("path",{d:"M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z"})]})},O=qa;var Xa=({title:t="Alert",onClose:n})=>jsxs(p,{as:"--head flex aic rel",children:[jsx(p,{as:`--${t?"title":"dot"} flex aic jcc rel`,children:t}),jsx(z,{onClick:e=>n(),className:"--closer abs center-v",children:O.close})]}),Ar=Xa;var _r=({ref:t,...n})=>{let{index:e,id:r,title:o,message:s,transition:a,curve:u,speed:f,type:l,action:c,actionPosition:m,spinner:i,loadingMessage:g,variant:T,inBackground:b,forceClose:S,forceLoading:I,onClose:R,onShow:P,onHide:h,...C}=n,y=useMemo(()=>uuid(12),[]),[x,N]=useState(o||""),[D,L]=useState(s||""),[A,M]=useState(l||Ye.Dialog),[H,V]=useState(false),[W,d]=useState(true),[E,_]=useState(c||null),[U,F]=useState(false),{variant:Z,spinner:j,dialog:Q}=X(true),Y=T||Q?.variant||Z||K.Small,{style:he,className:re,rest:ye}=B(C),Se=useRef(null),Ce=ce({when:H,duration:f||Q?.speed||.3,delay:Q?.delay||.1,transition:a||Q?.transition||G.SlideInBottom,curve:u||Q?.curve||q.EaseInOut,watch:["scale","filter","transform"]}),ae=()=>{V(false),R(r);},ee=useMemo(()=>[{keys:[KeyCode.Escape],callback:()=>{$e.isTop(ae)&&ae();}}],[H]);useShortcuts(ee),useEffect(()=>{M(Ye.Dialog),L(s),N(x),E&&_(E.reduce((ne,xe)=>(ne.push({...xe,key:xe.key||uuid(12)}),ne),[])),V(true),setTimeout(()=>P?P():()=>{},500);},[]),useEffect(()=>{S&&ae();},[S]),useEffect(()=>{I!=null&&F(I);},[I]);let te=useMemo(()=>1e4+e*10,[e]);return jsxs(Fragment$1,{children:[jsx(ze,{style:{zIndex:te},when:H}),jsxs(p,{as:`--dialog --${(l??Ye.Default).toLowerCase()} ${H?"--visible":""} ${re} fixed abc`.trim(),style:{...Ce.style,zIndex:te+1,pointerEvents:b==true?"none":"auto",...b==true?{scale:"0.92",filter:"blur(2px)"}:{}},...ye,ref:Se,children:[jsx(Ar,{title:x,onClose:ae}),jsx(Or,{message:D,render:W,action:E}),E&&E.length>0&&jsx(Hr,{variant:Y,action:E,dialogID:y,actionPosition:m}),jsx(Re,{when:U,spinner:i||Q?.spinner||j?.type||me.Simple,message:g||Q?.loadingMessage})]})]})};_r.displayName="Zuz.Dialog";var yo=_r;var Fr=forwardRef((t,n)=>{let{speed:e,style:r,...o}=t,{rootRef:s,containerRef:a,thumbY:u,thumbX:f,onScrollY:l,onScrollX:c}=useScrollbar(e||1),{style:m,className:i,rest:g}=B(o);return useEffect(()=>{let T=a.current;if(!T)return;let b=()=>{window.dispatchEvent(new Event("resize"));};return T.addEventListener("scroll",b),()=>T.removeEventListener("scroll",b)},[]),jsxs(p,{ref:s,className:i.trim(),as:"--scrollview rel",children:[jsx(p,{as:`--scroll-content ${i}`.trim(),ref:a,style:r||{},children:g.children}),jsx(p,{as:"--scroll-track --track-y --abs",children:jsx(p,{as:"--scroll-thumb --abs",ref:u,onMouseDown:l})}),jsx(p,{as:"--scroll-track --track-x --abs",children:jsx(p,{as:"--scroll-thumb --abs",ref:f,onMouseDown:c})})]})});Fr.displayName="Zuz.ScrollView";var xo=Fr;var Zr=({ref:t,...n})=>{let{id:e,index:r,from:o,speed:s,children:a,margin:u,animation:f,prerender:l,inBackground:c,forceClose:m,forceLoading:i,onClose:g,...T}=n,{drawer:b}=X(true),[S,I]=useState(a),[R,P]=useState(false),[h,C]=useState(l??(b?.prerender||true)),[y,x]=useState(false),N=()=>{P(false),g?.(e??-1);},{className:D,style:L,rest:A}=B(T),M=useMemo(()=>[{keys:[KeyCode.Escape],callback:()=>{$e.isTop(N)&&N();}}],[R]);useShortcuts(M),useEffect(()=>{I(a);},[a]),useEffect(()=>(R?$e.push(N):$e.pop(N),()=>$e.pop(N)),[R]),useEffect(()=>{P(true);},[]),useEffect(()=>{m&&N();},[m]),useEffect(()=>{i!=null&&x(i);},[i]);let H=o||b?.from||ue.Left,V=useMemo(()=>{switch(H){case ue.Left:return {from:{x:"-100vw"},to:{x:0}};case ue.Right:return {from:{x:"100vw"},to:{x:0}};case ue.Top:return {from:{y:"-100vh"},to:{y:0}};case ue.Bottom:return {from:{y:"100vh"},to:{y:0}};default:return {from:{x:"-100vw"},to:{x:0}}}},[o,b?.from]),W=ce({from:{...V.from,opacity:0},to:{...V.to,opacity:1},when:R,curve:f||b?.animation||q.EaseInOut,duration:s||b?.speed||.5,watch:["scale","filter"]}),d=useMemo(()=>1e4+(r||1)*10,[r]);return jsxs(Fragment$1,{children:[jsx(ze,{onClick:E=>{R&&N();},when:R,style:{zIndex:d}}),jsxs(p,{ref:t,"aria-hidden":!R,className:`--drawer flex cols ${D} --${H.toLowerCase()} fixed`,style:{...L,...W.style,"--m":`${u||b?.margin||0}px`,zIndex:d+1,pointerEvents:c==true?"none":"auto",...c==true?{scale:"0.92",filter:"blur(2px)"}:{}},...A,children:[o==ue.Top||o==ue.Bottom?jsx(p,{className:"--handle"}):null,jsxs(xo,{as:"rel",children:[h||R?S:null,jsx(Re,{when:y})]})]})]})};Zr.displayName="Zuz.Drawer";var So=Zr;var Wr=forwardRef((t,n)=>{let{progress:e,type:r,animated:o,...s}=t,a=useRef(null);useImperativeHandle(n,()=>({setProgress:c=>{a.current.style.width=`${c*100}%`,a.current.setAttribute("data-value",c+"");},getProgress:()=>+(a.current.getAttribute("data-value")||0)}),[]),useEffect(()=>{e&&a.current&&(o?setTimeout(()=>a.current.style.width=`${e*100}%`,500):a.current.style.width=`${e*100}%`,a.current.setAttribute("data-value",e+""));},[e,a.current]);let{className:u,style:f,rest:l}=B(s);return jsx(p,{className:`--progress ${o?"--animated":""} flex rel ${u}`.trim(),style:f,...l,children:jsx(p,{ref:a,className:"--bar rel"})})});Wr.displayName="Zuz.ProgressBar";var Fe=Wr;var Ot=(s=>(s.Default="default",s.Success="success",s.Error="error",s.Warn="warn",s.Promise="promise",s))(Ot||{}),Dt=(a=>(a.TopLeft="TopLeft",a.TopCenter="TopCenter",a.TopRight="TopRight",a.BottomLeft="BottomLeft",a.BottomCenter="BottomCenter",a.BottomRight="BottomRight",a))(Dt||{}),Ur=(e=>(e.Stack="stack",e.Individual="individual",e))(Ur||{}),Gr={success:"Action Successful",error:"Something Went Wrong",warn:"Heads Up",default:"Notice"};var ui=t=>{let{index:n,id:e,type:r,icon:o,title:s,message:a,duration:u,sticky:f=false,actions:l=[],position:c,style:m,isHovered:i,total:g,progress:T,forceClose:b,variant:S,onClick:I,onClose:R}=t,[P,h]=useState(false),[C,y]=useState(false),{toast:x}=X(true),N=C||b,D=c||x?.position||"TopCenter",L=r||x?.type||"default",A=m||x?.style||"stack",M=u||x?.duration||4,H=T||x?.progress||false,V=useRef(M*1e3),W=useRef(void 0),d=useRef(void 0),E=useRef(null),_=ce({when:P&&!N,duration:.3,transition:x?.transition||(D.includes("Top")?G.SlideInTop:D.includes("Bottom")?G.SlideInBottom:D.includes("Left")?G.SlideInLeft:G.SlideInRight),curve:x?.curve||q.EaseInOut,watch:["transform","opacity","scale","filter"]});useEffect(()=>{h(true);let re=ye=>{if(d.current!==void 0){let Se=ye-d.current;if(!i&&!f&&!N&&(V.current-=Se,E.current)){let Ce=Math.max(0,V.current/(M*1e3)*100);E.current?.setProgress?.(Ce/100);}}d.current=ye,V.current<=0?y(true):W.current=requestAnimationFrame(re);};return W.current=requestAnimationFrame(re),()=>{W.current&&cancelAnimationFrame(W.current);}},[i,f,N,M]),useEffect(()=>{if(N){let re=setTimeout(()=>{R?.(e);},350);return ()=>clearTimeout(re)}},[N,e]);let U=A==="stack",F=i?n*65:n*8,Z=i?1:Math.max(.85,1-n*.05),j=i?1:Math.max(.4,1-n*.2),Q=()=>{I?I():(!l||l.length===0)&&y(true);},Y=_.style.transform||"translate(0, 0)",he=N?Y:`${Y} translateY(${D.includes("Top")?F:-F}px) scale(${Z})`;return jsxs(p,{onClick:Q,as:`--snack --${N?"hidden":"visible"} --${S||x?.variant||K.Medium} --${L} --${D.toLowerCase()} abs flex aic`,style:{..._.style,zIndex:1e3-n,pointerEvents:N?"none":"auto",opacity:N?_.style.opacity:j,transform:he,filter:!N&&U&&!i&&n>0?"blur(1px)":"none",cursor:!l||l.length===0?"pointer":"default",transition:`${_.style.transition}, transform 0.3s ease, opacity 0.3s ease`},children:[jsx(p,{as:"--ico flex aic jcc",children:o?jsx(J,{name:o}):jsx(p,{as:"--no-icon"})}),jsxs(p,{as:"--meta flex cols",children:[jsx($,{as:"--tt",children:s||Gr[r]}),jsx($,{as:"--tm",children:a})]}),l&&l.length>0&&jsx(p,{as:"--actions flex gap:5",children:l.map((re,ye)=>jsx(z,{as:"--snack-btn bold",onClick:Se=>{Se.stopPropagation(),re.onClick();},children:re.label},ye))}),H&&jsx(Fe,{as:"abs",ref:E})]})},Co=ui;var fe=createContext(null),xi=({ref:t,...n})=>{let r=useContext(fe)?.depth??0,[o,s]=useState(null),[a,u]=useState(null),[f,l]=useState(false),[c,m]=useState([]),i=useDelayed(),g=useRef(0),T=()=>++g.current,b=()=>{l(false),setTimeout(()=>u(null),200);};useImperativeHandle(t,()=>({add(h){let C=T(),y={id:C,...h};return m(x=>[...x,y]),C},openMenu(h){l(false),setTimeout(()=>{u({id:T(),type:"menu",props:h}),l(true);},16);},remove(h){m(C=>C.map(y=>y.id===h?{...y,props:{...y.props,forceClose:true}}:y)),a?.id===h&&b();},loading(h,C){m(y=>y.map(x=>x.id===h?{...x,props:{...x.props,forceLoading:C}}:x)),a?.id===h&&b();},clear(h){m(c.filter(C=>C.type!=h));}})),useEffect(()=>{if(a&&f){let h=()=>b();return document.addEventListener("click",h),()=>document.removeEventListener("click",h)}},[a,f,b]);let S=h=>{setTimeout(()=>{m(C=>C.filter(y=>y.id!==h)),a?.id===h&&u(null);},250);},I=useMemo(()=>[...c.filter(h=>h.type!="toast")],[c]);if(!i)return null;let R=c.filter(h=>h.type=="toast").reverse(),P=Object.values(Dt);return createPortal(jsxs(p,{as:"--zuz-layers-wrapper fixed fill nope",style:{zIndex:9999+r},children:[I.map((h,C)=>{let y=C<I.length-1;return h.type==="dialog"?jsx(yo,{onClose:S,index:C,id:h.id,...h.props,inBackground:y},`layer-${h.type}-${h.id}`):h.type==="drawer"?jsx(So,{onClose:S,index:C,id:h.id,...h.props,inBackground:y},`layer-${h.type}-${h.id}`):null}),P.map(h=>{let C=R.filter(y=>(y.props.position||"TopCenter")===h);return C.length===0?null:jsx(p,{onMouseEnter:()=>s(h),onMouseLeave:()=>s(null),as:`--toast-container fixed --${h.toLowerCase()} flex cols`,style:{pointerEvents:"auto",zIndex:"var(--max-z-index)"},children:C.map((y,x)=>jsx(Co,{index:x,total:C.length,isHovered:o===h,onClose:S,id:y.id,...y.props},y.id))},h)}),a&&jsx(p,{as:"--zuz-layer-menus fixed fill nope",style:{zIndex:"var(--max-z-index)"},children:jsx(po,{onClose:b,when:f,...a.props},`menu-${a.id}`)})]}),document.body)},bi=({children:t})=>{let n=useContext(fe),e=n?n.depth+1:0,r=useRef(null),o=useMemo(()=>({add:s=>r.current?.add(s),openMenu:s=>r.current?.openMenu(s),remove:s=>r.current?.remove(s),loading:(s,a)=>r.current?.loading(s,a),clear:s=>r.current?.clear(s),depth:e,isSubLayer:!!n}),[n]);return jsxs(fe.Provider,{value:o,children:[t,jsx(xi,{ref:r})]})},co=bi;var wi=()=>{let t=useContext(fe);if(!t)throw new Error("useContextMenu must be used inside <LayersProvider>");return {showContextMenu:(r,o,s)=>{r.preventDefault(),t.openMenu({event:r,items:o,origin:s});},showMenu:(r,{items:o,origin:s,offsetX:a,offsetY:u,transition:f,curve:l,arrow:c,duration:m,header:i,footer:g})=>{t.openMenu({fx:{transition:f,curve:l,duration:m},parent:r,items:o,origin:s||mt.TopCenter,offsetX:a,offsetY:u,arrow:c,header:i,footer:g});},hide:t.clear}},Si=wi;var Ti=()=>{let t=useContext(fe);if(!t)throw new Error("useDialog must be used inside <LayersProvider>");let n=()=>t.clear("dialog"),e=s=>t.remove(s),r=(s,a)=>t.loading(s,a);return {clearAll:n,show:s=>{let a=t.add({type:"dialog",props:{...s,type:Ye.Dialog}});return {id:a,setLoading:u=>r(a,u),hide:()=>e(a)}},hide:e}},Pi=Ti;var Ii=()=>{let t=useContext(fe);if(!t)throw new Error("useDialog must be used inside <LayersProvider>");let n=()=>t.clear("drawer"),e=s=>t.remove(s),r=(s,a)=>t.loading(s,a),o=s=>{let a=t.add({type:"drawer",props:s});return {id:a,setLoading:u=>r(a,u),close:()=>e(a)}};return {clearAll:n,open:s=>o({children:s}),right:s=>o({children:s,from:ue.Right}),left:s=>o({children:s,from:ue.Left}),top:s=>o({children:s,from:ue.Top}),bottom:s=>o({children:s,from:ue.Bottom}),close:e}},Ni=Ii;var Ei=(t,n,e={})=>{let[r,o]=useState(null),[s,a]=useState(false),{duration:u=.25,curve:f=q.EaseOutBack,borderRadius:l={from:40,to:24},targetWidth:c=320}=e;return useLayoutEffect(()=>{n&&t.current?(o(t.current.getBoundingClientRect()),a(true)):n||a(false);},[n,t]),{style:ce({from:{opacity:0,width:r?.width,height:r?.height,borderRadius:l.from},to:{opacity:1,width:c,height:"auto",borderRadius:l.to},curve:f,duration:u,when:s&&n}).style,isMeasured:s,sourceRect:r}},Li=Ei;var Di=(t,n={})=>{let{offset:e=8,direction:r="bottom",container:o=null,triggerRef:s=null}=n,a=useRef(null),u=useCallback(()=>{let f=t.current;if(!f)return;let l=s?.current||f.parentElement;if(!l){console.warn("usePosition: No trigger element found. Positioning may not work.");return}let c=f.getBoundingClientRect(),m=l.getBoundingClientRect(),i,g;o?(i=o.getBoundingClientRect(),g="absolute"):(window.getComputedStyle(f).position==="fixed"?g="fixed":g="absolute",g==="fixed"?i={top:0,left:0,right:window.innerWidth,bottom:window.innerHeight,width:window.innerWidth,height:window.innerHeight}:i={top:0,left:0,right:window.innerWidth,bottom:window.innerHeight,width:window.innerWidth,height:window.innerHeight}),f.style.position!==g&&(f.style.position=g),a.current=g;let S=0,I=0;switch(r){case "top":S=m.top-c.height-e,I=m.left,S<i.top&&m.bottom+c.height+e<=i.bottom&&(S=m.bottom+e);break;case "bottom":S=m.bottom+e,I=m.left,S+c.height>i.bottom&&m.top-c.height-e>=i.top&&(S=m.top-c.height-e);break;case "left":S=m.top,I=m.left-c.width-e,I<i.left&&m.right+c.width+e<=i.right&&(I=m.right+e);break;case "right":S=m.top,I=m.right+e,I+c.width>i.right&&m.left-c.width-e>=i.left&&(I=m.left-c.width-e);break}if(S=Math.max(i.top,Math.min(S,i.bottom-c.height)),I=Math.max(i.left,Math.min(I,i.right-c.width)),a.current==="fixed")f.style.top=`${S}px`,f.style.left=`${I}px`;else {let R;f.offsetParent?R=f.offsetParent.getBoundingClientRect():R={top:0,left:0};let P=S-R.top+window.scrollY,h=I-R.left+window.scrollX;f.style.top=`${P}px`,f.style.left=`${h}px`;}},[t,s,e,r,o]);return useEffect(()=>{let f=t.current;if(!f)return;let l=s?.current||f.parentElement;if(!l){console.warn("usePosition: No trigger element found. Positioning may not work.");return}let c=new ResizeObserver(u);return c.observe(f),l&&c.observe(l),u(),window.addEventListener("resize",u),window.addEventListener("scroll",u,true),()=>{c.disconnect(),l&&c.disconnect(),window.removeEventListener("resize",u),window.removeEventListener("scroll",u,true);}},[t,r,e,o,s]),{postion:a.current,reposition:u}},gt=Di;var Vi=()=>{let t=useContext(fe);if(!t)throw new Error("useToast must be used inside <LayersProvider>");let n=(m,i)=>t.add({type:"toast",props:{...i,type:m}}),r=m=>t.remove(m),l=(m,i,g)=>{let T=n(m,{...i,sticky:i.sticky??false,actions:[{label:g?.label||"Ok",onClick:()=>{g?.onClick?.(),r(T);}}]});return T},c=(m,i,g,T)=>{let b=n(m,{...i,sticky:true,actions:[{label:T?.label||"Cancel",onClick:()=>{T?.onClick?.(),r(b);}},{label:g?.label||"Ok",onClick:()=>{g?.onClick?.(),r(b);}}]});return b};return {ok:(m,i)=>l("default",m,i),success:(m,i)=>l("success",m,i),error:(m,i)=>l("error",m,i),confirm:(m,i,g)=>c("default",m,i,g),warn:(m,i)=>l("warn",m,i)}},Ai=Vi;var zi=()=>{let t=useContext(fe);if(!t)throw new Error("useToast must be used inside <LayersProvider>");let n=(l,c)=>t.add({type:"toast",props:{...c,type:l}});return {show:(l,c,m,i)=>n("default",{title:l,message:c,icon:m,duration:i}),hide:l=>t.remove(l),success:(l,c,m,i)=>n("success",{title:l,message:c,icon:m,duration:i}),error:(l,c,m,i)=>n("error",{title:l,message:c,icon:m,duration:i}),warn:(l,c,m,i)=>n("warn",{title:l,message:c,icon:m,duration:i}),promise:(l,c,m,i)=>n("promise",{title:l,message:c,icon:m,duration:i}),clearAll:()=>t.clear("toast")}},To=zi;var on=({ref:t,style:n,...e})=>{let r=useRef(null),o=useMemo(()=>t&&typeof t!="function"&&t.current?t:r,[t]),{style:s,className:a,rest:u}=B(e,o);return jsx("div",{ref:t||r,style:{...s,...n||{}},className:a,...u})};on.displayName="Zuz.Box";var p=on;var nn=forwardRef((t,n)=>{let{title:e,message:r,...o}=t,[s,a]=useState(false);return jsxs(p,{className:"--accordion flex cols",...o,children:[jsxs(z,{onClick:u=>a(!s),className:`--toggle flex aic ${s?"--open":""}`.trim(),children:[jsx($,{className:"--label flex",children:e}),jsx(p,{className:"--arrow flex",children:s?O.arrowUp:O.arrowDown})]}),s&&jsx(p,{className:"--detail",children:r})]})});nn.displayName="Zuz.Accordion";var Ui=nn;var Gi=({label:t,icon:n,onClick:e,idx:r,selected:o})=>jsx(z,{onClick:e,onMouseMove:s=>document.documentElement.style.setProperty("--tip-m",`${r}`),className:`--action ${o?"--selected":""} aic jcc rel`.trim(),children:typeof n=="string"?jsx(J,{name:n}):n}),an=Gi;var ln=forwardRef((t,n)=>{let{items:e,name:r,selected:o,position:s,...a}=t,u=useRef(null),[f,l]=useState(o||e[0].tag||0),c=useCallback(({x:S,y:I})=>{if(u.current){let R=u.current.getBoundingClientRect();document.documentElement.style.setProperty("--tip-x",`${S-R.left}`),document.documentElement.style.setProperty("--tip-y",`${I-R.top}`),document.documentElement.style.setProperty("--tip-s","1");}},[]),m=useCallback(()=>{u.current&&(u.current.removeEventListener("pointerleave",m),u.current.removeEventListener("pointermove",c),document.documentElement.style.setProperty("--tip-s","0"));},[]),i=useCallback(()=>{u.current&&(u.current.addEventListener("pointerleave",m),u.current.addEventListener("pointermove",c));},[]);useEffect(()=>{u.current&&(document.documentElement.style.setProperty("--tip-w",e.reduce((S,I)=>I.label.length>S.length?I.label:S,"").length.toString()),document.documentElement.style.setProperty("--tip-s","0"),document.documentElement.style.setProperty("--tip-l",`${e.length}`),u.current?.addEventListener("pointerenter",i));},[]);let{className:g,style:T,rest:b}=B(a);return jsxs(p,{ref:u,style:T,className:[`--actionbar flex aic ${g}`,`${!s||s==le.Auto?"rel":`--${s}`}`].join(" ").trim(),...b,children:[e.map((S,I)=>jsx(an,{selected:f===S.tag||o==I,...S,idx:I},`actionbar-action-${S.label.toLowerCase().replace(/\s+/g,"-")}`)),jsx(p,{className:"--tip abs",children:jsx(p,{className:"--track flex aic",children:e.map(({label:S})=>jsx(p,{className:"--lb",children:S},`tool-tip-${S.toLowerCase().replace(/\s+/g,"-")}`))})})]})});ln.displayName="Zuz.ActionBar";var Ji=ln;var mn=forwardRef((t,n)=>{let{type:e,icon:r,title:o,message:s,iconSize:a,...u}=t,{className:f,style:l,rest:c}=B(u);return jsxs(p,{className:`--alert --${e||be.Info} flex aic ${f}`.trim(),style:l,...c,children:[jsx(p,{className:`--icon icon-${r||"auto-matic"}`,style:a?{fontSize:a,width:a,height:a}:{},children:!r&&O[e||be.Info]}),jsxs(p,{className:"--meta flex cols",children:[jsx($,{className:`--title ${s?"--tm":""}`,children:o||"Lorem ipsum dolor sit amet, consectetur adipiscing elit."}),s&&jsx($,{className:"--message",h:2,children:s})]})]})});mn.displayName="Zuz.Alert";var tl=mn;var pn=({ref:t,...n})=>{let{variant:e,numeric:r,onConfirm:o,...s}=n,{style:a,className:u,rest:f}=B(s),{variant:l}=X(true),c=m=>{r&&(m.currentTarget.value=m.currentTarget.value.replace(/[^0-9.]/g,"").replace(/(\..*?)\..*/g,"$1"));};return jsx("input",{className:`--input --${e||l} flex ${u}`.trim(),style:a,onInput:c,onKeyDown:m=>{m.key=="Enter"&&o?.(m.currentTarget.value);},ref:t,...f})};pn.displayName="Zuz.Input";var se=pn;var fn=t=>{let{meta:n,children:e}=t,r=useDelayed(),{label:o,icon:s,...a}=isValidElement(n)?{}:n,{className:u,style:f,rest:l}=B({...a,...a.animate?{animate:{...a.animate,when:r}}:{}});return isValidElement(n)?jsx("li",{style:f,className:u,children:n}):jsxs("li",{style:f,className:u,...l,children:[e,typeof n=="string"?n:o]})};fn.displayName="Zuz.ListItem";var dn=fn;var hn=forwardRef((t,n)=>{let{items:e,variant:r,direction:o,seperator:s,ol:a,...u}=t,{className:f,style:l,rest:c}=B(u),m=a==true?"ol":"ul";return createElement(m,{className:`--list --${r||K.Small} flex ${o??"cols"} ${f}`.trim(),style:l,ref:n,...c,children:e.map((i,g,T)=>{let b=`${typeof i=="string"?`li-${String(i)}`:isValidElement(i)?`li-${i.key}`||`${g}-${MD5(i.toString())}`:i.label}-${g}`;return jsxs(Fragment,{children:[jsx(dn,{meta:i}),s&&T[g+1]?jsx("li",{className:"--list-seperator",children:s},`spt-${g+1}-${b}`):null]},b)})})});hn.displayName="Zuz.List";var Ke=hn;var xn=forwardRef((t,n)=>{let{fx:e,action:r,data:o,withStyle:s,onChange:a,...u}=t,{className:f}=B({as:s||""}),{style:l}=B(u),[c,m]=useState(false),[i,g]=useState(o||[]),T=useRef(null),b=useRef(null),S=useRef(null),I=useMemo(()=>u.name||uuid(12),[]),[R,P]=useState(null),[h,C]=useState(null),[y,x]=useState([]),D=useDebounce(d=>{d.target.value==""?(m(false),g([])):r&&d.target.value.trim()!=""&&withPost(r,{query:d.target.value}).then(E=>{"items"in E&&_(E.items).isArray()?(g(E.items),C(d.target.value),x(E.items)):console.error("Action Response should contain items array"),P(null);}).catch(E=>{P(null),g([]);});},250),L=()=>{if(b.current){let d=b.current.getBoundingClientRect(),E=window.innerHeight-d.bottom,_=d.top;if(S.current){let U=S.current;E<U.offsetHeight&&_>E?(U.style.top="auto",U.style.bottom=`${d.height}px`,U.style.maxHeight=`${_-150}px`):(U.style.top=`${d.height+5}px`,U.style.bottom="auto",U.style.maxHeight=`${E-150}px`);}}},A=d=>{if(i.length>0){if((d.key==="ArrowDown"||d.key==="ArrowUp")&&(d.preventDefault(),d.stopPropagation()),d.key==="Escape")P(null),m(false),g([]);else if(d.key==="ArrowDown")P(E=>{let _=E===null||E===i.length-1?0:E+1;return H(_),_});else if(d.key==="ArrowUp")P(E=>{let _=E===null||E===0?i.length-1:E-1;return H(_),_});else if(d.key==="Enter"&&R!==null){let E=i[R];T.current&&(T.current.value=E,m(false),g([]));}}},M=d=>{T.current&&(T.current.value=d,m(false),g([]));},H=d=>{let E=i[d];if(E&&T.current&&(T.current.value=E,T.current.setSelectionRange(E.length,E.length)),S.current){let U=S.current.children[d];U&&U.scrollIntoView({block:"nearest"});}},V=d=>{b.current&&!b.current.contains(d.target)&&(m(false),g([]));},W=()=>{T.current&&T.current.value===h&&(g(y),P(null),L());};return useEffect(()=>(window.addEventListener("resize",L),window.addEventListener("scroll",L,true),document.addEventListener("mousedown",V),()=>{window.removeEventListener("resize",L),window.removeEventListener("scroll",L,true),document.removeEventListener("mousedown",V);}),[]),useEffect(()=>{L();},[i]),jsxs(p,{style:l,ref:b,className:`--autocomplete --${t.size||K.Small} flex aic rel ${f}`.trim(),children:[jsx(se,{ref:T,autoComplete:"off",onChange:D,onKeyDown:A,onFocus:W,...u}),jsx(p,{className:"--arrow rel flex aic jcc",children:i.length>0?O.arrowUp:O.arrowDown}),i.length>0&&jsx(Ke,{id:I,ref:S,className:"--suggestion-list flex cols abs",items:i.map((d,E)=>({label:d,onClick:_=>{_.preventDefault(),_.stopPropagation(),M(d);},className:R===E?"--current":"",animate:{transition:G.SlideInBottom,curve:q.EaseInOut,delay:clamp(.02*E,.02,.5)}}))})]})});xn.displayName="Zuz.AutoComplete";var bl=xn;var bn=forwardRef((t,n)=>{let e=useRef(null),r=useMemo(()=>n&&typeof n!="function"&&n.current?n:e,[n]),{style:o,className:s,rest:a}=B(t,r);return !a.src||a.src==""?null:jsx("img",{ref:r,style:o,className:`${s} flex`,...a})});bn.displayName="Zuz.Image";var We=bn;var vn=forwardRef((t,n)=>{let{src:e,variant:r,type:o,crossOrigin:s,referrerPolicy:a,fx:u,as:f,alt:l,color:c,style:m,...i}=t,[g,T,b]=useImage(e??"",s,a),{className:S,style:I,rest:R}=B({fx:u,as:f});return jsx(p,{className:`--avatar --${r||K.Small} --${(o||lr.Circle).toLowerCase()} rel flex aic jcc ${S}`.trim(),style:{background:c||"var(--primary)",...m,...I},...R,children:e?jsx(We,{src:g,crossOrigin:s,referrerPolicy:a,...i}):jsx($,{className:"--avatar-label",children:(l?l.charAt(0):"A").toUpperCase()})})});vn.displayName="Zuz.Avatar";var Il=vn;var Nl=({size:t=5,type:n="dead",label:e="",variant:r=K.Small,loading:o=false,spinner:s,...a})=>{let{style:u,className:f,rest:l}=B(a);return jsxs(p,{style:{..._(e).isEmpty()?{"--badge-size":t}:{},...u},as:`--badge --${r} --${n} rel flex aic jcc ${f}`.trim(),children:[jsx(p,{fx:{transition:G.FadeIn,curve:q.Liquid,duration:.5,when:o},as:"abs abc",children:jsx(we,{type:s})}),_(e).isEmpty()?jsx(p,{as:`--dot --${n}`}):jsx($,{as:"--label",children:e})]})},Bl=Nl;var Zl=[{label:"Today",getDate:()=>new Date,getDateFormat:()=>format(new Date,"EEE")},{label:"Later",getDate:()=>new Date,getDateFormat:()=>format(addHours(new Date,2),"hh:mm a")},{label:"Tomorrow",getDate:()=>addDays(new Date,1),getDateFormat:()=>format(addDays(new Date,1),"EEE")},{label:"This weekend",getDate:()=>{let t=new Date,n=t.getDay();return addDays(t,(6-n)%7||6)},getDateFormat:()=>{let t=new Date,n=t.getDay();return format(addDays(t,(6-n)%7||6),"EEE, MMM d")}},{label:"Next week",getDateFormat:()=>format(addWeeks(new Date,1),"EEE, MMM d"),getDate:()=>addWeeks(new Date,1)},{label:"Next weekend",getDateFormat:()=>format(addWeeks(new Date,1),"d MMM"),getDate:()=>addWeeks(new Date,1)},{label:"2 weeks",getDateFormat:()=>format(addWeeks(new Date,2),"d MMM"),getDate:()=>addWeeks(new Date,2)},{label:"4 weeks",getDateFormat:()=>format(addWeeks(new Date,4),"d MMM"),getDate:()=>addWeeks(new Date,4)}],Kl=t=>{let n=new Set;return t.filter(e=>{if(e.label=="Later")return true;let r=e.getDate().toISOString().split("T")[0];return n.has(r)?false:(n.add(r),true)})},Sn=forwardRef((t,n)=>{let{defaultValue:e,variant:r,onChange:o,...s}=t,{style:a,className:u,rest:f}=B(s),[l,c]=useState(e||new Date),m=startOfMonth(l),i=endOfMonth(l),g=startOfWeek(m),T=endOfWeek(i),b=useMemo(()=>eachDayOfInterval({start:g,end:T}),[g,T]),S=P=>{o?.(P),c(P);},I=()=>{c(P=>new Date(P.getFullYear(),P.getMonth()-1));},R=()=>{c(P=>new Date(P.getFullYear(),P.getMonth()+1));};return jsxs(p,{as:`--calendar flex --${r||"sm"} ${u}`,style:a,children:[jsx(p,{as:"--calendar-quick-select flex cols flex:1",children:Kl(Zl).map(P=>{let h=P.getDate();return jsxs(z,{onClick:()=>S(h),as:["--calendar-quick-option flex aic gap:5"],children:[jsx($,{as:"flex:1",children:P.label}),jsx($,{as:"tar",children:P.getDateFormat()})]},`--dtp-option-label-${P.label}`)})}),jsxs(p,{as:"--calendar-selector flex cols flex:1",children:[jsxs(p,{as:"--calendar-head flex aic jcc gap:4",children:[jsx($,{as:"flex:1 --calendar-cm bold",children:format(l,"MMMM yyyy")}),jsx(z,{onClick:I,as:"--calendar-chevron",children:O.chevronUpOutline}),jsx(z,{onClick:R,as:"--calendar-chevron",children:O.chevronDownOutline})]}),jsxs(p,{as:"--calendar-days gap:4",children:[["Su","Mo","Tu","We","Th","Fr","Sa"].map(P=>jsx($,{as:"--calendar-day",children:P},`--calendar-hd-${P}`)),b.map((P,h)=>{let C=isSameMonth(P,l),y=isSameDay(P,l),x=isToday(P);return jsx(z,{disabled:!C,onClick:()=>S(P),as:["--calendar-day --calendar-dd",`${y?"--calendar-dd-selected":""}`,`${x?"--calendar-dd-current":""}`],children:format(P,"d")},`--calendar-day-${h}-${P.getFullYear()}-${P.getMonth()}-${P.getDay()}`)})]})]})]})});Sn.displayName="Zuz.Calendar";var Lo=Sn;var _t=(e=>(e.Table="table",e.Gooey="gooey",e))(_t||{});var Rn=({ref:t,...n})=>{let{itemCount:e,itemsPerPage:r,startPage:o,pageRange:s,paginationStyle:a,breakLabel:u,prevLabel:f,nextLabel:l,hash:c,loading:m,seperator:i,renderOnZeroPageCount:g,asDots:T,progressBar:b,onPageChange:S,...I}=n,R=useRef(null),P=useMemo(()=>toHash(numberInRange(4,8)),[]),h=useCallback(d=>`${toHash(d,c||6,P)}${i||""}${P}`,[P]),C=useMemo(()=>u||"...",[u]),y=useRef(null),[x,N]=useState({id:c?o?typeof o=="number"?h(o):o:1:o||1,label:o||1});useImperativeHandle(t,()=>({setPage:d=>N(d),getPage:d=>x,setProgress:d=>y.current?.setProgress?.(d),getProgress:()=>y.current?.getProgress?.()??0}),[y.current]);let{style:D,className:L,rest:A}=B(I),M=useCallback(d=>typeof d=="number"?d:+d.label,[]);if(!e)throw new Error('"itemCount" prop is required');let H=useMemo(()=>Math.ceil(e/r),[e,r]),V=useMemo(()=>{let d=[],E=Math.max(M(x)-(s||2),1),_=Math.min(M(x)+(s||2),H);E>1&&d.push({id:c?h(1):1,label:1}),E>2&&d.push({id:-1,label:C});for(let U=E;U<=_;U++)d.push({id:c?h(U):U,label:U});return _<H-1&&d.push({id:-1,label:C}),_<H&&d.push({id:c?h(H):H,label:H}),d},[x]),W=useCallback(d=>{let E=d;+E.label<1||+E.label>H||(N(E),S?.(E));},[e,r,x]);return V.length<=1&&(g??false)===false?null:jsxs(p,{ref:R,as:`--pagination ${T===true?"--as-dots":""} --pgt-${a||"table"} flex aic w:100% jcc ${L}`,children:[jsx(p,{as:"flex flex:1 aic --pgt-btns",children:(V.length>1?V:[{id:1,label:1},{id:-1,label:C}]).map((d,E,_)=>{let U=(typeof d=="string"?d:d.label)==M(x);return jsx(z,{disabled:d.id==-1||M(x)==+d.label,className:U?"--current-page":"",onClick:F=>W(d),children:T===true?b===true&&U?jsx(Fe,{ref:y}):"":typeof d=="string"?d:d.label},`--pg-${E}-${d.id}`)})}),jsx(p,{as:"flex aic jcc flex:1 --pagination-label",children:[`Showing ${(M(x)-1)*r+1} - `,`${Math.min(M(x)*r,e)} of ${e} items`].join(" ")}),jsxs(p,{as:"flex aic jce flex:1 --pgt-btns --pgt-nav",children:[jsx(z,{disabled:M(x)<=1,onClick:d=>W({id:c?h(M(x)-1):M(x)-1,label:M(x)-1}),children:O.chevronLeftOutline}),jsx(z,{disabled:V.length<=1||M(x)==M(V[V.length-1]),onClick:d=>W({id:c?h(M(x)+1):M(x)+1,label:M(x)+1}),children:O.chevronRightOutline})]})]})};Rn.displayName="Zuz.Pagination";var xt=Rn;function Jl(t,n){let{items:e,renderItem:r,effect:o="slide",loop:s=true,loopMode:a="infinite",startIndex:u=0,useKeys:f=true,useWheel:l=true,spacing:c=160,rotation:m=20,scaleStep:i=.15,blur:g=4,animation:T="power",showDots:b=false,autoPlay:S=false,autoPlaySpeed:I=3,onChange:R,...P}=t,{className:h,style:C}=B(P),y=useRef(null),x=I/(I>=1e3?1e3:1),N=useCarousel({total:e.length,initialIndex:u,loop:s,useKeys:f,useWheel:l,onChange:H=>{y.current?.setPage({id:H+1,label:H+1}),y.current?.setProgress(0),R?.(H);}}),{pause:D,resume:L,reset:A}=useTimer({duration:x,autoStart:S===true,onProgress:H=>{S===true&&y.current?.setProgress(1-H);},onExpired:()=>{S===true&&N.next(),A();}}),M={...C,"--carousel-spacing":`${c}px`,"--carousel-rotation":`${m}deg`,"--carousel-blur":`${g}px`,"--carousel-scale-step":i,"--active-index":N.index,"--carousel-transition":`var(--${T})`};return jsxs(p,{ref:n,className:`--carousel --effect-${o} --loop-${a} flex cols aic jcc ${h}`.trim(),style:M,children:[jsx(p,{className:"--carousel-stage rel fill flex aic jcc",children:e.map((H,V)=>{let W=V-N.index;if(a==="infinite"){let E=e.length;W=((W+E/2)%E+E)%E-E/2;}let d=V===N.index;return jsx(p,{onMouseEnter:()=>d&&D(),onMouseLeave:()=>d&&L(),className:`--carousel-item-wrapper abs ${d?"--is-active":""}`,style:{"--offset":W,zIndex:d?100:100-Math.abs(W),display:Math.abs(W)>5?"none":"flex"},children:r(H,V,N.index)},V)})}),b&&jsx(xt,{ref:y,itemCount:e.length,itemsPerPage:1,startPage:u+1,pageRange:e.length,paginationStyle:"gooey",onPageChange:H=>N.goTo(+H.label-1),asDots:true,progressBar:true})]})}var jl=forwardRef(Jl),ec=jl;var In=(n=>(n.Line="line",n))(In||{});var En=forwardRef((t,n)=>{let{data:e,width:r,height:o,lineColor:s,strokeWidth:a=2,gradientStartColor:u,gradientEndColor:f,animated:l,animDuration:c=2,animDelay:m=0,padding:i=0,type:g,...T}=t,{className:b,style:S,rest:I}=B(T),R=useRef(null),P=useResizeObserver(R.current?.parentElement||R),h=typeof r=="number"?r:P.width,C=typeof o=="number"?o:P.height,y={width:h,height:C},x=useId(),{pathD:N,areaPathD:D}=useLineChart(e,y,i+(a||2)),L=useRef(null),A=useRef(null),[M,H]=useState(0),[V,W]=useState(0);return useEffect(()=>{l&&(L.current&&H(L.current.getTotalLength()),A.current&&W(A.current.getTotalLength()));},[l,N,D,h,C]),jsx(p,{ref:R,as:`--chart --${g||"line"}-chart ${b}`.trim(),style:{...S,width:r,height:o},...I,children:h>0&&C>0&&jsxs("svg",{viewBox:`0 0 ${h} ${C}`,preserveAspectRatio:"xMidYMid meet",children:[jsx("defs",{children:jsxs("linearGradient",{id:x,x1:"0%",y1:"0%",x2:"0%",y2:"100%",children:[jsx("stop",{offset:"0%",stopColor:u}),jsx("stop",{offset:"100%",stopColor:f})]})}),jsx("path",{ref:A,d:D,fill:`url(#${x})`,stroke:"none",style:l?{strokeDasharray:V,strokeDashoffset:V}:{},children:l&&jsx("animate",{attributeName:"stroke-dashoffset",from:V,to:"0",dur:`${c||2}s`,begin:`${m||0}s`,fill:"freeze"})}),jsx("path",{ref:L,d:N,fill:"none",stroke:s,strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round",style:l?{strokeDasharray:M,strokeDashoffset:M}:{},children:l&&jsx("animate",{attributeName:"stroke-dashoffset",from:M,to:"0",dur:`${c||2}s`,begin:`${m||0}s`,fill:"freeze"})})]})})});En.displayName="Zuz.Chart";var ic=En;var Ln=(o=>(o[o.Sending=0]="Sending",o[o.Sent=1]="Sent",o[o.Delivered=2]="Delivered",o[o.Read=3]="Read",o))(Ln||{}),Mn=(l=>(l.Image="img",l.Video="vid",l.Audio="audio",l.Link="link",l.Document="doc",l.Location="loc",l.Contact="contact",l.Event="event",l.Poll="poll",l))(Mn||{});var kn=forwardRef((t,n)=>{let{text:e,media:r,side:o="me",status:s=1,timeStamp:a=Date.now(),arrow:u=true,...f}=t,{className:l,style:c,rest:m}=B(f);return jsx(p,{className:`--bubble-wrapper flex --bw-${o}`.trim(),children:jsxs(p,{className:`--bubble --bubble-${o} ${r?`--with-media --bma-${r.type}`:""} rel flex cols ${u==true?"--b-arrow":""} ${l}`.trim(),style:{...c},...m,children:[e&&jsx($,{className:"--bubble-text",children:e}),r?r.type=="audio"?jsxs(p,{as:"flex aic --bubble-audio",children:[jsx(oe,{className:"--bm-action",children:O.play}),jsx(Fe,{progress:.7}),jsx($,{className:"--bm-dur",children:r.duration??"00:13"})]}):r.type=="img"?jsx(p,{as:"--bubble-image",children:jsx(We,{src:r.source})}):null:null,jsxs(p,{as:"flex aie jce --bubble-stats",children:[jsx($,{className:"--bubble-stamp tar",children:timeSince(a)}),o=="me"&&jsx(oe,{className:`--bubble-status --bs-${s}`,children:s==0?O.pending:s==1?O.done:s==2?O.doneAll:O.doneAll})]})]})})});kn.displayName="Zuz.Bubble";var mc=kn;var On=forwardRef((t,n)=>{let{style:e,className:r,rest:o}=B(t);return jsx("label",{ref:n,style:e,className:r,...o})});On.displayName="Zuz.Label";var bt=On;var Dn=forwardRef((t,n)=>{let{name:e,required:r,type:o,value:s,size:a,variant:u,checked:f,onSwitch:l,...c}=t,[m,i]=useState(f||false),g=useRef(null),{variant:T}=X(true);return useImperativeHandle(n,()=>({setChecked(b,S=true){i(b),g.current&&(g.current.checked=b),S&&l&&l(b,s||"cb");},toggle(b=true){g.current&&(g.current.checked=!m),b&&l&&l&&l(!m,s||"cb"),i(!m);}})),jsxs(bt,{className:`--${(o||Ee.Default).toLowerCase()} ${!o||o==Ee.Default?"--checkbox":"--switch"} --${u||T||K.Small} flex aic jcc ${m?"is-checked":""} rel`.trim(),...c,children:[(!o||o==Ee.Default)&&O.check,jsx(se,{ref:g,defaultChecked:m,value:s||"cb",type:"checkbox",className:"abs",name:e,required:r||false,onChange:b=>{l&&l(b.target.checked,s||"cb"),i(b.target.checked);}})]})});Dn.displayName="Zuz.CheckBox";var vt=Dn;var vc=({ref:t,...n})=>{let{code:e,lang:r="tsx",showLines:o=false,highlight:s="",as:a,fx:u,...f}=n,l=useRef(null),{className:c,style:m,rest:i}=B({as:`rel p:20 br:8 bg:shade-1 overflow:auto font:mono ${a}`,fx:u},l),g=useMemo(()=>{let b=new Set;return s.split(",").forEach(S=>{if(S.includes("-")){let[I,R]=S.split("-").map(Number);for(let P=I;P<=R;P++)b.add(P);}else S&&b.add(Number(S));}),b},[s]),T=useMemo(()=>{let b=e.split(`
9
+ `);for(;b.length>0&&b[0].trim()==="";)b.shift();for(;b.length>0&&b[b.length-1].trim()==="";)b.pop();let S=b[0]?.match(/^\s*/)?.[0].length||0,I=b.map(P=>{let h=P.match(/^\s*/)?.[0].length||0,C=Math.min(h,S);return P.slice(C)}),R=[{name:"comm",re:/\/\/.*/g},{name:"str",re:/(["'`])(?:(?=(\\?))\2.)*?\1/g},{name:"key",re:/\b(const|let|var|export|default|import|from|return|if|else|switch|case|break|as|type|interface|class|extends|await|async|new|void|typeof)\b/g},{name:"tag",re:/(&lt;\/?[A-Z][\w\.]*|&gt;)/g},{name:"var",re:/(?<!&lt;\/|&lt;)\b[A-Z]\w*\b/g},{name:"fn",re:/\b([a-z_]\w*)(?=\s*\()/gi},{name:"prop",re:/\.([a-z_]\w*)\b/gi},{name:"num",re:/\b\d+\b(?![#|A-Z|a-z|_|ZUZ])/g}];return I.map((P,h)=>{let C=P.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),y=g.has(h+1),x=[];R.forEach(N=>{C=C.replace(N.re,D=>{let L=`ZUZ_ID_${x.length}_ZUZ`;return x.push(`<span class="--token-${N.name}">${D}</span>`),L});});for(let N=x.length-1;N>=0;N--)C=C.replace(`ZUZ_ID_${N}_ZUZ`,x[N]);return `<div class="--code-line ${o==true?"--with-ln":""} ${y?"--is-highlighted":""}">
10
10
  ${o==true?`<span class="--line-number">${h+1}</span>`:""}
11
11
  <span class="--line-content">${C||" "}</span>
12
- </div>`}).join("")},[e,g]);return jsx(m,{as:`--code-block ${c}`,style:p,...f,children:jsx("pre",{ref:t,children:jsx("code",{className:`--code --lang-${r}`,dangerouslySetInnerHTML:{__html:T}})})})},vc=bc;var Dn=({onSelect:t,meta:n,selected:e,disabled:r=false})=>{let o=useRef(null),{index:s,icon:a,label:u}=n,[f,l]=useState({x:0,width:0}),c=useDelayed();return useLayoutEffect(()=>{if(c&&o.current){let{width:p,x:i}=o.current.getBoundingClientRect();l({x:i,width:p}),e&&t(s,p,i,n,true);}},[c,o.current]),useEffect(()=>{e&&t(s,f.width,f.x,n,false);},[e]),jsxs($,{disabled:r,onClick:()=>t(s,f.width,f.x,n,false),ref:o,className:`--segment-item flex aic rel ${e?"--segment-active":""}`.trim(),children:[a?typeof a=="string"?jsx(ee,{name:a,as:"--segment-icon"}):jsx(m,{as:"--segment-icon flex aic jcc",children:a}):null,u&&String(u).trim()!=""&&jsx(m,{className:"--segment-label",children:u||`Item ${s}`})]})};Dn.displayName="SelectTabItem";var Hn=Dn;var An=forwardRef((t,n)=>{let{fx:e,items:r,selected:o,variant:s,disabled:a=false,onSwitch:u,...f}=t,[l,c]=useState(o||0),p=useDelayed(50),i=useRef(l),{className:g,style:T,rest:y}=B(f),S=useRef(null),I=useRef(null),{variant:R}=X(true),P=(h,C,b,x,N)=>{if((N||l!=h&&l!=-2)&&(c(h),i.current=l,queueMicrotask(()=>{p&&u?.(x);})),S.current){let D=I.current?.getBoundingClientRect();S.current.style.setProperty("--w",`${C}px`),S.current.style.setProperty("--x",`${D?b-D.left:b}px`);}};return useImperativeHandle(n,()=>({setSelected:h=>{typeof h=="number"&&h!=l&&c(h);}}),[l]),jsxs(m,{ref:I,"data-selected":l,className:`${g} --segmented --${s||R||U.Medium} flex aic rel`,style:T,...y,children:[jsx(m,{ref:S,className:`--segment-tab --${a?"disabled":"abled"} abs`}),r.map((h,C)=>jsx(Hn,{disabled:a,onSelect:P,selected:l==C,meta:{...h,index:C}},`segment-${h.label}-${C}`))]})});An.displayName="Zuz.SelectTabs";var yt=An;var _n=forwardRef((t,n)=>{let{type:e,...r}=t,o=useDelayed(),{colorScheme:s,setColorScheme:a}=ao(),u=useCallback(()=>{a(s=="dark"?"light":s=="light"?"system":"dark");},[s]),{className:f,style:l}=B(r),c=useMemo(()=>e=="system"?[{tag:"light",index:0,label:"",icon:O.colorSchemeLight},{tag:"system",index:1,label:"",icon:O.colorSchemeSystem},{tag:"dark",index:2,label:"",icon:O.colorSchemeDark}]:[{tag:"light",index:0,label:"",icon:O.colorSchemeLight},{tag:"dark",index:2,label:"",icon:O.colorSchemeDark}],[]),p=useMemo(()=>["light","system","dark"].indexOf(s),[s]);return !o||p==-1?null:e=="system"||e=="switch"?jsx(yt,{className:`--color-scheme --${e}`,onSwitch:({tag:i})=>{a(i);},selected:p,items:c,...r}):jsx($,{onClick:u,style:l,as:`--color-scheme-switch --${r.variant||U.Small} ${f}`.trim(),children:s=="system"?O.colorSchemeSystem:s=="light"?O.colorSchemeLight:O.colorSchemeDark})});_n.displayName="Zuz.ColorScheme";var Dc=_n;var Zn=forwardRef((t,n)=>{let[e,r]=useState("wait"),{title:o,message:s,acceptLabel:a,rejectLabel:u,position:f}=t,l=async c=>{r(c==1?"accepted":"rejected"),localStorage.setItem("--ccnt",String(c));};return useEffect(()=>{let c=localStorage.getItem("--ccnt");r(c?c=="1"?"accepted":"rejected":"pending");},[]),jsxs(m,{fx:{from:{x:-1e3},to:{x:0},when:e=="pending",curve:q.EaseInOut,duration:.5,delay:e=="accepted"?0:3},as:`--cookie-consent --${e} --${f||re.Left} flex cols`,children:[jsx(V,{as:"--title",children:o||"This site uses cookies"}),jsx(V,{as:"--message",children:s||"We and selected third parties use cookies (or similar technologies) for technical purposes, to enhance and analyze site usage, to support our marketing efforts"}),jsxs(m,{as:"--footer flex aic",children:[jsx($,{onClick:c=>l(1),as:"--accept",children:a||"Accept All"}),jsx($,{onClick:c=>l(0),as:"--reject",children:u||"Cancel"})]})]})});Zn.displayName="Zuz.CookiesConsent";var $c=Zn;var qn=({ref:t,...n})=>{let{title:e,position:r,margin:o,children:s,show:a,...u}=n,{style:f,className:l,rest:c}=B(u),[p,i]=useState(false),[g,T]=useState(null),y=useMemo(()=>r||re.Top,[]),S=useRef(null),I=useRef(null),R=a!==void 0?a:p,P=x=>{},h=typeof ResizeObserver<"u"?new ResizeObserver(P):{observe:()=>{},unobserve:()=>{}},C=useDimensions(),b=useMemo(()=>{if(!I.current)return {left:0,top:0};let x=I.current.previousElementSibling;if(x){let N=x.getBoundingClientRect();switch(h.observe(x),y){case re.Top:return {left:N.left+N.width/2,top:N.top-(o||25)};case re.Bottom:return {left:N.left+N.width/2,top:N.top+(o||25)};case re.Left:return {left:N.left-N.width/2,top:N.top+N.height/2};case re.Right:return {left:N.right,top:N.top+N.height/2};default:return {left:0,top:0}}}},[I.current,C,y,R,h]);return useEffect(()=>{},[]),useImperativeHandle(t,()=>({setPosition:x=>{T(x);},show:()=>{},hide:()=>{}})),jsxs(m,{ref:S,className:"--with-tooltip rel",onMouseEnter:x=>i(true),onMouseLeave:x=>i(false),children:[s,jsx(m,{ref:I,style:{left:(g?g.x:b?.left)+"px",top:(g?g.y:b?.top)+"px"},className:`--tooltip --${y} abs ${l}`.trim(),fx:a!==void 0?void 0:{from:y==re.Bottom||y==re.Top?{opacity:0,x:"-50%",y:y==re.Top?-5:5}:{opacity:0,y:"-50%",x:y==re.Right?15:-25},to:y==re.Bottom||y==re.Top?{opacity:1,x:"-50%",y:0}:{opacity:1,y:"-50%",x:y==re.Right?10:-20},curve:q.EaseInOut,when:R},children:jsx(V,{className:"--text rel",children:e})})]})};qn.displayName="Zuz.ToolTip";var Ho=qn;var Xn=({ref:t,...n})=>{let {type:e,value:r=0,min:o=0,max:s=1,step:a=.01,onChange:u,showGhostBar:f,showKnobOnHover:l,showToolTip:c,roundValue:p,formatValue:i,...g}=n,{className:T,style:y,rest:S}=B(g),I=useRef(a||.01).current,R=useRef(o||0).current,P=useRef(s||1).current,h=useRef(r||0).current,C=useRef(null),b=useRef(null),x=useRef(null),N=useRef(null);useRef(null);let k=useRef(null),A=useRef(null),L=useRef(null),H=useRef(null),z=(Z,se,he)=>(Z-se)/(he-se)*100,W=Z=>{if(b.current){let se=parseFloat(Z.currentTarget.value);j(se);let he=z(se,parseFloat(Z.currentTarget.min),parseFloat(Z.currentTarget.max));b.current.style.setProperty("--value",`${he}`),b.current.setAttribute("data-value",`${se}`),u&&u(p?+se.toFixed(2):se);}},[d,E]=useState(false),[_,G]=useState(0),[F,K]=useState(0),[Q,J]=useState(false),j=async Z=>{let se=i?i(+Z):p?(+Z).toFixed(2):Math.round(+Z);L.current&&(L.current.textContent=String(se));},oe=Z=>{if(d){let se=Z.clientX-_,he=P-R,St=se/200*he,ye=Math.max(R,Math.min(F+St,P));if(ye=Math.round(ye/I)*I,j(ye),b.current){let Yt=z(ye,R,P);b.current.style.setProperty("--value",`${Yt}`),b.current.setAttribute("data-value",`${ye}`),A.current&&(A.current.textContent=p?ye.toFixed(2):ye.toString()),u&&u(ye);}}},ge=()=>{E(false),document.body.style.cursor="auto";},we=Z=>(Z-R)/(P-R)*100,Se=Z=>{if(!n.showGhostBar||!b.current)return;let se=b.current.getBoundingClientRect(),he=Z.clientX-se.left,St=Math.max(0,Math.min(100,he/se.width*100));if(c&&L.current&&(j(we(C.current?+C.current.value:r)),H.current?.setPosition({x:he,y:-36})),f){let ye=we(C.current?+C.current.value:r),Yt=Math.min(ye,St),pa=Math.abs(St-ye);b.current.style.setProperty("--ghost-start",`${Yt}`),b.current.style.setProperty("--ghost-width",`${pa}`);}};useEffect(()=>{b.current&&b.current.style.setProperty("--value",C.current?`${z(parseFloat(C.current.value),parseFloat(C.current.min),parseFloat(C.current.max))}`:h.toString());},[]),useEffect(()=>(d?(document.addEventListener("mousemove",oe),document.addEventListener("mouseup",ge)):(document.removeEventListener("mousemove",oe),document.removeEventListener("mouseup",ge)),()=>{document.removeEventListener("mousemove",oe),document.removeEventListener("mouseup",ge);}),[d]),useEffect(()=>{let Z=z(r,R,P);b.current?.style.setProperty("--value",`${Z}`),j(r);},[r,R,P,L.current]);let ae=()=>jsxs(m,{ref:b,onMouseEnter:()=>J(true),onMouseLeave:()=>J(false),onMouseMove:Se,className:`--slider --${e||jt.Default} ${l?"--knob-hover":""} flex rel ${T}`.trim(),style:{...y},children:[jsx(m,{ref:k,className:"--slider-track abs fill"}),f&&jsx(m,{ref:N,className:"--slider-ghost abs fill"}),jsx(m,{className:"--slider-track-filled abs fill",style:{width:"calc(var(--value) * 1%)"}}),jsx(m,{ref:x,className:"--slider-knob abs"}),jsx(ne,{ref:C,onInput:W,className:"abs fill",tabIndex:0,type:e||jt.Default,defaultValue:h||0,step:I,max:P,min:R})]});if(c===true){let Z=i?i(r):p?r.toFixed(2):r;return jsx(Ho,{ref:H,show:d||Q,position:nt.Top,margin:15,title:jsx(te,{ref:L,children:Z}),children:ae()})}return ae()};Xn.displayName="Zuz.Slider";var Xe=Xn;var Qn=forwardRef((t,n)=>{let{src:e,shape:r,size:o,...s}=t,{style:a,className:u,rest:f}=B(s),{canvasRef:l,crop:c,setScale:p,handleMouseDown:i,handleMouseUp:g,handleMouseMove:T}=useImageCropper(e,o||200,r||CropShape.Circle);return useImperativeHandle(n,()=>({getCropped(){return c()},setScale(y){p(y);}})),jsxs(m,{as:`--cropper --${r||CropShape.Circle} ${u}`,style:a,...f,children:[jsx("canvas",{ref:l,width:o||200,height:o||200,onMouseDown:i,onMouseUp:g,onMouseLeave:g,onMouseMove:T}),jsx(m,{as:"--cropper-slider",children:jsx(Xe,{onChange:y=>p(y),min:0,max:1,step:.01,value:1})})]})});Qn.displayName="Zuz.Cropper";var qc=Qn;var Yc=(e=>(e.Circle="circle",e.Square="square",e))(Yc||{});var jn=forwardRef((t,n)=>{let{items:e,maxItems:r}=t,o=useMemo(()=>{let u=typeof e=="string",f=u?[]:e;return u&&e.split(",").forEach(l=>{f.push({label:l});}),f},[e]),a=useMemo(()=>r&&r>0&&o.length>r-1,[o,r])?[...o.slice(0,2),{ID:".",label:"...",icon:"ellipsis",action:()=>{}},...o.slice(-r)]:o;return jsx(_e,{ref:n,className:"--crumb flex aic",direction:"rows",seperator:jsx(m,{as:"--crumb-chevron",children:O.chevronRightOutline}),items:a.map((u,f,l)=>u.ID=="."?jsx(m,{as:"flex aic gap:3",children:Array(3).fill(null).map(()=>jsx(m,{as:"w:4 h:4 bg:$text r:10"},`--crumb-placeholder-${f}`))}):jsxs($,{onClick:()=>u.action?.(),className:"--crumb-item",disabled:!l[f+1],children:[u.icon&&jsx(ee,{as:"--crumb-icon",name:u.icon}),jsx(V,{as:"--crumb-label",children:u.label})]},`${u.label.replace(/\s+/g,"-").toLowerCase()}-${f}`))})});jn.displayName="Zuz.Crumb";var Jc=jn;var os=forwardRef((t,n)=>{let{icon:e,defaultValue:r,value:o,size:s,variant:a,numeric:u,type:f,onConfirm:l,...c}=t,[p,i]=useState(false),[g,T]=useState(r||null),{style:y,className:S,rest:I}=B(c),R=useRef(null),P=useRef(null),{reposition:h}=pt(P,{direction:re.Bottom,offset:2}),C=x=>{u&&(x.currentTarget.value=x.currentTarget.value.replace(/[^0-9.]/g,"").replace(/(\..*?)\..*/g,"$1"));};useEffect(()=>{let x=N=>{let D=N.target,k=R.current?.contains(D),A=P.current?.contains(D);!k&&!A&&i(false);};return p&&document.addEventListener("mousedown",x),()=>{document.removeEventListener("mousedown",x);}},[p]),useEffect(()=>{let x=N=>{N.key==="Escape"&&p&&(i(false),R.current?.focus());};return document.addEventListener("keydown",x),()=>document.removeEventListener("keydown",x)},[p]);let b=()=>{i(true);};return useEffect(()=>{p&&h();},[p,h]),jsx(Fragment$1,{children:jsxs(m,{as:`--date-picker ${a?`--${a}`:""} rel flex aic ${S}`,"data-value":g?g.toISOString():"",children:[e?typeof e=="string"?jsx(ee,{as:"mr:10 c:#666",name:e}):e:jsx(te,{as:"--date-picker-icon flex aic jcc",children:O.calendar}),jsx("input",{ref:R,value:g?format(g,"EEE, MMM d YYY hh:mm a"):o||"",className:`--input ${a?`--${a}`:""} flex`.trim(),style:y,onFocus:b,onInput:C,autoComplete:"new-password",onKeyDown:x=>{x.key=="Enter"&&l?.(x.currentTarget.value);},...I}),jsx(m,{"aria-hidden":!p,ref:P,fx:{from:{y:5,opacity:0},to:{y:0,opacity:1},when:p,duration:.05},as:`--date-picker-chooser flex aic ${a?`--${a}`:""}`,children:jsx(No,{defaultValue:g,onChange:x=>{T(x),i(false);}})})]})})});os.displayName="Zuz.DatePicker";var om=os;var rs=forwardRef((t,n)=>{let{icon:e,variant:r,position:o}=t;return jsx($,{className:`--fab fixed --${r||U.Large} --${o||"bottomright"}`,children:e||O.plus})});rs.displayName="Zuz.Fab";var am=rs;var ns=t=>{let{names:n,strength:e}=t,r={[Tt.Gooey]:o=>jsxs("filter",{id:"gooey",children:[jsx("feGaussianBlur",{in:"SourceGraphic",stdDeviation:o||10,result:"blur"}),jsx("feColorMatrix",{in:"blur",mode:"matrix",values:"1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 18 -7",result:"goo"}),jsx("feBlend",{in:"SourceGraphic",in2:"goo"})]},`filter-${Tt.Gooey}`)};return useEffect(()=>{},[n]),jsx("svg",{xmlns:"http://www.w3.org/2000/svg",version:"1.1",children:jsx("defs",{children:(n||[Tt.Gooey]).map(o=>r[o](e))})})};ns.displayName="Zuz.Filters";var cm=ns;var Oe=null,fe=null,as=forwardRef((t,n)=>{let{title:e,message:r,transition:o,curve:s,speed:a,type:u,actionPosition:f,spinner:l,loadingMessage:c,onShow:p,onHide:i,...g}=t,{className:T,style:y,rest:S}=B(g),[I,R]=useState(e||""),[P,h]=useState(r||""),[C,b]=useState(null),[x,N]=useState(u||be.Default),D=useMemo(()=>uuid(12),[]),[k,A]=useState(false),L=useRef(null),H=useRef(null),[z,W]=useState(false),[d,E]=useState(true),_=useRef(null),G=P;useImperativeHandle(n,()=>({setLoading(K){W(K);},showDialog(K,Q,J,j){Oe&&(clearTimeout(Oe),fe&&clearTimeout(fe),L.current.classList.remove("--wobble"),setTimeout(()=>L.current.classList.add("--wobble"),50),fe=setTimeout(()=>{L.current.classList.remove("--wobble"),fe=null;},500)),N(be.Dialog),Q&&h(Q),K&&R(K),J&&b(J.reduce((de,oe)=>(de.push({...oe,key:oe.key||uuid(12)}),de),[])),A(true),setTimeout(()=>j?j():()=>{},1e3);},dialog(K,Q,J,j){Oe&&(clearTimeout(Oe),fe&&clearTimeout(fe),L.current.classList.remove("--wobble"),setTimeout(()=>L.current.classList.add("--wobble"),50),fe=setTimeout(()=>{L.current.classList.remove("--wobble"),fe=null;},500)),N(be.Dialog),h(Q),R(K),J&&b(J.reduce((de,oe)=>(de.push({...oe,key:oe.key||uuid(12)}),de),[])),A(true),setTimeout(()=>j?j():()=>{},1e3);},error(K,Q){this.show(K,Q,be.Error);},warn(K,Q){this.show(K,Q,be.Warn);},success(K,Q){this.show(K,Q,be.Success);},show(K,Q,J){Oe&&(clearTimeout(Oe),fe&&clearTimeout(fe),H.current=L.current.style.transform,L.current.style.transform="",L.current.classList.remove("--wobble"),setTimeout(()=>{L.current.classList.add("--wobble"),L.current.style.transform=`${H.current} scale(.9)`.trim();},50),fe=setTimeout(()=>{L.current.classList.remove("--wobble"),L.current.style.transform=H.current||"",fe=null;},500)),Oe=setTimeout(()=>{A(false),Oe=null,fe=null;},(Q||4)*1e3),N(J||be.Default),h(K),A(true),p?.();},hide(){A(false),i?.();}}));let F=useMemo(()=>{let K={when:k,duration:a||.3,delay:.1};if(x==be.Dialog){if(o){let{from:Q,to:J}=at(o,20);return {from:Q,to:J,curve:s||q.EaseInOut,...K}}return {from:{scale:0,x:"-50%",y:"-50%",opacity:0},to:{scale:1,x:"-50%",y:"-50%",opacity:1},curve:q.Spring,...K}}else return {from:{scale:0,x:"-50%",y:"-10vh",opacity:0},to:{scale:1,x:"-50%",y:0,opacity:1},curve:q.Spring,...K}},[k,x]);return useEffect(()=>{_.current&&clearTimeout(_.current),k?E(true):_.current=setTimeout(()=>E(false),1e3);},[k]),x==be.Dialog?jsxs(Fragment$1,{children:[jsx(Ve,{when:k}),jsxs(m,{className:`--sheet --sheet-${x.toLowerCase()} ${k?"is-visible":""} ${T} fixed`.trim(),style:y,fx:F,...S,ref:L,children:[jsx(Te,{when:z,spinner:l,message:c}),jsxs(m,{className:"--head flex aic rel",children:[jsx(m,{className:`--${I?"title":"dot"} flex aic rel`,children:I||""}),jsx($,{onClick:K=>A(false),className:"--closer abs",children:"\xD7"})]}),jsx(m,{className:`--body flex aic rel ${C?"":"--no-action"}`.trim(),children:d?G:null}),C&&jsx(m,{className:`--footer flex aic rel ${f?f==Jt.Center?"jcc":"":"jce"}`.trim(),children:C.map((K,Q)=>jsx($,{onClick:J=>K.handler?K.handler():K.onClick?K.onClick():console.log("onClick Handler missing"),className:"--action",children:K.label},`sheet-${D}-action-${K.key}`))})]})]}):jsx(m,{className:`--sheet --sheet-${x.toLowerCase()} ${T} abs`.trim(),style:y,...S,fx:F,ref:L,children:k?P:null})}),bt=t=>typeof t=="object"&&t!=null&&"setLoading"in t&&"success"in t&&"error"in t;as.displayName="Zuz.Sheet";var dm=as;var is=({ref:t,...n})=>{let{name:e,cover:r,spinner:o,errors:s,action:a,children:u,withData:f,beforeSubmit:l,onSubmit:c,onError:p,onSuccess:i,resetOnSuccess:g,...T}=n,{className:y,style:S,rest:I}=B(T),[R,P]=useState(false),h=useRef(null),C=useRef(null),b=useRef(null),x=wo(),N=useCallback(d=>h.current?h.current.querySelectorAll(d):[],[h.current]),D=d=>({name:d.name||d.getAttribute("name")||d.getAttribute("data-name"),required:d.required?true:d.getAttribute("data-required")?d.getAttribute("data-required")=="true":false,with:d.with||d.getAttribute("with")}),k=d=>{let E=[];return d.querySelectorAll(".--input").forEach(_=>{E.push(_.value);}),E.join("")},A=useCallback(d=>{let{required:_$1}=D(d);if(_$1){if(d.type=="checkbox"&&d.checked==false)return false;if(d.classList.contains("--otp")){let F=k(d);if(F==""||F.length<parseInt(d.getAttribute("data-size")))return false}if(d.classList.contains("--select")&&d.querySelector("button.--selected").dataset.value=="-1"||d.value=="")return false}if(d.getAttribute("with")){let F=d.getAttribute("with");switch(F.includes("@")&&(F=F.split("@")[0],F=="match"&&(F=Be.MatchField)),F.toUpperCase()){case Be.IPV4:return _(d.value).isIPv4();case Be.IPV6:return _(d.value).isIPv6();case Be.Email:return _(d.value).isEmail();case Be.Uri:try{return new URL(d.value),!0}catch{return false}case Be.Password:return console.log("Add FORMVALIDATION.Password"),false;case Be.MatchField:let[K,Q,J]=d.getAttribute("with").split("@"),j=document.querySelector(`[name=${Q.trim()}]`);if(!j)return false;switch(J||"direct-match"){case "if-not-empty":if(j&&!_(j.value).isEmpty()&&j.value!=d.value)return false;break;case "direct-match":if(j&&j.classList.contains("--otp")&&d.classList.contains("--otp")&&k(j)!=k(d))return false;if(j&&j.value!=d.value)return false;break}break;default:return true}}return true},[h.current]),L=useCallback(()=>{let d={},E={},_=null,G=null;if(Array.from(N("[name]")).forEach(F=>{let{name:K,required:Q,with:J}=D(F),j=true;(Q||J)&&(j=A(F)),d[K]={valid:j,value:F.type=="checkbox"?F.checked==true?F.value:false:F.classList.contains("--otp")?k(F):F.classList.contains("--select")?F.querySelector("button.--selected").dataset.value:F.value},E[K]=F.type=="checkbox"?F.checked==true:F.classList.contains("--otp")?k(F):F.classList.contains("--select")?F.querySelector("button.--selected").dataset.value:F.value,j?F.classList.remove("input-with-error"):(_==null&&s&&(_=F,G=s[K]),F.classList.add("input-with-error"));}),_){let F=_;if(F.classList.contains("--otp"))for(let K of Array.from(F.querySelectorAll(".--input"))){let Q=K;if(Q.value==""){Q.focus();break}}else F.focus();}return {error:_!=null,errorMsg:G||"Fix errors to continue...",data:d,payload:E}},[h.current]),H=useCallback(()=>{let{error:d,errorMsg:E,payload:_}=L();d?x.error(E):a?startTransition(async()=>{l&&l(_),bt(r)?r.setLoading(true):P(true),x.clearAll(),withPost(a,{..._,...f||{}}).then(G=>{let F=G;bt(r)?r.setLoading(false):P(false),g&&Array.from(N("[name]")).forEach(K=>{K instanceof HTMLInputElement&&(K.value="");}),i?i(F):(x.clearAll(),x.success(F.message||"Redirecting..."));}).catch(G=>{bt(r)?r.setLoading(false):P(false),p?p(G):x.error(G.message||"We cannot process your request at this time.");});}):c&&c(_);},[a,C.current,h.current]),z=useCallback(()=>{let d=N("[type=submit]");!d||d.length==0?console.warn("You should add at least 1 button with type=`SUBMIT`"):d.forEach(E=>{E.addEventListener("click",H);});},[h.current]),W=useMemo(()=>addPropsToChildren(u,d=>d.props.type=="submit",d=>({ref:b})),[u]);return useImperativeHandle(t,()=>({setLoading(d){if(d){C.current?.hide();try{x.clearAll();}catch{}}P(d);},showError(d){typeof d=="string"?x.error(d):C.current.error(d,4);},hideError(){C.current.hide();try{x.clearAll();}catch{}},init(){z();},submit(){H();}})),useEffect(z,[]),jsxs(m,{ref:h,style:S,className:`--form flex rel ${y} ${e?`--form-${e.replace(/\s+/g,"-")}`:""}`,propsToRemove:["withData","action","onSubmit","onSuccess","onError"],children:[!bt(r)&&jsx(Te,{message:r?r.message||void 0:"working",spinner:o,color:r&&"color"in r?r.color:"#ffffff",when:R}),W]})};is.displayName="Zuz.Form";var Cm=is;var ls=t=>{let {ref:n,cols:e,rows:r,gap:o,gapX:s,gapY:a,align:u,justify:f,inline:l,flow:c,autoCols:p,autoRows:i,template:g,...T}=t;useRef(null);let {className:S,style:I,rest:R}=B(T),P=C=>typeof C=="number"?`repeat(${C}, 1fr)`:C,h={display:l?"inline-grid":"grid",gridTemplateColumns:P(e),gridTemplateRows:P(r),gap:o,columnGap:s,rowGap:a,alignItems:u,justifyContent:f==="between"?"space-between":f==="around"?"space-around":f,gridAutoFlow:c,gridAutoColumns:p,gridAutoRows:i,gridTemplateAreas:g,...I};return jsx(m,{ref:n,as:`--grid ${S}`.trim(),style:h,...R})};ls.displayName="Zuz.Grid";var Im=ls;var cs=t=>typeof t=="string"&&t.includes("+"),ms={command:"\u2318",shift:"\u21E7",ctrl:"\u2303",option:"\u2325",enter:"\u21B5",delete:"\u232B",escape:"\u238B",tab:"\u21E5",capslock:"\u21EA",up:"\u2191",right:"\u2192",down:"\u2193",left:"\u2190",pageup:"\u21DE",pagedown:"\u21DF",home:"\u2196",end:"\u2198",help:"?",space:"\u2423",fn:"Fn",win:"\u2318",alt:"\u2325"},ps={command:"Command",shift:"Shift",ctrl:"Control",option:"Option",enter:"Enter",delete:"Delete",escape:"Escape",tab:"Tab",capslock:"Caps Lock",up:"Up",right:"Right",down:"Down",left:"Left",pageup:"Page Up",pagedown:"Page Down",home:"Home",end:"End",help:"Help",space:"Space",fn:"Fn",win:"Win",alt:"Alt"};var fs=forwardRef(({children:t,keys:n,as:e,className:r,variant:o},s)=>{let{variant:a}=X(true),u=useMemo(()=>{if(cs(n)){let f=null;return {keys:String(n).split("+").reduce((c,p,i,g)=>(g[i+1]?c.push(p):f=p.toUpperCase(),c),[]),children:f}}return {keys:n,children:String(t).toUpperCase()}},[n]);return jsxs(m,{as:`--keyboard-keys --${o||a||U.Small} flex aic ${e} ${r}`.trim(),children:[(Array.isArray(u.keys)?u.keys:[u.keys]).map(f=>jsx("abbr",{title:ps[f],children:ms[f]},f)),jsx(te,{children:u?.children??t})]})});fs.displayName="Zuz.KeyboardKeys";var Ko=fs;var hs=createContext(null),Je=()=>{let t=useContext(hs);if(!t)throw new Error("MediaPlayer sub-components must be used within <MediaPlayer />");return t},Dm=({ref:t,icons:n,children:e,...r})=>{let{playlist:o=[],mode:s="audio",defaultArtist:a="Artist",defaultTitle:u="No Track",defaultCover:f,onTrackChange:l,...c}=r,{className:p,style:i,rest:g}=B(c),T=useMediaPlayer(o,o[0]??void 0),y=useMemo(()=>({play:O.play,pause:O.pause,prev:O.prev,next:O.next,volumeHigh:O.volumeHigh,volumeMute:O.volumeMute,...n}),[n]),S=useMemo(()=>({...T,mode:s,icons:y}),[T,y]);return jsx(hs.Provider,{value:S,children:jsx(m,{className:`--zuz-media-player ${p}`,style:i,children:e})})},ys=Dm;var xs=t=>{if(!t||isNaN(t))return "0:00";let n=Math.floor(t/60),e=Math.floor(t%60);return `${n}:${e.toString().padStart(2,"0")}`},Zt=t=>typeof t=="string"?jsx(ee,{name:t}):t,bs=()=>{let{mediaRef:t,state:n,controls:e,mode:r}=Je();return jsxs(m,{as:`--mediaplayer-stage rel --mode-${r}`,children:[r==="video"?jsx("video",{ref:t,className:"fill",onClick:e.togglePlay}):jsx("audio",{ref:t}),n.isLoading&&jsx(m,{as:"abs fill aic jcc --mediaplayer-spinner",children:jsx(ve,{})})]})},vs=()=>{let{state:t,defaultArtist:n,defaultTitle:e,defaultCover:r}=Je();return jsxs(m,{as:"--track-info flex aic",children:[jsx(Fe,{src:t.currentItem?.cover||r||"",as:"--track-cover"}),jsxs(m,{as:"flex cols",children:[jsx(m,{as:"--track-title",children:t.currentItem?.title||e||"Choose Track"}),jsx(m,{as:"--track-artist",children:t.currentItem?.artist||n||"..."})]})]})},ws=()=>{let{state:t,controls:n,icons:e}=Je();return jsxs(m,{as:"--mediaplayer-controls flex aic",children:[jsx($,{onClick:n.prev,as:"--prev",children:Zt(e?.prev??O.prev)}),jsx($,{onClick:n.togglePlay,as:"--play-pause",children:Zt(t.isPlaying?e?.pause??O.pause:e?.play??O.play)}),jsx($,{onClick:n.next,as:"--next",children:Zt(e?.next??O.next)})]})},Ss=()=>{let{state:t,controls:n,mediaRef:e}=Je(),r=t.progress*(t.duration||0);return jsxs(m,{as:"--track-progress flex aic",children:[jsx(m,{as:"--track-current-duration",children:xs(r)}),jsx(Xe,{value:t.progress,onClick:o=>{let s=o.currentTarget.getBoundingClientRect(),a=(o.clientX-s.left)/s.width;n.seek(a);}}),jsx(m,{as:"--track-total-duration",children:xs(t.duration)})]})},Cs=()=>{let{state:t,controls:n,icons:e}=Je();return jsxs(m,{as:"--volume-control flex aic gap:8 w:120",children:[jsx($,{onClick:()=>n.setIsMuted(),children:Zt(t.isMuted?e?.volumeMute??O.volumeMute:e?.volumeHigh??O.volumeHigh)}),jsx(Xe,{value:t.volume,className:"h:3 flex:1",onClick:r=>{let o=r.currentTarget.getBoundingClientRect();n.setVolume((r.clientX-o.left)/o.width);}})]})};var Hm=({ref:t,...n})=>jsx(ys,{...n,ref:t}),Vm=Object.assign(Hm,{Stage:bs,TrackInfo:vs,Controls:ws,Progress:Ss,Volume:Cs}),Am=Vm;var Ps=forwardRef((t,n)=>{let e=useNetworkStatus(),{onlineMessage:r,offlineMessage:o,variant:s}=t;return jsxs(m,{fx:{from:{x:"-50%",y:200,opacity:0},to:{x:"-50%",y:0,opacity:1},when:e==false,curve:q.Spring,duration:.5,delay:2},className:`--network-manager --${e==true?"online":"offline"} --${s||U.Small} fixed flex`,children:[jsx(m,{className:"--ico",children:e?O[xe.Success]:O[xe.Error]}),jsx(V,{as:"--message",children:e?r||"internet connection restored :)":o||"no internet connection"})]})});Ps.displayName="Zuz.NetWorkManager";var Fm=Ps;var Is=forwardRef((t,n)=>{let{strenthMeter:e,onChange:r,...o}=t;"type"in o&&delete o.type;let{style:s,className:a,rest:u}=B(o),[f,l]=useState(false),[c,p]=useState(""),i=useMemo(()=>checkPasswordStrength(c),[c]),g=useDebounce(T=>{e&&p(T.target.value),r&&r(T);},100);return useEffect(()=>{},[]),jsxs(m,{as:"w:100% flex cols",children:[jsxs(m,{style:s,className:"--password flex aic rel",children:[jsx(ne,{ref:n,type:f?"text":"password",className:a,onChange:g,...u}),jsx($,{tabIndex:-1,onClick:()=>l(T=>!T),className:"--toggle flex aic jcc abs",children:f?O.eye:O.eyeSlash})]}),e&&jsxs(m,{as:`flex aic --password-meter --pb-score-${i.score}`,style:s,children:[jsxs(m,{as:"--password-bars flex aic",children:[jsx(m,{as:`--pbar ${i.score>=1?"--pb-on":""}`.trim()}),jsx(m,{as:`--pbar ${i.score>=2?"--pb-on":""}`.trim()}),jsx(m,{as:`--pbar ${i.score>=3?"--pb-on":""}`.trim()}),jsx(m,{as:`--pbar ${i.score>=4?"--pb-on":""}`.trim()}),jsx(m,{as:`--pbar ${i.score>=5?"--pb-on":""}`.trim()})]}),jsx(V,{as:"--password-meter-label","aria-hidden":true,children:i.result})]})]})});Is.displayName="Zuz.Password";var Xm=Is;var Bs=forwardRef((t,n)=>{let{size:e,length:r,mask:o,...s}=t,a=useRef([]),u="pinput",f=false,l={};"with"in s&&(l={with:s.with},delete s.with),"type"in s&&delete s.type,"name"in s&&(u=s.name,delete s.name),"required"in s&&(f=true,delete s.required);let{style:c}=B(s),p=i=>{let g=i.currentTarget,T=a.current[parseInt(g.dataset.index)+1],y=a.current[parseInt(g.dataset.index)-1];g.value.length===1&&T?T.focus():g.value.length===0&&y&&y.focus();};return useEffect(()=>{a.current=a.current.slice(0,e||r);},[e||r]),jsx(m,{name:u,style:c,className:"--otp flex aic rel","data-required":f,"data-size":e||r||4,...l,children:Array(e||r||4).fill(1).map((i,g)=>jsx(ne,{autoComplete:"new-password","data-index":g,ref:T=>{a.current[g]=T;},numeric:true,onChange:p,maxLength:1,placeholder:o?"\xB7":"0",type:o?"password":"text",...s},`pin-${g}`))})});Bs.displayName="Zuz.PinInput";var jm=Bs;var Es=forwardRef((t,n)=>{let{children:e,className:r,name:o,required:s,type:a,value:u,variant:f,checked:l,onSwitch:c,...p}=t,[i,g]=useState(l||false),{variant:T}=X(true),y=useRef(null);return jsxs(gt,{className:`${r} --${(a||eo.Default).toLowerCase()} --radio${!a||a==eo.Default?"":"card"} --${f||T||U.Small} flex aic rel`.trim(),...p,children:[jsx(ne,{ref:y,defaultChecked:i,value:u||"rd",type:"radio",className:"abs",name:o,required:s||false,onChange:S=>{c&&c(S.target.checked,u||"cb"),g(S.target.checked);}}),jsx(m,{className:"--dot rel",children:jsx(m,{className:"--rod abs abc"})}),jsx(m,{className:"--value",children:e})]})});Es.displayName="Zuz.Radio";var rp=Es;var Ls=forwardRef((t,n)=>{let{fx:e,withStyle:r,as:o,reverse:s=false,searchIcon:a=O.search,hideSearchIcon:u=false,clearIcon:f=O.close,hideClearIcon:l=false,onChange:c,onClear:p,...i}=t,{style:g,className:T}=B({as:t.as}),[y,S]=useState(""),{variant:I}=X(true),R=useRef(null);"type"in t&&delete t.type;let P=C=>{S(C.target.value),c?.(C.target.value);},h=C=>{y.trim()!==""&&(S(""),c?.(""),R.current&&(R.current.value="",t.onConfirm?.("")));};return useImperativeHandle(n,()=>({focus:()=>R.current?.focus(),value:()=>R.current?.value})),useEffect(()=>{},[]),jsxs(m,{style:g,className:`--search ${s?"--search-rev":""} --${t.variant||I||U.Medium} flex aic ${typeof t.as=="string"&&t.as.includes("abs")?"":"rel"} ${T}`.trim(),children:[jsx(ne,{ref:R,onChange:P,...i}),t.shortcut&&jsx(Ko,{keys:t.shortcut,as:"abs"}),jsx($,{tabIndex:-1,onClick:C=>h(),className:"--send flex aic jcc",variant:t.variant||U.Medium,children:y!==""?!l&&(typeof f=="string"?jsx(ee,{name:f,as:"--search-action"}):f):!u&&(typeof a=="string"?jsx(ee,{name:a,as:"--search-action"}):a)})]})});Ls.displayName="Zuz.Search";var mp=Ls;var ks=({value:t,updateValue:n,o:e})=>jsxs($,{onClick:r=>n(e),as:"--select-option-item",className:t&&(typeof e=="string"?e:e.value)==(typeof t=="string"?t:t.value)?"selected":"",children:[e.icon&&jsx(ee,{name:e.icon,as:`--select-option-icon --icon-${e.value}`,color:e.iconColor||void 0}),jsx(V,{suppressHydrationWarning:true,children:typeof e=="string"?e:e.label})]});ks.displayName="Option";var Os=ks;var Hs=({ref:t,...n})=>{let{selected:e,options:r,label:o,name:s,variant:a,search:u,searchPlaceholder:f,maxHeight:l,arrowDownIcon:c=O.arrowDown,arrowUpIcon:p=O.arrowUp,expanded:i,onChange:g,...T}=n,[y,S]=useState(e?typeof e=="string"?r.find(d=>d.value===e):e:r[0]),[I,R]=useState(false),[P,h]=useState(null),C=useRef(null),b=useRef(null),x=useRef(null),N=useId(),D=useMemo(()=>s||N,[]),{reposition:k}=pt(x,{direction:nt.Bottom,offset:2}),{variant:A}=X(true),{className:L,style:H,rest:z}=B(T),W=d=>{S(d),R(false),g&&g(d);};return useImperativeHandle(t,()=>({setSelected:d=>{if(typeof d=="string"){let E=r.find(_=>_.value===d);E&&S(E);}else S(d);},getValue:()=>y||null})),useEffect(()=>{if(!I)return;let d=()=>{k();};return window.addEventListener("scroll",d,true),window.addEventListener("resize",k),()=>{window.removeEventListener("scroll",k,true),window.removeEventListener("resize",k);}},[I,k]),useEffect(()=>{if(!I){b.current&&(b.current.value=""),h(null);return}b.current?.focus(),k();let d=_=>{x.current&&!x.current.contains(_.target)&&R(false);},E=setTimeout(()=>{document.addEventListener("click",d);},0);return ()=>{clearTimeout(E),document.removeEventListener("click",d);}},[I,k]),jsxs(m,{className:`--select ${i==true?"--expanded":""} --${a||A} ${s?`--${s}`:""} rel`.trim(),name:D,children:[jsxs($,{ref:C,"data-value":y?typeof y=="string"?y:y.value:y||"-1",className:`--selected flex aic rel ${L}`.trim(),withLabel:false,style:H,onClick:d=>{d.stopPropagation(),R(E=>!E);},...z,children:[jsx(V,{className:"--label",children:y?typeof y=="string"?y:y.label:o||"Choose"}),jsx(m,{className:"--svg-arrow rel flex aic jcc",children:I?typeof p=="string"?jsx(ee,{name:p,as:"--search-action"}):p:typeof c=="string"?jsx(ee,{name:c,as:"--search-action"}):c})]}),jsxs(m,{id:D,className:"--options-list -fx flex cols abs zIndex:$max-z-index","aria-hidden":!I,style:{maxHeight:l||"auto"},ref:x,fx:{from:{y:5,opacity:0},to:{y:0,opacity:1},when:I,duration:.05},children:[u&&jsx(m,{as:"--select-search --sticky",children:jsx(ne,{ref:b,onChange:d=>{h(d.target.value==""?null:d.target.value);},className:"--search-input",placeholder:f||"Search..."})}),(P==null?r:r.filter(d=>d.label.toLowerCase().includes(P.toLowerCase())||d.value.toLowerCase().includes(P.toLowerCase()))).map(d=>jsx(Os,{updateValue:W,value:y,o:d},`option-${(typeof d=="string"?d:d.label).replace(/\s+/g,"-")}-${typeof d=="string"?d:d.value}`))]})]})};Hs.displayName="Zuz.Select";var hp=Hs;var Vs=forwardRef((t,n)=>jsx(ht,{type:Ne.Switch,...t,ref:n}));Vs.displayName="Zuz.Switch";var xp=Vs;var $s=t=>{let{idx:n,id:e,as:r,weight:o,style:s,value:a,render:u,resize:f,sortBy:l,sortable:c,onSort:p}=t,[i,g]=useState(0),T=()=>{c&&(p?.(String(e),i==1?-1:1),g(y=>y==1?-1:1));};return jsxs(m,{style:{flex:o||1,...s},as:`--col flex aic ${r||""} ${c?"--sortable":""}`,onClick:T,children:[jsx(m,{children:a}),n==-1&&c&&l==e&&jsx(m,{as:"--arrow flex aib",children:i==1?O.arrowUp:O.arrowDown})]})};$s.displayName="Zuz.Column";var Gt=$s;var _s=t=>{let{index:n,pubsub:e,schema:r,data:o,ids:s,styles:a,animate:u,sortBy:f,selectable:l,tableRef:c,loading:p,rowClassName:i,onSort:g,onRowClick:T,onSelect:y,onContextMenu:S}=t,I=useDelayed(),R=useMemo(()=>({transition:Y.SlideInBottom,curve:q.EaseInOut,delay:.02*(n+1)}),[]),P=useRef(null),h=(b,x)=>{n==-1?e.emit(`ALL_ROWS_${b?"CHECKED":"UNCHECKED"}`,b):(y&&y(o,b),e.emit(`ROW_${b?"CHECKED":"UNCHECKED"}`,b,x));},C=(b,x,N)=>jsx(Gt,{idx:b,id:x,as:"--selector",pubsub:e,value:jsx(ht,{value:N,ref:P,onSwitch:h,type:Ne.Default})});return useEffect(()=>{let b=(k,A)=>{P.current?.setChecked(k,false);},x=(k,A)=>{let L=false;c?.current&&c.current.querySelectorAll(".--row").forEach(H=>{let z=H;if(!z.classList.contains("--row-head")){let W=z.querySelector(".--selector input[type=checkbox]");W&&W.checked&&!L&&(L=W.checked);}}),P.current.setChecked(L,false);},N=k=>{P.current?.setChecked(k,false),y&&y(o,k);},D=k=>{P.current?.setChecked(k,false),y&&y(o,k);};return n==-1?(e.on("ROW_CHECKED",b),e.on("ROW_UNCHECKED",x),()=>{e.off("ROW_CHECKED",b),e.off("ROW_UNCHECKED",x);}):(e.on("ALL_ROWS_CHECKED",N),e.on("ALL_ROWS_UNCHECKED",D),()=>{e.off("ALL_ROWS_CHECKED",N),e.off("ALL_ROWS_UNCHECKED",D);})},[]),jsxs(m,{onContextMenu:b=>S?S(b,o):null,onClick:b=>T?T(b,t.data):()=>{},...u?{fx:{...R,when:I}}:{},as:`--row flex aic ${T?"--row-clickable":""} ${n==-1?"--row-head":""} ${i||""}`,children:[n==-1&&r.map((b,x)=>{let{renderWhenHeader:N,render:D,value:k,...A}=b;return jsxs(Fragment,{children:[l&&x==0&&C(-1,`--selector-${b.id}`,"all"),jsx(Gt,{idx:-1,onSort:g,sortBy:f,value:k,...A,pubsub:e,style:a[b.id]})]},`--col-${b.id}`)}),p&&n>-1&&jsx(m,{as:"--col",children:jsx(V,{as:"opacity:0",children:"..."})}),!p&&n>-1&&s&&o&&r.map((b,x)=>jsxs(Fragment,{children:[l&&x==0&&C(x,`--selector-${b.id}`,b.id.toString()),s.includes(String(b.id))?jsx(Gt,{pubsub:e,idx:x,id:String(b.id),style:a[String(b.id)],value:b.render?b.render(o,n):o[String(b.id).includes(".")?String(b.id).split(".").reverse()[0]:b.id]}):null]},`--${String(b.id)}-val-${x}`))]})};_s.displayName="Zuz.Row";var Ut=_s;var Ws=(t,n)=>{let{schema:e,rows:r,rowCount:o,rowsPerPage:s,currentPage:a,pagination:u,paginationHash:f,showPaginationOnZeroPageCount:l,animateRows:c,header:p,rowClassName:i,selectableRows:g,hoverable:T,sortBy:y,loading:S,loadingRowCount:I,loadingMessage:R,spinner:P,emptyMessage:h,onSort:C,onRowClick:b,onRowSelectToggle:x,onPageChange:N,onRowContextMenu:D,...k}=t,A=useRef(null),L=useMemo(()=>e.reduce((ae,Z)=>(ae[Z.id]={flex:Z.weight||1,...Z.w&&{width:Z.w},...Z.maxW&&{maxWidth:Z.maxW},...Z.minW&&{minWidth:Z.minW},...Z.h&&{height:Z.h},...Z.maxH&&{maxHeight:Z.maxH},...Z.minH&&{minHeight:Z.minH}},ae),{}),[e]),H=useMemo(()=>Object.keys(L),[e]),z=useMemo(()=>p??true,[p]),{style:W,className:d,rest:E}=B(k),_=useRef(null),G=useMemo(()=>new PubSub,[]),F=useRef(r.map(()=>uuid(8))),[K,Q]=useState(y||null),[J,j]=useState(R||"loading"),de=useMemo(()=>!S&&r&&r.length==0,[S,r]),oe=useCallback(()=>h?typeof h=="function"?jsx(h,{}):h:jsx(V,{as:"tac s:18 mt:75",children:"No Record Found"}),[S,r]);useEffect(()=>{F.current=r.map(()=>uuid(8));},[r]);let ge=(ae,Z)=>{Q(ae),C?.(ae,Z);},we=(o||(r?r.length:0))/(s||10),Se=useMemo(()=>l||we>1?jsx(dt,{hash:f,ref:A,renderOnZeroPageCount:l,onPageChange:N,paginationStyle:"table",startPage:a,itemCount:o||(r?r.length:0),itemsPerPage:s||10}):null,[a,o]);return useImperativeHandle(n,()=>({setLoading(ae){}})),jsxs(m,{as:`--table ${T??true?"--hoverable":""} flex cols rel ${d}`,ref:_,children:[z==true&&jsx(Ut,{sortBy:K,onSort:ge,tableRef:_,pubsub:G,selectable:g,index:-1,schema:e,loading:true,styles:L}),S&&jsxs(m,{as:"center-x flex aic --table-spinner",children:[jsx(ve,{type:P||le.Simple}),J&&jsx(V,{as:"--table-loading-message",children:J})]}),S&&Array(I||5).fill({}).map((ae,Z)=>jsx(Ut,{tableRef:_,index:Z,pubsub:G,schema:e,styles:L,loading:true,animate:c,onRowClick:b},`--trow-loading-${Z}-${e[0].id}`)),!S&&r&&r.map((ae,Z)=>jsx(Ut,{tableRef:_,pubsub:G,loading:false,index:Z,schema:e,ids:H,styles:L,animate:c,data:ae,onRowClick:b,rowClassName:i,selectable:g,onSelect:x,onContextMenu:D},`--trow-${F.current[Z]||Z}-${e[0].id}`)),de&&oe(),jsx(m,{"aria-hidden":!u||!Se,...c?{fx:{transition:Y.SlideInBottom,curve:q.EaseInOut,delay:.02*(r.length+1),when:!S&&r&&u&&Se!=null}}:{},as:"--row flex aic --row-footer",children:u&&Se?Se:null})]})};Ws.displayName="Zuz.Table";var Lp=forwardRef(Ws),Mp=Lp;var Op=({ref:t,...n})=>{let{title:e,items:r}=n,[o,s]=useState(0),a=(u,f,l)=>{u.preventDefault(),s(f),document.getElementById(l)?.scrollIntoView({behavior:"smooth"});};return jsxs(m,{ref:t,as:"--table-of-contents rel flex cols",children:[jsx(V,{as:"--toc-title",children:e}),jsx(_e,{items:r.map((u,f)=>jsx("a",{className:o==f?"--toc-active":"",style:{anchorName:o===f?"--toc-active":"none",color:o==f?"var(--table-of-contents-color-active)":"var(--table-of-contents-color)"},onClick:l=>a(l,f,u.tag),href:`#${u.tag}`,children:u.label}))})]})},Dp=Op;var Gs=({isActive:t,transitionType:n,speed:e,width:r,render:o,content:s,onHeightChange:a})=>{let u=useRef(null),f=useResizeObserver(u);useEffect(()=>{t&&f.height>0&&a(f.height);},[t,f.height]);let l=useMemo(()=>{let c={flexShrink:0,height:"fit-content"};return n==="fade"?{...c,gridArea:"1 / 1 / 2 / 2",opacity:t?1:0,visibility:t?"visible":"hidden",transition:`opacity ${e}s ease-in-out`,zIndex:t?1:0}:n==="scale"?{...c,gridArea:"1 / 1 / 2 / 2",opacity:t?1:0,transform:`scale(${t?1:.95})`,transition:`all ${e}s cubic-bezier(0.34, 1.56, 0.64, 1)`,zIndex:t?1:0}:c},[t,n,r,e]);return jsx(m,{ref:u,style:{...l},className:"--content",children:o||t?s:null})};Gs.displayName="Zuz.TabBody";var Us=Gs;var Ys=({ref:t,...n})=>{let{tabs:e,speed:r=.3,prerender:o=true,variant:s,tabStyle:a="fixed",onChange:u,transitionType:f="slide",...l}=n,[c,p]=useState(0),i=useRef(null),g=useResizeObserver(i),T=useMemo(()=>uuid(8),[]),[y,S]=useState("auto"),I=useMemo(()=>g.width>0,[g.width]);useImperativeHandle(t,()=>({setTab:x=>p(x)}));let R=useMemo(()=>e.map(x=>({...x,key:x.key||uuid(8)})),[e]),{style:P,className:h,rest:C}=B({as:`flex cols w-full no-overflow ${l.as||""}`,...l}),b=()=>{if(!I)return {opacity:0};switch(f){case "fade":return {display:"grid",gridTemplateColumns:"1fr"};case "scale":return {display:"grid",gridTemplateColumns:"1fr"};default:return {display:"flex",transform:`translate3d(-${c*g.width}px, 0, 0)`,transition:`transform ${r}s cubic-bezier(0.4, 0, 0.2, 1)`}}};return jsxs(m,{ref:i,style:P,className:`--tabview --${a} flex cols ${h}`,children:[jsx(yt,{as:"--tabview-head",onSwitch:x=>{p(x.index);let N=R.find(D=>D.tag==x.tag);N&&N.onSelect&&(N.onSelect(N,x.index),u?.(N,x.index));},selected:c,items:R.reduce((x,N,D)=>(x.push({icon:N.icon,index:D,label:N.label,tag:N.tag}),x),[])}),jsx(m,{className:"--tabview-body",as:"rel no-overflow w-full",style:{height:y,transition:I?`height ${r}s cubic-bezier(0.4, 0, 0.2, 1)`:"none",opacity:I?1:0},children:jsx(m,{className:"--track",style:{...b()},children:R.map((x,N)=>jsx(Us,{isActive:N===c,transitionType:f,speed:r,width:g.width,render:o||N===c,onHeightChange:D=>N===c&&S(D),content:x.body},`tab-body-${x.key||N}-${T}`))})})]})};Ys.displayName="Zuz.TabView";var Wp=Ys;var Xp=({ref:t,commands:n,onCommand:e,welcomeMessage:r="Welcome to Zuz Terminal v1.0.0",prompt:o="zuz ~ ",variant:s,...a})=>{let[u,f]=useState([{type:"output",content:r}]),[l,c]=useState(""),p=useRef(null),i=useRef(null),{variant:g}=X(true);useEffect(()=>{p.current&&(p.current.scrollTop=p.current.scrollHeight);},[u]);let T=h=>{let C=typeof h=="string"?{type:"output",content:h}:h;f(b=>{let x=[...b,C];return x.length>1e3?x.slice(-1e3):x});},y=()=>f([]);useImperativeHandle(t,()=>({write:T,clear:y}));let S=async h=>{let[C,...b]=h.split(" "),x=C.toLowerCase();return n&&n[x]?await n[x](b):e?await e(h):`command not found: ${C}`},I=h=>{let C=/\u001b\[(\d+)m/g,b=[],x={31:"#ff5f56",32:"#27c93f",33:"#ffbd2e",34:"#007aff",35:"#ff79c6",36:"#8be9fd",39:"#d4d4d4"},N=0,D="#d4d4d4",k=false,A;for(;(A=C.exec(h))!==null;){let H=h.slice(N,A.index);H&&b.push({text:H,color:D,bold:k});let z=A[1];z==="0"?(D="#d4d4d4",k=false):z==="1"?k=true:x[z]&&(D=x[z]),N=C.lastIndex;}let L=h.slice(N);return L&&b.push({text:L,color:D,bold:k}),b},R=(h,C)=>h.includes("\x1B")?I(h).map((b,x)=>jsx(te,{style:{color:b.color||"#d4d4d4",fontWeight:b.bold?"bold":"normal"},children:b.text},`--terminal-msg-${x}-${b.text.replace(/\S+/g,"-")}`)):jsx(te,{style:{color:C==="error"?"#ff5f56":C==="command"?"#00ff00":"#d4d4d4"},children:h}),P=async h=>{if(h.key==="Enter"&&l.trim()){let C=l.trim(),b=[...u,{type:"command",content:`${o}${C}`}];c(""),f(b);let x=await S(C);f(N=>[...N,{type:"output",content:x}]);}};return jsxs(m,{as:`--zuz-terminal --${s||g||U.Medium} flex cols ${a.className}`,onClick:()=>i.current?.focus(),children:[jsx(m,{ref:p,className:"--terminal-log",children:u.map((h,C)=>jsx(m,{children:jsx(V,{children:R(h.content,h.type)})},C))}),jsxs(m,{as:"flex aic --terminal-input",children:[jsx(V,{as:"--terminal-prompt",children:o}),jsx(ne,{ref:i,className:"--zuz-term-input",autoFocus:true,value:l,variant:s||g||U.Medium,onChange:h=>c(h.target.value),onKeyDown:P})]})]})},Yp=Xp;var Qp=({meta:t})=>jsxs($,{as:"flex aic --command-item",children:[t.icon&&jsx(ee,{name:t.icon,as:"--command-icon"}),jsx(V,{children:t.label})]}),Jp=({position:t,onSelect:n,commands:e,visible:r})=>jsx(m,{"aria-hidden":!r,fx:{transition:Y.SlideInBottom,duration:.1,when:r},className:"--command-box abs grid",style:{...t},children:e.map(o=>jsx(Qp,{meta:o},`cmd-${o.label.replace(/\s+/,"-")}`))}),ea=Jp;var ra=forwardRef((t,n)=>{let{autoResize:e,maxHeight:r,variant:o,resize:s="none",command:a,commands:u,onInput:f,cmd:l,renderDropdown:c,value:p,defaultValue:i,...g}=t,T=useRef(null),y=useRef(null),{variant:S}=X(true),{style:I,className:R,rest:P}=B(g),{showDropdown:h,dropdownPosition:C,handleKeyDown:b,handleInput:x,handleCommandSelect:N}=useCommandActions({command:a,commands:u,cmd:l,ref:T}),D=useCallback(()=>{let A=T.current;!A||!e||(y.current&&cancelAnimationFrame(y.current),y.current=requestAnimationFrame(()=>{A.style.height="auto";let L=A.scrollHeight;if(r){let H=parseInt(r.toString(),10);isNaN(H)||(L=Math.min(L,H));}A.style.height=`${L}px`,A.style.overflowY=r&&L>=parseInt(r.toString(),10)?"auto":"hidden";}));},[e,r]),k=A=>{f?.(A),x(A),D();};return useEffect(()=>{D();},[p,i,D]),useEffect(()=>{e&&T.current&&D();},[e,D]),useEffect(()=>()=>{y.current&&cancelAnimationFrame(y.current);},[]),jsxs(m,{as:"rel",children:[jsx("textarea",{className:`--input --textarea --${o||S||U.Medium} flex ${R}`.trim(),style:{...I,resize:s,height:e?"auto":I?.height,overflow:"hidden",transition:e?"none":void 0},onKeyDown:b,onInput:k,ref:A=>{typeof n=="function"?n(A):n&&(n.current=A),T.current=A;},value:p,defaultValue:i,...P}),c?c({show:h,position:C,commands:u||[],onSelect:N}):u&&u.length>0&&jsx(ea,{visible:h,commands:u,onSelect:N,position:C})]})});ra.displayName="Zuz.TextArea";var ru=ra;var sa=forwardRef((t,n)=>{let{as:e,value:r,color:o,direction:s,...a}=t,u=useRef(null),[f,l]=useState(r||0);return useImperativeHandle(n,()=>({updateValue(c){f.toString().length!==c.toString().length&&l(c);},setValue(c){if(this.updateValue(c),u.current){let p=c.toString().split("");u.current.querySelectorAll(".--wheel-char").forEach((i,g)=>{let T=p[g];if(i instanceof HTMLElement){i.setAttribute("data-value",T);let y=i.querySelector(".--wheel-char-track");y instanceof HTMLElement&&(y.style.setProperty("--v",T),y.offsetWidth);}});}}})),useEffect(()=>{l(r||0);},[r]),jsxs(m,{className:"--text-wheel flex aic rel","aria-hidden":true,as:e,ref:u,...a,children:[(f||0).toString().split("").map((c,p)=>isNaN(parseInt(c,10))?jsx(te,{className:"--wheel-char wheel-char-symbol grid",children:c},`wheel-char-symbol-${p}`):jsx(te,{"data-value":c,className:`--wheel-char grid ${p>(f||0).toString().length-3?"--wheel-fraction":""}`.trim(),children:jsxs(te,{className:`--wheel-char-track --wheel-track-${s||"down"} grid`,style:{"--v":c},children:[jsx(te,{children:!s||s==="down"?0:9}),(!s||s==="down"?[9,8,7,6,5,4,3,2,1,0]:[0,1,2,3,4,5,6,7,8,9]).map((i,g)=>jsx(te,{children:i},`${p}--${g}`)),jsx(te,{children:!s||s==="down"?9:0})]})},`wheel-char-${p}`)),o&&jsx(m,{className:"abs fillx",style:{zIndex:1,background:`linear-gradient(0deg, ${o}, transparent, transparent, transparent, ${o})`}})]})});sa.displayName="Zuz.TextWheel";var mu=sa;var er=forwardRef((t,n)=>{let{as:e,meta:r,nodes:o,icons:s,onSelect:a,treeTag:u,selected:f,roots:l,expanded:c,...p}=t,{tag:i,label:g,icon:T,under:y,isHead:S}=r,I=useMemo(()=>l.includes(i),[l]),[R,P]=useState(c),h=()=>{localStorage.setItem(`--tn${u}-${i}`,R?"0":"1"),P(!R);};useEffect(()=>{c||I&&!localStorage.getItem(`--tn${u}-${i}`)?(localStorage.setItem(`--tn${u}-${i}`,"1"),P(true)):P(localStorage.getItem(`--tn${u}-${i}`)=="1");},[]);let C=useMemo(()=>o.filter(b=>b.under==i),[o,i]);return jsxs(m,{className:`--treenode ${I?"--is-root":""} --treenode-${i} flex cols`,children:[jsxs(m,{className:`--node --node-${i} flex aic ${f==i?" --selected":""}`,children:[jsx($,{skeleton:p.skeleton,onClick:h,className:"--node-aro-btn",disabled:C.length==0,children:s?.arrowClose&&s?.arrowOpen?jsx(ee,{skeleton:p.skeleton,className:"--node-aro-icon",name:C.length==0?s?.arrowDisabled||s?.arrowClose:R?s?.arrowOpen:s?.arrowClose}):C.length==0?O.chevronBottom:R?O.chevronBottom:O.chevronRight}),jsxs($,{className:"--node-meta flex aic",onClick:b=>a(i),children:[(s?.nodeOpen&&s?.nodeClose||I&&s?.rootOpen&&s?.rootClose)&&jsx(ee,{skeleton:p.skeleton,className:`--node-icon ${I?"--icon-root":""}`,name:T||(R?I&&s?.rootOpen||s.nodeOpen:I&&s?.rootClose||s?.nodeClose)}),jsx(V,{className:`--node-label ${I?"--node-label-root":""}`.trim(),skeleton:p.skeleton,children:g})]})]}),R&&C.length>0&&jsx(m,{className:`--sub-node tree-sub-node-${i} flex cols`,children:C.map(b=>jsx(er,{treeTag:u,selected:f,onSelect:a,icons:s,roots:l,expanded:b.expanded||false,meta:b,nodes:o},`--node-${b.tag}`))})]})});er.displayName="TreeItem";var ia=er;var ca=forwardRef((t,n)=>{let{as:e,nodes:r,onNodeSelect:o,tag:s,icons:a,roots:u,selected:f,...l}=t,[c,p]=useState(f);useImperativeHandle(n,()=>({getSelected:()=>c}),[o]);let i=g=>{p(g),o&&o(g);};return useEffect(()=>{c!=f&&p(f);},[f]),jsx(m,{className:"--treeview flex cols",children:r.filter(g=>u.includes(g.tag)).map(g=>jsx(ia,{treeTag:s?`-${s}`:"",selected:c,onSelect:T=>i(T),icons:a,meta:g,roots:u,expanded:g.expanded||false,skeleton:l.skeleton,nodes:r},`--node-${g.tag}`))})});ca.displayName="Zuz.TreeView";var xu=ca;String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"").replace(/\s+/g," ")};
13
- export{xe as ALERT,sr as AVATAR,Wi as Accordion,Qi as ActionBar,el as Alert,xl as AutoComplete,Rl as Avatar,Nl as Badge,m as Box,cc as Bubble,En as BubbleMediaType,Bn as BubbleStatus,$ as Button,Pn as CHART,Ne as CHECKBOX,Su as COLORTHEME,No as Calendar,jl as Carousel,ac as Chart,ht as CheckBox,vc as CodeBlock,Dc as ColorScheme,co as ContextMenu,$c as CookiesConsent,Te as Cover,Yc as CropShape,qc as Cropper,Jc as Crumb,Pu as DATATYPE,Ue as DIALOG,ar as DIALOG_ACTION_POSITION,ce as DRAWER_SIDE,om as DatePicker,uo as Dialog,bo as Drawer,Tt as FILTER,Be as FORMVALIDATION,Ru as FORMVALIDATION_STYLE,am as Fab,cm as Filters,Cm as Form,Im as Grid,mo as Group,ee as Icon,Fe as Image,ne as Input,Ko as KeyboardKeys,ps as KeysLabelMap,ms as KeysMap,gt as Label,io as LayersProvider,_e as List,Am as MediaPlayer,Fm as NetworkStatus,st as ORIGIN,Cu as OriginType,Ve as Overlay,nt as POSITION,Nu as PROGRESS,dt as Pagination,At as PaginationStyle,Xm as Password,jm as PinInput,re as Position,$e as ProgressBar,eo as RADIO,rp as Radio,be as SHEET,Jt as SHEET_ACTION_POSITION,wu as SKELETON,jt as SLIDER,Tu as SORT,le as SPINNER,go as ScrollView,mp as Search,hp as Select,yt as SelectTabs,dm as Sheet,Xe as Slider,Mt as SnackPosition,Kr as SnackStyle,Lt as SnackType,te as Span,ve as Spinner,Iu as Status,xp as Switch,Y as TRANSITIONS,q as TRANSITION_CURVES,Wp as TabView,Mp as Table,Dp as TableOfContents,Yp as Terminal,V as Text,mu as TextWheel,ru as Textarea,va as ThemeProvider,Wr as ToastDefaultTitle,Mt as ToastPosition,vo as ToastProvider,Kr as ToastStyle,Lt as ToastType,Ho as ToolTip,xu as TreeView,U as Variant,at as animationTransition,to as buildClassString,cr as buildWithStyles,qu as css,oo as getAnimationCurve,Xu as getAnimationTransition,fa as getZuzMap,cs as isKeyCombination,lr as setZuzMap,B as useBase,wi as useContextMenu,Ti as useDialog,Ii as useDrawer,me as useFx,Ei as useMorph,pt as usePosition,Vi as useSnack,wo as useToast};
12
+ </div>`}).join("")},[e,g]);return jsx(p,{as:`--code-block ${c}`,style:m,...f,children:jsx("pre",{ref:t,children:jsx("code",{className:`--code --lang-${r}`,dangerouslySetInnerHTML:{__html:T}})})})},wc=vc;var Vn=({onSelect:t,meta:n,selected:e,disabled:r=false})=>{let o=useRef(null),{index:s,icon:a,label:u}=n,[f,l]=useState({x:0,width:0}),c=useDelayed();return useLayoutEffect(()=>{if(c&&o.current){let{width:m,x:i}=o.current.getBoundingClientRect();l({x:i,width:m}),e&&t(s,m,i,n,true);}},[c,o.current]),useEffect(()=>{e&&t(s,f.width,f.x,n,false);},[e]),jsxs(z,{disabled:r,onClick:()=>t(s,f.width,f.x,n,false),ref:o,className:`--segment-item flex aic rel ${e?"--segment-active":""}`.trim(),children:[a?typeof a=="string"?jsx(J,{name:a,as:"--segment-icon"}):jsx(p,{as:"--segment-icon flex aic jcc",children:a}):null,u&&String(u).trim()!=""&&jsx(p,{className:"--segment-label",children:u||`Item ${s}`})]})};Vn.displayName="SelectTabItem";var An=Vn;var zn=forwardRef((t,n)=>{let{fx:e,items:r,selected:o,variant:s,disabled:a=false,onSwitch:u,...f}=t,[l,c]=useState(o||0),m=useDelayed(50),i=useRef(l),{className:g,style:T,rest:b}=B(f),S=useRef(null),I=useRef(null),{variant:R}=X(true),P=(h,C,y,x,N)=>{if((N||l!=h&&l!=-2)&&(c(h),i.current=l,queueMicrotask(()=>{m&&u?.(x);})),S.current){let D=I.current?.getBoundingClientRect();S.current.style.setProperty("--w",`${C}px`),S.current.style.setProperty("--x",`${D?y-D.left:y}px`);}};return useImperativeHandle(n,()=>({setSelected:h=>{typeof h=="number"&&h!=l&&c(h);}}),[l]),jsxs(p,{ref:I,"data-selected":l,className:`${g} --segmented --${s||R||K.Medium} flex aic rel`,style:T,...b,children:[jsx(p,{ref:S,className:`--segment-tab --${a?"disabled":"abled"} abs`}),r.map((h,C)=>jsx(An,{disabled:a,onSelect:P,selected:l==C,meta:{...h,index:C}},`segment-${h.label}-${C}`))]})});zn.displayName="Zuz.SelectTabs";var wt=zn;var Zn=forwardRef((t,n)=>{let{type:e,...r}=t,o=useDelayed(),{colorScheme:s,setColorScheme:a}=lo(),u=useCallback(()=>{a(s=="dark"?"light":s=="light"?"system":"dark");},[s]),{className:f,style:l}=B(r),c=useMemo(()=>e=="system"?[{tag:"light",index:0,label:"",icon:O.colorSchemeLight},{tag:"system",index:1,label:"",icon:O.colorSchemeSystem},{tag:"dark",index:2,label:"",icon:O.colorSchemeDark}]:[{tag:"light",index:0,label:"",icon:O.colorSchemeLight},{tag:"dark",index:2,label:"",icon:O.colorSchemeDark}],[]),m=useMemo(()=>["light","system","dark"].indexOf(s),[s]);return !o||m==-1?null:e=="system"||e=="switch"?jsx(wt,{className:`--color-scheme --${e}`,onSwitch:({tag:i})=>{a(i);},selected:m,items:c,...r}):jsx(z,{onClick:u,style:l,as:`--color-scheme-switch --${r.variant||K.Small} ${f}`.trim(),children:s=="system"?O.colorSchemeSystem:s=="light"?O.colorSchemeLight:O.colorSchemeDark})});Zn.displayName="Zuz.ColorScheme";var Hc=Zn;var Wn=forwardRef((t,n)=>{let[e,r]=useState("wait"),{title:o,message:s,acceptLabel:a,rejectLabel:u,position:f}=t,l=async c=>{r(c==1?"accepted":"rejected"),localStorage.setItem("--ccnt",String(c));};return useEffect(()=>{let c=localStorage.getItem("--ccnt");r(c?c=="1"?"accepted":"rejected":"pending");},[]),jsxs(p,{fx:{from:{x:-1e3},to:{x:0},when:e=="pending",curve:q.EaseInOut,duration:.5,delay:e=="accepted"?0:3},as:`--cookie-consent --${e} --${f||le.Left} flex cols`,children:[jsx($,{as:"--title",children:o||"This site uses cookies"}),jsx($,{as:"--message",children:s||"We and selected third parties use cookies (or similar technologies) for technical purposes, to enhance and analyze site usage, to support our marketing efforts"}),jsxs(p,{as:"--footer flex aic",children:[jsx(z,{onClick:c=>l(1),as:"--accept",children:a||"Accept All"}),jsx(z,{onClick:c=>l(0),as:"--reject",children:u||"Cancel"})]})]})});Wn.displayName="Zuz.CookiesConsent";var zc=Wn;var qn=({ref:t,...n})=>{let {title:e,position:r,margin:o=4,anchorName:s="--tooltip-anchor",children:a,show:u,variant:f,...l}=n,{style:c,className:m,rest:i}=B(l),g=r||le.Top;useRef(null);let [b,S]=useState(false);useRef(6);let R=u===true||b,h=`--anchor-${useId().replace(/:/g,"")}`,{tooltip:C}=X(true),y=useMemo(()=>{let N=false;return addPropsToChildren(a,D=>{let L=D.props.className?.includes(s);return L&&(N=true),L||!N},(D,L)=>{let A=L.props.className?.includes(s),M=D===0,H={};return (A||M)&&(H.style={...L.props.style,anchorName:h}),M&&(H.onMouseEnter=V=>{S(true),L.props.onMouseEnter?.(V);},H.onMouseLeave=V=>{S(false),L.props.onMouseLeave?.(V);}),H})},[a,s,h]),x=ce({transition:g==le.Top?G.SlideInTop:g==le.Bottom?G.SlideInBottom:g==le.Left?G.SlideInLeft:G.SlideInRight,when:R,duration:.2,offset:o+6,margin:g==le.Top||g==le.Left?-o:o,curve:C?.curve||q.EaseInOut});return useImperativeHandle(t,()=>({show:()=>S(true),hide:()=>S(false),setPosition:()=>{}})),jsxs(Fragment$1,{children:[y,jsx(p,{style:{positionAnchor:h,...x.style,...g===le.Top||g===le.Bottom?{"--fx-x":"-50%"}:{"--fx-y":"-50%"}},as:`--tooltip --visb-${R} --${f||C?.variant||K.Small} --${g} abs ${m}`.trim(),children:typeof e=="string"?jsx($,{as:"--text rel",children:e}):e})]})};qn.displayName="Zuz.ToolTip";var $o=qn;var Xn=({ref:t,...n})=>{let {type:e,value:r=0,min:o=0,max:s=1,step:a=.01,onChange:u,showGhostBar:f,showKnobOnHover:l,showToolTip:c,roundValue:m,formatValue:i,...g}=n,{className:T,style:b,rest:S}=B(g),I=useRef(a||.01).current,R=useRef(o||0).current,P=useRef(s||1).current,h=useRef(r||0).current,C=useRef(null),y=useRef(null),x=useRef(null),N=useRef(null);useRef(null);let L=useRef(null),A=useRef(null),M=useRef(null),H=useRef(null),V=(te,ne,xe)=>(te-ne)/(xe-ne)*100,W=te=>{if(y.current){let ne=parseFloat(te.currentTarget.value);Y(ne);let xe=V(ne,parseFloat(te.currentTarget.min),parseFloat(te.currentTarget.max));y.current.style.setProperty("--value",`${xe}`),y.current.setAttribute("data-value",`${ne}`),u&&u(m?+ne.toFixed(2):ne);}},[d,E]=useState(false),[_,U]=useState(0),[F,Z]=useState(0),[j,Q]=useState(false),Y=async te=>{let ne=i?i(+te):m?(+te).toFixed(2):Math.round(+te);M.current&&(M.current.textContent=String(ne));},re=te=>{if(d){let ne=te.clientX-_,xe=P-R,Pe=ne/200*xe,pe=Math.max(R,Math.min(F+Pe,P));if(pe=Math.round(pe/I)*I,Y(pe),y.current){let lt=V(pe,R,P);y.current.style.setProperty("--value",`${lt}`),y.current.setAttribute("data-value",`${pe}`),A.current&&(A.current.textContent=m?pe.toFixed(2):pe.toString()),u&&u(pe);}}},ye=()=>{E(false),document.body.style.cursor="auto";},Se=te=>(te-R)/(P-R)*100,Ce=te=>{if(!y.current)return;let ne=y.current.getBoundingClientRect(),xe=te.clientX-ne.left,it=Math.max(0,Math.min(100,xe/ne.width*100));if(c&&M.current){let Pe=C.current?+C.current.value:r;Y(Pe*100);}if(f){let Pe=Se(C.current?+C.current.value:r),pe=Math.min(Pe,it),lt=Math.abs(it-Pe);y.current.style.setProperty("--ghost-start",`${pe}`),y.current.style.setProperty("--ghost-width",`${lt}`);}};useEffect(()=>{y.current&&y.current.style.setProperty("--value",C.current?`${V(parseFloat(C.current.value),parseFloat(C.current.min),parseFloat(C.current.max))}`:h.toString());},[]),useEffect(()=>(d?(document.addEventListener("mousemove",re),document.addEventListener("mouseup",ye)):(document.removeEventListener("mousemove",re),document.removeEventListener("mouseup",ye)),()=>{document.removeEventListener("mousemove",re),document.removeEventListener("mouseup",ye);}),[d]),useEffect(()=>{let te=V(r,R,P);y.current?.style.setProperty("--value",`${te}`),Y(r);},[r,R,P,M.current]);let ee=()=>jsxs(p,{ref:y,onMouseEnter:()=>Q(true),onMouseLeave:()=>Q(false),onMouseMove:Ce,className:`--slider --${e||to.Default} ${l?"--knob-hover":""} flex rel ${T}`.trim(),style:{...b},children:[jsx(p,{ref:L,className:"--slider-track abs fill"}),f&&jsx(p,{ref:N,className:"--slider-ghost abs fill"}),jsx(p,{className:"--slider-track-filled abs fill",style:{width:"calc(var(--value) * 1%)"}}),jsx(p,{ref:x,className:"--slider-knob --tooltip-knob abs"}),jsx(se,{ref:C,onInput:W,className:"abs fill",tabIndex:0,type:e||to.Default,defaultValue:h||0,step:I,max:P,min:R})]});if(c===true){let te=i?i(r):m?r.toFixed(2):r;return jsx($o,{ref:H,show:d,position:ct.Top,margin:15,anchorName:"--tooltip-knob",title:jsx(oe,{ref:M,children:te}),children:ee()})}return ee()};Xn.displayName="Zuz.Slider";var Je=Xn;var Qn=forwardRef((t,n)=>{let{src:e,shape:r,size:o,...s}=t,{style:a,className:u,rest:f}=B(s),{canvasRef:l,crop:c,setScale:m,handleMouseDown:i,handleMouseUp:g,handleMouseMove:T}=useImageCropper(e,o||200,r||CropShape.Circle);return useImperativeHandle(n,()=>({getCropped(){return c()},setScale(b){m(b);}})),jsxs(p,{as:`--cropper --${r||CropShape.Circle} ${u}`,style:a,...f,children:[jsx("canvas",{ref:l,width:o||200,height:o||200,onMouseDown:i,onMouseUp:g,onMouseLeave:g,onMouseMove:T}),jsx(p,{as:"--cropper-slider",children:jsx(Je,{onChange:b=>m(b),min:0,max:1,step:.01,value:1})})]})});Qn.displayName="Zuz.Cropper";var Jc=Qn;var em=(e=>(e.Circle="circle",e.Square="square",e))(em||{});var jn=forwardRef((t,n)=>{let{items:e,maxItems:r}=t,o=useMemo(()=>{let u=typeof e=="string",f=u?[]:e;return u&&e.split(",").forEach(l=>{f.push({label:l});}),f},[e]),a=useMemo(()=>r&&r>0&&o.length>r-1,[o,r])?[...o.slice(0,2),{ID:".",label:"...",icon:"ellipsis",action:()=>{}},...o.slice(-r)]:o;return jsx(Ke,{ref:n,className:"--crumb flex aic",direction:"rows",seperator:jsx(p,{as:"--crumb-chevron",children:O.chevronRightOutline}),items:a.map((u,f,l)=>u.ID=="."?jsx(p,{as:"flex aic gap:3",children:Array(3).fill(null).map(()=>jsx(p,{as:"w:4 h:4 bg:$text r:10"},`--crumb-placeholder-${f}`))}):jsxs(z,{onClick:()=>u.action?.(),className:"--crumb-item",disabled:!l[f+1],children:[u.icon&&jsx(J,{as:"--crumb-icon",name:u.icon}),jsx($,{as:"--crumb-label",children:u.label})]},`${u.label.replace(/\s+/g,"-").toLowerCase()}-${f}`))})});jn.displayName="Zuz.Crumb";var om=jn;var os=forwardRef((t,n)=>{let{icon:e,defaultValue:r,value:o,size:s,variant:a,numeric:u,type:f,onConfirm:l,...c}=t,[m,i]=useState(false),[g,T]=useState(r||null),{style:b,className:S,rest:I}=B(c),R=useRef(null),P=useRef(null),{reposition:h}=gt(P,{direction:le.Bottom,offset:2}),C=x=>{u&&(x.currentTarget.value=x.currentTarget.value.replace(/[^0-9.]/g,"").replace(/(\..*?)\..*/g,"$1"));};useEffect(()=>{let x=N=>{let D=N.target,L=R.current?.contains(D),A=P.current?.contains(D);!L&&!A&&i(false);};return m&&document.addEventListener("mousedown",x),()=>{document.removeEventListener("mousedown",x);}},[m]),useEffect(()=>{let x=N=>{N.key==="Escape"&&m&&(i(false),R.current?.focus());};return document.addEventListener("keydown",x),()=>document.removeEventListener("keydown",x)},[m]);let y=()=>{i(true);};return useEffect(()=>{m&&h();},[m,h]),jsx(Fragment$1,{children:jsxs(p,{as:`--date-picker ${a?`--${a}`:""} rel flex aic ${S}`,"data-value":g?g.toISOString():"",children:[e?typeof e=="string"?jsx(J,{as:"mr:10 c:#666",name:e}):e:jsx(oe,{as:"--date-picker-icon flex aic jcc",children:O.calendar}),jsx("input",{ref:R,value:g?format(g,"EEE, MMM d YYY hh:mm a"):o||"",className:`--input ${a?`--${a}`:""} flex`.trim(),style:b,onFocus:y,onInput:C,autoComplete:"new-password",onKeyDown:x=>{x.key=="Enter"&&l?.(x.currentTarget.value);},...I}),jsx(p,{"aria-hidden":!m,ref:P,fx:{from:{y:5,opacity:0},to:{y:0,opacity:1},when:m,duration:.05},as:`--date-picker-chooser flex aic ${a?`--${a}`:""}`,children:jsx(Lo,{defaultValue:g,onChange:x=>{T(x),i(false);}})})]})})});os.displayName="Zuz.DatePicker";var am=os;var rs=forwardRef((t,n)=>{let{icon:e,variant:r,position:o}=t;return jsx(z,{className:`--fab fixed --${r||K.Large} --${o||"bottomright"}`,children:e||O.plus})});rs.displayName="Zuz.Fab";var mm=rs;var ns=t=>{let{names:n,strength:e}=t,r={[It.Gooey]:o=>jsxs("filter",{id:"gooey",children:[jsx("feGaussianBlur",{in:"SourceGraphic",stdDeviation:o||10,result:"blur"}),jsx("feColorMatrix",{in:"blur",mode:"matrix",values:"1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 18 -7",result:"goo"}),jsx("feBlend",{in:"SourceGraphic",in2:"goo"})]},`filter-${It.Gooey}`)};return useEffect(()=>{},[n]),jsx("svg",{xmlns:"http://www.w3.org/2000/svg",version:"1.1",children:jsx("defs",{children:(n||[It.Gooey]).map(o=>r[o](e))})})};ns.displayName="Zuz.Filters";var fm=ns;var He=null,ge=null,as=forwardRef((t,n)=>{let{title:e,message:r,transition:o,curve:s,speed:a,type:u,actionPosition:f,spinner:l,loadingMessage:c,onShow:m,onHide:i,...g}=t,{className:T,style:b,rest:S}=B(g),[I,R]=useState(e||""),[P,h]=useState(r||""),[C,y]=useState(null),[x,N]=useState(u||ve.Default),D=useMemo(()=>uuid(12),[]),[L,A]=useState(false),M=useRef(null),H=useRef(null),[V,W]=useState(false),[d,E]=useState(true),_=useRef(null),U=P;useImperativeHandle(n,()=>({setLoading(Z){W(Z);},showDialog(Z,j,Q,Y){He&&(clearTimeout(He),ge&&clearTimeout(ge),M.current.classList.remove("--wobble"),setTimeout(()=>M.current.classList.add("--wobble"),50),ge=setTimeout(()=>{M.current.classList.remove("--wobble"),ge=null;},500)),N(ve.Dialog),j&&h(j),Z&&R(Z),Q&&y(Q.reduce((he,re)=>(he.push({...re,key:re.key||uuid(12)}),he),[])),A(true),setTimeout(()=>Y?Y():()=>{},1e3);},dialog(Z,j,Q,Y){He&&(clearTimeout(He),ge&&clearTimeout(ge),M.current.classList.remove("--wobble"),setTimeout(()=>M.current.classList.add("--wobble"),50),ge=setTimeout(()=>{M.current.classList.remove("--wobble"),ge=null;},500)),N(ve.Dialog),h(j),R(Z),Q&&y(Q.reduce((he,re)=>(he.push({...re,key:re.key||uuid(12)}),he),[])),A(true),setTimeout(()=>Y?Y():()=>{},1e3);},error(Z,j){this.show(Z,j,ve.Error);},warn(Z,j){this.show(Z,j,ve.Warn);},success(Z,j){this.show(Z,j,ve.Success);},show(Z,j,Q){He&&(clearTimeout(He),ge&&clearTimeout(ge),H.current=M.current.style.transform,M.current.style.transform="",M.current.classList.remove("--wobble"),setTimeout(()=>{M.current.classList.add("--wobble"),M.current.style.transform=`${H.current} scale(.9)`.trim();},50),ge=setTimeout(()=>{M.current.classList.remove("--wobble"),M.current.style.transform=H.current||"",ge=null;},500)),He=setTimeout(()=>{A(false),He=null,ge=null;},(j||4)*1e3),N(Q||ve.Default),h(Z),A(true),m?.();},hide(){A(false),i?.();}}));let F=useMemo(()=>{let Z={when:L,duration:a||.3,delay:.1};if(x==ve.Dialog){if(o){let{from:j,to:Q}=pt(o,20);return {from:j,to:Q,curve:s||q.EaseInOut,...Z}}return {from:{scale:0,x:"-50%",y:"-50%",opacity:0},to:{scale:1,x:"-50%",y:"-50%",opacity:1},curve:q.Spring,...Z}}else return {from:{scale:0,x:"-50%",y:"-10vh",opacity:0},to:{scale:1,x:"-50%",y:0,opacity:1},curve:q.Spring,...Z}},[L,x]);return useEffect(()=>{_.current&&clearTimeout(_.current),L?E(true):_.current=setTimeout(()=>E(false),1e3);},[L]),x==ve.Dialog?jsxs(Fragment$1,{children:[jsx(ze,{when:L}),jsxs(p,{className:`--sheet --sheet-${x.toLowerCase()} ${L?"is-visible":""} ${T} fixed`.trim(),style:b,fx:F,...S,ref:M,children:[jsx(Re,{when:V,spinner:l,message:c}),jsxs(p,{className:"--head flex aic rel",children:[jsx(p,{className:`--${I?"title":"dot"} flex aic rel`,children:I||""}),jsx(z,{onClick:Z=>A(false),className:"--closer abs",children:"\xD7"})]}),jsx(p,{className:`--body flex aic rel ${C?"":"--no-action"}`.trim(),children:d?U:null}),C&&jsx(p,{className:`--footer flex aic rel ${f?f==eo.Center?"jcc":"":"jce"}`.trim(),children:C.map((Z,j)=>jsx(z,{onClick:Q=>Z.handler?Z.handler():Z.onClick?Z.onClick():console.log("onClick Handler missing"),className:"--action",children:Z.label},`sheet-${D}-action-${Z.key}`))})]})]}):jsx(p,{className:`--sheet --sheet-${x.toLowerCase()} ${T} abs`.trim(),style:b,...S,fx:F,ref:M,children:L?P:null})}),Ct=t=>typeof t=="object"&&t!=null&&"setLoading"in t&&"success"in t&&"error"in t;as.displayName="Zuz.Sheet";var xm=as;var is=({ref:t,...n})=>{let{name:e,cover:r,spinner:o,errors:s,action:a,children:u,withData:f,beforeSubmit:l,onSubmit:c,onError:m,onSuccess:i,resetOnSuccess:g,...T}=n,{className:b,style:S,rest:I}=B(T),[R,P]=useState(false),h=useRef(null),C=useRef(null),y=useRef(null),x=To(),N=useCallback(d=>h.current?h.current.querySelectorAll(d):[],[h.current]),D=d=>({name:d.name||d.getAttribute("name")||d.getAttribute("data-name"),required:d.required?true:d.getAttribute("data-required")?d.getAttribute("data-required")=="true":false,with:d.with||d.getAttribute("with")}),L=d=>{let E=[];return d.querySelectorAll(".--input").forEach(_=>{E.push(_.value);}),E.join("")},A=useCallback(d=>{let{required:_$1}=D(d);if(_$1){if(d.type=="checkbox"&&d.checked==false)return false;if(d.classList.contains("--otp")){let F=L(d);if(F==""||F.length<parseInt(d.getAttribute("data-size")))return false}if(d.classList.contains("--select")&&d.querySelector("button.--selected").dataset.value=="-1"||d.value=="")return false}if(d.getAttribute("with")){let F=d.getAttribute("with");switch(F.includes("@")&&(F=F.split("@")[0],F=="match"&&(F=Le.MatchField)),F.toUpperCase()){case Le.IPV4:return _(d.value).isIPv4();case Le.IPV6:return _(d.value).isIPv6();case Le.Email:return _(d.value).isEmail();case Le.Uri:try{return new URL(d.value),!0}catch{return false}case Le.Password:return console.log("Add FORMVALIDATION.Password"),false;case Le.MatchField:let[Z,j,Q]=d.getAttribute("with").split("@"),Y=document.querySelector(`[name=${j.trim()}]`);if(!Y)return false;switch(Q||"direct-match"){case "if-not-empty":if(Y&&!_(Y.value).isEmpty()&&Y.value!=d.value)return false;break;case "direct-match":if(Y&&Y.classList.contains("--otp")&&d.classList.contains("--otp")&&L(Y)!=L(d))return false;if(Y&&Y.value!=d.value)return false;break}break;default:return true}}return true},[h.current]),M=useCallback(()=>{let d={},E={},_=null,U=null;if(Array.from(N("[name]")).forEach(F=>{let{name:Z,required:j,with:Q}=D(F),Y=true;(j||Q)&&(Y=A(F)),d[Z]={valid:Y,value:F.type=="checkbox"?F.checked==true?F.value:false:F.classList.contains("--otp")?L(F):F.classList.contains("--select")?F.querySelector("button.--selected").dataset.value:F.value},E[Z]=F.type=="checkbox"?F.checked==true:F.classList.contains("--otp")?L(F):F.classList.contains("--select")?F.querySelector("button.--selected").dataset.value:F.value,Y?F.classList.remove("input-with-error"):(_==null&&s&&(_=F,U=s[Z]),F.classList.add("input-with-error"));}),_){let F=_;if(F.classList.contains("--otp"))for(let Z of Array.from(F.querySelectorAll(".--input"))){let j=Z;if(j.value==""){j.focus();break}}else F.focus();}return {error:_!=null,errorMsg:U||"Fix errors to continue...",data:d,payload:E}},[h.current]),H=useCallback(()=>{let{error:d,errorMsg:E,payload:_}=M();d?x.error(E):a?startTransition(async()=>{l&&l(_),Ct(r)?r.setLoading(true):P(true),x.clearAll(),withPost(a,{..._,...f||{}}).then(U=>{let F=U;Ct(r)?r.setLoading(false):P(false),g&&Array.from(N("[name]")).forEach(Z=>{Z instanceof HTMLInputElement&&(Z.value="");}),i?i(F):(x.clearAll(),x.success(F.message||"Redirecting..."));}).catch(U=>{Ct(r)?r.setLoading(false):P(false),m?m(U):x.error(U.message||"We cannot process your request at this time.");});}):c&&c(_);},[a,C.current,h.current]),V=useCallback(()=>{let d=N("[type=submit]");!d||d.length==0?console.warn("You should add at least 1 button with type=`SUBMIT`"):d.forEach(E=>{E.addEventListener("click",H);});},[h.current]),W=useMemo(()=>addPropsToChildren(u,d=>d.props.type=="submit",d=>({ref:y})),[u]);return useImperativeHandle(t,()=>({setLoading(d){if(d){C.current?.hide();try{x.clearAll();}catch{}}P(d);},showError(d){typeof d=="string"?x.error(d):C.current.error(d,4);},hideError(){C.current.hide();try{x.clearAll();}catch{}},init(){V();},submit(){H();}})),useEffect(V,[]),jsxs(p,{ref:h,style:S,className:`--form flex rel ${b} ${e?`--form-${e.replace(/\s+/g,"-")}`:""}`,propsToRemove:["withData","action","onSubmit","onSuccess","onError"],children:[!Ct(r)&&jsx(Re,{message:r?r.message||void 0:"working",spinner:o,color:r&&"color"in r?r.color:"#ffffff",when:R}),W]})};is.displayName="Zuz.Form";var Im=is;var ls=t=>{let {ref:n,cols:e,rows:r,gap:o,gapX:s,gapY:a,align:u,justify:f,inline:l,flow:c,autoCols:m,autoRows:i,template:g,...T}=t;useRef(null);let {className:S,style:I,rest:R}=B(T),P=C=>typeof C=="number"?`repeat(${C}, 1fr)`:C,h={display:l?"inline-grid":"grid",gridTemplateColumns:P(e),gridTemplateRows:P(r),gap:o,columnGap:s,rowGap:a,alignItems:u,justifyContent:f==="between"?"space-between":f==="around"?"space-around":f,gridAutoFlow:c,gridAutoColumns:m,gridAutoRows:i,gridTemplateAreas:g,...I};return jsx(p,{ref:n,as:`--grid ${S}`.trim(),style:h,...R})};ls.displayName="Zuz.Grid";var Lm=ls;var cs=t=>typeof t=="string"&&t.includes("+"),ms={command:"\u2318",shift:"\u21E7",ctrl:"\u2303",option:"\u2325",enter:"\u21B5",delete:"\u232B",escape:"\u238B",tab:"\u21E5",capslock:"\u21EA",up:"\u2191",right:"\u2192",down:"\u2193",left:"\u2190",pageup:"\u21DE",pagedown:"\u21DF",home:"\u2196",end:"\u2198",help:"?",space:"\u2423",fn:"Fn",win:"\u2318",alt:"\u2325"},ps={command:"Command",shift:"Shift",ctrl:"Control",option:"Option",enter:"Enter",delete:"Delete",escape:"Escape",tab:"Tab",capslock:"Caps Lock",up:"Up",right:"Right",down:"Down",left:"Left",pageup:"Page Up",pagedown:"Page Down",home:"Home",end:"End",help:"Help",space:"Space",fn:"Fn",win:"Win",alt:"Alt"};var fs=forwardRef(({children:t,keys:n,as:e,className:r,variant:o},s)=>{let{variant:a}=X(true),u=useMemo(()=>{if(cs(n)){let f=null;return {keys:String(n).split("+").reduce((c,m,i,g)=>(g[i+1]?c.push(m):f=m.toUpperCase(),c),[]),children:f}}return {keys:n,children:String(t).toUpperCase()}},[n]);return jsxs(p,{as:`--keyboard-keys --${o||a||K.Small} flex aic ${e} ${r}`.trim(),children:[(Array.isArray(u.keys)?u.keys:[u.keys]).map(f=>jsx("abbr",{title:ps[f],children:ms[f]},f)),jsx(oe,{children:u?.children??t})]})});fs.displayName="Zuz.KeyboardKeys";var Go=fs;var hs=createContext(null),tt=()=>{let t=useContext(hs);if(!t)throw new Error("MediaPlayer sub-components must be used within <MediaPlayer />");return t},$m=({ref:t,icons:n,children:e,...r})=>{let{playlist:o=[],mode:s="audio",defaultArtist:a="Artist",defaultTitle:u="No Track",defaultCover:f,onTrackChange:l,...c}=r,{className:m,style:i,rest:g}=B(c),T=useMediaPlayer(o,o[0]??void 0),b=useMemo(()=>({play:O.play,pause:O.pause,prev:O.prev,next:O.next,volumeHigh:O.volumeHigh,volumeMute:O.volumeMute,...n}),[n]),S=useMemo(()=>({...T,mode:s,icons:b}),[T,b]);return jsx(hs.Provider,{value:S,children:jsx(p,{className:`--zuz-media-player ${m}`,style:i,children:e})})},ys=$m;var xs=t=>{if(!t||isNaN(t))return "0:00";let n=Math.floor(t/60),e=Math.floor(t%60);return `${n}:${e.toString().padStart(2,"0")}`},Ut=t=>typeof t=="string"?jsx(J,{name:t}):t,bs=()=>{let{mediaRef:t,state:n,controls:e,mode:r}=tt();return jsxs(p,{as:`--mediaplayer-stage rel --mode-${r}`,children:[r==="video"?jsx("video",{ref:t,className:"fill",onClick:e.togglePlay}):jsx("audio",{ref:t}),n.isLoading&&jsx(p,{as:"abs fill aic jcc --mediaplayer-spinner",children:jsx(we,{})})]})},vs=()=>{let{state:t,defaultArtist:n,defaultTitle:e,defaultCover:r}=tt();return jsxs(p,{as:"--track-info flex aic",children:[jsx(We,{src:t.currentItem?.cover||r||"",as:"--track-cover"}),jsxs(p,{as:"flex cols",children:[jsx(p,{as:"--track-title",children:t.currentItem?.title||e||"Choose Track"}),jsx(p,{as:"--track-artist",children:t.currentItem?.artist||n||"..."})]})]})},ws=()=>{let{state:t,controls:n,icons:e}=tt();return jsxs(p,{as:"--mediaplayer-controls flex aic",children:[jsx(z,{onClick:n.prev,as:"--prev",children:Ut(e?.prev??O.prev)}),jsx(z,{onClick:n.togglePlay,as:"--play-pause",children:Ut(t.isPlaying?e?.pause??O.pause:e?.play??O.play)}),jsx(z,{onClick:n.next,as:"--next",children:Ut(e?.next??O.next)})]})},Ss=()=>{let{state:t,controls:n,mediaRef:e}=tt(),r=t.progress*(t.duration||0);return jsxs(p,{as:"--track-progress flex aic",children:[jsx(p,{as:"--track-current-duration",children:xs(r)}),jsx(Je,{value:t.progress,onClick:o=>{let s=o.currentTarget.getBoundingClientRect(),a=(o.clientX-s.left)/s.width;n.seek(a);}}),jsx(p,{as:"--track-total-duration",children:xs(t.duration)})]})},Cs=()=>{let{state:t,controls:n,icons:e}=tt();return jsxs(p,{as:"--volume-control flex aic gap:8 w:120",children:[jsx(z,{onClick:()=>n.setIsMuted(),children:Ut(t.isMuted?e?.volumeMute??O.volumeMute:e?.volumeHigh??O.volumeHigh)}),jsx(Je,{value:t.volume,className:"h:3 flex:1",onClick:r=>{let o=r.currentTarget.getBoundingClientRect();n.setVolume((r.clientX-o.left)/o.width);}})]})};var zm=({ref:t,...n})=>jsx(ys,{...n,ref:t}),_m=Object.assign(zm,{Stage:bs,TrackInfo:vs,Controls:ws,Progress:Ss,Volume:Cs}),Fm=_m;var Ps=forwardRef((t,n)=>{let e=useNetworkStatus(),{onlineMessage:r,offlineMessage:o,variant:s}=t;return jsxs(p,{fx:{from:{x:"-50%",y:200,opacity:0},to:{x:"-50%",y:0,opacity:1},when:e==false,curve:q.Spring,duration:.5,delay:2},className:`--network-manager --${e==true?"online":"offline"} --${s||K.Small} fixed flex`,children:[jsx(p,{className:"--ico",children:e?O[be.Success]:O[be.Error]}),jsx($,{as:"--message",children:e?r||"internet connection restored :)":o||"no internet connection"})]})});Ps.displayName="Zuz.NetWorkManager";var Um=Ps;var Is=forwardRef((t,n)=>{let{strenthMeter:e,onChange:r,...o}=t;"type"in o&&delete o.type;let{style:s,className:a,rest:u}=B(o),[f,l]=useState(false),[c,m]=useState(""),i=useMemo(()=>checkPasswordStrength(c),[c]),g=useDebounce(T=>{e&&m(T.target.value),r&&r(T);},100);return useEffect(()=>{},[]),jsxs(p,{as:"w:100% flex cols",children:[jsxs(p,{style:s,className:"--password flex aic rel",children:[jsx(se,{ref:n,type:f?"text":"password",className:a,onChange:g,...u}),jsx(z,{tabIndex:-1,onClick:()=>l(T=>!T),className:"--toggle flex aic jcc abs",children:f?O.eye:O.eyeSlash})]}),e&&jsxs(p,{as:`flex aic --password-meter --pb-score-${i.score}`,style:s,children:[jsxs(p,{as:"--password-bars flex aic",children:[jsx(p,{as:`--pbar ${i.score>=1?"--pb-on":""}`.trim()}),jsx(p,{as:`--pbar ${i.score>=2?"--pb-on":""}`.trim()}),jsx(p,{as:`--pbar ${i.score>=3?"--pb-on":""}`.trim()}),jsx(p,{as:`--pbar ${i.score>=4?"--pb-on":""}`.trim()}),jsx(p,{as:`--pbar ${i.score>=5?"--pb-on":""}`.trim()})]}),jsx($,{as:"--password-meter-label","aria-hidden":true,children:i.result})]})]})});Is.displayName="Zuz.Password";var jm=Is;var Bs=forwardRef((t,n)=>{let{size:e,length:r,mask:o,...s}=t,a=useRef([]),u="pinput",f=false,l={};"with"in s&&(l={with:s.with},delete s.with),"type"in s&&delete s.type,"name"in s&&(u=s.name,delete s.name),"required"in s&&(f=true,delete s.required);let{style:c}=B(s),m=i=>{let g=i.currentTarget,T=a.current[parseInt(g.dataset.index)+1],b=a.current[parseInt(g.dataset.index)-1];g.value.length===1&&T?T.focus():g.value.length===0&&b&&b.focus();};return useEffect(()=>{a.current=a.current.slice(0,e||r);},[e||r]),jsx(p,{name:u,style:c,className:"--otp flex aic rel","data-required":f,"data-size":e||r||4,...l,children:Array(e||r||4).fill(1).map((i,g)=>jsx(se,{autoComplete:"new-password","data-index":g,ref:T=>{a.current[g]=T;},numeric:true,onChange:m,maxLength:1,placeholder:o?"\xB7":"0",type:o?"password":"text",...s},`pin-${g}`))})});Bs.displayName="Zuz.PinInput";var rp=Bs;var Es=forwardRef((t,n)=>{let{children:e,className:r,name:o,required:s,type:a,value:u,variant:f,checked:l,onSwitch:c,...m}=t,[i,g]=useState(l||false),{variant:T}=X(true),b=useRef(null);return jsxs(bt,{className:`${r} --${(a||oo.Default).toLowerCase()} --radio${!a||a==oo.Default?"":"card"} --${f||T||K.Small} flex aic rel`.trim(),...m,children:[jsx(se,{ref:b,defaultChecked:i,value:u||"rd",type:"radio",className:"abs",name:o,required:s||false,onChange:S=>{c&&c(S.target.checked,u||"cb"),g(S.target.checked);}}),jsx(p,{className:"--dot rel",children:jsx(p,{className:"--rod abs abc"})}),jsx(p,{className:"--value",children:e})]})});Es.displayName="Zuz.Radio";var ip=Es;var Ls=forwardRef((t,n)=>{let{fx:e,withStyle:r,as:o,reverse:s=false,searchIcon:a=O.search,hideSearchIcon:u=false,clearIcon:f=O.close,hideClearIcon:l=false,onChange:c,onClear:m,...i}=t,{style:g,className:T}=B({as:t.as}),[b,S]=useState(""),{variant:I}=X(true),R=useRef(null);"type"in t&&delete t.type;let P=C=>{S(C.target.value),c?.(C.target.value);},h=C=>{b.trim()!==""&&(S(""),c?.(""),R.current&&(R.current.value="",t.onConfirm?.("")));};return useImperativeHandle(n,()=>({focus:()=>R.current?.focus(),value:()=>R.current?.value})),useEffect(()=>{},[]),jsxs(p,{style:g,className:`--search ${s?"--search-rev":""} --${t.variant||I||K.Medium} flex aic ${typeof t.as=="string"&&t.as.includes("abs")?"":"rel"} ${T}`.trim(),children:[jsx(se,{ref:R,onChange:P,...i}),t.shortcut&&jsx(Go,{keys:t.shortcut,as:"abs"}),jsx(z,{tabIndex:-1,onClick:C=>h(),className:"--send flex aic jcc",variant:t.variant||K.Medium,children:b!==""?!l&&(typeof f=="string"?jsx(J,{name:f,as:"--search-action"}):f):!u&&(typeof a=="string"?jsx(J,{name:a,as:"--search-action"}):a)})]})});Ls.displayName="Zuz.Search";var dp=Ls;var ks=({value:t,updateValue:n,o:e})=>jsxs(z,{onClick:r=>n(e),as:"--select-option-item",className:t&&(typeof e=="string"?e:e.value)==(typeof t=="string"?t:t.value)?"selected":"",children:[e.icon&&jsx(J,{name:e.icon,as:`--select-option-icon --icon-${e.value}`,color:e.iconColor||void 0}),jsx($,{suppressHydrationWarning:true,children:typeof e=="string"?e:e.label})]});ks.displayName="Option";var Os=ks;var Hs=({ref:t,...n})=>{let{selected:e,options:r,label:o,name:s,variant:a,search:u,searchPlaceholder:f,maxHeight:l,arrowDownIcon:c=O.arrowDown,arrowUpIcon:m=O.arrowUp,expanded:i,onChange:g,...T}=n,[b,S]=useState(e?typeof e=="string"?r.find(d=>d.value===e):e:r[0]),[I,R]=useState(false),[P,h]=useState(null),C=useRef(null),y=useRef(null),x=useRef(null),N=useId(),D=useMemo(()=>s||N,[]),{reposition:L}=gt(x,{direction:ct.Bottom,offset:2}),{variant:A}=X(true),{className:M,style:H,rest:V}=B(T),W=d=>{S(d),R(false),g&&g(d);};return useImperativeHandle(t,()=>({setSelected:d=>{if(typeof d=="string"){let E=r.find(_=>_.value===d);E&&S(E);}else S(d);},getValue:()=>b||null})),useEffect(()=>{if(!I)return;let d=()=>{L();};return window.addEventListener("scroll",d,true),window.addEventListener("resize",L),()=>{window.removeEventListener("scroll",L,true),window.removeEventListener("resize",L);}},[I,L]),useEffect(()=>{if(!I){y.current&&(y.current.value=""),h(null);return}y.current?.focus(),L();let d=_=>{x.current&&!x.current.contains(_.target)&&R(false);},E=setTimeout(()=>{document.addEventListener("click",d);},0);return ()=>{clearTimeout(E),document.removeEventListener("click",d);}},[I,L]),jsxs(p,{className:`--select ${i==true?"--expanded":""} --${a||A} ${s?`--${s}`:""} rel`.trim(),name:D,children:[jsxs(z,{ref:C,"data-value":b?typeof b=="string"?b:b.value:b||"-1",className:`--selected flex aic rel ${M}`.trim(),withLabel:false,style:H,onClick:d=>{d.stopPropagation(),R(E=>!E);},...V,children:[jsx($,{className:"--label",children:b?typeof b=="string"?b:b.label:o||"Choose"}),jsx(p,{className:"--svg-arrow rel flex aic jcc",children:I?typeof m=="string"?jsx(J,{name:m,as:"--search-action"}):m:typeof c=="string"?jsx(J,{name:c,as:"--search-action"}):c})]}),jsxs(p,{id:D,className:"--options-list -fx flex cols abs zIndex:var(--max-z-index)","aria-hidden":!I,style:{maxHeight:l||"auto"},ref:x,fx:{from:{y:5,opacity:0},to:{y:0,opacity:1},when:I,duration:.05},children:[u&&jsx(p,{as:"--select-search --sticky",children:jsx(se,{ref:y,onChange:d=>{h(d.target.value==""?null:d.target.value);},className:"--search-input",placeholder:f||"Search..."})}),(P==null?r:r.filter(d=>d.label.toLowerCase().includes(P.toLowerCase())||d.value.toLowerCase().includes(P.toLowerCase()))).map(d=>jsx(Os,{updateValue:W,value:b,o:d},`option-${(typeof d=="string"?d:d.label).replace(/\s+/g,"-")}-${typeof d=="string"?d:d.value}`))]})]})};Hs.displayName="Zuz.Select";var vp=Hs;var Vs=forwardRef((t,n)=>jsx(vt,{type:Ee.Switch,...t,ref:n}));Vs.displayName="Zuz.Switch";var Sp=Vs;var $s=t=>{let{idx:n,id:e,as:r,weight:o,style:s,value:a,render:u,resize:f,sortBy:l,sortable:c,onSort:m}=t,[i,g]=useState(0),T=()=>{c&&(m?.(String(e),i==1?-1:1),g(b=>b==1?-1:1));};return jsxs(p,{style:{flex:o||1,...s},as:`--col flex aic ${r||""} ${c?"--sortable":""}`,onClick:T,children:[jsx(p,{children:a}),n==-1&&c&&l==e&&jsx(p,{as:"--arrow flex aib",children:i==1?O.arrowUp:O.arrowDown})]})};$s.displayName="Zuz.Column";var Xt=$s;var _s=t=>{let{index:n,pubsub:e,schema:r,data:o,ids:s,styles:a,animate:u,sortBy:f,selectable:l,tableRef:c,loading:m,rowClassName:i,onSort:g,onRowClick:T,onSelect:b,onContextMenu:S}=t,I=useDelayed(),R=useMemo(()=>({transition:G.SlideInBottom,curve:q.EaseInOut,delay:.02*(n+1)}),[]),P=useRef(null),h=(y,x)=>{n==-1?e.emit(`ALL_ROWS_${y?"CHECKED":"UNCHECKED"}`,y):(b&&b(o,y),e.emit(`ROW_${y?"CHECKED":"UNCHECKED"}`,y,x));},C=(y,x,N)=>jsx(Xt,{idx:y,id:x,as:"--selector",pubsub:e,value:jsx(vt,{value:N,ref:P,onSwitch:h,type:Ee.Default})});return useEffect(()=>{let y=(L,A)=>{P.current?.setChecked(L,false);},x=(L,A)=>{let M=false;c?.current&&c.current.querySelectorAll(".--row").forEach(H=>{let V=H;if(!V.classList.contains("--row-head")){let W=V.querySelector(".--selector input[type=checkbox]");W&&W.checked&&!M&&(M=W.checked);}}),P.current.setChecked(M,false);},N=L=>{P.current?.setChecked(L,false),b&&b(o,L);},D=L=>{P.current?.setChecked(L,false),b&&b(o,L);};return n==-1?(e.on("ROW_CHECKED",y),e.on("ROW_UNCHECKED",x),()=>{e.off("ROW_CHECKED",y),e.off("ROW_UNCHECKED",x);}):(e.on("ALL_ROWS_CHECKED",N),e.on("ALL_ROWS_UNCHECKED",D),()=>{e.off("ALL_ROWS_CHECKED",N),e.off("ALL_ROWS_UNCHECKED",D);})},[]),jsxs(p,{onContextMenu:y=>S?S(y,o):null,onClick:y=>T?T(y,t.data):()=>{},...u?{fx:{...R,when:I}}:{},as:`--row flex aic ${T?"--row-clickable":""} ${n==-1?"--row-head":""} ${i||""}`,children:[n==-1&&r.map((y,x)=>{let{renderWhenHeader:N,render:D,value:L,...A}=y;return jsxs(Fragment,{children:[l&&x==0&&C(-1,`--selector-${y.id}`,"all"),jsx(Xt,{idx:-1,onSort:g,sortBy:f,value:L,...A,pubsub:e,style:a[y.id]})]},`--col-${y.id}`)}),m&&n>-1&&jsx(p,{as:"--col",children:jsx($,{as:"opacity:0",children:"..."})}),!m&&n>-1&&s&&o&&r.map((y,x)=>jsxs(Fragment,{children:[l&&x==0&&C(x,`--selector-${y.id}`,y.id.toString()),s.includes(String(y.id))?jsx(Xt,{pubsub:e,idx:x,id:String(y.id),style:a[String(y.id)],value:y.render?y.render(o,n):o[String(y.id).includes(".")?String(y.id).split(".").reverse()[0]:y.id]}):null]},`--${String(y.id)}-val-${x}`))]})};_s.displayName="Zuz.Row";var Yt=_s;var Ws=(t,n)=>{let{schema:e,rows:r,rowCount:o,rowsPerPage:s,currentPage:a,pagination:u,paginationHash:f,showPaginationOnZeroPageCount:l,animateRows:c,header:m,rowClassName:i,selectableRows:g,hoverable:T,sortBy:b,loading:S,loadingRowCount:I,loadingMessage:R,spinner:P,emptyMessage:h,onSort:C,onRowClick:y,onRowSelectToggle:x,onPageChange:N,onRowContextMenu:D,...L}=t,A=useRef(null),M=useMemo(()=>e.reduce((ae,ee)=>(ae[ee.id]={flex:ee.weight||1,...ee.w&&{width:ee.w},...ee.maxW&&{maxWidth:ee.maxW},...ee.minW&&{minWidth:ee.minW},...ee.h&&{height:ee.h},...ee.maxH&&{maxHeight:ee.maxH},...ee.minH&&{minHeight:ee.minH}},ae),{}),[e]),H=useMemo(()=>Object.keys(M),[e]),V=useMemo(()=>m??true,[m]),{style:W,className:d,rest:E}=B(L),_=useRef(null),U=useMemo(()=>new PubSub,[]),F=useRef(r.map(()=>uuid(8))),[Z,j]=useState(b||null),[Q,Y]=useState(R||"loading"),he=useMemo(()=>!S&&r&&r.length==0,[S,r]),re=useCallback(()=>h?typeof h=="function"?jsx(h,{}):h:jsx($,{as:"tac s:18 mt:75",children:"No Record Found"}),[S,r]);useEffect(()=>{F.current=r.map(()=>uuid(8));},[r]);let ye=(ae,ee)=>{j(ae),C?.(ae,ee);},Se=(o||(r?r.length:0))/(s||10),Ce=useMemo(()=>l||Se>1?jsx(xt,{hash:f,ref:A,renderOnZeroPageCount:l,onPageChange:N,paginationStyle:"table",startPage:a,itemCount:o||(r?r.length:0),itemsPerPage:s||10}):null,[a,o]);return useImperativeHandle(n,()=>({setLoading(ae){}})),jsxs(p,{as:`--table ${T??true?"--hoverable":""} flex cols rel ${d}`,ref:_,children:[V==true&&jsx(Yt,{sortBy:Z,onSort:ye,tableRef:_,pubsub:U,selectable:g,index:-1,schema:e,loading:true,styles:M}),S&&jsxs(p,{as:"center-x flex aic --table-spinner",children:[jsx(we,{type:P||me.Simple}),Q&&jsx($,{as:"--table-loading-message",children:Q})]}),S&&Array(I||5).fill({}).map((ae,ee)=>jsx(Yt,{tableRef:_,index:ee,pubsub:U,schema:e,styles:M,loading:true,animate:c,onRowClick:y},`--trow-loading-${ee}-${e[0].id}`)),!S&&r&&r.map((ae,ee)=>jsx(Yt,{tableRef:_,pubsub:U,loading:false,index:ee,schema:e,ids:H,styles:M,animate:c,data:ae,onRowClick:y,rowClassName:i,selectable:g,onSelect:x,onContextMenu:D},`--trow-${F.current[ee]||ee}-${e[0].id}`)),he&&re(),u&&Ce&&jsx(p,{"aria-hidden":!u||!Ce,...c?{fx:{transition:G.SlideInBottom,curve:q.EaseInOut,delay:.02*(r.length+1),when:!S&&r&&u&&Ce!=null}}:{},as:"--row flex aic --row-footer",children:Ce})]})};Ws.displayName="Zuz.Table";var Dp=forwardRef(Ws),Hp=Dp;var Ap=({ref:t,...n})=>{let{title:e,items:r}=n,[o,s]=useState(0),a=(u,f,l)=>{u.preventDefault(),s(f),document.getElementById(l)?.scrollIntoView({behavior:"smooth"});};return jsxs(p,{ref:t,as:"--table-of-contents rel flex cols",children:[jsx($,{as:"--toc-title",children:e}),jsx(Ke,{items:r.map((u,f)=>jsx("a",{className:o==f?"--toc-active":"",style:{anchorName:o===f?"--toc-active":"none",color:o==f?"var(--table-of-contents-color-active)":"var(--table-of-contents-color)"},onClick:l=>a(l,f,u.tag),href:`#${u.tag}`,children:u.label}))})]})},$p=Ap;var Us=({isActive:t,transitionType:n,speed:e,width:r,render:o,content:s,onHeightChange:a})=>{let u=useRef(null),f=useResizeObserver(u);useEffect(()=>{t&&f.height>0&&a(f.height);},[t,f.height]);let l=useMemo(()=>{let c={flexShrink:0,height:"fit-content"};return n==="fade"?{...c,gridArea:"1 / 1 / 2 / 2",opacity:t?1:0,visibility:t?"visible":"hidden",transition:`opacity ${e}s ease-in-out`,zIndex:t?1:0}:n==="scale"?{...c,gridArea:"1 / 1 / 2 / 2",opacity:t?1:0,transform:`scale(${t?1:.95})`,transition:`all ${e}s cubic-bezier(0.34, 1.56, 0.64, 1)`,zIndex:t?1:0}:c},[t,n,r,e]);return jsx(p,{ref:u,style:{...l},className:"--content",children:o||t?s:null})};Us.displayName="Zuz.TabBody";var Gs=Us;var Ys=({ref:t,...n})=>{let{tabs:e,speed:r=.3,prerender:o=true,variant:s,tabStyle:a="fixed",onChange:u,transitionType:f="slide",...l}=n,[c,m]=useState(0),i=useRef(null),g=useResizeObserver(i),T=useMemo(()=>uuid(8),[]),[b,S]=useState("auto"),I=useMemo(()=>g.width>0,[g.width]);useImperativeHandle(t,()=>({setTab:x=>m(x)}));let R=useMemo(()=>e.map(x=>({...x,key:x.key||uuid(8)})),[e]),{style:P,className:h,rest:C}=B({as:`flex cols w-full no-overflow ${l.as||""}`,...l}),y=()=>{if(!I)return {opacity:0};switch(f){case "fade":return {display:"grid",gridTemplateColumns:"1fr"};case "scale":return {display:"grid",gridTemplateColumns:"1fr"};default:return {display:"flex",transform:`translate3d(-${c*g.width}px, 0, 0)`,transition:`transform ${r}s cubic-bezier(0.4, 0, 0.2, 1)`}}};return jsxs(p,{ref:i,style:P,className:`--tabview --${a} flex cols ${h}`,children:[jsx(wt,{as:"--tabview-head",onSwitch:x=>{m(x.index);let N=R.find(D=>D.tag==x.tag);N&&N.onSelect&&(N.onSelect(N,x.index),u?.(N,x.index));},selected:c,items:R.reduce((x,N,D)=>(x.push({icon:N.icon,index:D,label:N.label,tag:N.tag}),x),[])}),jsx(p,{className:"--tabview-body",as:"rel no-overflow w-full",style:{height:b,transition:I?`height ${r}s cubic-bezier(0.4, 0, 0.2, 1)`:"none",opacity:I?1:0},children:jsx(p,{className:"--track",style:{...y()},children:R.map((x,N)=>jsx(Gs,{isActive:N===c,transitionType:f,speed:r,width:g.width,render:o||N===c,onHeightChange:D=>N===c&&S(D),content:x.body},`tab-body-${x.key||N}-${T}`))})})]})};Ys.displayName="Zuz.TabView";var Xp=Ys;var jp=({ref:t,commands:n,onCommand:e,welcomeMessage:r="Welcome to Zuz Terminal v1.0.0",prompt:o="zuz ~ ",variant:s,...a})=>{let[u,f]=useState([{type:"output",content:r}]),[l,c]=useState(""),m=useRef(null),i=useRef(null),{variant:g}=X(true);useEffect(()=>{m.current&&(m.current.scrollTop=m.current.scrollHeight);},[u]);let T=h=>{let C=typeof h=="string"?{type:"output",content:h}:h;f(y=>{let x=[...y,C];return x.length>1e3?x.slice(-1e3):x});},b=()=>f([]);useImperativeHandle(t,()=>({write:T,clear:b}));let S=async h=>{let[C,...y]=h.split(" "),x=C.toLowerCase();return n&&n[x]?await n[x](y):e?await e(h):`command not found: ${C}`},I=h=>{let C=/\u001b\[(\d+)m/g,y=[],x={31:"#ff5f56",32:"#27c93f",33:"#ffbd2e",34:"#007aff",35:"#ff79c6",36:"#8be9fd",39:"#d4d4d4"},N=0,D="#d4d4d4",L=false,A;for(;(A=C.exec(h))!==null;){let H=h.slice(N,A.index);H&&y.push({text:H,color:D,bold:L});let V=A[1];V==="0"?(D="#d4d4d4",L=false):V==="1"?L=true:x[V]&&(D=x[V]),N=C.lastIndex;}let M=h.slice(N);return M&&y.push({text:M,color:D,bold:L}),y},R=(h,C)=>h.includes("\x1B")?I(h).map((y,x)=>jsx(oe,{style:{color:y.color||"#d4d4d4",fontWeight:y.bold?"bold":"normal"},children:y.text},`--terminal-msg-${x}-${y.text.replace(/\S+/g,"-")}`)):jsx(oe,{style:{color:C==="error"?"#ff5f56":C==="command"?"#00ff00":"#d4d4d4"},children:h}),P=async h=>{if(h.key==="Enter"&&l.trim()){let C=l.trim(),y=[...u,{type:"command",content:`${o}${C}`}];c(""),f(y);let x=await S(C);f(N=>[...N,{type:"output",content:x}]);}};return jsxs(p,{as:`--zuz-terminal --${s||g||K.Medium} flex cols ${a.className}`,onClick:()=>i.current?.focus(),children:[jsx(p,{ref:m,className:"--terminal-log",children:u.map((h,C)=>jsx(p,{children:jsx($,{children:R(h.content,h.type)})},C))}),jsxs(p,{as:"flex aic --terminal-input",children:[jsx($,{as:"--terminal-prompt",children:o}),jsx(se,{ref:i,className:"--zuz-term-input",autoFocus:true,value:l,variant:s||g||K.Medium,onChange:h=>c(h.target.value),onKeyDown:P})]})]})},eu=jp;var tu=({meta:t})=>jsxs(z,{as:"flex aic --command-item",children:[t.icon&&jsx(J,{name:t.icon,as:"--command-icon"}),jsx($,{children:t.label})]}),ou=({position:t,onSelect:n,commands:e,visible:r})=>jsx(p,{"aria-hidden":!r,fx:{transition:G.SlideInBottom,duration:.1,when:r},className:"--command-box abs grid",style:{...t},children:e.map(o=>jsx(tu,{meta:o},`cmd-${o.label.replace(/\s+/,"-")}`))}),ea=ou;var ra=forwardRef((t,n)=>{let{autoResize:e,maxHeight:r,variant:o,resize:s="none",command:a,commands:u,onInput:f,cmd:l,renderDropdown:c,value:m,defaultValue:i,...g}=t,T=useRef(null),b=useRef(null),{variant:S}=X(true),{style:I,className:R,rest:P}=B(g),{showDropdown:h,dropdownPosition:C,handleKeyDown:y,handleInput:x,handleCommandSelect:N}=useCommandActions({command:a,commands:u,cmd:l,ref:T}),D=useCallback(()=>{let A=T.current;!A||!e||(b.current&&cancelAnimationFrame(b.current),b.current=requestAnimationFrame(()=>{A.style.height="auto";let M=A.scrollHeight;if(r){let H=parseInt(r.toString(),10);isNaN(H)||(M=Math.min(M,H));}A.style.height=`${M}px`,A.style.overflowY=r&&M>=parseInt(r.toString(),10)?"auto":"hidden";}));},[e,r]),L=A=>{f?.(A),x(A),D();};return useEffect(()=>{D();},[m,i,D]),useEffect(()=>{e&&T.current&&D();},[e,D]),useEffect(()=>()=>{b.current&&cancelAnimationFrame(b.current);},[]),jsxs(p,{as:"rel",children:[jsx("textarea",{className:`--input --textarea --${o||S||K.Medium} flex ${R}`.trim(),style:{...I,resize:s,height:e?"auto":I?.height,overflow:"hidden",transition:e?"none":void 0},onKeyDown:y,onInput:L,ref:A=>{typeof n=="function"?n(A):n&&(n.current=A),T.current=A;},value:m,defaultValue:i,...P}),c?c({show:h,position:C,commands:u||[],onSelect:N}):u&&u.length>0&&jsx(ea,{visible:h,commands:u,onSelect:N,position:C})]})});ra.displayName="Zuz.TextArea";var iu=ra;var sa=forwardRef((t,n)=>{let{as:e,value:r,color:o,direction:s,...a}=t,u=useRef(null),[f,l]=useState(r||0);return useImperativeHandle(n,()=>({updateValue(c){f.toString().length!==c.toString().length&&l(c);},setValue(c){if(this.updateValue(c),u.current){let m=c.toString().split("");u.current.querySelectorAll(".--wheel-char").forEach((i,g)=>{let T=m[g];if(i instanceof HTMLElement){i.setAttribute("data-value",T);let b=i.querySelector(".--wheel-char-track");b instanceof HTMLElement&&(b.style.setProperty("--v",T),b.offsetWidth);}});}}})),useEffect(()=>{l(r||0);},[r]),jsxs(p,{className:"--text-wheel flex aic rel","aria-hidden":true,as:e,ref:u,...a,children:[(f||0).toString().split("").map((c,m)=>isNaN(parseInt(c,10))?jsx(oe,{className:"--wheel-char wheel-char-symbol grid",children:c},`wheel-char-symbol-${m}`):jsx(oe,{"data-value":c,className:`--wheel-char grid ${m>(f||0).toString().length-3?"--wheel-fraction":""}`.trim(),children:jsxs(oe,{className:`--wheel-char-track --wheel-track-${s||"down"} grid`,style:{"--v":c},children:[jsx(oe,{children:!s||s==="down"?0:9}),(!s||s==="down"?[9,8,7,6,5,4,3,2,1,0]:[0,1,2,3,4,5,6,7,8,9]).map((i,g)=>jsx(oe,{children:i},`${m}--${g}`)),jsx(oe,{children:!s||s==="down"?9:0})]})},`wheel-char-${m}`)),o&&jsx(p,{className:"abs fillx",style:{zIndex:1,background:`linear-gradient(0deg, ${o}, transparent, transparent, transparent, ${o})`}})]})});sa.displayName="Zuz.TextWheel";var du=sa;var rr=forwardRef((t,n)=>{let{as:e,meta:r,nodes:o,icons:s,onSelect:a,treeTag:u,selected:f,roots:l,expanded:c,...m}=t,{tag:i,label:g,icon:T,under:b,isHead:S}=r,I=useMemo(()=>l.includes(i),[l]),[R,P]=useState(c),h=()=>{localStorage.setItem(`--tn${u}-${i}`,R?"0":"1"),P(!R);};useEffect(()=>{c||I&&!localStorage.getItem(`--tn${u}-${i}`)?(localStorage.setItem(`--tn${u}-${i}`,"1"),P(true)):P(localStorage.getItem(`--tn${u}-${i}`)=="1");},[]);let C=useMemo(()=>o.filter(y=>y.under==i),[o,i]);return jsxs(p,{className:`--treenode ${I?"--is-root":""} --treenode-${i} flex cols`,children:[jsxs(p,{className:`--node --node-${i} flex aic ${f==i?" --selected":""}`,children:[jsx(z,{skeleton:m.skeleton,onClick:h,className:"--node-aro-btn",disabled:C.length==0,children:s?.arrowClose&&s?.arrowOpen?jsx(J,{skeleton:m.skeleton,className:"--node-aro-icon",name:C.length==0?s?.arrowDisabled||s?.arrowClose:R?s?.arrowOpen:s?.arrowClose}):C.length==0?O.chevronBottom:R?O.chevronBottom:O.chevronRight}),jsxs(z,{className:"--node-meta flex aic",onClick:y=>a(i),children:[(s?.nodeOpen&&s?.nodeClose||I&&s?.rootOpen&&s?.rootClose)&&jsx(J,{skeleton:m.skeleton,className:`--node-icon ${I?"--icon-root":""}`,name:T||(R?I&&s?.rootOpen||s.nodeOpen:I&&s?.rootClose||s?.nodeClose)}),jsx($,{className:`--node-label ${I?"--node-label-root":""}`.trim(),skeleton:m.skeleton,children:g})]})]}),R&&C.length>0&&jsx(p,{className:`--sub-node tree-sub-node-${i} flex cols`,children:C.map(y=>jsx(rr,{treeTag:u,selected:f,onSelect:a,icons:s,roots:l,expanded:y.expanded||false,meta:y,nodes:o},`--node-${y.tag}`))})]})});rr.displayName="TreeItem";var ia=rr;var ca=forwardRef((t,n)=>{let{as:e,nodes:r,onNodeSelect:o,tag:s,icons:a,roots:u,selected:f,...l}=t,[c,m]=useState(f);useImperativeHandle(n,()=>({getSelected:()=>c}),[o]);let i=g=>{m(g),o&&o(g);};return useEffect(()=>{c!=f&&m(f);},[f]),jsx(p,{className:"--treeview flex cols",children:r.filter(g=>u.includes(g.tag)).map(g=>jsx(ia,{treeTag:s?`-${s}`:"",selected:c,onSelect:T=>i(T),icons:a,meta:g,roots:u,expanded:g.expanded||false,skeleton:l.skeleton,nodes:r},`--node-${g.tag}`))})});ca.displayName="Zuz.TreeView";var Su=ca;String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"").replace(/\s+/g," ")};
13
+ export{be as ALERT,lr as AVATAR,Ui as Accordion,Ji as ActionBar,tl as Alert,bl as AutoComplete,Il as Avatar,Bl as Badge,p as Box,mc as Bubble,Mn as BubbleMediaType,Ln as BubbleStatus,z as Button,In as CHART,Ee as CHECKBOX,Ru as COLORTHEME,Lo as Calendar,ec as Carousel,ic as Chart,vt as CheckBox,wc as CodeBlock,Hc as ColorScheme,po as ContextMenu,zc as CookiesConsent,Re as Cover,em as CropShape,Jc as Cropper,om as Crumb,Bu as DATATYPE,Ye as DIALOG,cr as DIALOG_ACTION_POSITION,ue as DRAWER_SIDE,am as DatePicker,yo as Dialog,So as Drawer,It as FILTER,Le as FORMVALIDATION,Eu as FORMVALIDATION_STYLE,mm as Fab,fm as Filters,Im as Form,Lm as Grid,uo as Group,J as Icon,We as Image,se as Input,Go as KeyboardKeys,ps as KeysLabelMap,ms as KeysMap,bt as Label,co as LayersProvider,Ke as List,Fm as MediaPlayer,Um as NetworkStatus,mt as ORIGIN,Iu as OriginType,ze as Overlay,ct as POSITION,Mu as PROGRESS,xt as Pagination,_t as PaginationStyle,jm as Password,rp as PinInput,le as Position,Fe as ProgressBar,oo as RADIO,ip as Radio,ve as SHEET,eo as SHEET_ACTION_POSITION,Pu as SKELETON,to as SLIDER,Nu as SORT,me as SPINNER,xo as ScrollView,dp as Search,vp as Select,wt as SelectTabs,xm as Sheet,Je as Slider,Dt as SnackPosition,Ur as SnackStyle,Ot as SnackType,oe as Span,we as Spinner,Lu as Status,Sp as Switch,G as TRANSITIONS,q as TRANSITION_CURVES,Xp as TabView,Hp as Table,$p as TableOfContents,eu as Terminal,$ as Text,du as TextWheel,iu as Textarea,ba as ThemeProvider,Gr as ToastDefaultTitle,Dt as ToastPosition,Co as ToastProvider,Ur as ToastStyle,Ot as ToastType,$o as ToolTip,Su as TreeView,K as Variant,pt as animationTransition,ro as buildClassString,ur as buildWithStyles,Qu as css,no as getAnimationCurve,Ju as getAnimationTransition,ua as getZuzMap,cs as isKeyCombination,pr as setZuzMap,B as useBase,Si as useContextMenu,Pi as useDialog,Ni as useDrawer,ce as useFx,Li as useMorph,gt as usePosition,Ai as useSnack,To as useToast};