@zuzjs/ui 1.0.15 → 1.0.16

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