@npm-questionpro/wick-ui-lib 1.9.0 → 1.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/base/ui/button.d.ts +1 -2
- package/dist/src/components/pagination/WuPagination.d.ts +1 -1
- package/dist/src/components/stepper/WuStepper.d.ts +8 -5
- package/dist/src/components/table/components/table/WuTable.d.ts +6 -9
- package/dist/src/components/table/hooks/useTableCore.d.ts +14 -0
- package/dist/src/components/table/utils/data.d.ts +1 -0
- package/dist/src/components/table/utils/variantClass.d.ts +3 -0
- package/dist/src/components/tooltip/WuTooltip.d.ts +2 -0
- package/dist/style.css +1 -1
- package/dist/wick-ui-lib/es/index.js +5222 -3517
- package/dist/wick-ui-lib/umd/index.js +7 -4
- package/package.json +6 -5
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
(function(x,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("react/jsx-runtime"),require("@radix-ui/react-accordion"),require("react"),require("clsx"),require("tailwind-merge"),require("@radix-ui/react-avatar"),require("@radix-ui/react-slot"),require("class-variance-authority"),require("@radix-ui/react-label"),require("@radix-ui/react-tooltip"),require("date-fns"),require("@radix-ui/react-popover"),require("react-day-picker"),require("@radix-ui/react-checkbox"),require("cmdk"),require("react-virtuoso"),require("@radix-ui/react-dropdown-menu"),require("@radix-ui/react-dialog"),require("@radix-ui/react-scroll-area"),require("@radix-ui/react-radio-group"),require("@radix-ui/react-separator"),require("@radix-ui/react-toggle-group"),require("@radix-ui/react-toggle"),require("@radix-ui/react-tabs"),require("@tanstack/react-table"),require("@radix-ui/react-toast"),require("@radix-ui/react-switch")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","@radix-ui/react-accordion","react","clsx","tailwind-merge","@radix-ui/react-avatar","@radix-ui/react-slot","class-variance-authority","@radix-ui/react-label","@radix-ui/react-tooltip","date-fns","@radix-ui/react-popover","react-day-picker","@radix-ui/react-checkbox","cmdk","react-virtuoso","@radix-ui/react-dropdown-menu","@radix-ui/react-dialog","@radix-ui/react-scroll-area","@radix-ui/react-radio-group","@radix-ui/react-separator","@radix-ui/react-toggle-group","@radix-ui/react-toggle","@radix-ui/react-tabs","@tanstack/react-table","@radix-ui/react-toast","@radix-ui/react-switch"],t):(x=typeof globalThis<"u"?globalThis:x||self,t(x["wick-ui-lib"]={},x["react/jsx-runtime"],x.RadixUIAccordion,x.React,x.clsx,x.tailwindMerge,x.RadixUIAvatar,x.RadixUISlot,x.ClassVarianceAuthority,x.RadixUILabel,x.RadixUITooltip,x.dateFns,x.RadixUIPopover,x.ReactDayPicker,x.RadixUICheckbox,x.cmdk,x.ReactVirtuoso,x.RadixUIDropdownMenu,x.RadixUIDialog,x.RadixUIScrollArea,x.RadixUIRadioGroup,x.RadixUISeparator,x.RadixUIToggleGroup,x.RadixUIToggle,x.RadixUITabs,x.TanstackReactTable,x.RadixUIToast,x.RadixUISwitch))})(this,function(x,t,Br,d,zr,Hr,jr,ye,X,$r,Qe,A,De,Ot,Ur,G,Gr,Vr,Yr,Jr,Kr,Xr,Qr,Zr,Rr,R,es,ts){"use strict";function j(e){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const s=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(a,r,s.get?s:{enumerable:!0,get:()=>e[r]})}}return a.default=e,Object.freeze(a)}const de=j(Br),N=j(d),ve=j(jr),Lt=j($r),Me=j(Qe),Ie=j(De),Ze=j(Ur),L=j(Vr),O=j(Yr),ce=j(Jr),We=j(Kr),Pt=j(Xr),Fe=j(Qr),Ft=j(Zr),fe=j(Rr),K=j(es),Re=j(ts),as={qualitative:{"--wu-qualitative-1":"#4C5B94","--wu-qualitative-2":"#5B7AAE","--wu-qualitative-3":"#409EB5","--wu-qualitative-4":"#40B59E","--wu-qualitative-5":"#60C790","--wu-qualitative-6":"#9AD69A","--wu-qualitative-7":"#B3BD56","--wu-qualitative-8":"#DD8F40","--wu-qualitative-9":"#CE6550","--wu-qualitative-10":"#AE4C3D","--wu-qualitative-11":"#8F3328","--wu-qualitative-12":"#985D75","--wu-qualitative-13":"#B181A8","--wu-qualitative-14":"#C5A0C2","--wu-qualitative-15":"#DAC2E0","--wu-qualitative-16":"#E3D9E8"},blueSequential:{"--wu-blue-sequential-1":"#EBF8FF","--wu-blue-sequential-2":"#D7EFFF","--wu-blue-sequential-3":"#C2DEFF","--wu-blue-sequential-4":"#AAD0FF","--wu-blue-sequential-5":"#94C1F3","--wu-blue-sequential-6":"#7DB2E7","--wu-blue-sequential-7":"#67A3DB","--wu-blue-sequential-8":"#5194CF","--wu-blue-sequential-9":"#3B85C3","--wu-blue-sequential-10":"#2576B7","--wu-blue-sequential-11":"#256CAC","--wu-blue-sequential-12":"#1A60A6","--wu-blue-sequential-13":"#184994","--wu-blue-sequential-14":"#1C337F","--wu-blue-sequential-15":"#0D2163","--wu-blue-sequential-16":"#00083D"},greenSequential:{"--wu-green-sequential-1":"#E0F9ED","--wu-green-sequential-2":"#C4F3DC","--wu-green-sequential-3":"#A8ECCC","--wu-green-sequential-4":"#8DE5BD","--wu-green-sequential-5":"#78DDB1","--wu-green-sequential-6":"#62D3A3","--wu-green-sequential-7":"#4CC996","--wu-green-sequential-8":"#3ABF8A","--wu-green-sequential-9":"#35AF7F","--wu-green-sequential-10":"#329D75","--wu-green-sequential-11":"#308A6A","--wu-green-sequential-12":"#2D7A60","--wu-green-sequential-13":"#286A55","--wu-green-sequential-14":"#255C4B","--wu-green-sequential-15":"#1F4B3E","--wu-green-sequential-16":"#1B3D34"},redSequential:{"--wu-red-sequential-1":"#FEE9EC","--wu-red-sequential-2":"#FFD2D8","--wu-red-sequential-3":"#FFBBC4","--wu-red-sequential-4":"#FFA6B3","--wu-red-sequential-5":"#FB97A5","--wu-red-sequential-6":"#F78998","--wu-red-sequential-7":"#F37C8C","--wu-red-sequential-8":"#EE6F80","--wu-red-sequential-9":"#E76172","--wu-red-sequential-10":"#E15466","--wu-red-sequential-11":"#DA465B","--wu-red-sequential-12":"#D33B50","--wu-red-sequential-13":"#BC3548","--wu-red-sequential-14":"#A73343","--wu-red-sequential-15":"#91313E","--wu-red-sequential-16":"#7D2D38"},orangeSequential:{"--wu-orange-sequential-1":"#FDEDE5","--wu-orange-sequential-2":"#FCDFCF","--wu-orange-sequential-3":"#FBCFBA","--wu-orange-sequential-4":"#FAC5AB","--wu-orange-sequential-5":"#F7B694","--wu-orange-sequential-6":"#F6AB85","--wu-orange-sequential-7":"#F79D70","--wu-orange-sequential-8":"#F6915F","--wu-orange-sequential-9":"#EF8450","--wu-orange-sequential-10":"#E37944","--wu-orange-sequential-11":"#DB713C","--wu-orange-sequential-12":"#D06530","--wu-orange-sequential-13":"#C95E29","--wu-orange-sequential-14":"#BD521C","--wu-orange-sequential-15":"#B24610","--wu-orange-sequential-16":"#AA3F08"},divergent:{"--wu-red-divergent-1":"#661200","--wu-red-divergent-2":"#A11C00","--wu-red-divergent-3":"#D2300E","--wu-red-divergent-4":"#DF4828","--wu-red-divergent-5":"#EB6A4A","--wu-red-divergent-6":"#F4896C","--wu-red-divergent-7":"#FFC4B3","--wu-red-divergent-8":"#FFE2D9","--wu-divergent-neutral":"#F5F5F5","--wu-blue-divergent-1":"#DBD9E9","--wu-blue-divergent-2":"#B7B5D4","--wu-blue-divergent-3":"#9392BF","--wu-blue-divergent-4":"#7070AA","--wu-blue-divergent-5":"#4A5195","--wu-blue-divergent-6":"#1B3380","--wu-blue-divergent-7":"#182D72","--wu-blue-divergent-8":"#122254"},nps:{"--wu-nps-detractor":"#F85271","--wu-nps-passive":"#F1DA7E","--wu-nps-promoter":"#42BD84"},sentiment:{"--wu-sentiment-negative":"#F85271","--wu-sentiment-slightly-negative":"#F69A79","--wu-sentiment-neutral":"#F1DA7E","--wu-sentiment-slightly-positive":"#94D08B","--wu-sentiment-positive":"#42BD84","--wu-sentiment-no-sentiment":"#E0E0E0"}},rs=Hr.extendTailwindMerge({prefix:"wu-"});function n(...e){return rs(zr.clsx(e))}const et=e=>{window.open(e,"_blank","toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=800,height=600")};function Be(){return Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15)}function Ee(e){switch(e){case"top":return"wu-flex-col-reverse";case"left":return"wu-flex-row-reverse wu-gap-2";case"right":return"wu-flex-row wu-gap-2";default:return""}}const ss=e=>e?/\S+@questionpro\.com/.test(e):!1,Bt=de.Root,tt=N.forwardRef(({className:e,...a},r)=>t.jsx(de.Item,{ref:r,className:n("wu-border-b",e),...a}));tt.displayName="AccordionItem";const at=N.forwardRef(({className:e,children:a,...r},s)=>t.jsx(de.Header,{className:"wu-flex",children:t.jsxs(de.Trigger,{ref:s,className:n("wu-flex wu-flex-1 wu-text-xs wu-items-center wu-justify-between wu-p-2 wu-transition-all","[&[data-state=open]>.wu-arrow-icon]:wu-rotate-180",e),...r,children:[a,t.jsx("span",{className:"wu-arrow-icon wm-keyboard-arrow-down wu-transition-transform wu-duration-200"})]})}));at.displayName=de.Trigger.displayName;const rt=N.forwardRef(({className:e,children:a,...r},s)=>t.jsx(de.Content,{ref:s,className:"wu-overflow-hidden wu-text-xs wu-px-2 wu-font-light wu-transition-all data-[state=closed]:wu-animate-accordion-up data-[state=open]:wu-animate-accordion-down",...r,children:t.jsx("div",{className:n("wu-pb-4 wu-pt-0",e),children:a})}));rt.displayName=de.Content.displayName;const us=e=>{const{items:a,className:r,dir:s="ltr"}=e;if(e.type==="multiple"){const{defaultValue:u=[],value:o,onValueChange:l}=e;return t.jsx(Bt,{type:"multiple",className:"wu-w-full wu-accordion-container",defaultValue:u,value:o,onValueChange:l,dir:s,children:a.map(({value:w,Summary:i,Details:c,className:f})=>t.jsxs(tt,{value:w,dir:s,className:n(r,f),children:[t.jsx(at,{dir:s,className:"wu-accordion-summary",children:i}),t.jsx(rt,{dir:s,className:"wu-accordion-details",children:c})]},w))})}else{const{defaultValue:u,value:o,onValueChange:l}=e;return t.jsx(Bt,{type:"single",className:"wu-w-full wu-accordion-container",defaultValue:u,value:o,onValueChange:l,dir:s,collapsible:!0,children:a.map(({value:w,Summary:i,Details:c,className:f})=>t.jsxs(tt,{value:w,dir:s,className:n(r,f),children:[t.jsx(at,{dir:s,className:"wu-accordion-summary",children:i}),t.jsx(rt,{dir:s,className:"wu-accordion-details",children:c})]},w))})}},zt=N.forwardRef(({className:e,...a},r)=>t.jsx(ve.Root,{ref:r,className:n("wu-relative wu-flex wu-h-10 wu-w-10 wu-shrink-0 wu-overflow-hidden wu-rounded-full",e),...a}));zt.displayName=ve.Root.displayName;const Ht=N.forwardRef(({className:e,...a},r)=>t.jsx(ve.Image,{ref:r,className:n("wu-aspect-square wu-h-full wu-w-full",e),...a}));Ht.displayName=ve.Image.displayName;const jt=N.forwardRef(({className:e,...a},r)=>t.jsx(ve.Fallback,{ref:r,className:n("wu-flex wu-h-full wu-w-full wu-items-center wu-justify-center wu-rounded-full wu-bg-muted",e),...a}));jt.displayName=ve.Fallback.displayName;function st(e,a){d.useEffect(()=>{const r=s=>{Array.isArray(e)&&e.some(u=>!u.current||u.current.contains(s.target))||!Array.isArray(e)&&(!e.current||e.current.contains(s.target))||a(s)};return document.addEventListener("mousedown",r),document.addEventListener("touchstart",r),()=>{document.removeEventListener("mousedown",r),document.removeEventListener("touchstart",r)}},[e,a])}const ut={dropdownContainer:"_dropdownContainer_vvlo9_1",open:"_open_vvlo9_1",dropdownMenu:"_dropdownMenu_vvlo9_1"},$t=({dir:e,Trigger:a,triggerClassName:r,DropdownContent:s})=>{const[u,o]=d.useState(!1),l=d.useRef(null),w=d.useRef(null);st([l,w],()=>o(!1));const i=()=>{o(!u)};return t.jsx(t.Fragment,{children:t.jsx("div",{className:ut.dropdownContainer,children:t.jsx("ul",{children:t.jsxs("li",{className:n("wu-flex wu-relative",u&&ut.open),children:[t.jsx("button",{className:n("wu-w-8 wu-h-8 wu-rounded-full focus:wu-outline-none focus-visible:wu-ring-2 focus-visible:wu-ring-blue-soft focus-visible:wu-ring-offset-2 focus-visible:wu-ring-offset-gray-switcher",r),onClick:c=>{c.preventDefault(),i()},ref:w,"aria-label":"dropdown-trigger",children:a}),t.jsx("div",{className:n(ut.dropdownMenu,{open:u},e==="rtl"?"wu-left-[-10px] wu-top-[38px]":"wu-right-[-7px] wu-top-[38px]"),dir:e,ref:l,"aria-label":"user-menu",children:s})]})})})})},ot=X.cva("wu-inline-flex wu-items-center wu-justify-center wu-whitespace-nowrap wu-rounded-sm wu-text-sm wu-font-normal wu-outline-offset-2 wu-transition-colors focus-visible:wu-outline-none focus-visible:wu-outline-2 focus-visible:wu-outline-blue-focus focus-visible:wu-outline-offset-2 disabled:wu-cursor-not-allowed wu-leading-4 disabled:wu-bg-black/10 disabled:wu-text-gray-subtle disabled:wu-outline-gray-subtle wu-leading-[1px] wu-transition-colors wu-duration-300",{variants:{size:{md:"wu-p-2 wu-min-w-[104px] wu-h-8 wu-text-sm",sm:"wu-p-1 wu-min-w-[90px] wu-h-6 wu-text-xs",mobile:"wu-p-4 wu-min-w-[104px] wu-h-10 wu-text-base"},color:{primary:"wu-bg-blue-p hover:wu-bg-blue-pHoverDeep wu-text-blue-p wu-outline-1 wu-outline-blue-p hover:wu-text-blue-q hover:wu-outline-blue-pHover",upgrade:"wu-bg-orange-soft hover:wu-bg-orange-deep wu-text-orange-deep hover:wu-text-orange-deep wu-outline-1 wu-outline-orange-soft hover:wu-outline-orange-deep hover:wu-text-maroon-hover",error:"wu-bg-maroon hover:wu-bg-maroon-hover wu-outline-1 wu-outline-red-deep hover:wu-outline-red-deep/80 hover:wu-text-maroon-hover"},variant:{primary:"wu-text-white wu-outline-0 hover:wu-text-white",secondary:"wu-bg-transparent wu-outline-0 hover:wu-bg-gray-20 hover:wu-text-blue-pHoverDeep",outline:"hover:wu-text-white wu-bg-white disabled:wu-bg-transparent hover:wu-outline-blue-pHoverDeep",rounded:"wu-text-white wu-outline-0 wu-rounded-full hover:wu-text-white",link:"hover:wu-underline wu-bg-transparent hover:wu-bg-transparent wu-outline-0 wu-underline-offset-2 wu-min-w-[auto] wu-px-2 disabled:wu-bg-transparent",iconOnly:"wu-rounded wu-p-2 wu-text-xl wu-h-8 wu-w-8 wu-leading-5 wu-text-gray-lead hover:wu-text-blue-q hover:wu-bg-gray-20 wu-outline-0 wu-bg-transparent wu-min-w-[auto] disabled:wu-grayscale disabled:wu-opacity-80 wu-rounded-sm focus-visible:wu-outline-offset-0 focus-visible:wu-bg-gray-20 wu-aspect-square"}},defaultVariants:{variant:"primary",size:"md",color:"primary"},compoundVariants:[]}),Ne=N.forwardRef(({className:e,variant:a,size:r,color:s,asChild:u=!1,...o},l)=>{const w=u?ye.Slot:"button";return t.jsx(w,{className:n(ot({size:r,color:s,variant:a,className:e})),ref:l,...o})});Ne.displayName="Button";const Ce=d.forwardRef((e,a)=>os(e,a)),os=(e,a)=>{const{size:r="md",color:s="#1B87E6",variant:u="dots",...o}=e,l=n("wu-w-[4em] wu-h-[1em] wu-inline-block wu-text-xs wu-relative wu-loader-dot-container");let w="7px";r==="sm"?w="7px":r==="md"?w="12px":r==="lg"?w="18px":typeof r=="string"&&(w=r);const i={backgroundColor:s,width:w,height:w},c=t.jsxs("div",{...o,ref:a,className:n("wu-flex wu-items-center wu-justify-center wu-gap-2 wu-w-fit",e.className),role:"status","aria-busy":"true",children:[t.jsx("div",{className:"wu-w-12 wu-h-12 wu-border-2 wu-rounded-full wu-animate-spin",style:{width:w,height:w,borderTopColor:s}}),e.message&&t.jsx("p",{className:"wu-inline-block wu-loader-message",children:e.message})]}),f=t.jsxs("div",{...o,ref:a,className:n("wu-flex wu-items-center wu-justify-center wu-gap-2 wu-w-fit",e.className),role:"alert","aria-busy":"true",children:[t.jsxs("ul",{className:l,style:{fontSize:w},role:"loader",children:[t.jsx("li",{className:"wu-dot wu-loader-dot",style:i}),t.jsx("li",{className:"wu-dot wu-loader-dot",style:i}),t.jsx("li",{className:"wu-dot wu-loader-dot",style:i}),t.jsx("li",{className:"wu-dot wu-loader-dot",style:i})]}),e.message&&t.jsx("p",{className:"wu-inline-block wu-loader-message",children:e.message})]});return t.jsx(t.Fragment,{children:u==="spinner"?c:f})};Ce.displayName="WuLoader";const V=d.forwardRef(({disabled:e,loading:a,variant:r="primary",size:s="md",Icon:u,iconPosition:o="left",children:l,floating:w,className:i,color:c="primary",selected:f,...p},h)=>{const m={primary:"#1986e688",upgrade:"#f5830088",error:"#ef444488"};return t.jsxs(Ne,{...p,disabled:e,variant:r,size:s,className:n(w&&"wu-shadow-qp","wu-flex wu-items-center wu-justify-center wu-gap-2",o==="right"&&"wu-flex-row-reverse",a?"wu-cursor-not-allowed wu-ring-0":"",f&&"wu-bg-blue-p wu-bg-opacity-15 wu-text-blue-pHoverDeep wu-ring-0",c==="error"&&"hover:wu-text-maroon",i),color:c,style:{backgroundColor:a?m[c]:"",...p.style},ref:h,children:[!a&&u&&t.jsx(t.Fragment,{children:u}),a&&t.jsx(Ce,{color:"#fff",size:"sm"}),!a&&l]})});V.displayName="WuButton";const ls=({onLogout:e,DataCenter:a})=>t.jsxs("section",{className:"wu-flex wu-justify-between wu-px-4 wu-py-4 wu-text-white wu-bg-gray-lead",children:[t.jsx("div",{className:"wu-flex-1 wu-flex wu-items-start",children:a}),t.jsx(V,{variant:"outline",size:"sm",Icon:t.jsx("span",{className:"wm-logout"}),className:"wu-text-white wu-bg-transparent wu-ring-white hover:wu-bg-gray-10 hover:wu-text-gray-lead hover:wu-ring-gray-lead",onClick:e,"aria-label":"logout",children:"LOGOUT"})]}),ns=({user:e,dir:a})=>{const r=[e!=null&&e.usage&&Object.keys(e.usage).length>0?{title:e.usage.title,url:e.usage.url,icon:"wm-bar-chart wu-text-base",node:t.jsxs("div",{className:"wu-flex wu-flex-col wu-items-center wu-w-20",children:[t.jsx("code",{className:"wu-font-medium",children:e.usage.collectedResponseCount||"0"}),t.jsx("span",{className:"wu-text-xs wu-font-normal",children:"Responses"})]})}:null,e!=null&&e.invoice&&Object.keys(e.invoice).length>0?{title:e.invoice.title,url:e.invoice.url,icon:"wm-attach-money wu-text-base wu-font-semibold",node:t.jsx("div",{className:"wu-flex wu-justify-center wu-items-center wu-w-20",children:t.jsx("code",{children:e.invoice.size})})}:null].filter(Boolean);return t.jsxs(t.Fragment,{children:[t.jsx("ul",{children:r.map(({title:s,url:u,icon:o,node:l},w)=>t.jsx("li",{className:w<r.length-1?"wu-border-b wu-border-gray-subtle":"",children:t.jsxs("a",{href:u,className:n("wu-flex items-center wu-justify-between wu-py-2 hover:wu-bg-gray-20 focus-within:wu-bg-gray-20 focus:wu-outline-none",a==="rtl"?"wu-pl-4":"wu-pr-4"),children:[t.jsxs("div",{className:"wu-flex wu-items-center wu-gap-2",children:[t.jsx("span",{className:n(o,"wu-w-12 wu-text-center")}),t.jsx("span",{children:s})]}),l]})},w))}),t.jsx("hr",{className:"wu-border-gray-subtle"})]})},ws=({settings:e,dir:a})=>t.jsxs(t.Fragment,{children:[t.jsx("hr",{className:"wu-border-gray-subtle"}),t.jsxs("section",{className:"wu-relative wu-flex wu-items-center wu-justify-start wu-gap-2",children:[t.jsx("span",{className:n("wu-absolute wm-settings wu-text-base",a==="rtl"?"wu-right-4":"wu-left-4")}),t.jsx("ul",{className:"wu-w-full",dir:a,children:e==null?void 0:e.map(r=>t.jsx("li",{tabIndex:-1,dir:a,children:t.jsx("a",{href:r.url,className:n("wu-inline-block wu-w-full wu-py-2 hover:wu-bg-gray-20 focus-within:wu-bg-gray-20 focus:wu-outline-none",a==="rtl"?"wu-pr-14 wu-text-right":"wu-pl-14"),children:r.title})},r.title))})]}),t.jsx("hr",{className:"wu-border-gray-subtle"})]}),is=({user:e,dir:a})=>{var r,s,u,o,l,w,i,c,f;return t.jsxs("section",{className:n("wu-flex wu-gap-2 wu-p-4 wu-w-full",a==="rtl"?"wu-pr-0":"wu-pl-0"),children:[t.jsx("div",{className:"wu-flex wu-items-center wu-justify-center wu-w-12",children:t.jsx("span",{className:"wu-text-base wm-person"})}),t.jsxs("div",{className:n("wu-flex wu-flex-col wu-gap-1",a==="rtl"&&"wu-text-right"),children:[t.jsx("p",{children:(r=e==null?void 0:e.profile)==null?void 0:r.title}),t.jsxs("a",{href:(s=e==null?void 0:e.license)==null?void 0:s.url,className:"hover:wu-text-blue-p wu-group/license focus:wu-outline-none focus:wu-text-blue-p",dir:a,children:[t.jsx("p",{children:(u=e==null?void 0:e.profile)==null?void 0:u.subtitle}),t.jsx("p",{className:"wu-font-light",children:(o=e==null?void 0:e.profile)==null?void 0:o.companyName})]}),(e==null?void 0:e.license)&&Object.keys(e.license).length>0&&t.jsxs("div",{className:"wu-flex wu-items-center wu-justify-between wu-gap-6 wu-mt-3",dir:a,children:[t.jsx("a",{href:(l=e==null?void 0:e.license)==null?void 0:l.url,className:"hover:wu-text-blue-p wu-group/license focus:wu-outline-none focus:wu-text-blue-p",children:t.jsxs("div",{className:"wu-flex wu-flex-col wu-items-start wu-gap-1",children:[t.jsx("p",{className:"wu-font-normal",children:(w=e==null?void 0:e.license)==null?void 0:w.subtitle}),t.jsx("button",{tabIndex:-1,className:"wu-px-3 wu-py-1 wu-border wu-rounded-sm wu-border-gray-subtle group-hover/license:wu-border-blue-p",children:(i=e==null?void 0:e.license)==null?void 0:i.title})]})}),t.jsxs("div",{className:"wu-flex wu-flex-col wu-items-start wu-gap-1",dir:a,children:[t.jsx("p",{className:"wu-font-normal",children:(c=e==null?void 0:e.license)==null?void 0:c.expiryDatePostFixString}),t.jsx("p",{children:(f=e==null?void 0:e.license)==null?void 0:f.expiryDate})]})]})]})]})},Ut=({user:e,onLogout:a,dir:r,DataCenter:s})=>{var u,o;return e?t.jsx($t,{Trigger:t.jsxs(zt,{className:n("wu-group wu-border wu-border-white wu-text-sm wu-font-medium wu-bg-transparent wu-w-8 wu-h-8 wu-ring-white wu-leading-[33px] wu-text-white wu-transition-colors hover:wu-bg-white hover:wu-text-gray-switcher wu-header-user-avatar"),children:[t.jsx(Ht,{className:"hover:wu-opacity-80",src:(u=e==null?void 0:e.profile)==null?void 0:u.profilePicture,alt:"User"}),t.jsx(jt,{children:(o=e==null?void 0:e.profile)==null?void 0:o.initials})]}),dir:r,triggerClassName:"wu-rounded-full focus:wu-outline-none focus-visible:wu-ring-2 focus-visible:wu-ring-blue-soft focus-visible:wu-ring-offset-2 focus-visible:wu-ring-offset-gray-switcher wu-w-8 wu-h-8 wu-app-user-button",DropdownContent:t.jsxs("div",{className:n("wu-p-0 wu-text-xs wu-font-medium wu-border wu-rounded-none wu-min-w-72 wu-w-max wu-max-w-96 wu-border-gray-subtle wu-text-gray-lead wu-overflow-hidden wu-bg-white"),dir:r,children:[t.jsx(is,{user:e,dir:r}),(e==null?void 0:e.settings)&&e.settings.length>0&&t.jsx(ws,{settings:e.settings,dir:r}),t.jsx(ns,{user:e,dir:r}),t.jsx(ls,{onLogout:a,DataCenter:s})]})}):null},Gt=({menuList:e,dir:a})=>{const r=[{icon:"wm-info",title:"Help Center",subTitle:"Knowledge Base",link:"https://www.questionpro.com/help/"},{icon:"wm-calendar-month",title:"Free Online Training",subTitle:"Webinar",link:"https://www.questionpro.com/training"},{icon:"wm-local-fire-department",title:"Updates",subTitle:"What's new!",link:"https://www.questionpro.com/updates/"},{icon:"wm-chat",title:"Live Chat",subTitle:"Support",link:"https://www.questionpro.com/a/liveperson.do?mode=launch&pageMode=quickChat",target:"window"}];return t.jsx($t,{dir:a,Trigger:t.jsx("span",{className:"wm-question-mark wu-text-base"}),triggerClassName:"wu-w-8 wu-h-8 wu-flex wu-items-center wu-justify-center wu-rounded-full wu-border wu-border-white focus:wu-outline-none focus-visible:wu-ring-2 focus-visible:wu-ring-blue-soft focus-visible:wu-ring-offset-2 focus-visible:wu-ring-offset-gray-switcher wu-text-white wu-transition-colors hover:wu-bg-white hover:wu-text-gray-switcher wu-app-header-help",DropdownContent:t.jsx("ul",{children:(e||r).map((s,u)=>t.jsx("li",{className:"wu-p-0 wu-w-[191px] hover:wu-bg-[#ededed]",dir:a,children:s.target==="window"?t.jsx("a",{tabIndex:0,rel:"noopener noreferrer",onClick:()=>et(s.link),onKeyDown:o=>{o.key==="Enter"&&et(s.link)},className:"wu-block wu-w-full wu-h-full wu-px-4 wu-py-2 hover:wu-bg-gray-20 focus-visible:wu-border-none focus-visible:wu-bg-gray-20 focus-visible:wu-ring-0 focus-visible:wu-outline-none focus-visible:wu-ring-offset-0 wu-cursor-pointer",children:t.jsx(Vt,{item:s,dir:a})}):t.jsx("a",{href:s.link,target:"_blank",className:"wu-block wu-w-full wu-h-full wu-px-4 wu-py-2 hover:wu-bg-gray-20 focus-visible:wu-border-none focus-visible:wu-bg-gray-20 focus-visible:wu-ring-0 focus-visible:wu-outline-none focus-visible:wu-ring-offset-0",rel:"noreferrer",children:t.jsx(Vt,{item:s,dir:a})})},u))})})},Vt=({item:e,dir:a})=>t.jsxs("div",{className:"wu-flex wu-items-start wu-gap-3",children:[t.jsx("span",{className:`${e.icon} wu-text-xl wu-text-gray-subtle`}),t.jsxs("div",{className:n("wu-flex wu-flex-col wu-gap-[2px]",a==="rtl"&&"wu-text-right"),children:[t.jsx("span",{className:"wu-text-xs wu-text-gray-subtle",children:e.subTitle}),t.jsx("p",{className:"wu-text-sm wu-text-blue-q",children:e.title})]})]}),ds=e=>{const[a,r]=d.useState(()=>window.innerWidth<=e);return d.useEffect(()=>{const s=()=>{r(window.innerWidth<=e)};return window.addEventListener("resize",s),()=>{window.removeEventListener("resize",s)}},[e]),a};function cs({productCategories:e,openCategory:a,setOpenCategory:r}){const s=(w,i)=>{const c=i[w];if(c){c.focus();const f=e[w]||null;r(f)}},u=(w,i,c,f)=>{w.preventDefault();const p=c==="down"?i+1:i-1;s(p,f)},o=(w,i,c,f)=>{a!=null&&a.products&&a.products[a.products.length-1].name===f&&(w.preventDefault(),s(i+1,c))},l=(w,i)=>{w.preventDefault();const c=e[i]===a?null:e[i];r(c)};return function(i,c,f){const p=document.querySelectorAll("[data-product-category]"),{key:h}=i;switch(h){case"ArrowDown":u(i,c,"down",p);break;case"ArrowUp":u(i,c,"up",p);break;case"Tab":o(i,c,p,f);break;case"Enter":case" ":l(i,c);break}}}const fs=e=>{const{size:a="lg",className:r,children:s,...u}=e,o={sm:"wu-text-body-3",md:"wu-text-body-2",lg:"wu-text-body-1"},l=e.as||"div";return t.jsx(l,{...u,className:n(o[a],r),children:s})},ps=e=>{const{size:a="xl",className:r,children:s,...u}=e,o={sm:"h4",md:"h3",lg:"h2",xl:"h1"},l={sm:"wu-text-heading-4",md:"wu-text-heading-3",lg:"wu-text-heading-2",xl:"wu-text-heading-1"},w=o[a];return t.jsx(w,{...u,className:n(l[a],r),children:s})},bs=e=>{const{size:a="lg",className:r,children:s,...u}=e,o={sm:"wu-text-sub-3",md:"wu-text-sub-2",lg:"wu-text-sub-1"},l=e.as||"div";return t.jsx(l,{...u,className:n(o[a],r),children:s})},hs=e=>{const{size:a="lg",className:r,children:s,...u}=e,o={md:"wu-text-display-2",lg:"wu-text-display-1"},l=e.as||"h1";return t.jsx(l,{...u,className:n(o[a],r),children:s})},le=e=>{const{icon:a,className:r,...s}=e;return t.jsx("span",{...s,className:n(a,r),role:"presentation","aria-label":a})},gs=({buttonRef:e,handleDropdownToggle:a,handleKeyDown:r,isDropdownOpen:s,activeProductName:u,dir:o="ltr",homeLink:l="/"})=>t.jsxs("button",{ref:e,type:"button",className:n("wu-text-base wu-font-normal wu-flex wu-items-center wu-justify-between wu-px-2 wu-gap-2 wu-w-full focus:wu-outline-none focus-visible:wu-bg-white/10 wu-switcher-trigger"),onClick:a,onKeyDown:w=>{s&&w.key==="ArrowDown"&&r(w,-1)},"aria-label":"product-switcher",children:[t.jsx("a",{className:"wu-pl-2 wu-pr-0 wu-aspect-auto focus:wu-outline-none focus-visible:wu-bg-white/10 wu-switcher-logo",tabIndex:-1,href:l,children:t.jsx(le,{icon:"wc-logo",className:"wu-text-xl wu-leading-4 wu-relative wu-top-1"})}),u,t.jsx("span",{className:n("wm-arrow-drop-down wu-text-2xl wu-transition-transform wu-duration-300",s&&"wu-rotate-180",o==="rtl"?"wu-mr-auto":"wu-ml-auto")})]}),F={productDropdownMenu:"_productDropdownMenu_amyba_1",productDropdownMenuOpen:"_productDropdownMenuOpen_amyba_38",rtlDropdownMenu:"_rtlDropdownMenu_amyba_51",productCategory:"_productCategory_amyba_55",open:"_open_amyba_61",productCategoryBorderTop:"_productCategoryBorderTop_amyba_66",productList:"_productList_amyba_93",rtlProductList:"_rtlProductList_amyba_114",productListItem:"_productListItem_amyba_137",productLink:"_productLink_amyba_162",activeProduct:"_activeProduct_amyba_164",topBorder:"_topBorder_amyba_169",topBorderRtl:"_topBorderRtl_amyba_190"},ms=({category:e,dir:a="ltr",openCategory:r})=>{const s=e.active?"#c5cce0":"#f0c36a",u=(r==null?void 0:r.name)===e.name,o=n("wm-arrow-forward-ios wu-text-xs wu-tracking-widest wu-text-muted-foreground wu-mr-2.5 group-hover:wu-hidden wu-text-blue-q",a==="rtl"&&"wu-rotate-180 wu-ml-2.5 wu-text-blue-q group-hover:wu-hidden",u&&"wu-hidden","wu-relative wu-top-[5px]"),l=n("wm-lock wu-text-orange-soft wu-text-base wu-mr-2.5 group-hover:wu-hidden",a==="rtl"&&"wu-ml-2.5 group-hover:wu-hidden",u&&"wu-hidden","wu-relative wu-top-1");return t.jsxs("div",{className:n("group focus:wu-outline-none focus-visible:wu-outline-none wu-flex wu-items-center wu-w-full wu-bg-white wu-relative wu-justify-between"),dir:a,children:[t.jsx("div",{className:F.productCategoryBorderTop,style:{backgroundColor:s}}),t.jsxs("div",{className:"wu-flex wu-items-center wu-px-1 wu-relative wu-top-1",children:[t.jsx("div",{className:"wu-w-[56px] wu-h-[56px] wu-flex wu-items-center wu-justify-center",children:t.jsx("img",{src:e.logo,alt:e.name,width:"32px",height:"32px"})}),t.jsx("span",{className:"wu-text-sm wu-leading-5 wu-text-blue-q wu-relative wu-top-[1px]",children:e.name})]}),e.active?t.jsx("span",{className:o}):t.jsx("span",{className:l})]})},xs={e309:"wp-audience",e381:"wp-bi",e329:"wp-closed-loop",e314:"wp-communities",e313:"wp-cx",e352:"wp-digsite",e324:"wp-empower",e317:"wp-insightshub",e380:"wp-instant-answers",e378:"wp-intercept",e311:"wp-livepolls",e316:"wp-reputation",e379:"wp-suite-cx",e382:"wp-suite-cx",e308:"wp-surveys",e315:"wp-workforce"},ys=({product:e,currentProduct:a,activeProductName:r,dir:s,focusItem:u,setFocusItem:o})=>{const[l,w]=d.useState(e.name===a),i=e.name===r,c=e.name===a,f=!e.active,p="#1b3380",h="#c5cce0",m="#ffcf70",g=n("wu-font-normal wu-text-xs wu-text-gray-lead wu-text-center",c&&"wu-text-blue-q wu-font-normal",!e.active&&"wu-text-gray-subtle",l&&"wu-font-normal",e.active&&l&&"wu-text-blue-q"),b=n("wu-text-blue-p wu-text-base",c&&"wu-text-blue-q",!e.active&&"wu-text-gray-subtle",e.active&&l&&"wu-text-blue-q"),v=l||u===e.name||i?p:h;return t.jsxs("li",{className:n(F.productListItem,"focus-visible:wu-outline-none focus:wu-outline-none wu-sub-product-list-item",(i||l)&&F.activeProduct,e.name.length>15&&window.innerWidth>768&&"wu-w-[130px] wu-min-w-[130px]",u===e.name&&F.activeProduct,"wu-product-item"),onMouseOver:()=>w(!0),onMouseOut:()=>w(!1),"aria-label":e.name,"aria-disabled":f,dir:s,onKeyDown:S=>{if(S.key==="Enter"){S.preventDefault();const y=S.currentTarget.querySelector("a");y&&y.click()}},onFocus:()=>{o(e.name)},onBlur:()=>o(""),children:[t.jsx("div",{className:n(F.topBorder,s==="rtl"&&F.topBorderRtl),style:{backgroundColor:f?m:v}}),t.jsxs("a",{className:n(F.productLink,"focus:wu-outline-none focus-visible:wu-outline-none"),href:e.link||"#",tabIndex:0,children:[t.jsx("span",{className:n(b,xs[e.icon||""]),"aria-hidden":!0}),t.jsx("span",{className:n(g),children:e.name})]})]},e.name)},vs=({category:e,currentProduct:a,activeProductName:r,dir:s="ltr",focusItem:u,setFocusItem:o,borderColorLocked:l="#f5a300"})=>{const{products:w=[],active:i}=e,c=d.useMemo(()=>w.filter(g=>g.active).sort((g,b)=>(g.order||100)-(b.order||100)),[w]),f=d.useMemo(()=>w.filter(g=>!g.active),[w]),[p,h]=d.useState(l),m=g=>g.map((b,v)=>t.jsx(ys,{product:b,currentProduct:a,activeProductName:r,dir:s,focusItem:u,setFocusItem:o},v));return i?t.jsxs(t.Fragment,{children:[m(c),f.length>0&&t.jsxs("li",{className:n(F.productListItem,"focus:wu-outline-none focus-visible:wu-outline-none !wu-bg-[#f5f5f5] hover:!wu-bg-[#eeeeee] wu-group"),onMouseOver:()=>h("#f5a300"),onMouseOut:()=>h(l),"aria-label":"Upgrade to unlock",children:[t.jsx("div",{className:n(F.topBorder,s==="rtl"&&F.topBorderRtl),style:{backgroundColor:p},"aria-label":"top-border"}),t.jsxs("a",{href:"https://www.questionpro.com/a/showUpgradeUser.do",className:n(F.productLink,"wu-flex wu-flex-col wu-items-center wu-justify-center wu-py-2 wu-min-w-[88px]"),children:[t.jsx("span",{className:"wu-text-base wu-transition-colors wm-lock !wu-text-orange-soft group-hover:wu-text-orange-deep"}),t.jsxs("span",{className:"wu-text-[10px] wu-leading-[10px] wu-text-center wu-pt-1 !wu-text-orange-deep",children:["Upgrade to ",t.jsx("br",{})," unlock"]})]})]}),m(f)]}):t.jsxs("li",{className:n(F.productListItem,F.learnMore,"focus:wu-outline-none focus-visible:wu-outline-none wu-product-item-inactive !wu-bg-[#f5f5f5] hover:!wu-bg-[#eeeeee]",u==="learn"&&"activeProduct"),tabIndex:0,onFocus:()=>o("learn"),onBlur:()=>o(""),"aria-label":"Learn More",children:[t.jsx("div",{className:n(F.topBorder,s==="rtl"&&F.topBorderRtl),style:{backgroundColor:l}}),t.jsx("a",{className:F.productLink,href:"https://www.questionpro.com/a/showUpgradeUser.do",tabIndex:-1,children:t.jsx("span",{className:"wu-text-[#f99e03]",children:"Learn More"})})]})},Yt=({dropdownRef:e,dir:a,isDropdownOpen:r,productCategories:s,openCategory:u,setOpenCategory:o,handleKeyDown:l,expandAll:w,activeProductName:i,focusItem:c,setFocusItem:f})=>{const p="#ffcf70",[h,m]=d.useState(window.innerWidth>768);return d.useEffect(()=>{const g=()=>{m(window.innerWidth>375)};return window.addEventListener("resize",g),()=>window.removeEventListener("resize",g)},[]),t.jsx("ul",{className:n(F.productDropdownMenu,r&&F.productDropdownMenuOpen,a==="rtl"&&F.rtlDropdownMenu,"wu-switcher-container"),ref:e,dir:a,"aria-label":"product-dropdown-menu","data-state":r?"open":"closed",children:s.map((g,b)=>t.jsxs("li",{className:n(F.productCategory,"focus:wu-outline-none focus-visible:wu-outline-none wu-h-16 wu-category-item",u===g&&F.open,w&&F.open),onMouseEnter:()=>h&&o(g),onMouseLeave:()=>h&&o(null),"aria-label":g.name,dir:a,onKeyDown:v=>l(v,b),tabIndex:0,"data-product-category":!0,children:[t.jsx(ms,{category:g,dir:a,openCategory:u}),t.jsx("ul",{className:n(F.productList,a==="rtl"&&F.rtlProductList),dir:a,children:t.jsx(vs,{category:g,dir:a,activeProductName:i,currentProduct:g.name,focusItem:c,setFocusItem:f,borderColorLocked:p})})]},g.name))})},Ns=({isProductButtonShow:e,isDropdownOpen:a,activeProductColor:r,activeProductBgColor:s,activeProductName:u,dir:o,smallScreenButtonRef:l,handleDropdownToggle:w,handleKeyDown:i})=>t.jsx("div",{className:n("wu-absolute wu-top-11 wu-transition-all wu-duration-300 wu-ease-in-out wu-transform wu-opacity-100 wu-w-[256px] wu-z-10",e?o==="rtl"?"wu-right-0 wu-overflow-hidden":"wu-translate-x-0 wu-left-0":o==="rtl"?"wu-right-0 wu-w-0":"wu--translate-x-full"),style:{backgroundColor:a?r.hover:s},children:t.jsxs("button",{ref:l,type:"button",className:n("wu-text-base wu-leading-[48px] wu-flex wu-items-center wu-justify-center wu-px-2 wu-gap-2 wu-w-full focus:wu-outline-none focus-visible:wu-bg-white/10 wu-switcher-trigger",e?"wu-flex":o==="rtl"?"wu-hidden":"wu-flex"),onClick:w,onKeyDown:c=>{a&&c.key==="ArrowDown"&&i(c,-1)},"aria-label":"small-screen-product-btn",children:[u,t.jsx("span",{className:n("wm-arrow-drop-down wu-text-2xl wu-transition-transform wu-duration-300",a&&"wu-rotate-180")})]})}),Cs=({dir:e,isProductButtonShow:a,smallScreenToggleButtonRef:r,setIsProductButtonShow:s,setDropdownOpen:u})=>{const o=()=>{s(l=>!l),a&&u(!1)};return t.jsxs("button",{className:n("wu-relative wu-w-10 wu-h-10 wu-flex wu-flex-col wu-justify-center wu-items-center",e==="rtl"?"wu-mr-4":"wu-ml-4"),onClick:o,ref:r,"aria-label":"menu-toggle-btn",children:[t.jsx("span",{className:`wu-absolute wu-w-6 wu-h-[3px] wu-bg-white wu-transition-transform wu-duration-300 ${a?"wu-rotate-45 wu-translate-y-0":"-wu-translate-y-2.5"}`}),t.jsx("span",{className:`wu-absolute wu-w-6 wu-h-[3px] wu-bg-white wu-transition-opacity wu-duration-300 ${a?"wu-opacity-0":"wu-opacity-100"}`}),t.jsx("span",{className:`wu-absolute wu-w-6 wu-h-[3px] wu-bg-white wu-transition-transform wu-duration-300 ${a?"-wu-rotate-45 wu-translate-y-0":"wu-translate-y-2.5"}`})]})},Jt=({productCategories:e,activeProductName:a,activeProductColor:r={base:"#1b87e6",hover:"#54A5EC"},dir:s,homeLink:u,expandAll:o})=>{const l=d.useRef(null),w=d.useRef(null),i=d.useRef(null),c=d.useRef(null),[f,p]=d.useState(!1),[h,m]=d.useState(null),[g,b]=d.useState(r.base),[v,S]=d.useState(""),[y,C]=d.useState(!1),D=ds(768);st([w,l],()=>{p(!1),m(null)}),st([i,c,w],()=>{C(!1),p(!1),m(null)}),d.useEffect(()=>{const W=T=>{T.key==="Escape"&&p(!1)};return document.addEventListener("keydown",W),()=>{document.removeEventListener("keydown",W)}},[f]),d.useEffect(()=>b(r.base),[r.base]);const k=W=>{W.preventDefault(),W.stopPropagation(),p(T=>{const M=!T;return M||m(null),M})},I=(W,T)=>{cs({productCategories:e,openCategory:h,setOpenCategory:m})(W,T,v)};return t.jsx("div",{className:n("wu-inline-flex wu-items-center wu-justify-between wu-relative wu-z-auto wu-h-12 wu-text-white"),children:D?t.jsxs("div",{className:"wu-relative wu-flex",children:[t.jsx(Cs,{dir:s,isProductButtonShow:y,smallScreenToggleButtonRef:c,setDropdownOpen:p,setIsProductButtonShow:C}),t.jsx(Ns,{isProductButtonShow:y,isDropdownOpen:f,activeProductColor:r,activeProductBgColor:g,activeProductName:a,handleDropdownToggle:k,smallScreenButtonRef:i,handleKeyDown:I,dir:s}),t.jsx("div",{className:n("wu-absolute wu-top-[92px] wu-left-0 wu-text-[18px]",s==="rtl"&&"wu-right-[256px] wu-left-auto"),children:t.jsx(Yt,{activeProductName:a,focusItem:v,setFocusItem:S,handleKeyDown:I,isDropdownOpen:f,openCategory:h,productCategories:e,setOpenCategory:m,dropdownRef:w,expandAll:o,dir:s})})]}):t.jsxs("div",{className:"wu-relative wu-flex wu-items-center wu-justify-start wu-h-full wu-w-[256px]",dir:s,style:{backgroundColor:f?r.hover:g},onMouseOver:()=>b(r.hover),onMouseOut:()=>b(r.base),children:[t.jsx(gs,{activeProductName:a,dir:s,homeLink:u,buttonRef:l,handleDropdownToggle:k,handleKeyDown:I,isDropdownOpen:f}),t.jsx(Yt,{activeProductName:a,focusItem:v,setFocusItem:S,handleKeyDown:I,isDropdownOpen:f,openCategory:h,productCategories:e,setOpenCategory:m,dropdownRef:w,expandAll:o,dir:s})]})})},Kt=({children:e,dir:a,className:r})=>t.jsx("section",{className:n("wu-flex wu-items-center wu-flex-1 wu-min-w-0 wu-h-12 wu-gap-2 wu-px-2",a==="rtl"&&"wu-flex-row-reverse",r),children:t.jsx("div",{className:"wu-grow",children:e})}),ze=N.forwardRef(({className:e,type:a,...r},s)=>t.jsx("input",{type:a,className:n("wu-flex wu-h-8 wu-w-full wu-border-b wu-border-gray-subtle wu-bg-gray-10 wu-p-2 wu-text-sm wu-font-normal wu-text-gray-lead","file:wu-border-0 file:wu-bg-gray-40 file:wu-text-gray-notification file:wu-text-sm file:wu-font-normal file:wu-relative file:wu-bottom-[3px]","wu-placeholder:wu-text-gray-subtle wu-placeholder:wu-font-light","disabled:wu-cursor-not-allowed disabled:wu-bg-gray-20 disabled:wu-border-gray-40 disabled:wu-text-gray-subtle","read-only:wu-cursor-not-allowed read-only:wu-bg-gray-20 read-only:wu-border-gray-40 read-only:wu-text-gray-subtle","focus:wu-border-blue-p focus-visible:wu-outline-none wu-transition-colors hover:wu-border-gray-40",e),ref:s,...r}));ze.displayName="Input";const Ss=e=>{const{message:a,className:r,...s}=e;return t.jsx("p",{...s,className:n("wu-text-sub-3 wu-break-words wu-font-light",r),style:{color:"rgb(var(--wu-red-deep))",...s.style},children:a})},ks=e=>{var w,i;const{inputRef:a,maxLength:r=50,className:s,...u}=e,[o,l]=d.useState(!1);return d.useEffect(()=>{var c;(((c=a==null?void 0:a.current)==null?void 0:c.value.length)||0)>.75*r?l(!0):l(!1)},[(w=a==null?void 0:a.current)==null?void 0:w.value,r]),t.jsx("p",{...u,className:n("wu-text-sub-3 wu-font-light",s),style:{color:"rgb(var(--wu-gray-subtle))",...u.style},children:o&&`${(i=a==null?void 0:a.current)==null?void 0:i.value.length}/${r}`})},Ts=X.cva("wu-text-xs wu-font-normal wu-leading-none peer-disabled:wu-cursor-not-allowed peer-disabled:wu-text-gray-subtle peer-readonly:wu-text-gray-subtle peer-required:after:wu-content-['*'] peer-required:after:wu-ml-[2px] peer-required:after:wu-text-red-deep peer-aria-[required]:after:wu-content-['*'] peer-aria-[required]:after:wu-ml-[2px] peer-aria-[required]:after:wu-text-red-deep"),_e=N.forwardRef(({className:e,...a},r)=>t.jsx(Lt.Root,{ref:r,className:n(Ts(),e),...a}));_e.displayName=Lt.Root.displayName;const Q=e=>t.jsx(_e,{...e,className:n("wu-text-gray-lead wu-leading-6",e.className)}),Ds=({Label:e,Error:a,Hint:r,Input:s,labelPosition:u="top",dir:o="ltr",className:l,...w})=>{const c=n("wu-flex",u==="top"?"wu-flex-col wu-gap-1":"wu-flex-row wu-items-center wu-gap-2",l),f=n("wu-flex wu-flex-col wu-gap-1 wu-relative wu-flex-1 wu-form-group-wrapper"),p=n("wu-absolute -wu-bottom-5",o==="ltr"?"wu-right-0":"wu-left-0","wu-form-group-hint"),h=n("wu-absolute -wu-bottom-5",o==="ltr"?"wu-left-0":"wu-right-0","wu-form-group-error");return t.jsxs("div",{className:c,dir:o,...w,children:[e,t.jsxs("div",{className:f,children:[s,r&&t.jsx("div",{className:p,children:r}),a&&t.jsx("div",{className:h,children:a})]})]})},pe=d.forwardRef((e,a)=>{const{Label:r,labelPosition:s="top",Icon:u,iconPosition:o,type:l,value:w,variant:i="flat",readonly:c,id:f=Be(),...p}=e,h=Ee(s),m=u?o!=="right"?"wu-pl-8":"wu-pr-8":"",[g,b]=d.useState(!1),v=()=>{b(y=>!y)},S=y=>{p.onChange&&p.onChange(y)};return t.jsx(t.Fragment,{children:l==="submit"?t.jsx(V,{type:"submit",className:p.className,id:f,children:r||"Submit"}):t.jsx("div",{className:n("wu-flex wu-flex-col wu-gap-2 wu-input-container"),dir:p.dir,children:t.jsxs("div",{className:n("wu-flex wu-gap-1 wu-relative wu-w-fit",h,(s==="right"||s==="left")&&"wu-items-center","wu-input-wrapper"),children:[u&&o!=="right"&&t.jsx("div",{className:"wu-absolute wu-flex wu-items-center wu-justify-center wu-w-8 wu-h-8 wu-input-icon-container",children:u}),t.jsx(ze,{...p,className:n("wu-peer wu-text-xs wu-rounded-t-sm",i==="outlined"?"wu-border wu-border-gray-subtle":"",m,p.className),type:g?"text":l,ref:a,readOnly:c,onChange:p.onChange&&S,value:w,id:f}),u&&o==="right"&&t.jsx("div",{className:"wu-absolute wu-right-0 wu-flex wu-items-center wu-justify-center wu-w-8 wu-h-8 wu-input-icon-container",children:u}),l==="password"&&t.jsx("div",{className:"wu-absolute wu-right-0 wu-flex wu-items-center wu-justify-center wu-w-8 wu-h-8 wu-cursor-pointer",onClick:v,children:t.jsx("button",{type:"button",className:"wu-flex wu-items-center wu-justify-center wu-w-6 wu-h-6 wu-rounded-sm focus:wu-outline-none focus-visible:wu-ring-2 focus-visible:wu-ring-blue-soft","aria-label":"show-password",children:g?t.jsx("span",{className:"wm-visibility wu-text-gray-subtle"}):t.jsx("span",{className:"wm-visibility-off wu-text-gray-subtle"})})}),r&&t.jsx(Q,{htmlFor:f,className:"wu-input-label",children:r})]})})})});pe.displayName="WuInput";const Ms=({className:e,placeholder:a="Search surveys, folders or tools",defaultCollapsed:r=!0,onSearch:s,...u})=>{const[o,l]=d.useState(r);return d.useEffect(()=>{l(r)},[r]),t.jsx(pe,{...u,placeholder:a,onChange:w=>s(w.target.value),className:n("wu-rounded-full focus-visible:wu-outline-2 focus-visible:wu-outline-blue-focus -wu-outline-offset-2 wu-bg-white","wu-transition-all wu-duration-300 wu-ease-in-out",o?"wu-w-8 wu-px-2 wu-text-lg wu-rounded-full wu-h-8 wu-border wu-border-white wu-bg-transparent":"wu-w-40 sm:wu-w-60",e),type:"search",Icon:t.jsx(le,{"data-testid":"search-icon",icon:"wm-search",className:n("wu-text-gray-lead wu-cursor-pointer",o&&"wu-text-white"),onClick:()=>l(w=>!w)})})},Xt=Me.Provider,Qt=Me.Root,Zt=Me.Trigger,lt=N.forwardRef(({className:e,sideOffset:a=4,...r},s)=>t.jsx(Me.Content,{ref:s,sideOffset:a,className:n("wu-z-50 wu-overflow-hidden wu-bg-gray-notification wu-text-white wu-px-3 wu-py-1.5 wu-text-sm wu-shadow-md",e),...r}));lt.displayName=Me.Content.displayName;const He=d.forwardRef(({content:e,position:a,positionOffset:r,duration:s,children:u,className:o,showArrow:l=!1,...w},i)=>t.jsx(Xt,{delayDuration:s||200,children:t.jsxs(Qt,{children:[t.jsx(Zt,{asChild:!0,children:t.jsx("span",{ref:i,children:u})}),t.jsx(Qe.Portal,{children:e&&t.jsxs(lt,{...w,side:a||"top",sideOffset:r||0,className:n("wu-max-w-sm wu-max-h-96 wu-overflow-y-auto",o),children:[e,l&&t.jsx(Qe.Arrow,{className:"wu-fill-gray-notification wu-tooltip-arrow"})]})})]})}));He.displayName="WuTooltip";const Is=({label:e,className:a})=>{const r=d.useRef(null),[s,u]=d.useState(!1);return d.useEffect(()=>{const o=r.current;if(o){const l=o.clientWidth,w=o.scrollWidth,i=w/e.length,c=e.length*i;u(c>l||w>l)}},[e]),t.jsx("p",{ref:r,className:n("wu-w-full wu-truncate",a),children:s?t.jsx(He,{content:e,positionOffset:8,children:e}):e})},Ws=e=>{var p;const{productName:a,categories:r=[],user:s,children:u,onLogout:o,homeLink:l=window.location.origin,brandColor:w,dir:i="ltr",expandAll:c,DataCenter:f}=e;return t.jsx("div",{className:"wu-sticky wu-top-0 wu-z-50 wu-w-full",children:t.jsxs("header",{className:n("wu-h-12 wu-flex wu-items-center wu-justify-between wu-relative wu-bg-blue-switcher wu-text-white",i==="rtl"&&"wu-flex-row-reverse",e.className),style:e.style,children:[ss((p=s==null?void 0:s.profile)==null?void 0:p.subtitle)&&window.wickUiVersion&&t.jsxs("p",{className:"wu-text-[10px] wu-text-gray-subtle wu-font-normal wu-absolute wu-top-11 wu-right-1 wu-z-[-1] wu-invisible","aria-label":"wickUiVersion",children:["Wick UI: v",window.wickUiVersion]}),t.jsx("section",{className:"wu-flex wu-items-center wu-gap-2 wu-shrink-0",children:t.jsx(Jt,{productCategories:r,activeProductName:a,activeProductColor:w,dir:i,homeLink:l,expandAll:c})}),t.jsx(Kt,{dir:i,children:u}),t.jsxs("section",{className:n("wu-flex wu-items-center wu-justify-end wu-shrink-0 wu-gap-2",i==="rtl"?"wu-flex-row-reverse wu-pl-4":"wu-flex-row wu-pr-4"),children:[t.jsx(Gt,{dir:i}),(s==null?void 0:s.profile)&&Object.keys(s.profile).length>0&&t.jsx(Ut,{user:s,onLogout:o,dir:i,DataCenter:f})]})]})})},ee=Ie.Root,be=Ie.Trigger,Z=N.forwardRef(({className:e,align:a="center",sideOffset:r=4,...s},u)=>t.jsx(Ie.Portal,{children:t.jsx(Ie.Content,{ref:u,align:a,sideOffset:r,className:n("wu-z-50 wu-w-72 wu-border wu-bg-popover wu-p-4 wu-text-popover-foreground wu-shadow-md wu-outline-none data-[state=open]:wu-animate-in data-[state=closed]:wu-animate-out data-[state=closed]:wu-fade-out-0 data-[state=open]:wu-fade-in-0 data-[state=closed]:wu-zoom-out-95 data-[state=open]:wu-zoom-in-95 data-[side=bottom]:wu-slide-in-from-top-2 data-[side=left]:wu-slide-in-from-right-2 data-[side=right]:wu-slide-in-from-left-2 data-[side=top]:wu-slide-in-from-bottom-2",e),...s})}));Z.displayName=Ie.Content.displayName;function Rt({className:e,classNames:a,dir:r="ltr",...s}){const u=Ot.getDefaultClassNames();return t.jsx(Ot.DayPicker,{showOutsideDays:s.showOutsideDays||!1,className:n("wu-p-3",e),classNames:{root:n(u.root,"wu-relative wu-rounded-none wu-bg-white dark:wu-bg-gray-switcher"),caption_label:n("wu-text-xs",s.captionLayout==="dropdown"?"wu-hidden":""),month_caption:n(u.month_caption,"wu-mb-5"),months:n(u.months,"wu-flex wu-flex-col sm:wu-flex-row wu-gap-4"),dropdowns:n(u.dropdowns,"wu-flex wu-items-center wu-justify-start wu-gap-2",(s.mode==="range","")),dropdown:n(u.dropdown,"wu-px-2 wu-py-1 wu-text-sm wu-text-gray-lead wu-font-medium focus:wu-outline-none wu-bg-white wu-border-b wu-border-gray-subtle focus-visible:wu-border-blue-p"),weekday:n(u.weekday,"wu-text-gray-lead wu-rounded-none wu-w-9 wu-font-normal wu-text-xs wu-bg-gray-10 wu-py-2"),day_button:n(u.day_button,"wu-w-full wu-h-full focus:wu-outline-none focus-visible:wu-ring-2 focus-visible:wu-ring-blue-pHover focus-visible:wu-ring-offset-2"),day:n(u.day,"wu-text-gray-lead wu-transition-colors wu-duration-300 [&:not([aria-selected])]:hover:wu-bg-gray-25 wu-text-sm wu-w-9 wu-h-9 wu-min-w-0 wu-text-center wu-p-0 wu-rounded-none data-[today=true]:[&:not([aria-selected])]:wu-border data-[today=true]:[&:not([aria-selected])]:wu-border-blue-p data-[today=true]:[&:not([aria-selected])]:wu-text-gray-lead"),selected:n(u.selected,"wu-bg-blue-p [&:not(.rm)]:wu-text-white hover:wu-bg-blue-pHover"),range_middle:n("rm",u.range_middle,"wu-bg-blue-p/10 wu-rounded-none hover:wu-bg-blue-p/20 wu-text-gray-lead hover:wu-text-white data-[today=true]:wu-bg-blue-p/20 hover:data-[today=true]:wu-bg-blue-pHover"),range_end:n(u.range_end,"wu-rounded-none"),range_start:n(u.range_start,"wu-rounded-none wu-bg-blue-p hover:wu-bg-blue-pHover"),month_grid:n(u.month_grid,"[&>thead>tr>th]:wu-pb-2 wu-border-collapse wu-space-y-1"),button_next:n(u.button_next,ot({variant:"iconOnly"}),"wu-h-6 wu-w-6 wu-text-gray-lead"),button_previous:n(u.button_previous,ot({variant:"iconOnly"}),"wu-h-6 wu-w-6 wu-rotate-180 wu-text-gray-lead"),nav:n(u.nav,"wu-absolute wu-top-4 wu-right-3 wu-flex",r==="rtl"&&"wu-right-auto wu-left-3 wu-flex-row-reverse"),chevron:n(u.chevron,"!wu-text-red-500"),outside:n(u.outside,"wu-invisible"),disabled:n(u.disabled,"hover:wu-bg-white wu-text-gray-subtle"),...a},components:{Chevron:()=>t.jsx("span",{className:"wm-chevron-right wu-text-lg wu-leading-5"})},...s})}Rt.displayName="Calendar";const nt=e=>t.jsx(Rt,{...e}),ea=e=>{const{handleDateChange:a,disabled:r,onReset:s,showResetButton:u}=e;return t.jsxs("div",{className:"wu-flex wu-items-center wu-justify-end wu-gap-2 wu-mt-2 wu-date-picker-footer",children:[u&&t.jsx(V,{variant:"secondary",onClick:s,Icon:t.jsx("span",{className:"wu-text-[20px] wu-leading-5 -wu-mt-[1px] wm-refresh"}),className:"wu-date-picker-footer-reset",children:"Reset"}),t.jsx(De.PopoverClose,{asChild:!0,children:t.jsx(V,{onClick:a,disabled:r,className:"wu-date-picker-apply",children:"Apply"})})]})},wt=({formattedString:e,dir:a,placeholder:r="Select Date",className:s,variant:u="primary",color:o,...l})=>t.jsx(De.PopoverTrigger,{asChild:!0,dir:a,children:t.jsx(V,{...l,className:n("wu-justify-between wu-w-full wu-gap-2 wu-text-xs wu-border-b wu-rounded-none wu-rounded-t-sm wu-min-w-48 wu-border-gray-subtle wu-text-gray-lead wu-placeholder:wu-text-gray-subtle wu-placeholder:wu-font-light wu-bg-gray-10 hover disabled:wu-cursor-not-allowed disabled:wu-bg-gray-20 disabled:wu-border-gray-40 disabled:wu-text-subtle hover:wu-text-gray-lead hover:wu-bg-gray-10 hover:wu-border-gray-40 wu-datepicker-trigger",u==="outlined"&&"wu-border wu-border-subtle wu-bg-transparent",s),Icon:t.jsx("span",{className:"wm-calendar-month wu-text-sm"}),iconPosition:"right",children:e||r})}),ta=(e,a,r,s)=>!!(a||r&&e<r||s&&e>s),je=e=>e?typeof e=="string"?new Date(e):e:new Date,it="\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01])",Es=[{label:"Last 7 days",value:7},{label:"Last 30 days",value:30},{label:"Last 90 days",value:90},{label:"Last 365 days",value:365}],_s=({formatString:e="yyyy-MM-dd",value:a,onChange:r,disabled:s,minDate:u=A.sub(new Date,{years:5}),maxDate:o=A.add(new Date,{years:1}),dir:l="ltr",Label:w,labelPosition:i="top",onReset:c,showResetButton:f=!1,placeholder:p="Select Date",...h})=>{const[m,g]=d.useState(),[b,v]=d.useState(""),S=d.useCallback(()=>{const C=je(m);v(A.format(C,e)),r&&r(m)},[m,e,r]),y=d.useCallback(()=>{c?c():(g(void 0),v(""),r&&r(void 0))},[r,c]);return d.useEffect(()=>{const C=je(a);g(C),v(A.format(C,e))},[a,e]),t.jsxs(Q,{className:n("wu-flex wu-gap-1",i==="left"?"wu-items-center":"wu-flex-col wu-items-start","wu-date-picker-label"),dir:l,children:[w,t.jsxs(ee,{children:[t.jsx(wt,{...h,formattedString:b,dir:l,placeholder:p}),t.jsx(Z,{className:"wu-p-0 wu-w-fit wu-date-picker-content",align:"start",sideOffset:-.5,dir:l,children:t.jsx(nt,{dir:l,mode:"single",captionLayout:"dropdown",selected:m,onSelect:g,disabled:C=>ta(C,s,u,o),startMonth:u,endMonth:o,required:!0,autoFocus:!0,defaultMonth:m,className:n("wu-border wu-border-blue-p wu-date-picker"),footer:t.jsx(ea,{handleDateChange:S,disabled:s,onReset:y,showResetButton:f})})})]})]})},aa="yyyy-MM-dd",qs=[{label:"Day",value:1},{label:"Week",value:7},{label:"Month",value:30},{label:"Quarter",value:90},{label:"Year",value:365}],As=({current:e,onSelect:a,presetRanges:r=Es})=>{const[s,u]=d.useState(),[o,l]=d.useState(!1),[w,i]=d.useState(""),[c,f]=d.useState(""),[p,h]=d.useState(!1),m=d.useMemo(()=>r.map(y=>y.value),[r]),g=n("wu-flex wu-w-full wu-gap-2 wu-px-4 wu-py-2 wu-text-sm wu-text-gray-lead wu-transition-colors","wu-rounded-none hover:wu-bg-gray-10 focus:wu-outline-none focus-visible:wu-ring-2","focus-visible:wu-ring-blue-pHover focus-visible:wu-ring-offset-1 wu-text-start"),b=d.useCallback(y=>{if(y===void 0){u(void 0),l(!0);return}const C=Number(y)-1;u(C),l(!1),a({from:A.sub(new Date,{days:C}),to:new Date})},[a]),v=d.useCallback((y,C)=>{if(!y||!(e!=null&&e.to)||!(e!=null&&e.from)||!new RegExp(it).test(y))return!1;const k=new Date(C==="start"?y:e.from),I=new Date(C==="end"?y:e.to);return A.isBefore(I,k)?(h(!0),!1):(h(!1),!(A.isSameDay(k,e.from)&&A.isSameDay(I,e.to)))},[e]),S=d.useCallback((y,C)=>{if((C==="start"?i:f)(y),v(y,C)){const k={from:e==null?void 0:e.from,to:e==null?void 0:e.to};C==="start"&&(k.from=new Date(y)),C==="end"&&(k.to=new Date(y)),a(k)}},[e,a,v]);return d.useEffect(()=>{if(e!=null&&e.to&&(e!=null&&e.from)&&A.isValid(e.to)&&A.isValid(e.from)){i(A.format(e.from,aa)),f(A.format(e.to,aa));const y=A.differenceInCalendarDays(e.to,e.from);A.isToday(e.to)&&m.includes(y+1)?(u(y),l(!1)):(u(void 0),l(!0))}},[e,m]),t.jsxs("div",{className:"wu-flex wu-flex-col wu-gap-1 wu-p-2 wu-bg-white wu-w-60 wu-date-picker-sidebar",children:[t.jsx("ul",{className:"wu-flex wu-gap-1 wu-py-2 wu-date-picker-batch-list",children:qs.map(({label:y,value:C})=>t.jsx(Ne,{variant:"secondary",className:"wu-px-1 wu-py-1 wu-text-xs wu-h-fit wu-min-w-fit disabled:wu-bg-white",disabled:C!==1,children:y},C))}),t.jsxs("ul",{className:"wu-flex wu-flex-col wu-gap-1 wu-date-picker-ranges",children:[r.map(({label:y,value:C})=>t.jsx("li",{children:t.jsx("button",{className:n(g,s===C-1&&"wu-bg-blue-p/10"),onClick:()=>b(C),children:y})},C)),t.jsx("li",{children:t.jsx("button",{className:n(g,o&&"wu-bg-blue-p/10"),onClick:()=>b(),children:"Custom Range"})})]}),t.jsxs("div",{className:"wu-relative wu-flex wu-gap-3 wu-pt-2 wu-date-picker-range-footer",children:[t.jsx(pe,{placeholder:"Start Date",pattern:it,value:w,onChange:y=>S(y.target.value,"start"),"aria-label":"Start Date"}),t.jsx(pe,{placeholder:"End Date",pattern:it,value:c,onChange:y=>S(y.target.value,"end"),"aria-label":"End Date"}),p?t.jsx("small",{className:"wu-absolute wu-text-[10px] wu-leading-[14px] wu-text-red-deep wu-left-0 -wu-bottom-4 wu-text-start",children:"End date must be after start date"}):t.jsx("small",{className:"wu-absolute wu-right-0 wu-leading-[14px] -wu-bottom-4 wu-text-gray-subtle wu-text-end",children:"yyyy-mm-dd"})]})]})},Os=({formatString:e="yyyy/MM/dd",value:a,onChange:r,disabled:s,minDate:u=A.sub(new Date,{years:5}),maxDate:o=A.add(new Date,{years:1}),dir:l="ltr",minDateToSelect:w,maxDateToSelect:i,presetRanges:c,Label:f,labelPosition:p="top",onReset:h,showResetButton:m=!0,placeholder:g="Select Date Range",...b})=>{const[v,S]=d.useState(a),[y,C]=d.useState(a),[D,k]=d.useState(""),I=d.useCallback(()=>{if(y){const M=y.from,q=y.to;S({from:M,to:q}),k(`${A.format(M,e)} - ${A.format(q,e)}`),r&&r({from:M,to:q})}},[y,e,r]),W=d.useCallback(()=>{C(v)},[v]),T=d.useCallback(()=>{h?h():(S(void 0),C(void 0),k(""),r&&r(void 0))},[h,r]);return d.useEffect(()=>{if(a!=null&&a.from&&(a!=null&&a.to)){const M=je(a.from),q=je(a.to);S(a),C(a),k(`${A.format(M,e)} - ${A.format(q,e)}`)}else S(void 0),C({to:new Date,from:new Date})},[a,e]),t.jsxs(Q,{className:n("wu-flex wu-gap-1",p==="left"?"wu-items-center":"wu-flex-col wu-items-start","wu-date-picker-label"),dir:l,children:[f,t.jsxs(ee,{onOpenChange:M=>!M&&W(),children:[t.jsx(wt,{...b,formattedString:D,dir:l,placeholder:g}),t.jsxs(Z,{className:"wu-flex wu-p-0 wu-border wu-w-fit wu-border-blue-p",align:"start",sideOffset:-.5,dir:l,children:[t.jsx(As,{current:y,onSelect:C,presetRanges:c}),t.jsx(nt,{dir:l,numberOfMonths:2,mode:"range",captionLayout:"dropdown",selected:y,onSelect:C,disabled:M=>ta(M,s,u,o),startMonth:u,endMonth:o,required:!0,autoFocus:!0,defaultMonth:v==null?void 0:v.from,className:n("wu-shadow-none wu-date-range-picker"),min:w,max:i,footer:t.jsx(ea,{handleDateChange:I,disabled:s,onReset:T,showResetButton:m})})]})]})]})},ra=d.forwardRef((e,a)=>{const{className:r,rounded:s,...u}=e;return t.jsx("div",{className:n("wu-card wu-p-2 wu-pt-1 hover:wu-shadow-card wu-border wu-border-black/20 hover:wu-border-black/30 wu-transition-colors wu-duration-300",s?"wu-rounded-lg":"wu-rounded-sm",r),ref:a,...u})});ra.displayName="WuCard";const Ls=d.forwardRef((e,a)=>{const{className:r,...s}=e;return t.jsx("div",{ref:a,...s,className:n("wu-p-2 wu-mb-2 wu-border-b wu-border-gray-40 min-h-12 wu-card-header",r)})});Ls.displayName="WuCardHeader";const Ps=d.forwardRef((e,a)=>{const{className:r,...s}=e;return t.jsx("div",{ref:a,...s,className:n("wu-p-2 wu-mt-2 wu-border-t wu-border-gray-40 min-h-12 wu-card-footer",r)})});Ps.displayName="WuCardHeader";const sa=N.forwardRef(({className:e,partial:a,...r},s)=>t.jsx(Ze.Root,{ref:s,className:n("wu-h-4 wu-w-4 wu-shrink-0 wu-rounded-[2px] wu-bg-white wu-border wu-border-gray-subtle wu-ring-offset-background focus-visible:wu-outline-none focus-visible:wu-ring-2 focus-visible:wu-ring-ring focus-visible:wu-ring-offset-[1px] data-[state=checked]:wu-bg-blue-p data-[state=checked]:wu-text-white data-[state=checked]:wu-border-none data-[state=checked]:hover:wu-bg-blue-q hover:wu-bg-gray-20 hover:wu-border-blue-p wu-transition-all data-[state=checked]:disabled:wu-bg-gray-20","disabled:wu-cursor-not-allowed disabled:wu-opacity-50 disabled:data-[state=unchecked]:wu-bg-gray-20 disabled:hover:wu-border-gray-subtle disabled:wu-border-gray-subtle",e),...r,children:t.jsxs(Ze.Indicator,{className:n("wu-flex wu-items-center wu-justify-center wu-text-current"),children:[!a&&t.jsx("span",{className:"wm-check wu-text-base wu-leading-4"}),a&&t.jsx("span",{className:"wm-check-indeterminate-small wu-text-base wu-leading-4"})]})}));sa.displayName=Ze.Root.displayName;const te=d.forwardRef((e,a)=>{const{disabled:r,checked:s,Label:u,labelPosition:o="right",className:l,id:w=Be(),partial:i,onChange:c,required:f,readonly:p,...h}=e;return d.useEffect(()=>{h.defaultChecked!==void 0&&s!==void 0&&console.error("WuCheckbox: Both `checked` and `defaultChecked` cannot be used together. Use only one of them.")},[h.defaultChecked,s]),t.jsxs("div",{className:Fs({labelPosition:o,className:"wu-checkbox-container"}),dir:h.dir,children:[t.jsx(sa,{id:w,...h,partial:i,checked:s,disabled:r||p,onCheckedChange:c,className:n("wu-peer wu-checkbox",l),required:f,ref:a}),u&&t.jsx(Q,{htmlFor:w,className:"wu-w-full wu-checkbox-label",children:u})]})}),Fs=X.cva("wu-flex wu-items-center wu-gap-2 wu-w-fit",{variants:{labelPosition:{left:"wu-flex-row-reverse wu-text-right",right:"wu-flex-row"}}});te.displayName="WuCheckbox";const Bs=e=>{const{className:a,children:r,...s}=e;return t.jsx("span",{...s,className:n("wu-flex wu-items-center wu-justify-center wu-truncate wu-max-w-28 wu-w-fit wu-px-2 wu-py-1 wu-text-xs wu-bg-gray-20 wu-rounded-sm hover:wu-bg-gray-40 hover:wu-text-blue-q",a),children:r})},dt=N.forwardRef(({className:e,...a},r)=>t.jsx(G.Command,{ref:r,className:n("wu-flex wu-h-full wu-w-full wu-flex-col wu-overflow-hidden wu-rounded-md",e),...a}));dt.displayName=G.Command.displayName;const ua=N.forwardRef(({className:e,...a},r)=>t.jsx("div",{className:"wu-flex wu-items-center wu-border-b wu-px-3",children:t.jsx(G.Command.Input,{ref:r,className:n("wu-flex wu-h-11 wu-w-full wu-rounded-md wu-bg-transparent wu-py-3 wu-text-sm wu-outline-none wu-placeholder:wu-text-muted-foreground disabled:wu-cursor-not-allowed disabled:wu-opacity-50",e),...a})}));ua.displayName=G.Command.Input.displayName;const ct=N.forwardRef(({className:e,...a},r)=>t.jsx(G.Command.List,{ref:r,className:n("",e),...a}));ct.displayName=G.Command.List.displayName;const ft=N.forwardRef((e,a)=>t.jsx(G.Command.Empty,{ref:a,className:"wu-text-center wu-p-2 wu-pb-2.5 wu-text-xs",...e}));ft.displayName=G.Command.Empty.displayName;const qe=N.forwardRef(({className:e,...a},r)=>t.jsx(G.Command.Group,{ref:r,className:n("",e),...a}));qe.displayName=G.Command.Group.displayName;const oa=N.forwardRef(({className:e,...a},r)=>t.jsx(G.Command.Separator,{ref:r,className:n("wu-mx-1 wu-my-1 wu-h-px wu-bg-gray-20",e),...a}));oa.displayName=G.Command.Separator.displayName;const Ae=N.forwardRef(({className:e,...a},r)=>t.jsx(G.Command.Item,{ref:r,className:n("wu-relative wu-flex wu-cursor-default wu-gap-2 wu-select-none wu-items-center wu-rounded-sm wu-px-2 wu-py-3 wu-text-sm wu-outline-none data-[disabled=true]:wu-pointer-events-none data-[disabled=true]:wu-opacity-50 [&_svg]:wu-pointer-events-none [&_svg]:wu-size-4 [&_svg]:wu-shrink-0",e),...a}));Ae.displayName=G.Command.Item.displayName;const Se=d.forwardRef(({containerHeight:e=400,list:a,callback:r,dir:s,className:u,style:o},l)=>t.jsx(Gr.Virtuoso,{ref:l,dir:s,className:u,style:{height:e,scrollbarWidth:"thin",scrollbarColor:"#d4d4d4 #f1f1f1",overflowX:"hidden",...o},data:a,itemContent:(w,i)=>r(w,i)}));Se.displayName="WuVirtualScroll";const zs=({tags:e,triggerRef:a})=>{const[r,s]=d.useState([]),[u,o]=d.useState([]),l=d.useMemo(()=>t.jsx("ul",{className:"wu-flex wu-flex-col wu-items-start wu-justify-center wu-list-none",children:u.map((i,c)=>t.jsx("li",{className:"wu-py-1 wu-text-xs wu-text-left",children:i},c))}),[u]),w=i=>{const c=document.createElement("div");Object.assign(c.style,{display:"inline-block",visibility:"hidden",position:"absolute",whiteSpace:"nowrap"}),c.textContent=i,document.body.appendChild(c);const f=c.offsetWidth;return document.body.removeChild(c),f+8};return d.useEffect(()=>{const i=()=>{if(a.current){const h=a.current.offsetWidth-20-36;let m=0;const g=[],b=[];e.forEach(v=>{const S=w(v);m+S+8<h?(g.push(v),m+=S+8):b.push(v)}),s(g),o(b)}};return i(),window.addEventListener("resize",i),()=>{window.removeEventListener("resize",i)}},[e,a]),t.jsxs("div",{className:"wu-flex wu-items-center wu-gap-2 wu-text-xs",children:[r.map((i,c)=>t.jsx("span",{className:"wu-px-1 wu-py-0.5 wu-text-xs wu-rounded-sm wu-bg-gray-10 wu-combobox-tag",children:i},c)),u.length>0&&t.jsx(He,{content:l,className:"wu-z-[51] wu-text-left",children:t.jsxs("span",{className:"wu-px-1 wu-py-0.5 wu-text-xs wu-rounded-sm wu-bg-gray-10 wu-combobox-tag",children:["+",u.length]})})]})},Hs=({placeholder:e="Select...",isEllipse:a=!1,selectedOptions:r,variant:s="flat",dir:u="ltr",accessorKey:o,multiple:l,id:w,disabled:i,selectAll:c,isCheckedAll:f,className:p,...h})=>{const[m,g]=d.useState([]),b=d.useRef(null);d.useEffect(()=>{if(!r||Array.isArray(r)&&r.length===0){g([]);return}if(l){const S=r;g(S==null?void 0:S.map(y=>y[o.label]));return}else g([r[o.label]])},[r]);const v=()=>{var S;return m.length?f&&(c!=null&&c.enable)&&(c!=null&&c.triggerText)?t.jsx("span",{className:"wu-overflow-hidden wu-text-xs wu-text-start wu-text-ellipsis wu-whitespace-nowrap",children:c.triggerText}):a?t.jsx("span",{className:"wu-overflow-hidden wu-text-xs wu-text-start wu-text-ellipsis wu-whitespace-nowrap",style:{width:`${(((S=b.current)==null?void 0:S.offsetWidth)||0)-32}px`},children:m.join(", ")}):t.jsx(zs,{tags:m,triggerRef:b}):t.jsx("p",{className:"wu-text-xs wu-opacity-70",children:e})};return t.jsx(be,{dir:u,asChild:!0,id:w,disabled:i,children:t.jsxs("button",{...h,ref:b,disabled:i,className:n("focus-visible:wu-ring-2 focus-visible:wu-ring-blue-pHover wu-bg-white focus-visible:wu-ring-offset-2 wu-flex wu-w-full wu-items-center wu-justify-between wu-border-b wu-border-gray-subtle wu-py-1.5 wu-px-2 placeholder:wu-text-gray-40 focus:wu-outline-none disabled:wu-cursor-not-allowed disabled:wu-opacity-50 hover:wu-bg-gray-10 hover:wu-border-blue-p wu-transition-colors focus-visible:wu-bg-gray-20 focus-visible:wu-border-blue-p wu-cursor-pointer wu-text-xs wu-rounded-t-sm wu-gap-2 wu-h-8 wu-group",s==="outlined"&&"wu-border wu-border-gray-subtle","disabled:wu-cursor-not-allowed disabled:hover:wu-border-gray-subtle disabled:wu-bg-gray-10",p),children:[v(),t.jsx("span",{className:"wm-arrow-drop-down group-data-[state=open]:wu-rotate-180 wu-transition-transform wu-duration-300 wu-text-base"})]})})},la=L.Root,na=L.Trigger,wa=L.Group,js=L.Portal,$s=L.Sub,Us=L.RadioGroup,ia=N.forwardRef(({className:e,inset:a,children:r,position:s,...u},o)=>t.jsxs(L.SubTrigger,{ref:o,className:n("wu-flex wu-cursor-default wu-select-none wu-text-xs wu-items-center wu-p-3 wu-outline-none focus:wu-bg-gray-20 data-[state=open]:wu-bg-gray-20",a&&"wu-pl-8",e),...u,children:[s==="left"&&t.jsx("span",{className:n("wm-chevron-right",u.dir==="rtl"&&"ml-2")}),r,s!=="left"&&t.jsx("span",{className:n("wu-text-base wu-leading-4",u.dir==="rtl"&&"wu-mr-auto wm-chevron-left",u.dir!=="rtl"&&"wu-ml-auto wm-chevron-right")})]}));ia.displayName=L.SubTrigger.displayName;const da=N.forwardRef(({className:e,...a},r)=>t.jsx(L.SubContent,{ref:r,className:n("wu-z-50 wu-min-w-[8rem] wu-overflow-hidden wu-border wu-text-xs wu-bg-white wu-text-gray-lead wu-shadow-lg data-[state=open]:wu-animate-in data-[state=closed]:wu-animate-out data-[state=closed]:wu-fade-out-0 data-[state=open]:wu-fade-in-0 data-[state=closed]:wu-zoom-out-95 data-[state=open]:wu-zoom-in-95 data-[side=bottom]:wu-slide-in-from-top-2 data-[side=left]:wu-slide-in-from-right-2 data-[side=right]:wu-slide-in-from-left-2 data-[side=top]:wu-slide-in-from-bottom-2",e),...a}));da.displayName=L.SubContent.displayName;const pt=N.forwardRef(({className:e,sideOffset:a=4,...r},s)=>t.jsx(L.Portal,{children:t.jsx(L.Content,{ref:s,sideOffset:a,className:n("wu-z-50 wu-min-w-[8rem] wu-overflow-hidden wu-border wu-text-xs wu-bg-white wu-text-gray-lead wu-shadow-md data-[state=open]:wu-animate-in data-[state=closed]:wu-animate-out data-[state=closed]:wu-fade-out-0 data-[state=open]:wu-fade-in-0 data-[state=closed]:wu-zoom-out-95 data-[state=open]:wu-zoom-in-95 data-[side=bottom]:wu-slide-in-from-top-2 data-[side=left]:wu-slide-in-from-right-2 data-[side=right]:wu-slide-in-from-left-2 data-[side=top]:wu-slide-in-from-bottom-2",e),...r})}));pt.displayName=L.Content.displayName;const $e=N.forwardRef(({className:e,inset:a,...r},s)=>t.jsx(L.Item,{ref:s,className:n("wu-relative wu-flex wu-cursor-default wu-select-none wu-items-center wu-text-xs wu-p-2 wu-outline-none wu-transition-colors focus:wu-bg-gray-20 data-[disabled]:wu-cursor-not-allowed data-[disabled]:wu-opacity-50",a&&"wu-pl-8",e),...r}));$e.displayName=L.Item.displayName;const ca=N.forwardRef(({className:e,children:a,checked:r,dir:s,...u},o)=>t.jsxs(L.CheckboxItem,{ref:o,className:n("wu-group wu-relative wu-flex wu-cursor-default wu-select-none wu-items-center wu-text-xs wu-py-3 wu-outline-none wu-transition-colors focus:wu-bg-gray-20 data-[disabled]:wu-cursor-not-allowed data-[disabled]:wu-opacity-50",s==="rtl"&&"wu-pr-8 wu-pl-2",s!=="rtl"&&"wu-pl-8 wu-pr-2",e),checked:r,...u,children:[t.jsx("span",{className:n("wu-absolute wu-flex wu-items-center wu-justify-center wu-w-4 wu-h-4 wu-rounded-sm wu-ring-1 wu-ring-gray-subtle group-disabled:wu-bg-gray-20 group-data-[state=checked]:wu-bg-blue-p group-hover:wu-bg-gray-20 group-hover:wu-ring-blue-p wu-transition-all group-data-[state=checked]:wu-ring-blue-p",s==="rtl"&&"wu-right-2",s!=="rtl"&&"wu-left-2"),children:t.jsx(L.ItemIndicator,{children:t.jsx("span",{className:"wm-check wu-text-base wu-text-white"})})}),a]}));ca.displayName=L.CheckboxItem.displayName;const fa=N.forwardRef(({className:e,children:a,...r},s)=>t.jsxs(L.RadioItem,{ref:s,className:n("wu-group wu-relative wu-flex wu-cursor-default wu-select-none wu-items-center wu-text-xs wu-py-3 wu-pl-8 wu-pr-2 wu-outline-none wu-transition-colors focus:wu-bg-gray-20 focus:wu-text-accent-foreground data-[disabled]:wu-cursor-not-allowed data-[disabled]:wu-opacity-50",e),...r,children:[t.jsx("span",{className:"wu-absolute wu-rounded-full wu-left-2 wu-flex wu-h-4 wu-w-4 wu-items-center wu-justify-center wu-ring-1 wu-ring-gray-subtle group-disabled:wu-bg-gray-20 group-data-[state=checked]:wu-bg-white group-hover:wu-bg-gray-20 group-hover:wu-ring-blue-p wu-transition-all group-data-[state=checked]:wu-ring-blue-p group-hover:group-data-[state=checked]:wu-ring-blue-q",children:t.jsx(L.ItemIndicator,{className:"wu-w-4 wu-h-4 wu-flex wu-items-center wu-justify-center",children:t.jsx("span",{className:"wm-circle wu-text-blue-p group-hover:group-data-[state=checked]:wu-text-blue-q wu-text-xs"})})}),a]}));fa.displayName=L.RadioItem.displayName;const Oe=N.forwardRef(({className:e,inset:a,...r},s)=>t.jsx(L.Label,{ref:s,className:n("wu-p-2 wu-font-medium wu-text-xs",a&&"wu-pl-8",e),...r}));Oe.displayName=L.Label.displayName;const Ue=N.forwardRef(({className:e,...a},r)=>t.jsx(L.Separator,{ref:r,className:n("-wu-mx-1 wu-my-1 wu-h-px wu-bg-gray-20",e),...a}));Ue.displayName=L.Separator.displayName;const pa=({option:e,value:a,multiple:r=!1,onSelect:s,accessorKey:u,dir:o})=>{const[l,w]=d.useState(r?[]:"");d.useEffect(()=>{a&&w(r?a.map(p=>JSON.stringify(p[u.value])):JSON.stringify(a[u.value]))},[a,u.value,r]);const i=r?l.includes(JSON.stringify(e[u.value])):l===JSON.stringify(e[u.value]),c=()=>{e.disabled||s(e)};return t.jsxs(Ae,{onSelect:c,disabled:e.disabled,className:n("wu-cursor-pointer wu-text-xs wu-items-start wu-leading-4 wu-py-2 wu-combobox-item hover:wu-bg-gray-100",i&&"wu-bg-gray-10"),dir:o,children:[r&&t.jsx(te,{checked:i}),t.jsx(Gs,{option:e,accessorKey:u})]})},Gs=({option:e,accessorKey:a})=>{const r=e[a.label];return t.jsxs("div",{className:"wu-flex wu-items-center wu-w-full wu-gap-1",children:[e.icon&&e.icon,r,e.isAdmin&&t.jsx("span",{className:"wu-ml-auto wu-text-sm wm-lock wu-text-orange-deep"})]})},ba=e=>{const{option:a,selectAll:r,handleSelectAll:s,isCheckedAll:u,isPartialSelected:o,...l}=e;switch("type"in a?a.type:"option"){case"all":return t.jsx(Ae,{onSelect:s,className:n("wu-cursor-pointer wu-text-xs wu-leading-4 wu-py-2 wu-combobox-item"),dir:l.dir,children:t.jsx(te,{checked:u||o,partial:o,"data-partial":o,Label:(r==null?void 0:r.label)||"Select All"})});case"group":return t.jsxs(qe,{children:[t.jsx(Oe,{children:a.label}),a.options.map((i,c)=>d.createElement(pa,{...l,option:i,key:c}))]});case"divider":return t.jsx(oa,{className:"wu-mx-4"});default:return t.jsx(pa,{...l,option:a})}},Vs=e=>{const a=[],r=[],s=[],u=[];return e.forEach(o=>{o.type==="group"?(a.push(o),s.push(...o.options),u.push(...o.options.filter(l=>!l.disabled))):o.type==="divider"?r.push(o):s.push(o),o!=null&&o.disabled||u.push(o)}),{groups:a,dividers:r,allOptions:s,enabledOptions:u}},Ys=d.memo(pe),Js=({data:e,accessorKey:a,value:r,defaultValue:s,Header:u,virtualizedThreshold:o=100,isEllipse:l,placeholder:w,variant:i,dir:c,onSelect:f,Label:p,maxHeight:h=420,multiple:m=!1,hasGroup:g=!1,selectAll:b,id:v,disabled:S,labelPosition:y="top",className:C,onScroll:D,maxContentWidth:k,...I})=>{const[W,T]=d.useState(""),[M,q]=d.useState(),[$,_]=d.useState(!1),[P,Y]=d.useState(!1),[H,ae]=d.useState(!1),me=d.useRef(null),{allOptions:re,groups:xe,dividers:Te,enabledOptions:we}=d.useMemo(()=>g||b&&!b.includeDisabled?Vs(e):{allOptions:e,groups:[],dividers:[],enabledOptions:[]},[e,g]),ue=d.useMemo(()=>{if(!W)return e;const B=W.toLowerCase();return re.filter(se=>se[a.label].toLowerCase().includes(B))},[W,re,e,a.label]),E=d.useMemo(()=>m&&b!=null&&b.enable&&!W&&ue.length>0?[{type:"all"},...ue]:ue,[ue,W,m]),z=d.useMemo(()=>{const B=32*E.length+Te.length*9+xe.length*48;return Math.min(h,B)},[h,E,Te,xe]),J=d.useCallback(B=>{const se=B[a.value];m?q(Go=>{const qt=Go||[],Fr=qt.some(At=>At[a.value]===se)?qt.filter(At=>At[a.value]!==se):[...qt,B];return f==null||f(Fr),Fr}):(_(!1),q(B),f==null||f(B))},[m,a.value,f]),U=d.useCallback(B=>T(B.target.value),[]),_t=d.useCallback(()=>T(""),[]);d.useEffect(()=>{if(r!==void 0&&s!==void 0){console.error("defaultValue and value cannot be used simultaneously");return}else r!==void 0?q(r):s!==void 0&&q(s)},[r,s]),d.useEffect(()=>{if(!m)return;const B=b!=null&&b.includeDisabled?(M==null?void 0:M.length)===re.length:(M==null?void 0:M.length)===we.length;Y(B);const se=(M==null?void 0:M.length)>0&&!B;ae(se)},[M,b]);const ie=d.useCallback(()=>{const B=P?[]:b!=null&&b.includeDisabled?re:we;q(B),f==null||f(B)},[P,m,re,we,f,b]),oe=Ee(y);return t.jsxs("div",{className:n(oe,"wu-flex wu-combobox-container"),ref:me,children:[t.jsxs(ee,{onOpenChange:B=>{B&&_t(),_(B)},open:$,modal:!0,children:[t.jsx(Hs,{...I,selectedOptions:M,accessorKey:a,isEllipse:l,placeholder:w,variant:i,dir:c,multiple:m,disabled:S,selectAll:b,isCheckedAll:P,className:C,id:v}),t.jsx(Z,{className:"wu-min-w-[--radix-popover-trigger-width] wu-max-w-[calc(100vw-32px)] wu-p-0 wu-bg-white wu-border wu-border-blue-p wu-combobox-content",align:"start",sideOffset:-1,style:{maxWidth:k},children:t.jsxs(dt,{id:v,children:[t.jsx("div",{className:"wu-m-2",children:t.jsx(Ys,{placeholder:"Search...",Icon:t.jsx("span",{className:"wm-search"}),className:"wu-text-xs wu-combobox-search",onChange:U,name:"Search","aria-label":"Search",dir:c,iconPosition:c==="rtl"?"right":"left"})}),u,t.jsxs(ct,{children:[t.jsx(ft,{children:"No results found."}),E.length>=o?t.jsx(Se,{className:"wu-combobox-list",containerHeight:h,list:E,callback:(B,se)=>t.jsx(ba,{option:se,value:M,onSelect:J,multiple:m,accessorKey:a,dir:c,selectAll:b,handleSelectAll:ie,isCheckedAll:P,isPartialSelected:H},B),dir:c}):t.jsx("div",{style:{maxHeight:z,height:"fit-content",overflow:"auto"},className:"wu-combobox-list",onScroll:D,children:E.map((B,se)=>t.jsx(ba,{option:B,value:M,onSelect:J,multiple:m,accessorKey:a,dir:c,selectAll:b,handleSelectAll:ie,isCheckedAll:P,isPartialSelected:H},se))})]})]})})]}),p&&t.jsx(Q,{htmlFor:v,className:"wu-combobox-label",children:p})]})},Ks=e=>{const{textToCopy:a,notificationText:r,...s}=e,[u,o]=d.useState(!1),l=async()=>{if(a)try{await navigator.clipboard.writeText(a),o(!0),setTimeout(()=>o(!1),2e3)}catch(w){console.error("Failed to copy:",w)}};return t.jsxs(V,{...s,onClick:l,variant:"iconOnly",className:n("wu-relative",e.className),"aria-label":"Copy to clipboard",children:[r&&t.jsx("span",{className:n("wu-absolute wu-text-[6px] wu-leading-3 -wu-top-4 wu-right-0 wu-bg-gray-notification wu-text-white wu-rounded-sm wu-shadow-md wu-px-1 wu-animate-ping-once",u?"wu-block":"wu-hidden"),children:r}),t.jsx(le,{icon:"wm-content-copy",className:"wu-text-lg"})]})},ha=O.Root,Xs=O.Trigger,Qs=O.Close,Zs=O.Portal,ga=N.forwardRef(({className:e,...a},r)=>t.jsx(O.Overlay,{className:n("wu-fixed wu-inset-0 wu-z-50 wu-bg-black/30 data-[state=open]:wu-animate-in data-[state=closed]:wu-animate-out data-[state=closed]:wu-fade-out-0 data-[state=open]:wu-fade-in-0",e,"wu-drawer-overlay"),...a,ref:r}));ga.displayName=O.Overlay.displayName;const Rs=X.cva("wu-fixed wu-z-50 wu-gap-4 wu-p-6 wu-shadow-lg wu-transition wu-ease-in-out data-[state=open]:wu-animate-in data-[state=closed]:wu-animate-out data-[state=closed]:wu-duration-500 data-[state=open]:wu-duration-500",{variants:{side:{top:"wu-inset-x-0 wu-top-0 wu-border-b data-[state=closed]:wu-slide-out-to-top data-[state=open]:wu-slide-in-from-top",bottom:"wu-inset-x-0 wu-bottom-0 wu-border-t data-[state=closed]:wu-slide-out-to-bottom data-[state=open]:wu-slide-in-from-bottom",left:"wu-inset-y-0 wu-left-0 wu-h-full wu-w-3/4 wu-border-r data-[state=closed]:wu-slide-out-to-left data-[state=open]:wu-slide-in-from-left sm:wu-max-w-sm",right:"wu-inset-y-0 wu-right-0 wu-h-full wu-w-3/4 wu-border-l data-[state=closed]:wu-slide-out-to-right data-[state=open]:wu-slide-in-from-right sm:wu-max-w-sm"}},defaultVariants:{side:"right"}}),bt=N.forwardRef(({side:e="right",className:a,children:r,hideCloseButton:s,...u},o)=>t.jsxs(Zs,{children:[t.jsx(ga,{}),t.jsxs(O.Content,{ref:o,className:n(Rs({side:e}),a),...u,children:[r,!s&&t.jsx(O.Close,{"aria-label":"close",asChild:!0,children:t.jsxs(Ne,{variant:"iconOnly",className:"wu-absolute wu-right-4 wu-top-4",children:[t.jsx("span",{className:"wm-close"}),t.jsx("span",{className:"wu-sr-only",children:"Close"})]})})]})]}));bt.displayName=O.Content.displayName;const ma=({className:e,...a})=>t.jsx("div",{className:n("",e),...a});ma.displayName="SheetHeader";const ht=N.forwardRef(({className:e,...a},r)=>t.jsx(O.Title,{ref:r,className:n("wu-text-lg wu-font-semibold",e),...a}));ht.displayName=O.Title.displayName;const xa=N.forwardRef(({className:e,...a},r)=>t.jsx(O.Description,{ref:r,className:n("wu-text-sm",e),...a}));xa.displayName=O.Description.displayName;const eu=e=>a=>{e&&a.preventDefault()},tu=e=>{const{Trigger:a,children:r,hideCloseButton:s,className:u,side:o="left",open:l,onOpenChange:w,preventClickOutside:i,...c}=e;return t.jsxs(ha,{open:l,onOpenChange:w,children:[t.jsx(Xs,{asChild:!0,children:a}),t.jsxs(bt,{...c,onInteractOutside:eu(i),side:o,className:n("wu-bg-white wu-text-gray-lead wu-px-0",u),hideCloseButton:s,children:[t.jsx("div",{className:"wu-hidden",children:t.jsx(ht,{})}),r]})]})},au=({children:e,...a})=>t.jsx(Qs,{...a,children:e}),ya=({className:e,isLoading:a,loadingText:r,children:s,...u})=>t.jsxs("footer",{className:n("wu-flex wu-items-center wu-justify-between wu-gap-2 wu-border-t wu-border-gray-10 wu-py-3 wu-px-4 wu-bg-white/80 wu-backdrop-blur-sm wu-text-xs wu-font-normal wu-text-gray-footer wu-sticky wu-bottom-0",e),...u,children:[t.jsx("div",{className:"wu-flex-1",children:s}),a&&t.jsx(Ce,{size:"16px",variant:"spinner",color:"#a3a3a3",message:r})]});ya.displayName="WuFooter";const va=d.forwardRef((e,a)=>{const{size:r="sm",idOrSlugOrUrl:s,variant:u="primary",...o}=e,l=r==="sm"?16:18,w=s.includes("http")?s:`/help/${s}.html`,i=u==="primary"?"wu-text-blue-p":"wu-text-gray-lead";return t.jsx("button",{...o,ref:a,onClick:()=>et(w),children:t.jsx("span",{className:n("wm-help wu-text-gray-subtle",`wu-text-[${l}px]`,i,o.disabled&&"wu-text-neutral-300","wu-help-button-icon")})})});va.displayName="WuHelpButton";const ne=(e,a)=>`wu-listbox-${e}`;function ru(e){const{option:a,accessorKey:r,onSelect:s,multiple:u,dir:o,GroupLabel:l,Item:w,isSelected:i,...c}=e,f=r.group&&Array.isArray(a[r.group]),p=({item:h,className:m})=>d.createElement(Ae,{...c,key:JSON.stringify(h),onSelect:()=>s==null?void 0:s(h),value:a[r.value],className:n("data-[selected='true']:wu-bg-gray-100 wu-cursor-pointer wu-text-xs wu-min-h-8 wu-py-0 hover:wu-bg-gray-100",!!(i!=null&&i(h))&&!u&&"wu-bg-blue-p/10",o==="rtl"&&"wu-justify-end",m,ne("item")),disabled:h.disabled},u&&t.jsx(te,{checked:i==null?void 0:i(h)}),w?w({value:h,isSelected:i==null?void 0:i(h)}):t.jsx(t.Fragment,{children:h[r.label]}));if(f){const h=a[r.group],m=typeof l=="string"?a[l]:l==null?void 0:l(a);return t.jsx(qe,{heading:m,children:h==null?void 0:h.map(g=>t.jsx(p,{item:g,className:"wu-pl-6"},JSON.stringify(g)))})}return t.jsx(p,{item:a})}const su=d.memo(ru),uu=e=>{const{className:a,...r}=e;return t.jsxs("div",{className:"wu-relative",children:[t.jsx(le,{icon:"wm-search",className:"wu-absolute wu-top-[14px] wu-left-5"}),t.jsx(ua,{...r,"aria-label":"Search",className:n("wu-bg-gray-10 wu-border-b wu-border-gray-subtle wu-rounded-none wu-rounded-t-sm wu-h-8 wu-my-2 wu-pl-8","focus:wu-border-blue-p focus-visible:wu-outline-none;",ne("input"),a)})]})},ou=e=>{const{label:a,onSelectAll:r,data:s,value:u}=e,[o,l]=d.useState(!1),[w,i]=d.useState(!1);return d.useEffect(()=>{!u||!s||(l(u.length>0),i(u.length>0&&u.length<s.length))},[s,u]),t.jsxs(Ae,{className:"data-[selected='true']:wu-bg-gray-100 wu-cursor-pointer wu-text-xs wu-min-h-8 wu-py-0 hover:wu-bg-gray-100",onSelect:()=>r==null?void 0:r(!o),children:[t.jsx(te,{checked:o,partial:w}),a||"Select All"]})},lu=e=>{const{CustomTrigger:a,disabled:r,value:s,placeholder:u,accessorKey:o,Chip:l,handleUnselect:w,variant:i,dir:c,className:f,...p}=e,[h,m]=d.useState(),g=d.useRef(null);return d.useEffect(()=>{if(!s){m(null);return}m(Array.isArray(s)?l?s.map((v,S)=>l({value:v,unselect:w,key:S})):s.map(v=>v[o.label]).join(", "):l?l({value:s,unselect:w}):s[o.label])},[s,l,o.label,m]),t.jsx(be,{asChild:!0,id:e.id,disabled:r,ref:g,children:(a==null?void 0:a(s))||t.jsxs("button",{...p,className:n("wu-group wu-relative wu-min-h-8 wu-text-xs wu-border-gray-subtle wu-bg-gray-10 wu-p-1 wu-pl-2 rtl:wu-pr-2 wu-border-b wu-w-full wu-text-left wu-pr-5 rtl:wu-pl-5","hover:wu-border-blue-p","disabled:wu-cursor-not-allowed disabled:wu-bg-gray-20 disabled:wu-border-gray-40 disabled:wu-text-gray-subtle","rtl:wu-text-right",i==="outlined"&&"wu-border wu-border-gray-subtle wu-bg-white",f,ne("trigger")),children:[t.jsx("div",{className:n("wu-truncate",l&&"wu-flex wu-items-center wu-gap-1 wu-flex-wrap",!h&&"wu-font-light"),children:h||u}),t.jsx(le,{icon:"wm-arrow-drop-down",className:n("wu-absolute wu-top-1 wm-arrow-drop-down group-data-[state=open]:wu-rotate-180 wu-transition-transform wu-duration-300 wu-text-base",c==="rtl"?"wu-left-1":"wu-right-1",ne("drop-icon"))})]})})},Na=(e,a,r)=>{const s=String(e[r.label]??"").toLowerCase(),u=String(e[r.value]??"").toLowerCase();return s.includes(a)||u.includes(a)},nu=(e,a,r)=>{const s=a.trim();if(s==="")return e;const u=s.toLowerCase(),o=[];for(const l of e){const w=r.group,i=w?l[w]:void 0;if(Array.isArray(i)){const c=i.filter(f=>Na(f,u,r));c.length>0&&o.push({...l,[w]:c})}else Na(l,u,r)&&o.push(l)}return o},wu=e=>{const{data:a,accessorKey:r,value:s,Item:u,Label:o,GroupLabel:l,CustomHeader:w,CustomTrigger:i,NoDataContent:c,Chip:f,onSelect:p,onScroll:h,disabled:m,multiple:g,searchable:b,selectAll:v,virtualizedThreshold:S=100,id:y,dir:C,className:D,listClass:k,placeholder:I="Select items...",variant:W,labelPosition:T="top",maxContentWidth:M,maxContentHeight:q}=e,[$,_]=d.useState(!1),[P,Y]=d.useState(""),[H,ae]=d.useState(s),me=d.useMemo(()=>r,[r]),re=d.useMemo(()=>{if(!b||!P)return a;const E=P.toLowerCase().trim();return nu(a,E,r)},[a,P,r.label,b]),xe=E=>{g?ae(z=>{const J=E[r.value],U=Array.isArray(z)?z:[],ie=U.some(oe=>oe[r.value]===J)?U.filter(oe=>oe[r.value]!==J):[...U,E];return p&&p(ie),ie}):(ae(E),p&&p(E),_(!1))},Te=d.useCallback(E=>{const z=E?a:[];ae(z),v!=null&&v.onSelectAll&&v.onSelectAll(E),p&&p(z)},[a,v,p]),we=E=>Array.isArray(H)?H.some(z=>z[r.value]===E[r.value]):(H==null?void 0:H[r.value])===E[r.value];d.useEffect(()=>{ae(s)},[s]);const ue=E=>{const z=J=>t.jsx(su,{option:J,accessorKey:me,multiple:g,onSelect:U=>xe(U),dir:C,GroupLabel:l,Item:u,isSelected:U=>we(U)},JSON.stringify(J));return E.length>S?t.jsx(Se,{list:E,callback:(J,U)=>z(U),dir:C}):E.map(z)};return t.jsxs("div",{className:n("wu-flex wu-text-sm wu-gap-2",T==="top"&&"wu-flex-col wu-gap-1",T==="left"&&"wu-flex-row",T==="right"&&"wu-flex-row-reverse",ne("container")),dir:C,children:[o&&t.jsx(Q,{htmlFor:y,className:ne("label"),children:o}),t.jsxs(ee,{open:$,onOpenChange:E=>{_(E),E||setTimeout(()=>{Y("")},100)},children:[t.jsx(lu,{CustomTrigger:i,disabled:m,value:H,accessorKey:r,placeholder:I,Chip:f,className:D,handleUnselect:xe,variant:W,id:y,dir:C}),t.jsx(Z,{className:n("wu-min-w-[--radix-popover-trigger-width] wu-max-w-[calc(100vw-32px)] wu-p-0 wu-bg-white wu-border wu-border-blue-p",ne("content")),align:"start",sideOffset:-1,style:{maxWidth:M},children:t.jsxs(dt,{id:e.id,shouldFilter:!1,children:[b&&t.jsx(uu,{value:P,onValueChange:Y}),w,t.jsxs(ct,{className:n("wu-overflow-y-auto",ne("list"),k),onScroll:h,style:{maxHeight:q||"420px"},children:[t.jsx(ft,{children:c||"No results found."}),t.jsx(qe,{children:g&&(v==null?void 0:v.enabled)&&!P&&t.jsx(ou,{data:a,value:H,onSelectAll:Te,label:v.label})}),t.jsx(qe,{children:ue(re)})]})]})})]})]})},iu=e=>{const{checked:a,onSelect:r,children:s,disabled:u,preventCloseOnSelect:o}=e;return t.jsx(ca,{disabled:u,checked:a,onCheckedChange:r,onSelect:l=>o&&l.preventDefault(),children:s})},gt=e=>{const{children:a,className:r,Icon:s,iconPosition:u="left",disabled:o,onSelect:l,preventCloseOnSelect:w}=e,i=n("wu-flex wu-items-center wu-gap-2",s&&(u==="left"?"":"wu-justify-between wu-flex-row-reverse"),r),c=f=>{l&&l(f),w&&f.preventDefault()};return t.jsxs($e,{onSelect:c,disabled:o,className:i,children:[s&&t.jsx("div",{className:"wu-text-base",children:s}),a]})},du=e=>{const{children:a,...r}=e;return t.jsxs(wa,{...r,children:[t.jsx(Oe,{children:e.label}),a]})},cu=e=>{const{options:a,value:r,onSelect:s}=e;return t.jsx(Us,{value:r,onValueChange:s,children:a.map(u=>t.jsx(fa,{value:u.value,disabled:u.disabled,children:u.label},u.value))})},fu=e=>{const{className:a,...r}=e,s=n("wu-w-11/12 wu-mx-auto wu-border-gray-40",a);return t.jsx(Ue,{...r,className:s})},ke=N.forwardRef(({className:e,children:a,thumbColor:r,railColor:s,...u},o)=>t.jsxs(ce.Root,{ref:o,className:n("wu-relative wu-overflow-hidden",e),children:[t.jsx(ce.Viewport,{className:"wu-h-full wu-w-full wu-rounded-[inherit]",...u,children:a}),t.jsx(mt,{thumbColor:r,railColor:s}),t.jsx(ce.Corner,{})]}));ke.displayName=ce.Root.displayName;const mt=N.forwardRef(({className:e,orientation:a="vertical",thumbColor:r="#d4d4d4",railColor:s="#eeeeee",...u},o)=>t.jsx(ce.ScrollAreaScrollbar,{ref:o,orientation:a,className:n("wu-flex wu-touch-none wu-select-none wu-transition-colors",a==="vertical"&&"wu-h-full wu-w-2 wu-border-l wu-border-l-transparent wu-p-[1px]",a==="horizontal"&&"wu-h-2 wu-flex-col wu-border-t wu-border-t-transparent wu-p-[1px]",e),style:{background:s},...u,children:t.jsx(ce.ScrollAreaThumb,{className:"wu-relative wu-flex-1 wu-rounded-full",style:{background:r}})}));mt.displayName=ce.ScrollAreaScrollbar.displayName;const pu=e=>{const{children:a,label:r,open:s,onOpenChange:u,height:o,dir:l,...w}=e;return t.jsxs($s,{...w,open:s,onOpenChange:u,children:[t.jsx(ia,{dir:l,children:r}),t.jsx(js,{children:t.jsx(da,{onInteractOutside:i=>i.preventDefault(),children:t.jsx(ke,{className:"wu-h-fit",style:{height:o},dir:l,children:a})})})]})},bu="wu-p-1.5 wu-cursor-pointer hover:wu-bg-gray-20 wu-border-gray-40 wu-transition wu-duration-300 focus:wu-outline-2 focus:wu-outline-offset focus:wu-outline-blue-p/80 focus:wu-bg-gray-20 hover:wu-bg-gray-20 wu-rounded-t-sm",Ca=e=>{const{children:a,menuTitle:r,variant:s="flat",name:u,open:o,onOpenChange:l,height:w,preventCloseOnClickOutside:i,dir:c,Trigger:f,align:p="start",sideOffset:h=0,side:m="bottom",alignOffset:g,className:b,disabled:v,...S}=e;return t.jsxs(la,{...S,open:o,onOpenChange:l,dir:c,children:[t.jsx(na,{asChild:!0,dir:c,disabled:v,className:n("disabled:wu-text-zinc-300 disabled:wu-bg-white disabled:wu-cursor-not-allowed disabled:hover:wu-bg-transparent"),children:f??hu(s,u,v)}),t.jsx(pt,{className:n("wu-w-56 wu-border wu-border-blue-p disabled:wu-border-gray-40",b,"wu-menu-content"),align:p,sideOffset:h,side:m,alignOffset:g,onInteractOutside:y=>i&&y.preventDefault(),children:t.jsxs(ke,{className:"h-fit",style:{height:w},dir:c,children:[r&&t.jsxs(t.Fragment,{children:[t.jsx(Oe,{dir:c,className:"wu-menu-title",children:r}),t.jsx(Ue,{className:"wu-mt-0 wu-menu-separator",dir:c})]}),a??t.jsx("p",{children:"Menu Is Empty"})]})})]})},hu=(e,a,r)=>{const s=n(bu,"wu-flex wu-items-center wu-justify-between wu-gap-2 wu-h-8 wu-text-xs wu-group",e==="outlined"?"wu-border":"wu-border-b","wu-trigger-btn");return t.jsxs("button",{className:s,"aria-label":"menu-trigger",children:[t.jsx("span",{children:a??"Menu"}),t.jsx("span",{className:n("wm-arrow-drop-down wu-text-gray-lead wu-text-base wu-rotate-180 group-data-[state=closed]:wu-rotate-0 wu-transition-transform wu-duration-300 group-hover:wu-text-blue-q",r&&"wu-text-zinc-300 group-hover:wu-text-zinc-300")})]})},xt=d.forwardRef(({showMenu:e=!1,className:a,color:r="#1B3380",...s},u)=>{const o=n("wu-w-full wu-border wu-transition-all wu-duration-300");return t.jsxs("div",{...s,className:n("wu-flex wu-flex-col wu-w-[18px] wu-justify-between wu-aspect-[3/2] wu-transition-all wu-duration-300",a),ref:u,"aria-label":"menu-icon",children:[t.jsx("div",{className:`${o} wu-origin-center ${e?"wu-rotate-45 wu-translate-y-[5px]":""}`,style:{borderColor:r}}),t.jsx("div",{className:`${o} ${e?"wu-opacity-0":""}`,style:{borderColor:r}}),t.jsx("div",{className:`${o} wu-origin-center ${e?"-wu-rotate-45 -wu-translate-y-[5px]":""}`,style:{borderColor:r}})]})});xt.displayName="WuMenuIcon";const Sa={overlay:"data-[state=open]:wu-animate-in data-[state=closed]:wu-animate-out data-[state=closed]:wu-fade-out-0 data-[state=open]:wu-fade-in-0",content:"data-[state=open]:wu-animate-in data-[state=closed]:wu-animate-out data-[state=closed]:wu-fade-out-0 data-[state=open]:wu-fade-in-0 data-[state=closed]:wu-zoom-out-95 data-[state=open]:wu-zoom-in-95 data-[state=closed]:wu-slide-out-to-left-1/2 data-[state=closed]:wu-slide-out-to-top-[48%] data-[state=open]:wu-slide-in-from-left-1/2 data-[state=open]:wu-slide-in-from-top-[48%]"},gu=O.Root,mu=O.Trigger,xu=O.Portal,yu=O.Close,ka=d.forwardRef(({className:e,...a},r)=>t.jsx(O.Overlay,{ref:r,className:n("wu-fixed wu-inset-0 wu-z-50 wu-bg-black/30",Sa.overlay,e),...a}));ka.displayName=O.Overlay.displayName;const Ta=d.forwardRef(({className:e,children:a,hideCloseButton:r,...s},u)=>t.jsxs(xu,{children:[t.jsx(ka,{}),t.jsxs(O.Content,{ref:u,className:n("wu-fixed wu-left-[50%] wu-top-[50%] wu-z-50 wu-flex wu-flex-col wu-w-full wu-max-w-lg wu-translate-x-[-50%] wu-translate-y-[-50%] wu-bg-white wu-shadow-lg wu-duration-200",Sa.content,e),...s,children:[a,!r&&t.jsx(O.Close,{"aria-label":"close",asChild:!0,children:t.jsxs(Ne,{variant:"iconOnly",className:n("wu-absolute wu-right-2 wu-top-1 hover:wu-bg-gray-lead/10","wuexp:wu-top-[18px] wuexp:wu-right-4 wuexp:wu-p-1.5 wuexp:hover:wu-bg-wuexp-gray-lead/10","wuexp:group-data-[variant=action]:wu-text-blue-q","wuexp:group-data-[variant=upgrade]:wu-text-yellow-deep","wuexp:group-data-[variant=critical]:wu-text-red-deep"),children:[t.jsx("span",{className:"wu-text-lg wm-close wuexp:wu-text-xl wuexp:wu-leading-5"}),t.jsx("span",{className:"wu-sr-only",children:"Close"})]})})]})]}));Ta.displayName=O.Content.displayName;const Da=({className:e,...a})=>t.jsx("div",{className:n("wu-text-center wu-bg-gray-20 wu-w-full",e),...a});Da.displayName="DialogHeader";const Ma=({className:e,...a})=>t.jsx("div",{className:n("wu-flex wu-flex-col-reverse sm:wu-flex-row sm:wu-justify-end sm:wu-space-x-2 wu-p-4",e),...a});Ma.displayName="DialogFooter";const Ia=d.forwardRef(({className:e,...a},r)=>t.jsx(O.Title,{ref:r,className:n("wu-text-lg wu-font-medium wu-flex wu-items-center wu-justify-center wu-gap-1 wu-h-10 wu-leading-none wu-tracking-tight",e),...a}));Ia.displayName=O.Title.displayName;const vu=d.forwardRef(({className:e,...a},r)=>t.jsx(O.Description,{ref:r,className:n("wu-text-sm wu-text-muted-foreground",e),...a}));vu.displayName=O.Description.displayName;const Nu={gradientBackground:"_gradientBackground_1bbet_1"},Wa=e=>{const{colors:a,size:r=.55,children:s,className:u,strokeWidth:o,centerOffset:l={x:0,y:0},...w}=e,i=d.useRef(null);return d.useEffect(()=>{const c=i.current;if(c){c.style.setProperty("--width",`${c.offsetWidth*r}px`),c.style.setProperty("--height",`${c.offsetHeight*r}px`),c.style.setProperty("--colors",a.join(",")),c.style.setProperty("--stroke-width",`-${o||2}px`),c.style.setProperty("--spotlight-background","radial-gradient(100% var(--height) ellipse at 25% 70%, var(--colors))");let p;const h=m=>{p&&cancelAnimationFrame(p),p=requestAnimationFrame(()=>{const g=c.getBoundingClientRect();let b=m.clientX-g.left,v=m.clientY-g.top;b=Math.max(0,Math.min(b+l.x,g.width)),v=Math.max(0,Math.min(v+l.y,g.height));const S=`radial-gradient(
|
|
2
|
-
var(--width) var(--height) ellipse at ${
|
|
1
|
+
(function(S,a){typeof exports=="object"&&typeof module<"u"?a(exports,require("react/jsx-runtime"),require("@radix-ui/react-accordion"),require("react"),require("clsx"),require("tailwind-merge"),require("@radix-ui/react-avatar"),require("@radix-ui/react-slot"),require("class-variance-authority"),require("@radix-ui/react-label"),require("@radix-ui/react-tooltip"),require("date-fns"),require("@radix-ui/react-popover"),require("react-day-picker"),require("@radix-ui/react-checkbox"),require("cmdk"),require("react-virtuoso"),require("@radix-ui/react-dropdown-menu"),require("@radix-ui/react-dialog"),require("@radix-ui/react-scroll-area"),require("@radix-ui/react-radio-group"),require("@radix-ui/react-separator"),require("react-dom"),require("@radix-ui/react-toggle-group"),require("@radix-ui/react-toggle"),require("@radix-ui/react-tabs"),require("@tanstack/react-table"),require("@radix-ui/react-toast"),require("@radix-ui/react-switch")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","@radix-ui/react-accordion","react","clsx","tailwind-merge","@radix-ui/react-avatar","@radix-ui/react-slot","class-variance-authority","@radix-ui/react-label","@radix-ui/react-tooltip","date-fns","@radix-ui/react-popover","react-day-picker","@radix-ui/react-checkbox","cmdk","react-virtuoso","@radix-ui/react-dropdown-menu","@radix-ui/react-dialog","@radix-ui/react-scroll-area","@radix-ui/react-radio-group","@radix-ui/react-separator","react-dom","@radix-ui/react-toggle-group","@radix-ui/react-toggle","@radix-ui/react-tabs","@tanstack/react-table","@radix-ui/react-toast","@radix-ui/react-switch"],a):(S=typeof globalThis<"u"?globalThis:S||self,a(S["wick-ui-lib"]={},S["react/jsx-runtime"],S.RadixUIAccordion,S.React,S.clsx,S.tailwindMerge,S.RadixUIAvatar,S.RadixUISlot,S.ClassVarianceAuthority,S.RadixUILabel,S.RadixUITooltip,S.dateFns,S.RadixUIPopover,S.ReactDayPicker,S.RadixUICheckbox,S.cmdk,S.ReactVirtuoso,S.RadixUIDropdownMenu,S.RadixUIDialog,S.RadixUIScrollArea,S.RadixUIRadioGroup,S.RadixUISeparator,S.ReactDOM,S.RadixUIToggleGroup,S.RadixUIToggle,S.RadixUITabs,S.TanstackReactTable,S.RadixUIToast,S.RadixUISwitch))})(this,function(S,a,Je,f,Uu,$u,ju,Xe,Ce,Gu,Rt,z,nt,Za,Yu,we,Ku,Ju,Xu,Qu,Zu,Ru,eo,to,ao,ro,Ie,so,uo){"use strict";var bc=Object.defineProperty;var gc=(S,a,Je)=>a in S?bc(S,a,{enumerable:!0,configurable:!0,writable:!0,value:Je}):S[a]=Je;var Tt=(S,a,Je)=>gc(S,typeof a!="symbol"?a+"":a,Je);function ue(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const s=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,s.get?s:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const qe=ue(Je),g=ue(f),Qe=ue(ju),Ra=ue(Gu),lt=ue(Rt),it=ue(nt),ea=ue(Yu),X=ue(Ju),Y=ue(Xu),Ve=ue(Qu),ct=ue(Zu),er=ue(Ru),oo=ue(eo),kt=ue(to),tr=ue(ao),He=ue(ro),pe=ue(so),ta=ue(uo),no={qualitative:{"--wu-qualitative-1":"#4C5B94","--wu-qualitative-2":"#5B7AAE","--wu-qualitative-3":"#409EB5","--wu-qualitative-4":"#40B59E","--wu-qualitative-5":"#60C790","--wu-qualitative-6":"#9AD69A","--wu-qualitative-7":"#B3BD56","--wu-qualitative-8":"#DD8F40","--wu-qualitative-9":"#CE6550","--wu-qualitative-10":"#AE4C3D","--wu-qualitative-11":"#8F3328","--wu-qualitative-12":"#985D75","--wu-qualitative-13":"#B181A8","--wu-qualitative-14":"#C5A0C2","--wu-qualitative-15":"#DAC2E0","--wu-qualitative-16":"#E3D9E8"},blueSequential:{"--wu-blue-sequential-1":"#EBF8FF","--wu-blue-sequential-2":"#D7EFFF","--wu-blue-sequential-3":"#C2DEFF","--wu-blue-sequential-4":"#AAD0FF","--wu-blue-sequential-5":"#94C1F3","--wu-blue-sequential-6":"#7DB2E7","--wu-blue-sequential-7":"#67A3DB","--wu-blue-sequential-8":"#5194CF","--wu-blue-sequential-9":"#3B85C3","--wu-blue-sequential-10":"#2576B7","--wu-blue-sequential-11":"#256CAC","--wu-blue-sequential-12":"#1A60A6","--wu-blue-sequential-13":"#184994","--wu-blue-sequential-14":"#1C337F","--wu-blue-sequential-15":"#0D2163","--wu-blue-sequential-16":"#00083D"},greenSequential:{"--wu-green-sequential-1":"#E0F9ED","--wu-green-sequential-2":"#C4F3DC","--wu-green-sequential-3":"#A8ECCC","--wu-green-sequential-4":"#8DE5BD","--wu-green-sequential-5":"#78DDB1","--wu-green-sequential-6":"#62D3A3","--wu-green-sequential-7":"#4CC996","--wu-green-sequential-8":"#3ABF8A","--wu-green-sequential-9":"#35AF7F","--wu-green-sequential-10":"#329D75","--wu-green-sequential-11":"#308A6A","--wu-green-sequential-12":"#2D7A60","--wu-green-sequential-13":"#286A55","--wu-green-sequential-14":"#255C4B","--wu-green-sequential-15":"#1F4B3E","--wu-green-sequential-16":"#1B3D34"},redSequential:{"--wu-red-sequential-1":"#FEE9EC","--wu-red-sequential-2":"#FFD2D8","--wu-red-sequential-3":"#FFBBC4","--wu-red-sequential-4":"#FFA6B3","--wu-red-sequential-5":"#FB97A5","--wu-red-sequential-6":"#F78998","--wu-red-sequential-7":"#F37C8C","--wu-red-sequential-8":"#EE6F80","--wu-red-sequential-9":"#E76172","--wu-red-sequential-10":"#E15466","--wu-red-sequential-11":"#DA465B","--wu-red-sequential-12":"#D33B50","--wu-red-sequential-13":"#BC3548","--wu-red-sequential-14":"#A73343","--wu-red-sequential-15":"#91313E","--wu-red-sequential-16":"#7D2D38"},orangeSequential:{"--wu-orange-sequential-1":"#FDEDE5","--wu-orange-sequential-2":"#FCDFCF","--wu-orange-sequential-3":"#FBCFBA","--wu-orange-sequential-4":"#FAC5AB","--wu-orange-sequential-5":"#F7B694","--wu-orange-sequential-6":"#F6AB85","--wu-orange-sequential-7":"#F79D70","--wu-orange-sequential-8":"#F6915F","--wu-orange-sequential-9":"#EF8450","--wu-orange-sequential-10":"#E37944","--wu-orange-sequential-11":"#DB713C","--wu-orange-sequential-12":"#D06530","--wu-orange-sequential-13":"#C95E29","--wu-orange-sequential-14":"#BD521C","--wu-orange-sequential-15":"#B24610","--wu-orange-sequential-16":"#AA3F08"},divergent:{"--wu-red-divergent-1":"#661200","--wu-red-divergent-2":"#A11C00","--wu-red-divergent-3":"#D2300E","--wu-red-divergent-4":"#DF4828","--wu-red-divergent-5":"#EB6A4A","--wu-red-divergent-6":"#F4896C","--wu-red-divergent-7":"#FFC4B3","--wu-red-divergent-8":"#FFE2D9","--wu-divergent-neutral":"#F5F5F5","--wu-blue-divergent-1":"#DBD9E9","--wu-blue-divergent-2":"#B7B5D4","--wu-blue-divergent-3":"#9392BF","--wu-blue-divergent-4":"#7070AA","--wu-blue-divergent-5":"#4A5195","--wu-blue-divergent-6":"#1B3380","--wu-blue-divergent-7":"#182D72","--wu-blue-divergent-8":"#122254"},nps:{"--wu-nps-detractor":"#F85271","--wu-nps-passive":"#F1DA7E","--wu-nps-promoter":"#42BD84"},sentiment:{"--wu-sentiment-negative":"#F85271","--wu-sentiment-slightly-negative":"#F69A79","--wu-sentiment-neutral":"#F1DA7E","--wu-sentiment-slightly-positive":"#94D08B","--wu-sentiment-positive":"#42BD84","--wu-sentiment-no-sentiment":"#E0E0E0"}},lo=$u.extendTailwindMerge({prefix:"wu-"});function c(...e){return lo(Uu.clsx(e))}const aa=e=>{window.open(e,"_blank","toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=800,height=600")};function It(){return Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15)}function wt(e){switch(e){case"top":return"wu-flex-col-reverse";case"left":return"wu-flex-row-reverse wu-gap-2";case"right":return"wu-flex-row wu-gap-2";default:return""}}const io=e=>e?/\S+@questionpro\.com/.test(e):!1,ar=qe.Root,ra=g.forwardRef(({className:e,...t},r)=>a.jsx(qe.Item,{ref:r,className:c("wu-border-b",e),...t}));ra.displayName="AccordionItem";const sa=g.forwardRef(({className:e,children:t,...r},s)=>a.jsx(qe.Header,{className:"wu-flex",children:a.jsxs(qe.Trigger,{ref:s,className:c("wu-flex wu-flex-1 wu-text-xs wu-items-center wu-justify-between wu-p-2 wu-transition-all","[&[data-state=open]>.wu-arrow-icon]:wu-rotate-180",e),...r,children:[t,a.jsx("span",{className:"wu-arrow-icon wm-keyboard-arrow-down wu-transition-transform wu-duration-200"})]})}));sa.displayName=qe.Trigger.displayName;const ua=g.forwardRef(({className:e,children:t,...r},s)=>a.jsx(qe.Content,{ref:s,className:"wu-overflow-hidden wu-text-xs wu-px-2 wu-font-light wu-transition-all data-[state=closed]:wu-animate-accordion-up data-[state=open]:wu-animate-accordion-down",...r,children:a.jsx("div",{className:c("wu-pb-4 wu-pt-0",e),children:t})}));ua.displayName=qe.Content.displayName;const co=e=>{const{items:t,className:r,dir:s="ltr"}=e;if(e.type==="multiple"){const{defaultValue:u=[],value:o,onValueChange:n}=e;return a.jsx(ar,{type:"multiple",className:"wu-w-full wu-accordion-container",defaultValue:u,value:o,onValueChange:n,dir:s,children:t.map(({value:l,Summary:i,Details:w,className:d})=>a.jsxs(ra,{value:l,dir:s,className:c(r,d),children:[a.jsx(sa,{dir:s,className:"wu-accordion-summary",children:i}),a.jsx(ua,{dir:s,className:"wu-accordion-details",children:w})]},l))})}else{const{defaultValue:u,value:o,onValueChange:n}=e;return a.jsx(ar,{type:"single",className:"wu-w-full wu-accordion-container",defaultValue:u,value:o,onValueChange:n,dir:s,collapsible:!0,children:t.map(({value:l,Summary:i,Details:w,className:d})=>a.jsxs(ra,{value:l,dir:s,className:c(r,d),children:[a.jsx(sa,{dir:s,className:"wu-accordion-summary",children:i}),a.jsx(ua,{dir:s,className:"wu-accordion-details",children:w})]},l))})}},rr=g.forwardRef(({className:e,...t},r)=>a.jsx(Qe.Root,{ref:r,className:c("wu-relative wu-flex wu-h-10 wu-w-10 wu-shrink-0 wu-overflow-hidden wu-rounded-full",e),...t}));rr.displayName=Qe.Root.displayName;const sr=g.forwardRef(({className:e,...t},r)=>a.jsx(Qe.Image,{ref:r,className:c("wu-aspect-square wu-h-full wu-w-full",e),...t}));sr.displayName=Qe.Image.displayName;const ur=g.forwardRef(({className:e,...t},r)=>a.jsx(Qe.Fallback,{ref:r,className:c("wu-flex wu-h-full wu-w-full wu-items-center wu-justify-center wu-rounded-full wu-bg-muted",e),...t}));ur.displayName=Qe.Fallback.displayName;function oa(e,t){f.useEffect(()=>{const r=s=>{Array.isArray(e)&&e.some(u=>!u.current||u.current.contains(s.target))||!Array.isArray(e)&&(!e.current||e.current.contains(s.target))||t(s)};return document.addEventListener("mousedown",r),document.addEventListener("touchstart",r),()=>{document.removeEventListener("mousedown",r),document.removeEventListener("touchstart",r)}},[e,t])}const na={dropdownContainer:"_dropdownContainer_vvlo9_1",open:"_open_vvlo9_1",dropdownMenu:"_dropdownMenu_vvlo9_1"},or=({dir:e,Trigger:t,triggerClassName:r,DropdownContent:s})=>{const[u,o]=f.useState(!1),n=f.useRef(null),l=f.useRef(null);oa([n,l],()=>o(!1));const i=()=>{o(!u)};return a.jsx(a.Fragment,{children:a.jsx("div",{className:na.dropdownContainer,children:a.jsx("ul",{children:a.jsxs("li",{className:c("wu-flex wu-relative",u&&na.open),children:[a.jsx("button",{className:c("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:w=>{w.preventDefault(),i()},ref:l,"aria-label":"dropdown-trigger",children:t}),a.jsx("div",{className:c(na.dropdownMenu,{open:u},e==="rtl"?"wu-left-[-10px] wu-top-[38px]":"wu-right-[-7px] wu-top-[38px]"),dir:e,ref:n,"aria-label":"user-menu",children:s})]})})})})},la=Ce.cva(["wu-inline-flex wu-items-center wu-justify-center wu-rounded-sm","wu-whitespace-nowrap wu-leading-4 wu-text-sm wu-font-normal","wu-transition-colors wu-duration-300","focus:wu-outline-none focus-visible:wu-outline-2 focus-visible:wu-outline-offset-2","disabled:wu-cursor-not-allowed disabled:wu-bg-black/10 disabled:wu-text-gray-subtle disabled:wu-outline-gray-subtle"],{variants:{size:{md:["wu-p-2 wu-h-8 wu-min-w-[104px]","wu-text-sm"],sm:["wu-p-1 wu-h-6 wu-min-w-[90px]","wu-text-xs"],mobile:["wu-p-4 wu-h-10 wu-min-w-[104px]","wu-text-base"]},color:{primary:["wu-bg-blue-p hover:wu-bg-blue-pHoverDeep","wu-text-blue-p hover:wu-text-blue-q","wu-ring-1 wu-ring-blue-p hover:wu-ring-blue-pHoverDeep","focus-visible:wu-outline-blue-p/50"],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","focus-visible:wu-outline-orange-deep/50"],error:["wu-bg-red-deep hover:wu-bg-red-soft","wu-text-red-deep hover:wu-text-red-deep","wu-ring-1 wu-ring-red-deep hover:wu-ring-red-soft","focus-visible:wu-outline-red-deep/50"]},variant:{primary:["wu-text-white hover:wu-text-white","wu-ring-0"],secondary:["wu-bg-transparent hover:wu-bg-black hover:wu-bg-opacity-[0.04]","wu-ring-0"],outline:["wu-bg-white hover:wu-text-white","disabled:wu-bg-transparent"],rounded:["wu-text-white hover:wu-text-white","wu-ring-0 wu-rounded-full"],link:["wu-bg-transparent hover:wu-bg-transparent","disabled:wu-bg-transparent","hover:wu-underline wu-underline-offset-2","wu-min-w-[auto] wu-px-2","wu-ring-0","focus-visible:wu-outline-offset-0"],iconOnly:["wu-aspect-square","wu-p-2 wu-h-8 wu-w-8 wu-min-w-[auto]","wu-text-xl wu-leading-5","wu-bg-transparent wu-text-gray-lead","hover:wu-bg-black hover:wu-bg-opacity-[0.04]","focus-visible:wu-bg-black focus-visible:wu-bg-opacity-[0.04]","wu-ring-0","disabled:wu-grayscale disabled:wu-opacity-80"]}},defaultVariants:{variant:"primary",size:"md",color:"primary"},compoundVariants:[]}),Ze=g.forwardRef(({className:e,variant:t,size:r,color:s,asChild:u=!1,...o},n)=>{const l=u?Xe.Slot:"button";return a.jsx(l,{className:c(la({size:r,color:s,variant:t,className:e})),ref:n,...o})});Ze.displayName="Button";const Re=f.forwardRef((e,t)=>wo(e,t)),wo=(e,t)=>{const{size:r="md",color:s="#1B87E6",variant:u="dots",...o}=e,n=c("wu-w-[4em] wu-h-[1em] wu-inline-block wu-text-xs wu-relative wu-loader-dot-container");let l="7px";r==="sm"?l="7px":r==="md"?l="12px":r==="lg"?l="18px":typeof r=="string"&&(l=r);const i={backgroundColor:s,width:l,height:l},w=a.jsxs("div",{...o,ref:t,className:c("wu-flex wu-items-center wu-justify-center wu-gap-2 wu-w-fit",e.className),role:"status","aria-busy":"true",children:[a.jsx("div",{className:"wu-w-12 wu-h-12 wu-border-2 wu-rounded-full wu-animate-spin",style:{width:l,height:l,borderTopColor:s}}),e.message&&a.jsx("p",{className:"wu-inline-block wu-loader-message",children:e.message})]}),d=a.jsxs("div",{...o,ref:t,className:c("wu-flex wu-items-center wu-justify-center wu-gap-2 wu-w-fit",e.className),role:"alert","aria-busy":"true",children:[a.jsxs("ul",{className:n,style:{fontSize:l},role:"loader",children:[a.jsx("li",{className:"wu-dot wu-loader-dot",style:i}),a.jsx("li",{className:"wu-dot wu-loader-dot",style:i}),a.jsx("li",{className:"wu-dot wu-loader-dot",style:i}),a.jsx("li",{className:"wu-dot wu-loader-dot",style:i})]}),e.message&&a.jsx("p",{className:"wu-inline-block wu-loader-message",children:e.message})]});return a.jsx(a.Fragment,{children:u==="spinner"?w:d})};Re.displayName="WuLoader";const me=f.forwardRef(({disabled:e,loading:t,variant:r="primary",size:s="md",Icon:u,iconPosition:o="left",children:n,floating:l,className:i,color:w="primary",selected:d,...p},b)=>{const h={primary:"#1986e688",upgrade:"#f5830088",error:"#ef444488"};return a.jsxs(Ze,{...p,disabled:e,variant:r,size:s,className:c(l&&"wu-shadow-qp","wu-flex wu-items-center wu-justify-center wu-gap-2",o==="right"&&"wu-flex-row-reverse",t?"wu-cursor-not-allowed wu-ring-0":"",d&&"wu-bg-blue-p wu-bg-opacity-15 wu-text-blue-pHoverDeep wu-ring-0",w==="error"&&"hover:wu-text-maroon",i),color:w,style:{backgroundColor:t?h[w]:"",...p.style},ref:b,children:[!t&&u&&a.jsx(a.Fragment,{children:u}),t&&a.jsx(Re,{color:"#fff",size:"sm"}),!t&&n]})});me.displayName="WuButton";const fo=({onLogout:e,DataCenter:t})=>a.jsxs("section",{className:"wu-flex wu-justify-between wu-px-4 wu-py-4 wu-text-white wu-bg-gray-lead",children:[a.jsx("div",{className:"wu-flex-1 wu-flex wu-items-start",children:t}),a.jsx(me,{variant:"outline",size:"sm",Icon:a.jsx("span",{className:"wm-logout"}),className:"wu-text-white wu-bg-transparent wu-ring-white hover:wu-bg-gray-10 hover:wu-text-gray-lead hover:wu-ring-gray-lead",onClick:e,"aria-label":"logout",children:"LOGOUT"})]}),po=({user:e,dir:t})=>{const r=[e!=null&&e.usage&&Object.keys(e.usage).length>0?{title:e.usage.title,url:e.usage.url,icon:"wm-bar-chart wu-text-base",node:a.jsxs("div",{className:"wu-flex wu-flex-col wu-items-center wu-w-20",children:[a.jsx("code",{className:"wu-font-medium",children:e.usage.collectedResponseCount||"0"}),a.jsx("span",{className:"wu-text-xs wu-font-normal",children:"Responses"})]})}:null,e!=null&&e.invoice&&Object.keys(e.invoice).length>0?{title:e.invoice.title,url:e.invoice.url,icon:"wm-attach-money wu-text-base wu-font-semibold",node:a.jsx("div",{className:"wu-flex wu-justify-center wu-items-center wu-w-20",children:a.jsx("code",{children:e.invoice.size})})}:null].filter(Boolean);return a.jsxs(a.Fragment,{children:[a.jsx("ul",{children:r.map(({title:s,url:u,icon:o,node:n},l)=>a.jsx("li",{className:l<r.length-1?"wu-border-b wu-border-gray-subtle":"",children:a.jsxs("a",{href:u,className:c("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:[a.jsxs("div",{className:"wu-flex wu-items-center wu-gap-2",children:[a.jsx("span",{className:c(o,"wu-w-12 wu-text-center")}),a.jsx("span",{children:s})]}),n]})},l))}),a.jsx("hr",{className:"wu-border-gray-subtle"})]})},bo=({settings:e,dir:t})=>a.jsxs(a.Fragment,{children:[a.jsx("hr",{className:"wu-border-gray-subtle"}),a.jsxs("section",{className:"wu-relative wu-flex wu-items-center wu-justify-start wu-gap-2",children:[a.jsx("span",{className:c("wu-absolute wm-settings wu-text-base",t==="rtl"?"wu-right-4":"wu-left-4")}),a.jsx("ul",{className:"wu-w-full",dir:t,children:e==null?void 0:e.map(r=>a.jsx("li",{tabIndex:-1,dir:t,children:a.jsx("a",{href:r.url,className:c("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))})]}),a.jsx("hr",{className:"wu-border-gray-subtle"})]}),go=({user:e,dir:t})=>{var r,s,u,o,n,l,i,w,d;return a.jsxs("section",{className:c("wu-flex wu-gap-2 wu-p-4 wu-w-full",t==="rtl"?"wu-pr-0":"wu-pl-0"),children:[a.jsx("div",{className:"wu-flex wu-items-center wu-justify-center wu-w-12",children:a.jsx("span",{className:"wu-text-base wm-person"})}),a.jsxs("div",{className:c("wu-flex wu-flex-col wu-gap-1",t==="rtl"&&"wu-text-right"),children:[a.jsx("p",{children:(r=e==null?void 0:e.profile)==null?void 0:r.title}),a.jsxs("a",{href:(s=e==null?void 0:e.license)==null?void 0:s.url,className:"hover:wu-text-blue-p wu-group/license focus:wu-outline-none focus:wu-text-blue-p",dir:t,children:[a.jsx("p",{children:(u=e==null?void 0:e.profile)==null?void 0:u.subtitle}),a.jsx("p",{className:"wu-font-light",children:(o=e==null?void 0:e.profile)==null?void 0:o.companyName})]}),(e==null?void 0:e.license)&&Object.keys(e.license).length>0&&a.jsxs("div",{className:"wu-flex wu-items-center wu-justify-between wu-gap-6 wu-mt-3",dir:t,children:[a.jsx("a",{href:(n=e==null?void 0:e.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:a.jsxs("div",{className:"wu-flex wu-flex-col wu-items-start wu-gap-1",children:[a.jsx("p",{className:"wu-font-normal",children:(l=e==null?void 0:e.license)==null?void 0:l.subtitle}),a.jsx("button",{tabIndex:-1,className:"wu-px-3 wu-py-1 wu-border wu-rounded-sm wu-border-gray-subtle group-hover/license:wu-border-blue-p",children:(i=e==null?void 0:e.license)==null?void 0:i.title})]})}),a.jsxs("div",{className:"wu-flex wu-flex-col wu-items-start wu-gap-1",dir:t,children:[a.jsx("p",{className:"wu-font-normal",children:(w=e==null?void 0:e.license)==null?void 0:w.expiryDatePostFixString}),a.jsx("p",{children:(d=e==null?void 0:e.license)==null?void 0:d.expiryDate})]})]})]})]})},nr=({user:e,onLogout:t,dir:r,DataCenter:s})=>{var u,o;return e?a.jsx(or,{Trigger:a.jsxs(rr,{className:c("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:[a.jsx(sr,{className:"hover:wu-opacity-80",src:(u=e==null?void 0:e.profile)==null?void 0:u.profilePicture,alt:"User"}),a.jsx(ur,{children:(o=e==null?void 0:e.profile)==null?void 0:o.initials})]}),dir:r,triggerClassName:"wu-rounded-full focus:wu-outline-none focus-visible:wu-ring-2 focus-visible:wu-ring-blue-soft focus-visible:wu-ring-offset-2 focus-visible:wu-ring-offset-gray-switcher wu-w-8 wu-h-8 wu-app-user-button",DropdownContent:a.jsxs("div",{className:c("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:[a.jsx(go,{user:e,dir:r}),(e==null?void 0:e.settings)&&e.settings.length>0&&a.jsx(bo,{settings:e.settings,dir:r}),a.jsx(po,{user:e,dir:r}),a.jsx(fo,{onLogout:t,DataCenter:s})]})}):null},lr=({menuList:e,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 a.jsx(or,{dir:t,Trigger:a.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:a.jsx("ul",{children:(e||r).map((s,u)=>a.jsx("li",{className:"wu-p-0 wu-w-[191px] hover:wu-bg-[#ededed]",dir:t,children:s.target==="window"?a.jsx("a",{tabIndex:0,rel:"noopener noreferrer",onClick:()=>aa(s.link),onKeyDown:o=>{o.key==="Enter"&&aa(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:a.jsx(ir,{item:s,dir:t})}):a.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:a.jsx(ir,{item:s,dir:t})})},u))})})},ir=({item:e,dir:t})=>a.jsxs("div",{className:"wu-flex wu-items-start wu-gap-3",children:[a.jsx("span",{className:`${e.icon} wu-text-xl wu-text-gray-subtle`}),a.jsxs("div",{className:c("wu-flex wu-flex-col wu-gap-[2px]",t==="rtl"&&"wu-text-right"),children:[a.jsx("span",{className:"wu-text-xs wu-text-gray-subtle",children:e.subTitle}),a.jsx("p",{className:"wu-text-sm wu-text-blue-q",children:e.title})]})]}),ho=e=>{const[t,r]=f.useState(()=>window.innerWidth<=e);return f.useEffect(()=>{const s=()=>{r(window.innerWidth<=e)};return window.addEventListener("resize",s),()=>{window.removeEventListener("resize",s)}},[e]),t};function mo({productCategories:e,openCategory:t,setOpenCategory:r}){const s=(l,i)=>{const w=i[l];if(w){w.focus();const d=e[l]||null;r(d)}},u=(l,i,w,d)=>{l.preventDefault();const p=w==="down"?i+1:i-1;s(p,d)},o=(l,i,w,d)=>{t!=null&&t.products&&t.products[t.products.length-1].name===d&&(l.preventDefault(),s(i+1,w))},n=(l,i)=>{l.preventDefault();const w=e[i]===t?null:e[i];r(w)};return function(i,w,d){const p=document.querySelectorAll("[data-product-category]"),{key:b}=i;switch(b){case"ArrowDown":u(i,w,"down",p);break;case"ArrowUp":u(i,w,"up",p);break;case"Tab":o(i,w,p,d);break;case"Enter":case" ":n(i,w);break}}}const xo=e=>{const{size:t="lg",className:r,children:s,...u}=e,o={sm:"wu-text-body-3",md:"wu-text-body-2",lg:"wu-text-body-1"},n=e.as||"div";return a.jsx(n,{...u,className:c(o[t],r),children:s})},yo=e=>{const{size:t="xl",className:r,children:s,...u}=e,o={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"},l=o[t];return a.jsx(l,{...u,className:c(n[t],r),children:s})},vo=e=>{const{size:t="lg",className:r,children:s,...u}=e,o={sm:"wu-text-sub-3",md:"wu-text-sub-2",lg:"wu-text-sub-1"},n=e.as||"div";return a.jsx(n,{...u,className:c(o[t],r),children:s})},No=e=>{const{size:t="lg",className:r,children:s,...u}=e,o={md:"wu-text-display-2",lg:"wu-text-display-1"},n=e.as||"h1";return a.jsx(n,{...u,className:c(o[t],r),children:s})},Oe=e=>{const{icon:t,className:r,...s}=e;return a.jsx("span",{...s,className:c(t,r),role:"presentation","aria-label":t})},Co=({buttonRef:e,handleDropdownToggle:t,handleKeyDown:r,isDropdownOpen:s,activeProductName:u,dir:o="ltr",homeLink:n="/"})=>a.jsxs("button",{ref:e,type:"button",className:c("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:l=>{s&&l.key==="ArrowDown"&&r(l,-1)},"aria-label":"product-switcher",children:[a.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:a.jsx(Oe,{icon:"wc-logo",className:"wu-text-xl wu-leading-4 wu-relative wu-top-1"})}),u,a.jsx("span",{className:c("wm-arrow-drop-down wu-text-2xl wu-transition-transform wu-duration-300",s&&"wu-rotate-180",o==="rtl"?"wu-mr-auto":"wu-ml-auto")})]}),R={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"},So=({category:e,dir:t="ltr",openCategory:r})=>{const s=e.active?"#c5cce0":"#f0c36a",u=(r==null?void 0:r.name)===e.name,o=c("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=c("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 a.jsxs("div",{className:c("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:[a.jsx("div",{className:R.productCategoryBorderTop,style:{backgroundColor:s}}),a.jsxs("div",{className:"wu-flex wu-items-center wu-px-1 wu-relative wu-top-1",children:[a.jsx("div",{className:"wu-w-[56px] wu-h-[56px] wu-flex wu-items-center wu-justify-center",children:a.jsx("img",{src:e.logo,alt:e.name,width:"32px",height:"32px"})}),a.jsx("span",{className:"wu-text-sm wu-leading-5 wu-text-blue-q wu-relative wu-top-[1px]",children:e.name})]}),e.active?a.jsx("span",{className:o}):a.jsx("span",{className:n})]})},Eo={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"},To=({product:e,currentProduct:t,activeProductName:r,dir:s,focusItem:u,setFocusItem:o})=>{const[n,l]=f.useState(e.name===t),i=e.name===r,w=e.name===t,d=!e.active,p="#1b3380",b="#c5cce0",h="#ffcf70",x=c("wu-font-normal wu-text-xs wu-text-gray-lead wu-text-center",w&&"wu-text-blue-q wu-font-normal",!e.active&&"wu-text-gray-subtle",n&&"wu-font-normal",e.active&&n&&"wu-text-blue-q"),m=c("wu-text-blue-p wu-text-base",w&&"wu-text-blue-q",!e.active&&"wu-text-gray-subtle",e.active&&n&&"wu-text-blue-q"),v=n||u===e.name||i?p:b;return a.jsxs("li",{className:c(R.productListItem,"focus-visible:wu-outline-none focus:wu-outline-none wu-sub-product-list-item",(i||n)&&R.activeProduct,e.name.length>15&&window.innerWidth>768&&"wu-w-[130px] wu-min-w-[130px]",u===e.name&&R.activeProduct,"wu-product-item"),onMouseOver:()=>l(!0),onMouseOut:()=>l(!1),"aria-label":e.name,"aria-disabled":d,dir:s,onKeyDown:E=>{if(E.key==="Enter"){E.preventDefault();const y=E.currentTarget.querySelector("a");y&&y.click()}},onFocus:()=>{o(e.name)},onBlur:()=>o(""),children:[a.jsx("div",{className:c(R.topBorder,s==="rtl"&&R.topBorderRtl),style:{backgroundColor:d?h:v}}),a.jsxs("a",{className:c(R.productLink,"focus:wu-outline-none focus-visible:wu-outline-none"),href:e.link||"#",tabIndex:0,children:[a.jsx("span",{className:c(m,Eo[e.icon||""]),"aria-hidden":!0}),a.jsx("span",{className:c(x),children:e.name})]})]},e.name)},ko=({category:e,currentProduct:t,activeProductName:r,dir:s="ltr",focusItem:u,setFocusItem:o,borderColorLocked:n="#f5a300"})=>{const{products:l=[],active:i}=e,w=f.useMemo(()=>l.filter(x=>x.active).sort((x,m)=>(x.order||100)-(m.order||100)),[l]),d=f.useMemo(()=>l.filter(x=>!x.active),[l]),[p,b]=f.useState(n),h=x=>x.map((m,v)=>a.jsx(To,{product:m,currentProduct:t,activeProductName:r,dir:s,focusItem:u,setFocusItem:o},v));return i?a.jsxs(a.Fragment,{children:[h(w),d.length>0&&a.jsxs("li",{className:c(R.productListItem,"focus:wu-outline-none focus-visible:wu-outline-none !wu-bg-[#f5f5f5] hover:!wu-bg-[#eeeeee] wu-group"),onMouseOver:()=>b("#f5a300"),onMouseOut:()=>b(n),"aria-label":"Upgrade to unlock",children:[a.jsx("div",{className:c(R.topBorder,s==="rtl"&&R.topBorderRtl),style:{backgroundColor:p},"aria-label":"top-border"}),a.jsxs("a",{href:"https://www.questionpro.com/a/showUpgradeUser.do",className:c(R.productLink,"wu-flex wu-flex-col wu-items-center wu-justify-center wu-py-2 wu-min-w-[88px]"),children:[a.jsx("span",{className:"wu-text-base wu-transition-colors wm-lock !wu-text-orange-soft group-hover:wu-text-orange-deep"}),a.jsxs("span",{className:"wu-text-[10px] wu-leading-[10px] wu-text-center wu-pt-1 !wu-text-orange-deep",children:["Upgrade to ",a.jsx("br",{})," unlock"]})]})]}),h(d)]}):a.jsxs("li",{className:c(R.productListItem,R.learnMore,"focus:wu-outline-none focus-visible:wu-outline-none wu-product-item-inactive !wu-bg-[#f5f5f5] hover:!wu-bg-[#eeeeee]",u==="learn"&&"activeProduct"),tabIndex:0,onFocus:()=>o("learn"),onBlur:()=>o(""),"aria-label":"Learn More",children:[a.jsx("div",{className:c(R.topBorder,s==="rtl"&&R.topBorderRtl),style:{backgroundColor:n}}),a.jsx("a",{className:R.productLink,href:"https://www.questionpro.com/a/showUpgradeUser.do",tabIndex:-1,children:a.jsx("span",{className:"wu-text-[#f99e03]",children:"Learn More"})})]})},cr=({dropdownRef:e,dir:t,isDropdownOpen:r,productCategories:s,openCategory:u,setOpenCategory:o,handleKeyDown:n,expandAll:l,activeProductName:i,focusItem:w,setFocusItem:d})=>{const p="#ffcf70",[b,h]=f.useState(window.innerWidth>768);return f.useEffect(()=>{const x=()=>{h(window.innerWidth>375)};return window.addEventListener("resize",x),()=>window.removeEventListener("resize",x)},[]),a.jsx("ul",{className:c(R.productDropdownMenu,r&&R.productDropdownMenuOpen,t==="rtl"&&R.rtlDropdownMenu,"wu-switcher-container"),ref:e,dir:t,"aria-label":"product-dropdown-menu","data-state":r?"open":"closed",children:s.map((x,m)=>a.jsxs("li",{className:c(R.productCategory,"focus:wu-outline-none focus-visible:wu-outline-none wu-h-16 wu-category-item",u===x&&R.open,l&&R.open),onMouseEnter:()=>b&&o(x),onMouseLeave:()=>b&&o(null),"aria-label":x.name,dir:t,onKeyDown:v=>n(v,m),tabIndex:0,"data-product-category":!0,children:[a.jsx(So,{category:x,dir:t,openCategory:u}),a.jsx("ul",{className:c(R.productList,t==="rtl"&&R.rtlProductList),dir:t,children:a.jsx(ko,{category:x,dir:t,activeProductName:i,currentProduct:x.name,focusItem:w,setFocusItem:d,borderColorLocked:p})})]},x.name))})},Io=({isProductButtonShow:e,isDropdownOpen:t,activeProductColor:r,activeProductBgColor:s,activeProductName:u,dir:o,smallScreenButtonRef:n,handleDropdownToggle:l,handleKeyDown:i})=>a.jsx("div",{className:c("wu-absolute wu-top-11 wu-transition-all wu-duration-300 wu-ease-in-out wu-transform wu-opacity-100 wu-w-[256px] wu-z-10",e?o==="rtl"?"wu-right-0 wu-overflow-hidden":"wu-translate-x-0 wu-left-0":o==="rtl"?"wu-right-0 wu-w-0":"wu--translate-x-full"),style:{backgroundColor:t?r.hover:s},children:a.jsxs("button",{ref:n,type:"button",className:c("wu-text-base wu-leading-[48px] wu-flex wu-items-center wu-justify-center wu-px-2 wu-gap-2 wu-w-full focus:wu-outline-none focus-visible:wu-bg-white/10 wu-switcher-trigger",e?"wu-flex":o==="rtl"?"wu-hidden":"wu-flex"),onClick:l,onKeyDown:w=>{t&&w.key==="ArrowDown"&&i(w,-1)},"aria-label":"small-screen-product-btn",children:[u,a.jsx("span",{className:c("wm-arrow-drop-down wu-text-2xl wu-transition-transform wu-duration-300",t&&"wu-rotate-180")})]})}),Do=({dir:e,isProductButtonShow:t,smallScreenToggleButtonRef:r,setIsProductButtonShow:s,setDropdownOpen:u})=>{const o=()=>{s(n=>!n),t&&u(!1)};return a.jsxs("button",{className:c("wu-relative wu-w-10 wu-h-10 wu-flex wu-flex-col wu-justify-center wu-items-center",e==="rtl"?"wu-mr-4":"wu-ml-4"),onClick:o,ref:r,"aria-label":"menu-toggle-btn",children:[a.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"}`}),a.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"}`}),a.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"}`})]})},wr=({productCategories:e,activeProductName:t,activeProductColor:r={base:"#1b87e6",hover:"#54A5EC"},dir:s,homeLink:u,expandAll:o})=>{const n=f.useRef(null),l=f.useRef(null),i=f.useRef(null),w=f.useRef(null),[d,p]=f.useState(!1),[b,h]=f.useState(null),[x,m]=f.useState(r.base),[v,E]=f.useState(""),[y,C]=f.useState(!1),N=ho(768);oa([l,n],()=>{p(!1),h(null)}),oa([i,w,l],()=>{C(!1),p(!1),h(null)}),f.useEffect(()=>{const T=_=>{_.key==="Escape"&&p(!1)};return document.addEventListener("keydown",T),()=>{document.removeEventListener("keydown",T)}},[d]),f.useEffect(()=>m(r.base),[r.base]);const I=T=>{T.preventDefault(),T.stopPropagation(),p(_=>{const D=!_;return D||h(null),D})},M=(T,_)=>{mo({productCategories:e,openCategory:b,setOpenCategory:h})(T,_,v)};return a.jsx("div",{className:c("wu-inline-flex wu-items-center wu-justify-between wu-relative wu-z-auto wu-h-12 wu-text-white"),children:N?a.jsxs("div",{className:"wu-relative wu-flex",children:[a.jsx(Do,{dir:s,isProductButtonShow:y,smallScreenToggleButtonRef:w,setDropdownOpen:p,setIsProductButtonShow:C}),a.jsx(Io,{isProductButtonShow:y,isDropdownOpen:d,activeProductColor:r,activeProductBgColor:x,activeProductName:t,handleDropdownToggle:I,smallScreenButtonRef:i,handleKeyDown:M,dir:s}),a.jsx("div",{className:c("wu-absolute wu-top-[92px] wu-left-0 wu-text-[18px]",s==="rtl"&&"wu-right-[256px] wu-left-auto"),children:a.jsx(cr,{activeProductName:t,focusItem:v,setFocusItem:E,handleKeyDown:M,isDropdownOpen:d,openCategory:b,productCategories:e,setOpenCategory:h,dropdownRef:l,expandAll:o,dir:s})})]}):a.jsxs("div",{className:"wu-relative wu-flex wu-items-center wu-justify-start wu-h-full wu-w-[256px]",dir:s,style:{backgroundColor:d?r.hover:x},onMouseOver:()=>m(r.hover),onMouseOut:()=>m(r.base),children:[a.jsx(Co,{activeProductName:t,dir:s,homeLink:u,buttonRef:n,handleDropdownToggle:I,handleKeyDown:M,isDropdownOpen:d}),a.jsx(cr,{activeProductName:t,focusItem:v,setFocusItem:E,handleKeyDown:M,isDropdownOpen:d,openCategory:b,productCategories:e,setOpenCategory:h,dropdownRef:l,expandAll:o,dir:s})]})})},dr=({children:e,dir:t,className:r})=>a.jsx("section",{className:c("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:a.jsx("div",{className:"wu-grow",children:e})}),ia=g.forwardRef(({className:e,type:t,...r},s)=>a.jsx("input",{type:t,className:c("wu-flex wu-h-8 wu-w-full wu-border-b wu-border-gray-subtle wu-bg-gray-10 wu-p-2 wu-text-sm wu-font-normal wu-text-gray-lead","file:wu-border-0 file:wu-bg-gray-40 file:wu-text-gray-notification file:wu-text-sm file:wu-font-normal file:wu-relative file:wu-bottom-[3px]","wu-placeholder:wu-text-gray-subtle wu-placeholder:wu-font-light","disabled:wu-cursor-not-allowed disabled:wu-bg-gray-20 disabled:wu-border-gray-40 disabled:wu-text-gray-subtle","read-only:wu-cursor-not-allowed read-only:wu-bg-gray-20 read-only:wu-border-gray-40 read-only:wu-text-gray-subtle","focus:wu-border-blue-p focus-visible:wu-outline-none wu-transition-colors hover:wu-border-gray-40",e),ref:s,...r}));ia.displayName="Input";const Mo=e=>{const{message:t,className:r,...s}=e;return a.jsx("p",{...s,className:c("wu-text-sub-3 wu-break-words wu-font-light",r),style:{color:"rgb(var(--wu-red-deep))",...s.style},children:t})},_o=e=>{var l,i;const{inputRef:t,maxLength:r=50,className:s,...u}=e,[o,n]=f.useState(!1);return f.useEffect(()=>{var w;(((w=t==null?void 0:t.current)==null?void 0:w.value.length)||0)>.75*r?n(!0):n(!1)},[(l=t==null?void 0:t.current)==null?void 0:l.value,r]),a.jsx("p",{...u,className:c("wu-text-sub-3 wu-font-light",s),style:{color:"rgb(var(--wu-gray-subtle))",...u.style},children:o&&`${(i=t==null?void 0:t.current)==null?void 0:i.value.length}/${r}`})},Ao=Ce.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"),Dt=g.forwardRef(({className:e,...t},r)=>a.jsx(Ra.Root,{ref:r,className:c(Ao(),e),...t}));Dt.displayName=Ra.Root.displayName;const be=e=>a.jsx(Dt,{...e,className:c("wu-text-gray-lead wu-leading-6",e.className)}),Wo=({Label:e,Error:t,Hint:r,Input:s,labelPosition:u="top",dir:o="ltr",className:n,...l})=>{const w=c("wu-flex",u==="top"?"wu-flex-col wu-gap-1":"wu-flex-row wu-items-center wu-gap-2",n),d=c("wu-flex wu-flex-col wu-gap-1 wu-relative wu-flex-1 wu-form-group-wrapper"),p=c("wu-absolute -wu-bottom-5",o==="ltr"?"wu-right-0":"wu-left-0","wu-form-group-hint"),b=c("wu-absolute -wu-bottom-5",o==="ltr"?"wu-left-0":"wu-right-0","wu-form-group-error");return a.jsxs("div",{className:w,dir:o,...l,children:[e,a.jsxs("div",{className:d,children:[s,r&&a.jsx("div",{className:p,children:r}),t&&a.jsx("div",{className:b,children:t})]})]})},ze=f.forwardRef((e,t)=>{const{Label:r,labelPosition:s="top",Icon:u,iconPosition:o,type:n,value:l,variant:i="flat",readonly:w,id:d=It(),...p}=e,b=wt(s),h=u?o!=="right"?"wu-pl-8":"wu-pr-8":"",[x,m]=f.useState(!1),v=()=>{m(y=>!y)},E=y=>{p.onChange&&p.onChange(y)};return a.jsx(a.Fragment,{children:n==="submit"?a.jsx(me,{type:"submit",className:p.className,id:d,children:r||"Submit"}):a.jsx("div",{className:c("wu-flex wu-flex-col wu-gap-2 wu-input-container"),dir:p.dir,children:a.jsxs("div",{className:c("wu-flex wu-gap-1 wu-relative",b,(s==="right"||s==="left")&&"wu-items-center","wu-input-wrapper"),children:[u&&o!=="right"&&a.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}),a.jsx(ia,{...p,className:c("wu-peer wu-text-xs wu-rounded-t-sm",i==="outlined"?"wu-border wu-border-gray-subtle":"",h,p.className),type:x?"text":n,ref:t,readOnly:w,onChange:p.onChange&&E,value:l,id:d}),u&&o==="right"&&a.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"&&a.jsx("div",{className:"wu-absolute wu-right-0 wu-flex wu-items-center wu-justify-center wu-w-8 wu-h-8 wu-cursor-pointer",onClick:v,children:a.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:x?a.jsx("span",{className:"wm-visibility wu-text-gray-subtle"}):a.jsx("span",{className:"wm-visibility-off wu-text-gray-subtle"})})}),r&&a.jsx(be,{htmlFor:d,className:"wu-flex-none wu-w-fit wu-input-label",children:r})]})})})});ze.displayName="WuInput";const Po=({className:e,placeholder:t="Search surveys, folders or tools",defaultCollapsed:r=!0,onSearch:s,...u})=>{const[o,n]=f.useState(r);return f.useEffect(()=>{n(r)},[r]),a.jsx(ze,{...u,placeholder:t,onChange:l=>s(l.target.value),className:c("wu-rounded-full focus-visible:wu-outline-2 focus-visible:wu-outline-blue-focus -wu-outline-offset-2 wu-bg-white","wu-transition-all wu-duration-300 wu-ease-in-out",o?"wu-w-8 wu-px-2 wu-text-lg wu-rounded-full wu-h-8 wu-border wu-border-white wu-bg-transparent":"wu-w-40 sm:wu-w-60",e),type:"search",Icon:a.jsx(Oe,{"data-testid":"search-icon",icon:"wm-search",className:c("wu-text-gray-lead wu-cursor-pointer",o&&"wu-text-white"),onClick:()=>n(l=>!l)})})},fr=lt.Provider,pr=lt.Root,br=lt.Trigger,ca=g.forwardRef(({className:e,sideOffset:t=4,...r},s)=>a.jsx(lt.Content,{ref:s,sideOffset:t,className:c("wu-z-50 wu-overflow-hidden wu-bg-gray-notification wu-text-white wu-px-3 wu-py-1.5 wu-text-sm wu-shadow-md",e),...r}));ca.displayName=lt.Content.displayName;const Mt=f.forwardRef(({content:e,position:t,positionOffset:r,duration:s,children:u,className:o,showArrow:n=!1,open:l,onOpenChange:i,...w},d)=>a.jsx(fr,{delayDuration:s||200,children:a.jsxs(pr,{open:l,onOpenChange:i,children:[a.jsx(br,{asChild:!0,children:a.jsx("span",{ref:d,children:u})}),a.jsx(Rt.Portal,{children:e&&a.jsxs(ca,{...w,side:t||"top",sideOffset:r||0,className:c("wu-max-w-sm wu-max-h-96 wu-overflow-y-auto",o),children:[e,n&&a.jsx(Rt.Arrow,{className:"wu-fill-gray-notification wu-tooltip-arrow"})]})})]})}));Mt.displayName="WuTooltip";const Lo=({label:e,className:t})=>{const r=f.useRef(null),[s,u]=f.useState(!1);return f.useEffect(()=>{const o=r.current;if(o){const n=o.clientWidth,l=o.scrollWidth,i=l/e.length,w=e.length*i;u(w>n||l>n)}},[e]),a.jsx("p",{ref:r,className:c("wu-w-full wu-truncate",t),children:s?a.jsx(Mt,{content:e,positionOffset:8,children:e}):e})},Oo=e=>{var p;const{productName:t,categories:r=[],user:s,children:u,onLogout:o,homeLink:n=window.location.origin,brandColor:l,dir:i="ltr",expandAll:w,DataCenter:d}=e;return a.jsx("div",{className:"wu-sticky wu-top-0 wu-z-50 wu-w-full",children:a.jsxs("header",{className:c("wu-h-12 wu-flex wu-items-center wu-justify-between wu-relative wu-bg-blue-switcher wu-text-white",i==="rtl"&&"wu-flex-row-reverse",e.className),style:e.style,children:[io((p=s==null?void 0:s.profile)==null?void 0:p.subtitle)&&window.wickUiVersion&&a.jsxs("p",{className:"wu-text-[10px] wu-text-gray-subtle wu-font-normal wu-absolute wu-top-11 wu-right-1 wu-z-[-1] wu-invisible","aria-label":"wickUiVersion",children:["Wick UI: v",window.wickUiVersion]}),a.jsx("section",{className:"wu-flex wu-items-center wu-gap-2 wu-shrink-0",children:a.jsx(wr,{productCategories:r,activeProductName:t,activeProductColor:l,dir:i,homeLink:n,expandAll:w})}),a.jsx(dr,{dir:i,children:u}),a.jsxs("section",{className:c("wu-flex wu-items-center wu-justify-end wu-shrink-0 wu-gap-2",i==="rtl"?"wu-flex-row-reverse wu-pl-4":"wu-flex-row wu-pr-4"),children:[a.jsx(lr,{dir:i}),(s==null?void 0:s.profile)&&Object.keys(s.profile).length>0&&a.jsx(nr,{user:s,onLogout:o,dir:i,DataCenter:d})]})]})})},De=it.Root,Ue=it.Trigger,Se=g.forwardRef(({className:e,align:t="center",sideOffset:r=4,...s},u)=>a.jsx(it.Portal,{children:a.jsx(it.Content,{ref:u,align:t,sideOffset:r,className:c("wu-z-50 wu-w-72 wu-border wu-bg-popover wu-p-4 wu-text-popover-foreground wu-shadow-md wu-outline-none data-[state=open]:wu-animate-in data-[state=closed]:wu-animate-out data-[state=closed]:wu-fade-out-0 data-[state=open]:wu-fade-in-0 data-[state=closed]:wu-zoom-out-95 data-[state=open]:wu-zoom-in-95 data-[side=bottom]:wu-slide-in-from-top-2 data-[side=left]:wu-slide-in-from-right-2 data-[side=right]:wu-slide-in-from-left-2 data-[side=top]:wu-slide-in-from-bottom-2",e),...s})}));Se.displayName=it.Content.displayName;function gr({className:e,classNames:t,dir:r="ltr",...s}){const u=Za.getDefaultClassNames();return a.jsx(Za.DayPicker,{showOutsideDays:s.showOutsideDays||!1,className:c("wu-p-3",e),classNames:{root:c(u.root,"wu-relative wu-rounded-none wu-bg-white dark:wu-bg-gray-switcher"),caption_label:c("wu-text-xs",s.captionLayout==="dropdown"?"wu-hidden":""),month_caption:c(u.month_caption,"wu-mb-5"),months:c(u.months,"wu-flex wu-flex-col sm:wu-flex-row wu-gap-4"),dropdowns:c(u.dropdowns,"wu-flex wu-items-center wu-justify-start wu-gap-2",(s.mode==="range","")),dropdown:c(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:c(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:c(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:c(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:c(u.selected,"wu-bg-blue-p [&:not(.rm)]:wu-text-white hover:wu-bg-blue-pHover"),range_middle:c("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:c(u.range_end,"wu-rounded-none"),range_start:c(u.range_start,"wu-rounded-none wu-bg-blue-p hover:wu-bg-blue-pHover"),month_grid:c(u.month_grid,"[&>thead>tr>th]:wu-pb-2 wu-border-collapse wu-space-y-1"),button_next:c(u.button_next,la({variant:"iconOnly"}),"wu-h-6 wu-w-6 wu-text-gray-lead"),button_previous:c(u.button_previous,la({variant:"iconOnly"}),"wu-h-6 wu-w-6 wu-rotate-180 wu-text-gray-lead"),nav:c(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:c(u.chevron,"!wu-text-red-500"),outside:c(u.outside,"wu-invisible"),disabled:c(u.disabled,"hover:wu-bg-white wu-text-gray-subtle"),...t},components:{Chevron:()=>a.jsx("span",{className:"wm-chevron-right wu-text-lg wu-leading-5"})},...s})}gr.displayName="Calendar";const wa=e=>a.jsx(gr,{...e}),hr=e=>{const{handleDateChange:t,disabled:r,onReset:s,showResetButton:u}=e;return a.jsxs("div",{className:"wu-flex wu-items-center wu-justify-end wu-gap-2 wu-mt-2 wu-date-picker-footer",children:[u&&a.jsx(me,{variant:"secondary",onClick:s,Icon:a.jsx("span",{className:"wu-text-[20px] wu-leading-5 -wu-mt-[1px] wm-refresh"}),className:"wu-date-picker-footer-reset",children:"Reset"}),a.jsx(nt.PopoverClose,{asChild:!0,children:a.jsx(me,{onClick:t,disabled:r,className:"wu-date-picker-apply",children:"Apply"})})]})},da=({formattedString:e,dir:t,placeholder:r="Select Date",className:s,variant:u="primary",color:o,...n})=>a.jsx(nt.PopoverTrigger,{asChild:!0,dir:t,children:a.jsx(me,{...n,className:c("wu-justify-between wu-w-full wu-gap-2 wu-text-xs wu-border-b wu-rounded-none wu-rounded-t-sm wu-min-w-48 wu-border-gray-subtle wu-text-gray-lead wu-placeholder:wu-text-gray-subtle wu-placeholder:wu-font-light wu-bg-gray-10 hover disabled:wu-cursor-not-allowed disabled:wu-bg-gray-20 disabled:wu-border-gray-40 disabled:wu-text-subtle hover:wu-text-gray-lead hover:wu-bg-gray-10 hover:wu-border-gray-40 wu-datepicker-trigger",u==="outlined"&&"wu-border wu-border-subtle wu-bg-transparent",s),Icon:a.jsx("span",{className:"wm-calendar-month wu-text-sm"}),iconPosition:"right",children:e||r})}),mr=(e,t,r,s)=>{const u=z.startOfDay(e).getTime();return!!(t||r&&u<z.startOfDay(r).getTime()||s&&u>z.startOfDay(s).getTime())},_t=e=>e?typeof e=="string"?new Date(e):e:new Date,fa="\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01])",Fo=[{label:"Last 7 days",value:7},{label:"Last 30 days",value:30},{label:"Last 90 days",value:90},{label:"Last 365 days",value:365}],Bo=({formatString:e="yyyy-MM-dd",value:t,onChange:r,disabled:s,minDate:u=z.sub(new Date,{years:5}),maxDate:o=z.add(new Date,{years:1}),dir:n="ltr",Label:l,labelPosition:i="top",onReset:w,showResetButton:d=!1,placeholder:p="Select Date",...b})=>{const[h,x]=f.useState(),[m,v]=f.useState(""),E=f.useCallback(()=>{const C=_t(h);v(z.format(C,e)),r&&r(h)},[h,e,r]),y=f.useCallback(()=>{w?w():(x(void 0),v(""),r&&r(void 0))},[r,w]);return f.useEffect(()=>{const C=_t(t);x(C),v(z.format(C,e))},[t,e]),a.jsxs(be,{className:c("wu-flex wu-gap-1",i==="left"?"wu-items-center":"wu-flex-col wu-items-start","wu-date-picker-label"),dir:n,children:[l,a.jsxs(De,{children:[a.jsx(da,{...b,formattedString:m,dir:n,placeholder:p}),a.jsx(Se,{className:"wu-p-0 wu-w-fit wu-date-picker-content",align:"start",sideOffset:-.5,dir:n,children:a.jsx(wa,{dir:n,mode:"single",captionLayout:"dropdown",selected:h,onSelect:x,disabled:C=>mr(C,s,u,o),startMonth:u,endMonth:o,required:!0,autoFocus:!0,defaultMonth:h,className:c("wu-border wu-border-blue-p wu-date-picker"),footer:a.jsx(hr,{handleDateChange:E,disabled:s,onReset:y,showResetButton:d})})})]})]})},xr="yyyy-MM-dd",qo=[{label:"Day",value:1},{label:"Week",value:7},{label:"Month",value:30},{label:"Quarter",value:90},{label:"Year",value:365}],Vo=({current:e,onSelect:t,presetRanges:r=Fo})=>{const[s,u]=f.useState(),[o,n]=f.useState(!1),[l,i]=f.useState(""),[w,d]=f.useState(""),[p,b]=f.useState(!1),h=f.useMemo(()=>r.map(y=>y.value),[r]),x=c("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"),m=f.useCallback(y=>{if(y===void 0){u(void 0),n(!0);return}const C=Number(y)-1;u(C),n(!1),t({from:z.sub(new Date,{days:C}),to:new Date})},[t]),v=f.useCallback((y,C)=>{if(!y||!(e!=null&&e.to)||!(e!=null&&e.from)||!new RegExp(fa).test(y))return!1;const I=new Date(C==="start"?y:e.from),M=new Date(C==="end"?y:e.to);return z.isBefore(M,I)?(b(!0),!1):(b(!1),!(z.isSameDay(I,e.from)&&z.isSameDay(M,e.to)))},[e]),E=f.useCallback((y,C)=>{if((C==="start"?i:d)(y),v(y,C)){const I={from:e==null?void 0:e.from,to:e==null?void 0:e.to};C==="start"&&(I.from=new Date(y)),C==="end"&&(I.to=new Date(y)),t(I)}},[e,t,v]);return f.useEffect(()=>{if(e!=null&&e.to&&(e!=null&&e.from)&&z.isValid(e.to)&&z.isValid(e.from)){i(z.format(e.from,xr)),d(z.format(e.to,xr));const y=z.differenceInCalendarDays(e.to,e.from);z.isToday(e.to)&&h.includes(y+1)?(u(y),n(!1)):(u(void 0),n(!0))}},[e,h]),a.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:[a.jsx("ul",{className:"wu-flex wu-gap-1 wu-py-2 wu-date-picker-batch-list",children:qo.map(({label:y,value:C})=>a.jsx(Ze,{variant:"secondary",className:"wu-px-1 wu-py-1 wu-text-xs wu-h-fit wu-min-w-fit disabled:wu-bg-white",disabled:C!==1,children:y},C))}),a.jsxs("ul",{className:"wu-flex wu-flex-col wu-gap-1 wu-date-picker-ranges",children:[r.map(({label:y,value:C})=>a.jsx("li",{children:a.jsx("button",{className:c(x,s===C-1&&"wu-bg-blue-p/10"),onClick:()=>m(C),children:y})},C)),a.jsx("li",{children:a.jsx("button",{className:c(x,o&&"wu-bg-blue-p/10"),onClick:()=>m(),children:"Custom Range"})})]}),a.jsxs("div",{className:"wu-relative wu-flex wu-gap-3 wu-pt-2 wu-date-picker-range-footer",children:[a.jsx(ze,{placeholder:"Start Date",pattern:fa,value:l,onChange:y=>E(y.target.value,"start"),"aria-label":"Start Date"}),a.jsx(ze,{placeholder:"End Date",pattern:fa,value:w,onChange:y=>E(y.target.value,"end"),"aria-label":"End Date"}),p?a.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"}):a.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"})]})]})},Ho=({formatString:e="yyyy/MM/dd",value:t,onChange:r,disabled:s,minDate:u=z.sub(new Date,{years:5}),maxDate:o=z.add(new Date,{years:1}),dir:n="ltr",minDateToSelect:l,maxDateToSelect:i,presetRanges:w,Label:d,labelPosition:p="top",onReset:b,showResetButton:h=!0,placeholder:x="Select Date Range",...m})=>{const[v,E]=f.useState(t),[y,C]=f.useState(t),[N,I]=f.useState(""),M=f.useCallback(()=>{if(y){const D=y.from,F=y.to;E({from:D,to:F}),I(`${z.format(D,e)} - ${z.format(F,e)}`),r&&r({from:D,to:F})}},[y,e,r]),T=f.useCallback(()=>{C(v)},[v]),_=f.useCallback(()=>{b?b():(E(void 0),C(void 0),I(""),r&&r(void 0))},[b,r]);return f.useEffect(()=>{if(t!=null&&t.from&&(t!=null&&t.to)){const D=_t(t.from),F=_t(t.to);E(t),C(t),I(`${z.format(D,e)} - ${z.format(F,e)}`)}else E(void 0),C({to:new Date,from:new Date})},[t,e]),a.jsxs(be,{className:c("wu-flex wu-gap-1",p==="left"?"wu-items-center":"wu-flex-col wu-items-start","wu-date-picker-label"),dir:n,children:[d,a.jsxs(De,{onOpenChange:D=>!D&&T(),children:[a.jsx(da,{...m,formattedString:N,dir:n,placeholder:x}),a.jsxs(Se,{className:"wu-flex wu-p-0 wu-border wu-w-fit wu-border-blue-p",align:"start",sideOffset:-.5,dir:n,children:[a.jsx(Vo,{current:y,onSelect:C,presetRanges:w}),a.jsx(wa,{dir:n,numberOfMonths:2,mode:"range",captionLayout:"dropdown",selected:y,onSelect:C,disabled:D=>mr(D,s,u,o),startMonth:u,endMonth:o,required:!0,autoFocus:!0,defaultMonth:v==null?void 0:v.from,className:c("wu-shadow-none wu-date-range-picker"),min:l,max:i,footer:a.jsx(hr,{handleDateChange:M,disabled:s,onReset:_,showResetButton:h})})]})]})]})},yr=f.forwardRef((e,t)=>{const{className:r,rounded:s,...u}=e;return a.jsx("div",{className:c("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})});yr.displayName="WuCard";const zo=f.forwardRef((e,t)=>{const{className:r,...s}=e;return a.jsx("div",{ref:t,...s,className:c("wu-p-2 wu-mb-2 wu-border-b wu-border-gray-40 min-h-12 wu-card-header",r)})});zo.displayName="WuCardHeader";const Uo=f.forwardRef((e,t)=>{const{className:r,...s}=e;return a.jsx("div",{ref:t,...s,className:c("wu-p-2 wu-mt-2 wu-border-t wu-border-gray-40 min-h-12 wu-card-footer",r)})});Uo.displayName="WuCardHeader";const vr=g.forwardRef(({className:e,partial:t,...r},s)=>a.jsx(ea.Root,{ref:s,className:c("wu-h-4 wu-w-4 wu-shrink-0 wu-rounded-[2px] wu-bg-white wu-border wu-border-gray-subtle wu-ring-offset-background focus-visible:wu-outline-none focus-visible:wu-ring-2 focus-visible:wu-ring-ring focus-visible:wu-ring-offset-[1px] data-[state=checked]:wu-bg-blue-p data-[state=checked]:wu-text-white data-[state=checked]:wu-border-none data-[state=checked]:hover:wu-bg-blue-q hover:wu-bg-gray-20 hover:wu-border-blue-p wu-transition-all data-[state=checked]:disabled:wu-bg-gray-20","disabled:wu-cursor-not-allowed disabled:wu-opacity-50 disabled:data-[state=unchecked]:wu-bg-gray-20 disabled:hover:wu-border-gray-subtle disabled:wu-border-gray-subtle",e),...r,children:a.jsxs(ea.Indicator,{className:c("wu-flex wu-items-center wu-justify-center wu-text-current"),children:[!t&&a.jsx("span",{className:"wm-check wu-text-base wu-leading-4"}),t&&a.jsx("span",{className:"wm-check-indeterminate-small wu-text-base wu-leading-4"})]})}));vr.displayName=ea.Root.displayName;const Me=f.forwardRef((e,t)=>{const{disabled:r,checked:s,Label:u,labelPosition:o="right",className:n,id:l=It(),partial:i,onChange:w,required:d,readonly:p,...b}=e;return f.useEffect(()=>{b.defaultChecked!==void 0&&s!==void 0&&console.error("WuCheckbox: Both `checked` and `defaultChecked` cannot be used together. Use only one of them.")},[b.defaultChecked,s]),a.jsxs("div",{className:$o({labelPosition:o,className:"wu-checkbox-container"}),dir:b.dir,children:[a.jsx(vr,{id:l,...b,partial:i,checked:s,disabled:r||p,onCheckedChange:w,className:c("wu-peer wu-checkbox",n),required:d,ref:t}),u&&a.jsx(be,{htmlFor:l,className:"wu-w-full wu-checkbox-label",children:u})]})}),$o=Ce.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"}}});Me.displayName="WuCheckbox";const jo=e=>{const{className:t,children:r,...s}=e;return a.jsx("span",{...s,className:c("wu-flex wu-items-center wu-justify-center wu-truncate wu-max-w-28 wu-w-fit wu-px-2 wu-py-1 wu-text-xs wu-bg-gray-20 wu-rounded-sm hover:wu-bg-gray-40 hover:wu-text-blue-q",t),children:r})},pa=g.forwardRef(({className:e,...t},r)=>a.jsx(we.Command,{ref:r,className:c("wu-flex wu-h-full wu-w-full wu-flex-col wu-overflow-hidden wu-rounded-md",e),...t}));pa.displayName=we.Command.displayName;const Nr=g.forwardRef(({className:e,...t},r)=>a.jsx("div",{className:"wu-flex wu-items-center wu-border-b wu-px-3",children:a.jsx(we.Command.Input,{ref:r,className:c("wu-flex wu-h-11 wu-w-full wu-rounded-md wu-bg-transparent wu-py-3 wu-text-sm wu-outline-none wu-placeholder:wu-text-muted-foreground disabled:wu-cursor-not-allowed disabled:wu-opacity-50",e),...t})}));Nr.displayName=we.Command.Input.displayName;const ba=g.forwardRef(({className:e,...t},r)=>a.jsx(we.Command.List,{ref:r,className:c("",e),...t}));ba.displayName=we.Command.List.displayName;const ga=g.forwardRef((e,t)=>a.jsx(we.Command.Empty,{ref:t,className:"wu-text-center wu-p-2 wu-pb-2.5 wu-text-xs",...e}));ga.displayName=we.Command.Empty.displayName;const dt=g.forwardRef(({className:e,...t},r)=>a.jsx(we.Command.Group,{ref:r,className:c("",e),...t}));dt.displayName=we.Command.Group.displayName;const Cr=g.forwardRef(({className:e,...t},r)=>a.jsx(we.Command.Separator,{ref:r,className:c("wu-mx-1 wu-my-1 wu-h-px wu-bg-gray-20",e),...t}));Cr.displayName=we.Command.Separator.displayName;const ft=g.forwardRef(({className:e,...t},r)=>a.jsx(we.Command.Item,{ref:r,className:c("wu-relative wu-flex wu-cursor-default wu-gap-2 wu-select-none wu-items-center wu-rounded-sm wu-px-2 wu-py-3 wu-text-sm wu-outline-none data-[disabled=true]:wu-pointer-events-none data-[disabled=true]:wu-opacity-50 [&_svg]:wu-pointer-events-none [&_svg]:wu-size-4 [&_svg]:wu-shrink-0",e),...t}));ft.displayName=we.Command.Item.displayName;const et=f.forwardRef(({containerHeight:e=400,list:t,callback:r,dir:s,className:u,style:o},n)=>a.jsx(Ku.Virtuoso,{ref:n,dir:s,className:u,style:{height:e,scrollbarWidth:"thin",scrollbarColor:"#d4d4d4 #f1f1f1",overflowX:"hidden",...o},data:t,itemContent:(l,i)=>r(l,i)}));et.displayName="WuVirtualScroll";const Go=({tags:e,triggerRef:t})=>{const[r,s]=f.useState([]),[u,o]=f.useState([]),n=f.useMemo(()=>a.jsx("ul",{className:"wu-flex wu-flex-col wu-items-start wu-justify-center wu-list-none",children:u.map((i,w)=>a.jsx("li",{className:"wu-py-1 wu-text-xs wu-text-left",children:i},w))}),[u]),l=i=>{const w=document.createElement("div");Object.assign(w.style,{display:"inline-block",visibility:"hidden",position:"absolute",whiteSpace:"nowrap"}),w.textContent=i,document.body.appendChild(w);const d=w.offsetWidth;return document.body.removeChild(w),d+8};return f.useEffect(()=>{const i=()=>{if(t.current){const b=t.current.offsetWidth-20-36;let h=0;const x=[],m=[];e.forEach(v=>{const E=l(v);h+E+8<b?(x.push(v),h+=E+8):m.push(v)}),s(x),o(m)}};return i(),window.addEventListener("resize",i),()=>{window.removeEventListener("resize",i)}},[e,t]),a.jsxs("div",{className:"wu-flex wu-items-center wu-gap-2 wu-text-xs",children:[r.map((i,w)=>a.jsx("span",{className:"wu-px-1 wu-py-0.5 wu-text-xs wu-rounded-sm wu-bg-gray-10 wu-combobox-tag",children:i},w)),u.length>0&&a.jsx(Mt,{content:n,className:"wu-z-[51] wu-text-left",children:a.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]})})]})},Yo=({placeholder:e="Select...",isEllipse:t=!1,selectedOptions:r,variant:s="flat",dir:u="ltr",accessorKey:o,multiple:n,id:l,disabled:i,selectAll:w,isCheckedAll:d,className:p,...b})=>{const[h,x]=f.useState([]),m=f.useRef(null);f.useEffect(()=>{if(!r||Array.isArray(r)&&r.length===0){x([]);return}if(n){const E=r;x(E==null?void 0:E.map(y=>y[o.label]));return}else x([r[o.label]])},[r]);const v=()=>{var E;return h.length?d&&(w!=null&&w.enable)&&(w!=null&&w.triggerText)?a.jsx("span",{className:"wu-overflow-hidden wu-text-xs wu-text-start wu-text-ellipsis wu-whitespace-nowrap",children:w.triggerText}):t?a.jsx("span",{className:"wu-overflow-hidden wu-text-xs wu-text-start wu-text-ellipsis wu-whitespace-nowrap",style:{width:`${(((E=m.current)==null?void 0:E.offsetWidth)||0)-32}px`},children:h.join(", ")}):a.jsx(Go,{tags:h,triggerRef:m}):a.jsx("p",{className:"wu-text-xs wu-opacity-70",children:e})};return a.jsx(Ue,{dir:u,asChild:!0,id:l,disabled:i,children:a.jsxs("button",{...b,ref:m,disabled:i,className:c("focus-visible:wu-ring-2 focus-visible:wu-ring-blue-pHover wu-bg-white focus-visible:wu-ring-offset-2 wu-flex wu-w-full wu-items-center wu-justify-between wu-border-b wu-border-gray-subtle wu-py-1.5 wu-px-2 placeholder:wu-text-gray-40 focus:wu-outline-none disabled:wu-cursor-not-allowed disabled:wu-opacity-50 hover:wu-bg-gray-10 hover:wu-border-blue-p wu-transition-colors focus-visible:wu-bg-gray-20 focus-visible:wu-border-blue-p wu-cursor-pointer wu-text-xs wu-rounded-t-sm wu-gap-2 wu-h-8 wu-group",s==="outlined"&&"wu-border wu-border-gray-subtle","disabled:wu-cursor-not-allowed disabled:hover:wu-border-gray-subtle disabled:wu-bg-gray-10",p),children:[v(),a.jsx("span",{className:"wm-arrow-drop-down group-data-[state=open]:wu-rotate-180 wu-transition-transform wu-duration-300 wu-text-base"})]})})},Sr=X.Root,Er=X.Trigger,Tr=X.Group,Ko=X.Portal,Jo=X.Sub,Xo=X.RadioGroup,kr=g.forwardRef(({className:e,inset:t,children:r,position:s,...u},o)=>a.jsxs(X.SubTrigger,{ref:o,className:c("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",e),...u,children:[s==="left"&&a.jsx("span",{className:c("wm-chevron-right",u.dir==="rtl"&&"ml-2")}),r,s!=="left"&&a.jsx("span",{className:c("wu-text-base wu-leading-4",u.dir==="rtl"&&"wu-mr-auto wm-chevron-left",u.dir!=="rtl"&&"wu-ml-auto wm-chevron-right")})]}));kr.displayName=X.SubTrigger.displayName;const Ir=g.forwardRef(({className:e,...t},r)=>a.jsx(X.SubContent,{ref:r,className:c("wu-z-50 wu-min-w-[8rem] wu-overflow-hidden wu-border wu-text-xs wu-bg-white wu-text-gray-lead wu-shadow-lg data-[state=open]:wu-animate-in data-[state=closed]:wu-animate-out data-[state=closed]:wu-fade-out-0 data-[state=open]:wu-fade-in-0 data-[state=closed]:wu-zoom-out-95 data-[state=open]:wu-zoom-in-95 data-[side=bottom]:wu-slide-in-from-top-2 data-[side=left]:wu-slide-in-from-right-2 data-[side=right]:wu-slide-in-from-left-2 data-[side=top]:wu-slide-in-from-bottom-2",e),...t}));Ir.displayName=X.SubContent.displayName;const ha=g.forwardRef(({className:e,sideOffset:t=4,...r},s)=>a.jsx(X.Portal,{children:a.jsx(X.Content,{ref:s,sideOffset:t,className:c("wu-z-50 wu-min-w-[8rem] wu-overflow-hidden wu-border wu-text-xs wu-bg-white wu-text-gray-lead wu-shadow-md data-[state=open]:wu-animate-in data-[state=closed]:wu-animate-out data-[state=closed]:wu-fade-out-0 data-[state=open]:wu-fade-in-0 data-[state=closed]:wu-zoom-out-95 data-[state=open]:wu-zoom-in-95 data-[side=bottom]:wu-slide-in-from-top-2 data-[side=left]:wu-slide-in-from-right-2 data-[side=right]:wu-slide-in-from-left-2 data-[side=top]:wu-slide-in-from-bottom-2",e),...r})}));ha.displayName=X.Content.displayName;const At=g.forwardRef(({className:e,inset:t,...r},s)=>a.jsx(X.Item,{ref:s,className:c("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",e),...r}));At.displayName=X.Item.displayName;const Dr=g.forwardRef(({className:e,children:t,checked:r,dir:s,...u},o)=>a.jsxs(X.CheckboxItem,{ref:o,className:c("wu-group wu-relative wu-flex wu-cursor-default wu-select-none wu-items-center wu-text-xs wu-py-3 wu-outline-none wu-transition-colors focus:wu-bg-gray-20 data-[disabled]:wu-cursor-not-allowed data-[disabled]:wu-opacity-50",s==="rtl"&&"wu-pr-8 wu-pl-2",s!=="rtl"&&"wu-pl-8 wu-pr-2",e),checked:r,...u,children:[a.jsx("span",{className:c("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:a.jsx(X.ItemIndicator,{children:a.jsx("span",{className:"wm-check wu-text-base wu-text-white"})})}),t]}));Dr.displayName=X.CheckboxItem.displayName;const Mr=g.forwardRef(({className:e,children:t,...r},s)=>a.jsxs(X.RadioItem,{ref:s,className:c("wu-group wu-relative wu-flex wu-cursor-default wu-select-none wu-items-center wu-text-xs wu-py-3 wu-pl-8 wu-pr-2 wu-outline-none wu-transition-colors focus:wu-bg-gray-20 focus:wu-text-accent-foreground data-[disabled]:wu-cursor-not-allowed data-[disabled]:wu-opacity-50",e),...r,children:[a.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:a.jsx(X.ItemIndicator,{className:"wu-w-4 wu-h-4 wu-flex wu-items-center wu-justify-center",children:a.jsx("span",{className:"wm-circle wu-text-blue-p group-hover:group-data-[state=checked]:wu-text-blue-q wu-text-xs"})})}),t]}));Mr.displayName=X.RadioItem.displayName;const pt=g.forwardRef(({className:e,inset:t,...r},s)=>a.jsx(X.Label,{ref:s,className:c("wu-p-2 wu-font-medium wu-text-xs",t&&"wu-pl-8",e),...r}));pt.displayName=X.Label.displayName;const Wt=g.forwardRef(({className:e,...t},r)=>a.jsx(X.Separator,{ref:r,className:c("-wu-mx-1 wu-my-1 wu-h-px wu-bg-gray-20",e),...t}));Wt.displayName=X.Separator.displayName;const _r=({option:e,value:t,multiple:r=!1,onSelect:s,accessorKey:u,dir:o})=>{const[n,l]=f.useState(r?[]:"");f.useEffect(()=>{t&&l(r?t.map(p=>JSON.stringify(p[u.value])):JSON.stringify(t[u.value]))},[t,u.value,r]);const i=r?n.includes(JSON.stringify(e[u.value])):n===JSON.stringify(e[u.value]),w=()=>{e.disabled||s(e)};return a.jsxs(ft,{onSelect:w,disabled:e.disabled,className:c("wu-cursor-pointer wu-text-xs wu-items-start wu-leading-4 wu-py-2 wu-combobox-item hover:wu-bg-gray-100",i&&"wu-bg-gray-10"),dir:o,children:[r&&a.jsx(Me,{checked:i}),a.jsx(Qo,{option:e,accessorKey:u})]})},Qo=({option:e,accessorKey:t})=>{const r=e[t.label];return a.jsxs("div",{className:"wu-flex wu-items-center wu-w-full wu-gap-1",children:[e.icon&&e.icon,r,e.isAdmin&&a.jsx("span",{className:"wu-ml-auto wu-text-sm wm-lock wu-text-orange-deep"})]})},Ar=e=>{const{option:t,selectAll:r,handleSelectAll:s,isCheckedAll:u,isPartialSelected:o,...n}=e;switch("type"in t?t.type:"option"){case"all":return a.jsx(ft,{onSelect:s,className:c("wu-cursor-pointer wu-text-xs wu-leading-4 wu-py-2 wu-combobox-item"),dir:n.dir,children:a.jsx(Me,{checked:u||o,partial:o,"data-partial":o,Label:(r==null?void 0:r.label)||"Select All"})});case"group":return a.jsxs(dt,{children:[a.jsx(pt,{children:t.label}),t.options.map((i,w)=>f.createElement(_r,{...n,option:i,key:w}))]});case"divider":return a.jsx(Cr,{className:"wu-mx-4"});default:return a.jsx(_r,{...n,option:t})}},Zo=e=>{const t=[],r=[],s=[],u=[];return e.forEach(o=>{o.type==="group"?(t.push(o),s.push(...o.options),u.push(...o.options.filter(n=>!n.disabled))):o.type==="divider"?r.push(o):s.push(o),o!=null&&o.disabled||u.push(o)}),{groups:t,dividers:r,allOptions:s,enabledOptions:u}},Ro=f.memo(ze),en=({data:e,accessorKey:t,value:r,defaultValue:s,Header:u,virtualizedThreshold:o=100,isEllipse:n,placeholder:l,variant:i,dir:w,onSelect:d,Label:p,maxHeight:b=420,multiple:h=!1,hasGroup:x=!1,selectAll:m,id:v,disabled:E,labelPosition:y="top",className:C,onScroll:N,maxContentWidth:I,...M})=>{const[T,_]=f.useState(""),[D,F]=f.useState(),[O,P]=f.useState(!1),[A,L]=f.useState(!1),[q,W]=f.useState(!1),$=f.useRef(null),{allOptions:H,groups:Q,dividers:ae,enabledOptions:le}=f.useMemo(()=>x||m&&!m.includeDisabled?Zo(e):{allOptions:e,groups:[],dividers:[],enabledOptions:[]},[e,x]),ee=f.useMemo(()=>{if(!T)return e;const k=T.toLowerCase();return H.filter(V=>V[t.label].toLowerCase().includes(k))},[T,H,e,t.label]),B=f.useMemo(()=>h&&m!=null&&m.enable&&!T&&ee.length>0?[{type:"all"},...ee]:ee,[ee,T,h]),K=f.useMemo(()=>{const k=32*B.length+ae.length*9+Q.length*48;return Math.min(b,k)},[b,B,ae,Q]),Z=f.useCallback(k=>{const V=k[t.value];h?F(ne=>{const U=ne||[],te=U.some(de=>de[t.value]===V)?U.filter(de=>de[t.value]!==V):[...U,k];return d==null||d(te),te}):(P(!1),F(k),d==null||d(k))},[h,t.value,d]),j=f.useCallback(k=>_(k.target.value),[]),Ee=f.useCallback(()=>_(""),[]);f.useEffect(()=>{if(r!==void 0&&s!==void 0){console.error("defaultValue and value cannot be used simultaneously");return}else r!==void 0?F(r):s!==void 0&&F(s)},[r,s]),f.useEffect(()=>{if(!h)return;const k=m!=null&&m.includeDisabled?(D==null?void 0:D.length)===H.length:(D==null?void 0:D.length)===le.length;L(k);const V=(D==null?void 0:D.length)>0&&!k;W(V)},[D,m]);const Te=f.useCallback(()=>{const k=A?[]:m!=null&&m.includeDisabled?H:le;F(k),d==null||d(k)},[A,h,H,le,d,m]),ye=wt(y);return a.jsxs("div",{className:c(ye,"wu-flex wu-combobox-container"),ref:$,children:[a.jsxs(De,{onOpenChange:k=>{k&&Ee(),P(k)},open:O,modal:!0,children:[a.jsx(Yo,{...M,selectedOptions:D,accessorKey:t,isEllipse:n,placeholder:l,variant:i,dir:w,multiple:h,disabled:E,selectAll:m,isCheckedAll:A,className:C,id:v}),a.jsx(Se,{className:"wu-min-w-[--radix-popover-trigger-width] wu-max-w-[calc(100vw-32px)] wu-p-0 wu-bg-white wu-border wu-border-blue-p wu-combobox-content",align:"start",sideOffset:-1,style:{maxWidth:I},children:a.jsxs(pa,{id:v,children:[a.jsx("div",{className:"wu-m-2",children:a.jsx(Ro,{placeholder:"Search...",Icon:a.jsx("span",{className:"wm-search"}),className:"wu-text-xs wu-combobox-search",onChange:j,name:"Search","aria-label":"Search",dir:w,iconPosition:w==="rtl"?"right":"left"})}),u,a.jsxs(ba,{children:[a.jsx(ga,{children:"No results found."}),B.length>=o?a.jsx(et,{className:"wu-combobox-list",containerHeight:b,list:B,callback:(k,V)=>a.jsx(Ar,{option:V,value:D,onSelect:Z,multiple:h,accessorKey:t,dir:w,selectAll:m,handleSelectAll:Te,isCheckedAll:A,isPartialSelected:q},k),dir:w}):a.jsx("div",{style:{maxHeight:K,height:"fit-content",overflow:"auto"},className:"wu-combobox-list",onScroll:N,children:B.map((k,V)=>a.jsx(Ar,{option:k,value:D,onSelect:Z,multiple:h,accessorKey:t,dir:w,selectAll:m,handleSelectAll:Te,isCheckedAll:A,isPartialSelected:q},V))})]})]})})]}),p&&a.jsx(be,{htmlFor:v,className:"wu-combobox-label",children:p})]})},tn=e=>{const{textToCopy:t,notificationText:r,...s}=e,[u,o]=f.useState(!1),n=async()=>{if(t)try{await navigator.clipboard.writeText(t),o(!0),setTimeout(()=>o(!1),2e3)}catch(l){console.error("Failed to copy:",l)}};return a.jsxs(me,{...s,onClick:n,variant:"iconOnly",className:c("wu-relative",e.className),"aria-label":"Copy to clipboard",children:[r&&a.jsx("span",{className:c("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}),a.jsx(Oe,{icon:"wm-content-copy",className:"wu-text-lg"})]})},Wr=Y.Root,an=Y.Trigger,rn=Y.Close,sn=Y.Portal,Pr=g.forwardRef(({className:e,...t},r)=>a.jsx(Y.Overlay,{className:c("wu-fixed wu-inset-0 wu-z-50 wu-bg-black/30 data-[state=open]:wu-animate-in data-[state=closed]:wu-animate-out data-[state=closed]:wu-fade-out-0 data-[state=open]:wu-fade-in-0",e,"wu-drawer-overlay"),...t,ref:r}));Pr.displayName=Y.Overlay.displayName;const un=Ce.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"}}),ma=g.forwardRef(({side:e="right",className:t,children:r,hideCloseButton:s,...u},o)=>a.jsxs(sn,{children:[a.jsx(Pr,{}),a.jsxs(Y.Content,{ref:o,className:c(un({side:e}),t),...u,children:[r,!s&&a.jsx(Y.Close,{"aria-label":"close",asChild:!0,children:a.jsxs(Ze,{variant:"iconOnly",className:"wu-absolute wu-right-4 wu-top-4",children:[a.jsx("span",{className:"wm-close"}),a.jsx("span",{className:"wu-sr-only",children:"Close"})]})})]})]}));ma.displayName=Y.Content.displayName;const Lr=({className:e,...t})=>a.jsx("div",{className:c("",e),...t});Lr.displayName="SheetHeader";const xa=g.forwardRef(({className:e,...t},r)=>a.jsx(Y.Title,{ref:r,className:c("wu-text-lg wu-font-semibold",e),...t}));xa.displayName=Y.Title.displayName;const Or=g.forwardRef(({className:e,...t},r)=>a.jsx(Y.Description,{ref:r,className:c("wu-text-sm",e),...t}));Or.displayName=Y.Description.displayName;const on=e=>t=>{e&&t.preventDefault()},nn=e=>{const{Trigger:t,children:r,hideCloseButton:s,className:u,side:o="left",open:n,onOpenChange:l,preventClickOutside:i,...w}=e;return a.jsxs(Wr,{open:n,onOpenChange:l,children:[a.jsx(an,{asChild:!0,children:t}),a.jsxs(ma,{...w,onInteractOutside:on(i),side:o,className:c("wu-bg-white wu-text-gray-lead wu-px-0",u),hideCloseButton:s,children:[a.jsx("div",{className:"wu-hidden",children:a.jsx(xa,{})}),r]})]})},ln=({children:e,...t})=>a.jsx(rn,{...t,children:e}),Fr=({className:e,isLoading:t,loadingText:r,children:s,...u})=>a.jsxs("footer",{className:c("wu-flex wu-items-center wu-justify-between wu-gap-2 wu-border-t wu-border-gray-10 wu-py-3 wu-px-4 wu-bg-white/80 wu-backdrop-blur-sm wu-text-xs wu-font-normal wu-text-gray-footer wu-sticky wu-bottom-0",e),...u,children:[a.jsx("div",{className:"wu-flex-1",children:s}),t&&a.jsx(Re,{size:"16px",variant:"spinner",color:"#a3a3a3",message:r})]});Fr.displayName="WuFooter";const Br=f.forwardRef((e,t)=>{const{size:r="sm",idOrSlugOrUrl:s,variant:u="primary",...o}=e,n=r==="sm"?16:18,l=s.includes("http")?s:`/help/${s}.html`,i=u==="primary"?"wu-text-blue-p":"wu-text-gray-lead";return a.jsx("button",{...o,ref:t,onClick:()=>aa(l),children:a.jsx("span",{className:c("wm-help wu-text-gray-subtle",`wu-text-[${n}px]`,i,o.disabled&&"wu-text-neutral-300","wu-help-button-icon")})})});Br.displayName="WuHelpButton";const Fe=(e,t)=>`wu-listbox-${e}`;function cn(e){const{option:t,accessorKey:r,onSelect:s,multiple:u,dir:o,GroupLabel:n,Item:l,isSelected:i,...w}=e,d=r.group&&Array.isArray(t[r.group]),p=({item:b,className:h})=>f.createElement(ft,{...w,key:JSON.stringify(b),onSelect:()=>s==null?void 0:s(b),value:t[r.value],className:c("data-[selected='true']:wu-bg-gray-100 wu-cursor-pointer wu-text-xs wu-min-h-8 wu-py-0 hover:wu-bg-gray-100",!!(i!=null&&i(b))&&!u&&"wu-bg-blue-p/10",o==="rtl"&&"wu-justify-end",h,Fe("item")),disabled:b.disabled},u&&a.jsx(Me,{checked:i==null?void 0:i(b)}),l?l({value:b,isSelected:i==null?void 0:i(b)}):a.jsx(a.Fragment,{children:b[r.label]}));if(d){const b=t[r.group],h=typeof n=="string"?t[n]:n==null?void 0:n(t);return a.jsx(dt,{heading:h,children:b==null?void 0:b.map(x=>a.jsx(p,{item:x,className:"wu-pl-6"},JSON.stringify(x)))})}return a.jsx(p,{item:t})}const wn=f.memo(cn),dn=e=>{const{className:t,...r}=e;return a.jsxs("div",{className:"wu-relative",children:[a.jsx(Oe,{icon:"wm-search",className:"wu-absolute wu-top-[14px] wu-left-5"}),a.jsx(Nr,{...r,"aria-label":"Search",className:c("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;",Fe("input"),t)})]})},fn=e=>{const{label:t,onSelectAll:r,data:s,value:u}=e,[o,n]=f.useState(!1),[l,i]=f.useState(!1);return f.useEffect(()=>{!u||!s||(n(u.length>0),i(u.length>0&&u.length<s.length))},[s,u]),a.jsxs(ft,{className:"data-[selected='true']:wu-bg-gray-100 wu-cursor-pointer wu-text-xs wu-min-h-8 wu-py-0 hover:wu-bg-gray-100",onSelect:()=>r==null?void 0:r(!o),children:[a.jsx(Me,{checked:o,partial:l}),t||"Select All"]})},pn=e=>{const{CustomTrigger:t,disabled:r,value:s,placeholder:u,accessorKey:o,Chip:n,handleUnselect:l,variant:i,dir:w,className:d,...p}=e,[b,h]=f.useState(),x=f.useRef(null);return f.useEffect(()=>{if(!s){h(null);return}h(Array.isArray(s)?n?s.map((v,E)=>n({value:v,unselect:l,key:E})):s.map(v=>v[o.label]).join(", "):n?n({value:s,unselect:l}):s[o.label])},[s,n,o.label,h]),a.jsx(Ue,{asChild:!0,id:e.id,disabled:r,ref:x,children:(t==null?void 0:t(s))||a.jsxs("button",{...p,className:c("wu-group wu-relative wu-min-h-8 wu-text-xs wu-border-gray-subtle wu-bg-gray-10 wu-p-1 wu-pl-2 rtl:wu-pr-2 wu-border-b wu-w-full wu-text-left wu-pr-5 rtl:wu-pl-5","hover:wu-border-blue-p","disabled:wu-cursor-not-allowed disabled:wu-bg-gray-20 disabled:wu-border-gray-40 disabled:wu-text-gray-subtle","rtl:wu-text-right",i==="outlined"&&"wu-border wu-border-gray-subtle wu-bg-white",d,Fe("trigger")),children:[a.jsx("div",{className:c("wu-truncate",n&&"wu-flex wu-items-center wu-gap-1 wu-flex-wrap",!b&&"wu-font-light"),children:b||u}),a.jsx(Oe,{icon:"wm-arrow-drop-down",className:c("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",w==="rtl"?"wu-left-1":"wu-right-1",Fe("drop-icon"))})]})})},qr=(e,t,r)=>{const s=String(e[r.label]??"").toLowerCase(),u=String(e[r.value]??"").toLowerCase();return s.includes(t)||u.includes(t)},bn=(e,t,r)=>{const s=t.trim();if(s==="")return e;const u=s.toLowerCase(),o=[];for(const n of e){const l=r.group,i=l?n[l]:void 0;if(Array.isArray(i)){const w=i.filter(d=>qr(d,u,r));w.length>0&&o.push({...n,[l]:w})}else qr(n,u,r)&&o.push(n)}return o},gn=e=>{const{data:t,accessorKey:r,value:s,Item:u,Label:o,GroupLabel:n,CustomHeader:l,CustomTrigger:i,NoDataContent:w,Chip:d,onSelect:p,onScroll:b,disabled:h,multiple:x,searchable:m,selectAll:v,virtualizedThreshold:E=100,id:y,dir:C,className:N,listClass:I,placeholder:M="Select items...",variant:T,labelPosition:_="top",maxContentWidth:D,maxContentHeight:F}=e,[O,P]=f.useState(!1),[A,L]=f.useState(""),[q,W]=f.useState(s),$=f.useMemo(()=>r,[r]),H=f.useMemo(()=>{if(!m||!A)return t;const B=A.toLowerCase().trim();return bn(t,B,r)},[t,A,r.label,m]),Q=B=>{x?W(K=>{const Z=B[r.value],j=Array.isArray(K)?K:[],Te=j.some(ye=>ye[r.value]===Z)?j.filter(ye=>ye[r.value]!==Z):[...j,B];return p&&p(Te),Te}):(W(B),p&&p(B),P(!1))},ae=f.useCallback(B=>{const K=B?t:[];W(K),v!=null&&v.onSelectAll&&v.onSelectAll(B),p&&p(K)},[t,v,p]),le=B=>Array.isArray(q)?q.some(K=>K[r.value]===B[r.value]):(q==null?void 0:q[r.value])===B[r.value];f.useEffect(()=>{W(s)},[s]);const ee=B=>{const K=Z=>a.jsx(wn,{option:Z,accessorKey:$,multiple:x,onSelect:j=>Q(j),dir:C,GroupLabel:n,Item:u,isSelected:j=>le(j)},JSON.stringify(Z));return B.length>E?a.jsx(et,{list:B,callback:(Z,j)=>K(j),dir:C}):B.map(K)};return a.jsxs("div",{className:c("wu-flex wu-text-sm wu-gap-2",_==="top"&&"wu-flex-col wu-gap-1",_==="left"&&"wu-flex-row",_==="right"&&"wu-flex-row-reverse",Fe("container")),dir:C,children:[o&&a.jsx(be,{htmlFor:y,className:Fe("label"),children:o}),a.jsxs(De,{open:O,onOpenChange:B=>{P(B),B||setTimeout(()=>{L("")},100)},children:[a.jsx(pn,{CustomTrigger:i,disabled:h,value:q,accessorKey:r,placeholder:M,Chip:d,className:N,handleUnselect:Q,variant:T,id:y,dir:C}),a.jsx(Se,{className:c("wu-min-w-[--radix-popover-trigger-width] wu-max-w-[calc(100vw-32px)] wu-p-0 wu-bg-white wu-border wu-border-blue-p",Fe("content")),align:"start",sideOffset:-1,style:{maxWidth:D},children:a.jsxs(pa,{id:e.id,shouldFilter:!1,children:[m&&a.jsx(dn,{value:A,onValueChange:L}),l,a.jsxs(ba,{className:c("wu-overflow-y-auto",Fe("list"),I),onScroll:b,style:{maxHeight:F||"420px"},children:[a.jsx(ga,{children:w||"No results found."}),a.jsx(dt,{children:x&&(v==null?void 0:v.enabled)&&!A&&a.jsx(fn,{data:t,value:q,onSelectAll:ae,label:v.label})}),a.jsx(dt,{children:ee(H)})]})]})})]})]})},hn=e=>{const{checked:t,onSelect:r,children:s,disabled:u,preventCloseOnSelect:o}=e;return a.jsx(Dr,{disabled:u,checked:t,onCheckedChange:r,onSelect:n=>o&&n.preventDefault(),children:s})},ya=e=>{const{children:t,className:r,Icon:s,iconPosition:u="left",disabled:o,onSelect:n,preventCloseOnSelect:l}=e,i=c("wu-flex wu-items-center wu-gap-2",s&&(u==="left"?"":"wu-justify-between wu-flex-row-reverse"),r),w=d=>{n&&n(d),l&&d.preventDefault()};return a.jsxs(At,{onSelect:w,disabled:o,className:i,children:[s&&a.jsx("div",{className:"wu-text-base",children:s}),t]})},mn=e=>{const{children:t,...r}=e;return a.jsxs(Tr,{...r,children:[a.jsx(pt,{children:e.label}),t]})},xn=e=>{const{options:t,value:r,onSelect:s}=e;return a.jsx(Xo,{value:r,onValueChange:s,children:t.map(u=>a.jsx(Mr,{value:u.value,disabled:u.disabled,children:u.label},u.value))})},yn=e=>{const{className:t,...r}=e,s=c("wu-w-11/12 wu-mx-auto wu-border-gray-40",t);return a.jsx(Wt,{...r,className:s})},tt=g.forwardRef(({className:e,children:t,thumbColor:r,railColor:s,...u},o)=>a.jsxs(Ve.Root,{ref:o,className:c("wu-relative wu-overflow-hidden",e),children:[a.jsx(Ve.Viewport,{className:"wu-h-full wu-w-full wu-rounded-[inherit]",...u,children:t}),a.jsx(va,{thumbColor:r,railColor:s}),a.jsx(Ve.Corner,{})]}));tt.displayName=Ve.Root.displayName;const va=g.forwardRef(({className:e,orientation:t="vertical",thumbColor:r="#d4d4d4",railColor:s="#eeeeee",...u},o)=>a.jsx(Ve.ScrollAreaScrollbar,{ref:o,orientation:t,className:c("wu-flex wu-touch-none wu-select-none wu-transition-colors",t==="vertical"&&"wu-h-full wu-w-2 wu-border-l wu-border-l-transparent wu-p-[1px]",t==="horizontal"&&"wu-h-2 wu-flex-col wu-border-t wu-border-t-transparent wu-p-[1px]",e),style:{background:s},...u,children:a.jsx(Ve.ScrollAreaThumb,{className:"wu-relative wu-flex-1 wu-rounded-full",style:{background:r}})}));va.displayName=Ve.ScrollAreaScrollbar.displayName;const vn=e=>{const{children:t,label:r,open:s,onOpenChange:u,height:o,dir:n,...l}=e;return a.jsxs(Jo,{...l,open:s,onOpenChange:u,children:[a.jsx(kr,{dir:n,children:r}),a.jsx(Ko,{children:a.jsx(Ir,{onInteractOutside:i=>i.preventDefault(),children:a.jsx(tt,{className:"wu-h-fit",style:{height:o},dir:n,children:t})})})]})},Nn="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",Vr=e=>{const{children:t,menuTitle:r,variant:s="flat",name:u,open:o,onOpenChange:n,height:l,preventCloseOnClickOutside:i,dir:w,Trigger:d,align:p="start",sideOffset:b=0,side:h="bottom",alignOffset:x,className:m,disabled:v,...E}=e;return a.jsxs(Sr,{...E,open:o,onOpenChange:n,dir:w,children:[a.jsx(Er,{asChild:!0,dir:w,disabled:v,className:c("disabled:wu-text-zinc-300 disabled:wu-bg-white disabled:wu-cursor-not-allowed disabled:hover:wu-bg-transparent"),children:d??Cn(s,u,v)}),a.jsx(ha,{className:c("wu-w-56 wu-border wu-border-blue-p disabled:wu-border-gray-40",m,"wu-menu-content"),align:p,sideOffset:b,side:h,alignOffset:x,onInteractOutside:y=>i&&y.preventDefault(),children:a.jsxs(tt,{className:"h-fit",style:{height:l},dir:w,children:[r&&a.jsxs(a.Fragment,{children:[a.jsx(pt,{dir:w,className:"wu-menu-title",children:r}),a.jsx(Wt,{className:"wu-mt-0 wu-menu-separator",dir:w})]}),t??a.jsx("p",{children:"Menu Is Empty"})]})})]})},Cn=(e,t,r)=>{const s=c(Nn,"wu-flex wu-items-center wu-justify-between wu-gap-2 wu-h-8 wu-text-xs wu-group",e==="outlined"?"wu-border":"wu-border-b","wu-trigger-btn");return a.jsxs("button",{className:s,"aria-label":"menu-trigger",children:[a.jsx("span",{children:t??"Menu"}),a.jsx("span",{className:c("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")})]})},Na=f.forwardRef(({showMenu:e=!1,className:t,color:r="#1B3380",...s},u)=>{const o=c("wu-w-full wu-border wu-transition-all wu-duration-300");return a.jsxs("div",{...s,className:c("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:[a.jsx("div",{className:`${o} wu-origin-center ${e?"wu-rotate-45 wu-translate-y-[5px]":""}`,style:{borderColor:r}}),a.jsx("div",{className:`${o} ${e?"wu-opacity-0":""}`,style:{borderColor:r}}),a.jsx("div",{className:`${o} wu-origin-center ${e?"-wu-rotate-45 -wu-translate-y-[5px]":""}`,style:{borderColor:r}})]})});Na.displayName="WuMenuIcon";const Hr={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%]"},Sn=Y.Root,En=Y.Trigger,Tn=Y.Portal,kn=Y.Close,zr=f.forwardRef(({className:e,...t},r)=>a.jsx(Y.Overlay,{ref:r,className:c("wu-fixed wu-inset-0 wu-z-50 wu-bg-black/30",Hr.overlay,e),...t}));zr.displayName=Y.Overlay.displayName;const Ur=f.forwardRef(({className:e,children:t,hideCloseButton:r,...s},u)=>a.jsxs(Tn,{children:[a.jsx(zr,{}),a.jsxs(Y.Content,{ref:u,className:c("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",Hr.content,e),...s,children:[t,!r&&a.jsx(Y.Close,{"aria-label":"close",asChild:!0,children:a.jsxs(Ze,{variant:"iconOnly",className:c("wu-absolute wu-right-2 wu-top-1 hover:wu-bg-black hover:wu-bg-opacity-[0.04]","wuexp:wu-top-3 wuexp:wu-right-4 wuexp:wu-p-1.5","wuexp:group-data-[variant=action]:wu-text-blue-q","wuexp:group-data-[variant=upgrade]:wu-text-yellow-deep","wuexp:group-data-[variant=critical]:wu-text-red-deep"),children:[a.jsx("span",{className:"wu-text-lg wm-close wuexp:wu-text-xl wuexp:wu-leading-5"}),a.jsx("span",{className:"wu-sr-only",children:"Close"})]})})]})]}));Ur.displayName=Y.Content.displayName;const $r=({className:e,...t})=>a.jsx("div",{className:c("wu-text-center wu-bg-gray-20 wu-w-full",e),...t});$r.displayName="DialogHeader";const jr=({className:e,...t})=>a.jsx("div",{className:c("wu-flex wu-flex-col-reverse sm:wu-flex-row sm:wu-justify-end sm:wu-space-x-2 wu-p-4",e),...t});jr.displayName="DialogFooter";const Gr=f.forwardRef(({className:e,...t},r)=>a.jsx(Y.Title,{ref:r,className:c("wu-text-lg wu-font-medium wu-flex wu-items-center wu-justify-center wu-gap-1 wu-h-10 wu-leading-none wu-tracking-tight",e),...t}));Gr.displayName=Y.Title.displayName;const In=f.forwardRef(({className:e,...t},r)=>a.jsx(Y.Description,{ref:r,className:c("wu-text-sm wu-text-muted-foreground",e),...t}));In.displayName=Y.Description.displayName;const Dn={gradientBackground:"_gradientBackground_1bbet_1"},Yr=e=>{const{colors:t,size:r=.55,children:s,className:u,strokeWidth:o,centerOffset:n={x:0,y:0},...l}=e,i=f.useRef(null);return f.useEffect(()=>{const w=i.current;if(w){w.style.setProperty("--width",`${w.offsetWidth*r}px`),w.style.setProperty("--height",`${w.offsetHeight*r}px`),w.style.setProperty("--colors",t.join(",")),w.style.setProperty("--stroke-width",`-${o||2}px`),w.style.setProperty("--spotlight-background","radial-gradient(100% var(--height) ellipse at 25% 70%, var(--colors))");let p;const b=h=>{p&&cancelAnimationFrame(p),p=requestAnimationFrame(()=>{const x=w.getBoundingClientRect();let m=h.clientX-x.left,v=h.clientY-x.top;m=Math.max(0,Math.min(m+n.x,x.width)),v=Math.max(0,Math.min(v+n.y,x.height));const E=`radial-gradient(
|
|
2
|
+
var(--width) var(--height) ellipse at ${m}px ${v}px,
|
|
3
3
|
var(--colors)
|
|
4
|
-
)`;c.style.setProperty("--spotlight-background",S)})};return window.addEventListener("mousemove",h),()=>{window.removeEventListener("mousemove",h),p&&cancelAnimationFrame(p)}}},[a,r,o,l]),t.jsx("div",{ref:i,className:n(Nu.gradientBackground,"wu-transform-gpu",u),...w,children:s})},Ea="600px",Cu={sm:"400px",md:"600px",lg:"1200px"},Su=({Trigger:e,children:a,size:r="md",hideCloseButton:s,preventClickOutside:u,onOpenChange:o,open:l,dir:w,maxWidth:i,maxHeight:c,className:f,style:p,variant:h="action",...m})=>{const g={action:["#1D50F4c0 84%","#EEF3FBc0"],upgrade:["#FF9F00c0 84%","#FDEDCCc0"],critical:["#CC0000c0 84%","#FFB6B6c0"]};return t.jsxs(gu,{modal:!0,onOpenChange:o,open:l,children:[e&&t.jsx(mu,{asChild:!0,children:e}),t.jsxs(Ta,{style:{width:"calc(100% - 64px)",maxWidth:i||Cu[r],maxHeight:c||Ea,...p},hideCloseButton:s,onInteractOutside:b=>u&&b.preventDefault(),dir:w,"aria-describedby":void 0,"data-variant":h,className:n("wu-group wuexp:wu-rounded-2xl",f),...m,children:["data-theme"in m&&t.jsx(Wa,{colors:g[h],strokeWidth:4,className:n("wuexp:wu-rounded-2xl wuexp:wu-text-wuexp-gray-lead wu-transform-gpu wu-flex wu-flex-col",f),style:{maxHeight:c||Ea},children:a}),!("data-theme"in m)&&a]})]})},ku=({children:e,style:a={},...r})=>t.jsx("div",{className:n("wu-flex wu-flex-col wu-gap-4 wu-px-3 wu-py-4 rtl:wu-text-right wu-overflow-auto wu-bg-white","wuexp:wu-p-8"),children:t.jsx("div",{...r,style:{...a,paddingLeft:`${(Number(a==null?void 0:a.paddingLeft)||0)+4}px`,paddingRight:`${(Number(a==null?void 0:a.paddingRight)||0)+4}px`},children:e})}),Tu=({children:e,className:a,...r})=>t.jsx(Da,{...r,"data-variant":"action",className:n("wu-text-lg wu-text-gray-lead wu-font-medium","wuexp:wu-rounded-t-xl wuexp:wu-px-4 wuexp:wu-py-[15px]","wuexp:group-data-[variant=action]:wu-bg-blue-sidebar wuexp:group-data-[variant=action]:wu-text-blue-q","wuexp:group-data-[variant=critical]:wu-bg-[#F9E0E0] wuexp:group-data-[variant=critical]:wu-text-red-deep","wuexp:group-data-[variant=upgrade]:wu-bg-[#FEF1D9] wuexp:group-data-[variant=upgrade]:wu-text-yellow-deep",a),children:t.jsx(Ia,{className:"wuexp:wu-font-normal wuexp:wu-justify-start wuexp:wu-text-[28px] wuexp:wu-h-auto wuexp:wu-leading-[34px]",children:e})}),Du=({children:e,className:a,...r})=>t.jsx(Ma,{...r,className:n("wu-border-t wu-border-gray-40 wu-bg-white wu-min-h-16 wu-mx-4 wu-px-0","wuexp:wu-mx-0 wuexp:wu-rounded-b-xl wuexp:wu-min-h-16 wuexp:wu-p-4","wuexp:group-data-[variant=upgrade]:wu-border-[#EED6A8]","wuexp:group-data-[variant=action]:wu-border-[#BAC9F8]","wuexp:group-data-[variant=critical]:wu-border-[#F0B3B3]",a),children:e}),Mu=({children:e,className:a,...r})=>{const s=d.useRef(null);return t.jsx(yu,{asChild:!0,children:t.jsx(V,{className:a,ref:s,...r,children:e})})},Iu=({placeholder:e="Select...",value:a,multiple:r=!1,accessorKey:s,variant:u="flat",dir:o="ltr",customTriggerChildren:l,id:w,disabled:i,selectAll:c,isCheckedAll:f,width:p,...h})=>{const[m,g]=d.useState(""),[b,v]=d.useState(e);d.useEffect(()=>{if(!a||Array.isArray(a)&&a.length===0){v(e),g("");return}const y=s.label;if(r&&Array.isArray(a)){const C=a.map(D=>D[y]).join(", ");g(C)}else!r&&!Array.isArray(a)&&g(a[y])},[a,s.label,r,e]);const S=()=>e&&!m?t.jsx("p",{className:"wu-text-xs wu-opacity-70",children:b}):t.jsx("span",{className:n("wu-overflow-hidden wu-text-xs wu-text-start wu-text-ellipsis wu-whitespace-nowrap"),style:{width:`${(p||0)-32}px`},children:f?(c==null?void 0:c.triggerText)??m:m});return t.jsx(na,{asChild:!0,dir:o,id:w,disabled:i,children:t.jsxs("button",{...h,disabled:i,className:n("wu-flex wu-gap-2 wu-w-full wu-items-center wu-justify-between wu-py-1.5 wu-px-2 wu-text-xs wu-transition-colors wu-cursor-pointer wu-border-b wu-bg-white wu-border-gray-subtle wu-h-8","focus:wu-outline-none focus-visible:wu-border-blue-p/80 wu-rounded-t-sm","disabled:wu-cursor-not-allowed disabled:hover:wu-border-gray-subtle disabled:wu-bg-gray-10 disabled:wu-opacity-50","hover:wu-bg-gray-10 hover:wu-border-blue-p",u==="outlined"&&"wu-border wu-border-gray-subtle","wu-group wu-select-trigger",h.className),children:[l??S(),t.jsx("span",{className:"wm-arrow-drop-down group-data-[state=open]:wu-rotate-180 wu-transition-transform wu-duration-300 wu-text-base"})]})})},_a=({option:e,value:a,multiple:r=!1,onSelect:s,accessorKey:u,dir:o="ltr"})=>{const[l,w]=d.useState(r?[]:"");d.useEffect(()=>{a&&w(r?a.map(p=>JSON.stringify(p[u.value])):JSON.stringify(a[u.value]))},[a,u.value,r]);const i=r?l.includes(JSON.stringify(e[u.value])):l===JSON.stringify(e[u.value]),c=f=>{e.disabled||(s(e),r&&f.preventDefault())};return t.jsxs($e,{onClick:c,disabled:e.disabled,className:n("wu-cursor-pointer wu-text-xs wu-py-2 wu-leading-4 wu-select-item wu-items-start",i&&"wu-bg-gray-10"),dir:o,children:[r&&t.jsx(te,{checked:i}),t.jsx(qa,{option:e,accessorKey:u})]})},qa=({option:e,accessorKey:a})=>{const r=String(e[a.label]);return t.jsxs("div",{className:"wu-flex wu-items-center wu-w-full wu-gap-1 wu-text-xs wu-pl-2",children:[e.icon,r,e.isAdmin&&t.jsx("span",{className:"wu-ml-auto wm-lock wu-text-sm wu-text-orange-deep"})]})},Aa=e=>{const{option:a,handleSelectAll:r,isCheckedAll:s,isPartialSelected:u,...o}=e;switch("type"in a?a.type:"option"){case"all":return t.jsxs($e,{onSelect:w=>{w.stopPropagation(),w.preventDefault(),r==null||r()},className:n("wu-cursor-pointer wu-text-xs wu-py-8 wu-leading-4 wu-select-item"),dir:o.dir,children:[t.jsx(te,{"data-partial":u,checked:s||u,partial:u}),t.jsx(qa,{option:a,accessorKey:o.accessorKey})]});case"group":return t.jsxs(wa,{dir:o.dir,children:[t.jsx(Oe,{className:"wu-text-xs",children:a.label}),a.options.map((w,i)=>d.createElement(_a,{...o,option:w,key:i}))]});case"divider":return t.jsx(Ue,{className:"wu-mx-4"});default:return t.jsx(_a,{...o,option:a})}},Wu=e=>{let a=0,r=0;const s=[],u=[],o=l=>{l.type==="divider"?a++:l.type==="group"?(r++,l.options.forEach(w=>{o(w)})):(s.push(l),l.disabled||u.push(l))};return e.forEach(l=>{o(l)}),{separators:a,groups:r,enabledOptions:u,totalData:s.length,cleanData:s}},Eu=100,_u=400,qu=32,Au=9,Ou=32,Oa=({data:e,onSelect:a,multiple:r=!1,defaultValue:s,value:u,accessorKey:o,variant:l="flat",dir:w="ltr",placeholder:i,Label:c,virtualizedThreshold:f=Eu,maxHeight:p=_u,hasGroup:h=!1,Header:m,CustomTrigger:g,selectAll:b,disabled:v,labelPosition:S="top",onScroll:y,maxContentWidth:C,...D})=>{const[k,I]=d.useState(),W=d.useRef(null),[T,M]=d.useState(!1),[q,$]=d.useState(!1),{cleanData:_,totalData:P,separators:Y,groups:H,enabledOptions:ae}=h||b!=null&&b.enable?Wu(e):{cleanData:e,totalData:e.length,separators:0,groups:0,enabledOptions:[]},me=d.useMemo(()=>r&&b!=null&&b.enable&&e.length>0?[{type:"all",[o.label]:b.label||"Select All"},...e]:e,[e,b,r]),re=d.useCallback(E=>{const z=E[o.value];if(r)I((J=[])=>{const U=J,ie=U.some(oe=>oe[o.value]===z)?U.filter(oe=>oe[o.value]!==z):[...U,E];return a==null||a(ie),ie});else{const J=E;I(J),a==null||a(J)}},[r,o.value,a]);d.useEffect(()=>{if(s&&u){console.error("defaultValue and value cannot be used simultaneously");return}!s&&!u&&I(void 0),s!==void 0&&I(s),u!==void 0&&I(u)},[s,u]);const xe=d.useMemo(()=>Math.min(p,P*qu+Y*Au+H*Ou),[p,P,Y,H]),Te=me.length>f;d.useEffect(()=>{if(!r)return;const E=b!=null&&b.includeDisabled?(k==null?void 0:k.length)===e.length:(k==null?void 0:k.length)===ae.length;M(E);const z=(k==null?void 0:k.length)>0&&!E;$(z)},[k,b]);const we=d.useCallback(()=>{const E=T?[]:b!=null&&b.includeDisabled?h?_:e:ae;I(E),a==null||a(E)},[T,r,e,ae,a,b]),ue=Ee(S);return t.jsxs("div",{className:n(ue,"wu-flex wu-select-container"),ref:W,dir:w,children:[t.jsxs(la,{children:[t.jsx(Iu,{...D,value:k,multiple:r,variant:l,dir:w,placeholder:i,accessorKey:o,customTriggerChildren:g,id:D.id,disabled:v,selectAll:b,isCheckedAll:T}),t.jsxs(pt,{className:"wu-min-w-[--radix-dropdown-menu-trigger-width] wu-max-w-[calc(100vw-32px)] wu-border-blue-p wu-select-content",role:"listbox",sideOffset:-1,align:"start",id:D.id,style:{maxWidth:C},children:[m,Te?t.jsx(Se,{list:me,containerHeight:p,callback:(E,z)=>t.jsx(Aa,{option:z,accessorKey:o,multiple:r,onSelect:re,value:k,dir:w,handleSelectAll:we,isCheckedAll:T,isPartialSelected:q}),dir:w}):t.jsx("div",{onScroll:y,style:{maxHeight:xe,height:"fit-content",overflow:"auto"},className:"wu-select-list",children:me.map((E,z)=>t.jsx(Aa,{option:E,accessorKey:o,multiple:r,onSelect:re,value:k,handleSelectAll:we,isCheckedAll:T,dir:w,isPartialSelected:q},`${z}`))})]})]}),c&&t.jsx(Q,{htmlFor:D.id,className:"wu-select-label",children:c})]})},Ge=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Lu=({value:e,onChange:a,min:r=A.sub(new Date,{years:5}),max:s=A.add(new Date,{years:1}),placeholder:u="Select a month",Label:o,labelPosition:l="top",disabled:w,id:i,readonly:c,disabledMonths:f=[],...p})=>{const[h,m]=d.useState(null),[g,b]=d.useState(""),[v,S]=d.useState({value:Math.min(new Date().getFullYear(),new Date(s).getFullYear()),label:Math.min(new Date().getFullYear(),new Date(s).getFullYear())}),y=d.useMemo(()=>{const D=new Date(r).getFullYear(),k=new Date(s).getFullYear();return Array.from({length:k-D+1},(I,W)=>({value:k-W,label:k-W}))},[r,s]);d.useEffect(()=>{if(e){const D=new Date(e),k=D.getFullYear(),I=D.getMonth();m({year:k,month:I}),b(`${Ge[I]} ${k}`),S({value:k,label:k})}},[e]);const C=()=>{h&&a&&(a(new Date(h.year,h.month,15)),b(`${Ge[h.month]} ${h.year}`))};return t.jsxs("div",{className:n("wu-flex wu-flex-col wu-items-center",Ee(l),l==="top"&&"wu-items-start"),children:[t.jsxs(ee,{children:[t.jsx(wt,{...p,disabled:w||c,id:i,dir:"ltr",placeholder:u,formattedString:g}),t.jsxs(Z,{className:"wu-flex wu-flex-col wu-gap-4 wu-p-4 wu-bg-white wu-border-blue-p wu-month-picker-content",align:"start",sideOffset:-1,children:[t.jsx("div",{className:"wu-px-1 wu-mx-auto wu-w-full",children:t.jsx(Oa,{data:y,accessorKey:{value:"value",label:"label"},value:v,onSelect:D=>S(D),multiple:!1,maxHeight:7*32})}),t.jsx(Pu,{year:v==null?void 0:v.value,selectedMonth:h==null?void 0:h.month,selectedYear:h==null?void 0:h.year,onClick:(D,k)=>m({year:k,month:D}),disabledMonths:f}),t.jsx("div",{className:"wu-flex wu-justify-end wu-px-0.5",children:t.jsx(De.PopoverClose,{asChild:!0,children:t.jsx(V,{onClick:C,children:"Apply"})})})]})]}),o&&t.jsx(Q,{className:"wu-truncate wu-max-w-[120px] wu-min-w-fit wu-select-label",children:o})]})},Pu=({year:e,selectedMonth:a,selectedYear:r,onClick:s,disabledMonths:u=[]})=>{const o=new Date,l=o.getFullYear(),w=o.getMonth(),i=d.useMemo(()=>{const c=new Set;return u.forEach(f=>{const p=typeof f=="string"?new Date(f):f;c.add(`${p.getFullYear()}-${p.getMonth()}`)}),c},[u]);return t.jsx("div",{className:"wu-grid wu-grid-cols-3 wu-grid-rows-4 wu-w-fit wu-gap-[1px] wu-bg-[#d9d9d9] wu-border wu-border-[#d9d9d9] wu-month-picker-grid",children:Ge.map((c,f)=>{const p=e===l&&f===w,h=a===f&&r===e;return t.jsx("button",{disabled:i.has(`${e}-${f}`),onClick:()=>s(f,e),className:n("wu-bg-white wu-flex wu-items-center wu-justify-center wu-w-[83px] wu-h-[53px] wu-text-xs wu-transition-colors","hover:wu-bg-gray-25 hover:wu-text-blue-q hover:wu-font-medium","focus:wu-outline-none focus-visible:wu-border focus-visible:wu-border-blue-p/50",p&&"wu-border wu-border-blue-p",h&&"wu-bg-blue-p wu-text-white hover:wu-bg-blue-p/80 hover:wu-text-white wu-font-medium","disabled:wu-bg-gray-20 disabled:wu-text-gray-subtle disabled:hover:wu-bg-gray-20 disabled:hover:wu-text-gray-subtle disabled:hover:wu-font-normal","wu-month-picker-month"),"data-value":`${Ge[f]} ${e}`,"data-month":f,"data-year":e,children:c},c)})})},La=(e,a,r,s=96)=>{if(e.length===0||s<=0)return[[],[]];const[o,l]=d.useState([]),[w,i]=d.useState([]);return d.useEffect(()=>{const c=()=>{var g,b;const f=((g=a.current)==null?void 0:g.clientWidth)||0,p=((b=r.current)==null?void 0:b.clientWidth)||0,h=f-p,m=Math.floor(h/s);l(e.slice(0,m)),i(e.slice(m))};return c(),window.addEventListener("resize",c),()=>{window.removeEventListener("resize",c)}},[e,s]),[o,w]},Pa={wuPrimaryLink:"_wuPrimaryLink_1sy3v_1",wuPrimaryPopoverContent:"_wuPrimaryPopoverContent_1sy3v_8"},Fu=e=>{const{Links:a,children:r,className:s,...u}=e,o=d.useMemo(()=>a.map((f,p)=>d.cloneElement(f,{className:n(Pa.wuPrimaryLink,f.props.className,"wu-primary-nav-link"),key:p})),[a]),l=d.useRef(null),w=d.useRef(null),[i,c]=La(o,l,w);return t.jsx(t.Fragment,{children:t.jsxs("header",{className:n("wu-flex wu-items-center wu-justify-between wu-gap-4 wu-px-2 wu-py-1 wu-bg-white wu-border-b",s),...u,ref:l,children:[t.jsxs("div",{className:"wu-flex wu-items-center wu-gap-2",children:[t.jsx("nav",{className:"wu-flex wu-items-center wu-justify-start wu-gap-4 wu-primary-nav-left",children:i}),c.length>0&&t.jsxs(ee,{children:[t.jsx(be,{className:"wu-p-1 wu-pb-0 wu-rounded-sm focus:wu-outline-none focus:wu-bg-gray-25","aria-label":"more",children:t.jsx("span",{className:"wm-more-vert"})}),t.jsx(Z,{className:n(Pa.wuPrimaryPopoverContent,"wu-primary-nav-popover-left"),align:"start",sideOffset:12,children:c})]})]}),r&&t.jsxs(t.Fragment,{children:[t.jsx("section",{className:"wu-items-center wu-justify-end wu-hidden wu-gap-4 sm:wu-flex wu-primary-nav-right",ref:w,children:r}),t.jsxs(ee,{children:[t.jsx(be,{className:"sm:wu-hidden",children:t.jsx("span",{className:"wu-text-lg wm-menu"})}),t.jsx(Z,{className:"wu-bg-white wu-border wu-border-blue-p wu-w-fit wu-primary-nav-popover-right",align:"end",sideOffset:4,children:r})]})]})]})})},yt={wuSecondaryLink:"_wuSecondaryLink_1edl1_1",wuSecondaryNav:"_wuSecondaryNav_1edl1_6"},Bu=e=>{const{Links:a,children:r,className:s,...u}=e,o=d.useMemo(()=>a.map((p,h)=>d.cloneElement(p.link,{key:h,className:n(yt.wuSecondaryLink,p.link.props.className,"wu-secondary-nav-link-container"),children:t.jsxs(t.Fragment,{children:[d.cloneElement(p.imgOrIcon,{className:n("wu-w-5 wu-h-5 wu-flex wu-items-center wu-justify-center wu-text-lg wu-leading-5",p.imgOrIcon.props.className)}),t.jsx("div",{className:"wu-secondary-nav-link",children:p.link.props.children})]})})),[a]),l=d.useRef(null),w=d.useRef(null),i=d.useRef(null),[c,f]=La(o,l,i);return t.jsx(t.Fragment,{children:t.jsxs("header",{className:n("wu-flex wu-items-center wu-justify-between wu-gap-4 wu-border-y wu-border-gray-25 wu-h-[50px]",s),...u,ref:l,children:[t.jsxs("div",{className:"wu-flex wu-items-center wu-justify-start wu-gap-2",children:[t.jsx("nav",{className:n(yt.wuSecondaryNav,"wu-flex wu-items-center wu-justify-start wu-w-full wu-h-full wu-secondary-nav-left"),ref:w,children:c}),f.length>0&&t.jsxs(ee,{children:[t.jsx(be,{className:"wu-p-1 wu-pb-0 wu-rounded-sm focus:wu-outline-none focus:wu-bg-gray-25","aria-label":"more",children:t.jsx("span",{className:"wm-more-vert"})}),t.jsx(Z,{className:n(yt.wuSecondaryNavPopover,"wu-secondary-nav-popover-left"),align:"start",sideOffset:12,children:f})]})]}),r&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"wu-items-center wu-justify-end wu-hidden sm:wu-flex",ref:i,children:r}),t.jsxs(ee,{children:[t.jsx(be,{className:"sm:wu-hidden",children:t.jsx("span",{className:"wu-text-lg wm-menu"})}),t.jsx(Z,{className:"wu-bg-white wu-border wu-border-blue-p wu-w-fit wu-secondary-nav-popover-right",align:"end",sideOffset:12,children:r})]})]})]})})},Fa=d.forwardRef(({totalRows:e,initialPage:a,initialPageSize:r=100,onPageChange:s,className:u,disabled:o=!1,...l},w)=>{const[i,c]=d.useState(a),[f,p]=d.useState(r);d.useEffect(()=>{c(a),p(r)},[a,r]);const h=Math.ceil(e/f),m=i*f+1,g=Math.min((i+1)*f,e),b=Array.from({length:h},(y,C)=>C),v=d.useCallback(y=>{y>=0&&y<h&&(c(y),s==null||s(y))},[h,s]),S=7*32;return t.jsxs("div",{className:n("wu-flex wu-items-center wu-gap-[2px]",u,"wu-pagination"),...l,role:"navigation",children:[t.jsx(Ba,{label:"Previous page",onClick:()=>v(i-1),disabled:i===0||o,icon:"wm-arrow-back-ios-new",className:"hover:wu-bg-gray-20 rtl:wu-rotate-180 wu-prev-btn"}),t.jsx(Ca,{name:`${m} - ${g}`,className:"wu-w-[96px] wu-min-w-[96px] wu-pagination-menu",align:"end",disabled:o,children:t.jsx(ke,{style:{maxHeight:S+"px"},dir:l.dir,children:b.length>100?t.jsx(Se,{className:"wu-pagination-list",containerHeight:S,list:b,callback:(y,C)=>t.jsxs(gt,{onSelect:()=>v(C),className:n("wu-py-2",C===i&&"wu-bg-gray-20","wu-pagination-item"),children:[C*f+1," -"," ",Math.min((C+1)*f,e)]},y)}):b.map(y=>t.jsxs(gt,{onSelect:()=>v(y),className:n(y===i&&"wu-bg-gray-20","wu-py-2 hover:wu-bg-gray-20","wu-pagination-item"),children:[y*f+1," -"," ",Math.min((y+1)*f,e)]},y))})}),t.jsx(Ba,{label:"Next page",onClick:()=>v(i+1),disabled:i===h-1||o,icon:"wm-arrow-forward-ios",className:"hover:wu-bg-gray-20 rtl:wu-rotate-180 wu-next-btn"})]})});Fa.displayName="WuPagination";const Ba=({label:e,onClick:a,disabled:r,icon:s,className:u})=>t.jsx(V,{variant:"iconOnly",onClick:a,disabled:r,className:n("wu-w-8 wu-h-8 wu-rounded-xs wu-group disabled:wu-text-zinc-300 disabled:wu-bg-white wu-text-gray-lead focus:wu-bg-color-none",u),"aria-label":e,children:t.jsx("span",{className:n("wu-text-sm",s)})}),zu=({Trigger:e,children:a,className:r,dir:s,open:u,onOpenChange:o,modal:l,...w})=>t.jsxs(ee,{open:u,onOpenChange:o,modal:l,children:[t.jsx(be,{asChild:!0,dir:s,children:e}),t.jsx(Z,{className:n("wu-w-80 wu-p-0 wu-border-blue-p wu-bg-white wu-dark:border-gray-switcher",r),dir:s,...w,children:a})]}),Hu=e=>t.jsx(De.PopoverClose,{asChild:!0,children:t.jsx(V,{...e})}),za=N.forwardRef(({className:e,...a},r)=>t.jsx(We.Root,{className:n("wu-grid wu-gap-2",e),...a,ref:r}));za.displayName=We.Root.displayName;const Ha=N.forwardRef(({className:e,...a},r)=>t.jsx(We.Item,{ref:r,className:n("wu-group wu-aspect-square wu-h-4 wu-w-4 wu-rounded-full wu-border wu-border-gray-subtle wu-text-blue-p wu-ring-offset-white disabled:wu-cursor-not-allowed disabled:wu-opacity-50 hover:wu-border-blue-p hover:wu-bg-gray-20 data-[state=checked]:wu-border-blue-p hover:data-[state=checked]:wu-border-blue-q hover:data-[state=checked]:wu-bg-inherit focus:wu-outline-2 focus:wu-outline-offset-4 focus:wu-outline-blue-soft disabled:hover:wu-border-gray-subtle disabled:wu-hover:bg-gray-20 disabled:wu-bg-gray-20",e),...a,children:t.jsx(We.Indicator,{className:"wu-flex wu-items-center wu-justify-center",children:t.jsx("div",{className:"wu-w-2 wu-h-2 wu-rounded-full wu-bg-blue-p group-hover:group-data-[state=checked]:wu-bg-blue-q"})})}));Ha.displayName=We.Item.displayName;const ja=d.forwardRef((e,a)=>{const{options:r,defaultValue:s,onChange:u,label:o,dir:l,...w}=e;return t.jsxs(za,{defaultValue:s,required:w.required,disabled:w.disabled,onValueChange:u,id:w.id,dir:l,name:w.name,className:n("w-fit",w.className),ref:a,style:w.style,children:[t.jsx(_e,{htmlFor:w.id,className:"wu-text-sm wu-font-normal wu-text-gray-lead wu-leading-6 wu-radio-group-label",children:o}),r.map(i=>t.jsxs("div",{className:"wu-flex wu-items-center wu-gap-2 wu-radio-item-container",children:[t.jsx(Ha,{value:i.value,id:i.value,disabled:i.disabled,required:i.required,"aria-label":i.value,className:"wu-peer wu-radio-item"}),t.jsx(_e,{htmlFor:i.value,className:n(i.required&&"after:wu-content-['*'] after:wu-mx-[2px] after:wu-text-rose-500","wu-radio-item-label"),children:i.label})]},i.value))]})});ja.displayName="WuRadioGroup";const ju=e=>{const{children:a,...r}=e;return t.jsxs(ke,{...r,role:"complementary","aria-label":"ScrollArea",children:[a,t.jsx(mt,{orientation:"horizontal"})]})},$a=N.forwardRef(({className:e,orientation:a="horizontal",decorative:r=!0,...s},u)=>t.jsx(Pt.Root,{ref:u,decorative:r,orientation:a,className:n("shrink-0 bg-border",a==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...s}));$a.displayName=Pt.Root.displayName;function Ua({className:e,...a}){return t.jsx("div",{className:n("animate-pulse rounded-md bg-muted",e),...a})}const vt=768;function $u(){const[e,a]=N.useState(void 0);return N.useEffect(()=>{const r=window.matchMedia(`(max-width: ${vt-1}px)`),s=()=>{a(window.innerWidth<vt)};return r.addEventListener("change",s),a(window.innerWidth<vt),()=>r.removeEventListener("change",s)},[]),!!e}const Uu="sidebar_state",Gu=60*60*24*7,Vu="256px",Yu="256px",Ju="3rem",Ku="b",Ga=N.createContext(null);function he(){const e=N.useContext(Ga);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}const Va=N.forwardRef(({defaultOpen:e=!0,open:a,onOpenChange:r,className:s,style:u,children:o,...l},w)=>{const i=$u(),[c,f]=N.useState(!1),[p,h]=N.useState(e),m=a??p,g=N.useCallback(y=>{const C=typeof y=="function"?y(m):y;r?r(C):h(C),document.cookie=`${Uu}=${C}; path=/; max-age=${Gu}`},[r,m]),b=N.useCallback(()=>i?f(y=>!y):g(y=>!y),[i,g,f]);N.useEffect(()=>{const y=C=>{C.key===Ku&&(C.metaKey||C.ctrlKey)&&(C.preventDefault(),b())};return window.addEventListener("keydown",y),()=>window.removeEventListener("keydown",y)},[b]);const v=m?"expanded":"collapsed",S=N.useMemo(()=>({state:v,open:m,setOpen:g,isMobile:i,openMobile:c,setOpenMobile:f,toggleSidebar:b}),[v,m,g,i,c,f,b]);return t.jsx(Ga.Provider,{value:S,children:t.jsx(Xt,{delayDuration:0,children:t.jsx("div",{style:{"--sidebar-width":Vu,"--sidebar-width-icon":Ju,...u},className:n("wu-group/sidebar-wrapper wu-flex wu-min-h-[calc(100svh-48px)] wu-w-full",s),ref:w,...l,children:o})})})});Va.displayName="SidebarProvider";const Ya=N.forwardRef(({side:e="left",variant:a="sidebar",collapsible:r="offcanvas",className:s,children:u,...o},l)=>{const{isMobile:w,state:i,openMobile:c,setOpenMobile:f}=he();return r==="none"?t.jsx("div",{className:n("wu-flex wu-h-full wu-w-[--sidebar-width] wu-flex-col",s),ref:l,...o,children:u}):w?t.jsx(ha,{open:c,onOpenChange:f,...o,children:t.jsxs(bt,{"data-sidebar":"sidebar","data-mobile":"true",className:"wu-w-[--sidebar-width] wu-bg-blue-sidebar wu-p-0 [&>button]:wu-hidden",style:{"--sidebar-width":Yu},side:e,children:[t.jsxs(ma,{className:"sr-only",children:[t.jsx(ht,{children:"Sidebar"}),t.jsx(xa,{children:"Displays the mobile sidebar."})]}),t.jsx("div",{className:"wu-flex wu-flex-col wu-w-full wu-h-full",children:u})]})}):t.jsxs("div",{ref:l,className:"wu-hidden wu-group wu-peer md:wu-block","data-state":i,"data-collapsible":i==="collapsed"?r:"","data-variant":a,"data-side":e,children:[t.jsx("div",{className:n("wu-relative wu-w-[--sidebar-width] wu-bg-transparent wu-transition-[width] wu-duration-150 wu-ease-linear","group-data-[collapsible=offcanvas]:wu-w-0","group-data-[side=right]:wu-rotate-180",a==="floating"||a==="inset"?"group-data-[collapsible=icon]:wu-w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4))]":"group-data-[collapsible=icon]:wu-w-[--sidebar-width-icon]")}),t.jsx("div",{className:n("wu-fixed wu-inset-y-0 wu-z-10 wu-hidden wu-h-svh wu-w-[--sidebar-width] wu-transition-[left,right,width] wu-duration-150 wu-ease-linear md:wu-flex",e==="left"?"wu-left-0 group-data-[collapsible=offcanvas]:wu-left-[calc(var(--sidebar-width)*-1)]":"wu-right-0 group-data-[collapsible=offcanvas]:wu-right-[calc(var(--sidebar-width)*-1)]",a==="floating"||a==="inset"?"wu-p-2 group-data-[collapsible=icon]:wu-w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4)_+2px)]":"group-data-[collapsible=icon]:wu-w-[--sidebar-width-icon] group-data-[side=left]:wu-border-r group-data-[side=right]:wu-border-l",s),...o,children:t.jsx("div",{"data-sidebar":"sidebar",className:"wu-flex wu-h-full wu-w-full wu-flex-col wu-bg-[#eef3fb] group-data-[variant=floating]:wu-rounded-lg group-data-[variant=floating]:wu-border group-data-[variant=floating]:wu-border-sidebar-border group-data-[variant=floating]:wu-shadow",children:u})})]})});Ya.displayName="Sidebar";const Ja=N.forwardRef(({className:e,onClick:a,children:r,...s},u)=>{const{toggleSidebar:o}=he();return t.jsxs(Ne,{ref:u,"data-sidebar":"trigger",variant:"secondary",className:n("wu-h-8 wu-w-8 wu-min-w-0 wu-p-0 wu-text-2xl wu-font-light hover:wu-bg-blue-sidebarHover wu-text-blue-q",e),onClick:l=>{a==null||a(l),o()},...s,children:[r,t.jsx("span",{className:"wu-sr-only",children:"Toggle Sidebar"})]})});Ja.displayName="SidebarTrigger";const Xu=N.forwardRef(({className:e,...a},r)=>{const{toggleSidebar:s}=he();return t.jsx("button",{ref:r,"data-sidebar":"rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:s,title:"Toggle Sidebar",className:n("wu-absolute wu-inset-y-0 wu-z-20 wu-hidden wu-w-4 wu-translate-x-1/2 wu-transition-all wu-ease-linear after:wu-absolute after:wu-inset-y-0 after:wu-left-1/2 after:wu-w-[2px] group-data-[side=left]:wu-right-4 group-data-[side=right]:wu-left-0 sm:wu-flex","[[data-side=left]_&]:wu-cursor-w-resize [[data-side=right]_&]:wu-cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:wu-cursor-e-resize [[data-side=right][data-state=collapsed]_&]:wu-cursor-w-resize","group-data-[collapsible=offcanvas]:wu-translate-x-0 group-data-[collapsible=offcanvas]:after:wu-left-full","[[data-side=left][data-collapsible=offcanvas]_&]:wu-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:wu-left-2",e),...a})});Xu.displayName="SidebarRail";const Ka=N.forwardRef(({className:e,...a},r)=>t.jsx("main",{ref:r,className:n("wu-relative wu-flex wu-w-full wu-flex-1 wu-flex-col","md:peer-data-[variant=inset]:wu-m-2 md:peer-data-[state=collapsed]:peer-data-[variant=inset]:wu-ml-2 md:peer-data-[variant=inset]:wu-ml-0 md:peer-data-[variant=inset]:wu-rounded-xl md:peer-data-[variant=inset]:wu-shadow",e),...a}));Ka.displayName="SidebarInset";const Qu=N.forwardRef(({className:e,...a},r)=>t.jsx(ze,{ref:r,"data-sidebar":"input",className:n("wu-h-8 wu-w-full wu-shadow-none focus-visible:wu-ring-2",e),...a}));Qu.displayName="SidebarInput";const Xa=N.forwardRef(({className:e,...a},r)=>t.jsx("div",{ref:r,"data-sidebar":"header",className:n("wu-flex wu-flex-col wu-gap-2 wu-p-2",e),...a}));Xa.displayName="SidebarHeader";const Qa=N.forwardRef(({className:e,...a},r)=>t.jsx("div",{ref:r,"data-sidebar":"footer",className:n("wu-flex wu-flex-col wu-gap-2 wu-pb-2",e),...a}));Qa.displayName="SidebarFooter";const Zu=N.forwardRef(({className:e,...a},r)=>t.jsx($a,{ref:r,"data-sidebar":"separator",className:n("wu-mx-2 wu-w-auto",e),...a}));Zu.displayName="SidebarSeparator";const Za=N.forwardRef(({className:e,...a},r)=>t.jsx("div",{ref:r,"data-sidebar":"content",className:n("wu-flex wu-min-h-0 wu-flex-1 wu-flex-col wu-gap-2 wu-overflow-auto group-data-[collapsible=icon]:wu-overflow-hidden",e),...a}));Za.displayName="SidebarContent";const Ra=N.forwardRef(({className:e,...a},r)=>t.jsx("div",{ref:r,"data-sidebar":"group",className:n("wu-relative wu-flex wu-w-full wu-min-w-0 wu-flex-col wu-p-2",e),...a}));Ra.displayName="SidebarGroup";const er=N.forwardRef(({className:e,asChild:a=!1,...r},s)=>{const u=a?ye.Slot:"div";return t.jsx(u,{ref:s,"data-sidebar":"group-label",className:n("wu-flex wu-h-8 wu-shrink-0 wu-items-center wu-rounded-md wu-px-2 wu-text-xs wu-font-medium wu-outline-none wu-transition-[margin,opacity] wu-duration-150 wu-ease-linear focus-visible:wu-ring-2 [&>svg]:wu-size-4 [&>svg]:wu-shrink-0","group-data-[collapsible=icon]:wu-opacity-0",e),...r})});er.displayName="SidebarGroupLabel";const Ru=N.forwardRef(({className:e,asChild:a=!1,...r},s)=>{const u=a?ye.Slot:"button";return t.jsx(u,{ref:s,"data-sidebar":"group-action",className:n("wu-absolute wu-right-3 wu-top-3.5 wu-flex wu-aspect-square wu-w-5 wu-items-center wu-justify-center wu-rounded-md wu-p-0 wu-outline-none wu-transition-transform focus-visible:wu-ring-2 [&>svg]:wu-size-4 [&>svg]:wu-shrink-0","after:wu-absolute after:wu-inset-2 after:md:wu-hidden","group-data-[collapsible=icon]:wu-hidden",e),...r})});Ru.displayName="SidebarGroupAction";const tr=N.forwardRef(({className:e,...a},r)=>t.jsx("div",{ref:r,"data-sidebar":"group-content",className:n("wu-w-full wu-text-sm",e),...a}));tr.displayName="SidebarGroupContent";const Nt=N.forwardRef(({className:e,...a},r)=>t.jsx("ul",{ref:r,"data-sidebar":"menu",className:n("wu-flex wu-w-full wu-min-w-0 wu-flex-col wu-gap-1",e),...a}));Nt.displayName="SidebarMenu";const ar=N.forwardRef(({className:e,...a},r)=>t.jsx("li",{ref:r,"data-sidebar":"menu-item",className:n("wu-group/menu-item wu-relative",e),...a}));ar.displayName="SidebarMenuItem";const eo=X.cva("wu-peer/menu-button wu-flex wu-w-full wu-items-center wu-gap-2 wu-overflow-hidden wu-rounded-md wu-p-2 wu-text-left wu-text-sm wu-outline-none wu-transition-[width,height,padding] focus-visible:wu-ring-2 disabled:wu-pointer-events-none disabled:wu-opacity-50 group-has-[[data-sidebar=menu-action]]/menu-item:wu-pr-8 aria-disabled:wu-pointer-events-none aria-disabled:wu-opacity-50 data-[active=true]:wu-font-medium group-data-[collapsible=icon]:!wu-size-8 group-data-[collapsible=icon]:!wu-p-2 [&>span:last-child]:wu-truncate [&>svg]:wu-size-4 [&>svg]:wu-shrink-0",{variants:{variant:{default:"",outline:""},size:{default:"wu-h-8 wu-text-sm",sm:"wu-h-7 wu-text-xs",lg:"wu-h-12 wu-text-sm group-data-[collapsible=icon]:!wu-p-0"}},defaultVariants:{variant:"default",size:"default"}}),rr=N.forwardRef(({asChild:e=!1,isActive:a=!1,variant:r="default",size:s="default",tooltip:u,className:o,...l},w)=>{const i=e?ye.Slot:"button",{isMobile:c,state:f}=he(),p=t.jsx(i,{ref:w,"data-sidebar":"menu-button","data-size":s,"data-active":a,className:n(eo({variant:r,size:s}),o),...l});return u?(typeof u=="string"&&(u={children:u}),t.jsxs(Qt,{children:[t.jsx(Zt,{asChild:!0,children:p}),t.jsx(lt,{side:"right",align:"center",hidden:f!=="collapsed"||c,...u})]})):p});rr.displayName="SidebarMenuButton";const to=N.forwardRef(({className:e,asChild:a=!1,showOnHover:r=!1,...s},u)=>{const o=a?ye.Slot:"button";return t.jsx(o,{ref:u,"data-sidebar":"menu-action",className:n("wu-absolute wu-right-1 wu-top-1.5 wu-flex wu-aspect-square wu-w-5 wu-items-center wu-justify-center wu-rounded-md wu-p-0 wu-outline-none wu-transition-transform focus-visible:wu-ring-2 [&>svg]:wu-size-4 [&>svg]:wu-shrink-0","after:wu-absolute after:wu-inset-2 after:md:wu-hidden","peer-data-[size=sm]/menu-button:wu-top-1","peer-data-[size=default]/menu-button:wu-top-1.5","peer-data-[size=lg]/menu-button:wu-top-2.5","group-data-[collapsible=icon]:wu-hidden",r&&"group-focus-within/menu-item:wu-opacity-100 group-hover/menu-item:wu-opacity-100 data-[state=open]:wu-opacity-100 md:wu-opacity-0",e),...s})});to.displayName="SidebarMenuAction";const ao=N.forwardRef(({className:e,...a},r)=>t.jsx("div",{ref:r,"data-sidebar":"menu-badge",className:n("wu-pointer-events-none wu-absolute wu-right-1 wu-flex wu-h-5 wu-min-w-5 wu-select-none wu-items-center wu-justify-center wu-rounded-md wu-px-1 wu-text-xs wu-font-medium wu-tabular-nums","","peer-data-[size=sm]/menu-button:wu-top-1","peer-data-[size=default]/menu-button:wu-top-1.5","peer-data-[size=lg]/menu-button:wu-top-2.5","group-data-[collapsible=icon]:wu-hidden",e),...a}));ao.displayName="SidebarMenuBadge";const ro=N.forwardRef(({className:e,showIcon:a=!1,...r},s)=>{const u=N.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return t.jsxs("div",{ref:s,"data-sidebar":"menu-skeleton",className:n("wu-flex wu-h-8 wu-items-center wu-gap-2 wu-rounded-md wu-px-2",e),...r,children:[a&&t.jsx(Ua,{className:"wu-rounded-md wu-size-4","data-sidebar":"menu-skeleton-icon"}),t.jsx(Ua,{className:"wu-h-4 wu-max-w-[--skeleton-width] wu-flex-1","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":u}})]})});ro.displayName="SidebarMenuSkeleton";const so=N.forwardRef(({className:e,...a},r)=>t.jsx("ul",{ref:r,"data-sidebar":"menu-sub",className:n("wu-mx-3.5 wu-flex wu-min-w-0 wu-translate-x-px wu-flex-col wu-gap-1 wu-border-l wu-px-2.5 wu-py-0.5","group-data-[collapsible=icon]:wu-hidden",e),...a}));so.displayName="SidebarMenuSub";const uo=N.forwardRef(({...e},a)=>t.jsx("li",{ref:a,...e}));uo.displayName="SidebarMenuSubItem";const oo=N.forwardRef(({asChild:e=!1,size:a="md",isActive:r,className:s,...u},o)=>{const l=e?ye.Slot:"a";return t.jsx(l,{ref:o,"data-sidebar":"menu-sub-button","data-size":a,"data-active":r,className:n("wu-flex wu-h-7 wu-min-w-0 wu-translate-x-px wu-items-center wu-gap-2 wu-overflow-hidden wu-rounded-md wu-px-2 wu-outline-none focus-visible:wu-ring-2 disabled:wu-pointer-events-none disabled:wu-opacity-50 aria-disabled:wu-pointer-events-none aria-disabled:wu-opacity-50 [&>span:last-child]:wu-truncate [&>svg]:wu-size-4 [&>svg]:wu-shrink-0","data-[active=true]:wu-bg-sidebar-accent data-[active=true]:wu-text-sidebar-accent-foreground",a==="sm"&&"wu-text-xs",a==="md"&&"wu-text-sm","group-data-[collapsible=icon]:wu-hidden",s),...u})});oo.displayName="SidebarMenuSubButton";const lo=({children:e,Sidebar:a,className:r,defaultOpen:s=!0,open:u,onOpenChange:o,style:l})=>t.jsxs(Va,{defaultOpen:s,open:u,onOpenChange:o,children:[t.jsxs(Ya,{variant:"sidebar",collapsible:"icon",className:n("wu-top-12 wu-h-[calc(100%-48px)] wu-shadow-sidebar wu-border-none",r),style:l,role:"complementary",children:[t.jsx(Xa,{className:"wu-py-2",children:t.jsx(sr,{})}),a]}),t.jsx(Ka,{children:e})]}),sr=e=>{const{state:a,isMobile:r,openMobile:s}=he();return t.jsx(Ja,{...e,children:t.jsx(xt,{showMenu:r?s:a==="expanded"})})},no=({className:e,children:a,...r})=>{const s=d.useRef(null),u=d.useRef(null),o=({currentTarget:w})=>{const{scrollTop:i,clientHeight:c,scrollHeight:f}=w;s.current&&s.current.classList.toggle("wu-border-[#1b338014]",i!==0),u.current&&u.current.classList.toggle("wu-border-[#1b338014]",i+c!==f)},l="wu-w-[calc(100%-16px)] wu-mx-auto wu-border-transparent";return t.jsxs(Za,{...r,className:n("wu-overflow-hidden wu-gap-0",e),children:[t.jsx("hr",{className:l,ref:s}),t.jsx(ke,{onScroll:o,className:"wu-gap-2",thumbColor:"#b9c3dc",railColor:"#00000000","data-testid":"scroll-area",children:a}),t.jsx("hr",{className:l,ref:u})]})},wo=e=>t.jsx(Qa,{...e,children:e.children}),io=({label:e,children:a,...r})=>t.jsxs(Ra,{...r,className:"wu-p-0",children:[t.jsx("div",{className:"wu-h-8",children:t.jsx(er,{className:"wu-items-end wu-px-4 wu-text-xs wu-font-normal wu-leading-4 wu-text-blue-q",children:e})}),t.jsx(tr,{children:t.jsx(Nt,{children:a})})]}),co=e=>t.jsx(Nt,{...e}),fo=({Icon:e,children:a,className:r,isActive:s,...u})=>{const{state:o}=he(),[l,w]=d.useState(),i=a&&d.cloneElement(a,{children:t.jsxs("div",{className:"wu-flex wu-items-center wu-gap-2 wu-overflow-hidden wu-text-base wu-truncate wu-text-ellipsis",children:[e,t.jsx("span",{className:n("wu-text-sm wu-leading-4 wu-transition-opacity wu-duration-150",o==="collapsed"&&"wu-opacity-0"),children:a.props.children})]})}),c=d.useRef(null);return d.useEffect(()=>{var f;w(((f=c.current)==null?void 0:f.textContent)||"")},[]),t.jsx(ar,{...u,className:"wu-flex wu-items-center wu-gap-2 wu-px-2",children:t.jsx(rr,{className:n("wu-flex wu-items-center wu-text-blue-q hover:wu-bg-blue-sidebarHover wu-cursor-pointer wu-h-8 wu-rounded-sm",r,s&&"wu-bg-white wu-shadow-[4px_4px_16px_0_#1B338014] wu-font-medium wu-text-blue-p hover:wu-bg-white wu-cursor-default"),isActive:s,tooltip:l,asChild:!0,ref:c,children:i})})},po={wuStepper:"_wuStepper_apbnq_1"},ur=d.forwardRef((e,a)=>{const{onChange:r,defaultValue:s=0,min:u,max:o,step:l,readonly:w,resetInvalidValueOnBlur:i=!0,value:c,label:f,labelPosition:p="top",className:h,style:m,...g}=e,[b,v]=d.useState(c||s),S=T=>!!(e.disabled||e.readOnly||T==="inc"&&Number(b||0)>=Number(o)||T==="dec"&&Number(b||0)<=Number(u)),y=d.useCallback(T=>{T.preventDefault(),v(M=>Number(M||u||0)+Number(l||1))},[u,l]),C=d.useCallback(T=>{T.preventDefault(),v(M=>M?Number(M)-Number(l||1):0)},[u,l]),D=d.useCallback(T=>T>=Number(u)&&T<=Number(o),[u,o]),k=T=>{const M=T.currentTarget.value;v(M)},I=d.useCallback(()=>{if(i&&!D(Number(b))){const T=Number(u)||0;v(T)}},[u,i,D,b]);d.useEffect(()=>{r&&r(Number(b))},[b,c]),d.useEffect(()=>{c&&s&&console.warn("As both value and defaultValue are passed, value will be used")},[c,s]);const W=n("wu-px-10 wu-h-[33px] wu-text-center wu-text-blue-q wu-text-xs wu-rounded-t-sm","wu-stepper-input");return t.jsxs("div",{className:n(po.wuStepper,bo({labelPosition:p}),h,"wu-stepper"),style:m,dir:g.dir,children:[t.jsx(_e,{htmlFor:g.id,className:n(p!=="top"&&"wu-max-w-[160px]","wu-truncate wu-text-xs wu-font-normal wu-leading-6 wu-text-gray-lead wu-stepper-label"),dir:g.dir,children:f}),t.jsxs("div",{className:"wu-relative wu-flex wu-items-center wu-justify-start wu-w-fit wu-stepper-container",dir:g.dir,children:[t.jsx(V,{variant:"iconOnly",Icon:t.jsx("span",{className:"wu-text-base wm-add"}),className:n("wu-rounded-none wu-bg-gray-10 wu-absolute wu-top-0 wu-right-0 wu-w-8 wu-h-8 wu-text-blue-q wu-rounded-tr-sm wu-p-2",g.dir==="rtl"?"wu-right-auto wu-left-0":"","wu-stepper-button"),onClick:y,disabled:S("inc"),"aria-label":"increment"}),t.jsx(ze,{...g,ref:a,type:"number",className:W,onChange:k,min:u,max:o,step:l,readOnly:w,onBlur:I,value:b}),t.jsx(V,{variant:"iconOnly",Icon:t.jsx("span",{className:"wu-text-base wm-minimize"}),className:n("wu-rounded-none wu-bg-gray-10 wu-absolute wu-top-0 wu-left-0 wu-w-8 wu-h-8 wu-text-blue-q wu-rounded-tl-sm wu-p-2",g.dir==="rtl"?"wu-left-auto wu-right-0":"","wu-stepper-button"),onClick:C,disabled:S("dec"),"aria-label":"decrement"})]})]})}),bo=X.cva("wu-flex wu-w-fit",{variants:{labelPosition:{left:"wu-flex-row wu-text-right wu-gap-2 wu-items-center",top:"wu-flex-col"}}});ur.displayName="WuStepper";const or=X.cva("wu-inline-flex wu-items-center wu-justify-center wu-text-sm wu-font-medium wu-ring-offset-background wu-transition-colors hover:wu-bg-muted hover:wu-text-muted-foreground focus-visible:wu-outline-none focus-visible:wu-ring-2 focus-visible:wu-ring-ring focus-visible:wu-ring-offset-2 disabled:wu-cursor-not-allowed disabled:wu-opacity-80",{variants:{variant:{default:"wu-bg-transparent",outline:"wu-border wu-border-input wu-bg-transparent hover:wu-bg-accent hover:wu-text-accent-foreground"},size:{default:"wu-h-10 wu-px-3",sm:"wu-h-9 wu-px-2.5",lg:"wu-h-11 wu-px-5"}},defaultVariants:{variant:"default",size:"default"}}),ho=N.forwardRef(({className:e,variant:a,size:r,...s},u)=>t.jsx(Ft.Root,{ref:u,className:n(or({variant:a,size:r,className:e})),...s}));ho.displayName=Ft.Root.displayName;const lr=N.createContext({size:"default",variant:"default"}),Ve=N.forwardRef(({className:e,variant:a,size:r,children:s,...u},o)=>t.jsx(Fe.Root,{ref:o,className:n("wu-flex wu-items-center wu-justify-center wu-gap-1",e),...u,children:t.jsx(lr.Provider,{value:{variant:a,size:r},children:s})}));Ve.displayName=Fe.Root.displayName;const ge=N.forwardRef(({className:e,children:a,variant:r,size:s,...u},o)=>{const l=N.useContext(lr);return t.jsx(Fe.Item,{ref:o,className:n(or({variant:l.variant||r,size:l.size||s}),e),...u,children:a})});ge.displayName=Fe.Item.displayName;const nr=d.forwardRef((e,a)=>{const{options:r,value:s,disabled:u,dir:o,onChange:l}=e,w=i=>n("wu-w-8 wu-h-8 wu-text-xl wu-leading-5 wu-rounded-full wu-text-gray-lead wu-relative wu-z-10 wu-p-0 wu-flex wu-items-center wu-justify-center",u&&"wu-cursor-not-allowed data-[state=on]:wu-text-gray-lead",i===s&&"wu-text-white",u&&s===i&&"wu-text-gray-lead","wu-switcher-icon-tab-item");return t.jsx(t.Fragment,{children:t.jsxs(Ve,{ref:a,type:"single",value:s,onValueChange:l,disabled:u,dir:o,className:n("wu-relative wu-group wu-flex wu-flex-row wu-items-start wu-justify-start wu-gap-0 wu-w-16 wu-bg-gray-25 wu-rounded-full",u&&"wu-cursor-not-allowed","wu-switcher-icon-tab-group"),children:[t.jsx("div",{role:"slider",className:n("wu-absolute wu-z-0 wu-w-8 wu-h-8 wu-bg-blue-p wu-rounded-full wu-transition-transform wu-duration-300 wu-ease-in-out",s==="opt1"&&"",s==="opt2"&&o!=="rtl"&&"wu-translate-x-full",s==="opt2"&&o==="rtl"&&"-wu-translate-x-full",u&&"wu-bg-gray-40","wu-switcher-icon-tab-slider")}),t.jsx(ge,{value:"opt1",className:w("opt1"),children:r[0].label}),t.jsx(ge,{value:"opt2",className:w("opt2"),children:r[1].label})]})})});nr.displayName="_IconTab";const wr=d.forwardRef((e,a)=>{const{options:r,value:s,disabled:u,dir:o,size:l="md",onChange:w}=e,i=c=>n("wu-w-1/2 wu-text-xs wu-rounded-full wu-text-gray-lead wu-relative wu-z-10 wu-font-normal",u&&"wu-cursor-not-allowed data-[state=on]:wu-text-gray-lead",l==="sm"&&"wu-h-6 wu-min-w-20",l==="md"&&"wu-h-8 wu-min-w-28",l==="lg"&&"wu-h-10 wu-min-w-36",c===s&&"wu-text-white wu-font-medium",u&&s===c&&"wu-text-gray-lead","wu-switcher-tab-item");return t.jsx(t.Fragment,{children:t.jsxs(Ve,{ref:a,type:"single",value:s,onValueChange:w,disabled:u,dir:o,className:n("wu-relative group wu-flex wu-flex-row wu-items-start wu-justify-start wu-gap-0 wu-w-fit wu-bg-gray-25 wu-rounded-full",u&&"wu-cursor-not-allowed","wu-switcher-tab-group"),children:[t.jsx("div",{role:"slider",className:n("wu-absolute wu-z-0 wu-w-1/2 wu-bg-blue-p wu-rounded-full wu-transition-transform wu-duration-300 wu-ease-in-out ",l==="sm"&&"wu-h-6 wu-min-w-20",l==="md"&&"wu-h-8 wu-min-w-28",l==="lg"&&"wu-h-10 wu-min-w-36",s==="opt1"&&"",s==="opt2"&&o!=="rtl"&&"wu-translate-x-full",s==="opt2"&&o==="rtl"&&"-wu-translate-x-full",u&&"wu-bg-gray-40","wu-switcher-tab-slider")}),t.jsx(ge,{value:"opt1",className:i("opt1"),children:t.jsx("div",{className:"wu-min-w-16 wu-max-w-[136px] wu-overflow-hidden wu-text-ellipsis wu-text-nowrap",children:r[0].label})}),t.jsx(ge,{value:"opt2",className:i("opt2"),children:t.jsx("div",{className:"wu-min-w-16 wu-max-w-[136px] wu-overflow-hidden wu-text-ellipsis wu-text-nowrap",children:r[1].label})})]})})});wr.displayName="_Tab";const ir=d.forwardRef((e,a)=>{const{options:r,value:s,disabled:u,dir:o,onChange:l}=e,w=p=>n("wu-p-0 wu-w-fit wu-text-xs wu-text-gray-lead wu-h-fit wu-font-normal",u&&"wu-cursor-not-allowed data-[state=on]:wu-text-gray-subtle wu-text-gray-subtle",p===s&&"wu-text-primary wu-font-medium",u&&s===p&&"wu-text-gray-lead","wu-switcher-toggle-item"),i=n("wu-w-fit wu-gap-2",u&&"wu-cursor-not-allowed","wu-switcher-toggle-group"),c=n("wu-flex wu-items-center wu-justify-center wu-w-8 wu-h-3 wu-p-0 wu-border wu-rounded-full wu-cursor-pointer wu-border-blue-p focus:wu-outline-none focus-visible:wu-ring-2 focus-visible:wu-ring-blue-soft focus-visible:wu-ring-offset-2",u&&"wu-border-gray-subtle wu-cursor-not-allowed","wu-switcher-toggle-button"),f=n("wu-w-2 wu-h-2 wu-bg-blue-p wu-rounded-full wu-transition-transform wu-duration-300 wu-ease-in-out",s==="opt1"&&o!=="rtl"&&"-wu-translate-x-[10px]",s==="opt1"&&o==="rtl"&&"wu-translate-x-[10px]",s==="opt2"&&o!=="rtl"&&"wu-translate-x-[10px]",s==="opt2"&&o==="rtl"&&"-wu-translate-x-[10px]",u&&"wu-hidden","wu-switcher-toggle-knob");return t.jsx(t.Fragment,{children:t.jsxs(Ve,{ref:a,type:"single",value:s,disabled:u,dir:o,className:i,onValueChange:l,children:[t.jsx(ge,{value:"opt1",className:w("opt1"),children:t.jsx("div",{className:"wu-max-w-[136px] wu-overflow-hidden wu-text-ellipsis wu-text-nowrap wu-text-right wu-switcher-toggle-item-label",children:r[0].label})}),t.jsx("button",{onClick:()=>l(s==="opt1"?"opt2":"opt1"),className:c,disabled:u,"aria-label":"knob",dir:o,children:t.jsx("div",{className:f,role:"knob",dir:o})}),t.jsx(ge,{value:"opt2",className:w("opt2"),children:t.jsx("div",{className:"wu-max-w-[136px] wu-overflow-hidden wu-text-ellipsis wu-text-nowrap wu-switcher-toggle-item-label",children:r[1].label})})]})})});ir.displayName="_Toggle";const dr=d.forwardRef((e,a)=>{const{type:r,options:s,value:u,disabled:o,dir:l,size:w,onChange:i,toggle:c=!0,...f}=e,[p,h]=d.useState(),m=g=>{let b=p;g!==""?b=g:c&&(b=p==="opt1"?"opt2":"opt1");const v=b==="opt1"?s[0].value:s[1].value;i&&i(v),h(b)};if(d.useEffect(()=>{if(!Array.isArray(s)||s.length<2)throw new Error("Options are not sufficient");h(u===s[0].value?"opt1":"opt2")},[s,u]),!Array.isArray(s)||s.length<2)return t.jsx(t.Fragment,{});switch(r){case"toggle":return t.jsx(ir,{...f,ref:a,options:s,value:p||"opt1",onChange:m,disabled:o,dir:l});case"iconTab":return t.jsx(nr,{ref:a,options:s,value:p||"opt1",onChange:m,disabled:o,dir:l});default:return t.jsx(wr,{ref:a,options:s,value:p||"opt1",onChange:m,disabled:o,dir:l,size:w})}});dr.displayName="WuSwitcher";const cr=fe.Root,Ct=N.forwardRef(({className:e,children:a,...r},s)=>t.jsx(fe.List,{className:n("wu-relative wu-flex",e),...r,ref:s,children:a}));Ct.displayName=fe.List.displayName;const St=N.forwardRef(({className:e,...a},r)=>t.jsx(fe.Trigger,{ref:r,className:n("wu-relative wu-inline-flex wu-items-center wu-whitespace-nowrap wu-text-xs wu-px-4 wu-py-2 wu-text-gray-600 wu-transition-colors wu-duration-200 data-[state=active]:wu-text-blue-p","data-[orientation=horizontal]:wu-justify-center",e),...a}));St.displayName=fe.Trigger.displayName;const fr=N.forwardRef(({className:e,...a},r)=>t.jsx(fe.Content,{ref:r,className:e,...a}));fr.displayName=fe.Content.displayName;const pr=({items:e,enableAnimation:a})=>{const r="wu-duration-700 wu-ease-in-out wu-transition-all data-[state=inactive]:wu-absolute data-[state=inactive]:wu-inset-0 data-[state=inactive]:wu-opacity-0 data-[state=inactive]:wu-z-0 data-[state=active]:wu-relative data-[state=active]:wu-opacity-100 data-[state=active]:wu-z-10";return t.jsx("div",{className:n("wu-w-full wu-h-full wu-flex-1 wu-overflow-auto",a&&"wu-relative wu-overflow-hidden"),children:e.map(s=>t.jsx(fr,{value:s.value,forceMount:a||void 0,className:n("wu-w-full wu-h-full wu-overflow-y-auto",a&&r,"wu-tab-content"),children:s.Content},s.value))})},go=e=>{const[a,r]=d.useState(!1),[s,u]=d.useState(!1),o=()=>{const w=e.current;w&&(r(w.scrollLeft>0),u(w.scrollLeft+w.clientWidth<w.scrollWidth))};return d.useEffect(()=>{const w=e.current;return o(),w&&w.addEventListener("scroll",o),window.addEventListener("resize",o),()=>{w&&w.removeEventListener("scroll",o),window.removeEventListener("resize",o)}},[e]),{showLeftArrow:a,showRightArrow:s,scrollByTab:w=>{const i=e.current;if(i){const c=(w==="right"?i.clientWidth:-i.clientWidth)*.8;i.scrollBy({left:c,behavior:"smooth"})}}}},br=(e,a)=>{const[r,s]=d.useState({width:0,left:0,height:0,top:0}),u=a==="vertical";return d.useEffect(()=>{const o=e.current;if(o){const l=()=>{const i=o.querySelector('[data-state="active"]');if(i){const c={width:u?2:i.offsetWidth,left:u?0:i.offsetLeft,height:u?i.offsetHeight:1,top:u?i.offsetTop:0};s(c)}},w=new MutationObserver(l);return w.observe(o,{attributes:!0,subtree:!0}),l(),()=>{w.disconnect()}}},[e,u]),r},mo=({items:e,value:a,defaultValue:r,onValueChange:s,enableAnimation:u=!1,className:o,dir:l="ltr",position:w="top"})=>{var C;const i=d.useRef(null),c=br(i,"horizontal"),{showLeftArrow:f,showRightArrow:p,scrollByTab:h}=go(i),[m,g]=d.useState(!1),b=()=>h("left"),v=()=>h("right"),S=D=>t.jsx("div",{"data-testid":`gradient-overlay-${D}`,className:n("wu-absolute wu-top-0 wu-h-full wu-w-20 wu-z-10 wu-pointer-events-none",D==="left"?"wu-left-0 wu-bg-gradient-to-r wu-from-white wu-to-transparent":"wu-right-0 wu-bg-gradient-to-l wu-from-white wu-to-transparent")}),y=(D,k,I)=>{const W=k==="left";return t.jsx("button",{onClick:D,className:n("wu-absolute wu-z-20 wu-flex wu-items-center wu-justify-center wu-px-1 wu-py-1 wu-transition-all wu-duration-300 wu-h-8",W?"wu-left-0":"wu-right-0",I&&"wu-translate-x-0 wu-opacity-100",!I&&[W?"-wu-translate-x-full":"wu-translate-x-full","wu-opacity-0"]),"aria-label":W?"scroll-left":"scroll-right",children:t.jsx("span",{className:n("wu-text-blue-p wu-text-lg",W?"wm-keyboard-arrow-left":"wm-keyboard-arrow-right")})})};return t.jsxs(cr,{defaultValue:r||((C=e[0])==null?void 0:C.value),value:a,onValueChange:s,orientation:"horizontal",dir:l,className:n("wu-relative wu-flex wu-flex-col wu-w-full wu-h-full",w==="bottom"?"wu-flex-col-reverse":"wu-flex-col",o),role:"tabs",children:[t.jsxs("div",{className:"wu-relative wu-flex wu-overflow-hidden wu-shrink-0 wu-border-b wu-border-gray-200",onMouseEnter:()=>g(!0),onMouseLeave:()=>g(!1),"aria-label":"tablistWrapper",children:[f&&m&&S("left"),y(b,"left",f&&m),t.jsxs(Ct,{ref:i,className:n("wu-relative wu-flex wu-w-full wu-overflow-x-auto wu-flex-row","[&::-webkit-scrollbar]:wu-hidden [-ms-overflow-style:none] [scrollbar-width:none]","wu-tablist"),children:[e.map(D=>t.jsx(St,{value:D.value,children:D.Trigger},D.value)),t.jsx("span",{className:"wu-absolute wu-bg-blue-p wu-transition-all wu-duration-300 wu-indicator wu-bottom-0",style:{width:c.width,left:c.left,height:1.25,bottom:w==="bottom"?void 0:0,top:w==="bottom"?0:void 0}})]}),p&&m&&S("right"),y(v,"right",p&&m)]}),t.jsx(pr,{items:e,enableAnimation:u})]})},xo=e=>{const[a,r]=d.useState(!1),[s,u]=d.useState(!1),o=()=>{const w=e.current;w&&(r(w.scrollTop>0),u(w.scrollTop+w.clientHeight<w.scrollHeight))};return d.useEffect(()=>{const w=e.current;if(w)return o(),w.addEventListener("scroll",o),window.addEventListener("resize",o),()=>{w.removeEventListener("scroll",o),window.removeEventListener("resize",o)}},[e]),{showTopArrow:a,showBottomArrow:s,scrollByTab:w=>{const i=e.current;if(i){const c=(w==="down"?i.clientHeight:-i.clientHeight)*.8;i.scrollBy({top:c,behavior:"smooth"})}}}},yo=({items:e,value:a,defaultValue:r,onValueChange:s,enableAnimation:u=!1,className:o,dir:l="ltr",position:w="left"})=>{var C;const i=d.useRef(null),c=br(i,"vertical"),{showTopArrow:f,showBottomArrow:p,scrollByTab:h}=xo(i),[m,g]=d.useState(!1),b=()=>h("up"),v=()=>h("down"),S=D=>t.jsx("div",{className:n("wu-absolute wu-left-0 wu-w-full wu-h-12 wu-z-10 wu-pointer-events-none",D==="top"?"wu-top-0 wu-bg-gradient-to-b wu-from-white wu-to-transparent":"wu-bottom-0 wu-bg-gradient-to-t wu-from-white wu-to-transparent")}),y=(D,k,I)=>{const W=k==="up";return t.jsx("button",{onClick:D,className:n("wu-absolute wu-z-20 wu-flex wu-items-center wu-justify-center wu-px-1 wu-py-1 wu-transition-all wu-duration-300 wu-w-full",W?"-wu-top-1":"-wu-bottom-1",I&&"wu-translate-y-0 wu-opacity-100",!I&&[W?"-wu-translate-y-full":"wu-translate-y-full","wu-opacity-0"]),"aria-label":W?"scroll-up":"scroll-down",children:t.jsx("span",{className:n("wu-text-blue-p wu-text-lg",W?"wm-keyboard-arrow-up":"wm-keyboard-arrow-down")})})};return t.jsxs(cr,{defaultValue:r||((C=e[0])==null?void 0:C.value),value:a,onValueChange:s,orientation:"vertical",dir:l,className:n("wu-relative wu-h-full wu-w-full wu-flex",w==="left"?"wu-flex-row":"wu-flex-row-reverse",o),role:"tabs",children:[t.jsxs("div",{className:"wu-relative wu-flex wu-overflow-hidden wu-shrink-0",onMouseEnter:()=>g(!0),onMouseLeave:()=>g(!1),"aria-label":"tablistWrapper",children:[f&&m&&S("top"),y(b,"up",f&&m),t.jsxs(Ct,{ref:i,className:n("wu-relative wu-flex wu-h-full wu-overflow-y-auto wu-flex-col","[&::-webkit-scrollbar]:wu-hidden [-ms-overflow-style:none] [scrollbar-width:none]","wu-tablist"),children:[e.map(D=>t.jsx(St,{value:D.value,children:D.Trigger},D.value)),t.jsx("span",{className:"wu-absolute wu-bg-blue-p wu-transition-all wu-duration-300 wu-indicator",style:{width:2,left:w==="left"?0:void 0,right:w==="right"?0:void 0,height:c.height,top:c.top}})]}),p&&m&&S("bottom"),y(v,"down",p&&m)]}),t.jsx(pr,{items:e,enableAnimation:u})]})},vo=({...e})=>e.orientation==="vertical"?t.jsx(yo,{...e}):t.jsx(mo,{...e}),kt=N.forwardRef(({className:e,...a},r)=>t.jsx("table",{ref:r,className:n("wu-w-full wu-caption-bottom wu-text-sm",e),...a}));kt.displayName="Table";const hr=N.forwardRef(({className:e,...a},r)=>t.jsx("thead",{ref:r,className:n("[&_tr]:wu-border-b",e),...a}));hr.displayName="TableHeader";const gr=N.forwardRef(({className:e,...a},r)=>t.jsx("tbody",{ref:r,className:n("",e),...a}));gr.displayName="TableBody";const No=N.forwardRef(({className:e,...a},r)=>t.jsx("tfoot",{ref:r,className:n("wu-border-t wu-bg-muted/50 wu-font-medium [&>tr]:last:wu-border-b-0",e),...a}));No.displayName="TableFooter";const Le=N.forwardRef(({className:e,...a},r)=>t.jsx("tr",{ref:r,className:n("wu-border-b wu-transition-colors wu-hover:wu-bg-muted/50 data-[state=selected]:wu-bg-muted",e),...a}));Le.displayName="TableRow";const Tt=N.forwardRef(({className:e,...a},r)=>t.jsx("th",{ref:r,className:n("wu-h-10 wu-px-4 wu-text-left wu-align-middle wu-font-medium wu-text-muted-foreground [&:has([role=checkbox])]:wu-pr-0",e),...a}));Tt.displayName="TableHead";const Ye=N.forwardRef(({className:e,...a},r)=>t.jsx("td",{ref:r,className:n("wu-p-4 wu-align-middle [&:has([role=checkbox])]:wu-pr-0",e),...a}));Ye.displayName="TableCell";const Dt=N.forwardRef(({className:e,...a},r)=>t.jsx("caption",{ref:r,className:n("wu-mt-4 wu-text-sm wu-text-gray-subtle wu-font-normal",e),...a}));Dt.displayName="TableCaption";const mr=({columns:e,rowSelection:a})=>{const r=(a==null?void 0:a.isEnabled)??!1,{onRowSelect:s,rowUniqueKey:u}=a||{},o=d.useCallback(w=>i=>{s(()=>i?w:[])},[s]);return{finalColumns:d.useMemo(()=>r?[{id:"select",header:({table:w})=>{const i=w.getRowModel().rows.map(f=>f.original),c=o(i);return t.jsx(te,{checked:w.getIsSomeRowsSelected()||w.getIsAllRowsSelected(),partial:w.getIsSomeRowsSelected()&&!w.getIsAllRowsSelected(),onChange:f=>{w.toggleAllRowsSelected(!!f),c(!!f)},"aria-label":"Select all","data-testid":w.getIsSomeRowsSelected()&&!w.getIsAllRowsSelected()?"select-partial":"select-all"})},cell:({row:w})=>t.jsx(te,{checked:w.getIsSelected(),onChange:i=>{w.toggleSelected(!!i)},"aria-label":String(w.original[u])}),enableSorting:!1,filterable:!1,accessorKey:"select"},...e]:e,[e,r,o])}},xr=({table:e,size:a,NoDataContent:r,isLoading:s,CustomLoader:u})=>{var w;const[o,l]=d.useState(null);return t.jsx(gr,{children:s?t.jsx(Le,{children:t.jsx(Ye,{colSpan:e.getAllColumns().length,className:"wu-text-center wu-h-[35vh] wu-loader-container",children:u||t.jsx(Ce,{className:"wu-w-full"})})}):(w=e.getRowModel().rows)!=null&&w.length?e.getRowModel().rows.map((i,c)=>t.jsx(Le,{"data-state":i.getIsSelected()&&"selected",onMouseOver:()=>l(i.id),onMouseOut:()=>l(null),className:n("wu-transition-colors wu-border-b wu-border-black/[12%]",i.getIsSelected()?o===i.id?"wu-bg-blue-p/[16%]":"wu-bg-blue-p/[8%]":"hover:wu-bg-black/[2%]"),children:i.getVisibleCells().map((f,p)=>t.jsx(Ye,{className:n("wu-py-0 wu-font-light wu-text-gray-lead wu-text-xs",a==="compact"?"wu-h-8":"wu-h-10",f.column.id==="actions"?"wu-opacity-0 wu-transition-opacity wu-duration-100":"",o===i.id&&f.column.id==="actions"?"wu-opacity-100 wu-visible":""),children:R.flexRender(f.column.columnDef.cell,f.getContext())},`${f.id}-${p}`))},`${i.id}-${c}`)):t.jsx(Le,{children:t.jsx(Ye,{colSpan:e.getAllColumns().length,children:r})})})},yr=({table:e,sortableColumns:a,manual:r=!1,onSort:s,size:u,isRowSelected:o,HeaderAction:l,isStickyHeader:w})=>{const i=c=>{const{id:f,columnDef:p,getIsSorted:h,toggleSorting:m}=c,{header:g}=p;if(!a.includes(f))return g;const b=h(),v=b==="asc",S=b==="desc",y=()=>{r?(m(!S),s==null||s({id:f,desc:S})):m(c.getIsSorted()==="asc")};return t.jsxs("button",{onClick:y,"aria-label":`Sort by ${g}`,className:"wu-flex wu-items-center wu-gap-4",children:[g,t.jsxs("div",{className:"wu-relative",children:[t.jsx("span",{className:n("wu-absolute -wu-top-[15px] wm-arrow-drop-down wu-text-xl",v&&"wu-hidden",!b&&"-wu-top-[11px]")}),t.jsx("span",{className:n("wu-absolute -wu-bottom-[13px] wm-arrow-drop-up wu-text-xl",S&&"wu-hidden",!b&&"-wu-bottom-[10px]")})]})]})};return t.jsxs(t.Fragment,{children:[t.jsx(hr,{className:n("wu-border-t wu-border-black/[12%] wu-bg-gray-20 wu-relative",w&&"wu-sticky wu-top-[-.5px] wu-z-10",u==="compact"?"wu-h-8":"wu-h-10"),children:e.getHeaderGroups().map(c=>t.jsx(Le,{className:"wu-relative",children:c.headers.map(f=>f.column.id==="actions"?t.jsx(Tt,{colSpan:f.colSpan,className:n("wu-text-gray-lead wu-text-xs wu-font-medium"),style:{width:`${f.getSize()}px`}},f.id):t.jsx(Tt,{colSpan:f.colSpan,className:n("wu-text-gray-lead wu-text-xs wu-font-medium wu-bg-[#EEEEEE]","wu-relative wu-z-0"),style:{width:`${f.getSize()}px`},children:R.flexRender(i(f.column),f.getContext())},f.id))},c.id))}),o&&l&&t.jsx("div",{className:n("wu-absolute wu-left-10 wu-top-0 wu-flex wu-items-center wu-px-4 wu-border-t",u==="compact"?"wu-h-8":"wu-h-10","wu-bg-gray-20 wu-text-gray-lead wu-text-xs wu-font-medium wu-z-10","wu-w-[calc(100%-40px)]","wu-transition-all wu-duration-300 wu-ease-in-out",w&&"wu-sticky wu-top-[-.1px] wu-z-10"),children:l})]})},Co=({data:e,columns:a,isLoading:r=!1,variant:s="unstyled",sort:u,size:o,rowSelection:l,HeaderAction:w,NoDataContent:i,stickyHeader:c=!1,CustomLoader:f,caption:p,...h})=>{var y;const m=((y=l==null?void 0:l.selectedRows)==null?void 0:y.length)??0,{finalColumns:g}=mr({columns:a,rowSelection:l}),b=d.useMemo(()=>a.filter(C=>C.enableSorting).map(C=>C.accessorKey),[g]),v=d.useMemo(()=>{if(!(l!=null&&l.isEnabled))return{};const C={};for(const D of l.selectedRows){const k=e.findIndex(I=>I[l.rowUniqueKey]===D[l.rowUniqueKey]);k!==-1&&(C[k]=!0)}return C},[l==null?void 0:l.selectedRows,e,l==null?void 0:l.rowUniqueKey,l==null?void 0:l.isEnabled]),S=R.useReactTable({data:e,columns:g,getCoreRowModel:R.getCoreRowModel(),getPaginationRowModel:R.getPaginationRowModel(),manualPagination:!0,manualSorting:!0,manualFiltering:!0,enableRowSelection:l==null?void 0:l.isEnabled,state:{...l!=null&&l.isEnabled?{rowSelection:v}:{}},onRowSelectionChange:C=>{if(typeof C=="function"){const D=C(v),k=Object.keys(D).filter(I=>D[I]).map(I=>e[Number(I)]);l==null||l.onRowSelect(k)}}});return t.jsxs("div",{className:n("wu-table-container wu-relative"),children:[p&&t.jsx(Dt,{className:"wu-font-light",children:p}),t.jsxs(kt,{...h,className:n(So({variant:s}),h.className),children:[t.jsx(yr,{table:S,sortableColumns:b,manual:!0,onSort:u==null?void 0:u.onSort,size:o,HeaderAction:w,isRowSelected:m>0,isStickyHeader:c}),!r&&t.jsx(xr,{table:S,size:o,NoDataContent:i,CustomLoader:f})]}),r&&t.jsx("div",{className:"wu-flex wu-items-center wu-justify-center wu-h-96",children:t.jsx(Ce,{})})]})},So=X.cva("",{variants:{variant:{striped:"[&_tr:nth-child(even)]:wu-bg-zinc-50",unstyled:"",bordered:"wu-border-collapse wu-border [&_th]:wu-border [&_td]:wu-border"}}}),vr=({data:e,columns:a,caption:r,variant:s="unstyled",sort:u,filterText:o,size:l="default",pagination:w,rowSelection:i,HeaderAction:c,NoDataContent:f,CustomLoader:p,isLoading:h,stickyHeader:m,...g})=>{var $;const[b,v]=d.useState((u==null?void 0:u.initial)||[]),[S,y]=d.useState([]),C=(($=i==null?void 0:i.selectedRows)==null?void 0:$.length)??0,[D,k]=d.useState((w==null?void 0:w.pageIndex)??0),{finalColumns:I}=mr({columns:a,rowSelection:i}),W=d.useMemo(()=>I.filter(_=>_.enableSorting).map(_=>_.accessorKey),[I]),T=d.useMemo(()=>I.filter(_=>_.filterable).map(_=>_.accessorKey),[I]),M=d.useMemo(()=>{if(!(i!=null&&i.isEnabled))return{};const _={};for(const P of i.selectedRows){const Y=e.findIndex(H=>H[i.rowUniqueKey]===P[i.rowUniqueKey]);Y!==-1&&(_[Y]=!0)}return _},[i==null?void 0:i.selectedRows,e,i==null?void 0:i.rowUniqueKey,i==null?void 0:i.isEnabled]),q=R.useReactTable({data:e,columns:I,getCoreRowModel:R.getCoreRowModel(),enableRowSelection:i==null?void 0:i.isEnabled,getPaginationRowModel:R.getPaginationRowModel(),getSortedRowModel:R.getSortedRowModel(),getFilteredRowModel:R.getFilteredRowModel(),initialState:{pagination:{pageSize:(w==null?void 0:w.pageSize)??100,pageIndex:(w==null?void 0:w.pageIndex)??0}},state:{sorting:b,columnFilters:S,...w?{pagination:w}:{},...i!=null&&i.isEnabled?{rowSelection:M}:{}},onSortingChange:v,onColumnFiltersChange:y,onRowSelectionChange:_=>{const P=typeof _=="function"?_(M):_,Y=Object.keys(P).filter(H=>P[H]).map(H=>e[Number(H)]);i==null||i.onRowSelect(Y)}});return d.useEffect(()=>{T.forEach(_=>{var P;(P=q.getColumn(_))==null||P.setFilterValue(o)})},[o,T,q]),d.useEffect(()=>{w&&(w==null?void 0:w.pageIndex)!==D&&(i==null||i.onRowSelect(()=>[]),q.resetRowSelection(),k(w.pageIndex))},[w==null?void 0:w.pageIndex]),t.jsx("div",{className:"wu-table-container wu-relative",children:t.jsxs(kt,{...g,className:n(ko({variant:s}),"wu-table-fixed",g.className),children:[r&&t.jsx(Dt,{className:"wu-font-light",children:r}),t.jsx(yr,{table:q,sortableColumns:W,size:l,HeaderAction:c,isRowSelected:C>0,isStickyHeader:m}),t.jsx(xr,{table:q,size:l,NoDataContent:f,CustomLoader:p,isLoading:h})]})})},ko=X.cva("",{variants:{variant:{striped:"[&_tr:nth-child(even)]:wu-bg-zinc-50",unstyled:"",bordered:"wu-border-collapse wu-border [&_th]:wu-border [&_td]:wu-border"}}});vr.displayName="WuTable";const Nr=N.forwardRef(({className:e,...a},r)=>t.jsx("textarea",{className:n("wu-flex wu-w-full wu-border-b wu-border-gray-subtle wu-bg-gray-10 wu-text-gray-lead wu-p-2 wu-text-sm wu-font-normal wu-placeholder:wu-text-gray-subtle wu-placeholder:wu-font-light focus-visible:wu-outline-none disabled:wu-cursor-not-allowed disabled:wu-bg-gray-20 disabled:wu-border-gray-40 disabled:wu-text-gray-subtle read-only:wu-cursor-not-allowed read-only:wu-bg-gray-20 read-only:wu-border-gray-40 read-only:wu-text-gray-subtle focus:wu-border-blue-p wu-transition-colors hover:wu-border-gray-40 ",e),ref:r,...a}));Nr.displayName="Textarea";const Cr=d.forwardRef((e,a)=>{const{Label:r,id:s=Be(),variant:u="flat",readonly:o,maxLength:l,labelPosition:w="top",...i}=e,c=p=>{i.onChange&&i.onChange(p)},f=Ee(w);return t.jsxs("div",{className:n(f,"wu-flex wu-textarea-container"),dir:i.dir,children:[t.jsx(Nr,{...i,ref:a,id:s,className:n("wu-peer wu-rounded-t-sm",u==="outlined"?"wu-border wu-border-gray-subtle":"",i.className),onChange:c,readOnly:o,maxLength:l}),r&&t.jsx(Q,{htmlFor:s,className:"wu-textarea-label",children:r})]})});Cr.displayName="WuTextarea";function To(e){if(typeof e=="string"&&e.includes("T")){const a=A.parseISO(e);return A.format(a,"HH:mm")}if(typeof e=="string"&&/^\d{2}:\d{2}:\d{2}$/.test(e)){const a=A.parse(e,"HH:mm:ss",new Date);return A.format(a,"HH:mm")}return typeof e=="string"&&/^\d{2}:\d{2}$/.test(e)?e:"00:00"}const Sr=["12",...Array.from({length:11},(e,a)=>String(a+1).padStart(2,"0"))],kr=Array.from({length:60},(e,a)=>String(a).padStart(2,"0")),Tr=["am","pm"],Je=50;function Do(e){return Array(Je).fill(e).flat()}function Mt(e,a){const r=e.indexOf(a);return[...e.slice(r),...e.slice(0,r)]}function Mo(e,a){let r=Number(e);return a==="pm"&&r<12&&(r+=12),a==="am"&&r===12&&(r=0),String(r).padStart(2,"0")}function Dr(e){const a=Number(e),r=a>=12?"pm":"am",s=a%12===0?12:a%12;return{hour:String(s),meridiem:r}}const Io=({value:e,isSelected:a,onClick:r})=>t.jsx("div",{onClick:r,className:n("wu-w-8 wu-h-8 wu-flex wu-items-center wu-justify-center wu-text-center wu-snap-start wu-rounded-[2px] wu-cursor-pointer hover:wu-bg-blue-p hover:wu-text-white",a&&"wu-bg-blue-p/15 wu-text-blue-p"),children:e}),It=({values:e,selectedValue:a,scrollRef:r,onSelect:s,repeatItems:u=!0,className:o})=>t.jsx("div",{ref:r,className:n("wu-overflow-y-scroll wu-w-8 wu-snap-y wu-snap-mandatory [&::-webkit-scrollbar]:hidden [-ms-overflow-style:none] [scrollbar-width:none]",o),role:"presentation",children:(u?Do(e):e).map((l,w)=>t.jsx(Io,{value:l,isSelected:l===a,onClick:()=>s(l)},`${l}-${w}`))});function Wo(e,a,r,s){const u=d.useMemo(()=>e?Mt(Sr,a.padStart(2,"0")):Sr,[e]),o=d.useMemo(()=>e?Mt(kr,r.padStart(2,"0")):kr,[e]),l=d.useMemo(()=>e?Mt(Tr,s):Tr,[e]);return{rotatedHours:u,rotatedMinutes:o,rotatedMeridiem:l}}function Eo(e,a,r){d.useEffect(()=>{function s(l){if(l){const w=l.scrollHeight/Je,i=Math.floor(Je/2);l.scrollTop=i*w;const c=()=>{const{scrollTop:f}=l,p=Math.round(f/w);(p<=1||p>=Je-2)&&(l.scrollTop=i*w)};return l.addEventListener("scroll",c),()=>{l.removeEventListener("scroll",c)}}}if(!e)return;const u=s(a.current),o=s(r.current);return()=>{u==null||u(),o==null||o()}},[e,a,r])}const Mr=({className:e,time:a,Label:r,labelPosition:s,dir:u,...o})=>{const[l,w]=d.useState(!1),[i,c]=d.useState(""),f=d.useRef(null),p=d.useRef(null),h=d.useRef(null),m=d.useRef(null),[g,b]=d.useState("12"),[v,S]=d.useState("00"),[y,C]=d.useState("am");d.useEffect(()=>{if(!a){c(""),b("12"),S("00"),C("am"),f.current&&(f.current.value="");return}const T=To(a);c(T);const[M,q]=T.split(":"),{hour:$,meridiem:_}=Dr(M);b($),S(q),C(_),f.current&&(f.current.value=T)},[a]),d.useEffect(()=>{const T=M=>{p.current&&!p.current.contains(M.target)&&w(!1)};return document.addEventListener("mousedown",T),()=>{document.removeEventListener("mousedown",T)}},[]),Eo(l,h,m);const{rotatedHours:D,rotatedMinutes:k,rotatedMeridiem:I}=Wo(l,g,v,y),W=d.useCallback((T,M,q)=>{const $=T??g,_=M??v,P=q??y;b($),S(_),C(P);const Y=`${Mo($,P)}:${_}`;c(Y)},[g,v,y]);return t.jsxs("div",{className:n("wu-flex wu-gap-1 wu-relative wu-w-fit wu-flex-col",(s==="right"||s==="left")&&"wu-items-center",s==="left"&&"wu-flex-row",s==="right"&&"wu-flex-row-reverse","wu-input-wrapper"),dir:u,children:[r&&t.jsx(Q,{htmlFor:"time-picker",className:"wu-timepicker-label",children:r}),t.jsxs("div",{className:n("relative inline-block"),ref:p,dir:u,children:[t.jsx(pe,{ref:f,type:"time",value:i,variant:"flat",role:"textbox",onChange:T=>{c(T.target.value);const[M,q]=T.target.value.split(":"),{hour:$,meridiem:_}=Dr(M);b($),S(q),C(_)},className:"wu-w-[136px] wu-h-8 wu-pr-6 wu-border wu-border-lead/40 wu-text-gray-lead wu-timepicker-input",style:{WebkitAppearance:"none",MozAppearance:"textfield"},Icon:t.jsx(le,{icon:"wm-schedule",className:"wu-text-base",onClick:()=>w(T=>!T),"data-testid":"wu-timepicker-icon"}),iconPosition:"right",dir:u,...o}),t.jsx("style",{children:`
|
|
4
|
+
)`;w.style.setProperty("--spotlight-background",E)})};return window.addEventListener("mousemove",b),()=>{window.removeEventListener("mousemove",b),p&&cancelAnimationFrame(p)}}},[t,r,o,n]),a.jsx("div",{ref:i,className:c(Dn.gradientBackground,"wu-transform-gpu",u),...l,children:s})},Kr="600px",Mn={sm:"400px",md:"600px",lg:"1200px"},_n=({Trigger:e,children:t,size:r="md",hideCloseButton:s,preventClickOutside:u,onOpenChange:o,open:n,dir:l,maxWidth:i,maxHeight:w,className:d,style:p,variant:b="action",...h})=>{const x={action:["#EEF3FBcc 32%","#1D50F4cc"],upgrade:["#FDEDCCcc 32%","#FF9F00cc"],critical:["#FFB6B6cc 32%","#CC0000cc"]};return a.jsxs(Sn,{modal:!0,onOpenChange:o,open:n,children:[e&&a.jsx(En,{asChild:!0,children:e}),a.jsxs(Ur,{style:{width:"calc(100% - 64px)",maxWidth:i||Mn[r],maxHeight:w||Kr,...p},hideCloseButton:s,onInteractOutside:m=>u&&m.preventDefault(),dir:l,"aria-describedby":void 0,"data-variant":b,className:c("wu-group wuexp:wu-rounded-[1.1rem]",d),...h,children:["data-theme"in h&&a.jsx(Yr,{colors:x[b],strokeWidth:4,className:c("wuexp:wu-rounded-[1.1rem] wu-transform-gpu wu-flex wu-flex-col",d),style:{maxHeight:w||Kr},children:t}),!("data-theme"in h)&&t]})]})},An=({children:e,style:t={},...r})=>a.jsx("div",{className:c("wu-flex wu-flex-col wu-gap-4 wu-px-3 wu-py-4 rtl:wu-text-right wu-overflow-auto wu-bg-white","wuexp:wu-p-8 wuexp:wu-text-gray-lead"),children:a.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:e})}),Wn=({children:e,className:t,...r})=>a.jsx($r,{...r,"data-variant":"action",className:c("wu-text-lg wu-text-gray-lead wu-font-medium","wuexp:wu-rounded-t-xl wuexp:wu-px-4","wuexp:group-data-[variant=action]:wu-bg-blue-sidebar wuexp:group-data-[variant=action]:wu-text-blue-q","wuexp:group-data-[variant=critical]:wu-bg-[#F9E0E0] wuexp:group-data-[variant=critical]:wu-text-red-deep","wuexp:group-data-[variant=upgrade]:wu-bg-[#FEF1D9] wuexp:group-data-[variant=upgrade]:wu-text-yellow-deep",t),children:a.jsx(Gr,{className:"wuexp:wu-font-normal wuexp:wu-justify-start wuexp:wu-text-2xl wuexp:wu-h-14",children:e})}),Pn=({children:e,className:t,...r})=>a.jsx(jr,{...r,className:c("wu-border-t wu-border-gray-40 wu-bg-white wu-min-h-16 wu-mx-4 wu-px-0","wuexp:wu-mx-0 wuexp:wu-rounded-b-xl wuexp:wu-min-h-16 wuexp:wu-p-4","wuexp:group-data-[variant=upgrade]:wu-border-[#EED6A8]","wuexp:group-data-[variant=action]:wu-border-[#BAC9F8]","wuexp:group-data-[variant=critical]:wu-border-[#F0B3B3]",t),children:e}),Ln=({children:e,className:t,...r})=>{const s=f.useRef(null);return a.jsx(kn,{asChild:!0,children:a.jsx(me,{className:t,ref:s,...r,children:e})})},On=({placeholder:e="Select...",value:t,multiple:r=!1,accessorKey:s,variant:u="flat",dir:o="ltr",customTriggerChildren:n,id:l,disabled:i,selectAll:w,isCheckedAll:d,width:p,...b})=>{const[h,x]=f.useState(""),[m,v]=f.useState(e);f.useEffect(()=>{if(!t||Array.isArray(t)&&t.length===0){v(e),x("");return}const y=s.label;if(r&&Array.isArray(t)){const C=t.map(N=>N[y]).join(", ");x(C)}else!r&&!Array.isArray(t)&&x(t[y])},[t,s.label,r,e]);const E=()=>e&&!h?a.jsx("p",{className:"wu-text-xs wu-opacity-70",children:m}):a.jsx("span",{className:c("wu-overflow-hidden wu-text-xs wu-text-start wu-text-ellipsis wu-whitespace-nowrap"),style:{width:`${(p||0)-32}px`},children:d?(w==null?void 0:w.triggerText)??h:h});return a.jsx(Er,{asChild:!0,dir:o,id:l,disabled:i,children:a.jsxs("button",{...b,disabled:i,className:c("wu-flex wu-gap-2 wu-w-full wu-items-center wu-justify-between wu-py-1.5 wu-px-2 wu-text-xs wu-transition-colors wu-cursor-pointer wu-border-b wu-bg-white wu-border-gray-subtle wu-h-8","focus:wu-outline-none focus-visible:wu-border-blue-p/80 wu-rounded-t-sm","disabled:wu-cursor-not-allowed disabled:hover:wu-border-gray-subtle disabled:wu-bg-gray-10 disabled:wu-opacity-50","hover:wu-bg-gray-10 hover:wu-border-blue-p",u==="outlined"&&"wu-border wu-border-gray-subtle","wu-group wu-select-trigger",b.className),children:[n??E(),a.jsx("span",{className:"wm-arrow-drop-down group-data-[state=open]:wu-rotate-180 wu-transition-transform wu-duration-300 wu-text-base"})]})})},Jr=({option:e,value:t,multiple:r=!1,onSelect:s,accessorKey:u,dir:o="ltr"})=>{const[n,l]=f.useState(r?[]:"");f.useEffect(()=>{t&&l(r?t.map(p=>JSON.stringify(p[u.value])):JSON.stringify(t[u.value]))},[t,u.value,r]);const i=r?n.includes(JSON.stringify(e[u.value])):n===JSON.stringify(e[u.value]),w=d=>{e.disabled||(s(e),r&&d.preventDefault())};return a.jsxs(At,{onClick:w,disabled:e.disabled,className:c("wu-cursor-pointer wu-text-xs wu-py-2 wu-leading-4 wu-select-item wu-items-start",i&&"wu-bg-gray-10"),dir:o,children:[r&&a.jsx(Me,{checked:i}),a.jsx(Xr,{option:e,accessorKey:u})]})},Xr=({option:e,accessorKey:t})=>{const r=String(e[t.label]);return a.jsxs("div",{className:"wu-flex wu-items-center wu-w-full wu-gap-1 wu-text-xs wu-pl-2",children:[e.icon,r,e.isAdmin&&a.jsx("span",{className:"wu-ml-auto wm-lock wu-text-sm wu-text-orange-deep"})]})},Qr=e=>{const{option:t,handleSelectAll:r,isCheckedAll:s,isPartialSelected:u,...o}=e;switch("type"in t?t.type:"option"){case"all":return a.jsxs(At,{onSelect:l=>{l.stopPropagation(),l.preventDefault(),r==null||r()},className:c("wu-cursor-pointer wu-text-xs wu-py-8 wu-leading-4 wu-select-item"),dir:o.dir,children:[a.jsx(Me,{"data-partial":u,checked:s||u,partial:u}),a.jsx(Xr,{option:t,accessorKey:o.accessorKey})]});case"group":return a.jsxs(Tr,{dir:o.dir,children:[a.jsx(pt,{className:"wu-text-xs",children:t.label}),t.options.map((l,i)=>f.createElement(Jr,{...o,option:l,key:i}))]});case"divider":return a.jsx(Wt,{className:"wu-mx-4"});default:return a.jsx(Jr,{...o,option:t})}},Fn=e=>{let t=0,r=0;const s=[],u=[],o=n=>{n.type==="divider"?t++:n.type==="group"?(r++,n.options.forEach(l=>{o(l)})):(s.push(n),n.disabled||u.push(n))};return e.forEach(n=>{o(n)}),{separators:t,groups:r,enabledOptions:u,totalData:s.length,cleanData:s}},Bn=100,qn=400,Vn=32,Hn=9,zn=32,Zr=({data:e,onSelect:t,multiple:r=!1,defaultValue:s,value:u,accessorKey:o,variant:n="flat",dir:l="ltr",placeholder:i,Label:w,virtualizedThreshold:d=Bn,maxHeight:p=qn,hasGroup:b=!1,Header:h,CustomTrigger:x,selectAll:m,disabled:v,labelPosition:E="top",onScroll:y,maxContentWidth:C,...N})=>{const[I,M]=f.useState(),T=f.useRef(null),[_,D]=f.useState(!1),[F,O]=f.useState(!1),{cleanData:P,totalData:A,separators:L,groups:q,enabledOptions:W}=b||m!=null&&m.enable?Fn(e):{cleanData:e,totalData:e.length,separators:0,groups:0,enabledOptions:[]},$=f.useMemo(()=>r&&m!=null&&m.enable&&e.length>0?[{type:"all",[o.label]:m.label||"Select All"},...e]:e,[e,m,r]),H=f.useCallback(B=>{const K=B[o.value];if(r)M((Z=[])=>{const j=Z,Te=j.some(ye=>ye[o.value]===K)?j.filter(ye=>ye[o.value]!==K):[...j,B];return t==null||t(Te),Te});else{const Z=B;M(Z),t==null||t(Z)}},[r,o.value,t]);f.useEffect(()=>{if(s&&u){console.error("defaultValue and value cannot be used simultaneously");return}!s&&!u&&M(void 0),s!==void 0&&M(s),u!==void 0&&M(u)},[s,u]);const Q=f.useMemo(()=>Math.min(p,A*Vn+L*Hn+q*zn),[p,A,L,q]),ae=$.length>d;f.useEffect(()=>{if(!r)return;const B=m!=null&&m.includeDisabled?(I==null?void 0:I.length)===e.length:(I==null?void 0:I.length)===W.length;D(B);const K=(I==null?void 0:I.length)>0&&!B;O(K)},[I,m]);const le=f.useCallback(()=>{const B=_?[]:m!=null&&m.includeDisabled?b?P:e:W;M(B),t==null||t(B)},[_,r,e,W,t,m]),ee=wt(E);return a.jsxs("div",{className:c(ee,"wu-flex wu-select-container"),ref:T,dir:l,children:[a.jsxs(Sr,{children:[a.jsx(On,{...N,value:I,multiple:r,variant:n,dir:l,placeholder:i,accessorKey:o,customTriggerChildren:x,id:N.id,disabled:v,selectAll:m,isCheckedAll:_}),a.jsxs(ha,{className:"wu-min-w-[--radix-dropdown-menu-trigger-width] wu-max-w-[calc(100vw-32px)] wu-border-blue-p wu-select-content",role:"listbox",sideOffset:-1,align:"start",id:N.id,style:{maxWidth:C},children:[h,ae?a.jsx(et,{list:$,containerHeight:p,callback:(B,K)=>a.jsx(Qr,{option:K,accessorKey:o,multiple:r,onSelect:H,value:I,dir:l,handleSelectAll:le,isCheckedAll:_,isPartialSelected:F}),dir:l}):a.jsx("div",{onScroll:y,style:{maxHeight:Q,height:"fit-content",overflow:"auto"},className:"wu-select-list",children:$.map((B,K)=>a.jsx(Qr,{option:B,accessorKey:o,multiple:r,onSelect:H,value:I,handleSelectAll:le,isCheckedAll:_,dir:l,isPartialSelected:F},`${K}`))})]})]}),w&&a.jsx(be,{htmlFor:N.id,className:"wu-select-label",children:w})]})},Pt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Un=({value:e,onChange:t,min:r=z.sub(new Date,{years:5}),max:s=z.add(new Date,{years:1}),placeholder:u="Select a month",Label:o,labelPosition:n="top",disabled:l,id:i,readonly:w,disabledMonths:d=[],...p})=>{const[b,h]=f.useState(null),[x,m]=f.useState(""),[v,E]=f.useState({value:Math.min(new Date().getFullYear(),new Date(s).getFullYear()),label:Math.min(new Date().getFullYear(),new Date(s).getFullYear())}),y=f.useMemo(()=>{const N=new Date(r).getFullYear(),I=new Date(s).getFullYear();return Array.from({length:I-N+1},(M,T)=>({value:I-T,label:I-T}))},[r,s]);f.useEffect(()=>{if(e){const N=new Date(e),I=N.getFullYear(),M=N.getMonth();h({year:I,month:M}),m(`${Pt[M]} ${I}`),E({value:I,label:I})}},[e]);const C=()=>{b&&t&&(t(new Date(b.year,b.month,15)),m(`${Pt[b.month]} ${b.year}`))};return a.jsxs("div",{className:c("wu-flex wu-flex-col wu-items-center",wt(n),n==="top"&&"wu-items-start"),children:[a.jsxs(De,{children:[a.jsx(da,{...p,disabled:l||w,id:i,dir:"ltr",placeholder:u,formattedString:x}),a.jsxs(Se,{className:"wu-flex wu-flex-col wu-gap-4 wu-p-4 wu-bg-white wu-border-blue-p wu-month-picker-content",align:"start",sideOffset:-1,children:[a.jsx("div",{className:"wu-px-1 wu-mx-auto wu-w-full",children:a.jsx(Zr,{data:y,accessorKey:{value:"value",label:"label"},value:v,onSelect:N=>E(N),multiple:!1,maxHeight:7*32})}),a.jsx($n,{year:v==null?void 0:v.value,selectedMonth:b==null?void 0:b.month,selectedYear:b==null?void 0:b.year,onClick:(N,I)=>h({year:I,month:N}),disabledMonths:d}),a.jsx("div",{className:"wu-flex wu-justify-end wu-px-0.5",children:a.jsx(nt.PopoverClose,{asChild:!0,children:a.jsx(me,{onClick:C,children:"Apply"})})})]})]}),o&&a.jsx(be,{className:"wu-truncate wu-max-w-[120px] wu-min-w-fit wu-select-label",children:o})]})},$n=({year:e,selectedMonth:t,selectedYear:r,onClick:s,disabledMonths:u=[]})=>{const o=new Date,n=o.getFullYear(),l=o.getMonth(),i=f.useMemo(()=>{const w=new Set;return u.forEach(d=>{const p=typeof d=="string"?new Date(d):d;w.add(`${p.getFullYear()}-${p.getMonth()}`)}),w},[u]);return a.jsx("div",{className:"wu-grid wu-grid-cols-3 wu-grid-rows-4 wu-w-fit wu-gap-[1px] wu-bg-[#d9d9d9] wu-border wu-border-[#d9d9d9] wu-month-picker-grid",children:Pt.map((w,d)=>{const p=e===n&&d===l,b=t===d&&r===e;return a.jsx("button",{disabled:i.has(`${e}-${d}`),onClick:()=>s(d,e),className:c("wu-bg-white wu-flex wu-items-center wu-justify-center wu-w-[83px] wu-h-[53px] wu-text-xs wu-transition-colors","hover:wu-bg-gray-25 hover:wu-text-blue-q hover:wu-font-medium","focus:wu-outline-none focus-visible:wu-border focus-visible:wu-border-blue-p/50",p&&"wu-border wu-border-blue-p",b&&"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":`${Pt[d]} ${e}`,"data-month":d,"data-year":e,children:w},w)})})},Rr=(e,t,r,s=96)=>{if(e.length===0||s<=0)return[[],[]];const[o,n]=f.useState([]),[l,i]=f.useState([]);return f.useEffect(()=>{const w=()=>{var x,m;const d=((x=t.current)==null?void 0:x.clientWidth)||0,p=((m=r.current)==null?void 0:m.clientWidth)||0,b=d-p,h=Math.floor(b/s);n(e.slice(0,h)),i(e.slice(h))};return w(),window.addEventListener("resize",w),()=>{window.removeEventListener("resize",w)}},[e,s]),[o,l]},es={wuPrimaryLink:"_wuPrimaryLink_1sy3v_1",wuPrimaryPopoverContent:"_wuPrimaryPopoverContent_1sy3v_8"},jn=e=>{const{Links:t,children:r,className:s,...u}=e,o=f.useMemo(()=>t.map((d,p)=>f.cloneElement(d,{className:c(es.wuPrimaryLink,d.props.className,"wu-primary-nav-link"),key:p})),[t]),n=f.useRef(null),l=f.useRef(null),[i,w]=Rr(o,n,l);return a.jsx(a.Fragment,{children:a.jsxs("header",{className:c("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:[a.jsxs("div",{className:"wu-flex wu-items-center wu-gap-2",children:[a.jsx("nav",{className:"wu-flex wu-items-center wu-justify-start wu-gap-4 wu-primary-nav-left",children:i}),w.length>0&&a.jsxs(De,{children:[a.jsx(Ue,{className:"wu-p-1 wu-pb-0 wu-rounded-sm focus:wu-outline-none focus:wu-bg-gray-25","aria-label":"more",children:a.jsx("span",{className:"wm-more-vert"})}),a.jsx(Se,{className:c(es.wuPrimaryPopoverContent,"wu-primary-nav-popover-left"),align:"start",sideOffset:12,children:w})]})]}),r&&a.jsxs(a.Fragment,{children:[a.jsx("section",{className:"wu-items-center wu-justify-end wu-hidden wu-gap-4 sm:wu-flex wu-primary-nav-right",ref:l,children:r}),a.jsxs(De,{children:[a.jsx(Ue,{className:"sm:wu-hidden",children:a.jsx("span",{className:"wu-text-lg wm-menu"})}),a.jsx(Se,{className:"wu-bg-white wu-border wu-border-blue-p wu-w-fit wu-primary-nav-popover-right",align:"end",sideOffset:4,children:r})]})]})]})})},Ca={wuSecondaryLink:"_wuSecondaryLink_1edl1_1",wuSecondaryNav:"_wuSecondaryNav_1edl1_6"},Gn=e=>{const{Links:t,children:r,className:s,...u}=e,o=f.useMemo(()=>t.map((p,b)=>f.cloneElement(p.link,{key:b,className:c(Ca.wuSecondaryLink,p.link.props.className,"wu-secondary-nav-link-container"),children:a.jsxs(a.Fragment,{children:[f.cloneElement(p.imgOrIcon,{className:c("wu-w-5 wu-h-5 wu-flex wu-items-center wu-justify-center wu-text-lg wu-leading-5",p.imgOrIcon.props.className)}),a.jsx("div",{className:"wu-secondary-nav-link",children:p.link.props.children})]})})),[t]),n=f.useRef(null),l=f.useRef(null),i=f.useRef(null),[w,d]=Rr(o,n,i);return a.jsx(a.Fragment,{children:a.jsxs("header",{className:c("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:[a.jsxs("div",{className:"wu-flex wu-items-center wu-justify-start wu-gap-2",children:[a.jsx("nav",{className:c(Ca.wuSecondaryNav,"wu-flex wu-items-center wu-justify-start wu-w-full wu-h-full wu-secondary-nav-left"),ref:l,children:w}),d.length>0&&a.jsxs(De,{children:[a.jsx(Ue,{className:"wu-p-1 wu-pb-0 wu-rounded-sm focus:wu-outline-none focus:wu-bg-gray-25","aria-label":"more",children:a.jsx("span",{className:"wm-more-vert"})}),a.jsx(Se,{className:c(Ca.wuSecondaryNavPopover,"wu-secondary-nav-popover-left"),align:"start",sideOffset:12,children:d})]})]}),r&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"wu-items-center wu-justify-end wu-hidden sm:wu-flex",ref:i,children:r}),a.jsxs(De,{children:[a.jsx(Ue,{className:"sm:wu-hidden",children:a.jsx("span",{className:"wu-text-lg wm-menu"})}),a.jsx(Se,{className:"wu-bg-white wu-border wu-border-blue-p wu-w-fit wu-secondary-nav-popover-right",align:"end",sideOffset:12,children:r})]})]})]})})},ts=f.forwardRef(({totalRows:e,initialPage:t=0,initialPageSize:r=100,onPageChange:s,className:u,disabled:o=!1,...n},l)=>{const[i,w]=f.useState(t),[d,p]=f.useState(r);f.useEffect(()=>{w(t),p(r)},[t,r]);const b=Math.ceil(e/d),h=i*d+1,x=Math.min((i+1)*d,e),m=Array.from({length:b},(y,C)=>C),v=f.useCallback(y=>{y>=0&&y<b&&(w(y),s==null||s(y))},[b,s]),E=7*32;return a.jsxs("div",{className:c("wu-flex wu-items-center wu-gap-[2px]",u,"wu-pagination"),...n,role:"navigation",children:[a.jsx(as,{label:"Previous page",onClick:()=>v(i-1),disabled:i===0||o,icon:"wm-arrow-back-ios-new",className:"hover:wu-bg-gray-20 rtl:wu-rotate-180 wu-prev-btn"}),a.jsx(Vr,{name:`${h} - ${x}`,className:"wu-w-[96px] wu-min-w-[96px] wu-pagination-menu",align:"end",disabled:o,children:a.jsx(tt,{style:{maxHeight:E+"px"},dir:n.dir,children:m.length>100?a.jsx(et,{className:"wu-pagination-list",containerHeight:E,list:m,callback:(y,C)=>a.jsxs(ya,{onSelect:()=>v(C),className:c("wu-py-2",C===i&&"wu-bg-gray-20","wu-pagination-item"),children:[C*d+1," -"," ",Math.min((C+1)*d,e)]},y)}):m.map(y=>a.jsxs(ya,{onSelect:()=>v(y),className:c(y===i&&"wu-bg-gray-20","wu-py-2 hover:wu-bg-gray-20","wu-pagination-item"),children:[y*d+1," -"," ",Math.min((y+1)*d,e)]},y))})}),a.jsx(as,{label:"Next page",onClick:()=>v(i+1),disabled:i===b-1||o,icon:"wm-arrow-forward-ios",className:"hover:wu-bg-gray-20 rtl:wu-rotate-180 wu-next-btn"})]})});ts.displayName="WuPagination";const as=({label:e,onClick:t,disabled:r,icon:s,className:u})=>a.jsx(me,{variant:"iconOnly",onClick:t,disabled:r,className:c("wu-w-8 wu-h-8 wu-rounded-xs wu-group disabled:wu-text-zinc-300 disabled:wu-bg-white wu-text-gray-lead focus:wu-bg-color-none",u),"aria-label":e,children:a.jsx("span",{className:c("wu-text-sm",s)})}),Yn=({Trigger:e,children:t,className:r,dir:s,open:u,onOpenChange:o,modal:n,...l})=>a.jsxs(De,{open:u,onOpenChange:o,modal:n,children:[a.jsx(Ue,{asChild:!0,dir:s,children:e}),a.jsx(Se,{className:c("wu-w-80 wu-p-0 wu-border-blue-p wu-bg-white wu-dark:border-gray-switcher",r),dir:s,...l,children:t})]}),Kn=e=>a.jsx(nt.PopoverClose,{asChild:!0,children:a.jsx(me,{...e})}),rs=g.forwardRef(({className:e,...t},r)=>a.jsx(ct.Root,{className:c("wu-grid wu-gap-2",e),...t,ref:r}));rs.displayName=ct.Root.displayName;const ss=g.forwardRef(({className:e,...t},r)=>a.jsx(ct.Item,{ref:r,className:c("wu-group wu-aspect-square wu-h-4 wu-w-4 wu-rounded-full wu-border wu-border-gray-subtle wu-text-blue-p wu-ring-offset-white disabled:wu-cursor-not-allowed disabled:wu-opacity-50 hover:wu-border-blue-p hover:wu-bg-gray-20 data-[state=checked]:wu-border-blue-p hover:data-[state=checked]:wu-border-blue-q hover:data-[state=checked]:wu-bg-inherit focus:wu-outline-2 focus:wu-outline-offset-4 focus:wu-outline-blue-soft disabled:hover:wu-border-gray-subtle disabled:wu-hover:bg-gray-20 disabled:wu-bg-gray-20",e),...t,children:a.jsx(ct.Indicator,{className:"wu-flex wu-items-center wu-justify-center",children:a.jsx("div",{className:"wu-w-2 wu-h-2 wu-rounded-full wu-bg-blue-p group-hover:group-data-[state=checked]:wu-bg-blue-q"})})}));ss.displayName=ct.Item.displayName;const us=f.forwardRef((e,t)=>{const{options:r,defaultValue:s,onChange:u,label:o,dir:n,...l}=e;return a.jsxs(rs,{defaultValue:s,required:l.required,disabled:l.disabled,onValueChange:u,id:l.id,dir:n,name:l.name,className:c("w-fit",l.className),ref:t,style:l.style,children:[a.jsx(Dt,{htmlFor:l.id,className:"wu-text-sm wu-font-normal wu-text-gray-lead wu-leading-6 wu-radio-group-label",children:o}),r.map(i=>a.jsxs("div",{className:"wu-flex wu-items-center wu-gap-2 wu-radio-item-container",children:[a.jsx(ss,{value:i.value,id:i.value,disabled:i.disabled,required:i.required,"aria-label":i.value,className:"wu-peer wu-radio-item"}),a.jsx(Dt,{htmlFor:i.value,className:c(i.required&&"after:wu-content-['*'] after:wu-mx-[2px] after:wu-text-rose-500","wu-radio-item-label"),children:i.label})]},i.value))]})});us.displayName="WuRadioGroup";const Jn=e=>{const{children:t,...r}=e;return a.jsxs(tt,{...r,role:"complementary","aria-label":"ScrollArea",children:[t,a.jsx(va,{orientation:"horizontal"})]})},os=g.forwardRef(({className:e,orientation:t="horizontal",decorative:r=!0,...s},u)=>a.jsx(er.Root,{ref:u,decorative:r,orientation:t,className:c("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...s}));os.displayName=er.Root.displayName;function ns({className:e,...t}){return a.jsx("div",{className:c("animate-pulse rounded-md bg-muted",e),...t})}const Sa=768;function Xn(){const[e,t]=g.useState(void 0);return g.useEffect(()=>{const r=window.matchMedia(`(max-width: ${Sa-1}px)`),s=()=>{t(window.innerWidth<Sa)};return r.addEventListener("change",s),t(window.innerWidth<Sa),()=>r.removeEventListener("change",s)},[]),!!e}const Qn="sidebar_state",Zn=60*60*24*7,Rn="256px",el="256px",tl="3rem",al="b",ls=g.createContext(null);function $e(){const e=g.useContext(ls);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}const is=g.forwardRef(({defaultOpen:e=!0,open:t,onOpenChange:r,className:s,style:u,children:o,...n},l)=>{const i=Xn(),[w,d]=g.useState(!1),[p,b]=g.useState(e),h=t??p,x=g.useCallback(y=>{const C=typeof y=="function"?y(h):y;r?r(C):b(C),document.cookie=`${Qn}=${C}; path=/; max-age=${Zn}`},[r,h]),m=g.useCallback(()=>i?d(y=>!y):x(y=>!y),[i,x,d]);g.useEffect(()=>{const y=C=>{C.key===al&&(C.metaKey||C.ctrlKey)&&(C.preventDefault(),m())};return window.addEventListener("keydown",y),()=>window.removeEventListener("keydown",y)},[m]);const v=h?"expanded":"collapsed",E=g.useMemo(()=>({state:v,open:h,setOpen:x,isMobile:i,openMobile:w,setOpenMobile:d,toggleSidebar:m}),[v,h,x,i,w,d,m]);return a.jsx(ls.Provider,{value:E,children:a.jsx(fr,{delayDuration:0,children:a.jsx("div",{style:{"--sidebar-width":Rn,"--sidebar-width-icon":tl,...u},className:c("wu-group/sidebar-wrapper wu-flex wu-min-h-[calc(100svh-48px)] wu-w-full",s),ref:l,...n,children:o})})})});is.displayName="SidebarProvider";const cs=g.forwardRef(({side:e="left",variant:t="sidebar",collapsible:r="offcanvas",className:s,children:u,...o},n)=>{const{isMobile:l,state:i,openMobile:w,setOpenMobile:d}=$e();return r==="none"?a.jsx("div",{className:c("wu-flex wu-h-full wu-w-[--sidebar-width] wu-flex-col",s),ref:n,...o,children:u}):l?a.jsx(Wr,{open:w,onOpenChange:d,...o,children:a.jsxs(ma,{"data-sidebar":"sidebar","data-mobile":"true",className:"wu-w-[--sidebar-width] wu-bg-blue-sidebar wu-p-0 [&>button]:wu-hidden",style:{"--sidebar-width":el},side:e,children:[a.jsxs(Lr,{className:"sr-only",children:[a.jsx(xa,{children:"Sidebar"}),a.jsx(Or,{children:"Displays the mobile sidebar."})]}),a.jsx("div",{className:"wu-flex wu-flex-col wu-w-full wu-h-full",children:u})]})}):a.jsxs("div",{ref:n,className:"wu-hidden wu-group wu-peer md:wu-block","data-state":i,"data-collapsible":i==="collapsed"?r:"","data-variant":t,"data-side":e,children:[a.jsx("div",{className:c("wu-relative wu-w-[--sidebar-width] wu-bg-transparent wu-transition-[width] wu-duration-150 wu-ease-linear","group-data-[collapsible=offcanvas]:wu-w-0","group-data-[side=right]:wu-rotate-180",t==="floating"||t==="inset"?"group-data-[collapsible=icon]:wu-w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4))]":"group-data-[collapsible=icon]:wu-w-[--sidebar-width-icon]")}),a.jsx("div",{className:c("wu-fixed wu-inset-y-0 wu-z-10 wu-hidden wu-h-svh wu-w-[--sidebar-width] wu-transition-[left,right,width] wu-duration-150 wu-ease-linear md:wu-flex",e==="left"?"wu-left-0 group-data-[collapsible=offcanvas]:wu-left-[calc(var(--sidebar-width)*-1)]":"wu-right-0 group-data-[collapsible=offcanvas]:wu-right-[calc(var(--sidebar-width)*-1)]",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),...o,children:a.jsx("div",{"data-sidebar":"sidebar",className:"wu-flex wu-h-full wu-w-full wu-flex-col wu-bg-[#eef3fb] group-data-[variant=floating]:wu-rounded-lg group-data-[variant=floating]:wu-border group-data-[variant=floating]:wu-border-sidebar-border group-data-[variant=floating]:wu-shadow",children:u})})]})});cs.displayName="Sidebar";const ws=g.forwardRef(({className:e,onClick:t,children:r,...s},u)=>{const{toggleSidebar:o}=$e();return a.jsxs(Ze,{ref:u,"data-sidebar":"trigger",variant:"secondary",className:c("wu-h-8 wu-w-8 wu-min-w-0 wu-p-0 wu-text-2xl wu-font-light hover:wu-bg-blue-sidebarHover wu-text-blue-q",e),onClick:n=>{t==null||t(n),o()},...s,children:[r,a.jsx("span",{className:"wu-sr-only",children:"Toggle Sidebar"})]})});ws.displayName="SidebarTrigger";const rl=g.forwardRef(({className:e,...t},r)=>{const{toggleSidebar:s}=$e();return a.jsx("button",{ref:r,"data-sidebar":"rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:s,title:"Toggle Sidebar",className:c("wu-absolute wu-inset-y-0 wu-z-20 wu-hidden wu-w-4 wu-translate-x-1/2 wu-transition-all wu-ease-linear after:wu-absolute after:wu-inset-y-0 after:wu-left-1/2 after:wu-w-[2px] group-data-[side=left]:wu-right-4 group-data-[side=right]:wu-left-0 sm:wu-flex","[[data-side=left]_&]:wu-cursor-w-resize [[data-side=right]_&]:wu-cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:wu-cursor-e-resize [[data-side=right][data-state=collapsed]_&]:wu-cursor-w-resize","group-data-[collapsible=offcanvas]:wu-translate-x-0 group-data-[collapsible=offcanvas]:after:wu-left-full","[[data-side=left][data-collapsible=offcanvas]_&]:wu-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:wu-left-2",e),...t})});rl.displayName="SidebarRail";const ds=g.forwardRef(({className:e,...t},r)=>a.jsx("main",{ref:r,className:c("wu-relative wu-flex wu-w-full wu-flex-1 wu-flex-col","md:peer-data-[variant=inset]:wu-m-2 md:peer-data-[state=collapsed]:peer-data-[variant=inset]:wu-ml-2 md:peer-data-[variant=inset]:wu-ml-0 md:peer-data-[variant=inset]:wu-rounded-xl md:peer-data-[variant=inset]:wu-shadow",e),...t}));ds.displayName="SidebarInset";const sl=g.forwardRef(({className:e,...t},r)=>a.jsx(ia,{ref:r,"data-sidebar":"input",className:c("wu-h-8 wu-w-full wu-shadow-none focus-visible:wu-ring-2",e),...t}));sl.displayName="SidebarInput";const fs=g.forwardRef(({className:e,...t},r)=>a.jsx("div",{ref:r,"data-sidebar":"header",className:c("wu-flex wu-flex-col wu-gap-2 wu-p-2",e),...t}));fs.displayName="SidebarHeader";const ps=g.forwardRef(({className:e,...t},r)=>a.jsx("div",{ref:r,"data-sidebar":"footer",className:c("wu-flex wu-flex-col wu-gap-2 wu-pb-2",e),...t}));ps.displayName="SidebarFooter";const ul=g.forwardRef(({className:e,...t},r)=>a.jsx(os,{ref:r,"data-sidebar":"separator",className:c("wu-mx-2 wu-w-auto",e),...t}));ul.displayName="SidebarSeparator";const bs=g.forwardRef(({className:e,...t},r)=>a.jsx("div",{ref:r,"data-sidebar":"content",className:c("wu-flex wu-min-h-0 wu-flex-1 wu-flex-col wu-gap-2 wu-overflow-auto group-data-[collapsible=icon]:wu-overflow-hidden",e),...t}));bs.displayName="SidebarContent";const gs=g.forwardRef(({className:e,...t},r)=>a.jsx("div",{ref:r,"data-sidebar":"group",className:c("wu-relative wu-flex wu-w-full wu-min-w-0 wu-flex-col wu-p-2",e),...t}));gs.displayName="SidebarGroup";const hs=g.forwardRef(({className:e,asChild:t=!1,...r},s)=>{const u=t?Xe.Slot:"div";return a.jsx(u,{ref:s,"data-sidebar":"group-label",className:c("wu-flex wu-h-8 wu-shrink-0 wu-items-center wu-rounded-md wu-px-2 wu-text-xs wu-font-medium wu-outline-none wu-transition-[margin,opacity] wu-duration-150 wu-ease-linear focus-visible:wu-ring-2 [&>svg]:wu-size-4 [&>svg]:wu-shrink-0","group-data-[collapsible=icon]:wu-opacity-0",e),...r})});hs.displayName="SidebarGroupLabel";const ol=g.forwardRef(({className:e,asChild:t=!1,...r},s)=>{const u=t?Xe.Slot:"button";return a.jsx(u,{ref:s,"data-sidebar":"group-action",className:c("wu-absolute wu-right-3 wu-top-3.5 wu-flex wu-aspect-square wu-w-5 wu-items-center wu-justify-center wu-rounded-md wu-p-0 wu-outline-none wu-transition-transform focus-visible:wu-ring-2 [&>svg]:wu-size-4 [&>svg]:wu-shrink-0","after:wu-absolute after:wu-inset-2 after:md:wu-hidden","group-data-[collapsible=icon]:wu-hidden",e),...r})});ol.displayName="SidebarGroupAction";const ms=g.forwardRef(({className:e,...t},r)=>a.jsx("div",{ref:r,"data-sidebar":"group-content",className:c("wu-w-full wu-text-sm",e),...t}));ms.displayName="SidebarGroupContent";const Ea=g.forwardRef(({className:e,...t},r)=>a.jsx("ul",{ref:r,"data-sidebar":"menu",className:c("wu-flex wu-w-full wu-min-w-0 wu-flex-col wu-gap-1",e),...t}));Ea.displayName="SidebarMenu";const xs=g.forwardRef(({className:e,...t},r)=>a.jsx("li",{ref:r,"data-sidebar":"menu-item",className:c("wu-group/menu-item wu-relative",e),...t}));xs.displayName="SidebarMenuItem";const nl=Ce.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"}}),ys=g.forwardRef(({asChild:e=!1,isActive:t=!1,variant:r="default",size:s="default",tooltip:u,className:o,...n},l)=>{const i=e?Xe.Slot:"button",{isMobile:w,state:d}=$e(),p=a.jsx(i,{ref:l,"data-sidebar":"menu-button","data-size":s,"data-active":t,className:c(nl({variant:r,size:s}),o),...n});return u?(typeof u=="string"&&(u={children:u}),a.jsxs(pr,{children:[a.jsx(br,{asChild:!0,children:p}),a.jsx(ca,{side:"right",align:"center",hidden:d!=="collapsed"||w,...u})]})):p});ys.displayName="SidebarMenuButton";const ll=g.forwardRef(({className:e,asChild:t=!1,showOnHover:r=!1,...s},u)=>{const o=t?Xe.Slot:"button";return a.jsx(o,{ref:u,"data-sidebar":"menu-action",className:c("wu-absolute wu-right-1 wu-top-1.5 wu-flex wu-aspect-square wu-w-5 wu-items-center wu-justify-center wu-rounded-md wu-p-0 wu-outline-none wu-transition-transform focus-visible:wu-ring-2 [&>svg]:wu-size-4 [&>svg]:wu-shrink-0","after:wu-absolute after:wu-inset-2 after:md:wu-hidden","peer-data-[size=sm]/menu-button:wu-top-1","peer-data-[size=default]/menu-button:wu-top-1.5","peer-data-[size=lg]/menu-button:wu-top-2.5","group-data-[collapsible=icon]:wu-hidden",r&&"group-focus-within/menu-item:wu-opacity-100 group-hover/menu-item:wu-opacity-100 data-[state=open]:wu-opacity-100 md:wu-opacity-0",e),...s})});ll.displayName="SidebarMenuAction";const il=g.forwardRef(({className:e,...t},r)=>a.jsx("div",{ref:r,"data-sidebar":"menu-badge",className:c("wu-pointer-events-none wu-absolute wu-right-1 wu-flex wu-h-5 wu-min-w-5 wu-select-none wu-items-center wu-justify-center wu-rounded-md wu-px-1 wu-text-xs wu-font-medium wu-tabular-nums","","peer-data-[size=sm]/menu-button:wu-top-1","peer-data-[size=default]/menu-button:wu-top-1.5","peer-data-[size=lg]/menu-button:wu-top-2.5","group-data-[collapsible=icon]:wu-hidden",e),...t}));il.displayName="SidebarMenuBadge";const cl=g.forwardRef(({className:e,showIcon:t=!1,...r},s)=>{const u=g.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return a.jsxs("div",{ref:s,"data-sidebar":"menu-skeleton",className:c("wu-flex wu-h-8 wu-items-center wu-gap-2 wu-rounded-md wu-px-2",e),...r,children:[t&&a.jsx(ns,{className:"wu-rounded-md wu-size-4","data-sidebar":"menu-skeleton-icon"}),a.jsx(ns,{className:"wu-h-4 wu-max-w-[--skeleton-width] wu-flex-1","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":u}})]})});cl.displayName="SidebarMenuSkeleton";const wl=g.forwardRef(({className:e,...t},r)=>a.jsx("ul",{ref:r,"data-sidebar":"menu-sub",className:c("wu-mx-3.5 wu-flex wu-min-w-0 wu-translate-x-px wu-flex-col wu-gap-1 wu-border-l wu-px-2.5 wu-py-0.5","group-data-[collapsible=icon]:wu-hidden",e),...t}));wl.displayName="SidebarMenuSub";const dl=g.forwardRef(({...e},t)=>a.jsx("li",{ref:t,...e}));dl.displayName="SidebarMenuSubItem";const fl=g.forwardRef(({asChild:e=!1,size:t="md",isActive:r,className:s,...u},o)=>{const n=e?Xe.Slot:"a";return a.jsx(n,{ref:o,"data-sidebar":"menu-sub-button","data-size":t,"data-active":r,className:c("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})});fl.displayName="SidebarMenuSubButton";const pl=({children:e,Sidebar:t,className:r,defaultOpen:s=!0,open:u,onOpenChange:o,style:n})=>a.jsxs(is,{defaultOpen:s,open:u,onOpenChange:o,children:[a.jsxs(cs,{variant:"sidebar",collapsible:"icon",className:c("wu-top-12 wu-h-[calc(100%-48px)] wu-shadow-sidebar wu-border-none",r),style:n,role:"complementary",children:[a.jsx(fs,{className:"wu-py-2",children:a.jsx(vs,{})}),t]}),a.jsx(ds,{children:e})]}),vs=e=>{const{state:t,isMobile:r,openMobile:s}=$e();return a.jsx(ws,{...e,children:a.jsx(Na,{showMenu:r?s:t==="expanded"})})},bl=({className:e,children:t,...r})=>{const s=f.useRef(null),u=f.useRef(null),o=({currentTarget:l})=>{const{scrollTop:i,clientHeight:w,scrollHeight:d}=l;s.current&&s.current.classList.toggle("wu-border-[#1b338014]",i!==0),u.current&&u.current.classList.toggle("wu-border-[#1b338014]",i+w!==d)},n="wu-w-[calc(100%-16px)] wu-mx-auto wu-border-transparent";return a.jsxs(bs,{...r,className:c("wu-overflow-hidden wu-gap-0",e),children:[a.jsx("hr",{className:n,ref:s}),a.jsx(tt,{onScroll:o,className:"wu-gap-2",thumbColor:"#b9c3dc",railColor:"#00000000","data-testid":"scroll-area",children:t}),a.jsx("hr",{className:n,ref:u})]})},gl=e=>a.jsx(ps,{...e,children:e.children}),hl=({label:e,children:t,...r})=>a.jsxs(gs,{...r,className:"wu-p-0",children:[a.jsx("div",{className:"wu-h-8",children:a.jsx(hs,{className:"wu-items-end wu-px-4 wu-text-xs wu-font-normal wu-leading-4 wu-text-blue-q",children:e})}),a.jsx(ms,{children:a.jsx(Ea,{children:t})})]}),ml=e=>a.jsx(Ea,{...e}),xl=({Icon:e,children:t,className:r,isActive:s,...u})=>{const{state:o}=$e(),[n,l]=f.useState(),i=t&&f.cloneElement(t,{children:a.jsxs("div",{className:"wu-flex wu-items-center wu-gap-2 wu-overflow-hidden wu-text-base wu-truncate wu-text-ellipsis",children:[e,a.jsx("span",{className:c("wu-text-sm wu-leading-4 wu-transition-opacity wu-duration-150",o==="collapsed"&&"wu-opacity-0"),children:t.props.children})]})}),w=f.useRef(null);return f.useEffect(()=>{var d;l(((d=w.current)==null?void 0:d.textContent)||"")},[]),a.jsx(xs,{...u,className:"wu-flex wu-items-center wu-gap-2 wu-px-2",children:a.jsx(ys,{className:c("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:w,children:i})})};function yl({controlled:e,default:t,name:r,state:s="value"}){const{current:u}=g.useRef(e!==void 0),[o,n]=g.useState(t),l=u?e:o;if(process.env.NODE_ENV!=="production"){g.useEffect(()=>{u!==(e!==void 0)&&console.error([`Base UI: A component is changing the ${u?"":"un"}controlled ${s} state of ${r} to be ${u?"un":""}controlled.`,"Elements should not switch from uncontrolled to controlled (or vice versa).",`Decide between using a controlled or uncontrolled ${r} element for the lifetime of the component.`,"The nature of the state is determined during the first render. It's considered controlled if the value is not `undefined`.","More info: https://fb.me/react-controlled-components"].join(`
|
|
5
|
+
`))},[s,r,e]);const{current:w}=g.useRef(t);g.useEffect(()=>{!u&&JSON.stringify(w)!==JSON.stringify(t)&&console.error([`Base UI: A component is changing the default ${s} state of an uncontrolled ${r} after being initialized. To suppress this warning opt to use a controlled ${r}.`].join(`
|
|
6
|
+
`))},[JSON.stringify(t)])}const i=g.useCallback(w=>{u||n(w)},[]);return[l,i]}const Ns={};function at(e,t){const r=g.useRef(Ns);return r.current===Ns&&(r.current=e(t)),r}const Ta=g[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],vl=Ta&&Ta!==g.useLayoutEffect?Ta:e=>e();function xe(e){const t=at(Nl).current;return t.next=e,vl(t.effect),t.trampoline}function Nl(){const e={next:void 0,callback:Cl,trampoline:(...t)=>{var r;return(r=e.callback)==null?void 0:r.call(e,...t)},effect:()=>{e.callback=e.next}};return e}function Cl(){if(process.env.NODE_ENV!=="production")throw new Error("Base UI: Cannot call an event handler while rendering.")}const Sl=[];function Cs(e){g.useEffect(e,Sl)}const bt=0;class Lt{constructor(){Tt(this,"currentId",bt);Tt(this,"clear",()=>{this.currentId!==bt&&(clearTimeout(this.currentId),this.currentId=bt)});Tt(this,"disposeEffect",()=>this.clear)}static create(){return new Lt}start(t,r){this.clear(),this.currentId=setTimeout(()=>{this.currentId=bt,r()},t)}isStarted(){return this.currentId!==bt}}function ka(){const e=at(Lt.create).current;return Cs(e.disposeEffect),e}const Ss=0;class Ia extends Lt{constructor(){super(...arguments);Tt(this,"clear",()=>{this.currentId!==Ss&&(clearInterval(this.currentId),this.currentId=Ss)})}static create(){return new Ia}start(r,s){this.clear(),this.currentId=setInterval(()=>{s()},r)}}function El(){const e=at(Ia.create).current;return Cs(e.disposeEffect),e}const ge=typeof document<"u"?g.useLayoutEffect:()=>{};function Da(e){const t=at(Tl,e).current;return t.next=e,ge(t.effect),t}function Tl(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}function kl(){const[,e]=g.useState({});return g.useCallback(()=>{e({})},[])}function Il(){return typeof window<"u"}function Es(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Dl(e){return Il()?e instanceof HTMLElement||e instanceof Es(e).HTMLElement:!1}function Ml(e){return(e==null?void 0:e.ownerDocument)||document}const Ot=typeof navigator<"u",Ma=Pl(),_l=Ol(),Al=Ll();typeof CSS>"u"||!CSS.supports||CSS.supports("-webkit-backdrop-filter:none");const Wl=Ma.platform==="MacIntel"&&Ma.maxTouchPoints>1?!0:/iP(hone|ad|od)|iOS/.test(Ma.platform);Ot&&_l.toLowerCase().startsWith("mac")&&navigator.maxTouchPoints,Al.includes("jsdom/");function Pl(){if(!Ot)return{platform:"",maxTouchPoints:-1};const e=navigator.userAgentData;return e!=null&&e.platform?{platform:e.platform,maxTouchPoints:navigator.maxTouchPoints}:{platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??-1}}function Ll(){if(!Ot)return"";const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:t,version:r})=>`${t}/${r}`).join(" "):navigator.userAgent}function Ol(){if(!Ot)return"";const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform??""}const _a=g.createContext(void 0);process.env.NODE_ENV!=="production"&&(_a.displayName="NumberFieldRootContext");function Ft(){const e=g.useContext(_a);if(e===void 0)throw new Error("Base UI: NumberFieldRootContext is missing. NumberField parts must be placed within <NumberField.Root>.");return e}function _e(){}const Be=Object.freeze({});let Ts=function(e){return e.disabled="data-disabled",e.valid="data-valid",e.invalid="data-invalid",e.touched="data-touched",e.dirty="data-dirty",e.filled="data-filled",e.focused="data-focused",e}({});const Aa={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},Fl={valid(e){return e===null?null:e?{[Ts.valid]:""}:{[Ts.invalid]:""}}},ks=g.createContext({invalid:void 0,controlId:void 0,setControlId:_e,labelId:void 0,setLabelId:_e,messageIds:[],setMessageIds:_e,name:void 0,validityData:{state:Aa,errors:[],error:"",value:"",initialValue:null},setValidityData:_e,disabled:void 0,touched:!1,setTouched:_e,dirty:!1,setDirty:_e,filled:!1,setFilled:_e,focused:!1,setFocused:_e,validate:()=>null,validationMode:"onBlur",validationDebounceTime:0,state:{disabled:!1,valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},markedDirtyRef:{current:!1}});process.env.NODE_ENV!=="production"&&(ks.displayName="FieldRootContext");function Bt(e=!0){const t=g.useContext(ks);if(t.setControlId===_e&&!e)throw new Error("Base UI: FieldRootContext is missing. Field parts must be placed within <Field.Root>.");return t}const gt={inputValue:()=>null,value:()=>null};function Is(e,t,r,s){const u=at(Ds).current;return ql(u,e,t,r,s)&&Ms(u,[e,t,r,s]),u.callback}function Bl(e){const t=at(Ds).current;return Vl(t,e)&&Ms(t,e),t.callback}function Ds(){return{callback:null,cleanup:null,refs:[]}}function ql(e,t,r,s,u){return e.refs[0]!==t||e.refs[1]!==r||e.refs[2]!==s||e.refs[3]!==u}function Vl(e,t){return e.refs.length!==t.length||e.refs.some((r,s)=>r!==t[s])}function Ms(e,t){if(e.refs=t,t.every(r=>r==null)){e.callback=null;return}e.callback=r=>{if(e.cleanup&&(e.cleanup(),e.cleanup=null),r!=null){const s=Array(t.length).fill(null);for(let u=0;u<t.length;u+=1){const o=t[u];if(o!=null)switch(typeof o){case"function":{const n=o(r);typeof n=="function"&&(s[u]=n);break}case"object":{o.current=r;break}}}e.cleanup=()=>{for(let u=0;u<t.length;u+=1){const o=t[u];if(o!=null)switch(typeof o){case"function":{const n=s[u];typeof n=="function"?n():o(null);break}case"object":{o.current=null;break}}}}}}}const Hl=parseInt(g.version,10);function zl(e){return Hl>=e}function _s(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}function Ul(e,t){const r={};for(const s in e){const u=e[s];if(t!=null&&t.hasOwnProperty(s)){const o=t[s](u);o!=null&&Object.assign(r,o);continue}u===!0?r[`data-${s.toLowerCase()}`]="":u&&(r[`data-${s.toLowerCase()}`]=u.toString())}return r}function $l(e,t){return typeof e=="function"?e(t):e}const ht={};function qt(e,t,r,s,u){let o={...Wa(e,ht)};return t&&(o=Vt(o,t)),r&&(o=Vt(o,r)),s&&(o=Vt(o,s)),o}function jl(e){if(e.length===0)return ht;if(e.length===1)return Wa(e[0],ht);let t={...Wa(e[0],ht)};for(let r=1;r<e.length;r+=1)t=Vt(t,e[r]);return t}function Vt(e,t){return As(t)?t(e):Gl(e,t)}function Gl(e,t){if(!t)return e;for(const r in t){const s=t[r];switch(r){case"style":{e[r]=_s(e.style,s);break}case"className":{e[r]=Ws(e.className,s);break}default:Yl(r,s)?e[r]=Kl(e[r],s):e[r]=s}}return e}function Yl(e,t){const r=e.charCodeAt(0),s=e.charCodeAt(1),u=e.charCodeAt(2);return r===111&&s===110&&u>=65&&u<=90&&(typeof t=="function"||typeof t>"u")}function As(e){return typeof e=="function"}function Wa(e,t){return As(e)?e(t):e??ht}function Kl(e,t){return t?e?r=>{if(Jl(r)){const u=r;Pa(u);const o=t(u);return u.baseUIHandlerPrevented||e==null||e(u),o}const s=t(r);return e==null||e(r),s}:t:e}function Pa(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function Ws(e,t){return t?e?t+" "+e:t:e}function Jl(e){return e!=null&&typeof e=="object"&&"nativeEvent"in e}function mt(e,t,r={}){const s=t.render,u=Xl(t,r);if(r.enabled===!1)return null;const o=r.state??Be;return Ql(e,s,u,o)}function Xl(e,t={}){const{className:r,render:s}=e,{state:u=Be,ref:o,props:n,stateAttributesMapping:l,enabled:i=!0}=t,w=i?$l(r,u):void 0,d=i?Ul(u,l):Be,p=i?_s(d,Array.isArray(n)?jl(n):n)??Be:Be;return typeof document<"u"&&(i?Array.isArray(o)?p.ref=Bl([p.ref,Ps(s),...o]):p.ref=Is(p.ref,Ps(s),o):Is(null,null)),i?(w!==void 0&&(p.className=Ws(p.className,w)),p):Be}function Ql(e,t,r,s){if(t){if(typeof t=="function")return t(r,s);const u=qt(r,t.props);return u.ref=r.ref,g.cloneElement(t,u)}if(e&&typeof e=="string")return Zl(e,r);throw new Error("Base UI: Render element or function are not defined.")}function Zl(e,t){return e==="button"?a.jsx("button",{type:"button",...t}):e==="img"?a.jsx("img",{alt:"",...t}):g.createElement(e,t)}function Ps(e){return e&&typeof e!="function"?zl(19)?e.props.ref:e.ref:null}const Ls=new Map;function xt(e,t){const r=JSON.stringify({locale:e,options:t}),s=Ls.get(r);if(s)return s;const u=new Intl.NumberFormat(e,t);return Ls.set(r,u),u}function rt(e,t,r){return e==null?"":xt(t,r).format(e)}function Os(e,t,r){return rt(e,t,{...r,maximumFractionDigits:20})}const Rl=["零","〇","一","二","三","四","五","六","七","八","九"],ei={零:"0","〇":"0",一:"1",二:"2",三:"3",四:"4",五:"5",六:"6",七:"7",八:"8",九:"9"},Fs=["٠","١","٢","٣","٤","٥","٦","٧","٨","٩"],Bs=["۰","۱","۲","۳","۴","۵","۶","۷","۸","۹"],La=["0","1","2","3","4","5","6","7","8","9"],qs=["%","٪","%","﹪"],Vs=["‰","؉"],Hs=["−","-","‒","–","—","﹣"],zs=["+","﹢"],ti=".",ai=",",ri=new RegExp(`[${Fs.join("")}]`,"g"),si=new RegExp(`[${Bs.join("")}]`,"g"),ui=new RegExp(`[${La.join("")}]`,"g"),oi=new RegExp(`[${Rl.join("")}]`,"g"),ni=new RegExp(`[${qs.join("")}]`),li=new RegExp(`[${Vs.join("")}]`),Oa=/[٠١٢٣٤٥٦٧٨٩]/,Us=/[۰۱۲۳۴۵۶۷۸۹]/,Fa=/[零〇一二三四五六七八九]/,$s=new RegExp(`[${La.join("")}]`),ii=[".",",",ti,ai,"٫","٬"],ci=new RegExp("\\p{Zs}","u"),wi=["+",...zs],di=["-",...Hs],Ht=e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),fi=e=>e.replace(/[-\\\]^]/g,t=>`\\${t}`),js=e=>`[${e.map(fi).join("")}]`,Gs=js(["-"].concat(Hs)),Ys=js(["+"].concat(zs)),Ks=new RegExp(Gs,"gu"),Js=new RegExp(Ys,"gu"),yt=new RegExp(Gs),zt=new RegExp(Ys);function Ba(e,t){const r=xt(e,t).formatToParts(11111.1),s={};return r.forEach(u=>{s[u.type]=u.value}),xt(e).formatToParts(.1).forEach(u=>{u.type==="decimal"&&(s[u.type]=u.value)}),s}function st(e,t,r){if(e==null)return null;let s=String(e).replace(new RegExp("\\p{Cf}","gu"),"").trim();s=s.replace(Ks,"-").replace(Js,"+");let u=!1;const o=s.match(/([+-])\s*$/);o&&(o[1]==="-"&&(u=!0),s=s.replace(/([+-])\s*$/,""));const n=s.match(/^\s*([+-])/);n&&(n[1]==="-"&&(u=!0),s=s.replace(/^\s*[+-]/,""));let l=t;l===void 0&&(Oa.test(s)||Us.test(s)?l="ar":Fa.test(s)&&(l="zh"));const{group:i,decimal:w,currency:d}=Ba(l,r),p=xt(l,r).formatToParts(1).filter(T=>T.type==="unit").map(T=>Ht(T.value)),b=p.length?new RegExp(p.join("|"),"g"):null;let h=null;i&&(h=new RegExp("\\p{Zs}","u").test(i)?new RegExp("\\p{Zs}","gu"):new RegExp(Ht(i),"g"));let m=[{regex:i?h:null,replacement:""},{regex:w?new RegExp(Ht(w),"g"):null,replacement:"."},{regex:/./g,replacement:"."},{regex:/,/g,replacement:""},{regex:/٫/g,replacement:"."},{regex:/٬/g,replacement:""},{regex:d?new RegExp(Ht(d),"g"):null,replacement:""},{regex:b,replacement:""},{regex:ri,replacement:T=>String(Fs.indexOf(T))},{regex:si,replacement:T=>String(Bs.indexOf(T))},{regex:ui,replacement:T=>String(La.indexOf(T))},{regex:oi,replacement:T=>ei[T]}].reduce((T,{regex:_,replacement:D})=>_?T.replace(_,D):T,s);const v=m.lastIndexOf(".");if(v!==-1&&(m=`${m.slice(0,v).replace(/\./g,"")}.${m.slice(v+1).replace(/\./g,"")}`),/^[-+]?Infinity$/i.test(s)||/[∞]/.test(s))return null;const E=(u?"-":"")+m;let y=parseFloat(E);const C=r==null?void 0:r.style,N=C==="unit"&&(r==null?void 0:r.unit)==="percent",I=ni.test(e)||C==="percent";return li.test(e)?y/=1e3:!N&&I&&(y/=100),Number.isNaN(y)?null:y}const pi={...g};let Xs=0;function bi(e,t="mui"){const[r,s]=g.useState(e),u=e||r;return g.useEffect(()=>{r==null&&(Xs+=1,s(`${t}-${Xs}`))},[r,t]),u}const Qs=pi.useId;function gi(e,t){if(Qs!==void 0){const r=Qs();return e??`${t}-${r}`}return bi(e,t)}function hi(e){return gi(e,"base-ui")}const mi=60,xi=400,yi=50,vi=3,Ni=8,Ut=1;function Ci(e,t=Number.MIN_SAFE_INTEGER,r=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,r))}function $t(e,t={}){return parseFloat(xt("en-US",{maximumFractionDigits:t.maximumFractionDigits,minimumFractionDigits:t.minimumFractionDigits,useGrouping:!1}).format(e))}function Si(e,{step:t,minWithDefault:r,maxWithDefault:s,minWithZeroDefault:u,format:o,snapOnStep:n,small:l}){if(e===null)return e;const i=Ci(e,r,s);if(t!=null&&n){if(l){const d=(i-u)/t,p=Math.round(d),b=u+p*t;return $t(b,o)}const w=r!==Number.MIN_SAFE_INTEGER?r:u;if(t>0){const d=i-t,p=Math.floor((d-w)/t);return $t(w+p*t+t,o)}if(t<0){const d=Math.abs(t),p=i-t,b=Math.ceil((p-w)/d);return $t(w+b*d+t,o)}}return $t(i,o)}function Zs(e,t,r){let s=!1,u=!1;const o=Be;return{reason:e,event:t??new Event("base-ui"),cancel(){s=!0},allowPropagation(){u=!0},get isCanceled(){return s},get isPropagationAllowed(){return u},...o}}function jt(e,t,r){const s=Be;return{reason:e,event:t??new Event("base-ui"),...s}}function Ei(e){e.preventDefault(),e.stopPropagation()}function Ti(e){return"nativeEvent"in e}const Rs=g.forwardRef(function(t,r){const{id:s,min:u,max:o,smallStep:n=.1,step:l=1,largeStep:i=10,required:w=!1,disabled:d=!1,readOnly:p=!1,name:b,defaultValue:h,value:x,onValueChange:m,onValueCommitted:v,allowWheelScrub:E=!1,snapOnStep:y=!1,format:C,locale:N,render:I,className:M,inputRef:T,..._}=t,{setControlId:D,setDirty:F,validityData:O,setValidityData:P,disabled:A,setFilled:L,invalid:q,name:W,state:$}=Bt(),H=A||d,Q=W??b,[ae,le]=g.useState(!1),ee=u??Number.MIN_SAFE_INTEGER,B=o??Number.MAX_SAFE_INTEGER,K=u??0,Z=C==null?void 0:C.style,j=g.useRef(null),Ee=hi(s);ge(()=>(D(Ee),()=>{D(void 0)}),[Ee,D]);const[Te,ye]=yl({controlled:x,default:h,name:"NumberField",state:"value"}),k=Te??null,V=Da(k);ge(()=>{L(k!==null)},[L,k]);const ne=kl(),U=Da(C),ie=xe(m),te=g.useRef(!1),de=xe((re,G)=>{te.current=!1,v==null||v(re,G)}),fe=ka(),Ae=El(),ve=ka(),We=g.useRef(!1),Pe=g.useRef(0),Le=g.useRef(!0),Ge=g.useRef(null),Zt=g.useRef(()=>{});ge(()=>{O.initialValue===null&&k!==O.initialValue&&P(re=>({...re,initialValue:k}))},[P,O.initialValue,k]);const[Ye,Ke]=g.useState(()=>x!==void 0?eu(k,N,C):rt(k,N,C)),[Ct,ut]=g.useState("numeric"),se=xe(()=>{const{decimal:re,group:G,currency:ce}=Ba(N,C),J=new Set;ii.forEach(oe=>J.add(oe)),re&&J.add(re),G&&(J.add(G),ci.test(G)&&J.add(" "));const ke=Z==="percent"||Z==="unit"&&(C==null?void 0:C.unit)==="percent",Ne=Z==="percent"||Z==="unit"&&(C==null?void 0:C.unit)==="permille";return ke&&qs.forEach(oe=>J.add(oe)),Ne&&Vs.forEach(oe=>J.add(oe)),Z==="currency"&&ce&&J.add(ce),wi.forEach(oe=>J.add(oe)),ee<0&&di.forEach(oe=>J.add(oe)),J}),he=xe(re=>re!=null&&re.altKey?n:re!=null&&re.shiftKey?i:l),St=xe((re,G,ce)=>{const J=G,ke=G&&Ti(G)?G.nativeEvent:G,Ne=Zs("none",ke),oe=Si(re,{step:ce?he(J)*ce:void 0,format:U.current,minWithDefault:ee,maxWithDefault:B,minWithZeroDefault:K,snapOnStep:y,small:(J==null?void 0:J.altKey)??!1});if(oe!==k||re!==k||Le.current===!1){if(Ge.current=oe,ie==null||ie(oe,Ne),Ne.isCanceled)return;ye(oe),F(oe!==O.initialValue),te.current=!0}Le.current&&Ke(rt(oe,N,C)),ne()}),Et=xe((re,G,ce,J)=>{const ke=ce??V.current,Ne=typeof ke=="number"?ke+re*G:Math.max(0,u??0);St(Ne,J,G)}),ot=xe(()=>{ve.clear(),fe.clear(),Ae.clear(),Zt.current(),Pe.current=0}),zu=xe((re,G)=>{if(ot(),!j.current)return;const ce=Es(j.current);function J(Ne){Ne.preventDefault()}ce.addEventListener("contextmenu",J),Zt.current=()=>{ce.removeEventListener("contextmenu",J)},ce.addEventListener("pointerup",Ne=>{We.current=!1,ot();const oe=Ge.current??V.current;de(oe,jt("none",Ne))},{once:!0});function ke(){const Ne=he(G)??Ut;Et(Ne,re?1:-1,void 0,G)}ke(),fe.start(xi,()=>{Ae.start(mi,ke)})});ge(function(){if(!Le.current)return;const G=x!==void 0?eu(k,N,C):rt(k,N,C);G!==Ye&&Ke(G)}),ge(function(){if(!Wl)return;let G="text";ee>=0&&(G="decimal"),ut(G)},[ee,Z]),g.useEffect(()=>()=>ot(),[ot]),g.useEffect(function(){const G=j.current;if(H||p||!E||!G)return;function ce(J){if(J.ctrlKey||Ml(j.current).activeElement!==j.current)return;J.preventDefault();const ke=he(J)??Ut;Et(ke,J.deltaY>0?-1:1,void 0,J)}return G.addEventListener("wheel",ce),()=>{G.removeEventListener("wheel",ce)}},[E,Et,H,p,i,l,he]);const Qa=g.useMemo(()=>({...$,disabled:H,readOnly:p,required:w,value:k,inputValue:Ye,scrubbing:ae}),[$,H,p,w,k,Ye,ae]),fc=g.useMemo(()=>({inputRef:j,inputValue:Ye,value:k,startAutoChange:zu,stopAutoChange:ot,minWithDefault:ee,maxWithDefault:B,disabled:H,readOnly:p,id:Ee,setValue:St,incrementValue:Et,getStepAmount:he,allowInputSyncRef:Le,formatOptionsRef:U,valueRef:V,lastChangedValueRef:Ge,hasPendingCommitRef:te,isPressedRef:We,intentionalTouchCheckTimeout:ve,movesAfterTouchRef:Pe,name:Q,required:w,invalid:q,inputMode:Ct,getAllowedNonNumericKeys:se,min:u,max:o,setInputValue:Ke,locale:N,isScrubbing:ae,setIsScrubbing:le,state:Qa,onValueCommitted:de}),[j,Ye,k,zu,ot,ee,B,H,p,Ee,St,Et,he,Le,U,V,Ge,te,We,ve,Pe,Q,w,q,Ct,se,u,o,Ke,N,ae,Qa,de]),pc=mt("div",t,{ref:r,state:Qa,props:_,stateAttributesMapping:gt});return a.jsxs(_a.Provider,{value:fc,children:[pc,Q&&a.jsx("input",{type:"hidden",name:Q,ref:T,value:k??"",disabled:H,required:w})]})});process.env.NODE_ENV!=="production"&&(Rs.displayName="NumberFieldRoot");function eu(e,t,r){return(r==null?void 0:r.maximumFractionDigits)!=null||(r==null?void 0:r.minimumFractionDigits)!=null?rt(e,t,r):Os(e,t,r)}const tu=g.forwardRef(function(t,r){const{render:s,className:u,...o}=t,{state:n}=Ft();return mt("div",t,{ref:r,state:n,props:[{role:"group"},o],stateAttributesMapping:gt})});process.env.NODE_ENV!=="production"&&(tu.displayName="NumberFieldGroup");let qa;process.env.NODE_ENV!=="production"&&(qa=new Set);function au(...e){if(process.env.NODE_ENV!=="production"){const t=e.join(" ");qa.has(t)||(qa.add(t),console.error(`Base UI: ${t}`))}}const ru=g.createContext(void 0);process.env.NODE_ENV!=="production"&&(ru.displayName="CompositeRootContext");function ki(e=!1){const t=g.useContext(ru);if(t===void 0&&!e)throw new Error("Base UI: CompositeRootContext is missing. Composite parts must be placed within <Composite.Root>.");return t}function Ii(e){const{focusableWhenDisabled:t,disabled:r,composite:s=!1,tabIndex:u=0,isNativeButton:o}=e,n=s&&t!==!1,l=s&&t===!1;return{props:g.useMemo(()=>{const w={onKeyDown(d){r&&t&&d.key!=="Tab"&&d.preventDefault()}};return s||(w.tabIndex=u,!o&&r&&(w.tabIndex=t?u:-1)),(o&&(t||n)||!o&&r)&&(w["aria-disabled"]=r),o&&(!t||l)&&(w.disabled=r),w},[s,r,t,n,l,o,u])}}function su(e={}){const{disabled:t=!1,focusableWhenDisabled:r,tabIndex:s=0,native:u=!0}=e,o=g.useRef(null),n=ki(!0)!==void 0,l=xe(()=>{const b=o.current;return!!((b==null?void 0:b.tagName)==="A"&&(b!=null&&b.href))}),{props:i}=Ii({focusableWhenDisabled:r,disabled:t,composite:n,tabIndex:s,isNativeButton:u});process.env.NODE_ENV!=="production"&&g.useEffect(()=>{if(!o.current)return;const b=o.current.tagName==="BUTTON";u?b||au("A component that acts as a button was not rendered as a native <button>, which does not match the default. Ensure that the element passed to the `render` prop of the component is a real <button>, or set the `nativeButton` prop on the component to `false`."):b&&au("A component that acts as a button was rendered as a native <button>, which does not match the default. Ensure that the element passed to the `render` prop of the component is not a real <button>, or set the `nativeButton` prop on the component to `true`.")},[u]);const w=g.useCallback(()=>{const b=o.current;Di(b)&&n&&t&&i.disabled===void 0&&b.disabled&&(b.disabled=!1)},[t,i.disabled,n]);ge(w,[w]);const d=g.useCallback((b={})=>{const{onClick:h,onMouseDown:x,onKeyUp:m,onKeyDown:v,onPointerDown:E,...y}=b;return qt({type:u?"button":void 0,onClick(N){if(t){N.preventDefault();return}h==null||h(N)},onMouseDown(N){t||x==null||x(N)},onKeyDown(N){if(t||(Pa(N),v==null||v(N)),N.baseUIHandlerPrevented)return;const I=N.target===N.currentTarget&&!u&&!l()&&!t,M=N.key==="Enter",T=N.key===" ";I&&((T||M)&&N.preventDefault(),M&&(h==null||h(N)))},onKeyUp(N){t||(Pa(N),m==null||m(N)),!N.baseUIHandlerPrevented&&N.target===N.currentTarget&&!u&&!t&&N.key===" "&&(h==null||h(N))},onPointerDown(N){if(t){N.preventDefault();return}E==null||E(N)}},u?void 0:{role:"button"},i,y)},[t,i,u,l]),p=xe(b=>{o.current=b,w()});return{getButtonProps:d,buttonRef:p}}function Di(e){return Dl(e)&&e.tagName==="BUTTON"}function uu(e){const{allowInputSyncRef:t,disabled:r,formatOptionsRef:s,getStepAmount:u,id:o,incrementValue:n,inputRef:l,inputValue:i,intentionalTouchCheckTimeout:w,isIncrement:d,isPressedRef:p,locale:b,maxWithDefault:h,minWithDefault:x,movesAfterTouchRef:m,readOnly:v,setValue:E,startAutoChange:y,stopAutoChange:C,value:N,valueRef:I,lastChangedValueRef:M,onValueCommitted:T}=e,_=g.useRef({x:0,y:0}),D=g.useRef(!1),F=g.useRef(!1),O=g.useRef(""),P=N!=null&&N<=x,A=N!=null&&N>=h,L=xe(W=>{t.current=!0;const $=st(i,b,s.current);$!==null&&(I.current=$,E($,W))}),q=g.useMemo(()=>({disabled:r||(d?A:P),"aria-readonly":v||void 0,"aria-label":d?"Increase":"Decrease","aria-controls":o,tabIndex:-1,style:{WebkitUserSelect:"none",userSelect:"none"},onTouchStart(){D.current=!0},onTouchEnd(){D.current=!1},onClick(W){const $=r||v||(d?A:P);if(W.defaultPrevented||$||(O.current==="touch"?F.current:W.detail!==0))return;L(W.nativeEvent);const H=u(W)??Ut,Q=I.current;n(H,d?1:-1,void 0,W.nativeEvent);const ae=M.current??I.current;ae!==Q&&T(ae,jt("none",W.nativeEvent))},onPointerDown(W){var Q;const $=!W.button||W.button===0,H=r||(d?A:P);W.defaultPrevented||v||!$||H||(O.current=W.pointerType,F.current=!1,p.current=!0,_.current={x:W.clientX,y:W.clientY},L(W.nativeEvent),W.pointerType!=="touch"?(W.preventDefault(),(Q=l.current)==null||Q.focus(),y(d,W)):w.start(yi,()=>{const ae=m.current;m.current=0,p.current&&ae!=null&&ae<vi?(y(d,W),F.current=!0):(F.current=!1,C())}))},onPointerUp(W){W.pointerType==="touch"&&(p.current=!1)},onPointerMove(W){if(r||v||(d?A:P)||W.pointerType!=="touch"||!p.current)return;m.current!=null&&(m.current+=1);const{x:H,y:Q}=_.current,ae=H-W.clientX,le=Q-W.clientY;ae**2+le**2>Ni**2&&C()},onMouseEnter(W){const $=r||v||(d?A:P);W.defaultPrevented||$||!p.current||D.current||O.current==="touch"||y(d,W)},onMouseLeave(){D.current||C()},onMouseUp(){D.current||C()}}),[r,d,A,P,v,o,L,u,I,n,M,T,p,l,y,w,m,C]);return g.useMemo(()=>({props:q}),[q])}const ou=g.forwardRef(function(t,r){const{render:s,className:u,disabled:o=!1,nativeButton:n=!0,...l}=t,{allowInputSyncRef:i,disabled:w,formatOptionsRef:d,getStepAmount:p,id:b,incrementValue:h,inputRef:x,inputValue:m,intentionalTouchCheckTimeout:v,isPressedRef:E,locale:y,maxWithDefault:C,minWithDefault:N,movesAfterTouchRef:I,readOnly:M,setValue:T,startAutoChange:_,state:D,stopAutoChange:F,value:O,valueRef:P,lastChangedValueRef:A,onValueCommitted:L}=Ft(),q=o||w,{props:W}=uu({isIncrement:!0,inputRef:x,startAutoChange:_,stopAutoChange:F,minWithDefault:N,maxWithDefault:C,value:O,inputValue:m,disabled:q,readOnly:M,id:b,setValue:T,getStepAmount:p,incrementValue:h,allowInputSyncRef:i,formatOptionsRef:d,valueRef:P,isPressedRef:E,intentionalTouchCheckTimeout:v,movesAfterTouchRef:I,locale:y,lastChangedValueRef:A,onValueCommitted:L}),{getButtonProps:$,buttonRef:H}=su({disabled:q,native:n}),Q=g.useMemo(()=>({...D,disabled:q}),[D,q]);return mt("button",t,{ref:[r,H],state:Q,props:[W,l,$],stateAttributesMapping:gt})});process.env.NODE_ENV!=="production"&&(ou.displayName="NumberFieldIncrement");const nu=g.forwardRef(function(t,r){const{render:s,className:u,disabled:o=!1,nativeButton:n=!0,...l}=t,{allowInputSyncRef:i,disabled:w,formatOptionsRef:d,getStepAmount:p,id:b,incrementValue:h,inputRef:x,inputValue:m,intentionalTouchCheckTimeout:v,isPressedRef:E,maxWithDefault:y,minWithDefault:C,movesAfterTouchRef:N,readOnly:I,setValue:M,startAutoChange:T,state:_,stopAutoChange:D,value:F,valueRef:O,locale:P,lastChangedValueRef:A,onValueCommitted:L}=Ft(),q=o||w,{props:W}=uu({isIncrement:!1,inputRef:x,startAutoChange:T,stopAutoChange:D,minWithDefault:C,maxWithDefault:y,value:F,inputValue:m,disabled:q,readOnly:I,id:b,setValue:M,getStepAmount:p,incrementValue:h,allowInputSyncRef:i,formatOptionsRef:d,valueRef:O,isPressedRef:E,intentionalTouchCheckTimeout:v,movesAfterTouchRef:N,locale:P,lastChangedValueRef:A,onValueCommitted:L}),{getButtonProps:$,buttonRef:H}=su({disabled:q,native:n}),Q=g.useMemo(()=>({..._,disabled:q}),[_,q]);return mt("button",t,{ref:[r,H],state:Q,props:[W,l,$],stateAttributesMapping:gt})});process.env.NODE_ENV!=="production"&&(nu.displayName="NumberFieldDecrement");const lu=g.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:_e});process.env.NODE_ENV!=="production"&&(lu.displayName="FormContext");function Va(){return g.useContext(lu)}function Ha(e,t){return{...e,state:{...e.state,valid:!t&&e.state.valid}}}const Gt=Object.keys(Aa);function Mi(e){if(!e||e.valid||!e.valueMissing)return!1;let t=!1;for(const r of Gt)r!=="valid"&&(r==="valueMissing"&&(t=e[r]),e[r]&&(t=!1));return t}function _i(){const{setValidityData:e,validate:t,messageIds:r,validityData:s,validationMode:u,validationDebounceTime:o,invalid:n,markedDirtyRef:l,controlId:i,state:w,name:d}=Bt(),{formRef:p,clearErrors:b}=Va(),h=ka(),x=g.useRef(null),m=xe(async(y,C=!1)=>{const N=x.current;if(!N)return;if(C){if(w.valid!==!1)return;const O=N.validity;if(!O.valueMissing){const A={value:y,state:{...Aa,valid:!0},error:"",errors:[],initialValue:s.initialValue};if(N.setCustomValidity(""),i){const L=p.current.fields.get(i);L&&p.current.fields.set(i,{...L,...Ha(A,!1)})}e(A);return}const P=Gt.reduce((A,L)=>(A[L]=O[L],A),{});if(!P.valid&&!Mi(P))return}function I(O){const P=Gt.reduce((L,q)=>(L[q]=O.validity[q],L),{});let A=!1;for(const L of Gt)if(L!=="valid"){if(L==="valueMissing"&&P[L])A=!0;else if(P[L])return P}return A&&!l.current&&(P.valid=!0,P.valueMissing=!1),P}h.clear();let M=null,T=[];const _=I(N);let D;if(N.validationMessage)D=N.validationMessage,T=[N.validationMessage];else{const O=Array.from(p.current.fields.values()).reduce((A,L)=>{var q,W;return L.name&&L.getValueRef&&(A[L.name]=(W=(q=L.getValueRef).current)==null?void 0:W.call(q)),A},{}),P=t(y,O);typeof P=="object"&&P!==null&&"then"in P?M=await P:M=P,M!==null&&(_.valid=!1,_.customError=!0,Array.isArray(M)?(T=M,N.setCustomValidity(M.join(`
|
|
7
|
+
`))):M&&(T=[M],N.setCustomValidity(M)))}const F={value:y,state:_,error:D??(Array.isArray(M)?M[0]:M??""),errors:T,initialValue:s.initialValue};if(i){const O=p.current.fields.get(i);O&&p.current.fields.set(i,{...O,...Ha(F,n)})}e(F)}),v=g.useCallback((y={})=>qt({...r.length&&{"aria-describedby":r.join(" ")},...w.valid===!1&&{"aria-invalid":!0}},y),[r,w.valid]),E=g.useCallback((y={})=>qt({onChange(C){if(C.nativeEvent.defaultPrevented)return;if(b(d),u!=="onChange"){m(C.currentTarget.value,!0);return}if(n)return;const N=C.currentTarget;if(N.value===""){m(N.value);return}h.clear(),o?h.start(o,()=>{m(N.value)}):m(N.value)}},v(y)),[v,b,d,h,m,n,u,o]);return g.useMemo(()=>({getValidationProps:v,getInputValidationProps:E,inputRef:x,commitValidation:m}),[v,E,m])}function Ai(e){const{formRef:t}=Va(),{invalid:r,markedDirtyRef:s,validityData:u,setValidityData:o}=Bt(),{enabled:n=!0,value:l,id:i,name:w,controlRef:d,commitValidation:p}=e,b=Da(e.getValue);ge(()=>{var x;if(!n)return;let h=l;h===void 0&&(h=(x=b.current)==null?void 0:x.call(b)),u.initialValue===null&&h!==u.initialValue&&o(m=>({...m,initialValue:h}))},[n,o,l,u.initialValue,b]),ge(()=>{n&&i&&t.current.fields.set(i,{controlRef:d,validityData:Ha(u,r),validate(){var x;let h=l;h===void 0&&(h=(x=b.current)==null?void 0:x.call(b)),s.current=!0,oo.flushSync(()=>p(h))},getValueRef:b,name:w})},[p,d,n,t,b,i,r,s,w,u,l]),ge(()=>{const h=t.current.fields;return()=>{i&&h.delete(i)}},[t,i])}const Wi={...Fl,...gt},Pi=new Set(["Backspace","Delete","ArrowLeft","ArrowRight","Tab","Enter","Escape"]),iu=g.forwardRef(function(t,r){const{render:s,className:u,...o}=t,{allowInputSyncRef:n,disabled:l,formatOptionsRef:i,getAllowedNonNumericKeys:w,getStepAmount:d,id:p,incrementValue:b,inputMode:h,inputValue:x,max:m,min:v,name:E,readOnly:y,required:C,setValue:N,state:I,setInputValue:M,locale:T,inputRef:_,value:D,onValueCommitted:F,lastChangedValueRef:O,hasPendingCommitRef:P,valueRef:A}=Ft(),{clearErrors:L}=Va(),{labelId:q,validationMode:W,setTouched:$,setFocused:H,invalid:Q}=Bt(),{getInputValidationProps:ae,getValidationProps:le,commitValidation:ee,inputRef:B}=_i(),K=g.useRef(!1),Z=g.useRef(!1);Ai({id:p,commitValidation:ee,value:D,controlRef:_,name:E,getValue:()=>D??null});const j=g.useRef(D),Ee=g.useRef(x);return ge(()=>{j.current===D&&Ee.current===x||(L(E),W==="onChange"&&ee(D))},[D,x,E,L,W,ee]),ge(()=>{if(!(j.current===D||W==="onChange")){if(Z.current){Z.current=!1;return}ee(D,!0)}},[ee,W,D]),ge(()=>{j.current=D,Ee.current=x},[D,x]),mt("input",t,{ref:[r,_,B],state:I,props:[{id:p,required:C,disabled:l,readOnly:y,inputMode:h,value:x,type:"text",autoComplete:"off",autoCorrect:"off",spellCheck:"false","aria-roledescription":"Number field","aria-invalid":Q||void 0,"aria-labelledby":q,suppressHydrationWarning:!0,onFocus(k){if(k.defaultPrevented||y||l||K.current)return;K.current=!0,H(!0);const V=k.currentTarget,ne=V.value.length;V.setSelectionRange(ne,ne)},onBlur(k){if(k.defaultPrevented||y||l)return;$(!0),H(!1);const V=!n.current,ne=P.current;if(n.current=!0,x.trim()===""){N(null),W==="onBlur"&&ee(null),F(null,jt("none",k.nativeEvent));return}const U=i.current,ie=st(x,T,U);if(ie===null)return;Z.current=!0;const te=(U==null?void 0:U.maximumFractionDigits)!=null||(U==null?void 0:U.minimumFractionDigits)!=null,de=U==null?void 0:U.maximumFractionDigits,fe=te&&typeof de=="number"?Number(ie.toFixed(de)):ie,Ae=jt("none",k.nativeEvent),ve=D!==fe,We=V||ve||ne;W==="onBlur"&&ee(fe),ve&&N(fe,k.nativeEvent),We&&F(fe,Ae);const Pe=rt(fe,T,U),Le=Os(ie,T,U);!(!te&&ie===D&&x===Le)&&x!==Pe&&M(Pe)},onChange(k){if(k.nativeEvent.defaultPrevented)return;n.current=!1;const V=k.target.value;if(V.trim()===""){M(V),N(null,k.nativeEvent);return}const ne=w();if(!Array.from(V).every(te=>{const de=te>="0"&&te<="9",fe=Oa.test(te),Ae=Fa.test(te),ve=Us.test(te),We=$s.test(te),Pe=yt.test(te);return de||fe||Ae||ve||We||Pe||ne.has(te)}))return;if(k.isTrusted){M(V);const te=st(V,T,i.current);te!==null&&N(te,k.nativeEvent);return}const ie=st(V,T,i.current);ie!==null&&(M(V),N(ie,k.nativeEvent))},onKeyDown(k){if(k.defaultPrevented||y||l)return;const V=k.nativeEvent;n.current=!0;const ne=w();let U=ne.has(k.key);const{decimal:ie,currency:te,percentSign:de}=Ba(T,i.current),fe=k.currentTarget.selectionStart,Ae=k.currentTarget.selectionEnd,ve=fe===0&&Ae===x.length,We=se=>fe===se&&Ae===se+1;if(yt.test(k.key)&&Array.from(ne).some(se=>yt.test(se||""))){const se=x.search(Ks),he=se!=null&&se!==-1&&We(se);U=!(yt.test(x)||zt.test(x))||ve||he}if(zt.test(k.key)&&Array.from(ne).some(se=>zt.test(se||""))){const se=x.search(Js),he=se!=null&&se!==-1&&We(se);U=!(yt.test(x)||zt.test(x))||ve||he}[ie,te,de].forEach(se=>{if(k.key===se){const he=x.indexOf(se),St=fe===he&&Ae===he+1;U=!x.includes(se)||ve||St}});const Pe=k.key>="0"&&k.key<="9",Le=Oa.test(k.key),Ge=Fa.test(k.key),Zt=$s.test(k.key),Ye=Pi.has(k.key);if(k.which===229||k.altKey||k.ctrlKey||k.metaKey||U||Pe||Le||Zt||Ge||Ye)return;const Ke=st(x,T,i.current),Ct=d(k)??Ut;Ei(k);const ut=Zs("none",V);k.key==="ArrowUp"?(b(Ct,1,Ke,V),F(O.current??A.current,ut)):k.key==="ArrowDown"?(b(Ct,-1,Ke,V),F(O.current??A.current,ut)):k.key==="Home"&&v!=null?(N(v,V),F(O.current??A.current,ut)):k.key==="End"&&m!=null&&(N(m,V),F(O.current??A.current,ut))},onPaste(k){if(k.defaultPrevented||y||l)return;k.preventDefault();const ne=(k.clipboardData||window.Clipboard).getData("text/plain"),U=st(ne,T,i.current);U!==null&&(n.current=!1,N(U,k.nativeEvent),M(ne))}},ae(),le(),o],stateAttributesMapping:Wi})});process.env.NODE_ENV!=="production"&&(iu.displayName="NumberFieldInput");const Li={wuStepper:"_wuStepper_apbnq_1"},Oi=({onChange:e,Label:t,defaultValue:r=0,readonly:s,dir:u,step:o=1,min:n,max:l,value:i,className:w,labelPosition:d="left",disabled:p,resetInvalidValueOnBlur:b=!0,...h})=>{const x=g.useId(),[m,v]=g.useState(i!==void 0?Number(i):r||0),E=T=>{v(T),e==null||e(T)},y=T=>{const _=Number(T.target.value);Number.isNaN(_)||v(_)},C=()=>{b&&(n!==void 0&&m<n?(v(n),e==null||e(n)):l!==void 0&&m>l&&(v(l),e==null||e(l)))};g.useEffect(()=>{i&&r&&console.warn("As both value and defaultValue are passed, value will be used")},[i,r]);const N={inc:s||l!==void 0&&m>=l||p,dec:s||n!==void 0&&m<=n||p},I=n!==void 0&&m<n||l!==void 0&&m>l,M=c("wu-flex wu-items-center wu-justify-center wu-rounded-none wu-bg-gray-10 wu-w-8 wu-h-8 wu-text-blue-q wu-p-2 wu-absolute wu-top-0 hover:wu-bg-gray-20","disabled:wu-cursor-not-allowed disabled:wu-bg-black/10 disabled:wu-text-gray-subtle disabled:wu-outline-gray-subtle");return a.jsxs(Rs,{id:x,value:m,step:o,readOnly:s,onValueChange:T=>typeof T=="number"&&E(T),dir:u,className:c("wu-flex wu-stepper",u==="rtl"&&d!=="top"&&"wu-gap-2",Li.wuStepper,Fi({labelPosition:d}),w),children:[t&&a.jsx(be,{htmlFor:x,className:"wu-input-label",children:t}),a.jsxs(tu,{className:"wu-flex wu-max-w-[97px] wu-relative",children:[a.jsx(nu,{"aria-label":"decrement",className:c(M,u==="rtl"?"wu-right-0":"wu-left-0","wu-stepper-button"),disabled:N.dec,children:a.jsx("span",{className:"wu-text-base wm-minimize"})}),a.jsx(iu,{"aria-label":"stepper",role:"spinbutton",type:"text","aria-invalid":I||void 0,dir:u,className:c("wu-flex wu-w-[97px] wu-h-8 wu-border-b wu-border-gray-subtle wu-bg-gray-10 wu-p-2 wu-text-sm wu-font-normal wu-text-gray-lead","wu-h-[33px] wu-text-center wu-text-blue-q wu-text-xs wu-rounded-t-sm ","focus:wu-border-blue-p focus-visible:wu-outline-none wu-transition-colors hover:wu-border-gray-40","disabled:wu-cursor-not-allowed disabled:wu-bg-gray-20 disabled:wu-border-gray-40 disabled:wu-text-gray-subtle","read-only:wu-cursor-not-allowed read-only:wu-bg-gray-20 read-only:wu-border-gray-40 read-only:wu-text-gray-subtle",I&&"wu-border-red-deep focus:wu-border-red-deep","wu-stepper-input"),readOnly:s,onChange:y,onBlur:C,disabled:p,min:n,max:l,step:o,...h}),a.jsx(ou,{"aria-label":"increment",className:c(M,u==="rtl"?"wu-left-0":"wu-right-0","wu-stepper-button"),disabled:N.inc,children:a.jsx("span",{className:"wu-text-base wm-add"})})]})]})},Fi=Ce.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"}}}),cu=Ce.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"}}),Bi=g.forwardRef(({className:e,variant:t,size:r,...s},u)=>a.jsx(tr.Root,{ref:u,className:c(cu({variant:t,size:r,className:e})),...s}));Bi.displayName=tr.Root.displayName;const wu=g.createContext({size:"default",variant:"default"}),Yt=g.forwardRef(({className:e,variant:t,size:r,children:s,...u},o)=>a.jsx(kt.Root,{ref:o,className:c("wu-flex wu-items-center wu-justify-center wu-gap-1",e),...u,children:a.jsx(wu.Provider,{value:{variant:t,size:r},children:s})}));Yt.displayName=kt.Root.displayName;const je=g.forwardRef(({className:e,children:t,variant:r,size:s,...u},o)=>{const n=g.useContext(wu);return a.jsx(kt.Item,{ref:o,className:c(cu({variant:n.variant||r,size:n.size||s}),e),...u,children:t})});je.displayName=kt.Item.displayName;const du=f.forwardRef((e,t)=>{const{options:r,value:s,disabled:u,dir:o,onChange:n}=e,l=i=>c("wu-w-8 wu-h-8 wu-text-xl wu-leading-5 wu-rounded-full wu-text-gray-lead wu-relative wu-z-10 wu-p-0 wu-flex wu-items-center wu-justify-center",u&&"wu-cursor-not-allowed data-[state=on]:wu-text-gray-lead",i===s&&"wu-text-white",u&&s===i&&"wu-text-gray-lead","wu-switcher-icon-tab-item");return a.jsx(a.Fragment,{children:a.jsxs(Yt,{ref:t,type:"single",value:s,onValueChange:n,disabled:u,dir:o,className:c("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:[a.jsx("div",{role:"slider",className:c("wu-absolute wu-z-0 wu-w-8 wu-h-8 wu-bg-blue-p wu-rounded-full wu-transition-transform wu-duration-300 wu-ease-in-out",s==="opt1"&&"",s==="opt2"&&o!=="rtl"&&"wu-translate-x-full",s==="opt2"&&o==="rtl"&&"-wu-translate-x-full",u&&"wu-bg-gray-40","wu-switcher-icon-tab-slider")}),a.jsx(je,{value:"opt1",className:l("opt1"),children:r[0].label}),a.jsx(je,{value:"opt2",className:l("opt2"),children:r[1].label})]})})});du.displayName="_IconTab";const fu=f.forwardRef((e,t)=>{const{options:r,value:s,disabled:u,dir:o,size:n="md",onChange:l}=e,i=w=>c("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",w===s&&"wu-text-white wu-font-medium",u&&s===w&&"wu-text-gray-lead","wu-switcher-tab-item");return a.jsx(a.Fragment,{children:a.jsxs(Yt,{ref:t,type:"single",value:s,onValueChange:l,disabled:u,dir:o,className:c("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:[a.jsx("div",{role:"slider",className:c("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"&&o!=="rtl"&&"wu-translate-x-full",s==="opt2"&&o==="rtl"&&"-wu-translate-x-full",u&&"wu-bg-gray-40","wu-switcher-tab-slider")}),a.jsx(je,{value:"opt1",className:i("opt1"),children:a.jsx("div",{className:"wu-min-w-16 wu-max-w-[136px] wu-overflow-hidden wu-text-ellipsis wu-text-nowrap",children:r[0].label})}),a.jsx(je,{value:"opt2",className:i("opt2"),children:a.jsx("div",{className:"wu-min-w-16 wu-max-w-[136px] wu-overflow-hidden wu-text-ellipsis wu-text-nowrap",children:r[1].label})})]})})});fu.displayName="_Tab";const pu=f.forwardRef((e,t)=>{const{options:r,value:s,disabled:u,dir:o,onChange:n}=e,l=p=>c("wu-p-0 wu-w-fit wu-text-xs wu-text-gray-lead wu-h-fit wu-font-normal",u&&"wu-cursor-not-allowed data-[state=on]:wu-text-gray-subtle wu-text-gray-subtle",p===s&&"wu-text-primary wu-font-medium",u&&s===p&&"wu-text-gray-lead","wu-switcher-toggle-item"),i=c("wu-w-fit wu-gap-2",u&&"wu-cursor-not-allowed","wu-switcher-toggle-group"),w=c("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"),d=c("wu-w-2 wu-h-2 wu-bg-blue-p wu-rounded-full wu-transition-transform wu-duration-300 wu-ease-in-out",s==="opt1"&&o!=="rtl"&&"-wu-translate-x-[10px]",s==="opt1"&&o==="rtl"&&"wu-translate-x-[10px]",s==="opt2"&&o!=="rtl"&&"wu-translate-x-[10px]",s==="opt2"&&o==="rtl"&&"-wu-translate-x-[10px]",u&&"wu-hidden","wu-switcher-toggle-knob");return a.jsx(a.Fragment,{children:a.jsxs(Yt,{ref:t,type:"single",value:s,disabled:u,dir:o,className:i,onValueChange:n,children:[a.jsx(je,{value:"opt1",className:l("opt1"),children:a.jsx("div",{className:"wu-max-w-[136px] wu-overflow-hidden wu-text-ellipsis wu-text-nowrap wu-text-right wu-switcher-toggle-item-label",children:r[0].label})}),a.jsx("button",{onClick:()=>n(s==="opt1"?"opt2":"opt1"),className:w,disabled:u,"aria-label":"knob",dir:o,children:a.jsx("div",{className:d,role:"knob",dir:o})}),a.jsx(je,{value:"opt2",className:l("opt2"),children:a.jsx("div",{className:"wu-max-w-[136px] wu-overflow-hidden wu-text-ellipsis wu-text-nowrap wu-switcher-toggle-item-label",children:r[1].label})})]})})});pu.displayName="_Toggle";const bu=f.forwardRef((e,t)=>{const{type:r,options:s,value:u,disabled:o,dir:n,size:l,onChange:i,toggle:w=!0,...d}=e,[p,b]=f.useState(),h=x=>{let m=p;x!==""?m=x:w&&(m=p==="opt1"?"opt2":"opt1");const v=m==="opt1"?s[0].value:s[1].value;i&&i(v),b(m)};if(f.useEffect(()=>{if(!Array.isArray(s)||s.length<2)throw new Error("Options are not sufficient");b(u===s[0].value?"opt1":"opt2")},[s,u]),!Array.isArray(s)||s.length<2)return a.jsx(a.Fragment,{});switch(r){case"toggle":return a.jsx(pu,{...d,ref:t,options:s,value:p||"opt1",onChange:h,disabled:o,dir:n});case"iconTab":return a.jsx(du,{ref:t,options:s,value:p||"opt1",onChange:h,disabled:o,dir:n});default:return a.jsx(fu,{ref:t,options:s,value:p||"opt1",onChange:h,disabled:o,dir:n,size:l})}});bu.displayName="WuSwitcher";const gu=He.Root,za=g.forwardRef(({className:e,children:t,...r},s)=>a.jsx(He.List,{className:c("wu-relative wu-flex",e),...r,ref:s,children:t}));za.displayName=He.List.displayName;const Ua=g.forwardRef(({className:e,...t},r)=>a.jsx(He.Trigger,{ref:r,className:c("wu-relative wu-inline-flex wu-items-center wu-whitespace-nowrap wu-text-xs wu-px-4 wu-py-2 wu-text-gray-600 wu-transition-colors wu-duration-200 data-[state=active]:wu-text-blue-p","data-[orientation=horizontal]:wu-justify-center",e),...t}));Ua.displayName=He.Trigger.displayName;const hu=g.forwardRef(({className:e,...t},r)=>a.jsx(He.Content,{ref:r,className:e,...t}));hu.displayName=He.Content.displayName;const mu=({items:e,enableAnimation:t})=>{const r="wu-duration-700 wu-ease-in-out wu-transition-all data-[state=inactive]:wu-absolute data-[state=inactive]:wu-inset-0 data-[state=inactive]:wu-opacity-0 data-[state=inactive]:wu-z-0 data-[state=active]:wu-relative data-[state=active]:wu-opacity-100 data-[state=active]:wu-z-10";return a.jsx("div",{className:c("wu-w-full wu-h-full wu-flex-1 wu-overflow-auto",t&&"wu-relative wu-overflow-hidden"),children:e.map(s=>a.jsx(hu,{value:s.value,forceMount:t||void 0,className:c("wu-w-full wu-h-full wu-overflow-y-auto",t&&r,"wu-tab-content"),children:s.Content},s.value))})},qi=e=>{const[t,r]=f.useState(!1),[s,u]=f.useState(!1),o=()=>{const l=e.current;l&&(r(l.scrollLeft>0),u(l.scrollLeft+l.clientWidth<l.scrollWidth))};return f.useEffect(()=>{const l=e.current;return o(),l&&l.addEventListener("scroll",o),window.addEventListener("resize",o),()=>{l&&l.removeEventListener("scroll",o),window.removeEventListener("resize",o)}},[e]),{showLeftArrow:t,showRightArrow:s,scrollByTab:l=>{const i=e.current;if(i){const w=(l==="right"?i.clientWidth:-i.clientWidth)*.8;i.scrollBy({left:w,behavior:"smooth"})}}}},xu=(e,t)=>{const[r,s]=f.useState({width:0,left:0,height:0,top:0}),u=t==="vertical";return f.useEffect(()=>{const o=e.current;if(o){const n=()=>{const i=o.querySelector('[data-state="active"]');if(i){const w={width:u?2:i.offsetWidth,left:u?0:i.offsetLeft,height:u?i.offsetHeight:1,top:u?i.offsetTop:0};s(w)}},l=new MutationObserver(n);return l.observe(o,{attributes:!0,subtree:!0}),n(),()=>{l.disconnect()}}},[e,u]),r},Vi=({items:e,value:t,defaultValue:r,onValueChange:s,enableAnimation:u=!1,className:o,dir:n="ltr",position:l="top"})=>{var C;const i=f.useRef(null),w=xu(i,"horizontal"),{showLeftArrow:d,showRightArrow:p,scrollByTab:b}=qi(i),[h,x]=f.useState(!1),m=()=>b("left"),v=()=>b("right"),E=N=>a.jsx("div",{"data-testid":`gradient-overlay-${N}`,className:c("wu-absolute wu-top-0 wu-h-full wu-w-20 wu-z-10 wu-pointer-events-none",N==="left"?"wu-left-0 wu-bg-gradient-to-r wu-from-white wu-to-transparent":"wu-right-0 wu-bg-gradient-to-l wu-from-white wu-to-transparent")}),y=(N,I,M)=>{const T=I==="left";return a.jsx("button",{onClick:N,className:c("wu-absolute wu-z-20 wu-flex wu-items-center wu-justify-center wu-px-1 wu-py-1 wu-transition-all wu-duration-300 wu-h-8",T?"wu-left-0":"wu-right-0",M&&"wu-translate-x-0 wu-opacity-100",!M&&[T?"-wu-translate-x-full":"wu-translate-x-full","wu-opacity-0"]),"aria-label":T?"scroll-left":"scroll-right",children:a.jsx("span",{className:c("wu-text-blue-p wu-text-lg",T?"wm-keyboard-arrow-left":"wm-keyboard-arrow-right")})})};return a.jsxs(gu,{defaultValue:r||((C=e[0])==null?void 0:C.value),value:t,onValueChange:s,orientation:"horizontal",dir:n,className:c("wu-relative wu-flex wu-flex-col wu-w-full wu-h-full",l==="bottom"?"wu-flex-col-reverse":"wu-flex-col",o),role:"tabs",children:[a.jsxs("div",{className:"wu-relative wu-flex wu-overflow-hidden wu-shrink-0 wu-border-b wu-border-gray-200",onMouseEnter:()=>x(!0),onMouseLeave:()=>x(!1),"aria-label":"tablistWrapper",children:[d&&h&&E("left"),y(m,"left",d&&h),a.jsxs(za,{ref:i,className:c("wu-relative wu-flex wu-w-full wu-overflow-x-auto wu-flex-row","[&::-webkit-scrollbar]:wu-hidden [-ms-overflow-style:none] [scrollbar-width:none]","wu-tablist"),children:[e.map(N=>a.jsx(Ua,{value:N.value,children:N.Trigger},N.value)),a.jsx("span",{className:"wu-absolute wu-bg-blue-p wu-transition-all wu-duration-300 wu-indicator wu-bottom-0",style:{width:w.width,left:w.left,height:1.25,bottom:l==="bottom"?void 0:0,top:l==="bottom"?0:void 0}})]}),p&&h&&E("right"),y(v,"right",p&&h)]}),a.jsx(mu,{items:e,enableAnimation:u})]})},Hi=e=>{const[t,r]=f.useState(!1),[s,u]=f.useState(!1),o=()=>{const l=e.current;l&&(r(l.scrollTop>0),u(l.scrollTop+l.clientHeight<l.scrollHeight))};return f.useEffect(()=>{const l=e.current;if(l)return o(),l.addEventListener("scroll",o),window.addEventListener("resize",o),()=>{l.removeEventListener("scroll",o),window.removeEventListener("resize",o)}},[e]),{showTopArrow:t,showBottomArrow:s,scrollByTab:l=>{const i=e.current;if(i){const w=(l==="down"?i.clientHeight:-i.clientHeight)*.8;i.scrollBy({top:w,behavior:"smooth"})}}}},zi=({items:e,value:t,defaultValue:r,onValueChange:s,enableAnimation:u=!1,className:o,dir:n="ltr",position:l="left"})=>{var C;const i=f.useRef(null),w=xu(i,"vertical"),{showTopArrow:d,showBottomArrow:p,scrollByTab:b}=Hi(i),[h,x]=f.useState(!1),m=()=>b("up"),v=()=>b("down"),E=N=>a.jsx("div",{className:c("wu-absolute wu-left-0 wu-w-full wu-h-12 wu-z-10 wu-pointer-events-none",N==="top"?"wu-top-0 wu-bg-gradient-to-b wu-from-white wu-to-transparent":"wu-bottom-0 wu-bg-gradient-to-t wu-from-white wu-to-transparent")}),y=(N,I,M)=>{const T=I==="up";return a.jsx("button",{onClick:N,className:c("wu-absolute wu-z-20 wu-flex wu-items-center wu-justify-center wu-px-1 wu-py-1 wu-transition-all wu-duration-300 wu-w-full",T?"-wu-top-1":"-wu-bottom-1",M&&"wu-translate-y-0 wu-opacity-100",!M&&[T?"-wu-translate-y-full":"wu-translate-y-full","wu-opacity-0"]),"aria-label":T?"scroll-up":"scroll-down",children:a.jsx("span",{className:c("wu-text-blue-p wu-text-lg",T?"wm-keyboard-arrow-up":"wm-keyboard-arrow-down")})})};return a.jsxs(gu,{defaultValue:r||((C=e[0])==null?void 0:C.value),value:t,onValueChange:s,orientation:"vertical",dir:n,className:c("wu-relative wu-h-full wu-w-full wu-flex",l==="left"?"wu-flex-row":"wu-flex-row-reverse",o),role:"tabs",children:[a.jsxs("div",{className:"wu-relative wu-flex wu-overflow-hidden wu-shrink-0",onMouseEnter:()=>x(!0),onMouseLeave:()=>x(!1),"aria-label":"tablistWrapper",children:[d&&h&&E("top"),y(m,"up",d&&h),a.jsxs(za,{ref:i,className:c("wu-relative wu-flex wu-h-full wu-overflow-y-auto wu-flex-col","[&::-webkit-scrollbar]:wu-hidden [-ms-overflow-style:none] [scrollbar-width:none]","wu-tablist"),children:[e.map(N=>a.jsx(Ua,{value:N.value,children:N.Trigger},N.value)),a.jsx("span",{className:"wu-absolute wu-bg-blue-p wu-transition-all wu-duration-300 wu-indicator",style:{width:2,left:l==="left"?0:void 0,right:l==="right"?0:void 0,height:w.height,top:w.top}})]}),p&&h&&E("bottom"),y(v,"down",p&&h)]}),a.jsx(mu,{items:e,enableAnimation:u})]})},Ui=({...e})=>e.orientation==="vertical"?a.jsx(zi,{...e}):a.jsx(Vi,{...e}),$a=g.forwardRef(({className:e,...t},r)=>a.jsx("table",{ref:r,className:c("wu-w-full wu-caption-bottom wu-text-sm",e),...t}));$a.displayName="Table";const yu=g.forwardRef(({className:e,...t},r)=>a.jsx("thead",{ref:r,className:c("[&_tr]:wu-border-b",e),...t}));yu.displayName="TableHeader";const vu=g.forwardRef(({className:e,...t},r)=>a.jsx("tbody",{ref:r,className:c("",e),...t}));vu.displayName="TableBody";const $i=g.forwardRef(({className:e,...t},r)=>a.jsx("tfoot",{ref:r,className:c("wu-border-t wu-bg-muted/50 wu-font-medium [&>tr]:last:wu-border-b-0",e),...t}));$i.displayName="TableFooter";const vt=g.forwardRef(({className:e,...t},r)=>a.jsx("tr",{ref:r,className:c("wu-border-b wu-transition-colors wu-hover:wu-bg-muted/50 data-[state=selected]:wu-bg-muted",e),...t}));vt.displayName="TableRow";const ja=g.forwardRef(({className:e,...t},r)=>a.jsx("th",{ref:r,className:c("wu-px-4 wu-text-left wu-align-middle wu-font-medium wu-text-muted-foreground [&:has([role=checkbox])]:wu-pr-0",e),...t}));ja.displayName="TableHead";const Kt=g.forwardRef(({className:e,...t},r)=>a.jsx("td",{ref:r,className:c("wu-p-4 wu-align-middle [&:has([role=checkbox])]:wu-pr-0",e),...t}));Kt.displayName="TableCell";const Ga=g.forwardRef(({className:e,...t},r)=>a.jsx("caption",{ref:r,className:c("wu-mt-4 wu-text-sm wu-text-gray-subtle wu-font-normal",e),...t}));Ga.displayName="TableCaption";const ji=({columns:e,rowSelection:t})=>{const r=(t==null?void 0:t.isEnabled)??!1,{onRowSelect:s,rowUniqueKey:u}=t||{},o=f.useCallback(l=>i=>{s(()=>i?l:[])},[s]);return{finalColumns:f.useMemo(()=>r?[{id:"select",header:({table:l})=>{const i=l.getRowModel().rows.map(d=>d.original),w=o(i);return a.jsx(Me,{checked:l.getIsSomeRowsSelected()||l.getIsAllRowsSelected(),partial:l.getIsSomeRowsSelected()&&!l.getIsAllRowsSelected(),onChange:d=>{l.toggleAllRowsSelected(!!d),w(!!d)},"aria-label":"Select all","data-testid":l.getIsSomeRowsSelected()&&!l.getIsAllRowsSelected()?"select-partial":"select-all"})},cell:({row:l})=>a.jsx(Me,{checked:l.getIsSelected(),onChange:i=>{l.toggleSelected(!!i)},"aria-label":String(l.original[u])}),enableSorting:!1,filterable:!1,accessorKey:"select"},...e]:e,[e,r,o])}};function Nu({data:e,columns:t,rowSelection:r}){const{finalColumns:s}=ji({columns:t,rowSelection:r}),u=f.useMemo(()=>{if(!(r!=null&&r.isEnabled))return{};const o={};for(const n of r.selectedRows){const l=e.findIndex(i=>i[r.rowUniqueKey]===n[r.rowUniqueKey]);l!==-1&&(o[l]=!0)}return o},[e,r]);return{finalColumns:s,rowSelectionState:u}}const Cu=({table:e,size:t,NoDataContent:r,isLoading:s,CustomLoader:u})=>{var l;const[o,n]=f.useState(null);return a.jsx(vu,{children:s?a.jsx(vt,{children:a.jsx(Kt,{colSpan:e.getAllColumns().length,className:"wu-text-center wu-h-[35vh] wu-loader-container",children:u||a.jsx(Re,{className:"wu-w-full"})})}):(l=e.getRowModel().rows)!=null&&l.length?e.getRowModel().rows.map((i,w)=>a.jsx(vt,{"data-state":i.getIsSelected()&&"selected",onMouseOver:()=>n(i.id),onMouseOut:()=>n(null),className:c("wu-transition-colors wu-border-b wu-border-black/[12%]",i.getIsSelected()?o===i.id?"wu-bg-blue-p/[16%]":"wu-bg-blue-p/[8%]":"hover:wu-bg-black/[2%]"),children:i.getVisibleCells().map((d,p)=>a.jsx(Kt,{className:c("wu-py-0 wu-font-light wu-text-gray-lead wu-text-xs",t==="compact"?"wu-h-8":"wu-h-10",d.column.id==="actions"?"wu-opacity-0 wu-transition-opacity wu-duration-100":"",o===i.id&&d.column.id==="actions"?"wu-opacity-100 wu-visible":""),children:Ie.flexRender(d.column.columnDef.cell,d.getContext())},`${d.id}-${p}`))},`${i.id}-${w}`)):a.jsx(vt,{children:a.jsx(Kt,{colSpan:e.getAllColumns().length,children:r})})})},Su=({table:e,sortableColumns:t,manual:r=!1,onSort:s,size:u,isRowSelected:o,HeaderAction:n,isStickyHeader:l})=>{const i=w=>{const{id:d,columnDef:p,getIsSorted:b,toggleSorting:h}=w,{header:x}=p;if(!t.includes(d))return x;const m=b(),v=m==="asc",E=m==="desc",y=()=>{r?(h(!E),s==null||s({id:d,desc:E})):h(w.getIsSorted()==="asc")};return a.jsxs("button",{onClick:y,"aria-label":`Sort by ${x}`,className:"wu-flex wu-items-center wu-gap-4",children:[x,a.jsxs("div",{className:"wu-relative",children:[a.jsx("span",{className:c("wu-absolute -wu-top-[15px] wm-arrow-drop-down wu-text-xl",v&&"wu-hidden",!m&&"-wu-top-[11px]")}),a.jsx("span",{className:c("wu-absolute -wu-bottom-[13px] wm-arrow-drop-up wu-text-xl",E&&"wu-hidden",!m&&"-wu-bottom-[10px]")})]})]})};return a.jsxs(a.Fragment,{children:[a.jsx(yu,{className:c("wu-border-t wu-border-black/[12%] wu-bg-gray-20 wu-relative",l&&"wu-sticky wu-top-[-.5px] wu-z-10",u==="compact"?"wu-h-8":"wu-h-10"),children:e.getHeaderGroups().map(w=>a.jsx(vt,{className:"wu-relative",children:w.headers.map(d=>d.column.id==="actions"?a.jsx(ja,{colSpan:d.colSpan,className:c("wu-text-gray-lead wu-text-xs wu-font-medium"),style:{width:`${d.getSize()}px`}},d.id):a.jsx(ja,{colSpan:d.colSpan,className:c("wu-text-gray-lead wu-text-xs wu-font-medium wu-bg-[#EEEEEE]","wu-relative wu-z-0"),style:{width:`${d.getSize()}px`},children:Ie.flexRender(i(d.column),d.getContext())},d.id))},w.id))}),o&&n&&a.jsx("div",{className:c("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",l&&"wu-sticky wu-top-[-.1px] wu-z-10"),children:n})]})},Eu=Ce.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"}}}),Gi=({data:e,columns:t,isLoading:r=!1,variant:s="unstyled",sort:u,size:o,rowSelection:n,HeaderAction:l,NoDataContent:i,stickyHeader:w=!1,CustomLoader:d,caption:p,...b})=>{var C;const{finalColumns:h,rowSelectionState:x}=Nu({data:e,columns:t,rowSelection:n}),m=f.useMemo(()=>h.filter(N=>N.enableSorting).map(N=>N.accessorKey),[h]),v=((C=n==null?void 0:n.selectedRows)==null?void 0:C.length)??0,E=N=>{if(typeof N=="function"){const I=N(x),M=Object.keys(I).filter(T=>I[Number(T)]).map(T=>e[Number(T)]);n==null||n.onRowSelect(M)}},y=Ie.useReactTable({data:e,columns:h,getCoreRowModel:Ie.getCoreRowModel(),getPaginationRowModel:Ie.getPaginationRowModel(),manualPagination:!0,manualSorting:!0,manualFiltering:!0,enableRowSelection:n==null?void 0:n.isEnabled,state:{...n!=null&&n.isEnabled?{rowSelection:x}:{}},onRowSelectionChange:E});return a.jsxs("div",{className:c("wu-table-container wu-relative"),children:[p&&a.jsx(Ga,{className:"wu-font-light",children:p}),a.jsxs($a,{...b,className:c(Eu({variant:s}),b.className),children:[a.jsx(Su,{table:y,sortableColumns:m,manual:!0,onSort:u==null?void 0:u.onSort,size:o,HeaderAction:l,isRowSelected:v>0,isStickyHeader:w}),!r&&a.jsx(Cu,{table:y,size:o,NoDataContent:i,CustomLoader:d})]}),r&&a.jsx("div",{className:"wu-flex wu-items-center wu-justify-center wu-h-96",children:a.jsx(Re,{})})]})},Yi=({data:e,columns:t,variant:r="unstyled",size:s="default",sort:u,filterText:o,pagination:n,stickyHeader:l,HeaderAction:i,CustomLoader:w,NoDataContent:d,isLoading:p,caption:b,rowSelection:h,...x})=>{var P;const[m,v]=f.useState((u==null?void 0:u.initial)||[]),[E,y]=f.useState([]),[C,N]=f.useState((n==null?void 0:n.pageIndex)??0),{finalColumns:I,rowSelectionState:M}=Nu({data:e,columns:t,rowSelection:h}),T=f.useMemo(()=>I.filter(A=>A.enableSorting).map(A=>A.accessorKey),[I]),_=f.useMemo(()=>I.filter(A=>A.filterable).map(A=>A.accessorKey),[I]),D=((P=h==null?void 0:h.selectedRows)==null?void 0:P.length)??0,F=A=>{const L=typeof A=="function"?A(M):A,q=Object.keys(L).filter(W=>L[Number(W)]).map(W=>e[Number(W)]);h==null||h.onRowSelect(q)},O=Ie.useReactTable({data:e,columns:I,getCoreRowModel:Ie.getCoreRowModel(),getFilteredRowModel:Ie.getFilteredRowModel(),getSortedRowModel:Ie.getSortedRowModel(),getPaginationRowModel:Ie.getPaginationRowModel(),state:{sorting:m,columnFilters:E,...n?{pagination:n}:{},...h!=null&&h.isEnabled?{rowSelection:M}:{}},onSortingChange:v,onColumnFiltersChange:y,onRowSelectionChange:F});return f.useEffect(()=>{_.forEach(A=>{var L;(L=O.getColumn(A))==null||L.setFilterValue(o)})},[o,_,O]),f.useEffect(()=>{n&&(n==null?void 0:n.pageIndex)!==C&&(h==null||h.onRowSelect(()=>[]),O.resetRowSelection(),N(n.pageIndex))},[n==null?void 0:n.pageIndex]),a.jsx("div",{className:"wu-table-container wu-relative",children:a.jsxs($a,{...x,className:c(Eu({variant:r}),"wu-table-fixed",x.className),children:[b&&a.jsx(Ga,{children:b}),a.jsx(Su,{table:O,sortableColumns:T,size:s,HeaderAction:i,isRowSelected:D>0,isStickyHeader:l}),a.jsx(Cu,{table:O,size:s,NoDataContent:d,CustomLoader:w,isLoading:p})]})})},Tu=g.forwardRef(({className:e,...t},r)=>a.jsx("textarea",{className:c("wu-flex wu-w-full wu-border-b wu-border-gray-subtle wu-bg-gray-10 wu-text-gray-lead wu-p-2 wu-text-sm wu-font-normal wu-placeholder:wu-text-gray-subtle wu-placeholder:wu-font-light focus-visible:wu-outline-none disabled:wu-cursor-not-allowed disabled:wu-bg-gray-20 disabled:wu-border-gray-40 disabled:wu-text-gray-subtle read-only:wu-cursor-not-allowed read-only:wu-bg-gray-20 read-only:wu-border-gray-40 read-only:wu-text-gray-subtle focus:wu-border-blue-p wu-transition-colors hover:wu-border-gray-40 ",e),ref:r,...t}));Tu.displayName="Textarea";const ku=f.forwardRef((e,t)=>{const{Label:r,id:s=It(),variant:u="flat",readonly:o,maxLength:n,labelPosition:l="top",...i}=e,w=p=>{i.onChange&&i.onChange(p)},d=wt(l);return a.jsxs("div",{className:c(d,"wu-flex wu-textarea-container"),dir:i.dir,children:[a.jsx(Tu,{...i,ref:t,id:s,className:c("wu-peer wu-rounded-t-sm",u==="outlined"?"wu-border wu-border-gray-subtle":"",i.className),onChange:w,readOnly:o,maxLength:n}),r&&a.jsx(be,{htmlFor:s,className:"wu-textarea-label",children:r})]})});ku.displayName="WuTextarea";function Ki(e){if(typeof e=="string"&&e.includes("T")){const t=z.parseISO(e);return z.format(t,"HH:mm")}if(typeof e=="string"&&/^\d{2}:\d{2}:\d{2}$/.test(e)){const t=z.parse(e,"HH:mm:ss",new Date);return z.format(t,"HH:mm")}return typeof e=="string"&&/^\d{2}:\d{2}$/.test(e)?e:"00:00"}const Iu=["12",...Array.from({length:11},(e,t)=>String(t+1).padStart(2,"0"))],Du=Array.from({length:60},(e,t)=>String(t).padStart(2,"0")),Mu=["am","pm"],Jt=50;function Ji(e){return Array(Jt).fill(e).flat()}function Ya(e,t){const r=e.indexOf(t);return[...e.slice(r),...e.slice(0,r)]}function Xi(e,t){let r=Number(e);return t==="pm"&&r<12&&(r+=12),t==="am"&&r===12&&(r=0),String(r).padStart(2,"0")}function _u(e){const t=Number(e),r=t>=12?"pm":"am",s=t%12===0?12:t%12;return{hour:String(s),meridiem:r}}const Qi=({value:e,isSelected:t,onClick:r})=>a.jsx("div",{onClick:r,className:c("wu-w-8 wu-h-8 wu-flex wu-items-center wu-justify-center wu-text-center wu-snap-start wu-rounded-[2px] wu-cursor-pointer hover:wu-bg-blue-p hover:wu-text-white",t&&"wu-bg-blue-p/15 wu-text-blue-p"),children:e}),Ka=({values:e,selectedValue:t,scrollRef:r,onSelect:s,repeatItems:u=!0,className:o})=>a.jsx("div",{ref:r,className:c("wu-overflow-y-scroll wu-w-8 wu-snap-y wu-snap-mandatory [&::-webkit-scrollbar]:hidden [-ms-overflow-style:none] [scrollbar-width:none]",o),role:"presentation",children:(u?Ji(e):e).map((n,l)=>a.jsx(Qi,{value:n,isSelected:n===t,onClick:()=>s(n)},`${n}-${l}`))});function Zi(e,t,r,s){const u=f.useMemo(()=>e?Ya(Iu,t.padStart(2,"0")):Iu,[e]),o=f.useMemo(()=>e?Ya(Du,r.padStart(2,"0")):Du,[e]),n=f.useMemo(()=>e?Ya(Mu,s):Mu,[e]);return{rotatedHours:u,rotatedMinutes:o,rotatedMeridiem:n}}function Ri(e,t,r){f.useEffect(()=>{function s(n){if(n){const l=n.scrollHeight/Jt,i=Math.floor(Jt/2);n.scrollTop=i*l;const w=()=>{const{scrollTop:d}=n,p=Math.round(d/l);(p<=1||p>=Jt-2)&&(n.scrollTop=i*l)};return n.addEventListener("scroll",w),()=>{n.removeEventListener("scroll",w)}}}if(!e)return;const u=s(t.current),o=s(r.current);return()=>{u==null||u(),o==null||o()}},[e,t,r])}const Au=({className:e,time:t,Label:r,labelPosition:s,dir:u,...o})=>{const[n,l]=f.useState(!1),[i,w]=f.useState(""),d=f.useRef(null),p=f.useRef(null),b=f.useRef(null),h=f.useRef(null),[x,m]=f.useState("12"),[v,E]=f.useState("00"),[y,C]=f.useState("am");f.useEffect(()=>{if(!t){w(""),m("12"),E("00"),C("am"),d.current&&(d.current.value="");return}const _=Ki(t);w(_);const[D,F]=_.split(":"),{hour:O,meridiem:P}=_u(D);m(O),E(F),C(P),d.current&&(d.current.value=_)},[t]),f.useEffect(()=>{const _=D=>{p.current&&!p.current.contains(D.target)&&l(!1)};return document.addEventListener("mousedown",_),()=>{document.removeEventListener("mousedown",_)}},[]),Ri(n,b,h);const{rotatedHours:N,rotatedMinutes:I,rotatedMeridiem:M}=Zi(n,x,v,y),T=f.useCallback((_,D,F)=>{const O=_??x,P=D??v,A=F??y;m(O),E(P),C(A);const L=`${Xi(O,A)}:${P}`;w(L)},[x,v,y]);return a.jsxs("div",{className:c("wu-flex wu-gap-1 wu-relative wu-w-fit wu-flex-col",(s==="right"||s==="left")&&"wu-items-center",s==="left"&&"wu-flex-row",s==="right"&&"wu-flex-row-reverse","wu-input-wrapper"),dir:u,children:[r&&a.jsx(be,{htmlFor:"time-picker",className:"wu-timepicker-label",children:r}),a.jsxs("div",{className:c("relative inline-block"),ref:p,dir:u,children:[a.jsx(ze,{ref:d,type:"time",value:i,variant:"flat",role:"textbox",onChange:_=>{w(_.target.value);const[D,F]=_.target.value.split(":"),{hour:O,meridiem:P}=_u(D);m(O),E(F),C(P)},className:"wu-w-[136px] wu-h-8 wu-pr-6 wu-border wu-border-lead/40 wu-text-gray-lead wu-timepicker-input",style:{WebkitAppearance:"none",MozAppearance:"textfield"},Icon:a.jsx(Oe,{icon:"wm-schedule",className:"wu-text-base",onClick:()=>l(_=>!_),"data-testid":"wu-timepicker-icon"}),iconPosition:"right",dir:u,...o}),a.jsx("style",{children:`
|
|
5
8
|
input[type="time"]::-webkit-calendar-picker-indicator { display: none; }
|
|
6
|
-
`}),
|
|
9
|
+
`}),n&&a.jsxs("div",{className:c("wu-absolute wu-w-[136px] wu-h-[228px] wu-flex wu-bg-white wu-border wu-shadow wu-z-50 wu-text-xs wu-gap-1 wu-p-1 wu-border-blue-p wu-text-lead",e),children:[a.jsx(Ka,{values:N,selectedValue:x.padStart(2,"0"),scrollRef:b,onSelect:_=>T(_,v),className:"wu-time-hour-picker"}),a.jsx(Ka,{values:I,selectedValue:v.padStart(2,"0"),scrollRef:h,onSelect:_=>T(x,_),className:"wu-time-minute-picker"}),a.jsx(Ka,{values:M,selectedValue:y,onSelect:_=>T(void 0,void 0,_),className:"wu-time-meridiem-picker",repeatItems:!1})]})]})]})};Au.displayName="WuTimePicker";const ec=1,tc=1e6;let Ja=0;function ac(){return Ja=(Ja+1)%Number.MAX_SAFE_INTEGER,Ja.toString()}const Xa=new Map,Wu=e=>{if(Xa.has(e))return;const t=setTimeout(()=>{Xa.delete(e),Nt({type:"REMOVE_TOAST",toastId:e})},tc);Xa.set(e,t)},rc=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,ec)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(r=>r.id===t.toast.id?{...r,...t.toast}:r)};case"DISMISS_TOAST":{const{toastId:r}=t;return r?Wu(r):e.toasts.forEach(s=>{Wu(s.id)}),{...e,toasts:e.toasts.map(s=>s.id===r||r===void 0?{...s,open:!1}:s)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(r=>r.id!==t.toastId)}}},Xt=[];let Qt={toasts:[]};function Nt(e){Qt=rc(Qt,e),Xt.forEach(t=>{t(Qt)})}function sc({...e}){const t=ac(),r=u=>Nt({type:"UPDATE_TOAST",toast:{...u,id:t}}),s=()=>Nt({type:"DISMISS_TOAST",toastId:t});return Nt({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:u=>{u||s()}}}),{id:t,dismiss:s,update:r}}function Pu(){const[e,t]=f.useState(Qt);return f.useEffect(()=>(Xt.push(t),()=>{const r=Xt.indexOf(t);r>-1&&Xt.splice(r,1)}),[e]),{...e,toast:sc,dismiss:r=>Nt({type:"DISMISS_TOAST",toastId:r})}}const uc=()=>{const{toast:e}=Pu();if(!e)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})=>{e?e({description:r,variant:t,duration:s}):console.error("Toast instance not initialized")}}},oc=pe.Provider,nc=Ce.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"}}),Lu=g.forwardRef(({className:e,position:t,...r},s)=>a.jsx(pe.Viewport,{ref:s,className:c(nc({position:t}),e),...r}));Lu.displayName=pe.Viewport.displayName;const lc=Ce.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"}}),Ou=g.forwardRef(({className:e,variant:t,...r},s)=>a.jsx(pe.Root,{ref:s,className:c(lc({variant:t}),e),...r}));Ou.displayName=pe.Root.displayName;const ic=g.forwardRef(({className:e,...t},r)=>a.jsx(pe.Action,{ref:r,className:c("wu-inline-flex wu-h-8 wu-shrink-0 wu-items-center wu-justify-center wu-border wu-bg-transparent wu-px-3 wu-text-sm wu-font-medium wu-ring-offset-background wu-transition-colors hover:wu-bg-secondary focus:wu-outline-none focus:wu-ring-2 focus:wu-ring-ring focus:wu-ring-offset-2 disabled:wu-cursor-not-allowed disabled:wu-opacity-50 group-[.destructive]:wu-border-muted/40 group-[.destructive]:hover:wu-border-destructive/30 group-[.destructive]:hover:wu-bg-destructive group-[.destructive]:hover:wu-text-destructive-foreground group-[.destructive]:focus:wu-ring-destructive",e),...t}));ic.displayName=pe.Action.displayName;const Fu=g.forwardRef(({className:e,...t},r)=>a.jsx(pe.Close,{ref:r,className:c("wu-relative wu-right-4 wu-bottom-2 wu-rounded-sm wu-w-4 wu-h-4 wu-p-1 wu-text-foreground/50 wu-opacity-100 wu-transition-opacity hover:wu-text-foreground focus:wu-opacity-100 focus:wu-outline-none group-hover:wu-opacity-100 group-[.destructive]:wu-text-red-300 group-[.destructive]:hover:wu-text-red-50 group-[.destructive]:focus:wu-ring-red-400 group-[.destructive]:focus:wu-ring-offset-red-600",e),"toast-close":"","aria-label":"Close toast",...t,children:a.jsx("span",{className:"wm-close wu-text-base"})}));Fu.displayName=pe.Close.displayName;const Bu=g.forwardRef(({className:e,...t},r)=>a.jsx(pe.Title,{ref:r,className:c("wu-text-sm wu-font-semibold",e),...t}));Bu.displayName=pe.Title.displayName;const qu=g.forwardRef(({className:e,...t},r)=>a.jsx(pe.Description,{ref:r,className:c("wu-text-sm wu-opacity-90",e),...t}));qu.displayName=pe.Description.displayName;function cc(){const{toasts:e}=Pu();return a.jsxs(oc,{children:[e.map(function({id:t,title:r,description:s,action:u,variant:o,...n}){const l={success:"wm-check-circle",info:"wm-info",warning:"wm-error",error:"wm-cancel"};return a.jsxs(Ou,{variant:o,...n,children:[a.jsxs("div",{className:"wu-grid wu-gap-1",children:[r&&a.jsx(Bu,{children:r}),s&&a.jsxs(qu,{className:"wu-flex wu-items-center wu-gap-3 wu-pr-6",children:[a.jsx(Oe,{icon:l[o||"success"],className:"wu-text-xl"}),s]})]}),u,a.jsx(Fu,{})]},t)}),a.jsx(Lu,{})]})}const wc=()=>a.jsx(cc,{}),Vu=g.forwardRef(({className:e,dir:t,...r},s)=>a.jsx(ta.Root,{className:c("wu-bg-gray-40 wu-inline-flex wu-h-2 wu-w-8 wu-shrink-0 wu-cursor-pointer wu-items-center wu-rounded-full wu-transition-colors focus-visible:wu-outline-none focus-visible:wu-ring-2 focus-visible:wu-ring-ring focus-visible:wu-ring-offset-[5px] focus-visible:wu-ring-offset-background disabled:wu-cursor-not-allowed disabled:wu-opacity-50 data-[state=unchecked]:wu-bg-gray-25 wu-group","hover:wu-bg-gray-subtle hover:data-[state=unchecked]:wu-bg-gray-subtle",e),...r,ref:s,children:a.jsx(ta.Thumb,{className:c("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")})}));Vu.displayName=ta.Root.displayName;const Hu=f.forwardRef((e,t)=>{const{Label:r,labelPosition:s="right",onChange:u,className:o,dir:n,disabled:l,id:i=It(),...w}=e;return f.useEffect(()=>{const{checked:d,defaultChecked:p}=w;d!==void 0&&p!==void 0&&console.error("WuToggle: Both `checked` and `defaultChecked` props are set. Use only one of them.")},[w.checked,w.defaultChecked]),a.jsxs("div",{className:c(dc({labelPosition:s}),"wu-toggle-container"),dir:n,children:[a.jsx(Vu,{...w,id:i,disabled:l,ref:t,onCheckedChange:u,className:c("wu-peer",o),dir:n}),a.jsx(be,{htmlFor:i,className:"wu-toggle-label",children:r})]})});Hu.displayName="WuToggle";const dc=Ce.cva("wu-flex wu-items-center wu-gap-3 wu-w-fit",{variants:{labelPosition:{right:"wu-flex-row",left:"wu-flex-row-reverse",top:"wu-flex-col-reverse wu-items-baseline"}}});window.wickUiVersion="1.11.0",S.CHART_COLOR_SYSTEM=no,S.WuAccordion=co,S.WuAppHeader=Oo,S.WuAppHeaderAccount=nr,S.WuAppHeaderBar=dr,S.WuAppHeaderHelp=lr,S.WuAppHeaderMenu=wr,S.WuAppHeaderSearch=Po,S.WuButton=me,S.WuCalender=wa,S.WuCard=yr,S.WuCheckbox=Me,S.WuChip=jo,S.WuCombobox=en,S.WuCopyToClipboard=tn,S.WuDataTable=Gi,S.WuDatePicker=Bo,S.WuDateRangePicker=Ho,S.WuDisplay=No,S.WuDrawer=nn,S.WuDrawerClose=ln,S.WuFooter=Fr,S.WuFormGroup=Wo,S.WuHeading=yo,S.WuHelpButton=Br,S.WuIcon=Oe,S.WuInput=ze,S.WuInputError=Mo,S.WuInputHint=_o,S.WuLabel=be,S.WuListbox=gn,S.WuLoader=Re,S.WuMenu=Vr,S.WuMenuCheckboxItem=hn,S.WuMenuIcon=Na,S.WuMenuItem=ya,S.WuMenuItemGroup=mn,S.WuMenuRadioItem=xn,S.WuMenuSeparatorItem=yn,S.WuModal=_n,S.WuModalClose=Ln,S.WuModalContent=An,S.WuModalFooter=Pn,S.WuModalHeader=Wn,S.WuMonthPicker=Un,S.WuPagination=ts,S.WuPopover=Yn,S.WuPopoverClose=Kn,S.WuPrimaryNavbar=jn,S.WuRadioGroup=us,S.WuScrollArea=Jn,S.WuSecondaryNavbar=Gn,S.WuSelect=Zr,S.WuSidebar=pl,S.WuSidebarContent=bl,S.WuSidebarFooter=gl,S.WuSidebarGroup=hl,S.WuSidebarItem=xl,S.WuSidebarMenu=ml,S.WuSidebarTrigger=vs,S.WuSpotlight=Yr,S.WuStepper=Oi,S.WuSubMenu=vn,S.WuSubtext=vo,S.WuSwitcher=bu,S.WuTab=Ui,S.WuTable=Yi,S.WuText=xo,S.WuTextarea=ku,S.WuTimePicker=Au,S.WuToast=wc,S.WuToggle=Hu,S.WuTooltip=Mt,S.WuTruncatedLabel=Lo,S.WuVirtualScroll=et,S.useWuShowToast=uc,S.useWuSidebar=$e,Object.defineProperty(S,Symbol.toStringTag,{value:"Module"})});
|
|
7
10
|
//# sourceMappingURL=index.js.map
|