@zuzjs/ui 1.0.63 → 1.0.65
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/css/styles.css +1 -1
- package/dist/index.cjs +6 -6
- package/dist/index.d.cts +155 -135
- package/dist/index.d.ts +155 -135
- package/dist/index.js +5 -5
- package/package.json +2 -2
- /package/dist/{chunk-7G2SIFGZ.cjs → chunk-7VYMG5ZY.cjs} +0 -0
- /package/dist/{chunk-Y3JDFLHY.js → chunk-R5D23PK6.js} +0 -0
package/dist/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {f,e,g,d,h,c}from'./chunk-
|
|
1
|
+
import {f as f$1,e,g,d,h,c}from'./chunk-R5D23PK6.js';export{e as PACKAGE_NAME,f as cleanProps,g as splitAtoms}from'./chunk-R5D23PK6.js';import {createContext,forwardRef,useMemo,Fragment,useState,useRef,useImperativeHandle,useEffect,useCallback,createElement,isValidElement,useId,useLayoutEffect,useContext,useSyncExternalStore,startTransition}from'react';import {useDelayed,useScrollbar,useDebounce,useImage,useResizeObserver,useLineChart,useImageCropper,CropShape,useNetworkStatus,useIntersectionObserver,useCarousel,useTimer,useMediaPlayer,AnchorType,useAnchorPosition,KeyCode,useShortcuts,useCommandActions}from'@zuzjs/hooks';import {createPortal}from'react-dom';import {uuid,MD5,withPost,_ as _$1,clamp,timeSince,checkPasswordStrength,removeDuplicateWords,PubSub,toHash,numberInRange,copyToClipboard}from'@zuzjs/core';import {jsx,jsxs,Fragment as Fragment$1}from'react/jsx-runtime';import {addPropsToChildren}from'@zuzjs/core/react';import {startOfMonth,endOfMonth,startOfWeek,endOfWeek,eachDayOfInterval,format,isSameMonth,isSameDay,isToday,addHours,addDays,addWeeks}from'date-fns';var Ar={Circle:"CIRCLE",Square:"SQUARE"},Ef={Default:"DEFAULT",Circle:"CIRCLE"},Nf={Light:"light",Dark:"dark",System:"system"},Ke={Default:"DEFAULT",Switch:"SWITCH"},St={Auto:"auto",Top:"top",Bottom:"bottom",Left:"left",Right:"right"},be=St,wt=AnchorType,Bf=wt,kf={Top:"top",TopStart:"top-start",TopCenter:"top-center",TopEnd:"top-end",Bottom:"bottom",BottomStart:"bottom-start",BottomCenter:"bottom-center",BottomEnd:"bottom-end",Left:"left",LeftStart:"left-start",LeftCenter:"left-center",LeftEnd:"left-end",Right:"right",RightStart:"right-start",RightCenter:"right-center",RightEnd:"right-end"},U={XSmall:"xs",Small:"sm",Medium:"md",Large:"lg",XLarge:"xl"},Lf={Asc:"ASC",Desc:"DESC"},Mf={String:"STRING",Number:"NUMBER",Boolean:"BOOLEAN",Array:"ARRAY",Object:"OBJECT",Date:"DATE",Time:"TIME",DateTime:"DATETIME",File:"FILE"},Of={Dots:"DOTS"},Qe={IPV4:"IPV4",IPV6:"IPV6",Email:"EMAIL",Uri:"URI",Password:"PASSWORD",MatchField:"MATCHFIELD",Pattern:"*",GreaterThan:"GREATER_THAN",NotEmpty:"NOT_EMPTY",NotMinusOne:"NOT_MINUS_ONE"},ke={Success:"success",Error:"error",Warning:"warning",Info:"info"},oe={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",SlideInTopScale:"SLIDE_FROM_BOTTOM_SCALE",SlideInBottomScale:"SLIDE_FROM_BOTTOM_SCALE",SlideInLeft:"SLIDE_FROM_LEFT"},Vf={Success:"success",Error:"error",Idle:"idle",Dead:"dead"},Le={Dialog:"DIALOG",Default:"DEFAULT",Error:"ERROR",Success:"SUCCESS",Warn:"WARN",Promise:"PROMISE",Confirm:"CONFIRM"},Je=Le,Ro={Left:"LEFT",Right:"RIGHT",Center:"CENTER"},$r=Ro,Df={Bar:"BAR",Ring:"RING"},Io={Default:"range",Text:"number"},Eo={Default:"DEFAULT",Card:"CARD"},Zt={Gooey:"gooey"},Pe={Left:"LEFT",Right:"RIGHT",Top:"TOP",Bottom:"BOTTOM"};var Fr=Symbol.for("zuz.global.map"),zr=e=>{globalThis[Fr]=e;},ni=()=>globalThis[Fr]||{},No=e$1=>{let r=Array.isArray(e$1)?e$1.join(" "):e$1;if(!r||typeof r!="string")return "";let t=ni();return process.env.NODE_ENV==="development"&&Object.keys(t).length===0&&console.warn(`[${e}] No utility map detected. Classes will not be hashed. `,"Ensure you call setZuzMap() or use <ThemeProvider zuzMap={...} />."),g(r).filter(Boolean).map(o=>{let s=o.match(/^([&@][\w-]+)\((.*)\)$/);if(s){let[a,i,m]=s;return g(m).map(l=>{let c=`${i}(${l})`;return t[c]||l}).join(" ")}return t[o]||o}).join(" ")},td=e=>{let r=Array.isArray(e)?e.join(" "):e;return !r||typeof r!="string"?"":No(r)},_r=e=>{let r={};for(let t in e){let n=e[t];if(t.startsWith("--")){r[t]=n;continue}let o=d[t]?.toString()??t;if(o==="x"||o==="translateX"){let s=r.translate?.split(" ")??["0px","0px"];r.translate=`${h.addUnitsSafely(t,n)} ${s[1]??"0px"}`;}else if(o==="y"||o==="translateY"){let s=r.translate?.split(" ")??["0px","0px"];r.translate=`${s[0]??"0px"} ${h.addUnitsSafely(t,n)}`;}else c.includes(o)?r[o]=h.addUnitsSafely(t,n):r[o]=n;}return r},Bo=e=>{if(!e)return "linear";switch(e.toUpperCase()){case oe.Bounce:return "var(--bounce)";case oe.Liquid:return "var(--liquid)";case oe.Spring:return "var(--spring)";case oe.EaseInOut:return "ease-in-out";case oe.EaseOutBack:return "ease-out-back";default:return "linear"}},Ct=(e,r=0,t=0)=>{let n={},o={},s=r||20,a=t||0;switch(e){case Q.SlideInLeft:case Q.SlideInRight:n={"--fx-x":e===Q.SlideInLeft?`-${s}px`:`${s}px`,opacity:0},o={"--fx-x":`${a}px`,opacity:1};break;case Q.SlideInTop:case Q.SlideInBottom:n={"--fx-y":e===Q.SlideInTop?`-${s}px`:`${s}px`,opacity:0},o={"--fx-y":`${a}px`,opacity:1};break;case Q.SlideInTopScale:case Q.SlideInBottomScale:n={"--fx-y":e===Q.SlideInTopScale?`-${s}px`:`${s}px`,scale:1.1},o={"--fx-y":`${a}px`,scale:1};break;case Q.ScaleIn:n={scale:0,opacity:0},o={scale:1,opacity:1};break;case Q.FadeIn:n={opacity:0},o={opacity:1};break}return {from:n,to:o}},od=(e,r,t)=>{let{from:n,to:o}=Ct(e);return r?{...n,...o}:t?n:o};var ai=(e,r)=>{let t=useRef([]),n=useRef(false);return useEffect(()=>{e?.when||(n.current=false);},[e?.transition]),useEffect(()=>{let o=r?.current;if(!o||!e||!e.clearAtEnd)return;let s=a=>{t.current.includes(a.propertyName)&&e.clearAtEnd===true&&(o.style.transform="",o.style.filter="",t.current.forEach(i=>o.style.removeProperty(i)));};return o.addEventListener("transitionend",s),()=>o.removeEventListener("transitionend",s)},[e,r]),useEffect(()=>{if(typeof window>"u"||!r?.current)return;let o=r.current;(e?.scroll||e?.mouse)&&(o.style.willChange="transform",o.style.translate="var(--fx-x, 0px) var(--fx-y, 0px)",o.style.transition=`translate 0.1s ${e.curve?Bo(e.curve):"var(--spring)"}`);},[e,r]),useMemo(()=>{if(!e)return {style:{}};let{transition:o,from:s,to:a,exit:i,when:m,duration:l=.3,delay:c=0,curve:d,margin:u=0,offset:p=20,watch:g=[]}=e,T=m===false&&!n.current;m===true&&(n.current=true);let x={},{from:P,to:S}=o?Ct(o,p,u):{from:s||{},to:a||{}};x=m===void 0?{...P,...S}:m?{...S}:i||P;let R=Bo(d),h=[],v=_r(x);t.current=Object.keys(v);let y={...v};return Object.keys(v).forEach(b=>{let E=b.startsWith("--")?"all":b;h.includes(E)||h.push(`${E} ${l}s ${R} ${c}s`);}),g.forEach(b=>{h.includes(b)||h.push(`${b} 0.1s ${R} 0s`);}),{style:{...y,transition:T?"none":h.join(", "),opacity:T?0:y.opacity,pointerEvents:T?"none":y.pointerEvents}}},[e,e?.when,e?.watch])},ve=ai;var Wt=null,ii=(e,r)=>{let{as:t,fx:n,busy:o=false,stripes:s,transition:a,skeleton:i,className:m,propsToRemove:l,draggable:c,dragOptions:d,style:u,...p}=e||{},g=typeof window<"u",T={},x={};if(c&&g&&!Wt&&(import('@zuzjs/hooks').then(v=>{Wt=v.useDrag;}).catch(v=>{console.error("Error loading useDrag:",v);}),Wt)){let v=Wt(d);T={onMouseDown:v.onMouseDown},x={transform:`translate(${v.position.x}px, ${v.position.y}px)`};}let P=[m,o===true?"--is-busy":"",s?`--has-stripes --stripes-${s}`:""].filter(Boolean).join(" "),S=a?{transition:a,duration:.3}:n||{},{style:R}=ve(S,r),h=No(t??"");return {style:{...u,...R,...x},className:[P,h||"",i?.enabled?"--skeleton":"",c?"--draggable":""].join(" ").trim(),rest:{...T,...f$1(p,l?[...l,"skeleton"]:["skeleton"])}}},B=ii;var Wr="(prefers-color-scheme: dark)",mi=typeof window>"u",Ur=createContext(void 0),Oo=e=>{let r=useContext(Ur);if(!r){if(e===true)return;throw new Error("useColorScheme must be used within a ThemeProvider")}return r},j=Oo,pi=({children:e,storageKey:r="--ucs",forceTheme:t,zuzMap:n,...o})=>(n&&zr(n),jsx(ui,{storageKey:r,forceTheme:t,...o,children:e})),ui=({children:e,storageKey:r,forceTheme:t,...n})=>{let[o,s]=useState(()=>t||Gr(r,"system")),[a,i]=useState(()=>t||Gr(r)),m=u=>(u||(u=window.matchMedia(Wr)),u.matches?"dark":"light"),l=useCallback(u=>{let p=u=="system"?m():u,g=document.documentElement;g.setAttribute("color-scheme",p),g.style.colorScheme=p,i(p);},[m]),c=useCallback(u=>{s(u),localStorage.setItem(r,u),l(u);},[o]),d=useCallback(u=>{let p=m(u);i(p),o==="system"&&l("system");},[o]);return useEffect(()=>{o==null&&window.localStorage.getItem(r);},[o]),useEffect(()=>{window.matchMedia(Wr).addEventListener("change",d);},[d]),useEffect(()=>{let u=p=>{p.key==r&&(p.newValue?c(p.newValue):c("system"));};return window.addEventListener("storage",u),()=>window.removeEventListener("storage",u)},[c]),useEffect(()=>{l(t||o||"system");},[o]),jsxs(Ur,{value:{colorScheme:o,resolvedScheme:a,setColorScheme:c,...n},children:[t?null:jsx("script",{suppressHydrationWarning:true,dangerouslySetInnerHTML:{__html:`const el = document.documentElement
|
|
2
2
|
const themes = ['light', 'dark']
|
|
3
3
|
let theme = localStorage.getItem(\`${r}\`) || "system";
|
|
4
4
|
if (theme === "system") {
|
|
5
5
|
theme = window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
|
|
6
6
|
}
|
|
7
7
|
document.documentElement.setAttribute("color-scheme", theme);
|
|
8
|
-
document.documentElement.style.colorScheme = theme;`}}),jsx(Bo,{children:e})]})},_r=(e,r)=>{if(li)return;let t;try{t=localStorage.getItem(e)||void 0;}catch{}return t||r};var Zr=({ref:e,...r})=>{let{style:t,...n}=r,{style:o,className:s,rest:a}=B(n);return jsx("span",{ref:e,style:t,className:s,...a})};Zr.displayName="Zuz.Span";var me=Zr;var Gr=forwardRef((e,r)=>{let{name:t,pathCount:n,variant:o,color:s,size:a,...l}=e,{variant:u}=j(true),{className:c,style:i,rest:d}=B(l);return jsx("div",{style:{color:s,...i,...a?{fontSize:a}:{}},className:`icon-${t} --icon --${o||u||U.Small} ${c}`.trim(),ref:r,...d,children:Array(n||0).fill(0).map((f,m)=>jsx(me,{className:`path${m+1}`},`${t}-layer-${m}`))})});Gr.displayName="Zuz.Icon";var te=Gr;var ve={Simple:"SIMPLE",Roller:"ROLLER",Wave:"Wave"};var Ur=e=>{let{type:r,variant:t,color:n,...o}=e,{className:s,style:a,rest:l}=B(o),{spinner:u}=j(true),c=()=>{switch(r||u?.type||ve.Simple){case ve.Simple:return null;case ve.Wave:return jsxs(Fragment$1,{children:[jsx(p,{as:"--bar --bar1"}),jsx(p,{as:"--bar --bar2"}),jsx(p,{as:"--bar --bar3"})]});case ve.Roller:return null}};return jsx(p,{className:`${s} --spinner --${(r||u?.type||ve.Simple).toLowerCase()} --${t||u?.variant||U.Small}`.trim(),style:{...a},...l,children:c()})};Ur.displayName="Zuz.Spinner";var Ce=Ur;var Wt={Loading:"loading",Normal:"normal"};var Xr=({ref:e,...r})=>{let{reset:t,kind:n="solid",variant:o,icon:s,iconSize:a,children:l,withLabel:u,spinner:c,state:i,disabled:d,...f}=r,{style:m,className:g,rest:P}=B(f),{variant:x}=j(true);return jsxs("button",{className:removeDuplicateWords(`--button --${n} --${o||x} flex aic ${t?"":"jcc"} ${s?"--with-icon":""} ${g}`).trim().replace(/\s+/g," "),style:m,ref:e,disabled:i==Wt.Loading||r.skeleton?.enabled||d,...P,children:[i==Wt.Loading&&jsx(Ce,{variant:o||x,type:c||ve.Simple}),(!i||i==Wt.Normal)&&jsxs(Fragment$1,{children:[s&&jsx(te,{variant:a,name:s}),u===true?jsx(me,{children:l}):l]})]})};Xr.displayName="Zuz.Button";var _=Xr;var Yr=({ref:e,...r})=>{let{h:t,html:n,children:o,lines:s,tfx:a,delay:l=0,duration:u=.5,stagger:c=.05,repeat:i=true,reveal:d=false,hover:f=false,...m}=r,{style:g,className:P,rest:x}=B(m),T=useRef(null),[S,R]=useState(false),[h]=useIntersectionObserver([T],{threshold:[1]}),v=useMemo(()=>{if(g?.opacity!==void 0)return g.opacity;if(typeof r.as=="string"){let A=r.as.match(/opacity:([\d.]+)/);if(A)return A[1]}return 1},[r.as,g?.opacity]),y=useMemo(()=>a?f?S:d?h===1:true:false,[a,f,S,d,h]);useEffect(()=>{e&&(typeof e=="function"?e(T.current):e.current=T.current);},[e]);let b=`h${r.h||1}`,E=useMemo(()=>typeof o=="string"?o:Array.isArray(o)&&o.length===1&&typeof o[0]=="string"?o[0]:null,[o]),$=useMemo(()=>{let A=Array.isArray(r.as)?r.as.join(" "):r.as||"";return typeof A=="string"&&A.includes("text-clip")},[r.as]);useLayoutEffect(()=>{if(!$||!T.current||E===null)return;let A=T.current,M=0,O=0,F=()=>{let k=A.getBoundingClientRect(),X=getComputedStyle(A).backgroundImage,Y=k.width;A.querySelectorAll(".--fx-char").forEach(z=>{let W=z.getBoundingClientRect().left-k.left;z.style.backgroundImage=X,z.style.backgroundRepeat="no-repeat",z.style.backgroundSize=`${Y}px 100%`,z.style.backgroundPosition=`-${W}px 0`,z.style.backgroundClip="text",z.style.webkitBackgroundClip="text",z.style.color="transparent";});},Z=()=>{cancelAnimationFrame(M),cancelAnimationFrame(O),M=requestAnimationFrame(()=>{O=requestAnimationFrame(F);});};Z();let I=new ResizeObserver(Z);return I.observe(A),typeof document<"u"&&"fonts"in document&&document.fonts?.ready.then(Z),window.addEventListener("resize",Z),()=>{cancelAnimationFrame(M),cancelAnimationFrame(O),I.disconnect(),window.removeEventListener("resize",Z);}},[$,E,a,y]);let L=useMemo(()=>n?jsx(me,{dangerouslySetInnerHTML:{__html:n}}):a&&E!==null?E.split("").map((A,M)=>{let O=A===" ",Z=["typewriter","reveal","fog","slide","pop"].includes(a)?"1":i?"infinite":"1";return jsx(me,{"data-char":A,className:`--fx-char -fx ${y?`--fx-${a}`:""}`,style:{"--delay":`${l+M*c}s`,"--duration":`${u}s`,"--iteration":Z,"--target-opacity":v,display:O?"inline":"inline-block",whiteSpace:"pre",opacity:!y&&a==="typewriter"?0:void 0},children:A},M)}):o,[o,n,a,E,y,l,c,u,i]);return jsx(b,{ref:T,onMouseEnter:()=>f&&R(true),onMouseLeave:()=>f&&R(false),style:a?{...g,display:a?"flex":g?.display,flexWrap:a?"wrap":g?.flexWrap,opacity:a&&!y?0:a?1:g?.opacity,transition:a?"opacity 0.4s ease":void 0}:g,className:`${P} ${a?"--text-fx -fx":""}`.trim(),...x,children:L})};Yr.displayName="Zuz.Text";var K=Yr;var Ci=e=>{let{label:r,labelColor:t,icon:n,iconColor:o,index:s,className:a,onSelect:l}=e;return r=="-"?jsx(p,{className:"--line"}):jsxs(_,{reset:true,onClick:u=>l?.(e),className:`--item ${a||""}`.trim(),children:[jsx(p,{as:"--icon",children:jsx(te,{name:n,className:"--ico",style:o?{color:o}:{}})}),jsx(K,{className:"--lbl flex aic",style:t?{color:t}:{},children:r})]})},jr=Ci;var en=({ref:e,...r})=>{let{id:t,as:n,fx:o,offsetX:s,offsetY:a,parent:l,event:u,arrow:c,when:i,items:d,header:f,footer:m,origin:g=St.TopRight,...P}=r,[x,T]=useState(false),[S,R]=useState(d||[]),{position:h,targetRef:v,calculatedAnchor:y}=useAnchorPosition(l?.current,u,{offsetX:s,offsetY:a,preferredAnchor:g}),E=l&&h.top>l.current.getBoundingClientRect().bottom?"--arrow-top":"--arrow-bottom",$=useMemo(()=>{let Z=y.toLowerCase();return Z.includes("left")?"--arrow-left":Z.includes("right")?"--arrow-right":"--arrow-center"},[y]),L=h.top!==0||h.left!==0;useEffect(()=>{i&&L?T(true):i||T(false);},[i,L]);let{className:A,style:M,rest:O}=B(P),F=be({...o?.transition?{transition:o.transition??Q.SlideInBottom}:{from:{opacity:0,scale:.8,y:-10},to:{opacity:1,scale:1,y:0}},curve:o?.curve??oe.EaseInOut,duration:o?.duration??.05,when:x&&L});return jsxs(p,{ref:v,className:`--contextmenu ${c||l!=null?`--has-arrow ${E} ${$}`:""} abs flex cols ${A}`.trim(),"aria-hidden":!x,style:{...M,...F.style,top:h.top,left:h.left,visibility:L?"visible":"hidden",transformOrigin:y},...O,children:[typeof f=="function"?createElement(f):f,S.map((Z,I)=>jsx(jr,{...Z,index:I},`context-${Z.label.toLowerCase()}-${I}`)),typeof m=="function"?createElement(m):m]})};en.displayName="Zuz.ContextMenu";var Mo=en;var tn=forwardRef((e,r)=>{let{children:t,fx:n,when:o,fxDelay:s,fxStep:a,classToIgnore:l,...u}=e,c=j(true),i=useDelayed(),d=n||c?.group?.fx,f=s||c?.group?.fxDelay,m=a||c?.group?.fxStep,g=l||c?.group?.classToIgnore||"-fx",P=useMemo(()=>d?addPropsToChildren(t,x=>{if(x.type===Fragment)return false;let T=x.props||{},S="fx"in T,R="tfx"in T,h=T.as?Array.isArray(T.as)?T.as.join(" "):T.as:T.className||"";return !(typeof h=="string"&&h.includes(g))&&(!S||R)},(x,T)=>{let S=(f??0)+x*(m??.1),R=T.props||{};return "tfx"in R?{delay:(R.delay??0)+S}:{fx:{...d,delay:S,when:o??(n?.when||i)}}}):t,[t,o,i,d,f,m,g,n]);return jsx(p,{className:"--group",ref:r,...u,children:P})});tn.displayName="Zuz.Group";var Oo=tn;var rn=forwardRef((e,r)=>{let{message:t,spinner:n,spinnerSize:o,color:s,when:a,hideMessage:l,...u}=e,{className:c,style:i,rest:d}=B(u),{spinner:f}=j(true);return "when"in e&&e.when==false?null:jsxs(Oo,{fx:{transition:Q.SlideInBottom,curve:oe.Liquid,duration:.5},fxDelay:.1,fxStep:.05,className:`--cover flex aic jcc cols abs fill nope nous ${c}`.trim(),style:{...i,backgroundColor:"var(--cover-bg)"},...d,children:[jsx(Ce,{variant:o||f?.variant||U.Small,type:n||f?.type||ve.Simple}),!l&&jsx(K,{className:"--label",tfx:"fade",style:{color:"var(--cover-label)"},children:t||"loading"})]})});rn.displayName="Zuz.Cover";var Me=rn;var Vo=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(r){return this.stack[this.stack.length-1]===r}push(r){this.stack.includes(r)||(this.stack.push(r),this.updateScrollLock());}pop(r){this.stack=this.stack.filter(t=>t!==r),this.updateScrollLock();}handleEscape(){let r=this.stack[this.stack.length-1];return r?(r(),true):false}get count(){return this.stack.length}},ke=new Vo;var nn=forwardRef((e,r)=>{let{when:t,...n}=e;return jsx(p,{ref:r,"aria-hidden":!t,className:"--overlay fixed fill",fx:{transition:Q.FadeIn,when:t},...n})});nn.displayName="Zuz.Overlay";var Ye=nn;var Fi=({action:e,render:r=true,message:t=""})=>jsx(p,{as:`--body flex aic rel ${e?"":"--no-action"}`.trim(),children:r?t:null}),sn=Fi;var _i=({action:e,actionPosition:r,dialogID:t,variant:n})=>jsx(p,{as:`--footer flex aic rel ${r?r==Vr.Center?"jcc":"":"jce"}`.trim(),children:e.map((o,s)=>jsx(_,{variant:n,onClick:a=>o.handler?o.handler():o.onClick?o.onClick():console.log("onClick Handler missing"),as:"--action",children:o.label},`dialog-${t}-action-${o.key}`))}),ln=_i;var Ki={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"})," "]}),[Ne.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"})}),[Ne.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"})}),[Ne.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"})}),[Ne.Success]:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",children:jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"})}),layers:jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 24 24",fill:"none",children:[jsx("path",{d:"M19.3697 4.89109L13.5097 2.28109C12.6497 1.90109 11.3497 1.90109 10.4897 2.28109L4.62969 4.89109C3.14969 5.55109 2.92969 6.45109 2.92969 6.93109C2.92969 7.41109 3.14969 8.31109 4.62969 8.97109L10.4897 11.5811C10.9197 11.7711 11.4597 11.8711 11.9997 11.8711C12.5397 11.8711 13.0797 11.7711 13.5097 11.5811L19.3697 8.97109C20.8497 8.31109 21.0697 7.41109 21.0697 6.93109C21.0697 6.45109 20.8597 5.55109 19.3697 4.89109Z",fill:"#292D32"}),jsx("path",{d:"M12.0003 17.04C11.6203 17.04 11.2403 16.96 10.8903 16.81L4.15031 13.81C3.12031 13.35 2.32031 12.12 2.32031 10.99C2.32031 10.58 2.65031 10.25 3.06031 10.25C3.47031 10.25 3.80031 10.58 3.80031 10.99C3.80031 11.53 4.25031 12.23 4.75031 12.45L11.4903 15.45C11.8103 15.59 12.1803 15.59 12.5003 15.45L19.2403 12.45C19.7403 12.23 20.1903 11.54 20.1903 10.99C20.1903 10.58 20.5203 10.25 20.9303 10.25C21.3403 10.25 21.6703 10.58 21.6703 10.99C21.6703 12.11 20.8703 13.35 19.8403 13.81L13.1003 16.81C12.7603 16.96 12.3803 17.04 12.0003 17.04Z",fill:"#292D32"}),jsx("path",{d:"M12.0003 22.0009C11.6203 22.0009 11.2403 21.9209 10.8903 21.7709L4.15031 18.7709C3.04031 18.2809 2.32031 17.1709 2.32031 15.9509C2.32031 15.5409 2.65031 15.2109 3.06031 15.2109C3.47031 15.2109 3.80031 15.5409 3.80031 15.9509C3.80031 16.5809 4.17031 17.1509 4.75031 17.4109L11.4903 20.4109C11.8103 20.5509 12.1803 20.5509 12.5003 20.4109L19.2403 17.4109C19.8103 17.1609 20.1903 16.5809 20.1903 15.9509C20.1903 15.5409 20.5203 15.2109 20.9303 15.2109C21.3403 15.2109 21.6703 15.5409 21.6703 15.9509C21.6703 17.1709 20.9503 18.2709 19.8403 18.7709L13.1003 21.7709C12.7603 21.9209 12.3803 22.0009 12.0003 22.0009Z",fill:"#292D32"})]}),play:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:jsx("path",{d:"M8 5v14l11-7z"})}),pause:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:jsx("path",{d:"M6 19h4V5H6zm8-14v14h4V5z"})}),next:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:jsx("path",{d:"m6 18 8.5-6L6 6zM16 6v12h2V6z"})}),prev:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:jsx("path",{d:"M6 6h2v12H6zm3.5 6 8.5 6V6z"})}),volumeHigh:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:jsx("path",{fill:"#292D32",d:"M22 11.25h-1.25V10c0-.41-.34-.75-.75-.75s-.75.34-.75.75v1.25H18c-.41 0-.75.34-.75.75s.34.75.75.75h1.25V14c0 .41.34.75.75.75s.75-.34.75-.75v-1.25H22c.41 0 .75-.34.75-.75s-.34-.75-.75-.75M14.02 3.782c-1.12-.62-2.55-.46-4.01.45l-2.92 1.83c-.2.12-.43.19-.66.19H5c-2.42 0-3.75 1.33-3.75 3.75v4c0 2.42 1.33 3.75 3.75 3.75h1.4300000000000002c.23 0 .46.07.66.19l2.92 1.83c.88.55 1.74.82 2.54.82a3 3 0 0 0 1.47-.37c1.11-.62 1.73-1.91 1.73-3.63v-9.18c0-1.72-.62-3.01-1.73-3.63"})}),volumeMute:jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[jsx("path",{fill:"#292D32",d:"M18 16.75a.75.75 0 0 1-.6-1.2 5.93 5.93 0 0 0 .72-5.84.75.75 0 0 1 .4-.98c.38-.16.82.02.98.4 1.02 2.42.67 5.23-.9 7.33-.15.19-.37.29-.6.29"}),jsx("path",{fill:"#292D32",d:"M19.828 19.25a.75.75 0 0 1-.6-1.2c2.14-2.85 2.61-6.67 1.23-9.96a.75.75 0 0 1 .4-.98c.38-.16.82.02.98.4 1.59 3.78 1.05 8.16-1.41 11.44-.14.2-.37.3-.6.3M14.04 12.958c.63-.63 1.71-.18 1.71.71v2.93c0 1.72-.62 3.01-1.73 3.63a3 3 0 0 1-1.47.37c-.8 0-1.66-.27-2.54-.82l-.64-.4c-.54-.34-.63-1.1-.18-1.55zM21.77 2.229c-.3-.3-.79-.3-1.09 0l-4.95 4.95c-.06-1.6-.66-2.8-1.72-3.39-1.12-.62-2.55-.46-4.01.45l-2.91 1.82c-.2.12-.43.19-.66.19H5c-2.42 0-3.75 1.33-3.75 3.75v4c0 2.42 1.33 3.75 3.75 3.75h.16l-2.94 2.94c-.3.3-.3.79 0 1.09.16.14.35.22.55.22s.39-.08.54-.23l18.46-18.46c.31-.3.31-.78 0-1.08"})]}),plus:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:jsx("path",{d:"M28 14H18V4a2 2 0 0 0-4 0v10H4a2 2 0 0 0 0 4h10v10a2 2 0 0 0 4 0V18h10a2 2 0 0 0 0-4"})}),add:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:jsx("path",{d:"M12 2C6.49 2 2 6.49 2 12s4.49 10 10 10 10-4.49 10-10S17.51 2 12 2m4 10.75h-3.25V16c0 .41-.34.75-.75.75s-.75-.34-.75-.75v-3.25H8c-.41 0-.75-.34-.75-.75s.34-.75.75-.75h3.25V8c0-.41.34-.75.75-.75s.75.34.75.75v3.25H16c.41 0 .75.34.75.75s-.34.75-.75.75"})}),chevronUp:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 24 24",children:jsx("path",{d:"m7 14 5-5 5 5z"})}),chevronBottom:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 24 24",children:jsx("path",{d:"m7 10 5 5 5-5z"})}),chevronRight:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 24 24",children:jsx("path",{d:"m10 17 5-5-5-5v10z"})}),chevronLeft:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 24 24",children:jsx("path",{d:"m14 7-5 5 5 5V7z"})}),chevronRightOutline:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 24 24",children:jsx("path",{d:"M8.59 16.59 13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"})}),chevronLeftOutline:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 24 24",children:jsx("path",{d:"M15.41 16.59 10.83 12l4.58-4.59L14 6l-6 6 6 6 1.41-1.41z"})}),chevronUpOutline:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 24 24",children:jsx("path",{d:"M7.41 15.41 12 10.83l4.59 4.58L18 14l-6-6-6 6z"})}),chevronDownOutline:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 24 24",children:jsx("path",{d:"M7.41 8.59 12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z"})}),bezier:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 24 24",fill:"none",children:jsx("path",{d:"M19.14 7.72C19.43 8.47 20.15 9 21 9C22.1 9 23 8.1 23 7C23 5.9 22.1 5 21 5C20.15 5 19.43 5.53 19.14 6.28C19.09 6.27 19.05 6.25 19 6.25H15V5.5C15 4.68 14.32 4 13.5 4H10.5C9.68 4 9 4.68 9 5.5V6.25H5C4.95 6.25 4.91 6.27 4.86 6.28C4.57 5.53 3.85 5 3 5C1.9 5 1 5.9 1 7C1 8.1 1.9 9 3 9C3.85 9 4.57 8.47 4.86 7.72C4.91 7.73 4.95 7.75 5 7.75H7.57C5.52 9.27 4.25 11.79 4.25 14.5C4.25 14.67 4.26 14.83 4.28 15H4C3.17 15 2.5 15.67 2.5 16.5V18.5C2.5 19.33 3.17 20 4 20H6C6.22 20 6.42 19.95 6.61 19.86C7.13 19.64 7.5 19.11 7.5 18.5V16.5C7.5 15.67 6.83 15 6 15H5.77C5.77 14.97 5.78 14.94 5.78 14.91C5.76 14.77 5.76 14.64 5.76 14.5C5.76 12.03 7.03 9.77 9.02 8.6C9.06 9.37 9.71 10 10.5 10H13.5C14.29 10 14.94 9.37 14.99 8.6C16.98 9.77 18.25 12.04 18.25 14.5C18.25 14.64 18.24 14.77 18.23 14.91C18.23 14.94 18.24 14.97 18.24 15H18C17.17 15 16.5 15.67 16.5 16.5V18.5C16.5 19.11 16.87 19.64 17.39 19.86C17.58 19.95 17.78 20 18 20H20C20.83 20 21.5 19.33 21.5 18.5V16.5C21.5 15.67 20.83 15 20 15H19.72C19.74 14.83 19.75 14.67 19.75 14.5C19.75 11.79 18.48 9.27 16.43 7.75H19C19.05 7.75 19.09 7.73 19.14 7.72Z",fill:"#292D32"})}),mouse:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 24 24",fill:"none",children:jsx("path",{d:"M13.2978 2.11468C13.0064 2.06339 12.75 2.29593 12.75 2.59185V5.45262C12.75 5.65098 12.8709 5.82564 13.0359 5.93583C13.5391 6.27202 13.87 6.84597 13.87 7.49906V9.49906C13.87 10.5291 13.03 11.3791 12 11.3791C10.96 11.3791 10.12 10.5291 10.12 9.49906V7.49906C10.12 6.84578 10.4583 6.27168 10.9639 5.93554C11.1291 5.82572 11.25 5.65098 11.25 5.45262V2.59249C11.25 2.29634 10.9935 2.0637 10.7019 2.11513C9.15243 2.38834 7.76579 3.13327 6.7 4.19906C5.34 5.55906 4.5 7.43906 4.5 9.49906V14.4991C4.5 18.6291 7.87 21.9991 12 21.9991C16.13 21.9991 19.5 18.6291 19.5 14.4991V9.49906C19.5 5.80857 16.813 2.73328 13.2978 2.11468Z",fill:"#292D32"})}),addKey:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 24 24",fill:"none",children:jsx("path",{d:"M20.9498 14.55L14.5598 20.94C13.1598 22.34 10.8598 22.34 9.44977 20.94L3.05977 14.55C1.65977 13.15 1.65977 10.85 3.05977 9.44L9.44977 3.05C10.8498 1.65 13.1498 1.65 14.5598 3.05L20.9498 9.44C22.3498 10.85 22.3498 13.15 20.9498 14.55Z",fill:"#292D32"})}),calendar:jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[jsx("path",{fill:"#292D32",d:"M8.25 5.75c-.41 0-.75-.34-.75-.75V2c0-.41.34-.75.75-.75S9 1.59 9 2v3c0 .41-.34.75-.75.75M15.75 5.75c-.41 0-.75-.34-.75-.75V2c0-.41.34-.75.75-.75s.75.34.75.75v3c0 .41-.34.75-.75.75M12 14.09c.52 0 .9-.31.9-.8 0-.5-.38-.79-.9-.79s-.9.29-.9.79c0 .49.38.8.9.8M12 17c.629 0 1.14-.416 1.14-.93 0-.513-.511-.93-1.14-.93-.63 0-1.14.417-1.14.93s.51.93 1.14.93"}),jsx("path",{fill:"#292D32",d:"M19.57 4.5c-.66-.49-1.61-.02-1.61.81v.1c0 1.17-.84 2.25-2.01 2.37-1.35.14-2.49-.92-2.49-2.24V4.5c0-.55-.45-1-1-1h-.92c-.55 0-1 .45-1 1v1.04c0 .79-.41 1.49-1.03 1.88-.09.06-.19.11-.29.16q-.135.075-.3.12c-.12.04-.25.07-.39.08q-.24.03-.48 0c-.14-.01-.27-.04-.39-.08q-.15-.045-.3-.12c-.1-.05-.2-.1-.29-.16-.63-.44-1.03-1.2-1.03-2.01v-.1c0-.77-.82-1.23-1.47-.9-.01.01-.02.01-.03.02-.04.02-.07.04-.11.07-.03.03-.07.05-.1.08-.28.22-.53.47-.74.74-.11.12-.2.25-.28.38a3.498 3.498 0 0 0-.27.46c-.02.02-.03.03-.03.05-.06.12-.12.24-.16.37-.03.05-.04.09-.06.14-.06.15-.1.3-.14.45-.04.14-.07.29-.09.44a5.902 5.902 0 0 0-.06.76v8.76A4.87 4.87 0 0 0 7.37 22h9.26a4.87 4.87 0 0 0 4.87-4.87V8.37c0-1.59-.76-2.98-1.93-3.87M12 18.25c-1.55 0-2.5-.77-2.5-2.01 0-.68.35-1.27.96-1.62-.44-.31-.73-.77-.73-1.4 0-1.3 1.04-1.97 2.27-1.97s2.26.67 2.26 1.97c0 .63-.28 1.09-.73 1.4.62.35.97.94.97 1.62 0 1.24-.96 2.01-2.5 2.01"})]}),done:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:jsx("path",{d:"M9 16.2 4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4z"})}),doneAll:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:jsx("path",{d:"m18 7-1.41-1.41-6.34 6.34 1.41 1.41zm4.24-1.41L11.66 16.17 7.48 12l-1.41 1.41L11.66 19l12-12zM.41 13.41 6 19l1.41-1.41L1.83 12z"})}),pending:jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[jsx("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2M12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"}),jsx("path",{d:"M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z"})]})},V=Ki;var Zi=({title:e="Alert",onClose:r})=>jsxs(p,{as:"--head flex aic rel",children:[jsx(p,{as:`--${e?"title":"dot"} flex aic jcc rel`,children:e}),jsx(_,{onClick:t=>r(),className:"--closer abs center-v",children:V.close})]}),mn=Zi;var fn=({ref:e,...r})=>{let{index:t,id:n,title:o,message:s,transition:a,curve:l,speed:u,type:c,action:i,actionPosition:d,spinner:f,loadingMessage:m,variant:g,inBackground:P,forceClose:x,forceLoading:T,onClose:S,onShow:R,onHide:h,...v}=r,y=useMemo(()=>uuid(12),[]),[b,E]=useState(o||""),[$,L]=useState(s||""),[A,M]=useState(c||at.Dialog),[O,F]=useState(false),[Z,I]=useState(true),[k,X]=useState(i||null),[Y,H]=useState(false),{variant:z,spinner:G,dialog:W}=j(true),ne=g||W?.variant||z||U.Small,{style:J,className:ae,rest:pe}=B(v),ye=useRef(null),ie=be({when:O,duration:u||W?.speed||.3,delay:W?.delay||.1,transition:a||W?.transition||Q.SlideInBottom,curve:l||W?.curve||oe.EaseInOut,watch:["scale","filter","transform"]}),ce=()=>{F(false),S(n);},q=useMemo(()=>[{keys:[KeyCode.Escape],callback:()=>{ke.isTop(ce)&&ce();}}],[O]);useShortcuts(q),useEffect(()=>{M(at.Dialog),L(s),E(b),k&&X(k.reduce((le,de)=>(le.push({...de,key:de.key||uuid(12)}),le),[])),F(true),setTimeout(()=>R?R():()=>{},500);},[]),useEffect(()=>{x&&ce();},[x]),useEffect(()=>{T!=null&&H(T);},[T]),useEffect(()=>(O?ke.push(ce):ke.pop(ce),()=>ke.pop(ce)),[O]);let re=useMemo(()=>1e4+t*10,[t]);return jsxs(Fragment$1,{children:[jsx(Ye,{style:{zIndex:re},when:O}),jsxs(p,{as:`--dialog --${(c??at.Default).toLowerCase()} ${O?"--visible":""} ${ae} fixed abc`.trim(),style:{...ie.style,zIndex:re+1,pointerEvents:P==true?"none":"auto",...P==true?{scale:"0.92",filter:"blur(2px)"}:{}},...pe,ref:ye,children:[jsx(mn,{title:b,onClose:ce}),jsx(sn,{message:$,render:Z,action:k}),k&&k.length>0&&jsx(ln,{variant:ne,action:k,dialogID:y,actionPosition:d}),jsx(Me,{when:Y,spinner:f||W?.spinner||G?.type||ve.Simple,message:m||W?.loadingMessage})]})]})};fn.displayName="Zuz.Dialog";var Ho=fn;var dn=forwardRef((e,r)=>{let{speed:t,smooth:n=false,breakpoints:o={},style:s,...a}=e,{rootRef:l,containerRef:u,thumbY:c,thumbX:i,onScrollY:d,onScrollX:f}=useScrollbar(t||1,o,n),{style:m,className:g,rest:P}=B(a);return useEffect(()=>{let x=u.current;if(!x)return;let T=()=>{window.dispatchEvent(new Event("resize"));},S=R=>{let h=R.target;if(h.closest(".--allow-scroll")){let y=h.closest(".--allow-scroll"),{scrollTop:b,scrollHeight:E,clientHeight:$}=y,L=R.deltaY<0,A=R.deltaY>0;(L&&b>0||A&&b+$<E)&&R.stopPropagation();}};return x.addEventListener("scroll",T),x.addEventListener("wheel",S,{passive:true}),()=>{x.removeEventListener("scroll",T),x.removeEventListener("wheel",S);}},[u]),jsxs(p,{ref:l,className:g.trim(),as:"--scrollview rel",children:[jsx(p,{as:`--scroll-content ${g}`.trim(),ref:u,style:s||{},children:P.children}),jsx(p,{as:"--scroll-track --track-y --abs",children:jsx(p,{as:"--scroll-thumb --abs --round",ref:c,onMouseDown:d})}),jsx(p,{as:"--scroll-track --track-x --abs",children:jsx(p,{as:"--scroll-thumb --abs --round",ref:i,onMouseDown:f})})]})});dn.displayName="Zuz.ScrollView";var Ao=dn;var gn=({ref:e,...r})=>{let{id:t,index:n,from:o,speed:s,children:a,margin:l,animation:u,prerender:c,inBackground:i,forceClose:d,forceLoading:f,onClose:m,...g}=r,{drawer:P}=j(true),[x,T]=useState(a),[S,R]=useState(false),[h,v]=useState(c??(P?.prerender||true)),[y,b]=useState(false),E=()=>{R(false),m?.(t??-1);},{className:$,style:L,rest:A}=B(g),M=useMemo(()=>[{keys:[KeyCode.Escape],callback:()=>{ke.isTop(E)&&E();}}],[S]);useShortcuts(M),useEffect(()=>{T(a);},[a]),useEffect(()=>(S?ke.push(E):ke.pop(E),()=>ke.pop(E)),[S]),useEffect(()=>{R(true);},[]),useEffect(()=>{d&&E();},[d]),useEffect(()=>{f!=null&&b(f);},[f]);let O=o||P?.from||we.Left,F=useMemo(()=>{switch(O){case we.Left:return {from:{x:"-100vw"},to:{x:0}};case we.Right:return {from:{x:"100vw"},to:{x:0}};case we.Top:return {from:{y:"-100vh"},to:{y:0}};case we.Bottom:return {from:{y:"100vh"},to:{y:0}};default:return {from:{x:"-100vw"},to:{x:0}}}},[o,P?.from]),Z=be({from:{...F.from,opacity:0},to:{...F.to,opacity:1},when:S,curve:u||P?.animation||oe.EaseInOut,duration:s||P?.speed||.5,watch:["scale","filter"]}),I=useMemo(()=>1e4+(n||1)*10,[n]);return jsxs(Fragment$1,{children:[jsx(Ye,{onClick:k=>{S&&E();},when:S,style:{zIndex:I}}),jsxs(p,{ref:e,"aria-hidden":!S,className:`--drawer flex cols ${$} --${O.toLowerCase()} fixed`,style:{...L,...Z.style,"--m":`${l||P?.margin||0}px`,zIndex:I+1,pointerEvents:i==true?"none":"auto",...i==true?{scale:"0.92",filter:"blur(2px)"}:{}},...A,children:[o==we.Top||o==we.Bottom?jsx(p,{className:"--handle"}):null,jsx(_,{as:"--close-drawer --abs",onClick:E,children:V.close}),jsxs(Ao,{as:"rel",children:[h||S?x:null,jsx(Me,{when:y})]})]})]})};gn.displayName="Zuz.Drawer";var zo=gn;var yn=forwardRef((e,r)=>{let{progress:t,type:n,animated:o,...s}=e,a=useRef(null);useImperativeHandle(r,()=>({setProgress:i=>{a.current.style.width=`${i*100}%`,a.current.setAttribute("data-value",i+"");},getProgress:()=>+(a.current.getAttribute("data-value")||0)}),[]),useEffect(()=>{t&&a.current&&(o?setTimeout(()=>a.current.style.width=`${t*100}%`,500):a.current.style.width=`${t*100}%`,a.current.setAttribute("data-value",t+""));},[t,a.current]);let{className:l,style:u,rest:c}=B(s);return jsx(p,{className:`--progress ${o?"--animated":""} flex rel ${l}`.trim(),style:u,...c,children:jsx(p,{ref:a,className:"--bar rel"})})});yn.displayName="Zuz.ProgressBar";var Qe=yn;var Yt=(s=>(s.Default="default",s.Success="success",s.Error="error",s.Warn="warn",s.Promise="promise",s))(Yt||{}),jt=(a=>(a.TopLeft="TopLeft",a.TopCenter="TopCenter",a.TopRight="TopRight",a.BottomLeft="BottomLeft",a.BottomCenter="BottomCenter",a.BottomRight="BottomRight",a))(jt||{}),xn=(t=>(t.Stack="stack",t.Individual="individual",t))(xn||{}),bn={success:"Action Successful",error:"Something Went Wrong",warn:"Heads Up",default:"Notice"};var il=e=>{let{index:r,id:t,type:n,icon:o,busy:s,width:a,title:l,message:u,duration:c,sticky:i=false,actions:d=[],position:f,style:m,isHovered:g,total:P,progress:x,progressValue:T,forceClose:S,variant:R,onClick:h,onClose:v}=e,[y,b]=useState(false),[E,$]=useState(false),{toast:L}=j(true),A=typeof T=="number",M=A?Math.max(0,Math.min(1,T)):void 0,O=E||S,F=f??L?.position??"TopCenter",Z=n??L?.type??"default",I=m??L?.style??"stack",k=c??L?.duration??4,X=x??L?.progress??false,Y=useRef(k*1e3),H=useRef(void 0),z=useRef(void 0),G=useRef(null),W=be({when:y&&!O,duration:.3,transition:L?.transition||(F.includes("Top")?Q.SlideInTop:F.includes("Bottom")?Q.SlideInBottom:F.includes("Left")?Q.SlideInLeft:Q.SlideInRight),curve:L?.curve||oe.EaseInOut,watch:["transform","opacity","scale","filter"]});useEffect(()=>{b(true);let q=re=>{if(z.current!==void 0){let le=re-z.current;if(!A&&!g&&!i&&!O&&(Y.current-=le,G.current)){let de=Math.max(0,Y.current/(k*1e3)*100);G.current?.setProgress?.(de/100);}}z.current=re,Y.current<=0?$(true):H.current=requestAnimationFrame(q);};return H.current=requestAnimationFrame(q),()=>{H.current&&cancelAnimationFrame(H.current);}},[g,i,O,k]),useEffect(()=>{if(O){let q=setTimeout(()=>{v?.(t);},350);return ()=>clearTimeout(q)}},[O,t]);let ne=I==="stack",J=g?r*65:r*8,ae=g?1:Math.max(.85,1-r*.05),pe=g?1:Math.max(.4,1-r*.2),ye=q=>{h?h(q):s!==true&&(!d||d.length===0)&&$(true);},ie=W.style.transform||"translate(0, 0)",ce=O?ie:`${ie} translateY(${F.includes("Top")?J:-J}px) scale(${ae})`;return jsxs(p,{onClick:ye,as:`--snack --${O?"hidden":"visible"} --${R||L?.variant||U.Medium} --${Z} --${F.toLowerCase()} abs flex aic`,style:{...W.style,zIndex:1e3-r,pointerEvents:O?"none":"auto",opacity:O?W.style.opacity:pe,transform:ce,filter:!O&&ne&&!g&&r>0?"blur(1px)":"none",cursor:!d||d.length===0?"pointer":"default",transition:`${W.style.transition}, transform 0.3s ease, opacity 0.3s ease`},children:[jsxs(p,{as:"--ico flex aic jcc rel",children:[o?jsx(te,{name:o}):jsx(p,{as:"--no-icon"}),s===true&&jsx(Ce,{as:"abs abc"})]}),jsxs(p,{as:"--meta flex cols",style:a?{width:a,minWidth:a,maxWidth:a}:void 0,children:[jsx(K,{as:"--tt",children:l||bn[n]}),jsx(K,{as:"--tm",children:u})]}),d&&d.length>0&&jsx(p,{as:"--actions flex gap:5",children:d.map((q,re)=>jsx(_,{as:"--snack-btn bold",variant:U.XSmall,onClick:le=>{le.stopPropagation(),q.onClick(le);},children:q.label},re))}),(X||A)&&jsx(Qe,{as:"abs",progress:M,ref:G})]})},Ko=il;var Pe=createContext(null),fl=({ref:e,...r})=>{let n=useContext(Pe)?.depth??0,[o,s]=useState(null),[a,l]=useState(null),[u,c]=useState(false),[i,d]=useState([]),f=useDelayed(),m=useRef(0),g=()=>++m.current,P=()=>{c(false),setTimeout(()=>l(null),200);};useImperativeHandle(e,()=>({add(h){let v=g(),y={id:v,...h};return d(b=>[...b,y]),v},openMenu(h){c(false),setTimeout(()=>{l({id:g(),type:"menu",props:h}),c(true);},16);},update(h,v){d(y=>y.map(b=>b.id!==h?b:{...b,props:{...b.props,...v}}));},remove(h){d(v=>v.map(y=>y.id===h?{...y,props:{...y.props,forceClose:true}}:y)),a?.id===h&&P();},loading(h,v){d(y=>y.map(b=>b.id===h?{...b,props:{...b.props,forceLoading:v}}:b)),a?.id===h&&P();},clear(h){d(i.filter(v=>v.type!=h));}})),useEffect(()=>{if(a&&u){let h=()=>P();return document.addEventListener("click",h),()=>document.removeEventListener("click",h)}},[a,u,P]);let x=h=>{setTimeout(()=>{d(v=>v.filter(y=>y.id!==h)),a?.id===h&&l(null);},250);},T=useMemo(()=>[...i.filter(h=>h.type!="toast")],[i]);if(!f)return null;let S=i.filter(h=>h.type=="toast").reverse(),R=Object.values(jt);return createPortal(jsxs(p,{as:"--zuz-layers-wrapper fixed fill nope",style:{zIndex:9999+n},children:[T.map((h,v)=>{let y=v<T.length-1;return h.type==="dialog"?jsx(Ho,{onClose:x,index:v,id:h.id,...h.props,inBackground:y},`layer-${h.type}-${h.id}`):h.type==="drawer"?jsx(zo,{onClose:x,index:v,id:h.id,...h.props,inBackground:y},`layer-${h.type}-${h.id}`):null}),R.map(h=>{let v=S.filter(y=>(y.props.position||"TopCenter")===h);return v.length===0?null:jsx(p,{onMouseEnter:()=>s(h),onMouseLeave:()=>s(null),as:`--toast-container fixed --${h.toLowerCase()} flex cols`,style:{pointerEvents:"auto",zIndex:"var(--max-z-index)"},children:v.map((y,b)=>jsx(Ko,{index:b,total:v.length,isHovered:o===h,onClose:x,id:y.id,...y.props},y.id))},h)}),a&&jsx(p,{as:"--zuz-layer-menus fixed fill nope",style:{zIndex:"var(--max-z-index)"},children:jsx(Mo,{onClose:P,when:u,...a.props},`menu-${a.id}`)})]}),document.body)},dl=({children:e})=>{let r=useContext(Pe),t=r?r.depth+1:0,n=useRef(null),o=useMemo(()=>({add:s=>n.current?.add(s),openMenu:s=>n.current?.openMenu(s),update:(s,a)=>n.current?.update(s,a),remove:s=>n.current?.remove(s),loading:(s,a)=>n.current?.loading(s,a),clear:s=>n.current?.clear(s),depth:t,isSubLayer:!!r}),[r]);return jsxs(Pe.Provider,{value:o,children:[e,jsx(fl,{ref:n})]})},Bo=dl;var hl=()=>{let e=useContext(Pe);if(!e)throw new Error("useContextMenu must be used inside <LayersProvider>");return {showContextMenu:(n,o,s)=>{n.preventDefault(),e.openMenu({event:n,items:o,origin:s});},showMenu:(n,{items:o,origin:s,offsetX:a,offsetY:l,transition:u,curve:c,arrow:i,duration:d,header:f,footer:m})=>{e.openMenu({fx:{transition:u,curve:c,duration:d},parent:n,items:o,origin:s||St.TopCenter,offsetX:a,offsetY:l,arrow:i,header:f,footer:m});},hide:e.clear}},yl=hl;var bl=()=>{let e=useContext(Pe);if(!e)throw new Error("useDialog must be used inside <LayersProvider>");let r=()=>e.clear("dialog"),t=s=>e.remove(s),n=(s,a)=>e.loading(s,a);return {clearAll:r,show:s=>{let a=e.add({type:"dialog",props:{...s,type:at.Dialog}});return {id:a,setLoading:l=>n(a,l),hide:()=>t(a)}},hide:t}},vl=bl;var wl=()=>{let e=useContext(Pe);if(!e)throw new Error("useDialog must be used inside <LayersProvider>");let r=()=>e.clear("drawer"),t=s=>e.remove(s),n=(s,a)=>e.loading(s,a),o=s=>{let a=e.add({type:"drawer",props:s});return {id:a,setLoading:l=>n(a,l),close:()=>t(a)}};return {clearAll:r,open:s=>o({children:s}),right:s=>o({children:s,from:we.Right}),left:s=>o({children:s,from:we.Left}),top:s=>o({children:s,from:we.Top}),bottom:s=>o({children:s,from:we.Bottom}),close:t}},Cl=wl;var Tl=(e,r,t={})=>{let[n,o]=useState(null),[s,a]=useState(false),{duration:l=.25,curve:u=oe.EaseOutBack,borderRadius:c={from:40,to:24},targetWidth:i=320}=t;return useLayoutEffect(()=>{r&&e.current?(o(e.current.getBoundingClientRect()),a(true)):r||a(false);},[r,e]),{style:be({from:{opacity:0,width:n?.width,height:n?.height,borderRadius:c.from},to:{opacity:1,width:i,height:"auto",borderRadius:c.to},curve:u,duration:l,when:s&&r}).style,isMeasured:s,sourceRect:n}},Rl=Tl;var Bl=(e,r={})=>{let{offset:t=8,direction:n="bottom",container:o=null,triggerRef:s=null}=r,a=useRef(null),l=useCallback(()=>{let u=e.current;if(!u)return;let c=s?.current||u.parentElement;if(!c){console.warn("usePosition: No trigger element found. Positioning may not work.");return}let i=u.getBoundingClientRect(),d=c.getBoundingClientRect(),f,m;o?(f=o.getBoundingClientRect(),m="absolute"):(window.getComputedStyle(u).position==="fixed"?m="fixed":m="absolute",m==="fixed"?f={top:0,left:0,right:window.innerWidth,bottom:window.innerHeight,width:window.innerWidth,height:window.innerHeight}:f={top:0,left:0,right:window.innerWidth,bottom:window.innerHeight,width:window.innerWidth,height:window.innerHeight}),u.style.position!==m&&(u.style.position=m),a.current=m;let x=0,T=0;switch(n){case "top":x=d.top-i.height-t,T=d.left,x<f.top&&d.bottom+i.height+t<=f.bottom&&(x=d.bottom+t);break;case "bottom":x=d.bottom+t,T=d.left,x+i.height>f.bottom&&d.top-i.height-t>=f.top&&(x=d.top-i.height-t);break;case "left":x=d.top,T=d.left-i.width-t,T<f.left&&d.right+i.width+t<=f.right&&(T=d.right+t);break;case "right":x=d.top,T=d.right+t,T+i.width>f.right&&d.left-i.width-t>=f.left&&(T=d.left-i.width-t);break}if(x=Math.max(f.top,Math.min(x,f.bottom-i.height)),T=Math.max(f.left,Math.min(T,f.right-i.width)),a.current==="fixed")u.style.top=`${x}px`,u.style.left=`${T}px`;else {let S;u.offsetParent?S=u.offsetParent.getBoundingClientRect():S={top:0,left:0};let R=x-S.top+window.scrollY,h=T-S.left+window.scrollX;u.style.top=`${R}px`,u.style.left=`${h}px`;}},[e,s,t,n,o]);return useEffect(()=>{let u=e.current;if(!u)return;let c=s?.current||u.parentElement;if(!c){console.warn("usePosition: No trigger element found. Positioning may not work.");return}let i=new ResizeObserver(l);return i.observe(u),c&&i.observe(c),l(),window.addEventListener("resize",l),window.addEventListener("scroll",l,true),()=>{i.disconnect(),c&&i.disconnect(),window.removeEventListener("resize",l),window.removeEventListener("scroll",l,true);}},[e,n,t,o,s]),{postion:a.current,reposition:l}},It=Bl;var Ll=()=>{let e=useContext(Pe);if(!e)throw new Error("useToast must be used inside <LayersProvider>");let r=(m,g)=>e.add({type:"toast",props:{...g,type:m}}),t=()=>e.clear("toast"),n=m=>e.remove(m),o=(m,g)=>e.update(m,g),s=m=>({id:m,update:g=>o(m,g),setType:g=>o(m,{type:g}),setProgress:g=>o(m,{progress:true,progressValue:g}),setBusy:g=>o(m,{busy:g}),success:()=>o(m,{type:"success"}),error:()=>o(m,{type:"error"}),warn:()=>o(m,{type:"warn"}),promise:()=>o(m,{type:"promise"}),default:()=>o(m,{type:"default"}),hide:()=>n(m)}),a=m=>s(r("default",m)),l=m=>s(r("success",m)),u=m=>s(r("error",m)),c=m=>s(r("warn",m)),i=m=>s(r("promise",m)),d=(m,g,P)=>{let x=r(m,{...g,sticky:g.sticky??false,actions:[{label:P?.label||"Ok",onClick:T=>{P?.onClick?.(T),n(x);}}]});return s(x)},f=(m,g,P,x)=>{let T=r(m,{...g,sticky:true,actions:[{label:P?.label||"Ok",onClick:S=>{P?.onClick?.(S),(P?.hide??false)===true&&n(T);}},{label:x?.label||"Cancel",onClick:S=>{x?.onClick?.(S),(x?.hide??true)===true&&n(T);}}]});return s(T)};return {show:a,hide:n,promise:i,clearAll:t,ok:(m,g)=>d("default",m,g),success:(m,g)=>g?d("success",m,g):l(m),error:(m,g)=>g?d("error",m,g):u(m),confirm:(m,g,P)=>f("default",m,g,P),warn:(m,g)=>g?d("warn",m,g):c(m),succes:(m,g)=>g?d("success",m,g):l(m)}},Ml=Ll;var Vl=()=>{let e=useContext(Pe);if(!e)throw new Error("useToast must be used inside <LayersProvider>");let r=(c,i)=>e.add({type:"toast",props:{...i,type:c}});return {show:(c,i,d,f)=>r("default",{title:c,message:i,icon:d,duration:f}),hide:c=>e.remove(c),success:(c,i,d,f)=>r("success",{title:c,message:i,icon:d,duration:f}),error:(c,i,d,f)=>r("error",{title:c,message:i,icon:d,duration:f}),warn:(c,i,d,f)=>r("warn",{title:c,message:i,icon:d,duration:f}),promise:(c,i,d,f)=>r("promise",{title:c,message:i,icon:d,duration:f}),clearAll:()=>e.clear("toast")}},Zo=Vl;var In=({ref:e,style:r,...t})=>{let n=useRef(null),o=useMemo(()=>e&&typeof e!="function"&&e.current?e:n,[e]),{style:s,className:a,rest:l}=B(t,o);return jsx("div",{ref:e||n,style:{...s,...r||{}},className:a,...l})};In.displayName="Zuz.Box";var p=In;var Nn=forwardRef((e,r)=>{let{title:t,message:n,...o}=e,[s,a]=useState(false);return jsxs(p,{className:"--accordion flex cols",...o,children:[jsxs(_,{onClick:l=>a(!s),className:`--toggle flex aic ${s?"--open":""}`.trim(),children:[jsx(K,{className:"--label flex",children:t}),jsx(p,{className:"--arrow flex",children:s?V.arrowUp:V.arrowDown})]}),s&&jsx(p,{className:"--detail",children:n})]})});Nn.displayName="Zuz.Accordion";var zl=Nn;var _l=({label:e,icon:r,onClick:t,idx:n,selected:o})=>jsx(_,{onClick:t,onMouseMove:s=>document.documentElement.style.setProperty("--tip-m",`${n}`),className:`--action ${o?"--selected":""} aic jcc rel`.trim(),children:typeof r=="string"?jsx(te,{name:r}):r}),kn=_l;var Ln=forwardRef((e,r)=>{let{items:t,name:n,selected:o,position:s,...a}=e,l=useRef(null),[u,c]=useState(o||t[0].tag||0),i=useCallback(({x,y:T})=>{if(l.current){let S=l.current.getBoundingClientRect();document.documentElement.style.setProperty("--tip-x",`${x-S.left}`),document.documentElement.style.setProperty("--tip-y",`${T-S.top}`),document.documentElement.style.setProperty("--tip-s","1");}},[]),d=useCallback(()=>{l.current&&(l.current.removeEventListener("pointerleave",d),l.current.removeEventListener("pointermove",i),document.documentElement.style.setProperty("--tip-s","0"));},[]),f=useCallback(()=>{l.current&&(l.current.addEventListener("pointerleave",d),l.current.addEventListener("pointermove",i));},[]);useEffect(()=>{l.current&&(document.documentElement.style.setProperty("--tip-w",t.reduce((x,T)=>T.label.length>x.length?T.label:x,"").length.toString()),document.documentElement.style.setProperty("--tip-s","0"),document.documentElement.style.setProperty("--tip-l",`${t.length}`),l.current?.addEventListener("pointerenter",f));},[]);let{className:m,style:g,rest:P}=B(a);return jsxs(p,{ref:l,style:g,className:[`--actionbar flex aic ${m}`,`${!s||s==xe.Auto?"rel":`--${s}`}`].join(" ").trim(),...P,children:[t.map((x,T)=>jsx(kn,{selected:u===x.tag||o==T,...x,idx:T},`actionbar-action-${x.label.toLowerCase().replace(/\s+/g,"-")}`)),jsx(p,{className:"--tip abs",children:jsx(p,{className:"--track flex aic",children:t.map(({label:x})=>jsx(p,{className:"--lb",children:x},`tool-tip-${x.toLowerCase().replace(/\s+/g,"-")}`))})})]})});Ln.displayName="Zuz.ActionBar";var Ul=Ln;var On=forwardRef((e,r)=>{let{type:t,icon:n,title:o,message:s,iconSize:a,...l}=e,{className:u,style:c,rest:i}=B(l);return jsxs(p,{className:`--alert --${t||Ne.Info} flex aic ${u}`.trim(),style:c,...i,children:[jsx(p,{className:`--icon icon-${n||"auto-matic"}`,style:a?{fontSize:a,width:a,height:a}:{},children:!n&&V[t||Ne.Info]}),jsxs(p,{className:"--meta flex cols",children:[jsx(K,{className:`--title ${s?"--tm":""}`,children:o||"Lorem ipsum dolor sit amet, consectetur adipiscing elit."}),s&&jsx(K,{className:"--message",h:2,children:s})]})]})});On.displayName="Zuz.Alert";var Yl=On;var Et=createContext(null),Yo=()=>{let e=useContext(Et);return e?useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot):null},Nt=()=>useContext(Et),Dn=()=>()=>{},Hn=e=>{let r=useContext(Et);return useSyncExternalStore(r?.subscribe??Dn,()=>{if(!(!r||!e))return r.getSnapshot().values?.[e]},()=>{})},An=e=>{let r=useContext(Et);return useSyncExternalStore(r?.subscribe??Dn,()=>!r||!e?null:r.getSnapshot().errors?.[e]??null,()=>null)},it=()=>{let e=Nt(),r=Yo();return {...e,...r}},$n=({children:e,initialValues:r={}})=>{let t=useRef({values:r,errors:{},touched:{}}),n=useRef(new Set(Object.keys(r))),o=useRef(new Set),s=useCallback(()=>t.current,[]),a=useCallback(c=>(o.current.add(c),()=>o.current.delete(c)),[]),l=()=>{o.current.forEach(c=>c());};useEffect(()=>{if(!r||Object.keys(r).length===0)return;let c=new Set(Object.keys(r)),i=[...n.current].filter(T=>!c.has(T)),d={...t.current.values};i.forEach(T=>delete d[T]);let f={...d,...r},m=t.current.values||{},g=Object.entries(f),P=Object.entries(m),x=g.length!==P.length||g.some(([T,S])=>m[T]!==S);n.current=c,x&&(t.current={...t.current,values:f},l());},[r]);let u=useMemo(()=>({subscribe:a,getSnapshot:s,setFieldValue:(c,i)=>{t.current.values[c]!==i&&(t.current={...t.current,values:{...t.current.values,[c]:i}},l());},deleteFieldValue:c=>{if(!(c in t.current.values))return;let{[c]:i,...d}=t.current.values;t.current={...t.current,values:d},l();},setFieldError:(c,i)=>{t.current={...t.current,errors:{...t.current.errors,[c]:i}},l();},reset:()=>{t.current={values:{},errors:{},touched:{}},l();}}),[]);return jsx(Et.Provider,{value:u,children:e})};var zn=({ref:e,...r})=>{let{variant:t,numeric:n,name:o,onConfirm:s,...a}=r,{style:l,className:u,rest:c}=B(a),{variant:i}=j(true),d=useRef(null),f=it(),m=o?f.errors?.[o]:null,g=o&&f.values&&f.setFieldValue,P=g?f.values?.[o]:void 0,x=useDebounce(S=>{g&&f.setFieldValue?.(o,S);},500),T=S=>{let R=S.currentTarget.value;n&&(R=R.replace(/[^0-9.]/g,"").replace(/(\..*?)\..*/g,"$1"),S.currentTarget.value=R),x(R),r.onInput?.(S);};return useEffect(()=>{d.current&&o&&P!==void 0&&d.current.value!==String(P)&&(d.current.value=String(P));},[P,o]),useEffect(()=>()=>{g&&f.deleteFieldValue?.(o);},[]),jsx("input",{name:o,className:`--input --${t||i} ${m?"--has-error":""} --flex ${u}`.trim(),style:l,defaultValue:P??r.defaultValue??"",onInput:T,onKeyDown:S=>{S.key=="Enter"&&s?.(S.currentTarget.value);},ref:S=>{d.current=S,typeof e=="function"?e(S):e&&(e.current=S);},...c})};zn.displayName="Zuz.Input";var fe=zn;var Kn=e=>{let{meta:r,children:t}=e,n=useDelayed(),{label:o,icon:s,...a}=isValidElement(r)?{}:r,{className:l,style:u,rest:c}=B({...a,...a.animate?{animate:{...a.animate,when:n}}:{}});return isValidElement(r)?jsx("li",{style:u,className:l,children:r}):jsxs("li",{style:u,className:l,...c,children:[t,typeof r=="string"?r:o]})};Kn.displayName="Zuz.ListItem";var Zn=Kn;var Gn=forwardRef((e,r)=>{let{items:t,variant:n,direction:o,seperator:s,ol:a,...l}=e,{className:u,style:c,rest:i}=B(l),d=a==true?"ol":"ul";return createElement(d,{className:`--list --${n||U.Small} flex ${o??"cols"} ${u}`.trim(),style:c,ref:r,...i,children:t.map((f,m,g)=>{let P=`${typeof f=="string"?`li-${String(f)}`:isValidElement(f)?`li-${f.key}`||`${m}-${MD5(f.toString())}`:f.label}-${m}`;return jsxs(Fragment,{children:[jsx(Zn,{meta:f}),s&&g[m+1]?jsx("li",{className:"--list-seperator",children:s},`spt-${m+1}-${P}`):null]},P)})})});Gn.displayName="Zuz.List";var et=Gn;var qn=forwardRef((e,r)=>{let{fx:t,action:n,data:o,withStyle:s,onChange:a,...l}=e,{className:u}=B({as:s||""}),{style:c}=B(l),[i,d]=useState(false),[f,m]=useState(o||[]),g=useRef(null),P=useRef(null),x=useRef(null),T=useMemo(()=>l.name||uuid(12),[]),[S,R]=useState(null),[h,v]=useState(null),[y,b]=useState([]),$=useDebounce(I=>{I.target.value==""?(d(false),m([])):n&&I.target.value.trim()!=""&&withPost(n,{query:I.target.value}).then(k=>{"items"in k&&_$1(k.items).isArray()?(m(k.items),v(I.target.value),b(k.items)):console.error("Action Response should contain items array"),R(null);}).catch(k=>{R(null),m([]);});},250),L=()=>{if(P.current){let I=P.current.getBoundingClientRect(),k=window.innerHeight-I.bottom,X=I.top;if(x.current){let Y=x.current;k<Y.offsetHeight&&X>k?(Y.style.top="auto",Y.style.bottom=`${I.height}px`,Y.style.maxHeight=`${X-150}px`):(Y.style.top=`${I.height+5}px`,Y.style.bottom="auto",Y.style.maxHeight=`${k-150}px`);}}},A=I=>{if(f.length>0){if((I.key==="ArrowDown"||I.key==="ArrowUp")&&(I.preventDefault(),I.stopPropagation()),I.key==="Escape")R(null),d(false),m([]);else if(I.key==="ArrowDown")R(k=>{let X=k===null||k===f.length-1?0:k+1;return O(X),X});else if(I.key==="ArrowUp")R(k=>{let X=k===null||k===0?f.length-1:k-1;return O(X),X});else if(I.key==="Enter"&&S!==null){let k=f[S];g.current&&(g.current.value=k,d(false),m([]));}}},M=I=>{g.current&&(g.current.value=I,d(false),m([]));},O=I=>{let k=f[I];if(k&&g.current&&(g.current.value=k,g.current.setSelectionRange(k.length,k.length)),x.current){let Y=x.current.children[I];Y&&Y.scrollIntoView({block:"nearest"});}},F=I=>{P.current&&!P.current.contains(I.target)&&(d(false),m([]));},Z=()=>{g.current&&g.current.value===h&&(m(y),R(null),L());};return useEffect(()=>(window.addEventListener("resize",L),window.addEventListener("scroll",L,true),document.addEventListener("mousedown",F),()=>{window.removeEventListener("resize",L),window.removeEventListener("scroll",L,true),document.removeEventListener("mousedown",F);}),[]),useEffect(()=>{L();},[f]),jsxs(p,{style:c,ref:P,className:`--autocomplete --${e.size||U.Small} flex aic rel ${u}`.trim(),children:[jsx(fe,{ref:g,autoComplete:"off",onChange:$,onKeyDown:A,onFocus:Z,...l}),jsx(p,{className:"--arrow rel flex aic jcc",children:f.length>0?V.arrowUp:V.arrowDown}),f.length>0&&jsx(et,{id:T,ref:x,className:"--suggestion-list flex cols abs",items:f.map((I,k)=>({label:I,onClick:X=>{X.preventDefault(),X.stopPropagation(),M(I);},className:S===k?"--current":"",animate:{transition:Q.SlideInBottom,curve:oe.EaseInOut,delay:clamp(.02*k,.02,.5)}}))})]})});qn.displayName="Zuz.AutoComplete";var vc=qn;var Xn=forwardRef((e,r)=>{let t=useRef(null),n=useMemo(()=>r&&typeof r!="function"&&r.current?r:t,[r]),{style:o,className:s,rest:a}=B(e,n);return !a.src||a.src==""?null:jsx("img",{ref:n,style:o,className:`${s} flex`,...a})});Xn.displayName="Zuz.Image";var tt=Xn;var Yn=forwardRef((e,r)=>{let{src:t,variant:n,type:o,crossOrigin:s,referrerPolicy:a,fx:l,as:u,alt:c,color:i,style:d,...f}=e,[m,g,P]=useImage(t??"",s,a),{className:x,style:T,rest:S}=B({fx:l,as:u});return jsx(p,{className:`--avatar --${n||U.Small} --${(o||Or.Circle).toLowerCase()} rel flex aic jcc ${x}`.trim(),style:{background:i||"var(--avatar-bg, var(--primary))",...d,...T},...S,children:t?jsx(tt,{src:m,crossOrigin:s,referrerPolicy:a,...f}):jsx(K,{className:"--avatar-label",children:(c?c.charAt(0):"A").toUpperCase()})})});Yn.displayName="Zuz.Avatar";var Ec=Yn;var Nc=({size:e=5,type:r="dead",label:t="",variant:n=U.Small,loading:o=false,spinner:s,...a})=>{let{style:l,className:u,rest:c}=B(a);return jsxs(p,{style:{..._$1(t).isEmpty()?{"--badge-size":e}:{},...l},as:`--badge --${n} --${r} rel flex aic jcc ${u}`.trim(),children:[jsx(p,{fx:{transition:Q.FadeIn,curve:oe.Liquid,duration:.5,when:o},as:"abs abc",children:jsx(Ce,{type:s})}),_$1(t).isEmpty()?jsx(p,{as:`--dot --${r}`}):jsx(K,{as:"--label",children:t})]})},Bc=Nc;var Zc=[{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 e=new Date,r=e.getDay();return addDays(e,(6-r)%7||6)},getDateFormat:()=>{let e=new Date,r=e.getDay();return format(addDays(e,(6-r)%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)}],Wc=e=>{let r=new Set;return e.filter(t=>{if(t.label=="Later")return true;let n=t.getDate().toISOString().split("T")[0];return r.has(n)?false:(r.add(n),true)})},Qn=forwardRef((e,r)=>{let{defaultValue:t,variant:n,onChange:o,...s}=e,{style:a,className:l,rest:u}=B(s),[c,i]=useState(t||new Date),d=startOfMonth(c),f=endOfMonth(c),m=startOfWeek(d),g=endOfWeek(f),P=useMemo(()=>eachDayOfInterval({start:m,end:g}),[m,g]),x=R=>{o?.(R),i(R);},T=()=>{i(R=>new Date(R.getFullYear(),R.getMonth()-1));},S=()=>{i(R=>new Date(R.getFullYear(),R.getMonth()+1));};return jsxs(p,{as:`--calendar flex --${n||"sm"} ${l}`,style:a,children:[jsx(p,{as:"--calendar-quick-select flex cols flex:1",children:Wc(Zc).map(R=>{let h=R.getDate();return jsxs(_,{onClick:()=>x(h),as:["--calendar-quick-option flex aic gap:5"],children:[jsx(K,{as:"flex:1",children:R.label}),jsx(K,{as:"tar",children:R.getDateFormat()})]},`--dtp-option-label-${R.label}`)})}),jsxs(p,{as:"--calendar-selector flex cols flex:1",children:[jsxs(p,{as:"--calendar-head flex aic jcc gap:4",children:[jsx(K,{as:"flex:1 --calendar-cm bold",children:format(c,"MMMM yyyy")}),jsx(_,{onClick:T,as:"--calendar-chevron",children:V.chevronUpOutline}),jsx(_,{onClick:S,as:"--calendar-chevron",children:V.chevronDownOutline})]}),jsxs(p,{as:"--calendar-days gap:4",children:[["Su","Mo","Tu","We","Th","Fr","Sa"].map(R=>jsx(K,{as:"--calendar-day",children:R},`--calendar-hd-${R}`)),P.map((R,h)=>{let v=isSameMonth(R,c),y=isSameDay(R,c),b=isToday(R);return jsx(_,{disabled:!v,onClick:()=>x(R),as:["--calendar-day --calendar-dd",`${y?"--calendar-dd-selected":""}`,`${b?"--calendar-dd-current":""}`],children:format(R,"d")},`--calendar-day-${h}-${R.getFullYear()}-${R.getMonth()}-${R.getDay()}`)})]})]})]})});Qn.displayName="Zuz.Calendar";var er=Qn;var no=(t=>(t.Table="table",t.Gooey="gooey",t))(no||{});var os=({ref:e,...r})=>{let{itemCount:t,itemsPerPage:n,startPage:o,pageRange:s,paginationStyle:a,breakLabel:l,prevLabel:u,nextLabel:c,hash:i,loading:d,seperator:f,renderOnZeroPageCount:m,asDots:g,progressBar:P,onPageChange:x,...T}=r,S=useRef(null),R=useMemo(()=>toHash(numberInRange(4,8)),[]),h=useCallback(I=>`${toHash(I,i||6,R)}${f||""}${R}`,[R]),v=useMemo(()=>l||"...",[l]),y=useRef(null),[b,E]=useState({id:i?o?typeof o=="number"?h(o):o:1:o||1,label:o||1});useImperativeHandle(e,()=>({setPage:I=>E(I),getPage:I=>b,setProgress:I=>y.current?.setProgress?.(I),getProgress:()=>y.current?.getProgress?.()??0}),[y.current]);let{style:$,className:L,rest:A}=B(T),M=useCallback(I=>typeof I=="number"?I:+I.label,[]);if(!t)throw new Error('"itemCount" prop is required');let O=useMemo(()=>Math.ceil(t/n),[t,n]),F=useMemo(()=>{let I=[],k=Math.max(M(b)-(s||2),1),X=Math.min(M(b)+(s||2),O);k>1&&I.push({id:i?h(1):1,label:1}),k>2&&I.push({id:-1,label:v});for(let Y=k;Y<=X;Y++)I.push({id:i?h(Y):Y,label:Y});return X<O-1&&I.push({id:-1,label:v}),X<O&&I.push({id:i?h(O):O,label:O}),I},[b]),Z=useCallback(I=>{let k=I;+k.label<1||+k.label>O||(E(k),x?.(k));},[t,n,b]);return F.length<=1&&(m??false)===false?null:jsxs(p,{ref:S,as:`--pagination ${g===true?"--as-dots":""} --pgt-${a||"table"} flex aic w:100% jcc ${L}`,children:[jsx(p,{as:"flex flex:1 aic --pgt-btns",children:(F.length>1?F:[{id:1,label:1},{id:-1,label:v}]).map((I,k,X)=>{let Y=(typeof I=="string"?I:I.label)==M(b);return jsx(_,{disabled:I.id==-1||M(b)==+I.label,className:Y?"--current-page":"",onClick:H=>Z(I),children:g===true?P===true&&Y?jsx(Qe,{ref:y}):"":typeof I=="string"?I:I.label},`--pg-${k}-${I.id}`)})}),jsx(p,{as:"flex aic jcc flex:1 --pagination-label",children:[`Showing ${(M(b)-1)*n+1} - `,`${Math.min(M(b)*n,t)} of ${t} items`].join(" ")}),jsxs(p,{as:"flex aic jce flex:1 --pgt-btns --pgt-nav",children:[jsx(_,{disabled:M(b)<=1,onClick:I=>Z({id:i?h(M(b)-1):M(b)-1,label:M(b)-1}),children:V.chevronLeftOutline}),jsx(_,{disabled:F.length<=1||M(b)==M(F[F.length-1]),onClick:I=>Z({id:i?h(M(b)+1):M(b)+1,label:M(b)+1}),children:V.chevronRightOutline})]})]})};os.displayName="Zuz.Pagination";var Lt=os;function Jc(e,r){let{items:t,renderItem:n,effect:o="slide",loop:s=true,loopMode:a="infinite",startIndex:l=0,useKeys:u=true,useWheel:c=true,spacing:i=160,rotation:d=20,scaleStep:f=.15,blur:m=4,animation:g="power",showDots:P=false,autoPlay:x=false,autoPlaySpeed:T=3,onChange:S,...R}=e,{className:h,style:v}=B(R),y=useRef(null),b=T/(T>=1e3?1e3:1),E=useCarousel({total:t.length,initialIndex:l,loop:s,useKeys:u,useWheel:c,onChange:O=>{y.current?.setPage({id:O+1,label:O+1}),y.current?.setProgress(0),S?.(O);}}),{pause:$,resume:L,reset:A}=useTimer({duration:b,autoStart:x===true,onProgress:O=>{x===true&&y.current?.setProgress(1-O);},onExpired:()=>{x===true&&E.next(),A();}}),M={...v,"--carousel-spacing":`${i}px`,"--carousel-rotation":`${d}deg`,"--carousel-blur":`${m}px`,"--carousel-scale-step":f,"--active-index":E.index,"--carousel-transition":`var(--${g})`};return jsxs(p,{ref:r,className:`--carousel --effect-${o} --loop-${a} flex cols aic jcc ${h}`.trim(),style:M,children:[jsx(p,{className:"--carousel-stage rel fill flex aic jcc",children:t.map((O,F)=>{let Z=F-E.index;if(a==="infinite"){let k=t.length;Z=((Z+k/2)%k+k)%k-k/2;}let I=F===E.index;return jsx(p,{onMouseEnter:()=>I&&$(),onMouseLeave:()=>I&&L(),className:`--carousel-item-wrapper abs ${I?"--is-active":""}`,style:{"--offset":Z,zIndex:I?100:100-Math.abs(Z),display:Math.abs(Z)>5?"none":"flex"},children:n(O,F,E.index)},F)})}),P&&jsx(Lt,{ref:y,itemCount:t.length,itemsPerPage:1,startPage:l+1,pageRange:t.length,paginationStyle:"gooey",onPageChange:O=>E.goTo(+O.label-1),asDots:true,progressBar:true})]})}var em=forwardRef(Jc),tm=em;var rs=(r=>(r.Line="line",r))(rs||{});var as=forwardRef((e,r)=>{let{data:t,width:n,height:o,lineColor:s,strokeWidth:a=2,gradientStartColor:l,gradientEndColor:u,animated:c,animDuration:i=2,animDelay:d=0,padding:f=0,type:m,...g}=e,{className:P,style:x,rest:T}=B(g),S=useRef(null),R=useResizeObserver(S.current?.parentElement||S),h=typeof n=="number"?n:R.width,v=typeof o=="number"?o:R.height,y={width:h,height:v},b=useId(),{pathD:E,areaPathD:$}=useLineChart(t,y,f+(a||2)),L=useRef(null),A=useRef(null),[M,O]=useState(0),[F,Z]=useState(0);return useEffect(()=>{c&&(L.current&&O(L.current.getTotalLength()),A.current&&Z(A.current.getTotalLength()));},[c,E,$,h,v]),jsx(p,{ref:S,as:`--chart --${m||"line"}-chart ${P}`.trim(),style:{...x,width:n,height:o},...T,children:h>0&&v>0&&jsxs("svg",{viewBox:`0 0 ${h} ${v}`,preserveAspectRatio:"xMidYMid meet",children:[jsx("defs",{children:jsxs("linearGradient",{id:b,x1:"0%",y1:"0%",x2:"0%",y2:"100%",children:[jsx("stop",{offset:"0%",stopColor:l}),jsx("stop",{offset:"100%",stopColor:u})]})}),jsx("path",{ref:A,d:$,fill:`url(#${b})`,stroke:"none",style:c?{strokeDasharray:F,strokeDashoffset:F}:{},children:c&&jsx("animate",{attributeName:"stroke-dashoffset",from:F,to:"0",dur:`${i||2}s`,begin:`${d||0}s`,fill:"freeze"})}),jsx("path",{ref:L,d:E,fill:"none",stroke:s,strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round",style:c?{strokeDasharray:M,strokeDashoffset:M}:{},children:c&&jsx("animate",{attributeName:"stroke-dashoffset",from:M,to:"0",dur:`${i||2}s`,begin:`${d||0}s`,fill:"freeze"})})]})})});as.displayName="Zuz.Chart";var lm=as;var is=(o=>(o[o.Sending=0]="Sending",o[o.Sent=1]="Sent",o[o.Delivered=2]="Delivered",o[o.Read=3]="Read",o))(is||{}),ls=(c=>(c.Image="img",c.Video="vid",c.Audio="audio",c.Link="link",c.Document="doc",c.Location="loc",c.Contact="contact",c.Event="event",c.Poll="poll",c))(ls||{});var cs=forwardRef((e,r)=>{let{text:t,media:n,side:o="me",status:s=1,timeStamp:a=Date.now(),arrow:l=true,...u}=e,{className:c,style:i,rest:d}=B(u);return jsx(p,{className:`--bubble-wrapper flex --bw-${o}`.trim(),children:jsxs(p,{className:`--bubble --bubble-${o} ${n?`--with-media --bma-${n.type}`:""} rel flex cols ${l==true?"--b-arrow":""} ${c}`.trim(),style:{...i},...d,children:[t&&jsx(K,{className:"--bubble-text",children:t}),n?n.type=="audio"?jsxs(p,{as:"flex aic --bubble-audio",children:[jsx(me,{className:"--bm-action",children:V.play}),jsx(Qe,{progress:.7}),jsx(K,{className:"--bm-dur",children:n.duration??"00:13"})]}):n.type=="img"?jsx(p,{as:"--bubble-image",children:jsx(tt,{src:n.source})}):null:null,jsxs(p,{as:"flex aie jce --bubble-stats",children:[jsx(K,{className:"--bubble-stamp tar",children:timeSince(a)}),o=="me"&&jsx(me,{className:`--bubble-status --bs-${s}`,children:s==0?V.pending:s==1?V.done:s==2?V.doneAll:V.doneAll})]})]})})});cs.displayName="Zuz.Bubble";var pm=cs;var ms=forwardRef((e,r)=>{let{style:t,className:n,rest:o}=B(e);return jsx("label",{ref:r,style:t,className:n,...o})});ms.displayName="Zuz.Label";var Mt=ms;var us=({ref:e,...r})=>{let {name:t,required:n,type:o,value:s,size:a,variant:l,checked:u,disabled:c,onSwitch:i,...d}=r,f=it(),m=!!(t&&f.values);m?f.errors?.[t]:null;let P=m?f.values?.[t]:void 0,[x,T]=useState(u||false),S=useRef(null),{variant:R}=j(true),h=useMemo(()=>m&&P!=null?typeof P=="string"?P.toLowerCase()!=="false"&&P!=="":!!P:x,[P,x,m]);useEffect(()=>{S.current&&S.current.checked!==h&&(S.current.checked=h);},[h]),useEffect(()=>{u!==void 0&&T(u);},[u]);let v=y=>{let b=!!y;m&&f.setFieldValue?.(t,b),T(b),i?.(b,s||"cb");};return useImperativeHandle(e,()=>({setChecked(y,b=true){v(y);},toggle(y=true){v(!h);}})),jsxs(Mt,{"aria-hidden":c,className:[`--${(o||Fe.Default).toLowerCase()}`,`${!o||o===Fe.Default?"--checkbox":"--switch"}`,`--${l||R||U.Small}`,`flex aic jcc ${h?"is-checked":""} rel`,`${c?"--disabled":""}`].join(" ").trim(),...d,children:[(!o||o==Fe.Default)&&V.check,jsx(fe,{ref:y=>{S.current=y,e&&(e.current=y);},defaultChecked:h,type:"checkbox",className:"abs",name:t,required:n||false,onChange:y=>{y.stopPropagation(),v(y.target.checked);},disabled:c})]})};us.displayName="Zuz.CheckBox";var Ot=us;var wm=({ref:e,...r})=>{let{code:t,copy:n,lang:o="tsx",showLines:s=false,highlight:a="",as:l,fx:u,...c}=r,i=useRef(null),{className:d,style:f,rest:m}=B({as:`rel p:20 br:8 bg:shade-1 overflow:auto font:mono ${l}`,fx:u},i),g=useMemo(()=>{let x=new Set;return a.split(",").forEach(T=>{if(T.includes("-")){let[S,R]=T.split("-").map(Number);for(let h=S;h<=R;h++)x.add(h);}else T&&x.add(Number(T));}),x},[a]),P=useMemo(()=>{let x=t.split(`
|
|
9
|
-
`);for(;x.length>0&&x[0].trim()==="";)x.shift();for(;x.length>0&&x[x.length-1].trim()==="";)x.pop();let
|
|
8
|
+
document.documentElement.style.colorScheme = theme;`}}),jsx(Vo,{children:e})]})},Gr=(e,r)=>{if(mi)return;let t;try{t=localStorage.getItem(e)||void 0;}catch{}return t||r};var qr=({ref:e,...r})=>{let{style:t,...n}=r,{style:o,className:s,rest:a}=B(n);return jsx("span",{ref:e,style:t,className:s,...a})};qr.displayName="Zuz.Span";var ce=qr;var Yr=forwardRef((e,r)=>{let{name:t,pathCount:n,variant:o,color:s,size:a,...i}=e,{variant:m}=j(true),{className:l,style:c,rest:d}=B(i);return jsx("div",{style:{color:s,...c,...a?{fontSize:a}:{}},className:`icon-${t} --icon --${o||m||U.Small} ${l}`.trim(),ref:r,...d,children:Array(n||0).fill(0).map((u,p)=>jsx(ce,{className:`path${p+1}`},`${t}-layer-${p}`))})});Yr.displayName="Zuz.Icon";var te=Yr;var Se={Simple:"SIMPLE",Roller:"ROLLER",Wave:"Wave"};var jr=e=>{let{type:r,variant:t,color:n,...o}=e,{className:s,style:a,rest:i}=B(o),{spinner:m}=j(true),l=()=>{switch(r||m?.type||Se.Simple){case Se.Simple:return null;case Se.Wave:return jsxs(Fragment$1,{children:[jsx(f,{as:"--bar --bar1"}),jsx(f,{as:"--bar --bar2"}),jsx(f,{as:"--bar --bar3"})]});case Se.Roller:return null}};return jsx(f,{className:`${s} --spinner --${(r||m?.type||Se.Simple).toLowerCase()} --${t||m?.variant||U.Small}`.trim(),style:{...a},...i,children:l()})};jr.displayName="Zuz.Spinner";var Re=jr;var Qr=({ref:e,...r})=>{let{h:t,html:n,children:o,lines:s,tfx:a,delay:i=0,duration:m=.5,stagger:l=.05,repeat:c=true,reveal:d=false,hover:u=false,...p}=r,{style:g,className:T,rest:x}=B(p),P=useRef(null),[S,R]=useState(false),[h]=useIntersectionObserver([P],{threshold:[1]}),v=useMemo(()=>{if(g?.opacity!==void 0)return g.opacity;if(typeof r.as=="string"){let A=r.as.match(/opacity:([\d.]+)/);if(A)return A[1]}return 1},[r.as,g?.opacity]),y=useMemo(()=>a?u?S:d?h===1:true:false,[a,u,S,d,h]);useEffect(()=>{e&&(typeof e=="function"?e(P.current):e.current=P.current);},[e]);let b=`h${r.h||1}`,E=useMemo(()=>typeof o=="string"?o:Array.isArray(o)&&o.length===1&&typeof o[0]=="string"?o[0]:null,[o]),$=useMemo(()=>{let A=Array.isArray(r.as)?r.as.join(" "):r.as||"";return typeof A=="string"&&A.includes("text-clip")},[r.as]);useLayoutEffect(()=>{if(!$||!P.current||E===null)return;let A=P.current,M=0,O=0,F=()=>{let L=A.getBoundingClientRect(),X=getComputedStyle(A).backgroundImage,Y=L.width;A.querySelectorAll(".--fx-char").forEach(z=>{let W=z.getBoundingClientRect().left-L.left;z.style.backgroundImage=X,z.style.backgroundRepeat="no-repeat",z.style.backgroundSize=`${Y}px 100%`,z.style.backgroundPosition=`-${W}px 0`,z.style.backgroundClip="text",z.style.webkitBackgroundClip="text",z.style.color="transparent";});},K=()=>{cancelAnimationFrame(M),cancelAnimationFrame(O),M=requestAnimationFrame(()=>{O=requestAnimationFrame(F);});};K();let I=new ResizeObserver(K);return I.observe(A),typeof document<"u"&&"fonts"in document&&document.fonts?.ready.then(K),window.addEventListener("resize",K),()=>{cancelAnimationFrame(M),cancelAnimationFrame(O),I.disconnect(),window.removeEventListener("resize",K);}},[$,E,a,y]);let k=useMemo(()=>n?jsx(ce,{dangerouslySetInnerHTML:{__html:n}}):a&&E!==null?E.split("").map((A,M)=>{let O=A===" ",K=["typewriter","reveal","fog","slide","pop"].includes(a)?"1":c?"infinite":"1";return jsx(ce,{"data-char":A,className:`--fx-char -fx ${y?`--fx-${a}`:""}`,style:{"--delay":`${i+M*l}s`,"--duration":`${m}s`,"--iteration":K,"--target-opacity":v,display:O?"inline":"inline-block",whiteSpace:"pre",opacity:!y&&a==="typewriter"?0:void 0},children:A},M)}):o,[o,n,a,E,y,i,l,m,c]);return jsx(b,{ref:P,onMouseEnter:()=>u&&R(true),onMouseLeave:()=>u&&R(false),style:a?{...g,display:a?"flex":g?.display,flexWrap:a?"wrap":g?.flexWrap,opacity:a&&!y?0:a?1:g?.opacity,transition:a?"opacity 0.4s ease":void 0}:g,className:`${T} ${a?"--text-fx -fx":""}`.trim(),...x,children:k})};Qr.displayName="Zuz.Text";var _=Qr;var tn=({ref:e,...r})=>{let {title:t,position:n,margin:o=4,anchorName:s="--tooltip-anchor",children:a,show:i,variant:m,...l}=r,{style:c,className:d,rest:u}=B(l),p=n||be.Top;useRef(null);let [T,x]=useState(false);useRef(6);let S=i===true||T,h=`--anchor-${useId().replace(/:/g,"")}`,{tooltip:v}=j(true),y=useMemo(()=>{let E=false;return addPropsToChildren(a,$=>{let k=$.props.className?.includes(s);return k&&(E=true),k||!E},($,k)=>{let A=k.props.className?.includes(s),M=$===0,O={};return (A||M)&&(O.style={...k.props.style,anchorName:h}),M&&(O.onMouseEnter=F=>{x(true),k.props.onMouseEnter?.(F);},O.onMouseLeave=F=>{x(false),k.props.onMouseLeave?.(F);}),O})},[a,s,h]),b=ve({transition:p==be.Top?Q.SlideInTop:p==be.Bottom?Q.SlideInBottom:p==be.Left?Q.SlideInLeft:Q.SlideInRight,when:S,duration:.2,offset:o+6,margin:p==be.Top||p==be.Left?-o:o,curve:v?.curve||oe.EaseInOut});return useImperativeHandle(e,()=>({show:()=>x(true),hide:()=>x(false),setPosition:()=>{}})),jsxs(Fragment$1,{children:[y,jsx(f,{style:{positionAnchor:h,...b.style,...p===be.Top||p===be.Bottom?{"--fx-x":"-50%"}:{"--fx-y":"-50%"}},as:`--tooltip --visb-${S} --${m||v?.variant||U.Small} --${p} abs ${d}`.trim(),children:typeof t=="string"?jsx(_,{as:"--text rel",children:t}):t})]})};tn.displayName="Zuz.ToolTip";var Pt=tn;var qt={Loading:"loading",Normal:"normal"};var rn=({ref:e,...r})=>{let{reset:t,kind:n="solid",variant:o,tooltip:s,tooltipProps:a,icon:i,iconSize:m,children:l,withLabel:c,spinner:d,state:u,disabled:p,...g}=r,{style:T,className:x,rest:P}=B(g),{variant:S}=j(true),R=jsxs("button",{className:removeDuplicateWords(`--button ${s?"--tooltip-anchor":""} --${n} --${o||S} flex aic ${t?"":"jcc"} ${i?"--with-icon":""} ${x}`).trim().replace(/\s+/g," "),style:T,ref:e,disabled:u==qt.Loading||r.skeleton?.enabled||p,...P,children:[u==qt.Loading&&jsx(Re,{variant:o||S,type:d||Se.Simple}),(!u||u==qt.Normal)&&jsxs(Fragment$1,{children:[i&&jsx(te,{variant:m,name:i}),c===true?jsx(ce,{children:l}):l]})]});return s?jsx(Pt,{title:s,...a,children:R}):R};rn.displayName="Zuz.Button";var Z=rn;var Li=e=>{let{label:r,labelColor:t,icon:n,iconColor:o,index:s,className:a,onSelect:i}=e;return r=="-"?jsx(f,{className:"--line"}):jsxs(Z,{reset:true,onClick:m=>i?.(e),className:`--item ${a||""}`.trim(),children:[jsx(f,{as:"--icon",children:jsx(te,{name:n,className:"--ico",style:o?{color:o}:{}})}),jsx(_,{className:"--lbl flex aic",style:t?{color:t}:{},children:r})]})},nn=Li;var ln=({ref:e,...r})=>{let{id:t,as:n,fx:o,offsetX:s,offsetY:a,parent:i,event:m,arrow:l,when:c,items:d,header:u,footer:p,origin:g=wt.TopRight,...T}=r,[x,P]=useState(false),[S,R]=useState(d||[]),{position:h,targetRef:v,calculatedAnchor:y}=useAnchorPosition(i?.current,m,{offsetX:s,offsetY:a,preferredAnchor:g}),E=i&&h.top>i.current.getBoundingClientRect().bottom?"--arrow-top":"--arrow-bottom",$=useMemo(()=>{let K=y.toLowerCase();return K.includes("left")?"--arrow-left":K.includes("right")?"--arrow-right":"--arrow-center"},[y]),k=h.top!==0||h.left!==0;useEffect(()=>{c&&k?P(true):c||P(false);},[c,k]);let{className:A,style:M,rest:O}=B(T),F=ve({...o?.transition?{transition:o.transition??Q.SlideInBottom}:{from:{opacity:0,scale:.8,y:-10},to:{opacity:1,scale:1,y:0}},curve:o?.curve??oe.EaseInOut,duration:o?.duration??.05,when:x&&k});return jsxs(f,{ref:v,className:`--contextmenu ${l||i!=null?`--has-arrow ${E} ${$}`:""} abs flex cols ${A}`.trim(),"aria-hidden":!x,style:{...M,...F.style,top:h.top,left:h.left,visibility:k?"visible":"hidden",transformOrigin:y},...O,children:[typeof u=="function"?createElement(u):u,S.map((K,I)=>jsx(nn,{...K,index:I},`context-${K.label.toLowerCase()}-${I}`)),typeof p=="function"?createElement(p):p]})};ln.displayName="Zuz.ContextMenu";var Ho=ln;var cn=forwardRef((e,r)=>{let{children:t,fx:n,when:o,fxDelay:s,fxStep:a,classToIgnore:i,...m}=e,l=j(true),c=useDelayed(),d=n||l?.group?.fx,u=s||l?.group?.fxDelay,p=a||l?.group?.fxStep,g=i||l?.group?.classToIgnore||"-fx",T=useMemo(()=>d?addPropsToChildren(t,x=>{if(x.type===Fragment)return false;let P=x.props||{},S="fx"in P,R="tfx"in P,h=P.as?Array.isArray(P.as)?P.as.join(" "):P.as:P.className||"";return !(typeof h=="string"&&h.includes(g))&&(!S||R)},(x,P)=>{let S=(u??0)+x*(p??.1),R=P.props||{};return "tfx"in R?{delay:(R.delay??0)+S}:{fx:{...d,delay:S,when:o??(n?.when||c)}}}):t,[t,o,c,d,u,p,g,n]);return jsx(f,{className:"--group",ref:r,...m,children:T})});cn.displayName="Zuz.Group";var Ao=cn;var pn=forwardRef((e,r)=>{let{message:t,spinner:n,spinnerSize:o,color:s,when:a,hideMessage:i,...m}=e,{className:l,style:c,rest:d}=B(m),{spinner:u}=j(true);return "when"in e&&e.when==false?null:jsxs(Ao,{fx:{transition:Q.SlideInBottom,curve:oe.Liquid,duration:.5},fxDelay:.1,fxStep:.05,className:`--cover flex aic jcc cols abs fill nope nous ${l}`.trim(),style:{...c,backgroundColor:"var(--cover-bg)"},...d,children:[jsx(Re,{variant:o||u?.variant||U.Small,type:n||u?.type||Se.Simple}),!i&&jsx(_,{className:"--label",tfx:"fade",style:{color:"var(--cover-label)"},children:t||"loading"})]})});pn.displayName="Zuz.Cover";var $e=pn;var jt=(s=>(s.Default="default",s.Success="success",s.Error="error",s.Warn="warn",s.Promise="promise",s))(jt||{}),Qt=(a=>(a.TopLeft="TopLeft",a.TopCenter="TopCenter",a.TopRight="TopRight",a.BottomLeft="BottomLeft",a.BottomCenter="BottomCenter",a.BottomRight="BottomRight",a))(Qt||{}),un=(t=>(t.Stack="stack",t.Individual="individual",t))(un||{}),fn={success:"Action Successful",error:"Something Went Wrong",warn:"Heads Up",default:"Notice"};var qi=()=>{let e=useContext(Ie);if(!e)throw new Error("useToast must be used inside <LayersProvider>");let r=(l,c)=>e.add({type:"toast",props:{...c,type:l}});return {show:(l,c,d,u)=>r("default",{title:l,message:c,icon:d,duration:u}),hide:l=>e.remove(l),success:(l,c,d,u)=>r("success",{title:l,message:c,icon:d,duration:u}),error:(l,c,d,u)=>r("error",{title:l,message:c,icon:d,duration:u}),warn:(l,c,d,u)=>r("warn",{title:l,message:c,icon:d,duration:u}),promise:(l,c,d,u)=>r("promise",{title:l,message:c,icon:d,duration:u}),clearAll:()=>e.clear("toast")}},$o=qi;var dn=forwardRef((e,r)=>{let{when:t,...n}=e;return jsx(f,{ref:r,"aria-hidden":!t,className:"--overlay fixed fill",fx:{transition:Q.FadeIn,when:t},...n})});dn.displayName="Zuz.Overlay";var et=dn;var Ze=null,Ee=null,hn=forwardRef((e,r)=>{let{title:t,message:n,transition:o,curve:s,speed:a,type:i,actionPosition:m,spinner:l,loadingMessage:c,onShow:d,onHide:u,...p}=e,{className:g,style:T,rest:x}=B(p),[P,S]=useState(t||""),[R,h]=useState(n||""),[v,y]=useState(null),[b,E]=useState(i||Le.Default),$=useMemo(()=>uuid(12),[]),[k,A]=useState(false),M=useRef(null),O=useRef(null),[F,K]=useState(false),[I,L]=useState(true),X=useRef(null),Y=R;useImperativeHandle(r,()=>({setLoading(z){K(z);},showDialog(z,G,W,re){Ze&&(clearTimeout(Ze),Ee&&clearTimeout(Ee),M.current.classList.remove("--wobble"),setTimeout(()=>M.current.classList.add("--wobble"),50),Ee=setTimeout(()=>{M.current.classList.remove("--wobble"),Ee=null;},500)),E(Le.Dialog),G&&h(G),z&&S(z),W&&y(W.reduce((J,le)=>(J.push({...le,key:le.key||uuid(12)}),J),[])),A(true),setTimeout(()=>re?re():()=>{},1e3);},dialog(z,G,W,re){Ze&&(clearTimeout(Ze),Ee&&clearTimeout(Ee),M.current.classList.remove("--wobble"),setTimeout(()=>M.current.classList.add("--wobble"),50),Ee=setTimeout(()=>{M.current.classList.remove("--wobble"),Ee=null;},500)),E(Le.Dialog),h(G),S(z),W&&y(W.reduce((J,le)=>(J.push({...le,key:le.key||uuid(12)}),J),[])),A(true),setTimeout(()=>re?re():()=>{},1e3);},error(z,G){this.show(z,G,Le.Error);},warn(z,G){this.show(z,G,Le.Warn);},success(z,G){this.show(z,G,Le.Success);},show(z,G,W){Ze&&(clearTimeout(Ze),Ee&&clearTimeout(Ee),O.current=M.current.style.transform,M.current.style.transform="",M.current.classList.remove("--wobble"),setTimeout(()=>{M.current.classList.add("--wobble"),M.current.style.transform=`${O.current} scale(.9)`.trim();},50),Ee=setTimeout(()=>{M.current.classList.remove("--wobble"),M.current.style.transform=O.current||"",Ee=null;},500)),Ze=setTimeout(()=>{A(false),Ze=null,Ee=null;},(G||4)*1e3),E(W||Le.Default),h(z),A(true),d?.();},hide(){A(false),u?.();}}));let H=useMemo(()=>{let z={when:k,duration:a||.3,delay:.1};if(b==Le.Dialog){if(o){let{from:G,to:W}=Ct(o,20);return {from:G,to:W,curve:s||oe.EaseInOut,...z}}return {from:{scale:0,x:"-50%",y:"-50%",opacity:0},to:{scale:1,x:"-50%",y:"-50%",opacity:1},curve:oe.Spring,...z}}else return {from:{scale:0,x:"-50%",y:"-10vh",opacity:0},to:{scale:1,x:"-50%",y:0,opacity:1},curve:oe.Spring,...z}},[k,b]);return useEffect(()=>{X.current&&clearTimeout(X.current),k?L(true):X.current=setTimeout(()=>L(false),1e3);},[k]),b==Le.Dialog?jsxs(Fragment$1,{children:[jsx(et,{when:k}),jsxs(f,{className:`--sheet --sheet-${b.toLowerCase()} ${k?"is-visible":""} ${g} fixed`.trim(),style:T,fx:H,...x,ref:M,children:[jsx($e,{when:F,spinner:l,message:c}),jsxs(f,{className:"--head flex aic rel",children:[jsx(f,{className:`--${P?"title":"dot"} flex aic rel`,children:P||""}),jsx(Z,{onClick:z=>A(false),className:"--closer abs",children:"\xD7"})]}),jsx(f,{className:`--body flex aic rel ${v?"":"--no-action"}`.trim(),children:I?Y:null}),v&&jsx(f,{className:`--footer flex aic rel ${m?m==Ro.Center?"jcc":"":"jce"}`.trim(),children:v.map((z,G)=>jsx(Z,{onClick:W=>z.handler?z.handler():z.onClick?z.onClick():console.log("onClick Handler missing"),className:"--action",children:z.label},`sheet-${$}-action-${z.key}`))})]})]}):jsx(f,{className:`--sheet --sheet-${b.toLowerCase()} ${g} abs`.trim(),style:T,...x,fx:H,ref:M,children:k?R:null})}),yn=e=>typeof e=="object"&&e!=null&&"setLoading"in e&&"success"in e&&"error"in e;hn.displayName="Zuz.Sheet";var el=hn;var Rt=createContext(null),Wo=()=>{let e=useContext(Rt);return e?useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot):null},It=()=>useContext(Rt),bn=()=>()=>{},vn=e=>{let r=useContext(Rt);return useSyncExternalStore(r?.subscribe??bn,()=>{if(!(!r||!e))return r.getSnapshot().values?.[e]},()=>{})},Sn=e=>{let r=useContext(Rt);return useSyncExternalStore(r?.subscribe??bn,()=>!r||!e?null:r.getSnapshot().errors?.[e]??null,()=>null)},lt=()=>{let e=It(),r=Wo();return {...e,...r}},wn=({children:e,initialValues:r={}})=>{let t=useRef({values:r,errors:{},touched:{}}),n=useRef(new Set(Object.keys(r))),o=useRef(new Set),s=useCallback(()=>t.current,[]),a=useCallback(l=>(o.current.add(l),()=>o.current.delete(l)),[]),i=()=>{o.current.forEach(l=>l());};useEffect(()=>{if(!r||Object.keys(r).length===0)return;let l=new Set(Object.keys(r)),c=[...n.current].filter(P=>!l.has(P)),d={...t.current.values};c.forEach(P=>delete d[P]);let u={...d,...r},p=t.current.values||{},g=Object.entries(u),T=Object.entries(p),x=g.length!==T.length||g.some(([P,S])=>p[P]!==S);n.current=l,x&&(t.current={...t.current,values:u},i());},[r]);let m=useMemo(()=>({subscribe:a,getSnapshot:s,setFieldValue:(l,c)=>{t.current.values[l]!==c&&(t.current={...t.current,values:{...t.current.values,[l]:c}},i());},deleteFieldValue:l=>{if(!(l in t.current.values))return;let{[l]:c,...d}=t.current.values;t.current={...t.current,values:d},i();},setFieldError:(l,c)=>{t.current={...t.current,errors:{...t.current.errors,[l]:c}},i();},reset:()=>{t.current={values:{},errors:{},touched:{}},i();}}),[]);return jsx(Rt.Provider,{value:m,children:e})};var ul=e=>{let r={};for(let t in e){let n=t.split(/[\[\]]+/).filter(Boolean);n.reduce((o,s,a)=>{if(a===n.length-1)o[s]=e[t];else {let i=!isNaN(Number(n[a+1]));o[s]=o[s]||(i?[]:{});}return o[s]},r);}return r},Cn=({ref:e,...r})=>{let {schema:t,name:n,cover:o,spinner:s,errors:a,action:i,children:m,withData:l,beforeSubmit:c,onSubmit:d,onError:u,onSuccess:p,resetOnSuccess:g,...T}=r,{className:x,style:P,rest:S}=B(T),[R,h]=useState(false),v=useRef(null),y=$o(),b=It();Wo();let $=useRef(null),k=useCallback(H=>v.current?v.current.querySelectorAll(H):[],[v.current]),A=H=>({name:H.name||H.getAttribute("name")||H.getAttribute("data-name"),required:H.required?true:H.getAttribute("data-required")?H.getAttribute("data-required")=="true":false,with:H.with||H.getAttribute("with")}),M=H=>{let z=[];return H.querySelectorAll(".--input").forEach(G=>{z.push(G.value);}),z.join("")},O=H=>H.classList.contains("--otp")?M(H):H.classList.contains("--select")?H.querySelector("button.--selected")?.dataset.value:H.classList.contains("--checkbox")||H.getAttribute("type")==="checkbox"?H.checked:H.value,F=useCallback(H=>{let{name:z,required:G,with:W}=A(H),re=O(H);if(t&&t[z]&&b?.getSnapshot()){let J=t[z](re,b.getSnapshot().values);if(J===false||typeof J=="string")return typeof J=="string"&&b?.setFieldError(z,J),false}if(G&&(H.type==="checkbox"&&!H.checked||H.classList.contains("--select")&&(re==="-1"||!re)||!re||re===""))return false;if(W)switch((W.includes("@")?W.split("@")[0]=="match"?Qe.MatchField:W.split("@")[0]:W).toUpperCase()){case Qe.IPV4:return _$1(re).isIPv4();case Qe.IPV6:return _$1(re).isIPv6();case Qe.Email:return _$1(re).isEmail();case Qe.Uri:try{return new URL(re),!0}catch{return false}case Qe.MatchField:let[le,me,we]=W.split("@"),ie=document.querySelector(`[name=${me.trim()}]`);if(!ie)return false;switch(we||"direct-match"){case "if-not-empty":if(ie&&!_$1(ie.value).isEmpty()&&ie.value!=H.value)return false;break;case "direct-match":if(ie&&ie.classList.contains("--otp")&&H.classList.contains("--otp")&&M(ie)!=M(H))return false;if(ie&&ie.value!=H.value)return false;break}break}return true},[t,b]),K=useCallback(()=>{let H={},z={...b?.getSnapshot().values||{}},G=null,W=null;if(k("[name]").forEach(J=>{let{name:le,required:me,with:we}=A(J),ie=me||we?F(J):true,pe=O(J);H[le]={valid:ie,value:pe},z[le]=pe,b?.setFieldError(le,ie?null:a?.[le]||"Invalid"),ie?J.classList.remove("--with-error"):(J.classList.add("--with-error"),G||(G=J),W=a?.[le]);}),G){let J=G;if(J.classList.contains("--otp"))for(let le of Array.from(J.querySelectorAll(".--input"))){let me=le;if(me.value==""){me.focus();break}}else J.focus();}let re=ul(z);return {error:G!=null,errorMsg:W||"Fix errors to continue...",data:H,payload:re}},[v.current,b]),I=useCallback((H={})=>{let{error:z,errorMsg:G,payload:W,data:re}=K();if(z){y.error(G);return}i?startTransition(async()=>{h(true),withPost(i,{...l,...W,...H}).then(J=>{h(false),g&&b?.reset(),p?.(J,{...l,...W,...H}),p||y.success(J.message||"Redirecting...");}).catch(J=>{h(false),u?u(J):y.error(J.message);});}):d?.(W,re);},[K,i,l,p,u,g,d]),L=useCallback(()=>{let H=k("[type=submit]");!H||H.length==0?console.warn("You should add at least 1 button with type=`SUBMIT`"):H.forEach(z=>{z.addEventListener("click",I);});},[v.current]),X=useMemo(()=>addPropsToChildren(m,H=>H.props.type=="submit",H=>({ref:$})),[m]),Y=useRef(I);return useImperativeHandle(e,()=>({setLoading:H=>h(H),submit:H=>Y.current(H),init:L,hideError:()=>y.clearAll()}),[I,L]),useEffect(L,[]),useEffect(()=>{Y.current=I;},[I]),useEffect(()=>{let H=k("[type=submit]"),z=Array.from(H).map(G=>{let W=G;return W.addEventListener("click",I),()=>W.removeEventListener("click",I)});return ()=>z.forEach(G=>G())},[I,k]),jsxs(f,{ref:v,style:P,className:`--form flex rel ${x}`,children:[!yn(o)&&jsx($e,{when:R,spinner:s,...o}),X]})};Cn.displayName="Zuz.FormInternal";var Tn=e=>jsx(wn,{initialValues:e.withData,children:jsx(Cn,{...e})});Tn.displayName="Zuz.Form";var Xo=Tn;var Yo=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(r){return this.stack[this.stack.length-1]===r}push(r){this.stack.includes(r)||(this.stack.push(r),this.updateScrollLock());}pop(r){this.stack=this.stack.filter(t=>t!==r),this.updateScrollLock();}handleEscape(){let r=this.stack[this.stack.length-1];return r?(r(),true):false}get count(){return this.stack.length}},Ve=new Yo;var dl=({action:e,render:r=true,message:t=""})=>jsx(f,{as:`--body flex aic rel ${e?"":"--no-action"}`.trim(),children:r?t:null}),Pn=dl;var Rn=({cols:e,gap:r,ais:t,aic:n,aie:o,jcs:s,jcc:a,jce:i,className:m="",style:l,...c})=>{let d=["--flex",e?"--cols":"",t?"--ais":"",n?"--aic":"",o?"--aie":"",s?"--jcs":"",a?"--jcc":"",i?"--jce":"",m].filter(Boolean).join(" "),u={...l,gap:typeof r=="number"?`${r}px`:r};return jsx(f,{...c,className:d,style:u})};Rn.displayName="Zuz.FlexBox";var Ce=Rn;var yl=({useForm:e,action:r,actionPosition:t,dialogID:n,variant:o})=>jsx(Ce,{aic:true,as:`--footer rel ${t?t==$r.Center?"--jcc":"":"--jce"}`.trim(),children:r.map((s,a)=>jsx(Z,{variant:o,kind:s.kind,type:s.type||"button",onClick:()=>{if(!(e===true&&s.type==="submit")){if(s.handler)return s.handler();if(s.onClick)return s.onClick();console.log("onClick Handler missing");}},as:"--action",children:s.label},`dialog-${n}-action-${s.key||a}`))}),En=yl;var xl={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"})," "]}),[ke.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"})}),[ke.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"})}),[ke.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"})}),[ke.Success]:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",children:jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"})}),layers:jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 24 24",fill:"none",children:[jsx("path",{d:"M19.3697 4.89109L13.5097 2.28109C12.6497 1.90109 11.3497 1.90109 10.4897 2.28109L4.62969 4.89109C3.14969 5.55109 2.92969 6.45109 2.92969 6.93109C2.92969 7.41109 3.14969 8.31109 4.62969 8.97109L10.4897 11.5811C10.9197 11.7711 11.4597 11.8711 11.9997 11.8711C12.5397 11.8711 13.0797 11.7711 13.5097 11.5811L19.3697 8.97109C20.8497 8.31109 21.0697 7.41109 21.0697 6.93109C21.0697 6.45109 20.8597 5.55109 19.3697 4.89109Z",fill:"#292D32"}),jsx("path",{d:"M12.0003 17.04C11.6203 17.04 11.2403 16.96 10.8903 16.81L4.15031 13.81C3.12031 13.35 2.32031 12.12 2.32031 10.99C2.32031 10.58 2.65031 10.25 3.06031 10.25C3.47031 10.25 3.80031 10.58 3.80031 10.99C3.80031 11.53 4.25031 12.23 4.75031 12.45L11.4903 15.45C11.8103 15.59 12.1803 15.59 12.5003 15.45L19.2403 12.45C19.7403 12.23 20.1903 11.54 20.1903 10.99C20.1903 10.58 20.5203 10.25 20.9303 10.25C21.3403 10.25 21.6703 10.58 21.6703 10.99C21.6703 12.11 20.8703 13.35 19.8403 13.81L13.1003 16.81C12.7603 16.96 12.3803 17.04 12.0003 17.04Z",fill:"#292D32"}),jsx("path",{d:"M12.0003 22.0009C11.6203 22.0009 11.2403 21.9209 10.8903 21.7709L4.15031 18.7709C3.04031 18.2809 2.32031 17.1709 2.32031 15.9509C2.32031 15.5409 2.65031 15.2109 3.06031 15.2109C3.47031 15.2109 3.80031 15.5409 3.80031 15.9509C3.80031 16.5809 4.17031 17.1509 4.75031 17.4109L11.4903 20.4109C11.8103 20.5509 12.1803 20.5509 12.5003 20.4109L19.2403 17.4109C19.8103 17.1609 20.1903 16.5809 20.1903 15.9509C20.1903 15.5409 20.5203 15.2109 20.9303 15.2109C21.3403 15.2109 21.6703 15.5409 21.6703 15.9509C21.6703 17.1709 20.9503 18.2709 19.8403 18.7709L13.1003 21.7709C12.7603 21.9209 12.3803 22.0009 12.0003 22.0009Z",fill:"#292D32"})]}),play:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:jsx("path",{d:"M8 5v14l11-7z"})}),pause:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:jsx("path",{d:"M6 19h4V5H6zm8-14v14h4V5z"})}),next:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:jsx("path",{d:"m6 18 8.5-6L6 6zM16 6v12h2V6z"})}),prev:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:jsx("path",{d:"M6 6h2v12H6zm3.5 6 8.5 6V6z"})}),volumeHigh:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:jsx("path",{fill:"#292D32",d:"M22 11.25h-1.25V10c0-.41-.34-.75-.75-.75s-.75.34-.75.75v1.25H18c-.41 0-.75.34-.75.75s.34.75.75.75h1.25V14c0 .41.34.75.75.75s.75-.34.75-.75v-1.25H22c.41 0 .75-.34.75-.75s-.34-.75-.75-.75M14.02 3.782c-1.12-.62-2.55-.46-4.01.45l-2.92 1.83c-.2.12-.43.19-.66.19H5c-2.42 0-3.75 1.33-3.75 3.75v4c0 2.42 1.33 3.75 3.75 3.75h1.4300000000000002c.23 0 .46.07.66.19l2.92 1.83c.88.55 1.74.82 2.54.82a3 3 0 0 0 1.47-.37c1.11-.62 1.73-1.91 1.73-3.63v-9.18c0-1.72-.62-3.01-1.73-3.63"})}),volumeMute:jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[jsx("path",{fill:"#292D32",d:"M18 16.75a.75.75 0 0 1-.6-1.2 5.93 5.93 0 0 0 .72-5.84.75.75 0 0 1 .4-.98c.38-.16.82.02.98.4 1.02 2.42.67 5.23-.9 7.33-.15.19-.37.29-.6.29"}),jsx("path",{fill:"#292D32",d:"M19.828 19.25a.75.75 0 0 1-.6-1.2c2.14-2.85 2.61-6.67 1.23-9.96a.75.75 0 0 1 .4-.98c.38-.16.82.02.98.4 1.59 3.78 1.05 8.16-1.41 11.44-.14.2-.37.3-.6.3M14.04 12.958c.63-.63 1.71-.18 1.71.71v2.93c0 1.72-.62 3.01-1.73 3.63a3 3 0 0 1-1.47.37c-.8 0-1.66-.27-2.54-.82l-.64-.4c-.54-.34-.63-1.1-.18-1.55zM21.77 2.229c-.3-.3-.79-.3-1.09 0l-4.95 4.95c-.06-1.6-.66-2.8-1.72-3.39-1.12-.62-2.55-.46-4.01.45l-2.91 1.82c-.2.12-.43.19-.66.19H5c-2.42 0-3.75 1.33-3.75 3.75v4c0 2.42 1.33 3.75 3.75 3.75h.16l-2.94 2.94c-.3.3-.3.79 0 1.09.16.14.35.22.55.22s.39-.08.54-.23l18.46-18.46c.31-.3.31-.78 0-1.08"})]}),plus:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:jsx("path",{d:"M28 14H18V4a2 2 0 0 0-4 0v10H4a2 2 0 0 0 0 4h10v10a2 2 0 0 0 4 0V18h10a2 2 0 0 0 0-4"})}),add:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:jsx("path",{d:"M12 2C6.49 2 2 6.49 2 12s4.49 10 10 10 10-4.49 10-10S17.51 2 12 2m4 10.75h-3.25V16c0 .41-.34.75-.75.75s-.75-.34-.75-.75v-3.25H8c-.41 0-.75-.34-.75-.75s.34-.75.75-.75h3.25V8c0-.41.34-.75.75-.75s.75.34.75.75v3.25H16c.41 0 .75.34.75.75s-.34.75-.75.75"})}),chevronUp:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 24 24",children:jsx("path",{d:"m7 14 5-5 5 5z"})}),chevronBottom:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 24 24",children:jsx("path",{d:"m7 10 5 5 5-5z"})}),chevronRight:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 24 24",children:jsx("path",{d:"m10 17 5-5-5-5v10z"})}),chevronLeft:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 24 24",children:jsx("path",{d:"m14 7-5 5 5 5V7z"})}),chevronRightOutline:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 24 24",children:jsx("path",{d:"M8.59 16.59 13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"})}),chevronLeftOutline:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 24 24",children:jsx("path",{d:"M15.41 16.59 10.83 12l4.58-4.59L14 6l-6 6 6 6 1.41-1.41z"})}),chevronUpOutline:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 24 24",children:jsx("path",{d:"M7.41 15.41 12 10.83l4.59 4.58L18 14l-6-6-6 6z"})}),chevronDownOutline:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 24 24",children:jsx("path",{d:"M7.41 8.59 12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z"})}),bezier:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 24 24",fill:"none",children:jsx("path",{d:"M19.14 7.72C19.43 8.47 20.15 9 21 9C22.1 9 23 8.1 23 7C23 5.9 22.1 5 21 5C20.15 5 19.43 5.53 19.14 6.28C19.09 6.27 19.05 6.25 19 6.25H15V5.5C15 4.68 14.32 4 13.5 4H10.5C9.68 4 9 4.68 9 5.5V6.25H5C4.95 6.25 4.91 6.27 4.86 6.28C4.57 5.53 3.85 5 3 5C1.9 5 1 5.9 1 7C1 8.1 1.9 9 3 9C3.85 9 4.57 8.47 4.86 7.72C4.91 7.73 4.95 7.75 5 7.75H7.57C5.52 9.27 4.25 11.79 4.25 14.5C4.25 14.67 4.26 14.83 4.28 15H4C3.17 15 2.5 15.67 2.5 16.5V18.5C2.5 19.33 3.17 20 4 20H6C6.22 20 6.42 19.95 6.61 19.86C7.13 19.64 7.5 19.11 7.5 18.5V16.5C7.5 15.67 6.83 15 6 15H5.77C5.77 14.97 5.78 14.94 5.78 14.91C5.76 14.77 5.76 14.64 5.76 14.5C5.76 12.03 7.03 9.77 9.02 8.6C9.06 9.37 9.71 10 10.5 10H13.5C14.29 10 14.94 9.37 14.99 8.6C16.98 9.77 18.25 12.04 18.25 14.5C18.25 14.64 18.24 14.77 18.23 14.91C18.23 14.94 18.24 14.97 18.24 15H18C17.17 15 16.5 15.67 16.5 16.5V18.5C16.5 19.11 16.87 19.64 17.39 19.86C17.58 19.95 17.78 20 18 20H20C20.83 20 21.5 19.33 21.5 18.5V16.5C21.5 15.67 20.83 15 20 15H19.72C19.74 14.83 19.75 14.67 19.75 14.5C19.75 11.79 18.48 9.27 16.43 7.75H19C19.05 7.75 19.09 7.73 19.14 7.72Z",fill:"#292D32"})}),mouse:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 24 24",fill:"none",children:jsx("path",{d:"M13.2978 2.11468C13.0064 2.06339 12.75 2.29593 12.75 2.59185V5.45262C12.75 5.65098 12.8709 5.82564 13.0359 5.93583C13.5391 6.27202 13.87 6.84597 13.87 7.49906V9.49906C13.87 10.5291 13.03 11.3791 12 11.3791C10.96 11.3791 10.12 10.5291 10.12 9.49906V7.49906C10.12 6.84578 10.4583 6.27168 10.9639 5.93554C11.1291 5.82572 11.25 5.65098 11.25 5.45262V2.59249C11.25 2.29634 10.9935 2.0637 10.7019 2.11513C9.15243 2.38834 7.76579 3.13327 6.7 4.19906C5.34 5.55906 4.5 7.43906 4.5 9.49906V14.4991C4.5 18.6291 7.87 21.9991 12 21.9991C16.13 21.9991 19.5 18.6291 19.5 14.4991V9.49906C19.5 5.80857 16.813 2.73328 13.2978 2.11468Z",fill:"#292D32"})}),addKey:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 24 24",fill:"none",children:jsx("path",{d:"M20.9498 14.55L14.5598 20.94C13.1598 22.34 10.8598 22.34 9.44977 20.94L3.05977 14.55C1.65977 13.15 1.65977 10.85 3.05977 9.44L9.44977 3.05C10.8498 1.65 13.1498 1.65 14.5598 3.05L20.9498 9.44C22.3498 10.85 22.3498 13.15 20.9498 14.55Z",fill:"#292D32"})}),calendar:jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[jsx("path",{fill:"#292D32",d:"M8.25 5.75c-.41 0-.75-.34-.75-.75V2c0-.41.34-.75.75-.75S9 1.59 9 2v3c0 .41-.34.75-.75.75M15.75 5.75c-.41 0-.75-.34-.75-.75V2c0-.41.34-.75.75-.75s.75.34.75.75v3c0 .41-.34.75-.75.75M12 14.09c.52 0 .9-.31.9-.8 0-.5-.38-.79-.9-.79s-.9.29-.9.79c0 .49.38.8.9.8M12 17c.629 0 1.14-.416 1.14-.93 0-.513-.511-.93-1.14-.93-.63 0-1.14.417-1.14.93s.51.93 1.14.93"}),jsx("path",{fill:"#292D32",d:"M19.57 4.5c-.66-.49-1.61-.02-1.61.81v.1c0 1.17-.84 2.25-2.01 2.37-1.35.14-2.49-.92-2.49-2.24V4.5c0-.55-.45-1-1-1h-.92c-.55 0-1 .45-1 1v1.04c0 .79-.41 1.49-1.03 1.88-.09.06-.19.11-.29.16q-.135.075-.3.12c-.12.04-.25.07-.39.08q-.24.03-.48 0c-.14-.01-.27-.04-.39-.08q-.15-.045-.3-.12c-.1-.05-.2-.1-.29-.16-.63-.44-1.03-1.2-1.03-2.01v-.1c0-.77-.82-1.23-1.47-.9-.01.01-.02.01-.03.02-.04.02-.07.04-.11.07-.03.03-.07.05-.1.08-.28.22-.53.47-.74.74-.11.12-.2.25-.28.38a3.498 3.498 0 0 0-.27.46c-.02.02-.03.03-.03.05-.06.12-.12.24-.16.37-.03.05-.04.09-.06.14-.06.15-.1.3-.14.45-.04.14-.07.29-.09.44a5.902 5.902 0 0 0-.06.76v8.76A4.87 4.87 0 0 0 7.37 22h9.26a4.87 4.87 0 0 0 4.87-4.87V8.37c0-1.59-.76-2.98-1.93-3.87M12 18.25c-1.55 0-2.5-.77-2.5-2.01 0-.68.35-1.27.96-1.62-.44-.31-.73-.77-.73-1.4 0-1.3 1.04-1.97 2.27-1.97s2.26.67 2.26 1.97c0 .63-.28 1.09-.73 1.4.62.35.97.94.97 1.62 0 1.24-.96 2.01-2.5 2.01"})]}),done:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:jsx("path",{d:"M9 16.2 4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4z"})}),doneAll:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:jsx("path",{d:"m18 7-1.41-1.41-6.34 6.34 1.41 1.41zm4.24-1.41L11.66 16.17 7.48 12l-1.41 1.41L11.66 19l12-12zM.41 13.41 6 19l1.41-1.41L1.83 12z"})}),pending:jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[jsx("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2M12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"}),jsx("path",{d:"M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z"})]})},V=xl;var bl=({title:e="Alert",description:r,titlePosition:t="center",onClose:n})=>jsxs(Ce,{as:"--head rel",children:[jsxs(Ce,{cols:true,as:[`--${e?"title":"dot"} rel`,`--position-${t}`],children:[jsx(_,{children:e}),r&&jsx(_,{as:"--description",children:r})]}),jsx(Z,{onClick:o=>n(),className:`--closer abs ${t=="center"?"center-v":""}`,children:V.close})]}),Bn=bl;var Mn=({ref:e,...r})=>{let{index:t,id:n,title:o,description:s,titleAlignment:a,message:i,content:m,transition:l,curve:c,speed:d,type:u,width:p,action:g,actionPosition:T,spinner:x,loadingMessage:P,variant:S,inBackground:R,forceClose:h,forceLoading:v,useForm:y,formProps:b,onConfirm:E,onCancel:$,onClose:k,onShow:A,onHide:M,...O}=r,F=useMemo(()=>uuid(12),[]),[K,I]=useState(o||""),[L,X]=useState(s||""),[Y,H]=useState(m||i||""),[z,G]=useState(u||Je.Dialog),[W,re]=useState(false),[J,le]=useState(true),[me,we]=useState(()=>g?g.map(Oe=>({...Oe,key:Oe.key||uuid(12)})):null),[ie,pe]=useState(false),{variant:q,spinner:se,dialog:ne}=j(true),ge=S||ne?.variant||q||U.Small,{style:He,className:Te,rest:he}=B(O),Me=useRef(null),ae=ve({when:W,duration:d||ne?.speed||.3,delay:ne?.delay||.1,transition:l||ne?.transition||Q.SlideInBottom,curve:c||ne?.curve||oe.EaseInOut,watch:["scale","filter","transform"]}),xe=()=>{re(false),k(n);},zt=useMemo(()=>[{keys:[KeyCode.Escape],callback:()=>{Ve.isTop(xe)&&xe();}}],[W]);useShortcuts(zt),useEffect(()=>{G(Je.Dialog),H(m||i),I(K),X(L),re(true),setTimeout(()=>A?A():()=>{},500);},[]),useEffect(()=>{h&&xe();},[h]),useEffect(()=>{v!=null&&pe(v);},[v]),useEffect(()=>(W?Ve.push(xe):Ve.pop(xe),()=>Ve.pop(xe)),[W]);let _t=useMemo(()=>1e4+t*10,[t]),Ae=jsxs(f,{as:`--dialog --${(u??Je.Default).toLowerCase()} ${W?"--visible":""} ${Te} fixed abc`.trim(),style:{...ae.style,zIndex:_t+1,pointerEvents:R==true?"none":"auto",width:p||"auto",...R==true?{scale:"0.92",filter:"blur(2px)"}:{}},...he,ref:Me,children:[jsx(Bn,{title:K,description:s,titlePosition:a||ne?.titleAlignment||"center",onClose:xe}),jsx(Pn,{message:Y,render:J,action:me}),me&&me.length>0&&jsx(En,{variant:ge,action:me,dialogID:F,useForm:y,actionPosition:T}),jsx($e,{when:ie,spinner:x||ne?.spinner||se?.type||Se.Simple,message:P||ne?.loadingMessage})]});return jsxs(Fragment$1,{children:[jsx(et,{style:{zIndex:_t},when:W}),y?jsx(Xo,{onSubmit:((Oe,Co)=>{E?.(Oe,Co);}),...b,children:Ae}):Ae]})};Mn.displayName="Zuz.Dialog";var Jo=Mn;var On=forwardRef((e,r)=>{let{speed:t,smooth:n=false,breakpoints:o={},style:s,...a}=e,{rootRef:i,containerRef:m,thumbY:l,thumbX:c,onScrollY:d,onScrollX:u}=useScrollbar(t||1,o,n),{style:p,className:g,rest:T}=B(a);return useEffect(()=>{let x=m.current;if(!x)return;let P=()=>{window.dispatchEvent(new Event("resize"));},S=R=>{let h=R.target;if(h.closest(".--allow-scroll")){let y=h.closest(".--allow-scroll"),{scrollTop:b,scrollHeight:E,clientHeight:$}=y,k=R.deltaY<0,A=R.deltaY>0;(k&&b>0||A&&b+$<E)&&R.stopPropagation();}};return x.addEventListener("scroll",P),x.addEventListener("wheel",S,{passive:true}),()=>{x.removeEventListener("scroll",P),x.removeEventListener("wheel",S);}},[m]),jsxs(f,{ref:i,className:g.trim(),as:"--scrollview rel",children:[jsx(f,{as:`--scroll-content ${g}`.trim(),ref:m,style:s||{},children:T.children}),jsx(f,{as:"--scroll-track --track-y --abs",children:jsx(f,{as:"--scroll-thumb --abs --round",ref:l,onMouseDown:d})}),jsx(f,{as:"--scroll-track --track-x --abs",children:jsx(f,{as:"--scroll-thumb --abs --round",ref:c,onMouseDown:u})})]})});On.displayName="Zuz.ScrollView";var er=On;var Vn=({ref:e,...r})=>{let{id:t,index:n,from:o,speed:s,children:a,margin:i,animation:m,prerender:l,inBackground:c,forceClose:d,forceLoading:u,onClose:p,...g}=r,{drawer:T}=j(true),[x,P]=useState(a),[S,R]=useState(false),[h,v]=useState(l??(T?.prerender||true)),[y,b]=useState(false),E=()=>{R(false),p?.(t??-1);},{className:$,style:k,rest:A}=B(g),M=useMemo(()=>[{keys:[KeyCode.Escape],callback:()=>{Ve.isTop(E)&&E();}}],[S]);useShortcuts(M),useEffect(()=>{P(a);},[a]),useEffect(()=>(S?Ve.push(E):Ve.pop(E),()=>Ve.pop(E)),[S]),useEffect(()=>{R(true);},[]),useEffect(()=>{d&&E();},[d]),useEffect(()=>{u!=null&&b(u);},[u]);let O=o||T?.from||Pe.Left,F=useMemo(()=>{switch(O){case Pe.Left:return {from:{x:"-100vw"},to:{x:0}};case Pe.Right:return {from:{x:"100vw"},to:{x:0}};case Pe.Top:return {from:{y:"-100vh"},to:{y:0}};case Pe.Bottom:return {from:{y:"100vh"},to:{y:0}};default:return {from:{x:"-100vw"},to:{x:0}}}},[o,T?.from]),K=ve({from:{...F.from,opacity:0},to:{...F.to,opacity:1},when:S,curve:m||T?.animation||oe.EaseInOut,duration:s||T?.speed||.5,watch:["scale","filter"]}),I=useMemo(()=>1e4+(n||1)*10,[n]);return jsxs(Fragment$1,{children:[jsx(et,{onClick:L=>{S&&E();},when:S,style:{zIndex:I}}),jsxs(f,{ref:e,"aria-hidden":!S,className:`--drawer flex cols ${$} --${O.toLowerCase()} fixed`,style:{...k,...K.style,"--m":`${i||T?.margin||0}px`,zIndex:I+1,pointerEvents:c==true?"none":"auto",...c==true?{scale:"0.92",filter:"blur(2px)"}:{}},...A,children:[o==Pe.Top||o==Pe.Bottom?jsx(f,{className:"--handle"}):null,jsx(Z,{as:"--close-drawer --abs",onClick:E,children:V.close}),jsxs(er,{as:"rel",children:[h||S?x:null,jsx($e,{when:y})]})]})]})};Vn.displayName="Zuz.Drawer";var rr=Vn;var Hn=forwardRef((e,r)=>{let{progress:t,type:n,animated:o,...s}=e,a=useRef(null);useImperativeHandle(r,()=>({setProgress:c=>{a.current.style.width=`${c*100}%`,a.current.setAttribute("data-value",c+"");},getProgress:()=>+(a.current.getAttribute("data-value")||0)}),[]),useEffect(()=>{t&&a.current&&(o?setTimeout(()=>a.current.style.width=`${t*100}%`,500):a.current.style.width=`${t*100}%`,a.current.setAttribute("data-value",t+""));},[t,a.current]);let{className:i,style:m,rest:l}=B(s);return jsx(f,{className:`--progress ${o?"--animated":""} flex rel ${i}`.trim(),style:m,...l,children:jsx(f,{ref:a,className:"--bar rel"})})});Hn.displayName="Zuz.ProgressBar";var ot=Hn;var Vl=e=>{let{index:r,id:t,type:n,icon:o,busy:s,width:a,title:i,message:m,duration:l,sticky:c=false,actions:d=[],position:u,style:p,isHovered:g,total:T,progress:x,progressValue:P,forceClose:S,variant:R,onClick:h,onClose:v}=e,[y,b]=useState(false),[E,$]=useState(false),{toast:k}=j(true),A=typeof P=="number",M=A?Math.max(0,Math.min(1,P)):void 0,O=E||S,F=u??k?.position??"TopCenter",K=n??k?.type??"default",I=p??k?.style??"stack",L=l??k?.duration??4,X=x??k?.progress??false,Y=useRef(L*1e3),H=useRef(void 0),z=useRef(void 0),G=useRef(null),W=ve({when:y&&!O,duration:.3,transition:k?.transition||(F.includes("Top")?Q.SlideInTop:F.includes("Bottom")?Q.SlideInBottom:F.includes("Left")?Q.SlideInLeft:Q.SlideInRight),curve:k?.curve||oe.EaseInOut,watch:["transform","opacity","scale","filter"]});useEffect(()=>{b(true);let q=se=>{if(z.current!==void 0){let ne=se-z.current;if(!A&&!g&&!c&&!O&&(Y.current-=ne,G.current)){let ge=Math.max(0,Y.current/(L*1e3)*100);G.current?.setProgress?.(ge/100);}}z.current=se,Y.current<=0?$(true):H.current=requestAnimationFrame(q);};return H.current=requestAnimationFrame(q),()=>{H.current&&cancelAnimationFrame(H.current);}},[g,c,O,L]),useEffect(()=>{if(O){let q=setTimeout(()=>{v?.(t);},350);return ()=>clearTimeout(q)}},[O,t]);let re=I==="stack",J=g?r*65:r*8,le=g?1:Math.max(.85,1-r*.05),me=g?1:Math.max(.4,1-r*.2),we=q=>{h?h(q):s!==true&&(!d||d.length===0)&&$(true);},ie=W.style.transform||"translate(0, 0)",pe=O?ie:`${ie} translateY(${F.includes("Top")?J:-J}px) scale(${le})`;return jsxs(f,{onClick:we,as:`--snack --${O?"hidden":"visible"} --${R||k?.variant||U.Medium} --${K} --${F.toLowerCase()} abs flex aic`,style:{...W.style,zIndex:1e3-r,pointerEvents:O?"none":"auto",opacity:O?W.style.opacity:me,transform:pe,filter:!O&&re&&!g&&r>0?"blur(1px)":"none",cursor:!d||d.length===0?"pointer":"default",transition:`${W.style.transition}, transform 0.3s ease, opacity 0.3s ease`},children:[jsxs(f,{as:"--ico flex aic jcc rel",children:[o?jsx(te,{name:o}):jsx(f,{as:"--no-icon"}),s===true&&jsx(Re,{as:"abs abc"})]}),jsxs(f,{as:"--meta flex cols",style:a?{width:a,minWidth:a,maxWidth:a}:void 0,children:[jsx(_,{as:"--tt",children:i||fn[n]}),jsx(_,{as:"--tm",children:m})]}),d&&d.length>0&&jsx(f,{as:"--actions flex gap:5",children:d.map((q,se)=>jsx(Z,{as:"--snack-btn bold",variant:U.XSmall,onClick:ne=>{ne.stopPropagation(),q.onClick(ne);},children:q.label},se))}),(X||A)&&jsx(ot,{as:"abs",progress:M,ref:G})]})},sr=Vl;var Ie=createContext(null),zl=({ref:e,...r})=>{let n=useContext(Ie)?.depth??0,[o,s]=useState(null),[a,i]=useState(null),[m,l]=useState(false),[c,d]=useState([]),u=useDelayed(),p=useRef(0),g=()=>++p.current,T=()=>{l(false),setTimeout(()=>i(null),200);};useImperativeHandle(e,()=>({add(h){let v=g(),y={id:v,...h};return d(b=>[...b,y]),v},openMenu(h){l(false),setTimeout(()=>{i({id:g(),type:"menu",props:h}),l(true);},16);},update(h,v){d(y=>y.map(b=>b.id!==h?b:{...b,props:{...b.props,...v}}));},remove(h){d(v=>v.map(y=>y.id===h?{...y,props:{...y.props,forceClose:true}}:y)),a?.id===h&&T();},loading(h,v){d(y=>y.map(b=>b.id===h?{...b,props:{...b.props,forceLoading:v}}:b)),a?.id===h&&T();},clear(h){d(c.filter(v=>v.type!=h));}})),useEffect(()=>{if(a&&m){let h=()=>T();return document.addEventListener("click",h),()=>document.removeEventListener("click",h)}},[a,m,T]);let x=h=>{setTimeout(()=>{d(v=>v.filter(y=>y.id!==h)),a?.id===h&&i(null);},250);},P=useMemo(()=>[...c.filter(h=>h.type!="toast")],[c]);if(!u)return null;let S=c.filter(h=>h.type=="toast").reverse(),R=Object.values(Qt);return createPortal(jsxs(f,{as:"--zuz-layers-wrapper fixed fill nope",style:{zIndex:9999+n},children:[P.map((h,v)=>{let y=v<P.length-1;return h.type==="dialog"?jsx(Jo,{onClose:x,index:v,id:h.id,...h.props,inBackground:y},`layer-${h.type}-${h.id}`):h.type==="drawer"?jsx(rr,{onClose:x,index:v,id:h.id,...h.props,inBackground:y},`layer-${h.type}-${h.id}`):null}),R.map(h=>{let v=S.filter(y=>(y.props.position||"TopCenter")===h);return v.length===0?null:jsx(f,{onMouseEnter:()=>s(h),onMouseLeave:()=>s(null),as:`--toast-container fixed --${h.toLowerCase()} flex cols`,style:{pointerEvents:"auto",zIndex:"var(--max-z-index)"},children:v.map((y,b)=>jsx(sr,{index:b,total:v.length,isHovered:o===h,onClose:x,id:y.id,...y.props},y.id))},h)}),a&&jsx(f,{as:"--zuz-layer-menus fixed fill nope",style:{zIndex:"var(--max-z-index)"},children:jsx(Ho,{onClose:T,when:m,...a.props},`menu-${a.id}`)})]}),document.body)},_l=({children:e})=>{let r=useContext(Ie),t=r?r.depth+1:0,n=useRef(null),o=useMemo(()=>({add:s=>n.current?.add(s),openMenu:s=>n.current?.openMenu(s),update:(s,a)=>n.current?.update(s,a),remove:s=>n.current?.remove(s),loading:(s,a)=>n.current?.loading(s,a),clear:s=>n.current?.clear(s),depth:t,isSubLayer:!!r}),[r]);return jsxs(Ie.Provider,{value:o,children:[e,jsx(zl,{ref:n})]})},Vo=_l;var Zl=()=>{let e=useContext(Ie);if(!e)throw new Error("useContextMenu must be used inside <LayersProvider>");return {showContextMenu:(n,o,s)=>{n.preventDefault(),e.openMenu({event:n,items:o,origin:s});},showMenu:(n,{items:o,origin:s,offsetX:a,offsetY:i,transition:m,curve:l,arrow:c,duration:d,header:u,footer:p})=>{e.openMenu({fx:{transition:m,curve:l,duration:d},parent:n,items:o,origin:s||wt.TopCenter,offsetX:a,offsetY:i,arrow:c,header:u,footer:p});},hide:e.clear}},Wl=Zl;var Ul=()=>{let e=useContext(Ie);if(!e)throw new Error("useDialog must be used inside <LayersProvider>");let r=()=>e.clear("dialog"),t=a=>e.remove(a),n=(a,i)=>e.loading(a,i);return {clearAll:r,show:a=>{let i=e.add({type:"dialog",props:{...a,type:Je.Dialog}});return {id:i,setLoading:m=>n(i,m),hide:()=>t(i)}},confirm:a=>{let i=e.add({type:"dialog",props:{...a,type:Je.Confirm,action:a.action??[{label:a.cancelLabel??"Cancel",kind:"ghost",onClick:()=>{a.onCancel?.(),t(i);}},{label:a.confirmLabel??"Confirm",kind:"solid",type:"submit",onClick:m=>{a.onConfirm?.(m);}}]}});return {id:i,setLoading:m=>n(i,m),hide:()=>t(i)}},hide:t}},ql=Ul;var Yl=()=>{let e=useContext(Ie);if(!e)throw new Error("useDialog must be used inside <LayersProvider>");let r=()=>e.clear("drawer"),t=s=>e.remove(s),n=(s,a)=>e.loading(s,a),o=s=>{let a=e.add({type:"drawer",props:s});return {id:a,setLoading:i=>n(a,i),close:()=>t(a)}};return {clearAll:r,open:s=>o({children:s}),right:s=>o({children:s,from:Pe.Right}),left:s=>o({children:s,from:Pe.Left}),top:s=>o({children:s,from:Pe.Top}),bottom:s=>o({children:s,from:Pe.Bottom}),close:t}},jl=Yl;var Jl=(e,r,t={})=>{let[n,o]=useState(null),[s,a]=useState(false),{duration:i=.25,curve:m=oe.EaseOutBack,borderRadius:l={from:40,to:24},targetWidth:c=320}=t;return useLayoutEffect(()=>{r&&e.current?(o(e.current.getBoundingClientRect()),a(true)):r||a(false);},[r,e]),{style:ve({from:{opacity:0,width:n?.width,height:n?.height,borderRadius:l.from},to:{opacity:1,width:c,height:"auto",borderRadius:l.to},curve:m,duration:i,when:s&&r}).style,isMeasured:s,sourceRect:n}},ec=Jl;var nc=(e,r={})=>{let{offset:t=8,direction:n="bottom",container:o=null,triggerRef:s=null}=r,a=useRef(null),i=useCallback(()=>{let m=e.current;if(!m)return;let l=s?.current||m.parentElement;if(!l){console.warn("usePosition: No trigger element found. Positioning may not work.");return}let c=m.getBoundingClientRect(),d=l.getBoundingClientRect(),u,p;o?(u=o.getBoundingClientRect(),p="absolute"):(window.getComputedStyle(m).position==="fixed"?p="fixed":p="absolute",p==="fixed"?u={top:0,left:0,right:window.innerWidth,bottom:window.innerHeight,width:window.innerWidth,height:window.innerHeight}:u={top:0,left:0,right:window.innerWidth,bottom:window.innerHeight,width:window.innerWidth,height:window.innerHeight}),m.style.position!==p&&(m.style.position=p),a.current=p;let x=0,P=0;switch(n){case "top":x=d.top-c.height-t,P=d.left,x<u.top&&d.bottom+c.height+t<=u.bottom&&(x=d.bottom+t);break;case "bottom":x=d.bottom+t,P=d.left,x+c.height>u.bottom&&d.top-c.height-t>=u.top&&(x=d.top-c.height-t);break;case "left":x=d.top,P=d.left-c.width-t,P<u.left&&d.right+c.width+t<=u.right&&(P=d.right+t);break;case "right":x=d.top,P=d.right+t,P+c.width>u.right&&d.left-c.width-t>=u.left&&(P=d.left-c.width-t);break}if(x=Math.max(u.top,Math.min(x,u.bottom-c.height)),P=Math.max(u.left,Math.min(P,u.right-c.width)),a.current==="fixed")m.style.top=`${x}px`,m.style.left=`${P}px`;else {let S;m.offsetParent?S=m.offsetParent.getBoundingClientRect():S={top:0,left:0};let R=x-S.top+window.scrollY,h=P-S.left+window.scrollX;m.style.top=`${R}px`,m.style.left=`${h}px`;}},[e,s,t,n,o]);return useEffect(()=>{let m=e.current;if(!m)return;let l=s?.current||m.parentElement;if(!l){console.warn("usePosition: No trigger element found. Positioning may not work.");return}let c=new ResizeObserver(i);return c.observe(m),l&&c.observe(l),i(),window.addEventListener("resize",i),window.addEventListener("scroll",i,true),()=>{c.disconnect(),l&&c.disconnect(),window.removeEventListener("resize",i),window.removeEventListener("scroll",i,true);}},[e,n,t,o,s]),{postion:a.current,reposition:i}},kt=nc;var ac=()=>{let e=useContext(Ie);if(!e)throw new Error("useToast must be used inside <LayersProvider>");let r=(p,g)=>e.add({type:"toast",props:{...g,type:p}}),t=()=>e.clear("toast"),n=p=>e.remove(p),o=(p,g)=>e.update(p,g),s=p=>({id:p,update:g=>o(p,g),setType:g=>o(p,{type:g}),setProgress:g=>o(p,{progress:true,progressValue:g}),setBusy:g=>o(p,{busy:g}),success:()=>o(p,{type:"success"}),error:()=>o(p,{type:"error"}),warn:()=>o(p,{type:"warn"}),promise:()=>o(p,{type:"promise"}),default:()=>o(p,{type:"default"}),hide:()=>n(p)}),a=p=>s(r("default",p)),i=p=>s(r("success",p)),m=p=>s(r("error",p)),l=p=>s(r("warn",p)),c=p=>s(r("promise",p)),d=(p,g,T)=>{let x=r(p,{...g,sticky:g.sticky??false,actions:[{label:T?.label||"Ok",onClick:P=>{T?.onClick?.(P),n(x);}}]});return s(x)},u=(p,g,T,x)=>{let P=r(p,{...g,sticky:true,actions:[{label:T?.label||"Ok",onClick:S=>{T?.onClick?.(S),(T?.hide??false)===true&&n(P);}},{label:x?.label||"Cancel",onClick:S=>{x?.onClick?.(S),(x?.hide??true)===true&&n(P);}}]});return s(P)};return {show:a,hide:n,promise:c,clearAll:t,ok:(p,g)=>d("default",p,g),success:(p,g)=>g?d("success",p,g):i(p),error:(p,g)=>g?d("error",p,g):m(p),confirm:(p,g,T)=>u("default",p,g,T),warn:(p,g)=>g?d("warn",p,g):l(p),succes:(p,g)=>g?d("success",p,g):i(p)}},ic=ac;var Wn=({ref:e,style:r,...t})=>{let n=useRef(null),o=useMemo(()=>e&&typeof e!="function"&&e.current?e:n,[e]),{style:s,className:a,rest:i}=B(t,o);return jsx("div",{ref:e||n,style:{...s,...r||{}},className:a,...i})};Wn.displayName="Zuz.Box";var f=Wn;var Un=forwardRef((e,r)=>{let{title:t,message:n,...o}=e,[s,a]=useState(false);return jsxs(f,{className:"--accordion flex cols",...o,children:[jsxs(Z,{onClick:i=>a(!s),className:`--toggle flex aic ${s?"--open":""}`.trim(),children:[jsx(_,{className:"--label flex",children:t}),jsx(f,{className:"--arrow flex",children:s?V.arrowUp:V.arrowDown})]}),s&&jsx(f,{className:"--detail",children:n})]})});Un.displayName="Zuz.Accordion";var fc=Un;var dc=({label:e,icon:r,onClick:t,idx:n,selected:o})=>jsx(Z,{onClick:t,onMouseMove:s=>document.documentElement.style.setProperty("--tip-m",`${n}`),className:`--action ${o?"--selected":""} aic jcc rel`.trim(),children:typeof r=="string"?jsx(te,{name:r}):r}),Xn=dc;var Yn=forwardRef((e,r)=>{let{items:t,name:n,selected:o,position:s,...a}=e,i=useRef(null),[m,l]=useState(o||t[0].tag||0),c=useCallback(({x,y:P})=>{if(i.current){let S=i.current.getBoundingClientRect();document.documentElement.style.setProperty("--tip-x",`${x-S.left}`),document.documentElement.style.setProperty("--tip-y",`${P-S.top}`),document.documentElement.style.setProperty("--tip-s","1");}},[]),d=useCallback(()=>{i.current&&(i.current.removeEventListener("pointerleave",d),i.current.removeEventListener("pointermove",c),document.documentElement.style.setProperty("--tip-s","0"));},[]),u=useCallback(()=>{i.current&&(i.current.addEventListener("pointerleave",d),i.current.addEventListener("pointermove",c));},[]);useEffect(()=>{i.current&&(document.documentElement.style.setProperty("--tip-w",t.reduce((x,P)=>P.label.length>x.length?P.label:x,"").length.toString()),document.documentElement.style.setProperty("--tip-s","0"),document.documentElement.style.setProperty("--tip-l",`${t.length}`),i.current?.addEventListener("pointerenter",u));},[]);let{className:p,style:g,rest:T}=B(a);return jsxs(f,{ref:i,style:g,className:[`--actionbar flex aic ${p}`,`${!s||s==be.Auto?"rel":`--${s}`}`].join(" ").trim(),...T,children:[t.map((x,P)=>jsx(Xn,{selected:m===x.tag||o==P,...x,idx:P},`actionbar-action-${x.label.toLowerCase().replace(/\s+/g,"-")}`)),jsx(f,{className:"--tip abs",children:jsx(f,{className:"--track flex aic",children:t.map(({label:x})=>jsx(f,{className:"--lb",children:x},`tool-tip-${x.toLowerCase().replace(/\s+/g,"-")}`))})})]})});Yn.displayName="Zuz.ActionBar";var bc=Yn;var Qn=forwardRef((e,r)=>{let{type:t,icon:n,title:o,message:s,iconSize:a,...i}=e,{className:m,style:l,rest:c}=B(i);return jsxs(f,{className:`--alert --${t||ke.Info} flex aic ${m}`.trim(),style:l,...c,children:[jsx(f,{className:`--icon icon-${n||"auto-matic"}`,style:a?{fontSize:a,width:a,height:a}:{},children:!n&&V[t||ke.Info]}),jsxs(f,{className:"--meta flex cols",children:[jsx(_,{className:`--title ${s?"--tm":""}`,children:o||"Lorem ipsum dolor sit amet, consectetur adipiscing elit."}),s&&jsx(_,{className:"--message",h:2,children:s})]})]})});Qn.displayName="Zuz.Alert";var wc=Qn;var es=({ref:e,...r})=>{let{variant:t,numeric:n,name:o,onConfirm:s,...a}=r,{style:i,className:m,rest:l}=B(a),{variant:c}=j(true),d=useRef(null),u=lt(),p=o?u.errors?.[o]:null,g=o&&u.values&&u.setFieldValue,T=g?u.values?.[o]:void 0,x=useDebounce(S=>{g&&u.setFieldValue?.(o,S);},500),P=S=>{let R=S.currentTarget.value;n&&(R=R.replace(/[^0-9.]/g,"").replace(/(\..*?)\..*/g,"$1"),S.currentTarget.value=R),x(R),r.onInput?.(S);};return useEffect(()=>{d.current&&o&&T!==void 0&&d.current.value!==String(T)&&(d.current.value=String(T));},[T,o]),useEffect(()=>()=>{g&&u.deleteFieldValue?.(o);},[]),jsx("input",{name:o,className:`--input --${t||c} ${p?"--has-error":""} --flex ${m}`.trim(),style:i,defaultValue:T??r.defaultValue??"",onInput:P,onKeyDown:S=>{S.key=="Enter"&&s?.(S.currentTarget.value);},ref:S=>{d.current=S,typeof e=="function"?e(S):e&&(e.current=S);},...l})};es.displayName="Zuz.Input";var fe=es;var os=e=>{let{meta:r,children:t}=e,n=useDelayed(),{label:o,icon:s,...a}=isValidElement(r)?{}:r,{className:i,style:m,rest:l}=B({...a,...a.animate?{animate:{...a.animate,when:n}}:{}});return isValidElement(r)?jsx("li",{style:m,className:i,children:r}):jsxs("li",{style:m,className:i,...l,children:[t,typeof r=="string"?r:o]})};os.displayName="Zuz.ListItem";var rs=os;var ss=forwardRef((e,r)=>{let{items:t,variant:n,direction:o,seperator:s,ol:a,...i}=e,{className:m,style:l,rest:c}=B(i),d=a==true?"ol":"ul";return createElement(d,{className:`--list --${n||U.Small} flex ${o??"cols"} ${m}`.trim(),style:l,ref:r,...c,children:t.map((u,p,g)=>{let T=`${typeof u=="string"?`li-${String(u)}`:isValidElement(u)?`li-${u.key}`||`${p}-${MD5(u.toString())}`:u.label}-${p}`;return jsxs(Fragment,{children:[jsx(rs,{meta:u}),s&&g[p+1]?jsx("li",{className:"--list-seperator",children:s},`spt-${p+1}-${T}`):null]},T)})})});ss.displayName="Zuz.List";var nt=ss;var is=forwardRef((e,r)=>{let{fx:t,action:n,data:o,withStyle:s,onChange:a,...i}=e,{className:m}=B({as:s||""}),{style:l}=B(i),[c,d]=useState(false),[u,p]=useState(o||[]),g=useRef(null),T=useRef(null),x=useRef(null),P=useMemo(()=>i.name||uuid(12),[]),[S,R]=useState(null),[h,v]=useState(null),[y,b]=useState([]),$=useDebounce(I=>{I.target.value==""?(d(false),p([])):n&&I.target.value.trim()!=""&&withPost(n,{query:I.target.value}).then(L=>{"items"in L&&_$1(L.items).isArray()?(p(L.items),v(I.target.value),b(L.items)):console.error("Action Response should contain items array"),R(null);}).catch(L=>{R(null),p([]);});},250),k=()=>{if(T.current){let I=T.current.getBoundingClientRect(),L=window.innerHeight-I.bottom,X=I.top;if(x.current){let Y=x.current;L<Y.offsetHeight&&X>L?(Y.style.top="auto",Y.style.bottom=`${I.height}px`,Y.style.maxHeight=`${X-150}px`):(Y.style.top=`${I.height+5}px`,Y.style.bottom="auto",Y.style.maxHeight=`${L-150}px`);}}},A=I=>{if(u.length>0){if((I.key==="ArrowDown"||I.key==="ArrowUp")&&(I.preventDefault(),I.stopPropagation()),I.key==="Escape")R(null),d(false),p([]);else if(I.key==="ArrowDown")R(L=>{let X=L===null||L===u.length-1?0:L+1;return O(X),X});else if(I.key==="ArrowUp")R(L=>{let X=L===null||L===0?u.length-1:L-1;return O(X),X});else if(I.key==="Enter"&&S!==null){let L=u[S];g.current&&(g.current.value=L,d(false),p([]));}}},M=I=>{g.current&&(g.current.value=I,d(false),p([]));},O=I=>{let L=u[I];if(L&&g.current&&(g.current.value=L,g.current.setSelectionRange(L.length,L.length)),x.current){let Y=x.current.children[I];Y&&Y.scrollIntoView({block:"nearest"});}},F=I=>{T.current&&!T.current.contains(I.target)&&(d(false),p([]));},K=()=>{g.current&&g.current.value===h&&(p(y),R(null),k());};return useEffect(()=>(window.addEventListener("resize",k),window.addEventListener("scroll",k,true),document.addEventListener("mousedown",F),()=>{window.removeEventListener("resize",k),window.removeEventListener("scroll",k,true),document.removeEventListener("mousedown",F);}),[]),useEffect(()=>{k();},[u]),jsxs(f,{style:l,ref:T,className:`--autocomplete --${e.size||U.Small} flex aic rel ${m}`.trim(),children:[jsx(fe,{ref:g,autoComplete:"off",onChange:$,onKeyDown:A,onFocus:K,...i}),jsx(f,{className:"--arrow rel flex aic jcc",children:u.length>0?V.arrowUp:V.arrowDown}),u.length>0&&jsx(nt,{id:P,ref:x,className:"--suggestion-list flex cols abs",items:u.map((I,L)=>({label:I,onClick:X=>{X.preventDefault(),X.stopPropagation(),M(I);},className:S===L?"--current":"",animate:{transition:Q.SlideInBottom,curve:oe.EaseInOut,delay:clamp(.02*L,.02,.5)}}))})]})});is.displayName="Zuz.AutoComplete";var _c=is;var ls=forwardRef((e,r)=>{let t=useRef(null),n=useMemo(()=>r&&typeof r!="function"&&r.current?r:t,[r]),{style:o,className:s,rest:a}=B(e,n);return !a.src||a.src==""?null:jsx("img",{ref:n,style:o,className:`${s} flex`,...a})});ls.displayName="Zuz.Image";var st=ls;var cs=forwardRef((e,r)=>{let{src:t,variant:n,type:o,crossOrigin:s,referrerPolicy:a,fx:i,as:m,alt:l,color:c,style:d,...u}=e,[p,g,T]=useImage(t??"",s,a),{className:x,style:P,rest:S}=B({fx:i,as:m});return jsx(f,{className:`--avatar --${n||U.Small} --${(o||Ar.Circle).toLowerCase()} rel flex aic jcc ${x}`.trim(),style:{background:c||"var(--avatar-bg, var(--primary))",...d,...P},...S,children:t?jsx(st,{src:p,crossOrigin:s,referrerPolicy:a,...u}):jsx(_,{className:"--avatar-label",children:(l?l.charAt(0):"A").toUpperCase()})})});cs.displayName="Zuz.Avatar";var Yc=cs;var jc=({size:e=5,type:r="dead",label:t="",variant:n=U.Small,loading:o=false,spinner:s,...a})=>{let{style:i,className:m,rest:l}=B(a);return jsxs(f,{style:{..._$1(t).isEmpty()?{"--badge-size":e}:{},...i},as:`--badge --${n} --${r} rel flex aic jcc ${m}`.trim(),children:[jsx(f,{fx:{transition:Q.FadeIn,curve:oe.Liquid,duration:.5,when:o},as:"abs abc",children:jsx(Re,{type:s})}),_$1(t).isEmpty()?jsx(f,{as:`--dot --${r}`}):jsx(_,{as:"--label",children:t})]})},Qc=jc;var um=[{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 e=new Date,r=e.getDay();return addDays(e,(6-r)%7||6)},getDateFormat:()=>{let e=new Date,r=e.getDay();return format(addDays(e,(6-r)%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)}],fm=e=>{let r=new Set;return e.filter(t=>{if(t.label=="Later")return true;let n=t.getDate().toISOString().split("T")[0];return r.has(n)?false:(r.add(n),true)})},ps=forwardRef((e,r)=>{let{defaultValue:t,variant:n,onChange:o,...s}=e,{style:a,className:i,rest:m}=B(s),[l,c]=useState(t||new Date),d=startOfMonth(l),u=endOfMonth(l),p=startOfWeek(d),g=endOfWeek(u),T=useMemo(()=>eachDayOfInterval({start:p,end:g}),[p,g]),x=R=>{o?.(R),c(R);},P=()=>{c(R=>new Date(R.getFullYear(),R.getMonth()-1));},S=()=>{c(R=>new Date(R.getFullYear(),R.getMonth()+1));};return jsxs(f,{as:`--calendar flex --${n||"sm"} ${i}`,style:a,children:[jsx(f,{as:"--calendar-quick-select flex cols flex:1",children:fm(um).map(R=>{let h=R.getDate();return jsxs(Z,{onClick:()=>x(h),as:["--calendar-quick-option flex aic gap:5"],children:[jsx(_,{as:"flex:1",children:R.label}),jsx(_,{as:"tar",children:R.getDateFormat()})]},`--dtp-option-label-${R.label}`)})}),jsxs(f,{as:"--calendar-selector flex cols flex:1",children:[jsxs(f,{as:"--calendar-head flex aic jcc gap:4",children:[jsx(_,{as:"flex:1 --calendar-cm bold",children:format(l,"MMMM yyyy")}),jsx(Z,{onClick:P,as:"--calendar-chevron",children:V.chevronUpOutline}),jsx(Z,{onClick:S,as:"--calendar-chevron",children:V.chevronDownOutline})]}),jsxs(f,{as:"--calendar-days gap:4",children:[["Su","Mo","Tu","We","Th","Fr","Sa"].map(R=>jsx(_,{as:"--calendar-day",children:R},`--calendar-hd-${R}`)),T.map((R,h)=>{let v=isSameMonth(R,l),y=isSameDay(R,l),b=isToday(R);return jsx(Z,{disabled:!v,onClick:()=>x(R),as:["--calendar-day --calendar-dd",`${y?"--calendar-dd-selected":""}`,`${b?"--calendar-dd-current":""}`],children:format(R,"d")},`--calendar-day-${h}-${R.getFullYear()}-${R.getMonth()}-${R.getDay()}`)})]})]})]})});ps.displayName="Zuz.Calendar";var ur=ps;var co=(t=>(t.Table="table",t.Gooey="gooey",t))(co||{});var gs=({ref:e,...r})=>{let{itemCount:t,itemsPerPage:n,startPage:o,pageRange:s,paginationStyle:a,breakLabel:i,prevLabel:m,nextLabel:l,hash:c,loading:d,seperator:u,renderOnZeroPageCount:p,asDots:g,progressBar:T,onPageChange:x,...P}=r,S=useRef(null),R=useMemo(()=>toHash(numberInRange(4,8)),[]),h=useCallback(I=>`${toHash(I,c||6,R)}${u||""}${R}`,[R]),v=useMemo(()=>i||"...",[i]),y=useRef(null),[b,E]=useState({id:c?o?typeof o=="number"?h(o):o:1:o||1,label:o||1});useImperativeHandle(e,()=>({setPage:I=>E(I),getPage:I=>b,setProgress:I=>y.current?.setProgress?.(I),getProgress:()=>y.current?.getProgress?.()??0}),[y.current]);let{style:$,className:k,rest:A}=B(P),M=useCallback(I=>typeof I=="number"?I:+I.label,[]);if(!t)throw new Error('"itemCount" prop is required');let O=useMemo(()=>Math.ceil(t/n),[t,n]),F=useMemo(()=>{let I=[],L=Math.max(M(b)-(s||2),1),X=Math.min(M(b)+(s||2),O);L>1&&I.push({id:c?h(1):1,label:1}),L>2&&I.push({id:-1,label:v});for(let Y=L;Y<=X;Y++)I.push({id:c?h(Y):Y,label:Y});return X<O-1&&I.push({id:-1,label:v}),X<O&&I.push({id:c?h(O):O,label:O}),I},[b]),K=useCallback(I=>{let L=I;+L.label<1||+L.label>O||(E(L),x?.(L));},[t,n,b]);return F.length<=1&&(p??false)===false?null:jsxs(f,{ref:S,as:`--pagination ${g===true?"--as-dots":""} --pgt-${a||"table"} flex aic w:100% jcc ${k}`,children:[jsx(f,{as:"flex flex:1 aic --pgt-btns",children:(F.length>1?F:[{id:1,label:1},{id:-1,label:v}]).map((I,L,X)=>{let Y=(typeof I=="string"?I:I.label)==M(b);return jsx(Z,{disabled:I.id==-1||M(b)==+I.label,className:Y?"--current-page":"",onClick:H=>K(I),children:g===true?T===true&&Y?jsx(ot,{ref:y}):"":typeof I=="string"?I:I.label},`--pg-${L}-${I.id}`)})}),jsx(f,{as:"flex aic jcc flex:1 --pagination-label",children:[`Showing ${(M(b)-1)*n+1} - `,`${Math.min(M(b)*n,t)} of ${t} items`].join(" ")}),jsxs(f,{as:"flex aic jce flex:1 --pgt-btns --pgt-nav",children:[jsx(Z,{disabled:M(b)<=1,onClick:I=>K({id:c?h(M(b)-1):M(b)-1,label:M(b)-1}),children:V.chevronLeftOutline}),jsx(Z,{disabled:F.length<=1||M(b)==M(F[F.length-1]),onClick:I=>K({id:c?h(M(b)+1):M(b)+1,label:M(b)+1}),children:V.chevronRightOutline})]})]})};gs.displayName="Zuz.Pagination";var Ot=gs;function Sm(e,r){let{items:t,renderItem:n,effect:o="slide",loop:s=true,loopMode:a="infinite",startIndex:i=0,useKeys:m=true,useWheel:l=true,spacing:c=160,rotation:d=20,scaleStep:u=.15,blur:p=4,animation:g="power",showDots:T=false,autoPlay:x=false,autoPlaySpeed:P=3,onChange:S,...R}=e,{className:h,style:v}=B(R),y=useRef(null),b=P/(P>=1e3?1e3:1),E=useCarousel({total:t.length,initialIndex:i,loop:s,useKeys:m,useWheel:l,onChange:O=>{y.current?.setPage({id:O+1,label:O+1}),y.current?.setProgress(0),S?.(O);}}),{pause:$,resume:k,reset:A}=useTimer({duration:b,autoStart:x===true,onProgress:O=>{x===true&&y.current?.setProgress(1-O);},onExpired:()=>{x===true&&E.next(),A();}}),M={...v,"--carousel-spacing":`${c}px`,"--carousel-rotation":`${d}deg`,"--carousel-blur":`${p}px`,"--carousel-scale-step":u,"--active-index":E.index,"--carousel-transition":`var(--${g})`};return jsxs(f,{ref:r,className:`--carousel --effect-${o} --loop-${a} flex cols aic jcc ${h}`.trim(),style:M,children:[jsx(f,{className:"--carousel-stage rel fill flex aic jcc",children:t.map((O,F)=>{let K=F-E.index;if(a==="infinite"){let L=t.length;K=((K+L/2)%L+L)%L-L/2;}let I=F===E.index;return jsx(f,{onMouseEnter:()=>I&&$(),onMouseLeave:()=>I&&k(),className:`--carousel-item-wrapper abs ${I?"--is-active":""}`,style:{"--offset":K,zIndex:I?100:100-Math.abs(K),display:Math.abs(K)>5?"none":"flex"},children:n(O,F,E.index)},F)})}),T&&jsx(Ot,{ref:y,itemCount:t.length,itemsPerPage:1,startPage:i+1,pageRange:t.length,paginationStyle:"gooey",onPageChange:O=>E.goTo(+O.label-1),asDots:true,progressBar:true})]})}var wm=forwardRef(Sm),Cm=wm;var hs=(r=>(r.Line="line",r))(hs||{});var bs=forwardRef((e,r)=>{let{data:t,width:n,height:o,lineColor:s,strokeWidth:a=2,gradientStartColor:i,gradientEndColor:m,animated:l,animDuration:c=2,animDelay:d=0,padding:u=0,type:p,...g}=e,{className:T,style:x,rest:P}=B(g),S=useRef(null),R=useResizeObserver(S.current?.parentElement||S),h=typeof n=="number"?n:R.width,v=typeof o=="number"?o:R.height,y={width:h,height:v},b=useId(),{pathD:E,areaPathD:$}=useLineChart(t,y,u+(a||2)),k=useRef(null),A=useRef(null),[M,O]=useState(0),[F,K]=useState(0);return useEffect(()=>{l&&(k.current&&O(k.current.getTotalLength()),A.current&&K(A.current.getTotalLength()));},[l,E,$,h,v]),jsx(f,{ref:S,as:`--chart --${p||"line"}-chart ${T}`.trim(),style:{...x,width:n,height:o},...P,children:h>0&&v>0&&jsxs("svg",{viewBox:`0 0 ${h} ${v}`,preserveAspectRatio:"xMidYMid meet",children:[jsx("defs",{children:jsxs("linearGradient",{id:b,x1:"0%",y1:"0%",x2:"0%",y2:"100%",children:[jsx("stop",{offset:"0%",stopColor:i}),jsx("stop",{offset:"100%",stopColor:m})]})}),jsx("path",{ref:A,d:$,fill:`url(#${b})`,stroke:"none",style:l?{strokeDasharray:F,strokeDashoffset:F}:{},children:l&&jsx("animate",{attributeName:"stroke-dashoffset",from:F,to:"0",dur:`${c||2}s`,begin:`${d||0}s`,fill:"freeze"})}),jsx("path",{ref:k,d:E,fill:"none",stroke:s,strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round",style:l?{strokeDasharray:M,strokeDashoffset:M}:{},children:l&&jsx("animate",{attributeName:"stroke-dashoffset",from:M,to:"0",dur:`${c||2}s`,begin:`${d||0}s`,fill:"freeze"})})]})})});bs.displayName="Zuz.Chart";var Bm=bs;var vs=(o=>(o[o.Sending=0]="Sending",o[o.Sent=1]="Sent",o[o.Delivered=2]="Delivered",o[o.Read=3]="Read",o))(vs||{}),Ss=(l=>(l.Image="img",l.Video="vid",l.Audio="audio",l.Link="link",l.Document="doc",l.Location="loc",l.Contact="contact",l.Event="event",l.Poll="poll",l))(Ss||{});var ws=forwardRef((e,r)=>{let{text:t,media:n,side:o="me",status:s=1,timeStamp:a=Date.now(),arrow:i=true,...m}=e,{className:l,style:c,rest:d}=B(m);return jsx(f,{className:`--bubble-wrapper flex --bw-${o}`.trim(),children:jsxs(f,{className:`--bubble --bubble-${o} ${n?`--with-media --bma-${n.type}`:""} rel flex cols ${i==true?"--b-arrow":""} ${l}`.trim(),style:{...c},...d,children:[t&&jsx(_,{className:"--bubble-text",children:t}),n?n.type=="audio"?jsxs(f,{as:"flex aic --bubble-audio",children:[jsx(ce,{className:"--bm-action",children:V.play}),jsx(ot,{progress:.7}),jsx(_,{className:"--bm-dur",children:n.duration??"00:13"})]}):n.type=="img"?jsx(f,{as:"--bubble-image",children:jsx(st,{src:n.source})}):null:null,jsxs(f,{as:"flex aie jce --bubble-stats",children:[jsx(_,{className:"--bubble-stamp tar",children:timeSince(a)}),o=="me"&&jsx(ce,{className:`--bubble-status --bs-${s}`,children:s==0?V.pending:s==1?V.done:s==2?V.doneAll:V.doneAll})]})]})})});ws.displayName="Zuz.Bubble";var Mm=ws;var Cs=forwardRef((e,r)=>{let{style:t,className:n,rest:o}=B(e);return jsx("label",{ref:r,style:t,className:n,...o})});Cs.displayName="Zuz.Label";var Vt=Cs;var Ps=({ref:e,...r})=>{let {name:t,required:n,type:o,value:s,size:a,variant:i,checked:m,disabled:l,onSwitch:c,...d}=r,u=lt(),p=!!(t&&u.values);p?u.errors?.[t]:null;let T=p?u.values?.[t]:void 0,[x,P]=useState(m||false),S=useRef(null),{variant:R}=j(true),h=useMemo(()=>p&&T!=null?typeof T=="string"?T.toLowerCase()!=="false"&&T!=="":!!T:x,[T,x,p]);useEffect(()=>{S.current&&S.current.checked!==h&&(S.current.checked=h);},[h]),useEffect(()=>{m!==void 0&&P(m);},[m]);let v=y=>{let b=!!y;p&&u.setFieldValue?.(t,b),P(b),c?.(b,s||"cb");};return useImperativeHandle(e,()=>({setChecked(y,b=true){v(y);},toggle(y=true){v(!h);}})),jsxs(Vt,{"aria-hidden":l,className:[`--${(o||Ke.Default).toLowerCase()}`,`${!o||o===Ke.Default?"--checkbox":"--switch"}`,`--${i||R||U.Small}`,`flex aic jcc ${h?"is-checked":""} rel`,`${l?"--disabled":""}`].join(" ").trim(),...d,children:[(!o||o==Ke.Default)&&V.check,jsx(fe,{ref:y=>{S.current=y,e&&(e.current=y);},defaultChecked:h,type:"checkbox",className:"abs",name:t,required:n||false,onChange:y=>{y.stopPropagation(),v(y.target.checked);},disabled:l})]})};Ps.displayName="Zuz.CheckBox";var Dt=Ps;var Zm=({ref:e,...r})=>{let{code:t,copy:n,lang:o="tsx",showLines:s=false,highlight:a="",as:i,fx:m,...l}=r,c=useRef(null),{className:d,style:u,rest:p}=B({as:`rel p:20 br:8 bg:shade-1 overflow:auto font:mono ${i}`,fx:m},c),g=useMemo(()=>{let x=new Set;return a.split(",").forEach(P=>{if(P.includes("-")){let[S,R]=P.split("-").map(Number);for(let h=S;h<=R;h++)x.add(h);}else P&&x.add(Number(P));}),x},[a]),T=useMemo(()=>{let x=t.split(`
|
|
9
|
+
`);for(;x.length>0&&x[0].trim()==="";)x.shift();for(;x.length>0&&x[x.length-1].trim()==="";)x.pop();let P=x[0]?.match(/^\s*/)?.[0].length||0,S=x.map(h=>{let v=h.match(/^\s*/)?.[0].length||0,y=Math.min(v,P);return h.slice(y)}),R=[{name:"comm",re:/\/\/.*/g},{name:"str",re:/(["'`])(?:(?=(\\?))\2.)*?\1/g},{name:"key",re:/\b(const|let|var|export|default|import|from|return|if|else|switch|case|break|as|type|interface|class|extends|await|async|new|void|typeof)\b/g},{name:"tag",re:/(<\/?[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 S.map((h,v)=>{let y=h.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">"),b=g.has(v+1);if(o!="plain"){let E=[];R.forEach($=>{y=y.replace($.re,k=>{let A=`ZUZ_ID_${E.length}_ZUZ`;return E.push(`<span class="--token-${$.name}">${k}</span>`),A});});for(let $=E.length-1;$>=0;$--)y=y.replace(`ZUZ_ID_${$}_ZUZ`,E[$]);}return `<div class="--code-line ${s==true?"--with-ln":""} ${b?"--is-highlighted":""}">
|
|
10
10
|
${s==true?`<span class="--line-number">${v+1}</span>`:""}
|
|
11
11
|
<span class="--line-content">${y||" "}</span>
|
|
12
|
-
</div>`}).join("")},[t,g]);return jsxs(p,{as:`--code-block rel ${d}`,style:f,...c,children:[jsx("pre",{ref:e,children:jsx("code",{className:`--code --lang-${o}`,dangerouslySetInnerHTML:{__html:P}})}),n&&jsx(_,{as:"--copy-code abs",onClick:()=>{copyToClipboard(t),n.onCopy?.();},children:"Copy"})]})},Cm=wm;var ds=({onSelect:e,meta:r,selected:t,disabled:n=false})=>{let o=useRef(null),{index:s,icon:a,label:l}=r,[u,c]=useState({x:0,width:0}),i=useDelayed();return useLayoutEffect(()=>{if(i&&o.current){let{width:d,x:f}=o.current.getBoundingClientRect();c({x:f,width:d}),t&&e(s,d,f,r,true);}},[i,o.current]),useEffect(()=>{t&&e(s,u.width,u.x,r,false);},[t]),jsxs(_,{disabled:n,onClick:()=>e(s,u.width,u.x,r,false),ref:o,className:`--segment-item flex aic rel ${t?"--segment-active":""}`.trim(),children:[a?typeof a=="string"?jsx(te,{name:a,as:"--segment-icon"}):jsx(p,{as:"--segment-icon flex aic jcc",children:a}):null,l&&String(l).trim()!=""&&jsx(p,{className:"--segment-label",children:l||`Item ${s}`})]})};ds.displayName="SelectTabItem";var gs=ds;var ys=forwardRef((e,r)=>{let{fx:t,items:n,selected:o,variant:s,disabled:a=false,onSwitch:l,...u}=e,[c,i]=useState(o||0),d=useDelayed(50),f=useRef(c),{className:m,style:g,rest:P}=B(u),x=useRef(null),T=useRef(null),{variant:S}=j(true),R=(h,v,y,b,E)=>{if((E||c!=h&&c!=-2)&&(i(h),f.current=c,queueMicrotask(()=>{d&&l?.(b);})),x.current){let $=T.current?.getBoundingClientRect();x.current.style.setProperty("--w",`${v}px`),x.current.style.setProperty("--x",`${$?y-$.left:y}px`);}};return useImperativeHandle(r,()=>({setSelected:h=>{typeof h=="number"&&h!=c&&i(h);}}),[c]),jsxs(p,{ref:T,"data-selected":c,className:`${m} --segmented --${s||S||U.Medium} flex aic rel`,style:g,...P,children:[jsx(p,{ref:x,className:`--segment-tab --${a?"disabled":"abled"} abs`}),n.map((h,v)=>jsx(gs,{disabled:a,onSelect:R,selected:c==v,meta:{...h,index:v}},`segment-${h.label}-${v}`))]})});ys.displayName="Zuz.SelectTabs";var Vt=ys;var vs=forwardRef((e,r)=>{let{type:t,variant:n,...o}=e,s=useDelayed(),{colorScheme:a,setColorScheme:l}=No(),u=useCallback(()=>{l(a=="dark"?"light":a=="light"?"system":"dark");},[a]),{variant:c}=j(true),{className:i,style:d}=B(o),f=useMemo(()=>t=="system"?[{tag:"light",index:0,label:"",icon:V.colorSchemeLight},{tag:"system",index:1,label:"",icon:V.colorSchemeSystem},{tag:"dark",index:2,label:"",icon:V.colorSchemeDark}]:[{tag:"light",index:0,label:"",icon:V.colorSchemeLight},{tag:"dark",index:2,label:"",icon:V.colorSchemeDark}],[]),m=useMemo(()=>["light","system","dark"].indexOf(a),[a]);return !s||m==-1?null:t=="system"||t=="switch"?jsx(Vt,{className:`--color-scheme --${t}`,onSwitch:({tag:g})=>{l(g);},selected:m,items:f,...o}):jsx(_,{onClick:u,style:d,variant:n,as:`--color-scheme-switch ${i}`.trim(),children:a=="system"?V.colorSchemeSystem:a=="light"?V.colorSchemeLight:V.colorSchemeDark})});vs.displayName="Zuz.ColorScheme";var $m=vs;var ws=forwardRef((e,r)=>{let[t,n]=useState("wait"),{title:o,message:s,acceptLabel:a,rejectLabel:l,position:u}=e,c=async i=>{n(i==1?"accepted":"rejected"),localStorage.setItem("--ccnt",String(i));};return useEffect(()=>{let i=localStorage.getItem("--ccnt");n(i?i=="1"?"accepted":"rejected":"pending");},[]),jsxs(p,{fx:{from:{x:-1e3},to:{x:0},when:t=="pending",curve:oe.EaseInOut,duration:.5,delay:t=="accepted"?0:3},as:`--cookie-consent --${t} --${u||xe.Left} flex cols`,children:[jsx(K,{as:"--title",children:o||"This site uses cookies"}),jsx(K,{as:"--message",children:s||"We and selected third parties use cookies (or similar technologies) for technical purposes, to enhance and analyze site usage, to support our marketing efforts"}),jsxs(p,{as:"--footer flex aic",children:[jsx(_,{onClick:i=>c(1),as:"--accept",children:a||"Accept All"}),jsx(_,{onClick:i=>c(0),as:"--reject",children:l||"Cancel"})]})]})});ws.displayName="Zuz.CookiesConsent";var Km=ws;var Ts=({ref:e,...r})=>{let {title:t,position:n,margin:o=4,anchorName:s="--tooltip-anchor",children:a,show:l,variant:u,...c}=r,{style:i,className:d,rest:f}=B(c),m=n||xe.Top;useRef(null);let [P,x]=useState(false);useRef(6);let S=l===true||P,h=`--anchor-${useId().replace(/:/g,"")}`,{tooltip:v}=j(true),y=useMemo(()=>{let E=false;return addPropsToChildren(a,$=>{let L=$.props.className?.includes(s);return L&&(E=true),L||!E},($,L)=>{let A=L.props.className?.includes(s),M=$===0,O={};return (A||M)&&(O.style={...L.props.style,anchorName:h}),M&&(O.onMouseEnter=F=>{x(true),L.props.onMouseEnter?.(F);},O.onMouseLeave=F=>{x(false),L.props.onMouseLeave?.(F);}),O})},[a,s,h]),b=be({transition:m==xe.Top?Q.SlideInTop:m==xe.Bottom?Q.SlideInBottom:m==xe.Left?Q.SlideInLeft:Q.SlideInRight,when:S,duration:.2,offset:o+6,margin:m==xe.Top||m==xe.Left?-o:o,curve:v?.curve||oe.EaseInOut});return useImperativeHandle(e,()=>({show:()=>x(true),hide:()=>x(false),setPosition:()=>{}})),jsxs(Fragment$1,{children:[y,jsx(p,{style:{positionAnchor:h,...b.style,...m===xe.Top||m===xe.Bottom?{"--fx-x":"-50%"}:{"--fx-y":"-50%"}},as:`--tooltip --visb-${S} --${u||v?.variant||U.Small} --${m} abs ${d}`.trim(),children:typeof t=="string"?jsx(K,{as:"--text rel",children:t}):t})]})};Ts.displayName="Zuz.ToolTip";var lr=Ts;var Rs=({ref:e,...r})=>{let {type:t,value:n=0,min:o=0,max:s=1,step:a=.01,onChange:l,showGhostBar:u,showKnobOnHover:c,showToolTip:i,roundValue:d,formatValue:f,...m}=r,{className:g,style:P,rest:x}=B(m),T=useRef(a||.01).current,S=useRef(o||0).current,R=useRef(s||1).current,h=useRef(n||0).current,v=useRef(null),y=useRef(null),b=useRef(null),E=useRef(null);useRef(null);let L=useRef(null),A=useRef(null),M=useRef(null),O=useRef(null),F=(re,le,de)=>(re-le)/(de-le)*100,Z=re=>{if(y.current){let le=parseFloat(re.currentTarget.value);ne(le);let de=F(le,parseFloat(re.currentTarget.min),parseFloat(re.currentTarget.max));y.current.style.setProperty("--value",`${de}`),y.current.setAttribute("data-value",`${le}`),l&&l(d?+le.toFixed(2):le);}},[I,k]=useState(false),[X,Y]=useState(0),[H,z]=useState(0),[G,W]=useState(false),ne=async re=>{let le=f?f(+re):d?(+re).toFixed(2):Math.round(+re);M.current&&(M.current.textContent=String(le));},ae=re=>{if(I){let le=re.clientX-X,de=R-S,Ee=le/200*de,Se=Math.max(S,Math.min(H+Ee,R));if(Se=Math.round(Se/T)*T,ne(Se),y.current){let $e=F(Se,S,R);y.current.style.setProperty("--value",`${$e}`),y.current.setAttribute("data-value",`${Se}`),A.current&&(A.current.textContent=d?Se.toFixed(2):Se.toString()),l&&l(Se);}}},pe=()=>{k(false),document.body.style.cursor="auto";},ye=re=>(re-S)/(R-S)*100,ie=re=>{if(!y.current)return;let le=y.current.getBoundingClientRect(),de=re.clientX-le.left,Ae=Math.max(0,Math.min(100,de/le.width*100));if(i&&M.current){let Ee=v.current?+v.current.value:n;ne(Ee*100);}if(u){let Ee=ye(v.current?+v.current.value:n),Se=Math.min(Ee,Ae),$e=Math.abs(Ae-Ee);y.current.style.setProperty("--ghost-start",`${Se}`),y.current.style.setProperty("--ghost-width",`${$e}`);}};useEffect(()=>{y.current&&y.current.style.setProperty("--value",v.current?`${F(parseFloat(v.current.value),parseFloat(v.current.min),parseFloat(v.current.max))}`:h.toString());},[]),useEffect(()=>(I?(document.addEventListener("mousemove",ae),document.addEventListener("mouseup",pe)):(document.removeEventListener("mousemove",ae),document.removeEventListener("mouseup",pe)),()=>{document.removeEventListener("mousemove",ae),document.removeEventListener("mouseup",pe);}),[I]),useEffect(()=>{let re=F(n,S,R);y.current?.style.setProperty("--value",`${re}`),ne(n);},[n,S,R,M.current]);let q=()=>jsxs(p,{ref:y,onMouseEnter:()=>W(true),onMouseLeave:()=>W(false),onMouseMove:ie,className:`--slider --${t||wo.Default} ${c?"--knob-hover":""} flex rel ${g}`.trim(),style:{...P},children:[jsx(p,{ref:L,className:"--slider-track abs fill"}),u&&jsx(p,{ref:E,className:"--slider-ghost abs fill"}),jsx(p,{className:"--slider-track-filled abs fill",style:{width:"calc(var(--value) * 1%)"}}),jsx(p,{ref:b,className:"--slider-knob --tooltip-knob abs"}),jsx(fe,{ref:v,onInput:Z,className:"abs fill",tabIndex:0,type:t||wo.Default,defaultValue:h||0,step:T,max:R,min:S})]});if(i===true){let re=f?f(n):d?n.toFixed(2):n;return jsx(lr,{ref:O,show:I,position:vt.Top,margin:15,anchorName:"--tooltip-knob",title:jsx(me,{ref:M,children:re}),children:q()})}return q()};Rs.displayName="Zuz.Slider";var ct=Rs;var Es=forwardRef((e,r)=>{let{src:t,shape:n,size:o,...s}=e,{style:a,className:l,rest:u}=B(s),{canvasRef:c,crop:i,setScale:d,handleMouseDown:f,handleMouseUp:m,handleMouseMove:g}=useImageCropper(t,o||200,n||CropShape.Circle);return useImperativeHandle(r,()=>({getCropped(){return i()},setScale(P){d(P);}})),jsxs(p,{as:`--cropper --${n||CropShape.Circle} ${l}`,style:a,...u,children:[jsx("canvas",{ref:c,width:o||200,height:o||200,onMouseDown:f,onMouseUp:m,onMouseLeave:m,onMouseMove:g}),jsx(p,{as:"--cropper-slider",children:jsx(ct,{onChange:P=>d(P),min:0,max:1,step:.01,value:1})})]})});Es.displayName="Zuz.Cropper";var tp=Es;var rp=(t=>(t.Circle="circle",t.Square="square",t))(rp||{});var Bs=forwardRef((e,r)=>{let{items:t,maxItems:n}=e,o=useMemo(()=>{let l=typeof t=="string",u=l?[]:t;return l&&t.split(",").forEach(c=>{u.push({label:c});}),u},[t]),a=useMemo(()=>n&&n>0&&o.length>n-1,[o,n])?[...o.slice(0,2),{ID:".",label:"...",icon:"ellipsis",action:()=>{}},...o.slice(-n)]:o;return jsx(et,{ref:r,className:"--crumb flex aic",direction:"rows",seperator:jsx(p,{as:"--crumb-chevron",children:V.chevronRightOutline}),items:a.map((l,u,c)=>l.ID=="."?jsx(p,{as:"flex aic gap:3",children:Array(3).fill(null).map(()=>jsx(p,{as:"w:4 h:4 bg:$text r:10"},`--crumb-placeholder-${u}`))}):jsxs(_,{onClick:()=>l.action?.(),className:"--crumb-item",disabled:!c[u+1],children:[l.icon&&jsx(te,{as:"--crumb-icon",name:l.icon}),jsx(K,{as:"--crumb-label",children:l.label})]},`${l.label.replace(/\s+/g,"-").toLowerCase()}-${u}`))})});Bs.displayName="Zuz.Crumb";var sp=Bs;var Ms=forwardRef((e,r)=>{let{icon:t,defaultValue:n,value:o,size:s,variant:a,numeric:l,type:u,onConfirm:c,...i}=e,[d,f]=useState(false),[m,g]=useState(n||null),{style:P,className:x,rest:T}=B(i),S=useRef(null),R=useRef(null),{reposition:h}=It(R,{direction:xe.Bottom,offset:2}),v=b=>{l&&(b.currentTarget.value=b.currentTarget.value.replace(/[^0-9.]/g,"").replace(/(\..*?)\..*/g,"$1"));};useEffect(()=>{let b=E=>{let $=E.target,L=S.current?.contains($),A=R.current?.contains($);!L&&!A&&f(false);};return d&&document.addEventListener("mousedown",b),()=>{document.removeEventListener("mousedown",b);}},[d]),useEffect(()=>{let b=E=>{E.key==="Escape"&&d&&(f(false),S.current?.focus());};return document.addEventListener("keydown",b),()=>document.removeEventListener("keydown",b)},[d]);let y=()=>{f(true);};return useEffect(()=>{d&&h();},[d,h]),jsx(Fragment$1,{children:jsxs(p,{as:`--date-picker ${a?`--${a}`:""} rel flex aic ${x}`,"data-value":m?m.toISOString():"",children:[t?typeof t=="string"?jsx(te,{as:"mr:10 c:#666",name:t}):t:jsx(me,{as:"--date-picker-icon flex aic jcc",children:V.calendar}),jsx("input",{ref:S,value:m?format(m,"EEE, MMM d YYY hh:mm a"):o||"",className:`--input ${a?`--${a}`:""} flex`.trim(),style:P,onFocus:y,onInput:v,autoComplete:"new-password",onKeyDown:b=>{b.key=="Enter"&&c?.(b.currentTarget.value);},...T}),jsx(p,{"aria-hidden":!d,ref:R,fx:{from:{y:5,opacity:0},to:{y:0,opacity:1},when:d,duration:.05},as:`--date-picker-chooser flex aic ${a?`--${a}`:""}`,children:jsx(er,{defaultValue:m,onChange:b=>{g(b),f(false);}})})]})})});Ms.displayName="Zuz.DatePicker";var cp=Ms;var Os=forwardRef((e,r)=>{let{icon:t,variant:n,position:o}=e;return jsx(_,{className:`--fab fixed --${n||U.Large} --${o||"bottomright"}`,children:t||V.plus})});Os.displayName="Zuz.Fab";var fp=Os;var gp=({ref:e,children:r,...t})=>{let{legend:n,legendPlacement:o,variant:s,...a}=t,{variant:l}=j(true),{className:u,style:c,rest:i}=B(a);return jsxs(p,{as:`--fieldset --rel --flex --${s||l||U.Medium} ${u}`.trim(),style:c,children:[jsx(p,{as:`--legend --abs --${o||"top-start"}`,children:n&&typeof n=="string"?jsx("legend",{children:n}):n}),r]})},hp=gp;var Ds=e=>{let{names:r,strength:t}=e,n={[zt.Gooey]:o=>jsxs("filter",{id:"gooey",children:[jsx("feGaussianBlur",{in:"SourceGraphic",stdDeviation:o||10,result:"blur"}),jsx("feColorMatrix",{in:"blur",mode:"matrix",values:"1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 18 -7",result:"goo"}),jsx("feBlend",{in:"SourceGraphic",in2:"goo"})]},`filter-${zt.Gooey}`)};return useEffect(()=>{},[r]),jsx("svg",{xmlns:"http://www.w3.org/2000/svg",version:"1.1",children:jsx("defs",{children:(r||[zt.Gooey]).map(o=>n[o](t))})})};Ds.displayName="Zuz.Filters";var bp=Ds;var Hs=({cols:e,gap:r,ais:t,aic:n,aie:o,jcs:s,jcc:a,jce:l,className:u="",style:c,...i})=>{let d=["--flex",e?"--cols":"",t?"--ais":"",n?"--aic":"",o?"--aie":"",s?"--jcs":"",a?"--jcc":"",l?"--jce":"",u].filter(Boolean).join(" "),f={...c,gap:typeof r=="number"?`${r}px`:r};return jsx(p,{...i,className:d,style:f})};Hs.displayName="Zuz.FlexBox";var De=Hs;var We=null,Re=null,$s=forwardRef((e,r)=>{let{title:t,message:n,transition:o,curve:s,speed:a,type:l,actionPosition:u,spinner:c,loadingMessage:i,onShow:d,onHide:f,...m}=e,{className:g,style:P,rest:x}=B(m),[T,S]=useState(t||""),[R,h]=useState(n||""),[v,y]=useState(null),[b,E]=useState(l||Be.Default),$=useMemo(()=>uuid(12),[]),[L,A]=useState(false),M=useRef(null),O=useRef(null),[F,Z]=useState(false),[I,k]=useState(true),X=useRef(null),Y=R;useImperativeHandle(r,()=>({setLoading(z){Z(z);},showDialog(z,G,W,ne){We&&(clearTimeout(We),Re&&clearTimeout(Re),M.current.classList.remove("--wobble"),setTimeout(()=>M.current.classList.add("--wobble"),50),Re=setTimeout(()=>{M.current.classList.remove("--wobble"),Re=null;},500)),E(Be.Dialog),G&&h(G),z&&S(z),W&&y(W.reduce((J,ae)=>(J.push({...ae,key:ae.key||uuid(12)}),J),[])),A(true),setTimeout(()=>ne?ne():()=>{},1e3);},dialog(z,G,W,ne){We&&(clearTimeout(We),Re&&clearTimeout(Re),M.current.classList.remove("--wobble"),setTimeout(()=>M.current.classList.add("--wobble"),50),Re=setTimeout(()=>{M.current.classList.remove("--wobble"),Re=null;},500)),E(Be.Dialog),h(G),S(z),W&&y(W.reduce((J,ae)=>(J.push({...ae,key:ae.key||uuid(12)}),J),[])),A(true),setTimeout(()=>ne?ne():()=>{},1e3);},error(z,G){this.show(z,G,Be.Error);},warn(z,G){this.show(z,G,Be.Warn);},success(z,G){this.show(z,G,Be.Success);},show(z,G,W){We&&(clearTimeout(We),Re&&clearTimeout(Re),O.current=M.current.style.transform,M.current.style.transform="",M.current.classList.remove("--wobble"),setTimeout(()=>{M.current.classList.add("--wobble"),M.current.style.transform=`${O.current} scale(.9)`.trim();},50),Re=setTimeout(()=>{M.current.classList.remove("--wobble"),M.current.style.transform=O.current||"",Re=null;},500)),We=setTimeout(()=>{A(false),We=null,Re=null;},(G||4)*1e3),E(W||Be.Default),h(z),A(true),d?.();},hide(){A(false),f?.();}}));let H=useMemo(()=>{let z={when:L,duration:a||.3,delay:.1};if(b==Be.Dialog){if(o){let{from:G,to:W}=wt(o,20);return {from:G,to:W,curve:s||oe.EaseInOut,...z}}return {from:{scale:0,x:"-50%",y:"-50%",opacity:0},to:{scale:1,x:"-50%",y:"-50%",opacity:1},curve:oe.Spring,...z}}else return {from:{scale:0,x:"-50%",y:"-10vh",opacity:0},to:{scale:1,x:"-50%",y:0,opacity:1},curve:oe.Spring,...z}},[L,b]);return useEffect(()=>{X.current&&clearTimeout(X.current),L?k(true):X.current=setTimeout(()=>k(false),1e3);},[L]),b==Be.Dialog?jsxs(Fragment$1,{children:[jsx(Ye,{when:L}),jsxs(p,{className:`--sheet --sheet-${b.toLowerCase()} ${L?"is-visible":""} ${g} fixed`.trim(),style:P,fx:H,...x,ref:M,children:[jsx(Me,{when:F,spinner:c,message:i}),jsxs(p,{className:"--head flex aic rel",children:[jsx(p,{className:`--${T?"title":"dot"} flex aic rel`,children:T||""}),jsx(_,{onClick:z=>A(false),className:"--closer abs",children:"\xD7"})]}),jsx(p,{className:`--body flex aic rel ${v?"":"--no-action"}`.trim(),children:I?Y:null}),v&&jsx(p,{className:`--footer flex aic rel ${u?u==So.Center?"jcc":"":"jce"}`.trim(),children:v.map((z,G)=>jsx(_,{onClick:W=>z.handler?z.handler():z.onClick?z.onClick():console.log("onClick Handler missing"),className:"--action",children:z.label},`sheet-${$}-action-${z.key}`))})]})]}):jsx(p,{className:`--sheet --sheet-${b.toLowerCase()} ${g} abs`.trim(),style:P,...x,fx:H,ref:M,children:L?R:null})}),Fs=e=>typeof e=="object"&&e!=null&&"setLoading"in e&&"success"in e&&"error"in e;$s.displayName="Zuz.Sheet";var Tp=$s;var Mp=e=>{let r={};for(let t in e){let n=t.split(/[\[\]]+/).filter(Boolean);n.reduce((o,s,a)=>{if(a===n.length-1)o[s]=e[t];else {let l=!isNaN(Number(n[a+1]));o[s]=o[s]||(l?[]:{});}return o[s]},r);}return r},zs=({ref:e,...r})=>{let {schema:t,name:n,cover:o,spinner:s,errors:a,action:l,children:u,withData:c,beforeSubmit:i,onSubmit:d,onError:f,onSuccess:m,resetOnSuccess:g,...P}=r,{className:x,style:T,rest:S}=B(P),[R,h]=useState(false),v=useRef(null),y=Zo(),b=Nt();Yo();let $=useRef(null),L=useCallback(H=>v.current?v.current.querySelectorAll(H):[],[v.current]),A=H=>({name:H.name||H.getAttribute("name")||H.getAttribute("data-name"),required:H.required?true:H.getAttribute("data-required")?H.getAttribute("data-required")=="true":false,with:H.with||H.getAttribute("with")}),M=H=>{let z=[];return H.querySelectorAll(".--input").forEach(G=>{z.push(G.value);}),z.join("")},O=H=>H.classList.contains("--otp")?M(H):H.classList.contains("--select")?H.querySelector("button.--selected")?.dataset.value:H.classList.contains("--checkbox")||H.getAttribute("type")==="checkbox"?H.checked:H.value,F=useCallback(H=>{let{name:z,required:G,with:W}=A(H),ne=O(H);if(t&&t[z]&&b?.getSnapshot()){let J=t[z](ne,b.getSnapshot().values);if(J===false||typeof J=="string")return typeof J=="string"&&b?.setFieldError(z,J),false}if(G&&(H.type==="checkbox"&&!H.checked||H.classList.contains("--select")&&(ne==="-1"||!ne)||!ne||ne===""))return false;if(W)switch((W.includes("@")?W.split("@")[0]=="match"?Xe.MatchField:W.split("@")[0]:W).toUpperCase()){case Xe.IPV4:return _$1(ne).isIPv4();case Xe.IPV6:return _$1(ne).isIPv6();case Xe.Email:return _$1(ne).isEmail();case Xe.Uri:try{return new URL(ne),!0}catch{return false}case Xe.MatchField:let[ae,pe,ye]=W.split("@"),ie=document.querySelector(`[name=${pe.trim()}]`);if(!ie)return false;switch(ye||"direct-match"){case "if-not-empty":if(ie&&!_$1(ie.value).isEmpty()&&ie.value!=H.value)return false;break;case "direct-match":if(ie&&ie.classList.contains("--otp")&&H.classList.contains("--otp")&&M(ie)!=M(H))return false;if(ie&&ie.value!=H.value)return false;break}break}return true},[t,b]),Z=useCallback(()=>{let H={},z={...b?.getSnapshot().values||{}},G=null,W=null;if(L("[name]").forEach(J=>{let{name:ae,required:pe,with:ye}=A(J),ie=pe||ye?F(J):true,ce=O(J);H[ae]={valid:ie,value:ce},z[ae]=ce,b?.setFieldError(ae,ie?null:a?.[ae]||"Invalid"),ie?J.classList.remove("--with-error"):(J.classList.add("--with-error"),G||(G=J),W=a?.[ae]);}),G){let J=G;if(J.classList.contains("--otp"))for(let ae of Array.from(J.querySelectorAll(".--input"))){let pe=ae;if(pe.value==""){pe.focus();break}}else J.focus();}let ne=Mp(z);return {error:G!=null,errorMsg:W||"Fix errors to continue...",data:H,payload:ne}},[v.current,b]),I=useCallback((H={})=>{let{error:z,errorMsg:G,payload:W,data:ne}=Z();if(z){y.error(G);return}l?startTransition(async()=>{h(true),withPost(l,{...c,...W,...H}).then(J=>{h(false),g&&b?.reset(),m?.(J,{...c,...W,...H}),m||y.success(J.message||"Redirecting...");}).catch(J=>{h(false),f?f(J):y.error(J.message);});}):d?.(W,ne);},[Z,l,c,m,f,g,d]),k=useCallback(()=>{let H=L("[type=submit]");!H||H.length==0?console.warn("You should add at least 1 button with type=`SUBMIT`"):H.forEach(z=>{z.addEventListener("click",I);});},[v.current]),X=useMemo(()=>addPropsToChildren(u,H=>H.props.type=="submit",H=>({ref:$})),[u]),Y=useRef(I);return useImperativeHandle(e,()=>({setLoading:H=>h(H),submit:H=>Y.current(H),init:k,hideError:()=>y.clearAll()}),[I,k]),useEffect(k,[]),useEffect(()=>{Y.current=I;},[I]),useEffect(()=>{let H=L("[type=submit]"),z=Array.from(H).map(G=>{let W=G;return W.addEventListener("click",I),()=>W.removeEventListener("click",I)});return ()=>z.forEach(G=>G())},[I,L]),jsxs(p,{ref:v,style:T,className:`--form flex rel ${x}`,children:[!Fs(o)&&jsx(Me,{when:R,spinner:s,...o}),X]})};zs.displayName="Zuz.FormInternal";var _s=e=>jsx($n,{initialValues:e.withData,children:jsx(zs,{...e})});_s.displayName="Zuz.Form";var Op=_s;var Ks=e=>{let {ref:r,cols:t,rows:n,gap:o,gapX:s,gapY:a,align:l,justify:u,inline:c,flow:i,autoCols:d,autoRows:f,template:m,...g}=e;useRef(null);let {className:x,style:T,rest:S}=B(g),R=v=>typeof v=="number"?`repeat(${v}, 1fr)`:v,h={display:c?"inline-grid":"grid",gridTemplateColumns:R(t),gridTemplateRows:R(n),gap:o,columnGap:s,rowGap:a,alignItems:l,justifyContent:u==="between"?"space-between":u==="around"?"space-around":u,gridAutoFlow:i,gridAutoColumns:d,gridAutoRows:f,gridTemplateAreas:m,...T};return jsx(p,{ref:r,as:`--grid ${x}`.trim(),style:h,...S})};Ks.displayName="Zuz.Grid";var Hp=Ks;var Zs=e=>typeof e=="string"&&e.includes("+"),Ws={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"},Gs={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 qs=forwardRef(({children:e,keys:r,as:t,className:n,variant:o},s)=>{let{variant:a}=j(true),l=useMemo(()=>{if(Zs(r)){let u=null;return {keys:String(r).split("+").reduce((i,d,f,m)=>(m[f+1]?i.push(d):u=d.toUpperCase(),i),[]),children:u}}return {keys:r,children:String(e).toUpperCase()}},[r]);return jsxs(p,{as:`--keyboard-keys --${o||a||U.Small} flex aic ${t} ${n}`.trim(),children:[(Array.isArray(l.keys)?l.keys:[l.keys]).map(u=>jsx("abbr",{title:Gs[u],children:Ws[u]},u)),jsx(me,{children:l?.children??e})]})});qs.displayName="Zuz.KeyboardKeys";var xr=qs;var js=createContext(null),ut=()=>{let e=useContext(js);if(!e)throw new Error("MediaPlayer sub-components must be used within <MediaPlayer />");return e},Wp=({ref:e,icons:r,children:t,...n})=>{let{playlist:o=[],mode:s="audio",defaultArtist:a="Artist",defaultTitle:l="No Track",defaultCover:u,onTrackChange:c,...i}=n,{className:d,style:f,rest:m}=B(i),g=useMediaPlayer(o,o[0]??void 0),P=useMemo(()=>({play:V.play,pause:V.pause,prev:V.prev,next:V.next,volumeHigh:V.volumeHigh,volumeMute:V.volumeMute,...r}),[r]),x=useMemo(()=>({...g,mode:s,icons:P}),[g,P]);return jsx(js.Provider,{value:x,children:jsx(p,{className:`--zuz-media-player ${d}`,style:f,children:t})})},Qs=Wp;var Js=e=>{if(!e||isNaN(e))return "0:00";let r=Math.floor(e/60),t=Math.floor(e%60);return `${r}:${t.toString().padStart(2,"0")}`},co=e=>typeof e=="string"?jsx(te,{name:e}):e,ea=()=>{let{mediaRef:e,state:r,controls:t,mode:n}=ut();return jsxs(p,{as:`--mediaplayer-stage rel --mode-${n}`,children:[n==="video"?jsx("video",{ref:e,className:"fill",onClick:t.togglePlay}):jsx("audio",{ref:e}),r.isLoading&&jsx(p,{as:"abs fill aic jcc --mediaplayer-spinner",children:jsx(Ce,{})})]})},ta=()=>{let{state:e,defaultArtist:r,defaultTitle:t,defaultCover:n}=ut();return jsxs(p,{as:"--track-info flex aic",children:[jsx(tt,{src:e.currentItem?.cover||n||"",as:"--track-cover"}),jsxs(p,{as:"flex cols",children:[jsx(p,{as:"--track-title",children:e.currentItem?.title||t||"Choose Track"}),jsx(p,{as:"--track-artist",children:e.currentItem?.artist||r||"..."})]})]})},oa=()=>{let{state:e,controls:r,icons:t}=ut();return jsxs(p,{as:"--mediaplayer-controls flex aic",children:[jsx(_,{onClick:r.prev,as:"--prev",children:co(t?.prev??V.prev)}),jsx(_,{onClick:r.togglePlay,as:"--play-pause",children:co(e.isPlaying?t?.pause??V.pause:t?.play??V.play)}),jsx(_,{onClick:r.next,as:"--next",children:co(t?.next??V.next)})]})},ra=()=>{let{state:e,controls:r,mediaRef:t}=ut(),n=e.progress*(e.duration||0);return jsxs(p,{as:"--track-progress flex aic",children:[jsx(p,{as:"--track-current-duration",children:Js(n)}),jsx(ct,{value:e.progress,onClick:o=>{let s=o.currentTarget.getBoundingClientRect(),a=(o.clientX-s.left)/s.width;r.seek(a);}}),jsx(p,{as:"--track-total-duration",children:Js(e.duration)})]})},na=()=>{let{state:e,controls:r,icons:t}=ut();return jsxs(p,{as:"--volume-control flex aic gap:8 w:120",children:[jsx(_,{onClick:()=>r.setIsMuted(),children:co(e.isMuted?t?.volumeMute??V.volumeMute:t?.volumeHigh??V.volumeHigh)}),jsx(ct,{value:e.volume,className:"h:3 flex:1",onClick:n=>{let o=n.currentTarget.getBoundingClientRect();r.setVolume((n.clientX-o.left)/o.width);}})]})};var Gp=Object.assign(Qs,{Stage:ea,TrackInfo:ta,Controls:oa,Progress:ra,Volume:na}),Up=Gp;var aa=forwardRef((e,r)=>{let t=useNetworkStatus(),{onlineMessage:n,offlineMessage:o,variant:s}=e;return jsxs(p,{fx:{from:{x:"-50%",y:200,opacity:0},to:{x:"-50%",y:0,opacity:1},when:t==false,curve:oe.Spring,duration:.5,delay:2},className:`--network-manager --${t==true?"online":"offline"} --${s||U.Small} fixed flex`,children:[jsx(p,{className:"--ico",children:t?V[Ne.Success]:V[Ne.Error]}),jsx(K,{as:"--message",children:t?n||"internet connection restored :)":o||"no internet connection"})]})});aa.displayName="Zuz.NetWorkManager";var Yp=aa;var la=forwardRef((e,r)=>{let{strenthMeter:t,onChange:n,...o}=e;"type"in o&&delete o.type;let{style:s,className:a,rest:l}=B(o),[u,c]=useState(false),[i,d]=useState(""),f=useMemo(()=>checkPasswordStrength(i),[i]),m=useDebounce(g=>{t&&d(g.target.value),n&&n(g);},100);return useEffect(()=>{},[]),jsxs(p,{as:"w:100% flex cols",children:[jsxs(p,{style:s,className:"--password flex aic rel",children:[jsx(fe,{ref:r,type:u?"text":"password",className:a,onChange:m,...l}),jsx(_,{tabIndex:-1,onClick:()=>c(g=>!g),className:"--toggle flex aic jcc abs",children:u?V.eye:V.eyeSlash})]}),t&&jsxs(p,{as:`flex aic --password-meter --pb-score-${f.score}`,style:s,children:[jsxs(p,{as:"--password-bars flex aic",children:[jsx(p,{as:`--pbar ${f.score>=1?"--pb-on":""}`.trim()}),jsx(p,{as:`--pbar ${f.score>=2?"--pb-on":""}`.trim()}),jsx(p,{as:`--pbar ${f.score>=3?"--pb-on":""}`.trim()}),jsx(p,{as:`--pbar ${f.score>=4?"--pb-on":""}`.trim()}),jsx(p,{as:`--pbar ${f.score>=5?"--pb-on":""}`.trim()})]}),jsx(K,{as:"--password-meter-label","aria-hidden":true,children:f.result})]})]})});la.displayName="Zuz.Password";var ru=la;var ma=forwardRef((e,r)=>{let{size:t,length:n,mask:o,...s}=e,a=useRef([]),l="pinput",u=false,c={};"with"in s&&(c={with:s.with},delete s.with),"type"in s&&delete s.type,"name"in s&&(l=s.name,delete s.name),"required"in s&&(u=true,delete s.required);let{style:i}=B(s),d=m=>{let g=m.currentTarget,P=a.current[parseInt(g.dataset.index)+1],x=a.current[parseInt(g.dataset.index)-1];g.value.length===1&&P?P.focus():g.value.length===0&&x&&x.focus();},{variant:f}=j(true);return useEffect(()=>{a.current=a.current.slice(0,t||n);},[t||n]),jsx(p,{name:l,style:i,className:`--otp --${s.variant??f??U.Medium} flex aic rel`,"data-required":u,"data-size":t||n||4,...c,children:Array(t||n||4).fill(1).map((m,g)=>jsx(fe,{autoComplete:"new-password","data-index":g,ref:P=>{a.current[g]=P;},numeric:true,onChange:d,maxLength:1,placeholder:o?"\xB7":"0",type:o?"password":"text",...s},`pin-${g}`))})});ma.displayName="Zuz.PinInput";var iu=ma;var pa=forwardRef((e,r)=>{let{children:t,className:n,name:o,required:s,type:a,value:l,variant:u,checked:c,onSwitch:i,...d}=e,[f,m]=useState(c||false),{variant:g}=j(true),P=useRef(null);return jsxs(Mt,{className:`${n} --${(a||Co.Default).toLowerCase()} --radio${!a||a==Co.Default?"":"card"} --${u||g||U.Small} flex aic rel`.trim(),...d,children:[jsx(fe,{ref:P,defaultChecked:f,value:l||"rd",type:"radio",className:"abs",name:o,required:s||false,onChange:x=>{i&&i(x.target.checked,l||"cb"),m(x.target.checked);}}),jsx(p,{className:"--dot rel",children:jsx(p,{className:"--rod abs abc"})}),jsx(p,{className:"--value",children:t})]})});pa.displayName="Zuz.Radio";var pu=pa;var ua=forwardRef((e,r)=>{let{fx:t,withStyle:n,as:o,reverse:s=false,searchIcon:a=V.search,hideSearchIcon:l=false,clearIcon:u=V.close,hideClearIcon:c=false,onChange:i,onClear:d,...f}=e,{style:m,className:g}=B({as:e.as}),[P,x]=useState(""),{variant:T}=j(true),S=useRef(null);"type"in e&&delete e.type;let R=v=>{x(v.target.value),i?.(v.target.value);},h=v=>{P.trim()!==""&&(x(""),i?.(""),S.current&&(S.current.value="",e.onConfirm?.("")));};return useImperativeHandle(r,()=>({focus:()=>S.current?.focus(),value:()=>S.current?.value})),useEffect(()=>{},[]),jsxs(p,{style:m,className:`--search --no-shrink ${s?"--search-rev":""} --${e.variant||T||U.Medium} flex aic ${typeof e.as=="string"&&e.as.includes("abs")?"":"rel"} ${g}`.trim(),children:[jsx(fe,{ref:S,onChange:R,...f}),e.shortcut&&jsx(xr,{keys:e.shortcut,as:"abs"}),jsx(_,{tabIndex:-1,onClick:v=>h(),className:"--send flex aic jcc",variant:e.variant||U.Medium,children:P!==""?!c&&(typeof u=="string"?jsx(te,{name:u,as:"--search-action"}):u):!l&&(typeof a=="string"?jsx(te,{name:a,as:"--search-action"}):a)})]})});ua.displayName="Zuz.Search";var br=ua;var bu=({label:e,icon:r})=>jsxs(p,{as:"--select-options-head --no-shrink --disabled".trim(),"aria-hidden":"true",children:[r&&jsx(te,{name:r}),jsx(K,{as:"--select-group-label",children:e})]}),da=bu;var ha=({checkIcon:e,selected:r,updateValue:t,o:n})=>{let o=e?typeof e=="string"?jsx(te,{name:"checkIcon"}):e:V.check,s=n.disabled===true;return jsxs(_,{onClick:a=>{s||(a.stopPropagation(),t(n));},disabled:s,as:`--select-option-item --no-shrink ${r?"--selected":""} ${s?"--disabled":""} rel`.trim(),children:[jsxs(De,{as:"--option-item-meta --aic",children:[n.icon&&jsx(te,{name:n.icon,as:`--select-option-icon --icon-${n.value}`,color:n.iconColor}),jsx(K,{suppressHydrationWarning:true,children:typeof n=="string"?n:n.label})]}),r&&jsx(De,{aic:true,jcc:true,as:"--select-option-check --abs",children:o})]})};ha.displayName="Option";var ya=ha;var ba=(({ref:e,...r})=>{let{selected:t,options:n,label:o,name:s,variant:a,search:l,searchPlaceholder:u,maxHeight:c,arrowDownIcon:i=V.arrowDown,arrowUpIcon:d=V.arrowUp,expanded:f,multiple:m,tokenizer:g,wrapTokens:P,disabled:x,checkIcon:T,closeIcon:S,editable:R,editablePlaceholder:h,onChange:v,required:y,with:b,...E}=r,$=Nt(),L=!!(s&&$?.setFieldValue),A=An(s),M=Hn(s),O=R===true&&m!==true&&g!==true,F=N=>typeof N=="string"||typeof N=="number",Z=N=>typeof N=="object"&&N!==null&&!Array.isArray(N)&&"value"in N&&"label"in N,I=N=>n.find(ee=>String(ee.value)===String(N)),k=N=>{if(N==null)return null;if(O&&N==="")return "";if(m||g)return (Array.isArray(N)?N:[N]).map(ge=>F(ge)?I(ge):ge).filter(ge=>Z(ge));if(F(N)){let ee=I(N);return ee||(O?String(N):null)}return Z(N)?N:null},X=()=>{if(t!==void 0)return k(t);let N=n.find(ee=>String(ee.value)==="-1");return N||(O?"":null)},Y=N=>Array.isArray(N)?N.map(ee=>ee.value):Z(N)?N.value:N,[H,z]=useState(()=>X()),[G,W]=useState(false),[ne,J]=useState(null),ae=useRef(null),pe=useRef(null),ye=useRef(null),ie=useId(),ce=useMemo(()=>s||ie,[s,ie]),{reposition:q}=It(ye,{direction:vt.Bottom,offset:2}),{variant:re}=j(true),le=S?typeof S=="string"?jsx(te,{name:S}):S:V.close,{className:de,style:Ae,rest:Ee}=B(E,void 0),{onClick:Se,...$e}=Ee||{},se=useMemo(()=>M!==void 0?k(M):H,[M,H,n,O,m,g]),qe=useMemo(()=>{if(!(!se||Array.isArray(se)||!Z(se)))return se},[se]),Nr=useMemo(()=>O?Z(se)?String(se.value??""):F(se)?String(se):"":"",[O,se]),Ua=N=>Array.isArray(se)?se.some(ee=>ee.value===N.value):Z(se)?se.value===N.value:O&&F(se)?String(se)===String(N.value):false,st=N=>{if(L&&$?.setFieldValue&&s){$.setFieldValue(s,Y(N));return}z(N);},bt=N=>{v?.(R===true&&N instanceof Option?String(N.value):N);},qa=N=>{if(!(x||N.disabled)){if(m||g){let ee=Array.isArray(se)?se:[],Ie=ee.find(bo=>bo.value===N.value)?ee.filter(bo=>bo.value!==N.value):[...ee,N];st(Ie),bt(Ie);return}st(N),W(false),bt(N);}},Xa=N=>{let ee=N.target.value,ge=ee===""?null:I(ee),Ie=ge?ge.value:ee;st(Ie),bt(Ie);},Ya=N=>{if(N.key==="Enter"&&(N.preventDefault(),O)){let ee=N.currentTarget.value.trim();if(!ee){W(false);return}let Ie=I(ee)??ee;st(Ie),bt(Ie),W(false);}},ja=(N,ee)=>{if(N.stopPropagation(),x)return;let ge=se.filter(Ie=>Ie.value!==ee.value);st(ge),W(false),bt(ge);},Qa=N=>{let ee=N.currentTarget,ge=ee.scrollTop===0&&N.deltaY<0,Ie=ee.scrollHeight-ee.scrollTop===ee.clientHeight&&N.deltaY>0;!ge&&!Ie||N.preventDefault(),N.stopPropagation();};useImperativeHandle(e,()=>({setSelected:N=>{st(k(N));},getValue:()=>se??null}),[se,n,O,m,g,L,s]),useEffect(()=>{L||t===void 0||z(k(t));},[t,L,n,O,m,g]),useEffect(()=>{if(!G)return;let N=()=>{q();};return window.addEventListener("scroll",N,true),window.addEventListener("resize",q),()=>{window.removeEventListener("scroll",N,true),window.removeEventListener("resize",q);}},[G,q]),useEffect(()=>{if(!G){pe.current&&(pe.current.value=""),J(null);return}pe.current?.focus(),q();let N=ge=>{ae.current&&!ae.current.contains(ge.target)&&W(false);},ee=setTimeout(()=>{document.addEventListener("click",N);},0);return ()=>{clearTimeout(ee),document.removeEventListener("click",N);}},[G,q]);let Ja=useDebounce(N=>J(N===""?null:N),300),ei=useDebounce(Xa,300);return jsxs(p,{ref:ae,"data-required":y?"true":void 0,with:b,className:[`--select ${f==true?"--expanded":""}`,`--${a||re}`,`${s?`--${s}`:""}`,`${A?"--has-error":""}`,`${x?"--disabled":""} rel`].join(" ").trim(),name:ce,children:[O?jsxs(p,{"data-value":qe?.value??(Nr||"-1"),className:`--select-display --selected --editable flex aic rel ${de}`.trim(),style:Ae,onClick:N=>N.stopPropagation(),...$e,children:[qe?.icon&&jsx(te,{as:"--selected-icon",name:qe.icon}),jsx(De,{aic:true,as:"--label-wrapper",children:jsx(fe,{"aria-expanded":G,className:"--select-input",disabled:x,onChange:ei,onClick:N=>{N.stopPropagation(),x||W(true);},onKeyDown:Ya,placeholder:h||o||"Choose",type:"text",defaultValue:Nr})}),jsx(_,{className:"--select-toggle rel flex aic jcc",disabled:x,onClick:N=>{N.stopPropagation(),x||W(ee=>!ee);},tabIndex:-1,withLabel:false,children:G?typeof d=="string"?jsx(te,{name:d,as:"--search-action"}):d:typeof i=="string"?jsx(te,{name:i,as:"--search-action"}):i})]}):jsxs(_,{disabled:x,variant:a||re,"data-value":qe?.value??"-1",className:`--select-display --selected flex aic rel ${de}`.trim(),withLabel:false,style:Ae,onClick:N=>{N.stopPropagation(),x||W(ee=>!ee);},...$e,children:[qe?.icon&&jsx(te,{as:"--selected-icon",name:qe.icon}),jsx(De,{aic:true,as:"--label-wrapper",children:g&&Array.isArray(se)&&se.length>0?jsxs(De,{as:`--tokens-wrap${P===true?" --wrap":""}`,children:[se.map(N=>jsxs(De,{aic:true,as:"--token",children:[jsx(K,{as:"--token-label",children:N.label}),jsx(p,{as:"--token-remove",onClick:ee=>ja(ee,N),children:le})]},N.value)),se.length<n.length&&jsx(K,{as:"--label",children:o||"Choose"})]}):jsx(K,{as:"--label",children:Array.isArray(se)?se.length>0?`${se.length} selected`:o||"Choose":qe?.label||o||"Choose"})}),jsx(p,{className:"--svg-arrow rel flex aic jcc",children:G?typeof d=="string"?jsx(te,{name:d,as:"--search-action"}):d:typeof i=="string"?jsx(te,{name:i,as:"--search-action"}):i})]}),jsxs(p,{id:ce,className:"--options-list --allow-scroll -fx flex cols abs zIndex:var(--max-z-index)","aria-hidden":!G,onWheel:Qa,style:{maxHeight:c||"auto"},ref:ye,fx:{from:{y:5,opacity:0},to:{y:0,opacity:1},when:G,duration:.05},children:[l&&jsx(p,{as:"--select-search --no-shrink flex --sticky",children:jsx(br,{ref:pe,variant:U.Small,placeholder:u||"Search...",onChange:Ja})}),o&&jsx(da,{label:o}),n?.filter(N=>!ne||N.label.toLowerCase().includes(ne.toLowerCase()))?.map(N=>jsx(ya,{updateValue:qa,checkIcon:T,selected:Ua(N),o:N},`option-${N.label.replace(/\s+/g,"-")}-${N.value}`))]})]})});ba.displayName="Zuz.Select";var Cu=ba;var va=({ref:e,...r})=>jsx(Ot,{type:Fe.Switch,...r,ref:e});va.displayName="Zuz.Switch";var Pu=va;var wa=e=>{let{idx:r,id:t,as:n,weight:o,style:s,value:a,render:l,resize:u,sortBy:c,sortable:i,onSort:d}=e,[f,m]=useState(0),g=()=>{i&&(d?.(String(t),f==1?-1:1),m(P=>P==1?-1:1));};return jsxs(p,{style:{flex:o||1,...s},as:`--col flex aic ${n||""} ${i?"--sortable":""}`,onClick:g,children:[jsx(p,{as:"--colv",children:a}),r==-1&&i&&c==t&&jsx(p,{as:"--arrow flex aib",children:f==1?V.arrowUp:V.arrowDown})]})};wa.displayName="Zuz.Column";var go=wa;var Pa=e=>{let{index:r,pubsub:t,schema:n,data:o,ids:s,styles:a,animate:l,sortBy:u,selectable:c,tableRef:i,loading:d,rowClassName:f,onSort:m,onRowClick:g,onSelect:P,onContextMenu:x}=e,T=useDelayed(),S=useMemo(()=>({transition:Q.SlideInBottom,curve:oe.EaseInOut,delay:.02*(r+1)}),[]),R=useRef(null),h=(y,b)=>{r==-1?t.emit(`ALL_ROWS_${y?"CHECKED":"UNCHECKED"}`,y):(P&&P(o,y),t.emit(`ROW_${y?"CHECKED":"UNCHECKED"}`,y,b));},v=(y,b,E)=>jsx(go,{idx:y,id:b,as:"--selector",pubsub:t,value:jsx(Ot,{value:E,ref:R,onSwitch:h,type:Fe.Default})});return useEffect(()=>{let y=(L,A)=>{R.current?.setChecked(L,false);},b=(L,A)=>{let M=false;i?.current&&i.current.querySelectorAll(".--row").forEach(O=>{let F=O;if(!F.classList.contains("--row-head")){let Z=F.querySelector(".--selector input[type=checkbox]");Z&&Z.checked&&!M&&(M=Z.checked);}}),R.current.setChecked(M,false);},E=L=>{R.current?.setChecked(L,false),P&&P(o,L);},$=L=>{R.current?.setChecked(L,false),P&&P(o,L);};return r==-1?(t.on("ROW_CHECKED",y),t.on("ROW_UNCHECKED",b),()=>{t.off("ROW_CHECKED",y),t.off("ROW_UNCHECKED",b);}):(t.on("ALL_ROWS_CHECKED",E),t.on("ALL_ROWS_UNCHECKED",$),()=>{t.off("ALL_ROWS_CHECKED",E),t.off("ALL_ROWS_UNCHECKED",$);})},[]),jsxs(p,{onContextMenu:y=>x?x(y,o):null,onClick:y=>g?g(y,e.data):()=>{},...l?{fx:{...S,when:T}}:{},as:`--row flex aic ${g?"--row-clickable":""} ${r==-1?"--row-head":""} ${f||""}`,children:[r==-1&&n.map((y,b)=>{let{renderWhenHeader:E,render:$,value:L,...A}=y;return jsxs(Fragment,{children:[c&&b==0&&v(-1,`--selector-${y.id}`,"all"),jsx(go,{idx:-1,onSort:m,sortBy:u,value:L,...A,pubsub:t,style:a[y.id]})]},`--col-${y.id}`)}),d&&r>-1&&jsx(p,{as:"--col",children:jsx(K,{as:"opacity:0",children:"..."})}),!d&&r>-1&&s&&o&&n.map((y,b)=>jsxs(Fragment,{children:[c&&b==0&&v(b,`--selector-${y.id}`,y.id.toString()),s.includes(String(y.id))?jsx(go,{pubsub:t,idx:b,id:String(y.id),style:a[String(y.id)],value:y.render?y.render(o,r):o[String(y.id).includes(".")?String(y.id).split(".").reverse()[0]:y.id]}):null]},`--${String(y.id)}-val-${b}`))]})};Pa.displayName="Zuz.Row";var ho=Pa;var Ea=(e,r)=>{let{schema:t,rows:n,rowCount:o,rowsPerPage:s,currentPage:a,pagination:l,paginationHash:u,showPaginationOnZeroPageCount:c,animateRows:i,header:d,rowClassName:f,selectableRows:m,hoverable:g,sortBy:P,loading:x,loadingRowCount:T,loadingMessage:S,spinner:R,emptyMessage:h,onSort:v,onRowClick:y,onRowSelectToggle:b,onPageChange:E,onRowContextMenu:$,...L}=e,A=useRef(null),M=useMemo(()=>t.reduce((ce,q)=>(ce[q.id]={flex:q.weight||1,...q.w&&{width:q.w},...q.maxW&&{maxWidth:q.maxW},...q.minW&&{minWidth:q.minW},...q.h&&{height:q.h},...q.maxH&&{maxHeight:q.maxH},...q.minH&&{minHeight:q.minH}},ce),{}),[t]),O=useMemo(()=>Object.keys(M),[t]),F=useMemo(()=>d??true,[d]),{style:Z,className:I,rest:k}=B(L),X=useRef(null),Y=useMemo(()=>new PubSub,[]),H=useRef(n.map(()=>uuid(8))),[z,G]=useState(P||null),[W,ne]=useState(S||"loading"),J=useMemo(()=>!x&&n&&n.length==0,[x,n]),ae=useCallback(()=>h?typeof h=="function"?jsx(h,{}):h:jsx(K,{as:"tac s:18 mt:75",children:"No Record Found"}),[x,n]);useEffect(()=>{n.length&&!H.current&&(H.current=n.map(()=>uuid(8)));},[n]);let pe=(ce,q)=>{G(ce),v?.(ce,q);},ye=(o||(n?n.length:0))/(s||10),ie=useMemo(()=>c||ye>1?jsx(Lt,{hash:u,ref:A,renderOnZeroPageCount:c,onPageChange:E,paginationStyle:"table",startPage:a,itemCount:o||(n?n.length:0),itemsPerPage:s||10}):null,[a,o]);return useImperativeHandle(r,()=>({setLoading(ce){}})),jsxs(p,{as:`--table ${g??true?"--hoverable":""} flex cols rel ${I}`,ref:X,children:[F==true&&jsx(ho,{sortBy:z,onSort:pe,tableRef:X,pubsub:Y,selectable:m,index:-1,schema:t,loading:true,styles:M}),x&&jsxs(p,{as:"center-x flex aic --table-spinner",children:[jsx(Ce,{type:R||ve.Simple}),W&&jsx(K,{as:"--table-loading-message",children:W})]}),x&&Array(T||5).fill({}).map((ce,q)=>jsx(ho,{tableRef:X,index:q,pubsub:Y,schema:t,styles:M,loading:true,animate:i,onRowClick:y},`--trow-loading-${q}-${t[0].id}`)),!x&&n&&n.map((ce,q)=>jsx(ho,{tableRef:X,pubsub:Y,loading:false,index:q,schema:t,ids:O,styles:M,animate:i,data:ce,onRowClick:y,rowClassName:f,selectable:m,onSelect:b,onContextMenu:$},`--trow-${H.current[q]||q}-${t[0].id}`)),J&&ae(),l&&ie&&jsx(p,{"aria-hidden":!l||!ie,...i?{fx:{transition:Q.SlideInBottom,curve:oe.EaseInOut,delay:.02*(n.length+1),when:!x&&n&&l&&ie!=null}}:{},as:"--row flex aic --row-footer",children:ie})]})};Ea.displayName="Zuz.Table";var Hu=forwardRef(Ea),Au=Hu;var Fu=({ref:e,...r})=>{let{title:t,items:n}=r,[o,s]=useState(0),a=(l,u,c)=>{l.preventDefault(),s(u),document.getElementById(c)?.scrollIntoView({behavior:"smooth"});};return jsxs(p,{ref:e,as:"--table-of-contents rel flex cols",children:[jsx(K,{as:"--toc-title",children:t}),jsx(et,{items:n.map((l,u)=>jsx("a",{className:o==u?"--toc-active":"",style:{anchorName:o===u?"--toc-active":"none",color:o==u?"var(--table-of-contents-color-active)":"var(--table-of-contents-color)"},onClick:c=>a(c,u,l.tag),href:`#${l.tag}`,children:l.label}))})]})},zu=Fu;var Na=({isActive:e,transitionType:r,speed:t,width:n,render:o,content:s,onHeightChange:a})=>{let l=useRef(null),u=useResizeObserver(l);useEffect(()=>{e&&u.height>0&&a(u.height);},[e,u.height]);let i=useMemo(()=>{let d={width:n>0?`${n}px`:"100%",minWidth:n>0?`${n}px`:"100%",flexShrink:0,height:"fit-content",boxSizing:"border-box"};return r==="fade"?{...d,gridArea:"1 / 1 / 2 / 2",opacity:e?1:0,visibility:e?"visible":"hidden",transition:`opacity ${t}s ease-in-out`,zIndex:e?1:0}:r==="scale"?{...d,gridArea:"1 / 1 / 2 / 2",opacity:e?1:0,transform:`scale(${e?1:.95})`,transition:`all ${t}s cubic-bezier(0.34, 1.56, 0.64, 1)`,zIndex:e?1:0}:d},[e,r,n,t]);return jsx(p,{ref:l,style:{...i},className:"--content",children:o||e?s:null})};Na.displayName="Zuz.TabBody";var Ba=Na;var Ma=({ref:e,...r})=>{let{tabs:t,speed:n=.3,prerender:o=true,variant:s,tabStyle:a="fixed",onChange:l,transitionType:u="slide",...c}=r,[i,d]=useState(0),f=useRef(null),m=useResizeObserver(f),g=useMemo(()=>uuid(8),[]),[P,x]=useState("auto"),T=useMemo(()=>m.width>0,[m.width]);useImperativeHandle(e,()=>({setTab:b=>d(b)}));let S=useMemo(()=>t.map(b=>({...b,key:b.key||uuid(8)})),[t]),{style:R,className:h,rest:v}=B({as:`flex cols w-full no-overflow ${c.as||""}`,...c}),y=()=>{if(!T)return {opacity:0};switch(u){case "fade":case "scale":return {display:"grid",gridTemplateColumns:"1fr",width:"100%"};default:return {width:`${S.length*100}%`,alignItems:"flex-start",display:"flex",transform:`translate3d(-${i*m.width}px, 0, 0)`,transition:`transform ${n}s cubic-bezier(0.4, 0, 0.2, 1)`}}};return jsxs(p,{ref:f,style:R,className:`--tabview --${a} flex cols ${h}`,children:[jsx(Vt,{as:"--tabview-head",onSwitch:b=>{d(b.index);let E=S.find($=>$.tag==b.tag);E&&E.onSelect&&(E.onSelect(E,b.index),l?.(E,b.index));},selected:i,items:S.reduce((b,E,$)=>(b.push({icon:E.icon,index:$,label:E.label,tag:E.tag}),b),[])}),jsx(p,{className:"--tabview-body",as:"rel no-overflow w-full",style:{height:P,transition:T?`height ${n}s cubic-bezier(0.4, 0, 0.2, 1)`:"none",opacity:T?1:0},children:jsx(p,{className:"--track",style:{...y()},children:S.map((b,E)=>jsx(Ba,{isActive:E===i,transitionType:u,speed:n,width:m.width,render:o||E===i,onHeightChange:$=>E===i&&x($),content:b.body},`tab-body-${b.key||E}-${g}`))})})]})};Ma.displayName="Zuz.TabView";var ju=Ma;var tf=({ref:e,commands:r,onCommand:t,welcomeMessage:n="Welcome to Zuz Terminal v1.0.0",prompt:o="zuz ~ ",variant:s,...a})=>{let[l,u]=useState([{type:"output",content:n}]),[c,i]=useState(""),d=useRef(null),f=useRef(null),{variant:m}=j(true);useEffect(()=>{d.current&&(d.current.scrollTop=d.current.scrollHeight);},[l]);let g=h=>{let v=typeof h=="string"?{type:"output",content:h}:h;u(y=>{let b=[...y,v];return b.length>1e3?b.slice(-1e3):b});},P=()=>u([]);useImperativeHandle(e,()=>({write:g,clear:P}));let x=async h=>{let[v,...y]=h.split(" "),b=v.toLowerCase();return r&&r[b]?await r[b](y):t?await t(h):`command not found: ${v}`},T=h=>{let v=/\u001b\[(\d+)m/g,y=[],b={31:"#ff5f56",32:"#27c93f",33:"#ffbd2e",34:"#007aff",35:"#ff79c6",36:"#8be9fd",39:"#d4d4d4"},E=0,$="#d4d4d4",L=false,A;for(;(A=v.exec(h))!==null;){let O=h.slice(E,A.index);O&&y.push({text:O,color:$,bold:L});let F=A[1];F==="0"?($="#d4d4d4",L=false):F==="1"?L=true:b[F]&&($=b[F]),E=v.lastIndex;}let M=h.slice(E);return M&&y.push({text:M,color:$,bold:L}),y},S=(h,v)=>h.includes("\x1B")?T(h).map((y,b)=>jsx(me,{style:{color:y.color||"#d4d4d4",fontWeight:y.bold?"bold":"normal"},children:y.text},`--terminal-msg-${b}-${y.text.replace(/\S+/g,"-")}`)):jsx(me,{style:{color:v==="error"?"#ff5f56":v==="command"?"#00ff00":"#d4d4d4"},children:h}),R=async h=>{if(h.key==="Enter"&&c.trim()){let v=c.trim(),y=[...l,{type:"command",content:`${o}${v}`}];i(""),u(y);let b=await x(v);u(E=>[...E,{type:"output",content:b}]);}};return jsxs(p,{as:`--zuz-terminal --${s||m||U.Medium} flex cols ${a.className}`,onClick:()=>f.current?.focus(),children:[jsx(p,{ref:d,className:"--terminal-log",children:l.map((h,v)=>jsx(p,{children:jsx(K,{children:S(h.content,h.type)})},v))}),jsxs(p,{as:"flex aic --terminal-input",children:[jsx(K,{as:"--terminal-prompt",children:o}),jsx(fe,{ref:f,className:"--zuz-term-input",autoFocus:true,value:c,variant:s||m||U.Medium,onChange:h=>i(h.target.value),onKeyDown:R})]})]})},of=tf;var rf=({meta:e})=>jsxs(_,{as:"flex aic --command-item",children:[e.icon&&jsx(te,{name:e.icon,as:"--command-icon"}),jsx(K,{children:e.label})]}),nf=({position:e,onSelect:r,commands:t,visible:n})=>jsx(p,{"aria-hidden":!n,fx:{transition:Q.SlideInBottom,duration:.1,when:n},className:"--command-box abs grid",style:{...e},children:t.map(o=>jsx(rf,{meta:o},`cmd-${o.label.replace(/\s+/,"-")}`))}),Ha=nf;var Fa=({ref:e,...r})=>{let {autoResize:t,maxHeight:n,variant:o,resize:s="none",command:a,commands:l,name:u,onInput:c,cmd:i,renderDropdown:d,value:f,defaultValue:m,...g}=r,P=useRef(null),x=useRef(null),{variant:T}=j(true),{style:S,className:R,rest:h}=B(g),v=it();u?v.errors?.[u]:null;let b=u&&v.values&&v.setFieldValue,E=b?v.values?.[u]:void 0,$=useDebounce(k=>{b&&v.setFieldValue?.(u,k);},500),{showDropdown:L,dropdownPosition:A,handleKeyDown:M,handleInput:O,handleCommandSelect:F}=useCommandActions({command:a,commands:l,cmd:i,ref:P}),Z=useCallback(()=>{let k=P.current;!k||!t||(x.current&&cancelAnimationFrame(x.current),x.current=requestAnimationFrame(()=>{k.style.height="auto";let X=k.scrollHeight;if(n){let Y=parseInt(n.toString(),10);isNaN(Y)||(X=Math.min(X,Y));}k.style.height=`${X}px`,k.style.overflowY=n&&X>=parseInt(n.toString(),10)?"auto":"hidden";}));},[t,n]),I=k=>{$(k.currentTarget.value),c?.(k),O(k),Z();};return useEffect(()=>{P.current&&u&&E!==void 0&&P.current.value!==String(E)&&(P.current.value=String(E));},[E,u]),useEffect(()=>{Z();},[f,m,Z]),useEffect(()=>{t&&P.current&&Z();},[t,Z]),useEffect(()=>()=>{x.current&&cancelAnimationFrame(x.current);},[]),useEffect(()=>()=>{b&&v.deleteFieldValue?.(u);},[]),jsxs(p,{as:"rel",children:[jsx("textarea",{name:u,className:`--input --textarea --${o||T||U.Medium} flex ${R}`.trim(),style:{...S,resize:s,height:t?"auto":S?.height,overflow:"hidden",transition:t?"none":void 0},onKeyDown:M,onInput:I,ref:k=>{P.current=k,typeof e=="function"?e(k):e&&(e.current=k);},value:f,defaultValue:m,...h}),d?d({show:L,position:A,commands:l||[],onSelect:F}):l&&l.length>0&&jsx(Ha,{visible:L,commands:l,onSelect:F,position:A})]})};Fa.displayName="Zuz.TextArea";var mf=Fa;var _a=forwardRef((e,r)=>{let{as:t,value:n,color:o,direction:s,...a}=e,l=useRef(null),[u,c]=useState(n||0);return useImperativeHandle(r,()=>({updateValue(i){u.toString().length!==i.toString().length&&c(i);},setValue(i){if(this.updateValue(i),l.current){let d=i.toString().split("");l.current.querySelectorAll(".--wheel-char").forEach((f,m)=>{let g=d[m];if(f instanceof HTMLElement){f.setAttribute("data-value",g);let P=f.querySelector(".--wheel-char-track");P instanceof HTMLElement&&(P.style.setProperty("--v",g),P.offsetWidth);}});}}})),useEffect(()=>{c(n||0);},[n]),jsxs(p,{className:"--text-wheel flex aic rel","aria-hidden":true,as:t,ref:l,...a,children:[(u||0).toString().split("").map((i,d)=>isNaN(parseInt(i,10))?jsx(me,{className:"--wheel-char wheel-char-symbol grid",children:i},`wheel-char-symbol-${d}`):jsx(me,{"data-value":i,className:`--wheel-char grid ${d>(u||0).toString().length-3?"--wheel-fraction":""}`.trim(),children:jsxs(me,{className:`--wheel-char-track --wheel-track-${s||"down"} grid`,style:{"--v":i},children:[jsx(me,{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((f,m)=>jsx(me,{children:f},`${d}--${m}`)),jsx(me,{children:!s||s==="down"?9:0})]})},`wheel-char-${d}`)),o&&jsx(p,{className:"abs fillx",style:{zIndex:1,background:`linear-gradient(0deg, ${o}, transparent, transparent, transparent, ${o})`}})]})});_a.displayName="Zuz.TextWheel";var yf=_a;var Er=forwardRef((e,r)=>{let{as:t,meta:n,nodes:o,icons:s,onSelect:a,treeTag:l,selected:u,roots:c,expanded:i,...d}=e,{tag:f,label:m,icon:g,under:P,isHead:x}=n,T=useMemo(()=>c.includes(f),[c]),[S,R]=useState(i),h=()=>{localStorage.setItem(`--tn${l}-${f}`,S?"0":"1"),R(!S);};useEffect(()=>{i||T&&!localStorage.getItem(`--tn${l}-${f}`)?(localStorage.setItem(`--tn${l}-${f}`,"1"),R(true)):R(localStorage.getItem(`--tn${l}-${f}`)=="1");},[]);let v=useMemo(()=>o.filter(y=>y.under==f),[o,f]);return jsxs(p,{className:`--treenode ${T?"--is-root":""} --treenode-${f} flex cols`,children:[jsxs(p,{className:`--node --node-${f} flex aic ${u==f?" --selected":""}`,children:[jsx(_,{skeleton:d.skeleton,onClick:h,className:"--node-aro-btn",disabled:v.length==0,children:s?.arrowClose&&s?.arrowOpen?jsx(te,{skeleton:d.skeleton,className:"--node-aro-icon",name:v.length==0?s?.arrowDisabled||s?.arrowClose:S?s?.arrowOpen:s?.arrowClose}):v.length==0?V.chevronBottom:S?V.chevronBottom:V.chevronRight}),jsxs(_,{className:"--node-meta flex aic",onClick:y=>a(f),children:[(s?.nodeOpen&&s?.nodeClose||T&&s?.rootOpen&&s?.rootClose)&&jsx(te,{skeleton:d.skeleton,className:`--node-icon ${T?"--icon-root":""}`,name:g||(S?T&&s?.rootOpen||s.nodeOpen:T&&s?.rootClose||s?.nodeClose)}),jsx(K,{className:`--node-label ${T?"--node-label-root":""}`.trim(),skeleton:d.skeleton,children:m})]})]}),S&&v.length>0&&jsx(p,{className:`--sub-node tree-sub-node-${f} flex cols`,children:v.map(y=>jsx(Er,{treeTag:l,selected:u,onSelect:a,icons:s,roots:c,expanded:y.expanded||false,meta:y,nodes:o},`--node-${y.tag}`))})]})});Er.displayName="TreeItem";var Za=Er;var Ga=forwardRef((e,r)=>{let{as:t,nodes:n,onNodeSelect:o,tag:s,icons:a,roots:l,selected:u,...c}=e,[i,d]=useState(u);useImperativeHandle(r,()=>({getSelected:()=>i}),[o]);let f=m=>{d(m),o&&o(m);};return useEffect(()=>{i!=u&&d(u);},[u]),jsx(p,{className:"--treeview flex cols",children:n.filter(m=>l.includes(m.tag)).map(m=>jsx(Za,{treeTag:s?`-${s}`:"",selected:i,onSelect:g=>f(g),icons:a,meta:m,roots:l,expanded:m.expanded||false,skeleton:c.skeleton,nodes:n},`--node-${m.tag}`))})});Ga.displayName="Zuz.TreeView";var Tf=Ga;String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"").replace(/\s+/g," ")};
|
|
13
|
-
export{
|
|
12
|
+
</div>`}).join("")},[t,g]);return jsxs(f,{as:`--code-block rel ${d}`,style:u,...l,children:[jsx("pre",{ref:e,children:jsx("code",{className:`--code --lang-${o}`,dangerouslySetInnerHTML:{__html:T}})}),n&&jsx(Z,{as:"--copy-code abs",onClick:()=>{copyToClipboard(t),n.onCopy?.();},children:"Copy"})]})},Wm=Zm;var Is=({onSelect:e,meta:r,selected:t,disabled:n=false})=>{let o=useRef(null),{index:s,icon:a,label:i}=r,[m,l]=useState({x:0,width:0}),c=useDelayed();return useLayoutEffect(()=>{if(c&&o.current){let{width:d,x:u}=o.current.getBoundingClientRect();l({x:u,width:d}),t&&e(s,d,u,r,true);}},[c,o.current]),useEffect(()=>{t&&e(s,m.width,m.x,r,false);},[t]),jsxs(Z,{disabled:n,onClick:()=>e(s,m.width,m.x,r,false),ref:o,className:`--segment-item flex aic rel ${t?"--segment-active":""}`.trim(),children:[a?typeof a=="string"?jsx(te,{name:a,as:"--segment-icon"}):jsx(f,{as:"--segment-icon flex aic jcc",children:a}):null,i&&String(i).trim()!=""&&jsx(f,{className:"--segment-label",children:i||`Item ${s}`})]})};Is.displayName="SelectTabItem";var Es=Is;var Bs=forwardRef((e,r)=>{let{fx:t,items:n,selected:o,variant:s,disabled:a=false,onSwitch:i,...m}=e,[l,c]=useState(o||0),d=useDelayed(50),u=useRef(l),{className:p,style:g,rest:T}=B(m),x=useRef(null),P=useRef(null),{variant:S}=j(true),R=(h,v,y,b,E)=>{if((E||l!=h&&l!=-2)&&(c(h),u.current=l,queueMicrotask(()=>{d&&i?.(b);})),x.current){let $=P.current?.getBoundingClientRect();x.current.style.setProperty("--w",`${v}px`),x.current.style.setProperty("--x",`${$?y-$.left:y}px`);}};return useImperativeHandle(r,()=>({setSelected:h=>{typeof h=="number"&&h!=l&&c(h);}}),[l]),jsxs(f,{ref:P,"data-selected":l,className:`${p} --segmented --${s||S||U.Medium} flex aic rel`,style:g,...T,children:[jsx(f,{ref:x,className:`--segment-tab --${a?"disabled":"abled"} abs`}),n.map((h,v)=>jsx(Es,{disabled:a,onSelect:R,selected:l==v,meta:{...h,index:v}},`segment-${h.label}-${v}`))]})});Bs.displayName="Zuz.SelectTabs";var Ht=Bs;var Ms=forwardRef((e,r)=>{let{type:t,variant:n,...o}=e,s=useDelayed(),{colorScheme:a,setColorScheme:i}=Oo(),m=useCallback(()=>{i(a=="dark"?"light":a=="light"?"system":"dark");},[a]),{variant:l}=j(true),{className:c,style:d}=B(o),u=useMemo(()=>t=="system"?[{tag:"light",index:0,label:"",icon:V.colorSchemeLight},{tag:"system",index:1,label:"",icon:V.colorSchemeSystem},{tag:"dark",index:2,label:"",icon:V.colorSchemeDark}]:[{tag:"light",index:0,label:"",icon:V.colorSchemeLight},{tag:"dark",index:2,label:"",icon:V.colorSchemeDark}],[]),p=useMemo(()=>["light","system","dark"].indexOf(a),[a]);return !s||p==-1?null:t=="system"||t=="switch"?jsx(Ht,{className:`--color-scheme --${t}`,onSwitch:({tag:g})=>{i(g);},selected:p,items:u,...o}):jsx(Z,{onClick:m,style:d,variant:n,as:`--color-scheme-switch ${c}`.trim(),children:a=="system"?V.colorSchemeSystem:a=="light"?V.colorSchemeLight:V.colorSchemeDark})});Ms.displayName="Zuz.ColorScheme";var ip=Ms;var Vs=forwardRef((e,r)=>{let[t,n]=useState("wait"),{title:o,message:s,acceptLabel:a,rejectLabel:i,position:m}=e,l=async c=>{n(c==1?"accepted":"rejected"),localStorage.setItem("--ccnt",String(c));};return useEffect(()=>{let c=localStorage.getItem("--ccnt");n(c?c=="1"?"accepted":"rejected":"pending");},[]),jsxs(f,{fx:{from:{x:-1e3},to:{x:0},when:t=="pending",curve:oe.EaseInOut,duration:.5,delay:t=="accepted"?0:3},as:`--cookie-consent --${t} --${m||be.Left} flex cols`,children:[jsx(_,{as:"--title",children:o||"This site uses cookies"}),jsx(_,{as:"--message",children:s||"We and selected third parties use cookies (or similar technologies) for technical purposes, to enhance and analyze site usage, to support our marketing efforts"}),jsxs(f,{as:"--footer flex aic",children:[jsx(Z,{onClick:c=>l(1),as:"--accept",children:a||"Accept All"}),jsx(Z,{onClick:c=>l(0),as:"--reject",children:i||"Cancel"})]})]})});Vs.displayName="Zuz.CookiesConsent";var pp=Vs;var Ds=({ref:e,...r})=>{let {type:t,value:n=0,min:o=0,max:s=1,step:a=.01,onChange:i,showGhostBar:m,showKnobOnHover:l,showToolTip:c,roundValue:d,formatValue:u,...p}=r,{className:g,style:T,rest:x}=B(p),P=useRef(a||.01).current,S=useRef(o||0).current,R=useRef(s||1).current,h=useRef(n||0).current,v=useRef(null),y=useRef(null),b=useRef(null),E=useRef(null);useRef(null);let k=useRef(null),A=useRef(null),M=useRef(null),O=useRef(null),F=(se,ne,ge)=>(se-ne)/(ge-ne)*100,K=se=>{if(y.current){let ne=parseFloat(se.currentTarget.value);re(ne);let ge=F(ne,parseFloat(se.currentTarget.min),parseFloat(se.currentTarget.max));y.current.style.setProperty("--value",`${ge}`),y.current.setAttribute("data-value",`${ne}`),i&&i(d?+ne.toFixed(2):ne);}},[I,L]=useState(false),[X,Y]=useState(0),[H,z]=useState(0),[G,W]=useState(false),re=async se=>{let ne=u?u(+se):d?(+se).toFixed(2):Math.round(+se);M.current&&(M.current.textContent=String(ne));},le=se=>{if(I){let ne=se.clientX-X,ge=R-S,Te=ne/200*ge,he=Math.max(S,Math.min(H+Te,R));if(he=Math.round(he/P)*P,re(he),y.current){let Me=F(he,S,R);y.current.style.setProperty("--value",`${Me}`),y.current.setAttribute("data-value",`${he}`),A.current&&(A.current.textContent=d?he.toFixed(2):he.toString()),i&&i(he);}}},me=()=>{L(false),document.body.style.cursor="auto";},we=se=>(se-S)/(R-S)*100,ie=se=>{if(!y.current)return;let ne=y.current.getBoundingClientRect(),ge=se.clientX-ne.left,He=Math.max(0,Math.min(100,ge/ne.width*100));if(c&&M.current){let Te=v.current?+v.current.value:n;re(Te*100);}if(m){let Te=we(v.current?+v.current.value:n),he=Math.min(Te,He),Me=Math.abs(He-Te);y.current.style.setProperty("--ghost-start",`${he}`),y.current.style.setProperty("--ghost-width",`${Me}`);}};useEffect(()=>{y.current&&y.current.style.setProperty("--value",v.current?`${F(parseFloat(v.current.value),parseFloat(v.current.min),parseFloat(v.current.max))}`:h.toString());},[]),useEffect(()=>(I?(document.addEventListener("mousemove",le),document.addEventListener("mouseup",me)):(document.removeEventListener("mousemove",le),document.removeEventListener("mouseup",me)),()=>{document.removeEventListener("mousemove",le),document.removeEventListener("mouseup",me);}),[I]),useEffect(()=>{let se=F(n,S,R);y.current?.style.setProperty("--value",`${se}`),re(n);},[n,S,R,M.current]);let q=()=>jsxs(f,{ref:y,onMouseEnter:()=>W(true),onMouseLeave:()=>W(false),onMouseMove:ie,className:`--slider --${t||Io.Default} ${l?"--knob-hover":""} flex rel ${g}`.trim(),style:{...T},children:[jsx(f,{ref:k,className:"--slider-track abs fill"}),m&&jsx(f,{ref:E,className:"--slider-ghost abs fill"}),jsx(f,{className:"--slider-track-filled abs fill",style:{width:"calc(var(--value) * 1%)"}}),jsx(f,{ref:b,className:"--slider-knob --tooltip-knob abs"}),jsx(fe,{ref:v,onInput:K,className:"abs fill",tabIndex:0,type:t||Io.Default,defaultValue:h||0,step:P,max:R,min:S})]});if(c===true){let se=u?u(n):d?n.toFixed(2):n;return jsx(Pt,{ref:O,show:I,position:St.Top,margin:15,anchorName:"--tooltip-knob",title:jsx(ce,{ref:M,children:se}),children:q()})}return q()};Ds.displayName="Zuz.Slider";var pt=Ds;var As=forwardRef((e,r)=>{let{src:t,shape:n,size:o,...s}=e,{style:a,className:i,rest:m}=B(s),{canvasRef:l,crop:c,setScale:d,handleMouseDown:u,handleMouseUp:p,handleMouseMove:g}=useImageCropper(t,o||200,n||CropShape.Circle);return useImperativeHandle(r,()=>({getCropped(){return c()},setScale(T){d(T);}})),jsxs(f,{as:`--cropper --${n||CropShape.Circle} ${i}`,style:a,...m,children:[jsx("canvas",{ref:l,width:o||200,height:o||200,onMouseDown:u,onMouseUp:p,onMouseLeave:p,onMouseMove:g}),jsx(f,{as:"--cropper-slider",children:jsx(pt,{onChange:T=>d(T),min:0,max:1,step:.01,value:1})})]})});As.displayName="Zuz.Cropper";var hp=As;var xp=(t=>(t.Circle="circle",t.Square="square",t))(xp||{});var Fs=forwardRef((e,r)=>{let{items:t,maxItems:n}=e,o=useMemo(()=>{let i=typeof t=="string",m=i?[]:t;return i&&t.split(",").forEach(l=>{m.push({label:l});}),m},[t]),a=useMemo(()=>n&&n>0&&o.length>n-1,[o,n])?[...o.slice(0,2),{ID:".",label:"...",icon:"ellipsis",action:()=>{}},...o.slice(-n)]:o;return jsx(nt,{ref:r,className:"--crumb flex aic",direction:"rows",seperator:jsx(f,{as:"--crumb-chevron",children:V.chevronRightOutline}),items:a.map((i,m,l)=>i.ID=="."?jsx(f,{as:"flex aic gap:3",children:Array(3).fill(null).map(()=>jsx(f,{as:"w:4 h:4 bg:$text r:10"},`--crumb-placeholder-${m}`))}):jsxs(Z,{onClick:()=>i.action?.(),className:"--crumb-item",disabled:!l[m+1],children:[i.icon&&jsx(te,{as:"--crumb-icon",name:i.icon}),jsx(_,{as:"--crumb-label",children:i.label})]},`${i.label.replace(/\s+/g,"-").toLowerCase()}-${m}`))})});Fs.displayName="Zuz.Crumb";var vp=Fs;var Ks=forwardRef((e,r)=>{let{icon:t,defaultValue:n,value:o,size:s,variant:a,numeric:i,type:m,onConfirm:l,...c}=e,[d,u]=useState(false),[p,g]=useState(n||null),{style:T,className:x,rest:P}=B(c),S=useRef(null),R=useRef(null),{reposition:h}=kt(R,{direction:be.Bottom,offset:2}),v=b=>{i&&(b.currentTarget.value=b.currentTarget.value.replace(/[^0-9.]/g,"").replace(/(\..*?)\..*/g,"$1"));};useEffect(()=>{let b=E=>{let $=E.target,k=S.current?.contains($),A=R.current?.contains($);!k&&!A&&u(false);};return d&&document.addEventListener("mousedown",b),()=>{document.removeEventListener("mousedown",b);}},[d]),useEffect(()=>{let b=E=>{E.key==="Escape"&&d&&(u(false),S.current?.focus());};return document.addEventListener("keydown",b),()=>document.removeEventListener("keydown",b)},[d]);let y=()=>{u(true);};return useEffect(()=>{d&&h();},[d,h]),jsx(Fragment$1,{children:jsxs(f,{as:`--date-picker ${a?`--${a}`:""} rel flex aic ${x}`,"data-value":p?p.toISOString():"",children:[t?typeof t=="string"?jsx(te,{as:"mr:10 c:#666",name:t}):t:jsx(ce,{as:"--date-picker-icon flex aic jcc",children:V.calendar}),jsx("input",{ref:S,value:p?format(p,"EEE, MMM d YYY hh:mm a"):o||"",className:`--input ${a?`--${a}`:""} flex`.trim(),style:T,onFocus:y,onInput:v,autoComplete:"new-password",onKeyDown:b=>{b.key=="Enter"&&l?.(b.currentTarget.value);},...P}),jsx(f,{"aria-hidden":!d,ref:R,fx:{from:{y:5,opacity:0},to:{y:0,opacity:1},when:d,duration:.05},as:`--date-picker-chooser flex aic ${a?`--${a}`:""}`,children:jsx(ur,{defaultValue:p,onChange:b=>{g(b),u(false);}})})]})})});Ks.displayName="Zuz.DatePicker";var Tp=Ks;var Zs=forwardRef((e,r)=>{let{icon:t,variant:n,position:o}=e;return jsx(Z,{className:`--fab fixed --${n||U.Large} --${o||"bottomright"}`,children:t||V.plus})});Zs.displayName="Zuz.Fab";var Ep=Zs;var Bp=({ref:e,children:r,...t})=>{let{legend:n,legendPlacement:o,variant:s,...a}=t,{variant:i}=j(true),{className:m,style:l,rest:c}=B(a);return jsxs(f,{as:`--fieldset --rel --flex --${s||i||U.Medium} ${m}`.trim(),style:l,children:[jsx(f,{as:`--legend --abs --${o||"top-start"}`,children:n&&typeof n=="string"?jsx("legend",{children:n}):n}),r]})},kp=Bp;var Gs=e=>{let{names:r,strength:t}=e,n={[Zt.Gooey]:o=>jsxs("filter",{id:"gooey",children:[jsx("feGaussianBlur",{in:"SourceGraphic",stdDeviation:o||10,result:"blur"}),jsx("feColorMatrix",{in:"blur",mode:"matrix",values:"1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 18 -7",result:"goo"}),jsx("feBlend",{in:"SourceGraphic",in2:"goo"})]},`filter-${Zt.Gooey}`)};return useEffect(()=>{},[r]),jsx("svg",{xmlns:"http://www.w3.org/2000/svg",version:"1.1",children:jsx("defs",{children:(r||[Zt.Gooey]).map(o=>n[o](t))})})};Gs.displayName="Zuz.Filters";var Op=Gs;var Us=e=>{let {ref:r,cols:t,rows:n,gap:o,gapX:s,gapY:a,align:i,justify:m,inline:l,flow:c,autoCols:d,autoRows:u,template:p,...g}=e;useRef(null);let {className:x,style:P,rest:S}=B(g),R=v=>typeof v=="number"?`repeat(${v}, 1fr)`:v,h={display:l?"inline-grid":"grid",gridTemplateColumns:R(t),gridTemplateRows:R(n),gap:o,columnGap:s,rowGap:a,alignItems:i,justifyContent:m==="between"?"space-between":m==="around"?"space-around":m,gridAutoFlow:c,gridAutoColumns:d,gridAutoRows:u,gridTemplateAreas:p,...P};return jsx(f,{ref:r,as:`--grid ${x}`.trim(),style:h,...S})};Us.displayName="Zuz.Grid";var Hp=Us;var qs=e=>typeof e=="string"&&e.includes("+"),Xs={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"},Ys={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 Qs=forwardRef(({children:e,keys:r,as:t,className:n,variant:o},s)=>{let{variant:a}=j(true),i=useMemo(()=>{if(qs(r)){let m=null;return {keys:String(r).split("+").reduce((c,d,u,p)=>(p[u+1]?c.push(d):m=d.toUpperCase(),c),[]),children:m}}return {keys:r,children:String(e).toUpperCase()}},[r]);return jsxs(f,{as:`--keyboard-keys --${o||a||U.Small} flex aic ${t} ${n}`.trim(),children:[(Array.isArray(i.keys)?i.keys:[i.keys]).map(m=>jsx("abbr",{title:Ys[m],children:Xs[m]},m)),jsx(ce,{children:i?.children??e})]})});Qs.displayName="Zuz.KeyboardKeys";var Cr=Qs;var ta=createContext(null),dt=()=>{let e=useContext(ta);if(!e)throw new Error("MediaPlayer sub-components must be used within <MediaPlayer />");return e},Wp=({ref:e,icons:r,children:t,...n})=>{let{playlist:o=[],mode:s="audio",defaultArtist:a="Artist",defaultTitle:i="No Track",defaultCover:m,onTrackChange:l,...c}=n,{className:d,style:u,rest:p}=B(c),g=useMediaPlayer(o,o[0]??void 0),T=useMemo(()=>({play:V.play,pause:V.pause,prev:V.prev,next:V.next,volumeHigh:V.volumeHigh,volumeMute:V.volumeMute,...r}),[r]),x=useMemo(()=>({...g,mode:s,icons:T}),[g,T]);return jsx(ta.Provider,{value:x,children:jsx(f,{className:`--zuz-media-player ${d}`,style:u,children:t})})},oa=Wp;var ra=e=>{if(!e||isNaN(e))return "0:00";let r=Math.floor(e/60),t=Math.floor(e%60);return `${r}:${t.toString().padStart(2,"0")}`},fo=e=>typeof e=="string"?jsx(te,{name:e}):e,na=()=>{let{mediaRef:e,state:r,controls:t,mode:n}=dt();return jsxs(f,{as:`--mediaplayer-stage rel --mode-${n}`,children:[n==="video"?jsx("video",{ref:e,className:"fill",onClick:t.togglePlay}):jsx("audio",{ref:e}),r.isLoading&&jsx(f,{as:"abs fill aic jcc --mediaplayer-spinner",children:jsx(Re,{})})]})},sa=()=>{let{state:e,defaultArtist:r,defaultTitle:t,defaultCover:n}=dt();return jsxs(f,{as:"--track-info flex aic",children:[jsx(st,{src:e.currentItem?.cover||n||"",as:"--track-cover"}),jsxs(f,{as:"flex cols",children:[jsx(f,{as:"--track-title",children:e.currentItem?.title||t||"Choose Track"}),jsx(f,{as:"--track-artist",children:e.currentItem?.artist||r||"..."})]})]})},aa=()=>{let{state:e,controls:r,icons:t}=dt();return jsxs(f,{as:"--mediaplayer-controls flex aic",children:[jsx(Z,{onClick:r.prev,as:"--prev",children:fo(t?.prev??V.prev)}),jsx(Z,{onClick:r.togglePlay,as:"--play-pause",children:fo(e.isPlaying?t?.pause??V.pause:t?.play??V.play)}),jsx(Z,{onClick:r.next,as:"--next",children:fo(t?.next??V.next)})]})},ia=()=>{let{state:e,controls:r,mediaRef:t}=dt(),n=e.progress*(e.duration||0);return jsxs(f,{as:"--track-progress flex aic",children:[jsx(f,{as:"--track-current-duration",children:ra(n)}),jsx(pt,{value:e.progress,onClick:o=>{let s=o.currentTarget.getBoundingClientRect(),a=(o.clientX-s.left)/s.width;r.seek(a);}}),jsx(f,{as:"--track-total-duration",children:ra(e.duration)})]})},la=()=>{let{state:e,controls:r,icons:t}=dt();return jsxs(f,{as:"--volume-control flex aic gap:8 w:120",children:[jsx(Z,{onClick:()=>r.setIsMuted(),children:fo(e.isMuted?t?.volumeMute??V.volumeMute:t?.volumeHigh??V.volumeHigh)}),jsx(pt,{value:e.volume,className:"h:3 flex:1",onClick:n=>{let o=n.currentTarget.getBoundingClientRect();r.setVolume((n.clientX-o.left)/o.width);}})]})};var Gp=Object.assign(oa,{Stage:na,TrackInfo:sa,Controls:aa,Progress:ia,Volume:la}),Up=Gp;var ma=forwardRef((e,r)=>{let t=useNetworkStatus(),{onlineMessage:n,offlineMessage:o,variant:s}=e;return jsxs(f,{fx:{from:{x:"-50%",y:200,opacity:0},to:{x:"-50%",y:0,opacity:1},when:t==false,curve:oe.Spring,duration:.5,delay:2},className:`--network-manager --${t==true?"online":"offline"} --${s||U.Small} fixed flex`,children:[jsx(f,{className:"--ico",children:t?V[ke.Success]:V[ke.Error]}),jsx(_,{as:"--message",children:t?n||"internet connection restored :)":o||"no internet connection"})]})});ma.displayName="Zuz.NetWorkManager";var Yp=ma;var ua=forwardRef((e,r)=>{let{strenthMeter:t,onChange:n,...o}=e;"type"in o&&delete o.type;let{style:s,className:a,rest:i}=B(o),[m,l]=useState(false),[c,d]=useState(""),u=useMemo(()=>checkPasswordStrength(c),[c]),p=useDebounce(g=>{t&&d(g.target.value),n&&n(g);},100);return useEffect(()=>{},[]),jsxs(f,{as:"w:100% flex cols",children:[jsxs(f,{style:s,className:"--password flex aic rel",children:[jsx(fe,{ref:r,type:m?"text":"password",className:a,onChange:p,...i}),jsx(Z,{tabIndex:-1,onClick:()=>l(g=>!g),className:"--toggle flex aic jcc abs",children:m?V.eye:V.eyeSlash})]}),t&&jsxs(f,{as:`flex aic --password-meter --pb-score-${u.score}`,style:s,children:[jsxs(f,{as:"--password-bars flex aic",children:[jsx(f,{as:`--pbar ${u.score>=1?"--pb-on":""}`.trim()}),jsx(f,{as:`--pbar ${u.score>=2?"--pb-on":""}`.trim()}),jsx(f,{as:`--pbar ${u.score>=3?"--pb-on":""}`.trim()}),jsx(f,{as:`--pbar ${u.score>=4?"--pb-on":""}`.trim()}),jsx(f,{as:`--pbar ${u.score>=5?"--pb-on":""}`.trim()})]}),jsx(_,{as:"--password-meter-label","aria-hidden":true,children:u.result})]})]})});ua.displayName="Zuz.Password";var ru=ua;var da=forwardRef((e,r)=>{let{size:t,length:n,mask:o,...s}=e,a=useRef([]),i="pinput",m=false,l={};"with"in s&&(l={with:s.with},delete s.with),"type"in s&&delete s.type,"name"in s&&(i=s.name,delete s.name),"required"in s&&(m=true,delete s.required);let{style:c}=B(s),d=p=>{let g=p.currentTarget,T=a.current[parseInt(g.dataset.index)+1],x=a.current[parseInt(g.dataset.index)-1];g.value.length===1&&T?T.focus():g.value.length===0&&x&&x.focus();},{variant:u}=j(true);return useEffect(()=>{a.current=a.current.slice(0,t||n);},[t||n]),jsx(f,{name:i,style:c,className:`--otp --${s.variant??u??U.Medium} flex aic rel`,"data-required":m,"data-size":t||n||4,...l,children:Array(t||n||4).fill(1).map((p,g)=>jsx(fe,{autoComplete:"new-password","data-index":g,ref:T=>{a.current[g]=T;},numeric:true,onChange:d,maxLength:1,placeholder:o?"\xB7":"0",type:o?"password":"text",...s},`pin-${g}`))})});da.displayName="Zuz.PinInput";var iu=da;var ga=forwardRef((e,r)=>{let{children:t,className:n,name:o,required:s,type:a,value:i,variant:m,checked:l,onSwitch:c,...d}=e,[u,p]=useState(l||false),{variant:g}=j(true),T=useRef(null);return jsxs(Vt,{className:`${n} --${(a||Eo.Default).toLowerCase()} --radio${!a||a==Eo.Default?"":"card"} --${m||g||U.Small} flex aic rel`.trim(),...d,children:[jsx(fe,{ref:T,defaultChecked:u,value:i||"rd",type:"radio",className:"abs",name:o,required:s||false,onChange:x=>{c&&c(x.target.checked,i||"cb"),p(x.target.checked);}}),jsx(f,{className:"--dot rel",children:jsx(f,{className:"--rod abs abc"})}),jsx(f,{className:"--value",children:t})]})});ga.displayName="Zuz.Radio";var pu=ga;var ha=forwardRef((e,r)=>{let{fx:t,withStyle:n,as:o,reverse:s=false,searchIcon:a=V.search,hideSearchIcon:i=false,clearIcon:m=V.close,hideClearIcon:l=false,onChange:c,onClear:d,...u}=e,{style:p,className:g}=B({as:e.as}),[T,x]=useState(""),{variant:P}=j(true),S=useRef(null);"type"in e&&delete e.type;let R=v=>{x(v.target.value),c?.(v.target.value);},h=v=>{T.trim()!==""&&(x(""),c?.(""),S.current&&(S.current.value="",e.onConfirm?.("")));};return useImperativeHandle(r,()=>({focus:()=>S.current?.focus(),value:()=>S.current?.value})),useEffect(()=>{},[]),jsxs(f,{style:p,className:`--search --no-shrink ${s?"--search-rev":""} --${e.variant||P||U.Medium} flex aic ${typeof e.as=="string"&&e.as.includes("abs")?"":"rel"} ${g}`.trim(),children:[jsx(fe,{ref:S,onChange:R,...u}),e.shortcut&&jsx(Cr,{keys:e.shortcut,as:"abs"}),jsx(Z,{tabIndex:-1,onClick:v=>h(),className:"--send flex aic jcc",variant:e.variant||U.Medium,children:T!==""?!l&&(typeof m=="string"?jsx(te,{name:m,as:"--search-action"}):m):!i&&(typeof a=="string"?jsx(te,{name:a,as:"--search-action"}):a)})]})});ha.displayName="Zuz.Search";var Tr=ha;var bu=({label:e,icon:r})=>jsxs(f,{as:"--select-options-head --no-shrink --disabled".trim(),"aria-hidden":"true",children:[r&&jsx(te,{name:r}),jsx(_,{as:"--select-group-label",children:e})]}),xa=bu;var va=({checkIcon:e,selected:r,updateValue:t,o:n})=>{let o=e?typeof e=="string"?jsx(te,{name:"checkIcon"}):e:V.check,s=n.disabled===true;return jsxs(Z,{onClick:a=>{s||(a.stopPropagation(),t(n));},disabled:s,as:`--select-option-item --no-shrink ${r?"--selected":""} ${s?"--disabled":""} rel`.trim(),children:[jsxs(Ce,{as:"--option-item-meta --aic",children:[n.icon&&jsx(te,{name:n.icon,as:`--select-option-icon --icon-${n.value}`,color:n.iconColor}),jsx(_,{suppressHydrationWarning:true,children:typeof n=="string"?n:n.label})]}),r&&jsx(Ce,{aic:true,jcc:true,as:"--select-option-check --abs",children:o})]})};va.displayName="Option";var Sa=va;var Ca=(({ref:e,...r})=>{let{selected:t,options:n,label:o,name:s,variant:a,search:i,searchPlaceholder:m,maxHeight:l,arrowDownIcon:c=V.arrowDown,arrowUpIcon:d=V.arrowUp,expanded:u,multiple:p,tokenizer:g,wrapTokens:T,disabled:x,checkIcon:P,closeIcon:S,editable:R,editablePlaceholder:h,onChange:v,required:y,with:b,...E}=r,$=It(),k=!!(s&&$?.setFieldValue),A=Sn(s),M=vn(s),O=R===true&&p!==true&&g!==true,F=N=>typeof N=="string"||typeof N=="number",K=N=>typeof N=="object"&&N!==null&&!Array.isArray(N)&&"value"in N&&"label"in N,I=N=>n.find(ee=>String(ee.value)===String(N)),L=N=>{if(N==null)return null;if(O&&N==="")return "";if(p||g)return (Array.isArray(N)?N:[N]).map(de=>F(de)?I(de):de).filter(de=>K(de));if(F(N)){let ee=I(N);return ee||(O?String(N):null)}return K(N)?N:null},X=()=>{if(t!==void 0)return L(t);let N=n.find(ee=>String(ee.value)==="-1");return N||(O?"":null)},Y=N=>Array.isArray(N)?N.map(ee=>ee.value):K(N)?N.value:N,[H,z]=useState(()=>X()),[G,W]=useState(false),[re,J]=useState(null),le=useRef(null),me=useRef(null),we=useRef(null),ie=useId(),pe=useMemo(()=>s||ie,[s,ie]),{reposition:q}=kt(we,{direction:St.Bottom,offset:2}),{variant:se}=j(true),ne=S?typeof S=="string"?jsx(te,{name:S}):S:V.close,{className:ge,style:He,rest:Te}=B(E,void 0),{onClick:he,...Me}=Te||{},ae=useMemo(()=>M!==void 0?L(M):H,[M,H,n,O,p,g]),xe=useMemo(()=>{if(!(!ae||Array.isArray(ae)||!K(ae)))return ae},[ae]),zt=useMemo(()=>O?K(ae)?String(ae.value??""):F(ae)?String(ae):"":"",[O,ae]),_t=N=>Array.isArray(ae)?ae.some(ee=>ee.value===N.value):K(ae)?ae.value===N.value:O&&F(ae)?String(ae)===String(N.value):false,Ae=N=>{if(k&&$?.setFieldValue&&s){$.setFieldValue(s,Y(N));return}z(N);},Oe=N=>{v?.(R===true&&N instanceof Option?String(N.value):N);},Co=N=>{if(!(x||N.disabled)){if(p||g){let ee=Array.isArray(ae)?ae:[],Be=ee.find(To=>To.value===N.value)?ee.filter(To=>To.value!==N.value):[...ee,N];Ae(Be),Oe(Be);return}Ae(N),W(false),Oe(N);}},ja=N=>{let ee=N.target.value,de=ee===""?null:I(ee),Be=de?de.value:ee;Ae(Be),Oe(Be);},Qa=N=>{if(N.key==="Enter"&&(N.preventDefault(),O)){let ee=N.currentTarget.value.trim();if(!ee){W(false);return}let Be=I(ee)??ee;Ae(Be),Oe(Be),W(false);}},Ja=(N,ee)=>{if(N.stopPropagation(),x)return;let de=ae.filter(Be=>Be.value!==ee.value);Ae(de),W(false),Oe(de);},ei=N=>{let ee=N.currentTarget,de=ee.scrollTop===0&&N.deltaY<0,Be=ee.scrollHeight-ee.scrollTop===ee.clientHeight&&N.deltaY>0;!de&&!Be||N.preventDefault(),N.stopPropagation();};useImperativeHandle(e,()=>({setSelected:N=>{Ae(L(N));},getValue:()=>ae??null}),[ae,n,O,p,g,k,s]),useEffect(()=>{k||t===void 0||z(L(t));},[t,k,n,O,p,g]),useEffect(()=>{if(!G)return;let N=()=>{q();};return window.addEventListener("scroll",N,true),window.addEventListener("resize",q),()=>{window.removeEventListener("scroll",N,true),window.removeEventListener("resize",q);}},[G,q]),useEffect(()=>{if(!G){me.current&&(me.current.value=""),J(null);return}me.current?.focus(),q();let N=de=>{le.current&&!le.current.contains(de.target)&&W(false);},ee=setTimeout(()=>{document.addEventListener("click",N);},0);return ()=>{clearTimeout(ee),document.removeEventListener("click",N);}},[G,q]);let ti=useDebounce(N=>J(N===""?null:N),300),oi=useDebounce(ja,300);return jsxs(f,{ref:le,"data-required":y?"true":void 0,with:b,className:[`--select ${u==true?"--expanded":""}`,`--${a||se}`,`${s?`--${s}`:""}`,`${A?"--has-error":""}`,`${x?"--disabled":""} rel`].join(" ").trim(),name:pe,children:[O?jsxs(f,{"data-value":xe?.value??(zt||"-1"),className:`--select-display --selected --editable flex aic rel ${ge}`.trim(),style:He,onClick:N=>N.stopPropagation(),...Me,children:[xe?.icon&&jsx(te,{as:"--selected-icon",name:xe.icon}),jsx(Ce,{aic:true,as:"--label-wrapper",children:jsx(fe,{"aria-expanded":G,className:"--select-input",disabled:x,onChange:oi,onClick:N=>{N.stopPropagation(),x||W(true);},onKeyDown:Qa,placeholder:h||o||"Choose",type:"text",defaultValue:zt})}),jsx(Z,{className:"--select-toggle rel flex aic jcc",disabled:x,onClick:N=>{N.stopPropagation(),x||W(ee=>!ee);},tabIndex:-1,withLabel:false,children:G?typeof d=="string"?jsx(te,{name:d,as:"--search-action"}):d:typeof c=="string"?jsx(te,{name:c,as:"--search-action"}):c})]}):jsxs(Z,{disabled:x,variant:a||se,"data-value":xe?.value??"-1",className:`--select-display --selected flex aic rel ${ge}`.trim(),withLabel:false,style:He,onClick:N=>{N.stopPropagation(),x||W(ee=>!ee);},...Me,children:[xe?.icon&&jsx(te,{as:"--selected-icon",name:xe.icon}),jsx(Ce,{aic:true,as:"--label-wrapper",children:g&&Array.isArray(ae)&&ae.length>0?jsxs(Ce,{as:`--tokens-wrap${T===true?" --wrap":""}`,children:[ae.map(N=>jsxs(Ce,{aic:true,as:"--token",children:[jsx(_,{as:"--token-label",children:N.label}),jsx(f,{as:"--token-remove",onClick:ee=>Ja(ee,N),children:ne})]},N.value)),ae.length<n.length&&jsx(_,{as:"--label",children:o||"Choose"})]}):jsx(_,{as:"--label",children:Array.isArray(ae)?ae.length>0?`${ae.length} selected`:o||"Choose":xe?.label||o||"Choose"})}),jsx(f,{className:"--svg-arrow rel flex aic jcc",children:G?typeof d=="string"?jsx(te,{name:d,as:"--search-action"}):d:typeof c=="string"?jsx(te,{name:c,as:"--search-action"}):c})]}),jsxs(f,{id:pe,className:"--options-list --allow-scroll -fx flex cols abs zIndex:var(--max-z-index)","aria-hidden":!G,onWheel:ei,style:{maxHeight:l||"auto"},ref:we,fx:{from:{y:5,opacity:0},to:{y:0,opacity:1},when:G,duration:.05},children:[i&&jsx(f,{as:"--select-search --no-shrink flex --sticky",children:jsx(Tr,{ref:me,variant:U.Small,placeholder:m||"Search...",onChange:ti})}),o&&jsx(xa,{label:o}),n?.filter(N=>!re||N.label.toLowerCase().includes(re.toLowerCase()))?.map(N=>jsx(Sa,{updateValue:Co,checkIcon:P,selected:_t(N),o:N},`option-${N.label.replace(/\s+/g,"-")}-${N.value}`))]})]})});Ca.displayName="Zuz.Select";var Cu=Ca;var Ta=({ref:e,...r})=>jsx(Dt,{type:Ke.Switch,...r,ref:e});Ta.displayName="Zuz.Switch";var Tu=Ta;var Ra=e=>{let{idx:r,id:t,as:n,weight:o,style:s,value:a,render:i,resize:m,sortBy:l,sortable:c,onSort:d}=e,[u,p]=useState(0),g=()=>{c&&(d?.(String(t),u==1?-1:1),p(T=>T==1?-1:1));};return jsxs(f,{style:{flex:o||1,...s},as:`--col flex aic ${n||""} ${c?"--sortable":""}`,onClick:g,children:[jsx(f,{as:"--colv",children:a}),r==-1&&c&&l==t&&jsx(f,{as:"--arrow flex aib",children:u==1?V.arrowUp:V.arrowDown})]})};Ra.displayName="Zuz.Column";var bo=Ra;var Ea=e=>{let{index:r,pubsub:t,schema:n,data:o,ids:s,styles:a,animate:i,sortBy:m,selectable:l,tableRef:c,loading:d,rowClassName:u,onSort:p,onRowClick:g,onSelect:T,onContextMenu:x}=e,P=useDelayed(),S=useMemo(()=>({transition:Q.SlideInBottom,curve:oe.EaseInOut,delay:.02*(r+1)}),[]),R=useRef(null),h=(y,b)=>{r==-1?t.emit(`ALL_ROWS_${y?"CHECKED":"UNCHECKED"}`,y):(T&&T(o,y),t.emit(`ROW_${y?"CHECKED":"UNCHECKED"}`,y,b));},v=(y,b,E)=>jsx(bo,{idx:y,id:b,as:"--selector",pubsub:t,value:jsx(Dt,{value:E,ref:R,onSwitch:h,type:Ke.Default})});return useEffect(()=>{let y=(k,A)=>{R.current?.setChecked(k,false);},b=(k,A)=>{let M=false;c?.current&&c.current.querySelectorAll(".--row").forEach(O=>{let F=O;if(!F.classList.contains("--row-head")){let K=F.querySelector(".--selector input[type=checkbox]");K&&K.checked&&!M&&(M=K.checked);}}),R.current.setChecked(M,false);},E=k=>{R.current?.setChecked(k,false),T&&T(o,k);},$=k=>{R.current?.setChecked(k,false),T&&T(o,k);};return r==-1?(t.on("ROW_CHECKED",y),t.on("ROW_UNCHECKED",b),()=>{t.off("ROW_CHECKED",y),t.off("ROW_UNCHECKED",b);}):(t.on("ALL_ROWS_CHECKED",E),t.on("ALL_ROWS_UNCHECKED",$),()=>{t.off("ALL_ROWS_CHECKED",E),t.off("ALL_ROWS_UNCHECKED",$);})},[]),jsxs(f,{onContextMenu:y=>x?x(y,o):null,onClick:y=>g?g(y,e.data):()=>{},...i?{fx:{...S,when:P}}:{},as:`--row flex aic ${g?"--row-clickable":""} ${r==-1?"--row-head":""} ${u||""}`,children:[r==-1&&n.map((y,b)=>{let{renderWhenHeader:E,render:$,value:k,...A}=y;return jsxs(Fragment,{children:[l&&b==0&&v(-1,`--selector-${y.id}`,"all"),jsx(bo,{idx:-1,onSort:p,sortBy:m,value:k,...A,pubsub:t,style:a[y.id]})]},`--col-${y.id}`)}),d&&r>-1&&jsx(f,{as:"--col",children:jsx(_,{as:"opacity:0",children:"..."})}),!d&&r>-1&&s&&o&&n.map((y,b)=>jsxs(Fragment,{children:[l&&b==0&&v(b,`--selector-${y.id}`,y.id.toString()),s.includes(String(y.id))?jsx(bo,{pubsub:t,idx:b,id:String(y.id),style:a[String(y.id)],value:y.render?y.render(o,r):o[String(y.id).includes(".")?String(y.id).split(".").reverse()[0]:y.id]}):null]},`--${String(y.id)}-val-${b}`))]})};Ea.displayName="Zuz.Row";var vo=Ea;var La=(e,r)=>{let{schema:t,rows:n,rowCount:o,rowsPerPage:s,currentPage:a,pagination:i,paginationHash:m,showPaginationOnZeroPageCount:l,animateRows:c,header:d,rowClassName:u,selectableRows:p,hoverable:g,sortBy:T,loading:x,loadingRowCount:P,loadingMessage:S,spinner:R,emptyMessage:h,onSort:v,onRowClick:y,onRowSelectToggle:b,onPageChange:E,onRowContextMenu:$,...k}=e,A=useRef(null),M=useMemo(()=>t.reduce((pe,q)=>(pe[q.id]={flex:q.weight||1,...q.w&&{width:q.w},...q.maxW&&{maxWidth:q.maxW},...q.minW&&{minWidth:q.minW},...q.h&&{height:q.h},...q.maxH&&{maxHeight:q.maxH},...q.minH&&{minHeight:q.minH}},pe),{}),[t]),O=useMemo(()=>Object.keys(M),[t]),F=useMemo(()=>d??true,[d]),{style:K,className:I,rest:L}=B(k),X=useRef(null),Y=useMemo(()=>new PubSub,[]),H=useRef(n.map(()=>uuid(8))),[z,G]=useState(T||null),[W,re]=useState(S||"loading"),J=useMemo(()=>!x&&n&&n.length==0,[x,n]),le=useCallback(()=>h?typeof h=="function"?jsx(h,{}):h:jsx(_,{as:"tac s:18 mt:75",children:"No Record Found"}),[x,n]);useEffect(()=>{n.length&&!H.current&&(H.current=n.map(()=>uuid(8)));},[n]);let me=(pe,q)=>{G(pe),v?.(pe,q);},we=(o||(n?n.length:0))/(s||10),ie=useMemo(()=>l||we>1?jsx(Ot,{hash:m,ref:A,renderOnZeroPageCount:l,onPageChange:E,paginationStyle:"table",startPage:a,itemCount:o||(n?n.length:0),itemsPerPage:s||10}):null,[a,o]);return useImperativeHandle(r,()=>({setLoading(pe){}})),jsxs(f,{as:`--table ${g??true?"--hoverable":""} flex cols rel ${I}`,ref:X,children:[F==true&&jsx(vo,{sortBy:z,onSort:me,tableRef:X,pubsub:Y,selectable:p,index:-1,schema:t,loading:true,styles:M}),x&&jsxs(f,{as:"center-x flex aic --table-spinner",children:[jsx(Re,{type:R||Se.Simple}),W&&jsx(_,{as:"--table-loading-message",children:W})]}),x&&Array(P||5).fill({}).map((pe,q)=>jsx(vo,{tableRef:X,index:q,pubsub:Y,schema:t,styles:M,loading:true,animate:c,onRowClick:y},`--trow-loading-${q}-${t[0].id}`)),!x&&n&&n.map((pe,q)=>jsx(vo,{tableRef:X,pubsub:Y,loading:false,index:q,schema:t,ids:O,styles:M,animate:c,data:pe,onRowClick:y,rowClassName:u,selectable:p,onSelect:b,onContextMenu:$},`--trow-${H.current[q]||q}-${t[0].id}`)),J&&le(),i&&ie&&jsx(f,{"aria-hidden":!i||!ie,...c?{fx:{transition:Q.SlideInBottom,curve:oe.EaseInOut,delay:.02*(n.length+1),when:!x&&n&&i&&ie!=null}}:{},as:"--row flex aic --row-footer",children:ie})]})};La.displayName="Zuz.Table";var Hu=forwardRef(La),Au=Hu;var Fu=({ref:e,...r})=>{let{title:t,items:n}=r,[o,s]=useState(0),a=(i,m,l)=>{i.preventDefault(),s(m),document.getElementById(l)?.scrollIntoView({behavior:"smooth"});};return jsxs(f,{ref:e,as:"--table-of-contents rel flex cols",children:[jsx(_,{as:"--toc-title",children:t}),jsx(nt,{items:n.map((i,m)=>jsx("a",{className:o==m?"--toc-active":"",style:{anchorName:o===m?"--toc-active":"none",color:o==m?"var(--table-of-contents-color-active)":"var(--table-of-contents-color)"},onClick:l=>a(l,m,i.tag),href:`#${i.tag}`,children:i.label}))})]})},zu=Fu;var Ma=({isActive:e,transitionType:r,speed:t,width:n,render:o,content:s,onHeightChange:a})=>{let i=useRef(null),m=useResizeObserver(i);useEffect(()=>{e&&m.height>0&&a(m.height);},[e,m.height]);let c=useMemo(()=>{let d={width:n>0?`${n}px`:"100%",minWidth:n>0?`${n}px`:"100%",flexShrink:0,height:"fit-content",boxSizing:"border-box"};return r==="fade"?{...d,gridArea:"1 / 1 / 2 / 2",opacity:e?1:0,visibility:e?"visible":"hidden",transition:`opacity ${t}s ease-in-out`,zIndex:e?1:0}:r==="scale"?{...d,gridArea:"1 / 1 / 2 / 2",opacity:e?1:0,transform:`scale(${e?1:.95})`,transition:`all ${t}s cubic-bezier(0.34, 1.56, 0.64, 1)`,zIndex:e?1:0}:d},[e,r,n,t]);return jsx(f,{ref:i,style:{...c},className:"--content",children:o||e?s:null})};Ma.displayName="Zuz.TabBody";var Oa=Ma;var Ha=({ref:e,...r})=>{let{tabs:t,speed:n=.3,prerender:o=true,variant:s,tabStyle:a="fixed",onChange:i,transitionType:m="slide",...l}=r,[c,d]=useState(0),u=useRef(null),p=useResizeObserver(u),g=useMemo(()=>uuid(8),[]),[T,x]=useState("auto"),P=useMemo(()=>p.width>0,[p.width]);useImperativeHandle(e,()=>({setTab:b=>d(b)}));let S=useMemo(()=>t.map(b=>({...b,key:b.key||uuid(8)})),[t]),{style:R,className:h,rest:v}=B({as:`flex cols w-full no-overflow ${l.as||""}`,...l}),y=()=>{if(!P)return {opacity:0};switch(m){case "fade":case "scale":return {display:"grid",gridTemplateColumns:"1fr",width:"100%"};default:return {width:`${S.length*100}%`,alignItems:"flex-start",display:"flex",transform:`translate3d(-${c*p.width}px, 0, 0)`,transition:`transform ${n}s cubic-bezier(0.4, 0, 0.2, 1)`}}};return jsxs(f,{ref:u,style:R,className:`--tabview --${a} flex cols ${h}`,children:[jsx(Ht,{as:"--tabview-head",onSwitch:b=>{d(b.index);let E=S.find($=>$.tag==b.tag);E&&E.onSelect&&(E.onSelect(E,b.index),i?.(E,b.index));},selected:c,items:S.reduce((b,E,$)=>(b.push({icon:E.icon,index:$,label:E.label,tag:E.tag}),b),[])}),jsx(f,{className:"--tabview-body",as:"rel no-overflow w-full",style:{height:T,transition:P?`height ${n}s cubic-bezier(0.4, 0, 0.2, 1)`:"none",opacity:P?1:0},children:jsx(f,{className:"--track",style:{...y()},children:S.map((b,E)=>jsx(Oa,{isActive:E===c,transitionType:m,speed:n,width:p.width,render:o||E===c,onHeightChange:$=>E===c&&x($),content:b.body},`tab-body-${b.key||E}-${g}`))})})]})};Ha.displayName="Zuz.TabView";var ju=Ha;var tf=({ref:e,commands:r,onCommand:t,welcomeMessage:n="Welcome to Zuz Terminal v1.0.0",prompt:o="zuz ~ ",variant:s,...a})=>{let[i,m]=useState([{type:"output",content:n}]),[l,c]=useState(""),d=useRef(null),u=useRef(null),{variant:p}=j(true);useEffect(()=>{d.current&&(d.current.scrollTop=d.current.scrollHeight);},[i]);let g=h=>{let v=typeof h=="string"?{type:"output",content:h}:h;m(y=>{let b=[...y,v];return b.length>1e3?b.slice(-1e3):b});},T=()=>m([]);useImperativeHandle(e,()=>({write:g,clear:T}));let x=async h=>{let[v,...y]=h.split(" "),b=v.toLowerCase();return r&&r[b]?await r[b](y):t?await t(h):`command not found: ${v}`},P=h=>{let v=/\u001b\[(\d+)m/g,y=[],b={31:"#ff5f56",32:"#27c93f",33:"#ffbd2e",34:"#007aff",35:"#ff79c6",36:"#8be9fd",39:"#d4d4d4"},E=0,$="#d4d4d4",k=false,A;for(;(A=v.exec(h))!==null;){let O=h.slice(E,A.index);O&&y.push({text:O,color:$,bold:k});let F=A[1];F==="0"?($="#d4d4d4",k=false):F==="1"?k=true:b[F]&&($=b[F]),E=v.lastIndex;}let M=h.slice(E);return M&&y.push({text:M,color:$,bold:k}),y},S=(h,v)=>h.includes("\x1B")?P(h).map((y,b)=>jsx(ce,{style:{color:y.color||"#d4d4d4",fontWeight:y.bold?"bold":"normal"},children:y.text},`--terminal-msg-${b}-${y.text.replace(/\S+/g,"-")}`)):jsx(ce,{style:{color:v==="error"?"#ff5f56":v==="command"?"#00ff00":"#d4d4d4"},children:h}),R=async h=>{if(h.key==="Enter"&&l.trim()){let v=l.trim(),y=[...i,{type:"command",content:`${o}${v}`}];c(""),m(y);let b=await x(v);m(E=>[...E,{type:"output",content:b}]);}};return jsxs(f,{as:`--zuz-terminal --${s||p||U.Medium} flex cols ${a.className}`,onClick:()=>u.current?.focus(),children:[jsx(f,{ref:d,className:"--terminal-log",children:i.map((h,v)=>jsx(f,{children:jsx(_,{children:S(h.content,h.type)})},v))}),jsxs(f,{as:"flex aic --terminal-input",children:[jsx(_,{as:"--terminal-prompt",children:o}),jsx(fe,{ref:u,className:"--zuz-term-input",autoFocus:true,value:l,variant:s||p||U.Medium,onChange:h=>c(h.target.value),onKeyDown:R})]})]})},of=tf;var rf=({meta:e})=>jsxs(Z,{as:"flex aic --command-item",children:[e.icon&&jsx(te,{name:e.icon,as:"--command-icon"}),jsx(_,{children:e.label})]}),nf=({position:e,onSelect:r,commands:t,visible:n})=>jsx(f,{"aria-hidden":!n,fx:{transition:Q.SlideInBottom,duration:.1,when:n},className:"--command-box abs grid",style:{...e},children:t.map(o=>jsx(rf,{meta:o},`cmd-${o.label.replace(/\s+/,"-")}`))}),za=nf;var Za=({ref:e,...r})=>{let {autoResize:t,maxHeight:n,variant:o,resize:s="none",command:a,commands:i,name:m,onInput:l,cmd:c,renderDropdown:d,value:u,defaultValue:p,...g}=r,T=useRef(null),x=useRef(null),{variant:P}=j(true),{style:S,className:R,rest:h}=B(g),v=lt();m?v.errors?.[m]:null;let b=m&&v.values&&v.setFieldValue,E=b?v.values?.[m]:void 0,$=useDebounce(L=>{b&&v.setFieldValue?.(m,L);},500),{showDropdown:k,dropdownPosition:A,handleKeyDown:M,handleInput:O,handleCommandSelect:F}=useCommandActions({command:a,commands:i,cmd:c,ref:T}),K=useCallback(()=>{let L=T.current;!L||!t||(x.current&&cancelAnimationFrame(x.current),x.current=requestAnimationFrame(()=>{L.style.height="auto";let X=L.scrollHeight;if(n){let Y=parseInt(n.toString(),10);isNaN(Y)||(X=Math.min(X,Y));}L.style.height=`${X}px`,L.style.overflowY=n&&X>=parseInt(n.toString(),10)?"auto":"hidden";}));},[t,n]),I=L=>{$(L.currentTarget.value),l?.(L),O(L),K();};return useEffect(()=>{T.current&&m&&E!==void 0&&T.current.value!==String(E)&&(T.current.value=String(E));},[E,m]),useEffect(()=>{K();},[u,p,K]),useEffect(()=>{t&&T.current&&K();},[t,K]),useEffect(()=>()=>{x.current&&cancelAnimationFrame(x.current);},[]),useEffect(()=>()=>{b&&v.deleteFieldValue?.(m);},[]),jsxs(f,{as:"rel",children:[jsx("textarea",{name:m,className:`--input --textarea --${o||P||U.Medium} flex ${R}`.trim(),style:{...S,resize:s,height:t?"auto":S?.height,overflow:"hidden",transition:t?"none":void 0},onKeyDown:M,onInput:I,ref:L=>{T.current=L,typeof e=="function"?e(L):e&&(e.current=L);},value:u,defaultValue:p,...h}),d?d({show:k,position:A,commands:i||[],onSelect:F}):i&&i.length>0&&jsx(za,{visible:k,commands:i,onSelect:F,position:A})]})};Za.displayName="Zuz.TextArea";var mf=Za;var Ga=forwardRef((e,r)=>{let{as:t,value:n,color:o,direction:s,...a}=e,i=useRef(null),[m,l]=useState(n||0);return useImperativeHandle(r,()=>({updateValue(c){m.toString().length!==c.toString().length&&l(c);},setValue(c){if(this.updateValue(c),i.current){let d=c.toString().split("");i.current.querySelectorAll(".--wheel-char").forEach((u,p)=>{let g=d[p];if(u instanceof HTMLElement){u.setAttribute("data-value",g);let T=u.querySelector(".--wheel-char-track");T instanceof HTMLElement&&(T.style.setProperty("--v",g),T.offsetWidth);}});}}})),useEffect(()=>{l(n||0);},[n]),jsxs(f,{className:"--text-wheel flex aic rel","aria-hidden":true,as:t,ref:i,...a,children:[(m||0).toString().split("").map((c,d)=>isNaN(parseInt(c,10))?jsx(ce,{className:"--wheel-char wheel-char-symbol grid",children:c},`wheel-char-symbol-${d}`):jsx(ce,{"data-value":c,className:`--wheel-char grid ${d>(m||0).toString().length-3?"--wheel-fraction":""}`.trim(),children:jsxs(ce,{className:`--wheel-char-track --wheel-track-${s||"down"} grid`,style:{"--v":c},children:[jsx(ce,{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((u,p)=>jsx(ce,{children:u},`${d}--${p}`)),jsx(ce,{children:!s||s==="down"?9:0})]})},`wheel-char-${d}`)),o&&jsx(f,{className:"abs fillx",style:{zIndex:1,background:`linear-gradient(0deg, ${o}, transparent, transparent, transparent, ${o})`}})]})});Ga.displayName="Zuz.TextWheel";var yf=Ga;var Mr=forwardRef((e,r)=>{let{as:t,meta:n,nodes:o,icons:s,onSelect:a,treeTag:i,selected:m,roots:l,expanded:c,...d}=e,{tag:u,label:p,icon:g,under:T,isHead:x}=n,P=useMemo(()=>l.includes(u),[l]),[S,R]=useState(c),h=()=>{localStorage.setItem(`--tn${i}-${u}`,S?"0":"1"),R(!S);};useEffect(()=>{c||P&&!localStorage.getItem(`--tn${i}-${u}`)?(localStorage.setItem(`--tn${i}-${u}`,"1"),R(true)):R(localStorage.getItem(`--tn${i}-${u}`)=="1");},[]);let v=useMemo(()=>o.filter(y=>y.under==u),[o,u]);return jsxs(f,{className:`--treenode ${P?"--is-root":""} --treenode-${u} flex cols`,children:[jsxs(f,{className:`--node --node-${u} flex aic ${m==u?" --selected":""}`,children:[jsx(Z,{skeleton:d.skeleton,onClick:h,className:"--node-aro-btn",disabled:v.length==0,children:s?.arrowClose&&s?.arrowOpen?jsx(te,{skeleton:d.skeleton,className:"--node-aro-icon",name:v.length==0?s?.arrowDisabled||s?.arrowClose:S?s?.arrowOpen:s?.arrowClose}):v.length==0?V.chevronBottom:S?V.chevronBottom:V.chevronRight}),jsxs(Z,{className:"--node-meta flex aic",onClick:y=>a(u),children:[(s?.nodeOpen&&s?.nodeClose||P&&s?.rootOpen&&s?.rootClose)&&jsx(te,{skeleton:d.skeleton,className:`--node-icon ${P?"--icon-root":""}`,name:g||(S?P&&s?.rootOpen||s.nodeOpen:P&&s?.rootClose||s?.nodeClose)}),jsx(_,{className:`--node-label ${P?"--node-label-root":""}`.trim(),skeleton:d.skeleton,children:p})]})]}),S&&v.length>0&&jsx(f,{className:`--sub-node tree-sub-node-${u} flex cols`,children:v.map(y=>jsx(Mr,{treeTag:i,selected:m,onSelect:a,icons:s,roots:l,expanded:y.expanded||false,meta:y,nodes:o},`--node-${y.tag}`))})]})});Mr.displayName="TreeItem";var qa=Mr;var Ya=forwardRef((e,r)=>{let{as:t,nodes:n,onNodeSelect:o,tag:s,icons:a,roots:i,selected:m,...l}=e,[c,d]=useState(m);useImperativeHandle(r,()=>({getSelected:()=>c}),[o]);let u=p=>{d(p),o&&o(p);};return useEffect(()=>{c!=m&&d(m);},[m]),jsx(f,{className:"--treeview flex cols",children:n.filter(p=>i.includes(p.tag)).map(p=>jsx(qa,{treeTag:s?`-${s}`:"",selected:c,onSelect:g=>u(g),icons:a,meta:p,roots:i,expanded:p.expanded||false,skeleton:l.skeleton,nodes:n},`--node-${p.tag}`))})});Ya.displayName="Zuz.TreeView";var Pf=Ya;String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"").replace(/\s+/g," ")};
|
|
13
|
+
export{ke as ALERT,Ar as AVATAR,fc as Accordion,bc as ActionBar,wc as Alert,_c as AutoComplete,Yc as Avatar,Qc as Badge,f as Box,Mm as Bubble,Ss as BubbleMediaType,vs as BubbleStatus,Z as Button,hs as CHART,Ke as CHECKBOX,Nf as COLORTHEME,ur as Calendar,Cm as Carousel,Bm as Chart,Dt as CheckBox,Wm as CodeBlock,ip as ColorScheme,Ho as ContextMenu,pp as CookiesConsent,$e as Cover,xp as CropShape,hp as Cropper,vp as Crumb,Mf as DATATYPE,Je as DIALOG,$r as DIALOG_ACTION_POSITION,Pe as DRAWER_SIDE,Tp as DatePicker,Jo as Dialog,rr as Drawer,Zt as FILTER,Qe as FORMVALIDATION,Of as FORMVALIDATION_STYLE,Ep as Fab,kp as Fieldset,Op as Filters,Ce as Flex,Xo as Form,Hp as Grid,Ao as Group,te as Icon,st as Image,fe as Input,Cr as KeyboardKeys,Ys as KeysLabelMap,Xs as KeysMap,Vt as Label,Vo as LayersProvider,nt as List,Up as MediaPlayer,Yp as NetworkStatus,wt as ORIGIN,Bf as OriginType,et as Overlay,kf as PLACEMENTS,St as POSITION,Df as PROGRESS,Ot as Pagination,co as PaginationStyle,ru as Password,iu as PinInput,be as Position,ot as ProgressBar,Eo as RADIO,pu as Radio,Le as SHEET,Ro as SHEET_ACTION_POSITION,Ef as SKELETON,Io as SLIDER,Lf as SORT,Se as SPINNER,er as ScrollView,Tr as Search,Cu as Select,Ht as SelectTabs,el as Sheet,pt as Slider,Qt as SnackPosition,un as SnackStyle,jt as SnackType,ce as Span,Re as Spinner,Vf as Status,Tu as Switch,Q as TRANSITIONS,oe as TRANSITION_CURVES,ju as TabView,Au as Table,zu as TableOfContents,of as Terminal,_ as Text,yf as TextWheel,mf as Textarea,pi as ThemeProvider,fn as ToastDefaultTitle,Qt as ToastPosition,sr as ToastProvider,un as ToastStyle,jt as ToastType,Pt as ToolTip,Pf as TreeView,U as Variant,Ct as animationTransition,No as buildClassString,_r as buildWithStyles,td as css,Bo as getAnimationCurve,od as getAnimationTransition,ni as getZuzMap,qs as isKeyCombination,zr as setZuzMap,B as useBase,Wl as useContextMenu,ql as useDialog,jl as useDrawer,ve as useFx,ec as useMorph,kt as usePosition,ic as useSnack,$o as useToast};
|