@npm-questionpro/wick-ui-lib 1.0.2 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  import { default as React } from 'react';
2
- export type IWuSelectProps<T> = Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'value' | 'defaultValue'> & {
2
+ export type IWuSelectProps<T> = Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'value' | 'defaultValue' | 'onSelect'> & {
3
3
  defaultValue?: T | T[] | null;
4
4
  Label?: React.ReactNode;
5
5
  value?: T | T[] | null;
@@ -3146,7 +3146,7 @@ const va = ve(({ className: e, children: t, hideCloseButton: u, ...r }, s) => /*
3146
3146
  ...r,
3147
3147
  children: [
3148
3148
  t,
3149
- !u && /* @__PURE__ */ a(z.Close, { "aria-label": "close", children: /* @__PURE__ */ m(
3149
+ !u && /* @__PURE__ */ a(z.Close, { "aria-label": "close", asChild: !0, children: /* @__PURE__ */ m(
3150
3150
  Ce,
3151
3151
  {
3152
3152
  variant: "iconOnly",
@@ -1,2 +1,2 @@
1
- (function(h,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("react/jsx-runtime"),require("@radix-ui/react-avatar"),require("react"),require("clsx"),require("tailwind-merge"),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("@radix-ui/react-scroll-area"),require("react-virtuoso"),require("@radix-ui/react-dropdown-menu"),require("@radix-ui/react-dialog"),require("@radix-ui/react-radio-group"),require("@radix-ui/react-separator"),require("@radix-ui/react-toggle-group"),require("@radix-ui/react-toggle"),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-avatar","react","clsx","tailwind-merge","@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","@radix-ui/react-scroll-area","react-virtuoso","@radix-ui/react-dropdown-menu","@radix-ui/react-dialog","@radix-ui/react-radio-group","@radix-ui/react-separator","@radix-ui/react-toggle-group","@radix-ui/react-toggle","@tanstack/react-table","@radix-ui/react-toast","@radix-ui/react-switch"],e):(h=typeof globalThis<"u"?globalThis:h||self,e(h["wick-ui-lib"]={},h["react/jsx-runtime"],h.RadixUIAvatar,h.React,h.clsx,h.tailwindMerge,h.RadixUISlot,h.ClassVarianceAuthority,h.RadixUILabel,h.RadixUITooltip,h.dateFns,h.RadixUIPopover,h.ReactDayPicker,h.RadixUICheckbox,h.cmdk,h.RadixUIScrollArea,h.ReactVirtuoso,h.RadixUIDropdownMenu,h.RadixUIDialog,h.RadixUIRadioGroup,h.RadixUISeparator,h.RadixUIToggleGroup,h.RadixUIToggle,h.TanstackReactTable,h.RadixUIToast,h.RadixUISwitch))})(this,function(h,e,hr,i,gr,mr,pe,K,xr,Je,A,Se,Ca,yr,U,vr,Nr,Cr,Sr,kr,Tr,Mr,Ir,Z,Dr,Wr){"use strict";function F(a){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(a){for(const r in a)if(r!=="default"){const s=Object.getOwnPropertyDescriptor(a,r);Object.defineProperty(t,r,s.get?s:{enumerable:!0,get:()=>a[r]})}}return t.default=a,Object.freeze(t)}const be=F(hr),y=F(i),Sa=F(xr),ke=F(Je),Te=F(Se),Ke=F(yr),ne=F(vr),L=F(Cr),P=F(Sr),Me=F(kr),ka=F(Tr),Pe=F(Mr),Ta=F(Ir),G=F(Dr),Xe=F(Wr),_r=mr.extendTailwindMerge({prefix:"wu-"});function o(...a){return _r(gr.clsx(a))}const Qe=a=>{window.open(a,"_blank","toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=800,height=600")};function ze(){return Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15)}function Ie(a){switch(a){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 Ma=y.forwardRef(({className:a,...t},r)=>e.jsx(be.Root,{ref:r,className:o("wu-relative wu-flex wu-h-10 wu-w-10 wu-shrink-0 wu-overflow-hidden wu-rounded-full",a),...t}));Ma.displayName=be.Root.displayName;const Ia=y.forwardRef(({className:a,...t},r)=>e.jsx(be.Image,{ref:r,className:o("wu-aspect-square wu-h-full wu-w-full",a),...t}));Ia.displayName=be.Image.displayName;const Da=y.forwardRef(({className:a,...t},r)=>e.jsx(be.Fallback,{ref:r,className:o("wu-flex wu-h-full wu-w-full wu-items-center wu-justify-center wu-rounded-full wu-bg-muted",a),...t}));Da.displayName=be.Fallback.displayName;function Ze(a,t){i.useEffect(()=>{const r=s=>{Array.isArray(a)&&a.some(u=>!u.current||u.current.contains(s.target))||!Array.isArray(a)&&(!a.current||a.current.contains(s.target))||t(s)};return document.addEventListener("mousedown",r),document.addEventListener("touchstart",r),()=>{document.removeEventListener("mousedown",r),document.removeEventListener("touchstart",r)}},[a,t])}const Re={dropdownContainer:"_dropdownContainer_vvlo9_1",open:"_open_vvlo9_1",dropdownMenu:"_dropdownMenu_vvlo9_1"},Wa=({dir:a,Trigger:t,triggerClassName:r,DropdownContent:s})=>{const[u,l]=i.useState(!1),n=i.useRef(null),d=i.useRef(null);Ze([n,d],()=>l(!1));const w=()=>{l(!u)};return e.jsx(e.Fragment,{children:e.jsx("div",{className:Re.dropdownContainer,children:e.jsx("ul",{children:e.jsxs("li",{className:o("wu-flex wu-relative",u&&Re.open),children:[e.jsx("button",{className:o("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(),w()},ref:d,"aria-label":"dropdown-trigger",children:t}),e.jsx("div",{className:o(Re.dropdownMenu,{open:u},a==="rtl"?"wu-left-[-10px] wu-top-[38px]":"wu-right-[-7px] wu-top-[38px]"),dir:a,ref:n,"aria-label":"user-menu",children:s})]})})})})},ea=K.cva("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-focus 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-leading-[1px]",{variants:{size:{md:"wu-px-4 wu-py-2 wu-min-w-[104px] wu-h-8",sm:"wu-px-4 wu-py-1 wu-min-w-[104px] wu-h-6",mobile:"wu-px-4 wu-py-2 wu-min-w-[104px] wu-h-10"},color:{primary:"wu-bg-blue-p hover:wu-bg-blue-pHover wu-text-blue-p wu-ring-1 wu-ring-blue-p hover:wu-text-blue-q hover:wu-ring-blue-pHover",upgrade:"wu-bg-orange-soft hover:wu-bg-orange-deep wu-text-orange-deep hover:wu-text-orange-deep wu-ring-1 wu-ring-orange-soft hover:wu-ring-orange-deep",error:"wu-bg-red-deep hover:wu-bg-red-deep/80 wu-text-red-deep hover:wu-text-red-deep/80 wu-ring-1 wu-ring-red-deep hover:wu-ring-red-deep/80"},variant:{primary:"wu-text-white wu-ring-0 hover:wu-text-white",secondary:"wu-bg-transparent wu-ring-0 hover:wu-bg-gray-20 ",outline:"hover:wu-text-white wu-bg-white disabled:wu-bg-transparent",rounded:"wu-text-white wu-ring-0 wu-rounded-full hover:wu-text-white",link:"hover:wu-underline wu-bg-transparent hover:wu-bg-transparent wu-ring-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-ring-0 wu-bg-transparent wu-min-w-[auto] disabled:wu-grayscale disabled:wu-opacity-80 wu-rounded-sm focus-visible:wu-ring-offset-0 focus-visible:wu-bg-gray-20 wu-aspect-square"}},defaultVariants:{variant:"primary",size:"md",color:"primary"}}),he=y.forwardRef(({className:a,variant:t,size:r,color:s,asChild:u=!1,...l},n)=>{const d=u?pe.Slot:"button";return e.jsx(d,{className:o(ea({size:r,color:s,variant:t,className:a})),ref:n,...l})});he.displayName="Button";const ge=i.forwardRef((a,t)=>Or(a,t)),Or=(a,t)=>{const{size:r="md",color:s="#1B87E6",variant:u="dots",...l}=a,n=o("wu-w-[4em] wu-h-[1em] wu-inline-block wu-text-xs wu-relative wu-loader-dot-container");let d="7px";r==="sm"?d="7px":r==="md"?d="12px":r==="lg"?d="18px":typeof r=="string"&&(d=r);const w={backgroundColor:s,width:d,height:d},c=e.jsxs("div",{...l,ref:t,className:o("wu-flex wu-items-center wu-justify-center wu-gap-2 wu-w-fit",a.className),role:"status","aria-busy":"true",children:[e.jsx("div",{className:"wu-w-12 wu-h-12 wu-border-2 wu-rounded-full wu-animate-spin",style:{width:d,height:d,borderTopColor:s}}),a.message&&e.jsx("p",{className:"wu-inline-block wu-loader-message",children:a.message})]}),f=e.jsxs("div",{...l,ref:t,className:o("wu-flex wu-items-center wu-justify-center wu-gap-2 wu-w-fit",a.className),role:"alert","aria-busy":"true",children:[e.jsxs("ul",{className:n,style:{fontSize:d},role:"loader",children:[e.jsx("li",{className:"wu-dot wu-loader-dot",style:w}),e.jsx("li",{className:"wu-dot wu-loader-dot",style:w}),e.jsx("li",{className:"wu-dot wu-loader-dot",style:w}),e.jsx("li",{className:"wu-dot wu-loader-dot",style:w})]}),a.message&&e.jsx("p",{className:"wu-inline-block wu-loader-message",children:a.message})]});return e.jsx(e.Fragment,{children:u==="spinner"?c:f})};ge.displayName="WuLoader";const V=i.forwardRef(({disabled:a,loading:t,variant:r="primary",size:s="md",Icon:u,iconPosition:l="left",children:n,floating:d,className:w,color:c="primary",...f},b)=>{const x={primary:"#1986e688",upgrade:"#f5830088",error:"#ef444488"};return e.jsxs(he,{...f,disabled:a,variant:r,size:s,className:o(d&&"wu-shadow-qp","wu-flex wu-items-center wu-justify-center wu-gap-2",l==="right"&&"wu-flex-row-reverse",w,t?"wu-cursor-not-allowed wu-ring-0":""),color:c,style:{backgroundColor:t?x[c]:"",...f.style},ref:b,children:[!t&&u&&e.jsx(e.Fragment,{children:u}),t&&e.jsx(ge,{color:"#fff",size:"sm"}),!t&&n]})});V.displayName="WuButton";const Er=({onLogout:a,DataCenter:t})=>e.jsxs("section",{className:"wu-flex wu-justify-between wu-px-4 wu-py-4 wu-text-white wu-bg-gray-lead",children:[e.jsx("div",{className:"wu-flex-1 wu-flex wu-items-start",children:t}),e.jsx(V,{variant:"outline",size:"sm",Icon:e.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:a,"aria-label":"logout",children:"LOGOUT"})]}),Lr=({user:a,dir:t})=>{const r=[a!=null&&a.usage&&Object.keys(a.usage).length>0?{title:a.usage.title,url:a.usage.url,icon:"wm-bar-chart wu-text-base",node:e.jsxs("div",{className:"wu-flex wu-flex-col wu-items-center wu-w-20",children:[e.jsx("code",{className:"wu-font-medium",children:a.usage.collectedResponseCount||"0"}),e.jsx("span",{className:"wu-text-xs wu-font-normal",children:"Responses"})]})}:null,a!=null&&a.invoice&&Object.keys(a.invoice).length>0?{title:a.invoice.title,url:a.invoice.url,icon:"wm-attach-money wu-text-base wu-font-semibold",node:e.jsx("div",{className:"wu-flex wu-justify-center wu-items-center wu-w-20",children:e.jsx("code",{children:a.invoice.size})})}:null].filter(Boolean);return e.jsxs(e.Fragment,{children:[e.jsx("ul",{children:r.map(({title:s,url:u,icon:l,node:n},d)=>e.jsx("li",{className:d<r.length-1?"wu-border-b wu-border-gray-subtle":"",children:e.jsxs("a",{href:u,className:o("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",t==="rtl"?"wu-pl-4":"wu-pr-4"),children:[e.jsxs("div",{className:"wu-flex wu-items-center wu-gap-2",children:[e.jsx("span",{className:o(l,"wu-w-12 wu-text-center")}),e.jsx("span",{children:s})]}),n]})},d))}),e.jsx("hr",{className:"wu-border-gray-subtle"})]})},Pr=({settings:a,dir:t})=>e.jsxs(e.Fragment,{children:[e.jsx("hr",{className:"wu-border-gray-subtle"}),e.jsxs("section",{className:"wu-relative wu-flex wu-items-center wu-justify-start wu-gap-2",children:[e.jsx("span",{className:o("wu-absolute wm-settings wu-text-base",t==="rtl"?"wu-right-4":"wu-left-4")}),e.jsx("ul",{className:"wu-w-full",dir:t,children:a==null?void 0:a.map(r=>e.jsx("li",{tabIndex:-1,dir:t,children:e.jsx("a",{href:r.url,className:o("wu-inline-block wu-w-full wu-py-2 hover:wu-bg-gray-20 focus-within:wu-bg-gray-20 focus:wu-outline-none",t==="rtl"?"wu-pr-14 wu-text-right":"wu-pl-14"),children:r.title})},r.title))})]}),e.jsx("hr",{className:"wu-border-gray-subtle"})]}),zr=({user:a,dir:t})=>{var r,s,u,l,n,d,w,c,f;return e.jsxs("section",{className:o("wu-flex wu-gap-2 wu-p-4 wu-w-full",t==="rtl"?"wu-pr-0":"wu-pl-0"),children:[e.jsx("div",{className:"wu-flex wu-items-center wu-justify-center wu-w-12",children:e.jsx("span",{className:"wu-text-base wm-person"})}),e.jsxs("div",{className:o("wu-flex wu-flex-col wu-gap-1",t==="rtl"&&"wu-text-right"),children:[e.jsx("p",{children:(r=a==null?void 0:a.profile)==null?void 0:r.title}),e.jsxs("a",{href:(s=a==null?void 0:a.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:t,children:[e.jsx("p",{children:(u=a==null?void 0:a.profile)==null?void 0:u.subtitle}),e.jsx("p",{className:"wu-font-light",children:(l=a==null?void 0:a.profile)==null?void 0:l.companyName})]}),(a==null?void 0:a.license)&&Object.keys(a.license).length>0&&e.jsxs("div",{className:"wu-flex wu-items-center wu-justify-between wu-gap-6 wu-mt-4",dir:t,children:[e.jsx("a",{href:(n=a==null?void 0:a.license)==null?void 0:n.url,className:"hover:wu-text-blue-p wu-group/license focus:wu-outline-none focus:wu-text-blue-p",children:e.jsxs("div",{className:"wu-flex wu-flex-col wu-items-start wu-gap-1",children:[e.jsx("p",{className:"wu-font-normal",children:(d=a==null?void 0:a.license)==null?void 0:d.subtitle}),e.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:(w=a==null?void 0:a.license)==null?void 0:w.title})]})}),e.jsxs("div",{className:"wu-flex wu-flex-col wu-items-start wu-gap-1",dir:t,children:[e.jsx("p",{className:"wu-font-normal",children:(c=a==null?void 0:a.license)==null?void 0:c.expiryDatePostFixString}),e.jsx("p",{children:(f=a==null?void 0:a.license)==null?void 0:f.expiryDate})]})]})]})]})},_a=({user:a,onLogout:t,dir:r,DataCenter:s})=>{var u,l;return a?e.jsx(Wa,{Trigger:e.jsxs(Ma,{className:o("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:[e.jsx(Ia,{className:"hover:wu-opacity-80",src:(u=a==null?void 0:a.profile)==null?void 0:u.profilePicture,alt:"User"}),e.jsx(Da,{children:(l=a==null?void 0:a.profile)==null?void 0:l.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:e.jsxs("div",{className:o("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:[e.jsx(zr,{user:a,dir:r}),(a==null?void 0:a.settings)&&a.settings.length>0&&e.jsx(Pr,{settings:a.settings,dir:r}),e.jsx(Lr,{user:a,dir:r}),e.jsx(Er,{onLogout:t,DataCenter:s})]})}):null},Oa=({menuList:a,dir:t})=>{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 e.jsx(Wa,{dir:t,Trigger:e.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:e.jsx("ul",{children:(a||r).map((s,u)=>e.jsx("li",{className:"wu-p-0 wu-w-[191px] hover:wu-bg-[#ededed]",dir:t,children:s.target==="window"?e.jsx("a",{tabIndex:0,rel:"noopener noreferrer",onClick:()=>Qe(s.link),onKeyDown:l=>{l.key==="Enter"&&Qe(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:e.jsx(Ea,{item:s,dir:t})}):e.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:e.jsx(Ea,{item:s,dir:t})})},u))})})},Ea=({item:a,dir:t})=>e.jsxs("div",{className:"wu-flex wu-items-start wu-gap-3",children:[e.jsx("span",{className:`${a.icon} wu-text-xl wu-text-gray-subtle`}),e.jsxs("div",{className:o("wu-flex wu-flex-col wu-gap-[2px]",t==="rtl"&&"wu-text-right"),children:[e.jsx("span",{className:"wu-text-xs wu-text-gray-subtle",children:a.subTitle}),e.jsx("p",{className:"wu-text-sm wu-text-blue-q",children:a.title})]})]}),Hr=a=>{const[t,r]=i.useState(()=>window.innerWidth<=a);return i.useEffect(()=>{const s=()=>{r(window.innerWidth<=a)};return window.addEventListener("resize",s),()=>{window.removeEventListener("resize",s)}},[a]),t};function Ar({productCategories:a,openCategory:t,setOpenCategory:r}){const s=(d,w)=>{const c=w[d];if(c){c.focus();const f=a[d]||null;r(f)}},u=(d,w,c,f)=>{d.preventDefault();const b=c==="down"?w+1:w-1;s(b,f)},l=(d,w,c,f)=>{t!=null&&t.products&&t.products[t.products.length-1].name===f&&(d.preventDefault(),s(w+1,c))},n=(d,w)=>{d.preventDefault();const c=a[w]===t?null:a[w];r(c)};return function(w,c,f){const b=document.querySelectorAll("[data-product-category]"),{key:x}=w;switch(x){case"ArrowDown":u(w,c,"down",b);break;case"ArrowUp":u(w,c,"up",b);break;case"Tab":l(w,c,b,f);break;case"Enter":case" ":n(w,c);break}}}const qr=a=>{const{size:t="lg",className:r,children:s,...u}=a,l={sm:"wu-text-body-3",md:"wu-text-body-2",lg:"wu-text-body-1"},n=a.as||"div";return e.jsx(n,{...u,className:o(l[t],r),children:s})},Br=a=>{const{size:t="xl",className:r,children:s,...u}=a,l={sm:"h4",md:"h3",lg:"h2",xl:"h1"},n={sm:"wu-text-heading-4",md:"wu-text-heading-3",lg:"wu-text-heading-2",xl:"wu-text-heading-1"},d=l[t];return e.jsx(d,{...u,className:o(n[t],r),children:s})},jr=a=>{const{size:t="lg",className:r,children:s,...u}=a,l={sm:"wu-text-sub-3",md:"wu-text-sub-2",lg:"wu-text-sub-1"},n=a.as||"div";return e.jsx(n,{...u,className:o(l[t],r),children:s})},Fr=a=>{const{size:t="lg",className:r,children:s,...u}=a,l={md:"wu-text-display-2",lg:"wu-text-display-1"},n=a.as||"h1";return e.jsx(n,{...u,className:o(l[t],r),children:s})},we=a=>{const{icon:t,className:r,...s}=a;return e.jsx("span",{...s,className:o(t,r),role:"presentation","aria-label":t})},Ur=({buttonRef:a,handleDropdownToggle:t,handleKeyDown:r,isDropdownOpen:s,activeProductName:u,dir:l="ltr",homeLink:n="/"})=>e.jsxs("button",{ref:a,type:"button",className:o("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:t,onKeyDown:d=>{s&&d.key==="ArrowDown"&&r(d,-1)},"aria-label":"product-switcher",children:[e.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:n,children:e.jsx(we,{icon:"wc-logo",className:"wu-text-xl wu-leading-4 wu-relative wu-top-1"})}),u,e.jsx("span",{className:o("wm-arrow-drop-down wu-text-2xl wu-transition-transform wu-duration-300",s&&"wu-rotate-180",l==="rtl"?"wu-mr-auto":"wu-ml-auto")})]}),z={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"},$r=({category:a,dir:t="ltr",openCategory:r})=>{const s=a.active?"#c5cce0":"#f0c36a",u=(r==null?void 0:r.name)===a.name,l=o("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",t==="rtl"&&"wu-rotate-180 wu-ml-2.5 wu-text-blue-q group-hover:wu-hidden",u&&"wu-hidden","wu-relative wu-top-[5px]"),n=o("wm-lock wu-text-orange-soft wu-text-base wu-mr-2.5 group-hover:wu-hidden",t==="rtl"&&"wu-ml-2.5 group-hover:wu-hidden",u&&"wu-hidden","wu-relative wu-top-1");return e.jsxs("div",{className:o("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:t,children:[e.jsx("div",{className:z.productCategoryBorderTop,style:{backgroundColor:s}}),e.jsxs("div",{className:"wu-flex wu-items-center wu-px-1 wu-relative wu-top-1",children:[e.jsx("div",{className:"wu-w-[56px] wu-h-[56px] wu-flex wu-items-center wu-justify-center",children:e.jsx("img",{src:a.logo,alt:a.name,width:"32px",height:"32px"})}),e.jsx("span",{className:"wu-text-sm wu-leading-5 wu-text-blue-q wu-relative wu-top-[1px]",children:a.name})]}),a.active?e.jsx("span",{className:l}):e.jsx("span",{className:n})]})},Gr={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"},Vr=({product:a,currentProduct:t,activeProductName:r,dir:s,focusItem:u,setFocusItem:l})=>{const[n,d]=i.useState(a.name===t),w=a.name===r,c=a.name===t,f=!a.active,b="#1b3380",x="#c5cce0",v="#ffcf70",m=o("wu-font-normal wu-text-xs wu-text-gray-lead wu-text-center",c&&"wu-text-blue-q wu-font-normal",!a.active&&"wu-text-gray-subtle",n&&"wu-font-normal",a.active&&n&&"wu-text-blue-q"),p=o("wu-text-blue-p wu-text-base",c&&"wu-text-blue-q",!a.active&&"wu-text-gray-subtle",a.active&&n&&"wu-text-blue-q"),C=n||u===a.name||w?b:x;return e.jsxs("li",{className:o(z.productListItem,"focus-visible:wu-outline-none focus:wu-outline-none wu-sub-product-list-item",(w||n)&&z.activeProduct,a.name.length>15&&window.innerWidth>768&&"wu-w-[130px] wu-min-w-[130px]",u===a.name&&z.activeProduct,"wu-product-item"),onMouseOver:()=>d(!0),onMouseOut:()=>d(!1),"aria-label":a.name,"aria-disabled":f,dir:s,onKeyDown:S=>{if(S.key==="Enter"){S.preventDefault();const g=S.currentTarget.querySelector("a");g&&g.click()}},onFocus:()=>{l(a.name)},onBlur:()=>l(""),children:[e.jsx("div",{className:o(z.topBorder,s==="rtl"&&z.topBorderRtl),style:{backgroundColor:f?v:C}}),e.jsxs("a",{className:o(z.productLink,"focus:wu-outline-none focus-visible:wu-outline-none"),href:a.link||"#",tabIndex:0,children:[e.jsx("span",{className:o(p,Gr[a.icon||""]),"aria-hidden":!0}),e.jsx("span",{className:o(m),children:a.name})]})]},a.name)},Yr=({category:a,currentProduct:t,activeProductName:r,dir:s="ltr",focusItem:u,setFocusItem:l,borderColorLocked:n="#f5a300"})=>{const{products:d=[],active:w}=a,c=i.useMemo(()=>d.filter(m=>m.active).sort((m,p)=>(m.order||100)-(p.order||100)),[d]),f=i.useMemo(()=>d.filter(m=>!m.active),[d]),[b,x]=i.useState(n),v=m=>m.map((p,C)=>e.jsx(Vr,{product:p,currentProduct:t,activeProductName:r,dir:s,focusItem:u,setFocusItem:l},C));return w?e.jsxs(e.Fragment,{children:[v(c),f.length>0&&e.jsxs("li",{className:o(z.productListItem,"focus:wu-outline-none focus-visible:wu-outline-none !wu-bg-[#f5f5f5] hover:!wu-bg-[#eeeeee] wu-group"),onMouseOver:()=>x("#f5a300"),onMouseOut:()=>x(n),"aria-label":"Upgrade to unlock",children:[e.jsx("div",{className:o(z.topBorder,s==="rtl"&&z.topBorderRtl),style:{backgroundColor:b},"aria-label":"top-border"}),e.jsxs("a",{href:"https://www.questionpro.com/a/showUpgradeUser.do",className:o(z.productLink,"wu-flex wu-flex-col wu-items-center wu-justify-center wu-py-2 wu-min-w-[88px]"),children:[e.jsx("span",{className:"wu-text-base wu-transition-colors wm-lock !wu-text-orange-soft group-hover:wu-text-orange-deep"}),e.jsxs("span",{className:"wu-text-[10px] wu-leading-[10px] wu-text-center wu-pt-1 !wu-text-orange-deep",children:["Upgrade to ",e.jsx("br",{})," unlock"]})]})]}),v(f)]}):e.jsxs("li",{className:o(z.productListItem,z.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:()=>l("learn"),onBlur:()=>l(""),"aria-label":"Learn More",children:[e.jsx("div",{className:o(z.topBorder,s==="rtl"&&z.topBorderRtl),style:{backgroundColor:n}}),e.jsx("a",{className:z.productLink,href:"https://www.questionpro.com/a/showUpgradeUser.do",tabIndex:-1,children:e.jsx("span",{className:"wu-text-[#f99e03]",children:"Learn More"})})]})},La=({dropdownRef:a,dir:t,isDropdownOpen:r,productCategories:s,openCategory:u,setOpenCategory:l,handleKeyDown:n,expandAll:d,activeProductName:w,focusItem:c,setFocusItem:f})=>{const b="#ffcf70",[x,v]=i.useState(window.innerWidth>768);return i.useEffect(()=>{const m=()=>{v(window.innerWidth>375)};return window.addEventListener("resize",m),()=>window.removeEventListener("resize",m)},[]),e.jsx("ul",{className:o(z.productDropdownMenu,r&&z.productDropdownMenuOpen,t==="rtl"&&z.rtlDropdownMenu,"wu-switcher-container"),ref:a,dir:t,"aria-label":"product-dropdown-menu","data-state":r?"open":"closed",children:s.map((m,p)=>e.jsxs("li",{className:o(z.productCategory,"focus:wu-outline-none focus-visible:wu-outline-none wu-h-16 wu-category-item",u===m&&z.open,d&&z.open),onMouseEnter:()=>x&&l(m),onMouseLeave:()=>x&&l(null),"aria-label":m.name,dir:t,onKeyDown:C=>n(C,p),tabIndex:0,"data-product-category":!0,children:[e.jsx($r,{category:m,dir:t,openCategory:u}),e.jsx("ul",{className:o(z.productList,t==="rtl"&&z.rtlProductList),dir:t,children:e.jsx(Yr,{category:m,dir:t,activeProductName:w,currentProduct:m.name,focusItem:c,setFocusItem:f,borderColorLocked:b})})]},m.name))})},Jr=({isProductButtonShow:a,isDropdownOpen:t,activeProductColor:r,activeProductBgColor:s,activeProductName:u,dir:l,smallScreenButtonRef:n,handleDropdownToggle:d,handleKeyDown:w})=>e.jsx("div",{className:o("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",a?l==="rtl"?"wu-right-0 wu-overflow-hidden":"wu-translate-x-0 wu-left-0":l==="rtl"?"wu-right-0 wu-w-0":"wu--translate-x-full"),style:{backgroundColor:t?r.hover:s},children:e.jsxs("button",{ref:n,type:"button",className:o("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",a?"wu-flex":l==="rtl"?"wu-hidden":"wu-flex"),onClick:d,onKeyDown:c=>{t&&c.key==="ArrowDown"&&w(c,-1)},"aria-label":"small-screen-product-btn",children:[u,e.jsx("span",{className:o("wm-arrow-drop-down wu-text-2xl wu-transition-transform wu-duration-300",t&&"wu-rotate-180")})]})}),Kr=({dir:a,isProductButtonShow:t,smallScreenToggleButtonRef:r,setIsProductButtonShow:s,setDropdownOpen:u})=>{const l=()=>{s(n=>!n),t&&u(!1)};return e.jsxs("button",{className:o("wu-relative wu-w-10 wu-h-10 wu-flex wu-flex-col wu-justify-center wu-items-center",a==="rtl"?"wu-mr-4":"wu-ml-4"),onClick:l,ref:r,"aria-label":"menu-toggle-btn",children:[e.jsx("span",{className:`wu-absolute wu-w-6 wu-h-[3px] wu-bg-white wu-transition-transform wu-duration-300 ${t?"wu-rotate-45 wu-translate-y-0":"-wu-translate-y-2.5"}`}),e.jsx("span",{className:`wu-absolute wu-w-6 wu-h-[3px] wu-bg-white wu-transition-opacity wu-duration-300 ${t?"wu-opacity-0":"wu-opacity-100"}`}),e.jsx("span",{className:`wu-absolute wu-w-6 wu-h-[3px] wu-bg-white wu-transition-transform wu-duration-300 ${t?"-wu-rotate-45 wu-translate-y-0":"wu-translate-y-2.5"}`})]})},Pa=({productCategories:a,activeProductName:t,activeProductColor:r={base:"#1b87e6",hover:"#54A5EC"},dir:s,homeLink:u,expandAll:l})=>{const n=i.useRef(null),d=i.useRef(null),w=i.useRef(null),c=i.useRef(null),[f,b]=i.useState(!1),[x,v]=i.useState(null),[m,p]=i.useState(r.base),[C,S]=i.useState(""),[g,N]=i.useState(!1),k=Hr(768);Ze([d,n],()=>{b(!1),v(null)}),Ze([w,c,d],()=>{N(!1),b(!1),v(null)}),i.useEffect(()=>{const O=M=>{M.key==="Escape"&&b(!1)};return document.addEventListener("keydown",O),()=>{document.removeEventListener("keydown",O)}},[f]),i.useEffect(()=>p(r.base),[r.base]);const T=O=>{O.preventDefault(),O.stopPropagation(),b(M=>{const W=!M;return W||v(null),W})},I=(O,M)=>{console.log(O),Ar({productCategories:a,openCategory:x,setOpenCategory:v})(O,M,C)};return e.jsx("div",{className:o("wu-inline-flex wu-items-center wu-justify-between wu-relative wu-z-auto wu-h-12 wu-text-white"),children:k?e.jsxs("div",{className:"wu-relative wu-flex",children:[e.jsx(Kr,{dir:s,isProductButtonShow:g,smallScreenToggleButtonRef:c,setDropdownOpen:b,setIsProductButtonShow:N}),e.jsx(Jr,{isProductButtonShow:g,isDropdownOpen:f,activeProductColor:r,activeProductBgColor:m,activeProductName:t,handleDropdownToggle:T,smallScreenButtonRef:w,handleKeyDown:I,dir:s}),e.jsx("div",{className:o("wu-absolute wu-top-[92px] wu-left-0 wu-text-[18px]",s==="rtl"&&"wu-right-[256px] wu-left-auto"),children:e.jsx(La,{activeProductName:t,focusItem:C,setFocusItem:S,handleKeyDown:I,isDropdownOpen:f,openCategory:x,productCategories:a,setOpenCategory:v,dropdownRef:d,expandAll:l,dir:s})})]}):e.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:m},onMouseOver:()=>p(r.hover),onMouseOut:()=>p(r.base),children:[e.jsx(Ur,{activeProductName:t,dir:s,homeLink:u,buttonRef:n,handleDropdownToggle:T,handleKeyDown:I,isDropdownOpen:f}),e.jsx(La,{activeProductName:t,focusItem:C,setFocusItem:S,handleKeyDown:I,isDropdownOpen:f,openCategory:x,productCategories:a,setOpenCategory:v,dropdownRef:d,expandAll:l,dir:s})]})})},za=({children:a,dir:t,className:r})=>e.jsx("section",{className:o("wu-flex wu-items-center wu-flex-1 wu-min-w-0 wu-h-12 wu-gap-2 wu-px-2",t==="rtl"&&"wu-flex-row-reverse",r),children:e.jsx("div",{className:"wu-grow",children:a})}),He=y.forwardRef(({className:a,type:t,...r},s)=>e.jsx("input",{type:t,className:o("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",a),ref:s,...r}));He.displayName="Input";const Xr=a=>{const{message:t,className:r,...s}=a;return e.jsx("p",{...s,className:o("wu-text-sub-3 wu-break-words wu-font-light",r),style:{color:"rgb(var(--wu-red-deep))",...s.style},children:t})},Qr=a=>{var d,w;const{inputRef:t,maxLength:r=50,className:s,...u}=a,[l,n]=i.useState(!1);return i.useEffect(()=>{var c;(((c=t==null?void 0:t.current)==null?void 0:c.value.length)||0)>.75*r?n(!0):n(!1)},[(d=t==null?void 0:t.current)==null?void 0:d.value,r]),e.jsx("p",{...u,className:o("wu-text-sub-3 wu-font-light",s),style:{color:"rgb(var(--wu-gray-subtle))",...u.style},children:l&&`${(w=t==null?void 0:t.current)==null?void 0:w.value.length}/${r}`})},Zr=K.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"),me=y.forwardRef(({className:a,...t},r)=>e.jsx(Sa.Root,{ref:r,className:o(Zr(),a),...t}));me.displayName=Sa.Root.displayName;const R=a=>e.jsx(me,{...a,className:o("wu-text-gray-lead wu-leading-6",a.className)}),Rr=({Label:a,Error:t,Hint:r,Input:s,labelPosition:u="top",dir:l="ltr",className:n,...d})=>{const c=o("wu-flex",u==="top"?"wu-flex-col wu-gap-1":"wu-flex-row wu-items-center wu-gap-2",n),f=o("wu-flex wu-flex-col wu-gap-1 wu-relative wu-flex-1 wu-form-group-wrapper"),b=o("wu-absolute -wu-bottom-5",l==="ltr"?"wu-right-0":"wu-left-0","wu-form-group-hint"),x=o("wu-absolute -wu-bottom-5",l==="ltr"?"wu-left-0":"wu-right-0","wu-form-group-error");return e.jsxs("div",{className:c,dir:l,...d,children:[a,e.jsxs("div",{className:f,children:[s,r&&e.jsx("div",{className:b,children:r}),t&&e.jsx("div",{className:x,children:t})]})]})},xe=i.forwardRef((a,t)=>{const{Label:r,labelPosition:s="top",Icon:u,iconPosition:l,type:n,value:d,variant:w="flat",readonly:c,id:f=ze(),...b}=a,x=Ie(s),v=u?l!=="right"?"wu-pl-8":"wu-pr-8":"",[m,p]=i.useState(!1),C=()=>{p(g=>!g)},S=g=>{b.onChange&&b.onChange(g)};return e.jsx(e.Fragment,{children:n==="submit"?e.jsx(V,{type:"submit",className:b.className,id:f,children:r||"Submit"}):e.jsx("div",{className:o("wu-flex wu-flex-col wu-gap-2 wu-input-container"),dir:b.dir,children:e.jsxs("div",{className:o("wu-flex wu-gap-1 wu-relative",x,(s==="right"||s==="left")&&"wu-items-center","wu-input-wrapper"),children:[u&&l!=="right"&&e.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}),e.jsx(He,{...b,className:o("wu-peer wu-text-xs wu-rounded-t-sm",w==="outlined"?"wu-border wu-border-gray-subtle":"",v,b.className),type:m?"text":n,ref:t,readOnly:c,onChange:b.onChange&&S,value:d,id:f}),u&&l==="right"&&e.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}),n==="password"&&e.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:C,children:e.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:m?e.jsx("span",{className:"wm-visibility wu-text-gray-subtle"}):e.jsx("span",{className:"wm-visibility-off wu-text-gray-subtle"})})}),r&&e.jsx(R,{htmlFor:f,className:"wu-input-label",children:r})]})})})});xe.displayName="WuInput";const es=({className:a,placeholder:t="Search surveys, folders or tools",defaultCollapsed:r=!0,onSearch:s,...u})=>{const[l,n]=i.useState(r);return i.useEffect(()=>{n(r)},[r]),e.jsx(xe,{...u,placeholder:t,onChange:d=>s(d.target.value),className:o("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",l?"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",a),type:"search",Icon:e.jsx(we,{"data-testid":"search-icon",icon:"wm-search",className:o("wu-text-gray-lead wu-cursor-pointer",l&&"wu-text-white"),onClick:()=>n(d=>!d)})})},Ha=ke.Provider,Aa=ke.Root,qa=ke.Trigger,aa=y.forwardRef(({className:a,sideOffset:t=4,...r},s)=>e.jsx(ke.Content,{ref:s,sideOffset:t,className:o("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",a),...r}));aa.displayName=ke.Content.displayName;const Ae=i.forwardRef(({content:a,position:t,positionOffset:r,duration:s,children:u,className:l,showArrow:n=!1,...d},w)=>e.jsx(Ha,{delayDuration:s||200,children:e.jsxs(Aa,{children:[e.jsx(qa,{asChild:!0,children:e.jsx("span",{ref:w,children:u})}),e.jsx(Je.Portal,{children:a&&e.jsxs(aa,{...d,side:t||"top",sideOffset:r||0,className:o("wu-max-w-sm wu-max-h-96 wu-overflow-y-auto",l),children:[a,n&&e.jsx(Je.Arrow,{className:"wu-fill-gray-notification wu-tooltip-arrow"})]})})]})}));Ae.displayName="WuTooltip";const as=({label:a,className:t})=>{const r=i.useRef(null),[s,u]=i.useState(!1);return i.useEffect(()=>{const l=r.current;if(l){const n=l.clientWidth,d=l.scrollWidth,w=d/a.length,c=a.length*w;u(c>n||d>n)}},[a]),e.jsx("p",{ref:r,className:o("wu-w-full wu-truncate",t),children:s?e.jsx(Ae,{content:a,positionOffset:8,children:a}):a})},ts=a=>{const{productName:t,categories:r=[],user:s,children:u,onLogout:l,homeLink:n=window.location.origin,brandColor:d,dir:w="ltr",expandAll:c,DataCenter:f}=a;return e.jsx("div",{className:"wu-sticky wu-top-0 wu-z-50 wu-w-full",children:e.jsxs("header",{className:o("wu-h-12 wu-flex wu-items-center wu-justify-between wu-relative wu-bg-blue-switcher wu-text-white",w==="rtl"&&"wu-flex-row-reverse",a.className),style:a.style,children:[e.jsx("section",{className:"wu-flex wu-items-center wu-gap-2 wu-shrink-0",children:e.jsx(Pa,{productCategories:r,activeProductName:t,activeProductColor:d,dir:w,homeLink:n,expandAll:c})}),e.jsx(za,{dir:w,children:u}),e.jsxs("section",{className:o("wu-flex wu-items-center wu-justify-end wu-shrink-0 wu-gap-2",w==="rtl"?"wu-flex-row-reverse wu-pl-4":"wu-flex-row wu-pr-4"),children:[e.jsx(Oa,{dir:w}),(s==null?void 0:s.profile)&&Object.keys(s.profile).length>0&&e.jsx(_a,{user:s,onLogout:l,dir:w,DataCenter:f})]})]})})},ee=Te.Root,de=Te.Trigger,Q=y.forwardRef(({className:a,align:t="center",sideOffset:r=4,...s},u)=>e.jsx(Te.Portal,{children:e.jsx(Te.Content,{ref:u,align:t,sideOffset:r,className:o("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",a),...s})}));Q.displayName=Te.Content.displayName;function Ba({className:a,classNames:t,dir:r="ltr",...s}){const u=Ca.getDefaultClassNames();return e.jsx(Ca.DayPicker,{showOutsideDays:s.showOutsideDays||!1,className:o("wu-p-3",a),classNames:{root:o(u.root,"wu-relative wu-rounded-none wu-bg-white dark:wu-bg-gray-switcher"),caption_label:o("wu-text-xs",s.captionLayout==="dropdown"?"wu-hidden":""),month_caption:o(u.month_caption,"wu-mb-5"),months:o(u.months,"wu-flex wu-flex-col sm:wu-flex-row wu-gap-4"),dropdowns:o(u.dropdowns,"wu-flex wu-items-center wu-justify-start wu-gap-2",(s.mode==="range","")),dropdown:o(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:o(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:o(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:o(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:o(u.selected,"wu-bg-blue-p [&:not(.rm)]:wu-text-white hover:wu-bg-blue-pHover"),range_middle:o("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:o(u.range_end,"wu-rounded-none"),range_start:o(u.range_start,"wu-rounded-none wu-bg-blue-p hover:wu-bg-blue-pHover"),month_grid:o(u.month_grid,"[&>thead>tr>th]:wu-pb-2 wu-border-collapse wu-space-y-1"),button_next:o(u.button_next,ea({variant:"iconOnly"}),"wu-h-6 wu-w-6 wu-text-gray-lead"),button_previous:o(u.button_previous,ea({variant:"iconOnly"}),"wu-h-6 wu-w-6 wu-rotate-180 wu-text-gray-lead"),nav:o(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:o(u.chevron,"!wu-text-red-500"),outside:o(u.outside,"wu-invisible"),disabled:o(u.disabled,"hover:wu-bg-white wu-text-gray-subtle"),...t},components:{Chevron:()=>e.jsx("span",{className:"wm-chevron-right wu-text-lg wu-leading-5"})},...s})}Ba.displayName="Calendar";const ta=a=>e.jsx(Ba,{...a}),ja=a=>{const{handleDateChange:t,disabled:r,onReset:s,showResetButton:u}=a;return e.jsxs("div",{className:"wu-flex wu-items-center wu-justify-end wu-gap-2 wu-mt-2 wu-date-picker-footer",children:[u&&e.jsx(V,{variant:"secondary",onClick:s,Icon:e.jsx("span",{className:"wu-text-[20px] wu-leading-5 -wu-mt-[1px] wm-refresh"}),className:"wu-date-picker-footer-reset",children:"Reset"}),e.jsx(Se.PopoverClose,{asChild:!0,children:e.jsx(V,{onClick:t,disabled:r,className:"wu-date-picker-apply",children:"Apply"})})]})},ra=({formattedString:a,dir:t,placeholder:r="Select Date",className:s,...u})=>e.jsx(Se.PopoverTrigger,{asChild:!0,dir:t,children:e.jsx(V,{...u,className:o("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",s),variant:"primary",Icon:e.jsx("span",{className:"wm-calendar-month wu-text-sm"}),iconPosition:"right",children:a||r})}),Fa=(a,t,r,s)=>!!(t||r&&a<r||s&&a>s),qe=a=>a?typeof a=="string"?new Date(a):a:new Date,sa="\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01])",rs=[{label:"Last 7 days",value:7},{label:"Last 30 days",value:30},{label:"Last 90 days",value:90},{label:"Last 365 days",value:365}],ss=({formatString:a="yyyy-MM-dd",value:t,onChange:r,disabled:s,minDate:u=A.sub(new Date,{years:5}),maxDate:l=A.add(new Date,{years:1}),className:n,dir:d="ltr",Label:w,labelPosition:c="top",onReset:f,showResetButton:b=!1,placeholder:x="Select Date",...v})=>{const[m,p]=i.useState(),[C,S]=i.useState(""),g=i.useCallback(()=>{const k=qe(m);S(A.format(k,a)),r&&r(m)},[m,a,r]),N=i.useCallback(()=>{f?f():(p(void 0),S(""),r&&r(void 0))},[r,f]);return i.useEffect(()=>{const k=qe(t);p(k),S(A.format(k,a))},[t,a]),e.jsxs(R,{className:o("wu-flex wu-gap-1",c==="left"?"wu-items-center":"wu-flex-col wu-items-start","wu-date-picker-label"),dir:d,children:[w,e.jsxs(ee,{children:[e.jsx(ra,{...v,formattedString:C,dir:d,placeholder:x}),e.jsx(Q,{className:"wu-p-0 wu-w-fit wu-date-picker-content",align:"start",sideOffset:-.5,dir:d,children:e.jsx(ta,{dir:d,mode:"single",captionLayout:"dropdown",selected:m,onSelect:p,disabled:k=>Fa(k,s,u,l),startMonth:u,endMonth:l,required:!0,autoFocus:!0,defaultMonth:m,className:o("wu-border wu-border-blue-p",n),footer:e.jsx(ja,{handleDateChange:g,disabled:s,onReset:N,showResetButton:b})})})]})]})},Ua="yyyy-MM-dd",us=[{label:"Day",value:1},{label:"Week",value:7},{label:"Month",value:30},{label:"Quarter",value:90},{label:"Year",value:365}],os=({current:a,onSelect:t,presetRanges:r=rs})=>{const[s,u]=i.useState(),[l,n]=i.useState(!1),[d,w]=i.useState(""),[c,f]=i.useState(""),[b,x]=i.useState(!1),v=i.useMemo(()=>r.map(g=>g.value),[r]),m=o("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"),p=i.useCallback(g=>{if(g===void 0){u(void 0),n(!0);return}const N=Number(g)-1;u(N),n(!1),t({from:A.sub(new Date,{days:N}),to:new Date})},[t]),C=i.useCallback((g,N)=>{if(!g||!(a!=null&&a.to)||!(a!=null&&a.from)||!new RegExp(sa).test(g))return!1;const T=new Date(N==="start"?g:a.from),I=new Date(N==="end"?g:a.to);return A.isBefore(I,T)?(x(!0),!1):(x(!1),!(A.isSameDay(T,a.from)&&A.isSameDay(I,a.to)))},[a]),S=i.useCallback((g,N)=>{if((N==="start"?w:f)(g),C(g,N)){const T={from:a==null?void 0:a.from,to:a==null?void 0:a.to};N==="start"&&(T.from=new Date(g)),N==="end"&&(T.to=new Date(g)),t(T)}},[a,t,C]);return i.useEffect(()=>{if(a!=null&&a.to&&(a!=null&&a.from)&&A.isValid(a.to)&&A.isValid(a.from)){w(A.format(a.from,Ua)),f(A.format(a.to,Ua));const g=A.differenceInCalendarDays(a.to,a.from);A.isToday(a.to)&&v.includes(g+1)?(u(g),n(!1)):(u(void 0),n(!0))}},[a,v]),e.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:[e.jsx("ul",{className:"wu-flex wu-gap-1 wu-py-2 wu-date-picker-batch-list",children:us.map(({label:g,value:N})=>e.jsx(he,{variant:"secondary",className:"wu-px-1 wu-py-1 wu-text-xs wu-h-fit wu-min-w-fit disabled:wu-bg-white",disabled:N!==1,children:g},N))}),e.jsxs("ul",{className:"wu-flex wu-flex-col wu-gap-1 wu-date-picker-ranges",children:[r.map(({label:g,value:N})=>e.jsx("li",{children:e.jsx("button",{className:o(m,s===N-1&&"wu-bg-blue-p/10"),onClick:()=>p(N),children:g})},N)),e.jsx("li",{children:e.jsx("button",{className:o(m,l&&"wu-bg-blue-p/10"),onClick:()=>p(),children:"Custom Range"})})]}),e.jsxs("div",{className:"wu-relative wu-flex wu-gap-3 wu-pt-2 wu-date-picker-range-footer",children:[e.jsx(xe,{placeholder:"Start Date",pattern:sa,value:d,onChange:g=>S(g.target.value,"start"),"aria-label":"Start Date"}),e.jsx(xe,{placeholder:"End Date",pattern:sa,value:c,onChange:g=>S(g.target.value,"end"),"aria-label":"End Date"}),b?e.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"}):e.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"})]})]})},ls=({formatString:a="yyyy/MM/dd",value:t,onChange:r,disabled:s,minDate:u=A.sub(new Date,{years:5}),maxDate:l=A.add(new Date,{years:1}),className:n,dir:d="ltr",minDateToSelect:w,maxDateToSelect:c,presetRanges:f,Label:b,labelPosition:x="top",onReset:v,showResetButton:m=!0,placeholder:p="Select Date Range"})=>{const[C,S]=i.useState(t),[g,N]=i.useState(t),[k,T]=i.useState(""),I=i.useCallback(()=>{if(g){const W=g.from,q=g.to;S({from:W,to:q}),T(`${A.format(W,a)} - ${A.format(q,a)}`),r&&r({from:W,to:q})}},[g,a,r]),O=i.useCallback(()=>{N(C)},[C]),M=i.useCallback(()=>{v?v():(S(void 0),N(void 0),T(""),r&&r(void 0))},[v,r]);return i.useEffect(()=>{if(t!=null&&t.from&&(t!=null&&t.to)){const W=qe(t.from),q=qe(t.to);S(t),N(t),T(`${A.format(W,a)} - ${A.format(q,a)}`)}else S(void 0),N({to:new Date,from:new Date})},[t,a]),e.jsxs(me,{className:o("wu-flex wu-gap-1",x==="left"?"wu-items-center":"wu-flex-col wu-items-start","wu-date-picker-label"),dir:d,children:[b,e.jsxs(ee,{onOpenChange:W=>!W&&O(),children:[e.jsx(ra,{formattedString:k,dir:d,placeholder:p}),e.jsxs(Q,{className:"wu-flex wu-p-0 wu-border wu-w-fit wu-border-blue-p",align:"start",sideOffset:-.5,dir:d,children:[e.jsx(os,{current:g,onSelect:N,presetRanges:f}),e.jsx(ta,{dir:d,numberOfMonths:2,mode:"range",captionLayout:"dropdown",selected:g,onSelect:N,disabled:W=>Fa(W,s,u,l),startMonth:u,endMonth:l,required:!0,autoFocus:!0,defaultMonth:C==null?void 0:C.from,className:o("wu-shadow-none",n),min:w,max:c,footer:e.jsx(ja,{handleDateChange:I,disabled:s,onReset:M,showResetButton:m})})]})]})]})},$a=y.forwardRef(({className:a,partial:t,...r},s)=>e.jsx(Ke.Root,{ref:s,className:o("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",a),...r,children:e.jsxs(Ke.Indicator,{className:o("wu-flex wu-items-center wu-justify-center wu-text-current"),children:[!t&&e.jsx("span",{className:"wm-check wu-text-base wu-leading-4"}),t&&e.jsx("span",{className:"wm-check-indeterminate-small wu-text-base wu-leading-4"})]})}));$a.displayName=Ke.Root.displayName;const ae=i.forwardRef((a,t)=>{const{disabled:r,checked:s,Label:u,labelPosition:l="right",className:n,id:d=ze(),partial:w,onChange:c,required:f,readonly:b,...x}=a;return i.useEffect(()=>{x.defaultChecked!==void 0&&s!==void 0&&console.error("WuCheckbox: Both `checked` and `defaultChecked` cannot be used together. Use only one of them.")},[x.defaultChecked,s]),e.jsxs("div",{className:ns({labelPosition:l,className:"wu-checkbox-container"}),dir:x.dir,children:[e.jsx($a,{id:d,...x,partial:w,checked:s,disabled:r||b,onCheckedChange:c,className:o("wu-peer wu-checkbox",n),required:f,ref:t}),u&&e.jsx(R,{htmlFor:d,className:"wu-w-full wu-checkbox-label",children:u})]})}),ns=K.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"}}});ae.displayName="WuCheckbox";const ua=y.forwardRef(({className:a,...t},r)=>e.jsx(U.Command,{ref:r,className:o("wu-flex wu-h-full wu-w-full wu-flex-col wu-overflow-hidden wu-rounded-md",a),...t}));ua.displayName=U.Command.displayName;const Ga=y.forwardRef(({className:a,...t},r)=>e.jsx("div",{className:"wu-flex wu-items-center wu-border-b wu-px-3",children:e.jsx(U.Command.Input,{ref:r,className:o("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",a),...t})}));Ga.displayName=U.Command.Input.displayName;const oa=y.forwardRef(({className:a,...t},r)=>e.jsx(U.Command.List,{ref:r,className:o("",a),...t}));oa.displayName=U.Command.List.displayName;const la=y.forwardRef((a,t)=>e.jsx(U.Command.Empty,{ref:t,className:"wu-text-center wu-p-2 wu-pb-2.5 wu-text-xs",...a}));la.displayName=U.Command.Empty.displayName;const Be=y.forwardRef(({className:a,...t},r)=>e.jsx(U.Command.Group,{ref:r,className:o("",a),...t}));Be.displayName=U.Command.Group.displayName;const Va=y.forwardRef(({className:a,...t},r)=>e.jsx(U.Command.Separator,{ref:r,className:o("wu-mx-1 wu-my-1 wu-h-px wu-bg-gray-20",a),...t}));Va.displayName=U.Command.Separator.displayName;const De=y.forwardRef(({className:a,...t},r)=>e.jsx(U.Command.Item,{ref:r,className:o("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",a),...t}));De.displayName=U.Command.Item.displayName;const ie=y.forwardRef(({className:a,children:t,thumbColor:r,railColor:s,...u},l)=>e.jsxs(ne.Root,{ref:l,className:o("wu-relative wu-overflow-hidden",a),children:[e.jsx(ne.Viewport,{className:"wu-h-full wu-w-full wu-rounded-[inherit]",...u,children:t}),e.jsx(Ya,{thumbColor:r,railColor:s}),e.jsx(ne.Corner,{})]}));ie.displayName=ne.Root.displayName;const Ya=y.forwardRef(({className:a,orientation:t="vertical",thumbColor:r="#d4d4d4",railColor:s="#eeeeee",...u},l)=>e.jsx(ne.ScrollAreaScrollbar,{ref:l,orientation:t,className:o("wu-flex wu-touch-none wu-select-none wu-transition-colors",t==="vertical"&&"wu-h-full wu-w-2 wu-border-l wu-border-l-transparent wu-p-[1px]",t==="horizontal"&&"wu-h-2 wu-flex-col wu-border-t wu-border-t-transparent wu-p-[1px]",a),style:{background:s},...u,children:e.jsx(ne.ScrollAreaThumb,{className:"wu-relative wu-flex-1 wu-rounded-full",style:{background:r}})}));Ya.displayName=ne.ScrollAreaScrollbar.displayName;const ye=i.forwardRef(({containerHeight:a=400,list:t,callback:r,dir:s,className:u,style:l},n)=>e.jsx(Nr.Virtuoso,{ref:n,dir:s,className:u,style:{height:a,scrollbarWidth:"thin",scrollbarColor:"#d4d4d4 #f1f1f1",overflowX:"hidden",...l},data:t,itemContent:(d,w)=>r(d,w)}));ye.displayName="WuVirtualScroll";const ws=({tags:a,triggerRef:t})=>{const[r,s]=i.useState([]),[u,l]=i.useState([]),n=i.useMemo(()=>e.jsx("ul",{className:"wu-flex wu-flex-col wu-items-start wu-justify-center wu-list-none",children:u.map((w,c)=>e.jsx("li",{className:"wu-py-1 wu-text-xs wu-text-left",children:w},c))}),[u]),d=w=>{const c=document.createElement("div");Object.assign(c.style,{display:"inline-block",visibility:"hidden",position:"absolute",whiteSpace:"nowrap"}),c.textContent=w,document.body.appendChild(c);const f=c.offsetWidth;return document.body.removeChild(c),f+8};return i.useEffect(()=>{const w=()=>{if(t.current){const x=t.current.offsetWidth-20-36;let v=0;const m=[],p=[];a.forEach(C=>{const S=d(C);v+S+8<x?(m.push(C),v+=S+8):p.push(C)}),s(m),l(p)}};return w(),window.addEventListener("resize",w),()=>{window.removeEventListener("resize",w)}},[a,t]),e.jsxs("div",{className:"wu-flex wu-items-center wu-gap-2 wu-text-xs",children:[r.map((w,c)=>e.jsx("span",{className:"wu-px-1 wu-py-0.5 wu-text-xs wu-rounded-sm wu-bg-gray-10 wu-combobox-tag",children:w},c)),u.length>0&&e.jsx(Ae,{content:n,className:"wu-z-[51] wu-text-left",children:e.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]})})]})},ds=({placeholder:a="Select...",isEllipse:t=!1,selectedOptions:r,variant:s="flat",dir:u="ltr",accessorKey:l,multiple:n,id:d,disabled:w,selectAll:c,isCheckedAll:f,className:b,...x})=>{const[v,m]=i.useState([]),p=i.useRef(null);i.useEffect(()=>{if(!r||Array.isArray(r)&&r.length===0){m([]);return}if(n){const S=r;m(S==null?void 0:S.map(g=>g[l.label]));return}else m([r[l.label]])},[r]);const C=()=>{var S;return v.length?f&&(c!=null&&c.enable)&&(c!=null&&c.triggerText)?e.jsx("span",{className:"wu-overflow-hidden wu-text-xs wu-text-start wu-text-ellipsis wu-whitespace-nowrap",children:c.triggerText}):t?e.jsx("span",{className:"wu-overflow-hidden wu-text-xs wu-text-start wu-text-ellipsis wu-whitespace-nowrap",style:{width:`${(((S=p.current)==null?void 0:S.offsetWidth)||0)-32}px`},children:v.join(", ")}):e.jsx(ws,{tags:v,triggerRef:p}):e.jsx("p",{className:"wu-text-xs wu-opacity-70",children:a})};return e.jsx(de,{dir:u,asChild:!0,id:d,disabled:w,children:e.jsxs("button",{...x,ref:p,disabled:w,className:o("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",b),children:[C(),e.jsx("span",{className:"wm-arrow-drop-down group-data-[state=open]:wu-rotate-180 wu-transition-transform wu-duration-300 wu-text-base"})]})})},Ja=L.Root,Ka=L.Trigger,Xa=L.Group,is=L.Portal,cs=L.Sub,fs=L.RadioGroup,Qa=y.forwardRef(({className:a,inset:t,children:r,position:s,...u},l)=>e.jsxs(L.SubTrigger,{ref:l,className:o("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",t&&"wu-pl-8",a),...u,children:[s==="left"&&e.jsx("span",{className:o("wm-chevron-right",u.dir==="rtl"&&"ml-2")}),r,s!=="left"&&e.jsx("span",{className:o("wu-text-base wu-leading-4",u.dir==="rtl"&&"wu-mr-auto wm-chevron-left",u.dir!=="rtl"&&"wu-ml-auto wm-chevron-right")})]}));Qa.displayName=L.SubTrigger.displayName;const Za=y.forwardRef(({className:a,...t},r)=>e.jsx(L.SubContent,{ref:r,className:o("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",a),...t}));Za.displayName=L.SubContent.displayName;const na=y.forwardRef(({className:a,sideOffset:t=4,...r},s)=>e.jsx(L.Portal,{children:e.jsx(L.Content,{ref:s,sideOffset:t,className:o("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",a),...r})}));na.displayName=L.Content.displayName;const je=y.forwardRef(({className:a,inset:t,...r},s)=>e.jsx(L.Item,{ref:s,className:o("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",t&&"wu-pl-8",a),...r}));je.displayName=L.Item.displayName;const Ra=y.forwardRef(({className:a,children:t,checked:r,dir:s,...u},l)=>e.jsxs(L.CheckboxItem,{ref:l,className:o("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",a),checked:r,...u,children:[e.jsx("span",{className:o("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:e.jsx(L.ItemIndicator,{children:e.jsx("span",{className:"wm-check wu-text-base wu-text-white"})})}),t]}));Ra.displayName=L.CheckboxItem.displayName;const et=y.forwardRef(({className:a,children:t,...r},s)=>e.jsxs(L.RadioItem,{ref:s,className:o("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",a),...r,children:[e.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:e.jsx(L.ItemIndicator,{className:"wu-w-4 wu-h-4 wu-flex wu-items-center wu-justify-center",children:e.jsx("span",{className:"wm-circle wu-text-blue-p group-hover:group-data-[state=checked]:wu-text-blue-q wu-text-xs"})})}),t]}));et.displayName=L.RadioItem.displayName;const We=y.forwardRef(({className:a,inset:t,...r},s)=>e.jsx(L.Label,{ref:s,className:o("wu-p-2 wu-font-medium wu-text-xs",t&&"wu-pl-8",a),...r}));We.displayName=L.Label.displayName;const Fe=y.forwardRef(({className:a,...t},r)=>e.jsx(L.Separator,{ref:r,className:o("-wu-mx-1 wu-my-1 wu-h-px wu-bg-gray-20",a),...t}));Fe.displayName=L.Separator.displayName;const at=({option:a,value:t,multiple:r=!1,onSelect:s,accessorKey:u,dir:l})=>{const[n,d]=i.useState(r?[]:"");i.useEffect(()=>{t&&d(r?t.map(b=>JSON.stringify(b[u.value])):JSON.stringify(t[u.value]))},[t,u.value,r]);const w=r?n.includes(JSON.stringify(a[u.value])):n===JSON.stringify(a[u.value]),c=()=>{a.disabled||s(a)};return e.jsxs(De,{onSelect:c,disabled:a.disabled,className:o("wu-cursor-pointer wu-text-xs wu-h-8 wu-py-0 wu-combobox-item hover:wu-bg-gray-100",w&&"wu-bg-gray-10"),dir:l,children:[r&&e.jsx(ae,{checked:w}),e.jsx(ps,{option:a,accessorKey:u})]})},ps=({option:a,accessorKey:t})=>{const r=a[t.label];return e.jsxs("div",{className:"wu-flex wu-items-center wu-w-full wu-gap-1",children:[a.icon&&a.icon,r,a.isAdmin&&e.jsx("span",{className:"wu-ml-auto wu-text-sm wm-lock wu-text-orange-deep"})]})},tt=a=>{const{option:t,selectAll:r,handleSelectAll:s,isCheckedAll:u,isPartialSelected:l,...n}=a;switch("type"in t?t.type:"option"){case"all":return e.jsx(De,{onSelect:s,className:o("wu-cursor-pointer wu-text-xs wu-h-8 wu-py-0 wu-select-item"),dir:n.dir,children:e.jsx(ae,{checked:u||l,partial:l,"data-partial":l,Label:(r==null?void 0:r.label)||"Select All"})});case"group":return e.jsxs(Be,{children:[e.jsx(We,{children:t.label}),t.options.map((w,c)=>i.createElement(at,{...n,option:w,key:c}))]});case"divider":return e.jsx(Va,{className:"wu-mx-4"});default:return e.jsx(at,{...n,option:t})}},bs=a=>{const t=[],r=[],s=[],u=[];return a.forEach(l=>{l.type==="group"?(t.push(l),s.push(...l.options),u.push(...l.options.filter(n=>!n.disabled))):l.type==="divider"?r.push(l):s.push(l),l!=null&&l.disabled||u.push(l)}),{groups:t,dividers:r,allOptions:s,enabledOptions:u}},hs=i.memo(xe),gs=({data:a,accessorKey:t,value:r,defaultValue:s,Header:u,virtualizedThreshold:l=100,isEllipse:n,placeholder:d,variant:w,dir:c,onSelect:f,Label:b,maxHeight:x=420,multiple:v=!1,hasGroup:m=!1,selectAll:p,id:C,disabled:S,labelPosition:g="top",className:N,onScroll:k,...T})=>{const[I,O]=i.useState(""),[M,W]=i.useState(),[q,re]=i.useState(!1),[D,B]=i.useState(!1),[Y,$]=i.useState(!1),le=i.useRef(null),{allOptions:X,groups:ve,dividers:Ne,enabledOptions:se}=i.useMemo(()=>m||p&&!p.includeDisabled?bs(a):{allOptions:a,groups:[],dividers:[],enabledOptions:[]},[a,m]),E=i.useMemo(()=>{if(!I)return a;const H=I.toLowerCase();return X.filter(te=>te[t.label].toLowerCase().includes(H))},[I,X,a,t.label]),_=i.useMemo(()=>v&&p!=null&&p.enable&&!I&&E.length>0?[{type:"all"},...E]:E,[E,I,v]),j=i.useMemo(()=>{const H=32*_.length+Ne.length*9+ve.length*48;return Math.min(x,H)},[x,_,Ne,ve]),J=i.useCallback(H=>{const te=H[t.value];v?W(Ru=>{const va=Ru||[],br=va.some(Na=>Na[t.value]===te)?va.filter(Na=>Na[t.value]!==te):[...va,H];return f==null||f(br),br}):(re(!1),W(H),f==null||f(H))},[v,t.value,f]),Ce=i.useCallback(H=>O(H.target.value),[]),Ee=i.useCallback(()=>O(""),[]);i.useEffect(()=>{if(r!==void 0&&s!==void 0){console.error("defaultValue and value cannot be used simultaneously");return}else r!==void 0?W(r):s!==void 0&&W(s)},[r,s]),i.useEffect(()=>{if(!v)return;const H=p!=null&&p.includeDisabled?(M==null?void 0:M.length)===X.length:(M==null?void 0:M.length)===se.length;B(H);const te=(M==null?void 0:M.length)>0&&!H;$(te)},[M,p]);const ue=i.useCallback(()=>{const H=D?[]:p!=null&&p.includeDisabled?X:se;W(H),f==null||f(H)},[D,v,X,se,f,p]),Le=Ie(g);return e.jsxs("div",{className:o(Le,"wu-flex wu-combobox-container"),ref:le,children:[e.jsxs(ee,{onOpenChange:H=>{H&&Ee(),re(H)},open:q,modal:!0,children:[e.jsx(ds,{...T,selectedOptions:M,accessorKey:t,isEllipse:n,placeholder:d,variant:w,dir:c,multiple:v,disabled:S,selectAll:p,isCheckedAll:D,className:N,id:C}),e.jsx(Q,{className:"wu-w-[--radix-popover-trigger-width] wu-p-0 wu-bg-white wu-border wu-border-blue-p wu-combobox-content",align:"start",sideOffset:-1,children:e.jsxs(ua,{id:C,children:[e.jsx("div",{className:"wu-m-2",children:e.jsx(hs,{placeholder:"Search...",Icon:e.jsx("span",{className:"wm-search"}),className:"wu-text-xs wu-combobox-search",onChange:Ce,name:"Search","aria-label":"Search",dir:c,iconPosition:c==="rtl"?"right":"left"})}),u,e.jsxs(oa,{children:[e.jsx(la,{children:"No results found."}),_.length>=l?e.jsx(ye,{className:"wu-combobox-list",containerHeight:x,list:_,callback:(H,te)=>e.jsx(tt,{option:te,value:M,onSelect:J,multiple:v,accessorKey:t,dir:c,selectAll:p,handleSelectAll:ue,isCheckedAll:D,isPartialSelected:Y},H),dir:c}):e.jsx(ie,{style:{maxHeight:j,height:"fit-content"},className:"wu-combobox-list",onScroll:k,children:_.map((H,te)=>e.jsx(tt,{option:H,value:M,onSelect:J,multiple:v,accessorKey:t,dir:c,selectAll:p,handleSelectAll:ue,isCheckedAll:D,isPartialSelected:Y},te))})]})]})})]}),b&&e.jsx(R,{htmlFor:C,className:"wu-combobox-label",children:b})]})},ms=a=>{const{textToCopy:t,notificationText:r,...s}=a,[u,l]=i.useState(!1),n=async()=>{if(t)try{await navigator.clipboard.writeText(t),l(!0),setTimeout(()=>l(!1),2e3)}catch(d){console.error("Failed to copy:",d)}};return e.jsxs(V,{...s,onClick:n,variant:"iconOnly",className:o("wu-relative",a.className),"aria-label":"Copy to clipboard",children:[r&&e.jsx("span",{className:o("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}),e.jsx(we,{icon:"wm-content-copy",className:"wu-text-lg"})]})},rt=({className:a,isLoading:t,loadingText:r,children:s,...u})=>e.jsxs("footer",{className:o("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",a),...u,children:[e.jsx("div",{className:"wu-flex-1",children:s}),t&&e.jsx(ge,{size:"16px",variant:"spinner",color:"#a3a3a3",message:r})]});rt.displayName="WuFooter";const st=i.forwardRef((a,t)=>{const{size:r="sm",idOrSlugOrUrl:s,variant:u="primary",...l}=a,n=r==="sm"?16:18,d=s.includes("http")?s:`/help/${s}.html`,w=u==="primary"?"wu-text-blue-p":"wu-text-gray-lead";return e.jsx("button",{...l,ref:t,onClick:()=>Qe(d),children:e.jsx("span",{className:o("wm-help wu-text-gray-subtle",`wu-text-[${n}px]`,w,l.disabled&&"wu-text-neutral-300","wu-help-button-icon")})})});st.displayName="WuHelpButton";const xs=a=>{const{checked:t,onSelect:r,children:s,disabled:u,preventCloseOnSelect:l}=a;return e.jsx(Ra,{disabled:u,checked:t,onCheckedChange:r,onSelect:n=>l&&n.preventDefault(),children:s})},wa=a=>{const{children:t,className:r,Icon:s,iconPosition:u="left",disabled:l,onSelect:n,preventCloseOnSelect:d}=a,w=o("wu-flex wu-items-center wu-gap-2",s&&(u==="left"?"":"wu-justify-between wu-flex-row-reverse"),r),c=f=>{n&&n(f),d&&f.preventDefault()};return e.jsxs(je,{onSelect:c,disabled:l,className:w,children:[s&&e.jsx("div",{className:"wu-text-base",children:s}),t]})},ys=a=>{const{children:t,...r}=a;return e.jsxs(Xa,{...r,children:[e.jsx(We,{children:a.label}),t]})},vs=a=>{const{options:t,value:r,onSelect:s}=a;return e.jsx(fs,{value:r,onValueChange:s,children:t.map(u=>e.jsx(et,{value:u.value,disabled:u.disabled,children:u.label},u.value))})},Ns=a=>{const{className:t,...r}=a,s=o("wu-w-11/12 wu-mx-auto wu-border-gray-40",t);return e.jsx(Fe,{...r,className:s})},Cs=a=>{const{children:t,label:r,open:s,onOpenChange:u,height:l,dir:n,...d}=a;return e.jsxs(cs,{...d,open:s,onOpenChange:u,children:[e.jsx(Qa,{dir:n,children:r}),e.jsx(is,{children:e.jsx(Za,{onInteractOutside:w=>w.preventDefault(),children:e.jsx(ie,{className:"wu-h-fit",style:{height:l},dir:n,children:t})})})]})},Ss="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",ut=a=>{const{children:t,menuTitle:r,variant:s="flat",name:u,open:l,onOpenChange:n,height:d,preventCloseOnClickOutside:w,dir:c,Trigger:f,align:b="start",sideOffset:x=0,side:v="bottom",alignOffset:m,className:p,disabled:C,...S}=a;return e.jsxs(Ja,{...S,open:l,onOpenChange:n,dir:c,children:[e.jsx(Ka,{asChild:!0,dir:c,disabled:C,className:o("disabled:wu-text-zinc-300 disabled:wu-bg-white disabled:wu-cursor-not-allowed disabled:hover:wu-bg-transparent"),children:f??ks(s,u,C)}),e.jsx(na,{className:o("wu-w-56 wu-border wu-border-blue-p disabled:wu-border-gray-40",p,"wu-menu-content"),align:b,sideOffset:x,side:v,alignOffset:m,onInteractOutside:g=>w&&g.preventDefault(),children:e.jsxs(ie,{className:"h-fit",style:{height:d},dir:c,children:[r&&e.jsxs(e.Fragment,{children:[e.jsx(We,{dir:c,className:"wu-menu-title",children:r}),e.jsx(Fe,{className:"wu-mt-0 wu-menu-separator",dir:c})]}),t??e.jsx("p",{children:"Menu Is Empty"})]})})]})},ks=(a,t,r)=>{const s=o(Ss,"wu-flex wu-items-center wu-justify-between wu-gap-2 wu-h-8 wu-text-xs wu-group",a==="outlined"?"wu-border":"wu-border-b","wu-trigger-btn");return e.jsxs("button",{className:s,"aria-label":"menu-trigger",children:[e.jsx("span",{children:t??"Menu"}),e.jsx("span",{className:o("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")})]})},da=i.forwardRef(({showMenu:a=!1,className:t,color:r="#1B3380",...s},u)=>{const l=o("wu-w-full wu-border wu-transition-all wu-duration-300");return e.jsxs("div",{...s,className:o("wu-flex wu-flex-col wu-w-[18px] wu-justify-between wu-aspect-[3/2] wu-transition-all wu-duration-300",t),ref:u,"aria-label":"menu-icon",children:[e.jsx("div",{className:`${l} wu-origin-center ${a?"wu-rotate-45 wu-translate-y-[5px]":""}`,style:{borderColor:r}}),e.jsx("div",{className:`${l} ${a?"wu-opacity-0":""}`,style:{borderColor:r}}),e.jsx("div",{className:`${l} wu-origin-center ${a?"-wu-rotate-45 -wu-translate-y-[5px]":""}`,style:{borderColor:r}})]})});da.displayName="WuMenuIcon";const ot={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%]"},Ts=P.Root,Ms=P.Trigger,Is=P.Portal,Ds=P.Close,lt=i.forwardRef(({className:a,...t},r)=>e.jsx(P.Overlay,{ref:r,className:o("wu-fixed wu-inset-0 wu-z-50 wu-bg-black/30",ot.overlay,a),...t}));lt.displayName=P.Overlay.displayName;const nt=i.forwardRef(({className:a,children:t,hideCloseButton:r,...s},u)=>e.jsxs(Is,{children:[e.jsx(lt,{}),e.jsxs(P.Content,{ref:u,className:o("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",ot.content,a),...s,children:[t,!r&&e.jsx(P.Close,{"aria-label":"close",children:e.jsxs(he,{variant:"iconOnly",className:"wu-absolute wu-right-2 wu-top-1 hover:wu-bg-gray-lead/10",children:[e.jsx("span",{className:"wu-text-lg wm-close"}),e.jsx("span",{className:"wu-sr-only",children:"Close"})]})})]})]}));nt.displayName=P.Content.displayName;const wt=({className:a,...t})=>e.jsx("div",{className:o("wu-text-center wu-bg-gray-20 wu-w-full",a),...t});wt.displayName="DialogHeader";const dt=({className:a,...t})=>e.jsx("div",{className:o("wu-flex wu-flex-col-reverse sm:wu-flex-row sm:wu-justify-end sm:wu-space-x-2 wu-p-4",a),...t});dt.displayName="DialogFooter";const it=i.forwardRef(({className:a,...t},r)=>e.jsx(P.Title,{ref:r,className:o("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",a),...t}));it.displayName=P.Title.displayName;const Ws=i.forwardRef(({className:a,...t},r)=>e.jsx(P.Description,{ref:r,className:o("wu-text-sm wu-text-muted-foreground",a),...t}));Ws.displayName=P.Description.displayName;const _s="600px",Os={sm:"400px",md:"600px",lg:"1200px"},Es={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"},Ls=({Trigger:a,children:t,size:r="md",hideCloseButton:s,preventClickOutside:u,onOpenChange:l,open:n,dir:d,maxWidth:w,maxHeight:c,...f})=>e.jsxs(Ts,{...f,modal:!0,onOpenChange:l,open:n,children:[a&&e.jsx(Ms,{asChild:!0,children:a}),e.jsx(nt,{style:{width:"calc(100% - 64px)",maxWidth:w||Os[r],maxHeight:c||_s},hideCloseButton:s,onInteractOutside:b=>u&&b.preventDefault(),dir:d,"aria-describedby":void 0,children:t})]}),Ps=({children:a,style:t={},...r})=>e.jsx("div",{className:"wu-flex wu-flex-col wu-gap-4 wu-px-3 wu-py-4 rtl:wu-text-right wu-overflow-auto",children:e.jsx("div",{...r,style:{...t,paddingLeft:`${(Number(t==null?void 0:t.paddingLeft)||0)+4}px`,paddingRight:`${(Number(t==null?void 0:t.paddingRight)||0)+4}px`},children:a})}),zs=({children:a,className:t,...r})=>e.jsx(wt,{...r,className:o("wu-text-lg wu-text-gray-lead wu-font-medium",t),children:e.jsx(it,{children:a})}),Hs=({children:a,className:t,...r})=>e.jsx(dt,{...r,className:o("wu-border-t wu-border-gray-40 wu-bg-white wu-min-h-16 wu-mx-4 wu-px-0",t),children:a}),As=({children:a,variant:t="primary",className:r,...s})=>e.jsx(Ds,{...s,className:o("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",Es[t],r),children:a}),qs=({placeholder:a="Select...",value:t,multiple:r=!1,accessorKey:s,variant:u="flat",dir:l="ltr",customTriggerChildren:n,id:d,disabled:w,selectAll:c,isCheckedAll:f,width:b,...x})=>{const[v,m]=i.useState(""),[p,C]=i.useState(a);i.useEffect(()=>{if(!t||Array.isArray(t)&&t.length===0){C(a),m("");return}const g=s.label;if(r&&Array.isArray(t)){const N=t.map(k=>k[g]).join(", ");m(N)}else!r&&!Array.isArray(t)&&m(t[g])},[t,s.label,r,a]);const S=()=>a&&!v?e.jsx("p",{className:"wu-text-xs wu-opacity-70",children:p}):e.jsx("span",{className:o("wu-overflow-hidden wu-text-xs wu-text-start wu-text-ellipsis wu-whitespace-nowrap"),style:{width:`${(b||0)-32}px`},children:f?(c==null?void 0:c.triggerText)??v:v});return e.jsx(Ka,{asChild:!0,dir:l,id:d,disabled:w,children:e.jsxs("button",{...x,disabled:w,className:o("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-40","wu-group wu-select-trigger",x.className),children:[n??S(),e.jsx("span",{className:"wm-arrow-drop-down group-data-[state=open]:wu-rotate-180 wu-transition-transform wu-duration-300 wu-text-base"})]})})},ct=({option:a,value:t,multiple:r=!1,onSelect:s,accessorKey:u,dir:l="ltr"})=>{const[n,d]=i.useState(r?[]:"");i.useEffect(()=>{t&&d(r?t.map(b=>JSON.stringify(b[u.value])):JSON.stringify(t[u.value]))},[t,u.value,r]);const w=r?n.includes(JSON.stringify(a[u.value])):n===JSON.stringify(a[u.value]),c=f=>{a.disabled||(s(a),r&&f.preventDefault())};return e.jsxs(je,{onClick:c,disabled:a.disabled,className:o("wu-cursor-pointer wu-select-item wu-h-8 wu-text-xs",w&&"wu-bg-gray-10"),dir:l,children:[r&&e.jsx(ae,{checked:w}),e.jsx(ft,{option:a,accessorKey:u})]})},ft=({option:a,accessorKey:t})=>{const r=String(a[t.label]);return e.jsxs("div",{className:"wu-flex wu-items-center wu-w-full wu-gap-1 wu-text-xs wu-pl-2",children:[a.icon,r,a.isAdmin&&e.jsx("span",{className:"wu-ml-auto wm-lock wu-text-sm wu-text-orange-deep"})]})},pt=a=>{const{option:t,handleSelectAll:r,isCheckedAll:s,isPartialSelected:u,...l}=a;switch("type"in t?t.type:"option"){case"all":return e.jsxs(je,{onSelect:d=>{d.stopPropagation(),d.preventDefault(),r==null||r()},className:o("wu-cursor-pointer wu-text-xs wu-h-8 wu-py-0 wu-select-item"),dir:l.dir,children:[e.jsx(ae,{"data-partial":u,checked:s||u,partial:u}),e.jsx(ft,{option:t,accessorKey:l.accessorKey})]});case"group":return e.jsxs(Xa,{dir:l.dir,children:[e.jsx(We,{className:"wu-text-xs",children:t.label}),t.options.map((d,w)=>i.createElement(ct,{...l,option:d,key:w}))]});case"divider":return e.jsx(Fe,{className:"wu-mx-4"});default:return e.jsx(ct,{...l,option:t})}},Bs=a=>{let t=0,r=0;const s=[],u=[],l=n=>{n.type==="divider"?t++:n.type==="group"?(r++,n.options.forEach(d=>{l(d)})):(s.push(n),n.disabled||u.push(n))};return a.forEach(n=>{l(n)}),{separators:t,groups:r,enabledOptions:u,totalData:s.length,cleanData:s}},js=100,Fs=400,Us=32,$s=9,Gs=32,bt=({data:a,onSelect:t,multiple:r=!1,defaultValue:s,value:u,accessorKey:l,variant:n="flat",dir:d="ltr",placeholder:w,Label:c,virtualizedThreshold:f=js,maxHeight:b=Fs,hasGroup:x=!1,Header:v,CustomTrigger:m,selectAll:p,disabled:C,labelPosition:S="top",onScroll:g,...N})=>{const[k,T]=i.useState(),I=i.useRef(null),[O,M]=i.useState(!1),[W,q]=i.useState(!1),{cleanData:re,totalData:D,separators:B,groups:Y,enabledOptions:$}=x||p!=null&&p.enable?Bs(a):{cleanData:a,totalData:a.length,separators:0,groups:0,enabledOptions:[]},le=i.useMemo(()=>r&&p!=null&&p.enable&&a.length>0?[{type:"all",label:p.label||"Select All"},...a]:a,[a,p,r]),X=i.useCallback(_=>{const j=_[l.value];if(r)T((J=[])=>{const Ce=J,ue=Ce.some(Le=>Le[l.value]===j)?Ce.filter(Le=>Le[l.value]!==j):[...Ce,_];return t==null||t(ue),ue});else{const J=_;T(J),t==null||t(J)}},[r,l.value,t]);i.useEffect(()=>{if(s&&u){console.error("defaultValue and value cannot be used simultaneously");return}!s&&!u&&T(void 0),s!==void 0&&T(s),u!==void 0&&T(u)},[s,u]);const ve=i.useMemo(()=>Math.min(b,D*Us+B*$s+Y*Gs),[b,D,B,Y]),Ne=le.length>f;i.useEffect(()=>{if(!r)return;const _=p!=null&&p.includeDisabled?(k==null?void 0:k.length)===a.length:(k==null?void 0:k.length)===$.length;M(_);const j=(k==null?void 0:k.length)>0&&!_;q(j)},[k,p]);const se=i.useCallback(()=>{const _=O?[]:p!=null&&p.includeDisabled?x?re:a:$;T(_),t==null||t(_)},[O,r,a,$,t,p]),E=Ie(S);return e.jsxs("div",{className:o(E,"wu-flex wu-select-container"),ref:I,dir:d,children:[e.jsxs(Ja,{children:[e.jsx(qs,{...N,value:k,multiple:r,variant:n,dir:d,placeholder:w,accessorKey:l,customTriggerChildren:m,id:N.id,disabled:C,selectAll:p,isCheckedAll:O}),e.jsxs(na,{className:"wu-w-[--radix-dropdown-menu-trigger-width] wu-border-blue-p wu-select-content",role:"listbox",sideOffset:-1,id:N.id,children:[v,Ne?e.jsx(ye,{list:le,containerHeight:b,callback:(_,j)=>e.jsx(pt,{option:j,accessorKey:l,multiple:r,onSelect:X,value:k,dir:d,handleSelectAll:se,isCheckedAll:O,isPartialSelected:W}),dir:d}):e.jsx(ie,{style:{maxHeight:ve,height:"fit-content"},onScroll:g,children:le.map((_,j)=>e.jsx(pt,{option:_,accessorKey:l,multiple:r,onSelect:X,value:k,handleSelectAll:se,isCheckedAll:O,dir:d,isPartialSelected:W},`${j}`))})]})]}),c&&e.jsx(R,{htmlFor:N.id,className:"wu-select-label",children:c})]})},Ue=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Vs=({value:a,onChange:t,min:r=A.sub(new Date,{years:5}),max:s=A.add(new Date,{years:1}),placeholder:u="Select a month",Label:l,labelPosition:n="top",disabled:d,id:w,readonly:c,disabledMonths:f=[],...b})=>{const[x,v]=i.useState(null),[m,p]=i.useState(""),[C,S]=i.useState({value:Math.min(new Date().getFullYear(),new Date(s).getFullYear()),label:Math.min(new Date().getFullYear(),new Date(s).getFullYear())}),g=i.useMemo(()=>{const k=new Date(r).getFullYear(),T=new Date(s).getFullYear();return Array.from({length:T-k+1},(I,O)=>({value:T-O,label:T-O}))},[r,s]);i.useEffect(()=>{if(a){const k=new Date(a),T=k.getFullYear(),I=k.getMonth();v({year:T,month:I}),p(`${Ue[I]} ${T}`),S({value:T,label:T})}},[a]);const N=()=>{x&&t&&(t(new Date(x.year,x.month,15)),p(`${Ue[x.month]} ${x.year}`))};return e.jsxs("div",{className:o("wu-flex wu-flex-col wu-items-center",Ie(n),n==="top"&&"wu-items-start"),children:[e.jsxs(ee,{children:[e.jsx(ra,{...b,disabled:d||c,id:w,dir:"ltr",placeholder:u,formattedString:m}),e.jsxs(Q,{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:[e.jsx("div",{className:"wu-px-1 wu-mx-auto wu-w-full",children:e.jsx(bt,{data:g,accessorKey:{value:"value",label:"label"},value:C,onSelect:k=>S(k),multiple:!1,maxHeight:7*32})}),e.jsx(Ys,{year:C==null?void 0:C.value,selectedMonth:x==null?void 0:x.month,selectedYear:x==null?void 0:x.year,onClick:(k,T)=>v({year:T,month:k}),disabledMonths:f}),e.jsx("div",{className:"wu-flex wu-justify-end wu-px-0.5",children:e.jsx(Se.PopoverClose,{asChild:!0,children:e.jsx(V,{onClick:N,children:"Apply"})})})]})]}),l&&e.jsx(R,{className:"wu-truncate wu-max-w-[120px] wu-min-w-fit wu-select-label",children:l})]})},Ys=({year:a,selectedMonth:t,selectedYear:r,onClick:s,disabledMonths:u=[]})=>{const l=new Date,n=l.getFullYear(),d=l.getMonth(),w=i.useMemo(()=>{const c=new Set;return u.forEach(f=>{const b=typeof f=="string"?new Date(f):f;c.add(`${b.getFullYear()}-${b.getMonth()}`)}),c},[u]);return e.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:Ue.map((c,f)=>{const b=a===n&&f===d,x=t===f&&r===a;return e.jsx("button",{disabled:w.has(`${a}-${f}`),onClick:()=>s(f,a),className:o("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",b&&"wu-border wu-border-blue-p",x&&"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":`${Ue[f]} ${a}`,"data-month":f,"data-year":a,children:c},c)})})},ht=(a,t,r,s=96)=>{if(a.length===0||s<=0)return[[],[]];const[l,n]=i.useState([]),[d,w]=i.useState([]);return i.useEffect(()=>{const c=()=>{var m,p;const f=((m=t.current)==null?void 0:m.clientWidth)||0,b=((p=r.current)==null?void 0:p.clientWidth)||0,x=f-b,v=Math.floor(x/s);n(a.slice(0,v)),w(a.slice(v))};return c(),window.addEventListener("resize",c),()=>{window.removeEventListener("resize",c)}},[a,s]),[l,d]},gt={wuPrimaryLink:"_wuPrimaryLink_1sy3v_1",wuPrimaryPopoverContent:"_wuPrimaryPopoverContent_1sy3v_8"},Js=a=>{const{Links:t,children:r,className:s,...u}=a,l=i.useMemo(()=>t.map((f,b)=>i.cloneElement(f,{className:o(gt.wuPrimaryLink,f.props.className,"wu-primary-nav-link"),key:b})),[t]),n=i.useRef(null),d=i.useRef(null),[w,c]=ht(l,n,d);return e.jsx(e.Fragment,{children:e.jsxs("header",{className:o("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:n,children:[e.jsxs("div",{className:"wu-flex wu-items-center wu-gap-2",children:[e.jsx("nav",{className:"wu-flex wu-items-center wu-justify-start wu-gap-4 wu-primary-nav-left",children:w}),c.length>0&&e.jsxs(ee,{children:[e.jsx(de,{className:"wu-p-1 wu-pb-0 wu-rounded-sm focus:wu-outline-none focus:wu-bg-gray-25","aria-label":"more",children:e.jsx("span",{className:"wm-more-vert"})}),e.jsx(Q,{className:o(gt.wuPrimaryPopoverContent,"wu-primary-nav-popover-left"),align:"start",sideOffset:12,children:c})]})]}),r&&e.jsxs(e.Fragment,{children:[e.jsx("section",{className:"wu-items-center wu-justify-end wu-hidden wu-gap-4 sm:wu-flex wu-primary-nav-right",ref:d,children:r}),e.jsxs(ee,{children:[e.jsx(de,{className:"sm:wu-hidden",children:e.jsx("span",{className:"wu-text-lg wm-menu"})}),e.jsx(Q,{className:"wu-bg-white wu-border wu-border-blue-p wu-w-fit wu-primary-nav-popover-right",align:"end",sideOffset:4,children:r})]})]})]})})},ia={wuSecondaryLink:"_wuSecondaryLink_1edl1_1",wuSecondaryNav:"_wuSecondaryNav_1edl1_6"},Ks=a=>{const{Links:t,children:r,className:s,...u}=a,l=i.useMemo(()=>t.map((b,x)=>i.cloneElement(b.link,{key:x,className:o(ia.wuSecondaryLink,b.link.props.className,"wu-secondary-nav-link-container"),children:e.jsxs(e.Fragment,{children:[i.cloneElement(b.imgOrIcon,{className:o("wu-w-5 wu-h-5 wu-flex wu-items-center wu-justify-center wu-text-lg wu-leading-5",b.imgOrIcon.props.className)}),e.jsx("div",{className:"wu-secondary-nav-link",children:b.link.props.children})]})})),[t]),n=i.useRef(null),d=i.useRef(null),w=i.useRef(null),[c,f]=ht(l,n,w);return e.jsx(e.Fragment,{children:e.jsxs("header",{className:o("wu-flex wu-items-center wu-justify-between wu-gap-4 wu-border-y wu-border-gray-25 wu-h-[50px]",s),...u,ref:n,children:[e.jsxs("div",{className:"wu-flex wu-items-center wu-justify-start wu-gap-2",children:[e.jsx("nav",{className:o(ia.wuSecondaryNav,"wu-flex wu-items-center wu-justify-start wu-w-full wu-h-full wu-secondary-nav-left"),ref:d,children:c}),f.length>0&&e.jsxs(ee,{children:[e.jsx(de,{className:"wu-p-1 wu-pb-0 wu-rounded-sm focus:wu-outline-none focus:wu-bg-gray-25","aria-label":"more",children:e.jsx("span",{className:"wm-more-vert"})}),e.jsx(Q,{className:o(ia.wuSecondaryNavPopover,"wu-secondary-nav-popover-left"),align:"start",sideOffset:12,children:f})]})]}),r&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"wu-items-center wu-justify-end wu-hidden sm:wu-flex",ref:w,children:r}),e.jsxs(ee,{children:[e.jsx(de,{className:"sm:wu-hidden",children:e.jsx("span",{className:"wu-text-lg wm-menu"})}),e.jsx(Q,{className:"wu-bg-white wu-border wu-border-blue-p wu-w-fit wu-secondary-nav-popover-right",align:"end",sideOffset:12,children:r})]})]})]})})},mt=i.forwardRef(({totalRows:a,initialPage:t,initialPageSize:r=100,onPageChange:s,className:u,disabled:l=!1,...n},d)=>{const[w,c]=i.useState(t),[f,b]=i.useState(r);i.useEffect(()=>{c(t),b(r)},[t,r]);const x=Math.ceil(a/f),v=w*f+1,m=Math.min((w+1)*f,a),p=Array.from({length:x},(g,N)=>N),C=i.useCallback(g=>{g>=0&&g<x&&(c(g),s==null||s(g))},[x,s]),S=7*32;return e.jsxs("div",{className:o("wu-flex wu-items-center wu-gap-[2px]",u,"wu-pagination"),...n,role:"navigation",children:[e.jsx(xt,{label:"Previous page",onClick:()=>C(w-1),disabled:w===0||l,icon:"wm-arrow-back-ios-new",className:"hover:wu-bg-gray-20 rtl:wu-rotate-180 wu-prev-btn"}),e.jsx(ut,{name:`${v} - ${m}`,className:"wu-w-[96px] wu-min-w-[96px] wu-pagination-menu",align:"end",disabled:l,children:e.jsx(ie,{style:{maxHeight:S+"px"},dir:n.dir,children:p.length>100?e.jsx(ye,{className:"wu-pagination-list",containerHeight:S,list:p,callback:(g,N)=>e.jsxs(wa,{onSelect:()=>C(N),className:o("wu-py-2",N===w&&"wu-bg-gray-20","wu-pagination-item"),children:[N*f+1," -"," ",Math.min((N+1)*f,a)]},g)}):p.map(g=>e.jsxs(wa,{onSelect:()=>C(g),className:o(g===w&&"wu-bg-gray-20","wu-py-2 hover:wu-bg-gray-20","wu-pagination-item"),children:[g*f+1," -"," ",Math.min((g+1)*f,a)]},g))})}),e.jsx(xt,{label:"Next page",onClick:()=>C(w+1),disabled:w===x-1||l,icon:"wm-arrow-forward-ios",className:"hover:wu-bg-gray-20 rtl:wu-rotate-180 wu-next-btn"})]})});mt.displayName="WuPagination";const xt=({label:a,onClick:t,disabled:r,icon:s,className:u})=>e.jsx(V,{variant:"iconOnly",onClick:t,disabled:r,className:o("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":a,children:e.jsx("span",{className:o("wu-text-sm",s)})}),Xs=({Trigger:a,children:t,className:r,dir:s,open:u,onOpenChange:l,modal:n,...d})=>e.jsxs(ee,{open:u,onOpenChange:l,modal:n,children:[e.jsx(de,{asChild:!0,dir:s,children:a}),e.jsx(Q,{className:o("wu-w-80 wu-p-0 wu-border-blue-p wu-bg-white wu-dark:border-gray-switcher",r),dir:s,...d,children:t})]}),Qs=a=>e.jsx(Se.PopoverClose,{asChild:!0,children:e.jsx(V,{...a})}),yt=y.forwardRef(({className:a,...t},r)=>e.jsx(Me.Root,{className:o("wu-grid wu-gap-2",a),...t,ref:r}));yt.displayName=Me.Root.displayName;const vt=y.forwardRef(({className:a,...t},r)=>e.jsx(Me.Item,{ref:r,className:o("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",a),...t,children:e.jsx(Me.Indicator,{className:"wu-flex wu-items-center wu-justify-center",children:e.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"})})}));vt.displayName=Me.Item.displayName;const Nt=i.forwardRef((a,t)=>{const{options:r,defaultValue:s,onChange:u,label:l,dir:n,...d}=a;return e.jsxs(yt,{defaultValue:s,required:d.required,disabled:d.disabled,onValueChange:u,id:d.id,dir:n,name:d.name,className:o("w-fit",d.className),ref:t,style:d.style,children:[e.jsx(me,{htmlFor:d.id,className:"wu-text-sm wu-font-normal wu-text-gray-lead wu-leading-6 wu-radio-group-label",children:l}),r.map(w=>e.jsxs("div",{className:"wu-flex wu-items-center wu-gap-2 wu-radio-item-container",children:[e.jsx(vt,{value:w.value,id:w.value,disabled:w.disabled,required:w.required,"aria-label":w.value,className:"wu-peer wu-radio-item"}),e.jsx(me,{htmlFor:w.value,className:o(w.required&&"after:wu-content-['*'] after:wu-mx-[2px] after:wu-text-rose-500","wu-radio-item-label"),children:w.label})]},w.value))]})});Nt.displayName="WuRadioGroup";const Ct=y.forwardRef(({className:a,orientation:t="horizontal",decorative:r=!0,...s},u)=>e.jsx(ka.Root,{ref:u,decorative:r,orientation:t,className:o("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",a),...s}));Ct.displayName=ka.Root.displayName;const St=P.Root,Zs=P.Trigger,Rs=P.Portal,kt=y.forwardRef(({className:a,...t},r)=>e.jsx(P.Overlay,{className:o("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",a,"wu-drawer-overlay"),...t,ref:r}));kt.displayName=P.Overlay.displayName;const eu=K.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"}}),ca=y.forwardRef(({side:a="right",className:t,children:r,hideCloseButton:s,...u},l)=>e.jsxs(Rs,{children:[e.jsx(kt,{}),e.jsxs(P.Content,{ref:l,className:o(eu({side:a}),t),...u,children:[r,!s&&e.jsx(P.Close,{"aria-label":"close",asChild:!0,children:e.jsxs(he,{variant:"iconOnly",className:"wu-absolute wu-right-4 wu-top-4",children:[e.jsx("span",{className:"wm-close"}),e.jsx("span",{className:"wu-sr-only",children:"Close"})]})})]})]}));ca.displayName=P.Content.displayName;const Tt=({className:a,...t})=>e.jsx("div",{className:o("",a),...t});Tt.displayName="SheetHeader";const fa=y.forwardRef(({className:a,...t},r)=>e.jsx(P.Title,{ref:r,className:o("wu-text-lg wu-font-semibold",a),...t}));fa.displayName=P.Title.displayName;const Mt=y.forwardRef(({className:a,...t},r)=>e.jsx(P.Description,{ref:r,className:o("wu-text-sm",a),...t}));Mt.displayName=P.Description.displayName;function It({className:a,...t}){return e.jsx("div",{className:o("animate-pulse rounded-md bg-muted",a),...t})}const pa=768;function au(){const[a,t]=y.useState(void 0);return y.useEffect(()=>{const r=window.matchMedia(`(max-width: ${pa-1}px)`),s=()=>{t(window.innerWidth<pa)};return r.addEventListener("change",s),t(window.innerWidth<pa),()=>r.removeEventListener("change",s)},[]),!!a}const tu="sidebar_state",ru=60*60*24*7,su="256px",uu="256px",ou="3rem",lu="b",Dt=y.createContext(null);function ce(){const a=y.useContext(Dt);if(!a)throw new Error("useSidebar must be used within a SidebarProvider.");return a}const Wt=y.forwardRef(({defaultOpen:a=!0,open:t,onOpenChange:r,className:s,style:u,children:l,...n},d)=>{const w=au(),[c,f]=y.useState(!1),[b,x]=y.useState(a),v=t??b,m=y.useCallback(g=>{const N=typeof g=="function"?g(v):g;r?r(N):x(N),document.cookie=`${tu}=${N}; path=/; max-age=${ru}`},[r,v]),p=y.useCallback(()=>w?f(g=>!g):m(g=>!g),[w,m,f]);y.useEffect(()=>{const g=N=>{N.key===lu&&(N.metaKey||N.ctrlKey)&&(N.preventDefault(),p())};return window.addEventListener("keydown",g),()=>window.removeEventListener("keydown",g)},[p]);const C=v?"expanded":"collapsed",S=y.useMemo(()=>({state:C,open:v,setOpen:m,isMobile:w,openMobile:c,setOpenMobile:f,toggleSidebar:p}),[C,v,m,w,c,f,p]);return e.jsx(Dt.Provider,{value:S,children:e.jsx(Ha,{delayDuration:0,children:e.jsx("div",{style:{"--sidebar-width":su,"--sidebar-width-icon":ou,...u},className:o("wu-group/sidebar-wrapper wu-flex wu-min-h-[calc(100svh-48px)] wu-w-full",s),ref:d,...n,children:l})})})});Wt.displayName="SidebarProvider";const _t=y.forwardRef(({side:a="left",variant:t="sidebar",collapsible:r="offcanvas",className:s,children:u,...l},n)=>{const{isMobile:d,state:w,openMobile:c,setOpenMobile:f}=ce();return r==="none"?e.jsx("div",{className:o("wu-flex wu-h-full wu-w-[--sidebar-width] wu-flex-col",s),ref:n,...l,children:u}):d?e.jsx(St,{open:c,onOpenChange:f,...l,children:e.jsxs(ca,{"data-sidebar":"sidebar","data-mobile":"true",className:"wu-w-[--sidebar-width] wu-bg-blue-sidebar wu-p-0 [&>button]:wu-hidden",style:{"--sidebar-width":uu},side:a,children:[e.jsxs(Tt,{className:"sr-only",children:[e.jsx(fa,{children:"Sidebar"}),e.jsx(Mt,{children:"Displays the mobile sidebar."})]}),e.jsx("div",{className:"wu-flex wu-flex-col wu-w-full wu-h-full",children:u})]})}):e.jsxs("div",{ref:n,className:"wu-hidden wu-group wu-peer md:wu-block","data-state":w,"data-collapsible":w==="collapsed"?r:"","data-variant":t,"data-side":a,children:[e.jsx("div",{className:o("wu-relative wu-w-[--sidebar-width] wu-bg-transparent wu-transition-[width] wu-duration-150 wu-ease-linear","group-data-[collapsible=offcanvas]:wu-w-0","group-data-[side=right]:wu-rotate-180",t==="floating"||t==="inset"?"group-data-[collapsible=icon]:wu-w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4))]":"group-data-[collapsible=icon]:wu-w-[--sidebar-width-icon]")}),e.jsx("div",{className:o("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",a==="left"?"wu-left-0 group-data-[collapsible=offcanvas]:wu-left-[calc(var(--sidebar-width)*-1)]":"wu-right-0 group-data-[collapsible=offcanvas]:wu-right-[calc(var(--sidebar-width)*-1)]",t==="floating"||t==="inset"?"wu-p-2 group-data-[collapsible=icon]:wu-w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4)_+2px)]":"group-data-[collapsible=icon]:wu-w-[--sidebar-width-icon] group-data-[side=left]:wu-border-r group-data-[side=right]:wu-border-l",s),...l,children:e.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})})]})});_t.displayName="Sidebar";const Ot=y.forwardRef(({className:a,onClick:t,children:r,...s},u)=>{const{toggleSidebar:l}=ce();return e.jsxs(he,{ref:u,"data-sidebar":"trigger",variant:"secondary",className:o("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",a),onClick:n=>{t==null||t(n),l()},...s,children:[r,e.jsx("span",{className:"wu-sr-only",children:"Toggle Sidebar"})]})});Ot.displayName="SidebarTrigger";const nu=y.forwardRef(({className:a,...t},r)=>{const{toggleSidebar:s}=ce();return e.jsx("button",{ref:r,"data-sidebar":"rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:s,title:"Toggle Sidebar",className:o("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",a),...t})});nu.displayName="SidebarRail";const Et=y.forwardRef(({className:a,...t},r)=>e.jsx("main",{ref:r,className:o("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",a),...t}));Et.displayName="SidebarInset";const wu=y.forwardRef(({className:a,...t},r)=>e.jsx(He,{ref:r,"data-sidebar":"input",className:o("wu-h-8 wu-w-full wu-shadow-none focus-visible:wu-ring-2",a),...t}));wu.displayName="SidebarInput";const Lt=y.forwardRef(({className:a,...t},r)=>e.jsx("div",{ref:r,"data-sidebar":"header",className:o("wu-flex wu-flex-col wu-gap-2 wu-p-2",a),...t}));Lt.displayName="SidebarHeader";const Pt=y.forwardRef(({className:a,...t},r)=>e.jsx("div",{ref:r,"data-sidebar":"footer",className:o("wu-flex wu-flex-col wu-gap-2 wu-pb-2",a),...t}));Pt.displayName="SidebarFooter";const du=y.forwardRef(({className:a,...t},r)=>e.jsx(Ct,{ref:r,"data-sidebar":"separator",className:o("wu-mx-2 wu-w-auto",a),...t}));du.displayName="SidebarSeparator";const zt=y.forwardRef(({className:a,...t},r)=>e.jsx("div",{ref:r,"data-sidebar":"content",className:o("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",a),...t}));zt.displayName="SidebarContent";const Ht=y.forwardRef(({className:a,...t},r)=>e.jsx("div",{ref:r,"data-sidebar":"group",className:o("wu-relative wu-flex wu-w-full wu-min-w-0 wu-flex-col wu-p-2",a),...t}));Ht.displayName="SidebarGroup";const At=y.forwardRef(({className:a,asChild:t=!1,...r},s)=>{const u=t?pe.Slot:"div";return e.jsx(u,{ref:s,"data-sidebar":"group-label",className:o("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",a),...r})});At.displayName="SidebarGroupLabel";const iu=y.forwardRef(({className:a,asChild:t=!1,...r},s)=>{const u=t?pe.Slot:"button";return e.jsx(u,{ref:s,"data-sidebar":"group-action",className:o("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",a),...r})});iu.displayName="SidebarGroupAction";const qt=y.forwardRef(({className:a,...t},r)=>e.jsx("div",{ref:r,"data-sidebar":"group-content",className:o("wu-w-full wu-text-sm",a),...t}));qt.displayName="SidebarGroupContent";const ba=y.forwardRef(({className:a,...t},r)=>e.jsx("ul",{ref:r,"data-sidebar":"menu",className:o("wu-flex wu-w-full wu-min-w-0 wu-flex-col wu-gap-1",a),...t}));ba.displayName="SidebarMenu";const Bt=y.forwardRef(({className:a,...t},r)=>e.jsx("li",{ref:r,"data-sidebar":"menu-item",className:o("wu-group/menu-item wu-relative",a),...t}));Bt.displayName="SidebarMenuItem";const cu=K.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"}}),jt=y.forwardRef(({asChild:a=!1,isActive:t=!1,variant:r="default",size:s="default",tooltip:u,className:l,...n},d)=>{const w=a?pe.Slot:"button",{isMobile:c,state:f}=ce(),b=e.jsx(w,{ref:d,"data-sidebar":"menu-button","data-size":s,"data-active":t,className:o(cu({variant:r,size:s}),l),...n});return u?(typeof u=="string"&&(u={children:u}),e.jsxs(Aa,{children:[e.jsx(qa,{asChild:!0,children:b}),e.jsx(aa,{side:"right",align:"center",hidden:f!=="collapsed"||c,...u})]})):b});jt.displayName="SidebarMenuButton";const fu=y.forwardRef(({className:a,asChild:t=!1,showOnHover:r=!1,...s},u)=>{const l=t?pe.Slot:"button";return e.jsx(l,{ref:u,"data-sidebar":"menu-action",className:o("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",a),...s})});fu.displayName="SidebarMenuAction";const pu=y.forwardRef(({className:a,...t},r)=>e.jsx("div",{ref:r,"data-sidebar":"menu-badge",className:o("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",a),...t}));pu.displayName="SidebarMenuBadge";const bu=y.forwardRef(({className:a,showIcon:t=!1,...r},s)=>{const u=y.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return e.jsxs("div",{ref:s,"data-sidebar":"menu-skeleton",className:o("wu-flex wu-h-8 wu-items-center wu-gap-2 wu-rounded-md wu-px-2",a),...r,children:[t&&e.jsx(It,{className:"wu-rounded-md wu-size-4","data-sidebar":"menu-skeleton-icon"}),e.jsx(It,{className:"wu-h-4 wu-max-w-[--skeleton-width] wu-flex-1","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":u}})]})});bu.displayName="SidebarMenuSkeleton";const hu=y.forwardRef(({className:a,...t},r)=>e.jsx("ul",{ref:r,"data-sidebar":"menu-sub",className:o("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",a),...t}));hu.displayName="SidebarMenuSub";const gu=y.forwardRef(({...a},t)=>e.jsx("li",{ref:t,...a}));gu.displayName="SidebarMenuSubItem";const mu=y.forwardRef(({asChild:a=!1,size:t="md",isActive:r,className:s,...u},l)=>{const n=a?pe.Slot:"a";return e.jsx(n,{ref:l,"data-sidebar":"menu-sub-button","data-size":t,"data-active":r,className:o("wu-flex wu-h-7 wu-min-w-0 wu-translate-x-px wu-items-center wu-gap-2 wu-overflow-hidden wu-rounded-md wu-px-2 wu-outline-none focus-visible:wu-ring-2 disabled:wu-pointer-events-none disabled:wu-opacity-50 aria-disabled:wu-pointer-events-none aria-disabled:wu-opacity-50 [&>span:last-child]:wu-truncate [&>svg]:wu-size-4 [&>svg]:wu-shrink-0","data-[active=true]:wu-bg-sidebar-accent data-[active=true]:wu-text-sidebar-accent-foreground",t==="sm"&&"wu-text-xs",t==="md"&&"wu-text-sm","group-data-[collapsible=icon]:wu-hidden",s),...u})});mu.displayName="SidebarMenuSubButton";const xu=({children:a,Sidebar:t,className:r,defaultOpen:s=!0,open:u,onOpenChange:l,style:n})=>e.jsxs(Wt,{defaultOpen:s,open:u,onOpenChange:l,children:[e.jsxs(_t,{variant:"sidebar",collapsible:"icon",className:o("wu-top-12 wu-h-[calc(100%-48px)] wu-shadow-sidebar wu-border-none",r),style:n,role:"complementary",children:[e.jsx(Lt,{className:"wu-py-2",children:e.jsx(Ft,{})}),t]}),e.jsx(Et,{children:a})]}),Ft=a=>{const{state:t,isMobile:r,openMobile:s}=ce();return e.jsx(Ot,{...a,children:e.jsx(da,{showMenu:r?s:t==="expanded"})})},yu=({className:a,children:t,...r})=>{const s=i.useRef(null),u=i.useRef(null),l=({currentTarget:d})=>{const{scrollTop:w,clientHeight:c,scrollHeight:f}=d;s.current&&s.current.classList.toggle("wu-border-[#1b338014]",w!==0),u.current&&u.current.classList.toggle("wu-border-[#1b338014]",w+c!==f)},n="wu-w-[calc(100%-16px)] wu-mx-auto wu-border-transparent";return e.jsxs(zt,{...r,className:o("wu-overflow-hidden wu-gap-0",a),children:[e.jsx("hr",{className:n,ref:s}),e.jsx(ie,{onScroll:l,className:"wu-gap-2",thumbColor:"#b9c3dc",railColor:"#00000000","data-testid":"scroll-area",children:t}),e.jsx("hr",{className:n,ref:u})]})},vu=a=>e.jsx(Pt,{...a,children:a.children}),Nu=({label:a,children:t,...r})=>e.jsxs(Ht,{...r,className:"wu-p-0",children:[e.jsx("div",{className:"wu-h-8",children:e.jsx(At,{className:"wu-items-end wu-px-4 wu-text-xs wu-font-normal wu-leading-4 wu-text-blue-q",children:a})}),e.jsx(qt,{children:e.jsx(ba,{children:t})})]}),Cu=a=>e.jsx(ba,{...a}),Su=({Icon:a,children:t,className:r,isActive:s,...u})=>{const{state:l}=ce(),[n,d]=i.useState(),w=t&&i.cloneElement(t,{children:e.jsxs("div",{className:"wu-flex wu-items-center wu-gap-2 wu-overflow-hidden wu-text-base wu-truncate wu-text-ellipsis",children:[a,e.jsx("span",{className:o("wu-text-sm wu-leading-4 wu-transition-opacity wu-duration-150",l==="collapsed"&&"wu-opacity-0"),children:t.props.children})]})}),c=i.useRef(null);return i.useEffect(()=>{var f;d(((f=c.current)==null?void 0:f.textContent)||"")},[]),e.jsx(Bt,{...u,className:"wu-flex wu-items-center wu-gap-2 wu-px-2",children:e.jsx(jt,{className:o("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:n,asChild:!0,ref:c,children:w})})},ku={wuStepper:"_wuStepper_apbnq_1"},Ut=i.forwardRef((a,t)=>{const{onChange:r,defaultValue:s=0,min:u,max:l,step:n,readonly:d,resetInvalidValueOnBlur:w=!0,value:c,label:f,labelPosition:b="top",className:x,style:v,...m}=a,[p,C]=i.useState(c||s),S=M=>!!(a.disabled||a.readOnly||M==="inc"&&Number(p||0)>=Number(l)||M==="dec"&&Number(p||0)<=Number(u)),g=i.useCallback(M=>{M.preventDefault(),C(W=>Number(W||u||0)+Number(n||1))},[u,n]),N=i.useCallback(M=>{M.preventDefault(),C(W=>W?Number(W)-Number(n||1):0)},[u,n]),k=i.useCallback(M=>M>=Number(u)&&M<=Number(l),[u,l]),T=M=>{const W=M.currentTarget.value;C(W)},I=i.useCallback(()=>{if(w&&!k(Number(p))){const M=Number(u)||0;C(M)}},[u,w,k,p]);i.useEffect(()=>{r&&r(Number(p))},[p,c]),i.useEffect(()=>{c&&s&&console.warn("As both value and defaultValue are passed, value will be used")},[c,s]);const O=o("wu-px-10 wu-h-[33px] wu-text-center wu-text-blue-q wu-text-xs wu-rounded-t-sm","wu-stepper-input");return e.jsxs("div",{className:o(ku.wuStepper,Tu({labelPosition:b}),x,"wu-stepper"),style:v,dir:m.dir,children:[e.jsx(me,{htmlFor:m.id,className:o(b!=="top"&&"wu-max-w-[160px]","wu-truncate wu-text-xs wu-font-normal wu-leading-6 wu-text-gray-lead wu-stepper-label"),dir:m.dir,children:f}),e.jsxs("div",{className:"wu-relative wu-flex wu-items-center wu-justify-start wu-w-fit wu-stepper-container",dir:m.dir,children:[e.jsx(V,{variant:"iconOnly",Icon:e.jsx("span",{className:"wu-text-base wm-add"}),className:o("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",m.dir==="rtl"?"wu-right-auto wu-left-0":"","wu-stepper-button"),onClick:g,disabled:S("inc"),"aria-label":"increment"}),e.jsx(He,{...m,ref:t,type:"number",className:O,onChange:T,min:u,max:l,step:n,readOnly:d,onBlur:I,value:p}),e.jsx(V,{variant:"iconOnly",Icon:e.jsx("span",{className:"wu-text-base wm-minimize"}),className:o("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",m.dir==="rtl"?"wu-left-auto wu-right-0":"","wu-stepper-button"),onClick:N,disabled:S("dec"),"aria-label":"decrement"})]})]})}),Tu=K.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"}}});Ut.displayName="WuStepper";const $t=K.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"}}),Mu=y.forwardRef(({className:a,variant:t,size:r,...s},u)=>e.jsx(Ta.Root,{ref:u,className:o($t({variant:t,size:r,className:a})),...s}));Mu.displayName=Ta.Root.displayName;const Gt=y.createContext({size:"default",variant:"default"}),$e=y.forwardRef(({className:a,variant:t,size:r,children:s,...u},l)=>e.jsx(Pe.Root,{ref:l,className:o("wu-flex wu-items-center wu-justify-center wu-gap-1",a),...u,children:e.jsx(Gt.Provider,{value:{variant:t,size:r},children:s})}));$e.displayName=Pe.Root.displayName;const fe=y.forwardRef(({className:a,children:t,variant:r,size:s,...u},l)=>{const n=y.useContext(Gt);return e.jsx(Pe.Item,{ref:l,className:o($t({variant:n.variant||r,size:n.size||s}),a),...u,children:t})});fe.displayName=Pe.Item.displayName;const Vt=i.forwardRef((a,t)=>{const{options:r,value:s,disabled:u,dir:l,onChange:n}=a,d=w=>o("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",w===s&&"wu-text-white",u&&s===w&&"wu-text-gray-lead","wu-switcher-icon-tab-item");return e.jsx(e.Fragment,{children:e.jsxs($e,{ref:t,type:"single",value:s,onValueChange:n,disabled:u,dir:l,className:o("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:[e.jsx("div",{role:"slider",className:o("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"&&l!=="rtl"&&"wu-translate-x-full",s==="opt2"&&l==="rtl"&&"-wu-translate-x-full",u&&"wu-bg-gray-40","wu-switcher-icon-tab-slider")}),e.jsx(fe,{value:"opt1",className:d("opt1"),children:r[0].label}),e.jsx(fe,{value:"opt2",className:d("opt2"),children:r[1].label})]})})});Vt.displayName="_IconTab";const Yt=i.forwardRef((a,t)=>{const{options:r,value:s,disabled:u,dir:l,size:n="md",onChange:d}=a,w=c=>o("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",n==="sm"&&"wu-h-6 wu-min-w-20",n==="md"&&"wu-h-8 wu-min-w-28",n==="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 e.jsx(e.Fragment,{children:e.jsxs($e,{ref:t,type:"single",value:s,onValueChange:d,disabled:u,dir:l,className:o("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:[e.jsx("div",{role:"slider",className:o("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 ",n==="sm"&&"wu-h-6 wu-min-w-20",n==="md"&&"wu-h-8 wu-min-w-28",n==="lg"&&"wu-h-10 wu-min-w-36",s==="opt1"&&"",s==="opt2"&&l!=="rtl"&&"wu-translate-x-full",s==="opt2"&&l==="rtl"&&"-wu-translate-x-full",u&&"wu-bg-gray-40","wu-switcher-tab-slider")}),e.jsx(fe,{value:"opt1",className:w("opt1"),children:e.jsx("div",{className:"wu-min-w-16 wu-max-w-[136px] wu-overflow-hidden wu-text-ellipsis wu-text-nowrap",children:r[0].label})}),e.jsx(fe,{value:"opt2",className:w("opt2"),children:e.jsx("div",{className:"wu-min-w-16 wu-max-w-[136px] wu-overflow-hidden wu-text-ellipsis wu-text-nowrap",children:r[1].label})})]})})});Yt.displayName="_Tab";const Jt=i.forwardRef((a,t)=>{const{options:r,value:s,disabled:u,dir:l,onChange:n}=a,d=b=>o("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",b===s&&"wu-text-primary wu-font-medium",u&&s===b&&"wu-text-gray-lead","wu-switcher-toggle-item"),w=o("wu-w-fit wu-gap-2",u&&"wu-cursor-not-allowed","wu-switcher-toggle-group"),c=o("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=o("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"&&l!=="rtl"&&"-wu-translate-x-[10px]",s==="opt1"&&l==="rtl"&&"wu-translate-x-[10px]",s==="opt2"&&l!=="rtl"&&"wu-translate-x-[10px]",s==="opt2"&&l==="rtl"&&"-wu-translate-x-[10px]",u&&"wu-hidden","wu-switcher-toggle-knob");return e.jsx(e.Fragment,{children:e.jsxs($e,{ref:t,type:"single",value:s,disabled:u,dir:l,className:w,onValueChange:n,children:[e.jsx(fe,{value:"opt1",className:d("opt1"),children:e.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})}),e.jsx("button",{onClick:()=>n(s==="opt1"?"opt2":"opt1"),className:c,disabled:u,"aria-label":"knob",dir:l,children:e.jsx("div",{className:f,role:"knob",dir:l})}),e.jsx(fe,{value:"opt2",className:d("opt2"),children:e.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})})]})})});Jt.displayName="_Toggle";const Kt=i.forwardRef((a,t)=>{const{type:r,options:s,value:u,disabled:l,dir:n,size:d,onChange:w,toggle:c=!0,...f}=a,[b,x]=i.useState(),v=m=>{let p=b;m!==""?p=m:c&&(p=b==="opt1"?"opt2":"opt1");const C=p==="opt1"?s[0].value:s[1].value;w&&w(C),x(p)};if(i.useEffect(()=>{if(!Array.isArray(s)||s.length<2)throw new Error("Options are not sufficient");x(u===s[0].value?"opt1":"opt2")},[s,u]),!Array.isArray(s)||s.length<2)return e.jsx(e.Fragment,{});switch(r){case"toggle":return e.jsx(Jt,{...f,ref:t,options:s,value:b||"opt1",onChange:v,disabled:l,dir:n});case"iconTab":return e.jsx(Vt,{ref:t,options:s,value:b||"opt1",onChange:v,disabled:l,dir:n});default:return e.jsx(Yt,{ref:t,options:s,value:b||"opt1",onChange:v,disabled:l,dir:n,size:d})}});Kt.displayName="WuSwitcher";const ha=y.forwardRef(({className:a,...t},r)=>e.jsx("table",{ref:r,className:o("wu-w-full wu-caption-bottom wu-text-sm",a),...t}));ha.displayName="Table";const Xt=y.forwardRef(({className:a,...t},r)=>e.jsx("thead",{ref:r,className:o("[&_tr]:wu-border-b",a),...t}));Xt.displayName="TableHeader";const Qt=y.forwardRef(({className:a,...t},r)=>e.jsx("tbody",{ref:r,className:o("",a),...t}));Qt.displayName="TableBody";const Iu=y.forwardRef(({className:a,...t},r)=>e.jsx("tfoot",{ref:r,className:o("wu-border-t wu-bg-muted/50 wu-font-medium [&>tr]:last:wu-border-b-0",a),...t}));Iu.displayName="TableFooter";const _e=y.forwardRef(({className:a,...t},r)=>e.jsx("tr",{ref:r,className:o("wu-border-b wu-transition-colors wu-hover:wu-bg-muted/50 data-[state=selected]:wu-bg-muted",a),...t}));_e.displayName="TableRow";const ga=y.forwardRef(({className:a,...t},r)=>e.jsx("th",{ref:r,className:o("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",a),...t}));ga.displayName="TableHead";const Ge=y.forwardRef(({className:a,...t},r)=>e.jsx("td",{ref:r,className:o("wu-p-4 wu-align-middle [&:has([role=checkbox])]:wu-pr-0",a),...t}));Ge.displayName="TableCell";const ma=y.forwardRef(({className:a,...t},r)=>e.jsx("caption",{ref:r,className:o("wu-mt-4 wu-text-sm wu-text-gray-subtle wu-font-normal",a),...t}));ma.displayName="TableCaption";const Zt=({columns:a,rowSelection:t})=>{const r=(t==null?void 0:t.isEnabled)??!1,{onRowSelect:s,rowUniqueKey:u}=t||{},l=i.useCallback(d=>w=>{s(()=>w?d:[])},[s]);return{finalColumns:i.useMemo(()=>r?[{id:"select",header:({table:d})=>{const w=d.getRowModel().rows.map(f=>f.original),c=l(w);return e.jsx(ae,{checked:d.getIsSomeRowsSelected()||d.getIsAllRowsSelected(),partial:d.getIsSomeRowsSelected()&&!d.getIsAllRowsSelected(),onChange:f=>{d.toggleAllRowsSelected(!!f),c(!!f)},"aria-label":"Select all","data-testid":d.getIsSomeRowsSelected()&&!d.getIsAllRowsSelected()?"select-partial":"select-all"})},cell:({row:d})=>e.jsx(ae,{checked:d.getIsSelected(),onChange:w=>{d.toggleSelected(!!w)},"aria-label":String(d.original[u])}),enableSorting:!1,filterable:!1,accessorKey:"select"},...a]:a,[a,r,l])}},Rt=({table:a,size:t,NoDataContent:r,isLoading:s,CustomLoader:u})=>{var d;const[l,n]=i.useState(null);return e.jsx(Qt,{children:s?e.jsx(_e,{children:e.jsx(Ge,{colSpan:a.getAllColumns().length,className:"wu-text-center wu-h-[35vh] wu-loader-container",children:u||e.jsx(ge,{className:"wu-w-full"})})}):(d=a.getRowModel().rows)!=null&&d.length?a.getRowModel().rows.map(w=>e.jsx(_e,{"data-state":w.getIsSelected()&&"selected",onMouseOver:()=>n(w.id),onMouseOut:()=>n(null),className:o("wu-transition-colors wu-border-b wu-border-black/[12%]",w.getIsSelected()?l===w.id?"wu-bg-blue-p/[16%]":"wu-bg-blue-p/[8%]":"hover:wu-bg-black/[2%]"),children:w.getVisibleCells().map(c=>e.jsx(Ge,{className:o("wu-py-0 wu-font-light wu-text-gray-lead wu-text-xs",t==="compact"?"wu-h-8":"wu-h-10",c.column.id==="actions"?"wu-opacity-0 wu-transition-opacity wu-duration-100":"",l===w.id&&c.column.id==="actions"?"wu-opacity-100 wu-visible":""),children:Z.flexRender(c.column.columnDef.cell,c.getContext())},c.id))},w.id)):e.jsx(_e,{children:e.jsx(Ge,{colSpan:a.getAllColumns().length,children:r})})})},er=({table:a,sortableColumns:t,manual:r=!1,onSort:s,size:u,isRowSelected:l,HeaderAction:n,isStickyHeader:d})=>{const w=c=>{const{id:f,columnDef:b,getIsSorted:x,toggleSorting:v}=c,{header:m}=b;if(!t.includes(f))return m;const p=x(),C=p==="asc",S=p==="desc",g=()=>{r?(v(!S),s==null||s({id:f,desc:S})):v(c.getIsSorted()==="asc")};return e.jsxs("button",{onClick:g,"aria-label":`Sort by ${m}`,className:"wu-flex wu-items-center wu-gap-4",children:[m,e.jsxs("div",{className:"wu-relative",children:[e.jsx("span",{className:o("wu-absolute -wu-top-[15px] wm-arrow-drop-down wu-text-xl",C&&"wu-hidden",!p&&"-wu-top-[11px]")}),e.jsx("span",{className:o("wu-absolute -wu-bottom-[13px] wm-arrow-drop-up wu-text-xl",S&&"wu-hidden",!p&&"-wu-bottom-[10px]")})]})]})};return e.jsxs(e.Fragment,{children:[e.jsx(Xt,{className:o("wu-border-t wu-border-black/[12%] wu-bg-gray-20 wu-relative",d&&"wu-sticky wu-top-[-.5px] wu-z-10",u==="compact"?"wu-h-8":"wu-h-10"),children:a.getHeaderGroups().map(c=>e.jsx(_e,{className:"wu-relative",children:c.headers.map(f=>f.column.id==="actions"?e.jsx(ga,{colSpan:f.colSpan,className:o("wu-text-gray-lead wu-text-xs wu-font-medium"),style:{width:`${f.getSize()}px`}},f.id):e.jsx(ga,{colSpan:f.colSpan,className:o("wu-text-gray-lead wu-text-xs wu-font-medium wu-bg-[#EEEEEE]","wu-relative wu-z-0"),style:{width:`${f.getSize()}px`},children:Z.flexRender(w(f.column),f.getContext())},f.id))},c.id))}),l&&n&&e.jsx("div",{className:o("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",d&&"wu-sticky wu-top-[-.1px] wu-z-10"),children:n})]})},Du=({data:a,columns:t,isLoading:r=!1,variant:s="unstyled",sort:u,size:l,rowSelection:n,HeaderAction:d,NoDataContent:w,stickyHeader:c=!1,CustomLoader:f,caption:b,...x})=>{var g;const v=((g=n==null?void 0:n.selectedRows)==null?void 0:g.length)??0,{finalColumns:m}=Zt({columns:t,rowSelection:n}),p=i.useMemo(()=>t.filter(N=>N.enableSorting).map(N=>N.accessorKey),[m]),C=i.useMemo(()=>{if(!(n!=null&&n.isEnabled))return{};const N={};for(const k of n.selectedRows){const T=a.findIndex(I=>I[n.rowUniqueKey]===k[n.rowUniqueKey]);T!==-1&&(N[T]=!0)}return N},[n==null?void 0:n.selectedRows,a,n==null?void 0:n.rowUniqueKey,n==null?void 0:n.isEnabled]),S=Z.useReactTable({data:a,columns:m,getCoreRowModel:Z.getCoreRowModel(),getPaginationRowModel:Z.getPaginationRowModel(),manualPagination:!0,manualSorting:!0,manualFiltering:!0,enableRowSelection:n==null?void 0:n.isEnabled,state:{...n!=null&&n.isEnabled?{rowSelection:C}:{}},onRowSelectionChange:N=>{if(typeof N=="function"){const k=N(C),T=Object.keys(k).filter(I=>k[I]).map(I=>a[Number(I)]);n==null||n.onRowSelect(T)}}});return e.jsxs("div",{className:o("wu-table-container wu-relative"),children:[b&&e.jsx(ma,{className:"wu-font-light",children:b}),e.jsxs(ha,{...x,className:o(Wu({variant:s}),x.className),children:[e.jsx(er,{table:S,sortableColumns:p,manual:!0,onSort:u==null?void 0:u.onSort,size:l,HeaderAction:d,isRowSelected:v>0,isStickyHeader:c}),!r&&e.jsx(Rt,{table:S,size:l,NoDataContent:w,CustomLoader:f})]}),r&&e.jsx("div",{className:"wu-flex wu-items-center wu-justify-center wu-h-96",children:e.jsx(ge,{})})]})},Wu=K.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"}}}),ar=({data:a,columns:t,caption:r,variant:s="unstyled",sort:u,filterText:l,size:n="default",pagination:d,rowSelection:w,HeaderAction:c,NoDataContent:f,CustomLoader:b,isLoading:x,stickyHeader:v,...m})=>{var re;const[p,C]=i.useState((u==null?void 0:u.initial)||[]),[S,g]=i.useState([]),N=((re=w==null?void 0:w.selectedRows)==null?void 0:re.length)??0,[k,T]=i.useState((d==null?void 0:d.pageIndex)??0),{finalColumns:I}=Zt({columns:t,rowSelection:w}),O=i.useMemo(()=>I.filter(D=>D.enableSorting).map(D=>D.accessorKey),[I]),M=i.useMemo(()=>I.filter(D=>D.filterable).map(D=>D.accessorKey),[I]),W=i.useMemo(()=>{if(!(w!=null&&w.isEnabled))return{};const D={};for(const B of w.selectedRows){const Y=a.findIndex($=>$[w.rowUniqueKey]===B[w.rowUniqueKey]);Y!==-1&&(D[Y]=!0)}return D},[w==null?void 0:w.selectedRows,a,w==null?void 0:w.rowUniqueKey,w==null?void 0:w.isEnabled]),q=Z.useReactTable({data:a,columns:I,getCoreRowModel:Z.getCoreRowModel(),enableRowSelection:w==null?void 0:w.isEnabled,getPaginationRowModel:Z.getPaginationRowModel(),getSortedRowModel:Z.getSortedRowModel(),getFilteredRowModel:Z.getFilteredRowModel(),initialState:{pagination:{pageSize:(d==null?void 0:d.pageSize)??100,pageIndex:(d==null?void 0:d.pageIndex)??0}},state:{sorting:p,columnFilters:S,...d?{pagination:d}:{},...w!=null&&w.isEnabled?{rowSelection:W}:{}},onSortingChange:C,onColumnFiltersChange:g,onRowSelectionChange:D=>{const B=typeof D=="function"?D(W):D,Y=Object.keys(B).filter($=>B[$]).map($=>a[Number($)]);w==null||w.onRowSelect(Y)}});return i.useEffect(()=>{M.forEach(D=>{var B;(B=q.getColumn(D))==null||B.setFilterValue(l)})},[l,M,q]),i.useEffect(()=>{d&&(d==null?void 0:d.pageIndex)!==k&&(w==null||w.onRowSelect(()=>[]),q.resetRowSelection(),T(d.pageIndex))},[d==null?void 0:d.pageIndex]),e.jsx("div",{className:"wu-table-container wu-relative",children:e.jsxs(ha,{...m,className:o(_u({variant:s}),"wu-table-fixed",m.className),children:[r&&e.jsx(ma,{className:"wu-font-light",children:r}),e.jsx(er,{table:q,sortableColumns:O,size:n,HeaderAction:c,isRowSelected:N>0,isStickyHeader:v}),e.jsx(Rt,{table:q,size:n,NoDataContent:f,CustomLoader:b,isLoading:x})]})})},_u=K.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"}}});ar.displayName="WuTable";const tr=y.forwardRef(({className:a,...t},r)=>e.jsx("textarea",{className:o("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 ",a),ref:r,...t}));tr.displayName="Textarea";const rr=i.forwardRef((a,t)=>{const{Label:r,id:s=ze(),variant:u="flat",readonly:l,maxLength:n,labelPosition:d="top",...w}=a,c=b=>{w.onChange&&w.onChange(b)},f=Ie(d);return e.jsxs("div",{className:o(f,"wu-flex wu-textarea-container"),dir:w.dir,children:[e.jsx(tr,{...w,ref:t,id:s,className:o("wu-peer wu-rounded-t-sm",u==="outlined"?"wu-border wu-border-gray-subtle":"",w.className),onChange:c,readOnly:l,maxLength:n}),r&&e.jsx(R,{htmlFor:s,className:"wu-textarea-label",children:r})]})});rr.displayName="WuTextarea";const Ou=1,Eu=1e6;let xa=0;function Lu(){return xa=(xa+1)%Number.MAX_SAFE_INTEGER,xa.toString()}const ya=new Map,sr=a=>{if(ya.has(a))return;const t=setTimeout(()=>{ya.delete(a),Oe({type:"REMOVE_TOAST",toastId:a})},Eu);ya.set(a,t)},Pu=(a,t)=>{switch(t.type){case"ADD_TOAST":return{...a,toasts:[t.toast,...a.toasts].slice(0,Ou)};case"UPDATE_TOAST":return{...a,toasts:a.toasts.map(r=>r.id===t.toast.id?{...r,...t.toast}:r)};case"DISMISS_TOAST":{const{toastId:r}=t;return r?sr(r):a.toasts.forEach(s=>{sr(s.id)}),{...a,toasts:a.toasts.map(s=>s.id===r||r===void 0?{...s,open:!1}:s)}}case"REMOVE_TOAST":return t.toastId===void 0?{...a,toasts:[]}:{...a,toasts:a.toasts.filter(r=>r.id!==t.toastId)}}},Ve=[];let Ye={toasts:[]};function Oe(a){Ye=Pu(Ye,a),Ve.forEach(t=>{t(Ye)})}function zu({...a}){const t=Lu(),r=u=>Oe({type:"UPDATE_TOAST",toast:{...u,id:t}}),s=()=>Oe({type:"DISMISS_TOAST",toastId:t});return Oe({type:"ADD_TOAST",toast:{...a,id:t,open:!0,onOpenChange:u=>{u||s()}}}),{id:t,dismiss:s,update:r}}function ur(){const[a,t]=i.useState(Ye);return i.useEffect(()=>(Ve.push(t),()=>{const r=Ve.indexOf(t);r>-1&&Ve.splice(r,1)}),[a]),{...a,toast:zu,dismiss:r=>Oe({type:"DISMISS_TOAST",toastId:r})}}const Hu=()=>{const{toast:a}=ur();if(!a)throw new Error("Toast not initialized. Please render <WuToast /> at the root of your app.");return{showToast:({variant:t="success",message:r,duration:s=3e3})=>{a?a({description:r,variant:t,duration:s}):console.error("Toast instance not initialized")}}},Au=G.Provider,qu=K.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"}}),or=y.forwardRef(({className:a,position:t,...r},s)=>e.jsx(G.Viewport,{ref:s,className:o(qu({position:t}),a),...r}));or.displayName=G.Viewport.displayName;const Bu=K.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"}}),lr=y.forwardRef(({className:a,variant:t,...r},s)=>e.jsx(G.Root,{ref:s,className:o(Bu({variant:t}),a),...r}));lr.displayName=G.Root.displayName;const ju=y.forwardRef(({className:a,...t},r)=>e.jsx(G.Action,{ref:r,className:o("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",a),...t}));ju.displayName=G.Action.displayName;const nr=y.forwardRef(({className:a,...t},r)=>e.jsx(G.Close,{ref:r,className:o("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",a),"toast-close":"","aria-label":"Close toast",...t,children:e.jsx("span",{className:"wm-close wu-text-base"})}));nr.displayName=G.Close.displayName;const wr=y.forwardRef(({className:a,...t},r)=>e.jsx(G.Title,{ref:r,className:o("wu-text-sm wu-font-semibold",a),...t}));wr.displayName=G.Title.displayName;const dr=y.forwardRef(({className:a,...t},r)=>e.jsx(G.Description,{ref:r,className:o("wu-text-sm wu-opacity-90",a),...t}));dr.displayName=G.Description.displayName;function Fu(){const{toasts:a}=ur();return e.jsxs(Au,{children:[a.map(function({id:t,title:r,description:s,action:u,variant:l,...n}){const d={success:"wm-check-circle",info:"wm-info",warning:"wm-error",error:"wm-cancel"};return e.jsxs(lr,{variant:l,...n,children:[e.jsxs("div",{className:"wu-grid wu-gap-1",children:[r&&e.jsx(wr,{children:r}),s&&e.jsxs(dr,{className:"wu-flex wu-items-center wu-gap-3 wu-pr-6",children:[e.jsx(we,{icon:d[l||"success"],className:"wu-text-xl"}),s]})]}),u,e.jsx(nr,{})]},t)}),e.jsx(or,{})]})}const Uu=()=>e.jsx(Fu,{}),ir=y.forwardRef(({className:a,dir:t,...r},s)=>e.jsx(Xe.Root,{className:o("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",a),...r,ref:s,children:e.jsx(Xe.Thumb,{className:o("wu-block wu-h-4 wu-w-4 wu-rounded-full wu-bg-gray-subtle wu-shadow-lg wu-ring-0 wu-transition-all data-[state=checked]:wu-bg-blue-p","group-hover:data-[state=unchecked]:wu-bg-gray-lead",t==="rtl"&&"-wu-translate-x-4 data-[state=unchecked]:wu-translate-x-0",t!=="rtl"&&"wu-translate-x-4 data-[state=unchecked]:wu-translate-x-0","wu-toggle-thumb")})}));ir.displayName=Xe.Root.displayName;const cr=i.forwardRef((a,t)=>{const{Label:r,labelPosition:s="right",onChange:u,className:l,dir:n,disabled:d,id:w=ze(),...c}=a;return i.useEffect(()=>{const{checked:f,defaultChecked:b}=c;f!==void 0&&b!==void 0&&console.error("WuToggle: Both `checked` and `defaultChecked` props are set. Use only one of them.")},[c.checked,c.defaultChecked]),e.jsxs("div",{className:o($u({labelPosition:s}),"wu-toggle-container"),dir:n,children:[e.jsx(ir,{...c,id:w,disabled:d,ref:t,onCheckedChange:u,className:o("wu-peer",l),dir:n}),e.jsx(R,{htmlFor:w,className:"wu-toggle-label",children:r})]})});cr.displayName="WuToggle";const $u=K.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"}}}),fr=i.forwardRef((a,t)=>{const{className:r,rounded:s,...u}=a;return e.jsx("div",{className:o("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:t,...u})});fr.displayName="WuCard";const Gu=i.forwardRef((a,t)=>{const{className:r,...s}=a;return e.jsx("div",{ref:t,...s,className:o("wu-p-2 wu-mb-2 wu-border-b wu-border-gray-40 min-h-12 wu-card-header",r)})});Gu.displayName="WuCardHeader";const Vu=i.forwardRef((a,t)=>{const{className:r,...s}=a;return e.jsx("div",{ref:t,...s,className:o("wu-p-2 wu-mt-2 wu-border-t wu-border-gray-40 min-h-12 wu-card-footer",r)})});Vu.displayName="WuCardHeader";const Yu=a=>{const{Trigger:t,children:r,hideCloseButton:s,className:u,side:l="left",...n}=a;return e.jsxs(St,{children:[e.jsx(Zs,{asChild:!0,children:t}),e.jsxs(ca,{...n,side:l,className:o("wu-bg-white wu-text-gray-lead wu-px-0",u),hideCloseButton:s,children:[e.jsx("div",{className:"wu-hidden",children:e.jsx(fa,{})}),r]})]})},oe=(a,t)=>`wu-listbox-${a}`,Ju=a=>{const{CustomTrigger:t,disabled:r,value:s,placeholder:u,accessorKey:l,Chip:n,handleUnselect:d,variant:w,dir:c,...f}=a,[b,x]=i.useState(),v=i.useRef(null);return i.useEffect(()=>{if(!s){x(null);return}x(Array.isArray(s)?n?s.map((p,C)=>n({value:p,unselect:d,key:C})):s.map(p=>p[l.label]).join(", "):n?n({value:s,unselect:d}):s[l.label])},[s,n,l.label,x]),e.jsx(de,{asChild:!0,id:a.id,disabled:r,ref:v,children:(t==null?void 0:t(s))||e.jsxs("button",{...f,className:o("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",w==="outlined"&&"wu-border wu-border-gray-subtle wu-bg-white",f.className,oe("trigger")),children:[e.jsx("div",{className:o("wu-truncate",n&&"wu-flex wu-items-center wu-gap-1 wu-flex-wrap",!b&&"wu-font-light"),children:b||u}),e.jsx(we,{icon:"wm-arrow-drop-down",className:o("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",oe("drop-icon"))})]})})},Ku=a=>{const{option:t,accessorKey:r,onSelect:s,multiple:u,children:l,value:n,dir:d,...w}=a;return e.jsxs(De,{...w,onSelect:()=>s==null?void 0:s(t),value:JSON.stringify(t),className:o("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",d==="rtl"&&"wu-justify-end",oe("item")),disabled:t.disabled,children:[e.jsx("span",{className:"wu-hidden",children:crypto.randomUUID()}),u&&e.jsx(ae,{checked:Array.isArray(n)&&!!n.find(c=>c[r.value]===t[r.value])}),l]})},pr=i.memo(Ku),Xu=a=>{const{label:t,onSelectAll:r,data:s,value:u}=a,[l,n]=i.useState(!1),[d,w]=i.useState(!1);return i.useEffect(()=>{!u||!s||(n(u.length>0),w(u.length>0&&u.length<s.length))},[s,u]),e.jsxs(De,{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(!l),children:[e.jsx(ae,{checked:l,partial:d}),t||"Select All"]})},Qu=a=>{const{className:t,...r}=a;return e.jsxs("div",{className:"wu-relative",children:[e.jsx(we,{icon:"wm-search",className:"wu-absolute wu-top-[14px] wu-left-5"}),e.jsx(Ga,{...r,"aria-label":"Search",className:o("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;",oe("input"),t)})]})},Zu=a=>{const{data:t,accessorKey:r,value:s,Item:u,Label:l,CustomHeader:n,CustomTrigger:d,NoDataContent:w,Chip:c,onSelect:f,onScroll:b,disabled:x,multiple:v,searchable:m,selectAll:p,virtualizedThreshold:C=100,id:S,dir:g,className:N,listClass:k,placeholder:T="Select items...",variant:I,labelPosition:O="top"}=a,[M,W]=i.useState(!1),[q,re]=i.useState(""),[D,B]=i.useState(s),[Y,$]=i.useState(t),le=i.useMemo(()=>r,[r]),X=E=>{v?B(_=>{const j=E[r.value],J=Array.isArray(_)?_:[],Ee=J.some(ue=>ue[r.value]===j)?J.filter(ue=>ue[r.value]!==j):[...J,E];return f&&f(Ee),Ee}):(B(E),f&&f(E),W(!1))},ve=i.useCallback(E=>{const _=E?t:[];B(_),p!=null&&p.onSelectAll&&p.onSelectAll(E),f&&f(_)},[t,p,f]),Ne=i.useCallback(E=>{re(E);const _=E.toLowerCase().trim(),j=t.filter(J=>J[r.label].toLowerCase().trim().includes(_));$(j)},[t,r.label]),se=i.useCallback(E=>Array.isArray(D)?D.some(_=>_[r.value]===E[r.value]):(D==null?void 0:D[r.value])===E[r.value],[D,r.value]);return i.useEffect(()=>{B(s)},[s]),i.useEffect(()=>{$(t)},[t]),e.jsxs("div",{className:o("wu-flex wu-text-sm wu-gap-2",O==="top"&&"wu-flex-col wu-gap-1",O==="left"&&"wu-flex-row",O==="right"&&"wu-flex-row-reverse",oe("container")),dir:g,children:[l&&e.jsx(R,{htmlFor:S,className:oe("label"),children:l}),e.jsxs(ee,{open:M,onOpenChange:W,children:[e.jsx(Ju,{CustomTrigger:d,disabled:x,value:D,accessorKey:r,placeholder:T,Chip:c,className:N,handleUnselect:X,variant:I,id:S,dir:g}),e.jsx(Q,{className:o("wu-w-[--radix-popover-trigger-width] wu-p-0 wu-bg-white wu-border wu-border-blue-p",oe("content")),align:"start",sideOffset:-1,children:e.jsxs(ua,{id:a.id,shouldFilter:!1,children:[m&&e.jsx(Qu,{value:q,onValueChange:Ne}),n,e.jsxs(oa,{className:o("wu-max-h-96 wu-overflow-y-auto",oe("list"),k),onScroll:b,children:[e.jsx(la,{children:w||"No results found."}),e.jsx(Be,{children:v&&(p==null?void 0:p.enabled)&&!q&&e.jsx(Xu,{data:t,value:D,onSelectAll:ve,label:p.label})}),e.jsx(Be,{children:t.length>C?e.jsx(ye,{list:Y,callback:(E,_)=>e.jsxs(pr,{option:_,accessorKey:le,multiple:v,onSelect:j=>X(j),value:D,dir:g,children:[u&&u({value:_,isSelected:se(_)}),!u&&_&&e.jsx(e.Fragment,{children:_[r.label]})]},JSON.stringify(_)),dir:g}):Y.map(E=>e.jsxs(pr,{option:E,accessorKey:le,multiple:v,onSelect:()=>X(E),value:D,dir:g,children:[u&&u({value:E,isSelected:se(E)}),!u&&e.jsx(e.Fragment,{children:E[r.label]})]},JSON.stringify(E)))})]})]})})]})]})};h.WuAppHeader=ts,h.WuAppHeaderAccount=_a,h.WuAppHeaderBar=za,h.WuAppHeaderHelp=Oa,h.WuAppHeaderMenu=Pa,h.WuAppHeaderSearch=es,h.WuButton=V,h.WuCalender=ta,h.WuCard=fr,h.WuCheckbox=ae,h.WuCombobox=gs,h.WuCopyToClipboard=ms,h.WuDataTable=Du,h.WuDatePicker=ss,h.WuDateRangePicker=ls,h.WuDisplay=Fr,h.WuDrawer=Yu,h.WuFooter=rt,h.WuFormGroup=Rr,h.WuHeading=Br,h.WuHelpButton=st,h.WuIcon=we,h.WuInput=xe,h.WuInputError=Xr,h.WuInputHint=Qr,h.WuLabel=R,h.WuListbox=Zu,h.WuLoader=ge,h.WuMenu=ut,h.WuMenuCheckboxItem=xs,h.WuMenuIcon=da,h.WuMenuItem=wa,h.WuMenuItemGroup=ys,h.WuMenuRadioItem=vs,h.WuMenuSeparatorItem=Ns,h.WuModal=Ls,h.WuModalClose=As,h.WuModalContent=Ps,h.WuModalFooter=Hs,h.WuModalHeader=zs,h.WuMonthPicker=Vs,h.WuPagination=mt,h.WuPopover=Xs,h.WuPopoverClose=Qs,h.WuPrimaryNavbar=Js,h.WuRadioGroup=Nt,h.WuSecondaryNavbar=Ks,h.WuSelect=bt,h.WuSidebar=xu,h.WuSidebarContent=yu,h.WuSidebarFooter=vu,h.WuSidebarGroup=Nu,h.WuSidebarItem=Su,h.WuSidebarMenu=Cu,h.WuSidebarTrigger=Ft,h.WuStepper=Ut,h.WuSubMenu=Cs,h.WuSubtext=jr,h.WuSwitcher=Kt,h.WuTable=ar,h.WuText=qr,h.WuTextarea=rr,h.WuToast=Uu,h.WuToggle=cr,h.WuTooltip=Ae,h.WuTruncatedLabel=as,h.WuVirtualScroll=ye,h.useWuShowToast=Hu,h.useWuSidebar=ce,Object.defineProperty(h,Symbol.toStringTag,{value:"Module"})});
1
+ (function(h,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("react/jsx-runtime"),require("@radix-ui/react-avatar"),require("react"),require("clsx"),require("tailwind-merge"),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("@radix-ui/react-scroll-area"),require("react-virtuoso"),require("@radix-ui/react-dropdown-menu"),require("@radix-ui/react-dialog"),require("@radix-ui/react-radio-group"),require("@radix-ui/react-separator"),require("@radix-ui/react-toggle-group"),require("@radix-ui/react-toggle"),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-avatar","react","clsx","tailwind-merge","@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","@radix-ui/react-scroll-area","react-virtuoso","@radix-ui/react-dropdown-menu","@radix-ui/react-dialog","@radix-ui/react-radio-group","@radix-ui/react-separator","@radix-ui/react-toggle-group","@radix-ui/react-toggle","@tanstack/react-table","@radix-ui/react-toast","@radix-ui/react-switch"],e):(h=typeof globalThis<"u"?globalThis:h||self,e(h["wick-ui-lib"]={},h["react/jsx-runtime"],h.RadixUIAvatar,h.React,h.clsx,h.tailwindMerge,h.RadixUISlot,h.ClassVarianceAuthority,h.RadixUILabel,h.RadixUITooltip,h.dateFns,h.RadixUIPopover,h.ReactDayPicker,h.RadixUICheckbox,h.cmdk,h.RadixUIScrollArea,h.ReactVirtuoso,h.RadixUIDropdownMenu,h.RadixUIDialog,h.RadixUIRadioGroup,h.RadixUISeparator,h.RadixUIToggleGroup,h.RadixUIToggle,h.TanstackReactTable,h.RadixUIToast,h.RadixUISwitch))})(this,function(h,e,hr,i,gr,mr,pe,K,xr,Je,A,Se,Ca,yr,U,vr,Nr,Cr,Sr,kr,Tr,Mr,Ir,Z,Dr,Wr){"use strict";function F(a){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(a){for(const r in a)if(r!=="default"){const s=Object.getOwnPropertyDescriptor(a,r);Object.defineProperty(t,r,s.get?s:{enumerable:!0,get:()=>a[r]})}}return t.default=a,Object.freeze(t)}const be=F(hr),y=F(i),Sa=F(xr),ke=F(Je),Te=F(Se),Ke=F(yr),ne=F(vr),L=F(Cr),P=F(Sr),Me=F(kr),ka=F(Tr),Pe=F(Mr),Ta=F(Ir),G=F(Dr),Xe=F(Wr),_r=mr.extendTailwindMerge({prefix:"wu-"});function o(...a){return _r(gr.clsx(a))}const Qe=a=>{window.open(a,"_blank","toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=800,height=600")};function ze(){return Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15)}function Ie(a){switch(a){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 Ma=y.forwardRef(({className:a,...t},r)=>e.jsx(be.Root,{ref:r,className:o("wu-relative wu-flex wu-h-10 wu-w-10 wu-shrink-0 wu-overflow-hidden wu-rounded-full",a),...t}));Ma.displayName=be.Root.displayName;const Ia=y.forwardRef(({className:a,...t},r)=>e.jsx(be.Image,{ref:r,className:o("wu-aspect-square wu-h-full wu-w-full",a),...t}));Ia.displayName=be.Image.displayName;const Da=y.forwardRef(({className:a,...t},r)=>e.jsx(be.Fallback,{ref:r,className:o("wu-flex wu-h-full wu-w-full wu-items-center wu-justify-center wu-rounded-full wu-bg-muted",a),...t}));Da.displayName=be.Fallback.displayName;function Ze(a,t){i.useEffect(()=>{const r=s=>{Array.isArray(a)&&a.some(u=>!u.current||u.current.contains(s.target))||!Array.isArray(a)&&(!a.current||a.current.contains(s.target))||t(s)};return document.addEventListener("mousedown",r),document.addEventListener("touchstart",r),()=>{document.removeEventListener("mousedown",r),document.removeEventListener("touchstart",r)}},[a,t])}const Re={dropdownContainer:"_dropdownContainer_vvlo9_1",open:"_open_vvlo9_1",dropdownMenu:"_dropdownMenu_vvlo9_1"},Wa=({dir:a,Trigger:t,triggerClassName:r,DropdownContent:s})=>{const[u,l]=i.useState(!1),n=i.useRef(null),d=i.useRef(null);Ze([n,d],()=>l(!1));const w=()=>{l(!u)};return e.jsx(e.Fragment,{children:e.jsx("div",{className:Re.dropdownContainer,children:e.jsx("ul",{children:e.jsxs("li",{className:o("wu-flex wu-relative",u&&Re.open),children:[e.jsx("button",{className:o("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(),w()},ref:d,"aria-label":"dropdown-trigger",children:t}),e.jsx("div",{className:o(Re.dropdownMenu,{open:u},a==="rtl"?"wu-left-[-10px] wu-top-[38px]":"wu-right-[-7px] wu-top-[38px]"),dir:a,ref:n,"aria-label":"user-menu",children:s})]})})})})},ea=K.cva("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-focus 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-leading-[1px]",{variants:{size:{md:"wu-px-4 wu-py-2 wu-min-w-[104px] wu-h-8",sm:"wu-px-4 wu-py-1 wu-min-w-[104px] wu-h-6",mobile:"wu-px-4 wu-py-2 wu-min-w-[104px] wu-h-10"},color:{primary:"wu-bg-blue-p hover:wu-bg-blue-pHover wu-text-blue-p wu-ring-1 wu-ring-blue-p hover:wu-text-blue-q hover:wu-ring-blue-pHover",upgrade:"wu-bg-orange-soft hover:wu-bg-orange-deep wu-text-orange-deep hover:wu-text-orange-deep wu-ring-1 wu-ring-orange-soft hover:wu-ring-orange-deep",error:"wu-bg-red-deep hover:wu-bg-red-deep/80 wu-text-red-deep hover:wu-text-red-deep/80 wu-ring-1 wu-ring-red-deep hover:wu-ring-red-deep/80"},variant:{primary:"wu-text-white wu-ring-0 hover:wu-text-white",secondary:"wu-bg-transparent wu-ring-0 hover:wu-bg-gray-20 ",outline:"hover:wu-text-white wu-bg-white disabled:wu-bg-transparent",rounded:"wu-text-white wu-ring-0 wu-rounded-full hover:wu-text-white",link:"hover:wu-underline wu-bg-transparent hover:wu-bg-transparent wu-ring-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-ring-0 wu-bg-transparent wu-min-w-[auto] disabled:wu-grayscale disabled:wu-opacity-80 wu-rounded-sm focus-visible:wu-ring-offset-0 focus-visible:wu-bg-gray-20 wu-aspect-square"}},defaultVariants:{variant:"primary",size:"md",color:"primary"}}),he=y.forwardRef(({className:a,variant:t,size:r,color:s,asChild:u=!1,...l},n)=>{const d=u?pe.Slot:"button";return e.jsx(d,{className:o(ea({size:r,color:s,variant:t,className:a})),ref:n,...l})});he.displayName="Button";const ge=i.forwardRef((a,t)=>Or(a,t)),Or=(a,t)=>{const{size:r="md",color:s="#1B87E6",variant:u="dots",...l}=a,n=o("wu-w-[4em] wu-h-[1em] wu-inline-block wu-text-xs wu-relative wu-loader-dot-container");let d="7px";r==="sm"?d="7px":r==="md"?d="12px":r==="lg"?d="18px":typeof r=="string"&&(d=r);const w={backgroundColor:s,width:d,height:d},c=e.jsxs("div",{...l,ref:t,className:o("wu-flex wu-items-center wu-justify-center wu-gap-2 wu-w-fit",a.className),role:"status","aria-busy":"true",children:[e.jsx("div",{className:"wu-w-12 wu-h-12 wu-border-2 wu-rounded-full wu-animate-spin",style:{width:d,height:d,borderTopColor:s}}),a.message&&e.jsx("p",{className:"wu-inline-block wu-loader-message",children:a.message})]}),f=e.jsxs("div",{...l,ref:t,className:o("wu-flex wu-items-center wu-justify-center wu-gap-2 wu-w-fit",a.className),role:"alert","aria-busy":"true",children:[e.jsxs("ul",{className:n,style:{fontSize:d},role:"loader",children:[e.jsx("li",{className:"wu-dot wu-loader-dot",style:w}),e.jsx("li",{className:"wu-dot wu-loader-dot",style:w}),e.jsx("li",{className:"wu-dot wu-loader-dot",style:w}),e.jsx("li",{className:"wu-dot wu-loader-dot",style:w})]}),a.message&&e.jsx("p",{className:"wu-inline-block wu-loader-message",children:a.message})]});return e.jsx(e.Fragment,{children:u==="spinner"?c:f})};ge.displayName="WuLoader";const V=i.forwardRef(({disabled:a,loading:t,variant:r="primary",size:s="md",Icon:u,iconPosition:l="left",children:n,floating:d,className:w,color:c="primary",...f},b)=>{const x={primary:"#1986e688",upgrade:"#f5830088",error:"#ef444488"};return e.jsxs(he,{...f,disabled:a,variant:r,size:s,className:o(d&&"wu-shadow-qp","wu-flex wu-items-center wu-justify-center wu-gap-2",l==="right"&&"wu-flex-row-reverse",w,t?"wu-cursor-not-allowed wu-ring-0":""),color:c,style:{backgroundColor:t?x[c]:"",...f.style},ref:b,children:[!t&&u&&e.jsx(e.Fragment,{children:u}),t&&e.jsx(ge,{color:"#fff",size:"sm"}),!t&&n]})});V.displayName="WuButton";const Er=({onLogout:a,DataCenter:t})=>e.jsxs("section",{className:"wu-flex wu-justify-between wu-px-4 wu-py-4 wu-text-white wu-bg-gray-lead",children:[e.jsx("div",{className:"wu-flex-1 wu-flex wu-items-start",children:t}),e.jsx(V,{variant:"outline",size:"sm",Icon:e.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:a,"aria-label":"logout",children:"LOGOUT"})]}),Lr=({user:a,dir:t})=>{const r=[a!=null&&a.usage&&Object.keys(a.usage).length>0?{title:a.usage.title,url:a.usage.url,icon:"wm-bar-chart wu-text-base",node:e.jsxs("div",{className:"wu-flex wu-flex-col wu-items-center wu-w-20",children:[e.jsx("code",{className:"wu-font-medium",children:a.usage.collectedResponseCount||"0"}),e.jsx("span",{className:"wu-text-xs wu-font-normal",children:"Responses"})]})}:null,a!=null&&a.invoice&&Object.keys(a.invoice).length>0?{title:a.invoice.title,url:a.invoice.url,icon:"wm-attach-money wu-text-base wu-font-semibold",node:e.jsx("div",{className:"wu-flex wu-justify-center wu-items-center wu-w-20",children:e.jsx("code",{children:a.invoice.size})})}:null].filter(Boolean);return e.jsxs(e.Fragment,{children:[e.jsx("ul",{children:r.map(({title:s,url:u,icon:l,node:n},d)=>e.jsx("li",{className:d<r.length-1?"wu-border-b wu-border-gray-subtle":"",children:e.jsxs("a",{href:u,className:o("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",t==="rtl"?"wu-pl-4":"wu-pr-4"),children:[e.jsxs("div",{className:"wu-flex wu-items-center wu-gap-2",children:[e.jsx("span",{className:o(l,"wu-w-12 wu-text-center")}),e.jsx("span",{children:s})]}),n]})},d))}),e.jsx("hr",{className:"wu-border-gray-subtle"})]})},Pr=({settings:a,dir:t})=>e.jsxs(e.Fragment,{children:[e.jsx("hr",{className:"wu-border-gray-subtle"}),e.jsxs("section",{className:"wu-relative wu-flex wu-items-center wu-justify-start wu-gap-2",children:[e.jsx("span",{className:o("wu-absolute wm-settings wu-text-base",t==="rtl"?"wu-right-4":"wu-left-4")}),e.jsx("ul",{className:"wu-w-full",dir:t,children:a==null?void 0:a.map(r=>e.jsx("li",{tabIndex:-1,dir:t,children:e.jsx("a",{href:r.url,className:o("wu-inline-block wu-w-full wu-py-2 hover:wu-bg-gray-20 focus-within:wu-bg-gray-20 focus:wu-outline-none",t==="rtl"?"wu-pr-14 wu-text-right":"wu-pl-14"),children:r.title})},r.title))})]}),e.jsx("hr",{className:"wu-border-gray-subtle"})]}),zr=({user:a,dir:t})=>{var r,s,u,l,n,d,w,c,f;return e.jsxs("section",{className:o("wu-flex wu-gap-2 wu-p-4 wu-w-full",t==="rtl"?"wu-pr-0":"wu-pl-0"),children:[e.jsx("div",{className:"wu-flex wu-items-center wu-justify-center wu-w-12",children:e.jsx("span",{className:"wu-text-base wm-person"})}),e.jsxs("div",{className:o("wu-flex wu-flex-col wu-gap-1",t==="rtl"&&"wu-text-right"),children:[e.jsx("p",{children:(r=a==null?void 0:a.profile)==null?void 0:r.title}),e.jsxs("a",{href:(s=a==null?void 0:a.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:t,children:[e.jsx("p",{children:(u=a==null?void 0:a.profile)==null?void 0:u.subtitle}),e.jsx("p",{className:"wu-font-light",children:(l=a==null?void 0:a.profile)==null?void 0:l.companyName})]}),(a==null?void 0:a.license)&&Object.keys(a.license).length>0&&e.jsxs("div",{className:"wu-flex wu-items-center wu-justify-between wu-gap-6 wu-mt-4",dir:t,children:[e.jsx("a",{href:(n=a==null?void 0:a.license)==null?void 0:n.url,className:"hover:wu-text-blue-p wu-group/license focus:wu-outline-none focus:wu-text-blue-p",children:e.jsxs("div",{className:"wu-flex wu-flex-col wu-items-start wu-gap-1",children:[e.jsx("p",{className:"wu-font-normal",children:(d=a==null?void 0:a.license)==null?void 0:d.subtitle}),e.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:(w=a==null?void 0:a.license)==null?void 0:w.title})]})}),e.jsxs("div",{className:"wu-flex wu-flex-col wu-items-start wu-gap-1",dir:t,children:[e.jsx("p",{className:"wu-font-normal",children:(c=a==null?void 0:a.license)==null?void 0:c.expiryDatePostFixString}),e.jsx("p",{children:(f=a==null?void 0:a.license)==null?void 0:f.expiryDate})]})]})]})]})},_a=({user:a,onLogout:t,dir:r,DataCenter:s})=>{var u,l;return a?e.jsx(Wa,{Trigger:e.jsxs(Ma,{className:o("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:[e.jsx(Ia,{className:"hover:wu-opacity-80",src:(u=a==null?void 0:a.profile)==null?void 0:u.profilePicture,alt:"User"}),e.jsx(Da,{children:(l=a==null?void 0:a.profile)==null?void 0:l.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:e.jsxs("div",{className:o("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:[e.jsx(zr,{user:a,dir:r}),(a==null?void 0:a.settings)&&a.settings.length>0&&e.jsx(Pr,{settings:a.settings,dir:r}),e.jsx(Lr,{user:a,dir:r}),e.jsx(Er,{onLogout:t,DataCenter:s})]})}):null},Oa=({menuList:a,dir:t})=>{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 e.jsx(Wa,{dir:t,Trigger:e.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:e.jsx("ul",{children:(a||r).map((s,u)=>e.jsx("li",{className:"wu-p-0 wu-w-[191px] hover:wu-bg-[#ededed]",dir:t,children:s.target==="window"?e.jsx("a",{tabIndex:0,rel:"noopener noreferrer",onClick:()=>Qe(s.link),onKeyDown:l=>{l.key==="Enter"&&Qe(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:e.jsx(Ea,{item:s,dir:t})}):e.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:e.jsx(Ea,{item:s,dir:t})})},u))})})},Ea=({item:a,dir:t})=>e.jsxs("div",{className:"wu-flex wu-items-start wu-gap-3",children:[e.jsx("span",{className:`${a.icon} wu-text-xl wu-text-gray-subtle`}),e.jsxs("div",{className:o("wu-flex wu-flex-col wu-gap-[2px]",t==="rtl"&&"wu-text-right"),children:[e.jsx("span",{className:"wu-text-xs wu-text-gray-subtle",children:a.subTitle}),e.jsx("p",{className:"wu-text-sm wu-text-blue-q",children:a.title})]})]}),Hr=a=>{const[t,r]=i.useState(()=>window.innerWidth<=a);return i.useEffect(()=>{const s=()=>{r(window.innerWidth<=a)};return window.addEventListener("resize",s),()=>{window.removeEventListener("resize",s)}},[a]),t};function Ar({productCategories:a,openCategory:t,setOpenCategory:r}){const s=(d,w)=>{const c=w[d];if(c){c.focus();const f=a[d]||null;r(f)}},u=(d,w,c,f)=>{d.preventDefault();const b=c==="down"?w+1:w-1;s(b,f)},l=(d,w,c,f)=>{t!=null&&t.products&&t.products[t.products.length-1].name===f&&(d.preventDefault(),s(w+1,c))},n=(d,w)=>{d.preventDefault();const c=a[w]===t?null:a[w];r(c)};return function(w,c,f){const b=document.querySelectorAll("[data-product-category]"),{key:x}=w;switch(x){case"ArrowDown":u(w,c,"down",b);break;case"ArrowUp":u(w,c,"up",b);break;case"Tab":l(w,c,b,f);break;case"Enter":case" ":n(w,c);break}}}const qr=a=>{const{size:t="lg",className:r,children:s,...u}=a,l={sm:"wu-text-body-3",md:"wu-text-body-2",lg:"wu-text-body-1"},n=a.as||"div";return e.jsx(n,{...u,className:o(l[t],r),children:s})},Br=a=>{const{size:t="xl",className:r,children:s,...u}=a,l={sm:"h4",md:"h3",lg:"h2",xl:"h1"},n={sm:"wu-text-heading-4",md:"wu-text-heading-3",lg:"wu-text-heading-2",xl:"wu-text-heading-1"},d=l[t];return e.jsx(d,{...u,className:o(n[t],r),children:s})},jr=a=>{const{size:t="lg",className:r,children:s,...u}=a,l={sm:"wu-text-sub-3",md:"wu-text-sub-2",lg:"wu-text-sub-1"},n=a.as||"div";return e.jsx(n,{...u,className:o(l[t],r),children:s})},Fr=a=>{const{size:t="lg",className:r,children:s,...u}=a,l={md:"wu-text-display-2",lg:"wu-text-display-1"},n=a.as||"h1";return e.jsx(n,{...u,className:o(l[t],r),children:s})},we=a=>{const{icon:t,className:r,...s}=a;return e.jsx("span",{...s,className:o(t,r),role:"presentation","aria-label":t})},Ur=({buttonRef:a,handleDropdownToggle:t,handleKeyDown:r,isDropdownOpen:s,activeProductName:u,dir:l="ltr",homeLink:n="/"})=>e.jsxs("button",{ref:a,type:"button",className:o("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:t,onKeyDown:d=>{s&&d.key==="ArrowDown"&&r(d,-1)},"aria-label":"product-switcher",children:[e.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:n,children:e.jsx(we,{icon:"wc-logo",className:"wu-text-xl wu-leading-4 wu-relative wu-top-1"})}),u,e.jsx("span",{className:o("wm-arrow-drop-down wu-text-2xl wu-transition-transform wu-duration-300",s&&"wu-rotate-180",l==="rtl"?"wu-mr-auto":"wu-ml-auto")})]}),z={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"},$r=({category:a,dir:t="ltr",openCategory:r})=>{const s=a.active?"#c5cce0":"#f0c36a",u=(r==null?void 0:r.name)===a.name,l=o("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",t==="rtl"&&"wu-rotate-180 wu-ml-2.5 wu-text-blue-q group-hover:wu-hidden",u&&"wu-hidden","wu-relative wu-top-[5px]"),n=o("wm-lock wu-text-orange-soft wu-text-base wu-mr-2.5 group-hover:wu-hidden",t==="rtl"&&"wu-ml-2.5 group-hover:wu-hidden",u&&"wu-hidden","wu-relative wu-top-1");return e.jsxs("div",{className:o("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:t,children:[e.jsx("div",{className:z.productCategoryBorderTop,style:{backgroundColor:s}}),e.jsxs("div",{className:"wu-flex wu-items-center wu-px-1 wu-relative wu-top-1",children:[e.jsx("div",{className:"wu-w-[56px] wu-h-[56px] wu-flex wu-items-center wu-justify-center",children:e.jsx("img",{src:a.logo,alt:a.name,width:"32px",height:"32px"})}),e.jsx("span",{className:"wu-text-sm wu-leading-5 wu-text-blue-q wu-relative wu-top-[1px]",children:a.name})]}),a.active?e.jsx("span",{className:l}):e.jsx("span",{className:n})]})},Gr={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"},Vr=({product:a,currentProduct:t,activeProductName:r,dir:s,focusItem:u,setFocusItem:l})=>{const[n,d]=i.useState(a.name===t),w=a.name===r,c=a.name===t,f=!a.active,b="#1b3380",x="#c5cce0",v="#ffcf70",m=o("wu-font-normal wu-text-xs wu-text-gray-lead wu-text-center",c&&"wu-text-blue-q wu-font-normal",!a.active&&"wu-text-gray-subtle",n&&"wu-font-normal",a.active&&n&&"wu-text-blue-q"),p=o("wu-text-blue-p wu-text-base",c&&"wu-text-blue-q",!a.active&&"wu-text-gray-subtle",a.active&&n&&"wu-text-blue-q"),C=n||u===a.name||w?b:x;return e.jsxs("li",{className:o(z.productListItem,"focus-visible:wu-outline-none focus:wu-outline-none wu-sub-product-list-item",(w||n)&&z.activeProduct,a.name.length>15&&window.innerWidth>768&&"wu-w-[130px] wu-min-w-[130px]",u===a.name&&z.activeProduct,"wu-product-item"),onMouseOver:()=>d(!0),onMouseOut:()=>d(!1),"aria-label":a.name,"aria-disabled":f,dir:s,onKeyDown:S=>{if(S.key==="Enter"){S.preventDefault();const g=S.currentTarget.querySelector("a");g&&g.click()}},onFocus:()=>{l(a.name)},onBlur:()=>l(""),children:[e.jsx("div",{className:o(z.topBorder,s==="rtl"&&z.topBorderRtl),style:{backgroundColor:f?v:C}}),e.jsxs("a",{className:o(z.productLink,"focus:wu-outline-none focus-visible:wu-outline-none"),href:a.link||"#",tabIndex:0,children:[e.jsx("span",{className:o(p,Gr[a.icon||""]),"aria-hidden":!0}),e.jsx("span",{className:o(m),children:a.name})]})]},a.name)},Yr=({category:a,currentProduct:t,activeProductName:r,dir:s="ltr",focusItem:u,setFocusItem:l,borderColorLocked:n="#f5a300"})=>{const{products:d=[],active:w}=a,c=i.useMemo(()=>d.filter(m=>m.active).sort((m,p)=>(m.order||100)-(p.order||100)),[d]),f=i.useMemo(()=>d.filter(m=>!m.active),[d]),[b,x]=i.useState(n),v=m=>m.map((p,C)=>e.jsx(Vr,{product:p,currentProduct:t,activeProductName:r,dir:s,focusItem:u,setFocusItem:l},C));return w?e.jsxs(e.Fragment,{children:[v(c),f.length>0&&e.jsxs("li",{className:o(z.productListItem,"focus:wu-outline-none focus-visible:wu-outline-none !wu-bg-[#f5f5f5] hover:!wu-bg-[#eeeeee] wu-group"),onMouseOver:()=>x("#f5a300"),onMouseOut:()=>x(n),"aria-label":"Upgrade to unlock",children:[e.jsx("div",{className:o(z.topBorder,s==="rtl"&&z.topBorderRtl),style:{backgroundColor:b},"aria-label":"top-border"}),e.jsxs("a",{href:"https://www.questionpro.com/a/showUpgradeUser.do",className:o(z.productLink,"wu-flex wu-flex-col wu-items-center wu-justify-center wu-py-2 wu-min-w-[88px]"),children:[e.jsx("span",{className:"wu-text-base wu-transition-colors wm-lock !wu-text-orange-soft group-hover:wu-text-orange-deep"}),e.jsxs("span",{className:"wu-text-[10px] wu-leading-[10px] wu-text-center wu-pt-1 !wu-text-orange-deep",children:["Upgrade to ",e.jsx("br",{})," unlock"]})]})]}),v(f)]}):e.jsxs("li",{className:o(z.productListItem,z.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:()=>l("learn"),onBlur:()=>l(""),"aria-label":"Learn More",children:[e.jsx("div",{className:o(z.topBorder,s==="rtl"&&z.topBorderRtl),style:{backgroundColor:n}}),e.jsx("a",{className:z.productLink,href:"https://www.questionpro.com/a/showUpgradeUser.do",tabIndex:-1,children:e.jsx("span",{className:"wu-text-[#f99e03]",children:"Learn More"})})]})},La=({dropdownRef:a,dir:t,isDropdownOpen:r,productCategories:s,openCategory:u,setOpenCategory:l,handleKeyDown:n,expandAll:d,activeProductName:w,focusItem:c,setFocusItem:f})=>{const b="#ffcf70",[x,v]=i.useState(window.innerWidth>768);return i.useEffect(()=>{const m=()=>{v(window.innerWidth>375)};return window.addEventListener("resize",m),()=>window.removeEventListener("resize",m)},[]),e.jsx("ul",{className:o(z.productDropdownMenu,r&&z.productDropdownMenuOpen,t==="rtl"&&z.rtlDropdownMenu,"wu-switcher-container"),ref:a,dir:t,"aria-label":"product-dropdown-menu","data-state":r?"open":"closed",children:s.map((m,p)=>e.jsxs("li",{className:o(z.productCategory,"focus:wu-outline-none focus-visible:wu-outline-none wu-h-16 wu-category-item",u===m&&z.open,d&&z.open),onMouseEnter:()=>x&&l(m),onMouseLeave:()=>x&&l(null),"aria-label":m.name,dir:t,onKeyDown:C=>n(C,p),tabIndex:0,"data-product-category":!0,children:[e.jsx($r,{category:m,dir:t,openCategory:u}),e.jsx("ul",{className:o(z.productList,t==="rtl"&&z.rtlProductList),dir:t,children:e.jsx(Yr,{category:m,dir:t,activeProductName:w,currentProduct:m.name,focusItem:c,setFocusItem:f,borderColorLocked:b})})]},m.name))})},Jr=({isProductButtonShow:a,isDropdownOpen:t,activeProductColor:r,activeProductBgColor:s,activeProductName:u,dir:l,smallScreenButtonRef:n,handleDropdownToggle:d,handleKeyDown:w})=>e.jsx("div",{className:o("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",a?l==="rtl"?"wu-right-0 wu-overflow-hidden":"wu-translate-x-0 wu-left-0":l==="rtl"?"wu-right-0 wu-w-0":"wu--translate-x-full"),style:{backgroundColor:t?r.hover:s},children:e.jsxs("button",{ref:n,type:"button",className:o("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",a?"wu-flex":l==="rtl"?"wu-hidden":"wu-flex"),onClick:d,onKeyDown:c=>{t&&c.key==="ArrowDown"&&w(c,-1)},"aria-label":"small-screen-product-btn",children:[u,e.jsx("span",{className:o("wm-arrow-drop-down wu-text-2xl wu-transition-transform wu-duration-300",t&&"wu-rotate-180")})]})}),Kr=({dir:a,isProductButtonShow:t,smallScreenToggleButtonRef:r,setIsProductButtonShow:s,setDropdownOpen:u})=>{const l=()=>{s(n=>!n),t&&u(!1)};return e.jsxs("button",{className:o("wu-relative wu-w-10 wu-h-10 wu-flex wu-flex-col wu-justify-center wu-items-center",a==="rtl"?"wu-mr-4":"wu-ml-4"),onClick:l,ref:r,"aria-label":"menu-toggle-btn",children:[e.jsx("span",{className:`wu-absolute wu-w-6 wu-h-[3px] wu-bg-white wu-transition-transform wu-duration-300 ${t?"wu-rotate-45 wu-translate-y-0":"-wu-translate-y-2.5"}`}),e.jsx("span",{className:`wu-absolute wu-w-6 wu-h-[3px] wu-bg-white wu-transition-opacity wu-duration-300 ${t?"wu-opacity-0":"wu-opacity-100"}`}),e.jsx("span",{className:`wu-absolute wu-w-6 wu-h-[3px] wu-bg-white wu-transition-transform wu-duration-300 ${t?"-wu-rotate-45 wu-translate-y-0":"wu-translate-y-2.5"}`})]})},Pa=({productCategories:a,activeProductName:t,activeProductColor:r={base:"#1b87e6",hover:"#54A5EC"},dir:s,homeLink:u,expandAll:l})=>{const n=i.useRef(null),d=i.useRef(null),w=i.useRef(null),c=i.useRef(null),[f,b]=i.useState(!1),[x,v]=i.useState(null),[m,p]=i.useState(r.base),[C,S]=i.useState(""),[g,N]=i.useState(!1),k=Hr(768);Ze([d,n],()=>{b(!1),v(null)}),Ze([w,c,d],()=>{N(!1),b(!1),v(null)}),i.useEffect(()=>{const O=M=>{M.key==="Escape"&&b(!1)};return document.addEventListener("keydown",O),()=>{document.removeEventListener("keydown",O)}},[f]),i.useEffect(()=>p(r.base),[r.base]);const T=O=>{O.preventDefault(),O.stopPropagation(),b(M=>{const W=!M;return W||v(null),W})},I=(O,M)=>{console.log(O),Ar({productCategories:a,openCategory:x,setOpenCategory:v})(O,M,C)};return e.jsx("div",{className:o("wu-inline-flex wu-items-center wu-justify-between wu-relative wu-z-auto wu-h-12 wu-text-white"),children:k?e.jsxs("div",{className:"wu-relative wu-flex",children:[e.jsx(Kr,{dir:s,isProductButtonShow:g,smallScreenToggleButtonRef:c,setDropdownOpen:b,setIsProductButtonShow:N}),e.jsx(Jr,{isProductButtonShow:g,isDropdownOpen:f,activeProductColor:r,activeProductBgColor:m,activeProductName:t,handleDropdownToggle:T,smallScreenButtonRef:w,handleKeyDown:I,dir:s}),e.jsx("div",{className:o("wu-absolute wu-top-[92px] wu-left-0 wu-text-[18px]",s==="rtl"&&"wu-right-[256px] wu-left-auto"),children:e.jsx(La,{activeProductName:t,focusItem:C,setFocusItem:S,handleKeyDown:I,isDropdownOpen:f,openCategory:x,productCategories:a,setOpenCategory:v,dropdownRef:d,expandAll:l,dir:s})})]}):e.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:m},onMouseOver:()=>p(r.hover),onMouseOut:()=>p(r.base),children:[e.jsx(Ur,{activeProductName:t,dir:s,homeLink:u,buttonRef:n,handleDropdownToggle:T,handleKeyDown:I,isDropdownOpen:f}),e.jsx(La,{activeProductName:t,focusItem:C,setFocusItem:S,handleKeyDown:I,isDropdownOpen:f,openCategory:x,productCategories:a,setOpenCategory:v,dropdownRef:d,expandAll:l,dir:s})]})})},za=({children:a,dir:t,className:r})=>e.jsx("section",{className:o("wu-flex wu-items-center wu-flex-1 wu-min-w-0 wu-h-12 wu-gap-2 wu-px-2",t==="rtl"&&"wu-flex-row-reverse",r),children:e.jsx("div",{className:"wu-grow",children:a})}),He=y.forwardRef(({className:a,type:t,...r},s)=>e.jsx("input",{type:t,className:o("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",a),ref:s,...r}));He.displayName="Input";const Xr=a=>{const{message:t,className:r,...s}=a;return e.jsx("p",{...s,className:o("wu-text-sub-3 wu-break-words wu-font-light",r),style:{color:"rgb(var(--wu-red-deep))",...s.style},children:t})},Qr=a=>{var d,w;const{inputRef:t,maxLength:r=50,className:s,...u}=a,[l,n]=i.useState(!1);return i.useEffect(()=>{var c;(((c=t==null?void 0:t.current)==null?void 0:c.value.length)||0)>.75*r?n(!0):n(!1)},[(d=t==null?void 0:t.current)==null?void 0:d.value,r]),e.jsx("p",{...u,className:o("wu-text-sub-3 wu-font-light",s),style:{color:"rgb(var(--wu-gray-subtle))",...u.style},children:l&&`${(w=t==null?void 0:t.current)==null?void 0:w.value.length}/${r}`})},Zr=K.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"),me=y.forwardRef(({className:a,...t},r)=>e.jsx(Sa.Root,{ref:r,className:o(Zr(),a),...t}));me.displayName=Sa.Root.displayName;const R=a=>e.jsx(me,{...a,className:o("wu-text-gray-lead wu-leading-6",a.className)}),Rr=({Label:a,Error:t,Hint:r,Input:s,labelPosition:u="top",dir:l="ltr",className:n,...d})=>{const c=o("wu-flex",u==="top"?"wu-flex-col wu-gap-1":"wu-flex-row wu-items-center wu-gap-2",n),f=o("wu-flex wu-flex-col wu-gap-1 wu-relative wu-flex-1 wu-form-group-wrapper"),b=o("wu-absolute -wu-bottom-5",l==="ltr"?"wu-right-0":"wu-left-0","wu-form-group-hint"),x=o("wu-absolute -wu-bottom-5",l==="ltr"?"wu-left-0":"wu-right-0","wu-form-group-error");return e.jsxs("div",{className:c,dir:l,...d,children:[a,e.jsxs("div",{className:f,children:[s,r&&e.jsx("div",{className:b,children:r}),t&&e.jsx("div",{className:x,children:t})]})]})},xe=i.forwardRef((a,t)=>{const{Label:r,labelPosition:s="top",Icon:u,iconPosition:l,type:n,value:d,variant:w="flat",readonly:c,id:f=ze(),...b}=a,x=Ie(s),v=u?l!=="right"?"wu-pl-8":"wu-pr-8":"",[m,p]=i.useState(!1),C=()=>{p(g=>!g)},S=g=>{b.onChange&&b.onChange(g)};return e.jsx(e.Fragment,{children:n==="submit"?e.jsx(V,{type:"submit",className:b.className,id:f,children:r||"Submit"}):e.jsx("div",{className:o("wu-flex wu-flex-col wu-gap-2 wu-input-container"),dir:b.dir,children:e.jsxs("div",{className:o("wu-flex wu-gap-1 wu-relative",x,(s==="right"||s==="left")&&"wu-items-center","wu-input-wrapper"),children:[u&&l!=="right"&&e.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}),e.jsx(He,{...b,className:o("wu-peer wu-text-xs wu-rounded-t-sm",w==="outlined"?"wu-border wu-border-gray-subtle":"",v,b.className),type:m?"text":n,ref:t,readOnly:c,onChange:b.onChange&&S,value:d,id:f}),u&&l==="right"&&e.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}),n==="password"&&e.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:C,children:e.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:m?e.jsx("span",{className:"wm-visibility wu-text-gray-subtle"}):e.jsx("span",{className:"wm-visibility-off wu-text-gray-subtle"})})}),r&&e.jsx(R,{htmlFor:f,className:"wu-input-label",children:r})]})})})});xe.displayName="WuInput";const es=({className:a,placeholder:t="Search surveys, folders or tools",defaultCollapsed:r=!0,onSearch:s,...u})=>{const[l,n]=i.useState(r);return i.useEffect(()=>{n(r)},[r]),e.jsx(xe,{...u,placeholder:t,onChange:d=>s(d.target.value),className:o("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",l?"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",a),type:"search",Icon:e.jsx(we,{"data-testid":"search-icon",icon:"wm-search",className:o("wu-text-gray-lead wu-cursor-pointer",l&&"wu-text-white"),onClick:()=>n(d=>!d)})})},Ha=ke.Provider,Aa=ke.Root,qa=ke.Trigger,aa=y.forwardRef(({className:a,sideOffset:t=4,...r},s)=>e.jsx(ke.Content,{ref:s,sideOffset:t,className:o("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",a),...r}));aa.displayName=ke.Content.displayName;const Ae=i.forwardRef(({content:a,position:t,positionOffset:r,duration:s,children:u,className:l,showArrow:n=!1,...d},w)=>e.jsx(Ha,{delayDuration:s||200,children:e.jsxs(Aa,{children:[e.jsx(qa,{asChild:!0,children:e.jsx("span",{ref:w,children:u})}),e.jsx(Je.Portal,{children:a&&e.jsxs(aa,{...d,side:t||"top",sideOffset:r||0,className:o("wu-max-w-sm wu-max-h-96 wu-overflow-y-auto",l),children:[a,n&&e.jsx(Je.Arrow,{className:"wu-fill-gray-notification wu-tooltip-arrow"})]})})]})}));Ae.displayName="WuTooltip";const as=({label:a,className:t})=>{const r=i.useRef(null),[s,u]=i.useState(!1);return i.useEffect(()=>{const l=r.current;if(l){const n=l.clientWidth,d=l.scrollWidth,w=d/a.length,c=a.length*w;u(c>n||d>n)}},[a]),e.jsx("p",{ref:r,className:o("wu-w-full wu-truncate",t),children:s?e.jsx(Ae,{content:a,positionOffset:8,children:a}):a})},ts=a=>{const{productName:t,categories:r=[],user:s,children:u,onLogout:l,homeLink:n=window.location.origin,brandColor:d,dir:w="ltr",expandAll:c,DataCenter:f}=a;return e.jsx("div",{className:"wu-sticky wu-top-0 wu-z-50 wu-w-full",children:e.jsxs("header",{className:o("wu-h-12 wu-flex wu-items-center wu-justify-between wu-relative wu-bg-blue-switcher wu-text-white",w==="rtl"&&"wu-flex-row-reverse",a.className),style:a.style,children:[e.jsx("section",{className:"wu-flex wu-items-center wu-gap-2 wu-shrink-0",children:e.jsx(Pa,{productCategories:r,activeProductName:t,activeProductColor:d,dir:w,homeLink:n,expandAll:c})}),e.jsx(za,{dir:w,children:u}),e.jsxs("section",{className:o("wu-flex wu-items-center wu-justify-end wu-shrink-0 wu-gap-2",w==="rtl"?"wu-flex-row-reverse wu-pl-4":"wu-flex-row wu-pr-4"),children:[e.jsx(Oa,{dir:w}),(s==null?void 0:s.profile)&&Object.keys(s.profile).length>0&&e.jsx(_a,{user:s,onLogout:l,dir:w,DataCenter:f})]})]})})},ee=Te.Root,de=Te.Trigger,Q=y.forwardRef(({className:a,align:t="center",sideOffset:r=4,...s},u)=>e.jsx(Te.Portal,{children:e.jsx(Te.Content,{ref:u,align:t,sideOffset:r,className:o("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",a),...s})}));Q.displayName=Te.Content.displayName;function Ba({className:a,classNames:t,dir:r="ltr",...s}){const u=Ca.getDefaultClassNames();return e.jsx(Ca.DayPicker,{showOutsideDays:s.showOutsideDays||!1,className:o("wu-p-3",a),classNames:{root:o(u.root,"wu-relative wu-rounded-none wu-bg-white dark:wu-bg-gray-switcher"),caption_label:o("wu-text-xs",s.captionLayout==="dropdown"?"wu-hidden":""),month_caption:o(u.month_caption,"wu-mb-5"),months:o(u.months,"wu-flex wu-flex-col sm:wu-flex-row wu-gap-4"),dropdowns:o(u.dropdowns,"wu-flex wu-items-center wu-justify-start wu-gap-2",(s.mode==="range","")),dropdown:o(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:o(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:o(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:o(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:o(u.selected,"wu-bg-blue-p [&:not(.rm)]:wu-text-white hover:wu-bg-blue-pHover"),range_middle:o("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:o(u.range_end,"wu-rounded-none"),range_start:o(u.range_start,"wu-rounded-none wu-bg-blue-p hover:wu-bg-blue-pHover"),month_grid:o(u.month_grid,"[&>thead>tr>th]:wu-pb-2 wu-border-collapse wu-space-y-1"),button_next:o(u.button_next,ea({variant:"iconOnly"}),"wu-h-6 wu-w-6 wu-text-gray-lead"),button_previous:o(u.button_previous,ea({variant:"iconOnly"}),"wu-h-6 wu-w-6 wu-rotate-180 wu-text-gray-lead"),nav:o(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:o(u.chevron,"!wu-text-red-500"),outside:o(u.outside,"wu-invisible"),disabled:o(u.disabled,"hover:wu-bg-white wu-text-gray-subtle"),...t},components:{Chevron:()=>e.jsx("span",{className:"wm-chevron-right wu-text-lg wu-leading-5"})},...s})}Ba.displayName="Calendar";const ta=a=>e.jsx(Ba,{...a}),ja=a=>{const{handleDateChange:t,disabled:r,onReset:s,showResetButton:u}=a;return e.jsxs("div",{className:"wu-flex wu-items-center wu-justify-end wu-gap-2 wu-mt-2 wu-date-picker-footer",children:[u&&e.jsx(V,{variant:"secondary",onClick:s,Icon:e.jsx("span",{className:"wu-text-[20px] wu-leading-5 -wu-mt-[1px] wm-refresh"}),className:"wu-date-picker-footer-reset",children:"Reset"}),e.jsx(Se.PopoverClose,{asChild:!0,children:e.jsx(V,{onClick:t,disabled:r,className:"wu-date-picker-apply",children:"Apply"})})]})},ra=({formattedString:a,dir:t,placeholder:r="Select Date",className:s,...u})=>e.jsx(Se.PopoverTrigger,{asChild:!0,dir:t,children:e.jsx(V,{...u,className:o("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",s),variant:"primary",Icon:e.jsx("span",{className:"wm-calendar-month wu-text-sm"}),iconPosition:"right",children:a||r})}),Fa=(a,t,r,s)=>!!(t||r&&a<r||s&&a>s),qe=a=>a?typeof a=="string"?new Date(a):a:new Date,sa="\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01])",rs=[{label:"Last 7 days",value:7},{label:"Last 30 days",value:30},{label:"Last 90 days",value:90},{label:"Last 365 days",value:365}],ss=({formatString:a="yyyy-MM-dd",value:t,onChange:r,disabled:s,minDate:u=A.sub(new Date,{years:5}),maxDate:l=A.add(new Date,{years:1}),className:n,dir:d="ltr",Label:w,labelPosition:c="top",onReset:f,showResetButton:b=!1,placeholder:x="Select Date",...v})=>{const[m,p]=i.useState(),[C,S]=i.useState(""),g=i.useCallback(()=>{const k=qe(m);S(A.format(k,a)),r&&r(m)},[m,a,r]),N=i.useCallback(()=>{f?f():(p(void 0),S(""),r&&r(void 0))},[r,f]);return i.useEffect(()=>{const k=qe(t);p(k),S(A.format(k,a))},[t,a]),e.jsxs(R,{className:o("wu-flex wu-gap-1",c==="left"?"wu-items-center":"wu-flex-col wu-items-start","wu-date-picker-label"),dir:d,children:[w,e.jsxs(ee,{children:[e.jsx(ra,{...v,formattedString:C,dir:d,placeholder:x}),e.jsx(Q,{className:"wu-p-0 wu-w-fit wu-date-picker-content",align:"start",sideOffset:-.5,dir:d,children:e.jsx(ta,{dir:d,mode:"single",captionLayout:"dropdown",selected:m,onSelect:p,disabled:k=>Fa(k,s,u,l),startMonth:u,endMonth:l,required:!0,autoFocus:!0,defaultMonth:m,className:o("wu-border wu-border-blue-p",n),footer:e.jsx(ja,{handleDateChange:g,disabled:s,onReset:N,showResetButton:b})})})]})]})},Ua="yyyy-MM-dd",us=[{label:"Day",value:1},{label:"Week",value:7},{label:"Month",value:30},{label:"Quarter",value:90},{label:"Year",value:365}],os=({current:a,onSelect:t,presetRanges:r=rs})=>{const[s,u]=i.useState(),[l,n]=i.useState(!1),[d,w]=i.useState(""),[c,f]=i.useState(""),[b,x]=i.useState(!1),v=i.useMemo(()=>r.map(g=>g.value),[r]),m=o("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"),p=i.useCallback(g=>{if(g===void 0){u(void 0),n(!0);return}const N=Number(g)-1;u(N),n(!1),t({from:A.sub(new Date,{days:N}),to:new Date})},[t]),C=i.useCallback((g,N)=>{if(!g||!(a!=null&&a.to)||!(a!=null&&a.from)||!new RegExp(sa).test(g))return!1;const T=new Date(N==="start"?g:a.from),I=new Date(N==="end"?g:a.to);return A.isBefore(I,T)?(x(!0),!1):(x(!1),!(A.isSameDay(T,a.from)&&A.isSameDay(I,a.to)))},[a]),S=i.useCallback((g,N)=>{if((N==="start"?w:f)(g),C(g,N)){const T={from:a==null?void 0:a.from,to:a==null?void 0:a.to};N==="start"&&(T.from=new Date(g)),N==="end"&&(T.to=new Date(g)),t(T)}},[a,t,C]);return i.useEffect(()=>{if(a!=null&&a.to&&(a!=null&&a.from)&&A.isValid(a.to)&&A.isValid(a.from)){w(A.format(a.from,Ua)),f(A.format(a.to,Ua));const g=A.differenceInCalendarDays(a.to,a.from);A.isToday(a.to)&&v.includes(g+1)?(u(g),n(!1)):(u(void 0),n(!0))}},[a,v]),e.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:[e.jsx("ul",{className:"wu-flex wu-gap-1 wu-py-2 wu-date-picker-batch-list",children:us.map(({label:g,value:N})=>e.jsx(he,{variant:"secondary",className:"wu-px-1 wu-py-1 wu-text-xs wu-h-fit wu-min-w-fit disabled:wu-bg-white",disabled:N!==1,children:g},N))}),e.jsxs("ul",{className:"wu-flex wu-flex-col wu-gap-1 wu-date-picker-ranges",children:[r.map(({label:g,value:N})=>e.jsx("li",{children:e.jsx("button",{className:o(m,s===N-1&&"wu-bg-blue-p/10"),onClick:()=>p(N),children:g})},N)),e.jsx("li",{children:e.jsx("button",{className:o(m,l&&"wu-bg-blue-p/10"),onClick:()=>p(),children:"Custom Range"})})]}),e.jsxs("div",{className:"wu-relative wu-flex wu-gap-3 wu-pt-2 wu-date-picker-range-footer",children:[e.jsx(xe,{placeholder:"Start Date",pattern:sa,value:d,onChange:g=>S(g.target.value,"start"),"aria-label":"Start Date"}),e.jsx(xe,{placeholder:"End Date",pattern:sa,value:c,onChange:g=>S(g.target.value,"end"),"aria-label":"End Date"}),b?e.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"}):e.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"})]})]})},ls=({formatString:a="yyyy/MM/dd",value:t,onChange:r,disabled:s,minDate:u=A.sub(new Date,{years:5}),maxDate:l=A.add(new Date,{years:1}),className:n,dir:d="ltr",minDateToSelect:w,maxDateToSelect:c,presetRanges:f,Label:b,labelPosition:x="top",onReset:v,showResetButton:m=!0,placeholder:p="Select Date Range"})=>{const[C,S]=i.useState(t),[g,N]=i.useState(t),[k,T]=i.useState(""),I=i.useCallback(()=>{if(g){const W=g.from,q=g.to;S({from:W,to:q}),T(`${A.format(W,a)} - ${A.format(q,a)}`),r&&r({from:W,to:q})}},[g,a,r]),O=i.useCallback(()=>{N(C)},[C]),M=i.useCallback(()=>{v?v():(S(void 0),N(void 0),T(""),r&&r(void 0))},[v,r]);return i.useEffect(()=>{if(t!=null&&t.from&&(t!=null&&t.to)){const W=qe(t.from),q=qe(t.to);S(t),N(t),T(`${A.format(W,a)} - ${A.format(q,a)}`)}else S(void 0),N({to:new Date,from:new Date})},[t,a]),e.jsxs(me,{className:o("wu-flex wu-gap-1",x==="left"?"wu-items-center":"wu-flex-col wu-items-start","wu-date-picker-label"),dir:d,children:[b,e.jsxs(ee,{onOpenChange:W=>!W&&O(),children:[e.jsx(ra,{formattedString:k,dir:d,placeholder:p}),e.jsxs(Q,{className:"wu-flex wu-p-0 wu-border wu-w-fit wu-border-blue-p",align:"start",sideOffset:-.5,dir:d,children:[e.jsx(os,{current:g,onSelect:N,presetRanges:f}),e.jsx(ta,{dir:d,numberOfMonths:2,mode:"range",captionLayout:"dropdown",selected:g,onSelect:N,disabled:W=>Fa(W,s,u,l),startMonth:u,endMonth:l,required:!0,autoFocus:!0,defaultMonth:C==null?void 0:C.from,className:o("wu-shadow-none",n),min:w,max:c,footer:e.jsx(ja,{handleDateChange:I,disabled:s,onReset:M,showResetButton:m})})]})]})]})},$a=y.forwardRef(({className:a,partial:t,...r},s)=>e.jsx(Ke.Root,{ref:s,className:o("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",a),...r,children:e.jsxs(Ke.Indicator,{className:o("wu-flex wu-items-center wu-justify-center wu-text-current"),children:[!t&&e.jsx("span",{className:"wm-check wu-text-base wu-leading-4"}),t&&e.jsx("span",{className:"wm-check-indeterminate-small wu-text-base wu-leading-4"})]})}));$a.displayName=Ke.Root.displayName;const ae=i.forwardRef((a,t)=>{const{disabled:r,checked:s,Label:u,labelPosition:l="right",className:n,id:d=ze(),partial:w,onChange:c,required:f,readonly:b,...x}=a;return i.useEffect(()=>{x.defaultChecked!==void 0&&s!==void 0&&console.error("WuCheckbox: Both `checked` and `defaultChecked` cannot be used together. Use only one of them.")},[x.defaultChecked,s]),e.jsxs("div",{className:ns({labelPosition:l,className:"wu-checkbox-container"}),dir:x.dir,children:[e.jsx($a,{id:d,...x,partial:w,checked:s,disabled:r||b,onCheckedChange:c,className:o("wu-peer wu-checkbox",n),required:f,ref:t}),u&&e.jsx(R,{htmlFor:d,className:"wu-w-full wu-checkbox-label",children:u})]})}),ns=K.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"}}});ae.displayName="WuCheckbox";const ua=y.forwardRef(({className:a,...t},r)=>e.jsx(U.Command,{ref:r,className:o("wu-flex wu-h-full wu-w-full wu-flex-col wu-overflow-hidden wu-rounded-md",a),...t}));ua.displayName=U.Command.displayName;const Ga=y.forwardRef(({className:a,...t},r)=>e.jsx("div",{className:"wu-flex wu-items-center wu-border-b wu-px-3",children:e.jsx(U.Command.Input,{ref:r,className:o("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",a),...t})}));Ga.displayName=U.Command.Input.displayName;const oa=y.forwardRef(({className:a,...t},r)=>e.jsx(U.Command.List,{ref:r,className:o("",a),...t}));oa.displayName=U.Command.List.displayName;const la=y.forwardRef((a,t)=>e.jsx(U.Command.Empty,{ref:t,className:"wu-text-center wu-p-2 wu-pb-2.5 wu-text-xs",...a}));la.displayName=U.Command.Empty.displayName;const Be=y.forwardRef(({className:a,...t},r)=>e.jsx(U.Command.Group,{ref:r,className:o("",a),...t}));Be.displayName=U.Command.Group.displayName;const Va=y.forwardRef(({className:a,...t},r)=>e.jsx(U.Command.Separator,{ref:r,className:o("wu-mx-1 wu-my-1 wu-h-px wu-bg-gray-20",a),...t}));Va.displayName=U.Command.Separator.displayName;const De=y.forwardRef(({className:a,...t},r)=>e.jsx(U.Command.Item,{ref:r,className:o("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",a),...t}));De.displayName=U.Command.Item.displayName;const ie=y.forwardRef(({className:a,children:t,thumbColor:r,railColor:s,...u},l)=>e.jsxs(ne.Root,{ref:l,className:o("wu-relative wu-overflow-hidden",a),children:[e.jsx(ne.Viewport,{className:"wu-h-full wu-w-full wu-rounded-[inherit]",...u,children:t}),e.jsx(Ya,{thumbColor:r,railColor:s}),e.jsx(ne.Corner,{})]}));ie.displayName=ne.Root.displayName;const Ya=y.forwardRef(({className:a,orientation:t="vertical",thumbColor:r="#d4d4d4",railColor:s="#eeeeee",...u},l)=>e.jsx(ne.ScrollAreaScrollbar,{ref:l,orientation:t,className:o("wu-flex wu-touch-none wu-select-none wu-transition-colors",t==="vertical"&&"wu-h-full wu-w-2 wu-border-l wu-border-l-transparent wu-p-[1px]",t==="horizontal"&&"wu-h-2 wu-flex-col wu-border-t wu-border-t-transparent wu-p-[1px]",a),style:{background:s},...u,children:e.jsx(ne.ScrollAreaThumb,{className:"wu-relative wu-flex-1 wu-rounded-full",style:{background:r}})}));Ya.displayName=ne.ScrollAreaScrollbar.displayName;const ye=i.forwardRef(({containerHeight:a=400,list:t,callback:r,dir:s,className:u,style:l},n)=>e.jsx(Nr.Virtuoso,{ref:n,dir:s,className:u,style:{height:a,scrollbarWidth:"thin",scrollbarColor:"#d4d4d4 #f1f1f1",overflowX:"hidden",...l},data:t,itemContent:(d,w)=>r(d,w)}));ye.displayName="WuVirtualScroll";const ws=({tags:a,triggerRef:t})=>{const[r,s]=i.useState([]),[u,l]=i.useState([]),n=i.useMemo(()=>e.jsx("ul",{className:"wu-flex wu-flex-col wu-items-start wu-justify-center wu-list-none",children:u.map((w,c)=>e.jsx("li",{className:"wu-py-1 wu-text-xs wu-text-left",children:w},c))}),[u]),d=w=>{const c=document.createElement("div");Object.assign(c.style,{display:"inline-block",visibility:"hidden",position:"absolute",whiteSpace:"nowrap"}),c.textContent=w,document.body.appendChild(c);const f=c.offsetWidth;return document.body.removeChild(c),f+8};return i.useEffect(()=>{const w=()=>{if(t.current){const x=t.current.offsetWidth-20-36;let v=0;const m=[],p=[];a.forEach(C=>{const S=d(C);v+S+8<x?(m.push(C),v+=S+8):p.push(C)}),s(m),l(p)}};return w(),window.addEventListener("resize",w),()=>{window.removeEventListener("resize",w)}},[a,t]),e.jsxs("div",{className:"wu-flex wu-items-center wu-gap-2 wu-text-xs",children:[r.map((w,c)=>e.jsx("span",{className:"wu-px-1 wu-py-0.5 wu-text-xs wu-rounded-sm wu-bg-gray-10 wu-combobox-tag",children:w},c)),u.length>0&&e.jsx(Ae,{content:n,className:"wu-z-[51] wu-text-left",children:e.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]})})]})},ds=({placeholder:a="Select...",isEllipse:t=!1,selectedOptions:r,variant:s="flat",dir:u="ltr",accessorKey:l,multiple:n,id:d,disabled:w,selectAll:c,isCheckedAll:f,className:b,...x})=>{const[v,m]=i.useState([]),p=i.useRef(null);i.useEffect(()=>{if(!r||Array.isArray(r)&&r.length===0){m([]);return}if(n){const S=r;m(S==null?void 0:S.map(g=>g[l.label]));return}else m([r[l.label]])},[r]);const C=()=>{var S;return v.length?f&&(c!=null&&c.enable)&&(c!=null&&c.triggerText)?e.jsx("span",{className:"wu-overflow-hidden wu-text-xs wu-text-start wu-text-ellipsis wu-whitespace-nowrap",children:c.triggerText}):t?e.jsx("span",{className:"wu-overflow-hidden wu-text-xs wu-text-start wu-text-ellipsis wu-whitespace-nowrap",style:{width:`${(((S=p.current)==null?void 0:S.offsetWidth)||0)-32}px`},children:v.join(", ")}):e.jsx(ws,{tags:v,triggerRef:p}):e.jsx("p",{className:"wu-text-xs wu-opacity-70",children:a})};return e.jsx(de,{dir:u,asChild:!0,id:d,disabled:w,children:e.jsxs("button",{...x,ref:p,disabled:w,className:o("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",b),children:[C(),e.jsx("span",{className:"wm-arrow-drop-down group-data-[state=open]:wu-rotate-180 wu-transition-transform wu-duration-300 wu-text-base"})]})})},Ja=L.Root,Ka=L.Trigger,Xa=L.Group,is=L.Portal,cs=L.Sub,fs=L.RadioGroup,Qa=y.forwardRef(({className:a,inset:t,children:r,position:s,...u},l)=>e.jsxs(L.SubTrigger,{ref:l,className:o("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",t&&"wu-pl-8",a),...u,children:[s==="left"&&e.jsx("span",{className:o("wm-chevron-right",u.dir==="rtl"&&"ml-2")}),r,s!=="left"&&e.jsx("span",{className:o("wu-text-base wu-leading-4",u.dir==="rtl"&&"wu-mr-auto wm-chevron-left",u.dir!=="rtl"&&"wu-ml-auto wm-chevron-right")})]}));Qa.displayName=L.SubTrigger.displayName;const Za=y.forwardRef(({className:a,...t},r)=>e.jsx(L.SubContent,{ref:r,className:o("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",a),...t}));Za.displayName=L.SubContent.displayName;const na=y.forwardRef(({className:a,sideOffset:t=4,...r},s)=>e.jsx(L.Portal,{children:e.jsx(L.Content,{ref:s,sideOffset:t,className:o("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",a),...r})}));na.displayName=L.Content.displayName;const je=y.forwardRef(({className:a,inset:t,...r},s)=>e.jsx(L.Item,{ref:s,className:o("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",t&&"wu-pl-8",a),...r}));je.displayName=L.Item.displayName;const Ra=y.forwardRef(({className:a,children:t,checked:r,dir:s,...u},l)=>e.jsxs(L.CheckboxItem,{ref:l,className:o("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",a),checked:r,...u,children:[e.jsx("span",{className:o("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:e.jsx(L.ItemIndicator,{children:e.jsx("span",{className:"wm-check wu-text-base wu-text-white"})})}),t]}));Ra.displayName=L.CheckboxItem.displayName;const et=y.forwardRef(({className:a,children:t,...r},s)=>e.jsxs(L.RadioItem,{ref:s,className:o("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",a),...r,children:[e.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:e.jsx(L.ItemIndicator,{className:"wu-w-4 wu-h-4 wu-flex wu-items-center wu-justify-center",children:e.jsx("span",{className:"wm-circle wu-text-blue-p group-hover:group-data-[state=checked]:wu-text-blue-q wu-text-xs"})})}),t]}));et.displayName=L.RadioItem.displayName;const We=y.forwardRef(({className:a,inset:t,...r},s)=>e.jsx(L.Label,{ref:s,className:o("wu-p-2 wu-font-medium wu-text-xs",t&&"wu-pl-8",a),...r}));We.displayName=L.Label.displayName;const Fe=y.forwardRef(({className:a,...t},r)=>e.jsx(L.Separator,{ref:r,className:o("-wu-mx-1 wu-my-1 wu-h-px wu-bg-gray-20",a),...t}));Fe.displayName=L.Separator.displayName;const at=({option:a,value:t,multiple:r=!1,onSelect:s,accessorKey:u,dir:l})=>{const[n,d]=i.useState(r?[]:"");i.useEffect(()=>{t&&d(r?t.map(b=>JSON.stringify(b[u.value])):JSON.stringify(t[u.value]))},[t,u.value,r]);const w=r?n.includes(JSON.stringify(a[u.value])):n===JSON.stringify(a[u.value]),c=()=>{a.disabled||s(a)};return e.jsxs(De,{onSelect:c,disabled:a.disabled,className:o("wu-cursor-pointer wu-text-xs wu-h-8 wu-py-0 wu-combobox-item hover:wu-bg-gray-100",w&&"wu-bg-gray-10"),dir:l,children:[r&&e.jsx(ae,{checked:w}),e.jsx(ps,{option:a,accessorKey:u})]})},ps=({option:a,accessorKey:t})=>{const r=a[t.label];return e.jsxs("div",{className:"wu-flex wu-items-center wu-w-full wu-gap-1",children:[a.icon&&a.icon,r,a.isAdmin&&e.jsx("span",{className:"wu-ml-auto wu-text-sm wm-lock wu-text-orange-deep"})]})},tt=a=>{const{option:t,selectAll:r,handleSelectAll:s,isCheckedAll:u,isPartialSelected:l,...n}=a;switch("type"in t?t.type:"option"){case"all":return e.jsx(De,{onSelect:s,className:o("wu-cursor-pointer wu-text-xs wu-h-8 wu-py-0 wu-select-item"),dir:n.dir,children:e.jsx(ae,{checked:u||l,partial:l,"data-partial":l,Label:(r==null?void 0:r.label)||"Select All"})});case"group":return e.jsxs(Be,{children:[e.jsx(We,{children:t.label}),t.options.map((w,c)=>i.createElement(at,{...n,option:w,key:c}))]});case"divider":return e.jsx(Va,{className:"wu-mx-4"});default:return e.jsx(at,{...n,option:t})}},bs=a=>{const t=[],r=[],s=[],u=[];return a.forEach(l=>{l.type==="group"?(t.push(l),s.push(...l.options),u.push(...l.options.filter(n=>!n.disabled))):l.type==="divider"?r.push(l):s.push(l),l!=null&&l.disabled||u.push(l)}),{groups:t,dividers:r,allOptions:s,enabledOptions:u}},hs=i.memo(xe),gs=({data:a,accessorKey:t,value:r,defaultValue:s,Header:u,virtualizedThreshold:l=100,isEllipse:n,placeholder:d,variant:w,dir:c,onSelect:f,Label:b,maxHeight:x=420,multiple:v=!1,hasGroup:m=!1,selectAll:p,id:C,disabled:S,labelPosition:g="top",className:N,onScroll:k,...T})=>{const[I,O]=i.useState(""),[M,W]=i.useState(),[q,re]=i.useState(!1),[D,B]=i.useState(!1),[Y,$]=i.useState(!1),le=i.useRef(null),{allOptions:X,groups:ve,dividers:Ne,enabledOptions:se}=i.useMemo(()=>m||p&&!p.includeDisabled?bs(a):{allOptions:a,groups:[],dividers:[],enabledOptions:[]},[a,m]),E=i.useMemo(()=>{if(!I)return a;const H=I.toLowerCase();return X.filter(te=>te[t.label].toLowerCase().includes(H))},[I,X,a,t.label]),_=i.useMemo(()=>v&&p!=null&&p.enable&&!I&&E.length>0?[{type:"all"},...E]:E,[E,I,v]),j=i.useMemo(()=>{const H=32*_.length+Ne.length*9+ve.length*48;return Math.min(x,H)},[x,_,Ne,ve]),J=i.useCallback(H=>{const te=H[t.value];v?W(Ru=>{const va=Ru||[],br=va.some(Na=>Na[t.value]===te)?va.filter(Na=>Na[t.value]!==te):[...va,H];return f==null||f(br),br}):(re(!1),W(H),f==null||f(H))},[v,t.value,f]),Ce=i.useCallback(H=>O(H.target.value),[]),Ee=i.useCallback(()=>O(""),[]);i.useEffect(()=>{if(r!==void 0&&s!==void 0){console.error("defaultValue and value cannot be used simultaneously");return}else r!==void 0?W(r):s!==void 0&&W(s)},[r,s]),i.useEffect(()=>{if(!v)return;const H=p!=null&&p.includeDisabled?(M==null?void 0:M.length)===X.length:(M==null?void 0:M.length)===se.length;B(H);const te=(M==null?void 0:M.length)>0&&!H;$(te)},[M,p]);const ue=i.useCallback(()=>{const H=D?[]:p!=null&&p.includeDisabled?X:se;W(H),f==null||f(H)},[D,v,X,se,f,p]),Le=Ie(g);return e.jsxs("div",{className:o(Le,"wu-flex wu-combobox-container"),ref:le,children:[e.jsxs(ee,{onOpenChange:H=>{H&&Ee(),re(H)},open:q,modal:!0,children:[e.jsx(ds,{...T,selectedOptions:M,accessorKey:t,isEllipse:n,placeholder:d,variant:w,dir:c,multiple:v,disabled:S,selectAll:p,isCheckedAll:D,className:N,id:C}),e.jsx(Q,{className:"wu-w-[--radix-popover-trigger-width] wu-p-0 wu-bg-white wu-border wu-border-blue-p wu-combobox-content",align:"start",sideOffset:-1,children:e.jsxs(ua,{id:C,children:[e.jsx("div",{className:"wu-m-2",children:e.jsx(hs,{placeholder:"Search...",Icon:e.jsx("span",{className:"wm-search"}),className:"wu-text-xs wu-combobox-search",onChange:Ce,name:"Search","aria-label":"Search",dir:c,iconPosition:c==="rtl"?"right":"left"})}),u,e.jsxs(oa,{children:[e.jsx(la,{children:"No results found."}),_.length>=l?e.jsx(ye,{className:"wu-combobox-list",containerHeight:x,list:_,callback:(H,te)=>e.jsx(tt,{option:te,value:M,onSelect:J,multiple:v,accessorKey:t,dir:c,selectAll:p,handleSelectAll:ue,isCheckedAll:D,isPartialSelected:Y},H),dir:c}):e.jsx(ie,{style:{maxHeight:j,height:"fit-content"},className:"wu-combobox-list",onScroll:k,children:_.map((H,te)=>e.jsx(tt,{option:H,value:M,onSelect:J,multiple:v,accessorKey:t,dir:c,selectAll:p,handleSelectAll:ue,isCheckedAll:D,isPartialSelected:Y},te))})]})]})})]}),b&&e.jsx(R,{htmlFor:C,className:"wu-combobox-label",children:b})]})},ms=a=>{const{textToCopy:t,notificationText:r,...s}=a,[u,l]=i.useState(!1),n=async()=>{if(t)try{await navigator.clipboard.writeText(t),l(!0),setTimeout(()=>l(!1),2e3)}catch(d){console.error("Failed to copy:",d)}};return e.jsxs(V,{...s,onClick:n,variant:"iconOnly",className:o("wu-relative",a.className),"aria-label":"Copy to clipboard",children:[r&&e.jsx("span",{className:o("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}),e.jsx(we,{icon:"wm-content-copy",className:"wu-text-lg"})]})},rt=({className:a,isLoading:t,loadingText:r,children:s,...u})=>e.jsxs("footer",{className:o("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",a),...u,children:[e.jsx("div",{className:"wu-flex-1",children:s}),t&&e.jsx(ge,{size:"16px",variant:"spinner",color:"#a3a3a3",message:r})]});rt.displayName="WuFooter";const st=i.forwardRef((a,t)=>{const{size:r="sm",idOrSlugOrUrl:s,variant:u="primary",...l}=a,n=r==="sm"?16:18,d=s.includes("http")?s:`/help/${s}.html`,w=u==="primary"?"wu-text-blue-p":"wu-text-gray-lead";return e.jsx("button",{...l,ref:t,onClick:()=>Qe(d),children:e.jsx("span",{className:o("wm-help wu-text-gray-subtle",`wu-text-[${n}px]`,w,l.disabled&&"wu-text-neutral-300","wu-help-button-icon")})})});st.displayName="WuHelpButton";const xs=a=>{const{checked:t,onSelect:r,children:s,disabled:u,preventCloseOnSelect:l}=a;return e.jsx(Ra,{disabled:u,checked:t,onCheckedChange:r,onSelect:n=>l&&n.preventDefault(),children:s})},wa=a=>{const{children:t,className:r,Icon:s,iconPosition:u="left",disabled:l,onSelect:n,preventCloseOnSelect:d}=a,w=o("wu-flex wu-items-center wu-gap-2",s&&(u==="left"?"":"wu-justify-between wu-flex-row-reverse"),r),c=f=>{n&&n(f),d&&f.preventDefault()};return e.jsxs(je,{onSelect:c,disabled:l,className:w,children:[s&&e.jsx("div",{className:"wu-text-base",children:s}),t]})},ys=a=>{const{children:t,...r}=a;return e.jsxs(Xa,{...r,children:[e.jsx(We,{children:a.label}),t]})},vs=a=>{const{options:t,value:r,onSelect:s}=a;return e.jsx(fs,{value:r,onValueChange:s,children:t.map(u=>e.jsx(et,{value:u.value,disabled:u.disabled,children:u.label},u.value))})},Ns=a=>{const{className:t,...r}=a,s=o("wu-w-11/12 wu-mx-auto wu-border-gray-40",t);return e.jsx(Fe,{...r,className:s})},Cs=a=>{const{children:t,label:r,open:s,onOpenChange:u,height:l,dir:n,...d}=a;return e.jsxs(cs,{...d,open:s,onOpenChange:u,children:[e.jsx(Qa,{dir:n,children:r}),e.jsx(is,{children:e.jsx(Za,{onInteractOutside:w=>w.preventDefault(),children:e.jsx(ie,{className:"wu-h-fit",style:{height:l},dir:n,children:t})})})]})},Ss="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",ut=a=>{const{children:t,menuTitle:r,variant:s="flat",name:u,open:l,onOpenChange:n,height:d,preventCloseOnClickOutside:w,dir:c,Trigger:f,align:b="start",sideOffset:x=0,side:v="bottom",alignOffset:m,className:p,disabled:C,...S}=a;return e.jsxs(Ja,{...S,open:l,onOpenChange:n,dir:c,children:[e.jsx(Ka,{asChild:!0,dir:c,disabled:C,className:o("disabled:wu-text-zinc-300 disabled:wu-bg-white disabled:wu-cursor-not-allowed disabled:hover:wu-bg-transparent"),children:f??ks(s,u,C)}),e.jsx(na,{className:o("wu-w-56 wu-border wu-border-blue-p disabled:wu-border-gray-40",p,"wu-menu-content"),align:b,sideOffset:x,side:v,alignOffset:m,onInteractOutside:g=>w&&g.preventDefault(),children:e.jsxs(ie,{className:"h-fit",style:{height:d},dir:c,children:[r&&e.jsxs(e.Fragment,{children:[e.jsx(We,{dir:c,className:"wu-menu-title",children:r}),e.jsx(Fe,{className:"wu-mt-0 wu-menu-separator",dir:c})]}),t??e.jsx("p",{children:"Menu Is Empty"})]})})]})},ks=(a,t,r)=>{const s=o(Ss,"wu-flex wu-items-center wu-justify-between wu-gap-2 wu-h-8 wu-text-xs wu-group",a==="outlined"?"wu-border":"wu-border-b","wu-trigger-btn");return e.jsxs("button",{className:s,"aria-label":"menu-trigger",children:[e.jsx("span",{children:t??"Menu"}),e.jsx("span",{className:o("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")})]})},da=i.forwardRef(({showMenu:a=!1,className:t,color:r="#1B3380",...s},u)=>{const l=o("wu-w-full wu-border wu-transition-all wu-duration-300");return e.jsxs("div",{...s,className:o("wu-flex wu-flex-col wu-w-[18px] wu-justify-between wu-aspect-[3/2] wu-transition-all wu-duration-300",t),ref:u,"aria-label":"menu-icon",children:[e.jsx("div",{className:`${l} wu-origin-center ${a?"wu-rotate-45 wu-translate-y-[5px]":""}`,style:{borderColor:r}}),e.jsx("div",{className:`${l} ${a?"wu-opacity-0":""}`,style:{borderColor:r}}),e.jsx("div",{className:`${l} wu-origin-center ${a?"-wu-rotate-45 -wu-translate-y-[5px]":""}`,style:{borderColor:r}})]})});da.displayName="WuMenuIcon";const ot={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%]"},Ts=P.Root,Ms=P.Trigger,Is=P.Portal,Ds=P.Close,lt=i.forwardRef(({className:a,...t},r)=>e.jsx(P.Overlay,{ref:r,className:o("wu-fixed wu-inset-0 wu-z-50 wu-bg-black/30",ot.overlay,a),...t}));lt.displayName=P.Overlay.displayName;const nt=i.forwardRef(({className:a,children:t,hideCloseButton:r,...s},u)=>e.jsxs(Is,{children:[e.jsx(lt,{}),e.jsxs(P.Content,{ref:u,className:o("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",ot.content,a),...s,children:[t,!r&&e.jsx(P.Close,{"aria-label":"close",asChild:!0,children:e.jsxs(he,{variant:"iconOnly",className:"wu-absolute wu-right-2 wu-top-1 hover:wu-bg-gray-lead/10",children:[e.jsx("span",{className:"wu-text-lg wm-close"}),e.jsx("span",{className:"wu-sr-only",children:"Close"})]})})]})]}));nt.displayName=P.Content.displayName;const wt=({className:a,...t})=>e.jsx("div",{className:o("wu-text-center wu-bg-gray-20 wu-w-full",a),...t});wt.displayName="DialogHeader";const dt=({className:a,...t})=>e.jsx("div",{className:o("wu-flex wu-flex-col-reverse sm:wu-flex-row sm:wu-justify-end sm:wu-space-x-2 wu-p-4",a),...t});dt.displayName="DialogFooter";const it=i.forwardRef(({className:a,...t},r)=>e.jsx(P.Title,{ref:r,className:o("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",a),...t}));it.displayName=P.Title.displayName;const Ws=i.forwardRef(({className:a,...t},r)=>e.jsx(P.Description,{ref:r,className:o("wu-text-sm wu-text-muted-foreground",a),...t}));Ws.displayName=P.Description.displayName;const _s="600px",Os={sm:"400px",md:"600px",lg:"1200px"},Es={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"},Ls=({Trigger:a,children:t,size:r="md",hideCloseButton:s,preventClickOutside:u,onOpenChange:l,open:n,dir:d,maxWidth:w,maxHeight:c,...f})=>e.jsxs(Ts,{...f,modal:!0,onOpenChange:l,open:n,children:[a&&e.jsx(Ms,{asChild:!0,children:a}),e.jsx(nt,{style:{width:"calc(100% - 64px)",maxWidth:w||Os[r],maxHeight:c||_s},hideCloseButton:s,onInteractOutside:b=>u&&b.preventDefault(),dir:d,"aria-describedby":void 0,children:t})]}),Ps=({children:a,style:t={},...r})=>e.jsx("div",{className:"wu-flex wu-flex-col wu-gap-4 wu-px-3 wu-py-4 rtl:wu-text-right wu-overflow-auto",children:e.jsx("div",{...r,style:{...t,paddingLeft:`${(Number(t==null?void 0:t.paddingLeft)||0)+4}px`,paddingRight:`${(Number(t==null?void 0:t.paddingRight)||0)+4}px`},children:a})}),zs=({children:a,className:t,...r})=>e.jsx(wt,{...r,className:o("wu-text-lg wu-text-gray-lead wu-font-medium",t),children:e.jsx(it,{children:a})}),Hs=({children:a,className:t,...r})=>e.jsx(dt,{...r,className:o("wu-border-t wu-border-gray-40 wu-bg-white wu-min-h-16 wu-mx-4 wu-px-0",t),children:a}),As=({children:a,variant:t="primary",className:r,...s})=>e.jsx(Ds,{...s,className:o("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",Es[t],r),children:a}),qs=({placeholder:a="Select...",value:t,multiple:r=!1,accessorKey:s,variant:u="flat",dir:l="ltr",customTriggerChildren:n,id:d,disabled:w,selectAll:c,isCheckedAll:f,width:b,...x})=>{const[v,m]=i.useState(""),[p,C]=i.useState(a);i.useEffect(()=>{if(!t||Array.isArray(t)&&t.length===0){C(a),m("");return}const g=s.label;if(r&&Array.isArray(t)){const N=t.map(k=>k[g]).join(", ");m(N)}else!r&&!Array.isArray(t)&&m(t[g])},[t,s.label,r,a]);const S=()=>a&&!v?e.jsx("p",{className:"wu-text-xs wu-opacity-70",children:p}):e.jsx("span",{className:o("wu-overflow-hidden wu-text-xs wu-text-start wu-text-ellipsis wu-whitespace-nowrap"),style:{width:`${(b||0)-32}px`},children:f?(c==null?void 0:c.triggerText)??v:v});return e.jsx(Ka,{asChild:!0,dir:l,id:d,disabled:w,children:e.jsxs("button",{...x,disabled:w,className:o("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-40","wu-group wu-select-trigger",x.className),children:[n??S(),e.jsx("span",{className:"wm-arrow-drop-down group-data-[state=open]:wu-rotate-180 wu-transition-transform wu-duration-300 wu-text-base"})]})})},ct=({option:a,value:t,multiple:r=!1,onSelect:s,accessorKey:u,dir:l="ltr"})=>{const[n,d]=i.useState(r?[]:"");i.useEffect(()=>{t&&d(r?t.map(b=>JSON.stringify(b[u.value])):JSON.stringify(t[u.value]))},[t,u.value,r]);const w=r?n.includes(JSON.stringify(a[u.value])):n===JSON.stringify(a[u.value]),c=f=>{a.disabled||(s(a),r&&f.preventDefault())};return e.jsxs(je,{onClick:c,disabled:a.disabled,className:o("wu-cursor-pointer wu-select-item wu-h-8 wu-text-xs",w&&"wu-bg-gray-10"),dir:l,children:[r&&e.jsx(ae,{checked:w}),e.jsx(ft,{option:a,accessorKey:u})]})},ft=({option:a,accessorKey:t})=>{const r=String(a[t.label]);return e.jsxs("div",{className:"wu-flex wu-items-center wu-w-full wu-gap-1 wu-text-xs wu-pl-2",children:[a.icon,r,a.isAdmin&&e.jsx("span",{className:"wu-ml-auto wm-lock wu-text-sm wu-text-orange-deep"})]})},pt=a=>{const{option:t,handleSelectAll:r,isCheckedAll:s,isPartialSelected:u,...l}=a;switch("type"in t?t.type:"option"){case"all":return e.jsxs(je,{onSelect:d=>{d.stopPropagation(),d.preventDefault(),r==null||r()},className:o("wu-cursor-pointer wu-text-xs wu-h-8 wu-py-0 wu-select-item"),dir:l.dir,children:[e.jsx(ae,{"data-partial":u,checked:s||u,partial:u}),e.jsx(ft,{option:t,accessorKey:l.accessorKey})]});case"group":return e.jsxs(Xa,{dir:l.dir,children:[e.jsx(We,{className:"wu-text-xs",children:t.label}),t.options.map((d,w)=>i.createElement(ct,{...l,option:d,key:w}))]});case"divider":return e.jsx(Fe,{className:"wu-mx-4"});default:return e.jsx(ct,{...l,option:t})}},Bs=a=>{let t=0,r=0;const s=[],u=[],l=n=>{n.type==="divider"?t++:n.type==="group"?(r++,n.options.forEach(d=>{l(d)})):(s.push(n),n.disabled||u.push(n))};return a.forEach(n=>{l(n)}),{separators:t,groups:r,enabledOptions:u,totalData:s.length,cleanData:s}},js=100,Fs=400,Us=32,$s=9,Gs=32,bt=({data:a,onSelect:t,multiple:r=!1,defaultValue:s,value:u,accessorKey:l,variant:n="flat",dir:d="ltr",placeholder:w,Label:c,virtualizedThreshold:f=js,maxHeight:b=Fs,hasGroup:x=!1,Header:v,CustomTrigger:m,selectAll:p,disabled:C,labelPosition:S="top",onScroll:g,...N})=>{const[k,T]=i.useState(),I=i.useRef(null),[O,M]=i.useState(!1),[W,q]=i.useState(!1),{cleanData:re,totalData:D,separators:B,groups:Y,enabledOptions:$}=x||p!=null&&p.enable?Bs(a):{cleanData:a,totalData:a.length,separators:0,groups:0,enabledOptions:[]},le=i.useMemo(()=>r&&p!=null&&p.enable&&a.length>0?[{type:"all",label:p.label||"Select All"},...a]:a,[a,p,r]),X=i.useCallback(_=>{const j=_[l.value];if(r)T((J=[])=>{const Ce=J,ue=Ce.some(Le=>Le[l.value]===j)?Ce.filter(Le=>Le[l.value]!==j):[...Ce,_];return t==null||t(ue),ue});else{const J=_;T(J),t==null||t(J)}},[r,l.value,t]);i.useEffect(()=>{if(s&&u){console.error("defaultValue and value cannot be used simultaneously");return}!s&&!u&&T(void 0),s!==void 0&&T(s),u!==void 0&&T(u)},[s,u]);const ve=i.useMemo(()=>Math.min(b,D*Us+B*$s+Y*Gs),[b,D,B,Y]),Ne=le.length>f;i.useEffect(()=>{if(!r)return;const _=p!=null&&p.includeDisabled?(k==null?void 0:k.length)===a.length:(k==null?void 0:k.length)===$.length;M(_);const j=(k==null?void 0:k.length)>0&&!_;q(j)},[k,p]);const se=i.useCallback(()=>{const _=O?[]:p!=null&&p.includeDisabled?x?re:a:$;T(_),t==null||t(_)},[O,r,a,$,t,p]),E=Ie(S);return e.jsxs("div",{className:o(E,"wu-flex wu-select-container"),ref:I,dir:d,children:[e.jsxs(Ja,{children:[e.jsx(qs,{...N,value:k,multiple:r,variant:n,dir:d,placeholder:w,accessorKey:l,customTriggerChildren:m,id:N.id,disabled:C,selectAll:p,isCheckedAll:O}),e.jsxs(na,{className:"wu-w-[--radix-dropdown-menu-trigger-width] wu-border-blue-p wu-select-content",role:"listbox",sideOffset:-1,id:N.id,children:[v,Ne?e.jsx(ye,{list:le,containerHeight:b,callback:(_,j)=>e.jsx(pt,{option:j,accessorKey:l,multiple:r,onSelect:X,value:k,dir:d,handleSelectAll:se,isCheckedAll:O,isPartialSelected:W}),dir:d}):e.jsx(ie,{style:{maxHeight:ve,height:"fit-content"},onScroll:g,children:le.map((_,j)=>e.jsx(pt,{option:_,accessorKey:l,multiple:r,onSelect:X,value:k,handleSelectAll:se,isCheckedAll:O,dir:d,isPartialSelected:W},`${j}`))})]})]}),c&&e.jsx(R,{htmlFor:N.id,className:"wu-select-label",children:c})]})},Ue=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Vs=({value:a,onChange:t,min:r=A.sub(new Date,{years:5}),max:s=A.add(new Date,{years:1}),placeholder:u="Select a month",Label:l,labelPosition:n="top",disabled:d,id:w,readonly:c,disabledMonths:f=[],...b})=>{const[x,v]=i.useState(null),[m,p]=i.useState(""),[C,S]=i.useState({value:Math.min(new Date().getFullYear(),new Date(s).getFullYear()),label:Math.min(new Date().getFullYear(),new Date(s).getFullYear())}),g=i.useMemo(()=>{const k=new Date(r).getFullYear(),T=new Date(s).getFullYear();return Array.from({length:T-k+1},(I,O)=>({value:T-O,label:T-O}))},[r,s]);i.useEffect(()=>{if(a){const k=new Date(a),T=k.getFullYear(),I=k.getMonth();v({year:T,month:I}),p(`${Ue[I]} ${T}`),S({value:T,label:T})}},[a]);const N=()=>{x&&t&&(t(new Date(x.year,x.month,15)),p(`${Ue[x.month]} ${x.year}`))};return e.jsxs("div",{className:o("wu-flex wu-flex-col wu-items-center",Ie(n),n==="top"&&"wu-items-start"),children:[e.jsxs(ee,{children:[e.jsx(ra,{...b,disabled:d||c,id:w,dir:"ltr",placeholder:u,formattedString:m}),e.jsxs(Q,{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:[e.jsx("div",{className:"wu-px-1 wu-mx-auto wu-w-full",children:e.jsx(bt,{data:g,accessorKey:{value:"value",label:"label"},value:C,onSelect:k=>S(k),multiple:!1,maxHeight:7*32})}),e.jsx(Ys,{year:C==null?void 0:C.value,selectedMonth:x==null?void 0:x.month,selectedYear:x==null?void 0:x.year,onClick:(k,T)=>v({year:T,month:k}),disabledMonths:f}),e.jsx("div",{className:"wu-flex wu-justify-end wu-px-0.5",children:e.jsx(Se.PopoverClose,{asChild:!0,children:e.jsx(V,{onClick:N,children:"Apply"})})})]})]}),l&&e.jsx(R,{className:"wu-truncate wu-max-w-[120px] wu-min-w-fit wu-select-label",children:l})]})},Ys=({year:a,selectedMonth:t,selectedYear:r,onClick:s,disabledMonths:u=[]})=>{const l=new Date,n=l.getFullYear(),d=l.getMonth(),w=i.useMemo(()=>{const c=new Set;return u.forEach(f=>{const b=typeof f=="string"?new Date(f):f;c.add(`${b.getFullYear()}-${b.getMonth()}`)}),c},[u]);return e.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:Ue.map((c,f)=>{const b=a===n&&f===d,x=t===f&&r===a;return e.jsx("button",{disabled:w.has(`${a}-${f}`),onClick:()=>s(f,a),className:o("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",b&&"wu-border wu-border-blue-p",x&&"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":`${Ue[f]} ${a}`,"data-month":f,"data-year":a,children:c},c)})})},ht=(a,t,r,s=96)=>{if(a.length===0||s<=0)return[[],[]];const[l,n]=i.useState([]),[d,w]=i.useState([]);return i.useEffect(()=>{const c=()=>{var m,p;const f=((m=t.current)==null?void 0:m.clientWidth)||0,b=((p=r.current)==null?void 0:p.clientWidth)||0,x=f-b,v=Math.floor(x/s);n(a.slice(0,v)),w(a.slice(v))};return c(),window.addEventListener("resize",c),()=>{window.removeEventListener("resize",c)}},[a,s]),[l,d]},gt={wuPrimaryLink:"_wuPrimaryLink_1sy3v_1",wuPrimaryPopoverContent:"_wuPrimaryPopoverContent_1sy3v_8"},Js=a=>{const{Links:t,children:r,className:s,...u}=a,l=i.useMemo(()=>t.map((f,b)=>i.cloneElement(f,{className:o(gt.wuPrimaryLink,f.props.className,"wu-primary-nav-link"),key:b})),[t]),n=i.useRef(null),d=i.useRef(null),[w,c]=ht(l,n,d);return e.jsx(e.Fragment,{children:e.jsxs("header",{className:o("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:n,children:[e.jsxs("div",{className:"wu-flex wu-items-center wu-gap-2",children:[e.jsx("nav",{className:"wu-flex wu-items-center wu-justify-start wu-gap-4 wu-primary-nav-left",children:w}),c.length>0&&e.jsxs(ee,{children:[e.jsx(de,{className:"wu-p-1 wu-pb-0 wu-rounded-sm focus:wu-outline-none focus:wu-bg-gray-25","aria-label":"more",children:e.jsx("span",{className:"wm-more-vert"})}),e.jsx(Q,{className:o(gt.wuPrimaryPopoverContent,"wu-primary-nav-popover-left"),align:"start",sideOffset:12,children:c})]})]}),r&&e.jsxs(e.Fragment,{children:[e.jsx("section",{className:"wu-items-center wu-justify-end wu-hidden wu-gap-4 sm:wu-flex wu-primary-nav-right",ref:d,children:r}),e.jsxs(ee,{children:[e.jsx(de,{className:"sm:wu-hidden",children:e.jsx("span",{className:"wu-text-lg wm-menu"})}),e.jsx(Q,{className:"wu-bg-white wu-border wu-border-blue-p wu-w-fit wu-primary-nav-popover-right",align:"end",sideOffset:4,children:r})]})]})]})})},ia={wuSecondaryLink:"_wuSecondaryLink_1edl1_1",wuSecondaryNav:"_wuSecondaryNav_1edl1_6"},Ks=a=>{const{Links:t,children:r,className:s,...u}=a,l=i.useMemo(()=>t.map((b,x)=>i.cloneElement(b.link,{key:x,className:o(ia.wuSecondaryLink,b.link.props.className,"wu-secondary-nav-link-container"),children:e.jsxs(e.Fragment,{children:[i.cloneElement(b.imgOrIcon,{className:o("wu-w-5 wu-h-5 wu-flex wu-items-center wu-justify-center wu-text-lg wu-leading-5",b.imgOrIcon.props.className)}),e.jsx("div",{className:"wu-secondary-nav-link",children:b.link.props.children})]})})),[t]),n=i.useRef(null),d=i.useRef(null),w=i.useRef(null),[c,f]=ht(l,n,w);return e.jsx(e.Fragment,{children:e.jsxs("header",{className:o("wu-flex wu-items-center wu-justify-between wu-gap-4 wu-border-y wu-border-gray-25 wu-h-[50px]",s),...u,ref:n,children:[e.jsxs("div",{className:"wu-flex wu-items-center wu-justify-start wu-gap-2",children:[e.jsx("nav",{className:o(ia.wuSecondaryNav,"wu-flex wu-items-center wu-justify-start wu-w-full wu-h-full wu-secondary-nav-left"),ref:d,children:c}),f.length>0&&e.jsxs(ee,{children:[e.jsx(de,{className:"wu-p-1 wu-pb-0 wu-rounded-sm focus:wu-outline-none focus:wu-bg-gray-25","aria-label":"more",children:e.jsx("span",{className:"wm-more-vert"})}),e.jsx(Q,{className:o(ia.wuSecondaryNavPopover,"wu-secondary-nav-popover-left"),align:"start",sideOffset:12,children:f})]})]}),r&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"wu-items-center wu-justify-end wu-hidden sm:wu-flex",ref:w,children:r}),e.jsxs(ee,{children:[e.jsx(de,{className:"sm:wu-hidden",children:e.jsx("span",{className:"wu-text-lg wm-menu"})}),e.jsx(Q,{className:"wu-bg-white wu-border wu-border-blue-p wu-w-fit wu-secondary-nav-popover-right",align:"end",sideOffset:12,children:r})]})]})]})})},mt=i.forwardRef(({totalRows:a,initialPage:t,initialPageSize:r=100,onPageChange:s,className:u,disabled:l=!1,...n},d)=>{const[w,c]=i.useState(t),[f,b]=i.useState(r);i.useEffect(()=>{c(t),b(r)},[t,r]);const x=Math.ceil(a/f),v=w*f+1,m=Math.min((w+1)*f,a),p=Array.from({length:x},(g,N)=>N),C=i.useCallback(g=>{g>=0&&g<x&&(c(g),s==null||s(g))},[x,s]),S=7*32;return e.jsxs("div",{className:o("wu-flex wu-items-center wu-gap-[2px]",u,"wu-pagination"),...n,role:"navigation",children:[e.jsx(xt,{label:"Previous page",onClick:()=>C(w-1),disabled:w===0||l,icon:"wm-arrow-back-ios-new",className:"hover:wu-bg-gray-20 rtl:wu-rotate-180 wu-prev-btn"}),e.jsx(ut,{name:`${v} - ${m}`,className:"wu-w-[96px] wu-min-w-[96px] wu-pagination-menu",align:"end",disabled:l,children:e.jsx(ie,{style:{maxHeight:S+"px"},dir:n.dir,children:p.length>100?e.jsx(ye,{className:"wu-pagination-list",containerHeight:S,list:p,callback:(g,N)=>e.jsxs(wa,{onSelect:()=>C(N),className:o("wu-py-2",N===w&&"wu-bg-gray-20","wu-pagination-item"),children:[N*f+1," -"," ",Math.min((N+1)*f,a)]},g)}):p.map(g=>e.jsxs(wa,{onSelect:()=>C(g),className:o(g===w&&"wu-bg-gray-20","wu-py-2 hover:wu-bg-gray-20","wu-pagination-item"),children:[g*f+1," -"," ",Math.min((g+1)*f,a)]},g))})}),e.jsx(xt,{label:"Next page",onClick:()=>C(w+1),disabled:w===x-1||l,icon:"wm-arrow-forward-ios",className:"hover:wu-bg-gray-20 rtl:wu-rotate-180 wu-next-btn"})]})});mt.displayName="WuPagination";const xt=({label:a,onClick:t,disabled:r,icon:s,className:u})=>e.jsx(V,{variant:"iconOnly",onClick:t,disabled:r,className:o("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":a,children:e.jsx("span",{className:o("wu-text-sm",s)})}),Xs=({Trigger:a,children:t,className:r,dir:s,open:u,onOpenChange:l,modal:n,...d})=>e.jsxs(ee,{open:u,onOpenChange:l,modal:n,children:[e.jsx(de,{asChild:!0,dir:s,children:a}),e.jsx(Q,{className:o("wu-w-80 wu-p-0 wu-border-blue-p wu-bg-white wu-dark:border-gray-switcher",r),dir:s,...d,children:t})]}),Qs=a=>e.jsx(Se.PopoverClose,{asChild:!0,children:e.jsx(V,{...a})}),yt=y.forwardRef(({className:a,...t},r)=>e.jsx(Me.Root,{className:o("wu-grid wu-gap-2",a),...t,ref:r}));yt.displayName=Me.Root.displayName;const vt=y.forwardRef(({className:a,...t},r)=>e.jsx(Me.Item,{ref:r,className:o("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",a),...t,children:e.jsx(Me.Indicator,{className:"wu-flex wu-items-center wu-justify-center",children:e.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"})})}));vt.displayName=Me.Item.displayName;const Nt=i.forwardRef((a,t)=>{const{options:r,defaultValue:s,onChange:u,label:l,dir:n,...d}=a;return e.jsxs(yt,{defaultValue:s,required:d.required,disabled:d.disabled,onValueChange:u,id:d.id,dir:n,name:d.name,className:o("w-fit",d.className),ref:t,style:d.style,children:[e.jsx(me,{htmlFor:d.id,className:"wu-text-sm wu-font-normal wu-text-gray-lead wu-leading-6 wu-radio-group-label",children:l}),r.map(w=>e.jsxs("div",{className:"wu-flex wu-items-center wu-gap-2 wu-radio-item-container",children:[e.jsx(vt,{value:w.value,id:w.value,disabled:w.disabled,required:w.required,"aria-label":w.value,className:"wu-peer wu-radio-item"}),e.jsx(me,{htmlFor:w.value,className:o(w.required&&"after:wu-content-['*'] after:wu-mx-[2px] after:wu-text-rose-500","wu-radio-item-label"),children:w.label})]},w.value))]})});Nt.displayName="WuRadioGroup";const Ct=y.forwardRef(({className:a,orientation:t="horizontal",decorative:r=!0,...s},u)=>e.jsx(ka.Root,{ref:u,decorative:r,orientation:t,className:o("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",a),...s}));Ct.displayName=ka.Root.displayName;const St=P.Root,Zs=P.Trigger,Rs=P.Portal,kt=y.forwardRef(({className:a,...t},r)=>e.jsx(P.Overlay,{className:o("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",a,"wu-drawer-overlay"),...t,ref:r}));kt.displayName=P.Overlay.displayName;const eu=K.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"}}),ca=y.forwardRef(({side:a="right",className:t,children:r,hideCloseButton:s,...u},l)=>e.jsxs(Rs,{children:[e.jsx(kt,{}),e.jsxs(P.Content,{ref:l,className:o(eu({side:a}),t),...u,children:[r,!s&&e.jsx(P.Close,{"aria-label":"close",asChild:!0,children:e.jsxs(he,{variant:"iconOnly",className:"wu-absolute wu-right-4 wu-top-4",children:[e.jsx("span",{className:"wm-close"}),e.jsx("span",{className:"wu-sr-only",children:"Close"})]})})]})]}));ca.displayName=P.Content.displayName;const Tt=({className:a,...t})=>e.jsx("div",{className:o("",a),...t});Tt.displayName="SheetHeader";const fa=y.forwardRef(({className:a,...t},r)=>e.jsx(P.Title,{ref:r,className:o("wu-text-lg wu-font-semibold",a),...t}));fa.displayName=P.Title.displayName;const Mt=y.forwardRef(({className:a,...t},r)=>e.jsx(P.Description,{ref:r,className:o("wu-text-sm",a),...t}));Mt.displayName=P.Description.displayName;function It({className:a,...t}){return e.jsx("div",{className:o("animate-pulse rounded-md bg-muted",a),...t})}const pa=768;function au(){const[a,t]=y.useState(void 0);return y.useEffect(()=>{const r=window.matchMedia(`(max-width: ${pa-1}px)`),s=()=>{t(window.innerWidth<pa)};return r.addEventListener("change",s),t(window.innerWidth<pa),()=>r.removeEventListener("change",s)},[]),!!a}const tu="sidebar_state",ru=60*60*24*7,su="256px",uu="256px",ou="3rem",lu="b",Dt=y.createContext(null);function ce(){const a=y.useContext(Dt);if(!a)throw new Error("useSidebar must be used within a SidebarProvider.");return a}const Wt=y.forwardRef(({defaultOpen:a=!0,open:t,onOpenChange:r,className:s,style:u,children:l,...n},d)=>{const w=au(),[c,f]=y.useState(!1),[b,x]=y.useState(a),v=t??b,m=y.useCallback(g=>{const N=typeof g=="function"?g(v):g;r?r(N):x(N),document.cookie=`${tu}=${N}; path=/; max-age=${ru}`},[r,v]),p=y.useCallback(()=>w?f(g=>!g):m(g=>!g),[w,m,f]);y.useEffect(()=>{const g=N=>{N.key===lu&&(N.metaKey||N.ctrlKey)&&(N.preventDefault(),p())};return window.addEventListener("keydown",g),()=>window.removeEventListener("keydown",g)},[p]);const C=v?"expanded":"collapsed",S=y.useMemo(()=>({state:C,open:v,setOpen:m,isMobile:w,openMobile:c,setOpenMobile:f,toggleSidebar:p}),[C,v,m,w,c,f,p]);return e.jsx(Dt.Provider,{value:S,children:e.jsx(Ha,{delayDuration:0,children:e.jsx("div",{style:{"--sidebar-width":su,"--sidebar-width-icon":ou,...u},className:o("wu-group/sidebar-wrapper wu-flex wu-min-h-[calc(100svh-48px)] wu-w-full",s),ref:d,...n,children:l})})})});Wt.displayName="SidebarProvider";const _t=y.forwardRef(({side:a="left",variant:t="sidebar",collapsible:r="offcanvas",className:s,children:u,...l},n)=>{const{isMobile:d,state:w,openMobile:c,setOpenMobile:f}=ce();return r==="none"?e.jsx("div",{className:o("wu-flex wu-h-full wu-w-[--sidebar-width] wu-flex-col",s),ref:n,...l,children:u}):d?e.jsx(St,{open:c,onOpenChange:f,...l,children:e.jsxs(ca,{"data-sidebar":"sidebar","data-mobile":"true",className:"wu-w-[--sidebar-width] wu-bg-blue-sidebar wu-p-0 [&>button]:wu-hidden",style:{"--sidebar-width":uu},side:a,children:[e.jsxs(Tt,{className:"sr-only",children:[e.jsx(fa,{children:"Sidebar"}),e.jsx(Mt,{children:"Displays the mobile sidebar."})]}),e.jsx("div",{className:"wu-flex wu-flex-col wu-w-full wu-h-full",children:u})]})}):e.jsxs("div",{ref:n,className:"wu-hidden wu-group wu-peer md:wu-block","data-state":w,"data-collapsible":w==="collapsed"?r:"","data-variant":t,"data-side":a,children:[e.jsx("div",{className:o("wu-relative wu-w-[--sidebar-width] wu-bg-transparent wu-transition-[width] wu-duration-150 wu-ease-linear","group-data-[collapsible=offcanvas]:wu-w-0","group-data-[side=right]:wu-rotate-180",t==="floating"||t==="inset"?"group-data-[collapsible=icon]:wu-w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4))]":"group-data-[collapsible=icon]:wu-w-[--sidebar-width-icon]")}),e.jsx("div",{className:o("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",a==="left"?"wu-left-0 group-data-[collapsible=offcanvas]:wu-left-[calc(var(--sidebar-width)*-1)]":"wu-right-0 group-data-[collapsible=offcanvas]:wu-right-[calc(var(--sidebar-width)*-1)]",t==="floating"||t==="inset"?"wu-p-2 group-data-[collapsible=icon]:wu-w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4)_+2px)]":"group-data-[collapsible=icon]:wu-w-[--sidebar-width-icon] group-data-[side=left]:wu-border-r group-data-[side=right]:wu-border-l",s),...l,children:e.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})})]})});_t.displayName="Sidebar";const Ot=y.forwardRef(({className:a,onClick:t,children:r,...s},u)=>{const{toggleSidebar:l}=ce();return e.jsxs(he,{ref:u,"data-sidebar":"trigger",variant:"secondary",className:o("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",a),onClick:n=>{t==null||t(n),l()},...s,children:[r,e.jsx("span",{className:"wu-sr-only",children:"Toggle Sidebar"})]})});Ot.displayName="SidebarTrigger";const nu=y.forwardRef(({className:a,...t},r)=>{const{toggleSidebar:s}=ce();return e.jsx("button",{ref:r,"data-sidebar":"rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:s,title:"Toggle Sidebar",className:o("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",a),...t})});nu.displayName="SidebarRail";const Et=y.forwardRef(({className:a,...t},r)=>e.jsx("main",{ref:r,className:o("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",a),...t}));Et.displayName="SidebarInset";const wu=y.forwardRef(({className:a,...t},r)=>e.jsx(He,{ref:r,"data-sidebar":"input",className:o("wu-h-8 wu-w-full wu-shadow-none focus-visible:wu-ring-2",a),...t}));wu.displayName="SidebarInput";const Lt=y.forwardRef(({className:a,...t},r)=>e.jsx("div",{ref:r,"data-sidebar":"header",className:o("wu-flex wu-flex-col wu-gap-2 wu-p-2",a),...t}));Lt.displayName="SidebarHeader";const Pt=y.forwardRef(({className:a,...t},r)=>e.jsx("div",{ref:r,"data-sidebar":"footer",className:o("wu-flex wu-flex-col wu-gap-2 wu-pb-2",a),...t}));Pt.displayName="SidebarFooter";const du=y.forwardRef(({className:a,...t},r)=>e.jsx(Ct,{ref:r,"data-sidebar":"separator",className:o("wu-mx-2 wu-w-auto",a),...t}));du.displayName="SidebarSeparator";const zt=y.forwardRef(({className:a,...t},r)=>e.jsx("div",{ref:r,"data-sidebar":"content",className:o("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",a),...t}));zt.displayName="SidebarContent";const Ht=y.forwardRef(({className:a,...t},r)=>e.jsx("div",{ref:r,"data-sidebar":"group",className:o("wu-relative wu-flex wu-w-full wu-min-w-0 wu-flex-col wu-p-2",a),...t}));Ht.displayName="SidebarGroup";const At=y.forwardRef(({className:a,asChild:t=!1,...r},s)=>{const u=t?pe.Slot:"div";return e.jsx(u,{ref:s,"data-sidebar":"group-label",className:o("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",a),...r})});At.displayName="SidebarGroupLabel";const iu=y.forwardRef(({className:a,asChild:t=!1,...r},s)=>{const u=t?pe.Slot:"button";return e.jsx(u,{ref:s,"data-sidebar":"group-action",className:o("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",a),...r})});iu.displayName="SidebarGroupAction";const qt=y.forwardRef(({className:a,...t},r)=>e.jsx("div",{ref:r,"data-sidebar":"group-content",className:o("wu-w-full wu-text-sm",a),...t}));qt.displayName="SidebarGroupContent";const ba=y.forwardRef(({className:a,...t},r)=>e.jsx("ul",{ref:r,"data-sidebar":"menu",className:o("wu-flex wu-w-full wu-min-w-0 wu-flex-col wu-gap-1",a),...t}));ba.displayName="SidebarMenu";const Bt=y.forwardRef(({className:a,...t},r)=>e.jsx("li",{ref:r,"data-sidebar":"menu-item",className:o("wu-group/menu-item wu-relative",a),...t}));Bt.displayName="SidebarMenuItem";const cu=K.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"}}),jt=y.forwardRef(({asChild:a=!1,isActive:t=!1,variant:r="default",size:s="default",tooltip:u,className:l,...n},d)=>{const w=a?pe.Slot:"button",{isMobile:c,state:f}=ce(),b=e.jsx(w,{ref:d,"data-sidebar":"menu-button","data-size":s,"data-active":t,className:o(cu({variant:r,size:s}),l),...n});return u?(typeof u=="string"&&(u={children:u}),e.jsxs(Aa,{children:[e.jsx(qa,{asChild:!0,children:b}),e.jsx(aa,{side:"right",align:"center",hidden:f!=="collapsed"||c,...u})]})):b});jt.displayName="SidebarMenuButton";const fu=y.forwardRef(({className:a,asChild:t=!1,showOnHover:r=!1,...s},u)=>{const l=t?pe.Slot:"button";return e.jsx(l,{ref:u,"data-sidebar":"menu-action",className:o("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",a),...s})});fu.displayName="SidebarMenuAction";const pu=y.forwardRef(({className:a,...t},r)=>e.jsx("div",{ref:r,"data-sidebar":"menu-badge",className:o("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",a),...t}));pu.displayName="SidebarMenuBadge";const bu=y.forwardRef(({className:a,showIcon:t=!1,...r},s)=>{const u=y.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return e.jsxs("div",{ref:s,"data-sidebar":"menu-skeleton",className:o("wu-flex wu-h-8 wu-items-center wu-gap-2 wu-rounded-md wu-px-2",a),...r,children:[t&&e.jsx(It,{className:"wu-rounded-md wu-size-4","data-sidebar":"menu-skeleton-icon"}),e.jsx(It,{className:"wu-h-4 wu-max-w-[--skeleton-width] wu-flex-1","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":u}})]})});bu.displayName="SidebarMenuSkeleton";const hu=y.forwardRef(({className:a,...t},r)=>e.jsx("ul",{ref:r,"data-sidebar":"menu-sub",className:o("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",a),...t}));hu.displayName="SidebarMenuSub";const gu=y.forwardRef(({...a},t)=>e.jsx("li",{ref:t,...a}));gu.displayName="SidebarMenuSubItem";const mu=y.forwardRef(({asChild:a=!1,size:t="md",isActive:r,className:s,...u},l)=>{const n=a?pe.Slot:"a";return e.jsx(n,{ref:l,"data-sidebar":"menu-sub-button","data-size":t,"data-active":r,className:o("wu-flex wu-h-7 wu-min-w-0 wu-translate-x-px wu-items-center wu-gap-2 wu-overflow-hidden wu-rounded-md wu-px-2 wu-outline-none focus-visible:wu-ring-2 disabled:wu-pointer-events-none disabled:wu-opacity-50 aria-disabled:wu-pointer-events-none aria-disabled:wu-opacity-50 [&>span:last-child]:wu-truncate [&>svg]:wu-size-4 [&>svg]:wu-shrink-0","data-[active=true]:wu-bg-sidebar-accent data-[active=true]:wu-text-sidebar-accent-foreground",t==="sm"&&"wu-text-xs",t==="md"&&"wu-text-sm","group-data-[collapsible=icon]:wu-hidden",s),...u})});mu.displayName="SidebarMenuSubButton";const xu=({children:a,Sidebar:t,className:r,defaultOpen:s=!0,open:u,onOpenChange:l,style:n})=>e.jsxs(Wt,{defaultOpen:s,open:u,onOpenChange:l,children:[e.jsxs(_t,{variant:"sidebar",collapsible:"icon",className:o("wu-top-12 wu-h-[calc(100%-48px)] wu-shadow-sidebar wu-border-none",r),style:n,role:"complementary",children:[e.jsx(Lt,{className:"wu-py-2",children:e.jsx(Ft,{})}),t]}),e.jsx(Et,{children:a})]}),Ft=a=>{const{state:t,isMobile:r,openMobile:s}=ce();return e.jsx(Ot,{...a,children:e.jsx(da,{showMenu:r?s:t==="expanded"})})},yu=({className:a,children:t,...r})=>{const s=i.useRef(null),u=i.useRef(null),l=({currentTarget:d})=>{const{scrollTop:w,clientHeight:c,scrollHeight:f}=d;s.current&&s.current.classList.toggle("wu-border-[#1b338014]",w!==0),u.current&&u.current.classList.toggle("wu-border-[#1b338014]",w+c!==f)},n="wu-w-[calc(100%-16px)] wu-mx-auto wu-border-transparent";return e.jsxs(zt,{...r,className:o("wu-overflow-hidden wu-gap-0",a),children:[e.jsx("hr",{className:n,ref:s}),e.jsx(ie,{onScroll:l,className:"wu-gap-2",thumbColor:"#b9c3dc",railColor:"#00000000","data-testid":"scroll-area",children:t}),e.jsx("hr",{className:n,ref:u})]})},vu=a=>e.jsx(Pt,{...a,children:a.children}),Nu=({label:a,children:t,...r})=>e.jsxs(Ht,{...r,className:"wu-p-0",children:[e.jsx("div",{className:"wu-h-8",children:e.jsx(At,{className:"wu-items-end wu-px-4 wu-text-xs wu-font-normal wu-leading-4 wu-text-blue-q",children:a})}),e.jsx(qt,{children:e.jsx(ba,{children:t})})]}),Cu=a=>e.jsx(ba,{...a}),Su=({Icon:a,children:t,className:r,isActive:s,...u})=>{const{state:l}=ce(),[n,d]=i.useState(),w=t&&i.cloneElement(t,{children:e.jsxs("div",{className:"wu-flex wu-items-center wu-gap-2 wu-overflow-hidden wu-text-base wu-truncate wu-text-ellipsis",children:[a,e.jsx("span",{className:o("wu-text-sm wu-leading-4 wu-transition-opacity wu-duration-150",l==="collapsed"&&"wu-opacity-0"),children:t.props.children})]})}),c=i.useRef(null);return i.useEffect(()=>{var f;d(((f=c.current)==null?void 0:f.textContent)||"")},[]),e.jsx(Bt,{...u,className:"wu-flex wu-items-center wu-gap-2 wu-px-2",children:e.jsx(jt,{className:o("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:n,asChild:!0,ref:c,children:w})})},ku={wuStepper:"_wuStepper_apbnq_1"},Ut=i.forwardRef((a,t)=>{const{onChange:r,defaultValue:s=0,min:u,max:l,step:n,readonly:d,resetInvalidValueOnBlur:w=!0,value:c,label:f,labelPosition:b="top",className:x,style:v,...m}=a,[p,C]=i.useState(c||s),S=M=>!!(a.disabled||a.readOnly||M==="inc"&&Number(p||0)>=Number(l)||M==="dec"&&Number(p||0)<=Number(u)),g=i.useCallback(M=>{M.preventDefault(),C(W=>Number(W||u||0)+Number(n||1))},[u,n]),N=i.useCallback(M=>{M.preventDefault(),C(W=>W?Number(W)-Number(n||1):0)},[u,n]),k=i.useCallback(M=>M>=Number(u)&&M<=Number(l),[u,l]),T=M=>{const W=M.currentTarget.value;C(W)},I=i.useCallback(()=>{if(w&&!k(Number(p))){const M=Number(u)||0;C(M)}},[u,w,k,p]);i.useEffect(()=>{r&&r(Number(p))},[p,c]),i.useEffect(()=>{c&&s&&console.warn("As both value and defaultValue are passed, value will be used")},[c,s]);const O=o("wu-px-10 wu-h-[33px] wu-text-center wu-text-blue-q wu-text-xs wu-rounded-t-sm","wu-stepper-input");return e.jsxs("div",{className:o(ku.wuStepper,Tu({labelPosition:b}),x,"wu-stepper"),style:v,dir:m.dir,children:[e.jsx(me,{htmlFor:m.id,className:o(b!=="top"&&"wu-max-w-[160px]","wu-truncate wu-text-xs wu-font-normal wu-leading-6 wu-text-gray-lead wu-stepper-label"),dir:m.dir,children:f}),e.jsxs("div",{className:"wu-relative wu-flex wu-items-center wu-justify-start wu-w-fit wu-stepper-container",dir:m.dir,children:[e.jsx(V,{variant:"iconOnly",Icon:e.jsx("span",{className:"wu-text-base wm-add"}),className:o("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",m.dir==="rtl"?"wu-right-auto wu-left-0":"","wu-stepper-button"),onClick:g,disabled:S("inc"),"aria-label":"increment"}),e.jsx(He,{...m,ref:t,type:"number",className:O,onChange:T,min:u,max:l,step:n,readOnly:d,onBlur:I,value:p}),e.jsx(V,{variant:"iconOnly",Icon:e.jsx("span",{className:"wu-text-base wm-minimize"}),className:o("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",m.dir==="rtl"?"wu-left-auto wu-right-0":"","wu-stepper-button"),onClick:N,disabled:S("dec"),"aria-label":"decrement"})]})]})}),Tu=K.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"}}});Ut.displayName="WuStepper";const $t=K.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"}}),Mu=y.forwardRef(({className:a,variant:t,size:r,...s},u)=>e.jsx(Ta.Root,{ref:u,className:o($t({variant:t,size:r,className:a})),...s}));Mu.displayName=Ta.Root.displayName;const Gt=y.createContext({size:"default",variant:"default"}),$e=y.forwardRef(({className:a,variant:t,size:r,children:s,...u},l)=>e.jsx(Pe.Root,{ref:l,className:o("wu-flex wu-items-center wu-justify-center wu-gap-1",a),...u,children:e.jsx(Gt.Provider,{value:{variant:t,size:r},children:s})}));$e.displayName=Pe.Root.displayName;const fe=y.forwardRef(({className:a,children:t,variant:r,size:s,...u},l)=>{const n=y.useContext(Gt);return e.jsx(Pe.Item,{ref:l,className:o($t({variant:n.variant||r,size:n.size||s}),a),...u,children:t})});fe.displayName=Pe.Item.displayName;const Vt=i.forwardRef((a,t)=>{const{options:r,value:s,disabled:u,dir:l,onChange:n}=a,d=w=>o("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",w===s&&"wu-text-white",u&&s===w&&"wu-text-gray-lead","wu-switcher-icon-tab-item");return e.jsx(e.Fragment,{children:e.jsxs($e,{ref:t,type:"single",value:s,onValueChange:n,disabled:u,dir:l,className:o("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:[e.jsx("div",{role:"slider",className:o("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"&&l!=="rtl"&&"wu-translate-x-full",s==="opt2"&&l==="rtl"&&"-wu-translate-x-full",u&&"wu-bg-gray-40","wu-switcher-icon-tab-slider")}),e.jsx(fe,{value:"opt1",className:d("opt1"),children:r[0].label}),e.jsx(fe,{value:"opt2",className:d("opt2"),children:r[1].label})]})})});Vt.displayName="_IconTab";const Yt=i.forwardRef((a,t)=>{const{options:r,value:s,disabled:u,dir:l,size:n="md",onChange:d}=a,w=c=>o("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",n==="sm"&&"wu-h-6 wu-min-w-20",n==="md"&&"wu-h-8 wu-min-w-28",n==="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 e.jsx(e.Fragment,{children:e.jsxs($e,{ref:t,type:"single",value:s,onValueChange:d,disabled:u,dir:l,className:o("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:[e.jsx("div",{role:"slider",className:o("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 ",n==="sm"&&"wu-h-6 wu-min-w-20",n==="md"&&"wu-h-8 wu-min-w-28",n==="lg"&&"wu-h-10 wu-min-w-36",s==="opt1"&&"",s==="opt2"&&l!=="rtl"&&"wu-translate-x-full",s==="opt2"&&l==="rtl"&&"-wu-translate-x-full",u&&"wu-bg-gray-40","wu-switcher-tab-slider")}),e.jsx(fe,{value:"opt1",className:w("opt1"),children:e.jsx("div",{className:"wu-min-w-16 wu-max-w-[136px] wu-overflow-hidden wu-text-ellipsis wu-text-nowrap",children:r[0].label})}),e.jsx(fe,{value:"opt2",className:w("opt2"),children:e.jsx("div",{className:"wu-min-w-16 wu-max-w-[136px] wu-overflow-hidden wu-text-ellipsis wu-text-nowrap",children:r[1].label})})]})})});Yt.displayName="_Tab";const Jt=i.forwardRef((a,t)=>{const{options:r,value:s,disabled:u,dir:l,onChange:n}=a,d=b=>o("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",b===s&&"wu-text-primary wu-font-medium",u&&s===b&&"wu-text-gray-lead","wu-switcher-toggle-item"),w=o("wu-w-fit wu-gap-2",u&&"wu-cursor-not-allowed","wu-switcher-toggle-group"),c=o("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=o("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"&&l!=="rtl"&&"-wu-translate-x-[10px]",s==="opt1"&&l==="rtl"&&"wu-translate-x-[10px]",s==="opt2"&&l!=="rtl"&&"wu-translate-x-[10px]",s==="opt2"&&l==="rtl"&&"-wu-translate-x-[10px]",u&&"wu-hidden","wu-switcher-toggle-knob");return e.jsx(e.Fragment,{children:e.jsxs($e,{ref:t,type:"single",value:s,disabled:u,dir:l,className:w,onValueChange:n,children:[e.jsx(fe,{value:"opt1",className:d("opt1"),children:e.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})}),e.jsx("button",{onClick:()=>n(s==="opt1"?"opt2":"opt1"),className:c,disabled:u,"aria-label":"knob",dir:l,children:e.jsx("div",{className:f,role:"knob",dir:l})}),e.jsx(fe,{value:"opt2",className:d("opt2"),children:e.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})})]})})});Jt.displayName="_Toggle";const Kt=i.forwardRef((a,t)=>{const{type:r,options:s,value:u,disabled:l,dir:n,size:d,onChange:w,toggle:c=!0,...f}=a,[b,x]=i.useState(),v=m=>{let p=b;m!==""?p=m:c&&(p=b==="opt1"?"opt2":"opt1");const C=p==="opt1"?s[0].value:s[1].value;w&&w(C),x(p)};if(i.useEffect(()=>{if(!Array.isArray(s)||s.length<2)throw new Error("Options are not sufficient");x(u===s[0].value?"opt1":"opt2")},[s,u]),!Array.isArray(s)||s.length<2)return e.jsx(e.Fragment,{});switch(r){case"toggle":return e.jsx(Jt,{...f,ref:t,options:s,value:b||"opt1",onChange:v,disabled:l,dir:n});case"iconTab":return e.jsx(Vt,{ref:t,options:s,value:b||"opt1",onChange:v,disabled:l,dir:n});default:return e.jsx(Yt,{ref:t,options:s,value:b||"opt1",onChange:v,disabled:l,dir:n,size:d})}});Kt.displayName="WuSwitcher";const ha=y.forwardRef(({className:a,...t},r)=>e.jsx("table",{ref:r,className:o("wu-w-full wu-caption-bottom wu-text-sm",a),...t}));ha.displayName="Table";const Xt=y.forwardRef(({className:a,...t},r)=>e.jsx("thead",{ref:r,className:o("[&_tr]:wu-border-b",a),...t}));Xt.displayName="TableHeader";const Qt=y.forwardRef(({className:a,...t},r)=>e.jsx("tbody",{ref:r,className:o("",a),...t}));Qt.displayName="TableBody";const Iu=y.forwardRef(({className:a,...t},r)=>e.jsx("tfoot",{ref:r,className:o("wu-border-t wu-bg-muted/50 wu-font-medium [&>tr]:last:wu-border-b-0",a),...t}));Iu.displayName="TableFooter";const _e=y.forwardRef(({className:a,...t},r)=>e.jsx("tr",{ref:r,className:o("wu-border-b wu-transition-colors wu-hover:wu-bg-muted/50 data-[state=selected]:wu-bg-muted",a),...t}));_e.displayName="TableRow";const ga=y.forwardRef(({className:a,...t},r)=>e.jsx("th",{ref:r,className:o("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",a),...t}));ga.displayName="TableHead";const Ge=y.forwardRef(({className:a,...t},r)=>e.jsx("td",{ref:r,className:o("wu-p-4 wu-align-middle [&:has([role=checkbox])]:wu-pr-0",a),...t}));Ge.displayName="TableCell";const ma=y.forwardRef(({className:a,...t},r)=>e.jsx("caption",{ref:r,className:o("wu-mt-4 wu-text-sm wu-text-gray-subtle wu-font-normal",a),...t}));ma.displayName="TableCaption";const Zt=({columns:a,rowSelection:t})=>{const r=(t==null?void 0:t.isEnabled)??!1,{onRowSelect:s,rowUniqueKey:u}=t||{},l=i.useCallback(d=>w=>{s(()=>w?d:[])},[s]);return{finalColumns:i.useMemo(()=>r?[{id:"select",header:({table:d})=>{const w=d.getRowModel().rows.map(f=>f.original),c=l(w);return e.jsx(ae,{checked:d.getIsSomeRowsSelected()||d.getIsAllRowsSelected(),partial:d.getIsSomeRowsSelected()&&!d.getIsAllRowsSelected(),onChange:f=>{d.toggleAllRowsSelected(!!f),c(!!f)},"aria-label":"Select all","data-testid":d.getIsSomeRowsSelected()&&!d.getIsAllRowsSelected()?"select-partial":"select-all"})},cell:({row:d})=>e.jsx(ae,{checked:d.getIsSelected(),onChange:w=>{d.toggleSelected(!!w)},"aria-label":String(d.original[u])}),enableSorting:!1,filterable:!1,accessorKey:"select"},...a]:a,[a,r,l])}},Rt=({table:a,size:t,NoDataContent:r,isLoading:s,CustomLoader:u})=>{var d;const[l,n]=i.useState(null);return e.jsx(Qt,{children:s?e.jsx(_e,{children:e.jsx(Ge,{colSpan:a.getAllColumns().length,className:"wu-text-center wu-h-[35vh] wu-loader-container",children:u||e.jsx(ge,{className:"wu-w-full"})})}):(d=a.getRowModel().rows)!=null&&d.length?a.getRowModel().rows.map(w=>e.jsx(_e,{"data-state":w.getIsSelected()&&"selected",onMouseOver:()=>n(w.id),onMouseOut:()=>n(null),className:o("wu-transition-colors wu-border-b wu-border-black/[12%]",w.getIsSelected()?l===w.id?"wu-bg-blue-p/[16%]":"wu-bg-blue-p/[8%]":"hover:wu-bg-black/[2%]"),children:w.getVisibleCells().map(c=>e.jsx(Ge,{className:o("wu-py-0 wu-font-light wu-text-gray-lead wu-text-xs",t==="compact"?"wu-h-8":"wu-h-10",c.column.id==="actions"?"wu-opacity-0 wu-transition-opacity wu-duration-100":"",l===w.id&&c.column.id==="actions"?"wu-opacity-100 wu-visible":""),children:Z.flexRender(c.column.columnDef.cell,c.getContext())},c.id))},w.id)):e.jsx(_e,{children:e.jsx(Ge,{colSpan:a.getAllColumns().length,children:r})})})},er=({table:a,sortableColumns:t,manual:r=!1,onSort:s,size:u,isRowSelected:l,HeaderAction:n,isStickyHeader:d})=>{const w=c=>{const{id:f,columnDef:b,getIsSorted:x,toggleSorting:v}=c,{header:m}=b;if(!t.includes(f))return m;const p=x(),C=p==="asc",S=p==="desc",g=()=>{r?(v(!S),s==null||s({id:f,desc:S})):v(c.getIsSorted()==="asc")};return e.jsxs("button",{onClick:g,"aria-label":`Sort by ${m}`,className:"wu-flex wu-items-center wu-gap-4",children:[m,e.jsxs("div",{className:"wu-relative",children:[e.jsx("span",{className:o("wu-absolute -wu-top-[15px] wm-arrow-drop-down wu-text-xl",C&&"wu-hidden",!p&&"-wu-top-[11px]")}),e.jsx("span",{className:o("wu-absolute -wu-bottom-[13px] wm-arrow-drop-up wu-text-xl",S&&"wu-hidden",!p&&"-wu-bottom-[10px]")})]})]})};return e.jsxs(e.Fragment,{children:[e.jsx(Xt,{className:o("wu-border-t wu-border-black/[12%] wu-bg-gray-20 wu-relative",d&&"wu-sticky wu-top-[-.5px] wu-z-10",u==="compact"?"wu-h-8":"wu-h-10"),children:a.getHeaderGroups().map(c=>e.jsx(_e,{className:"wu-relative",children:c.headers.map(f=>f.column.id==="actions"?e.jsx(ga,{colSpan:f.colSpan,className:o("wu-text-gray-lead wu-text-xs wu-font-medium"),style:{width:`${f.getSize()}px`}},f.id):e.jsx(ga,{colSpan:f.colSpan,className:o("wu-text-gray-lead wu-text-xs wu-font-medium wu-bg-[#EEEEEE]","wu-relative wu-z-0"),style:{width:`${f.getSize()}px`},children:Z.flexRender(w(f.column),f.getContext())},f.id))},c.id))}),l&&n&&e.jsx("div",{className:o("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",d&&"wu-sticky wu-top-[-.1px] wu-z-10"),children:n})]})},Du=({data:a,columns:t,isLoading:r=!1,variant:s="unstyled",sort:u,size:l,rowSelection:n,HeaderAction:d,NoDataContent:w,stickyHeader:c=!1,CustomLoader:f,caption:b,...x})=>{var g;const v=((g=n==null?void 0:n.selectedRows)==null?void 0:g.length)??0,{finalColumns:m}=Zt({columns:t,rowSelection:n}),p=i.useMemo(()=>t.filter(N=>N.enableSorting).map(N=>N.accessorKey),[m]),C=i.useMemo(()=>{if(!(n!=null&&n.isEnabled))return{};const N={};for(const k of n.selectedRows){const T=a.findIndex(I=>I[n.rowUniqueKey]===k[n.rowUniqueKey]);T!==-1&&(N[T]=!0)}return N},[n==null?void 0:n.selectedRows,a,n==null?void 0:n.rowUniqueKey,n==null?void 0:n.isEnabled]),S=Z.useReactTable({data:a,columns:m,getCoreRowModel:Z.getCoreRowModel(),getPaginationRowModel:Z.getPaginationRowModel(),manualPagination:!0,manualSorting:!0,manualFiltering:!0,enableRowSelection:n==null?void 0:n.isEnabled,state:{...n!=null&&n.isEnabled?{rowSelection:C}:{}},onRowSelectionChange:N=>{if(typeof N=="function"){const k=N(C),T=Object.keys(k).filter(I=>k[I]).map(I=>a[Number(I)]);n==null||n.onRowSelect(T)}}});return e.jsxs("div",{className:o("wu-table-container wu-relative"),children:[b&&e.jsx(ma,{className:"wu-font-light",children:b}),e.jsxs(ha,{...x,className:o(Wu({variant:s}),x.className),children:[e.jsx(er,{table:S,sortableColumns:p,manual:!0,onSort:u==null?void 0:u.onSort,size:l,HeaderAction:d,isRowSelected:v>0,isStickyHeader:c}),!r&&e.jsx(Rt,{table:S,size:l,NoDataContent:w,CustomLoader:f})]}),r&&e.jsx("div",{className:"wu-flex wu-items-center wu-justify-center wu-h-96",children:e.jsx(ge,{})})]})},Wu=K.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"}}}),ar=({data:a,columns:t,caption:r,variant:s="unstyled",sort:u,filterText:l,size:n="default",pagination:d,rowSelection:w,HeaderAction:c,NoDataContent:f,CustomLoader:b,isLoading:x,stickyHeader:v,...m})=>{var re;const[p,C]=i.useState((u==null?void 0:u.initial)||[]),[S,g]=i.useState([]),N=((re=w==null?void 0:w.selectedRows)==null?void 0:re.length)??0,[k,T]=i.useState((d==null?void 0:d.pageIndex)??0),{finalColumns:I}=Zt({columns:t,rowSelection:w}),O=i.useMemo(()=>I.filter(D=>D.enableSorting).map(D=>D.accessorKey),[I]),M=i.useMemo(()=>I.filter(D=>D.filterable).map(D=>D.accessorKey),[I]),W=i.useMemo(()=>{if(!(w!=null&&w.isEnabled))return{};const D={};for(const B of w.selectedRows){const Y=a.findIndex($=>$[w.rowUniqueKey]===B[w.rowUniqueKey]);Y!==-1&&(D[Y]=!0)}return D},[w==null?void 0:w.selectedRows,a,w==null?void 0:w.rowUniqueKey,w==null?void 0:w.isEnabled]),q=Z.useReactTable({data:a,columns:I,getCoreRowModel:Z.getCoreRowModel(),enableRowSelection:w==null?void 0:w.isEnabled,getPaginationRowModel:Z.getPaginationRowModel(),getSortedRowModel:Z.getSortedRowModel(),getFilteredRowModel:Z.getFilteredRowModel(),initialState:{pagination:{pageSize:(d==null?void 0:d.pageSize)??100,pageIndex:(d==null?void 0:d.pageIndex)??0}},state:{sorting:p,columnFilters:S,...d?{pagination:d}:{},...w!=null&&w.isEnabled?{rowSelection:W}:{}},onSortingChange:C,onColumnFiltersChange:g,onRowSelectionChange:D=>{const B=typeof D=="function"?D(W):D,Y=Object.keys(B).filter($=>B[$]).map($=>a[Number($)]);w==null||w.onRowSelect(Y)}});return i.useEffect(()=>{M.forEach(D=>{var B;(B=q.getColumn(D))==null||B.setFilterValue(l)})},[l,M,q]),i.useEffect(()=>{d&&(d==null?void 0:d.pageIndex)!==k&&(w==null||w.onRowSelect(()=>[]),q.resetRowSelection(),T(d.pageIndex))},[d==null?void 0:d.pageIndex]),e.jsx("div",{className:"wu-table-container wu-relative",children:e.jsxs(ha,{...m,className:o(_u({variant:s}),"wu-table-fixed",m.className),children:[r&&e.jsx(ma,{className:"wu-font-light",children:r}),e.jsx(er,{table:q,sortableColumns:O,size:n,HeaderAction:c,isRowSelected:N>0,isStickyHeader:v}),e.jsx(Rt,{table:q,size:n,NoDataContent:f,CustomLoader:b,isLoading:x})]})})},_u=K.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"}}});ar.displayName="WuTable";const tr=y.forwardRef(({className:a,...t},r)=>e.jsx("textarea",{className:o("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 ",a),ref:r,...t}));tr.displayName="Textarea";const rr=i.forwardRef((a,t)=>{const{Label:r,id:s=ze(),variant:u="flat",readonly:l,maxLength:n,labelPosition:d="top",...w}=a,c=b=>{w.onChange&&w.onChange(b)},f=Ie(d);return e.jsxs("div",{className:o(f,"wu-flex wu-textarea-container"),dir:w.dir,children:[e.jsx(tr,{...w,ref:t,id:s,className:o("wu-peer wu-rounded-t-sm",u==="outlined"?"wu-border wu-border-gray-subtle":"",w.className),onChange:c,readOnly:l,maxLength:n}),r&&e.jsx(R,{htmlFor:s,className:"wu-textarea-label",children:r})]})});rr.displayName="WuTextarea";const Ou=1,Eu=1e6;let xa=0;function Lu(){return xa=(xa+1)%Number.MAX_SAFE_INTEGER,xa.toString()}const ya=new Map,sr=a=>{if(ya.has(a))return;const t=setTimeout(()=>{ya.delete(a),Oe({type:"REMOVE_TOAST",toastId:a})},Eu);ya.set(a,t)},Pu=(a,t)=>{switch(t.type){case"ADD_TOAST":return{...a,toasts:[t.toast,...a.toasts].slice(0,Ou)};case"UPDATE_TOAST":return{...a,toasts:a.toasts.map(r=>r.id===t.toast.id?{...r,...t.toast}:r)};case"DISMISS_TOAST":{const{toastId:r}=t;return r?sr(r):a.toasts.forEach(s=>{sr(s.id)}),{...a,toasts:a.toasts.map(s=>s.id===r||r===void 0?{...s,open:!1}:s)}}case"REMOVE_TOAST":return t.toastId===void 0?{...a,toasts:[]}:{...a,toasts:a.toasts.filter(r=>r.id!==t.toastId)}}},Ve=[];let Ye={toasts:[]};function Oe(a){Ye=Pu(Ye,a),Ve.forEach(t=>{t(Ye)})}function zu({...a}){const t=Lu(),r=u=>Oe({type:"UPDATE_TOAST",toast:{...u,id:t}}),s=()=>Oe({type:"DISMISS_TOAST",toastId:t});return Oe({type:"ADD_TOAST",toast:{...a,id:t,open:!0,onOpenChange:u=>{u||s()}}}),{id:t,dismiss:s,update:r}}function ur(){const[a,t]=i.useState(Ye);return i.useEffect(()=>(Ve.push(t),()=>{const r=Ve.indexOf(t);r>-1&&Ve.splice(r,1)}),[a]),{...a,toast:zu,dismiss:r=>Oe({type:"DISMISS_TOAST",toastId:r})}}const Hu=()=>{const{toast:a}=ur();if(!a)throw new Error("Toast not initialized. Please render <WuToast /> at the root of your app.");return{showToast:({variant:t="success",message:r,duration:s=3e3})=>{a?a({description:r,variant:t,duration:s}):console.error("Toast instance not initialized")}}},Au=G.Provider,qu=K.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"}}),or=y.forwardRef(({className:a,position:t,...r},s)=>e.jsx(G.Viewport,{ref:s,className:o(qu({position:t}),a),...r}));or.displayName=G.Viewport.displayName;const Bu=K.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"}}),lr=y.forwardRef(({className:a,variant:t,...r},s)=>e.jsx(G.Root,{ref:s,className:o(Bu({variant:t}),a),...r}));lr.displayName=G.Root.displayName;const ju=y.forwardRef(({className:a,...t},r)=>e.jsx(G.Action,{ref:r,className:o("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",a),...t}));ju.displayName=G.Action.displayName;const nr=y.forwardRef(({className:a,...t},r)=>e.jsx(G.Close,{ref:r,className:o("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",a),"toast-close":"","aria-label":"Close toast",...t,children:e.jsx("span",{className:"wm-close wu-text-base"})}));nr.displayName=G.Close.displayName;const wr=y.forwardRef(({className:a,...t},r)=>e.jsx(G.Title,{ref:r,className:o("wu-text-sm wu-font-semibold",a),...t}));wr.displayName=G.Title.displayName;const dr=y.forwardRef(({className:a,...t},r)=>e.jsx(G.Description,{ref:r,className:o("wu-text-sm wu-opacity-90",a),...t}));dr.displayName=G.Description.displayName;function Fu(){const{toasts:a}=ur();return e.jsxs(Au,{children:[a.map(function({id:t,title:r,description:s,action:u,variant:l,...n}){const d={success:"wm-check-circle",info:"wm-info",warning:"wm-error",error:"wm-cancel"};return e.jsxs(lr,{variant:l,...n,children:[e.jsxs("div",{className:"wu-grid wu-gap-1",children:[r&&e.jsx(wr,{children:r}),s&&e.jsxs(dr,{className:"wu-flex wu-items-center wu-gap-3 wu-pr-6",children:[e.jsx(we,{icon:d[l||"success"],className:"wu-text-xl"}),s]})]}),u,e.jsx(nr,{})]},t)}),e.jsx(or,{})]})}const Uu=()=>e.jsx(Fu,{}),ir=y.forwardRef(({className:a,dir:t,...r},s)=>e.jsx(Xe.Root,{className:o("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",a),...r,ref:s,children:e.jsx(Xe.Thumb,{className:o("wu-block wu-h-4 wu-w-4 wu-rounded-full wu-bg-gray-subtle wu-shadow-lg wu-ring-0 wu-transition-all data-[state=checked]:wu-bg-blue-p","group-hover:data-[state=unchecked]:wu-bg-gray-lead",t==="rtl"&&"-wu-translate-x-4 data-[state=unchecked]:wu-translate-x-0",t!=="rtl"&&"wu-translate-x-4 data-[state=unchecked]:wu-translate-x-0","wu-toggle-thumb")})}));ir.displayName=Xe.Root.displayName;const cr=i.forwardRef((a,t)=>{const{Label:r,labelPosition:s="right",onChange:u,className:l,dir:n,disabled:d,id:w=ze(),...c}=a;return i.useEffect(()=>{const{checked:f,defaultChecked:b}=c;f!==void 0&&b!==void 0&&console.error("WuToggle: Both `checked` and `defaultChecked` props are set. Use only one of them.")},[c.checked,c.defaultChecked]),e.jsxs("div",{className:o($u({labelPosition:s}),"wu-toggle-container"),dir:n,children:[e.jsx(ir,{...c,id:w,disabled:d,ref:t,onCheckedChange:u,className:o("wu-peer",l),dir:n}),e.jsx(R,{htmlFor:w,className:"wu-toggle-label",children:r})]})});cr.displayName="WuToggle";const $u=K.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"}}}),fr=i.forwardRef((a,t)=>{const{className:r,rounded:s,...u}=a;return e.jsx("div",{className:o("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:t,...u})});fr.displayName="WuCard";const Gu=i.forwardRef((a,t)=>{const{className:r,...s}=a;return e.jsx("div",{ref:t,...s,className:o("wu-p-2 wu-mb-2 wu-border-b wu-border-gray-40 min-h-12 wu-card-header",r)})});Gu.displayName="WuCardHeader";const Vu=i.forwardRef((a,t)=>{const{className:r,...s}=a;return e.jsx("div",{ref:t,...s,className:o("wu-p-2 wu-mt-2 wu-border-t wu-border-gray-40 min-h-12 wu-card-footer",r)})});Vu.displayName="WuCardHeader";const Yu=a=>{const{Trigger:t,children:r,hideCloseButton:s,className:u,side:l="left",...n}=a;return e.jsxs(St,{children:[e.jsx(Zs,{asChild:!0,children:t}),e.jsxs(ca,{...n,side:l,className:o("wu-bg-white wu-text-gray-lead wu-px-0",u),hideCloseButton:s,children:[e.jsx("div",{className:"wu-hidden",children:e.jsx(fa,{})}),r]})]})},oe=(a,t)=>`wu-listbox-${a}`,Ju=a=>{const{CustomTrigger:t,disabled:r,value:s,placeholder:u,accessorKey:l,Chip:n,handleUnselect:d,variant:w,dir:c,...f}=a,[b,x]=i.useState(),v=i.useRef(null);return i.useEffect(()=>{if(!s){x(null);return}x(Array.isArray(s)?n?s.map((p,C)=>n({value:p,unselect:d,key:C})):s.map(p=>p[l.label]).join(", "):n?n({value:s,unselect:d}):s[l.label])},[s,n,l.label,x]),e.jsx(de,{asChild:!0,id:a.id,disabled:r,ref:v,children:(t==null?void 0:t(s))||e.jsxs("button",{...f,className:o("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",w==="outlined"&&"wu-border wu-border-gray-subtle wu-bg-white",f.className,oe("trigger")),children:[e.jsx("div",{className:o("wu-truncate",n&&"wu-flex wu-items-center wu-gap-1 wu-flex-wrap",!b&&"wu-font-light"),children:b||u}),e.jsx(we,{icon:"wm-arrow-drop-down",className:o("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",oe("drop-icon"))})]})})},Ku=a=>{const{option:t,accessorKey:r,onSelect:s,multiple:u,children:l,value:n,dir:d,...w}=a;return e.jsxs(De,{...w,onSelect:()=>s==null?void 0:s(t),value:JSON.stringify(t),className:o("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",d==="rtl"&&"wu-justify-end",oe("item")),disabled:t.disabled,children:[e.jsx("span",{className:"wu-hidden",children:crypto.randomUUID()}),u&&e.jsx(ae,{checked:Array.isArray(n)&&!!n.find(c=>c[r.value]===t[r.value])}),l]})},pr=i.memo(Ku),Xu=a=>{const{label:t,onSelectAll:r,data:s,value:u}=a,[l,n]=i.useState(!1),[d,w]=i.useState(!1);return i.useEffect(()=>{!u||!s||(n(u.length>0),w(u.length>0&&u.length<s.length))},[s,u]),e.jsxs(De,{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(!l),children:[e.jsx(ae,{checked:l,partial:d}),t||"Select All"]})},Qu=a=>{const{className:t,...r}=a;return e.jsxs("div",{className:"wu-relative",children:[e.jsx(we,{icon:"wm-search",className:"wu-absolute wu-top-[14px] wu-left-5"}),e.jsx(Ga,{...r,"aria-label":"Search",className:o("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;",oe("input"),t)})]})},Zu=a=>{const{data:t,accessorKey:r,value:s,Item:u,Label:l,CustomHeader:n,CustomTrigger:d,NoDataContent:w,Chip:c,onSelect:f,onScroll:b,disabled:x,multiple:v,searchable:m,selectAll:p,virtualizedThreshold:C=100,id:S,dir:g,className:N,listClass:k,placeholder:T="Select items...",variant:I,labelPosition:O="top"}=a,[M,W]=i.useState(!1),[q,re]=i.useState(""),[D,B]=i.useState(s),[Y,$]=i.useState(t),le=i.useMemo(()=>r,[r]),X=E=>{v?B(_=>{const j=E[r.value],J=Array.isArray(_)?_:[],Ee=J.some(ue=>ue[r.value]===j)?J.filter(ue=>ue[r.value]!==j):[...J,E];return f&&f(Ee),Ee}):(B(E),f&&f(E),W(!1))},ve=i.useCallback(E=>{const _=E?t:[];B(_),p!=null&&p.onSelectAll&&p.onSelectAll(E),f&&f(_)},[t,p,f]),Ne=i.useCallback(E=>{re(E);const _=E.toLowerCase().trim(),j=t.filter(J=>J[r.label].toLowerCase().trim().includes(_));$(j)},[t,r.label]),se=i.useCallback(E=>Array.isArray(D)?D.some(_=>_[r.value]===E[r.value]):(D==null?void 0:D[r.value])===E[r.value],[D,r.value]);return i.useEffect(()=>{B(s)},[s]),i.useEffect(()=>{$(t)},[t]),e.jsxs("div",{className:o("wu-flex wu-text-sm wu-gap-2",O==="top"&&"wu-flex-col wu-gap-1",O==="left"&&"wu-flex-row",O==="right"&&"wu-flex-row-reverse",oe("container")),dir:g,children:[l&&e.jsx(R,{htmlFor:S,className:oe("label"),children:l}),e.jsxs(ee,{open:M,onOpenChange:W,children:[e.jsx(Ju,{CustomTrigger:d,disabled:x,value:D,accessorKey:r,placeholder:T,Chip:c,className:N,handleUnselect:X,variant:I,id:S,dir:g}),e.jsx(Q,{className:o("wu-w-[--radix-popover-trigger-width] wu-p-0 wu-bg-white wu-border wu-border-blue-p",oe("content")),align:"start",sideOffset:-1,children:e.jsxs(ua,{id:a.id,shouldFilter:!1,children:[m&&e.jsx(Qu,{value:q,onValueChange:Ne}),n,e.jsxs(oa,{className:o("wu-max-h-96 wu-overflow-y-auto",oe("list"),k),onScroll:b,children:[e.jsx(la,{children:w||"No results found."}),e.jsx(Be,{children:v&&(p==null?void 0:p.enabled)&&!q&&e.jsx(Xu,{data:t,value:D,onSelectAll:ve,label:p.label})}),e.jsx(Be,{children:t.length>C?e.jsx(ye,{list:Y,callback:(E,_)=>e.jsxs(pr,{option:_,accessorKey:le,multiple:v,onSelect:j=>X(j),value:D,dir:g,children:[u&&u({value:_,isSelected:se(_)}),!u&&_&&e.jsx(e.Fragment,{children:_[r.label]})]},JSON.stringify(_)),dir:g}):Y.map(E=>e.jsxs(pr,{option:E,accessorKey:le,multiple:v,onSelect:()=>X(E),value:D,dir:g,children:[u&&u({value:E,isSelected:se(E)}),!u&&e.jsx(e.Fragment,{children:E[r.label]})]},JSON.stringify(E)))})]})]})})]})]})};h.WuAppHeader=ts,h.WuAppHeaderAccount=_a,h.WuAppHeaderBar=za,h.WuAppHeaderHelp=Oa,h.WuAppHeaderMenu=Pa,h.WuAppHeaderSearch=es,h.WuButton=V,h.WuCalender=ta,h.WuCard=fr,h.WuCheckbox=ae,h.WuCombobox=gs,h.WuCopyToClipboard=ms,h.WuDataTable=Du,h.WuDatePicker=ss,h.WuDateRangePicker=ls,h.WuDisplay=Fr,h.WuDrawer=Yu,h.WuFooter=rt,h.WuFormGroup=Rr,h.WuHeading=Br,h.WuHelpButton=st,h.WuIcon=we,h.WuInput=xe,h.WuInputError=Xr,h.WuInputHint=Qr,h.WuLabel=R,h.WuListbox=Zu,h.WuLoader=ge,h.WuMenu=ut,h.WuMenuCheckboxItem=xs,h.WuMenuIcon=da,h.WuMenuItem=wa,h.WuMenuItemGroup=ys,h.WuMenuRadioItem=vs,h.WuMenuSeparatorItem=Ns,h.WuModal=Ls,h.WuModalClose=As,h.WuModalContent=Ps,h.WuModalFooter=Hs,h.WuModalHeader=zs,h.WuMonthPicker=Vs,h.WuPagination=mt,h.WuPopover=Xs,h.WuPopoverClose=Qs,h.WuPrimaryNavbar=Js,h.WuRadioGroup=Nt,h.WuSecondaryNavbar=Ks,h.WuSelect=bt,h.WuSidebar=xu,h.WuSidebarContent=yu,h.WuSidebarFooter=vu,h.WuSidebarGroup=Nu,h.WuSidebarItem=Su,h.WuSidebarMenu=Cu,h.WuSidebarTrigger=Ft,h.WuStepper=Ut,h.WuSubMenu=Cs,h.WuSubtext=jr,h.WuSwitcher=Kt,h.WuTable=ar,h.WuText=qr,h.WuTextarea=rr,h.WuToast=Uu,h.WuToggle=cr,h.WuTooltip=Ae,h.WuTruncatedLabel=as,h.WuVirtualScroll=ye,h.useWuShowToast=Hu,h.useWuSidebar=ce,Object.defineProperty(h,Symbol.toStringTag,{value:"Module"})});
2
2
  //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@npm-questionpro/wick-ui-lib",
3
3
  "private": false,
4
- "version": "1.0.2",
4
+ "version": "1.0.3",
5
5
  "description": "A React component library by QuestionPro for building web applications with ease",
6
6
  "keywords": [
7
7
  "react",