@npm-questionpro/wick-ui-lib 1.17.3-next.0 → 1.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,10 +1,10 @@
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"),require("react-transition-group")):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","react-transition-group"],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,S.ReactTransitionGroup))})(this,function(S,a,Je,f,Ru,eo,to,Xe,Se,ao,ra,H,it,ur,ro,we,so,uo,or,oo,no,lo,io,co,wo,fo,De,po,bo,Dt){"use strict";var _c=Object.defineProperty;var Ac=(S,a,Je)=>a in S?_c(S,a,{enumerable:!0,configurable:!0,writable:!0,value:Je}):S[a]=Je;var kt=(S,a,Je)=>Ac(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),Ze=ue(to),nr=ue(ao),ct=ue(ra),wt=ue(it),sa=ue(ro),X=ue(uo),Y=ue(or),Ve=ue(oo),dt=ue(no),lr=ue(lo),go=ue(io),Mt=ue(co),ir=ue(wo),ze=ue(fo),pe=ue(po),ua=ue(bo),ho=eo.extendTailwindMerge({prefix:"wu-"});function c(...e){return ho(Ru.clsx(e))}const oa=e=>{window.open(e,"_blank","toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=800,height=600")};function _t(){return Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15)}function ft(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 mo=e=>e?/\S+@questionpro\.com/.test(e):!1,cr=qe.Root,na=g.forwardRef(({className:e,...t},r)=>a.jsx(qe.Item,{ref:r,className:c("wu-border-b",e),...t}));na.displayName="AccordionItem";const la=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"})]})}));la.displayName=qe.Trigger.displayName;const ia=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})}));ia.displayName=qe.Content.displayName;const xo=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(cr,{type:"multiple",className:"wu-w-full wu-accordion-container",defaultValue:u,value:o,onValueChange:n,dir:s,children:t.map(({value:i,Summary:l,Details:w,className:d})=>a.jsxs(na,{value:i,dir:s,className:c(r,d),children:[a.jsx(la,{dir:s,className:"wu-accordion-summary",children:l}),a.jsx(ia,{dir:s,className:"wu-accordion-details",children:w})]},i))})}else{const{defaultValue:u,value:o,onValueChange:n}=e;return a.jsx(cr,{type:"single",className:"wu-w-full wu-accordion-container",defaultValue:u,value:o,onValueChange:n,dir:s,collapsible:!0,children:t.map(({value:i,Summary:l,Details:w,className:d})=>a.jsxs(na,{value:i,dir:s,className:c(r,d),children:[a.jsx(la,{dir:s,className:"wu-accordion-summary",children:l}),a.jsx(ia,{dir:s,className:"wu-accordion-details",children:w})]},i))})}},wr=g.forwardRef(({className:e,...t},r)=>a.jsx(Ze.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}));wr.displayName=Ze.Root.displayName;const dr=g.forwardRef(({className:e,...t},r)=>a.jsx(Ze.Image,{ref:r,className:c("wu-aspect-square wu-h-full wu-w-full",e),...t}));dr.displayName=Ze.Image.displayName;const fr=g.forwardRef(({className:e,...t},r)=>a.jsx(Ze.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}));fr.displayName=Ze.Fallback.displayName;function ca(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 wa={dropdownContainer:"_dropdownContainer_vvlo9_1",open:"_open_vvlo9_1",dropdownMenu:"_dropdownMenu_vvlo9_1"},pr=({dir:e,Trigger:t,triggerClassName:r,DropdownContent:s})=>{const[u,o]=f.useState(!1),n=f.useRef(null),i=f.useRef(null);ca([n,i],()=>o(!1));const l=()=>{o(!u)};return a.jsx(a.Fragment,{children:a.jsx("div",{className:wa.dropdownContainer,children:a.jsx("ul",{children:a.jsxs("li",{className:c("wu-flex wu-relative",u&&wa.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(),l()},ref:i,"aria-label":"dropdown-trigger",children:t}),a.jsx("div",{className:c(wa.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})]})})})})},da=Se.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:[]}),Qe=g.forwardRef(({className:e,variant:t,size:r,color:s,asChild:u=!1,...o},n)=>{const i=u?Xe.Slot:"button";return a.jsx(i,{className:c(da({size:r,color:s,variant:t,className:e})),ref:n,...o})});Qe.displayName="Button";const Re=f.forwardRef((e,t)=>yo(e,t)),yo=(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 i="7px";r==="sm"?i="7px":r==="md"?i="12px":r==="lg"?i="18px":typeof r=="string"&&(i=r);const l={backgroundColor:s,width:i,height:i},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:i,height:i,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:i},role:"loader",children:[a.jsx("li",{className:"wu-dot wu-loader-dot",style:l}),a.jsx("li",{className:"wu-dot wu-loader-dot",style:l}),a.jsx("li",{className:"wu-dot wu-loader-dot",style:l}),a.jsx("li",{className:"wu-dot wu-loader-dot",style:l})]}),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:i,className:l,color:w="primary",selected:d,...p},b)=>{const x={primary:"#1986e688",upgrade:"#f5830088",error:"#ef444488"};return a.jsxs(Qe,{...p,disabled:e,variant:r,size:s,className:c(i&&"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",l),color:w,style:{backgroundColor:t?x[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 vo=({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"})]}),No=({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},i)=>a.jsx("li",{className:i<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]})},i))}),a.jsx("hr",{className:"wu-border-gray-subtle"})]})},So=({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"})]}),Co=({user:e,dir:t})=>{var r,s,u,o,n,i,l,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:(i=e==null?void 0:e.license)==null?void 0:i.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:(l=e==null?void 0:e.license)==null?void 0:l.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})]})]})]})]})},br=({user:e,onLogout:t,dir:r,DataCenter:s})=>{var u,o;return e?a.jsx(pr,{Trigger:a.jsxs(wr,{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(dr,{className:"hover:wu-opacity-80",src:(u=e==null?void 0:e.profile)==null?void 0:u.profilePicture,alt:"User"}),a.jsx(fr,{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(Co,{user:e,dir:r}),(e==null?void 0:e.settings)&&e.settings.length>0&&a.jsx(So,{settings:e.settings,dir:r}),a.jsx(No,{user:e,dir:r}),a.jsx(vo,{onLogout:t,DataCenter:s})]})}):null},gr=({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(pr,{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:()=>oa(s.link),onKeyDown:o=>{o.key==="Enter"&&oa(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(hr,{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(hr,{item:s,dir:t})})},u))})})},hr=({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})]})]}),Eo=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 To({productCategories:e,openCategory:t,setOpenCategory:r}){const s=(i,l)=>{const w=l[i];if(w){w.focus();const d=e[i]||null;r(d)}},u=(i,l,w,d)=>{i.preventDefault();const p=w==="down"?l+1:l-1;s(p,d)},o=(i,l,w,d)=>{t!=null&&t.products&&t.products[t.products.length-1].name===d&&(i.preventDefault(),s(l+1,w))},n=(i,l)=>{i.preventDefault();const w=e[l]===t?null:e[l];r(w)};return function(l,w,d){const p=document.querySelectorAll("[data-product-category]"),{key:b}=l;switch(b){case"ArrowDown":u(l,w,"down",p);break;case"ArrowUp":u(l,w,"up",p);break;case"Tab":o(l,w,p,d);break;case"Enter":case" ":n(l,w);break}}}const Io=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})},ko=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"},i=o[t];return a.jsx(i,{...u,className:c(n[t],r),children:s})},Do=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})},Mo=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})},Le=e=>{const{icon:t,className:r,...s}=e;return a.jsx("span",{...s,className:c(t,r),role:"presentation","aria-label":t})},_o=({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:i=>{s&&i.key==="ArrowDown"&&r(i,-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(Le,{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"},Ao=({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})]})},Wo={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"},Po=({product:e,currentProduct:t,activeProductName:r,dir:s,focusItem:u,setFocusItem:o})=>{const[n,i]=f.useState(e.name===t),l=e.name===r,w=e.name===t,d=!e.active,p="#1b3380",b="#c5cce0",x="#ffcf70",h=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"),N=n||u===e.name||l?p:b;return a.jsxs("li",{className:c(R.productListItem,"focus-visible:wu-outline-none focus:wu-outline-none wu-sub-product-list-item",(l||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:()=>i(!0),onMouseOut:()=>i(!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?x:N}}),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,Wo[e.icon||""]),"aria-hidden":!0}),a.jsx("span",{className:c(h),children:e.name})]})]},e.name)},Lo=({category:e,currentProduct:t,activeProductName:r,dir:s="ltr",focusItem:u,setFocusItem:o,borderColorLocked:n="#f5a300"})=>{const{products:i=[],active:l}=e,w=f.useMemo(()=>i.filter(h=>h.active).sort((h,m)=>(h.order||100)-(m.order||100)),[i]),d=f.useMemo(()=>i.filter(h=>!h.active),[i]),[p,b]=f.useState(n),x=h=>h.map((m,N)=>a.jsx(Po,{product:m,currentProduct:t,activeProductName:r,dir:s,focusItem:u,setFocusItem:o},N));return l?a.jsxs(a.Fragment,{children:[x(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"]})]})]}),x(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"})})]})},mr=({dropdownRef:e,dir:t,isDropdownOpen:r,productCategories:s,openCategory:u,setOpenCategory:o,handleKeyDown:n,expandAll:i,activeProductName:l,focusItem:w,setFocusItem:d})=>{const p="#ffcf70",[b,x]=f.useState(window.innerWidth>768);return f.useEffect(()=>{const h=()=>{x(window.innerWidth>375)};return window.addEventListener("resize",h),()=>window.removeEventListener("resize",h)},[]),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((h,m)=>a.jsxs("li",{className:c(R.productCategory,"focus:wu-outline-none focus-visible:wu-outline-none wu-h-16 wu-category-item",u===h&&R.open,i&&R.open),onMouseEnter:()=>b&&o(h),onMouseLeave:()=>b&&o(null),"aria-label":h.name,dir:t,onKeyDown:N=>n(N,m),tabIndex:0,"data-product-category":!0,children:[a.jsx(Ao,{category:h,dir:t,openCategory:u}),a.jsx("ul",{className:c(R.productList,t==="rtl"&&R.rtlProductList),dir:t,children:a.jsx(Lo,{category:h,dir:t,activeProductName:l,currentProduct:h.name,focusItem:w,setFocusItem:d,borderColorLocked:p})})]},h.name))})},Oo=({isProductButtonShow:e,isDropdownOpen:t,activeProductColor:r,activeProductBgColor:s,activeProductName:u,dir:o,smallScreenButtonRef:n,handleDropdownToggle:i,handleKeyDown:l})=>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:i,onKeyDown:w=>{t&&w.key==="ArrowDown"&&l(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")})]})}),Fo=({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"}`})]})},xr=({productCategories:e,activeProductName:t,activeProductColor:r={base:"#1b87e6",hover:"#54A5EC"},dir:s,homeLink:u,expandAll:o})=>{const n=f.useRef(null),i=f.useRef(null),l=f.useRef(null),w=f.useRef(null),[d,p]=f.useState(!1),[b,x]=f.useState(null),[h,m]=f.useState(r.base),[N,E]=f.useState(""),[y,C]=f.useState(!1),v=Eo(768);ca([i,n],()=>{p(!1),x(null)}),ca([l,w,i],()=>{C(!1),p(!1),x(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 k=T=>{T.preventDefault(),T.stopPropagation(),p(_=>{const M=!_;return M||x(null),M})},D=(T,_)=>{To({productCategories:e,openCategory:b,setOpenCategory:x})(T,_,N)};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:v?a.jsxs("div",{className:"wu-relative wu-flex",children:[a.jsx(Fo,{dir:s,isProductButtonShow:y,smallScreenToggleButtonRef:w,setDropdownOpen:p,setIsProductButtonShow:C}),a.jsx(Oo,{isProductButtonShow:y,isDropdownOpen:d,activeProductColor:r,activeProductBgColor:h,activeProductName:t,handleDropdownToggle:k,smallScreenButtonRef:l,handleKeyDown:D,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(mr,{activeProductName:t,focusItem:N,setFocusItem:E,handleKeyDown:D,isDropdownOpen:d,openCategory:b,productCategories:e,setOpenCategory:x,dropdownRef:i,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:h},onMouseOver:()=>m(r.hover),onMouseOut:()=>m(r.base),children:[a.jsx(_o,{activeProductName:t,dir:s,homeLink:u,buttonRef:n,handleDropdownToggle:k,handleKeyDown:D,isDropdownOpen:d}),a.jsx(mr,{activeProductName:t,focusItem:N,setFocusItem:E,handleKeyDown:D,isDropdownOpen:d,openCategory:b,productCategories:e,setOpenCategory:x,dropdownRef:i,expandAll:o,dir:s})]})})},yr=({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})}),fa=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}));fa.displayName="Input";const Bo=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})},qo=e=>{var i,l;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)},[(i=t==null?void 0:t.current)==null?void 0:i.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&&`${(l=t==null?void 0:t.current)==null?void 0:l.value.length}/${r}`})},Vo=Se.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"),At=g.forwardRef(({className:e,...t},r)=>a.jsx(nr.Root,{ref:r,className:c(Vo(),e),...t}));At.displayName=nr.Root.displayName;const be=e=>a.jsx(At,{...e,className:c("wu-text-gray-lead wu-leading-6",e.className)}),zo=({Label:e,Error:t,Hint:r,Input:s,labelPosition:u="top",dir:o="ltr",className:n,...i})=>{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,...i,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})]})]})},He=f.forwardRef((e,t)=>{const{Label:r,labelPosition:s="top",Icon:u,iconPosition:o,type:n,value:i,variant:l="flat",readonly:w,id:d=_t(),...p}=e,b=ft(s),x=u?o!=="right"?"wu-pl-8":"wu-pr-8":"",[h,m]=f.useState(!1),N=()=>{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(fa,{...p,className:c("wu-peer wu-text-xs wu-rounded-t-sm",l==="outlined"?"wu-border wu-border-gray-subtle":"",x,p.className),type:h?"text":n,ref:t,readOnly:w,onChange:p.onChange&&E,value:i,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:N,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:h?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})]})})})});He.displayName="WuInput";const Ho=({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(He,{...u,placeholder:t,onChange:i=>s(i.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(Le,{"data-testid":"search-icon",icon:"wm-search",className:c("wu-text-gray-lead wu-cursor-pointer",o&&"wu-text-white"),onClick:()=>n(i=>!i)})})},vr=ct.Provider,Nr=ct.Root,Sr=ct.Trigger,pa=g.forwardRef(({className:e,sideOffset:t=4,...r},s)=>a.jsx(ct.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}));pa.displayName=ct.Content.displayName;const Wt=f.forwardRef(({content:e,position:t,positionOffset:r,duration:s,children:u,className:o,showArrow:n=!1,open:i,onOpenChange:l,...w},d)=>a.jsx(vr,{delayDuration:s||200,children:a.jsxs(Nr,{open:i,onOpenChange:l,children:[a.jsx(Sr,{asChild:!0,children:a.jsx("span",{ref:d,children:u})}),a.jsx(ra.Portal,{children:e&&a.jsxs(pa,{...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(ra.Arrow,{className:"wu-fill-gray-notification wu-tooltip-arrow"})]})})]})}));Wt.displayName="WuTooltip";const $o=({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,i=o.scrollWidth,l=i/e.length,w=e.length*l;u(w>n||i>n)}},[e]),a.jsx("p",{ref:r,className:c("wu-w-full wu-truncate",t),children:s?a.jsx(Wt,{content:e,positionOffset:8,children:e}):e})},Uo=e=>{var p;const{productName:t,categories:r=[],user:s,children:u,onLogout:o,homeLink:n=window.location.origin,brandColor:i,dir:l="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",l==="rtl"&&"wu-flex-row-reverse",e.className),style:e.style,children:[mo((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(xr,{productCategories:r,activeProductName:t,activeProductColor:i,dir:l,homeLink:n,expandAll:w})}),a.jsx(yr,{dir:l,children:u}),a.jsxs("section",{className:c("wu-flex wu-items-center wu-justify-end wu-shrink-0 wu-gap-2",l==="rtl"?"wu-flex-row-reverse wu-pl-4":"wu-flex-row wu-pr-4"),children:[a.jsx(gr,{dir:l}),(s==null?void 0:s.profile)&&Object.keys(s.profile).length>0&&a.jsx(br,{user:s,onLogout:o,dir:l,DataCenter:d})]})]})})},Me=wt.Root,$e=wt.Trigger,Ce=g.forwardRef(({className:e,align:t="center",sideOffset:r=4,...s},u)=>a.jsx(wt.Portal,{children:a.jsx(wt.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})}));Ce.displayName=wt.Content.displayName;function Cr({className:e,classNames:t,dir:r="ltr",...s}){const u=ur.getDefaultClassNames();return a.jsx(ur.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,da({variant:"iconOnly"}),"wu-h-6 wu-w-6 wu-text-gray-lead"),button_previous:c(u.button_previous,da({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})}Cr.displayName="Calendar";const ba=e=>a.jsx(Cr,{...e}),Er=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(it.PopoverClose,{asChild:!0,children:a.jsx(me,{onClick:t,disabled:r,className:"wu-date-picker-apply",children:"Apply"})})]})},ga=({formattedString:e,dir:t,placeholder:r="Select Date",className:s,variant:u="primary",color:o,CustomTrigger:n,...i})=>a.jsx(it.PopoverTrigger,{asChild:!n,dir:t,children:n?a.jsx(a.Fragment,{children:n(e)}):a.jsx(me,{...i,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})}),Tr=(e,t,r,s)=>{const u=H.startOfDay(e).getTime();return!!(t||r&&u<H.startOfDay(r).getTime()||s&&u>H.startOfDay(s).getTime())},Pt=e=>e?typeof e=="string"?new Date(e):e:new Date,ha="\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01])",jo=[{label:"Last 7 days",value:7},{label:"Last 30 days",value:30},{label:"Last 90 days",value:90},{label:"Last 365 days",value:365}],Go=({formatString:e="yyyy-MM-dd",value:t,onChange:r,disabled:s,minDate:u=H.sub(new Date,{years:5}),maxDate:o=H.add(new Date,{years:1}),dir:n="ltr",Label:i,labelPosition:l="top",onReset:w,showResetButton:d=!1,placeholder:p="Select Date",CustomTrigger:b,...x})=>{const[h,m]=f.useState(),[N,E]=f.useState(""),y=f.useCallback(()=>{const v=Pt(h);E(H.format(v,e)),r&&r(h)},[h,e,r]),C=f.useCallback(()=>{w?w():(m(void 0),E(""),r&&r(void 0))},[r,w]);return f.useEffect(()=>{const v=Pt(t);m(v),E(H.format(v,e))},[t,e]),a.jsxs(be,{className:c("wu-flex wu-gap-1",l==="left"?"wu-items-center":"wu-flex-col wu-items-start","wu-date-picker-label"),dir:n,children:[i,a.jsxs(Me,{children:[a.jsx(ga,{formattedString:N,dir:n,placeholder:p,CustomTrigger:b,...x}),a.jsx(Ce,{className:"wu-p-0 wu-w-fit wu-date-picker-content",align:"start",sideOffset:-.5,dir:n,children:a.jsx(ba,{dir:n,mode:"single",captionLayout:"dropdown",selected:h,onSelect:m,disabled:v=>Tr(v,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(Er,{handleDateChange:y,disabled:s,onReset:C,showResetButton:d})})})]})]})},Ir="yyyy-MM-dd",Yo=[{label:"Day",value:1},{label:"Week",value:7},{label:"Month",value:30},{label:"Quarter",value:90},{label:"Year",value:365}],Ko=({current:e,onSelect:t,presetRanges:r=jo})=>{const[s,u]=f.useState(),[o,n]=f.useState(!1),[i,l]=f.useState(""),[w,d]=f.useState(""),[p,b]=f.useState(!1),x=f.useMemo(()=>r.map(y=>y.value),[r]),h=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:H.sub(new Date,{days:C}),to:new Date})},[t]),N=f.useCallback((y,C)=>{if(!y||!(e!=null&&e.to)||!(e!=null&&e.from)||!new RegExp(ha).test(y))return!1;const k=new Date(C==="start"?y:e.from),D=new Date(C==="end"?y:e.to);return H.isBefore(D,k)?(b(!0),!1):(b(!1),!(H.isSameDay(k,e.from)&&H.isSameDay(D,e.to)))},[e]),E=f.useCallback((y,C)=>{if((C==="start"?l:d)(y),N(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)),t(k)}},[e,t,N]);return f.useEffect(()=>{if(e!=null&&e.to&&(e!=null&&e.from)&&H.isValid(e.to)&&H.isValid(e.from)){l(H.format(e.from,Ir)),d(H.format(e.to,Ir));const y=H.differenceInCalendarDays(e.to,e.from);H.isToday(e.to)&&x.includes(y+1)?(u(y),n(!1)):(u(void 0),n(!0))}},[e,x]),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:Yo.map(({label:y,value:C})=>a.jsx(Qe,{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(h,s===C-1&&"wu-bg-blue-p/10"),onClick:()=>m(C),children:y})},C)),a.jsx("li",{children:a.jsx("button",{className:c(h,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(He,{placeholder:"Start Date",pattern:ha,value:i,onChange:y=>E(y.target.value,"start"),"aria-label":"Start Date"}),a.jsx(He,{placeholder:"End Date",pattern:ha,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"})]})]})},Jo=({formatString:e="yyyy/MM/dd",value:t,onChange:r,disabled:s,minDate:u=H.sub(new Date,{years:5}),maxDate:o=H.add(new Date,{years:1}),dir:n="ltr",minDateToSelect:i,maxDateToSelect:l,presetRanges:w,Label:d,labelPosition:p="top",onReset:b,showResetButton:x=!0,placeholder:h="Select Date Range",CustomTrigger:m,...N})=>{const[E,y]=f.useState(t),[C,v]=f.useState(t),[k,D]=f.useState(""),T=f.useCallback(()=>{if(C){const L=C.from,P=C.to;y({from:L,to:P}),D(`${H.format(L,e)} - ${H.format(P,e)}`),r&&r({from:L,to:P})}},[C,e,r]),_=f.useCallback(()=>{v(E)},[E]),M=f.useCallback(()=>{b?b():(y(void 0),v(void 0),D(""),r&&r(void 0))},[b,r]);return f.useEffect(()=>{if(t!=null&&t.from&&(t!=null&&t.to)){const L=Pt(t.from),P=Pt(t.to);y(t),v(t),D(`${H.format(L,e)} - ${H.format(P,e)}`)}else y(void 0),v({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(Me,{onOpenChange:L=>!L&&_(),children:[a.jsx(ga,{formattedString:k,dir:n,placeholder:h,CustomTrigger:m,...N}),a.jsxs(Ce,{className:"wu-flex wu-p-0 wu-border wu-w-fit wu-border-blue-p",align:"start",sideOffset:-.5,dir:n,children:[a.jsx(Ko,{current:C,onSelect:v,presetRanges:w}),a.jsx(ba,{dir:n,numberOfMonths:2,mode:"range",captionLayout:"dropdown",selected:C,onSelect:v,disabled:L=>Tr(L,s,u,o),startMonth:u,endMonth:o,required:!0,autoFocus:!0,defaultMonth:E==null?void 0:E.from,className:c("wu-shadow-none wu-date-range-picker"),min:i,max:l,footer:a.jsx(Er,{handleDateChange:T,disabled:s,onReset:M,showResetButton:x})})]})]})]})},kr=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})});kr.displayName="WuCard";const Xo=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)})});Xo.displayName="WuCardHeader";const Zo=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)})});Zo.displayName="WuCardHeader";const Dr=g.forwardRef(({className:e,partial:t,...r},s)=>a.jsx(sa.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(sa.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"})]})}));Dr.displayName=sa.Root.displayName;const Ee=f.forwardRef((e,t)=>{const{disabled:r,checked:s,Label:u,labelPosition:o="right",className:n,id:i=_t(),partial:l,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:Qo({labelPosition:o,className:"wu-checkbox-container"}),dir:b.dir,children:[a.jsx(Dr,{id:i,...b,partial:l,checked:s,disabled:r||p,onCheckedChange:w,className:c("wu-peer wu-checkbox",n),required:d,ref:t}),u&&a.jsx(be,{htmlFor:i,className:"wu-w-full wu-checkbox-label",children:u})]})}),Qo=Se.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"}}});Ee.displayName="WuCheckbox";const Ro=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})},ma=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}));ma.displayName=we.Command.displayName;const Mr=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})}));Mr.displayName=we.Command.Input.displayName;const xa=g.forwardRef(({className:e,...t},r)=>a.jsx(we.Command.List,{ref:r,className:c("",e),...t}));xa.displayName=we.Command.List.displayName;const ya=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}));ya.displayName=we.Command.Empty.displayName;const pt=g.forwardRef(({className:e,...t},r)=>a.jsx(we.Command.Group,{ref:r,className:c("",e),...t}));pt.displayName=we.Command.Group.displayName;const _r=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}));_r.displayName=we.Command.Separator.displayName;const bt=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}));bt.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(so.Virtuoso,{ref:n,dir:s,className:u,style:{height:e,scrollbarWidth:"thin",scrollbarColor:"#d4d4d4 #f1f1f1",overflowX:"hidden",...o},data:t,itemContent:(i,l)=>r(i,l)}));et.displayName="WuVirtualScroll";const en=({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((l,w)=>a.jsx("li",{className:"wu-py-1 wu-text-xs wu-text-left",children:l},w))}),[u]),i=l=>{const w=document.createElement("div");Object.assign(w.style,{display:"inline-block",visibility:"hidden",position:"absolute",whiteSpace:"nowrap"}),w.textContent=l,document.body.appendChild(w);const d=w.offsetWidth;return document.body.removeChild(w),d+8};return f.useEffect(()=>{const l=()=>{if(t.current){const b=t.current.offsetWidth-20-36;let x=0;const h=[],m=[];e.forEach(N=>{const E=i(N);x+E+8<b?(h.push(N),x+=E+8):m.push(N)}),s(h),o(m)}};return l(),window.addEventListener("resize",l),()=>{window.removeEventListener("resize",l)}},[e,t]),a.jsxs("div",{className:"wu-flex wu-items-center wu-gap-2 wu-text-xs",children:[r.map((l,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:l},w)),u.length>0&&a.jsx(Wt,{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]})})]})},tn=({placeholder:e="Select...",isEllipse:t=!1,selectedOptions:r,variant:s="flat",dir:u="ltr",accessorKey:o,multiple:n,id:i,disabled:l,selectAll:w,isCheckedAll:d,className:p,...b})=>{const[x,h]=f.useState([]),m=f.useRef(null);f.useEffect(()=>{if(!r||Array.isArray(r)&&r.length===0){h([]);return}if(n){const E=r;h(E==null?void 0:E.map(y=>y[o.label]));return}else h([r[o.label]])},[r]);const N=()=>{var E;return x.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:x.join(", ")}):a.jsx(en,{tags:x,triggerRef:m}):a.jsx("p",{className:"wu-text-xs wu-opacity-70",children:e})};return a.jsx($e,{dir:u,asChild:!0,id:i,disabled:l,children:a.jsxs("button",{...b,ref:m,disabled:l,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:[N(),a.jsx("span",{className:"wm-arrow-drop-down group-data-[state=open]:wu-rotate-180 wu-transition-transform wu-duration-300 wu-text-base"})]})})},Ar=X.Root,Wr=X.Trigger,Pr=X.Group,an=X.Portal,rn=X.Sub,sn=X.RadioGroup,Lr=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-2 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")})]}));Lr.displayName=X.SubTrigger.displayName;const Or=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}));Or.displayName=X.SubContent.displayName;const va=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})}));va.displayName=X.Content.displayName;const Lt=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}));Lt.displayName=X.Item.displayName;const Fr=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]}));Fr.displayName=X.CheckboxItem.displayName;const Br=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]}));Br.displayName=X.RadioItem.displayName;const gt=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}));gt.displayName=X.Label.displayName;const Ot=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}));Ot.displayName=X.Separator.displayName;const qr=({option:e,value:t,multiple:r=!1,onSelect:s,accessorKey:u,dir:o})=>{const[n,i]=f.useState(r?[]:"");f.useEffect(()=>{t&&i(r?t.map(p=>JSON.stringify(p[u.value])):JSON.stringify(t[u.value]))},[t,u.value,r]);const l=r?n.includes(JSON.stringify(e[u.value])):n===JSON.stringify(e[u.value]),w=()=>{e.disabled||s(e)};return a.jsxs(bt,{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",l&&"wu-bg-gray-10"),dir:o,children:[r&&a.jsx(Ee,{checked:l}),a.jsx(un,{option:e,accessorKey:u})]})},un=({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"})]})},Vr=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(bt,{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(Ee,{checked:u||o,partial:o,"data-partial":o,Label:(r==null?void 0:r.label)||"Select All"})});case"group":return a.jsxs(pt,{children:[a.jsx(gt,{children:t.label}),t.options.map((l,w)=>f.createElement(qr,{...n,option:l,key:w}))]});case"divider":return a.jsx(_r,{className:"wu-mx-4"});default:return a.jsx(qr,{...n,option:t})}},on=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}},nn=f.memo(He),ln=({data:e,accessorKey:t,value:r,defaultValue:s,Header:u,virtualizedThreshold:o=100,isEllipse:n,placeholder:i,variant:l,dir:w,onSelect:d,Label:p,maxHeight:b=420,multiple:x=!1,hasGroup:h=!1,selectAll:m,id:N,disabled:E,labelPosition:y="top",className:C,onScroll:v,maxContentWidth:k,...D})=>{const[T,_]=f.useState(""),[M,L]=f.useState(),[P,O]=f.useState(!1),[A,F]=f.useState(!1),[q,W]=f.useState(!1),U=f.useRef(null),{allOptions:z,groups:Z,dividers:ae,enabledOptions:le}=f.useMemo(()=>h||m&&!m.includeDisabled?on(e):{allOptions:e,groups:[],dividers:[],enabledOptions:[]},[e,h]),ee=f.useMemo(()=>{if(!T)return e;const I=T.toLowerCase();return z.filter(V=>V[t.label].toLowerCase().includes(I))},[T,z,e,t.label]),B=f.useMemo(()=>x&&m!=null&&m.enable&&!T&&ee.length>0?[{type:"all"},...ee]:ee,[ee,T,x]),K=f.useMemo(()=>{const I=32*B.length+ae.length*9+Z.length*48;return Math.min(b,I)},[b,B,ae,Z]),Q=f.useCallback(I=>{const V=I[t.value];x?L(ne=>{const $=ne||[],te=$.some(de=>de[t.value]===V)?$.filter(de=>de[t.value]!==V):[...$,I];return d==null||d(te),te}):(O(!1),L(I),d==null||d(I))},[x,t.value,d]),j=f.useCallback(I=>_(I.target.value),[]),Te=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?L(r):s!==void 0&&L(s)},[r,s]),f.useEffect(()=>{if(!x)return;const I=m!=null&&m.includeDisabled?(M==null?void 0:M.length)===z.length:(M==null?void 0:M.length)===le.length;F(I);const V=(M==null?void 0:M.length)>0&&!I;W(V)},[M,m]);const Ie=f.useCallback(()=>{const I=A?[]:m!=null&&m.includeDisabled?z:le;L(I),d==null||d(I)},[A,x,z,le,d,m]),ye=ft(y);return a.jsxs("div",{className:c(ye,"wu-flex wu-combobox-container"),ref:U,children:[a.jsxs(Me,{onOpenChange:I=>{I&&Te(),O(I)},open:P,modal:!0,children:[a.jsx(tn,{...D,selectedOptions:M,accessorKey:t,isEllipse:n,placeholder:i,variant:l,dir:w,multiple:x,disabled:E,selectAll:m,isCheckedAll:A,className:C,id:N}),a.jsx(Ce,{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:a.jsxs(ma,{id:N,children:[a.jsx("div",{className:"wu-m-2",children:a.jsx(nn,{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(xa,{children:[a.jsx(ya,{children:"No results found."}),B.length>=o?a.jsx(et,{className:"wu-combobox-list",containerHeight:b,list:B,callback:(I,V)=>a.jsx(Vr,{option:V,value:M,onSelect:Q,multiple:x,accessorKey:t,dir:w,selectAll:m,handleSelectAll:Ie,isCheckedAll:A,isPartialSelected:q},I),dir:w}):a.jsx("div",{style:{maxHeight:K,height:"fit-content",overflow:"auto"},className:"wu-combobox-list",onScroll:v,children:B.map((I,V)=>a.jsx(Vr,{option:I,value:M,onSelect:Q,multiple:x,accessorKey:t,dir:w,selectAll:m,handleSelectAll:Ie,isCheckedAll:A,isPartialSelected:q},V))})]})]})})]}),p&&a.jsx(be,{htmlFor:N,className:"wu-combobox-label",children:p})]})},cn=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(i){console.error("Failed to copy:",i)}};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(Le,{icon:"wm-content-copy",className:"wu-text-lg"})]})},zr=Y.Root,wn=Y.Trigger,dn=Y.Close,fn=Y.Portal,Hr=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}));Hr.displayName=Y.Overlay.displayName;const pn=Se.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"}}),Na=g.forwardRef(({side:e="right",className:t,children:r,hideCloseButton:s,...u},o)=>a.jsxs(fn,{children:[a.jsx(Hr,{}),a.jsxs(Y.Content,{ref:o,className:c(pn({side:e}),t),...u,children:[r,!s&&a.jsx(Y.Close,{"aria-label":"close",asChild:!0,children:a.jsxs(Qe,{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"})]})})]})]}));Na.displayName=Y.Content.displayName;const $r=g.forwardRef(({className:e,...t},r)=>a.jsx(Y.Title,{ref:r,className:c("wu-text-lg wu-font-semibold",e),...t}));$r.displayName=Y.Title.displayName;const bn=g.forwardRef(({className:e,...t},r)=>a.jsx(Y.Description,{ref:r,className:c("wu-text-sm",e),...t}));bn.displayName=Y.Description.displayName;const gn=e=>t=>{e&&t.preventDefault()},hn=e=>{const{Trigger:t,children:r,hideCloseButton:s,className:u,side:o="left",open:n,onOpenChange:i,preventClickOutside:l,...w}=e;return a.jsxs(zr,{open:n,onOpenChange:i,children:[a.jsx(wn,{asChild:!0,children:t}),a.jsxs(Na,{...w,onInteractOutside:gn(l),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($r,{})}),r]})]})},mn=({children:e,...t})=>a.jsx(dn,{...t,children:e}),Ur=({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})]});Ur.displayName="WuFooter";const jr=f.forwardRef((e,t)=>{const{size:r="sm",idOrSlugOrUrl:s,variant:u="primary",...o}=e,n=r==="sm"?16:18,i=s.includes("http")?s:`/help/${s}.html`,l=u==="primary"?"wu-text-blue-p":"wu-text-gray-lead";return a.jsx("button",{...o,ref:t,onClick:()=>oa(i),children:a.jsx("span",{className:c("wm-help wu-text-gray-subtle",`wu-text-[${n}px]`,l,o.disabled&&"wu-text-neutral-300","wu-help-button-icon")})})});jr.displayName="WuHelpButton";const Fe=(e,t)=>`wu-listbox-${e}`;function xn(e){const{option:t,accessorKey:r,onSelect:s,multiple:u,dir:o,GroupLabel:n,Item:i,isSelected:l,...w}=e,d=r.group&&Array.isArray(t[r.group]),p=({item:b,className:x})=>f.createElement(bt,{...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",!!(l!=null&&l(b))&&!u&&"wu-bg-blue-p/10",o==="rtl"&&"wu-justify-end",x,Fe("item")),disabled:b.disabled},u&&a.jsx(Ee,{checked:l==null?void 0:l(b)}),i?i({value:b,isSelected:l==null?void 0:l(b)}):a.jsx(a.Fragment,{children:b[r.label]}));if(d){const b=t[r.group],x=typeof n=="string"?t[n]:n==null?void 0:n(t);return a.jsx(pt,{heading:x,children:b==null?void 0:b.map(h=>a.jsx(p,{item:h,className:"wu-pl-6"},JSON.stringify(h)))})}return a.jsx(p,{item:t})}const yn=f.memo(xn),vn=e=>{const{className:t,...r}=e;return a.jsxs("div",{className:"wu-relative",children:[a.jsx(Le,{icon:"wm-search",className:"wu-absolute wu-top-[14px] wu-left-5"}),a.jsx(Mr,{...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)})]})},Nn=e=>{const{label:t,onSelectAll:r,data:s,value:u}=e,[o,n]=f.useState(!1),[i,l]=f.useState(!1);return f.useEffect(()=>{!u||!s||(n(u.length>0),l(u.length>0&&u.length<s.length))},[s,u]),a.jsxs(bt,{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(Ee,{checked:o,partial:i}),t||"Select All"]})},Sn=e=>{const{CustomTrigger:t,disabled:r,value:s,placeholder:u,accessorKey:o,Chip:n,handleUnselect:i,variant:l,dir:w,className:d,...p}=e,[b,x]=f.useState(),h=f.useRef(null);return f.useEffect(()=>{if(!s){x(null);return}x(Array.isArray(s)?n?s.map((N,E)=>n({value:N,unselect:i,key:E})):s.map(N=>N[o.label]).join(", "):n?n({value:s,unselect:i}):s[o.label])},[s,n,o.label,x]),a.jsx($e,{asChild:!0,id:e.id,disabled:r,ref:h,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",l==="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(Le,{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"))})]})})},Gr=(e,t,r)=>{const s=String(e[r.label]??"").toLowerCase(),u=String(e[r.value]??"").toLowerCase();return s.includes(t)||u.includes(t)},Cn=(e,t,r)=>{const s=t.trim();if(s==="")return e;const u=s.toLowerCase(),o=[];for(const n of e){const i=r.group,l=i?n[i]:void 0;if(Array.isArray(l)){const w=l.filter(d=>Gr(d,u,r));w.length>0&&o.push({...n,[i]:w})}else Gr(n,u,r)&&o.push(n)}return o},En=e=>{const{data:t,accessorKey:r,value:s,Item:u,Label:o,GroupLabel:n,CustomHeader:i,CustomTrigger:l,NoDataContent:w,Chip:d,onSelect:p,onScroll:b,disabled:x,multiple:h,searchable:m,selectAll:N,virtualizedThreshold:E=100,id:y,dir:C,className:v,listClass:k,placeholder:D="Select items...",variant:T,labelPosition:_="top",maxContentWidth:M,maxContentHeight:L}=e,[P,O]=f.useState(!1),[A,F]=f.useState(""),[q,W]=f.useState(s),U=f.useMemo(()=>r,[r]),z=f.useMemo(()=>{if(!m||!A)return t;const B=A.toLowerCase().trim();return Cn(t,B,r)},[t,A,r.label,m]),Z=B=>{h?W(K=>{const Q=B[r.value],j=Array.isArray(K)?K:[],Ie=j.some(ye=>ye[r.value]===Q)?j.filter(ye=>ye[r.value]!==Q):[...j,B];return p&&p(Ie),Ie}):(W(B),p&&p(B),O(!1))},ae=f.useCallback(B=>{const K=B?t:[];W(K),N!=null&&N.onSelectAll&&N.onSelectAll(B),p&&p(K)},[t,N,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=Q=>a.jsx(yn,{option:Q,accessorKey:U,multiple:h,onSelect:j=>Z(j),dir:C,GroupLabel:n,Item:u,isSelected:j=>le(j)},JSON.stringify(Q));return B.length>E?a.jsx(et,{list:B,callback:(Q,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(Me,{open:P,onOpenChange:B=>{O(B),B||setTimeout(()=>{F("")},100)},children:[a.jsx(Sn,{CustomTrigger:l,disabled:x,value:q,accessorKey:r,placeholder:D,Chip:d,className:v,handleUnselect:Z,variant:T,id:y,dir:C}),a.jsx(Ce,{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:M},children:a.jsxs(ma,{id:e.id,shouldFilter:!1,children:[m&&a.jsx(vn,{value:A,onValueChange:F}),i,a.jsxs(xa,{className:c("wu-overflow-y-auto",Fe("list"),k),onScroll:b,style:{maxHeight:L||"420px"},children:[a.jsx(ya,{children:w||"No results found."}),a.jsx(pt,{children:h&&(N==null?void 0:N.enabled)&&!A&&a.jsx(Nn,{data:t,value:q,onSelectAll:ae,label:N.label})}),a.jsx(pt,{children:ee(z)})]})]})})]})]})},Tn=e=>{const{checked:t,onSelect:r,children:s,disabled:u,preventCloseOnSelect:o}=e;return a.jsx(Fr,{disabled:u,checked:t,onCheckedChange:r,onSelect:n=>o&&n.preventDefault(),children:s})},Sa=e=>{const{children:t,className:r,Icon:s,iconPosition:u="left",disabled:o,onSelect:n,preventCloseOnSelect:i}=e,l=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),i&&d.preventDefault()};return a.jsxs(Lt,{onSelect:w,disabled:o,className:l,children:[s&&a.jsx("div",{className:"wu-text-base",children:s}),t]})},In=e=>{const{children:t,Label:r,...s}=e;return a.jsxs(Pr,{...s,children:[a.jsx(gt,{children:r||e.label}),t]})},kn=e=>{const{options:t,value:r,onSelect:s}=e;return a.jsx(sn,{value:r,onValueChange:s,children:t.map(u=>a.jsx(Br,{value:u.value,disabled:u.disabled,children:u.Label||u.label},u.value))})},Dn=e=>{const{className:t,...r}=e,s=c("wu-w-11/12 wu-mx-auto wu-border-gray-40",t);return a.jsx(Ot,{...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(Ca,{thumbColor:r,railColor:s}),a.jsx(Ve.Corner,{})]}));tt.displayName=Ve.Root.displayName;const Ca=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}})}));Ca.displayName=Ve.ScrollAreaScrollbar.displayName;const Mn=e=>{const{children:t,label:r,Label:s,open:u,onOpenChange:o,height:n,dir:i,...l}=e;return a.jsxs(rn,{...l,open:u,onOpenChange:o,children:[a.jsx(Lr,{dir:i,children:s||r}),a.jsx(an,{children:a.jsx(Or,{onInteractOutside:w=>w.preventDefault(),children:a.jsx(tt,{className:"wu-h-fit",style:{height:n},dir:i,children:t})})})]})},_n="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",Yr=e=>{const{children:t,menuTitle:r,MenuTitle:s,variant:u="flat",name:o,open:n,onOpenChange:i,height:l,preventCloseOnClickOutside:w,dir:d,Trigger:p,align:b="start",sideOffset:x=0,side:h="bottom",alignOffset:m,className:N,disabled:E,...y}=e;return a.jsxs(Ar,{...y,open:n,onOpenChange:i,dir:d,children:[a.jsx(Wr,{asChild:!0,dir:d,disabled:E,className:c("disabled:wu-text-zinc-300 disabled:wu-bg-white disabled:wu-cursor-not-allowed disabled:hover:wu-bg-transparent"),children:p??An(u,o,E)}),a.jsx(va,{className:c("wu-w-56 wu-border wu-border-blue-p disabled:wu-border-gray-40",N,"wu-menu-content"),align:b,sideOffset:x,side:h,alignOffset:m,onInteractOutside:C=>w&&C.preventDefault(),children:a.jsxs(tt,{className:"h-fit",style:{height:l},dir:d,children:[(r||s)&&a.jsxs(a.Fragment,{children:[a.jsx(gt,{dir:d,className:"wu-menu-title",children:s||r}),a.jsx(Ot,{className:"wu-mt-0 wu-menu-separator",dir:d})]}),t??a.jsx("p",{children:"Menu Is Empty"})]})})]})},An=(e,t,r)=>{const s=c(_n,"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")})]})},Ea=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}})]})});Ea.displayName="WuMenuIcon";const Kr={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%]"},Jr=Y.Root,Xr=Y.Trigger,Wn=Y.Portal,Pn=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",Kr.overlay,e),...t}));Zr.displayName=Y.Overlay.displayName;const Ta=f.forwardRef(({className:e,children:t,hideCloseButton:r,isStackedCard:s,...u},o)=>a.jsxs(Wn,{children:[a.jsx(Zr,{className:s?"wu-bg-transparent":""}),a.jsxs(Y.Content,{ref:o,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",Kr.content,e),...u,children:[t,!r&&a.jsx(Y.Close,{"aria-label":"close",asChild:!0,children:a.jsxs(Qe,{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"})]})})]})]}));Ta.displayName=Y.Content.displayName;const Ia=({className:e,...t})=>a.jsx("div",{className:c("wu-text-center wu-bg-gray-20 wu-w-full",e),...t});Ia.displayName="DialogHeader";const Qr=({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});Qr.displayName="DialogFooter";const Rr=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}));Rr.displayName=Y.Title.displayName;const Ln=f.forwardRef(({className:e,...t},r)=>a.jsx(Y.Description,{ref:r,className:c("wu-text-sm wu-text-muted-foreground",e),...t}));Ln.displayName=Y.Description.displayName;const On={gradientBackground:"_gradientBackground_1bbet_1"},es=e=>{const{colors:t,size:r=.55,children:s,className:u,strokeWidth:o,centerOffset:n={x:0,y:0},...i}=e,l=f.useRef(null);return f.useEffect(()=>{const w=l.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=x=>{p&&cancelAnimationFrame(p),p=requestAnimationFrame(()=>{const h=w.getBoundingClientRect();let m=x.clientX-h.left,N=x.clientY-h.top;m=Math.max(0,Math.min(m+n.x,h.width)),N=Math.max(0,Math.min(N+n.y,h.height));const E=`radial-gradient(
2
- var(--width) var(--height) ellipse at ${m}px ${N}px,
1
+ (function(C,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"),require("react-transition-group")):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","react-transition-group"],a):(C=typeof globalThis<"u"?globalThis:C||self,a(C["wick-ui-lib"]={},C["react/jsx-runtime"],C.RadixUIAccordion,C.React,C.clsx,C.tailwindMerge,C.RadixUIAvatar,C.RadixUISlot,C.ClassVarianceAuthority,C.RadixUILabel,C.RadixUITooltip,C.dateFns,C.RadixUIPopover,C.ReactDayPicker,C.RadixUICheckbox,C.cmdk,C.ReactVirtuoso,C.RadixUIDropdownMenu,C.RadixUIDialog,C.RadixUIScrollArea,C.RadixUIRadioGroup,C.RadixUISeparator,C.ReactDOM,C.RadixUIToggleGroup,C.RadixUIToggle,C.RadixUITabs,C.TanstackReactTable,C.RadixUIToast,C.RadixUISwitch,C.ReactTransitionGroup))})(this,(function(C,a,Je,f,Xo,Zo,Qo,Xe,Ne,Ro,ta,H,lt,ar,eu,de,tu,au,rr,ru,su,ou,uu,nu,lu,iu,Ie,cu,wu,kt){"use strict";var vc=Object.defineProperty;var Nc=(C,a,Je)=>a in C?vc(C,a,{enumerable:!0,configurable:!0,writable:!0,value:Je}):C[a]=Je;var It=(C,a,Je)=>Nc(C,typeof a!="symbol"?a+"":a,Je);function ne(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 Be=ne(Je),g=ne(f),Ze=ne(Qo),sr=ne(Ro),it=ne(ta),ct=ne(lt),aa=ne(eu),Q=ne(au),G=ne(rr),qe=ne(ru),wt=ne(su),or=ne(ou),du=ne(uu),Dt=ne(nu),ur=ne(lu),Ve=ne(iu),pe=ne(cu),ra=ne(wu),fu={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"}},pu=Zo.extendTailwindMerge({prefix:"wu-"});function c(...e){return pu(Xo.clsx(e))}const sa=e=>{window.open(e,"_blank","toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=800,height=600")};function Mt(){return Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15)}function dt(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 bu=e=>e?/\S+@questionpro\.com/.test(e):!1,nr=Be.Root,oa=g.forwardRef(({className:e,...t},r)=>a.jsx(Be.Item,{ref:r,className:c("wu-border-b",e),...t}));oa.displayName="AccordionItem";const ua=g.forwardRef(({className:e,children:t,...r},s)=>a.jsx(Be.Header,{className:"wu-flex",children:a.jsxs(Be.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"})]})}));ua.displayName=Be.Trigger.displayName;const na=g.forwardRef(({className:e,children:t,...r},s)=>a.jsx(Be.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})}));na.displayName=Be.Content.displayName;const gu=e=>{const{items:t,className:r,dir:s="ltr"}=e;if(e.type==="multiple"){const{defaultValue:o=[],value:u,onValueChange:n}=e;return a.jsx(nr,{type:"multiple",className:"wu-w-full wu-accordion-container",defaultValue:o,value:u,onValueChange:n,dir:s,children:t.map(({value:i,Summary:l,Details:w,className:d})=>a.jsxs(oa,{value:i,dir:s,className:c(r,d),children:[a.jsx(ua,{dir:s,className:"wu-accordion-summary",children:l}),a.jsx(na,{dir:s,className:"wu-accordion-details",children:w})]},i))})}else{const{defaultValue:o,value:u,onValueChange:n}=e;return a.jsx(nr,{type:"single",className:"wu-w-full wu-accordion-container",defaultValue:o,value:u,onValueChange:n,dir:s,collapsible:!0,children:t.map(({value:i,Summary:l,Details:w,className:d})=>a.jsxs(oa,{value:i,dir:s,className:c(r,d),children:[a.jsx(ua,{dir:s,className:"wu-accordion-summary",children:l}),a.jsx(na,{dir:s,className:"wu-accordion-details",children:w})]},i))})}},lr=g.forwardRef(({className:e,...t},r)=>a.jsx(Ze.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}));lr.displayName=Ze.Root.displayName;const ir=g.forwardRef(({className:e,...t},r)=>a.jsx(Ze.Image,{ref:r,className:c("wu-aspect-square wu-h-full wu-w-full",e),...t}));ir.displayName=Ze.Image.displayName;const cr=g.forwardRef(({className:e,...t},r)=>a.jsx(Ze.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}));cr.displayName=Ze.Fallback.displayName;function la(e,t){f.useEffect(()=>{const r=s=>{Array.isArray(e)&&e.some(o=>!o.current||o.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 ia={dropdownContainer:"_dropdownContainer_vvlo9_1",open:"_open_vvlo9_1",dropdownMenu:"_dropdownMenu_vvlo9_1"},wr=({dir:e,Trigger:t,triggerClassName:r,DropdownContent:s})=>{const[o,u]=f.useState(!1),n=f.useRef(null),i=f.useRef(null);la([n,i],()=>u(!1));const l=()=>{u(!o)};return a.jsx(a.Fragment,{children:a.jsx("div",{className:ia.dropdownContainer,children:a.jsx("ul",{children:a.jsxs("li",{className:c("wu-flex wu-relative",o&&ia.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(),l()},ref:i,"aria-label":"dropdown-trigger",children:t}),a.jsx("div",{className:c(ia.dropdownMenu,{open:o},e==="rtl"?"wu-left-[-10px] wu-top-[38px]":"wu-right-[-7px] wu-top-[38px]"),dir:e,ref:n,"aria-label":"user-menu",children:s})]})})})})},ca=Ne.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:[]}),Qe=g.forwardRef(({className:e,variant:t,size:r,color:s,asChild:o=!1,...u},n)=>{const i=o?Xe.Slot:"button";return a.jsx(i,{className:c(ca({size:r,color:s,variant:t,className:e})),ref:n,...u})});Qe.displayName="Button";const Re=f.forwardRef((e,t)=>hu(e,t)),hu=(e,t)=>{const{size:r="md",color:s="#1B87E6",variant:o="dots",...u}=e,n=c("wu-w-[4em] wu-h-[1em] wu-inline-block wu-text-xs wu-relative wu-loader-dot-container");let i="7px";r==="sm"?i="7px":r==="md"?i="12px":r==="lg"?i="18px":typeof r=="string"&&(i=r);const l={backgroundColor:s,width:i,height:i},w=a.jsxs("div",{...u,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:i,height:i,borderTopColor:s}}),e.message&&a.jsx("p",{className:"wu-inline-block wu-loader-message",children:e.message})]}),d=a.jsxs("div",{...u,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:i},role:"loader",children:[a.jsx("li",{className:"wu-dot wu-loader-dot",style:l}),a.jsx("li",{className:"wu-dot wu-loader-dot",style:l}),a.jsx("li",{className:"wu-dot wu-loader-dot",style:l}),a.jsx("li",{className:"wu-dot wu-loader-dot",style:l})]}),e.message&&a.jsx("p",{className:"wu-inline-block wu-loader-message",children:e.message})]});return a.jsx(a.Fragment,{children:o==="spinner"?w:d})};Re.displayName="WuLoader";const me=f.forwardRef(({disabled:e,loading:t,variant:r="primary",size:s="md",Icon:o,iconPosition:u="left",children:n,floating:i,className:l,color:w="primary",selected:d,...p},b)=>{const x={primary:"#1986e688",upgrade:"#f5830088",error:"#ef444488"};return a.jsxs(Qe,{...p,disabled:e,variant:r,size:s,className:c(i&&"wu-shadow-qp","wu-flex wu-items-center wu-justify-center wu-gap-2",u==="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",l),color:w,style:{backgroundColor:t?x[w]:"",...p.style},ref:b,children:[!t&&o&&a.jsx(a.Fragment,{children:o}),t&&a.jsx(Re,{color:"#fff",size:"sm"}),!t&&n]})});me.displayName="WuButton";const mu=({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"})]}),xu=({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:o,icon:u,node:n},i)=>a.jsx("li",{className:i<r.length-1?"wu-border-b wu-border-gray-subtle":"",children:a.jsxs("a",{href:o,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(u,"wu-w-12 wu-text-center")}),a.jsx("span",{children:s})]}),n]})},i))}),a.jsx("hr",{className:"wu-border-gray-subtle"})]})},yu=({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"})]}),vu=({user:e,dir:t})=>{var r,s,o,u,n,i,l,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:(o=e==null?void 0:e.profile)==null?void 0:o.subtitle}),a.jsx("p",{className:"wu-font-light",children:(u=e==null?void 0:e.profile)==null?void 0:u.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:(i=e==null?void 0:e.license)==null?void 0:i.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:(l=e==null?void 0:e.license)==null?void 0:l.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})]})]})]})]})},dr=({user:e,onLogout:t,dir:r,DataCenter:s})=>{var o,u;return e?a.jsx(wr,{Trigger:a.jsxs(lr,{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(ir,{className:"hover:wu-opacity-80",src:(o=e==null?void 0:e.profile)==null?void 0:o.profilePicture,alt:"User"}),a.jsx(cr,{children:(u=e==null?void 0:e.profile)==null?void 0:u.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(vu,{user:e,dir:r}),(e==null?void 0:e.settings)&&e.settings.length>0&&a.jsx(yu,{settings:e.settings,dir:r}),a.jsx(xu,{user:e,dir:r}),a.jsx(mu,{onLogout:t,DataCenter:s})]})}):null},fr=({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(wr,{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,o)=>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:()=>sa(s.link),onKeyDown:u=>{u.key==="Enter"&&sa(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(pr,{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(pr,{item:s,dir:t})})},o))})})},pr=({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})]})]}),Nu=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 Su({productCategories:e,openCategory:t,setOpenCategory:r}){const s=(i,l)=>{const w=l[i];if(w){w.focus();const d=e[i]||null;r(d)}},o=(i,l,w,d)=>{i.preventDefault();const p=w==="down"?l+1:l-1;s(p,d)},u=(i,l,w,d)=>{t!=null&&t.products&&t.products[t.products.length-1].name===d&&(i.preventDefault(),s(l+1,w))},n=(i,l)=>{i.preventDefault();const w=e[l]===t?null:e[l];r(w)};return function(l,w,d){const p=document.querySelectorAll("[data-product-category]"),{key:b}=l;switch(b){case"ArrowDown":o(l,w,"down",p);break;case"ArrowUp":o(l,w,"up",p);break;case"Tab":u(l,w,p,d);break;case"Enter":case" ":n(l,w);break}}}const Cu=e=>{const{size:t="lg",className:r,children:s,...o}=e,u={sm:"wu-text-body-3",md:"wu-text-body-2",lg:"wu-text-body-1"},n=e.as||"div";return a.jsx(n,{...o,className:c(u[t],r),children:s})},Eu=e=>{const{size:t="xl",className:r,children:s,...o}=e,u={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"},i=u[t];return a.jsx(i,{...o,className:c(n[t],r),children:s})},Tu=e=>{const{size:t="lg",className:r,children:s,...o}=e,u={sm:"wu-text-sub-3",md:"wu-text-sub-2",lg:"wu-text-sub-1"},n=e.as||"div";return a.jsx(n,{...o,className:c(u[t],r),children:s})},Iu=e=>{const{size:t="lg",className:r,children:s,...o}=e,u={md:"wu-text-display-2",lg:"wu-text-display-1"},n=e.as||"h1";return a.jsx(n,{...o,className:c(u[t],r),children:s})},Pe=e=>{const{icon:t,className:r,...s}=e;return a.jsx("span",{...s,className:c(t,r),role:"presentation","aria-label":t})},ku=({buttonRef:e,handleDropdownToggle:t,handleKeyDown:r,isDropdownOpen:s,activeProductName:o,dir:u="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:i=>{s&&i.key==="ArrowDown"&&r(i,-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(Pe,{icon:"wc-logo",className:"wu-text-xl wu-leading-4 wu-relative wu-top-1"})}),o,a.jsx("span",{className:c("wm-arrow-drop-down wu-text-2xl wu-transition-transform wu-duration-300",s&&"wu-rotate-180",u==="rtl"?"wu-mr-auto":"wu-ml-auto")})]}),ee={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"},Du=({category:e,dir:t="ltr",openCategory:r})=>{const s=e.active?"#c5cce0":"#f0c36a",o=(r==null?void 0:r.name)===e.name,u=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",o&&"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",o&&"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:ee.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:u}):a.jsx("span",{className:n})]})},Mu={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"},_u=({product:e,currentProduct:t,activeProductName:r,dir:s,focusItem:o,setFocusItem:u})=>{const[n,i]=f.useState(e.name===t),l=e.name===r,w=e.name===t,d=!e.active,p="#1b3380",b="#c5cce0",x="#ffcf70",m=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"),h=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"),N=n||o===e.name||l?p:b;return a.jsxs("li",{className:c(ee.productListItem,"focus-visible:wu-outline-none focus:wu-outline-none wu-sub-product-list-item",(l||n)&&ee.activeProduct,e.name.length>15&&window.innerWidth>768&&"wu-w-[130px] wu-min-w-[130px]",o===e.name&&ee.activeProduct,"wu-product-item"),onMouseOver:()=>i(!0),onMouseOut:()=>i(!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:()=>{u(e.name)},onBlur:()=>u(""),children:[a.jsx("div",{className:c(ee.topBorder,s==="rtl"&&ee.topBorderRtl),style:{backgroundColor:d?x:N}}),a.jsxs("a",{className:c(ee.productLink,"focus:wu-outline-none focus-visible:wu-outline-none"),href:e.link||"#",tabIndex:0,children:[a.jsx("span",{className:c(h,Mu[e.icon||""]),"aria-hidden":!0}),a.jsx("span",{className:c(m),children:e.name})]})]},e.name)},Au=({category:e,currentProduct:t,activeProductName:r,dir:s="ltr",focusItem:o,setFocusItem:u,borderColorLocked:n="#f5a300"})=>{const{products:i=[],active:l}=e,w=f.useMemo(()=>i.filter(m=>m.active).sort((m,h)=>(m.order||100)-(h.order||100)),[i]),d=f.useMemo(()=>i.filter(m=>!m.active),[i]),[p,b]=f.useState(n),x=m=>m.map((h,N)=>a.jsx(_u,{product:h,currentProduct:t,activeProductName:r,dir:s,focusItem:o,setFocusItem:u},N));return l?a.jsxs(a.Fragment,{children:[x(w),d.length>0&&a.jsxs("li",{className:c(ee.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(ee.topBorder,s==="rtl"&&ee.topBorderRtl),style:{backgroundColor:p},"aria-label":"top-border"}),a.jsxs("a",{href:"https://www.questionpro.com/a/showUpgradeUser.do",className:c(ee.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"]})]})]}),x(d)]}):a.jsxs("li",{className:c(ee.productListItem,ee.learnMore,"focus:wu-outline-none focus-visible:wu-outline-none wu-product-item-inactive !wu-bg-[#f5f5f5] hover:!wu-bg-[#eeeeee]",o==="learn"&&"activeProduct"),tabIndex:0,onFocus:()=>u("learn"),onBlur:()=>u(""),"aria-label":"Learn More",children:[a.jsx("div",{className:c(ee.topBorder,s==="rtl"&&ee.topBorderRtl),style:{backgroundColor:n}}),a.jsx("a",{className:ee.productLink,href:"https://www.questionpro.com/a/showUpgradeUser.do",tabIndex:-1,children:a.jsx("span",{className:"wu-text-[#f99e03]",children:"Learn More"})})]})},br=({dropdownRef:e,dir:t,isDropdownOpen:r,productCategories:s,openCategory:o,setOpenCategory:u,handleKeyDown:n,expandAll:i,activeProductName:l,focusItem:w,setFocusItem:d})=>{const p="#ffcf70",[b,x]=f.useState(window.innerWidth>768);return f.useEffect(()=>{const m=()=>{x(window.innerWidth>375)};return window.addEventListener("resize",m),()=>window.removeEventListener("resize",m)},[]),a.jsx("ul",{className:c(ee.productDropdownMenu,r&&ee.productDropdownMenuOpen,t==="rtl"&&ee.rtlDropdownMenu,"wu-switcher-container"),ref:e,dir:t,"aria-label":"product-dropdown-menu","data-state":r?"open":"closed",children:s.map((m,h)=>a.jsxs("li",{className:c(ee.productCategory,"focus:wu-outline-none focus-visible:wu-outline-none wu-h-16 wu-category-item",o===m&&ee.open,i&&ee.open),onMouseEnter:()=>b&&u(m),onMouseLeave:()=>b&&u(null),"aria-label":m.name,dir:t,onKeyDown:N=>n(N,h),tabIndex:0,"data-product-category":!0,children:[a.jsx(Du,{category:m,dir:t,openCategory:o}),a.jsx("ul",{className:c(ee.productList,t==="rtl"&&ee.rtlProductList),dir:t,children:a.jsx(Au,{category:m,dir:t,activeProductName:l,currentProduct:m.name,focusItem:w,setFocusItem:d,borderColorLocked:p})})]},m.name))})},Wu=({isProductButtonShow:e,isDropdownOpen:t,activeProductColor:r,activeProductBgColor:s,activeProductName:o,dir:u,smallScreenButtonRef:n,handleDropdownToggle:i,handleKeyDown:l})=>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?u==="rtl"?"wu-right-0 wu-overflow-hidden":"wu-translate-x-0 wu-left-0":u==="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":u==="rtl"?"wu-hidden":"wu-flex"),onClick:i,onKeyDown:w=>{t&&w.key==="ArrowDown"&&l(w,-1)},"aria-label":"small-screen-product-btn",children:[o,a.jsx("span",{className:c("wm-arrow-drop-down wu-text-2xl wu-transition-transform wu-duration-300",t&&"wu-rotate-180")})]})}),Pu=({dir:e,isProductButtonShow:t,smallScreenToggleButtonRef:r,setIsProductButtonShow:s,setDropdownOpen:o})=>{const u=()=>{s(n=>!n),t&&o(!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:u,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"}`})]})},gr=({productCategories:e,activeProductName:t,activeProductColor:r={base:"#1b87e6",hover:"#54A5EC"},dir:s,homeLink:o,expandAll:u})=>{const n=f.useRef(null),i=f.useRef(null),l=f.useRef(null),w=f.useRef(null),[d,p]=f.useState(!1),[b,x]=f.useState(null),[m,h]=f.useState(r.base),[N,E]=f.useState(""),[y,S]=f.useState(!1),v=Nu(768);la([i,n],()=>{p(!1),x(null)}),la([l,w,i],()=>{S(!1),p(!1),x(null)}),f.useEffect(()=>{const T=M=>{M.key==="Escape"&&p(!1)};return document.addEventListener("keydown",T),()=>{document.removeEventListener("keydown",T)}},[d]),f.useEffect(()=>h(r.base),[r.base]);const I=T=>{T.preventDefault(),T.stopPropagation(),p(M=>{const A=!M;return A||x(null),A})},k=(T,M)=>{Su({productCategories:e,openCategory:b,setOpenCategory:x})(T,M,N)};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:v?a.jsxs("div",{className:"wu-relative wu-flex",children:[a.jsx(Pu,{dir:s,isProductButtonShow:y,smallScreenToggleButtonRef:w,setDropdownOpen:p,setIsProductButtonShow:S}),a.jsx(Wu,{isProductButtonShow:y,isDropdownOpen:d,activeProductColor:r,activeProductBgColor:m,activeProductName:t,handleDropdownToggle:I,smallScreenButtonRef:l,handleKeyDown:k,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(br,{activeProductName:t,focusItem:N,setFocusItem:E,handleKeyDown:k,isDropdownOpen:d,openCategory:b,productCategories:e,setOpenCategory:x,dropdownRef:i,expandAll:u,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:m},onMouseOver:()=>h(r.hover),onMouseOut:()=>h(r.base),children:[a.jsx(ku,{activeProductName:t,dir:s,homeLink:o,buttonRef:n,handleDropdownToggle:I,handleKeyDown:k,isDropdownOpen:d}),a.jsx(br,{activeProductName:t,focusItem:N,setFocusItem:E,handleKeyDown:k,isDropdownOpen:d,openCategory:b,productCategories:e,setOpenCategory:x,dropdownRef:i,expandAll:u,dir:s})]})})},hr=({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})}),wa=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}));wa.displayName="Input";const Lu=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})},Ou=e=>{var i,l;const{inputRef:t,maxLength:r=50,className:s,...o}=e,[u,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)},[(i=t==null?void 0:t.current)==null?void 0:i.value,r]),a.jsx("p",{...o,className:c("wu-text-sub-3 wu-font-light",s),style:{color:"rgb(var(--wu-gray-subtle))",...o.style},children:u&&`${(l=t==null?void 0:t.current)==null?void 0:l.value.length}/${r}`})},Fu=Ne.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"),_t=g.forwardRef(({className:e,...t},r)=>a.jsx(sr.Root,{ref:r,className:c(Fu(),e),...t}));_t.displayName=sr.Root.displayName;const be=e=>a.jsx(_t,{...e,className:c("wu-text-gray-lead wu-leading-6",e.className)}),Bu=({Label:e,Error:t,Hint:r,Input:s,labelPosition:o="top",dir:u="ltr",className:n,...i})=>{const w=c("wu-flex",o==="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",u==="ltr"?"wu-right-0":"wu-left-0","wu-form-group-hint"),b=c("wu-absolute -wu-bottom-5",u==="ltr"?"wu-left-0":"wu-right-0","wu-form-group-error");return a.jsxs("div",{className:w,dir:u,...i,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:o,iconPosition:u,type:n,value:i,variant:l="flat",readonly:w,id:d=Mt(),...p}=e,b=dt(s),x=o?u!=="right"?"wu-pl-8":"wu-pr-8":"",[m,h]=f.useState(!1),N=()=>{h(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:[o&&u!=="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:o}),a.jsx(wa,{...p,className:c("wu-peer wu-text-xs wu-rounded-t-sm",l==="outlined"?"wu-border wu-border-gray-subtle":"",x,p.className),type:m?"text":n,ref:t,readOnly:w,onChange:p.onChange&&E,value:i,id:d}),o&&u==="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:o}),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:N,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:m?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 qu=({className:e,placeholder:t="Search surveys, folders or tools",defaultCollapsed:r=!0,onSearch:s,...o})=>{const[u,n]=f.useState(r);return f.useEffect(()=>{n(r)},[r]),a.jsx(ze,{...o,placeholder:t,onChange:i=>s(i.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",u?"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(Pe,{"data-testid":"search-icon",icon:"wm-search",className:c("wu-text-gray-lead wu-cursor-pointer",u&&"wu-text-white"),onClick:()=>n(i=>!i)})})},mr=it.Provider,xr=it.Root,yr=it.Trigger,da=g.forwardRef(({className:e,sideOffset:t=4,...r},s)=>a.jsx(it.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}));da.displayName=it.Content.displayName;const At=f.forwardRef(({content:e,position:t,positionOffset:r,duration:s,children:o,className:u,showArrow:n=!1,open:i,onOpenChange:l,...w},d)=>a.jsx(mr,{delayDuration:s||200,children:a.jsxs(xr,{open:i,onOpenChange:l,children:[a.jsx(yr,{asChild:!0,children:a.jsx("span",{ref:d,children:o})}),a.jsx(ta.Portal,{children:e&&a.jsxs(da,{...w,side:t||"top",sideOffset:r||0,className:c("wu-max-w-sm wu-max-h-96 wu-overflow-y-auto",u),children:[e,n&&a.jsx(ta.Arrow,{className:"wu-fill-gray-notification wu-tooltip-arrow"})]})})]})}));At.displayName="WuTooltip";const Vu=({label:e,className:t})=>{const r=f.useRef(null),[s,o]=f.useState(!1);return f.useEffect(()=>{const u=r.current;if(u){const n=u.clientWidth,i=u.scrollWidth,l=i/e.length,w=e.length*l;o(w>n||i>n)}},[e]),a.jsx("p",{ref:r,className:c("wu-w-full wu-truncate",t),children:s?a.jsx(At,{content:e,positionOffset:8,children:e}):e})},zu=e=>{var p;const{productName:t,categories:r=[],user:s,children:o,onLogout:u,homeLink:n=window.location.origin,brandColor:i,dir:l="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",l==="rtl"&&"wu-flex-row-reverse",e.className),style:e.style,children:[bu((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(gr,{productCategories:r,activeProductName:t,activeProductColor:i,dir:l,homeLink:n,expandAll:w})}),a.jsx(hr,{dir:l,children:o}),a.jsxs("section",{className:c("wu-flex wu-items-center wu-justify-end wu-shrink-0 wu-gap-2",l==="rtl"?"wu-flex-row-reverse wu-pl-4":"wu-flex-row wu-pr-4"),children:[a.jsx(fr,{dir:l}),(s==null?void 0:s.profile)&&Object.keys(s.profile).length>0&&a.jsx(dr,{user:s,onLogout:u,dir:l,DataCenter:d})]})]})})},ke=ct.Root,He=ct.Trigger,Se=g.forwardRef(({className:e,align:t="center",sideOffset:r=4,...s},o)=>a.jsx(ct.Portal,{children:a.jsx(ct.Content,{ref:o,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=ct.Content.displayName;function vr({className:e,classNames:t,dir:r="ltr",...s}){const o=ar.getDefaultClassNames();return a.jsx(ar.DayPicker,{showOutsideDays:s.showOutsideDays||!1,className:c("wu-p-3",e),classNames:{root:c(o.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(o.month_caption,"wu-mb-5"),months:c(o.months,"wu-flex wu-flex-col sm:wu-flex-row wu-gap-4"),dropdowns:c(o.dropdowns,"wu-flex wu-items-center wu-justify-start wu-gap-2",(s.mode==="range","")),dropdown:c(o.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(o.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(o.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(o.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(o.selected,"wu-bg-blue-p [&:not(.rm)]:wu-text-white hover:wu-bg-blue-pHover"),range_middle:c("rm",o.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(o.range_end,"wu-rounded-none"),range_start:c(o.range_start,"wu-rounded-none wu-bg-blue-p hover:wu-bg-blue-pHover"),month_grid:c(o.month_grid,"[&>thead>tr>th]:wu-pb-2 wu-border-collapse wu-space-y-1"),button_next:c(o.button_next,ca({variant:"iconOnly"}),"wu-h-6 wu-w-6 wu-text-gray-lead"),button_previous:c(o.button_previous,ca({variant:"iconOnly"}),"wu-h-6 wu-w-6 wu-rotate-180 wu-text-gray-lead"),nav:c(o.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(o.chevron,"!wu-text-red-500"),outside:c(o.outside,"wu-invisible"),disabled:c(o.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})}vr.displayName="Calendar";const fa=e=>a.jsx(vr,{...e}),Nr=e=>{const{handleDateChange:t,disabled:r,onReset:s,showResetButton:o}=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:[o&&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(lt.PopoverClose,{asChild:!0,children:a.jsx(me,{onClick:t,disabled:r,className:"wu-date-picker-apply",children:"Apply"})})]})},pa=({formattedString:e,dir:t,placeholder:r="Select Date",className:s,variant:o="primary",color:u,CustomTrigger:n,...i})=>a.jsx(lt.PopoverTrigger,{asChild:!n,dir:t,children:n?a.jsx(a.Fragment,{children:n(e)}):a.jsx(me,{...i,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",o==="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})}),Sr=(e,t,r,s)=>{const o=H.startOfDay(e).getTime();return!!(t||r&&o<H.startOfDay(r).getTime()||s&&o>H.startOfDay(s).getTime())},Wt=e=>e?typeof e=="string"?new Date(e):e:new Date,ba="\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01])",Hu=[{label:"Last 7 days",value:7},{label:"Last 30 days",value:30},{label:"Last 90 days",value:90},{label:"Last 365 days",value:365}],$u=({formatString:e="yyyy-MM-dd",value:t,onChange:r,disabled:s,minDate:o=H.sub(new Date,{years:5}),maxDate:u=H.add(new Date,{years:1}),dir:n="ltr",Label:i,labelPosition:l="top",onReset:w,showResetButton:d=!1,placeholder:p="Select Date",CustomTrigger:b,...x})=>{const[m,h]=f.useState(),[N,E]=f.useState(""),y=f.useCallback(()=>{const v=Wt(m);E(H.format(v,e)),r&&r(m)},[m,e,r]),S=f.useCallback(()=>{w?w():(h(void 0),E(""),r&&r(void 0))},[r,w]);return f.useEffect(()=>{const v=Wt(t);h(v),E(H.format(v,e))},[t,e]),a.jsxs(be,{className:c("wu-flex wu-gap-1",l==="left"?"wu-items-center":"wu-flex-col wu-items-start","wu-date-picker-label"),dir:n,children:[i,a.jsxs(ke,{children:[a.jsx(pa,{formattedString:N,dir:n,placeholder:p,CustomTrigger:b,...x}),a.jsx(Se,{className:"wu-p-0 wu-w-fit wu-date-picker-content",align:"start",sideOffset:-.5,dir:n,children:a.jsx(fa,{dir:n,mode:"single",captionLayout:"dropdown",selected:m,onSelect:h,disabled:v=>Sr(v,s,o,u),startMonth:o,endMonth:u,required:!0,autoFocus:!0,defaultMonth:m,className:c("wu-border wu-border-blue-p wu-date-picker"),footer:a.jsx(Nr,{handleDateChange:y,disabled:s,onReset:S,showResetButton:d})})})]})]})},Cr="yyyy-MM-dd",Uu=[{label:"Day",value:1},{label:"Week",value:7},{label:"Month",value:30},{label:"Quarter",value:90},{label:"Year",value:365}],ju=({current:e,onSelect:t,presetRanges:r=Hu})=>{const[s,o]=f.useState(),[u,n]=f.useState(!1),[i,l]=f.useState(""),[w,d]=f.useState(""),[p,b]=f.useState(!1),x=f.useMemo(()=>r.map(y=>y.value),[r]),m=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"),h=f.useCallback(y=>{if(y===void 0){o(void 0),n(!0);return}const S=Number(y)-1;o(S),n(!1),t({from:H.sub(new Date,{days:S}),to:new Date})},[t]),N=f.useCallback((y,S)=>{if(!y||!(e!=null&&e.to)||!(e!=null&&e.from)||!new RegExp(ba).test(y))return!1;const I=new Date(S==="start"?y:e.from),k=new Date(S==="end"?y:e.to);return H.isBefore(k,I)?(b(!0),!1):(b(!1),!(H.isSameDay(I,e.from)&&H.isSameDay(k,e.to)))},[e]),E=f.useCallback((y,S)=>{if((S==="start"?l:d)(y),N(y,S)){const I={from:e==null?void 0:e.from,to:e==null?void 0:e.to};S==="start"&&(I.from=new Date(y)),S==="end"&&(I.to=new Date(y)),t(I)}},[e,t,N]);return f.useEffect(()=>{if(e!=null&&e.to&&(e!=null&&e.from)&&H.isValid(e.to)&&H.isValid(e.from)){l(H.format(e.from,Cr)),d(H.format(e.to,Cr));const y=H.differenceInCalendarDays(e.to,e.from);H.isToday(e.to)&&x.includes(y+1)?(o(y),n(!1)):(o(void 0),n(!0))}},[e,x]),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:Uu.map(({label:y,value:S})=>a.jsx(Qe,{variant:"secondary",className:"wu-px-1 wu-py-1 wu-text-xs wu-h-fit wu-min-w-fit disabled:wu-bg-white",disabled:S!==1,children:y},S))}),a.jsxs("ul",{className:"wu-flex wu-flex-col wu-gap-1 wu-date-picker-ranges",children:[r.map(({label:y,value:S})=>a.jsx("li",{children:a.jsx("button",{className:c(m,s===S-1&&"wu-bg-blue-p/10"),onClick:()=>h(S),children:y})},S)),a.jsx("li",{children:a.jsx("button",{className:c(m,u&&"wu-bg-blue-p/10"),onClick:()=>h(),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:ba,value:i,onChange:y=>E(y.target.value,"start"),"aria-label":"Start Date"}),a.jsx(ze,{placeholder:"End Date",pattern:ba,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"})]})]})},Gu=({formatString:e="yyyy/MM/dd",value:t,onChange:r,disabled:s,minDate:o=H.sub(new Date,{years:5}),maxDate:u=H.add(new Date,{years:1}),dir:n="ltr",minDateToSelect:i,maxDateToSelect:l,presetRanges:w,Label:d,labelPosition:p="top",onReset:b,showResetButton:x=!0,placeholder:m="Select Date Range",CustomTrigger:h,...N})=>{const[E,y]=f.useState(t),[S,v]=f.useState(t),[I,k]=f.useState(""),T=f.useCallback(()=>{if(S){const F=S.from,_=S.to;y({from:F,to:_}),k(`${H.format(F,e)} - ${H.format(_,e)}`),r&&r({from:F,to:_})}},[S,e,r]),M=f.useCallback(()=>{v(E)},[E]),A=f.useCallback(()=>{b?b():(y(void 0),v(void 0),k(""),r&&r(void 0))},[b,r]);return f.useEffect(()=>{if(t!=null&&t.from&&(t!=null&&t.to)){const F=Wt(t.from),_=Wt(t.to);y(t),v(t),k(`${H.format(F,e)} - ${H.format(_,e)}`)}else y(void 0),v({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(ke,{onOpenChange:F=>!F&&M(),children:[a.jsx(pa,{formattedString:I,dir:n,placeholder:m,CustomTrigger:h,...N}),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(ju,{current:S,onSelect:v,presetRanges:w}),a.jsx(fa,{dir:n,numberOfMonths:2,mode:"range",captionLayout:"dropdown",selected:S,onSelect:v,disabled:F=>Sr(F,s,o,u),startMonth:o,endMonth:u,required:!0,autoFocus:!0,defaultMonth:E==null?void 0:E.from,className:c("wu-shadow-none wu-date-range-picker"),min:i,max:l,footer:a.jsx(Nr,{handleDateChange:T,disabled:s,onReset:A,showResetButton:x})})]})]})]})},Er=f.forwardRef((e,t)=>{const{className:r,rounded:s,...o}=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,...o})});Er.displayName="WuCard";const Yu=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)})});Yu.displayName="WuCardHeader";const Ku=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)})});Ku.displayName="WuCardHeader";const Tr=g.forwardRef(({className:e,partial:t,...r},s)=>a.jsx(aa.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(aa.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"})]})}));Tr.displayName=aa.Root.displayName;const Ce=f.forwardRef((e,t)=>{const{disabled:r,checked:s,Label:o,labelPosition:u="right",className:n,id:i=Mt(),partial:l,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:Ju({labelPosition:u,className:"wu-checkbox-container"}),dir:b.dir,children:[a.jsx(Tr,{id:i,...b,partial:l,checked:s,disabled:r||p,onCheckedChange:w,className:c("wu-peer wu-checkbox",n),required:d,ref:t}),o&&a.jsx(be,{htmlFor:i,className:"wu-w-full wu-checkbox-label",children:o})]})}),Ju=Ne.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"}}});Ce.displayName="WuCheckbox";const Xu=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})},ga=g.forwardRef(({className:e,...t},r)=>a.jsx(de.Command,{ref:r,className:c("wu-flex wu-h-full wu-w-full wu-flex-col wu-overflow-hidden wu-rounded-md",e),...t}));ga.displayName=de.Command.displayName;const Ir=g.forwardRef(({className:e,...t},r)=>a.jsx("div",{className:"wu-flex wu-items-center wu-border-b wu-px-3",children:a.jsx(de.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})}));Ir.displayName=de.Command.Input.displayName;const ha=g.forwardRef(({className:e,...t},r)=>a.jsx(de.Command.List,{ref:r,className:c("",e),...t}));ha.displayName=de.Command.List.displayName;const ma=g.forwardRef((e,t)=>a.jsx(de.Command.Empty,{ref:t,className:"wu-text-center wu-p-2 wu-pb-2.5 wu-text-xs",...e}));ma.displayName=de.Command.Empty.displayName;const ft=g.forwardRef(({className:e,...t},r)=>a.jsx(de.Command.Group,{ref:r,className:c("",e),...t}));ft.displayName=de.Command.Group.displayName;const kr=g.forwardRef(({className:e,...t},r)=>a.jsx(de.Command.Separator,{ref:r,className:c("wu-mx-1 wu-my-1 wu-h-px wu-bg-gray-20",e),...t}));kr.displayName=de.Command.Separator.displayName;const pt=g.forwardRef(({className:e,...t},r)=>a.jsx(de.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}));pt.displayName=de.Command.Item.displayName;const et=f.forwardRef(({containerHeight:e=400,list:t,callback:r,dir:s,className:o,style:u},n)=>a.jsx(tu.Virtuoso,{ref:n,dir:s,className:o,style:{height:e,scrollbarWidth:"thin",scrollbarColor:"#d4d4d4 #f1f1f1",overflowX:"hidden",...u},data:t,itemContent:(i,l)=>r(i,l)}));et.displayName="WuVirtualScroll";const Zu=({tags:e,triggerRef:t})=>{const[r,s]=f.useState([]),[o,u]=f.useState([]),n=f.useMemo(()=>a.jsx("ul",{className:"wu-flex wu-flex-col wu-items-start wu-justify-center wu-list-none",children:o.map((l,w)=>a.jsx("li",{className:"wu-py-1 wu-text-xs wu-text-left",children:l},w))}),[o]),i=l=>{const w=document.createElement("div");Object.assign(w.style,{display:"inline-block",visibility:"hidden",position:"absolute",whiteSpace:"nowrap"}),w.textContent=l,document.body.appendChild(w);const d=w.offsetWidth;return document.body.removeChild(w),d+8};return f.useEffect(()=>{const l=()=>{if(t.current){const b=t.current.offsetWidth-20-36;let x=0;const m=[],h=[];e.forEach(N=>{const E=i(N);x+E+8<b?(m.push(N),x+=E+8):h.push(N)}),s(m),u(h)}};return l(),window.addEventListener("resize",l),()=>{window.removeEventListener("resize",l)}},[e,t]),a.jsxs("div",{className:"wu-flex wu-items-center wu-gap-2 wu-text-xs",children:[r.map((l,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:l},w)),o.length>0&&a.jsx(At,{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:["+",o.length]})})]})},Qu=({placeholder:e="Select...",isEllipse:t=!1,selectedOptions:r,variant:s="flat",dir:o="ltr",accessorKey:u,multiple:n,id:i,disabled:l,selectAll:w,isCheckedAll:d,className:p,...b})=>{const[x,m]=f.useState([]),h=f.useRef(null);f.useEffect(()=>{if(!r||Array.isArray(r)&&r.length===0){m([]);return}if(n){const E=r;m(E==null?void 0:E.map(y=>y[u.label]));return}else m([r[u.label]])},[r]);const N=()=>{var E;return x.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=h.current)==null?void 0:E.offsetWidth)||0)-32}px`},children:x.join(", ")}):a.jsx(Zu,{tags:x,triggerRef:h}):a.jsx("p",{className:"wu-text-xs wu-opacity-70",children:e})};return a.jsx(He,{dir:o,asChild:!0,id:i,disabled:l,children:a.jsxs("button",{...b,ref:h,disabled:l,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/wuCombobox wu-combobox-trigger",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:[N(),a.jsx("span",{className:"wm-arrow-drop-down group-data-[state=open]/wuCombobox:wu-rotate-180 wu-transition-transform wu-duration-300 wu-text-base"})]})})},Dr=Q.Root,Mr=Q.Trigger,_r=Q.Group,Ru=Q.Portal,en=Q.Sub,tn=Q.RadioGroup,Ar=g.forwardRef(({className:e,inset:t,children:r,position:s,...o},u)=>a.jsxs(Q.SubTrigger,{ref:u,className:c("wu-flex wu-cursor-default wu-select-none wu-text-xs wu-items-center wu-p-2 wu-outline-none focus:wu-bg-gray-20 data-[state=open]:wu-bg-gray-20",t&&"wu-pl-8",e),...o,children:[s==="left"&&a.jsx("span",{className:c("wm-chevron-right",o.dir==="rtl"&&"ml-2")}),r,s!=="left"&&a.jsx("span",{className:c("wu-text-base wu-leading-4",o.dir==="rtl"&&"wu-mr-auto wm-chevron-left",o.dir!=="rtl"&&"wu-ml-auto wm-chevron-right")})]}));Ar.displayName=Q.SubTrigger.displayName;const Wr=g.forwardRef(({className:e,...t},r)=>a.jsx(Q.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}));Wr.displayName=Q.SubContent.displayName;const xa=g.forwardRef(({className:e,sideOffset:t=4,...r},s)=>a.jsx(Q.Portal,{children:a.jsx(Q.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})}));xa.displayName=Q.Content.displayName;const Pt=g.forwardRef(({className:e,inset:t,...r},s)=>a.jsx(Q.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}));Pt.displayName=Q.Item.displayName;const Pr=g.forwardRef(({className:e,children:t,checked:r,dir:s,...o},u)=>a.jsxs(Q.CheckboxItem,{ref:u,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,...o,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(Q.ItemIndicator,{children:a.jsx("span",{className:"wm-check wu-text-base wu-text-white"})})}),t]}));Pr.displayName=Q.CheckboxItem.displayName;const Lr=g.forwardRef(({className:e,children:t,...r},s)=>a.jsxs(Q.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(Q.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]}));Lr.displayName=Q.RadioItem.displayName;const bt=g.forwardRef(({className:e,inset:t,...r},s)=>a.jsx(Q.Label,{ref:s,className:c("wu-p-2 wu-font-medium wu-text-xs",t&&"wu-pl-8",e),...r}));bt.displayName=Q.Label.displayName;const Lt=g.forwardRef(({className:e,...t},r)=>a.jsx(Q.Separator,{ref:r,className:c("-wu-mx-1 wu-my-1 wu-h-px wu-bg-gray-20",e),...t}));Lt.displayName=Q.Separator.displayName;const Or=({option:e,value:t,multiple:r=!1,onSelect:s,accessorKey:o,dir:u})=>{const[n,i]=f.useState(r?[]:"");f.useEffect(()=>{t&&i(r?t.map(p=>JSON.stringify(p[o.value])):JSON.stringify(t[o.value]))},[t,o.value,r]);const l=r?n.includes(JSON.stringify(e[o.value])):n===JSON.stringify(e[o.value]),w=()=>{e.disabled||s(e)};return a.jsxs(pt,{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",l&&"wu-bg-gray-10"),dir:u,children:[r&&a.jsx(Ce,{checked:l}),a.jsx(an,{option:e,accessorKey:o})]})},an=({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"})]})},Fr=e=>{const{option:t,selectAll:r,handleSelectAll:s,isCheckedAll:o,isPartialSelected:u,...n}=e;switch("type"in t?t.type:"option"){case"all":return a.jsxs(pt,{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(Ce,{checked:o||u,partial:u,"data-partial":u,"aria-label":(r==null?void 0:r.label)||"Select All"}),a.jsx("span",{"aria-hidden":!0,children:(r==null?void 0:r.label)||"Select All"})]});case"group":return a.jsxs(ft,{children:[a.jsx(bt,{children:t.label}),t.options.map((l,w)=>f.createElement(Or,{...n,option:l,key:w}))]});case"divider":return a.jsx(kr,{className:"wu-mx-4"});default:return a.jsx(Or,{...n,option:t})}},rn=e=>{const t=[],r=[],s=[],o=[];return e.forEach(u=>{u.type==="group"?(t.push(u),s.push(...u.options),o.push(...u.options.filter(n=>!n.disabled))):u.type==="divider"?r.push(u):s.push(u),u!=null&&u.disabled||o.push(u)}),{groups:t,dividers:r,allOptions:s,enabledOptions:o}},sn=f.memo(ze),on=({data:e,accessorKey:t,value:r,defaultValue:s,Header:o,virtualizedThreshold:u=100,isEllipse:n,placeholder:i,variant:l,dir:w,onSelect:d,Label:p,maxHeight:b=420,multiple:x=!1,hasGroup:m=!1,selectAll:h,id:N,disabled:E,labelPosition:y="top",className:S,onScroll:v,maxContentWidth:I,enableSearch:k=!0,noDataContent:T,...M})=>{const[A,F]=f.useState(""),[_,L]=f.useState(),[W,O]=f.useState(!1),[B,P]=f.useState(!1),[U,Y]=f.useState(!1),q=f.useRef(null),{allOptions:V,enabledOptions:ie}=f.useMemo(()=>m||h&&!h.includeDisabled?rn(e):{allOptions:e,groups:[],dividers:[],enabledOptions:[]},[e,m]),K=f.useMemo(()=>{if(!A)return e;const $=A.toLowerCase();return V.filter(D=>D[t.label].toLowerCase().includes($))},[A,V,e,t.label]),z=f.useMemo(()=>x&&h!=null&&h.enable&&!A&&K.length>0?[{type:"all"},...K]:K,[K,A,x]),se=f.useCallback($=>{const D=$[t.value];x?L(J=>{const ue=J||[],ce=ue.some(R=>R[t.value]===D)?ue.filter(R=>R[t.value]!==D):[...ue,$];return d==null||d(ce),ce}):(O(!1),L($),d==null||d($))},[x,t.value,d]),te=f.useCallback($=>F($.target.value),[]),ae=f.useCallback(()=>F(""),[]);f.useEffect(()=>{if(r!==void 0&&s!==void 0){console.error("defaultValue and value cannot be used simultaneously");return}else r!==void 0?L(r):s!==void 0&&L(s)},[r,s]),f.useEffect(()=>{if(!x)return;const $=h!=null&&h.includeDisabled?(_==null?void 0:_.length)===V.length:(_==null?void 0:_.length)===ie.length;P($);const D=(_==null?void 0:_.length)>0&&!$;Y(D)},[_,h]);const Ee=f.useCallback(()=>{const $=B?[]:h!=null&&h.includeDisabled?V:ie;L($),d==null||d($)},[B,x,V,ie,d,h]),je=dt(y);return a.jsxs("div",{className:c(je,"wu-flex wu-combobox-container"),ref:q,children:[a.jsxs(ke,{onOpenChange:$=>{$&&ae(),O($)},open:W,modal:!0,children:[a.jsx(Qu,{selectedOptions:_,accessorKey:t,isEllipse:n,placeholder:i,variant:l,dir:w,multiple:x,disabled:E,selectAll:h,isCheckedAll:B,className:S,id:N,...M}),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(ga,{id:N,children:[k&&a.jsx("div",{className:"wu-m-2",children:a.jsx(sn,{placeholder:"Search...",Icon:a.jsx("span",{className:"wm-search"}),className:"wu-text-xs wu-combobox-search",onChange:te,name:"Search","aria-label":"Search",dir:w,iconPosition:w==="rtl"?"right":"left"})}),o,a.jsxs(ha,{children:[a.jsx(ma,{children:T||"No results found."}),z.length>=u?a.jsx(et,{className:"wu-combobox-list",containerHeight:b,list:z,callback:($,D)=>a.jsx(Fr,{option:D,value:_,onSelect:se,multiple:x,accessorKey:t,dir:w,selectAll:h,handleSelectAll:Ee,isCheckedAll:B,isPartialSelected:U},$),dir:w}):a.jsx("div",{style:{height:"fit-content",maxHeight:b,overflow:"auto"},className:"wu-combobox-list",onScroll:v,children:z.map(($,D)=>a.jsx(Fr,{option:$,value:_,onSelect:se,multiple:x,accessorKey:t,dir:w,selectAll:h,handleSelectAll:Ee,isCheckedAll:B,isPartialSelected:U},D))})]})]})})]}),p&&a.jsx(be,{htmlFor:N,className:"wu-combobox-label",children:p})]})},un=e=>{const{textToCopy:t,notificationText:r,...s}=e,[o,u]=f.useState(!1),n=async()=>{if(t)try{await navigator.clipboard.writeText(t),u(!0),setTimeout(()=>u(!1),2e3)}catch(i){console.error("Failed to copy:",i)}};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",o?"wu-block":"wu-hidden"),children:r}),a.jsx(Pe,{icon:"wm-content-copy",className:"wu-text-lg"})]})},Br=G.Root,nn=G.Trigger,ln=G.Close,cn=G.Portal,qr=g.forwardRef(({className:e,...t},r)=>a.jsx(G.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","wu-drawer-overlay",e),...t,ref:r}));qr.displayName=G.Overlay.displayName;const wn=Ne.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"}}),ya=g.forwardRef(({side:e="right",className:t,children:r,hideCloseButton:s,overlayClassName:o,closeButtonClassName:u,...n},i)=>a.jsxs(cn,{children:[a.jsx(qr,{className:o}),a.jsxs(G.Content,{ref:i,className:c(wn({side:e}),t),...n,children:[r,!s&&a.jsx(G.Close,{"aria-label":"close",asChild:!0,children:a.jsxs(Qe,{variant:"iconOnly",className:c("wu-absolute wu-right-4 wu-top-4",u),children:[a.jsx("span",{className:"wm-close"}),a.jsx("span",{className:"wu-sr-only",children:"Close"})]})})]})]}));ya.displayName=G.Content.displayName;const Vr=g.forwardRef(({className:e,...t},r)=>a.jsx(G.Title,{ref:r,className:c("wu-text-lg wu-font-semibold",e),...t}));Vr.displayName=G.Title.displayName;const dn=g.forwardRef(({className:e,...t},r)=>a.jsx(G.Description,{ref:r,className:c("wu-text-sm",e),...t}));dn.displayName=G.Description.displayName;const fn=e=>t=>{e&&t.preventDefault()},pn=e=>{const{Trigger:t,children:r,hideCloseButton:s,className:o,side:u="left",open:n,onOpenChange:i,preventClickOutside:l,overlayClassName:w,closeButtonClassName:d,...p}=e;return a.jsxs(Br,{open:n,onOpenChange:i,children:[a.jsx(nn,{asChild:!0,children:t}),a.jsxs(ya,{onInteractOutside:fn(l),side:u,className:c("wu-bg-white wu-text-gray-lead wu-px-0",o),hideCloseButton:s,overlayClassName:w,closeButtonClassName:d,...p,children:[a.jsx("div",{className:"wu-hidden",children:a.jsx(Vr,{})}),r]})]})},bn=({children:e,...t})=>a.jsx(ln,{...t,children:e}),zr=({className:e,isLoading:t,loadingText:r,children:s,...o})=>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),...o,children:[a.jsx("div",{className:"wu-flex-1",children:s}),t&&a.jsx(Re,{size:"16px",variant:"spinner",color:"#a3a3a3",message:r})]});zr.displayName="WuFooter";const Hr=f.forwardRef((e,t)=>{const{size:r="sm",idOrSlugOrUrl:s,variant:o="primary",...u}=e,n=r==="sm"?16:18,i=s.includes("http")?s:`/help/${s}.html`,l=o==="primary"?"wu-text-blue-p":"wu-text-gray-lead";return a.jsx("button",{...u,ref:t,onClick:()=>sa(i),children:a.jsx("span",{className:c("wm-help wu-text-gray-subtle",`wu-text-[${n}px]`,l,u.disabled&&"wu-text-neutral-300","wu-help-button-icon")})})});Hr.displayName="WuHelpButton";const Oe=(e,t)=>`wu-listbox-${e}`;function gn(e){const{option:t,accessorKey:r,onSelect:s,multiple:o,dir:u,GroupLabel:n,Item:i,isSelected:l,...w}=e,d=r.group&&Array.isArray(t[r.group]),p=({item:b,className:x})=>f.createElement(pt,{...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",!!(l!=null&&l(b))&&!o&&"wu-bg-blue-p/10",u==="rtl"&&"wu-justify-end",x,Oe("item")),disabled:b.disabled},o&&a.jsx(Ce,{checked:l==null?void 0:l(b)}),i?i({value:b,isSelected:l==null?void 0:l(b)}):a.jsx(a.Fragment,{children:b[r.label]}));if(d){const b=t[r.group],x=typeof n=="string"?t[n]:n==null?void 0:n(t);return a.jsx(ft,{heading:x,children:b==null?void 0:b.map(m=>a.jsx(p,{item:m,className:"wu-pl-6"},JSON.stringify(m)))})}return a.jsx(p,{item:t})}const hn=f.memo(gn),mn=e=>{const{className:t,...r}=e;return a.jsxs("div",{className:"wu-relative",children:[a.jsx(Pe,{icon:"wm-search",className:"wu-absolute wu-top-[14px] wu-left-5"}),a.jsx(Ir,{...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;",Oe("input"),t)})]})},xn=e=>{const{label:t,onSelectAll:r,data:s,value:o}=e,[u,n]=f.useState(!1),[i,l]=f.useState(!1);return f.useEffect(()=>{!o||!s||(n(o.length>0),l(o.length>0&&o.length<s.length))},[s,o]),a.jsxs(pt,{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(!u),children:[a.jsx(Ce,{checked:u,partial:i}),t||"Select All"]})},yn=e=>{const{CustomTrigger:t,disabled:r,value:s,placeholder:o,accessorKey:u,Chip:n,handleUnselect:i,variant:l,dir:w,className:d,...p}=e,[b,x]=f.useState(),m=f.useRef(null);return f.useEffect(()=>{if(!s){x(null);return}x(Array.isArray(s)?n?s.map((N,E)=>n({value:N,unselect:i,key:E})):s.map(N=>N[u.label]).join(", "):n?n({value:s,unselect:i}):s[u.label])},[s,n,u.label,x]),a.jsx(He,{asChild:!0,id:e.id,disabled:r,ref:m,children:(t==null?void 0:t(s))||a.jsxs("button",{...p,className:c("wu-group/wuListbox wu-relative wu-min-h-8 wu-text-xs wu-border-gray-subtle wu-bg-gray-10 wu-p-1 wu-pl-2 rtl:wu-pr-2 wu-border-b wu-w-full wu-text-left wu-pr-5 rtl:wu-pl-5","hover:wu-border-blue-p","disabled:wu-cursor-not-allowed disabled:wu-bg-gray-20 disabled:wu-border-gray-40 disabled:wu-text-gray-subtle","rtl:wu-text-right",l==="outlined"&&"wu-border wu-border-gray-subtle wu-bg-white",d,Oe("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||o}),a.jsx(Pe,{icon:"wm-arrow-drop-down",className:c("wu-absolute wu-top-1 wm-arrow-drop-down group-data-[state=open]/wuListbox:wu-rotate-180 wu-transition-transform wu-duration-300 wu-text-base",w==="rtl"?"wu-left-1":"wu-right-1",Oe("drop-icon"))})]})})},$r=(e,t,r)=>{const s=String(e[r.label]??"").toLowerCase(),o=String(e[r.value]??"").toLowerCase();return s.includes(t)||o.includes(t)},vn=(e,t,r)=>{const s=t.trim();if(s==="")return e;const o=s.toLowerCase(),u=[];for(const n of e){const i=r.group,l=i?n[i]:void 0;if(Array.isArray(l)){const w=l.filter(d=>$r(d,o,r));w.length>0&&u.push({...n,[i]:w})}else $r(n,o,r)&&u.push(n)}return u},Nn=e=>{const{data:t,accessorKey:r,value:s,Item:o,Label:u,GroupLabel:n,CustomHeader:i,CustomTrigger:l,NoDataContent:w,Chip:d,onSelect:p,onScroll:b,disabled:x,multiple:m,searchable:h,selectAll:N,virtualizedThreshold:E=100,id:y,dir:S,className:v,listClass:I,placeholder:k="Select items...",variant:T,labelPosition:M="top",maxContentWidth:A,maxContentHeight:F}=e,[_,L]=f.useState(!1),[W,O]=f.useState(""),[B,P]=f.useState(s),U=f.useMemo(()=>r,[r]),Y=f.useMemo(()=>{if(!h||!W)return t;const z=W.toLowerCase().trim();return vn(t,z,r)},[t,W,r.label,h]),q=z=>{m?P(se=>{const te=z[r.value],ae=Array.isArray(se)?se:[],je=ae.some($=>$[r.value]===te)?ae.filter($=>$[r.value]!==te):[...ae,z];return p&&p(je),je}):(P(z),p&&p(z),L(!1))},V=f.useCallback(z=>{const se=z?t:[];P(se),N!=null&&N.onSelectAll&&N.onSelectAll(z),p&&p(se)},[t,N,p]),ie=z=>Array.isArray(B)?B.some(se=>se[r.value]===z[r.value]):(B==null?void 0:B[r.value])===z[r.value];f.useEffect(()=>{P(s)},[s]);const K=z=>{const se=te=>a.jsx(hn,{option:te,accessorKey:U,multiple:m,onSelect:ae=>q(ae),dir:S,GroupLabel:n,Item:o,isSelected:ae=>ie(ae)},JSON.stringify(te));return z.length>E?a.jsx(et,{list:z,callback:(te,ae)=>se(ae),dir:S}):z.map(se)};return a.jsxs("div",{className:c("wu-flex wu-text-sm wu-gap-2",M==="top"&&"wu-flex-col wu-gap-1",M==="left"&&"wu-flex-row",M==="right"&&"wu-flex-row-reverse",Oe("container")),dir:S,children:[u&&a.jsx(be,{htmlFor:y,className:Oe("label"),children:u}),a.jsxs(ke,{open:_,onOpenChange:z=>{L(z),z||setTimeout(()=>{O("")},100)},children:[a.jsx(yn,{CustomTrigger:l,disabled:x,value:B,accessorKey:r,placeholder:k,Chip:d,className:v,handleUnselect:q,variant:T,id:y,dir:S}),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",Oe("content")),align:"start",sideOffset:-1,style:{maxWidth:A},children:a.jsxs(ga,{id:e.id,shouldFilter:!1,children:[h&&a.jsx(mn,{value:W,onValueChange:O}),i,a.jsxs(ha,{className:c("wu-overflow-y-auto",Oe("list"),I),onScroll:b,style:{maxHeight:F||"420px"},children:[a.jsx(ma,{children:w||"No results found."}),a.jsx(ft,{children:m&&(N==null?void 0:N.enabled)&&!W&&a.jsx(xn,{data:t,value:B,onSelectAll:V,label:N.label})}),a.jsx(ft,{children:K(Y)})]})]})})]})]})},Sn=e=>{const{checked:t,onSelect:r,children:s,disabled:o,preventCloseOnSelect:u}=e;return a.jsx(Pr,{disabled:o,checked:t,onCheckedChange:r,onSelect:n=>u&&n.preventDefault(),children:s})},va=e=>{const{children:t,className:r,Icon:s,iconPosition:o="left",disabled:u,onSelect:n,preventCloseOnSelect:i}=e,l=c("wu-flex wu-items-center wu-gap-2",s&&(o==="left"?"":"wu-justify-between wu-flex-row-reverse"),r),w=d=>{n&&n(d),i&&d.preventDefault()};return a.jsxs(Pt,{onSelect:w,disabled:u,className:l,children:[s&&a.jsx("div",{className:"wu-text-base",children:s}),t]})},Cn=e=>{const{children:t,Label:r,...s}=e;return a.jsxs(_r,{...s,children:[a.jsx(bt,{children:r||e.label}),t]})},En=e=>{const{options:t,value:r,onSelect:s}=e;return a.jsx(tn,{value:r,onValueChange:s,children:t.map(o=>a.jsx(Lr,{value:o.value,disabled:o.disabled,children:o.Label||o.label},o.value))})},Tn=e=>{const{className:t,...r}=e,s=c("wu-w-11/12 wu-mx-auto wu-border-gray-40",t);return a.jsx(Lt,{...r,className:s})},tt=g.forwardRef(({className:e,children:t,thumbColor:r,railColor:s,...o},u)=>a.jsxs(qe.Root,{ref:u,className:c("wu-relative wu-overflow-hidden",e),children:[a.jsx(qe.Viewport,{className:"wu-h-full wu-w-full wu-rounded-[inherit]",...o,children:t}),a.jsx(Na,{thumbColor:r,railColor:s}),a.jsx(qe.Corner,{})]}));tt.displayName=qe.Root.displayName;const Na=g.forwardRef(({className:e,orientation:t="vertical",thumbColor:r="#d4d4d4",railColor:s="#eeeeee",...o},u)=>a.jsx(qe.ScrollAreaScrollbar,{ref:u,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},...o,children:a.jsx(qe.ScrollAreaThumb,{className:"wu-relative wu-flex-1 wu-rounded-full",style:{background:r}})}));Na.displayName=qe.ScrollAreaScrollbar.displayName;const In=e=>{const{children:t,label:r,Label:s,open:o,onOpenChange:u,height:n,dir:i,...l}=e;return a.jsxs(en,{...l,open:o,onOpenChange:u,children:[a.jsx(Ar,{dir:i,children:s||r}),a.jsx(Ru,{children:a.jsx(Wr,{onInteractOutside:w=>w.preventDefault(),children:a.jsx(tt,{className:"wu-h-fit",style:{height:n},dir:i,children:t})})})]})},kn="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",Ur=e=>{const{children:t,menuTitle:r,MenuTitle:s,variant:o="flat",name:u,open:n,onOpenChange:i,height:l,preventCloseOnClickOutside:w,dir:d,Trigger:p,align:b="start",sideOffset:x=0,side:m="bottom",alignOffset:h,className:N,disabled:E,...y}=e;return a.jsxs(Dr,{...y,open:n,onOpenChange:i,dir:d,children:[a.jsx(Mr,{asChild:!0,dir:d,disabled:E,className:c("disabled:wu-text-zinc-300 disabled:wu-bg-white disabled:wu-cursor-not-allowed disabled:hover:wu-bg-transparent"),children:p??Dn(o,u,E)}),a.jsx(xa,{className:c("wu-w-56 wu-border wu-border-blue-p disabled:wu-border-gray-40",N,"wu-menu-content"),align:b,sideOffset:x,side:m,alignOffset:h,onInteractOutside:S=>w&&S.preventDefault(),children:a.jsxs(tt,{className:"h-fit",style:{height:l},dir:d,children:[(r||s)&&a.jsxs(a.Fragment,{children:[a.jsx(bt,{dir:d,className:"wu-menu-title",children:s||r}),a.jsx(Lt,{className:"wu-mt-0 wu-menu-separator",dir:d})]}),t??a.jsx("p",{children:"Menu Is Empty"})]})})]})},Dn=(e,t,r)=>{const s=c(kn,"wu-flex wu-items-center wu-justify-between wu-gap-2 wu-h-8 wu-text-xs wu-group/wuMenu",e==="outlined"?"wu-border":"wu-border-b","wu-trigger-btn");return a.jsxs("button",{className: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]/wuMenu: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")})]})},Sa=f.forwardRef(({showMenu:e=!1,className:t,color:r="#1B3380",...s},o)=>{const u=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:o,"aria-label":"menu-icon",children:[a.jsx("div",{className:`${u} wu-origin-center ${e?"wu-rotate-45 wu-translate-y-[5px]":""}`,style:{borderColor:r}}),a.jsx("div",{className:`${u} ${e?"wu-opacity-0":""}`,style:{borderColor:r}}),a.jsx("div",{className:`${u} wu-origin-center ${e?"-wu-rotate-45 -wu-translate-y-[5px]":""}`,style:{borderColor:r}})]})});Sa.displayName="WuMenuIcon";const jr={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%]"},Gr=G.Root,Yr=G.Trigger,Mn=G.Portal,_n=G.Close,Kr=f.forwardRef(({className:e,...t},r)=>a.jsx(G.Overlay,{ref:r,className:c("wu-fixed wu-inset-0 wu-z-50 wu-bg-black/30",jr.overlay,e),...t}));Kr.displayName=G.Overlay.displayName;const Ca=f.forwardRef(({className:e,children:t,hideCloseButton:r,isStackedCard:s,...o},u)=>a.jsxs(Mn,{children:[a.jsx(Kr,{className:s?"wu-bg-transparent":""}),a.jsxs(G.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",jr.content,e),...o,children:[t,!r&&a.jsx(G.Close,{"aria-label":"close",asChild:!0,children:a.jsxs(Qe,{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"})]})})]})]}));Ca.displayName=G.Content.displayName;const Ea=({className:e,...t})=>a.jsx("div",{className:c("wu-text-center wu-bg-gray-20 wu-w-full",e),...t});Ea.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 Xr=f.forwardRef(({className:e,...t},r)=>a.jsx(G.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}));Xr.displayName=G.Title.displayName;const An=f.forwardRef(({className:e,...t},r)=>a.jsx(G.Description,{ref:r,className:c("wu-text-sm wu-text-muted-foreground",e),...t}));An.displayName=G.Description.displayName;const Wn={gradientBackground:"_gradientBackground_1bbet_1"},Zr=e=>{const{colors:t,size:r=.55,children:s,className:o,strokeWidth:u,centerOffset:n={x:0,y:0},...i}=e,l=f.useRef(null);return f.useEffect(()=>{const w=l.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",`-${u||2}px`),w.style.setProperty("--spotlight-background","radial-gradient(100% var(--height) ellipse at 25% 70%, var(--colors))");let p;const b=x=>{p&&cancelAnimationFrame(p),p=requestAnimationFrame(()=>{const m=w.getBoundingClientRect();let h=x.clientX-m.left,N=x.clientY-m.top;h=Math.max(0,Math.min(h+n.x,m.width)),N=Math.max(0,Math.min(N+n.y,m.height));const E=`radial-gradient(
2
+ var(--width) var(--height) ellipse at ${h}px ${N}px,
3
3
  var(--colors)
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:l,className:c(On.gradientBackground,"wu-transform-gpu",u),...i,children:s})},ts="calc(100vh - 64px)",Fn={sm:"400px",md:"600px",lg:"1200px"},Bn=({Trigger:e,children:t,size:r="md",hideCloseButton:s,preventClickOutside:u,onOpenChange:o,open:n,dir:i,maxWidth:l,maxHeight:w,className:d,style:p,variant:b="action",...x})=>{const h={action:["#EEF3FBcc 32%","#1D50F4cc"],upgrade:["#FDEDCCcc 32%","#FF9F00cc"],critical:["#FFB6B6cc 32%","#CC0000cc"]};return a.jsxs(Jr,{modal:!0,onOpenChange:o,open:n,children:[e&&a.jsx(Xr,{asChild:!0,children:e}),a.jsxs(Ta,{style:{width:"calc(100% - 64px)",maxWidth:l||Fn[r],maxHeight:w||ts,...p},hideCloseButton:s,onInteractOutside:m=>u&&m.preventDefault(),dir:i,"aria-describedby":void 0,"data-variant":b,className:c("wu-group wuexp:wu-rounded-[1.1rem]",d),...x,children:["data-theme"in x&&a.jsx(es,{colors:h[b],strokeWidth:4,className:c("wuexp:wu-rounded-[1.1rem] wu-transform-gpu wu-flex wu-flex-col",d),style:{maxHeight:w||ts},children:t}),!("data-theme"in x)&&t]})]})},qn=({children:e,className:t,...r})=>a.jsx("div",{className:c("wu-flex wu-flex-col wu-gap-4 wu-p-4 rtl:wu-text-right wu-overflow-auto wu-bg-white","wuexp:wu-p-8 wuexp:wu-text-gray-lead",t),...r,children:e}),Vn=({children:e,className:t,...r})=>a.jsx(Ia,{...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(Rr,{className:"wuexp:wu-font-normal wuexp:wu-justify-start wuexp:wu-text-2xl wuexp:wu-h-14",children:e})}),zn=({children:e,className:t,...r})=>a.jsx(Qr,{...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}),Hn=({children:e,className:t,...r})=>{const s=f.useRef(null);return a.jsx(Pn,{asChild:!0,children:a.jsx(me,{className:t,ref:s,...r,children:e})})},$n=({placeholder:e="Select...",value:t,multiple:r=!1,accessorKey:s,variant:u="flat",dir:o="ltr",customTriggerChildren:n,id:i,disabled:l,selectAll:w,isCheckedAll:d,width:p,...b})=>{const[x,h]=f.useState(""),[m,N]=f.useState(e);f.useEffect(()=>{if(!t||Array.isArray(t)&&t.length===0){N(e),h("");return}const y=s.label;if(r&&Array.isArray(t)){const C=t.map(v=>v[y]).join(", ");h(C)}else!r&&!Array.isArray(t)&&h(t[y])},[t,s.label,r,e]);const E=()=>e&&!x?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)??x:x});return a.jsx(Wr,{asChild:!0,dir:o,id:i,disabled:l,children:a.jsxs("button",{...b,disabled:l,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"})]})})},as=({option:e,value:t,multiple:r=!1,onSelect:s,accessorKey:u,dir:o="ltr"})=>{const[n,i]=f.useState(r?[]:"");f.useEffect(()=>{t&&i(r?t.map(p=>JSON.stringify(p[u.value])):JSON.stringify(t[u.value]))},[t,u.value,r]);const l=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(Lt,{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",l&&"wu-bg-gray-10"),dir:o,children:[r&&a.jsx(Ee,{checked:l}),a.jsx(rs,{option:e,accessorKey:u})]})},rs=({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"})]})},ss=e=>{const{option:t,handleSelectAll:r,isCheckedAll:s,isPartialSelected:u,...o}=e;switch("type"in t?t.type:"option"){case"all":return a.jsxs(Lt,{onSelect:i=>{i.stopPropagation(),i.preventDefault(),r==null||r()},className:c("wu-cursor-pointer wu-text-xs wu-py-2 wu-leading-4 wu-select-item"),dir:o.dir,children:[a.jsx(Ee,{"data-partial":u,checked:s||u,partial:u}),a.jsx(rs,{option:t,accessorKey:o.accessorKey})]});case"group":return a.jsxs(Pr,{dir:o.dir,children:[a.jsx(gt,{className:"wu-text-xs",children:t.label}),t.options.map((i,l)=>f.createElement(as,{...o,option:i,key:l}))]});case"divider":return a.jsx(Ot,{className:"wu-mx-4"});default:return a.jsx(as,{...o,option:t})}},Un=e=>{let t=0,r=0;const s=[],u=[],o=n=>{n.type==="divider"?t++:n.type==="group"?(r++,n.options.forEach(i=>{o(i)})):(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}},jn=100,Gn=400,Yn=32,Kn=9,Jn=32,us=({data:e,onSelect:t,multiple:r=!1,defaultValue:s,value:u,accessorKey:o,variant:n="flat",dir:i="ltr",placeholder:l,Label:w,virtualizedThreshold:d=jn,maxHeight:p=Gn,hasGroup:b=!1,Header:x,CustomTrigger:h,selectAll:m,disabled:N,labelPosition:E="top",onScroll:y,maxContentWidth:C,...v})=>{const[k,D]=f.useState(),T=f.useRef(null),[_,M]=f.useState(!1),[L,P]=f.useState(!1),{cleanData:O,totalData:A,separators:F,groups:q,enabledOptions:W}=b||m!=null&&m.enable?Un(e):{cleanData:e,totalData:e.length,separators:0,groups:0,enabledOptions:[]},U=f.useMemo(()=>r&&m!=null&&m.enable&&e.length>0?[{type:"all",[o.label]:m.label||"Select All"},...e]:e,[e,m,r]),z=f.useCallback(B=>{const K=B[o.value];if(r)D((Q=[])=>{const j=Q,Ie=j.some(ye=>ye[o.value]===K)?j.filter(ye=>ye[o.value]!==K):[...j,B];return t==null||t(Ie),Ie});else{const Q=B;D(Q),t==null||t(Q)}},[r,o.value,t]);f.useEffect(()=>{if(s&&u){console.error("defaultValue and value cannot be used simultaneously");return}!s&&!u&&D(void 0),s!==void 0&&D(s),u!==void 0&&D(u)},[s,u]);const Z=f.useMemo(()=>Math.min(p,A*Yn+F*Kn+q*Jn),[p,A,F,q]),ae=U.length>d;f.useEffect(()=>{if(!r)return;const B=m!=null&&m.includeDisabled?(k==null?void 0:k.length)===e.length:(k==null?void 0:k.length)===W.length;M(B);const K=(k==null?void 0:k.length)>0&&!B;P(K)},[k,m]);const le=f.useCallback(()=>{const B=_?[]:m!=null&&m.includeDisabled?b?O:e:W;D(B),t==null||t(B)},[_,r,e,W,t,m]),ee=ft(E);return a.jsxs("div",{className:c(ee,"wu-flex wu-select-container"),ref:T,dir:i,children:[a.jsxs(Ar,{children:[a.jsx($n,{...v,value:k,multiple:r,variant:n,dir:i,placeholder:l,accessorKey:o,customTriggerChildren:h,id:v.id,disabled:N,selectAll:m,isCheckedAll:_}),a.jsxs(va,{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:v.id,style:{maxWidth:C},children:[x,ae?a.jsx(et,{list:U,containerHeight:p,callback:(B,K)=>a.jsx(ss,{option:K,accessorKey:o,multiple:r,onSelect:z,value:k,dir:i,handleSelectAll:le,isCheckedAll:_,isPartialSelected:L}),dir:i}):a.jsx("div",{onScroll:y,style:{maxHeight:Z,height:"fit-content",overflow:"auto"},className:"wu-select-list",children:U.map((B,K)=>a.jsx(ss,{option:B,accessorKey:o,multiple:r,onSelect:z,value:k,handleSelectAll:le,isCheckedAll:_,dir:i,isPartialSelected:L},`${K}`))})]})]}),w&&a.jsx(be,{htmlFor:v.id,className:"wu-select-label",children:w})]})},Ft=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Xn=({value:e,onChange:t,min:r=H.sub(new Date,{years:5}),max:s=H.add(new Date,{years:1}),placeholder:u="Select a month",Label:o,labelPosition:n="top",disabled:i,id:l,readonly:w,disabledMonths:d=[],...p})=>{const[b,x]=f.useState(null),[h,m]=f.useState(""),[N,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 v=new Date(r).getFullYear(),k=new Date(s).getFullYear();return Array.from({length:k-v+1},(D,T)=>({value:k-T,label:k-T}))},[r,s]);f.useEffect(()=>{if(e){const v=new Date(e),k=v.getFullYear(),D=v.getMonth();x({year:k,month:D}),m(`${Ft[D]} ${k}`),E({value:k,label:k})}},[e]);const C=()=>{b&&t&&(t(new Date(b.year,b.month,15)),m(`${Ft[b.month]} ${b.year}`))};return a.jsxs("div",{className:c("wu-flex wu-flex-col wu-items-center",ft(n),n==="top"&&"wu-items-start"),children:[a.jsxs(Me,{children:[a.jsx(ga,{...p,disabled:i||w,id:l,dir:"ltr",placeholder:u,formattedString:h}),a.jsxs(Ce,{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(us,{data:y,accessorKey:{value:"value",label:"label"},value:N,onSelect:v=>E(v),multiple:!1,maxHeight:7*32})}),a.jsx(Zn,{year:N==null?void 0:N.value,selectedMonth:b==null?void 0:b.month,selectedYear:b==null?void 0:b.year,onClick:(v,k)=>x({year:k,month:v}),disabledMonths:d}),a.jsx("div",{className:"wu-flex wu-justify-end wu-px-0.5",children:a.jsx(it.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})]})},Zn=({year:e,selectedMonth:t,selectedYear:r,onClick:s,disabledMonths:u=[]})=>{const o=new Date,n=o.getFullYear(),i=o.getMonth(),l=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:Ft.map((w,d)=>{const p=e===n&&d===i,b=t===d&&r===e;return a.jsx("button",{disabled:l.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":`${Ft[d]} ${e}`,"data-month":d,"data-year":e,children:w},w)})})},os=(e,t,r,s=96)=>{if(e.length===0||s<=0)return[[],[]];const[o,n]=f.useState([]),[i,l]=f.useState([]);return f.useEffect(()=>{const w=()=>{var h,m;const d=((h=t.current)==null?void 0:h.clientWidth)||0,p=((m=r.current)==null?void 0:m.clientWidth)||0,b=d-p,x=Math.floor(b/s);n(e.slice(0,x)),l(e.slice(x))};return w(),window.addEventListener("resize",w),()=>{window.removeEventListener("resize",w)}},[e,s]),[o,i]},ns={wuPrimaryLink:"_wuPrimaryLink_1sy3v_1",wuPrimaryPopoverContent:"_wuPrimaryPopoverContent_1sy3v_8"},Qn=e=>{const{Links:t,children:r,className:s,...u}=e,o=f.useMemo(()=>t.map((d,p)=>f.cloneElement(d,{className:c(ns.wuPrimaryLink,d.props.className,"wu-primary-nav-link"),key:p})),[t]),n=f.useRef(null),i=f.useRef(null),[l,w]=os(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-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:l}),w.length>0&&a.jsxs(Me,{children:[a.jsx($e,{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(Ce,{className:c(ns.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:i,children:r}),a.jsxs(Me,{children:[a.jsx($e,{className:"sm:wu-hidden",children:a.jsx("span",{className:"wu-text-lg wm-menu"})}),a.jsx(Ce,{className:"wu-bg-white wu-border wu-border-blue-p wu-w-fit wu-primary-nav-popover-right",align:"end",sideOffset:4,children:r})]})]})]})})},ka={wuSecondaryLink:"_wuSecondaryLink_1edl1_1",wuSecondaryNav:"_wuSecondaryNav_1edl1_6"},Rn=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(ka.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),i=f.useRef(null),l=f.useRef(null),[w,d]=os(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-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(ka.wuSecondaryNav,"wu-flex wu-items-center wu-justify-start wu-w-full wu-h-full wu-secondary-nav-left"),ref:i,children:w}),d.length>0&&a.jsxs(Me,{children:[a.jsx($e,{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(Ce,{className:c(ka.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:l,children:r}),a.jsxs(Me,{children:[a.jsx($e,{className:"sm:wu-hidden",children:a.jsx("span",{className:"wu-text-lg wm-menu"})}),a.jsx(Ce,{className:"wu-bg-white wu-border wu-border-blue-p wu-w-fit wu-secondary-nav-popover-right",align:"end",sideOffset:12,children:r})]})]})]})})},ls=f.forwardRef(({totalRows:e,initialPage:t=0,initialPageSize:r=100,onPageChange:s,className:u,disabled:o=!1,...n},i)=>{const[l,w]=f.useState(t),[d,p]=f.useState(r);f.useEffect(()=>{w(t),p(r)},[t,r]);const b=Math.ceil(e/d),x=l*d+1,h=Math.min((l+1)*d,e),m=Array.from({length:b},(y,C)=>C),N=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(is,{label:"Previous page",onClick:()=>N(l-1),disabled:l===0||o,icon:"wm-arrow-back-ios-new",className:"hover:wu-bg-gray-20 rtl:wu-rotate-180 wu-prev-btn"}),a.jsx(Yr,{name:`${x} - ${h}`,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(Sa,{onSelect:()=>N(C),className:c("wu-py-2",C===l&&"wu-bg-gray-20","wu-pagination-item"),children:[C*d+1," -"," ",Math.min((C+1)*d,e)]},y)}):m.map(y=>a.jsxs(Sa,{onSelect:()=>N(y),className:c(y===l&&"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(is,{label:"Next page",onClick:()=>N(l+1),disabled:l===b-1||o,icon:"wm-arrow-forward-ios",className:"hover:wu-bg-gray-20 rtl:wu-rotate-180 wu-next-btn"})]})});ls.displayName="WuPagination";const is=({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)})}),el=({Trigger:e,children:t,className:r,dir:s,open:u,onOpenChange:o,modal:n,...i})=>a.jsxs(Me,{open:u,onOpenChange:o,modal:n,children:[a.jsx($e,{asChild:!0,dir:s,children:e}),a.jsx(Ce,{className:c("wu-w-80 wu-p-0 wu-border-blue-p wu-bg-white wu-dark:border-gray-switcher",r),dir:s,...i,children:t})]}),tl=e=>a.jsx(it.PopoverClose,{asChild:!0,children:a.jsx(me,{...e})}),cs=g.forwardRef(({className:e,...t},r)=>a.jsx(dt.Root,{className:c("wu-grid wu-gap-2",e),...t,ref:r}));cs.displayName=dt.Root.displayName;const ws=g.forwardRef(({className:e,...t},r)=>a.jsx(dt.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(dt.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"})})}));ws.displayName=dt.Item.displayName;const ds=f.forwardRef((e,t)=>{const{options:r,defaultValue:s,onChange:u,label:o,dir:n,...i}=e;return a.jsxs(cs,{defaultValue:s,required:i.required,disabled:i.disabled,onValueChange:u,id:i.id,dir:n,name:i.name,className:c("w-fit",i.className),ref:t,style:i.style,children:[a.jsx(At,{htmlFor:i.id,className:"wu-text-sm wu-font-normal wu-text-gray-lead wu-leading-6 wu-radio-group-label",children:o}),r.map(l=>a.jsxs("div",{className:"wu-flex wu-items-center wu-gap-2 wu-radio-item-container",children:[a.jsx(ws,{value:l.value,id:l.value,disabled:l.disabled,required:l.required,"aria-label":l.value,className:"wu-peer wu-radio-item"}),a.jsx(At,{htmlFor:l.value,className:c(l.required&&"after:wu-content-['*'] after:wu-mx-[2px] after:wu-text-rose-500","wu-radio-item-label"),children:l.label})]},l.value))]})});ds.displayName="WuRadioGroup";const al=e=>{const{children:t,...r}=e;return a.jsxs(tt,{...r,role:"complementary","aria-label":"ScrollArea",children:[t,a.jsx(Ca,{orientation:"horizontal"})]})},fs=g.forwardRef(({className:e,orientation:t="horizontal",decorative:r=!0,...s},u)=>a.jsx(lr.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}));fs.displayName=lr.Root.displayName;function ps({className:e,...t}){return a.jsx("div",{className:c("animate-pulse rounded-md bg-muted",e),...t})}const Da=768;function rl(){const[e,t]=g.useState(void 0);return g.useEffect(()=>{const r=window.matchMedia(`(max-width: ${Da-1}px)`),s=()=>{t(window.innerWidth<Da)};return r.addEventListener("change",s),t(window.innerWidth<Da),()=>r.removeEventListener("change",s)},[]),!!e}const sl="sidebar_state",ul=60*60*24*7,ol="256px",nl="256px",ll="3rem",il="b",bs=g.createContext(null);function Ue(){const e=g.useContext(bs);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}const gs=g.forwardRef(({defaultOpen:e=!0,open:t,onOpenChange:r,className:s,style:u,children:o,...n},i)=>{const l=rl(),[w,d]=g.useState(!1),[p,b]=g.useState(l?!0:e),x=t??p,h=g.useCallback(y=>{const C=typeof y=="function"?y(x):y;r?r(C):b(C),document.cookie=`${sl}=${C}; path=/; max-age=${ul}`},[r,x]),m=g.useCallback(()=>l?d(y=>!y):h(y=>!y),[l,h,d]);g.useEffect(()=>{const y=C=>{C.key===il&&(C.metaKey||C.ctrlKey)&&(C.preventDefault(),m())};return window.addEventListener("keydown",y),()=>window.removeEventListener("keydown",y)},[m]);const N=x?"expanded":"collapsed",E=g.useMemo(()=>({state:N,open:x,setOpen:h,isMobile:l,openMobile:w,setOpenMobile:d,toggleSidebar:m}),[N,x,h,l,w,d,m]);return a.jsx(bs.Provider,{value:E,children:a.jsx(vr,{delayDuration:0,children:a.jsx("div",{style:{"--sidebar-width":ol,"--sidebar-width-icon":ll,...u},className:c("wu-group/sidebar-wrapper wu-flex wu-min-h-[calc(100svh-48px)] wu-w-full",s),ref:i,...n,children:o})})})});gs.displayName="SidebarProvider";const hs=g.forwardRef(({side:e="left",variant:t="sidebar",collapsible:r="offcanvas",className:s,children:u,...o},n)=>{const{isMobile:i,state:l,openMobile:w,setOpenMobile:d}=Ue();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}):i?a.jsx(zr,{open:w,onOpenChange:d,...o,children:a.jsx(Na,{"data-sidebar":"sidebar","data-mobile":"true",className:"wu-w-[--sidebar-width] wu-bg-blue-sidebar wu-p-0 [&>button]:wu-hidden",style:{"--sidebar-width":nl},side:e,children: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":l,"data-collapsible":l==="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-20 wu-hidden wu-h-svh wu-w-[--sidebar-width] wu-transition-[left,right,width] wu-duration-150 wu-ease-linear md:wu-flex",e==="left"?"wu-left-0 group-data-[collapsible=offcanvas]:wu-left-[calc(var(--sidebar-width)*-1)]":"wu-right-0 group-data-[collapsible=offcanvas]:wu-right-[calc(var(--sidebar-width)*-1)]",t==="floating"||t==="inset"?"wu-p-2 group-data-[collapsible=icon]:wu-w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4)_+2px)]":"group-data-[collapsible=icon]:wu-w-[--sidebar-width-icon] group-data-[side=left]:wu-border-r group-data-[side=right]:wu-border-l",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})})]})});hs.displayName="Sidebar";const ms=g.forwardRef(({className:e,onClick:t,children:r,...s},u)=>{const{toggleSidebar:o}=Ue();return a.jsxs(Qe,{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"})]})});ms.displayName="SidebarTrigger";const cl=g.forwardRef(({className:e,...t},r)=>{const{toggleSidebar:s}=Ue();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})});cl.displayName="SidebarRail";const xs=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}));xs.displayName="SidebarInset";const wl=g.forwardRef(({className:e,...t},r)=>a.jsx(fa,{ref:r,"data-sidebar":"input",className:c("wu-h-8 wu-w-full wu-shadow-none focus-visible:wu-ring-2",e),...t}));wl.displayName="SidebarInput";const ys=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}));ys.displayName="SidebarHeader";const vs=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}));vs.displayName="SidebarFooter";const dl=g.forwardRef(({className:e,...t},r)=>a.jsx(fs,{ref:r,"data-sidebar":"separator",className:c("wu-mx-2 wu-w-auto",e),...t}));dl.displayName="SidebarSeparator";const Ns=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}));Ns.displayName="SidebarContent";const Ss=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}));Ss.displayName="SidebarGroup";const Cs=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})});Cs.displayName="SidebarGroupLabel";const fl=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})});fl.displayName="SidebarGroupAction";const Es=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}));Es.displayName="SidebarGroupContent";const Ma=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}));Ma.displayName="SidebarMenu";const Ts=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}));Ts.displayName="SidebarMenuItem";const pl=Se.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"}}),Is=g.forwardRef(({asChild:e=!1,isActive:t=!1,variant:r="default",size:s="default",tooltip:u,className:o,...n},i)=>{const l=e?Xe.Slot:"button",{isMobile:w,state:d}=Ue(),p=a.jsx(l,{ref:i,"data-sidebar":"menu-button","data-size":s,"data-active":t,className:c(pl({variant:r,size:s}),o),...n});return u?(typeof u=="string"&&(u={children:u}),a.jsxs(Nr,{children:[a.jsx(Sr,{asChild:!0,children:p}),a.jsx(pa,{side:"right",align:"center",hidden:d!=="collapsed"||w,...u})]})):p});Is.displayName="SidebarMenuButton";const bl=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})});bl.displayName="SidebarMenuAction";const gl=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}));gl.displayName="SidebarMenuBadge";const hl=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(ps,{className:"wu-rounded-md wu-size-4","data-sidebar":"menu-skeleton-icon"}),a.jsx(ps,{className:"wu-h-4 wu-max-w-[--skeleton-width] wu-flex-1","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":u}})]})});hl.displayName="SidebarMenuSkeleton";const ml=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}));ml.displayName="SidebarMenuSub";const xl=g.forwardRef(({...e},t)=>a.jsx("li",{ref:t,...e}));xl.displayName="SidebarMenuSubItem";const yl=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})});yl.displayName="SidebarMenuSubButton";const vl=({children:e,Sidebar:t,className:r,defaultOpen:s=!0,open:u,onOpenChange:o,style:n})=>a.jsxs(gs,{defaultOpen:s,open:u,onOpenChange:o,children:[a.jsxs(hs,{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(ys,{className:"wu-py-2",children:a.jsx(ks,{})}),t]}),a.jsx(xs,{className:"wu-contain-inline-size",children:e})]}),ks=e=>{const{state:t,isMobile:r,openMobile:s}=Ue();return a.jsx(ms,{...e,children:a.jsx(Ea,{showMenu:r?s:t==="expanded"})})},Nl=({className:e,children:t,...r})=>{const s=f.useRef(null),u=f.useRef(null),o=({currentTarget:i})=>{const{scrollTop:l,clientHeight:w,scrollHeight:d}=i;s.current&&s.current.classList.toggle("wu-border-[#1b338014]",l!==0),u.current&&u.current.classList.toggle("wu-border-[#1b338014]",l+w!==d)},n="wu-w-[calc(100%-16px)] wu-mx-auto wu-border-transparent";return a.jsxs(Ns,{...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})]})},Sl=e=>a.jsx(vs,{...e,children:e.children}),Cl=({label:e,children:t,...r})=>a.jsxs(Ss,{...r,className:"wu-p-0",children:[a.jsx("div",{className:"wu-h-8",children:a.jsx(Cs,{className:"wu-items-end wu-px-4 wu-text-xs wu-font-normal wu-leading-4 wu-text-blue-q",children:e})}),a.jsx(Es,{children:a.jsx(Ma,{children:t})})]}),El=e=>a.jsx(Ma,{...e}),Tl=({Icon:e,children:t,className:r,isActive:s,...u})=>{const{state:o}=Ue(),[n,i]=f.useState(),l=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;i(((d=w.current)==null?void 0:d.textContent)||"")},[]),a.jsx(Ts,{...u,className:"wu-flex wu-items-center wu-gap-2 wu-px-2",children:a.jsx(Is,{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:l})})},Il=new Map([[-3,{top:-20,left:-4,zIndex:-1,opacity:0,transition:"all 0.3s ease-in-out, z-index 0s",position:"absolute"}],[-2,{top:0,left:0,zIndex:1,opacity:1,transition:"all 0.3s ease-in-out, z-index 0s",position:"absolute"}],[-1,{top:20,left:4,zIndex:2,opacity:1,transition:"all 0.3s ease-in-out, z-index 0s",position:"absolute"}],[0,{top:40,left:8,zIndex:3,opacity:1,transition:"all 0.3s ease-in-out, z-index 0.10s",position:"absolute"}],[1,{left:12,zIndex:4,opacity:1,transition:"all 0.3s ease-in-out, z-index 0.3s 0.10s",position:"absolute"}],[2,{left:16,zIndex:5,opacity:1,transition:"all 0.3s ease-in-out, z-index 0.3s 0.10s",position:"absolute"}],[3,{left:20,zIndex:-1,opacity:0,transition:"all 0.3s ease-in-out, z-index 0.3s 0.10s",position:"absolute"}]]),_a=(e,t,r=1)=>{const s=e.match(/hsla?\(\s*([\d.]+)\s*,\s*([\d.]+)%\s*,\s*([\d.]+)%\s*(?:,\s*([\d.]+)\s*)?\)/);if(!s)throw new Error("Invalid HSL color format");const u=parseFloat(s[1]),o=parseFloat(s[2]),n=Math.max(0,parseFloat(s[3])+t);return`hsl(${u} ${o}% ${n}% / ${r})`},kl=({index:e,viewIndex:t,length:r,itemHeight:s})=>{const u=(e-t+r)%r;let o;u===0?o=0:u===r-1&&r>=2?o=-1:u===r-2&&r>=3?o=-2:u===1?o=1:u===2?o=2:u===r-3&&r>=4?o=-3:o=3;const n=Il.get(o)||{},i=o>0?s+28+(o-1)*20:n.top;return{position:o,styles:{...n,...o>0&&{top:`${i}px`},height:o>0?"40px":s}}},at={LIGHTNESS_STEP:8,BORDER_LIGHTNESS:10,CONTENT_LIGHTNESS:45,CONTENT_HEIGHT:"calc(100% - 2rem)",FONT_SIZE_ACTIVE:"14px",FONT_SIZE_INACTIVE:"12px"},Dl=({children:e,className:t,header:r,baseColor:s,position:u=0,style:o,...n})=>{const i=u===0,l=u<=0,w={border:i?`4px solid ${_a(s,at.BORDER_LIGHTNESS)}`:"",...o},d={backgroundColor:_a(s,u*at.LIGHTNESS_STEP),fontSize:i?at.FONT_SIZE_ACTIVE:at.FONT_SIZE_INACTIVE,transition:"all 0.3s ease"},p={backgroundColor:_a(s,at.CONTENT_LIGHTNESS),height:at.CONTENT_HEIGHT};return a.jsxs("div",{className:c("wu-font-normal wu-transition-all wu-rounded-lg wu-overflow-hidden wu-w-full wu-cursor-pointer hover:-wu-translate-y-2",t),style:w,...n,children:[a.jsx("div",{style:d,className:"wu-p-2 wu-text-white",children:r}),l&&a.jsx("div",{className:"wu-p-2 wu-overflow-y-auto wu-text-sm",style:p,children:e})]})},Ml=({children:e,Trigger:t,Header:r,styles:s={},classNames:u={},open:o,onOpenChange:n,itemHeight:i})=>{const l={height:i,...s.Trigger};return a.jsxs(Jr,{open:o,onOpenChange:n,children:[a.jsx(Xr,{className:c("wu-bg-gray-25 wu-z-0 wu-w-full wu-rounded-lg wu-rounded-tl-none wu-relative",u.Trigger),style:l,children:a.jsx("span",{className:"wu-absolute wu-text-xs wu-font-medium wu-bg-gray-25 -wu-top-6 wu-left-0 wu-p-1 wu-rounded-t-lg",children:t})}),a.jsxs(Ta,{className:c("wu-top-[50%] wu-left-[50%] wu-bg-black/75 wu-backdrop-blur-[4px] wu-min-h-full wu-overflow-auto wu-shadow-none wu-max-w-none wu-border-none wu-text-white",u.Content),hideCloseButton:!0,isStackedCard:!0,style:s.Content,children:[a.jsx(or.DialogClose,{className:c("wu-absolute wu-right-2 wu-top-2 wu-w-8 wu-h-8 wu-flex wu-items-center wu-justify-center wu-z-10",u.CloseButton),style:s.CloseButton,"aria-label":"Close dialog",children:a.jsx(Le,{icon:"wm-close",className:"wu-text-lg wu-m-4 wu-cursor-pointer"})}),r&&a.jsx(Ia,{className:c("wu-h-12 wu-p-2 wu-pl-4 wu-bg-white/25 wu-backdrop-blur-[24px]",u.Header),style:s.Header,children:r}),e]})]})};function _l({controlled:e,default:t,name:r,state:s="value"}){const{current:u}=g.useRef(e!==void 0),[o,n]=g.useState(t),i=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 l=g.useCallback(w=>{u||n(w)},[]);return[i,l]}const Ds={};function rt(e,t){const r=g.useRef(Ds);return r.current===Ds&&(r.current=e(t)),r}const Aa=g[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],Al=Aa&&Aa!==g.useLayoutEffect?Aa:e=>e();function xe(e){const t=rt(Wl).current;return t.next=e,Al(t.effect),t.trampoline}function Wl(){const e={next:void 0,callback:Pl,trampoline:(...t)=>{var r;return(r=e.callback)==null?void 0:r.call(e,...t)},effect:()=>{e.callback=e.next}};return e}function Pl(){if(process.env.NODE_ENV!=="production")throw new Error("Base UI: Cannot call an event handler while rendering.")}const Ll=[];function Ms(e){g.useEffect(e,Ll)}const ht=0;class Bt{constructor(){kt(this,"currentId",ht);kt(this,"clear",()=>{this.currentId!==ht&&(clearTimeout(this.currentId),this.currentId=ht)});kt(this,"disposeEffect",()=>this.clear)}static create(){return new Bt}start(t,r){this.clear(),this.currentId=setTimeout(()=>{this.currentId=ht,r()},t)}isStarted(){return this.currentId!==ht}}function Wa(){const e=rt(Bt.create).current;return Ms(e.disposeEffect),e}const _s=0;class Pa extends Bt{constructor(){super(...arguments);kt(this,"clear",()=>{this.currentId!==_s&&(clearInterval(this.currentId),this.currentId=_s)})}static create(){return new Pa}start(r,s){this.clear(),this.currentId=setInterval(()=>{s()},r)}}function Ol(){const e=rt(Pa.create).current;return Ms(e.disposeEffect),e}const ge=typeof document<"u"?g.useLayoutEffect:()=>{};function La(e){const t=rt(Fl,e).current;return t.next=e,ge(t.effect),t}function Fl(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}function Bl(){const[,e]=g.useState({});return g.useCallback(()=>{e({})},[])}function ql(){return typeof window<"u"}function As(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Vl(e){return ql()?e instanceof HTMLElement||e instanceof As(e).HTMLElement:!1}function zl(e){return(e==null?void 0:e.ownerDocument)||document}const qt=typeof navigator<"u",Oa=jl(),Hl=Yl(),$l=Gl();typeof CSS>"u"||!CSS.supports||CSS.supports("-webkit-backdrop-filter:none");const Ul=Oa.platform==="MacIntel"&&Oa.maxTouchPoints>1?!0:/iP(hone|ad|od)|iOS/.test(Oa.platform);qt&&Hl.toLowerCase().startsWith("mac")&&navigator.maxTouchPoints,$l.includes("jsdom/");function jl(){if(!qt)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 Gl(){if(!qt)return"";const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:t,version:r})=>`${t}/${r}`).join(" "):navigator.userAgent}function Yl(){if(!qt)return"";const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform??""}const Fa=g.createContext(void 0);process.env.NODE_ENV!=="production"&&(Fa.displayName="NumberFieldRootContext");function Vt(){const e=g.useContext(Fa);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 Ws=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 Ba={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},Kl={valid(e){return e===null?null:e?{[Ws.valid]:""}:{[Ws.invalid]:""}}},Ps=g.createContext({invalid:void 0,controlId:void 0,setControlId:_e,labelId:void 0,setLabelId:_e,messageIds:[],setMessageIds:_e,name:void 0,validityData:{state:Ba,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"&&(Ps.displayName="FieldRootContext");function zt(e=!0){const t=g.useContext(Ps);if(t.setControlId===_e&&!e)throw new Error("Base UI: FieldRootContext is missing. Field parts must be placed within <Field.Root>.");return t}const mt={inputValue:()=>null,value:()=>null};function Ls(e,t,r,s){const u=rt(Os).current;return Xl(u,e,t,r,s)&&Fs(u,[e,t,r,s]),u.callback}function Jl(e){const t=rt(Os).current;return Zl(t,e)&&Fs(t,e),t.callback}function Os(){return{callback:null,cleanup:null,refs:[]}}function Xl(e,t,r,s,u){return e.refs[0]!==t||e.refs[1]!==r||e.refs[2]!==s||e.refs[3]!==u}function Zl(e,t){return e.refs.length!==t.length||e.refs.some((r,s)=>r!==t[s])}function Fs(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 Ql=parseInt(g.version,10);function Rl(e){return Ql>=e}function Bs(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}function ei(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 ti(e,t){return typeof e=="function"?e(t):e}const xt={};function Ht(e,t,r,s,u){let o={...qa(e,xt)};return t&&(o=$t(o,t)),r&&(o=$t(o,r)),s&&(o=$t(o,s)),o}function ai(e){if(e.length===0)return xt;if(e.length===1)return qa(e[0],xt);let t={...qa(e[0],xt)};for(let r=1;r<e.length;r+=1)t=$t(t,e[r]);return t}function $t(e,t){return qs(t)?t(e):ri(e,t)}function ri(e,t){if(!t)return e;for(const r in t){const s=t[r];switch(r){case"style":{e[r]=Bs(e.style,s);break}case"className":{e[r]=Vs(e.className,s);break}default:si(r,s)?e[r]=ui(e[r],s):e[r]=s}}return e}function si(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 qs(e){return typeof e=="function"}function qa(e,t){return qs(e)?e(t):e??xt}function ui(e,t){return t?e?r=>{if(oi(r)){const u=r;Va(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 Va(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function Vs(e,t){return t?e?t+" "+e:t:e}function oi(e){return e!=null&&typeof e=="object"&&"nativeEvent"in e}function yt(e,t,r={}){const s=t.render,u=ni(t,r);if(r.enabled===!1)return null;const o=r.state??Be;return li(e,s,u,o)}function ni(e,t={}){const{className:r,render:s}=e,{state:u=Be,ref:o,props:n,stateAttributesMapping:i,enabled:l=!0}=t,w=l?ti(r,u):void 0,d=l?ei(u,i):Be,p=l?Bs(d,Array.isArray(n)?ai(n):n)??Be:Be;return typeof document<"u"&&(l?Array.isArray(o)?p.ref=Jl([p.ref,zs(s),...o]):p.ref=Ls(p.ref,zs(s),o):Ls(null,null)),l?(w!==void 0&&(p.className=Vs(p.className,w)),p):Be}function li(e,t,r,s){if(t){if(typeof t=="function")return t(r,s);const u=Ht(r,t.props);return u.ref=r.ref,g.cloneElement(t,u)}if(e&&typeof e=="string")return ii(e,r);throw new Error("Base UI: Render element or function are not defined.")}function ii(e,t){return e==="button"?a.jsx("button",{type:"button",...t}):e==="img"?a.jsx("img",{alt:"",...t}):g.createElement(e,t)}function zs(e){return e&&typeof e!="function"?Rl(19)?e.props.ref:e.ref:null}const Hs=new Map;function vt(e,t){const r=JSON.stringify({locale:e,options:t}),s=Hs.get(r);if(s)return s;const u=new Intl.NumberFormat(e,t);return Hs.set(r,u),u}function st(e,t,r){return e==null?"":vt(t,r).format(e)}function $s(e,t,r){return st(e,t,{...r,maximumFractionDigits:20})}const ci=["零","〇","一","二","三","四","五","六","七","八","九"],wi={零:"0","〇":"0",一:"1",二:"2",三:"3",四:"4",五:"5",六:"6",七:"7",八:"8",九:"9"},Us=["٠","١","٢","٣","٤","٥","٦","٧","٨","٩"],js=["۰","۱","۲","۳","۴","۵","۶","۷","۸","۹"],za=["0","1","2","3","4","5","6","7","8","9"],Gs=["%","٪","%","﹪"],Ys=["‰","؉"],Ks=["−","-","‒","–","—","﹣"],Js=["+","﹢"],di=".",fi=",",pi=new RegExp(`[${Us.join("")}]`,"g"),bi=new RegExp(`[${js.join("")}]`,"g"),gi=new RegExp(`[${za.join("")}]`,"g"),hi=new RegExp(`[${ci.join("")}]`,"g"),mi=new RegExp(`[${Gs.join("")}]`),xi=new RegExp(`[${Ys.join("")}]`),Ha=/[٠١٢٣٤٥٦٧٨٩]/,Xs=/[۰۱۲۳۴۵۶۷۸۹]/,$a=/[零〇一二三四五六七八九]/,Zs=new RegExp(`[${za.join("")}]`),yi=[".",",",di,fi,"٫","٬"],vi=new RegExp("\\p{Zs}","u"),Ni=["+",...Js],Si=["-",...Ks],Ut=e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),Ci=e=>e.replace(/[-\\\]^]/g,t=>`\\${t}`),Qs=e=>`[${e.map(Ci).join("")}]`,Rs=Qs(["-"].concat(Ks)),eu=Qs(["+"].concat(Js)),tu=new RegExp(Rs,"gu"),au=new RegExp(eu,"gu"),Nt=new RegExp(Rs),jt=new RegExp(eu);function Ua(e,t){const r=vt(e,t).formatToParts(11111.1),s={};return r.forEach(u=>{s[u.type]=u.value}),vt(e).formatToParts(.1).forEach(u=>{u.type==="decimal"&&(s[u.type]=u.value)}),s}function ut(e,t,r){if(e==null)return null;let s=String(e).replace(new RegExp("\\p{Cf}","gu"),"").trim();s=s.replace(tu,"-").replace(au,"+");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 i=t;i===void 0&&(Ha.test(s)||Xs.test(s)?i="ar":$a.test(s)&&(i="zh"));const{group:l,decimal:w,currency:d}=Ua(i,r),p=vt(i,r).formatToParts(1).filter(T=>T.type==="unit").map(T=>Ut(T.value)),b=p.length?new RegExp(p.join("|"),"g"):null;let x=null;l&&(x=new RegExp("\\p{Zs}","u").test(l)?new RegExp("\\p{Zs}","gu"):new RegExp(Ut(l),"g"));let m=[{regex:l?x:null,replacement:""},{regex:w?new RegExp(Ut(w),"g"):null,replacement:"."},{regex:/./g,replacement:"."},{regex:/,/g,replacement:""},{regex:/٫/g,replacement:"."},{regex:/٬/g,replacement:""},{regex:d?new RegExp(Ut(d),"g"):null,replacement:""},{regex:b,replacement:""},{regex:pi,replacement:T=>String(Us.indexOf(T))},{regex:bi,replacement:T=>String(js.indexOf(T))},{regex:gi,replacement:T=>String(za.indexOf(T))},{regex:hi,replacement:T=>wi[T]}].reduce((T,{regex:_,replacement:M})=>_?T.replace(_,M):T,s);const N=m.lastIndexOf(".");if(N!==-1&&(m=`${m.slice(0,N).replace(/\./g,"")}.${m.slice(N+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,v=C==="unit"&&(r==null?void 0:r.unit)==="percent",k=mi.test(e)||C==="percent";return xi.test(e)?y/=1e3:!v&&k&&(y/=100),Number.isNaN(y)?null:y}const Ei={...g};let ru=0;function Ti(e,t="mui"){const[r,s]=g.useState(e),u=e||r;return g.useEffect(()=>{r==null&&(ru+=1,s(`${t}-${ru}`))},[r,t]),u}const su=Ei.useId;function Ii(e,t){if(su!==void 0){const r=su();return e??`${t}-${r}`}return Ti(e,t)}function ki(e){return Ii(e,"base-ui")}const Di=60,Mi=400,_i=50,Ai=3,Wi=8,Gt=1;function Pi(e,t=Number.MIN_SAFE_INTEGER,r=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,r))}function Yt(e,t={}){return parseFloat(vt("en-US",{maximumFractionDigits:t.maximumFractionDigits,minimumFractionDigits:t.minimumFractionDigits,useGrouping:!1}).format(e))}function Li(e,{step:t,minWithDefault:r,maxWithDefault:s,minWithZeroDefault:u,format:o,snapOnStep:n,small:i}){if(e===null)return e;const l=Pi(e,r,s);if(t!=null&&n){if(i){const d=(l-u)/t,p=Math.round(d),b=u+p*t;return Yt(b,o)}const w=r!==Number.MIN_SAFE_INTEGER?r:u;if(t>0){const d=l-t,p=Math.floor((d-w)/t);return Yt(w+p*t+t,o)}if(t<0){const d=Math.abs(t),p=l-t,b=Math.ceil((p-w)/d);return Yt(w+b*d+t,o)}}return Yt(l,o)}function uu(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 Kt(e,t,r){const s=Be;return{reason:e,event:t??new Event("base-ui"),...s}}function Oi(e){e.preventDefault(),e.stopPropagation()}function Fi(e){return"nativeEvent"in e}const ou=g.forwardRef(function(t,r){const{id:s,min:u,max:o,smallStep:n=.1,step:i=1,largeStep:l=10,required:w=!1,disabled:d=!1,readOnly:p=!1,name:b,defaultValue:x,value:h,onValueChange:m,onValueCommitted:N,allowWheelScrub:E=!1,snapOnStep:y=!1,format:C,locale:v,render:k,className:D,inputRef:T,..._}=t,{setControlId:M,setDirty:L,validityData:P,setValidityData:O,disabled:A,setFilled:F,invalid:q,name:W,state:U}=zt(),z=A||d,Z=W??b,[ae,le]=g.useState(!1),ee=u??Number.MIN_SAFE_INTEGER,B=o??Number.MAX_SAFE_INTEGER,K=u??0,Q=C==null?void 0:C.style,j=g.useRef(null),Te=ki(s);ge(()=>(M(Te),()=>{M(void 0)}),[Te,M]);const[Ie,ye]=_l({controlled:h,default:x,name:"NumberField",state:"value"}),I=Ie??null,V=La(I);ge(()=>{F(I!==null)},[F,I]);const ne=Bl(),$=La(C),ie=xe(m),te=g.useRef(!1),de=xe((re,G)=>{te.current=!1,N==null||N(re,G)}),fe=Wa(),Ae=Ol(),ve=Wa(),We=g.useRef(!1),Pe=g.useRef(0),Oe=g.useRef(!0),Ge=g.useRef(null),aa=g.useRef(()=>{});ge(()=>{P.initialValue===null&&I!==P.initialValue&&O(re=>({...re,initialValue:I}))},[O,P.initialValue,I]);const[Ye,Ke]=g.useState(()=>h!==void 0?nu(I,v,C):st(I,v,C)),[Et,nt]=g.useState("numeric"),se=xe(()=>{const{decimal:re,group:G,currency:ce}=Ua(v,C),J=new Set;yi.forEach(oe=>J.add(oe)),re&&J.add(re),G&&(J.add(G),vi.test(G)&&J.add(" "));const ke=Q==="percent"||Q==="unit"&&(C==null?void 0:C.unit)==="percent",Ne=Q==="percent"||Q==="unit"&&(C==null?void 0:C.unit)==="permille";return ke&&Gs.forEach(oe=>J.add(oe)),Ne&&Ys.forEach(oe=>J.add(oe)),Q==="currency"&&ce&&J.add(ce),Ni.forEach(oe=>J.add(oe)),ee<0&&Si.forEach(oe=>J.add(oe)),J}),he=xe(re=>re!=null&&re.altKey?n:re!=null&&re.shiftKey?l:i),Tt=xe((re,G,ce)=>{const J=G,ke=G&&Fi(G)?G.nativeEvent:G,Ne=uu("none",ke),oe=Li(re,{step:ce?he(J)*ce:void 0,format:$.current,minWithDefault:ee,maxWithDefault:B,minWithZeroDefault:K,snapOnStep:y,small:(J==null?void 0:J.altKey)??!1});if(oe!==I||re!==I||Oe.current===!1){if(Ge.current=oe,ie==null||ie(oe,Ne),Ne.isCanceled)return;ye(oe),L(oe!==P.initialValue),te.current=!0}Oe.current&&Ke(st(oe,v,C)),ne()}),It=xe((re,G,ce,J)=>{const ke=ce??V.current,Ne=typeof ke=="number"?ke+re*G:Math.max(0,u??0);Tt(Ne,J,G)}),lt=xe(()=>{ve.clear(),fe.clear(),Ae.clear(),aa.current(),Pe.current=0}),Qu=xe((re,G)=>{if(lt(),!j.current)return;const ce=As(j.current);function J(Ne){Ne.preventDefault()}ce.addEventListener("contextmenu",J),aa.current=()=>{ce.removeEventListener("contextmenu",J)},ce.addEventListener("pointerup",Ne=>{We.current=!1,lt();const oe=Ge.current??V.current;de(oe,Kt("none",Ne))},{once:!0});function ke(){const Ne=he(G)??Gt;It(Ne,re?1:-1,void 0,G)}ke(),fe.start(Mi,()=>{Ae.start(Di,ke)})});ge(function(){if(!Oe.current)return;const G=h!==void 0?nu(I,v,C):st(I,v,C);G!==Ye&&Ke(G)}),ge(function(){if(!Ul)return;let G="text";ee>=0&&(G="decimal"),nt(G)},[ee,Q]),g.useEffect(()=>()=>lt(),[lt]),g.useEffect(function(){const G=j.current;if(z||p||!E||!G)return;function ce(J){if(J.ctrlKey||zl(j.current).activeElement!==j.current)return;J.preventDefault();const ke=he(J)??Gt;It(ke,J.deltaY>0?-1:1,void 0,J)}return G.addEventListener("wheel",ce),()=>{G.removeEventListener("wheel",ce)}},[E,It,z,p,l,i,he]);const sr=g.useMemo(()=>({...U,disabled:z,readOnly:p,required:w,value:I,inputValue:Ye,scrubbing:ae}),[U,z,p,w,I,Ye,ae]),Dc=g.useMemo(()=>({inputRef:j,inputValue:Ye,value:I,startAutoChange:Qu,stopAutoChange:lt,minWithDefault:ee,maxWithDefault:B,disabled:z,readOnly:p,id:Te,setValue:Tt,incrementValue:It,getStepAmount:he,allowInputSyncRef:Oe,formatOptionsRef:$,valueRef:V,lastChangedValueRef:Ge,hasPendingCommitRef:te,isPressedRef:We,intentionalTouchCheckTimeout:ve,movesAfterTouchRef:Pe,name:Z,required:w,invalid:q,inputMode:Et,getAllowedNonNumericKeys:se,min:u,max:o,setInputValue:Ke,locale:v,isScrubbing:ae,setIsScrubbing:le,state:sr,onValueCommitted:de}),[j,Ye,I,Qu,lt,ee,B,z,p,Te,Tt,It,he,Oe,$,V,Ge,te,We,ve,Pe,Z,w,q,Et,se,u,o,Ke,v,ae,sr,de]),Mc=yt("div",t,{ref:r,state:sr,props:_,stateAttributesMapping:mt});return a.jsxs(Fa.Provider,{value:Dc,children:[Mc,Z&&a.jsx("input",{type:"hidden",name:Z,ref:T,value:I??"",disabled:z,required:w})]})});process.env.NODE_ENV!=="production"&&(ou.displayName="NumberFieldRoot");function nu(e,t,r){return(r==null?void 0:r.maximumFractionDigits)!=null||(r==null?void 0:r.minimumFractionDigits)!=null?st(e,t,r):$s(e,t,r)}const lu=g.forwardRef(function(t,r){const{render:s,className:u,...o}=t,{state:n}=Vt();return yt("div",t,{ref:r,state:n,props:[{role:"group"},o],stateAttributesMapping:mt})});process.env.NODE_ENV!=="production"&&(lu.displayName="NumberFieldGroup");let ja;process.env.NODE_ENV!=="production"&&(ja=new Set);function iu(...e){if(process.env.NODE_ENV!=="production"){const t=e.join(" ");ja.has(t)||(ja.add(t),console.error(`Base UI: ${t}`))}}const cu=g.createContext(void 0);process.env.NODE_ENV!=="production"&&(cu.displayName="CompositeRootContext");function Bi(e=!1){const t=g.useContext(cu);if(t===void 0&&!e)throw new Error("Base UI: CompositeRootContext is missing. Composite parts must be placed within <Composite.Root>.");return t}function qi(e){const{focusableWhenDisabled:t,disabled:r,composite:s=!1,tabIndex:u=0,isNativeButton:o}=e,n=s&&t!==!1,i=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||i)&&(w.disabled=r),w},[s,r,t,n,i,o,u])}}function wu(e={}){const{disabled:t=!1,focusableWhenDisabled:r,tabIndex:s=0,native:u=!0}=e,o=g.useRef(null),n=Bi(!0)!==void 0,i=xe(()=>{const b=o.current;return!!((b==null?void 0:b.tagName)==="A"&&(b!=null&&b.href))}),{props:l}=qi({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||iu("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&&iu("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;Vi(b)&&n&&t&&l.disabled===void 0&&b.disabled&&(b.disabled=!1)},[t,l.disabled,n]);ge(w,[w]);const d=g.useCallback((b={})=>{const{onClick:x,onMouseDown:h,onKeyUp:m,onKeyDown:N,onPointerDown:E,...y}=b;return Ht({type:u?"button":void 0,onClick(v){if(t){v.preventDefault();return}x==null||x(v)},onMouseDown(v){t||h==null||h(v)},onKeyDown(v){if(t||(Va(v),N==null||N(v)),v.baseUIHandlerPrevented)return;const k=v.target===v.currentTarget&&!u&&!i()&&!t,D=v.key==="Enter",T=v.key===" ";k&&((T||D)&&v.preventDefault(),D&&(x==null||x(v)))},onKeyUp(v){t||(Va(v),m==null||m(v)),!v.baseUIHandlerPrevented&&v.target===v.currentTarget&&!u&&!t&&v.key===" "&&(x==null||x(v))},onPointerDown(v){if(t){v.preventDefault();return}E==null||E(v)}},u?void 0:{role:"button"},l,y)},[t,l,u,i]),p=xe(b=>{o.current=b,w()});return{getButtonProps:d,buttonRef:p}}function Vi(e){return Vl(e)&&e.tagName==="BUTTON"}function du(e){const{allowInputSyncRef:t,disabled:r,formatOptionsRef:s,getStepAmount:u,id:o,incrementValue:n,inputRef:i,inputValue:l,intentionalTouchCheckTimeout:w,isIncrement:d,isPressedRef:p,locale:b,maxWithDefault:x,minWithDefault:h,movesAfterTouchRef:m,readOnly:N,setValue:E,startAutoChange:y,stopAutoChange:C,value:v,valueRef:k,lastChangedValueRef:D,onValueCommitted:T}=e,_=g.useRef({x:0,y:0}),M=g.useRef(!1),L=g.useRef(!1),P=g.useRef(""),O=v!=null&&v<=h,A=v!=null&&v>=x,F=xe(W=>{t.current=!0;const U=ut(l,b,s.current);U!==null&&(k.current=U,E(U,W))}),q=g.useMemo(()=>({disabled:r||(d?A:O),"aria-readonly":N||void 0,"aria-label":d?"Increase":"Decrease","aria-controls":o,tabIndex:-1,style:{WebkitUserSelect:"none",userSelect:"none"},onTouchStart(){M.current=!0},onTouchEnd(){M.current=!1},onClick(W){const U=r||N||(d?A:O);if(W.defaultPrevented||U||(P.current==="touch"?L.current:W.detail!==0))return;F(W.nativeEvent);const z=u(W)??Gt,Z=k.current;n(z,d?1:-1,void 0,W.nativeEvent);const ae=D.current??k.current;ae!==Z&&T(ae,Kt("none",W.nativeEvent))},onPointerDown(W){var Z;const U=!W.button||W.button===0,z=r||(d?A:O);W.defaultPrevented||N||!U||z||(P.current=W.pointerType,L.current=!1,p.current=!0,_.current={x:W.clientX,y:W.clientY},F(W.nativeEvent),W.pointerType!=="touch"?(W.preventDefault(),(Z=i.current)==null||Z.focus(),y(d,W)):w.start(_i,()=>{const ae=m.current;m.current=0,p.current&&ae!=null&&ae<Ai?(y(d,W),L.current=!0):(L.current=!1,C())}))},onPointerUp(W){W.pointerType==="touch"&&(p.current=!1)},onPointerMove(W){if(r||N||(d?A:O)||W.pointerType!=="touch"||!p.current)return;m.current!=null&&(m.current+=1);const{x:z,y:Z}=_.current,ae=z-W.clientX,le=Z-W.clientY;ae**2+le**2>Wi**2&&C()},onMouseEnter(W){const U=r||N||(d?A:O);W.defaultPrevented||U||!p.current||M.current||P.current==="touch"||y(d,W)},onMouseLeave(){M.current||C()},onMouseUp(){M.current||C()}}),[r,d,A,O,N,o,F,u,k,n,D,T,p,i,y,w,m,C]);return g.useMemo(()=>({props:q}),[q])}const fu=g.forwardRef(function(t,r){const{render:s,className:u,disabled:o=!1,nativeButton:n=!0,...i}=t,{allowInputSyncRef:l,disabled:w,formatOptionsRef:d,getStepAmount:p,id:b,incrementValue:x,inputRef:h,inputValue:m,intentionalTouchCheckTimeout:N,isPressedRef:E,locale:y,maxWithDefault:C,minWithDefault:v,movesAfterTouchRef:k,readOnly:D,setValue:T,startAutoChange:_,state:M,stopAutoChange:L,value:P,valueRef:O,lastChangedValueRef:A,onValueCommitted:F}=Vt(),q=o||w,{props:W}=du({isIncrement:!0,inputRef:h,startAutoChange:_,stopAutoChange:L,minWithDefault:v,maxWithDefault:C,value:P,inputValue:m,disabled:q,readOnly:D,id:b,setValue:T,getStepAmount:p,incrementValue:x,allowInputSyncRef:l,formatOptionsRef:d,valueRef:O,isPressedRef:E,intentionalTouchCheckTimeout:N,movesAfterTouchRef:k,locale:y,lastChangedValueRef:A,onValueCommitted:F}),{getButtonProps:U,buttonRef:z}=wu({disabled:q,native:n}),Z=g.useMemo(()=>({...M,disabled:q}),[M,q]);return yt("button",t,{ref:[r,z],state:Z,props:[W,i,U],stateAttributesMapping:mt})});process.env.NODE_ENV!=="production"&&(fu.displayName="NumberFieldIncrement");const pu=g.forwardRef(function(t,r){const{render:s,className:u,disabled:o=!1,nativeButton:n=!0,...i}=t,{allowInputSyncRef:l,disabled:w,formatOptionsRef:d,getStepAmount:p,id:b,incrementValue:x,inputRef:h,inputValue:m,intentionalTouchCheckTimeout:N,isPressedRef:E,maxWithDefault:y,minWithDefault:C,movesAfterTouchRef:v,readOnly:k,setValue:D,startAutoChange:T,state:_,stopAutoChange:M,value:L,valueRef:P,locale:O,lastChangedValueRef:A,onValueCommitted:F}=Vt(),q=o||w,{props:W}=du({isIncrement:!1,inputRef:h,startAutoChange:T,stopAutoChange:M,minWithDefault:C,maxWithDefault:y,value:L,inputValue:m,disabled:q,readOnly:k,id:b,setValue:D,getStepAmount:p,incrementValue:x,allowInputSyncRef:l,formatOptionsRef:d,valueRef:P,isPressedRef:E,intentionalTouchCheckTimeout:N,movesAfterTouchRef:v,locale:O,lastChangedValueRef:A,onValueCommitted:F}),{getButtonProps:U,buttonRef:z}=wu({disabled:q,native:n}),Z=g.useMemo(()=>({..._,disabled:q}),[_,q]);return yt("button",t,{ref:[r,z],state:Z,props:[W,i,U],stateAttributesMapping:mt})});process.env.NODE_ENV!=="production"&&(pu.displayName="NumberFieldDecrement");const bu=g.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:_e});process.env.NODE_ENV!=="production"&&(bu.displayName="FormContext");function Ga(){return g.useContext(bu)}function Ya(e,t){return{...e,state:{...e.state,valid:!t&&e.state.valid}}}const Jt=Object.keys(Ba);function zi(e){if(!e||e.valid||!e.valueMissing)return!1;let t=!1;for(const r of Jt)r!=="valid"&&(r==="valueMissing"&&(t=e[r]),e[r]&&(t=!1));return t}function Hi(){const{setValidityData:e,validate:t,messageIds:r,validityData:s,validationMode:u,validationDebounceTime:o,invalid:n,markedDirtyRef:i,controlId:l,state:w,name:d}=zt(),{formRef:p,clearErrors:b}=Ga(),x=Wa(),h=g.useRef(null),m=xe(async(y,C=!1)=>{const v=h.current;if(!v)return;if(C){if(w.valid!==!1)return;const P=v.validity;if(!P.valueMissing){const A={value:y,state:{...Ba,valid:!0},error:"",errors:[],initialValue:s.initialValue};if(v.setCustomValidity(""),l){const F=p.current.fields.get(l);F&&p.current.fields.set(l,{...F,...Ya(A,!1)})}e(A);return}const O=Jt.reduce((A,F)=>(A[F]=P[F],A),{});if(!O.valid&&!zi(O))return}function k(P){const O=Jt.reduce((F,q)=>(F[q]=P.validity[q],F),{});let A=!1;for(const F of Jt)if(F!=="valid"){if(F==="valueMissing"&&O[F])A=!0;else if(O[F])return O}return A&&!i.current&&(O.valid=!0,O.valueMissing=!1),O}x.clear();let D=null,T=[];const _=k(v);let M;if(v.validationMessage)M=v.validationMessage,T=[v.validationMessage];else{const P=Array.from(p.current.fields.values()).reduce((A,F)=>{var q,W;return F.name&&F.getValueRef&&(A[F.name]=(W=(q=F.getValueRef).current)==null?void 0:W.call(q)),A},{}),O=t(y,P);typeof O=="object"&&O!==null&&"then"in O?D=await O:D=O,D!==null&&(_.valid=!1,_.customError=!0,Array.isArray(D)?(T=D,v.setCustomValidity(D.join(`
7
- `))):D&&(T=[D],v.setCustomValidity(D)))}const L={value:y,state:_,error:M??(Array.isArray(D)?D[0]:D??""),errors:T,initialValue:s.initialValue};if(l){const P=p.current.fields.get(l);P&&p.current.fields.set(l,{...P,...Ya(L,n)})}e(L)}),N=g.useCallback((y={})=>Ht({...r.length&&{"aria-describedby":r.join(" ")},...w.valid===!1&&{"aria-invalid":!0}},y),[r,w.valid]),E=g.useCallback((y={})=>Ht({onChange(C){if(C.nativeEvent.defaultPrevented)return;if(b(d),u!=="onChange"){m(C.currentTarget.value,!0);return}if(n)return;const v=C.currentTarget;if(v.value===""){m(v.value);return}x.clear(),o?x.start(o,()=>{m(v.value)}):m(v.value)}},N(y)),[N,b,d,x,m,n,u,o]);return g.useMemo(()=>({getValidationProps:N,getInputValidationProps:E,inputRef:h,commitValidation:m}),[N,E,m])}function $i(e){const{formRef:t}=Ga(),{invalid:r,markedDirtyRef:s,validityData:u,setValidityData:o}=zt(),{enabled:n=!0,value:i,id:l,name:w,controlRef:d,commitValidation:p}=e,b=La(e.getValue);ge(()=>{var h;if(!n)return;let x=i;x===void 0&&(x=(h=b.current)==null?void 0:h.call(b)),u.initialValue===null&&x!==u.initialValue&&o(m=>({...m,initialValue:x}))},[n,o,i,u.initialValue,b]),ge(()=>{n&&l&&t.current.fields.set(l,{controlRef:d,validityData:Ya(u,r),validate(){var h;let x=i;x===void 0&&(x=(h=b.current)==null?void 0:h.call(b)),s.current=!0,go.flushSync(()=>p(x))},getValueRef:b,name:w})},[p,d,n,t,b,l,r,s,w,u,i]),ge(()=>{const x=t.current.fields;return()=>{l&&x.delete(l)}},[t,l])}const Ui={...Kl,...mt},ji=new Set(["Backspace","Delete","ArrowLeft","ArrowRight","Tab","Enter","Escape"]),gu=g.forwardRef(function(t,r){const{render:s,className:u,...o}=t,{allowInputSyncRef:n,disabled:i,formatOptionsRef:l,getAllowedNonNumericKeys:w,getStepAmount:d,id:p,incrementValue:b,inputMode:x,inputValue:h,max:m,min:N,name:E,readOnly:y,required:C,setValue:v,state:k,setInputValue:D,locale:T,inputRef:_,value:M,onValueCommitted:L,lastChangedValueRef:P,hasPendingCommitRef:O,valueRef:A}=Vt(),{clearErrors:F}=Ga(),{labelId:q,validationMode:W,setTouched:U,setFocused:z,invalid:Z}=zt(),{getInputValidationProps:ae,getValidationProps:le,commitValidation:ee,inputRef:B}=Hi(),K=g.useRef(!1),Q=g.useRef(!1);$i({id:p,commitValidation:ee,value:M,controlRef:_,name:E,getValue:()=>M??null});const j=g.useRef(M),Te=g.useRef(h);return ge(()=>{j.current===M&&Te.current===h||(F(E),W==="onChange"&&ee(M))},[M,h,E,F,W,ee]),ge(()=>{if(!(j.current===M||W==="onChange")){if(Q.current){Q.current=!1;return}ee(M,!0)}},[ee,W,M]),ge(()=>{j.current=M,Te.current=h},[M,h]),yt("input",t,{ref:[r,_,B],state:k,props:[{id:p,required:C,disabled:i,readOnly:y,inputMode:x,value:h,type:"text",autoComplete:"off",autoCorrect:"off",spellCheck:"false","aria-roledescription":"Number field","aria-invalid":Z||void 0,"aria-labelledby":q,suppressHydrationWarning:!0,onFocus(I){if(I.defaultPrevented||y||i||K.current)return;K.current=!0,z(!0);const V=I.currentTarget,ne=V.value.length;V.setSelectionRange(ne,ne)},onBlur(I){if(I.defaultPrevented||y||i)return;U(!0),z(!1);const V=!n.current,ne=O.current;if(n.current=!0,h.trim()===""){v(null),W==="onBlur"&&ee(null),L(null,Kt("none",I.nativeEvent));return}const $=l.current,ie=ut(h,T,$);if(ie===null)return;Q.current=!0;const te=($==null?void 0:$.maximumFractionDigits)!=null||($==null?void 0:$.minimumFractionDigits)!=null,de=$==null?void 0:$.maximumFractionDigits,fe=te&&typeof de=="number"?Number(ie.toFixed(de)):ie,Ae=Kt("none",I.nativeEvent),ve=M!==fe,We=V||ve||ne;W==="onBlur"&&ee(fe),ve&&v(fe,I.nativeEvent),We&&L(fe,Ae);const Pe=st(fe,T,$),Oe=$s(ie,T,$);!(!te&&ie===M&&h===Oe)&&h!==Pe&&D(Pe)},onChange(I){if(I.nativeEvent.defaultPrevented)return;n.current=!1;const V=I.target.value;if(V.trim()===""){D(V),v(null,I.nativeEvent);return}const ne=w();if(!Array.from(V).every(te=>{const de=te>="0"&&te<="9",fe=Ha.test(te),Ae=$a.test(te),ve=Xs.test(te),We=Zs.test(te),Pe=Nt.test(te);return de||fe||Ae||ve||We||Pe||ne.has(te)}))return;if(I.isTrusted){D(V);const te=ut(V,T,l.current);te!==null&&v(te,I.nativeEvent);return}const ie=ut(V,T,l.current);ie!==null&&(D(V),v(ie,I.nativeEvent))},onKeyDown(I){if(I.defaultPrevented||y||i)return;const V=I.nativeEvent;n.current=!0;const ne=w();let $=ne.has(I.key);const{decimal:ie,currency:te,percentSign:de}=Ua(T,l.current),fe=I.currentTarget.selectionStart,Ae=I.currentTarget.selectionEnd,ve=fe===0&&Ae===h.length,We=se=>fe===se&&Ae===se+1;if(Nt.test(I.key)&&Array.from(ne).some(se=>Nt.test(se||""))){const se=h.search(tu),he=se!=null&&se!==-1&&We(se);$=!(Nt.test(h)||jt.test(h))||ve||he}if(jt.test(I.key)&&Array.from(ne).some(se=>jt.test(se||""))){const se=h.search(au),he=se!=null&&se!==-1&&We(se);$=!(Nt.test(h)||jt.test(h))||ve||he}[ie,te,de].forEach(se=>{if(I.key===se){const he=h.indexOf(se),Tt=fe===he&&Ae===he+1;$=!h.includes(se)||ve||Tt}});const Pe=I.key>="0"&&I.key<="9",Oe=Ha.test(I.key),Ge=$a.test(I.key),aa=Zs.test(I.key),Ye=ji.has(I.key);if(I.which===229||I.altKey||I.ctrlKey||I.metaKey||$||Pe||Oe||aa||Ge||Ye)return;const Ke=ut(h,T,l.current),Et=d(I)??Gt;Oi(I);const nt=uu("none",V);I.key==="ArrowUp"?(b(Et,1,Ke,V),L(P.current??A.current,nt)):I.key==="ArrowDown"?(b(Et,-1,Ke,V),L(P.current??A.current,nt)):I.key==="Home"&&N!=null?(v(N,V),L(P.current??A.current,nt)):I.key==="End"&&m!=null&&(v(m,V),L(P.current??A.current,nt))},onPaste(I){if(I.defaultPrevented||y||i)return;I.preventDefault();const ne=(I.clipboardData||window.Clipboard).getData("text/plain"),$=ut(ne,T,l.current);$!==null&&(n.current=!1,v($,I.nativeEvent),D(ne))}},ae(),le(),o],stateAttributesMapping:Ui})});process.env.NODE_ENV!=="production"&&(gu.displayName="NumberFieldInput");const Gi={wuStepper:"_wuStepper_apbnq_1"},Yi=({onChange:e,Label:t,defaultValue:r=0,readonly:s,dir:u,step:o=1,min:n,max:i,value:l,className:w,labelPosition:d="left",disabled:p,resetInvalidValueOnBlur:b=!0,...x})=>{const h=g.useId(),[m,N]=g.useState(l!==void 0?Number(l):r||0);g.useEffect(()=>{l!==void 0&&N(Number(l))},[l]);const E=T=>{N(T),e==null||e(T)},y=T=>{const _=Number(T.target.value);Number.isNaN(_)||N(_)},C=()=>{b&&(n!==void 0&&m<n?(N(n),e==null||e(n)):i!==void 0&&m>i&&(N(i),e==null||e(i)))};g.useEffect(()=>{l&&r&&console.warn("As both value and defaultValue are passed, value will be used")},[l,r]);const v={inc:s||i!==void 0&&m>=i||p,dec:s||n!==void 0&&m<=n||p},k=n!==void 0&&m<n||i!==void 0&&m>i,D=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(ou,{id:h,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",Gi.wuStepper,Ki({labelPosition:d}),w),children:[t&&a.jsx(be,{htmlFor:h,className:"wu-input-label",children:t}),a.jsxs(lu,{className:"wu-flex wu-max-w-[97px] wu-relative",children:[a.jsx(pu,{"aria-label":"decrement",className:c(D,u==="rtl"?"wu-right-0":"wu-left-0","wu-stepper-button"),disabled:v.dec,children:a.jsx("span",{className:"wu-text-base wm-minimize"})}),a.jsx(gu,{"aria-label":"stepper",role:"spinbutton",type:"text","aria-invalid":k||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",k&&"wu-border-red-deep focus:wu-border-red-deep","wu-stepper-input"),readOnly:s,onChange:y,onBlur:C,disabled:p,min:n,max:i,step:o,...x}),a.jsx(fu,{"aria-label":"increment",className:c(D,u==="rtl"?"wu-left-0":"wu-right-0","wu-stepper-button"),disabled:v.inc,children:a.jsx("span",{className:"wu-text-base wm-add"})})]})]})},Ki=Se.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"}}}),hu=Se.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"}}),Ji=g.forwardRef(({className:e,variant:t,size:r,...s},u)=>a.jsx(ir.Root,{ref:u,className:c(hu({variant:t,size:r,className:e})),...s}));Ji.displayName=ir.Root.displayName;const mu=g.createContext({size:"default",variant:"default"}),Xt=g.forwardRef(({className:e,variant:t,size:r,children:s,...u},o)=>a.jsx(Mt.Root,{ref:o,className:c("wu-flex wu-items-center wu-justify-center wu-gap-1",e),...u,children:a.jsx(mu.Provider,{value:{variant:t,size:r},children:s})}));Xt.displayName=Mt.Root.displayName;const je=g.forwardRef(({className:e,children:t,variant:r,size:s,...u},o)=>{const n=g.useContext(mu);return a.jsx(Mt.Item,{ref:o,className:c(hu({variant:n.variant||r,size:n.size||s}),e),...u,children:t})});je.displayName=Mt.Item.displayName;const xu=f.forwardRef((e,t)=>{const{options:r,value:s,disabled:u,dir:o,onChange:n}=e,i=l=>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",l===s&&"wu-text-white",u&&s===l&&"wu-text-gray-lead","wu-switcher-icon-tab-item");return a.jsx(a.Fragment,{children:a.jsxs(Xt,{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:i("opt1"),children:r[0].label}),a.jsx(je,{value:"opt2",className:i("opt2"),children:r[1].label})]})})});xu.displayName="_IconTab";const yu=f.forwardRef((e,t)=>{const{options:r,value:s,disabled:u,dir:o,size:n="md",onChange:i}=e,l=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(Xt,{ref:t,type:"single",value:s,onValueChange:i,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:l("opt1"),children:a.jsx("div",{className:"wu-min-w-16 wu-max-w-[136px] wu-overflow-hidden wu-text-ellipsis wu-text-nowrap",children:r[0].label})}),a.jsx(je,{value:"opt2",className:l("opt2"),children:a.jsx("div",{className:"wu-min-w-16 wu-max-w-[136px] wu-overflow-hidden wu-text-ellipsis wu-text-nowrap",children:r[1].label})})]})})});yu.displayName="_Tab";const vu=f.forwardRef((e,t)=>{const{options:r,value:s,disabled:u,dir:o,onChange:n}=e,i=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"),l=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(Xt,{ref:t,type:"single",value:s,disabled:u,dir:o,className:l,onValueChange:n,children:[a.jsx(je,{value:"opt1",className:i("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:i("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})})]})})});vu.displayName="_Toggle";const Nu=f.forwardRef((e,t)=>{const{type:r,options:s,value:u,disabled:o,dir:n,size:i,onChange:l,toggle:w=!0,...d}=e,[p,b]=f.useState(),x=h=>{let m=p;h!==""?m=h:w&&(m=p==="opt1"?"opt2":"opt1");const N=m==="opt1"?s[0].value:s[1].value;l&&l(N),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(vu,{...d,ref:t,options:s,value:p||"opt1",onChange:x,disabled:o,dir:n});case"iconTab":return a.jsx(xu,{ref:t,options:s,value:p||"opt1",onChange:x,disabled:o,dir:n});default:return a.jsx(yu,{ref:t,options:s,value:p||"opt1",onChange:x,disabled:o,dir:n,size:i})}});Nu.displayName="WuSwitcher";const Su=ze.Root,Ka=g.forwardRef(({className:e,children:t,...r},s)=>a.jsx(ze.List,{className:c("wu-relative wu-flex",e),...r,ref:s,children:t}));Ka.displayName=ze.List.displayName;const Ja=g.forwardRef(({className:e,...t},r)=>a.jsx(ze.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}));Ja.displayName=ze.Trigger.displayName;const Cu=g.forwardRef(({className:e,...t},r)=>a.jsx(ze.Content,{ref:r,className:e,...t}));Cu.displayName=ze.Content.displayName;const Eu=({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","wu-tab-content-container"),children:e.map(s=>a.jsx(Cu,{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))})},Xi=e=>{const[t,r]=f.useState(!1),[s,u]=f.useState(!1),o=()=>{const i=e.current;i&&(r(i.scrollLeft>0),u(i.scrollLeft+i.clientWidth<i.scrollWidth))};return f.useEffect(()=>{const i=e.current;return o(),i&&i.addEventListener("scroll",o),window.addEventListener("resize",o),()=>{i&&i.removeEventListener("scroll",o),window.removeEventListener("resize",o)}},[e]),{showLeftArrow:t,showRightArrow:s,scrollByTab:i=>{const l=e.current;if(l){const w=(i==="right"?l.clientWidth:-l.clientWidth)*.8;l.scrollBy({left:w,behavior:"smooth"})}}}},Tu=(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 l=o.querySelector('[data-state="active"]');if(l){const w={width:u?2:l.offsetWidth,left:u?0:l.offsetLeft,height:u?l.offsetHeight:1,top:u?l.offsetTop:0};s(w)}},i=new MutationObserver(n);return i.observe(o,{attributes:!0,subtree:!0}),n(),()=>{i.disconnect()}}},[e,u]),r},Zi=({items:e,value:t,defaultValue:r,onValueChange:s,enableAnimation:u=!1,className:o,dir:n="ltr",position:i="top"})=>{var C;const l=f.useRef(null),w=Tu(l,"horizontal"),{showLeftArrow:d,showRightArrow:p,scrollByTab:b}=Xi(l),[x,h]=f.useState(!1),m=()=>b("left"),N=()=>b("right"),E=v=>a.jsx("div",{"data-testid":`gradient-overlay-${v}`,className:c("wu-absolute wu-top-0 wu-h-full wu-w-20 wu-z-10 wu-pointer-events-none",v==="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=(v,k,D)=>{const T=k==="left";return a.jsx("button",{onClick:v,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",D&&"wu-translate-x-0 wu-opacity-100",!D&&[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(Su,{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",i==="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:()=>h(!0),onMouseLeave:()=>h(!1),"aria-label":"tablistWrapper",children:[d&&x&&E("left"),y(m,"left",d&&x),a.jsxs(Ka,{ref:l,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(v=>a.jsx(Ja,{value:v.value,children:v.Trigger},v.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:i==="bottom"?void 0:0,top:i==="bottom"?0:void 0}})]}),p&&x&&E("right"),y(N,"right",p&&x)]}),a.jsx(Eu,{items:e,enableAnimation:u})]})},Qi=e=>{const[t,r]=f.useState(!1),[s,u]=f.useState(!1),o=()=>{const i=e.current;i&&(r(i.scrollTop>0),u(i.scrollTop+i.clientHeight<i.scrollHeight))};return f.useEffect(()=>{const i=e.current;if(i)return o(),i.addEventListener("scroll",o),window.addEventListener("resize",o),()=>{i.removeEventListener("scroll",o),window.removeEventListener("resize",o)}},[e]),{showTopArrow:t,showBottomArrow:s,scrollByTab:i=>{const l=e.current;if(l){const w=(i==="down"?l.clientHeight:-l.clientHeight)*.8;l.scrollBy({top:w,behavior:"smooth"})}}}},Ri=({items:e,value:t,defaultValue:r,onValueChange:s,enableAnimation:u=!1,className:o,dir:n="ltr",position:i="left"})=>{var C;const l=f.useRef(null),w=Tu(l,"vertical"),{showTopArrow:d,showBottomArrow:p,scrollByTab:b}=Qi(l),[x,h]=f.useState(!1),m=()=>b("up"),N=()=>b("down"),E=v=>a.jsx("div",{className:c("wu-absolute wu-left-0 wu-w-full wu-h-12 wu-z-10 wu-pointer-events-none",v==="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=(v,k,D)=>{const T=k==="up";return a.jsx("button",{onClick:v,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",D&&"wu-translate-y-0 wu-opacity-100",!D&&[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(Su,{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",i==="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:()=>h(!0),onMouseLeave:()=>h(!1),"aria-label":"tablistWrapper",children:[d&&x&&E("top"),y(m,"up",d&&x),a.jsxs(Ka,{ref:l,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(v=>a.jsx(Ja,{value:v.value,children:v.Trigger},v.value)),a.jsx("span",{className:"wu-absolute wu-bg-blue-p wu-transition-all wu-duration-300 wu-indicator",style:{width:2,left:i==="left"?0:void 0,right:i==="right"?0:void 0,height:w.height,top:w.top}})]}),p&&x&&E("bottom"),y(N,"down",p&&x)]}),a.jsx(Eu,{items:e,enableAnimation:u})]})},ec=({...e})=>e.orientation==="vertical"?a.jsx(Ri,{...e}):a.jsx(Zi,{...e}),Xa=g.forwardRef(({className:e,...t},r)=>a.jsx("table",{ref:r,className:c("wu-w-full wu-caption-bottom wu-text-sm",e),...t}));Xa.displayName="Table";const Iu=g.forwardRef(({className:e,...t},r)=>a.jsx("thead",{ref:r,className:c("[&_tr]:wu-border-b",e),...t}));Iu.displayName="TableHeader";const ku=g.forwardRef(({className:e,...t},r)=>a.jsx("tbody",{ref:r,className:c("",e),...t}));ku.displayName="TableBody";const tc=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}));tc.displayName="TableFooter";const St=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}));St.displayName="TableRow";const Za=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}));Za.displayName="TableHead";const Zt=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}));Zt.displayName="TableCell";const Qa=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}));Qa.displayName="TableCaption";const ac=({columns:e,rowSelection:t})=>{const r=(t==null?void 0:t.isEnabled)??!1,s=(t==null?void 0:t.size)??48,{onRowSelect:u,rowUniqueKey:o}=t||{},n=f.useCallback(l=>w=>{u(()=>w?l:[])},[u]);return{finalColumns:f.useMemo(()=>r?[{id:"select",header:({table:l})=>{const w=l.getRowModel().rows.map(p=>p.original),d=n(w);return a.jsx(Ee,{checked:l.getIsSomeRowsSelected()||l.getIsAllRowsSelected(),partial:l.getIsSomeRowsSelected()&&!l.getIsAllRowsSelected(),onChange:p=>{l.toggleAllRowsSelected(!!p),d(!!p)},"aria-label":"Select all","data-testid":l.getIsSomeRowsSelected()&&!l.getIsAllRowsSelected()?"select-partial":"select-all"})},cell:({row:l})=>a.jsx(Ee,{checked:l.getIsSelected(),onChange:w=>{l.toggleSelected(!!w)},"aria-label":String(l.original[o])}),enableSorting:!1,filterable:!1,accessorKey:"select",size:s},...e]:e,[e,r,n])}};function Du({data:e,columns:t,rowSelection:r}){const{finalColumns:s}=ac({columns:t,rowSelection:r}),u=f.useMemo(()=>{if(!(r!=null&&r.isEnabled))return{};const o={};for(const n of r.selectedRows){const i=e.findIndex(l=>l[r.rowUniqueKey]===n[r.rowUniqueKey]);i!==-1&&(o[i]=!0)}return o},[e,r]);return{finalColumns:s,rowSelectionState:u}}const Mu=({table:e,size:t,NoDataContent:r,isLoading:s,CustomLoader:u})=>{var i;const[o,n]=f.useState(null);return a.jsx(ku,{children:s?a.jsx(St,{children:a.jsx(Zt,{colSpan:e.getAllColumns().length,className:"wu-text-center wu-h-[35vh] wu-loader-container",children:u||a.jsx(Re,{className:"wu-w-full"})})}):(i=e.getRowModel().rows)!=null&&i.length?e.getRowModel().rows.map((l,w)=>a.jsx(St,{"data-state":l.getIsSelected()&&"selected",onMouseOver:()=>n(l.id),onMouseOut:()=>n(null),className:c("wu-transition-colors wu-border-b wu-border-black/[12%]",l.getIsSelected()?o===l.id?"wu-bg-blue-p/[16%]":"wu-bg-blue-p/[8%]":"hover:wu-bg-black/[2%]"),children:l.getVisibleCells().map((d,p)=>a.jsx(Zt,{className:c("wu-py-0 wu-font-light 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===l.id&&d.column.id==="actions"?"wu-opacity-100 wu-visible":""),children:De.flexRender(d.column.columnDef.cell,d.getContext())},`${d.id}-${p}`))},`${l.id}-${w}`)):a.jsx(St,{children:a.jsx(Zt,{colSpan:e.getAllColumns().length,children:r})})})},_u=({table:e,sortableColumns:t,manual:r=!1,onSort:s,size:u,isRowSelected:o,HeaderAction:n,isStickyHeader:i})=>{const l=u==="compact"?"wu-h-8":"wu-h-10",w=d=>{const{id:p,columnDef:b,getIsSorted:x,toggleSorting:h}=d,{header:m}=b;if(!t.includes(p))return m;const N=x(),E=N==="asc",y=N==="desc",C=()=>{r?(h(!y),s==null||s({id:p,desc:y})):h(d.getIsSorted()==="asc")};return a.jsxs("button",{onClick:C,"aria-label":`Sort by ${m}`,className:"wu-flex wu-items-center wu-gap-4",children:[m,a.jsxs("div",{className:"wu-relative",children:[a.jsx("span",{className:c("wu-absolute -wu-top-[15px] wm-arrow-drop-down wu-text-xl",E&&"wu-hidden",!N&&"-wu-top-[11px]")}),a.jsx("span",{className:c("wu-absolute -wu-bottom-[13px] wm-arrow-drop-up wu-text-xl",y&&"wu-hidden",!N&&"-wu-bottom-[10px]")})]})]})};return a.jsxs(Iu,{className:c("wu-border-t wu-border-black/[12%] wu-bg-gray-20 wu-relative",i&&"wu-sticky wu-top-[-.5px] wu-z-10",l),children:[e.getHeaderGroups().map(d=>a.jsx(St,{className:"wu-relative",children:d.headers.map(p=>p.column.id==="actions"?a.jsx(Za,{colSpan:p.colSpan,className:"wu-text-xs wu-font-medium",style:{width:`${p.getSize()}px`}},p.id):a.jsx(Za,{colSpan:p.colSpan,className:c("wu-text-xs wu-font-medium wu-bg-[#EEEEEE]","wu-relative wu-z-0"),style:{width:`${p.getSize()}px`},children:De.flexRender(w(p.column),p.getContext())},p.id))},d.id)),o&&n&&a.jsxs("div",{className:c("wu-absolute wu-top-[-1px] wu-left-0 wu-right-0 wu-flex wu-items-center wu-border-b wu-border-t wu-bg-gray-20 wu-z-10",l),children:[a.jsx("div",{className:"wu-flex wu-items-center wu-px-4",style:{width:e.getVisibleLeafColumns()[0].getSize()},children:a.jsx(Ee,{checked:e.getIsSomeRowsSelected()||e.getIsAllRowsSelected(),partial:e.getIsSomeRowsSelected()&&!e.getIsAllRowsSelected(),onChange:d=>{e.toggleAllRowsSelected(!!d)},"aria-label":"Select all"})}),a.jsx("div",{className:"wu-flex-1 wu-flex wu-pr-4",children:n})]})]})},Au=Se.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"}}}),rc=({data:e,columns:t,isLoading:r=!1,variant:s="unstyled",sort:u,size:o,rowSelection:n,HeaderAction:i,NoDataContent:l,stickyHeader:w=!1,CustomLoader:d,caption:p,...b})=>{var C;const{finalColumns:x,rowSelectionState:h}=Du({data:e,columns:t,rowSelection:n}),m=f.useMemo(()=>x.filter(v=>v.enableSorting).map(v=>v.accessorKey),[x]),N=((C=n==null?void 0:n.selectedRows)==null?void 0:C.length)??0,E=v=>{if(typeof v=="function"){const k=v(h),D=Object.keys(k).filter(T=>k[Number(T)]).map(T=>e[Number(T)]);n==null||n.onRowSelect(D)}},y=De.useReactTable({data:e,columns:x,getCoreRowModel:De.getCoreRowModel(),getPaginationRowModel:De.getPaginationRowModel(),manualPagination:!0,manualSorting:!0,manualFiltering:!0,enableRowSelection:n==null?void 0:n.isEnabled,state:{...n!=null&&n.isEnabled?{rowSelection:h}:{}},onRowSelectionChange:E});return a.jsxs("div",{className:c("wu-text-gray-lead wu-table-container wu-relative"),children:[p&&a.jsx(Qa,{className:"wu-font-light",children:p}),a.jsxs(Xa,{...b,className:c(Au({variant:s}),b.className),children:[a.jsx(_u,{table:y,sortableColumns:m,manual:!0,onSort:u==null?void 0:u.onSort,size:o,HeaderAction:i,isRowSelected:N>0,isStickyHeader:w}),!r&&a.jsx(Mu,{table:y,size:o,NoDataContent:l,CustomLoader:d})]}),r&&a.jsx("div",{className:"wu-flex wu-items-center wu-justify-center wu-h-96",children:a.jsx(Re,{})})]})},sc=({data:e,columns:t,variant:r="unstyled",size:s="default",sort:u,filterText:o,pagination:n,stickyHeader:i,HeaderAction:l,CustomLoader:w,NoDataContent:d,isLoading:p,caption:b,rowSelection:x,...h})=>{var O;const[m,N]=f.useState((u==null?void 0:u.initial)||[]),[E,y]=f.useState([]),[C,v]=f.useState((n==null?void 0:n.pageIndex)??0),{finalColumns:k,rowSelectionState:D}=Du({data:e,columns:t,rowSelection:x}),T=f.useMemo(()=>k.filter(A=>A.enableSorting).map(A=>A.accessorKey),[k]),_=f.useMemo(()=>k.filter(A=>A.filterable).map(A=>A.accessorKey),[k]),M=((O=x==null?void 0:x.selectedRows)==null?void 0:O.length)??0,L=A=>{const F=typeof A=="function"?A(D):A,q=Object.keys(F).filter(W=>F[Number(W)]).map(W=>e[Number(W)]);x==null||x.onRowSelect(q)},P=De.useReactTable({data:e,columns:k,getCoreRowModel:De.getCoreRowModel(),getFilteredRowModel:De.getFilteredRowModel(),getSortedRowModel:De.getSortedRowModel(),getPaginationRowModel:n?De.getPaginationRowModel():void 0,state:{sorting:m,columnFilters:E,...n?{pagination:n}:{},...x!=null&&x.isEnabled?{rowSelection:D}:{}},onSortingChange:N,onColumnFiltersChange:y,onRowSelectionChange:L});return f.useEffect(()=>{_.forEach(A=>{var F;(F=P.getColumn(A))==null||F.setFilterValue(o)})},[o,_,P]),f.useEffect(()=>{n&&(n==null?void 0:n.pageIndex)!==C&&(x==null||x.onRowSelect(()=>[]),P.resetRowSelection(),v(n.pageIndex))},[n==null?void 0:n.pageIndex]),a.jsx("div",{className:"wu-text-gray-lead wu-table-container wu-relative",children:a.jsxs(Xa,{...h,className:c("wu-overflow-x-auto wu-w-full",Au({variant:r}),"wu-table-fixed",h.className),children:[b&&a.jsx(Qa,{children:b}),a.jsx(_u,{table:P,sortableColumns:T,size:s,HeaderAction:l,isRowSelected:M>0,isStickyHeader:i}),a.jsx(Mu,{table:P,size:s,NoDataContent:d,CustomLoader:w,isLoading:p})]})})},Wu=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}));Wu.displayName="Textarea";const Pu=f.forwardRef((e,t)=>{const{Label:r,id:s=_t(),variant:u="flat",readonly:o,maxLength:n,labelPosition:i="top",...l}=e,w=p=>{l.onChange&&l.onChange(p)},d=ft(i);return a.jsxs("div",{className:c(d,"wu-flex wu-textarea-container"),dir:l.dir,children:[a.jsx(Wu,{...l,ref:t,id:s,className:c("wu-peer wu-rounded-t-sm",u==="outlined"?"wu-border wu-border-gray-subtle":"",l.className),onChange:w,readOnly:o,maxLength:n}),r&&a.jsx(be,{htmlFor:s,className:"wu-textarea-label",children:r})]})});Pu.displayName="WuTextarea";function uc(e){if(typeof e=="string"&&e.includes("T")){const t=H.parseISO(e);return H.format(t,"HH:mm")}if(typeof e=="string"&&/^\d{2}:\d{2}:\d{2}$/.test(e)){const t=H.parse(e,"HH:mm:ss",new Date);return H.format(t,"HH:mm")}return typeof e=="string"&&/^\d{2}:\d{2}$/.test(e)?e:"00:00"}const Lu=["12",...Array.from({length:11},(e,t)=>String(t+1).padStart(2,"0"))],Ou=Array.from({length:60},(e,t)=>String(t).padStart(2,"0")),Fu=["am","pm"],Qt=50;function oc(e){return Array(Qt).fill(e).flat()}function Ra(e,t){const r=e.indexOf(t);return[...e.slice(r),...e.slice(0,r)]}function nc(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 Bu(e){const t=Number(e),r=t>=12?"pm":"am",s=t%12===0?12:t%12;return{hour:String(s),meridiem:r}}const lc=({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}),er=({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?oc(e):e).map((n,i)=>a.jsx(lc,{value:n,isSelected:n===t,onClick:()=>s(n)},`${n}-${i}`))});function ic(e,t,r,s){const u=f.useMemo(()=>e?Ra(Lu,t.padStart(2,"0")):Lu,[e]),o=f.useMemo(()=>e?Ra(Ou,r.padStart(2,"0")):Ou,[e]),n=f.useMemo(()=>e?Ra(Fu,s):Fu,[e]);return{rotatedHours:u,rotatedMinutes:o,rotatedMeridiem:n}}function cc(e,t,r){f.useEffect(()=>{function s(n){if(n){const i=n.scrollHeight/Qt,l=Math.floor(Qt/2);n.scrollTop=l*i;const w=()=>{const{scrollTop:d}=n,p=Math.round(d/i);(p<=1||p>=Qt-2)&&(n.scrollTop=l*i)};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 qu=({className:e,time:t,Label:r,labelPosition:s,dir:u,...o})=>{const[n,i]=f.useState(!1),[l,w]=f.useState(""),d=f.useRef(null),p=f.useRef(null),b=f.useRef(null),x=f.useRef(null),[h,m]=f.useState("12"),[N,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 _=uc(t);w(_);const[M,L]=_.split(":"),{hour:P,meridiem:O}=Bu(M);m(P),E(L),C(O),d.current&&(d.current.value=_)},[t]),f.useEffect(()=>{const _=M=>{p.current&&!p.current.contains(M.target)&&i(!1)};return document.addEventListener("mousedown",_),()=>{document.removeEventListener("mousedown",_)}},[]),cc(n,b,x);const{rotatedHours:v,rotatedMinutes:k,rotatedMeridiem:D}=ic(n,h,N,y),T=f.useCallback((_,M,L)=>{const P=_??h,O=M??N,A=L??y;m(P),E(O),C(A);const F=`${nc(P,A)}:${O}`;w(F)},[h,N,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(He,{ref:d,type:"time",value:l,variant:"flat",role:"textbox",onChange:_=>{w(_.target.value);const[M,L]=_.target.value.split(":"),{hour:P,meridiem:O}=Bu(M);m(P),E(L),C(O)},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(Le,{icon:"wm-schedule",className:"wu-text-base",onClick:()=>i(_=>!_),"data-testid":"wu-timepicker-icon"}),iconPosition:"right",dir:u,...o}),a.jsx("style",{children:`
4
+ )`;w.style.setProperty("--spotlight-background",E)})};return window.addEventListener("mousemove",b),()=>{window.removeEventListener("mousemove",b),p&&cancelAnimationFrame(p)}}},[t,r,u,n]),a.jsx("div",{ref:l,className:c(Wn.gradientBackground,"wu-transform-gpu",o),...i,children:s})},Qr="calc(100vh - 64px)",Pn={sm:"400px",md:"600px",lg:"1200px"},Ln=({Trigger:e,children:t,size:r="md",hideCloseButton:s,preventClickOutside:o,onOpenChange:u,open:n,dir:i,maxWidth:l,maxHeight:w,className:d,style:p,variant:b="action",...x})=>{const m={action:["#EEF3FBcc 32%","#1D50F4cc"],upgrade:["#FDEDCCcc 32%","#FF9F00cc"],critical:["#FFB6B6cc 32%","#CC0000cc"]};return a.jsxs(Gr,{modal:!0,onOpenChange:u,open:n,children:[e&&a.jsx(Yr,{asChild:!0,children:e}),a.jsxs(Ca,{style:{width:"calc(100% - 64px)",maxWidth:l||Pn[r],maxHeight:w||Qr,...p},hideCloseButton:s,onInteractOutside:h=>o&&h.preventDefault(),dir:i,"aria-describedby":void 0,"data-variant":b,className:c("wu-group wuexp:wu-rounded-[1.1rem]",d),...x,children:["data-theme"in x&&a.jsx(Zr,{colors:m[b],strokeWidth:4,className:c("wuexp:wu-rounded-[1.1rem] wu-transform-gpu wu-flex wu-flex-col",d),style:{maxHeight:w||Qr},children:t}),!("data-theme"in x)&&t]})]})},On=({children:e,className:t,...r})=>a.jsx("div",{className:c("wu-flex wu-flex-col wu-gap-4 wu-p-4 rtl:wu-text-right wu-overflow-auto wu-bg-white","wuexp:wu-p-8 wuexp:wu-text-gray-lead",t),...r,children:e}),Fn=({children:e,className:t,...r})=>a.jsx(Ea,{...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(Xr,{className:"wuexp:wu-font-normal wuexp:wu-justify-start wuexp:wu-text-2xl wuexp:wu-h-14",children:e})}),Bn=({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}),qn=({children:e,className:t,...r})=>{const s=f.useRef(null);return a.jsx(_n,{asChild:!0,children:a.jsx(me,{className:t,ref:s,...r,children:e})})},Vn=({placeholder:e="Select...",value:t,multiple:r=!1,accessorKey:s,variant:o="flat",dir:u="ltr",customTriggerChildren:n,id:i,disabled:l,selectAll:w,isCheckedAll:d,width:p,...b})=>{const[x,m]=f.useState(""),[h,N]=f.useState(e);f.useEffect(()=>{if(!t||Array.isArray(t)&&t.length===0){N(e),m("");return}const y=s.label;if(r&&Array.isArray(t)){const S=t.map(v=>v[y]).join(", ");m(S)}else!r&&!Array.isArray(t)&&m(t[y])},[t,s.label,r,e]);const E=()=>e&&!x?a.jsx("p",{className:"wu-text-xs wu-opacity-70",children:h}):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)??x:x});return a.jsx(Mr,{asChild:!0,dir:u,id:i,disabled:l,children:a.jsxs("button",{...b,disabled:l,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",o==="outlined"&&"wu-border wu-border-gray-subtle","wu-group/wuSelect wu-select-trigger",b.className),children:[n??E(),a.jsx("span",{className:"wm-arrow-drop-down group-data-[state=open]/wuSelect:wu-rotate-180 wu-transition-transform wu-duration-300 wu-text-base"})]})})},Rr=({option:e,value:t,multiple:r=!1,onSelect:s,accessorKey:o,dir:u="ltr"})=>{const[n,i]=f.useState(r?[]:"");f.useEffect(()=>{t&&i(r?t.map(p=>JSON.stringify(p[o.value])):JSON.stringify(t[o.value]))},[t,o.value,r]);const l=r?n.includes(JSON.stringify(e[o.value])):n===JSON.stringify(e[o.value]),w=d=>{e.disabled||(s(e),r&&d.preventDefault())};return a.jsxs(Pt,{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",l&&"wu-bg-gray-10"),dir:u,children:[r&&a.jsx(Ce,{checked:l}),a.jsx(es,{option:e,accessorKey:o})]})},es=({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"})]})},ts=e=>{const{option:t,handleSelectAll:r,isCheckedAll:s,isPartialSelected:o,...u}=e;switch("type"in t?t.type:"option"){case"all":return a.jsxs(Pt,{onSelect:i=>{i.stopPropagation(),i.preventDefault(),r==null||r()},className:c("wu-cursor-pointer wu-text-xs wu-py-2 wu-leading-4 wu-select-item"),dir:u.dir,children:[a.jsx(Ce,{"data-partial":o,checked:s||o,partial:o}),a.jsx(es,{option:t,accessorKey:u.accessorKey})]});case"group":return a.jsxs(_r,{dir:u.dir,children:[a.jsx(bt,{className:"wu-text-xs",children:t.label}),t.options.map((i,l)=>f.createElement(Rr,{...u,option:i,key:l}))]});case"divider":return a.jsx(Lt,{className:"wu-mx-4"});default:return a.jsx(Rr,{...u,option:t})}},zn=e=>{let t=0,r=0;const s=[],o=[],u=n=>{n.type==="divider"?t++:n.type==="group"?(r++,n.options.forEach(i=>{u(i)})):(s.push(n),n.disabled||o.push(n))};return e.forEach(n=>{u(n)}),{separators:t,groups:r,enabledOptions:o,totalData:s.length,cleanData:s}},Hn=100,$n=400,as=({data:e,onSelect:t,multiple:r=!1,defaultValue:s,value:o,accessorKey:u,variant:n="flat",dir:i="ltr",placeholder:l,Label:w,virtualizedThreshold:d=Hn,maxHeight:p=$n,hasGroup:b=!1,Header:x,CustomTrigger:m,selectAll:h,disabled:N,labelPosition:E="top",onScroll:y,maxContentWidth:S,...v})=>{const[I,k]=f.useState(),T=f.useRef(null),[M,A]=f.useState(!1),[F,_]=f.useState(!1),{cleanData:L,enabledOptions:W}=b||h!=null&&h.enable?zn(e):{cleanData:e,enabledOptions:[]},O=f.useMemo(()=>r&&h!=null&&h.enable&&e.length>0?[{type:"all",[u.label]:h.label||"Select All"},...e]:e,[e,h,r]),B=f.useCallback(q=>{const V=q[u.value];if(r)k((ie=[])=>{const K=ie,se=K.some(te=>te[u.value]===V)?K.filter(te=>te[u.value]!==V):[...K,q];return t==null||t(se),se});else{const ie=q;k(ie),t==null||t(ie)}},[r,u.value,t]);f.useEffect(()=>{if(s&&o){console.error("defaultValue and value cannot be used simultaneously");return}!s&&!o&&k(void 0),s!==void 0&&k(s),o!==void 0&&k(o)},[s,o]);const P=O.length>d;f.useEffect(()=>{if(!r)return;const q=h!=null&&h.includeDisabled?(I==null?void 0:I.length)===e.length:(I==null?void 0:I.length)===W.length;A(q);const V=(I==null?void 0:I.length)>0&&!q;_(V)},[I,h]);const U=f.useCallback(()=>{const q=M?[]:h!=null&&h.includeDisabled?b?L:e:W;k(q),t==null||t(q)},[M,r,e,W,t,h]),Y=dt(E);return a.jsxs("div",{className:c(Y,"wu-flex wu-select-container"),ref:T,dir:i,children:[a.jsxs(Dr,{children:[a.jsx(Vn,{...v,value:I,multiple:r,variant:n,dir:i,placeholder:l,accessorKey:u,customTriggerChildren:m,id:v.id,disabled:N,selectAll:h,isCheckedAll:M}),a.jsxs(xa,{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:v.id,style:{maxWidth:S},children:[x,P?a.jsx(et,{list:O,containerHeight:p,callback:(q,V)=>a.jsx(ts,{option:V,accessorKey:u,multiple:r,onSelect:B,value:I,dir:i,handleSelectAll:U,isCheckedAll:M,isPartialSelected:F}),dir:i}):a.jsx("div",{onScroll:y,style:{maxHeight:p,height:"fit-content",overflow:"auto"},className:"wu-select-list",children:O.map((q,V)=>a.jsx(ts,{option:q,accessorKey:u,multiple:r,onSelect:B,value:I,handleSelectAll:U,isCheckedAll:M,dir:i,isPartialSelected:F},`${V}`))})]})]}),w&&a.jsx(be,{htmlFor:v.id,className:"wu-select-label",children:w})]})},Ot=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Un=({value:e,onChange:t,min:r=H.sub(new Date,{years:5}),max:s=H.add(new Date,{years:1}),placeholder:o="Select a month",Label:u,labelPosition:n="top",disabled:i,id:l,readonly:w,disabledMonths:d=[],...p})=>{const[b,x]=f.useState(null),[m,h]=f.useState(""),[N,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 v=new Date(r).getFullYear(),I=new Date(s).getFullYear();return Array.from({length:I-v+1},(k,T)=>({value:I-T,label:I-T}))},[r,s]);f.useEffect(()=>{if(e){const v=new Date(e),I=v.getFullYear(),k=v.getMonth();x({year:I,month:k}),h(`${Ot[k]} ${I}`),E({value:I,label:I})}},[e]);const S=()=>{b&&t&&(t(new Date(b.year,b.month,15)),h(`${Ot[b.month]} ${b.year}`))};return a.jsxs("div",{className:c("wu-flex wu-flex-col wu-items-center",dt(n),n==="top"&&"wu-items-start"),children:[a.jsxs(ke,{children:[a.jsx(pa,{...p,disabled:i||w,id:l,dir:"ltr",placeholder:o,formattedString:m}),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(as,{data:y,accessorKey:{value:"value",label:"label"},value:N,onSelect:v=>E(v),multiple:!1,maxHeight:224})}),a.jsx(jn,{year:N==null?void 0:N.value,selectedMonth:b==null?void 0:b.month,selectedYear:b==null?void 0:b.year,onClick:(v,I)=>x({year:I,month:v}),disabledMonths:d}),a.jsx("div",{className:"wu-flex wu-justify-end wu-px-0.5",children:a.jsx(lt.PopoverClose,{asChild:!0,children:a.jsx(me,{onClick:S,children:"Apply"})})})]})]}),u&&a.jsx(be,{className:"wu-truncate wu-max-w-[120px] wu-min-w-fit wu-select-label",children:u})]})},jn=({year:e,selectedMonth:t,selectedYear:r,onClick:s,disabledMonths:o=[]})=>{const u=new Date,n=u.getFullYear(),i=u.getMonth(),l=f.useMemo(()=>{const w=new Set;return o.forEach(d=>{const p=typeof d=="string"?new Date(d):d;w.add(`${p.getFullYear()}-${p.getMonth()}`)}),w},[o]);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:Ot.map((w,d)=>{const p=e===n&&d===i,b=t===d&&r===e;return a.jsx("button",{disabled:l.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":`${Ot[d]} ${e}`,"data-month":d,"data-year":e,children:w},w)})})},rs=(e,t,r,s=96)=>{if(e.length===0||s<=0)return[[],[]];const[u,n]=f.useState([]),[i,l]=f.useState([]);return f.useEffect(()=>{const w=()=>{var m,h;const d=((m=t.current)==null?void 0:m.clientWidth)||0,p=((h=r.current)==null?void 0:h.clientWidth)||0,b=d-p,x=Math.floor(b/s);n(e.slice(0,x)),l(e.slice(x))};return w(),window.addEventListener("resize",w),()=>{window.removeEventListener("resize",w)}},[e,s]),[u,i]},ss={wuPrimaryLink:"_wuPrimaryLink_1sy3v_1",wuPrimaryPopoverContent:"_wuPrimaryPopoverContent_1sy3v_8"},Gn=e=>{const{Links:t,children:r,className:s,...o}=e,u=f.useMemo(()=>t.map((d,p)=>f.cloneElement(d,{className:c(ss.wuPrimaryLink,d.props.className,"wu-primary-nav-link"),key:p})),[t]),n=f.useRef(null),i=f.useRef(null),[l,w]=rs(u,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-px-2 wu-py-1 wu-bg-white wu-border-b",s),...o,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:l}),w.length>0&&a.jsxs(ke,{children:[a.jsx(He,{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(ss.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:i,children:r}),a.jsxs(ke,{children:[a.jsx(He,{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})]})]})]})})},Ta={wuSecondaryLink:"_wuSecondaryLink_1edl1_1",wuSecondaryNav:"_wuSecondaryNav_1edl1_6"},Yn=e=>{const{Links:t,children:r,className:s,...o}=e,u=f.useMemo(()=>t.map((p,b)=>f.cloneElement(p.link,{key:b,className:c(Ta.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),i=f.useRef(null),l=f.useRef(null),[w,d]=rs(u,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-border-y wu-border-gray-25 wu-h-[50px]",s),...o,ref:n,children:[a.jsxs("div",{className:"wu-flex wu-items-center wu-justify-start wu-gap-2",children:[a.jsx("nav",{className:c(Ta.wuSecondaryNav,"wu-flex wu-items-center wu-justify-start wu-w-full wu-h-full wu-secondary-nav-left"),ref:i,children:w}),d.length>0&&a.jsxs(ke,{children:[a.jsx(He,{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(Ta.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:l,children:r}),a.jsxs(ke,{children:[a.jsx(He,{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})]})]})]})})},os=f.forwardRef(({totalRows:e,initialPage:t=0,initialPageSize:r=100,onPageChange:s,className:o,disabled:u=!1,...n},i)=>{const[l,w]=f.useState(t),[d,p]=f.useState(r);f.useEffect(()=>{w(t),p(r)},[t,r]);const b=Math.ceil(e/d),x=l*d+1,m=Math.min((l+1)*d,e),h=Array.from({length:b},(y,S)=>S),N=f.useCallback(y=>{y>=0&&y<b&&(w(y),s==null||s(y))},[b,s]),E=224;return a.jsxs("div",{className:c("wu-flex wu-items-center wu-gap-[2px]",o,"wu-pagination"),...n,role:"navigation",children:[a.jsx(us,{label:"Previous page",onClick:()=>N(l-1),disabled:l===0||u,icon:"wm-arrow-back-ios-new",className:"hover:wu-bg-gray-20 rtl:wu-rotate-180 wu-prev-btn"}),a.jsx(Ur,{name:`${x} - ${m}`,className:"wu-w-[96px] wu-min-w-[96px] wu-pagination-menu",align:"end",disabled:u,children:a.jsx(tt,{style:{maxHeight:E+"px"},dir:n.dir,children:h.length>100?a.jsx(et,{className:"wu-pagination-list",containerHeight:E,list:h,callback:(y,S)=>a.jsxs(va,{onSelect:()=>N(S),className:c("wu-py-2",S===l&&"wu-bg-gray-20","wu-pagination-item"),children:[S*d+1," -"," ",Math.min((S+1)*d,e)]},y)}):h.map(y=>a.jsxs(va,{onSelect:()=>N(y),className:c(y===l&&"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(us,{label:"Next page",onClick:()=>N(l+1),disabled:l===b-1||u,icon:"wm-arrow-forward-ios",className:"hover:wu-bg-gray-20 rtl:wu-rotate-180 wu-next-btn"})]})});os.displayName="WuPagination";const us=({label:e,onClick:t,disabled:r,icon:s,className:o})=>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",o),"aria-label":e,children:a.jsx("span",{className:c("wu-text-sm",s)})}),Kn=({Trigger:e,children:t,className:r,dir:s,open:o,onOpenChange:u,modal:n,...i})=>a.jsxs(ke,{open:o,onOpenChange:u,modal:n,children:[a.jsx(He,{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,...i,children:t})]}),Jn=e=>a.jsx(lt.PopoverClose,{asChild:!0,children:a.jsx(me,{...e})}),ns=g.forwardRef(({className:e,...t},r)=>a.jsx(wt.Root,{className:c("wu-grid wu-gap-2",e),...t,ref:r}));ns.displayName=wt.Root.displayName;const ls=g.forwardRef(({className:e,...t},r)=>a.jsx(wt.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(wt.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"})})}));ls.displayName=wt.Item.displayName;const is=f.forwardRef((e,t)=>{const{options:r,defaultValue:s,onChange:o,label:u,dir:n,...i}=e;return a.jsxs(ns,{defaultValue:s,required:i.required,disabled:i.disabled,onValueChange:o,id:i.id,dir:n,name:i.name,className:c("w-fit",i.className),ref:t,style:i.style,children:[a.jsx(_t,{htmlFor:i.id,className:"wu-text-sm wu-font-normal wu-text-gray-lead wu-leading-6 wu-radio-group-label",children:u}),r.map(l=>a.jsxs("div",{className:"wu-flex wu-items-center wu-gap-2 wu-radio-item-container",children:[a.jsx(ls,{value:l.value,id:l.value,disabled:l.disabled,required:l.required,"aria-label":l.value,className:"wu-peer wu-radio-item"}),a.jsx(_t,{htmlFor:l.value,className:c(l.required&&"after:wu-content-['*'] after:wu-mx-[2px] after:wu-text-rose-500","wu-radio-item-label"),children:l.label})]},l.value))]})});is.displayName="WuRadioGroup";const Xn=e=>{const{children:t,...r}=e;return a.jsxs(tt,{...r,role:"complementary","aria-label":"ScrollArea",children:[t,a.jsx(Na,{orientation:"horizontal"})]})},cs=g.forwardRef(({className:e,orientation:t="horizontal",decorative:r=!0,...s},o)=>a.jsx(or.Root,{ref:o,decorative:r,orientation:t,className:c("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...s}));cs.displayName=or.Root.displayName;function ws({className:e,...t}){return a.jsx("div",{className:c("animate-pulse rounded-md bg-muted",e),...t})}const Ia=768;function Zn(){const[e,t]=g.useState(void 0);return g.useEffect(()=>{const r=window.matchMedia(`(max-width: ${Ia-1}px)`),s=()=>{t(window.innerWidth<Ia)};return r.addEventListener("change",s),t(window.innerWidth<Ia),()=>r.removeEventListener("change",s)},[]),!!e}const Qn="sidebar_state",Rn=3600*24*7,el="256px",tl="256px",al="3rem",rl="b",ds=g.createContext(null);function $e(){const e=g.useContext(ds);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}const fs=g.forwardRef(({defaultOpen:e=!0,open:t,onOpenChange:r,className:s,style:o,children:u,...n},i)=>{const l=Zn(),[w,d]=g.useState(!1),[p,b]=g.useState(l?!0:e),x=t??p,m=g.useCallback(y=>{const S=typeof y=="function"?y(x):y;r?r(S):b(S),document.cookie=`${Qn}=${S}; path=/; max-age=${Rn}`},[r,x]),h=g.useCallback(()=>l?d(y=>!y):m(y=>!y),[l,m,d]);g.useEffect(()=>{const y=S=>{S.key===rl&&(S.metaKey||S.ctrlKey)&&(S.preventDefault(),h())};return window.addEventListener("keydown",y),()=>window.removeEventListener("keydown",y)},[h]);const N=x?"expanded":"collapsed",E=g.useMemo(()=>({state:N,open:x,setOpen:m,isMobile:l,openMobile:w,setOpenMobile:d,toggleSidebar:h}),[N,x,m,l,w,d,h]);return a.jsx(ds.Provider,{value:E,children:a.jsx(mr,{delayDuration:0,children:a.jsx("div",{style:{"--sidebar-width":el,"--sidebar-width-icon":al,...o},className:c("wu-group/sidebar-wrapper wu-flex wu-min-h-[calc(100svh-48px)] wu-w-full",s),ref:i,...n,children:u})})})});fs.displayName="SidebarProvider";const ps=g.forwardRef(({side:e="left",variant:t="sidebar",collapsible:r="offcanvas",className:s,children:o,...u},n)=>{const{isMobile:i,state:l,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,...u,children:o}):i?a.jsx(Br,{open:w,onOpenChange:d,...u,children:a.jsx(ya,{"data-sidebar":"sidebar","data-mobile":"true",className:"wu-w-[--sidebar-width] wu-bg-blue-sidebar wu-p-0 [&>button]:wu-hidden",style:{"--sidebar-width":tl},side:e,children:a.jsx("div",{className:"wu-flex wu-flex-col wu-w-full wu-h-full",children:o})})}):a.jsxs("div",{ref:n,className:"wu-hidden wu-group wu-peer md:wu-block","data-state":l,"data-collapsible":l==="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-20 wu-hidden wu-h-svh wu-w-[--sidebar-width] wu-transition-[left,right,width] wu-duration-150 wu-ease-linear md:wu-flex",e==="left"?"wu-left-0 group-data-[collapsible=offcanvas]:wu-left-[calc(var(--sidebar-width)*-1)]":"wu-right-0 group-data-[collapsible=offcanvas]:wu-right-[calc(var(--sidebar-width)*-1)]",t==="floating"||t==="inset"?"wu-p-2 group-data-[collapsible=icon]:wu-w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4)_+2px)]":"group-data-[collapsible=icon]:wu-w-[--sidebar-width-icon] group-data-[side=left]:wu-border-r group-data-[side=right]:wu-border-l",s),...u,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:o})})]})});ps.displayName="Sidebar";const bs=g.forwardRef(({className:e,onClick:t,children:r,...s},o)=>{const{toggleSidebar:u}=$e();return a.jsxs(Qe,{ref:o,"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),u()},...s,children:[r,a.jsx("span",{className:"wu-sr-only",children:"Toggle Sidebar"})]})});bs.displayName="SidebarTrigger";const sl=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})});sl.displayName="SidebarRail";const gs=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}));gs.displayName="SidebarInset";const ol=g.forwardRef(({className:e,...t},r)=>a.jsx(wa,{ref:r,"data-sidebar":"input",className:c("wu-h-8 wu-w-full wu-shadow-none focus-visible:wu-ring-2",e),...t}));ol.displayName="SidebarInput";const hs=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}));hs.displayName="SidebarHeader";const ms=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}));ms.displayName="SidebarFooter";const ul=g.forwardRef(({className:e,...t},r)=>a.jsx(cs,{ref:r,"data-sidebar":"separator",className:c("wu-mx-2 wu-w-auto",e),...t}));ul.displayName="SidebarSeparator";const xs=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}));xs.displayName="SidebarContent";const ys=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}));ys.displayName="SidebarGroup";const vs=g.forwardRef(({className:e,asChild:t=!1,...r},s)=>{const o=t?Xe.Slot:"div";return a.jsx(o,{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})});vs.displayName="SidebarGroupLabel";const nl=g.forwardRef(({className:e,asChild:t=!1,...r},s)=>{const o=t?Xe.Slot:"button";return a.jsx(o,{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})});nl.displayName="SidebarGroupAction";const Ns=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}));Ns.displayName="SidebarGroupContent";const ka=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}));ka.displayName="SidebarMenu";const Ss=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}));Ss.displayName="SidebarMenuItem";const ll=Ne.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"}}),Cs=g.forwardRef(({asChild:e=!1,isActive:t=!1,variant:r="default",size:s="default",tooltip:o,className:u,...n},i)=>{const l=e?Xe.Slot:"button",{isMobile:w,state:d}=$e(),p=a.jsx(l,{ref:i,"data-sidebar":"menu-button","data-size":s,"data-active":t,className:c(ll({variant:r,size:s}),u),...n});return o?(typeof o=="string"&&(o={children:o}),a.jsxs(xr,{children:[a.jsx(yr,{asChild:!0,children:p}),a.jsx(da,{side:"right",align:"center",hidden:d!=="collapsed"||w,...o})]})):p});Cs.displayName="SidebarMenuButton";const il=g.forwardRef(({className:e,asChild:t=!1,showOnHover:r=!1,...s},o)=>{const u=t?Xe.Slot:"button";return a.jsx(u,{ref:o,"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})});il.displayName="SidebarMenuAction";const cl=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}));cl.displayName="SidebarMenuBadge";const wl=g.forwardRef(({className:e,showIcon:t=!1,...r},s)=>{const o=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(ws,{className:"wu-rounded-md wu-size-4","data-sidebar":"menu-skeleton-icon"}),a.jsx(ws,{className:"wu-h-4 wu-max-w-[--skeleton-width] wu-flex-1","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":o}})]})});wl.displayName="SidebarMenuSkeleton";const dl=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}));dl.displayName="SidebarMenuSub";const fl=g.forwardRef(({...e},t)=>a.jsx("li",{ref:t,...e}));fl.displayName="SidebarMenuSubItem";const pl=g.forwardRef(({asChild:e=!1,size:t="md",isActive:r,className:s,...o},u)=>{const n=e?Xe.Slot:"a";return a.jsx(n,{ref:u,"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),...o})});pl.displayName="SidebarMenuSubButton";const bl=({children:e,Sidebar:t,className:r,defaultOpen:s=!0,open:o,onOpenChange:u,style:n})=>a.jsxs(fs,{defaultOpen:s,open:o,onOpenChange:u,children:[a.jsxs(ps,{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(hs,{className:"wu-py-2",children:a.jsx(Es,{})}),t]}),a.jsx(gs,{className:"wu-contain-inline-size",children:e})]}),Es=e=>{const{state:t,isMobile:r,openMobile:s}=$e();return a.jsx(bs,{...e,children:a.jsx(Sa,{showMenu:r?s:t==="expanded"})})},gl=({className:e,children:t,...r})=>{const s=f.useRef(null),o=f.useRef(null),u=({currentTarget:i})=>{const{scrollTop:l,clientHeight:w,scrollHeight:d}=i;s.current&&s.current.classList.toggle("wu-border-[#1b338014]",l!==0),o.current&&o.current.classList.toggle("wu-border-[#1b338014]",l+w!==d)},n="wu-w-[calc(100%-16px)] wu-mx-auto wu-border-transparent";return a.jsxs(xs,{...r,className:c("wu-overflow-hidden wu-gap-0",e),children:[a.jsx("hr",{className:n,ref:s}),a.jsx(tt,{onScroll:u,className:"wu-gap-2",thumbColor:"#b9c3dc",railColor:"#00000000","data-testid":"scroll-area",children:t}),a.jsx("hr",{className:n,ref:o})]})},hl=e=>a.jsx(ms,{...e,children:e.children}),ml=({label:e,children:t,...r})=>a.jsxs(ys,{...r,className:"wu-p-0",children:[a.jsx("div",{className:"wu-h-8",children:a.jsx(vs,{className:"wu-items-end wu-px-4 wu-text-xs wu-font-normal wu-leading-4 wu-text-blue-q",children:e})}),a.jsx(Ns,{children:a.jsx(ka,{children:t})})]}),xl=e=>a.jsx(ka,{...e}),yl=({Icon:e,children:t,className:r,isActive:s,...o})=>{const{state:u}=$e(),[n,i]=f.useState(),l=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",u==="collapsed"&&"wu-opacity-0"),children:t.props.children})]})}),w=f.useRef(null);return f.useEffect(()=>{var d;i(((d=w.current)==null?void 0:d.textContent)||"")},[]),a.jsx(Ss,{...o,className:"wu-flex wu-items-center wu-gap-2 wu-px-2",children:a.jsx(Cs,{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:l})})},vl=new Map([[-3,{top:-20,left:-4,zIndex:-1,opacity:0,transition:"all 0.3s ease-in-out, z-index 0s",position:"absolute"}],[-2,{top:0,left:0,zIndex:1,opacity:1,transition:"all 0.3s ease-in-out, z-index 0s",position:"absolute"}],[-1,{top:20,left:4,zIndex:2,opacity:1,transition:"all 0.3s ease-in-out, z-index 0s",position:"absolute"}],[0,{top:40,left:8,zIndex:3,opacity:1,transition:"all 0.3s ease-in-out, z-index 0.10s",position:"absolute"}],[1,{left:12,zIndex:4,opacity:1,transition:"all 0.3s ease-in-out, z-index 0.3s 0.10s",position:"absolute"}],[2,{left:16,zIndex:5,opacity:1,transition:"all 0.3s ease-in-out, z-index 0.3s 0.10s",position:"absolute"}],[3,{left:20,zIndex:-1,opacity:0,transition:"all 0.3s ease-in-out, z-index 0.3s 0.10s",position:"absolute"}]]),Da=(e,t,r=1)=>{const s=e.match(/hsla?\(\s*([\d.]+)\s*,\s*([\d.]+)%\s*,\s*([\d.]+)%\s*(?:,\s*([\d.]+)\s*)?\)/);if(!s)throw new Error("Invalid HSL color format");const o=parseFloat(s[1]),u=parseFloat(s[2]),n=Math.max(0,parseFloat(s[3])+t);return`hsl(${o} ${u}% ${n}% / ${r})`},Nl=({index:e,viewIndex:t,length:r,itemHeight:s})=>{const o=(e-t+r)%r;let u;o===0?u=0:o===r-1&&r>=2?u=-1:o===r-2&&r>=3?u=-2:o===1?u=1:o===2?u=2:o===r-3&&r>=4?u=-3:u=3;const n=vl.get(u)||{},i=u>0?s+28+(u-1)*20:n.top;return{position:u,styles:{...n,...u>0&&{top:`${i}px`},height:u>0?"40px":s}}},at={LIGHTNESS_STEP:8,BORDER_LIGHTNESS:10,CONTENT_LIGHTNESS:45,CONTENT_HEIGHT:"calc(100% - 2rem)",FONT_SIZE_ACTIVE:"14px",FONT_SIZE_INACTIVE:"12px"},Sl=({children:e,className:t,header:r,baseColor:s,position:o=0,style:u,...n})=>{const i=o===0,l=o<=0,w={border:i?`4px solid ${Da(s,at.BORDER_LIGHTNESS)}`:"",...u},d={backgroundColor:Da(s,o*at.LIGHTNESS_STEP),fontSize:i?at.FONT_SIZE_ACTIVE:at.FONT_SIZE_INACTIVE,transition:"all 0.3s ease"},p={backgroundColor:Da(s,at.CONTENT_LIGHTNESS),height:at.CONTENT_HEIGHT};return a.jsxs("div",{className:c("wu-font-normal wu-transition-all wu-rounded-lg wu-overflow-hidden wu-w-full wu-cursor-pointer hover:-wu-translate-y-2",t),style:w,...n,children:[a.jsx("div",{style:d,className:"wu-p-2 wu-text-white",children:r}),l&&a.jsx("div",{className:"wu-p-2 wu-overflow-y-auto wu-text-sm",style:p,children:e})]})},Cl=({children:e,Trigger:t,Header:r,styles:s={},classNames:o={},open:u,onOpenChange:n,itemHeight:i})=>{const l={height:i,...s.Trigger};return a.jsxs(Gr,{open:u,onOpenChange:n,children:[a.jsx(Yr,{className:c("wu-bg-gray-25 wu-z-0 wu-w-full wu-rounded-lg wu-rounded-tl-none wu-relative",o.Trigger),style:l,children:a.jsx("span",{className:"wu-absolute wu-text-xs wu-font-medium wu-bg-gray-25 -wu-top-6 wu-left-0 wu-p-1 wu-rounded-t-lg",children:t})}),a.jsxs(Ca,{className:c("wu-top-[50%] wu-left-[50%] wu-bg-black/75 wu-backdrop-blur-[4px] wu-min-h-full wu-overflow-auto wu-shadow-none wu-max-w-none wu-border-none wu-text-white",o.Content),hideCloseButton:!0,isStackedCard:!0,style:s.Content,children:[a.jsx(rr.DialogClose,{className:c("wu-absolute wu-right-2 wu-top-2 wu-w-8 wu-h-8 wu-flex wu-items-center wu-justify-center wu-z-10",o.CloseButton),style:s.CloseButton,"aria-label":"Close dialog",children:a.jsx(Pe,{icon:"wm-close",className:"wu-text-lg wu-m-4 wu-cursor-pointer"})}),r&&a.jsx(Ea,{className:c("wu-h-12 wu-p-2 wu-pl-4 wu-bg-white/25 wu-backdrop-blur-[24px]",o.Header),style:s.Header,children:r}),e]})]})};function El({controlled:e,default:t,name:r,state:s="value"}){const{current:o}=g.useRef(e!==void 0),[u,n]=g.useState(t),i=o?e:u;if(process.env.NODE_ENV!=="production"){g.useEffect(()=>{o!==(e!==void 0)&&console.error([`Base UI: A component is changing the ${o?"":"un"}controlled ${s} state of ${r} to be ${o?"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(()=>{!o&&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 l=g.useCallback(w=>{o||n(w)},[]);return[i,l]}const Ts={};function rt(e,t){const r=g.useRef(Ts);return r.current===Ts&&(r.current=e(t)),r}const Ma=g[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],Tl=Ma&&Ma!==g.useLayoutEffect?Ma:e=>e();function xe(e){const t=rt(Il).current;return t.next=e,Tl(t.effect),t.trampoline}function Il(){const e={next:void 0,callback:kl,trampoline:(...t)=>{var r;return(r=e.callback)==null?void 0:r.call(e,...t)},effect:()=>{e.callback=e.next}};return e}function kl(){if(process.env.NODE_ENV!=="production")throw new Error("Base UI: Cannot call an event handler while rendering.")}const Dl=[];function Is(e){g.useEffect(e,Dl)}const gt=0;class Ft{constructor(){It(this,"currentId",gt);It(this,"clear",()=>{this.currentId!==gt&&(clearTimeout(this.currentId),this.currentId=gt)});It(this,"disposeEffect",()=>this.clear)}static create(){return new Ft}start(t,r){this.clear(),this.currentId=setTimeout(()=>{this.currentId=gt,r()},t)}isStarted(){return this.currentId!==gt}}function _a(){const e=rt(Ft.create).current;return Is(e.disposeEffect),e}const ks=0;class Aa extends Ft{constructor(){super(...arguments);It(this,"clear",()=>{this.currentId!==ks&&(clearInterval(this.currentId),this.currentId=ks)})}static create(){return new Aa}start(r,s){this.clear(),this.currentId=setInterval(()=>{s()},r)}}function Ml(){const e=rt(Aa.create).current;return Is(e.disposeEffect),e}const ge=typeof document<"u"?g.useLayoutEffect:()=>{};function Wa(e){const t=rt(_l,e).current;return t.next=e,ge(t.effect),t}function _l(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}function Al(){const[,e]=g.useState({});return g.useCallback(()=>{e({})},[])}function Wl(){return typeof window<"u"}function Ds(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Pl(e){return Wl()?e instanceof HTMLElement||e instanceof Ds(e).HTMLElement:!1}function Ll(e){return(e==null?void 0:e.ownerDocument)||document}const Bt=typeof navigator<"u",Pa=ql(),Ol=zl(),Fl=Vl();typeof CSS>"u"||!CSS.supports||CSS.supports("-webkit-backdrop-filter:none");const Bl=Pa.platform==="MacIntel"&&Pa.maxTouchPoints>1?!0:/iP(hone|ad|od)|iOS/.test(Pa.platform);Bt&&Ol.toLowerCase().startsWith("mac")&&navigator.maxTouchPoints,Fl.includes("jsdom/");function ql(){if(!Bt)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 Vl(){if(!Bt)return"";const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:t,version:r})=>`${t}/${r}`).join(" "):navigator.userAgent}function zl(){if(!Bt)return"";const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform??""}const La=g.createContext(void 0);process.env.NODE_ENV!=="production"&&(La.displayName="NumberFieldRootContext");function qt(){const e=g.useContext(La);if(e===void 0)throw new Error("Base UI: NumberFieldRootContext is missing. NumberField parts must be placed within <NumberField.Root>.");return e}function De(){}const Fe=Object.freeze({});let Ms=(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 Oa={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},Hl={valid(e){return e===null?null:e?{[Ms.valid]:""}:{[Ms.invalid]:""}}},_s=g.createContext({invalid:void 0,controlId:void 0,setControlId:De,labelId:void 0,setLabelId:De,messageIds:[],setMessageIds:De,name:void 0,validityData:{state:Oa,errors:[],error:"",value:"",initialValue:null},setValidityData:De,disabled:void 0,touched:!1,setTouched:De,dirty:!1,setDirty:De,filled:!1,setFilled:De,focused:!1,setFocused:De,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"&&(_s.displayName="FieldRootContext");function Vt(e=!0){const t=g.useContext(_s);if(t.setControlId===De&&!e)throw new Error("Base UI: FieldRootContext is missing. Field parts must be placed within <Field.Root>.");return t}const ht={inputValue:()=>null,value:()=>null};function As(e,t,r,s){const o=rt(Ws).current;return Ul(o,e,t,r,s)&&Ps(o,[e,t,r,s]),o.callback}function $l(e){const t=rt(Ws).current;return jl(t,e)&&Ps(t,e),t.callback}function Ws(){return{callback:null,cleanup:null,refs:[]}}function Ul(e,t,r,s,o){return e.refs[0]!==t||e.refs[1]!==r||e.refs[2]!==s||e.refs[3]!==o}function jl(e,t){return e.refs.length!==t.length||e.refs.some((r,s)=>r!==t[s])}function Ps(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 o=0;o<t.length;o+=1){const u=t[o];if(u!=null)switch(typeof u){case"function":{const n=u(r);typeof n=="function"&&(s[o]=n);break}case"object":{u.current=r;break}}}e.cleanup=()=>{for(let o=0;o<t.length;o+=1){const u=t[o];if(u!=null)switch(typeof u){case"function":{const n=s[o];typeof n=="function"?n():u(null);break}case"object":{u.current=null;break}}}}}}}const Gl=parseInt(g.version,10);function Yl(e){return Gl>=e}function Ls(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}function Kl(e,t){const r={};for(const s in e){const o=e[s];if(t!=null&&t.hasOwnProperty(s)){const u=t[s](o);u!=null&&Object.assign(r,u);continue}o===!0?r[`data-${s.toLowerCase()}`]="":o&&(r[`data-${s.toLowerCase()}`]=o.toString())}return r}function Jl(e,t){return typeof e=="function"?e(t):e}const mt={};function zt(e,t,r,s,o){let u={...Fa(e,mt)};return t&&(u=Ht(u,t)),r&&(u=Ht(u,r)),s&&(u=Ht(u,s)),u}function Xl(e){if(e.length===0)return mt;if(e.length===1)return Fa(e[0],mt);let t={...Fa(e[0],mt)};for(let r=1;r<e.length;r+=1)t=Ht(t,e[r]);return t}function Ht(e,t){return Os(t)?t(e):Zl(e,t)}function Zl(e,t){if(!t)return e;for(const r in t){const s=t[r];switch(r){case"style":{e[r]=Ls(e.style,s);break}case"className":{e[r]=Fs(e.className,s);break}default:Ql(r,s)?e[r]=Rl(e[r],s):e[r]=s}}return e}function Ql(e,t){const r=e.charCodeAt(0),s=e.charCodeAt(1),o=e.charCodeAt(2);return r===111&&s===110&&o>=65&&o<=90&&(typeof t=="function"||typeof t>"u")}function Os(e){return typeof e=="function"}function Fa(e,t){return Os(e)?e(t):e??mt}function Rl(e,t){return t?e?r=>{if(ei(r)){const o=r;Ba(o);const u=t(o);return o.baseUIHandlerPrevented||e==null||e(o),u}const s=t(r);return e==null||e(r),s}:t:e}function Ba(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function Fs(e,t){return t?e?t+" "+e:t:e}function ei(e){return e!=null&&typeof e=="object"&&"nativeEvent"in e}function xt(e,t,r={}){const s=t.render,o=ti(t,r);if(r.enabled===!1)return null;const u=r.state??Fe;return ai(e,s,o,u)}function ti(e,t={}){const{className:r,render:s}=e,{state:o=Fe,ref:u,props:n,stateAttributesMapping:i,enabled:l=!0}=t,w=l?Jl(r,o):void 0,d=l?Kl(o,i):Fe,p=l?Ls(d,Array.isArray(n)?Xl(n):n)??Fe:Fe;return typeof document<"u"&&(l?Array.isArray(u)?p.ref=$l([p.ref,Bs(s),...u]):p.ref=As(p.ref,Bs(s),u):As(null,null)),l?(w!==void 0&&(p.className=Fs(p.className,w)),p):Fe}function ai(e,t,r,s){if(t){if(typeof t=="function")return t(r,s);const o=zt(r,t.props);return o.ref=r.ref,g.cloneElement(t,o)}if(e&&typeof e=="string")return ri(e,r);throw new Error("Base UI: Render element or function are not defined.")}function ri(e,t){return e==="button"?a.jsx("button",{type:"button",...t}):e==="img"?a.jsx("img",{alt:"",...t}):g.createElement(e,t)}function Bs(e){return e&&typeof e!="function"?Yl(19)?e.props.ref:e.ref:null}const qs=new Map;function yt(e,t){const r=JSON.stringify({locale:e,options:t}),s=qs.get(r);if(s)return s;const o=new Intl.NumberFormat(e,t);return qs.set(r,o),o}function st(e,t,r){return e==null?"":yt(t,r).format(e)}function Vs(e,t,r){return st(e,t,{...r,maximumFractionDigits:20})}const si=["零","〇","一","二","三","四","五","六","七","八","九"],oi={零:"0","〇":"0",一:"1",二:"2",三:"3",四:"4",五:"5",六:"6",七:"7",八:"8",九:"9"},zs=["٠","١","٢","٣","٤","٥","٦","٧","٨","٩"],Hs=["۰","۱","۲","۳","۴","۵","۶","۷","۸","۹"],qa=["0","1","2","3","4","5","6","7","8","9"],$s=["%","٪","%","﹪"],Us=["‰","؉"],js=["−","-","‒","–","—","﹣"],Gs=["+","﹢"],ui=".",ni=",",li=new RegExp(`[${zs.join("")}]`,"g"),ii=new RegExp(`[${Hs.join("")}]`,"g"),ci=new RegExp(`[${qa.join("")}]`,"g"),wi=new RegExp(`[${si.join("")}]`,"g"),di=new RegExp(`[${$s.join("")}]`),fi=new RegExp(`[${Us.join("")}]`),Va=/[٠١٢٣٤٥٦٧٨٩]/,Ys=/[۰۱۲۳۴۵۶۷۸۹]/,za=/[零〇一二三四五六七八九]/,Ks=new RegExp(`[${qa.join("")}]`),pi=[".",",",ui,ni,"٫","٬"],bi=new RegExp("\\p{Zs}","u"),gi=["+",...Gs],hi=["-",...js],$t=e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),mi=e=>e.replace(/[-\\\]^]/g,t=>`\\${t}`),Js=e=>`[${e.map(mi).join("")}]`,Xs=Js(["-"].concat(js)),Zs=Js(["+"].concat(Gs)),Qs=new RegExp(Xs,"gu"),Rs=new RegExp(Zs,"gu"),vt=new RegExp(Xs),Ut=new RegExp(Zs);function Ha(e,t){const r=yt(e,t).formatToParts(11111.1),s={};return r.forEach(o=>{s[o.type]=o.value}),yt(e).formatToParts(.1).forEach(o=>{o.type==="decimal"&&(s[o.type]=o.value)}),s}function ot(e,t,r){if(e==null)return null;let s=String(e).replace(new RegExp("\\p{Cf}","gu"),"").trim();s=s.replace(Qs,"-").replace(Rs,"+");let o=!1;const u=s.match(/([+-])\s*$/);u&&(u[1]==="-"&&(o=!0),s=s.replace(/([+-])\s*$/,""));const n=s.match(/^\s*([+-])/);n&&(n[1]==="-"&&(o=!0),s=s.replace(/^\s*[+-]/,""));let i=t;i===void 0&&(Va.test(s)||Ys.test(s)?i="ar":za.test(s)&&(i="zh"));const{group:l,decimal:w,currency:d}=Ha(i,r),p=yt(i,r).formatToParts(1).filter(T=>T.type==="unit").map(T=>$t(T.value)),b=p.length?new RegExp(p.join("|"),"g"):null;let x=null;l&&(x=new RegExp("\\p{Zs}","u").test(l)?new RegExp("\\p{Zs}","gu"):new RegExp($t(l),"g"));let h=[{regex:l?x:null,replacement:""},{regex:w?new RegExp($t(w),"g"):null,replacement:"."},{regex:/./g,replacement:"."},{regex:/,/g,replacement:""},{regex:/٫/g,replacement:"."},{regex:/٬/g,replacement:""},{regex:d?new RegExp($t(d),"g"):null,replacement:""},{regex:b,replacement:""},{regex:li,replacement:T=>String(zs.indexOf(T))},{regex:ii,replacement:T=>String(Hs.indexOf(T))},{regex:ci,replacement:T=>String(qa.indexOf(T))},{regex:wi,replacement:T=>oi[T]}].reduce((T,{regex:M,replacement:A})=>M?T.replace(M,A):T,s);const N=h.lastIndexOf(".");if(N!==-1&&(h=`${h.slice(0,N).replace(/\./g,"")}.${h.slice(N+1).replace(/\./g,"")}`),/^[-+]?Infinity$/i.test(s)||/[∞]/.test(s))return null;const E=(o?"-":"")+h;let y=parseFloat(E);const S=r==null?void 0:r.style,v=S==="unit"&&(r==null?void 0:r.unit)==="percent",I=di.test(e)||S==="percent";return fi.test(e)?y/=1e3:!v&&I&&(y/=100),Number.isNaN(y)?null:y}const xi={...g};let eo=0;function yi(e,t="mui"){const[r,s]=g.useState(e),o=e||r;return g.useEffect(()=>{r==null&&(eo+=1,s(`${t}-${eo}`))},[r,t]),o}const to=xi.useId;function vi(e,t){if(to!==void 0){const r=to();return e??`${t}-${r}`}return yi(e,t)}function Ni(e){return vi(e,"base-ui")}const Si=60,Ci=400,Ei=50,Ti=3,Ii=8,jt=1;function ki(e,t=Number.MIN_SAFE_INTEGER,r=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,r))}function Gt(e,t={}){return parseFloat(yt("en-US",{maximumFractionDigits:t.maximumFractionDigits,minimumFractionDigits:t.minimumFractionDigits,useGrouping:!1}).format(e))}function Di(e,{step:t,minWithDefault:r,maxWithDefault:s,minWithZeroDefault:o,format:u,snapOnStep:n,small:i}){if(e===null)return e;const l=ki(e,r,s);if(t!=null&&n){if(i){const d=(l-o)/t,p=Math.round(d),b=o+p*t;return Gt(b,u)}const w=r!==Number.MIN_SAFE_INTEGER?r:o;if(t>0){const d=l-t,p=Math.floor((d-w)/t);return Gt(w+p*t+t,u)}if(t<0){const d=Math.abs(t),p=l-t,b=Math.ceil((p-w)/d);return Gt(w+b*d+t,u)}}return Gt(l,u)}function ao(e,t,r){let s=!1,o=!1;const u=Fe;return{reason:e,event:t??new Event("base-ui"),cancel(){s=!0},allowPropagation(){o=!0},get isCanceled(){return s},get isPropagationAllowed(){return o},...u}}function Yt(e,t,r){const s=Fe;return{reason:e,event:t??new Event("base-ui"),...s}}function Mi(e){e.preventDefault(),e.stopPropagation()}function _i(e){return"nativeEvent"in e}const ro=g.forwardRef(function(t,r){const{id:s,min:o,max:u,smallStep:n=.1,step:i=1,largeStep:l=10,required:w=!1,disabled:d=!1,readOnly:p=!1,name:b,defaultValue:x,value:m,onValueChange:h,onValueCommitted:N,allowWheelScrub:E=!1,snapOnStep:y=!1,format:S,locale:v,render:I,className:k,inputRef:T,...M}=t,{setControlId:A,setDirty:F,validityData:_,setValidityData:L,disabled:W,setFilled:O,invalid:B,name:P,state:U}=Vt(),Y=W||d,q=P??b,[V,ie]=g.useState(!1),K=o??Number.MIN_SAFE_INTEGER,z=u??Number.MAX_SAFE_INTEGER,se=o??0,te=S==null?void 0:S.style,ae=g.useRef(null),Ee=Ni(s);ge(()=>(A(Ee),()=>{A(void 0)}),[Ee,A]);const[je,$]=El({controlled:m,default:x,name:"NumberField",state:"value"}),D=je??null,J=Wa(D);ge(()=>{O(D!==null)},[O,D]);const ue=Al(),X=Wa(S),ce=xe(h),R=g.useRef(!1),Me=xe((re,j)=>{R.current=!1,N==null||N(re,j)}),fe=_a(),_e=Ml(),ye=_a(),Ae=g.useRef(!1),We=g.useRef(0),Le=g.useRef(!0),Ge=g.useRef(null),ea=g.useRef(()=>{});ge(()=>{_.initialValue===null&&D!==_.initialValue&&L(re=>({...re,initialValue:D}))},[L,_.initialValue,D]);const[Ye,Ke]=g.useState(()=>m!==void 0?so(D,v,S):st(D,v,S)),[Ct,ut]=g.useState("numeric"),oe=xe(()=>{const{decimal:re,group:j,currency:we}=Ha(v,S),Z=new Set;pi.forEach(le=>Z.add(le)),re&&Z.add(re),j&&(Z.add(j),bi.test(j)&&Z.add(" "));const Te=te==="percent"||te==="unit"&&(S==null?void 0:S.unit)==="percent",ve=te==="percent"||te==="unit"&&(S==null?void 0:S.unit)==="permille";return Te&&$s.forEach(le=>Z.add(le)),ve&&Us.forEach(le=>Z.add(le)),te==="currency"&&we&&Z.add(we),gi.forEach(le=>Z.add(le)),K<0&&hi.forEach(le=>Z.add(le)),Z}),he=xe(re=>re!=null&&re.altKey?n:re!=null&&re.shiftKey?l:i),Et=xe((re,j,we)=>{const Z=j,Te=j&&_i(j)?j.nativeEvent:j,ve=ao("none",Te),le=Di(re,{step:we?he(Z)*we:void 0,format:X.current,minWithDefault:K,maxWithDefault:z,minWithZeroDefault:se,snapOnStep:y,small:(Z==null?void 0:Z.altKey)??!1});if(le!==D||re!==D||Le.current===!1){if(Ge.current=le,ce==null||ce(le,ve),ve.isCanceled)return;$(le),F(le!==_.initialValue),R.current=!0}Le.current&&Ke(st(le,v,S)),ue()}),Tt=xe((re,j,we,Z)=>{const Te=we??J.current,ve=typeof Te=="number"?Te+re*j:Math.max(0,o??0);Et(ve,Z,j)}),nt=xe(()=>{ye.clear(),fe.clear(),_e.clear(),ea.current(),We.current=0}),Jo=xe((re,j)=>{if(nt(),!ae.current)return;const we=Ds(ae.current);function Z(ve){ve.preventDefault()}we.addEventListener("contextmenu",Z),ea.current=()=>{we.removeEventListener("contextmenu",Z)},we.addEventListener("pointerup",ve=>{Ae.current=!1,nt();const le=Ge.current??J.current;Me(le,Yt("none",ve))},{once:!0});function Te(){const ve=he(j)??jt;Tt(ve,re?1:-1,void 0,j)}Te(),fe.start(Ci,()=>{_e.start(Si,Te)})});ge(function(){if(!Le.current)return;const j=m!==void 0?so(D,v,S):st(D,v,S);j!==Ye&&Ke(j)}),ge(function(){if(!Bl)return;let j="text";K>=0&&(j="decimal"),ut(j)},[K,te]),g.useEffect(()=>()=>nt(),[nt]),g.useEffect(function(){const j=ae.current;if(Y||p||!E||!j)return;function we(Z){if(Z.ctrlKey||Ll(ae.current).activeElement!==ae.current)return;Z.preventDefault();const Te=he(Z)??jt;Tt(Te,Z.deltaY>0?-1:1,void 0,Z)}return j.addEventListener("wheel",we),()=>{j.removeEventListener("wheel",we)}},[E,Tt,Y,p,l,i,he]);const tr=g.useMemo(()=>({...U,disabled:Y,readOnly:p,required:w,value:D,inputValue:Ye,scrubbing:V}),[U,Y,p,w,D,Ye,V]),xc=g.useMemo(()=>({inputRef:ae,inputValue:Ye,value:D,startAutoChange:Jo,stopAutoChange:nt,minWithDefault:K,maxWithDefault:z,disabled:Y,readOnly:p,id:Ee,setValue:Et,incrementValue:Tt,getStepAmount:he,allowInputSyncRef:Le,formatOptionsRef:X,valueRef:J,lastChangedValueRef:Ge,hasPendingCommitRef:R,isPressedRef:Ae,intentionalTouchCheckTimeout:ye,movesAfterTouchRef:We,name:q,required:w,invalid:B,inputMode:Ct,getAllowedNonNumericKeys:oe,min:o,max:u,setInputValue:Ke,locale:v,isScrubbing:V,setIsScrubbing:ie,state:tr,onValueCommitted:Me}),[ae,Ye,D,Jo,nt,K,z,Y,p,Ee,Et,Tt,he,Le,X,J,Ge,R,Ae,ye,We,q,w,B,Ct,oe,o,u,Ke,v,V,tr,Me]),yc=xt("div",t,{ref:r,state:tr,props:M,stateAttributesMapping:ht});return a.jsxs(La.Provider,{value:xc,children:[yc,q&&a.jsx("input",{type:"hidden",name:q,ref:T,value:D??"",disabled:Y,required:w})]})});process.env.NODE_ENV!=="production"&&(ro.displayName="NumberFieldRoot");function so(e,t,r){return(r==null?void 0:r.maximumFractionDigits)!=null||(r==null?void 0:r.minimumFractionDigits)!=null?st(e,t,r):Vs(e,t,r)}const oo=g.forwardRef(function(t,r){const{render:s,className:o,...u}=t,{state:n}=qt();return xt("div",t,{ref:r,state:n,props:[{role:"group"},u],stateAttributesMapping:ht})});process.env.NODE_ENV!=="production"&&(oo.displayName="NumberFieldGroup");let $a;process.env.NODE_ENV!=="production"&&($a=new Set);function uo(...e){if(process.env.NODE_ENV!=="production"){const t=e.join(" ");$a.has(t)||($a.add(t),console.error(`Base UI: ${t}`))}}const no=g.createContext(void 0);process.env.NODE_ENV!=="production"&&(no.displayName="CompositeRootContext");function Ai(e=!1){const t=g.useContext(no);if(t===void 0&&!e)throw new Error("Base UI: CompositeRootContext is missing. Composite parts must be placed within <Composite.Root>.");return t}function Wi(e){const{focusableWhenDisabled:t,disabled:r,composite:s=!1,tabIndex:o=0,isNativeButton:u}=e,n=s&&t!==!1,i=s&&t===!1;return{props:g.useMemo(()=>{const w={onKeyDown(d){r&&t&&d.key!=="Tab"&&d.preventDefault()}};return s||(w.tabIndex=o,!u&&r&&(w.tabIndex=t?o:-1)),(u&&(t||n)||!u&&r)&&(w["aria-disabled"]=r),u&&(!t||i)&&(w.disabled=r),w},[s,r,t,n,i,u,o])}}function lo(e={}){const{disabled:t=!1,focusableWhenDisabled:r,tabIndex:s=0,native:o=!0}=e,u=g.useRef(null),n=Ai(!0)!==void 0,i=xe(()=>{const b=u.current;return!!((b==null?void 0:b.tagName)==="A"&&(b!=null&&b.href))}),{props:l}=Wi({focusableWhenDisabled:r,disabled:t,composite:n,tabIndex:s,isNativeButton:o});process.env.NODE_ENV!=="production"&&g.useEffect(()=>{if(!u.current)return;const b=u.current.tagName==="BUTTON";o?b||uo("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&&uo("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`.")},[o]);const w=g.useCallback(()=>{const b=u.current;Pi(b)&&n&&t&&l.disabled===void 0&&b.disabled&&(b.disabled=!1)},[t,l.disabled,n]);ge(w,[w]);const d=g.useCallback((b={})=>{const{onClick:x,onMouseDown:m,onKeyUp:h,onKeyDown:N,onPointerDown:E,...y}=b;return zt({type:o?"button":void 0,onClick(v){if(t){v.preventDefault();return}x==null||x(v)},onMouseDown(v){t||m==null||m(v)},onKeyDown(v){if(t||(Ba(v),N==null||N(v)),v.baseUIHandlerPrevented)return;const I=v.target===v.currentTarget&&!o&&!i()&&!t,k=v.key==="Enter",T=v.key===" ";I&&((T||k)&&v.preventDefault(),k&&(x==null||x(v)))},onKeyUp(v){t||(Ba(v),h==null||h(v)),!v.baseUIHandlerPrevented&&v.target===v.currentTarget&&!o&&!t&&v.key===" "&&(x==null||x(v))},onPointerDown(v){if(t){v.preventDefault();return}E==null||E(v)}},o?void 0:{role:"button"},l,y)},[t,l,o,i]),p=xe(b=>{u.current=b,w()});return{getButtonProps:d,buttonRef:p}}function Pi(e){return Pl(e)&&e.tagName==="BUTTON"}function io(e){const{allowInputSyncRef:t,disabled:r,formatOptionsRef:s,getStepAmount:o,id:u,incrementValue:n,inputRef:i,inputValue:l,intentionalTouchCheckTimeout:w,isIncrement:d,isPressedRef:p,locale:b,maxWithDefault:x,minWithDefault:m,movesAfterTouchRef:h,readOnly:N,setValue:E,startAutoChange:y,stopAutoChange:S,value:v,valueRef:I,lastChangedValueRef:k,onValueCommitted:T}=e,M=g.useRef({x:0,y:0}),A=g.useRef(!1),F=g.useRef(!1),_=g.useRef(""),L=v!=null&&v<=m,W=v!=null&&v>=x,O=xe(P=>{t.current=!0;const U=ot(l,b,s.current);U!==null&&(I.current=U,E(U,P))}),B=g.useMemo(()=>({disabled:r||(d?W:L),"aria-readonly":N||void 0,"aria-label":d?"Increase":"Decrease","aria-controls":u,tabIndex:-1,style:{WebkitUserSelect:"none",userSelect:"none"},onTouchStart(){A.current=!0},onTouchEnd(){A.current=!1},onClick(P){const U=r||N||(d?W:L);if(P.defaultPrevented||U||(_.current==="touch"?F.current:P.detail!==0))return;O(P.nativeEvent);const Y=o(P)??jt,q=I.current;n(Y,d?1:-1,void 0,P.nativeEvent);const V=k.current??I.current;V!==q&&T(V,Yt("none",P.nativeEvent))},onPointerDown(P){var q;const U=!P.button||P.button===0,Y=r||(d?W:L);P.defaultPrevented||N||!U||Y||(_.current=P.pointerType,F.current=!1,p.current=!0,M.current={x:P.clientX,y:P.clientY},O(P.nativeEvent),P.pointerType!=="touch"?(P.preventDefault(),(q=i.current)==null||q.focus(),y(d,P)):w.start(Ei,()=>{const V=h.current;h.current=0,p.current&&V!=null&&V<Ti?(y(d,P),F.current=!0):(F.current=!1,S())}))},onPointerUp(P){P.pointerType==="touch"&&(p.current=!1)},onPointerMove(P){if(r||N||(d?W:L)||P.pointerType!=="touch"||!p.current)return;h.current!=null&&(h.current+=1);const{x:Y,y:q}=M.current,V=Y-P.clientX,ie=q-P.clientY;V**2+ie**2>Ii**2&&S()},onMouseEnter(P){const U=r||N||(d?W:L);P.defaultPrevented||U||!p.current||A.current||_.current==="touch"||y(d,P)},onMouseLeave(){A.current||S()},onMouseUp(){A.current||S()}}),[r,d,W,L,N,u,O,o,I,n,k,T,p,i,y,w,h,S]);return g.useMemo(()=>({props:B}),[B])}const co=g.forwardRef(function(t,r){const{render:s,className:o,disabled:u=!1,nativeButton:n=!0,...i}=t,{allowInputSyncRef:l,disabled:w,formatOptionsRef:d,getStepAmount:p,id:b,incrementValue:x,inputRef:m,inputValue:h,intentionalTouchCheckTimeout:N,isPressedRef:E,locale:y,maxWithDefault:S,minWithDefault:v,movesAfterTouchRef:I,readOnly:k,setValue:T,startAutoChange:M,state:A,stopAutoChange:F,value:_,valueRef:L,lastChangedValueRef:W,onValueCommitted:O}=qt(),B=u||w,{props:P}=io({isIncrement:!0,inputRef:m,startAutoChange:M,stopAutoChange:F,minWithDefault:v,maxWithDefault:S,value:_,inputValue:h,disabled:B,readOnly:k,id:b,setValue:T,getStepAmount:p,incrementValue:x,allowInputSyncRef:l,formatOptionsRef:d,valueRef:L,isPressedRef:E,intentionalTouchCheckTimeout:N,movesAfterTouchRef:I,locale:y,lastChangedValueRef:W,onValueCommitted:O}),{getButtonProps:U,buttonRef:Y}=lo({disabled:B,native:n}),q=g.useMemo(()=>({...A,disabled:B}),[A,B]);return xt("button",t,{ref:[r,Y],state:q,props:[P,i,U],stateAttributesMapping:ht})});process.env.NODE_ENV!=="production"&&(co.displayName="NumberFieldIncrement");const wo=g.forwardRef(function(t,r){const{render:s,className:o,disabled:u=!1,nativeButton:n=!0,...i}=t,{allowInputSyncRef:l,disabled:w,formatOptionsRef:d,getStepAmount:p,id:b,incrementValue:x,inputRef:m,inputValue:h,intentionalTouchCheckTimeout:N,isPressedRef:E,maxWithDefault:y,minWithDefault:S,movesAfterTouchRef:v,readOnly:I,setValue:k,startAutoChange:T,state:M,stopAutoChange:A,value:F,valueRef:_,locale:L,lastChangedValueRef:W,onValueCommitted:O}=qt(),B=u||w,{props:P}=io({isIncrement:!1,inputRef:m,startAutoChange:T,stopAutoChange:A,minWithDefault:S,maxWithDefault:y,value:F,inputValue:h,disabled:B,readOnly:I,id:b,setValue:k,getStepAmount:p,incrementValue:x,allowInputSyncRef:l,formatOptionsRef:d,valueRef:_,isPressedRef:E,intentionalTouchCheckTimeout:N,movesAfterTouchRef:v,locale:L,lastChangedValueRef:W,onValueCommitted:O}),{getButtonProps:U,buttonRef:Y}=lo({disabled:B,native:n}),q=g.useMemo(()=>({...M,disabled:B}),[M,B]);return xt("button",t,{ref:[r,Y],state:q,props:[P,i,U],stateAttributesMapping:ht})});process.env.NODE_ENV!=="production"&&(wo.displayName="NumberFieldDecrement");const fo=g.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:De});process.env.NODE_ENV!=="production"&&(fo.displayName="FormContext");function Ua(){return g.useContext(fo)}function ja(e,t){return{...e,state:{...e.state,valid:!t&&e.state.valid}}}const Kt=Object.keys(Oa);function Li(e){if(!e||e.valid||!e.valueMissing)return!1;let t=!1;for(const r of Kt)r!=="valid"&&(r==="valueMissing"&&(t=e[r]),e[r]&&(t=!1));return t}function Oi(){const{setValidityData:e,validate:t,messageIds:r,validityData:s,validationMode:o,validationDebounceTime:u,invalid:n,markedDirtyRef:i,controlId:l,state:w,name:d}=Vt(),{formRef:p,clearErrors:b}=Ua(),x=_a(),m=g.useRef(null),h=xe(async(y,S=!1)=>{const v=m.current;if(!v)return;if(S){if(w.valid!==!1)return;const _=v.validity;if(!_.valueMissing){const W={value:y,state:{...Oa,valid:!0},error:"",errors:[],initialValue:s.initialValue};if(v.setCustomValidity(""),l){const O=p.current.fields.get(l);O&&p.current.fields.set(l,{...O,...ja(W,!1)})}e(W);return}const L=Kt.reduce((W,O)=>(W[O]=_[O],W),{});if(!L.valid&&!Li(L))return}function I(_){const L=Kt.reduce((O,B)=>(O[B]=_.validity[B],O),{});let W=!1;for(const O of Kt)if(O!=="valid"){if(O==="valueMissing"&&L[O])W=!0;else if(L[O])return L}return W&&!i.current&&(L.valid=!0,L.valueMissing=!1),L}x.clear();let k=null,T=[];const M=I(v);let A;if(v.validationMessage)A=v.validationMessage,T=[v.validationMessage];else{const _=Array.from(p.current.fields.values()).reduce((W,O)=>{var B,P;return O.name&&O.getValueRef&&(W[O.name]=(P=(B=O.getValueRef).current)==null?void 0:P.call(B)),W},{}),L=t(y,_);typeof L=="object"&&L!==null&&"then"in L?k=await L:k=L,k!==null&&(M.valid=!1,M.customError=!0,Array.isArray(k)?(T=k,v.setCustomValidity(k.join(`
7
+ `))):k&&(T=[k],v.setCustomValidity(k)))}const F={value:y,state:M,error:A??(Array.isArray(k)?k[0]:k??""),errors:T,initialValue:s.initialValue};if(l){const _=p.current.fields.get(l);_&&p.current.fields.set(l,{..._,...ja(F,n)})}e(F)}),N=g.useCallback((y={})=>zt({...r.length&&{"aria-describedby":r.join(" ")},...w.valid===!1&&{"aria-invalid":!0}},y),[r,w.valid]),E=g.useCallback((y={})=>zt({onChange(S){if(S.nativeEvent.defaultPrevented)return;if(b(d),o!=="onChange"){h(S.currentTarget.value,!0);return}if(n)return;const v=S.currentTarget;if(v.value===""){h(v.value);return}x.clear(),u?x.start(u,()=>{h(v.value)}):h(v.value)}},N(y)),[N,b,d,x,h,n,o,u]);return g.useMemo(()=>({getValidationProps:N,getInputValidationProps:E,inputRef:m,commitValidation:h}),[N,E,h])}function Fi(e){const{formRef:t}=Ua(),{invalid:r,markedDirtyRef:s,validityData:o,setValidityData:u}=Vt(),{enabled:n=!0,value:i,id:l,name:w,controlRef:d,commitValidation:p}=e,b=Wa(e.getValue);ge(()=>{var m;if(!n)return;let x=i;x===void 0&&(x=(m=b.current)==null?void 0:m.call(b)),o.initialValue===null&&x!==o.initialValue&&u(h=>({...h,initialValue:x}))},[n,u,i,o.initialValue,b]),ge(()=>{n&&l&&t.current.fields.set(l,{controlRef:d,validityData:ja(o,r),validate(){var m;let x=i;x===void 0&&(x=(m=b.current)==null?void 0:m.call(b)),s.current=!0,du.flushSync(()=>p(x))},getValueRef:b,name:w})},[p,d,n,t,b,l,r,s,w,o,i]),ge(()=>{const x=t.current.fields;return()=>{l&&x.delete(l)}},[t,l])}const Bi={...Hl,...ht},qi=new Set(["Backspace","Delete","ArrowLeft","ArrowRight","Tab","Enter","Escape"]),po=g.forwardRef(function(t,r){const{render:s,className:o,...u}=t,{allowInputSyncRef:n,disabled:i,formatOptionsRef:l,getAllowedNonNumericKeys:w,getStepAmount:d,id:p,incrementValue:b,inputMode:x,inputValue:m,max:h,min:N,name:E,readOnly:y,required:S,setValue:v,state:I,setInputValue:k,locale:T,inputRef:M,value:A,onValueCommitted:F,lastChangedValueRef:_,hasPendingCommitRef:L,valueRef:W}=qt(),{clearErrors:O}=Ua(),{labelId:B,validationMode:P,setTouched:U,setFocused:Y,invalid:q}=Vt(),{getInputValidationProps:V,getValidationProps:ie,commitValidation:K,inputRef:z}=Oi(),se=g.useRef(!1),te=g.useRef(!1);Fi({id:p,commitValidation:K,value:A,controlRef:M,name:E,getValue:()=>A??null});const ae=g.useRef(A),Ee=g.useRef(m);return ge(()=>{ae.current===A&&Ee.current===m||(O(E),P==="onChange"&&K(A))},[A,m,E,O,P,K]),ge(()=>{if(!(ae.current===A||P==="onChange")){if(te.current){te.current=!1;return}K(A,!0)}},[K,P,A]),ge(()=>{ae.current=A,Ee.current=m},[A,m]),xt("input",t,{ref:[r,M,z],state:I,props:[{id:p,required:S,disabled:i,readOnly:y,inputMode:x,value:m,type:"text",autoComplete:"off",autoCorrect:"off",spellCheck:"false","aria-roledescription":"Number field","aria-invalid":q||void 0,"aria-labelledby":B,suppressHydrationWarning:!0,onFocus(D){if(D.defaultPrevented||y||i||se.current)return;se.current=!0,Y(!0);const J=D.currentTarget,ue=J.value.length;J.setSelectionRange(ue,ue)},onBlur(D){if(D.defaultPrevented||y||i)return;U(!0),Y(!1);const J=!n.current,ue=L.current;if(n.current=!0,m.trim()===""){v(null),P==="onBlur"&&K(null),F(null,Yt("none",D.nativeEvent));return}const X=l.current,ce=ot(m,T,X);if(ce===null)return;te.current=!0;const R=(X==null?void 0:X.maximumFractionDigits)!=null||(X==null?void 0:X.minimumFractionDigits)!=null,Me=X==null?void 0:X.maximumFractionDigits,fe=R&&typeof Me=="number"?Number(ce.toFixed(Me)):ce,_e=Yt("none",D.nativeEvent),ye=A!==fe,Ae=J||ye||ue;P==="onBlur"&&K(fe),ye&&v(fe,D.nativeEvent),Ae&&F(fe,_e);const We=st(fe,T,X),Le=Vs(ce,T,X);!(!R&&ce===A&&m===Le)&&m!==We&&k(We)},onChange(D){if(D.nativeEvent.defaultPrevented)return;n.current=!1;const J=D.target.value;if(J.trim()===""){k(J),v(null,D.nativeEvent);return}const ue=w();if(!Array.from(J).every(R=>{const Me=R>="0"&&R<="9",fe=Va.test(R),_e=za.test(R),ye=Ys.test(R),Ae=Ks.test(R),We=vt.test(R);return Me||fe||_e||ye||Ae||We||ue.has(R)}))return;if(D.isTrusted){k(J);const R=ot(J,T,l.current);R!==null&&v(R,D.nativeEvent);return}const ce=ot(J,T,l.current);ce!==null&&(k(J),v(ce,D.nativeEvent))},onKeyDown(D){if(D.defaultPrevented||y||i)return;const J=D.nativeEvent;n.current=!0;const ue=w();let X=ue.has(D.key);const{decimal:ce,currency:R,percentSign:Me}=Ha(T,l.current),fe=D.currentTarget.selectionStart,_e=D.currentTarget.selectionEnd,ye=fe===0&&_e===m.length,Ae=oe=>fe===oe&&_e===oe+1;if(vt.test(D.key)&&Array.from(ue).some(oe=>vt.test(oe||""))){const oe=m.search(Qs),he=oe!=null&&oe!==-1&&Ae(oe);X=!(vt.test(m)||Ut.test(m))||ye||he}if(Ut.test(D.key)&&Array.from(ue).some(oe=>Ut.test(oe||""))){const oe=m.search(Rs),he=oe!=null&&oe!==-1&&Ae(oe);X=!(vt.test(m)||Ut.test(m))||ye||he}[ce,R,Me].forEach(oe=>{if(D.key===oe){const he=m.indexOf(oe),Et=fe===he&&_e===he+1;X=!m.includes(oe)||ye||Et}});const We=D.key>="0"&&D.key<="9",Le=Va.test(D.key),Ge=za.test(D.key),ea=Ks.test(D.key),Ye=qi.has(D.key);if(D.which===229||D.altKey||D.ctrlKey||D.metaKey||X||We||Le||ea||Ge||Ye)return;const Ke=ot(m,T,l.current),Ct=d(D)??jt;Mi(D);const ut=ao("none",J);D.key==="ArrowUp"?(b(Ct,1,Ke,J),F(_.current??W.current,ut)):D.key==="ArrowDown"?(b(Ct,-1,Ke,J),F(_.current??W.current,ut)):D.key==="Home"&&N!=null?(v(N,J),F(_.current??W.current,ut)):D.key==="End"&&h!=null&&(v(h,J),F(_.current??W.current,ut))},onPaste(D){if(D.defaultPrevented||y||i)return;D.preventDefault();const ue=(D.clipboardData||window.Clipboard).getData("text/plain"),X=ot(ue,T,l.current);X!==null&&(n.current=!1,v(X,D.nativeEvent),k(ue))}},V(),ie(),u],stateAttributesMapping:Bi})});process.env.NODE_ENV!=="production"&&(po.displayName="NumberFieldInput");const Vi={wuStepper:"_wuStepper_apbnq_1"},zi=({onChange:e,Label:t,defaultValue:r=0,readonly:s,dir:o,step:u=1,min:n,max:i,value:l,className:w,labelPosition:d="left",disabled:p,resetInvalidValueOnBlur:b=!0,...x})=>{const m=g.useId(),[h,N]=g.useState(l!==void 0?Number(l):r||0);g.useEffect(()=>{l!==void 0&&N(Number(l))},[l]);const E=T=>{N(T),e==null||e(T)},y=T=>{const M=Number(T.target.value);Number.isNaN(M)||N(M)},S=()=>{b&&(n!==void 0&&h<n?(N(n),e==null||e(n)):i!==void 0&&h>i&&(N(i),e==null||e(i)))};g.useEffect(()=>{l&&r&&console.warn("As both value and defaultValue are passed, value will be used")},[l,r]);const v={inc:s||i!==void 0&&h>=i||p,dec:s||n!==void 0&&h<=n||p},I=n!==void 0&&h<n||i!==void 0&&h>i,k=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(ro,{id:m,value:h,step:u,readOnly:s,onValueChange:T=>typeof T=="number"&&E(T),dir:o,className:c("wu-flex wu-stepper",o==="rtl"&&d!=="top"&&"wu-gap-2",Vi.wuStepper,Hi({labelPosition:d}),w),children:[t&&a.jsx(be,{htmlFor:m,className:"wu-input-label",children:t}),a.jsxs(oo,{className:"wu-flex wu-max-w-[97px] wu-relative",children:[a.jsx(wo,{"aria-label":"decrement",className:c(k,o==="rtl"?"wu-right-0":"wu-left-0","wu-stepper-button"),disabled:v.dec,children:a.jsx("span",{className:"wu-text-base wm-minimize"})}),a.jsx(po,{"aria-label":"stepper",role:"spinbutton",type:"text","aria-invalid":I||void 0,dir:o,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:S,disabled:p,min:n,max:i,step:u,value:h,...x}),a.jsx(co,{"aria-label":"increment",className:c(k,o==="rtl"?"wu-left-0":"wu-right-0","wu-stepper-button"),disabled:v.inc,children:a.jsx("span",{className:"wu-text-base wm-add"})})]})]})},Hi=Ne.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"}}}),bo=Ne.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"}}),$i=g.forwardRef(({className:e,variant:t,size:r,...s},o)=>a.jsx(ur.Root,{ref:o,className:c(bo({variant:t,size:r,className:e})),...s}));$i.displayName=ur.Root.displayName;const go=g.createContext({size:"default",variant:"default"}),Jt=g.forwardRef(({className:e,variant:t,size:r,children:s,...o},u)=>a.jsx(Dt.Root,{ref:u,className:c("wu-flex wu-items-center wu-justify-center wu-gap-1",e),...o,children:a.jsx(go.Provider,{value:{variant:t,size:r},children:s})}));Jt.displayName=Dt.Root.displayName;const Ue=g.forwardRef(({className:e,children:t,variant:r,size:s,...o},u)=>{const n=g.useContext(go);return a.jsx(Dt.Item,{ref:u,className:c(bo({variant:n.variant||r,size:n.size||s}),e),...o,children:t})});Ue.displayName=Dt.Item.displayName;const ho=f.forwardRef((e,t)=>{const{options:r,value:s,disabled:o,dir:u,onChange:n}=e,i=l=>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",o&&"wu-cursor-not-allowed data-[state=on]:wu-text-gray-lead",l===s&&"wu-text-white",o&&s===l&&"wu-text-gray-lead","wu-switcher-icon-tab-item");return a.jsx(a.Fragment,{children:a.jsxs(Jt,{ref:t,type:"single",value:s,onValueChange:n,disabled:o,dir:u,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",o&&"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"&&u!=="rtl"&&"wu-translate-x-full",s==="opt2"&&u==="rtl"&&"-wu-translate-x-full",o&&"wu-bg-gray-40","wu-switcher-icon-tab-slider")}),a.jsx(Ue,{value:"opt1",className:i("opt1"),children:r[0].label}),a.jsx(Ue,{value:"opt2",className:i("opt2"),children:r[1].label})]})})});ho.displayName="_IconTab";const mo=f.forwardRef((e,t)=>{const{options:r,value:s,disabled:o,dir:u,size:n="md",onChange:i}=e,l=w=>c("wu-w-1/2 wu-text-xs wu-rounded-full wu-text-gray-lead wu-relative wu-z-10 wu-font-normal",o&&"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",o&&s===w&&"wu-text-gray-lead","wu-switcher-tab-item");return a.jsx(a.Fragment,{children:a.jsxs(Jt,{ref:t,type:"single",value:s,onValueChange:i,disabled:o,dir:u,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",o&&"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"&&u!=="rtl"&&"wu-translate-x-full",s==="opt2"&&u==="rtl"&&"-wu-translate-x-full",o&&"wu-bg-gray-40","wu-switcher-tab-slider")}),a.jsx(Ue,{value:"opt1",className:l("opt1"),children:a.jsx("div",{className:"wu-min-w-16 wu-max-w-[136px] wu-overflow-hidden wu-text-ellipsis wu-text-nowrap",children:r[0].label})}),a.jsx(Ue,{value:"opt2",className:l("opt2"),children:a.jsx("div",{className:"wu-min-w-16 wu-max-w-[136px] wu-overflow-hidden wu-text-ellipsis wu-text-nowrap",children:r[1].label})})]})})});mo.displayName="_Tab";const xo=f.forwardRef((e,t)=>{const{options:r,value:s,disabled:o,dir:u,onChange:n}=e,i=p=>c("wu-p-0 wu-w-fit wu-text-xs wu-text-gray-lead wu-h-fit wu-font-normal",o&&"wu-cursor-not-allowed data-[state=on]:wu-text-gray-subtle wu-text-gray-subtle",p===s&&"wu-text-primary wu-font-medium",o&&s===p&&"wu-text-gray-lead","wu-switcher-toggle-item"),l=c("wu-w-fit wu-gap-2",o&&"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",o&&"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"&&u!=="rtl"&&"-wu-translate-x-[10px]",s==="opt1"&&u==="rtl"&&"wu-translate-x-[10px]",s==="opt2"&&u!=="rtl"&&"wu-translate-x-[10px]",s==="opt2"&&u==="rtl"&&"-wu-translate-x-[10px]",o&&"wu-hidden","wu-switcher-toggle-knob");return a.jsx(a.Fragment,{children:a.jsxs(Jt,{ref:t,type:"single",value:s,disabled:o,dir:u,className:l,onValueChange:n,children:[a.jsx(Ue,{value:"opt1",className:i("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:o,"aria-label":"knob",dir:u,children:a.jsx("div",{className:d,role:"knob",dir:u})}),a.jsx(Ue,{value:"opt2",className:i("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})})]})})});xo.displayName="_Toggle";const yo=f.forwardRef((e,t)=>{const{type:r,options:s,value:o,disabled:u,dir:n,size:i,onChange:l,toggle:w=!0,...d}=e,[p,b]=f.useState(),x=m=>{let h=p;m!==""?h=m:w&&(h=p==="opt1"?"opt2":"opt1");const N=h==="opt1"?s[0].value:s[1].value;l&&l(N),b(h)};if(f.useEffect(()=>{if(!Array.isArray(s)||s.length<2)throw new Error("Options are not sufficient");b(o===s[0].value?"opt1":"opt2")},[s,o]),!Array.isArray(s)||s.length<2)return a.jsx(a.Fragment,{});switch(r){case"toggle":return a.jsx(xo,{...d,ref:t,options:s,value:p||"opt1",onChange:x,disabled:u,dir:n});case"iconTab":return a.jsx(ho,{ref:t,options:s,value:p||"opt1",onChange:x,disabled:u,dir:n});default:return a.jsx(mo,{ref:t,options:s,value:p||"opt1",onChange:x,disabled:u,dir:n,size:i})}});yo.displayName="WuSwitcher";const vo=Ve.Root,Ga=g.forwardRef(({className:e,children:t,...r},s)=>a.jsx(Ve.List,{className:c("wu-relative wu-flex",e),...r,ref:s,children:t}));Ga.displayName=Ve.List.displayName;const Ya=g.forwardRef(({className:e,...t},r)=>a.jsx(Ve.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}));Ya.displayName=Ve.Trigger.displayName;const No=g.forwardRef(({className:e,...t},r)=>a.jsx(Ve.Content,{ref:r,className:e,...t}));No.displayName=Ve.Content.displayName;const So=({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","wu-tab-content-container"),children:e.map(s=>a.jsx(No,{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))})},Ui=e=>{const[t,r]=f.useState(!1),[s,o]=f.useState(!1),u=()=>{const i=e.current;i&&(r(i.scrollLeft>0),o(i.scrollLeft+i.clientWidth<i.scrollWidth))};return f.useEffect(()=>{const i=e.current;return u(),i&&i.addEventListener("scroll",u),window.addEventListener("resize",u),()=>{i&&i.removeEventListener("scroll",u),window.removeEventListener("resize",u)}},[e]),{showLeftArrow:t,showRightArrow:s,scrollByTab:i=>{const l=e.current;if(l){const w=(i==="right"?l.clientWidth:-l.clientWidth)*.8;l.scrollBy({left:w,behavior:"smooth"})}}}},Co=(e,t)=>{const[r,s]=f.useState({width:0,left:0,height:0,top:0}),o=t==="vertical";return f.useEffect(()=>{const u=e.current;if(u){const n=()=>{const l=u.querySelector('[data-state="active"]');if(l){const w={width:o?2:l.offsetWidth,left:o?0:l.offsetLeft,height:o?l.offsetHeight:1,top:o?l.offsetTop:0};s(w)}},i=new MutationObserver(n);return i.observe(u,{attributes:!0,subtree:!0}),n(),()=>{i.disconnect()}}},[e,o]),r},ji=({items:e,value:t,defaultValue:r,onValueChange:s,enableAnimation:o=!1,className:u,dir:n="ltr",position:i="top"})=>{var S;const l=f.useRef(null),w=Co(l,"horizontal"),{showLeftArrow:d,showRightArrow:p,scrollByTab:b}=Ui(l),[x,m]=f.useState(!1),h=()=>b("left"),N=()=>b("right"),E=v=>a.jsx("div",{"data-testid":`gradient-overlay-${v}`,className:c("wu-absolute wu-top-0 wu-h-full wu-w-20 wu-z-10 wu-pointer-events-none",v==="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=(v,I,k)=>{const T=I==="left";return a.jsx("button",{onClick:v,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",k&&"wu-translate-x-0 wu-opacity-100",!k&&[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(vo,{defaultValue:r||((S=e[0])==null?void 0:S.value),value:t,onValueChange:s,orientation:"horizontal",dir:n,className:c("wu-relative wu-flex wu-flex-col wu-w-full wu-h-full",i==="bottom"?"wu-flex-col-reverse":"wu-flex-col",u),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:()=>m(!0),onMouseLeave:()=>m(!1),"aria-label":"tablistWrapper",children:[d&&x&&E("left"),y(h,"left",d&&x),a.jsxs(Ga,{ref:l,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(v=>a.jsx(Ya,{value:v.value,children:v.Trigger},v.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:i==="bottom"?void 0:0,top:i==="bottom"?0:void 0}})]}),p&&x&&E("right"),y(N,"right",p&&x)]}),a.jsx(So,{items:e,enableAnimation:o})]})},Gi=e=>{const[t,r]=f.useState(!1),[s,o]=f.useState(!1),u=()=>{const i=e.current;i&&(r(i.scrollTop>0),o(i.scrollTop+i.clientHeight<i.scrollHeight))};return f.useEffect(()=>{const i=e.current;if(i)return u(),i.addEventListener("scroll",u),window.addEventListener("resize",u),()=>{i.removeEventListener("scroll",u),window.removeEventListener("resize",u)}},[e]),{showTopArrow:t,showBottomArrow:s,scrollByTab:i=>{const l=e.current;if(l){const w=(i==="down"?l.clientHeight:-l.clientHeight)*.8;l.scrollBy({top:w,behavior:"smooth"})}}}},Yi=({items:e,value:t,defaultValue:r,onValueChange:s,enableAnimation:o=!1,className:u,dir:n="ltr",position:i="left"})=>{var S;const l=f.useRef(null),w=Co(l,"vertical"),{showTopArrow:d,showBottomArrow:p,scrollByTab:b}=Gi(l),[x,m]=f.useState(!1),h=()=>b("up"),N=()=>b("down"),E=v=>a.jsx("div",{className:c("wu-absolute wu-left-0 wu-w-full wu-h-12 wu-z-10 wu-pointer-events-none",v==="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=(v,I,k)=>{const T=I==="up";return a.jsx("button",{onClick:v,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",k&&"wu-translate-y-0 wu-opacity-100",!k&&[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(vo,{defaultValue:r||((S=e[0])==null?void 0:S.value),value:t,onValueChange:s,orientation:"vertical",dir:n,className:c("wu-relative wu-h-full wu-w-full wu-flex",i==="left"?"wu-flex-row":"wu-flex-row-reverse",u),role:"tabs",children:[a.jsxs("div",{className:"wu-relative wu-flex wu-overflow-hidden wu-shrink-0",onMouseEnter:()=>m(!0),onMouseLeave:()=>m(!1),"aria-label":"tablistWrapper",children:[d&&x&&E("top"),y(h,"up",d&&x),a.jsxs(Ga,{ref:l,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(v=>a.jsx(Ya,{value:v.value,children:v.Trigger},v.value)),a.jsx("span",{className:"wu-absolute wu-bg-blue-p wu-transition-all wu-duration-300 wu-indicator",style:{width:2,left:i==="left"?0:void 0,right:i==="right"?0:void 0,height:w.height,top:w.top}})]}),p&&x&&E("bottom"),y(N,"down",p&&x)]}),a.jsx(So,{items:e,enableAnimation:o})]})},Ki=({...e})=>e.orientation==="vertical"?a.jsx(Yi,{...e}):a.jsx(ji,{...e}),Ka=g.forwardRef(({className:e,...t},r)=>a.jsx("table",{ref:r,className:c("wu-w-full wu-caption-bottom wu-text-sm",e),...t}));Ka.displayName="Table";const Eo=g.forwardRef(({className:e,...t},r)=>a.jsx("thead",{ref:r,className:c("[&_tr]:wu-border-b",e),...t}));Eo.displayName="TableHeader";const To=g.forwardRef(({className:e,...t},r)=>a.jsx("tbody",{ref:r,className:c("",e),...t}));To.displayName="TableBody";const Ji=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}));Ji.displayName="TableFooter";const Nt=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}));Nt.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 Xt=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}));Xt.displayName="TableCell";const Xa=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}));Xa.displayName="TableCaption";const Xi=({columns:e,rowSelection:t})=>{const r=(t==null?void 0:t.isEnabled)??!1,s=(t==null?void 0:t.size)??48,{onRowSelect:o,rowUniqueKey:u}=t||{},n=f.useCallback(l=>w=>{o(()=>w?l:[])},[o]);return{finalColumns:f.useMemo(()=>r?[{id:"select",header:({table:l})=>{const w=l.getRowModel().rows.map(p=>p.original),d=n(w);return a.jsx(Ce,{checked:l.getIsSomeRowsSelected()||l.getIsAllRowsSelected(),partial:l.getIsSomeRowsSelected()&&!l.getIsAllRowsSelected(),onChange:p=>{l.toggleAllRowsSelected(!!p),d(!!p)},"aria-label":"Select all","data-testid":l.getIsSomeRowsSelected()&&!l.getIsAllRowsSelected()?"select-partial":"select-all"})},cell:({row:l})=>a.jsx(Ce,{checked:l.getIsSelected(),onChange:w=>{l.toggleSelected(!!w)},"aria-label":String(l.original[u])}),enableSorting:!1,filterable:!1,accessorKey:"select",size:s},...e]:e,[e,r,n])}};function Io({data:e,columns:t,rowSelection:r}){const{finalColumns:s}=Xi({columns:t,rowSelection:r}),o=f.useMemo(()=>{if(!(r!=null&&r.isEnabled))return{};const u={};for(const n of r.selectedRows){const i=e.findIndex(l=>l[r.rowUniqueKey]===n[r.rowUniqueKey]);i!==-1&&(u[i]=!0)}return u},[e,r]);return{finalColumns:s,rowSelectionState:o}}const ko=({table:e,size:t,NoDataContent:r,isLoading:s,CustomLoader:o})=>{var i;const[u,n]=f.useState(null);return a.jsx(To,{children:s?a.jsx(Nt,{children:a.jsx(Xt,{colSpan:e.getAllColumns().length,className:"wu-text-center wu-h-[35vh] wu-loader-container",children:o||a.jsx(Re,{className:"wu-w-full"})})}):(i=e.getRowModel().rows)!=null&&i.length?e.getRowModel().rows.map((l,w)=>a.jsx(Nt,{"data-state":l.getIsSelected()&&"selected",onMouseOver:()=>n(l.id),onMouseOut:()=>n(null),className:c("wu-transition-colors wu-border-b wu-border-black/[12%]",l.getIsSelected()?u===l.id?"wu-bg-blue-p/[16%]":"wu-bg-blue-p/[8%]":"hover:wu-bg-black/[2%]"),children:l.getVisibleCells().map((d,p)=>a.jsx(Xt,{className:c("wu-py-0 wu-font-light wu-text-xs",t==="compact"?"wu-h-8":"wu-h-10",d.column.id==="actions"?"wu-opacity-0 wu-transition-opacity wu-duration-100":"",u===l.id&&d.column.id==="actions"?"wu-opacity-100 wu-visible":""),children:Ie.flexRender(d.column.columnDef.cell,d.getContext())},`${d.id}-${p}`))},`${l.id}-${w}`)):a.jsx(Nt,{children:a.jsx(Xt,{colSpan:e.getAllColumns().length,children:r})})})},Do=({table:e,sortableColumns:t,manual:r=!1,onSort:s,size:o,isRowSelected:u,HeaderAction:n,isStickyHeader:i})=>{const l=o==="compact"?"wu-h-8":"wu-h-10",w=d=>{const{id:p,columnDef:b,getIsSorted:x,toggleSorting:m}=d,{header:h}=b;if(!t.includes(p))return h;const N=x(),E=N==="asc",y=N==="desc",S=()=>{r?(m(!y),s==null||s({id:p,desc:y})):m(d.getIsSorted()==="asc")};return a.jsxs("button",{onClick:S,"aria-label":`Sort by ${h}`,className:"wu-flex wu-items-center wu-gap-4",children:[h,a.jsxs("div",{className:"wu-relative",children:[a.jsx("span",{className:c("wu-absolute -wu-top-[15px] wm-arrow-drop-down wu-text-xl",E&&"wu-hidden",!N&&"-wu-top-[11px]")}),a.jsx("span",{className:c("wu-absolute -wu-bottom-[13px] wm-arrow-drop-up wu-text-xl",y&&"wu-hidden",!N&&"-wu-bottom-[10px]")})]})]})};return a.jsxs(Eo,{className:c("wu-border-t wu-border-black/[12%] wu-bg-gray-20 wu-relative",i&&"wu-sticky wu-top-[-.5px] wu-z-10",l),children:[e.getHeaderGroups().map(d=>a.jsx(Nt,{className:"wu-relative",children:d.headers.map(p=>p.column.id==="actions"?a.jsx(Ja,{colSpan:p.colSpan,className:"wu-text-xs wu-font-medium",style:{width:`${p.getSize()}px`}},p.id):a.jsx(Ja,{colSpan:p.colSpan,className:c("wu-text-xs wu-font-medium wu-bg-[#EEEEEE]","wu-relative wu-z-0"),style:{width:`${p.getSize()}px`},children:Ie.flexRender(w(p.column),p.getContext())},p.id))},d.id)),u&&n&&a.jsxs("div",{className:c("wu-absolute wu-top-[-1px] wu-left-0 wu-right-0 wu-flex wu-items-center wu-border-b wu-border-t wu-bg-gray-20 wu-z-10",l),children:[a.jsx("div",{className:"wu-flex wu-items-center wu-px-4",style:{width:e.getVisibleLeafColumns()[0].getSize()},children:a.jsx(Ce,{checked:e.getIsSomeRowsSelected()||e.getIsAllRowsSelected(),partial:e.getIsSomeRowsSelected()&&!e.getIsAllRowsSelected(),onChange:d=>{e.toggleAllRowsSelected(!!d)},"aria-label":"Select all"})}),a.jsx("div",{className:"wu-flex-1 wu-flex wu-pr-4",children:n})]})]})},Mo=Ne.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"}}}),Zi=({data:e,columns:t,isLoading:r=!1,variant:s="unstyled",sort:o,size:u,rowSelection:n,HeaderAction:i,NoDataContent:l,stickyHeader:w=!1,CustomLoader:d,caption:p,...b})=>{var S;const{finalColumns:x,rowSelectionState:m}=Io({data:e,columns:t,rowSelection:n}),h=f.useMemo(()=>x.filter(v=>v.enableSorting).map(v=>v.accessorKey),[x]),N=((S=n==null?void 0:n.selectedRows)==null?void 0:S.length)??0,E=v=>{if(typeof v=="function"){const I=v(m),k=Object.keys(I).filter(T=>I[Number(T)]).map(T=>e[Number(T)]);n==null||n.onRowSelect(k)}},y=Ie.useReactTable({data:e,columns:x,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:m}:{}},onRowSelectionChange:E});return a.jsxs("div",{className:c("wu-text-gray-lead wu-table-container wu-relative"),children:[p&&a.jsx(Xa,{className:"wu-font-light",children:p}),a.jsxs(Ka,{...b,className:c(Mo({variant:s}),b.className),children:[a.jsx(Do,{table:y,sortableColumns:h,manual:!0,onSort:o==null?void 0:o.onSort,size:u,HeaderAction:i,isRowSelected:N>0,isStickyHeader:w}),!r&&a.jsx(ko,{table:y,size:u,NoDataContent:l,CustomLoader:d})]}),r&&a.jsx("div",{className:"wu-flex wu-items-center wu-justify-center wu-h-96",children:a.jsx(Re,{})})]})},Qi=({data:e,columns:t,variant:r="unstyled",size:s="default",sort:o,filterText:u,pagination:n,stickyHeader:i,HeaderAction:l,CustomLoader:w,NoDataContent:d,isLoading:p,caption:b,rowSelection:x,...m})=>{var L;const[h,N]=f.useState((o==null?void 0:o.initial)||[]),[E,y]=f.useState([]),[S,v]=f.useState((n==null?void 0:n.pageIndex)??0),{finalColumns:I,rowSelectionState:k}=Io({data:e,columns:t,rowSelection:x}),T=f.useMemo(()=>I.filter(W=>W.enableSorting).map(W=>W.accessorKey),[I]),M=f.useMemo(()=>I.filter(W=>W.filterable).map(W=>W.accessorKey),[I]),A=((L=x==null?void 0:x.selectedRows)==null?void 0:L.length)??0,F=W=>{const O=typeof W=="function"?W(k):W,B=Object.keys(O).filter(P=>O[Number(P)]).map(P=>e[Number(P)]);x==null||x.onRowSelect(B)},_=Ie.useReactTable({data:e,columns:I,getCoreRowModel:Ie.getCoreRowModel(),getFilteredRowModel:Ie.getFilteredRowModel(),getSortedRowModel:Ie.getSortedRowModel(),getPaginationRowModel:n?Ie.getPaginationRowModel():void 0,state:{sorting:h,columnFilters:E,...n?{pagination:n}:{},...x!=null&&x.isEnabled?{rowSelection:k}:{}},onSortingChange:N,onColumnFiltersChange:y,onRowSelectionChange:F});return f.useEffect(()=>{M.forEach(W=>{var O;(O=_.getColumn(W))==null||O.setFilterValue(u)})},[u,M,_]),f.useEffect(()=>{n&&(n==null?void 0:n.pageIndex)!==S&&(x==null||x.onRowSelect(()=>[]),_.resetRowSelection(),v(n.pageIndex))},[n==null?void 0:n.pageIndex]),a.jsx("div",{className:"wu-text-gray-lead wu-table-container wu-relative",children:a.jsxs(Ka,{...m,className:c("wu-overflow-x-auto wu-w-full",Mo({variant:r}),"wu-table-fixed",m.className),children:[b&&a.jsx(Xa,{children:b}),a.jsx(Do,{table:_,sortableColumns:T,size:s,HeaderAction:l,isRowSelected:A>0,isStickyHeader:i}),a.jsx(ko,{table:_,size:s,NoDataContent:d,CustomLoader:w,isLoading:p})]})})},_o=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}));_o.displayName="Textarea";const Ao=f.forwardRef((e,t)=>{const{Label:r,id:s=Mt(),variant:o="flat",readonly:u,maxLength:n,labelPosition:i="top",...l}=e,w=p=>{l.onChange&&l.onChange(p)},d=dt(i);return a.jsxs("div",{className:c(d,"wu-flex wu-textarea-container"),dir:l.dir,children:[a.jsx(_o,{...l,ref:t,id:s,className:c("wu-peer wu-rounded-t-sm",o==="outlined"?"wu-border wu-border-gray-subtle":"",l.className),onChange:w,readOnly:u,maxLength:n}),r&&a.jsx(be,{htmlFor:s,className:"wu-textarea-label",children:r})]})});Ao.displayName="WuTextarea";function Ri(e){if(typeof e=="string"&&e.includes("T")){const t=H.parseISO(e);return H.format(t,"HH:mm")}if(typeof e=="string"&&/^\d{2}:\d{2}:\d{2}$/.test(e)){const t=H.parse(e,"HH:mm:ss",new Date);return H.format(t,"HH:mm")}return typeof e=="string"&&/^\d{2}:\d{2}$/.test(e)?e:"00:00"}const Wo=["12",...Array.from({length:11},(e,t)=>String(t+1).padStart(2,"0"))],Po=Array.from({length:60},(e,t)=>String(t).padStart(2,"0")),Lo=["am","pm"],Zt=50;function ec(e){return Array(Zt).fill(e).flat()}function Za(e,t){const r=e.indexOf(t);return[...e.slice(r),...e.slice(0,r)]}function tc(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 Oo(e){const t=Number(e),r=t>=12?"pm":"am",s=t%12===0?12:t%12;return{hour:String(s),meridiem:r}}const ac=({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}),Qa=({values:e,selectedValue:t,scrollRef:r,onSelect:s,repeatItems:o=!0,className:u})=>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]",u),role:"presentation",children:(o?ec(e):e).map((n,i)=>a.jsx(ac,{value:n,isSelected:n===t,onClick:()=>s(n)},`${n}-${i}`))});function rc(e,t,r,s){const o=f.useMemo(()=>e?Za(Wo,t.padStart(2,"0")):Wo,[e]),u=f.useMemo(()=>e?Za(Po,r.padStart(2,"0")):Po,[e]),n=f.useMemo(()=>e?Za(Lo,s):Lo,[e]);return{rotatedHours:o,rotatedMinutes:u,rotatedMeridiem:n}}function sc(e,t,r){f.useEffect(()=>{function s(n){if(n){const i=n.scrollHeight/Zt,l=Math.floor(Zt/2);n.scrollTop=l*i;const w=()=>{const{scrollTop:d}=n,p=Math.round(d/i);(p<=1||p>=Zt-2)&&(n.scrollTop=l*i)};return n.addEventListener("scroll",w),()=>{n.removeEventListener("scroll",w)}}}if(!e)return;const o=s(t.current),u=s(r.current);return()=>{o==null||o(),u==null||u()}},[e,t,r])}const Fo=({className:e,time:t,Label:r,labelPosition:s,dir:o,...u})=>{const[n,i]=f.useState(!1),[l,w]=f.useState(""),d=f.useRef(null),p=f.useRef(null),b=f.useRef(null),x=f.useRef(null),[m,h]=f.useState("12"),[N,E]=f.useState("00"),[y,S]=f.useState("am");f.useEffect(()=>{if(!t){w(""),h("12"),E("00"),S("am"),d.current&&(d.current.value="");return}const M=Ri(t);w(M);const[A,F]=M.split(":"),{hour:_,meridiem:L}=Oo(A);h(_),E(F),S(L),d.current&&(d.current.value=M)},[t]),f.useEffect(()=>{const M=A=>{p.current&&!p.current.contains(A.target)&&i(!1)};return document.addEventListener("mousedown",M),()=>{document.removeEventListener("mousedown",M)}},[]),sc(n,b,x);const{rotatedHours:v,rotatedMinutes:I,rotatedMeridiem:k}=rc(n,m,N,y),T=f.useCallback((M,A,F)=>{const _=M??m,L=A??N,W=F??y;h(_),E(L),S(W);const O=`${tc(_,W)}:${L}`;w(O)},[m,N,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:o,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:o,children:[a.jsx(ze,{ref:d,type:"time",value:l,variant:"flat",role:"textbox",onChange:M=>{w(M.target.value);const[A,F]=M.target.value.split(":"),{hour:_,meridiem:L}=Oo(A);h(_),E(F),S(L)},className:"wu-w-[136px] wu-h-8 wu-pr-6 wu-border wu-border-lead/40 wu-text-gray-lead wu-timepicker-input",style:{WebkitAppearance:"none",MozAppearance:"textfield"},Icon:a.jsx(Pe,{icon:"wm-schedule",className:c("wu-text-base",u.disabled&&"wu-text-lead/50 wu-pointer-events-none wu-opacity-50"),onClick:()=>i(M=>!M),"data-testid":"wu-timepicker-icon"}),iconPosition:"right",dir:o,...u}),a.jsx("style",{children:`
8
8
  input[type="time"]::-webkit-calendar-picker-indicator { display: none; }
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(er,{values:v,selectedValue:h.padStart(2,"0"),scrollRef:b,onSelect:_=>T(_,N),className:"wu-time-hour-picker"}),a.jsx(er,{values:k,selectedValue:N.padStart(2,"0"),scrollRef:x,onSelect:_=>T(h,_),className:"wu-time-minute-picker"}),a.jsx(er,{values:D,selectedValue:y,onSelect:_=>T(void 0,void 0,_),className:"wu-time-meridiem-picker",repeatItems:!1})]})]})]})};qu.displayName="WuTimePicker";const wc=1,dc=1e6;let tr=0;function fc(){return tr=(tr+1)%Number.MAX_SAFE_INTEGER,tr.toString()}const ar=new Map,Vu=e=>{if(ar.has(e))return;const t=setTimeout(()=>{ar.delete(e),Ct({type:"REMOVE_TOAST",toastId:e})},dc);ar.set(e,t)},pc=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,wc)};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?Vu(r):e.toasts.forEach(s=>{Vu(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)}}},Rt=[];let ea={toasts:[]};function Ct(e){ea=pc(ea,e),Rt.forEach(t=>{t(ea)})}function zu({...e}){const t=fc(),r=u=>Ct({type:"UPDATE_TOAST",toast:{...u,id:t}}),s=()=>Ct({type:"DISMISS_TOAST",toastId:t});return Ct({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:u=>{u||s()}}}),{id:t,dismiss:s,update:r}}function bc(){const[e,t]=f.useState(ea);return f.useEffect(()=>(Rt.push(t),()=>{const r=Rt.indexOf(t);r>-1&&Rt.splice(r,1)}),[e]),{...e,toast:zu,dismiss:r=>Ct({type:"DISMISS_TOAST",toastId:r})}}const gc=()=>({showToast:({message:t,variant:r,duration:s,position:u})=>zu({description:t,variant:r,duration:s,position:u})}),hc=pe.Provider,mc=Se.cva("wu-fixed wu-z-[100] wu-flex wu-max-h-screen wu-w-full wu-flex-col-reverse wu-px-4 wu-py-2 sm:wu-flex-col md:wu-max-w-[720px] wu-w-fit wu-toast-container",{variants:{position:{topRight:"wu-right-0 wu-top-0",top:"wu-top-0 wu-left-1/2 wu--translate-x-1/2",topLeft:"wu-left-0 wu-top-0",bottom:"wu-bottom-0 wu-left-1/2 wu--translate-x-1/2",bottomRight:"wu-right-0 wu-bottom-0",bottomLeft:"wu-left-0 wu-bottom-0"}},defaultVariants:{position:"top"}}),Hu=g.forwardRef(({className:e,position:t,...r},s)=>a.jsx(pe.Viewport,{ref:s,className:c(mc({position:t}),e),...r}));Hu.displayName=pe.Viewport.displayName;const xc=Se.cva("group wu-pointer-events-auto wu-text-xs wu-font-normal wu-relative wu-flex wu-w-full wu-min-h-12 wu-items-center wu-justify-between wu-overflow-hidden wu-px-4 wu-pr-0 wu-py-2 wu-shadow-sm wu-transition-all data-[swipe=cancel]:wu-translate-y-0 data-[swipe=end]:wu-translate-y-[var(--radix-toast-swipe-end-y)] data-[swipe=move]:wu-translate-y-[var(--radix-toast-swipe-move-y)] data-[swipe=move]:wu-transition-none data-[state=open]:wu-animate-in data-[state=closed]:wu-animate-out data-[swipe=end]:wu-animate-out data-[state=closed]:wu-fade-out-80",{variants:{variant:{default:"wu-border wu-bg-white wu-text-text",success:"wu-text-green-deep wu-bg-green-soft",error:"wu-text-red-deep wu-bg-red-soft",warning:"wu-text-yellow-deep wu-bg-yellow-soft",info:"wu-text-blue-deep wu-bg-blue-soft"},position:{topRight:"data-[state=closed]:wu-slide-out-to-top-full data-[state=open]:wu-slide-in-from-top-full",top:"data-[state=closed]:wu-slide-out-to-top-full data-[state=open]:wu-slide-in-from-top-full",topLeft:"data-[state=closed]:wu-slide-out-to-top-full data-[state=open]:wu-slide-in-from-top-full",bottom:"data-[state=closed]:wu-slide-out-to-bottom-full data-[state=open]:wu-slide-in-from-bottom-full",bottomRight:"data-[state=closed]:wu-slide-out-to-bottom-full data-[state=open]:wu-slide-in-from-bottom-full",bottomLeft:"data-[state=closed]:wu-slide-out-to-bottom-full data-[state=open]:wu-slide-in-from-bottom-full"}},defaultVariants:{variant:"success",position:"top"}}),$u=g.forwardRef(({className:e,variant:t,position:r,...s},u)=>a.jsx(pe.Root,{ref:u,className:c(xc({variant:t,position:r}),e),...s}));$u.displayName=pe.Root.displayName;const yc=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}));yc.displayName=pe.Action.displayName;const Uu=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"})}));Uu.displayName=pe.Close.displayName;const ju=g.forwardRef(({className:e,...t},r)=>a.jsx(pe.Title,{ref:r,className:c("wu-text-sm wu-font-semibold",e),...t}));ju.displayName=pe.Title.displayName;const Gu=g.forwardRef(({className:e,...t},r)=>a.jsx(pe.Description,{ref:r,className:c("wu-text-sm wu-opacity-90",e),...t}));Gu.displayName=pe.Description.displayName;function vc(){const{toasts:e}=bc(),t=e.reduce((r,s)=>{const u=s.position||"top";return r[u]||(r[u]=[]),r[u].push(s),r},{});return a.jsx(hc,{children:Object.entries(t).map(([r,s])=>a.jsx(Hu,{position:r,children:s.map(function({id:u,title:o,description:n,action:i,variant:l,position:w,...d}){const p={success:"wm-check-circle",info:"wm-info",warning:"wm-error",error:"wm-cancel"};return a.jsxs($u,{variant:l||"success",position:w,...d,children:[a.jsxs("div",{className:"wu-grid wu-gap-1",children:[o&&a.jsx(ju,{children:o}),n&&a.jsxs(Gu,{className:"wu-flex wu-items-center wu-gap-3 wu-pr-6",children:[a.jsx(Le,{icon:p[l||"success"],className:"wu-text-xl"}),n]})]}),i,a.jsx(Uu,{})]},u)})},r))})}const Nc=()=>a.jsx(vc,{}),Yu=g.forwardRef(({className:e,dir:t,...r},s)=>a.jsx(ua.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(ua.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")})}));Yu.displayName=ua.Root.displayName;const Ku=f.forwardRef((e,t)=>{const{Label:r,labelPosition:s="right",onChange:u,className:o,dir:n,disabled:i,id:l=_t(),...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(Sc({labelPosition:s}),"wu-toggle-container"),dir:n,children:[a.jsx(Yu,{...w,id:l,disabled:i,ref:t,onCheckedChange:u,className:c("wu-peer",o),dir:n}),a.jsx(be,{htmlFor:l,className:"wu-toggle-label",children:r})]})});Ku.displayName="WuToggle";const Sc=Se.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"}}});let ot={},ta={},rr=!1;function Cc(e){ta=e}async function Ec(e,t){if(rr)return ot;t&&(ta=t);try{const r=await fetch(e);if(!r.ok)throw new Error(`Failed to fetch translations: ${r.status} ${r.statusText}`);return ot=await r.json()??{},rr=!0,ot}catch(r){return console.error("Error loading translations:",r),ot=ta,rr=!0,ot}}function Ju(e){return ot[e]??ta[e]??e}function Tc(){return{t:f.useCallback(t=>Ju(t),[])}}const Ic={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"}},Xu={main:"_main_1uzld_1",container:"_container_1uzld_5"},Zu=f.forwardRef(({className:e,children:t,isOpen:r=!1,contentOffset:s=48,contentOffsetFactor:u=4,header:o,contentAnimation:n="wu-fade-zoom",headerAnimation:i="wu-slide-up-down",dir:l="ltr"},w)=>{const[d,p]=f.useState(`${n}-view-in`),[b,x]=f.useState(`${i}-header-in`),h=f.useRef(null),m=f.useRef(null),[N,E]=f.useState(!1),[y,C]=f.useState(!1),v=()=>{E(!0)},k=()=>{C(!0)};return f.useEffect(()=>{N&&y&&(d.includes("in")?(p(`${n}-view-out`),x(`${i}-header-out`)):(p(`${n}-view-in`),x(`${i}-header-in`)),E(!1),C(!1))},[N,y]),a.jsxs("div",{className:c(Xu.main),ref:w,children:[a.jsx(Dt.SwitchTransition,{mode:"out-in",children:a.jsx(Dt.CSSTransition,{nodeRef:m,addEndListener:D=>{h.current&&h.current.addEventListener("transitionend",D,!0)},classNames:b,unmountOnExit:!0,children:o?o(m):null},r?"header-visible":"header-hidden")}),a.jsx(Dt.SwitchTransition,{mode:"out-in",children:a.jsx(Dt.CSSTransition,{nodeRef:h,classNames:d,addEndListener:D=>{h.current&&h.current.addEventListener("transitionend",D,!0)},onExited:v,onEntered:k,unmountOnExit:!0,children:a.jsx("div",{ref:h,className:c(Xu.container,e),style:{padding:r?kc(s,u,l):"0px"},children:t})},r?"details":"card")})]})});Zu.displayName="WuDrilldown";function kc(e,t,r){return typeof e=="number"?r==="rtl"?`${e}px ${e/2}px ${e/t}px ${e/t}px`:`${e}px ${e/t}px ${e/t}px ${e/2}px`:e}window.wickUiVersion="1.16.1",S.CHART_COLOR_SYSTEM=Ic,S.WuAccordion=xo,S.WuAppHeader=Uo,S.WuAppHeaderAccount=br,S.WuAppHeaderBar=yr,S.WuAppHeaderHelp=gr,S.WuAppHeaderMenu=xr,S.WuAppHeaderSearch=Ho,S.WuButton=me,S.WuCalender=ba,S.WuCard=kr,S.WuCheckbox=Ee,S.WuChip=Ro,S.WuCombobox=ln,S.WuCopyToClipboard=cn,S.WuDataTable=rc,S.WuDatePicker=Go,S.WuDateRangePicker=Jo,S.WuDisplay=Mo,S.WuDrawer=hn,S.WuDrawerClose=mn,S.WuDrilldown=Zu,S.WuFooter=Ur,S.WuFormGroup=zo,S.WuHeading=ko,S.WuHelpButton=jr,S.WuIcon=Le,S.WuInput=He,S.WuInputError=Bo,S.WuInputHint=qo,S.WuLabel=be,S.WuListbox=En,S.WuLoader=Re,S.WuMenu=Yr,S.WuMenuCheckboxItem=Tn,S.WuMenuIcon=Ea,S.WuMenuItem=Sa,S.WuMenuItemGroup=In,S.WuMenuRadioItem=kn,S.WuMenuSeparatorItem=Dn,S.WuModal=Bn,S.WuModalClose=Hn,S.WuModalContent=qn,S.WuModalFooter=zn,S.WuModalHeader=Vn,S.WuMonthPicker=Xn,S.WuPagination=ls,S.WuPopover=el,S.WuPopoverClose=tl,S.WuPrimaryNavbar=Qn,S.WuRadioGroup=ds,S.WuScrollArea=al,S.WuSecondaryNavbar=Rn,S.WuSelect=us,S.WuSidebar=vl,S.WuSidebarContent=Nl,S.WuSidebarFooter=Sl,S.WuSidebarGroup=Cl,S.WuSidebarItem=Tl,S.WuSidebarMenu=El,S.WuSidebarTrigger=ks,S.WuSpotlight=es,S.WuStackedCard=Dl,S.WuStackedCardOverlay=Ml,S.WuStepper=Yi,S.WuSubMenu=Mn,S.WuSubtext=Do,S.WuSwitcher=Nu,S.WuTab=ec,S.WuTable=sc,S.WuText=Io,S.WuTextarea=Pu,S.WuTimePicker=qu,S.WuToast=Nc,S.WuToggle=Ku,S.WuTooltip=Wt,S.WuTruncatedLabel=$o,S.WuVirtualScroll=et,S.calculatePosition=kl,S.loadTranslations=Ec,S.setFallbackTranslations=Cc,S.translate=Ju,S.useTranslation=Tc,S.useWuShowToast=gc,S.useWuSidebar=Ue,Object.defineProperty(S,Symbol.toStringTag,{value:"Module"})});
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(Qa,{values:v,selectedValue:m.padStart(2,"0"),scrollRef:b,onSelect:M=>T(M,N),className:"wu-time-hour-picker"}),a.jsx(Qa,{values:I,selectedValue:N.padStart(2,"0"),scrollRef:x,onSelect:M=>T(m,M),className:"wu-time-minute-picker"}),a.jsx(Qa,{values:k,selectedValue:y,onSelect:M=>T(void 0,void 0,M),className:"wu-time-meridiem-picker",repeatItems:!1})]})]})]})};Fo.displayName="WuTimePicker";const oc=1,uc=1e6;let Ra=0;function nc(){return Ra=(Ra+1)%Number.MAX_SAFE_INTEGER,Ra.toString()}const er=new Map,Bo=e=>{if(er.has(e))return;const t=setTimeout(()=>{er.delete(e),St({type:"REMOVE_TOAST",toastId:e})},uc);er.set(e,t)},lc=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,oc)};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?Bo(r):e.toasts.forEach(s=>{Bo(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)}}},Qt=[];let Rt={toasts:[]};function St(e){Rt=lc(Rt,e),Qt.forEach(t=>{t(Rt)})}function qo({...e}){const t=nc(),r=o=>St({type:"UPDATE_TOAST",toast:{...o,id:t}}),s=()=>St({type:"DISMISS_TOAST",toastId:t});return St({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:o=>{o||s()}}}),{id:t,dismiss:s,update:r}}function ic(){const[e,t]=f.useState(Rt);return f.useEffect(()=>(Qt.push(t),()=>{const r=Qt.indexOf(t);r>-1&&Qt.splice(r,1)}),[e]),{...e,toast:qo,dismiss:r=>St({type:"DISMISS_TOAST",toastId:r})}}const cc=()=>({showToast:({message:t,variant:r,duration:s,position:o})=>qo({description:t,variant:r,duration:s,position:o})}),wc=pe.Provider,dc=Ne.cva("wu-fixed wu-z-[100] wu-flex wu-max-h-screen wu-w-full wu-flex-col-reverse wu-px-4 wu-py-2 sm:wu-flex-col md:wu-max-w-[720px] wu-w-fit wu-toast-container",{variants:{position:{topRight:"wu-right-0 wu-top-0",top:"wu-top-0 wu-left-1/2 wu--translate-x-1/2",topLeft:"wu-left-0 wu-top-0",bottom:"wu-bottom-0 wu-left-1/2 wu--translate-x-1/2",bottomRight:"wu-right-0 wu-bottom-0",bottomLeft:"wu-left-0 wu-bottom-0"}},defaultVariants:{position:"top"}}),Vo=g.forwardRef(({className:e,position:t,...r},s)=>a.jsx(pe.Viewport,{ref:s,className:c(dc({position:t}),e),...r}));Vo.displayName=pe.Viewport.displayName;const fc=Ne.cva("group wu-pointer-events-auto wu-text-xs wu-font-normal wu-relative wu-flex wu-w-full wu-min-h-12 wu-items-center wu-justify-between wu-overflow-hidden wu-px-4 wu-pr-0 wu-py-2 wu-shadow-sm wu-transition-all data-[swipe=cancel]:wu-translate-y-0 data-[swipe=end]:wu-translate-y-[var(--radix-toast-swipe-end-y)] data-[swipe=move]:wu-translate-y-[var(--radix-toast-swipe-move-y)] data-[swipe=move]:wu-transition-none data-[state=open]:wu-animate-in data-[state=closed]:wu-animate-out data-[swipe=end]:wu-animate-out data-[state=closed]:wu-fade-out-80",{variants:{variant:{default:"wu-border wu-bg-white wu-text-text",success:"wu-text-green-deep wu-bg-green-soft",error:"wu-text-red-deep wu-bg-red-soft",warning:"wu-text-yellow-deep wu-bg-yellow-soft",info:"wu-text-blue-deep wu-bg-blue-soft"},position:{topRight:"data-[state=closed]:wu-slide-out-to-top-full data-[state=open]:wu-slide-in-from-top-full",top:"data-[state=closed]:wu-slide-out-to-top-full data-[state=open]:wu-slide-in-from-top-full",topLeft:"data-[state=closed]:wu-slide-out-to-top-full data-[state=open]:wu-slide-in-from-top-full",bottom:"data-[state=closed]:wu-slide-out-to-bottom-full data-[state=open]:wu-slide-in-from-bottom-full",bottomRight:"data-[state=closed]:wu-slide-out-to-bottom-full data-[state=open]:wu-slide-in-from-bottom-full",bottomLeft:"data-[state=closed]:wu-slide-out-to-bottom-full data-[state=open]:wu-slide-in-from-bottom-full"}},defaultVariants:{variant:"success",position:"top"}}),zo=g.forwardRef(({className:e,variant:t,position:r,...s},o)=>a.jsx(pe.Root,{ref:o,className:c(fc({variant:t,position:r}),e),...s}));zo.displayName=pe.Root.displayName;const pc=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}));pc.displayName=pe.Action.displayName;const Ho=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"})}));Ho.displayName=pe.Close.displayName;const $o=g.forwardRef(({className:e,...t},r)=>a.jsx(pe.Title,{ref:r,className:c("wu-text-sm wu-font-semibold",e),...t}));$o.displayName=pe.Title.displayName;const Uo=g.forwardRef(({className:e,...t},r)=>a.jsx(pe.Description,{ref:r,className:c("wu-text-sm wu-opacity-90",e),...t}));Uo.displayName=pe.Description.displayName;function bc(){const{toasts:e}=ic(),t=e.reduce((r,s)=>{const o=s.position||"top";return r[o]||(r[o]=[]),r[o].push(s),r},{});return a.jsx(wc,{children:Object.entries(t).map(([r,s])=>a.jsx(Vo,{position:r,children:s.map(function({id:o,title:u,description:n,action:i,variant:l,position:w,...d}){const p={success:"wm-check-circle",info:"wm-info",warning:"wm-error",error:"wm-cancel"};return a.jsxs(zo,{variant:l||"success",position:w,...d,children:[a.jsxs("div",{className:"wu-grid wu-gap-1",children:[u&&a.jsx($o,{children:u}),n&&a.jsxs(Uo,{className:"wu-flex wu-items-center wu-gap-3 wu-pr-6",children:[a.jsx(Pe,{icon:p[l||"success"],className:"wu-text-xl"}),n]})]}),i,a.jsx(Ho,{})]},o)})},r))})}const gc=()=>a.jsx(bc,{}),jo=g.forwardRef(({className:e,dir:t,...r},s)=>a.jsx(ra.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(ra.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")})}));jo.displayName=ra.Root.displayName;const Go=f.forwardRef((e,t)=>{const{Label:r,labelPosition:s="right",onChange:o,className:u,dir:n,disabled:i,id:l=Mt(),...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(hc({labelPosition:s}),"wu-toggle-container"),dir:n,children:[a.jsx(jo,{...w,id:l,disabled:i,ref:t,onCheckedChange:o,className:c("wu-peer",u),dir:n}),a.jsx(be,{htmlFor:l,className:"wu-toggle-label",children:r})]})});Go.displayName="WuToggle";const hc=Ne.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"}}}),Yo={main:"_main_1uzld_1",container:"_container_1uzld_5"},Ko=f.forwardRef(({className:e,children:t,isOpen:r=!1,contentOffset:s=48,contentOffsetFactor:o=4,header:u,contentAnimation:n="wu-fade-zoom",headerAnimation:i="wu-slide-up-down",dir:l="ltr"},w)=>{const[d,p]=f.useState(`${n}-view-in`),[b,x]=f.useState(`${i}-header-in`),m=f.useRef(null),h=f.useRef(null),[N,E]=f.useState(!1),[y,S]=f.useState(!1),v=()=>{E(!0)},I=()=>{S(!0)};return f.useEffect(()=>{N&&y&&(d.includes("in")?(p(`${n}-view-out`),x(`${i}-header-out`)):(p(`${n}-view-in`),x(`${i}-header-in`)),E(!1),S(!1))},[N,y]),a.jsxs("div",{className:c(Yo.main),ref:w,children:[a.jsx(kt.SwitchTransition,{mode:"out-in",children:a.jsx(kt.CSSTransition,{nodeRef:h,addEndListener:k=>{m.current&&m.current.addEventListener("transitionend",k,!0)},classNames:b,unmountOnExit:!0,children:u?u(h):null},r?"header-visible":"header-hidden")}),a.jsx(kt.SwitchTransition,{mode:"out-in",children:a.jsx(kt.CSSTransition,{nodeRef:m,classNames:d,addEndListener:k=>{m.current&&m.current.addEventListener("transitionend",k,!0)},onExited:v,onEntered:I,unmountOnExit:!0,children:a.jsx("div",{ref:m,className:c(Yo.container,e),style:{padding:r?mc(s,o,l):"0px"},children:t})},r?"details":"card")})]})});Ko.displayName="WuDrilldown";function mc(e,t,r){return typeof e=="number"?r==="rtl"?`${e}px ${e/2}px ${e/t}px ${e/t}px`:`${e}px ${e/t}px ${e/t}px ${e/2}px`:e}window.wickUiVersion="1.18.0",C.CHART_COLOR_SYSTEM=fu,C.WuAccordion=gu,C.WuAppHeader=zu,C.WuAppHeaderAccount=dr,C.WuAppHeaderBar=hr,C.WuAppHeaderHelp=fr,C.WuAppHeaderMenu=gr,C.WuAppHeaderSearch=qu,C.WuButton=me,C.WuCalender=fa,C.WuCard=Er,C.WuCheckbox=Ce,C.WuChip=Xu,C.WuCombobox=on,C.WuCopyToClipboard=un,C.WuDataTable=Zi,C.WuDatePicker=$u,C.WuDateRangePicker=Gu,C.WuDisplay=Iu,C.WuDrawer=pn,C.WuDrawerClose=bn,C.WuDrilldown=Ko,C.WuFooter=zr,C.WuFormGroup=Bu,C.WuHeading=Eu,C.WuHelpButton=Hr,C.WuIcon=Pe,C.WuInput=ze,C.WuInputError=Lu,C.WuInputHint=Ou,C.WuLabel=be,C.WuListbox=Nn,C.WuLoader=Re,C.WuMenu=Ur,C.WuMenuCheckboxItem=Sn,C.WuMenuIcon=Sa,C.WuMenuItem=va,C.WuMenuItemGroup=Cn,C.WuMenuRadioItem=En,C.WuMenuSeparatorItem=Tn,C.WuModal=Ln,C.WuModalClose=qn,C.WuModalContent=On,C.WuModalFooter=Bn,C.WuModalHeader=Fn,C.WuMonthPicker=Un,C.WuPagination=os,C.WuPopover=Kn,C.WuPopoverClose=Jn,C.WuPrimaryNavbar=Gn,C.WuRadioGroup=is,C.WuScrollArea=Xn,C.WuSecondaryNavbar=Yn,C.WuSelect=as,C.WuSidebar=bl,C.WuSidebarContent=gl,C.WuSidebarFooter=hl,C.WuSidebarGroup=ml,C.WuSidebarItem=yl,C.WuSidebarMenu=xl,C.WuSidebarTrigger=Es,C.WuSpotlight=Zr,C.WuStackedCard=Sl,C.WuStackedCardOverlay=Cl,C.WuStepper=zi,C.WuSubMenu=In,C.WuSubtext=Tu,C.WuSwitcher=yo,C.WuTab=Ki,C.WuTable=Qi,C.WuText=Cu,C.WuTextarea=Ao,C.WuTimePicker=Fo,C.WuToast=gc,C.WuToggle=Go,C.WuTooltip=At,C.WuTruncatedLabel=Vu,C.WuVirtualScroll=et,C.calculatePosition=Nl,C.useWuShowToast=cc,C.useWuSidebar=$e,Object.defineProperty(C,Symbol.toStringTag,{value:"Module"})}));
10
10
  //# sourceMappingURL=index.js.map