@zuzjs/ui 1.0.24 → 1.0.25

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-QNDXKMRP.js';export{e as PACKAGE_NAME,f as cleanProps,g as splitAtoms}from'./chunk-QNDXKMRP.js';import {createContext,forwardRef,useMemo,Fragment,useEffect,useRef,useState,useCallback,createElement,isValidElement,useId,useImperativeHandle,useLayoutEffect,useContext,startTransition}from'react';import {useDelayed,useScrollbar,useDebounce,useImage,useResizeObserver,useLineChart,useImageCropper,CropShape,useNetworkStatus,useCommandActions,useDimensions,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,toHash,numberInRange,checkPasswordStrength,PubSub}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 Wo={Circle:"CIRCLE",Square:"SQUARE"},Op={Default:"DEFAULT",Circle:"CIRCLE"},Dp={Light:"light",Dark:"dark",System:"system"},we={Default:"DEFAULT",Switch:"SWITCH"},Ot={Auto:"auto",Top:"top",Bottom:"bottom",Left:"left",Right:"right"},oe=Ot,We=AnchorType,Hp=We,W={XSmall:"xs",Small:"sm",Medium:"md",Large:"lg",XLarge:"xl"},Vp={Asc:"ASC",Desc:"DESC"},Ap={String:"STRING",Number:"NUMBER",Boolean:"BOOLEAN",Array:"ARRAY",Object:"OBJECT",Date:"DATE",Time:"TIME",DateTime:"DATETIME",File:"FILE"},$p={Dots:"DOTS"},ve={IPV4:"IPV4",IPV6:"IPV6",Email:"EMAIL",Uri:"URI",Password:"PASSWORD",MatchField:"MATCHFIELD",Pattern:"*",GreaterThan:"GREATER_THAN"},me={Success:"success",Error:"error",Warning:"warning",Info:"info"},F={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"},zp={Success:"success",Error:"error",Idle:"idle",Dead:"dead"},ce={Dialog:"DIALOG",Default:"DEFAULT",Error:"ERROR",Success:"SUCCESS",Warn:"WARN",Promise:"PROMISE"},Ve=ce,Dt={Left:"LEFT",Right:"RIGHT",Center:"CENTER"},Uo=Dt,_p={Bar:"BAR",Ring:"RING"},pt={Default:"range",Text:"number"},Ht={Default:"DEFAULT",Card:"CARD"},ut={Gooey:"gooey"},ae={Left:"LEFT",Right:"RIGHT",Top:"TOP",Bottom:"BOTTOM"};var Go=Symbol.for("zuz.global.map"),qo=t=>{globalThis[Go]=t;},zs=()=>globalThis[Go]||{},Vt=t=>{let s=Array.isArray(t)?t.join(" "):t;if(!s||typeof s!="string")return "";let e$1=zs();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(s).filter(Boolean).map(o=>{let r=o.match(/^([&@][\w-]+)\((.*)\)$/);if(r){let[m,i,c]=r;return g(c).map(l=>{let a=`${i}(${l})`;return e$1[a]||l}).join(" ")}return e$1[o]||o}).join(" ")},iu=t=>{let s=Array.isArray(t)?t.join(" "):t;return !s||typeof s!="string"?"":Vt(s)},Xo=t=>{let s={};for(let e in t){let n=t[e];if(e.startsWith("--")){s[e]=n;continue}let o=d[e]?.toString()??e;if(o==="x"||o==="translateX"){let r=s.translate?.split(" ")??["0px","0px"];s.translate=`${h.addUnitsSafely(e,n)} ${r[1]??"0px"}`;}else if(o==="y"||o==="translateY"){let r=s.translate?.split(" ")??["0px","0px"];s.translate=`${r[0]??"0px"} ${h.addUnitsSafely(e,n)}`;}else c.includes(o)?s[o]=h.addUnitsSafely(e,n):s[o]=n;}return s},At=t=>{if(!t)return "linear";switch(t.toUpperCase()){case F.Bounce:return "var(--bounce)";case F.Liquid:return "var(--liquid)";case F.Spring:return "var(--spring)";case F.EaseInOut:return "ease-in-out";case F.EaseOutBack:return "ease-out-back";default:return "linear"}},Ue=(t,s=0)=>{let e={},n={},o=s||20;switch(t){case G.SlideInLeft:case G.SlideInRight:e={"--fx-x":t===G.SlideInLeft?`-${o}px`:`${o}px`,opacity:0},n={"--fx-x":"0px",opacity:1};break;case G.SlideInTop:case G.SlideInBottom:e={"--fx-y":t===G.SlideInTop?`-${o}px`:`${o}px`,opacity:0},n={"--fx-y":"0px",opacity:1};break;case G.ScaleIn:e={scale:0,opacity:0},n={scale:1,opacity:1};break;case G.FadeIn:e={opacity:0},n={opacity:1};break}return {from:e,to:n}},lu=(t,s,e)=>{let{from:n,to:o}=Ue(t);return s?{...n,...o}:e?n:o};var Fs=(t,s)=>{let e=useRef([]),n=useRef(false);return useEffect(()=>{t?.when||(n.current=false);},[t?.transition]),useEffect(()=>{let o=s?.current;if(!o||!t||!t.clearAtEnd)return;let r=m=>{e.current.includes(m.propertyName)&&t.clearAtEnd===true&&(o.style.transform="",o.style.filter="",e.current.forEach(i=>o.style.removeProperty(i)));};return o.addEventListener("transitionend",r),()=>o.removeEventListener("transitionend",r)},[t,s]),useEffect(()=>{if(typeof window>"u"||!s?.current)return;let o=s.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?At(t.curve):"var(--spring)"}`);},[t,s]),useMemo(()=>{if(!t)return {style:{}};let{transition:o,from:r,to:m,exit:i,when:c,duration:l=.3,delay:a=0,curve:f,watch:u=[]}=t,d=c===false&&!n.current;c===true&&(n.current=true);let T={},{from:x,to:S}=o?Ue(o):{from:r||{},to:m||{}};T=c===void 0?{...x,...S}:c?{...S}:i||x;let h=At(f),v=[],g=Xo(T);e.current=Object.keys(g);let C={...g};return Object.keys(g).forEach(E=>{let R=E.startsWith("--")?"all":E;v.includes(R)||v.push(`${R} ${l}s ${h} ${a}s`);}),u.forEach(E=>{v.includes(E)||v.push(`${E} 0.1s ${h} 0s`);}),{style:{...C,transition:d?"none":v.join(", "),opacity:d?0:C.opacity,pointerEvents:d?"none":C.pointerEvents}}},[t,t?.when,t?.watch])},ie=Fs;var Zs=(t,s)=>{let{as:e,fx:n,transition:o,skeleton:r,className:m,propsToRemove:i,style:c,...l}=t||{},a=o?{transition:o,duration:.3}:n||{},{style:f$1}=ie(a,s),u=Vt(e??"");return {style:{...c,...f$1},className:[m||"",u||"",r?.enabled?"--skeleton":""].join(" ").trim(),rest:{...f(l,i?[...i,"skeleton"]:["skeleton"])}}},N=Zs;var Gs=(t,s={})=>{let{offset:e=8,direction:n="bottom",container:o=null,triggerRef:r=null}=s,m=useRef(null),i=useCallback(()=>{let c=t.current;if(!c)return;let l=r?.current||c.parentElement;if(!l){console.warn("usePosition: No trigger element found. Positioning may not work.");return}let a=c.getBoundingClientRect(),f=l.getBoundingClientRect(),u,d;o?(u=o.getBoundingClientRect(),d="absolute"):(window.getComputedStyle(c).position==="fixed"?d="fixed":d="absolute",d==="fixed"?u={top:0,left:0,right:window.innerWidth,bottom:window.innerHeight,width:window.innerWidth,height:window.innerHeight}:u={top:0,left:0,right:window.innerWidth,bottom:window.innerHeight,width:window.innerWidth,height:window.innerHeight}),c.style.position!==d&&(c.style.position=d),m.current=d;let S=0,h=0;switch(n){case "top":S=f.top-a.height-e,h=f.left,S<u.top&&f.bottom+a.height+e<=u.bottom&&(S=f.bottom+e);break;case "bottom":S=f.bottom+e,h=f.left,S+a.height>u.bottom&&f.top-a.height-e>=u.top&&(S=f.top-a.height-e);break;case "left":S=f.top,h=f.left-a.width-e,h<u.left&&f.right+a.width+e<=u.right&&(h=f.right+e);break;case "right":S=f.top,h=f.right+e,h+a.width>u.right&&f.left-a.width-e>=u.left&&(h=f.left-a.width-e);break}if(S=Math.max(u.top,Math.min(S,u.bottom-a.height)),h=Math.max(u.left,Math.min(h,u.right-a.width)),m.current==="fixed")c.style.top=`${S}px`,c.style.left=`${h}px`;else {let v;c.offsetParent?v=c.offsetParent.getBoundingClientRect():v={top:0,left:0};let g=S-v.top+window.scrollY,C=h-v.left+window.scrollX;c.style.top=`${g}px`,c.style.left=`${C}px`;}},[t,r,e,n,o]);return useEffect(()=>{let c=t.current;if(!c)return;let l=r?.current||c.parentElement;if(!l){console.warn("usePosition: No trigger element found. Positioning may not work.");return}let a=new ResizeObserver(i);return a.observe(c),l&&a.observe(l),i(),window.addEventListener("resize",i),window.addEventListener("scroll",i,true),()=>{a.disconnect(),l&&a.disconnect(),window.removeEventListener("resize",i),window.removeEventListener("scroll",i,true);}},[t,n,e,o,r]),{postion:m.current,reposition:i}},Ge=Gs;var Jo="(prefers-color-scheme: dark)",Ys=typeof window>"u",er=createContext(void 0),Ft=t=>{let s=useContext(er);if(!s){if(t===true)return;throw new Error("useColorScheme must be used within a ThemeProvider")}return s},X=Ft,Qs=({children:t,storageKey:s="--ucs",forceTheme:e,zuzMap:n,...o})=>(n&&qo(n),jsx(Js,{storageKey:s,forceTheme:e,...o,children:t})),Js=({children:t,storageKey:s,forceTheme:e,...n})=>{let[o,r]=useState(()=>e||jo(s,"system")),[m,i]=useState(()=>e||jo(s)),c=u=>(u||(u=window.matchMedia(Jo)),u.matches?"dark":"light"),l=useCallback(u=>{let d=u=="system"?c():u,T=document.documentElement;T.setAttribute("color-scheme",d),T.style.colorScheme=d,i(d);},[c]),a=useCallback(u=>{r(u),localStorage.setItem(s,u),l(u);},[o]),f=useCallback(u=>{let d=c(u);i(d),o==="system"&&l("system");},[o]);return useEffect(()=>{o==null&&window.localStorage.getItem(s);},[o]),useEffect(()=>{window.matchMedia(Jo).addEventListener("change",f);},[f]),useEffect(()=>{let u=d=>{d.key==s&&(d.newValue?a(d.newValue):a("system"));};return window.addEventListener("storage",u),()=>window.removeEventListener("storage",u)},[a]),useEffect(()=>{l(e||o||"system");},[o]),jsxs(er,{value:{colorScheme:o,resolvedScheme:m,setColorScheme:a,...n},children:[e?null:jsx("script",{suppressHydrationWarning:true,dangerouslySetInnerHTML:{__html:`const el = document.documentElement
1
+ import {f,e,g,d,h,c}from'./chunk-X2GGFKXO.js';export{e as PACKAGE_NAME,f as cleanProps,g as splitAtoms}from'./chunk-X2GGFKXO.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,useDimensions,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,toHash,numberInRange,checkPasswordStrength,PubSub}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 qo={Circle:"CIRCLE",Square:"SQUARE"},zp={Default:"DEFAULT",Circle:"CIRCLE"},_p={Light:"light",Dark:"dark",System:"system"},Se={Default:"DEFAULT",Switch:"SWITCH"},$t={Auto:"auto",Top:"top",Bottom:"bottom",Left:"left",Right:"right"},oe=$t,qe=AnchorType,Fp=qe,K={XSmall:"xs",Small:"sm",Medium:"md",Large:"lg",XLarge:"xl"},Zp={Asc:"ASC",Desc:"DESC"},Kp={String:"STRING",Number:"NUMBER",Boolean:"BOOLEAN",Array:"ARRAY",Object:"OBJECT",Date:"DATE",Time:"TIME",DateTime:"DATETIME",File:"FILE"},Wp={Dots:"DOTS"},Ce={IPV4:"IPV4",IPV6:"IPV6",Email:"EMAIL",Uri:"URI",Password:"PASSWORD",MatchField:"MATCHFIELD",Pattern:"*",GreaterThan:"GREATER_THAN"},ue={Success:"success",Error:"error",Warning:"warning",Info:"info"},G={Spring:"SPRING",Liquid:"LIQUID",EaseInOut:"EASEINOUT",EaseOutBack:"EASEOUTBACK",Bounce:"BOUNCE"},q={FadeIn:"FADE_IN",ScaleIn:"SCALE_IN",SlideInTop:"SLIDE_FROM_TOP",SlideInRight:"SLIDE_FROM_RIGHT",SlideInBottom:"SLIDE_FROM_BOTTOM",SlideInLeft:"SLIDE_FROM_LEFT"},Up={Success:"success",Error:"error",Idle:"idle",Dead:"dead"},fe={Dialog:"DIALOG",Default:"DEFAULT",Error:"ERROR",Success:"SUCCESS",Warn:"WARN",Promise:"PROMISE"},ze=fe,zt={Left:"LEFT",Right:"RIGHT",Center:"CENTER"},Xo=zt,Gp={Bar:"BAR",Ring:"RING"},dt={Default:"range",Text:"number"},_t={Default:"DEFAULT",Card:"CARD"},gt={Gooey:"gooey"},ie={Left:"LEFT",Right:"RIGHT",Top:"TOP",Bottom:"BOTTOM"};var Yo=Symbol.for("zuz.global.map"),Qo=t=>{globalThis[Yo]=t;},Ks=()=>globalThis[Yo]||{},Ft=t=>{let s=Array.isArray(t)?t.join(" "):t;if(!s||typeof s!="string")return "";let e$1=Ks();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(s).filter(Boolean).map(o=>{let n=o.match(/^([&@][\w-]+)\((.*)\)$/);if(n){let[i,m,f]=n;return g(f).map(l=>{let c=`${m}(${l})`;return e$1[c]||l}).join(" ")}return e$1[o]||o}).join(" ")},fu=t=>{let s=Array.isArray(t)?t.join(" "):t;return !s||typeof s!="string"?"":Ft(s)},Jo=t=>{let s={};for(let e in t){let r=t[e];if(e.startsWith("--")){s[e]=r;continue}let o=d[e]?.toString()??e;if(o==="x"||o==="translateX"){let n=s.translate?.split(" ")??["0px","0px"];s.translate=`${h.addUnitsSafely(e,r)} ${n[1]??"0px"}`;}else if(o==="y"||o==="translateY"){let n=s.translate?.split(" ")??["0px","0px"];s.translate=`${n[0]??"0px"} ${h.addUnitsSafely(e,r)}`;}else c.includes(o)?s[o]=h.addUnitsSafely(e,r):s[o]=r;}return s},Zt=t=>{if(!t)return "linear";switch(t.toUpperCase()){case G.Bounce:return "var(--bounce)";case G.Liquid:return "var(--liquid)";case G.Spring:return "var(--spring)";case G.EaseInOut:return "ease-in-out";case G.EaseOutBack:return "ease-out-back";default:return "linear"}},Xe=(t,s=0)=>{let e={},r={},o=s||20;switch(t){case q.SlideInLeft:case q.SlideInRight:e={"--fx-x":t===q.SlideInLeft?`-${o}px`:`${o}px`,opacity:0},r={"--fx-x":"0px",opacity:1};break;case q.SlideInTop:case q.SlideInBottom:e={"--fx-y":t===q.SlideInTop?`-${o}px`:`${o}px`,opacity:0},r={"--fx-y":"0px",opacity:1};break;case q.ScaleIn:e={scale:0,opacity:0},r={scale:1,opacity:1};break;case q.FadeIn:e={opacity:0},r={opacity:1};break}return {from:e,to:r}},du=(t,s,e)=>{let{from:r,to:o}=Xe(t);return s?{...r,...o}:e?r:o};var Us=(t,s)=>{let e=useRef([]),r=useRef(false);return useEffect(()=>{t?.when||(r.current=false);},[t?.transition]),useEffect(()=>{let o=s?.current;if(!o||!t||!t.clearAtEnd)return;let n=i=>{e.current.includes(i.propertyName)&&t.clearAtEnd===true&&(o.style.transform="",o.style.filter="",e.current.forEach(m=>o.style.removeProperty(m)));};return o.addEventListener("transitionend",n),()=>o.removeEventListener("transitionend",n)},[t,s]),useEffect(()=>{if(typeof window>"u"||!s?.current)return;let o=s.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?Zt(t.curve):"var(--spring)"}`);},[t,s]),useMemo(()=>{if(!t)return {style:{}};let{transition:o,from:n,to:i,exit:m,when:f,duration:l=.3,delay:c=0,curve:p,watch:a=[]}=t,d=f===false&&!r.current;f===true&&(r.current=true);let T={},{from:h,to:S}=o?Xe(o):{from:n||{},to:i||{}};T=f===void 0?{...h,...S}:f?{...S}:m||h;let P=Zt(p),R=[],y=Jo(T);e.current=Object.keys(y);let g={...y};return Object.keys(y).forEach(I=>{let v=I.startsWith("--")?"all":I;R.includes(v)||R.push(`${v} ${l}s ${P} ${c}s`);}),a.forEach(I=>{R.includes(I)||R.push(`${I} 0.1s ${P} 0s`);}),{style:{...g,transition:d?"none":R.join(", "),opacity:d?0:g.opacity,pointerEvents:d?"none":g.pointerEvents}}},[t,t?.when,t?.watch])},le=Us;var Gs=(t,s)=>{let{as:e,fx:r,transition:o,skeleton:n,className:i,propsToRemove:m,style:f$1,...l}=t||{},c=o?{transition:o,duration:.3}:r||{},{style:p}=le(c,s),a=Ft(e??"");return {style:{...f$1,...p},className:[i||"",a||"",n?.enabled?"--skeleton":""].join(" ").trim(),rest:{...f(l,m?[...m,"skeleton"]:["skeleton"])}}},E=Gs;var tr="(prefers-color-scheme: dark)",Ys=typeof window>"u",rr=createContext(void 0),Gt=t=>{let s=useContext(rr);if(!s){if(t===true)return;throw new Error("useColorScheme must be used within a ThemeProvider")}return s},X=Gt,Qs=({children:t,storageKey:s="--ucs",forceTheme:e,zuzMap:r,...o})=>(r&&Qo(r),jsx(Js,{storageKey:s,forceTheme:e,...o,children:t})),Js=({children:t,storageKey:s,forceTheme:e,...r})=>{let[o,n]=useState(()=>e||or(s,"system")),[i,m]=useState(()=>e||or(s)),f=a=>(a||(a=window.matchMedia(tr)),a.matches?"dark":"light"),l=useCallback(a=>{let d=a=="system"?f():a,T=document.documentElement;T.setAttribute("color-scheme",d),T.style.colorScheme=d,m(d);},[f]),c=useCallback(a=>{n(a),localStorage.setItem(s,a),l(a);},[o]),p=useCallback(a=>{let d=f(a);m(d),o==="system"&&l("system");},[o]);return useEffect(()=>{o==null&&window.localStorage.getItem(s);},[o]),useEffect(()=>{window.matchMedia(tr).addEventListener("change",p);},[p]),useEffect(()=>{let a=d=>{d.key==s&&(d.newValue?c(d.newValue):c("system"));};return window.addEventListener("storage",a),()=>window.removeEventListener("storage",a)},[c]),useEffect(()=>{l(e||o||"system");},[o]),jsxs(rr,{value:{colorScheme:o,resolvedScheme:i,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(\`${s}\`) || "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(Zt,{children:t})]})},jo=(t,s)=>{if(Ys)return;let e;try{e=localStorage.getItem(t)||void 0;}catch{}return e||s};var tr=({ref:t,...s})=>{let{style:e,...n}=s,{style:o,className:r,rest:m}=N(n);return jsx("span",{ref:t,style:e,className:r,...m})};tr.displayName="Zuz.Span";var ee=tr;var rr=forwardRef((t,s)=>{let{name:e,pathCount:n,variant:o,color:r,...m}=t,{variant:i}=X(true),{className:c,style:l,rest:a}=N(m);return jsx("div",{style:{color:r,...l},className:`icon-${e} --icon --${o||i||W.Small} ${c}`.trim(),ref:s,...a,children:Array(n||0).fill(0).map((f,u)=>jsx(ee,{className:`path${u+1}`},`${e}-layer-${u}`))})});rr.displayName="Zuz.Icon";var Y=rr;var ne={Simple:"SIMPLE",Roller:"ROLLER",Wave:"Wave"};var nr=t=>{let{type:s,variant:e,color:n,...o}=t,{className:r,style:m,rest:i}=N(o),{spinner:c}=X(true),l=()=>{switch(s||c?.type||ne.Simple){case ne.Simple:return null;case ne.Wave:return jsxs(Fragment$1,{children:[jsx(p,{as:"--bar --bar1"}),jsx(p,{as:"--bar --bar2"}),jsx(p,{as:"--bar --bar3"})]});case ne.Roller:return null}};return jsx(p,{className:`${r} --spinner --${(s||c?.type||ne.Simple).toLowerCase()} --${e||c?.variant||W.Small}`.trim(),style:{...m},...i,children:l()})};nr.displayName="Zuz.Spinner";var he=nr;var gt={Loading:"loading",Normal:"normal"};var ar=({ref:t,...s})=>{let{reset:e,kind:n="solid",variant:o,icon:r,iconSize:m,children:i,withLabel:c,spinner:l,state:a,disabled:f,...u}=s,{style:d,className:T,rest:x}=N(u),{variant:S}=X(true);return jsxs("button",{className:`--button --${n} --${o||S} flex aic ${e?"":"jcc"} ${r?"--with-icon":""} ${T}`.trim().replace(/\s+/g," "),style:d,ref:t,disabled:a==gt.Loading||s.skeleton?.enabled||f,...x,children:[a==gt.Loading&&jsx(he,{variant:o||S,type:l||ne.Simple}),(!a||a==gt.Normal)&&jsxs(Fragment$1,{children:[r&&jsx(Y,{variant:m,name:r}),c===true?jsx(ee,{children:i}):i]})]})};ar.displayName="Zuz.Button";var z=ar;var lr=forwardRef((t,s)=>{let{h:e,html:n,children:o,lines:r,...m}=t,{style:i,className:c,rest:l}=N(m),a=`h${t.h||1}`;return jsx(a,{ref:s,style:i,className:c,...l,children:n?jsx(ee,{dangerouslySetInnerHTML:{__html:n}}):o})});lr.displayName="Zuz.Text";var H=lr;var aa=t=>{let{label:s,labelColor:e,icon:n,iconColor:o,index:r,className:m,onSelect:i}=t;return s=="-"?jsx(p,{className:"--line"}):jsxs(z,{reset:true,onClick:c=>i?.(t),className:`--item ${m||""}`.trim(),children:[jsx(p,{as:"--icon",children:jsx(Y,{name:n,className:"--ico",style:o?{color:o}:{}})}),jsx(H,{className:"--lbl flex aic",style:e?{color:e}:{},children:s})]})},mr=aa;var ur=({ref:t,...s})=>{let{id:e,as:n,fx:o,offsetX:r,offsetY:m,parent:i,event:c,arrow:l,when:a,items:f,header:u,footer:d,origin:T=We.TopRight,...x}=s,[S,h]=useState(false),[v,g]=useState(f||[]),{position:C,targetRef:E,calculatedAnchor:R}=useAnchorPosition(i?.current,c,{offsetX:r,offsetY:m,preferredAnchor:T}),I=i&&C.top>i.current.getBoundingClientRect().bottom?"--arrow-top":"--arrow-bottom",O=useMemo(()=>{let q=R.toLowerCase();return q.includes("left")?"--arrow-left":q.includes("right")?"--arrow-right":"--arrow-center"},[R]),L=C.top!==0||C.left!==0;useEffect(()=>{a&&L?h(true):a||h(false);},[a,L]);let{className:A,style:B,rest:_}=N(x),K=ie({...o?.transition?{transition:o.transition??G.SlideInBottom}:{from:{opacity:0,scale:.8,y:-10},to:{opacity:1,scale:1,y:0}},curve:o?.curve??F.EaseInOut,duration:o?.duration??.05,when:S&&L});return jsxs(p,{ref:E,className:`--contextmenu ${l||i!=null?`--has-arrow ${I} ${O}`:""} abs flex cols ${A}`.trim(),"aria-hidden":!S,style:{...B,...K.style,top:C.top,left:C.left,visibility:L?"visible":"hidden",transformOrigin:R},..._,children:[typeof u=="function"?createElement(u):u,v.map((q,w)=>jsx(mr,{...q,index:w},`context-${q.label.toLowerCase()}-${w}`)),typeof d=="function"?createElement(d):d]})};ur.displayName="Zuz.ContextMenu";var Wt=ur;var fr=forwardRef((t,s)=>{let{children:e,fx:n,when:o,fxDelay:r,fxStep:m,classToIgnore:i,...c}=t,l=X(true),a=useDelayed(),f=n||l?.group?.fx,u=r||l?.group?.fxDelay,d=m||l?.group?.fxStep,T=i||l?.group?.classToIgnore||"--ignore",x=useMemo(()=>f?addPropsToChildren(e,S=>{if(S.type===Fragment)return false;let h=S.props||{},v="fx"in h,g=h.as?Array.isArray(h.as)?h.as.join(" "):h.as:h.className||"",C=typeof g=="string"&&g.includes(T);return !v&&!C},S=>({fx:{...f,delay:(u||0)+S*(d||.1),when:o??(n?.when||a)}})):e,[e,o,a,f]);return jsx(p,{className:"--group",ref:s,...c,children:x})});fr.displayName="Zuz.Group";var Ut=fr;var gr=forwardRef((t,s)=>{let{message:e,spinner:n,spinnerSize:o,color:r,when:m,hideMessage:i,...c}=t,{className:l,style:a,rest:f}=N(c),{spinner:u}=X(true);return "when"in t&&t.when==false?null:jsxs(Ut,{fx:{transition:G.SlideInBottom,curve:F.Liquid,duration:.5},fxDelay:.1,fxStep:.05,className:`--cover flex aic jcc cols abs fill nope nous ${l}`.trim(),style:{...a,backgroundColor:"var(--cover-bg)"},...f,children:[jsx(he,{variant:o||u?.variant||W.Small,type:n||u?.type||ne.Simple}),!i&&jsx(H,{className:"--label",style:{color:"var(--cover-label)"},children:e||"loading"})]})});gr.displayName="Zuz.Cover";var xe=gr;var hr=forwardRef((t,s)=>{let{when:e,...n}=t;return jsx(p,{ref:s,"aria-hidden":!e,className:"--overlay fixed fill",fx:{transition:G.FadeIn,when:e},...n})});hr.displayName="Zuz.Overlay";var Ee=hr;var Ca=({action:t,render:s=true,message:e=""})=>jsx(p,{as:`--body flex aic rel ${t?"":"--no-action"}`.trim(),children:s?e:null}),xr=Ca;var Pa=({action:t,actionPosition:s,dialogID:e,variant:n})=>jsx(p,{as:`--footer flex aic rel ${s?s==Uo.Center?"jcc":"":"jce"}`.trim(),children:t.map((o,r)=>jsx(z,{variant:n,onClick:m=>o.handler?o.handler():o.onClick?o.onClick():console.log("onClick Handler missing"),as:"--action",children:o.label},`dialog-${e}-action-${o.key}`))}),br=Pa;var Ra={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"})," "]}),[me.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"})}),[me.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"})}),[me.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"})}),[me.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"})}),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"})]})},D=Ra;var Ia=({title:t="Alert",onClose:s})=>jsxs(p,{as:"--head flex aic rel",children:[jsx(p,{as:`--${t?"title":"dot"} flex aic jcc rel`,children:t}),jsx(z,{onClick:e=>s(),className:"--closer abs center-v",children:D.close})]}),vr=Ia;var Pr=({ref:t,...s})=>{let{index:e,id:n,title:o,message:r,transition:m,curve:i,speed:c,type:l,action:a,actionPosition:f,spinner:u,loadingMessage:d,variant:T,inBackground:x,forceClose:S,forceLoading:h,onClose:v,onShow:g,onHide:C,...E}=s,R=useMemo(()=>uuid(12),[]),[P,I]=useState(o||""),[O,L]=useState(r||""),[A,B]=useState(l||Ve.Dialog),[_,K]=useState(false),[q,w]=useState(true),[k,$]=useState(a||null),[U,V]=useState(false),{variant:Z,spinner:Q,dialog:j}=X(true),te=T||j?.variant||Z||W.Small,{style:de,className:ge,rest:Lt}=N(E),Mt=useRef(null),He=ie({when:_,duration:c||j?.speed||.3,delay:j?.delay||.1,transition:m||j?.transition||G.SlideInBottom,curve:i||j?.curve||F.EaseInOut,watch:["scale","filter","transform"]}),se=()=>{K(false),v(n);};useEffect(()=>{B(Ve.Dialog),L(r),I(P),k&&$(k.reduce(($o,zo)=>($o.push({...zo,key:zo.key||uuid(12)}),$o),[])),K(true),setTimeout(()=>g?g():()=>{},500);},[]),useEffect(()=>{S&&se();},[S]),useEffect(()=>{h!=null&&V(h);},[h]);let J=useMemo(()=>1e4+e*10,[e]);return jsxs(Fragment$1,{children:[jsx(Ee,{style:{zIndex:J},when:_}),jsxs(p,{as:`--dialog --${(l??Ve.Default).toLowerCase()} ${_?"--visible":""} ${ge} fixed abc`.trim(),style:{...He.style,zIndex:J+1,pointerEvents:x==true?"none":"auto",...x==true?{scale:"0.92",filter:"blur(2px)"}:{}},...Lt,ref:Mt,children:[jsx(vr,{title:P,onClose:se}),jsx(xr,{message:O,render:q,action:k}),k&&k.length>0&&jsx(br,{variant:te,action:k,dialogID:R,actionPosition:f}),jsx(xe,{when:U,spinner:u||j?.spinner||Q?.type||ne.Simple,message:d||j?.loadingMessage})]})]})};Pr.displayName="Zuz.Dialog";var qt=Pr;var Xt=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(s){return this.stack[this.stack.length-1]===s}push(s){this.stack.includes(s)||(this.stack.push(s),this.updateScrollLock());}pop(s){this.stack=this.stack.filter(e=>e!==s),this.updateScrollLock();}handleEscape(){let s=this.stack[this.stack.length-1];return s?(s(),true):false}get count(){return this.stack.length}},Xe=new Xt;var Rr=forwardRef((t,s)=>{let{speed:e,style:n,...o}=t,{rootRef:r,containerRef:m,thumbY:i,thumbX:c,onScrollY:l,onScrollX:a}=useScrollbar(e||1),{style:f,className:u,rest:d}=N(o);return useEffect(()=>{let T=m.current;if(!T)return;let x=()=>{window.dispatchEvent(new Event("resize"));};return T.addEventListener("scroll",x),()=>T.removeEventListener("scroll",x)},[]),jsxs(p,{ref:r,className:u.trim(),as:"--scrollview rel",children:[jsx(p,{as:`--scroll-content ${u}`.trim(),ref:m,style:n||{},children:d.children}),jsx(p,{as:"--scroll-track --track-y --abs",children:jsx(p,{as:"--scroll-thumb --abs",ref:i,onMouseDown:l})}),jsx(p,{as:"--scroll-track --track-x --abs",children:jsx(p,{as:"--scroll-thumb --abs",ref:c,onMouseDown:a})})]})});Rr.displayName="Zuz.ScrollView";var Yt=Rr;var Ir=({ref:t,...s})=>{let{id:e,index:n,from:o,speed:r,children:m,margin:i,animation:c,prerender:l,inBackground:a,forceClose:f,forceLoading:u,onClose:d,...T}=s,{drawer:x}=X(true),[S,h]=useState(m),[v,g]=useState(false),[C,E]=useState(l??(x?.prerender||true)),[R,P]=useState(false),I=()=>{g(false),d?.(e??-1);},{className:O,style:L,rest:A}=N(T),B=useMemo(()=>[{keys:[KeyCode.Escape],callback:()=>{Xe.isTop(I)&&I();}}],[v]);useShortcuts(B),useEffect(()=>{h(m);},[m]),useEffect(()=>(v?Xe.push(I):Xe.pop(I),()=>Xe.pop(I)),[v]),useEffect(()=>{g(true);},[]),useEffect(()=>{f&&I();},[f]),useEffect(()=>{u!=null&&P(u);},[u]);let _=o||x?.from||ae.Left,K=useMemo(()=>{switch(_){case ae.Left:return {from:{x:"-100vw"},to:{x:0}};case ae.Right:return {from:{x:"100vw"},to:{x:0}};case ae.Top:return {from:{y:"-100vh"},to:{y:0}};case ae.Bottom:return {from:{y:"100vh"},to:{y:0}};default:return {from:{x:"-100vw"},to:{x:0}}}},[o,x?.from]),q=ie({from:{...K.from,opacity:0},to:{...K.to,opacity:1},when:v,curve:c||x?.animation||F.EaseInOut,duration:r||x?.speed||.5,watch:["scale","filter"]}),w=useMemo(()=>1e4+(n||1)*10,[n]);return jsxs(Fragment$1,{children:[jsx(Ee,{onClick:k=>{v&&I();},when:v,style:{zIndex:w}}),jsxs(p,{ref:t,"aria-hidden":!v,className:`--drawer flex cols ${O} --${_.toLowerCase()} fixed`,style:{...L,...q.style,"--m":`${i||x?.margin||0}px`,zIndex:w+1,pointerEvents:a==true?"none":"auto",...a==true?{scale:"0.92",filter:"blur(2px)"}:{}},...A,children:[o==ae.Top||o==ae.Bottom?jsx(p,{className:"--handle"}):null,jsxs(Yt,{as:"rel",children:[C||v?S:null,jsx(xe,{when:R})]})]})]})};Ir.displayName="Zuz.Drawer";var eo=Ir;var Nr=(r=>(r.Default="default",r.Success="success",r.Error="error",r.Warn="warn",r.Promise="promise",r))(Nr||{}),Er={success:"Action Successful",error:"Something Went Wrong",warn:"Heads Up",default:"Notice"};var $a=({index:t,id:s,type:e,icon:n,title:o,message:r,duration:m,onClose:i})=>{let c=useDelayed(),l=useDelayed(((m||4)-1)*1e3),{toast:a}=X(true),f=ie({when:c&&!l,duration:a?.duration||.2,transition:G.SlideInTop,curve:a?.curve||F.EaseInOut});return useEffect(()=>{l&&s&&i?.(s);},[l,s]),jsxs(p,{as:`--snack --${e} --snack-${s} ${t>2?"--snacked":""} flex aic`,style:f.style,children:[jsx(p,{as:"--ico flex aic jcc",fx:{transition:G.ScaleIn,curve:F.Spring,delay:.2,when:c&&!l},children:n?jsx(Y,{name:n,fx:{transition:G.ScaleIn,curve:F.Spring,delay:.4,duration:.5,when:c&&!l}}):jsx(p,{as:"--no-icon",fx:{transition:G.ScaleIn,curve:F.Spring,delay:.4,duration:.5,when:c&&!l}})}),jsxs(p,{as:"--meta",children:[jsx(H,{as:"--tt",fx:{transition:G.SlideInTop,curve:F.Spring,delay:.3,when:c},children:o||Er[e]}),jsx(H,{as:"--tm",fx:{transition:G.SlideInTop,curve:F.Spring,delay:.4,duration:.5,when:c},children:r})]})]})},to=$a;var pe=createContext(null),Wa=({ref:t,...s})=>{let n=useContext(pe)?.depth??0,[o,r]=useState(null),[m,i]=useState(false),[c,l]=useState([]),a=useDelayed(),f=useRef(0),u=()=>++f.current,d=()=>{i(false),setTimeout(()=>r(null),200);};useImperativeHandle(t,()=>({add(h){let v=u(),g={id:v,...h};return l(C=>[...C,g]),v},openMenu(h){i(false),setTimeout(()=>{r({id:u(),type:"menu",props:h}),i(true);},16);},remove(h){l(v=>v.map(g=>g.id===h?{...g,props:{...g.props,forceClose:true}}:g)),o?.id===h&&d();},loading(h,v){l(g=>g.map(C=>C.id===h?{...C,props:{...C.props,forceLoading:v}}:C)),o?.id===h&&d();},clear(h){l(c.filter(v=>v.type!=h));}})),useEffect(()=>{if(o&&m){let h=()=>d();return document.addEventListener("click",h),()=>document.removeEventListener("click",h)}},[o,m,d]);let T=h=>{setTimeout(()=>{l(v=>v.filter(g=>g.id!==h)),o?.id===h&&r(null);},250);},x=useMemo(()=>[...c.filter(h=>h.type!="toast")],[c]);if(!a)return null;let S=c.filter(h=>h.type=="toast").reverse();return createPortal(jsxs(p,{as:"--zuz-layers-wrapper fixed fill nope",style:{zIndex:9999+n},children:[x.map((h,v)=>{let g=v<x.length-1;return h.type==="dialog"?jsx(qt,{onClose:T,index:v,id:h.id,...h.props,inBackground:g},`layer-${h.type}-${h.id}`):h.type==="drawer"?jsx(eo,{onClose:T,index:v,id:h.id,...h.props,inBackground:g},`layer-${h.type}-${h.id}`):null}),S.length>0&&jsx(p,{as:"--zuz-layer-toasts fixed fill nope",style:{zIndex:"var(--max-z-index)"},children:S.map((h,v)=>jsx(to,{onClose:T,index:v,id:h.id,...h.props},`layer-${h.type}-${h.id}`))}),o&&jsx(p,{as:"--zuz-layer-menus fixed fill nope",style:{zIndex:"var(--max-z-index)"},children:jsx(Wt,{onClose:d,when:m,...o.props},`menu-${o.id}`)})]}),document.body)},Ua=({children:t})=>{let s=useContext(pe),e=s?s.depth+1:0,n=useRef(null),o=useMemo(()=>({add:r=>n.current?.add(r),openMenu:r=>n.current?.openMenu(r),remove:r=>n.current?.remove(r),loading:(r,m)=>n.current?.loading(r,m),clear:r=>n.current?.clear(r),depth:e,isSubLayer:!!s}),[s]);return jsxs(pe.Provider,{value:o,children:[t,jsx(Wa,{ref:n})]})},Zt=Ua;var qa=()=>{let t=useContext(pe);if(!t)throw new Error("useDialog must be used inside <LayersProvider>");let s=()=>t.clear("dialog"),e=r=>t.remove(r),n=(r,m)=>t.loading(r,m);return {clearAll:s,show:r=>{let m=t.add({type:"dialog",props:{...r,type:Ve.Dialog}});return {id:m,setLoading:i=>n(m,i),hide:()=>e(m)}},hide:e}},Xa=qa;var Qa=()=>{let t=useContext(pe);if(!t)throw new Error("useToast must be used inside <LayersProvider>");let s=(l,a)=>t.add({type:"toast",props:{...a,type:l}});return {show:(l,a,f,u)=>s("default",{title:l,message:a,icon:f,duration:u}),hide:l=>t.remove(l),success:(l,a,f,u)=>s("success",{title:l,message:a,icon:f,duration:u}),error:(l,a,f,u)=>s("error",{title:l,message:a,icon:f,duration:u}),warn:(l,a,f,u)=>s("warn",{title:l,message:a,icon:f,duration:u}),promise:(l,a,f,u)=>s("promise",{title:l,message:a,icon:f,duration:u}),clearAll:()=>t.clear("toast")}},ro=Qa;var ja=()=>{let t=useContext(pe);if(!t)throw new Error("useDialog must be used inside <LayersProvider>");let s=()=>t.clear("drawer"),e=r=>t.remove(r),n=(r,m)=>t.loading(r,m),o=r=>{let m=t.add({type:"drawer",props:r});return {id:m,setLoading:i=>n(m,i),close:()=>e(m)}};return {clearAll:s,open:r=>o({children:r}),right:r=>o({children:r,from:ae.Right}),left:r=>o({children:r,from:ae.Left}),top:r=>o({children:r,from:ae.Top}),bottom:r=>o({children:r,from:ae.Bottom}),close:e}},ei=ja;var oi=(t,s,e={})=>{let[n,o]=useState(null),[r,m]=useState(false),{duration:i=.25,curve:c=F.EaseOutBack,borderRadius:l={from:40,to:24},targetWidth:a=320}=e;return useLayoutEffect(()=>{s&&t.current?(o(t.current.getBoundingClientRect()),m(true)):s||m(false);},[s,t]),{style:ie({from:{opacity:0,width:n?.width,height:n?.height,borderRadius:l.from},to:{opacity:1,width:a,height:"auto",borderRadius:l.to},curve:c,duration:i,when:r&&s}).style,isMeasured:r,sourceRect:n}},ri=oi;var si=()=>{let t=useContext(pe);if(!t)throw new Error("useContextMenu must be used inside <LayersProvider>");return {showContextMenu:(n,o,r)=>{n.preventDefault(),t.openMenu({event:n,items:o,origin:r});},showMenu:(n,{items:o,origin:r,offsetX:m,offsetY:i,transition:c,curve:l,arrow:a,duration:f,header:u,footer:d})=>{t.openMenu({fx:{transition:c,curve:l,duration:f},parent:n,items:o,origin:r||We.TopCenter,offsetX:m,offsetY:i,arrow:a,header:u,footer:d});},hide:t.clear}},ai=si;var Vr=({ref:t,style:s,...e})=>{let n=useRef(null),o=useMemo(()=>t&&typeof t!="function"&&t.current?t:n,[t]),{style:r,className:m,rest:i}=N(e,o);return jsx("div",{ref:t||n,style:{...r,...s||{}},className:m,...i})};Vr.displayName="Zuz.Box";var p=Vr;var $r=forwardRef((t,s)=>{let{title:e,message:n,...o}=t,[r,m]=useState(false);return jsxs(p,{className:"--accordion flex cols",...o,children:[jsxs(z,{onClick:i=>m(!r),className:`--toggle flex aic ${r?"--open":""}`.trim(),children:[jsx(H,{className:"--label flex",children:e}),jsx(p,{className:"--arrow flex",children:r?D.arrowUp:D.arrowDown})]}),r&&jsx(p,{className:"--detail",children:n})]})});$r.displayName="Zuz.Accordion";var ui=$r;var fi=({label:t,icon:s,onClick:e,idx:n,selected:o})=>jsx(z,{onClick:e,onMouseMove:r=>document.documentElement.style.setProperty("--tip-m",`${n}`),className:`--action ${o?"--selected":""} aic jcc rel`.trim(),children:typeof s=="string"?jsx(Y,{name:s}):s}),_r=fi;var Fr=forwardRef((t,s)=>{let{items:e,name:n,selected:o,position:r,...m}=t,i=useRef(null),[c,l]=useState(o||e[0].tag||0),a=useCallback(({x:S,y:h})=>{if(i.current){let v=i.current.getBoundingClientRect();document.documentElement.style.setProperty("--tip-x",`${S-v.left}`),document.documentElement.style.setProperty("--tip-y",`${h-v.top}`),document.documentElement.style.setProperty("--tip-s","1");}},[]),f=useCallback(()=>{i.current&&(i.current.removeEventListener("pointerleave",f),i.current.removeEventListener("pointermove",a),document.documentElement.style.setProperty("--tip-s","0"));},[]),u=useCallback(()=>{i.current&&(i.current.addEventListener("pointerleave",f),i.current.addEventListener("pointermove",a));},[]);useEffect(()=>{i.current&&(document.documentElement.style.setProperty("--tip-w",e.reduce((S,h)=>h.label.length>S.length?h.label:S,"").length.toString()),document.documentElement.style.setProperty("--tip-s","0"),document.documentElement.style.setProperty("--tip-l",`${e.length}`),i.current?.addEventListener("pointerenter",u));},[]);let{className:d,style:T,rest:x}=N(m);return jsxs(p,{ref:i,style:T,className:[`--actionbar flex aic ${d}`,`${!r||r==oe.Auto?"rel":`--${r}`}`].join(" ").trim(),...x,children:[e.map((S,h)=>jsx(_r,{selected:c===S.tag||o==h,...S,idx:h},`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,"-")}`))})})]})});Fr.displayName="Zuz.ActionBar";var yi=Fr;var Kr=forwardRef((t,s)=>{let{type:e,icon:n,title:o,message:r,iconSize:m,...i}=t,{className:c,style:l,rest:a}=N(i);return jsxs(p,{className:`--alert --${e||me.Info} flex aic ${c}`.trim(),style:l,...a,children:[jsx(p,{className:`--icon icon-${n||"auto-matic"}`,style:m?{fontSize:m,width:m,height:m}:{},children:!n&&D[e||me.Info]}),jsxs(p,{className:"--meta flex cols",children:[jsx(H,{className:`--title ${r?"--tm":""}`,children:o||"Lorem ipsum dolor sit amet, consectetur adipiscing elit."}),r&&jsx(H,{className:"--message",h:2,children:r})]})]})});Kr.displayName="Zuz.Alert";var vi=Kr;var Wr=({ref:t,...s})=>{let{variant:e,numeric:n,onConfirm:o,...r}=s,{style:m,className:i,rest:c}=N(r),{variant:l}=X(true),a=f=>{n&&(f.currentTarget.value=f.currentTarget.value.replace(/[^0-9.]/g,"").replace(/(\..*?)\..*/g,"$1"));};return jsx("input",{className:`--input --${e||l} flex ${i}`.trim(),style:m,onInput:a,onKeyDown:f=>{f.key=="Enter"&&o?.(f.currentTarget.value);},ref:t,...c})};Wr.displayName="Zuz.Input";var re=Wr;var Gr=t=>{let{meta:s,children:e}=t,n=useDelayed(),{label:o,icon:r,...m}=isValidElement(s)?{}:s,{className:i,style:c,rest:l}=N({...m,...m.animate?{animate:{...m.animate,when:n}}:{}});return isValidElement(s)?jsx("li",{style:c,className:i,children:s}):jsxs("li",{style:c,className:i,...l,children:[e,typeof s=="string"?s:o]})};Gr.displayName="Zuz.ListItem";var qr=Gr;var Yr=forwardRef((t,s)=>{let{items:e,variant:n,direction:o,seperator:r,ol:m,...i}=t,{className:c,style:l,rest:a}=N(i),f=m==true?"ol":"ul";return createElement(f,{className:`--list --${n||W.Small} flex ${o??"cols"} ${c}`.trim(),style:l,ref:s,...a,children:e.map((u,d,T)=>{let x=`${typeof u=="string"?`li-${String(u)}`:isValidElement(u)?`li-${u.key}`||`${d}-${MD5(u.toString())}`:u.label}-${d}`;return jsxs(Fragment,{children:[jsx(qr,{meta:u}),r&&T[d+1]?jsx("li",{className:"--list-seperator",children:r},`spt-${d+1}-${x}`):null]},x)})})});Yr.displayName="Zuz.List";var Me=Yr;var Jr=forwardRef((t,s)=>{let{fx:e,action:n,data:o,withStyle:r,onChange:m,...i}=t,{className:c}=N({as:r||""}),{style:l}=N(i),[a,f]=useState(false),[u,d]=useState(o||[]),T=useRef(null),x=useRef(null),S=useRef(null),h=useMemo(()=>i.name||uuid(12),[]),[v,g]=useState(null),[C,E]=useState(null),[R,P]=useState([]),O=useDebounce(w=>{w.target.value==""?(f(false),d([])):n&&w.target.value.trim()!=""&&withPost(n,{query:w.target.value}).then(k=>{"items"in k&&_(k.items).isArray()?(d(k.items),E(w.target.value),P(k.items)):console.error("Action Response should contain items array"),g(null);}).catch(k=>{g(null),d([]);});},250),L=()=>{if(x.current){let w=x.current.getBoundingClientRect(),k=window.innerHeight-w.bottom,$=w.top;if(S.current){let U=S.current;k<U.offsetHeight&&$>k?(U.style.top="auto",U.style.bottom=`${w.height}px`,U.style.maxHeight=`${$-150}px`):(U.style.top=`${w.height+5}px`,U.style.bottom="auto",U.style.maxHeight=`${k-150}px`);}}},A=w=>{if(u.length>0){if((w.key==="ArrowDown"||w.key==="ArrowUp")&&(w.preventDefault(),w.stopPropagation()),w.key==="Escape")g(null),f(false),d([]);else if(w.key==="ArrowDown")g(k=>{let $=k===null||k===u.length-1?0:k+1;return _$1($),$});else if(w.key==="ArrowUp")g(k=>{let $=k===null||k===0?u.length-1:k-1;return _$1($),$});else if(w.key==="Enter"&&v!==null){let k=u[v];T.current&&(T.current.value=k,f(false),d([]));}}},B=w=>{T.current&&(T.current.value=w,f(false),d([]));},_$1=w=>{let k=u[w];if(k&&T.current&&(T.current.value=k,T.current.setSelectionRange(k.length,k.length)),S.current){let U=S.current.children[w];U&&U.scrollIntoView({block:"nearest"});}},K=w=>{x.current&&!x.current.contains(w.target)&&(f(false),d([]));},q=()=>{T.current&&T.current.value===C&&(d(R),g(null),L());};return useEffect(()=>(window.addEventListener("resize",L),window.addEventListener("scroll",L,true),document.addEventListener("mousedown",K),()=>{window.removeEventListener("resize",L),window.removeEventListener("scroll",L,true),document.removeEventListener("mousedown",K);}),[]),useEffect(()=>{L();},[u]),jsxs(p,{style:l,ref:x,className:`--autocomplete --${t.size||W.Small} flex aic rel ${c}`.trim(),children:[jsx(re,{ref:T,autoComplete:"off",onChange:O,onKeyDown:A,onFocus:q,...i}),jsx(p,{className:"--arrow rel flex aic jcc",children:u.length>0?D.arrowUp:D.arrowDown}),u.length>0&&jsx(Me,{id:h,ref:S,className:"--suggestion-list flex cols abs",items:u.map((w,k)=>({label:w,onClick:$=>{$.preventDefault(),$.stopPropagation(),B(w);},className:v===k?"--current":"",animate:{transition:G.SlideInBottom,curve:F.EaseInOut,delay:clamp(.02*k,.02,.5)}}))})]})});Jr.displayName="Zuz.AutoComplete";var $i=Jr;var jr=forwardRef((t,s)=>{let e=useRef(null),n=useMemo(()=>s&&typeof s!="function"&&s.current?s:e,[s]),{style:o,className:r,rest:m}=N(t,n);return !m.src||m.src==""?null:jsx("img",{ref:n,style:o,className:`${r} flex`,...m})});jr.displayName="Zuz.Image";var et=jr;var en=forwardRef((t,s)=>{let{src:e,variant:n,type:o,crossOrigin:r,referrerPolicy:m,fx:i,as:c,alt:l,color:a,style:f,...u}=t,[d,T,x]=useImage(e??"",r,m),{className:S,style:h,rest:v}=N({fx:i,as:c});return jsx(p,{className:`--avatar --${n||W.Small} --${(o||Wo.Circle).toLowerCase()} rel flex aic jcc ${S}`.trim(),style:{background:a||"var(--primary)",...f,...h},...v,children:e?jsx(et,{src:d,crossOrigin:r,referrerPolicy:m,...u}):jsx(H,{className:"--avatar-label",children:(l?l.charAt(0):"A").toUpperCase()})})});en.displayName="Zuz.Avatar";var Gi=en;var qi=({size:t=5,type:s="dead",label:e="",variant:n=W.Small,loading:o=false,...r})=>{let{style:m,className:i,rest:c}=N(r);return jsxs(p,{style:{..._(e).isEmpty()?{width:`${t+4}px`,height:`${t+4}px`}:{},...m},as:`--badge --${n} --${s} rel flex aic jcc ${i}`.trim(),children:[jsx(p,{fx:{transition:G.FadeIn,curve:F.Liquid,duration:.5,when:o},as:"abs abc",children:jsx(he,{})}),_(e).isEmpty()?jsx(p,{style:{width:`${t}px`,height:`${t}px`},as:`--dot --${s}`}):jsx(H,{as:"--label",children:e})]})},Xi=qi;var ml=[{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,s=t.getDay();return addDays(t,(6-s)%7||6)},getDateFormat:()=>{let t=new Date,s=t.getDay();return format(addDays(t,(6-s)%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)}],cl=t=>{let s=new Set;return t.filter(e=>{if(e.label=="Later")return true;let n=e.getDate().toISOString().split("T")[0];return s.has(n)?false:(s.add(n),true)})},on=forwardRef((t,s)=>{let{defaultValue:e,variant:n,onChange:o,...r}=t,{style:m,className:i,rest:c}=N(r),[l,a]=useState(e||new Date),f=startOfMonth(l),u=endOfMonth(l),d=startOfWeek(f),T=endOfWeek(u),x=useMemo(()=>eachDayOfInterval({start:d,end:T}),[d,T]),S=g=>{o?.(g),a(g);},h=()=>{a(g=>new Date(g.getFullYear(),g.getMonth()-1));},v=()=>{a(g=>new Date(g.getFullYear(),g.getMonth()+1));};return jsxs(p,{as:`--calendar flex --${n||"sm"} ${i}`,style:m,children:[jsx(p,{as:"--calendar-quick-select flex cols flex:1",children:cl(ml).map(g=>{let C=g.getDate();return jsxs(z,{onClick:()=>S(C),as:["--calendar-quick-option flex aic gap:5"],children:[jsx(H,{as:"flex:1",children:g.label}),jsx(H,{as:"tar",children:g.getDateFormat()})]},`--dtp-option-label-${g.label}`)})}),jsxs(p,{as:"--calendar-selector flex cols flex:1",children:[jsxs(p,{as:"--calendar-head flex aic jcc gap:4",children:[jsx(H,{as:"flex:1 --calendar-cm bold",children:format(l,"MMMM yyyy")}),jsx(z,{onClick:h,as:"--calendar-chevron",children:D.chevronUpOutline}),jsx(z,{onClick:v,as:"--calendar-chevron",children:D.chevronDownOutline})]}),jsxs(p,{as:"--calendar-days gap:4",children:[["Su","Mo","Tu","We","Th","Fr","Sa"].map(g=>jsx(H,{as:"--calendar-day",children:g},`--calendar-hd-${g}`)),x.map((g,C)=>{let E=isSameMonth(g,l),R=isSameDay(g,l),P=isToday(g);return jsx(z,{disabled:!E,onClick:()=>S(g),as:["--calendar-day --calendar-dd",`${R?"--calendar-dd-selected":""}`,`${P?"--calendar-dd-current":""}`],children:format(g,"d")},`--calendar-day-${C}-${g.getFullYear()}-${g.getMonth()}-${g.getDay()}`)})]})]})]})});on.displayName="Zuz.Calendar";var co=on;var rn=(s=>(s.Line="line",s))(rn||{});var an=forwardRef((t,s)=>{let{data:e,width:n,height:o,lineColor:r,strokeWidth:m=2,gradientStartColor:i,gradientEndColor:c,animated:l,animDuration:a=2,animDelay:f=0,padding:u=0,type:d,...T}=t,{className:x,style:S,rest:h}=N(T),v=useRef(null),g=useResizeObserver(v.current?.parentElement||v),C=typeof n=="number"?n:g.width,E=typeof o=="number"?o:g.height,R={width:C,height:E},P=useId(),{pathD:I,areaPathD:O}=useLineChart(e,R,u+(m||2)),L=useRef(null),A=useRef(null),[B,_]=useState(0),[K,q]=useState(0);return useEffect(()=>{l&&(L.current&&_(L.current.getTotalLength()),A.current&&q(A.current.getTotalLength()));},[l,I,O,C,E]),jsx(p,{ref:v,as:`--chart --${d||"line"}-chart ${x}`.trim(),style:{...S,width:n,height:o},...h,children:C>0&&E>0&&jsxs("svg",{viewBox:`0 0 ${C} ${E}`,preserveAspectRatio:"xMidYMid meet",children:[jsx("defs",{children:jsxs("linearGradient",{id:P,x1:"0%",y1:"0%",x2:"0%",y2:"100%",children:[jsx("stop",{offset:"0%",stopColor:i}),jsx("stop",{offset:"100%",stopColor:c})]})}),jsx("path",{ref:A,d:O,fill:`url(#${P})`,stroke:"none",style:l?{strokeDasharray:K,strokeDashoffset:K}:{},children:l&&jsx("animate",{attributeName:"stroke-dashoffset",from:K,to:"0",dur:`${a||2}s`,begin:`${f||0}s`,fill:"freeze"})}),jsx("path",{ref:L,d:I,fill:"none",stroke:r,strokeWidth:m,strokeLinecap:"round",strokeLinejoin:"round",style:l?{strokeDasharray:B,strokeDashoffset:B}:{},children:l&&jsx("animate",{attributeName:"stroke-dashoffset",from:B,to:"0",dur:`${a||2}s`,begin:`${f||0}s`,fill:"freeze"})})]})})});an.displayName="Zuz.Chart";var hl=an;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 pn=forwardRef((t,s)=>{let{progress:e,type:n,animated:o,...r}=t,m=useRef(null);useImperativeHandle(s,()=>({setProgress:a=>{m.current.style.width=`${a*100}%`;}}),[]),useEffect(()=>{e&&m.current&&(o?setTimeout(()=>m.current.style.width=`${e*100}%`,500):m.current.style.width=`${e*100}%`);},[e,m.current]);let{className:i,style:c,rest:l}=N(r);return jsx(p,{className:`--progress ${o?"--animated":""} flex rel ${i}`.trim(),style:c,...l,children:jsx(p,{ref:m,className:"--bar rel"})})});pn.displayName="Zuz.ProgressBar";var uo=pn;var un=forwardRef((t,s)=>{let{text:e,media:n,side:o="me",status:r=1,timeStamp:m=Date.now(),arrow:i=true,...c}=t,{className:l,style:a,rest:f}=N(c);return jsx(p,{className:`--bubble-wrapper flex --bw-${o}`.trim(),children:jsxs(p,{className:`--bubble --bubble-${o} ${n?`--with-media --bma-${n.type}`:""} rel flex cols ${i==true?"--b-arrow":""} ${l}`.trim(),style:{...a},...f,children:[e&&jsx(H,{className:"--bubble-text",children:e}),n?n.type=="audio"?jsxs(p,{as:"flex aic --bubble-audio",children:[jsx(ee,{className:"--bm-action",children:D.play}),jsx(uo,{progress:.7}),jsx(H,{className:"--bm-dur",children:n.duration??"00:13"})]}):n.type=="img"?jsx(p,{as:"--bubble-image",children:jsx(et,{src:n.source})}):null:null,jsxs(p,{as:"flex aie jce --bubble-stats",children:[jsx(H,{className:"--bubble-stamp tar",children:timeSince(m)}),o=="me"&&jsx(ee,{className:`--bubble-status --bs-${r}`,children:r==0?D.pending:r==1?D.done:r==2?D.doneAll:D.doneAll})]})]})})});un.displayName="Zuz.Bubble";var Cl=un;var fn=forwardRef((t,s)=>{let{style:e,className:n,rest:o}=N(t);return jsx("label",{ref:s,style:e,className:n,...o})});fn.displayName="Zuz.Label";var ot=fn;var dn=forwardRef((t,s)=>{let{name:e,required:n,type:o,value:r,size:m,variant:i,checked:c,onSwitch:l,...a}=t,[f,u]=useState(c||false),d=useRef(null),{variant:T}=X(true);return useImperativeHandle(s,()=>({setChecked(x,S=true){u(x),d.current&&(d.current.checked=x),S&&l&&l(x,r||"cb");},toggle(x=true){d.current&&(d.current.checked=!f),x&&l&&l&&l(!f,r||"cb"),u(!f);}})),jsxs(ot,{className:`--${(o||we.Default).toLowerCase()} ${!o||o==we.Default?"--checkbox":"--switch"} --${i||T||W.Small} flex aic jcc ${f?"is-checked":""} rel`.trim(),...a,children:[(!o||o==we.Default)&&D.check,jsx(re,{ref:d,defaultChecked:f,value:r||"cb",type:"checkbox",className:"abs",name:e,required:n||false,onChange:x=>{l&&l(x.target.checked,r||"cb"),u(x.target.checked);}})]})});dn.displayName="Zuz.CheckBox";var rt=dn;var kl=({ref:t,...s})=>{let{code:e,lang:n="tsx",showLines:o=false,highlight:r="",as:m,fx:i,...c}=s,l=useRef(null),{className:a,style:f,rest:u}=N({as:`rel p:20 br:8 bg:shade-1 overflow:auto font:mono ${m}`,fx:i},l),d=useMemo(()=>{let x=new Set;return r.split(",").forEach(S=>{if(S.includes("-")){let[h,v]=S.split("-").map(Number);for(let g=h;g<=v;g++)x.add(g);}else S&&x.add(Number(S));}),x},[r]),T=useMemo(()=>{let x=e.split(`
9
- `);for(;x.length>0&&x[0].trim()==="";)x.shift();for(;x.length>0&&x[x.length-1].trim()==="";)x.pop();let S=x[0]?.match(/^\s*/)?.[0].length||0,h=x.map(g=>{let C=g.match(/^\s*/)?.[0].length||0,E=Math.min(C,S);return g.slice(E)}),v=[{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 h.map((g,C)=>{let E=g.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),R=d.has(C+1),P=[];v.forEach(I=>{E=E.replace(I.re,O=>{let L=`ZUZ_ID_${P.length}_ZUZ`;return P.push(`<span class="--token-${I.name}">${O}</span>`),L});});for(let I=P.length-1;I>=0;I--)E=E.replace(`ZUZ_ID_${I}_ZUZ`,P[I]);return `<div class="--code-line ${o==true?"--with-ln":""} ${R?"--is-highlighted":""}">
10
- ${o==true?`<span class="--line-number">${C+1}</span>`:""}
11
- <span class="--line-content">${E||" "}</span>
12
- </div>`}).join("")},[e,d]);return jsx(p,{as:`--code-block ${a}`,style:f,...c,children:jsx("pre",{ref:t,children:jsx("code",{className:`--code --lang-${n}`,dangerouslySetInnerHTML:{__html:T}})})})},Ol=kl;var hn=({onSelect:t,meta:s,selected:e})=>{let n=useRef(null),{index:o,icon:r,label:m}=s,[i,c]=useState({x:0,width:0}),l=useDelayed();return useLayoutEffect(()=>{if(l&&n.current){let{width:a,x:f}=n.current.getBoundingClientRect();c({x:f,width:a}),e&&t(o,a,f,s,true);}},[l,n.current]),useEffect(()=>{e&&t(o,i.width,i.x,s,false);},[e]),jsxs(z,{onClick:()=>t(o,i.width,i.x,s,false),ref:n,className:`--segment-item flex aic rel ${e?"--segment-active":""}`.trim(),children:[r?typeof r=="string"?jsx(Y,{name:r,as:"--segment-icon"}):jsx(p,{as:"--segment-icon flex aic jcc",children:r}):null,m&&String(m).trim()!=""&&jsx(p,{className:"--segment-label",children:m||`Item ${o}`})]})};hn.displayName="SelectTabItem";var xn=hn;var bn=forwardRef((t,s)=>{let{fx:e,items:n,selected:o,variant:r,onSwitch:m,...i}=t,[c,l]=useState(o||0),a=useRef(false),f=useRef(c),{className:u,style:d,rest:T}=N(i),x=useRef(null),S=useRef(null),{variant:h}=X(true),v=(g,C,E,R,P)=>{if((P||c!=g&&c!=-2)&&(l(g),f.current=c,a.current&&m?.(R)),x.current){let I=S.current?.getBoundingClientRect();x.current.style.setProperty("--w",`${C}px`),x.current.style.setProperty("--x",`${I?E-I.left:E}px`);}};return useImperativeHandle(s,()=>({setSelected:g=>{typeof g=="number"&&g!=c&&l(g);}}),[c]),useEffect(()=>{a.current=true;},[]),jsxs(p,{ref:S,"data-selected":c,className:`${u} --segmented --${r||h||W.Medium} flex aic rel`,style:d,...T,children:[jsx(p,{ref:x,className:"--segment-tab abs"}),n.map((g,C)=>jsx(xn,{onSelect:v,selected:c==C,meta:{...g,index:C}},`segment-${g.label}-${C}`))]})});bn.displayName="Zuz.SelectTabs";var nt=bn;var Sn=forwardRef((t,s)=>{let{type:e,...n}=t,o=useDelayed(),{colorScheme:r,setColorScheme:m}=Ft(),i=useCallback(()=>{m(r=="dark"?"light":r=="light"?"system":"dark");},[r]),{className:c,style:l}=N(n),a=useMemo(()=>e=="system"?[{tag:"light",index:0,label:"",icon:D.colorSchemeLight},{tag:"system",index:1,label:"",icon:D.colorSchemeSystem},{tag:"dark",index:2,label:"",icon:D.colorSchemeDark}]:[{tag:"light",index:0,label:"",icon:D.colorSchemeLight},{tag:"dark",index:2,label:"",icon:D.colorSchemeDark}],[]),f=useMemo(()=>["light","system","dark"].indexOf(r),[r]);return !o||f==-1?null:e=="system"||e=="switch"?jsx(nt,{className:`--color-scheme --${e}`,onSwitch:({tag:u})=>{m(u);},selected:f,items:a,...n}):jsx(z,{onClick:i,style:l,as:`--color-scheme-switch --${n.variant||W.Small} ${c}`.trim(),children:r=="system"?D.colorSchemeSystem:r=="light"?D.colorSchemeLight:D.colorSchemeDark})});Sn.displayName="Zuz.ColorScheme";var Xl=Sn;var Tn=forwardRef((t,s)=>{let[e,n]=useState("wait"),{title:o,message:r,acceptLabel:m,rejectLabel:i,position:c}=t,l=async a=>{n(a==1?"accepted":"rejected"),localStorage.setItem("--ccnt",String(a));};return useEffect(()=>{let a=localStorage.getItem("--ccnt");n(a?a=="1"?"accepted":"rejected":"pending");},[]),jsxs(p,{fx:{from:{x:-1e3},to:{x:0},when:e=="pending",curve:F.EaseInOut,duration:.5,delay:e=="accepted"?0:3},as:`--cookie-consent --${e} --${c||oe.Left} flex cols`,children:[jsx(H,{as:"--title",children:o||"This site uses cookies"}),jsx(H,{as:"--message",children:r||"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:a=>l(1),as:"--accept",children:m||"Accept All"}),jsx(z,{onClick:a=>l(0),as:"--reject",children:i||"Cancel"})]})]})});Tn.displayName="Zuz.CookiesConsent";var jl=Tn;var In=forwardRef((t,s)=>{let {type:e,value:n,min:o,max:r,step:m,onChange:i,roundValue:c,...l}=t,{className:a,style:f,rest:u}=N(l),d=useRef(m||.01).current,T=useRef(o||0).current,x=useRef(r||1).current,S=useRef(n||0).current,h=useRef(null),v=useRef(null),g=useRef(null);useRef(null);let E=useRef(null),R=useRef(null),P=($,U,V)=>($-U)/(V-U)*100,I=$=>{if(v.current){let U=parseFloat($.currentTarget.value),V=P(U,parseFloat($.currentTarget.min),parseFloat($.currentTarget.max));v.current.style.setProperty("--value",`${V}`),v.current.setAttribute("data-value",`${U}`),i&&i(c?+U.toFixed(2):U);}},[O,L]=useState(false),[A,B]=useState(0),[_,K]=useState(0),q=$=>{L(true),B($.clientX),K(v.current?parseFloat(v.current.getAttribute("data-value")):0),document.body.style.cursor="ew-resize";},w=$=>{if(O){let U=$.clientX-A,V=Math.max(T,Math.min(_+U*d,x));v.current&&(v.current.setAttribute("data-value",`${V}`),R.current.textContent=c?V.toFixed(2):V.toString(),i&&i(c?+V.toFixed(2):V));}},k=()=>{L(false),document.body.style.cursor="auto";};return useEffect(()=>{v.current&&v.current.style.setProperty("--value",h.current?`${P(parseFloat(h.current.value),parseFloat(h.current.min),parseFloat(h.current.max))}`:S.toString());},[]),useEffect(()=>(O?(document.addEventListener("mousemove",w),document.addEventListener("mouseup",k)):(document.removeEventListener("mousemove",w),document.removeEventListener("mouseup",k)),()=>{document.removeEventListener("mousemove",w),document.removeEventListener("mouseup",k);}),[O]),jsx(p,{ref:v,"data-value":S||0,className:`--slider --${e||pt.Default} flex rel ${a}`.trim(),style:{...f},children:pt.Text===e?jsx(Fragment$1,{children:jsx(H,{ref:R,onMouseDown:q,className:"--slider-text",children:S||0})}):jsxs(Fragment$1,{children:[jsx(p,{ref:E,className:"--slider-track abs fill"}),jsx(p,{ref:g,className:"--slider-knob abs"}),jsx(re,{ref:h,onInput:I,className:"abs fill",tabIndex:0,type:e||pt.Default,defaultValue:S||0,step:d,max:x,min:T})]})})});In.displayName="Zuz.Slider";var yo=In;var En=forwardRef((t,s)=>{let{src:e,shape:n,size:o,...r}=t,{style:m,className:i,rest:c}=N(r),{canvasRef:l,crop:a,setScale:f,handleMouseDown:u,handleMouseUp:d,handleMouseMove:T}=useImageCropper(e,o||200,n||CropShape.Circle);return useImperativeHandle(s,()=>({getCropped(){return a()},setScale(x){f(x);}})),jsxs(p,{as:`--cropper --${n||CropShape.Circle} ${i}`,style:m,...c,children:[jsx("canvas",{ref:l,width:o||200,height:o||200,onMouseDown:u,onMouseUp:d,onMouseLeave:d,onMouseMove:T}),jsx(p,{as:"--cropper-slider",children:jsx(yo,{onChange:x=>f(x),min:0,max:1,step:.01,value:1})})]})});En.displayName="Zuz.Cropper";var sm=En;var im=(e=>(e.Circle="circle",e.Square="square",e))(im||{});var Ln=forwardRef((t,s)=>{let{items:e,maxItems:n}=t,o=useMemo(()=>{let i=typeof e=="string",c=i?[]:e;return i&&e.split(",").forEach(l=>{c.push({label:l});}),c},[e]),m=useMemo(()=>n&&n>0&&o.length>n-1,[o,n])?[...o.slice(0,2),{ID:".",label:"...",icon:"ellipsis",action:()=>{}},...o.slice(-n)]:o;return jsx(Me,{ref:s,className:"--crumb flex aic",direction:"rows",seperator:jsx(p,{as:"--crumb-chevron",children:D.chevronRightOutline}),items:m.map((i,c,l)=>i.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-${c}`))}):jsxs(z,{onClick:()=>i.action?.(),className:"--crumb-item",disabled:!l[c+1],children:[i.icon&&jsx(Y,{as:"--crumb-icon",name:i.icon}),jsx(H,{as:"--crumb-label",children:i.label})]},`${i.label.replace(/\s+/g,"-").toLowerCase()}-${c}`))})});Ln.displayName="Zuz.Crumb";var mm=Ln;var On=forwardRef((t,s)=>{let{icon:e,defaultValue:n,value:o,size:r,variant:m,numeric:i,type:c,onConfirm:l,...a}=t,[f,u]=useState(false),[d,T]=useState(n||null),{style:x,className:S,rest:h}=N(a),v=useRef(null),g=useRef(null),{reposition:C}=Ge(g,{direction:oe.Bottom,offset:2}),E=P=>{i&&(P.currentTarget.value=P.currentTarget.value.replace(/[^0-9.]/g,"").replace(/(\..*?)\..*/g,"$1"));};useEffect(()=>{let P=I=>{let O=I.target,L=v.current?.contains(O),A=g.current?.contains(O);!L&&!A&&u(false);};return f&&document.addEventListener("mousedown",P),()=>{document.removeEventListener("mousedown",P);}},[f]),useEffect(()=>{let P=I=>{I.key==="Escape"&&f&&(u(false),v.current?.focus());};return document.addEventListener("keydown",P),()=>document.removeEventListener("keydown",P)},[f]);let R=()=>{u(true);};return useEffect(()=>{f&&C();},[f,C]),jsx(Fragment$1,{children:jsxs(p,{as:`--date-picker ${m?`--${m}`:""} rel flex aic ${S}`,"data-value":d?d.toISOString():"",children:[e?typeof e=="string"?jsx(Y,{as:"mr:10 c:#666",name:e}):e:jsx(ee,{as:"--date-picker-icon flex aic jcc",children:D.calendar}),jsx("input",{ref:v,value:d?format(d,"EEE, MMM d YYY hh:mm a"):o||"",className:`--input ${m?`--${m}`:""} flex`.trim(),style:x,onFocus:R,onInput:E,autoComplete:"new-password",onKeyDown:P=>{P.key=="Enter"&&l?.(P.currentTarget.value);},...h}),jsx(p,{"aria-hidden":!f,ref:g,fx:{from:{y:5,opacity:0},to:{y:0,opacity:1},when:f,duration:.05},as:`--date-picker-chooser flex aic ${m?`--${m}`:""}`,children:jsx(co,{defaultValue:d,onChange:P=>{T(P),u(false);}})})]})})});On.displayName="Zuz.DatePicker";var fm=On;var Dn=forwardRef((t,s)=>{let{icon:e,variant:n,position:o}=t;return jsx(z,{className:`--fab fixed --${n||W.Large} --${o||"bottomright"}`,children:e||D.plus})});Dn.displayName="Zuz.Fab";var xm=Dn;var Hn=t=>{let{names:s,strength:e}=t,n={[ut.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-${ut.Gooey}`)};return useEffect(()=>{},[s]),jsx("svg",{xmlns:"http://www.w3.org/2000/svg",version:"1.1",children:jsx("defs",{children:(s||[ut.Gooey]).map(o=>n[o](e))})})};Hn.displayName="Zuz.Filters";var wm=Hn;var Re=null,le=null,An=forwardRef((t,s)=>{let{title:e,message:n,transition:o,curve:r,speed:m,type:i,actionPosition:c,spinner:l,loadingMessage:a,onShow:f,onHide:u,...d}=t,{className:T,style:x,rest:S}=N(d),[h,v]=useState(e||""),[g,C]=useState(n||""),[E,R]=useState(null),[P,I]=useState(i||ce.Default),O=useMemo(()=>uuid(12),[]),[L,A]=useState(false),B=useRef(null),_=useRef(null),[K,q]=useState(false),[w,k]=useState(true),$=useRef(null),U=g;useImperativeHandle(s,()=>({setLoading(Z){q(Z);},showDialog(Z,Q,j,te){Re&&(clearTimeout(Re),le&&clearTimeout(le),B.current.classList.remove("--wobble"),setTimeout(()=>B.current.classList.add("--wobble"),50),le=setTimeout(()=>{B.current.classList.remove("--wobble"),le=null;},500)),I(ce.Dialog),Q&&C(Q),Z&&v(Z),j&&R(j.reduce((de,ge)=>(de.push({...ge,key:ge.key||uuid(12)}),de),[])),A(true),setTimeout(()=>te?te():()=>{},1e3);},dialog(Z,Q,j,te){Re&&(clearTimeout(Re),le&&clearTimeout(le),B.current.classList.remove("--wobble"),setTimeout(()=>B.current.classList.add("--wobble"),50),le=setTimeout(()=>{B.current.classList.remove("--wobble"),le=null;},500)),I(ce.Dialog),C(Q),v(Z),j&&R(j.reduce((de,ge)=>(de.push({...ge,key:ge.key||uuid(12)}),de),[])),A(true),setTimeout(()=>te?te():()=>{},1e3);},error(Z,Q){this.show(Z,Q,ce.Error);},warn(Z,Q){this.show(Z,Q,ce.Warn);},success(Z,Q){this.show(Z,Q,ce.Success);},show(Z,Q,j){Re&&(clearTimeout(Re),le&&clearTimeout(le),_.current=B.current.style.transform,B.current.style.transform="",B.current.classList.remove("--wobble"),setTimeout(()=>{B.current.classList.add("--wobble"),B.current.style.transform=`${_.current} scale(.9)`.trim();},50),le=setTimeout(()=>{B.current.classList.remove("--wobble"),B.current.style.transform=_.current||"",le=null;},500)),Re=setTimeout(()=>{A(false),Re=null,le=null;},(Q||4)*1e3),I(j||ce.Default),C(Z),A(true),f?.();},hide(){A(false),u?.();}}));let V=useMemo(()=>{let Z={when:L,duration:m||.3,delay:.1};if(P==ce.Dialog){if(o){let{from:Q,to:j}=Ue(o,20);return {from:Q,to:j,curve:r||F.EaseInOut,...Z}}return {from:{scale:0,x:"-50%",y:"-50%",opacity:0},to:{scale:1,x:"-50%",y:"-50%",opacity:1},curve:F.Spring,...Z}}else return {from:{scale:0,x:"-50%",y:"-10vh",opacity:0},to:{scale:1,x:"-50%",y:0,opacity:1},curve:F.Spring,...Z}},[L,P]);return useEffect(()=>{$.current&&clearTimeout($.current),L?k(true):$.current=setTimeout(()=>k(false),1e3);},[L]),P==ce.Dialog?jsxs(Fragment$1,{children:[jsx(Ee,{when:L}),jsxs(p,{className:`--sheet --sheet-${P.toLowerCase()} ${L?"is-visible":""} ${T} fixed`.trim(),style:x,fx:V,...S,ref:B,children:[jsx(xe,{when:K,spinner:l,message:a}),jsxs(p,{className:"--head flex aic rel",children:[jsx(p,{className:`--${h?"title":"dot"} flex aic rel`,children:h||""}),jsx(z,{onClick:Z=>A(false),className:"--closer abs",children:"\xD7"})]}),jsx(p,{className:`--body flex aic rel ${E?"":"--no-action"}`.trim(),children:w?U:null}),E&&jsx(p,{className:`--footer flex aic rel ${c?c==Dt.Center?"jcc":"":"jce"}`.trim(),children:E.map((Z,Q)=>jsx(z,{onClick:j=>Z.handler?Z.handler():Z.onClick?Z.onClick():console.log("onClick Handler missing"),className:"--action",children:Z.label},`sheet-${O}-action-${Z.key}`))})]})]}):jsx(p,{className:`--sheet --sheet-${P.toLowerCase()} ${T} abs`.trim(),style:x,...S,fx:V,ref:B,children:L?g:null})}),at=t=>typeof t=="object"&&t!=null&&"setLoading"in t&&"success"in t&&"error"in t;An.displayName="Zuz.Sheet";var Pm=An;var $n=({ref:t,...s})=>{let{name:e,cover:n,spinner:o,errors:r,action:m,children:i,withData:c,beforeSubmit:l,onSubmit:a,onError:f,onSuccess:u,resetOnSuccess:d,...T}=s,{className:x,style:S,rest:h}=N(T),[v,g]=useState(false),C=useRef(null),E=useRef(null),R=useRef(null),P=ro(),I=useCallback(w=>C.current?C.current.querySelectorAll(w):[],[C.current]),O=w=>({name:w.name||w.getAttribute("name")||w.getAttribute("data-name"),required:w.required?true:w.getAttribute("data-required")?w.getAttribute("data-required")=="true":false,with:w.with||w.getAttribute("with")}),L=w=>{let k=[];return w.querySelectorAll(".--input").forEach($=>{k.push($.value);}),k.join("")},A=useCallback(w=>{let{required:$}=O(w);if($){if(w.type=="checkbox"&&w.checked==false)return false;if(w.classList.contains("--otp")){let V=L(w);if(V==""||V.length<parseInt(w.getAttribute("data-size")))return false}if(w.classList.contains("--select")&&w.querySelector("button.--selected").dataset.value=="-1"||w.value=="")return false}if(w.getAttribute("with")){let V=w.getAttribute("with");switch(V.includes("@")&&(V=V.split("@")[0],V=="match"&&(V=ve.MatchField)),V.toUpperCase()){case ve.IPV4:return _(w.value).isIPv4();case ve.IPV6:return _(w.value).isIPv6();case ve.Email:return _(w.value).isEmail();case ve.Uri:try{return new URL(w.value),!0}catch{return false}case ve.Password:return console.log("Add FORMVALIDATION.Password"),false;case ve.MatchField:let[Z,Q,j]=w.getAttribute("with").split("@"),te=document.querySelector(`[name=${Q.trim()}]`);if(!te)return false;switch(j||"direct-match"){case "if-not-empty":if(te&&!_(te.value).isEmpty()&&te.value!=w.value)return false;break;case "direct-match":if(te&&te.classList.contains("--otp")&&w.classList.contains("--otp")&&L(te)!=L(w))return false;if(te&&te.value!=w.value)return false;break}break;default:return true}}return true},[C.current]),B=useCallback(()=>{let w={},k={},$=null,U=null;if(Array.from(I("[name]")).forEach(V=>{let{name:Z,required:Q,with:j}=O(V),te=true;(Q||j)&&(te=A(V)),w[Z]={valid:te,value:V.type=="checkbox"?V.checked==true?V.value:false:V.classList.contains("--otp")?L(V):V.classList.contains("--select")?V.querySelector("button.--selected").dataset.value:V.value},k[Z]=V.type=="checkbox"?V.checked==true:V.classList.contains("--otp")?L(V):V.classList.contains("--select")?V.querySelector("button.--selected").dataset.value:V.value,te?V.classList.remove("input-with-error"):($==null&&r&&($=V,U=r[Z]),V.classList.add("input-with-error"));}),$){let V=$;if(V.classList.contains("--otp"))for(let Z of Array.from(V.querySelectorAll(".--input"))){let Q=Z;if(Q.value==""){Q.focus();break}}else V.focus();}return {error:$!=null,errorMsg:U||"Fix errors to continue...",data:w,payload:k}},[C.current]),_$1=useCallback(()=>{let{error:w,errorMsg:k,payload:$}=B();w?P.error(k):m?startTransition(async()=>{l&&l($),at(n)?n.setLoading(true):g(true),P.clearAll(),withPost(m,{...$,...c||{}}).then(U=>{let V=U;at(n)?n.setLoading(false):g(false),d&&Array.from(I("[name]")).forEach(Z=>{Z instanceof HTMLInputElement&&(Z.value="");}),u?u(V):(P.clearAll(),P.success(V.message||"Redirecting..."));}).catch(U=>{at(n)?n.setLoading(false):g(false),f?f(U):P.error(U.message||"We cannot process your request at this time.");});}):a&&a($);},[m,E.current,C.current]),K=useCallback(()=>{let w=I("[type=submit]");!w||w.length==0?console.warn("You should add at least 1 button with type=`SUBMIT`"):w.forEach(k=>{k.addEventListener("click",_$1);});},[C.current]),q=useMemo(()=>addPropsToChildren(i,w=>w.props.type=="submit",w=>({ref:R})),[i]);return useImperativeHandle(t,()=>({setLoading(w){if(w){E.current?.hide();try{P.clearAll();}catch{}}g(w);},showError(w){typeof w=="string"?P.error(w):E.current.error(w,4);},hideError(){E.current.hide();try{P.clearAll();}catch{}},init(){K();},submit(){_$1();}})),useEffect(K,[]),jsxs(p,{ref:C,style:S,className:`--form flex rel ${x} ${e?`--form-${e.replace(/\s+/g,"-")}`:""}`,propsToRemove:["withData","action","onSubmit","onSuccess","onError"],children:[!at(n)&&jsx(xe,{message:n?n.message||void 0:"working",spinner:o,color:n&&"color"in n?n.color:"#ffffff",when:v}),q]})};$n.displayName="Zuz.Form";var Om=$n;var zn=t=>{let {ref:s,cols:e,rows:n,gap:o,gapX:r,gapY:m,align:i,justify:c,inline:l,flow:a,autoCols:f,autoRows:u,template:d,...T}=t;useRef(null);let {className:S,style:h,rest:v}=N(T),g=E=>typeof E=="number"?`repeat(${E}, 1fr)`:E,C={display:l?"inline-grid":"grid",gridTemplateColumns:g(e),gridTemplateRows:g(n),gap:o,columnGap:r,rowGap:m,alignItems:i,justifyContent:c==="between"?"space-between":c==="around"?"space-around":c,gridAutoFlow:a,gridAutoColumns:f,gridAutoRows:u,gridTemplateAreas:d,...h};return jsx(p,{ref:s,as:`--grid ${S}`.trim(),style:C,...v})};zn.displayName="Zuz.Grid";var Am=zn;var _n=t=>typeof t=="string"&&t.includes("+"),Fn={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"},Zn={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 Wn=forwardRef(({children:t,keys:s,variant:e},n)=>{let o=useMemo(()=>{if(_n(s)){let r=null;return {keys:String(s).split("+").reduce((i,c,l,a)=>(a[l+1]?i.push(c):r=c.toUpperCase(),i),[]),children:r}}return {keys:s,children:String(t).toUpperCase()}},[s]);return jsxs(p,{as:`--keyboard-keys --${e||W.Small} flex aic`,children:[(Array.isArray(o.keys)?o.keys:[o.keys]).map(r=>jsx("abbr",{title:Zn[r],children:Fn[r]},r)),jsx(ee,{children:o?.children??t})]})});Wn.displayName="Zuz.KeyboardKeys";var Po=Wn;var Gn=forwardRef((t,s)=>{let e=useNetworkStatus(),{onlineMessage:n,offlineMessage:o,variant:r}=t;return jsxs(p,{fx:{from:{x:"-50%",y:200,opacity:0},to:{x:"-50%",y:0,opacity:1},when:e==false,curve:F.Spring,duration:.5,delay:2},className:`--network-manager --${e==true?"online":"offline"} --${r||W.Small} fixed flex`,children:[jsx(p,{className:"--ico",children:e?D[me.Success]:D[me.Error]}),jsx(H,{as:"--message",children:e?n||"internet connection restored :)":o||"no internet connection"})]})});Gn.displayName="Zuz.NetWorkManager";var Wm=Gn;var Ro=(e=>(e.Table="table",e.Gooey="gooey",e))(Ro||{});var Yn=forwardRef((t,s)=>{let{itemCount:e,itemsPerPage:n,startPage:o,pageRange:r,paginationStyle:m,breakLabel:i,prevLabel:c,nextLabel:l,hash:a,loading:f,seperator:u,renderOnZeroPageCount:d,onPageChange:T,...x}=t,S=useMemo(()=>toHash(numberInRange(4,8)),[]),h=useCallback(B=>`${toHash(B,a||6,S)}${u||""}${S}`,[S]),v=useMemo(()=>i||"...",[i]),[g,C]=useState({id:a?o?typeof o=="number"?h(o):o:1:o||1,label:o||1}),{style:E,className:R,rest:P}=N(x),I=useCallback(B=>typeof B=="number"?B:+B.label,[]);if(!e)throw new Error('"itemCount" prop is required');let O=useMemo(()=>Math.ceil(e/n),[e,n]),L=useMemo(()=>{let B=[],_=Math.max(I(g)-(r||2),1),K=Math.min(I(g)+(r||2),O);_>1&&B.push({id:a?h(1):1,label:1}),_>2&&B.push({id:-1,label:v});for(let q=_;q<=K;q++)B.push({id:a?h(q):q,label:q});return K<O-1&&B.push({id:-1,label:v}),K<O&&B.push({id:a?h(O):O,label:O}),B},[g]),A=useCallback(B=>{let _=B;+_.label<1||+_.label>O||(C(_),T?.(_));},[e,n,g]);return L.length<=1&&(d??false)===false?null:jsxs(p,{ref:s,as:`--pagination --pgt-${m||"table"} flex aic w:100% jcc ${R}`,children:[jsx(p,{as:"flex flex:1 aic --pgt-btns",children:(L.length>1?L:[{id:1,label:1},{id:-1,label:v}]).map((B,_,K)=>jsx(z,{disabled:B.id==-1||I(g)==+B.label,className:(typeof B=="string"?B:B.label)==I(g)?"--current-page":"",onClick:q=>A(B),children:typeof B=="string"?B:B.label},`--pg-${_}-${B.id}`))}),jsx(p,{as:"flex aic jcc flex:1 --pagination-label",children:[`Showing ${(I(g)-1)*n+1} - `,`${Math.min(I(g)*n,e)} of ${e} items`].join(" ")}),jsxs(p,{as:"flex aic jce flex:1 --pgt-btns --pgt-nav",children:[jsx(z,{disabled:I(g)<=1,onClick:B=>A({id:a?h(I(g)-1):I(g)-1,label:I(g)-1}),children:D.chevronLeftOutline}),jsx(z,{disabled:L.length<=1||I(g)==I(L[L.length-1]),onClick:B=>A({id:a?h(I(g)+1):I(g)+1,label:I(g)+1}),children:D.chevronRightOutline})]})]})});Yn.displayName="Zuz.Pagination";var No=Yn;var Jn=forwardRef((t,s)=>{let{strenthMeter:e,onChange:n,...o}=t;"type"in o&&delete o.type;let{style:r,className:m,rest:i}=N(o),[c,l]=useState(false),[a,f]=useState(""),u=useMemo(()=>checkPasswordStrength(a),[a]),d=useDebounce(T=>{e&&f(T.target.value),n&&n(T);},100);return useEffect(()=>{},[]),jsxs(p,{as:"w:100% flex cols",children:[jsxs(p,{style:r,className:"--password flex aic rel",children:[jsx(re,{ref:s,type:c?"text":"password",className:m,onChange:d,...i}),jsx(z,{tabIndex:-1,onClick:()=>l(T=>!T),className:"--toggle flex aic jcc abs",children:c?D.eye:D.eyeSlash})]}),e&&jsxs(p,{as:`flex aic --password-meter --pb-score-${u.score}`,style:r,children:[jsxs(p,{as:"--password-bars flex aic",children:[jsx(p,{as:`--pbar ${u.score>=1?"--pb-on":""}`.trim()}),jsx(p,{as:`--pbar ${u.score>=2?"--pb-on":""}`.trim()}),jsx(p,{as:`--pbar ${u.score>=3?"--pb-on":""}`.trim()}),jsx(p,{as:`--pbar ${u.score>=4?"--pb-on":""}`.trim()}),jsx(p,{as:`--pbar ${u.score>=5?"--pb-on":""}`.trim()})]}),jsx(H,{as:"--password-meter-label","aria-hidden":true,children:u.result})]})]})});Jn.displayName="Zuz.Password";var tc=Jn;var es=forwardRef((t,s)=>{let{size:e,length:n,mask:o,...r}=t,m=useRef([]),i="pinput",c=false,l={};"with"in r&&(l={with:r.with},delete r.with),"type"in r&&delete r.type,"name"in r&&(i=r.name,delete r.name),"required"in r&&(c=true,delete r.required);let{style:a}=N(r),f=u=>{let d=u.currentTarget,T=m.current[parseInt(d.dataset.index)+1],x=m.current[parseInt(d.dataset.index)-1];d.value.length===1&&T?T.focus():d.value.length===0&&x&&x.focus();};return useEffect(()=>{m.current=m.current.slice(0,e||n);},[e||n]),jsx(p,{name:i,style:a,className:"--otp flex aic rel","data-required":c,"data-size":e||n||4,...l,children:Array(e||n||4).fill(1).map((u,d)=>jsx(re,{autoComplete:"new-password","data-index":d,ref:T=>{m.current[d]=T;},numeric:true,onChange:f,maxLength:1,placeholder:o?"\xB7":"0",type:o?"password":"text",...r},`pin-${d}`))})});es.displayName="Zuz.PinInput";var sc=es;var ts=forwardRef((t,s)=>{let{children:e,className:n,name:o,required:r,type:m,value:i,variant:c,checked:l,onSwitch:a,...f}=t,[u,d]=useState(l||false),{variant:T}=X(true),x=useRef(null);return jsxs(ot,{className:`${n} --${(m||Ht.Default).toLowerCase()} --radio${!m||m==Ht.Default?"":"card"} --${c||T||W.Small} flex aic rel`.trim(),...f,children:[jsx(re,{ref:x,defaultChecked:u,value:i||"rd",type:"radio",className:"abs",name:o,required:r||false,onChange:S=>{a&&a(S.target.checked,i||"cb"),d(S.target.checked);}}),jsx(p,{className:"--dot rel",children:jsx(p,{className:"--rod abs abc"})}),jsx(p,{className:"--value",children:e})]})});ts.displayName="Zuz.Radio";var mc=ts;var os=forwardRef((t,s)=>{let{fx:e,withStyle:n,as:o,reverse:r=false,searchIcon:m=D.search,hideSearchIcon:i=false,clearIcon:c=D.close,hideClearIcon:l=false,onChange:a,onClear:f,...u}=t,{style:d,className:T}=N({as:t.as}),[x,S]=useState(""),{variant:h}=X(true),v=useRef(null),g=useMemo(()=>jsx(z,{tabIndex:-1,onClick:R=>E(),className:"--send flex aic jcc",variant:t.variant||W.Small,children:x!==""?!l&&(typeof c=="string"?jsx(Y,{name:c,as:"--search-action"}):c):!i&&(typeof m=="string"?jsx(Y,{name:m,as:"--search-action"}):m)}),[r,m,l,c,i]);"type"in t&&delete t.type;let C=R=>{S(R.target.value),a?.(R.target.value);},E=R=>{x.trim()!==""&&(S(""),a?.(""),v.current&&(v.current.value="",t.onConfirm?.("")));};return useImperativeHandle(s,()=>({focus:()=>v.current?.focus(),value:()=>v.current?.value})),useEffect(()=>{},[]),jsxs(p,{style:d,className:`--search ${r?"--search-rev":""} --${t.variant||h||W.Medium} flex aic ${typeof t.as=="string"&&t.as.includes("abs")?"":"rel"} ${T}`.trim(),children:[r&&g,jsx(re,{ref:v,onChange:C,...u}),t.shortcut&&jsx(Po,{keys:t.shortcut,as:"abs"}),!r&&g]})});os.displayName="Zuz.Search";var xc=os;var ns=({value:t,updateValue:s,o:e})=>jsxs(z,{onClick:n=>s(e),as:"--select-option-item",className:t&&(typeof e=="string"?e:e.value)==(typeof t=="string"?t:t.value)?"selected":"",children:[e.icon&&jsx(Y,{name:e.icon,as:`--select-option-icon --icon-${e.value}`,color:e.iconColor||void 0}),jsx(H,{suppressHydrationWarning:true,children:typeof e=="string"?e:e.label})]});ns.displayName="Option";var ss=ns;var is=({ref:t,...s})=>{let{selected:e,options:n,label:o,name:r,variant:m,search:i,searchPlaceholder:c,maxHeight:l,arrowDownIcon:a=D.arrowDown,arrowUpIcon:f=D.arrowUp,expanded:u,onChange:d,...T}=s,[x,S]=useState(e?typeof e=="string"?n.find(w=>w.value===e):e:n[0]),[h,v]=useState(false),[g,C]=useState(null),E=useRef(null),R=useRef(null),P=useRef(null),I=useId(),O=useMemo(()=>r||I,[]),{reposition:L}=Ge(P,{direction:Ot.Bottom,offset:2}),{variant:A}=X(true),{className:B,style:_,rest:K}=N(T),q=w=>{S(w),v(false),d&&d(w);};return useImperativeHandle(t,()=>({setSelected:w=>{if(typeof w=="string"){let k=n.find($=>$.value===w);k&&S(k);}else S(w);},getValue:()=>x||null})),useEffect(()=>{if(!h)return;let w=()=>{L();};return window.addEventListener("scroll",w,true),window.addEventListener("resize",L),()=>{window.removeEventListener("scroll",L,true),window.removeEventListener("resize",L);}},[h,L]),useEffect(()=>{if(!h){R.current&&(R.current.value=""),C(null);return}R.current?.focus(),L();let w=$=>{P.current&&!P.current.contains($.target)&&v(false);},k=setTimeout(()=>{document.addEventListener("click",w);},0);return ()=>{clearTimeout(k),document.removeEventListener("click",w);}},[h,L]),jsxs(p,{className:`--select --${u==true?"expanded":""} --${m||A} ${r?`--${r}`:""} rel`.trim(),name:O,children:[jsxs(z,{ref:E,"data-value":x?typeof x=="string"?x:x.value:x||"-1",className:`--selected flex aic rel ${B}`.trim(),withLabel:false,style:_,onClick:w=>{w.stopPropagation(),v(k=>!k);},...K,children:[jsx(H,{className:"--label",children:x?typeof x=="string"?x:x.label:o||"Choose"}),jsx(p,{className:"--svg-arrow rel flex aic jcc",children:h?typeof f=="string"?jsx(Y,{name:f,as:"--search-action"}):f:typeof a=="string"?jsx(Y,{name:a,as:"--search-action"}):a})]}),jsxs(p,{id:O,className:"--options-list flex cols abs","aria-hidden":!h,style:{maxHeight:l||"auto"},ref:P,fx:{from:{y:5,opacity:0},to:{y:0,opacity:1},when:h,duration:.05},children:[i&&jsx(p,{as:"--select-search --sticky",children:jsx(re,{ref:R,onChange:w=>{C(w.target.value==""?null:w.target.value);},className:"--search-input",placeholder:c||"Search..."})}),(g==null?n:n.filter(w=>w.label.toLowerCase().includes(g.toLowerCase())||w.value.toLowerCase().includes(g.toLowerCase()))).map(w=>jsx(ss,{updateValue:q,value:x,o:w},`option-${(typeof w=="string"?w:w.label).replace(/\s+/g,"-")}-${typeof w=="string"?w:w.value}`))]})]})};is.displayName="Zuz.Select";var Cc=is;var ls=forwardRef((t,s)=>jsx(rt,{type:we.Switch,...t,ref:s}));ls.displayName="Zuz.Switch";var Pc=ls;var cs=t=>{let{idx:s,id:e,as:n,weight:o,style:r,value:m,render:i,resize:c,sortBy:l,sortable:a,onSort:f}=t,[u,d]=useState(0),T=()=>{a&&(f?.(String(e),u==1?-1:1),d(x=>x==1?-1:1));};return jsxs(p,{style:{flex:o||1,...r},as:`--col flex aic ${n||""} ${a?"--sortable":""}`,onClick:T,children:[jsx(p,{children:m}),s==-1&&a&&l==e&&jsx(p,{as:"--arrow flex aib",children:u==1?D.arrowUp:D.arrowDown})]})};cs.displayName="Zuz.Column";var It=cs;var us=t=>{let{index:s,pubsub:e,schema:n,data:o,ids:r,styles:m,animate:i,sortBy:c,selectable:l,tableRef:a,loading:f,rowClassName:u,onSort:d,onRowClick:T,onSelect:x,onContextMenu:S}=t,h=useDelayed(),v=useMemo(()=>({transition:G.SlideInBottom,curve:F.EaseInOut,delay:.02*(s+1)}),[]),g=useRef(null),C=(R,P)=>{s==-1?e.emit(`ALL_ROWS_${R?"CHECKED":"UNCHECKED"}`,R):(x&&x(o,R),e.emit(`ROW_${R?"CHECKED":"UNCHECKED"}`,R,P));},E=(R,P,I)=>jsx(It,{idx:R,id:P,as:"--selector",pubsub:e,value:jsx(rt,{value:I,ref:g,onSwitch:C,type:we.Default})});return useEffect(()=>{let R=(L,A)=>{g.current?.setChecked(L,false);},P=(L,A)=>{let B=false;a?.current&&a.current.querySelectorAll(".--row").forEach(_=>{let K=_;if(!K.classList.contains("--row-head")){let q=K.querySelector(".--selector input[type=checkbox]");q&&q.checked&&!B&&(B=q.checked);}}),g.current.setChecked(B,false);},I=L=>{g.current?.setChecked(L,false),x&&x(o,L);},O=L=>{g.current?.setChecked(L,false),x&&x(o,L);};return s==-1?(e.on("ROW_CHECKED",R),e.on("ROW_UNCHECKED",P),()=>{e.off("ROW_CHECKED",R),e.off("ROW_UNCHECKED",P);}):(e.on("ALL_ROWS_CHECKED",I),e.on("ALL_ROWS_UNCHECKED",O),()=>{e.off("ALL_ROWS_CHECKED",I),e.off("ALL_ROWS_UNCHECKED",O);})},[]),jsxs(p,{onContextMenu:R=>S?S(R,o):null,onClick:R=>T?T(R,t.data):()=>{},...i?{fx:{...v,when:h}}:{},as:`--row flex aic ${T?"--row-clickable":""} ${s==-1?"--row-head":""} ${u||""}`,children:[s==-1&&n.map((R,P)=>{let{renderWhenHeader:I,render:O,value:L,...A}=R;return jsxs(Fragment,{children:[l&&P==0&&E(-1,`--selector-${R.id}`,"all"),jsx(It,{idx:-1,onSort:d,sortBy:c,value:L,...A,pubsub:e,style:m[R.id]})]},`--col-${R.id}`)}),f&&s>-1&&jsx(p,{as:"--col",children:jsx(H,{as:"opacity:0",children:"..."})}),!f&&s>-1&&r&&o&&n.map((R,P)=>jsxs(Fragment,{children:[l&&P==0&&E(P,`--selector-${R.id}`,R.id.toString()),r.includes(String(R.id))?jsx(It,{pubsub:e,idx:P,id:String(R.id),style:m[String(R.id)],value:R.render?R.render(o,s):o[String(R.id).includes(".")?String(R.id).split(".").reverse()[0]:R.id]}):null]},`--${String(R.id)}-val-${P}`))]})};us.displayName="Zuz.Row";var Nt=us;var hs=(t,s)=>{let{schema:e,rows:n,rowCount:o,rowsPerPage:r,currentPage:m,pagination:i,paginationHash:c,showPaginationOnZeroPageCount:l,animateRows:a,header:f,rowClassName:u,selectableRows:d,hoverable:T,sortBy:x,loading:S,loadingRowCount:h,loadingMessage:v,spinner:g,emptyMessage:C,onSort:E,onRowClick:R,onRowSelectToggle:P,onPageChange:I,onRowContextMenu:O,...L}=t,A=useRef(null),B=useMemo(()=>e.reduce((se,J)=>(se[J.id]={flex:J.weight||1,...J.w&&{width:J.w},...J.maxW&&{maxWidth:J.maxW},...J.minW&&{minWidth:J.minW},...J.h&&{height:J.h},...J.maxH&&{maxHeight:J.maxH},...J.minH&&{minHeight:J.minH}},se),{}),[e]),_=useMemo(()=>Object.keys(B),[e]),K=useMemo(()=>f??true,[f]),{style:q,className:w,rest:k}=N(L),$=useRef(null),U=useMemo(()=>new PubSub,[]),V=useRef(n.map(()=>uuid(8))),[Z,Q]=useState(x||null),[j,te]=useState(v||"loading"),de=useMemo(()=>!S&&n&&n.length==0,[S,n]),ge=useCallback(()=>C?typeof C=="function"?jsx(C,{}):C:jsx(H,{as:"tac s:18 mt:75",children:"No Record Found"}),[S,n]);useEffect(()=>{V.current=n.map(()=>uuid(8));},[n]);let Lt=(se,J)=>{Q(se),E?.(se,J);},Mt=(o||(n?n.length:0))/(r||10),He=useMemo(()=>l||Mt>1?jsx(No,{hash:c,ref:A,renderOnZeroPageCount:l,onPageChange:I,paginationStyle:"table",startPage:m,itemCount:o||(n?n.length:0),itemsPerPage:r||10}):null,[m,o]);return useImperativeHandle(s,()=>({setLoading(se){}})),jsxs(p,{as:`--table ${T??true?"--hoverable":""} flex cols rel ${w}`,ref:$,children:[K==true&&jsx(Nt,{sortBy:Z,onSort:Lt,tableRef:$,pubsub:U,selectable:d,index:-1,schema:e,loading:true,styles:B}),S&&jsxs(p,{as:"center-x flex aic --table-spinner",children:[jsx(he,{type:g||ne.Simple}),j&&jsx(H,{as:"--table-loading-message",children:j})]}),S&&Array(h||5).fill({}).map((se,J)=>jsx(Nt,{tableRef:$,index:J,pubsub:U,schema:e,styles:B,loading:true,animate:a,onRowClick:R},`--trow-loading-${J}-${e[0].id}`)),!S&&n&&n.map((se,J)=>jsx(Nt,{tableRef:$,pubsub:U,loading:false,index:J,schema:e,ids:_,styles:B,animate:a,data:se,onRowClick:R,rowClassName:u,selectable:d,onSelect:P,onContextMenu:O},`--trow-${V.current[J]||J}-${e[0].id}`)),de&&ge(),jsx(p,{"aria-hidden":!i||!He,...a?{fx:{transition:G.SlideInBottom,curve:F.EaseInOut,delay:.02*(n.length+1),when:!S&&n&&i&&He!=null}}:{},as:"--row flex aic --row-footer",children:i&&He?He:null})]})};hs.displayName="Zuz.Table";var Ac=forwardRef(hs),$c=Ac;var _c=({ref:t,...s})=>{let{title:e,items:n}=s,[o,r]=useState(0),m=(i,c,l)=>{i.preventDefault(),r(c),document.getElementById(l)?.scrollIntoView({behavior:"smooth"});};return jsxs(p,{ref:t,as:"--table-of-contents rel flex cols",children:[jsx(H,{as:"--toc-title",children:e}),jsx(Me,{items:n.map((i,c)=>jsx("a",{className:o==c?"--toc-active":"",style:{anchorName:o===c?"--toc-active":"none",color:o==c?"var(--table-of-contents-color-active)":"var(--table-of-contents-color)"},onClick:l=>m(l,c,i.tag),href:`#${i.tag}`,children:i.label}))})]})},Fc=_c;var xs=({isActive:t,transitionType:s,speed:e,width:n,render:o,content:r,onHeightChange:m})=>{let i=useRef(null),c=useResizeObserver(i);useEffect(()=>{t&&c.height>0&&m(c.height);},[t,c.height]);let l=useMemo(()=>{let a={flexShrink:0,height:"fit-content"};return s==="fade"?{...a,gridArea:"1 / 1 / 2 / 2",opacity:t?1:0,visibility:t?"visible":"hidden",transition:`opacity ${e}s ease-in-out`,zIndex:t?1:0}:s==="scale"?{...a,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}:a},[t,s,n,e]);return jsx(p,{ref:i,style:{...l},className:"--content",children:o||t?r:null})};xs.displayName="Zuz.TabBody";var ys=xs;var vs=({ref:t,...s})=>{let{tabs:e,speed:n=.3,prerender:o=true,variant:r,tabStyle:m="fixed",onChange:i,transitionType:c="slide",...l}=s,[a,f]=useState(0),u=useRef(null),d=useResizeObserver(u),T=useMemo(()=>uuid(8),[]),[x,S]=useState("auto"),h=useMemo(()=>d.width>0,[d.width]);useImperativeHandle(t,()=>({setTab:P=>f(P)}));let v=useMemo(()=>e.map(P=>({...P,key:P.key||uuid(8)})),[e]),{style:g,className:C,rest:E}=N({as:`flex cols w-full no-overflow ${l.as||""}`,...l}),R=()=>{if(!h)return {opacity:0};switch(c){case "fade":return {display:"grid",gridTemplateColumns:"1fr"};case "scale":return {display:"grid",gridTemplateColumns:"1fr"};default:return {display:"flex",transform:`translate3d(-${a*d.width}px, 0, 0)`,transition:`transform ${n}s cubic-bezier(0.4, 0, 0.2, 1)`}}};return jsxs(p,{ref:u,style:g,className:`--tabview --${m} flex cols ${C}`,children:[jsx(nt,{as:"--tabview-head",onSwitch:P=>{f(P.index);let I=v.find(O=>O.tag==P.tag);I&&I.onSelect&&(I.onSelect(I,P.index),i?.(I,P.index));},selected:a,items:v.reduce((P,I,O)=>(P.push({icon:I.icon,index:O,label:I.label,tag:I.tag}),P),[])}),jsx(p,{className:"--tabview-body",as:"rel no-overflow w-full",style:{height:x,transition:h?`height ${n}s cubic-bezier(0.4, 0, 0.2, 1)`:"none",opacity:h?1:0},children:jsx(p,{className:"--track",style:{...R()},children:v.map((P,I)=>jsx(ys,{isActive:I===a,transitionType:c,speed:n,width:d.width,render:o||I===a,onHeightChange:O=>I===a&&S(O),content:P.body},`tab-body-${P.key||I}-${T}`))})})]})};vs.displayName="Zuz.TabView";var Jc=vs;var op=({ref:t,commands:s,onCommand:e,welcomeMessage:n="Welcome to Zuz Terminal v1.0.0",prompt:o="zuz ~ ",variant:r,...m})=>{let[i,c]=useState([{type:"output",content:n}]),[l,a]=useState(""),f=useRef(null),u=useRef(null),{variant:d}=X(true);useEffect(()=>{f.current&&(f.current.scrollTop=f.current.scrollHeight);},[i]);let T=C=>{let E=typeof C=="string"?{type:"output",content:C}:C;c(R=>{let P=[...R,E];return P.length>1e3?P.slice(-1e3):P});},x=()=>c([]);useImperativeHandle(t,()=>({write:T,clear:x}));let S=async C=>{let[E,...R]=C.split(" "),P=E.toLowerCase();return s&&s[P]?await s[P](R):e?await e(C):`command not found: ${E}`},h=C=>{let E=/\u001b\[(\d+)m/g,R=[],P={31:"#ff5f56",32:"#27c93f",33:"#ffbd2e",34:"#007aff",35:"#ff79c6",36:"#8be9fd",39:"#d4d4d4"},I=0,O="#d4d4d4",L=false,A;for(;(A=E.exec(C))!==null;){let _=C.slice(I,A.index);_&&R.push({text:_,color:O,bold:L});let K=A[1];K==="0"?(O="#d4d4d4",L=false):K==="1"?L=true:P[K]&&(O=P[K]),I=E.lastIndex;}let B=C.slice(I);return B&&R.push({text:B,color:O,bold:L}),R},v=(C,E)=>C.includes("\x1B")?h(C).map((R,P)=>jsx(ee,{style:{color:R.color||"#d4d4d4",fontWeight:R.bold?"bold":"normal"},children:R.text},`--terminal-msg-${P}-${R.text.replace(/\S+/g,"-")}`)):jsx(ee,{style:{color:E==="error"?"#ff5f56":E==="command"?"#00ff00":"#d4d4d4"},children:C}),g=async C=>{if(C.key==="Enter"&&l.trim()){let E=l.trim(),R=[...i,{type:"command",content:`${o}${E}`}];a(""),c(R);let P=await S(E);c(I=>[...I,{type:"output",content:P}]);}};return jsxs(p,{as:`--zuz-terminal --${r||d||W.Medium} flex cols ${m.className}`,onClick:()=>u.current?.focus(),children:[jsx(p,{ref:f,className:"--terminal-log",children:i.map((C,E)=>jsx(p,{children:jsx(H,{children:v(C.content,C.type)})},E))}),jsxs(p,{as:"flex aic --terminal-input",children:[jsx(H,{as:"--terminal-prompt",children:o}),jsx(re,{ref:u,className:"--zuz-term-input",autoFocus:true,value:l,variant:r||d||W.Medium,onChange:C=>a(C.target.value),onKeyDown:g})]})]})},rp=op;var np=({meta:t})=>jsxs(z,{as:"flex aic --command-item",children:[t.icon&&jsx(Y,{name:t.icon,as:"--command-icon"}),jsx(H,{children:t.label})]}),sp=({position:t,onSelect:s,commands:e,visible:n})=>jsx(p,{"aria-hidden":!n,fx:{transition:G.SlideInBottom,duration:.1,when:n},className:"--command-box abs grid",style:{...t},children:e.map(o=>jsx(np,{meta:o},`cmd-${o.label.replace(/\s+/,"-")}`))}),Ps=sp;var Ns=forwardRef((t,s)=>{let{autoResize:e,maxHeight:n,variant:o,resize:r="none",command:m,commands:i,onInput:c,cmd:l,renderDropdown:a,value:f,defaultValue:u,...d}=t,T=useRef(null),x=useRef(null),{variant:S}=X(true),{style:h,className:v,rest:g}=N(d),{showDropdown:C,dropdownPosition:E,handleKeyDown:R,handleInput:P,handleCommandSelect:I}=useCommandActions({command:m,commands:i,cmd:l,ref:T}),O=useCallback(()=>{let A=T.current;!A||!e||(x.current&&cancelAnimationFrame(x.current),x.current=requestAnimationFrame(()=>{A.style.height="auto";let B=A.scrollHeight;if(n){let _=parseInt(n.toString(),10);isNaN(_)||(B=Math.min(B,_));}A.style.height=`${B}px`,A.style.overflowY=n&&B>=parseInt(n.toString(),10)?"auto":"hidden";}));},[e,n]),L=A=>{c?.(A),P(A),O();};return useEffect(()=>{O();},[f,u,O]),useEffect(()=>{e&&T.current&&O();},[e,O]),useEffect(()=>()=>{x.current&&cancelAnimationFrame(x.current);},[]),jsxs(p,{as:"rel",children:[jsx("textarea",{className:`--input --textarea --${o||S||W.Medium} flex ${v}`.trim(),style:{...h,resize:r,height:e?"auto":h?.height,overflow:"hidden",transition:e?"none":void 0},onKeyDown:R,onInput:L,ref:A=>{typeof s=="function"?s(A):s&&(s.current=A),T.current=A;},value:f,defaultValue:u,...g}),a?a({show:C,position:E,commands:i||[],onSelect:I}):i&&i.length>0&&jsx(Ps,{visible:C,commands:i,onSelect:I,position:E})]})});Ns.displayName="Zuz.TextArea";var cp=Ns;var Bs=forwardRef((t,s)=>{let{as:e,value:n,color:o,direction:r,...m}=t,i=useRef(null),[c,l]=useState(n||0);return useImperativeHandle(s,()=>({updateValue(a){c.toString().length!==a.toString().length&&l(a);},setValue(a){if(this.updateValue(a),i.current){let f=a.toString().split("");i.current.querySelectorAll(".--wheel-char").forEach((u,d)=>{let T=f[d];if(u instanceof HTMLElement){u.setAttribute("data-value",T);let x=u.querySelector(".--wheel-char-track");x instanceof HTMLElement&&(x.style.setProperty("--v",T),x.offsetWidth);}});}}})),useEffect(()=>{l(n||0);},[n]),jsxs(p,{className:"--text-wheel flex aic rel","aria-hidden":true,as:e,ref:i,...m,children:[(c||0).toString().split("").map((a,f)=>isNaN(parseInt(a,10))?jsx(ee,{className:"--wheel-char wheel-char-symbol grid",children:a},`wheel-char-symbol-${f}`):jsx(ee,{"data-value":a,className:`--wheel-char grid ${f>(c||0).toString().length-3?"--wheel-fraction":""}`.trim(),children:jsxs(ee,{className:`--wheel-char-track --wheel-track-${r||"down"} grid`,style:{"--v":a},children:[jsx(ee,{children:!r||r==="down"?0:9}),(!r||r==="down"?[9,8,7,6,5,4,3,2,1,0]:[0,1,2,3,4,5,6,7,8,9]).map((u,d)=>jsx(ee,{children:u},`${f}--${d}`)),jsx(ee,{children:!r||r==="down"?9:0})]})},`wheel-char-${f}`)),o&&jsx(p,{className:"abs fillx",style:{zIndex:1,background:`linear-gradient(0deg, ${o}, transparent, transparent, transparent, ${o})`}})]})});Bs.displayName="Zuz.TextWheel";var xp=Bs;var Os=forwardRef((t,s)=>{let{title:e,position:n,margin:o,children:r,...m}=t,{style:i,className:c,rest:l}=N(m),[a,f]=useState(false),u=useMemo(()=>n||oe.Top,[]),d=useRef(null),T=useRef(null),x=g=>{},S=typeof ResizeObserver<"u"?new ResizeObserver(x):{observe:()=>{},unobserve:()=>{}},h=useDimensions(),v=useMemo(()=>{if(!T.current)return {left:0,top:0};let g=T.current.previousElementSibling;if(g){let C=g.getBoundingClientRect();switch(S.observe(g),u){case oe.Top:return {left:C.left+C.width/2,top:C.top-(o||25)};case oe.Bottom:return {left:C.left+C.width/2,top:C.top+(o||25)};case oe.Left:return {left:C.left-C.width/2,top:C.top+C.height/2};case oe.Right:return {left:C.right,top:C.top+C.height/2};default:return {left:0,top:0}}}},[T.current,h,S]);return useEffect(()=>{},[]),jsxs(p,{ref:d,className:"--with-tooltip rel",onMouseEnter:g=>f(true),onMouseLeave:g=>f(false),children:[r,jsx(p,{ref:T,style:{left:v?.left+"px",top:v?.top+"px"},className:`--tooltip --${n||oe.Top} fixed ${c}`.trim(),fx:{from:u==oe.Bottom||u==oe.Top?{opacity:0,x:"-50%",y:u==oe.Top?-5:5}:{opacity:0,y:"-50%",x:u==oe.Right?15:-25},to:u==oe.Bottom||u==oe.Top?{opacity:1,x:"-50%",y:0}:{opacity:1,y:"-50%",x:u==oe.Right?10:-20},curve:F.EaseInOut,when:a},children:jsx(H,{className:"--text rel",children:e})})]})});Os.displayName="Zuz.ToolTip";var Sp=Os;var Ao=forwardRef((t,s)=>{let{as:e,meta:n,nodes:o,icons:r,onSelect:m,treeTag:i,selected:c,roots:l,expanded:a,...f}=t,{tag:u,label:d,icon:T,under:x,isHead:S}=n,h=useMemo(()=>l.includes(u),[l]),[v,g]=useState(a),C=()=>{localStorage.setItem(`--tn${i}-${u}`,v?"0":"1"),g(!v);};useEffect(()=>{a||h&&!localStorage.getItem(`--tn${i}-${u}`)?(localStorage.setItem(`--tn${i}-${u}`,"1"),g(true)):g(localStorage.getItem(`--tn${i}-${u}`)=="1");},[]);let E=useMemo(()=>o.filter(R=>R.under==u),[o,u]);return jsxs(p,{className:`--treenode ${h?"--is-root":""} --treenode-${u} flex cols`,children:[jsxs(p,{className:`--node --node-${u} flex aic ${c==u?" --selected":""}`,children:[jsx(z,{skeleton:f.skeleton,onClick:C,className:"--node-aro-btn",disabled:E.length==0,children:r?.arrowClose&&r?.arrowOpen?jsx(Y,{skeleton:f.skeleton,className:"--node-aro-icon",name:E.length==0?r?.arrowDisabled||r?.arrowClose:v?r?.arrowOpen:r?.arrowClose}):E.length==0?D.chevronBottom:v?D.chevronBottom:D.chevronRight}),jsxs(z,{className:"--node-meta flex aic",onClick:R=>m(u),children:[(r?.nodeOpen&&r?.nodeClose||h&&r?.rootOpen&&r?.rootClose)&&jsx(Y,{skeleton:f.skeleton,className:`--node-icon ${h?"--icon-root":""}`,name:T||(v?h&&r?.rootOpen||r.nodeOpen:h&&r?.rootClose||r?.nodeClose)}),jsx(H,{className:`--node-label ${h?"--node-label-root":""}`.trim(),skeleton:f.skeleton,children:d})]})]}),v&&E.length>0&&jsx(p,{className:`--sub-node tree-sub-node-${u} flex cols`,children:E.map(R=>jsx(Ao,{treeTag:i,selected:c,onSelect:m,icons:r,roots:l,expanded:R.expanded||false,meta:R,nodes:o},`--node-${R.tag}`))})]})});Ao.displayName="TreeItem";var Hs=Ao;var As=forwardRef((t,s)=>{let{as:e,nodes:n,onNodeSelect:o,tag:r,icons:m,roots:i,selected:c,...l}=t,[a,f]=useState(c);useImperativeHandle(s,()=>({getSelected:()=>a}),[o]);let u=d=>{f(d),o&&o(d);};return useEffect(()=>{a!=c&&f(c);},[c]),jsx(p,{className:"--treeview flex cols",children:n.filter(d=>i.includes(d.tag)).map(d=>jsx(Hs,{treeTag:r?`-${r}`:"",selected:a,onSelect:T=>u(T),icons:m,meta:d,roots:i,expanded:d.expanded||false,skeleton:l.skeleton,nodes:n},`--node-${d.tag}`))})});As.displayName="Zuz.TreeView";var Lp=As;String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"").replace(/\s+/g," ")};
13
- export{me as ALERT,Wo as AVATAR,ui as Accordion,yi as ActionBar,vi as Alert,$i as AutoComplete,Gi as Avatar,Xi as Badge,p as Box,Cl as Bubble,mn as BubbleMediaType,ln as BubbleStatus,z as Button,rn as CHART,we as CHECKBOX,Dp as COLORTHEME,co as Calendar,hl as Chart,rt as CheckBox,Ol as CodeBlock,Xl as ColorScheme,Wt as ContextMenu,jl as CookiesConsent,xe as Cover,im as CropShape,sm as Cropper,mm as Crumb,Ap as DATATYPE,Ve as DIALOG,Uo as DIALOG_ACTION_POSITION,ae as DRAWER_SIDE,fm as DatePicker,qt as Dialog,eo as Drawer,ut as FILTER,ve as FORMVALIDATION,$p as FORMVALIDATION_STYLE,xm as Fab,wm as Filters,Om as Form,Am as Grid,Ut as Group,Y as Icon,et as Image,re as Input,Po as KeyboardKeys,Zn as KeysLabelMap,Fn as KeysMap,ot as Label,Zt as LayersProvider,Me as List,Wm as NetworkStatus,We as ORIGIN,Hp as OriginType,Ee as Overlay,Ot as POSITION,_p as PROGRESS,No as Pagination,Ro as PaginationStyle,tc as Password,sc as PinInput,oe as Position,uo as ProgressBar,Ht as RADIO,mc as Radio,ce as SHEET,Dt as SHEET_ACTION_POSITION,Op as SKELETON,pt as SLIDER,Vp as SORT,ne as SPINNER,Yt as ScrollView,xc as Search,Cc as Select,nt as SelectTabs,Pm as Sheet,yo as Slider,ee as Span,he as Spinner,zp as Status,Pc as Switch,G as TRANSITIONS,F as TRANSITION_CURVES,Jc as TabView,$c as Table,Fc as TableOfContents,rp as Terminal,H as Text,xp as TextWheel,cp as Textarea,Qs as ThemeProvider,Er as ToastDefaultTitle,to as ToastProvider,Nr as ToastType,Sp as ToolTip,Lp as TreeView,W as Variant,Ue as animationTransition,Vt as buildClassString,Xo as buildWithStyles,iu as css,At as getAnimationCurve,lu as getAnimationTransition,zs as getZuzMap,_n as isKeyCombination,qo as setZuzMap,N as useBase,ai as useContextMenu,Xa as useDialog,ei as useDrawer,ie as useFx,ri as useMorph,Ge as usePosition,ro as useToast};
8
+ document.documentElement.style.colorScheme = theme;`}}),jsx(qt,{children:t})]})},or=(t,s)=>{if(Ys)return;let e;try{e=localStorage.getItem(t)||void 0;}catch{}return e||s};var nr=({ref:t,...s})=>{let{style:e,...r}=s,{style:o,className:n,rest:i}=E(r);return jsx("span",{ref:t,style:e,className:n,...i})};nr.displayName="Zuz.Span";var te=nr;var ar=forwardRef((t,s)=>{let{name:e,pathCount:r,variant:o,color:n,...i}=t,{variant:m}=X(true),{className:f,style:l,rest:c}=E(i);return jsx("div",{style:{color:n,...l},className:`icon-${e} --icon --${o||m||K.Small} ${f}`.trim(),ref:s,...c,children:Array(r||0).fill(0).map((p,a)=>jsx(te,{className:`path${a+1}`},`${e}-layer-${a}`))})});ar.displayName="Zuz.Icon";var Q=ar;var se={Simple:"SIMPLE",Roller:"ROLLER",Wave:"Wave"};var ir=t=>{let{type:s,variant:e,color:r,...o}=t,{className:n,style:i,rest:m}=E(o),{spinner:f}=X(true),l=()=>{switch(s||f?.type||se.Simple){case se.Simple:return null;case se.Wave:return jsxs(Fragment$1,{children:[jsx(u,{as:"--bar --bar1"}),jsx(u,{as:"--bar --bar2"}),jsx(u,{as:"--bar --bar3"})]});case se.Roller:return null}};return jsx(u,{className:`${n} --spinner --${(s||f?.type||se.Simple).toLowerCase()} --${e||f?.variant||K.Small}`.trim(),style:{...i},...m,children:l()})};ir.displayName="Zuz.Spinner";var he=ir;var xt={Loading:"loading",Normal:"normal"};var cr=({ref:t,...s})=>{let{reset:e,kind:r="solid",variant:o,icon:n,iconSize:i,children:m,withLabel:f,spinner:l,state:c,disabled:p,...a}=s,{style:d,className:T,rest:h}=E(a),{variant:S}=X(true);return jsxs("button",{className:`--button --${r} --${o||S} flex aic ${e?"":"jcc"} ${n?"--with-icon":""} ${T}`.trim().replace(/\s+/g," "),style:d,ref:t,disabled:c==xt.Loading||s.skeleton?.enabled||p,...h,children:[c==xt.Loading&&jsx(he,{variant:o||S,type:l||se.Simple}),(!c||c==xt.Normal)&&jsxs(Fragment$1,{children:[n&&jsx(Q,{variant:i,name:n}),f===true?jsx(te,{children:m}):m]})]})};cr.displayName="Zuz.Button";var z=cr;var pr=forwardRef((t,s)=>{let{h:e,html:r,children:o,lines:n,...i}=t,{style:m,className:f,rest:l}=E(i),c=`h${t.h||1}`;return jsx(c,{ref:s,style:m,className:f,...l,children:r?jsx(te,{dangerouslySetInnerHTML:{__html:r}}):o})});pr.displayName="Zuz.Text";var V=pr;var aa=t=>{let{label:s,labelColor:e,icon:r,iconColor:o,index:n,className:i,onSelect:m}=t;return s=="-"?jsx(u,{className:"--line"}):jsxs(z,{reset:true,onClick:f=>m?.(t),className:`--item ${i||""}`.trim(),children:[jsx(u,{as:"--icon",children:jsx(Q,{name:r,className:"--ico",style:o?{color:o}:{}})}),jsx(V,{className:"--lbl flex aic",style:e?{color:e}:{},children:s})]})},ur=aa;var gr=({ref:t,...s})=>{let{id:e,as:r,fx:o,offsetX:n,offsetY:i,parent:m,event:f,arrow:l,when:c,items:p,header:a,footer:d,origin:T=qe.TopRight,...h}=s,[S,P]=useState(false),[R,y]=useState(p||[]),{position:g,targetRef:I,calculatedAnchor:v}=useAnchorPosition(m?.current,f,{offsetX:n,offsetY:i,preferredAnchor:T}),N=m&&g.top>m.current.getBoundingClientRect().bottom?"--arrow-top":"--arrow-bottom",O=useMemo(()=>{let U=v.toLowerCase();return U.includes("left")?"--arrow-left":U.includes("right")?"--arrow-right":"--arrow-center"},[v]),L=g.top!==0||g.left!==0;useEffect(()=>{c&&L?P(true):c||P(false);},[c,L]);let{className:$,style:B,rest:_}=E(h),F=le({...o?.transition?{transition:o.transition??q.SlideInBottom}:{from:{opacity:0,scale:.8,y:-10},to:{opacity:1,scale:1,y:0}},curve:o?.curve??G.EaseInOut,duration:o?.duration??.05,when:S&&L});return jsxs(u,{ref:I,className:`--contextmenu ${l||m!=null?`--has-arrow ${N} ${O}`:""} abs flex cols ${$}`.trim(),"aria-hidden":!S,style:{...B,...F.style,top:g.top,left:g.left,visibility:L?"visible":"hidden",transformOrigin:v},..._,children:[typeof a=="function"?createElement(a):a,R.map((U,x)=>jsx(ur,{...U,index:x},`context-${U.label.toLowerCase()}-${x}`)),typeof d=="function"?createElement(d):d]})};gr.displayName="Zuz.ContextMenu";var Yt=gr;var hr=forwardRef((t,s)=>{let{children:e,fx:r,when:o,fxDelay:n,fxStep:i,classToIgnore:m,...f}=t,l=X(true),c=useDelayed(),p=r||l?.group?.fx,a=n||l?.group?.fxDelay,d=i||l?.group?.fxStep,T=m||l?.group?.classToIgnore||"--ignore",h=useMemo(()=>p?addPropsToChildren(e,S=>{if(S.type===Fragment)return false;let P=S.props||{},R="fx"in P,y=P.as?Array.isArray(P.as)?P.as.join(" "):P.as:P.className||"",g=typeof y=="string"&&y.includes(T);return !R&&!g},S=>({fx:{...p,delay:(a||0)+S*(d||.1),when:o??(r?.when||c)}})):e,[e,o,c,p]);return jsx(u,{className:"--group",ref:s,...f,children:h})});hr.displayName="Zuz.Group";var Qt=hr;var xr=forwardRef((t,s)=>{let{message:e,spinner:r,spinnerSize:o,color:n,when:i,hideMessage:m,...f}=t,{className:l,style:c,rest:p}=E(f),{spinner:a}=X(true);return "when"in t&&t.when==false?null:jsxs(Qt,{fx:{transition:q.SlideInBottom,curve:G.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(he,{variant:o||a?.variant||K.Small,type:r||a?.type||se.Simple}),!m&&jsx(V,{className:"--label",style:{color:"var(--cover-label)"},children:e||"loading"})]})});xr.displayName="Zuz.Cover";var ye=xr;var br=forwardRef((t,s)=>{let{when:e,...r}=t;return jsx(u,{ref:s,"aria-hidden":!e,className:"--overlay fixed fill",fx:{transition:q.FadeIn,when:e},...r})});br.displayName="Zuz.Overlay";var Me=br;var Ca=({action:t,render:s=true,message:e=""})=>jsx(u,{as:`--body flex aic rel ${t?"":"--no-action"}`.trim(),children:s?e:null}),wr=Ca;var Pa=({action:t,actionPosition:s,dialogID:e,variant:r})=>jsx(u,{as:`--footer flex aic rel ${s?s==Xo.Center?"jcc":"":"jce"}`.trim(),children:t.map((o,n)=>jsx(z,{variant:r,onClick:i=>o.handler?o.handler():o.onClick?o.onClick():console.log("onClick Handler missing"),as:"--action",children:o.label},`dialog-${e}-action-${o.key}`))}),Sr=Pa;var Ra={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"})," "]}),[ue.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"})}),[ue.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"})}),[ue.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"})}),[ue.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"})}),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"})]})},H=Ra;var Ia=({title:t="Alert",onClose:s})=>jsxs(u,{as:"--head flex aic rel",children:[jsx(u,{as:`--${t?"title":"dot"} flex aic jcc rel`,children:t}),jsx(z,{onClick:e=>s(),className:"--closer abs center-v",children:H.close})]}),Tr=Ia;var Nr=({ref:t,...s})=>{let{index:e,id:r,title:o,message:n,transition:i,curve:m,speed:f,type:l,action:c,actionPosition:p,spinner:a,loadingMessage:d,variant:T,inBackground:h,forceClose:S,forceLoading:P,onClose:R,onShow:y,onHide:g,...I}=s,v=useMemo(()=>uuid(12),[]),[C,N]=useState(o||""),[O,L]=useState(n||""),[$,B]=useState(l||ze.Dialog),[_,F]=useState(false),[U,x]=useState(true),[M,A]=useState(c||null),[W,D]=useState(false),{variant:Z,spinner:Y,dialog:J}=X(true),ee=T||J?.variant||Z||K.Small,{style:pe,className:ne,rest:we}=E(I),ke=useRef(null),ve=le({when:_,duration:f||J?.speed||.3,delay:J?.delay||.1,transition:i||J?.transition||q.SlideInBottom,curve:m||J?.curve||G.EaseInOut,watch:["scale","filter","transform"]}),ae=()=>{F(false),R(r);};useEffect(()=>{B(ze.Dialog),L(n),N(C),M&&A(M.reduce((Fo,Zo)=>(Fo.push({...Zo,key:Zo.key||uuid(12)}),Fo),[])),F(true),setTimeout(()=>y?y():()=>{},500);},[]),useEffect(()=>{S&&ae();},[S]),useEffect(()=>{P!=null&&D(P);},[P]);let j=useMemo(()=>1e4+e*10,[e]);return jsxs(Fragment$1,{children:[jsx(Me,{style:{zIndex:j},when:_}),jsxs(u,{as:`--dialog --${(l??ze.Default).toLowerCase()} ${_?"--visible":""} ${ne} fixed abc`.trim(),style:{...ve.style,zIndex:j+1,pointerEvents:h==true?"none":"auto",...h==true?{scale:"0.92",filter:"blur(2px)"}:{}},...we,ref:ke,children:[jsx(Tr,{title:C,onClose:ae}),jsx(wr,{message:O,render:U,action:M}),M&&M.length>0&&jsx(Sr,{variant:ee,action:M,dialogID:v,actionPosition:p}),jsx(ye,{when:W,spinner:a||J?.spinner||Y?.type||se.Simple,message:d||J?.loadingMessage})]})]})};Nr.displayName="Zuz.Dialog";var jt=Nr;var eo=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(s){return this.stack[this.stack.length-1]===s}push(s){this.stack.includes(s)||(this.stack.push(s),this.updateScrollLock());}pop(s){this.stack=this.stack.filter(e=>e!==s),this.updateScrollLock();}handleEscape(){let s=this.stack[this.stack.length-1];return s?(s(),true):false}get count(){return this.stack.length}},Qe=new eo;var Er=forwardRef((t,s)=>{let{speed:e,style:r,...o}=t,{rootRef:n,containerRef:i,thumbY:m,thumbX:f,onScrollY:l,onScrollX:c}=useScrollbar(e||1),{style:p,className:a,rest:d}=E(o);return useEffect(()=>{let T=i.current;if(!T)return;let h=()=>{window.dispatchEvent(new Event("resize"));};return T.addEventListener("scroll",h),()=>T.removeEventListener("scroll",h)},[]),jsxs(u,{ref:n,className:a.trim(),as:"--scrollview rel",children:[jsx(u,{as:`--scroll-content ${a}`.trim(),ref:i,style:r||{},children:d.children}),jsx(u,{as:"--scroll-track --track-y --abs",children:jsx(u,{as:"--scroll-thumb --abs",ref:m,onMouseDown:l})}),jsx(u,{as:"--scroll-track --track-x --abs",children:jsx(u,{as:"--scroll-thumb --abs",ref:f,onMouseDown:c})})]})});Er.displayName="Zuz.ScrollView";var to=Er;var Br=({ref:t,...s})=>{let{id:e,index:r,from:o,speed:n,children:i,margin:m,animation:f,prerender:l,inBackground:c,forceClose:p,forceLoading:a,onClose:d,...T}=s,{drawer:h}=X(true),[S,P]=useState(i),[R,y]=useState(false),[g,I]=useState(l??(h?.prerender||true)),[v,C]=useState(false),N=()=>{y(false),d?.(e??-1);},{className:O,style:L,rest:$}=E(T),B=useMemo(()=>[{keys:[KeyCode.Escape],callback:()=>{Qe.isTop(N)&&N();}}],[R]);useShortcuts(B),useEffect(()=>{P(i);},[i]),useEffect(()=>(R?Qe.push(N):Qe.pop(N),()=>Qe.pop(N)),[R]),useEffect(()=>{y(true);},[]),useEffect(()=>{p&&N();},[p]),useEffect(()=>{a!=null&&C(a);},[a]);let _=o||h?.from||ie.Left,F=useMemo(()=>{switch(_){case ie.Left:return {from:{x:"-100vw"},to:{x:0}};case ie.Right:return {from:{x:"100vw"},to:{x:0}};case ie.Top:return {from:{y:"-100vh"},to:{y:0}};case ie.Bottom:return {from:{y:"100vh"},to:{y:0}};default:return {from:{x:"-100vw"},to:{x:0}}}},[o,h?.from]),U=le({from:{...F.from,opacity:0},to:{...F.to,opacity:1},when:R,curve:f||h?.animation||G.EaseInOut,duration:n||h?.speed||.5,watch:["scale","filter"]}),x=useMemo(()=>1e4+(r||1)*10,[r]);return jsxs(Fragment$1,{children:[jsx(Me,{onClick:M=>{R&&N();},when:R,style:{zIndex:x}}),jsxs(u,{ref:t,"aria-hidden":!R,className:`--drawer flex cols ${O} --${_.toLowerCase()} fixed`,style:{...L,...U.style,"--m":`${m||h?.margin||0}px`,zIndex:x+1,pointerEvents:c==true?"none":"auto",...c==true?{scale:"0.92",filter:"blur(2px)"}:{}},...$,children:[o==ie.Top||o==ie.Bottom?jsx(u,{className:"--handle"}):null,jsxs(to,{as:"rel",children:[g||R?S:null,jsx(ye,{when:v})]})]})]})};Br.displayName="Zuz.Drawer";var so=Br;var kr=forwardRef((t,s)=>{let{progress:e,type:r,animated:o,...n}=t,i=useRef(null);useImperativeHandle(s,()=>({setProgress:c=>{i.current.style.width=`${c*100}%`;}}),[]),useEffect(()=>{e&&i.current&&(o?setTimeout(()=>i.current.style.width=`${e*100}%`,500):i.current.style.width=`${e*100}%`);},[e,i.current]);let{className:m,style:f,rest:l}=E(n);return jsx(u,{className:`--progress ${o?"--animated":""} flex rel ${m}`.trim(),style:f,...l,children:jsx(u,{ref:i,className:"--bar rel"})})});kr.displayName="Zuz.ProgressBar";var et=kr;var vt=(n=>(n.Default="default",n.Success="success",n.Error="error",n.Warn="warn",n.Promise="promise",n))(vt||{}),St=(i=>(i.TopLeft="TopLeft",i.TopCenter="TopCenter",i.TopRight="TopRight",i.BottomLeft="BottomLeft",i.BottomCenter="BottomCenter",i.BottomRight="BottomRight",i))(St||{}),Mr=(e=>(e.Stack="stack",e.Individual="individual",e))(Mr||{}),Or={success:"Action Successful",error:"Something Went Wrong",warn:"Heads Up",default:"Notice"};var Fa=t=>{let{index:s,id:e,type:r,icon:o,title:n,message:i,duration:m,sticky:f=false,actions:l=[],position:c,style:p,isHovered:a,total:d,progress:T,forceClose:h,variant:S,onClick:P,onClose:R}=t,[y,g]=useState(false),[I,v]=useState(false),{toast:C}=X(true),N=I||h,O=c||C?.position||"TopCenter",L=r||C?.type||"default",$=p||C?.style||"stack",B=m||C?.duration||4,_=T||C?.progress||false,F=useRef(B*1e3),U=useRef(void 0),x=useRef(void 0),M=useRef(null),A=le({when:y&&!N,duration:.3,transition:C?.transition||(O.includes("Top")?q.SlideInTop:O.includes("Bottom")?q.SlideInBottom:O.includes("Left")?q.SlideInLeft:q.SlideInRight),curve:C?.curve||G.EaseInOut,watch:["transform","opacity","scale","filter"]});useEffect(()=>{g(true);let ne=we=>{if(x.current!==void 0){let ke=we-x.current;if(!a&&!f&&!N&&(F.current-=ke,M.current)){let ve=Math.max(0,F.current/(B*1e3)*100);M.current?.setProgress?.(ve/100);}}x.current=we,F.current<=0?v(true):U.current=requestAnimationFrame(ne);};return U.current=requestAnimationFrame(ne),()=>{U.current&&cancelAnimationFrame(U.current);}},[a,f,N,B]),useEffect(()=>{if(N){let ne=setTimeout(()=>{R?.(e);},350);return ()=>clearTimeout(ne)}},[N,e]);let W=$==="stack",D=a?s*65:s*8,Z=a?1:Math.max(.85,1-s*.05),Y=a?1:Math.max(.4,1-s*.2),J=()=>{P?P():(!l||l.length===0)&&v(true);},ee=A.style.transform||"translate(0, 0)",pe=N?ee:`${ee} translateY(${O.includes("Top")?D:-D}px) scale(${Z})`;return jsxs(u,{onClick:J,as:`--snack --${N?"hidden":"visible"} --${S||C?.variant||K.Medium} --${L} --${O.toLowerCase()} abs flex aic`,style:{...A.style,zIndex:1e3-s,pointerEvents:N?"none":"auto",opacity:N?A.style.opacity:Y,transform:pe,filter:!N&&W&&!a&&s>0?"blur(1px)":"none",cursor:!l||l.length===0?"pointer":"default",transition:`${A.style.transition}, transform 0.3s ease, opacity 0.3s ease`},children:[jsx(u,{as:"--ico flex aic jcc",children:o?jsx(Q,{name:o}):jsx(u,{as:"--no-icon"})}),jsxs(u,{as:"--meta flex cols",children:[jsx(V,{as:"--tt",children:n||Or[r]}),jsx(V,{as:"--tm",children:i})]}),l&&l.length>0&&jsx(u,{as:"--actions flex gap:5",children:l.map((ne,we)=>jsx(z,{as:"--snack-btn bold",onClick:ke=>{ke.stopPropagation(),ne.onClick();},children:ne.label},we))}),_&&jsx(et,{as:"abs",ref:M})]})},ao=Fa;var ce=createContext(null),qa=({ref:t,...s})=>{let r=useContext(ce)?.depth??0,[o,n]=useState(null),[i,m]=useState(null),[f,l]=useState(false),[c,p]=useState([]),a=useDelayed(),d=useRef(0),T=()=>++d.current,h=()=>{l(false),setTimeout(()=>m(null),200);};useImperativeHandle(t,()=>({add(g){let I=T(),v={id:I,...g};return p(C=>[...C,v]),I},openMenu(g){l(false),setTimeout(()=>{m({id:T(),type:"menu",props:g}),l(true);},16);},remove(g){p(I=>I.map(v=>v.id===g?{...v,props:{...v.props,forceClose:true}}:v)),i?.id===g&&h();},loading(g,I){p(v=>v.map(C=>C.id===g?{...C,props:{...C.props,forceLoading:I}}:C)),i?.id===g&&h();},clear(g){p(c.filter(I=>I.type!=g));}})),useEffect(()=>{if(i&&f){let g=()=>h();return document.addEventListener("click",g),()=>document.removeEventListener("click",g)}},[i,f,h]);let S=g=>{setTimeout(()=>{p(I=>I.filter(v=>v.id!==g)),i?.id===g&&m(null);},250);},P=useMemo(()=>[...c.filter(g=>g.type!="toast")],[c]);if(!a)return null;let R=c.filter(g=>g.type=="toast").reverse(),y=Object.values(St);return createPortal(jsxs(u,{as:"--zuz-layers-wrapper fixed fill nope",style:{zIndex:9999+r},children:[P.map((g,I)=>{let v=I<P.length-1;return g.type==="dialog"?jsx(jt,{onClose:S,index:I,id:g.id,...g.props,inBackground:v},`layer-${g.type}-${g.id}`):g.type==="drawer"?jsx(so,{onClose:S,index:I,id:g.id,...g.props,inBackground:v},`layer-${g.type}-${g.id}`):null}),y.map(g=>{let I=R.filter(v=>(v.props.position||"TopCenter")===g);return I.length===0?null:jsx(u,{onMouseEnter:()=>n(g),onMouseLeave:()=>n(null),as:`--toast-container fixed --${g.toLowerCase()} flex cols`,style:{pointerEvents:"auto"},children:I.map((v,C)=>jsx(ao,{index:C,total:I.length,isHovered:o===g,onClose:S,id:v.id,...v.props},v.id))},g)}),i&&jsx(u,{as:"--zuz-layer-menus fixed fill nope",style:{zIndex:"var(--max-z-index)"},children:jsx(Yt,{onClose:h,when:f,...i.props},`menu-${i.id}`)})]}),document.body)},Xa=({children:t})=>{let s=useContext(ce),e=s?s.depth+1:0,r=useRef(null),o=useMemo(()=>({add:n=>r.current?.add(n),openMenu:n=>r.current?.openMenu(n),remove:n=>r.current?.remove(n),loading:(n,i)=>r.current?.loading(n,i),clear:n=>r.current?.clear(n),depth:e,isSubLayer:!!s}),[s]);return jsxs(ce.Provider,{value:o,children:[t,jsx(qa,{ref:r})]})},qt=Xa;var Qa=()=>{let t=useContext(ce);if(!t)throw new Error("useContextMenu must be used inside <LayersProvider>");return {showContextMenu:(r,o,n)=>{r.preventDefault(),t.openMenu({event:r,items:o,origin:n});},showMenu:(r,{items:o,origin:n,offsetX:i,offsetY:m,transition:f,curve:l,arrow:c,duration:p,header:a,footer:d})=>{t.openMenu({fx:{transition:f,curve:l,duration:p},parent:r,items:o,origin:n||qe.TopCenter,offsetX:i,offsetY:m,arrow:c,header:a,footer:d});},hide:t.clear}},Ja=Qa;var ei=()=>{let t=useContext(ce);if(!t)throw new Error("useDialog must be used inside <LayersProvider>");let s=()=>t.clear("dialog"),e=n=>t.remove(n),r=(n,i)=>t.loading(n,i);return {clearAll:s,show:n=>{let i=t.add({type:"dialog",props:{...n,type:ze.Dialog}});return {id:i,setLoading:m=>r(i,m),hide:()=>e(i)}},hide:e}},ti=ei;var ri=()=>{let t=useContext(ce);if(!t)throw new Error("useDialog must be used inside <LayersProvider>");let s=()=>t.clear("drawer"),e=n=>t.remove(n),r=(n,i)=>t.loading(n,i),o=n=>{let i=t.add({type:"drawer",props:n});return {id:i,setLoading:m=>r(i,m),close:()=>e(i)}};return {clearAll:s,open:n=>o({children:n}),right:n=>o({children:n,from:ie.Right}),left:n=>o({children:n,from:ie.Left}),top:n=>o({children:n,from:ie.Top}),bottom:n=>o({children:n,from:ie.Bottom}),close:e}},ni=ri;var ai=(t,s,e={})=>{let[r,o]=useState(null),[n,i]=useState(false),{duration:m=.25,curve:f=G.EaseOutBack,borderRadius:l={from:40,to:24},targetWidth:c=320}=e;return useLayoutEffect(()=>{s&&t.current?(o(t.current.getBoundingClientRect()),i(true)):s||i(false);},[s,t]),{style:le({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:m,when:n&&s}).style,isMeasured:n,sourceRect:r}},ii=ai;var pi=(t,s={})=>{let{offset:e=8,direction:r="bottom",container:o=null,triggerRef:n=null}=s,i=useRef(null),m=useCallback(()=>{let f=t.current;if(!f)return;let l=n?.current||f.parentElement;if(!l){console.warn("usePosition: No trigger element found. Positioning may not work.");return}let c=f.getBoundingClientRect(),p=l.getBoundingClientRect(),a,d;o?(a=o.getBoundingClientRect(),d="absolute"):(window.getComputedStyle(f).position==="fixed"?d="fixed":d="absolute",d==="fixed"?a={top:0,left:0,right:window.innerWidth,bottom:window.innerHeight,width:window.innerWidth,height:window.innerHeight}:a={top:0,left:0,right:window.innerWidth,bottom:window.innerHeight,width:window.innerWidth,height:window.innerHeight}),f.style.position!==d&&(f.style.position=d),i.current=d;let S=0,P=0;switch(r){case "top":S=p.top-c.height-e,P=p.left,S<a.top&&p.bottom+c.height+e<=a.bottom&&(S=p.bottom+e);break;case "bottom":S=p.bottom+e,P=p.left,S+c.height>a.bottom&&p.top-c.height-e>=a.top&&(S=p.top-c.height-e);break;case "left":S=p.top,P=p.left-c.width-e,P<a.left&&p.right+c.width+e<=a.right&&(P=p.right+e);break;case "right":S=p.top,P=p.right+e,P+c.width>a.right&&p.left-c.width-e>=a.left&&(P=p.left-c.width-e);break}if(S=Math.max(a.top,Math.min(S,a.bottom-c.height)),P=Math.max(a.left,Math.min(P,a.right-c.width)),i.current==="fixed")f.style.top=`${S}px`,f.style.left=`${P}px`;else {let R;f.offsetParent?R=f.offsetParent.getBoundingClientRect():R={top:0,left:0};let y=S-R.top+window.scrollY,g=P-R.left+window.scrollX;f.style.top=`${y}px`,f.style.left=`${g}px`;}},[t,n,e,r,o]);return useEffect(()=>{let f=t.current;if(!f)return;let l=n?.current||f.parentElement;if(!l){console.warn("usePosition: No trigger element found. Positioning may not work.");return}let c=new ResizeObserver(m);return c.observe(f),l&&c.observe(l),m(),window.addEventListener("resize",m),window.addEventListener("scroll",m,true),()=>{c.disconnect(),l&&c.disconnect(),window.removeEventListener("resize",m),window.removeEventListener("scroll",m,true);}},[t,r,e,o,n]),{postion:i.current,reposition:m}},tt=pi;var fi=()=>{let t=useContext(ce);if(!t)throw new Error("useToast must be used inside <LayersProvider>");let s=(p,a)=>t.add({type:"toast",props:{...a,type:p}}),r=p=>t.remove(p),l=(p,a,d)=>{let T=s(p,{...a,sticky:a.sticky??false,actions:[{label:d?.label||"Ok",onClick:()=>{d?.onClick?.(),r(T);}}]});return T},c=(p,a,d,T)=>{let h=s(p,{...a,sticky:true,actions:[{label:T?.label||"Cancel",onClick:()=>{T?.onClick?.(),r(h);}},{label:d?.label||"Ok",onClick:()=>{d?.onClick?.(),r(h);}}]});return h};return {ok:(p,a)=>l("default",p,a),success:(p,a)=>l("success",p,a),error:(p,a)=>l("error",p,a),confirm:(p,a,d)=>c("default",p,a,d),warn:(p,a)=>l("warn",p,a)}},di=fi;var hi=()=>{let t=useContext(ce);if(!t)throw new Error("useToast must be used inside <LayersProvider>");let s=(l,c)=>t.add({type:"toast",props:{...c,type:l}});return {show:(l,c,p,a)=>s("default",{title:l,message:c,icon:p,duration:a}),hide:l=>t.remove(l),success:(l,c,p,a)=>s("success",{title:l,message:c,icon:p,duration:a}),error:(l,c,p,a)=>s("error",{title:l,message:c,icon:p,duration:a}),warn:(l,c,p,a)=>s("warn",{title:l,message:c,icon:p,duration:a}),promise:(l,c,p,a)=>s("promise",{title:l,message:c,icon:p,duration:a}),clearAll:()=>t.clear("toast")}},io=hi;var Zr=({ref:t,style:s,...e})=>{let r=useRef(null),o=useMemo(()=>t&&typeof t!="function"&&t.current?t:r,[t]),{style:n,className:i,rest:m}=E(e,o);return jsx("div",{ref:t||r,style:{...n,...s||{}},className:i,...m})};Zr.displayName="Zuz.Box";var u=Zr;var Wr=forwardRef((t,s)=>{let{title:e,message:r,...o}=t,[n,i]=useState(false);return jsxs(u,{className:"--accordion flex cols",...o,children:[jsxs(z,{onClick:m=>i(!n),className:`--toggle flex aic ${n?"--open":""}`.trim(),children:[jsx(V,{className:"--label flex",children:e}),jsx(u,{className:"--arrow flex",children:n?H.arrowUp:H.arrowDown})]}),n&&jsx(u,{className:"--detail",children:r})]})});Wr.displayName="Zuz.Accordion";var Si=Wr;var Ci=({label:t,icon:s,onClick:e,idx:r,selected:o})=>jsx(z,{onClick:e,onMouseMove:n=>document.documentElement.style.setProperty("--tip-m",`${r}`),className:`--action ${o?"--selected":""} aic jcc rel`.trim(),children:typeof s=="string"?jsx(Q,{name:s}):s}),Gr=Ci;var qr=forwardRef((t,s)=>{let{items:e,name:r,selected:o,position:n,...i}=t,m=useRef(null),[f,l]=useState(o||e[0].tag||0),c=useCallback(({x:S,y:P})=>{if(m.current){let R=m.current.getBoundingClientRect();document.documentElement.style.setProperty("--tip-x",`${S-R.left}`),document.documentElement.style.setProperty("--tip-y",`${P-R.top}`),document.documentElement.style.setProperty("--tip-s","1");}},[]),p=useCallback(()=>{m.current&&(m.current.removeEventListener("pointerleave",p),m.current.removeEventListener("pointermove",c),document.documentElement.style.setProperty("--tip-s","0"));},[]),a=useCallback(()=>{m.current&&(m.current.addEventListener("pointerleave",p),m.current.addEventListener("pointermove",c));},[]);useEffect(()=>{m.current&&(document.documentElement.style.setProperty("--tip-w",e.reduce((S,P)=>P.label.length>S.length?P.label:S,"").length.toString()),document.documentElement.style.setProperty("--tip-s","0"),document.documentElement.style.setProperty("--tip-l",`${e.length}`),m.current?.addEventListener("pointerenter",a));},[]);let{className:d,style:T,rest:h}=E(i);return jsxs(u,{ref:m,style:T,className:[`--actionbar flex aic ${d}`,`${!n||n==oe.Auto?"rel":`--${n}`}`].join(" ").trim(),...h,children:[e.map((S,P)=>jsx(Gr,{selected:f===S.tag||o==P,...S,idx:P},`actionbar-action-${S.label.toLowerCase().replace(/\s+/g,"-")}`)),jsx(u,{className:"--tip abs",children:jsx(u,{className:"--track flex aic",children:e.map(({label:S})=>jsx(u,{className:"--lb",children:S},`tool-tip-${S.toLowerCase().replace(/\s+/g,"-")}`))})})]})});qr.displayName="Zuz.ActionBar";var Ni=qr;var Yr=forwardRef((t,s)=>{let{type:e,icon:r,title:o,message:n,iconSize:i,...m}=t,{className:f,style:l,rest:c}=E(m);return jsxs(u,{className:`--alert --${e||ue.Info} flex aic ${f}`.trim(),style:l,...c,children:[jsx(u,{className:`--icon icon-${r||"auto-matic"}`,style:i?{fontSize:i,width:i,height:i}:{},children:!r&&H[e||ue.Info]}),jsxs(u,{className:"--meta flex cols",children:[jsx(V,{className:`--title ${n?"--tm":""}`,children:o||"Lorem ipsum dolor sit amet, consectetur adipiscing elit."}),n&&jsx(V,{className:"--message",h:2,children:n})]})]})});Yr.displayName="Zuz.Alert";var Li=Yr;var Qr=({ref:t,...s})=>{let{variant:e,numeric:r,onConfirm:o,...n}=s,{style:i,className:m,rest:f}=E(n),{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 ${m}`.trim(),style:i,onInput:c,onKeyDown:p=>{p.key=="Enter"&&o?.(p.currentTarget.value);},ref:t,...f})};Qr.displayName="Zuz.Input";var re=Qr;var jr=t=>{let{meta:s,children:e}=t,r=useDelayed(),{label:o,icon:n,...i}=isValidElement(s)?{}:s,{className:m,style:f,rest:l}=E({...i,...i.animate?{animate:{...i.animate,when:r}}:{}});return isValidElement(s)?jsx("li",{style:f,className:m,children:s}):jsxs("li",{style:f,className:m,...l,children:[e,typeof s=="string"?s:o]})};jr.displayName="Zuz.ListItem";var en=jr;var on=forwardRef((t,s)=>{let{items:e,variant:r,direction:o,seperator:n,ol:i,...m}=t,{className:f,style:l,rest:c}=E(m),p=i==true?"ol":"ul";return createElement(p,{className:`--list --${r||K.Small} flex ${o??"cols"} ${f}`.trim(),style:l,ref:s,...c,children:e.map((a,d,T)=>{let h=`${typeof a=="string"?`li-${String(a)}`:isValidElement(a)?`li-${a.key}`||`${d}-${MD5(a.toString())}`:a.label}-${d}`;return jsxs(Fragment,{children:[jsx(en,{meta:a}),n&&T[d+1]?jsx("li",{className:"--list-seperator",children:n},`spt-${d+1}-${h}`):null]},h)})})});on.displayName="Zuz.List";var He=on;var nn=forwardRef((t,s)=>{let{fx:e,action:r,data:o,withStyle:n,onChange:i,...m}=t,{className:f}=E({as:n||""}),{style:l}=E(m),[c,p]=useState(false),[a,d]=useState(o||[]),T=useRef(null),h=useRef(null),S=useRef(null),P=useMemo(()=>m.name||uuid(12),[]),[R,y]=useState(null),[g,I]=useState(null),[v,C]=useState([]),O=useDebounce(x=>{x.target.value==""?(p(false),d([])):r&&x.target.value.trim()!=""&&withPost(r,{query:x.target.value}).then(M=>{"items"in M&&_(M.items).isArray()?(d(M.items),I(x.target.value),C(M.items)):console.error("Action Response should contain items array"),y(null);}).catch(M=>{y(null),d([]);});},250),L=()=>{if(h.current){let x=h.current.getBoundingClientRect(),M=window.innerHeight-x.bottom,A=x.top;if(S.current){let W=S.current;M<W.offsetHeight&&A>M?(W.style.top="auto",W.style.bottom=`${x.height}px`,W.style.maxHeight=`${A-150}px`):(W.style.top=`${x.height+5}px`,W.style.bottom="auto",W.style.maxHeight=`${M-150}px`);}}},$=x=>{if(a.length>0){if((x.key==="ArrowDown"||x.key==="ArrowUp")&&(x.preventDefault(),x.stopPropagation()),x.key==="Escape")y(null),p(false),d([]);else if(x.key==="ArrowDown")y(M=>{let A=M===null||M===a.length-1?0:M+1;return _$1(A),A});else if(x.key==="ArrowUp")y(M=>{let A=M===null||M===0?a.length-1:M-1;return _$1(A),A});else if(x.key==="Enter"&&R!==null){let M=a[R];T.current&&(T.current.value=M,p(false),d([]));}}},B=x=>{T.current&&(T.current.value=x,p(false),d([]));},_$1=x=>{let M=a[x];if(M&&T.current&&(T.current.value=M,T.current.setSelectionRange(M.length,M.length)),S.current){let W=S.current.children[x];W&&W.scrollIntoView({block:"nearest"});}},F=x=>{h.current&&!h.current.contains(x.target)&&(p(false),d([]));},U=()=>{T.current&&T.current.value===g&&(d(v),y(null),L());};return useEffect(()=>(window.addEventListener("resize",L),window.addEventListener("scroll",L,true),document.addEventListener("mousedown",F),()=>{window.removeEventListener("resize",L),window.removeEventListener("scroll",L,true),document.removeEventListener("mousedown",F);}),[]),useEffect(()=>{L();},[a]),jsxs(u,{style:l,ref:h,className:`--autocomplete --${t.size||K.Small} flex aic rel ${f}`.trim(),children:[jsx(re,{ref:T,autoComplete:"off",onChange:O,onKeyDown:$,onFocus:U,...m}),jsx(u,{className:"--arrow rel flex aic jcc",children:a.length>0?H.arrowUp:H.arrowDown}),a.length>0&&jsx(He,{id:P,ref:S,className:"--suggestion-list flex cols abs",items:a.map((x,M)=>({label:x,onClick:A=>{A.preventDefault(),A.stopPropagation(),B(x);},className:R===M?"--current":"",animate:{transition:q.SlideInBottom,curve:G.EaseInOut,delay:clamp(.02*M,.02,.5)}}))})]})});nn.displayName="Zuz.AutoComplete";var Xi=nn;var sn=forwardRef((t,s)=>{let e=useRef(null),r=useMemo(()=>s&&typeof s!="function"&&s.current?s:e,[s]),{style:o,className:n,rest:i}=E(t,r);return !i.src||i.src==""?null:jsx("img",{ref:r,style:o,className:`${n} flex`,...i})});sn.displayName="Zuz.Image";var rt=sn;var an=forwardRef((t,s)=>{let{src:e,variant:r,type:o,crossOrigin:n,referrerPolicy:i,fx:m,as:f,alt:l,color:c,style:p,...a}=t,[d,T,h]=useImage(e??"",n,i),{className:S,style:P,rest:R}=E({fx:m,as:f});return jsx(u,{className:`--avatar --${r||K.Small} --${(o||qo.Circle).toLowerCase()} rel flex aic jcc ${S}`.trim(),style:{background:c||"var(--primary)",...p,...P},...R,children:e?jsx(rt,{src:d,crossOrigin:n,referrerPolicy:i,...a}):jsx(V,{className:"--avatar-label",children:(l?l.charAt(0):"A").toUpperCase()})})});an.displayName="Zuz.Avatar";var rl=an;var nl=({size:t=5,type:s="dead",label:e="",variant:r=K.Small,loading:o=false,spinner:n,...i})=>{let{style:m,className:f,rest:l}=E(i);return jsxs(u,{style:{..._(e).isEmpty()?{width:`${t+4}px`,height:`${t+4}px`}:{},...m},as:`--badge --${r} --${s} rel flex aic jcc ${f}`.trim(),children:[jsx(u,{fx:{transition:q.FadeIn,curve:G.Liquid,duration:.5,when:o},as:"abs abc",children:jsx(he,{type:n})}),_(e).isEmpty()?jsx(u,{style:{width:`${t}px`,height:`${t}px`},as:`--dot --${s}`}):jsx(V,{as:"--label",children:e})]})},sl=nl;var bl=[{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,s=t.getDay();return addDays(t,(6-s)%7||6)},getDateFormat:()=>{let t=new Date,s=t.getDay();return format(addDays(t,(6-s)%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)}],wl=t=>{let s=new Set;return t.filter(e=>{if(e.label=="Later")return true;let r=e.getDate().toISOString().split("T")[0];return s.has(r)?false:(s.add(r),true)})},cn=forwardRef((t,s)=>{let{defaultValue:e,variant:r,onChange:o,...n}=t,{style:i,className:m,rest:f}=E(n),[l,c]=useState(e||new Date),p=startOfMonth(l),a=endOfMonth(l),d=startOfWeek(p),T=endOfWeek(a),h=useMemo(()=>eachDayOfInterval({start:d,end:T}),[d,T]),S=y=>{o?.(y),c(y);},P=()=>{c(y=>new Date(y.getFullYear(),y.getMonth()-1));},R=()=>{c(y=>new Date(y.getFullYear(),y.getMonth()+1));};return jsxs(u,{as:`--calendar flex --${r||"sm"} ${m}`,style:i,children:[jsx(u,{as:"--calendar-quick-select flex cols flex:1",children:wl(bl).map(y=>{let g=y.getDate();return jsxs(z,{onClick:()=>S(g),as:["--calendar-quick-option flex aic gap:5"],children:[jsx(V,{as:"flex:1",children:y.label}),jsx(V,{as:"tar",children:y.getDateFormat()})]},`--dtp-option-label-${y.label}`)})}),jsxs(u,{as:"--calendar-selector flex cols flex:1",children:[jsxs(u,{as:"--calendar-head flex aic jcc gap:4",children:[jsx(V,{as:"flex:1 --calendar-cm bold",children:format(l,"MMMM yyyy")}),jsx(z,{onClick:P,as:"--calendar-chevron",children:H.chevronUpOutline}),jsx(z,{onClick:R,as:"--calendar-chevron",children:H.chevronDownOutline})]}),jsxs(u,{as:"--calendar-days gap:4",children:[["Su","Mo","Tu","We","Th","Fr","Sa"].map(y=>jsx(V,{as:"--calendar-day",children:y},`--calendar-hd-${y}`)),h.map((y,g)=>{let I=isSameMonth(y,l),v=isSameDay(y,l),C=isToday(y);return jsx(z,{disabled:!I,onClick:()=>S(y),as:["--calendar-day --calendar-dd",`${v?"--calendar-dd-selected":""}`,`${C?"--calendar-dd-current":""}`],children:format(y,"d")},`--calendar-day-${g}-${y.getFullYear()}-${y.getMonth()}-${y.getDay()}`)})]})]})]})});cn.displayName="Zuz.Calendar";var go=cn;var mn=(s=>(s.Line="line",s))(mn||{});var fn=forwardRef((t,s)=>{let{data:e,width:r,height:o,lineColor:n,strokeWidth:i=2,gradientStartColor:m,gradientEndColor:f,animated:l,animDuration:c=2,animDelay:p=0,padding:a=0,type:d,...T}=t,{className:h,style:S,rest:P}=E(T),R=useRef(null),y=useResizeObserver(R.current?.parentElement||R),g=typeof r=="number"?r:y.width,I=typeof o=="number"?o:y.height,v={width:g,height:I},C=useId(),{pathD:N,areaPathD:O}=useLineChart(e,v,a+(i||2)),L=useRef(null),$=useRef(null),[B,_]=useState(0),[F,U]=useState(0);return useEffect(()=>{l&&(L.current&&_(L.current.getTotalLength()),$.current&&U($.current.getTotalLength()));},[l,N,O,g,I]),jsx(u,{ref:R,as:`--chart --${d||"line"}-chart ${h}`.trim(),style:{...S,width:r,height:o},...P,children:g>0&&I>0&&jsxs("svg",{viewBox:`0 0 ${g} ${I}`,preserveAspectRatio:"xMidYMid meet",children:[jsx("defs",{children:jsxs("linearGradient",{id:C,x1:"0%",y1:"0%",x2:"0%",y2:"100%",children:[jsx("stop",{offset:"0%",stopColor:m}),jsx("stop",{offset:"100%",stopColor:f})]})}),jsx("path",{ref:$,d:O,fill:`url(#${C})`,stroke:"none",style:l?{strokeDasharray:F,strokeDashoffset:F}:{},children:l&&jsx("animate",{attributeName:"stroke-dashoffset",from:F,to:"0",dur:`${c||2}s`,begin:`${p||0}s`,fill:"freeze"})}),jsx("path",{ref:L,d:N,fill:"none",stroke:n,strokeWidth:i,strokeLinecap:"round",strokeLinejoin:"round",style:l?{strokeDasharray:B,strokeDashoffset:B}:{},children:l&&jsx("animate",{attributeName:"stroke-dashoffset",from:B,to:"0",dur:`${c||2}s`,begin:`${p||0}s`,fill:"freeze"})})]})})});fn.displayName="Zuz.Chart";var Rl=fn;var dn=(o=>(o[o.Sending=0]="Sending",o[o.Sent=1]="Sent",o[o.Delivered=2]="Delivered",o[o.Read=3]="Read",o))(dn||{}),gn=(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))(gn||{});var hn=forwardRef((t,s)=>{let{text:e,media:r,side:o="me",status:n=1,timeStamp:i=Date.now(),arrow:m=true,...f}=t,{className:l,style:c,rest:p}=E(f);return jsx(u,{className:`--bubble-wrapper flex --bw-${o}`.trim(),children:jsxs(u,{className:`--bubble --bubble-${o} ${r?`--with-media --bma-${r.type}`:""} rel flex cols ${m==true?"--b-arrow":""} ${l}`.trim(),style:{...c},...p,children:[e&&jsx(V,{className:"--bubble-text",children:e}),r?r.type=="audio"?jsxs(u,{as:"flex aic --bubble-audio",children:[jsx(te,{className:"--bm-action",children:H.play}),jsx(et,{progress:.7}),jsx(V,{className:"--bm-dur",children:r.duration??"00:13"})]}):r.type=="img"?jsx(u,{as:"--bubble-image",children:jsx(rt,{src:r.source})}):null:null,jsxs(u,{as:"flex aie jce --bubble-stats",children:[jsx(V,{className:"--bubble-stamp tar",children:timeSince(i)}),o=="me"&&jsx(te,{className:`--bubble-status --bs-${n}`,children:n==0?H.pending:n==1?H.done:n==2?H.doneAll:H.doneAll})]})]})})});hn.displayName="Zuz.Bubble";var El=hn;var yn=forwardRef((t,s)=>{let{style:e,className:r,rest:o}=E(t);return jsx("label",{ref:s,style:e,className:r,...o})});yn.displayName="Zuz.Label";var st=yn;var xn=forwardRef((t,s)=>{let{name:e,required:r,type:o,value:n,size:i,variant:m,checked:f,onSwitch:l,...c}=t,[p,a]=useState(f||false),d=useRef(null),{variant:T}=X(true);return useImperativeHandle(s,()=>({setChecked(h,S=true){a(h),d.current&&(d.current.checked=h),S&&l&&l(h,n||"cb");},toggle(h=true){d.current&&(d.current.checked=!p),h&&l&&l&&l(!p,n||"cb"),a(!p);}})),jsxs(st,{className:`--${(o||Se.Default).toLowerCase()} ${!o||o==Se.Default?"--checkbox":"--switch"} --${m||T||K.Small} flex aic jcc ${p?"is-checked":""} rel`.trim(),...c,children:[(!o||o==Se.Default)&&H.check,jsx(re,{ref:d,defaultChecked:p,value:n||"cb",type:"checkbox",className:"abs",name:e,required:r||false,onChange:h=>{l&&l(h.target.checked,n||"cb"),a(h.target.checked);}})]})});xn.displayName="Zuz.CheckBox";var at=xn;var $l=({ref:t,...s})=>{let{code:e,lang:r="tsx",showLines:o=false,highlight:n="",as:i,fx:m,...f}=s,l=useRef(null),{className:c,style:p,rest:a}=E({as:`rel p:20 br:8 bg:shade-1 overflow:auto font:mono ${i}`,fx:m},l),d=useMemo(()=>{let h=new Set;return n.split(",").forEach(S=>{if(S.includes("-")){let[P,R]=S.split("-").map(Number);for(let y=P;y<=R;y++)h.add(y);}else S&&h.add(Number(S));}),h},[n]),T=useMemo(()=>{let h=e.split(`
9
+ `);for(;h.length>0&&h[0].trim()==="";)h.shift();for(;h.length>0&&h[h.length-1].trim()==="";)h.pop();let S=h[0]?.match(/^\s*/)?.[0].length||0,P=h.map(y=>{let g=y.match(/^\s*/)?.[0].length||0,I=Math.min(g,S);return y.slice(I)}),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 P.map((y,g)=>{let I=y.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),v=d.has(g+1),C=[];R.forEach(N=>{I=I.replace(N.re,O=>{let L=`ZUZ_ID_${C.length}_ZUZ`;return C.push(`<span class="--token-${N.name}">${O}</span>`),L});});for(let N=C.length-1;N>=0;N--)I=I.replace(`ZUZ_ID_${N}_ZUZ`,C[N]);return `<div class="--code-line ${o==true?"--with-ln":""} ${v?"--is-highlighted":""}">
10
+ ${o==true?`<span class="--line-number">${g+1}</span>`:""}
11
+ <span class="--line-content">${I||" "}</span>
12
+ </div>`}).join("")},[e,d]);return jsx(u,{as:`--code-block ${c}`,style:p,...f,children:jsx("pre",{ref:t,children:jsx("code",{className:`--code --lang-${r}`,dangerouslySetInnerHTML:{__html:T}})})})},zl=$l;var wn=({onSelect:t,meta:s,selected:e})=>{let r=useRef(null),{index:o,icon:n,label:i}=s,[m,f]=useState({x:0,width:0}),l=useDelayed();return useLayoutEffect(()=>{if(l&&r.current){let{width:c,x:p}=r.current.getBoundingClientRect();f({x:p,width:c}),e&&t(o,c,p,s,true);}},[l,r.current]),useEffect(()=>{e&&t(o,m.width,m.x,s,false);},[e]),jsxs(z,{onClick:()=>t(o,m.width,m.x,s,false),ref:r,className:`--segment-item flex aic rel ${e?"--segment-active":""}`.trim(),children:[n?typeof n=="string"?jsx(Q,{name:n,as:"--segment-icon"}):jsx(u,{as:"--segment-icon flex aic jcc",children:n}):null,i&&String(i).trim()!=""&&jsx(u,{className:"--segment-label",children:i||`Item ${o}`})]})};wn.displayName="SelectTabItem";var vn=wn;var Cn=forwardRef((t,s)=>{let{fx:e,items:r,selected:o,variant:n,onSwitch:i,...m}=t,[f,l]=useState(o||0),c=useRef(false),p=useRef(f),{className:a,style:d,rest:T}=E(m),h=useRef(null),S=useRef(null),{variant:P}=X(true),R=(y,g,I,v,C)=>{if((C||f!=y&&f!=-2)&&(l(y),p.current=f,c.current&&i?.(v)),h.current){let N=S.current?.getBoundingClientRect();h.current.style.setProperty("--w",`${g}px`),h.current.style.setProperty("--x",`${N?I-N.left:I}px`);}};return useImperativeHandle(s,()=>({setSelected:y=>{typeof y=="number"&&y!=f&&l(y);}}),[f]),useEffect(()=>{c.current=true;},[]),jsxs(u,{ref:S,"data-selected":f,className:`${a} --segmented --${n||P||K.Medium} flex aic rel`,style:d,...T,children:[jsx(u,{ref:h,className:"--segment-tab abs"}),r.map((y,g)=>jsx(vn,{onSelect:R,selected:f==g,meta:{...y,index:g}},`segment-${y.label}-${g}`))]})});Cn.displayName="Zuz.SelectTabs";var it=Cn;var Rn=forwardRef((t,s)=>{let{type:e,...r}=t,o=useDelayed(),{colorScheme:n,setColorScheme:i}=Gt(),m=useCallback(()=>{i(n=="dark"?"light":n=="light"?"system":"dark");},[n]),{className:f,style:l}=E(r),c=useMemo(()=>e=="system"?[{tag:"light",index:0,label:"",icon:H.colorSchemeLight},{tag:"system",index:1,label:"",icon:H.colorSchemeSystem},{tag:"dark",index:2,label:"",icon:H.colorSchemeDark}]:[{tag:"light",index:0,label:"",icon:H.colorSchemeLight},{tag:"dark",index:2,label:"",icon:H.colorSchemeDark}],[]),p=useMemo(()=>["light","system","dark"].indexOf(n),[n]);return !o||p==-1?null:e=="system"||e=="switch"?jsx(it,{className:`--color-scheme --${e}`,onSwitch:({tag:a})=>{i(a);},selected:p,items:c,...r}):jsx(z,{onClick:m,style:l,as:`--color-scheme-switch --${r.variant||K.Small} ${f}`.trim(),children:n=="system"?H.colorSchemeSystem:n=="light"?H.colorSchemeLight:H.colorSchemeDark})});Rn.displayName="Zuz.ColorScheme";var tc=Rn;var Nn=forwardRef((t,s)=>{let[e,r]=useState("wait"),{title:o,message:n,acceptLabel:i,rejectLabel:m,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(u,{fx:{from:{x:-1e3},to:{x:0},when:e=="pending",curve:G.EaseInOut,duration:.5,delay:e=="accepted"?0:3},as:`--cookie-consent --${e} --${f||oe.Left} flex cols`,children:[jsx(V,{as:"--title",children:o||"This site uses cookies"}),jsx(V,{as:"--message",children:n||"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(u,{as:"--footer flex aic",children:[jsx(z,{onClick:c=>l(1),as:"--accept",children:i||"Accept All"}),jsx(z,{onClick:c=>l(0),as:"--reject",children:m||"Cancel"})]})]})});Nn.displayName="Zuz.CookiesConsent";var sc=Nn;var Ln=forwardRef((t,s)=>{let {type:e,value:r,min:o,max:n,step:i,onChange:m,roundValue:f,...l}=t,{className:c,style:p,rest:a}=E(l),d=useRef(i||.01).current,T=useRef(o||0).current,h=useRef(n||1).current,S=useRef(r||0).current,P=useRef(null),R=useRef(null),y=useRef(null);useRef(null);let I=useRef(null),v=useRef(null),C=(A,W,D)=>(A-W)/(D-W)*100,N=A=>{if(R.current){let W=parseFloat(A.currentTarget.value),D=C(W,parseFloat(A.currentTarget.min),parseFloat(A.currentTarget.max));R.current.style.setProperty("--value",`${D}`),R.current.setAttribute("data-value",`${W}`),m&&m(f?+W.toFixed(2):W);}},[O,L]=useState(false),[$,B]=useState(0),[_,F]=useState(0),U=A=>{L(true),B(A.clientX),F(R.current?parseFloat(R.current.getAttribute("data-value")):0),document.body.style.cursor="ew-resize";},x=A=>{if(O){let W=A.clientX-$,D=Math.max(T,Math.min(_+W*d,h));R.current&&(R.current.setAttribute("data-value",`${D}`),v.current.textContent=f?D.toFixed(2):D.toString(),m&&m(f?+D.toFixed(2):D));}},M=()=>{L(false),document.body.style.cursor="auto";};return useEffect(()=>{R.current&&R.current.style.setProperty("--value",P.current?`${C(parseFloat(P.current.value),parseFloat(P.current.min),parseFloat(P.current.max))}`:S.toString());},[]),useEffect(()=>(O?(document.addEventListener("mousemove",x),document.addEventListener("mouseup",M)):(document.removeEventListener("mousemove",x),document.removeEventListener("mouseup",M)),()=>{document.removeEventListener("mousemove",x),document.removeEventListener("mouseup",M);}),[O]),jsx(u,{ref:R,"data-value":S||0,className:`--slider --${e||dt.Default} flex rel ${c}`.trim(),style:{...p},children:dt.Text===e?jsx(Fragment$1,{children:jsx(V,{ref:v,onMouseDown:U,className:"--slider-text",children:S||0})}):jsxs(Fragment$1,{children:[jsx(u,{ref:I,className:"--slider-track abs fill"}),jsx(u,{ref:y,className:"--slider-knob abs"}),jsx(re,{ref:P,onInput:N,className:"abs fill",tabIndex:0,type:e||dt.Default,defaultValue:S||0,step:d,max:h,min:T})]})})});Ln.displayName="Zuz.Slider";var vo=Ln;var Mn=forwardRef((t,s)=>{let{src:e,shape:r,size:o,...n}=t,{style:i,className:m,rest:f}=E(n),{canvasRef:l,crop:c,setScale:p,handleMouseDown:a,handleMouseUp:d,handleMouseMove:T}=useImageCropper(e,o||200,r||CropShape.Circle);return useImperativeHandle(s,()=>({getCropped(){return c()},setScale(h){p(h);}})),jsxs(u,{as:`--cropper --${r||CropShape.Circle} ${m}`,style:i,...f,children:[jsx("canvas",{ref:l,width:o||200,height:o||200,onMouseDown:a,onMouseUp:d,onMouseLeave:d,onMouseMove:T}),jsx(u,{as:"--cropper-slider",children:jsx(vo,{onChange:h=>p(h),min:0,max:1,step:.01,value:1})})]})});Mn.displayName="Zuz.Cropper";var pc=Mn;var fc=(e=>(e.Circle="circle",e.Square="square",e))(fc||{});var Dn=forwardRef((t,s)=>{let{items:e,maxItems:r}=t,o=useMemo(()=>{let m=typeof e=="string",f=m?[]:e;return m&&e.split(",").forEach(l=>{f.push({label:l});}),f},[e]),i=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(He,{ref:s,className:"--crumb flex aic",direction:"rows",seperator:jsx(u,{as:"--crumb-chevron",children:H.chevronRightOutline}),items:i.map((m,f,l)=>m.ID=="."?jsx(u,{as:"flex aic gap:3",children:Array(3).fill(null).map(()=>jsx(u,{as:"w:4 h:4 bg:$text r:10"},`--crumb-placeholder-${f}`))}):jsxs(z,{onClick:()=>m.action?.(),className:"--crumb-item",disabled:!l[f+1],children:[m.icon&&jsx(Q,{as:"--crumb-icon",name:m.icon}),jsx(V,{as:"--crumb-label",children:m.label})]},`${m.label.replace(/\s+/g,"-").toLowerCase()}-${f}`))})});Dn.displayName="Zuz.Crumb";var gc=Dn;var An=forwardRef((t,s)=>{let{icon:e,defaultValue:r,value:o,size:n,variant:i,numeric:m,type:f,onConfirm:l,...c}=t,[p,a]=useState(false),[d,T]=useState(r||null),{style:h,className:S,rest:P}=E(c),R=useRef(null),y=useRef(null),{reposition:g}=tt(y,{direction:oe.Bottom,offset:2}),I=C=>{m&&(C.currentTarget.value=C.currentTarget.value.replace(/[^0-9.]/g,"").replace(/(\..*?)\..*/g,"$1"));};useEffect(()=>{let C=N=>{let O=N.target,L=R.current?.contains(O),$=y.current?.contains(O);!L&&!$&&a(false);};return p&&document.addEventListener("mousedown",C),()=>{document.removeEventListener("mousedown",C);}},[p]),useEffect(()=>{let C=N=>{N.key==="Escape"&&p&&(a(false),R.current?.focus());};return document.addEventListener("keydown",C),()=>document.removeEventListener("keydown",C)},[p]);let v=()=>{a(true);};return useEffect(()=>{p&&g();},[p,g]),jsx(Fragment$1,{children:jsxs(u,{as:`--date-picker ${i?`--${i}`:""} rel flex aic ${S}`,"data-value":d?d.toISOString():"",children:[e?typeof e=="string"?jsx(Q,{as:"mr:10 c:#666",name:e}):e:jsx(te,{as:"--date-picker-icon flex aic jcc",children:H.calendar}),jsx("input",{ref:R,value:d?format(d,"EEE, MMM d YYY hh:mm a"):o||"",className:`--input ${i?`--${i}`:""} flex`.trim(),style:h,onFocus:v,onInput:I,autoComplete:"new-password",onKeyDown:C=>{C.key=="Enter"&&l?.(C.currentTarget.value);},...P}),jsx(u,{"aria-hidden":!p,ref:y,fx:{from:{y:5,opacity:0},to:{y:0,opacity:1},when:p,duration:.05},as:`--date-picker-chooser flex aic ${i?`--${i}`:""}`,children:jsx(go,{defaultValue:d,onChange:C=>{T(C),a(false);}})})]})})});An.displayName="Zuz.DatePicker";var bc=An;var $n=forwardRef((t,s)=>{let{icon:e,variant:r,position:o}=t;return jsx(z,{className:`--fab fixed --${r||K.Large} --${o||"bottomright"}`,children:e||H.plus})});$n.displayName="Zuz.Fab";var Cc=$n;var zn=t=>{let{names:s,strength:e}=t,r={[gt.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-${gt.Gooey}`)};return useEffect(()=>{},[s]),jsx("svg",{xmlns:"http://www.w3.org/2000/svg",version:"1.1",children:jsx("defs",{children:(s||[gt.Gooey]).map(o=>r[o](e))})})};zn.displayName="Zuz.Filters";var Rc=zn;var Ee=null,me=null,Fn=forwardRef((t,s)=>{let{title:e,message:r,transition:o,curve:n,speed:i,type:m,actionPosition:f,spinner:l,loadingMessage:c,onShow:p,onHide:a,...d}=t,{className:T,style:h,rest:S}=E(d),[P,R]=useState(e||""),[y,g]=useState(r||""),[I,v]=useState(null),[C,N]=useState(m||fe.Default),O=useMemo(()=>uuid(12),[]),[L,$]=useState(false),B=useRef(null),_=useRef(null),[F,U]=useState(false),[x,M]=useState(true),A=useRef(null),W=y;useImperativeHandle(s,()=>({setLoading(Z){U(Z);},showDialog(Z,Y,J,ee){Ee&&(clearTimeout(Ee),me&&clearTimeout(me),B.current.classList.remove("--wobble"),setTimeout(()=>B.current.classList.add("--wobble"),50),me=setTimeout(()=>{B.current.classList.remove("--wobble"),me=null;},500)),N(fe.Dialog),Y&&g(Y),Z&&R(Z),J&&v(J.reduce((pe,ne)=>(pe.push({...ne,key:ne.key||uuid(12)}),pe),[])),$(true),setTimeout(()=>ee?ee():()=>{},1e3);},dialog(Z,Y,J,ee){Ee&&(clearTimeout(Ee),me&&clearTimeout(me),B.current.classList.remove("--wobble"),setTimeout(()=>B.current.classList.add("--wobble"),50),me=setTimeout(()=>{B.current.classList.remove("--wobble"),me=null;},500)),N(fe.Dialog),g(Y),R(Z),J&&v(J.reduce((pe,ne)=>(pe.push({...ne,key:ne.key||uuid(12)}),pe),[])),$(true),setTimeout(()=>ee?ee():()=>{},1e3);},error(Z,Y){this.show(Z,Y,fe.Error);},warn(Z,Y){this.show(Z,Y,fe.Warn);},success(Z,Y){this.show(Z,Y,fe.Success);},show(Z,Y,J){Ee&&(clearTimeout(Ee),me&&clearTimeout(me),_.current=B.current.style.transform,B.current.style.transform="",B.current.classList.remove("--wobble"),setTimeout(()=>{B.current.classList.add("--wobble"),B.current.style.transform=`${_.current} scale(.9)`.trim();},50),me=setTimeout(()=>{B.current.classList.remove("--wobble"),B.current.style.transform=_.current||"",me=null;},500)),Ee=setTimeout(()=>{$(false),Ee=null,me=null;},(Y||4)*1e3),N(J||fe.Default),g(Z),$(true),p?.();},hide(){$(false),a?.();}}));let D=useMemo(()=>{let Z={when:L,duration:i||.3,delay:.1};if(C==fe.Dialog){if(o){let{from:Y,to:J}=Xe(o,20);return {from:Y,to:J,curve:n||G.EaseInOut,...Z}}return {from:{scale:0,x:"-50%",y:"-50%",opacity:0},to:{scale:1,x:"-50%",y:"-50%",opacity:1},curve:G.Spring,...Z}}else return {from:{scale:0,x:"-50%",y:"-10vh",opacity:0},to:{scale:1,x:"-50%",y:0,opacity:1},curve:G.Spring,...Z}},[L,C]);return useEffect(()=>{A.current&&clearTimeout(A.current),L?M(true):A.current=setTimeout(()=>M(false),1e3);},[L]),C==fe.Dialog?jsxs(Fragment$1,{children:[jsx(Me,{when:L}),jsxs(u,{className:`--sheet --sheet-${C.toLowerCase()} ${L?"is-visible":""} ${T} fixed`.trim(),style:h,fx:D,...S,ref:B,children:[jsx(ye,{when:F,spinner:l,message:c}),jsxs(u,{className:"--head flex aic rel",children:[jsx(u,{className:`--${P?"title":"dot"} flex aic rel`,children:P||""}),jsx(z,{onClick:Z=>$(false),className:"--closer abs",children:"\xD7"})]}),jsx(u,{className:`--body flex aic rel ${I?"":"--no-action"}`.trim(),children:x?W:null}),I&&jsx(u,{className:`--footer flex aic rel ${f?f==zt.Center?"jcc":"":"jce"}`.trim(),children:I.map((Z,Y)=>jsx(z,{onClick:J=>Z.handler?Z.handler():Z.onClick?Z.onClick():console.log("onClick Handler missing"),className:"--action",children:Z.label},`sheet-${O}-action-${Z.key}`))})]})]}):jsx(u,{className:`--sheet --sheet-${C.toLowerCase()} ${T} abs`.trim(),style:h,...S,fx:D,ref:B,children:L?y:null})}),ct=t=>typeof t=="object"&&t!=null&&"setLoading"in t&&"success"in t&&"error"in t;Fn.displayName="Zuz.Sheet";var Lc=Fn;var Zn=({ref:t,...s})=>{let{name:e,cover:r,spinner:o,errors:n,action:i,children:m,withData:f,beforeSubmit:l,onSubmit:c,onError:p,onSuccess:a,resetOnSuccess:d,...T}=s,{className:h,style:S,rest:P}=E(T),[R,y]=useState(false),g=useRef(null),I=useRef(null),v=useRef(null),C=io(),N=useCallback(x=>g.current?g.current.querySelectorAll(x):[],[g.current]),O=x=>({name:x.name||x.getAttribute("name")||x.getAttribute("data-name"),required:x.required?true:x.getAttribute("data-required")?x.getAttribute("data-required")=="true":false,with:x.with||x.getAttribute("with")}),L=x=>{let M=[];return x.querySelectorAll(".--input").forEach(A=>{M.push(A.value);}),M.join("")},$=useCallback(x=>{let{required:A}=O(x);if(A){if(x.type=="checkbox"&&x.checked==false)return false;if(x.classList.contains("--otp")){let D=L(x);if(D==""||D.length<parseInt(x.getAttribute("data-size")))return false}if(x.classList.contains("--select")&&x.querySelector("button.--selected").dataset.value=="-1"||x.value=="")return false}if(x.getAttribute("with")){let D=x.getAttribute("with");switch(D.includes("@")&&(D=D.split("@")[0],D=="match"&&(D=Ce.MatchField)),D.toUpperCase()){case Ce.IPV4:return _(x.value).isIPv4();case Ce.IPV6:return _(x.value).isIPv6();case Ce.Email:return _(x.value).isEmail();case Ce.Uri:try{return new URL(x.value),!0}catch{return false}case Ce.Password:return console.log("Add FORMVALIDATION.Password"),false;case Ce.MatchField:let[Z,Y,J]=x.getAttribute("with").split("@"),ee=document.querySelector(`[name=${Y.trim()}]`);if(!ee)return false;switch(J||"direct-match"){case "if-not-empty":if(ee&&!_(ee.value).isEmpty()&&ee.value!=x.value)return false;break;case "direct-match":if(ee&&ee.classList.contains("--otp")&&x.classList.contains("--otp")&&L(ee)!=L(x))return false;if(ee&&ee.value!=x.value)return false;break}break;default:return true}}return true},[g.current]),B=useCallback(()=>{let x={},M={},A=null,W=null;if(Array.from(N("[name]")).forEach(D=>{let{name:Z,required:Y,with:J}=O(D),ee=true;(Y||J)&&(ee=$(D)),x[Z]={valid:ee,value:D.type=="checkbox"?D.checked==true?D.value:false:D.classList.contains("--otp")?L(D):D.classList.contains("--select")?D.querySelector("button.--selected").dataset.value:D.value},M[Z]=D.type=="checkbox"?D.checked==true:D.classList.contains("--otp")?L(D):D.classList.contains("--select")?D.querySelector("button.--selected").dataset.value:D.value,ee?D.classList.remove("input-with-error"):(A==null&&n&&(A=D,W=n[Z]),D.classList.add("input-with-error"));}),A){let D=A;if(D.classList.contains("--otp"))for(let Z of Array.from(D.querySelectorAll(".--input"))){let Y=Z;if(Y.value==""){Y.focus();break}}else D.focus();}return {error:A!=null,errorMsg:W||"Fix errors to continue...",data:x,payload:M}},[g.current]),_$1=useCallback(()=>{let{error:x,errorMsg:M,payload:A}=B();x?C.error(M):i?startTransition(async()=>{l&&l(A),ct(r)?r.setLoading(true):y(true),C.clearAll(),withPost(i,{...A,...f||{}}).then(W=>{let D=W;ct(r)?r.setLoading(false):y(false),d&&Array.from(N("[name]")).forEach(Z=>{Z instanceof HTMLInputElement&&(Z.value="");}),a?a(D):(C.clearAll(),C.success(D.message||"Redirecting..."));}).catch(W=>{ct(r)?r.setLoading(false):y(false),p?p(W):C.error(W.message||"We cannot process your request at this time.");});}):c&&c(A);},[i,I.current,g.current]),F=useCallback(()=>{let x=N("[type=submit]");!x||x.length==0?console.warn("You should add at least 1 button with type=`SUBMIT`"):x.forEach(M=>{M.addEventListener("click",_$1);});},[g.current]),U=useMemo(()=>addPropsToChildren(m,x=>x.props.type=="submit",x=>({ref:v})),[m]);return useImperativeHandle(t,()=>({setLoading(x){if(x){I.current?.hide();try{C.clearAll();}catch{}}y(x);},showError(x){typeof x=="string"?C.error(x):I.current.error(x,4);},hideError(){I.current.hide();try{C.clearAll();}catch{}},init(){F();},submit(){_$1();}})),useEffect(F,[]),jsxs(u,{ref:g,style:S,className:`--form flex rel ${h} ${e?`--form-${e.replace(/\s+/g,"-")}`:""}`,propsToRemove:["withData","action","onSubmit","onSuccess","onError"],children:[!ct(r)&&jsx(ye,{message:r?r.message||void 0:"working",spinner:o,color:r&&"color"in r?r.color:"#ffffff",when:R}),U]})};Zn.displayName="Zuz.Form";var zc=Zn;var Kn=t=>{let {ref:s,cols:e,rows:r,gap:o,gapX:n,gapY:i,align:m,justify:f,inline:l,flow:c,autoCols:p,autoRows:a,template:d,...T}=t;useRef(null);let {className:S,style:P,rest:R}=E(T),y=I=>typeof I=="number"?`repeat(${I}, 1fr)`:I,g={display:l?"inline-grid":"grid",gridTemplateColumns:y(e),gridTemplateRows:y(r),gap:o,columnGap:n,rowGap:i,alignItems:m,justifyContent:f==="between"?"space-between":f==="around"?"space-around":f,gridAutoFlow:c,gridAutoColumns:p,gridAutoRows:a,gridTemplateAreas:d,...P};return jsx(u,{ref:s,as:`--grid ${S}`.trim(),style:g,...R})};Kn.displayName="Zuz.Grid";var Kc=Kn;var Wn=t=>typeof t=="string"&&t.includes("+"),Un={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"},Gn={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 Xn=forwardRef(({children:t,keys:s,variant:e},r)=>{let o=useMemo(()=>{if(Wn(s)){let n=null;return {keys:String(s).split("+").reduce((m,f,l,c)=>(c[l+1]?m.push(f):n=f.toUpperCase(),m),[]),children:n}}return {keys:s,children:String(t).toUpperCase()}},[s]);return jsxs(u,{as:`--keyboard-keys --${e||K.Small} flex aic`,children:[(Array.isArray(o.keys)?o.keys:[o.keys]).map(n=>jsx("abbr",{title:Gn[n],children:Un[n]},n)),jsx(te,{children:o?.children??t})]})});Xn.displayName="Zuz.KeyboardKeys";var No=Xn;var Qn=forwardRef((t,s)=>{let e=useNetworkStatus(),{onlineMessage:r,offlineMessage:o,variant:n}=t;return jsxs(u,{fx:{from:{x:"-50%",y:200,opacity:0},to:{x:"-50%",y:0,opacity:1},when:e==false,curve:G.Spring,duration:.5,delay:2},className:`--network-manager --${e==true?"online":"offline"} --${n||K.Small} fixed flex`,children:[jsx(u,{className:"--ico",children:e?H[ue.Success]:H[ue.Error]}),jsx(V,{as:"--message",children:e?r||"internet connection restored :)":o||"no internet connection"})]})});Qn.displayName="Zuz.NetWorkManager";var Qc=Qn;var Eo=(e=>(e.Table="table",e.Gooey="gooey",e))(Eo||{});var es=forwardRef((t,s)=>{let{itemCount:e,itemsPerPage:r,startPage:o,pageRange:n,paginationStyle:i,breakLabel:m,prevLabel:f,nextLabel:l,hash:c,loading:p,seperator:a,renderOnZeroPageCount:d,onPageChange:T,...h}=t,S=useMemo(()=>toHash(numberInRange(4,8)),[]),P=useCallback(B=>`${toHash(B,c||6,S)}${a||""}${S}`,[S]),R=useMemo(()=>m||"...",[m]),[y,g]=useState({id:c?o?typeof o=="number"?P(o):o:1:o||1,label:o||1}),{style:I,className:v,rest:C}=E(h),N=useCallback(B=>typeof B=="number"?B:+B.label,[]);if(!e)throw new Error('"itemCount" prop is required');let O=useMemo(()=>Math.ceil(e/r),[e,r]),L=useMemo(()=>{let B=[],_=Math.max(N(y)-(n||2),1),F=Math.min(N(y)+(n||2),O);_>1&&B.push({id:c?P(1):1,label:1}),_>2&&B.push({id:-1,label:R});for(let U=_;U<=F;U++)B.push({id:c?P(U):U,label:U});return F<O-1&&B.push({id:-1,label:R}),F<O&&B.push({id:c?P(O):O,label:O}),B},[y]),$=useCallback(B=>{let _=B;+_.label<1||+_.label>O||(g(_),T?.(_));},[e,r,y]);return L.length<=1&&(d??false)===false?null:jsxs(u,{ref:s,as:`--pagination --pgt-${i||"table"} flex aic w:100% jcc ${v}`,children:[jsx(u,{as:"flex flex:1 aic --pgt-btns",children:(L.length>1?L:[{id:1,label:1},{id:-1,label:R}]).map((B,_,F)=>jsx(z,{disabled:B.id==-1||N(y)==+B.label,className:(typeof B=="string"?B:B.label)==N(y)?"--current-page":"",onClick:U=>$(B),children:typeof B=="string"?B:B.label},`--pg-${_}-${B.id}`))}),jsx(u,{as:"flex aic jcc flex:1 --pagination-label",children:[`Showing ${(N(y)-1)*r+1} - `,`${Math.min(N(y)*r,e)} of ${e} items`].join(" ")}),jsxs(u,{as:"flex aic jce flex:1 --pgt-btns --pgt-nav",children:[jsx(z,{disabled:N(y)<=1,onClick:B=>$({id:c?P(N(y)-1):N(y)-1,label:N(y)-1}),children:H.chevronLeftOutline}),jsx(z,{disabled:L.length<=1||N(y)==N(L[L.length-1]),onClick:B=>$({id:c?P(N(y)+1):N(y)+1,label:N(y)+1}),children:H.chevronRightOutline})]})]})});es.displayName="Zuz.Pagination";var Lo=es;var os=forwardRef((t,s)=>{let{strenthMeter:e,onChange:r,...o}=t;"type"in o&&delete o.type;let{style:n,className:i,rest:m}=E(o),[f,l]=useState(false),[c,p]=useState(""),a=useMemo(()=>checkPasswordStrength(c),[c]),d=useDebounce(T=>{e&&p(T.target.value),r&&r(T);},100);return useEffect(()=>{},[]),jsxs(u,{as:"w:100% flex cols",children:[jsxs(u,{style:n,className:"--password flex aic rel",children:[jsx(re,{ref:s,type:f?"text":"password",className:i,onChange:d,...m}),jsx(z,{tabIndex:-1,onClick:()=>l(T=>!T),className:"--toggle flex aic jcc abs",children:f?H.eye:H.eyeSlash})]}),e&&jsxs(u,{as:`flex aic --password-meter --pb-score-${a.score}`,style:n,children:[jsxs(u,{as:"--password-bars flex aic",children:[jsx(u,{as:`--pbar ${a.score>=1?"--pb-on":""}`.trim()}),jsx(u,{as:`--pbar ${a.score>=2?"--pb-on":""}`.trim()}),jsx(u,{as:`--pbar ${a.score>=3?"--pb-on":""}`.trim()}),jsx(u,{as:`--pbar ${a.score>=4?"--pb-on":""}`.trim()}),jsx(u,{as:`--pbar ${a.score>=5?"--pb-on":""}`.trim()})]}),jsx(V,{as:"--password-meter-label","aria-hidden":true,children:a.result})]})]})});os.displayName="Zuz.Password";var im=os;var ns=forwardRef((t,s)=>{let{size:e,length:r,mask:o,...n}=t,i=useRef([]),m="pinput",f=false,l={};"with"in n&&(l={with:n.with},delete n.with),"type"in n&&delete n.type,"name"in n&&(m=n.name,delete n.name),"required"in n&&(f=true,delete n.required);let{style:c}=E(n),p=a=>{let d=a.currentTarget,T=i.current[parseInt(d.dataset.index)+1],h=i.current[parseInt(d.dataset.index)-1];d.value.length===1&&T?T.focus():d.value.length===0&&h&&h.focus();};return useEffect(()=>{i.current=i.current.slice(0,e||r);},[e||r]),jsx(u,{name:m,style:c,className:"--otp flex aic rel","data-required":f,"data-size":e||r||4,...l,children:Array(e||r||4).fill(1).map((a,d)=>jsx(re,{autoComplete:"new-password","data-index":d,ref:T=>{i.current[d]=T;},numeric:true,onChange:p,maxLength:1,placeholder:o?"\xB7":"0",type:o?"password":"text",...n},`pin-${d}`))})});ns.displayName="Zuz.PinInput";var pm=ns;var ss=forwardRef((t,s)=>{let{children:e,className:r,name:o,required:n,type:i,value:m,variant:f,checked:l,onSwitch:c,...p}=t,[a,d]=useState(l||false),{variant:T}=X(true),h=useRef(null);return jsxs(st,{className:`${r} --${(i||_t.Default).toLowerCase()} --radio${!i||i==_t.Default?"":"card"} --${f||T||K.Small} flex aic rel`.trim(),...p,children:[jsx(re,{ref:h,defaultChecked:a,value:m||"rd",type:"radio",className:"abs",name:o,required:n||false,onChange:S=>{c&&c(S.target.checked,m||"cb"),d(S.target.checked);}}),jsx(u,{className:"--dot rel",children:jsx(u,{className:"--rod abs abc"})}),jsx(u,{className:"--value",children:e})]})});ss.displayName="Zuz.Radio";var gm=ss;var as=forwardRef((t,s)=>{let{fx:e,withStyle:r,as:o,reverse:n=false,searchIcon:i=H.search,hideSearchIcon:m=false,clearIcon:f=H.close,hideClearIcon:l=false,onChange:c,onClear:p,...a}=t,{style:d,className:T}=E({as:t.as}),[h,S]=useState(""),{variant:P}=X(true),R=useRef(null),y=useMemo(()=>jsx(z,{tabIndex:-1,onClick:v=>I(),className:"--send flex aic jcc",variant:t.variant||K.Small,children:h!==""?!l&&(typeof f=="string"?jsx(Q,{name:f,as:"--search-action"}):f):!m&&(typeof i=="string"?jsx(Q,{name:i,as:"--search-action"}):i)}),[n,i,l,f,m]);"type"in t&&delete t.type;let g=v=>{S(v.target.value),c?.(v.target.value);},I=v=>{h.trim()!==""&&(S(""),c?.(""),R.current&&(R.current.value="",t.onConfirm?.("")));};return useImperativeHandle(s,()=>({focus:()=>R.current?.focus(),value:()=>R.current?.value})),useEffect(()=>{},[]),jsxs(u,{style:d,className:`--search ${n?"--search-rev":""} --${t.variant||P||K.Medium} flex aic ${typeof t.as=="string"&&t.as.includes("abs")?"":"rel"} ${T}`.trim(),children:[n&&y,jsx(re,{ref:R,onChange:g,...a}),t.shortcut&&jsx(No,{keys:t.shortcut,as:"abs"}),!n&&y]})});as.displayName="Zuz.Search";var Cm=as;var ls=({value:t,updateValue:s,o:e})=>jsxs(z,{onClick:r=>s(e),as:"--select-option-item",className:t&&(typeof e=="string"?e:e.value)==(typeof t=="string"?t:t.value)?"selected":"",children:[e.icon&&jsx(Q,{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})]});ls.displayName="Option";var cs=ls;var ps=({ref:t,...s})=>{let{selected:e,options:r,label:o,name:n,variant:i,search:m,searchPlaceholder:f,maxHeight:l,arrowDownIcon:c=H.arrowDown,arrowUpIcon:p=H.arrowUp,expanded:a,onChange:d,...T}=s,[h,S]=useState(e?typeof e=="string"?r.find(x=>x.value===e):e:r[0]),[P,R]=useState(false),[y,g]=useState(null),I=useRef(null),v=useRef(null),C=useRef(null),N=useId(),O=useMemo(()=>n||N,[]),{reposition:L}=tt(C,{direction:$t.Bottom,offset:2}),{variant:$}=X(true),{className:B,style:_,rest:F}=E(T),U=x=>{S(x),R(false),d&&d(x);};return useImperativeHandle(t,()=>({setSelected:x=>{if(typeof x=="string"){let M=r.find(A=>A.value===x);M&&S(M);}else S(x);},getValue:()=>h||null})),useEffect(()=>{if(!P)return;let x=()=>{L();};return window.addEventListener("scroll",x,true),window.addEventListener("resize",L),()=>{window.removeEventListener("scroll",L,true),window.removeEventListener("resize",L);}},[P,L]),useEffect(()=>{if(!P){v.current&&(v.current.value=""),g(null);return}v.current?.focus(),L();let x=A=>{C.current&&!C.current.contains(A.target)&&R(false);},M=setTimeout(()=>{document.addEventListener("click",x);},0);return ()=>{clearTimeout(M),document.removeEventListener("click",x);}},[P,L]),jsxs(u,{className:`--select --${a==true?"expanded":""} --${i||$} ${n?`--${n}`:""} rel`.trim(),name:O,children:[jsxs(z,{ref:I,"data-value":h?typeof h=="string"?h:h.value:h||"-1",className:`--selected flex aic rel ${B}`.trim(),withLabel:false,style:_,onClick:x=>{x.stopPropagation(),R(M=>!M);},...F,children:[jsx(V,{className:"--label",children:h?typeof h=="string"?h:h.label:o||"Choose"}),jsx(u,{className:"--svg-arrow rel flex aic jcc",children:P?typeof p=="string"?jsx(Q,{name:p,as:"--search-action"}):p:typeof c=="string"?jsx(Q,{name:c,as:"--search-action"}):c})]}),jsxs(u,{id:O,className:"--options-list flex cols abs","aria-hidden":!P,style:{maxHeight:l||"auto"},ref:C,fx:{from:{y:5,opacity:0},to:{y:0,opacity:1},when:P,duration:.05},children:[m&&jsx(u,{as:"--select-search --sticky",children:jsx(re,{ref:v,onChange:x=>{g(x.target.value==""?null:x.target.value);},className:"--search-input",placeholder:f||"Search..."})}),(y==null?r:r.filter(x=>x.label.toLowerCase().includes(y.toLowerCase())||x.value.toLowerCase().includes(y.toLowerCase()))).map(x=>jsx(cs,{updateValue:U,value:h,o:x},`option-${(typeof x=="string"?x:x.label).replace(/\s+/g,"-")}-${typeof x=="string"?x:x.value}`))]})]})};ps.displayName="Zuz.Select";var Em=ps;var us=forwardRef((t,s)=>jsx(at,{type:Se.Switch,...t,ref:s}));us.displayName="Zuz.Switch";var Lm=us;var ds=t=>{let{idx:s,id:e,as:r,weight:o,style:n,value:i,render:m,resize:f,sortBy:l,sortable:c,onSort:p}=t,[a,d]=useState(0),T=()=>{c&&(p?.(String(e),a==1?-1:1),d(h=>h==1?-1:1));};return jsxs(u,{style:{flex:o||1,...n},as:`--col flex aic ${r||""} ${c?"--sortable":""}`,onClick:T,children:[jsx(u,{children:i}),s==-1&&c&&l==e&&jsx(u,{as:"--arrow flex aib",children:a==1?H.arrowUp:H.arrowDown})]})};ds.displayName="Zuz.Column";var Ot=ds;var hs=t=>{let{index:s,pubsub:e,schema:r,data:o,ids:n,styles:i,animate:m,sortBy:f,selectable:l,tableRef:c,loading:p,rowClassName:a,onSort:d,onRowClick:T,onSelect:h,onContextMenu:S}=t,P=useDelayed(),R=useMemo(()=>({transition:q.SlideInBottom,curve:G.EaseInOut,delay:.02*(s+1)}),[]),y=useRef(null),g=(v,C)=>{s==-1?e.emit(`ALL_ROWS_${v?"CHECKED":"UNCHECKED"}`,v):(h&&h(o,v),e.emit(`ROW_${v?"CHECKED":"UNCHECKED"}`,v,C));},I=(v,C,N)=>jsx(Ot,{idx:v,id:C,as:"--selector",pubsub:e,value:jsx(at,{value:N,ref:y,onSwitch:g,type:Se.Default})});return useEffect(()=>{let v=(L,$)=>{y.current?.setChecked(L,false);},C=(L,$)=>{let B=false;c?.current&&c.current.querySelectorAll(".--row").forEach(_=>{let F=_;if(!F.classList.contains("--row-head")){let U=F.querySelector(".--selector input[type=checkbox]");U&&U.checked&&!B&&(B=U.checked);}}),y.current.setChecked(B,false);},N=L=>{y.current?.setChecked(L,false),h&&h(o,L);},O=L=>{y.current?.setChecked(L,false),h&&h(o,L);};return s==-1?(e.on("ROW_CHECKED",v),e.on("ROW_UNCHECKED",C),()=>{e.off("ROW_CHECKED",v),e.off("ROW_UNCHECKED",C);}):(e.on("ALL_ROWS_CHECKED",N),e.on("ALL_ROWS_UNCHECKED",O),()=>{e.off("ALL_ROWS_CHECKED",N),e.off("ALL_ROWS_UNCHECKED",O);})},[]),jsxs(u,{onContextMenu:v=>S?S(v,o):null,onClick:v=>T?T(v,t.data):()=>{},...m?{fx:{...R,when:P}}:{},as:`--row flex aic ${T?"--row-clickable":""} ${s==-1?"--row-head":""} ${a||""}`,children:[s==-1&&r.map((v,C)=>{let{renderWhenHeader:N,render:O,value:L,...$}=v;return jsxs(Fragment,{children:[l&&C==0&&I(-1,`--selector-${v.id}`,"all"),jsx(Ot,{idx:-1,onSort:d,sortBy:f,value:L,...$,pubsub:e,style:i[v.id]})]},`--col-${v.id}`)}),p&&s>-1&&jsx(u,{as:"--col",children:jsx(V,{as:"opacity:0",children:"..."})}),!p&&s>-1&&n&&o&&r.map((v,C)=>jsxs(Fragment,{children:[l&&C==0&&I(C,`--selector-${v.id}`,v.id.toString()),n.includes(String(v.id))?jsx(Ot,{pubsub:e,idx:C,id:String(v.id),style:i[String(v.id)],value:v.render?v.render(o,s):o[String(v.id).includes(".")?String(v.id).split(".").reverse()[0]:v.id]}):null]},`--${String(v.id)}-val-${C}`))]})};hs.displayName="Zuz.Row";var Dt=hs;var ws=(t,s)=>{let{schema:e,rows:r,rowCount:o,rowsPerPage:n,currentPage:i,pagination:m,paginationHash:f,showPaginationOnZeroPageCount:l,animateRows:c,header:p,rowClassName:a,selectableRows:d,hoverable:T,sortBy:h,loading:S,loadingRowCount:P,loadingMessage:R,spinner:y,emptyMessage:g,onSort:I,onRowClick:v,onRowSelectToggle:C,onPageChange:N,onRowContextMenu:O,...L}=t,$=useRef(null),B=useMemo(()=>e.reduce((ae,j)=>(ae[j.id]={flex:j.weight||1,...j.w&&{width:j.w},...j.maxW&&{maxWidth:j.maxW},...j.minW&&{minWidth:j.minW},...j.h&&{height:j.h},...j.maxH&&{maxHeight:j.maxH},...j.minH&&{minHeight:j.minH}},ae),{}),[e]),_=useMemo(()=>Object.keys(B),[e]),F=useMemo(()=>p??true,[p]),{style:U,className:x,rest:M}=E(L),A=useRef(null),W=useMemo(()=>new PubSub,[]),D=useRef(r.map(()=>uuid(8))),[Z,Y]=useState(h||null),[J,ee]=useState(R||"loading"),pe=useMemo(()=>!S&&r&&r.length==0,[S,r]),ne=useCallback(()=>g?typeof g=="function"?jsx(g,{}):g:jsx(V,{as:"tac s:18 mt:75",children:"No Record Found"}),[S,r]);useEffect(()=>{D.current=r.map(()=>uuid(8));},[r]);let we=(ae,j)=>{Y(ae),I?.(ae,j);},ke=(o||(r?r.length:0))/(n||10),ve=useMemo(()=>l||ke>1?jsx(Lo,{hash:f,ref:$,renderOnZeroPageCount:l,onPageChange:N,paginationStyle:"table",startPage:i,itemCount:o||(r?r.length:0),itemsPerPage:n||10}):null,[i,o]);return useImperativeHandle(s,()=>({setLoading(ae){}})),jsxs(u,{as:`--table ${T??true?"--hoverable":""} flex cols rel ${x}`,ref:A,children:[F==true&&jsx(Dt,{sortBy:Z,onSort:we,tableRef:A,pubsub:W,selectable:d,index:-1,schema:e,loading:true,styles:B}),S&&jsxs(u,{as:"center-x flex aic --table-spinner",children:[jsx(he,{type:y||se.Simple}),J&&jsx(V,{as:"--table-loading-message",children:J})]}),S&&Array(P||5).fill({}).map((ae,j)=>jsx(Dt,{tableRef:A,index:j,pubsub:W,schema:e,styles:B,loading:true,animate:c,onRowClick:v},`--trow-loading-${j}-${e[0].id}`)),!S&&r&&r.map((ae,j)=>jsx(Dt,{tableRef:A,pubsub:W,loading:false,index:j,schema:e,ids:_,styles:B,animate:c,data:ae,onRowClick:v,rowClassName:a,selectable:d,onSelect:C,onContextMenu:O},`--trow-${D.current[j]||j}-${e[0].id}`)),pe&&ne(),jsx(u,{"aria-hidden":!m||!ve,...c?{fx:{transition:q.SlideInBottom,curve:G.EaseInOut,delay:.02*(r.length+1),when:!S&&r&&m&&ve!=null}}:{},as:"--row flex aic --row-footer",children:m&&ve?ve:null})]})};ws.displayName="Zuz.Table";var Km=forwardRef(ws),Wm=Km;var Gm=({ref:t,...s})=>{let{title:e,items:r}=s,[o,n]=useState(0),i=(m,f,l)=>{m.preventDefault(),n(f),document.getElementById(l)?.scrollIntoView({behavior:"smooth"});};return jsxs(u,{ref:t,as:"--table-of-contents rel flex cols",children:[jsx(V,{as:"--toc-title",children:e}),jsx(He,{items:r.map((m,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=>i(l,f,m.tag),href:`#${m.tag}`,children:m.label}))})]})},qm=Gm;var vs=({isActive:t,transitionType:s,speed:e,width:r,render:o,content:n,onHeightChange:i})=>{let m=useRef(null),f=useResizeObserver(m);useEffect(()=>{t&&f.height>0&&i(f.height);},[t,f.height]);let l=useMemo(()=>{let c={flexShrink:0,height:"fit-content"};return s==="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}:s==="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,s,r,e]);return jsx(u,{ref:m,style:{...l},className:"--content",children:o||t?n:null})};vs.displayName="Zuz.TabBody";var Ss=vs;var Ps=({ref:t,...s})=>{let{tabs:e,speed:r=.3,prerender:o=true,variant:n,tabStyle:i="fixed",onChange:m,transitionType:f="slide",...l}=s,[c,p]=useState(0),a=useRef(null),d=useResizeObserver(a),T=useMemo(()=>uuid(8),[]),[h,S]=useState("auto"),P=useMemo(()=>d.width>0,[d.width]);useImperativeHandle(t,()=>({setTab:C=>p(C)}));let R=useMemo(()=>e.map(C=>({...C,key:C.key||uuid(8)})),[e]),{style:y,className:g,rest:I}=E({as:`flex cols w-full no-overflow ${l.as||""}`,...l}),v=()=>{if(!P)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*d.width}px, 0, 0)`,transition:`transform ${r}s cubic-bezier(0.4, 0, 0.2, 1)`}}};return jsxs(u,{ref:a,style:y,className:`--tabview --${i} flex cols ${g}`,children:[jsx(it,{as:"--tabview-head",onSwitch:C=>{p(C.index);let N=R.find(O=>O.tag==C.tag);N&&N.onSelect&&(N.onSelect(N,C.index),m?.(N,C.index));},selected:c,items:R.reduce((C,N,O)=>(C.push({icon:N.icon,index:O,label:N.label,tag:N.tag}),C),[])}),jsx(u,{className:"--tabview-body",as:"rel no-overflow w-full",style:{height:h,transition:P?`height ${r}s cubic-bezier(0.4, 0, 0.2, 1)`:"none",opacity:P?1:0},children:jsx(u,{className:"--track",style:{...v()},children:R.map((C,N)=>jsx(Ss,{isActive:N===c,transitionType:f,speed:r,width:d.width,render:o||N===c,onHeightChange:O=>N===c&&S(O),content:C.body},`tab-body-${C.key||N}-${T}`))})})]})};Ps.displayName="Zuz.TabView";var np=Ps;var lp=({ref:t,commands:s,onCommand:e,welcomeMessage:r="Welcome to Zuz Terminal v1.0.0",prompt:o="zuz ~ ",variant:n,...i})=>{let[m,f]=useState([{type:"output",content:r}]),[l,c]=useState(""),p=useRef(null),a=useRef(null),{variant:d}=X(true);useEffect(()=>{p.current&&(p.current.scrollTop=p.current.scrollHeight);},[m]);let T=g=>{let I=typeof g=="string"?{type:"output",content:g}:g;f(v=>{let C=[...v,I];return C.length>1e3?C.slice(-1e3):C});},h=()=>f([]);useImperativeHandle(t,()=>({write:T,clear:h}));let S=async g=>{let[I,...v]=g.split(" "),C=I.toLowerCase();return s&&s[C]?await s[C](v):e?await e(g):`command not found: ${I}`},P=g=>{let I=/\u001b\[(\d+)m/g,v=[],C={31:"#ff5f56",32:"#27c93f",33:"#ffbd2e",34:"#007aff",35:"#ff79c6",36:"#8be9fd",39:"#d4d4d4"},N=0,O="#d4d4d4",L=false,$;for(;($=I.exec(g))!==null;){let _=g.slice(N,$.index);_&&v.push({text:_,color:O,bold:L});let F=$[1];F==="0"?(O="#d4d4d4",L=false):F==="1"?L=true:C[F]&&(O=C[F]),N=I.lastIndex;}let B=g.slice(N);return B&&v.push({text:B,color:O,bold:L}),v},R=(g,I)=>g.includes("\x1B")?P(g).map((v,C)=>jsx(te,{style:{color:v.color||"#d4d4d4",fontWeight:v.bold?"bold":"normal"},children:v.text},`--terminal-msg-${C}-${v.text.replace(/\S+/g,"-")}`)):jsx(te,{style:{color:I==="error"?"#ff5f56":I==="command"?"#00ff00":"#d4d4d4"},children:g}),y=async g=>{if(g.key==="Enter"&&l.trim()){let I=l.trim(),v=[...m,{type:"command",content:`${o}${I}`}];c(""),f(v);let C=await S(I);f(N=>[...N,{type:"output",content:C}]);}};return jsxs(u,{as:`--zuz-terminal --${n||d||K.Medium} flex cols ${i.className}`,onClick:()=>a.current?.focus(),children:[jsx(u,{ref:p,className:"--terminal-log",children:m.map((g,I)=>jsx(u,{children:jsx(V,{children:R(g.content,g.type)})},I))}),jsxs(u,{as:"flex aic --terminal-input",children:[jsx(V,{as:"--terminal-prompt",children:o}),jsx(re,{ref:a,className:"--zuz-term-input",autoFocus:true,value:l,variant:n||d||K.Medium,onChange:g=>c(g.target.value),onKeyDown:y})]})]})},cp=lp;var mp=({meta:t})=>jsxs(z,{as:"flex aic --command-item",children:[t.icon&&jsx(Q,{name:t.icon,as:"--command-icon"}),jsx(V,{children:t.label})]}),pp=({position:t,onSelect:s,commands:e,visible:r})=>jsx(u,{"aria-hidden":!r,fx:{transition:q.SlideInBottom,duration:.1,when:r},className:"--command-box abs grid",style:{...t},children:e.map(o=>jsx(mp,{meta:o},`cmd-${o.label.replace(/\s+/,"-")}`))}),Es=pp;var ks=forwardRef((t,s)=>{let{autoResize:e,maxHeight:r,variant:o,resize:n="none",command:i,commands:m,onInput:f,cmd:l,renderDropdown:c,value:p,defaultValue:a,...d}=t,T=useRef(null),h=useRef(null),{variant:S}=X(true),{style:P,className:R,rest:y}=E(d),{showDropdown:g,dropdownPosition:I,handleKeyDown:v,handleInput:C,handleCommandSelect:N}=useCommandActions({command:i,commands:m,cmd:l,ref:T}),O=useCallback(()=>{let $=T.current;!$||!e||(h.current&&cancelAnimationFrame(h.current),h.current=requestAnimationFrame(()=>{$.style.height="auto";let B=$.scrollHeight;if(r){let _=parseInt(r.toString(),10);isNaN(_)||(B=Math.min(B,_));}$.style.height=`${B}px`,$.style.overflowY=r&&B>=parseInt(r.toString(),10)?"auto":"hidden";}));},[e,r]),L=$=>{f?.($),C($),O();};return useEffect(()=>{O();},[p,a,O]),useEffect(()=>{e&&T.current&&O();},[e,O]),useEffect(()=>()=>{h.current&&cancelAnimationFrame(h.current);},[]),jsxs(u,{as:"rel",children:[jsx("textarea",{className:`--input --textarea --${o||S||K.Medium} flex ${R}`.trim(),style:{...P,resize:n,height:e?"auto":P?.height,overflow:"hidden",transition:e?"none":void 0},onKeyDown:v,onInput:L,ref:$=>{typeof s=="function"?s($):s&&(s.current=$),T.current=$;},value:p,defaultValue:a,...y}),c?c({show:g,position:I,commands:m||[],onSelect:N}):m&&m.length>0&&jsx(Es,{visible:g,commands:m,onSelect:N,position:I})]})});ks.displayName="Zuz.TextArea";var hp=ks;var Os=forwardRef((t,s)=>{let{as:e,value:r,color:o,direction:n,...i}=t,m=useRef(null),[f,l]=useState(r||0);return useImperativeHandle(s,()=>({updateValue(c){f.toString().length!==c.toString().length&&l(c);},setValue(c){if(this.updateValue(c),m.current){let p=c.toString().split("");m.current.querySelectorAll(".--wheel-char").forEach((a,d)=>{let T=p[d];if(a instanceof HTMLElement){a.setAttribute("data-value",T);let h=a.querySelector(".--wheel-char-track");h instanceof HTMLElement&&(h.style.setProperty("--v",T),h.offsetWidth);}});}}})),useEffect(()=>{l(r||0);},[r]),jsxs(u,{className:"--text-wheel flex aic rel","aria-hidden":true,as:e,ref:m,...i,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-${n||"down"} grid`,style:{"--v":c},children:[jsx(te,{children:!n||n==="down"?0:9}),(!n||n==="down"?[9,8,7,6,5,4,3,2,1,0]:[0,1,2,3,4,5,6,7,8,9]).map((a,d)=>jsx(te,{children:a},`${p}--${d}`)),jsx(te,{children:!n||n==="down"?9:0})]})},`wheel-char-${p}`)),o&&jsx(u,{className:"abs fillx",style:{zIndex:1,background:`linear-gradient(0deg, ${o}, transparent, transparent, transparent, ${o})`}})]})});Os.displayName="Zuz.TextWheel";var Cp=Os;var As=forwardRef((t,s)=>{let{title:e,position:r,margin:o,children:n,...i}=t,{style:m,className:f,rest:l}=E(i),[c,p]=useState(false),a=useMemo(()=>r||oe.Top,[]),d=useRef(null),T=useRef(null),h=y=>{},S=typeof ResizeObserver<"u"?new ResizeObserver(h):{observe:()=>{},unobserve:()=>{}},P=useDimensions(),R=useMemo(()=>{if(!T.current)return {left:0,top:0};let y=T.current.previousElementSibling;if(y){let g=y.getBoundingClientRect();switch(S.observe(y),a){case oe.Top:return {left:g.left+g.width/2,top:g.top-(o||25)};case oe.Bottom:return {left:g.left+g.width/2,top:g.top+(o||25)};case oe.Left:return {left:g.left-g.width/2,top:g.top+g.height/2};case oe.Right:return {left:g.right,top:g.top+g.height/2};default:return {left:0,top:0}}}},[T.current,P,S]);return useEffect(()=>{},[]),jsxs(u,{ref:d,className:"--with-tooltip rel",onMouseEnter:y=>p(true),onMouseLeave:y=>p(false),children:[n,jsx(u,{ref:T,style:{left:R?.left+"px",top:R?.top+"px"},className:`--tooltip --${r||oe.Top} fixed ${f}`.trim(),fx:{from:a==oe.Bottom||a==oe.Top?{opacity:0,x:"-50%",y:a==oe.Top?-5:5}:{opacity:0,y:"-50%",x:a==oe.Right?15:-25},to:a==oe.Bottom||a==oe.Top?{opacity:1,x:"-50%",y:0}:{opacity:1,y:"-50%",x:a==oe.Right?10:-20},curve:G.EaseInOut,when:c},children:jsx(V,{className:"--text rel",children:e})})]})});As.displayName="Zuz.ToolTip";var Np=As;var _o=forwardRef((t,s)=>{let{as:e,meta:r,nodes:o,icons:n,onSelect:i,treeTag:m,selected:f,roots:l,expanded:c,...p}=t,{tag:a,label:d,icon:T,under:h,isHead:S}=r,P=useMemo(()=>l.includes(a),[l]),[R,y]=useState(c),g=()=>{localStorage.setItem(`--tn${m}-${a}`,R?"0":"1"),y(!R);};useEffect(()=>{c||P&&!localStorage.getItem(`--tn${m}-${a}`)?(localStorage.setItem(`--tn${m}-${a}`,"1"),y(true)):y(localStorage.getItem(`--tn${m}-${a}`)=="1");},[]);let I=useMemo(()=>o.filter(v=>v.under==a),[o,a]);return jsxs(u,{className:`--treenode ${P?"--is-root":""} --treenode-${a} flex cols`,children:[jsxs(u,{className:`--node --node-${a} flex aic ${f==a?" --selected":""}`,children:[jsx(z,{skeleton:p.skeleton,onClick:g,className:"--node-aro-btn",disabled:I.length==0,children:n?.arrowClose&&n?.arrowOpen?jsx(Q,{skeleton:p.skeleton,className:"--node-aro-icon",name:I.length==0?n?.arrowDisabled||n?.arrowClose:R?n?.arrowOpen:n?.arrowClose}):I.length==0?H.chevronBottom:R?H.chevronBottom:H.chevronRight}),jsxs(z,{className:"--node-meta flex aic",onClick:v=>i(a),children:[(n?.nodeOpen&&n?.nodeClose||P&&n?.rootOpen&&n?.rootClose)&&jsx(Q,{skeleton:p.skeleton,className:`--node-icon ${P?"--icon-root":""}`,name:T||(R?P&&n?.rootOpen||n.nodeOpen:P&&n?.rootClose||n?.nodeClose)}),jsx(V,{className:`--node-label ${P?"--node-label-root":""}`.trim(),skeleton:p.skeleton,children:d})]})]}),R&&I.length>0&&jsx(u,{className:`--sub-node tree-sub-node-${a} flex cols`,children:I.map(v=>jsx(_o,{treeTag:m,selected:f,onSelect:i,icons:n,roots:l,expanded:v.expanded||false,meta:v,nodes:o},`--node-${v.tag}`))})]})});_o.displayName="TreeItem";var zs=_o;var Fs=forwardRef((t,s)=>{let{as:e,nodes:r,onNodeSelect:o,tag:n,icons:i,roots:m,selected:f,...l}=t,[c,p]=useState(f);useImperativeHandle(s,()=>({getSelected:()=>c}),[o]);let a=d=>{p(d),o&&o(d);};return useEffect(()=>{c!=f&&p(f);},[f]),jsx(u,{className:"--treeview flex cols",children:r.filter(d=>m.includes(d.tag)).map(d=>jsx(zs,{treeTag:n?`-${n}`:"",selected:c,onSelect:T=>a(T),icons:i,meta:d,roots:m,expanded:d.expanded||false,skeleton:l.skeleton,nodes:r},`--node-${d.tag}`))})});Fs.displayName="Zuz.TreeView";var Vp=Fs;String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"").replace(/\s+/g," ")};
13
+ export{ue as ALERT,qo as AVATAR,Si as Accordion,Ni as ActionBar,Li as Alert,Xi as AutoComplete,rl as Avatar,sl as Badge,u as Box,El as Bubble,gn as BubbleMediaType,dn as BubbleStatus,z as Button,mn as CHART,Se as CHECKBOX,_p as COLORTHEME,go as Calendar,Rl as Chart,at as CheckBox,zl as CodeBlock,tc as ColorScheme,Yt as ContextMenu,sc as CookiesConsent,ye as Cover,fc as CropShape,pc as Cropper,gc as Crumb,Kp as DATATYPE,ze as DIALOG,Xo as DIALOG_ACTION_POSITION,ie as DRAWER_SIDE,bc as DatePicker,jt as Dialog,so as Drawer,gt as FILTER,Ce as FORMVALIDATION,Wp as FORMVALIDATION_STYLE,Cc as Fab,Rc as Filters,zc as Form,Kc as Grid,Qt as Group,Q as Icon,rt as Image,re as Input,No as KeyboardKeys,Gn as KeysLabelMap,Un as KeysMap,st as Label,qt as LayersProvider,He as List,Qc as NetworkStatus,qe as ORIGIN,Fp as OriginType,Me as Overlay,$t as POSITION,Gp as PROGRESS,Lo as Pagination,Eo as PaginationStyle,im as Password,pm as PinInput,oe as Position,et as ProgressBar,_t as RADIO,gm as Radio,fe as SHEET,zt as SHEET_ACTION_POSITION,zp as SKELETON,dt as SLIDER,Zp as SORT,se as SPINNER,to as ScrollView,Cm as Search,Em as Select,it as SelectTabs,Lc as Sheet,vo as Slider,St as SnackPosition,Mr as SnackStyle,vt as SnackType,te as Span,he as Spinner,Up as Status,Lm as Switch,q as TRANSITIONS,G as TRANSITION_CURVES,np as TabView,Wm as Table,qm as TableOfContents,cp as Terminal,V as Text,Cp as TextWheel,hp as Textarea,Qs as ThemeProvider,Or as ToastDefaultTitle,St as ToastPosition,ao as ToastProvider,Mr as ToastStyle,vt as ToastType,Np as ToolTip,Vp as TreeView,K as Variant,Xe as animationTransition,Ft as buildClassString,Jo as buildWithStyles,fu as css,Zt as getAnimationCurve,du as getAnimationTransition,Ks as getZuzMap,Wn as isKeyCombination,Qo as setZuzMap,E as useBase,Ja as useContextMenu,ti as useDialog,ni as useDrawer,le as useFx,ii as useMorph,tt as usePosition,di as useSnack,io as useToast};