@npm-questionpro/wick-ui-lib 1.8.0 → 1.9.0

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.
@@ -1,7 +1,7 @@
1
- (function(x,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("react/jsx-runtime"),require("@radix-ui/react-accordion"),require("react"),require("clsx"),require("tailwind-merge"),require("@radix-ui/react-avatar"),require("@radix-ui/react-slot"),require("class-variance-authority"),require("@radix-ui/react-label"),require("@radix-ui/react-tooltip"),require("date-fns"),require("@radix-ui/react-popover"),require("react-day-picker"),require("@radix-ui/react-checkbox"),require("cmdk"),require("react-virtuoso"),require("@radix-ui/react-dropdown-menu"),require("@radix-ui/react-dialog"),require("@radix-ui/react-scroll-area"),require("@radix-ui/react-radio-group"),require("@radix-ui/react-separator"),require("@radix-ui/react-toggle-group"),require("@radix-ui/react-toggle"),require("@radix-ui/react-tabs"),require("@tanstack/react-table"),require("@radix-ui/react-toast"),require("@radix-ui/react-switch")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","@radix-ui/react-accordion","react","clsx","tailwind-merge","@radix-ui/react-avatar","@radix-ui/react-slot","class-variance-authority","@radix-ui/react-label","@radix-ui/react-tooltip","date-fns","@radix-ui/react-popover","react-day-picker","@radix-ui/react-checkbox","cmdk","react-virtuoso","@radix-ui/react-dropdown-menu","@radix-ui/react-dialog","@radix-ui/react-scroll-area","@radix-ui/react-radio-group","@radix-ui/react-separator","@radix-ui/react-toggle-group","@radix-ui/react-toggle","@radix-ui/react-tabs","@tanstack/react-table","@radix-ui/react-toast","@radix-ui/react-switch"],t):(x=typeof globalThis<"u"?globalThis:x||self,t(x["wick-ui-lib"]={},x["react/jsx-runtime"],x.RadixUIAccordion,x.React,x.clsx,x.tailwindMerge,x.RadixUIAvatar,x.RadixUISlot,x.ClassVarianceAuthority,x.RadixUILabel,x.RadixUITooltip,x.dateFns,x.RadixUIPopover,x.ReactDayPicker,x.RadixUICheckbox,x.cmdk,x.ReactVirtuoso,x.RadixUIDropdownMenu,x.RadixUIDialog,x.RadixUIScrollArea,x.RadixUIRadioGroup,x.RadixUISeparator,x.RadixUIToggleGroup,x.RadixUIToggle,x.RadixUITabs,x.TanstackReactTable,x.RadixUIToast,x.RadixUISwitch))})(this,function(x,t,Fr,d,zr,Hr,jr,ye,X,$r,Qe,A,De,Ot,Ur,G,Gr,Vr,Yr,Jr,Kr,Xr,Qr,Zr,Rr,R,es,ts){"use strict";function j(e){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const s=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(a,r,s.get?s:{enumerable:!0,get:()=>e[r]})}}return a.default=e,Object.freeze(a)}const de=j(Fr),N=j(d),ve=j(jr),Lt=j($r),Me=j(Qe),Ie=j(De),Ze=j(Ur),L=j(Vr),O=j(Yr),ce=j(Jr),We=j(Kr),Pt=j(Xr),Be=j(Qr),Bt=j(Zr),fe=j(Rr),J=j(es),Re=j(ts),as={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"}},rs=Hr.extendTailwindMerge({prefix:"wu-"});function n(...e){return rs(zr.clsx(e))}const et=e=>{window.open(e,"_blank","toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=800,height=600")};function Fe(){return Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15)}function Ee(e){switch(e){case"top":return"wu-flex-col-reverse";case"left":return"wu-flex-row-reverse wu-gap-2";case"right":return"wu-flex-row wu-gap-2";default:return""}}const ss=e=>e?/\S+@questionpro\.com/.test(e):!1,Ft=de.Root,tt=N.forwardRef(({className:e,...a},r)=>t.jsx(de.Item,{ref:r,className:n("wu-border-b",e),...a}));tt.displayName="AccordionItem";const at=N.forwardRef(({className:e,children:a,...r},s)=>t.jsx(de.Header,{className:"wu-flex",children:t.jsxs(de.Trigger,{ref:s,className:n("wu-flex wu-flex-1 wu-text-xs wu-items-center wu-justify-between wu-p-2 wu-transition-all","[&[data-state=open]>.wu-arrow-icon]:wu-rotate-180",e),...r,children:[a,t.jsx("span",{className:"wu-arrow-icon wm-keyboard-arrow-down wu-transition-transform wu-duration-200"})]})}));at.displayName=de.Trigger.displayName;const rt=N.forwardRef(({className:e,children:a,...r},s)=>t.jsx(de.Content,{ref:s,className:"wu-overflow-hidden wu-text-xs wu-px-2 wu-font-light wu-transition-all data-[state=closed]:wu-animate-accordion-up data-[state=open]:wu-animate-accordion-down",...r,children:t.jsx("div",{className:n("wu-pb-4 wu-pt-0",e),children:a})}));rt.displayName=de.Content.displayName;const us=e=>{const{items:a,className:r,dir:s="ltr"}=e;if(e.type==="multiple"){const{defaultValue:u=[],value:o,onValueChange:l}=e;return t.jsx(Ft,{type:"multiple",className:"wu-w-full wu-accordion-container",defaultValue:u,value:o,onValueChange:l,dir:s,children:a.map(({value:w,Summary:i,Details:c,className:f})=>t.jsxs(tt,{value:w,dir:s,className:n(r,f),children:[t.jsx(at,{dir:s,className:"wu-accordion-summary",children:i}),t.jsx(rt,{dir:s,className:"wu-accordion-details",children:c})]},w))})}else{const{defaultValue:u,value:o,onValueChange:l}=e;return t.jsx(Ft,{type:"single",className:"wu-w-full wu-accordion-container",defaultValue:u,value:o,onValueChange:l,dir:s,collapsible:!0,children:a.map(({value:w,Summary:i,Details:c,className:f})=>t.jsxs(tt,{value:w,dir:s,className:n(r,f),children:[t.jsx(at,{dir:s,className:"wu-accordion-summary",children:i}),t.jsx(rt,{dir:s,className:"wu-accordion-details",children:c})]},w))})}},zt=N.forwardRef(({className:e,...a},r)=>t.jsx(ve.Root,{ref:r,className:n("wu-relative wu-flex wu-h-10 wu-w-10 wu-shrink-0 wu-overflow-hidden wu-rounded-full",e),...a}));zt.displayName=ve.Root.displayName;const Ht=N.forwardRef(({className:e,...a},r)=>t.jsx(ve.Image,{ref:r,className:n("wu-aspect-square wu-h-full wu-w-full",e),...a}));Ht.displayName=ve.Image.displayName;const jt=N.forwardRef(({className:e,...a},r)=>t.jsx(ve.Fallback,{ref:r,className:n("wu-flex wu-h-full wu-w-full wu-items-center wu-justify-center wu-rounded-full wu-bg-muted",e),...a}));jt.displayName=ve.Fallback.displayName;function st(e,a){d.useEffect(()=>{const r=s=>{Array.isArray(e)&&e.some(u=>!u.current||u.current.contains(s.target))||!Array.isArray(e)&&(!e.current||e.current.contains(s.target))||a(s)};return document.addEventListener("mousedown",r),document.addEventListener("touchstart",r),()=>{document.removeEventListener("mousedown",r),document.removeEventListener("touchstart",r)}},[e,a])}const ut={dropdownContainer:"_dropdownContainer_vvlo9_1",open:"_open_vvlo9_1",dropdownMenu:"_dropdownMenu_vvlo9_1"},$t=({dir:e,Trigger:a,triggerClassName:r,DropdownContent:s})=>{const[u,o]=d.useState(!1),l=d.useRef(null),w=d.useRef(null);st([l,w],()=>o(!1));const i=()=>{o(!u)};return t.jsx(t.Fragment,{children:t.jsx("div",{className:ut.dropdownContainer,children:t.jsx("ul",{children:t.jsxs("li",{className:n("wu-flex wu-relative",u&&ut.open),children:[t.jsx("button",{className:n("wu-w-8 wu-h-8 wu-rounded-full focus:wu-outline-none focus-visible:wu-ring-2 focus-visible:wu-ring-blue-soft focus-visible:wu-ring-offset-2 focus-visible:wu-ring-offset-gray-switcher",r),onClick:c=>{c.preventDefault(),i()},ref:w,"aria-label":"dropdown-trigger",children:a}),t.jsx("div",{className:n(ut.dropdownMenu,{open:u},e==="rtl"?"wu-left-[-10px] wu-top-[38px]":"wu-right-[-7px] wu-top-[38px]"),dir:e,ref:l,"aria-label":"user-menu",children:s})]})})})})},ot=X.cva("wu-inline-flex wu-items-center wu-justify-center wu-whitespace-nowrap wu-rounded-sm wu-text-sm wu-font-normal wu-outline-offset-2 wu-transition-colors focus-visible:wu-outline-none focus-visible:wu-outline-2 focus-visible:wu-outline-blue-focus focus-visible:wu-outline-offset-2 disabled:wu-cursor-not-allowed wu-leading-4 disabled:wu-bg-black/10 disabled:wu-text-gray-subtle disabled:wu-outline-gray-subtle wu-leading-[1px] wu-transition-colors wu-duration-300",{variants:{size:{md:"wu-p-2 wu-min-w-[104px] wu-h-8 wu-text-sm",sm:"wu-p-1 wu-min-w-[90px] wu-h-6 wu-text-xs",mobile:"wu-p-4 wu-min-w-[104px] wu-h-10 wu-text-base"},color:{primary:"wu-bg-blue-p hover:wu-bg-blue-pHoverDeep wu-text-blue-p wu-outline-1 wu-outline-blue-p hover:wu-text-blue-q hover:wu-outline-blue-pHover",upgrade:"wu-bg-orange-soft hover:wu-bg-orange-deep wu-text-orange-deep hover:wu-text-orange-deep wu-outline-1 wu-outline-orange-soft hover:wu-outline-orange-deep hover:wu-text-maroon-hover",error:"wu-bg-maroon hover:wu-bg-maroon-hover wu-outline-1 wu-outline-red-deep hover:wu-outline-red-deep/80 hover:wu-text-maroon-hover"},variant:{primary:"wu-text-white wu-outline-0 hover:wu-text-white",secondary:"wu-bg-transparent wu-outline-0 hover:wu-bg-gray-20 hover:wu-text-blue-pHoverDeep",outline:"hover:wu-text-white wu-bg-white disabled:wu-bg-transparent hover:wu-outline-blue-pHoverDeep",rounded:"wu-text-white wu-outline-0 wu-rounded-full hover:wu-text-white",link:"hover:wu-underline wu-bg-transparent hover:wu-bg-transparent wu-outline-0 wu-underline-offset-2 wu-min-w-[auto] wu-px-2 disabled:wu-bg-transparent",iconOnly:"wu-rounded wu-p-2 wu-text-xl wu-h-8 wu-w-8 wu-leading-5 wu-text-gray-lead hover:wu-text-blue-q hover:wu-bg-gray-20 wu-outline-0 wu-bg-transparent wu-min-w-[auto] disabled:wu-grayscale disabled:wu-opacity-80 wu-rounded-sm focus-visible:wu-outline-offset-0 focus-visible:wu-bg-gray-20 wu-aspect-square"}},defaultVariants:{variant:"primary",size:"md",color:"primary"},compoundVariants:[]}),Ne=N.forwardRef(({className:e,variant:a,size:r,color:s,asChild:u=!1,...o},l)=>{const w=u?ye.Slot:"button";return t.jsx(w,{className:n(ot({size:r,color:s,variant:a,className:e})),ref:l,...o})});Ne.displayName="Button";const Ce=d.forwardRef((e,a)=>os(e,a)),os=(e,a)=>{const{size:r="md",color:s="#1B87E6",variant:u="dots",...o}=e,l=n("wu-w-[4em] wu-h-[1em] wu-inline-block wu-text-xs wu-relative wu-loader-dot-container");let w="7px";r==="sm"?w="7px":r==="md"?w="12px":r==="lg"?w="18px":typeof r=="string"&&(w=r);const i={backgroundColor:s,width:w,height:w},c=t.jsxs("div",{...o,ref:a,className:n("wu-flex wu-items-center wu-justify-center wu-gap-2 wu-w-fit",e.className),role:"status","aria-busy":"true",children:[t.jsx("div",{className:"wu-w-12 wu-h-12 wu-border-2 wu-rounded-full wu-animate-spin",style:{width:w,height:w,borderTopColor:s}}),e.message&&t.jsx("p",{className:"wu-inline-block wu-loader-message",children:e.message})]}),f=t.jsxs("div",{...o,ref:a,className:n("wu-flex wu-items-center wu-justify-center wu-gap-2 wu-w-fit",e.className),role:"alert","aria-busy":"true",children:[t.jsxs("ul",{className:l,style:{fontSize:w},role:"loader",children:[t.jsx("li",{className:"wu-dot wu-loader-dot",style:i}),t.jsx("li",{className:"wu-dot wu-loader-dot",style:i}),t.jsx("li",{className:"wu-dot wu-loader-dot",style:i}),t.jsx("li",{className:"wu-dot wu-loader-dot",style:i})]}),e.message&&t.jsx("p",{className:"wu-inline-block wu-loader-message",children:e.message})]});return t.jsx(t.Fragment,{children:u==="spinner"?c:f})};Ce.displayName="WuLoader";const K=d.forwardRef(({disabled:e,loading:a,variant:r="primary",size:s="md",Icon:u,iconPosition:o="left",children:l,floating:w,className:i,color:c="primary",selected:f,...p},h)=>{const m={primary:"#1986e688",upgrade:"#f5830088",error:"#ef444488"};return t.jsxs(Ne,{...p,disabled:e,variant:r,size:s,className:n(w&&"wu-shadow-qp","wu-flex wu-items-center wu-justify-center wu-gap-2",o==="right"&&"wu-flex-row-reverse",a?"wu-cursor-not-allowed wu-ring-0":"",f&&"wu-bg-blue-p wu-bg-opacity-15 wu-text-blue-pHoverDeep wu-ring-0",c==="error"&&"hover:wu-text-maroon",i),color:c,style:{backgroundColor:a?m[c]:"",...p.style},ref:h,children:[!a&&u&&t.jsx(t.Fragment,{children:u}),a&&t.jsx(Ce,{color:"#fff",size:"sm"}),!a&&l]})});K.displayName="WuButton";const ls=({onLogout:e,DataCenter:a})=>t.jsxs("section",{className:"wu-flex wu-justify-between wu-px-4 wu-py-4 wu-text-white wu-bg-gray-lead",children:[t.jsx("div",{className:"wu-flex-1 wu-flex wu-items-start",children:a}),t.jsx(K,{variant:"outline",size:"sm",Icon:t.jsx("span",{className:"wm-logout"}),className:"wu-text-white wu-bg-transparent wu-ring-white hover:wu-bg-gray-10 hover:wu-text-gray-lead hover:wu-ring-gray-lead",onClick:e,"aria-label":"logout",children:"LOGOUT"})]}),ns=({user:e,dir:a})=>{const r=[e!=null&&e.usage&&Object.keys(e.usage).length>0?{title:e.usage.title,url:e.usage.url,icon:"wm-bar-chart wu-text-base",node:t.jsxs("div",{className:"wu-flex wu-flex-col wu-items-center wu-w-20",children:[t.jsx("code",{className:"wu-font-medium",children:e.usage.collectedResponseCount||"0"}),t.jsx("span",{className:"wu-text-xs wu-font-normal",children:"Responses"})]})}:null,e!=null&&e.invoice&&Object.keys(e.invoice).length>0?{title:e.invoice.title,url:e.invoice.url,icon:"wm-attach-money wu-text-base wu-font-semibold",node:t.jsx("div",{className:"wu-flex wu-justify-center wu-items-center wu-w-20",children:t.jsx("code",{children:e.invoice.size})})}:null].filter(Boolean);return t.jsxs(t.Fragment,{children:[t.jsx("ul",{children:r.map(({title:s,url:u,icon:o,node:l},w)=>t.jsx("li",{className:w<r.length-1?"wu-border-b wu-border-gray-subtle":"",children:t.jsxs("a",{href:u,className:n("wu-flex items-center wu-justify-between wu-py-2 hover:wu-bg-gray-20 focus-within:wu-bg-gray-20 focus:wu-outline-none",a==="rtl"?"wu-pl-4":"wu-pr-4"),children:[t.jsxs("div",{className:"wu-flex wu-items-center wu-gap-2",children:[t.jsx("span",{className:n(o,"wu-w-12 wu-text-center")}),t.jsx("span",{children:s})]}),l]})},w))}),t.jsx("hr",{className:"wu-border-gray-subtle"})]})},ws=({settings:e,dir:a})=>t.jsxs(t.Fragment,{children:[t.jsx("hr",{className:"wu-border-gray-subtle"}),t.jsxs("section",{className:"wu-relative wu-flex wu-items-center wu-justify-start wu-gap-2",children:[t.jsx("span",{className:n("wu-absolute wm-settings wu-text-base",a==="rtl"?"wu-right-4":"wu-left-4")}),t.jsx("ul",{className:"wu-w-full",dir:a,children:e==null?void 0:e.map(r=>t.jsx("li",{tabIndex:-1,dir:a,children:t.jsx("a",{href:r.url,className:n("wu-inline-block wu-w-full wu-py-2 hover:wu-bg-gray-20 focus-within:wu-bg-gray-20 focus:wu-outline-none",a==="rtl"?"wu-pr-14 wu-text-right":"wu-pl-14"),children:r.title})},r.title))})]}),t.jsx("hr",{className:"wu-border-gray-subtle"})]}),is=({user:e,dir:a})=>{var r,s,u,o,l,w,i,c,f;return t.jsxs("section",{className:n("wu-flex wu-gap-2 wu-p-4 wu-w-full",a==="rtl"?"wu-pr-0":"wu-pl-0"),children:[t.jsx("div",{className:"wu-flex wu-items-center wu-justify-center wu-w-12",children:t.jsx("span",{className:"wu-text-base wm-person"})}),t.jsxs("div",{className:n("wu-flex wu-flex-col wu-gap-1",a==="rtl"&&"wu-text-right"),children:[t.jsx("p",{children:(r=e==null?void 0:e.profile)==null?void 0:r.title}),t.jsxs("a",{href:(s=e==null?void 0:e.license)==null?void 0:s.url,className:"hover:wu-text-blue-p wu-group/license focus:wu-outline-none focus:wu-text-blue-p",dir:a,children:[t.jsx("p",{children:(u=e==null?void 0:e.profile)==null?void 0:u.subtitle}),t.jsx("p",{className:"wu-font-light",children:(o=e==null?void 0:e.profile)==null?void 0:o.companyName})]}),(e==null?void 0:e.license)&&Object.keys(e.license).length>0&&t.jsxs("div",{className:"wu-flex wu-items-center wu-justify-between wu-gap-6 wu-mt-3",dir:a,children:[t.jsx("a",{href:(l=e==null?void 0:e.license)==null?void 0:l.url,className:"hover:wu-text-blue-p wu-group/license focus:wu-outline-none focus:wu-text-blue-p",children:t.jsxs("div",{className:"wu-flex wu-flex-col wu-items-start wu-gap-1",children:[t.jsx("p",{className:"wu-font-normal",children:(w=e==null?void 0:e.license)==null?void 0:w.subtitle}),t.jsx("button",{tabIndex:-1,className:"wu-px-3 wu-py-1 wu-border wu-rounded-sm wu-border-gray-subtle group-hover/license:wu-border-blue-p",children:(i=e==null?void 0:e.license)==null?void 0:i.title})]})}),t.jsxs("div",{className:"wu-flex wu-flex-col wu-items-start wu-gap-1",dir:a,children:[t.jsx("p",{className:"wu-font-normal",children:(c=e==null?void 0:e.license)==null?void 0:c.expiryDatePostFixString}),t.jsx("p",{children:(f=e==null?void 0:e.license)==null?void 0:f.expiryDate})]})]})]})]})},Ut=({user:e,onLogout:a,dir:r,DataCenter:s})=>{var u,o;return e?t.jsx($t,{Trigger:t.jsxs(zt,{className:n("wu-group wu-border wu-border-white wu-text-sm wu-font-medium wu-bg-transparent wu-w-8 wu-h-8 wu-ring-white wu-leading-[33px] wu-text-white wu-transition-colors hover:wu-bg-white hover:wu-text-gray-switcher wu-header-user-avatar"),children:[t.jsx(Ht,{className:"hover:wu-opacity-80",src:(u=e==null?void 0:e.profile)==null?void 0:u.profilePicture,alt:"User"}),t.jsx(jt,{children:(o=e==null?void 0:e.profile)==null?void 0:o.initials})]}),dir:r,triggerClassName:"wu-rounded-full focus:wu-outline-none focus-visible:wu-ring-2 focus-visible:wu-ring-blue-soft focus-visible:wu-ring-offset-2 focus-visible:wu-ring-offset-gray-switcher wu-w-8 wu-h-8 wu-app-user-button",DropdownContent:t.jsxs("div",{className:n("wu-p-0 wu-text-xs wu-font-medium wu-border wu-rounded-none wu-min-w-72 wu-w-max wu-max-w-96 wu-border-gray-subtle wu-text-gray-lead wu-overflow-hidden wu-bg-white"),dir:r,children:[t.jsx(is,{user:e,dir:r}),(e==null?void 0:e.settings)&&e.settings.length>0&&t.jsx(ws,{settings:e.settings,dir:r}),t.jsx(ns,{user:e,dir:r}),t.jsx(ls,{onLogout:a,DataCenter:s})]})}):null},Gt=({menuList:e,dir:a})=>{const r=[{icon:"wm-info",title:"Help Center",subTitle:"Knowledge Base",link:"https://www.questionpro.com/help/"},{icon:"wm-calendar-month",title:"Free Online Training",subTitle:"Webinar",link:"https://www.questionpro.com/training"},{icon:"wm-local-fire-department",title:"Updates",subTitle:"What's new!",link:"https://www.questionpro.com/updates/"},{icon:"wm-chat",title:"Live Chat",subTitle:"Support",link:"https://www.questionpro.com/a/liveperson.do?mode=launch&pageMode=quickChat",target:"window"}];return t.jsx($t,{dir:a,Trigger:t.jsx("span",{className:"wm-question-mark wu-text-base"}),triggerClassName:"wu-w-8 wu-h-8 wu-flex wu-items-center wu-justify-center wu-rounded-full wu-border wu-border-white focus:wu-outline-none focus-visible:wu-ring-2 focus-visible:wu-ring-blue-soft focus-visible:wu-ring-offset-2 focus-visible:wu-ring-offset-gray-switcher wu-text-white wu-transition-colors hover:wu-bg-white hover:wu-text-gray-switcher wu-app-header-help",DropdownContent:t.jsx("ul",{children:(e||r).map((s,u)=>t.jsx("li",{className:"wu-p-0 wu-w-[191px] hover:wu-bg-[#ededed]",dir:a,children:s.target==="window"?t.jsx("a",{tabIndex:0,rel:"noopener noreferrer",onClick:()=>et(s.link),onKeyDown:o=>{o.key==="Enter"&&et(s.link)},className:"wu-block wu-w-full wu-h-full wu-px-4 wu-py-2 hover:wu-bg-gray-20 focus-visible:wu-border-none focus-visible:wu-bg-gray-20 focus-visible:wu-ring-0 focus-visible:wu-outline-none focus-visible:wu-ring-offset-0 wu-cursor-pointer",children:t.jsx(Vt,{item:s,dir:a})}):t.jsx("a",{href:s.link,target:"_blank",className:"wu-block wu-w-full wu-h-full wu-px-4 wu-py-2 hover:wu-bg-gray-20 focus-visible:wu-border-none focus-visible:wu-bg-gray-20 focus-visible:wu-ring-0 focus-visible:wu-outline-none focus-visible:wu-ring-offset-0",rel:"noreferrer",children:t.jsx(Vt,{item:s,dir:a})})},u))})})},Vt=({item:e,dir:a})=>t.jsxs("div",{className:"wu-flex wu-items-start wu-gap-3",children:[t.jsx("span",{className:`${e.icon} wu-text-xl wu-text-gray-subtle`}),t.jsxs("div",{className:n("wu-flex wu-flex-col wu-gap-[2px]",a==="rtl"&&"wu-text-right"),children:[t.jsx("span",{className:"wu-text-xs wu-text-gray-subtle",children:e.subTitle}),t.jsx("p",{className:"wu-text-sm wu-text-blue-q",children:e.title})]})]}),ds=e=>{const[a,r]=d.useState(()=>window.innerWidth<=e);return d.useEffect(()=>{const s=()=>{r(window.innerWidth<=e)};return window.addEventListener("resize",s),()=>{window.removeEventListener("resize",s)}},[e]),a};function cs({productCategories:e,openCategory:a,setOpenCategory:r}){const s=(w,i)=>{const c=i[w];if(c){c.focus();const f=e[w]||null;r(f)}},u=(w,i,c,f)=>{w.preventDefault();const p=c==="down"?i+1:i-1;s(p,f)},o=(w,i,c,f)=>{a!=null&&a.products&&a.products[a.products.length-1].name===f&&(w.preventDefault(),s(i+1,c))},l=(w,i)=>{w.preventDefault();const c=e[i]===a?null:e[i];r(c)};return function(i,c,f){const p=document.querySelectorAll("[data-product-category]"),{key:h}=i;switch(h){case"ArrowDown":u(i,c,"down",p);break;case"ArrowUp":u(i,c,"up",p);break;case"Tab":o(i,c,p,f);break;case"Enter":case" ":l(i,c);break}}}const fs=e=>{const{size:a="lg",className:r,children:s,...u}=e,o={sm:"wu-text-body-3",md:"wu-text-body-2",lg:"wu-text-body-1"},l=e.as||"div";return t.jsx(l,{...u,className:n(o[a],r),children:s})},ps=e=>{const{size:a="xl",className:r,children:s,...u}=e,o={sm:"h4",md:"h3",lg:"h2",xl:"h1"},l={sm:"wu-text-heading-4",md:"wu-text-heading-3",lg:"wu-text-heading-2",xl:"wu-text-heading-1"},w=o[a];return t.jsx(w,{...u,className:n(l[a],r),children:s})},bs=e=>{const{size:a="lg",className:r,children:s,...u}=e,o={sm:"wu-text-sub-3",md:"wu-text-sub-2",lg:"wu-text-sub-1"},l=e.as||"div";return t.jsx(l,{...u,className:n(o[a],r),children:s})},hs=e=>{const{size:a="lg",className:r,children:s,...u}=e,o={md:"wu-text-display-2",lg:"wu-text-display-1"},l=e.as||"h1";return t.jsx(l,{...u,className:n(o[a],r),children:s})},le=e=>{const{icon:a,className:r,...s}=e;return t.jsx("span",{...s,className:n(a,r),role:"presentation","aria-label":a})},gs=({buttonRef:e,handleDropdownToggle:a,handleKeyDown:r,isDropdownOpen:s,activeProductName:u,dir:o="ltr",homeLink:l="/"})=>t.jsxs("button",{ref:e,type:"button",className:n("wu-text-base wu-font-normal wu-flex wu-items-center wu-justify-between wu-px-2 wu-gap-2 wu-w-full focus:wu-outline-none focus-visible:wu-bg-white/10 wu-switcher-trigger"),onClick:a,onKeyDown:w=>{s&&w.key==="ArrowDown"&&r(w,-1)},"aria-label":"product-switcher",children:[t.jsx("a",{className:"wu-pl-2 wu-pr-0 wu-aspect-auto focus:wu-outline-none focus-visible:wu-bg-white/10 wu-switcher-logo",tabIndex:-1,href:l,children:t.jsx(le,{icon:"wc-logo",className:"wu-text-xl wu-leading-4 wu-relative wu-top-1"})}),u,t.jsx("span",{className:n("wm-arrow-drop-down wu-text-2xl wu-transition-transform wu-duration-300",s&&"wu-rotate-180",o==="rtl"?"wu-mr-auto":"wu-ml-auto")})]}),B={productDropdownMenu:"_productDropdownMenu_amyba_1",productDropdownMenuOpen:"_productDropdownMenuOpen_amyba_38",rtlDropdownMenu:"_rtlDropdownMenu_amyba_51",productCategory:"_productCategory_amyba_55",open:"_open_amyba_61",productCategoryBorderTop:"_productCategoryBorderTop_amyba_66",productList:"_productList_amyba_93",rtlProductList:"_rtlProductList_amyba_114",productListItem:"_productListItem_amyba_137",productLink:"_productLink_amyba_162",activeProduct:"_activeProduct_amyba_164",topBorder:"_topBorder_amyba_169",topBorderRtl:"_topBorderRtl_amyba_190"},ms=({category:e,dir:a="ltr",openCategory:r})=>{const s=e.active?"#c5cce0":"#f0c36a",u=(r==null?void 0:r.name)===e.name,o=n("wm-arrow-forward-ios wu-text-xs wu-tracking-widest wu-text-muted-foreground wu-mr-2.5 group-hover:wu-hidden wu-text-blue-q",a==="rtl"&&"wu-rotate-180 wu-ml-2.5 wu-text-blue-q group-hover:wu-hidden",u&&"wu-hidden","wu-relative wu-top-[5px]"),l=n("wm-lock wu-text-orange-soft wu-text-base wu-mr-2.5 group-hover:wu-hidden",a==="rtl"&&"wu-ml-2.5 group-hover:wu-hidden",u&&"wu-hidden","wu-relative wu-top-1");return t.jsxs("div",{className:n("group focus:wu-outline-none focus-visible:wu-outline-none wu-flex wu-items-center wu-w-full wu-bg-white wu-relative wu-justify-between"),dir:a,children:[t.jsx("div",{className:B.productCategoryBorderTop,style:{backgroundColor:s}}),t.jsxs("div",{className:"wu-flex wu-items-center wu-px-1 wu-relative wu-top-1",children:[t.jsx("div",{className:"wu-w-[56px] wu-h-[56px] wu-flex wu-items-center wu-justify-center",children:t.jsx("img",{src:e.logo,alt:e.name,width:"32px",height:"32px"})}),t.jsx("span",{className:"wu-text-sm wu-leading-5 wu-text-blue-q wu-relative wu-top-[1px]",children:e.name})]}),e.active?t.jsx("span",{className:o}):t.jsx("span",{className:l})]})},xs={e309:"wp-audience",e381:"wp-bi",e329:"wp-closed-loop",e314:"wp-communities",e313:"wp-cx",e352:"wp-digsite",e324:"wp-empower",e317:"wp-insightshub",e380:"wp-instant-answers",e378:"wp-intercept",e311:"wp-livepolls",e316:"wp-reputation",e379:"wp-suite-cx",e382:"wp-suite-cx",e308:"wp-surveys",e315:"wp-workforce"},ys=({product:e,currentProduct:a,activeProductName:r,dir:s,focusItem:u,setFocusItem:o})=>{const[l,w]=d.useState(e.name===a),i=e.name===r,c=e.name===a,f=!e.active,p="#1b3380",h="#c5cce0",m="#ffcf70",g=n("wu-font-normal wu-text-xs wu-text-gray-lead wu-text-center",c&&"wu-text-blue-q wu-font-normal",!e.active&&"wu-text-gray-subtle",l&&"wu-font-normal",e.active&&l&&"wu-text-blue-q"),b=n("wu-text-blue-p wu-text-base",c&&"wu-text-blue-q",!e.active&&"wu-text-gray-subtle",e.active&&l&&"wu-text-blue-q"),v=l||u===e.name||i?p:h;return t.jsxs("li",{className:n(B.productListItem,"focus-visible:wu-outline-none focus:wu-outline-none wu-sub-product-list-item",(i||l)&&B.activeProduct,e.name.length>15&&window.innerWidth>768&&"wu-w-[130px] wu-min-w-[130px]",u===e.name&&B.activeProduct,"wu-product-item"),onMouseOver:()=>w(!0),onMouseOut:()=>w(!1),"aria-label":e.name,"aria-disabled":f,dir:s,onKeyDown:S=>{if(S.key==="Enter"){S.preventDefault();const y=S.currentTarget.querySelector("a");y&&y.click()}},onFocus:()=>{o(e.name)},onBlur:()=>o(""),children:[t.jsx("div",{className:n(B.topBorder,s==="rtl"&&B.topBorderRtl),style:{backgroundColor:f?m:v}}),t.jsxs("a",{className:n(B.productLink,"focus:wu-outline-none focus-visible:wu-outline-none"),href:e.link||"#",tabIndex:0,children:[t.jsx("span",{className:n(b,xs[e.icon||""]),"aria-hidden":!0}),t.jsx("span",{className:n(g),children:e.name})]})]},e.name)},vs=({category:e,currentProduct:a,activeProductName:r,dir:s="ltr",focusItem:u,setFocusItem:o,borderColorLocked:l="#f5a300"})=>{const{products:w=[],active:i}=e,c=d.useMemo(()=>w.filter(g=>g.active).sort((g,b)=>(g.order||100)-(b.order||100)),[w]),f=d.useMemo(()=>w.filter(g=>!g.active),[w]),[p,h]=d.useState(l),m=g=>g.map((b,v)=>t.jsx(ys,{product:b,currentProduct:a,activeProductName:r,dir:s,focusItem:u,setFocusItem:o},v));return i?t.jsxs(t.Fragment,{children:[m(c),f.length>0&&t.jsxs("li",{className:n(B.productListItem,"focus:wu-outline-none focus-visible:wu-outline-none !wu-bg-[#f5f5f5] hover:!wu-bg-[#eeeeee] wu-group"),onMouseOver:()=>h("#f5a300"),onMouseOut:()=>h(l),"aria-label":"Upgrade to unlock",children:[t.jsx("div",{className:n(B.topBorder,s==="rtl"&&B.topBorderRtl),style:{backgroundColor:p},"aria-label":"top-border"}),t.jsxs("a",{href:"https://www.questionpro.com/a/showUpgradeUser.do",className:n(B.productLink,"wu-flex wu-flex-col wu-items-center wu-justify-center wu-py-2 wu-min-w-[88px]"),children:[t.jsx("span",{className:"wu-text-base wu-transition-colors wm-lock !wu-text-orange-soft group-hover:wu-text-orange-deep"}),t.jsxs("span",{className:"wu-text-[10px] wu-leading-[10px] wu-text-center wu-pt-1 !wu-text-orange-deep",children:["Upgrade to ",t.jsx("br",{})," unlock"]})]})]}),m(f)]}):t.jsxs("li",{className:n(B.productListItem,B.learnMore,"focus:wu-outline-none focus-visible:wu-outline-none wu-product-item-inactive !wu-bg-[#f5f5f5] hover:!wu-bg-[#eeeeee]",u==="learn"&&"activeProduct"),tabIndex:0,onFocus:()=>o("learn"),onBlur:()=>o(""),"aria-label":"Learn More",children:[t.jsx("div",{className:n(B.topBorder,s==="rtl"&&B.topBorderRtl),style:{backgroundColor:l}}),t.jsx("a",{className:B.productLink,href:"https://www.questionpro.com/a/showUpgradeUser.do",tabIndex:-1,children:t.jsx("span",{className:"wu-text-[#f99e03]",children:"Learn More"})})]})},Yt=({dropdownRef:e,dir:a,isDropdownOpen:r,productCategories:s,openCategory:u,setOpenCategory:o,handleKeyDown:l,expandAll:w,activeProductName:i,focusItem:c,setFocusItem:f})=>{const p="#ffcf70",[h,m]=d.useState(window.innerWidth>768);return d.useEffect(()=>{const g=()=>{m(window.innerWidth>375)};return window.addEventListener("resize",g),()=>window.removeEventListener("resize",g)},[]),t.jsx("ul",{className:n(B.productDropdownMenu,r&&B.productDropdownMenuOpen,a==="rtl"&&B.rtlDropdownMenu,"wu-switcher-container"),ref:e,dir:a,"aria-label":"product-dropdown-menu","data-state":r?"open":"closed",children:s.map((g,b)=>t.jsxs("li",{className:n(B.productCategory,"focus:wu-outline-none focus-visible:wu-outline-none wu-h-16 wu-category-item",u===g&&B.open,w&&B.open),onMouseEnter:()=>h&&o(g),onMouseLeave:()=>h&&o(null),"aria-label":g.name,dir:a,onKeyDown:v=>l(v,b),tabIndex:0,"data-product-category":!0,children:[t.jsx(ms,{category:g,dir:a,openCategory:u}),t.jsx("ul",{className:n(B.productList,a==="rtl"&&B.rtlProductList),dir:a,children:t.jsx(vs,{category:g,dir:a,activeProductName:i,currentProduct:g.name,focusItem:c,setFocusItem:f,borderColorLocked:p})})]},g.name))})},Ns=({isProductButtonShow:e,isDropdownOpen:a,activeProductColor:r,activeProductBgColor:s,activeProductName:u,dir:o,smallScreenButtonRef:l,handleDropdownToggle:w,handleKeyDown:i})=>t.jsx("div",{className:n("wu-absolute wu-top-11 wu-transition-all wu-duration-300 wu-ease-in-out wu-transform wu-opacity-100 wu-w-[256px] wu-z-10",e?o==="rtl"?"wu-right-0 wu-overflow-hidden":"wu-translate-x-0 wu-left-0":o==="rtl"?"wu-right-0 wu-w-0":"wu--translate-x-full"),style:{backgroundColor:a?r.hover:s},children:t.jsxs("button",{ref:l,type:"button",className:n("wu-text-base wu-leading-[48px] wu-flex wu-items-center wu-justify-center wu-px-2 wu-gap-2 wu-w-full focus:wu-outline-none focus-visible:wu-bg-white/10 wu-switcher-trigger",e?"wu-flex":o==="rtl"?"wu-hidden":"wu-flex"),onClick:w,onKeyDown:c=>{a&&c.key==="ArrowDown"&&i(c,-1)},"aria-label":"small-screen-product-btn",children:[u,t.jsx("span",{className:n("wm-arrow-drop-down wu-text-2xl wu-transition-transform wu-duration-300",a&&"wu-rotate-180")})]})}),Cs=({dir:e,isProductButtonShow:a,smallScreenToggleButtonRef:r,setIsProductButtonShow:s,setDropdownOpen:u})=>{const o=()=>{s(l=>!l),a&&u(!1)};return t.jsxs("button",{className:n("wu-relative wu-w-10 wu-h-10 wu-flex wu-flex-col wu-justify-center wu-items-center",e==="rtl"?"wu-mr-4":"wu-ml-4"),onClick:o,ref:r,"aria-label":"menu-toggle-btn",children:[t.jsx("span",{className:`wu-absolute wu-w-6 wu-h-[3px] wu-bg-white wu-transition-transform wu-duration-300 ${a?"wu-rotate-45 wu-translate-y-0":"-wu-translate-y-2.5"}`}),t.jsx("span",{className:`wu-absolute wu-w-6 wu-h-[3px] wu-bg-white wu-transition-opacity wu-duration-300 ${a?"wu-opacity-0":"wu-opacity-100"}`}),t.jsx("span",{className:`wu-absolute wu-w-6 wu-h-[3px] wu-bg-white wu-transition-transform wu-duration-300 ${a?"-wu-rotate-45 wu-translate-y-0":"wu-translate-y-2.5"}`})]})},Jt=({productCategories:e,activeProductName:a,activeProductColor:r={base:"#1b87e6",hover:"#54A5EC"},dir:s,homeLink:u,expandAll:o})=>{const l=d.useRef(null),w=d.useRef(null),i=d.useRef(null),c=d.useRef(null),[f,p]=d.useState(!1),[h,m]=d.useState(null),[g,b]=d.useState(r.base),[v,S]=d.useState(""),[y,C]=d.useState(!1),D=ds(768);st([w,l],()=>{p(!1),m(null)}),st([i,c,w],()=>{C(!1),p(!1),m(null)}),d.useEffect(()=>{const W=T=>{T.key==="Escape"&&p(!1)};return document.addEventListener("keydown",W),()=>{document.removeEventListener("keydown",W)}},[f]),d.useEffect(()=>b(r.base),[r.base]);const k=W=>{W.preventDefault(),W.stopPropagation(),p(T=>{const M=!T;return M||m(null),M})},I=(W,T)=>{cs({productCategories:e,openCategory:h,setOpenCategory:m})(W,T,v)};return t.jsx("div",{className:n("wu-inline-flex wu-items-center wu-justify-between wu-relative wu-z-auto wu-h-12 wu-text-white"),children:D?t.jsxs("div",{className:"wu-relative wu-flex",children:[t.jsx(Cs,{dir:s,isProductButtonShow:y,smallScreenToggleButtonRef:c,setDropdownOpen:p,setIsProductButtonShow:C}),t.jsx(Ns,{isProductButtonShow:y,isDropdownOpen:f,activeProductColor:r,activeProductBgColor:g,activeProductName:a,handleDropdownToggle:k,smallScreenButtonRef:i,handleKeyDown:I,dir:s}),t.jsx("div",{className:n("wu-absolute wu-top-[92px] wu-left-0 wu-text-[18px]",s==="rtl"&&"wu-right-[256px] wu-left-auto"),children:t.jsx(Yt,{activeProductName:a,focusItem:v,setFocusItem:S,handleKeyDown:I,isDropdownOpen:f,openCategory:h,productCategories:e,setOpenCategory:m,dropdownRef:w,expandAll:o,dir:s})})]}):t.jsxs("div",{className:"wu-relative wu-flex wu-items-center wu-justify-start wu-h-full wu-w-[256px]",dir:s,style:{backgroundColor:f?r.hover:g},onMouseOver:()=>b(r.hover),onMouseOut:()=>b(r.base),children:[t.jsx(gs,{activeProductName:a,dir:s,homeLink:u,buttonRef:l,handleDropdownToggle:k,handleKeyDown:I,isDropdownOpen:f}),t.jsx(Yt,{activeProductName:a,focusItem:v,setFocusItem:S,handleKeyDown:I,isDropdownOpen:f,openCategory:h,productCategories:e,setOpenCategory:m,dropdownRef:w,expandAll:o,dir:s})]})})},Kt=({children:e,dir:a,className:r})=>t.jsx("section",{className:n("wu-flex wu-items-center wu-flex-1 wu-min-w-0 wu-h-12 wu-gap-2 wu-px-2",a==="rtl"&&"wu-flex-row-reverse",r),children:t.jsx("div",{className:"wu-grow",children:e})}),ze=N.forwardRef(({className:e,type:a,...r},s)=>t.jsx("input",{type:a,className:n("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:s,...r}));ze.displayName="Input";const Ss=e=>{const{message:a,className:r,...s}=e;return t.jsx("p",{...s,className:n("wu-text-sub-3 wu-break-words wu-font-light",r),style:{color:"rgb(var(--wu-red-deep))",...s.style},children:a})},ks=e=>{var w,i;const{inputRef:a,maxLength:r=50,className:s,...u}=e,[o,l]=d.useState(!1);return d.useEffect(()=>{var c;(((c=a==null?void 0:a.current)==null?void 0:c.value.length)||0)>.75*r?l(!0):l(!1)},[(w=a==null?void 0:a.current)==null?void 0:w.value,r]),t.jsx("p",{...u,className:n("wu-text-sub-3 wu-font-light",s),style:{color:"rgb(var(--wu-gray-subtle))",...u.style},children:o&&`${(i=a==null?void 0:a.current)==null?void 0:i.value.length}/${r}`})},Ts=X.cva("wu-text-xs wu-font-normal wu-leading-none peer-disabled:wu-cursor-not-allowed peer-disabled:wu-text-gray-subtle peer-readonly:wu-text-gray-subtle peer-required:after:wu-content-['*'] peer-required:after:wu-ml-[2px] peer-required:after:wu-text-red-deep peer-aria-[required]:after:wu-content-['*'] peer-aria-[required]:after:wu-ml-[2px] peer-aria-[required]:after:wu-text-red-deep"),_e=N.forwardRef(({className:e,...a},r)=>t.jsx(Lt.Root,{ref:r,className:n(Ts(),e),...a}));_e.displayName=Lt.Root.displayName;const Q=e=>t.jsx(_e,{...e,className:n("wu-text-gray-lead wu-leading-6",e.className)}),Ds=({Label:e,Error:a,Hint:r,Input:s,labelPosition:u="top",dir:o="ltr",className:l,...w})=>{const c=n("wu-flex",u==="top"?"wu-flex-col wu-gap-1":"wu-flex-row wu-items-center wu-gap-2",l),f=n("wu-flex wu-flex-col wu-gap-1 wu-relative wu-flex-1 wu-form-group-wrapper"),p=n("wu-absolute -wu-bottom-5",o==="ltr"?"wu-right-0":"wu-left-0","wu-form-group-hint"),h=n("wu-absolute -wu-bottom-5",o==="ltr"?"wu-left-0":"wu-right-0","wu-form-group-error");return t.jsxs("div",{className:c,dir:o,...w,children:[e,t.jsxs("div",{className:f,children:[s,r&&t.jsx("div",{className:p,children:r}),a&&t.jsx("div",{className:h,children:a})]})]})},pe=d.forwardRef((e,a)=>{const{Label:r,labelPosition:s="top",Icon:u,iconPosition:o,type:l,value:w,variant:i="flat",readonly:c,id:f=Fe(),...p}=e,h=Ee(s),m=u?o!=="right"?"wu-pl-8":"wu-pr-8":"",[g,b]=d.useState(!1),v=()=>{b(y=>!y)},S=y=>{p.onChange&&p.onChange(y)};return t.jsx(t.Fragment,{children:l==="submit"?t.jsx(K,{type:"submit",className:p.className,id:f,children:r||"Submit"}):t.jsx("div",{className:n("wu-flex wu-flex-col wu-gap-2 wu-input-container"),dir:p.dir,children:t.jsxs("div",{className:n("wu-flex wu-gap-1 wu-relative wu-w-fit",h,(s==="right"||s==="left")&&"wu-items-center","wu-input-wrapper"),children:[u&&o!=="right"&&t.jsx("div",{className:"wu-absolute wu-flex wu-items-center wu-justify-center wu-w-8 wu-h-8 wu-input-icon-container",children:u}),t.jsx(ze,{...p,className:n("wu-peer wu-text-xs wu-rounded-t-sm",i==="outlined"?"wu-border wu-border-gray-subtle":"",m,p.className),type:g?"text":l,ref:a,readOnly:c,onChange:p.onChange&&S,value:w,id:f}),u&&o==="right"&&t.jsx("div",{className:"wu-absolute wu-right-0 wu-flex wu-items-center wu-justify-center wu-w-8 wu-h-8 wu-input-icon-container",children:u}),l==="password"&&t.jsx("div",{className:"wu-absolute wu-right-0 wu-flex wu-items-center wu-justify-center wu-w-8 wu-h-8 wu-cursor-pointer",onClick:v,children:t.jsx("button",{type:"button",className:"wu-flex wu-items-center wu-justify-center wu-w-6 wu-h-6 wu-rounded-sm focus:wu-outline-none focus-visible:wu-ring-2 focus-visible:wu-ring-blue-soft","aria-label":"show-password",children:g?t.jsx("span",{className:"wm-visibility wu-text-gray-subtle"}):t.jsx("span",{className:"wm-visibility-off wu-text-gray-subtle"})})}),r&&t.jsx(Q,{htmlFor:f,className:"wu-input-label",children:r})]})})})});pe.displayName="WuInput";const Ms=({className:e,placeholder:a="Search surveys, folders or tools",defaultCollapsed:r=!0,onSearch:s,...u})=>{const[o,l]=d.useState(r);return d.useEffect(()=>{l(r)},[r]),t.jsx(pe,{...u,placeholder:a,onChange:w=>s(w.target.value),className:n("wu-rounded-full focus-visible:wu-outline-2 focus-visible:wu-outline-blue-focus -wu-outline-offset-2 wu-bg-white","wu-transition-all wu-duration-300 wu-ease-in-out",o?"wu-w-8 wu-px-2 wu-text-lg wu-rounded-full wu-h-8 wu-border wu-border-white wu-bg-transparent":"wu-w-40 sm:wu-w-60",e),type:"search",Icon:t.jsx(le,{"data-testid":"search-icon",icon:"wm-search",className:n("wu-text-gray-lead wu-cursor-pointer",o&&"wu-text-white"),onClick:()=>l(w=>!w)})})},Xt=Me.Provider,Qt=Me.Root,Zt=Me.Trigger,lt=N.forwardRef(({className:e,sideOffset:a=4,...r},s)=>t.jsx(Me.Content,{ref:s,sideOffset:a,className:n("wu-z-50 wu-overflow-hidden wu-bg-gray-notification wu-text-white wu-px-3 wu-py-1.5 wu-text-sm wu-shadow-md",e),...r}));lt.displayName=Me.Content.displayName;const He=d.forwardRef(({content:e,position:a,positionOffset:r,duration:s,children:u,className:o,showArrow:l=!1,...w},i)=>t.jsx(Xt,{delayDuration:s||200,children:t.jsxs(Qt,{children:[t.jsx(Zt,{asChild:!0,children:t.jsx("span",{ref:i,children:u})}),t.jsx(Qe.Portal,{children:e&&t.jsxs(lt,{...w,side:a||"top",sideOffset:r||0,className:n("wu-max-w-sm wu-max-h-96 wu-overflow-y-auto",o),children:[e,l&&t.jsx(Qe.Arrow,{className:"wu-fill-gray-notification wu-tooltip-arrow"})]})})]})}));He.displayName="WuTooltip";const Is=({label:e,className:a})=>{const r=d.useRef(null),[s,u]=d.useState(!1);return d.useEffect(()=>{const o=r.current;if(o){const l=o.clientWidth,w=o.scrollWidth,i=w/e.length,c=e.length*i;u(c>l||w>l)}},[e]),t.jsx("p",{ref:r,className:n("wu-w-full wu-truncate",a),children:s?t.jsx(He,{content:e,positionOffset:8,children:e}):e})},Ws=e=>{var p;const{productName:a,categories:r=[],user:s,children:u,onLogout:o,homeLink:l=window.location.origin,brandColor:w,dir:i="ltr",expandAll:c,DataCenter:f}=e;return t.jsx("div",{className:"wu-sticky wu-top-0 wu-z-50 wu-w-full",children:t.jsxs("header",{className:n("wu-h-12 wu-flex wu-items-center wu-justify-between wu-relative wu-bg-blue-switcher wu-text-white",i==="rtl"&&"wu-flex-row-reverse",e.className),style:e.style,children:[ss((p=s==null?void 0:s.profile)==null?void 0:p.subtitle)&&window.wickUiVersion&&t.jsxs("p",{className:"wu-text-[10px] wu-text-gray-subtle wu-font-normal wu-absolute wu-top-11 wu-right-1 wu-z-[-1] wu-invisible","aria-label":"wickUiVersion",children:["Wick UI: v",window.wickUiVersion]}),t.jsx("section",{className:"wu-flex wu-items-center wu-gap-2 wu-shrink-0",children:t.jsx(Jt,{productCategories:r,activeProductName:a,activeProductColor:w,dir:i,homeLink:l,expandAll:c})}),t.jsx(Kt,{dir:i,children:u}),t.jsxs("section",{className:n("wu-flex wu-items-center wu-justify-end wu-shrink-0 wu-gap-2",i==="rtl"?"wu-flex-row-reverse wu-pl-4":"wu-flex-row wu-pr-4"),children:[t.jsx(Gt,{dir:i}),(s==null?void 0:s.profile)&&Object.keys(s.profile).length>0&&t.jsx(Ut,{user:s,onLogout:o,dir:i,DataCenter:f})]})]})})},ee=Ie.Root,be=Ie.Trigger,Z=N.forwardRef(({className:e,align:a="center",sideOffset:r=4,...s},u)=>t.jsx(Ie.Portal,{children:t.jsx(Ie.Content,{ref:u,align:a,sideOffset:r,className:n("wu-z-50 wu-w-72 wu-border wu-bg-popover wu-p-4 wu-text-popover-foreground wu-shadow-md wu-outline-none 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-[side=bottom]:wu-slide-in-from-top-2 data-[side=left]:wu-slide-in-from-right-2 data-[side=right]:wu-slide-in-from-left-2 data-[side=top]:wu-slide-in-from-bottom-2",e),...s})}));Z.displayName=Ie.Content.displayName;function Rt({className:e,classNames:a,dir:r="ltr",...s}){const u=Ot.getDefaultClassNames();return t.jsx(Ot.DayPicker,{showOutsideDays:s.showOutsideDays||!1,className:n("wu-p-3",e),classNames:{root:n(u.root,"wu-relative wu-rounded-none wu-bg-white dark:wu-bg-gray-switcher"),caption_label:n("wu-text-xs",s.captionLayout==="dropdown"?"wu-hidden":""),month_caption:n(u.month_caption,"wu-mb-5"),months:n(u.months,"wu-flex wu-flex-col sm:wu-flex-row wu-gap-4"),dropdowns:n(u.dropdowns,"wu-flex wu-items-center wu-justify-start wu-gap-2",(s.mode==="range","")),dropdown:n(u.dropdown,"wu-px-2 wu-py-1 wu-text-sm wu-text-gray-lead wu-font-medium focus:wu-outline-none wu-bg-white wu-border-b wu-border-gray-subtle focus-visible:wu-border-blue-p"),weekday:n(u.weekday,"wu-text-gray-lead wu-rounded-none wu-w-9 wu-font-normal wu-text-xs wu-bg-gray-10 wu-py-2"),day_button:n(u.day_button,"wu-w-full wu-h-full focus:wu-outline-none focus-visible:wu-ring-2 focus-visible:wu-ring-blue-pHover focus-visible:wu-ring-offset-2"),day:n(u.day,"wu-text-gray-lead wu-transition-colors wu-duration-300 [&:not([aria-selected])]:hover:wu-bg-gray-25 wu-text-sm wu-w-9 wu-h-9 wu-min-w-0 wu-text-center wu-p-0 wu-rounded-none data-[today=true]:[&:not([aria-selected])]:wu-border data-[today=true]:[&:not([aria-selected])]:wu-border-blue-p data-[today=true]:[&:not([aria-selected])]:wu-text-gray-lead"),selected:n(u.selected,"wu-bg-blue-p [&:not(.rm)]:wu-text-white hover:wu-bg-blue-pHover"),range_middle:n("rm",u.range_middle,"wu-bg-blue-p/10 wu-rounded-none hover:wu-bg-blue-p/20 wu-text-gray-lead hover:wu-text-white data-[today=true]:wu-bg-blue-p/20 hover:data-[today=true]:wu-bg-blue-pHover"),range_end:n(u.range_end,"wu-rounded-none"),range_start:n(u.range_start,"wu-rounded-none wu-bg-blue-p hover:wu-bg-blue-pHover"),month_grid:n(u.month_grid,"[&>thead>tr>th]:wu-pb-2 wu-border-collapse wu-space-y-1"),button_next:n(u.button_next,ot({variant:"iconOnly"}),"wu-h-6 wu-w-6 wu-text-gray-lead"),button_previous:n(u.button_previous,ot({variant:"iconOnly"}),"wu-h-6 wu-w-6 wu-rotate-180 wu-text-gray-lead"),nav:n(u.nav,"wu-absolute wu-top-4 wu-right-3 wu-flex",r==="rtl"&&"wu-right-auto wu-left-3 wu-flex-row-reverse"),chevron:n(u.chevron,"!wu-text-red-500"),outside:n(u.outside,"wu-invisible"),disabled:n(u.disabled,"hover:wu-bg-white wu-text-gray-subtle"),...a},components:{Chevron:()=>t.jsx("span",{className:"wm-chevron-right wu-text-lg wu-leading-5"})},...s})}Rt.displayName="Calendar";const nt=e=>t.jsx(Rt,{...e}),ea=e=>{const{handleDateChange:a,disabled:r,onReset:s,showResetButton:u}=e;return t.jsxs("div",{className:"wu-flex wu-items-center wu-justify-end wu-gap-2 wu-mt-2 wu-date-picker-footer",children:[u&&t.jsx(K,{variant:"secondary",onClick:s,Icon:t.jsx("span",{className:"wu-text-[20px] wu-leading-5 -wu-mt-[1px] wm-refresh"}),className:"wu-date-picker-footer-reset",children:"Reset"}),t.jsx(De.PopoverClose,{asChild:!0,children:t.jsx(K,{onClick:a,disabled:r,className:"wu-date-picker-apply",children:"Apply"})})]})},wt=({formattedString:e,dir:a,placeholder:r="Select Date",className:s,variant:u="primary",color:o,...l})=>t.jsx(De.PopoverTrigger,{asChild:!0,dir:a,children:t.jsx(K,{...l,className:n("wu-justify-between wu-w-full wu-gap-2 wu-text-xs wu-border-b wu-rounded-none wu-rounded-t-sm wu-min-w-48 wu-border-gray-subtle wu-text-gray-lead wu-placeholder:wu-text-gray-subtle wu-placeholder:wu-font-light wu-bg-gray-10 hover disabled:wu-cursor-not-allowed disabled:wu-bg-gray-20 disabled:wu-border-gray-40 disabled:wu-text-subtle hover:wu-text-gray-lead hover:wu-bg-gray-10 hover:wu-border-gray-40 wu-datepicker-trigger",u==="outlined"&&"wu-border wu-border-subtle wu-bg-transparent",s),Icon:t.jsx("span",{className:"wm-calendar-month wu-text-sm"}),iconPosition:"right",children:e||r})}),ta=(e,a,r,s)=>!!(a||r&&e<r||s&&e>s),je=e=>e?typeof e=="string"?new Date(e):e:new Date,it="\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01])",Es=[{label:"Last 7 days",value:7},{label:"Last 30 days",value:30},{label:"Last 90 days",value:90},{label:"Last 365 days",value:365}],_s=({formatString:e="yyyy-MM-dd",value:a,onChange:r,disabled:s,minDate:u=A.sub(new Date,{years:5}),maxDate:o=A.add(new Date,{years:1}),dir:l="ltr",Label:w,labelPosition:i="top",onReset:c,showResetButton:f=!1,placeholder:p="Select Date",...h})=>{const[m,g]=d.useState(),[b,v]=d.useState(""),S=d.useCallback(()=>{const C=je(m);v(A.format(C,e)),r&&r(m)},[m,e,r]),y=d.useCallback(()=>{c?c():(g(void 0),v(""),r&&r(void 0))},[r,c]);return d.useEffect(()=>{const C=je(a);g(C),v(A.format(C,e))},[a,e]),t.jsxs(Q,{className:n("wu-flex wu-gap-1",i==="left"?"wu-items-center":"wu-flex-col wu-items-start","wu-date-picker-label"),dir:l,children:[w,t.jsxs(ee,{children:[t.jsx(wt,{...h,formattedString:b,dir:l,placeholder:p}),t.jsx(Z,{className:"wu-p-0 wu-w-fit wu-date-picker-content",align:"start",sideOffset:-.5,dir:l,children:t.jsx(nt,{dir:l,mode:"single",captionLayout:"dropdown",selected:m,onSelect:g,disabled:C=>ta(C,s,u,o),startMonth:u,endMonth:o,required:!0,autoFocus:!0,defaultMonth:m,className:n("wu-border wu-border-blue-p wu-date-picker"),footer:t.jsx(ea,{handleDateChange:S,disabled:s,onReset:y,showResetButton:f})})})]})]})},aa="yyyy-MM-dd",qs=[{label:"Day",value:1},{label:"Week",value:7},{label:"Month",value:30},{label:"Quarter",value:90},{label:"Year",value:365}],As=({current:e,onSelect:a,presetRanges:r=Es})=>{const[s,u]=d.useState(),[o,l]=d.useState(!1),[w,i]=d.useState(""),[c,f]=d.useState(""),[p,h]=d.useState(!1),m=d.useMemo(()=>r.map(y=>y.value),[r]),g=n("wu-flex wu-w-full wu-gap-2 wu-px-4 wu-py-2 wu-text-sm wu-text-gray-lead wu-transition-colors","wu-rounded-none hover:wu-bg-gray-10 focus:wu-outline-none focus-visible:wu-ring-2","focus-visible:wu-ring-blue-pHover focus-visible:wu-ring-offset-1 wu-text-start"),b=d.useCallback(y=>{if(y===void 0){u(void 0),l(!0);return}const C=Number(y)-1;u(C),l(!1),a({from:A.sub(new Date,{days:C}),to:new Date})},[a]),v=d.useCallback((y,C)=>{if(!y||!(e!=null&&e.to)||!(e!=null&&e.from)||!new RegExp(it).test(y))return!1;const k=new Date(C==="start"?y:e.from),I=new Date(C==="end"?y:e.to);return A.isBefore(I,k)?(h(!0),!1):(h(!1),!(A.isSameDay(k,e.from)&&A.isSameDay(I,e.to)))},[e]),S=d.useCallback((y,C)=>{if((C==="start"?i:f)(y),v(y,C)){const k={from:e==null?void 0:e.from,to:e==null?void 0:e.to};C==="start"&&(k.from=new Date(y)),C==="end"&&(k.to=new Date(y)),a(k)}},[e,a,v]);return d.useEffect(()=>{if(e!=null&&e.to&&(e!=null&&e.from)&&A.isValid(e.to)&&A.isValid(e.from)){i(A.format(e.from,aa)),f(A.format(e.to,aa));const y=A.differenceInCalendarDays(e.to,e.from);A.isToday(e.to)&&m.includes(y+1)?(u(y),l(!1)):(u(void 0),l(!0))}},[e,m]),t.jsxs("div",{className:"wu-flex wu-flex-col wu-gap-1 wu-p-2 wu-bg-white wu-w-60 wu-date-picker-sidebar",children:[t.jsx("ul",{className:"wu-flex wu-gap-1 wu-py-2 wu-date-picker-batch-list",children:qs.map(({label:y,value:C})=>t.jsx(Ne,{variant:"secondary",className:"wu-px-1 wu-py-1 wu-text-xs wu-h-fit wu-min-w-fit disabled:wu-bg-white",disabled:C!==1,children:y},C))}),t.jsxs("ul",{className:"wu-flex wu-flex-col wu-gap-1 wu-date-picker-ranges",children:[r.map(({label:y,value:C})=>t.jsx("li",{children:t.jsx("button",{className:n(g,s===C-1&&"wu-bg-blue-p/10"),onClick:()=>b(C),children:y})},C)),t.jsx("li",{children:t.jsx("button",{className:n(g,o&&"wu-bg-blue-p/10"),onClick:()=>b(),children:"Custom Range"})})]}),t.jsxs("div",{className:"wu-relative wu-flex wu-gap-3 wu-pt-2 wu-date-picker-range-footer",children:[t.jsx(pe,{placeholder:"Start Date",pattern:it,value:w,onChange:y=>S(y.target.value,"start"),"aria-label":"Start Date"}),t.jsx(pe,{placeholder:"End Date",pattern:it,value:c,onChange:y=>S(y.target.value,"end"),"aria-label":"End Date"}),p?t.jsx("small",{className:"wu-absolute wu-text-[10px] wu-leading-[14px] wu-text-red-deep wu-left-0 -wu-bottom-4 wu-text-start",children:"End date must be after start date"}):t.jsx("small",{className:"wu-absolute wu-right-0 wu-leading-[14px] -wu-bottom-4 wu-text-gray-subtle wu-text-end",children:"yyyy-mm-dd"})]})]})},Os=({formatString:e="yyyy/MM/dd",value:a,onChange:r,disabled:s,minDate:u=A.sub(new Date,{years:5}),maxDate:o=A.add(new Date,{years:1}),dir:l="ltr",minDateToSelect:w,maxDateToSelect:i,presetRanges:c,Label:f,labelPosition:p="top",onReset:h,showResetButton:m=!0,placeholder:g="Select Date Range",...b})=>{const[v,S]=d.useState(a),[y,C]=d.useState(a),[D,k]=d.useState(""),I=d.useCallback(()=>{if(y){const M=y.from,q=y.to;S({from:M,to:q}),k(`${A.format(M,e)} - ${A.format(q,e)}`),r&&r({from:M,to:q})}},[y,e,r]),W=d.useCallback(()=>{C(v)},[v]),T=d.useCallback(()=>{h?h():(S(void 0),C(void 0),k(""),r&&r(void 0))},[h,r]);return d.useEffect(()=>{if(a!=null&&a.from&&(a!=null&&a.to)){const M=je(a.from),q=je(a.to);S(a),C(a),k(`${A.format(M,e)} - ${A.format(q,e)}`)}else S(void 0),C({to:new Date,from:new Date})},[a,e]),t.jsxs(Q,{className:n("wu-flex wu-gap-1",p==="left"?"wu-items-center":"wu-flex-col wu-items-start","wu-date-picker-label"),dir:l,children:[f,t.jsxs(ee,{onOpenChange:M=>!M&&W(),children:[t.jsx(wt,{...b,formattedString:D,dir:l,placeholder:g}),t.jsxs(Z,{className:"wu-flex wu-p-0 wu-border wu-w-fit wu-border-blue-p",align:"start",sideOffset:-.5,dir:l,children:[t.jsx(As,{current:y,onSelect:C,presetRanges:c}),t.jsx(nt,{dir:l,numberOfMonths:2,mode:"range",captionLayout:"dropdown",selected:y,onSelect:C,disabled:M=>ta(M,s,u,o),startMonth:u,endMonth:o,required:!0,autoFocus:!0,defaultMonth:v==null?void 0:v.from,className:n("wu-shadow-none wu-date-range-picker"),min:w,max:i,footer:t.jsx(ea,{handleDateChange:I,disabled:s,onReset:T,showResetButton:m})})]})]})]})},ra=d.forwardRef((e,a)=>{const{className:r,rounded:s,...u}=e;return t.jsx("div",{className:n("wu-card wu-p-2 wu-pt-1 hover:wu-shadow-card wu-border wu-border-black/20 hover:wu-border-black/30 wu-transition-colors wu-duration-300",s?"wu-rounded-lg":"wu-rounded-sm",r),ref:a,...u})});ra.displayName="WuCard";const Ls=d.forwardRef((e,a)=>{const{className:r,...s}=e;return t.jsx("div",{ref:a,...s,className:n("wu-p-2 wu-mb-2 wu-border-b wu-border-gray-40 min-h-12 wu-card-header",r)})});Ls.displayName="WuCardHeader";const Ps=d.forwardRef((e,a)=>{const{className:r,...s}=e;return t.jsx("div",{ref:a,...s,className:n("wu-p-2 wu-mt-2 wu-border-t wu-border-gray-40 min-h-12 wu-card-footer",r)})});Ps.displayName="WuCardHeader";const sa=N.forwardRef(({className:e,partial:a,...r},s)=>t.jsx(Ze.Root,{ref:s,className:n("wu-h-4 wu-w-4 wu-shrink-0 wu-rounded-[2px] wu-bg-white wu-border wu-border-gray-subtle wu-ring-offset-background focus-visible:wu-outline-none focus-visible:wu-ring-2 focus-visible:wu-ring-ring focus-visible:wu-ring-offset-[1px] data-[state=checked]:wu-bg-blue-p data-[state=checked]:wu-text-white data-[state=checked]:wu-border-none data-[state=checked]:hover:wu-bg-blue-q hover:wu-bg-gray-20 hover:wu-border-blue-p wu-transition-all data-[state=checked]:disabled:wu-bg-gray-20","disabled:wu-cursor-not-allowed disabled:wu-opacity-50 disabled:data-[state=unchecked]:wu-bg-gray-20 disabled:hover:wu-border-gray-subtle disabled:wu-border-gray-subtle",e),...r,children:t.jsxs(Ze.Indicator,{className:n("wu-flex wu-items-center wu-justify-center wu-text-current"),children:[!a&&t.jsx("span",{className:"wm-check wu-text-base wu-leading-4"}),a&&t.jsx("span",{className:"wm-check-indeterminate-small wu-text-base wu-leading-4"})]})}));sa.displayName=Ze.Root.displayName;const te=d.forwardRef((e,a)=>{const{disabled:r,checked:s,Label:u,labelPosition:o="right",className:l,id:w=Fe(),partial:i,onChange:c,required:f,readonly:p,...h}=e;return d.useEffect(()=>{h.defaultChecked!==void 0&&s!==void 0&&console.error("WuCheckbox: Both `checked` and `defaultChecked` cannot be used together. Use only one of them.")},[h.defaultChecked,s]),t.jsxs("div",{className:Bs({labelPosition:o,className:"wu-checkbox-container"}),dir:h.dir,children:[t.jsx(sa,{id:w,...h,partial:i,checked:s,disabled:r||p,onCheckedChange:c,className:n("wu-peer wu-checkbox",l),required:f,ref:a}),u&&t.jsx(Q,{htmlFor:w,className:"wu-w-full wu-checkbox-label",children:u})]})}),Bs=X.cva("wu-flex wu-items-center wu-gap-2 wu-w-fit",{variants:{labelPosition:{left:"wu-flex-row-reverse wu-text-right",right:"wu-flex-row"}}});te.displayName="WuCheckbox";const Fs=e=>{const{className:a,children:r,...s}=e;return t.jsx("span",{...s,className:n("wu-flex wu-items-center wu-justify-center wu-truncate wu-max-w-28 wu-w-fit wu-px-2 wu-py-1 wu-text-xs wu-bg-gray-20 wu-rounded-sm hover:wu-bg-gray-40 hover:wu-text-blue-q",a),children:r})},dt=N.forwardRef(({className:e,...a},r)=>t.jsx(G.Command,{ref:r,className:n("wu-flex wu-h-full wu-w-full wu-flex-col wu-overflow-hidden wu-rounded-md",e),...a}));dt.displayName=G.Command.displayName;const ua=N.forwardRef(({className:e,...a},r)=>t.jsx("div",{className:"wu-flex wu-items-center wu-border-b wu-px-3",children:t.jsx(G.Command.Input,{ref:r,className:n("wu-flex wu-h-11 wu-w-full wu-rounded-md wu-bg-transparent wu-py-3 wu-text-sm wu-outline-none wu-placeholder:wu-text-muted-foreground disabled:wu-cursor-not-allowed disabled:wu-opacity-50",e),...a})}));ua.displayName=G.Command.Input.displayName;const ct=N.forwardRef(({className:e,...a},r)=>t.jsx(G.Command.List,{ref:r,className:n("",e),...a}));ct.displayName=G.Command.List.displayName;const ft=N.forwardRef((e,a)=>t.jsx(G.Command.Empty,{ref:a,className:"wu-text-center wu-p-2 wu-pb-2.5 wu-text-xs",...e}));ft.displayName=G.Command.Empty.displayName;const qe=N.forwardRef(({className:e,...a},r)=>t.jsx(G.Command.Group,{ref:r,className:n("",e),...a}));qe.displayName=G.Command.Group.displayName;const oa=N.forwardRef(({className:e,...a},r)=>t.jsx(G.Command.Separator,{ref:r,className:n("wu-mx-1 wu-my-1 wu-h-px wu-bg-gray-20",e),...a}));oa.displayName=G.Command.Separator.displayName;const Ae=N.forwardRef(({className:e,...a},r)=>t.jsx(G.Command.Item,{ref:r,className:n("wu-relative wu-flex wu-cursor-default wu-gap-2 wu-select-none wu-items-center wu-rounded-sm wu-px-2 wu-py-3 wu-text-sm wu-outline-none data-[disabled=true]:wu-pointer-events-none data-[disabled=true]:wu-opacity-50 [&_svg]:wu-pointer-events-none [&_svg]:wu-size-4 [&_svg]:wu-shrink-0",e),...a}));Ae.displayName=G.Command.Item.displayName;const Se=d.forwardRef(({containerHeight:e=400,list:a,callback:r,dir:s,className:u,style:o},l)=>t.jsx(Gr.Virtuoso,{ref:l,dir:s,className:u,style:{height:e,scrollbarWidth:"thin",scrollbarColor:"#d4d4d4 #f1f1f1",overflowX:"hidden",...o},data:a,itemContent:(w,i)=>r(w,i)}));Se.displayName="WuVirtualScroll";const zs=({tags:e,triggerRef:a})=>{const[r,s]=d.useState([]),[u,o]=d.useState([]),l=d.useMemo(()=>t.jsx("ul",{className:"wu-flex wu-flex-col wu-items-start wu-justify-center wu-list-none",children:u.map((i,c)=>t.jsx("li",{className:"wu-py-1 wu-text-xs wu-text-left",children:i},c))}),[u]),w=i=>{const c=document.createElement("div");Object.assign(c.style,{display:"inline-block",visibility:"hidden",position:"absolute",whiteSpace:"nowrap"}),c.textContent=i,document.body.appendChild(c);const f=c.offsetWidth;return document.body.removeChild(c),f+8};return d.useEffect(()=>{const i=()=>{if(a.current){const h=a.current.offsetWidth-20-36;let m=0;const g=[],b=[];e.forEach(v=>{const S=w(v);m+S+8<h?(g.push(v),m+=S+8):b.push(v)}),s(g),o(b)}};return i(),window.addEventListener("resize",i),()=>{window.removeEventListener("resize",i)}},[e,a]),t.jsxs("div",{className:"wu-flex wu-items-center wu-gap-2 wu-text-xs",children:[r.map((i,c)=>t.jsx("span",{className:"wu-px-1 wu-py-0.5 wu-text-xs wu-rounded-sm wu-bg-gray-10 wu-combobox-tag",children:i},c)),u.length>0&&t.jsx(He,{content:l,className:"wu-z-[51] wu-text-left",children:t.jsxs("span",{className:"wu-px-1 wu-py-0.5 wu-text-xs wu-rounded-sm wu-bg-gray-10 wu-combobox-tag",children:["+",u.length]})})]})},Hs=({placeholder:e="Select...",isEllipse:a=!1,selectedOptions:r,variant:s="flat",dir:u="ltr",accessorKey:o,multiple:l,id:w,disabled:i,selectAll:c,isCheckedAll:f,className:p,...h})=>{const[m,g]=d.useState([]),b=d.useRef(null);d.useEffect(()=>{if(!r||Array.isArray(r)&&r.length===0){g([]);return}if(l){const S=r;g(S==null?void 0:S.map(y=>y[o.label]));return}else g([r[o.label]])},[r]);const v=()=>{var S;return m.length?f&&(c!=null&&c.enable)&&(c!=null&&c.triggerText)?t.jsx("span",{className:"wu-overflow-hidden wu-text-xs wu-text-start wu-text-ellipsis wu-whitespace-nowrap",children:c.triggerText}):a?t.jsx("span",{className:"wu-overflow-hidden wu-text-xs wu-text-start wu-text-ellipsis wu-whitespace-nowrap",style:{width:`${(((S=b.current)==null?void 0:S.offsetWidth)||0)-32}px`},children:m.join(", ")}):t.jsx(zs,{tags:m,triggerRef:b}):t.jsx("p",{className:"wu-text-xs wu-opacity-70",children:e})};return t.jsx(be,{dir:u,asChild:!0,id:w,disabled:i,children:t.jsxs("button",{...h,ref:b,disabled:i,className:n("focus-visible:wu-ring-2 focus-visible:wu-ring-blue-pHover wu-bg-white focus-visible:wu-ring-offset-2 wu-flex wu-w-full wu-items-center wu-justify-between wu-border-b wu-border-gray-subtle wu-py-1.5 wu-px-2 placeholder:wu-text-gray-40 focus:wu-outline-none disabled:wu-cursor-not-allowed disabled:wu-opacity-50 hover:wu-bg-gray-10 hover:wu-border-blue-p wu-transition-colors focus-visible:wu-bg-gray-20 focus-visible:wu-border-blue-p wu-cursor-pointer wu-text-xs wu-rounded-t-sm wu-gap-2 wu-h-8 wu-group",s==="outlined"&&"wu-border wu-border-gray-subtle","disabled:wu-cursor-not-allowed disabled:hover:wu-border-gray-subtle disabled:wu-bg-gray-10",p),children:[v(),t.jsx("span",{className:"wm-arrow-drop-down group-data-[state=open]:wu-rotate-180 wu-transition-transform wu-duration-300 wu-text-base"})]})})},la=L.Root,na=L.Trigger,wa=L.Group,js=L.Portal,$s=L.Sub,Us=L.RadioGroup,ia=N.forwardRef(({className:e,inset:a,children:r,position:s,...u},o)=>t.jsxs(L.SubTrigger,{ref:o,className:n("wu-flex wu-cursor-default wu-select-none wu-text-xs wu-items-center wu-p-3 wu-outline-none focus:wu-bg-gray-20 data-[state=open]:wu-bg-gray-20",a&&"wu-pl-8",e),...u,children:[s==="left"&&t.jsx("span",{className:n("wm-chevron-right",u.dir==="rtl"&&"ml-2")}),r,s!=="left"&&t.jsx("span",{className:n("wu-text-base wu-leading-4",u.dir==="rtl"&&"wu-mr-auto wm-chevron-left",u.dir!=="rtl"&&"wu-ml-auto wm-chevron-right")})]}));ia.displayName=L.SubTrigger.displayName;const da=N.forwardRef(({className:e,...a},r)=>t.jsx(L.SubContent,{ref:r,className:n("wu-z-50 wu-min-w-[8rem] wu-overflow-hidden wu-border wu-text-xs wu-bg-white wu-text-gray-lead wu-shadow-lg 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-[side=bottom]:wu-slide-in-from-top-2 data-[side=left]:wu-slide-in-from-right-2 data-[side=right]:wu-slide-in-from-left-2 data-[side=top]:wu-slide-in-from-bottom-2",e),...a}));da.displayName=L.SubContent.displayName;const pt=N.forwardRef(({className:e,sideOffset:a=4,...r},s)=>t.jsx(L.Portal,{children:t.jsx(L.Content,{ref:s,sideOffset:a,className:n("wu-z-50 wu-min-w-[8rem] wu-overflow-hidden wu-border wu-text-xs wu-bg-white wu-text-gray-lead wu-shadow-md 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-[side=bottom]:wu-slide-in-from-top-2 data-[side=left]:wu-slide-in-from-right-2 data-[side=right]:wu-slide-in-from-left-2 data-[side=top]:wu-slide-in-from-bottom-2",e),...r})}));pt.displayName=L.Content.displayName;const $e=N.forwardRef(({className:e,inset:a,...r},s)=>t.jsx(L.Item,{ref:s,className:n("wu-relative wu-flex wu-cursor-default wu-select-none wu-items-center wu-text-xs wu-p-2 wu-outline-none wu-transition-colors focus:wu-bg-gray-20 data-[disabled]:wu-cursor-not-allowed data-[disabled]:wu-opacity-50",a&&"wu-pl-8",e),...r}));$e.displayName=L.Item.displayName;const ca=N.forwardRef(({className:e,children:a,checked:r,dir:s,...u},o)=>t.jsxs(L.CheckboxItem,{ref:o,className:n("wu-group wu-relative wu-flex wu-cursor-default wu-select-none wu-items-center wu-text-xs wu-py-3 wu-outline-none wu-transition-colors focus:wu-bg-gray-20 data-[disabled]:wu-cursor-not-allowed data-[disabled]:wu-opacity-50",s==="rtl"&&"wu-pr-8 wu-pl-2",s!=="rtl"&&"wu-pl-8 wu-pr-2",e),checked:r,...u,children:[t.jsx("span",{className:n("wu-absolute wu-flex wu-items-center wu-justify-center wu-w-4 wu-h-4 wu-rounded-sm wu-ring-1 wu-ring-gray-subtle group-disabled:wu-bg-gray-20 group-data-[state=checked]:wu-bg-blue-p group-hover:wu-bg-gray-20 group-hover:wu-ring-blue-p wu-transition-all group-data-[state=checked]:wu-ring-blue-p",s==="rtl"&&"wu-right-2",s!=="rtl"&&"wu-left-2"),children:t.jsx(L.ItemIndicator,{children:t.jsx("span",{className:"wm-check wu-text-base wu-text-white"})})}),a]}));ca.displayName=L.CheckboxItem.displayName;const fa=N.forwardRef(({className:e,children:a,...r},s)=>t.jsxs(L.RadioItem,{ref:s,className:n("wu-group wu-relative wu-flex wu-cursor-default wu-select-none wu-items-center wu-text-xs wu-py-3 wu-pl-8 wu-pr-2 wu-outline-none wu-transition-colors focus:wu-bg-gray-20 focus:wu-text-accent-foreground data-[disabled]:wu-cursor-not-allowed data-[disabled]:wu-opacity-50",e),...r,children:[t.jsx("span",{className:"wu-absolute wu-rounded-full wu-left-2 wu-flex wu-h-4 wu-w-4 wu-items-center wu-justify-center wu-ring-1 wu-ring-gray-subtle group-disabled:wu-bg-gray-20 group-data-[state=checked]:wu-bg-white group-hover:wu-bg-gray-20 group-hover:wu-ring-blue-p wu-transition-all group-data-[state=checked]:wu-ring-blue-p group-hover:group-data-[state=checked]:wu-ring-blue-q",children:t.jsx(L.ItemIndicator,{className:"wu-w-4 wu-h-4 wu-flex wu-items-center wu-justify-center",children:t.jsx("span",{className:"wm-circle wu-text-blue-p group-hover:group-data-[state=checked]:wu-text-blue-q wu-text-xs"})})}),a]}));fa.displayName=L.RadioItem.displayName;const Oe=N.forwardRef(({className:e,inset:a,...r},s)=>t.jsx(L.Label,{ref:s,className:n("wu-p-2 wu-font-medium wu-text-xs",a&&"wu-pl-8",e),...r}));Oe.displayName=L.Label.displayName;const Ue=N.forwardRef(({className:e,...a},r)=>t.jsx(L.Separator,{ref:r,className:n("-wu-mx-1 wu-my-1 wu-h-px wu-bg-gray-20",e),...a}));Ue.displayName=L.Separator.displayName;const pa=({option:e,value:a,multiple:r=!1,onSelect:s,accessorKey:u,dir:o})=>{const[l,w]=d.useState(r?[]:"");d.useEffect(()=>{a&&w(r?a.map(p=>JSON.stringify(p[u.value])):JSON.stringify(a[u.value]))},[a,u.value,r]);const i=r?l.includes(JSON.stringify(e[u.value])):l===JSON.stringify(e[u.value]),c=()=>{e.disabled||s(e)};return t.jsxs(Ae,{onSelect:c,disabled:e.disabled,className:n("wu-cursor-pointer wu-text-xs wu-items-start wu-leading-4 wu-py-2 wu-combobox-item hover:wu-bg-gray-100",i&&"wu-bg-gray-10"),dir:o,children:[r&&t.jsx(te,{checked:i}),t.jsx(Gs,{option:e,accessorKey:u})]})},Gs=({option:e,accessorKey:a})=>{const r=e[a.label];return t.jsxs("div",{className:"wu-flex wu-items-center wu-w-full wu-gap-1",children:[e.icon&&e.icon,r,e.isAdmin&&t.jsx("span",{className:"wu-ml-auto wu-text-sm wm-lock wu-text-orange-deep"})]})},ba=e=>{const{option:a,selectAll:r,handleSelectAll:s,isCheckedAll:u,isPartialSelected:o,...l}=e;switch("type"in a?a.type:"option"){case"all":return t.jsx(Ae,{onSelect:s,className:n("wu-cursor-pointer wu-text-xs wu-leading-4 wu-py-2 wu-combobox-item"),dir:l.dir,children:t.jsx(te,{checked:u||o,partial:o,"data-partial":o,Label:(r==null?void 0:r.label)||"Select All"})});case"group":return t.jsxs(qe,{children:[t.jsx(Oe,{children:a.label}),a.options.map((i,c)=>d.createElement(pa,{...l,option:i,key:c}))]});case"divider":return t.jsx(oa,{className:"wu-mx-4"});default:return t.jsx(pa,{...l,option:a})}},Vs=e=>{const a=[],r=[],s=[],u=[];return e.forEach(o=>{o.type==="group"?(a.push(o),s.push(...o.options),u.push(...o.options.filter(l=>!l.disabled))):o.type==="divider"?r.push(o):s.push(o),o!=null&&o.disabled||u.push(o)}),{groups:a,dividers:r,allOptions:s,enabledOptions:u}},Ys=d.memo(pe),Js=({data:e,accessorKey:a,value:r,defaultValue:s,Header:u,virtualizedThreshold:o=100,isEllipse:l,placeholder:w,variant:i,dir:c,onSelect:f,Label:p,maxHeight:h=420,multiple:m=!1,hasGroup:g=!1,selectAll:b,id:v,disabled:S,labelPosition:y="top",className:C,onScroll:D,maxContentWidth:k,...I})=>{const[W,T]=d.useState(""),[M,q]=d.useState(),[$,_]=d.useState(!1),[P,V]=d.useState(!1),[H,ae]=d.useState(!1),me=d.useRef(null),{allOptions:re,groups:xe,dividers:Te,enabledOptions:we}=d.useMemo(()=>g||b&&!b.includeDisabled?Vs(e):{allOptions:e,groups:[],dividers:[],enabledOptions:[]},[e,g]),ue=d.useMemo(()=>{if(!W)return e;const F=W.toLowerCase();return re.filter(se=>se[a.label].toLowerCase().includes(F))},[W,re,e,a.label]),E=d.useMemo(()=>m&&b!=null&&b.enable&&!W&&ue.length>0?[{type:"all"},...ue]:ue,[ue,W,m]),z=d.useMemo(()=>{const F=32*E.length+Te.length*9+xe.length*48;return Math.min(h,F)},[h,E,Te,xe]),Y=d.useCallback(F=>{const se=F[a.value];m?q(Go=>{const qt=Go||[],Br=qt.some(At=>At[a.value]===se)?qt.filter(At=>At[a.value]!==se):[...qt,F];return f==null||f(Br),Br}):(_(!1),q(F),f==null||f(F))},[m,a.value,f]),U=d.useCallback(F=>T(F.target.value),[]),_t=d.useCallback(()=>T(""),[]);d.useEffect(()=>{if(r!==void 0&&s!==void 0){console.error("defaultValue and value cannot be used simultaneously");return}else r!==void 0?q(r):s!==void 0&&q(s)},[r,s]),d.useEffect(()=>{if(!m)return;const F=b!=null&&b.includeDisabled?(M==null?void 0:M.length)===re.length:(M==null?void 0:M.length)===we.length;V(F);const se=(M==null?void 0:M.length)>0&&!F;ae(se)},[M,b]);const ie=d.useCallback(()=>{const F=P?[]:b!=null&&b.includeDisabled?re:we;q(F),f==null||f(F)},[P,m,re,we,f,b]),oe=Ee(y);return t.jsxs("div",{className:n(oe,"wu-flex wu-combobox-container"),ref:me,children:[t.jsxs(ee,{onOpenChange:F=>{F&&_t(),_(F)},open:$,modal:!0,children:[t.jsx(Hs,{...I,selectedOptions:M,accessorKey:a,isEllipse:l,placeholder:w,variant:i,dir:c,multiple:m,disabled:S,selectAll:b,isCheckedAll:P,className:C,id:v}),t.jsx(Z,{className:"wu-min-w-[--radix-popover-trigger-width] wu-max-w-[calc(100vw-32px)] wu-p-0 wu-bg-white wu-border wu-border-blue-p wu-combobox-content",align:"start",sideOffset:-1,style:{maxWidth:k},children:t.jsxs(dt,{id:v,children:[t.jsx("div",{className:"wu-m-2",children:t.jsx(Ys,{placeholder:"Search...",Icon:t.jsx("span",{className:"wm-search"}),className:"wu-text-xs wu-combobox-search",onChange:U,name:"Search","aria-label":"Search",dir:c,iconPosition:c==="rtl"?"right":"left"})}),u,t.jsxs(ct,{children:[t.jsx(ft,{children:"No results found."}),E.length>=o?t.jsx(Se,{className:"wu-combobox-list",containerHeight:h,list:E,callback:(F,se)=>t.jsx(ba,{option:se,value:M,onSelect:Y,multiple:m,accessorKey:a,dir:c,selectAll:b,handleSelectAll:ie,isCheckedAll:P,isPartialSelected:H},F),dir:c}):t.jsx("div",{style:{maxHeight:z,height:"fit-content",overflow:"auto"},className:"wu-combobox-list",onScroll:D,children:E.map((F,se)=>t.jsx(ba,{option:F,value:M,onSelect:Y,multiple:m,accessorKey:a,dir:c,selectAll:b,handleSelectAll:ie,isCheckedAll:P,isPartialSelected:H},se))})]})]})})]}),p&&t.jsx(Q,{htmlFor:v,className:"wu-combobox-label",children:p})]})},Ks=e=>{const{textToCopy:a,notificationText:r,...s}=e,[u,o]=d.useState(!1),l=async()=>{if(a)try{await navigator.clipboard.writeText(a),o(!0),setTimeout(()=>o(!1),2e3)}catch(w){console.error("Failed to copy:",w)}};return t.jsxs(K,{...s,onClick:l,variant:"iconOnly",className:n("wu-relative",e.className),"aria-label":"Copy to clipboard",children:[r&&t.jsx("span",{className:n("wu-absolute wu-text-[6px] wu-leading-3 -wu-top-4 wu-right-0 wu-bg-gray-notification wu-text-white wu-rounded-sm wu-shadow-md wu-px-1 wu-animate-ping-once",u?"wu-block":"wu-hidden"),children:r}),t.jsx(le,{icon:"wm-content-copy",className:"wu-text-lg"})]})},ha=O.Root,Xs=O.Trigger,Qs=O.Close,Zs=O.Portal,ga=N.forwardRef(({className:e,...a},r)=>t.jsx(O.Overlay,{className:n("wu-fixed wu-inset-0 wu-z-50 wu-bg-black/30 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",e,"wu-drawer-overlay"),...a,ref:r}));ga.displayName=O.Overlay.displayName;const Rs=X.cva("wu-fixed wu-z-50 wu-gap-4 wu-p-6 wu-shadow-lg wu-transition wu-ease-in-out data-[state=open]:wu-animate-in data-[state=closed]:wu-animate-out data-[state=closed]:wu-duration-500 data-[state=open]:wu-duration-500",{variants:{side:{top:"wu-inset-x-0 wu-top-0 wu-border-b data-[state=closed]:wu-slide-out-to-top data-[state=open]:wu-slide-in-from-top",bottom:"wu-inset-x-0 wu-bottom-0 wu-border-t data-[state=closed]:wu-slide-out-to-bottom data-[state=open]:wu-slide-in-from-bottom",left:"wu-inset-y-0 wu-left-0 wu-h-full wu-w-3/4 wu-border-r data-[state=closed]:wu-slide-out-to-left data-[state=open]:wu-slide-in-from-left sm:wu-max-w-sm",right:"wu-inset-y-0 wu-right-0 wu-h-full wu-w-3/4 wu-border-l data-[state=closed]:wu-slide-out-to-right data-[state=open]:wu-slide-in-from-right sm:wu-max-w-sm"}},defaultVariants:{side:"right"}}),bt=N.forwardRef(({side:e="right",className:a,children:r,hideCloseButton:s,...u},o)=>t.jsxs(Zs,{children:[t.jsx(ga,{}),t.jsxs(O.Content,{ref:o,className:n(Rs({side:e}),a),...u,children:[r,!s&&t.jsx(O.Close,{"aria-label":"close",asChild:!0,children:t.jsxs(Ne,{variant:"iconOnly",className:"wu-absolute wu-right-4 wu-top-4",children:[t.jsx("span",{className:"wm-close"}),t.jsx("span",{className:"wu-sr-only",children:"Close"})]})})]})]}));bt.displayName=O.Content.displayName;const ma=({className:e,...a})=>t.jsx("div",{className:n("",e),...a});ma.displayName="SheetHeader";const ht=N.forwardRef(({className:e,...a},r)=>t.jsx(O.Title,{ref:r,className:n("wu-text-lg wu-font-semibold",e),...a}));ht.displayName=O.Title.displayName;const xa=N.forwardRef(({className:e,...a},r)=>t.jsx(O.Description,{ref:r,className:n("wu-text-sm",e),...a}));xa.displayName=O.Description.displayName;const eu=e=>{const{Trigger:a,children:r,hideCloseButton:s,className:u,side:o="left",open:l,onOpenChange:w,preventClickOutside:i,...c}=e;return t.jsxs(ha,{open:l,onOpenChange:w,children:[t.jsx(Xs,{asChild:!0,children:a}),t.jsxs(bt,{...c,onInteractOutside:f=>{i&&f.preventDefault()},side:o,className:n("wu-bg-white wu-text-gray-lead wu-px-0",u),hideCloseButton:s,children:[t.jsx("div",{className:"wu-hidden",children:t.jsx(ht,{})}),r]})]})},tu=({children:e,...a})=>t.jsx(Qs,{...a,children:e}),ya=({className:e,isLoading:a,loadingText:r,children:s,...u})=>t.jsxs("footer",{className:n("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),...u,children:[t.jsx("div",{className:"wu-flex-1",children:s}),a&&t.jsx(Ce,{size:"16px",variant:"spinner",color:"#a3a3a3",message:r})]});ya.displayName="WuFooter";const va=d.forwardRef((e,a)=>{const{size:r="sm",idOrSlugOrUrl:s,variant:u="primary",...o}=e,l=r==="sm"?16:18,w=s.includes("http")?s:`/help/${s}.html`,i=u==="primary"?"wu-text-blue-p":"wu-text-gray-lead";return t.jsx("button",{...o,ref:a,onClick:()=>et(w),children:t.jsx("span",{className:n("wm-help wu-text-gray-subtle",`wu-text-[${l}px]`,i,o.disabled&&"wu-text-neutral-300","wu-help-button-icon")})})});va.displayName="WuHelpButton";const ne=(e,a)=>`wu-listbox-${e}`,au=e=>{const{CustomTrigger:a,disabled:r,value:s,placeholder:u,accessorKey:o,Chip:l,handleUnselect:w,variant:i,dir:c,className:f,...p}=e,[h,m]=d.useState(),g=d.useRef(null);return d.useEffect(()=>{if(!s){m(null);return}m(Array.isArray(s)?l?s.map((v,S)=>l({value:v,unselect:w,key:S})):s.map(v=>v[o.label]).join(", "):l?l({value:s,unselect:w}):s[o.label])},[s,l,o.label,m]),t.jsx(be,{asChild:!0,id:e.id,disabled:r,ref:g,children:(a==null?void 0:a(s))||t.jsxs("button",{...p,className:n("wu-group 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",i==="outlined"&&"wu-border wu-border-gray-subtle wu-bg-white",f,ne("trigger")),children:[t.jsx("div",{className:n("wu-truncate",l&&"wu-flex wu-items-center wu-gap-1 wu-flex-wrap",!h&&"wu-font-light"),children:h||u}),t.jsx(le,{icon:"wm-arrow-drop-down",className:n("wu-absolute wu-top-1 wm-arrow-drop-down group-data-[state=open]:wu-rotate-180 wu-transition-transform wu-duration-300 wu-text-base",c==="rtl"?"wu-left-1":"wu-right-1",ne("drop-icon"))})]})})};function ru(e){const{option:a,accessorKey:r,onSelect:s,multiple:u,dir:o,GroupLabel:l,Item:w,isSelected:i,...c}=e,f=r.group&&Array.isArray(a[r.group]),p=({item:h,className:m})=>d.createElement(Ae,{...c,key:JSON.stringify(h),onSelect:()=>s==null?void 0:s(h),value:a[r.value],className:n("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",!!(i!=null&&i(h))&&!u&&"wu-bg-blue-p/10",o==="rtl"&&"wu-justify-end",m,ne("item")),disabled:h.disabled},u&&t.jsx(te,{checked:i==null?void 0:i(h)}),w?w({value:h,isSelected:i==null?void 0:i(h)}):t.jsx(t.Fragment,{children:h[r.label]}));if(f){const h=a[r.group],m=typeof l=="string"?a[l]:l==null?void 0:l(a);return t.jsx(qe,{heading:m,children:h==null?void 0:h.map(g=>t.jsx(p,{item:g,className:"wu-pl-6"},JSON.stringify(g)))})}return t.jsx(p,{item:a})}const su=d.memo(ru),uu=e=>{const{label:a,onSelectAll:r,data:s,value:u}=e,[o,l]=d.useState(!1),[w,i]=d.useState(!1);return d.useEffect(()=>{!u||!s||(l(u.length>0),i(u.length>0&&u.length<s.length))},[s,u]),t.jsxs(Ae,{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:()=>r==null?void 0:r(!o),children:[t.jsx(te,{checked:o,partial:w}),a||"Select All"]})},ou=e=>{const{className:a,...r}=e;return t.jsxs("div",{className:"wu-relative",children:[t.jsx(le,{icon:"wm-search",className:"wu-absolute wu-top-[14px] wu-left-5"}),t.jsx(ua,{...r,"aria-label":"Search",className:n("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;",ne("input"),a)})]})},Na=(e,a,r)=>{const s=String(e[r.label]??"").toLowerCase(),u=String(e[r.value]??"").toLowerCase();return s.includes(a)||u.includes(a)},lu=(e,a,r)=>{const s=a.trim();if(s==="")return e;const u=s.toLowerCase(),o=[];for(const l of e){const w=r.group,i=w?l[w]:void 0;if(Array.isArray(i)){const c=i.filter(f=>Na(f,u,r));c.length>0&&o.push({...l,[w]:c})}else Na(l,u,r)&&o.push(l)}return o},nu=e=>{const{data:a,accessorKey:r,value:s,Item:u,Label:o,GroupLabel:l,CustomHeader:w,CustomTrigger:i,NoDataContent:c,Chip:f,onSelect:p,onScroll:h,disabled:m,multiple:g,searchable:b,selectAll:v,virtualizedThreshold:S=100,id:y,dir:C,className:D,listClass:k,placeholder:I="Select items...",variant:W,labelPosition:T="top",maxContentWidth:M,maxContentHeight:q}=e,[$,_]=d.useState(!1),[P,V]=d.useState(""),[H,ae]=d.useState(s),me=d.useMemo(()=>r,[r]),re=d.useMemo(()=>{if(!b||!P)return a;const E=P.toLowerCase().trim();return lu(a,E,r)},[a,P,r.label,b]),xe=E=>{g?ae(z=>{const Y=E[r.value],U=Array.isArray(z)?z:[],ie=U.some(oe=>oe[r.value]===Y)?U.filter(oe=>oe[r.value]!==Y):[...U,E];return p&&p(ie),ie}):(ae(E),p&&p(E),_(!1))},Te=d.useCallback(E=>{const z=E?a:[];ae(z),v!=null&&v.onSelectAll&&v.onSelectAll(E),p&&p(z)},[a,v,p]),we=E=>Array.isArray(H)?H.some(z=>z[r.value]===E[r.value]):(H==null?void 0:H[r.value])===E[r.value];d.useEffect(()=>{ae(s)},[s]);const ue=E=>{const z=Y=>t.jsx(su,{option:Y,accessorKey:me,multiple:g,onSelect:U=>xe(U),dir:C,GroupLabel:l,Item:u,isSelected:U=>we(U)},JSON.stringify(Y));return E.length>S?t.jsx(Se,{list:E,callback:(Y,U)=>z(U),dir:C}):E.map(z)};return t.jsxs("div",{className:n("wu-flex wu-text-sm wu-gap-2",T==="top"&&"wu-flex-col wu-gap-1",T==="left"&&"wu-flex-row",T==="right"&&"wu-flex-row-reverse",ne("container")),dir:C,children:[o&&t.jsx(Q,{htmlFor:y,className:ne("label"),children:o}),t.jsxs(ee,{open:$,onOpenChange:E=>{_(E),E||setTimeout(()=>{V("")},100)},children:[t.jsx(au,{CustomTrigger:i,disabled:m,value:H,accessorKey:r,placeholder:I,Chip:f,className:D,handleUnselect:xe,variant:W,id:y,dir:C}),t.jsx(Z,{className:n("wu-min-w-[--radix-popover-trigger-width] wu-max-w-[calc(100vw-32px)] wu-p-0 wu-bg-white wu-border wu-border-blue-p",ne("content")),align:"start",sideOffset:-1,style:{maxWidth:M},children:t.jsxs(dt,{id:e.id,shouldFilter:!1,children:[b&&t.jsx(ou,{value:P,onValueChange:V}),w,t.jsxs(ct,{className:n("wu-overflow-y-auto",ne("list"),k),onScroll:h,style:{maxHeight:q||"420px"},children:[t.jsx(ft,{children:c||"No results found."}),t.jsx(qe,{children:g&&(v==null?void 0:v.enabled)&&!P&&t.jsx(uu,{data:a,value:H,onSelectAll:Te,label:v.label})}),t.jsx(qe,{children:ue(re)})]})]})})]})]})},wu=e=>{const{checked:a,onSelect:r,children:s,disabled:u,preventCloseOnSelect:o}=e;return t.jsx(ca,{disabled:u,checked:a,onCheckedChange:r,onSelect:l=>o&&l.preventDefault(),children:s})},gt=e=>{const{children:a,className:r,Icon:s,iconPosition:u="left",disabled:o,onSelect:l,preventCloseOnSelect:w}=e,i=n("wu-flex wu-items-center wu-gap-2",s&&(u==="left"?"":"wu-justify-between wu-flex-row-reverse"),r),c=f=>{l&&l(f),w&&f.preventDefault()};return t.jsxs($e,{onSelect:c,disabled:o,className:i,children:[s&&t.jsx("div",{className:"wu-text-base",children:s}),a]})},iu=e=>{const{children:a,...r}=e;return t.jsxs(wa,{...r,children:[t.jsx(Oe,{children:e.label}),a]})},du=e=>{const{options:a,value:r,onSelect:s}=e;return t.jsx(Us,{value:r,onValueChange:s,children:a.map(u=>t.jsx(fa,{value:u.value,disabled:u.disabled,children:u.label},u.value))})},cu=e=>{const{className:a,...r}=e,s=n("wu-w-11/12 wu-mx-auto wu-border-gray-40",a);return t.jsx(Ue,{...r,className:s})},ke=N.forwardRef(({className:e,children:a,thumbColor:r,railColor:s,...u},o)=>t.jsxs(ce.Root,{ref:o,className:n("wu-relative wu-overflow-hidden",e),children:[t.jsx(ce.Viewport,{className:"wu-h-full wu-w-full wu-rounded-[inherit]",...u,children:a}),t.jsx(mt,{thumbColor:r,railColor:s}),t.jsx(ce.Corner,{})]}));ke.displayName=ce.Root.displayName;const mt=N.forwardRef(({className:e,orientation:a="vertical",thumbColor:r="#d4d4d4",railColor:s="#eeeeee",...u},o)=>t.jsx(ce.ScrollAreaScrollbar,{ref:o,orientation:a,className:n("wu-flex wu-touch-none wu-select-none wu-transition-colors",a==="vertical"&&"wu-h-full wu-w-2 wu-border-l wu-border-l-transparent wu-p-[1px]",a==="horizontal"&&"wu-h-2 wu-flex-col wu-border-t wu-border-t-transparent wu-p-[1px]",e),style:{background:s},...u,children:t.jsx(ce.ScrollAreaThumb,{className:"wu-relative wu-flex-1 wu-rounded-full",style:{background:r}})}));mt.displayName=ce.ScrollAreaScrollbar.displayName;const fu=e=>{const{children:a,label:r,open:s,onOpenChange:u,height:o,dir:l,...w}=e;return t.jsxs($s,{...w,open:s,onOpenChange:u,children:[t.jsx(ia,{dir:l,children:r}),t.jsx(js,{children:t.jsx(da,{onInteractOutside:i=>i.preventDefault(),children:t.jsx(ke,{className:"wu-h-fit",style:{height:o},dir:l,children:a})})})]})},pu="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",Ca=e=>{const{children:a,menuTitle:r,variant:s="flat",name:u,open:o,onOpenChange:l,height:w,preventCloseOnClickOutside:i,dir:c,Trigger:f,align:p="start",sideOffset:h=0,side:m="bottom",alignOffset:g,className:b,disabled:v,...S}=e;return t.jsxs(la,{...S,open:o,onOpenChange:l,dir:c,children:[t.jsx(na,{asChild:!0,dir:c,disabled:v,className:n("disabled:wu-text-zinc-300 disabled:wu-bg-white disabled:wu-cursor-not-allowed disabled:hover:wu-bg-transparent"),children:f??bu(s,u,v)}),t.jsx(pt,{className:n("wu-w-56 wu-border wu-border-blue-p disabled:wu-border-gray-40",b,"wu-menu-content"),align:p,sideOffset:h,side:m,alignOffset:g,onInteractOutside:y=>i&&y.preventDefault(),children:t.jsxs(ke,{className:"h-fit",style:{height:w},dir:c,children:[r&&t.jsxs(t.Fragment,{children:[t.jsx(Oe,{dir:c,className:"wu-menu-title",children:r}),t.jsx(Ue,{className:"wu-mt-0 wu-menu-separator",dir:c})]}),a??t.jsx("p",{children:"Menu Is Empty"})]})})]})},bu=(e,a,r)=>{const s=n(pu,"wu-flex wu-items-center wu-justify-between wu-gap-2 wu-h-8 wu-text-xs wu-group",e==="outlined"?"wu-border":"wu-border-b","wu-trigger-btn");return t.jsxs("button",{className:s,"aria-label":"menu-trigger",children:[t.jsx("span",{children:a??"Menu"}),t.jsx("span",{className:n("wm-arrow-drop-down wu-text-gray-lead wu-text-base wu-rotate-180 group-data-[state=closed]:wu-rotate-0 wu-transition-transform wu-duration-300 group-hover:wu-text-blue-q",r&&"wu-text-zinc-300 group-hover:wu-text-zinc-300")})]})},xt=d.forwardRef(({showMenu:e=!1,className:a,color:r="#1B3380",...s},u)=>{const o=n("wu-w-full wu-border wu-transition-all wu-duration-300");return t.jsxs("div",{...s,className:n("wu-flex wu-flex-col wu-w-[18px] wu-justify-between wu-aspect-[3/2] wu-transition-all wu-duration-300",a),ref:u,"aria-label":"menu-icon",children:[t.jsx("div",{className:`${o} wu-origin-center ${e?"wu-rotate-45 wu-translate-y-[5px]":""}`,style:{borderColor:r}}),t.jsx("div",{className:`${o} ${e?"wu-opacity-0":""}`,style:{borderColor:r}}),t.jsx("div",{className:`${o} wu-origin-center ${e?"-wu-rotate-45 -wu-translate-y-[5px]":""}`,style:{borderColor:r}})]})});xt.displayName="WuMenuIcon";const Sa={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%]"},hu=O.Root,gu=O.Trigger,mu=O.Portal,xu=O.Close,ka=d.forwardRef(({className:e,...a},r)=>t.jsx(O.Overlay,{ref:r,className:n("wu-fixed wu-inset-0 wu-z-50 wu-bg-black/30",Sa.overlay,e),...a}));ka.displayName=O.Overlay.displayName;const Ta=d.forwardRef(({className:e,children:a,hideCloseButton:r,...s},u)=>t.jsxs(mu,{children:[t.jsx(ka,{}),t.jsxs(O.Content,{ref:u,className:n("wu-fixed wu-left-[50%] wu-top-[50%] wu-z-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",Sa.content,e),...s,children:[a,!r&&t.jsx(O.Close,{"aria-label":"close",asChild:!0,children:t.jsxs(Ne,{variant:"iconOnly",className:n("wu-absolute wu-right-2 wu-top-1 hover:wu-bg-gray-lead/10","wuexp:wu-top-[18px] wuexp:wu-right-4 wuexp:wu-p-1.5 wuexp:wu-text-wuexp-gray-lead/70 wuexp:hover:wu-bg-wuexp-gray-lead/10"),children:[t.jsx("span",{className:"wu-text-lg wm-close wuexp:wu-text-xl wuexp:wu-leading-5"}),t.jsx("span",{className:"wu-sr-only",children:"Close"})]})})]})]}));Ta.displayName=O.Content.displayName;const Da=({className:e,...a})=>t.jsx("div",{className:n("wu-text-center wu-bg-gray-20 wu-w-full",e),...a});Da.displayName="DialogHeader";const Ma=({className:e,...a})=>t.jsx("div",{className:n("wu-flex wu-flex-col-reverse sm:wu-flex-row sm:wu-justify-end sm:wu-space-x-2 wu-p-4",e),...a});Ma.displayName="DialogFooter";const Ia=d.forwardRef(({className:e,...a},r)=>t.jsx(O.Title,{ref:r,className:n("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),...a}));Ia.displayName=O.Title.displayName;const yu=d.forwardRef(({className:e,...a},r)=>t.jsx(O.Description,{ref:r,className:n("wu-text-sm wu-text-muted-foreground",e),...a}));yu.displayName=O.Description.displayName;const vu={gradientBackground:"_gradientBackground_wwrco_1"},Wa=e=>{const{colors:a,size:r=.6,children:s,className:u,strokeWidth:o,centerOffset:l={x:0,y:0},...w}=e,i=d.useRef(null);return d.useEffect(()=>{const c=i.current;if(!c)return;c.style.setProperty("--width",`${c.offsetWidth*r}px`),c.style.setProperty("--height",`${c.offsetHeight*r}px`),c.style.setProperty("--colors",a.join(",")),c.style.setProperty("--stroke-width",`-${o||2}px`),c.style.setProperty("--spotlight-background","radial-gradient(100% var(--height) ellipse at 25% 70%, var(--colors))");let p;const h=m=>{p&&cancelAnimationFrame(p),p=requestAnimationFrame(()=>{const g=c.getBoundingClientRect();let b=m.clientX-g.left,v=m.clientY-g.top;b=Math.max(0,Math.min(b+l.x,g.width)),v=Math.max(0,Math.min(v+l.y,g.height));const S=`radial-gradient(
2
- var(--width) var(--height) ellipse at ${b}px ${v}px,
3
- var(--colors)
4
- )`;c.style.setProperty("--spotlight-background",S)})};return window.addEventListener("mousemove",h),()=>{window.removeEventListener("mousemove",h),p&&cancelAnimationFrame(p)}},[a,r,o,l]),t.jsx("div",{ref:i,className:n(vu.gradientBackground,"wu-transform-gpu",u),...w,children:s})},Ea="600px",Nu={sm:"400px",md:"600px",lg:"1200px"},Cu={primary:"wu-bg-blue-p wu-text-white hover:wu-bg-opacity-70",secondary:"hover:wu-bg-blue-p hover:wu-bg-gray-100 wu-text-blue-p",iconOnly:"wu-p-2 hover:wu-bg-gray-40 wu-min-w-[auto] disabled:wu-grayscale disabled:wu-opacity-80 focus-visible:wu-ring-offset-0 focus:wu-bg-blue-soft"},Su=({Trigger:e,children:a,size:r="md",hideCloseButton:s,preventClickOutside:u,onOpenChange:o,open:l,dir:w,maxWidth:i,maxHeight:c,className:f,style:p,variant:h="action",...m})=>{const g={action:["#1D50F4cc 60%","#EEF3FBcc"],upgrade:["#FF9F00cc 60%","#FDEDCCcc"],critical:["#CC0000cc 60%","#FFB6B6cc"]};return t.jsxs(hu,{modal:!0,onOpenChange:o,open:l,children:[e&&t.jsx(gu,{asChild:!0,children:e}),t.jsxs(Ta,{style:{width:"calc(100% - 64px)",maxWidth:i||Nu[r],maxHeight:c||Ea,...p},hideCloseButton:s,onInteractOutside:b=>u&&b.preventDefault(),dir:w,"aria-describedby":void 0,"data-variant":h,className:n("wu-group wuexp:wu-rounded-2xl",f),...m,children:["data-theme"in m&&t.jsx(Wa,{colors:g[h],strokeWidth:4,className:n("wuexp:wu-rounded-2xl wuexp:wu-text-wuexp-gray-lead wu-transform-gpu wu-flex wu-flex-col",f),style:{maxHeight:c||Ea},children:a}),!("data-theme"in m)&&a]})]})},ku=({children:e,style:a={},...r})=>t.jsx("div",{className:n("wu-flex wu-flex-col wu-gap-4 wu-px-3 wu-py-4 rtl:wu-text-right wu-overflow-auto wu-bg-white","wuexp:wu-p-8"),children:t.jsx("div",{...r,style:{...a,paddingLeft:`${(Number(a==null?void 0:a.paddingLeft)||0)+4}px`,paddingRight:`${(Number(a==null?void 0:a.paddingRight)||0)+4}px`},children:e})}),Tu=({children:e,className:a,...r})=>t.jsx(Da,{...r,"data-variant":"action",className:n("wu-text-lg wu-text-gray-lead wu-font-medium","wuexp:wu-rounded-t-[calc(1rem-0.125rem)] wuexp:wu-px-4 wuexp:wu-py-[15px]","wuexp:group-data-[variant=action]:wu-bg-blue-sidebar wuexp:group-data-[variant=action]:wu-text-blue-q","wuexp:group-data-[variant=critical]:wu-bg-[#F9E0E0] wuexp:group-data-[variant=critical]:wu-text-red-deep","wuexp:group-data-[variant=upgrade]:wu-bg-[#FEF1D9] wuexp:group-data-[variant=upgrade]:wu-text-orange-deep",a),children:t.jsx(Ia,{className:"wuexp:wu-font-normal wuexp:wu-justify-start wuexp:wu-text-[28px] wuexp:wu-h-auto wuexp:wu-leading-[34px]",children:e})}),Du=({children:e,className:a,...r})=>t.jsx(Ma,{...r,className:n("wu-border-t wu-border-gray-40 wu-bg-white wu-min-h-16 wu-mx-4 wu-px-0","wuexp:wu-mx-0 wuexp:wu-rounded-b-[calc(1rem-0.125rem)] wuexp:wu-min-h-16 wuexp:wu-p-4","wuexp:group-data-[variant=upgrade]:wu-border-[#EED6A8]","wuexp:group-data-[variant=action]:wu-border-[#BAC9F8]","wuexp:group-data-[variant=critical]:wu-border-[#F0B3B3]",a),children:e}),Mu=({children:e,variant:a="primary",className:r,...s})=>t.jsx(xu,{className:n("wu-inline-flex wu-items-center wu-justify-center wu-whitespace-nowrap wu-rounded-sm wu-text-sm wu-font-normal wu-ring-offset-background wu-transition-colors focus-visible:wu-outline-none focus-visible:wu-ring-2 focus-visible:wu-ring-blue-soft focus-visible:wu-ring-offset-2 disabled:wu-cursor-not-allowed wu-leading-4 disabled:wu-bg-gray-20 disabled:wu-text-gray-subtle disabled:wu-opacity-80 disabled:wu-ring-gray-subtle wu-px-6 wu-py-2 wu-min-w-[104px] wu-h-8",Cu[a],"wuexp:wu-rounded","wuexp:group-data-[variant=critical]:wu-bg-red-deep","wuexp:group-data-[variant=action]:wu-bg-blue-p","wuexp:group-data-[variant=upgrade]:wu-bg-orange-soft",r),...s,children:e}),Iu=({placeholder:e="Select...",value:a,multiple:r=!1,accessorKey:s,variant:u="flat",dir:o="ltr",customTriggerChildren:l,id:w,disabled:i,selectAll:c,isCheckedAll:f,width:p,...h})=>{const[m,g]=d.useState(""),[b,v]=d.useState(e);d.useEffect(()=>{if(!a||Array.isArray(a)&&a.length===0){v(e),g("");return}const y=s.label;if(r&&Array.isArray(a)){const C=a.map(D=>D[y]).join(", ");g(C)}else!r&&!Array.isArray(a)&&g(a[y])},[a,s.label,r,e]);const S=()=>e&&!m?t.jsx("p",{className:"wu-text-xs wu-opacity-70",children:b}):t.jsx("span",{className:n("wu-overflow-hidden wu-text-xs wu-text-start wu-text-ellipsis wu-whitespace-nowrap"),style:{width:`${(p||0)-32}px`},children:f?(c==null?void 0:c.triggerText)??m:m});return t.jsx(na,{asChild:!0,dir:o,id:w,disabled:i,children:t.jsxs("button",{...h,disabled:i,className:n("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",u==="outlined"&&"wu-border wu-border-gray-subtle","wu-group wu-select-trigger",h.className),children:[l??S(),t.jsx("span",{className:"wm-arrow-drop-down group-data-[state=open]:wu-rotate-180 wu-transition-transform wu-duration-300 wu-text-base"})]})})},_a=({option:e,value:a,multiple:r=!1,onSelect:s,accessorKey:u,dir:o="ltr"})=>{const[l,w]=d.useState(r?[]:"");d.useEffect(()=>{a&&w(r?a.map(p=>JSON.stringify(p[u.value])):JSON.stringify(a[u.value]))},[a,u.value,r]);const i=r?l.includes(JSON.stringify(e[u.value])):l===JSON.stringify(e[u.value]),c=f=>{e.disabled||(s(e),r&&f.preventDefault())};return t.jsxs($e,{onClick:c,disabled:e.disabled,className:n("wu-cursor-pointer wu-text-xs wu-py-2 wu-leading-4 wu-select-item wu-items-start",i&&"wu-bg-gray-10"),dir:o,children:[r&&t.jsx(te,{checked:i}),t.jsx(qa,{option:e,accessorKey:u})]})},qa=({option:e,accessorKey:a})=>{const r=String(e[a.label]);return t.jsxs("div",{className:"wu-flex wu-items-center wu-w-full wu-gap-1 wu-text-xs wu-pl-2",children:[e.icon,r,e.isAdmin&&t.jsx("span",{className:"wu-ml-auto wm-lock wu-text-sm wu-text-orange-deep"})]})},Aa=e=>{const{option:a,handleSelectAll:r,isCheckedAll:s,isPartialSelected:u,...o}=e;switch("type"in a?a.type:"option"){case"all":return t.jsxs($e,{onSelect:w=>{w.stopPropagation(),w.preventDefault(),r==null||r()},className:n("wu-cursor-pointer wu-text-xs wu-py-8 wu-leading-4 wu-select-item"),dir:o.dir,children:[t.jsx(te,{"data-partial":u,checked:s||u,partial:u}),t.jsx(qa,{option:a,accessorKey:o.accessorKey})]});case"group":return t.jsxs(wa,{dir:o.dir,children:[t.jsx(Oe,{className:"wu-text-xs",children:a.label}),a.options.map((w,i)=>d.createElement(_a,{...o,option:w,key:i}))]});case"divider":return t.jsx(Ue,{className:"wu-mx-4"});default:return t.jsx(_a,{...o,option:a})}},Wu=e=>{let a=0,r=0;const s=[],u=[],o=l=>{l.type==="divider"?a++:l.type==="group"?(r++,l.options.forEach(w=>{o(w)})):(s.push(l),l.disabled||u.push(l))};return e.forEach(l=>{o(l)}),{separators:a,groups:r,enabledOptions:u,totalData:s.length,cleanData:s}},Eu=100,_u=400,qu=32,Au=9,Ou=32,Oa=({data:e,onSelect:a,multiple:r=!1,defaultValue:s,value:u,accessorKey:o,variant:l="flat",dir:w="ltr",placeholder:i,Label:c,virtualizedThreshold:f=Eu,maxHeight:p=_u,hasGroup:h=!1,Header:m,CustomTrigger:g,selectAll:b,disabled:v,labelPosition:S="top",onScroll:y,maxContentWidth:C,...D})=>{const[k,I]=d.useState(),W=d.useRef(null),[T,M]=d.useState(!1),[q,$]=d.useState(!1),{cleanData:_,totalData:P,separators:V,groups:H,enabledOptions:ae}=h||b!=null&&b.enable?Wu(e):{cleanData:e,totalData:e.length,separators:0,groups:0,enabledOptions:[]},me=d.useMemo(()=>r&&b!=null&&b.enable&&e.length>0?[{type:"all",[o.label]:b.label||"Select All"},...e]:e,[e,b,r]),re=d.useCallback(E=>{const z=E[o.value];if(r)I((Y=[])=>{const U=Y,ie=U.some(oe=>oe[o.value]===z)?U.filter(oe=>oe[o.value]!==z):[...U,E];return a==null||a(ie),ie});else{const Y=E;I(Y),a==null||a(Y)}},[r,o.value,a]);d.useEffect(()=>{if(s&&u){console.error("defaultValue and value cannot be used simultaneously");return}!s&&!u&&I(void 0),s!==void 0&&I(s),u!==void 0&&I(u)},[s,u]);const xe=d.useMemo(()=>Math.min(p,P*qu+V*Au+H*Ou),[p,P,V,H]),Te=me.length>f;d.useEffect(()=>{if(!r)return;const E=b!=null&&b.includeDisabled?(k==null?void 0:k.length)===e.length:(k==null?void 0:k.length)===ae.length;M(E);const z=(k==null?void 0:k.length)>0&&!E;$(z)},[k,b]);const we=d.useCallback(()=>{const E=T?[]:b!=null&&b.includeDisabled?h?_:e:ae;I(E),a==null||a(E)},[T,r,e,ae,a,b]),ue=Ee(S);return t.jsxs("div",{className:n(ue,"wu-flex wu-select-container"),ref:W,dir:w,children:[t.jsxs(la,{children:[t.jsx(Iu,{...D,value:k,multiple:r,variant:l,dir:w,placeholder:i,accessorKey:o,customTriggerChildren:g,id:D.id,disabled:v,selectAll:b,isCheckedAll:T}),t.jsxs(pt,{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:D.id,style:{maxWidth:C},children:[m,Te?t.jsx(Se,{list:me,containerHeight:p,callback:(E,z)=>t.jsx(Aa,{option:z,accessorKey:o,multiple:r,onSelect:re,value:k,dir:w,handleSelectAll:we,isCheckedAll:T,isPartialSelected:q}),dir:w}):t.jsx("div",{onScroll:y,style:{maxHeight:xe,height:"fit-content",overflow:"auto"},className:"wu-select-list",children:me.map((E,z)=>t.jsx(Aa,{option:E,accessorKey:o,multiple:r,onSelect:re,value:k,handleSelectAll:we,isCheckedAll:T,dir:w,isPartialSelected:q},`${z}`))})]})]}),c&&t.jsx(Q,{htmlFor:D.id,className:"wu-select-label",children:c})]})},Ge=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Lu=({value:e,onChange:a,min:r=A.sub(new Date,{years:5}),max:s=A.add(new Date,{years:1}),placeholder:u="Select a month",Label:o,labelPosition:l="top",disabled:w,id:i,readonly:c,disabledMonths:f=[],...p})=>{const[h,m]=d.useState(null),[g,b]=d.useState(""),[v,S]=d.useState({value:Math.min(new Date().getFullYear(),new Date(s).getFullYear()),label:Math.min(new Date().getFullYear(),new Date(s).getFullYear())}),y=d.useMemo(()=>{const D=new Date(r).getFullYear(),k=new Date(s).getFullYear();return Array.from({length:k-D+1},(I,W)=>({value:k-W,label:k-W}))},[r,s]);d.useEffect(()=>{if(e){const D=new Date(e),k=D.getFullYear(),I=D.getMonth();m({year:k,month:I}),b(`${Ge[I]} ${k}`),S({value:k,label:k})}},[e]);const C=()=>{h&&a&&(a(new Date(h.year,h.month,15)),b(`${Ge[h.month]} ${h.year}`))};return t.jsxs("div",{className:n("wu-flex wu-flex-col wu-items-center",Ee(l),l==="top"&&"wu-items-start"),children:[t.jsxs(ee,{children:[t.jsx(wt,{...p,disabled:w||c,id:i,dir:"ltr",placeholder:u,formattedString:g}),t.jsxs(Z,{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:[t.jsx("div",{className:"wu-px-1 wu-mx-auto wu-w-full",children:t.jsx(Oa,{data:y,accessorKey:{value:"value",label:"label"},value:v,onSelect:D=>S(D),multiple:!1,maxHeight:7*32})}),t.jsx(Pu,{year:v==null?void 0:v.value,selectedMonth:h==null?void 0:h.month,selectedYear:h==null?void 0:h.year,onClick:(D,k)=>m({year:k,month:D}),disabledMonths:f}),t.jsx("div",{className:"wu-flex wu-justify-end wu-px-0.5",children:t.jsx(De.PopoverClose,{asChild:!0,children:t.jsx(K,{onClick:C,children:"Apply"})})})]})]}),o&&t.jsx(Q,{className:"wu-truncate wu-max-w-[120px] wu-min-w-fit wu-select-label",children:o})]})},Pu=({year:e,selectedMonth:a,selectedYear:r,onClick:s,disabledMonths:u=[]})=>{const o=new Date,l=o.getFullYear(),w=o.getMonth(),i=d.useMemo(()=>{const c=new Set;return u.forEach(f=>{const p=typeof f=="string"?new Date(f):f;c.add(`${p.getFullYear()}-${p.getMonth()}`)}),c},[u]);return t.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:Ge.map((c,f)=>{const p=e===l&&f===w,h=a===f&&r===e;return t.jsx("button",{disabled:i.has(`${e}-${f}`),onClick:()=>s(f,e),className:n("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",p&&"wu-border wu-border-blue-p",h&&"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":`${Ge[f]} ${e}`,"data-month":f,"data-year":e,children:c},c)})})},La=(e,a,r,s=96)=>{if(e.length===0||s<=0)return[[],[]];const[o,l]=d.useState([]),[w,i]=d.useState([]);return d.useEffect(()=>{const c=()=>{var g,b;const f=((g=a.current)==null?void 0:g.clientWidth)||0,p=((b=r.current)==null?void 0:b.clientWidth)||0,h=f-p,m=Math.floor(h/s);l(e.slice(0,m)),i(e.slice(m))};return c(),window.addEventListener("resize",c),()=>{window.removeEventListener("resize",c)}},[e,s]),[o,w]},Pa={wuPrimaryLink:"_wuPrimaryLink_1sy3v_1",wuPrimaryPopoverContent:"_wuPrimaryPopoverContent_1sy3v_8"},Bu=e=>{const{Links:a,children:r,className:s,...u}=e,o=d.useMemo(()=>a.map((f,p)=>d.cloneElement(f,{className:n(Pa.wuPrimaryLink,f.props.className,"wu-primary-nav-link"),key:p})),[a]),l=d.useRef(null),w=d.useRef(null),[i,c]=La(o,l,w);return t.jsx(t.Fragment,{children:t.jsxs("header",{className:n("wu-flex wu-items-center wu-justify-between wu-gap-4 wu-px-2 wu-py-1 wu-bg-white wu-border-b",s),...u,ref:l,children:[t.jsxs("div",{className:"wu-flex wu-items-center wu-gap-2",children:[t.jsx("nav",{className:"wu-flex wu-items-center wu-justify-start wu-gap-4 wu-primary-nav-left",children:i}),c.length>0&&t.jsxs(ee,{children:[t.jsx(be,{className:"wu-p-1 wu-pb-0 wu-rounded-sm focus:wu-outline-none focus:wu-bg-gray-25","aria-label":"more",children:t.jsx("span",{className:"wm-more-vert"})}),t.jsx(Z,{className:n(Pa.wuPrimaryPopoverContent,"wu-primary-nav-popover-left"),align:"start",sideOffset:12,children:c})]})]}),r&&t.jsxs(t.Fragment,{children:[t.jsx("section",{className:"wu-items-center wu-justify-end wu-hidden wu-gap-4 sm:wu-flex wu-primary-nav-right",ref:w,children:r}),t.jsxs(ee,{children:[t.jsx(be,{className:"sm:wu-hidden",children:t.jsx("span",{className:"wu-text-lg wm-menu"})}),t.jsx(Z,{className:"wu-bg-white wu-border wu-border-blue-p wu-w-fit wu-primary-nav-popover-right",align:"end",sideOffset:4,children:r})]})]})]})})},yt={wuSecondaryLink:"_wuSecondaryLink_1edl1_1",wuSecondaryNav:"_wuSecondaryNav_1edl1_6"},Fu=e=>{const{Links:a,children:r,className:s,...u}=e,o=d.useMemo(()=>a.map((p,h)=>d.cloneElement(p.link,{key:h,className:n(yt.wuSecondaryLink,p.link.props.className,"wu-secondary-nav-link-container"),children:t.jsxs(t.Fragment,{children:[d.cloneElement(p.imgOrIcon,{className:n("wu-w-5 wu-h-5 wu-flex wu-items-center wu-justify-center wu-text-lg wu-leading-5",p.imgOrIcon.props.className)}),t.jsx("div",{className:"wu-secondary-nav-link",children:p.link.props.children})]})})),[a]),l=d.useRef(null),w=d.useRef(null),i=d.useRef(null),[c,f]=La(o,l,i);return t.jsx(t.Fragment,{children:t.jsxs("header",{className:n("wu-flex wu-items-center wu-justify-between wu-gap-4 wu-border-y wu-border-gray-25 wu-h-[50px]",s),...u,ref:l,children:[t.jsxs("div",{className:"wu-flex wu-items-center wu-justify-start wu-gap-2",children:[t.jsx("nav",{className:n(yt.wuSecondaryNav,"wu-flex wu-items-center wu-justify-start wu-w-full wu-h-full wu-secondary-nav-left"),ref:w,children:c}),f.length>0&&t.jsxs(ee,{children:[t.jsx(be,{className:"wu-p-1 wu-pb-0 wu-rounded-sm focus:wu-outline-none focus:wu-bg-gray-25","aria-label":"more",children:t.jsx("span",{className:"wm-more-vert"})}),t.jsx(Z,{className:n(yt.wuSecondaryNavPopover,"wu-secondary-nav-popover-left"),align:"start",sideOffset:12,children:f})]})]}),r&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"wu-items-center wu-justify-end wu-hidden sm:wu-flex",ref:i,children:r}),t.jsxs(ee,{children:[t.jsx(be,{className:"sm:wu-hidden",children:t.jsx("span",{className:"wu-text-lg wm-menu"})}),t.jsx(Z,{className:"wu-bg-white wu-border wu-border-blue-p wu-w-fit wu-secondary-nav-popover-right",align:"end",sideOffset:12,children:r})]})]})]})})},Ba=d.forwardRef(({totalRows:e,initialPage:a,initialPageSize:r=100,onPageChange:s,className:u,disabled:o=!1,...l},w)=>{const[i,c]=d.useState(a),[f,p]=d.useState(r);d.useEffect(()=>{c(a),p(r)},[a,r]);const h=Math.ceil(e/f),m=i*f+1,g=Math.min((i+1)*f,e),b=Array.from({length:h},(y,C)=>C),v=d.useCallback(y=>{y>=0&&y<h&&(c(y),s==null||s(y))},[h,s]),S=7*32;return t.jsxs("div",{className:n("wu-flex wu-items-center wu-gap-[2px]",u,"wu-pagination"),...l,role:"navigation",children:[t.jsx(Fa,{label:"Previous page",onClick:()=>v(i-1),disabled:i===0||o,icon:"wm-arrow-back-ios-new",className:"hover:wu-bg-gray-20 rtl:wu-rotate-180 wu-prev-btn"}),t.jsx(Ca,{name:`${m} - ${g}`,className:"wu-w-[96px] wu-min-w-[96px] wu-pagination-menu",align:"end",disabled:o,children:t.jsx(ke,{style:{maxHeight:S+"px"},dir:l.dir,children:b.length>100?t.jsx(Se,{className:"wu-pagination-list",containerHeight:S,list:b,callback:(y,C)=>t.jsxs(gt,{onSelect:()=>v(C),className:n("wu-py-2",C===i&&"wu-bg-gray-20","wu-pagination-item"),children:[C*f+1," -"," ",Math.min((C+1)*f,e)]},y)}):b.map(y=>t.jsxs(gt,{onSelect:()=>v(y),className:n(y===i&&"wu-bg-gray-20","wu-py-2 hover:wu-bg-gray-20","wu-pagination-item"),children:[y*f+1," -"," ",Math.min((y+1)*f,e)]},y))})}),t.jsx(Fa,{label:"Next page",onClick:()=>v(i+1),disabled:i===h-1||o,icon:"wm-arrow-forward-ios",className:"hover:wu-bg-gray-20 rtl:wu-rotate-180 wu-next-btn"})]})});Ba.displayName="WuPagination";const Fa=({label:e,onClick:a,disabled:r,icon:s,className:u})=>t.jsx(K,{variant:"iconOnly",onClick:a,disabled:r,className:n("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",u),"aria-label":e,children:t.jsx("span",{className:n("wu-text-sm",s)})}),zu=({Trigger:e,children:a,className:r,dir:s,open:u,onOpenChange:o,modal:l,...w})=>t.jsxs(ee,{open:u,onOpenChange:o,modal:l,children:[t.jsx(be,{asChild:!0,dir:s,children:e}),t.jsx(Z,{className:n("wu-w-80 wu-p-0 wu-border-blue-p wu-bg-white wu-dark:border-gray-switcher",r),dir:s,...w,children:a})]}),Hu=e=>t.jsx(De.PopoverClose,{asChild:!0,children:t.jsx(K,{...e})}),za=N.forwardRef(({className:e,...a},r)=>t.jsx(We.Root,{className:n("wu-grid wu-gap-2",e),...a,ref:r}));za.displayName=We.Root.displayName;const Ha=N.forwardRef(({className:e,...a},r)=>t.jsx(We.Item,{ref:r,className:n("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),...a,children:t.jsx(We.Indicator,{className:"wu-flex wu-items-center wu-justify-center",children:t.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"})})}));Ha.displayName=We.Item.displayName;const ja=d.forwardRef((e,a)=>{const{options:r,defaultValue:s,onChange:u,label:o,dir:l,...w}=e;return t.jsxs(za,{defaultValue:s,required:w.required,disabled:w.disabled,onValueChange:u,id:w.id,dir:l,name:w.name,className:n("w-fit",w.className),ref:a,style:w.style,children:[t.jsx(_e,{htmlFor:w.id,className:"wu-text-sm wu-font-normal wu-text-gray-lead wu-leading-6 wu-radio-group-label",children:o}),r.map(i=>t.jsxs("div",{className:"wu-flex wu-items-center wu-gap-2 wu-radio-item-container",children:[t.jsx(Ha,{value:i.value,id:i.value,disabled:i.disabled,required:i.required,"aria-label":i.value,className:"wu-peer wu-radio-item"}),t.jsx(_e,{htmlFor:i.value,className:n(i.required&&"after:wu-content-['*'] after:wu-mx-[2px] after:wu-text-rose-500","wu-radio-item-label"),children:i.label})]},i.value))]})});ja.displayName="WuRadioGroup";const ju=e=>{const{children:a,...r}=e;return t.jsxs(ke,{...r,role:"complementary","aria-label":"ScrollArea",children:[a,t.jsx(mt,{orientation:"horizontal"})]})},$a=N.forwardRef(({className:e,orientation:a="horizontal",decorative:r=!0,...s},u)=>t.jsx(Pt.Root,{ref:u,decorative:r,orientation:a,className:n("shrink-0 bg-border",a==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...s}));$a.displayName=Pt.Root.displayName;function Ua({className:e,...a}){return t.jsx("div",{className:n("animate-pulse rounded-md bg-muted",e),...a})}const vt=768;function $u(){const[e,a]=N.useState(void 0);return N.useEffect(()=>{const r=window.matchMedia(`(max-width: ${vt-1}px)`),s=()=>{a(window.innerWidth<vt)};return r.addEventListener("change",s),a(window.innerWidth<vt),()=>r.removeEventListener("change",s)},[]),!!e}const Uu="sidebar_state",Gu=60*60*24*7,Vu="256px",Yu="256px",Ju="3rem",Ku="b",Ga=N.createContext(null);function he(){const e=N.useContext(Ga);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}const Va=N.forwardRef(({defaultOpen:e=!0,open:a,onOpenChange:r,className:s,style:u,children:o,...l},w)=>{const i=$u(),[c,f]=N.useState(!1),[p,h]=N.useState(e),m=a??p,g=N.useCallback(y=>{const C=typeof y=="function"?y(m):y;r?r(C):h(C),document.cookie=`${Uu}=${C}; path=/; max-age=${Gu}`},[r,m]),b=N.useCallback(()=>i?f(y=>!y):g(y=>!y),[i,g,f]);N.useEffect(()=>{const y=C=>{C.key===Ku&&(C.metaKey||C.ctrlKey)&&(C.preventDefault(),b())};return window.addEventListener("keydown",y),()=>window.removeEventListener("keydown",y)},[b]);const v=m?"expanded":"collapsed",S=N.useMemo(()=>({state:v,open:m,setOpen:g,isMobile:i,openMobile:c,setOpenMobile:f,toggleSidebar:b}),[v,m,g,i,c,f,b]);return t.jsx(Ga.Provider,{value:S,children:t.jsx(Xt,{delayDuration:0,children:t.jsx("div",{style:{"--sidebar-width":Vu,"--sidebar-width-icon":Ju,...u},className:n("wu-group/sidebar-wrapper wu-flex wu-min-h-[calc(100svh-48px)] wu-w-full",s),ref:w,...l,children:o})})})});Va.displayName="SidebarProvider";const Ya=N.forwardRef(({side:e="left",variant:a="sidebar",collapsible:r="offcanvas",className:s,children:u,...o},l)=>{const{isMobile:w,state:i,openMobile:c,setOpenMobile:f}=he();return r==="none"?t.jsx("div",{className:n("wu-flex wu-h-full wu-w-[--sidebar-width] wu-flex-col",s),ref:l,...o,children:u}):w?t.jsx(ha,{open:c,onOpenChange:f,...o,children:t.jsxs(bt,{"data-sidebar":"sidebar","data-mobile":"true",className:"wu-w-[--sidebar-width] wu-bg-blue-sidebar wu-p-0 [&>button]:wu-hidden",style:{"--sidebar-width":Yu},side:e,children:[t.jsxs(ma,{className:"sr-only",children:[t.jsx(ht,{children:"Sidebar"}),t.jsx(xa,{children:"Displays the mobile sidebar."})]}),t.jsx("div",{className:"wu-flex wu-flex-col wu-w-full wu-h-full",children:u})]})}):t.jsxs("div",{ref:l,className:"wu-hidden wu-group wu-peer md:wu-block","data-state":i,"data-collapsible":i==="collapsed"?r:"","data-variant":a,"data-side":e,children:[t.jsx("div",{className:n("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",a==="floating"||a==="inset"?"group-data-[collapsible=icon]:wu-w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4))]":"group-data-[collapsible=icon]:wu-w-[--sidebar-width-icon]")}),t.jsx("div",{className:n("wu-fixed wu-inset-y-0 wu-z-10 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)]",a==="floating"||a==="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",s),...o,children:t.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:u})})]})});Ya.displayName="Sidebar";const Ja=N.forwardRef(({className:e,onClick:a,children:r,...s},u)=>{const{toggleSidebar:o}=he();return t.jsxs(Ne,{ref:u,"data-sidebar":"trigger",variant:"secondary",className:n("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:l=>{a==null||a(l),o()},...s,children:[r,t.jsx("span",{className:"wu-sr-only",children:"Toggle Sidebar"})]})});Ja.displayName="SidebarTrigger";const Xu=N.forwardRef(({className:e,...a},r)=>{const{toggleSidebar:s}=he();return t.jsx("button",{ref:r,"data-sidebar":"rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:s,title:"Toggle Sidebar",className:n("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),...a})});Xu.displayName="SidebarRail";const Ka=N.forwardRef(({className:e,...a},r)=>t.jsx("main",{ref:r,className:n("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),...a}));Ka.displayName="SidebarInset";const Qu=N.forwardRef(({className:e,...a},r)=>t.jsx(ze,{ref:r,"data-sidebar":"input",className:n("wu-h-8 wu-w-full wu-shadow-none focus-visible:wu-ring-2",e),...a}));Qu.displayName="SidebarInput";const Xa=N.forwardRef(({className:e,...a},r)=>t.jsx("div",{ref:r,"data-sidebar":"header",className:n("wu-flex wu-flex-col wu-gap-2 wu-p-2",e),...a}));Xa.displayName="SidebarHeader";const Qa=N.forwardRef(({className:e,...a},r)=>t.jsx("div",{ref:r,"data-sidebar":"footer",className:n("wu-flex wu-flex-col wu-gap-2 wu-pb-2",e),...a}));Qa.displayName="SidebarFooter";const Zu=N.forwardRef(({className:e,...a},r)=>t.jsx($a,{ref:r,"data-sidebar":"separator",className:n("wu-mx-2 wu-w-auto",e),...a}));Zu.displayName="SidebarSeparator";const Za=N.forwardRef(({className:e,...a},r)=>t.jsx("div",{ref:r,"data-sidebar":"content",className:n("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),...a}));Za.displayName="SidebarContent";const Ra=N.forwardRef(({className:e,...a},r)=>t.jsx("div",{ref:r,"data-sidebar":"group",className:n("wu-relative wu-flex wu-w-full wu-min-w-0 wu-flex-col wu-p-2",e),...a}));Ra.displayName="SidebarGroup";const er=N.forwardRef(({className:e,asChild:a=!1,...r},s)=>{const u=a?ye.Slot:"div";return t.jsx(u,{ref:s,"data-sidebar":"group-label",className:n("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),...r})});er.displayName="SidebarGroupLabel";const Ru=N.forwardRef(({className:e,asChild:a=!1,...r},s)=>{const u=a?ye.Slot:"button";return t.jsx(u,{ref:s,"data-sidebar":"group-action",className:n("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),...r})});Ru.displayName="SidebarGroupAction";const tr=N.forwardRef(({className:e,...a},r)=>t.jsx("div",{ref:r,"data-sidebar":"group-content",className:n("wu-w-full wu-text-sm",e),...a}));tr.displayName="SidebarGroupContent";const Nt=N.forwardRef(({className:e,...a},r)=>t.jsx("ul",{ref:r,"data-sidebar":"menu",className:n("wu-flex wu-w-full wu-min-w-0 wu-flex-col wu-gap-1",e),...a}));Nt.displayName="SidebarMenu";const ar=N.forwardRef(({className:e,...a},r)=>t.jsx("li",{ref:r,"data-sidebar":"menu-item",className:n("wu-group/menu-item wu-relative",e),...a}));ar.displayName="SidebarMenuItem";const eo=X.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"}}),rr=N.forwardRef(({asChild:e=!1,isActive:a=!1,variant:r="default",size:s="default",tooltip:u,className:o,...l},w)=>{const i=e?ye.Slot:"button",{isMobile:c,state:f}=he(),p=t.jsx(i,{ref:w,"data-sidebar":"menu-button","data-size":s,"data-active":a,className:n(eo({variant:r,size:s}),o),...l});return u?(typeof u=="string"&&(u={children:u}),t.jsxs(Qt,{children:[t.jsx(Zt,{asChild:!0,children:p}),t.jsx(lt,{side:"right",align:"center",hidden:f!=="collapsed"||c,...u})]})):p});rr.displayName="SidebarMenuButton";const to=N.forwardRef(({className:e,asChild:a=!1,showOnHover:r=!1,...s},u)=>{const o=a?ye.Slot:"button";return t.jsx(o,{ref:u,"data-sidebar":"menu-action",className:n("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",r&&"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),...s})});to.displayName="SidebarMenuAction";const ao=N.forwardRef(({className:e,...a},r)=>t.jsx("div",{ref:r,"data-sidebar":"menu-badge",className:n("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),...a}));ao.displayName="SidebarMenuBadge";const ro=N.forwardRef(({className:e,showIcon:a=!1,...r},s)=>{const u=N.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return t.jsxs("div",{ref:s,"data-sidebar":"menu-skeleton",className:n("wu-flex wu-h-8 wu-items-center wu-gap-2 wu-rounded-md wu-px-2",e),...r,children:[a&&t.jsx(Ua,{className:"wu-rounded-md wu-size-4","data-sidebar":"menu-skeleton-icon"}),t.jsx(Ua,{className:"wu-h-4 wu-max-w-[--skeleton-width] wu-flex-1","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":u}})]})});ro.displayName="SidebarMenuSkeleton";const so=N.forwardRef(({className:e,...a},r)=>t.jsx("ul",{ref:r,"data-sidebar":"menu-sub",className:n("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),...a}));so.displayName="SidebarMenuSub";const uo=N.forwardRef(({...e},a)=>t.jsx("li",{ref:a,...e}));uo.displayName="SidebarMenuSubItem";const oo=N.forwardRef(({asChild:e=!1,size:a="md",isActive:r,className:s,...u},o)=>{const l=e?ye.Slot:"a";return t.jsx(l,{ref:o,"data-sidebar":"menu-sub-button","data-size":a,"data-active":r,className:n("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",a==="sm"&&"wu-text-xs",a==="md"&&"wu-text-sm","group-data-[collapsible=icon]:wu-hidden",s),...u})});oo.displayName="SidebarMenuSubButton";const lo=({children:e,Sidebar:a,className:r,defaultOpen:s=!0,open:u,onOpenChange:o,style:l})=>t.jsxs(Va,{defaultOpen:s,open:u,onOpenChange:o,children:[t.jsxs(Ya,{variant:"sidebar",collapsible:"icon",className:n("wu-top-12 wu-h-[calc(100%-48px)] wu-shadow-sidebar wu-border-none",r),style:l,role:"complementary",children:[t.jsx(Xa,{className:"wu-py-2",children:t.jsx(sr,{})}),a]}),t.jsx(Ka,{children:e})]}),sr=e=>{const{state:a,isMobile:r,openMobile:s}=he();return t.jsx(Ja,{...e,children:t.jsx(xt,{showMenu:r?s:a==="expanded"})})},no=({className:e,children:a,...r})=>{const s=d.useRef(null),u=d.useRef(null),o=({currentTarget:w})=>{const{scrollTop:i,clientHeight:c,scrollHeight:f}=w;s.current&&s.current.classList.toggle("wu-border-[#1b338014]",i!==0),u.current&&u.current.classList.toggle("wu-border-[#1b338014]",i+c!==f)},l="wu-w-[calc(100%-16px)] wu-mx-auto wu-border-transparent";return t.jsxs(Za,{...r,className:n("wu-overflow-hidden wu-gap-0",e),children:[t.jsx("hr",{className:l,ref:s}),t.jsx(ke,{onScroll:o,className:"wu-gap-2",thumbColor:"#b9c3dc",railColor:"#00000000","data-testid":"scroll-area",children:a}),t.jsx("hr",{className:l,ref:u})]})},wo=e=>t.jsx(Qa,{...e,children:e.children}),io=({label:e,children:a,...r})=>t.jsxs(Ra,{...r,className:"wu-p-0",children:[t.jsx("div",{className:"wu-h-8",children:t.jsx(er,{className:"wu-items-end wu-px-4 wu-text-xs wu-font-normal wu-leading-4 wu-text-blue-q",children:e})}),t.jsx(tr,{children:t.jsx(Nt,{children:a})})]}),co=e=>t.jsx(Nt,{...e}),fo=({Icon:e,children:a,className:r,isActive:s,...u})=>{const{state:o}=he(),[l,w]=d.useState(),i=a&&d.cloneElement(a,{children:t.jsxs("div",{className:"wu-flex wu-items-center wu-gap-2 wu-overflow-hidden wu-text-base wu-truncate wu-text-ellipsis",children:[e,t.jsx("span",{className:n("wu-text-sm wu-leading-4 wu-transition-opacity wu-duration-150",o==="collapsed"&&"wu-opacity-0"),children:a.props.children})]})}),c=d.useRef(null);return d.useEffect(()=>{var f;w(((f=c.current)==null?void 0:f.textContent)||"")},[]),t.jsx(ar,{...u,className:"wu-flex wu-items-center wu-gap-2 wu-px-2",children:t.jsx(rr,{className:n("wu-flex wu-items-center wu-text-blue-q hover:wu-bg-blue-sidebarHover wu-cursor-pointer wu-h-8 wu-rounded-sm",r,s&&"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:s,tooltip:l,asChild:!0,ref:c,children:i})})},po={wuStepper:"_wuStepper_apbnq_1"},ur=d.forwardRef((e,a)=>{const{onChange:r,defaultValue:s=0,min:u,max:o,step:l,readonly:w,resetInvalidValueOnBlur:i=!0,value:c,label:f,labelPosition:p="top",className:h,style:m,...g}=e,[b,v]=d.useState(c||s),S=T=>!!(e.disabled||e.readOnly||T==="inc"&&Number(b||0)>=Number(o)||T==="dec"&&Number(b||0)<=Number(u)),y=d.useCallback(T=>{T.preventDefault(),v(M=>Number(M||u||0)+Number(l||1))},[u,l]),C=d.useCallback(T=>{T.preventDefault(),v(M=>M?Number(M)-Number(l||1):0)},[u,l]),D=d.useCallback(T=>T>=Number(u)&&T<=Number(o),[u,o]),k=T=>{const M=T.currentTarget.value;v(M)},I=d.useCallback(()=>{if(i&&!D(Number(b))){const T=Number(u)||0;v(T)}},[u,i,D,b]);d.useEffect(()=>{r&&r(Number(b))},[b,c]),d.useEffect(()=>{c&&s&&console.warn("As both value and defaultValue are passed, value will be used")},[c,s]);const W=n("wu-px-10 wu-h-[33px] wu-text-center wu-text-blue-q wu-text-xs wu-rounded-t-sm","wu-stepper-input");return t.jsxs("div",{className:n(po.wuStepper,bo({labelPosition:p}),h,"wu-stepper"),style:m,dir:g.dir,children:[t.jsx(_e,{htmlFor:g.id,className:n(p!=="top"&&"wu-max-w-[160px]","wu-truncate wu-text-xs wu-font-normal wu-leading-6 wu-text-gray-lead wu-stepper-label"),dir:g.dir,children:f}),t.jsxs("div",{className:"wu-relative wu-flex wu-items-center wu-justify-start wu-w-fit wu-stepper-container",dir:g.dir,children:[t.jsx(K,{variant:"iconOnly",Icon:t.jsx("span",{className:"wu-text-base wm-add"}),className:n("wu-rounded-none wu-bg-gray-10 wu-absolute wu-top-0 wu-right-0 wu-w-8 wu-h-8 wu-text-blue-q wu-rounded-tr-sm wu-p-2",g.dir==="rtl"?"wu-right-auto wu-left-0":"","wu-stepper-button"),onClick:y,disabled:S("inc"),"aria-label":"increment"}),t.jsx(ze,{...g,ref:a,type:"number",className:W,onChange:k,min:u,max:o,step:l,readOnly:w,onBlur:I,value:b}),t.jsx(K,{variant:"iconOnly",Icon:t.jsx("span",{className:"wu-text-base wm-minimize"}),className:n("wu-rounded-none wu-bg-gray-10 wu-absolute wu-top-0 wu-left-0 wu-w-8 wu-h-8 wu-text-blue-q wu-rounded-tl-sm wu-p-2",g.dir==="rtl"?"wu-left-auto wu-right-0":"","wu-stepper-button"),onClick:C,disabled:S("dec"),"aria-label":"decrement"})]})]})}),bo=X.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"}}});ur.displayName="WuStepper";const or=X.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"}}),ho=N.forwardRef(({className:e,variant:a,size:r,...s},u)=>t.jsx(Bt.Root,{ref:u,className:n(or({variant:a,size:r,className:e})),...s}));ho.displayName=Bt.Root.displayName;const lr=N.createContext({size:"default",variant:"default"}),Ve=N.forwardRef(({className:e,variant:a,size:r,children:s,...u},o)=>t.jsx(Be.Root,{ref:o,className:n("wu-flex wu-items-center wu-justify-center wu-gap-1",e),...u,children:t.jsx(lr.Provider,{value:{variant:a,size:r},children:s})}));Ve.displayName=Be.Root.displayName;const ge=N.forwardRef(({className:e,children:a,variant:r,size:s,...u},o)=>{const l=N.useContext(lr);return t.jsx(Be.Item,{ref:o,className:n(or({variant:l.variant||r,size:l.size||s}),e),...u,children:a})});ge.displayName=Be.Item.displayName;const nr=d.forwardRef((e,a)=>{const{options:r,value:s,disabled:u,dir:o,onChange:l}=e,w=i=>n("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",u&&"wu-cursor-not-allowed data-[state=on]:wu-text-gray-lead",i===s&&"wu-text-white",u&&s===i&&"wu-text-gray-lead","wu-switcher-icon-tab-item");return t.jsx(t.Fragment,{children:t.jsxs(Ve,{ref:a,type:"single",value:s,onValueChange:l,disabled:u,dir:o,className:n("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",u&&"wu-cursor-not-allowed","wu-switcher-icon-tab-group"),children:[t.jsx("div",{role:"slider",className:n("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",s==="opt1"&&"",s==="opt2"&&o!=="rtl"&&"wu-translate-x-full",s==="opt2"&&o==="rtl"&&"-wu-translate-x-full",u&&"wu-bg-gray-40","wu-switcher-icon-tab-slider")}),t.jsx(ge,{value:"opt1",className:w("opt1"),children:r[0].label}),t.jsx(ge,{value:"opt2",className:w("opt2"),children:r[1].label})]})})});nr.displayName="_IconTab";const wr=d.forwardRef((e,a)=>{const{options:r,value:s,disabled:u,dir:o,size:l="md",onChange:w}=e,i=c=>n("wu-w-1/2 wu-text-xs wu-rounded-full wu-text-gray-lead wu-relative wu-z-10 wu-font-normal",u&&"wu-cursor-not-allowed data-[state=on]:wu-text-gray-lead",l==="sm"&&"wu-h-6 wu-min-w-20",l==="md"&&"wu-h-8 wu-min-w-28",l==="lg"&&"wu-h-10 wu-min-w-36",c===s&&"wu-text-white wu-font-medium",u&&s===c&&"wu-text-gray-lead","wu-switcher-tab-item");return t.jsx(t.Fragment,{children:t.jsxs(Ve,{ref:a,type:"single",value:s,onValueChange:w,disabled:u,dir:o,className:n("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",u&&"wu-cursor-not-allowed","wu-switcher-tab-group"),children:[t.jsx("div",{role:"slider",className:n("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 ",l==="sm"&&"wu-h-6 wu-min-w-20",l==="md"&&"wu-h-8 wu-min-w-28",l==="lg"&&"wu-h-10 wu-min-w-36",s==="opt1"&&"",s==="opt2"&&o!=="rtl"&&"wu-translate-x-full",s==="opt2"&&o==="rtl"&&"-wu-translate-x-full",u&&"wu-bg-gray-40","wu-switcher-tab-slider")}),t.jsx(ge,{value:"opt1",className:i("opt1"),children:t.jsx("div",{className:"wu-min-w-16 wu-max-w-[136px] wu-overflow-hidden wu-text-ellipsis wu-text-nowrap",children:r[0].label})}),t.jsx(ge,{value:"opt2",className:i("opt2"),children:t.jsx("div",{className:"wu-min-w-16 wu-max-w-[136px] wu-overflow-hidden wu-text-ellipsis wu-text-nowrap",children:r[1].label})})]})})});wr.displayName="_Tab";const ir=d.forwardRef((e,a)=>{const{options:r,value:s,disabled:u,dir:o,onChange:l}=e,w=p=>n("wu-p-0 wu-w-fit wu-text-xs wu-text-gray-lead wu-h-fit wu-font-normal",u&&"wu-cursor-not-allowed data-[state=on]:wu-text-gray-subtle wu-text-gray-subtle",p===s&&"wu-text-primary wu-font-medium",u&&s===p&&"wu-text-gray-lead","wu-switcher-toggle-item"),i=n("wu-w-fit wu-gap-2",u&&"wu-cursor-not-allowed","wu-switcher-toggle-group"),c=n("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",u&&"wu-border-gray-subtle wu-cursor-not-allowed","wu-switcher-toggle-button"),f=n("wu-w-2 wu-h-2 wu-bg-blue-p wu-rounded-full wu-transition-transform wu-duration-300 wu-ease-in-out",s==="opt1"&&o!=="rtl"&&"-wu-translate-x-[10px]",s==="opt1"&&o==="rtl"&&"wu-translate-x-[10px]",s==="opt2"&&o!=="rtl"&&"wu-translate-x-[10px]",s==="opt2"&&o==="rtl"&&"-wu-translate-x-[10px]",u&&"wu-hidden","wu-switcher-toggle-knob");return t.jsx(t.Fragment,{children:t.jsxs(Ve,{ref:a,type:"single",value:s,disabled:u,dir:o,className:i,onValueChange:l,children:[t.jsx(ge,{value:"opt1",className:w("opt1"),children:t.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:r[0].label})}),t.jsx("button",{onClick:()=>l(s==="opt1"?"opt2":"opt1"),className:c,disabled:u,"aria-label":"knob",dir:o,children:t.jsx("div",{className:f,role:"knob",dir:o})}),t.jsx(ge,{value:"opt2",className:w("opt2"),children:t.jsx("div",{className:"wu-max-w-[136px] wu-overflow-hidden wu-text-ellipsis wu-text-nowrap wu-switcher-toggle-item-label",children:r[1].label})})]})})});ir.displayName="_Toggle";const dr=d.forwardRef((e,a)=>{const{type:r,options:s,value:u,disabled:o,dir:l,size:w,onChange:i,toggle:c=!0,...f}=e,[p,h]=d.useState(),m=g=>{let b=p;g!==""?b=g:c&&(b=p==="opt1"?"opt2":"opt1");const v=b==="opt1"?s[0].value:s[1].value;i&&i(v),h(b)};if(d.useEffect(()=>{if(!Array.isArray(s)||s.length<2)throw new Error("Options are not sufficient");h(u===s[0].value?"opt1":"opt2")},[s,u]),!Array.isArray(s)||s.length<2)return t.jsx(t.Fragment,{});switch(r){case"toggle":return t.jsx(ir,{...f,ref:a,options:s,value:p||"opt1",onChange:m,disabled:o,dir:l});case"iconTab":return t.jsx(nr,{ref:a,options:s,value:p||"opt1",onChange:m,disabled:o,dir:l});default:return t.jsx(wr,{ref:a,options:s,value:p||"opt1",onChange:m,disabled:o,dir:l,size:w})}});dr.displayName="WuSwitcher";const cr=fe.Root,Ct=N.forwardRef(({className:e,children:a,...r},s)=>t.jsx(fe.List,{className:n("wu-relative wu-flex",e),...r,ref:s,children:a}));Ct.displayName=fe.List.displayName;const St=N.forwardRef(({className:e,...a},r)=>t.jsx(fe.Trigger,{ref:r,className:n("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),...a}));St.displayName=fe.Trigger.displayName;const fr=N.forwardRef(({className:e,...a},r)=>t.jsx(fe.Content,{ref:r,className:e,...a}));fr.displayName=fe.Content.displayName;const pr=({items:e,enableAnimation:a})=>{const r="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 t.jsx("div",{className:n("wu-w-full wu-h-full wu-flex-1 wu-overflow-auto",a&&"wu-relative wu-overflow-hidden"),children:e.map(s=>t.jsx(fr,{value:s.value,forceMount:a||void 0,className:n("wu-w-full wu-h-full wu-overflow-y-auto",a&&r,"wu-tab-content"),children:s.Content},s.value))})},go=e=>{const[a,r]=d.useState(!1),[s,u]=d.useState(!1),o=()=>{const w=e.current;w&&(r(w.scrollLeft>0),u(w.scrollLeft+w.clientWidth<w.scrollWidth))};return d.useEffect(()=>{const w=e.current;return o(),w&&w.addEventListener("scroll",o),window.addEventListener("resize",o),()=>{w&&w.removeEventListener("scroll",o),window.removeEventListener("resize",o)}},[e]),{showLeftArrow:a,showRightArrow:s,scrollByTab:w=>{const i=e.current;if(i){const c=(w==="right"?i.clientWidth:-i.clientWidth)*.8;i.scrollBy({left:c,behavior:"smooth"})}}}},br=(e,a)=>{const[r,s]=d.useState({width:0,left:0,height:0,top:0}),u=a==="vertical";return d.useEffect(()=>{const o=e.current;if(o){const l=()=>{const i=o.querySelector('[data-state="active"]');if(i){const c={width:u?2:i.offsetWidth,left:u?0:i.offsetLeft,height:u?i.offsetHeight:1,top:u?i.offsetTop:0};s(c)}},w=new MutationObserver(l);return w.observe(o,{attributes:!0,subtree:!0}),l(),()=>{w.disconnect()}}},[e,u]),r},mo=({items:e,value:a,defaultValue:r,onValueChange:s,enableAnimation:u=!1,className:o,dir:l="ltr",position:w="top"})=>{var C;const i=d.useRef(null),c=br(i,"horizontal"),{showLeftArrow:f,showRightArrow:p,scrollByTab:h}=go(i),[m,g]=d.useState(!1),b=()=>h("left"),v=()=>h("right"),S=D=>t.jsx("div",{"data-testid":`gradient-overlay-${D}`,className:n("wu-absolute wu-top-0 wu-h-full wu-w-20 wu-z-10 wu-pointer-events-none",D==="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=(D,k,I)=>{const W=k==="left";return t.jsx("button",{onClick:D,className:n("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",W?"wu-left-0":"wu-right-0",I&&"wu-translate-x-0 wu-opacity-100",!I&&[W?"-wu-translate-x-full":"wu-translate-x-full","wu-opacity-0"]),"aria-label":W?"scroll-left":"scroll-right",children:t.jsx("span",{className:n("wu-text-blue-p wu-text-lg",W?"wm-keyboard-arrow-left":"wm-keyboard-arrow-right")})})};return t.jsxs(cr,{defaultValue:r||((C=e[0])==null?void 0:C.value),value:a,onValueChange:s,orientation:"horizontal",dir:l,className:n("wu-relative wu-flex wu-flex-col wu-w-full wu-h-full",w==="bottom"?"wu-flex-col-reverse":"wu-flex-col",o),role:"tabs",children:[t.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:[f&&m&&S("left"),y(b,"left",f&&m),t.jsxs(Ct,{ref:i,className:n("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(D=>t.jsx(St,{value:D.value,children:D.Trigger},D.value)),t.jsx("span",{className:"wu-absolute wu-bg-blue-p wu-transition-all wu-duration-300 wu-indicator wu-bottom-0",style:{width:c.width,left:c.left,height:1.25,bottom:w==="bottom"?void 0:0,top:w==="bottom"?0:void 0}})]}),p&&m&&S("right"),y(v,"right",p&&m)]}),t.jsx(pr,{items:e,enableAnimation:u})]})},xo=e=>{const[a,r]=d.useState(!1),[s,u]=d.useState(!1),o=()=>{const w=e.current;w&&(r(w.scrollTop>0),u(w.scrollTop+w.clientHeight<w.scrollHeight))};return d.useEffect(()=>{const w=e.current;if(w)return o(),w.addEventListener("scroll",o),window.addEventListener("resize",o),()=>{w.removeEventListener("scroll",o),window.removeEventListener("resize",o)}},[e]),{showTopArrow:a,showBottomArrow:s,scrollByTab:w=>{const i=e.current;if(i){const c=(w==="down"?i.clientHeight:-i.clientHeight)*.8;i.scrollBy({top:c,behavior:"smooth"})}}}},yo=({items:e,value:a,defaultValue:r,onValueChange:s,enableAnimation:u=!1,className:o,dir:l="ltr",position:w="left"})=>{var C;const i=d.useRef(null),c=br(i,"vertical"),{showTopArrow:f,showBottomArrow:p,scrollByTab:h}=xo(i),[m,g]=d.useState(!1),b=()=>h("up"),v=()=>h("down"),S=D=>t.jsx("div",{className:n("wu-absolute wu-left-0 wu-w-full wu-h-12 wu-z-10 wu-pointer-events-none",D==="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=(D,k,I)=>{const W=k==="up";return t.jsx("button",{onClick:D,className:n("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",W?"-wu-top-1":"-wu-bottom-1",I&&"wu-translate-y-0 wu-opacity-100",!I&&[W?"-wu-translate-y-full":"wu-translate-y-full","wu-opacity-0"]),"aria-label":W?"scroll-up":"scroll-down",children:t.jsx("span",{className:n("wu-text-blue-p wu-text-lg",W?"wm-keyboard-arrow-up":"wm-keyboard-arrow-down")})})};return t.jsxs(cr,{defaultValue:r||((C=e[0])==null?void 0:C.value),value:a,onValueChange:s,orientation:"vertical",dir:l,className:n("wu-relative wu-h-full wu-w-full wu-flex",w==="left"?"wu-flex-row":"wu-flex-row-reverse",o),role:"tabs",children:[t.jsxs("div",{className:"wu-relative wu-flex wu-overflow-hidden wu-shrink-0",onMouseEnter:()=>g(!0),onMouseLeave:()=>g(!1),"aria-label":"tablistWrapper",children:[f&&m&&S("top"),y(b,"up",f&&m),t.jsxs(Ct,{ref:i,className:n("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(D=>t.jsx(St,{value:D.value,children:D.Trigger},D.value)),t.jsx("span",{className:"wu-absolute wu-bg-blue-p wu-transition-all wu-duration-300 wu-indicator",style:{width:2,left:w==="left"?0:void 0,right:w==="right"?0:void 0,height:c.height,top:c.top}})]}),p&&m&&S("bottom"),y(v,"down",p&&m)]}),t.jsx(pr,{items:e,enableAnimation:u})]})},vo=({...e})=>e.orientation==="vertical"?t.jsx(yo,{...e}):t.jsx(mo,{...e}),kt=N.forwardRef(({className:e,...a},r)=>t.jsx("table",{ref:r,className:n("wu-w-full wu-caption-bottom wu-text-sm",e),...a}));kt.displayName="Table";const hr=N.forwardRef(({className:e,...a},r)=>t.jsx("thead",{ref:r,className:n("[&_tr]:wu-border-b",e),...a}));hr.displayName="TableHeader";const gr=N.forwardRef(({className:e,...a},r)=>t.jsx("tbody",{ref:r,className:n("",e),...a}));gr.displayName="TableBody";const No=N.forwardRef(({className:e,...a},r)=>t.jsx("tfoot",{ref:r,className:n("wu-border-t wu-bg-muted/50 wu-font-medium [&>tr]:last:wu-border-b-0",e),...a}));No.displayName="TableFooter";const Le=N.forwardRef(({className:e,...a},r)=>t.jsx("tr",{ref:r,className:n("wu-border-b wu-transition-colors wu-hover:wu-bg-muted/50 data-[state=selected]:wu-bg-muted",e),...a}));Le.displayName="TableRow";const Tt=N.forwardRef(({className:e,...a},r)=>t.jsx("th",{ref:r,className:n("wu-h-10 wu-px-4 wu-text-left wu-align-middle wu-font-medium wu-text-muted-foreground [&:has([role=checkbox])]:wu-pr-0",e),...a}));Tt.displayName="TableHead";const Ye=N.forwardRef(({className:e,...a},r)=>t.jsx("td",{ref:r,className:n("wu-p-4 wu-align-middle [&:has([role=checkbox])]:wu-pr-0",e),...a}));Ye.displayName="TableCell";const Dt=N.forwardRef(({className:e,...a},r)=>t.jsx("caption",{ref:r,className:n("wu-mt-4 wu-text-sm wu-text-gray-subtle wu-font-normal",e),...a}));Dt.displayName="TableCaption";const mr=({columns:e,rowSelection:a})=>{const r=(a==null?void 0:a.isEnabled)??!1,{onRowSelect:s,rowUniqueKey:u}=a||{},o=d.useCallback(w=>i=>{s(()=>i?w:[])},[s]);return{finalColumns:d.useMemo(()=>r?[{id:"select",header:({table:w})=>{const i=w.getRowModel().rows.map(f=>f.original),c=o(i);return t.jsx(te,{checked:w.getIsSomeRowsSelected()||w.getIsAllRowsSelected(),partial:w.getIsSomeRowsSelected()&&!w.getIsAllRowsSelected(),onChange:f=>{w.toggleAllRowsSelected(!!f),c(!!f)},"aria-label":"Select all","data-testid":w.getIsSomeRowsSelected()&&!w.getIsAllRowsSelected()?"select-partial":"select-all"})},cell:({row:w})=>t.jsx(te,{checked:w.getIsSelected(),onChange:i=>{w.toggleSelected(!!i)},"aria-label":String(w.original[u])}),enableSorting:!1,filterable:!1,accessorKey:"select"},...e]:e,[e,r,o])}},xr=({table:e,size:a,NoDataContent:r,isLoading:s,CustomLoader:u})=>{var w;const[o,l]=d.useState(null);return t.jsx(gr,{children:s?t.jsx(Le,{children:t.jsx(Ye,{colSpan:e.getAllColumns().length,className:"wu-text-center wu-h-[35vh] wu-loader-container",children:u||t.jsx(Ce,{className:"wu-w-full"})})}):(w=e.getRowModel().rows)!=null&&w.length?e.getRowModel().rows.map((i,c)=>t.jsx(Le,{"data-state":i.getIsSelected()&&"selected",onMouseOver:()=>l(i.id),onMouseOut:()=>l(null),className:n("wu-transition-colors wu-border-b wu-border-black/[12%]",i.getIsSelected()?o===i.id?"wu-bg-blue-p/[16%]":"wu-bg-blue-p/[8%]":"hover:wu-bg-black/[2%]"),children:i.getVisibleCells().map((f,p)=>t.jsx(Ye,{className:n("wu-py-0 wu-font-light wu-text-gray-lead wu-text-xs",a==="compact"?"wu-h-8":"wu-h-10",f.column.id==="actions"?"wu-opacity-0 wu-transition-opacity wu-duration-100":"",o===i.id&&f.column.id==="actions"?"wu-opacity-100 wu-visible":""),children:R.flexRender(f.column.columnDef.cell,f.getContext())},`${f.id}-${p}`))},`${i.id}-${c}`)):t.jsx(Le,{children:t.jsx(Ye,{colSpan:e.getAllColumns().length,children:r})})})},yr=({table:e,sortableColumns:a,manual:r=!1,onSort:s,size:u,isRowSelected:o,HeaderAction:l,isStickyHeader:w})=>{const i=c=>{const{id:f,columnDef:p,getIsSorted:h,toggleSorting:m}=c,{header:g}=p;if(!a.includes(f))return g;const b=h(),v=b==="asc",S=b==="desc",y=()=>{r?(m(!S),s==null||s({id:f,desc:S})):m(c.getIsSorted()==="asc")};return t.jsxs("button",{onClick:y,"aria-label":`Sort by ${g}`,className:"wu-flex wu-items-center wu-gap-4",children:[g,t.jsxs("div",{className:"wu-relative",children:[t.jsx("span",{className:n("wu-absolute -wu-top-[15px] wm-arrow-drop-down wu-text-xl",v&&"wu-hidden",!b&&"-wu-top-[11px]")}),t.jsx("span",{className:n("wu-absolute -wu-bottom-[13px] wm-arrow-drop-up wu-text-xl",S&&"wu-hidden",!b&&"-wu-bottom-[10px]")})]})]})};return t.jsxs(t.Fragment,{children:[t.jsx(hr,{className:n("wu-border-t wu-border-black/[12%] wu-bg-gray-20 wu-relative",w&&"wu-sticky wu-top-[-.5px] wu-z-10",u==="compact"?"wu-h-8":"wu-h-10"),children:e.getHeaderGroups().map(c=>t.jsx(Le,{className:"wu-relative",children:c.headers.map(f=>f.column.id==="actions"?t.jsx(Tt,{colSpan:f.colSpan,className:n("wu-text-gray-lead wu-text-xs wu-font-medium"),style:{width:`${f.getSize()}px`}},f.id):t.jsx(Tt,{colSpan:f.colSpan,className:n("wu-text-gray-lead wu-text-xs wu-font-medium wu-bg-[#EEEEEE]","wu-relative wu-z-0"),style:{width:`${f.getSize()}px`},children:R.flexRender(i(f.column),f.getContext())},f.id))},c.id))}),o&&l&&t.jsx("div",{className:n("wu-absolute wu-left-10 wu-top-0 wu-flex wu-items-center wu-px-4 wu-border-t",u==="compact"?"wu-h-8":"wu-h-10","wu-bg-gray-20 wu-text-gray-lead wu-text-xs wu-font-medium wu-z-10","wu-w-[calc(100%-40px)]","wu-transition-all wu-duration-300 wu-ease-in-out",w&&"wu-sticky wu-top-[-.1px] wu-z-10"),children:l})]})},Co=({data:e,columns:a,isLoading:r=!1,variant:s="unstyled",sort:u,size:o,rowSelection:l,HeaderAction:w,NoDataContent:i,stickyHeader:c=!1,CustomLoader:f,caption:p,...h})=>{var y;const m=((y=l==null?void 0:l.selectedRows)==null?void 0:y.length)??0,{finalColumns:g}=mr({columns:a,rowSelection:l}),b=d.useMemo(()=>a.filter(C=>C.enableSorting).map(C=>C.accessorKey),[g]),v=d.useMemo(()=>{if(!(l!=null&&l.isEnabled))return{};const C={};for(const D of l.selectedRows){const k=e.findIndex(I=>I[l.rowUniqueKey]===D[l.rowUniqueKey]);k!==-1&&(C[k]=!0)}return C},[l==null?void 0:l.selectedRows,e,l==null?void 0:l.rowUniqueKey,l==null?void 0:l.isEnabled]),S=R.useReactTable({data:e,columns:g,getCoreRowModel:R.getCoreRowModel(),getPaginationRowModel:R.getPaginationRowModel(),manualPagination:!0,manualSorting:!0,manualFiltering:!0,enableRowSelection:l==null?void 0:l.isEnabled,state:{...l!=null&&l.isEnabled?{rowSelection:v}:{}},onRowSelectionChange:C=>{if(typeof C=="function"){const D=C(v),k=Object.keys(D).filter(I=>D[I]).map(I=>e[Number(I)]);l==null||l.onRowSelect(k)}}});return t.jsxs("div",{className:n("wu-table-container wu-relative"),children:[p&&t.jsx(Dt,{className:"wu-font-light",children:p}),t.jsxs(kt,{...h,className:n(So({variant:s}),h.className),children:[t.jsx(yr,{table:S,sortableColumns:b,manual:!0,onSort:u==null?void 0:u.onSort,size:o,HeaderAction:w,isRowSelected:m>0,isStickyHeader:c}),!r&&t.jsx(xr,{table:S,size:o,NoDataContent:i,CustomLoader:f})]}),r&&t.jsx("div",{className:"wu-flex wu-items-center wu-justify-center wu-h-96",children:t.jsx(Ce,{})})]})},So=X.cva("",{variants:{variant:{striped:"[&_tr:nth-child(even)]:wu-bg-zinc-50",unstyled:"",bordered:"wu-border-collapse wu-border [&_th]:wu-border [&_td]:wu-border"}}}),vr=({data:e,columns:a,caption:r,variant:s="unstyled",sort:u,filterText:o,size:l="default",pagination:w,rowSelection:i,HeaderAction:c,NoDataContent:f,CustomLoader:p,isLoading:h,stickyHeader:m,...g})=>{var $;const[b,v]=d.useState((u==null?void 0:u.initial)||[]),[S,y]=d.useState([]),C=(($=i==null?void 0:i.selectedRows)==null?void 0:$.length)??0,[D,k]=d.useState((w==null?void 0:w.pageIndex)??0),{finalColumns:I}=mr({columns:a,rowSelection:i}),W=d.useMemo(()=>I.filter(_=>_.enableSorting).map(_=>_.accessorKey),[I]),T=d.useMemo(()=>I.filter(_=>_.filterable).map(_=>_.accessorKey),[I]),M=d.useMemo(()=>{if(!(i!=null&&i.isEnabled))return{};const _={};for(const P of i.selectedRows){const V=e.findIndex(H=>H[i.rowUniqueKey]===P[i.rowUniqueKey]);V!==-1&&(_[V]=!0)}return _},[i==null?void 0:i.selectedRows,e,i==null?void 0:i.rowUniqueKey,i==null?void 0:i.isEnabled]),q=R.useReactTable({data:e,columns:I,getCoreRowModel:R.getCoreRowModel(),enableRowSelection:i==null?void 0:i.isEnabled,getPaginationRowModel:R.getPaginationRowModel(),getSortedRowModel:R.getSortedRowModel(),getFilteredRowModel:R.getFilteredRowModel(),initialState:{pagination:{pageSize:(w==null?void 0:w.pageSize)??100,pageIndex:(w==null?void 0:w.pageIndex)??0}},state:{sorting:b,columnFilters:S,...w?{pagination:w}:{},...i!=null&&i.isEnabled?{rowSelection:M}:{}},onSortingChange:v,onColumnFiltersChange:y,onRowSelectionChange:_=>{const P=typeof _=="function"?_(M):_,V=Object.keys(P).filter(H=>P[H]).map(H=>e[Number(H)]);i==null||i.onRowSelect(V)}});return d.useEffect(()=>{T.forEach(_=>{var P;(P=q.getColumn(_))==null||P.setFilterValue(o)})},[o,T,q]),d.useEffect(()=>{w&&(w==null?void 0:w.pageIndex)!==D&&(i==null||i.onRowSelect(()=>[]),q.resetRowSelection(),k(w.pageIndex))},[w==null?void 0:w.pageIndex]),t.jsx("div",{className:"wu-table-container wu-relative",children:t.jsxs(kt,{...g,className:n(ko({variant:s}),"wu-table-fixed",g.className),children:[r&&t.jsx(Dt,{className:"wu-font-light",children:r}),t.jsx(yr,{table:q,sortableColumns:W,size:l,HeaderAction:c,isRowSelected:C>0,isStickyHeader:m}),t.jsx(xr,{table:q,size:l,NoDataContent:f,CustomLoader:p,isLoading:h})]})})},ko=X.cva("",{variants:{variant:{striped:"[&_tr:nth-child(even)]:wu-bg-zinc-50",unstyled:"",bordered:"wu-border-collapse wu-border [&_th]:wu-border [&_td]:wu-border"}}});vr.displayName="WuTable";const Nr=N.forwardRef(({className:e,...a},r)=>t.jsx("textarea",{className:n("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:r,...a}));Nr.displayName="Textarea";const Cr=d.forwardRef((e,a)=>{const{Label:r,id:s=Fe(),variant:u="flat",readonly:o,maxLength:l,labelPosition:w="top",...i}=e,c=p=>{i.onChange&&i.onChange(p)},f=Ee(w);return t.jsxs("div",{className:n(f,"wu-flex wu-textarea-container"),dir:i.dir,children:[t.jsx(Nr,{...i,ref:a,id:s,className:n("wu-peer wu-rounded-t-sm",u==="outlined"?"wu-border wu-border-gray-subtle":"",i.className),onChange:c,readOnly:o,maxLength:l}),r&&t.jsx(Q,{htmlFor:s,className:"wu-textarea-label",children:r})]})});Cr.displayName="WuTextarea";function To(e){if(typeof e=="string"&&e.includes("T")){const a=A.parseISO(e);return A.format(a,"HH:mm")}if(typeof e=="string"&&/^\d{2}:\d{2}:\d{2}$/.test(e)){const a=A.parse(e,"HH:mm:ss",new Date);return A.format(a,"HH:mm")}return typeof e=="string"&&/^\d{2}:\d{2}$/.test(e)?e:"00:00"}const Sr=["12",...Array.from({length:11},(e,a)=>String(a+1).padStart(2,"0"))],kr=Array.from({length:60},(e,a)=>String(a).padStart(2,"0")),Tr=["am","pm"],Je=50;function Do(e){return Array(Je).fill(e).flat()}function Mt(e,a){const r=e.indexOf(a);return[...e.slice(r),...e.slice(0,r)]}function Mo(e,a){let r=Number(e);return a==="pm"&&r<12&&(r+=12),a==="am"&&r===12&&(r=0),String(r).padStart(2,"0")}function Dr(e){const a=Number(e),r=a>=12?"pm":"am",s=a%12===0?12:a%12;return{hour:String(s),meridiem:r}}const Io=({value:e,isSelected:a,onClick:r})=>t.jsx("div",{onClick:r,className:n("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",a&&"wu-bg-blue-p/15 wu-text-blue-p"),children:e}),It=({values:e,selectedValue:a,scrollRef:r,onSelect:s,repeatItems:u=!0,className:o})=>t.jsx("div",{ref:r,className:n("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:(u?Do(e):e).map((l,w)=>t.jsx(Io,{value:l,isSelected:l===a,onClick:()=>s(l)},`${l}-${w}`))});function Wo(e,a,r,s){const u=d.useMemo(()=>e?Mt(Sr,a.padStart(2,"0")):Sr,[e]),o=d.useMemo(()=>e?Mt(kr,r.padStart(2,"0")):kr,[e]),l=d.useMemo(()=>e?Mt(Tr,s):Tr,[e]);return{rotatedHours:u,rotatedMinutes:o,rotatedMeridiem:l}}function Eo(e,a,r){d.useEffect(()=>{function s(l){if(l){const w=l.scrollHeight/Je,i=Math.floor(Je/2);l.scrollTop=i*w;const c=()=>{const{scrollTop:f}=l,p=Math.round(f/w);(p<=1||p>=Je-2)&&(l.scrollTop=i*w)};return l.addEventListener("scroll",c),()=>{l.removeEventListener("scroll",c)}}}if(!e)return;const u=s(a.current),o=s(r.current);return()=>{u==null||u(),o==null||o()}},[e,a,r])}const Mr=({className:e,time:a,Label:r,labelPosition:s,dir:u,...o})=>{const[l,w]=d.useState(!1),[i,c]=d.useState(""),f=d.useRef(null),p=d.useRef(null),h=d.useRef(null),m=d.useRef(null),[g,b]=d.useState("12"),[v,S]=d.useState("00"),[y,C]=d.useState("am");d.useEffect(()=>{if(!a){c(""),b("12"),S("00"),C("am"),f.current&&(f.current.value="");return}const T=To(a);c(T);const[M,q]=T.split(":"),{hour:$,meridiem:_}=Dr(M);b($),S(q),C(_),f.current&&(f.current.value=T)},[a]),d.useEffect(()=>{const T=M=>{p.current&&!p.current.contains(M.target)&&w(!1)};return document.addEventListener("mousedown",T),()=>{document.removeEventListener("mousedown",T)}},[]),Eo(l,h,m);const{rotatedHours:D,rotatedMinutes:k,rotatedMeridiem:I}=Wo(l,g,v,y),W=d.useCallback((T,M,q)=>{const $=T??g,_=M??v,P=q??y;b($),S(_),C(P);const V=`${Mo($,P)}:${_}`;c(V)},[g,v,y]);return t.jsxs("div",{className:n("wu-flex wu-gap-1 wu-relative wu-w-fit wu-flex-col",(s==="right"||s==="left")&&"wu-items-center",s==="left"&&"wu-flex-row",s==="right"&&"wu-flex-row-reverse","wu-input-wrapper"),dir:u,children:[r&&t.jsx(Q,{htmlFor:"time-picker",className:"wu-timepicker-label",children:r}),t.jsxs("div",{className:n("relative inline-block"),ref:p,dir:u,children:[t.jsx(pe,{ref:f,type:"time",value:i,variant:"flat",role:"textbox",onChange:T=>{c(T.target.value);const[M,q]=T.target.value.split(":"),{hour:$,meridiem:_}=Dr(M);b($),S(q),C(_)},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:t.jsx(le,{icon:"wm-schedule",className:"wu-text-base",onClick:()=>w(T=>!T),"data-testid":"wu-timepicker-icon"}),iconPosition:"right",dir:u,...o}),t.jsx("style",{children:`
1
+ (function(x,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("react/jsx-runtime"),require("@radix-ui/react-accordion"),require("react"),require("clsx"),require("tailwind-merge"),require("@radix-ui/react-avatar"),require("@radix-ui/react-slot"),require("class-variance-authority"),require("@radix-ui/react-label"),require("@radix-ui/react-tooltip"),require("date-fns"),require("@radix-ui/react-popover"),require("react-day-picker"),require("@radix-ui/react-checkbox"),require("cmdk"),require("react-virtuoso"),require("@radix-ui/react-dropdown-menu"),require("@radix-ui/react-dialog"),require("@radix-ui/react-scroll-area"),require("@radix-ui/react-radio-group"),require("@radix-ui/react-separator"),require("@radix-ui/react-toggle-group"),require("@radix-ui/react-toggle"),require("@radix-ui/react-tabs"),require("@tanstack/react-table"),require("@radix-ui/react-toast"),require("@radix-ui/react-switch")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","@radix-ui/react-accordion","react","clsx","tailwind-merge","@radix-ui/react-avatar","@radix-ui/react-slot","class-variance-authority","@radix-ui/react-label","@radix-ui/react-tooltip","date-fns","@radix-ui/react-popover","react-day-picker","@radix-ui/react-checkbox","cmdk","react-virtuoso","@radix-ui/react-dropdown-menu","@radix-ui/react-dialog","@radix-ui/react-scroll-area","@radix-ui/react-radio-group","@radix-ui/react-separator","@radix-ui/react-toggle-group","@radix-ui/react-toggle","@radix-ui/react-tabs","@tanstack/react-table","@radix-ui/react-toast","@radix-ui/react-switch"],t):(x=typeof globalThis<"u"?globalThis:x||self,t(x["wick-ui-lib"]={},x["react/jsx-runtime"],x.RadixUIAccordion,x.React,x.clsx,x.tailwindMerge,x.RadixUIAvatar,x.RadixUISlot,x.ClassVarianceAuthority,x.RadixUILabel,x.RadixUITooltip,x.dateFns,x.RadixUIPopover,x.ReactDayPicker,x.RadixUICheckbox,x.cmdk,x.ReactVirtuoso,x.RadixUIDropdownMenu,x.RadixUIDialog,x.RadixUIScrollArea,x.RadixUIRadioGroup,x.RadixUISeparator,x.RadixUIToggleGroup,x.RadixUIToggle,x.RadixUITabs,x.TanstackReactTable,x.RadixUIToast,x.RadixUISwitch))})(this,function(x,t,Br,d,zr,Hr,jr,ye,X,$r,Qe,A,De,Ot,Ur,G,Gr,Vr,Yr,Jr,Kr,Xr,Qr,Zr,Rr,R,es,ts){"use strict";function j(e){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const s=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(a,r,s.get?s:{enumerable:!0,get:()=>e[r]})}}return a.default=e,Object.freeze(a)}const de=j(Br),N=j(d),ve=j(jr),Lt=j($r),Me=j(Qe),Ie=j(De),Ze=j(Ur),L=j(Vr),O=j(Yr),ce=j(Jr),We=j(Kr),Pt=j(Xr),Fe=j(Qr),Ft=j(Zr),fe=j(Rr),K=j(es),Re=j(ts),as={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"}},rs=Hr.extendTailwindMerge({prefix:"wu-"});function n(...e){return rs(zr.clsx(e))}const et=e=>{window.open(e,"_blank","toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=800,height=600")};function Be(){return Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15)}function Ee(e){switch(e){case"top":return"wu-flex-col-reverse";case"left":return"wu-flex-row-reverse wu-gap-2";case"right":return"wu-flex-row wu-gap-2";default:return""}}const ss=e=>e?/\S+@questionpro\.com/.test(e):!1,Bt=de.Root,tt=N.forwardRef(({className:e,...a},r)=>t.jsx(de.Item,{ref:r,className:n("wu-border-b",e),...a}));tt.displayName="AccordionItem";const at=N.forwardRef(({className:e,children:a,...r},s)=>t.jsx(de.Header,{className:"wu-flex",children:t.jsxs(de.Trigger,{ref:s,className:n("wu-flex wu-flex-1 wu-text-xs wu-items-center wu-justify-between wu-p-2 wu-transition-all","[&[data-state=open]>.wu-arrow-icon]:wu-rotate-180",e),...r,children:[a,t.jsx("span",{className:"wu-arrow-icon wm-keyboard-arrow-down wu-transition-transform wu-duration-200"})]})}));at.displayName=de.Trigger.displayName;const rt=N.forwardRef(({className:e,children:a,...r},s)=>t.jsx(de.Content,{ref:s,className:"wu-overflow-hidden wu-text-xs wu-px-2 wu-font-light wu-transition-all data-[state=closed]:wu-animate-accordion-up data-[state=open]:wu-animate-accordion-down",...r,children:t.jsx("div",{className:n("wu-pb-4 wu-pt-0",e),children:a})}));rt.displayName=de.Content.displayName;const us=e=>{const{items:a,className:r,dir:s="ltr"}=e;if(e.type==="multiple"){const{defaultValue:u=[],value:o,onValueChange:l}=e;return t.jsx(Bt,{type:"multiple",className:"wu-w-full wu-accordion-container",defaultValue:u,value:o,onValueChange:l,dir:s,children:a.map(({value:w,Summary:i,Details:c,className:f})=>t.jsxs(tt,{value:w,dir:s,className:n(r,f),children:[t.jsx(at,{dir:s,className:"wu-accordion-summary",children:i}),t.jsx(rt,{dir:s,className:"wu-accordion-details",children:c})]},w))})}else{const{defaultValue:u,value:o,onValueChange:l}=e;return t.jsx(Bt,{type:"single",className:"wu-w-full wu-accordion-container",defaultValue:u,value:o,onValueChange:l,dir:s,collapsible:!0,children:a.map(({value:w,Summary:i,Details:c,className:f})=>t.jsxs(tt,{value:w,dir:s,className:n(r,f),children:[t.jsx(at,{dir:s,className:"wu-accordion-summary",children:i}),t.jsx(rt,{dir:s,className:"wu-accordion-details",children:c})]},w))})}},zt=N.forwardRef(({className:e,...a},r)=>t.jsx(ve.Root,{ref:r,className:n("wu-relative wu-flex wu-h-10 wu-w-10 wu-shrink-0 wu-overflow-hidden wu-rounded-full",e),...a}));zt.displayName=ve.Root.displayName;const Ht=N.forwardRef(({className:e,...a},r)=>t.jsx(ve.Image,{ref:r,className:n("wu-aspect-square wu-h-full wu-w-full",e),...a}));Ht.displayName=ve.Image.displayName;const jt=N.forwardRef(({className:e,...a},r)=>t.jsx(ve.Fallback,{ref:r,className:n("wu-flex wu-h-full wu-w-full wu-items-center wu-justify-center wu-rounded-full wu-bg-muted",e),...a}));jt.displayName=ve.Fallback.displayName;function st(e,a){d.useEffect(()=>{const r=s=>{Array.isArray(e)&&e.some(u=>!u.current||u.current.contains(s.target))||!Array.isArray(e)&&(!e.current||e.current.contains(s.target))||a(s)};return document.addEventListener("mousedown",r),document.addEventListener("touchstart",r),()=>{document.removeEventListener("mousedown",r),document.removeEventListener("touchstart",r)}},[e,a])}const ut={dropdownContainer:"_dropdownContainer_vvlo9_1",open:"_open_vvlo9_1",dropdownMenu:"_dropdownMenu_vvlo9_1"},$t=({dir:e,Trigger:a,triggerClassName:r,DropdownContent:s})=>{const[u,o]=d.useState(!1),l=d.useRef(null),w=d.useRef(null);st([l,w],()=>o(!1));const i=()=>{o(!u)};return t.jsx(t.Fragment,{children:t.jsx("div",{className:ut.dropdownContainer,children:t.jsx("ul",{children:t.jsxs("li",{className:n("wu-flex wu-relative",u&&ut.open),children:[t.jsx("button",{className:n("wu-w-8 wu-h-8 wu-rounded-full focus:wu-outline-none focus-visible:wu-ring-2 focus-visible:wu-ring-blue-soft focus-visible:wu-ring-offset-2 focus-visible:wu-ring-offset-gray-switcher",r),onClick:c=>{c.preventDefault(),i()},ref:w,"aria-label":"dropdown-trigger",children:a}),t.jsx("div",{className:n(ut.dropdownMenu,{open:u},e==="rtl"?"wu-left-[-10px] wu-top-[38px]":"wu-right-[-7px] wu-top-[38px]"),dir:e,ref:l,"aria-label":"user-menu",children:s})]})})})})},ot=X.cva("wu-inline-flex wu-items-center wu-justify-center wu-whitespace-nowrap wu-rounded-sm wu-text-sm wu-font-normal wu-outline-offset-2 wu-transition-colors focus-visible:wu-outline-none focus-visible:wu-outline-2 focus-visible:wu-outline-blue-focus focus-visible:wu-outline-offset-2 disabled:wu-cursor-not-allowed wu-leading-4 disabled:wu-bg-black/10 disabled:wu-text-gray-subtle disabled:wu-outline-gray-subtle wu-leading-[1px] wu-transition-colors wu-duration-300",{variants:{size:{md:"wu-p-2 wu-min-w-[104px] wu-h-8 wu-text-sm",sm:"wu-p-1 wu-min-w-[90px] wu-h-6 wu-text-xs",mobile:"wu-p-4 wu-min-w-[104px] wu-h-10 wu-text-base"},color:{primary:"wu-bg-blue-p hover:wu-bg-blue-pHoverDeep wu-text-blue-p wu-outline-1 wu-outline-blue-p hover:wu-text-blue-q hover:wu-outline-blue-pHover",upgrade:"wu-bg-orange-soft hover:wu-bg-orange-deep wu-text-orange-deep hover:wu-text-orange-deep wu-outline-1 wu-outline-orange-soft hover:wu-outline-orange-deep hover:wu-text-maroon-hover",error:"wu-bg-maroon hover:wu-bg-maroon-hover wu-outline-1 wu-outline-red-deep hover:wu-outline-red-deep/80 hover:wu-text-maroon-hover"},variant:{primary:"wu-text-white wu-outline-0 hover:wu-text-white",secondary:"wu-bg-transparent wu-outline-0 hover:wu-bg-gray-20 hover:wu-text-blue-pHoverDeep",outline:"hover:wu-text-white wu-bg-white disabled:wu-bg-transparent hover:wu-outline-blue-pHoverDeep",rounded:"wu-text-white wu-outline-0 wu-rounded-full hover:wu-text-white",link:"hover:wu-underline wu-bg-transparent hover:wu-bg-transparent wu-outline-0 wu-underline-offset-2 wu-min-w-[auto] wu-px-2 disabled:wu-bg-transparent",iconOnly:"wu-rounded wu-p-2 wu-text-xl wu-h-8 wu-w-8 wu-leading-5 wu-text-gray-lead hover:wu-text-blue-q hover:wu-bg-gray-20 wu-outline-0 wu-bg-transparent wu-min-w-[auto] disabled:wu-grayscale disabled:wu-opacity-80 wu-rounded-sm focus-visible:wu-outline-offset-0 focus-visible:wu-bg-gray-20 wu-aspect-square"}},defaultVariants:{variant:"primary",size:"md",color:"primary"},compoundVariants:[]}),Ne=N.forwardRef(({className:e,variant:a,size:r,color:s,asChild:u=!1,...o},l)=>{const w=u?ye.Slot:"button";return t.jsx(w,{className:n(ot({size:r,color:s,variant:a,className:e})),ref:l,...o})});Ne.displayName="Button";const Ce=d.forwardRef((e,a)=>os(e,a)),os=(e,a)=>{const{size:r="md",color:s="#1B87E6",variant:u="dots",...o}=e,l=n("wu-w-[4em] wu-h-[1em] wu-inline-block wu-text-xs wu-relative wu-loader-dot-container");let w="7px";r==="sm"?w="7px":r==="md"?w="12px":r==="lg"?w="18px":typeof r=="string"&&(w=r);const i={backgroundColor:s,width:w,height:w},c=t.jsxs("div",{...o,ref:a,className:n("wu-flex wu-items-center wu-justify-center wu-gap-2 wu-w-fit",e.className),role:"status","aria-busy":"true",children:[t.jsx("div",{className:"wu-w-12 wu-h-12 wu-border-2 wu-rounded-full wu-animate-spin",style:{width:w,height:w,borderTopColor:s}}),e.message&&t.jsx("p",{className:"wu-inline-block wu-loader-message",children:e.message})]}),f=t.jsxs("div",{...o,ref:a,className:n("wu-flex wu-items-center wu-justify-center wu-gap-2 wu-w-fit",e.className),role:"alert","aria-busy":"true",children:[t.jsxs("ul",{className:l,style:{fontSize:w},role:"loader",children:[t.jsx("li",{className:"wu-dot wu-loader-dot",style:i}),t.jsx("li",{className:"wu-dot wu-loader-dot",style:i}),t.jsx("li",{className:"wu-dot wu-loader-dot",style:i}),t.jsx("li",{className:"wu-dot wu-loader-dot",style:i})]}),e.message&&t.jsx("p",{className:"wu-inline-block wu-loader-message",children:e.message})]});return t.jsx(t.Fragment,{children:u==="spinner"?c:f})};Ce.displayName="WuLoader";const V=d.forwardRef(({disabled:e,loading:a,variant:r="primary",size:s="md",Icon:u,iconPosition:o="left",children:l,floating:w,className:i,color:c="primary",selected:f,...p},h)=>{const m={primary:"#1986e688",upgrade:"#f5830088",error:"#ef444488"};return t.jsxs(Ne,{...p,disabled:e,variant:r,size:s,className:n(w&&"wu-shadow-qp","wu-flex wu-items-center wu-justify-center wu-gap-2",o==="right"&&"wu-flex-row-reverse",a?"wu-cursor-not-allowed wu-ring-0":"",f&&"wu-bg-blue-p wu-bg-opacity-15 wu-text-blue-pHoverDeep wu-ring-0",c==="error"&&"hover:wu-text-maroon",i),color:c,style:{backgroundColor:a?m[c]:"",...p.style},ref:h,children:[!a&&u&&t.jsx(t.Fragment,{children:u}),a&&t.jsx(Ce,{color:"#fff",size:"sm"}),!a&&l]})});V.displayName="WuButton";const ls=({onLogout:e,DataCenter:a})=>t.jsxs("section",{className:"wu-flex wu-justify-between wu-px-4 wu-py-4 wu-text-white wu-bg-gray-lead",children:[t.jsx("div",{className:"wu-flex-1 wu-flex wu-items-start",children:a}),t.jsx(V,{variant:"outline",size:"sm",Icon:t.jsx("span",{className:"wm-logout"}),className:"wu-text-white wu-bg-transparent wu-ring-white hover:wu-bg-gray-10 hover:wu-text-gray-lead hover:wu-ring-gray-lead",onClick:e,"aria-label":"logout",children:"LOGOUT"})]}),ns=({user:e,dir:a})=>{const r=[e!=null&&e.usage&&Object.keys(e.usage).length>0?{title:e.usage.title,url:e.usage.url,icon:"wm-bar-chart wu-text-base",node:t.jsxs("div",{className:"wu-flex wu-flex-col wu-items-center wu-w-20",children:[t.jsx("code",{className:"wu-font-medium",children:e.usage.collectedResponseCount||"0"}),t.jsx("span",{className:"wu-text-xs wu-font-normal",children:"Responses"})]})}:null,e!=null&&e.invoice&&Object.keys(e.invoice).length>0?{title:e.invoice.title,url:e.invoice.url,icon:"wm-attach-money wu-text-base wu-font-semibold",node:t.jsx("div",{className:"wu-flex wu-justify-center wu-items-center wu-w-20",children:t.jsx("code",{children:e.invoice.size})})}:null].filter(Boolean);return t.jsxs(t.Fragment,{children:[t.jsx("ul",{children:r.map(({title:s,url:u,icon:o,node:l},w)=>t.jsx("li",{className:w<r.length-1?"wu-border-b wu-border-gray-subtle":"",children:t.jsxs("a",{href:u,className:n("wu-flex items-center wu-justify-between wu-py-2 hover:wu-bg-gray-20 focus-within:wu-bg-gray-20 focus:wu-outline-none",a==="rtl"?"wu-pl-4":"wu-pr-4"),children:[t.jsxs("div",{className:"wu-flex wu-items-center wu-gap-2",children:[t.jsx("span",{className:n(o,"wu-w-12 wu-text-center")}),t.jsx("span",{children:s})]}),l]})},w))}),t.jsx("hr",{className:"wu-border-gray-subtle"})]})},ws=({settings:e,dir:a})=>t.jsxs(t.Fragment,{children:[t.jsx("hr",{className:"wu-border-gray-subtle"}),t.jsxs("section",{className:"wu-relative wu-flex wu-items-center wu-justify-start wu-gap-2",children:[t.jsx("span",{className:n("wu-absolute wm-settings wu-text-base",a==="rtl"?"wu-right-4":"wu-left-4")}),t.jsx("ul",{className:"wu-w-full",dir:a,children:e==null?void 0:e.map(r=>t.jsx("li",{tabIndex:-1,dir:a,children:t.jsx("a",{href:r.url,className:n("wu-inline-block wu-w-full wu-py-2 hover:wu-bg-gray-20 focus-within:wu-bg-gray-20 focus:wu-outline-none",a==="rtl"?"wu-pr-14 wu-text-right":"wu-pl-14"),children:r.title})},r.title))})]}),t.jsx("hr",{className:"wu-border-gray-subtle"})]}),is=({user:e,dir:a})=>{var r,s,u,o,l,w,i,c,f;return t.jsxs("section",{className:n("wu-flex wu-gap-2 wu-p-4 wu-w-full",a==="rtl"?"wu-pr-0":"wu-pl-0"),children:[t.jsx("div",{className:"wu-flex wu-items-center wu-justify-center wu-w-12",children:t.jsx("span",{className:"wu-text-base wm-person"})}),t.jsxs("div",{className:n("wu-flex wu-flex-col wu-gap-1",a==="rtl"&&"wu-text-right"),children:[t.jsx("p",{children:(r=e==null?void 0:e.profile)==null?void 0:r.title}),t.jsxs("a",{href:(s=e==null?void 0:e.license)==null?void 0:s.url,className:"hover:wu-text-blue-p wu-group/license focus:wu-outline-none focus:wu-text-blue-p",dir:a,children:[t.jsx("p",{children:(u=e==null?void 0:e.profile)==null?void 0:u.subtitle}),t.jsx("p",{className:"wu-font-light",children:(o=e==null?void 0:e.profile)==null?void 0:o.companyName})]}),(e==null?void 0:e.license)&&Object.keys(e.license).length>0&&t.jsxs("div",{className:"wu-flex wu-items-center wu-justify-between wu-gap-6 wu-mt-3",dir:a,children:[t.jsx("a",{href:(l=e==null?void 0:e.license)==null?void 0:l.url,className:"hover:wu-text-blue-p wu-group/license focus:wu-outline-none focus:wu-text-blue-p",children:t.jsxs("div",{className:"wu-flex wu-flex-col wu-items-start wu-gap-1",children:[t.jsx("p",{className:"wu-font-normal",children:(w=e==null?void 0:e.license)==null?void 0:w.subtitle}),t.jsx("button",{tabIndex:-1,className:"wu-px-3 wu-py-1 wu-border wu-rounded-sm wu-border-gray-subtle group-hover/license:wu-border-blue-p",children:(i=e==null?void 0:e.license)==null?void 0:i.title})]})}),t.jsxs("div",{className:"wu-flex wu-flex-col wu-items-start wu-gap-1",dir:a,children:[t.jsx("p",{className:"wu-font-normal",children:(c=e==null?void 0:e.license)==null?void 0:c.expiryDatePostFixString}),t.jsx("p",{children:(f=e==null?void 0:e.license)==null?void 0:f.expiryDate})]})]})]})]})},Ut=({user:e,onLogout:a,dir:r,DataCenter:s})=>{var u,o;return e?t.jsx($t,{Trigger:t.jsxs(zt,{className:n("wu-group wu-border wu-border-white wu-text-sm wu-font-medium wu-bg-transparent wu-w-8 wu-h-8 wu-ring-white wu-leading-[33px] wu-text-white wu-transition-colors hover:wu-bg-white hover:wu-text-gray-switcher wu-header-user-avatar"),children:[t.jsx(Ht,{className:"hover:wu-opacity-80",src:(u=e==null?void 0:e.profile)==null?void 0:u.profilePicture,alt:"User"}),t.jsx(jt,{children:(o=e==null?void 0:e.profile)==null?void 0:o.initials})]}),dir:r,triggerClassName:"wu-rounded-full focus:wu-outline-none focus-visible:wu-ring-2 focus-visible:wu-ring-blue-soft focus-visible:wu-ring-offset-2 focus-visible:wu-ring-offset-gray-switcher wu-w-8 wu-h-8 wu-app-user-button",DropdownContent:t.jsxs("div",{className:n("wu-p-0 wu-text-xs wu-font-medium wu-border wu-rounded-none wu-min-w-72 wu-w-max wu-max-w-96 wu-border-gray-subtle wu-text-gray-lead wu-overflow-hidden wu-bg-white"),dir:r,children:[t.jsx(is,{user:e,dir:r}),(e==null?void 0:e.settings)&&e.settings.length>0&&t.jsx(ws,{settings:e.settings,dir:r}),t.jsx(ns,{user:e,dir:r}),t.jsx(ls,{onLogout:a,DataCenter:s})]})}):null},Gt=({menuList:e,dir:a})=>{const r=[{icon:"wm-info",title:"Help Center",subTitle:"Knowledge Base",link:"https://www.questionpro.com/help/"},{icon:"wm-calendar-month",title:"Free Online Training",subTitle:"Webinar",link:"https://www.questionpro.com/training"},{icon:"wm-local-fire-department",title:"Updates",subTitle:"What's new!",link:"https://www.questionpro.com/updates/"},{icon:"wm-chat",title:"Live Chat",subTitle:"Support",link:"https://www.questionpro.com/a/liveperson.do?mode=launch&pageMode=quickChat",target:"window"}];return t.jsx($t,{dir:a,Trigger:t.jsx("span",{className:"wm-question-mark wu-text-base"}),triggerClassName:"wu-w-8 wu-h-8 wu-flex wu-items-center wu-justify-center wu-rounded-full wu-border wu-border-white focus:wu-outline-none focus-visible:wu-ring-2 focus-visible:wu-ring-blue-soft focus-visible:wu-ring-offset-2 focus-visible:wu-ring-offset-gray-switcher wu-text-white wu-transition-colors hover:wu-bg-white hover:wu-text-gray-switcher wu-app-header-help",DropdownContent:t.jsx("ul",{children:(e||r).map((s,u)=>t.jsx("li",{className:"wu-p-0 wu-w-[191px] hover:wu-bg-[#ededed]",dir:a,children:s.target==="window"?t.jsx("a",{tabIndex:0,rel:"noopener noreferrer",onClick:()=>et(s.link),onKeyDown:o=>{o.key==="Enter"&&et(s.link)},className:"wu-block wu-w-full wu-h-full wu-px-4 wu-py-2 hover:wu-bg-gray-20 focus-visible:wu-border-none focus-visible:wu-bg-gray-20 focus-visible:wu-ring-0 focus-visible:wu-outline-none focus-visible:wu-ring-offset-0 wu-cursor-pointer",children:t.jsx(Vt,{item:s,dir:a})}):t.jsx("a",{href:s.link,target:"_blank",className:"wu-block wu-w-full wu-h-full wu-px-4 wu-py-2 hover:wu-bg-gray-20 focus-visible:wu-border-none focus-visible:wu-bg-gray-20 focus-visible:wu-ring-0 focus-visible:wu-outline-none focus-visible:wu-ring-offset-0",rel:"noreferrer",children:t.jsx(Vt,{item:s,dir:a})})},u))})})},Vt=({item:e,dir:a})=>t.jsxs("div",{className:"wu-flex wu-items-start wu-gap-3",children:[t.jsx("span",{className:`${e.icon} wu-text-xl wu-text-gray-subtle`}),t.jsxs("div",{className:n("wu-flex wu-flex-col wu-gap-[2px]",a==="rtl"&&"wu-text-right"),children:[t.jsx("span",{className:"wu-text-xs wu-text-gray-subtle",children:e.subTitle}),t.jsx("p",{className:"wu-text-sm wu-text-blue-q",children:e.title})]})]}),ds=e=>{const[a,r]=d.useState(()=>window.innerWidth<=e);return d.useEffect(()=>{const s=()=>{r(window.innerWidth<=e)};return window.addEventListener("resize",s),()=>{window.removeEventListener("resize",s)}},[e]),a};function cs({productCategories:e,openCategory:a,setOpenCategory:r}){const s=(w,i)=>{const c=i[w];if(c){c.focus();const f=e[w]||null;r(f)}},u=(w,i,c,f)=>{w.preventDefault();const p=c==="down"?i+1:i-1;s(p,f)},o=(w,i,c,f)=>{a!=null&&a.products&&a.products[a.products.length-1].name===f&&(w.preventDefault(),s(i+1,c))},l=(w,i)=>{w.preventDefault();const c=e[i]===a?null:e[i];r(c)};return function(i,c,f){const p=document.querySelectorAll("[data-product-category]"),{key:h}=i;switch(h){case"ArrowDown":u(i,c,"down",p);break;case"ArrowUp":u(i,c,"up",p);break;case"Tab":o(i,c,p,f);break;case"Enter":case" ":l(i,c);break}}}const fs=e=>{const{size:a="lg",className:r,children:s,...u}=e,o={sm:"wu-text-body-3",md:"wu-text-body-2",lg:"wu-text-body-1"},l=e.as||"div";return t.jsx(l,{...u,className:n(o[a],r),children:s})},ps=e=>{const{size:a="xl",className:r,children:s,...u}=e,o={sm:"h4",md:"h3",lg:"h2",xl:"h1"},l={sm:"wu-text-heading-4",md:"wu-text-heading-3",lg:"wu-text-heading-2",xl:"wu-text-heading-1"},w=o[a];return t.jsx(w,{...u,className:n(l[a],r),children:s})},bs=e=>{const{size:a="lg",className:r,children:s,...u}=e,o={sm:"wu-text-sub-3",md:"wu-text-sub-2",lg:"wu-text-sub-1"},l=e.as||"div";return t.jsx(l,{...u,className:n(o[a],r),children:s})},hs=e=>{const{size:a="lg",className:r,children:s,...u}=e,o={md:"wu-text-display-2",lg:"wu-text-display-1"},l=e.as||"h1";return t.jsx(l,{...u,className:n(o[a],r),children:s})},le=e=>{const{icon:a,className:r,...s}=e;return t.jsx("span",{...s,className:n(a,r),role:"presentation","aria-label":a})},gs=({buttonRef:e,handleDropdownToggle:a,handleKeyDown:r,isDropdownOpen:s,activeProductName:u,dir:o="ltr",homeLink:l="/"})=>t.jsxs("button",{ref:e,type:"button",className:n("wu-text-base wu-font-normal wu-flex wu-items-center wu-justify-between wu-px-2 wu-gap-2 wu-w-full focus:wu-outline-none focus-visible:wu-bg-white/10 wu-switcher-trigger"),onClick:a,onKeyDown:w=>{s&&w.key==="ArrowDown"&&r(w,-1)},"aria-label":"product-switcher",children:[t.jsx("a",{className:"wu-pl-2 wu-pr-0 wu-aspect-auto focus:wu-outline-none focus-visible:wu-bg-white/10 wu-switcher-logo",tabIndex:-1,href:l,children:t.jsx(le,{icon:"wc-logo",className:"wu-text-xl wu-leading-4 wu-relative wu-top-1"})}),u,t.jsx("span",{className:n("wm-arrow-drop-down wu-text-2xl wu-transition-transform wu-duration-300",s&&"wu-rotate-180",o==="rtl"?"wu-mr-auto":"wu-ml-auto")})]}),F={productDropdownMenu:"_productDropdownMenu_amyba_1",productDropdownMenuOpen:"_productDropdownMenuOpen_amyba_38",rtlDropdownMenu:"_rtlDropdownMenu_amyba_51",productCategory:"_productCategory_amyba_55",open:"_open_amyba_61",productCategoryBorderTop:"_productCategoryBorderTop_amyba_66",productList:"_productList_amyba_93",rtlProductList:"_rtlProductList_amyba_114",productListItem:"_productListItem_amyba_137",productLink:"_productLink_amyba_162",activeProduct:"_activeProduct_amyba_164",topBorder:"_topBorder_amyba_169",topBorderRtl:"_topBorderRtl_amyba_190"},ms=({category:e,dir:a="ltr",openCategory:r})=>{const s=e.active?"#c5cce0":"#f0c36a",u=(r==null?void 0:r.name)===e.name,o=n("wm-arrow-forward-ios wu-text-xs wu-tracking-widest wu-text-muted-foreground wu-mr-2.5 group-hover:wu-hidden wu-text-blue-q",a==="rtl"&&"wu-rotate-180 wu-ml-2.5 wu-text-blue-q group-hover:wu-hidden",u&&"wu-hidden","wu-relative wu-top-[5px]"),l=n("wm-lock wu-text-orange-soft wu-text-base wu-mr-2.5 group-hover:wu-hidden",a==="rtl"&&"wu-ml-2.5 group-hover:wu-hidden",u&&"wu-hidden","wu-relative wu-top-1");return t.jsxs("div",{className:n("group focus:wu-outline-none focus-visible:wu-outline-none wu-flex wu-items-center wu-w-full wu-bg-white wu-relative wu-justify-between"),dir:a,children:[t.jsx("div",{className:F.productCategoryBorderTop,style:{backgroundColor:s}}),t.jsxs("div",{className:"wu-flex wu-items-center wu-px-1 wu-relative wu-top-1",children:[t.jsx("div",{className:"wu-w-[56px] wu-h-[56px] wu-flex wu-items-center wu-justify-center",children:t.jsx("img",{src:e.logo,alt:e.name,width:"32px",height:"32px"})}),t.jsx("span",{className:"wu-text-sm wu-leading-5 wu-text-blue-q wu-relative wu-top-[1px]",children:e.name})]}),e.active?t.jsx("span",{className:o}):t.jsx("span",{className:l})]})},xs={e309:"wp-audience",e381:"wp-bi",e329:"wp-closed-loop",e314:"wp-communities",e313:"wp-cx",e352:"wp-digsite",e324:"wp-empower",e317:"wp-insightshub",e380:"wp-instant-answers",e378:"wp-intercept",e311:"wp-livepolls",e316:"wp-reputation",e379:"wp-suite-cx",e382:"wp-suite-cx",e308:"wp-surveys",e315:"wp-workforce"},ys=({product:e,currentProduct:a,activeProductName:r,dir:s,focusItem:u,setFocusItem:o})=>{const[l,w]=d.useState(e.name===a),i=e.name===r,c=e.name===a,f=!e.active,p="#1b3380",h="#c5cce0",m="#ffcf70",g=n("wu-font-normal wu-text-xs wu-text-gray-lead wu-text-center",c&&"wu-text-blue-q wu-font-normal",!e.active&&"wu-text-gray-subtle",l&&"wu-font-normal",e.active&&l&&"wu-text-blue-q"),b=n("wu-text-blue-p wu-text-base",c&&"wu-text-blue-q",!e.active&&"wu-text-gray-subtle",e.active&&l&&"wu-text-blue-q"),v=l||u===e.name||i?p:h;return t.jsxs("li",{className:n(F.productListItem,"focus-visible:wu-outline-none focus:wu-outline-none wu-sub-product-list-item",(i||l)&&F.activeProduct,e.name.length>15&&window.innerWidth>768&&"wu-w-[130px] wu-min-w-[130px]",u===e.name&&F.activeProduct,"wu-product-item"),onMouseOver:()=>w(!0),onMouseOut:()=>w(!1),"aria-label":e.name,"aria-disabled":f,dir:s,onKeyDown:S=>{if(S.key==="Enter"){S.preventDefault();const y=S.currentTarget.querySelector("a");y&&y.click()}},onFocus:()=>{o(e.name)},onBlur:()=>o(""),children:[t.jsx("div",{className:n(F.topBorder,s==="rtl"&&F.topBorderRtl),style:{backgroundColor:f?m:v}}),t.jsxs("a",{className:n(F.productLink,"focus:wu-outline-none focus-visible:wu-outline-none"),href:e.link||"#",tabIndex:0,children:[t.jsx("span",{className:n(b,xs[e.icon||""]),"aria-hidden":!0}),t.jsx("span",{className:n(g),children:e.name})]})]},e.name)},vs=({category:e,currentProduct:a,activeProductName:r,dir:s="ltr",focusItem:u,setFocusItem:o,borderColorLocked:l="#f5a300"})=>{const{products:w=[],active:i}=e,c=d.useMemo(()=>w.filter(g=>g.active).sort((g,b)=>(g.order||100)-(b.order||100)),[w]),f=d.useMemo(()=>w.filter(g=>!g.active),[w]),[p,h]=d.useState(l),m=g=>g.map((b,v)=>t.jsx(ys,{product:b,currentProduct:a,activeProductName:r,dir:s,focusItem:u,setFocusItem:o},v));return i?t.jsxs(t.Fragment,{children:[m(c),f.length>0&&t.jsxs("li",{className:n(F.productListItem,"focus:wu-outline-none focus-visible:wu-outline-none !wu-bg-[#f5f5f5] hover:!wu-bg-[#eeeeee] wu-group"),onMouseOver:()=>h("#f5a300"),onMouseOut:()=>h(l),"aria-label":"Upgrade to unlock",children:[t.jsx("div",{className:n(F.topBorder,s==="rtl"&&F.topBorderRtl),style:{backgroundColor:p},"aria-label":"top-border"}),t.jsxs("a",{href:"https://www.questionpro.com/a/showUpgradeUser.do",className:n(F.productLink,"wu-flex wu-flex-col wu-items-center wu-justify-center wu-py-2 wu-min-w-[88px]"),children:[t.jsx("span",{className:"wu-text-base wu-transition-colors wm-lock !wu-text-orange-soft group-hover:wu-text-orange-deep"}),t.jsxs("span",{className:"wu-text-[10px] wu-leading-[10px] wu-text-center wu-pt-1 !wu-text-orange-deep",children:["Upgrade to ",t.jsx("br",{})," unlock"]})]})]}),m(f)]}):t.jsxs("li",{className:n(F.productListItem,F.learnMore,"focus:wu-outline-none focus-visible:wu-outline-none wu-product-item-inactive !wu-bg-[#f5f5f5] hover:!wu-bg-[#eeeeee]",u==="learn"&&"activeProduct"),tabIndex:0,onFocus:()=>o("learn"),onBlur:()=>o(""),"aria-label":"Learn More",children:[t.jsx("div",{className:n(F.topBorder,s==="rtl"&&F.topBorderRtl),style:{backgroundColor:l}}),t.jsx("a",{className:F.productLink,href:"https://www.questionpro.com/a/showUpgradeUser.do",tabIndex:-1,children:t.jsx("span",{className:"wu-text-[#f99e03]",children:"Learn More"})})]})},Yt=({dropdownRef:e,dir:a,isDropdownOpen:r,productCategories:s,openCategory:u,setOpenCategory:o,handleKeyDown:l,expandAll:w,activeProductName:i,focusItem:c,setFocusItem:f})=>{const p="#ffcf70",[h,m]=d.useState(window.innerWidth>768);return d.useEffect(()=>{const g=()=>{m(window.innerWidth>375)};return window.addEventListener("resize",g),()=>window.removeEventListener("resize",g)},[]),t.jsx("ul",{className:n(F.productDropdownMenu,r&&F.productDropdownMenuOpen,a==="rtl"&&F.rtlDropdownMenu,"wu-switcher-container"),ref:e,dir:a,"aria-label":"product-dropdown-menu","data-state":r?"open":"closed",children:s.map((g,b)=>t.jsxs("li",{className:n(F.productCategory,"focus:wu-outline-none focus-visible:wu-outline-none wu-h-16 wu-category-item",u===g&&F.open,w&&F.open),onMouseEnter:()=>h&&o(g),onMouseLeave:()=>h&&o(null),"aria-label":g.name,dir:a,onKeyDown:v=>l(v,b),tabIndex:0,"data-product-category":!0,children:[t.jsx(ms,{category:g,dir:a,openCategory:u}),t.jsx("ul",{className:n(F.productList,a==="rtl"&&F.rtlProductList),dir:a,children:t.jsx(vs,{category:g,dir:a,activeProductName:i,currentProduct:g.name,focusItem:c,setFocusItem:f,borderColorLocked:p})})]},g.name))})},Ns=({isProductButtonShow:e,isDropdownOpen:a,activeProductColor:r,activeProductBgColor:s,activeProductName:u,dir:o,smallScreenButtonRef:l,handleDropdownToggle:w,handleKeyDown:i})=>t.jsx("div",{className:n("wu-absolute wu-top-11 wu-transition-all wu-duration-300 wu-ease-in-out wu-transform wu-opacity-100 wu-w-[256px] wu-z-10",e?o==="rtl"?"wu-right-0 wu-overflow-hidden":"wu-translate-x-0 wu-left-0":o==="rtl"?"wu-right-0 wu-w-0":"wu--translate-x-full"),style:{backgroundColor:a?r.hover:s},children:t.jsxs("button",{ref:l,type:"button",className:n("wu-text-base wu-leading-[48px] wu-flex wu-items-center wu-justify-center wu-px-2 wu-gap-2 wu-w-full focus:wu-outline-none focus-visible:wu-bg-white/10 wu-switcher-trigger",e?"wu-flex":o==="rtl"?"wu-hidden":"wu-flex"),onClick:w,onKeyDown:c=>{a&&c.key==="ArrowDown"&&i(c,-1)},"aria-label":"small-screen-product-btn",children:[u,t.jsx("span",{className:n("wm-arrow-drop-down wu-text-2xl wu-transition-transform wu-duration-300",a&&"wu-rotate-180")})]})}),Cs=({dir:e,isProductButtonShow:a,smallScreenToggleButtonRef:r,setIsProductButtonShow:s,setDropdownOpen:u})=>{const o=()=>{s(l=>!l),a&&u(!1)};return t.jsxs("button",{className:n("wu-relative wu-w-10 wu-h-10 wu-flex wu-flex-col wu-justify-center wu-items-center",e==="rtl"?"wu-mr-4":"wu-ml-4"),onClick:o,ref:r,"aria-label":"menu-toggle-btn",children:[t.jsx("span",{className:`wu-absolute wu-w-6 wu-h-[3px] wu-bg-white wu-transition-transform wu-duration-300 ${a?"wu-rotate-45 wu-translate-y-0":"-wu-translate-y-2.5"}`}),t.jsx("span",{className:`wu-absolute wu-w-6 wu-h-[3px] wu-bg-white wu-transition-opacity wu-duration-300 ${a?"wu-opacity-0":"wu-opacity-100"}`}),t.jsx("span",{className:`wu-absolute wu-w-6 wu-h-[3px] wu-bg-white wu-transition-transform wu-duration-300 ${a?"-wu-rotate-45 wu-translate-y-0":"wu-translate-y-2.5"}`})]})},Jt=({productCategories:e,activeProductName:a,activeProductColor:r={base:"#1b87e6",hover:"#54A5EC"},dir:s,homeLink:u,expandAll:o})=>{const l=d.useRef(null),w=d.useRef(null),i=d.useRef(null),c=d.useRef(null),[f,p]=d.useState(!1),[h,m]=d.useState(null),[g,b]=d.useState(r.base),[v,S]=d.useState(""),[y,C]=d.useState(!1),D=ds(768);st([w,l],()=>{p(!1),m(null)}),st([i,c,w],()=>{C(!1),p(!1),m(null)}),d.useEffect(()=>{const W=T=>{T.key==="Escape"&&p(!1)};return document.addEventListener("keydown",W),()=>{document.removeEventListener("keydown",W)}},[f]),d.useEffect(()=>b(r.base),[r.base]);const k=W=>{W.preventDefault(),W.stopPropagation(),p(T=>{const M=!T;return M||m(null),M})},I=(W,T)=>{cs({productCategories:e,openCategory:h,setOpenCategory:m})(W,T,v)};return t.jsx("div",{className:n("wu-inline-flex wu-items-center wu-justify-between wu-relative wu-z-auto wu-h-12 wu-text-white"),children:D?t.jsxs("div",{className:"wu-relative wu-flex",children:[t.jsx(Cs,{dir:s,isProductButtonShow:y,smallScreenToggleButtonRef:c,setDropdownOpen:p,setIsProductButtonShow:C}),t.jsx(Ns,{isProductButtonShow:y,isDropdownOpen:f,activeProductColor:r,activeProductBgColor:g,activeProductName:a,handleDropdownToggle:k,smallScreenButtonRef:i,handleKeyDown:I,dir:s}),t.jsx("div",{className:n("wu-absolute wu-top-[92px] wu-left-0 wu-text-[18px]",s==="rtl"&&"wu-right-[256px] wu-left-auto"),children:t.jsx(Yt,{activeProductName:a,focusItem:v,setFocusItem:S,handleKeyDown:I,isDropdownOpen:f,openCategory:h,productCategories:e,setOpenCategory:m,dropdownRef:w,expandAll:o,dir:s})})]}):t.jsxs("div",{className:"wu-relative wu-flex wu-items-center wu-justify-start wu-h-full wu-w-[256px]",dir:s,style:{backgroundColor:f?r.hover:g},onMouseOver:()=>b(r.hover),onMouseOut:()=>b(r.base),children:[t.jsx(gs,{activeProductName:a,dir:s,homeLink:u,buttonRef:l,handleDropdownToggle:k,handleKeyDown:I,isDropdownOpen:f}),t.jsx(Yt,{activeProductName:a,focusItem:v,setFocusItem:S,handleKeyDown:I,isDropdownOpen:f,openCategory:h,productCategories:e,setOpenCategory:m,dropdownRef:w,expandAll:o,dir:s})]})})},Kt=({children:e,dir:a,className:r})=>t.jsx("section",{className:n("wu-flex wu-items-center wu-flex-1 wu-min-w-0 wu-h-12 wu-gap-2 wu-px-2",a==="rtl"&&"wu-flex-row-reverse",r),children:t.jsx("div",{className:"wu-grow",children:e})}),ze=N.forwardRef(({className:e,type:a,...r},s)=>t.jsx("input",{type:a,className:n("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:s,...r}));ze.displayName="Input";const Ss=e=>{const{message:a,className:r,...s}=e;return t.jsx("p",{...s,className:n("wu-text-sub-3 wu-break-words wu-font-light",r),style:{color:"rgb(var(--wu-red-deep))",...s.style},children:a})},ks=e=>{var w,i;const{inputRef:a,maxLength:r=50,className:s,...u}=e,[o,l]=d.useState(!1);return d.useEffect(()=>{var c;(((c=a==null?void 0:a.current)==null?void 0:c.value.length)||0)>.75*r?l(!0):l(!1)},[(w=a==null?void 0:a.current)==null?void 0:w.value,r]),t.jsx("p",{...u,className:n("wu-text-sub-3 wu-font-light",s),style:{color:"rgb(var(--wu-gray-subtle))",...u.style},children:o&&`${(i=a==null?void 0:a.current)==null?void 0:i.value.length}/${r}`})},Ts=X.cva("wu-text-xs wu-font-normal wu-leading-none peer-disabled:wu-cursor-not-allowed peer-disabled:wu-text-gray-subtle peer-readonly:wu-text-gray-subtle peer-required:after:wu-content-['*'] peer-required:after:wu-ml-[2px] peer-required:after:wu-text-red-deep peer-aria-[required]:after:wu-content-['*'] peer-aria-[required]:after:wu-ml-[2px] peer-aria-[required]:after:wu-text-red-deep"),_e=N.forwardRef(({className:e,...a},r)=>t.jsx(Lt.Root,{ref:r,className:n(Ts(),e),...a}));_e.displayName=Lt.Root.displayName;const Q=e=>t.jsx(_e,{...e,className:n("wu-text-gray-lead wu-leading-6",e.className)}),Ds=({Label:e,Error:a,Hint:r,Input:s,labelPosition:u="top",dir:o="ltr",className:l,...w})=>{const c=n("wu-flex",u==="top"?"wu-flex-col wu-gap-1":"wu-flex-row wu-items-center wu-gap-2",l),f=n("wu-flex wu-flex-col wu-gap-1 wu-relative wu-flex-1 wu-form-group-wrapper"),p=n("wu-absolute -wu-bottom-5",o==="ltr"?"wu-right-0":"wu-left-0","wu-form-group-hint"),h=n("wu-absolute -wu-bottom-5",o==="ltr"?"wu-left-0":"wu-right-0","wu-form-group-error");return t.jsxs("div",{className:c,dir:o,...w,children:[e,t.jsxs("div",{className:f,children:[s,r&&t.jsx("div",{className:p,children:r}),a&&t.jsx("div",{className:h,children:a})]})]})},pe=d.forwardRef((e,a)=>{const{Label:r,labelPosition:s="top",Icon:u,iconPosition:o,type:l,value:w,variant:i="flat",readonly:c,id:f=Be(),...p}=e,h=Ee(s),m=u?o!=="right"?"wu-pl-8":"wu-pr-8":"",[g,b]=d.useState(!1),v=()=>{b(y=>!y)},S=y=>{p.onChange&&p.onChange(y)};return t.jsx(t.Fragment,{children:l==="submit"?t.jsx(V,{type:"submit",className:p.className,id:f,children:r||"Submit"}):t.jsx("div",{className:n("wu-flex wu-flex-col wu-gap-2 wu-input-container"),dir:p.dir,children:t.jsxs("div",{className:n("wu-flex wu-gap-1 wu-relative wu-w-fit",h,(s==="right"||s==="left")&&"wu-items-center","wu-input-wrapper"),children:[u&&o!=="right"&&t.jsx("div",{className:"wu-absolute wu-flex wu-items-center wu-justify-center wu-w-8 wu-h-8 wu-input-icon-container",children:u}),t.jsx(ze,{...p,className:n("wu-peer wu-text-xs wu-rounded-t-sm",i==="outlined"?"wu-border wu-border-gray-subtle":"",m,p.className),type:g?"text":l,ref:a,readOnly:c,onChange:p.onChange&&S,value:w,id:f}),u&&o==="right"&&t.jsx("div",{className:"wu-absolute wu-right-0 wu-flex wu-items-center wu-justify-center wu-w-8 wu-h-8 wu-input-icon-container",children:u}),l==="password"&&t.jsx("div",{className:"wu-absolute wu-right-0 wu-flex wu-items-center wu-justify-center wu-w-8 wu-h-8 wu-cursor-pointer",onClick:v,children:t.jsx("button",{type:"button",className:"wu-flex wu-items-center wu-justify-center wu-w-6 wu-h-6 wu-rounded-sm focus:wu-outline-none focus-visible:wu-ring-2 focus-visible:wu-ring-blue-soft","aria-label":"show-password",children:g?t.jsx("span",{className:"wm-visibility wu-text-gray-subtle"}):t.jsx("span",{className:"wm-visibility-off wu-text-gray-subtle"})})}),r&&t.jsx(Q,{htmlFor:f,className:"wu-input-label",children:r})]})})})});pe.displayName="WuInput";const Ms=({className:e,placeholder:a="Search surveys, folders or tools",defaultCollapsed:r=!0,onSearch:s,...u})=>{const[o,l]=d.useState(r);return d.useEffect(()=>{l(r)},[r]),t.jsx(pe,{...u,placeholder:a,onChange:w=>s(w.target.value),className:n("wu-rounded-full focus-visible:wu-outline-2 focus-visible:wu-outline-blue-focus -wu-outline-offset-2 wu-bg-white","wu-transition-all wu-duration-300 wu-ease-in-out",o?"wu-w-8 wu-px-2 wu-text-lg wu-rounded-full wu-h-8 wu-border wu-border-white wu-bg-transparent":"wu-w-40 sm:wu-w-60",e),type:"search",Icon:t.jsx(le,{"data-testid":"search-icon",icon:"wm-search",className:n("wu-text-gray-lead wu-cursor-pointer",o&&"wu-text-white"),onClick:()=>l(w=>!w)})})},Xt=Me.Provider,Qt=Me.Root,Zt=Me.Trigger,lt=N.forwardRef(({className:e,sideOffset:a=4,...r},s)=>t.jsx(Me.Content,{ref:s,sideOffset:a,className:n("wu-z-50 wu-overflow-hidden wu-bg-gray-notification wu-text-white wu-px-3 wu-py-1.5 wu-text-sm wu-shadow-md",e),...r}));lt.displayName=Me.Content.displayName;const He=d.forwardRef(({content:e,position:a,positionOffset:r,duration:s,children:u,className:o,showArrow:l=!1,...w},i)=>t.jsx(Xt,{delayDuration:s||200,children:t.jsxs(Qt,{children:[t.jsx(Zt,{asChild:!0,children:t.jsx("span",{ref:i,children:u})}),t.jsx(Qe.Portal,{children:e&&t.jsxs(lt,{...w,side:a||"top",sideOffset:r||0,className:n("wu-max-w-sm wu-max-h-96 wu-overflow-y-auto",o),children:[e,l&&t.jsx(Qe.Arrow,{className:"wu-fill-gray-notification wu-tooltip-arrow"})]})})]})}));He.displayName="WuTooltip";const Is=({label:e,className:a})=>{const r=d.useRef(null),[s,u]=d.useState(!1);return d.useEffect(()=>{const o=r.current;if(o){const l=o.clientWidth,w=o.scrollWidth,i=w/e.length,c=e.length*i;u(c>l||w>l)}},[e]),t.jsx("p",{ref:r,className:n("wu-w-full wu-truncate",a),children:s?t.jsx(He,{content:e,positionOffset:8,children:e}):e})},Ws=e=>{var p;const{productName:a,categories:r=[],user:s,children:u,onLogout:o,homeLink:l=window.location.origin,brandColor:w,dir:i="ltr",expandAll:c,DataCenter:f}=e;return t.jsx("div",{className:"wu-sticky wu-top-0 wu-z-50 wu-w-full",children:t.jsxs("header",{className:n("wu-h-12 wu-flex wu-items-center wu-justify-between wu-relative wu-bg-blue-switcher wu-text-white",i==="rtl"&&"wu-flex-row-reverse",e.className),style:e.style,children:[ss((p=s==null?void 0:s.profile)==null?void 0:p.subtitle)&&window.wickUiVersion&&t.jsxs("p",{className:"wu-text-[10px] wu-text-gray-subtle wu-font-normal wu-absolute wu-top-11 wu-right-1 wu-z-[-1] wu-invisible","aria-label":"wickUiVersion",children:["Wick UI: v",window.wickUiVersion]}),t.jsx("section",{className:"wu-flex wu-items-center wu-gap-2 wu-shrink-0",children:t.jsx(Jt,{productCategories:r,activeProductName:a,activeProductColor:w,dir:i,homeLink:l,expandAll:c})}),t.jsx(Kt,{dir:i,children:u}),t.jsxs("section",{className:n("wu-flex wu-items-center wu-justify-end wu-shrink-0 wu-gap-2",i==="rtl"?"wu-flex-row-reverse wu-pl-4":"wu-flex-row wu-pr-4"),children:[t.jsx(Gt,{dir:i}),(s==null?void 0:s.profile)&&Object.keys(s.profile).length>0&&t.jsx(Ut,{user:s,onLogout:o,dir:i,DataCenter:f})]})]})})},ee=Ie.Root,be=Ie.Trigger,Z=N.forwardRef(({className:e,align:a="center",sideOffset:r=4,...s},u)=>t.jsx(Ie.Portal,{children:t.jsx(Ie.Content,{ref:u,align:a,sideOffset:r,className:n("wu-z-50 wu-w-72 wu-border wu-bg-popover wu-p-4 wu-text-popover-foreground wu-shadow-md wu-outline-none 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-[side=bottom]:wu-slide-in-from-top-2 data-[side=left]:wu-slide-in-from-right-2 data-[side=right]:wu-slide-in-from-left-2 data-[side=top]:wu-slide-in-from-bottom-2",e),...s})}));Z.displayName=Ie.Content.displayName;function Rt({className:e,classNames:a,dir:r="ltr",...s}){const u=Ot.getDefaultClassNames();return t.jsx(Ot.DayPicker,{showOutsideDays:s.showOutsideDays||!1,className:n("wu-p-3",e),classNames:{root:n(u.root,"wu-relative wu-rounded-none wu-bg-white dark:wu-bg-gray-switcher"),caption_label:n("wu-text-xs",s.captionLayout==="dropdown"?"wu-hidden":""),month_caption:n(u.month_caption,"wu-mb-5"),months:n(u.months,"wu-flex wu-flex-col sm:wu-flex-row wu-gap-4"),dropdowns:n(u.dropdowns,"wu-flex wu-items-center wu-justify-start wu-gap-2",(s.mode==="range","")),dropdown:n(u.dropdown,"wu-px-2 wu-py-1 wu-text-sm wu-text-gray-lead wu-font-medium focus:wu-outline-none wu-bg-white wu-border-b wu-border-gray-subtle focus-visible:wu-border-blue-p"),weekday:n(u.weekday,"wu-text-gray-lead wu-rounded-none wu-w-9 wu-font-normal wu-text-xs wu-bg-gray-10 wu-py-2"),day_button:n(u.day_button,"wu-w-full wu-h-full focus:wu-outline-none focus-visible:wu-ring-2 focus-visible:wu-ring-blue-pHover focus-visible:wu-ring-offset-2"),day:n(u.day,"wu-text-gray-lead wu-transition-colors wu-duration-300 [&:not([aria-selected])]:hover:wu-bg-gray-25 wu-text-sm wu-w-9 wu-h-9 wu-min-w-0 wu-text-center wu-p-0 wu-rounded-none data-[today=true]:[&:not([aria-selected])]:wu-border data-[today=true]:[&:not([aria-selected])]:wu-border-blue-p data-[today=true]:[&:not([aria-selected])]:wu-text-gray-lead"),selected:n(u.selected,"wu-bg-blue-p [&:not(.rm)]:wu-text-white hover:wu-bg-blue-pHover"),range_middle:n("rm",u.range_middle,"wu-bg-blue-p/10 wu-rounded-none hover:wu-bg-blue-p/20 wu-text-gray-lead hover:wu-text-white data-[today=true]:wu-bg-blue-p/20 hover:data-[today=true]:wu-bg-blue-pHover"),range_end:n(u.range_end,"wu-rounded-none"),range_start:n(u.range_start,"wu-rounded-none wu-bg-blue-p hover:wu-bg-blue-pHover"),month_grid:n(u.month_grid,"[&>thead>tr>th]:wu-pb-2 wu-border-collapse wu-space-y-1"),button_next:n(u.button_next,ot({variant:"iconOnly"}),"wu-h-6 wu-w-6 wu-text-gray-lead"),button_previous:n(u.button_previous,ot({variant:"iconOnly"}),"wu-h-6 wu-w-6 wu-rotate-180 wu-text-gray-lead"),nav:n(u.nav,"wu-absolute wu-top-4 wu-right-3 wu-flex",r==="rtl"&&"wu-right-auto wu-left-3 wu-flex-row-reverse"),chevron:n(u.chevron,"!wu-text-red-500"),outside:n(u.outside,"wu-invisible"),disabled:n(u.disabled,"hover:wu-bg-white wu-text-gray-subtle"),...a},components:{Chevron:()=>t.jsx("span",{className:"wm-chevron-right wu-text-lg wu-leading-5"})},...s})}Rt.displayName="Calendar";const nt=e=>t.jsx(Rt,{...e}),ea=e=>{const{handleDateChange:a,disabled:r,onReset:s,showResetButton:u}=e;return t.jsxs("div",{className:"wu-flex wu-items-center wu-justify-end wu-gap-2 wu-mt-2 wu-date-picker-footer",children:[u&&t.jsx(V,{variant:"secondary",onClick:s,Icon:t.jsx("span",{className:"wu-text-[20px] wu-leading-5 -wu-mt-[1px] wm-refresh"}),className:"wu-date-picker-footer-reset",children:"Reset"}),t.jsx(De.PopoverClose,{asChild:!0,children:t.jsx(V,{onClick:a,disabled:r,className:"wu-date-picker-apply",children:"Apply"})})]})},wt=({formattedString:e,dir:a,placeholder:r="Select Date",className:s,variant:u="primary",color:o,...l})=>t.jsx(De.PopoverTrigger,{asChild:!0,dir:a,children:t.jsx(V,{...l,className:n("wu-justify-between wu-w-full wu-gap-2 wu-text-xs wu-border-b wu-rounded-none wu-rounded-t-sm wu-min-w-48 wu-border-gray-subtle wu-text-gray-lead wu-placeholder:wu-text-gray-subtle wu-placeholder:wu-font-light wu-bg-gray-10 hover disabled:wu-cursor-not-allowed disabled:wu-bg-gray-20 disabled:wu-border-gray-40 disabled:wu-text-subtle hover:wu-text-gray-lead hover:wu-bg-gray-10 hover:wu-border-gray-40 wu-datepicker-trigger",u==="outlined"&&"wu-border wu-border-subtle wu-bg-transparent",s),Icon:t.jsx("span",{className:"wm-calendar-month wu-text-sm"}),iconPosition:"right",children:e||r})}),ta=(e,a,r,s)=>!!(a||r&&e<r||s&&e>s),je=e=>e?typeof e=="string"?new Date(e):e:new Date,it="\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01])",Es=[{label:"Last 7 days",value:7},{label:"Last 30 days",value:30},{label:"Last 90 days",value:90},{label:"Last 365 days",value:365}],_s=({formatString:e="yyyy-MM-dd",value:a,onChange:r,disabled:s,minDate:u=A.sub(new Date,{years:5}),maxDate:o=A.add(new Date,{years:1}),dir:l="ltr",Label:w,labelPosition:i="top",onReset:c,showResetButton:f=!1,placeholder:p="Select Date",...h})=>{const[m,g]=d.useState(),[b,v]=d.useState(""),S=d.useCallback(()=>{const C=je(m);v(A.format(C,e)),r&&r(m)},[m,e,r]),y=d.useCallback(()=>{c?c():(g(void 0),v(""),r&&r(void 0))},[r,c]);return d.useEffect(()=>{const C=je(a);g(C),v(A.format(C,e))},[a,e]),t.jsxs(Q,{className:n("wu-flex wu-gap-1",i==="left"?"wu-items-center":"wu-flex-col wu-items-start","wu-date-picker-label"),dir:l,children:[w,t.jsxs(ee,{children:[t.jsx(wt,{...h,formattedString:b,dir:l,placeholder:p}),t.jsx(Z,{className:"wu-p-0 wu-w-fit wu-date-picker-content",align:"start",sideOffset:-.5,dir:l,children:t.jsx(nt,{dir:l,mode:"single",captionLayout:"dropdown",selected:m,onSelect:g,disabled:C=>ta(C,s,u,o),startMonth:u,endMonth:o,required:!0,autoFocus:!0,defaultMonth:m,className:n("wu-border wu-border-blue-p wu-date-picker"),footer:t.jsx(ea,{handleDateChange:S,disabled:s,onReset:y,showResetButton:f})})})]})]})},aa="yyyy-MM-dd",qs=[{label:"Day",value:1},{label:"Week",value:7},{label:"Month",value:30},{label:"Quarter",value:90},{label:"Year",value:365}],As=({current:e,onSelect:a,presetRanges:r=Es})=>{const[s,u]=d.useState(),[o,l]=d.useState(!1),[w,i]=d.useState(""),[c,f]=d.useState(""),[p,h]=d.useState(!1),m=d.useMemo(()=>r.map(y=>y.value),[r]),g=n("wu-flex wu-w-full wu-gap-2 wu-px-4 wu-py-2 wu-text-sm wu-text-gray-lead wu-transition-colors","wu-rounded-none hover:wu-bg-gray-10 focus:wu-outline-none focus-visible:wu-ring-2","focus-visible:wu-ring-blue-pHover focus-visible:wu-ring-offset-1 wu-text-start"),b=d.useCallback(y=>{if(y===void 0){u(void 0),l(!0);return}const C=Number(y)-1;u(C),l(!1),a({from:A.sub(new Date,{days:C}),to:new Date})},[a]),v=d.useCallback((y,C)=>{if(!y||!(e!=null&&e.to)||!(e!=null&&e.from)||!new RegExp(it).test(y))return!1;const k=new Date(C==="start"?y:e.from),I=new Date(C==="end"?y:e.to);return A.isBefore(I,k)?(h(!0),!1):(h(!1),!(A.isSameDay(k,e.from)&&A.isSameDay(I,e.to)))},[e]),S=d.useCallback((y,C)=>{if((C==="start"?i:f)(y),v(y,C)){const k={from:e==null?void 0:e.from,to:e==null?void 0:e.to};C==="start"&&(k.from=new Date(y)),C==="end"&&(k.to=new Date(y)),a(k)}},[e,a,v]);return d.useEffect(()=>{if(e!=null&&e.to&&(e!=null&&e.from)&&A.isValid(e.to)&&A.isValid(e.from)){i(A.format(e.from,aa)),f(A.format(e.to,aa));const y=A.differenceInCalendarDays(e.to,e.from);A.isToday(e.to)&&m.includes(y+1)?(u(y),l(!1)):(u(void 0),l(!0))}},[e,m]),t.jsxs("div",{className:"wu-flex wu-flex-col wu-gap-1 wu-p-2 wu-bg-white wu-w-60 wu-date-picker-sidebar",children:[t.jsx("ul",{className:"wu-flex wu-gap-1 wu-py-2 wu-date-picker-batch-list",children:qs.map(({label:y,value:C})=>t.jsx(Ne,{variant:"secondary",className:"wu-px-1 wu-py-1 wu-text-xs wu-h-fit wu-min-w-fit disabled:wu-bg-white",disabled:C!==1,children:y},C))}),t.jsxs("ul",{className:"wu-flex wu-flex-col wu-gap-1 wu-date-picker-ranges",children:[r.map(({label:y,value:C})=>t.jsx("li",{children:t.jsx("button",{className:n(g,s===C-1&&"wu-bg-blue-p/10"),onClick:()=>b(C),children:y})},C)),t.jsx("li",{children:t.jsx("button",{className:n(g,o&&"wu-bg-blue-p/10"),onClick:()=>b(),children:"Custom Range"})})]}),t.jsxs("div",{className:"wu-relative wu-flex wu-gap-3 wu-pt-2 wu-date-picker-range-footer",children:[t.jsx(pe,{placeholder:"Start Date",pattern:it,value:w,onChange:y=>S(y.target.value,"start"),"aria-label":"Start Date"}),t.jsx(pe,{placeholder:"End Date",pattern:it,value:c,onChange:y=>S(y.target.value,"end"),"aria-label":"End Date"}),p?t.jsx("small",{className:"wu-absolute wu-text-[10px] wu-leading-[14px] wu-text-red-deep wu-left-0 -wu-bottom-4 wu-text-start",children:"End date must be after start date"}):t.jsx("small",{className:"wu-absolute wu-right-0 wu-leading-[14px] -wu-bottom-4 wu-text-gray-subtle wu-text-end",children:"yyyy-mm-dd"})]})]})},Os=({formatString:e="yyyy/MM/dd",value:a,onChange:r,disabled:s,minDate:u=A.sub(new Date,{years:5}),maxDate:o=A.add(new Date,{years:1}),dir:l="ltr",minDateToSelect:w,maxDateToSelect:i,presetRanges:c,Label:f,labelPosition:p="top",onReset:h,showResetButton:m=!0,placeholder:g="Select Date Range",...b})=>{const[v,S]=d.useState(a),[y,C]=d.useState(a),[D,k]=d.useState(""),I=d.useCallback(()=>{if(y){const M=y.from,q=y.to;S({from:M,to:q}),k(`${A.format(M,e)} - ${A.format(q,e)}`),r&&r({from:M,to:q})}},[y,e,r]),W=d.useCallback(()=>{C(v)},[v]),T=d.useCallback(()=>{h?h():(S(void 0),C(void 0),k(""),r&&r(void 0))},[h,r]);return d.useEffect(()=>{if(a!=null&&a.from&&(a!=null&&a.to)){const M=je(a.from),q=je(a.to);S(a),C(a),k(`${A.format(M,e)} - ${A.format(q,e)}`)}else S(void 0),C({to:new Date,from:new Date})},[a,e]),t.jsxs(Q,{className:n("wu-flex wu-gap-1",p==="left"?"wu-items-center":"wu-flex-col wu-items-start","wu-date-picker-label"),dir:l,children:[f,t.jsxs(ee,{onOpenChange:M=>!M&&W(),children:[t.jsx(wt,{...b,formattedString:D,dir:l,placeholder:g}),t.jsxs(Z,{className:"wu-flex wu-p-0 wu-border wu-w-fit wu-border-blue-p",align:"start",sideOffset:-.5,dir:l,children:[t.jsx(As,{current:y,onSelect:C,presetRanges:c}),t.jsx(nt,{dir:l,numberOfMonths:2,mode:"range",captionLayout:"dropdown",selected:y,onSelect:C,disabled:M=>ta(M,s,u,o),startMonth:u,endMonth:o,required:!0,autoFocus:!0,defaultMonth:v==null?void 0:v.from,className:n("wu-shadow-none wu-date-range-picker"),min:w,max:i,footer:t.jsx(ea,{handleDateChange:I,disabled:s,onReset:T,showResetButton:m})})]})]})]})},ra=d.forwardRef((e,a)=>{const{className:r,rounded:s,...u}=e;return t.jsx("div",{className:n("wu-card wu-p-2 wu-pt-1 hover:wu-shadow-card wu-border wu-border-black/20 hover:wu-border-black/30 wu-transition-colors wu-duration-300",s?"wu-rounded-lg":"wu-rounded-sm",r),ref:a,...u})});ra.displayName="WuCard";const Ls=d.forwardRef((e,a)=>{const{className:r,...s}=e;return t.jsx("div",{ref:a,...s,className:n("wu-p-2 wu-mb-2 wu-border-b wu-border-gray-40 min-h-12 wu-card-header",r)})});Ls.displayName="WuCardHeader";const Ps=d.forwardRef((e,a)=>{const{className:r,...s}=e;return t.jsx("div",{ref:a,...s,className:n("wu-p-2 wu-mt-2 wu-border-t wu-border-gray-40 min-h-12 wu-card-footer",r)})});Ps.displayName="WuCardHeader";const sa=N.forwardRef(({className:e,partial:a,...r},s)=>t.jsx(Ze.Root,{ref:s,className:n("wu-h-4 wu-w-4 wu-shrink-0 wu-rounded-[2px] wu-bg-white wu-border wu-border-gray-subtle wu-ring-offset-background focus-visible:wu-outline-none focus-visible:wu-ring-2 focus-visible:wu-ring-ring focus-visible:wu-ring-offset-[1px] data-[state=checked]:wu-bg-blue-p data-[state=checked]:wu-text-white data-[state=checked]:wu-border-none data-[state=checked]:hover:wu-bg-blue-q hover:wu-bg-gray-20 hover:wu-border-blue-p wu-transition-all data-[state=checked]:disabled:wu-bg-gray-20","disabled:wu-cursor-not-allowed disabled:wu-opacity-50 disabled:data-[state=unchecked]:wu-bg-gray-20 disabled:hover:wu-border-gray-subtle disabled:wu-border-gray-subtle",e),...r,children:t.jsxs(Ze.Indicator,{className:n("wu-flex wu-items-center wu-justify-center wu-text-current"),children:[!a&&t.jsx("span",{className:"wm-check wu-text-base wu-leading-4"}),a&&t.jsx("span",{className:"wm-check-indeterminate-small wu-text-base wu-leading-4"})]})}));sa.displayName=Ze.Root.displayName;const te=d.forwardRef((e,a)=>{const{disabled:r,checked:s,Label:u,labelPosition:o="right",className:l,id:w=Be(),partial:i,onChange:c,required:f,readonly:p,...h}=e;return d.useEffect(()=>{h.defaultChecked!==void 0&&s!==void 0&&console.error("WuCheckbox: Both `checked` and `defaultChecked` cannot be used together. Use only one of them.")},[h.defaultChecked,s]),t.jsxs("div",{className:Fs({labelPosition:o,className:"wu-checkbox-container"}),dir:h.dir,children:[t.jsx(sa,{id:w,...h,partial:i,checked:s,disabled:r||p,onCheckedChange:c,className:n("wu-peer wu-checkbox",l),required:f,ref:a}),u&&t.jsx(Q,{htmlFor:w,className:"wu-w-full wu-checkbox-label",children:u})]})}),Fs=X.cva("wu-flex wu-items-center wu-gap-2 wu-w-fit",{variants:{labelPosition:{left:"wu-flex-row-reverse wu-text-right",right:"wu-flex-row"}}});te.displayName="WuCheckbox";const Bs=e=>{const{className:a,children:r,...s}=e;return t.jsx("span",{...s,className:n("wu-flex wu-items-center wu-justify-center wu-truncate wu-max-w-28 wu-w-fit wu-px-2 wu-py-1 wu-text-xs wu-bg-gray-20 wu-rounded-sm hover:wu-bg-gray-40 hover:wu-text-blue-q",a),children:r})},dt=N.forwardRef(({className:e,...a},r)=>t.jsx(G.Command,{ref:r,className:n("wu-flex wu-h-full wu-w-full wu-flex-col wu-overflow-hidden wu-rounded-md",e),...a}));dt.displayName=G.Command.displayName;const ua=N.forwardRef(({className:e,...a},r)=>t.jsx("div",{className:"wu-flex wu-items-center wu-border-b wu-px-3",children:t.jsx(G.Command.Input,{ref:r,className:n("wu-flex wu-h-11 wu-w-full wu-rounded-md wu-bg-transparent wu-py-3 wu-text-sm wu-outline-none wu-placeholder:wu-text-muted-foreground disabled:wu-cursor-not-allowed disabled:wu-opacity-50",e),...a})}));ua.displayName=G.Command.Input.displayName;const ct=N.forwardRef(({className:e,...a},r)=>t.jsx(G.Command.List,{ref:r,className:n("",e),...a}));ct.displayName=G.Command.List.displayName;const ft=N.forwardRef((e,a)=>t.jsx(G.Command.Empty,{ref:a,className:"wu-text-center wu-p-2 wu-pb-2.5 wu-text-xs",...e}));ft.displayName=G.Command.Empty.displayName;const qe=N.forwardRef(({className:e,...a},r)=>t.jsx(G.Command.Group,{ref:r,className:n("",e),...a}));qe.displayName=G.Command.Group.displayName;const oa=N.forwardRef(({className:e,...a},r)=>t.jsx(G.Command.Separator,{ref:r,className:n("wu-mx-1 wu-my-1 wu-h-px wu-bg-gray-20",e),...a}));oa.displayName=G.Command.Separator.displayName;const Ae=N.forwardRef(({className:e,...a},r)=>t.jsx(G.Command.Item,{ref:r,className:n("wu-relative wu-flex wu-cursor-default wu-gap-2 wu-select-none wu-items-center wu-rounded-sm wu-px-2 wu-py-3 wu-text-sm wu-outline-none data-[disabled=true]:wu-pointer-events-none data-[disabled=true]:wu-opacity-50 [&_svg]:wu-pointer-events-none [&_svg]:wu-size-4 [&_svg]:wu-shrink-0",e),...a}));Ae.displayName=G.Command.Item.displayName;const Se=d.forwardRef(({containerHeight:e=400,list:a,callback:r,dir:s,className:u,style:o},l)=>t.jsx(Gr.Virtuoso,{ref:l,dir:s,className:u,style:{height:e,scrollbarWidth:"thin",scrollbarColor:"#d4d4d4 #f1f1f1",overflowX:"hidden",...o},data:a,itemContent:(w,i)=>r(w,i)}));Se.displayName="WuVirtualScroll";const zs=({tags:e,triggerRef:a})=>{const[r,s]=d.useState([]),[u,o]=d.useState([]),l=d.useMemo(()=>t.jsx("ul",{className:"wu-flex wu-flex-col wu-items-start wu-justify-center wu-list-none",children:u.map((i,c)=>t.jsx("li",{className:"wu-py-1 wu-text-xs wu-text-left",children:i},c))}),[u]),w=i=>{const c=document.createElement("div");Object.assign(c.style,{display:"inline-block",visibility:"hidden",position:"absolute",whiteSpace:"nowrap"}),c.textContent=i,document.body.appendChild(c);const f=c.offsetWidth;return document.body.removeChild(c),f+8};return d.useEffect(()=>{const i=()=>{if(a.current){const h=a.current.offsetWidth-20-36;let m=0;const g=[],b=[];e.forEach(v=>{const S=w(v);m+S+8<h?(g.push(v),m+=S+8):b.push(v)}),s(g),o(b)}};return i(),window.addEventListener("resize",i),()=>{window.removeEventListener("resize",i)}},[e,a]),t.jsxs("div",{className:"wu-flex wu-items-center wu-gap-2 wu-text-xs",children:[r.map((i,c)=>t.jsx("span",{className:"wu-px-1 wu-py-0.5 wu-text-xs wu-rounded-sm wu-bg-gray-10 wu-combobox-tag",children:i},c)),u.length>0&&t.jsx(He,{content:l,className:"wu-z-[51] wu-text-left",children:t.jsxs("span",{className:"wu-px-1 wu-py-0.5 wu-text-xs wu-rounded-sm wu-bg-gray-10 wu-combobox-tag",children:["+",u.length]})})]})},Hs=({placeholder:e="Select...",isEllipse:a=!1,selectedOptions:r,variant:s="flat",dir:u="ltr",accessorKey:o,multiple:l,id:w,disabled:i,selectAll:c,isCheckedAll:f,className:p,...h})=>{const[m,g]=d.useState([]),b=d.useRef(null);d.useEffect(()=>{if(!r||Array.isArray(r)&&r.length===0){g([]);return}if(l){const S=r;g(S==null?void 0:S.map(y=>y[o.label]));return}else g([r[o.label]])},[r]);const v=()=>{var S;return m.length?f&&(c!=null&&c.enable)&&(c!=null&&c.triggerText)?t.jsx("span",{className:"wu-overflow-hidden wu-text-xs wu-text-start wu-text-ellipsis wu-whitespace-nowrap",children:c.triggerText}):a?t.jsx("span",{className:"wu-overflow-hidden wu-text-xs wu-text-start wu-text-ellipsis wu-whitespace-nowrap",style:{width:`${(((S=b.current)==null?void 0:S.offsetWidth)||0)-32}px`},children:m.join(", ")}):t.jsx(zs,{tags:m,triggerRef:b}):t.jsx("p",{className:"wu-text-xs wu-opacity-70",children:e})};return t.jsx(be,{dir:u,asChild:!0,id:w,disabled:i,children:t.jsxs("button",{...h,ref:b,disabled:i,className:n("focus-visible:wu-ring-2 focus-visible:wu-ring-blue-pHover wu-bg-white focus-visible:wu-ring-offset-2 wu-flex wu-w-full wu-items-center wu-justify-between wu-border-b wu-border-gray-subtle wu-py-1.5 wu-px-2 placeholder:wu-text-gray-40 focus:wu-outline-none disabled:wu-cursor-not-allowed disabled:wu-opacity-50 hover:wu-bg-gray-10 hover:wu-border-blue-p wu-transition-colors focus-visible:wu-bg-gray-20 focus-visible:wu-border-blue-p wu-cursor-pointer wu-text-xs wu-rounded-t-sm wu-gap-2 wu-h-8 wu-group",s==="outlined"&&"wu-border wu-border-gray-subtle","disabled:wu-cursor-not-allowed disabled:hover:wu-border-gray-subtle disabled:wu-bg-gray-10",p),children:[v(),t.jsx("span",{className:"wm-arrow-drop-down group-data-[state=open]:wu-rotate-180 wu-transition-transform wu-duration-300 wu-text-base"})]})})},la=L.Root,na=L.Trigger,wa=L.Group,js=L.Portal,$s=L.Sub,Us=L.RadioGroup,ia=N.forwardRef(({className:e,inset:a,children:r,position:s,...u},o)=>t.jsxs(L.SubTrigger,{ref:o,className:n("wu-flex wu-cursor-default wu-select-none wu-text-xs wu-items-center wu-p-3 wu-outline-none focus:wu-bg-gray-20 data-[state=open]:wu-bg-gray-20",a&&"wu-pl-8",e),...u,children:[s==="left"&&t.jsx("span",{className:n("wm-chevron-right",u.dir==="rtl"&&"ml-2")}),r,s!=="left"&&t.jsx("span",{className:n("wu-text-base wu-leading-4",u.dir==="rtl"&&"wu-mr-auto wm-chevron-left",u.dir!=="rtl"&&"wu-ml-auto wm-chevron-right")})]}));ia.displayName=L.SubTrigger.displayName;const da=N.forwardRef(({className:e,...a},r)=>t.jsx(L.SubContent,{ref:r,className:n("wu-z-50 wu-min-w-[8rem] wu-overflow-hidden wu-border wu-text-xs wu-bg-white wu-text-gray-lead wu-shadow-lg 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-[side=bottom]:wu-slide-in-from-top-2 data-[side=left]:wu-slide-in-from-right-2 data-[side=right]:wu-slide-in-from-left-2 data-[side=top]:wu-slide-in-from-bottom-2",e),...a}));da.displayName=L.SubContent.displayName;const pt=N.forwardRef(({className:e,sideOffset:a=4,...r},s)=>t.jsx(L.Portal,{children:t.jsx(L.Content,{ref:s,sideOffset:a,className:n("wu-z-50 wu-min-w-[8rem] wu-overflow-hidden wu-border wu-text-xs wu-bg-white wu-text-gray-lead wu-shadow-md 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-[side=bottom]:wu-slide-in-from-top-2 data-[side=left]:wu-slide-in-from-right-2 data-[side=right]:wu-slide-in-from-left-2 data-[side=top]:wu-slide-in-from-bottom-2",e),...r})}));pt.displayName=L.Content.displayName;const $e=N.forwardRef(({className:e,inset:a,...r},s)=>t.jsx(L.Item,{ref:s,className:n("wu-relative wu-flex wu-cursor-default wu-select-none wu-items-center wu-text-xs wu-p-2 wu-outline-none wu-transition-colors focus:wu-bg-gray-20 data-[disabled]:wu-cursor-not-allowed data-[disabled]:wu-opacity-50",a&&"wu-pl-8",e),...r}));$e.displayName=L.Item.displayName;const ca=N.forwardRef(({className:e,children:a,checked:r,dir:s,...u},o)=>t.jsxs(L.CheckboxItem,{ref:o,className:n("wu-group wu-relative wu-flex wu-cursor-default wu-select-none wu-items-center wu-text-xs wu-py-3 wu-outline-none wu-transition-colors focus:wu-bg-gray-20 data-[disabled]:wu-cursor-not-allowed data-[disabled]:wu-opacity-50",s==="rtl"&&"wu-pr-8 wu-pl-2",s!=="rtl"&&"wu-pl-8 wu-pr-2",e),checked:r,...u,children:[t.jsx("span",{className:n("wu-absolute wu-flex wu-items-center wu-justify-center wu-w-4 wu-h-4 wu-rounded-sm wu-ring-1 wu-ring-gray-subtle group-disabled:wu-bg-gray-20 group-data-[state=checked]:wu-bg-blue-p group-hover:wu-bg-gray-20 group-hover:wu-ring-blue-p wu-transition-all group-data-[state=checked]:wu-ring-blue-p",s==="rtl"&&"wu-right-2",s!=="rtl"&&"wu-left-2"),children:t.jsx(L.ItemIndicator,{children:t.jsx("span",{className:"wm-check wu-text-base wu-text-white"})})}),a]}));ca.displayName=L.CheckboxItem.displayName;const fa=N.forwardRef(({className:e,children:a,...r},s)=>t.jsxs(L.RadioItem,{ref:s,className:n("wu-group wu-relative wu-flex wu-cursor-default wu-select-none wu-items-center wu-text-xs wu-py-3 wu-pl-8 wu-pr-2 wu-outline-none wu-transition-colors focus:wu-bg-gray-20 focus:wu-text-accent-foreground data-[disabled]:wu-cursor-not-allowed data-[disabled]:wu-opacity-50",e),...r,children:[t.jsx("span",{className:"wu-absolute wu-rounded-full wu-left-2 wu-flex wu-h-4 wu-w-4 wu-items-center wu-justify-center wu-ring-1 wu-ring-gray-subtle group-disabled:wu-bg-gray-20 group-data-[state=checked]:wu-bg-white group-hover:wu-bg-gray-20 group-hover:wu-ring-blue-p wu-transition-all group-data-[state=checked]:wu-ring-blue-p group-hover:group-data-[state=checked]:wu-ring-blue-q",children:t.jsx(L.ItemIndicator,{className:"wu-w-4 wu-h-4 wu-flex wu-items-center wu-justify-center",children:t.jsx("span",{className:"wm-circle wu-text-blue-p group-hover:group-data-[state=checked]:wu-text-blue-q wu-text-xs"})})}),a]}));fa.displayName=L.RadioItem.displayName;const Oe=N.forwardRef(({className:e,inset:a,...r},s)=>t.jsx(L.Label,{ref:s,className:n("wu-p-2 wu-font-medium wu-text-xs",a&&"wu-pl-8",e),...r}));Oe.displayName=L.Label.displayName;const Ue=N.forwardRef(({className:e,...a},r)=>t.jsx(L.Separator,{ref:r,className:n("-wu-mx-1 wu-my-1 wu-h-px wu-bg-gray-20",e),...a}));Ue.displayName=L.Separator.displayName;const pa=({option:e,value:a,multiple:r=!1,onSelect:s,accessorKey:u,dir:o})=>{const[l,w]=d.useState(r?[]:"");d.useEffect(()=>{a&&w(r?a.map(p=>JSON.stringify(p[u.value])):JSON.stringify(a[u.value]))},[a,u.value,r]);const i=r?l.includes(JSON.stringify(e[u.value])):l===JSON.stringify(e[u.value]),c=()=>{e.disabled||s(e)};return t.jsxs(Ae,{onSelect:c,disabled:e.disabled,className:n("wu-cursor-pointer wu-text-xs wu-items-start wu-leading-4 wu-py-2 wu-combobox-item hover:wu-bg-gray-100",i&&"wu-bg-gray-10"),dir:o,children:[r&&t.jsx(te,{checked:i}),t.jsx(Gs,{option:e,accessorKey:u})]})},Gs=({option:e,accessorKey:a})=>{const r=e[a.label];return t.jsxs("div",{className:"wu-flex wu-items-center wu-w-full wu-gap-1",children:[e.icon&&e.icon,r,e.isAdmin&&t.jsx("span",{className:"wu-ml-auto wu-text-sm wm-lock wu-text-orange-deep"})]})},ba=e=>{const{option:a,selectAll:r,handleSelectAll:s,isCheckedAll:u,isPartialSelected:o,...l}=e;switch("type"in a?a.type:"option"){case"all":return t.jsx(Ae,{onSelect:s,className:n("wu-cursor-pointer wu-text-xs wu-leading-4 wu-py-2 wu-combobox-item"),dir:l.dir,children:t.jsx(te,{checked:u||o,partial:o,"data-partial":o,Label:(r==null?void 0:r.label)||"Select All"})});case"group":return t.jsxs(qe,{children:[t.jsx(Oe,{children:a.label}),a.options.map((i,c)=>d.createElement(pa,{...l,option:i,key:c}))]});case"divider":return t.jsx(oa,{className:"wu-mx-4"});default:return t.jsx(pa,{...l,option:a})}},Vs=e=>{const a=[],r=[],s=[],u=[];return e.forEach(o=>{o.type==="group"?(a.push(o),s.push(...o.options),u.push(...o.options.filter(l=>!l.disabled))):o.type==="divider"?r.push(o):s.push(o),o!=null&&o.disabled||u.push(o)}),{groups:a,dividers:r,allOptions:s,enabledOptions:u}},Ys=d.memo(pe),Js=({data:e,accessorKey:a,value:r,defaultValue:s,Header:u,virtualizedThreshold:o=100,isEllipse:l,placeholder:w,variant:i,dir:c,onSelect:f,Label:p,maxHeight:h=420,multiple:m=!1,hasGroup:g=!1,selectAll:b,id:v,disabled:S,labelPosition:y="top",className:C,onScroll:D,maxContentWidth:k,...I})=>{const[W,T]=d.useState(""),[M,q]=d.useState(),[$,_]=d.useState(!1),[P,Y]=d.useState(!1),[H,ae]=d.useState(!1),me=d.useRef(null),{allOptions:re,groups:xe,dividers:Te,enabledOptions:we}=d.useMemo(()=>g||b&&!b.includeDisabled?Vs(e):{allOptions:e,groups:[],dividers:[],enabledOptions:[]},[e,g]),ue=d.useMemo(()=>{if(!W)return e;const B=W.toLowerCase();return re.filter(se=>se[a.label].toLowerCase().includes(B))},[W,re,e,a.label]),E=d.useMemo(()=>m&&b!=null&&b.enable&&!W&&ue.length>0?[{type:"all"},...ue]:ue,[ue,W,m]),z=d.useMemo(()=>{const B=32*E.length+Te.length*9+xe.length*48;return Math.min(h,B)},[h,E,Te,xe]),J=d.useCallback(B=>{const se=B[a.value];m?q(Go=>{const qt=Go||[],Fr=qt.some(At=>At[a.value]===se)?qt.filter(At=>At[a.value]!==se):[...qt,B];return f==null||f(Fr),Fr}):(_(!1),q(B),f==null||f(B))},[m,a.value,f]),U=d.useCallback(B=>T(B.target.value),[]),_t=d.useCallback(()=>T(""),[]);d.useEffect(()=>{if(r!==void 0&&s!==void 0){console.error("defaultValue and value cannot be used simultaneously");return}else r!==void 0?q(r):s!==void 0&&q(s)},[r,s]),d.useEffect(()=>{if(!m)return;const B=b!=null&&b.includeDisabled?(M==null?void 0:M.length)===re.length:(M==null?void 0:M.length)===we.length;Y(B);const se=(M==null?void 0:M.length)>0&&!B;ae(se)},[M,b]);const ie=d.useCallback(()=>{const B=P?[]:b!=null&&b.includeDisabled?re:we;q(B),f==null||f(B)},[P,m,re,we,f,b]),oe=Ee(y);return t.jsxs("div",{className:n(oe,"wu-flex wu-combobox-container"),ref:me,children:[t.jsxs(ee,{onOpenChange:B=>{B&&_t(),_(B)},open:$,modal:!0,children:[t.jsx(Hs,{...I,selectedOptions:M,accessorKey:a,isEllipse:l,placeholder:w,variant:i,dir:c,multiple:m,disabled:S,selectAll:b,isCheckedAll:P,className:C,id:v}),t.jsx(Z,{className:"wu-min-w-[--radix-popover-trigger-width] wu-max-w-[calc(100vw-32px)] wu-p-0 wu-bg-white wu-border wu-border-blue-p wu-combobox-content",align:"start",sideOffset:-1,style:{maxWidth:k},children:t.jsxs(dt,{id:v,children:[t.jsx("div",{className:"wu-m-2",children:t.jsx(Ys,{placeholder:"Search...",Icon:t.jsx("span",{className:"wm-search"}),className:"wu-text-xs wu-combobox-search",onChange:U,name:"Search","aria-label":"Search",dir:c,iconPosition:c==="rtl"?"right":"left"})}),u,t.jsxs(ct,{children:[t.jsx(ft,{children:"No results found."}),E.length>=o?t.jsx(Se,{className:"wu-combobox-list",containerHeight:h,list:E,callback:(B,se)=>t.jsx(ba,{option:se,value:M,onSelect:J,multiple:m,accessorKey:a,dir:c,selectAll:b,handleSelectAll:ie,isCheckedAll:P,isPartialSelected:H},B),dir:c}):t.jsx("div",{style:{maxHeight:z,height:"fit-content",overflow:"auto"},className:"wu-combobox-list",onScroll:D,children:E.map((B,se)=>t.jsx(ba,{option:B,value:M,onSelect:J,multiple:m,accessorKey:a,dir:c,selectAll:b,handleSelectAll:ie,isCheckedAll:P,isPartialSelected:H},se))})]})]})})]}),p&&t.jsx(Q,{htmlFor:v,className:"wu-combobox-label",children:p})]})},Ks=e=>{const{textToCopy:a,notificationText:r,...s}=e,[u,o]=d.useState(!1),l=async()=>{if(a)try{await navigator.clipboard.writeText(a),o(!0),setTimeout(()=>o(!1),2e3)}catch(w){console.error("Failed to copy:",w)}};return t.jsxs(V,{...s,onClick:l,variant:"iconOnly",className:n("wu-relative",e.className),"aria-label":"Copy to clipboard",children:[r&&t.jsx("span",{className:n("wu-absolute wu-text-[6px] wu-leading-3 -wu-top-4 wu-right-0 wu-bg-gray-notification wu-text-white wu-rounded-sm wu-shadow-md wu-px-1 wu-animate-ping-once",u?"wu-block":"wu-hidden"),children:r}),t.jsx(le,{icon:"wm-content-copy",className:"wu-text-lg"})]})},ha=O.Root,Xs=O.Trigger,Qs=O.Close,Zs=O.Portal,ga=N.forwardRef(({className:e,...a},r)=>t.jsx(O.Overlay,{className:n("wu-fixed wu-inset-0 wu-z-50 wu-bg-black/30 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",e,"wu-drawer-overlay"),...a,ref:r}));ga.displayName=O.Overlay.displayName;const Rs=X.cva("wu-fixed wu-z-50 wu-gap-4 wu-p-6 wu-shadow-lg wu-transition wu-ease-in-out data-[state=open]:wu-animate-in data-[state=closed]:wu-animate-out data-[state=closed]:wu-duration-500 data-[state=open]:wu-duration-500",{variants:{side:{top:"wu-inset-x-0 wu-top-0 wu-border-b data-[state=closed]:wu-slide-out-to-top data-[state=open]:wu-slide-in-from-top",bottom:"wu-inset-x-0 wu-bottom-0 wu-border-t data-[state=closed]:wu-slide-out-to-bottom data-[state=open]:wu-slide-in-from-bottom",left:"wu-inset-y-0 wu-left-0 wu-h-full wu-w-3/4 wu-border-r data-[state=closed]:wu-slide-out-to-left data-[state=open]:wu-slide-in-from-left sm:wu-max-w-sm",right:"wu-inset-y-0 wu-right-0 wu-h-full wu-w-3/4 wu-border-l data-[state=closed]:wu-slide-out-to-right data-[state=open]:wu-slide-in-from-right sm:wu-max-w-sm"}},defaultVariants:{side:"right"}}),bt=N.forwardRef(({side:e="right",className:a,children:r,hideCloseButton:s,...u},o)=>t.jsxs(Zs,{children:[t.jsx(ga,{}),t.jsxs(O.Content,{ref:o,className:n(Rs({side:e}),a),...u,children:[r,!s&&t.jsx(O.Close,{"aria-label":"close",asChild:!0,children:t.jsxs(Ne,{variant:"iconOnly",className:"wu-absolute wu-right-4 wu-top-4",children:[t.jsx("span",{className:"wm-close"}),t.jsx("span",{className:"wu-sr-only",children:"Close"})]})})]})]}));bt.displayName=O.Content.displayName;const ma=({className:e,...a})=>t.jsx("div",{className:n("",e),...a});ma.displayName="SheetHeader";const ht=N.forwardRef(({className:e,...a},r)=>t.jsx(O.Title,{ref:r,className:n("wu-text-lg wu-font-semibold",e),...a}));ht.displayName=O.Title.displayName;const xa=N.forwardRef(({className:e,...a},r)=>t.jsx(O.Description,{ref:r,className:n("wu-text-sm",e),...a}));xa.displayName=O.Description.displayName;const eu=e=>a=>{e&&a.preventDefault()},tu=e=>{const{Trigger:a,children:r,hideCloseButton:s,className:u,side:o="left",open:l,onOpenChange:w,preventClickOutside:i,...c}=e;return t.jsxs(ha,{open:l,onOpenChange:w,children:[t.jsx(Xs,{asChild:!0,children:a}),t.jsxs(bt,{...c,onInteractOutside:eu(i),side:o,className:n("wu-bg-white wu-text-gray-lead wu-px-0",u),hideCloseButton:s,children:[t.jsx("div",{className:"wu-hidden",children:t.jsx(ht,{})}),r]})]})},au=({children:e,...a})=>t.jsx(Qs,{...a,children:e}),ya=({className:e,isLoading:a,loadingText:r,children:s,...u})=>t.jsxs("footer",{className:n("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),...u,children:[t.jsx("div",{className:"wu-flex-1",children:s}),a&&t.jsx(Ce,{size:"16px",variant:"spinner",color:"#a3a3a3",message:r})]});ya.displayName="WuFooter";const va=d.forwardRef((e,a)=>{const{size:r="sm",idOrSlugOrUrl:s,variant:u="primary",...o}=e,l=r==="sm"?16:18,w=s.includes("http")?s:`/help/${s}.html`,i=u==="primary"?"wu-text-blue-p":"wu-text-gray-lead";return t.jsx("button",{...o,ref:a,onClick:()=>et(w),children:t.jsx("span",{className:n("wm-help wu-text-gray-subtle",`wu-text-[${l}px]`,i,o.disabled&&"wu-text-neutral-300","wu-help-button-icon")})})});va.displayName="WuHelpButton";const ne=(e,a)=>`wu-listbox-${e}`;function ru(e){const{option:a,accessorKey:r,onSelect:s,multiple:u,dir:o,GroupLabel:l,Item:w,isSelected:i,...c}=e,f=r.group&&Array.isArray(a[r.group]),p=({item:h,className:m})=>d.createElement(Ae,{...c,key:JSON.stringify(h),onSelect:()=>s==null?void 0:s(h),value:a[r.value],className:n("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",!!(i!=null&&i(h))&&!u&&"wu-bg-blue-p/10",o==="rtl"&&"wu-justify-end",m,ne("item")),disabled:h.disabled},u&&t.jsx(te,{checked:i==null?void 0:i(h)}),w?w({value:h,isSelected:i==null?void 0:i(h)}):t.jsx(t.Fragment,{children:h[r.label]}));if(f){const h=a[r.group],m=typeof l=="string"?a[l]:l==null?void 0:l(a);return t.jsx(qe,{heading:m,children:h==null?void 0:h.map(g=>t.jsx(p,{item:g,className:"wu-pl-6"},JSON.stringify(g)))})}return t.jsx(p,{item:a})}const su=d.memo(ru),uu=e=>{const{className:a,...r}=e;return t.jsxs("div",{className:"wu-relative",children:[t.jsx(le,{icon:"wm-search",className:"wu-absolute wu-top-[14px] wu-left-5"}),t.jsx(ua,{...r,"aria-label":"Search",className:n("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;",ne("input"),a)})]})},ou=e=>{const{label:a,onSelectAll:r,data:s,value:u}=e,[o,l]=d.useState(!1),[w,i]=d.useState(!1);return d.useEffect(()=>{!u||!s||(l(u.length>0),i(u.length>0&&u.length<s.length))},[s,u]),t.jsxs(Ae,{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:()=>r==null?void 0:r(!o),children:[t.jsx(te,{checked:o,partial:w}),a||"Select All"]})},lu=e=>{const{CustomTrigger:a,disabled:r,value:s,placeholder:u,accessorKey:o,Chip:l,handleUnselect:w,variant:i,dir:c,className:f,...p}=e,[h,m]=d.useState(),g=d.useRef(null);return d.useEffect(()=>{if(!s){m(null);return}m(Array.isArray(s)?l?s.map((v,S)=>l({value:v,unselect:w,key:S})):s.map(v=>v[o.label]).join(", "):l?l({value:s,unselect:w}):s[o.label])},[s,l,o.label,m]),t.jsx(be,{asChild:!0,id:e.id,disabled:r,ref:g,children:(a==null?void 0:a(s))||t.jsxs("button",{...p,className:n("wu-group 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",i==="outlined"&&"wu-border wu-border-gray-subtle wu-bg-white",f,ne("trigger")),children:[t.jsx("div",{className:n("wu-truncate",l&&"wu-flex wu-items-center wu-gap-1 wu-flex-wrap",!h&&"wu-font-light"),children:h||u}),t.jsx(le,{icon:"wm-arrow-drop-down",className:n("wu-absolute wu-top-1 wm-arrow-drop-down group-data-[state=open]:wu-rotate-180 wu-transition-transform wu-duration-300 wu-text-base",c==="rtl"?"wu-left-1":"wu-right-1",ne("drop-icon"))})]})})},Na=(e,a,r)=>{const s=String(e[r.label]??"").toLowerCase(),u=String(e[r.value]??"").toLowerCase();return s.includes(a)||u.includes(a)},nu=(e,a,r)=>{const s=a.trim();if(s==="")return e;const u=s.toLowerCase(),o=[];for(const l of e){const w=r.group,i=w?l[w]:void 0;if(Array.isArray(i)){const c=i.filter(f=>Na(f,u,r));c.length>0&&o.push({...l,[w]:c})}else Na(l,u,r)&&o.push(l)}return o},wu=e=>{const{data:a,accessorKey:r,value:s,Item:u,Label:o,GroupLabel:l,CustomHeader:w,CustomTrigger:i,NoDataContent:c,Chip:f,onSelect:p,onScroll:h,disabled:m,multiple:g,searchable:b,selectAll:v,virtualizedThreshold:S=100,id:y,dir:C,className:D,listClass:k,placeholder:I="Select items...",variant:W,labelPosition:T="top",maxContentWidth:M,maxContentHeight:q}=e,[$,_]=d.useState(!1),[P,Y]=d.useState(""),[H,ae]=d.useState(s),me=d.useMemo(()=>r,[r]),re=d.useMemo(()=>{if(!b||!P)return a;const E=P.toLowerCase().trim();return nu(a,E,r)},[a,P,r.label,b]),xe=E=>{g?ae(z=>{const J=E[r.value],U=Array.isArray(z)?z:[],ie=U.some(oe=>oe[r.value]===J)?U.filter(oe=>oe[r.value]!==J):[...U,E];return p&&p(ie),ie}):(ae(E),p&&p(E),_(!1))},Te=d.useCallback(E=>{const z=E?a:[];ae(z),v!=null&&v.onSelectAll&&v.onSelectAll(E),p&&p(z)},[a,v,p]),we=E=>Array.isArray(H)?H.some(z=>z[r.value]===E[r.value]):(H==null?void 0:H[r.value])===E[r.value];d.useEffect(()=>{ae(s)},[s]);const ue=E=>{const z=J=>t.jsx(su,{option:J,accessorKey:me,multiple:g,onSelect:U=>xe(U),dir:C,GroupLabel:l,Item:u,isSelected:U=>we(U)},JSON.stringify(J));return E.length>S?t.jsx(Se,{list:E,callback:(J,U)=>z(U),dir:C}):E.map(z)};return t.jsxs("div",{className:n("wu-flex wu-text-sm wu-gap-2",T==="top"&&"wu-flex-col wu-gap-1",T==="left"&&"wu-flex-row",T==="right"&&"wu-flex-row-reverse",ne("container")),dir:C,children:[o&&t.jsx(Q,{htmlFor:y,className:ne("label"),children:o}),t.jsxs(ee,{open:$,onOpenChange:E=>{_(E),E||setTimeout(()=>{Y("")},100)},children:[t.jsx(lu,{CustomTrigger:i,disabled:m,value:H,accessorKey:r,placeholder:I,Chip:f,className:D,handleUnselect:xe,variant:W,id:y,dir:C}),t.jsx(Z,{className:n("wu-min-w-[--radix-popover-trigger-width] wu-max-w-[calc(100vw-32px)] wu-p-0 wu-bg-white wu-border wu-border-blue-p",ne("content")),align:"start",sideOffset:-1,style:{maxWidth:M},children:t.jsxs(dt,{id:e.id,shouldFilter:!1,children:[b&&t.jsx(uu,{value:P,onValueChange:Y}),w,t.jsxs(ct,{className:n("wu-overflow-y-auto",ne("list"),k),onScroll:h,style:{maxHeight:q||"420px"},children:[t.jsx(ft,{children:c||"No results found."}),t.jsx(qe,{children:g&&(v==null?void 0:v.enabled)&&!P&&t.jsx(ou,{data:a,value:H,onSelectAll:Te,label:v.label})}),t.jsx(qe,{children:ue(re)})]})]})})]})]})},iu=e=>{const{checked:a,onSelect:r,children:s,disabled:u,preventCloseOnSelect:o}=e;return t.jsx(ca,{disabled:u,checked:a,onCheckedChange:r,onSelect:l=>o&&l.preventDefault(),children:s})},gt=e=>{const{children:a,className:r,Icon:s,iconPosition:u="left",disabled:o,onSelect:l,preventCloseOnSelect:w}=e,i=n("wu-flex wu-items-center wu-gap-2",s&&(u==="left"?"":"wu-justify-between wu-flex-row-reverse"),r),c=f=>{l&&l(f),w&&f.preventDefault()};return t.jsxs($e,{onSelect:c,disabled:o,className:i,children:[s&&t.jsx("div",{className:"wu-text-base",children:s}),a]})},du=e=>{const{children:a,...r}=e;return t.jsxs(wa,{...r,children:[t.jsx(Oe,{children:e.label}),a]})},cu=e=>{const{options:a,value:r,onSelect:s}=e;return t.jsx(Us,{value:r,onValueChange:s,children:a.map(u=>t.jsx(fa,{value:u.value,disabled:u.disabled,children:u.label},u.value))})},fu=e=>{const{className:a,...r}=e,s=n("wu-w-11/12 wu-mx-auto wu-border-gray-40",a);return t.jsx(Ue,{...r,className:s})},ke=N.forwardRef(({className:e,children:a,thumbColor:r,railColor:s,...u},o)=>t.jsxs(ce.Root,{ref:o,className:n("wu-relative wu-overflow-hidden",e),children:[t.jsx(ce.Viewport,{className:"wu-h-full wu-w-full wu-rounded-[inherit]",...u,children:a}),t.jsx(mt,{thumbColor:r,railColor:s}),t.jsx(ce.Corner,{})]}));ke.displayName=ce.Root.displayName;const mt=N.forwardRef(({className:e,orientation:a="vertical",thumbColor:r="#d4d4d4",railColor:s="#eeeeee",...u},o)=>t.jsx(ce.ScrollAreaScrollbar,{ref:o,orientation:a,className:n("wu-flex wu-touch-none wu-select-none wu-transition-colors",a==="vertical"&&"wu-h-full wu-w-2 wu-border-l wu-border-l-transparent wu-p-[1px]",a==="horizontal"&&"wu-h-2 wu-flex-col wu-border-t wu-border-t-transparent wu-p-[1px]",e),style:{background:s},...u,children:t.jsx(ce.ScrollAreaThumb,{className:"wu-relative wu-flex-1 wu-rounded-full",style:{background:r}})}));mt.displayName=ce.ScrollAreaScrollbar.displayName;const pu=e=>{const{children:a,label:r,open:s,onOpenChange:u,height:o,dir:l,...w}=e;return t.jsxs($s,{...w,open:s,onOpenChange:u,children:[t.jsx(ia,{dir:l,children:r}),t.jsx(js,{children:t.jsx(da,{onInteractOutside:i=>i.preventDefault(),children:t.jsx(ke,{className:"wu-h-fit",style:{height:o},dir:l,children:a})})})]})},bu="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",Ca=e=>{const{children:a,menuTitle:r,variant:s="flat",name:u,open:o,onOpenChange:l,height:w,preventCloseOnClickOutside:i,dir:c,Trigger:f,align:p="start",sideOffset:h=0,side:m="bottom",alignOffset:g,className:b,disabled:v,...S}=e;return t.jsxs(la,{...S,open:o,onOpenChange:l,dir:c,children:[t.jsx(na,{asChild:!0,dir:c,disabled:v,className:n("disabled:wu-text-zinc-300 disabled:wu-bg-white disabled:wu-cursor-not-allowed disabled:hover:wu-bg-transparent"),children:f??hu(s,u,v)}),t.jsx(pt,{className:n("wu-w-56 wu-border wu-border-blue-p disabled:wu-border-gray-40",b,"wu-menu-content"),align:p,sideOffset:h,side:m,alignOffset:g,onInteractOutside:y=>i&&y.preventDefault(),children:t.jsxs(ke,{className:"h-fit",style:{height:w},dir:c,children:[r&&t.jsxs(t.Fragment,{children:[t.jsx(Oe,{dir:c,className:"wu-menu-title",children:r}),t.jsx(Ue,{className:"wu-mt-0 wu-menu-separator",dir:c})]}),a??t.jsx("p",{children:"Menu Is Empty"})]})})]})},hu=(e,a,r)=>{const s=n(bu,"wu-flex wu-items-center wu-justify-between wu-gap-2 wu-h-8 wu-text-xs wu-group",e==="outlined"?"wu-border":"wu-border-b","wu-trigger-btn");return t.jsxs("button",{className:s,"aria-label":"menu-trigger",children:[t.jsx("span",{children:a??"Menu"}),t.jsx("span",{className:n("wm-arrow-drop-down wu-text-gray-lead wu-text-base wu-rotate-180 group-data-[state=closed]:wu-rotate-0 wu-transition-transform wu-duration-300 group-hover:wu-text-blue-q",r&&"wu-text-zinc-300 group-hover:wu-text-zinc-300")})]})},xt=d.forwardRef(({showMenu:e=!1,className:a,color:r="#1B3380",...s},u)=>{const o=n("wu-w-full wu-border wu-transition-all wu-duration-300");return t.jsxs("div",{...s,className:n("wu-flex wu-flex-col wu-w-[18px] wu-justify-between wu-aspect-[3/2] wu-transition-all wu-duration-300",a),ref:u,"aria-label":"menu-icon",children:[t.jsx("div",{className:`${o} wu-origin-center ${e?"wu-rotate-45 wu-translate-y-[5px]":""}`,style:{borderColor:r}}),t.jsx("div",{className:`${o} ${e?"wu-opacity-0":""}`,style:{borderColor:r}}),t.jsx("div",{className:`${o} wu-origin-center ${e?"-wu-rotate-45 -wu-translate-y-[5px]":""}`,style:{borderColor:r}})]})});xt.displayName="WuMenuIcon";const Sa={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%]"},gu=O.Root,mu=O.Trigger,xu=O.Portal,yu=O.Close,ka=d.forwardRef(({className:e,...a},r)=>t.jsx(O.Overlay,{ref:r,className:n("wu-fixed wu-inset-0 wu-z-50 wu-bg-black/30",Sa.overlay,e),...a}));ka.displayName=O.Overlay.displayName;const Ta=d.forwardRef(({className:e,children:a,hideCloseButton:r,...s},u)=>t.jsxs(xu,{children:[t.jsx(ka,{}),t.jsxs(O.Content,{ref:u,className:n("wu-fixed wu-left-[50%] wu-top-[50%] wu-z-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",Sa.content,e),...s,children:[a,!r&&t.jsx(O.Close,{"aria-label":"close",asChild:!0,children:t.jsxs(Ne,{variant:"iconOnly",className:n("wu-absolute wu-right-2 wu-top-1 hover:wu-bg-gray-lead/10","wuexp:wu-top-[18px] wuexp:wu-right-4 wuexp:wu-p-1.5 wuexp:hover:wu-bg-wuexp-gray-lead/10","wuexp:group-data-[variant=action]:wu-text-blue-q","wuexp:group-data-[variant=upgrade]:wu-text-yellow-deep","wuexp:group-data-[variant=critical]:wu-text-red-deep"),children:[t.jsx("span",{className:"wu-text-lg wm-close wuexp:wu-text-xl wuexp:wu-leading-5"}),t.jsx("span",{className:"wu-sr-only",children:"Close"})]})})]})]}));Ta.displayName=O.Content.displayName;const Da=({className:e,...a})=>t.jsx("div",{className:n("wu-text-center wu-bg-gray-20 wu-w-full",e),...a});Da.displayName="DialogHeader";const Ma=({className:e,...a})=>t.jsx("div",{className:n("wu-flex wu-flex-col-reverse sm:wu-flex-row sm:wu-justify-end sm:wu-space-x-2 wu-p-4",e),...a});Ma.displayName="DialogFooter";const Ia=d.forwardRef(({className:e,...a},r)=>t.jsx(O.Title,{ref:r,className:n("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),...a}));Ia.displayName=O.Title.displayName;const vu=d.forwardRef(({className:e,...a},r)=>t.jsx(O.Description,{ref:r,className:n("wu-text-sm wu-text-muted-foreground",e),...a}));vu.displayName=O.Description.displayName;const Nu={gradientBackground:"_gradientBackground_1bbet_1"},Wa=e=>{const{colors:a,size:r=.55,children:s,className:u,strokeWidth:o,centerOffset:l={x:0,y:0},...w}=e,i=d.useRef(null);return d.useEffect(()=>{const c=i.current;if(c){c.style.setProperty("--width",`${c.offsetWidth*r}px`),c.style.setProperty("--height",`${c.offsetHeight*r}px`),c.style.setProperty("--colors",a.join(",")),c.style.setProperty("--stroke-width",`-${o||2}px`),c.style.setProperty("--spotlight-background","radial-gradient(100% var(--height) ellipse at 25% 70%, var(--colors))");let p;const h=m=>{p&&cancelAnimationFrame(p),p=requestAnimationFrame(()=>{const g=c.getBoundingClientRect();let b=m.clientX-g.left,v=m.clientY-g.top;b=Math.max(0,Math.min(b+l.x,g.width)),v=Math.max(0,Math.min(v+l.y,g.height));const S=`radial-gradient(
2
+ var(--width) var(--height) ellipse at ${b}px ${v}px,
3
+ var(--colors)
4
+ )`;c.style.setProperty("--spotlight-background",S)})};return window.addEventListener("mousemove",h),()=>{window.removeEventListener("mousemove",h),p&&cancelAnimationFrame(p)}}},[a,r,o,l]),t.jsx("div",{ref:i,className:n(Nu.gradientBackground,"wu-transform-gpu",u),...w,children:s})},Ea="600px",Cu={sm:"400px",md:"600px",lg:"1200px"},Su=({Trigger:e,children:a,size:r="md",hideCloseButton:s,preventClickOutside:u,onOpenChange:o,open:l,dir:w,maxWidth:i,maxHeight:c,className:f,style:p,variant:h="action",...m})=>{const g={action:["#1D50F4c0 84%","#EEF3FBc0"],upgrade:["#FF9F00c0 84%","#FDEDCCc0"],critical:["#CC0000c0 84%","#FFB6B6c0"]};return t.jsxs(gu,{modal:!0,onOpenChange:o,open:l,children:[e&&t.jsx(mu,{asChild:!0,children:e}),t.jsxs(Ta,{style:{width:"calc(100% - 64px)",maxWidth:i||Cu[r],maxHeight:c||Ea,...p},hideCloseButton:s,onInteractOutside:b=>u&&b.preventDefault(),dir:w,"aria-describedby":void 0,"data-variant":h,className:n("wu-group wuexp:wu-rounded-2xl",f),...m,children:["data-theme"in m&&t.jsx(Wa,{colors:g[h],strokeWidth:4,className:n("wuexp:wu-rounded-2xl wuexp:wu-text-wuexp-gray-lead wu-transform-gpu wu-flex wu-flex-col",f),style:{maxHeight:c||Ea},children:a}),!("data-theme"in m)&&a]})]})},ku=({children:e,style:a={},...r})=>t.jsx("div",{className:n("wu-flex wu-flex-col wu-gap-4 wu-px-3 wu-py-4 rtl:wu-text-right wu-overflow-auto wu-bg-white","wuexp:wu-p-8"),children:t.jsx("div",{...r,style:{...a,paddingLeft:`${(Number(a==null?void 0:a.paddingLeft)||0)+4}px`,paddingRight:`${(Number(a==null?void 0:a.paddingRight)||0)+4}px`},children:e})}),Tu=({children:e,className:a,...r})=>t.jsx(Da,{...r,"data-variant":"action",className:n("wu-text-lg wu-text-gray-lead wu-font-medium","wuexp:wu-rounded-t-xl wuexp:wu-px-4 wuexp:wu-py-[15px]","wuexp:group-data-[variant=action]:wu-bg-blue-sidebar wuexp:group-data-[variant=action]:wu-text-blue-q","wuexp:group-data-[variant=critical]:wu-bg-[#F9E0E0] wuexp:group-data-[variant=critical]:wu-text-red-deep","wuexp:group-data-[variant=upgrade]:wu-bg-[#FEF1D9] wuexp:group-data-[variant=upgrade]:wu-text-yellow-deep",a),children:t.jsx(Ia,{className:"wuexp:wu-font-normal wuexp:wu-justify-start wuexp:wu-text-[28px] wuexp:wu-h-auto wuexp:wu-leading-[34px]",children:e})}),Du=({children:e,className:a,...r})=>t.jsx(Ma,{...r,className:n("wu-border-t wu-border-gray-40 wu-bg-white wu-min-h-16 wu-mx-4 wu-px-0","wuexp:wu-mx-0 wuexp:wu-rounded-b-xl wuexp:wu-min-h-16 wuexp:wu-p-4","wuexp:group-data-[variant=upgrade]:wu-border-[#EED6A8]","wuexp:group-data-[variant=action]:wu-border-[#BAC9F8]","wuexp:group-data-[variant=critical]:wu-border-[#F0B3B3]",a),children:e}),Mu=({children:e,className:a,...r})=>{const s=d.useRef(null);return t.jsx(yu,{asChild:!0,children:t.jsx(V,{className:a,ref:s,...r,children:e})})},Iu=({placeholder:e="Select...",value:a,multiple:r=!1,accessorKey:s,variant:u="flat",dir:o="ltr",customTriggerChildren:l,id:w,disabled:i,selectAll:c,isCheckedAll:f,width:p,...h})=>{const[m,g]=d.useState(""),[b,v]=d.useState(e);d.useEffect(()=>{if(!a||Array.isArray(a)&&a.length===0){v(e),g("");return}const y=s.label;if(r&&Array.isArray(a)){const C=a.map(D=>D[y]).join(", ");g(C)}else!r&&!Array.isArray(a)&&g(a[y])},[a,s.label,r,e]);const S=()=>e&&!m?t.jsx("p",{className:"wu-text-xs wu-opacity-70",children:b}):t.jsx("span",{className:n("wu-overflow-hidden wu-text-xs wu-text-start wu-text-ellipsis wu-whitespace-nowrap"),style:{width:`${(p||0)-32}px`},children:f?(c==null?void 0:c.triggerText)??m:m});return t.jsx(na,{asChild:!0,dir:o,id:w,disabled:i,children:t.jsxs("button",{...h,disabled:i,className:n("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",u==="outlined"&&"wu-border wu-border-gray-subtle","wu-group wu-select-trigger",h.className),children:[l??S(),t.jsx("span",{className:"wm-arrow-drop-down group-data-[state=open]:wu-rotate-180 wu-transition-transform wu-duration-300 wu-text-base"})]})})},_a=({option:e,value:a,multiple:r=!1,onSelect:s,accessorKey:u,dir:o="ltr"})=>{const[l,w]=d.useState(r?[]:"");d.useEffect(()=>{a&&w(r?a.map(p=>JSON.stringify(p[u.value])):JSON.stringify(a[u.value]))},[a,u.value,r]);const i=r?l.includes(JSON.stringify(e[u.value])):l===JSON.stringify(e[u.value]),c=f=>{e.disabled||(s(e),r&&f.preventDefault())};return t.jsxs($e,{onClick:c,disabled:e.disabled,className:n("wu-cursor-pointer wu-text-xs wu-py-2 wu-leading-4 wu-select-item wu-items-start",i&&"wu-bg-gray-10"),dir:o,children:[r&&t.jsx(te,{checked:i}),t.jsx(qa,{option:e,accessorKey:u})]})},qa=({option:e,accessorKey:a})=>{const r=String(e[a.label]);return t.jsxs("div",{className:"wu-flex wu-items-center wu-w-full wu-gap-1 wu-text-xs wu-pl-2",children:[e.icon,r,e.isAdmin&&t.jsx("span",{className:"wu-ml-auto wm-lock wu-text-sm wu-text-orange-deep"})]})},Aa=e=>{const{option:a,handleSelectAll:r,isCheckedAll:s,isPartialSelected:u,...o}=e;switch("type"in a?a.type:"option"){case"all":return t.jsxs($e,{onSelect:w=>{w.stopPropagation(),w.preventDefault(),r==null||r()},className:n("wu-cursor-pointer wu-text-xs wu-py-8 wu-leading-4 wu-select-item"),dir:o.dir,children:[t.jsx(te,{"data-partial":u,checked:s||u,partial:u}),t.jsx(qa,{option:a,accessorKey:o.accessorKey})]});case"group":return t.jsxs(wa,{dir:o.dir,children:[t.jsx(Oe,{className:"wu-text-xs",children:a.label}),a.options.map((w,i)=>d.createElement(_a,{...o,option:w,key:i}))]});case"divider":return t.jsx(Ue,{className:"wu-mx-4"});default:return t.jsx(_a,{...o,option:a})}},Wu=e=>{let a=0,r=0;const s=[],u=[],o=l=>{l.type==="divider"?a++:l.type==="group"?(r++,l.options.forEach(w=>{o(w)})):(s.push(l),l.disabled||u.push(l))};return e.forEach(l=>{o(l)}),{separators:a,groups:r,enabledOptions:u,totalData:s.length,cleanData:s}},Eu=100,_u=400,qu=32,Au=9,Ou=32,Oa=({data:e,onSelect:a,multiple:r=!1,defaultValue:s,value:u,accessorKey:o,variant:l="flat",dir:w="ltr",placeholder:i,Label:c,virtualizedThreshold:f=Eu,maxHeight:p=_u,hasGroup:h=!1,Header:m,CustomTrigger:g,selectAll:b,disabled:v,labelPosition:S="top",onScroll:y,maxContentWidth:C,...D})=>{const[k,I]=d.useState(),W=d.useRef(null),[T,M]=d.useState(!1),[q,$]=d.useState(!1),{cleanData:_,totalData:P,separators:Y,groups:H,enabledOptions:ae}=h||b!=null&&b.enable?Wu(e):{cleanData:e,totalData:e.length,separators:0,groups:0,enabledOptions:[]},me=d.useMemo(()=>r&&b!=null&&b.enable&&e.length>0?[{type:"all",[o.label]:b.label||"Select All"},...e]:e,[e,b,r]),re=d.useCallback(E=>{const z=E[o.value];if(r)I((J=[])=>{const U=J,ie=U.some(oe=>oe[o.value]===z)?U.filter(oe=>oe[o.value]!==z):[...U,E];return a==null||a(ie),ie});else{const J=E;I(J),a==null||a(J)}},[r,o.value,a]);d.useEffect(()=>{if(s&&u){console.error("defaultValue and value cannot be used simultaneously");return}!s&&!u&&I(void 0),s!==void 0&&I(s),u!==void 0&&I(u)},[s,u]);const xe=d.useMemo(()=>Math.min(p,P*qu+Y*Au+H*Ou),[p,P,Y,H]),Te=me.length>f;d.useEffect(()=>{if(!r)return;const E=b!=null&&b.includeDisabled?(k==null?void 0:k.length)===e.length:(k==null?void 0:k.length)===ae.length;M(E);const z=(k==null?void 0:k.length)>0&&!E;$(z)},[k,b]);const we=d.useCallback(()=>{const E=T?[]:b!=null&&b.includeDisabled?h?_:e:ae;I(E),a==null||a(E)},[T,r,e,ae,a,b]),ue=Ee(S);return t.jsxs("div",{className:n(ue,"wu-flex wu-select-container"),ref:W,dir:w,children:[t.jsxs(la,{children:[t.jsx(Iu,{...D,value:k,multiple:r,variant:l,dir:w,placeholder:i,accessorKey:o,customTriggerChildren:g,id:D.id,disabled:v,selectAll:b,isCheckedAll:T}),t.jsxs(pt,{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:D.id,style:{maxWidth:C},children:[m,Te?t.jsx(Se,{list:me,containerHeight:p,callback:(E,z)=>t.jsx(Aa,{option:z,accessorKey:o,multiple:r,onSelect:re,value:k,dir:w,handleSelectAll:we,isCheckedAll:T,isPartialSelected:q}),dir:w}):t.jsx("div",{onScroll:y,style:{maxHeight:xe,height:"fit-content",overflow:"auto"},className:"wu-select-list",children:me.map((E,z)=>t.jsx(Aa,{option:E,accessorKey:o,multiple:r,onSelect:re,value:k,handleSelectAll:we,isCheckedAll:T,dir:w,isPartialSelected:q},`${z}`))})]})]}),c&&t.jsx(Q,{htmlFor:D.id,className:"wu-select-label",children:c})]})},Ge=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Lu=({value:e,onChange:a,min:r=A.sub(new Date,{years:5}),max:s=A.add(new Date,{years:1}),placeholder:u="Select a month",Label:o,labelPosition:l="top",disabled:w,id:i,readonly:c,disabledMonths:f=[],...p})=>{const[h,m]=d.useState(null),[g,b]=d.useState(""),[v,S]=d.useState({value:Math.min(new Date().getFullYear(),new Date(s).getFullYear()),label:Math.min(new Date().getFullYear(),new Date(s).getFullYear())}),y=d.useMemo(()=>{const D=new Date(r).getFullYear(),k=new Date(s).getFullYear();return Array.from({length:k-D+1},(I,W)=>({value:k-W,label:k-W}))},[r,s]);d.useEffect(()=>{if(e){const D=new Date(e),k=D.getFullYear(),I=D.getMonth();m({year:k,month:I}),b(`${Ge[I]} ${k}`),S({value:k,label:k})}},[e]);const C=()=>{h&&a&&(a(new Date(h.year,h.month,15)),b(`${Ge[h.month]} ${h.year}`))};return t.jsxs("div",{className:n("wu-flex wu-flex-col wu-items-center",Ee(l),l==="top"&&"wu-items-start"),children:[t.jsxs(ee,{children:[t.jsx(wt,{...p,disabled:w||c,id:i,dir:"ltr",placeholder:u,formattedString:g}),t.jsxs(Z,{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:[t.jsx("div",{className:"wu-px-1 wu-mx-auto wu-w-full",children:t.jsx(Oa,{data:y,accessorKey:{value:"value",label:"label"},value:v,onSelect:D=>S(D),multiple:!1,maxHeight:7*32})}),t.jsx(Pu,{year:v==null?void 0:v.value,selectedMonth:h==null?void 0:h.month,selectedYear:h==null?void 0:h.year,onClick:(D,k)=>m({year:k,month:D}),disabledMonths:f}),t.jsx("div",{className:"wu-flex wu-justify-end wu-px-0.5",children:t.jsx(De.PopoverClose,{asChild:!0,children:t.jsx(V,{onClick:C,children:"Apply"})})})]})]}),o&&t.jsx(Q,{className:"wu-truncate wu-max-w-[120px] wu-min-w-fit wu-select-label",children:o})]})},Pu=({year:e,selectedMonth:a,selectedYear:r,onClick:s,disabledMonths:u=[]})=>{const o=new Date,l=o.getFullYear(),w=o.getMonth(),i=d.useMemo(()=>{const c=new Set;return u.forEach(f=>{const p=typeof f=="string"?new Date(f):f;c.add(`${p.getFullYear()}-${p.getMonth()}`)}),c},[u]);return t.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:Ge.map((c,f)=>{const p=e===l&&f===w,h=a===f&&r===e;return t.jsx("button",{disabled:i.has(`${e}-${f}`),onClick:()=>s(f,e),className:n("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",p&&"wu-border wu-border-blue-p",h&&"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":`${Ge[f]} ${e}`,"data-month":f,"data-year":e,children:c},c)})})},La=(e,a,r,s=96)=>{if(e.length===0||s<=0)return[[],[]];const[o,l]=d.useState([]),[w,i]=d.useState([]);return d.useEffect(()=>{const c=()=>{var g,b;const f=((g=a.current)==null?void 0:g.clientWidth)||0,p=((b=r.current)==null?void 0:b.clientWidth)||0,h=f-p,m=Math.floor(h/s);l(e.slice(0,m)),i(e.slice(m))};return c(),window.addEventListener("resize",c),()=>{window.removeEventListener("resize",c)}},[e,s]),[o,w]},Pa={wuPrimaryLink:"_wuPrimaryLink_1sy3v_1",wuPrimaryPopoverContent:"_wuPrimaryPopoverContent_1sy3v_8"},Fu=e=>{const{Links:a,children:r,className:s,...u}=e,o=d.useMemo(()=>a.map((f,p)=>d.cloneElement(f,{className:n(Pa.wuPrimaryLink,f.props.className,"wu-primary-nav-link"),key:p})),[a]),l=d.useRef(null),w=d.useRef(null),[i,c]=La(o,l,w);return t.jsx(t.Fragment,{children:t.jsxs("header",{className:n("wu-flex wu-items-center wu-justify-between wu-gap-4 wu-px-2 wu-py-1 wu-bg-white wu-border-b",s),...u,ref:l,children:[t.jsxs("div",{className:"wu-flex wu-items-center wu-gap-2",children:[t.jsx("nav",{className:"wu-flex wu-items-center wu-justify-start wu-gap-4 wu-primary-nav-left",children:i}),c.length>0&&t.jsxs(ee,{children:[t.jsx(be,{className:"wu-p-1 wu-pb-0 wu-rounded-sm focus:wu-outline-none focus:wu-bg-gray-25","aria-label":"more",children:t.jsx("span",{className:"wm-more-vert"})}),t.jsx(Z,{className:n(Pa.wuPrimaryPopoverContent,"wu-primary-nav-popover-left"),align:"start",sideOffset:12,children:c})]})]}),r&&t.jsxs(t.Fragment,{children:[t.jsx("section",{className:"wu-items-center wu-justify-end wu-hidden wu-gap-4 sm:wu-flex wu-primary-nav-right",ref:w,children:r}),t.jsxs(ee,{children:[t.jsx(be,{className:"sm:wu-hidden",children:t.jsx("span",{className:"wu-text-lg wm-menu"})}),t.jsx(Z,{className:"wu-bg-white wu-border wu-border-blue-p wu-w-fit wu-primary-nav-popover-right",align:"end",sideOffset:4,children:r})]})]})]})})},yt={wuSecondaryLink:"_wuSecondaryLink_1edl1_1",wuSecondaryNav:"_wuSecondaryNav_1edl1_6"},Bu=e=>{const{Links:a,children:r,className:s,...u}=e,o=d.useMemo(()=>a.map((p,h)=>d.cloneElement(p.link,{key:h,className:n(yt.wuSecondaryLink,p.link.props.className,"wu-secondary-nav-link-container"),children:t.jsxs(t.Fragment,{children:[d.cloneElement(p.imgOrIcon,{className:n("wu-w-5 wu-h-5 wu-flex wu-items-center wu-justify-center wu-text-lg wu-leading-5",p.imgOrIcon.props.className)}),t.jsx("div",{className:"wu-secondary-nav-link",children:p.link.props.children})]})})),[a]),l=d.useRef(null),w=d.useRef(null),i=d.useRef(null),[c,f]=La(o,l,i);return t.jsx(t.Fragment,{children:t.jsxs("header",{className:n("wu-flex wu-items-center wu-justify-between wu-gap-4 wu-border-y wu-border-gray-25 wu-h-[50px]",s),...u,ref:l,children:[t.jsxs("div",{className:"wu-flex wu-items-center wu-justify-start wu-gap-2",children:[t.jsx("nav",{className:n(yt.wuSecondaryNav,"wu-flex wu-items-center wu-justify-start wu-w-full wu-h-full wu-secondary-nav-left"),ref:w,children:c}),f.length>0&&t.jsxs(ee,{children:[t.jsx(be,{className:"wu-p-1 wu-pb-0 wu-rounded-sm focus:wu-outline-none focus:wu-bg-gray-25","aria-label":"more",children:t.jsx("span",{className:"wm-more-vert"})}),t.jsx(Z,{className:n(yt.wuSecondaryNavPopover,"wu-secondary-nav-popover-left"),align:"start",sideOffset:12,children:f})]})]}),r&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"wu-items-center wu-justify-end wu-hidden sm:wu-flex",ref:i,children:r}),t.jsxs(ee,{children:[t.jsx(be,{className:"sm:wu-hidden",children:t.jsx("span",{className:"wu-text-lg wm-menu"})}),t.jsx(Z,{className:"wu-bg-white wu-border wu-border-blue-p wu-w-fit wu-secondary-nav-popover-right",align:"end",sideOffset:12,children:r})]})]})]})})},Fa=d.forwardRef(({totalRows:e,initialPage:a,initialPageSize:r=100,onPageChange:s,className:u,disabled:o=!1,...l},w)=>{const[i,c]=d.useState(a),[f,p]=d.useState(r);d.useEffect(()=>{c(a),p(r)},[a,r]);const h=Math.ceil(e/f),m=i*f+1,g=Math.min((i+1)*f,e),b=Array.from({length:h},(y,C)=>C),v=d.useCallback(y=>{y>=0&&y<h&&(c(y),s==null||s(y))},[h,s]),S=7*32;return t.jsxs("div",{className:n("wu-flex wu-items-center wu-gap-[2px]",u,"wu-pagination"),...l,role:"navigation",children:[t.jsx(Ba,{label:"Previous page",onClick:()=>v(i-1),disabled:i===0||o,icon:"wm-arrow-back-ios-new",className:"hover:wu-bg-gray-20 rtl:wu-rotate-180 wu-prev-btn"}),t.jsx(Ca,{name:`${m} - ${g}`,className:"wu-w-[96px] wu-min-w-[96px] wu-pagination-menu",align:"end",disabled:o,children:t.jsx(ke,{style:{maxHeight:S+"px"},dir:l.dir,children:b.length>100?t.jsx(Se,{className:"wu-pagination-list",containerHeight:S,list:b,callback:(y,C)=>t.jsxs(gt,{onSelect:()=>v(C),className:n("wu-py-2",C===i&&"wu-bg-gray-20","wu-pagination-item"),children:[C*f+1," -"," ",Math.min((C+1)*f,e)]},y)}):b.map(y=>t.jsxs(gt,{onSelect:()=>v(y),className:n(y===i&&"wu-bg-gray-20","wu-py-2 hover:wu-bg-gray-20","wu-pagination-item"),children:[y*f+1," -"," ",Math.min((y+1)*f,e)]},y))})}),t.jsx(Ba,{label:"Next page",onClick:()=>v(i+1),disabled:i===h-1||o,icon:"wm-arrow-forward-ios",className:"hover:wu-bg-gray-20 rtl:wu-rotate-180 wu-next-btn"})]})});Fa.displayName="WuPagination";const Ba=({label:e,onClick:a,disabled:r,icon:s,className:u})=>t.jsx(V,{variant:"iconOnly",onClick:a,disabled:r,className:n("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",u),"aria-label":e,children:t.jsx("span",{className:n("wu-text-sm",s)})}),zu=({Trigger:e,children:a,className:r,dir:s,open:u,onOpenChange:o,modal:l,...w})=>t.jsxs(ee,{open:u,onOpenChange:o,modal:l,children:[t.jsx(be,{asChild:!0,dir:s,children:e}),t.jsx(Z,{className:n("wu-w-80 wu-p-0 wu-border-blue-p wu-bg-white wu-dark:border-gray-switcher",r),dir:s,...w,children:a})]}),Hu=e=>t.jsx(De.PopoverClose,{asChild:!0,children:t.jsx(V,{...e})}),za=N.forwardRef(({className:e,...a},r)=>t.jsx(We.Root,{className:n("wu-grid wu-gap-2",e),...a,ref:r}));za.displayName=We.Root.displayName;const Ha=N.forwardRef(({className:e,...a},r)=>t.jsx(We.Item,{ref:r,className:n("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),...a,children:t.jsx(We.Indicator,{className:"wu-flex wu-items-center wu-justify-center",children:t.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"})})}));Ha.displayName=We.Item.displayName;const ja=d.forwardRef((e,a)=>{const{options:r,defaultValue:s,onChange:u,label:o,dir:l,...w}=e;return t.jsxs(za,{defaultValue:s,required:w.required,disabled:w.disabled,onValueChange:u,id:w.id,dir:l,name:w.name,className:n("w-fit",w.className),ref:a,style:w.style,children:[t.jsx(_e,{htmlFor:w.id,className:"wu-text-sm wu-font-normal wu-text-gray-lead wu-leading-6 wu-radio-group-label",children:o}),r.map(i=>t.jsxs("div",{className:"wu-flex wu-items-center wu-gap-2 wu-radio-item-container",children:[t.jsx(Ha,{value:i.value,id:i.value,disabled:i.disabled,required:i.required,"aria-label":i.value,className:"wu-peer wu-radio-item"}),t.jsx(_e,{htmlFor:i.value,className:n(i.required&&"after:wu-content-['*'] after:wu-mx-[2px] after:wu-text-rose-500","wu-radio-item-label"),children:i.label})]},i.value))]})});ja.displayName="WuRadioGroup";const ju=e=>{const{children:a,...r}=e;return t.jsxs(ke,{...r,role:"complementary","aria-label":"ScrollArea",children:[a,t.jsx(mt,{orientation:"horizontal"})]})},$a=N.forwardRef(({className:e,orientation:a="horizontal",decorative:r=!0,...s},u)=>t.jsx(Pt.Root,{ref:u,decorative:r,orientation:a,className:n("shrink-0 bg-border",a==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...s}));$a.displayName=Pt.Root.displayName;function Ua({className:e,...a}){return t.jsx("div",{className:n("animate-pulse rounded-md bg-muted",e),...a})}const vt=768;function $u(){const[e,a]=N.useState(void 0);return N.useEffect(()=>{const r=window.matchMedia(`(max-width: ${vt-1}px)`),s=()=>{a(window.innerWidth<vt)};return r.addEventListener("change",s),a(window.innerWidth<vt),()=>r.removeEventListener("change",s)},[]),!!e}const Uu="sidebar_state",Gu=60*60*24*7,Vu="256px",Yu="256px",Ju="3rem",Ku="b",Ga=N.createContext(null);function he(){const e=N.useContext(Ga);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}const Va=N.forwardRef(({defaultOpen:e=!0,open:a,onOpenChange:r,className:s,style:u,children:o,...l},w)=>{const i=$u(),[c,f]=N.useState(!1),[p,h]=N.useState(e),m=a??p,g=N.useCallback(y=>{const C=typeof y=="function"?y(m):y;r?r(C):h(C),document.cookie=`${Uu}=${C}; path=/; max-age=${Gu}`},[r,m]),b=N.useCallback(()=>i?f(y=>!y):g(y=>!y),[i,g,f]);N.useEffect(()=>{const y=C=>{C.key===Ku&&(C.metaKey||C.ctrlKey)&&(C.preventDefault(),b())};return window.addEventListener("keydown",y),()=>window.removeEventListener("keydown",y)},[b]);const v=m?"expanded":"collapsed",S=N.useMemo(()=>({state:v,open:m,setOpen:g,isMobile:i,openMobile:c,setOpenMobile:f,toggleSidebar:b}),[v,m,g,i,c,f,b]);return t.jsx(Ga.Provider,{value:S,children:t.jsx(Xt,{delayDuration:0,children:t.jsx("div",{style:{"--sidebar-width":Vu,"--sidebar-width-icon":Ju,...u},className:n("wu-group/sidebar-wrapper wu-flex wu-min-h-[calc(100svh-48px)] wu-w-full",s),ref:w,...l,children:o})})})});Va.displayName="SidebarProvider";const Ya=N.forwardRef(({side:e="left",variant:a="sidebar",collapsible:r="offcanvas",className:s,children:u,...o},l)=>{const{isMobile:w,state:i,openMobile:c,setOpenMobile:f}=he();return r==="none"?t.jsx("div",{className:n("wu-flex wu-h-full wu-w-[--sidebar-width] wu-flex-col",s),ref:l,...o,children:u}):w?t.jsx(ha,{open:c,onOpenChange:f,...o,children:t.jsxs(bt,{"data-sidebar":"sidebar","data-mobile":"true",className:"wu-w-[--sidebar-width] wu-bg-blue-sidebar wu-p-0 [&>button]:wu-hidden",style:{"--sidebar-width":Yu},side:e,children:[t.jsxs(ma,{className:"sr-only",children:[t.jsx(ht,{children:"Sidebar"}),t.jsx(xa,{children:"Displays the mobile sidebar."})]}),t.jsx("div",{className:"wu-flex wu-flex-col wu-w-full wu-h-full",children:u})]})}):t.jsxs("div",{ref:l,className:"wu-hidden wu-group wu-peer md:wu-block","data-state":i,"data-collapsible":i==="collapsed"?r:"","data-variant":a,"data-side":e,children:[t.jsx("div",{className:n("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",a==="floating"||a==="inset"?"group-data-[collapsible=icon]:wu-w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4))]":"group-data-[collapsible=icon]:wu-w-[--sidebar-width-icon]")}),t.jsx("div",{className:n("wu-fixed wu-inset-y-0 wu-z-10 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)]",a==="floating"||a==="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",s),...o,children:t.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:u})})]})});Ya.displayName="Sidebar";const Ja=N.forwardRef(({className:e,onClick:a,children:r,...s},u)=>{const{toggleSidebar:o}=he();return t.jsxs(Ne,{ref:u,"data-sidebar":"trigger",variant:"secondary",className:n("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:l=>{a==null||a(l),o()},...s,children:[r,t.jsx("span",{className:"wu-sr-only",children:"Toggle Sidebar"})]})});Ja.displayName="SidebarTrigger";const Xu=N.forwardRef(({className:e,...a},r)=>{const{toggleSidebar:s}=he();return t.jsx("button",{ref:r,"data-sidebar":"rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:s,title:"Toggle Sidebar",className:n("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),...a})});Xu.displayName="SidebarRail";const Ka=N.forwardRef(({className:e,...a},r)=>t.jsx("main",{ref:r,className:n("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),...a}));Ka.displayName="SidebarInset";const Qu=N.forwardRef(({className:e,...a},r)=>t.jsx(ze,{ref:r,"data-sidebar":"input",className:n("wu-h-8 wu-w-full wu-shadow-none focus-visible:wu-ring-2",e),...a}));Qu.displayName="SidebarInput";const Xa=N.forwardRef(({className:e,...a},r)=>t.jsx("div",{ref:r,"data-sidebar":"header",className:n("wu-flex wu-flex-col wu-gap-2 wu-p-2",e),...a}));Xa.displayName="SidebarHeader";const Qa=N.forwardRef(({className:e,...a},r)=>t.jsx("div",{ref:r,"data-sidebar":"footer",className:n("wu-flex wu-flex-col wu-gap-2 wu-pb-2",e),...a}));Qa.displayName="SidebarFooter";const Zu=N.forwardRef(({className:e,...a},r)=>t.jsx($a,{ref:r,"data-sidebar":"separator",className:n("wu-mx-2 wu-w-auto",e),...a}));Zu.displayName="SidebarSeparator";const Za=N.forwardRef(({className:e,...a},r)=>t.jsx("div",{ref:r,"data-sidebar":"content",className:n("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),...a}));Za.displayName="SidebarContent";const Ra=N.forwardRef(({className:e,...a},r)=>t.jsx("div",{ref:r,"data-sidebar":"group",className:n("wu-relative wu-flex wu-w-full wu-min-w-0 wu-flex-col wu-p-2",e),...a}));Ra.displayName="SidebarGroup";const er=N.forwardRef(({className:e,asChild:a=!1,...r},s)=>{const u=a?ye.Slot:"div";return t.jsx(u,{ref:s,"data-sidebar":"group-label",className:n("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),...r})});er.displayName="SidebarGroupLabel";const Ru=N.forwardRef(({className:e,asChild:a=!1,...r},s)=>{const u=a?ye.Slot:"button";return t.jsx(u,{ref:s,"data-sidebar":"group-action",className:n("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),...r})});Ru.displayName="SidebarGroupAction";const tr=N.forwardRef(({className:e,...a},r)=>t.jsx("div",{ref:r,"data-sidebar":"group-content",className:n("wu-w-full wu-text-sm",e),...a}));tr.displayName="SidebarGroupContent";const Nt=N.forwardRef(({className:e,...a},r)=>t.jsx("ul",{ref:r,"data-sidebar":"menu",className:n("wu-flex wu-w-full wu-min-w-0 wu-flex-col wu-gap-1",e),...a}));Nt.displayName="SidebarMenu";const ar=N.forwardRef(({className:e,...a},r)=>t.jsx("li",{ref:r,"data-sidebar":"menu-item",className:n("wu-group/menu-item wu-relative",e),...a}));ar.displayName="SidebarMenuItem";const eo=X.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"}}),rr=N.forwardRef(({asChild:e=!1,isActive:a=!1,variant:r="default",size:s="default",tooltip:u,className:o,...l},w)=>{const i=e?ye.Slot:"button",{isMobile:c,state:f}=he(),p=t.jsx(i,{ref:w,"data-sidebar":"menu-button","data-size":s,"data-active":a,className:n(eo({variant:r,size:s}),o),...l});return u?(typeof u=="string"&&(u={children:u}),t.jsxs(Qt,{children:[t.jsx(Zt,{asChild:!0,children:p}),t.jsx(lt,{side:"right",align:"center",hidden:f!=="collapsed"||c,...u})]})):p});rr.displayName="SidebarMenuButton";const to=N.forwardRef(({className:e,asChild:a=!1,showOnHover:r=!1,...s},u)=>{const o=a?ye.Slot:"button";return t.jsx(o,{ref:u,"data-sidebar":"menu-action",className:n("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",r&&"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),...s})});to.displayName="SidebarMenuAction";const ao=N.forwardRef(({className:e,...a},r)=>t.jsx("div",{ref:r,"data-sidebar":"menu-badge",className:n("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),...a}));ao.displayName="SidebarMenuBadge";const ro=N.forwardRef(({className:e,showIcon:a=!1,...r},s)=>{const u=N.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return t.jsxs("div",{ref:s,"data-sidebar":"menu-skeleton",className:n("wu-flex wu-h-8 wu-items-center wu-gap-2 wu-rounded-md wu-px-2",e),...r,children:[a&&t.jsx(Ua,{className:"wu-rounded-md wu-size-4","data-sidebar":"menu-skeleton-icon"}),t.jsx(Ua,{className:"wu-h-4 wu-max-w-[--skeleton-width] wu-flex-1","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":u}})]})});ro.displayName="SidebarMenuSkeleton";const so=N.forwardRef(({className:e,...a},r)=>t.jsx("ul",{ref:r,"data-sidebar":"menu-sub",className:n("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),...a}));so.displayName="SidebarMenuSub";const uo=N.forwardRef(({...e},a)=>t.jsx("li",{ref:a,...e}));uo.displayName="SidebarMenuSubItem";const oo=N.forwardRef(({asChild:e=!1,size:a="md",isActive:r,className:s,...u},o)=>{const l=e?ye.Slot:"a";return t.jsx(l,{ref:o,"data-sidebar":"menu-sub-button","data-size":a,"data-active":r,className:n("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",a==="sm"&&"wu-text-xs",a==="md"&&"wu-text-sm","group-data-[collapsible=icon]:wu-hidden",s),...u})});oo.displayName="SidebarMenuSubButton";const lo=({children:e,Sidebar:a,className:r,defaultOpen:s=!0,open:u,onOpenChange:o,style:l})=>t.jsxs(Va,{defaultOpen:s,open:u,onOpenChange:o,children:[t.jsxs(Ya,{variant:"sidebar",collapsible:"icon",className:n("wu-top-12 wu-h-[calc(100%-48px)] wu-shadow-sidebar wu-border-none",r),style:l,role:"complementary",children:[t.jsx(Xa,{className:"wu-py-2",children:t.jsx(sr,{})}),a]}),t.jsx(Ka,{children:e})]}),sr=e=>{const{state:a,isMobile:r,openMobile:s}=he();return t.jsx(Ja,{...e,children:t.jsx(xt,{showMenu:r?s:a==="expanded"})})},no=({className:e,children:a,...r})=>{const s=d.useRef(null),u=d.useRef(null),o=({currentTarget:w})=>{const{scrollTop:i,clientHeight:c,scrollHeight:f}=w;s.current&&s.current.classList.toggle("wu-border-[#1b338014]",i!==0),u.current&&u.current.classList.toggle("wu-border-[#1b338014]",i+c!==f)},l="wu-w-[calc(100%-16px)] wu-mx-auto wu-border-transparent";return t.jsxs(Za,{...r,className:n("wu-overflow-hidden wu-gap-0",e),children:[t.jsx("hr",{className:l,ref:s}),t.jsx(ke,{onScroll:o,className:"wu-gap-2",thumbColor:"#b9c3dc",railColor:"#00000000","data-testid":"scroll-area",children:a}),t.jsx("hr",{className:l,ref:u})]})},wo=e=>t.jsx(Qa,{...e,children:e.children}),io=({label:e,children:a,...r})=>t.jsxs(Ra,{...r,className:"wu-p-0",children:[t.jsx("div",{className:"wu-h-8",children:t.jsx(er,{className:"wu-items-end wu-px-4 wu-text-xs wu-font-normal wu-leading-4 wu-text-blue-q",children:e})}),t.jsx(tr,{children:t.jsx(Nt,{children:a})})]}),co=e=>t.jsx(Nt,{...e}),fo=({Icon:e,children:a,className:r,isActive:s,...u})=>{const{state:o}=he(),[l,w]=d.useState(),i=a&&d.cloneElement(a,{children:t.jsxs("div",{className:"wu-flex wu-items-center wu-gap-2 wu-overflow-hidden wu-text-base wu-truncate wu-text-ellipsis",children:[e,t.jsx("span",{className:n("wu-text-sm wu-leading-4 wu-transition-opacity wu-duration-150",o==="collapsed"&&"wu-opacity-0"),children:a.props.children})]})}),c=d.useRef(null);return d.useEffect(()=>{var f;w(((f=c.current)==null?void 0:f.textContent)||"")},[]),t.jsx(ar,{...u,className:"wu-flex wu-items-center wu-gap-2 wu-px-2",children:t.jsx(rr,{className:n("wu-flex wu-items-center wu-text-blue-q hover:wu-bg-blue-sidebarHover wu-cursor-pointer wu-h-8 wu-rounded-sm",r,s&&"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:s,tooltip:l,asChild:!0,ref:c,children:i})})},po={wuStepper:"_wuStepper_apbnq_1"},ur=d.forwardRef((e,a)=>{const{onChange:r,defaultValue:s=0,min:u,max:o,step:l,readonly:w,resetInvalidValueOnBlur:i=!0,value:c,label:f,labelPosition:p="top",className:h,style:m,...g}=e,[b,v]=d.useState(c||s),S=T=>!!(e.disabled||e.readOnly||T==="inc"&&Number(b||0)>=Number(o)||T==="dec"&&Number(b||0)<=Number(u)),y=d.useCallback(T=>{T.preventDefault(),v(M=>Number(M||u||0)+Number(l||1))},[u,l]),C=d.useCallback(T=>{T.preventDefault(),v(M=>M?Number(M)-Number(l||1):0)},[u,l]),D=d.useCallback(T=>T>=Number(u)&&T<=Number(o),[u,o]),k=T=>{const M=T.currentTarget.value;v(M)},I=d.useCallback(()=>{if(i&&!D(Number(b))){const T=Number(u)||0;v(T)}},[u,i,D,b]);d.useEffect(()=>{r&&r(Number(b))},[b,c]),d.useEffect(()=>{c&&s&&console.warn("As both value and defaultValue are passed, value will be used")},[c,s]);const W=n("wu-px-10 wu-h-[33px] wu-text-center wu-text-blue-q wu-text-xs wu-rounded-t-sm","wu-stepper-input");return t.jsxs("div",{className:n(po.wuStepper,bo({labelPosition:p}),h,"wu-stepper"),style:m,dir:g.dir,children:[t.jsx(_e,{htmlFor:g.id,className:n(p!=="top"&&"wu-max-w-[160px]","wu-truncate wu-text-xs wu-font-normal wu-leading-6 wu-text-gray-lead wu-stepper-label"),dir:g.dir,children:f}),t.jsxs("div",{className:"wu-relative wu-flex wu-items-center wu-justify-start wu-w-fit wu-stepper-container",dir:g.dir,children:[t.jsx(V,{variant:"iconOnly",Icon:t.jsx("span",{className:"wu-text-base wm-add"}),className:n("wu-rounded-none wu-bg-gray-10 wu-absolute wu-top-0 wu-right-0 wu-w-8 wu-h-8 wu-text-blue-q wu-rounded-tr-sm wu-p-2",g.dir==="rtl"?"wu-right-auto wu-left-0":"","wu-stepper-button"),onClick:y,disabled:S("inc"),"aria-label":"increment"}),t.jsx(ze,{...g,ref:a,type:"number",className:W,onChange:k,min:u,max:o,step:l,readOnly:w,onBlur:I,value:b}),t.jsx(V,{variant:"iconOnly",Icon:t.jsx("span",{className:"wu-text-base wm-minimize"}),className:n("wu-rounded-none wu-bg-gray-10 wu-absolute wu-top-0 wu-left-0 wu-w-8 wu-h-8 wu-text-blue-q wu-rounded-tl-sm wu-p-2",g.dir==="rtl"?"wu-left-auto wu-right-0":"","wu-stepper-button"),onClick:C,disabled:S("dec"),"aria-label":"decrement"})]})]})}),bo=X.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"}}});ur.displayName="WuStepper";const or=X.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"}}),ho=N.forwardRef(({className:e,variant:a,size:r,...s},u)=>t.jsx(Ft.Root,{ref:u,className:n(or({variant:a,size:r,className:e})),...s}));ho.displayName=Ft.Root.displayName;const lr=N.createContext({size:"default",variant:"default"}),Ve=N.forwardRef(({className:e,variant:a,size:r,children:s,...u},o)=>t.jsx(Fe.Root,{ref:o,className:n("wu-flex wu-items-center wu-justify-center wu-gap-1",e),...u,children:t.jsx(lr.Provider,{value:{variant:a,size:r},children:s})}));Ve.displayName=Fe.Root.displayName;const ge=N.forwardRef(({className:e,children:a,variant:r,size:s,...u},o)=>{const l=N.useContext(lr);return t.jsx(Fe.Item,{ref:o,className:n(or({variant:l.variant||r,size:l.size||s}),e),...u,children:a})});ge.displayName=Fe.Item.displayName;const nr=d.forwardRef((e,a)=>{const{options:r,value:s,disabled:u,dir:o,onChange:l}=e,w=i=>n("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",u&&"wu-cursor-not-allowed data-[state=on]:wu-text-gray-lead",i===s&&"wu-text-white",u&&s===i&&"wu-text-gray-lead","wu-switcher-icon-tab-item");return t.jsx(t.Fragment,{children:t.jsxs(Ve,{ref:a,type:"single",value:s,onValueChange:l,disabled:u,dir:o,className:n("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",u&&"wu-cursor-not-allowed","wu-switcher-icon-tab-group"),children:[t.jsx("div",{role:"slider",className:n("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",s==="opt1"&&"",s==="opt2"&&o!=="rtl"&&"wu-translate-x-full",s==="opt2"&&o==="rtl"&&"-wu-translate-x-full",u&&"wu-bg-gray-40","wu-switcher-icon-tab-slider")}),t.jsx(ge,{value:"opt1",className:w("opt1"),children:r[0].label}),t.jsx(ge,{value:"opt2",className:w("opt2"),children:r[1].label})]})})});nr.displayName="_IconTab";const wr=d.forwardRef((e,a)=>{const{options:r,value:s,disabled:u,dir:o,size:l="md",onChange:w}=e,i=c=>n("wu-w-1/2 wu-text-xs wu-rounded-full wu-text-gray-lead wu-relative wu-z-10 wu-font-normal",u&&"wu-cursor-not-allowed data-[state=on]:wu-text-gray-lead",l==="sm"&&"wu-h-6 wu-min-w-20",l==="md"&&"wu-h-8 wu-min-w-28",l==="lg"&&"wu-h-10 wu-min-w-36",c===s&&"wu-text-white wu-font-medium",u&&s===c&&"wu-text-gray-lead","wu-switcher-tab-item");return t.jsx(t.Fragment,{children:t.jsxs(Ve,{ref:a,type:"single",value:s,onValueChange:w,disabled:u,dir:o,className:n("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",u&&"wu-cursor-not-allowed","wu-switcher-tab-group"),children:[t.jsx("div",{role:"slider",className:n("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 ",l==="sm"&&"wu-h-6 wu-min-w-20",l==="md"&&"wu-h-8 wu-min-w-28",l==="lg"&&"wu-h-10 wu-min-w-36",s==="opt1"&&"",s==="opt2"&&o!=="rtl"&&"wu-translate-x-full",s==="opt2"&&o==="rtl"&&"-wu-translate-x-full",u&&"wu-bg-gray-40","wu-switcher-tab-slider")}),t.jsx(ge,{value:"opt1",className:i("opt1"),children:t.jsx("div",{className:"wu-min-w-16 wu-max-w-[136px] wu-overflow-hidden wu-text-ellipsis wu-text-nowrap",children:r[0].label})}),t.jsx(ge,{value:"opt2",className:i("opt2"),children:t.jsx("div",{className:"wu-min-w-16 wu-max-w-[136px] wu-overflow-hidden wu-text-ellipsis wu-text-nowrap",children:r[1].label})})]})})});wr.displayName="_Tab";const ir=d.forwardRef((e,a)=>{const{options:r,value:s,disabled:u,dir:o,onChange:l}=e,w=p=>n("wu-p-0 wu-w-fit wu-text-xs wu-text-gray-lead wu-h-fit wu-font-normal",u&&"wu-cursor-not-allowed data-[state=on]:wu-text-gray-subtle wu-text-gray-subtle",p===s&&"wu-text-primary wu-font-medium",u&&s===p&&"wu-text-gray-lead","wu-switcher-toggle-item"),i=n("wu-w-fit wu-gap-2",u&&"wu-cursor-not-allowed","wu-switcher-toggle-group"),c=n("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",u&&"wu-border-gray-subtle wu-cursor-not-allowed","wu-switcher-toggle-button"),f=n("wu-w-2 wu-h-2 wu-bg-blue-p wu-rounded-full wu-transition-transform wu-duration-300 wu-ease-in-out",s==="opt1"&&o!=="rtl"&&"-wu-translate-x-[10px]",s==="opt1"&&o==="rtl"&&"wu-translate-x-[10px]",s==="opt2"&&o!=="rtl"&&"wu-translate-x-[10px]",s==="opt2"&&o==="rtl"&&"-wu-translate-x-[10px]",u&&"wu-hidden","wu-switcher-toggle-knob");return t.jsx(t.Fragment,{children:t.jsxs(Ve,{ref:a,type:"single",value:s,disabled:u,dir:o,className:i,onValueChange:l,children:[t.jsx(ge,{value:"opt1",className:w("opt1"),children:t.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:r[0].label})}),t.jsx("button",{onClick:()=>l(s==="opt1"?"opt2":"opt1"),className:c,disabled:u,"aria-label":"knob",dir:o,children:t.jsx("div",{className:f,role:"knob",dir:o})}),t.jsx(ge,{value:"opt2",className:w("opt2"),children:t.jsx("div",{className:"wu-max-w-[136px] wu-overflow-hidden wu-text-ellipsis wu-text-nowrap wu-switcher-toggle-item-label",children:r[1].label})})]})})});ir.displayName="_Toggle";const dr=d.forwardRef((e,a)=>{const{type:r,options:s,value:u,disabled:o,dir:l,size:w,onChange:i,toggle:c=!0,...f}=e,[p,h]=d.useState(),m=g=>{let b=p;g!==""?b=g:c&&(b=p==="opt1"?"opt2":"opt1");const v=b==="opt1"?s[0].value:s[1].value;i&&i(v),h(b)};if(d.useEffect(()=>{if(!Array.isArray(s)||s.length<2)throw new Error("Options are not sufficient");h(u===s[0].value?"opt1":"opt2")},[s,u]),!Array.isArray(s)||s.length<2)return t.jsx(t.Fragment,{});switch(r){case"toggle":return t.jsx(ir,{...f,ref:a,options:s,value:p||"opt1",onChange:m,disabled:o,dir:l});case"iconTab":return t.jsx(nr,{ref:a,options:s,value:p||"opt1",onChange:m,disabled:o,dir:l});default:return t.jsx(wr,{ref:a,options:s,value:p||"opt1",onChange:m,disabled:o,dir:l,size:w})}});dr.displayName="WuSwitcher";const cr=fe.Root,Ct=N.forwardRef(({className:e,children:a,...r},s)=>t.jsx(fe.List,{className:n("wu-relative wu-flex",e),...r,ref:s,children:a}));Ct.displayName=fe.List.displayName;const St=N.forwardRef(({className:e,...a},r)=>t.jsx(fe.Trigger,{ref:r,className:n("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),...a}));St.displayName=fe.Trigger.displayName;const fr=N.forwardRef(({className:e,...a},r)=>t.jsx(fe.Content,{ref:r,className:e,...a}));fr.displayName=fe.Content.displayName;const pr=({items:e,enableAnimation:a})=>{const r="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 t.jsx("div",{className:n("wu-w-full wu-h-full wu-flex-1 wu-overflow-auto",a&&"wu-relative wu-overflow-hidden"),children:e.map(s=>t.jsx(fr,{value:s.value,forceMount:a||void 0,className:n("wu-w-full wu-h-full wu-overflow-y-auto",a&&r,"wu-tab-content"),children:s.Content},s.value))})},go=e=>{const[a,r]=d.useState(!1),[s,u]=d.useState(!1),o=()=>{const w=e.current;w&&(r(w.scrollLeft>0),u(w.scrollLeft+w.clientWidth<w.scrollWidth))};return d.useEffect(()=>{const w=e.current;return o(),w&&w.addEventListener("scroll",o),window.addEventListener("resize",o),()=>{w&&w.removeEventListener("scroll",o),window.removeEventListener("resize",o)}},[e]),{showLeftArrow:a,showRightArrow:s,scrollByTab:w=>{const i=e.current;if(i){const c=(w==="right"?i.clientWidth:-i.clientWidth)*.8;i.scrollBy({left:c,behavior:"smooth"})}}}},br=(e,a)=>{const[r,s]=d.useState({width:0,left:0,height:0,top:0}),u=a==="vertical";return d.useEffect(()=>{const o=e.current;if(o){const l=()=>{const i=o.querySelector('[data-state="active"]');if(i){const c={width:u?2:i.offsetWidth,left:u?0:i.offsetLeft,height:u?i.offsetHeight:1,top:u?i.offsetTop:0};s(c)}},w=new MutationObserver(l);return w.observe(o,{attributes:!0,subtree:!0}),l(),()=>{w.disconnect()}}},[e,u]),r},mo=({items:e,value:a,defaultValue:r,onValueChange:s,enableAnimation:u=!1,className:o,dir:l="ltr",position:w="top"})=>{var C;const i=d.useRef(null),c=br(i,"horizontal"),{showLeftArrow:f,showRightArrow:p,scrollByTab:h}=go(i),[m,g]=d.useState(!1),b=()=>h("left"),v=()=>h("right"),S=D=>t.jsx("div",{"data-testid":`gradient-overlay-${D}`,className:n("wu-absolute wu-top-0 wu-h-full wu-w-20 wu-z-10 wu-pointer-events-none",D==="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=(D,k,I)=>{const W=k==="left";return t.jsx("button",{onClick:D,className:n("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",W?"wu-left-0":"wu-right-0",I&&"wu-translate-x-0 wu-opacity-100",!I&&[W?"-wu-translate-x-full":"wu-translate-x-full","wu-opacity-0"]),"aria-label":W?"scroll-left":"scroll-right",children:t.jsx("span",{className:n("wu-text-blue-p wu-text-lg",W?"wm-keyboard-arrow-left":"wm-keyboard-arrow-right")})})};return t.jsxs(cr,{defaultValue:r||((C=e[0])==null?void 0:C.value),value:a,onValueChange:s,orientation:"horizontal",dir:l,className:n("wu-relative wu-flex wu-flex-col wu-w-full wu-h-full",w==="bottom"?"wu-flex-col-reverse":"wu-flex-col",o),role:"tabs",children:[t.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:[f&&m&&S("left"),y(b,"left",f&&m),t.jsxs(Ct,{ref:i,className:n("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(D=>t.jsx(St,{value:D.value,children:D.Trigger},D.value)),t.jsx("span",{className:"wu-absolute wu-bg-blue-p wu-transition-all wu-duration-300 wu-indicator wu-bottom-0",style:{width:c.width,left:c.left,height:1.25,bottom:w==="bottom"?void 0:0,top:w==="bottom"?0:void 0}})]}),p&&m&&S("right"),y(v,"right",p&&m)]}),t.jsx(pr,{items:e,enableAnimation:u})]})},xo=e=>{const[a,r]=d.useState(!1),[s,u]=d.useState(!1),o=()=>{const w=e.current;w&&(r(w.scrollTop>0),u(w.scrollTop+w.clientHeight<w.scrollHeight))};return d.useEffect(()=>{const w=e.current;if(w)return o(),w.addEventListener("scroll",o),window.addEventListener("resize",o),()=>{w.removeEventListener("scroll",o),window.removeEventListener("resize",o)}},[e]),{showTopArrow:a,showBottomArrow:s,scrollByTab:w=>{const i=e.current;if(i){const c=(w==="down"?i.clientHeight:-i.clientHeight)*.8;i.scrollBy({top:c,behavior:"smooth"})}}}},yo=({items:e,value:a,defaultValue:r,onValueChange:s,enableAnimation:u=!1,className:o,dir:l="ltr",position:w="left"})=>{var C;const i=d.useRef(null),c=br(i,"vertical"),{showTopArrow:f,showBottomArrow:p,scrollByTab:h}=xo(i),[m,g]=d.useState(!1),b=()=>h("up"),v=()=>h("down"),S=D=>t.jsx("div",{className:n("wu-absolute wu-left-0 wu-w-full wu-h-12 wu-z-10 wu-pointer-events-none",D==="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=(D,k,I)=>{const W=k==="up";return t.jsx("button",{onClick:D,className:n("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",W?"-wu-top-1":"-wu-bottom-1",I&&"wu-translate-y-0 wu-opacity-100",!I&&[W?"-wu-translate-y-full":"wu-translate-y-full","wu-opacity-0"]),"aria-label":W?"scroll-up":"scroll-down",children:t.jsx("span",{className:n("wu-text-blue-p wu-text-lg",W?"wm-keyboard-arrow-up":"wm-keyboard-arrow-down")})})};return t.jsxs(cr,{defaultValue:r||((C=e[0])==null?void 0:C.value),value:a,onValueChange:s,orientation:"vertical",dir:l,className:n("wu-relative wu-h-full wu-w-full wu-flex",w==="left"?"wu-flex-row":"wu-flex-row-reverse",o),role:"tabs",children:[t.jsxs("div",{className:"wu-relative wu-flex wu-overflow-hidden wu-shrink-0",onMouseEnter:()=>g(!0),onMouseLeave:()=>g(!1),"aria-label":"tablistWrapper",children:[f&&m&&S("top"),y(b,"up",f&&m),t.jsxs(Ct,{ref:i,className:n("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(D=>t.jsx(St,{value:D.value,children:D.Trigger},D.value)),t.jsx("span",{className:"wu-absolute wu-bg-blue-p wu-transition-all wu-duration-300 wu-indicator",style:{width:2,left:w==="left"?0:void 0,right:w==="right"?0:void 0,height:c.height,top:c.top}})]}),p&&m&&S("bottom"),y(v,"down",p&&m)]}),t.jsx(pr,{items:e,enableAnimation:u})]})},vo=({...e})=>e.orientation==="vertical"?t.jsx(yo,{...e}):t.jsx(mo,{...e}),kt=N.forwardRef(({className:e,...a},r)=>t.jsx("table",{ref:r,className:n("wu-w-full wu-caption-bottom wu-text-sm",e),...a}));kt.displayName="Table";const hr=N.forwardRef(({className:e,...a},r)=>t.jsx("thead",{ref:r,className:n("[&_tr]:wu-border-b",e),...a}));hr.displayName="TableHeader";const gr=N.forwardRef(({className:e,...a},r)=>t.jsx("tbody",{ref:r,className:n("",e),...a}));gr.displayName="TableBody";const No=N.forwardRef(({className:e,...a},r)=>t.jsx("tfoot",{ref:r,className:n("wu-border-t wu-bg-muted/50 wu-font-medium [&>tr]:last:wu-border-b-0",e),...a}));No.displayName="TableFooter";const Le=N.forwardRef(({className:e,...a},r)=>t.jsx("tr",{ref:r,className:n("wu-border-b wu-transition-colors wu-hover:wu-bg-muted/50 data-[state=selected]:wu-bg-muted",e),...a}));Le.displayName="TableRow";const Tt=N.forwardRef(({className:e,...a},r)=>t.jsx("th",{ref:r,className:n("wu-h-10 wu-px-4 wu-text-left wu-align-middle wu-font-medium wu-text-muted-foreground [&:has([role=checkbox])]:wu-pr-0",e),...a}));Tt.displayName="TableHead";const Ye=N.forwardRef(({className:e,...a},r)=>t.jsx("td",{ref:r,className:n("wu-p-4 wu-align-middle [&:has([role=checkbox])]:wu-pr-0",e),...a}));Ye.displayName="TableCell";const Dt=N.forwardRef(({className:e,...a},r)=>t.jsx("caption",{ref:r,className:n("wu-mt-4 wu-text-sm wu-text-gray-subtle wu-font-normal",e),...a}));Dt.displayName="TableCaption";const mr=({columns:e,rowSelection:a})=>{const r=(a==null?void 0:a.isEnabled)??!1,{onRowSelect:s,rowUniqueKey:u}=a||{},o=d.useCallback(w=>i=>{s(()=>i?w:[])},[s]);return{finalColumns:d.useMemo(()=>r?[{id:"select",header:({table:w})=>{const i=w.getRowModel().rows.map(f=>f.original),c=o(i);return t.jsx(te,{checked:w.getIsSomeRowsSelected()||w.getIsAllRowsSelected(),partial:w.getIsSomeRowsSelected()&&!w.getIsAllRowsSelected(),onChange:f=>{w.toggleAllRowsSelected(!!f),c(!!f)},"aria-label":"Select all","data-testid":w.getIsSomeRowsSelected()&&!w.getIsAllRowsSelected()?"select-partial":"select-all"})},cell:({row:w})=>t.jsx(te,{checked:w.getIsSelected(),onChange:i=>{w.toggleSelected(!!i)},"aria-label":String(w.original[u])}),enableSorting:!1,filterable:!1,accessorKey:"select"},...e]:e,[e,r,o])}},xr=({table:e,size:a,NoDataContent:r,isLoading:s,CustomLoader:u})=>{var w;const[o,l]=d.useState(null);return t.jsx(gr,{children:s?t.jsx(Le,{children:t.jsx(Ye,{colSpan:e.getAllColumns().length,className:"wu-text-center wu-h-[35vh] wu-loader-container",children:u||t.jsx(Ce,{className:"wu-w-full"})})}):(w=e.getRowModel().rows)!=null&&w.length?e.getRowModel().rows.map((i,c)=>t.jsx(Le,{"data-state":i.getIsSelected()&&"selected",onMouseOver:()=>l(i.id),onMouseOut:()=>l(null),className:n("wu-transition-colors wu-border-b wu-border-black/[12%]",i.getIsSelected()?o===i.id?"wu-bg-blue-p/[16%]":"wu-bg-blue-p/[8%]":"hover:wu-bg-black/[2%]"),children:i.getVisibleCells().map((f,p)=>t.jsx(Ye,{className:n("wu-py-0 wu-font-light wu-text-gray-lead wu-text-xs",a==="compact"?"wu-h-8":"wu-h-10",f.column.id==="actions"?"wu-opacity-0 wu-transition-opacity wu-duration-100":"",o===i.id&&f.column.id==="actions"?"wu-opacity-100 wu-visible":""),children:R.flexRender(f.column.columnDef.cell,f.getContext())},`${f.id}-${p}`))},`${i.id}-${c}`)):t.jsx(Le,{children:t.jsx(Ye,{colSpan:e.getAllColumns().length,children:r})})})},yr=({table:e,sortableColumns:a,manual:r=!1,onSort:s,size:u,isRowSelected:o,HeaderAction:l,isStickyHeader:w})=>{const i=c=>{const{id:f,columnDef:p,getIsSorted:h,toggleSorting:m}=c,{header:g}=p;if(!a.includes(f))return g;const b=h(),v=b==="asc",S=b==="desc",y=()=>{r?(m(!S),s==null||s({id:f,desc:S})):m(c.getIsSorted()==="asc")};return t.jsxs("button",{onClick:y,"aria-label":`Sort by ${g}`,className:"wu-flex wu-items-center wu-gap-4",children:[g,t.jsxs("div",{className:"wu-relative",children:[t.jsx("span",{className:n("wu-absolute -wu-top-[15px] wm-arrow-drop-down wu-text-xl",v&&"wu-hidden",!b&&"-wu-top-[11px]")}),t.jsx("span",{className:n("wu-absolute -wu-bottom-[13px] wm-arrow-drop-up wu-text-xl",S&&"wu-hidden",!b&&"-wu-bottom-[10px]")})]})]})};return t.jsxs(t.Fragment,{children:[t.jsx(hr,{className:n("wu-border-t wu-border-black/[12%] wu-bg-gray-20 wu-relative",w&&"wu-sticky wu-top-[-.5px] wu-z-10",u==="compact"?"wu-h-8":"wu-h-10"),children:e.getHeaderGroups().map(c=>t.jsx(Le,{className:"wu-relative",children:c.headers.map(f=>f.column.id==="actions"?t.jsx(Tt,{colSpan:f.colSpan,className:n("wu-text-gray-lead wu-text-xs wu-font-medium"),style:{width:`${f.getSize()}px`}},f.id):t.jsx(Tt,{colSpan:f.colSpan,className:n("wu-text-gray-lead wu-text-xs wu-font-medium wu-bg-[#EEEEEE]","wu-relative wu-z-0"),style:{width:`${f.getSize()}px`},children:R.flexRender(i(f.column),f.getContext())},f.id))},c.id))}),o&&l&&t.jsx("div",{className:n("wu-absolute wu-left-10 wu-top-0 wu-flex wu-items-center wu-px-4 wu-border-t",u==="compact"?"wu-h-8":"wu-h-10","wu-bg-gray-20 wu-text-gray-lead wu-text-xs wu-font-medium wu-z-10","wu-w-[calc(100%-40px)]","wu-transition-all wu-duration-300 wu-ease-in-out",w&&"wu-sticky wu-top-[-.1px] wu-z-10"),children:l})]})},Co=({data:e,columns:a,isLoading:r=!1,variant:s="unstyled",sort:u,size:o,rowSelection:l,HeaderAction:w,NoDataContent:i,stickyHeader:c=!1,CustomLoader:f,caption:p,...h})=>{var y;const m=((y=l==null?void 0:l.selectedRows)==null?void 0:y.length)??0,{finalColumns:g}=mr({columns:a,rowSelection:l}),b=d.useMemo(()=>a.filter(C=>C.enableSorting).map(C=>C.accessorKey),[g]),v=d.useMemo(()=>{if(!(l!=null&&l.isEnabled))return{};const C={};for(const D of l.selectedRows){const k=e.findIndex(I=>I[l.rowUniqueKey]===D[l.rowUniqueKey]);k!==-1&&(C[k]=!0)}return C},[l==null?void 0:l.selectedRows,e,l==null?void 0:l.rowUniqueKey,l==null?void 0:l.isEnabled]),S=R.useReactTable({data:e,columns:g,getCoreRowModel:R.getCoreRowModel(),getPaginationRowModel:R.getPaginationRowModel(),manualPagination:!0,manualSorting:!0,manualFiltering:!0,enableRowSelection:l==null?void 0:l.isEnabled,state:{...l!=null&&l.isEnabled?{rowSelection:v}:{}},onRowSelectionChange:C=>{if(typeof C=="function"){const D=C(v),k=Object.keys(D).filter(I=>D[I]).map(I=>e[Number(I)]);l==null||l.onRowSelect(k)}}});return t.jsxs("div",{className:n("wu-table-container wu-relative"),children:[p&&t.jsx(Dt,{className:"wu-font-light",children:p}),t.jsxs(kt,{...h,className:n(So({variant:s}),h.className),children:[t.jsx(yr,{table:S,sortableColumns:b,manual:!0,onSort:u==null?void 0:u.onSort,size:o,HeaderAction:w,isRowSelected:m>0,isStickyHeader:c}),!r&&t.jsx(xr,{table:S,size:o,NoDataContent:i,CustomLoader:f})]}),r&&t.jsx("div",{className:"wu-flex wu-items-center wu-justify-center wu-h-96",children:t.jsx(Ce,{})})]})},So=X.cva("",{variants:{variant:{striped:"[&_tr:nth-child(even)]:wu-bg-zinc-50",unstyled:"",bordered:"wu-border-collapse wu-border [&_th]:wu-border [&_td]:wu-border"}}}),vr=({data:e,columns:a,caption:r,variant:s="unstyled",sort:u,filterText:o,size:l="default",pagination:w,rowSelection:i,HeaderAction:c,NoDataContent:f,CustomLoader:p,isLoading:h,stickyHeader:m,...g})=>{var $;const[b,v]=d.useState((u==null?void 0:u.initial)||[]),[S,y]=d.useState([]),C=(($=i==null?void 0:i.selectedRows)==null?void 0:$.length)??0,[D,k]=d.useState((w==null?void 0:w.pageIndex)??0),{finalColumns:I}=mr({columns:a,rowSelection:i}),W=d.useMemo(()=>I.filter(_=>_.enableSorting).map(_=>_.accessorKey),[I]),T=d.useMemo(()=>I.filter(_=>_.filterable).map(_=>_.accessorKey),[I]),M=d.useMemo(()=>{if(!(i!=null&&i.isEnabled))return{};const _={};for(const P of i.selectedRows){const Y=e.findIndex(H=>H[i.rowUniqueKey]===P[i.rowUniqueKey]);Y!==-1&&(_[Y]=!0)}return _},[i==null?void 0:i.selectedRows,e,i==null?void 0:i.rowUniqueKey,i==null?void 0:i.isEnabled]),q=R.useReactTable({data:e,columns:I,getCoreRowModel:R.getCoreRowModel(),enableRowSelection:i==null?void 0:i.isEnabled,getPaginationRowModel:R.getPaginationRowModel(),getSortedRowModel:R.getSortedRowModel(),getFilteredRowModel:R.getFilteredRowModel(),initialState:{pagination:{pageSize:(w==null?void 0:w.pageSize)??100,pageIndex:(w==null?void 0:w.pageIndex)??0}},state:{sorting:b,columnFilters:S,...w?{pagination:w}:{},...i!=null&&i.isEnabled?{rowSelection:M}:{}},onSortingChange:v,onColumnFiltersChange:y,onRowSelectionChange:_=>{const P=typeof _=="function"?_(M):_,Y=Object.keys(P).filter(H=>P[H]).map(H=>e[Number(H)]);i==null||i.onRowSelect(Y)}});return d.useEffect(()=>{T.forEach(_=>{var P;(P=q.getColumn(_))==null||P.setFilterValue(o)})},[o,T,q]),d.useEffect(()=>{w&&(w==null?void 0:w.pageIndex)!==D&&(i==null||i.onRowSelect(()=>[]),q.resetRowSelection(),k(w.pageIndex))},[w==null?void 0:w.pageIndex]),t.jsx("div",{className:"wu-table-container wu-relative",children:t.jsxs(kt,{...g,className:n(ko({variant:s}),"wu-table-fixed",g.className),children:[r&&t.jsx(Dt,{className:"wu-font-light",children:r}),t.jsx(yr,{table:q,sortableColumns:W,size:l,HeaderAction:c,isRowSelected:C>0,isStickyHeader:m}),t.jsx(xr,{table:q,size:l,NoDataContent:f,CustomLoader:p,isLoading:h})]})})},ko=X.cva("",{variants:{variant:{striped:"[&_tr:nth-child(even)]:wu-bg-zinc-50",unstyled:"",bordered:"wu-border-collapse wu-border [&_th]:wu-border [&_td]:wu-border"}}});vr.displayName="WuTable";const Nr=N.forwardRef(({className:e,...a},r)=>t.jsx("textarea",{className:n("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:r,...a}));Nr.displayName="Textarea";const Cr=d.forwardRef((e,a)=>{const{Label:r,id:s=Be(),variant:u="flat",readonly:o,maxLength:l,labelPosition:w="top",...i}=e,c=p=>{i.onChange&&i.onChange(p)},f=Ee(w);return t.jsxs("div",{className:n(f,"wu-flex wu-textarea-container"),dir:i.dir,children:[t.jsx(Nr,{...i,ref:a,id:s,className:n("wu-peer wu-rounded-t-sm",u==="outlined"?"wu-border wu-border-gray-subtle":"",i.className),onChange:c,readOnly:o,maxLength:l}),r&&t.jsx(Q,{htmlFor:s,className:"wu-textarea-label",children:r})]})});Cr.displayName="WuTextarea";function To(e){if(typeof e=="string"&&e.includes("T")){const a=A.parseISO(e);return A.format(a,"HH:mm")}if(typeof e=="string"&&/^\d{2}:\d{2}:\d{2}$/.test(e)){const a=A.parse(e,"HH:mm:ss",new Date);return A.format(a,"HH:mm")}return typeof e=="string"&&/^\d{2}:\d{2}$/.test(e)?e:"00:00"}const Sr=["12",...Array.from({length:11},(e,a)=>String(a+1).padStart(2,"0"))],kr=Array.from({length:60},(e,a)=>String(a).padStart(2,"0")),Tr=["am","pm"],Je=50;function Do(e){return Array(Je).fill(e).flat()}function Mt(e,a){const r=e.indexOf(a);return[...e.slice(r),...e.slice(0,r)]}function Mo(e,a){let r=Number(e);return a==="pm"&&r<12&&(r+=12),a==="am"&&r===12&&(r=0),String(r).padStart(2,"0")}function Dr(e){const a=Number(e),r=a>=12?"pm":"am",s=a%12===0?12:a%12;return{hour:String(s),meridiem:r}}const Io=({value:e,isSelected:a,onClick:r})=>t.jsx("div",{onClick:r,className:n("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",a&&"wu-bg-blue-p/15 wu-text-blue-p"),children:e}),It=({values:e,selectedValue:a,scrollRef:r,onSelect:s,repeatItems:u=!0,className:o})=>t.jsx("div",{ref:r,className:n("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:(u?Do(e):e).map((l,w)=>t.jsx(Io,{value:l,isSelected:l===a,onClick:()=>s(l)},`${l}-${w}`))});function Wo(e,a,r,s){const u=d.useMemo(()=>e?Mt(Sr,a.padStart(2,"0")):Sr,[e]),o=d.useMemo(()=>e?Mt(kr,r.padStart(2,"0")):kr,[e]),l=d.useMemo(()=>e?Mt(Tr,s):Tr,[e]);return{rotatedHours:u,rotatedMinutes:o,rotatedMeridiem:l}}function Eo(e,a,r){d.useEffect(()=>{function s(l){if(l){const w=l.scrollHeight/Je,i=Math.floor(Je/2);l.scrollTop=i*w;const c=()=>{const{scrollTop:f}=l,p=Math.round(f/w);(p<=1||p>=Je-2)&&(l.scrollTop=i*w)};return l.addEventListener("scroll",c),()=>{l.removeEventListener("scroll",c)}}}if(!e)return;const u=s(a.current),o=s(r.current);return()=>{u==null||u(),o==null||o()}},[e,a,r])}const Mr=({className:e,time:a,Label:r,labelPosition:s,dir:u,...o})=>{const[l,w]=d.useState(!1),[i,c]=d.useState(""),f=d.useRef(null),p=d.useRef(null),h=d.useRef(null),m=d.useRef(null),[g,b]=d.useState("12"),[v,S]=d.useState("00"),[y,C]=d.useState("am");d.useEffect(()=>{if(!a){c(""),b("12"),S("00"),C("am"),f.current&&(f.current.value="");return}const T=To(a);c(T);const[M,q]=T.split(":"),{hour:$,meridiem:_}=Dr(M);b($),S(q),C(_),f.current&&(f.current.value=T)},[a]),d.useEffect(()=>{const T=M=>{p.current&&!p.current.contains(M.target)&&w(!1)};return document.addEventListener("mousedown",T),()=>{document.removeEventListener("mousedown",T)}},[]),Eo(l,h,m);const{rotatedHours:D,rotatedMinutes:k,rotatedMeridiem:I}=Wo(l,g,v,y),W=d.useCallback((T,M,q)=>{const $=T??g,_=M??v,P=q??y;b($),S(_),C(P);const Y=`${Mo($,P)}:${_}`;c(Y)},[g,v,y]);return t.jsxs("div",{className:n("wu-flex wu-gap-1 wu-relative wu-w-fit wu-flex-col",(s==="right"||s==="left")&&"wu-items-center",s==="left"&&"wu-flex-row",s==="right"&&"wu-flex-row-reverse","wu-input-wrapper"),dir:u,children:[r&&t.jsx(Q,{htmlFor:"time-picker",className:"wu-timepicker-label",children:r}),t.jsxs("div",{className:n("relative inline-block"),ref:p,dir:u,children:[t.jsx(pe,{ref:f,type:"time",value:i,variant:"flat",role:"textbox",onChange:T=>{c(T.target.value);const[M,q]=T.target.value.split(":"),{hour:$,meridiem:_}=Dr(M);b($),S(q),C(_)},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:t.jsx(le,{icon:"wm-schedule",className:"wu-text-base",onClick:()=>w(T=>!T),"data-testid":"wu-timepicker-icon"}),iconPosition:"right",dir:u,...o}),t.jsx("style",{children:`
5
5
  input[type="time"]::-webkit-calendar-picker-indicator { display: none; }
6
- `}),l&&t.jsxs("div",{className:n("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:[t.jsx(It,{values:D,selectedValue:g.padStart(2,"0"),scrollRef:h,onSelect:T=>W(T,v),className:"wu-time-hour-picker"}),t.jsx(It,{values:k,selectedValue:v.padStart(2,"0"),scrollRef:m,onSelect:T=>W(g,T),className:"wu-time-minute-picker"}),t.jsx(It,{values:I,selectedValue:y,onSelect:T=>W(void 0,void 0,T),className:"wu-time-meridiem-picker",repeatItems:!1})]})]})]})};Mr.displayName="WuTimePicker";const _o=1,qo=1e6;let Wt=0;function Ao(){return Wt=(Wt+1)%Number.MAX_SAFE_INTEGER,Wt.toString()}const Et=new Map,Ir=e=>{if(Et.has(e))return;const a=setTimeout(()=>{Et.delete(e),Pe({type:"REMOVE_TOAST",toastId:e})},qo);Et.set(e,a)},Oo=(e,a)=>{switch(a.type){case"ADD_TOAST":return{...e,toasts:[a.toast,...e.toasts].slice(0,_o)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(r=>r.id===a.toast.id?{...r,...a.toast}:r)};case"DISMISS_TOAST":{const{toastId:r}=a;return r?Ir(r):e.toasts.forEach(s=>{Ir(s.id)}),{...e,toasts:e.toasts.map(s=>s.id===r||r===void 0?{...s,open:!1}:s)}}case"REMOVE_TOAST":return a.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(r=>r.id!==a.toastId)}}},Ke=[];let Xe={toasts:[]};function Pe(e){Xe=Oo(Xe,e),Ke.forEach(a=>{a(Xe)})}function Lo({...e}){const a=Ao(),r=u=>Pe({type:"UPDATE_TOAST",toast:{...u,id:a}}),s=()=>Pe({type:"DISMISS_TOAST",toastId:a});return Pe({type:"ADD_TOAST",toast:{...e,id:a,open:!0,onOpenChange:u=>{u||s()}}}),{id:a,dismiss:s,update:r}}function Wr(){const[e,a]=d.useState(Xe);return d.useEffect(()=>(Ke.push(a),()=>{const r=Ke.indexOf(a);r>-1&&Ke.splice(r,1)}),[e]),{...e,toast:Lo,dismiss:r=>Pe({type:"DISMISS_TOAST",toastId:r})}}const Po=()=>{const{toast:e}=Wr();if(!e)throw new Error("Toast not initialized. Please render <WuToast /> at the root of your app.");return{showToast:({variant:a="success",message:r,duration:s=3e3})=>{e?e({description:r,variant:a,duration:s}):console.error("Toast instance not initialized")}}},Bo=J.Provider,Fo=X.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",bottomRight:"wu-right-0 wu-bottom-0",bottomReft:"wu-left-0 wu-bottom-0"}},defaultVariants:{position:"top"}}),Er=N.forwardRef(({className:e,position:a,...r},s)=>t.jsx(J.Viewport,{ref:s,className:n(Fo({position:a}),e),...r}));Er.displayName=J.Viewport.displayName;const zo=X.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 data-[state=closed]:wu-slide-out-to-top-full data-[state=open]:wu-slide-in-from-top-full",{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"}},defaultVariants:{variant:"default"}}),_r=N.forwardRef(({className:e,variant:a,...r},s)=>t.jsx(J.Root,{ref:s,className:n(zo({variant:a}),e),...r}));_r.displayName=J.Root.displayName;const Ho=N.forwardRef(({className:e,...a},r)=>t.jsx(J.Action,{ref:r,className:n("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),...a}));Ho.displayName=J.Action.displayName;const qr=N.forwardRef(({className:e,...a},r)=>t.jsx(J.Close,{ref:r,className:n("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",...a,children:t.jsx("span",{className:"wm-close wu-text-base"})}));qr.displayName=J.Close.displayName;const Ar=N.forwardRef(({className:e,...a},r)=>t.jsx(J.Title,{ref:r,className:n("wu-text-sm wu-font-semibold",e),...a}));Ar.displayName=J.Title.displayName;const Or=N.forwardRef(({className:e,...a},r)=>t.jsx(J.Description,{ref:r,className:n("wu-text-sm wu-opacity-90",e),...a}));Or.displayName=J.Description.displayName;function jo(){const{toasts:e}=Wr();return t.jsxs(Bo,{children:[e.map(function({id:a,title:r,description:s,action:u,variant:o,...l}){const w={success:"wm-check-circle",info:"wm-info",warning:"wm-error",error:"wm-cancel"};return t.jsxs(_r,{variant:o,...l,children:[t.jsxs("div",{className:"wu-grid wu-gap-1",children:[r&&t.jsx(Ar,{children:r}),s&&t.jsxs(Or,{className:"wu-flex wu-items-center wu-gap-3 wu-pr-6",children:[t.jsx(le,{icon:w[o||"success"],className:"wu-text-xl"}),s]})]}),u,t.jsx(qr,{})]},a)}),t.jsx(Er,{})]})}const $o=()=>t.jsx(jo,{}),Lr=N.forwardRef(({className:e,dir:a,...r},s)=>t.jsx(Re.Root,{className:n("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),...r,ref:s,children:t.jsx(Re.Thumb,{className:n("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",a==="rtl"&&"-wu-translate-x-4 data-[state=unchecked]:wu-translate-x-0",a!=="rtl"&&"wu-translate-x-4 data-[state=unchecked]:wu-translate-x-0","wu-toggle-thumb")})}));Lr.displayName=Re.Root.displayName;const Pr=d.forwardRef((e,a)=>{const{Label:r,labelPosition:s="right",onChange:u,className:o,dir:l,disabled:w,id:i=Fe(),...c}=e;return d.useEffect(()=>{const{checked:f,defaultChecked:p}=c;f!==void 0&&p!==void 0&&console.error("WuToggle: Both `checked` and `defaultChecked` props are set. Use only one of them.")},[c.checked,c.defaultChecked]),t.jsxs("div",{className:n(Uo({labelPosition:s}),"wu-toggle-container"),dir:l,children:[t.jsx(Lr,{...c,id:i,disabled:w,ref:a,onCheckedChange:u,className:n("wu-peer",o),dir:l}),t.jsx(Q,{htmlFor:i,className:"wu-toggle-label",children:r})]})});Pr.displayName="WuToggle";const Uo=X.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"}}});window.wickUiVersion="1.8.0",x.CHART_COLOR_SYSTEM=as,x.WuAccordion=us,x.WuAppHeader=Ws,x.WuAppHeaderAccount=Ut,x.WuAppHeaderBar=Kt,x.WuAppHeaderHelp=Gt,x.WuAppHeaderMenu=Jt,x.WuAppHeaderSearch=Ms,x.WuButton=K,x.WuCalender=nt,x.WuCard=ra,x.WuCheckbox=te,x.WuChip=Fs,x.WuCombobox=Js,x.WuCopyToClipboard=Ks,x.WuDataTable=Co,x.WuDatePicker=_s,x.WuDateRangePicker=Os,x.WuDisplay=hs,x.WuDrawer=eu,x.WuDrawerClose=tu,x.WuFooter=ya,x.WuFormGroup=Ds,x.WuHeading=ps,x.WuHelpButton=va,x.WuIcon=le,x.WuInput=pe,x.WuInputError=Ss,x.WuInputHint=ks,x.WuLabel=Q,x.WuListbox=nu,x.WuLoader=Ce,x.WuMenu=Ca,x.WuMenuCheckboxItem=wu,x.WuMenuIcon=xt,x.WuMenuItem=gt,x.WuMenuItemGroup=iu,x.WuMenuRadioItem=du,x.WuMenuSeparatorItem=cu,x.WuModal=Su,x.WuModalClose=Mu,x.WuModalContent=ku,x.WuModalFooter=Du,x.WuModalHeader=Tu,x.WuMonthPicker=Lu,x.WuPagination=Ba,x.WuPopover=zu,x.WuPopoverClose=Hu,x.WuPrimaryNavbar=Bu,x.WuRadioGroup=ja,x.WuScrollArea=ju,x.WuSecondaryNavbar=Fu,x.WuSelect=Oa,x.WuSidebar=lo,x.WuSidebarContent=no,x.WuSidebarFooter=wo,x.WuSidebarGroup=io,x.WuSidebarItem=fo,x.WuSidebarMenu=co,x.WuSidebarTrigger=sr,x.WuSpotlight=Wa,x.WuStepper=ur,x.WuSubMenu=fu,x.WuSubtext=bs,x.WuSwitcher=dr,x.WuTab=vo,x.WuTable=vr,x.WuText=fs,x.WuTextarea=Cr,x.WuTimePicker=Mr,x.WuToast=$o,x.WuToggle=Pr,x.WuTooltip=He,x.WuTruncatedLabel=Is,x.WuVirtualScroll=Se,x.useWuShowToast=Po,x.useWuSidebar=he,Object.defineProperty(x,Symbol.toStringTag,{value:"Module"})});
6
+ `}),l&&t.jsxs("div",{className:n("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:[t.jsx(It,{values:D,selectedValue:g.padStart(2,"0"),scrollRef:h,onSelect:T=>W(T,v),className:"wu-time-hour-picker"}),t.jsx(It,{values:k,selectedValue:v.padStart(2,"0"),scrollRef:m,onSelect:T=>W(g,T),className:"wu-time-minute-picker"}),t.jsx(It,{values:I,selectedValue:y,onSelect:T=>W(void 0,void 0,T),className:"wu-time-meridiem-picker",repeatItems:!1})]})]})]})};Mr.displayName="WuTimePicker";const _o=1,qo=1e6;let Wt=0;function Ao(){return Wt=(Wt+1)%Number.MAX_SAFE_INTEGER,Wt.toString()}const Et=new Map,Ir=e=>{if(Et.has(e))return;const a=setTimeout(()=>{Et.delete(e),Pe({type:"REMOVE_TOAST",toastId:e})},qo);Et.set(e,a)},Oo=(e,a)=>{switch(a.type){case"ADD_TOAST":return{...e,toasts:[a.toast,...e.toasts].slice(0,_o)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(r=>r.id===a.toast.id?{...r,...a.toast}:r)};case"DISMISS_TOAST":{const{toastId:r}=a;return r?Ir(r):e.toasts.forEach(s=>{Ir(s.id)}),{...e,toasts:e.toasts.map(s=>s.id===r||r===void 0?{...s,open:!1}:s)}}case"REMOVE_TOAST":return a.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(r=>r.id!==a.toastId)}}},Ke=[];let Xe={toasts:[]};function Pe(e){Xe=Oo(Xe,e),Ke.forEach(a=>{a(Xe)})}function Lo({...e}){const a=Ao(),r=u=>Pe({type:"UPDATE_TOAST",toast:{...u,id:a}}),s=()=>Pe({type:"DISMISS_TOAST",toastId:a});return Pe({type:"ADD_TOAST",toast:{...e,id:a,open:!0,onOpenChange:u=>{u||s()}}}),{id:a,dismiss:s,update:r}}function Wr(){const[e,a]=d.useState(Xe);return d.useEffect(()=>(Ke.push(a),()=>{const r=Ke.indexOf(a);r>-1&&Ke.splice(r,1)}),[e]),{...e,toast:Lo,dismiss:r=>Pe({type:"DISMISS_TOAST",toastId:r})}}const Po=()=>{const{toast:e}=Wr();if(!e)throw new Error("Toast not initialized. Please render <WuToast /> at the root of your app.");return{showToast:({variant:a="success",message:r,duration:s=3e3})=>{e?e({description:r,variant:a,duration:s}):console.error("Toast instance not initialized")}}},Fo=K.Provider,Bo=X.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",bottomRight:"wu-right-0 wu-bottom-0",bottomReft:"wu-left-0 wu-bottom-0"}},defaultVariants:{position:"top"}}),Er=N.forwardRef(({className:e,position:a,...r},s)=>t.jsx(K.Viewport,{ref:s,className:n(Bo({position:a}),e),...r}));Er.displayName=K.Viewport.displayName;const zo=X.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 data-[state=closed]:wu-slide-out-to-top-full data-[state=open]:wu-slide-in-from-top-full",{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"}},defaultVariants:{variant:"default"}}),_r=N.forwardRef(({className:e,variant:a,...r},s)=>t.jsx(K.Root,{ref:s,className:n(zo({variant:a}),e),...r}));_r.displayName=K.Root.displayName;const Ho=N.forwardRef(({className:e,...a},r)=>t.jsx(K.Action,{ref:r,className:n("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),...a}));Ho.displayName=K.Action.displayName;const qr=N.forwardRef(({className:e,...a},r)=>t.jsx(K.Close,{ref:r,className:n("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",...a,children:t.jsx("span",{className:"wm-close wu-text-base"})}));qr.displayName=K.Close.displayName;const Ar=N.forwardRef(({className:e,...a},r)=>t.jsx(K.Title,{ref:r,className:n("wu-text-sm wu-font-semibold",e),...a}));Ar.displayName=K.Title.displayName;const Or=N.forwardRef(({className:e,...a},r)=>t.jsx(K.Description,{ref:r,className:n("wu-text-sm wu-opacity-90",e),...a}));Or.displayName=K.Description.displayName;function jo(){const{toasts:e}=Wr();return t.jsxs(Fo,{children:[e.map(function({id:a,title:r,description:s,action:u,variant:o,...l}){const w={success:"wm-check-circle",info:"wm-info",warning:"wm-error",error:"wm-cancel"};return t.jsxs(_r,{variant:o,...l,children:[t.jsxs("div",{className:"wu-grid wu-gap-1",children:[r&&t.jsx(Ar,{children:r}),s&&t.jsxs(Or,{className:"wu-flex wu-items-center wu-gap-3 wu-pr-6",children:[t.jsx(le,{icon:w[o||"success"],className:"wu-text-xl"}),s]})]}),u,t.jsx(qr,{})]},a)}),t.jsx(Er,{})]})}const $o=()=>t.jsx(jo,{}),Lr=N.forwardRef(({className:e,dir:a,...r},s)=>t.jsx(Re.Root,{className:n("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),...r,ref:s,children:t.jsx(Re.Thumb,{className:n("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",a==="rtl"&&"-wu-translate-x-4 data-[state=unchecked]:wu-translate-x-0",a!=="rtl"&&"wu-translate-x-4 data-[state=unchecked]:wu-translate-x-0","wu-toggle-thumb")})}));Lr.displayName=Re.Root.displayName;const Pr=d.forwardRef((e,a)=>{const{Label:r,labelPosition:s="right",onChange:u,className:o,dir:l,disabled:w,id:i=Be(),...c}=e;return d.useEffect(()=>{const{checked:f,defaultChecked:p}=c;f!==void 0&&p!==void 0&&console.error("WuToggle: Both `checked` and `defaultChecked` props are set. Use only one of them.")},[c.checked,c.defaultChecked]),t.jsxs("div",{className:n(Uo({labelPosition:s}),"wu-toggle-container"),dir:l,children:[t.jsx(Lr,{...c,id:i,disabled:w,ref:a,onCheckedChange:u,className:n("wu-peer",o),dir:l}),t.jsx(Q,{htmlFor:i,className:"wu-toggle-label",children:r})]})});Pr.displayName="WuToggle";const Uo=X.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"}}});window.wickUiVersion="1.8.0",x.CHART_COLOR_SYSTEM=as,x.WuAccordion=us,x.WuAppHeader=Ws,x.WuAppHeaderAccount=Ut,x.WuAppHeaderBar=Kt,x.WuAppHeaderHelp=Gt,x.WuAppHeaderMenu=Jt,x.WuAppHeaderSearch=Ms,x.WuButton=V,x.WuCalender=nt,x.WuCard=ra,x.WuCheckbox=te,x.WuChip=Bs,x.WuCombobox=Js,x.WuCopyToClipboard=Ks,x.WuDataTable=Co,x.WuDatePicker=_s,x.WuDateRangePicker=Os,x.WuDisplay=hs,x.WuDrawer=tu,x.WuDrawerClose=au,x.WuFooter=ya,x.WuFormGroup=Ds,x.WuHeading=ps,x.WuHelpButton=va,x.WuIcon=le,x.WuInput=pe,x.WuInputError=Ss,x.WuInputHint=ks,x.WuLabel=Q,x.WuListbox=wu,x.WuLoader=Ce,x.WuMenu=Ca,x.WuMenuCheckboxItem=iu,x.WuMenuIcon=xt,x.WuMenuItem=gt,x.WuMenuItemGroup=du,x.WuMenuRadioItem=cu,x.WuMenuSeparatorItem=fu,x.WuModal=Su,x.WuModalClose=Mu,x.WuModalContent=ku,x.WuModalFooter=Du,x.WuModalHeader=Tu,x.WuMonthPicker=Lu,x.WuPagination=Fa,x.WuPopover=zu,x.WuPopoverClose=Hu,x.WuPrimaryNavbar=Fu,x.WuRadioGroup=ja,x.WuScrollArea=ju,x.WuSecondaryNavbar=Bu,x.WuSelect=Oa,x.WuSidebar=lo,x.WuSidebarContent=no,x.WuSidebarFooter=wo,x.WuSidebarGroup=io,x.WuSidebarItem=fo,x.WuSidebarMenu=co,x.WuSidebarTrigger=sr,x.WuSpotlight=Wa,x.WuStepper=ur,x.WuSubMenu=pu,x.WuSubtext=bs,x.WuSwitcher=dr,x.WuTab=vo,x.WuTable=vr,x.WuText=fs,x.WuTextarea=Cr,x.WuTimePicker=Mr,x.WuToast=$o,x.WuToggle=Pr,x.WuTooltip=He,x.WuTruncatedLabel=Is,x.WuVirtualScroll=Se,x.useWuShowToast=Po,x.useWuSidebar=he,Object.defineProperty(x,Symbol.toStringTag,{value:"Module"})});
7
7
  //# sourceMappingURL=index.js.map