@zuzjs/ui 1.0.10 → 1.0.12
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/bin.cjs +4 -4
- package/dist/bin.js +1 -1
- package/dist/index.cjs +6 -6
- package/dist/index.d.cts +6 -1
- package/dist/index.d.ts +6 -1
- package/dist/index.js +5 -5
- package/package.json +3 -3
- /package/dist/{chunk-4QXR46PL.js → chunk-DMBVWA7C.js} +0 -0
- /package/dist/{chunk-KUGLU5CK.cjs → chunk-X4NXRKUY.cjs} +0 -0
package/dist/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {f,e,g,d,h,c}from'./chunk-
|
|
1
|
+
import {f,e,g,d,h,c}from'./chunk-DMBVWA7C.js';export{e as PACKAGE_NAME,f as cleanProps,g as splitAtoms}from'./chunk-DMBVWA7C.js';import {forwardRef,createContext,useEffect,useRef,useMemo,useState,useCallback,createElement,isValidElement,Fragment,useId,useImperativeHandle,startTransition,useLayoutEffect,useContext}from'react';import {useScrollbar,useDebounce,useImage,useResizeObserver,useLineChart,useDelayed,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 {createPortal}from'react-dom';import {startOfMonth,endOfMonth,startOfWeek,endOfWeek,eachDayOfInterval,format,isSameMonth,isSameDay,isToday,addHours,addDays,addWeeks}from'date-fns';import {addPropsToChildren}from'@zuzjs/core/react';var Bt={Circle:"CIRCLE",Square:"SQUARE"},Rp={Default:"DEFAULT",Circle:"CIRCLE"},Np={Light:"light",Dark:"dark",System:"system"},ve={Default:"DEFAULT",Switch:"SWITCH"},Lt={Auto:"auto",Top:"top",Bottom:"bottom",Left:"left",Right:"right"},te=Lt,Ke=AnchorType,Ip=Ke,G={XSmall:"xs",Small:"sm",Medium:"md",Large:"lg",XLarge:"xl"},Ep={Asc:"ASC",Desc:"DESC"},Bp={String:"STRING",Number:"NUMBER",Boolean:"BOOLEAN",Array:"ARRAY",Object:"OBJECT",Date:"DATE",Time:"TIME",DateTime:"DATETIME",File:"FILE"},Lp={Dots:"DOTS"},we={IPV4:"IPV4",IPV6:"IPV6",Email:"EMAIL",Uri:"URI",Password:"PASSWORD",MatchField:"MATCHFIELD",Pattern:"*",GreaterThan:"GREATER_THAN"},ie={Success:"success",Error:"error",Warning:"warning",Info:"info"},Z={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"},Mp={Success:"success",Error:"error",Idle:"idle",Dead:"dead"},le={Dialog:"DIALOG",Default:"DEFAULT",Error:"ERROR",Success:"SUCCESS",Warn:"WARN",Promise:"PROMISE"},De=le,Mt={Left:"LEFT",Right:"RIGHT",Center:"CENTER"},Vo=Mt,Op={Bar:"BAR",Ring:"RING"},ut={Default:"range",Text:"number"},Ot={Default:"DEFAULT",Card:"CARD"},ft={Gooey:"gooey"},ne={Left:"LEFT",Right:"RIGHT",Top:"TOP",Bottom:"BOTTOM"};var $o=Symbol.for("zuz.global.map"),zo=o=>{globalThis[$o]=o;},Bs=()=>globalThis[$o]||{},kt=o=>{let n=Array.isArray(o)?o.join(" "):o;if(!n||typeof n!="string")return "";let e$1=Bs();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,m,p]=s;return g(p).map(a=>{let i=`${m}(${a})`;return e$1[i]||a}).join(" ")}return e$1[t]||t}).join(" ")},jp=o=>{let n=Array.isArray(o)?o.join(" "):o;return !n||typeof n!="string"?"":kt(n)},_o=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 Z.Bounce:return "var(--bounce)";case Z.Liquid:return "var(--liquid)";case Z.Spring:return "var(--spring)";case Z.EaseInOut:return "ease-in-out";case Z.EaseOutBack:return "ease-out-back";default:return "linear"}},Ue=(o,n=0)=>{let e={},r={},t=n||20;switch(o){case q.SlideInLeft:case q.SlideInRight:e={"--fx-x":o===q.SlideInLeft?`-${t}px`:`${t}px`,opacity:0},r={"--fx-x":"0px",opacity:1};break;case q.SlideInTop:case q.SlideInBottom:e={"--fx-y":o===q.SlideInTop?`-${t}px`:`${t}px`,opacity:0},r={"--fx-y":"0px",opacity:1};break;case q.ScaleIn:e={scale:0,opacity:0},r={scale:1,opacity:1};break;case q.FadeIn:e={opacity:0},r={opacity:1};break}return {from:e,to:r}},eu=(o,n,e)=>{let{from:r,to:t}=Ue(o);return n?{...r,...t}:e?r:t};var Os=(o,n)=>{let e=useRef([]);return useEffect(()=>{let r=n?.current;if(!r||!o||!o.clearAtEnd)return;let t=s=>{e.current.includes(s.propertyName)&&o.clearAtEnd===true&&(r.style.transform="",r.style.filter="",e.current.forEach(u=>r.style.removeProperty(u)));};return r.addEventListener("transitionend",t),()=>r.removeEventListener("transitionend",t)},[o,n]),useEffect(()=>{if(typeof window>"u"||!n?.current)return;let r=n.current;(o?.scroll||o?.mouse)&&(r.style.willChange="transform",r.style.translate="var(--fx-x, 0px) var(--fx-y, 0px)",r.style.transition=`translate 0.1s ${o.curve?Dt(o.curve):"var(--spring)"}`);},[o,n]),useMemo(()=>{if(!o)return {style:{}};let{transition:r,from:t,to:s,exit:u,when:m,duration:p=.3,delay:a=0,curve:i}=o,f={},{from:c,to:g}=r?Ue(r):{from:t||{},to:s||{}};f=m===void 0?{...c,...g}:m?{...g}:u||c;let w=Dt(i),x=[],v=_o(f);e.current=Object.keys(v);let R={...v};return Object.keys(v).forEach(h=>{let d=h.startsWith("--")?"all":h;x.includes(d)||x.push(`${d} ${p}s ${w} ${a}s`);}),{style:{...R,transition:x.join(", ")}}},[o])},se=Os;var ks=(o,n)=>{let{as:e,fx:r,transition:t,skeleton:s,className:u,propsToRemove:m,style:p,...a}=o||{},i=t?{transition:t,duration:.3}:r||{},{style:f$1}=se(i,n),c=kt(e??"");return {style:{...p,...f$1},className:[u||"",c||"",s?.enabled?"--skeleton":""].join(" ").trim(),rest:{...f(a,m?[...m,"skeleton"]:["skeleton"])}}},N=ks;var Vs=(o,n={})=>{let{offset:e=8,direction:r="bottom",container:t=null,triggerRef:s=null}=n,u=useRef(null),m=useCallback(()=>{let p=o.current;if(!p)return;let a=s?.current||p.parentElement;if(!a){console.warn("usePosition: No trigger element found. Positioning may not work.");return}let i=p.getBoundingClientRect(),f=a.getBoundingClientRect(),c,g;t?(c=t.getBoundingClientRect(),g="absolute"):(window.getComputedStyle(p).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}),p.style.position!==g&&(p.style.position=g),u.current=g;let v=0,R=0;switch(r){case "top":v=f.top-i.height-e,R=f.left,v<c.top&&f.bottom+i.height+e<=c.bottom&&(v=f.bottom+e);break;case "bottom":v=f.bottom+e,R=f.left,v+i.height>c.bottom&&f.top-i.height-e>=c.top&&(v=f.top-i.height-e);break;case "left":v=f.top,R=f.left-i.width-e,R<c.left&&f.right+i.width+e<=c.right&&(R=f.right+e);break;case "right":v=f.top,R=f.right+e,R+i.width>c.right&&f.left-i.width-e>=c.left&&(R=f.left-i.width-e);break}if(v=Math.max(c.top,Math.min(v,c.bottom-i.height)),R=Math.max(c.left,Math.min(R,c.right-i.width)),u.current==="fixed")p.style.top=`${v}px`,p.style.left=`${R}px`;else {let h;p.offsetParent?h=p.offsetParent.getBoundingClientRect():h={top:0,left:0};let d=v-h.top+window.scrollY,S=R-h.left+window.scrollX;p.style.top=`${d}px`,p.style.left=`${S}px`;}},[o,s,e,r,t]);return useEffect(()=>{let p=o.current;if(!p)return;let a=s?.current||p.parentElement;if(!a){console.warn("usePosition: No trigger element found. Positioning may not work.");return}let i=new ResizeObserver(m);return i.observe(p),a&&i.observe(a),m(),window.addEventListener("resize",m),window.addEventListener("scroll",m,true),()=>{i.disconnect(),a&&i.disconnect(),window.removeEventListener("resize",m),window.removeEventListener("scroll",m,true);}},[o,r,e,t,s]),{postion:u.current,reposition:m}},We=Vs;var Zo=forwardRef((o,n)=>{let{when:e,...r}=o;return jsx(l,{ref:n,"aria-hidden":!e,className:"--overlay fixed fill",fx:{transition:q.FadeIn,when:e},...r})});Zo.displayName="Zuz.Overlay";var Ee=Zo;var Ko=({ref:o,...n})=>{let{style:e,...r}=n,{style:t,className:s,rest:u}=N(r);return jsx("span",{ref:o,style:e,className:s,...u})};Ko.displayName="Zuz.Span";var Q=Ko;var Wo="(prefers-color-scheme: dark)",Ks=typeof window>"u",qo=createContext(void 0),Vt=o=>{let n=useContext(qo);if(!n){if(o===true)return;throw new Error("useColorScheme must be used within a ThemeProvider")}return n},J=Vt,Us=({children:o,storageKey:n="--ucs",forceTheme:e,zuzMap:r,...t})=>(r&&zo(r),jsx(Ws,{storageKey:n,forceTheme:e,...t,children:o})),Ws=({children:o,storageKey:n,forceTheme:e,...r})=>{let[t,s]=useState(()=>e||Go(n,"system")),[u,m]=useState(()=>e||Go(n)),p=c=>(c||(c=window.matchMedia(Wo)),c.matches?"dark":"light"),a=useCallback(c=>{let g=c=="system"?p():c,w=document.documentElement;w.setAttribute("color-scheme",g),w.style.colorScheme=g,m(g);},[p]),i=useCallback(c=>{s(c),localStorage.setItem(n,c),a(c);},[t]),f=useCallback(c=>{let g=p(c);m(g),t==="system"&&a("system");},[t]);return useEffect(()=>{t==null&&window.localStorage.getItem(n);},[t]),useEffect(()=>{window.matchMedia(Wo).addEventListener("change",f);},[f]),useEffect(()=>{let c=g=>{g.key==n&&(g.newValue?i(g.newValue):i("system"));};return window.addEventListener("storage",c),()=>window.removeEventListener("storage",c)},[i]),useEffect(()=>{a(e||t||"system");},[t]),jsxs(qo,{value:{colorScheme:t,resolvedScheme:u,setColorScheme:i,...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;`}}),o]})},Zo=(o,n)=>{if(Fs)return;let e;try{e=localStorage.getItem(o)||void 0;}catch{}return e||n};var Go=forwardRef((o,n)=>{let{name:e,pathCount:r,variant:t,color:s,...u}=o,{variant:m}=ee(true),{className:p,style:a,rest:i}=N(u);return jsx("div",{style:{color:s,...a},className:`icon-${e} --icon --${t||m||W.Small} ${p}`.trim(),ref:n,...i,children:Array(r||0).fill(0).map((f,c)=>jsx(Q,{className:`path${c+1}`},`${e}-layer-${c}`))})});Go.displayName="Zuz.Icon";var X=Go;var me={Simple:"SIMPLE",Roller:"ROLLER",Wave:"Wave"};var qo=o=>{let {type:n,variant:e,width:r,speed:t,color:s,background:u,foreground:m,...p}=o,{className:i,style:f,rest:c}=N(p);return jsx(l,{className:`${i} --spinner --${(n||me.Simple).toLowerCase()} --${e}`.trim(),style:{...f},...c})};qo.displayName="Zuz.Spinner";var he=qo;var gt={Loading:"loading",Normal:"normal"};var Yo=({ref:o,...n})=>{let{reset:e,variant:r,icon:t,iconSize:s,children:u,withLabel:m,spinner:p,state:a,disabled:i,...f}=n,{style:c,className:g,rest:w}=N(f),{variant:x}=ee(true);return jsxs("button",{className:`--button --${r||x} flex aic ${e?"":"jcc"} ${t?"--with-icon":""} ${g}`.trim().replace(/\s+/g," "),style:c,ref:o,disabled:a==gt.Loading||n.skeleton?.enabled||i,...w,children:[a==gt.Loading&&jsx(he,{variant:r||x,type:p||me.Simple}),(!a||a==gt.Normal)&&jsxs(Fragment$1,{children:[t&&jsx(X,{variant:s,name:t}),m===true?jsx(Q,{children:u}):u]})]})};Yo.displayName="Zuz.Button";var z=Yo;var Xs={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"})," "]}),[ie.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"})}),[ie.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"})}),[ie.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"})}),[ie.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"})]})},k=Xs;var Ys=({title:o="Alert",onClose:n})=>jsxs(l,{as:"--head flex aic rel",children:[jsx(l,{as:`--${o?"title":"dot"} flex aic jcc rel`,children:o}),jsx(z,{onClick:e=>n(),className:"--closer abs center-v",children:k.close})]}),Jo=Ys;var Js=({action:o,render:n=true,message:e=""})=>jsx(l,{as:`--body flex aic rel ${o?"":"--no-action"}`.trim(),children:n?e:null}),jo=Js;var ea=({action:o,actionPosition:n,dialogID:e,variant:r})=>jsx(l,{as:`--footer flex aic rel ${n?n==ko.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}`))}),tr=ea;var rr=forwardRef((o,n)=>{let{h:e,html:r,children:t,lines:s,...u}=o,{style:m,className:p,rest:a}=N(u),i=`h${o.h||1}`;return jsx(i,{ref:n,style:m,className:p,...a,children:r?jsx(Q,{dangerouslySetInnerHTML:{__html:r}}):t})});rr.displayName="Zuz.Text";var H=rr;var sr=forwardRef((o,n)=>{let{message:e,spinner:r,spinnerSize:t,color:s,when:u,hideMessage:m,...p}=o,{className:a,style:i,rest:f}=N(p);return "when"in o&&o.when==false?null:jsxs(l,{className:`--cover flex aic jcc cols abs fillx nope nous ${a}`.trim(),style:{...i,backgroundColor:"var(--cover-bg)"},...f,children:[jsx(he,{variant:t||W.Small,type:r||me.Simple}),!m&&jsx(H,{className:"--label",style:{color:"var(--cover-label)"},children:e||"loading"})]})});sr.displayName="Zuz.Cover";var Be=sr;var lr=({ref:o,...n})=>{let{index:e,id:r,title:t,message:s,transition:u,curve:m,speed:p,type:a,action:i,actionPosition:f,spinner:c,loadingMessage:g,variant:w,onClose:x,onShow:v,onHide:R,...h}=n,d=useMemo(()=>uuid(12),[]),[S,I]=useState(t||""),[P,C]=useState(s||""),[E,D]=useState(a||De.Dialog),[B,_]=useState(false),[L,G]=useState(true),[U,V]=useState(i||null),[T,A]=useState(false),{variant:$,spinner:K,dialog:O}=ee(true),F=w||O?.variant||$||W.Small,{style:Y,className:oe,rest:j}=N(h),pe=useRef(null),ge=se({when:B,duration:p||O?.speed||.3,delay:O?.delay||.1,transition:u||O?.transition||q.SlideInBottom,curve:m||O?.curve||Z.EaseInOut});return useEffect(()=>{D(De.Dialog),C(s),I(S),U&&V(U.reduce((lt,mt)=>(lt.push({...mt,key:mt.key||uuid(12)}),lt),[])),_(true),setTimeout(()=>v?v():()=>{},1e3);},[]),jsxs(Fragment$1,{children:[jsx(Ee,{when:B}),jsxs(l,{as:`--dialog --${(a??De.Default).toLowerCase()} ${B?"--visible":""} ${oe} fixed abc`.trim(),style:ge.style,...j,ref:pe,children:[jsx(Be,{when:T,spinner:c||O?.spinner||K?.type||me.Simple,message:g||O?.loadingMessage}),jsx(Jo,{title:S,onClose:()=>{x(r),_(false);}}),jsx(jo,{message:P,render:L,action:U}),U&&jsx(tr,{variant:F,action:U,dialogID:d,actionPosition:f})]})]})};lr.displayName="Zuz.Dialog";var $t=lr;var mr=(s=>(s.Default="default",s.Success="success",s.Error="error",s.Warn="warn",s.Promise="promise",s))(mr||{}),cr={success:"Action Successful",error:"Something Went Wrong",warn:"Heads Up",default:"Notice"};var ma=({index:o,id:n,type:e,icon:r,title:t,message:s,duration:u,onClose:m})=>{let p=useDelayed(),a=useDelayed(((u||4)-1)*1e3),{toast:i}=ee(true),f=se({when:p&&!a,duration:i?.duration||.2,transition:q.SlideInTop,curve:i?.curve||Z.EaseInOut});return useEffect(()=>{console.log("--expired",a,n),a&&n&&m?.(n);},[a,n]),jsxs(l,{as:`--snack --${e} --snack-${n} ${o>2?"--snacked":""} flex aic`,style:f.style,children:[jsx(l,{as:"--ico flex aic jcc",fx:{transition:q.ScaleIn,curve:Z.Spring,delay:.2,when:p&&!a},children:r?jsx(X,{name:r,fx:{transition:q.ScaleIn,curve:Z.Spring,delay:.4,duration:.5,when:p&&!a}}):jsx(l,{as:"--no-icon",fx:{transition:q.ScaleIn,curve:Z.Spring,delay:.4,duration:.5,when:p&&!a}})}),jsxs(l,{as:"--meta",children:[jsx(H,{as:"--tt",fx:{transition:q.SlideInTop,curve:Z.Spring,delay:.3,when:p},children:t||cr[e]}),jsx(H,{as:"--tm",fx:{transition:q.SlideInTop,curve:Z.Spring,delay:.4,duration:.5,when:p},children:s})]})]})},zt=ma;var _t=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 _t;var hr=({ref:o,...n})=>{let{id:e,index:r,from:t,speed:s,children:u,margin:m,animation:p,prerender:a,onClose:i,...f}=n,{drawer:c}=ee(true),[g,w]=useState(u),[x,v]=useState(false),[R,h]=useState(a??(c?.prerender||true)),d=()=>{v(false),i?.(e??-1);},{className:S,style:I,rest:P}=N(f),C=useMemo(()=>[{keys:[KeyCode.Escape],callback:()=>{Xe.isTop(d)&&d();}}],[x]);useShortcuts(C),useEffect(()=>{w(u);},[u]),useEffect(()=>(x?Xe.push(d):Xe.pop(d),()=>Xe.pop(d)),[x]),useEffect(()=>{v(true);},[]);let E=t||c?.from||ne.Left,D=useMemo(()=>{switch(E){case ne.Left:return {from:{x:"-100vw"},to:{x:0}};case ne.Right:return {from:{x:"100vw"},to:{x:0}};case ne.Top:return {from:{y:"-100vh"},to:{y:0}};case ne.Bottom:return {from:{y:"100vh"},to:{y:0}};default:return {from:{x:"-100vw"},to:{x:0}}}},[t,c?.from]),B=se({from:{...D.from,opacity:0},to:{...D.to,opacity:1},when:x,curve:p||c?.animation||Z.EaseInOut,duration:s||c?.speed||.5});return jsxs(Fragment$1,{children:[jsx(Ee,{onClick:_=>{x&&d();},when:x}),jsxs(l,{ref:o,"aria-hidden":!x,className:`--drawer flex cols ${S} --${E.toLowerCase()} fixed`,style:{...I,...B.style,"--m":`${m||c?.margin||0}px`},...P,children:[t==ne.Top||t==ne.Bottom?jsx(l,{className:"--handle"}):null,R||x?g:null]})]})};hr.displayName="Zuz.Drawer";var Kt=hr;var fa=o=>{let{label:n,labelColor:e,icon:r,iconColor:t,index:s,className:u,onSelect:m}=o;return n=="-"?jsx(l,{className:"--line"}):jsxs(z,{reset:true,onClick:p=>m(),className:`--item ${u||""}`.trim(),children:[jsx(l,{as:"--icon",children:jsx(X,{name:r,className:"--ico",style:t?{color:t}:{}})}),jsx(H,{className:"--lbl flex aic",style:e?{color:e}:{},children:n})]})},xr=fa;var vr=({ref:o,...n})=>{let{id:e,as:r,offsetX:t,offsetY:s,parent:u,event:m,when:p,items:a,header:i,footer:f,origin:c=Ke.TopRight,...g}=n,[w,x]=useState(false),[v,R]=useState(a||[]),{position:h,targetRef:d,calculatedAnchor:S}=useAnchorPosition(u?.current,m,{offsetX:t,offsetY:s,preferredAnchor:c});useEffect(()=>{p&&h.top!==0?x(true):p||x(false);},[p,h]);let{className:I,style:P,rest:C}=N(g),E=se({from:{opacity:0,scale:.8,y:-10},to:{opacity:1,scale:1,y:0},curve:Z.EaseInOut,duration:.05,when:w});return jsxs(l,{className:`--contextmenu abs flex cols ${I}`.trim(),"aria-hidden":!w,style:{...P,...E.style,top:h.top,left:h.left,overflow:"hidden",transformOrigin:S},...C,children:[typeof i=="function"?createElement(i):i,v.map((D,B)=>jsx(xr,{...D,index:B},`context-${D.label.toLowerCase()}-${B}`)),typeof f=="function"?createElement(f):f]})};vr.displayName="Zuz.ContextMenu";var Ut=vr;var ce=createContext(null),Pa=({ref:o,...n})=>{let r=useContext(ce)?.depth??0,[t,s]=useState(null),[u,m]=useState(false),[p,a]=useState([]),i=useDelayed(),f=useRef(0),c=()=>++f.current,g=()=>{m(false),setTimeout(()=>s(null),200);};useImperativeHandle(o,()=>({add(h){let d=c(),S={id:d,...h};return a(I=>[S,...I.slice(0,20)]),d},openMenu(h){m(false),setTimeout(()=>{s({id:c(),type:"menu",props:h}),m(true);},16);},remove(h){a(d=>d.filter(S=>S.id!==h)),t?.id===h&&g();},clear(){a([]);}})),useEffect(()=>{if(t&&u){let h=()=>g();return document.addEventListener("click",h),()=>document.removeEventListener("click",h)}},[t,u,g]);let w=h=>{setTimeout(()=>{a(d=>d.filter(S=>S.id!==h)),t?.id===h&&s(null);},1e3);};if(!i)return null;let x=p.filter(h=>h.type=="dialog").reverse(),v=p.filter(h=>h.type=="drawer").reverse(),R=p.filter(h=>h.type=="toast");return createPortal(jsxs(l,{as:"--zuz-layers-wrapper fixed fill nope",style:{zIndex:9999+r},children:[x.length>0&&jsx(l,{as:"--zuz-layer-dialogs fixed fill nope",children:x.map((h,d)=>jsx($t,{onClose:w,index:d,id:h.id,...h.props},`layer-${h.type}-${h.id}`))}),v.length>0&&jsx(l,{as:"--zuz-layer-drawers fixed fill nope",children:v.map((h,d)=>jsx(Kt,{onClose:w,index:d,id:h.id,...h.props},`layer-${h.type}-${h.id}`))}),R.length>0&&jsx(l,{as:"--zuz-layer-toasts fixed fill nope",children:R.map((h,d)=>jsx(zt,{onClose:w,index:d,id:h.id,...h.props},`layer-${h.type}-${h.id}`))}),t&&jsx(l,{as:"--zuz-layer-menus fixed fill nope",children:jsx(Ut,{onClose:g,when:u,...t.props},`menu-${t.id}`)})]}),document.body)},Ra=({children:o})=>{let n=useContext(ce),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(ce.Provider,{value:t,children:[o,jsx(Pa,{ref:r})]})},Na=Ra;var Ea=()=>{let o=useContext(ce);if(!o)throw new Error("useDialog must be used inside <ThemeProvider>");return {clearAll:()=>o.clear(),show:t=>o.add({type:"dialog",props:{...t,type:De.Dialog}}),hide:t=>o.remove(t)}},Ba=Ea;var Ma=()=>{let o=useContext(ce);if(!o)throw new Error("useToast must be used inside <ToastProvider>");let n=(a,i)=>o.add({type:"toast",props:{...i,type:a}});return {show:(a,i,f,c)=>n("default",{title:a,message:i,icon:f,duration:c}),hide:a=>o.remove(a),success:(a,i,f,c)=>n("success",{title:a,message:i,icon:f,duration:c}),error:(a,i,f,c)=>n("error",{title:a,message:i,icon:f,duration:c}),warn:(a,i,f,c)=>n("warn",{title:a,message:i,icon:f,duration:c}),promise:(a,i,f,c)=>n("promise",{title:a,message:i,icon:f,duration:c}),clearAll:()=>o.clear()}},Gt=Ma;var ka=()=>{let o=useContext(ce);if(!o)throw new Error("useDialog must be used inside <ThemeProvider>");let n=()=>o.clear(),e=t=>o.remove(t),r=t=>o.add({type:"drawer",props:t});return {clearAll:n,open:t=>r({children:t}),right:t=>r({children:t,from:ne.Right}),left:t=>r({children:t,from:ne.Left}),top:t=>r({children:t,from:ne.Top}),bottom:t=>r({children:t,from:ne.Bottom}),close:e}},Da=ka;var Aa=(o,n,e={})=>{let[r,t]=useState(null),[s,u]=useState(false),{duration:m=.25,curve:p=Z.EaseOutBack,borderRadius:a={from:40,to:24},targetWidth:i=320}=e;return useLayoutEffect(()=>{n&&o.current?(t(o.current.getBoundingClientRect()),u(true)):n||u(false);},[n,o]),{style:se({from:{opacity:0,width:r?.width,height:r?.height,borderRadius:a.from},to:{opacity:1,width:i,height:"auto",borderRadius:a.to},curve:p,duration:m,when:s&&n}).style,isMeasured:s,sourceRect:r}},Va=Aa;var za=()=>{let o=useContext(ce);if(!o)throw new Error("useContextMenu must be used inside <ThemeProvider>");return {showContextMenu:(r,t,s)=>{r.preventDefault(),o.openMenu({event:r,items:t,origin:s});},showMenu:(r,t,s)=>{o.openMenu({parent:r,items:t,origin:s||Ke.TopCenter});},hide:o.clear}},_a=za;var Pr=({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:m}=N(e,t);return jsx("div",{ref:o||r,style:{...s,...n||{}},className:u,...m})};Pr.displayName="Zuz.Box";var l=Pr;var Nr=forwardRef((o,n)=>{let{title:e,message:r,...t}=o,[s,u]=useState(false);return jsxs(l,{className:"--accordion flex cols",...t,children:[jsxs(z,{onClick:m=>u(!s),className:`--toggle flex aic ${s?"--open":""}`.trim(),children:[jsx(H,{className:"--label flex",children:e}),jsx(l,{className:"--arrow flex",children:s?k.arrowUp:k.arrowDown})]}),s&&jsx(l,{className:"--detail",children:r})]})});Nr.displayName="Zuz.Accordion";var Ga=Nr;var qa=({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(X,{name:n}):n}),Er=qa;var Br=forwardRef((o,n)=>{let{items:e,name:r,selected:t,position:s,...u}=o,m=useRef(null),[p,a]=useState(t||e[0].tag||0),i=useCallback(({x:v,y:R})=>{if(m.current){let h=m.current.getBoundingClientRect();document.documentElement.style.setProperty("--tip-x",`${v-h.left}`),document.documentElement.style.setProperty("--tip-y",`${R-h.top}`),document.documentElement.style.setProperty("--tip-s","1");}},[]),f=useCallback(()=>{m.current&&(m.current.removeEventListener("pointerleave",f),m.current.removeEventListener("pointermove",i),document.documentElement.style.setProperty("--tip-s","0"));},[]),c=useCallback(()=>{m.current&&(m.current.addEventListener("pointerleave",f),m.current.addEventListener("pointermove",i));},[]);useEffect(()=>{m.current&&(document.documentElement.style.setProperty("--tip-w",e.reduce((v,R)=>R.label.length>v.length?R.label:v,"").length.toString()),document.documentElement.style.setProperty("--tip-s","0"),document.documentElement.style.setProperty("--tip-l",`${e.length}`),m.current?.addEventListener("pointerenter",c));},[]);let{className:g,style:w,rest:x}=N(u);return jsxs(l,{ref:m,style:w,className:[`--actionbar flex aic ${g}`,`${!s||s==te.Auto?"rel":`--${s}`}`].join(" ").trim(),...x,children:[e.map((v,R)=>jsx(Er,{selected:p===v.tag||t==R,...v,idx:R},`actionbar-action-${v.label.toLowerCase().replace(/\s+/g,"-")}`)),jsx(l,{className:"--tip abs",children:jsx(l,{className:"--track flex aic",children:e.map(({label:v})=>jsx(l,{className:"--lb",children:v},`tool-tip-${v.toLowerCase().replace(/\s+/g,"-")}`))})})]})});Br.displayName="Zuz.ActionBar";var ja=Br;var Mr=forwardRef((o,n)=>{let{type:e,icon:r,title:t,message:s,iconSize:u,...m}=o,{className:p,style:a,rest:i}=N(m);return jsxs(l,{className:`--alert --${e||ie.Info} flex aic ${p}`.trim(),style:a,...i,children:[jsx(l,{className:`--icon icon-${r||"auto-matic"}`,style:u?{fontSize:u,width:u,height:u}:{},children:!r&&k[e||ie.Info]}),jsxs(l,{className:"--meta flex cols",children:[jsx(H,{className:`--title ${s?"--tm":""}`,children:t||"Lorem ipsum dolor sit amet, consectetur adipiscing elit."}),s&&jsx(H,{className:"--message",h:2,children:s})]})]})});Mr.displayName="Zuz.Alert";var oi=Mr;var Or=({ref:o,...n})=>{let{variant:e,numeric:r,onConfirm:t,...s}=n,{style:u,className:m,rest:p}=N(s),{variant:a}=ee(true),i=f=>{r&&(f.currentTarget.value=f.currentTarget.value.replace(/[^0-9.]/g,"").replace(/(\..*?)\..*/g,"$1"));};return jsx("input",{className:`--input --${e||a} flex ${m}`.trim(),style:u,onInput:i,onKeyDown:f=>{f.key=="Enter"&&t?.(f.currentTarget.value);},ref:o,...p})};Or.displayName="Zuz.Input";var re=Or;var Dr=o=>{let{meta:n,children:e}=o,r=useDelayed(),{label:t,icon:s,...u}=isValidElement(n)?{}:n,{className:m,style:p,rest:a}=N({...u,...u.animate?{animate:{...u.animate,when:r}}:{}});return isValidElement(n)?jsx("li",{style:p,className:m,children:n}):jsxs("li",{style:p,className:m,...a,children:[e,typeof n=="string"?n:t]})};Dr.displayName="Zuz.ListItem";var Hr=Dr;var Vr=forwardRef((o,n)=>{let{items:e,variant:r,direction:t,seperator:s,ol:u,...m}=o,{className:p,style:a,rest:i}=N(m),f=u==true?"ol":"ul";return createElement(f,{className:`--list --${r||W.Small} flex ${t??"cols"} ${p}`.trim(),style:a,ref:n,...i,children:e.map((c,g,w)=>{let x=`${typeof c=="string"?`li-${String(c)}`:isValidElement(c)?`li-${c.key}`||`${g}-${MD5(c.toString())}`:c.label}-${g}`;return jsxs(Fragment,{children:[jsx(Hr,{meta:c}),s&&w[g+1]?jsx("li",{className:"--list-seperator",children:s},`spt-${g+1}-${x}`):null]},x)})})});Vr.displayName="Zuz.List";var Me=Vr;var zr=forwardRef((o,n)=>{let{fx:e,action:r,data:t,withStyle:s,onChange:u,...m}=o,{className:p}=N({as:s||""}),{style:a}=N(m),[i,f]=useState(false),[c,g]=useState(t||[]),w=useRef(null),x=useRef(null),v=useRef(null),R=useMemo(()=>m.name||uuid(12),[]),[h,d]=useState(null),[S,I]=useState(null),[P,C]=useState([]),D=useDebounce(T=>{T.target.value==""?(f(false),g([])):r&&T.target.value.trim()!=""&&withPost(r,{query:T.target.value}).then(A=>{"items"in A&&_(A.items).isArray()?(g(A.items),I(T.target.value),C(A.items)):console.error("Action Response should contain items array"),d(null);}).catch(A=>{d(null),g([]);});},250),B=()=>{if(x.current){let T=x.current.getBoundingClientRect(),A=window.innerHeight-T.bottom,$=T.top;if(v.current){let K=v.current;A<K.offsetHeight&&$>A?(K.style.top="auto",K.style.bottom=`${T.height}px`,K.style.maxHeight=`${$-150}px`):(K.style.top=`${T.height+5}px`,K.style.bottom="auto",K.style.maxHeight=`${A-150}px`);}}},_$1=T=>{if(c.length>0){if((T.key==="ArrowDown"||T.key==="ArrowUp")&&(T.preventDefault(),T.stopPropagation()),T.key==="Escape")d(null),f(false),g([]);else if(T.key==="ArrowDown")d(A=>{let $=A===null||A===c.length-1?0:A+1;return G($),$});else if(T.key==="ArrowUp")d(A=>{let $=A===null||A===0?c.length-1:A-1;return G($),$});else if(T.key==="Enter"&&h!==null){let A=c[h];w.current&&(w.current.value=A,f(false),g([]));}}},L=T=>{w.current&&(w.current.value=T,f(false),g([]));},G=T=>{let A=c[T];if(A&&w.current&&(w.current.value=A,w.current.setSelectionRange(A.length,A.length)),v.current){let K=v.current.children[T];K&&K.scrollIntoView({block:"nearest"});}},U=T=>{x.current&&!x.current.contains(T.target)&&(f(false),g([]));},V=()=>{w.current&&w.current.value===S&&(g(P),d(null),B());};return useEffect(()=>(window.addEventListener("resize",B),window.addEventListener("scroll",B,true),document.addEventListener("mousedown",U),()=>{window.removeEventListener("resize",B),window.removeEventListener("scroll",B,true),document.removeEventListener("mousedown",U);}),[]),useEffect(()=>{B();},[c]),jsxs(l,{style:a,ref:x,className:`--autocomplete --${o.size||W.Small} flex aic rel ${p}`.trim(),children:[jsx(re,{ref:w,autoComplete:"off",onChange:D,onKeyDown:_$1,onFocus:V,...m}),jsx(l,{className:"--arrow rel flex aic jcc",children:c.length>0?k.arrowUp:k.arrowDown}),c.length>0&&jsx(Me,{id:R,ref:v,className:"--suggestion-list flex cols abs",items:c.map((T,A)=>({label:T,onClick:$=>{$.preventDefault(),$.stopPropagation(),L(T);},className:h===A?"--current":"",animate:{transition:q.SlideInBottom,curve:Z.EaseInOut,delay:clamp(.02*A,.02,.5)}}))})]})});zr.displayName="Zuz.AutoComplete";var vi=zr;var _r=forwardRef((o,n)=>{let e=useRef(null),r=useMemo(()=>n&&typeof n!="function"&&n.current?n:e,[n]),{style:t,className:s,rest:u}=N(o,r);return !u.src||u.src==""?null:jsx("img",{ref:r,style:t,className:`${s} flex`,...u})});_r.displayName="Zuz.Image";var Qe=_r;var Fr=forwardRef((o,n)=>{let{src:e,variant:r,type:t,crossOrigin:s,referrerPolicy:u,fx:m,as:p,alt:a,color:i,style:f,...c}=o,[g,w,x]=useImage(e??"",s,u),{className:v,style:R,rest:h}=N({fx:m,as:p});return useEffect(()=>{if(t==Bt.Square&&!document.getElementById("squareRadiusClipPath")){let d="http://www.w3.org/2000/svg",S=document.createElementNS(d,"svg");S.setAttribute("width","0"),S.setAttribute("height","0");let I=document.createElementNS(d,"defs"),P=document.createElementNS(d,"clipPath");P.setAttribute("id","squareRadiusClipPath"),P.setAttribute("clipPathUnits","objectBoundingBox");let C=document.createElementNS(d,"path");C.setAttribute("d","M0.986 0.347C0.951 0.11 0.777 -0.002 0.5 0C0.223 -0.002 0.049 0.11 0.014 0.347C0.005 0.404 0 0.452 0 0.5C0 0.548 0.005 0.596 0.014 0.653C0.049 0.89 0.223 1.002 0.5 1C0.777 1.002 0.951 0.89 0.986 0.653C0.995 0.596 1 0.548 1 0.5C1 0.452 0.995 0.404 0.986 0.347Z"),P.appendChild(C),I.appendChild(P),S.appendChild(I),document.body.appendChild(S);}},[e]),jsx(l,{className:`--avatar --${r||W.Small} --${(t||Bt.Circle).toLowerCase()} rel flex aic jcc ${v}`.trim(),style:{background:i||"var(--primary)",...f,...R},...h,children:e?jsx(Qe,{src:g,crossOrigin:s,referrerPolicy:u,...c}):jsx(H,{className:"--avatar-label",children:(a?a.charAt(0):"A").toUpperCase()})})});Fr.displayName="Zuz.Avatar";var Ei=Fr;var Bi=({size:o=6,type:n="idle",label:e="",loading:r=false,...t})=>{let{style:s,className:u,rest:m}=N(t);return jsxs(l,{style:{width:`${o+4}px`,height:`${o+4}px`,...s},as:`--badge rel flex aic jcc ${u}`.trim(),children:[jsx(l,{fx:{transition:q.FadeIn,curve:Z.Liquid,duration:.5,when:r},as:"abs abc",children:jsx(he,{})}),jsx(l,{style:{width:`${o}px`,height:`${o}px`},as:`--dot --${n}`})]})},Li=Bi;var Ui=[{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)}],Wi=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)})},Zr=forwardRef((o,n)=>{let{defaultValue:e,variant:r,onChange:t,...s}=o,{style:u,className:m,rest:p}=N(s),[a,i]=useState(e||new Date),f=startOfMonth(a),c=endOfMonth(a),g=startOfWeek(f),w=endOfWeek(c),x=useMemo(()=>eachDayOfInterval({start:g,end:w}),[g,w]),v=d=>{t?.(d),i(d);},R=()=>{i(d=>new Date(d.getFullYear(),d.getMonth()-1));},h=()=>{i(d=>new Date(d.getFullYear(),d.getMonth()+1));};return jsxs(l,{as:`--calendar flex --${r||"sm"} ${m}`,style:u,children:[jsx(l,{as:"--calendar-quick-select flex cols flex:1",children:Wi(Ui).map(d=>{let S=d.getDate();return jsxs(z,{onClick:()=>v(S),as:["--calendar-quick-option flex aic gap:5"],children:[jsx(H,{as:"flex:1",children:d.label}),jsx(H,{as:"tar",children:d.getDateFormat()})]},`--dtp-option-label-${d.label}`)})}),jsxs(l,{as:"--calendar-selector flex cols flex:1",children:[jsxs(l,{as:"--calendar-head flex aic jcc gap:4",children:[jsx(H,{as:"flex:1 --calendar-cm bold",children:format(a,"MMMM yyyy")}),jsx(z,{onClick:R,as:"--calendar-chevron",children:k.chevronUpOutline}),jsx(z,{onClick:h,as:"--calendar-chevron",children:k.chevronDownOutline})]}),jsxs(l,{as:"--calendar-days gap:4",children:[["Su","Mo","Tu","We","Th","Fr","Sa"].map(d=>jsx(H,{as:"--calendar-day",children:d},`--calendar-hd-${d}`)),x.map((d,S)=>{let I=isSameMonth(d,a),P=isSameDay(d,a),C=isToday(d);return jsx(z,{disabled:!I,onClick:()=>v(d),as:["--calendar-day --calendar-dd",`${P?"--calendar-dd-selected":""}`,`${C?"--calendar-dd-current":""}`],children:format(d,"d")},`--calendar-day-${S}-${d.getFullYear()}-${d.getMonth()}-${d.getDay()}`)})]})]})]})});Zr.displayName="Zuz.Calendar";var to=Zr;var Kr=(n=>(n.Line="line",n))(Kr||{});var Gr=forwardRef((o,n)=>{let{data:e,width:r,height:t,lineColor:s,strokeWidth:u=2,gradientStartColor:m,gradientEndColor:p,animated:a,animDuration:i=2,animDelay:f=0,padding:c=0,type:g,...w}=o,{className:x,style:v,rest:R}=N(w),h=useRef(null),d=useResizeObserver(h.current?.parentElement||h),S=typeof r=="number"?r:d.width,I=typeof t=="number"?t:d.height,P={width:S,height:I},C=useId(),{pathD:E,areaPathD:D}=useLineChart(e,P,c+(u||2)),B=useRef(null),_=useRef(null),[L,G]=useState(0),[U,V]=useState(0);return useEffect(()=>{a&&(B.current&&G(B.current.getTotalLength()),_.current&&V(_.current.getTotalLength()));},[a,E,D,S,I]),jsx(l,{ref:h,as:`--chart --${g||"line"}-chart ${x}`.trim(),style:{...v,width:r,height:t},...R,children:S>0&&I>0&&jsxs("svg",{viewBox:`0 0 ${S} ${I}`,preserveAspectRatio:"xMidYMid meet",children:[jsx("defs",{children:jsxs("linearGradient",{id:C,x1:"0%",y1:"0%",x2:"0%",y2:"100%",children:[jsx("stop",{offset:"0%",stopColor:m}),jsx("stop",{offset:"100%",stopColor:p})]})}),jsx("path",{ref:_,d:D,fill:`url(#${C})`,stroke:"none",style:a?{strokeDasharray:U,strokeDashoffset:U}:{},children:a&&jsx("animate",{attributeName:"stroke-dashoffset",from:U,to:"0",dur:`${i||2}s`,begin:`${f||0}s`,fill:"freeze"})}),jsx("path",{ref:B,d:E,fill:"none",stroke:s,strokeWidth:u,strokeLinecap:"round",strokeLinejoin:"round",style:a?{strokeDasharray:L,strokeDashoffset:L}:{},children:a&&jsx("animate",{attributeName:"stroke-dashoffset",from:L,to:"0",dur:`${i||2}s`,begin:`${f||0}s`,fill:"freeze"})})]})})});Gr.displayName="Zuz.Chart";var Ji=Gr;var qr=(t=>(t[t.Sending=0]="Sending",t[t.Sent=1]="Sent",t[t.Delivered=2]="Delivered",t[t.Read=3]="Read",t))(qr||{}),Xr=(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))(Xr||{});var Qr=forwardRef((o,n)=>{let{progress:e,type:r,animated:t,...s}=o,u=useRef(null);useImperativeHandle(n,()=>({setProgress:i=>{u.current.style.width=`${i*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:m,style:p,rest:a}=N(s);return jsx(l,{className:`--progress ${t?"--animated":""} flex rel ${m}`.trim(),style:p,...a,children:jsx(l,{ref:u,className:"--bar rel"})})});Qr.displayName="Zuz.ProgressBar";var ro=Qr;var Jr=forwardRef((o,n)=>{let{text:e,media:r,side:t="me",status:s=1,timeStamp:u=Date.now(),arrow:m=true,...p}=o,{className:a,style:i,rest:f}=N(p);return jsx(l,{className:`--bubble-wrapper flex --bw-${t}`.trim(),children:jsxs(l,{className:`--bubble --bubble-${t} ${r?`--with-media --bma-${r.type}`:""} rel flex cols ${m==true?"--b-arrow":""} ${a}`.trim(),style:{...i},...f,children:[e&&jsx(H,{className:"--bubble-text",children:e}),r?r.type=="audio"?jsxs(l,{as:"flex aic --bubble-audio",children:[jsx(Q,{className:"--bm-action",children:k.play}),jsx(ro,{progress:.7}),jsx(H,{className:"--bm-dur",children:r.duration??"00:13"})]}):r.type=="img"?jsx(l,{as:"--bubble-image",children:jsx(Qe,{src:r.source})}):null:null,jsxs(l,{as:"flex aie jce --bubble-stats",children:[jsx(H,{className:"--bubble-stamp tar",children:timeSince(u)}),t=="me"&&jsx(Q,{className:`--bubble-status --bs-${s}`,children:s==0?k.pending:s==1?k.done:s==2?k.doneAll:k.doneAll})]})]})})});Jr.displayName="Zuz.Bubble";var sl=Jr;var jr=forwardRef((o,n)=>{let{style:e,className:r,rest:t}=N(o);return jsx("label",{ref:n,style:e,className:r,...t})});jr.displayName="Zuz.Label";var je=jr;var en=forwardRef((o,n)=>{let{name:e,required:r,type:t,value:s,size:u,variant:m,checked:p,onSwitch:a,...i}=o,[f,c]=useState(p||false),g=useRef(null),{variant:w}=ee(true);return useImperativeHandle(n,()=>({setChecked(x,v=true){c(x),g.current&&(g.current.checked=x),v&&a&&a(x,s||"cb");},toggle(x=true){g.current&&(g.current.checked=!f),x&&a&&a&&a(!f,s||"cb"),c(!f);}})),jsxs(je,{className:`--${(t||ve.Default).toLowerCase()} ${!t||t==ve.Default?"--checkbox":"--switch"} --${m||w||W.Small} flex aic jcc ${f?"is-checked":""} rel`.trim(),...i,children:[(!t||t==ve.Default)&&k.check,jsx(re,{ref:g,defaultChecked:f,value:s||"cb",type:"checkbox",className:"abs",name:e,required:r||false,onChange:x=>{a&&a(x.target.checked,s||"cb"),c(x.target.checked);}})]})});en.displayName="Zuz.CheckBox";var et=en;var gl=({ref:o,...n})=>{let{code:e,lang:r="tsx",showLines:t=false,highlight:s="",as:u,fx:m,...p}=n,a=useRef(null),{className:i,style:f,rest:c}=N({as:`rel p:20 br:8 bg:shade-1 overflow:auto font:mono ${u}`,fx:m},a),g=useMemo(()=>{let x=new Set;return s.split(",").forEach(v=>{if(v.includes("-")){let[R,h]=v.split("-").map(Number);for(let d=R;d<=h;d++)x.add(d);}else v&&x.add(Number(v));}),x},[s]),w=useMemo(()=>{let x=e.split(`
|
|
9
|
-
`);for(;x.length>0&&x[0].trim()==="";)x.shift();for(;x.length>0&&x[x.length-1].trim()==="";)x.pop();let v=x[0]?.match(/^\s*/)?.[0].length||0,R=x.map(d=>{let S=d.match(/^\s*/)?.[0].length||0,I=Math.min(S,v);return d.slice(I)}),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:/(<\/?[A-Z][\w\.]*|>)/g},{name:"var",re:/(?<!<\/|<)\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 R.map((d,S)=>{let I=d.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">"),P=g.has(S+1),C=[];h.forEach(E=>{I=I.replace(E.re,
|
|
8
|
+
document.documentElement.style.colorScheme = theme;`}}),jsx($t,{children:o})]})},Go=(o,n)=>{if(Ks)return;let e;try{e=localStorage.getItem(o)||void 0;}catch{}return e||n};var Yo=forwardRef((o,n)=>{let{name:e,pathCount:r,variant:t,color:s,...u}=o,{variant:m}=J(true),{className:p,style:a,rest:i}=N(u);return jsx("div",{style:{color:s,...a},className:`icon-${e} --icon --${t||m||G.Small} ${p}`.trim(),ref:n,...i,children:Array(r||0).fill(0).map((f,c)=>jsx(Q,{className:`path${c+1}`},`${e}-layer-${c}`))})});Yo.displayName="Zuz.Icon";var X=Yo;var me={Simple:"SIMPLE",Roller:"ROLLER",Wave:"Wave"};var Qo=o=>{let {type:n,variant:e,width:r,speed:t,color:s,background:u,foreground:m,...p}=o,{className:i,style:f,rest:c}=N(p);return jsx(l,{className:`${i} --spinner --${(n||me.Simple).toLowerCase()} --${e}`.trim(),style:{...f},...c})};Qo.displayName="Zuz.Spinner";var he=Qo;var gt={Loading:"loading",Normal:"normal"};var jo=({ref:o,...n})=>{let{reset:e,variant:r,icon:t,iconSize:s,children:u,withLabel:m,spinner:p,state:a,disabled:i,...f}=n,{style:c,className:g,rest:w}=N(f),{variant:x}=J(true);return jsxs("button",{className:`--button --${r||x} flex aic ${e?"":"jcc"} ${t?"--with-icon":""} ${g}`.trim().replace(/\s+/g," "),style:c,ref:o,disabled:a==gt.Loading||n.skeleton?.enabled||i,...w,children:[a==gt.Loading&&jsx(he,{variant:r||x,type:p||me.Simple}),(!a||a==gt.Normal)&&jsxs(Fragment$1,{children:[t&&jsx(X,{variant:s,name:t}),m===true?jsx(Q,{children:u}):u]})]})};jo.displayName="Zuz.Button";var _=jo;var Qs={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"})," "]}),[ie.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"})}),[ie.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"})}),[ie.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"})}),[ie.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=Qs;var Js=({title:o="Alert",onClose:n})=>jsxs(l,{as:"--head flex aic rel",children:[jsx(l,{as:`--${o?"title":"dot"} flex aic jcc rel`,children:o}),jsx(_,{onClick:e=>n(),className:"--closer abs center-v",children:D.close})]}),tr=Js;var ea=({action:o,render:n=true,message:e=""})=>jsx(l,{as:`--body flex aic rel ${o?"":"--no-action"}`.trim(),children:n?e:null}),or=ea;var oa=({action:o,actionPosition:n,dialogID:e,variant:r})=>jsx(l,{as:`--footer flex aic rel ${n?n==Vo.Center?"jcc":"":"jce"}`.trim(),children:o.map((t,s)=>jsx(_,{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}`))}),nr=oa;var ar=forwardRef((o,n)=>{let{h:e,html:r,children:t,lines:s,...u}=o,{style:m,className:p,rest:a}=N(u),i=`h${o.h||1}`;return jsx(i,{ref:n,style:m,className:p,...a,children:r?jsx(Q,{dangerouslySetInnerHTML:{__html:r}}):t})});ar.displayName="Zuz.Text";var H=ar;var lr=forwardRef((o,n)=>{let{message:e,spinner:r,spinnerSize:t,color:s,when:u,hideMessage:m,...p}=o,{className:a,style:i,rest:f}=N(p);return "when"in o&&o.when==false?null:jsxs(l,{className:`--cover flex aic jcc cols abs fillx nope nous ${a}`.trim(),style:{...i,backgroundColor:"var(--cover-bg)"},...f,children:[jsx(he,{variant:t||G.Small,type:r||me.Simple}),!m&&jsx(H,{className:"--label",style:{color:"var(--cover-label)"},children:e||"loading"})]})});lr.displayName="Zuz.Cover";var Be=lr;var pr=({ref:o,...n})=>{let{index:e,id:r,title:t,message:s,transition:u,curve:m,speed:p,type:a,action:i,actionPosition:f,spinner:c,loadingMessage:g,variant:w,onClose:x,onShow:v,onHide:R,...h}=n,d=useMemo(()=>uuid(12),[]),[S,I]=useState(t||""),[P,C]=useState(s||""),[E,O]=useState(a||De.Dialog),[M,$]=useState(false),[B,K]=useState(true),[W,A]=useState(i||null),[T,V]=useState(false),{variant:z,spinner:U,dialog:k}=J(true),F=w||k?.variant||z||G.Small,{style:Y,className:oe,rest:ee}=N(h),pe=useRef(null),ge=se({when:M,duration:p||k?.speed||.3,delay:k?.delay||.1,transition:u||k?.transition||q.SlideInBottom,curve:m||k?.curve||Z.EaseInOut});return useEffect(()=>{O(De.Dialog),C(s),I(S),W&&A(W.reduce((lt,mt)=>(lt.push({...mt,key:mt.key||uuid(12)}),lt),[])),$(true),setTimeout(()=>v?v():()=>{},1e3);},[]),jsxs(Fragment$1,{children:[jsx(Ee,{when:M}),jsxs(l,{as:`--dialog --${(a??De.Default).toLowerCase()} ${M?"--visible":""} ${oe} fixed abc`.trim(),style:ge.style,...ee,ref:pe,children:[jsx(Be,{when:T,spinner:c||k?.spinner||U?.type||me.Simple,message:g||k?.loadingMessage}),jsx(tr,{title:S,onClose:()=>{x(r),$(false);}}),jsx(or,{message:P,render:B,action:W}),W&&jsx(nr,{variant:F,action:W,dialogID:d,actionPosition:f})]})]})};pr.displayName="Zuz.Dialog";var _t=pr;var ur=(s=>(s.Default="default",s.Success="success",s.Error="error",s.Warn="warn",s.Promise="promise",s))(ur||{}),fr={success:"Action Successful",error:"Something Went Wrong",warn:"Heads Up",default:"Notice"};var pa=({index:o,id:n,type:e,icon:r,title:t,message:s,duration:u,onClose:m})=>{let p=useDelayed(),a=useDelayed(((u||4)-1)*1e3),{toast:i}=J(true),f=se({when:p&&!a,duration:i?.duration||.2,transition:q.SlideInTop,curve:i?.curve||Z.EaseInOut});return useEffect(()=>{console.log("--expired",a,n),a&&n&&m?.(n);},[a,n]),jsxs(l,{as:`--snack --${e} --snack-${n} ${o>2?"--snacked":""} flex aic`,style:f.style,children:[jsx(l,{as:"--ico flex aic jcc",fx:{transition:q.ScaleIn,curve:Z.Spring,delay:.2,when:p&&!a},children:r?jsx(X,{name:r,fx:{transition:q.ScaleIn,curve:Z.Spring,delay:.4,duration:.5,when:p&&!a}}):jsx(l,{as:"--no-icon",fx:{transition:q.ScaleIn,curve:Z.Spring,delay:.4,duration:.5,when:p&&!a}})}),jsxs(l,{as:"--meta",children:[jsx(H,{as:"--tt",fx:{transition:q.SlideInTop,curve:Z.Spring,delay:.3,when:p},children:t||fr[e]}),jsx(H,{as:"--tm",fx:{transition:q.SlideInTop,curve:Z.Spring,delay:.4,duration:.5,when:p},children:s})]})]})},Ft=pa;var Zt=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 Zt;var hr=forwardRef((o,n)=>{let{speed:e,style:r,...t}=o,{rootRef:s,containerRef:u,thumbY:m,thumbX:p,onScrollY:a,onScrollX:i}=useScrollbar(e||1),{style:f,className:c,rest:g}=N(t);return useEffect(()=>{let w=u.current;if(!w)return;let x=()=>{window.dispatchEvent(new Event("resize"));};return w.addEventListener("scroll",x),()=>w.removeEventListener("scroll",x)},[]),jsxs(l,{ref:s,className:c.trim(),as:"--scrollview rel",children:[jsx(l,{as:`--scroll-content ${c}`.trim(),ref:u,style:r||{},children:g.children}),jsx(l,{as:"--scroll-track --track-y --abs",children:jsx(l,{as:"--scroll-thumb --abs",ref:m,onMouseDown:a})}),jsx(l,{as:"--scroll-track --track-x --abs",children:jsx(l,{as:"--scroll-thumb --abs",ref:p,onMouseDown:i})})]})});hr.displayName="Zuz.ScrollView";var Kt=hr;var br=({ref:o,...n})=>{let{id:e,index:r,from:t,speed:s,children:u,margin:m,animation:p,prerender:a,onClose:i,...f}=n,{drawer:c}=J(true),[g,w]=useState(u),[x,v]=useState(false),[R,h]=useState(a??(c?.prerender||true)),d=()=>{v(false),i?.(e??-1);},{className:S,style:I,rest:P}=N(f),C=useMemo(()=>[{keys:[KeyCode.Escape],callback:()=>{Xe.isTop(d)&&d();}}],[x]);useShortcuts(C),useEffect(()=>{w(u);},[u]),useEffect(()=>(x?Xe.push(d):Xe.pop(d),()=>Xe.pop(d)),[x]),useEffect(()=>{v(true);},[]);let E=t||c?.from||ne.Left,O=useMemo(()=>{switch(E){case ne.Left:return {from:{x:"-100vw"},to:{x:0}};case ne.Right:return {from:{x:"100vw"},to:{x:0}};case ne.Top:return {from:{y:"-100vh"},to:{y:0}};case ne.Bottom:return {from:{y:"100vh"},to:{y:0}};default:return {from:{x:"-100vw"},to:{x:0}}}},[t,c?.from]),M=se({from:{...O.from,opacity:0},to:{...O.to,opacity:1},when:x,curve:p||c?.animation||Z.EaseInOut,duration:s||c?.speed||.5});return jsxs(Fragment$1,{children:[jsx(Ee,{onClick:$=>{x&&d();},when:x}),jsxs(l,{ref:o,"aria-hidden":!x,className:`--drawer flex cols ${S} --${E.toLowerCase()} fixed`,style:{...I,...M.style,"--m":`${m||c?.margin||0}px`},...P,children:[t==ne.Top||t==ne.Bottom?jsx(l,{className:"--handle"}):null,jsx(Kt,{children:R||x?g:null})]})]})};br.displayName="Zuz.Drawer";var qt=br;var ba=o=>{let{label:n,labelColor:e,icon:r,iconColor:t,index:s,className:u,onSelect:m}=o;return n=="-"?jsx(l,{className:"--line"}):jsxs(_,{reset:true,onClick:p=>m(),className:`--item ${u||""}`.trim(),children:[jsx(l,{as:"--icon",children:jsx(X,{name:r,className:"--ico",style:t?{color:t}:{}})}),jsx(H,{className:"--lbl flex aic",style:e?{color:e}:{},children:n})]})},vr=ba;var Cr=({ref:o,...n})=>{let{id:e,as:r,offsetX:t,offsetY:s,parent:u,event:m,when:p,items:a,header:i,footer:f,origin:c=Ke.TopRight,...g}=n,[w,x]=useState(false),[v,R]=useState(a||[]),{position:h,targetRef:d,calculatedAnchor:S}=useAnchorPosition(u?.current,m,{offsetX:t,offsetY:s,preferredAnchor:c});useEffect(()=>{p&&h.top!==0?x(true):p||x(false);},[p,h]);let{className:I,style:P,rest:C}=N(g),E=se({from:{opacity:0,scale:.8,y:-10},to:{opacity:1,scale:1,y:0},curve:Z.EaseInOut,duration:.05,when:w});return jsxs(l,{className:`--contextmenu abs flex cols ${I}`.trim(),"aria-hidden":!w,style:{...P,...E.style,top:h.top,left:h.left,overflow:"hidden",transformOrigin:S},...C,children:[typeof i=="function"?createElement(i):i,v.map((O,M)=>jsx(vr,{...O,index:M},`context-${O.label.toLowerCase()}-${M}`)),typeof f=="function"?createElement(f):f]})};Cr.displayName="Zuz.ContextMenu";var Xt=Cr;var ce=createContext(null),La=({ref:o,...n})=>{let r=useContext(ce)?.depth??0,[t,s]=useState(null),[u,m]=useState(false),[p,a]=useState([]),i=useDelayed(),f=useRef(0),c=()=>++f.current,g=()=>{m(false),setTimeout(()=>s(null),200);};useImperativeHandle(o,()=>({add(h){let d=c(),S={id:d,...h};return a(I=>[S,...I.slice(0,20)]),d},openMenu(h){m(false),setTimeout(()=>{s({id:c(),type:"menu",props:h}),m(true);},16);},remove(h){a(d=>d.filter(S=>S.id!==h)),t?.id===h&&g();},clear(){a([]);}})),useEffect(()=>{if(t&&u){let h=()=>g();return document.addEventListener("click",h),()=>document.removeEventListener("click",h)}},[t,u,g]);let w=h=>{setTimeout(()=>{a(d=>d.filter(S=>S.id!==h)),t?.id===h&&s(null);},1e3);};if(!i)return null;let x=p.filter(h=>h.type=="dialog").reverse(),v=p.filter(h=>h.type=="drawer").reverse(),R=p.filter(h=>h.type=="toast");return createPortal(jsxs(l,{as:"--zuz-layers-wrapper fixed fill nope",style:{zIndex:9999+r},children:[x.length>0&&jsx(l,{as:"--zuz-layer-dialogs fixed fill nope",children:x.map((h,d)=>jsx(_t,{onClose:w,index:d,id:h.id,...h.props},`layer-${h.type}-${h.id}`))}),v.length>0&&jsx(l,{as:"--zuz-layer-drawers fixed fill nope",children:v.map((h,d)=>jsx(qt,{onClose:w,index:d,id:h.id,...h.props},`layer-${h.type}-${h.id}`))}),R.length>0&&jsx(l,{as:"--zuz-layer-toasts fixed fill nope",children:R.map((h,d)=>jsx(Ft,{onClose:w,index:d,id:h.id,...h.props},`layer-${h.type}-${h.id}`))}),t&&jsx(l,{as:"--zuz-layer-menus fixed fill nope",children:jsx(Xt,{onClose:g,when:u,...t.props},`menu-${t.id}`)})]}),document.body)},Ma=({children:o})=>{let n=useContext(ce),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(ce.Provider,{value:t,children:[o,jsx(La,{ref:r})]})},$t=Ma;var ka=()=>{let o=useContext(ce);if(!o)throw new Error("useDialog must be used inside <LayersProvider>");return {clearAll:()=>o.clear(),show:t=>o.add({type:"dialog",props:{...t,type:De.Dialog}}),hide:t=>o.remove(t)}},Da=ka;var Aa=()=>{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,c)=>n("default",{title:a,message:i,icon:f,duration:c}),hide:a=>o.remove(a),success:(a,i,f,c)=>n("success",{title:a,message:i,icon:f,duration:c}),error:(a,i,f,c)=>n("error",{title:a,message:i,icon:f,duration:c}),warn:(a,i,f,c)=>n("warn",{title:a,message:i,icon:f,duration:c}),promise:(a,i,f,c)=>n("promise",{title:a,message:i,icon:f,duration:c}),clearAll:()=>o.clear()}},Qt=Aa;var $a=()=>{let o=useContext(ce);if(!o)throw new Error("useDialog must be used inside <LayersProvider>");let n=()=>o.clear(),e=t=>o.remove(t),r=t=>o.add({type:"drawer",props:t});return {clearAll:n,open:t=>r({children:t}),right:t=>r({children:t,from:ne.Right}),left:t=>r({children:t,from:ne.Left}),top:t=>r({children:t,from:ne.Top}),bottom:t=>r({children:t,from:ne.Bottom}),close:e}},za=$a;var Fa=(o,n,e={})=>{let[r,t]=useState(null),[s,u]=useState(false),{duration:m=.25,curve:p=Z.EaseOutBack,borderRadius:a={from:40,to:24},targetWidth:i=320}=e;return useLayoutEffect(()=>{n&&o.current?(t(o.current.getBoundingClientRect()),u(true)):n||u(false);},[n,o]),{style:se({from:{opacity:0,width:r?.width,height:r?.height,borderRadius:a.from},to:{opacity:1,width:i,height:"auto",borderRadius:a.to},curve:p,duration:m,when:s&&n}).style,isMeasured:s,sourceRect:r}},Za=Fa;var Ua=()=>{let o=useContext(ce);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,t,s)=>{o.openMenu({parent:r,items:t,origin:s||Ke.TopCenter});},hide:o.clear}},Wa=Ua;var Ir=({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:m}=N(e,t);return jsx("div",{ref:o||r,style:{...s,...n||{}},className:u,...m})};Ir.displayName="Zuz.Box";var l=Ir;var Br=forwardRef((o,n)=>{let{title:e,message:r,...t}=o,[s,u]=useState(false);return jsxs(l,{className:"--accordion flex cols",...t,children:[jsxs(_,{onClick:m=>u(!s),className:`--toggle flex aic ${s?"--open":""}`.trim(),children:[jsx(H,{className:"--label flex",children:e}),jsx(l,{className:"--arrow flex",children:s?D.arrowUp:D.arrowDown})]}),s&&jsx(l,{className:"--detail",children:r})]})});Br.displayName="Zuz.Accordion";var Ja=Br;var ja=({label:o,icon:n,onClick:e,idx:r,selected:t})=>jsx(_,{onClick:e,onMouseMove:s=>document.documentElement.style.setProperty("--tip-m",`${r}`),className:`--action ${t?"--selected":""} aic jcc rel`.trim(),children:typeof n=="string"?jsx(X,{name:n}):n}),Mr=ja;var Or=forwardRef((o,n)=>{let{items:e,name:r,selected:t,position:s,...u}=o,m=useRef(null),[p,a]=useState(t||e[0].tag||0),i=useCallback(({x:v,y:R})=>{if(m.current){let h=m.current.getBoundingClientRect();document.documentElement.style.setProperty("--tip-x",`${v-h.left}`),document.documentElement.style.setProperty("--tip-y",`${R-h.top}`),document.documentElement.style.setProperty("--tip-s","1");}},[]),f=useCallback(()=>{m.current&&(m.current.removeEventListener("pointerleave",f),m.current.removeEventListener("pointermove",i),document.documentElement.style.setProperty("--tip-s","0"));},[]),c=useCallback(()=>{m.current&&(m.current.addEventListener("pointerleave",f),m.current.addEventListener("pointermove",i));},[]);useEffect(()=>{m.current&&(document.documentElement.style.setProperty("--tip-w",e.reduce((v,R)=>R.label.length>v.length?R.label:v,"").length.toString()),document.documentElement.style.setProperty("--tip-s","0"),document.documentElement.style.setProperty("--tip-l",`${e.length}`),m.current?.addEventListener("pointerenter",c));},[]);let{className:g,style:w,rest:x}=N(u);return jsxs(l,{ref:m,style:w,className:[`--actionbar flex aic ${g}`,`${!s||s==te.Auto?"rel":`--${s}`}`].join(" ").trim(),...x,children:[e.map((v,R)=>jsx(Mr,{selected:p===v.tag||t==R,...v,idx:R},`actionbar-action-${v.label.toLowerCase().replace(/\s+/g,"-")}`)),jsx(l,{className:"--tip abs",children:jsx(l,{className:"--track flex aic",children:e.map(({label:v})=>jsx(l,{className:"--lb",children:v},`tool-tip-${v.toLowerCase().replace(/\s+/g,"-")}`))})})]})});Or.displayName="Zuz.ActionBar";var ni=Or;var Dr=forwardRef((o,n)=>{let{type:e,icon:r,title:t,message:s,iconSize:u,...m}=o,{className:p,style:a,rest:i}=N(m);return jsxs(l,{className:`--alert --${e||ie.Info} flex aic ${p}`.trim(),style:a,...i,children:[jsx(l,{className:`--icon icon-${r||"auto-matic"}`,style:u?{fontSize:u,width:u,height:u}:{},children:!r&&D[e||ie.Info]}),jsxs(l,{className:"--meta flex cols",children:[jsx(H,{className:`--title ${s?"--tm":""}`,children:t||"Lorem ipsum dolor sit amet, consectetur adipiscing elit."}),s&&jsx(H,{className:"--message",h:2,children:s})]})]})});Dr.displayName="Zuz.Alert";var ii=Dr;var Hr=({ref:o,...n})=>{let{variant:e,numeric:r,onConfirm:t,...s}=n,{style:u,className:m,rest:p}=N(s),{variant:a}=J(true),i=f=>{r&&(f.currentTarget.value=f.currentTarget.value.replace(/[^0-9.]/g,"").replace(/(\..*?)\..*/g,"$1"));};return jsx("input",{className:`--input --${e||a} flex ${m}`.trim(),style:u,onInput:i,onKeyDown:f=>{f.key=="Enter"&&t?.(f.currentTarget.value);},ref:o,...p})};Hr.displayName="Zuz.Input";var re=Hr;var Vr=o=>{let{meta:n,children:e}=o,r=useDelayed(),{label:t,icon:s,...u}=isValidElement(n)?{}:n,{className:m,style:p,rest:a}=N({...u,...u.animate?{animate:{...u.animate,when:r}}:{}});return isValidElement(n)?jsx("li",{style:p,className:m,children:n}):jsxs("li",{style:p,className:m,...a,children:[e,typeof n=="string"?n:t]})};Vr.displayName="Zuz.ListItem";var $r=Vr;var _r=forwardRef((o,n)=>{let{items:e,variant:r,direction:t,seperator:s,ol:u,...m}=o,{className:p,style:a,rest:i}=N(m),f=u==true?"ol":"ul";return createElement(f,{className:`--list --${r||G.Small} flex ${t??"cols"} ${p}`.trim(),style:a,ref:n,...i,children:e.map((c,g,w)=>{let x=`${typeof c=="string"?`li-${String(c)}`:isValidElement(c)?`li-${c.key}`||`${g}-${MD5(c.toString())}`:c.label}-${g}`;return jsxs(Fragment,{children:[jsx($r,{meta:c}),s&&w[g+1]?jsx("li",{className:"--list-seperator",children:s},`spt-${g+1}-${x}`):null]},x)})})});_r.displayName="Zuz.List";var Me=_r;var Zr=forwardRef((o,n)=>{let{fx:e,action:r,data:t,withStyle:s,onChange:u,...m}=o,{className:p}=N({as:s||""}),{style:a}=N(m),[i,f]=useState(false),[c,g]=useState(t||[]),w=useRef(null),x=useRef(null),v=useRef(null),R=useMemo(()=>m.name||uuid(12),[]),[h,d]=useState(null),[S,I]=useState(null),[P,C]=useState([]),O=useDebounce(T=>{T.target.value==""?(f(false),g([])):r&&T.target.value.trim()!=""&&withPost(r,{query:T.target.value}).then(V=>{"items"in V&&_$1(V.items).isArray()?(g(V.items),I(T.target.value),C(V.items)):console.error("Action Response should contain items array"),d(null);}).catch(V=>{d(null),g([]);});},250),M=()=>{if(x.current){let T=x.current.getBoundingClientRect(),V=window.innerHeight-T.bottom,z=T.top;if(v.current){let U=v.current;V<U.offsetHeight&&z>V?(U.style.top="auto",U.style.bottom=`${T.height}px`,U.style.maxHeight=`${z-150}px`):(U.style.top=`${T.height+5}px`,U.style.bottom="auto",U.style.maxHeight=`${V-150}px`);}}},$=T=>{if(c.length>0){if((T.key==="ArrowDown"||T.key==="ArrowUp")&&(T.preventDefault(),T.stopPropagation()),T.key==="Escape")d(null),f(false),g([]);else if(T.key==="ArrowDown")d(V=>{let z=V===null||V===c.length-1?0:V+1;return K(z),z});else if(T.key==="ArrowUp")d(V=>{let z=V===null||V===0?c.length-1:V-1;return K(z),z});else if(T.key==="Enter"&&h!==null){let V=c[h];w.current&&(w.current.value=V,f(false),g([]));}}},B=T=>{w.current&&(w.current.value=T,f(false),g([]));},K=T=>{let V=c[T];if(V&&w.current&&(w.current.value=V,w.current.setSelectionRange(V.length,V.length)),v.current){let U=v.current.children[T];U&&U.scrollIntoView({block:"nearest"});}},W=T=>{x.current&&!x.current.contains(T.target)&&(f(false),g([]));},A=()=>{w.current&&w.current.value===S&&(g(P),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();},[c]),jsxs(l,{style:a,ref:x,className:`--autocomplete --${o.size||G.Small} flex aic rel ${p}`.trim(),children:[jsx(re,{ref:w,autoComplete:"off",onChange:O,onKeyDown:$,onFocus:A,...m}),jsx(l,{className:"--arrow rel flex aic jcc",children:c.length>0?D.arrowUp:D.arrowDown}),c.length>0&&jsx(Me,{id:R,ref:v,className:"--suggestion-list flex cols abs",items:c.map((T,V)=>({label:T,onClick:z=>{z.preventDefault(),z.stopPropagation(),B(T);},className:h===V?"--current":"",animate:{transition:q.SlideInBottom,curve:Z.EaseInOut,delay:clamp(.02*V,.02,.5)}}))})]})});Zr.displayName="Zuz.AutoComplete";var Pi=Zr;var Kr=forwardRef((o,n)=>{let e=useRef(null),r=useMemo(()=>n&&typeof n!="function"&&n.current?n:e,[n]),{style:t,className:s,rest:u}=N(o,r);return !u.src||u.src==""?null:jsx("img",{ref:r,style:t,className:`${s} flex`,...u})});Kr.displayName="Zuz.Image";var Je=Kr;var Ur=forwardRef((o,n)=>{let{src:e,variant:r,type:t,crossOrigin:s,referrerPolicy:u,fx:m,as:p,alt:a,color:i,style:f,...c}=o,[g,w,x]=useImage(e??"",s,u),{className:v,style:R,rest:h}=N({fx:m,as:p});return useEffect(()=>{if(t==Bt.Square&&!document.getElementById("squareRadiusClipPath")){let d="http://www.w3.org/2000/svg",S=document.createElementNS(d,"svg");S.setAttribute("width","0"),S.setAttribute("height","0");let I=document.createElementNS(d,"defs"),P=document.createElementNS(d,"clipPath");P.setAttribute("id","squareRadiusClipPath"),P.setAttribute("clipPathUnits","objectBoundingBox");let C=document.createElementNS(d,"path");C.setAttribute("d","M0.986 0.347C0.951 0.11 0.777 -0.002 0.5 0C0.223 -0.002 0.049 0.11 0.014 0.347C0.005 0.404 0 0.452 0 0.5C0 0.548 0.005 0.596 0.014 0.653C0.049 0.89 0.223 1.002 0.5 1C0.777 1.002 0.951 0.89 0.986 0.653C0.995 0.596 1 0.548 1 0.5C1 0.452 0.995 0.404 0.986 0.347Z"),P.appendChild(C),I.appendChild(P),S.appendChild(I),document.body.appendChild(S);}},[e]),jsx(l,{className:`--avatar --${r||G.Small} --${(t||Bt.Circle).toLowerCase()} rel flex aic jcc ${v}`.trim(),style:{background:i||"var(--primary)",...f,...R},...h,children:e?jsx(Je,{src:g,crossOrigin:s,referrerPolicy:u,...c}):jsx(H,{className:"--avatar-label",children:(a?a.charAt(0):"A").toUpperCase()})})});Ur.displayName="Zuz.Avatar";var ki=Ur;var Di=({size:o=6,type:n="idle",label:e="",loading:r=false,...t})=>{let{style:s,className:u,rest:m}=N(t);return jsxs(l,{style:{width:`${o+4}px`,height:`${o+4}px`,...s},as:`--badge rel flex aic jcc ${u}`.trim(),children:[jsx(l,{fx:{transition:q.FadeIn,curve:Z.Liquid,duration:.5,when:r},as:"abs abc",children:jsx(he,{})}),jsx(l,{style:{width:`${o}px`,height:`${o}px`},as:`--dot --${n}`})]})},Hi=Di;var Yi=[{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)}],Qi=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)})},Wr=forwardRef((o,n)=>{let{defaultValue:e,variant:r,onChange:t,...s}=o,{style:u,className:m,rest:p}=N(s),[a,i]=useState(e||new Date),f=startOfMonth(a),c=endOfMonth(a),g=startOfWeek(f),w=endOfWeek(c),x=useMemo(()=>eachDayOfInterval({start:g,end:w}),[g,w]),v=d=>{t?.(d),i(d);},R=()=>{i(d=>new Date(d.getFullYear(),d.getMonth()-1));},h=()=>{i(d=>new Date(d.getFullYear(),d.getMonth()+1));};return jsxs(l,{as:`--calendar flex --${r||"sm"} ${m}`,style:u,children:[jsx(l,{as:"--calendar-quick-select flex cols flex:1",children:Qi(Yi).map(d=>{let S=d.getDate();return jsxs(_,{onClick:()=>v(S),as:["--calendar-quick-option flex aic gap:5"],children:[jsx(H,{as:"flex:1",children:d.label}),jsx(H,{as:"tar",children:d.getDateFormat()})]},`--dtp-option-label-${d.label}`)})}),jsxs(l,{as:"--calendar-selector flex cols flex:1",children:[jsxs(l,{as:"--calendar-head flex aic jcc gap:4",children:[jsx(H,{as:"flex:1 --calendar-cm bold",children:format(a,"MMMM yyyy")}),jsx(_,{onClick:R,as:"--calendar-chevron",children:D.chevronUpOutline}),jsx(_,{onClick:h,as:"--calendar-chevron",children:D.chevronDownOutline})]}),jsxs(l,{as:"--calendar-days gap:4",children:[["Su","Mo","Tu","We","Th","Fr","Sa"].map(d=>jsx(H,{as:"--calendar-day",children:d},`--calendar-hd-${d}`)),x.map((d,S)=>{let I=isSameMonth(d,a),P=isSameDay(d,a),C=isToday(d);return jsx(_,{disabled:!I,onClick:()=>v(d),as:["--calendar-day --calendar-dd",`${P?"--calendar-dd-selected":""}`,`${C?"--calendar-dd-current":""}`],children:format(d,"d")},`--calendar-day-${S}-${d.getFullYear()}-${d.getMonth()}-${d.getDay()}`)})]})]})]})});Wr.displayName="Zuz.Calendar";var so=Wr;var Gr=(n=>(n.Line="line",n))(Gr||{});var Yr=forwardRef((o,n)=>{let{data:e,width:r,height:t,lineColor:s,strokeWidth:u=2,gradientStartColor:m,gradientEndColor:p,animated:a,animDuration:i=2,animDelay:f=0,padding:c=0,type:g,...w}=o,{className:x,style:v,rest:R}=N(w),h=useRef(null),d=useResizeObserver(h.current?.parentElement||h),S=typeof r=="number"?r:d.width,I=typeof t=="number"?t:d.height,P={width:S,height:I},C=useId(),{pathD:E,areaPathD:O}=useLineChart(e,P,c+(u||2)),M=useRef(null),$=useRef(null),[B,K]=useState(0),[W,A]=useState(0);return useEffect(()=>{a&&(M.current&&K(M.current.getTotalLength()),$.current&&A($.current.getTotalLength()));},[a,E,O,S,I]),jsx(l,{ref:h,as:`--chart --${g||"line"}-chart ${x}`.trim(),style:{...v,width:r,height:t},...R,children:S>0&&I>0&&jsxs("svg",{viewBox:`0 0 ${S} ${I}`,preserveAspectRatio:"xMidYMid meet",children:[jsx("defs",{children:jsxs("linearGradient",{id:C,x1:"0%",y1:"0%",x2:"0%",y2:"100%",children:[jsx("stop",{offset:"0%",stopColor:m}),jsx("stop",{offset:"100%",stopColor:p})]})}),jsx("path",{ref:$,d:O,fill:`url(#${C})`,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:E,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"})})]})})});Yr.displayName="Zuz.Chart";var rl=Yr;var Qr=(t=>(t[t.Sending=0]="Sending",t[t.Sent=1]="Sent",t[t.Delivered=2]="Delivered",t[t.Read=3]="Read",t))(Qr||{}),Jr=(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))(Jr||{});var en=forwardRef((o,n)=>{let{progress:e,type:r,animated:t,...s}=o,u=useRef(null);useImperativeHandle(n,()=>({setProgress:i=>{u.current.style.width=`${i*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:m,style:p,rest:a}=N(s);return jsx(l,{className:`--progress ${t?"--animated":""} flex rel ${m}`.trim(),style:p,...a,children:jsx(l,{ref:u,className:"--bar rel"})})});en.displayName="Zuz.ProgressBar";var io=en;var tn=forwardRef((o,n)=>{let{text:e,media:r,side:t="me",status:s=1,timeStamp:u=Date.now(),arrow:m=true,...p}=o,{className:a,style:i,rest:f}=N(p);return jsx(l,{className:`--bubble-wrapper flex --bw-${t}`.trim(),children:jsxs(l,{className:`--bubble --bubble-${t} ${r?`--with-media --bma-${r.type}`:""} rel flex cols ${m==true?"--b-arrow":""} ${a}`.trim(),style:{...i},...f,children:[e&&jsx(H,{className:"--bubble-text",children:e}),r?r.type=="audio"?jsxs(l,{as:"flex aic --bubble-audio",children:[jsx(Q,{className:"--bm-action",children:D.play}),jsx(io,{progress:.7}),jsx(H,{className:"--bm-dur",children:r.duration??"00:13"})]}):r.type=="img"?jsx(l,{as:"--bubble-image",children:jsx(Je,{src:r.source})}):null:null,jsxs(l,{as:"flex aie jce --bubble-stats",children:[jsx(H,{className:"--bubble-stamp tar",children:timeSince(u)}),t=="me"&&jsx(Q,{className:`--bubble-status --bs-${s}`,children:s==0?D.pending:s==1?D.done:s==2?D.doneAll:D.doneAll})]})]})})});tn.displayName="Zuz.Bubble";var cl=tn;var on=forwardRef((o,n)=>{let{style:e,className:r,rest:t}=N(o);return jsx("label",{ref:n,style:e,className:r,...t})});on.displayName="Zuz.Label";var et=on;var rn=forwardRef((o,n)=>{let{name:e,required:r,type:t,value:s,size:u,variant:m,checked:p,onSwitch:a,...i}=o,[f,c]=useState(p||false),g=useRef(null),{variant:w}=J(true);return useImperativeHandle(n,()=>({setChecked(x,v=true){c(x),g.current&&(g.current.checked=x),v&&a&&a(x,s||"cb");},toggle(x=true){g.current&&(g.current.checked=!f),x&&a&&a&&a(!f,s||"cb"),c(!f);}})),jsxs(et,{className:`--${(t||ve.Default).toLowerCase()} ${!t||t==ve.Default?"--checkbox":"--switch"} --${m||w||G.Small} flex aic jcc ${f?"is-checked":""} rel`.trim(),...i,children:[(!t||t==ve.Default)&&D.check,jsx(re,{ref:g,defaultChecked:f,value:s||"cb",type:"checkbox",className:"abs",name:e,required:r||false,onChange:x=>{a&&a(x.target.checked,s||"cb"),c(x.target.checked);}})]})});rn.displayName="Zuz.CheckBox";var tt=rn;var vl=({ref:o,...n})=>{let{code:e,lang:r="tsx",showLines:t=false,highlight:s="",as:u,fx:m,...p}=n,a=useRef(null),{className:i,style:f,rest:c}=N({as:`rel p:20 br:8 bg:shade-1 overflow:auto font:mono ${u}`,fx:m},a),g=useMemo(()=>{let x=new Set;return s.split(",").forEach(v=>{if(v.includes("-")){let[R,h]=v.split("-").map(Number);for(let d=R;d<=h;d++)x.add(d);}else v&&x.add(Number(v));}),x},[s]),w=useMemo(()=>{let x=e.split(`
|
|
9
|
+
`);for(;x.length>0&&x[0].trim()==="";)x.shift();for(;x.length>0&&x[x.length-1].trim()==="";)x.pop();let v=x[0]?.match(/^\s*/)?.[0].length||0,R=x.map(d=>{let S=d.match(/^\s*/)?.[0].length||0,I=Math.min(S,v);return d.slice(I)}),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:/(<\/?[A-Z][\w\.]*|>)/g},{name:"var",re:/(?<!<\/|<)\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 R.map((d,S)=>{let I=d.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">"),P=g.has(S+1),C=[];h.forEach(E=>{I=I.replace(E.re,O=>{let M=`ZUZ_ID_${C.length}_ZUZ`;return C.push(`<span class="--token-${E.name}">${O}</span>`),M});});for(let E=C.length-1;E>=0;E--)I=I.replace(`ZUZ_ID_${E}_ZUZ`,C[E]);return `<div class="--code-line ${t==true?"--with-ln":""} ${P?"--is-highlighted":""}">
|
|
10
10
|
${t==true?`<span class="--line-number">${S+1}</span>`:""}
|
|
11
11
|
<span class="--line-content">${I||" "}</span>
|
|
12
|
-
</div>`}).join("")},[e,g]);return jsx(l,{as:`--code-block ${i}`,style:f,...p,children:jsx("pre",{ref:o,children:jsx("code",{className:`--code --lang-${r}`,dangerouslySetInnerHTML:{__html:w}})})})},hl=gl;var on=({onSelect:o,meta:n,selected:e})=>{let r=useRef(null),{index:t,icon:s,label:u}=n,[m,p]=useState({x:0,width:0}),a=useDelayed();return useLayoutEffect(()=>{if(a&&r.current){let{width:i,x:f}=r.current.getBoundingClientRect();p({x:f,width:i}),e&&o(t,i,f,n,true);}},[a,r.current]),useEffect(()=>{e&&o(t,m.width,m.x,n,false);},[e]),jsxs(z,{onClick:()=>o(t,m.width,m.x,n,false),ref:r,className:`--segment-item flex aic rel ${e?"--segment-active":""}`.trim(),children:[s?typeof s=="string"?jsx(X,{name:s,as:"--segment-icon"}):jsx(l,{as:"--segment-icon flex aic jcc",children:s}):null,u&&String(u).trim()!=""&&jsx(l,{className:"--segment-label",children:u||`Item ${t}`})]})};on.displayName="SelectTabItem";var rn=on;var sn=forwardRef((o,n)=>{let{fx:e,items:r,selected:t,variant:s,onSwitch:u,...m}=o,[p,a]=useState(t||0),i=useRef(false),f=useRef(p),{className:c,style:g,rest:w}=N(m),x=useRef(null),v=useRef(null),R=(h,d,S,I,P)=>{if((P||p!=h&&p!=-2)&&(a(h),f.current=p,i.current&&u?.(I)),x.current){let C=v.current?.getBoundingClientRect();x.current.style.setProperty("--w",`${d}px`),x.current.style.setProperty("--x",`${C?S-C.left:S}px`);}};return useImperativeHandle(n,()=>({setSelected:h=>{typeof h=="number"&&h!=p&&a(h);}}),[p]),useEffect(()=>{i.current=true;},[]),jsxs(l,{ref:v,"data-selected":p,className:`${c} --segmented --${s||W.Small} flex aic rel`,style:g,...w,children:[jsx(l,{ref:x,className:"--segment-tab abs"}),r.map((h,d)=>jsx(rn,{onSelect:R,selected:p==d,meta:{...h,index:d}},`segment-${h.label}-${d}`))]})});sn.displayName="Zuz.SelectTabs";var tt=sn;var mn=forwardRef((o,n)=>{let{type:e,...r}=o,t=useDelayed(),{colorScheme:s,setColorScheme:u}=At(),m=useCallback(()=>{u(s=="dark"?"light":s=="light"?"system":"dark");},[s]),{className:p,style:a}=N(r),i=useMemo(()=>e=="system"?[{tag:"light",index:0,label:"",icon:k.colorSchemeLight},{tag:"system",index:1,label:"",icon:k.colorSchemeSystem},{tag:"dark",index:2,label:"",icon:k.colorSchemeDark}]:[{tag:"light",index:0,label:"",icon:k.colorSchemeLight},{tag:"dark",index:2,label:"",icon:k.colorSchemeDark}],[]),f=useMemo(()=>["light","system","dark"].indexOf(s),[s]);return !t||f==-1?null:e=="system"||e=="switch"?jsx(tt,{className:`--color-scheme --${e}`,onSwitch:({tag:c})=>{u(c);},selected:f,items:i,...r}):jsx(z,{onClick:m,style:a,as:`--color-scheme-switch --${r.variant||W.Small} ${p}`.trim(),children:s=="system"?k.colorSchemeSystem:s=="light"?k.colorSchemeLight:k.colorSchemeDark})});mn.displayName="Zuz.ColorScheme";var Ll=mn;var pn=forwardRef((o,n)=>{let[e,r]=useState("wait"),{title:t,message:s,acceptLabel:u,rejectLabel:m,position:p}=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(l,{fx:{from:{x:-1e3},to:{x:0},when:e=="pending",curve:Z.EaseInOut,duration:.5,delay:e=="accepted"?0:3},as:`--cookie-consent --${e} --${p||te.Left} flex cols`,children:[jsx(H,{as:"--title",children:t||"This site uses cookies"}),jsx(H,{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(l,{as:"--footer flex aic",children:[jsx(z,{onClick:i=>a(1),as:"--accept",children:u||"Accept All"}),jsx(z,{onClick:i=>a(0),as:"--reject",children:m||"Cancel"})]})]})});pn.displayName="Zuz.CookiesConsent";var Dl=pn;var dn=forwardRef((o,n)=>{let {type:e,value:r,min:t,max:s,step:u,onChange:m,roundValue:p,...a}=o,{className:i,style:f,rest:c}=N(a),g=useRef(u||.01).current,w=useRef(t||0).current,x=useRef(s||1).current,v=useRef(r||0).current,R=useRef(null),h=useRef(null),d=useRef(null);useRef(null);let I=useRef(null),P=useRef(null),C=($,K,O)=>($-K)/(O-K)*100,E=$=>{if(h.current){let K=parseFloat($.currentTarget.value),O=C(K,parseFloat($.currentTarget.min),parseFloat($.currentTarget.max));h.current.style.setProperty("--value",`${O}`),h.current.setAttribute("data-value",`${K}`),m&&m(p?+K.toFixed(2):K);}},[D,B]=useState(false),[_,L]=useState(0),[G,U]=useState(0),V=$=>{B(true),L($.clientX),U(h.current?parseFloat(h.current.getAttribute("data-value")):0),document.body.style.cursor="ew-resize";},T=$=>{if(D){let K=$.clientX-_,O=Math.max(w,Math.min(G+K*g,x));h.current&&(h.current.setAttribute("data-value",`${O}`),P.current.textContent=p?O.toFixed(2):O.toString(),m&&m(p?+O.toFixed(2):O));}},A=()=>{B(false),document.body.style.cursor="auto";};return useEffect(()=>{h.current&&h.current.style.setProperty("--value",R.current?`${C(parseFloat(R.current.value),parseFloat(R.current.min),parseFloat(R.current.max))}`:v.toString());},[]),useEffect(()=>(D?(document.addEventListener("mousemove",T),document.addEventListener("mouseup",A)):(document.removeEventListener("mousemove",T),document.removeEventListener("mouseup",A)),()=>{document.removeEventListener("mousemove",T),document.removeEventListener("mouseup",A);}),[D]),jsx(l,{ref:h,"data-value":v||0,className:`--slider --${e||ut.Default} flex rel ${i}`.trim(),style:{...f},children:ut.Text===e?jsx(Fragment$1,{children:jsx(H,{ref:P,onMouseDown:V,className:"--slider-text",children:v||0})}):jsxs(Fragment$1,{children:[jsx(l,{ref:I,className:"--slider-track abs fill"}),jsx(l,{ref:d,className:"--slider-knob abs"}),jsx(re,{ref:R,onInput:E,className:"abs fill",tabIndex:0,type:e||ut.Default,defaultValue:v||0,step:g,max:x,min:w})]})})});dn.displayName="Zuz.Slider";var lo=dn;var hn=forwardRef((o,n)=>{let{src:e,shape:r,size:t,...s}=o,{style:u,className:m,rest:p}=N(s),{canvasRef:a,crop:i,setScale:f,handleMouseDown:c,handleMouseUp:g,handleMouseMove:w}=useImageCropper(e,t||200,r||CropShape.Circle);return useImperativeHandle(n,()=>({getCropped(){return i()},setScale(x){f(x);}})),jsxs(l,{as:`--cropper --${r||CropShape.Circle} ${m}`,style:u,...p,children:[jsx("canvas",{ref:a,width:t||200,height:t||200,onMouseDown:c,onMouseUp:g,onMouseLeave:g,onMouseMove:w}),jsx(l,{as:"--cropper-slider",children:jsx(lo,{onChange:x=>f(x),min:0,max:1,step:.01,value:1})})]})});hn.displayName="Zuz.Cropper";var _l=hn;var Zl=(e=>(e.Circle="circle",e.Square="square",e))(Zl||{});var yn=forwardRef((o,n)=>{let{items:e,maxItems:r}=o,t=useMemo(()=>{let m=typeof e=="string",p=m?[]:e;return m&&e.split(",").forEach(a=>{p.push({label:a});}),p},[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(l,{as:"--crumb-chevron",children:k.chevronRightOutline}),items:u.map((m,p,a)=>m.ID=="."?jsx(l,{as:"flex aic gap:3",children:Array(3).fill(null).map(()=>jsx(l,{as:"w:4 h:4 bg:$text r:10"},`--crumb-placeholder-${p}`))}):jsxs(z,{onClick:()=>m.action?.(),className:"--crumb-item",disabled:!a[p+1],children:[m.icon&&jsx(X,{as:"--crumb-icon",name:m.icon}),jsx(H,{as:"--crumb-label",children:m.label})]},`${m.label.replace(/\s+/g,"-").toLowerCase()}-${p}`))})});yn.displayName="Zuz.Crumb";var Ul=yn;var wn=forwardRef((o,n)=>{let{icon:e,defaultValue:r,value:t,size:s,variant:u,numeric:m,type:p,onConfirm:a,...i}=o,[f,c]=useState(false),[g,w]=useState(r||null),{style:x,className:v,rest:R}=N(i),h=useRef(null),d=useRef(null),{reposition:S}=We(d,{direction:te.Bottom,offset:2}),I=C=>{m&&(C.currentTarget.value=C.currentTarget.value.replace(/[^0-9.]/g,"").replace(/(\..*?)\..*/g,"$1"));};useEffect(()=>{let C=E=>{let D=E.target,B=h.current?.contains(D),_=d.current?.contains(D);!B&&!_&&c(false);};return f&&document.addEventListener("mousedown",C),()=>{document.removeEventListener("mousedown",C);}},[f]),useEffect(()=>{let C=E=>{E.key==="Escape"&&f&&(c(false),h.current?.focus());};return document.addEventListener("keydown",C),()=>document.removeEventListener("keydown",C)},[f]);let P=()=>{c(true);};return useEffect(()=>{f&&S();},[f,S]),jsx(Fragment$1,{children:jsxs(l,{as:`--date-picker ${u?`--${u}`:""} rel flex aic ${v}`,"data-value":g?g.toISOString():"",children:[e?typeof e=="string"?jsx(X,{as:"mr:10 c:#666",name:e}):e:jsx(Q,{as:"--date-picker-icon flex aic jcc",children:k.calendar}),jsx("input",{ref:h,value:g?format(g,"EEE, MMM d YYY hh:mm a"):t||"",className:`--input ${u?`--${u}`:""} flex`.trim(),style:x,onFocus:P,onInput:I,autoComplete:"new-password",onKeyDown:C=>{C.key=="Enter"&&a?.(C.currentTarget.value);},...R}),jsx(l,{"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(to,{defaultValue:g,onChange:C=>{w(C),c(false);}})})]})})});wn.displayName="Zuz.DatePicker";var Xl=wn;var Sn=forwardRef((o,n)=>{let{icon:e,variant:r,position:t}=o;return jsx(z,{className:`--fab fixed --${r||W.Large} --${t||"bottomright"}`,children:e||k.plus})});Sn.displayName="Zuz.Fab";var jl=Sn;var Cn=o=>{let{names:n,strength:e}=o,r={[ft.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-${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(t=>r[t](e))})})};Cn.displayName="Zuz.Filters";var om=Cn;var Re=null,ae=null,Pn=forwardRef((o,n)=>{let{title:e,message:r,transition:t,curve:s,speed:u,type:m,actionPosition:p,spinner:a,loadingMessage:i,onShow:f,onHide:c,...g}=o,{className:w,style:x,rest:v}=N(g),[R,h]=useState(e||""),[d,S]=useState(r||""),[I,P]=useState(null),[C,E]=useState(m||le.Default),D=useMemo(()=>uuid(12),[]),[B,_]=useState(false),L=useRef(null),G=useRef(null),[U,V]=useState(false),[T,A]=useState(true),$=useRef(null),K=d;useImperativeHandle(n,()=>({setLoading(F){V(F);},showDialog(F,Y,oe,j){Re&&(clearTimeout(Re),ae&&clearTimeout(ae),L.current.classList.remove("--wobble"),setTimeout(()=>L.current.classList.add("--wobble"),50),ae=setTimeout(()=>{L.current.classList.remove("--wobble"),ae=null;},500)),E(le.Dialog),Y&&S(Y),F&&h(F),oe&&P(oe.reduce((pe,ge)=>(pe.push({...ge,key:ge.key||uuid(12)}),pe),[])),_(true),setTimeout(()=>j?j():()=>{},1e3);},dialog(F,Y,oe,j){Re&&(clearTimeout(Re),ae&&clearTimeout(ae),L.current.classList.remove("--wobble"),setTimeout(()=>L.current.classList.add("--wobble"),50),ae=setTimeout(()=>{L.current.classList.remove("--wobble"),ae=null;},500)),E(le.Dialog),S(Y),h(F),oe&&P(oe.reduce((pe,ge)=>(pe.push({...ge,key:ge.key||uuid(12)}),pe),[])),_(true),setTimeout(()=>j?j():()=>{},1e3);},error(F,Y){this.show(F,Y,le.Error);},warn(F,Y){this.show(F,Y,le.Warn);},success(F,Y){this.show(F,Y,le.Success);},show(F,Y,oe){Re&&(clearTimeout(Re),ae&&clearTimeout(ae),G.current=L.current.style.transform,L.current.style.transform="",L.current.classList.remove("--wobble"),setTimeout(()=>{L.current.classList.add("--wobble"),L.current.style.transform=`${G.current} scale(.9)`.trim();},50),ae=setTimeout(()=>{L.current.classList.remove("--wobble"),L.current.style.transform=G.current||"",ae=null;},500)),Re=setTimeout(()=>{_(false),Re=null,ae=null;},(Y||4)*1e3),E(oe||le.Default),S(F),_(true),f?.();},hide(){_(false),c?.();}}));let O=useMemo(()=>{let F={when:B,duration:u||.3,delay:.1};if(C==le.Dialog){if(t){let{from:Y,to:oe}=Ue(t,20);return {from:Y,to:oe,curve:s||Z.EaseInOut,...F}}return {from:{scale:0,x:"-50%",y:"-50%",opacity:0},to:{scale:1,x:"-50%",y:"-50%",opacity:1},curve:Z.Spring,...F}}else return {from:{scale:0,x:"-50%",y:"-10vh",opacity:0},to:{scale:1,x:"-50%",y:0,opacity:1},curve:Z.Spring,...F}},[B,C]);return useEffect(()=>{$.current&&clearTimeout($.current),B?A(true):$.current=setTimeout(()=>A(false),1e3);},[B]),C==le.Dialog?jsxs(Fragment$1,{children:[jsx(Ee,{when:B}),jsxs(l,{className:`--sheet --sheet-${C.toLowerCase()} ${B?"is-visible":""} ${w} fixed`.trim(),style:x,fx:O,...v,ref:L,children:[jsx(Be,{when:U,spinner:a,message:i}),jsxs(l,{className:"--head flex aic rel",children:[jsx(l,{className:`--${R?"title":"dot"} flex aic rel`,children:R||""}),jsx(z,{onClick:F=>_(false),className:"--closer abs",children:"\xD7"})]}),jsx(l,{className:`--body flex aic rel ${I?"":"--no-action"}`.trim(),children:T?K:null}),I&&jsx(l,{className:`--footer flex aic rel ${p?p==Mt.Center?"jcc":"":"jce"}`.trim(),children:I.map((F,Y)=>jsx(z,{onClick:oe=>F.handler?F.handler():F.onClick?F.onClick():console.log("onClick Handler missing"),className:"--action",children:F.label},`sheet-${D}-action-${F.key}`))})]})]}):jsx(l,{className:`--sheet --sheet-${C.toLowerCase()} ${w} abs`.trim(),style:x,...v,fx:O,ref:L,children:B?d:null})}),rt=o=>typeof o=="object"&&o!=null&&"setLoading"in o&&"success"in o&&"error"in o;Pn.displayName="Zuz.Sheet";var im=Pn;var Rn=forwardRef((o,n)=>{let{name:e,cover:r,spinner:t,errors:s,action:u,children:m,withData:p,beforeSubmit:a,onSubmit:i,onError:f,onSuccess:c,resetOnSuccess:g,...w}=o,{className:x,style:v,rest:R}=N(w),[h,d]=useState(false),S=useRef(null),I=useRef(null),P=useRef(null),C=Gt(),E=useCallback(T=>S.current?S.current.querySelectorAll(T):[],[S.current]),D=T=>({name:T.name||T.getAttribute("name")||T.getAttribute("data-name"),required:T.required?true:T.getAttribute("data-required")?T.getAttribute("data-required")=="true":false,with:T.with||T.getAttribute("with")}),B=T=>{let A=[];return T.querySelectorAll(".--input").forEach($=>{A.push($.value);}),A.join("")},_$1=useCallback(T=>{let{required:$}=D(T);if($){if(T.type=="checkbox"&&T.checked==false)return false;if(T.classList.contains("--otp")){let O=B(T);if(O==""||O.length<parseInt(T.getAttribute("data-size")))return false}if(T.classList.contains("--select")&&T.querySelector("button.--selected").dataset.value=="-1"||T.value=="")return false}if(T.getAttribute("with")){let O=T.getAttribute("with");switch(O.includes("@")&&(O=O.split("@")[0],O=="match"&&(O=we.MatchField)),O.toUpperCase()){case we.IPV4:return _(T.value).isIPv4();case we.IPV6:return _(T.value).isIPv6();case we.Email:return _(T.value).isEmail();case we.Uri:try{return new URL(T.value),!0}catch{return false}case we.Password:return console.log("Add FORMVALIDATION.Password"),false;case we.MatchField:let[F,Y,oe]=T.getAttribute("with").split("@"),j=document.querySelector(`[name=${Y.trim()}]`);if(!j)return false;switch(oe||"direct-match"){case "if-not-empty":if(j&&!_(j.value).isEmpty()&&j.value!=T.value)return false;break;case "direct-match":if(j&&j.classList.contains("--otp")&&T.classList.contains("--otp")&&B(j)!=B(T))return false;if(j&&j.value!=T.value)return false;break}break;default:return true}}return true},[S.current]),L=useCallback(()=>{let T={},A={},$=null,K=null;if(Array.from(E("[name]")).forEach(O=>{let{name:F,required:Y,with:oe}=D(O),j=true;(Y||oe)&&(j=_$1(O)),T[F]={valid:j,value:O.type=="checkbox"?O.checked==true?O.value:false:O.classList.contains("--otp")?B(O):O.classList.contains("--select")?O.querySelector("button.--selected").dataset.value:O.value},A[F]=O.type=="checkbox"?O.checked==true:O.classList.contains("--otp")?B(O):O.classList.contains("--select")?O.querySelector("button.--selected").dataset.value:O.value,j?O.classList.remove("input-with-error"):($==null&&s&&($=O,K=s[F]),O.classList.add("input-with-error"));}),$){let O=$;if(O.classList.contains("--otp"))for(let F of Array.from(O.querySelectorAll(".--input"))){let Y=F;if(Y.value==""){Y.focus();break}}else O.focus();}return {error:$!=null,errorMsg:K||"Fix errors to continue...",data:T,payload:A}},[S.current]),G=useCallback(()=>{let{error:T,errorMsg:A,payload:$}=L();T?C.error(A):u?startTransition(async()=>{a&&a($),rt(r)?r.setLoading(true):d(true),C.clearAll(),withPost(u,{...$,...p||{}}).then(K=>{let O=K;rt(r)?r.setLoading(false):d(false),g&&Array.from(E("[name]")).forEach(F=>{F instanceof HTMLInputElement&&(F.value="");}),c?c(O):(C.clearAll(),C.success(O.message||"Redirecting..."));}).catch(K=>{rt(r)?r.setLoading(false):d(false),f?f(K):C.error(K.message||"We cannot process your request at this time.");});}):i&&i($);},[u,I.current,S.current]),U=useCallback(()=>{let T=E("[type=submit]");!T||T.length==0?console.warn("You should add at least 1 button with type=`SUBMIT`"):T.forEach(A=>{A.addEventListener("click",G);});},[S.current]),V=useMemo(()=>addPropsToChildren(m,T=>T.props.type=="submit",T=>({ref:P})),[m]);return useImperativeHandle(n,()=>({setLoading(T){if(T){I.current.hide();try{C.clearAll();}catch{}}d(T);},showError(T){typeof T=="string"?C.error(T):I.current.error(T,4);},hideError(){I.current.hide();try{C.clearAll();}catch{}},init(){U();},submit(){G();}})),useEffect(U,[]),jsxs(l,{ref:S,style:v,className:`--form flex rel ${x} ${e?`--form-${e.replace(/\s+/g,"-")}`:""}`,propsToRemove:["withData","action","onSubmit","onSuccess","onError"],children:[!rt(r)&&jsx(Be,{message:r?r.message||void 0:"working",spinner:t,color:r&&"color"in r?r.color:"#ffffff",when:h}),V]})});Rn.displayName="Zuz.Form";var xm=Rn;var Nn=forwardRef((o,n)=>{let {children:e,fx:r,fxDelay:t,fxStep:s,classToIgnore:u,...m}=o,p=ee(true),a=useDelayed(),i=r||p?.group?.fx,f=t||p?.group?.fxDelay,c=s||p?.group?.fxStep;u||p?.group?.classToIgnore;let w=useMemo(()=>i?addPropsToChildren(e,x=>{if(x.type===Fragment)return false;let v=x.props||{},R="fx"in v,h=v.as?Array.isArray(v.as)?v.as.join(" "):v.as:v.className||"",d=typeof h=="string"&&h.includes(u||"--ignore");return !R&&!d},x=>({fx:{...i,delay:(f||0)+x*(c||.1),when:a}})):e,[e,a,i]);return jsx(l,{className:"--group",ref:n,...m,children:w})});Nn.displayName="Zuz.Group";var Pm=Nn;var In=o=>typeof o=="string"&&o.includes("+"),En={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"},Bn={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 Mn=forwardRef(({children:o,keys:n,variant:e},r)=>{let t=useMemo(()=>{if(In(n)){let s=null;return {keys:String(n).split("+").reduce((m,p,a,i)=>(i[a+1]?m.push(p):s=p.toUpperCase(),m),[]),children:s}}return {keys:n,children:String(o).toUpperCase()}},[n]);return jsxs(l,{as:`--keyboard-keys --${e||W.Small} flex aic`,children:[(Array.isArray(t.keys)?t.keys:[t.keys]).map(s=>jsx("abbr",{title:Bn[s],children:En[s]},s)),jsx(Q,{children:t?.children??o})]})});Mn.displayName="Zuz.KeyboardKeys";var ho=Mn;var kn=forwardRef((o,n)=>{let e=useNetworkStatus(),{onlineMessage:r,offlineMessage:t,variant:s}=o;return jsxs(l,{fx:{from:{x:"-50%",y:200,opacity:0},to:{x:"-50%",y:0,opacity:1},when:e==false,curve:Z.Spring,duration:.5,delay:2},className:`--network-manager --${e==true?"online":"offline"} --${s||W.Small} fixed flex`,children:[jsx(l,{className:"--ico",children:e?k[ie.Success]:k[ie.Error]}),jsx(H,{as:"--message",children:e?r||"internet connection restored :)":t||"no internet connection"})]})});kn.displayName="Zuz.NetWorkManager";var Mm=kn;var xo=(e=>(e.Table="table",e.Gooey="gooey",e))(xo||{});var An=forwardRef((o,n)=>{let{itemCount:e,itemsPerPage:r,startPage:t,pageRange:s,paginationStyle:u,breakLabel:m,prevLabel:p,nextLabel:a,hash:i,loading:f,seperator:c,renderOnZeroPageCount:g,onPageChange:w,...x}=o,v=useMemo(()=>toHash(numberInRange(4,8)),[]),R=useCallback(L=>`${toHash(L,i||6,v)}${c||""}${v}`,[v]),h=useMemo(()=>m||"...",[m]),[d,S]=useState({id:i?t?typeof t=="number"?R(t):t:1:t||1,label:t||1}),{style:I,className:P,rest:C}=N(x),E=useCallback(L=>typeof L=="number"?L:+L.label,[]);if(!e)throw new Error('"itemCount" prop is required');let D=useMemo(()=>Math.ceil(e/r),[e,r]),B=useMemo(()=>{let L=[],G=Math.max(E(d)-(s||2),1),U=Math.min(E(d)+(s||2),D);G>1&&L.push({id:i?R(1):1,label:1}),G>2&&L.push({id:-1,label:h});for(let V=G;V<=U;V++)L.push({id:i?R(V):V,label:V});return U<D-1&&L.push({id:-1,label:h}),U<D&&L.push({id:i?R(D):D,label:D}),L},[d]),_=useCallback(L=>{let G=L;+G.label<1||+G.label>D||(S(G),w?.(G));},[e,r,d]);return B.length<=1&&(g??false)===false?null:jsxs(l,{ref:n,as:`--pagination --pgt-${u||"table"} flex aic w:100% jcc ${P}`,children:[jsx(l,{as:"flex flex:1 aic --pgt-btns",children:(B.length>1?B:[{id:1,label:1},{id:-1,label:h}]).map((L,G,U)=>jsx(z,{disabled:L.id==-1||E(d)==+L.label,className:(typeof L=="string"?L:L.label)==E(d)?"--current-page":"",onClick:V=>_(L),children:typeof L=="string"?L:L.label},`--pg-${G}-${L.id}`))}),jsx(l,{as:"flex aic jcc flex:1 --pagination-label",children:[`Showing ${(E(d)-1)*r+1} - `,`${Math.min(E(d)*r,e)} of ${e} items`].join(" ")}),jsxs(l,{as:"flex aic jce flex:1 --pgt-btns --pgt-nav",children:[jsx(z,{disabled:E(d)<=1,onClick:L=>_({id:i?R(E(d)-1):E(d)-1,label:E(d)-1}),children:k.chevronLeftOutline}),jsx(z,{disabled:B.length<=1||E(d)==E(B[B.length-1]),onClick:L=>_({id:i?R(E(d)+1):E(d)+1,label:E(d)+1}),children:k.chevronRightOutline})]})]})});An.displayName="Zuz.Pagination";var bo=An;var $n=forwardRef((o,n)=>{let{strenthMeter:e,onChange:r,...t}=o;"type"in t&&delete t.type;let{style:s,className:u,rest:m}=N(t),[p,a]=useState(false),[i,f]=useState(""),c=useMemo(()=>checkPasswordStrength(i),[i]),g=useDebounce(w=>{e&&f(w.target.value),r&&r(w);},100);return useEffect(()=>{},[]),jsxs(l,{as:"w:100% flex cols",children:[jsxs(l,{style:s,className:"--password flex aic rel",children:[jsx(re,{ref:n,type:p?"text":"password",className:u,onChange:g,...m}),jsx(z,{tabIndex:-1,onClick:()=>a(w=>!w),className:"--toggle flex aic jcc abs",children:p?k.eye:k.eyeSlash})]}),e&&jsxs(l,{as:`flex aic --password-meter --pb-score-${c.score}`,style:s,children:[jsxs(l,{as:"--password-bars flex aic",children:[jsx(l,{as:`--pbar ${c.score>=1?"--pb-on":""}`.trim()}),jsx(l,{as:`--pbar ${c.score>=2?"--pb-on":""}`.trim()}),jsx(l,{as:`--pbar ${c.score>=3?"--pb-on":""}`.trim()}),jsx(l,{as:`--pbar ${c.score>=4?"--pb-on":""}`.trim()}),jsx(l,{as:`--pbar ${c.score>=5?"--pb-on":""}`.trim()})]}),jsx(H,{as:"--password-meter-label","aria-hidden":true,children:c.result})]})]})});$n.displayName="Zuz.Password";var Fm=$n;var _n=forwardRef((o,n)=>{let{size:e,length:r,mask:t,...s}=o,u=useRef([]),m="pinput",p=false,a={};"with"in s&&(a={with:s.with},delete s.with),"type"in s&&delete s.type,"name"in s&&(m=s.name,delete s.name),"required"in s&&(p=true,delete s.required);let{style:i}=N(s),f=c=>{let g=c.currentTarget,w=u.current[parseInt(g.dataset.index)+1],x=u.current[parseInt(g.dataset.index)-1];g.value.length===1&&w?w.focus():g.value.length===0&&x&&x.focus();};return useEffect(()=>{u.current=u.current.slice(0,e||r);},[e||r]),jsx(l,{name:m,style:i,className:"--otp flex aic rel","data-required":p,"data-size":e||r||4,...a,children:Array(e||r||4).fill(1).map((c,g)=>jsx(re,{autoComplete:"new-password","data-index":g,ref:w=>{u.current[g]=w;},numeric:true,onChange:f,maxLength:1,placeholder:t?"\xB7":"0",type:t?"password":"text",...s},`pin-${g}`))})});_n.displayName="Zuz.PinInput";var Wm=_n;var Fn=forwardRef((o,n)=>{let{children:e,className:r,name:t,required:s,type:u,value:m,variant:p,checked:a,onSwitch:i,...f}=o,[c,g]=useState(a||false),{variant:w}=ee(true),x=useRef(null);return jsxs(je,{className:`${r} --${(u||Ot.Default).toLowerCase()} --radio${!u||u==Ot.Default?"":"card"} --${p||w||W.Small} flex aic rel`.trim(),...f,children:[jsx(re,{ref:x,defaultChecked:c,value:m||"rd",type:"radio",className:"abs",name:t,required:s||false,onChange:v=>{i&&i(v.target.checked,m||"cb"),g(v.target.checked);}}),jsx(l,{className:"--dot rel",children:jsx(l,{className:"--rod abs abc"})}),jsx(l,{className:"--value",children:e})]})});Fn.displayName="Zuz.Radio";var Ym=Fn;var Zn=forwardRef((o,n)=>{let{speed:e,style:r,...t}=o,{rootRef:s,containerRef:u,thumbY:m,thumbX:p,onScrollY:a,onScrollX:i}=useScrollbar(e||1),{style:f,className:c,rest:g}=N(t);return jsxs(l,{ref:s,className:c.trim(),as:"--scrollview rel",children:[jsx(l,{as:`--scroll-content ${c}`.trim(),ref:u,style:r||{},children:g.children}),jsx(l,{as:"--scroll-track --track-y --abs",children:jsx(l,{as:"--scroll-thumb --abs",ref:m,onMouseDown:a})}),jsx(l,{as:"--scroll-track --track-x --abs",children:jsx(l,{as:"--scroll-thumb --abs",ref:p,onMouseDown:i})})]})});Zn.displayName="Zuz.ScrollView";var ec=Zn;var Kn=forwardRef((o,n)=>{let{fx:e,withStyle:r,as:t,reverse:s=false,searchIcon:u=k.search,hideSearchIcon:m=false,clearIcon:p=k.close,hideClearIcon:a=false,onChange:i,onClear:f,...c}=o,{style:g,className:w}=N({as:o.as}),[x,v]=useState(""),R=useRef(null),h=useMemo(()=>jsx(z,{tabIndex:-1,onClick:I=>S(),className:"--send flex aic jcc",variant:o.variant||W.Small,children:x!==""?!a&&(typeof p=="string"?jsx(X,{name:p,as:"--search-action"}):p):!m&&(typeof u=="string"?jsx(X,{name:u,as:"--search-action"}):u)}),[s,u,a,p,m]);"type"in o&&delete o.type;let d=I=>{v(I.target.value),i?.(I.target.value);},S=I=>{x.trim()!==""&&(v(""),i?.(""),R.current&&(R.current.value="",o.onConfirm?.("")));};return useImperativeHandle(n,()=>({focus:()=>R.current?.focus(),value:()=>R.current?.value})),useEffect(()=>{},[]),jsxs(l,{style:g,className:`--search ${s?"--search-rev":""} --${o.variant||W.Small} flex aic ${typeof o.as=="string"&&o.as.includes("abs")?"":"rel"} ${w}`.trim(),children:[s&&h,jsx(re,{ref:R,onChange:d,className:`--${o.variant||W.Small}`,...c}),o.shortcut&&jsx(ho,{keys:o.shortcut,as:"abs"}),!s&&h]})});Kn.displayName="Zuz.Search";var lc=Kn;var Wn=({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(X,{name:e.icon,as:`--select-option-icon --icon-${e.value}`,color:e.iconColor||void 0}),jsx(H,{children:typeof e=="string"?e:e.label})]});Wn.displayName="Option";var Gn=Wn;var Xn=forwardRef((o,n)=>{let {selected:e,options:r,label:t,name:s,variant:u,search:m,searchPlaceholder:p,maxHeight:a,arrowDownIcon:i=k.arrowDown,arrowUpIcon:f=k.arrowUp,onChange:c,...g}=o,[w,x]=useState(e?typeof e=="string"?r.find(V=>V.value===e):e:r[0]),[v,R]=useState(false),[h,d]=useState(null);useRef(null);let I=useRef(null),P=useRef(null),C=useId(),E=useMemo(()=>s||C,[]),{reposition:D}=We(P,{direction:Lt.Bottom,offset:2}),{variant:B}=ee(true),{className:_,style:L,rest:G}=N(g),U=V=>{x(V),c&&c(V);};return useImperativeHandle(n,()=>({setSelected:V=>{if(typeof V=="string"){let T=r.find(A=>A.value===V);T&&x(T);}else x(V);},getValue:()=>w||null})),useEffect(()=>{document.body.addEventListener("click",V=>{R(false);}),window.dispatchEvent(new Event("resize"));},[]),useEffect(()=>{v?I.current&&I.current.focus():(I.current&&(I.current.value=""),d(null)),D();},[v]),jsxs(l,{className:`--select --${u||B} ${s?`--${s}`:""} rel`.trim(),name:E,children:[jsxs(z,{"data-value":w?typeof w=="string"?w:w.value:w||"-1",className:`--selected flex aic rel ${_}`.trim(),withLabel:false,style:L,onClick:V=>R(T=>!T),...G,children:[jsx(H,{className:"--label",children:w?typeof w=="string"?w:w.label:t||"Choose"}),jsx(l,{className:"--svg-arrow rel flex aic jcc",children:v?typeof f=="string"?jsx(X,{name:f,as:"--search-action"}):f:typeof i=="string"?jsx(X,{name:i,as:"--search-action"}):i})]}),jsxs(l,{id:E,className:"--options-list flex cols abs","aria-hidden":!v,style:{maxHeight:a||"auto"},ref:P,fx:{from:{y:5,opacity:0},to:{y:0,opacity:1},when:v,duration:.05},children:[m&&jsx(re,{ref:I,onChange:V=>{d(V.target.value==""?null:V.target.value);},className:"--select-search",placeholder:p||"Search..."}),(h==null?r:r.filter(V=>V.label.toLowerCase().includes(h.toLowerCase())||V.value.toLowerCase().includes(h.toLowerCase()))).map(V=>jsx(Gn,{updateValue:U,value:w,o:V},`option-${(typeof V=="string"?V:V.label).replace(/\s+/g,"-")}-${typeof V=="string"?V:V.value}`))]})]})});Xn.displayName="Zuz.Select";var gc=Xn;var Yn=forwardRef((o,n)=>jsx(et,{type:ve.Switch,...o,ref:n}));Yn.displayName="Zuz.Switch";var xc=Yn;var Jn=o=>{let{idx:n,id:e,as:r,weight:t,style:s,value:u,render:m,resize:p,sortBy:a,sortable:i,onSort:f}=o,[c,g]=useState(0),w=()=>{i&&(f?.(String(e),c==1?-1:1),g(x=>x==1?-1:1));};return jsxs(l,{style:{flex:t||1,...s},as:`--col flex aic ${r||""} ${i?"--sortable":""}`,onClick:w,children:[jsx(l,{children:u}),n==-1&&i&&a==e&&jsx(l,{as:"--arrow flex aib",children:c==1?k.arrowUp:k.arrowDown})]})};Jn.displayName="Zuz.Column";var Pt=Jn;var es=o=>{let{index:n,pubsub:e,schema:r,data:t,ids:s,styles:u,animate:m,sortBy:p,selectable:a,tableRef:i,loading:f,rowClassName:c,onSort:g,onRowClick:w,onSelect:x,onContextMenu:v}=o,R=useDelayed(),h=useMemo(()=>({transition:q.SlideInBottom,curve:Z.EaseInOut,delay:.02*(n+1)}),[]),d=useRef(null),S=(P,C)=>{n==-1?e.emit(`ALL_ROWS_${P?"CHECKED":"UNCHECKED"}`,P):(x&&x(t,P),e.emit(`ROW_${P?"CHECKED":"UNCHECKED"}`,P,C));},I=(P,C,E)=>jsx(Pt,{idx:P,id:C,as:"--selector",pubsub:e,value:jsx(et,{value:E,ref:d,onSwitch:S,type:ve.Default})});return useEffect(()=>{let P=(B,_)=>{d.current?.setChecked(B,false);},C=(B,_)=>{let L=false;i?.current&&i.current.querySelectorAll(".--row").forEach(G=>{let U=G;if(!U.classList.contains("--row-head")){let V=U.querySelector(".--selector input[type=checkbox]");V&&V.checked&&!L&&(L=V.checked);}}),d.current.setChecked(L,false);},E=B=>{d.current?.setChecked(B,false),x&&x(t,B);},D=B=>{d.current?.setChecked(B,false),x&&x(t,B);};return n==-1?(e.on("ROW_CHECKED",P),e.on("ROW_UNCHECKED",C),()=>{e.off("ROW_CHECKED",P),e.off("ROW_UNCHECKED",C);}):(e.on("ALL_ROWS_CHECKED",E),e.on("ALL_ROWS_UNCHECKED",D),()=>{e.off("ALL_ROWS_CHECKED",E),e.off("ALL_ROWS_UNCHECKED",D);})},[]),jsxs(l,{onContextMenu:P=>v?v(P,t):null,onClick:P=>w?w(P,o.data):()=>{},...m?{fx:{...h,when:R}}:{},as:`--row flex aic ${w?"--row-clickable":""} ${n==-1?"--row-head":""} ${c||""}`,children:[n==-1&&r.map((P,C)=>{let{renderWhenHeader:E,render:D,value:B,..._}=P;return jsxs(Fragment,{children:[a&&C==0&&I(-1,`--selector-${P.id}`,"all"),jsx(Pt,{idx:-1,onSort:g,sortBy:p,value:B,..._,pubsub:e,style:u[P.id]})]},`--col-${P.id}`)}),f&&n>-1&&jsx(l,{as:"--col",children:jsx(H,{as:"opacity:0",children:"..."})}),!f&&n>-1&&s&&t&&r.map((P,C)=>jsxs(Fragment,{children:[a&&C==0&&I(C,`--selector-${P.id}`,P.id.toString()),s.includes(String(P.id))?jsx(Pt,{pubsub:e,idx:C,id:String(P.id),style:u[String(P.id)],value:P.render?P.render(t,n):t[String(P.id).includes(".")?String(P.id).split(".").reverse()[0]:P.id]}):null]},`--${String(P.id)}-val-${C}`))]})};es.displayName="Zuz.Row";var Rt=es;var ns=(o,n)=>{let{schema:e,rows:r,rowCount:t,rowsPerPage:s,currentPage:u,pagination:m,paginationHash:p,showPaginationOnZeroPageCount:a,animateRows:i,header:f,rowClassName:c,selectableRows:g,hoverable:w,sortBy:x,loading:v,loadingRowCount:R,loadingMessage:h,spinner:d,emptyMessage:S,onSort:I,onRowClick:P,onRowSelectToggle:C,onPageChange:E,onRowContextMenu:D,...B}=o,_=useRef(null),L=useMemo(()=>e.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),{}),[e]),G=useMemo(()=>Object.keys(L),[e]),U=useMemo(()=>f??true,[f]),{style:V,className:T,rest:A}=N(B),$=useRef(null),K=useMemo(()=>new PubSub,[]),O=useRef(r.map(()=>uuid(8))),[F,Y]=useState(x||null),[oe,j]=useState(h||"loading"),pe=useMemo(()=>!v&&r&&r.length==0,[v,r]),ge=useCallback(()=>S?typeof S=="function"?jsx(S,{}):S:jsx(H,{as:"tac s:18 mt:75",children:"No Record Found"}),[v,r]);useEffect(()=>{O.current=r.map(()=>uuid(8));},[r]);let lt=(ue,J)=>{Y(ue),I?.(ue,J);},mt=(t||(r?r.length:0))/(s||10),ct=useMemo(()=>a||mt>1?jsx(bo,{hash:p,ref:_,renderOnZeroPageCount:a,onPageChange:E,paginationStyle:"table",startPage:u,itemCount:t||(r?r.length:0),itemsPerPage:s||10}):null,[u,t]);return useImperativeHandle(n,()=>({setLoading(ue){}})),jsxs(l,{as:`--table ${w??true?"--hoverable":""} flex cols rel ${T}`,ref:$,children:[U==true&&jsx(Rt,{sortBy:F,onSort:lt,tableRef:$,pubsub:K,selectable:g,index:-1,schema:e,loading:true,styles:L}),v&&jsxs(l,{as:"center-x flex aic --table-spinner",children:[jsx(he,{type:d||me.Simple}),oe&&jsx(H,{as:"--table-loading-message",children:oe})]}),v&&Array(R||5).fill({}).map((ue,J)=>jsx(Rt,{tableRef:$,index:J,pubsub:K,schema:e,styles:L,loading:true,animate:i,onRowClick:P},`--trow-loading-${J}-${e[0].id}`)),!v&&r&&r.map((ue,J)=>jsx(Rt,{tableRef:$,pubsub:K,loading:false,index:J,schema:e,ids:G,styles:L,animate:i,data:ue,onRowClick:P,rowClassName:c,selectable:g,onSelect:C,onContextMenu:D},`--trow-${O.current[J]||J}-${e[0].id}`)),pe&&ge(),jsx(l,{"aria-hidden":!m||!ct,...i?{fx:{transition:q.SlideInBottom,curve:Z.EaseInOut,delay:.02*(r.length+1),when:!v&&r&&m&&ct!=null}}:{},as:"--row flex aic --row-footer",children:m&&ct?ct:null})]})};ns.displayName="Zuz.Table";var Bc=forwardRef(ns),Lc=Bc;var Oc=({ref:o,...n})=>{let{title:e,items:r}=n,[t,s]=useState(0),u=(m,p,a)=>{m.preventDefault(),s(p),document.getElementById(a)?.scrollIntoView({behavior:"smooth"});};return jsxs(l,{ref:o,as:"--table-of-contents rel flex cols",children:[jsx(H,{as:"--toc-title",children:e}),jsx(Me,{items:r.map((m,p)=>jsx("a",{className:t==p?"--toc-active":"",style:{anchorName:t===p?"--toc-active":"none",color:t==p?"var(--table-of-contents-color-active)":"var(--table-of-contents-color)"},onClick:a=>u(a,p,m.tag),href:`#${m.tag}`,children:m.label}))})]})},kc=Oc;var ss=({isActive:o,transitionType:n,speed:e,width:r,render:t,content:s,onHeightChange:u})=>{let m=useRef(null),p=useResizeObserver(m);useEffect(()=>{o&&p.height>0&&u(p.height);},[o,p.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 ${e}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 ${e}s cubic-bezier(0.34, 1.56, 0.64, 1)`,zIndex:o?1:0}:i},[o,n,r,e]);return jsx(l,{ref:m,style:{...a},className:"--content",children:t||o?s:null})};ss.displayName="Zuz.TabBody";var as=ss;var ms=({ref:o,...n})=>{let{tabs:e,speed:r=.3,prerender:t=true,variant:s,tabStyle:u="fixed",onChange:m,transitionType:p="slide",...a}=n,[i,f]=useState(0),c=useRef(null),g=useResizeObserver(c),w=useMemo(()=>uuid(8),[]),[x,v]=useState("auto"),R=useMemo(()=>g.width>0,[g.width]);useImperativeHandle(o,()=>({setTab:C=>f(C)}));let h=useMemo(()=>e.map(C=>({...C,key:C.key||uuid(8)})),[e]),{style:d,className:S,rest:I}=N({as:`flex cols w-full no-overflow ${a.as||""}`,...a}),P=()=>{if(!R)return {opacity:0};switch(p){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(l,{ref:c,style:d,className:`--tabview --${u} flex cols ${S}`,children:[jsx(tt,{as:"--tabview-head",onSwitch:C=>{f(C.index);let E=h.find(D=>D.tag==C.tag);E&&E.onSelect&&(E.onSelect(E,C.index),m?.(E,C.index));},selected:i,items:h.reduce((C,E,D)=>(C.push({icon:E.icon,index:D,label:E.label,tag:E.tag}),C),[])}),jsx(l,{className:"--tabview-body",as:"rel no-overflow w-full",style:{height:x,transition:R?`height ${r}s cubic-bezier(0.4, 0, 0.2, 1)`:"none",opacity:R?1:0},children:jsx(l,{className:"--track",style:{...P()},children:h.map((C,E)=>jsx(as,{isActive:E===i,transitionType:p,speed:r,width:g.width,render:t||E===i,onHeightChange:D=>E===i&&v(D),content:C.body},`tab-body-${C.key||E}-${w}`))})})]})};ms.displayName="Zuz.TabView";var Kc=ms;var qc=({ref:o,commands:n,onCommand:e,welcomeMessage:r="Welcome to Zuz Terminal v1.0.0",prompt:t="zuz ~ ",variant:s,...u})=>{let[m,p]=useState([{type:"output",content:r}]),[a,i]=useState(""),f=useRef(null),c=useRef(null),{variant:g}=ee(true);useEffect(()=>{f.current&&(f.current.scrollTop=f.current.scrollHeight);},[m]);let w=S=>{let I=typeof S=="string"?{type:"output",content:S}:S;p(P=>{let C=[...P,I];return C.length>1e3?C.slice(-1e3):C});},x=()=>p([]);useImperativeHandle(o,()=>({write:w,clear:x}));let v=async S=>{let[I,...P]=S.split(" "),C=I.toLowerCase();return n&&n[C]?await n[C](P):e?await e(S):`command not found: ${I}`},R=S=>{let I=/\u001b\[(\d+)m/g,P=[],C={31:"#ff5f56",32:"#27c93f",33:"#ffbd2e",34:"#007aff",35:"#ff79c6",36:"#8be9fd",39:"#d4d4d4"},E=0,D="#d4d4d4",B=false,_;for(;(_=I.exec(S))!==null;){let G=S.slice(E,_.index);G&&P.push({text:G,color:D,bold:B});let U=_[1];U==="0"?(D="#d4d4d4",B=false):U==="1"?B=true:C[U]&&(D=C[U]),E=I.lastIndex;}let L=S.slice(E);return L&&P.push({text:L,color:D,bold:B}),P},h=(S,I)=>S.includes("\x1B")?R(S).map((P,C)=>jsx(Q,{style:{color:P.color||"#d4d4d4",fontWeight:P.bold?"bold":"normal"},children:P.text},`--terminal-msg-${C}-${P.text.replace(/\S+/g,"-")}`)):jsx(Q,{style:{color:I==="error"?"#ff5f56":I==="command"?"#00ff00":"#d4d4d4"},children:S}),d=async S=>{if(S.key==="Enter"&&a.trim()){let I=a.trim(),P=[...m,{type:"command",content:`${t}${I}`}];i(""),p(P);let C=await v(I);p(E=>[...E,{type:"output",content:C}]);}};return jsxs(l,{as:`--zuz-terminal --${s||g||W.Medium} flex cols ${u.className}`,onClick:()=>c.current?.focus(),children:[jsx(l,{ref:f,className:"--terminal-log",children:m.map((S,I)=>jsx(l,{children:jsx(H,{children:h(S.content,S.type)})},I))}),jsxs(l,{as:"flex aic --terminal-input",children:[jsx(H,{as:"--terminal-prompt",children:t}),jsx(re,{ref:c,className:"--zuz-term-input",autoFocus:true,value:a,variant:s||g||W.Medium,onChange:S=>i(S.target.value),onKeyDown:d})]})]})},Xc=qc;var Yc=({meta:o})=>jsxs(z,{as:"flex aic --command-item",children:[o.icon&&jsx(X,{name:o.icon,as:"--command-icon"}),jsx(H,{children:o.label})]}),Qc=({position:o,onSelect:n,commands:e,visible:r})=>jsx(l,{"aria-hidden":!r,fx:{transition:q.SlideInBottom,duration:.1,when:r},className:"--command-box abs grid",style:{...o},children:e.map(t=>jsx(Yc,{meta:t},`cmd-${t.label.replace(/\s+/,"-")}`))}),fs=Qc;var hs=forwardRef((o,n)=>{let{autoResize:e,maxHeight:r,variant:t=W.Small,resize:s="none",command:u,commands:m,onInput:p,cmd:a,renderDropdown:i,value:f,defaultValue:c,...g}=o,w=useRef(null),x=useRef(null),{style:v,className:R,rest:h}=N(g),{showDropdown:d,dropdownPosition:S,handleKeyDown:I,handleInput:P,handleCommandSelect:C}=useCommandActions({command:u,commands:m,cmd:a,ref:w}),E=useCallback(()=>{let B=w.current;!B||!e||(x.current&&cancelAnimationFrame(x.current),x.current=requestAnimationFrame(()=>{B.style.height="auto";let _=B.scrollHeight;if(r){let L=parseInt(r.toString(),10);isNaN(L)||(_=Math.min(_,L));}B.style.height=`${_}px`,B.style.overflowY=r&&_>=parseInt(r.toString(),10)?"auto":"hidden";}));},[e,r]),D=B=>{p?.(B),P(B),E();};return useEffect(()=>{E();},[f,c,E]),useEffect(()=>{e&&w.current&&E();},[e,E]),useEffect(()=>()=>{x.current&&cancelAnimationFrame(x.current);},[]),jsxs(l,{as:"rel",children:[jsx("textarea",{className:`--input --textarea --${t} flex ${R}`.trim(),style:{...v,resize:s,height:e?"auto":v?.height,overflow:"hidden",transition:e?"none":void 0},onKeyDown:I,onInput:D,ref:B=>{typeof n=="function"?n(B):n&&(n.current=B),w.current=B;},value:f,defaultValue:c,...h}),i?i({show:d,position:S,commands:m||[],onSelect:C}):m&&m.length>0&&jsx(fs,{visible:d,commands:m,onSelect:C,position:S})]})});hs.displayName="Zuz.TextArea";var op=hs;var ys=forwardRef((o,n)=>{let{as:e,value:r,color:t,direction:s,...u}=o,m=useRef(null),[p,a]=useState(r||0);return useImperativeHandle(n,()=>({updateValue(i){p.toString().length!==i.toString().length&&a(i);},setValue(i){if(this.updateValue(i),m.current){let f=i.toString().split("");m.current.querySelectorAll(".--wheel-char").forEach((c,g)=>{let w=f[g];if(c instanceof HTMLElement){c.setAttribute("data-value",w);let x=c.querySelector(".--wheel-char-track");x instanceof HTMLElement&&(x.style.setProperty("--v",w),x.offsetWidth);}});}}})),useEffect(()=>{a(r||0);},[r]),jsxs(l,{className:"--text-wheel flex aic rel","aria-hidden":true,as:e,ref:m,...u,children:[(p||0).toString().split("").map((i,f)=>isNaN(parseInt(i,10))?jsx(Q,{className:"--wheel-char wheel-char-symbol grid",children:i},`wheel-char-symbol-${f}`):jsx(Q,{"data-value":i,className:`--wheel-char grid ${f>(p||0).toString().length-3?"--wheel-fraction":""}`.trim(),children:jsxs(Q,{className:`--wheel-char-track --wheel-track-${s||"down"} grid`,style:{"--v":i},children:[jsx(Q,{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(Q,{children:c},`${f}--${g}`)),jsx(Q,{children:!s||s==="down"?9:0})]})},`wheel-char-${f}`)),t&&jsx(l,{className:"abs fillx",style:{zIndex:1,background:`linear-gradient(0deg, ${t}, transparent, transparent, transparent, ${t})`}})]})});ys.displayName="Zuz.TextWheel";var mp=ys;var Ss=forwardRef((o,n)=>{let{title:e,position:r,margin:t,children:s,...u}=o,{style:m,className:p,rest:a}=N(u),[i,f]=useState(false),c=useMemo(()=>r||te.Top,[]),g=useRef(null),w=useRef(null),x=d=>{},v=typeof ResizeObserver<"u"?new ResizeObserver(x):{observe:()=>{},unobserve:()=>{}},R=useDimensions(),h=useMemo(()=>{if(!w.current)return {left:0,top:0};let d=w.current.previousElementSibling;if(d){let S=d.getBoundingClientRect();switch(v.observe(d),c){case te.Top:return {left:S.left+S.width/2,top:S.top-(t||25)};case te.Bottom:return {left:S.left+S.width/2,top:S.top+(t||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}}}},[w.current,R,v]);return useEffect(()=>{},[]),jsxs(l,{ref:g,className:"--with-tooltip rel",onMouseEnter:d=>f(true),onMouseLeave:d=>f(false),children:[s,jsx(l,{ref:w,style:{left:h?.left+"px",top:h?.top+"px"},className:`--tooltip --${r||te.Top} fixed ${p}`.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:Z.EaseInOut,when:i},children:jsx(H,{className:"--text rel",children:e})})]})});Ss.displayName="Zuz.ToolTip";var dp=Ss;var Eo=forwardRef((o,n)=>{let{as:e,meta:r,nodes:t,icons:s,onSelect:u,treeTag:m,selected:p,roots:a,expanded:i,...f}=o,{tag:c,label:g,icon:w,under:x,isHead:v}=r,R=useMemo(()=>a.includes(c),[a]),[h,d]=useState(i),S=()=>{localStorage.setItem(`--tn${m}-${c}`,h?"0":"1"),d(!h);};useEffect(()=>{i||R&&!localStorage.getItem(`--tn${m}-${c}`)?(localStorage.setItem(`--tn${m}-${c}`,"1"),d(true)):d(localStorage.getItem(`--tn${m}-${c}`)=="1");},[]);let I=useMemo(()=>t.filter(P=>P.under==c),[t,c]);return jsxs(l,{className:`--treenode ${R?"--is-root":""} --treenode-${c} flex cols`,children:[jsxs(l,{className:`--node --node-${c} flex aic ${p==c?" --selected":""}`,children:[jsx(z,{skeleton:f.skeleton,onClick:S,className:"--node-aro-btn",disabled:I.length==0,children:s?.arrowClose&&s?.arrowOpen?jsx(X,{skeleton:f.skeleton,className:"--node-aro-icon",name:I.length==0?s?.arrowDisabled||s?.arrowClose:h?s?.arrowOpen:s?.arrowClose}):I.length==0?k.chevronBottom:h?k.chevronBottom:k.chevronRight}),jsxs(z,{className:"--node-meta flex aic",onClick:P=>u(c),children:[(s?.nodeOpen&&s?.nodeClose||R&&s?.rootOpen&&s?.rootClose)&&jsx(X,{skeleton:f.skeleton,className:`--node-icon ${R?"--icon-root":""}`,name:w||(h?R&&s?.rootOpen||s.nodeOpen:R&&s?.rootClose||s?.nodeClose)}),jsx(H,{className:`--node-label ${R?"--node-label-root":""}`.trim(),skeleton:f.skeleton,children:g})]})]}),h&&I.length>0&&jsx(l,{className:`--sub-node tree-sub-node-${c} flex cols`,children:I.map(P=>jsx(Eo,{treeTag:m,selected:p,onSelect:u,icons:s,roots:a,expanded:P.expanded||false,meta:P,nodes:t},`--node-${P.tag}`))})]})});Eo.displayName="TreeItem";var Ts=Eo;var Rs=forwardRef((o,n)=>{let{as:e,nodes:r,onNodeSelect:t,tag:s,icons:u,roots:m,selected:p,...a}=o,[i,f]=useState(p);useImperativeHandle(n,()=>({getSelected:()=>i}),[t]);let c=g=>{f(g),t&&t(g);};return useEffect(()=>{i!=p&&f(p);},[p]),jsx(l,{className:"--treeview flex cols",children:r.filter(g=>m.includes(g.tag)).map(g=>jsx(Ts,{treeTag:s?`-${s}`:"",selected:i,onSelect:w=>c(w),icons:u,meta:g,roots:m,expanded:g.expanded||false,skeleton:a.skeleton,nodes:r},`--node-${g.tag}`))})});Rs.displayName="Zuz.TreeView";var Cp=Rs;String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"").replace(/\s+/g," ")};
|
|
13
|
-
export{ie as ALERT,Bt as AVATAR,
|
|
12
|
+
</div>`}).join("")},[e,g]);return jsx(l,{as:`--code-block ${i}`,style:f,...p,children:jsx("pre",{ref:o,children:jsx("code",{className:`--code --lang-${r}`,dangerouslySetInnerHTML:{__html:w}})})})},wl=vl;var sn=({onSelect:o,meta:n,selected:e})=>{let r=useRef(null),{index:t,icon:s,label:u}=n,[m,p]=useState({x:0,width:0}),a=useDelayed();return useLayoutEffect(()=>{if(a&&r.current){let{width:i,x:f}=r.current.getBoundingClientRect();p({x:f,width:i}),e&&o(t,i,f,n,true);}},[a,r.current]),useEffect(()=>{e&&o(t,m.width,m.x,n,false);},[e]),jsxs(_,{onClick:()=>o(t,m.width,m.x,n,false),ref:r,className:`--segment-item flex aic rel ${e?"--segment-active":""}`.trim(),children:[s?typeof s=="string"?jsx(X,{name:s,as:"--segment-icon"}):jsx(l,{as:"--segment-icon flex aic jcc",children:s}):null,u&&String(u).trim()!=""&&jsx(l,{className:"--segment-label",children:u||`Item ${t}`})]})};sn.displayName="SelectTabItem";var an=sn;var mn=forwardRef((o,n)=>{let{fx:e,items:r,selected:t,variant:s,onSwitch:u,...m}=o,[p,a]=useState(t||0),i=useRef(false),f=useRef(p),{className:c,style:g,rest:w}=N(m),x=useRef(null),v=useRef(null),R=(h,d,S,I,P)=>{if((P||p!=h&&p!=-2)&&(a(h),f.current=p,i.current&&u?.(I)),x.current){let C=v.current?.getBoundingClientRect();x.current.style.setProperty("--w",`${d}px`),x.current.style.setProperty("--x",`${C?S-C.left:S}px`);}};return useImperativeHandle(n,()=>({setSelected:h=>{typeof h=="number"&&h!=p&&a(h);}}),[p]),useEffect(()=>{i.current=true;},[]),jsxs(l,{ref:v,"data-selected":p,className:`${c} --segmented --${s||G.Small} flex aic rel`,style:g,...w,children:[jsx(l,{ref:x,className:"--segment-tab abs"}),r.map((h,d)=>jsx(an,{onSelect:R,selected:p==d,meta:{...h,index:d}},`segment-${h.label}-${d}`))]})});mn.displayName="Zuz.SelectTabs";var ot=mn;var un=forwardRef((o,n)=>{let{type:e,...r}=o,t=useDelayed(),{colorScheme:s,setColorScheme:u}=Vt(),m=useCallback(()=>{u(s=="dark"?"light":s=="light"?"system":"dark");},[s]),{className:p,style:a}=N(r),i=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(ot,{className:`--color-scheme --${e}`,onSwitch:({tag:c})=>{u(c);},selected:f,items:i,...r}):jsx(_,{onClick:m,style:a,as:`--color-scheme-switch --${r.variant||G.Small} ${p}`.trim(),children:s=="system"?D.colorSchemeSystem:s=="light"?D.colorSchemeLight:D.colorSchemeDark})});un.displayName="Zuz.ColorScheme";var Hl=un;var dn=forwardRef((o,n)=>{let[e,r]=useState("wait"),{title:t,message:s,acceptLabel:u,rejectLabel:m,position:p}=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(l,{fx:{from:{x:-1e3},to:{x:0},when:e=="pending",curve:Z.EaseInOut,duration:.5,delay:e=="accepted"?0:3},as:`--cookie-consent --${e} --${p||te.Left} flex cols`,children:[jsx(H,{as:"--title",children:t||"This site uses cookies"}),jsx(H,{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(l,{as:"--footer flex aic",children:[jsx(_,{onClick:i=>a(1),as:"--accept",children:u||"Accept All"}),jsx(_,{onClick:i=>a(0),as:"--reject",children:m||"Cancel"})]})]})});dn.displayName="Zuz.CookiesConsent";var zl=dn;var xn=forwardRef((o,n)=>{let {type:e,value:r,min:t,max:s,step:u,onChange:m,roundValue:p,...a}=o,{className:i,style:f,rest:c}=N(a),g=useRef(u||.01).current,w=useRef(t||0).current,x=useRef(s||1).current,v=useRef(r||0).current,R=useRef(null),h=useRef(null),d=useRef(null);useRef(null);let I=useRef(null),P=useRef(null),C=(z,U,k)=>(z-U)/(k-U)*100,E=z=>{if(h.current){let U=parseFloat(z.currentTarget.value),k=C(U,parseFloat(z.currentTarget.min),parseFloat(z.currentTarget.max));h.current.style.setProperty("--value",`${k}`),h.current.setAttribute("data-value",`${U}`),m&&m(p?+U.toFixed(2):U);}},[O,M]=useState(false),[$,B]=useState(0),[K,W]=useState(0),A=z=>{M(true),B(z.clientX),W(h.current?parseFloat(h.current.getAttribute("data-value")):0),document.body.style.cursor="ew-resize";},T=z=>{if(O){let U=z.clientX-$,k=Math.max(w,Math.min(K+U*g,x));h.current&&(h.current.setAttribute("data-value",`${k}`),P.current.textContent=p?k.toFixed(2):k.toString(),m&&m(p?+k.toFixed(2):k));}},V=()=>{M(false),document.body.style.cursor="auto";};return useEffect(()=>{h.current&&h.current.style.setProperty("--value",R.current?`${C(parseFloat(R.current.value),parseFloat(R.current.min),parseFloat(R.current.max))}`:v.toString());},[]),useEffect(()=>(O?(document.addEventListener("mousemove",T),document.addEventListener("mouseup",V)):(document.removeEventListener("mousemove",T),document.removeEventListener("mouseup",V)),()=>{document.removeEventListener("mousemove",T),document.removeEventListener("mouseup",V);}),[O]),jsx(l,{ref:h,"data-value":v||0,className:`--slider --${e||ut.Default} flex rel ${i}`.trim(),style:{...f},children:ut.Text===e?jsx(Fragment$1,{children:jsx(H,{ref:P,onMouseDown:A,className:"--slider-text",children:v||0})}):jsxs(Fragment$1,{children:[jsx(l,{ref:I,className:"--slider-track abs fill"}),jsx(l,{ref:d,className:"--slider-knob abs"}),jsx(re,{ref:R,onInput:E,className:"abs fill",tabIndex:0,type:e||ut.Default,defaultValue:v||0,step:g,max:x,min:w})]})})});xn.displayName="Zuz.Slider";var uo=xn;var bn=forwardRef((o,n)=>{let{src:e,shape:r,size:t,...s}=o,{style:u,className:m,rest:p}=N(s),{canvasRef:a,crop:i,setScale:f,handleMouseDown:c,handleMouseUp:g,handleMouseMove:w}=useImageCropper(e,t||200,r||CropShape.Circle);return useImperativeHandle(n,()=>({getCropped(){return i()},setScale(x){f(x);}})),jsxs(l,{as:`--cropper --${r||CropShape.Circle} ${m}`,style:u,...p,children:[jsx("canvas",{ref:a,width:t||200,height:t||200,onMouseDown:c,onMouseUp:g,onMouseLeave:g,onMouseMove:w}),jsx(l,{as:"--cropper-slider",children:jsx(uo,{onChange:x=>f(x),min:0,max:1,step:.01,value:1})})]})});bn.displayName="Zuz.Cropper";var Wl=bn;var ql=(e=>(e.Circle="circle",e.Square="square",e))(ql||{});var wn=forwardRef((o,n)=>{let{items:e,maxItems:r}=o,t=useMemo(()=>{let m=typeof e=="string",p=m?[]:e;return m&&e.split(",").forEach(a=>{p.push({label:a});}),p},[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(l,{as:"--crumb-chevron",children:D.chevronRightOutline}),items:u.map((m,p,a)=>m.ID=="."?jsx(l,{as:"flex aic gap:3",children:Array(3).fill(null).map(()=>jsx(l,{as:"w:4 h:4 bg:$text r:10"},`--crumb-placeholder-${p}`))}):jsxs(_,{onClick:()=>m.action?.(),className:"--crumb-item",disabled:!a[p+1],children:[m.icon&&jsx(X,{as:"--crumb-icon",name:m.icon}),jsx(H,{as:"--crumb-label",children:m.label})]},`${m.label.replace(/\s+/g,"-").toLowerCase()}-${p}`))})});wn.displayName="Zuz.Crumb";var Yl=wn;var Tn=forwardRef((o,n)=>{let{icon:e,defaultValue:r,value:t,size:s,variant:u,numeric:m,type:p,onConfirm:a,...i}=o,[f,c]=useState(false),[g,w]=useState(r||null),{style:x,className:v,rest:R}=N(i),h=useRef(null),d=useRef(null),{reposition:S}=We(d,{direction:te.Bottom,offset:2}),I=C=>{m&&(C.currentTarget.value=C.currentTarget.value.replace(/[^0-9.]/g,"").replace(/(\..*?)\..*/g,"$1"));};useEffect(()=>{let C=E=>{let O=E.target,M=h.current?.contains(O),$=d.current?.contains(O);!M&&!$&&c(false);};return f&&document.addEventListener("mousedown",C),()=>{document.removeEventListener("mousedown",C);}},[f]),useEffect(()=>{let C=E=>{E.key==="Escape"&&f&&(c(false),h.current?.focus());};return document.addEventListener("keydown",C),()=>document.removeEventListener("keydown",C)},[f]);let P=()=>{c(true);};return useEffect(()=>{f&&S();},[f,S]),jsx(Fragment$1,{children:jsxs(l,{as:`--date-picker ${u?`--${u}`:""} rel flex aic ${v}`,"data-value":g?g.toISOString():"",children:[e?typeof e=="string"?jsx(X,{as:"mr:10 c:#666",name:e}):e:jsx(Q,{as:"--date-picker-icon flex aic jcc",children:D.calendar}),jsx("input",{ref:h,value:g?format(g,"EEE, MMM d YYY hh:mm a"):t||"",className:`--input ${u?`--${u}`:""} flex`.trim(),style:x,onFocus:P,onInput:I,autoComplete:"new-password",onKeyDown:C=>{C.key=="Enter"&&a?.(C.currentTarget.value);},...R}),jsx(l,{"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(so,{defaultValue:g,onChange:C=>{w(C),c(false);}})})]})})});Tn.displayName="Zuz.DatePicker";var em=Tn;var Pn=forwardRef((o,n)=>{let{icon:e,variant:r,position:t}=o;return jsx(_,{className:`--fab fixed --${r||G.Large} --${t||"bottomright"}`,children:e||D.plus})});Pn.displayName="Zuz.Fab";var nm=Pn;var Rn=o=>{let{names:n,strength:e}=o,r={[ft.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-${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(t=>r[t](e))})})};Rn.displayName="Zuz.Filters";var im=Rn;var Re=null,ae=null,In=forwardRef((o,n)=>{let{title:e,message:r,transition:t,curve:s,speed:u,type:m,actionPosition:p,spinner:a,loadingMessage:i,onShow:f,onHide:c,...g}=o,{className:w,style:x,rest:v}=N(g),[R,h]=useState(e||""),[d,S]=useState(r||""),[I,P]=useState(null),[C,E]=useState(m||le.Default),O=useMemo(()=>uuid(12),[]),[M,$]=useState(false),B=useRef(null),K=useRef(null),[W,A]=useState(false),[T,V]=useState(true),z=useRef(null),U=d;useImperativeHandle(n,()=>({setLoading(F){A(F);},showDialog(F,Y,oe,ee){Re&&(clearTimeout(Re),ae&&clearTimeout(ae),B.current.classList.remove("--wobble"),setTimeout(()=>B.current.classList.add("--wobble"),50),ae=setTimeout(()=>{B.current.classList.remove("--wobble"),ae=null;},500)),E(le.Dialog),Y&&S(Y),F&&h(F),oe&&P(oe.reduce((pe,ge)=>(pe.push({...ge,key:ge.key||uuid(12)}),pe),[])),$(true),setTimeout(()=>ee?ee():()=>{},1e3);},dialog(F,Y,oe,ee){Re&&(clearTimeout(Re),ae&&clearTimeout(ae),B.current.classList.remove("--wobble"),setTimeout(()=>B.current.classList.add("--wobble"),50),ae=setTimeout(()=>{B.current.classList.remove("--wobble"),ae=null;},500)),E(le.Dialog),S(Y),h(F),oe&&P(oe.reduce((pe,ge)=>(pe.push({...ge,key:ge.key||uuid(12)}),pe),[])),$(true),setTimeout(()=>ee?ee():()=>{},1e3);},error(F,Y){this.show(F,Y,le.Error);},warn(F,Y){this.show(F,Y,le.Warn);},success(F,Y){this.show(F,Y,le.Success);},show(F,Y,oe){Re&&(clearTimeout(Re),ae&&clearTimeout(ae),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),ae=setTimeout(()=>{B.current.classList.remove("--wobble"),B.current.style.transform=K.current||"",ae=null;},500)),Re=setTimeout(()=>{$(false),Re=null,ae=null;},(Y||4)*1e3),E(oe||le.Default),S(F),$(true),f?.();},hide(){$(false),c?.();}}));let k=useMemo(()=>{let F={when:M,duration:u||.3,delay:.1};if(C==le.Dialog){if(t){let{from:Y,to:oe}=Ue(t,20);return {from:Y,to:oe,curve:s||Z.EaseInOut,...F}}return {from:{scale:0,x:"-50%",y:"-50%",opacity:0},to:{scale:1,x:"-50%",y:"-50%",opacity:1},curve:Z.Spring,...F}}else return {from:{scale:0,x:"-50%",y:"-10vh",opacity:0},to:{scale:1,x:"-50%",y:0,opacity:1},curve:Z.Spring,...F}},[M,C]);return useEffect(()=>{z.current&&clearTimeout(z.current),M?V(true):z.current=setTimeout(()=>V(false),1e3);},[M]),C==le.Dialog?jsxs(Fragment$1,{children:[jsx(Ee,{when:M}),jsxs(l,{className:`--sheet --sheet-${C.toLowerCase()} ${M?"is-visible":""} ${w} fixed`.trim(),style:x,fx:k,...v,ref:B,children:[jsx(Be,{when:W,spinner:a,message:i}),jsxs(l,{className:"--head flex aic rel",children:[jsx(l,{className:`--${R?"title":"dot"} flex aic rel`,children:R||""}),jsx(_,{onClick:F=>$(false),className:"--closer abs",children:"\xD7"})]}),jsx(l,{className:`--body flex aic rel ${I?"":"--no-action"}`.trim(),children:T?U:null}),I&&jsx(l,{className:`--footer flex aic rel ${p?p==Mt.Center?"jcc":"":"jce"}`.trim(),children:I.map((F,Y)=>jsx(_,{onClick:oe=>F.handler?F.handler():F.onClick?F.onClick():console.log("onClick Handler missing"),className:"--action",children:F.label},`sheet-${O}-action-${F.key}`))})]})]}):jsx(l,{className:`--sheet --sheet-${C.toLowerCase()} ${w} abs`.trim(),style:x,...v,fx:k,ref:B,children:M?d:null})}),nt=o=>typeof o=="object"&&o!=null&&"setLoading"in o&&"success"in o&&"error"in o;In.displayName="Zuz.Sheet";var um=In;var En=forwardRef((o,n)=>{let{name:e,cover:r,spinner:t,errors:s,action:u,children:m,withData:p,beforeSubmit:a,onSubmit:i,onError:f,onSuccess:c,resetOnSuccess:g,...w}=o,{className:x,style:v,rest:R}=N(w),[h,d]=useState(false),S=useRef(null),I=useRef(null),P=useRef(null),C=Qt(),E=useCallback(T=>S.current?S.current.querySelectorAll(T):[],[S.current]),O=T=>({name:T.name||T.getAttribute("name")||T.getAttribute("data-name"),required:T.required?true:T.getAttribute("data-required")?T.getAttribute("data-required")=="true":false,with:T.with||T.getAttribute("with")}),M=T=>{let V=[];return T.querySelectorAll(".--input").forEach(z=>{V.push(z.value);}),V.join("")},$=useCallback(T=>{let{required:z}=O(T);if(z){if(T.type=="checkbox"&&T.checked==false)return false;if(T.classList.contains("--otp")){let k=M(T);if(k==""||k.length<parseInt(T.getAttribute("data-size")))return false}if(T.classList.contains("--select")&&T.querySelector("button.--selected").dataset.value=="-1"||T.value=="")return false}if(T.getAttribute("with")){let k=T.getAttribute("with");switch(k.includes("@")&&(k=k.split("@")[0],k=="match"&&(k=we.MatchField)),k.toUpperCase()){case we.IPV4:return _$1(T.value).isIPv4();case we.IPV6:return _$1(T.value).isIPv6();case we.Email:return _$1(T.value).isEmail();case we.Uri:try{return new URL(T.value),!0}catch{return false}case we.Password:return console.log("Add FORMVALIDATION.Password"),false;case we.MatchField:let[F,Y,oe]=T.getAttribute("with").split("@"),ee=document.querySelector(`[name=${Y.trim()}]`);if(!ee)return false;switch(oe||"direct-match"){case "if-not-empty":if(ee&&!_$1(ee.value).isEmpty()&&ee.value!=T.value)return false;break;case "direct-match":if(ee&&ee.classList.contains("--otp")&&T.classList.contains("--otp")&&M(ee)!=M(T))return false;if(ee&&ee.value!=T.value)return false;break}break;default:return true}}return true},[S.current]),B=useCallback(()=>{let T={},V={},z=null,U=null;if(Array.from(E("[name]")).forEach(k=>{let{name:F,required:Y,with:oe}=O(k),ee=true;(Y||oe)&&(ee=$(k)),T[F]={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},V[F]=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[F]),k.classList.add("input-with-error"));}),z){let k=z;if(k.classList.contains("--otp"))for(let F of Array.from(k.querySelectorAll(".--input"))){let Y=F;if(Y.value==""){Y.focus();break}}else k.focus();}return {error:z!=null,errorMsg:U||"Fix errors to continue...",data:T,payload:V}},[S.current]),K=useCallback(()=>{let{error:T,errorMsg:V,payload:z}=B();T?C.error(V):u?startTransition(async()=>{a&&a(z),nt(r)?r.setLoading(true):d(true),C.clearAll(),withPost(u,{...z,...p||{}}).then(U=>{let k=U;nt(r)?r.setLoading(false):d(false),g&&Array.from(E("[name]")).forEach(F=>{F instanceof HTMLInputElement&&(F.value="");}),c?c(k):(C.clearAll(),C.success(k.message||"Redirecting..."));}).catch(U=>{nt(r)?r.setLoading(false):d(false),f?f(U):C.error(U.message||"We cannot process your request at this time.");});}):i&&i(z);},[u,I.current,S.current]),W=useCallback(()=>{let T=E("[type=submit]");!T||T.length==0?console.warn("You should add at least 1 button with type=`SUBMIT`"):T.forEach(V=>{V.addEventListener("click",K);});},[S.current]),A=useMemo(()=>addPropsToChildren(m,T=>T.props.type=="submit",T=>({ref:P})),[m]);return useImperativeHandle(n,()=>({setLoading(T){if(T){I.current.hide();try{C.clearAll();}catch{}}d(T);},showError(T){typeof T=="string"?C.error(T):I.current.error(T,4);},hideError(){I.current.hide();try{C.clearAll();}catch{}},init(){W();},submit(){K();}})),useEffect(W,[]),jsxs(l,{ref:S,style:v,className:`--form flex rel ${x} ${e?`--form-${e.replace(/\s+/g,"-")}`:""}`,propsToRemove:["withData","action","onSubmit","onSuccess","onError"],children:[!nt(r)&&jsx(Be,{message:r?r.message||void 0:"working",spinner:t,color:r&&"color"in r?r.color:"#ffffff",when:h}),A]})});En.displayName="Zuz.Form";var Sm=En;var Bn=forwardRef((o,n)=>{let {children:e,fx:r,fxDelay:t,fxStep:s,classToIgnore:u,...m}=o,p=J(true),a=useDelayed(),i=r||p?.group?.fx,f=t||p?.group?.fxDelay,c=s||p?.group?.fxStep;u||p?.group?.classToIgnore;let w=useMemo(()=>i?addPropsToChildren(e,x=>{if(x.type===Fragment)return false;let v=x.props||{},R="fx"in v,h=v.as?Array.isArray(v.as)?v.as.join(" "):v.as:v.className||"",d=typeof h=="string"&&h.includes(u||"--ignore");return !R&&!d},x=>({fx:{...i,delay:(f||0)+x*(c||.1),when:a}})):e,[e,a,i]);return jsx(l,{className:"--group",ref:n,...m,children:w})});Bn.displayName="Zuz.Group";var Bm=Bn;var Ln=o=>typeof o=="string"&&o.includes("+"),Mn={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"},On={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 Dn=forwardRef(({children:o,keys:n,variant:e},r)=>{let t=useMemo(()=>{if(Ln(n)){let s=null;return {keys:String(n).split("+").reduce((m,p,a,i)=>(i[a+1]?m.push(p):s=p.toUpperCase(),m),[]),children:s}}return {keys:n,children:String(o).toUpperCase()}},[n]);return jsxs(l,{as:`--keyboard-keys --${e||G.Small} flex aic`,children:[(Array.isArray(t.keys)?t.keys:[t.keys]).map(s=>jsx("abbr",{title:On[s],children:Mn[s]},s)),jsx(Q,{children:t?.children??o})]})});Dn.displayName="Zuz.KeyboardKeys";var vo=Dn;var An=forwardRef((o,n)=>{let e=useNetworkStatus(),{onlineMessage:r,offlineMessage:t,variant:s}=o;return jsxs(l,{fx:{from:{x:"-50%",y:200,opacity:0},to:{x:"-50%",y:0,opacity:1},when:e==false,curve:Z.Spring,duration:.5,delay:2},className:`--network-manager --${e==true?"online":"offline"} --${s||G.Small} fixed flex`,children:[jsx(l,{className:"--ico",children:e?D[ie.Success]:D[ie.Error]}),jsx(H,{as:"--message",children:e?r||"internet connection restored :)":t||"no internet connection"})]})});An.displayName="Zuz.NetWorkManager";var Am=An;var wo=(e=>(e.Table="table",e.Gooey="gooey",e))(wo||{});var zn=forwardRef((o,n)=>{let{itemCount:e,itemsPerPage:r,startPage:t,pageRange:s,paginationStyle:u,breakLabel:m,prevLabel:p,nextLabel:a,hash:i,loading:f,seperator:c,renderOnZeroPageCount:g,onPageChange:w,...x}=o,v=useMemo(()=>toHash(numberInRange(4,8)),[]),R=useCallback(B=>`${toHash(B,i||6,v)}${c||""}${v}`,[v]),h=useMemo(()=>m||"...",[m]),[d,S]=useState({id:i?t?typeof t=="number"?R(t):t:1:t||1,label:t||1}),{style:I,className:P,rest:C}=N(x),E=useCallback(B=>typeof B=="number"?B:+B.label,[]);if(!e)throw new Error('"itemCount" prop is required');let O=useMemo(()=>Math.ceil(e/r),[e,r]),M=useMemo(()=>{let B=[],K=Math.max(E(d)-(s||2),1),W=Math.min(E(d)+(s||2),O);K>1&&B.push({id:i?R(1):1,label:1}),K>2&&B.push({id:-1,label:h});for(let A=K;A<=W;A++)B.push({id:i?R(A):A,label:A});return W<O-1&&B.push({id:-1,label:h}),W<O&&B.push({id:i?R(O):O,label:O}),B},[d]),$=useCallback(B=>{let K=B;+K.label<1||+K.label>O||(S(K),w?.(K));},[e,r,d]);return M.length<=1&&(g??false)===false?null:jsxs(l,{ref:n,as:`--pagination --pgt-${u||"table"} flex aic w:100% jcc ${P}`,children:[jsx(l,{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||E(d)==+B.label,className:(typeof B=="string"?B:B.label)==E(d)?"--current-page":"",onClick:A=>$(B),children:typeof B=="string"?B:B.label},`--pg-${K}-${B.id}`))}),jsx(l,{as:"flex aic jcc flex:1 --pagination-label",children:[`Showing ${(E(d)-1)*r+1} - `,`${Math.min(E(d)*r,e)} of ${e} items`].join(" ")}),jsxs(l,{as:"flex aic jce flex:1 --pgt-btns --pgt-nav",children:[jsx(_,{disabled:E(d)<=1,onClick:B=>$({id:i?R(E(d)-1):E(d)-1,label:E(d)-1}),children:D.chevronLeftOutline}),jsx(_,{disabled:M.length<=1||E(d)==E(M[M.length-1]),onClick:B=>$({id:i?R(E(d)+1):E(d)+1,label:E(d)+1}),children:D.chevronRightOutline})]})]})});zn.displayName="Zuz.Pagination";var Co=zn;var Fn=forwardRef((o,n)=>{let{strenthMeter:e,onChange:r,...t}=o;"type"in t&&delete t.type;let{style:s,className:u,rest:m}=N(t),[p,a]=useState(false),[i,f]=useState(""),c=useMemo(()=>checkPasswordStrength(i),[i]),g=useDebounce(w=>{e&&f(w.target.value),r&&r(w);},100);return useEffect(()=>{},[]),jsxs(l,{as:"w:100% flex cols",children:[jsxs(l,{style:s,className:"--password flex aic rel",children:[jsx(re,{ref:n,type:p?"text":"password",className:u,onChange:g,...m}),jsx(_,{tabIndex:-1,onClick:()=>a(w=>!w),className:"--toggle flex aic jcc abs",children:p?D.eye:D.eyeSlash})]}),e&&jsxs(l,{as:`flex aic --password-meter --pb-score-${c.score}`,style:s,children:[jsxs(l,{as:"--password-bars flex aic",children:[jsx(l,{as:`--pbar ${c.score>=1?"--pb-on":""}`.trim()}),jsx(l,{as:`--pbar ${c.score>=2?"--pb-on":""}`.trim()}),jsx(l,{as:`--pbar ${c.score>=3?"--pb-on":""}`.trim()}),jsx(l,{as:`--pbar ${c.score>=4?"--pb-on":""}`.trim()}),jsx(l,{as:`--pbar ${c.score>=5?"--pb-on":""}`.trim()})]}),jsx(H,{as:"--password-meter-label","aria-hidden":true,children:c.result})]})]})});Fn.displayName="Zuz.Password";var Gm=Fn;var Kn=forwardRef((o,n)=>{let{size:e,length:r,mask:t,...s}=o,u=useRef([]),m="pinput",p=false,a={};"with"in s&&(a={with:s.with},delete s.with),"type"in s&&delete s.type,"name"in s&&(m=s.name,delete s.name),"required"in s&&(p=true,delete s.required);let{style:i}=N(s),f=c=>{let g=c.currentTarget,w=u.current[parseInt(g.dataset.index)+1],x=u.current[parseInt(g.dataset.index)-1];g.value.length===1&&w?w.focus():g.value.length===0&&x&&x.focus();};return useEffect(()=>{u.current=u.current.slice(0,e||r);},[e||r]),jsx(l,{name:m,style:i,className:"--otp flex aic rel","data-required":p,"data-size":e||r||4,...a,children:Array(e||r||4).fill(1).map((c,g)=>jsx(re,{autoComplete:"new-password","data-index":g,ref:w=>{u.current[g]=w;},numeric:true,onChange:f,maxLength:1,placeholder:t?"\xB7":"0",type:t?"password":"text",...s},`pin-${g}`))})});Kn.displayName="Zuz.PinInput";var Qm=Kn;var Un=forwardRef((o,n)=>{let{children:e,className:r,name:t,required:s,type:u,value:m,variant:p,checked:a,onSwitch:i,...f}=o,[c,g]=useState(a||false),{variant:w}=J(true),x=useRef(null);return jsxs(et,{className:`${r} --${(u||Ot.Default).toLowerCase()} --radio${!u||u==Ot.Default?"":"card"} --${p||w||G.Small} flex aic rel`.trim(),...f,children:[jsx(re,{ref:x,defaultChecked:c,value:m||"rd",type:"radio",className:"abs",name:t,required:s||false,onChange:v=>{i&&i(v.target.checked,m||"cb"),g(v.target.checked);}}),jsx(l,{className:"--dot rel",children:jsx(l,{className:"--rod abs abc"})}),jsx(l,{className:"--value",children:e})]})});Un.displayName="Zuz.Radio";var tc=Un;var Wn=forwardRef((o,n)=>{let{fx:e,withStyle:r,as:t,reverse:s=false,searchIcon:u=D.search,hideSearchIcon:m=false,clearIcon:p=D.close,hideClearIcon:a=false,onChange:i,onClear:f,...c}=o,{style:g,className:w}=N({as:o.as}),[x,v]=useState(""),R=useRef(null),h=useMemo(()=>jsx(_,{tabIndex:-1,onClick:I=>S(),className:"--send flex aic jcc",variant:o.variant||G.Small,children:x!==""?!a&&(typeof p=="string"?jsx(X,{name:p,as:"--search-action"}):p):!m&&(typeof u=="string"?jsx(X,{name:u,as:"--search-action"}):u)}),[s,u,a,p,m]);"type"in o&&delete o.type;let d=I=>{v(I.target.value),i?.(I.target.value);},S=I=>{x.trim()!==""&&(v(""),i?.(""),R.current&&(R.current.value="",o.onConfirm?.("")));};return useImperativeHandle(n,()=>({focus:()=>R.current?.focus(),value:()=>R.current?.value})),useEffect(()=>{},[]),jsxs(l,{style:g,className:`--search ${s?"--search-rev":""} --${o.variant||G.Small} flex aic ${typeof o.as=="string"&&o.as.includes("abs")?"":"rel"} ${w}`.trim(),children:[s&&h,jsx(re,{ref:R,onChange:d,className:`--${o.variant||G.Small}`,...c}),o.shortcut&&jsx(vo,{keys:o.shortcut,as:"abs"}),!s&&h]})});Wn.displayName="Zuz.Search";var mc=Wn;var qn=({value:o,updateValue:n,o:e})=>jsxs(_,{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(X,{name:e.icon,as:`--select-option-icon --icon-${e.value}`,color:e.iconColor||void 0}),jsx(H,{children:typeof e=="string"?e:e.label})]});qn.displayName="Option";var Xn=qn;var Qn=({ref:o,...n})=>{let {selected:e,options:r,label:t,name:s,variant:u,search:m,searchPlaceholder:p,maxHeight:a,arrowDownIcon:i=D.arrowDown,arrowUpIcon:f=D.arrowUp,onChange:c,...g}=n,[w,x]=useState(e?typeof e=="string"?r.find(A=>A.value===e):e:r[0]),[v,R]=useState(false),[h,d]=useState(null);useRef(null);let I=useRef(null),P=useRef(null),C=useId(),E=useMemo(()=>s||C,[]),{reposition:O}=We(P,{direction:Lt.Bottom,offset:2}),{variant:M}=J(true),{className:$,style:B,rest:K}=N(g),W=A=>{x(A),c&&c(A);};return useImperativeHandle(o,()=>({setSelected:A=>{if(typeof A=="string"){let T=r.find(V=>V.value===A);T&&x(T);}else x(A);},getValue:()=>w||null})),useEffect(()=>{if(!v)return;let A=()=>{O();};return window.addEventListener("scroll",A,true),window.addEventListener("resize",O),()=>{window.removeEventListener("scroll",O,true),window.removeEventListener("resize",O);}},[v,O]),useEffect(()=>{if(!v){I.current&&(I.current.value=""),d(null);return}I.current?.focus(),O();let A=V=>{P.current&&!P.current.contains(V.target)&&R(false);},T=setTimeout(()=>{document.addEventListener("click",A);},0);return ()=>{clearTimeout(T),document.removeEventListener("click",A);}},[v,O]),jsxs(l,{className:`--select --${u||M} ${s?`--${s}`:""} rel`.trim(),name:E,children:[jsxs(_,{"data-value":w?typeof w=="string"?w:w.value:w||"-1",className:`--selected flex aic rel ${$}`.trim(),withLabel:false,style:B,onClick:A=>{A.stopPropagation(),R(T=>!T);},...K,children:[jsx(H,{className:"--label",children:w?typeof w=="string"?w:w.label:t||"Choose"}),jsx(l,{className:"--svg-arrow rel flex aic jcc",children:v?typeof f=="string"?jsx(X,{name:f,as:"--search-action"}):f:typeof i=="string"?jsx(X,{name:i,as:"--search-action"}):i})]}),jsxs(l,{id:E,className:"--options-list flex cols abs","aria-hidden":!v,style:{maxHeight:a||"auto"},ref:P,fx:{from:{y:5,opacity:0},to:{y:0,opacity:1},when:v,duration:.05},children:[m&&jsx(re,{ref:I,onChange:A=>{d(A.target.value==""?null:A.target.value);},className:"--select-search",placeholder:p||"Search..."}),(h==null?r:r.filter(A=>A.label.toLowerCase().includes(h.toLowerCase())||A.value.toLowerCase().includes(h.toLowerCase()))).map(A=>jsx(Xn,{updateValue:W,value:w,o:A},`option-${(typeof A=="string"?A:A.label).replace(/\s+/g,"-")}-${typeof A=="string"?A:A.value}`))]})]})};Qn.displayName="Zuz.Select";var gc=Qn;var Jn=forwardRef((o,n)=>jsx(tt,{type:ve.Switch,...o,ref:n}));Jn.displayName="Zuz.Switch";var xc=Jn;var es=o=>{let{idx:n,id:e,as:r,weight:t,style:s,value:u,render:m,resize:p,sortBy:a,sortable:i,onSort:f}=o,[c,g]=useState(0),w=()=>{i&&(f?.(String(e),c==1?-1:1),g(x=>x==1?-1:1));};return jsxs(l,{style:{flex:t||1,...s},as:`--col flex aic ${r||""} ${i?"--sortable":""}`,onClick:w,children:[jsx(l,{children:u}),n==-1&&i&&a==e&&jsx(l,{as:"--arrow flex aib",children:c==1?D.arrowUp:D.arrowDown})]})};es.displayName="Zuz.Column";var Pt=es;var os=o=>{let{index:n,pubsub:e,schema:r,data:t,ids:s,styles:u,animate:m,sortBy:p,selectable:a,tableRef:i,loading:f,rowClassName:c,onSort:g,onRowClick:w,onSelect:x,onContextMenu:v}=o,R=useDelayed(),h=useMemo(()=>({transition:q.SlideInBottom,curve:Z.EaseInOut,delay:.02*(n+1)}),[]),d=useRef(null),S=(P,C)=>{n==-1?e.emit(`ALL_ROWS_${P?"CHECKED":"UNCHECKED"}`,P):(x&&x(t,P),e.emit(`ROW_${P?"CHECKED":"UNCHECKED"}`,P,C));},I=(P,C,E)=>jsx(Pt,{idx:P,id:C,as:"--selector",pubsub:e,value:jsx(tt,{value:E,ref:d,onSwitch:S,type:ve.Default})});return useEffect(()=>{let P=(M,$)=>{d.current?.setChecked(M,false);},C=(M,$)=>{let B=false;i?.current&&i.current.querySelectorAll(".--row").forEach(K=>{let W=K;if(!W.classList.contains("--row-head")){let A=W.querySelector(".--selector input[type=checkbox]");A&&A.checked&&!B&&(B=A.checked);}}),d.current.setChecked(B,false);},E=M=>{d.current?.setChecked(M,false),x&&x(t,M);},O=M=>{d.current?.setChecked(M,false),x&&x(t,M);};return n==-1?(e.on("ROW_CHECKED",P),e.on("ROW_UNCHECKED",C),()=>{e.off("ROW_CHECKED",P),e.off("ROW_UNCHECKED",C);}):(e.on("ALL_ROWS_CHECKED",E),e.on("ALL_ROWS_UNCHECKED",O),()=>{e.off("ALL_ROWS_CHECKED",E),e.off("ALL_ROWS_UNCHECKED",O);})},[]),jsxs(l,{onContextMenu:P=>v?v(P,t):null,onClick:P=>w?w(P,o.data):()=>{},...m?{fx:{...h,when:R}}:{},as:`--row flex aic ${w?"--row-clickable":""} ${n==-1?"--row-head":""} ${c||""}`,children:[n==-1&&r.map((P,C)=>{let{renderWhenHeader:E,render:O,value:M,...$}=P;return jsxs(Fragment,{children:[a&&C==0&&I(-1,`--selector-${P.id}`,"all"),jsx(Pt,{idx:-1,onSort:g,sortBy:p,value:M,...$,pubsub:e,style:u[P.id]})]},`--col-${P.id}`)}),f&&n>-1&&jsx(l,{as:"--col",children:jsx(H,{as:"opacity:0",children:"..."})}),!f&&n>-1&&s&&t&&r.map((P,C)=>jsxs(Fragment,{children:[a&&C==0&&I(C,`--selector-${P.id}`,P.id.toString()),s.includes(String(P.id))?jsx(Pt,{pubsub:e,idx:C,id:String(P.id),style:u[String(P.id)],value:P.render?P.render(t,n):t[String(P.id).includes(".")?String(P.id).split(".").reverse()[0]:P.id]}):null]},`--${String(P.id)}-val-${C}`))]})};os.displayName="Zuz.Row";var Rt=os;var as=(o,n)=>{let{schema:e,rows:r,rowCount:t,rowsPerPage:s,currentPage:u,pagination:m,paginationHash:p,showPaginationOnZeroPageCount:a,animateRows:i,header:f,rowClassName:c,selectableRows:g,hoverable:w,sortBy:x,loading:v,loadingRowCount:R,loadingMessage:h,spinner:d,emptyMessage:S,onSort:I,onRowClick:P,onRowSelectToggle:C,onPageChange:E,onRowContextMenu:O,...M}=o,$=useRef(null),B=useMemo(()=>e.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),{}),[e]),K=useMemo(()=>Object.keys(B),[e]),W=useMemo(()=>f??true,[f]),{style:A,className:T,rest:V}=N(M),z=useRef(null),U=useMemo(()=>new PubSub,[]),k=useRef(r.map(()=>uuid(8))),[F,Y]=useState(x||null),[oe,ee]=useState(h||"loading"),pe=useMemo(()=>!v&&r&&r.length==0,[v,r]),ge=useCallback(()=>S?typeof S=="function"?jsx(S,{}):S:jsx(H,{as:"tac s:18 mt:75",children:"No Record Found"}),[v,r]);useEffect(()=>{k.current=r.map(()=>uuid(8));},[r]);let lt=(ue,j)=>{Y(ue),I?.(ue,j);},mt=(t||(r?r.length:0))/(s||10),ct=useMemo(()=>a||mt>1?jsx(Co,{hash:p,ref:$,renderOnZeroPageCount:a,onPageChange:E,paginationStyle:"table",startPage:u,itemCount:t||(r?r.length:0),itemsPerPage:s||10}):null,[u,t]);return useImperativeHandle(n,()=>({setLoading(ue){}})),jsxs(l,{as:`--table ${w??true?"--hoverable":""} flex cols rel ${T}`,ref:z,children:[W==true&&jsx(Rt,{sortBy:F,onSort:lt,tableRef:z,pubsub:U,selectable:g,index:-1,schema:e,loading:true,styles:B}),v&&jsxs(l,{as:"center-x flex aic --table-spinner",children:[jsx(he,{type:d||me.Simple}),oe&&jsx(H,{as:"--table-loading-message",children:oe})]}),v&&Array(R||5).fill({}).map((ue,j)=>jsx(Rt,{tableRef:z,index:j,pubsub:U,schema:e,styles:B,loading:true,animate:i,onRowClick:P},`--trow-loading-${j}-${e[0].id}`)),!v&&r&&r.map((ue,j)=>jsx(Rt,{tableRef:z,pubsub:U,loading:false,index:j,schema:e,ids:K,styles:B,animate:i,data:ue,onRowClick:P,rowClassName:c,selectable:g,onSelect:C,onContextMenu:O},`--trow-${k.current[j]||j}-${e[0].id}`)),pe&&ge(),jsx(l,{"aria-hidden":!m||!ct,...i?{fx:{transition:q.SlideInBottom,curve:Z.EaseInOut,delay:.02*(r.length+1),when:!v&&r&&m&&ct!=null}}:{},as:"--row flex aic --row-footer",children:m&&ct?ct:null})]})};as.displayName="Zuz.Table";var Bc=forwardRef(as),Lc=Bc;var Oc=({ref:o,...n})=>{let{title:e,items:r}=n,[t,s]=useState(0),u=(m,p,a)=>{m.preventDefault(),s(p),document.getElementById(a)?.scrollIntoView({behavior:"smooth"});};return jsxs(l,{ref:o,as:"--table-of-contents rel flex cols",children:[jsx(H,{as:"--toc-title",children:e}),jsx(Me,{items:r.map((m,p)=>jsx("a",{className:t==p?"--toc-active":"",style:{anchorName:t===p?"--toc-active":"none",color:t==p?"var(--table-of-contents-color-active)":"var(--table-of-contents-color)"},onClick:a=>u(a,p,m.tag),href:`#${m.tag}`,children:m.label}))})]})},kc=Oc;var is=({isActive:o,transitionType:n,speed:e,width:r,render:t,content:s,onHeightChange:u})=>{let m=useRef(null),p=useResizeObserver(m);useEffect(()=>{o&&p.height>0&&u(p.height);},[o,p.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 ${e}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 ${e}s cubic-bezier(0.34, 1.56, 0.64, 1)`,zIndex:o?1:0}:i},[o,n,r,e]);return jsx(l,{ref:m,style:{...a},className:"--content",children:t||o?s:null})};is.displayName="Zuz.TabBody";var ls=is;var ps=({ref:o,...n})=>{let{tabs:e,speed:r=.3,prerender:t=true,variant:s,tabStyle:u="fixed",onChange:m,transitionType:p="slide",...a}=n,[i,f]=useState(0),c=useRef(null),g=useResizeObserver(c),w=useMemo(()=>uuid(8),[]),[x,v]=useState("auto"),R=useMemo(()=>g.width>0,[g.width]);useImperativeHandle(o,()=>({setTab:C=>f(C)}));let h=useMemo(()=>e.map(C=>({...C,key:C.key||uuid(8)})),[e]),{style:d,className:S,rest:I}=N({as:`flex cols w-full no-overflow ${a.as||""}`,...a}),P=()=>{if(!R)return {opacity:0};switch(p){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(l,{ref:c,style:d,className:`--tabview --${u} flex cols ${S}`,children:[jsx(ot,{as:"--tabview-head",onSwitch:C=>{f(C.index);let E=h.find(O=>O.tag==C.tag);E&&E.onSelect&&(E.onSelect(E,C.index),m?.(E,C.index));},selected:i,items:h.reduce((C,E,O)=>(C.push({icon:E.icon,index:O,label:E.label,tag:E.tag}),C),[])}),jsx(l,{className:"--tabview-body",as:"rel no-overflow w-full",style:{height:x,transition:R?`height ${r}s cubic-bezier(0.4, 0, 0.2, 1)`:"none",opacity:R?1:0},children:jsx(l,{className:"--track",style:{...P()},children:h.map((C,E)=>jsx(ls,{isActive:E===i,transitionType:p,speed:r,width:g.width,render:t||E===i,onHeightChange:O=>E===i&&v(O),content:C.body},`tab-body-${C.key||E}-${w}`))})})]})};ps.displayName="Zuz.TabView";var Kc=ps;var qc=({ref:o,commands:n,onCommand:e,welcomeMessage:r="Welcome to Zuz Terminal v1.0.0",prompt:t="zuz ~ ",variant:s,...u})=>{let[m,p]=useState([{type:"output",content:r}]),[a,i]=useState(""),f=useRef(null),c=useRef(null),{variant:g}=J(true);useEffect(()=>{f.current&&(f.current.scrollTop=f.current.scrollHeight);},[m]);let w=S=>{let I=typeof S=="string"?{type:"output",content:S}:S;p(P=>{let C=[...P,I];return C.length>1e3?C.slice(-1e3):C});},x=()=>p([]);useImperativeHandle(o,()=>({write:w,clear:x}));let v=async S=>{let[I,...P]=S.split(" "),C=I.toLowerCase();return n&&n[C]?await n[C](P):e?await e(S):`command not found: ${I}`},R=S=>{let I=/\u001b\[(\d+)m/g,P=[],C={31:"#ff5f56",32:"#27c93f",33:"#ffbd2e",34:"#007aff",35:"#ff79c6",36:"#8be9fd",39:"#d4d4d4"},E=0,O="#d4d4d4",M=false,$;for(;($=I.exec(S))!==null;){let K=S.slice(E,$.index);K&&P.push({text:K,color:O,bold:M});let W=$[1];W==="0"?(O="#d4d4d4",M=false):W==="1"?M=true:C[W]&&(O=C[W]),E=I.lastIndex;}let B=S.slice(E);return B&&P.push({text:B,color:O,bold:M}),P},h=(S,I)=>S.includes("\x1B")?R(S).map((P,C)=>jsx(Q,{style:{color:P.color||"#d4d4d4",fontWeight:P.bold?"bold":"normal"},children:P.text},`--terminal-msg-${C}-${P.text.replace(/\S+/g,"-")}`)):jsx(Q,{style:{color:I==="error"?"#ff5f56":I==="command"?"#00ff00":"#d4d4d4"},children:S}),d=async S=>{if(S.key==="Enter"&&a.trim()){let I=a.trim(),P=[...m,{type:"command",content:`${t}${I}`}];i(""),p(P);let C=await v(I);p(E=>[...E,{type:"output",content:C}]);}};return jsxs(l,{as:`--zuz-terminal --${s||g||G.Medium} flex cols ${u.className}`,onClick:()=>c.current?.focus(),children:[jsx(l,{ref:f,className:"--terminal-log",children:m.map((S,I)=>jsx(l,{children:jsx(H,{children:h(S.content,S.type)})},I))}),jsxs(l,{as:"flex aic --terminal-input",children:[jsx(H,{as:"--terminal-prompt",children:t}),jsx(re,{ref:c,className:"--zuz-term-input",autoFocus:true,value:a,variant:s||g||G.Medium,onChange:S=>i(S.target.value),onKeyDown:d})]})]})},Xc=qc;var Yc=({meta:o})=>jsxs(_,{as:"flex aic --command-item",children:[o.icon&&jsx(X,{name:o.icon,as:"--command-icon"}),jsx(H,{children:o.label})]}),Qc=({position:o,onSelect:n,commands:e,visible:r})=>jsx(l,{"aria-hidden":!r,fx:{transition:q.SlideInBottom,duration:.1,when:r},className:"--command-box abs grid",style:{...o},children:e.map(t=>jsx(Yc,{meta:t},`cmd-${t.label.replace(/\s+/,"-")}`))}),gs=Qc;var ys=forwardRef((o,n)=>{let{autoResize:e,maxHeight:r,variant:t,resize:s="none",command:u,commands:m,onInput:p,cmd:a,renderDropdown:i,value:f,defaultValue:c,...g}=o,w=useRef(null),x=useRef(null),{variant:v}=J(true),{style:R,className:h,rest:d}=N(g),{showDropdown:S,dropdownPosition:I,handleKeyDown:P,handleInput:C,handleCommandSelect:E}=useCommandActions({command:u,commands:m,cmd:a,ref:w}),O=useCallback(()=>{let $=w.current;!$||!e||(x.current&&cancelAnimationFrame(x.current),x.current=requestAnimationFrame(()=>{$.style.height="auto";let B=$.scrollHeight;if(r){let K=parseInt(r.toString(),10);isNaN(K)||(B=Math.min(B,K));}$.style.height=`${B}px`,$.style.overflowY=r&&B>=parseInt(r.toString(),10)?"auto":"hidden";}));},[e,r]),M=$=>{p?.($),C($),O();};return useEffect(()=>{O();},[f,c,O]),useEffect(()=>{e&&w.current&&O();},[e,O]),useEffect(()=>()=>{x.current&&cancelAnimationFrame(x.current);},[]),jsxs(l,{as:"rel",children:[jsx("textarea",{className:`--input --textarea --${t||v||G.Medium} flex ${h}`.trim(),style:{...R,resize:s,height:e?"auto":R?.height,overflow:"hidden",transition:e?"none":void 0},onKeyDown:P,onInput:M,ref:$=>{typeof n=="function"?n($):n&&(n.current=$),w.current=$;},value:f,defaultValue:c,...d}),i?i({show:S,position:I,commands:m||[],onSelect:E}):m&&m.length>0&&jsx(gs,{visible:S,commands:m,onSelect:E,position:I})]})});ys.displayName="Zuz.TextArea";var op=ys;var vs=forwardRef((o,n)=>{let{as:e,value:r,color:t,direction:s,...u}=o,m=useRef(null),[p,a]=useState(r||0);return useImperativeHandle(n,()=>({updateValue(i){p.toString().length!==i.toString().length&&a(i);},setValue(i){if(this.updateValue(i),m.current){let f=i.toString().split("");m.current.querySelectorAll(".--wheel-char").forEach((c,g)=>{let w=f[g];if(c instanceof HTMLElement){c.setAttribute("data-value",w);let x=c.querySelector(".--wheel-char-track");x instanceof HTMLElement&&(x.style.setProperty("--v",w),x.offsetWidth);}});}}})),useEffect(()=>{a(r||0);},[r]),jsxs(l,{className:"--text-wheel flex aic rel","aria-hidden":true,as:e,ref:m,...u,children:[(p||0).toString().split("").map((i,f)=>isNaN(parseInt(i,10))?jsx(Q,{className:"--wheel-char wheel-char-symbol grid",children:i},`wheel-char-symbol-${f}`):jsx(Q,{"data-value":i,className:`--wheel-char grid ${f>(p||0).toString().length-3?"--wheel-fraction":""}`.trim(),children:jsxs(Q,{className:`--wheel-char-track --wheel-track-${s||"down"} grid`,style:{"--v":i},children:[jsx(Q,{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(Q,{children:c},`${f}--${g}`)),jsx(Q,{children:!s||s==="down"?9:0})]})},`wheel-char-${f}`)),t&&jsx(l,{className:"abs fillx",style:{zIndex:1,background:`linear-gradient(0deg, ${t}, transparent, transparent, transparent, ${t})`}})]})});vs.displayName="Zuz.TextWheel";var mp=vs;var Ts=forwardRef((o,n)=>{let{title:e,position:r,margin:t,children:s,...u}=o,{style:m,className:p,rest:a}=N(u),[i,f]=useState(false),c=useMemo(()=>r||te.Top,[]),g=useRef(null),w=useRef(null),x=d=>{},v=typeof ResizeObserver<"u"?new ResizeObserver(x):{observe:()=>{},unobserve:()=>{}},R=useDimensions(),h=useMemo(()=>{if(!w.current)return {left:0,top:0};let d=w.current.previousElementSibling;if(d){let S=d.getBoundingClientRect();switch(v.observe(d),c){case te.Top:return {left:S.left+S.width/2,top:S.top-(t||25)};case te.Bottom:return {left:S.left+S.width/2,top:S.top+(t||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}}}},[w.current,R,v]);return useEffect(()=>{},[]),jsxs(l,{ref:g,className:"--with-tooltip rel",onMouseEnter:d=>f(true),onMouseLeave:d=>f(false),children:[s,jsx(l,{ref:w,style:{left:h?.left+"px",top:h?.top+"px"},className:`--tooltip --${r||te.Top} fixed ${p}`.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:Z.EaseInOut,when:i},children:jsx(H,{className:"--text rel",children:e})})]})});Ts.displayName="Zuz.ToolTip";var dp=Ts;var Oo=forwardRef((o,n)=>{let{as:e,meta:r,nodes:t,icons:s,onSelect:u,treeTag:m,selected:p,roots:a,expanded:i,...f}=o,{tag:c,label:g,icon:w,under:x,isHead:v}=r,R=useMemo(()=>a.includes(c),[a]),[h,d]=useState(i),S=()=>{localStorage.setItem(`--tn${m}-${c}`,h?"0":"1"),d(!h);};useEffect(()=>{i||R&&!localStorage.getItem(`--tn${m}-${c}`)?(localStorage.setItem(`--tn${m}-${c}`,"1"),d(true)):d(localStorage.getItem(`--tn${m}-${c}`)=="1");},[]);let I=useMemo(()=>t.filter(P=>P.under==c),[t,c]);return jsxs(l,{className:`--treenode ${R?"--is-root":""} --treenode-${c} flex cols`,children:[jsxs(l,{className:`--node --node-${c} flex aic ${p==c?" --selected":""}`,children:[jsx(_,{skeleton:f.skeleton,onClick:S,className:"--node-aro-btn",disabled:I.length==0,children:s?.arrowClose&&s?.arrowOpen?jsx(X,{skeleton:f.skeleton,className:"--node-aro-icon",name:I.length==0?s?.arrowDisabled||s?.arrowClose:h?s?.arrowOpen:s?.arrowClose}):I.length==0?D.chevronBottom:h?D.chevronBottom:D.chevronRight}),jsxs(_,{className:"--node-meta flex aic",onClick:P=>u(c),children:[(s?.nodeOpen&&s?.nodeClose||R&&s?.rootOpen&&s?.rootClose)&&jsx(X,{skeleton:f.skeleton,className:`--node-icon ${R?"--icon-root":""}`,name:w||(h?R&&s?.rootOpen||s.nodeOpen:R&&s?.rootClose||s?.nodeClose)}),jsx(H,{className:`--node-label ${R?"--node-label-root":""}`.trim(),skeleton:f.skeleton,children:g})]})]}),h&&I.length>0&&jsx(l,{className:`--sub-node tree-sub-node-${c} flex cols`,children:I.map(P=>jsx(Oo,{treeTag:m,selected:p,onSelect:u,icons:s,roots:a,expanded:P.expanded||false,meta:P,nodes:t},`--node-${P.tag}`))})]})});Oo.displayName="TreeItem";var Rs=Oo;var Is=forwardRef((o,n)=>{let{as:e,nodes:r,onNodeSelect:t,tag:s,icons:u,roots:m,selected:p,...a}=o,[i,f]=useState(p);useImperativeHandle(n,()=>({getSelected:()=>i}),[t]);let c=g=>{f(g),t&&t(g);};return useEffect(()=>{i!=p&&f(p);},[p]),jsx(l,{className:"--treeview flex cols",children:r.filter(g=>m.includes(g.tag)).map(g=>jsx(Rs,{treeTag:s?`-${s}`:"",selected:i,onSelect:w=>c(w),icons:u,meta:g,roots:m,expanded:g.expanded||false,skeleton:a.skeleton,nodes:r},`--node-${g.tag}`))})});Is.displayName="Zuz.TreeView";var Cp=Is;String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"").replace(/\s+/g," ")};
|
|
13
|
+
export{ie as ALERT,Bt as AVATAR,Ja as Accordion,ni as ActionBar,ii as Alert,Pi as AutoComplete,ki as Avatar,Hi as Badge,l as Box,cl as Bubble,Jr as BubbleMediaType,Qr as BubbleStatus,_ as Button,Gr as CHART,ve as CHECKBOX,Np as COLORTHEME,so as Calendar,rl as Chart,tt as CheckBox,wl as CodeBlock,Hl as ColorScheme,Xt as ContextMenu,zl as CookiesConsent,Be as Cover,ql as CropShape,Wl as Cropper,Yl as Crumb,Bp as DATATYPE,De as DIALOG,Vo as DIALOG_ACTION_POSITION,ne as DRAWER_SIDE,em as DatePicker,_t as Dialog,qt as Drawer,ft as FILTER,we as FORMVALIDATION,Lp as FORMVALIDATION_STYLE,nm as Fab,im as Filters,Sm as Form,Bm as Group,X as Icon,Je as Image,re as Input,vo as KeyboardKeys,On as KeysLabelMap,Mn as KeysMap,et as Label,$t as LayersProvider,Me as List,Am as NetworkStatus,Ke as ORIGIN,Ip as OriginType,Ee as Overlay,Lt as POSITION,Op as PROGRESS,Co as Pagination,wo as PaginationStyle,Gm as Password,Qm as PinInput,te as Position,io as ProgressBar,Ot as RADIO,tc as Radio,le as SHEET,Mt as SHEET_ACTION_POSITION,Rp as SKELETON,ut as SLIDER,Ep as SORT,me as SPINNER,Kt as ScrollView,mc as Search,gc as Select,ot as SelectTabs,um as Sheet,uo as Slider,Q as Span,he as Spinner,Mp as Status,xc as Switch,q as TRANSITIONS,Z as TRANSITION_CURVES,Kc as TabView,Lc as Table,kc as TableOfContents,Xc as Terminal,H as Text,mp as TextWheel,op as Textarea,Us as ThemeProvider,fr as ToastDefaultTitle,Ft as ToastProvider,ur as ToastType,dp as ToolTip,Cp as TreeView,G as Variant,Ue as animationTransition,kt as buildClassString,_o as buildWithStyles,jp as css,Dt as getAnimationCurve,eu as getAnimationTransition,Bs as getZuzMap,Ln as isKeyCombination,zo as setZuzMap,N as useBase,Wa as useContextMenu,Da as useDialog,za as useDrawer,se as useFx,Za as useMorph,We as usePosition,Qt as useToast};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zuzjs/ui",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.12",
|
|
4
4
|
"description": "ZuzJS UI Library",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -38,8 +38,8 @@
|
|
|
38
38
|
"dist"
|
|
39
39
|
],
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@zuzjs/core": "^0.3.
|
|
42
|
-
"@zuzjs/hooks": "^0.1.
|
|
41
|
+
"@zuzjs/core": "^0.3.4",
|
|
42
|
+
"@zuzjs/hooks": "^0.1.4",
|
|
43
43
|
"chokidar": "^5.0.0",
|
|
44
44
|
"commander": "^14.0.2",
|
|
45
45
|
"date-fns": "^4.1.0",
|
|
File without changes
|
|
File without changes
|