@npm-questionpro/wick-ui-lib 1.35.2 → 1.35.3
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/style.css +1 -1
- package/dist/wick-ui-lib/es/index.js +285 -285
- package/dist/wick-ui-lib/umd/index.js +2 -2
- package/package.json +1 -1
|
@@ -12,10 +12,10 @@
|
|
|
12
12
|
${C}px !important;
|
|
13
13
|
${S}px !important;
|
|
14
14
|
}
|
|
15
|
-
`),()=>{var A;(A=u.current)==null||A.removeAttribute("data-motion-pop-id"),D.contains(T)&&D.removeChild(T)}},[t]),a.jsx(Lm,{isPresent:t,childRef:u,sizeRef:l,pop:o,children:o===!1?e:x.cloneElement(e,{ref:w})})}const Bm=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:s,presenceAffectsLayout:o,mode:i,anchorX:u,anchorY:l,root:d})=>{const c=hs(qm),w=h.useId();let p=!0,f=h.useMemo(()=>(p=!1,{id:w,initial:t,isPresent:n,custom:s,onExitComplete:g=>{c.set(g,!0);for(const b of c.values())if(!b)return;r&&r()},register:g=>(c.set(g,!1),()=>c.delete(g))}),[n,c,r]);return o&&p&&(f={...f}),h.useMemo(()=>{c.forEach((g,b)=>c.set(b,!1))},[n]),x.useEffect(()=>{!n&&!c.size&&r&&r()},[n]),e=a.jsx(Wm,{pop:i==="popLayout",isPresent:n,anchorX:u,anchorY:l,root:d,children:e}),a.jsx(Gn.Provider,{value:f,children:e})};function qm(){return new Map}function $m(e=!0){const t=h.useContext(Gn);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:s}=t,o=h.useId();h.useEffect(()=>{if(e)return s(o)},[e]);const i=h.useCallback(()=>e&&r&&r(o),[o,r,e]);return!n&&r?[!1,i]:[!0]}const lr=e=>e.key||"";function Gu(e){const t=[];return h.Children.forEach(e,n=>{h.isValidElement(n)&&t.push(n)}),t}const Ku=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:s=!0,mode:o="sync",propagate:i=!1,anchorX:u="left",anchorY:l="top",root:d})=>{const[c,w]=$m(i),p=h.useMemo(()=>Gu(e),[e]),f=i&&!c?[]:p.map(lr),g=h.useRef(!0),b=h.useRef(p),v=hs(()=>new Map),N=h.useRef(new Set),[y,C]=h.useState(p),[S,T]=h.useState(p);oi(()=>{g.current=!1,b.current=p;for(let k=0;k<S.length;k++){const M=lr(S[k]);f.includes(M)?(v.delete(M),N.current.delete(M)):v.get(M)!==!0&&v.set(M,!1)}},[S,f.length,f.join("-")]);const D=[];if(p!==y){let k=[...p];for(let M=0;M<S.length;M++){const _=S[M],P=lr(_);f.includes(P)||(k.splice(M,0,_),D.push(_))}return o==="wait"&&D.length&&(k=D),T(Gu(k)),C(p),null}process.env.NODE_ENV!=="production"&&o==="wait"&&S.length>1&&console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`);const{forceRender:A}=h.useContext(ai);return a.jsx(a.Fragment,{children:S.map(k=>{const M=lr(k),_=i&&!c?!1:p===S||f.includes(M),P=()=>{if(N.current.has(M))return;if(v.has(M))N.current.add(M),v.set(M,!0);else return;let E=!0;v.forEach(V=>{V||(E=!1)}),E&&(A==null||A(),T(b.current),i&&(w==null||w()),r&&r())};return a.jsx(Bm,{isPresent:_,initial:!g.current||n?void 0:!1,custom:t,presenceAffectsLayout:s,mode:o,root:d,onExitComplete:_?void 0:P,anchorX:u,anchorY:l,children:k},M)})})},sa=h.createContext({strict:!1}),Yu={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let Xu=!1;function Hm(){if(Xu)return;const e={};for(const t in Yu)e[t]={isEnabled:n=>Yu[t].some(r=>!!n[r])};_u(e),Xu=!0}function Zu(){return Hm(),cm()}function Ju(e){const t=Zu();for(const n in e)t[n]={...t[n],...e[n]};_u(t)}function Qu({children:e,features:t,strict:n=!1}){const[,r]=h.useState(!aa(t)),s=h.useRef(void 0);if(!aa(t)){const{renderer:o,...i}=t;s.current=o,Ju(i)}return h.useEffect(()=>{aa(t)&&t().then(({renderer:o,...i})=>{Ju(i),s.current=o,r(!0)})},[]),a.jsx(sa.Provider,{value:{renderer:s.current,strict:n},children:e})}function aa(e){return typeof e=="function"}const zm=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function cr(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||zm.has(e)}let Ru=e=>!cr(e);function Um(e){typeof e=="function"&&(Ru=t=>t.startsWith("on")?!cr(t):e(t))}try{Um(require("@emotion/is-prop-valid").default)}catch{}function jm(e,t,n){const r={};for(const s in e)s==="values"&&typeof e.values=="object"||be(e[s])||(Ru(s)||n===!0&&cr(s)||!t&&!cr(s)||e.draggable&&s.startsWith("onDrag"))&&(r[s]=e[s]);return r}const dr=h.createContext({});function Gm(e,t){if(ir(e)){const{initial:n,animate:r}=e;return{initial:n===!1||wn(n)?n:void 0,animate:wn(r)?r:void 0}}return e.inherit!==!1?t:{}}function Km(e){const{initial:t,animate:n}=Gm(e,h.useContext(dr));return h.useMemo(()=>({initial:t,animate:n}),[el(t),el(n)])}function el(e){return Array.isArray(e)?e.join(" "):e}const oa=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function tl(e,t,n){for(const r in t)!be(t[r])&&!Fu(r,n)&&(e[r]=t[r])}function Ym({transformTemplate:e},t){return h.useMemo(()=>{const n=oa();return ta(n,t,e),Object.assign({},n.vars,n.style)},[t])}function Xm(e,t){const n=e.style||{},r={};return tl(r,n,e),Object.assign(r,Ym(e,t)),r}function Zm(e,t){const n={},r=Xm(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const nl=()=>({...oa(),attrs:{}});function Jm(e,t,n,r){const s=h.useMemo(()=>{const o=nl();return Lu(o,t,Bu(r),e.transformTemplate,e.style),{...o.attrs,style:{...o.style}}},[t]);if(e.style){const o={};tl(o,e.style,e),s.style={...o,...s.style}}return s}const Qm=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function ia(e){return typeof e!="string"||e.includes("-")?!1:!!(Qm.indexOf(e)>-1||/[A-Z]/u.test(e))}function Rm(e,t,n,{latestValues:r},s,o=!1,i){const l=(i??ia(e)?Jm:Zm)(t,r,s,e),d=jm(t,typeof e=="string",o),c=e!==h.Fragment?{...d,...l,ref:n}:{},{children:w}=t,p=h.useMemo(()=>be(w)?w.get():w,[w]);return h.createElement(e,{...c,children:p})}function eg({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,s){return{latestValues:tg(n,r,s,e),renderState:t()}}function tg(e,t,n,r){const s={},o=r(e,{});for(const p in o)s[p]=Vm(o[p]);let{initial:i,animate:u}=e;const l=ir(e),d=Au(e);t&&d&&!l&&e.inherit!==!1&&(i===void 0&&(i=t.initial),u===void 0&&(u=t.animate));let c=n?n.initial===!1:!1;c=c||i===!1;const w=c?u:i;if(w&&typeof w!="boolean"&&!or(w)){const p=Array.isArray(w)?w:[w];for(let f=0;f<p.length;f++){const g=Us(e,p[f]);if(g){const{transitionEnd:b,transition:v,...N}=g;for(const y in N){let C=N[y];if(Array.isArray(C)){const S=c?C.length-1:0;C=C[S]}C!==null&&(s[y]=C)}for(const y in b)s[y]=b[y]}}}return s}const rl=e=>(t,n)=>{const r=h.useContext(dr),s=h.useContext(Gn),o=()=>eg(e,t,r,s);return n?o():hs(o)},ng=rl({scrapeMotionValuesFromProps:na,createRenderState:oa}),rg=rl({scrapeMotionValuesFromProps:qu,createRenderState:nl}),sg=Symbol.for("motionComponentSymbol");function ag(e,t,n){const r=h.useRef(n);h.useInsertionEffect(()=>{r.current=n});const s=h.useRef(null);return h.useCallback(o=>{var u;o&&((u=e.onMount)==null||u.call(e,o));const i=r.current;if(typeof i=="function")if(o){const l=i(o);typeof l=="function"&&(s.current=l)}else s.current?(s.current(),s.current=null):i(o);else i&&(i.current=o);t&&(o?t.mount(o):t.unmount())},[t])}const og=h.createContext({});function ig(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function ug(e,t,n,r,s,o){var C,S;const{visualElement:i}=h.useContext(dr),u=h.useContext(sa),l=h.useContext(Gn),d=h.useContext(ra),c=d.reducedMotion,w=d.skipAnimations,p=h.useRef(null),f=h.useRef(!1);r=r||u.renderer,!p.current&&r&&(p.current=r(e,{visualState:t,parent:i,props:n,presenceContext:l,blockInitialAnimation:l?l.initial===!1:!1,reducedMotionConfig:c,skipAnimations:w,isSVG:o}),f.current&&p.current&&(p.current.manuallyAnimateOnMount=!0));const g=p.current,b=h.useContext(og);g&&!g.projection&&s&&(g.type==="html"||g.type==="svg")&&lg(p.current,n,s,b);const v=h.useRef(!1);h.useInsertionEffect(()=>{g&&v.current&&g.update(n,l)});const N=n[fu],y=h.useRef(!!N&&typeof window<"u"&&!((C=window.MotionHandoffIsComplete)!=null&&C.call(window,N))&&((S=window.MotionHasOptimisedAnimation)==null?void 0:S.call(window,N)));return oi(()=>{f.current=!0,g&&(v.current=!0,window.MotionIsMounted=!0,g.updateFeatures(),g.scheduleRenderMicrotask(),y.current&&g.animationState&&g.animationState.animateChanges())}),h.useEffect(()=>{g&&(!y.current&&g.animationState&&g.animationState.animateChanges(),y.current&&(queueMicrotask(()=>{var T;(T=window.MotionHandoffMarkAsComplete)==null||T.call(window,N)}),y.current=!1),g.enteringChildren=void 0)}),g}function lg(e,t,n,r){const{layoutId:s,layout:o,drag:i,dragConstraints:u,layoutScroll:l,layoutRoot:d,layoutAnchor:c,layoutCrossfade:w}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:sl(e.parent)),e.projection.setOptions({layoutId:s,layout:o,alwaysMeasureLayout:!!i||u&&ig(u),visualElement:e,animationType:typeof o=="string"?o:"both",initialPromotionConfig:r,crossfade:w,layoutScroll:l,layoutRoot:d,layoutAnchor:c})}function sl(e){if(e)return e.options.allowProjection!==!1?e.projection:sl(e.parent)}function cg(e,{forwardMotionProps:t=!1,type:n}={},r,s){const o=n?n==="svg":ia(e),i=o?rg:ng;function u(d,c){let w;const p={...h.useContext(ra),...d,layoutId:dg(d)},{isStatic:f}=p,g=Km(d),b=i(d,f);if(!f&&typeof window<"u"){wg(p,r);const v=fg(p);w=v.MeasureLayout,g.visualElement=ug(e,b,p,s,v.ProjectionNode,o)}return a.jsxs(dr.Provider,{value:g,children:[w&&g.visualElement?a.jsx(w,{visualElement:g.visualElement,...p}):null,Rm(e,d,ag(b,g.visualElement,c),b,f,t,o)]})}u.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const l=h.forwardRef(u);return l[sg]=e,l}function dg({layoutId:e}){const t=h.useContext(ai).id;return t&&e!==void 0?t+"-"+e:e}function wg(e,t){h.useContext(sa).strict,process.env.NODE_ENV}function fg(e){const t=Zu(),{drag:n,layout:r}=t;if(!n&&!r)return{};const s={...n,...r};return{MeasureLayout:n!=null&&n.isEnabled(e)||r!=null&&r.isEnabled(e)?s.MeasureLayout:void 0,ProjectionNode:s.ProjectionNode}}const pg=(e,t)=>t.isSVG??ia(e)?new Mm(t):new xm(t,{allowProjection:e!==h.Fragment});class hg extends Lt{constructor(t){super(t),t.animationState||(t.animationState=_m(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();or(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)==null||t.call(this)}}let mg=0;class gg extends Lt{constructor(){super(...arguments),this.id=mg++,this.isExitComplete=!1}update(){var o;if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;if(t&&r===!1){if(this.isExitComplete){const{initial:i,custom:u}=this.node.getProps();if(typeof i=="string"){const l=bt(this.node,i,u);if(l){const{transition:d,transitionEnd:c,...w}=l;for(const p in w)(o=this.node.getValue(p))==null||o.jump(w[p])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);this.isExitComplete=!1;return}const s=this.node.animationState.setActive("exit",!t);n&&!t&&s.then(()=>{this.isExitComplete=!0,n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const bg={animation:{Feature:hg},exit:{Feature:gg}};function al(e){return{point:{x:e.pageX,y:e.pageY}}}function ol(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const s="onHover"+n,o=r[s];o&&Fe.postRender(()=>o(t,al(t)))}class yg extends Lt{mount(){const{current:t}=this.node;t&&(this.unmount=Qh(t,(n,r)=>(ol(this.node,r,"Start"),s=>ol(this.node,s,"End"))))}unmount(){}}class vg extends Lt{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Kn(Uu(this.node.current,"focus",()=>this.onFocus()),Uu(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function il(e,t,n){const{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const s="onTap"+(n==="End"?"":n),o=r[s];o&&Fe.postRender(()=>o(t,al(t)))}class xg extends Lt{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:n,propagate:r}=this.node.props;this.unmount=rm(t,(s,o)=>(il(this.node,o,"Start"),(i,{success:u})=>il(this.node,i,u?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:(r==null?void 0:r.tap)===!1})}unmount(){}}const ua=new WeakMap,la=new WeakMap,Ng=e=>{const t=ua.get(e.target);t&&t(e)},Sg=e=>{e.forEach(Ng)};function Cg({root:e,...t}){const n=e||document;la.has(n)||la.set(n,{});const r=la.get(n),s=JSON.stringify(t);return r[s]||(r[s]=new IntersectionObserver(Sg,{root:e,...t})),r[s]}function Tg(e,t,n){const r=Cg(t);return ua.set(e,n),r.observe(e),()=>{ua.delete(e),r.unobserve(e)}}const Eg={some:0,all:1};class Mg extends Lt{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){var l;(l=this.stopObserver)==null||l.call(this);const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:s="some",once:o}=t,i={root:n?n.current:void 0,rootMargin:r,threshold:typeof s=="number"?s:Eg[s]},u=d=>{const{isIntersecting:c}=d;if(this.isInView===c||(this.isInView=c,o&&!c&&this.hasEnteredView))return;c&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",c);const{onViewportEnter:w,onViewportLeave:p}=this.node.getProps(),f=c?w:p;f&&f(d)};this.stopObserver=Tg(this.node.current,i,u)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(Ig(t,n))&&this.startObserver()}unmount(){var t;(t=this.stopObserver)==null||t.call(this),this.hasEnteredView=!1,this.isInView=!1}}function Ig({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const ul={renderer:pg,...bg,...{inView:{Feature:Mg},tap:{Feature:xg},focus:{Feature:vg},hover:{Feature:yg}}};function Ag(e,t){return cg(e,t)}const ll=Ag("div"),kg=e=>{const{checked:t,onSelect:n,children:r,disabled:s,preventCloseOnSelect:o}=e;return a.jsx(Qo,{disabled:s,checked:t,onCheckedChange:n,onSelect:i=>o&&i.preventDefault(),children:r})},wr=e=>{const{children:t,className:n,Icon:r,iconPosition:s="left",disabled:o,onSelect:i,preventCloseOnSelect:u}=e,l=m("wu-flex wu-items-center wu-gap-2",r&&(s==="left"?"":"wu-justify-between wu-flex-row-reverse"),n),d=c=>{i&&i(c),u&&c.preventDefault()};return a.jsxs(Un,{onSelect:d,disabled:o,className:l,children:[r&&a.jsx("div",{className:"wu-text-base",children:r}),t]})},Dg=e=>{const{children:t,Label:n,...r}=e;return a.jsxs(Xo,{...r,children:[a.jsx(rn,{children:n||e.label}),t]})},_g=e=>{const{options:t,value:n,onSelect:r}=e;return a.jsx(Cf,{value:n,onValueChange:r,children:t.map(s=>a.jsx(Ro,{value:s.value,disabled:s.disabled,children:s.Label||s.label},s.value))})},Pg=e=>{const{className:t,...n}=e,r=m("wu-w-11/12 wu-mx-auto wu-border-gray-40",t);return a.jsx(jn,{...n,className:r})},Wt=x.forwardRef(({className:e,children:t,thumbColor:n,railColor:r,...s},o)=>a.jsxs(lt.Root,{ref:o,className:m("wu-relative wu-overflow-hidden",e),children:[a.jsx(lt.Viewport,{className:"wu-h-full wu-w-full wu-rounded-[inherit]",...s,children:t}),a.jsx(ca,{thumbColor:n,railColor:r}),a.jsx(lt.Corner,{})]}));Wt.displayName=lt.Root.displayName;const ca=x.forwardRef(({className:e,orientation:t="vertical",thumbColor:n="#d4d4d4",railColor:r="#eeeeee",...s},o)=>a.jsx(lt.ScrollAreaScrollbar,{ref:o,orientation:t,className:m("wu-flex wu-touch-none wu-select-none wu-transition-colors",t==="vertical"&&"wu-h-full wu-w-2 wu-border-l wu-border-l-transparent wu-p-[1px]",t==="horizontal"&&"wu-h-2 wu-flex-col wu-border-t wu-border-t-transparent wu-p-[1px]",e),style:{background:r},...s,children:a.jsx(lt.ScrollAreaThumb,{className:"wu-relative wu-flex-1 wu-rounded-full",style:{background:n}})}));ca.displayName=lt.ScrollAreaScrollbar.displayName;const Vg=e=>{const{children:t,label:n,Label:r,open:s,onOpenChange:o,height:i,dir:u,...l}=e;return a.jsxs(Sf,{...l,open:s,onOpenChange:o,children:[a.jsx(Zo,{dir:u,children:r||n}),a.jsx(Nf,{children:a.jsx(Jo,{onInteractOutside:d=>d.preventDefault(),children:a.jsx(Wt,{className:"wu-h-fit",style:{height:i},dir:u,children:t})})})]})},Og="wu-p-1.5 wu-cursor-pointer hover:wu-bg-gray-20 wu-border-gray-40 wu-transition wu-duration-300 focus:wu-outline-2 focus:wu-outline-offset focus:wu-outline-blue-p/80 focus:wu-bg-gray-20 hover:wu-bg-gray-20 wu-rounded-t-sm",da=e=>{const{children:t,menuTitle:n,MenuTitle:r,variant:s="flat",name:o,open:i,onOpenChange:u,height:l,preventCloseOnClickOutside:d,dir:c,Trigger:w,align:p="start",sideOffset:f=0,side:g="bottom",alignOffset:b,className:v,disabled:N,...y}=e;return a.jsxs(Ko,{...y,open:i,onOpenChange:u,dir:c,children:[a.jsx(Yo,{asChild:!0,dir:c,disabled:N,className:m("disabled:wu-text-zinc-300 disabled:wu-bg-white disabled:wu-cursor-not-allowed disabled:hover:wu-bg-transparent"),children:w??Fg(s,o,N)}),a.jsx(fs,{className:m("wu-w-56 wu-border wu-border-blue-p disabled:wu-border-gray-40",v,"wu-menu-content"),align:p,sideOffset:f,side:g,alignOffset:b,onInteractOutside:C=>d&&C.preventDefault(),children:a.jsxs(Wt,{className:"h-fit",style:{height:l},dir:c,children:[(n||r)&&a.jsxs(a.Fragment,{children:[a.jsx(rn,{dir:c,className:"wu-menu-title",children:r||n}),a.jsx(jn,{className:"wu-mt-0 wu-menu-separator",dir:c})]}),t??a.jsx("p",{children:"Menu Is Empty"})]})})]})},Fg=(e,t,n)=>{const r=m(Og,"wu-flex wu-items-center wu-justify-between wu-gap-2 wu-h-8 wu-text-xs wu-group/wuMenu",e==="outlined"?"wu-border":"wu-border-b","wu-trigger-btn");return a.jsxs("button",{className:r,"aria-label":"menu-trigger",children:[a.jsx("span",{children:t??"Menu"}),a.jsx("span",{className:m("wm-arrow-drop-down wu-text-gray-lead wu-text-base wu-rotate-180 group-data-[state=closed]/wuMenu:wu-rotate-0 wu-transition-transform wu-duration-300 group-hover:wu-text-blue-q",n&&"wu-text-zinc-300 group-hover:wu-text-zinc-300")})]})},Lg=({titles:e,dir:t="ltr",handleTitleClick:n})=>{const[r,s]=h.useState(!1);return a.jsx(da,{className:"wu-rounded-sm",open:r,onOpenChange:s,dir:t,sideOffset:8,Trigger:a.jsx(Ae,{variant:"iconOnly",className:m("wu-w-6 wu-h-6 wu-shrink-0 wu-p-0"),Icon:a.jsx("span",{className:m("wm-keyboard-arrow-down wu-text-[16px] wu-origin-center wu-transition-transform wu-duration-300",r&&(t==="rtl"?"-wu-rotate-180":"wu-rotate-180"))})}),children:e.map(o=>a.jsx(wr,{onSelect:i=>n(i,o.id),children:o.title},o.id))})},Wg=({titles:e,currentLevel:t,initial:n,handleTitleClick:r,headerClasses:s,offsetHeight:o,dir:i="ltr"})=>{const u=h.useMemo(()=>i==="rtl"?{initial:{x:8,opacity:0,zIndex:0},animate:{x:0,opacity:1,zIndex:50},exit:{x:-8,opacity:0,zIndex:0}}:{initial:{x:-8,opacity:0,zIndex:0},animate:{x:0,opacity:1,zIndex:50},exit:{x:8,opacity:0,zIndex:0}},[i]);return a.jsxs("div",{className:m("wu-absolute wu-top-0 wu-left-0 wu-flex wu-gap-x-1 wu-px-4 wu-items-center wu-origin-left wu-w-full wu-transition",t!==n?"wu-translate-y-0 wu-opacity-100 wu-z-50 wu-delay-200":"wu-translate-y-1 wu-opacity-0 wu-z-0 wu-delay-0",s),style:{height:t!==n?`${o}px`:"-40px"},dir:i,children:[a.jsx(Lg,{titles:e,handleTitleClick:r,dir:i}),a.jsx("div",{className:"wu-w-full wu-relative wu-h-full wu-flex wu-items-center wu-flex-nowrap wu-whitespace-nowrap wu-text-nowrap wu-gap-2 wu-overflow-x-auto wu-no-scrollbar wu-snap-x wu-snap-mandatory wu-scroll-smooth",children:a.jsx(Qu,{features:ul,children:a.jsxs(Ku,{initial:!1,mode:"popLayout",children:[Bg(e).map((l,d)=>a.jsx(ll,{initial:u.initial,animate:u.animate,exit:u.exit,transition:{duration:.4,ease:"easeInOut"},children:a.jsxs("h6",{"data-id":l.id,onClick:r,className:m("wu-flex wu-text-sm wu-font-normal wu-items-center wu-gap-2 wu-h-6",d===2||d===1||l.id==="LEVEL_DOTS"?"wu-cursor-default wu-text-gray-600":"wu-cursor-pointer wu-text-[#1B87E6] wu-hover:text-[#145DBF]/70"),children:[d!==0&&a.jsx("span",{className:m("wm-keyboard-arrow-right wu-text-[16px] wu-font-light",i==="rtl"&&"wu-rotate-180")}),l.title]})},l.id)),"``"]})})})]})},Bg=e=>{const t=e.length;if(t>2){const n=e[0],r=e[t-1];return[n,{id:"LEVEL_DOTS",title:"..."},r]}return e},qg=({items:e,initial:t,baseTitle:n,mode:r="popLayout",headerClasses:s="",offsetHeight:o=40,variant:i="default",dir:u="ltr"})=>{const[l,d]=h.useState(n?[n]:[]),[[c,w],p]=h.useState([t,1]),f=(N,y)=>{y&&d([...l,y]),p([N,1])},g=N=>{const y=l.findIndex(C=>C.id===N);if(y!==-1){const C=l.slice(0,y+1);d(C)}p([N,-1])},b=(N,y)=>{const C=y||N.currentTarget.getAttribute("data-id")||"";if(C&&C!==c){const S=l.findIndex(T=>T.id===C);S!==-1&&(d(l.slice(0,S+1)),g(C))}},v=()=>{const N=e[c]?e[c]:null;if(!N)return a.jsx("div",{className:"wu-absolute wu-inset-0 wu-w-full wu-h-full wu-flex wu-items-center wu-justify-center",children:a.jsx("p",{className:"wu-text-gray-500",children:"No content available."})});const y=typeof N.component=="function"?N.component({goNext:f,goBack:g}):N.component;return a.jsx(ll,{dir:u,custom:w,variants:$g(i),initial:"enter",animate:"center",exit:"exit",transition:{opacity:{duration:.325,ease:"easeInOut"},scale:{duration:.275,ease:"easeInOut"}},className:"wu-w-full wu-h-full",style:{paddingTop:c!==t?`${o}px`:"0px"},children:y},c)};return a.jsxs("div",{dir:u,className:"wu-w-full wu-h-full wu-relative wu-overflow-hidden wu-flex wu-flex-col",children:[a.jsx(Wg,{titles:l,currentLevel:c,initial:t,handleTitleClick:b,headerClasses:s,offsetHeight:o,dir:u}),a.jsx(Qu,{features:ul,children:a.jsx(Ku,{initial:!1,custom:w,mode:r,children:v()})})]})},$g=e=>{switch(e){case"slideRight":return zg;case"slideLeft":return Ug;case"fadeZoom":return jg;case"default":default:return Hg}},Hg={enter:e=>({scale:e>0?.825:1.1,opacity:0,zIndex:0}),center:{scale:1,opacity:1,zIndex:1},exit:e=>({scale:e>0?1.1:.825,opacity:0,zIndex:0})},zg={enter:e=>({x:e>0?-15:15,opacity:0,zIndex:0}),center:{x:0,opacity:1,zIndex:1},exit:e=>({x:e>0?15:-15,opacity:0,zIndex:0})},Ug={enter:e=>({x:e>0?15:-15,opacity:0,zIndex:0}),center:{x:0,opacity:1,zIndex:1},exit:e=>({x:e>0?-15:15,opacity:0,zIndex:0})},jg={enter:e=>({opacity:0,zIndex:0,scale:e>0?.925:1.1}),center:{opacity:1,zIndex:1,scale:1},exit:{opacity:0,zIndex:0,scale:1}},cl=({className:e,isLoading:t,loadingText:n,children:r,...s})=>a.jsxs("footer",{className:m("wu-flex wu-items-center wu-justify-between wu-gap-2 wu-border-t wu-border-gray-10 wu-py-3 wu-px-4 wu-bg-white/80 wu-backdrop-blur-sm wu-text-xs wu-font-normal wu-text-gray-footer wu-sticky wu-bottom-0",e),...s,children:[a.jsx("div",{className:"wu-flex-1",children:r}),t&&a.jsx(dt,{size:"16px",variant:"spinner",color:"#a3a3a3",message:n})]});cl.displayName="WuFooter";const dl=h.forwardRef((e,t)=>{const{size:n="sm",idOrSlugOrUrl:r,variant:s="primary",...o}=e,i=n==="sm"?16:18,u=r.includes("http")?r:`/help/${r}.html`,l=s==="primary"?"wu-text-blue-p":"wu-text-gray-lead";return a.jsx("button",{...o,ref:t,onClick:()=>Pr(u),children:a.jsx("span",{className:m("wm-help wu-text-gray-subtle",`wu-text-[${i}px]`,l,o.disabled&&"wu-text-neutral-300","wu-help-button-icon")})})});dl.displayName="WuHelpButton";const rt=(e,t)=>`wu-listbox-${e}`;function Gg(e){const{option:t,accessorKey:n,onSelect:r,multiple:s,dir:o,GroupLabel:i,Item:u,isSelected:l,...d}=e,c=n.group&&Array.isArray(t[n.group]),w=({item:p,className:f})=>h.createElement(nn,{...d,key:JSON.stringify(p),onSelect:()=>r==null?void 0:r(p),value:t[n.value],className:m("data-[selected='true']:wu-bg-gray-100 wu-cursor-pointer wu-text-xs wu-min-h-8 wu-py-0 hover:wu-bg-gray-10",!!(l!=null&&l(p))&&!s&&"wu-bg-blue-p/10",o==="rtl"&&"wu-justify-end",f,rt("item")),disabled:p.disabled},s&&a.jsx(He,{checked:l==null?void 0:l(p)}),u?u({value:p,isSelected:l==null?void 0:l(p)}):a.jsx(a.Fragment,{children:p[n.label]}));if(c){const p=t[n.group],f=typeof i=="string"?t[i]:i==null?void 0:i(t);return a.jsx(tn,{heading:f,children:p==null?void 0:p.map(g=>a.jsx(w,{item:g,className:"wu-pl-6"},JSON.stringify(g)))})}return a.jsx(w,{item:t})}const Kg=h.memo(Gg),Yg=e=>{const{className:t,...n}=e;return a.jsxs("div",{className:"wu-relative",children:[a.jsx(Pe,{icon:"wm-search",className:"wu-absolute wu-top-[14px] wu-left-5"}),a.jsx(jo,{...n,"aria-label":"Search",className:m("wu-bg-gray-10 wu-border-b wu-border-gray-subtle wu-rounded-none wu-rounded-t-sm wu-h-8 wu-my-2 wu-pl-8","focus:wu-border-blue-p focus-visible:wu-outline-none;",rt("input"),t)})]})},Xg=e=>{const{label:t,onSelectAll:n,data:r,value:s}=e,[o,i]=h.useState(!1),[u,l]=h.useState(!1);return h.useEffect(()=>{!s||!r||(i(s.length>0),l(s.length>0&&s.length<r.length))},[r,s]),a.jsxs(nn,{className:"data-[selected='true']:wu-bg-gray-100 wu-cursor-pointer wu-text-xs wu-min-h-8 wu-py-0 hover:wu-bg-gray-100",onSelect:()=>n==null?void 0:n(!o),children:[a.jsx(He,{checked:o,partial:u}),t||"Select All"]})},Zg=e=>{const{CustomTrigger:t,disabled:n,value:r,placeholder:s,accessorKey:o,Chip:i,handleUnselect:u,variant:l,dir:d,className:c,...w}=e,[p,f]=h.useState(),g=h.useRef(null);return h.useEffect(()=>{if(!r){f(null);return}f(Array.isArray(r)?i?r.map((v,N)=>i({value:v,unselect:u,key:N})):r.map(v=>v[o.label]).join(", "):i?i({value:r,unselect:u}):r[o.label])},[r,i,o.label,f]),a.jsx(wt,{asChild:!0,id:e.id,disabled:n,ref:g,children:(t==null?void 0:t(r))||a.jsxs("button",{...w,className:m("wu-group/wuListbox wu-relative wu-min-h-8 wu-text-xs wu-border-gray-subtle wu-bg-gray-10 wu-p-1 wu-pl-2 rtl:wu-pr-2 wu-border-b wu-w-full wu-text-left wu-pr-5 rtl:wu-pl-5","hover:wu-border-blue-p","disabled:wu-cursor-not-allowed disabled:wu-bg-gray-20 disabled:wu-border-gray-40 disabled:wu-text-gray-subtle","rtl:wu-text-right",l==="outlined"&&"wu-border wu-border-gray-subtle wu-bg-white",c,rt("trigger")),children:[a.jsx("div",{className:m("wu-truncate",i&&"wu-flex wu-items-center wu-gap-1 wu-flex-wrap",!p&&"wu-font-light"),children:p||s}),a.jsx(Pe,{icon:"wm-arrow-drop-down",className:m("wu-absolute wu-top-1 wm-arrow-drop-down group-data-[state=open]/wuListbox:wu-rotate-180 wu-transition-transform wu-duration-300 wu-text-base",d==="rtl"?"wu-left-1":"wu-right-1",rt("drop-icon"))})]})})},wl=(e,t,n)=>{const r=String(e[n.label]??"").toLowerCase(),s=String(e[n.value]??"").toLowerCase();return r.includes(t)||s.includes(t)},Jg=(e,t,n)=>{const r=t.trim();if(r==="")return e;const s=r.toLowerCase(),o=[];for(const i of e){const u=n.group,l=u?i[u]:void 0;if(Array.isArray(l)){const d=l.filter(c=>wl(c,s,n));d.length>0&&o.push({...i,[u]:d})}else wl(i,s,n)&&o.push(i)}return o},fl=e=>{const{data:t,accessorKey:n,value:r,Item:s,Label:o,GroupLabel:i,CustomHeader:u,CustomTrigger:l,NoDataContent:d,Chip:c,onSelect:w,onScroll:p,disabled:f,multiple:g,searchable:b,selectAll:v,virtualizedThreshold:N=100,showGroupSeparator:y,id:C,dir:S,className:T,listClass:D,placeholder:A="Select items...",variant:k,labelPosition:M="top",maxContentWidth:_,maxContentHeight:P,modal:E,...V}=e,[L,O]=h.useState(!1),[W,q]=h.useState(""),[$,G]=h.useState(r),Z=h.useMemo(()=>n,[n]),H=h.useMemo(()=>{if(!b||!W)return t;const F=W.toLowerCase().trim();return Jg(t,F,n)},[t,W,n.label,b]),J=F=>{g?G(z=>{const Y=F[n.value],K=Array.isArray(z)?z:[],j=K.some(ee=>ee[n.value]===Y)?K.filter(ee=>ee[n.value]!==Y):[...K,F];return w&&w(j),j}):(G(F),w&&w(F),O(!1))},ie=h.useCallback(F=>{const z=F?t:[];G(z),v!=null&&v.onSelectAll&&v.onSelectAll(F),w&&w(z)},[t,v,w]),fe=F=>Array.isArray($)?$.some(z=>z[n.value]===F[n.value]):($==null?void 0:$[n.value])===F[n.value];h.useEffect(()=>{G(r)},[r]);const Se=F=>{const z=(Y,K)=>{const me=n.group&&Array.isArray(Y[n.group]),j=y&&me&&K>0&&F.length>1;return a.jsxs(h.Fragment,{children:[j&&a.jsx(ws,{}),a.jsx(Kg,{option:Y,accessorKey:Z,multiple:g,onSelect:ee=>J(ee),dir:S,GroupLabel:i,Item:s,isSelected:ee=>fe(ee)})]},JSON.stringify(Y))};return F.length>N?a.jsx(It,{list:F,callback:(Y,K)=>z(K,Y),dir:S}):F.map((Y,K)=>z(Y,K))};return a.jsxs("div",{className:m("wu-flex wu-text-sm wu-gap-2",M==="top"&&"wu-flex-col wu-gap-1",M==="left"&&"wu-flex-row",M==="right"&&"wu-flex-row-reverse",rt("container")),dir:S,children:[o&&a.jsx(ke,{htmlFor:C,className:rt("label"),children:o}),a.jsxs(Ge,{open:L,onOpenChange:F=>{O(F),F||setTimeout(()=>{q("")},100)},modal:E,children:[a.jsx(Zg,{CustomTrigger:l,disabled:f,value:$,accessorKey:n,placeholder:A,Chip:c,className:T,handleUnselect:J,variant:k,id:C,dir:S,...V}),a.jsx($e,{className:m("wu-min-w-[--radix-popover-trigger-width] wu-max-w-[calc(100vw-32px)] wu-w-auto wu-p-0 wu-bg-white wu-border wu-border-blue-p",rt("content")),align:"start",sideOffset:-1,style:{maxWidth:_},children:a.jsxs(ls,{id:e.id,shouldFilter:!1,children:[b&&a.jsx(Yg,{value:W,onValueChange:q}),u,a.jsxs(cs,{className:m("wu-overflow-y-auto",rt("list"),D),onScroll:p,style:{maxHeight:P||"420px"},children:[a.jsx(ds,{children:d||"No results found."}),a.jsx(tn,{children:g&&(v==null?void 0:v.enabled)&&!W&&a.jsx(Xg,{data:t,value:$,onSelectAll:ie,label:v.label})}),a.jsx(tn,{children:Se(H)})]})]})})]})]})},wa=h.forwardRef(({showMenu:e=!1,className:t,color:n="#1B3380",...r},s)=>{const o=m("wu-w-full wu-border wu-transition-all wu-duration-300");return a.jsxs("div",{...r,className:m("wu-flex wu-flex-col wu-w-[18px] wu-justify-between wu-aspect-[3/2] wu-transition-all wu-duration-300",t),ref:s,"aria-label":"menu-icon",children:[a.jsx("div",{className:`${o} wu-origin-center ${e?"wu-rotate-45 wu-translate-y-[5px]":""}`,style:{borderColor:n}}),a.jsx("div",{className:`${o} ${e?"wu-opacity-0":""}`,style:{borderColor:n}}),a.jsx("div",{className:`${o} wu-origin-center ${e?"-wu-rotate-45 -wu-translate-y-[5px]":""}`,style:{borderColor:n}})]})});wa.displayName="WuMenuIcon";const pl={overlay:"data-[state=open]:wu-animate-in data-[state=closed]:wu-animate-out data-[state=closed]:wu-fade-out-0 data-[state=open]:wu-fade-in-0",content:"data-[state=open]:wu-animate-in data-[state=closed]:wu-animate-out data-[state=closed]:wu-fade-out-0 data-[state=open]:wu-fade-in-0 data-[state=closed]:wu-zoom-out-95 data-[state=open]:wu-zoom-in-95 data-[state=closed]:wu-slide-out-to-left-1/2 data-[state=closed]:wu-slide-out-to-top-[48%] data-[state=open]:wu-slide-in-from-left-1/2 data-[state=open]:wu-slide-in-from-top-[48%]"},hl=te.Root,ml=te.Trigger,Qg=te.Portal,Rg=te.Close,gl=h.forwardRef(({className:e,...t},n)=>a.jsx(te.Overlay,{ref:n,className:m("wu-fixed wu-inset-0 wu-z-50 wu-bg-black/30",pl.overlay,e),...t}));gl.displayName=te.Overlay.displayName;const fa=h.forwardRef(({className:e,children:t,hideCloseButton:n,isStackedCard:r,...s},o)=>a.jsxs(Qg,{children:[a.jsx(gl,{className:r?"wu-bg-transparent":""}),a.jsxs(te.Content,{ref:o,className:m("wu-fixed wu-left-[50%] wu-z-50 wu-top-[50%] wu-flex wu-flex-col wu-w-full wu-max-w-lg wu-translate-x-[-50%] wu-translate-y-[-50%] wu-bg-white wu-shadow-lg wu-duration-200",pl.content,e),...s,children:[t,!n&&a.jsx(te.Close,{"aria-label":"close",asChild:!0,children:a.jsxs(Et,{variant:"iconOnly",className:m("wu-absolute wu-right-2 wu-top-1 hover:wu-bg-black/[0.08] wu-w-8 wu-h-8 wu-p-0","wu-top-3 wu-right-4","group-data-[variant=action]:wu-text-blue-q","group-data-[variant=upgrade]:wu-text-yellow-deep","group-data-[variant=critical]:wu-text-red-deep"),children:[a.jsx("span",{className:"wm-close wu-leading-5"}),a.jsx("span",{className:"wu-sr-only",children:"Close"})]})})]})]}));fa.displayName=te.Content.displayName;const pa=({className:e,...t})=>a.jsx("div",{className:m("wu-text-center wu-bg-gray-20 wu-w-full",e),...t});pa.displayName="DialogHeader";const bl=({className:e,...t})=>a.jsx("div",{className:m("wu-flex wu-flex-col-reverse sm:wu-flex-row sm:wu-justify-end sm:wu-space-x-2 wu-p-4",e),...t});bl.displayName="DialogFooter";const ha=h.forwardRef(({className:e,...t},n)=>a.jsx(te.Title,{ref:n,className:m("wu-text-lg wu-font-medium wu-flex wu-items-center wu-justify-center wu-gap-1 wu-h-10 wu-leading-none wu-tracking-tight",e),...t}));ha.displayName=te.Title.displayName;const eb=h.forwardRef(({className:e,...t},n)=>a.jsx(te.Description,{ref:n,className:m("wu-text-sm wu-text-muted-foreground",e),...t}));eb.displayName=te.Description.displayName;const tb={gradientBackground:"_gradientBackground_1uc4j_1"},yl=e=>{const{colors:t,size:n=.55,children:r,className:s,strokeWidth:o,centerOffset:i={x:0,y:0},...u}=e,l=h.useRef(null);return h.useEffect(()=>{const d=l.current;if(d){d.style.setProperty("--width",`${d.offsetWidth*n}px`),d.style.setProperty("--height",`${d.offsetHeight*n}px`),d.style.setProperty("--colors",t.join(",")),d.style.setProperty("--stroke-width",`-${o||2}px`),d.style.setProperty("--spotlight-background","radial-gradient(100% var(--height) ellipse at 25% 70%, var(--colors))");let w;const p=f=>{w&&cancelAnimationFrame(w),w=requestAnimationFrame(()=>{const g=d.getBoundingClientRect();let b=f.clientX-g.left,v=f.clientY-g.top;b=Math.max(0,Math.min(b+i.x,g.width)),v=Math.max(0,Math.min(v+i.y,g.height));const N=`radial-gradient(
|
|
15
|
+
`),()=>{var A;(A=u.current)==null||A.removeAttribute("data-motion-pop-id"),D.contains(T)&&D.removeChild(T)}},[t]),a.jsx(Lm,{isPresent:t,childRef:u,sizeRef:l,pop:o,children:o===!1?e:x.cloneElement(e,{ref:w})})}const Bm=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:s,presenceAffectsLayout:o,mode:i,anchorX:u,anchorY:l,root:d})=>{const c=hs(qm),w=h.useId();let p=!0,f=h.useMemo(()=>(p=!1,{id:w,initial:t,isPresent:n,custom:s,onExitComplete:g=>{c.set(g,!0);for(const b of c.values())if(!b)return;r&&r()},register:g=>(c.set(g,!1),()=>c.delete(g))}),[n,c,r]);return o&&p&&(f={...f}),h.useMemo(()=>{c.forEach((g,b)=>c.set(b,!1))},[n]),x.useEffect(()=>{!n&&!c.size&&r&&r()},[n]),e=a.jsx(Wm,{pop:i==="popLayout",isPresent:n,anchorX:u,anchorY:l,root:d,children:e}),a.jsx(Gn.Provider,{value:f,children:e})};function qm(){return new Map}function $m(e=!0){const t=h.useContext(Gn);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:s}=t,o=h.useId();h.useEffect(()=>{if(e)return s(o)},[e]);const i=h.useCallback(()=>e&&r&&r(o),[o,r,e]);return!n&&r?[!1,i]:[!0]}const lr=e=>e.key||"";function Gu(e){const t=[];return h.Children.forEach(e,n=>{h.isValidElement(n)&&t.push(n)}),t}const Ku=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:s=!0,mode:o="sync",propagate:i=!1,anchorX:u="left",anchorY:l="top",root:d})=>{const[c,w]=$m(i),p=h.useMemo(()=>Gu(e),[e]),f=i&&!c?[]:p.map(lr),g=h.useRef(!0),b=h.useRef(p),v=hs(()=>new Map),N=h.useRef(new Set),[y,C]=h.useState(p),[S,T]=h.useState(p);oi(()=>{g.current=!1,b.current=p;for(let k=0;k<S.length;k++){const M=lr(S[k]);f.includes(M)?(v.delete(M),N.current.delete(M)):v.get(M)!==!0&&v.set(M,!1)}},[S,f.length,f.join("-")]);const D=[];if(p!==y){let k=[...p];for(let M=0;M<S.length;M++){const _=S[M],P=lr(_);f.includes(P)||(k.splice(M,0,_),D.push(_))}return o==="wait"&&D.length&&(k=D),T(Gu(k)),C(p),null}process.env.NODE_ENV!=="production"&&o==="wait"&&S.length>1&&console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`);const{forceRender:A}=h.useContext(ai);return a.jsx(a.Fragment,{children:S.map(k=>{const M=lr(k),_=i&&!c?!1:p===S||f.includes(M),P=()=>{if(N.current.has(M))return;if(v.has(M))N.current.add(M),v.set(M,!0);else return;let E=!0;v.forEach(V=>{V||(E=!1)}),E&&(A==null||A(),T(b.current),i&&(w==null||w()),r&&r())};return a.jsx(Bm,{isPresent:_,initial:!g.current||n?void 0:!1,custom:t,presenceAffectsLayout:s,mode:o,root:d,onExitComplete:_?void 0:P,anchorX:u,anchorY:l,children:k},M)})})},sa=h.createContext({strict:!1}),Yu={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let Xu=!1;function Hm(){if(Xu)return;const e={};for(const t in Yu)e[t]={isEnabled:n=>Yu[t].some(r=>!!n[r])};_u(e),Xu=!0}function Zu(){return Hm(),cm()}function Ju(e){const t=Zu();for(const n in e)t[n]={...t[n],...e[n]};_u(t)}function Qu({children:e,features:t,strict:n=!1}){const[,r]=h.useState(!aa(t)),s=h.useRef(void 0);if(!aa(t)){const{renderer:o,...i}=t;s.current=o,Ju(i)}return h.useEffect(()=>{aa(t)&&t().then(({renderer:o,...i})=>{Ju(i),s.current=o,r(!0)})},[]),a.jsx(sa.Provider,{value:{renderer:s.current,strict:n},children:e})}function aa(e){return typeof e=="function"}const zm=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function cr(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||zm.has(e)}let Ru=e=>!cr(e);function Um(e){typeof e=="function"&&(Ru=t=>t.startsWith("on")?!cr(t):e(t))}try{Um(require("@emotion/is-prop-valid").default)}catch{}function jm(e,t,n){const r={};for(const s in e)s==="values"&&typeof e.values=="object"||be(e[s])||(Ru(s)||n===!0&&cr(s)||!t&&!cr(s)||e.draggable&&s.startsWith("onDrag"))&&(r[s]=e[s]);return r}const dr=h.createContext({});function Gm(e,t){if(ir(e)){const{initial:n,animate:r}=e;return{initial:n===!1||wn(n)?n:void 0,animate:wn(r)?r:void 0}}return e.inherit!==!1?t:{}}function Km(e){const{initial:t,animate:n}=Gm(e,h.useContext(dr));return h.useMemo(()=>({initial:t,animate:n}),[el(t),el(n)])}function el(e){return Array.isArray(e)?e.join(" "):e}const oa=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function tl(e,t,n){for(const r in t)!be(t[r])&&!Fu(r,n)&&(e[r]=t[r])}function Ym({transformTemplate:e},t){return h.useMemo(()=>{const n=oa();return ta(n,t,e),Object.assign({},n.vars,n.style)},[t])}function Xm(e,t){const n=e.style||{},r={};return tl(r,n,e),Object.assign(r,Ym(e,t)),r}function Zm(e,t){const n={},r=Xm(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const nl=()=>({...oa(),attrs:{}});function Jm(e,t,n,r){const s=h.useMemo(()=>{const o=nl();return Lu(o,t,Bu(r),e.transformTemplate,e.style),{...o.attrs,style:{...o.style}}},[t]);if(e.style){const o={};tl(o,e.style,e),s.style={...o,...s.style}}return s}const Qm=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function ia(e){return typeof e!="string"||e.includes("-")?!1:!!(Qm.indexOf(e)>-1||/[A-Z]/u.test(e))}function Rm(e,t,n,{latestValues:r},s,o=!1,i){const l=(i??ia(e)?Jm:Zm)(t,r,s,e),d=jm(t,typeof e=="string",o),c=e!==h.Fragment?{...d,...l,ref:n}:{},{children:w}=t,p=h.useMemo(()=>be(w)?w.get():w,[w]);return h.createElement(e,{...c,children:p})}function eg({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,s){return{latestValues:tg(n,r,s,e),renderState:t()}}function tg(e,t,n,r){const s={},o=r(e,{});for(const p in o)s[p]=Vm(o[p]);let{initial:i,animate:u}=e;const l=ir(e),d=Au(e);t&&d&&!l&&e.inherit!==!1&&(i===void 0&&(i=t.initial),u===void 0&&(u=t.animate));let c=n?n.initial===!1:!1;c=c||i===!1;const w=c?u:i;if(w&&typeof w!="boolean"&&!or(w)){const p=Array.isArray(w)?w:[w];for(let f=0;f<p.length;f++){const g=Us(e,p[f]);if(g){const{transitionEnd:b,transition:v,...N}=g;for(const y in N){let C=N[y];if(Array.isArray(C)){const S=c?C.length-1:0;C=C[S]}C!==null&&(s[y]=C)}for(const y in b)s[y]=b[y]}}}return s}const rl=e=>(t,n)=>{const r=h.useContext(dr),s=h.useContext(Gn),o=()=>eg(e,t,r,s);return n?o():hs(o)},ng=rl({scrapeMotionValuesFromProps:na,createRenderState:oa}),rg=rl({scrapeMotionValuesFromProps:qu,createRenderState:nl}),sg=Symbol.for("motionComponentSymbol");function ag(e,t,n){const r=h.useRef(n);h.useInsertionEffect(()=>{r.current=n});const s=h.useRef(null);return h.useCallback(o=>{var u;o&&((u=e.onMount)==null||u.call(e,o));const i=r.current;if(typeof i=="function")if(o){const l=i(o);typeof l=="function"&&(s.current=l)}else s.current?(s.current(),s.current=null):i(o);else i&&(i.current=o);t&&(o?t.mount(o):t.unmount())},[t])}const og=h.createContext({});function ig(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function ug(e,t,n,r,s,o){var C,S;const{visualElement:i}=h.useContext(dr),u=h.useContext(sa),l=h.useContext(Gn),d=h.useContext(ra),c=d.reducedMotion,w=d.skipAnimations,p=h.useRef(null),f=h.useRef(!1);r=r||u.renderer,!p.current&&r&&(p.current=r(e,{visualState:t,parent:i,props:n,presenceContext:l,blockInitialAnimation:l?l.initial===!1:!1,reducedMotionConfig:c,skipAnimations:w,isSVG:o}),f.current&&p.current&&(p.current.manuallyAnimateOnMount=!0));const g=p.current,b=h.useContext(og);g&&!g.projection&&s&&(g.type==="html"||g.type==="svg")&&lg(p.current,n,s,b);const v=h.useRef(!1);h.useInsertionEffect(()=>{g&&v.current&&g.update(n,l)});const N=n[fu],y=h.useRef(!!N&&typeof window<"u"&&!((C=window.MotionHandoffIsComplete)!=null&&C.call(window,N))&&((S=window.MotionHasOptimisedAnimation)==null?void 0:S.call(window,N)));return oi(()=>{f.current=!0,g&&(v.current=!0,window.MotionIsMounted=!0,g.updateFeatures(),g.scheduleRenderMicrotask(),y.current&&g.animationState&&g.animationState.animateChanges())}),h.useEffect(()=>{g&&(!y.current&&g.animationState&&g.animationState.animateChanges(),y.current&&(queueMicrotask(()=>{var T;(T=window.MotionHandoffMarkAsComplete)==null||T.call(window,N)}),y.current=!1),g.enteringChildren=void 0)}),g}function lg(e,t,n,r){const{layoutId:s,layout:o,drag:i,dragConstraints:u,layoutScroll:l,layoutRoot:d,layoutAnchor:c,layoutCrossfade:w}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:sl(e.parent)),e.projection.setOptions({layoutId:s,layout:o,alwaysMeasureLayout:!!i||u&&ig(u),visualElement:e,animationType:typeof o=="string"?o:"both",initialPromotionConfig:r,crossfade:w,layoutScroll:l,layoutRoot:d,layoutAnchor:c})}function sl(e){if(e)return e.options.allowProjection!==!1?e.projection:sl(e.parent)}function cg(e,{forwardMotionProps:t=!1,type:n}={},r,s){const o=n?n==="svg":ia(e),i=o?rg:ng;function u(d,c){let w;const p={...h.useContext(ra),...d,layoutId:dg(d)},{isStatic:f}=p,g=Km(d),b=i(d,f);if(!f&&typeof window<"u"){wg(p,r);const v=fg(p);w=v.MeasureLayout,g.visualElement=ug(e,b,p,s,v.ProjectionNode,o)}return a.jsxs(dr.Provider,{value:g,children:[w&&g.visualElement?a.jsx(w,{visualElement:g.visualElement,...p}):null,Rm(e,d,ag(b,g.visualElement,c),b,f,t,o)]})}u.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const l=h.forwardRef(u);return l[sg]=e,l}function dg({layoutId:e}){const t=h.useContext(ai).id;return t&&e!==void 0?t+"-"+e:e}function wg(e,t){h.useContext(sa).strict,process.env.NODE_ENV}function fg(e){const t=Zu(),{drag:n,layout:r}=t;if(!n&&!r)return{};const s={...n,...r};return{MeasureLayout:n!=null&&n.isEnabled(e)||r!=null&&r.isEnabled(e)?s.MeasureLayout:void 0,ProjectionNode:s.ProjectionNode}}const pg=(e,t)=>t.isSVG??ia(e)?new Mm(t):new xm(t,{allowProjection:e!==h.Fragment});class hg extends Lt{constructor(t){super(t),t.animationState||(t.animationState=_m(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();or(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)==null||t.call(this)}}let mg=0;class gg extends Lt{constructor(){super(...arguments),this.id=mg++,this.isExitComplete=!1}update(){var o;if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;if(t&&r===!1){if(this.isExitComplete){const{initial:i,custom:u}=this.node.getProps();if(typeof i=="string"){const l=bt(this.node,i,u);if(l){const{transition:d,transitionEnd:c,...w}=l;for(const p in w)(o=this.node.getValue(p))==null||o.jump(w[p])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);this.isExitComplete=!1;return}const s=this.node.animationState.setActive("exit",!t);n&&!t&&s.then(()=>{this.isExitComplete=!0,n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const bg={animation:{Feature:hg},exit:{Feature:gg}};function al(e){return{point:{x:e.pageX,y:e.pageY}}}function ol(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const s="onHover"+n,o=r[s];o&&Fe.postRender(()=>o(t,al(t)))}class yg extends Lt{mount(){const{current:t}=this.node;t&&(this.unmount=Qh(t,(n,r)=>(ol(this.node,r,"Start"),s=>ol(this.node,s,"End"))))}unmount(){}}class vg extends Lt{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Kn(Uu(this.node.current,"focus",()=>this.onFocus()),Uu(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function il(e,t,n){const{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const s="onTap"+(n==="End"?"":n),o=r[s];o&&Fe.postRender(()=>o(t,al(t)))}class xg extends Lt{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:n,propagate:r}=this.node.props;this.unmount=rm(t,(s,o)=>(il(this.node,o,"Start"),(i,{success:u})=>il(this.node,i,u?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:(r==null?void 0:r.tap)===!1})}unmount(){}}const ua=new WeakMap,la=new WeakMap,Ng=e=>{const t=ua.get(e.target);t&&t(e)},Sg=e=>{e.forEach(Ng)};function Cg({root:e,...t}){const n=e||document;la.has(n)||la.set(n,{});const r=la.get(n),s=JSON.stringify(t);return r[s]||(r[s]=new IntersectionObserver(Sg,{root:e,...t})),r[s]}function Tg(e,t,n){const r=Cg(t);return ua.set(e,n),r.observe(e),()=>{ua.delete(e),r.unobserve(e)}}const Eg={some:0,all:1};class Mg extends Lt{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){var l;(l=this.stopObserver)==null||l.call(this);const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:s="some",once:o}=t,i={root:n?n.current:void 0,rootMargin:r,threshold:typeof s=="number"?s:Eg[s]},u=d=>{const{isIntersecting:c}=d;if(this.isInView===c||(this.isInView=c,o&&!c&&this.hasEnteredView))return;c&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",c);const{onViewportEnter:w,onViewportLeave:p}=this.node.getProps(),f=c?w:p;f&&f(d)};this.stopObserver=Tg(this.node.current,i,u)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(Ig(t,n))&&this.startObserver()}unmount(){var t;(t=this.stopObserver)==null||t.call(this),this.hasEnteredView=!1,this.isInView=!1}}function Ig({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const ul={renderer:pg,...bg,...{inView:{Feature:Mg},tap:{Feature:xg},focus:{Feature:vg},hover:{Feature:yg}}};function Ag(e,t){return cg(e,t)}const ll=Ag("div"),kg=e=>{const{checked:t,onSelect:n,children:r,disabled:s,preventCloseOnSelect:o}=e;return a.jsx(Qo,{disabled:s,checked:t,onCheckedChange:n,onSelect:i=>o&&i.preventDefault(),children:r})},wr=e=>{const{children:t,className:n,Icon:r,iconPosition:s="left",disabled:o,onSelect:i,preventCloseOnSelect:u}=e,l=m("wu-flex wu-items-center wu-gap-2",r&&(s==="left"?"":"wu-justify-between wu-flex-row-reverse"),n),d=c=>{i&&i(c),u&&c.preventDefault()};return a.jsxs(Un,{onSelect:d,disabled:o,className:l,children:[r&&a.jsx("div",{className:"wu-text-base",children:r}),t]})},Dg=e=>{const{children:t,Label:n,...r}=e;return a.jsxs(Xo,{...r,children:[a.jsx(rn,{children:n||e.label}),t]})},_g=e=>{const{options:t,value:n,onSelect:r}=e;return a.jsx(Cf,{value:n,onValueChange:r,children:t.map(s=>a.jsx(Ro,{value:s.value,disabled:s.disabled,children:s.Label||s.label},s.value))})},Pg=e=>{const{className:t,...n}=e,r=m("wu-w-11/12 wu-mx-auto wu-border-gray-40",t);return a.jsx(jn,{...n,className:r})},Wt=x.forwardRef(({className:e,children:t,thumbColor:n,railColor:r,...s},o)=>a.jsxs(lt.Root,{ref:o,className:m("wu-relative wu-overflow-hidden",e),children:[a.jsx(lt.Viewport,{className:"wu-h-full wu-w-full wu-rounded-[inherit]",...s,children:t}),a.jsx(ca,{thumbColor:n,railColor:r}),a.jsx(lt.Corner,{})]}));Wt.displayName=lt.Root.displayName;const ca=x.forwardRef(({className:e,orientation:t="vertical",thumbColor:n="#d4d4d4",railColor:r="#eeeeee",...s},o)=>a.jsx(lt.ScrollAreaScrollbar,{ref:o,orientation:t,className:m("wu-flex wu-touch-none wu-select-none wu-transition-colors",t==="vertical"&&"wu-h-full wu-w-2 wu-border-l wu-border-l-transparent wu-p-[1px]",t==="horizontal"&&"wu-h-2 wu-flex-col wu-border-t wu-border-t-transparent wu-p-[1px]",e),style:{background:r},...s,children:a.jsx(lt.ScrollAreaThumb,{className:"wu-relative wu-flex-1 wu-rounded-full",style:{background:n}})}));ca.displayName=lt.ScrollAreaScrollbar.displayName;const Vg=e=>{const{children:t,label:n,Label:r,open:s,onOpenChange:o,height:i,dir:u,...l}=e;return a.jsxs(Sf,{...l,open:s,onOpenChange:o,children:[a.jsx(Zo,{dir:u,children:r||n}),a.jsx(Nf,{children:a.jsx(Jo,{onInteractOutside:d=>d.preventDefault(),children:a.jsx(Wt,{className:"wu-h-fit",style:{height:i},dir:u,children:t})})})]})},Og="wu-p-1.5 wu-cursor-pointer hover:wu-bg-gray-20 wu-border-gray-40 wu-transition wu-duration-300 focus:wu-outline-2 focus:wu-outline-offset focus:wu-outline-blue-p/80 focus:wu-bg-gray-20 hover:wu-bg-gray-20 wu-rounded-t-sm",da=e=>{const{children:t,menuTitle:n,MenuTitle:r,variant:s="flat",name:o,open:i,onOpenChange:u,height:l,preventCloseOnClickOutside:d,dir:c,Trigger:w,align:p="start",sideOffset:f=0,side:g="bottom",alignOffset:b,className:v,disabled:N,...y}=e;return a.jsxs(Ko,{...y,open:i,onOpenChange:u,dir:c,children:[a.jsx(Yo,{asChild:!0,dir:c,disabled:N,className:m("disabled:wu-text-zinc-300 disabled:wu-bg-white disabled:wu-cursor-not-allowed disabled:hover:wu-bg-transparent"),children:w??Fg(s,o,N)}),a.jsx(fs,{className:m("wu-w-56 wu-border wu-border-blue-p disabled:wu-border-gray-40",v,"wu-menu-content"),align:p,sideOffset:f,side:g,alignOffset:b,onInteractOutside:C=>d&&C.preventDefault(),children:a.jsxs(Wt,{className:"h-fit",style:{height:l},dir:c,children:[(n||r)&&a.jsxs(a.Fragment,{children:[a.jsx(rn,{dir:c,className:"wu-menu-title",children:r||n}),a.jsx(jn,{className:"wu-mt-0 wu-menu-separator",dir:c})]}),t??a.jsx("p",{children:"Menu Is Empty"})]})})]})},Fg=(e,t,n)=>{const r=m(Og,"wu-flex wu-items-center wu-justify-between wu-gap-2 wu-h-8 wu-text-xs wu-group/wuMenu",e==="outlined"?"wu-border":"wu-border-b","wu-trigger-btn");return a.jsxs("button",{className:r,"aria-label":"menu-trigger",children:[a.jsx("span",{children:t??"Menu"}),a.jsx("span",{className:m("wm-arrow-drop-down wu-text-gray-lead wu-text-base wu-rotate-180 group-data-[state=closed]/wuMenu:wu-rotate-0 wu-transition-transform wu-duration-300 group-hover:wu-text-blue-q",n&&"wu-text-zinc-300 group-hover:wu-text-zinc-300")})]})},Lg=({titles:e,dir:t="ltr",handleTitleClick:n})=>{const[r,s]=h.useState(!1);return a.jsx(da,{className:"wu-rounded-sm",open:r,onOpenChange:s,dir:t,sideOffset:4,Trigger:a.jsx(Ae,{variant:"iconOnly",className:m("wu-w-6 wu-h-6 wu-shrink-0 wu-rounded-sm"),Icon:a.jsx("span",{className:m("wm-keyboard-arrow-down wu-text-[16px] wu-origin-center wu-transition-transform wu-duration-300",r&&(t==="rtl"?"-wu-rotate-180":"wu-rotate-180"))})}),children:e.map(o=>a.jsx(wr,{onSelect:i=>n(i,o.id),children:o.title},o.id))})},Wg=({titles:e,currentLevel:t,initial:n,handleTitleClick:r,headerClasses:s,offsetHeight:o,dir:i="ltr"})=>{const u=h.useMemo(()=>i==="rtl"?{initial:{x:8,opacity:0,zIndex:0},animate:{x:0,opacity:1,zIndex:50},exit:{x:-8,opacity:0,zIndex:0}}:{initial:{x:-8,opacity:0,zIndex:0},animate:{x:0,opacity:1,zIndex:50},exit:{x:8,opacity:0,zIndex:0}},[i]);return a.jsxs("div",{className:m("wu-absolute wu-top-0 wu-left-0 wu-flex wu-gap-x-2 wu-px-4 wu-items-center wu-origin-left wu-w-full wu-transition wu-duration-200",t!==n?"wu-translate-x-0 wu-opacity-100 wu-z-50 wu-delay-200":i==="rtl"?"wu-translate-x-1 wu-opacity-0 wu-z-0 wu-delay-0":"-wu-translate-x-1 wu-opacity-0 wu-z-0 wu-delay-0",s),style:{height:t!==n?`${o}px`:"-40px"},dir:i,children:[a.jsx(Lg,{titles:e,handleTitleClick:r,dir:i}),a.jsx("div",{className:"wu-w-full wu-relative wu-h-full wu-flex wu-items-center wu-flex-nowrap wu-whitespace-nowrap wu-text-nowrap wu-gap-2 wu-overflow-x-auto wu-no-scrollbar wu-snap-x wu-snap-mandatory wu-scroll-smooth",children:a.jsx(Qu,{features:ul,children:a.jsxs(Ku,{initial:!1,mode:"popLayout",children:[Bg(e).map((l,d)=>a.jsx(ll,{initial:u.initial,animate:u.animate,exit:u.exit,transition:{duration:.4,ease:"easeInOut"},children:a.jsxs("h6",{"data-id":l.id,onClick:r,className:m("wu-flex wu-text-sm wu-leading-4 wu-font-normal wu-items-center wu-gap-2",d===2||d===1||l.id==="LEVEL_DOTS"?"wu-cursor-default wu-text-gray-600":"wu-cursor-pointer wu-text-[#1B87E6] wu-hover:text-[#145DBF]/70"),children:[d!==0&&a.jsx("span",{className:m("wm-keyboard-arrow-right wu-text-[16px] wu-font-light wu-max-w-4 wu-flex wu-justify-center",i==="rtl"&&"wu-rotate-180")}),l.id==="LEVEL_DOTS"?a.jsx("span",{className:"wu-flex wu-justify-center wu-w-[11px]",children:l.title}):l.title]})},l.id)),"``"]})})})]})},Bg=e=>{const t=e.length;if(t>2){const n=e[0],r=e[t-1];return[n,{id:"LEVEL_DOTS",title:"..."},r]}return e},qg=({items:e,initial:t,baseTitle:n,mode:r="popLayout",headerClasses:s="",offsetHeight:o=40,variant:i="default",dir:u="ltr"})=>{const[l,d]=h.useState(n?[n]:[]),[[c,w],p]=h.useState([t,1]),f=(N,y)=>{y&&d([...l,y]),p([N,1])},g=N=>{const y=l.findIndex(C=>C.id===N);if(y!==-1){const C=l.slice(0,y+1);d(C)}p([N,-1])},b=(N,y)=>{const C=y||N.currentTarget.getAttribute("data-id")||"";if(C&&C!==c){const S=l.findIndex(T=>T.id===C);S!==-1&&(d(l.slice(0,S+1)),g(C))}},v=()=>{const N=e[c]?e[c]:null;if(!N)return a.jsx("div",{className:"wu-absolute wu-inset-0 wu-w-full wu-h-full wu-flex wu-items-center wu-justify-center",children:a.jsx("p",{className:"wu-text-gray-500",children:"No content available."})});const y=typeof N.component=="function"?N.component({goNext:f,goBack:g}):N.component;return a.jsx(ll,{dir:u,custom:w,variants:$g(i),initial:"enter",animate:"center",exit:"exit",transition:{opacity:{duration:.325,ease:"easeInOut"},scale:{duration:.275,ease:"easeInOut"}},className:"wu-w-full wu-h-full",style:{paddingTop:c!==t?`${o}px`:"0px"},children:y},c)};return a.jsxs("div",{dir:u,className:"wu-w-full wu-h-full wu-relative wu-overflow-hidden wu-flex wu-flex-col",children:[a.jsx(Wg,{titles:l,currentLevel:c,initial:t,handleTitleClick:b,headerClasses:s,offsetHeight:o,dir:u}),a.jsx(Qu,{features:ul,children:a.jsx(Ku,{initial:!1,custom:w,mode:r,children:v()})})]})},$g=e=>{switch(e){case"slideRight":return zg;case"slideLeft":return Ug;case"fadeZoom":return jg;case"default":default:return Hg}},Hg={enter:e=>({scale:e>0?.825:1.1,opacity:0,zIndex:0}),center:{scale:1,opacity:1,zIndex:1},exit:e=>({scale:e>0?1.1:.825,opacity:0,zIndex:0})},zg={enter:e=>({x:e>0?-15:15,opacity:0,zIndex:0}),center:{x:0,opacity:1,zIndex:1},exit:e=>({x:e>0?15:-15,opacity:0,zIndex:0})},Ug={enter:e=>({x:e>0?15:-15,opacity:0,zIndex:0}),center:{x:0,opacity:1,zIndex:1},exit:e=>({x:e>0?-15:15,opacity:0,zIndex:0})},jg={enter:e=>({opacity:0,zIndex:0,scale:e>0?.925:1.1}),center:{opacity:1,zIndex:1,scale:1},exit:{opacity:0,zIndex:0,scale:1}},cl=({className:e,isLoading:t,loadingText:n,children:r,...s})=>a.jsxs("footer",{className:m("wu-flex wu-items-center wu-justify-between wu-gap-2 wu-border-t wu-border-gray-10 wu-py-3 wu-px-4 wu-bg-white/80 wu-backdrop-blur-sm wu-text-xs wu-font-normal wu-text-gray-footer wu-sticky wu-bottom-0",e),...s,children:[a.jsx("div",{className:"wu-flex-1",children:r}),t&&a.jsx(dt,{size:"16px",variant:"spinner",color:"#a3a3a3",message:n})]});cl.displayName="WuFooter";const dl=h.forwardRef((e,t)=>{const{size:n="sm",idOrSlugOrUrl:r,variant:s="primary",...o}=e,i=n==="sm"?16:18,u=r.includes("http")?r:`/help/${r}.html`,l=s==="primary"?"wu-text-blue-p":"wu-text-gray-lead";return a.jsx("button",{...o,ref:t,onClick:()=>Pr(u),children:a.jsx("span",{className:m("wm-help wu-text-gray-subtle",`wu-text-[${i}px]`,l,o.disabled&&"wu-text-neutral-300","wu-help-button-icon")})})});dl.displayName="WuHelpButton";const rt=(e,t)=>`wu-listbox-${e}`;function Gg(e){const{option:t,accessorKey:n,onSelect:r,multiple:s,dir:o,GroupLabel:i,Item:u,isSelected:l,...d}=e,c=n.group&&Array.isArray(t[n.group]),w=({item:p,className:f})=>h.createElement(nn,{...d,key:JSON.stringify(p),onSelect:()=>r==null?void 0:r(p),value:t[n.value],className:m("data-[selected='true']:wu-bg-gray-100 wu-cursor-pointer wu-text-xs wu-min-h-8 wu-py-0 hover:wu-bg-gray-10",!!(l!=null&&l(p))&&!s&&"wu-bg-blue-p/10",o==="rtl"&&"wu-justify-end",f,rt("item")),disabled:p.disabled},s&&a.jsx(He,{checked:l==null?void 0:l(p)}),u?u({value:p,isSelected:l==null?void 0:l(p)}):a.jsx(a.Fragment,{children:p[n.label]}));if(c){const p=t[n.group],f=typeof i=="string"?t[i]:i==null?void 0:i(t);return a.jsx(tn,{heading:f,children:p==null?void 0:p.map(g=>a.jsx(w,{item:g,className:"wu-pl-6"},JSON.stringify(g)))})}return a.jsx(w,{item:t})}const Kg=h.memo(Gg),Yg=e=>{const{className:t,...n}=e;return a.jsxs("div",{className:"wu-relative",children:[a.jsx(Pe,{icon:"wm-search",className:"wu-absolute wu-top-[14px] wu-left-5"}),a.jsx(jo,{...n,"aria-label":"Search",className:m("wu-bg-gray-10 wu-border-b wu-border-gray-subtle wu-rounded-none wu-rounded-t-sm wu-h-8 wu-my-2 wu-pl-8","focus:wu-border-blue-p focus-visible:wu-outline-none;",rt("input"),t)})]})},Xg=e=>{const{label:t,onSelectAll:n,data:r,value:s}=e,[o,i]=h.useState(!1),[u,l]=h.useState(!1);return h.useEffect(()=>{!s||!r||(i(s.length>0),l(s.length>0&&s.length<r.length))},[r,s]),a.jsxs(nn,{className:"data-[selected='true']:wu-bg-gray-100 wu-cursor-pointer wu-text-xs wu-min-h-8 wu-py-0 hover:wu-bg-gray-100",onSelect:()=>n==null?void 0:n(!o),children:[a.jsx(He,{checked:o,partial:u}),t||"Select All"]})},Zg=e=>{const{CustomTrigger:t,disabled:n,value:r,placeholder:s,accessorKey:o,Chip:i,handleUnselect:u,variant:l,dir:d,className:c,...w}=e,[p,f]=h.useState(),g=h.useRef(null);return h.useEffect(()=>{if(!r){f(null);return}f(Array.isArray(r)?i?r.map((v,N)=>i({value:v,unselect:u,key:N})):r.map(v=>v[o.label]).join(", "):i?i({value:r,unselect:u}):r[o.label])},[r,i,o.label,f]),a.jsx(wt,{asChild:!0,id:e.id,disabled:n,ref:g,children:(t==null?void 0:t(r))||a.jsxs("button",{...w,className:m("wu-group/wuListbox wu-relative wu-min-h-8 wu-text-xs wu-border-gray-subtle wu-bg-gray-10 wu-p-1 wu-pl-2 rtl:wu-pr-2 wu-border-b wu-w-full wu-text-left wu-pr-5 rtl:wu-pl-5","hover:wu-border-blue-p","disabled:wu-cursor-not-allowed disabled:wu-bg-gray-20 disabled:wu-border-gray-40 disabled:wu-text-gray-subtle","rtl:wu-text-right",l==="outlined"&&"wu-border wu-border-gray-subtle wu-bg-white",c,rt("trigger")),children:[a.jsx("div",{className:m("wu-truncate",i&&"wu-flex wu-items-center wu-gap-1 wu-flex-wrap",!p&&"wu-font-light"),children:p||s}),a.jsx(Pe,{icon:"wm-arrow-drop-down",className:m("wu-absolute wu-top-1 wm-arrow-drop-down group-data-[state=open]/wuListbox:wu-rotate-180 wu-transition-transform wu-duration-300 wu-text-base",d==="rtl"?"wu-left-1":"wu-right-1",rt("drop-icon"))})]})})},wl=(e,t,n)=>{const r=String(e[n.label]??"").toLowerCase(),s=String(e[n.value]??"").toLowerCase();return r.includes(t)||s.includes(t)},Jg=(e,t,n)=>{const r=t.trim();if(r==="")return e;const s=r.toLowerCase(),o=[];for(const i of e){const u=n.group,l=u?i[u]:void 0;if(Array.isArray(l)){const d=l.filter(c=>wl(c,s,n));d.length>0&&o.push({...i,[u]:d})}else wl(i,s,n)&&o.push(i)}return o},fl=e=>{const{data:t,accessorKey:n,value:r,Item:s,Label:o,GroupLabel:i,CustomHeader:u,CustomTrigger:l,NoDataContent:d,Chip:c,onSelect:w,onScroll:p,disabled:f,multiple:g,searchable:b,selectAll:v,virtualizedThreshold:N=100,showGroupSeparator:y,id:C,dir:S,className:T,listClass:D,placeholder:A="Select items...",variant:k,labelPosition:M="top",maxContentWidth:_,maxContentHeight:P,modal:E,...V}=e,[L,O]=h.useState(!1),[W,q]=h.useState(""),[$,G]=h.useState(r),Z=h.useMemo(()=>n,[n]),H=h.useMemo(()=>{if(!b||!W)return t;const F=W.toLowerCase().trim();return Jg(t,F,n)},[t,W,n.label,b]),J=F=>{g?G(z=>{const Y=F[n.value],K=Array.isArray(z)?z:[],j=K.some(ee=>ee[n.value]===Y)?K.filter(ee=>ee[n.value]!==Y):[...K,F];return w&&w(j),j}):(G(F),w&&w(F),O(!1))},ie=h.useCallback(F=>{const z=F?t:[];G(z),v!=null&&v.onSelectAll&&v.onSelectAll(F),w&&w(z)},[t,v,w]),fe=F=>Array.isArray($)?$.some(z=>z[n.value]===F[n.value]):($==null?void 0:$[n.value])===F[n.value];h.useEffect(()=>{G(r)},[r]);const Se=F=>{const z=(Y,K)=>{const me=n.group&&Array.isArray(Y[n.group]),j=y&&me&&K>0&&F.length>1;return a.jsxs(h.Fragment,{children:[j&&a.jsx(ws,{}),a.jsx(Kg,{option:Y,accessorKey:Z,multiple:g,onSelect:ee=>J(ee),dir:S,GroupLabel:i,Item:s,isSelected:ee=>fe(ee)})]},JSON.stringify(Y))};return F.length>N?a.jsx(It,{list:F,callback:(Y,K)=>z(K,Y),dir:S}):F.map((Y,K)=>z(Y,K))};return a.jsxs("div",{className:m("wu-flex wu-text-sm wu-gap-2",M==="top"&&"wu-flex-col wu-gap-1",M==="left"&&"wu-flex-row",M==="right"&&"wu-flex-row-reverse",rt("container")),dir:S,children:[o&&a.jsx(ke,{htmlFor:C,className:rt("label"),children:o}),a.jsxs(Ge,{open:L,onOpenChange:F=>{O(F),F||setTimeout(()=>{q("")},100)},modal:E,children:[a.jsx(Zg,{CustomTrigger:l,disabled:f,value:$,accessorKey:n,placeholder:A,Chip:c,className:T,handleUnselect:J,variant:k,id:C,dir:S,...V}),a.jsx($e,{className:m("wu-min-w-[--radix-popover-trigger-width] wu-max-w-[calc(100vw-32px)] wu-w-auto wu-p-0 wu-bg-white wu-border wu-border-blue-p",rt("content")),align:"start",sideOffset:-1,style:{maxWidth:_},children:a.jsxs(ls,{id:e.id,shouldFilter:!1,children:[b&&a.jsx(Yg,{value:W,onValueChange:q}),u,a.jsxs(cs,{className:m("wu-overflow-y-auto",rt("list"),D),onScroll:p,style:{maxHeight:P||"420px"},children:[a.jsx(ds,{children:d||"No results found."}),a.jsx(tn,{children:g&&(v==null?void 0:v.enabled)&&!W&&a.jsx(Xg,{data:t,value:$,onSelectAll:ie,label:v.label})}),a.jsx(tn,{children:Se(H)})]})]})})]})]})},wa=h.forwardRef(({showMenu:e=!1,className:t,color:n="#1B3380",...r},s)=>{const o=m("wu-w-full wu-border wu-transition-all wu-duration-300");return a.jsxs("div",{...r,className:m("wu-flex wu-flex-col wu-w-[18px] wu-justify-between wu-aspect-[3/2] wu-transition-all wu-duration-300",t),ref:s,"aria-label":"menu-icon",children:[a.jsx("div",{className:`${o} wu-origin-center ${e?"wu-rotate-45 wu-translate-y-[5px]":""}`,style:{borderColor:n}}),a.jsx("div",{className:`${o} ${e?"wu-opacity-0":""}`,style:{borderColor:n}}),a.jsx("div",{className:`${o} wu-origin-center ${e?"-wu-rotate-45 -wu-translate-y-[5px]":""}`,style:{borderColor:n}})]})});wa.displayName="WuMenuIcon";const pl={overlay:"data-[state=open]:wu-animate-in data-[state=closed]:wu-animate-out data-[state=closed]:wu-fade-out-0 data-[state=open]:wu-fade-in-0",content:"data-[state=open]:wu-animate-in data-[state=closed]:wu-animate-out data-[state=closed]:wu-fade-out-0 data-[state=open]:wu-fade-in-0 data-[state=closed]:wu-zoom-out-95 data-[state=open]:wu-zoom-in-95 data-[state=closed]:wu-slide-out-to-left-1/2 data-[state=closed]:wu-slide-out-to-top-[48%] data-[state=open]:wu-slide-in-from-left-1/2 data-[state=open]:wu-slide-in-from-top-[48%]"},hl=te.Root,ml=te.Trigger,Qg=te.Portal,Rg=te.Close,gl=h.forwardRef(({className:e,...t},n)=>a.jsx(te.Overlay,{ref:n,className:m("wu-fixed wu-inset-0 wu-z-50 wu-bg-black/30",pl.overlay,e),...t}));gl.displayName=te.Overlay.displayName;const fa=h.forwardRef(({className:e,children:t,hideCloseButton:n,isStackedCard:r,...s},o)=>a.jsxs(Qg,{children:[a.jsx(gl,{className:r?"wu-bg-transparent":""}),a.jsxs(te.Content,{ref:o,className:m("wu-fixed wu-left-[50%] wu-z-50 wu-top-[50%] wu-flex wu-flex-col wu-w-full wu-max-w-lg wu-translate-x-[-50%] wu-translate-y-[-50%] wu-bg-white wu-shadow-lg wu-duration-200",pl.content,e),...s,children:[t,!n&&a.jsx(te.Close,{"aria-label":"close",asChild:!0,children:a.jsxs(Et,{variant:"iconOnly",className:m("wu-absolute wu-right-2 wu-top-1 hover:wu-bg-black/[0.08] wu-w-8 wu-h-8 wu-p-0","wu-top-3 wu-right-4","group-data-[variant=action]:wu-text-blue-q","group-data-[variant=upgrade]:wu-text-yellow-deep","group-data-[variant=critical]:wu-text-red-deep"),children:[a.jsx("span",{className:"wm-close wu-leading-5"}),a.jsx("span",{className:"wu-sr-only",children:"Close"})]})})]})]}));fa.displayName=te.Content.displayName;const pa=({className:e,...t})=>a.jsx("div",{className:m("wu-text-center wu-bg-gray-20 wu-w-full",e),...t});pa.displayName="DialogHeader";const bl=({className:e,...t})=>a.jsx("div",{className:m("wu-flex wu-flex-col-reverse sm:wu-flex-row sm:wu-justify-end sm:wu-space-x-2 wu-p-4",e),...t});bl.displayName="DialogFooter";const ha=h.forwardRef(({className:e,...t},n)=>a.jsx(te.Title,{ref:n,className:m("wu-text-lg wu-font-medium wu-flex wu-items-center wu-justify-center wu-gap-1 wu-h-10 wu-leading-none wu-tracking-tight",e),...t}));ha.displayName=te.Title.displayName;const eb=h.forwardRef(({className:e,...t},n)=>a.jsx(te.Description,{ref:n,className:m("wu-text-sm wu-text-muted-foreground",e),...t}));eb.displayName=te.Description.displayName;const tb={gradientBackground:"_gradientBackground_1uc4j_1"},yl=e=>{const{colors:t,size:n=.55,children:r,className:s,strokeWidth:o,centerOffset:i={x:0,y:0},...u}=e,l=h.useRef(null);return h.useEffect(()=>{const d=l.current;if(d){d.style.setProperty("--width",`${d.offsetWidth*n}px`),d.style.setProperty("--height",`${d.offsetHeight*n}px`),d.style.setProperty("--colors",t.join(",")),d.style.setProperty("--stroke-width",`-${o||2}px`),d.style.setProperty("--spotlight-background","radial-gradient(100% var(--height) ellipse at 25% 70%, var(--colors))");let w;const p=f=>{w&&cancelAnimationFrame(w),w=requestAnimationFrame(()=>{const g=d.getBoundingClientRect();let b=f.clientX-g.left,v=f.clientY-g.top;b=Math.max(0,Math.min(b+i.x,g.width)),v=Math.max(0,Math.min(v+i.y,g.height));const N=`radial-gradient(
|
|
16
16
|
var(--width) var(--height) ellipse at ${b}px ${v}px,
|
|
17
17
|
var(--colors)
|
|
18
18
|
)`;d.style.setProperty("--spotlight-background",N)})};return window.addEventListener("mousemove",p),()=>{window.removeEventListener("mousemove",p),w&&cancelAnimationFrame(w)}}},[t,n,o,i]),a.jsx("div",{ref:l,className:m(tb.gradientBackground,"wu-transform-gpu",s),...u,children:r})},fr={wuModalBodyWrapper:"_wuModalBodyWrapper_uaelx_1","wu-modal-footer":"_wu-modal-footer_uaelx_5","wu-modal-content":"_wu-modal-content_uaelx_5","wu-modal-header":"_wu-modal-header_uaelx_9"},vl="calc(100vh - 64px)",nb={sm:"400px",md:"600px",lg:"1200px"},rb=({Trigger:e,children:t,size:n="md",hideCloseButton:r,preventClickOutside:s,onOpenChange:o,open:i,dir:u,maxWidth:l,maxHeight:d,className:c,style:w,variant:p="action",...f})=>{const g={action:["#EEF3FBcc 32%","#1D50F4cc"],upgrade:["#FDEDCCcc 32%","#FF9F00cc"],critical:["#FFB6B6cc 32%","#CC0000cc"]};return a.jsxs(hl,{modal:!0,onOpenChange:o,open:i,children:[e&&a.jsx(ml,{asChild:!0,children:e}),a.jsx(fa,{style:{width:"calc(100% - 64px)",maxWidth:l||nb[n],maxHeight:d||vl,...w},hideCloseButton:r,onInteractOutside:b=>s&&b.preventDefault(),dir:u,"aria-describedby":void 0,"data-variant":p,className:m("wu-group wu-rounded-[.88rem]",fr.wuModalBodyWrapper,c),...f,children:a.jsx(yl,{colors:g[p],strokeWidth:4,className:m("wu-rounded-[1.1rem] wu-transform-gpu wu-flex wu-flex-col",c),style:{maxHeight:d||vl},children:t})})]})},sb=({children:e,className:t,...n})=>a.jsx("div",{className:m("wu-flex wu-flex-col wu-gap-4 wu-p-4 rtl:wu-text-right wu-overflow-auto wu-bg-white","wu-p-8 wu-text-gray-lead",fr["wu-modal-content"],t),...n,children:e}),ab=({children:e,className:t,...n})=>a.jsx(pa,{...n,"data-variant":"action",className:m("wu-text-lg wu-text-gray-lead wu-font-medium","wu-rounded-t-[.88rem] wu-px-4","group-data-[variant=action]:wu-bg-blue-sidebar group-data-[variant=action]:wu-text-blue-q","group-data-[variant=critical]:wu-bg-[#F9E0E0] group-data-[variant=critical]:wu-text-red-deep","group-data-[variant=upgrade]:wu-bg-[#FEF1D9] group-data-[variant=upgrade]:wu-text-yellow-deep",fr["wu-modal-header"],t),children:a.jsx(ha,{className:"wu-font-normal wu-justify-start wu-text-2xl wu-h-14",children:e})}),ob=({children:e,className:t,...n})=>a.jsx(bl,{...n,className:m("wu-border-t wu-border-gray-40 wu-bg-white wu-min-h-16 wu-mx-4 wu-px-0","wu-mx-0 wu-rounded-b-[.88rem] wu-min-h-16 wu-p-4","group-data-[variant=upgrade]:wu-border-[#EED6A8]","group-data-[variant=action]:wu-border-[#BAC9F8]","group-data-[variant=critical]:wu-border-[#F0B3B3]",fr["wu-modal-footer"],t),children:e}),ib=({children:e,className:t,...n})=>{const r=h.useRef(null);return a.jsx(Rg,{asChild:!0,children:a.jsx(Ae,{className:t,ref:r,...n,children:e})})},ub=({placeholder:e="Select...",value:t,multiple:n=!1,accessorKey:r,variant:s="flat",dir:o="ltr",customTriggerChildren:i,id:u,disabled:l,selectAll:d,isCheckedAll:c,width:w,...p})=>{const[f,g]=h.useState(""),[b,v]=h.useState(e);h.useEffect(()=>{if(!t||Array.isArray(t)&&t.length===0){v(e),g("");return}const y=r.label;if(n&&Array.isArray(t)){const C=t.map(S=>S[y]).join(", ");g(C)}else!n&&!Array.isArray(t)&&g(t[y])},[t,r.label,n,e]);const N=()=>e&&!f?a.jsx("p",{className:"wu-text-xs wu-opacity-70",children:b}):a.jsx("span",{className:m("wu-overflow-hidden wu-text-xs wu-text-start wu-text-ellipsis wu-whitespace-nowrap"),style:{width:`${(w||0)-32}px`},children:c?(d==null?void 0:d.triggerText)??f:f});return a.jsx(Yo,{asChild:!0,dir:o,id:u,disabled:l,children:a.jsxs("button",{...p,disabled:l,className:m("wu-flex wu-gap-2 wu-w-full wu-items-center wu-justify-between wu-py-1.5 wu-px-2 wu-text-xs wu-transition-colors wu-cursor-pointer wu-border-b wu-bg-white wu-border-gray-subtle wu-h-8","focus:wu-outline-none focus-visible:wu-border-blue-p/80 wu-rounded-t-sm","disabled:wu-cursor-not-allowed disabled:hover:wu-border-gray-subtle disabled:wu-bg-gray-10 disabled:wu-opacity-50","hover:wu-bg-gray-10 hover:wu-border-blue-p",s==="outlined"&&"wu-border wu-border-gray-subtle","wu-group/wuSelect wu-select-trigger",p.className),children:[i??N(),a.jsx("span",{className:"wm-arrow-drop-down group-data-[state=open]/wuSelect:wu-rotate-180 wu-transition-transform wu-duration-300 wu-text-base"})]})})},xl=({option:e,value:t,multiple:n=!1,onSelect:r,accessorKey:s,dir:o="ltr"})=>{const[i,u]=h.useState(n?[]:"");h.useEffect(()=>{t&&u(n?t.map(w=>JSON.stringify(w[s.value])):JSON.stringify(t[s.value]))},[t,s.value,n]);const l=n?i.includes(JSON.stringify(e[s.value])):i===JSON.stringify(e[s.value]),d=c=>{e.disabled||(r(e),n&&c.preventDefault())};return a.jsxs(Un,{onClick:d,disabled:e.disabled,className:m("wu-cursor-pointer wu-text-xs wu-py-2 wu-leading-4 wu-select-item wu-items-start",l&&"wu-bg-gray-10"),dir:o,children:[n&&a.jsx(He,{checked:l}),a.jsx(Nl,{option:e,accessorKey:s})]})},Nl=({option:e,accessorKey:t})=>{const n=String(e[t.label]);return a.jsxs("div",{className:"wu-flex wu-items-center wu-w-full wu-gap-1 wu-text-xs wu-pl-2",children:[e.icon,n,e.isAdmin&&a.jsx("span",{className:"wu-ml-auto wm-lock wu-text-sm wu-text-orange-deep"})]})},Sl=e=>{const{option:t,handleSelectAll:n,isCheckedAll:r,isPartialSelected:s,...o}=e;switch("type"in t?t.type:"option"){case"all":return a.jsxs(Un,{onSelect:u=>{u.stopPropagation(),u.preventDefault(),n==null||n()},className:m("wu-cursor-pointer wu-text-xs wu-py-2 wu-leading-4 wu-select-item"),dir:o.dir,children:[a.jsx(He,{"data-partial":s,checked:r||s,partial:s}),a.jsx(Nl,{option:t,accessorKey:o.accessorKey})]});case"group":return a.jsxs(Xo,{dir:o.dir,children:[a.jsx(rn,{className:"wu-text-xs",children:t.label}),t.options.map((u,l)=>h.createElement(xl,{...o,option:u,key:l}))]});case"divider":return a.jsx(jn,{className:"wu-mx-4"});default:return a.jsx(xl,{...o,option:t})}},lb=e=>{let t=0,n=0;const r=[],s=[],o=i=>{i.type==="divider"?t++:i.type==="group"?(n++,i.options.forEach(u=>{o(u)})):(r.push(i),i.disabled||s.push(i))};return e.forEach(i=>{o(i)}),{separators:t,groups:n,enabledOptions:s,totalData:r.length,cleanData:r}},cb=100,db=400,Cl=({data:e,onSelect:t,multiple:n=!1,defaultValue:r,value:s,accessorKey:o,variant:i="flat",dir:u="ltr",placeholder:l,Label:d,virtualizedThreshold:c=cb,maxHeight:w=db,hasGroup:p=!1,Header:f,CustomTrigger:g,selectAll:b,disabled:v,labelPosition:N="top",onScroll:y,maxContentWidth:C,selectedToTop:S=!1,...T})=>{const[D,A]=h.useState(),k=h.useRef(null),[M,_]=h.useState(!1),[P,E]=h.useState(!1),{cleanData:V,enabledOptions:L}=lb(e),O=h.useMemo(()=>n&&b!=null&&b.enable&&e.length>0?[{type:"all",[o.label]:b.label||"Select All"},...e]:e,[e,b,n]),W=h.useCallback(H=>{const J=H[o.value];if(n)A((ie=[])=>{const fe=ie,F=fe.some(z=>z[o.value]===J)?fe.filter(z=>z[o.value]!==J):[...fe,H];return t==null||t(F),F});else{const ie=H;A(ie),t==null||t(ie)}},[n,o.value,t]);h.useEffect(()=>{if(r&&s){console.error("defaultValue and value cannot be used simultaneously");return}!r&&!s&&A(void 0),r!==void 0&&A(r),s!==void 0&&A(s)},[r,s]);const q=Go(S,O,D,o),$=q.length>c;h.useEffect(()=>{if(!n)return;const H=b!=null&&b.includeDisabled?(D==null?void 0:D.length)===e.length:(D==null?void 0:D.length)===L.length;_(H);const J=(D==null?void 0:D.length)>0&&!H;E(J)},[D,b]);const G=h.useCallback(()=>{const H=M?[]:b!=null&&b.includeDisabled?p?V:e:L;A(H),t==null||t(H)},[M,n,e,L,t,b]),Z=kn(N);return a.jsxs("div",{className:m(Z,"wu-flex wu-select-container"),ref:k,dir:u,children:[a.jsxs(Ko,{children:[a.jsx(ub,{...T,value:D,multiple:n,variant:i,dir:u,placeholder:l,accessorKey:o,customTriggerChildren:g,id:T.id,disabled:v,selectAll:b,isCheckedAll:M}),a.jsxs(fs,{className:"wu-min-w-[--radix-dropdown-menu-trigger-width] wu-max-w-[calc(100vw-32px)] wu-border-blue-p wu-select-content",role:"listbox",sideOffset:-1,align:"start",id:T.id,style:{maxWidth:C},children:[f,$?a.jsx(It,{list:q,containerHeight:w,callback:(H,J)=>a.jsx(Sl,{option:J,accessorKey:o,multiple:n,onSelect:W,value:D,dir:u,handleSelectAll:G,isCheckedAll:M,isPartialSelected:P}),dir:u}):a.jsx("div",{onScroll:y,style:{maxHeight:w,height:"fit-content",overflow:"auto"},className:"wu-select-list",children:q.map(H=>{const J=H,ie=String(J[o.value]??J.type);return a.jsx(Sl,{option:J,accessorKey:o,multiple:n,onSelect:W,value:D,handleSelectAll:G,isCheckedAll:M,dir:u,isPartialSelected:P},ie)})})]})]}),d&&a.jsx(ke,{htmlFor:T.id,className:"wu-select-label",children:d})]})},pr=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wb=({value:e,onChange:t,min:n=U.sub(new Date,{years:5}),max:r=U.add(new Date,{years:1}),placeholder:s="Select a month",Label:o,labelPosition:i="top",disabled:u,id:l,readonly:d,disabledMonths:c=[],...w})=>{const[p,f]=h.useState(null),[g,b]=h.useState(""),[v,N]=h.useState({value:Math.min(new Date().getFullYear(),new Date(r).getFullYear()),label:Math.min(new Date().getFullYear(),new Date(r).getFullYear())}),y=h.useMemo(()=>{const S=new Date(n).getFullYear(),T=new Date(r).getFullYear();return Array.from({length:T-S+1},(D,A)=>({value:T-A,label:T-A}))},[n,r]);h.useEffect(()=>{if(e){const S=new Date(e),T=S.getFullYear(),D=S.getMonth();f({year:T,month:D}),b(`${pr[D]} ${T}`),N({value:T,label:T})}},[e]);const C=()=>{p&&t&&(t(new Date(p.year,p.month,15)),b(`${pr[p.month]} ${p.year}`))};return a.jsxs("div",{className:m("wu-flex wu-flex-col wu-items-center",kn(i),i==="top"&&"wu-items-start"),children:[a.jsxs(Ge,{children:[a.jsx(Gr,{...w,disabled:u||d,id:l,dir:"ltr",placeholder:s,formattedString:g}),a.jsxs($e,{className:"wu-flex wu-flex-col wu-gap-4 wu-p-4 wu-bg-white wu-border-blue-p wu-month-picker-content",align:"start",sideOffset:-1,children:[a.jsx("div",{className:"wu-px-1 wu-mx-auto wu-w-full",children:a.jsx(Cl,{data:y,accessorKey:{value:"value",label:"label"},value:v,onSelect:S=>N(S),multiple:!1,maxHeight:224})}),a.jsx(fb,{year:v==null?void 0:v.value,selectedMonth:p==null?void 0:p.month,selectedYear:p==null?void 0:p.year,onClick:(S,T)=>f({year:T,month:S}),disabledMonths:c}),a.jsx("div",{className:"wu-flex wu-justify-end wu-px-0.5",children:a.jsx(Ht.PopoverClose,{asChild:!0,children:a.jsx(Ae,{onClick:C,children:"Apply"})})})]})]}),o&&a.jsx(ke,{className:"wu-truncate wu-max-w-[120px] wu-min-w-fit wu-select-label",children:o})]})},fb=({year:e,selectedMonth:t,selectedYear:n,onClick:r,disabledMonths:s=[]})=>{const o=new Date,i=o.getFullYear(),u=o.getMonth(),l=h.useMemo(()=>{const d=new Set;return s.forEach(c=>{const w=typeof c=="string"?new Date(c):c;d.add(`${w.getFullYear()}-${w.getMonth()}`)}),d},[s]);return a.jsx("div",{className:"wu-grid wu-grid-cols-3 wu-grid-rows-4 wu-w-fit wu-gap-[1px] wu-bg-[#d9d9d9] wu-border wu-border-[#d9d9d9] wu-month-picker-grid",children:pr.map((d,c)=>{const w=e===i&&c===u,p=t===c&&n===e;return a.jsx("button",{disabled:l.has(`${e}-${c}`),onClick:()=>r(c,e),className:m("wu-bg-white wu-flex wu-items-center wu-justify-center wu-w-[83px] wu-h-[53px] wu-text-xs wu-transition-colors","hover:wu-bg-gray-25 hover:wu-text-blue-q hover:wu-font-medium","focus:wu-outline-none focus-visible:wu-border focus-visible:wu-border-blue-p/50",w&&"wu-border wu-border-blue-p",p&&"wu-bg-blue-p wu-text-white hover:wu-bg-blue-p/80 hover:wu-text-white wu-font-medium","disabled:wu-bg-gray-20 disabled:wu-text-gray-subtle disabled:hover:wu-bg-gray-20 disabled:hover:wu-text-gray-subtle disabled:hover:wu-font-normal","wu-month-picker-month"),"data-value":`${pr[c]} ${e}`,"data-month":c,"data-year":e,children:d},d)})})},Tl=(e,t,n,r=96)=>{if(e.length===0||r<=0)return[[],[]];const[o,i]=h.useState([]),[u,l]=h.useState([]);return h.useEffect(()=>{const d=()=>{var g,b;const c=((g=t.current)==null?void 0:g.clientWidth)||0,w=((b=n.current)==null?void 0:b.clientWidth)||0,p=c-w,f=Math.floor(p/r);i(e.slice(0,f)),l(e.slice(f))};return d(),window.addEventListener("resize",d),()=>{window.removeEventListener("resize",d)}},[e,r]),[o,u]},El={wuPrimaryLink:"_wuPrimaryLink_1sy3v_1",wuPrimaryPopoverContent:"_wuPrimaryPopoverContent_1sy3v_8"},pb=e=>{const{Links:t,children:n,className:r,...s}=e,o=h.useMemo(()=>t.map((c,w)=>h.cloneElement(c,{className:m(El.wuPrimaryLink,c.props.className,"wu-primary-nav-link"),key:w})),[t]),i=h.useRef(null),u=h.useRef(null),[l,d]=Tl(o,i,u);return a.jsx(a.Fragment,{children:a.jsxs("header",{className:m("wu-flex wu-items-center wu-justify-between wu-gap-4 wu-px-2 wu-py-1 wu-bg-white wu-border-b",r),...s,ref:i,children:[a.jsxs("div",{className:"wu-flex wu-items-center wu-gap-2",children:[a.jsx("nav",{className:"wu-flex wu-items-center wu-justify-start wu-gap-4 wu-primary-nav-left",children:l}),d.length>0&&a.jsxs(Ge,{children:[a.jsx(wt,{className:"wu-p-1 wu-pb-0 wu-rounded-sm focus:wu-outline-none focus:wu-bg-gray-25","aria-label":"more",children:a.jsx("span",{className:"wm-more-vert"})}),a.jsx($e,{className:m(El.wuPrimaryPopoverContent,"wu-primary-nav-popover-left"),align:"start",sideOffset:12,children:d})]})]}),n&&a.jsxs(a.Fragment,{children:[a.jsx("section",{className:"wu-items-center wu-justify-end wu-hidden wu-gap-4 sm:wu-flex wu-primary-nav-right",ref:u,children:n}),a.jsxs(Ge,{children:[a.jsx(wt,{className:"sm:wu-hidden",children:a.jsx("span",{className:"wu-text-lg wm-menu"})}),a.jsx($e,{className:"wu-bg-white wu-border wu-border-blue-p wu-w-fit wu-primary-nav-popover-right",align:"end",sideOffset:4,children:n})]})]})]})})},ma={wuSecondaryLink:"_wuSecondaryLink_1edl1_1",wuSecondaryNav:"_wuSecondaryNav_1edl1_6"},hb=e=>{const{Links:t,children:n,className:r,...s}=e,o=h.useMemo(()=>t.map((w,p)=>h.cloneElement(w.link,{key:p,className:m(ma.wuSecondaryLink,w.link.props.className,"wu-secondary-nav-link-container"),children:a.jsxs(a.Fragment,{children:[h.cloneElement(w.imgOrIcon,{className:m("wu-w-5 wu-h-5 wu-flex wu-items-center wu-justify-center wu-text-lg wu-leading-5",w.imgOrIcon.props.className)}),a.jsx("div",{className:"wu-secondary-nav-link",children:w.link.props.children})]})})),[t]),i=h.useRef(null),u=h.useRef(null),l=h.useRef(null),[d,c]=Tl(o,i,l);return a.jsx(a.Fragment,{children:a.jsxs("header",{className:m("wu-flex wu-items-center wu-justify-between wu-gap-4 wu-border-y wu-border-gray-25 wu-h-[50px]",r),...s,ref:i,children:[a.jsxs("div",{className:"wu-flex wu-items-center wu-justify-start wu-gap-2",children:[a.jsx("nav",{className:m(ma.wuSecondaryNav,"wu-flex wu-items-center wu-justify-start wu-w-full wu-h-full wu-secondary-nav-left"),ref:u,children:d}),c.length>0&&a.jsxs(Ge,{children:[a.jsx(wt,{className:"wu-p-1 wu-pb-0 wu-rounded-sm focus:wu-outline-none focus:wu-bg-gray-25","aria-label":"more",children:a.jsx("span",{className:"wm-more-vert"})}),a.jsx($e,{className:m(ma.wuSecondaryNavPopover,"wu-secondary-nav-popover-left"),align:"start",sideOffset:12,children:c})]})]}),n&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"wu-items-center wu-justify-end wu-hidden sm:wu-flex",ref:l,children:n}),a.jsxs(Ge,{children:[a.jsx(wt,{className:"sm:wu-hidden",children:a.jsx("span",{className:"wu-text-lg wm-menu"})}),a.jsx($e,{className:"wu-bg-white wu-border wu-border-blue-p wu-w-fit wu-secondary-nav-popover-right",align:"end",sideOffset:12,children:n})]})]})]})})},Ml=h.forwardRef(({totalRows:e,initialPage:t=0,initialPageSize:n=100,onPageChange:r,className:s,disabled:o=!1,...i},u)=>{const[l,d]=h.useState(t),[c,w]=h.useState(n);h.useEffect(()=>{d(t),w(n)},[t,n]);const p=Math.ceil(e/c),f=l*c+1,g=Math.min((l+1)*c,e),b=Array.from({length:p},(y,C)=>C),v=h.useCallback(y=>{y>=0&&y<p&&(d(y),r==null||r(y))},[p,r]),N=224;return a.jsxs("div",{className:m("wu-flex wu-items-center wu-gap-[2px]",s,"wu-pagination"),...i,role:"navigation",children:[a.jsx(Il,{label:"Previous page",onClick:()=>v(l-1),disabled:l===0||o,icon:"wm-arrow-back-ios-new",className:"hover:wu-bg-gray-20 rtl:wu-rotate-180 wu-prev-btn"}),a.jsx(da,{name:`${f} - ${g}`,className:"wu-w-[96px] wu-min-w-[96px] wu-pagination-menu",align:"end",disabled:o,children:a.jsx(Wt,{style:{maxHeight:N+"px"},dir:i.dir,children:b.length>100?a.jsx(It,{className:"wu-pagination-list",containerHeight:N,list:b,callback:(y,C)=>a.jsxs(wr,{onSelect:()=>v(C),className:m("wu-py-2",C===l&&"wu-bg-gray-20","wu-pagination-item"),children:[C*c+1," -"," ",Math.min((C+1)*c,e)]},y)}):b.map(y=>a.jsxs(wr,{onSelect:()=>v(y),className:m(y===l&&"wu-bg-gray-20","wu-py-2 hover:wu-bg-gray-20","wu-pagination-item"),children:[y*c+1," -"," ",Math.min((y+1)*c,e)]},y))})}),a.jsx(Il,{label:"Next page",onClick:()=>v(l+1),disabled:l===p-1||o,icon:"wm-arrow-forward-ios",className:"hover:wu-bg-gray-20 rtl:wu-rotate-180 wu-next-btn"})]})});Ml.displayName="WuPagination";const Il=({label:e,onClick:t,disabled:n,icon:r,className:s})=>a.jsx(Ae,{variant:"iconOnly",onClick:t,disabled:n,className:m("wu-w-8 wu-h-8 wu-rounded-xs wu-group disabled:wu-text-zinc-300 disabled:wu-bg-white wu-text-gray-lead focus:wu-bg-color-none",s),"aria-label":e,children:a.jsx("span",{className:m("wu-text-sm",r)})}),Al=x.forwardRef(({className:e,...t},n)=>a.jsx(jt.Root,{className:m("wu-grid wu-gap-2",e),...t,ref:n}));Al.displayName=jt.Root.displayName;const kl=x.forwardRef(({className:e,...t},n)=>a.jsx(jt.Item,{ref:n,className:m("wu-group wu-aspect-square wu-h-4 wu-w-4 wu-rounded-full wu-border wu-border-gray-subtle wu-text-blue-p wu-ring-offset-white disabled:wu-cursor-not-allowed disabled:wu-opacity-50 hover:wu-border-blue-p hover:wu-bg-gray-20 data-[state=checked]:wu-border-blue-p hover:data-[state=checked]:wu-border-blue-q hover:data-[state=checked]:wu-bg-inherit focus:wu-outline-2 focus:wu-outline-offset-4 focus:wu-outline-blue-soft disabled:hover:wu-border-gray-subtle disabled:wu-hover:bg-gray-20 disabled:wu-bg-gray-20",e),...t,children:a.jsx(jt.Indicator,{className:"wu-flex wu-items-center wu-justify-center",children:a.jsx("div",{className:"wu-w-2 wu-h-2 wu-rounded-full wu-bg-blue-p group-hover:group-data-[state=checked]:wu-bg-blue-q"})})}));kl.displayName=jt.Item.displayName;const Dl=h.forwardRef((e,t)=>{const{options:n,defaultValue:r,onChange:s,label:o,dir:i,...u}=e;return a.jsxs(Al,{defaultValue:r,required:u.required,disabled:u.disabled,onValueChange:s,id:u.id,dir:i,name:u.name,className:m("w-fit",u.className),ref:t,style:u.style,children:[a.jsx(Pn,{htmlFor:u.id,className:"wu-text-sm wu-font-normal wu-text-gray-lead wu-leading-6 wu-radio-group-label",children:o}),n.map(l=>a.jsxs("div",{className:"wu-flex wu-items-center wu-gap-2 wu-radio-item-container",children:[a.jsx(kl,{value:l.value,id:l.value,disabled:l.disabled,required:l.required,"aria-label":l.value,className:"wu-peer wu-radio-item"}),a.jsx(Pn,{htmlFor:l.value,className:m(l.required&&"after:wu-content-['*'] after:wu-mx-[2px] after:wu-text-rose-500","wu-radio-item-label"),children:l.label})]},l.value))]})});Dl.displayName="WuRadioGroup";const mb=e=>{const{children:t,...n}=e;return a.jsxs(Wt,{...n,role:"complementary","aria-label":"ScrollArea",children:[t,a.jsx(ca,{orientation:"horizontal"})]})},_l=x.forwardRef(({className:e,type:t,...n},r)=>a.jsx("input",{type:t,className:m("wu-flex wu-h-8 wu-w-full wu-border-b wu-border-gray-subtle wu-bg-gray-10 wu-p-2 wu-text-sm wu-font-normal wu-text-gray-lead","file:wu-border-0 file:wu-bg-gray-40 file:wu-text-gray-notification file:wu-text-sm file:wu-font-normal file:wu-relative file:wu-bottom-[3px]","wu-placeholder:wu-text-gray-subtle wu-placeholder:wu-font-light","disabled:wu-cursor-not-allowed disabled:wu-bg-gray-20 disabled:wu-border-gray-40 disabled:wu-text-gray-subtle","read-only:wu-cursor-not-allowed read-only:wu-bg-gray-20 read-only:wu-border-gray-40 read-only:wu-text-gray-subtle","focus:wu-border-blue-p focus-visible:wu-outline-none wu-transition-colors hover:wu-border-gray-40",e),ref:r,...n}));_l.displayName="Input";const Pl=x.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...r},s)=>a.jsx(Ga.Root,{ref:s,decorative:n,orientation:t,className:m("wu-shrink-0 wu-bg-gray-40",t==="horizontal"?"wu-h-[1px] wu-w-full":"wu-h-full wu-w-[1px]",e),...r}));Pl.displayName=Ga.Root.displayName;function Vl({className:e,...t}){return a.jsx("div",{className:m("animate-pulse rounded-md bg-muted",e),...t})}const ga=768;function ba(){const[e,t]=x.useState(void 0);return x.useEffect(()=>{const n=window.matchMedia(`(max-width: ${ga-1}px)`),r=()=>{t(window.innerWidth<ga)};return n.addEventListener("change",r),t(window.innerWidth<ga),()=>n.removeEventListener("change",r)},[]),!!e}const gb="sidebar_state",bb=3600*24*7,yb="256px",vb="256px",xb="3rem",Nb="b",Ol=x.createContext(null);function st(){const e=x.useContext(Ol);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}const Fl=x.forwardRef(({defaultOpen:e=!0,open:t,onOpenChange:n,className:r,style:s,children:o,...i},u)=>{const l=ba(),[d,c]=x.useState(!1),[w,p]=x.useState(l?!0:e),f=t??w,g=x.useCallback(y=>{const C=typeof y=="function"?y(f):y;n?n(C):p(C),document.cookie=`${gb}=${C}; path=/; max-age=${bb}`},[n,f]),b=x.useCallback(()=>l?c(y=>!y):g(y=>!y),[l,g,c]);x.useEffect(()=>{const y=C=>{C.key===Nb&&(C.metaKey||C.ctrlKey)&&(C.preventDefault(),b())};return window.addEventListener("keydown",y),()=>window.removeEventListener("keydown",y)},[b]);const v=f?"expanded":"collapsed",N=x.useMemo(()=>({state:v,open:f,setOpen:g,isMobile:l,openMobile:d,setOpenMobile:c,toggleSidebar:b}),[v,f,g,l,d,c,b]);return a.jsx(Ol.Provider,{value:N,children:a.jsx(no,{delayDuration:0,children:a.jsx("div",{style:{"--sidebar-width":yb,"--sidebar-width-icon":xb,...s},className:m("wu-group/sidebar-wrapper wu-flex wu-min-h-[calc(100svh-48px)] wu-w-full",r),ref:u,...i,children:o})})})});Fl.displayName="SidebarProvider";const Ll=x.forwardRef(({side:e="left",variant:t="sidebar",collapsible:n="offcanvas",className:r,children:s,...o},i)=>{const{isMobile:u,state:l,openMobile:d,setOpenMobile:c}=st();return n==="none"?a.jsx("div",{className:m("wu-flex wu-h-full wu-w-[--sidebar-width] wu-flex-col",r),ref:i,...o,children:s}):u?a.jsx(ni,{open:d,onOpenChange:c,...o,children:a.jsx(ps,{"data-sidebar":"sidebar","data-mobile":"true",className:"wu-w-[--sidebar-width] wu-bg-blue-sidebar wu-p-0 [&>button]:wu-hidden",style:{"--sidebar-width":vb},side:e,children:a.jsx("div",{className:"wu-flex wu-flex-col wu-w-full wu-h-full",children:s})})}):a.jsxs("div",{ref:i,className:"wu-hidden wu-group wu-peer md:wu-block","data-state":l,"data-collapsible":l==="collapsed"?n:"","data-variant":t,"data-side":e,children:[a.jsx("div",{className:m("wu-relative wu-w-[--sidebar-width] wu-bg-transparent wu-transition-[width] wu-duration-150 wu-ease-linear","group-data-[collapsible=offcanvas]:wu-w-0","group-data-[side=right]:wu-rotate-180",t==="floating"||t==="inset"?"group-data-[collapsible=icon]:wu-w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4))]":"group-data-[collapsible=icon]:wu-w-[--sidebar-width-icon]")}),a.jsx("div",{className:m("wu-fixed wu-inset-y-0 wu-z-20 wu-hidden wu-h-svh wu-w-[--sidebar-width] wu-transition-[left,right,width] wu-duration-150 wu-ease-linear md:wu-flex",e==="left"?"wu-left-0 group-data-[collapsible=offcanvas]:wu-left-[calc(var(--sidebar-width)*-1)]":"wu-right-0 group-data-[collapsible=offcanvas]:wu-right-[calc(var(--sidebar-width)*-1)]",t==="floating"||t==="inset"?"wu-p-2 group-data-[collapsible=icon]:wu-w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4)_+2px)]":"group-data-[collapsible=icon]:wu-w-[--sidebar-width-icon] group-data-[side=left]:wu-border-r group-data-[side=right]:wu-border-l",r),...o,children:a.jsx("div",{"data-sidebar":"sidebar",className:"wu-flex wu-h-full wu-w-full wu-flex-col wu-bg-[#eef3fb] group-data-[variant=floating]:wu-rounded-lg group-data-[variant=floating]:wu-border group-data-[variant=floating]:wu-border-sidebar-border group-data-[variant=floating]:wu-shadow",children:s})})]})});Ll.displayName="Sidebar";const Wl=x.forwardRef(({className:e,onClick:t,children:n,...r},s)=>{const{toggleSidebar:o}=st();return a.jsxs(Et,{ref:s,"data-sidebar":"trigger",variant:"secondary",className:m("wu-h-8 wu-w-8 wu-min-w-0 wu-p-0 wu-text-2xl wu-font-light hover:wu-bg-blue-sidebarHover wu-text-blue-q",e),onClick:i=>{t==null||t(i),o()},...r,children:[n,a.jsx("span",{className:"wu-sr-only",children:"Toggle Sidebar"})]})});Wl.displayName="SidebarTrigger";const Sb=x.forwardRef(({className:e,...t},n)=>{const{toggleSidebar:r}=st();return a.jsx("button",{ref:n,"data-sidebar":"rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:r,title:"Toggle Sidebar",className:m("wu-absolute wu-inset-y-0 wu-z-20 wu-hidden wu-w-4 wu-translate-x-1/2 wu-transition-all wu-ease-linear after:wu-absolute after:wu-inset-y-0 after:wu-left-1/2 after:wu-w-[2px] group-data-[side=left]:wu-right-4 group-data-[side=right]:wu-left-0 sm:wu-flex","[[data-side=left]_&]:wu-cursor-w-resize [[data-side=right]_&]:wu-cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:wu-cursor-e-resize [[data-side=right][data-state=collapsed]_&]:wu-cursor-w-resize","group-data-[collapsible=offcanvas]:wu-translate-x-0 group-data-[collapsible=offcanvas]:after:wu-left-full","[[data-side=left][data-collapsible=offcanvas]_&]:wu-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:wu-left-2",e),...t})});Sb.displayName="SidebarRail";const Bl=x.forwardRef(({className:e,...t},n)=>a.jsx("main",{ref:n,className:m("wu-relative wu-flex wu-w-full wu-flex-1 wu-flex-col","md:peer-data-[variant=inset]:wu-m-2 md:peer-data-[state=collapsed]:peer-data-[variant=inset]:wu-ml-2 md:peer-data-[variant=inset]:wu-ml-0 md:peer-data-[variant=inset]:wu-rounded-xl md:peer-data-[variant=inset]:wu-shadow",e),...t}));Bl.displayName="SidebarInset";const Cb=x.forwardRef(({className:e,...t},n)=>a.jsx(_l,{ref:n,"data-sidebar":"input",className:m("wu-h-8 wu-w-full wu-shadow-none focus-visible:wu-ring-2",e),...t}));Cb.displayName="SidebarInput";const ql=x.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,"data-sidebar":"header",className:m("wu-flex wu-flex-col wu-gap-2 wu-p-2",e),...t}));ql.displayName="SidebarHeader";const $l=x.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,"data-sidebar":"footer",className:m("wu-flex wu-flex-col wu-gap-2 wu-pb-2",e),...t}));$l.displayName="SidebarFooter";const Tb=x.forwardRef(({className:e,...t},n)=>a.jsx(Pl,{ref:n,"data-sidebar":"separator",className:m("wu-mx-2 wu-w-auto",e),...t}));Tb.displayName="SidebarSeparator";const Hl=x.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,"data-sidebar":"content",className:m("wu-flex wu-min-h-0 wu-flex-1 wu-flex-col wu-gap-2 wu-overflow-auto group-data-[collapsible=icon]:wu-overflow-hidden",e),...t}));Hl.displayName="SidebarContent";const zl=x.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,"data-sidebar":"group",className:m("wu-relative wu-flex wu-w-full wu-min-w-0 wu-flex-col wu-p-2",e),...t}));zl.displayName="SidebarGroup";const Ul=x.forwardRef(({className:e,asChild:t=!1,...n},r)=>{const s=t?Ct.Slot:"div";return a.jsx(s,{ref:r,"data-sidebar":"group-label",className:m("wu-flex wu-h-8 wu-shrink-0 wu-items-center wu-rounded-md wu-px-2 wu-text-xs wu-font-medium wu-outline-none wu-transition-[margin,opacity] wu-duration-150 wu-ease-linear focus-visible:wu-ring-2 [&>svg]:wu-size-4 [&>svg]:wu-shrink-0","group-data-[collapsible=icon]:wu-opacity-0",e),...n})});Ul.displayName="SidebarGroupLabel";const Eb=x.forwardRef(({className:e,asChild:t=!1,...n},r)=>{const s=t?Ct.Slot:"button";return a.jsx(s,{ref:r,"data-sidebar":"group-action",className:m("wu-absolute wu-right-3 wu-top-3.5 wu-flex wu-aspect-square wu-w-5 wu-items-center wu-justify-center wu-rounded-md wu-p-0 wu-outline-none wu-transition-transform focus-visible:wu-ring-2 [&>svg]:wu-size-4 [&>svg]:wu-shrink-0","after:wu-absolute after:wu-inset-2 after:md:wu-hidden","group-data-[collapsible=icon]:wu-hidden",e),...n})});Eb.displayName="SidebarGroupAction";const jl=x.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,"data-sidebar":"group-content",className:m("wu-w-full wu-text-sm",e),...t}));jl.displayName="SidebarGroupContent";const ya=x.forwardRef(({className:e,...t},n)=>a.jsx("ul",{ref:n,"data-sidebar":"menu",className:m("wu-flex wu-w-full wu-min-w-0 wu-flex-col wu-gap-1",e),...t}));ya.displayName="SidebarMenu";const Gl=x.forwardRef(({className:e,...t},n)=>a.jsx("li",{ref:n,"data-sidebar":"menu-item",className:m("wu-group/menu-item wu-relative",e),...t}));Gl.displayName="SidebarMenuItem";const Mb=qe.cva("wu-peer/menu-button wu-flex wu-w-full wu-items-center wu-gap-2 wu-overflow-hidden wu-rounded-md wu-p-2 wu-text-left wu-text-sm wu-outline-none wu-transition-[width,height,padding] focus-visible:wu-ring-2 disabled:wu-pointer-events-none disabled:wu-opacity-50 group-has-[[data-sidebar=menu-action]]/menu-item:wu-pr-8 aria-disabled:wu-pointer-events-none aria-disabled:wu-opacity-50 data-[active=true]:wu-font-medium group-data-[collapsible=icon]:!wu-size-8 group-data-[collapsible=icon]:!wu-p-2 [&>span:last-child]:wu-truncate [&>svg]:wu-size-4 [&>svg]:wu-shrink-0",{variants:{variant:{default:"",outline:""},size:{default:"wu-h-8 wu-text-sm",sm:"wu-h-7 wu-text-xs",lg:"wu-h-12 wu-text-sm group-data-[collapsible=icon]:!wu-p-0"}},defaultVariants:{variant:"default",size:"default"}}),Kl=x.forwardRef(({asChild:e=!1,isActive:t=!1,variant:n="default",size:r="default",tooltip:s,className:o,...i},u)=>{const l=e?Ct.Slot:"button",{isMobile:d,state:c}=st(),w=a.jsx(l,{ref:u,"data-sidebar":"menu-button","data-size":r,"data-active":t,className:m(Mb({variant:n,size:r}),o),...i});return s?(typeof s=="string"&&(s={children:s}),a.jsxs(ro,{children:[a.jsx(so,{asChild:!0,children:w}),a.jsx(Ur,{side:"right",align:"center",hidden:c!=="collapsed"||d,...s})]})):w});Kl.displayName="SidebarMenuButton";const Ib=x.forwardRef(({className:e,asChild:t=!1,showOnHover:n=!1,...r},s)=>{const o=t?Ct.Slot:"button";return a.jsx(o,{ref:s,"data-sidebar":"menu-action",className:m("wu-absolute wu-right-1 wu-top-1.5 wu-flex wu-aspect-square wu-w-5 wu-items-center wu-justify-center wu-rounded-md wu-p-0 wu-outline-none wu-transition-transform focus-visible:wu-ring-2 [&>svg]:wu-size-4 [&>svg]:wu-shrink-0","after:wu-absolute after:wu-inset-2 after:md:wu-hidden","peer-data-[size=sm]/menu-button:wu-top-1","peer-data-[size=default]/menu-button:wu-top-1.5","peer-data-[size=lg]/menu-button:wu-top-2.5","group-data-[collapsible=icon]:wu-hidden",n&&"group-focus-within/menu-item:wu-opacity-100 group-hover/menu-item:wu-opacity-100 data-[state=open]:wu-opacity-100 md:wu-opacity-0",e),...r})});Ib.displayName="SidebarMenuAction";const Ab=x.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,"data-sidebar":"menu-badge",className:m("wu-pointer-events-none wu-absolute wu-right-1 wu-flex wu-h-5 wu-min-w-5 wu-select-none wu-items-center wu-justify-center wu-rounded-md wu-px-1 wu-text-xs wu-font-medium wu-tabular-nums","","peer-data-[size=sm]/menu-button:wu-top-1","peer-data-[size=default]/menu-button:wu-top-1.5","peer-data-[size=lg]/menu-button:wu-top-2.5","group-data-[collapsible=icon]:wu-hidden",e),...t}));Ab.displayName="SidebarMenuBadge";const kb=x.forwardRef(({className:e,showIcon:t=!1,...n},r)=>{const s=x.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return a.jsxs("div",{ref:r,"data-sidebar":"menu-skeleton",className:m("wu-flex wu-h-8 wu-items-center wu-gap-2 wu-rounded-md wu-px-2",e),...n,children:[t&&a.jsx(Vl,{className:"wu-rounded-md wu-size-4","data-sidebar":"menu-skeleton-icon"}),a.jsx(Vl,{className:"wu-h-4 wu-max-w-[--skeleton-width] wu-flex-1","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":s}})]})});kb.displayName="SidebarMenuSkeleton";const Db=x.forwardRef(({className:e,...t},n)=>a.jsx("ul",{ref:n,"data-sidebar":"menu-sub",className:m("wu-mx-3.5 wu-flex wu-min-w-0 wu-translate-x-px wu-flex-col wu-gap-1 wu-border-l wu-px-2.5 wu-py-0.5","group-data-[collapsible=icon]:wu-hidden",e),...t}));Db.displayName="SidebarMenuSub";const _b=x.forwardRef(({...e},t)=>a.jsx("li",{ref:t,...e}));_b.displayName="SidebarMenuSubItem";const Pb=x.forwardRef(({asChild:e=!1,size:t="md",isActive:n,className:r,...s},o)=>{const i=e?Ct.Slot:"a";return a.jsx(i,{ref:o,"data-sidebar":"menu-sub-button","data-size":t,"data-active":n,className:m("wu-flex wu-h-7 wu-min-w-0 wu-translate-x-px wu-items-center wu-gap-2 wu-overflow-hidden wu-rounded-md wu-px-2 wu-outline-none focus-visible:wu-ring-2 disabled:wu-pointer-events-none disabled:wu-opacity-50 aria-disabled:wu-pointer-events-none aria-disabled:wu-opacity-50 [&>span:last-child]:wu-truncate [&>svg]:wu-size-4 [&>svg]:wu-shrink-0","data-[active=true]:wu-bg-sidebar-accent data-[active=true]:wu-text-sidebar-accent-foreground",t==="sm"&&"wu-text-xs",t==="md"&&"wu-text-sm","group-data-[collapsible=icon]:wu-hidden",r),...s})});Pb.displayName="SidebarMenuSubButton";function Vb(e){const{open:t,defaultOpen:n,onOpenChange:r,disabled:s}=e,o=t!==void 0,[i,u]=as({controlled:t,default:n,name:"Collapsible",state:"open"}),{mounted:l,setMounted:d,transitionStatus:c}=of(i,!0,!0),[w,p]=x.useState(i),[{height:f,width:g},b]=x.useState({height:void 0,width:void 0}),v=yo(),[N,y]=x.useState(),C=N??v,[S,T]=x.useState(!1),[D,A]=x.useState(!1),k=x.useRef(null),M=x.useRef(null),_=x.useRef(null),P=x.useRef(null),E=Do(P,!1),V=ge(L=>{const O=!i,W=De(uf,L.nativeEvent);if(r(O,W),W.isCanceled)return;const q=P.current;M.current==="css-animation"&&q!=null&&q.style.removeProperty("animation-name"),!S&&!D&&(M.current!=null&&M.current!=="css-animation"&&!l&&O&&d(!0),M.current==="css-animation"&&(!w&&O&&p(!0),!l&&O&&d(!0))),u(O),M.current==="none"&&l&&!O&&d(!1)});return re(()=>{o&&M.current==="none"&&!D&&!i&&d(!1)},[o,D,i,t,d]),x.useMemo(()=>({abortControllerRef:k,animationTypeRef:M,disabled:s,handleTrigger:V,height:f,mounted:l,open:i,panelId:C,panelRef:P,runOnceAnimationsFinish:E,setDimensions:b,setHiddenUntilFound:T,setKeepMounted:A,setMounted:d,setOpen:u,setPanelIdState:y,setVisible:p,transitionDimensionRef:_,transitionStatus:c,visible:w,width:g}),[k,M,s,V,f,l,i,C,P,E,b,T,A,d,u,p,_,c,w,g])}const va=x.createContext(void 0);process.env.NODE_ENV!=="production"&&(va.displayName="CollapsibleRootContext");function Yl(){const e=x.useContext(va);if(e===void 0)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: CollapsibleRootContext is missing. Collapsible parts must be placed within <Collapsible.Root>.":Gt(15));return e}let pn=(function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=Zt.startingStyle]="startingStyle",e[e.endingStyle=Zt.endingStyle]="endingStyle",e})({}),Ob=(function(e){return e.panelOpen="data-panel-open",e})({});const Fb={[pn.open]:""},Lb={[pn.closed]:""},Wb={open(e){return e?{[Ob.panelOpen]:""}:null}},Xl={...{open(e){return e?Fb:Lb}},...ko},Zl=x.forwardRef(function(t,n){const{render:r,className:s,defaultOpen:o=!1,disabled:i=!1,onOpenChange:u,open:l,...d}=t,c=ge(u),w=Vb({open:l,defaultOpen:o,onOpenChange:c,disabled:i}),p=x.useMemo(()=>({open:w.open,disabled:w.disabled,transitionStatus:w.transitionStatus}),[w.open,w.disabled,w.transitionStatus]),f=x.useMemo(()=>({...w,onOpenChange:c,state:p}),[w,c,p]),g=Ye("div",t,{state:p,ref:n,props:d,stateAttributesMapping:Xl});return a.jsx(va.Provider,{value:f,children:g})});process.env.NODE_ENV!=="production"&&(Zl.displayName="CollapsibleRoot");const Jl=x.createContext(void 0);process.env.NODE_ENV!=="production"&&(Jl.displayName="CompositeRootContext");function Bb(e=!1){const t=x.useContext(Jl);if(t===void 0&&!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: CompositeRootContext is missing. Composite parts must be placed within <Composite.Root>.":Gt(16));return t}function qb(e){const{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:s=0,isNativeButton:o}=e,i=r&&t!==!1,u=r&&t===!1;return{props:x.useMemo(()=>{const d={onKeyDown(c){n&&t&&c.key!=="Tab"&&c.preventDefault()}};return r||(d.tabIndex=s,!o&&n&&(d.tabIndex=t?s:-1)),(o&&(t||i)||!o&&n)&&(d["aria-disabled"]=n),o&&(!t||u)&&(d.disabled=n),d},[r,n,t,i,u,o,s])}}function xa(e={}){const{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:s=!0,composite:o}=e,i=x.useRef(null),u=Bb(!0),l=o??u!==void 0,{props:d}=qb({focusableWhenDisabled:n,disabled:t,composite:l,tabIndex:r,isNativeButton:s});process.env.NODE_ENV!=="production"&&x.useEffect(()=>{var g,b;if(!i.current)return;const f=hr(i.current);if(s){if(!f){const v=((g=ft.captureOwnerStack)==null?void 0:g.call(ft))||"";To(`A component that acts as a button expected a native <button> because the \`nativeButton\` prop is true. Rendering a non-<button> removes native button semantics, which can impact forms and accessibility. Use a real <button> in the \`render\` prop, or set \`nativeButton\` to \`false\`.${v}`)}}else if(f){const v=((b=ft.captureOwnerStack)==null?void 0:b.call(ft))||"";To(`A component that acts as a button expected a non-<button> because the \`nativeButton\` prop is false. Rendering a <button> keeps native behavior while Base UI applies non-native attributes and handlers, which can add unintended extra attributes (such as \`role\` or \`aria-disabled\`). Use a non-<button> in the \`render\` prop, or set \`nativeButton\` to \`true\`.${v}`)}},[s]);const c=x.useCallback(()=>{const f=i.current;hr(f)&&l&&t&&d.disabled===void 0&&f.disabled&&(f.disabled=!1)},[t,d.disabled,l]);re(c,[c]);const w=x.useCallback((f={})=>{const{onClick:g,onMouseDown:b,onKeyUp:v,onKeyDown:N,onPointerDown:y,...C}=f;return po({type:s?"button":void 0,onClick(T){if(t){T.preventDefault();return}g==null||g(T)},onMouseDown(T){t||b==null||b(T)},onKeyDown(T){if(t||(Qr(T),N==null||N(T),T.baseUIHandlerPrevented))return;const D=T.target===T.currentTarget,A=T.currentTarget,k=hr(A),M=!s&&$b(A),_=D&&(s?k:!M),P=T.key==="Enter",E=T.key===" ",V=A.getAttribute("role"),L=(V==null?void 0:V.startsWith("menuitem"))||V==="option"||V==="gridcell";if(D&&l&&E){if(T.defaultPrevented&&L)return;T.preventDefault(),M||s&&k?(A.click(),T.preventBaseUIHandler()):_&&(g==null||g(T),T.preventBaseUIHandler());return}_&&(!s&&(E||P)&&T.preventDefault(),!s&&P&&(g==null||g(T)))},onKeyUp(T){if(!t){if(Qr(T),v==null||v(T),T.target===T.currentTarget&&s&&l&&hr(T.currentTarget)&&T.key===" "){T.preventDefault();return}T.baseUIHandlerPrevented||T.target===T.currentTarget&&!s&&!l&&T.key===" "&&(g==null||g(T))}},onPointerDown(T){if(t){T.preventDefault();return}y==null||y(T)}},s?void 0:{role:"button"},d,C)},[t,d,l,s]),p=ge(f=>{i.current=f,c()});return{getButtonProps:w,buttonRef:p}}function hr(e){return Gw(e)&&e.tagName==="BUTTON"}function $b(e){return!!((e==null?void 0:e.tagName)==="A"&&(e!=null&&e.href))}const Hb={...Wb,...ko},Ql=x.forwardRef(function(t,n){const{panelId:r,open:s,handleTrigger:o,state:i,disabled:u}=Yl(),{className:l,disabled:d=u,id:c,render:w,nativeButton:p=!0,...f}=t,{getButtonProps:g,buttonRef:b}=xa({disabled:d,focusableWhenDisabled:!0,native:p}),v=x.useMemo(()=>({"aria-controls":s?r:void 0,"aria-expanded":s,onClick:o}),[r,s,o]);return Ye("button",t,{state:i,ref:[n,b],props:[v,f,g],stateAttributesMapping:Hb})});process.env.NODE_ENV!=="production"&&(Ql.displayName="CollapsibleTrigger");let zb=(function(e){return e.disabled="data-disabled",e.orientation="data-orientation",e})({});function Ub(e){const{abortControllerRef:t,animationTypeRef:n,externalRef:r,height:s,hiddenUntilFound:o,keepMounted:i,id:u,mounted:l,onOpenChange:d,open:c,panelRef:w,runOnceAnimationsFinish:p,setDimensions:f,setMounted:g,setOpen:b,setVisible:v,transitionDimensionRef:N,visible:y,width:C}=e,S=x.useRef(!1),T=x.useRef(null),D=x.useRef(c),A=x.useRef(c),k=Ao(),M=x.useMemo(()=>n.current==="css-animation"?!y:!c&&!l,[c,l,y,n]),_=ge(E=>{if(!E)return;if(n.current==null||N.current==null){const O=getComputedStyle(E),W=O.animationName!=="none"&&O.animationName!=="",q=O.transitionDuration!=="0s"&&O.transitionDuration!=="";W&&q?process.env.NODE_ENV!=="production"&&ts("CSS transitions and CSS animations both detected on Collapsible or Accordion panel.","Only one of either animation type should be used."):O.animationName==="none"&&O.transitionDuration!=="0s"?n.current="css-transition":O.animationName!=="none"&&O.transitionDuration==="0s"?n.current="css-animation":n.current="none",E.getAttribute(zb.orientation)==="horizontal"||O.transitionProperty.indexOf("width")>-1?N.current="width":N.current="height"}if(n.current!=="css-transition")return;(s===void 0||C===void 0)&&(f({height:E.scrollHeight,width:E.scrollWidth}),A.current&&E.style.setProperty("transition-duration","0s"));let V=-1,L=-1;return V=le.request(()=>{A.current=!1,L=le.request(()=>{setTimeout(()=>{E.style.removeProperty("transition-duration")})})}),()=>{le.cancel(V),le.cancel(L)}}),P=Fn(r,w,_);return re(()=>{if(n.current!=="css-transition")return;const E=w.current;if(!E)return;let V=-1;if(t.current!=null&&(t.current.abort(),t.current=null),c){const L={"justify-content":E.style.justifyContent,"align-items":E.style.alignItems,"align-content":E.style.alignContent,"justify-items":E.style.justifyItems};Object.keys(L).forEach(O=>{E.style.setProperty(O,"initial","important")}),!A.current&&!i&&E.setAttribute(pn.startingStyle,""),f({height:E.scrollHeight,width:E.scrollWidth}),V=le.request(()=>{Object.entries(L).forEach(([O,W])=>{W===""?E.style.removeProperty(O):E.style.setProperty(O,W)})})}else{if(E.scrollHeight===0&&E.scrollWidth===0)return;f({height:E.scrollHeight,width:E.scrollWidth});const L=new AbortController;t.current=L;const O=L.signal;let W=null;const q=pn.endingStyle;return W=new MutationObserver($=>{$.some(Z=>Z.type==="attributes"&&Z.attributeName===q)&&(W==null||W.disconnect(),W=null,p(()=>{f({height:0,width:0}),E.style.removeProperty("content-visibility"),g(!1),t.current===L&&(t.current=null)},O))}),W.observe(E,{attributes:!0,attributeFilter:[q]}),()=>{W==null||W.disconnect(),k.cancel(),t.current===L&&(L.abort(),t.current=null)}}return()=>{le.cancel(V)}},[t,n,k,o,i,l,c,w,p,f,g]),re(()=>{if(n.current!=="css-animation")return;const E=w.current;E&&(T.current=E.style.animationName||T.current,E.style.setProperty("animation-name","none"),f({height:E.scrollHeight,width:E.scrollWidth}),!D.current&&!S.current&&E.style.removeProperty("animation-name"),c?(t.current!=null&&(t.current.abort(),t.current=null),g(!0),v(!0)):(t.current=new AbortController,p(()=>{g(!1),v(!1),t.current=null},t.current.signal)))},[t,n,c,w,p,f,g,v,y]),Ln(()=>{const E=le.request(()=>{D.current=!1});return()=>le.cancel(E)}),re(()=>{if(!o)return;const E=w.current;if(!E)return;let V=-1,L=-1;return c&&S.current&&(E.style.transitionDuration="0s",f({height:E.scrollHeight,width:E.scrollWidth}),V=le.request(()=>{S.current=!1,L=le.request(()=>{setTimeout(()=>{E.style.removeProperty("transition-duration")})})})),()=>{le.cancel(V),le.cancel(L)}},[o,c,w,f]),re(()=>{const E=w.current;E&&o&&M&&(E.setAttribute("hidden","until-found"),n.current==="css-transition"&&E.setAttribute(pn.startingStyle,""))},[o,M,n,w]),x.useEffect(function(){const V=w.current;if(!V)return;function L(O){S.current=!0,b(!0),d(!0,De(Jt,O))}return V.addEventListener("beforematch",L),()=>{V.removeEventListener("beforematch",L)}},[d,w,b]),x.useMemo(()=>({props:{hidden:M,id:u,ref:P}}),[M,u,P])}let Rl=(function(e){return e.collapsiblePanelHeight="--collapsible-panel-height",e.collapsiblePanelWidth="--collapsible-panel-width",e})({});const ec=x.forwardRef(function(t,n){const{className:r,hiddenUntilFound:s,keepMounted:o,render:i,id:u,...l}=t;process.env.NODE_ENV!=="production"&&re(()=>{s&&o===!1&&ts("The `keepMounted={false}` prop on a Collapsible will be ignored when using `hiddenUntilFound` since it requires the Panel to remain mounted even when closed.")},[s,o]);const{abortControllerRef:d,animationTypeRef:c,height:w,mounted:p,onOpenChange:f,open:g,panelId:b,panelRef:v,runOnceAnimationsFinish:N,setDimensions:y,setHiddenUntilFound:C,setKeepMounted:S,setMounted:T,setPanelIdState:D,setOpen:A,setVisible:k,state:M,transitionDimensionRef:_,visible:P,width:E,transitionStatus:V}=Yl(),L=s??!1,O=o??!1;re(()=>{if(u)return D(u),()=>{D(void 0)}},[u,D]),re(()=>{C(L)},[C,L]),re(()=>{S(O)},[S,O]);const{props:W}=Ub({abortControllerRef:d,animationTypeRef:c,externalRef:n,height:w,hiddenUntilFound:L,id:b,keepMounted:O,mounted:p,onOpenChange:f,open:g,panelRef:v,runOnceAnimationsFinish:N,setDimensions:y,setMounted:T,setOpen:A,setVisible:k,transitionDimensionRef:_,visible:P,width:E});af({open:g&&V==="idle",ref:v,onComplete(){g&&y({height:void 0,width:void 0})}});const q=x.useMemo(()=>({...M,transitionStatus:V}),[M,V]),$=Ye("div",t,{state:q,ref:[n,v],props:[W,{style:{[Rl.collapsiblePanelHeight]:w===void 0?"auto":`${w}px`,[Rl.collapsiblePanelWidth]:E===void 0?"auto":`${E}px`}},l],stateAttributesMapping:Xl});return O||L||!O&&p?$:null});process.env.NODE_ENV!=="production"&&(ec.displayName="CollapsiblePanel");const jb=({children:e,Sidebar:t,className:n,defaultOpen:r=!0,open:s,onOpenChange:o,style:i})=>a.jsxs(Fl,{defaultOpen:r,open:s,onOpenChange:o,children:[a.jsxs(Ll,{variant:"sidebar",collapsible:"icon",className:m("wu-top-12 wu-h-[calc(100%-48px)] wu-shadow-sidebar wu-border-none",n),style:i,role:"complementary",children:[a.jsx(ql,{className:"wu-py-2",children:a.jsx(tc,{})}),t]}),a.jsx(Bl,{className:"wu-contain-inline-size",children:e})]}),tc=e=>{const{state:t,isMobile:n,openMobile:r}=st();return a.jsx(Wl,{...e,children:a.jsx(wa,{showMenu:n?r:t==="expanded"})})},Gb=({className:e,children:t,...n})=>{const r=h.useRef(null),s=h.useRef(null),o=({currentTarget:u})=>{const{scrollTop:l,clientHeight:d,scrollHeight:c}=u;r.current&&r.current.classList.toggle("wu-border-[#1b338014]",l!==0),s.current&&s.current.classList.toggle("wu-border-[#1b338014]",l+d!==c)},i="wu-w-[calc(100%-16px)] wu-mx-auto wu-border-transparent";return a.jsxs(Hl,{...n,className:m("wu-overflow-hidden wu-gap-0",e),children:[a.jsx("hr",{className:i,ref:r}),a.jsx(Wt,{onScroll:o,className:"wu-gap-2",thumbColor:"#b9c3dc",railColor:"#00000000","data-testid":"scroll-area",children:t}),a.jsx("hr",{className:i,ref:s})]})},Kb=e=>a.jsx($l,{...e,children:e.children}),Yb=({label:e,children:t,...n})=>a.jsxs(zl,{...n,className:"wu-p-0",children:[a.jsx("div",{className:"wu-h-8",children:a.jsx(Ul,{className:"wu-items-end wu-px-4 wu-text-xs wu-font-normal wu-leading-4 wu-text-blue-q",children:e})}),a.jsx(jl,{children:a.jsx(ya,{children:t})})]}),Xb=e=>a.jsx(ya,{...e}),nc=({Icon:e,children:t,className:n,isActive:r,...s})=>{var w;const{state:o}=st(),[i,u]=h.useState(),l=ba(),d=h.isValidElement(t)?h.cloneElement(t,{children:a.jsxs("div",{className:"wu-flex wu-items-center wu-overflow-hidden wu-text-base wu-truncate wu-text-ellipsis",children:[a.jsx("div",{className:"wu-relative wu-right-1",children:e}),a.jsx("span",{className:m("wu-text-sm wu-leading-4 wu-transition-opacity wu-duration-150",o==="collapsed"&&!l&&"wu-opacity-0"),children:(w=t.props)==null?void 0:w.children})]})}):t&&a.jsxs("div",{className:"wu-flex wu-items-center wu-overflow-hidden wu-text-base wu-truncate wu-text-ellipsis",children:[a.jsx("div",{className:"wu-relative wu-right-1",children:e}),a.jsx("span",{className:m("wu-text-sm wu-leading-4 wu-transition-opacity wu-duration-150",o==="collapsed"&&!l&&"wu-opacity-0"),children:t})]}),c=h.useRef(null);return h.useEffect(()=>{var p;u(((p=c.current)==null?void 0:p.textContent)||"")},[]),a.jsx(Gl,{...s,className:"wu-flex wu-items-center wu-gap-2 wu-px-2",children:a.jsx(Kl,{className:m("wu-flex wu-items-center wu-text-blue-q hover:wu-bg-blue-sidebarHover wu-cursor-pointer wu-h-8 wu-rounded-sm",n,r&&"wu-bg-white wu-shadow-[4px_4px_16px_0_#1B338014] wu-font-medium wu-text-blue-p hover:wu-bg-white wu-cursor-default"),isActive:r,tooltip:i,asChild:h.isValidElement(t),ref:c,children:d})})},Zb=({Title:e,Icon:t,children:n,className:r,...s})=>{const{state:o}=st(),i=ba();return a.jsxs(Zl,{children:[a.jsx(Ql,{render:u=>{const l="data-panel-open"in u;return a.jsxs(nc,{Icon:t,...u,children:[e,(o==="expanded"||i)&&a.jsx(Pe,{icon:"wm-arrow-forward-ios",className:m("wu-absolute wu-right-4 wu-transition-transform wu-duration-300",l&&"wu-rotate-90","wu-scale-75")})]})}}),a.jsx(ec,{className:m(o==="collapsed"?"":"wu-pl-2","wu-h-[var(--collapsible-panel-height)] wu-overflow-hidden","wu-transition-all wu-duration-300 wu-ease-in-out","data-[starting-style]:wu-h-0 data-[ending-style]:wu-h-0",'[&[hidden]:not([hidden="until-found"])]:wu-hidden',r),...s,children:n})]})},Jb=new Map([[-3,{top:-20,left:-4,zIndex:-1,opacity:0,transition:"all 0.3s ease-in-out, z-index 0s",position:"absolute"}],[-2,{top:0,left:0,zIndex:1,opacity:1,transition:"all 0.3s ease-in-out, z-index 0s",position:"absolute"}],[-1,{top:20,left:4,zIndex:2,opacity:1,transition:"all 0.3s ease-in-out, z-index 0s",position:"absolute"}],[0,{top:40,left:8,zIndex:3,opacity:1,transition:"all 0.3s ease-in-out, z-index 0.10s",position:"absolute"}],[1,{left:12,zIndex:4,opacity:1,transition:"all 0.3s ease-in-out, z-index 0.3s 0.10s",position:"absolute"}],[2,{left:16,zIndex:5,opacity:1,transition:"all 0.3s ease-in-out, z-index 0.3s 0.10s",position:"absolute"}],[3,{left:20,zIndex:-1,opacity:0,transition:"all 0.3s ease-in-out, z-index 0.3s 0.10s",position:"absolute"}]]),Na=(e,t,n=1)=>{const r=e.match(/hsla?\(\s*([\d.]+)\s*,\s*([\d.]+)%\s*,\s*([\d.]+)%\s*(?:,\s*([\d.]+)\s*)?\)/);if(!r)throw new Error("Invalid HSL color format");const s=parseFloat(r[1]),o=parseFloat(r[2]),i=Math.max(0,parseFloat(r[3])+t);return`hsl(${s} ${o}% ${i}% / ${n})`},Qb=({index:e,viewIndex:t,length:n,itemHeight:r})=>{const s=(e-t+n)%n;let o;s===0?o=0:s===n-1&&n>=2?o=-1:s===n-2&&n>=3?o=-2:s===1?o=1:s===2?o=2:s===n-3&&n>=4?o=-3:o=3;const i=Jb.get(o)||{},u=o>0?r+28+(o-1)*20:i.top;return{position:o,styles:{...i,...o>0&&{top:`${u}px`},height:o>0?"32px":r}}},hn={LIGHTNESS_STEP:8,BORDER_LIGHTNESS:10,CONTENT_HEIGHT:"calc(100% - 2rem)",FONT_SIZE_ACTIVE:"14px",FONT_SIZE_INACTIVE:"12px"},Rb=({children:e,className:t,header:n,baseColor:r,position:s=0,style:o,...i})=>{const u=s<=0,l=s===0,d={border:l?`4px solid ${Na(r,hn.BORDER_LIGHTNESS)}`:"",...o},c={backgroundColor:Na(r,s*hn.LIGHTNESS_STEP),fontSize:l?hn.FONT_SIZE_ACTIVE:hn.FONT_SIZE_INACTIVE,transition:"all 0.3s ease",position:"relative",bottom:s<0?"4px":"0px",height:"32px",padding:"4px 8px"},w={backgroundColor:Na(r,45+s*6),height:hn.CONTENT_HEIGHT,position:"relative",bottom:s<0?"4px":"0px"};return a.jsxs("div",{className:m("wu-font-normal wu-transition-all wu-rounded-lg wu-overflow-hidden wu-w-full wu-cursor-pointer hover:-wu-translate-y-2",t),style:d,...i,children:[a.jsx("div",{style:c,className:"wu-text-white",children:n}),u&&a.jsx("div",{className:"wu-p-2 wu-overflow-y-auto wu-text-sm",style:w,children:e})]})},ey=({children:e,Trigger:t,Header:n,styles:r={},classNames:s={},open:o,onOpenChange:i,itemHeight:u})=>{const l={height:u,...r.Trigger};return a.jsxs(hl,{open:o,onOpenChange:i,children:[a.jsx(ml,{className:m("wu-bg-gray-25 wu-z-0 wu-w-full wu-rounded-lg wu-rounded-tl-none wu-relative",s.Trigger),style:l,children:a.jsx("span",{className:"wu-absolute wu-text-xs wu-font-medium wu-bg-gray-25 -wu-top-6 wu-left-0 wu-p-1 wu-rounded-t-lg",children:t})}),a.jsxs(fa,{className:m("wu-top-[50%] wu-left-[50%] wu-bg-black/75 wu-backdrop-blur-[4px] wu-min-h-full wu-overflow-auto wu-shadow-none wu-max-w-none wu-border-none wu-text-white",s.Content),hideCloseButton:!0,isStackedCard:!0,style:r.Content,children:[a.jsx(ha,{}),a.jsx(za.DialogClose,{className:m("wu-absolute wu-right-2 wu-top-2 wu-w-8 wu-h-8 wu-flex wu-items-center wu-justify-center wu-z-10",s.CloseButton),style:r.CloseButton,"aria-label":"Close dialog",children:a.jsx(Pe,{icon:"wm-close",className:"wu-text-lg wu-m-4 wu-cursor-pointer"})}),n&&a.jsx(pa,{className:m("wu-h-12 wu-p-2 wu-pl-4 wu-bg-white/25 wu-backdrop-blur-[24px]",s.Header),style:r.Header,children:n}),e]})]})},rc=0;class Sa extends Wn{constructor(){super(...arguments);Ee(this,"clear",()=>{this.currentId!==rc&&(clearInterval(this.currentId),this.currentId=rc)})}static create(){return new Sa}start(n,r){this.clear(),this.currentId=setInterval(()=>{r()},n)}}function ty(){const e=Je(Sa.create).current;return Ln(e.disposeEffect),e}function sc(e){const t=Je(ny,e).current;return t.next=e,re(t.effect),t}function ny(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}function ry(){const[,e]=x.useState({});return x.useCallback(()=>{e({})},[])}const ac={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},sy={...ac,position:"fixed",top:0,left:0},ay={...ac,position:"absolute"},Ca=x.createContext(void 0);process.env.NODE_ENV!=="production"&&(Ca.displayName="NumberFieldRootContext");function mr(){const e=x.useContext(Ca);if(e===void 0)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: NumberFieldRootContext is missing. NumberField parts must be placed within <NumberField.Root>.":Gt(43));return e}const mn={inputValue:()=>null,value:()=>null,...Xr},oc=new Map;function gn(e,t){const n=JSON.stringify({locale:e,options:t}),r=oc.get(n);if(r)return r;const s=new Intl.NumberFormat(e,t);return oc.set(n,s),s}function Bt(e,t,n){return e==null?"":gn(t,n).format(e)}function ic(e,t,n){return Bt(e,t,{...n,maximumFractionDigits:20})}const oy=["零","〇","一","二","三","四","五","六","七","八","九"],iy={零:"0","〇":"0",一:"1",二:"2",三:"3",四:"4",五:"5",六:"6",七:"7",八:"8",九:"9"},uc=["٠","١","٢","٣","٤","٥","٦","٧","٨","٩"],lc=["۰","۱","۲","۳","۴","۵","۶","۷","۸","۹"],Ta=["0","1","2","3","4","5","6","7","8","9"],cc=["%","٪","%","﹪"],dc=["‰","؉"],wc=["−","-","‒","–","—","﹣"],fc=["+","﹢"],uy=".",ly=",",cy=new RegExp(`[${uc.join("")}]`,"g"),dy=new RegExp(`[${lc.join("")}]`,"g"),wy=new RegExp(`[${Ta.join("")}]`,"g"),fy=new RegExp(`[${oy.join("")}]`,"g"),py=new RegExp(`[${cc.join("")}]`),hy=new RegExp(`[${dc.join("")}]`),Ea=/[٠١٢٣٤٥٦٧٨٩]/,pc=/[۰۱۲۳۴۵۶۷۸۹]/,Ma=/[零〇一二三四五六七八九]/,hc=new RegExp(`[${Ta.join("")}]`),my=[".",",",uy,ly,"٫","٬"],mc=new RegExp("\\p{Zs}","u"),gy=["+",...fc],by=["-",...wc],gr=e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),yy=e=>e.replace(/[-\\\]^]/g,t=>`\\${t}`),gc=e=>`[${e.map(yy).join("")}]`,bc=gc(["-"].concat(wc)),yc=gc(["+"].concat(fc)),vc=new RegExp(bc,"gu"),xc=new RegExp(yc,"gu"),bn=new RegExp(bc),br=new RegExp(yc);function Ia(e,t){const n=gn(e,t).formatToParts(11111.1),r={};return n.forEach(s=>{r[s.type]=s.value}),gn(e).formatToParts(.1).forEach(s=>{s.type==="decimal"&&(r[s.type]=s.value)}),r}function yn(e,t,n){if(e==null)return null;let r=String(e).replace(new RegExp("\\p{Cf}","gu"),"").trim();r=r.replace(vc,"-").replace(xc,"+");let s=!1;const o=r.match(/([+-])\s*$/);o&&(o[1]==="-"&&(s=!0),r=r.replace(/([+-])\s*$/,""));const i=r.match(/^\s*([+-])/);i&&(i[1]==="-"&&(s=!0),r=r.replace(/^\s*[+-]/,""));let u=t;u===void 0&&(Ea.test(r)||pc.test(r)?u="ar":Ma.test(r)&&(u="zh"));const{group:l,decimal:d,currency:c}=Ia(u,n),w=gn(u,n).formatToParts(1).filter(A=>A.type==="unit").map(A=>gr(A.value)),p=w.length?new RegExp(w.join("|"),"g"):null;let f=null;l&&(new RegExp("\\p{Zs}","u").test(l)?f=new RegExp("\\p{Zs}","gu"):l==="'"||l==="’"?f=/['’]/g:f=new RegExp(gr(l),"g"));let b=[{regex:l?f:null,replacement:""},{regex:d?new RegExp(gr(d),"g"):null,replacement:"."},{regex:/./g,replacement:"."},{regex:/,/g,replacement:""},{regex:/٫/g,replacement:"."},{regex:/٬/g,replacement:""},{regex:c?new RegExp(gr(c),"g"):null,replacement:""},{regex:p,replacement:""},{regex:cy,replacement:A=>String(uc.indexOf(A))},{regex:dy,replacement:A=>String(lc.indexOf(A))},{regex:wy,replacement:A=>String(Ta.indexOf(A))},{regex:fy,replacement:A=>iy[A]}].reduce((A,{regex:k,replacement:M})=>k?A.replace(k,M):A,r);const v=b.lastIndexOf(".");if(v!==-1&&(b=`${b.slice(0,v).replace(/\./g,"")}.${b.slice(v+1).replace(/\./g,"")}`),/^[-+]?Infinity$/i.test(r)||/[∞]/.test(r))return null;const N=(s?"-":"")+b;let y=parseFloat(N);const C=n==null?void 0:n.style,S=C==="unit"&&(n==null?void 0:n.unit)==="percent",T=py.test(e)||C==="percent";return hy.test(e)?y/=1e3:!S&&T&&(y/=100),Number.isNaN(y)?null:y}const vy=60,xy=400,Ny=50,Sy=3,Cy=8,yr=1;function Ty(e,t=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,n))}const Ey=1e-10;function My(e){const t=gn("en-US").resolvedOptions(),n=(e==null?void 0:e.minimumFractionDigits)??t.minimumFractionDigits??0;return{maximumFractionDigits:Math.max((e==null?void 0:e.maximumFractionDigits)??t.maximumFractionDigits??20,n),minimumFractionDigits:n}}function Iy(e,t){if(!Number.isFinite(e))return e;const n=Math.min(Math.max(t,0),20);return Number(e.toFixed(n))}function Aa(e,t){const{maximumFractionDigits:n}=My(t);return Iy(e,n)}function Ay(e,t,n,r="directional"){if(n===0)return e;const s=Math.abs(n),o=Math.sign(n),i=s*Ey*o,u=r==="nearest"?n:s,l=(e-t+i)/u;let d;return r==="nearest"?d=Math.round(l):o>0?d=Math.floor(l):d=Math.ceil(l),t+d*(r==="nearest"?n:s)}function ky(e,{step:t,minWithDefault:n,maxWithDefault:r,minWithZeroDefault:s,format:o,snapOnStep:i,small:u,clamp:l}){if(e===null)return e;const d=l?Ty(e,n,r):e;if(t!=null&&i){if(t===0)return Aa(d,o);let c=s;!u&&n!==Number.MIN_SAFE_INTEGER&&(c=n);const w=Ay(d,c,t,u?"nearest":"directional");return Aa(w,o)}return Aa(d,o)}const Nc=x.forwardRef(function(t,n){const{id:r,min:s,max:o,smallStep:i=.1,step:u=1,largeStep:l=10,required:d=!1,disabled:c=!1,readOnly:w=!1,name:p,defaultValue:f,value:g,onValueChange:b,onValueCommitted:v,allowWheelScrub:N=!1,snapOnStep:y=!1,allowOutOfRange:C=!1,format:S,locale:T,render:D,className:A,inputRef:k,...M}=t,{setDirty:_,validityData:P,disabled:E,setFilled:V,invalid:L,name:O,state:W,validation:q,shouldValidateOnChange:$}=Vn(),G=E||c,Z=O??p,H=u==="any"?1:u,[J,ie]=x.useState(!1),fe=s??Number.MIN_SAFE_INTEGER,Se=o??Number.MAX_SAFE_INTEGER,F=s??0,z=S==null?void 0:S.style,Y=x.useRef(null),K=Fn(k,q.inputRef),me=_o({id:r}),[j,ee]=as({controlled:g,default:f,name:"NumberField",state:"value"}),Q=j??null,ye=sc(Q);re(()=>{V(Q!==null)},[V,Q]);const je=ry(),Ce=sc(S),Te=x.useRef(!1),xt=ge((R,X)=>{Te.current=!1,v==null||v(R,X)}),Cn=Co(),Mr=ty(),Tn=Co(),En=x.useRef(!1),Mn=x.useRef(0),Xe=x.useRef(!0),ue=x.useRef(null),ot=x.useRef(()=>{}),[Nt,Ir]=x.useState(()=>g!==void 0?Sc(Q,T,S):Bt(Q,T,S)),[vd,Tv]=x.useState("numeric"),xd=ge(()=>{const{decimal:R,group:X,currency:ce,literal:pe}=Ia(T,S),se=new Set;my.forEach(ve=>se.add(ve)),R&&se.add(R),X&&(se.add(X),mc.test(X)&&se.add(" "));const We=z==="percent"||z==="unit"&&(S==null?void 0:S.unit)==="percent",Be=z==="percent"||z==="unit"&&(S==null?void 0:S.unit)==="permille";return We&&cc.forEach(ve=>se.add(ve)),Be&&dc.forEach(ve=>se.add(ve)),z==="currency"&&ce&&se.add(ce),pe&&(Array.from(pe).forEach(ve=>se.add(ve)),mc.test(pe)&&se.add(" ")),gy.forEach(ve=>se.add(ve)),fe<0&&by.forEach(ve=>se.add(ve)),se}),$t=ge(R=>R!=null&&R.altKey?i:R!=null&&R.shiftKey?l:H),Ar=ge((R,X)=>{const ce=X.event,pe=X.direction,se=X.reason,We=!C||!(se===os||se===Hn||se===is||se===Qt||se===Jt),Be=ky(R,{step:pe?$t(ce)*pe:void 0,format:Ce.current,minWithDefault:fe,maxWithDefault:Se,minWithZeroDefault:F,snapOnStep:y,small:(ce==null?void 0:ce.altKey)??!1,clamp:We}),ve=X.reason===os||X.reason===Qt||X.reason===Hn||X.reason===is||X.reason===Jt,qa=Be!==Q||ve&&(R!==Q||Xe.current===!1);if(qa){if(ue.current=Be,b==null||b(Be,X),X.isCanceled)return qa;ee(Be),_(Be!==P.initialValue),Te.current=!0}return Xe.current&&Ir(Bt(Be,T,S)),je(),qa}),In=ge((R,{direction:X,currentValue:ce,event:pe,reason:se})=>{const We=ce??ye.current,Be=typeof We=="number"?We+R*X:Math.max(0,s??0);return Ar(Be,De(se,pe,void 0,{direction:X}))}),it=ge(()=>{Tn.clear(),Cn.clear(),Mr.clear(),ot.current(),Mn.current=0}),Nd=ge((R,X)=>{if(it(),!Y.current)return;const ce=rs(Y.current);function pe(We){We.preventDefault()}ce.addEventListener("contextmenu",pe),ot.current=()=>{ce.removeEventListener("contextmenu",pe)},ce.addEventListener("pointerup",We=>{En.current=!1,it();const Be=ue.current??ye.current;xt(Be,en(R?lf:cf,We))},{once:!0});function se(){const We=$t(X)??yr;return In(We,{direction:R?1:-1,event:X,reason:R?"increment-press":"decrement-press"})}if(!se()){it();return}Cn.start(xy,()=>{Mr.start(vy,()=>{se()||it()})})});re(function(){if(!Xe.current)return;const X=g!==void 0?Sc(Q,T,S):Bt(Q,T,S);X!==Nt&&Ir(X)}),re(function(){if(!Xw)return;let X="text";fe>=0&&(X="decimal"),Tv(X)},[fe,z]),x.useEffect(()=>()=>it(),[it]),x.useEffect(function(){const X=Y.current;if(G||w||!N||!X)return;function ce(pe){if(pe.ctrlKey||Mo(Y.current).activeElement!==Y.current)return;pe.preventDefault();const se=$t(pe)??yr;In(se,{direction:pe.deltaY>0?-1:1,event:pe,reason:"wheel"})}return X.addEventListener("wheel",ce),()=>{X.removeEventListener("wheel",ce)}},[N,In,G,w,l,H,$t]);const Ba=x.useMemo(()=>({...W,disabled:G,readOnly:w,required:d,value:Q,inputValue:Nt,scrubbing:J}),[W,G,w,d,Q,Nt,J]),Ev=x.useMemo(()=>({inputRef:Y,inputValue:Nt,value:Q,startAutoChange:Nd,stopAutoChange:it,minWithDefault:fe,maxWithDefault:Se,disabled:G,readOnly:w,id:me,setValue:Ar,incrementValue:In,getStepAmount:$t,allowInputSyncRef:Xe,formatOptionsRef:Ce,valueRef:ye,lastChangedValueRef:ue,hasPendingCommitRef:Te,isPressedRef:En,intentionalTouchCheckTimeout:Tn,movesAfterTouchRef:Mn,name:Z,required:d,invalid:L,inputMode:vd,getAllowedNonNumericKeys:xd,min:s,max:o,setInputValue:Ir,locale:T,isScrubbing:J,setIsScrubbing:ie,state:Ba,onValueCommitted:xt}),[Y,Nt,Q,Nd,it,fe,Se,G,w,me,Ar,In,$t,Ce,ye,Tn,Z,d,L,vd,xd,s,o,Ir,T,J,Ba,xt]),Mv=Ye("div",t,{ref:n,state:Ba,props:M,stateAttributesMapping:mn});return a.jsxs(Ca.Provider,{value:Ev,children:[Mv,a.jsx("input",{...q.getInputValidationProps({onFocus(){var R;(R=Y.current)==null||R.focus()},onChange(R){if(R.nativeEvent.defaultPrevented)return;const X=R.currentTarget.valueAsNumber,ce=Number.isNaN(X)?null:X,pe=De(Jt,R.nativeEvent);_(ce!==P.initialValue),Ar(ce,pe),$()&&q.commit(ce)}}),ref:K,type:"number",name:Z,value:Q??"",min:s,max:o,step:u,disabled:G,required:d,"aria-hidden":!0,tabIndex:-1,style:Z?ay:sy})]})});process.env.NODE_ENV!=="production"&&(Nc.displayName="NumberFieldRoot");function Sc(e,t,n){return(n==null?void 0:n.maximumFractionDigits)!=null||(n==null?void 0:n.minimumFractionDigits)!=null?Bt(e,t,n):ic(e,t,n)}const Cc=x.forwardRef(function(t,n){const{render:r,className:s,...o}=t,{state:i}=mr();return Ye("div",t,{ref:n,state:i,props:[{role:"group"},o],stateAttributesMapping:mn})});process.env.NODE_ENV!=="production"&&(Cc.displayName="NumberFieldGroup");function vn(e){return e==="touch"||e==="pen"}function Tc(e){const{allowInputSyncRef:t,disabled:n,formatOptionsRef:r,getStepAmount:s,id:o,incrementValue:i,inputRef:u,inputValue:l,intentionalTouchCheckTimeout:d,isIncrement:c,isPressedRef:w,locale:p,movesAfterTouchRef:f,readOnly:g,setValue:b,startAutoChange:v,stopAutoChange:N,valueRef:y,lastChangedValueRef:C,onValueCommitted:S}=e,T=x.useRef({x:0,y:0}),D=x.useRef(!1),A=x.useRef(!1),k=x.useRef(""),M=c?"increment-press":"decrement-press";function _(E){t.current=!0;const V=yn(l,p,r.current);V!==null&&(y.current=V,b(V,De(M,E,void 0,{direction:c?1:-1})))}return{disabled:n,"aria-readonly":g||void 0,"aria-label":c?"Increase":"Decrease","aria-controls":o,tabIndex:-1,style:{WebkitUserSelect:"none",userSelect:"none"},onTouchStart(){D.current=!0},onTouchEnd(){D.current=!1},onClick(E){const V=n||g;if(E.defaultPrevented||V||(vn(k.current)?A.current:E.detail!==0))return;_(E.nativeEvent);const L=s(E)??yr,O=y.current;i(L,{direction:c?1:-1,event:E.nativeEvent,reason:M});const W=C.current??y.current;W!==O&&S(W,en(M,E.nativeEvent))},onPointerDown(E){var O;const V=!E.button||E.button===0;if(E.defaultPrevented||g||!V||n)return;k.current=E.pointerType,A.current=!1,w.current=!0,T.current={x:E.clientX,y:E.clientY},_(E.nativeEvent),vn(E.pointerType)?d.start(Ny,()=>{const W=f.current;f.current=0,w.current&&W!=null&&W<Sy?(v(c,E),A.current=!0):(A.current=!1,N())}):(E.preventDefault(),(O=u.current)==null||O.focus(),v(c,E))},onPointerUp(E){vn(E.pointerType)&&(w.current=!1)},onPointerMove(E){if(n||g||!vn(E.pointerType)||!w.current)return;f.current!=null&&(f.current+=1);const{x:L,y:O}=T.current,W=L-E.clientX,q=O-E.clientY;W**2+q**2>Cy**2&&N()},onMouseEnter(E){const V=n||g;E.defaultPrevented||V||!w.current||D.current||vn(k.current)||v(c,E)},onMouseLeave(){D.current||N()},onMouseUp(){D.current||N()}}}const Ec=x.forwardRef(function(t,n){const{render:r,className:s,disabled:o=!1,nativeButton:i=!0,...u}=t,{allowInputSyncRef:l,disabled:d,formatOptionsRef:c,getStepAmount:w,id:p,incrementValue:f,inputRef:g,inputValue:b,intentionalTouchCheckTimeout:v,isPressedRef:N,locale:y,maxWithDefault:C,movesAfterTouchRef:S,readOnly:T,setValue:D,startAutoChange:A,state:k,stopAutoChange:M,value:_,valueRef:P,lastChangedValueRef:E,onValueCommitted:V}=mr(),L=_!=null&&_>=C,O=o||d||L,W=Tc({isIncrement:!0,inputRef:g,startAutoChange:A,stopAutoChange:M,inputValue:b,disabled:O,readOnly:T,id:p,setValue:D,getStepAmount:w,incrementValue:f,allowInputSyncRef:l,formatOptionsRef:c,valueRef:P,isPressedRef:N,intentionalTouchCheckTimeout:v,movesAfterTouchRef:S,locale:y,lastChangedValueRef:E,onValueCommitted:V}),{getButtonProps:q,buttonRef:$}=xa({disabled:O,native:i,focusableWhenDisabled:!0}),G=x.useMemo(()=>({...k,disabled:O}),[k,O]);return Ye("button",t,{ref:[n,$],state:G,props:[W,u,q],stateAttributesMapping:mn})});process.env.NODE_ENV!=="production"&&(Ec.displayName="NumberFieldIncrement");const Mc=x.forwardRef(function(t,n){const{render:r,className:s,disabled:o=!1,nativeButton:i=!0,...u}=t,{allowInputSyncRef:l,disabled:d,formatOptionsRef:c,getStepAmount:w,id:p,incrementValue:f,inputRef:g,inputValue:b,intentionalTouchCheckTimeout:v,isPressedRef:N,minWithDefault:y,movesAfterTouchRef:C,readOnly:S,setValue:T,startAutoChange:D,state:A,stopAutoChange:k,value:M,valueRef:_,locale:P,lastChangedValueRef:E,onValueCommitted:V}=mr(),L=M!=null&&M<=y,O=o||d||L,W=Tc({isIncrement:!1,inputRef:g,startAutoChange:D,stopAutoChange:k,inputValue:b,disabled:O,readOnly:S,id:p,setValue:T,getStepAmount:w,incrementValue:f,allowInputSyncRef:l,formatOptionsRef:c,valueRef:_,isPressedRef:N,intentionalTouchCheckTimeout:v,movesAfterTouchRef:C,locale:P,lastChangedValueRef:E,onValueCommitted:V}),{getButtonProps:q,buttonRef:$}=xa({disabled:O,native:i,focusableWhenDisabled:!0}),G=x.useMemo(()=>({...A,disabled:O}),[A,O]);return Ye("button",t,{ref:[n,$],state:G,props:[W,u,q],stateAttributesMapping:mn})});process.env.NODE_ENV!=="production"&&(Mc.displayName="NumberFieldDecrement");function Dy(e,t){const n=x.useRef(e),r=ge(t);re(()=>{n.current!==e&&r(n.current)},[e,r]),re(()=>{n.current=e},[e])}const _y={...Xr,...mn},Py=new Set(["Backspace","Delete","ArrowLeft","ArrowRight","Tab","Enter","Escape"]),Ic=x.forwardRef(function(t,n){const{render:r,className:s,...o}=t,{allowInputSyncRef:i,disabled:u,formatOptionsRef:l,getAllowedNonNumericKeys:d,getStepAmount:c,id:w,incrementValue:p,inputMode:f,inputValue:g,max:b,min:v,name:N,readOnly:y,required:C,setValue:S,state:T,setInputValue:D,locale:A,inputRef:k,value:M,onValueCommitted:_,lastChangedValueRef:P,hasPendingCommitRef:E,valueRef:V}=mr(),{clearErrors:L}=fo(),{validationMode:O,setTouched:W,setFocused:q,invalid:$,shouldValidateOnChange:G,validation:Z}=Vn(),{labelId:H}=Rr(),J=x.useRef(!1),ie=x.useRef(!1);return Po({id:w,commit:Z.commit,value:M,controlRef:k,name:N,getValue:()=>M??null}),Dy(M,F=>{const z=G();if(L(N),z&&Z.commit(M),!(F===M||z)){if(ie.current){ie.current=!1;return}Z.commit(M,!0)}}),Ye("input",t,{ref:[n,k],state:T,props:[{id:w,required:C,disabled:u,readOnly:y,inputMode:f,value:g,type:"text",autoComplete:"off",autoCorrect:"off",spellCheck:"false","aria-roledescription":"Number field","aria-invalid":$||void 0,"aria-labelledby":H,suppressHydrationWarning:!0,onFocus(F){if(F.defaultPrevented||y||u||(q(!0),J.current))return;J.current=!0;const z=F.currentTarget,Y=z.value.length;z.setSelectionRange(Y,Y)},onBlur(F){if(F.defaultPrevented||y||u)return;W(!0),q(!1);const z=!i.current,Y=E.current;if(i.current=!0,g.trim()===""){S(null,De(Qt,F.nativeEvent)),O==="onBlur"&&Z.commit(null),_(null,en(Qt,F.nativeEvent));return}const K=l.current,me=yn(g,A,K);if(me===null)return;const j=(K==null?void 0:K.maximumFractionDigits)!=null||(K==null?void 0:K.minimumFractionDigits)!=null,ee=K==null?void 0:K.maximumFractionDigits,Q=j&&typeof ee=="number"?Number(me.toFixed(ee)):me,ye=en(Hn,F.nativeEvent),je=M!==Q,Ce=z||je||Y;O==="onBlur"&&Z.commit(Q),je&&(ie.current=!0,S(Q,De(Hn,F.nativeEvent))),Ce&&_(Q,ye);const Te=Bt(Q,A,K),xt=ic(me,A,K);!(!j&&me===M&&g===xt)&&g!==Te&&D(Te)},onChange(F){if(F.nativeEvent.defaultPrevented)return;i.current=!1;const z=F.target.value;if(z.trim()===""){D(z),S(null,De(Qt,F.nativeEvent));return}const Y=d();if(!Array.from(z).every(j=>{const ee=j>="0"&&j<="9",Q=Ea.test(j),ye=Ma.test(j),je=pc.test(j),Ce=hc.test(j),Te=bn.test(j);return ee||Q||ye||je||Ce||Te||Y.has(j)}))return;const me=yn(z,A,l.current);D(z),me!==null&&S(me,De(os,F.nativeEvent))},onKeyDown(F){if(F.defaultPrevented||y||u)return;const z=F.nativeEvent;i.current=!0;const Y=d();let K=Y.has(F.key);const{decimal:me,currency:j,percentSign:ee}=Ia(A,l.current),Q=F.currentTarget.selectionStart,ye=F.currentTarget.selectionEnd,je=Q===0&&ye===g.length,Ce=ue=>Q!=null&&ye!=null&&ue>=Q&&ue<ye;if(bn.test(F.key)&&Array.from(Y).some(ue=>bn.test(ue||""))){const ue=g.search(vc),ot=ue!=null&&ue!==-1&&Ce(ue);K=!(bn.test(g)||br.test(g))||je||ot}if(br.test(F.key)&&Array.from(Y).some(ue=>br.test(ue||""))){const ue=g.search(xc),ot=ue!=null&&ue!==-1&&Ce(ue);K=!(bn.test(g)||br.test(g))||je||ot}[me,j,ee].forEach(ue=>{if(F.key===ue){const ot=g.indexOf(ue),Nt=Ce(ot);K=!g.includes(ue)||je||Nt}});const Te=F.key>="0"&&F.key<="9",xt=Ea.test(F.key),Cn=Ma.test(F.key),Mr=hc.test(F.key),Tn=Py.has(F.key);if(F.which===229||F.altKey||F.ctrlKey||F.metaKey||K||Te||xt||Mr||Cn||Tn)return;const En=yn(g,A,l.current),Mn=c(F)??yr;ef(F);const Xe=en(Rt,z);F.key==="ArrowUp"?(p(Mn,{direction:1,currentValue:En,event:z,reason:Rt}),_(P.current??V.current,Xe)):F.key==="ArrowDown"?(p(Mn,{direction:-1,currentValue:En,event:z,reason:Rt}),_(P.current??V.current,Xe)):F.key==="Home"&&v!=null?(S(v,De(Rt,z)),_(P.current??V.current,Xe)):F.key==="End"&&b!=null&&(S(b,De(Rt,z)),_(P.current??V.current,Xe))},onPaste(F){if(F.defaultPrevented||y||u)return;F.preventDefault();const Y=(F.clipboardData||window.Clipboard).getData("text/plain"),K=yn(Y,A,l.current);K!==null&&(i.current=!1,S(K,De(is,F.nativeEvent)),D(Y))}},Z.getValidationProps(),o],stateAttributesMapping:_y})});process.env.NODE_ENV!=="production"&&(Ic.displayName="NumberFieldInput");const Vy={wuStepper:"_wuStepper_apbnq_1"},Oy=({onChange:e,Label:t,defaultValue:n=0,readonly:r,dir:s,step:o=1,min:i,max:u,value:l,className:d,labelPosition:c="left",disabled:w,resetInvalidValueOnBlur:p=!0,...f})=>{const g=x.useId(),[b,v]=x.useState(l!==void 0?Number(l):n||0);x.useEffect(()=>{l!==void 0&&v(Number(l))},[l]);const N=A=>{v(A),e==null||e(A)},y=A=>{const k=Number(A.target.value);Number.isNaN(k)||v(k)},C=()=>{p&&(i!==void 0&&b<i?(v(i),e==null||e(i)):u!==void 0&&b>u&&(v(u),e==null||e(u)))};x.useEffect(()=>{l&&n&&console.warn("As both value and defaultValue are passed, value will be used")},[l,n]);const S={inc:r||u!==void 0&&b>=u||w,dec:r||i!==void 0&&b<=i||w},T=i!==void 0&&b<i||u!==void 0&&b>u,D=m("wu-flex wu-items-center wu-justify-center wu-rounded-none wu-bg-gray-10 wu-w-8 wu-h-8 wu-text-blue-q wu-p-2 wu-absolute wu-top-0 hover:wu-bg-gray-20","disabled:wu-cursor-not-allowed disabled:wu-bg-black/10 disabled:wu-text-gray-subtle disabled:wu-outline-gray-subtle");return a.jsxs(Nc,{id:g,value:b,step:o,readOnly:r,onValueChange:A=>typeof A=="number"&&N(A),dir:s,className:m("wu-flex wu-stepper",s==="rtl"&&c!=="top"&&"wu-gap-2",Vy.wuStepper,Fy({labelPosition:c}),d),children:[t&&a.jsx(ke,{htmlFor:g,className:"wu-input-label",children:t}),a.jsxs(Cc,{className:"wu-flex wu-max-w-[97px] wu-relative",children:[a.jsx(Mc,{"aria-label":"decrement",className:m(D,s==="rtl"?"wu-right-0":"wu-left-0","wu-stepper-button"),disabled:S.dec,children:a.jsx("span",{className:"wu-text-base wm-minimize"})}),a.jsx(Ic,{"aria-label":"stepper",role:"spinbutton",type:"text","aria-invalid":T||void 0,dir:s,className:m("wu-flex wu-w-[97px] wu-h-8 wu-border-b wu-border-gray-subtle wu-bg-gray-10 wu-p-2 wu-text-sm wu-font-normal wu-text-gray-lead","wu-h-[33px] wu-text-center wu-text-blue-q wu-text-xs wu-rounded-t-sm ","focus:wu-border-blue-p focus-visible:wu-outline-none wu-transition-colors hover:wu-border-gray-40","disabled:wu-cursor-not-allowed disabled:wu-bg-gray-20 disabled:wu-border-gray-40 disabled:wu-text-gray-subtle","read-only:wu-cursor-not-allowed read-only:wu-bg-gray-20 read-only:wu-border-gray-40 read-only:wu-text-gray-subtle",T&&"wu-border-red-deep focus:wu-border-red-deep","wu-stepper-input"),readOnly:r,onChange:y,onBlur:C,disabled:w,min:i,max:u,step:o,value:b,...f}),a.jsx(Ec,{"aria-label":"increment",className:m(D,s==="rtl"?"wu-left-0":"wu-right-0","wu-stepper-button"),disabled:S.inc,children:a.jsx("span",{className:"wu-text-base wm-add"})})]})]})},Fy=qe.cva("wu-flex wu-w-fit",{variants:{labelPosition:{left:"wu-flex-row wu-text-right wu-gap-2 wu-items-center",top:"wu-flex-col"}}}),Le={container:"_container_1cpdq_1",sidebar:"_sidebar_1cpdq_5",content:"_content_1cpdq_13",sourceWrapper:"_sourceWrapper_1cpdq_17",list:"_list_1cpdq_25",listItem:"_listItem_1cpdq_29",listItemActive:"_listItemActive_1cpdq_42",label:"_label_1cpdq_46",icon:"_icon_1cpdq_50",sharedWrapper:"_sharedWrapper_1cpdq_54"},Ac=h.memo(({className:e,label:t="Shared surveys",...n})=>a.jsxs("button",{className:m(Le.sharedWrapper,e),"data-slot":"survey-select-shared","aria-label":t,...n,children:[a.jsx("span",{className:"wm-share","aria-hidden":"true"}),a.jsx("span",{children:t})]}));Ac.displayName="WuSharedSurvey";const Ly=(e,t=!1)=>{if(e)return a.jsx("span",{className:Le.icon,"aria-hidden":"true",children:e});const n=t?"wm-folder-supervised":"wm-folder";return a.jsx("span",{className:m(Le.icon,n),"aria-hidden":"true"})},kc=h.memo(({children:e,icon:t,isActive:n,isShared:r,className:s,...o})=>a.jsxs("button",{className:m(Le.listItem,n&&Le.listItemActive,s),"aria-selected":n,"data-slot":"survey-select-item",type:"button",...o,children:[Ly(t,r),a.jsx("span",{className:Le.label,children:e})]}));kc.displayName="WuSurveyItem";const Dc=h.memo(({children:e,className:t,...n})=>a.jsx("div",{className:m(Le.list,t),...n,children:e}));Dc.displayName="WuSurveyList";const _c=e=>{const{className:t,variant:n="outlined",...r}=e;return a.jsx("div",{className:Le.sourceWrapper,"data-slot":"survey-select-source",children:a.jsx(fl,{variant:n,showGroupSeparator:!0,className:m(Le.source,t),...r})})};_c.displayName="WuSurveySource";const Wy=h.memo(_c),Pc=h.memo(({Sidebar:e,children:t,className:n,...r})=>a.jsxs("div",{className:m(Le.container,n),role:"region","aria-label":"Survey selection interface","data-slot":"survey-select",...r,children:[e&&a.jsx("div",{className:Le.sidebar,role:"complementary","aria-label":"Survey sidebar","data-slot":"survey-select-sidebar",children:e}),a.jsx("div",{className:Le.content,"aria-label":"Survey content","data-slot":"survey-select-content",children:t})]}));Pc.displayName="WuSurveySelect";const Vc=qe.cva("wu-inline-flex wu-items-center wu-justify-center wu-text-sm wu-font-medium wu-ring-offset-background wu-transition-colors hover:wu-bg-muted hover:wu-text-muted-foreground focus-visible:wu-outline-none focus-visible:wu-ring-2 focus-visible:wu-ring-ring focus-visible:wu-ring-offset-2 disabled:wu-cursor-not-allowed disabled:wu-opacity-80",{variants:{variant:{default:"wu-bg-transparent",outline:"wu-border wu-border-input wu-bg-transparent hover:wu-bg-accent hover:wu-text-accent-foreground"},size:{default:"wu-h-10 wu-px-3",sm:"wu-h-9 wu-px-2.5",lg:"wu-h-11 wu-px-5"}},defaultVariants:{variant:"default",size:"default"}}),By=x.forwardRef(({className:e,variant:t,size:n,...r},s)=>a.jsx(Ka.Root,{ref:s,className:m(Vc({variant:t,size:n,className:e})),...r}));By.displayName=Ka.Root.displayName;const Oc=x.createContext({size:"default",variant:"default"}),vr=x.forwardRef(({className:e,variant:t,size:n,children:r,...s},o)=>a.jsx(An.Root,{ref:o,className:m("wu-flex wu-items-center wu-justify-center wu-gap-1",e),...s,children:a.jsx(Oc.Provider,{value:{variant:t,size:n},children:r})}));vr.displayName=An.Root.displayName;const vt=x.forwardRef(({className:e,children:t,variant:n,size:r,...s},o)=>{const i=x.useContext(Oc);return a.jsx(An.Item,{ref:o,className:m(Vc({variant:i.variant||n,size:i.size||r}),e),...s,children:t})});vt.displayName=An.Item.displayName;const Fc=h.forwardRef((e,t)=>{const{options:n,value:r,disabled:s,dir:o,onChange:i}=e,u=l=>m("wu-w-8 wu-h-8 wu-text-xl wu-leading-5 wu-rounded-full wu-text-gray-lead wu-relative wu-z-10 wu-p-0 wu-flex wu-items-center wu-justify-center",s&&"wu-cursor-not-allowed data-[state=on]:wu-text-gray-lead",l===r&&"wu-text-white",s&&r===l&&"wu-text-gray-lead","wu-switcher-icon-tab-item");return a.jsx(a.Fragment,{children:a.jsxs(vr,{ref:t,type:"single",value:r,onValueChange:i,disabled:s,dir:o,className:m("wu-relative wu-group wu-flex wu-flex-row wu-items-start wu-justify-start wu-gap-0 wu-w-16 wu-bg-gray-25 wu-rounded-full",s&&"wu-cursor-not-allowed","wu-switcher-icon-tab-group"),children:[a.jsx("div",{role:"slider",className:m("wu-absolute wu-z-0 wu-w-8 wu-h-8 wu-bg-blue-p wu-rounded-full wu-transition-transform wu-duration-300 wu-ease-in-out",r==="opt1"&&"",r==="opt2"&&o!=="rtl"&&"wu-translate-x-full",r==="opt2"&&o==="rtl"&&"-wu-translate-x-full",s&&"wu-bg-gray-40","wu-switcher-icon-tab-slider")}),a.jsx(vt,{value:"opt1",className:u("opt1"),children:n[0].label}),a.jsx(vt,{value:"opt2",className:u("opt2"),children:n[1].label})]})})});Fc.displayName="_IconTab";const Lc=h.forwardRef((e,t)=>{const{options:n,value:r,disabled:s,dir:o,size:i="md",onChange:u}=e,l=d=>m("wu-w-1/2 wu-text-xs wu-rounded-full wu-text-gray-lead wu-relative wu-z-10 wu-font-normal",s&&"wu-cursor-not-allowed data-[state=on]:wu-text-gray-lead",i==="sm"&&"wu-h-6 wu-min-w-20",i==="md"&&"wu-h-8 wu-min-w-28",i==="lg"&&"wu-h-10 wu-min-w-36",d===r&&"wu-text-white wu-font-medium",s&&r===d&&"wu-text-gray-lead","wu-switcher-tab-item");return a.jsx(a.Fragment,{children:a.jsxs(vr,{ref:t,type:"single",value:r,onValueChange:u,disabled:s,dir:o,className:m("wu-relative group wu-flex wu-flex-row wu-items-start wu-justify-start wu-gap-0 wu-w-fit wu-bg-gray-25 wu-rounded-full",s&&"wu-cursor-not-allowed","wu-switcher-tab-group"),children:[a.jsx("div",{role:"slider",className:m("wu-absolute wu-z-0 wu-w-1/2 wu-bg-blue-p wu-rounded-full wu-transition-transform wu-duration-300 wu-ease-in-out ",i==="sm"&&"wu-h-6 wu-min-w-20",i==="md"&&"wu-h-8 wu-min-w-28",i==="lg"&&"wu-h-10 wu-min-w-36",r==="opt1"&&"",r==="opt2"&&o!=="rtl"&&"wu-translate-x-full",r==="opt2"&&o==="rtl"&&"-wu-translate-x-full",s&&"wu-bg-gray-40","wu-switcher-tab-slider")}),a.jsx(vt,{value:"opt1",className:l("opt1"),children:a.jsx("div",{className:"wu-min-w-16 wu-max-w-[136px] wu-overflow-hidden wu-text-ellipsis wu-text-nowrap",children:n[0].label})}),a.jsx(vt,{value:"opt2",className:l("opt2"),children:a.jsx("div",{className:"wu-min-w-16 wu-max-w-[136px] wu-overflow-hidden wu-text-ellipsis wu-text-nowrap",children:n[1].label})})]})})});Lc.displayName="_Tab";const Wc=h.forwardRef((e,t)=>{const{options:n,value:r,disabled:s,dir:o,onChange:i}=e,u=w=>m("wu-p-0 wu-w-fit wu-text-xs wu-text-gray-lead wu-h-fit wu-font-normal",s&&"wu-cursor-not-allowed data-[state=on]:wu-text-gray-subtle wu-text-gray-subtle",w===r&&"wu-text-primary wu-font-medium",s&&r===w&&"wu-text-gray-lead","wu-switcher-toggle-item"),l=m("wu-w-fit wu-gap-2",s&&"wu-cursor-not-allowed","wu-switcher-toggle-group"),d=m("wu-flex wu-items-center wu-justify-center wu-w-8 wu-h-3 wu-p-0 wu-border wu-rounded-full wu-cursor-pointer wu-border-blue-p focus:wu-outline-none focus-visible:wu-ring-2 focus-visible:wu-ring-blue-soft focus-visible:wu-ring-offset-2",s&&"wu-border-gray-subtle wu-cursor-not-allowed","wu-switcher-toggle-button"),c=m("wu-w-2 wu-h-2 wu-bg-blue-p wu-rounded-full wu-transition-transform wu-duration-300 wu-ease-in-out",r==="opt1"&&o!=="rtl"&&"-wu-translate-x-[10px]",r==="opt1"&&o==="rtl"&&"wu-translate-x-[10px]",r==="opt2"&&o!=="rtl"&&"wu-translate-x-[10px]",r==="opt2"&&o==="rtl"&&"-wu-translate-x-[10px]",s&&"wu-hidden","wu-switcher-toggle-knob");return a.jsx(a.Fragment,{children:a.jsxs(vr,{ref:t,type:"single",value:r,disabled:s,dir:o,className:l,onValueChange:i,children:[a.jsx(vt,{value:"opt1",className:u("opt1"),children:a.jsx("div",{className:"wu-max-w-[136px] wu-overflow-hidden wu-text-ellipsis wu-text-nowrap wu-text-right wu-switcher-toggle-item-label",children:n[0].label})}),a.jsx("button",{onClick:()=>i(r==="opt1"?"opt2":"opt1"),className:d,disabled:s,"aria-label":"knob",dir:o,children:a.jsx("div",{className:c,role:"knob",dir:o})}),a.jsx(vt,{value:"opt2",className:u("opt2"),children:a.jsx("div",{className:"wu-max-w-[136px] wu-overflow-hidden wu-text-ellipsis wu-text-nowrap wu-switcher-toggle-item-label",children:n[1].label})})]})})});Wc.displayName="_Toggle";const Bc=h.forwardRef((e,t)=>{const{type:n,options:r,value:s,disabled:o,dir:i,size:u,onChange:l,toggle:d=!0,...c}=e,[w,p]=h.useState(),f=g=>{let b=w;g!==""?b=g:d&&(b=w==="opt1"?"opt2":"opt1");const v=b==="opt1"?r[0].value:r[1].value;l&&l(v),p(b)};if(h.useEffect(()=>{if(!Array.isArray(r)||r.length<2)throw new Error("Options are not sufficient");p(s===r[0].value?"opt1":"opt2")},[r,s]),!Array.isArray(r)||r.length<2)return a.jsx(a.Fragment,{});switch(n){case"toggle":return a.jsx(Wc,{...c,ref:t,options:r,value:w||"opt1",onChange:f,disabled:o,dir:i});case"iconTab":return a.jsx(Fc,{ref:t,options:r,value:w||"opt1",onChange:f,disabled:o,dir:i});default:return a.jsx(Lc,{ref:t,options:r,value:w||"opt1",onChange:f,disabled:o,dir:i,size:u})}});Bc.displayName="WuSwitcher";const qc=ct.Root,ka=x.forwardRef(({className:e,children:t,...n},r)=>a.jsx(ct.List,{className:m("wu-relative wu-flex",e),...n,ref:r,children:t}));ka.displayName=ct.List.displayName;const Da=x.forwardRef(({className:e,...t},n)=>a.jsx(ct.Trigger,{ref:n,className:m("wu-relative wu-inline-flex wu-items-center wu-whitespace-nowrap wu-text-xs wu-px-4 wu-py-2 wu-text-gray-600 wu-transition-colors wu-duration-200 data-[state=active]:wu-text-blue-p","data-[orientation=horizontal]:wu-justify-center",e),...t}));Da.displayName=ct.Trigger.displayName;const $c=x.forwardRef(({className:e,...t},n)=>a.jsx(ct.Content,{ref:n,className:e,...t}));$c.displayName=ct.Content.displayName;const Hc=({items:e,enableAnimation:t})=>{const n="wu-duration-700 wu-ease-in-out wu-transition-all data-[state=inactive]:wu-absolute data-[state=inactive]:wu-inset-0 data-[state=inactive]:wu-opacity-0 data-[state=inactive]:wu-z-0 data-[state=active]:wu-relative data-[state=active]:wu-opacity-100 data-[state=active]:wu-z-10";return a.jsx("div",{className:m("wu-w-full wu-h-full wu-flex-1 wu-overflow-auto",t&&"wu-relative wu-overflow-hidden","wu-tab-content-container"),children:e.map(r=>a.jsx($c,{value:r.value,forceMount:t||void 0,className:m("wu-w-full wu-h-full wu-overflow-y-auto",t&&n,"wu-tab-content"),children:r.Content},r.value))})},qy=e=>{const[t,n]=h.useState(!1),[r,s]=h.useState(!1),o=()=>{const u=e.current;u&&(n(u.scrollLeft>0),s(u.scrollLeft+u.clientWidth<u.scrollWidth))};return h.useEffect(()=>{const u=e.current;return o(),u&&u.addEventListener("scroll",o),window.addEventListener("resize",o),()=>{u&&u.removeEventListener("scroll",o),window.removeEventListener("resize",o)}},[e]),{showLeftArrow:t,showRightArrow:r,scrollByTab:u=>{const l=e.current;if(l){const d=(u==="right"?l.clientWidth:-l.clientWidth)*.8;l.scrollBy({left:d,behavior:"smooth"})}}}},zc=(e,t)=>{const[n,r]=h.useState({width:0,left:0,height:0,top:0}),s=t==="vertical";return h.useEffect(()=>{const o=e.current;if(o){const i=()=>{const l=o.querySelector('[data-state="active"]');if(l){const d={width:s?2:l.offsetWidth,left:s?0:l.offsetLeft,height:s?l.offsetHeight:1,top:s?l.offsetTop:0};r(d)}},u=new MutationObserver(i);return u.observe(o,{attributes:!0,subtree:!0}),i(),()=>{u.disconnect()}}},[e,s]),n},$y=({items:e,value:t,defaultValue:n,onValueChange:r,enableAnimation:s=!1,className:o,dir:i="ltr",position:u="top"})=>{var C;const l=h.useRef(null),d=zc(l,"horizontal"),{showLeftArrow:c,showRightArrow:w,scrollByTab:p}=qy(l),[f,g]=h.useState(!1),b=()=>p("left"),v=()=>p("right"),N=S=>a.jsx("div",{"data-testid":`gradient-overlay-${S}`,className:m("wu-absolute wu-top-0 wu-h-full wu-w-20 wu-z-10 wu-pointer-events-none",S==="left"?"wu-left-0 wu-bg-gradient-to-r wu-from-white wu-to-transparent":"wu-right-0 wu-bg-gradient-to-l wu-from-white wu-to-transparent")}),y=(S,T,D)=>{const A=T==="left";return a.jsx("button",{onClick:S,className:m("wu-absolute wu-z-20 wu-flex wu-items-center wu-justify-center wu-px-1 wu-py-1 wu-transition-all wu-duration-300 wu-h-8",A?"wu-left-0":"wu-right-0",D&&"wu-translate-x-0 wu-opacity-100",!D&&[A?"-wu-translate-x-full":"wu-translate-x-full","wu-opacity-0"]),"aria-label":A?"scroll-left":"scroll-right",children:a.jsx("span",{className:m("wu-text-blue-p wu-text-lg",A?"wm-keyboard-arrow-left":"wm-keyboard-arrow-right")})})};return a.jsxs(qc,{defaultValue:n||((C=e[0])==null?void 0:C.value),value:t,onValueChange:r,orientation:"horizontal",dir:i,className:m("wu-relative wu-flex wu-flex-col wu-w-full wu-h-full",u==="bottom"?"wu-flex-col-reverse":"wu-flex-col",o),role:"tabs",children:[a.jsxs("div",{className:"wu-relative wu-flex wu-overflow-hidden wu-shrink-0 wu-border-b wu-border-gray-200",onMouseEnter:()=>g(!0),onMouseLeave:()=>g(!1),"aria-label":"tablistWrapper",children:[c&&f&&N("left"),y(b,"left",c&&f),a.jsxs(ka,{ref:l,className:m("wu-relative wu-flex wu-w-full wu-overflow-x-auto wu-flex-row","[&::-webkit-scrollbar]:wu-hidden [-ms-overflow-style:none] [scrollbar-width:none]","wu-tablist"),children:[e.map(S=>a.jsx(Da,{value:S.value,children:S.Trigger},S.value)),a.jsx("span",{className:"wu-absolute wu-bg-blue-p wu-transition-all wu-duration-300 wu-indicator wu-bottom-0",style:{width:d.width,left:d.left,height:1.25,bottom:u==="bottom"?void 0:0,top:u==="bottom"?0:void 0}})]}),w&&f&&N("right"),y(v,"right",w&&f)]}),a.jsx(Hc,{items:e,enableAnimation:s})]})},Hy=e=>{const[t,n]=h.useState(!1),[r,s]=h.useState(!1),o=()=>{const u=e.current;u&&(n(u.scrollTop>0),s(u.scrollTop+u.clientHeight<u.scrollHeight))};return h.useEffect(()=>{const u=e.current;if(u)return o(),u.addEventListener("scroll",o),window.addEventListener("resize",o),()=>{u.removeEventListener("scroll",o),window.removeEventListener("resize",o)}},[e]),{showTopArrow:t,showBottomArrow:r,scrollByTab:u=>{const l=e.current;if(l){const d=(u==="down"?l.clientHeight:-l.clientHeight)*.8;l.scrollBy({top:d,behavior:"smooth"})}}}},zy=({items:e,value:t,defaultValue:n,onValueChange:r,enableAnimation:s=!1,className:o,dir:i="ltr",position:u="left"})=>{var C;const l=h.useRef(null),d=zc(l,"vertical"),{showTopArrow:c,showBottomArrow:w,scrollByTab:p}=Hy(l),[f,g]=h.useState(!1),b=()=>p("up"),v=()=>p("down"),N=S=>a.jsx("div",{className:m("wu-absolute wu-left-0 wu-w-full wu-h-12 wu-z-10 wu-pointer-events-none",S==="top"?"wu-top-0 wu-bg-gradient-to-b wu-from-white wu-to-transparent":"wu-bottom-0 wu-bg-gradient-to-t wu-from-white wu-to-transparent")}),y=(S,T,D)=>{const A=T==="up";return a.jsx("button",{onClick:S,className:m("wu-absolute wu-z-20 wu-flex wu-items-center wu-justify-center wu-px-1 wu-py-1 wu-transition-all wu-duration-300 wu-w-full",A?"-wu-top-1":"-wu-bottom-1",D&&"wu-translate-y-0 wu-opacity-100",!D&&[A?"-wu-translate-y-full":"wu-translate-y-full","wu-opacity-0"]),"aria-label":A?"scroll-up":"scroll-down",children:a.jsx("span",{className:m("wu-text-blue-p wu-text-lg",A?"wm-keyboard-arrow-up":"wm-keyboard-arrow-down")})})};return a.jsxs(qc,{defaultValue:n||((C=e[0])==null?void 0:C.value),value:t,onValueChange:r,orientation:"vertical",dir:i,className:m("wu-relative wu-h-full wu-w-full wu-flex",u==="left"?"wu-flex-row":"wu-flex-row-reverse",o),role:"tabs",children:[a.jsxs("div",{className:"wu-relative wu-flex wu-overflow-hidden wu-shrink-0",onMouseEnter:()=>g(!0),onMouseLeave:()=>g(!1),"aria-label":"tablistWrapper",children:[c&&f&&N("top"),y(b,"up",c&&f),a.jsxs(ka,{ref:l,className:m("wu-relative wu-flex wu-h-full wu-overflow-y-auto wu-flex-col","[&::-webkit-scrollbar]:wu-hidden [-ms-overflow-style:none] [scrollbar-width:none]","wu-tablist"),children:[e.map(S=>a.jsx(Da,{value:S.value,children:S.Trigger},S.value)),a.jsx("span",{className:"wu-absolute wu-bg-blue-p wu-transition-all wu-duration-300 wu-indicator",style:{width:2,left:u==="left"?0:void 0,right:u==="right"?0:void 0,height:d.height,top:d.top}})]}),w&&f&&N("bottom"),y(v,"down",w&&f)]}),a.jsx(Hc,{items:e,enableAnimation:s})]})},Uy=({...e})=>e.orientation==="vertical"?a.jsx(zy,{...e}):a.jsx($y,{...e}),_a=x.forwardRef(({className:e,...t},n)=>a.jsx("table",{ref:n,className:m("wu-w-full wu-caption-bottom wu-text-sm",e),...t}));_a.displayName="Table";const Pa=x.forwardRef(({className:e,...t},n)=>a.jsx("thead",{ref:n,className:m("[&_tr]:wu-border-b",e),...t}));Pa.displayName="TableHeader";const xn=x.forwardRef(({className:e,...t},n)=>a.jsx("tbody",{ref:n,className:m("",e),...t}));xn.displayName="TableBody";const jy=x.forwardRef(({className:e,...t},n)=>a.jsx("tfoot",{ref:n,className:m("wu-border-t wu-bg-muted/50 wu-font-medium [&>tr]:last:wu-border-b-0",e),...t}));jy.displayName="TableFooter";const at=x.forwardRef(({className:e,...t},n)=>a.jsx("tr",{ref:n,className:m("wu-border-b wu-transition-colors wu-hover:wu-bg-muted/50 data-[state=selected]:wu-bg-muted",e),...t}));at.displayName="TableRow";const xr=x.forwardRef(({className:e,...t},n)=>a.jsx("th",{ref:n,className:m("wu-px-4 wu-text-left wu-align-middle wu-font-medium wu-text-muted-foreground [&:has([role=checkbox])]:wu-pr-0",e),...t}));xr.displayName="TableHead";const qt=x.forwardRef(({className:e,...t},n)=>a.jsx("td",{ref:n,className:m("wu-p-4 wu-align-middle [&:has([role=checkbox])]:wu-pr-0",e),...t}));qt.displayName="TableCell";const Nn=x.forwardRef(({className:e,...t},n)=>a.jsx("caption",{ref:n,className:m("wu-mt-4 wu-text-sm wu-text-gray-subtle wu-font-normal",e),...t}));Nn.displayName="TableCaption";const Gy=({columns:e,rowSelection:t})=>{const n=(t==null?void 0:t.isEnabled)??!1,r=(t==null?void 0:t.size)??48,{onRowSelect:s,rowUniqueKey:o,isRowDisabled:i,hideSelectAll:u}=t||{},l=h.useCallback(c=>w=>{s==null||s(w?c:[])},[s]);return{finalColumns:h.useMemo(()=>n?[{id:"select",header:({table:c})=>{const w=c.getRowModel().rows.map(f=>f.original).filter(f=>!(i!=null&&i(f))),p=l(w);return u?a.jsx("div",{}):a.jsx(He,{checked:c.getIsSomeRowsSelected()||c.getIsAllRowsSelected(),partial:c.getIsSomeRowsSelected()&&!c.getIsAllRowsSelected(),onChange:f=>{c.toggleAllRowsSelected(!!f),p(!!f)},"aria-label":"Select all","data-testid":c.getIsSomeRowsSelected()&&!c.getIsAllRowsSelected()?"select-partial":"select-all"})},cell:({row:c})=>{const w=(i==null?void 0:i(c.original))??!1;return a.jsx(He,{checked:c.getIsSelected(),disabled:w,onChange:p=>{w||c.toggleSelected(!!p)},"aria-label":String(c.original[o])})},filterable:!1,accessorKey:"select",size:r},...e]:e,[e,n,l,i,u])}};function Uc({data:e,columns:t,rowSelection:n}){const{finalColumns:r}=Gy({columns:t,rowSelection:n}),s=h.useMemo(()=>{if(!(n!=null&&n.isEnabled))return{};const o={};for(const i of n.selectedRows){const u=e.findIndex(l=>l[n.rowUniqueKey]===i[n.rowUniqueKey]);u!==-1&&(o[u]=!0)}return o},[e,n]);return{finalColumns:r,rowSelectionState:s}}const jc=48,Gc="expander";function Kc(e,t){return e?[{id:Gc,accessorKey:Gc,header:"",cell:({row:n})=>{const r=n.getIsExpanded();return a.jsx("button",{type:"button",className:"wu-inline-flex wu-h-full wu-w-full wu-items-center wu-justify-center wu-text-[10px]",onClick:()=>n.toggleExpanded(),"aria-label":r?"Collapse row":"Expand row",children:a.jsx("span",{className:m("wm-arrow-forward-ios wu-transition-all",r?"wu-rotate-90":"")})})},enableSorting:!1,enableColumnFilter:!1,enableGlobalFilter:!1,enableHiding:!1,size:jc},...t]:t}function Ky(e,t){const n=t.map(r=>{var s;return(s=r.columnDef)==null?void 0:s.expandableRowContent}).find(r=>r);return n==null?void 0:n.call(null,e)}function Yc(e,t,n){return e===!0&&(!t||n>t)}const Xc=(e,t)=>m("wu-group wu-transition-colors wu-border-b wu-border-black/[12%]",e&&"wu-bg-blue-p/[8%]",!t&&(e?"hover:wu-bg-blue-p/[16%]":"hover:wu-bg-black/[2%]")),Zc=(e,t="default",n,r=!1)=>m("wu-py-0 wu-font-light wu-text-xs",t==="compact"?"wu-h-8":"wu-h-10",e==="actions"&&"wu-opacity-0 wu-transition-opacity wu-duration-150 wu-ease-in-out group-hover:wu-opacity-100",n==="right"&&"wu-text-right",n==="center"&&"wu-text-center",n==="left"&&"wu-text-left",r&&"wu-overflow-hidden"),Yy=(e="default")=>e==="compact"?"wu-h-8":"wu-h-10",Xy=e=>m({"wu-text-right":e==="right","wu-text-center":e==="center","wu-text-left":e==="left"}),Zy=e=>m({"wu-justify-end":e==="right","wu-justify-center":e==="center"}),Jy=(e,t)=>m("wu-absolute -wu-bottom-[13px] wu-left-0 wm-arrow-drop-up wu-text-xl",e&&"wu-hidden",!t&&"-wu-bottom-[10px]"),Qy=(e,t)=>m("wu-absolute -wu-top-[15px] wu-left-0 wm-arrow-drop-down wu-text-xl",e&&"wu-hidden",!t&&"-wu-top-[11px]"),Jc=({table:e,size:t,NoDataContent:n,isLoading:r,CustomLoader:s,isRowDisabled:o,isRowExpandable:i})=>{const u=e.getVisibleLeafColumns().length,l=e.getRowModel().rows;return r?a.jsx(xn,{children:a.jsx(at,{children:a.jsx(qt,{colSpan:u,className:"wu-text-center wu-h-[35vh] wu-loader-container",children:s??a.jsx(dt,{className:"wu-w-full"})})})}):l!=null&&l.length?a.jsx(xn,{children:l.flatMap((d,c)=>{const w=(o==null?void 0:o(d.original))??!1,p=d.getIsSelected(),f=d.getIsExpanded(),g=a.jsx(at,{"data-disabled":w,"data-state":p&&"selected",className:Xc(p,w),"data-expanded":f,children:d.getVisibleCells().map((N,y)=>{const C=N.column.columnDef;return a.jsx(qt,{className:Zc(N.column.id,t,C.cellAlign),children:Me.flexRender(C.cell,N.getContext())},`${N.id}-${y}`)})},`${d.id}-${c}`),b=i&&f?Ky(d,e.getVisibleLeafColumns()):null,v=b?a.jsx(at,{"data-expanded":"true","data-state":p&&"selected",children:a.jsx(qt,{colSpan:u,children:b})},`${d.id}-expanded-${c}`):null;return v?[g,v]:[g]})}):a.jsx(xn,{children:a.jsx(at,{children:a.jsx(qt,{colSpan:u,children:n})})})},Va=({table:e,sortableColumns:t,manual:n=!1,onSort:r,size:s,isRowSelected:o,HeaderAction:i,isStickyHeader:u,asVirtualContent:l=!1,isRowExpandable:d})=>{var N;const c=s==="compact"?"wu-h-8":"wu-h-10",w=e.getVisibleLeafColumns(),p=y=>{const{id:C,columnDef:S,getIsSorted:T,toggleSorting:D}=y,A=S.header,k=S.headerAlign;if(!t.includes(C))return A;const M=T(),_=M==="asc",P=M==="desc",E=()=>{n?(D(!P),r==null||r({id:C,desc:P})):D(y.getIsSorted()==="asc")};return a.jsxs("button",{onClick:E,"aria-label":`Sort by ${A}`,className:m("wu-flex wu-items-center wu-gap-1 wu-w-full",Zy(k)),children:[A,a.jsxs("div",{className:"wu-relative wu-flex-shrink-0 wu-w-4",children:[a.jsx("span",{className:Qy(_,!!M)}),a.jsx("span",{className:Jy(P,!!M)})]})]})},f=y=>y.column.id==="actions"?a.jsx(xr,{colSpan:y.colSpan,className:"wu-text-xs wu-font-medium",style:{width:`${y.getSize()}px`}},y.id):a.jsx(xr,{colSpan:y.colSpan,className:m("wu-text-xs wu-font-medium wu-bg-[#EEEEEE]","wu-relative wu-z-0",Xy(y.column.columnDef.headerAlign)),style:{width:`${y.getSize()}px`},children:Me.flexRender(p(y.column),y.getContext())},y.id),g=()=>e.getHeaderGroups().map(y=>a.jsx(at,{className:"wu-relative",children:y.headers.map(f)},y.id)),b=()=>{var y;return a.jsxs("div",{className:m("wu-flex wu-items-center wu-border-b wu-border-t wu-bg-gray-20",c),children:[a.jsx("div",{className:m("wu-flex wu-items-center wu-px-4"),style:{width:(y=w[0])==null?void 0:y.getSize(),marginLeft:d?jc:void 0},children:a.jsx(He,{checked:e.getIsSomeRowsSelected()||e.getIsAllRowsSelected(),partial:e.getIsSomeRowsSelected()&&!e.getIsAllRowsSelected(),onChange:C=>e.toggleAllRowsSelected(!!C),"aria-label":"Select all","data-testid":"select-all-header-checkbox"})}),a.jsx("div",{className:"wu-flex-1 wu-flex wu-pr-4",children:i})]})},v=o&&i;if(l){const y=((N=e.getHeaderGroups()[0])==null?void 0:N.headers)??[];return a.jsxs(at,{className:"wu-relative",children:[y.map(f),v&&a.jsx(xr,{colSpan:w.length,className:"wu-p-0 wu-absolute wu-top-0 wu-left-0 wu-right-0 wu-z-10",children:b()})]})}return a.jsxs(Pa,{className:m("wu-border-t wu-border-black/[12%] wu-bg-gray-20 wu-relative",u&&"wu-sticky wu-top-[-.5px] wu-z-10",c),children:[g(),v&&a.jsx("div",{className:m("wu-absolute wu-top-[-1px] wu-left-0 wu-right-0 wu-flex wu-items-center wu-border-b wu-border-t wu-bg-gray-20 wu-z-10",c),children:b()})]})},Qc=h.forwardRef((e,t)=>a.jsx(xn,{...e,ref:t}));Qc.displayName="TableBodyComponent";const Rc=({table:e,size:t,isRowDisabled:n,containerHeight:r=600,sortableColumns:s,HeaderAction:o,isRowSelected:i,manual:u=!1,onSort:l})=>{const d=e.getRowModel().rows,c=e.getVisibleLeafColumns();return a.jsx("div",{className:"wu-w-full",children:a.jsx(Ha.TableVirtuoso,{style:{height:r},totalCount:d.length,fixedHeaderContent:()=>a.jsx(Va,{table:e,sortableColumns:s,manual:u,onSort:l,size:t,isRowSelected:i,HeaderAction:o,asVirtualContent:!0}),itemContent:w=>{const p=d[w];return p?a.jsx(a.Fragment,{children:p.getVisibleCells().map((f,g)=>{const b=f.column.columnDef;return a.jsx(qt,{className:Zc(f.column.id,t,b.cellAlign,!0),children:Me.flexRender(b.cell,f.getContext())},`${f.id}-${g}`)})}):null},components:{Table:({style:w,...p})=>a.jsxs("table",{...p,style:{...w,width:"100%",borderCollapse:"collapse",tableLayout:"fixed"},className:"wu-table-fixed",children:[a.jsx("colgroup",{children:c.map(f=>a.jsx("col",{style:{width:`${f.getSize()}px`}},f.id))}),p.children]}),TableBody:Qc,TableHead:w=>a.jsx(Pa,{...w,className:m("wu-border-t wu-border-black/[12%] wu-bg-gray-20",Yy(t),w.className)}),TableRow:({...w})=>{const p=w["data-index"],f=d[p],g=f?(n==null?void 0:n(f.original))??!1:!1,b=(f==null?void 0:f.getIsSelected())??!1;return a.jsx(at,{...w,"data-disabled":g,"data-state":b&&"selected",className:Xc(b,g)})}}})})},Nr=qe.cva("",{variants:{variant:{striped:'[&_tr:nth-child(even):not([data-expanded])]:wu-bg-zinc-50 [&_tr:nth-child(odd)[data-expanded]:not([data-state="selected"])]:wu-bg-zinc-50',unstyled:"",bordered:"wu-border-collapse wu-border wu-border-black/[12%] [&_th]:wu-border [&_td]:wu-border"}}}),Ry=({data:e,columns:t,isLoading:n=!1,variant:r="unstyled",sort:s,size:o,rowSelection:i,HeaderAction:u,NoDataContent:l,stickyHeader:d=!1,CustomLoader:c,caption:w,virtualization:p,isRowExpandable:f,...g})=>{var _,P;const[b,v]=h.useState({}),{finalColumns:N,rowSelectionState:y}=Uc({data:e,columns:t,rowSelection:i}),C=h.useMemo(()=>N.filter(E=>E.enableSorting).map(E=>E.accessorKey),[N]),S=h.useMemo(()=>Kc(f,N),[N,f]),T=((_=i==null?void 0:i.selectedRows)==null?void 0:_.length)??0,D=E=>{const V=typeof E=="function"?E(y):E,L=[],O=i==null?void 0:i.isRowDisabled;for(const W in V){if(!V[W])continue;const q=e[Number(W)];q&&(O!=null&&O(q)||L.push(q))}i==null||i.onRowSelect(L)},A=Me.useReactTable({data:e,columns:S,getCoreRowModel:Me.getCoreRowModel(),getPaginationRowModel:Me.getPaginationRowModel(),getExpandedRowModel:f?Me.getExpandedRowModel():void 0,manualPagination:!0,manualSorting:!0,manualFiltering:!0,enableRowSelection:i!=null&&i.isRowDisabled?E=>!i.isRowDisabled(E.original):!0,enableExpanding:!!f,state:{...i!=null&&i.isEnabled?{rowSelection:y}:{},...f?{expanded:b}:{}},onRowSelectionChange:D,...f?{onExpandedChange:v}:{}}),k=Yc(p==null?void 0:p.enabled,p==null?void 0:p.threshold,e.length),M=(p==null?void 0:p.maxHeight)??600;return a.jsx("div",{className:m("wu-text-gray-lead wu-table-container wu-relative"),children:k?a.jsxs("div",{className:m("wu-overflow-hidden wu-w-full",Nr({variant:r})),children:[w&&a.jsx(Nn,{className:"wu-font-light",children:w}),n?a.jsx("div",{className:"wu-text-center wu-h-[35vh] wu-flex wu-items-center wu-justify-center",children:c??a.jsx(dt,{className:"wu-w-full"})}):(P=A.getRowModel().rows)!=null&&P.length?a.jsx(Rc,{table:A,size:o,isRowDisabled:i==null?void 0:i.isRowDisabled,containerHeight:M,sortableColumns:C,HeaderAction:u,isRowSelected:T>0,manual:!0,onSort:s==null?void 0:s.onSort}):a.jsx("div",{className:"wu-p-4 wu-text-center",children:l})]}):a.jsxs(_a,{...g,className:m("wu-overflow-x-auto wu-w-full",Nr({variant:r}),"wu-table-fixed",g.className),children:[w&&a.jsx(Nn,{className:"wu-font-light",children:w}),a.jsx(Va,{table:A,sortableColumns:C,manual:!0,onSort:s==null?void 0:s.onSort,size:o,HeaderAction:u,isRowSelected:T>0,isStickyHeader:d,isRowExpandable:f}),a.jsx(Jc,{table:A,size:o,NoDataContent:l,CustomLoader:c,isLoading:n,isRowDisabled:i==null?void 0:i.isRowDisabled,isRowExpandable:f})]})})},ev=({data:e,columns:t,variant:n="unstyled",size:r="default",sort:s,filterText:o,pagination:i,stickyHeader:u,HeaderAction:l,CustomLoader:d,NoDataContent:c,isLoading:w,caption:p,rowSelection:f,isRowExpandable:g,virtualization:b,...v})=>{var G,Z;const[N,y]=h.useState((s==null?void 0:s.initial)||[]),[C,S]=h.useState([]),[T,D]=h.useState((i==null?void 0:i.pageIndex)??0),[A,k]=h.useState({}),{finalColumns:M,rowSelectionState:_}=Uc({data:e,columns:t,rowSelection:f}),P=h.useMemo(()=>M.filter(H=>H.enableSorting).map(H=>H.accessorKey),[M]),E=h.useMemo(()=>M.filter(H=>H.filterable).map(H=>H.accessorKey),[M]),V=((G=f==null?void 0:f.selectedRows)==null?void 0:G.length)??0,L=h.useMemo(()=>Kc(g,M),[M,g]),O=H=>{const J=typeof H=="function"?H(_):H,ie=[],fe=f==null?void 0:f.isRowDisabled;for(const Se in J){if(!J[Se])continue;const F=e[Number(Se)];F&&(fe!=null&&fe(F)||ie.push(F))}f==null||f.onRowSelect(ie)},W=Me.useReactTable({data:e,columns:L,getCoreRowModel:Me.getCoreRowModel(),getFilteredRowModel:Me.getFilteredRowModel(),getSortedRowModel:Me.getSortedRowModel(),getPaginationRowModel:i?Me.getPaginationRowModel():void 0,getExpandedRowModel:g?Me.getExpandedRowModel():void 0,enableRowSelection:f!=null&&f.isRowDisabled?H=>!f.isRowDisabled(H.original):!0,enableExpanding:!!g,state:{sorting:N,columnFilters:C,...i?{pagination:i}:{},...f!=null&&f.isEnabled?{rowSelection:_}:{},...g?{expanded:A}:{}},onSortingChange:y,onColumnFiltersChange:S,onRowSelectionChange:O,...g?{onExpandedChange:k}:{}});h.useEffect(()=>{E.forEach(H=>{var J;(J=W.getColumn(H))==null||J.setFilterValue(o)})},[o,E,W]),h.useEffect(()=>{i&&(i==null?void 0:i.pageIndex)!==T&&(f==null||f.onRowSelect(()=>[]),W.resetRowSelection(),D(i.pageIndex))},[i==null?void 0:i.pageIndex]);const q=Yc(b==null?void 0:b.enabled,b==null?void 0:b.threshold,e.length),$=(b==null?void 0:b.maxHeight)??600;return a.jsx("div",{className:"wu-text-gray-lead wu-table-container wu-relative",children:q?a.jsxs("div",{className:m("wu-overflow-hidden wu-w-full",Nr({variant:n})),children:[p&&a.jsx(Nn,{children:p}),w?a.jsx("div",{className:"wu-text-center wu-h-[35vh] wu-flex wu-items-center wu-justify-center",children:d??a.jsx(dt,{className:"wu-w-full"})}):(Z=W.getRowModel().rows)!=null&&Z.length?a.jsx(Rc,{table:W,size:r,isRowDisabled:f==null?void 0:f.isRowDisabled,containerHeight:$,sortableColumns:P,HeaderAction:l,isRowSelected:V>0}):a.jsx("div",{className:"wu-p-4 wu-text-center",children:c})]}):a.jsxs(_a,{...v,className:m("wu-overflow-x-auto wu-w-full",Nr({variant:n}),"wu-table-fixed",v.className),children:[p&&a.jsx(Nn,{children:p}),a.jsx(Va,{table:W,sortableColumns:P,size:r,HeaderAction:l,isRowSelected:V>0,isStickyHeader:u,isRowExpandable:g}),a.jsx(Jc,{table:W,size:r,NoDataContent:c,CustomLoader:d,isLoading:w,isRowDisabled:f==null?void 0:f.isRowDisabled,isRowExpandable:g})]})})},ed=x.forwardRef(({className:e,...t},n)=>a.jsx("textarea",{className:m("wu-flex wu-w-full wu-border-b wu-border-gray-subtle wu-bg-gray-10 wu-text-gray-lead wu-p-2 wu-text-sm wu-font-normal wu-placeholder:wu-text-gray-subtle wu-placeholder:wu-font-light focus-visible:wu-outline-none disabled:wu-cursor-not-allowed disabled:wu-bg-gray-20 disabled:wu-border-gray-40 disabled:wu-text-gray-subtle read-only:wu-cursor-not-allowed read-only:wu-bg-gray-20 read-only:wu-border-gray-40 read-only:wu-text-gray-subtle focus:wu-border-blue-p wu-transition-colors hover:wu-border-gray-40 ",e),ref:n,...t}));ed.displayName="Textarea";const td=h.forwardRef((e,t)=>{const{Label:n,id:r=Vr(),variant:s="flat",readonly:o,maxLength:i,labelPosition:u="top",...l}=e,d=w=>{l.onChange&&l.onChange(w)},c=kn(u);return a.jsxs("div",{className:m(c,"wu-flex wu-textarea-container"),dir:l.dir,children:[a.jsx(ed,{...l,ref:t,id:r,className:m("wu-peer wu-rounded-t-sm",s==="outlined"?"wu-border wu-border-gray-subtle":"",l.className),onChange:d,readOnly:o,maxLength:i}),n&&a.jsx(ke,{htmlFor:r,className:"wu-textarea-label",children:n})]})});td.displayName="WuTextarea";function tv(e){if(typeof e=="string"&&e.includes("T")){const t=U.parseISO(e);return U.format(t,"HH:mm")}if(typeof e=="string"&&/^\d{2}:\d{2}:\d{2}$/.test(e)){const t=U.parse(e,"HH:mm:ss",new Date);return U.format(t,"HH:mm")}return typeof e=="string"&&/^\d{2}:\d{2}$/.test(e)?e:"00:00"}const nd=["12",...Array.from({length:11},(e,t)=>String(t+1).padStart(2,"0"))],rd=Array.from({length:60},(e,t)=>String(t).padStart(2,"0")),sd=["am","pm"],Sr=50;function nv(e){return Array(Sr).fill(e).flat()}function Oa(e,t){const n=e.indexOf(t);return[...e.slice(n),...e.slice(0,n)]}function rv(e,t){let n=Number(e);return t==="pm"&&n<12&&(n+=12),t==="am"&&n===12&&(n=0),String(n).padStart(2,"0")}function ad(e){const t=Number(e),n=t>=12?"pm":"am",r=t%12===0?12:t%12;return{hour:String(r),meridiem:n}}const sv=({value:e,isSelected:t,onClick:n})=>a.jsx("div",{onClick:n,className:m("wu-w-8 wu-h-8 wu-flex wu-items-center wu-justify-center wu-text-center wu-snap-start wu-rounded-[2px] wu-cursor-pointer hover:wu-bg-blue-p hover:wu-text-white",t&&"wu-bg-blue-p/15 wu-text-blue-p"),children:e}),Fa=({values:e,selectedValue:t,scrollRef:n,onSelect:r,repeatItems:s=!0,className:o})=>a.jsx("div",{ref:n,className:m("wu-overflow-y-scroll wu-w-8 wu-snap-y wu-snap-mandatory [&::-webkit-scrollbar]:hidden [-ms-overflow-style:none] [scrollbar-width:none]",o),role:"presentation",children:(s?nv(e):e).map((i,u)=>a.jsx(sv,{value:i,isSelected:i===t,onClick:()=>r(i)},`${i}-${u}`))});function av(e,t,n,r){const s=h.useMemo(()=>e?Oa(nd,t.padStart(2,"0")):nd,[e]),o=h.useMemo(()=>e?Oa(rd,n.padStart(2,"0")):rd,[e]),i=h.useMemo(()=>e?Oa(sd,r):sd,[e]);return{rotatedHours:s,rotatedMinutes:o,rotatedMeridiem:i}}function ov(e,t,n){h.useEffect(()=>{function r(i){if(i){const u=i.scrollHeight/Sr,l=Math.floor(Sr/2);i.scrollTop=l*u;const d=()=>{const{scrollTop:c}=i,w=Math.round(c/u);(w<=1||w>=Sr-2)&&(i.scrollTop=l*u)};return i.addEventListener("scroll",d),()=>{i.removeEventListener("scroll",d)}}}if(!e)return;const s=r(t.current),o=r(n.current);return()=>{s==null||s(),o==null||o()}},[e,t,n])}const od=({className:e,time:t,Label:n,labelPosition:r,dir:s,...o})=>{const[i,u]=h.useState(!1),[l,d]=h.useState(""),c=h.useRef(null),w=h.useRef(null),p=h.useRef(null),f=h.useRef(null),[g,b]=h.useState("12"),[v,N]=h.useState("00"),[y,C]=h.useState("am");h.useEffect(()=>{if(!t){d(""),b("12"),N("00"),C("am"),c.current&&(c.current.value="");return}const k=tv(t);d(k);const[M,_]=k.split(":"),{hour:P,meridiem:E}=ad(M);b(P),N(_),C(E),c.current&&(c.current.value=k)},[t]),h.useEffect(()=>{const k=M=>{w.current&&!w.current.contains(M.target)&&u(!1)};return document.addEventListener("mousedown",k),()=>{document.removeEventListener("mousedown",k)}},[]),ov(i,p,f);const{rotatedHours:S,rotatedMinutes:T,rotatedMeridiem:D}=av(i,g,v,y),A=h.useCallback((k,M,_)=>{const P=k??g,E=M??v,V=_??y;b(P),N(E),C(V);const L=`${rv(P,V)}:${E}`;d(L)},[g,v,y]);return a.jsxs("div",{className:m("wu-flex wu-gap-1 wu-relative wu-w-fit wu-flex-col",(r==="right"||r==="left")&&"wu-items-center",r==="left"&&"wu-flex-row",r==="right"&&"wu-flex-row-reverse","wu-input-wrapper"),dir:s,children:[n&&a.jsx(ke,{htmlFor:"time-picker",className:"wu-timepicker-label",children:n}),a.jsxs("div",{className:m("relative inline-block"),ref:w,dir:s,children:[a.jsx(Qe,{ref:c,type:"time",value:l,variant:"flat",role:"textbox",onChange:k=>{d(k.target.value);const[M,_]=k.target.value.split(":"),{hour:P,meridiem:E}=ad(M);b(P),N(_),C(E)},className:"wu-w-[136px] wu-h-8 wu-pr-6 wu-border wu-border-lead/40 wu-text-gray-lead wu-timepicker-input",style:{WebkitAppearance:"none",MozAppearance:"textfield"},Icon:a.jsx(Pe,{icon:"wm-schedule",className:m("wu-text-base",o.disabled&&"wu-text-lead/50 wu-pointer-events-none wu-opacity-50"),onClick:()=>u(k=>!k),"data-testid":"wu-timepicker-icon"}),iconPosition:"right",dir:s,...o}),a.jsx("style",{children:`
|
|
19
19
|
input[type="time"]::-webkit-calendar-picker-indicator { display: none; }
|
|
20
|
-
`}),i&&a.jsxs("div",{className:m("wu-absolute wu-w-[136px] wu-h-[228px] wu-flex wu-bg-white wu-border wu-shadow wu-z-50 wu-text-xs wu-gap-1 wu-p-1 wu-border-blue-p wu-text-lead",e),children:[a.jsx(Fa,{values:S,selectedValue:g.padStart(2,"0"),scrollRef:p,onSelect:k=>A(k,v),className:"wu-time-hour-picker"}),a.jsx(Fa,{values:T,selectedValue:v.padStart(2,"0"),scrollRef:f,onSelect:k=>A(g,k),className:"wu-time-minute-picker"}),a.jsx(Fa,{values:D,selectedValue:y,onSelect:k=>A(void 0,void 0,k),className:"wu-time-meridiem-picker",repeatItems:!1})]})]})]})};od.displayName="WuTimePicker";const iv=1,uv=1e6;let La=0;function lv(){return La=(La+1)%Number.MAX_SAFE_INTEGER,La.toString()}const Wa=new Map,id=e=>{if(Wa.has(e))return;const t=setTimeout(()=>{Wa.delete(e),Sn({type:"REMOVE_TOAST",toastId:e})},uv);Wa.set(e,t)},cv=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,iv)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(n=>n.id===t.toast.id?{...n,...t.toast}:n)};case"DISMISS_TOAST":{const{toastId:n}=t;return n?id(n):e.toasts.forEach(r=>{id(r.id)}),{...e,toasts:e.toasts.map(r=>r.id===n||n===void 0?{...r,open:!1}:r)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(n=>n.id!==t.toastId)}}},Cr=[];let Tr={toasts:[]};function Sn(e){Tr=cv(Tr,e),Cr.forEach(t=>{t(Tr)})}function ud({...e}){const t=lv(),n=s=>Sn({type:"UPDATE_TOAST",toast:{...s,id:t}}),r=()=>Sn({type:"DISMISS_TOAST",toastId:t});return Sn({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:s=>{s||r()}}}),{id:t,dismiss:r,update:n}}function dv(){const[e,t]=h.useState(Tr);return h.useEffect(()=>(Cr.push(t),()=>{const n=Cr.indexOf(t);n>-1&&Cr.splice(n,1)}),[e]),{...e,toast:ud,dismiss:n=>Sn({type:"DISMISS_TOAST",toastId:n})}}const wv=()=>({showToast:({message:t,variant:n,duration:r,position:s})=>ud({description:t,variant:n,duration:r,position:s})}),fv=Ie.Provider,pv=qe.cva("wu-fixed wu-z-[100] wu-flex wu-max-h-screen wu-w-full wu-flex-col-reverse wu-px-4 wu-py-2 sm:wu-flex-col md:wu-max-w-[720px] wu-w-fit wu-toast-container",{variants:{position:{topRight:"wu-right-0 wu-top-0",top:"wu-top-0 wu-left-1/2 wu--translate-x-1/2",topLeft:"wu-left-0 wu-top-0",bottom:"wu-bottom-0 wu-left-1/2 wu--translate-x-1/2",bottomRight:"wu-right-0 wu-bottom-0",bottomLeft:"wu-left-0 wu-bottom-0"}},defaultVariants:{position:"top"}}),ld=x.forwardRef(({className:e,position:t,...n},r)=>a.jsx(Ie.Viewport,{ref:r,className:m(pv({position:t}),e),...n}));ld.displayName=Ie.Viewport.displayName;const hv=qe.cva("group wu-pointer-events-auto wu-text-xs wu-font-normal wu-relative wu-flex wu-w-full wu-min-h-12 wu-items-center wu-justify-between wu-overflow-hidden wu-px-4 wu-pr-0 wu-py-2 wu-shadow-sm wu-transition-all data-[swipe=cancel]:wu-translate-y-0 data-[swipe=end]:wu-translate-y-[var(--radix-toast-swipe-end-y)] data-[swipe=move]:wu-translate-y-[var(--radix-toast-swipe-move-y)] data-[swipe=move]:wu-transition-none data-[state=open]:wu-animate-in data-[state=closed]:wu-animate-out data-[swipe=end]:wu-animate-out data-[state=closed]:wu-fade-out-80",{variants:{variant:{default:"wu-border wu-bg-white wu-text-text",success:"wu-text-green-deep wu-bg-green-soft",error:"wu-text-red-deep wu-bg-red-soft",warning:"wu-text-yellow-deep wu-bg-yellow-soft",info:"wu-text-blue-deep wu-bg-blue-soft"},position:{topRight:"data-[state=closed]:wu-slide-out-to-top-full data-[state=open]:wu-slide-in-from-top-full",top:"data-[state=closed]:wu-slide-out-to-top-full data-[state=open]:wu-slide-in-from-top-full",topLeft:"data-[state=closed]:wu-slide-out-to-top-full data-[state=open]:wu-slide-in-from-top-full",bottom:"data-[state=closed]:wu-slide-out-to-bottom-full data-[state=open]:wu-slide-in-from-bottom-full",bottomRight:"data-[state=closed]:wu-slide-out-to-bottom-full data-[state=open]:wu-slide-in-from-bottom-full",bottomLeft:"data-[state=closed]:wu-slide-out-to-bottom-full data-[state=open]:wu-slide-in-from-bottom-full"}},defaultVariants:{variant:"success",position:"top"}}),cd=x.forwardRef(({className:e,variant:t,position:n,...r},s)=>a.jsx(Ie.Root,{ref:s,className:m(hv({variant:t,position:n}),e),...r}));cd.displayName=Ie.Root.displayName;const mv=x.forwardRef(({className:e,...t},n)=>a.jsx(Ie.Action,{ref:n,className:m("wu-inline-flex wu-h-8 wu-shrink-0 wu-items-center wu-justify-center wu-border wu-bg-transparent wu-px-3 wu-text-sm wu-font-medium wu-ring-offset-background wu-transition-colors hover:wu-bg-secondary focus:wu-outline-none focus:wu-ring-2 focus:wu-ring-ring focus:wu-ring-offset-2 disabled:wu-cursor-not-allowed disabled:wu-opacity-50 group-[.destructive]:wu-border-muted/40 group-[.destructive]:hover:wu-border-destructive/30 group-[.destructive]:hover:wu-bg-destructive group-[.destructive]:hover:wu-text-destructive-foreground group-[.destructive]:focus:wu-ring-destructive",e),...t}));mv.displayName=Ie.Action.displayName;const dd=x.forwardRef(({className:e,...t},n)=>a.jsx(Ie.Close,{ref:n,className:m("wu-relative wu-right-4 wu-bottom-2 wu-rounded-sm wu-w-4 wu-h-4 wu-p-1 wu-text-foreground/50 wu-opacity-100 wu-transition-opacity hover:wu-text-foreground focus:wu-opacity-100 focus:wu-outline-none group-hover:wu-opacity-100 group-[.destructive]:wu-text-red-300 group-[.destructive]:hover:wu-text-red-50 group-[.destructive]:focus:wu-ring-red-400 group-[.destructive]:focus:wu-ring-offset-red-600",e),"toast-close":"","aria-label":"Close toast",...t,children:a.jsx("span",{className:"wm-close wu-text-base"})}));dd.displayName=Ie.Close.displayName;const wd=x.forwardRef(({className:e,...t},n)=>a.jsx(Ie.Title,{ref:n,className:m("wu-text-sm wu-font-semibold",e),...t}));wd.displayName=Ie.Title.displayName;const fd=x.forwardRef(({className:e,...t},n)=>a.jsx(Ie.Description,{ref:n,className:m("wu-text-sm wu-opacity-90",e),...t}));fd.displayName=Ie.Description.displayName;function gv(){const{toasts:e}=dv(),t=e.reduce((n,r)=>{const s=r.position||"top";return n[s]||(n[s]=[]),n[s].push(r),n},{});return a.jsx(fv,{children:Object.entries(t).map(([n,r])=>a.jsx(ld,{position:n,children:r.map(function({id:s,title:o,description:i,action:u,variant:l,position:d,...c}){const w={success:"wm-check-circle",info:"wm-info",warning:"wm-error",error:"wm-cancel"};return a.jsxs(cd,{variant:l||"success",position:d,...c,children:[a.jsxs("div",{className:"wu-grid wu-gap-1",children:[o&&a.jsx(wd,{children:o}),i&&a.jsxs(fd,{className:"wu-flex wu-items-center wu-gap-3 wu-pr-6",children:[a.jsx(Pe,{icon:w[l||"success"],className:"wu-text-xl"}),i]})]}),u,a.jsx(dd,{})]},s)})},n))})}const bv=()=>a.jsx(gv,{}),pd=x.forwardRef(({className:e,dir:t,...n},r)=>a.jsx(_r.Root,{className:m("wu-bg-gray-40 wu-inline-flex wu-h-2 wu-w-8 wu-shrink-0 wu-cursor-pointer wu-items-center wu-rounded-full wu-transition-colors focus-visible:wu-outline-none focus-visible:wu-ring-2 focus-visible:wu-ring-ring focus-visible:wu-ring-offset-[5px] focus-visible:wu-ring-offset-background disabled:wu-cursor-not-allowed disabled:wu-opacity-50 data-[state=unchecked]:wu-bg-gray-25 wu-group","hover:wu-bg-gray-subtle hover:data-[state=unchecked]:wu-bg-gray-subtle",e),...n,ref:r,children:a.jsx(_r.Thumb,{className:m("wu-block wu-h-4 wu-w-4 wu-rounded-full wu-bg-gray-subtle wu-shadow-lg wu-ring-0 wu-transition-all data-[state=checked]:wu-bg-blue-p","group-hover:data-[state=unchecked]:wu-bg-gray-lead",t==="rtl"&&"-wu-translate-x-4 data-[state=unchecked]:wu-translate-x-0",t!=="rtl"&&"wu-translate-x-4 data-[state=unchecked]:wu-translate-x-0","wu-toggle-thumb")})}));pd.displayName=_r.Root.displayName;const hd=h.forwardRef((e,t)=>{const{Label:n,labelPosition:r="right",onChange:s,className:o,dir:i,disabled:u,id:l=Vr(),...d}=e;return h.useEffect(()=>{const{checked:c,defaultChecked:w}=d;c!==void 0&&w!==void 0&&console.error("WuToggle: Both `checked` and `defaultChecked` props are set. Use only one of them.")},[d.checked,d.defaultChecked]),a.jsxs("div",{className:m(yv({labelPosition:r}),"wu-toggle-container"),dir:i,children:[a.jsx(pd,{...d,id:l,disabled:u,ref:t,onCheckedChange:s,className:m("wu-peer",o),dir:i}),a.jsx(ke,{htmlFor:l,className:"wu-toggle-label",children:n})]})});hd.displayName="WuToggle";const yv=qe.cva("wu-flex wu-items-center wu-gap-3 wu-w-fit",{variants:{labelPosition:{right:"wu-flex-row",left:"wu-flex-row-reverse",top:"wu-flex-col-reverse wu-items-baseline"}}}),Er=h.createContext(null),vv=()=>{const e=h.useContext(Er);if(!e)throw new Error("useTranslation must be used within a WuTranslationProvider");return e.useTranslation()},xv=()=>{const e=h.useContext(Er);if(!e)throw new Error("useLoadTranslationsFunction must be used within a WuTranslationProvider");return e},Nv=({children:e})=>{const[t,n]=h.useState({}),[r,s]=h.useState({}),o=h.useCallback(async(d,c)=>{try{const p=await(await fetch(d)).json();n(p)}catch(w){console.error("Failed to load translations:",w),c&&n(c)}c&&s(c)},[]),i=h.useCallback(d=>{s(d)},[]),u=h.useCallback(()=>({t:(c,w)=>t[c]?t[c]:r[c]?r[c]:w||c}),[t,r]),l={loadTranslations:o,setFallbackTranslations:i,useTranslation:u};return a.jsx(Er.Provider,{value:l,children:e})},Sv={qualitative:{"--wu-qualitative-1":"#4C5B94","--wu-qualitative-2":"#5B7AAE","--wu-qualitative-3":"#409EB5","--wu-qualitative-4":"#40B59E","--wu-qualitative-5":"#60C790","--wu-qualitative-6":"#9AD69A","--wu-qualitative-7":"#B3BD56","--wu-qualitative-8":"#DD8F40","--wu-qualitative-9":"#CE6550","--wu-qualitative-10":"#AE4C3D","--wu-qualitative-11":"#8F3328","--wu-qualitative-12":"#985D75","--wu-qualitative-13":"#B181A8","--wu-qualitative-14":"#C5A0C2","--wu-qualitative-15":"#DAC2E0","--wu-qualitative-16":"#E3D9E8"},blueSequential:{"--wu-blue-sequential-1":"#EBF8FF","--wu-blue-sequential-2":"#D7EFFF","--wu-blue-sequential-3":"#C2DEFF","--wu-blue-sequential-4":"#AAD0FF","--wu-blue-sequential-5":"#94C1F3","--wu-blue-sequential-6":"#7DB2E7","--wu-blue-sequential-7":"#67A3DB","--wu-blue-sequential-8":"#5194CF","--wu-blue-sequential-9":"#3B85C3","--wu-blue-sequential-10":"#2576B7","--wu-blue-sequential-11":"#256CAC","--wu-blue-sequential-12":"#1A60A6","--wu-blue-sequential-13":"#184994","--wu-blue-sequential-14":"#1C337F","--wu-blue-sequential-15":"#0D2163","--wu-blue-sequential-16":"#00083D"},greenSequential:{"--wu-green-sequential-1":"#E0F9ED","--wu-green-sequential-2":"#C4F3DC","--wu-green-sequential-3":"#A8ECCC","--wu-green-sequential-4":"#8DE5BD","--wu-green-sequential-5":"#78DDB1","--wu-green-sequential-6":"#62D3A3","--wu-green-sequential-7":"#4CC996","--wu-green-sequential-8":"#3ABF8A","--wu-green-sequential-9":"#35AF7F","--wu-green-sequential-10":"#329D75","--wu-green-sequential-11":"#308A6A","--wu-green-sequential-12":"#2D7A60","--wu-green-sequential-13":"#286A55","--wu-green-sequential-14":"#255C4B","--wu-green-sequential-15":"#1F4B3E","--wu-green-sequential-16":"#1B3D34"},redSequential:{"--wu-red-sequential-1":"#FEE9EC","--wu-red-sequential-2":"#FFD2D8","--wu-red-sequential-3":"#FFBBC4","--wu-red-sequential-4":"#FFA6B3","--wu-red-sequential-5":"#FB97A5","--wu-red-sequential-6":"#F78998","--wu-red-sequential-7":"#F37C8C","--wu-red-sequential-8":"#EE6F80","--wu-red-sequential-9":"#E76172","--wu-red-sequential-10":"#E15466","--wu-red-sequential-11":"#DA465B","--wu-red-sequential-12":"#D33B50","--wu-red-sequential-13":"#BC3548","--wu-red-sequential-14":"#A73343","--wu-red-sequential-15":"#91313E","--wu-red-sequential-16":"#7D2D38"},orangeSequential:{"--wu-orange-sequential-1":"#FDEDE5","--wu-orange-sequential-2":"#FCDFCF","--wu-orange-sequential-3":"#FBCFBA","--wu-orange-sequential-4":"#FAC5AB","--wu-orange-sequential-5":"#F7B694","--wu-orange-sequential-6":"#F6AB85","--wu-orange-sequential-7":"#F79D70","--wu-orange-sequential-8":"#F6915F","--wu-orange-sequential-9":"#EF8450","--wu-orange-sequential-10":"#E37944","--wu-orange-sequential-11":"#DB713C","--wu-orange-sequential-12":"#D06530","--wu-orange-sequential-13":"#C95E29","--wu-orange-sequential-14":"#BD521C","--wu-orange-sequential-15":"#B24610","--wu-orange-sequential-16":"#AA3F08"},divergent:{"--wu-red-divergent-1":"#661200","--wu-red-divergent-2":"#A11C00","--wu-red-divergent-3":"#D2300E","--wu-red-divergent-4":"#DF4828","--wu-red-divergent-5":"#EB6A4A","--wu-red-divergent-6":"#F4896C","--wu-red-divergent-7":"#FFC4B3","--wu-red-divergent-8":"#FFE2D9","--wu-divergent-neutral":"#F5F5F5","--wu-blue-divergent-1":"#DBD9E9","--wu-blue-divergent-2":"#B7B5D4","--wu-blue-divergent-3":"#9392BF","--wu-blue-divergent-4":"#7070AA","--wu-blue-divergent-5":"#4A5195","--wu-blue-divergent-6":"#1B3380","--wu-blue-divergent-7":"#182D72","--wu-blue-divergent-8":"#122254"},nps:{"--wu-nps-detractor":"#F85271","--wu-nps-passive":"#F1DA7E","--wu-nps-promoter":"#42BD84"},sentiment:{"--wu-sentiment-negative":"#F85271","--wu-sentiment-slightly-negative":"#F69A79","--wu-sentiment-neutral":"#F1DA7E","--wu-sentiment-slightly-positive":"#94D08B","--wu-sentiment-positive":"#42BD84","--wu-sentiment-no-sentiment":"#E0E0E0"}},md=h.createContext(null),gd=()=>{const e=h.useContext(md);if(!e)throw new Error("[WuTranslateProvider] Must be used within a provider.");return e},Cv=({children:e,defaultLocale:t="en",baseApi:n="https://admin2.questionpro.com/cs/api/gad/translate",keys:r="./wick-ui-i18n.json"})=>{const[s,o]=h.useState(t),[i,u]=h.useState({}),[l,d]=h.useState(!0);h.useEffect(()=>{const w=new AbortController;return(async()=>{d(!0);try{const f=await fetch(r,{signal:w.signal});if(!f.ok)throw new Error("Failed to fetch translation keys");const g=await f.json(),b=await fetch(`${n}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({keys:g,code:s}),signal:w.signal});if(!b.ok)throw new Error("Failed to fetch dictionary");const v=await b.json();u(v)}catch(f){f.name!=="AbortError"&&(console.error("[WuTranslateProvider] Error loading translations:",f),u({}))}finally{d(!1)}})(),()=>{w.abort()}},[s,n,r]);const c=h.useMemo(()=>({dictionary:i,locale:s,setLocale:o,isLoading:l}),[i,s,l]);return a.jsx(md.Provider,{value:c,children:e})},bd=h.memo(({__i18nKey:e})=>{const{dictionary:t}=gd();return a.jsx(a.Fragment,{children:t[e]??e})});bd.displayName="WuTranslate",window&&(window.wickUiVersion="1.35.2",window.wickUiIcon="9.0.0",window.wickUiEditor="0.13.0"),Object.defineProperty(I,"useContext",{enumerable:!0,get:()=>h.useContext}),I.CHART_COLOR_SYSTEM=Sv,I.WuAccordion=qd,I.WuActivityLog=zd,I.WuAppHeader=cw,I.WuAppHeaderAccount=Za,I.WuAppHeaderBar=to,I.WuAppHeaderHelp=Ja,I.WuAppHeaderMenu=eo,I.WuAppHeaderSearch=uw,I.WuButton=Ae,I.WuCalender=jr,I.WuCard=$o,I.WuCardFooter=zo,I.WuCardHeader=Ho,I.WuCheckbox=He,I.WuChip=yf,I.WuCombobox=If,I.WuCopyToClipboard=Af,I.WuDataTable=Ry,I.WuDatePicker=mw,I.WuDateRangePicker=gf,I.WuDisplay=ew,I.WuDrawer=Ff,I.WuDrawerClose=Lf,I.WuDrilldown=qg,I.WuFooter=cl,I.WuFormGroup=hw,I.WuHeading=Qd,I.WuHelpButton=dl,I.WuIcon=Pe,I.WuInput=Qe,I.WuInputError=ww,I.WuInputHint=fw,I.WuLabel=ke,I.WuListbox=fl,I.WuLoader=dt,I.WuMenu=da,I.WuMenuCheckboxItem=kg,I.WuMenuIcon=wa,I.WuMenuItem=wr,I.WuMenuItemGroup=Dg,I.WuMenuRadioItem=_g,I.WuMenuSeparatorItem=Pg,I.WuModal=rb,I.WuModalClose=ib,I.WuModalContent=sb,I.WuModalFooter=ob,I.WuModalHeader=ab,I.WuMonthPicker=wb,I.WuPagination=Ml,I.WuPopover=ff,I.WuPopoverClose=us,I.WuPrimaryNavbar=pb,I.WuRadioGroup=Dl,I.WuScrollArea=mb,I.WuSecondaryNavbar=hb,I.WuSelect=Cl,I.WuSharedSurvey=Ac,I.WuSidebar=jb,I.WuSidebarCollapsibleMenu=Zb,I.WuSidebarContent=Gb,I.WuSidebarFooter=Kb,I.WuSidebarGroup=Yb,I.WuSidebarItem=nc,I.WuSidebarMenu=Xb,I.WuSidebarTrigger=tc,I.WuSpotlight=yl,I.WuStackedCard=Rb,I.WuStackedCardOverlay=ey,I.WuStepper=Oy,I.WuSubMenu=Vg,I.WuSubtext=Rd,I.WuSurveyItem=kc,I.WuSurveyList=Dc,I.WuSurveySelect=Pc,I.WuSurveySource=Wy,I.WuSwitcher=Bc,I.WuTab=Uy,I.WuTable=ev,I.WuText=Jd,I.WuTextarea=td,I.WuTimePicker=od,I.WuToast=bv,I.WuToggle=hd,I.WuTooltip=Dn,I.WuTranslate=bd,I.WuTranslateProvider=Cv,I.WuTranslationContext=Er,I.WuTranslationProvider=Nv,I.WuTruncatedLabel=lw,I.WuVirtualScroll=It,I.calculatePosition=Qb,I.useTranslation=vv,I.useTranslationsContext=xv,I.useWickuiTranslate=gd,I.useWuShowToast=wv,I.useWuSidebar=st,Object.defineProperty(I,Symbol.toStringTag,{value:"Module"})}));
|
|
20
|
+
`}),i&&a.jsxs("div",{className:m("wu-absolute wu-w-[136px] wu-h-[228px] wu-flex wu-bg-white wu-border wu-shadow wu-z-50 wu-text-xs wu-gap-1 wu-p-1 wu-border-blue-p wu-text-lead",e),children:[a.jsx(Fa,{values:S,selectedValue:g.padStart(2,"0"),scrollRef:p,onSelect:k=>A(k,v),className:"wu-time-hour-picker"}),a.jsx(Fa,{values:T,selectedValue:v.padStart(2,"0"),scrollRef:f,onSelect:k=>A(g,k),className:"wu-time-minute-picker"}),a.jsx(Fa,{values:D,selectedValue:y,onSelect:k=>A(void 0,void 0,k),className:"wu-time-meridiem-picker",repeatItems:!1})]})]})]})};od.displayName="WuTimePicker";const iv=1,uv=1e6;let La=0;function lv(){return La=(La+1)%Number.MAX_SAFE_INTEGER,La.toString()}const Wa=new Map,id=e=>{if(Wa.has(e))return;const t=setTimeout(()=>{Wa.delete(e),Sn({type:"REMOVE_TOAST",toastId:e})},uv);Wa.set(e,t)},cv=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,iv)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(n=>n.id===t.toast.id?{...n,...t.toast}:n)};case"DISMISS_TOAST":{const{toastId:n}=t;return n?id(n):e.toasts.forEach(r=>{id(r.id)}),{...e,toasts:e.toasts.map(r=>r.id===n||n===void 0?{...r,open:!1}:r)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(n=>n.id!==t.toastId)}}},Cr=[];let Tr={toasts:[]};function Sn(e){Tr=cv(Tr,e),Cr.forEach(t=>{t(Tr)})}function ud({...e}){const t=lv(),n=s=>Sn({type:"UPDATE_TOAST",toast:{...s,id:t}}),r=()=>Sn({type:"DISMISS_TOAST",toastId:t});return Sn({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:s=>{s||r()}}}),{id:t,dismiss:r,update:n}}function dv(){const[e,t]=h.useState(Tr);return h.useEffect(()=>(Cr.push(t),()=>{const n=Cr.indexOf(t);n>-1&&Cr.splice(n,1)}),[e]),{...e,toast:ud,dismiss:n=>Sn({type:"DISMISS_TOAST",toastId:n})}}const wv=()=>({showToast:({message:t,variant:n,duration:r,position:s})=>ud({description:t,variant:n,duration:r,position:s})}),fv=Ie.Provider,pv=qe.cva("wu-fixed wu-z-[100] wu-flex wu-max-h-screen wu-w-full wu-flex-col-reverse wu-px-4 wu-py-2 sm:wu-flex-col md:wu-max-w-[720px] wu-w-fit wu-toast-container",{variants:{position:{topRight:"wu-right-0 wu-top-0",top:"wu-top-0 wu-left-1/2 wu--translate-x-1/2",topLeft:"wu-left-0 wu-top-0",bottom:"wu-bottom-0 wu-left-1/2 wu--translate-x-1/2",bottomRight:"wu-right-0 wu-bottom-0",bottomLeft:"wu-left-0 wu-bottom-0"}},defaultVariants:{position:"top"}}),ld=x.forwardRef(({className:e,position:t,...n},r)=>a.jsx(Ie.Viewport,{ref:r,className:m(pv({position:t}),e),...n}));ld.displayName=Ie.Viewport.displayName;const hv=qe.cva("group wu-pointer-events-auto wu-text-xs wu-font-normal wu-relative wu-flex wu-w-full wu-min-h-12 wu-items-center wu-justify-between wu-overflow-hidden wu-px-4 wu-pr-0 wu-py-2 wu-shadow-sm wu-transition-all data-[swipe=cancel]:wu-translate-y-0 data-[swipe=end]:wu-translate-y-[var(--radix-toast-swipe-end-y)] data-[swipe=move]:wu-translate-y-[var(--radix-toast-swipe-move-y)] data-[swipe=move]:wu-transition-none data-[state=open]:wu-animate-in data-[state=closed]:wu-animate-out data-[swipe=end]:wu-animate-out data-[state=closed]:wu-fade-out-80",{variants:{variant:{default:"wu-border wu-bg-white wu-text-text",success:"wu-text-green-deep wu-bg-green-soft",error:"wu-text-red-deep wu-bg-red-soft",warning:"wu-text-yellow-deep wu-bg-yellow-soft",info:"wu-text-blue-deep wu-bg-blue-soft"},position:{topRight:"data-[state=closed]:wu-slide-out-to-top-full data-[state=open]:wu-slide-in-from-top-full",top:"data-[state=closed]:wu-slide-out-to-top-full data-[state=open]:wu-slide-in-from-top-full",topLeft:"data-[state=closed]:wu-slide-out-to-top-full data-[state=open]:wu-slide-in-from-top-full",bottom:"data-[state=closed]:wu-slide-out-to-bottom-full data-[state=open]:wu-slide-in-from-bottom-full",bottomRight:"data-[state=closed]:wu-slide-out-to-bottom-full data-[state=open]:wu-slide-in-from-bottom-full",bottomLeft:"data-[state=closed]:wu-slide-out-to-bottom-full data-[state=open]:wu-slide-in-from-bottom-full"}},defaultVariants:{variant:"success",position:"top"}}),cd=x.forwardRef(({className:e,variant:t,position:n,...r},s)=>a.jsx(Ie.Root,{ref:s,className:m(hv({variant:t,position:n}),e),...r}));cd.displayName=Ie.Root.displayName;const mv=x.forwardRef(({className:e,...t},n)=>a.jsx(Ie.Action,{ref:n,className:m("wu-inline-flex wu-h-8 wu-shrink-0 wu-items-center wu-justify-center wu-border wu-bg-transparent wu-px-3 wu-text-sm wu-font-medium wu-ring-offset-background wu-transition-colors hover:wu-bg-secondary focus:wu-outline-none focus:wu-ring-2 focus:wu-ring-ring focus:wu-ring-offset-2 disabled:wu-cursor-not-allowed disabled:wu-opacity-50 group-[.destructive]:wu-border-muted/40 group-[.destructive]:hover:wu-border-destructive/30 group-[.destructive]:hover:wu-bg-destructive group-[.destructive]:hover:wu-text-destructive-foreground group-[.destructive]:focus:wu-ring-destructive",e),...t}));mv.displayName=Ie.Action.displayName;const dd=x.forwardRef(({className:e,...t},n)=>a.jsx(Ie.Close,{ref:n,className:m("wu-relative wu-right-4 wu-bottom-2 wu-rounded-sm wu-w-4 wu-h-4 wu-p-1 wu-text-foreground/50 wu-opacity-100 wu-transition-opacity hover:wu-text-foreground focus:wu-opacity-100 focus:wu-outline-none group-hover:wu-opacity-100 group-[.destructive]:wu-text-red-300 group-[.destructive]:hover:wu-text-red-50 group-[.destructive]:focus:wu-ring-red-400 group-[.destructive]:focus:wu-ring-offset-red-600",e),"toast-close":"","aria-label":"Close toast",...t,children:a.jsx("span",{className:"wm-close wu-text-base"})}));dd.displayName=Ie.Close.displayName;const wd=x.forwardRef(({className:e,...t},n)=>a.jsx(Ie.Title,{ref:n,className:m("wu-text-sm wu-font-semibold",e),...t}));wd.displayName=Ie.Title.displayName;const fd=x.forwardRef(({className:e,...t},n)=>a.jsx(Ie.Description,{ref:n,className:m("wu-text-sm wu-opacity-90",e),...t}));fd.displayName=Ie.Description.displayName;function gv(){const{toasts:e}=dv(),t=e.reduce((n,r)=>{const s=r.position||"top";return n[s]||(n[s]=[]),n[s].push(r),n},{});return a.jsx(fv,{children:Object.entries(t).map(([n,r])=>a.jsx(ld,{position:n,children:r.map(function({id:s,title:o,description:i,action:u,variant:l,position:d,...c}){const w={success:"wm-check-circle",info:"wm-info",warning:"wm-error",error:"wm-cancel"};return a.jsxs(cd,{variant:l||"success",position:d,...c,children:[a.jsxs("div",{className:"wu-grid wu-gap-1",children:[o&&a.jsx(wd,{children:o}),i&&a.jsxs(fd,{className:"wu-flex wu-items-center wu-gap-3 wu-pr-6",children:[a.jsx(Pe,{icon:w[l||"success"],className:"wu-text-xl"}),i]})]}),u,a.jsx(dd,{})]},s)})},n))})}const bv=()=>a.jsx(gv,{}),pd=x.forwardRef(({className:e,dir:t,...n},r)=>a.jsx(_r.Root,{className:m("wu-bg-gray-40 wu-inline-flex wu-h-2 wu-w-8 wu-shrink-0 wu-cursor-pointer wu-items-center wu-rounded-full wu-transition-colors focus-visible:wu-outline-none focus-visible:wu-ring-2 focus-visible:wu-ring-ring focus-visible:wu-ring-offset-[5px] focus-visible:wu-ring-offset-background disabled:wu-cursor-not-allowed disabled:wu-opacity-50 data-[state=unchecked]:wu-bg-gray-25 wu-group","hover:wu-bg-gray-subtle hover:data-[state=unchecked]:wu-bg-gray-subtle",e),...n,ref:r,children:a.jsx(_r.Thumb,{className:m("wu-block wu-h-4 wu-w-4 wu-rounded-full wu-bg-gray-subtle wu-shadow-lg wu-ring-0 wu-transition-all data-[state=checked]:wu-bg-blue-p","group-hover:data-[state=unchecked]:wu-bg-gray-lead",t==="rtl"&&"-wu-translate-x-4 data-[state=unchecked]:wu-translate-x-0",t!=="rtl"&&"wu-translate-x-4 data-[state=unchecked]:wu-translate-x-0","wu-toggle-thumb")})}));pd.displayName=_r.Root.displayName;const hd=h.forwardRef((e,t)=>{const{Label:n,labelPosition:r="right",onChange:s,className:o,dir:i,disabled:u,id:l=Vr(),...d}=e;return h.useEffect(()=>{const{checked:c,defaultChecked:w}=d;c!==void 0&&w!==void 0&&console.error("WuToggle: Both `checked` and `defaultChecked` props are set. Use only one of them.")},[d.checked,d.defaultChecked]),a.jsxs("div",{className:m(yv({labelPosition:r}),"wu-toggle-container"),dir:i,children:[a.jsx(pd,{...d,id:l,disabled:u,ref:t,onCheckedChange:s,className:m("wu-peer",o),dir:i}),a.jsx(ke,{htmlFor:l,className:"wu-toggle-label",children:n})]})});hd.displayName="WuToggle";const yv=qe.cva("wu-flex wu-items-center wu-gap-3 wu-w-fit",{variants:{labelPosition:{right:"wu-flex-row",left:"wu-flex-row-reverse",top:"wu-flex-col-reverse wu-items-baseline"}}}),Er=h.createContext(null),vv=()=>{const e=h.useContext(Er);if(!e)throw new Error("useTranslation must be used within a WuTranslationProvider");return e.useTranslation()},xv=()=>{const e=h.useContext(Er);if(!e)throw new Error("useLoadTranslationsFunction must be used within a WuTranslationProvider");return e},Nv=({children:e})=>{const[t,n]=h.useState({}),[r,s]=h.useState({}),o=h.useCallback(async(d,c)=>{try{const p=await(await fetch(d)).json();n(p)}catch(w){console.error("Failed to load translations:",w),c&&n(c)}c&&s(c)},[]),i=h.useCallback(d=>{s(d)},[]),u=h.useCallback(()=>({t:(c,w)=>t[c]?t[c]:r[c]?r[c]:w||c}),[t,r]),l={loadTranslations:o,setFallbackTranslations:i,useTranslation:u};return a.jsx(Er.Provider,{value:l,children:e})},Sv={qualitative:{"--wu-qualitative-1":"#4C5B94","--wu-qualitative-2":"#5B7AAE","--wu-qualitative-3":"#409EB5","--wu-qualitative-4":"#40B59E","--wu-qualitative-5":"#60C790","--wu-qualitative-6":"#9AD69A","--wu-qualitative-7":"#B3BD56","--wu-qualitative-8":"#DD8F40","--wu-qualitative-9":"#CE6550","--wu-qualitative-10":"#AE4C3D","--wu-qualitative-11":"#8F3328","--wu-qualitative-12":"#985D75","--wu-qualitative-13":"#B181A8","--wu-qualitative-14":"#C5A0C2","--wu-qualitative-15":"#DAC2E0","--wu-qualitative-16":"#E3D9E8"},blueSequential:{"--wu-blue-sequential-1":"#EBF8FF","--wu-blue-sequential-2":"#D7EFFF","--wu-blue-sequential-3":"#C2DEFF","--wu-blue-sequential-4":"#AAD0FF","--wu-blue-sequential-5":"#94C1F3","--wu-blue-sequential-6":"#7DB2E7","--wu-blue-sequential-7":"#67A3DB","--wu-blue-sequential-8":"#5194CF","--wu-blue-sequential-9":"#3B85C3","--wu-blue-sequential-10":"#2576B7","--wu-blue-sequential-11":"#256CAC","--wu-blue-sequential-12":"#1A60A6","--wu-blue-sequential-13":"#184994","--wu-blue-sequential-14":"#1C337F","--wu-blue-sequential-15":"#0D2163","--wu-blue-sequential-16":"#00083D"},greenSequential:{"--wu-green-sequential-1":"#E0F9ED","--wu-green-sequential-2":"#C4F3DC","--wu-green-sequential-3":"#A8ECCC","--wu-green-sequential-4":"#8DE5BD","--wu-green-sequential-5":"#78DDB1","--wu-green-sequential-6":"#62D3A3","--wu-green-sequential-7":"#4CC996","--wu-green-sequential-8":"#3ABF8A","--wu-green-sequential-9":"#35AF7F","--wu-green-sequential-10":"#329D75","--wu-green-sequential-11":"#308A6A","--wu-green-sequential-12":"#2D7A60","--wu-green-sequential-13":"#286A55","--wu-green-sequential-14":"#255C4B","--wu-green-sequential-15":"#1F4B3E","--wu-green-sequential-16":"#1B3D34"},redSequential:{"--wu-red-sequential-1":"#FEE9EC","--wu-red-sequential-2":"#FFD2D8","--wu-red-sequential-3":"#FFBBC4","--wu-red-sequential-4":"#FFA6B3","--wu-red-sequential-5":"#FB97A5","--wu-red-sequential-6":"#F78998","--wu-red-sequential-7":"#F37C8C","--wu-red-sequential-8":"#EE6F80","--wu-red-sequential-9":"#E76172","--wu-red-sequential-10":"#E15466","--wu-red-sequential-11":"#DA465B","--wu-red-sequential-12":"#D33B50","--wu-red-sequential-13":"#BC3548","--wu-red-sequential-14":"#A73343","--wu-red-sequential-15":"#91313E","--wu-red-sequential-16":"#7D2D38"},orangeSequential:{"--wu-orange-sequential-1":"#FDEDE5","--wu-orange-sequential-2":"#FCDFCF","--wu-orange-sequential-3":"#FBCFBA","--wu-orange-sequential-4":"#FAC5AB","--wu-orange-sequential-5":"#F7B694","--wu-orange-sequential-6":"#F6AB85","--wu-orange-sequential-7":"#F79D70","--wu-orange-sequential-8":"#F6915F","--wu-orange-sequential-9":"#EF8450","--wu-orange-sequential-10":"#E37944","--wu-orange-sequential-11":"#DB713C","--wu-orange-sequential-12":"#D06530","--wu-orange-sequential-13":"#C95E29","--wu-orange-sequential-14":"#BD521C","--wu-orange-sequential-15":"#B24610","--wu-orange-sequential-16":"#AA3F08"},divergent:{"--wu-red-divergent-1":"#661200","--wu-red-divergent-2":"#A11C00","--wu-red-divergent-3":"#D2300E","--wu-red-divergent-4":"#DF4828","--wu-red-divergent-5":"#EB6A4A","--wu-red-divergent-6":"#F4896C","--wu-red-divergent-7":"#FFC4B3","--wu-red-divergent-8":"#FFE2D9","--wu-divergent-neutral":"#F5F5F5","--wu-blue-divergent-1":"#DBD9E9","--wu-blue-divergent-2":"#B7B5D4","--wu-blue-divergent-3":"#9392BF","--wu-blue-divergent-4":"#7070AA","--wu-blue-divergent-5":"#4A5195","--wu-blue-divergent-6":"#1B3380","--wu-blue-divergent-7":"#182D72","--wu-blue-divergent-8":"#122254"},nps:{"--wu-nps-detractor":"#F85271","--wu-nps-passive":"#F1DA7E","--wu-nps-promoter":"#42BD84"},sentiment:{"--wu-sentiment-negative":"#F85271","--wu-sentiment-slightly-negative":"#F69A79","--wu-sentiment-neutral":"#F1DA7E","--wu-sentiment-slightly-positive":"#94D08B","--wu-sentiment-positive":"#42BD84","--wu-sentiment-no-sentiment":"#E0E0E0"}},md=h.createContext(null),gd=()=>{const e=h.useContext(md);if(!e)throw new Error("[WuTranslateProvider] Must be used within a provider.");return e},Cv=({children:e,defaultLocale:t="en",baseApi:n="https://admin2.questionpro.com/cs/api/gad/translate",keys:r="./wick-ui-i18n.json"})=>{const[s,o]=h.useState(t),[i,u]=h.useState({}),[l,d]=h.useState(!0);h.useEffect(()=>{const w=new AbortController;return(async()=>{d(!0);try{const f=await fetch(r,{signal:w.signal});if(!f.ok)throw new Error("Failed to fetch translation keys");const g=await f.json(),b=await fetch(`${n}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({keys:g,code:s}),signal:w.signal});if(!b.ok)throw new Error("Failed to fetch dictionary");const v=await b.json();u(v)}catch(f){f.name!=="AbortError"&&(console.error("[WuTranslateProvider] Error loading translations:",f),u({}))}finally{d(!1)}})(),()=>{w.abort()}},[s,n,r]);const c=h.useMemo(()=>({dictionary:i,locale:s,setLocale:o,isLoading:l}),[i,s,l]);return a.jsx(md.Provider,{value:c,children:e})},bd=h.memo(({__i18nKey:e})=>{const{dictionary:t}=gd();return a.jsx(a.Fragment,{children:t[e]??e})});bd.displayName="WuTranslate",window&&(window.wickUiVersion="1.35.3",window.wickUiIcon="9.0.0",window.wickUiEditor="0.13.0"),Object.defineProperty(I,"useContext",{enumerable:!0,get:()=>h.useContext}),I.CHART_COLOR_SYSTEM=Sv,I.WuAccordion=qd,I.WuActivityLog=zd,I.WuAppHeader=cw,I.WuAppHeaderAccount=Za,I.WuAppHeaderBar=to,I.WuAppHeaderHelp=Ja,I.WuAppHeaderMenu=eo,I.WuAppHeaderSearch=uw,I.WuButton=Ae,I.WuCalender=jr,I.WuCard=$o,I.WuCardFooter=zo,I.WuCardHeader=Ho,I.WuCheckbox=He,I.WuChip=yf,I.WuCombobox=If,I.WuCopyToClipboard=Af,I.WuDataTable=Ry,I.WuDatePicker=mw,I.WuDateRangePicker=gf,I.WuDisplay=ew,I.WuDrawer=Ff,I.WuDrawerClose=Lf,I.WuDrilldown=qg,I.WuFooter=cl,I.WuFormGroup=hw,I.WuHeading=Qd,I.WuHelpButton=dl,I.WuIcon=Pe,I.WuInput=Qe,I.WuInputError=ww,I.WuInputHint=fw,I.WuLabel=ke,I.WuListbox=fl,I.WuLoader=dt,I.WuMenu=da,I.WuMenuCheckboxItem=kg,I.WuMenuIcon=wa,I.WuMenuItem=wr,I.WuMenuItemGroup=Dg,I.WuMenuRadioItem=_g,I.WuMenuSeparatorItem=Pg,I.WuModal=rb,I.WuModalClose=ib,I.WuModalContent=sb,I.WuModalFooter=ob,I.WuModalHeader=ab,I.WuMonthPicker=wb,I.WuPagination=Ml,I.WuPopover=ff,I.WuPopoverClose=us,I.WuPrimaryNavbar=pb,I.WuRadioGroup=Dl,I.WuScrollArea=mb,I.WuSecondaryNavbar=hb,I.WuSelect=Cl,I.WuSharedSurvey=Ac,I.WuSidebar=jb,I.WuSidebarCollapsibleMenu=Zb,I.WuSidebarContent=Gb,I.WuSidebarFooter=Kb,I.WuSidebarGroup=Yb,I.WuSidebarItem=nc,I.WuSidebarMenu=Xb,I.WuSidebarTrigger=tc,I.WuSpotlight=yl,I.WuStackedCard=Rb,I.WuStackedCardOverlay=ey,I.WuStepper=Oy,I.WuSubMenu=Vg,I.WuSubtext=Rd,I.WuSurveyItem=kc,I.WuSurveyList=Dc,I.WuSurveySelect=Pc,I.WuSurveySource=Wy,I.WuSwitcher=Bc,I.WuTab=Uy,I.WuTable=ev,I.WuText=Jd,I.WuTextarea=td,I.WuTimePicker=od,I.WuToast=bv,I.WuToggle=hd,I.WuTooltip=Dn,I.WuTranslate=bd,I.WuTranslateProvider=Cv,I.WuTranslationContext=Er,I.WuTranslationProvider=Nv,I.WuTruncatedLabel=lw,I.WuVirtualScroll=It,I.calculatePosition=Qb,I.useTranslation=vv,I.useTranslationsContext=xv,I.useWickuiTranslate=gd,I.useWuShowToast=wv,I.useWuSidebar=st,Object.defineProperty(I,Symbol.toStringTag,{value:"Module"})}));
|
|
21
21
|
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED