@npm-questionpro/wick-ui-lib 1.21.0 → 1.22.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.
Files changed (38) hide show
  1. package/dist/src/components/appHeader/components/WuAppHeaderDropdownWrapper.d.ts +1 -0
  2. package/dist/src/components/card/index.d.ts +1 -1
  3. package/dist/src/components/contentEditor/WuContentEditor.d.ts +8 -0
  4. package/dist/src/components/contentEditor/extentions/config.d.ts +2 -0
  5. package/dist/src/components/contentEditor/extentions/fontFamily.d.ts +2 -0
  6. package/dist/src/components/contentEditor/extentions/fontSize.d.ts +1 -0
  7. package/dist/src/components/contentEditor/extentions/formatAlignment.d.ts +2 -0
  8. package/dist/src/components/contentEditor/extentions/formatClear.d.ts +1 -0
  9. package/dist/src/components/contentEditor/extentions/formatCode.d.ts +1 -0
  10. package/dist/src/components/contentEditor/extentions/formatColor.d.ts +1 -0
  11. package/dist/src/components/contentEditor/extentions/formatList.d.ts +2 -0
  12. package/dist/src/components/contentEditor/extentions/formatScript.d.ts +1 -0
  13. package/dist/src/components/contentEditor/extentions/formatStyle.d.ts +2 -0
  14. package/dist/src/components/contentEditor/extentions/formatText.d.ts +2 -0
  15. package/dist/src/components/contentEditor/extentions/image.d.ts +2 -0
  16. package/dist/src/components/contentEditor/extentions/link.d.ts +2 -0
  17. package/dist/src/components/contentEditor/extentions/table.d.ts +1 -0
  18. package/dist/src/components/contentEditor/hooks/useToolbar.d.ts +15 -0
  19. package/dist/src/components/contentEditor/index.d.ts +2 -0
  20. package/dist/src/components/contentEditor/ui/InlineDropdown.d.ts +20 -0
  21. package/dist/src/components/contentEditor/ui/Toolbar.d.ts +6 -0
  22. package/dist/src/index.d.ts +1 -1
  23. package/dist/style.css +1 -1
  24. package/dist/wick-ui-lib/es/index.js +5510 -5305
  25. package/dist/wick-ui-lib/umd/index.js +8 -6
  26. package/package.json +27 -14
  27. package/dist/src/components/editor/WuEditor.d.ts +0 -9
  28. package/dist/src/components/editor/index.d.ts +0 -2
  29. package/dist/src/components/editor/partials/ImageModal.d.ts +0 -1
  30. package/dist/src/components/editor/partials/LinkModal.d.ts +0 -9
  31. package/dist/src/components/editor/partials/Menubar.d.ts +0 -1
  32. package/dist/src/components/editor/partials/TablePopover.d.ts +0 -1
  33. package/dist/src/components/editor/partials/config.d.ts +0 -2
  34. package/dist/src/components/editor/partials/fontFamily.d.ts +0 -1
  35. package/dist/src/components/editor/partials/helper.d.ts +0 -3
  36. package/dist/src/components/editor/partials/toolbarItems.d.ts +0 -20
  37. package/dist/src/components/editor/partials/wuEditorContext.d.ts +0 -13
  38. /package/dist/src/components/{editor/WuEditor.test.d.ts → contentEditor/WuContentEditor.test.d.ts} +0 -0
@@ -1,10 +1,12 @@
1
- (function(N,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"),require("@tiptap/react"),require("@tiptap/extension-subscript"),require("@tiptap/starter-kit"),require("@tiptap/extension-superscript"),require("@tiptap/extension-text-style"),require("@tiptap/extension-image"),require("@tiptap/extension-text-align"),require("@tiptap/extension-list"),require("@tiptap/extension-table")):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","@tiptap/react","@tiptap/extension-subscript","@tiptap/starter-kit","@tiptap/extension-superscript","@tiptap/extension-text-style","@tiptap/extension-image","@tiptap/extension-text-align","@tiptap/extension-list","@tiptap/extension-table"],a):(N=typeof globalThis<"u"?globalThis:N||self,a(N["wick-ui-lib"]={},N["react/jsx-runtime"],N.RadixUIAccordion,N.React,N.clsx,N.tailwindMerge,N.RadixUIAvatar,N.RadixUISlot,N.ClassVarianceAuthority,N.RadixUILabel,N.RadixUITooltip,N.dateFns,N.RadixUIPopover,N.ReactDayPicker,N.RadixUICheckbox,N.cmdk,N.ReactVirtuoso,N.RadixUIDropdownMenu,N.RadixUIDialog,N.RadixUIScrollArea,N.RadixUIRadioGroup,N.RadixUISeparator,N.ReactDOM,N.RadixUIToggleGroup,N.RadixUIToggle,N.RadixUITabs,N.TanstackReactTable,N.RadixUIToast,N.RadixUISwitch,N.ReactTransitionGroup,N.TipTapReact,N.TipTapExtensionSubscript,N.TipTapStarterKit,N.TipTapExtensionSuperscript,N.TipTapExtensionTextStyle,N.TipTapExtensionImage,N.TipTapExtensionTextAlign,N.TipTapExtensionList,N.TipTapExtensionTable))})(this,(function(N,a,Je,p,wn,dn,fn,Xe,Ee,pn,na,U,lt,dr,hn,fe,bn,fr,pr,gn,mn,xn,yn,vn,Nn,Cn,Me,Sn,kn,Mt,hr,En,Tn,In,Ze,Dn,Mn,br,An){"use strict";var Rc=Object.defineProperty;var ew=(N,a,Je)=>a in N?Rc(N,a,{enumerable:!0,configurable:!0,writable:!0,value:Je}):N[a]=Je;var Dt=(N,a,Je)=>ew(N,typeof a!="symbol"?a+"":a,Je);function oe(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 ze=oe(Je),x=oe(p),Qe=oe(fn),gr=oe(pn),it=oe(na),ct=oe(lt),ua=oe(hn),Z=oe(fr),Y=oe(pr),He=oe(gn),wt=oe(mn),mr=oe(xn),_n=oe(yn),At=oe(vn),xr=oe(Nn),$e=oe(Cn),be=oe(Sn),la=oe(kn),Wn=dn.extendTailwindMerge({prefix:"wu-"});function c(...e){return Wn(wn.clsx(e))}const ia=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 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 Ln=e=>e?/\S+@questionpro\.com/.test(e):!1,yr=ze.Root,ca=x.forwardRef(({className:e,...t},r)=>a.jsx(ze.Item,{ref:r,className:c("wu-border-b",e),...t}));ca.displayName="AccordionItem";const wa=x.forwardRef(({className:e,children:t,...r},s)=>a.jsx(ze.Header,{className:"wu-flex",children:a.jsxs(ze.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"})]})}));wa.displayName=ze.Trigger.displayName;const da=x.forwardRef(({className:e,children:t,...r},s)=>a.jsx(ze.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})}));da.displayName=ze.Content.displayName;const Pn=e=>{const{items:t,className:r,dir:s="ltr"}=e;if(e.type==="multiple"){const{defaultValue:o=[],value:n,onValueChange:u}=e;return a.jsx(yr,{type:"multiple",className:"wu-w-full wu-accordion-container",defaultValue:o,value:n,onValueChange:u,dir:s,children:t.map(({value:i,Summary:l,Details:w,className:d})=>a.jsxs(ca,{value:i,dir:s,className:c(r,d),children:[a.jsx(wa,{dir:s,className:"wu-accordion-summary",children:l}),a.jsx(da,{dir:s,className:"wu-accordion-details",children:w})]},i))})}else{const{defaultValue:o,value:n,onValueChange:u}=e;return a.jsx(yr,{type:"single",className:"wu-w-full wu-accordion-container",defaultValue:o,value:n,onValueChange:u,dir:s,collapsible:!0,children:t.map(({value:i,Summary:l,Details:w,className:d})=>a.jsxs(ca,{value:i,dir:s,className:c(r,d),children:[a.jsx(wa,{dir:s,className:"wu-accordion-summary",children:l}),a.jsx(da,{dir:s,className:"wu-accordion-details",children:w})]},i))})}},vr=x.forwardRef(({className:e,...t},r)=>a.jsx(Qe.Root,{ref:r,className:c("wu-relative wu-flex wu-h-10 wu-w-10 wu-shrink-0 wu-overflow-hidden wu-rounded-full",e),...t}));vr.displayName=Qe.Root.displayName;const Nr=x.forwardRef(({className:e,...t},r)=>a.jsx(Qe.Image,{ref:r,className:c("wu-aspect-square wu-h-full wu-w-full",e),...t}));Nr.displayName=Qe.Image.displayName;const Cr=x.forwardRef(({className:e,...t},r)=>a.jsx(Qe.Fallback,{ref:r,className:c("wu-flex wu-h-full wu-w-full wu-items-center wu-justify-center wu-rounded-full wu-bg-muted",e),...t}));Cr.displayName=Qe.Fallback.displayName;function fa(e,t){p.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 pa={dropdownContainer:"_dropdownContainer_vvlo9_1",open:"_open_vvlo9_1",dropdownMenu:"_dropdownMenu_vvlo9_1"},Sr=({dir:e,Trigger:t,triggerClassName:r,DropdownContent:s})=>{const[o,n]=p.useState(!1),u=p.useRef(null),i=p.useRef(null);fa([u,i],()=>n(!1));const l=()=>{n(!o)};return a.jsx(a.Fragment,{children:a.jsx("div",{className:pa.dropdownContainer,children:a.jsx("ul",{children:a.jsxs("li",{className:c("wu-flex wu-relative",o&&pa.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(pa.dropdownMenu,{open:o},e==="rtl"?"wu-left-[-10px] wu-top-[38px]":"wu-right-[-7px] wu-top-[38px]"),dir:e,ref:u,"aria-label":"user-menu",children:s})]})})})})},ha=Ee.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:[]}),Re=x.forwardRef(({className:e,variant:t,size:r,color:s,asChild:o=!1,...n},u)=>{const i=o?Xe.Slot:"button";return a.jsx(i,{className:c(ha({size:r,color:s,variant:t,className:e})),ref:u,...n})});Re.displayName="Button";const et=p.forwardRef((e,t)=>Fn(e,t)),Fn=(e,t)=>{const{size:r="md",color:s="#1B87E6",variant:o="dots",...n}=e,u=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",{...n,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",{...n,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:u,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})};et.displayName="WuLoader";const we=p.forwardRef(({disabled:e,loading:t,variant:r="primary",size:s="md",Icon:o,iconPosition:n="left",children:u,floating:i,className:l,color:w="primary",selected:d,...f},h)=>{const b={primary:"#1986e688",upgrade:"#f5830088",error:"#ef444488"};return a.jsxs(Re,{...f,disabled:e,variant:r,size:s,className:c(i&&"wu-shadow-qp","wu-flex wu-items-center wu-justify-center wu-gap-2",n==="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?b[w]:"",...f.style},ref:h,children:[!t&&o&&a.jsx(a.Fragment,{children:o}),t&&a.jsx(et,{color:"#fff",size:"sm"}),!t&&u]})});we.displayName="WuButton";const On=({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(we,{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"})]}),Bn=({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:n,node:u},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(n,"wu-w-12 wu-text-center")}),a.jsx("span",{children:s})]}),u]})},i))}),a.jsx("hr",{className:"wu-border-gray-subtle"})]})},qn=({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"})]}),Vn=({user:e,dir:t})=>{var r,s,o,n,u,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:(n=e==null?void 0:e.profile)==null?void 0:n.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:(u=e==null?void 0:e.license)==null?void 0:u.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})]})]})]})]})},kr=({user:e,onLogout:t,dir:r,DataCenter:s})=>{var o,n;return e?a.jsx(Sr,{Trigger:a.jsxs(vr,{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(Nr,{className:"hover:wu-opacity-80",src:(o=e==null?void 0:e.profile)==null?void 0:o.profilePicture,alt:"User"}),a.jsx(Cr,{children:(n=e==null?void 0:e.profile)==null?void 0:n.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(Vn,{user:e,dir:r}),(e==null?void 0:e.settings)&&e.settings.length>0&&a.jsx(qn,{settings:e.settings,dir:r}),a.jsx(Bn,{user:e,dir:r}),a.jsx(On,{onLogout:t,DataCenter:s})]})}):null},Er=({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(Sr,{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:()=>ia(s.link),onKeyDown:n=>{n.key==="Enter"&&ia(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(Tr,{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(Tr,{item:s,dir:t})})},o))})})},Tr=({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})]})]}),zn=e=>{const[t,r]=p.useState(()=>window.innerWidth<=e);return p.useEffect(()=>{const s=()=>{r(window.innerWidth<=e)};return window.addEventListener("resize",s),()=>{window.removeEventListener("resize",s)}},[e]),t};function Hn({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 f=w==="down"?l+1:l-1;s(f,d)},n=(i,l,w,d)=>{t!=null&&t.products&&t.products[t.products.length-1].name===d&&(i.preventDefault(),s(l+1,w))},u=(i,l)=>{i.preventDefault();const w=e[l]===t?null:e[l];r(w)};return function(l,w,d){const f=document.querySelectorAll("[data-product-category]"),{key:h}=l;switch(h){case"ArrowDown":o(l,w,"down",f);break;case"ArrowUp":o(l,w,"up",f);break;case"Tab":n(l,w,f,d);break;case"Enter":case" ":u(l,w);break}}}const $n=e=>{const{size:t="lg",className:r,children:s,...o}=e,n={sm:"wu-text-body-3",md:"wu-text-body-2",lg:"wu-text-body-1"},u=e.as||"div";return a.jsx(u,{...o,className:c(n[t],r),children:s})},Un=e=>{const{size:t="xl",className:r,children:s,...o}=e,n={sm:"h4",md:"h3",lg:"h2",xl:"h1"},u={sm:"wu-text-heading-4",md:"wu-text-heading-3",lg:"wu-text-heading-2",xl:"wu-text-heading-1"},i=n[t];return a.jsx(i,{...o,className:c(u[t],r),children:s})},jn=e=>{const{size:t="lg",className:r,children:s,...o}=e,n={sm:"wu-text-sub-3",md:"wu-text-sub-2",lg:"wu-text-sub-1"},u=e.as||"div";return a.jsx(u,{...o,className:c(n[t],r),children:s})},Gn=e=>{const{size:t="lg",className:r,children:s,...o}=e,n={md:"wu-text-display-2",lg:"wu-text-display-1"},u=e.as||"h1";return a.jsx(u,{...o,className:c(n[t],r),children:s})},ce=e=>{const{icon:t,className:r,...s}=e;return a.jsx("span",{...s,className:c(t,r),role:"presentation","aria-label":t})},Yn=({buttonRef:e,handleDropdownToggle:t,handleKeyDown:r,isDropdownOpen:s,activeProductName:o,dir:n="ltr",homeLink:u="/"})=>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:u,children:a.jsx(ce,{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",n==="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"},Kn=({category:e,dir:t="ltr",openCategory:r})=>{const s=e.active?"#c5cce0":"#f0c36a",o=(r==null?void 0:r.name)===e.name,n=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]"),u=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:n}):a.jsx("span",{className:u})]})},Jn={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"},Xn=({product:e,currentProduct:t,activeProductName:r,dir:s,focusItem:o,setFocusItem:n})=>{const[u,i]=p.useState(e.name===t),l=e.name===r,w=e.name===t,d=!e.active,f="#1b3380",h="#c5cce0",b="#ffcf70",g=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",u&&"wu-font-normal",e.active&&u&&"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&&u&&"wu-text-blue-q"),C=u||o===e.name||l?f:h;return a.jsxs("li",{className:c(ee.productListItem,"focus-visible:wu-outline-none focus:wu-outline-none wu-sub-product-list-item",(l||u)&&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:k=>{if(k.key==="Enter"){k.preventDefault();const y=k.currentTarget.querySelector("a");y&&y.click()}},onFocus:()=>{n(e.name)},onBlur:()=>n(""),children:[a.jsx("div",{className:c(ee.topBorder,s==="rtl"&&ee.topBorderRtl),style:{backgroundColor:d?b:C}}),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(m,Jn[e.icon||""]),"aria-hidden":!0}),a.jsx("span",{className:c(g),children:e.name})]})]},e.name)},Zn=({category:e,currentProduct:t,activeProductName:r,dir:s="ltr",focusItem:o,setFocusItem:n,borderColorLocked:u="#f5a300"})=>{const{products:i=[],active:l}=e,w=p.useMemo(()=>i.filter(g=>g.active).sort((g,m)=>(g.order||100)-(m.order||100)),[i]),d=p.useMemo(()=>i.filter(g=>!g.active),[i]),[f,h]=p.useState(u),b=g=>g.map((m,C)=>a.jsx(Xn,{product:m,currentProduct:t,activeProductName:r,dir:s,focusItem:o,setFocusItem:n},C));return l?a.jsxs(a.Fragment,{children:[b(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:()=>h("#f5a300"),onMouseOut:()=>h(u),"aria-label":"Upgrade to unlock",children:[a.jsx("div",{className:c(ee.topBorder,s==="rtl"&&ee.topBorderRtl),style:{backgroundColor:f},"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"]})]})]}),b(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:()=>n("learn"),onBlur:()=>n(""),"aria-label":"Learn More",children:[a.jsx("div",{className:c(ee.topBorder,s==="rtl"&&ee.topBorderRtl),style:{backgroundColor:u}}),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"})})]})},Ir=({dropdownRef:e,dir:t,isDropdownOpen:r,productCategories:s,openCategory:o,setOpenCategory:n,handleKeyDown:u,expandAll:i,activeProductName:l,focusItem:w,setFocusItem:d})=>{const f="#ffcf70",[h,b]=p.useState(window.innerWidth>768);return p.useEffect(()=>{const g=()=>{b(window.innerWidth>375)};return window.addEventListener("resize",g),()=>window.removeEventListener("resize",g)},[]),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((g,m)=>a.jsxs("li",{className:c(ee.productCategory,"focus:wu-outline-none focus-visible:wu-outline-none wu-h-16 wu-category-item",o===g&&ee.open,i&&ee.open),onMouseEnter:()=>h&&n(g),onMouseLeave:()=>h&&n(null),"aria-label":g.name,dir:t,onKeyDown:C=>u(C,m),tabIndex:0,"data-product-category":!0,children:[a.jsx(Kn,{category:g,dir:t,openCategory:o}),a.jsx("ul",{className:c(ee.productList,t==="rtl"&&ee.rtlProductList),dir:t,children:a.jsx(Zn,{category:g,dir:t,activeProductName:l,currentProduct:g.name,focusItem:w,setFocusItem:d,borderColorLocked:f})})]},g.name))})},Qn=({isProductButtonShow:e,isDropdownOpen:t,activeProductColor:r,activeProductBgColor:s,activeProductName:o,dir:n,smallScreenButtonRef:u,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?n==="rtl"?"wu-right-0 wu-overflow-hidden":"wu-translate-x-0 wu-left-0":n==="rtl"?"wu-right-0 wu-w-0":"wu--translate-x-full"),style:{backgroundColor:t?r.hover:s},children:a.jsxs("button",{ref:u,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":n==="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")})]})}),Rn=({dir:e,isProductButtonShow:t,smallScreenToggleButtonRef:r,setIsProductButtonShow:s,setDropdownOpen:o})=>{const n=()=>{s(u=>!u),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:n,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"}`})]})},Dr=({productCategories:e,activeProductName:t,activeProductColor:r={base:"#1b87e6",hover:"#54A5EC"},dir:s,homeLink:o,expandAll:n})=>{const u=p.useRef(null),i=p.useRef(null),l=p.useRef(null),w=p.useRef(null),[d,f]=p.useState(!1),[h,b]=p.useState(null),[g,m]=p.useState(r.base),[C,k]=p.useState(""),[y,S]=p.useState(!1),v=zn(768);fa([i,u],()=>{f(!1),b(null)}),fa([l,w,i],()=>{S(!1),f(!1),b(null)}),p.useEffect(()=>{const E=M=>{M.key==="Escape"&&f(!1)};return document.addEventListener("keydown",E),()=>{document.removeEventListener("keydown",E)}},[d]),p.useEffect(()=>m(r.base),[r.base]);const T=E=>{E.preventDefault(),E.stopPropagation(),f(M=>{const _=!M;return _||b(null),_})},I=(E,M)=>{Hn({productCategories:e,openCategory:h,setOpenCategory:b})(E,M,C)};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(Rn,{dir:s,isProductButtonShow:y,smallScreenToggleButtonRef:w,setDropdownOpen:f,setIsProductButtonShow:S}),a.jsx(Qn,{isProductButtonShow:y,isDropdownOpen:d,activeProductColor:r,activeProductBgColor:g,activeProductName:t,handleDropdownToggle:T,smallScreenButtonRef:l,handleKeyDown:I,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(Ir,{activeProductName:t,focusItem:C,setFocusItem:k,handleKeyDown:I,isDropdownOpen:d,openCategory:h,productCategories:e,setOpenCategory:b,dropdownRef:i,expandAll:n,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:g},onMouseOver:()=>m(r.hover),onMouseOut:()=>m(r.base),children:[a.jsx(Yn,{activeProductName:t,dir:s,homeLink:o,buttonRef:u,handleDropdownToggle:T,handleKeyDown:I,isDropdownOpen:d}),a.jsx(Ir,{activeProductName:t,focusItem:C,setFocusItem:k,handleKeyDown:I,isDropdownOpen:d,openCategory:h,productCategories:e,setOpenCategory:b,dropdownRef:i,expandAll:n,dir:s})]})})},Mr=({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})}),ba=x.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}));ba.displayName="Input";const eu=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})},tu=e=>{var i,l;const{inputRef:t,maxLength:r=50,className:s,...o}=e,[n,u]=p.useState(!1);return p.useEffect(()=>{var w;(((w=t==null?void 0:t.current)==null?void 0:w.value.length)||0)>.75*r?u(!0):u(!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:n&&`${(l=t==null?void 0:t.current)==null?void 0:l.value.length}/${r}`})},au=Ee.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"),Wt=x.forwardRef(({className:e,...t},r)=>a.jsx(gr.Root,{ref:r,className:c(au(),e),...t}));Wt.displayName=gr.Root.displayName;const ge=e=>a.jsx(Wt,{...e,className:c("wu-text-gray-lead wu-leading-6",e.className)}),ru=({Label:e,Error:t,Hint:r,Input:s,labelPosition:o="top",dir:n="ltr",className:u,...i})=>{const w=c("wu-flex",o==="top"?"wu-flex-col wu-gap-1":"wu-flex-row wu-items-center wu-gap-2",u),d=c("wu-flex wu-flex-col wu-gap-1 wu-relative wu-flex-1 wu-form-group-wrapper"),f=c("wu-absolute -wu-bottom-5",n==="ltr"?"wu-right-0":"wu-left-0","wu-form-group-hint"),h=c("wu-absolute -wu-bottom-5",n==="ltr"?"wu-left-0":"wu-right-0","wu-form-group-error");return a.jsxs("div",{className:w,dir:n,...i,children:[e,a.jsxs("div",{className:d,children:[s,r&&a.jsx("div",{className:f,children:r}),t&&a.jsx("div",{className:h,children:t})]})]})},Ae=p.forwardRef((e,t)=>{const{Label:r,labelPosition:s="top",Icon:o,iconPosition:n,type:u,value:i,variant:l="flat",readonly:w,id:d=_t(),...f}=e,h=dt(s),b=o?n!=="right"?"wu-pl-8":"wu-pr-8":"",[g,m]=p.useState(!1),C=()=>{m(y=>!y)},k=y=>{f.onChange&&f.onChange(y)};return a.jsx(a.Fragment,{children:u==="submit"?a.jsx(we,{type:"submit",className:f.className,id:d,children:r||"Submit"}):a.jsx("div",{className:c("wu-flex wu-flex-col wu-gap-2 wu-input-container"),dir:f.dir,children:a.jsxs("div",{className:c("wu-flex wu-gap-1 wu-relative",h,(s==="right"||s==="left")&&"wu-items-center","wu-input-wrapper"),children:[o&&n!=="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(ba,{...f,className:c("wu-peer wu-text-xs wu-rounded-t-sm",l==="outlined"?"wu-border wu-border-gray-subtle":"",b,f.className),type:g?"text":u,ref:t,readOnly:w,onChange:f.onChange&&k,value:i,id:d}),o&&n==="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}),u==="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:C,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:g?a.jsx("span",{className:"wm-visibility wu-text-gray-subtle"}):a.jsx("span",{className:"wm-visibility-off wu-text-gray-subtle"})})}),r&&a.jsx(ge,{htmlFor:d,className:"wu-flex-none wu-w-fit wu-input-label",children:r})]})})})});Ae.displayName="WuInput";const su=({className:e,placeholder:t="Search surveys, folders or tools",defaultCollapsed:r=!0,onSearch:s,...o})=>{const[n,u]=p.useState(r);return p.useEffect(()=>{u(r)},[r]),a.jsx(Ae,{...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",n?"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(ce,{"data-testid":"search-icon",icon:"wm-search",className:c("wu-text-gray-lead wu-cursor-pointer",n&&"wu-text-white"),onClick:()=>u(i=>!i)})})},Ar=it.Provider,_r=it.Root,Wr=it.Trigger,ga=x.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}));ga.displayName=it.Content.displayName;const Lt=p.forwardRef(({content:e,position:t,positionOffset:r,duration:s,children:o,className:n,showArrow:u=!1,open:i,onOpenChange:l,...w},d)=>a.jsx(Ar,{delayDuration:s||200,children:a.jsxs(_r,{open:i,onOpenChange:l,children:[a.jsx(Wr,{asChild:!0,children:a.jsx("span",{ref:d,children:o})}),a.jsx(na.Portal,{children:e&&a.jsxs(ga,{...w,side:t||"top",sideOffset:r||0,className:c("wu-max-w-sm wu-max-h-96 wu-overflow-y-auto",n),children:[e,u&&a.jsx(na.Arrow,{className:"wu-fill-gray-notification wu-tooltip-arrow"})]})})]})}));Lt.displayName="WuTooltip";const ou=({label:e,className:t})=>{const r=p.useRef(null),[s,o]=p.useState(!1);return p.useEffect(()=>{const n=r.current;if(n){const u=n.clientWidth,i=n.scrollWidth,l=i/e.length,w=e.length*l;o(w>u||i>u)}},[e]),a.jsx("p",{ref:r,className:c("wu-w-full wu-truncate",t),children:s?a.jsx(Lt,{content:e,positionOffset:8,children:e}):e})},nu=e=>{var f;const{productName:t,categories:r=[],user:s,children:o,onLogout:n,homeLink:u=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-[60] 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:[Ln((f=s==null?void 0:s.profile)==null?void 0:f.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(Dr,{productCategories:r,activeProductName:t,activeProductColor:i,dir:l,homeLink:u,expandAll:w})}),a.jsx(Mr,{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(Er,{dir:l}),(s==null?void 0:s.profile)&&Object.keys(s.profile).length>0&&a.jsx(kr,{user:s,onLogout:n,dir:l,DataCenter:d})]})]})})},Te=ct.Root,Be=ct.Trigger,ye=x.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})}));ye.displayName=ct.Content.displayName;function Lr({className:e,classNames:t,dir:r="ltr",...s}){const o=dr.getDefaultClassNames();return a.jsx(dr.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,ha({variant:"iconOnly"}),"wu-h-6 wu-w-6 wu-text-gray-lead"),button_previous:c(o.button_previous,ha({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})}Lr.displayName="Calendar";const ma=e=>a.jsx(Lr,{...e}),Pr=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(we,{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(we,{onClick:t,disabled:r,className:"wu-date-picker-apply",children:"Apply"})})]})},xa=({formattedString:e,dir:t,placeholder:r="Select Date",className:s,variant:o="primary",color:n,CustomTrigger:u,...i})=>a.jsx(lt.PopoverTrigger,{asChild:!u,dir:t,children:u?a.jsx(a.Fragment,{children:u(e)}):a.jsx(we,{...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})}),Fr=(e,t,r,s)=>{const o=U.startOfDay(e).getTime();return!!(t||r&&o<U.startOfDay(r).getTime()||s&&o>U.startOfDay(s).getTime())},Pt=e=>e?typeof e=="string"?new Date(e):e:new Date,ya="\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01])",uu=[{label:"Last 7 days",value:7},{label:"Last 30 days",value:30},{label:"Last 90 days",value:90},{label:"Last 365 days",value:365}],lu=({formatString:e="yyyy-MM-dd",value:t,onChange:r,disabled:s,minDate:o=U.sub(new Date,{years:5}),maxDate:n=U.add(new Date,{years:1}),dir:u="ltr",Label:i,labelPosition:l="top",onReset:w,showResetButton:d=!1,placeholder:f="Select Date",CustomTrigger:h,...b})=>{const[g,m]=p.useState(),[C,k]=p.useState(""),y=p.useCallback(()=>{const v=Pt(g);k(U.format(v,e)),r&&r(g)},[g,e,r]),S=p.useCallback(()=>{w?w():(m(void 0),k(""),r&&r(void 0))},[r,w]);return p.useEffect(()=>{const v=Pt(t);m(v),k(U.format(v,e))},[t,e]),a.jsxs(ge,{className:c("wu-flex wu-gap-1",l==="left"?"wu-items-center":"wu-flex-col wu-items-start","wu-date-picker-label"),dir:u,children:[i,a.jsxs(Te,{children:[a.jsx(xa,{formattedString:C,dir:u,placeholder:f,CustomTrigger:h,...b}),a.jsx(ye,{className:"wu-p-0 wu-w-fit wu-date-picker-content",align:"start",sideOffset:-.5,dir:u,children:a.jsx(ma,{dir:u,mode:"single",captionLayout:"dropdown",selected:g,onSelect:m,disabled:v=>Fr(v,s,o,n),startMonth:o,endMonth:n,required:!0,autoFocus:!0,defaultMonth:g,className:c("wu-border wu-border-blue-p wu-date-picker"),footer:a.jsx(Pr,{handleDateChange:y,disabled:s,onReset:S,showResetButton:d})})})]})]})},Or="yyyy-MM-dd",iu=[{label:"Day",value:1},{label:"Week",value:7},{label:"Month",value:30},{label:"Quarter",value:90},{label:"Year",value:365}],cu=({current:e,onSelect:t,presetRanges:r=uu})=>{const[s,o]=p.useState(),[n,u]=p.useState(!1),[i,l]=p.useState(""),[w,d]=p.useState(""),[f,h]=p.useState(!1),b=p.useMemo(()=>r.map(y=>y.value),[r]),g=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=p.useCallback(y=>{if(y===void 0){o(void 0),u(!0);return}const S=Number(y)-1;o(S),u(!1),t({from:U.sub(new Date,{days:S}),to:new Date})},[t]),C=p.useCallback((y,S)=>{if(!y||!(e!=null&&e.to)||!(e!=null&&e.from)||!new RegExp(ya).test(y))return!1;const T=new Date(S==="start"?y:e.from),I=new Date(S==="end"?y:e.to);return U.isBefore(I,T)?(h(!0),!1):(h(!1),!(U.isSameDay(T,e.from)&&U.isSameDay(I,e.to)))},[e]),k=p.useCallback((y,S)=>{if((S==="start"?l:d)(y),C(y,S)){const T={from:e==null?void 0:e.from,to:e==null?void 0:e.to};S==="start"&&(T.from=new Date(y)),S==="end"&&(T.to=new Date(y)),t(T)}},[e,t,C]);return p.useEffect(()=>{if(e!=null&&e.to&&(e!=null&&e.from)&&U.isValid(e.to)&&U.isValid(e.from)){l(U.format(e.from,Or)),d(U.format(e.to,Or));const y=U.differenceInCalendarDays(e.to,e.from);U.isToday(e.to)&&b.includes(y+1)?(o(y),u(!1)):(o(void 0),u(!0))}},[e,b]),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:iu.map(({label:y,value:S})=>a.jsx(Re,{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(g,s===S-1&&"wu-bg-blue-p/10"),onClick:()=>m(S),children:y})},S)),a.jsx("li",{children:a.jsx("button",{className:c(g,n&&"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(Ae,{placeholder:"Start Date",pattern:ya,value:i,onChange:y=>k(y.target.value,"start"),"aria-label":"Start Date"}),a.jsx(Ae,{placeholder:"End Date",pattern:ya,value:w,onChange:y=>k(y.target.value,"end"),"aria-label":"End Date"}),f?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"})]})]})},wu=({formatString:e="yyyy/MM/dd",value:t,onChange:r,disabled:s,minDate:o=U.sub(new Date,{years:5}),maxDate:n=U.add(new Date,{years:1}),dir:u="ltr",minDateToSelect:i,maxDateToSelect:l,presetRanges:w,Label:d,labelPosition:f="top",onReset:h,showResetButton:b=!0,placeholder:g="Select Date Range",CustomTrigger:m,...C})=>{const[k,y]=p.useState(t),[S,v]=p.useState(t),[T,I]=p.useState(""),E=p.useCallback(()=>{if(S){const O=S.from,A=S.to;y({from:O,to:A}),I(`${U.format(O,e)} - ${U.format(A,e)}`),r&&r({from:O,to:A})}},[S,e,r]),M=p.useCallback(()=>{v(k)},[k]),_=p.useCallback(()=>{h?h():(y(void 0),v(void 0),I(""),r&&r(void 0))},[h,r]);return p.useEffect(()=>{if(t!=null&&t.from&&(t!=null&&t.to)){const O=Pt(t.from),A=Pt(t.to);y(t),v(t),I(`${U.format(O,e)} - ${U.format(A,e)}`)}else y(void 0),v({to:new Date,from:new Date})},[t,e]),a.jsxs(ge,{className:c("wu-flex wu-gap-1",f==="left"?"wu-items-center":"wu-flex-col wu-items-start","wu-date-picker-label"),dir:u,children:[d,a.jsxs(Te,{onOpenChange:O=>!O&&M(),children:[a.jsx(xa,{formattedString:T,dir:u,placeholder:g,CustomTrigger:m,...C}),a.jsxs(ye,{className:"wu-flex wu-p-0 wu-border wu-w-fit wu-border-blue-p",align:"start",sideOffset:-.5,dir:u,children:[a.jsx(cu,{current:S,onSelect:v,presetRanges:w}),a.jsx(ma,{dir:u,numberOfMonths:2,mode:"range",captionLayout:"dropdown",selected:S,onSelect:v,disabled:O=>Fr(O,s,o,n),startMonth:o,endMonth:n,required:!0,autoFocus:!0,defaultMonth:k==null?void 0:k.from,className:c("wu-shadow-none wu-date-range-picker"),min:i,max:l,footer:a.jsx(Pr,{handleDateChange:E,disabled:s,onReset:_,showResetButton:b})})]})]})]})},Br=p.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})});Br.displayName="WuCard";const du=p.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)})});du.displayName="WuCardHeader";const fu=p.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)})});fu.displayName="WuCardHeader";const qr=x.forwardRef(({className:e,partial:t,...r},s)=>a.jsx(ua.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(ua.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"})]})}));qr.displayName=ua.Root.displayName;const Ie=p.forwardRef((e,t)=>{const{disabled:r,checked:s,Label:o,labelPosition:n="right",className:u,id:i=_t(),partial:l,onChange:w,required:d,readonly:f,...h}=e;return p.useEffect(()=>{h.defaultChecked!==void 0&&s!==void 0&&console.error("WuCheckbox: Both `checked` and `defaultChecked` cannot be used together. Use only one of them.")},[h.defaultChecked,s]),a.jsxs("div",{className:pu({labelPosition:n,className:"wu-checkbox-container"}),dir:h.dir,children:[a.jsx(qr,{id:i,...h,partial:l,checked:s,disabled:r||f,onCheckedChange:w,className:c("wu-peer wu-checkbox",u),required:d,ref:t}),o&&a.jsx(ge,{htmlFor:i,className:"wu-w-full wu-checkbox-label",children:o})]})}),pu=Ee.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"}}});Ie.displayName="WuCheckbox";const hu=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})},va=x.forwardRef(({className:e,...t},r)=>a.jsx(fe.Command,{ref:r,className:c("wu-flex wu-h-full wu-w-full wu-flex-col wu-overflow-hidden wu-rounded-md",e),...t}));va.displayName=fe.Command.displayName;const Vr=x.forwardRef(({className:e,...t},r)=>a.jsx("div",{className:"wu-flex wu-items-center wu-border-b wu-px-3",children:a.jsx(fe.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})}));Vr.displayName=fe.Command.Input.displayName;const Na=x.forwardRef(({className:e,...t},r)=>a.jsx(fe.Command.List,{ref:r,className:c("",e),...t}));Na.displayName=fe.Command.List.displayName;const Ca=x.forwardRef((e,t)=>a.jsx(fe.Command.Empty,{ref:t,className:"wu-text-center wu-p-2 wu-pb-2.5 wu-text-xs",...e}));Ca.displayName=fe.Command.Empty.displayName;const ft=x.forwardRef(({className:e,...t},r)=>a.jsx(fe.Command.Group,{ref:r,className:c("",e),...t}));ft.displayName=fe.Command.Group.displayName;const zr=x.forwardRef(({className:e,...t},r)=>a.jsx(fe.Command.Separator,{ref:r,className:c("wu-mx-1 wu-my-1 wu-h-px wu-bg-gray-20",e),...t}));zr.displayName=fe.Command.Separator.displayName;const pt=x.forwardRef(({className:e,...t},r)=>a.jsx(fe.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=fe.Command.Item.displayName;const tt=p.forwardRef(({containerHeight:e=400,list:t,callback:r,dir:s,className:o,style:n},u)=>a.jsx(bn.Virtuoso,{ref:u,dir:s,className:o,style:{height:e,scrollbarWidth:"thin",scrollbarColor:"#d4d4d4 #f1f1f1",overflowX:"hidden",...n},data:t,itemContent:(i,l)=>r(i,l)}));tt.displayName="WuVirtualScroll";const bu=({tags:e,triggerRef:t})=>{const[r,s]=p.useState([]),[o,n]=p.useState([]),u=p.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 p.useEffect(()=>{const l=()=>{if(t.current){const h=t.current.offsetWidth-20-36;let b=0;const g=[],m=[];e.forEach(C=>{const k=i(C);b+k+8<h?(g.push(C),b+=k+8):m.push(C)}),s(g),n(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)),o.length>0&&a.jsx(Lt,{content:u,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]})})]})},gu=({placeholder:e="Select...",isEllipse:t=!1,selectedOptions:r,variant:s="flat",dir:o="ltr",accessorKey:n,multiple:u,id:i,disabled:l,selectAll:w,isCheckedAll:d,className:f,...h})=>{const[b,g]=p.useState([]),m=p.useRef(null);p.useEffect(()=>{if(!r||Array.isArray(r)&&r.length===0){g([]);return}if(u){const k=r;g(k==null?void 0:k.map(y=>y[n.label]));return}else g([r[n.label]])},[r]);const C=()=>{var k;return b.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:`${(((k=m.current)==null?void 0:k.offsetWidth)||0)-32}px`},children:b.join(", ")}):a.jsx(bu,{tags:b,triggerRef:m}):a.jsx("p",{className:"wu-text-xs wu-opacity-70",children:e})};return a.jsx(Be,{dir:o,asChild:!0,id:i,disabled:l,children:a.jsxs("button",{...h,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/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",f),children:[C(),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"})]})})},Sa=Z.Root,ka=Z.Trigger,Hr=Z.Group,mu=Z.Portal,xu=Z.Sub,yu=Z.RadioGroup,$r=x.forwardRef(({className:e,inset:t,children:r,position:s,...o},n)=>a.jsxs(Z.SubTrigger,{ref:n,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")})]}));$r.displayName=Z.SubTrigger.displayName;const Ur=x.forwardRef(({className:e,...t},r)=>a.jsx(Z.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}));Ur.displayName=Z.SubContent.displayName;const Ft=x.forwardRef(({className:e,sideOffset:t=4,...r},s)=>a.jsx(Z.Portal,{children:a.jsx(Z.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})}));Ft.displayName=Z.Content.displayName;const Ot=x.forwardRef(({className:e,inset:t,...r},s)=>a.jsx(Z.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}));Ot.displayName=Z.Item.displayName;const jr=x.forwardRef(({className:e,children:t,checked:r,dir:s,...o},n)=>a.jsxs(Z.CheckboxItem,{ref:n,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(Z.ItemIndicator,{children:a.jsx("span",{className:"wm-check wu-text-base wu-text-white"})})}),t]}));jr.displayName=Z.CheckboxItem.displayName;const Gr=x.forwardRef(({className:e,children:t,...r},s)=>a.jsxs(Z.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(Z.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]}));Gr.displayName=Z.RadioItem.displayName;const ht=x.forwardRef(({className:e,inset:t,...r},s)=>a.jsx(Z.Label,{ref:s,className:c("wu-p-2 wu-font-medium wu-text-xs",t&&"wu-pl-8",e),...r}));ht.displayName=Z.Label.displayName;const Bt=x.forwardRef(({className:e,...t},r)=>a.jsx(Z.Separator,{ref:r,className:c("-wu-mx-1 wu-my-1 wu-h-px wu-bg-gray-20",e),...t}));Bt.displayName=Z.Separator.displayName;const Yr=({option:e,value:t,multiple:r=!1,onSelect:s,accessorKey:o,dir:n})=>{const[u,i]=p.useState(r?[]:"");p.useEffect(()=>{t&&i(r?t.map(f=>JSON.stringify(f[o.value])):JSON.stringify(t[o.value]))},[t,o.value,r]);const l=r?u.includes(JSON.stringify(e[o.value])):u===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:n,children:[r&&a.jsx(Ie,{checked:l}),a.jsx(vu,{option:e,accessorKey:o})]})},vu=({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"})]})},Kr=e=>{const{option:t,selectAll:r,handleSelectAll:s,isCheckedAll:o,isPartialSelected:n,...u}=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:u.dir,children:[a.jsx(Ie,{checked:o||n,partial:n,"data-partial":n,"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(ht,{children:t.label}),t.options.map((l,w)=>p.createElement(Yr,{...u,option:l,key:w}))]});case"divider":return a.jsx(zr,{className:"wu-mx-4"});default:return a.jsx(Yr,{...u,option:t})}},Nu=e=>{const t=[],r=[],s=[],o=[];return e.forEach(n=>{n.type==="group"?(t.push(n),s.push(...n.options),o.push(...n.options.filter(u=>!u.disabled))):n.type==="divider"?r.push(n):s.push(n),n!=null&&n.disabled||o.push(n)}),{groups:t,dividers:r,allOptions:s,enabledOptions:o}},Cu=p.memo(Ae),Su=({data:e,accessorKey:t,value:r,defaultValue:s,Header:o,virtualizedThreshold:n=100,isEllipse:u,placeholder:i,variant:l,dir:w,onSelect:d,Label:f,maxHeight:h=420,multiple:b=!1,hasGroup:g=!1,selectAll:m,id:C,disabled:k,labelPosition:y="top",className:S,onScroll:v,maxContentWidth:T,enableSearch:I=!0,noDataContent:E,...M})=>{const[_,O]=p.useState(""),[A,P]=p.useState(),[L,F]=p.useState(!1),[B,W]=p.useState(!1),[z,j]=p.useState(!1),V=p.useRef(null),{allOptions:H,enabledOptions:ne}=p.useMemo(()=>g||m&&!m.includeDisabled?Nu(e):{allOptions:e,groups:[],dividers:[],enabledOptions:[]},[e,g]),K=p.useMemo(()=>{if(!_)return e;const Q=_.toLowerCase();return H.filter(D=>D[t.label].toLowerCase().includes(Q))},[_,H,e,t.label]),Ne=p.useMemo(()=>b&&m!=null&&m.enable&&!_&&K.length>0?[{type:"all"},...K]:K,[K,_,b]),Ce=p.useCallback(Q=>{const D=Q[t.value];b?P($=>{const se=$||[],ie=se.some(R=>R[t.value]===D)?se.filter(R=>R[t.value]!==D):[...se,Q];return d==null||d(ie),ie}):(F(!1),P(Q),d==null||d(Q))},[b,t.value,d]),q=p.useCallback(Q=>O(Q.target.value),[]),te=p.useCallback(()=>O(""),[]);p.useEffect(()=>{if(r!==void 0&&s!==void 0){console.error("defaultValue and value cannot be used simultaneously");return}else r!==void 0?P(r):s!==void 0&&P(s)},[r,s]),p.useEffect(()=>{if(!b)return;const Q=m!=null&&m.includeDisabled?(A==null?void 0:A.length)===H.length:(A==null?void 0:A.length)===ne.length;W(Q);const D=(A==null?void 0:A.length)>0&&!Q;j(D)},[A,m]);const le=p.useCallback(()=>{const Q=B?[]:m!=null&&m.includeDisabled?H:ne;P(Q),d==null||d(Q)},[B,b,H,ne,d,m]),pe=dt(y);return a.jsxs("div",{className:c(pe,"wu-flex wu-combobox-container"),ref:V,children:[a.jsxs(Te,{onOpenChange:Q=>{Q&&te(),F(Q)},open:L,modal:!0,children:[a.jsx(gu,{selectedOptions:A,accessorKey:t,isEllipse:u,placeholder:i,variant:l,dir:w,multiple:b,disabled:k,selectAll:m,isCheckedAll:B,className:S,id:C,...M}),a.jsx(ye,{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:T},children:a.jsxs(va,{id:C,children:[I&&a.jsx("div",{className:"wu-m-2",children:a.jsx(Cu,{placeholder:"Search...",Icon:a.jsx("span",{className:"wm-search"}),className:"wu-text-xs wu-combobox-search",onChange:q,name:"Search","aria-label":"Search",dir:w,iconPosition:w==="rtl"?"right":"left"})}),o,a.jsxs(Na,{children:[a.jsx(Ca,{children:E||"No results found."}),Ne.length>=n?a.jsx(tt,{className:"wu-combobox-list",containerHeight:h,list:Ne,callback:(Q,D)=>a.jsx(Kr,{option:D,value:A,onSelect:Ce,multiple:b,accessorKey:t,dir:w,selectAll:m,handleSelectAll:le,isCheckedAll:B,isPartialSelected:z},Q),dir:w}):a.jsx("div",{style:{height:"fit-content",maxHeight:h,overflow:"auto"},className:"wu-combobox-list",onScroll:v,children:Ne.map((Q,D)=>a.jsx(Kr,{option:Q,value:A,onSelect:Ce,multiple:b,accessorKey:t,dir:w,selectAll:m,handleSelectAll:le,isCheckedAll:B,isPartialSelected:z},D))})]})]})})]}),f&&a.jsx(ge,{htmlFor:C,className:"wu-combobox-label",children:f})]})},ku=e=>{const{textToCopy:t,notificationText:r,...s}=e,[o,n]=p.useState(!1),u=async()=>{if(t)try{await navigator.clipboard.writeText(t),n(!0),setTimeout(()=>n(!1),2e3)}catch(i){console.error("Failed to copy:",i)}};return a.jsxs(we,{...s,onClick:u,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(ce,{icon:"wm-content-copy",className:"wu-text-lg"})]})},Jr=Y.Root,Eu=Y.Trigger,Tu=Y.Close,Iu=Y.Portal,Xr=x.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","wu-drawer-overlay",e),...t,ref:r}));Xr.displayName=Y.Overlay.displayName;const Du=Ee.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"}}),Ea=x.forwardRef(({side:e="right",className:t,children:r,hideCloseButton:s,overlayClassName:o,closeButtonClassName:n,...u},i)=>a.jsxs(Iu,{children:[a.jsx(Xr,{className:o}),a.jsxs(Y.Content,{ref:i,className:c(Du({side:e}),t),...u,children:[r,!s&&a.jsx(Y.Close,{"aria-label":"close",asChild:!0,children:a.jsxs(Re,{variant:"iconOnly",className:c("wu-absolute wu-right-4 wu-top-4",n),children:[a.jsx("span",{className:"wm-close"}),a.jsx("span",{className:"wu-sr-only",children:"Close"})]})})]})]}));Ea.displayName=Y.Content.displayName;const Zr=x.forwardRef(({className:e,...t},r)=>a.jsx(Y.Title,{ref:r,className:c("wu-text-lg wu-font-semibold",e),...t}));Zr.displayName=Y.Title.displayName;const Mu=x.forwardRef(({className:e,...t},r)=>a.jsx(Y.Description,{ref:r,className:c("wu-text-sm",e),...t}));Mu.displayName=Y.Description.displayName;const Au=e=>t=>{e&&t.preventDefault()},_u=e=>{const{Trigger:t,children:r,hideCloseButton:s,className:o,side:n="left",open:u,onOpenChange:i,preventClickOutside:l,overlayClassName:w,closeButtonClassName:d,...f}=e;return a.jsxs(Jr,{open:u,onOpenChange:i,children:[a.jsx(Eu,{asChild:!0,children:t}),a.jsxs(Ea,{onInteractOutside:Au(l),side:n,className:c("wu-bg-white wu-text-gray-lead wu-px-0",o),hideCloseButton:s,overlayClassName:w,closeButtonClassName:d,...f,children:[a.jsx("div",{className:"wu-hidden",children:a.jsx(Zr,{})}),r]})]})},Wu=({children:e,...t})=>a.jsx(Tu,{...t,children:e}),Qr=({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(et,{size:"16px",variant:"spinner",color:"#a3a3a3",message:r})]});Qr.displayName="WuFooter";const Rr=p.forwardRef((e,t)=>{const{size:r="sm",idOrSlugOrUrl:s,variant:o="primary",...n}=e,u=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",{...n,ref:t,onClick:()=>ia(i),children:a.jsx("span",{className:c("wm-help wu-text-gray-subtle",`wu-text-[${u}px]`,l,n.disabled&&"wu-text-neutral-300","wu-help-button-icon")})})});Rr.displayName="WuHelpButton";const qe=(e,t)=>`wu-listbox-${e}`;function Lu(e){const{option:t,accessorKey:r,onSelect:s,multiple:o,dir:n,GroupLabel:u,Item:i,isSelected:l,...w}=e,d=r.group&&Array.isArray(t[r.group]),f=({item:h,className:b})=>p.createElement(pt,{...w,key:JSON.stringify(h),onSelect:()=>s==null?void 0:s(h),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(h))&&!o&&"wu-bg-blue-p/10",n==="rtl"&&"wu-justify-end",b,qe("item")),disabled:h.disabled},o&&a.jsx(Ie,{checked:l==null?void 0:l(h)}),i?i({value:h,isSelected:l==null?void 0:l(h)}):a.jsx(a.Fragment,{children:h[r.label]}));if(d){const h=t[r.group],b=typeof u=="string"?t[u]:u==null?void 0:u(t);return a.jsx(ft,{heading:b,children:h==null?void 0:h.map(g=>a.jsx(f,{item:g,className:"wu-pl-6"},JSON.stringify(g)))})}return a.jsx(f,{item:t})}const Pu=p.memo(Lu),Fu=e=>{const{className:t,...r}=e;return a.jsxs("div",{className:"wu-relative",children:[a.jsx(ce,{icon:"wm-search",className:"wu-absolute wu-top-[14px] wu-left-5"}),a.jsx(Vr,{...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;",qe("input"),t)})]})},Ou=e=>{const{label:t,onSelectAll:r,data:s,value:o}=e,[n,u]=p.useState(!1),[i,l]=p.useState(!1);return p.useEffect(()=>{!o||!s||(u(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(!n),children:[a.jsx(Ie,{checked:n,partial:i}),t||"Select All"]})},Bu=e=>{const{CustomTrigger:t,disabled:r,value:s,placeholder:o,accessorKey:n,Chip:u,handleUnselect:i,variant:l,dir:w,className:d,...f}=e,[h,b]=p.useState(),g=p.useRef(null);return p.useEffect(()=>{if(!s){b(null);return}b(Array.isArray(s)?u?s.map((C,k)=>u({value:C,unselect:i,key:k})):s.map(C=>C[n.label]).join(", "):u?u({value:s,unselect:i}):s[n.label])},[s,u,n.label,b]),a.jsx(Be,{asChild:!0,id:e.id,disabled:r,ref:g,children:(t==null?void 0:t(s))||a.jsxs("button",{...f,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,qe("trigger")),children:[a.jsx("div",{className:c("wu-truncate",u&&"wu-flex wu-items-center wu-gap-1 wu-flex-wrap",!h&&"wu-font-light"),children:h||o}),a.jsx(ce,{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",qe("drop-icon"))})]})})},es=(e,t,r)=>{const s=String(e[r.label]??"").toLowerCase(),o=String(e[r.value]??"").toLowerCase();return s.includes(t)||o.includes(t)},qu=(e,t,r)=>{const s=t.trim();if(s==="")return e;const o=s.toLowerCase(),n=[];for(const u of e){const i=r.group,l=i?u[i]:void 0;if(Array.isArray(l)){const w=l.filter(d=>es(d,o,r));w.length>0&&n.push({...u,[i]:w})}else es(u,o,r)&&n.push(u)}return n},ts=e=>{const{data:t,accessorKey:r,value:s,Item:o,Label:n,GroupLabel:u,CustomHeader:i,CustomTrigger:l,NoDataContent:w,Chip:d,onSelect:f,onScroll:h,disabled:b,multiple:g,searchable:m,selectAll:C,virtualizedThreshold:k=100,id:y,dir:S,className:v,listClass:T,placeholder:I="Select items...",variant:E,labelPosition:M="top",maxContentWidth:_,maxContentHeight:O,modal:A,...P}=e,[L,F]=p.useState(!1),[B,W]=p.useState(""),[z,j]=p.useState(s),V=p.useMemo(()=>r,[r]),H=p.useMemo(()=>{if(!m||!B)return t;const q=B.toLowerCase().trim();return qu(t,q,r)},[t,B,r.label,m]),ne=q=>{g?j(te=>{const le=q[r.value],pe=Array.isArray(te)?te:[],D=pe.some($=>$[r.value]===le)?pe.filter($=>$[r.value]!==le):[...pe,q];return f&&f(D),D}):(j(q),f&&f(q),F(!1))},K=p.useCallback(q=>{const te=q?t:[];j(te),C!=null&&C.onSelectAll&&C.onSelectAll(q),f&&f(te)},[t,C,f]),Ne=q=>Array.isArray(z)?z.some(te=>te[r.value]===q[r.value]):(z==null?void 0:z[r.value])===q[r.value];p.useEffect(()=>{j(s)},[s]);const Ce=q=>{const te=le=>a.jsx(Pu,{option:le,accessorKey:V,multiple:g,onSelect:pe=>ne(pe),dir:S,GroupLabel:u,Item:o,isSelected:pe=>Ne(pe)},JSON.stringify(le));return q.length>k?a.jsx(tt,{list:q,callback:(le,pe)=>te(pe),dir:S}):q.map(te)};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",qe("container")),dir:S,children:[n&&a.jsx(ge,{htmlFor:y,className:qe("label"),children:n}),a.jsxs(Te,{open:L,onOpenChange:q=>{F(q),q||setTimeout(()=>{W("")},100)},modal:A,children:[a.jsx(Bu,{CustomTrigger:l,disabled:b,value:z,accessorKey:r,placeholder:I,Chip:d,className:v,handleUnselect:ne,variant:E,id:y,dir:S,...P}),a.jsx(ye,{className:c("wu-min-w-[--radix-popover-trigger-width] wu-max-w-[calc(100vw-32px)] wu-w-auto wu-p-0 wu-bg-white wu-border wu-border-blue-p",qe("content")),align:"start",sideOffset:-1,style:{maxWidth:_},children:a.jsxs(va,{id:e.id,shouldFilter:!1,children:[m&&a.jsx(Fu,{value:B,onValueChange:W}),i,a.jsxs(Na,{className:c("wu-overflow-y-auto",qe("list"),T),onScroll:h,style:{maxHeight:O||"420px"},children:[a.jsx(Ca,{children:w||"No results found."}),a.jsx(ft,{children:g&&(C==null?void 0:C.enabled)&&!B&&a.jsx(Ou,{data:t,value:z,onSelectAll:K,label:C.label})}),a.jsx(ft,{children:Ce(H)})]})]})})]})]})},Vu=e=>{const{checked:t,onSelect:r,children:s,disabled:o,preventCloseOnSelect:n}=e;return a.jsx(jr,{disabled:o,checked:t,onCheckedChange:r,onSelect:u=>n&&u.preventDefault(),children:s})},Ta=e=>{const{children:t,className:r,Icon:s,iconPosition:o="left",disabled:n,onSelect:u,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=>{u&&u(d),i&&d.preventDefault()};return a.jsxs(Ot,{onSelect:w,disabled:n,className:l,children:[s&&a.jsx("div",{className:"wu-text-base",children:s}),t]})},zu=e=>{const{children:t,Label:r,...s}=e;return a.jsxs(Hr,{...s,children:[a.jsx(ht,{children:r||e.label}),t]})},Hu=e=>{const{options:t,value:r,onSelect:s}=e;return a.jsx(yu,{value:r,onValueChange:s,children:t.map(o=>a.jsx(Gr,{value:o.value,disabled:o.disabled,children:o.Label||o.label},o.value))})},$u=e=>{const{className:t,...r}=e,s=c("wu-w-11/12 wu-mx-auto wu-border-gray-40",t);return a.jsx(Bt,{...r,className:s})},at=x.forwardRef(({className:e,children:t,thumbColor:r,railColor:s,...o},n)=>a.jsxs(He.Root,{ref:n,className:c("wu-relative wu-overflow-hidden",e),children:[a.jsx(He.Viewport,{className:"wu-h-full wu-w-full wu-rounded-[inherit]",...o,children:t}),a.jsx(Ia,{thumbColor:r,railColor:s}),a.jsx(He.Corner,{})]}));at.displayName=He.Root.displayName;const Ia=x.forwardRef(({className:e,orientation:t="vertical",thumbColor:r="#d4d4d4",railColor:s="#eeeeee",...o},n)=>a.jsx(He.ScrollAreaScrollbar,{ref:n,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(He.ScrollAreaThumb,{className:"wu-relative wu-flex-1 wu-rounded-full",style:{background:r}})}));Ia.displayName=He.ScrollAreaScrollbar.displayName;const Uu=e=>{const{children:t,label:r,Label:s,open:o,onOpenChange:n,height:u,dir:i,...l}=e;return a.jsxs(xu,{...l,open:o,onOpenChange:n,children:[a.jsx($r,{dir:i,children:s||r}),a.jsx(mu,{children:a.jsx(Ur,{onInteractOutside:w=>w.preventDefault(),children:a.jsx(at,{className:"wu-h-fit",style:{height:u},dir:i,children:t})})})]})},ju="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",as=e=>{const{children:t,menuTitle:r,MenuTitle:s,variant:o="flat",name:n,open:u,onOpenChange:i,height:l,preventCloseOnClickOutside:w,dir:d,Trigger:f,align:h="start",sideOffset:b=0,side:g="bottom",alignOffset:m,className:C,disabled:k,...y}=e;return a.jsxs(Sa,{...y,open:u,onOpenChange:i,dir:d,children:[a.jsx(ka,{asChild:!0,dir:d,disabled:k,className:c("disabled:wu-text-zinc-300 disabled:wu-bg-white disabled:wu-cursor-not-allowed disabled:hover:wu-bg-transparent"),children:f??Gu(o,n,k)}),a.jsx(Ft,{className:c("wu-w-56 wu-border wu-border-blue-p disabled:wu-border-gray-40",C,"wu-menu-content"),align:h,sideOffset:b,side:g,alignOffset:m,onInteractOutside:S=>w&&S.preventDefault(),children:a.jsxs(at,{className:"h-fit",style:{height:l},dir:d,children:[(r||s)&&a.jsxs(a.Fragment,{children:[a.jsx(ht,{dir:d,className:"wu-menu-title",children:s||r}),a.jsx(Bt,{className:"wu-mt-0 wu-menu-separator",dir:d})]}),t??a.jsx("p",{children:"Menu Is Empty"})]})})]})},Gu=(e,t,r)=>{const s=c(ju,"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")})]})},Da=p.forwardRef(({showMenu:e=!1,className:t,color:r="#1B3380",...s},o)=>{const n=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:`${n} wu-origin-center ${e?"wu-rotate-45 wu-translate-y-[5px]":""}`,style:{borderColor:r}}),a.jsx("div",{className:`${n} ${e?"wu-opacity-0":""}`,style:{borderColor:r}}),a.jsx("div",{className:`${n} wu-origin-center ${e?"-wu-rotate-45 -wu-translate-y-[5px]":""}`,style:{borderColor:r}})]})});Da.displayName="WuMenuIcon";const rs={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%]"},ss=Y.Root,os=Y.Trigger,Yu=Y.Portal,Ku=Y.Close,ns=p.forwardRef(({className:e,...t},r)=>a.jsx(Y.Overlay,{ref:r,className:c("wu-fixed wu-inset-0 wu-z-[60] wu-bg-black/30",rs.overlay,e),...t}));ns.displayName=Y.Overlay.displayName;const Ma=p.forwardRef(({className:e,children:t,hideCloseButton:r,isStackedCard:s,...o},n)=>a.jsxs(Yu,{children:[a.jsx(ns,{className:s?"wu-bg-transparent":""}),a.jsxs(Y.Content,{ref:n,className:c("wu-fixed wu-left-[50%] wu-z-[60] wu-top-[50%] wu-flex wu-flex-col wu-w-full wu-max-w-lg wu-translate-x-[-50%] wu-translate-y-[-50%] wu-bg-white wu-shadow-lg wu-duration-200",rs.content,e),...o,children:[t,!r&&a.jsx(Y.Close,{"aria-label":"close",asChild:!0,children:a.jsxs(Re,{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"})]})})]})]}));Ma.displayName=Y.Content.displayName;const Aa=({className:e,...t})=>a.jsx("div",{className:c("wu-text-center wu-bg-gray-20 wu-w-full",e),...t});Aa.displayName="DialogHeader";const us=({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});us.displayName="DialogFooter";const _a=p.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}));_a.displayName=Y.Title.displayName;const Ju=p.forwardRef(({className:e,...t},r)=>a.jsx(Y.Description,{ref:r,className:c("wu-text-sm wu-text-muted-foreground",e),...t}));Ju.displayName=Y.Description.displayName;const Xu={gradientBackground:"_gradientBackground_1bbet_1"},ls=e=>{const{colors:t,size:r=.55,children:s,className:o,strokeWidth:n,centerOffset:u={x:0,y:0},...i}=e,l=p.useRef(null);return p.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",`-${n||2}px`),w.style.setProperty("--spotlight-background","radial-gradient(100% var(--height) ellipse at 25% 70%, var(--colors))");let f;const h=b=>{f&&cancelAnimationFrame(f),f=requestAnimationFrame(()=>{const g=w.getBoundingClientRect();let m=b.clientX-g.left,C=b.clientY-g.top;m=Math.max(0,Math.min(m+u.x,g.width)),C=Math.max(0,Math.min(C+u.y,g.height));const k=`radial-gradient(
1
+ (function(v,r){typeof exports=="object"&&typeof module<"u"?r(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"),require("@tiptap/react"),require("@tiptap/extension-list"),require("@tiptap/extension-subscript"),require("@tiptap/extension-superscript"),require("@tiptap/extension-table"),require("@tiptap/extension-text-align"),require("@tiptap/extension-text-style"),require("@tiptap/starter-kit"),require("@tiptap/extension-image")):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","@tiptap/react","@tiptap/extension-list","@tiptap/extension-subscript","@tiptap/extension-superscript","@tiptap/extension-table","@tiptap/extension-text-align","@tiptap/extension-text-style","@tiptap/starter-kit","@tiptap/extension-image"],r):(v=typeof globalThis<"u"?globalThis:v||self,r(v["wick-ui-lib"]={},v["react/jsx-runtime"],v.RadixUIAccordion,v.React,v.clsx,v.tailwindMerge,v.RadixUIAvatar,v.RadixUISlot,v.ClassVarianceAuthority,v.RadixUILabel,v.RadixUITooltip,v.dateFns,v.RadixUIPopover,v.ReactDayPicker,v.RadixUICheckbox,v.cmdk,v.ReactVirtuoso,v.RadixUIDropdownMenu,v.RadixUIDialog,v.RadixUIScrollArea,v.RadixUIRadioGroup,v.RadixUISeparator,v.ReactDOM,v.RadixUIToggleGroup,v.RadixUIToggle,v.RadixUITabs,v.TanstackReactTable,v.RadixUIToast,v.RadixUISwitch,v.ReactTransitionGroup,v.TipTapReact,v.TipTapExtensionList,v.TipTapExtensionSubscript,v.TipTapExtensionSuperscript,v.TipTapExtensionTable,v.TipTapExtensionTextAlign,v.TipTapExtensionTextStyle,v.TipTapStarterKit,v.TipTapExtensionImage))})(this,(function(v,r,Je,f,xn,vn,yn,Xe,Se,Nn,dr,j,wt,ha,Cn,fe,Sn,ft,ba,En,Tn,kn,In,An,Dn,Mn,_e,_n,Fn,Pt,ge,ga,Ln,Wn,Pn,On,Ze,Bn,qn){"use strict";var xd=Object.defineProperty;var vd=(v,r,Je)=>r in v?xd(v,r,{enumerable:!0,configurable:!0,writable:!0,value:Je}):v[r]=Je;var Wt=(v,r,Je)=>vd(v,typeof r!="symbol"?r+"":r,Je);function ce(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const a in e)if(a!=="default"){const s=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(t,a,s.get?s:{enumerable:!0,get:()=>e[a]})}}return t.default=e,Object.freeze(t)}const Ve=ce(Je),g=ce(f),Qe=ce(yn),ma=ce(Nn),pt=ce(dr),ht=ce(wt),wr=ce(Cn),R=ce(ft),X=ce(ba),He=ce(En),bt=ce(Tn),xa=ce(kn),zn=ce(In),Ot=ce(An),va=ce(Dn),$e=ce(Mn),me=ce(_n),fr=ce(Fn),Vn=vn.extendTailwindMerge({prefix:"wu-"});function c(...e){return Vn(xn.clsx(e))}const pr=e=>{window.open(e,"_blank","toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=800,height=600")};function Bt(){return Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15)}function gt(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 Hn=e=>e?/\S+@questionpro\.com/.test(e):!1,ya=Ve.Root,hr=g.forwardRef(({className:e,...t},a)=>r.jsx(Ve.Item,{ref:a,className:c("wu-border-b",e),...t}));hr.displayName="AccordionItem";const br=g.forwardRef(({className:e,children:t,...a},s)=>r.jsx(Ve.Header,{className:"wu-flex",children:r.jsxs(Ve.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),...a,children:[t,r.jsx("span",{className:"wu-arrow-icon wm-keyboard-arrow-down wu-transition-transform wu-duration-200"})]})}));br.displayName=Ve.Trigger.displayName;const gr=g.forwardRef(({className:e,children:t,...a},s)=>r.jsx(Ve.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",...a,children:r.jsx("div",{className:c("wu-pb-4 wu-pt-0",e),children:t})}));gr.displayName=Ve.Content.displayName;const $n=e=>{const{items:t,className:a,dir:s="ltr"}=e;if(e.type==="multiple"){const{defaultValue:o=[],value:n,onValueChange:u}=e;return r.jsx(ya,{type:"multiple",className:"wu-w-full wu-accordion-container",defaultValue:o,value:n,onValueChange:u,dir:s,children:t.map(({value:l,Summary:i,Details:d,className:w})=>r.jsxs(hr,{value:l,dir:s,className:c(a,w),children:[r.jsx(br,{dir:s,className:"wu-accordion-summary",children:i}),r.jsx(gr,{dir:s,className:"wu-accordion-details",children:d})]},l))})}else{const{defaultValue:o,value:n,onValueChange:u}=e;return r.jsx(ya,{type:"single",className:"wu-w-full wu-accordion-container",defaultValue:o,value:n,onValueChange:u,dir:s,collapsible:!0,children:t.map(({value:l,Summary:i,Details:d,className:w})=>r.jsxs(hr,{value:l,dir:s,className:c(a,w),children:[r.jsx(br,{dir:s,className:"wu-accordion-summary",children:i}),r.jsx(gr,{dir:s,className:"wu-accordion-details",children:d})]},l))})}},Na=g.forwardRef(({className:e,...t},a)=>r.jsx(Qe.Root,{ref:a,className:c("wu-relative wu-flex wu-h-10 wu-w-10 wu-shrink-0 wu-overflow-hidden wu-rounded-full",e),...t}));Na.displayName=Qe.Root.displayName;const Ca=g.forwardRef(({className:e,...t},a)=>r.jsx(Qe.Image,{ref:a,className:c("wu-aspect-square wu-h-full wu-w-full",e),...t}));Ca.displayName=Qe.Image.displayName;const Sa=g.forwardRef(({className:e,...t},a)=>r.jsx(Qe.Fallback,{ref:a,className:c("wu-flex wu-h-full wu-w-full wu-items-center wu-justify-center wu-rounded-full wu-bg-muted",e),...t}));Sa.displayName=Qe.Fallback.displayName;function mr(e,t){f.useEffect(()=>{const a=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",a),document.addEventListener("touchstart",a),()=>{document.removeEventListener("mousedown",a),document.removeEventListener("touchstart",a)}},[e,t])}const xr={dropdownContainer:"_dropdownContainer_vvlo9_1",open:"_open_vvlo9_1",dropdownMenu:"_dropdownMenu_vvlo9_1"},Ea=({dir:e,Trigger:t,triggerClassName:a,DropdownContent:s,isAllowActiveStyle:o})=>{const[n,u]=f.useState(!1),l=f.useRef(null),i=f.useRef(null);mr([l,i],()=>u(!1));const d=()=>{u(!n)};return r.jsx(r.Fragment,{children:r.jsx("div",{className:xr.dropdownContainer,children:r.jsx("ul",{children:r.jsxs("li",{className:c("wu-flex wu-relative",n&&xr.open),children:[r.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",a,o&&n&&"wu-bg-white wu-text-blue-switcher"),onClick:w=>{w.preventDefault(),d()},ref:i,"aria-label":"dropdown-trigger",children:t}),r.jsx("div",{className:c(xr.dropdownMenu,{open:n},e==="rtl"?"wu-left-[-10px] wu-top-[38px]":"wu-right-[-7px] wu-top-[38px]"),dir:e,ref:l,"aria-label":"user-menu",children:s})]})})})})},vr=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:[]}),Re=g.forwardRef(({className:e,variant:t,size:a,color:s,asChild:o=!1,...n},u)=>{const l=o?Xe.Slot:"button";return r.jsx(l,{className:c(vr({size:a,color:s,variant:t,className:e})),ref:u,...n})});Re.displayName="Button";const et=f.forwardRef((e,t)=>Un(e,t)),Un=(e,t)=>{const{size:a="md",color:s="#1B87E6",variant:o="dots",...n}=e,u=c("wu-w-[4em] wu-h-[1em] wu-inline-block wu-text-xs wu-relative wu-loader-dot-container");let l="7px";a==="sm"?l="7px":a==="md"?l="12px":a==="lg"?l="18px":typeof a=="string"&&(l=a);const i={backgroundColor:s,width:l,height:l},d=r.jsxs("div",{...n,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:[r.jsx("div",{className:"wu-w-12 wu-h-12 wu-border-2 wu-rounded-full wu-animate-spin",style:{width:l,height:l,borderTopColor:s}}),e.message&&r.jsx("p",{className:"wu-inline-block wu-loader-message",children:e.message})]}),w=r.jsxs("div",{...n,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:[r.jsxs("ul",{className:u,style:{fontSize:l},role:"loader",children:[r.jsx("li",{className:"wu-dot wu-loader-dot",style:i}),r.jsx("li",{className:"wu-dot wu-loader-dot",style:i}),r.jsx("li",{className:"wu-dot wu-loader-dot",style:i}),r.jsx("li",{className:"wu-dot wu-loader-dot",style:i})]}),e.message&&r.jsx("p",{className:"wu-inline-block wu-loader-message",children:e.message})]});return r.jsx(r.Fragment,{children:o==="spinner"?d:w})};et.displayName="WuLoader";const le=f.forwardRef(({disabled:e,loading:t,variant:a="primary",size:s="md",Icon:o,iconPosition:n="left",children:u,floating:l,className:i,color:d="primary",selected:w,...p},b)=>{const h={primary:"#1986e688",upgrade:"#F5A300",error:"#ef444488"};return r.jsxs(Re,{...p,disabled:e,variant:a,size:s,className:c(l&&"wu-shadow-qp","wu-flex wu-items-center wu-justify-center wu-gap-2",n==="right"&&"wu-flex-row-reverse",t?"wu-cursor-not-allowed wu-ring-0":"",w&&"wu-bg-blue-p wu-bg-opacity-15 wu-text-blue-pHoverDeep wu-ring-0",d==="error"&&"hover:wu-text-maroon",i),color:d,style:{backgroundColor:t?h[d]:"",...p.style},ref:b,children:[!t&&o&&r.jsx(r.Fragment,{children:o}),t&&r.jsx(et,{color:"#fff",size:"sm"}),!t&&u]})});le.displayName="WuButton";const jn=({onLogout:e,DataCenter:t})=>r.jsxs("section",{className:"wu-flex wu-justify-between wu-px-4 wu-py-4 wu-text-white wu-bg-gray-lead",children:[r.jsx("div",{className:"wu-flex-1 wu-flex wu-items-start",children:t}),r.jsx(le,{variant:"outline",size:"sm",Icon:r.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"})]}),Gn=({user:e,dir:t})=>{const a=[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:r.jsxs("div",{className:"wu-flex wu-flex-col wu-items-center wu-w-20",children:[r.jsx("code",{className:"wu-font-medium",children:e.usage.collectedResponseCount||"0"}),r.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:r.jsx("div",{className:"wu-flex wu-justify-center wu-items-center wu-w-20",children:r.jsx("code",{children:e.invoice.size})})}:null].filter(Boolean);return r.jsxs(r.Fragment,{children:[r.jsx("ul",{children:a.map(({title:s,url:o,icon:n,node:u},l)=>r.jsx("li",{className:l<a.length-1?"wu-border-b wu-border-gray-subtle":"",children:r.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:[r.jsxs("div",{className:"wu-flex wu-items-center wu-gap-2",children:[r.jsx("span",{className:c(n,"wu-w-12 wu-text-center")}),r.jsx("span",{children:s})]}),u]})},l))}),r.jsx("hr",{className:"wu-border-gray-subtle"})]})},Yn=({settings:e,dir:t})=>r.jsxs(r.Fragment,{children:[r.jsx("hr",{className:"wu-border-gray-subtle"}),r.jsxs("section",{className:"wu-relative wu-flex wu-items-center wu-justify-start wu-gap-2",children:[r.jsx("span",{className:c("wu-absolute wm-settings wu-text-base",t==="rtl"?"wu-right-4":"wu-left-4")}),r.jsx("ul",{className:"wu-w-full",dir:t,children:e==null?void 0:e.map(a=>r.jsx("li",{tabIndex:-1,dir:t,children:r.jsx("a",{href:a.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:a.title})},a.title))})]}),r.jsx("hr",{className:"wu-border-gray-subtle"})]}),Kn=({user:e,dir:t})=>{var a,s,o,n,u,l,i,d,w;return r.jsxs("section",{className:c("wu-flex wu-gap-2 wu-p-4 wu-w-full",t==="rtl"?"wu-pr-0":"wu-pl-0"),children:[r.jsx("div",{className:"wu-flex wu-items-center wu-justify-center wu-w-12",children:r.jsx("span",{className:"wu-text-base wm-person"})}),r.jsxs("div",{className:c("wu-flex wu-flex-col wu-gap-1",t==="rtl"&&"wu-text-right"),children:[r.jsx("p",{children:(a=e==null?void 0:e.profile)==null?void 0:a.title}),r.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:[r.jsx("p",{children:(o=e==null?void 0:e.profile)==null?void 0:o.subtitle}),r.jsx("p",{className:"wu-font-light",children:(n=e==null?void 0:e.profile)==null?void 0:n.companyName})]}),(e==null?void 0:e.license)&&Object.keys(e.license).length>0&&r.jsxs("div",{className:"wu-flex wu-items-center wu-justify-between wu-gap-6 wu-mt-3",dir:t,children:[r.jsx("a",{href:(u=e==null?void 0:e.license)==null?void 0:u.url,className:"hover:wu-text-blue-p wu-group/license focus:wu-outline-none focus:wu-text-blue-p",children:r.jsxs("div",{className:"wu-flex wu-flex-col wu-items-start wu-gap-1",children:[r.jsx("p",{className:"wu-font-normal",children:(l=e==null?void 0:e.license)==null?void 0:l.subtitle}),r.jsx("button",{tabIndex:-1,className:"wu-px-3 wu-py-1 wu-border wu-rounded-sm wu-border-gray-subtle group-hover/license:wu-border-blue-p",children:(i=e==null?void 0:e.license)==null?void 0:i.title})]})}),r.jsxs("div",{className:"wu-flex wu-flex-col wu-items-start wu-gap-1",dir:t,children:[r.jsx("p",{className:"wu-font-normal",children:(d=e==null?void 0:e.license)==null?void 0:d.expiryDatePostFixString}),r.jsx("p",{children:(w=e==null?void 0:e.license)==null?void 0:w.expiryDate})]})]})]})]})},Ta=({user:e,onLogout:t,dir:a,DataCenter:s})=>{var o,n;return e?r.jsx(Ea,{Trigger:r.jsxs(Na,{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:[r.jsx(Ca,{className:"hover:wu-opacity-80",src:(o=e==null?void 0:e.profile)==null?void 0:o.profilePicture,alt:"User"}),r.jsx(Sa,{children:(n=e==null?void 0:e.profile)==null?void 0:n.initials})]}),dir:a,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:r.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:a,children:[r.jsx(Kn,{user:e,dir:a}),(e==null?void 0:e.settings)&&e.settings.length>0&&r.jsx(Yn,{settings:e.settings,dir:a}),r.jsx(Gn,{user:e,dir:a}),r.jsx(jn,{onLogout:t,DataCenter:s})]})}):null},ka=({menuList:e,dir:t})=>{const a=[{icon:"wm-help",title:"Help center",subTitle:"Knowledge Base",link:"https://www.questionpro.com/help/"},{icon:"wm-live-tv",title:"Free 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-support-agent",title:"Live support",subTitle:"Support",link:"https://www.questionpro.com/a/liveperson.do?mode=launch&pageMode=quickChat",target:"window"},{icon:"wm-book-2",title:"Org wiki",subTitle:"wiki",link:"https://www.questionpro.com/a/liveperson.do?mode=launch&pageMode=quickChat",target:"window"}];return r.jsx(Ea,{dir:t,Trigger:r.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-blue-switcher wu-app-header-help",isAllowActiveStyle:!0,DropdownContent:r.jsx("ul",{children:(e||a).map((s,o)=>r.jsx("li",{className:"wu-p-0 wu-w-[136px]",dir:t,children:s.target==="window"?r.jsx("a",{tabIndex:0,rel:"noopener noreferrer",onClick:()=>pr(s.link),onKeyDown:n=>{n.key==="Enter"&&pr(s.link)},className:`wu-block wu-w-full wu-h-full wu-px-3 wu-py-2 hover:wu-bg-black hover:wu-bg-opacity-[.04] focus-visible:wu-border-none focus-visible:wu-bg-black
2
+ focus-visible:wu-bg-opacity-[.04] focus-visible:wu-ring-0 focus-visible:wu-outline-none focus-visible:wu-ring-offset-0 wu-cursor-pointer`,children:r.jsx(Ia,{item:s,dir:t})}):r.jsx("a",{href:s.link,target:"_blank",className:`wu-block wu-w-full wu-h-full wu-px-3 wu-py-2 hover:wu-bg-black hover:wu-bg-opacity-[0.04] focus-visible:wu-border-none
3
+ focus-visible:wu-bg-black
4
+ focus-visible:wu-bg-opacity-[.04] focus-visible:wu-ring-0 focus-visible:wu-outline-none focus-visible:wu-ring-offset-0`,rel:"noreferrer",children:r.jsx(Ia,{item:s,dir:t})})},o))})})},Ia=({item:e,dir:t})=>r.jsxs("div",{className:"wu-flex wu-items-center wu-gap-[5px]",dir:t,children:[r.jsx("div",{className:"wu-flex wu-items-center wu-justify-center wu-w-6 wu-h-6",children:r.jsx("span",{className:c("wu-text-xl wu-text-gray-lead",e.icon)})}),r.jsx("p",{className:"wu-text-sm wu-text-gray-lead",children:e.title})]}),Jn=e=>{const[t,a]=f.useState(()=>window.innerWidth<=e);return f.useEffect(()=>{const s=()=>{a(window.innerWidth<=e)};return window.addEventListener("resize",s),()=>{window.removeEventListener("resize",s)}},[e]),t};function Xn({productCategories:e,openCategory:t,setOpenCategory:a}){const s=(l,i)=>{const d=i[l];if(d){d.focus();const w=e[l]||null;a(w)}},o=(l,i,d,w)=>{l.preventDefault();const p=d==="down"?i+1:i-1;s(p,w)},n=(l,i,d,w)=>{t!=null&&t.products&&t.products[t.products.length-1].name===w&&(l.preventDefault(),s(i+1,d))},u=(l,i)=>{l.preventDefault();const d=e[i]===t?null:e[i];a(d)};return function(i,d,w){const p=document.querySelectorAll("[data-product-category]"),{key:b}=i;switch(b){case"ArrowDown":o(i,d,"down",p);break;case"ArrowUp":o(i,d,"up",p);break;case"Tab":n(i,d,p,w);break;case"Enter":case" ":u(i,d);break}}}const Zn=e=>{const{size:t="lg",className:a,children:s,...o}=e,n={sm:"wu-text-body-3",md:"wu-text-body-2",lg:"wu-text-body-1"},u=e.as||"div";return r.jsx(u,{...o,className:c(n[t],a),children:s})},Qn=e=>{const{size:t="xl",className:a,children:s,...o}=e,n={sm:"h4",md:"h3",lg:"h2",xl:"h1"},u={sm:"wu-text-heading-4",md:"wu-text-heading-3",lg:"wu-text-heading-2",xl:"wu-text-heading-1"},l=n[t];return r.jsx(l,{...o,className:c(u[t],a),children:s})},Rn=e=>{const{size:t="lg",className:a,children:s,...o}=e,n={sm:"wu-text-sub-3",md:"wu-text-sub-2",lg:"wu-text-sub-1"},u=e.as||"div";return r.jsx(u,{...o,className:c(n[t],a),children:s})},eu=e=>{const{size:t="lg",className:a,children:s,...o}=e,n={md:"wu-text-display-2",lg:"wu-text-display-1"},u=e.as||"h1";return r.jsx(u,{...o,className:c(n[t],a),children:s})},ue=e=>{const{icon:t,className:a,...s}=e;return r.jsx("span",{...s,className:c(t,a),role:"presentation","aria-label":t})},tu=({buttonRef:e,handleDropdownToggle:t,handleKeyDown:a,isDropdownOpen:s,activeProductName:o,dir:n="ltr",homeLink:u="/"})=>r.jsxs("button",{ref:e,type:"button",className:c("wu-text-base wu-font-normal wu-flex wu-items-center wu-justify-between wu-px-2 wu-gap-2 wu-w-full focus:wu-outline-none focus-visible:wu-bg-white/10 wu-switcher-trigger"),onClick:t,onKeyDown:l=>{s&&l.key==="ArrowDown"&&a(l,-1)},"aria-label":"product-switcher",children:[r.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:u,children:r.jsx(ue,{icon:"wc-logo",className:"wu-text-xl wu-leading-4 wu-relative wu-top-1"})}),o,r.jsx("span",{className:c("wm-arrow-drop-down wu-text-2xl wu-transition-transform wu-duration-300",s&&"wu-rotate-180",n==="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"},ru=({category:e,dir:t="ltr",openCategory:a})=>{const s=e.active?"#c5cce0":"#f0c36a",o=(a==null?void 0:a.name)===e.name,n=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]"),u=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 r.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:[r.jsx("div",{className:ee.productCategoryBorderTop,style:{backgroundColor:s}}),r.jsxs("div",{className:"wu-flex wu-items-center wu-px-1 wu-relative wu-top-1",children:[r.jsx("div",{className:"wu-w-[56px] wu-h-[56px] wu-flex wu-items-center wu-justify-center",children:r.jsx("img",{src:e.logo,alt:e.name,width:"32px",height:"32px"})}),r.jsx("span",{className:"wu-text-sm wu-leading-5 wu-text-blue-q wu-relative wu-top-[1px]",children:e.name})]}),e.active?r.jsx("span",{className:n}):r.jsx("span",{className:u})]})},au={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"},su=({product:e,currentProduct:t,activeProductName:a,dir:s,focusItem:o,setFocusItem:n})=>{const[u,l]=f.useState(e.name===t),i=e.name===a,d=e.name===t,w=!e.active,p="#1b3380",b="#c5cce0",h="#ffcf70",x=c("wu-font-normal wu-text-xs wu-text-gray-lead wu-text-center",d&&"wu-text-blue-q wu-font-normal",!e.active&&"wu-text-gray-subtle",u&&"wu-font-normal",e.active&&u&&"wu-text-blue-q"),m=c("wu-text-blue-p wu-text-base",d&&"wu-text-blue-q",!e.active&&"wu-text-gray-subtle",e.active&&u&&"wu-text-blue-q"),C=u||o===e.name||i?p:b;return r.jsxs("li",{className:c(ee.productListItem,"focus-visible:wu-outline-none focus:wu-outline-none wu-sub-product-list-item",(i||u)&&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:()=>l(!0),onMouseOut:()=>l(!1),"aria-label":e.name,"aria-disabled":w,dir:s,onKeyDown:E=>{if(E.key==="Enter"){E.preventDefault();const y=E.currentTarget.querySelector("a");y&&y.click()}},onFocus:()=>{n(e.name)},onBlur:()=>n(""),children:[r.jsx("div",{className:c(ee.topBorder,s==="rtl"&&ee.topBorderRtl),style:{backgroundColor:w?h:C}}),r.jsxs("a",{className:c(ee.productLink,"focus:wu-outline-none focus-visible:wu-outline-none"),href:e.link||"#",tabIndex:0,children:[r.jsx("span",{className:c(m,au[e.icon||""]),"aria-hidden":!0}),r.jsx("span",{className:c(x),children:e.name})]})]},e.name)},ou=({category:e,currentProduct:t,activeProductName:a,dir:s="ltr",focusItem:o,setFocusItem:n,borderColorLocked:u="#f5a300"})=>{const{products:l=[],active:i}=e,d=f.useMemo(()=>l.filter(x=>x.active).sort((x,m)=>(x.order||100)-(m.order||100)),[l]),w=f.useMemo(()=>l.filter(x=>!x.active),[l]),[p,b]=f.useState(u),h=x=>x.map((m,C)=>r.jsx(su,{product:m,currentProduct:t,activeProductName:a,dir:s,focusItem:o,setFocusItem:n},C));return i?r.jsxs(r.Fragment,{children:[h(d),w.length>0&&r.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(u),"aria-label":"Upgrade to unlock",children:[r.jsx("div",{className:c(ee.topBorder,s==="rtl"&&ee.topBorderRtl),style:{backgroundColor:p},"aria-label":"top-border"}),r.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:[r.jsx("span",{className:"wu-text-base wu-transition-colors wm-lock !wu-text-orange-soft group-hover:wu-text-orange-deep"}),r.jsxs("span",{className:"wu-text-[10px] wu-leading-[10px] wu-text-center wu-pt-1 !wu-text-orange-deep",children:["Upgrade to ",r.jsx("br",{})," unlock"]})]})]}),h(w)]}):r.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:()=>n("learn"),onBlur:()=>n(""),"aria-label":"Learn More",children:[r.jsx("div",{className:c(ee.topBorder,s==="rtl"&&ee.topBorderRtl),style:{backgroundColor:u}}),r.jsx("a",{className:ee.productLink,href:"https://www.questionpro.com/a/showUpgradeUser.do",tabIndex:-1,children:r.jsx("span",{className:"wu-text-[#f99e03]",children:"Learn More"})})]})},Aa=({dropdownRef:e,dir:t,isDropdownOpen:a,productCategories:s,openCategory:o,setOpenCategory:n,handleKeyDown:u,expandAll:l,activeProductName:i,focusItem:d,setFocusItem:w})=>{const p="#ffcf70",[b,h]=f.useState(window.innerWidth>768);return f.useEffect(()=>{const x=()=>{h(window.innerWidth>375)};return window.addEventListener("resize",x),()=>window.removeEventListener("resize",x)},[]),r.jsx("ul",{className:c(ee.productDropdownMenu,a&&ee.productDropdownMenuOpen,t==="rtl"&&ee.rtlDropdownMenu,"wu-switcher-container"),ref:e,dir:t,"aria-label":"product-dropdown-menu","data-state":a?"open":"closed",children:s.map((x,m)=>r.jsxs("li",{className:c(ee.productCategory,"focus:wu-outline-none focus-visible:wu-outline-none wu-h-16 wu-category-item",o===x&&ee.open,l&&ee.open),onMouseEnter:()=>b&&n(x),onMouseLeave:()=>b&&n(null),"aria-label":x.name,dir:t,onKeyDown:C=>u(C,m),tabIndex:0,"data-product-category":!0,children:[r.jsx(ru,{category:x,dir:t,openCategory:o}),r.jsx("ul",{className:c(ee.productList,t==="rtl"&&ee.rtlProductList),dir:t,children:r.jsx(ou,{category:x,dir:t,activeProductName:i,currentProduct:x.name,focusItem:d,setFocusItem:w,borderColorLocked:p})})]},x.name))})},nu=({isProductButtonShow:e,isDropdownOpen:t,activeProductColor:a,activeProductBgColor:s,activeProductName:o,dir:n,smallScreenButtonRef:u,handleDropdownToggle:l,handleKeyDown:i})=>r.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?n==="rtl"?"wu-right-0 wu-overflow-hidden":"wu-translate-x-0 wu-left-0":n==="rtl"?"wu-right-0 wu-w-0":"wu--translate-x-full"),style:{backgroundColor:t?a.hover:s},children:r.jsxs("button",{ref:u,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":n==="rtl"?"wu-hidden":"wu-flex"),onClick:l,onKeyDown:d=>{t&&d.key==="ArrowDown"&&i(d,-1)},"aria-label":"small-screen-product-btn",children:[o,r.jsx("span",{className:c("wm-arrow-drop-down wu-text-2xl wu-transition-transform wu-duration-300",t&&"wu-rotate-180")})]})}),uu=({dir:e,isProductButtonShow:t,smallScreenToggleButtonRef:a,setIsProductButtonShow:s,setDropdownOpen:o})=>{const n=()=>{s(u=>!u),t&&o(!1)};return r.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:n,ref:a,"aria-label":"menu-toggle-btn",children:[r.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"}`}),r.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"}`}),r.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"}`})]})},Da=({productCategories:e,activeProductName:t,activeProductColor:a={base:"#1b87e6",hover:"#54A5EC"},dir:s,homeLink:o,expandAll:n})=>{const u=f.useRef(null),l=f.useRef(null),i=f.useRef(null),d=f.useRef(null),[w,p]=f.useState(!1),[b,h]=f.useState(null),[x,m]=f.useState(a.base),[C,E]=f.useState(""),[y,S]=f.useState(!1),N=Jn(768);mr([l,u],()=>{p(!1),h(null)}),mr([i,d,l],()=>{S(!1),p(!1),h(null)}),f.useEffect(()=>{const T=D=>{D.key==="Escape"&&p(!1)};return document.addEventListener("keydown",T),()=>{document.removeEventListener("keydown",T)}},[w]),f.useEffect(()=>m(a.base),[a.base]);const k=T=>{T.preventDefault(),T.stopPropagation(),p(D=>{const F=!D;return F||h(null),F})},A=(T,D)=>{Xn({productCategories:e,openCategory:b,setOpenCategory:h})(T,D,C)};return r.jsx("div",{className:c("wu-inline-flex wu-items-center wu-justify-between wu-relative wu-z-auto wu-h-12 wu-text-white"),children:N?r.jsxs("div",{className:"wu-relative wu-flex",children:[r.jsx(uu,{dir:s,isProductButtonShow:y,smallScreenToggleButtonRef:d,setDropdownOpen:p,setIsProductButtonShow:S}),r.jsx(nu,{isProductButtonShow:y,isDropdownOpen:w,activeProductColor:a,activeProductBgColor:x,activeProductName:t,handleDropdownToggle:k,smallScreenButtonRef:i,handleKeyDown:A,dir:s}),r.jsx("div",{className:c("wu-absolute wu-top-[92px] wu-left-0 wu-text-[18px]",s==="rtl"&&"wu-right-[256px] wu-left-auto"),children:r.jsx(Aa,{activeProductName:t,focusItem:C,setFocusItem:E,handleKeyDown:A,isDropdownOpen:w,openCategory:b,productCategories:e,setOpenCategory:h,dropdownRef:l,expandAll:n,dir:s})})]}):r.jsxs("div",{className:"wu-relative wu-flex wu-items-center wu-justify-start wu-h-full wu-w-[256px]",dir:s,style:{backgroundColor:w?a.hover:x},onMouseOver:()=>m(a.hover),onMouseOut:()=>m(a.base),children:[r.jsx(tu,{activeProductName:t,dir:s,homeLink:o,buttonRef:u,handleDropdownToggle:k,handleKeyDown:A,isDropdownOpen:w}),r.jsx(Aa,{activeProductName:t,focusItem:C,setFocusItem:E,handleKeyDown:A,isDropdownOpen:w,openCategory:b,productCategories:e,setOpenCategory:h,dropdownRef:l,expandAll:n,dir:s})]})})},Ma=({children:e,dir:t,className:a})=>r.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",a),children:r.jsx("div",{className:"wu-grow",children:e})}),yr=g.forwardRef(({className:e,type:t,...a},s)=>r.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,...a}));yr.displayName="Input";const lu=e=>{const{message:t,className:a,...s}=e;return r.jsx("p",{...s,className:c("wu-text-sub-3 wu-break-words wu-font-light",a),style:{color:"rgb(var(--wu-red-deep))",...s.style},children:t})},iu=e=>{var l,i;const{inputRef:t,maxLength:a=50,className:s,...o}=e,[n,u]=f.useState(!1);return f.useEffect(()=>{var d;(((d=t==null?void 0:t.current)==null?void 0:d.value.length)||0)>.75*a?u(!0):u(!1)},[(l=t==null?void 0:t.current)==null?void 0:l.value,a]),r.jsx("p",{...o,className:c("wu-text-sub-3 wu-font-light",s),style:{color:"rgb(var(--wu-gray-subtle))",...o.style},children:n&&`${(i=t==null?void 0:t.current)==null?void 0:i.value.length}/${a}`})},cu=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"),qt=g.forwardRef(({className:e,...t},a)=>r.jsx(ma.Root,{ref:a,className:c(cu(),e),...t}));qt.displayName=ma.Root.displayName;const xe=e=>r.jsx(qt,{...e,className:c("wu-text-gray-lead wu-leading-6",e.className)}),du=({Label:e,Error:t,Hint:a,Input:s,labelPosition:o="top",dir:n="ltr",className:u,...l})=>{const d=c("wu-flex",o==="top"?"wu-flex-col wu-gap-1":"wu-flex-row wu-items-center wu-gap-2",u),w=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",n==="ltr"?"wu-right-0":"wu-left-0","wu-form-group-hint"),b=c("wu-absolute -wu-bottom-5",n==="ltr"?"wu-left-0":"wu-right-0","wu-form-group-error");return r.jsxs("div",{className:d,dir:n,...l,children:[e,r.jsxs("div",{className:w,children:[s,a&&r.jsx("div",{className:p,children:a}),t&&r.jsx("div",{className:b,children:t})]})]})},ve=f.forwardRef((e,t)=>{const{Label:a,labelPosition:s="top",Icon:o,iconPosition:n,type:u,value:l,variant:i="flat",readonly:d,id:w=Bt(),...p}=e,b=gt(s),h=o?n!=="right"?"wu-pl-8":"wu-pr-8":"",[x,m]=f.useState(!1),C=()=>{m(y=>!y)},E=y=>{p.onChange&&p.onChange(y)};return r.jsx(r.Fragment,{children:u==="submit"?r.jsx(le,{type:"submit",className:p.className,id:w,children:a||"Submit"}):r.jsx("div",{className:c("wu-flex wu-flex-col wu-gap-2 wu-input-container"),dir:p.dir,children:r.jsxs("div",{className:c("wu-flex wu-gap-1 wu-relative",b,(s==="right"||s==="left")&&"wu-items-center","wu-input-wrapper"),children:[o&&n!=="right"&&r.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}),r.jsx(yr,{...p,className:c("wu-peer wu-text-xs wu-rounded-t-sm",i==="outlined"?"wu-border wu-border-gray-subtle":"",h,p.className),type:x?"text":u,ref:t,readOnly:d,onChange:p.onChange&&E,value:l,id:w}),o&&n==="right"&&r.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}),u==="password"&&r.jsx("div",{className:"wu-absolute wu-right-0 wu-flex wu-items-center wu-justify-center wu-w-8 wu-h-8 wu-cursor-pointer",onClick:C,children:r.jsx("button",{type:"button",className:"wu-flex wu-items-center wu-justify-center wu-w-6 wu-h-6 wu-rounded-sm focus:wu-outline-none focus-visible:wu-ring-2 focus-visible:wu-ring-blue-soft","aria-label":"show-password",children:x?r.jsx("span",{className:"wm-visibility wu-text-gray-subtle"}):r.jsx("span",{className:"wm-visibility-off wu-text-gray-subtle"})})}),a&&r.jsx(xe,{htmlFor:w,className:"wu-flex-none wu-w-fit wu-input-label",children:a})]})})})});ve.displayName="WuInput";const wu=({className:e,placeholder:t="Search surveys, folders or tools",defaultCollapsed:a=!0,onSearch:s,...o})=>{const[n,u]=f.useState(a);return f.useEffect(()=>{u(a)},[a]),r.jsx(ve,{...o,placeholder:t,onChange:l=>s(l.target.value),className:c("wu-rounded-full focus-visible:wu-outline-2 focus-visible:wu-outline-blue-focus -wu-outline-offset-2 wu-bg-white","wu-transition-all wu-duration-300 wu-ease-in-out",n?"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:r.jsx(ue,{"data-testid":"search-icon",icon:"wm-search",className:c("wu-text-gray-lead wu-cursor-pointer",n&&"wu-text-white"),onClick:()=>u(l=>!l)})})},_a=pt.Provider,Fa=pt.Root,La=pt.Trigger,Nr=g.forwardRef(({className:e,sideOffset:t=4,...a},s)=>r.jsx(pt.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),...a}));Nr.displayName=pt.Content.displayName;const zt=f.forwardRef(({content:e,position:t,positionOffset:a,duration:s,children:o,className:n,showArrow:u=!1,open:l,onOpenChange:i,...d},w)=>r.jsx(_a,{delayDuration:s||200,children:r.jsxs(Fa,{open:l,onOpenChange:i,children:[r.jsx(La,{asChild:!0,children:r.jsx("span",{ref:w,children:o})}),r.jsx(dr.Portal,{children:e&&r.jsxs(Nr,{...d,side:t||"top",sideOffset:a||0,className:c("wu-max-w-sm wu-max-h-96 wu-overflow-y-auto",n),children:[e,u&&r.jsx(dr.Arrow,{className:"wu-fill-gray-notification wu-tooltip-arrow"})]})})]})}));zt.displayName="WuTooltip";const fu=({label:e,className:t})=>{const a=f.useRef(null),[s,o]=f.useState(!1);return f.useEffect(()=>{const n=a.current;if(n){const u=n.clientWidth,l=n.scrollWidth,i=l/e.length,d=e.length*i;o(d>u||l>u)}},[e]),r.jsx("p",{ref:a,className:c("wu-w-full wu-truncate",t),children:s?r.jsx(zt,{content:e,positionOffset:8,children:e}):e})},pu=e=>{var p;const{productName:t,categories:a=[],user:s,children:o,onLogout:n,homeLink:u=window.location.origin,brandColor:l,dir:i="ltr",expandAll:d,DataCenter:w}=e;return r.jsx("div",{className:"wu-sticky wu-top-0 wu-z-50 wu-w-full",children:r.jsxs("header",{className:c("wu-h-12 wu-flex wu-items-center wu-justify-between wu-relative wu-bg-blue-switcher wu-text-white",i==="rtl"&&"wu-flex-row-reverse",e.className),style:e.style,children:[Hn((p=s==null?void 0:s.profile)==null?void 0:p.subtitle)&&window.wickUiVersion&&r.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]}),r.jsx("section",{className:"wu-flex wu-items-center wu-gap-2 wu-shrink-0",children:r.jsx(Da,{productCategories:a,activeProductName:t,activeProductColor:l,dir:i,homeLink:u,expandAll:d})}),r.jsx(Ma,{dir:i,children:o}),r.jsxs("section",{className:c("wu-flex wu-items-center wu-justify-end wu-shrink-0 wu-gap-2",i==="rtl"?"wu-flex-row-reverse wu-pl-4":"wu-flex-row wu-pr-4"),children:[r.jsx(ka,{dir:i}),(s==null?void 0:s.profile)&&Object.keys(s.profile).length>0&&r.jsx(Ta,{user:s,onLogout:n,dir:i,DataCenter:w})]})]})})},Fe=ht.Root,Ue=ht.Trigger,Ee=g.forwardRef(({className:e,align:t="center",sideOffset:a=4,...s},o)=>r.jsx(ht.Portal,{children:r.jsx(ht.Content,{ref:o,align:t,sideOffset:a,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})}));Ee.displayName=ht.Content.displayName;function Wa({className:e,classNames:t,dir:a="ltr",...s}){const o=ha.getDefaultClassNames();return r.jsx(ha.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,vr({variant:"iconOnly"}),"wu-h-6 wu-w-6 wu-text-gray-lead"),button_previous:c(o.button_previous,vr({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",a==="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:()=>r.jsx("span",{className:"wm-chevron-right wu-text-lg wu-leading-5"})},...s})}Wa.displayName="Calendar";const Cr=e=>r.jsx(Wa,{...e}),Pa=e=>{const{handleDateChange:t,disabled:a,onReset:s,showResetButton:o}=e;return r.jsxs("div",{className:"wu-flex wu-items-center wu-justify-end wu-gap-2 wu-mt-2 wu-date-picker-footer",children:[o&&r.jsx(le,{variant:"secondary",onClick:s,Icon:r.jsx("span",{className:"wu-text-[20px] wu-leading-5 -wu-mt-[1px] wm-refresh"}),className:"wu-date-picker-footer-reset",children:"Reset"}),r.jsx(wt.PopoverClose,{asChild:!0,children:r.jsx(le,{onClick:t,disabled:a,className:"wu-date-picker-apply",children:"Apply"})})]})},Sr=({formattedString:e,dir:t,placeholder:a="Select Date",className:s,variant:o="primary",color:n,CustomTrigger:u,...l})=>r.jsx(wt.PopoverTrigger,{asChild:!u,dir:t,children:u?r.jsx(r.Fragment,{children:u(e)}):r.jsx(le,{...l,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:r.jsx("span",{className:"wm-calendar-month wu-text-sm"}),iconPosition:"right",children:e||a})}),Oa=(e,t,a,s)=>{const o=j.startOfDay(e).getTime();return!!(t||a&&o<j.startOfDay(a).getTime()||s&&o>j.startOfDay(s).getTime())},Vt=e=>e?typeof e=="string"?new Date(e):e:new Date,Er="\\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}],bu=({formatString:e="yyyy-MM-dd",value:t,onChange:a,disabled:s,minDate:o=j.sub(new Date,{years:5}),maxDate:n=j.add(new Date,{years:1}),dir:u="ltr",Label:l,labelPosition:i="top",onReset:d,showResetButton:w=!1,placeholder:p="Select Date",CustomTrigger:b,...h})=>{const[x,m]=f.useState(),[C,E]=f.useState(""),y=f.useCallback(()=>{const N=Vt(x);E(j.format(N,e)),a&&a(x)},[x,e,a]),S=f.useCallback(()=>{d?d():(m(void 0),E(""),a&&a(void 0))},[a,d]);return f.useEffect(()=>{const N=Vt(t);m(N),E(j.format(N,e))},[t,e]),r.jsxs(xe,{className:c("wu-flex wu-gap-1",i==="left"?"wu-items-center":"wu-flex-col wu-items-start","wu-date-picker-label"),dir:u,children:[l,r.jsxs(Fe,{children:[r.jsx(Sr,{formattedString:C,dir:u,placeholder:p,CustomTrigger:b,...h}),r.jsx(Ee,{className:"wu-p-0 wu-w-fit wu-date-picker-content",align:"start",sideOffset:-.5,dir:u,children:r.jsx(Cr,{dir:u,mode:"single",captionLayout:"dropdown",selected:x,onSelect:m,disabled:N=>Oa(N,s,o,n),startMonth:o,endMonth:n,required:!0,autoFocus:!0,defaultMonth:x,className:c("wu-border wu-border-blue-p wu-date-picker"),footer:r.jsx(Pa,{handleDateChange:y,disabled:s,onReset:S,showResetButton:w})})})]})]})},Ba="yyyy-MM-dd",gu=[{label:"Day",value:1},{label:"Week",value:7},{label:"Month",value:30},{label:"Quarter",value:90},{label:"Year",value:365}],mu=({current:e,onSelect:t,presetRanges:a=hu})=>{const[s,o]=f.useState(),[n,u]=f.useState(!1),[l,i]=f.useState(""),[d,w]=f.useState(""),[p,b]=f.useState(!1),h=f.useMemo(()=>a.map(y=>y.value),[a]),x=c("wu-flex wu-w-full wu-gap-2 wu-px-4 wu-py-2 wu-text-sm wu-text-gray-lead wu-transition-colors","wu-rounded-none hover:wu-bg-gray-10 focus:wu-outline-none focus-visible:wu-ring-2","focus-visible:wu-ring-blue-pHover focus-visible:wu-ring-offset-1 wu-text-start"),m=f.useCallback(y=>{if(y===void 0){o(void 0),u(!0);return}const S=Number(y)-1;o(S),u(!1),t({from:j.sub(new Date,{days:S}),to:new Date})},[t]),C=f.useCallback((y,S)=>{if(!y||!(e!=null&&e.to)||!(e!=null&&e.from)||!new RegExp(Er).test(y))return!1;const k=new Date(S==="start"?y:e.from),A=new Date(S==="end"?y:e.to);return j.isBefore(A,k)?(b(!0),!1):(b(!1),!(j.isSameDay(k,e.from)&&j.isSameDay(A,e.to)))},[e]),E=f.useCallback((y,S)=>{if((S==="start"?i:w)(y),C(y,S)){const k={from:e==null?void 0:e.from,to:e==null?void 0:e.to};S==="start"&&(k.from=new Date(y)),S==="end"&&(k.to=new Date(y)),t(k)}},[e,t,C]);return f.useEffect(()=>{if(e!=null&&e.to&&(e!=null&&e.from)&&j.isValid(e.to)&&j.isValid(e.from)){i(j.format(e.from,Ba)),w(j.format(e.to,Ba));const y=j.differenceInCalendarDays(e.to,e.from);j.isToday(e.to)&&h.includes(y+1)?(o(y),u(!1)):(o(void 0),u(!0))}},[e,h]),r.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:[r.jsx("ul",{className:"wu-flex wu-gap-1 wu-py-2 wu-date-picker-batch-list",children:gu.map(({label:y,value:S})=>r.jsx(Re,{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))}),r.jsxs("ul",{className:"wu-flex wu-flex-col wu-gap-1 wu-date-picker-ranges",children:[a.map(({label:y,value:S})=>r.jsx("li",{children:r.jsx("button",{className:c(x,s===S-1&&"wu-bg-blue-p/10"),onClick:()=>m(S),children:y})},S)),r.jsx("li",{children:r.jsx("button",{className:c(x,n&&"wu-bg-blue-p/10"),onClick:()=>m(),children:"Custom Range"})})]}),r.jsxs("div",{className:"wu-relative wu-flex wu-gap-3 wu-pt-2 wu-date-picker-range-footer",children:[r.jsx(ve,{placeholder:"Start Date",pattern:Er,value:l,onChange:y=>E(y.target.value,"start"),"aria-label":"Start Date"}),r.jsx(ve,{placeholder:"End Date",pattern:Er,value:d,onChange:y=>E(y.target.value,"end"),"aria-label":"End Date"}),p?r.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"}):r.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"})]})]})},xu=({formatString:e="yyyy/MM/dd",value:t,onChange:a,disabled:s,minDate:o=j.sub(new Date,{years:5}),maxDate:n=j.add(new Date,{years:1}),dir:u="ltr",minDateToSelect:l,maxDateToSelect:i,presetRanges:d,Label:w,labelPosition:p="top",onReset:b,showResetButton:h=!0,placeholder:x="Select Date Range",CustomTrigger:m,...C})=>{const[E,y]=f.useState(t),[S,N]=f.useState(t),[k,A]=f.useState(""),T=f.useCallback(()=>{if(S){const W=S.from,_=S.to;y({from:W,to:_}),A(`${j.format(W,e)} - ${j.format(_,e)}`),a&&a({from:W,to:_})}},[S,e,a]),D=f.useCallback(()=>{N(E)},[E]),F=f.useCallback(()=>{b?b():(y(void 0),N(void 0),A(""),a&&a(void 0))},[b,a]);return f.useEffect(()=>{if(t!=null&&t.from&&(t!=null&&t.to)){const W=Vt(t.from),_=Vt(t.to);y(t),N(t),A(`${j.format(W,e)} - ${j.format(_,e)}`)}else y(void 0),N({to:new Date,from:new Date})},[t,e]),r.jsxs(xe,{className:c("wu-flex wu-gap-1",p==="left"?"wu-items-center":"wu-flex-col wu-items-start","wu-date-picker-label"),dir:u,children:[w,r.jsxs(Fe,{onOpenChange:W=>!W&&D(),children:[r.jsx(Sr,{formattedString:k,dir:u,placeholder:x,CustomTrigger:m,...C}),r.jsxs(Ee,{className:"wu-flex wu-p-0 wu-border wu-w-fit wu-border-blue-p",align:"start",sideOffset:-.5,dir:u,children:[r.jsx(mu,{current:S,onSelect:N,presetRanges:d}),r.jsx(Cr,{dir:u,numberOfMonths:2,mode:"range",captionLayout:"dropdown",selected:S,onSelect:N,disabled:W=>Oa(W,s,o,n),startMonth:o,endMonth:n,required:!0,autoFocus:!0,defaultMonth:E==null?void 0:E.from,className:c("wu-shadow-none wu-date-range-picker"),min:l,max:i,footer:r.jsx(Pa,{handleDateChange:T,disabled:s,onReset:F,showResetButton:h})})]})]})]})},qa=f.forwardRef((e,t)=>{const{className:a,rounded:s,...o}=e;return r.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",a),ref:t,...o})});qa.displayName="WuCard";const za=f.forwardRef((e,t)=>{const{className:a,...s}=e;return r.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",a)})});za.displayName="WuCardHeader";const Va=f.forwardRef((e,t)=>{const{className:a,...s}=e;return r.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",a)})});Va.displayName="WuCardHeader";const Ha=g.forwardRef(({className:e,partial:t,...a},s)=>r.jsx(wr.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),...a,children:r.jsxs(wr.Indicator,{className:c("wu-flex wu-items-center wu-justify-center wu-text-current"),children:[!t&&r.jsx("span",{className:"wm-check wu-text-base wu-leading-4"}),t&&r.jsx("span",{className:"wm-check-indeterminate-small wu-text-base wu-leading-4"})]})}));Ha.displayName=wr.Root.displayName;const Ce=f.forwardRef((e,t)=>{const{disabled:a,checked:s,Label:o,labelPosition:n="right",className:u,id:l=Bt(),partial:i,onChange:d,required:w,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]),r.jsxs("div",{className:vu({labelPosition:n,className:"wu-checkbox-container"}),dir:b.dir,children:[r.jsx(Ha,{id:l,...b,partial:i,checked:s,disabled:a||p,onCheckedChange:d,className:c("wu-peer wu-checkbox",u),required:w,ref:t}),o&&r.jsx(xe,{htmlFor:l,className:"wu-w-full wu-checkbox-label",children:o})]})}),vu=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"}}});Ce.displayName="WuCheckbox";const yu=e=>{const{className:t,children:a,...s}=e;return r.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:a})},Tr=g.forwardRef(({className:e,...t},a)=>r.jsx(fe.Command,{ref:a,className:c("wu-flex wu-h-full wu-w-full wu-flex-col wu-overflow-hidden wu-rounded-md",e),...t}));Tr.displayName=fe.Command.displayName;const $a=g.forwardRef(({className:e,...t},a)=>r.jsx("div",{className:"wu-flex wu-items-center wu-border-b wu-px-3",children:r.jsx(fe.Command.Input,{ref:a,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})}));$a.displayName=fe.Command.Input.displayName;const kr=g.forwardRef(({className:e,...t},a)=>r.jsx(fe.Command.List,{ref:a,className:c("",e),...t}));kr.displayName=fe.Command.List.displayName;const Ir=g.forwardRef((e,t)=>r.jsx(fe.Command.Empty,{ref:t,className:"wu-text-center wu-p-2 wu-pb-2.5 wu-text-xs",...e}));Ir.displayName=fe.Command.Empty.displayName;const mt=g.forwardRef(({className:e,...t},a)=>r.jsx(fe.Command.Group,{ref:a,className:c("",e),...t}));mt.displayName=fe.Command.Group.displayName;const Ua=g.forwardRef(({className:e,...t},a)=>r.jsx(fe.Command.Separator,{ref:a,className:c("wu-mx-1 wu-my-1 wu-h-px wu-bg-gray-20",e),...t}));Ua.displayName=fe.Command.Separator.displayName;const xt=g.forwardRef(({className:e,...t},a)=>r.jsx(fe.Command.Item,{ref:a,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}));xt.displayName=fe.Command.Item.displayName;const tt=f.forwardRef(({containerHeight:e=400,list:t,callback:a,dir:s,className:o,style:n},u)=>r.jsx(Sn.Virtuoso,{ref:u,dir:s,className:o,style:{height:e,scrollbarWidth:"thin",scrollbarColor:"#d4d4d4 #f1f1f1",overflowX:"hidden",...n},data:t,itemContent:(l,i)=>a(l,i)}));tt.displayName="WuVirtualScroll";const Nu=({tags:e,triggerRef:t})=>{const[a,s]=f.useState([]),[o,n]=f.useState([]),u=f.useMemo(()=>r.jsx("ul",{className:"wu-flex wu-flex-col wu-items-start wu-justify-center wu-list-none",children:o.map((i,d)=>r.jsx("li",{className:"wu-py-1 wu-text-xs wu-text-left",children:i},d))}),[o]),l=i=>{const d=document.createElement("div");Object.assign(d.style,{display:"inline-block",visibility:"hidden",position:"absolute",whiteSpace:"nowrap"}),d.textContent=i,document.body.appendChild(d);const w=d.offsetWidth;return document.body.removeChild(d),w+8};return f.useEffect(()=>{const i=()=>{if(t.current){const b=t.current.offsetWidth-20-36;let h=0;const x=[],m=[];e.forEach(C=>{const E=l(C);h+E+8<b?(x.push(C),h+=E+8):m.push(C)}),s(x),n(m)}};return i(),window.addEventListener("resize",i),()=>{window.removeEventListener("resize",i)}},[e,t]),r.jsxs("div",{className:"wu-flex wu-items-center wu-gap-2 wu-text-xs",children:[a.map((i,d)=>r.jsx("span",{className:"wu-px-1 wu-py-0.5 wu-text-xs wu-rounded-sm wu-bg-gray-10 wu-combobox-tag",children:i},d)),o.length>0&&r.jsx(zt,{content:u,className:"wu-z-[51] wu-text-left",children:r.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]})})]})},Cu=({placeholder:e="Select...",isEllipse:t=!1,selectedOptions:a,variant:s="flat",dir:o="ltr",accessorKey:n,multiple:u,id:l,disabled:i,selectAll:d,isCheckedAll:w,className:p,...b})=>{const[h,x]=f.useState([]),m=f.useRef(null);f.useEffect(()=>{if(!a||Array.isArray(a)&&a.length===0){x([]);return}if(u){const E=a;x(E==null?void 0:E.map(y=>y[n.label]));return}else x([a[n.label]])},[a]);const C=()=>{var E;return h.length?w&&(d!=null&&d.enable)&&(d!=null&&d.triggerText)?r.jsx("span",{className:"wu-overflow-hidden wu-text-xs wu-text-start wu-text-ellipsis wu-whitespace-nowrap",children:d.triggerText}):t?r.jsx("span",{className:"wu-overflow-hidden wu-text-xs wu-text-start wu-text-ellipsis wu-whitespace-nowrap",style:{width:`${(((E=m.current)==null?void 0:E.offsetWidth)||0)-32}px`},children:h.join(", ")}):r.jsx(Nu,{tags:h,triggerRef:m}):r.jsx("p",{className:"wu-text-xs wu-opacity-70",children:e})};return r.jsx(Ue,{dir:o,asChild:!0,id:l,disabled:i,children:r.jsxs("button",{...b,ref:m,disabled:i,className:c("focus-visible:wu-ring-2 focus-visible:wu-ring-blue-pHover wu-bg-white focus-visible:wu-ring-offset-2 wu-flex wu-w-full wu-items-center wu-justify-between wu-border-b wu-border-gray-subtle wu-py-1.5 wu-px-2 placeholder:wu-text-gray-40 focus:wu-outline-none disabled:wu-cursor-not-allowed disabled:wu-opacity-50 hover:wu-bg-gray-10 hover:wu-border-blue-p wu-transition-colors focus-visible:wu-bg-gray-20 focus-visible:wu-border-blue-p wu-cursor-pointer wu-text-xs wu-rounded-t-sm wu-gap-2 wu-h-8 wu-group/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:[C(),r.jsx("span",{className:"wm-arrow-drop-down group-data-[state=open]/wuCombobox:wu-rotate-180 wu-transition-transform wu-duration-300 wu-text-base"})]})})},Ar=R.Root,Dr=R.Trigger,ja=R.Group,Su=R.Portal,Eu=R.Sub,Tu=R.RadioGroup,Ga=g.forwardRef(({className:e,inset:t,children:a,position:s,...o},n)=>r.jsxs(R.SubTrigger,{ref:n,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"&&r.jsx("span",{className:c("wm-chevron-right",o.dir==="rtl"&&"ml-2")}),a,s!=="left"&&r.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")})]}));Ga.displayName=R.SubTrigger.displayName;const Ya=g.forwardRef(({className:e,...t},a)=>r.jsx(R.SubContent,{ref:a,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}));Ya.displayName=R.SubContent.displayName;const Ht=g.forwardRef(({className:e,sideOffset:t=4,...a},s)=>r.jsx(R.Portal,{children:r.jsx(R.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),...a})}));Ht.displayName=R.Content.displayName;const vt=g.forwardRef(({className:e,inset:t,...a},s)=>r.jsx(R.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),...a}));vt.displayName=R.Item.displayName;const Ka=g.forwardRef(({className:e,children:t,checked:a,dir:s,...o},n)=>r.jsxs(R.CheckboxItem,{ref:n,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:a,...o,children:[r.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:r.jsx(R.ItemIndicator,{children:r.jsx("span",{className:"wm-check wu-text-base wu-text-white"})})}),t]}));Ka.displayName=R.CheckboxItem.displayName;const Ja=g.forwardRef(({className:e,children:t,...a},s)=>r.jsxs(R.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),...a,children:[r.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:r.jsx(R.ItemIndicator,{className:"wu-w-4 wu-h-4 wu-flex wu-items-center wu-justify-center",children:r.jsx("span",{className:"wm-circle wu-text-blue-p group-hover:group-data-[state=checked]:wu-text-blue-q wu-text-xs"})})}),t]}));Ja.displayName=R.RadioItem.displayName;const yt=g.forwardRef(({className:e,inset:t,...a},s)=>r.jsx(R.Label,{ref:s,className:c("wu-p-2 wu-font-medium wu-text-xs",t&&"wu-pl-8",e),...a}));yt.displayName=R.Label.displayName;const $t=g.forwardRef(({className:e,...t},a)=>r.jsx(R.Separator,{ref:a,className:c("-wu-mx-1 wu-my-1 wu-h-px wu-bg-gray-20",e),...t}));$t.displayName=R.Separator.displayName;const Xa=({option:e,value:t,multiple:a=!1,onSelect:s,accessorKey:o,dir:n})=>{const[u,l]=f.useState(a?[]:"");f.useEffect(()=>{t&&l(a?t.map(p=>JSON.stringify(p[o.value])):JSON.stringify(t[o.value]))},[t,o.value,a]);const i=a?u.includes(JSON.stringify(e[o.value])):u===JSON.stringify(e[o.value]),d=()=>{e.disabled||s(e)};return r.jsxs(xt,{onSelect:d,disabled:e.disabled,className:c("wu-cursor-pointer wu-text-xs wu-items-start wu-leading-4 wu-py-2 wu-combobox-item hover:wu-bg-gray-100",i&&"wu-bg-gray-10"),dir:n,children:[a&&r.jsx(Ce,{checked:i}),r.jsx(ku,{option:e,accessorKey:o})]})},ku=({option:e,accessorKey:t})=>{const a=e[t.label];return r.jsxs("div",{className:"wu-flex wu-items-center wu-w-full wu-gap-1",children:[e.icon&&e.icon,a,e.isAdmin&&r.jsx("span",{className:"wu-ml-auto wu-text-sm wm-lock wu-text-orange-deep"})]})},Za=e=>{const{option:t,selectAll:a,handleSelectAll:s,isCheckedAll:o,isPartialSelected:n,...u}=e;switch("type"in t?t.type:"option"){case"all":return r.jsxs(xt,{onSelect:s,className:c("wu-cursor-pointer wu-text-xs wu-leading-4 wu-py-2 wu-combobox-item"),dir:u.dir,children:[r.jsx(Ce,{checked:o||n,partial:n,"data-partial":n,"aria-label":(a==null?void 0:a.label)||"Select All"}),r.jsx("span",{"aria-hidden":!0,children:(a==null?void 0:a.label)||"Select All"})]});case"group":return r.jsxs(mt,{children:[r.jsx(yt,{children:t.label}),t.options.map((i,d)=>f.createElement(Xa,{...u,option:i,key:d}))]});case"divider":return r.jsx(Ua,{className:"wu-mx-4"});default:return r.jsx(Xa,{...u,option:t})}},Iu=e=>{const t=[],a=[],s=[],o=[];return e.forEach(n=>{n.type==="group"?(t.push(n),s.push(...n.options),o.push(...n.options.filter(u=>!u.disabled))):n.type==="divider"?a.push(n):s.push(n),n!=null&&n.disabled||o.push(n)}),{groups:t,dividers:a,allOptions:s,enabledOptions:o}},Au=f.memo(ve),Du=({data:e,accessorKey:t,value:a,defaultValue:s,Header:o,virtualizedThreshold:n=100,isEllipse:u,placeholder:l,variant:i,dir:d,onSelect:w,Label:p,maxHeight:b=420,multiple:h=!1,hasGroup:x=!1,selectAll:m,id:C,disabled:E,labelPosition:y="top",className:S,onScroll:N,maxContentWidth:k,enableSearch:A=!0,noDataContent:T,...D})=>{const[F,W]=f.useState(""),[_,z]=f.useState(),[P,G]=f.useState(!1),[q,oe]=f.useState(!1),[M,H]=f.useState(!1),U=f.useRef(null),{allOptions:O,enabledOptions:ae}=f.useMemo(()=>x||m&&!m.includeDisabled?Iu(e):{allOptions:e,groups:[],dividers:[],enabledOptions:[]},[e,x]),te=f.useMemo(()=>{if(!F)return e;const L=F.toLowerCase();return O.filter(Z=>Z[t.label].toLowerCase().includes(L))},[F,O,e,t.label]),pe=f.useMemo(()=>h&&m!=null&&m.enable&&!F&&te.length>0?[{type:"all"},...te]:te,[te,F,h]),We=f.useCallback(L=>{const Z=L[t.value];h?z(B=>{const we=B||[],be=we.some(de=>de[t.value]===Z)?we.filter(de=>de[t.value]!==Z):[...we,L];return w==null||w(be),be}):(G(!1),z(L),w==null||w(L))},[h,t.value,w]),$=f.useCallback(L=>W(L.target.value),[]),I=f.useCallback(()=>W(""),[]);f.useEffect(()=>{if(a!==void 0&&s!==void 0){console.error("defaultValue and value cannot be used simultaneously");return}else a!==void 0?z(a):s!==void 0&&z(s)},[a,s]),f.useEffect(()=>{if(!h)return;const L=m!=null&&m.includeDisabled?(_==null?void 0:_.length)===O.length:(_==null?void 0:_.length)===ae.length;oe(L);const Z=(_==null?void 0:_.length)>0&&!L;H(Z)},[_,m]);const V=f.useCallback(()=>{const L=q?[]:m!=null&&m.includeDisabled?O:ae;z(L),w==null||w(L)},[q,h,O,ae,w,m]),K=gt(y);return r.jsxs("div",{className:c(K,"wu-flex wu-combobox-container"),ref:U,children:[r.jsxs(Fe,{onOpenChange:L=>{L&&I(),G(L)},open:P,modal:!0,children:[r.jsx(Cu,{selectedOptions:_,accessorKey:t,isEllipse:u,placeholder:l,variant:i,dir:d,multiple:h,disabled:E,selectAll:m,isCheckedAll:q,className:S,id:C,...D}),r.jsx(Ee,{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:r.jsxs(Tr,{id:C,children:[A&&r.jsx("div",{className:"wu-m-2",children:r.jsx(Au,{placeholder:"Search...",Icon:r.jsx("span",{className:"wm-search"}),className:"wu-text-xs wu-combobox-search",onChange:$,name:"Search","aria-label":"Search",dir:d,iconPosition:d==="rtl"?"right":"left"})}),o,r.jsxs(kr,{children:[r.jsx(Ir,{children:T||"No results found."}),pe.length>=n?r.jsx(tt,{className:"wu-combobox-list",containerHeight:b,list:pe,callback:(L,Z)=>r.jsx(Za,{option:Z,value:_,onSelect:We,multiple:h,accessorKey:t,dir:d,selectAll:m,handleSelectAll:V,isCheckedAll:q,isPartialSelected:M},L),dir:d}):r.jsx("div",{style:{height:"fit-content",maxHeight:b,overflow:"auto"},className:"wu-combobox-list",onScroll:N,children:pe.map((L,Z)=>r.jsx(Za,{option:L,value:_,onSelect:We,multiple:h,accessorKey:t,dir:d,selectAll:m,handleSelectAll:V,isCheckedAll:q,isPartialSelected:M},Z))})]})]})})]}),p&&r.jsx(xe,{htmlFor:C,className:"wu-combobox-label",children:p})]})},Mu=e=>{const{textToCopy:t,notificationText:a,...s}=e,[o,n]=f.useState(!1),u=async()=>{if(t)try{await navigator.clipboard.writeText(t),n(!0),setTimeout(()=>n(!1),2e3)}catch(l){console.error("Failed to copy:",l)}};return r.jsxs(le,{...s,onClick:u,variant:"iconOnly",className:c("wu-relative",e.className),"aria-label":"Copy to clipboard",children:[a&&r.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:a}),r.jsx(ue,{icon:"wm-content-copy",className:"wu-text-lg"})]})},Qa=X.Root,_u=X.Trigger,Fu=X.Close,Lu=X.Portal,Ra=g.forwardRef(({className:e,...t},a)=>r.jsx(X.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:a}));Ra.displayName=X.Overlay.displayName;const Wu=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"}}),Mr=g.forwardRef(({side:e="right",className:t,children:a,hideCloseButton:s,overlayClassName:o,closeButtonClassName:n,...u},l)=>r.jsxs(Lu,{children:[r.jsx(Ra,{className:o}),r.jsxs(X.Content,{ref:l,className:c(Wu({side:e}),t),...u,children:[a,!s&&r.jsx(X.Close,{"aria-label":"close",asChild:!0,children:r.jsxs(Re,{variant:"iconOnly",className:c("wu-absolute wu-right-4 wu-top-4",n),children:[r.jsx("span",{className:"wm-close"}),r.jsx("span",{className:"wu-sr-only",children:"Close"})]})})]})]}));Mr.displayName=X.Content.displayName;const es=g.forwardRef(({className:e,...t},a)=>r.jsx(X.Title,{ref:a,className:c("wu-text-lg wu-font-semibold",e),...t}));es.displayName=X.Title.displayName;const Pu=g.forwardRef(({className:e,...t},a)=>r.jsx(X.Description,{ref:a,className:c("wu-text-sm",e),...t}));Pu.displayName=X.Description.displayName;const Ou=e=>t=>{e&&t.preventDefault()},Bu=e=>{const{Trigger:t,children:a,hideCloseButton:s,className:o,side:n="left",open:u,onOpenChange:l,preventClickOutside:i,overlayClassName:d,closeButtonClassName:w,...p}=e;return r.jsxs(Qa,{open:u,onOpenChange:l,children:[r.jsx(_u,{asChild:!0,children:t}),r.jsxs(Mr,{onInteractOutside:Ou(i),side:n,className:c("wu-bg-white wu-text-gray-lead wu-px-0",o),hideCloseButton:s,overlayClassName:d,closeButtonClassName:w,...p,children:[r.jsx("div",{className:"wu-hidden",children:r.jsx(es,{})}),a]})]})},qu=({children:e,...t})=>r.jsx(Fu,{...t,children:e}),ts=({className:e,isLoading:t,loadingText:a,children:s,...o})=>r.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:[r.jsx("div",{className:"wu-flex-1",children:s}),t&&r.jsx(et,{size:"16px",variant:"spinner",color:"#a3a3a3",message:a})]});ts.displayName="WuFooter";const rs=f.forwardRef((e,t)=>{const{size:a="sm",idOrSlugOrUrl:s,variant:o="primary",...n}=e,u=a==="sm"?16:18,l=s.includes("http")?s:`/help/${s}.html`,i=o==="primary"?"wu-text-blue-p":"wu-text-gray-lead";return r.jsx("button",{...n,ref:t,onClick:()=>pr(l),children:r.jsx("span",{className:c("wm-help wu-text-gray-subtle",`wu-text-[${u}px]`,i,n.disabled&&"wu-text-neutral-300","wu-help-button-icon")})})});rs.displayName="WuHelpButton";const qe=(e,t)=>`wu-listbox-${e}`;function zu(e){const{option:t,accessorKey:a,onSelect:s,multiple:o,dir:n,GroupLabel:u,Item:l,isSelected:i,...d}=e,w=a.group&&Array.isArray(t[a.group]),p=({item:b,className:h})=>f.createElement(xt,{...d,key:JSON.stringify(b),onSelect:()=>s==null?void 0:s(b),value:t[a.value],className:c("data-[selected='true']:wu-bg-gray-100 wu-cursor-pointer wu-text-xs wu-min-h-8 wu-py-0 hover:wu-bg-gray-100",!!(i!=null&&i(b))&&!o&&"wu-bg-blue-p/10",n==="rtl"&&"wu-justify-end",h,qe("item")),disabled:b.disabled},o&&r.jsx(Ce,{checked:i==null?void 0:i(b)}),l?l({value:b,isSelected:i==null?void 0:i(b)}):r.jsx(r.Fragment,{children:b[a.label]}));if(w){const b=t[a.group],h=typeof u=="string"?t[u]:u==null?void 0:u(t);return r.jsx(mt,{heading:h,children:b==null?void 0:b.map(x=>r.jsx(p,{item:x,className:"wu-pl-6"},JSON.stringify(x)))})}return r.jsx(p,{item:t})}const Vu=f.memo(zu),Hu=e=>{const{className:t,...a}=e;return r.jsxs("div",{className:"wu-relative",children:[r.jsx(ue,{icon:"wm-search",className:"wu-absolute wu-top-[14px] wu-left-5"}),r.jsx($a,{...a,"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;",qe("input"),t)})]})},$u=e=>{const{label:t,onSelectAll:a,data:s,value:o}=e,[n,u]=f.useState(!1),[l,i]=f.useState(!1);return f.useEffect(()=>{!o||!s||(u(o.length>0),i(o.length>0&&o.length<s.length))},[s,o]),r.jsxs(xt,{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:()=>a==null?void 0:a(!n),children:[r.jsx(Ce,{checked:n,partial:l}),t||"Select All"]})},Uu=e=>{const{CustomTrigger:t,disabled:a,value:s,placeholder:o,accessorKey:n,Chip:u,handleUnselect:l,variant:i,dir:d,className:w,...p}=e,[b,h]=f.useState(),x=f.useRef(null);return f.useEffect(()=>{if(!s){h(null);return}h(Array.isArray(s)?u?s.map((C,E)=>u({value:C,unselect:l,key:E})):s.map(C=>C[n.label]).join(", "):u?u({value:s,unselect:l}):s[n.label])},[s,u,n.label,h]),r.jsx(Ue,{asChild:!0,id:e.id,disabled:a,ref:x,children:(t==null?void 0:t(s))||r.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",i==="outlined"&&"wu-border wu-border-gray-subtle wu-bg-white",w,qe("trigger")),children:[r.jsx("div",{className:c("wu-truncate",u&&"wu-flex wu-items-center wu-gap-1 wu-flex-wrap",!b&&"wu-font-light"),children:b||o}),r.jsx(ue,{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",d==="rtl"?"wu-left-1":"wu-right-1",qe("drop-icon"))})]})})},as=(e,t,a)=>{const s=String(e[a.label]??"").toLowerCase(),o=String(e[a.value]??"").toLowerCase();return s.includes(t)||o.includes(t)},ju=(e,t,a)=>{const s=t.trim();if(s==="")return e;const o=s.toLowerCase(),n=[];for(const u of e){const l=a.group,i=l?u[l]:void 0;if(Array.isArray(i)){const d=i.filter(w=>as(w,o,a));d.length>0&&n.push({...u,[l]:d})}else as(u,o,a)&&n.push(u)}return n},Gu=e=>{const{data:t,accessorKey:a,value:s,Item:o,Label:n,GroupLabel:u,CustomHeader:l,CustomTrigger:i,NoDataContent:d,Chip:w,onSelect:p,onScroll:b,disabled:h,multiple:x,searchable:m,selectAll:C,virtualizedThreshold:E=100,id:y,dir:S,className:N,listClass:k,placeholder:A="Select items...",variant:T,labelPosition:D="top",maxContentWidth:F,maxContentHeight:W,modal:_,...z}=e,[P,G]=f.useState(!1),[q,oe]=f.useState(""),[M,H]=f.useState(s),U=f.useMemo(()=>a,[a]),O=f.useMemo(()=>{if(!m||!q)return t;const $=q.toLowerCase().trim();return ju(t,$,a)},[t,q,a.label,m]),ae=$=>{x?H(I=>{const V=$[a.value],K=Array.isArray(I)?I:[],Z=K.some(B=>B[a.value]===V)?K.filter(B=>B[a.value]!==V):[...K,$];return p&&p(Z),Z}):(H($),p&&p($),G(!1))},te=f.useCallback($=>{const I=$?t:[];H(I),C!=null&&C.onSelectAll&&C.onSelectAll($),p&&p(I)},[t,C,p]),pe=$=>Array.isArray(M)?M.some(I=>I[a.value]===$[a.value]):(M==null?void 0:M[a.value])===$[a.value];f.useEffect(()=>{H(s)},[s]);const We=$=>{const I=V=>r.jsx(Vu,{option:V,accessorKey:U,multiple:x,onSelect:K=>ae(K),dir:S,GroupLabel:u,Item:o,isSelected:K=>pe(K)},JSON.stringify(V));return $.length>E?r.jsx(tt,{list:$,callback:(V,K)=>I(K),dir:S}):$.map(I)};return r.jsxs("div",{className:c("wu-flex wu-text-sm wu-gap-2",D==="top"&&"wu-flex-col wu-gap-1",D==="left"&&"wu-flex-row",D==="right"&&"wu-flex-row-reverse",qe("container")),dir:S,children:[n&&r.jsx(xe,{htmlFor:y,className:qe("label"),children:n}),r.jsxs(Fe,{open:P,onOpenChange:$=>{G($),$||setTimeout(()=>{oe("")},100)},modal:_,children:[r.jsx(Uu,{CustomTrigger:i,disabled:h,value:M,accessorKey:a,placeholder:A,Chip:w,className:N,handleUnselect:ae,variant:T,id:y,dir:S,...z}),r.jsx(Ee,{className:c("wu-min-w-[--radix-popover-trigger-width] wu-max-w-[calc(100vw-32px)] wu-w-auto wu-p-0 wu-bg-white wu-border wu-border-blue-p",qe("content")),align:"start",sideOffset:-1,style:{maxWidth:F},children:r.jsxs(Tr,{id:e.id,shouldFilter:!1,children:[m&&r.jsx(Hu,{value:q,onValueChange:oe}),l,r.jsxs(kr,{className:c("wu-overflow-y-auto",qe("list"),k),onScroll:b,style:{maxHeight:W||"420px"},children:[r.jsx(Ir,{children:d||"No results found."}),r.jsx(mt,{children:x&&(C==null?void 0:C.enabled)&&!q&&r.jsx($u,{data:t,value:M,onSelectAll:te,label:C.label})}),r.jsx(mt,{children:We(O)})]})]})})]})]})},Yu=e=>{const{checked:t,onSelect:a,children:s,disabled:o,preventCloseOnSelect:n}=e;return r.jsx(Ka,{disabled:o,checked:t,onCheckedChange:a,onSelect:u=>n&&u.preventDefault(),children:s})},_r=e=>{const{children:t,className:a,Icon:s,iconPosition:o="left",disabled:n,onSelect:u,preventCloseOnSelect:l}=e,i=c("wu-flex wu-items-center wu-gap-2",s&&(o==="left"?"":"wu-justify-between wu-flex-row-reverse"),a),d=w=>{u&&u(w),l&&w.preventDefault()};return r.jsxs(vt,{onSelect:d,disabled:n,className:i,children:[s&&r.jsx("div",{className:"wu-text-base",children:s}),t]})},Ku=e=>{const{children:t,Label:a,...s}=e;return r.jsxs(ja,{...s,children:[r.jsx(yt,{children:a||e.label}),t]})},Ju=e=>{const{options:t,value:a,onSelect:s}=e;return r.jsx(Tu,{value:a,onValueChange:s,children:t.map(o=>r.jsx(Ja,{value:o.value,disabled:o.disabled,children:o.Label||o.label},o.value))})},Xu=e=>{const{className:t,...a}=e,s=c("wu-w-11/12 wu-mx-auto wu-border-gray-40",t);return r.jsx($t,{...a,className:s})},rt=g.forwardRef(({className:e,children:t,thumbColor:a,railColor:s,...o},n)=>r.jsxs(He.Root,{ref:n,className:c("wu-relative wu-overflow-hidden",e),children:[r.jsx(He.Viewport,{className:"wu-h-full wu-w-full wu-rounded-[inherit]",...o,children:t}),r.jsx(Fr,{thumbColor:a,railColor:s}),r.jsx(He.Corner,{})]}));rt.displayName=He.Root.displayName;const Fr=g.forwardRef(({className:e,orientation:t="vertical",thumbColor:a="#d4d4d4",railColor:s="#eeeeee",...o},n)=>r.jsx(He.ScrollAreaScrollbar,{ref:n,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:r.jsx(He.ScrollAreaThumb,{className:"wu-relative wu-flex-1 wu-rounded-full",style:{background:a}})}));Fr.displayName=He.ScrollAreaScrollbar.displayName;const Zu=e=>{const{children:t,label:a,Label:s,open:o,onOpenChange:n,height:u,dir:l,...i}=e;return r.jsxs(Eu,{...i,open:o,onOpenChange:n,children:[r.jsx(Ga,{dir:l,children:s||a}),r.jsx(Su,{children:r.jsx(Ya,{onInteractOutside:d=>d.preventDefault(),children:r.jsx(rt,{className:"wu-h-fit",style:{height:u},dir:l,children:t})})})]})},Qu="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",ss=e=>{const{children:t,menuTitle:a,MenuTitle:s,variant:o="flat",name:n,open:u,onOpenChange:l,height:i,preventCloseOnClickOutside:d,dir:w,Trigger:p,align:b="start",sideOffset:h=0,side:x="bottom",alignOffset:m,className:C,disabled:E,...y}=e;return r.jsxs(Ar,{...y,open:u,onOpenChange:l,dir:w,children:[r.jsx(Dr,{asChild:!0,dir:w,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??Ru(o,n,E)}),r.jsx(Ht,{className:c("wu-w-56 wu-border wu-border-blue-p disabled:wu-border-gray-40",C,"wu-menu-content"),align:b,sideOffset:h,side:x,alignOffset:m,onInteractOutside:S=>d&&S.preventDefault(),children:r.jsxs(rt,{className:"h-fit",style:{height:i},dir:w,children:[(a||s)&&r.jsxs(r.Fragment,{children:[r.jsx(yt,{dir:w,className:"wu-menu-title",children:s||a}),r.jsx($t,{className:"wu-mt-0 wu-menu-separator",dir:w})]}),t??r.jsx("p",{children:"Menu Is Empty"})]})})]})},Ru=(e,t,a)=>{const s=c(Qu,"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 r.jsxs("button",{className:s,"aria-label":"menu-trigger",children:[r.jsx("span",{children:t??"Menu"}),r.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",a&&"wu-text-zinc-300 group-hover:wu-text-zinc-300")})]})},Lr=f.forwardRef(({showMenu:e=!1,className:t,color:a="#1B3380",...s},o)=>{const n=c("wu-w-full wu-border wu-transition-all wu-duration-300");return r.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:[r.jsx("div",{className:`${n} wu-origin-center ${e?"wu-rotate-45 wu-translate-y-[5px]":""}`,style:{borderColor:a}}),r.jsx("div",{className:`${n} ${e?"wu-opacity-0":""}`,style:{borderColor:a}}),r.jsx("div",{className:`${n} wu-origin-center ${e?"-wu-rotate-45 -wu-translate-y-[5px]":""}`,style:{borderColor:a}})]})});Lr.displayName="WuMenuIcon";const os={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%]"},ns=X.Root,us=X.Trigger,el=X.Portal,tl=X.Close,ls=f.forwardRef(({className:e,...t},a)=>r.jsx(X.Overlay,{ref:a,className:c("wu-fixed wu-inset-0 wu-z-50 wu-bg-black/30",os.overlay,e),...t}));ls.displayName=X.Overlay.displayName;const Wr=f.forwardRef(({className:e,children:t,hideCloseButton:a,isStackedCard:s,...o},n)=>r.jsxs(el,{children:[r.jsx(ls,{className:s?"wu-bg-transparent":""}),r.jsxs(X.Content,{ref:n,className:c("wu-fixed wu-left-[50%] wu-z-50 wu-top-[50%] wu-flex wu-flex-col wu-w-full wu-max-w-lg wu-translate-x-[-50%] wu-translate-y-[-50%] wu-bg-white wu-shadow-lg wu-duration-200",os.content,e),...o,children:[t,!a&&r.jsx(X.Close,{"aria-label":"close",asChild:!0,children:r.jsxs(Re,{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:[r.jsx("span",{className:"wu-text-lg wm-close wuexp:wu-text-xl wuexp:wu-leading-5"}),r.jsx("span",{className:"wu-sr-only",children:"Close"})]})})]})]}));Wr.displayName=X.Content.displayName;const Pr=({className:e,...t})=>r.jsx("div",{className:c("wu-text-center wu-bg-gray-20 wu-w-full",e),...t});Pr.displayName="DialogHeader";const is=({className:e,...t})=>r.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});is.displayName="DialogFooter";const at=f.forwardRef(({className:e,...t},a)=>r.jsx(X.Title,{ref:a,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}));at.displayName=X.Title.displayName;const rl=f.forwardRef(({className:e,...t},a)=>r.jsx(X.Description,{ref:a,className:c("wu-text-sm wu-text-muted-foreground",e),...t}));rl.displayName=X.Description.displayName;const al={gradientBackground:"_gradientBackground_1bbet_1"},cs=e=>{const{colors:t,size:a=.55,children:s,className:o,strokeWidth:n,centerOffset:u={x:0,y:0},...l}=e,i=f.useRef(null);return f.useEffect(()=>{const d=i.current;if(d){d.style.setProperty("--width",`${d.offsetWidth*a}px`),d.style.setProperty("--height",`${d.offsetHeight*a}px`),d.style.setProperty("--colors",t.join(",")),d.style.setProperty("--stroke-width",`-${n||2}px`),d.style.setProperty("--spotlight-background","radial-gradient(100% var(--height) ellipse at 25% 70%, var(--colors))");let p;const b=h=>{p&&cancelAnimationFrame(p),p=requestAnimationFrame(()=>{const x=d.getBoundingClientRect();let m=h.clientX-x.left,C=h.clientY-x.top;m=Math.max(0,Math.min(m+u.x,x.width)),C=Math.max(0,Math.min(C+u.y,x.height));const E=`radial-gradient(
2
5
  var(--width) var(--height) ellipse at ${m}px ${C}px,
3
6
  var(--colors)
4
- )`;w.style.setProperty("--spotlight-background",k)})};return window.addEventListener("mousemove",h),()=>{window.removeEventListener("mousemove",h),f&&cancelAnimationFrame(f)}}},[t,r,n,u]),a.jsx("div",{ref:l,className:c(Xu.gradientBackground,"wu-transform-gpu",o),...i,children:s})},is="calc(100vh - 64px)",Zu={sm:"400px",md:"600px",lg:"1200px"},Wa=({Trigger:e,children:t,size:r="md",hideCloseButton:s,preventClickOutside:o,onOpenChange:n,open:u,dir:i,maxWidth:l,maxHeight:w,className:d,style:f,variant:h="action",...b})=>{const g={action:["#EEF3FBcc 32%","#1D50F4cc"],upgrade:["#FDEDCCcc 32%","#FF9F00cc"],critical:["#FFB6B6cc 32%","#CC0000cc"]};return a.jsxs(ss,{modal:!0,onOpenChange:n,open:u,children:[e&&a.jsx(os,{asChild:!0,children:e}),a.jsxs(Ma,{style:{width:"calc(100% - 64px)",maxWidth:l||Zu[r],maxHeight:w||is,...f},hideCloseButton:s,onInteractOutside:m=>o&&m.preventDefault(),dir:i,"aria-describedby":void 0,"data-variant":h,className:c("wu-group wuexp:wu-rounded-[1.1rem]",d),...b,children:["data-theme"in b&&a.jsx(ls,{colors:g[h],strokeWidth:4,className:c("wuexp:wu-rounded-[1.1rem] wu-transform-gpu wu-flex wu-flex-col",d),style:{maxHeight:w||is},children:t}),!("data-theme"in b)&&t]})]})},La=({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}),Qu=({children:e,className:t,...r})=>a.jsx(Aa,{...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(_a,{className:"wuexp:wu-font-normal wuexp:wu-justify-start wuexp:wu-text-2xl wuexp:wu-h-14",children:e})}),Pa=({children:e,className:t,...r})=>a.jsx(us,{...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}),qt=({children:e,className:t,...r})=>{const s=p.useRef(null);return a.jsx(Ku,{asChild:!0,children:a.jsx(we,{className:t,ref:s,...r,children:e})})},Ru=({placeholder:e="Select...",value:t,multiple:r=!1,accessorKey:s,variant:o="flat",dir:n="ltr",customTriggerChildren:u,id:i,disabled:l,selectAll:w,isCheckedAll:d,width:f,...h})=>{const[b,g]=p.useState(""),[m,C]=p.useState(e);p.useEffect(()=>{if(!t||Array.isArray(t)&&t.length===0){C(e),g("");return}const y=s.label;if(r&&Array.isArray(t)){const S=t.map(v=>v[y]).join(", ");g(S)}else!r&&!Array.isArray(t)&&g(t[y])},[t,s.label,r,e]);const k=()=>e&&!b?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:`${(f||0)-32}px`},children:d?(w==null?void 0:w.triggerText)??b:b});return a.jsx(ka,{asChild:!0,dir:n,id:i,disabled:l,children:a.jsxs("button",{...h,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",h.className),children:[u??k(),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"})]})})},cs=({option:e,value:t,multiple:r=!1,onSelect:s,accessorKey:o,dir:n="ltr"})=>{const[u,i]=p.useState(r?[]:"");p.useEffect(()=>{t&&i(r?t.map(f=>JSON.stringify(f[o.value])):JSON.stringify(t[o.value]))},[t,o.value,r]);const l=r?u.includes(JSON.stringify(e[o.value])):u===JSON.stringify(e[o.value]),w=d=>{e.disabled||(s(e),r&&d.preventDefault())};return a.jsxs(Ot,{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:n,children:[r&&a.jsx(Ie,{checked:l}),a.jsx(ws,{option:e,accessorKey:o})]})},ws=({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"})]})},ds=e=>{const{option:t,handleSelectAll:r,isCheckedAll:s,isPartialSelected:o,...n}=e;switch("type"in t?t.type:"option"){case"all":return a.jsxs(Ot,{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:n.dir,children:[a.jsx(Ie,{"data-partial":o,checked:s||o,partial:o}),a.jsx(ws,{option:t,accessorKey:n.accessorKey})]});case"group":return a.jsxs(Hr,{dir:n.dir,children:[a.jsx(ht,{className:"wu-text-xs",children:t.label}),t.options.map((i,l)=>p.createElement(cs,{...n,option:i,key:l}))]});case"divider":return a.jsx(Bt,{className:"wu-mx-4"});default:return a.jsx(cs,{...n,option:t})}},el=e=>{let t=0,r=0;const s=[],o=[],n=u=>{u.type==="divider"?t++:u.type==="group"?(r++,u.options.forEach(i=>{n(i)})):(s.push(u),u.disabled||o.push(u))};return e.forEach(u=>{n(u)}),{separators:t,groups:r,enabledOptions:o,totalData:s.length,cleanData:s}},tl=100,al=400,fs=({data:e,onSelect:t,multiple:r=!1,defaultValue:s,value:o,accessorKey:n,variant:u="flat",dir:i="ltr",placeholder:l,Label:w,virtualizedThreshold:d=tl,maxHeight:f=al,hasGroup:h=!1,Header:b,CustomTrigger:g,selectAll:m,disabled:C,labelPosition:k="top",onScroll:y,maxContentWidth:S,...v})=>{const[T,I]=p.useState(),E=p.useRef(null),[M,_]=p.useState(!1),[O,A]=p.useState(!1),{cleanData:P,enabledOptions:L}=h||m!=null&&m.enable?el(e):{cleanData:e,enabledOptions:[]},F=p.useMemo(()=>r&&m!=null&&m.enable&&e.length>0?[{type:"all",[n.label]:m.label||"Select All"},...e]:e,[e,m,r]),B=p.useCallback(V=>{const H=V[n.value];if(r)I((ne=[])=>{const K=ne,Ce=K.some(q=>q[n.value]===H)?K.filter(q=>q[n.value]!==H):[...K,V];return t==null||t(Ce),Ce});else{const ne=V;I(ne),t==null||t(ne)}},[r,n.value,t]);p.useEffect(()=>{if(s&&o){console.error("defaultValue and value cannot be used simultaneously");return}!s&&!o&&I(void 0),s!==void 0&&I(s),o!==void 0&&I(o)},[s,o]);const W=F.length>d;p.useEffect(()=>{if(!r)return;const V=m!=null&&m.includeDisabled?(T==null?void 0:T.length)===e.length:(T==null?void 0:T.length)===L.length;_(V);const H=(T==null?void 0:T.length)>0&&!V;A(H)},[T,m]);const z=p.useCallback(()=>{const V=M?[]:m!=null&&m.includeDisabled?h?P:e:L;I(V),t==null||t(V)},[M,r,e,L,t,m]),j=dt(k);return a.jsxs("div",{className:c(j,"wu-flex wu-select-container"),ref:E,dir:i,children:[a.jsxs(Sa,{children:[a.jsx(Ru,{...v,value:T,multiple:r,variant:u,dir:i,placeholder:l,accessorKey:n,customTriggerChildren:g,id:v.id,disabled:C,selectAll:m,isCheckedAll:M}),a.jsxs(Ft,{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:[b,W?a.jsx(tt,{list:F,containerHeight:f,callback:(V,H)=>a.jsx(ds,{option:H,accessorKey:n,multiple:r,onSelect:B,value:T,dir:i,handleSelectAll:z,isCheckedAll:M,isPartialSelected:O}),dir:i}):a.jsx("div",{onScroll:y,style:{maxHeight:f,height:"fit-content",overflow:"auto"},className:"wu-select-list",children:F.map((V,H)=>a.jsx(ds,{option:V,accessorKey:n,multiple:r,onSelect:B,value:T,handleSelectAll:z,isCheckedAll:M,dir:i,isPartialSelected:O},`${H}`))})]})]}),w&&a.jsx(ge,{htmlFor:v.id,className:"wu-select-label",children:w})]})},Vt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],rl=({value:e,onChange:t,min:r=U.sub(new Date,{years:5}),max:s=U.add(new Date,{years:1}),placeholder:o="Select a month",Label:n,labelPosition:u="top",disabled:i,id:l,readonly:w,disabledMonths:d=[],...f})=>{const[h,b]=p.useState(null),[g,m]=p.useState(""),[C,k]=p.useState({value:Math.min(new Date().getFullYear(),new Date(s).getFullYear()),label:Math.min(new Date().getFullYear(),new Date(s).getFullYear())}),y=p.useMemo(()=>{const v=new Date(r).getFullYear(),T=new Date(s).getFullYear();return Array.from({length:T-v+1},(I,E)=>({value:T-E,label:T-E}))},[r,s]);p.useEffect(()=>{if(e){const v=new Date(e),T=v.getFullYear(),I=v.getMonth();b({year:T,month:I}),m(`${Vt[I]} ${T}`),k({value:T,label:T})}},[e]);const S=()=>{h&&t&&(t(new Date(h.year,h.month,15)),m(`${Vt[h.month]} ${h.year}`))};return a.jsxs("div",{className:c("wu-flex wu-flex-col wu-items-center",dt(u),u==="top"&&"wu-items-start"),children:[a.jsxs(Te,{children:[a.jsx(xa,{...f,disabled:i||w,id:l,dir:"ltr",placeholder:o,formattedString:g}),a.jsxs(ye,{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(fs,{data:y,accessorKey:{value:"value",label:"label"},value:C,onSelect:v=>k(v),multiple:!1,maxHeight:224})}),a.jsx(sl,{year:C==null?void 0:C.value,selectedMonth:h==null?void 0:h.month,selectedYear:h==null?void 0:h.year,onClick:(v,T)=>b({year:T,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(we,{onClick:S,children:"Apply"})})})]})]}),n&&a.jsx(ge,{className:"wu-truncate wu-max-w-[120px] wu-min-w-fit wu-select-label",children:n})]})},sl=({year:e,selectedMonth:t,selectedYear:r,onClick:s,disabledMonths:o=[]})=>{const n=new Date,u=n.getFullYear(),i=n.getMonth(),l=p.useMemo(()=>{const w=new Set;return o.forEach(d=>{const f=typeof d=="string"?new Date(d):d;w.add(`${f.getFullYear()}-${f.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:Vt.map((w,d)=>{const f=e===u&&d===i,h=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",f&&"wu-border wu-border-blue-p",h&&"wu-bg-blue-p wu-text-white hover:wu-bg-blue-p/80 hover:wu-text-white wu-font-medium","disabled:wu-bg-gray-20 disabled:wu-text-gray-subtle disabled:hover:wu-bg-gray-20 disabled:hover:wu-text-gray-subtle disabled:hover:wu-font-normal","wu-month-picker-month"),"data-value":`${Vt[d]} ${e}`,"data-month":d,"data-year":e,children:w},w)})})},ps=(e,t,r,s=96)=>{if(e.length===0||s<=0)return[[],[]];const[n,u]=p.useState([]),[i,l]=p.useState([]);return p.useEffect(()=>{const w=()=>{var g,m;const d=((g=t.current)==null?void 0:g.clientWidth)||0,f=((m=r.current)==null?void 0:m.clientWidth)||0,h=d-f,b=Math.floor(h/s);u(e.slice(0,b)),l(e.slice(b))};return w(),window.addEventListener("resize",w),()=>{window.removeEventListener("resize",w)}},[e,s]),[n,i]},hs={wuPrimaryLink:"_wuPrimaryLink_1sy3v_1",wuPrimaryPopoverContent:"_wuPrimaryPopoverContent_1sy3v_8"},ol=e=>{const{Links:t,children:r,className:s,...o}=e,n=p.useMemo(()=>t.map((d,f)=>p.cloneElement(d,{className:c(hs.wuPrimaryLink,d.props.className,"wu-primary-nav-link"),key:f})),[t]),u=p.useRef(null),i=p.useRef(null),[l,w]=ps(n,u,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:u,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(Te,{children:[a.jsx(Be,{className:"wu-p-1 wu-pb-0 wu-rounded-sm focus:wu-outline-none focus:wu-bg-gray-25","aria-label":"more",children:a.jsx("span",{className:"wm-more-vert"})}),a.jsx(ye,{className:c(hs.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(Te,{children:[a.jsx(Be,{className:"sm:wu-hidden",children:a.jsx("span",{className:"wu-text-lg wm-menu"})}),a.jsx(ye,{className:"wu-bg-white wu-border wu-border-blue-p wu-w-fit wu-primary-nav-popover-right",align:"end",sideOffset:4,children:r})]})]})]})})},Fa={wuSecondaryLink:"_wuSecondaryLink_1edl1_1",wuSecondaryNav:"_wuSecondaryNav_1edl1_6"},nl=e=>{const{Links:t,children:r,className:s,...o}=e,n=p.useMemo(()=>t.map((f,h)=>p.cloneElement(f.link,{key:h,className:c(Fa.wuSecondaryLink,f.link.props.className,"wu-secondary-nav-link-container"),children:a.jsxs(a.Fragment,{children:[p.cloneElement(f.imgOrIcon,{className:c("wu-w-5 wu-h-5 wu-flex wu-items-center wu-justify-center wu-text-lg wu-leading-5",f.imgOrIcon.props.className)}),a.jsx("div",{className:"wu-secondary-nav-link",children:f.link.props.children})]})})),[t]),u=p.useRef(null),i=p.useRef(null),l=p.useRef(null),[w,d]=ps(n,u,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:u,children:[a.jsxs("div",{className:"wu-flex wu-items-center wu-justify-start wu-gap-2",children:[a.jsx("nav",{className:c(Fa.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(Te,{children:[a.jsx(Be,{className:"wu-p-1 wu-pb-0 wu-rounded-sm focus:wu-outline-none focus:wu-bg-gray-25","aria-label":"more",children:a.jsx("span",{className:"wm-more-vert"})}),a.jsx(ye,{className:c(Fa.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(Te,{children:[a.jsx(Be,{className:"sm:wu-hidden",children:a.jsx("span",{className:"wu-text-lg wm-menu"})}),a.jsx(ye,{className:"wu-bg-white wu-border wu-border-blue-p wu-w-fit wu-secondary-nav-popover-right",align:"end",sideOffset:12,children:r})]})]})]})})},bs=p.forwardRef(({totalRows:e,initialPage:t=0,initialPageSize:r=100,onPageChange:s,className:o,disabled:n=!1,...u},i)=>{const[l,w]=p.useState(t),[d,f]=p.useState(r);p.useEffect(()=>{w(t),f(r)},[t,r]);const h=Math.ceil(e/d),b=l*d+1,g=Math.min((l+1)*d,e),m=Array.from({length:h},(y,S)=>S),C=p.useCallback(y=>{y>=0&&y<h&&(w(y),s==null||s(y))},[h,s]),k=224;return a.jsxs("div",{className:c("wu-flex wu-items-center wu-gap-[2px]",o,"wu-pagination"),...u,role:"navigation",children:[a.jsx(gs,{label:"Previous page",onClick:()=>C(l-1),disabled:l===0||n,icon:"wm-arrow-back-ios-new",className:"hover:wu-bg-gray-20 rtl:wu-rotate-180 wu-prev-btn"}),a.jsx(as,{name:`${b} - ${g}`,className:"wu-w-[96px] wu-min-w-[96px] wu-pagination-menu",align:"end",disabled:n,children:a.jsx(at,{style:{maxHeight:k+"px"},dir:u.dir,children:m.length>100?a.jsx(tt,{className:"wu-pagination-list",containerHeight:k,list:m,callback:(y,S)=>a.jsxs(Ta,{onSelect:()=>C(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)}):m.map(y=>a.jsxs(Ta,{onSelect:()=>C(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(gs,{label:"Next page",onClick:()=>C(l+1),disabled:l===h-1||n,icon:"wm-arrow-forward-ios",className:"hover:wu-bg-gray-20 rtl:wu-rotate-180 wu-next-btn"})]})});bs.displayName="WuPagination";const gs=({label:e,onClick:t,disabled:r,icon:s,className:o})=>a.jsx(we,{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)})}),ul=({Trigger:e,children:t,className:r,dir:s,open:o,onOpenChange:n,modal:u,...i})=>a.jsxs(Te,{open:o,onOpenChange:n,modal:u,children:[a.jsx(Be,{asChild:!0,dir:s,children:e}),a.jsx(ye,{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})]}),ll=e=>a.jsx(lt.PopoverClose,{asChild:!0,children:a.jsx(we,{...e})}),ms=x.forwardRef(({className:e,...t},r)=>a.jsx(wt.Root,{className:c("wu-grid wu-gap-2",e),...t,ref:r}));ms.displayName=wt.Root.displayName;const xs=x.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"})})}));xs.displayName=wt.Item.displayName;const ys=p.forwardRef((e,t)=>{const{options:r,defaultValue:s,onChange:o,label:n,dir:u,...i}=e;return a.jsxs(ms,{defaultValue:s,required:i.required,disabled:i.disabled,onValueChange:o,id:i.id,dir:u,name:i.name,className:c("w-fit",i.className),ref:t,style:i.style,children:[a.jsx(Wt,{htmlFor:i.id,className:"wu-text-sm wu-font-normal wu-text-gray-lead wu-leading-6 wu-radio-group-label",children:n}),r.map(l=>a.jsxs("div",{className:"wu-flex wu-items-center wu-gap-2 wu-radio-item-container",children:[a.jsx(xs,{value:l.value,id:l.value,disabled:l.disabled,required:l.required,"aria-label":l.value,className:"wu-peer wu-radio-item"}),a.jsx(Wt,{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))]})});ys.displayName="WuRadioGroup";const il=e=>{const{children:t,...r}=e;return a.jsxs(at,{...r,role:"complementary","aria-label":"ScrollArea",children:[t,a.jsx(Ia,{orientation:"horizontal"})]})},vs=x.forwardRef(({className:e,orientation:t="horizontal",decorative:r=!0,...s},o)=>a.jsx(mr.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}));vs.displayName=mr.Root.displayName;function Ns({className:e,...t}){return a.jsx("div",{className:c("animate-pulse rounded-md bg-muted",e),...t})}const Oa=768;function cl(){const[e,t]=x.useState(void 0);return x.useEffect(()=>{const r=window.matchMedia(`(max-width: ${Oa-1}px)`),s=()=>{t(window.innerWidth<Oa)};return r.addEventListener("change",s),t(window.innerWidth<Oa),()=>r.removeEventListener("change",s)},[]),!!e}const wl="sidebar_state",dl=3600*24*7,fl="256px",pl="256px",hl="3rem",bl="b",Cs=x.createContext(null);function Ue(){const e=x.useContext(Cs);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}const Ss=x.forwardRef(({defaultOpen:e=!0,open:t,onOpenChange:r,className:s,style:o,children:n,...u},i)=>{const l=cl(),[w,d]=x.useState(!1),[f,h]=x.useState(l?!0:e),b=t??f,g=x.useCallback(y=>{const S=typeof y=="function"?y(b):y;r?r(S):h(S),document.cookie=`${wl}=${S}; path=/; max-age=${dl}`},[r,b]),m=x.useCallback(()=>l?d(y=>!y):g(y=>!y),[l,g,d]);x.useEffect(()=>{const y=S=>{S.key===bl&&(S.metaKey||S.ctrlKey)&&(S.preventDefault(),m())};return window.addEventListener("keydown",y),()=>window.removeEventListener("keydown",y)},[m]);const C=b?"expanded":"collapsed",k=x.useMemo(()=>({state:C,open:b,setOpen:g,isMobile:l,openMobile:w,setOpenMobile:d,toggleSidebar:m}),[C,b,g,l,w,d,m]);return a.jsx(Cs.Provider,{value:k,children:a.jsx(Ar,{delayDuration:0,children:a.jsx("div",{style:{"--sidebar-width":fl,"--sidebar-width-icon":hl,...o},className:c("wu-group/sidebar-wrapper wu-flex wu-min-h-[calc(100svh-48px)] wu-w-full",s),ref:i,...u,children:n})})})});Ss.displayName="SidebarProvider";const ks=x.forwardRef(({side:e="left",variant:t="sidebar",collapsible:r="offcanvas",className:s,children:o,...n},u)=>{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:u,...n,children:o}):i?a.jsx(Jr,{open:w,onOpenChange:d,...n,children:a.jsx(Ea,{"data-sidebar":"sidebar","data-mobile":"true",className:"wu-w-[--sidebar-width] wu-bg-blue-sidebar wu-p-0 [&>button]:wu-hidden",style:{"--sidebar-width":pl},side:e,children:a.jsx("div",{className:"wu-flex wu-flex-col wu-w-full wu-h-full",children:o})})}):a.jsxs("div",{ref:u,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),...n,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})})]})});ks.displayName="Sidebar";const Es=x.forwardRef(({className:e,onClick:t,children:r,...s},o)=>{const{toggleSidebar:n}=Ue();return a.jsxs(Re,{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:u=>{t==null||t(u),n()},...s,children:[r,a.jsx("span",{className:"wu-sr-only",children:"Toggle Sidebar"})]})});Es.displayName="SidebarTrigger";const gl=x.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})});gl.displayName="SidebarRail";const Ts=x.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}));Ts.displayName="SidebarInset";const ml=x.forwardRef(({className:e,...t},r)=>a.jsx(ba,{ref:r,"data-sidebar":"input",className:c("wu-h-8 wu-w-full wu-shadow-none focus-visible:wu-ring-2",e),...t}));ml.displayName="SidebarInput";const Is=x.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}));Is.displayName="SidebarHeader";const Ds=x.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}));Ds.displayName="SidebarFooter";const xl=x.forwardRef(({className:e,...t},r)=>a.jsx(vs,{ref:r,"data-sidebar":"separator",className:c("wu-mx-2 wu-w-auto",e),...t}));xl.displayName="SidebarSeparator";const Ms=x.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}));Ms.displayName="SidebarContent";const As=x.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}));As.displayName="SidebarGroup";const _s=x.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})});_s.displayName="SidebarGroupLabel";const yl=x.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})});yl.displayName="SidebarGroupAction";const Ws=x.forwardRef(({className:e,...t},r)=>a.jsx("div",{ref:r,"data-sidebar":"group-content",className:c("wu-w-full wu-text-sm",e),...t}));Ws.displayName="SidebarGroupContent";const Ba=x.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}));Ba.displayName="SidebarMenu";const Ls=x.forwardRef(({className:e,...t},r)=>a.jsx("li",{ref:r,"data-sidebar":"menu-item",className:c("wu-group/menu-item wu-relative",e),...t}));Ls.displayName="SidebarMenuItem";const vl=Ee.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"}}),Ps=x.forwardRef(({asChild:e=!1,isActive:t=!1,variant:r="default",size:s="default",tooltip:o,className:n,...u},i)=>{const l=e?Xe.Slot:"button",{isMobile:w,state:d}=Ue(),f=a.jsx(l,{ref:i,"data-sidebar":"menu-button","data-size":s,"data-active":t,className:c(vl({variant:r,size:s}),n),...u});return o?(typeof o=="string"&&(o={children:o}),a.jsxs(_r,{children:[a.jsx(Wr,{asChild:!0,children:f}),a.jsx(ga,{side:"right",align:"center",hidden:d!=="collapsed"||w,...o})]})):f});Ps.displayName="SidebarMenuButton";const Nl=x.forwardRef(({className:e,asChild:t=!1,showOnHover:r=!1,...s},o)=>{const n=t?Xe.Slot:"button";return a.jsx(n,{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})});Nl.displayName="SidebarMenuAction";const Cl=x.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 Sl=x.forwardRef(({className:e,showIcon:t=!1,...r},s)=>{const o=x.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return a.jsxs("div",{ref:s,"data-sidebar":"menu-skeleton",className:c("wu-flex wu-h-8 wu-items-center wu-gap-2 wu-rounded-md wu-px-2",e),...r,children:[t&&a.jsx(Ns,{className:"wu-rounded-md wu-size-4","data-sidebar":"menu-skeleton-icon"}),a.jsx(Ns,{className:"wu-h-4 wu-max-w-[--skeleton-width] wu-flex-1","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":o}})]})});Sl.displayName="SidebarMenuSkeleton";const kl=x.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}));kl.displayName="SidebarMenuSub";const El=x.forwardRef(({...e},t)=>a.jsx("li",{ref:t,...e}));El.displayName="SidebarMenuSubItem";const Tl=x.forwardRef(({asChild:e=!1,size:t="md",isActive:r,className:s,...o},n)=>{const u=e?Xe.Slot:"a";return a.jsx(u,{ref:n,"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})});Tl.displayName="SidebarMenuSubButton";const Il=({children:e,Sidebar:t,className:r,defaultOpen:s=!0,open:o,onOpenChange:n,style:u})=>a.jsxs(Ss,{defaultOpen:s,open:o,onOpenChange:n,children:[a.jsxs(ks,{variant:"sidebar",collapsible:"icon",className:c("wu-top-12 wu-h-[calc(100%-48px)] wu-shadow-sidebar wu-border-none",r),style:u,role:"complementary",children:[a.jsx(Is,{className:"wu-py-2",children:a.jsx(Fs,{})}),t]}),a.jsx(Ts,{className:"wu-contain-inline-size",children:e})]}),Fs=e=>{const{state:t,isMobile:r,openMobile:s}=Ue();return a.jsx(Es,{...e,children:a.jsx(Da,{showMenu:r?s:t==="expanded"})})},Dl=({className:e,children:t,...r})=>{const s=p.useRef(null),o=p.useRef(null),n=({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)},u="wu-w-[calc(100%-16px)] wu-mx-auto wu-border-transparent";return a.jsxs(Ms,{...r,className:c("wu-overflow-hidden wu-gap-0",e),children:[a.jsx("hr",{className:u,ref:s}),a.jsx(at,{onScroll:n,className:"wu-gap-2",thumbColor:"#b9c3dc",railColor:"#00000000","data-testid":"scroll-area",children:t}),a.jsx("hr",{className:u,ref:o})]})},Ml=e=>a.jsx(Ds,{...e,children:e.children}),Al=({label:e,children:t,...r})=>a.jsxs(As,{...r,className:"wu-p-0",children:[a.jsx("div",{className:"wu-h-8",children:a.jsx(_s,{className:"wu-items-end wu-px-4 wu-text-xs wu-font-normal wu-leading-4 wu-text-blue-q",children:e})}),a.jsx(Ws,{children:a.jsx(Ba,{children:t})})]}),_l=e=>a.jsx(Ba,{...e}),Wl=({Icon:e,children:t,className:r,isActive:s,...o})=>{const{state:n}=Ue(),[u,i]=p.useState(),l=t&&p.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",n==="collapsed"&&"wu-opacity-0"),children:t.props.children})]})}),w=p.useRef(null);return p.useEffect(()=>{var d;i(((d=w.current)==null?void 0:d.textContent)||"")},[]),a.jsx(Ls,{...o,className:"wu-flex wu-items-center wu-gap-2 wu-px-2",children:a.jsx(Ps,{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:u,asChild:!0,ref:w,children:l})})},Ll=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"}]]),qa=(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]),n=parseFloat(s[2]),u=Math.max(0,parseFloat(s[3])+t);return`hsl(${o} ${n}% ${u}% / ${r})`},Pl=({index:e,viewIndex:t,length:r,itemHeight:s})=>{const o=(e-t+r)%r;let n;o===0?n=0:o===r-1&&r>=2?n=-1:o===r-2&&r>=3?n=-2:o===1?n=1:o===2?n=2:o===r-3&&r>=4?n=-3:n=3;const u=Ll.get(n)||{},i=n>0?s+28+(n-1)*20:u.top;return{position:n,styles:{...u,...n>0&&{top:`${i}px`},height:n>0?"32px":s}}},bt={LIGHTNESS_STEP:8,BORDER_LIGHTNESS:10,CONTENT_HEIGHT:"calc(100% - 2rem)",FONT_SIZE_ACTIVE:"14px",FONT_SIZE_INACTIVE:"12px"},Fl=({children:e,className:t,header:r,baseColor:s,position:o=0,style:n,...u})=>{const i=o<=0,l=o===0,w={border:l?`4px solid ${qa(s,bt.BORDER_LIGHTNESS)}`:"",...n},d={backgroundColor:qa(s,o*bt.LIGHTNESS_STEP),fontSize:l?bt.FONT_SIZE_ACTIVE:bt.FONT_SIZE_INACTIVE,transition:"all 0.3s ease",position:"relative",bottom:o<0?"4px":"0px",height:"32px",padding:"4px 8px"},f={backgroundColor:qa(s,45+o*6),height:bt.CONTENT_HEIGHT,position:"relative",bottom:o<0?"4px":"0px"};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,...u,children:[a.jsx("div",{style:d,className:"wu-text-white",children:r}),i&&a.jsx("div",{className:"wu-p-2 wu-overflow-y-auto wu-text-sm",style:f,children:e})]})},Ol=({children:e,Trigger:t,Header:r,styles:s={},classNames:o={},open:n,onOpenChange:u,itemHeight:i})=>{const l={height:i,...s.Trigger};return a.jsxs(ss,{open:n,onOpenChange:u,children:[a.jsx(os,{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(Ma,{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(_a,{}),a.jsx(pr.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(ce,{icon:"wm-close",className:"wu-text-lg wu-m-4 wu-cursor-pointer"})}),r&&a.jsx(Aa,{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 Bl({controlled:e,default:t,name:r,state:s="value"}){const{current:o}=x.useRef(e!==void 0),[n,u]=x.useState(t),i=o?e:n;if(process.env.NODE_ENV!=="production"){x.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}=x.useRef(t);x.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=x.useCallback(w=>{o||u(w)},[]);return[i,l]}const Os={};function rt(e,t){const r=x.useRef(Os);return r.current===Os&&(r.current=e(t)),r}const Va=x[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],ql=Va&&Va!==x.useLayoutEffect?Va:e=>e();function ve(e){const t=rt(Vl).current;return t.next=e,ql(t.effect),t.trampoline}function Vl(){const e={next:void 0,callback:zl,trampoline:(...t)=>{var r;return(r=e.callback)==null?void 0:r.call(e,...t)},effect:()=>{e.callback=e.next}};return e}function zl(){if(process.env.NODE_ENV!=="production")throw new Error("Base UI: Cannot call an event handler while rendering.")}const Hl=[];function Bs(e){x.useEffect(e,Hl)}const gt=0;class zt{constructor(){Dt(this,"currentId",gt);Dt(this,"clear",()=>{this.currentId!==gt&&(clearTimeout(this.currentId),this.currentId=gt)});Dt(this,"disposeEffect",()=>this.clear)}static create(){return new zt}start(t,r){this.clear(),this.currentId=setTimeout(()=>{this.currentId=gt,r()},t)}isStarted(){return this.currentId!==gt}}function za(){const e=rt(zt.create).current;return Bs(e.disposeEffect),e}const qs=0;class Ha extends zt{constructor(){super(...arguments);Dt(this,"clear",()=>{this.currentId!==qs&&(clearInterval(this.currentId),this.currentId=qs)})}static create(){return new Ha}start(r,s){this.clear(),this.currentId=setInterval(()=>{s()},r)}}function $l(){const e=rt(Ha.create).current;return Bs(e.disposeEffect),e}const me=typeof document<"u"?x.useLayoutEffect:()=>{};function $a(e){const t=rt(Ul,e).current;return t.next=e,me(t.effect),t}function Ul(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}function jl(){const[,e]=x.useState({});return x.useCallback(()=>{e({})},[])}function Gl(){return typeof window<"u"}function Vs(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Yl(e){return Gl()?e instanceof HTMLElement||e instanceof Vs(e).HTMLElement:!1}function Kl(e){return(e==null?void 0:e.ownerDocument)||document}const Ht=typeof navigator<"u",Ua=Ql(),Jl=ei(),Xl=Rl();typeof CSS>"u"||!CSS.supports||CSS.supports("-webkit-backdrop-filter:none");const Zl=Ua.platform==="MacIntel"&&Ua.maxTouchPoints>1?!0:/iP(hone|ad|od)|iOS/.test(Ua.platform);Ht&&Jl.toLowerCase().startsWith("mac")&&navigator.maxTouchPoints,Xl.includes("jsdom/");function Ql(){if(!Ht)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 Rl(){if(!Ht)return"";const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:t,version:r})=>`${t}/${r}`).join(" "):navigator.userAgent}function ei(){if(!Ht)return"";const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform??""}const ja=x.createContext(void 0);process.env.NODE_ENV!=="production"&&(ja.displayName="NumberFieldRootContext");function $t(){const e=x.useContext(ja);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 Ve=Object.freeze({});let zs=(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 Ga={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},ti={valid(e){return e===null?null:e?{[zs.valid]:""}:{[zs.invalid]:""}}},Hs=x.createContext({invalid:void 0,controlId:void 0,setControlId:_e,labelId:void 0,setLabelId:_e,messageIds:[],setMessageIds:_e,name:void 0,validityData:{state:Ga,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"&&(Hs.displayName="FieldRootContext");function Ut(e=!0){const t=x.useContext(Hs);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 $s(e,t,r,s){const o=rt(Us).current;return ri(o,e,t,r,s)&&js(o,[e,t,r,s]),o.callback}function ai(e){const t=rt(Us).current;return si(t,e)&&js(t,e),t.callback}function Us(){return{callback:null,cleanup:null,refs:[]}}function ri(e,t,r,s,o){return e.refs[0]!==t||e.refs[1]!==r||e.refs[2]!==s||e.refs[3]!==o}function si(e,t){return e.refs.length!==t.length||e.refs.some((r,s)=>r!==t[s])}function js(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 n=t[o];if(n!=null)switch(typeof n){case"function":{const u=n(r);typeof u=="function"&&(s[o]=u);break}case"object":{n.current=r;break}}}e.cleanup=()=>{for(let o=0;o<t.length;o+=1){const n=t[o];if(n!=null)switch(typeof n){case"function":{const u=s[o];typeof u=="function"?u():n(null);break}case"object":{n.current=null;break}}}}}}}const oi=parseInt(x.version,10);function ni(e){return oi>=e}function Gs(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}function ui(e,t){const r={};for(const s in e){const o=e[s];if(t!=null&&t.hasOwnProperty(s)){const n=t[s](o);n!=null&&Object.assign(r,n);continue}o===!0?r[`data-${s.toLowerCase()}`]="":o&&(r[`data-${s.toLowerCase()}`]=o.toString())}return r}function li(e,t){return typeof e=="function"?e(t):e}const xt={};function jt(e,t,r,s,o){let n={...Ya(e,xt)};return t&&(n=Gt(n,t)),r&&(n=Gt(n,r)),s&&(n=Gt(n,s)),n}function ii(e){if(e.length===0)return xt;if(e.length===1)return Ya(e[0],xt);let t={...Ya(e[0],xt)};for(let r=1;r<e.length;r+=1)t=Gt(t,e[r]);return t}function Gt(e,t){return Ys(t)?t(e):ci(e,t)}function ci(e,t){if(!t)return e;for(const r in t){const s=t[r];switch(r){case"style":{e[r]=Gs(e.style,s);break}case"className":{e[r]=Ks(e.className,s);break}default:wi(r,s)?e[r]=di(e[r],s):e[r]=s}}return e}function wi(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 Ys(e){return typeof e=="function"}function Ya(e,t){return Ys(e)?e(t):e??xt}function di(e,t){return t?e?r=>{if(fi(r)){const o=r;Ka(o);const n=t(o);return o.baseUIHandlerPrevented||e==null||e(o),n}const s=t(r);return e==null||e(r),s}:t:e}function Ka(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function Ks(e,t){return t?e?t+" "+e:t:e}function fi(e){return e!=null&&typeof e=="object"&&"nativeEvent"in e}function yt(e,t,r={}){const s=t.render,o=pi(t,r);if(r.enabled===!1)return null;const n=r.state??Ve;return hi(e,s,o,n)}function pi(e,t={}){const{className:r,render:s}=e,{state:o=Ve,ref:n,props:u,stateAttributesMapping:i,enabled:l=!0}=t,w=l?li(r,o):void 0,d=l?ui(o,i):Ve,f=l?Gs(d,Array.isArray(u)?ii(u):u)??Ve:Ve;return typeof document<"u"&&(l?Array.isArray(n)?f.ref=ai([f.ref,Js(s),...n]):f.ref=$s(f.ref,Js(s),n):$s(null,null)),l?(w!==void 0&&(f.className=Ks(f.className,w)),f):Ve}function hi(e,t,r,s){if(t){if(typeof t=="function")return t(r,s);const o=jt(r,t.props);return o.ref=r.ref,x.cloneElement(t,o)}if(e&&typeof e=="string")return bi(e,r);throw new Error("Base UI: Render element or function are not defined.")}function bi(e,t){return e==="button"?a.jsx("button",{type:"button",...t}):e==="img"?a.jsx("img",{alt:"",...t}):x.createElement(e,t)}function Js(e){return e&&typeof e!="function"?ni(19)?e.props.ref:e.ref:null}const Xs=new Map;function vt(e,t){const r=JSON.stringify({locale:e,options:t}),s=Xs.get(r);if(s)return s;const o=new Intl.NumberFormat(e,t);return Xs.set(r,o),o}function st(e,t,r){return e==null?"":vt(t,r).format(e)}function Zs(e,t,r){return st(e,t,{...r,maximumFractionDigits:20})}const gi=["零","〇","一","二","三","四","五","六","七","八","九"],mi={零:"0","〇":"0",一:"1",二:"2",三:"3",四:"4",五:"5",六:"6",七:"7",八:"8",九:"9"},Qs=["٠","١","٢","٣","٤","٥","٦","٧","٨","٩"],Rs=["۰","۱","۲","۳","۴","۵","۶","۷","۸","۹"],Ja=["0","1","2","3","4","5","6","7","8","9"],eo=["%","٪","%","﹪"],to=["‰","؉"],ao=["−","-","‒","–","—","﹣"],ro=["+","﹢"],xi=".",yi=",",vi=new RegExp(`[${Qs.join("")}]`,"g"),Ni=new RegExp(`[${Rs.join("")}]`,"g"),Ci=new RegExp(`[${Ja.join("")}]`,"g"),Si=new RegExp(`[${gi.join("")}]`,"g"),ki=new RegExp(`[${eo.join("")}]`),Ei=new RegExp(`[${to.join("")}]`),Xa=/[٠١٢٣٤٥٦٧٨٩]/,so=/[۰۱۲۳۴۵۶۷۸۹]/,Za=/[零〇一二三四五六七八九]/,oo=new RegExp(`[${Ja.join("")}]`),Ti=[".",",",xi,yi,"٫","٬"],Ii=new RegExp("\\p{Zs}","u"),Di=["+",...ro],Mi=["-",...ao],Yt=e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),Ai=e=>e.replace(/[-\\\]^]/g,t=>`\\${t}`),no=e=>`[${e.map(Ai).join("")}]`,uo=no(["-"].concat(ao)),lo=no(["+"].concat(ro)),io=new RegExp(uo,"gu"),co=new RegExp(lo,"gu"),Nt=new RegExp(uo),Kt=new RegExp(lo);function Qa(e,t){const r=vt(e,t).formatToParts(11111.1),s={};return r.forEach(o=>{s[o.type]=o.value}),vt(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(io,"-").replace(co,"+");let o=!1;const n=s.match(/([+-])\s*$/);n&&(n[1]==="-"&&(o=!0),s=s.replace(/([+-])\s*$/,""));const u=s.match(/^\s*([+-])/);u&&(u[1]==="-"&&(o=!0),s=s.replace(/^\s*[+-]/,""));let i=t;i===void 0&&(Xa.test(s)||so.test(s)?i="ar":Za.test(s)&&(i="zh"));const{group:l,decimal:w,currency:d}=Qa(i,r),f=vt(i,r).formatToParts(1).filter(E=>E.type==="unit").map(E=>Yt(E.value)),h=f.length?new RegExp(f.join("|"),"g"):null;let b=null;l&&(b=new RegExp("\\p{Zs}","u").test(l)?new RegExp("\\p{Zs}","gu"):new RegExp(Yt(l),"g"));let m=[{regex:l?b:null,replacement:""},{regex:w?new RegExp(Yt(w),"g"):null,replacement:"."},{regex:/./g,replacement:"."},{regex:/,/g,replacement:""},{regex:/٫/g,replacement:"."},{regex:/٬/g,replacement:""},{regex:d?new RegExp(Yt(d),"g"):null,replacement:""},{regex:h,replacement:""},{regex:vi,replacement:E=>String(Qs.indexOf(E))},{regex:Ni,replacement:E=>String(Rs.indexOf(E))},{regex:Ci,replacement:E=>String(Ja.indexOf(E))},{regex:Si,replacement:E=>mi[E]}].reduce((E,{regex:M,replacement:_})=>M?E.replace(M,_):E,s);const C=m.lastIndexOf(".");if(C!==-1&&(m=`${m.slice(0,C).replace(/\./g,"")}.${m.slice(C+1).replace(/\./g,"")}`),/^[-+]?Infinity$/i.test(s)||/[∞]/.test(s))return null;const k=(o?"-":"")+m;let y=parseFloat(k);const S=r==null?void 0:r.style,v=S==="unit"&&(r==null?void 0:r.unit)==="percent",T=ki.test(e)||S==="percent";return Ei.test(e)?y/=1e3:!v&&T&&(y/=100),Number.isNaN(y)?null:y}const _i={...x};let wo=0;function Wi(e,t="mui"){const[r,s]=x.useState(e),o=e||r;return x.useEffect(()=>{r==null&&(wo+=1,s(`${t}-${wo}`))},[r,t]),o}const fo=_i.useId;function Li(e,t){if(fo!==void 0){const r=fo();return e??`${t}-${r}`}return Wi(e,t)}function Pi(e){return Li(e,"base-ui")}const Fi=60,Oi=400,Bi=50,qi=3,Vi=8,Jt=1;function zi(e,t=Number.MIN_SAFE_INTEGER,r=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,r))}function Xt(e,t={}){return parseFloat(vt("en-US",{maximumFractionDigits:t.maximumFractionDigits,minimumFractionDigits:t.minimumFractionDigits,useGrouping:!1}).format(e))}function Hi(e,{step:t,minWithDefault:r,maxWithDefault:s,minWithZeroDefault:o,format:n,snapOnStep:u,small:i}){if(e===null)return e;const l=zi(e,r,s);if(t!=null&&u){if(i){const d=(l-o)/t,f=Math.round(d),h=o+f*t;return Xt(h,n)}const w=r!==Number.MIN_SAFE_INTEGER?r:o;if(t>0){const d=l-t,f=Math.floor((d-w)/t);return Xt(w+f*t+t,n)}if(t<0){const d=Math.abs(t),f=l-t,h=Math.ceil((f-w)/d);return Xt(w+h*d+t,n)}}return Xt(l,n)}function po(e,t,r){let s=!1,o=!1;const n=Ve;return{reason:e,event:t??new Event("base-ui"),cancel(){s=!0},allowPropagation(){o=!0},get isCanceled(){return s},get isPropagationAllowed(){return o},...n}}function Zt(e,t,r){const s=Ve;return{reason:e,event:t??new Event("base-ui"),...s}}function $i(e){e.preventDefault(),e.stopPropagation()}function Ui(e){return"nativeEvent"in e}const ho=x.forwardRef(function(t,r){const{id:s,min:o,max:n,smallStep:u=.1,step:i=1,largeStep:l=10,required:w=!1,disabled:d=!1,readOnly:f=!1,name:h,defaultValue:b,value:g,onValueChange:m,onValueCommitted:C,allowWheelScrub:k=!1,snapOnStep:y=!1,format:S,locale:v,render:T,className:I,inputRef:E,...M}=t,{setControlId:_,setDirty:O,validityData:A,setValidityData:P,disabled:L,setFilled:F,invalid:B,name:W,state:z}=Ut(),j=L||d,V=W??h,[H,ne]=x.useState(!1),K=o??Number.MIN_SAFE_INTEGER,Ne=n??Number.MAX_SAFE_INTEGER,Ce=o??0,q=S==null?void 0:S.style,te=x.useRef(null),le=Pi(s);me(()=>(_(le),()=>{_(void 0)}),[le,_]);const[pe,Q]=Bl({controlled:g,default:b,name:"NumberField",state:"value"}),D=pe??null,$=$a(D);me(()=>{F(D!==null)},[F,D]);const se=jl(),J=$a(S),ie=ve(m),R=x.useRef(!1),We=ve((ae,G)=>{R.current=!1,C==null||C(ae,G)}),he=za(),Le=$l(),Se=za(),Pe=x.useRef(!1),Fe=x.useRef(0),Oe=x.useRef(!0),Ge=x.useRef(null),oa=x.useRef(()=>{});me(()=>{A.initialValue===null&&D!==A.initialValue&&P(ae=>({...ae,initialValue:D}))},[P,A.initialValue,D]);const[Ye,Ke]=x.useState(()=>g!==void 0?bo(D,v,S):st(D,v,S)),[Et,nt]=x.useState("numeric"),re=ve(()=>{const{decimal:ae,group:G,currency:de}=Qa(v,S),X=new Set;Ti.forEach(ue=>X.add(ue)),ae&&X.add(ae),G&&(X.add(G),Ii.test(G)&&X.add(" "));const De=q==="percent"||q==="unit"&&(S==null?void 0:S.unit)==="percent",ke=q==="percent"||q==="unit"&&(S==null?void 0:S.unit)==="permille";return De&&eo.forEach(ue=>X.add(ue)),ke&&to.forEach(ue=>X.add(ue)),q==="currency"&&de&&X.add(de),Di.forEach(ue=>X.add(ue)),K<0&&Mi.forEach(ue=>X.add(ue)),X}),xe=ve(ae=>ae!=null&&ae.altKey?u:ae!=null&&ae.shiftKey?l:i),Tt=ve((ae,G,de)=>{const X=G,De=G&&Ui(G)?G.nativeEvent:G,ke=po("none",De),ue=Hi(ae,{step:de?xe(X)*de:void 0,format:J.current,minWithDefault:K,maxWithDefault:Ne,minWithZeroDefault:Ce,snapOnStep:y,small:(X==null?void 0:X.altKey)??!1});if(ue!==D||ae!==D||Oe.current===!1){if(Ge.current=ue,ie==null||ie(ue,ke),ke.isCanceled)return;Q(ue),O(ue!==A.initialValue),R.current=!0}Oe.current&&Ke(st(ue,v,S)),se()}),It=ve((ae,G,de,X)=>{const De=de??$.current,ke=typeof De=="number"?De+ae*G:Math.max(0,o??0);Tt(ke,X,G)}),ut=ve(()=>{Se.clear(),he.clear(),Le.clear(),oa.current(),Fe.current=0}),cn=ve((ae,G)=>{if(ut(),!te.current)return;const de=Vs(te.current);function X(ke){ke.preventDefault()}de.addEventListener("contextmenu",X),oa.current=()=>{de.removeEventListener("contextmenu",X)},de.addEventListener("pointerup",ke=>{Pe.current=!1,ut();const ue=Ge.current??$.current;We(ue,Zt("none",ke))},{once:!0});function De(){const ke=xe(G)??Jt;It(ke,ae?1:-1,void 0,G)}De(),he.start(Oi,()=>{Le.start(Fi,De)})});me(function(){if(!Oe.current)return;const G=g!==void 0?bo(D,v,S):st(D,v,S);G!==Ye&&Ke(G)}),me(function(){if(!Zl)return;let G="text";K>=0&&(G="decimal"),nt(G)},[K,q]),x.useEffect(()=>()=>ut(),[ut]),x.useEffect(function(){const G=te.current;if(j||f||!k||!G)return;function de(X){if(X.ctrlKey||Kl(te.current).activeElement!==te.current)return;X.preventDefault();const De=xe(X)??Jt;It(De,X.deltaY>0?-1:1,void 0,X)}return G.addEventListener("wheel",de),()=>{G.removeEventListener("wheel",de)}},[k,It,j,f,l,i,xe]);const wr=x.useMemo(()=>({...z,disabled:j,readOnly:f,required:w,value:D,inputValue:Ye,scrubbing:H}),[z,j,f,w,D,Ye,H]),Zc=x.useMemo(()=>({inputRef:te,inputValue:Ye,value:D,startAutoChange:cn,stopAutoChange:ut,minWithDefault:K,maxWithDefault:Ne,disabled:j,readOnly:f,id:le,setValue:Tt,incrementValue:It,getStepAmount:xe,allowInputSyncRef:Oe,formatOptionsRef:J,valueRef:$,lastChangedValueRef:Ge,hasPendingCommitRef:R,isPressedRef:Pe,intentionalTouchCheckTimeout:Se,movesAfterTouchRef:Fe,name:V,required:w,invalid:B,inputMode:Et,getAllowedNonNumericKeys:re,min:o,max:n,setInputValue:Ke,locale:v,isScrubbing:H,setIsScrubbing:ne,state:wr,onValueCommitted:We}),[te,Ye,D,cn,ut,K,Ne,j,f,le,Tt,It,xe,Oe,J,$,Ge,R,Pe,Se,Fe,V,w,B,Et,re,o,n,Ke,v,H,wr,We]),Qc=yt("div",t,{ref:r,state:wr,props:M,stateAttributesMapping:mt});return a.jsxs(ja.Provider,{value:Zc,children:[Qc,V&&a.jsx("input",{type:"hidden",name:V,ref:E,value:D??"",disabled:j,required:w})]})});process.env.NODE_ENV!=="production"&&(ho.displayName="NumberFieldRoot");function bo(e,t,r){return(r==null?void 0:r.maximumFractionDigits)!=null||(r==null?void 0:r.minimumFractionDigits)!=null?st(e,t,r):Zs(e,t,r)}const go=x.forwardRef(function(t,r){const{render:s,className:o,...n}=t,{state:u}=$t();return yt("div",t,{ref:r,state:u,props:[{role:"group"},n],stateAttributesMapping:mt})});process.env.NODE_ENV!=="production"&&(go.displayName="NumberFieldGroup");let Ra;process.env.NODE_ENV!=="production"&&(Ra=new Set);function mo(...e){if(process.env.NODE_ENV!=="production"){const t=e.join(" ");Ra.has(t)||(Ra.add(t),console.error(`Base UI: ${t}`))}}const xo=x.createContext(void 0);process.env.NODE_ENV!=="production"&&(xo.displayName="CompositeRootContext");function ji(e=!1){const t=x.useContext(xo);if(t===void 0&&!e)throw new Error("Base UI: CompositeRootContext is missing. Composite parts must be placed within <Composite.Root>.");return t}function Gi(e){const{focusableWhenDisabled:t,disabled:r,composite:s=!1,tabIndex:o=0,isNativeButton:n}=e,u=s&&t!==!1,i=s&&t===!1;return{props:x.useMemo(()=>{const w={onKeyDown(d){r&&t&&d.key!=="Tab"&&d.preventDefault()}};return s||(w.tabIndex=o,!n&&r&&(w.tabIndex=t?o:-1)),(n&&(t||u)||!n&&r)&&(w["aria-disabled"]=r),n&&(!t||i)&&(w.disabled=r),w},[s,r,t,u,i,n,o])}}function yo(e={}){const{disabled:t=!1,focusableWhenDisabled:r,tabIndex:s=0,native:o=!0}=e,n=x.useRef(null),u=ji(!0)!==void 0,i=ve(()=>{const h=n.current;return!!((h==null?void 0:h.tagName)==="A"&&(h!=null&&h.href))}),{props:l}=Gi({focusableWhenDisabled:r,disabled:t,composite:u,tabIndex:s,isNativeButton:o});process.env.NODE_ENV!=="production"&&x.useEffect(()=>{if(!n.current)return;const h=n.current.tagName==="BUTTON";o?h||mo("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`."):h&&mo("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=x.useCallback(()=>{const h=n.current;Yi(h)&&u&&t&&l.disabled===void 0&&h.disabled&&(h.disabled=!1)},[t,l.disabled,u]);me(w,[w]);const d=x.useCallback((h={})=>{const{onClick:b,onMouseDown:g,onKeyUp:m,onKeyDown:C,onPointerDown:k,...y}=h;return jt({type:o?"button":void 0,onClick(v){if(t){v.preventDefault();return}b==null||b(v)},onMouseDown(v){t||g==null||g(v)},onKeyDown(v){if(t||(Ka(v),C==null||C(v)),v.baseUIHandlerPrevented)return;const T=v.target===v.currentTarget&&!o&&!i()&&!t,I=v.key==="Enter",E=v.key===" ";T&&((E||I)&&v.preventDefault(),I&&(b==null||b(v)))},onKeyUp(v){t||(Ka(v),m==null||m(v)),!v.baseUIHandlerPrevented&&v.target===v.currentTarget&&!o&&!t&&v.key===" "&&(b==null||b(v))},onPointerDown(v){if(t){v.preventDefault();return}k==null||k(v)}},o?void 0:{role:"button"},l,y)},[t,l,o,i]),f=ve(h=>{n.current=h,w()});return{getButtonProps:d,buttonRef:f}}function Yi(e){return Yl(e)&&e.tagName==="BUTTON"}function vo(e){const{allowInputSyncRef:t,disabled:r,formatOptionsRef:s,getStepAmount:o,id:n,incrementValue:u,inputRef:i,inputValue:l,intentionalTouchCheckTimeout:w,isIncrement:d,isPressedRef:f,locale:h,maxWithDefault:b,minWithDefault:g,movesAfterTouchRef:m,readOnly:C,setValue:k,startAutoChange:y,stopAutoChange:S,value:v,valueRef:T,lastChangedValueRef:I,onValueCommitted:E}=e,M=x.useRef({x:0,y:0}),_=x.useRef(!1),O=x.useRef(!1),A=x.useRef(""),P=v!=null&&v<=g,L=v!=null&&v>=b,F=ve(W=>{t.current=!0;const z=ot(l,h,s.current);z!==null&&(T.current=z,k(z,W))}),B=x.useMemo(()=>({disabled:r||(d?L:P),"aria-readonly":C||void 0,"aria-label":d?"Increase":"Decrease","aria-controls":n,tabIndex:-1,style:{WebkitUserSelect:"none",userSelect:"none"},onTouchStart(){_.current=!0},onTouchEnd(){_.current=!1},onClick(W){const z=r||C||(d?L:P);if(W.defaultPrevented||z||(A.current==="touch"?O.current:W.detail!==0))return;F(W.nativeEvent);const j=o(W)??Jt,V=T.current;u(j,d?1:-1,void 0,W.nativeEvent);const H=I.current??T.current;H!==V&&E(H,Zt("none",W.nativeEvent))},onPointerDown(W){var V;const z=!W.button||W.button===0,j=r||(d?L:P);W.defaultPrevented||C||!z||j||(A.current=W.pointerType,O.current=!1,f.current=!0,M.current={x:W.clientX,y:W.clientY},F(W.nativeEvent),W.pointerType!=="touch"?(W.preventDefault(),(V=i.current)==null||V.focus(),y(d,W)):w.start(Bi,()=>{const H=m.current;m.current=0,f.current&&H!=null&&H<qi?(y(d,W),O.current=!0):(O.current=!1,S())}))},onPointerUp(W){W.pointerType==="touch"&&(f.current=!1)},onPointerMove(W){if(r||C||(d?L:P)||W.pointerType!=="touch"||!f.current)return;m.current!=null&&(m.current+=1);const{x:j,y:V}=M.current,H=j-W.clientX,ne=V-W.clientY;H**2+ne**2>Vi**2&&S()},onMouseEnter(W){const z=r||C||(d?L:P);W.defaultPrevented||z||!f.current||_.current||A.current==="touch"||y(d,W)},onMouseLeave(){_.current||S()},onMouseUp(){_.current||S()}}),[r,d,L,P,C,n,F,o,T,u,I,E,f,i,y,w,m,S]);return x.useMemo(()=>({props:B}),[B])}const No=x.forwardRef(function(t,r){const{render:s,className:o,disabled:n=!1,nativeButton:u=!0,...i}=t,{allowInputSyncRef:l,disabled:w,formatOptionsRef:d,getStepAmount:f,id:h,incrementValue:b,inputRef:g,inputValue:m,intentionalTouchCheckTimeout:C,isPressedRef:k,locale:y,maxWithDefault:S,minWithDefault:v,movesAfterTouchRef:T,readOnly:I,setValue:E,startAutoChange:M,state:_,stopAutoChange:O,value:A,valueRef:P,lastChangedValueRef:L,onValueCommitted:F}=$t(),B=n||w,{props:W}=vo({isIncrement:!0,inputRef:g,startAutoChange:M,stopAutoChange:O,minWithDefault:v,maxWithDefault:S,value:A,inputValue:m,disabled:B,readOnly:I,id:h,setValue:E,getStepAmount:f,incrementValue:b,allowInputSyncRef:l,formatOptionsRef:d,valueRef:P,isPressedRef:k,intentionalTouchCheckTimeout:C,movesAfterTouchRef:T,locale:y,lastChangedValueRef:L,onValueCommitted:F}),{getButtonProps:z,buttonRef:j}=yo({disabled:B,native:u}),V=x.useMemo(()=>({..._,disabled:B}),[_,B]);return yt("button",t,{ref:[r,j],state:V,props:[W,i,z],stateAttributesMapping:mt})});process.env.NODE_ENV!=="production"&&(No.displayName="NumberFieldIncrement");const Co=x.forwardRef(function(t,r){const{render:s,className:o,disabled:n=!1,nativeButton:u=!0,...i}=t,{allowInputSyncRef:l,disabled:w,formatOptionsRef:d,getStepAmount:f,id:h,incrementValue:b,inputRef:g,inputValue:m,intentionalTouchCheckTimeout:C,isPressedRef:k,maxWithDefault:y,minWithDefault:S,movesAfterTouchRef:v,readOnly:T,setValue:I,startAutoChange:E,state:M,stopAutoChange:_,value:O,valueRef:A,locale:P,lastChangedValueRef:L,onValueCommitted:F}=$t(),B=n||w,{props:W}=vo({isIncrement:!1,inputRef:g,startAutoChange:E,stopAutoChange:_,minWithDefault:S,maxWithDefault:y,value:O,inputValue:m,disabled:B,readOnly:T,id:h,setValue:I,getStepAmount:f,incrementValue:b,allowInputSyncRef:l,formatOptionsRef:d,valueRef:A,isPressedRef:k,intentionalTouchCheckTimeout:C,movesAfterTouchRef:v,locale:P,lastChangedValueRef:L,onValueCommitted:F}),{getButtonProps:z,buttonRef:j}=yo({disabled:B,native:u}),V=x.useMemo(()=>({...M,disabled:B}),[M,B]);return yt("button",t,{ref:[r,j],state:V,props:[W,i,z],stateAttributesMapping:mt})});process.env.NODE_ENV!=="production"&&(Co.displayName="NumberFieldDecrement");const So=x.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:_e});process.env.NODE_ENV!=="production"&&(So.displayName="FormContext");function er(){return x.useContext(So)}function tr(e,t){return{...e,state:{...e.state,valid:!t&&e.state.valid}}}const Qt=Object.keys(Ga);function Ki(e){if(!e||e.valid||!e.valueMissing)return!1;let t=!1;for(const r of Qt)r!=="valid"&&(r==="valueMissing"&&(t=e[r]),e[r]&&(t=!1));return t}function Ji(){const{setValidityData:e,validate:t,messageIds:r,validityData:s,validationMode:o,validationDebounceTime:n,invalid:u,markedDirtyRef:i,controlId:l,state:w,name:d}=Ut(),{formRef:f,clearErrors:h}=er(),b=za(),g=x.useRef(null),m=ve(async(y,S=!1)=>{const v=g.current;if(!v)return;if(S){if(w.valid!==!1)return;const A=v.validity;if(!A.valueMissing){const L={value:y,state:{...Ga,valid:!0},error:"",errors:[],initialValue:s.initialValue};if(v.setCustomValidity(""),l){const F=f.current.fields.get(l);F&&f.current.fields.set(l,{...F,...tr(L,!1)})}e(L);return}const P=Qt.reduce((L,F)=>(L[F]=A[F],L),{});if(!P.valid&&!Ki(P))return}function T(A){const P=Qt.reduce((F,B)=>(F[B]=A.validity[B],F),{});let L=!1;for(const F of Qt)if(F!=="valid"){if(F==="valueMissing"&&P[F])L=!0;else if(P[F])return P}return L&&!i.current&&(P.valid=!0,P.valueMissing=!1),P}b.clear();let I=null,E=[];const M=T(v);let _;if(v.validationMessage)_=v.validationMessage,E=[v.validationMessage];else{const A=Array.from(f.current.fields.values()).reduce((L,F)=>{var B,W;return F.name&&F.getValueRef&&(L[F.name]=(W=(B=F.getValueRef).current)==null?void 0:W.call(B)),L},{}),P=t(y,A);typeof P=="object"&&P!==null&&"then"in P?I=await P:I=P,I!==null&&(M.valid=!1,M.customError=!0,Array.isArray(I)?(E=I,v.setCustomValidity(I.join(`
7
- `))):I&&(E=[I],v.setCustomValidity(I)))}const O={value:y,state:M,error:_??(Array.isArray(I)?I[0]:I??""),errors:E,initialValue:s.initialValue};if(l){const A=f.current.fields.get(l);A&&f.current.fields.set(l,{...A,...tr(O,u)})}e(O)}),C=x.useCallback((y={})=>jt({...r.length&&{"aria-describedby":r.join(" ")},...w.valid===!1&&{"aria-invalid":!0}},y),[r,w.valid]),k=x.useCallback((y={})=>jt({onChange(S){if(S.nativeEvent.defaultPrevented)return;if(h(d),o!=="onChange"){m(S.currentTarget.value,!0);return}if(u)return;const v=S.currentTarget;if(v.value===""){m(v.value);return}b.clear(),n?b.start(n,()=>{m(v.value)}):m(v.value)}},C(y)),[C,h,d,b,m,u,o,n]);return x.useMemo(()=>({getValidationProps:C,getInputValidationProps:k,inputRef:g,commitValidation:m}),[C,k,m])}function Xi(e){const{formRef:t}=er(),{invalid:r,markedDirtyRef:s,validityData:o,setValidityData:n}=Ut(),{enabled:u=!0,value:i,id:l,name:w,controlRef:d,commitValidation:f}=e,h=$a(e.getValue);me(()=>{var g;if(!u)return;let b=i;b===void 0&&(b=(g=h.current)==null?void 0:g.call(h)),o.initialValue===null&&b!==o.initialValue&&n(m=>({...m,initialValue:b}))},[u,n,i,o.initialValue,h]),me(()=>{u&&l&&t.current.fields.set(l,{controlRef:d,validityData:tr(o,r),validate(){var g;let b=i;b===void 0&&(b=(g=h.current)==null?void 0:g.call(h)),s.current=!0,_n.flushSync(()=>f(b))},getValueRef:h,name:w})},[f,d,u,t,h,l,r,s,w,o,i]),me(()=>{const b=t.current.fields;return()=>{l&&b.delete(l)}},[t,l])}const Zi={...ti,...mt},Qi=new Set(["Backspace","Delete","ArrowLeft","ArrowRight","Tab","Enter","Escape"]),ko=x.forwardRef(function(t,r){const{render:s,className:o,...n}=t,{allowInputSyncRef:u,disabled:i,formatOptionsRef:l,getAllowedNonNumericKeys:w,getStepAmount:d,id:f,incrementValue:h,inputMode:b,inputValue:g,max:m,min:C,name:k,readOnly:y,required:S,setValue:v,state:T,setInputValue:I,locale:E,inputRef:M,value:_,onValueCommitted:O,lastChangedValueRef:A,hasPendingCommitRef:P,valueRef:L}=$t(),{clearErrors:F}=er(),{labelId:B,validationMode:W,setTouched:z,setFocused:j,invalid:V}=Ut(),{getInputValidationProps:H,getValidationProps:ne,commitValidation:K,inputRef:Ne}=Ji(),Ce=x.useRef(!1),q=x.useRef(!1);Xi({id:f,commitValidation:K,value:_,controlRef:M,name:k,getValue:()=>_??null});const te=x.useRef(_),le=x.useRef(g);return me(()=>{te.current===_&&le.current===g||(F(k),W==="onChange"&&K(_))},[_,g,k,F,W,K]),me(()=>{if(!(te.current===_||W==="onChange")){if(q.current){q.current=!1;return}K(_,!0)}},[K,W,_]),me(()=>{te.current=_,le.current=g},[_,g]),yt("input",t,{ref:[r,M,Ne],state:T,props:[{id:f,required:S,disabled:i,readOnly:y,inputMode:b,value:g,type:"text",autoComplete:"off",autoCorrect:"off",spellCheck:"false","aria-roledescription":"Number field","aria-invalid":V||void 0,"aria-labelledby":B,suppressHydrationWarning:!0,onFocus(D){if(D.defaultPrevented||y||i||Ce.current)return;Ce.current=!0,j(!0);const $=D.currentTarget,se=$.value.length;$.setSelectionRange(se,se)},onBlur(D){if(D.defaultPrevented||y||i)return;z(!0),j(!1);const $=!u.current,se=P.current;if(u.current=!0,g.trim()===""){v(null),W==="onBlur"&&K(null),O(null,Zt("none",D.nativeEvent));return}const J=l.current,ie=ot(g,E,J);if(ie===null)return;q.current=!0;const R=(J==null?void 0:J.maximumFractionDigits)!=null||(J==null?void 0:J.minimumFractionDigits)!=null,We=J==null?void 0:J.maximumFractionDigits,he=R&&typeof We=="number"?Number(ie.toFixed(We)):ie,Le=Zt("none",D.nativeEvent),Se=_!==he,Pe=$||Se||se;W==="onBlur"&&K(he),Se&&v(he,D.nativeEvent),Pe&&O(he,Le);const Fe=st(he,E,J),Oe=Zs(ie,E,J);!(!R&&ie===_&&g===Oe)&&g!==Fe&&I(Fe)},onChange(D){if(D.nativeEvent.defaultPrevented)return;u.current=!1;const $=D.target.value;if($.trim()===""){I($),v(null,D.nativeEvent);return}const se=w();if(!Array.from($).every(R=>{const We=R>="0"&&R<="9",he=Xa.test(R),Le=Za.test(R),Se=so.test(R),Pe=oo.test(R),Fe=Nt.test(R);return We||he||Le||Se||Pe||Fe||se.has(R)}))return;if(D.isTrusted){I($);const R=ot($,E,l.current);R!==null&&v(R,D.nativeEvent);return}const ie=ot($,E,l.current);ie!==null&&(I($),v(ie,D.nativeEvent))},onKeyDown(D){if(D.defaultPrevented||y||i)return;const $=D.nativeEvent;u.current=!0;const se=w();let J=se.has(D.key);const{decimal:ie,currency:R,percentSign:We}=Qa(E,l.current),he=D.currentTarget.selectionStart,Le=D.currentTarget.selectionEnd,Se=he===0&&Le===g.length,Pe=re=>he===re&&Le===re+1;if(Nt.test(D.key)&&Array.from(se).some(re=>Nt.test(re||""))){const re=g.search(io),xe=re!=null&&re!==-1&&Pe(re);J=!(Nt.test(g)||Kt.test(g))||Se||xe}if(Kt.test(D.key)&&Array.from(se).some(re=>Kt.test(re||""))){const re=g.search(co),xe=re!=null&&re!==-1&&Pe(re);J=!(Nt.test(g)||Kt.test(g))||Se||xe}[ie,R,We].forEach(re=>{if(D.key===re){const xe=g.indexOf(re),Tt=he===xe&&Le===xe+1;J=!g.includes(re)||Se||Tt}});const Fe=D.key>="0"&&D.key<="9",Oe=Xa.test(D.key),Ge=Za.test(D.key),oa=oo.test(D.key),Ye=Qi.has(D.key);if(D.which===229||D.altKey||D.ctrlKey||D.metaKey||J||Fe||Oe||oa||Ge||Ye)return;const Ke=ot(g,E,l.current),Et=d(D)??Jt;$i(D);const nt=po("none",$);D.key==="ArrowUp"?(h(Et,1,Ke,$),O(A.current??L.current,nt)):D.key==="ArrowDown"?(h(Et,-1,Ke,$),O(A.current??L.current,nt)):D.key==="Home"&&C!=null?(v(C,$),O(A.current??L.current,nt)):D.key==="End"&&m!=null&&(v(m,$),O(A.current??L.current,nt))},onPaste(D){if(D.defaultPrevented||y||i)return;D.preventDefault();const se=(D.clipboardData||window.Clipboard).getData("text/plain"),J=ot(se,E,l.current);J!==null&&(u.current=!1,v(J,D.nativeEvent),I(se))}},H(),ne(),n],stateAttributesMapping:Zi})});process.env.NODE_ENV!=="production"&&(ko.displayName="NumberFieldInput");const Ri={wuStepper:"_wuStepper_apbnq_1"},Eo=({onChange:e,Label:t,defaultValue:r=0,readonly:s,dir:o,step:n=1,min:u,max:i,value:l,className:w,labelPosition:d="left",disabled:f,resetInvalidValueOnBlur:h=!0,...b})=>{const g=x.useId(),[m,C]=x.useState(l!==void 0?Number(l):r||0);x.useEffect(()=>{l!==void 0&&C(Number(l))},[l]);const k=E=>{C(E),e==null||e(E)},y=E=>{const M=Number(E.target.value);Number.isNaN(M)||C(M)},S=()=>{h&&(u!==void 0&&m<u?(C(u),e==null||e(u)):i!==void 0&&m>i&&(C(i),e==null||e(i)))};x.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||f,dec:s||u!==void 0&&m<=u||f},T=u!==void 0&&m<u||i!==void 0&&m>i,I=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(ho,{id:g,value:m,step:n,readOnly:s,onValueChange:E=>typeof E=="number"&&k(E),dir:o,className:c("wu-flex wu-stepper",o==="rtl"&&d!=="top"&&"wu-gap-2",Ri.wuStepper,ec({labelPosition:d}),w),children:[t&&a.jsx(ge,{htmlFor:g,className:"wu-input-label",children:t}),a.jsxs(go,{className:"wu-flex wu-max-w-[97px] wu-relative",children:[a.jsx(Co,{"aria-label":"decrement",className:c(I,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(ko,{"aria-label":"stepper",role:"spinbutton",type:"text","aria-invalid":T||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",T&&"wu-border-red-deep focus:wu-border-red-deep","wu-stepper-input"),readOnly:s,onChange:y,onBlur:S,disabled:f,min:u,max:i,step:n,value:m,...b}),a.jsx(No,{"aria-label":"increment",className:c(I,o==="rtl"?"wu-left-0":"wu-right-0","wu-stepper-button"),disabled:v.inc,children:a.jsx("span",{className:"wu-text-base wm-add"})})]})]})},ec=Ee.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"}}}),To=Ee.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"}}),tc=x.forwardRef(({className:e,variant:t,size:r,...s},o)=>a.jsx(xr.Root,{ref:o,className:c(To({variant:t,size:r,className:e})),...s}));tc.displayName=xr.Root.displayName;const Io=x.createContext({size:"default",variant:"default"}),Rt=x.forwardRef(({className:e,variant:t,size:r,children:s,...o},n)=>a.jsx(At.Root,{ref:n,className:c("wu-flex wu-items-center wu-justify-center wu-gap-1",e),...o,children:a.jsx(Io.Provider,{value:{variant:t,size:r},children:s})}));Rt.displayName=At.Root.displayName;const je=x.forwardRef(({className:e,children:t,variant:r,size:s,...o},n)=>{const u=x.useContext(Io);return a.jsx(At.Item,{ref:n,className:c(To({variant:u.variant||r,size:u.size||s}),e),...o,children:t})});je.displayName=At.Item.displayName;const Do=p.forwardRef((e,t)=>{const{options:r,value:s,disabled:o,dir:n,onChange:u}=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(Rt,{ref:t,type:"single",value:s,onValueChange:u,disabled:o,dir:n,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"&&n!=="rtl"&&"wu-translate-x-full",s==="opt2"&&n==="rtl"&&"-wu-translate-x-full",o&&"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})]})})});Do.displayName="_IconTab";const Mo=p.forwardRef((e,t)=>{const{options:r,value:s,disabled:o,dir:n,size:u="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",u==="sm"&&"wu-h-6 wu-min-w-20",u==="md"&&"wu-h-8 wu-min-w-28",u==="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(Rt,{ref:t,type:"single",value:s,onValueChange:i,disabled:o,dir:n,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 ",u==="sm"&&"wu-h-6 wu-min-w-20",u==="md"&&"wu-h-8 wu-min-w-28",u==="lg"&&"wu-h-10 wu-min-w-36",s==="opt1"&&"",s==="opt2"&&n!=="rtl"&&"wu-translate-x-full",s==="opt2"&&n==="rtl"&&"-wu-translate-x-full",o&&"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})})]})})});Mo.displayName="_Tab";const Ao=p.forwardRef((e,t)=>{const{options:r,value:s,disabled:o,dir:n,onChange:u}=e,i=f=>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",f===s&&"wu-text-primary wu-font-medium",o&&s===f&&"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"&&n!=="rtl"&&"-wu-translate-x-[10px]",s==="opt1"&&n==="rtl"&&"wu-translate-x-[10px]",s==="opt2"&&n!=="rtl"&&"wu-translate-x-[10px]",s==="opt2"&&n==="rtl"&&"-wu-translate-x-[10px]",o&&"wu-hidden","wu-switcher-toggle-knob");return a.jsx(a.Fragment,{children:a.jsxs(Rt,{ref:t,type:"single",value:s,disabled:o,dir:n,className:l,onValueChange:u,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:()=>u(s==="opt1"?"opt2":"opt1"),className:w,disabled:o,"aria-label":"knob",dir:n,children:a.jsx("div",{className:d,role:"knob",dir:n})}),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})})]})})});Ao.displayName="_Toggle";const _o=p.forwardRef((e,t)=>{const{type:r,options:s,value:o,disabled:n,dir:u,size:i,onChange:l,toggle:w=!0,...d}=e,[f,h]=p.useState(),b=g=>{let m=f;g!==""?m=g:w&&(m=f==="opt1"?"opt2":"opt1");const C=m==="opt1"?s[0].value:s[1].value;l&&l(C),h(m)};if(p.useEffect(()=>{if(!Array.isArray(s)||s.length<2)throw new Error("Options are not sufficient");h(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(Ao,{...d,ref:t,options:s,value:f||"opt1",onChange:b,disabled:n,dir:u});case"iconTab":return a.jsx(Do,{ref:t,options:s,value:f||"opt1",onChange:b,disabled:n,dir:u});default:return a.jsx(Mo,{ref:t,options:s,value:f||"opt1",onChange:b,disabled:n,dir:u,size:i})}});_o.displayName="WuSwitcher";const Wo=$e.Root,ar=x.forwardRef(({className:e,children:t,...r},s)=>a.jsx($e.List,{className:c("wu-relative wu-flex",e),...r,ref:s,children:t}));ar.displayName=$e.List.displayName;const rr=x.forwardRef(({className:e,...t},r)=>a.jsx($e.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}));rr.displayName=$e.Trigger.displayName;const Lo=x.forwardRef(({className:e,...t},r)=>a.jsx($e.Content,{ref:r,className:e,...t}));Lo.displayName=$e.Content.displayName;const Po=({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(Lo,{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))})},ac=e=>{const[t,r]=p.useState(!1),[s,o]=p.useState(!1),n=()=>{const i=e.current;i&&(r(i.scrollLeft>0),o(i.scrollLeft+i.clientWidth<i.scrollWidth))};return p.useEffect(()=>{const i=e.current;return n(),i&&i.addEventListener("scroll",n),window.addEventListener("resize",n),()=>{i&&i.removeEventListener("scroll",n),window.removeEventListener("resize",n)}},[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"})}}}},Fo=(e,t)=>{const[r,s]=p.useState({width:0,left:0,height:0,top:0}),o=t==="vertical";return p.useEffect(()=>{const n=e.current;if(n){const u=()=>{const l=n.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(u);return i.observe(n,{attributes:!0,subtree:!0}),u(),()=>{i.disconnect()}}},[e,o]),r},rc=({items:e,value:t,defaultValue:r,onValueChange:s,enableAnimation:o=!1,className:n,dir:u="ltr",position:i="top"})=>{var S;const l=p.useRef(null),w=Fo(l,"horizontal"),{showLeftArrow:d,showRightArrow:f,scrollByTab:h}=ac(l),[b,g]=p.useState(!1),m=()=>h("left"),C=()=>h("right"),k=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,T,I)=>{const E=T==="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",E?"wu-left-0":"wu-right-0",I&&"wu-translate-x-0 wu-opacity-100",!I&&[E?"-wu-translate-x-full":"wu-translate-x-full","wu-opacity-0"]),"aria-label":E?"scroll-left":"scroll-right",children:a.jsx("span",{className:c("wu-text-blue-p wu-text-lg",E?"wm-keyboard-arrow-left":"wm-keyboard-arrow-right")})})};return a.jsxs(Wo,{defaultValue:r||((S=e[0])==null?void 0:S.value),value:t,onValueChange:s,orientation:"horizontal",dir:u,className:c("wu-relative wu-flex wu-flex-col wu-w-full wu-h-full",i==="bottom"?"wu-flex-col-reverse":"wu-flex-col",n),role:"tabs",children:[a.jsxs("div",{className:"wu-relative wu-flex wu-overflow-hidden wu-shrink-0 wu-border-b wu-border-gray-200",onMouseEnter:()=>g(!0),onMouseLeave:()=>g(!1),"aria-label":"tablistWrapper",children:[d&&b&&k("left"),y(m,"left",d&&b),a.jsxs(ar,{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(rr,{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}})]}),f&&b&&k("right"),y(C,"right",f&&b)]}),a.jsx(Po,{items:e,enableAnimation:o})]})},sc=e=>{const[t,r]=p.useState(!1),[s,o]=p.useState(!1),n=()=>{const i=e.current;i&&(r(i.scrollTop>0),o(i.scrollTop+i.clientHeight<i.scrollHeight))};return p.useEffect(()=>{const i=e.current;if(i)return n(),i.addEventListener("scroll",n),window.addEventListener("resize",n),()=>{i.removeEventListener("scroll",n),window.removeEventListener("resize",n)}},[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"})}}}},oc=({items:e,value:t,defaultValue:r,onValueChange:s,enableAnimation:o=!1,className:n,dir:u="ltr",position:i="left"})=>{var S;const l=p.useRef(null),w=Fo(l,"vertical"),{showTopArrow:d,showBottomArrow:f,scrollByTab:h}=sc(l),[b,g]=p.useState(!1),m=()=>h("up"),C=()=>h("down"),k=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,T,I)=>{const E=T==="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",E?"-wu-top-1":"-wu-bottom-1",I&&"wu-translate-y-0 wu-opacity-100",!I&&[E?"-wu-translate-y-full":"wu-translate-y-full","wu-opacity-0"]),"aria-label":E?"scroll-up":"scroll-down",children:a.jsx("span",{className:c("wu-text-blue-p wu-text-lg",E?"wm-keyboard-arrow-up":"wm-keyboard-arrow-down")})})};return a.jsxs(Wo,{defaultValue:r||((S=e[0])==null?void 0:S.value),value:t,onValueChange:s,orientation:"vertical",dir:u,className:c("wu-relative wu-h-full wu-w-full wu-flex",i==="left"?"wu-flex-row":"wu-flex-row-reverse",n),role:"tabs",children:[a.jsxs("div",{className:"wu-relative wu-flex wu-overflow-hidden wu-shrink-0",onMouseEnter:()=>g(!0),onMouseLeave:()=>g(!1),"aria-label":"tablistWrapper",children:[d&&b&&k("top"),y(m,"up",d&&b),a.jsxs(ar,{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(rr,{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}})]}),f&&b&&k("bottom"),y(C,"down",f&&b)]}),a.jsx(Po,{items:e,enableAnimation:o})]})},nc=({...e})=>e.orientation==="vertical"?a.jsx(oc,{...e}):a.jsx(rc,{...e}),sr=x.forwardRef(({className:e,...t},r)=>a.jsx("table",{ref:r,className:c("wu-w-full wu-caption-bottom wu-text-sm",e),...t}));sr.displayName="Table";const Oo=x.forwardRef(({className:e,...t},r)=>a.jsx("thead",{ref:r,className:c("[&_tr]:wu-border-b",e),...t}));Oo.displayName="TableHeader";const Bo=x.forwardRef(({className:e,...t},r)=>a.jsx("tbody",{ref:r,className:c("",e),...t}));Bo.displayName="TableBody";const uc=x.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}));uc.displayName="TableFooter";const Ct=x.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}));Ct.displayName="TableRow";const or=x.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}));or.displayName="TableHead";const ea=x.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}));ea.displayName="TableCell";const nr=x.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}));nr.displayName="TableCaption";const lc=({columns:e,rowSelection:t})=>{const r=(t==null?void 0:t.isEnabled)??!1,s=(t==null?void 0:t.size)??48,{onRowSelect:o,rowUniqueKey:n}=t||{},u=p.useCallback(l=>w=>{o(()=>w?l:[])},[o]);return{finalColumns:p.useMemo(()=>r?[{id:"select",header:({table:l})=>{const w=l.getRowModel().rows.map(f=>f.original),d=u(w);return a.jsx(Ie,{checked:l.getIsSomeRowsSelected()||l.getIsAllRowsSelected(),partial:l.getIsSomeRowsSelected()&&!l.getIsAllRowsSelected(),onChange:f=>{l.toggleAllRowsSelected(!!f),d(!!f)},"aria-label":"Select all","data-testid":l.getIsSomeRowsSelected()&&!l.getIsAllRowsSelected()?"select-partial":"select-all"})},cell:({row:l})=>a.jsx(Ie,{checked:l.getIsSelected(),onChange:w=>{l.toggleSelected(!!w)},"aria-label":String(l.original[n])}),enableSorting:!1,filterable:!1,accessorKey:"select",size:s},...e]:e,[e,r,u])}};function qo({data:e,columns:t,rowSelection:r}){const{finalColumns:s}=lc({columns:t,rowSelection:r}),o=p.useMemo(()=>{if(!(r!=null&&r.isEnabled))return{};const n={};for(const u of r.selectedRows){const i=e.findIndex(l=>l[r.rowUniqueKey]===u[r.rowUniqueKey]);i!==-1&&(n[i]=!0)}return n},[e,r]);return{finalColumns:s,rowSelectionState:o}}const Vo=({table:e,size:t,NoDataContent:r,isLoading:s,CustomLoader:o})=>{var i;const[n,u]=p.useState(null);return a.jsx(Bo,{children:s?a.jsx(Ct,{children:a.jsx(ea,{colSpan:e.getAllColumns().length,className:"wu-text-center wu-h-[35vh] wu-loader-container",children:o||a.jsx(et,{className:"wu-w-full"})})}):(i=e.getRowModel().rows)!=null&&i.length?e.getRowModel().rows.map((l,w)=>a.jsx(Ct,{"data-state":l.getIsSelected()&&"selected",onMouseOver:()=>u(l.id),onMouseOut:()=>u(null),className:c("wu-transition-colors wu-border-b wu-border-black/[12%]",l.getIsSelected()?n===l.id?"wu-bg-blue-p/[16%]":"wu-bg-blue-p/[8%]":"hover:wu-bg-black/[2%]"),children:l.getVisibleCells().map((d,f)=>a.jsx(ea,{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":"",n===l.id&&d.column.id==="actions"?"wu-opacity-100 wu-visible":"",d.column.columnDef.cellAlign==="right"&&"wu-text-right",d.column.columnDef.cellAlign==="center"&&"wu-text-center",d.column.columnDef.cellAlign==="left"&&"wu-text-left"),children:Me.flexRender(d.column.columnDef.cell,d.getContext())},`${d.id}-${f}`))},`${l.id}-${w}`)):a.jsx(Ct,{children:a.jsx(ea,{colSpan:e.getAllColumns().length,children:r})})})},zo=({table:e,sortableColumns:t,manual:r=!1,onSort:s,size:o,isRowSelected:n,HeaderAction:u,isStickyHeader:i})=>{const l=o==="compact"?"wu-h-8":"wu-h-10",w=d=>{const{id:f,columnDef:h,getIsSorted:b,toggleSorting:g}=d,{header:m}=h;if(!t.includes(f))return m;const C=b(),k=C==="asc",y=C==="desc",S=()=>{r?(g(!y),s==null||s({id:f,desc:y})):g(d.getIsSorted()==="asc")};return a.jsxs("button",{onClick:S,"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",k&&"wu-hidden",!C&&"-wu-top-[11px]")}),a.jsx("span",{className:c("wu-absolute -wu-bottom-[13px] wm-arrow-drop-up wu-text-xl",y&&"wu-hidden",!C&&"-wu-bottom-[10px]")})]})]})};return a.jsxs(Oo,{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(Ct,{className:"wu-relative",children:d.headers.map(f=>f.column.id==="actions"?a.jsx(or,{colSpan:f.colSpan,className:"wu-text-xs wu-font-medium",style:{width:`${f.getSize()}px`}},f.id):a.jsx(or,{colSpan:f.colSpan,className:c("wu-text-xs wu-font-medium wu-bg-[#EEEEEE]","wu-relative wu-z-0",f.column.columnDef.headerAlign==="right"&&"wu-text-right",f.column.columnDef.headerAlign==="center"&&"wu-text-center",f.column.columnDef.headerAlign==="left"&&"wu-text-left"),style:{width:`${f.getSize()}px`},children:Me.flexRender(w(f.column),f.getContext())},f.id))},d.id)),n&&u&&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(Ie,{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:u})]})]})},Ho=Ee.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"}}}),ic=({data:e,columns:t,isLoading:r=!1,variant:s="unstyled",sort:o,size:n,rowSelection:u,HeaderAction:i,NoDataContent:l,stickyHeader:w=!1,CustomLoader:d,caption:f,...h})=>{var S;const{finalColumns:b,rowSelectionState:g}=qo({data:e,columns:t,rowSelection:u}),m=p.useMemo(()=>b.filter(v=>v.enableSorting).map(v=>v.accessorKey),[b]),C=((S=u==null?void 0:u.selectedRows)==null?void 0:S.length)??0,k=v=>{if(typeof v=="function"){const T=v(g),I=Object.keys(T).filter(E=>T[Number(E)]).map(E=>e[Number(E)]);u==null||u.onRowSelect(I)}},y=Me.useReactTable({data:e,columns:b,getCoreRowModel:Me.getCoreRowModel(),getPaginationRowModel:Me.getPaginationRowModel(),manualPagination:!0,manualSorting:!0,manualFiltering:!0,enableRowSelection:u==null?void 0:u.isEnabled,state:{...u!=null&&u.isEnabled?{rowSelection:g}:{}},onRowSelectionChange:k});return a.jsxs("div",{className:c("wu-text-gray-lead wu-table-container wu-relative"),children:[f&&a.jsx(nr,{className:"wu-font-light",children:f}),a.jsxs(sr,{...h,className:c(Ho({variant:s}),h.className),children:[a.jsx(zo,{table:y,sortableColumns:m,manual:!0,onSort:o==null?void 0:o.onSort,size:n,HeaderAction:i,isRowSelected:C>0,isStickyHeader:w}),!r&&a.jsx(Vo,{table:y,size:n,NoDataContent:l,CustomLoader:d})]}),r&&a.jsx("div",{className:"wu-flex wu-items-center wu-justify-center wu-h-96",children:a.jsx(et,{})})]})},cc=({data:e,columns:t,variant:r="unstyled",size:s="default",sort:o,filterText:n,pagination:u,stickyHeader:i,HeaderAction:l,CustomLoader:w,NoDataContent:d,isLoading:f,caption:h,rowSelection:b,...g})=>{var P;const[m,C]=p.useState((o==null?void 0:o.initial)||[]),[k,y]=p.useState([]),[S,v]=p.useState((u==null?void 0:u.pageIndex)??0),{finalColumns:T,rowSelectionState:I}=qo({data:e,columns:t,rowSelection:b}),E=p.useMemo(()=>T.filter(L=>L.enableSorting).map(L=>L.accessorKey),[T]),M=p.useMemo(()=>T.filter(L=>L.filterable).map(L=>L.accessorKey),[T]),_=((P=b==null?void 0:b.selectedRows)==null?void 0:P.length)??0,O=L=>{const F=typeof L=="function"?L(I):L,B=Object.keys(F).filter(W=>F[Number(W)]).map(W=>e[Number(W)]);b==null||b.onRowSelect(B)},A=Me.useReactTable({data:e,columns:T,getCoreRowModel:Me.getCoreRowModel(),getFilteredRowModel:Me.getFilteredRowModel(),getSortedRowModel:Me.getSortedRowModel(),getPaginationRowModel:u?Me.getPaginationRowModel():void 0,state:{sorting:m,columnFilters:k,...u?{pagination:u}:{},...b!=null&&b.isEnabled?{rowSelection:I}:{}},onSortingChange:C,onColumnFiltersChange:y,onRowSelectionChange:O});return p.useEffect(()=>{M.forEach(L=>{var F;(F=A.getColumn(L))==null||F.setFilterValue(n)})},[n,M,A]),p.useEffect(()=>{u&&(u==null?void 0:u.pageIndex)!==S&&(b==null||b.onRowSelect(()=>[]),A.resetRowSelection(),v(u.pageIndex))},[u==null?void 0:u.pageIndex]),a.jsx("div",{className:"wu-text-gray-lead wu-table-container wu-relative",children:a.jsxs(sr,{...g,className:c("wu-overflow-x-auto wu-w-full",Ho({variant:r}),"wu-table-fixed",g.className),children:[h&&a.jsx(nr,{children:h}),a.jsx(zo,{table:A,sortableColumns:E,size:s,HeaderAction:l,isRowSelected:_>0,isStickyHeader:i}),a.jsx(Vo,{table:A,size:s,NoDataContent:d,CustomLoader:w,isLoading:f})]})})},$o=x.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 Uo=p.forwardRef((e,t)=>{const{Label:r,id:s=_t(),variant:o="flat",readonly:n,maxLength:u,labelPosition:i="top",...l}=e,w=f=>{l.onChange&&l.onChange(f)},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:n,maxLength:u}),r&&a.jsx(ge,{htmlFor:s,className:"wu-textarea-label",children:r})]})});Uo.displayName="WuTextarea";function wc(e){if(typeof e=="string"&&e.includes("T")){const t=U.parseISO(e);return U.format(t,"HH:mm")}if(typeof e=="string"&&/^\d{2}:\d{2}:\d{2}$/.test(e)){const t=U.parse(e,"HH:mm:ss",new Date);return U.format(t,"HH:mm")}return typeof e=="string"&&/^\d{2}:\d{2}$/.test(e)?e:"00:00"}const jo=["12",...Array.from({length:11},(e,t)=>String(t+1).padStart(2,"0"))],Go=Array.from({length:60},(e,t)=>String(t).padStart(2,"0")),Yo=["am","pm"],ta=50;function dc(e){return Array(ta).fill(e).flat()}function ur(e,t){const r=e.indexOf(t);return[...e.slice(r),...e.slice(0,r)]}function fc(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 Ko(e){const t=Number(e),r=t>=12?"pm":"am",s=t%12===0?12:t%12;return{hour:String(s),meridiem:r}}const pc=({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}),lr=({values:e,selectedValue:t,scrollRef:r,onSelect:s,repeatItems:o=!0,className:n})=>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]",n),role:"presentation",children:(o?dc(e):e).map((u,i)=>a.jsx(pc,{value:u,isSelected:u===t,onClick:()=>s(u)},`${u}-${i}`))});function hc(e,t,r,s){const o=p.useMemo(()=>e?ur(jo,t.padStart(2,"0")):jo,[e]),n=p.useMemo(()=>e?ur(Go,r.padStart(2,"0")):Go,[e]),u=p.useMemo(()=>e?ur(Yo,s):Yo,[e]);return{rotatedHours:o,rotatedMinutes:n,rotatedMeridiem:u}}function bc(e,t,r){p.useEffect(()=>{function s(u){if(u){const i=u.scrollHeight/ta,l=Math.floor(ta/2);u.scrollTop=l*i;const w=()=>{const{scrollTop:d}=u,f=Math.round(d/i);(f<=1||f>=ta-2)&&(u.scrollTop=l*i)};return u.addEventListener("scroll",w),()=>{u.removeEventListener("scroll",w)}}}if(!e)return;const o=s(t.current),n=s(r.current);return()=>{o==null||o(),n==null||n()}},[e,t,r])}const Jo=({className:e,time:t,Label:r,labelPosition:s,dir:o,...n})=>{const[u,i]=p.useState(!1),[l,w]=p.useState(""),d=p.useRef(null),f=p.useRef(null),h=p.useRef(null),b=p.useRef(null),[g,m]=p.useState("12"),[C,k]=p.useState("00"),[y,S]=p.useState("am");p.useEffect(()=>{if(!t){w(""),m("12"),k("00"),S("am"),d.current&&(d.current.value="");return}const M=wc(t);w(M);const[_,O]=M.split(":"),{hour:A,meridiem:P}=Ko(_);m(A),k(O),S(P),d.current&&(d.current.value=M)},[t]),p.useEffect(()=>{const M=_=>{f.current&&!f.current.contains(_.target)&&i(!1)};return document.addEventListener("mousedown",M),()=>{document.removeEventListener("mousedown",M)}},[]),bc(u,h,b);const{rotatedHours:v,rotatedMinutes:T,rotatedMeridiem:I}=hc(u,g,C,y),E=p.useCallback((M,_,O)=>{const A=M??g,P=_??C,L=O??y;m(A),k(P),S(L);const F=`${fc(A,L)}:${P}`;w(F)},[g,C,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(ge,{htmlFor:"time-picker",className:"wu-timepicker-label",children:r}),a.jsxs("div",{className:c("relative inline-block"),ref:f,dir:o,children:[a.jsx(Ae,{ref:d,type:"time",value:l,variant:"flat",role:"textbox",onChange:M=>{w(M.target.value);const[_,O]=M.target.value.split(":"),{hour:A,meridiem:P}=Ko(_);m(A),k(O),S(P)},className:"wu-w-[136px] wu-h-8 wu-pr-6 wu-border wu-border-lead/40 wu-text-gray-lead wu-timepicker-input",style:{WebkitAppearance:"none",MozAppearance:"textfield"},Icon:a.jsx(ce,{icon:"wm-schedule",className:c("wu-text-base",n.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,...n}),a.jsx("style",{children:`
7
+ )`;d.style.setProperty("--spotlight-background",E)})};return window.addEventListener("mousemove",b),()=>{window.removeEventListener("mousemove",b),p&&cancelAnimationFrame(p)}}},[t,a,n,u]),r.jsx("div",{ref:i,className:c(al.gradientBackground,"wu-transform-gpu",o),...l,children:s})},ds="calc(100vh - 64px)",sl={sm:"400px",md:"600px",lg:"1200px"},Ut=({Trigger:e,children:t,size:a="md",hideCloseButton:s,preventClickOutside:o,onOpenChange:n,open:u,dir:l,maxWidth:i,maxHeight:d,className:w,style:p,variant:b="action",...h})=>{const x={action:["#EEF3FBcc 32%","#1D50F4cc"],upgrade:["#FDEDCCcc 32%","#FF9F00cc"],critical:["#FFB6B6cc 32%","#CC0000cc"]};return r.jsxs(ns,{modal:!0,onOpenChange:n,open:u,children:[e&&r.jsx(us,{asChild:!0,children:e}),r.jsxs(Wr,{style:{width:"calc(100% - 64px)",maxWidth:i||sl[a],maxHeight:d||ds,...p},hideCloseButton:s,onInteractOutside:m=>o&&m.preventDefault(),dir:l,"aria-describedby":void 0,"data-variant":b,className:c("wu-group wuexp:wu-rounded-[1.1rem]",w),...h,children:["data-theme"in h&&r.jsx(cs,{colors:x[b],strokeWidth:4,className:c("wuexp:wu-rounded-[1.1rem] wu-transform-gpu wu-flex wu-flex-col",w),style:{maxHeight:d||ds},children:t}),!("data-theme"in h)&&t]})]})},jt=({children:e,className:t,...a})=>r.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),...a,children:e}),ol=({children:e,className:t,...a})=>r.jsx(Pr,{...a,"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:r.jsx(at,{className:"wuexp:wu-font-normal wuexp:wu-justify-start wuexp:wu-text-2xl wuexp:wu-h-14",children:e})}),nl=({children:e,className:t,...a})=>r.jsx(is,{...a,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}),ze=({children:e,className:t,...a})=>{const s=f.useRef(null);return r.jsx(tl,{asChild:!0,children:r.jsx(le,{className:t,ref:s,...a,children:e})})},ul=({placeholder:e="Select...",value:t,multiple:a=!1,accessorKey:s,variant:o="flat",dir:n="ltr",customTriggerChildren:u,id:l,disabled:i,selectAll:d,isCheckedAll:w,width:p,...b})=>{const[h,x]=f.useState(""),[m,C]=f.useState(e);f.useEffect(()=>{if(!t||Array.isArray(t)&&t.length===0){C(e),x("");return}const y=s.label;if(a&&Array.isArray(t)){const S=t.map(N=>N[y]).join(", ");x(S)}else!a&&!Array.isArray(t)&&x(t[y])},[t,s.label,a,e]);const E=()=>e&&!h?r.jsx("p",{className:"wu-text-xs wu-opacity-70",children:m}):r.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:w?(d==null?void 0:d.triggerText)??h:h});return r.jsx(Dr,{asChild:!0,dir:n,id:l,disabled:i,children:r.jsxs("button",{...b,disabled:i,className:c("wu-flex wu-gap-2 wu-w-full wu-items-center wu-justify-between wu-py-1.5 wu-px-2 wu-text-xs wu-transition-colors wu-cursor-pointer wu-border-b wu-bg-white wu-border-gray-subtle wu-h-8","focus:wu-outline-none focus-visible:wu-border-blue-p/80 wu-rounded-t-sm","disabled:wu-cursor-not-allowed disabled:hover:wu-border-gray-subtle disabled:wu-bg-gray-10 disabled:wu-opacity-50","hover:wu-bg-gray-10 hover:wu-border-blue-p",o==="outlined"&&"wu-border wu-border-gray-subtle","wu-group/wuSelect wu-select-trigger",b.className),children:[u??E(),r.jsx("span",{className:"wm-arrow-drop-down group-data-[state=open]/wuSelect:wu-rotate-180 wu-transition-transform wu-duration-300 wu-text-base"})]})})},ws=({option:e,value:t,multiple:a=!1,onSelect:s,accessorKey:o,dir:n="ltr"})=>{const[u,l]=f.useState(a?[]:"");f.useEffect(()=>{t&&l(a?t.map(p=>JSON.stringify(p[o.value])):JSON.stringify(t[o.value]))},[t,o.value,a]);const i=a?u.includes(JSON.stringify(e[o.value])):u===JSON.stringify(e[o.value]),d=w=>{e.disabled||(s(e),a&&w.preventDefault())};return r.jsxs(vt,{onClick:d,disabled:e.disabled,className:c("wu-cursor-pointer wu-text-xs wu-py-2 wu-leading-4 wu-select-item wu-items-start",i&&"wu-bg-gray-10"),dir:n,children:[a&&r.jsx(Ce,{checked:i}),r.jsx(fs,{option:e,accessorKey:o})]})},fs=({option:e,accessorKey:t})=>{const a=String(e[t.label]);return r.jsxs("div",{className:"wu-flex wu-items-center wu-w-full wu-gap-1 wu-text-xs wu-pl-2",children:[e.icon,a,e.isAdmin&&r.jsx("span",{className:"wu-ml-auto wm-lock wu-text-sm wu-text-orange-deep"})]})},ps=e=>{const{option:t,handleSelectAll:a,isCheckedAll:s,isPartialSelected:o,...n}=e;switch("type"in t?t.type:"option"){case"all":return r.jsxs(vt,{onSelect:l=>{l.stopPropagation(),l.preventDefault(),a==null||a()},className:c("wu-cursor-pointer wu-text-xs wu-py-2 wu-leading-4 wu-select-item"),dir:n.dir,children:[r.jsx(Ce,{"data-partial":o,checked:s||o,partial:o}),r.jsx(fs,{option:t,accessorKey:n.accessorKey})]});case"group":return r.jsxs(ja,{dir:n.dir,children:[r.jsx(yt,{className:"wu-text-xs",children:t.label}),t.options.map((l,i)=>f.createElement(ws,{...n,option:l,key:i}))]});case"divider":return r.jsx($t,{className:"wu-mx-4"});default:return r.jsx(ws,{...n,option:t})}},ll=e=>{let t=0,a=0;const s=[],o=[],n=u=>{u.type==="divider"?t++:u.type==="group"?(a++,u.options.forEach(l=>{n(l)})):(s.push(u),u.disabled||o.push(u))};return e.forEach(u=>{n(u)}),{separators:t,groups:a,enabledOptions:o,totalData:s.length,cleanData:s}},il=100,cl=400,hs=({data:e,onSelect:t,multiple:a=!1,defaultValue:s,value:o,accessorKey:n,variant:u="flat",dir:l="ltr",placeholder:i,Label:d,virtualizedThreshold:w=il,maxHeight:p=cl,hasGroup:b=!1,Header:h,CustomTrigger:x,selectAll:m,disabled:C,labelPosition:E="top",onScroll:y,maxContentWidth:S,...N})=>{const[k,A]=f.useState(),T=f.useRef(null),[D,F]=f.useState(!1),[W,_]=f.useState(!1),{cleanData:z,enabledOptions:P}=b||m!=null&&m.enable?ll(e):{cleanData:e,enabledOptions:[]},G=f.useMemo(()=>a&&m!=null&&m.enable&&e.length>0?[{type:"all",[n.label]:m.label||"Select All"},...e]:e,[e,m,a]),q=f.useCallback(U=>{const O=U[n.value];if(a)A((ae=[])=>{const te=ae,We=te.some($=>$[n.value]===O)?te.filter($=>$[n.value]!==O):[...te,U];return t==null||t(We),We});else{const ae=U;A(ae),t==null||t(ae)}},[a,n.value,t]);f.useEffect(()=>{if(s&&o){console.error("defaultValue and value cannot be used simultaneously");return}!s&&!o&&A(void 0),s!==void 0&&A(s),o!==void 0&&A(o)},[s,o]);const oe=G.length>w;f.useEffect(()=>{if(!a)return;const U=m!=null&&m.includeDisabled?(k==null?void 0:k.length)===e.length:(k==null?void 0:k.length)===P.length;F(U);const O=(k==null?void 0:k.length)>0&&!U;_(O)},[k,m]);const M=f.useCallback(()=>{const U=D?[]:m!=null&&m.includeDisabled?b?z:e:P;A(U),t==null||t(U)},[D,a,e,P,t,m]),H=gt(E);return r.jsxs("div",{className:c(H,"wu-flex wu-select-container"),ref:T,dir:l,children:[r.jsxs(Ar,{children:[r.jsx(ul,{...N,value:k,multiple:a,variant:u,dir:l,placeholder:i,accessorKey:n,customTriggerChildren:x,id:N.id,disabled:C,selectAll:m,isCheckedAll:D}),r.jsxs(Ht,{className:"wu-min-w-[--radix-dropdown-menu-trigger-width] wu-max-w-[calc(100vw-32px)] wu-border-blue-p wu-select-content",role:"listbox",sideOffset:-1,align:"start",id:N.id,style:{maxWidth:S},children:[h,oe?r.jsx(tt,{list:G,containerHeight:p,callback:(U,O)=>r.jsx(ps,{option:O,accessorKey:n,multiple:a,onSelect:q,value:k,dir:l,handleSelectAll:M,isCheckedAll:D,isPartialSelected:W}),dir:l}):r.jsx("div",{onScroll:y,style:{maxHeight:p,height:"fit-content",overflow:"auto"},className:"wu-select-list",children:G.map((U,O)=>r.jsx(ps,{option:U,accessorKey:n,multiple:a,onSelect:q,value:k,handleSelectAll:M,isCheckedAll:D,dir:l,isPartialSelected:W},`${O}`))})]})]}),d&&r.jsx(xe,{htmlFor:N.id,className:"wu-select-label",children:d})]})},Gt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dl=({value:e,onChange:t,min:a=j.sub(new Date,{years:5}),max:s=j.add(new Date,{years:1}),placeholder:o="Select a month",Label:n,labelPosition:u="top",disabled:l,id:i,readonly:d,disabledMonths:w=[],...p})=>{const[b,h]=f.useState(null),[x,m]=f.useState(""),[C,E]=f.useState({value:Math.min(new Date().getFullYear(),new Date(s).getFullYear()),label:Math.min(new Date().getFullYear(),new Date(s).getFullYear())}),y=f.useMemo(()=>{const N=new Date(a).getFullYear(),k=new Date(s).getFullYear();return Array.from({length:k-N+1},(A,T)=>({value:k-T,label:k-T}))},[a,s]);f.useEffect(()=>{if(e){const N=new Date(e),k=N.getFullYear(),A=N.getMonth();h({year:k,month:A}),m(`${Gt[A]} ${k}`),E({value:k,label:k})}},[e]);const S=()=>{b&&t&&(t(new Date(b.year,b.month,15)),m(`${Gt[b.month]} ${b.year}`))};return r.jsxs("div",{className:c("wu-flex wu-flex-col wu-items-center",gt(u),u==="top"&&"wu-items-start"),children:[r.jsxs(Fe,{children:[r.jsx(Sr,{...p,disabled:l||d,id:i,dir:"ltr",placeholder:o,formattedString:x}),r.jsxs(Ee,{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:[r.jsx("div",{className:"wu-px-1 wu-mx-auto wu-w-full",children:r.jsx(hs,{data:y,accessorKey:{value:"value",label:"label"},value:C,onSelect:N=>E(N),multiple:!1,maxHeight:224})}),r.jsx(wl,{year:C==null?void 0:C.value,selectedMonth:b==null?void 0:b.month,selectedYear:b==null?void 0:b.year,onClick:(N,k)=>h({year:k,month:N}),disabledMonths:w}),r.jsx("div",{className:"wu-flex wu-justify-end wu-px-0.5",children:r.jsx(wt.PopoverClose,{asChild:!0,children:r.jsx(le,{onClick:S,children:"Apply"})})})]})]}),n&&r.jsx(xe,{className:"wu-truncate wu-max-w-[120px] wu-min-w-fit wu-select-label",children:n})]})},wl=({year:e,selectedMonth:t,selectedYear:a,onClick:s,disabledMonths:o=[]})=>{const n=new Date,u=n.getFullYear(),l=n.getMonth(),i=f.useMemo(()=>{const d=new Set;return o.forEach(w=>{const p=typeof w=="string"?new Date(w):w;d.add(`${p.getFullYear()}-${p.getMonth()}`)}),d},[o]);return r.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:Gt.map((d,w)=>{const p=e===u&&w===l,b=t===w&&a===e;return r.jsx("button",{disabled:i.has(`${e}-${w}`),onClick:()=>s(w,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":`${Gt[w]} ${e}`,"data-month":w,"data-year":e,children:d},d)})})},bs=(e,t,a,s=96)=>{if(e.length===0||s<=0)return[[],[]];const[n,u]=f.useState([]),[l,i]=f.useState([]);return f.useEffect(()=>{const d=()=>{var x,m;const w=((x=t.current)==null?void 0:x.clientWidth)||0,p=((m=a.current)==null?void 0:m.clientWidth)||0,b=w-p,h=Math.floor(b/s);u(e.slice(0,h)),i(e.slice(h))};return d(),window.addEventListener("resize",d),()=>{window.removeEventListener("resize",d)}},[e,s]),[n,l]},gs={wuPrimaryLink:"_wuPrimaryLink_1sy3v_1",wuPrimaryPopoverContent:"_wuPrimaryPopoverContent_1sy3v_8"},fl=e=>{const{Links:t,children:a,className:s,...o}=e,n=f.useMemo(()=>t.map((w,p)=>f.cloneElement(w,{className:c(gs.wuPrimaryLink,w.props.className,"wu-primary-nav-link"),key:p})),[t]),u=f.useRef(null),l=f.useRef(null),[i,d]=bs(n,u,l);return r.jsx(r.Fragment,{children:r.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:u,children:[r.jsxs("div",{className:"wu-flex wu-items-center wu-gap-2",children:[r.jsx("nav",{className:"wu-flex wu-items-center wu-justify-start wu-gap-4 wu-primary-nav-left",children:i}),d.length>0&&r.jsxs(Fe,{children:[r.jsx(Ue,{className:"wu-p-1 wu-pb-0 wu-rounded-sm focus:wu-outline-none focus:wu-bg-gray-25","aria-label":"more",children:r.jsx("span",{className:"wm-more-vert"})}),r.jsx(Ee,{className:c(gs.wuPrimaryPopoverContent,"wu-primary-nav-popover-left"),align:"start",sideOffset:12,children:d})]})]}),a&&r.jsxs(r.Fragment,{children:[r.jsx("section",{className:"wu-items-center wu-justify-end wu-hidden wu-gap-4 sm:wu-flex wu-primary-nav-right",ref:l,children:a}),r.jsxs(Fe,{children:[r.jsx(Ue,{className:"sm:wu-hidden",children:r.jsx("span",{className:"wu-text-lg wm-menu"})}),r.jsx(Ee,{className:"wu-bg-white wu-border wu-border-blue-p wu-w-fit wu-primary-nav-popover-right",align:"end",sideOffset:4,children:a})]})]})]})})},Or={wuSecondaryLink:"_wuSecondaryLink_1edl1_1",wuSecondaryNav:"_wuSecondaryNav_1edl1_6"},pl=e=>{const{Links:t,children:a,className:s,...o}=e,n=f.useMemo(()=>t.map((p,b)=>f.cloneElement(p.link,{key:b,className:c(Or.wuSecondaryLink,p.link.props.className,"wu-secondary-nav-link-container"),children:r.jsxs(r.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)}),r.jsx("div",{className:"wu-secondary-nav-link",children:p.link.props.children})]})})),[t]),u=f.useRef(null),l=f.useRef(null),i=f.useRef(null),[d,w]=bs(n,u,i);return r.jsx(r.Fragment,{children:r.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:u,children:[r.jsxs("div",{className:"wu-flex wu-items-center wu-justify-start wu-gap-2",children:[r.jsx("nav",{className:c(Or.wuSecondaryNav,"wu-flex wu-items-center wu-justify-start wu-w-full wu-h-full wu-secondary-nav-left"),ref:l,children:d}),w.length>0&&r.jsxs(Fe,{children:[r.jsx(Ue,{className:"wu-p-1 wu-pb-0 wu-rounded-sm focus:wu-outline-none focus:wu-bg-gray-25","aria-label":"more",children:r.jsx("span",{className:"wm-more-vert"})}),r.jsx(Ee,{className:c(Or.wuSecondaryNavPopover,"wu-secondary-nav-popover-left"),align:"start",sideOffset:12,children:w})]})]}),a&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"wu-items-center wu-justify-end wu-hidden sm:wu-flex",ref:i,children:a}),r.jsxs(Fe,{children:[r.jsx(Ue,{className:"sm:wu-hidden",children:r.jsx("span",{className:"wu-text-lg wm-menu"})}),r.jsx(Ee,{className:"wu-bg-white wu-border wu-border-blue-p wu-w-fit wu-secondary-nav-popover-right",align:"end",sideOffset:12,children:a})]})]})]})})},ms=f.forwardRef(({totalRows:e,initialPage:t=0,initialPageSize:a=100,onPageChange:s,className:o,disabled:n=!1,...u},l)=>{const[i,d]=f.useState(t),[w,p]=f.useState(a);f.useEffect(()=>{d(t),p(a)},[t,a]);const b=Math.ceil(e/w),h=i*w+1,x=Math.min((i+1)*w,e),m=Array.from({length:b},(y,S)=>S),C=f.useCallback(y=>{y>=0&&y<b&&(d(y),s==null||s(y))},[b,s]),E=224;return r.jsxs("div",{className:c("wu-flex wu-items-center wu-gap-[2px]",o,"wu-pagination"),...u,role:"navigation",children:[r.jsx(xs,{label:"Previous page",onClick:()=>C(i-1),disabled:i===0||n,icon:"wm-arrow-back-ios-new",className:"hover:wu-bg-gray-20 rtl:wu-rotate-180 wu-prev-btn"}),r.jsx(ss,{name:`${h} - ${x}`,className:"wu-w-[96px] wu-min-w-[96px] wu-pagination-menu",align:"end",disabled:n,children:r.jsx(rt,{style:{maxHeight:E+"px"},dir:u.dir,children:m.length>100?r.jsx(tt,{className:"wu-pagination-list",containerHeight:E,list:m,callback:(y,S)=>r.jsxs(_r,{onSelect:()=>C(S),className:c("wu-py-2",S===i&&"wu-bg-gray-20","wu-pagination-item"),children:[S*w+1," -"," ",Math.min((S+1)*w,e)]},y)}):m.map(y=>r.jsxs(_r,{onSelect:()=>C(y),className:c(y===i&&"wu-bg-gray-20","wu-py-2 hover:wu-bg-gray-20","wu-pagination-item"),children:[y*w+1," -"," ",Math.min((y+1)*w,e)]},y))})}),r.jsx(xs,{label:"Next page",onClick:()=>C(i+1),disabled:i===b-1||n,icon:"wm-arrow-forward-ios",className:"hover:wu-bg-gray-20 rtl:wu-rotate-180 wu-next-btn"})]})});ms.displayName="WuPagination";const xs=({label:e,onClick:t,disabled:a,icon:s,className:o})=>r.jsx(le,{variant:"iconOnly",onClick:t,disabled:a,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:r.jsx("span",{className:c("wu-text-sm",s)})}),hl=({Trigger:e,children:t,className:a,dir:s,open:o,onOpenChange:n,modal:u,...l})=>r.jsxs(Fe,{open:o,onOpenChange:n,modal:u,children:[r.jsx(Ue,{asChild:!0,dir:s,children:e}),r.jsx(Ee,{className:c("wu-w-80 wu-p-0 wu-border-blue-p wu-bg-white wu-dark:border-gray-switcher",a),dir:s,...l,children:t})]}),bl=e=>r.jsx(wt.PopoverClose,{asChild:!0,children:r.jsx(le,{...e})}),vs=g.forwardRef(({className:e,...t},a)=>r.jsx(bt.Root,{className:c("wu-grid wu-gap-2",e),...t,ref:a}));vs.displayName=bt.Root.displayName;const ys=g.forwardRef(({className:e,...t},a)=>r.jsx(bt.Item,{ref:a,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:r.jsx(bt.Indicator,{className:"wu-flex wu-items-center wu-justify-center",children:r.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"})})}));ys.displayName=bt.Item.displayName;const Ns=f.forwardRef((e,t)=>{const{options:a,defaultValue:s,onChange:o,label:n,dir:u,...l}=e;return r.jsxs(vs,{defaultValue:s,required:l.required,disabled:l.disabled,onValueChange:o,id:l.id,dir:u,name:l.name,className:c("w-fit",l.className),ref:t,style:l.style,children:[r.jsx(qt,{htmlFor:l.id,className:"wu-text-sm wu-font-normal wu-text-gray-lead wu-leading-6 wu-radio-group-label",children:n}),a.map(i=>r.jsxs("div",{className:"wu-flex wu-items-center wu-gap-2 wu-radio-item-container",children:[r.jsx(ys,{value:i.value,id:i.value,disabled:i.disabled,required:i.required,"aria-label":i.value,className:"wu-peer wu-radio-item"}),r.jsx(qt,{htmlFor:i.value,className:c(i.required&&"after:wu-content-['*'] after:wu-mx-[2px] after:wu-text-rose-500","wu-radio-item-label"),children:i.label})]},i.value))]})});Ns.displayName="WuRadioGroup";const gl=e=>{const{children:t,...a}=e;return r.jsxs(rt,{...a,role:"complementary","aria-label":"ScrollArea",children:[t,r.jsx(Fr,{orientation:"horizontal"})]})},Oe=g.forwardRef(({className:e,orientation:t="horizontal",decorative:a=!0,...s},o)=>r.jsx(xa.Root,{ref:o,decorative:a,orientation:t,className:c("wu-shrink-0 wu-bg-gray-40",t==="horizontal"?"wu-h-[1px] wu-w-full":"wu-h-full wu-w-[1px]",e),...s}));Oe.displayName=xa.Root.displayName;function Cs({className:e,...t}){return r.jsx("div",{className:c("animate-pulse rounded-md bg-muted",e),...t})}const Br=768;function Ss(){const[e,t]=g.useState(void 0);return g.useEffect(()=>{const a=window.matchMedia(`(max-width: ${Br-1}px)`),s=()=>{t(window.innerWidth<Br)};return a.addEventListener("change",s),t(window.innerWidth<Br),()=>a.removeEventListener("change",s)},[]),!!e}const ml="sidebar_state",xl=3600*24*7,vl="256px",yl="256px",Nl="3rem",Cl="b",Es=g.createContext(null);function je(){const e=g.useContext(Es);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}const Ts=g.forwardRef(({defaultOpen:e=!0,open:t,onOpenChange:a,className:s,style:o,children:n,...u},l)=>{const i=Ss(),[d,w]=g.useState(!1),[p,b]=g.useState(i?!0:e),h=t??p,x=g.useCallback(y=>{const S=typeof y=="function"?y(h):y;a?a(S):b(S),document.cookie=`${ml}=${S}; path=/; max-age=${xl}`},[a,h]),m=g.useCallback(()=>i?w(y=>!y):x(y=>!y),[i,x,w]);g.useEffect(()=>{const y=S=>{S.key===Cl&&(S.metaKey||S.ctrlKey)&&(S.preventDefault(),m())};return window.addEventListener("keydown",y),()=>window.removeEventListener("keydown",y)},[m]);const C=h?"expanded":"collapsed",E=g.useMemo(()=>({state:C,open:h,setOpen:x,isMobile:i,openMobile:d,setOpenMobile:w,toggleSidebar:m}),[C,h,x,i,d,w,m]);return r.jsx(Es.Provider,{value:E,children:r.jsx(_a,{delayDuration:0,children:r.jsx("div",{style:{"--sidebar-width":vl,"--sidebar-width-icon":Nl,...o},className:c("wu-group/sidebar-wrapper wu-flex wu-min-h-[calc(100svh-48px)] wu-w-full",s),ref:l,...u,children:n})})})});Ts.displayName="SidebarProvider";const ks=g.forwardRef(({side:e="left",variant:t="sidebar",collapsible:a="offcanvas",className:s,children:o,...n},u)=>{const{isMobile:l,state:i,openMobile:d,setOpenMobile:w}=je();return a==="none"?r.jsx("div",{className:c("wu-flex wu-h-full wu-w-[--sidebar-width] wu-flex-col",s),ref:u,...n,children:o}):l?r.jsx(Qa,{open:d,onOpenChange:w,...n,children:r.jsx(Mr,{"data-sidebar":"sidebar","data-mobile":"true",className:"wu-w-[--sidebar-width] wu-bg-blue-sidebar wu-p-0 [&>button]:wu-hidden",style:{"--sidebar-width":yl},side:e,children:r.jsx("div",{className:"wu-flex wu-flex-col wu-w-full wu-h-full",children:o})})}):r.jsxs("div",{ref:u,className:"wu-hidden wu-group wu-peer md:wu-block","data-state":i,"data-collapsible":i==="collapsed"?a:"","data-variant":t,"data-side":e,children:[r.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]")}),r.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),...n,children:r.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})})]})});ks.displayName="Sidebar";const Is=g.forwardRef(({className:e,onClick:t,children:a,...s},o)=>{const{toggleSidebar:n}=je();return r.jsxs(Re,{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:u=>{t==null||t(u),n()},...s,children:[a,r.jsx("span",{className:"wu-sr-only",children:"Toggle Sidebar"})]})});Is.displayName="SidebarTrigger";const Sl=g.forwardRef(({className:e,...t},a)=>{const{toggleSidebar:s}=je();return r.jsx("button",{ref:a,"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 As=g.forwardRef(({className:e,...t},a)=>r.jsx("main",{ref:a,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}));As.displayName="SidebarInset";const El=g.forwardRef(({className:e,...t},a)=>r.jsx(yr,{ref:a,"data-sidebar":"input",className:c("wu-h-8 wu-w-full wu-shadow-none focus-visible:wu-ring-2",e),...t}));El.displayName="SidebarInput";const Ds=g.forwardRef(({className:e,...t},a)=>r.jsx("div",{ref:a,"data-sidebar":"header",className:c("wu-flex wu-flex-col wu-gap-2 wu-p-2",e),...t}));Ds.displayName="SidebarHeader";const Ms=g.forwardRef(({className:e,...t},a)=>r.jsx("div",{ref:a,"data-sidebar":"footer",className:c("wu-flex wu-flex-col wu-gap-2 wu-pb-2",e),...t}));Ms.displayName="SidebarFooter";const Tl=g.forwardRef(({className:e,...t},a)=>r.jsx(Oe,{ref:a,"data-sidebar":"separator",className:c("wu-mx-2 wu-w-auto",e),...t}));Tl.displayName="SidebarSeparator";const _s=g.forwardRef(({className:e,...t},a)=>r.jsx("div",{ref:a,"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}));_s.displayName="SidebarContent";const Fs=g.forwardRef(({className:e,...t},a)=>r.jsx("div",{ref:a,"data-sidebar":"group",className:c("wu-relative wu-flex wu-w-full wu-min-w-0 wu-flex-col wu-p-2",e),...t}));Fs.displayName="SidebarGroup";const Ls=g.forwardRef(({className:e,asChild:t=!1,...a},s)=>{const o=t?Xe.Slot:"div";return r.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),...a})});Ls.displayName="SidebarGroupLabel";const kl=g.forwardRef(({className:e,asChild:t=!1,...a},s)=>{const o=t?Xe.Slot:"button";return r.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),...a})});kl.displayName="SidebarGroupAction";const Ws=g.forwardRef(({className:e,...t},a)=>r.jsx("div",{ref:a,"data-sidebar":"group-content",className:c("wu-w-full wu-text-sm",e),...t}));Ws.displayName="SidebarGroupContent";const qr=g.forwardRef(({className:e,...t},a)=>r.jsx("ul",{ref:a,"data-sidebar":"menu",className:c("wu-flex wu-w-full wu-min-w-0 wu-flex-col wu-gap-1",e),...t}));qr.displayName="SidebarMenu";const Ps=g.forwardRef(({className:e,...t},a)=>r.jsx("li",{ref:a,"data-sidebar":"menu-item",className:c("wu-group/menu-item wu-relative",e),...t}));Ps.displayName="SidebarMenuItem";const Il=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"}}),Os=g.forwardRef(({asChild:e=!1,isActive:t=!1,variant:a="default",size:s="default",tooltip:o,className:n,...u},l)=>{const i=e?Xe.Slot:"button",{isMobile:d,state:w}=je(),p=r.jsx(i,{ref:l,"data-sidebar":"menu-button","data-size":s,"data-active":t,className:c(Il({variant:a,size:s}),n),...u});return o?(typeof o=="string"&&(o={children:o}),r.jsxs(Fa,{children:[r.jsx(La,{asChild:!0,children:p}),r.jsx(Nr,{side:"right",align:"center",hidden:w!=="collapsed"||d,...o})]})):p});Os.displayName="SidebarMenuButton";const Al=g.forwardRef(({className:e,asChild:t=!1,showOnHover:a=!1,...s},o)=>{const n=t?Xe.Slot:"button";return r.jsx(n,{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",a&&"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})});Al.displayName="SidebarMenuAction";const Dl=g.forwardRef(({className:e,...t},a)=>r.jsx("div",{ref:a,"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}));Dl.displayName="SidebarMenuBadge";const Ml=g.forwardRef(({className:e,showIcon:t=!1,...a},s)=>{const o=g.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return r.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),...a,children:[t&&r.jsx(Cs,{className:"wu-rounded-md wu-size-4","data-sidebar":"menu-skeleton-icon"}),r.jsx(Cs,{className:"wu-h-4 wu-max-w-[--skeleton-width] wu-flex-1","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":o}})]})});Ml.displayName="SidebarMenuSkeleton";const _l=g.forwardRef(({className:e,...t},a)=>r.jsx("ul",{ref:a,"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}));_l.displayName="SidebarMenuSub";const Fl=g.forwardRef(({...e},t)=>r.jsx("li",{ref:t,...e}));Fl.displayName="SidebarMenuSubItem";const Ll=g.forwardRef(({asChild:e=!1,size:t="md",isActive:a,className:s,...o},n)=>{const u=e?Xe.Slot:"a";return r.jsx(u,{ref:n,"data-sidebar":"menu-sub-button","data-size":t,"data-active":a,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})});Ll.displayName="SidebarMenuSubButton";const Wl=({children:e,Sidebar:t,className:a,defaultOpen:s=!0,open:o,onOpenChange:n,style:u})=>r.jsxs(Ts,{defaultOpen:s,open:o,onOpenChange:n,children:[r.jsxs(ks,{variant:"sidebar",collapsible:"icon",className:c("wu-top-12 wu-h-[calc(100%-48px)] wu-shadow-sidebar wu-border-none",a),style:u,role:"complementary",children:[r.jsx(Ds,{className:"wu-py-2",children:r.jsx(Bs,{})}),t]}),r.jsx(As,{className:"wu-contain-inline-size",children:e})]}),Bs=e=>{const{state:t,isMobile:a,openMobile:s}=je();return r.jsx(Is,{...e,children:r.jsx(Lr,{showMenu:a?s:t==="expanded"})})},Pl=({className:e,children:t,...a})=>{const s=f.useRef(null),o=f.useRef(null),n=({currentTarget:l})=>{const{scrollTop:i,clientHeight:d,scrollHeight:w}=l;s.current&&s.current.classList.toggle("wu-border-[#1b338014]",i!==0),o.current&&o.current.classList.toggle("wu-border-[#1b338014]",i+d!==w)},u="wu-w-[calc(100%-16px)] wu-mx-auto wu-border-transparent";return r.jsxs(_s,{...a,className:c("wu-overflow-hidden wu-gap-0",e),children:[r.jsx("hr",{className:u,ref:s}),r.jsx(rt,{onScroll:n,className:"wu-gap-2",thumbColor:"#b9c3dc",railColor:"#00000000","data-testid":"scroll-area",children:t}),r.jsx("hr",{className:u,ref:o})]})},Ol=e=>r.jsx(Ms,{...e,children:e.children}),Bl=({label:e,children:t,...a})=>r.jsxs(Fs,{...a,className:"wu-p-0",children:[r.jsx("div",{className:"wu-h-8",children:r.jsx(Ls,{className:"wu-items-end wu-px-4 wu-text-xs wu-font-normal wu-leading-4 wu-text-blue-q",children:e})}),r.jsx(Ws,{children:r.jsx(qr,{children:t})})]}),ql=e=>r.jsx(qr,{...e}),zl=({Icon:e,children:t,className:a,isActive:s,...o})=>{const{state:n}=je(),[u,l]=f.useState(),i=Ss(),d=t&&f.cloneElement(t,{children:r.jsxs("div",{className:"wu-flex wu-items-center wu-gap-2 wu-overflow-hidden wu-text-base wu-truncate wu-text-ellipsis",children:[e,r.jsx("span",{className:c("wu-text-sm wu-leading-4 wu-transition-opacity wu-duration-150",n==="collapsed"&&!i&&"wu-opacity-0"),children:t.props.children})]})}),w=f.useRef(null);return f.useEffect(()=>{var p;l(((p=w.current)==null?void 0:p.textContent)||"")},[]),r.jsx(Ps,{...o,className:"wu-flex wu-items-center wu-gap-2 wu-px-2",children:r.jsx(Os,{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",a,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:u,asChild:!0,ref:w,children:d})})},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"}]]),zr=(e,t,a=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]),n=parseFloat(s[2]),u=Math.max(0,parseFloat(s[3])+t);return`hsl(${o} ${n}% ${u}% / ${a})`},Hl=({index:e,viewIndex:t,length:a,itemHeight:s})=>{const o=(e-t+a)%a;let n;o===0?n=0:o===a-1&&a>=2?n=-1:o===a-2&&a>=3?n=-2:o===1?n=1:o===2?n=2:o===a-3&&a>=4?n=-3:n=3;const u=Vl.get(n)||{},l=n>0?s+28+(n-1)*20:u.top;return{position:n,styles:{...u,...n>0&&{top:`${l}px`},height:n>0?"32px":s}}},Nt={LIGHTNESS_STEP:8,BORDER_LIGHTNESS:10,CONTENT_HEIGHT:"calc(100% - 2rem)",FONT_SIZE_ACTIVE:"14px",FONT_SIZE_INACTIVE:"12px"},$l=({children:e,className:t,header:a,baseColor:s,position:o=0,style:n,...u})=>{const l=o<=0,i=o===0,d={border:i?`4px solid ${zr(s,Nt.BORDER_LIGHTNESS)}`:"",...n},w={backgroundColor:zr(s,o*Nt.LIGHTNESS_STEP),fontSize:i?Nt.FONT_SIZE_ACTIVE:Nt.FONT_SIZE_INACTIVE,transition:"all 0.3s ease",position:"relative",bottom:o<0?"4px":"0px",height:"32px",padding:"4px 8px"},p={backgroundColor:zr(s,45+o*6),height:Nt.CONTENT_HEIGHT,position:"relative",bottom:o<0?"4px":"0px"};return r.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:d,...u,children:[r.jsx("div",{style:w,className:"wu-text-white",children:a}),l&&r.jsx("div",{className:"wu-p-2 wu-overflow-y-auto wu-text-sm",style:p,children:e})]})},Ul=({children:e,Trigger:t,Header:a,styles:s={},classNames:o={},open:n,onOpenChange:u,itemHeight:l})=>{const i={height:l,...s.Trigger};return r.jsxs(ns,{open:n,onOpenChange:u,children:[r.jsx(us,{className:c("wu-bg-gray-25 wu-z-0 wu-w-full wu-rounded-lg wu-rounded-tl-none wu-relative",o.Trigger),style:i,children:r.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})}),r.jsxs(Wr,{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:[r.jsx(at,{}),r.jsx(ba.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:r.jsx(ue,{icon:"wm-close",className:"wu-text-lg wu-m-4 wu-cursor-pointer"})}),a&&r.jsx(Pr,{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:a}),e]})]})};function jl({controlled:e,default:t,name:a,state:s="value"}){const{current:o}=g.useRef(e!==void 0),[n,u]=g.useState(t),l=o?e:n;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 ${a} to be ${o?"un":""}controlled.`,"Elements should not switch from uncontrolled to controlled (or vice versa).",`Decide between using a controlled or uncontrolled ${a} 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(`
8
+ `))},[s,a,e]);const{current:d}=g.useRef(t);g.useEffect(()=>{!o&&JSON.stringify(d)!==JSON.stringify(t)&&console.error([`Base UI: A component is changing the default ${s} state of an uncontrolled ${a} after being initialized. To suppress this warning opt to use a controlled ${a}.`].join(`
9
+ `))},[JSON.stringify(t)])}const i=g.useCallback(d=>{o||u(d)},[]);return[l,i]}const qs={};function st(e,t){const a=g.useRef(qs);return a.current===qs&&(a.current=e(t)),a}const Vr=g[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],Gl=Vr&&Vr!==g.useLayoutEffect?Vr:e=>e();function Te(e){const t=st(Yl).current;return t.next=e,Gl(t.effect),t.trampoline}function Yl(){const e={next:void 0,callback:Kl,trampoline:(...t)=>{var a;return(a=e.callback)==null?void 0:a.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 Jl=[];function zs(e){g.useEffect(e,Jl)}const Ct=0;class Yt{constructor(){Wt(this,"currentId",Ct);Wt(this,"clear",()=>{this.currentId!==Ct&&(clearTimeout(this.currentId),this.currentId=Ct)});Wt(this,"disposeEffect",()=>this.clear)}static create(){return new Yt}start(t,a){this.clear(),this.currentId=setTimeout(()=>{this.currentId=Ct,a()},t)}isStarted(){return this.currentId!==Ct}}function Vs(){const e=st(Yt.create).current;return zs(e.disposeEffect),e}const Hs=0;class Hr extends Yt{constructor(){super(...arguments);Wt(this,"clear",()=>{this.currentId!==Hs&&(clearInterval(this.currentId),this.currentId=Hs)})}static create(){return new Hr}start(a,s){this.clear(),this.currentId=setInterval(()=>{s()},a)}}function Xl(){const e=st(Hr.create).current;return zs(e.disposeEffect),e}const ke=typeof document<"u"?g.useLayoutEffect:()=>{};function $s(e){const t=st(Zl,e).current;return t.next=e,ke(t.effect),t}function Zl(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}function Ql(){const[,e]=g.useState({});return g.useCallback(()=>{e({})},[])}function $r(e,t,a,s){const o=st(Us).current;return ei(o,e,t,a,s)&&js(o,[e,t,a,s]),o.callback}function Rl(e){const t=st(Us).current;return ti(t,e)&&js(t,e),t.callback}function Us(){return{callback:null,cleanup:null,refs:[]}}function ei(e,t,a,s,o){return e.refs[0]!==t||e.refs[1]!==a||e.refs[2]!==s||e.refs[3]!==o}function ti(e,t){return e.refs.length!==t.length||e.refs.some((a,s)=>a!==t[s])}function js(e,t){if(e.refs=t,t.every(a=>a==null)){e.callback=null;return}e.callback=a=>{if(e.cleanup&&(e.cleanup(),e.cleanup=null),a!=null){const s=Array(t.length).fill(null);for(let o=0;o<t.length;o+=1){const n=t[o];if(n!=null)switch(typeof n){case"function":{const u=n(a);typeof u=="function"&&(s[o]=u);break}case"object":{n.current=a;break}}}e.cleanup=()=>{for(let o=0;o<t.length;o+=1){const n=t[o];if(n!=null)switch(typeof n){case"function":{const u=s[o];typeof u=="function"?u():n(null);break}case"object":{n.current=null;break}}}}}}}const ri={clip:"rect(0 0 0 0)",overflow:"hidden",whiteSpace:"nowrap",position:"fixed",top:0,left:0,border:0,padding:0,width:1,height:1,margin:-1};function Gs(){return typeof window<"u"}function Ur(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ai(e){return Gs()?e instanceof Element||e instanceof Ur(e).Element:!1}function si(e){return Gs()?e instanceof HTMLElement||e instanceof Ur(e).HTMLElement:!1}function oi(e){return(e==null?void 0:e.ownerDocument)||document}const Kt=typeof navigator<"u",jr=ii(),ni=di(),ui=ci();typeof CSS>"u"||!CSS.supports||CSS.supports("-webkit-backdrop-filter:none");const li=jr.platform==="MacIntel"&&jr.maxTouchPoints>1?!0:/iP(hone|ad|od)|iOS/.test(jr.platform);Kt&&ni.toLowerCase().startsWith("mac")&&navigator.maxTouchPoints,ui.includes("jsdom/");function ii(){if(!Kt)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 ci(){if(!Kt)return"";const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:t,version:a})=>`${t}/${a}`).join(" "):navigator.userAgent}function di(){if(!Kt)return"";const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform??""}function Jt(e,...t){const a=new URL(`https://base-ui.com/production-error/${e}`);return t.forEach(s=>a.searchParams.append("args[]",s)),`Base UI error #${e}; visit ${a} for the full message.`}const Gr=g.createContext(void 0);process.env.NODE_ENV!=="production"&&(Gr.displayName="NumberFieldRootContext");function Xt(){const e=g.useContext(Gr);if(e===void 0)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: NumberFieldRootContext is missing. NumberField parts must be placed within <NumberField.Root>.":Jt(43));return e}function Ie(){}const Le=Object.freeze({});let Ys=(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 wi={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},fi={valid(e){return e===null?null:e?{[Ys.valid]:""}:{[Ys.invalid]:""}}},Ks=g.createContext({invalid:void 0,name:void 0,validityData:{state:wi,errors:[],error:"",value:"",initialValue:null},setValidityData:Ie,disabled:void 0,touched:!1,setTouched:Ie,dirty:!1,setDirty:Ie,filled:!1,setFilled:Ie,focused:!1,setFocused:Ie,validate:()=>null,validationMode:"onSubmit",validationDebounceTime:0,shouldValidateOnChange:()=>!1,state:{disabled:!1,valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},markedDirtyRef:{current:!1},validation:{getValidationProps:(e=Le)=>e,getInputValidationProps:(e=Le)=>e,inputRef:{current:null},commit:async()=>{}}});process.env.NODE_ENV!=="production"&&(Ks.displayName="FieldRootContext");function Yr(e=!0){const t=g.useContext(Ks);if(t.setValidityData===Ie&&!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: FieldRootContext is missing. Field parts must be placed within <Field.Root>.":Jt(28));return t}const pi={...g};let Js=0;function hi(e,t="mui"){const[a,s]=g.useState(e),o=e||a;return g.useEffect(()=>{a==null&&(Js+=1,s(`${t}-${Js}`))},[a,t]),o}const Xs=pi.useId;function bi(e,t){if(Xs!==void 0){const a=Xs();return e??(t?`${t}-${a}`:a)}return hi(e,t)}function gi(e){return bi(e,"base-ui")}const Zs=g.createContext({controlId:void 0,setControlId:Ie,labelId:void 0,setLabelId:Ie,messageIds:[],setMessageIds:Ie,getDescriptionProps:e=>e});process.env.NODE_ENV!=="production"&&(Zs.displayName="LabelableContext");function Qs(){return g.useContext(Zs)}function mi(e={}){const{id:t,implicit:a=!1,controlRef:s}=e,{controlId:o,setControlId:n}=Qs(),u=gi(t);return ke(()=>{if(!(!a&&!t||n===Ie)){if(a){const l=s==null?void 0:s.current;ai(l)&&l.closest("label")!=null?n(t??null):n(o??u)}else t&&n(t);return()=>{t&&n(void 0)}}},[t,s,o,n,a,u]),o??u}const St={inputValue:()=>null,value:()=>null},xi=parseInt(g.version,10);function vi(e){return xi>=e}function Rs(e){if(!g.isValidElement(e))return null;const t=e,a=t.props;return(vi(19)?a==null?void 0:a.ref:t.ref)??null}function Kr(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}function yi(e,t){const a={};for(const s in e){const o=e[s];if(t!=null&&t.hasOwnProperty(s)){const n=t[s](o);n!=null&&Object.assign(a,n);continue}o===!0?a[`data-${s.toLowerCase()}`]="":o&&(a[`data-${s.toLowerCase()}`]=o.toString())}return a}function Ni(e,t){return typeof e=="function"?e(t):e}function Ci(e,t){return typeof e=="function"?e(t):e}const Et={};function eo(e,t,a,s,o){let n={...Jr(e,Et)};return t&&(n=Zt(n,t)),a&&(n=Zt(n,a)),s&&(n=Zt(n,s)),n}function Si(e){if(e.length===0)return Et;if(e.length===1)return Jr(e[0],Et);let t={...Jr(e[0],Et)};for(let a=1;a<e.length;a+=1)t=Zt(t,e[a]);return t}function Zt(e,t){return to(t)?t(e):Ei(e,t)}function Ei(e,t){if(!t)return e;for(const a in t){const s=t[a];switch(a){case"style":{e[a]=Kr(e.style,s);break}case"className":{e[a]=ro(e.className,s);break}default:Ti(a,s)?e[a]=ki(e[a],s):e[a]=s}}return e}function Ti(e,t){const a=e.charCodeAt(0),s=e.charCodeAt(1),o=e.charCodeAt(2);return a===111&&s===110&&o>=65&&o<=90&&(typeof t=="function"||typeof t>"u")}function to(e){return typeof e=="function"}function Jr(e,t){return to(e)?e(t):e??Et}function ki(e,t){return t?e?a=>{if(Ii(a)){const o=a;Xr(o);const n=t(o);return o.baseUIHandlerPrevented||e==null||e(o),n}const s=t(a);return e==null||e(a),s}:t:e}function Xr(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function ro(e,t){return t?e?t+" "+e:t:e}function Ii(e){return e!=null&&typeof e=="object"&&"nativeEvent"in e}function Tt(e,t,a={}){const s=t.render,o=Ai(t,a);if(a.enabled===!1)return null;const n=a.state??Le;return Di(e,s,o,n)}function Ai(e,t={}){const{className:a,style:s,render:o}=e,{state:n=Le,ref:u,props:l,stateAttributesMapping:i,enabled:d=!0}=t,w=d?Ni(a,n):void 0,p=d?Ci(s,n):void 0,b=d?yi(n,i):Le,h=d?Kr(b,Array.isArray(l)?Si(l):l)??Le:Le;return typeof document<"u"&&(d?Array.isArray(u)?h.ref=Rl([h.ref,Rs(o),...u]):h.ref=$r(h.ref,Rs(o),u):$r(null,null)),d?(w!==void 0&&(h.className=ro(h.className,w)),p!==void 0&&(h.style=Kr(h.style,p)),h):Le}function Di(e,t,a,s){if(t){if(typeof t=="function")return t(a,s);const o=eo(a,t.props);return o.ref=a.ref,g.cloneElement(t,o)}if(e&&typeof e=="string")return Mi(e,a);throw new Error(process.env.NODE_ENV!=="production"?"Base UI: Render element or function are not defined.":Jt(8))}function Mi(e,t){return e==="button"?f.createElement("button",{type:"button",...t,key:t.key}):e==="img"?f.createElement("img",{alt:"",...t,key:t.key}):g.createElement(e,t)}const ao=new Map;function kt(e,t){const a=JSON.stringify({locale:e,options:t}),s=ao.get(a);if(s)return s;const o=new Intl.NumberFormat(e,t);return ao.set(a,o),o}function ot(e,t,a){return e==null?"":kt(t,a).format(e)}function so(e,t,a){return ot(e,t,{...a,maximumFractionDigits:20})}const _i=["零","〇","一","二","三","四","五","六","七","八","九"],Fi={零:"0","〇":"0",一:"1",二:"2",三:"3",四:"4",五:"5",六:"6",七:"7",八:"8",九:"9"},oo=["٠","١","٢","٣","٤","٥","٦","٧","٨","٩"],no=["۰","۱","۲","۳","۴","۵","۶","۷","۸","۹"],Zr=["0","1","2","3","4","5","6","7","8","9"],uo=["%","٪","%","﹪"],lo=["‰","؉"],io=["−","-","‒","–","—","﹣"],co=["+","﹢"],Li=".",Wi=",",Pi=new RegExp(`[${oo.join("")}]`,"g"),Oi=new RegExp(`[${no.join("")}]`,"g"),Bi=new RegExp(`[${Zr.join("")}]`,"g"),qi=new RegExp(`[${_i.join("")}]`,"g"),zi=new RegExp(`[${uo.join("")}]`),Vi=new RegExp(`[${lo.join("")}]`),Qr=/[٠١٢٣٤٥٦٧٨٩]/,wo=/[۰۱۲۳۴۵۶۷۸۹]/,Rr=/[零〇一二三四五六七八九]/,fo=new RegExp(`[${Zr.join("")}]`),Hi=[".",",",Li,Wi,"٫","٬"],po=new RegExp("\\p{Zs}","u"),$i=["+",...co],Ui=["-",...io],Qt=e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),ji=e=>e.replace(/[-\\\]^]/g,t=>`\\${t}`),ho=e=>`[${e.map(ji).join("")}]`,bo=ho(["-"].concat(io)),go=ho(["+"].concat(co)),mo=new RegExp(bo,"gu"),xo=new RegExp(go,"gu"),It=new RegExp(bo),Rt=new RegExp(go);function ea(e,t){const a=kt(e,t).formatToParts(11111.1),s={};return a.forEach(o=>{s[o.type]=o.value}),kt(e).formatToParts(.1).forEach(o=>{o.type==="decimal"&&(s[o.type]=o.value)}),s}function nt(e,t,a){if(e==null)return null;let s=String(e).replace(new RegExp("\\p{Cf}","gu"),"").trim();s=s.replace(mo,"-").replace(xo,"+");let o=!1;const n=s.match(/([+-])\s*$/);n&&(n[1]==="-"&&(o=!0),s=s.replace(/([+-])\s*$/,""));const u=s.match(/^\s*([+-])/);u&&(u[1]==="-"&&(o=!0),s=s.replace(/^\s*[+-]/,""));let l=t;l===void 0&&(Qr.test(s)||wo.test(s)?l="ar":Rr.test(s)&&(l="zh"));const{group:i,decimal:d,currency:w}=ea(l,a),p=kt(l,a).formatToParts(1).filter(T=>T.type==="unit").map(T=>Qt(T.value)),b=p.length?new RegExp(p.join("|"),"g"):null;let h=null;i&&(new RegExp("\\p{Zs}","u").test(i)?h=new RegExp("\\p{Zs}","gu"):i==="'"||i==="’"?h=/['’]/g:h=new RegExp(Qt(i),"g"));let m=[{regex:i?h:null,replacement:""},{regex:d?new RegExp(Qt(d),"g"):null,replacement:"."},{regex:/./g,replacement:"."},{regex:/,/g,replacement:""},{regex:/٫/g,replacement:"."},{regex:/٬/g,replacement:""},{regex:w?new RegExp(Qt(w),"g"):null,replacement:""},{regex:b,replacement:""},{regex:Pi,replacement:T=>String(oo.indexOf(T))},{regex:Oi,replacement:T=>String(no.indexOf(T))},{regex:Bi,replacement:T=>String(Zr.indexOf(T))},{regex:qi,replacement:T=>Fi[T]}].reduce((T,{regex:D,replacement:F})=>D?T.replace(D,F):T,s);const C=m.lastIndexOf(".");if(C!==-1&&(m=`${m.slice(0,C).replace(/\./g,"")}.${m.slice(C+1).replace(/\./g,"")}`),/^[-+]?Infinity$/i.test(s)||/[∞]/.test(s))return null;const E=(o?"-":"")+m;let y=parseFloat(E);const S=a==null?void 0:a.style,N=S==="unit"&&(a==null?void 0:a.unit)==="percent",k=zi.test(e)||S==="percent";return Vi.test(e)?y/=1e3:!N&&k&&(y/=100),Number.isNaN(y)?null:y}const Gi=60,Yi=400,Ki=50,Ji=3,Xi=8,er=1;function Zi(e,t=Number.MIN_SAFE_INTEGER,a=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,a))}const Qi=1e-10;function Ri(e){const t=kt("en-US").resolvedOptions(),a=(e==null?void 0:e.minimumFractionDigits)??t.minimumFractionDigits??0;return{maximumFractionDigits:Math.max((e==null?void 0:e.maximumFractionDigits)??t.maximumFractionDigits??20,a),minimumFractionDigits:a}}function ec(e,t){if(!Number.isFinite(e))return e;const a=Math.min(Math.max(t,0),20);return Number(e.toFixed(a))}function ta(e,t){const{maximumFractionDigits:a}=Ri(t);return ec(e,a)}function tc(e,t,a,s="directional"){if(a===0)return e;const o=Math.abs(a),n=Math.sign(a),u=o*Qi*n,l=s==="nearest"?a:o,i=(e-t+u)/l;let d;return s==="nearest"?d=Math.round(i):n>0?d=Math.floor(i):d=Math.ceil(i),t+d*(s==="nearest"?a:o)}function rc(e,{step:t,minWithDefault:a,maxWithDefault:s,minWithZeroDefault:o,format:n,snapOnStep:u,small:l}){if(e===null)return e;const i=Zi(e,a,s);if(t!=null&&u){if(t===0)return ta(i,n);let d=o;!l&&a!==Number.MIN_SAFE_INTEGER&&(d=a);const w=tc(i,d,t,l?"nearest":"directional");return ta(w,n)}return ta(i,n)}const ac="none",vo="input-change",ra="input-clear",yo="input-blur",sc="input-paste",At="keyboard";function Ae(e,t,a,s){let o=!1,n=!1;const u=s??Le;return{reason:e,event:t??new Event("base-ui"),cancel(){o=!0},allowPropagation(){n=!0},get isCanceled(){return o},get isPropagationAllowed(){return n},trigger:a,...u}}function Dt(e,t,a){const s=Le;return{reason:e,event:t??new Event("base-ui"),...s}}const No=g.forwardRef(function(t,a){const{id:s,min:o,max:n,smallStep:u=.1,step:l=1,largeStep:i=10,required:d=!1,disabled:w=!1,readOnly:p=!1,name:b,defaultValue:h,value:x,onValueChange:m,onValueCommitted:C,allowWheelScrub:E=!1,snapOnStep:y=!1,format:S,locale:N,render:k,className:A,inputRef:T,...D}=t,{setDirty:F,validityData:W,disabled:_,setFilled:z,invalid:P,name:G,state:q,validation:oe,shouldValidateOnChange:M}=Yr(),H=_||w,U=G??b,[O,ae]=g.useState(!1),te=o??Number.MIN_SAFE_INTEGER,pe=n??Number.MAX_SAFE_INTEGER,We=o??0,$=S==null?void 0:S.style,I=g.useRef(null),V=$r(T,oe.inputRef),K=mi({id:s}),[L,Z]=jl({controlled:x,default:h,name:"NumberField",state:"value"}),B=L??null,we=$s(B);ke(()=>{z(B!==null)},[z,B]);const he=Ql(),be=$s(S),de=g.useRef(!1),De=Te((J,Y)=>{de.current=!1,C==null||C(J,Y)}),Be=Vs(),ut=Xl(),lt=Vs(),ur=g.useRef(!1),lr=g.useRef(0),Ye=g.useRef(!0),it=g.useRef(null),Ke=g.useRef(()=>{}),[re,Pe]=g.useState(()=>x!==void 0?Co(B,N,S):ot(B,N,S)),[ir,bd]=g.useState("numeric"),gn=Te(()=>{const{decimal:J,group:Y,currency:ne,literal:ie}=ea(N,S),Q=new Set;Hi.forEach(Ne=>Q.add(Ne)),J&&Q.add(J),Y&&(Q.add(Y),po.test(Y)&&Q.add(" "));const Me=$==="percent"||$==="unit"&&(S==null?void 0:S.unit)==="percent",Lt=$==="percent"||$==="unit"&&(S==null?void 0:S.unit)==="permille";return Me&&uo.forEach(Ne=>Q.add(Ne)),Lt&&lo.forEach(Ne=>Q.add(Ne)),$==="currency"&&ne&&Q.add(ne),ie&&(Array.from(ie).forEach(Ne=>Q.add(Ne)),po.test(ie)&&Q.add(" ")),$i.forEach(Ne=>Q.add(Ne)),te<0&&Ui.forEach(Ne=>Q.add(Ne)),Q}),ct=Te(J=>J!=null&&J.altKey?u:J!=null&&J.shiftKey?i:l),cr=Te((J,Y)=>{const ne=Y.event,ie=Y.direction,Q=rc(J,{step:ie?ct(ne)*ie:void 0,format:be.current,minWithDefault:te,maxWithDefault:pe,minWithZeroDefault:We,snapOnStep:y,small:(ne==null?void 0:ne.altKey)??!1});if(Q!==B||J!==B||Ye.current===!1){if(it.current=Q,m==null||m(Q,Y),Y.isCanceled)return;Z(Q),F(Q!==W.initialValue),de.current=!0}Ye.current&&Pe(ot(Q,N,S)),he()}),Ft=Te((J,{direction:Y,currentValue:ne,event:ie,reason:Q})=>{const Me=ne??we.current,Lt=typeof Me=="number"?Me+J*Y:Math.max(0,o??0);cr(Lt,Ae(Q,ie,void 0,{direction:Y}))}),dt=Te(()=>{lt.clear(),Be.clear(),ut.clear(),Ke.current(),lr.current=0}),mn=Te((J,Y)=>{if(dt(),!I.current)return;const ne=Ur(I.current);function ie(Me){Me.preventDefault()}ne.addEventListener("contextmenu",ie),Ke.current=()=>{ne.removeEventListener("contextmenu",ie)},ne.addEventListener("pointerup",Me=>{ur.current=!1,dt();const Lt=it.current??we.current;De(Lt,Dt(J?"increment":"decrement",Me))},{once:!0});function Q(){const Me=ct(Y)??er;Ft(Me,{direction:J?1:-1,event:Y,reason:J?"increment-press":"decrement-press"})}Q(),Be.start(Yi,()=>{ut.start(Gi,Q)})});ke(function(){if(!Ye.current)return;const Y=x!==void 0?Co(B,N,S):ot(B,N,S);Y!==re&&Pe(Y)}),ke(function(){if(!li)return;let Y="text";te>=0&&(Y="decimal"),bd(Y)},[te,$]),g.useEffect(()=>()=>dt(),[dt]),g.useEffect(function(){const Y=I.current;if(H||p||!E||!Y)return;function ne(ie){if(ie.ctrlKey||oi(I.current).activeElement!==I.current)return;ie.preventDefault();const Q=ct(ie)??er;Ft(Q,{direction:ie.deltaY>0?-1:1,event:ie,reason:"wheel"})}return Y.addEventListener("wheel",ne),()=>{Y.removeEventListener("wheel",ne)}},[E,Ft,H,p,i,l,ct]);const pa=g.useMemo(()=>({...q,disabled:H,readOnly:p,required:d,value:B,inputValue:re,scrubbing:O}),[q,H,p,d,B,re,O]),gd=g.useMemo(()=>({inputRef:I,inputValue:re,value:B,startAutoChange:mn,stopAutoChange:dt,minWithDefault:te,maxWithDefault:pe,disabled:H,readOnly:p,id:K,setValue:cr,incrementValue:Ft,getStepAmount:ct,allowInputSyncRef:Ye,formatOptionsRef:be,valueRef:we,lastChangedValueRef:it,hasPendingCommitRef:de,isPressedRef:ur,intentionalTouchCheckTimeout:lt,movesAfterTouchRef:lr,name:U,required:d,invalid:P,inputMode:ir,getAllowedNonNumericKeys:gn,min:o,max:n,setInputValue:Pe,locale:N,isScrubbing:O,setIsScrubbing:ae,state:pa,onValueCommitted:De}),[I,re,B,mn,dt,te,pe,H,p,K,cr,Ft,ct,be,we,lt,U,d,P,ir,gn,o,n,Pe,N,O,pa,De]),md=Tt("div",t,{ref:a,state:pa,props:D,stateAttributesMapping:St});return r.jsxs(Gr.Provider,{value:gd,children:[md,r.jsx("input",{...oe.getInputValidationProps({onChange(J){if(J.nativeEvent.defaultPrevented)return;const Y=J.currentTarget.valueAsNumber,ne=Number.isNaN(Y)?null:Y,ie=Ae(ac,J.nativeEvent);F(ne!==W.initialValue),cr(ne,ie),M()&&oe.commit(ne)}}),ref:V,type:"number",name:U,value:B??"",min:o,max:n,step:l,disabled:H,required:d,"aria-hidden":!0,tabIndex:-1,style:ri})]})});process.env.NODE_ENV!=="production"&&(No.displayName="NumberFieldRoot");function Co(e,t,a){return(a==null?void 0:a.maximumFractionDigits)!=null||(a==null?void 0:a.minimumFractionDigits)!=null?ot(e,t,a):so(e,t,a)}const So=g.forwardRef(function(t,a){const{render:s,className:o,...n}=t,{state:u}=Xt();return Tt("div",t,{ref:a,state:u,props:[{role:"group"},n],stateAttributesMapping:St})});process.env.NODE_ENV!=="production"&&(So.displayName="NumberFieldGroup");let aa;process.env.NODE_ENV!=="production"&&(aa=new Set);function Eo(...e){if(process.env.NODE_ENV!=="production"){const t=e.join(" ");aa.has(t)||(aa.add(t),console.error(`Base UI: ${t}`))}}const To=g.createContext(void 0);process.env.NODE_ENV!=="production"&&(To.displayName="CompositeRootContext");function oc(e=!1){const t=g.useContext(To);if(t===void 0&&!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: CompositeRootContext is missing. Composite parts must be placed within <Composite.Root>.":Jt(16));return t}function nc(e){const{focusableWhenDisabled:t,disabled:a,composite:s=!1,tabIndex:o=0,isNativeButton:n}=e,u=s&&t!==!1,l=s&&t===!1;return{props:g.useMemo(()=>{const d={onKeyDown(w){a&&t&&w.key!=="Tab"&&w.preventDefault()}};return s||(d.tabIndex=o,!n&&a&&(d.tabIndex=t?o:-1)),(n&&(t||u)||!n&&a)&&(d["aria-disabled"]=a),n&&(!t||l)&&(d.disabled=a),d},[s,a,t,u,l,n,o])}}function ko(e={}){const{disabled:t=!1,focusableWhenDisabled:a,tabIndex:s=0,native:o=!0}=e,n=g.useRef(null),u=oc(!0)!==void 0,l=Te(()=>{const b=n.current;return!!((b==null?void 0:b.tagName)==="A"&&(b!=null&&b.href))}),{props:i}=nc({focusableWhenDisabled:a,disabled:t,composite:u,tabIndex:s,isNativeButton:o});process.env.NODE_ENV!=="production"&&g.useEffect(()=>{if(!n.current)return;const b=n.current.tagName==="BUTTON";o?b||Eo("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&&Eo("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 d=g.useCallback(()=>{const b=n.current;uc(b)&&u&&t&&i.disabled===void 0&&b.disabled&&(b.disabled=!1)},[t,i.disabled,u]);ke(d,[d]);const w=g.useCallback((b={})=>{const{onClick:h,onMouseDown:x,onKeyUp:m,onKeyDown:C,onPointerDown:E,...y}=b;return eo({type:o?"button":void 0,onClick(N){if(t){N.preventDefault();return}h==null||h(N)},onMouseDown(N){t||x==null||x(N)},onKeyDown(N){if(t||(Xr(N),C==null||C(N)),N.baseUIHandlerPrevented)return;const k=N.target===N.currentTarget&&!o&&!l()&&!t,A=N.key==="Enter",T=N.key===" ";k&&((T||A)&&N.preventDefault(),A&&(h==null||h(N)))},onKeyUp(N){t||(Xr(N),m==null||m(N)),!N.baseUIHandlerPrevented&&N.target===N.currentTarget&&!o&&!t&&N.key===" "&&(h==null||h(N))},onPointerDown(N){if(t){N.preventDefault();return}E==null||E(N)}},o?void 0:{role:"button"},i,y)},[t,i,o,l]),p=Te(b=>{n.current=b,d()});return{getButtonProps:w,buttonRef:p}}function uc(e){return si(e)&&e.tagName==="BUTTON"}function Io(e){const{allowInputSyncRef:t,disabled:a,formatOptionsRef:s,getStepAmount:o,id:n,incrementValue:u,inputRef:l,inputValue:i,intentionalTouchCheckTimeout:d,isIncrement:w,isPressedRef:p,locale:b,maxWithDefault:h,minWithDefault:x,movesAfterTouchRef:m,readOnly:C,setValue:E,startAutoChange:y,stopAutoChange:S,value:N,valueRef:k,lastChangedValueRef:A,onValueCommitted:T}=e,D=g.useRef({x:0,y:0}),F=g.useRef(!1),W=g.useRef(!1),_=g.useRef(""),z=N!=null&&N<=x,P=N!=null&&N>=h,G=w?"increment-press":"decrement-press";function q(M){t.current=!0;const H=nt(i,b,s.current);H!==null&&(k.current=H,E(H,Ae(G,M,void 0,{direction:w?1:-1})))}return{disabled:a||(w?P:z),"aria-readonly":C||void 0,"aria-label":w?"Increase":"Decrease","aria-controls":n,tabIndex:-1,style:{WebkitUserSelect:"none",userSelect:"none"},onTouchStart(){F.current=!0},onTouchEnd(){F.current=!1},onClick(M){const H=a||C||(w?P:z);if(M.defaultPrevented||H||(_.current==="touch"?W.current:M.detail!==0))return;q(M.nativeEvent);const U=o(M)??er,O=k.current;u(U,{direction:w?1:-1,event:M.nativeEvent,reason:G});const ae=A.current??k.current;ae!==O&&T(ae,Dt(G,M.nativeEvent))},onPointerDown(M){var O;const H=!M.button||M.button===0,U=a||(w?P:z);M.defaultPrevented||C||!H||U||(_.current=M.pointerType,W.current=!1,p.current=!0,D.current={x:M.clientX,y:M.clientY},q(M.nativeEvent),M.pointerType!=="touch"?(M.preventDefault(),(O=l.current)==null||O.focus(),y(w,M)):d.start(Ki,()=>{const ae=m.current;m.current=0,p.current&&ae!=null&&ae<Ji?(y(w,M),W.current=!0):(W.current=!1,S())}))},onPointerUp(M){M.pointerType==="touch"&&(p.current=!1)},onPointerMove(M){if(a||C||(w?P:z)||M.pointerType!=="touch"||!p.current)return;m.current!=null&&(m.current+=1);const{x:U,y:O}=D.current,ae=U-M.clientX,te=O-M.clientY;ae**2+te**2>Xi**2&&S()},onMouseEnter(M){const H=a||C||(w?P:z);M.defaultPrevented||H||!p.current||F.current||_.current==="touch"||y(w,M)},onMouseLeave(){F.current||S()},onMouseUp(){F.current||S()}}}const Ao=g.forwardRef(function(t,a){const{render:s,className:o,disabled:n=!1,nativeButton:u=!0,...l}=t,{allowInputSyncRef:i,disabled:d,formatOptionsRef:w,getStepAmount:p,id:b,incrementValue:h,inputRef:x,inputValue:m,intentionalTouchCheckTimeout:C,isPressedRef:E,locale:y,maxWithDefault:S,minWithDefault:N,movesAfterTouchRef:k,readOnly:A,setValue:T,startAutoChange:D,state:F,stopAutoChange:W,value:_,valueRef:z,lastChangedValueRef:P,onValueCommitted:G}=Xt(),q=n||d,oe=Io({isIncrement:!0,inputRef:x,startAutoChange:D,stopAutoChange:W,minWithDefault:N,maxWithDefault:S,value:_,inputValue:m,disabled:q,readOnly:A,id:b,setValue:T,getStepAmount:p,incrementValue:h,allowInputSyncRef:i,formatOptionsRef:w,valueRef:z,isPressedRef:E,intentionalTouchCheckTimeout:C,movesAfterTouchRef:k,locale:y,lastChangedValueRef:P,onValueCommitted:G}),{getButtonProps:M,buttonRef:H}=ko({disabled:q,native:u}),U=g.useMemo(()=>({...F,disabled:q}),[F,q]);return Tt("button",t,{ref:[a,H],state:U,props:[oe,l,M],stateAttributesMapping:St})});process.env.NODE_ENV!=="production"&&(Ao.displayName="NumberFieldIncrement");const Do=g.forwardRef(function(t,a){const{render:s,className:o,disabled:n=!1,nativeButton:u=!0,...l}=t,{allowInputSyncRef:i,disabled:d,formatOptionsRef:w,getStepAmount:p,id:b,incrementValue:h,inputRef:x,inputValue:m,intentionalTouchCheckTimeout:C,isPressedRef:E,maxWithDefault:y,minWithDefault:S,movesAfterTouchRef:N,readOnly:k,setValue:A,startAutoChange:T,state:D,stopAutoChange:F,value:W,valueRef:_,locale:z,lastChangedValueRef:P,onValueCommitted:G}=Xt(),q=n||d,oe=Io({isIncrement:!1,inputRef:x,startAutoChange:T,stopAutoChange:F,minWithDefault:S,maxWithDefault:y,value:W,inputValue:m,disabled:q,readOnly:k,id:b,setValue:A,getStepAmount:p,incrementValue:h,allowInputSyncRef:i,formatOptionsRef:w,valueRef:_,isPressedRef:E,intentionalTouchCheckTimeout:C,movesAfterTouchRef:N,locale:z,lastChangedValueRef:P,onValueCommitted:G}),{getButtonProps:M,buttonRef:H}=ko({disabled:q,native:u}),U=g.useMemo(()=>({...D,disabled:q}),[D,q]);return Tt("button",t,{ref:[a,H],state:U,props:[oe,l,M],stateAttributesMapping:St})});process.env.NODE_ENV!=="production"&&(Do.displayName="NumberFieldDecrement");function lc(e){e.preventDefault(),e.stopPropagation()}function ic(e,t){return{...e,state:{...e.state,valid:!t&&e.state.valid}}}const Mo=g.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:Ie,validationMode:"onSubmit",submitAttemptedRef:{current:!1}});process.env.NODE_ENV!=="production"&&(Mo.displayName="FormContext");function _o(){return g.useContext(Mo)}function cc(e){const{enabled:t=!0,value:a,id:s,name:o,controlRef:n,commit:u}=e,{formRef:l}=_o(),{invalid:i,markedDirtyRef:d,validityData:w,setValidityData:p}=Yr(),b=Te(e.getValue);ke(()=>{if(!t)return;let h=a;h===void 0&&(h=b()),w.initialValue===null&&h!==null&&p(x=>({...x,initialValue:h}))},[t,p,a,w.initialValue,b]),ke(()=>{!t||!s||l.current.fields.set(s,{getValue:b,name:o,controlRef:n,validityData:ic(w,i),validate(){let h=a;h===void 0&&(h=b()),d.current=!0,zn.flushSync(()=>u(h))}})},[u,n,t,l,b,s,i,d,o,w,a]),ke(()=>{const h=l.current.fields;return()=>{s&&h.delete(s)}},[l,s])}function dc(e,t){const a=g.useRef(e),s=Te(t);ke(()=>{a.current!==e&&s(a.current)},[e,s]),ke(()=>{a.current=e},[e])}const wc={...fi,...St},fc=new Set(["Backspace","Delete","ArrowLeft","ArrowRight","Tab","Enter","Escape"]),Fo=g.forwardRef(function(t,a){const{render:s,className:o,...n}=t,{allowInputSyncRef:u,disabled:l,formatOptionsRef:i,getAllowedNonNumericKeys:d,getStepAmount:w,id:p,incrementValue:b,inputMode:h,inputValue:x,max:m,min:C,name:E,readOnly:y,required:S,setValue:N,state:k,setInputValue:A,locale:T,inputRef:D,value:F,onValueCommitted:W,lastChangedValueRef:_,hasPendingCommitRef:z,valueRef:P}=Xt(),{clearErrors:G}=_o(),{validationMode:q,setTouched:oe,setFocused:M,invalid:H,shouldValidateOnChange:U,validation:O}=Yr(),{labelId:ae}=Qs(),te=g.useRef(!1),pe=g.useRef(!1);return cc({id:p,commit:O.commit,value:F,controlRef:D,name:E,getValue:()=>F??null}),dc(F,I=>{const V=U();if(G(E),V&&O.commit(F),!(I===F||V)){if(pe.current){pe.current=!1;return}O.commit(F,!0)}}),Tt("input",t,{ref:[a,D],state:k,props:[{id:p,required:S,disabled:l,readOnly:y,inputMode:h,value:x,type:"text",autoComplete:"off",autoCorrect:"off",spellCheck:"false","aria-roledescription":"Number field","aria-invalid":H||void 0,"aria-labelledby":ae,suppressHydrationWarning:!0,onFocus(I){if(I.defaultPrevented||y||l||te.current)return;te.current=!0,M(!0);const V=I.currentTarget,K=V.value.length;V.setSelectionRange(K,K)},onBlur(I){if(I.defaultPrevented||y||l)return;oe(!0),M(!1);const V=!u.current,K=z.current;if(u.current=!0,x.trim()===""){N(null,Ae(ra,I.nativeEvent)),q==="onBlur"&&O.commit(null),W(null,Dt(ra,I.nativeEvent));return}const L=i.current,Z=nt(x,T,L);if(Z===null)return;const B=(L==null?void 0:L.maximumFractionDigits)!=null||(L==null?void 0:L.minimumFractionDigits)!=null,we=L==null?void 0:L.maximumFractionDigits,he=B&&typeof we=="number"?Number(Z.toFixed(we)):Z,be=Dt(yo,I.nativeEvent),de=F!==he,De=V||de||K;q==="onBlur"&&O.commit(he),de&&(pe.current=!0,N(he,Ae(yo,I.nativeEvent))),De&&W(he,be);const Be=ot(he,T,L),ut=so(Z,T,L);!(!B&&Z===F&&x===ut)&&x!==Be&&A(Be)},onChange(I){if(I.nativeEvent.defaultPrevented)return;u.current=!1;const V=I.target.value;if(V.trim()===""){A(V),N(null,Ae(ra,I.nativeEvent));return}const K=d();if(!Array.from(V).every(B=>{const we=B>="0"&&B<="9",he=Qr.test(B),be=Rr.test(B),de=wo.test(B),De=fo.test(B),Be=It.test(B);return we||he||be||de||De||Be||K.has(B)}))return;if(I.isTrusted){A(V);const B=nt(V,T,i.current);B!==null&&N(B,Ae(vo,I.nativeEvent));return}const Z=nt(V,T,i.current);Z!==null&&(A(V),N(Z,Ae(vo,I.nativeEvent)))},onKeyDown(I){if(I.defaultPrevented||y||l)return;const V=I.nativeEvent;u.current=!0;const K=d();let L=K.has(I.key);const{decimal:Z,currency:B,percentSign:we}=ea(T,i.current),he=I.currentTarget.selectionStart,be=I.currentTarget.selectionEnd,de=he===0&&be===x.length,De=re=>he!=null&&be!=null&&re>=he&&re<be;if(It.test(I.key)&&Array.from(K).some(re=>It.test(re||""))){const re=x.search(mo),Pe=re!=null&&re!==-1&&De(re);L=!(It.test(x)||Rt.test(x))||de||Pe}if(Rt.test(I.key)&&Array.from(K).some(re=>Rt.test(re||""))){const re=x.search(xo),Pe=re!=null&&re!==-1&&De(re);L=!(It.test(x)||Rt.test(x))||de||Pe}[Z,B,we].forEach(re=>{if(I.key===re){const Pe=x.indexOf(re),ir=De(Pe);L=!x.includes(re)||de||ir}});const Be=I.key>="0"&&I.key<="9",ut=Qr.test(I.key),lt=Rr.test(I.key),ur=fo.test(I.key),lr=fc.has(I.key);if(I.which===229||I.altKey||I.ctrlKey||I.metaKey||L||Be||ut||ur||lt||lr)return;const Ye=nt(x,T,i.current),it=w(I)??er;lc(I);const Ke=Dt(At,V);I.key==="ArrowUp"?(b(it,{direction:1,currentValue:Ye,event:V,reason:At}),W(_.current??P.current,Ke)):I.key==="ArrowDown"?(b(it,{direction:-1,currentValue:Ye,event:V,reason:At}),W(_.current??P.current,Ke)):I.key==="Home"&&C!=null?(N(C,Ae(At,V)),W(_.current??P.current,Ke)):I.key==="End"&&m!=null&&(N(m,Ae(At,V)),W(_.current??P.current,Ke))},onPaste(I){if(I.defaultPrevented||y||l)return;I.preventDefault();const K=(I.clipboardData||window.Clipboard).getData("text/plain"),L=nt(K,T,i.current);L!==null&&(u.current=!1,N(L,Ae(sc,I.nativeEvent)),A(K))}},O.getValidationProps(),n],stateAttributesMapping:wc})});process.env.NODE_ENV!=="production"&&(Fo.displayName="NumberFieldInput");const pc={wuStepper:"_wuStepper_apbnq_1"},hc=({onChange:e,Label:t,defaultValue:a=0,readonly:s,dir:o,step:n=1,min:u,max:l,value:i,className:d,labelPosition:w="left",disabled:p,resetInvalidValueOnBlur:b=!0,...h})=>{const x=g.useId(),[m,C]=g.useState(i!==void 0?Number(i):a||0);g.useEffect(()=>{i!==void 0&&C(Number(i))},[i]);const E=T=>{C(T),e==null||e(T)},y=T=>{const D=Number(T.target.value);Number.isNaN(D)||C(D)},S=()=>{b&&(u!==void 0&&m<u?(C(u),e==null||e(u)):l!==void 0&&m>l&&(C(l),e==null||e(l)))};g.useEffect(()=>{i&&a&&console.warn("As both value and defaultValue are passed, value will be used")},[i,a]);const N={inc:s||l!==void 0&&m>=l||p,dec:s||u!==void 0&&m<=u||p},k=u!==void 0&&m<u||l!==void 0&&m>l,A=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 r.jsxs(No,{id:x,value:m,step:n,readOnly:s,onValueChange:T=>typeof T=="number"&&E(T),dir:o,className:c("wu-flex wu-stepper",o==="rtl"&&w!=="top"&&"wu-gap-2",pc.wuStepper,bc({labelPosition:w}),d),children:[t&&r.jsx(xe,{htmlFor:x,className:"wu-input-label",children:t}),r.jsxs(So,{className:"wu-flex wu-max-w-[97px] wu-relative",children:[r.jsx(Do,{"aria-label":"decrement",className:c(A,o==="rtl"?"wu-right-0":"wu-left-0","wu-stepper-button"),disabled:N.dec,children:r.jsx("span",{className:"wu-text-base wm-minimize"})}),r.jsx(Fo,{"aria-label":"stepper",role:"spinbutton",type:"text","aria-invalid":k||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",k&&"wu-border-red-deep focus:wu-border-red-deep","wu-stepper-input"),readOnly:s,onChange:y,onBlur:S,disabled:p,min:u,max:l,step:n,value:m,...h}),r.jsx(Ao,{"aria-label":"increment",className:c(A,o==="rtl"?"wu-left-0":"wu-right-0","wu-stepper-button"),disabled:N.inc,children:r.jsx("span",{className:"wu-text-base wm-add"})})]})]})},bc=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"}}}),Lo=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"}}),gc=g.forwardRef(({className:e,variant:t,size:a,...s},o)=>r.jsx(va.Root,{ref:o,className:c(Lo({variant:t,size:a,className:e})),...s}));gc.displayName=va.Root.displayName;const Wo=g.createContext({size:"default",variant:"default"}),tr=g.forwardRef(({className:e,variant:t,size:a,children:s,...o},n)=>r.jsx(Ot.Root,{ref:n,className:c("wu-flex wu-items-center wu-justify-center wu-gap-1",e),...o,children:r.jsx(Wo.Provider,{value:{variant:t,size:a},children:s})}));tr.displayName=Ot.Root.displayName;const Ge=g.forwardRef(({className:e,children:t,variant:a,size:s,...o},n)=>{const u=g.useContext(Wo);return r.jsx(Ot.Item,{ref:n,className:c(Lo({variant:u.variant||a,size:u.size||s}),e),...o,children:t})});Ge.displayName=Ot.Item.displayName;const Po=f.forwardRef((e,t)=>{const{options:a,value:s,disabled:o,dir:n,onChange:u}=e,l=i=>c("wu-w-8 wu-h-8 wu-text-xl wu-leading-5 wu-rounded-full wu-text-gray-lead wu-relative wu-z-10 wu-p-0 wu-flex wu-items-center wu-justify-center",o&&"wu-cursor-not-allowed data-[state=on]:wu-text-gray-lead",i===s&&"wu-text-white",o&&s===i&&"wu-text-gray-lead","wu-switcher-icon-tab-item");return r.jsx(r.Fragment,{children:r.jsxs(tr,{ref:t,type:"single",value:s,onValueChange:u,disabled:o,dir:n,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:[r.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"&&n!=="rtl"&&"wu-translate-x-full",s==="opt2"&&n==="rtl"&&"-wu-translate-x-full",o&&"wu-bg-gray-40","wu-switcher-icon-tab-slider")}),r.jsx(Ge,{value:"opt1",className:l("opt1"),children:a[0].label}),r.jsx(Ge,{value:"opt2",className:l("opt2"),children:a[1].label})]})})});Po.displayName="_IconTab";const Oo=f.forwardRef((e,t)=>{const{options:a,value:s,disabled:o,dir:n,size:u="md",onChange:l}=e,i=d=>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",u==="sm"&&"wu-h-6 wu-min-w-20",u==="md"&&"wu-h-8 wu-min-w-28",u==="lg"&&"wu-h-10 wu-min-w-36",d===s&&"wu-text-white wu-font-medium",o&&s===d&&"wu-text-gray-lead","wu-switcher-tab-item");return r.jsx(r.Fragment,{children:r.jsxs(tr,{ref:t,type:"single",value:s,onValueChange:l,disabled:o,dir:n,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:[r.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 ",u==="sm"&&"wu-h-6 wu-min-w-20",u==="md"&&"wu-h-8 wu-min-w-28",u==="lg"&&"wu-h-10 wu-min-w-36",s==="opt1"&&"",s==="opt2"&&n!=="rtl"&&"wu-translate-x-full",s==="opt2"&&n==="rtl"&&"-wu-translate-x-full",o&&"wu-bg-gray-40","wu-switcher-tab-slider")}),r.jsx(Ge,{value:"opt1",className:i("opt1"),children:r.jsx("div",{className:"wu-min-w-16 wu-max-w-[136px] wu-overflow-hidden wu-text-ellipsis wu-text-nowrap",children:a[0].label})}),r.jsx(Ge,{value:"opt2",className:i("opt2"),children:r.jsx("div",{className:"wu-min-w-16 wu-max-w-[136px] wu-overflow-hidden wu-text-ellipsis wu-text-nowrap",children:a[1].label})})]})})});Oo.displayName="_Tab";const Bo=f.forwardRef((e,t)=>{const{options:a,value:s,disabled:o,dir:n,onChange:u}=e,l=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"),i=c("wu-w-fit wu-gap-2",o&&"wu-cursor-not-allowed","wu-switcher-toggle-group"),d=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"),w=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"&&n!=="rtl"&&"-wu-translate-x-[10px]",s==="opt1"&&n==="rtl"&&"wu-translate-x-[10px]",s==="opt2"&&n!=="rtl"&&"wu-translate-x-[10px]",s==="opt2"&&n==="rtl"&&"-wu-translate-x-[10px]",o&&"wu-hidden","wu-switcher-toggle-knob");return r.jsx(r.Fragment,{children:r.jsxs(tr,{ref:t,type:"single",value:s,disabled:o,dir:n,className:i,onValueChange:u,children:[r.jsx(Ge,{value:"opt1",className:l("opt1"),children:r.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:a[0].label})}),r.jsx("button",{onClick:()=>u(s==="opt1"?"opt2":"opt1"),className:d,disabled:o,"aria-label":"knob",dir:n,children:r.jsx("div",{className:w,role:"knob",dir:n})}),r.jsx(Ge,{value:"opt2",className:l("opt2"),children:r.jsx("div",{className:"wu-max-w-[136px] wu-overflow-hidden wu-text-ellipsis wu-text-nowrap wu-switcher-toggle-item-label",children:a[1].label})})]})})});Bo.displayName="_Toggle";const qo=f.forwardRef((e,t)=>{const{type:a,options:s,value:o,disabled:n,dir:u,size:l,onChange:i,toggle:d=!0,...w}=e,[p,b]=f.useState(),h=x=>{let m=p;x!==""?m=x:d&&(m=p==="opt1"?"opt2":"opt1");const C=m==="opt1"?s[0].value:s[1].value;i&&i(C),b(m)};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 r.jsx(r.Fragment,{});switch(a){case"toggle":return r.jsx(Bo,{...w,ref:t,options:s,value:p||"opt1",onChange:h,disabled:n,dir:u});case"iconTab":return r.jsx(Po,{ref:t,options:s,value:p||"opt1",onChange:h,disabled:n,dir:u});default:return r.jsx(Oo,{ref:t,options:s,value:p||"opt1",onChange:h,disabled:n,dir:u,size:l})}});qo.displayName="WuSwitcher";const zo=$e.Root,sa=g.forwardRef(({className:e,children:t,...a},s)=>r.jsx($e.List,{className:c("wu-relative wu-flex",e),...a,ref:s,children:t}));sa.displayName=$e.List.displayName;const oa=g.forwardRef(({className:e,...t},a)=>r.jsx($e.Trigger,{ref:a,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}));oa.displayName=$e.Trigger.displayName;const Vo=g.forwardRef(({className:e,...t},a)=>r.jsx($e.Content,{ref:a,className:e,...t}));Vo.displayName=$e.Content.displayName;const Ho=({items:e,enableAnimation:t})=>{const a="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 r.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=>r.jsx(Vo,{value:s.value,forceMount:t||void 0,className:c("wu-w-full wu-h-full wu-overflow-y-auto",t&&a,"wu-tab-content"),children:s.Content},s.value))})},mc=e=>{const[t,a]=f.useState(!1),[s,o]=f.useState(!1),n=()=>{const l=e.current;l&&(a(l.scrollLeft>0),o(l.scrollLeft+l.clientWidth<l.scrollWidth))};return f.useEffect(()=>{const l=e.current;return n(),l&&l.addEventListener("scroll",n),window.addEventListener("resize",n),()=>{l&&l.removeEventListener("scroll",n),window.removeEventListener("resize",n)}},[e]),{showLeftArrow:t,showRightArrow:s,scrollByTab:l=>{const i=e.current;if(i){const d=(l==="right"?i.clientWidth:-i.clientWidth)*.8;i.scrollBy({left:d,behavior:"smooth"})}}}},$o=(e,t)=>{const[a,s]=f.useState({width:0,left:0,height:0,top:0}),o=t==="vertical";return f.useEffect(()=>{const n=e.current;if(n){const u=()=>{const i=n.querySelector('[data-state="active"]');if(i){const d={width:o?2:i.offsetWidth,left:o?0:i.offsetLeft,height:o?i.offsetHeight:1,top:o?i.offsetTop:0};s(d)}},l=new MutationObserver(u);return l.observe(n,{attributes:!0,subtree:!0}),u(),()=>{l.disconnect()}}},[e,o]),a},xc=({items:e,value:t,defaultValue:a,onValueChange:s,enableAnimation:o=!1,className:n,dir:u="ltr",position:l="top"})=>{var S;const i=f.useRef(null),d=$o(i,"horizontal"),{showLeftArrow:w,showRightArrow:p,scrollByTab:b}=mc(i),[h,x]=f.useState(!1),m=()=>b("left"),C=()=>b("right"),E=N=>r.jsx("div",{"data-testid":`gradient-overlay-${N}`,className:c("wu-absolute wu-top-0 wu-h-full wu-w-20 wu-z-10 wu-pointer-events-none",N==="left"?"wu-left-0 wu-bg-gradient-to-r wu-from-white wu-to-transparent":"wu-right-0 wu-bg-gradient-to-l wu-from-white wu-to-transparent")}),y=(N,k,A)=>{const T=k==="left";return r.jsx("button",{onClick:N,className:c("wu-absolute wu-z-20 wu-flex wu-items-center wu-justify-center wu-px-1 wu-py-1 wu-transition-all wu-duration-300 wu-h-8",T?"wu-left-0":"wu-right-0",A&&"wu-translate-x-0 wu-opacity-100",!A&&[T?"-wu-translate-x-full":"wu-translate-x-full","wu-opacity-0"]),"aria-label":T?"scroll-left":"scroll-right",children:r.jsx("span",{className:c("wu-text-blue-p wu-text-lg",T?"wm-keyboard-arrow-left":"wm-keyboard-arrow-right")})})};return r.jsxs(zo,{defaultValue:a||((S=e[0])==null?void 0:S.value),value:t,onValueChange:s,orientation:"horizontal",dir:u,className:c("wu-relative wu-flex wu-flex-col wu-w-full wu-h-full",l==="bottom"?"wu-flex-col-reverse":"wu-flex-col",n),role:"tabs",children:[r.jsxs("div",{className:"wu-relative wu-flex wu-overflow-hidden wu-shrink-0 wu-border-b wu-border-gray-200",onMouseEnter:()=>x(!0),onMouseLeave:()=>x(!1),"aria-label":"tablistWrapper",children:[w&&h&&E("left"),y(m,"left",w&&h),r.jsxs(sa,{ref:i,className:c("wu-relative wu-flex wu-w-full wu-overflow-x-auto wu-flex-row","[&::-webkit-scrollbar]:wu-hidden [-ms-overflow-style:none] [scrollbar-width:none]","wu-tablist"),children:[e.map(N=>r.jsx(oa,{value:N.value,children:N.Trigger},N.value)),r.jsx("span",{className:"wu-absolute wu-bg-blue-p wu-transition-all wu-duration-300 wu-indicator wu-bottom-0",style:{width:d.width,left:d.left,height:1.25,bottom:l==="bottom"?void 0:0,top:l==="bottom"?0:void 0}})]}),p&&h&&E("right"),y(C,"right",p&&h)]}),r.jsx(Ho,{items:e,enableAnimation:o})]})},vc=e=>{const[t,a]=f.useState(!1),[s,o]=f.useState(!1),n=()=>{const l=e.current;l&&(a(l.scrollTop>0),o(l.scrollTop+l.clientHeight<l.scrollHeight))};return f.useEffect(()=>{const l=e.current;if(l)return n(),l.addEventListener("scroll",n),window.addEventListener("resize",n),()=>{l.removeEventListener("scroll",n),window.removeEventListener("resize",n)}},[e]),{showTopArrow:t,showBottomArrow:s,scrollByTab:l=>{const i=e.current;if(i){const d=(l==="down"?i.clientHeight:-i.clientHeight)*.8;i.scrollBy({top:d,behavior:"smooth"})}}}},yc=({items:e,value:t,defaultValue:a,onValueChange:s,enableAnimation:o=!1,className:n,dir:u="ltr",position:l="left"})=>{var S;const i=f.useRef(null),d=$o(i,"vertical"),{showTopArrow:w,showBottomArrow:p,scrollByTab:b}=vc(i),[h,x]=f.useState(!1),m=()=>b("up"),C=()=>b("down"),E=N=>r.jsx("div",{className:c("wu-absolute wu-left-0 wu-w-full wu-h-12 wu-z-10 wu-pointer-events-none",N==="top"?"wu-top-0 wu-bg-gradient-to-b wu-from-white wu-to-transparent":"wu-bottom-0 wu-bg-gradient-to-t wu-from-white wu-to-transparent")}),y=(N,k,A)=>{const T=k==="up";return r.jsx("button",{onClick:N,className:c("wu-absolute wu-z-20 wu-flex wu-items-center wu-justify-center wu-px-1 wu-py-1 wu-transition-all wu-duration-300 wu-w-full",T?"-wu-top-1":"-wu-bottom-1",A&&"wu-translate-y-0 wu-opacity-100",!A&&[T?"-wu-translate-y-full":"wu-translate-y-full","wu-opacity-0"]),"aria-label":T?"scroll-up":"scroll-down",children:r.jsx("span",{className:c("wu-text-blue-p wu-text-lg",T?"wm-keyboard-arrow-up":"wm-keyboard-arrow-down")})})};return r.jsxs(zo,{defaultValue:a||((S=e[0])==null?void 0:S.value),value:t,onValueChange:s,orientation:"vertical",dir:u,className:c("wu-relative wu-h-full wu-w-full wu-flex",l==="left"?"wu-flex-row":"wu-flex-row-reverse",n),role:"tabs",children:[r.jsxs("div",{className:"wu-relative wu-flex wu-overflow-hidden wu-shrink-0",onMouseEnter:()=>x(!0),onMouseLeave:()=>x(!1),"aria-label":"tablistWrapper",children:[w&&h&&E("top"),y(m,"up",w&&h),r.jsxs(sa,{ref:i,className:c("wu-relative wu-flex wu-h-full wu-overflow-y-auto wu-flex-col","[&::-webkit-scrollbar]:wu-hidden [-ms-overflow-style:none] [scrollbar-width:none]","wu-tablist"),children:[e.map(N=>r.jsx(oa,{value:N.value,children:N.Trigger},N.value)),r.jsx("span",{className:"wu-absolute wu-bg-blue-p wu-transition-all wu-duration-300 wu-indicator",style:{width:2,left:l==="left"?0:void 0,right:l==="right"?0:void 0,height:d.height,top:d.top}})]}),p&&h&&E("bottom"),y(C,"down",p&&h)]}),r.jsx(Ho,{items:e,enableAnimation:o})]})},Nc=({...e})=>e.orientation==="vertical"?r.jsx(yc,{...e}):r.jsx(xc,{...e}),na=g.forwardRef(({className:e,...t},a)=>r.jsx("table",{ref:a,className:c("wu-w-full wu-caption-bottom wu-text-sm",e),...t}));na.displayName="Table";const Uo=g.forwardRef(({className:e,...t},a)=>r.jsx("thead",{ref:a,className:c("[&_tr]:wu-border-b",e),...t}));Uo.displayName="TableHeader";const jo=g.forwardRef(({className:e,...t},a)=>r.jsx("tbody",{ref:a,className:c("",e),...t}));jo.displayName="TableBody";const Cc=g.forwardRef(({className:e,...t},a)=>r.jsx("tfoot",{ref:a,className:c("wu-border-t wu-bg-muted/50 wu-font-medium [&>tr]:last:wu-border-b-0",e),...t}));Cc.displayName="TableFooter";const Mt=g.forwardRef(({className:e,...t},a)=>r.jsx("tr",{ref:a,className:c("wu-border-b wu-transition-colors wu-hover:wu-bg-muted/50 data-[state=selected]:wu-bg-muted",e),...t}));Mt.displayName="TableRow";const ua=g.forwardRef(({className:e,...t},a)=>r.jsx("th",{ref:a,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}));ua.displayName="TableHead";const rr=g.forwardRef(({className:e,...t},a)=>r.jsx("td",{ref:a,className:c("wu-p-4 wu-align-middle [&:has([role=checkbox])]:wu-pr-0",e),...t}));rr.displayName="TableCell";const la=g.forwardRef(({className:e,...t},a)=>r.jsx("caption",{ref:a,className:c("wu-mt-4 wu-text-sm wu-text-gray-subtle wu-font-normal",e),...t}));la.displayName="TableCaption";const Sc=({columns:e,rowSelection:t})=>{const a=(t==null?void 0:t.isEnabled)??!1,s=(t==null?void 0:t.size)??48,{onRowSelect:o,rowUniqueKey:n}=t||{},u=f.useCallback(i=>d=>{o(()=>d?i:[])},[o]);return{finalColumns:f.useMemo(()=>a?[{id:"select",header:({table:i})=>{const d=i.getRowModel().rows.map(p=>p.original),w=u(d);return r.jsx(Ce,{checked:i.getIsSomeRowsSelected()||i.getIsAllRowsSelected(),partial:i.getIsSomeRowsSelected()&&!i.getIsAllRowsSelected(),onChange:p=>{i.toggleAllRowsSelected(!!p),w(!!p)},"aria-label":"Select all","data-testid":i.getIsSomeRowsSelected()&&!i.getIsAllRowsSelected()?"select-partial":"select-all"})},cell:({row:i})=>r.jsx(Ce,{checked:i.getIsSelected(),onChange:d=>{i.toggleSelected(!!d)},"aria-label":String(i.original[n])}),enableSorting:!1,filterable:!1,accessorKey:"select",size:s},...e]:e,[e,a,u])}};function Go({data:e,columns:t,rowSelection:a}){const{finalColumns:s}=Sc({columns:t,rowSelection:a}),o=f.useMemo(()=>{if(!(a!=null&&a.isEnabled))return{};const n={};for(const u of a.selectedRows){const l=e.findIndex(i=>i[a.rowUniqueKey]===u[a.rowUniqueKey]);l!==-1&&(n[l]=!0)}return n},[e,a]);return{finalColumns:s,rowSelectionState:o}}const Yo=({table:e,size:t,NoDataContent:a,isLoading:s,CustomLoader:o})=>{var l;const[n,u]=f.useState(null);return r.jsx(jo,{children:s?r.jsx(Mt,{children:r.jsx(rr,{colSpan:e.getAllColumns().length,className:"wu-text-center wu-h-[35vh] wu-loader-container",children:o||r.jsx(et,{className:"wu-w-full"})})}):(l=e.getRowModel().rows)!=null&&l.length?e.getRowModel().rows.map((i,d)=>r.jsx(Mt,{"data-state":i.getIsSelected()&&"selected",onMouseOver:()=>u(i.id),onMouseOut:()=>u(null),className:c("wu-transition-colors wu-border-b wu-border-black/[12%]",i.getIsSelected()?n===i.id?"wu-bg-blue-p/[16%]":"wu-bg-blue-p/[8%]":"hover:wu-bg-black/[2%]"),children:i.getVisibleCells().map((w,p)=>r.jsx(rr,{className:c("wu-py-0 wu-font-light wu-text-xs",t==="compact"?"wu-h-8":"wu-h-10",w.column.id==="actions"?"wu-opacity-0 wu-transition-opacity wu-duration-100":"",n===i.id&&w.column.id==="actions"?"wu-opacity-100 wu-visible":"",w.column.columnDef.cellAlign==="right"&&"wu-text-right",w.column.columnDef.cellAlign==="center"&&"wu-text-center",w.column.columnDef.cellAlign==="left"&&"wu-text-left"),children:_e.flexRender(w.column.columnDef.cell,w.getContext())},`${w.id}-${p}`))},`${i.id}-${d}`)):r.jsx(Mt,{children:r.jsx(rr,{colSpan:e.getAllColumns().length,children:a})})})},Ko=({table:e,sortableColumns:t,manual:a=!1,onSort:s,size:o,isRowSelected:n,HeaderAction:u,isStickyHeader:l})=>{const i=o==="compact"?"wu-h-8":"wu-h-10",d=w=>{const{id:p,columnDef:b,getIsSorted:h,toggleSorting:x}=w,{header:m}=b;if(!t.includes(p))return m;const C=h(),E=C==="asc",y=C==="desc",S=()=>{a?(x(!y),s==null||s({id:p,desc:y})):x(w.getIsSorted()==="asc")};return r.jsxs("button",{onClick:S,"aria-label":`Sort by ${m}`,className:"wu-flex wu-items-center wu-gap-4",children:[m,r.jsxs("div",{className:"wu-relative",children:[r.jsx("span",{className:c("wu-absolute -wu-top-[15px] wm-arrow-drop-down wu-text-xl",E&&"wu-hidden",!C&&"-wu-top-[11px]")}),r.jsx("span",{className:c("wu-absolute -wu-bottom-[13px] wm-arrow-drop-up wu-text-xl",y&&"wu-hidden",!C&&"-wu-bottom-[10px]")})]})]})};return r.jsxs(Uo,{className:c("wu-border-t wu-border-black/[12%] wu-bg-gray-20 wu-relative",l&&"wu-sticky wu-top-[-.5px] wu-z-10",i),children:[e.getHeaderGroups().map(w=>r.jsx(Mt,{className:"wu-relative",children:w.headers.map(p=>p.column.id==="actions"?r.jsx(ua,{colSpan:p.colSpan,className:"wu-text-xs wu-font-medium",style:{width:`${p.getSize()}px`}},p.id):r.jsx(ua,{colSpan:p.colSpan,className:c("wu-text-xs wu-font-medium wu-bg-[#EEEEEE]","wu-relative wu-z-0",p.column.columnDef.headerAlign==="right"&&"wu-text-right",p.column.columnDef.headerAlign==="center"&&"wu-text-center",p.column.columnDef.headerAlign==="left"&&"wu-text-left"),style:{width:`${p.getSize()}px`},children:_e.flexRender(d(p.column),p.getContext())},p.id))},w.id)),n&&u&&r.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",i),children:[r.jsx("div",{className:"wu-flex wu-items-center wu-px-4",style:{width:e.getVisibleLeafColumns()[0].getSize()},children:r.jsx(Ce,{checked:e.getIsSomeRowsSelected()||e.getIsAllRowsSelected(),partial:e.getIsSomeRowsSelected()&&!e.getIsAllRowsSelected(),onChange:w=>{e.toggleAllRowsSelected(!!w)},"aria-label":"Select all"})}),r.jsx("div",{className:"wu-flex-1 wu-flex wu-pr-4",children:u})]})]})},Jo=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"}}}),Ec=({data:e,columns:t,isLoading:a=!1,variant:s="unstyled",sort:o,size:n,rowSelection:u,HeaderAction:l,NoDataContent:i,stickyHeader:d=!1,CustomLoader:w,caption:p,...b})=>{var S;const{finalColumns:h,rowSelectionState:x}=Go({data:e,columns:t,rowSelection:u}),m=f.useMemo(()=>h.filter(N=>N.enableSorting).map(N=>N.accessorKey),[h]),C=((S=u==null?void 0:u.selectedRows)==null?void 0:S.length)??0,E=N=>{if(typeof N=="function"){const k=N(x),A=Object.keys(k).filter(T=>k[Number(T)]).map(T=>e[Number(T)]);u==null||u.onRowSelect(A)}},y=_e.useReactTable({data:e,columns:h,getCoreRowModel:_e.getCoreRowModel(),getPaginationRowModel:_e.getPaginationRowModel(),manualPagination:!0,manualSorting:!0,manualFiltering:!0,enableRowSelection:u==null?void 0:u.isEnabled,state:{...u!=null&&u.isEnabled?{rowSelection:x}:{}},onRowSelectionChange:E});return r.jsxs("div",{className:c("wu-text-gray-lead wu-table-container wu-relative"),children:[p&&r.jsx(la,{className:"wu-font-light",children:p}),r.jsxs(na,{...b,className:c(Jo({variant:s}),b.className),children:[r.jsx(Ko,{table:y,sortableColumns:m,manual:!0,onSort:o==null?void 0:o.onSort,size:n,HeaderAction:l,isRowSelected:C>0,isStickyHeader:d}),!a&&r.jsx(Yo,{table:y,size:n,NoDataContent:i,CustomLoader:w})]}),a&&r.jsx("div",{className:"wu-flex wu-items-center wu-justify-center wu-h-96",children:r.jsx(et,{})})]})},Tc=({data:e,columns:t,variant:a="unstyled",size:s="default",sort:o,filterText:n,pagination:u,stickyHeader:l,HeaderAction:i,CustomLoader:d,NoDataContent:w,isLoading:p,caption:b,rowSelection:h,...x})=>{var z;const[m,C]=f.useState((o==null?void 0:o.initial)||[]),[E,y]=f.useState([]),[S,N]=f.useState((u==null?void 0:u.pageIndex)??0),{finalColumns:k,rowSelectionState:A}=Go({data:e,columns:t,rowSelection:h}),T=f.useMemo(()=>k.filter(P=>P.enableSorting).map(P=>P.accessorKey),[k]),D=f.useMemo(()=>k.filter(P=>P.filterable).map(P=>P.accessorKey),[k]),F=((z=h==null?void 0:h.selectedRows)==null?void 0:z.length)??0,W=P=>{const G=typeof P=="function"?P(A):P,q=Object.keys(G).filter(oe=>G[Number(oe)]).map(oe=>e[Number(oe)]);h==null||h.onRowSelect(q)},_=_e.useReactTable({data:e,columns:k,getCoreRowModel:_e.getCoreRowModel(),getFilteredRowModel:_e.getFilteredRowModel(),getSortedRowModel:_e.getSortedRowModel(),getPaginationRowModel:u?_e.getPaginationRowModel():void 0,state:{sorting:m,columnFilters:E,...u?{pagination:u}:{},...h!=null&&h.isEnabled?{rowSelection:A}:{}},onSortingChange:C,onColumnFiltersChange:y,onRowSelectionChange:W});return f.useEffect(()=>{D.forEach(P=>{var G;(G=_.getColumn(P))==null||G.setFilterValue(n)})},[n,D,_]),f.useEffect(()=>{u&&(u==null?void 0:u.pageIndex)!==S&&(h==null||h.onRowSelect(()=>[]),_.resetRowSelection(),N(u.pageIndex))},[u==null?void 0:u.pageIndex]),r.jsx("div",{className:"wu-text-gray-lead wu-table-container wu-relative",children:r.jsxs(na,{...x,className:c("wu-overflow-x-auto wu-w-full",Jo({variant:a}),"wu-table-fixed",x.className),children:[b&&r.jsx(la,{children:b}),r.jsx(Ko,{table:_,sortableColumns:T,size:s,HeaderAction:i,isRowSelected:F>0,isStickyHeader:l}),r.jsx(Yo,{table:_,size:s,NoDataContent:w,CustomLoader:d,isLoading:p})]})})},Xo=g.forwardRef(({className:e,...t},a)=>r.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:a,...t}));Xo.displayName="Textarea";const Zo=f.forwardRef((e,t)=>{const{Label:a,id:s=Bt(),variant:o="flat",readonly:n,maxLength:u,labelPosition:l="top",...i}=e,d=p=>{i.onChange&&i.onChange(p)},w=gt(l);return r.jsxs("div",{className:c(w,"wu-flex wu-textarea-container"),dir:i.dir,children:[r.jsx(Xo,{...i,ref:t,id:s,className:c("wu-peer wu-rounded-t-sm",o==="outlined"?"wu-border wu-border-gray-subtle":"",i.className),onChange:d,readOnly:n,maxLength:u}),a&&r.jsx(xe,{htmlFor:s,className:"wu-textarea-label",children:a})]})});Zo.displayName="WuTextarea";function kc(e){if(typeof e=="string"&&e.includes("T")){const t=j.parseISO(e);return j.format(t,"HH:mm")}if(typeof e=="string"&&/^\d{2}:\d{2}:\d{2}$/.test(e)){const t=j.parse(e,"HH:mm:ss",new Date);return j.format(t,"HH:mm")}return typeof e=="string"&&/^\d{2}:\d{2}$/.test(e)?e:"00:00"}const Qo=["12",...Array.from({length:11},(e,t)=>String(t+1).padStart(2,"0"))],Ro=Array.from({length:60},(e,t)=>String(t).padStart(2,"0")),en=["am","pm"],ar=50;function Ic(e){return Array(ar).fill(e).flat()}function ia(e,t){const a=e.indexOf(t);return[...e.slice(a),...e.slice(0,a)]}function Ac(e,t){let a=Number(e);return t==="pm"&&a<12&&(a+=12),t==="am"&&a===12&&(a=0),String(a).padStart(2,"0")}function tn(e){const t=Number(e),a=t>=12?"pm":"am",s=t%12===0?12:t%12;return{hour:String(s),meridiem:a}}const Dc=({value:e,isSelected:t,onClick:a})=>r.jsx("div",{onClick:a,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}),ca=({values:e,selectedValue:t,scrollRef:a,onSelect:s,repeatItems:o=!0,className:n})=>r.jsx("div",{ref:a,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]",n),role:"presentation",children:(o?Ic(e):e).map((u,l)=>r.jsx(Dc,{value:u,isSelected:u===t,onClick:()=>s(u)},`${u}-${l}`))});function Mc(e,t,a,s){const o=f.useMemo(()=>e?ia(Qo,t.padStart(2,"0")):Qo,[e]),n=f.useMemo(()=>e?ia(Ro,a.padStart(2,"0")):Ro,[e]),u=f.useMemo(()=>e?ia(en,s):en,[e]);return{rotatedHours:o,rotatedMinutes:n,rotatedMeridiem:u}}function _c(e,t,a){f.useEffect(()=>{function s(u){if(u){const l=u.scrollHeight/ar,i=Math.floor(ar/2);u.scrollTop=i*l;const d=()=>{const{scrollTop:w}=u,p=Math.round(w/l);(p<=1||p>=ar-2)&&(u.scrollTop=i*l)};return u.addEventListener("scroll",d),()=>{u.removeEventListener("scroll",d)}}}if(!e)return;const o=s(t.current),n=s(a.current);return()=>{o==null||o(),n==null||n()}},[e,t,a])}const rn=({className:e,time:t,Label:a,labelPosition:s,dir:o,...n})=>{const[u,l]=f.useState(!1),[i,d]=f.useState(""),w=f.useRef(null),p=f.useRef(null),b=f.useRef(null),h=f.useRef(null),[x,m]=f.useState("12"),[C,E]=f.useState("00"),[y,S]=f.useState("am");f.useEffect(()=>{if(!t){d(""),m("12"),E("00"),S("am"),w.current&&(w.current.value="");return}const D=kc(t);d(D);const[F,W]=D.split(":"),{hour:_,meridiem:z}=tn(F);m(_),E(W),S(z),w.current&&(w.current.value=D)},[t]),f.useEffect(()=>{const D=F=>{p.current&&!p.current.contains(F.target)&&l(!1)};return document.addEventListener("mousedown",D),()=>{document.removeEventListener("mousedown",D)}},[]),_c(u,b,h);const{rotatedHours:N,rotatedMinutes:k,rotatedMeridiem:A}=Mc(u,x,C,y),T=f.useCallback((D,F,W)=>{const _=D??x,z=F??C,P=W??y;m(_),E(z),S(P);const G=`${Ac(_,P)}:${z}`;d(G)},[x,C,y]);return r.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:[a&&r.jsx(xe,{htmlFor:"time-picker",className:"wu-timepicker-label",children:a}),r.jsxs("div",{className:c("relative inline-block"),ref:p,dir:o,children:[r.jsx(ve,{ref:w,type:"time",value:i,variant:"flat",role:"textbox",onChange:D=>{d(D.target.value);const[F,W]=D.target.value.split(":"),{hour:_,meridiem:z}=tn(F);m(_),E(W),S(z)},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:r.jsx(ue,{icon:"wm-schedule",className:c("wu-text-base",n.disabled&&"wu-text-lead/50 wu-pointer-events-none wu-opacity-50"),onClick:()=>l(D=>!D),"data-testid":"wu-timepicker-icon"}),iconPosition:"right",dir:o,...n}),r.jsx("style",{children:`
8
10
  input[type="time"]::-webkit-calendar-picker-indicator { display: none; }
9
- `}),u&&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(lr,{values:v,selectedValue:g.padStart(2,"0"),scrollRef:h,onSelect:M=>E(M,C),className:"wu-time-hour-picker"}),a.jsx(lr,{values:T,selectedValue:C.padStart(2,"0"),scrollRef:b,onSelect:M=>E(g,M),className:"wu-time-minute-picker"}),a.jsx(lr,{values:I,selectedValue:y,onSelect:M=>E(void 0,void 0,M),className:"wu-time-meridiem-picker",repeatItems:!1})]})]})]})};Jo.displayName="WuTimePicker";const gc=1,mc=1e6;let ir=0;function xc(){return ir=(ir+1)%Number.MAX_SAFE_INTEGER,ir.toString()}const cr=new Map,Xo=e=>{if(cr.has(e))return;const t=setTimeout(()=>{cr.delete(e),St({type:"REMOVE_TOAST",toastId:e})},mc);cr.set(e,t)},yc=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,gc)};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?Xo(r):e.toasts.forEach(s=>{Xo(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)}}},aa=[];let ra={toasts:[]};function St(e){ra=yc(ra,e),aa.forEach(t=>{t(ra)})}function Zo({...e}){const t=xc(),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 vc(){const[e,t]=p.useState(ra);return p.useEffect(()=>(aa.push(t),()=>{const r=aa.indexOf(t);r>-1&&aa.splice(r,1)}),[e]),{...e,toast:Zo,dismiss:r=>St({type:"DISMISS_TOAST",toastId:r})}}const Nc=()=>({showToast:({message:t,variant:r,duration:s,position:o})=>Zo({description:t,variant:r,duration:s,position:o})}),Cc=be.Provider,Sc=Ee.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"}}),Qo=x.forwardRef(({className:e,position:t,...r},s)=>a.jsx(be.Viewport,{ref:s,className:c(Sc({position:t}),e),...r}));Qo.displayName=be.Viewport.displayName;const kc=Ee.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"}}),Ro=x.forwardRef(({className:e,variant:t,position:r,...s},o)=>a.jsx(be.Root,{ref:o,className:c(kc({variant:t,position:r}),e),...s}));Ro.displayName=be.Root.displayName;const Ec=x.forwardRef(({className:e,...t},r)=>a.jsx(be.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}));Ec.displayName=be.Action.displayName;const en=x.forwardRef(({className:e,...t},r)=>a.jsx(be.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"})}));en.displayName=be.Close.displayName;const tn=x.forwardRef(({className:e,...t},r)=>a.jsx(be.Title,{ref:r,className:c("wu-text-sm wu-font-semibold",e),...t}));tn.displayName=be.Title.displayName;const an=x.forwardRef(({className:e,...t},r)=>a.jsx(be.Description,{ref:r,className:c("wu-text-sm wu-opacity-90",e),...t}));an.displayName=be.Description.displayName;function Tc(){const{toasts:e}=vc(),t=e.reduce((r,s)=>{const o=s.position||"top";return r[o]||(r[o]=[]),r[o].push(s),r},{});return a.jsx(Cc,{children:Object.entries(t).map(([r,s])=>a.jsx(Qo,{position:r,children:s.map(function({id:o,title:n,description:u,action:i,variant:l,position:w,...d}){const f={success:"wm-check-circle",info:"wm-info",warning:"wm-error",error:"wm-cancel"};return a.jsxs(Ro,{variant:l||"success",position:w,...d,children:[a.jsxs("div",{className:"wu-grid wu-gap-1",children:[n&&a.jsx(tn,{children:n}),u&&a.jsxs(an,{className:"wu-flex wu-items-center wu-gap-3 wu-pr-6",children:[a.jsx(ce,{icon:f[l||"success"],className:"wu-text-xl"}),u]})]}),i,a.jsx(en,{})]},o)})},r))})}const Ic=()=>a.jsx(Tc,{}),rn=x.forwardRef(({className:e,dir:t,...r},s)=>a.jsx(la.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(la.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")})}));rn.displayName=la.Root.displayName;const sn=p.forwardRef((e,t)=>{const{Label:r,labelPosition:s="right",onChange:o,className:n,dir:u,disabled:i,id:l=_t(),...w}=e;return p.useEffect(()=>{const{checked:d,defaultChecked:f}=w;d!==void 0&&f!==void 0&&console.error("WuToggle: Both `checked` and `defaultChecked` props are set. Use only one of them.")},[w.checked,w.defaultChecked]),a.jsxs("div",{className:c(Dc({labelPosition:s}),"wu-toggle-container"),dir:u,children:[a.jsx(rn,{...w,id:l,disabled:i,ref:t,onCheckedChange:o,className:c("wu-peer",n),dir:u}),a.jsx(ge,{htmlFor:l,className:"wu-toggle-label",children:r})]})});sn.displayName="WuToggle";const Dc=Ee.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"}}}),sa=p.createContext(null),Mc=()=>{const e=p.useContext(sa);if(!e)throw new Error("useTranslation must be used within a WuTranslationProvider");return e.useTranslation()},Ac=()=>{const e=p.useContext(sa);if(!e)throw new Error("useLoadTranslationsFunction must be used within a WuTranslationProvider");return e},_c=({children:e})=>{const[t,r]=p.useState({}),[s,o]=p.useState({}),n=p.useCallback(async(w,d)=>{try{const h=await(await fetch(w)).json();r(h)}catch(f){console.error("Failed to load translations:",f),d&&r(d)}d&&o(d)},[]),u=p.useCallback(w=>{o(w)},[]),i=p.useCallback(()=>({t:(d,f)=>t[d]?t[d]:s[d]?s[d]:f||d}),[t,s]),l={loadTranslations:n,setFallbackTranslations:u,useTranslation:i};return a.jsx(sa.Provider,{value:l,children:e})},Wc={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"}},on={main:"_main_1uzld_1",container:"_container_1uzld_5"},nn=p.forwardRef(({className:e,children:t,isOpen:r=!1,contentOffset:s=48,contentOffsetFactor:o=4,header:n,contentAnimation:u="wu-fade-zoom",headerAnimation:i="wu-slide-up-down",dir:l="ltr"},w)=>{const[d,f]=p.useState(`${u}-view-in`),[h,b]=p.useState(`${i}-header-in`),g=p.useRef(null),m=p.useRef(null),[C,k]=p.useState(!1),[y,S]=p.useState(!1),v=()=>{k(!0)},T=()=>{S(!0)};return p.useEffect(()=>{C&&y&&(d.includes("in")?(f(`${u}-view-out`),b(`${i}-header-out`)):(f(`${u}-view-in`),b(`${i}-header-in`)),k(!1),S(!1))},[C,y]),a.jsxs("div",{className:c(on.main),ref:w,children:[a.jsx(Mt.SwitchTransition,{mode:"out-in",children:a.jsx(Mt.CSSTransition,{nodeRef:m,addEndListener:I=>{g.current&&g.current.addEventListener("transitionend",I,!0)},classNames:h,unmountOnExit:!0,children:n?n(m):null},r?"header-visible":"header-hidden")}),a.jsx(Mt.SwitchTransition,{mode:"out-in",children:a.jsx(Mt.CSSTransition,{nodeRef:g,classNames:d,addEndListener:I=>{g.current&&g.current.addEventListener("transitionend",I,!0)},onExited:v,onEntered:T,unmountOnExit:!0,children:a.jsx("div",{ref:g,className:c(on.container,e),style:{padding:r?Lc(s,o,l):"0px"},children:t})},r?"details":"card")})]})});nn.displayName="WuDrilldown";function Lc(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}const Pc={WuEditor:"_WuEditor_88p35_2"},Fc={link:{openOnClick:!1,autolink:!0,defaultProtocol:"https",protocols:["http","https"],isAllowedUri:(e,t)=>{try{const r=e.includes(":")?new URL(e):new URL(`${t.defaultProtocol}://${e}`);if(!t.defaultValidate(r.href))return!1;const s=["ftp","file","mailto"],o=r.protocol.replace(":","");if(s.includes(o)||!t.protocols.map(l=>typeof l=="string"?l:l.scheme).includes(o))return!1;const u=["example-phishing.com","malicious-site.net"],i=r.hostname;return!u.includes(i)}catch{return!1}},shouldAutoLink:e=>{try{const t=e.includes(":")?new URL(e):new URL(`https://${e}`),r=["example-no-autolink.com","another-no-autolink.com"],s=t.hostname;return!r.includes(s)}catch{return!1}}}},Oc=(e,t)=>{if(e.isActive("link")){const{from:u,to:i}=e.state.selection;let l=e.state.doc.textBetween(u,i);e.state.selection.empty,e.chain().extendMarkRange("link").run();const{from:w,to:d}=e.state.selection,f=e.getAttributes("link");return l=e.state.doc.textBetween(w,d),t((h,b)=>{if(h===null){e.chain().focus().extendMarkRange("link").unsetLink().run();return}h&&(b&&b!==l?e.chain().focus().extendMarkRange("link").insertContent({type:"text",text:b,marks:[{type:"link",attrs:{href:h}}]}).run():e.chain().focus().extendMarkRange("link").setLink({href:h}).run())},l,f.href),!0}const{from:r,to:s,empty:o}=e.state.selection;let n=e.state.doc.textBetween(r,s);if(o){const{$from:u}=e.state.selection,i=u.parent.textContent,l=u.parentOffset;let w=l,d=l;for(;w>0&&!/\s/.test(i[w-1]);)w--;for(;d<i.length&&!/\s/.test(i[d]);)d++;if(w<d&&i.slice(w,d).trim()){const f=u.start(),h=f+w,b=f+d;return n=i.slice(w,d),e.commands.setTextSelection({from:h,to:b}),t((g,m)=>{g&&(m&&m!==n?e.chain().focus().insertContent({type:"text",text:m,marks:[{type:"link",attrs:{href:g}}]}).run():e.chain().focus().setLink({href:g}).run())},n),!0}else return t((f,h)=>{f&&h&&e.chain().focus().insertContent({type:"text",text:h,marks:[{type:"link",attrs:{href:f}}]}).run()}),!0}return n?(t((u,i)=>{u&&(i&&i!==n?e.chain().focus().insertContent({type:"text",text:i,marks:[{type:"link",attrs:{href:u}}]}).run():e.chain().focus().setLink({href:u}).run())},n),!0):!1},Bc=({open:e,onOpenChange:t,onSubmit:r,initialText:s,initialUrl:o})=>{const[n,u]=p.useState(""),[i,l]=p.useState("");p.useEffect(()=>{e&&(l(s||""),u(o||""))},[e,s,o]);const w=()=>{if(n){const f=n.startsWith("http")?n:`https://${n}`;r(f,i),t(!1)}},d=()=>{r(null),t(!1)};return a.jsxs(Wa,{open:e,onOpenChange:t,size:"sm",children:[a.jsx(La,{children:a.jsxs("div",{className:"wu-flex wu-flex-col wu-gap-4",children:[a.jsx(Ae,{Label:"Text to display",value:i,onChange:f=>l(f.target.value),placeholder:"Enter text",autoFocus:!1}),a.jsx(Ae,{Label:"URL",value:n,onChange:f=>u(f.target.value),placeholder:"https://example.com",onKeyDown:f=>{f.key==="Enter"&&w()}})]})}),a.jsx(Pa,{children:a.jsxs("div",{className:"wu-flex wu-w-full wu-justify-between",children:[o&&a.jsx(we,{color:"error",onClick:d,children:"Remove Link"}),a.jsxs("div",{className:"wu-flex wu-gap-2 wu-ml-auto",children:[a.jsx(qt,{variant:"secondary",children:"Cancel"}),a.jsx(we,{onClick:w,children:"Save"})]})]})})]})},un=p.createContext(null),kt=()=>{const e=p.useContext(un);if(!e)throw new Error("useWuEditor must be used within a WuEditorProvider");return e},qc=({editor:e,children:t})=>{const[r,s]=p.useState(!1),[o,n]=p.useState(null),[u,i]=p.useState(""),[l,w]=p.useState(""),d=p.useCallback((h,b,g)=>{i(b||""),w(g||""),n(()=>h),s(!0)},[]),f=(h,b)=>{o&&o(h,b),n(null)};return a.jsxs(un.Provider,{value:{editor:e,openLinkModal:d},children:[t,a.jsx(Bc,{open:r,onOpenChange:s,initialText:u,initialUrl:l,onSubmit:f})]})},Vc=()=>{const{editor:e}=kt(),t=[{label:"Fira Sans",id:"Fira Sans"},{label:"Inter",id:"Inter"},{label:"Poppins",id:"Poppins"},{label:"JetBrains Mono",id:"JetBrains Mono"},{label:"Montserrat",id:"Montserrat"}];return a.jsx(ts,{accessorKey:{label:"label",value:"id"},data:t,className:"wu-w-32",onSelect:r=>e==null?void 0:e.chain().focus().setFontFamily(r.id).run(),Item:({value:r})=>a.jsx("span",{style:{fontFamily:r.id},children:r.label})})},zc=()=>{const{editor:e}=kt(),[t,r]=p.useState("");return a.jsxs(Wa,{Trigger:a.jsx("button",{children:a.jsx(ce,{icon:"wm-image"})}),size:"sm",children:[a.jsx(La,{children:a.jsx(Ae,{type:"url",Label:"Insert image link",onChange:s=>r(s.target.value)})}),a.jsxs(Pa,{children:[a.jsx(qt,{variant:"secondary",children:"Cancel"}),a.jsx(qt,{onClick:()=>e==null?void 0:e.chain().focus().setImage({src:t}).run(),children:"Save"})]})]})},Hc=()=>{const[e,t]=p.useState(0),[r,s]=p.useState(0),{editor:o}=kt();return a.jsxs(Te,{children:[a.jsx(Be,{asChild:!0,children:a.jsx("button",{children:a.jsx(ce,{icon:"wm-table-chart"})})}),a.jsxs(ye,{className:"wu-p-2 wu-rounded-md wu-shadow-md wu-bg-white wu-w-max wu-flex wu-flex-col wu-gap-2 wu-items-center wu-justify-center",children:[a.jsx("div",{className:"wu-grid wu-grid-cols-10 wu-gap-1 wu-w-fit",children:Array.from({length:10}).map((n,u)=>Array.from({length:10}).map((i,l)=>a.jsx("button",{onMouseEnter:()=>{t(l+1),s(u+1),console.log(`Insert table: ${l+1} x ${u+1}`)},onClick:()=>o==null?void 0:o.chain().focus().insertTable({rows:r,cols:e,withHeaderRow:!0}).run(),className:"wu-w-3 wu-h-3 wu-bg-gray-20 wu-rounded-sm",style:{backgroundColor:l<e&&u<r?"rgba(var(--wu-blue-p) / 0.6)":"rgba(var(--wu-gray-20))"}},l+u)))}),a.jsxs("div",{className:"wu-text-xs",children:["Insert Table: ",e," x ",r]})]})]})},$c=(e,t)=>[{id:"styles",icon:"wm-format-paragraph",tooltip:"Text Styles",event:()=>!1,enabled:!1,className:"wu-relative wu-top-[1px]",type:"dropdown",items:[{id:"paragraph",icon:"wm-format-paragraph",event:()=>e.chain().focus().setParagraph().run()},{id:"h1",icon:"wm-format-h1",event:()=>e.chain().focus().setHeading({level:1}).run()},{id:"h2",icon:"wm-format-h2",event:()=>e.chain().focus().setHeading({level:2}).run()},{id:"h3",icon:"wm-format-h3",event:()=>e.chain().focus().setHeading({level:3}).run()},{id:"h4",icon:"wm-format-h4",event:()=>e.chain().focus().setHeading({level:4}).run()}]},{id:"fontFamily",icon:"wm-serif",tooltip:"Font Family",event:()=>!1,enabled:!1,className:"wu-relative wu-top-[1px]",type:"custom",customComponent:a.jsx(Vc,{})},{id:"fontSize",icon:"wm-format-size",event:()=>e.chain().focus().setFontSize("16px").run(),enabled:!1,break:!0,type:"custom",customComponent:a.jsx(Eo,{defaultValue:16,onChange:r=>e.chain().focus().setFontSize(r+"px").run(),min:8,max:72})},{id:"bold",icon:"wm-format-bold",tooltip:"Bold",event:()=>e.chain().focus().toggleBold().run(),enabled:e.isActive("bold"),className:""},{id:"underline",icon:"wm-format-underlined",tooltip:"Underline",event:()=>e.chain().focus().toggleUnderline().run(),enabled:e.isActive("underline"),className:"wu-relative wu-top-[1px]"},{id:"italic",icon:"wm-format-italic",tooltip:"Italic",event:()=>e.chain().focus().toggleItalic().run(),enabled:e.isActive("italic"),className:""},{id:"strikethrough",icon:"wm-format-strikethrough",tooltip:"Strikethrough",event:()=>e.chain().focus().toggleStrike().run(),enabled:e.isActive("strike"),className:"",break:!0},{id:"textColor",icon:"wm-format-color-text",tooltip:"Text Color",event:r=>e.chain().focus().setColor(r).run(),enabled:!1,className:"wu-text-lg",type:"color"},{id:"backgroundColor",icon:"wm-border-color",tooltip:"Background Color",event:r=>e.chain().focus().setBackgroundColor(r).run(),enabled:!1,className:"wu-text-base",type:"color",break:!0},{id:"alignText",icon:"wm-format-align-left",tooltip:"Align Text",event:()=>!1,enabled:!1,className:"wu-text-lg",type:"dropdown",items:[{id:"alignLeft",icon:"wm-format-align-left",event:()=>e.chain().focus().setTextAlign("left").run()},{id:"alignCenter",icon:"wm-format-align-center",event:()=>e.chain().focus().setTextAlign("center").run()},{id:"alignRight",icon:"wm-format-align-right",event:()=>e.chain().focus().setTextAlign("right").run()},{id:"alignJustify",icon:"wm-format-align-justify",event:()=>e.chain().focus().setTextAlign("justify").run()}]},{id:"lineSpace",icon:"wm-format-line-spacing",tooltip:"Line Spacing",event:()=>!1,enabled:!1,className:"wu-text-lg wu-relative wu-bottom-[1px]",type:"dropdown",items:[{id:"compact",icon:"wm-line-style",event:()=>e.chain().focus().setLineHeight("1").run()},{id:"normal",icon:"wm-format-list-bulleted",event:()=>e.chain().focus().setLineHeight("2").run()},{id:"wide",icon:"wm-format-list-bulleted",event:()=>e.chain().focus().setLineHeight("3").run()}]},{id:"formatList",icon:"wm-format-list-bulleted",tooltip:"Format List",event:()=>e.chain().focus().toggleBulletList().run(),enabled:!1,className:"wu-text-lg",type:"dropdown",items:[{id:"bulletlist",icon:"wm-format-list-bulleted",event:()=>e.chain().focus().toggleBulletList().run()},{id:"checklist",icon:"wm-checklist",event:()=>e.chain().focus().toggleTaskList().run()},{id:"orderedlist",icon:"wm-format-list-numbered",event:()=>e.chain().focus().toggleOrderedList().run()}],break:!0},{id:"link",icon:"wm-link",tooltip:"Insert Link",event:()=>t?Oc(e,t):!1,enabled:!1},{id:"image",icon:"wm-image",tooltip:"Insert Image",event:()=>e.chain().focus().setImage({src:"https://picsum.photos/200/300"}).run(),enabled:!1,type:"custom",customComponent:a.jsx(zc,{})},{id:"blockquote",icon:"wm-format-quote",tooltip:" Blockquote",event:()=>e.chain().focus().toggleBlockquote().run(),enabled:e.isActive("blockquote"),className:""},{id:"table",icon:"wm-table-chart",tooltip:"Insert Table",event:()=>!1,enabled:!1,break:!0,type:"custom",customComponent:a.jsx(Hc,{})},{id:"code",icon:"wm-code",tooltip:"Code",event:()=>e.chain().focus().toggleCode().run(),enabled:e.isActive("code"),className:""},{id:"superscript",icon:"wm-superscript",tooltip:"Superscript",event:()=>e.chain().focus().toggleSuperscript().run(),enabled:e.isActive("superscript"),className:""},{id:"subscript",icon:"wm-subscript",tooltip:"Subscript",event:()=>e.chain().focus().toggleSubscript().run(),enabled:e.isActive("subscript"),className:"wu-relative wu-top-[1px]",break:!0},{id:"clearFormat",icon:"wm-format-clear",tooltip:"Clear Formatting",event:()=>e.chain().focus().clearNodes().run(),enabled:!1,className:"wu-text-red-500"}],ln="wu-w-6 wu-h-6 wu-text-xl hover:wu-bg-gray-10 wu-rounded-sm wu-flex wu-items-center wu-justify-center",Uc=()=>{const{editor:e,openLinkModal:t}=kt();if(!e)return null;const r=$c(e,t);return a.jsx("div",{className:"wu-flex wu-border-b wu-items-center wu-justify-start wu-gap-2 wu-p-2",children:r.map(s=>a.jsxs(a.Fragment,{children:[a.jsx(jc,{act:s}),s.break&&a.jsx("div",{className:"wu-border-l wu-mx-1 wu-h-6 wu-border-gray-25"})]},s.id))})},jc=({act:e})=>{switch(e.type){case"color":return a.jsx(Kc,{act:e});case"dropdown":return a.jsx(Yc,{act:e});case"custom":return e.customComponent||null;default:return a.jsx(Gc,{act:e})}},Gc=({act:e})=>a.jsx("button",{onClick:e.event,"data-active":e.enabled,className:ln,title:e.tooltip,children:a.jsx(ce,{icon:e.icon,className:e.className})}),Yc=({act:e})=>{var t;return a.jsxs(Sa,{children:[a.jsxs(ka,{className:e.className,children:[a.jsx(ce,{icon:e.icon}),a.jsx(ce,{icon:"wm-arrow-drop-down"})]}),a.jsx(Ft,{className:"wu-flex wu-min-w-0 wu-p-1 wu-gap-[6px]",align:"start",children:(t=e.items)==null?void 0:t.map(r=>a.jsx(fr.DropdownMenuItem,{onClick:r.event,children:a.jsx(we,{variant:"iconOnly",className:"wu-w-6 wu-h-6 wu-text-lg",children:a.jsx(ce,{icon:r.icon})})},r.id))})]})},Kc=({act:e})=>a.jsxs(a.Fragment,{children:[a.jsx("label",{"data-active":e.enabled,className:`${ln} wu-cursor-pointer`,title:e.tooltip,htmlFor:e.id,children:a.jsx(ce,{icon:e.icon,className:e.className})}),a.jsx("input",{id:e.id,type:"color",className:"wu-h-0 wu-w-0 wu-absolute wu-opacity-0",onInput:t=>e.event(t.currentTarget.value)})]}),Jc=e=>{const{className:t,onChange:r,content:s}=e,o=hr.useEditor({extensions:[Tn.configure(Fc),Mn.configure({types:["heading","paragraph"]}),In,En,Ze.TextStyle,Ze.Color,Ze.BackgroundColor,br.TaskList,br.TaskItem,Ze.LineHeight,Ze.FontSize,Ze.FontFamily,Dn.configure({resize:{enabled:!0,alwaysPreserveAspectRatio:!0},inline:!0}),An.TableKit.configure({table:{resizable:!0}})],content:s,onUpdate:({editor:n})=>{r&&r(n.getHTML())}});return a.jsx("div",{className:Pc.WuEditor+" "+t,children:a.jsxs(qc,{editor:o,children:[a.jsx(Uc,{}),a.jsx(Xc,{})]})})},Xc=()=>{const{editor:e,openLinkModal:t}=kt(),r=s=>{const o=s.target;if(o.tagName==="A"&&o instanceof HTMLAnchorElement){s.preventDefault();const n=o.getAttribute("href"),u=o.textContent||"";t((i,l)=>{i===null?e==null||e.chain().focus().extendMarkRange("link").unsetLink().run():i&&(l&&l!==u?e==null||e.chain().focus().extendMarkRange("link").insertContent({type:"text",text:l,marks:[{type:"link",attrs:{href:i}}]}).run():e==null||e.chain().focus().extendMarkRange("link").setLink({href:i}).run())},u,n||"")}};return a.jsx(hr.EditorContent,{onClick:r,editor:e,className:"wu-p-2 wu-prose prose-p:wu-my-0 wu-min-h-40"})};window.wickUiVersion="1.21.0",Object.defineProperty(N,"useContext",{enumerable:!0,get:()=>p.useContext}),N.CHART_COLOR_SYSTEM=Wc,N.WuAccordion=Pn,N.WuAppHeader=nu,N.WuAppHeaderAccount=kr,N.WuAppHeaderBar=Mr,N.WuAppHeaderHelp=Er,N.WuAppHeaderMenu=Dr,N.WuAppHeaderSearch=su,N.WuButton=we,N.WuCalender=ma,N.WuCard=Br,N.WuCheckbox=Ie,N.WuChip=hu,N.WuCombobox=Su,N.WuCopyToClipboard=ku,N.WuDataTable=ic,N.WuDatePicker=lu,N.WuDateRangePicker=wu,N.WuDisplay=Gn,N.WuDrawer=_u,N.WuDrawerClose=Wu,N.WuDrilldown=nn,N.WuEditor=Jc,N.WuFooter=Qr,N.WuFormGroup=ru,N.WuHeading=Un,N.WuHelpButton=Rr,N.WuIcon=ce,N.WuInput=Ae,N.WuInputError=eu,N.WuInputHint=tu,N.WuLabel=ge,N.WuListbox=ts,N.WuLoader=et,N.WuMenu=as,N.WuMenuCheckboxItem=Vu,N.WuMenuIcon=Da,N.WuMenuItem=Ta,N.WuMenuItemGroup=zu,N.WuMenuRadioItem=Hu,N.WuMenuSeparatorItem=$u,N.WuModal=Wa,N.WuModalClose=qt,N.WuModalContent=La,N.WuModalFooter=Pa,N.WuModalHeader=Qu,N.WuMonthPicker=rl,N.WuPagination=bs,N.WuPopover=ul,N.WuPopoverClose=ll,N.WuPrimaryNavbar=ol,N.WuRadioGroup=ys,N.WuScrollArea=il,N.WuSecondaryNavbar=nl,N.WuSelect=fs,N.WuSidebar=Il,N.WuSidebarContent=Dl,N.WuSidebarFooter=Ml,N.WuSidebarGroup=Al,N.WuSidebarItem=Wl,N.WuSidebarMenu=_l,N.WuSidebarTrigger=Fs,N.WuSpotlight=ls,N.WuStackedCard=Fl,N.WuStackedCardOverlay=Ol,N.WuStepper=Eo,N.WuSubMenu=Uu,N.WuSubtext=jn,N.WuSwitcher=_o,N.WuTab=nc,N.WuTable=cc,N.WuText=$n,N.WuTextarea=Uo,N.WuTimePicker=Jo,N.WuToast=Ic,N.WuToggle=sn,N.WuTooltip=Lt,N.WuTranslationContext=sa,N.WuTranslationProvider=_c,N.WuTruncatedLabel=ou,N.WuVirtualScroll=tt,N.calculatePosition=Pl,N.useTranslation=Mc,N.useTranslationsContext=Ac,N.useWuShowToast=Nc,N.useWuSidebar=Ue,Object.defineProperty(N,Symbol.toStringTag,{value:"Module"})}));
11
+ `}),u&&r.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:[r.jsx(ca,{values:N,selectedValue:x.padStart(2,"0"),scrollRef:b,onSelect:D=>T(D,C),className:"wu-time-hour-picker"}),r.jsx(ca,{values:k,selectedValue:C.padStart(2,"0"),scrollRef:h,onSelect:D=>T(x,D),className:"wu-time-minute-picker"}),r.jsx(ca,{values:A,selectedValue:y,onSelect:D=>T(void 0,void 0,D),className:"wu-time-meridiem-picker",repeatItems:!1})]})]})]})};rn.displayName="WuTimePicker";const Fc=1,Lc=1e6;let da=0;function Wc(){return da=(da+1)%Number.MAX_SAFE_INTEGER,da.toString()}const wa=new Map,an=e=>{if(wa.has(e))return;const t=setTimeout(()=>{wa.delete(e),_t({type:"REMOVE_TOAST",toastId:e})},Lc);wa.set(e,t)},Pc=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,Fc)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(a=>a.id===t.toast.id?{...a,...t.toast}:a)};case"DISMISS_TOAST":{const{toastId:a}=t;return a?an(a):e.toasts.forEach(s=>{an(s.id)}),{...e,toasts:e.toasts.map(s=>s.id===a||a===void 0?{...s,open:!1}:s)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(a=>a.id!==t.toastId)}}},sr=[];let or={toasts:[]};function _t(e){or=Pc(or,e),sr.forEach(t=>{t(or)})}function sn({...e}){const t=Wc(),a=o=>_t({type:"UPDATE_TOAST",toast:{...o,id:t}}),s=()=>_t({type:"DISMISS_TOAST",toastId:t});return _t({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:o=>{o||s()}}}),{id:t,dismiss:s,update:a}}function Oc(){const[e,t]=f.useState(or);return f.useEffect(()=>(sr.push(t),()=>{const a=sr.indexOf(t);a>-1&&sr.splice(a,1)}),[e]),{...e,toast:sn,dismiss:a=>_t({type:"DISMISS_TOAST",toastId:a})}}const Bc=()=>({showToast:({message:t,variant:a,duration:s,position:o})=>sn({description:t,variant:a,duration:s,position:o})}),qc=me.Provider,zc=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"}}),on=g.forwardRef(({className:e,position:t,...a},s)=>r.jsx(me.Viewport,{ref:s,className:c(zc({position:t}),e),...a}));on.displayName=me.Viewport.displayName;const Vc=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"}}),nn=g.forwardRef(({className:e,variant:t,position:a,...s},o)=>r.jsx(me.Root,{ref:o,className:c(Vc({variant:t,position:a}),e),...s}));nn.displayName=me.Root.displayName;const Hc=g.forwardRef(({className:e,...t},a)=>r.jsx(me.Action,{ref:a,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}));Hc.displayName=me.Action.displayName;const un=g.forwardRef(({className:e,...t},a)=>r.jsx(me.Close,{ref:a,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:r.jsx("span",{className:"wm-close wu-text-base"})}));un.displayName=me.Close.displayName;const ln=g.forwardRef(({className:e,...t},a)=>r.jsx(me.Title,{ref:a,className:c("wu-text-sm wu-font-semibold",e),...t}));ln.displayName=me.Title.displayName;const cn=g.forwardRef(({className:e,...t},a)=>r.jsx(me.Description,{ref:a,className:c("wu-text-sm wu-opacity-90",e),...t}));cn.displayName=me.Description.displayName;function $c(){const{toasts:e}=Oc(),t=e.reduce((a,s)=>{const o=s.position||"top";return a[o]||(a[o]=[]),a[o].push(s),a},{});return r.jsx(qc,{children:Object.entries(t).map(([a,s])=>r.jsx(on,{position:a,children:s.map(function({id:o,title:n,description:u,action:l,variant:i,position:d,...w}){const p={success:"wm-check-circle",info:"wm-info",warning:"wm-error",error:"wm-cancel"};return r.jsxs(nn,{variant:i||"success",position:d,...w,children:[r.jsxs("div",{className:"wu-grid wu-gap-1",children:[n&&r.jsx(ln,{children:n}),u&&r.jsxs(cn,{className:"wu-flex wu-items-center wu-gap-3 wu-pr-6",children:[r.jsx(ue,{icon:p[i||"success"],className:"wu-text-xl"}),u]})]}),l,r.jsx(un,{})]},o)})},a))})}const Uc=()=>r.jsx($c,{}),dn=g.forwardRef(({className:e,dir:t,...a},s)=>r.jsx(fr.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),...a,ref:s,children:r.jsx(fr.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")})}));dn.displayName=fr.Root.displayName;const wn=f.forwardRef((e,t)=>{const{Label:a,labelPosition:s="right",onChange:o,className:n,dir:u,disabled:l,id:i=Bt(),...d}=e;return f.useEffect(()=>{const{checked:w,defaultChecked:p}=d;w!==void 0&&p!==void 0&&console.error("WuToggle: Both `checked` and `defaultChecked` props are set. Use only one of them.")},[d.checked,d.defaultChecked]),r.jsxs("div",{className:c(jc({labelPosition:s}),"wu-toggle-container"),dir:u,children:[r.jsx(dn,{...d,id:i,disabled:l,ref:t,onCheckedChange:o,className:c("wu-peer",n),dir:u}),r.jsx(xe,{htmlFor:i,className:"wu-toggle-label",children:a})]})});wn.displayName="WuToggle";const jc=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"}}}),nr=f.createContext(null),Gc=()=>{const e=f.useContext(nr);if(!e)throw new Error("useTranslation must be used within a WuTranslationProvider");return e.useTranslation()},Yc=()=>{const e=f.useContext(nr);if(!e)throw new Error("useLoadTranslationsFunction must be used within a WuTranslationProvider");return e},Kc=({children:e})=>{const[t,a]=f.useState({}),[s,o]=f.useState({}),n=f.useCallback(async(d,w)=>{try{const b=await(await fetch(d)).json();a(b)}catch(p){console.error("Failed to load translations:",p),w&&a(w)}w&&o(w)},[]),u=f.useCallback(d=>{o(d)},[]),l=f.useCallback(()=>({t:(w,p)=>t[w]?t[w]:s[w]?s[w]:p||w}),[t,s]),i={loadTranslations:n,setFallbackTranslations:u,useTranslation:l};return r.jsx(nr.Provider,{value:i,children:e})},Jc={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"}},fn={main:"_main_1uzld_1",container:"_container_1uzld_5"},pn=f.forwardRef(({className:e,children:t,isOpen:a=!1,contentOffset:s=48,contentOffsetFactor:o=4,header:n,contentAnimation:u="wu-fade-zoom",headerAnimation:l="wu-slide-up-down",dir:i="ltr"},d)=>{const[w,p]=f.useState(`${u}-view-in`),[b,h]=f.useState(`${l}-header-in`),x=f.useRef(null),m=f.useRef(null),[C,E]=f.useState(!1),[y,S]=f.useState(!1),N=()=>{E(!0)},k=()=>{S(!0)};return f.useEffect(()=>{C&&y&&(w.includes("in")?(p(`${u}-view-out`),h(`${l}-header-out`)):(p(`${u}-view-in`),h(`${l}-header-in`)),E(!1),S(!1))},[C,y]),r.jsxs("div",{className:c(fn.main),ref:d,children:[r.jsx(Pt.SwitchTransition,{mode:"out-in",children:r.jsx(Pt.CSSTransition,{nodeRef:m,addEndListener:A=>{x.current&&x.current.addEventListener("transitionend",A,!0)},classNames:b,unmountOnExit:!0,children:n?n(m):null},a?"header-visible":"header-hidden")}),r.jsx(Pt.SwitchTransition,{mode:"out-in",children:r.jsx(Pt.CSSTransition,{nodeRef:x,classNames:w,addEndListener:A=>{x.current&&x.current.addEventListener("transitionend",A,!0)},onExited:N,onEntered:k,unmountOnExit:!0,children:r.jsx("div",{ref:x,className:c(fn.container,e),style:{padding:a?Xc(s,o,i):"0px"},children:t})},a?"details":"card")})]})});pn.displayName="WuDrilldown";function Xc(e,t,a){return typeof e=="number"?a==="rtl"?`${e}px ${e/2}px ${e/t}px ${e/t}px`:`${e}px ${e/t}px ${e/t}px ${e/2}px`:e}const Zc=[Bn.configure({link:{openOnClick:!1,autolink:!0,defaultProtocol:"https",protocols:["http","https"],isAllowedUri:(e,t)=>{try{const a=e.includes(":")?new URL(e):new URL(`${t.defaultProtocol}://${e}`);if(!t.defaultValidate(a.href))return!1;const s=["ftp","file","mailto"],o=a.protocol.replace(":","");if(s.includes(o)||!t.protocols.map(i=>typeof i=="string"?i:i.scheme).includes(o))return!1;const u=["example-phishing.com","malicious-site.net"],l=a.hostname;return!u.includes(l)}catch{return!1}},shouldAutoLink:e=>{try{const t=e.includes(":")?new URL(e):new URL(`https://${e}`),a=["example-no-autolink.com","another-no-autolink.com"],s=t.hostname;return!a.includes(s)}catch{return!1}}}}),On.configure({types:["heading","paragraph"]}),Wn,Ln,Ze.TextStyle,Ze.Color,Ze.BackgroundColor,ga.TaskList,ga.TaskItem,Ze.LineHeight,Ze.FontSize,Ze.FontFamily,qn.configure({resize:{enabled:!0,alwaysPreserveAspectRatio:!0},inline:!0}),Pn.TableKit.configure({table:{resizable:!0}})],se={WuContentEditor:"_WuContentEditor_lg9m4_8",EditorAction:"_EditorAction_lg9m4_69",EditorActionActive:"_EditorActionActive_lg9m4_72"},hn=f.createContext(null),Qc=({editor:e,children:t,customFonts:a})=>r.jsx(hn.Provider,{value:{editor:e,customFonts:a},children:t}),ye=()=>{const e=f.useContext(hn);if(!e)throw new Error("useToolbar must be used within a ToolbarProvider");return e},Rc=()=>{const{editor:e}=ye(),t=[{id:"bold",icon:"wm-format-bold",tooltip:"Bold",event:()=>e.chain().focus().toggleBold().run()},{id:"underline",icon:"wm-format-underlined",tooltip:"Underline",event:()=>e.chain().focus().toggleUnderline().run()},{id:"italic",icon:"wm-format-italic",tooltip:"Italic",event:()=>e.chain().focus().toggleItalic().run()},{id:"strike",icon:"wm-format-strikethrough",tooltip:"Strikethrough",event:()=>e.chain().focus().toggleStrike().run()}],a=ge.useEditorState({editor:e,selector:s=>{var o,n,u,l;return{bold:(o=s.editor)==null?void 0:o.isActive("bold"),underline:(n=s.editor)==null?void 0:n.isActive("underline"),italic:(u=s.editor)==null?void 0:u.isActive("italic"),strike:(l=s.editor)==null?void 0:l.isActive("strike")}}});return r.jsx(r.Fragment,{children:t.map(s=>r.jsx("button",{title:s.tooltip,className:c(se.EditorAction,(a==null?void 0:a[s.id])&&se.EditorActionActive),onClick:s.event,children:r.jsx(ue,{icon:s.icon})},s.id))})},fa=({action:e,defaultValue:t})=>{var o;const[a,s]=f.useState();return f.useEffect(()=>{s(t||e.items.find(n=>n.active)||e.items[0])},[e,t]),r.jsxs(ft.DropdownMenu,{children:[r.jsx(ft.DropdownMenuTrigger,{className:c(se.EditorAction,e.active&&"wu-bg-blue-p/5 wu-text-blue-p"),children:r.jsx(ue,{icon:a==null?void 0:a.icon})}),r.jsx(ft.DropdownMenuContent,{className:"wu-flex wu-min-w-0 wu-p-1 wu-gap-[6px] wu-border wu-border-blue-p wu-rounded wu-bg-white",align:"start",children:(o=e.items)==null?void 0:o.map(n=>r.jsx(ft.DropdownMenuItem,{onClick:()=>{n.event(),s(n)},title:n.tooltip,children:r.jsx("button",{className:c(se.EditorAction,n.active&&"wu-bg-blue-p/5 wu-text-blue-p"),children:r.jsx(ue,{icon:n.icon})})},n.id))})]})},ed=()=>{const{editor:e}=ye(),t=ge.useEditorState({editor:e,selector:s=>{var o,n,u,l,i,d;return{isParagraph:(o=s.editor)==null?void 0:o.isActive("paragraph"),isH1:(n=s.editor)==null?void 0:n.isActive("heading",{level:1}),isH2:(u=s.editor)==null?void 0:u.isActive("heading",{level:2}),isH3:(l=s.editor)==null?void 0:l.isActive("heading",{level:3}),isH4:(i=s.editor)==null?void 0:i.isActive("heading",{level:4}),isStyle:(d=s.editor)==null?void 0:d.isActive("heading")}}}),a=[{id:"paragraph",icon:"wm-format-paragraph",event:()=>e.chain().focus().setParagraph().run(),active:t.isParagraph},{id:"h1",icon:"wm-format-h1",event:()=>e.chain().focus().setHeading({level:1}).run(),active:t.isH1},{id:"h2",icon:"wm-format-h2",event:()=>e.chain().focus().setHeading({level:2}).run(),active:t.isH2},{id:"h3",icon:"wm-format-h3",event:()=>e.chain().focus().setHeading({level:3}).run(),active:t.isH3},{id:"h4",icon:"wm-format-h4",event:()=>e.chain().focus().setHeading({level:4}).run(),active:t.isH4}];return r.jsx(fa,{action:{id:"style",active:t.isStyle,icon:"wm-format-paragraph",items:a},defaultValue:a.find(s=>s.active)})},td=()=>{const{editor:e,customFonts:t}=ye(),a=ge.useEditorState({editor:e,selector:u=>({currentFontFamily:u.editor.getAttributes("textStyle").fontFamily||""})}),s=["Fira Sans","Inter","Poppins","JetBrains Mono","Montserrat",...t||[]],[o,n]=f.useState(a.currentFontFamily||s[0]);return f.useEffect(()=>{var u;n(((u=a.currentFontFamily)==null?void 0:u.replace(/"/g,""))||s[0])},[a.currentFontFamily]),r.jsxs(Ar,{children:[r.jsx(Dr,{className:se.EditorAction+" wu-transition-colors "+(o!=="Fira Sans"&&se.EditorActionActive),style:{fontFamily:o},title:o||"Font Family",children:o==null?void 0:o[0]}),r.jsx(Ht,{align:"start",className:"wu-border-blue-p wu-rounded",children:s.map(u=>r.jsx(vt,{title:u,onSelect:()=>{e.chain().focus().setFontFamily(u).run(),n(u)},className:o===u?se.EditorActionActive:"",children:u},u))})]})},rd=["e","E","+","-"],ad="wu-border wu-rounded wu-w-10 wu-h-6 wu-text-center [appearance:textfield] [&::-webkit-outer-spin-button]:wu-appearance-none [&::-webkit-inner-spin-button]:wu-appearance-none focus:wu-border-blue-p",bn=1,sd=()=>{const{editor:e}=ye(),[t,a]=f.useState(16),s=u=>{e.chain().focus().setFontSize(u+"px").run()},o=u=>{const l=Math.max(bn,u);a(l),s(l)},n=u=>{rd.includes(u.key)?u.preventDefault():u.key==="Enter"&&s(t)};return r.jsxs("div",{className:"wu-flex wu-items-center wu-gap-1",children:[r.jsx("button",{className:se.EditorAction,onClick:()=>o(t-1),disabled:t<=bn,children:"−"}),r.jsx("input",{type:"number",inputMode:"numeric",pattern:"[0-9]*",className:ad,value:t,onKeyDown:n,onChange:u=>a(u.target.valueAsNumber),onBlur:()=>s(t)}),r.jsx("button",{className:se.EditorAction,onClick:()=>o(t+1),disabled:t>=128,children:"+"})]})},od=()=>{const{editor:e}=ye(),t=ge.useEditorState({editor:e,selector:({editor:a})=>({textColor:a.getAttributes("textStyle").color,bgColor:a.getAttributes("textStyle").backgroundColor})});return r.jsxs(r.Fragment,{children:[r.jsxs("label",{className:se.EditorAction,htmlFor:"text-color",title:"Text Color",children:[r.jsx(ue,{icon:"wm-format-color-text",className:"wu-cursor-pointer",style:{color:t.textColor}}),r.jsx("input",{type:"color",className:"wu-opacity-0 wu-w-0 wu-h-0",id:"text-color",defaultValue:"#545E6B",onChange:a=>e.chain().focus().setColor(a.target.value).run()})]}),r.jsxs("label",{className:se.EditorAction,htmlFor:"bg-color",title:"Background Color",children:[r.jsx(ue,{icon:"wm-border-color",className:"wu-cursor-pointer",style:{color:t.bgColor}}),r.jsx("input",{type:"color",className:"wu-opacity-0 wu-w-0 wu-h-0",id:"bg-color",defaultValue:"#545E6B",onChange:a=>e.chain().focus().setBackgroundColor(a.target.value).run()})]})]})},nd=()=>{const{editor:e}=ye(),t=ge.useEditorState({editor:e,selector:s=>{var o,n,u,l,i,d;return{isUl:(o=s.editor)==null?void 0:o.isActive("bulletList"),isOl:(n=s.editor)==null?void 0:n.isActive("orderedList"),isTodo:(u=s.editor)==null?void 0:u.isActive("taskList"),isList:((l=s.editor)==null?void 0:l.isActive("bulletList"))||((i=s.editor)==null?void 0:i.isActive("orderedList"))||((d=s.editor)==null?void 0:d.isActive("taskList"))}}}),a=[{id:"ul",icon:"wm-format-list-bulleted",event:()=>e.chain().focus().toggleBulletList().run(),active:t.isUl,tooltip:"Bulleted List"},{id:"ol",icon:"wm-format-list-numbered",event:()=>e.chain().focus().toggleOrderedList().run(),active:t.isOl,tooltip:"Numbered List"},{id:"todo",icon:"wm-checklist",event:()=>e.chain().focus().toggleTaskList().run(),active:t.isTodo,tooltip:"To-Do List"}];return r.jsx(fa,{action:{id:"style",active:t.isList,icon:"wm-format-paragraph",items:a}})},ud=()=>{const{editor:e}=ye(),t=ge.useEditorState({editor:e,selector:s=>{var o,n,u;return{superscript:(o=s.editor)==null?void 0:o.isActive("superscript"),subscript:(n=s.editor)==null?void 0:n.isActive("subscript"),quote:(u=s.editor)==null?void 0:u.isActive("blockquote")}}}),a=[{id:"quote",icon:"wm-format-quote",event:()=>e.chain().focus().toggleBlockquote().run(),active:t==null?void 0:t.quote,tooltip:"Blockquote"},{id:"superscript",icon:"wm-superscript",event:()=>e.chain().focus().toggleSuperscript().run(),active:t==null?void 0:t.superscript,tooltip:"Superscript"},{id:"subscript",icon:"wm-subscript",event:()=>e.chain().focus().toggleSubscript().run(),active:t==null?void 0:t.subscript,tooltip:"Subscript"}];return r.jsx(r.Fragment,{children:a.map(s=>r.jsx("button",{title:s.tooltip,className:c(se.EditorAction,(t==null?void 0:t[s.id])&&"wu-bg-blue-p/5 wu-text-blue-p"),onClick:s.event,children:r.jsx(ue,{icon:s.icon})},s.id))})},ld=()=>{const{editor:e}=ye(),t=ge.useEditorState({editor:e,selector:s=>{var o,n,u,l,i,d,w;return{isLeft:(o=s.editor)==null?void 0:o.isActive({textAlign:"left"}),isCenter:(n=s.editor)==null?void 0:n.isActive({textAlign:"center"}),isRight:(u=s.editor)==null?void 0:u.isActive({textAlign:"right"}),isJustify:(l=s.editor)==null?void 0:l.isActive({textAlign:"justify"}),isAligned:((i=s.editor)==null?void 0:i.isActive({textAlign:"center"}))||((d=s.editor)==null?void 0:d.isActive({textAlign:"right"}))||((w=s.editor)==null?void 0:w.isActive({textAlign:"justify"}))}}}),a=[{id:"left",icon:"wm-format-align-left",event:()=>e.chain().focus().setTextAlign("left").run(),tooltip:"Align Left",active:t.isLeft},{id:"center",icon:"wm-format-align-center",event:()=>e.chain().focus().setTextAlign("center").run(),tooltip:"Align Center",active:t.isCenter},{id:"right",icon:"wm-format-align-right",event:()=>e.chain().focus().setTextAlign("right").run(),tooltip:"Align Right",active:t.isRight},{id:"justify",icon:"wm-format-align-justify",event:()=>e.chain().focus().setTextAlign("justify").run(),tooltip:"Justify",active:t.isJustify}];return r.jsx(fa,{action:{id:"style",active:t.isAligned,icon:"wm-format-paragraph",items:a}})},id=()=>{const{editor:e}=ye(),t=ge.useEditorState({editor:e,selector:s=>({code:s.editor.isActive("code")})}),a=[{id:"code",event:()=>e.chain().focus().toggleCode().run(),icon:"wm-code",tooltip:"Code"}];return r.jsx(r.Fragment,{children:a.map(s=>r.jsx("button",{title:s.tooltip,className:c(se.EditorAction,(t==null?void 0:t[s.id])&&"wu-bg-blue-p/5 wu-text-blue-p"),onClick:s.event,children:r.jsx(ue,{icon:s.icon})},s.id))})},cd=()=>{const{editor:e}=ye(),t=[{id:"clear",icon:"wm-format-clear",event:()=>e.chain().focus().clearNodes().unsetAllMarks().run(),tooltip:"Clear Formatting"}];return r.jsx(r.Fragment,{children:t.map(a=>r.jsx("button",{title:a.tooltip,className:c(se.EditorAction),onClick:a.event,children:r.jsx(ue,{icon:a.icon})},a.id))})},dd=()=>{const{editor:e}=ye(),t=ge.useEditorState({editor:e,selector:l=>{var i,d;return{isImage:(i=l.editor)==null?void 0:i.isActive("image"),imageAttrs:(d=l.editor)==null?void 0:d.getAttributes("image")}}}),[a,s]=f.useState(t.imageAttrs.src||""),[o,n]=f.useState(t.imageAttrs.alt||""),u=()=>{e.chain().focus().setImage({src:a,alt:o}).run()};return r.jsx(Ut,{hideCloseButton:!0,Trigger:r.jsx("button",{className:`${se.EditorAction} ${t.isImage&&se.EditorActionActive}`,children:r.jsx(ue,{icon:"wm-image"})}),maxWidth:"400px",children:r.jsxs(jt,{children:[r.jsx(at,{className:"wu-hidden"}),r.jsx(ve,{Label:"Image URL",type:"url",value:a,onChange:l=>s(l.target.value),required:!0}),r.jsx(ve,{Label:"Alt Text",type:"text",value:o,onChange:l=>n(l.target.value)}),r.jsxs("div",{className:"wu-flex wu-justify-end wu-gap-2",children:[r.jsx(ze,{variant:"secondary",children:"Cancel"}),r.jsx(ze,{onClick:u,disabled:!a,children:"Save"})]})]})})},wd=()=>{const{editor:e}=ye(),t=ge.useEditorState({editor:e,selector:i=>{var d,w;return{isLink:(d=i.editor)==null?void 0:d.isActive("link"),linkAttrs:(w=i.editor)==null?void 0:w.getAttributes("link")}}}),[a,s]=f.useState(t.linkAttrs.href||""),[o,n]=f.useState(t.linkAttrs.alt||""),u=()=>{e.chain().focus().insertContent({type:"text",text:o||a,marks:[{type:"link",attrs:{href:a}}]}).run()},l=()=>{const{$from:i}=e.state.selection,d=i.parent.textContent,w=i.parentOffset;let p=w,b=w;for(;p>0&&!/\s/.test(d[p-1]);)p--;for(;b<d.length&&!/\s/.test(d[b]);)b++;const h=i.start(),x=h+p,m=h+b,C=d.slice(p,b);e.commands.setTextSelection({from:x,to:m}),s(t.linkAttrs.href||""),n(C||t.linkAttrs.alt||"")};return r.jsx(Ut,{Trigger:r.jsx("button",{className:`${se.EditorAction} ${t.isLink&&se.EditorActionActive}`,children:r.jsx(ue,{icon:"wm-link"})}),maxWidth:"400px",onOpenChange:i=>i&&l(),children:r.jsxs(jt,{children:[r.jsx(at,{className:"wu-hidden"}),r.jsx(ve,{Label:"Link",type:"url",value:a,onChange:i=>s(i.target.value),required:!0}),r.jsx(ve,{Label:"Text to display",type:"text",value:o,onChange:i=>n(i.target.value)}),r.jsxs("div",{className:"wu-flex wu-justify-end wu-gap-2",children:[t.isLink&&r.jsx(ze,{color:"error",onClick:()=>e.chain().focus().unsetLink().run(),variant:"secondary",children:"Remove"}),r.jsx(ze,{onClick:u,disabled:!a,children:"Save"})]})]})})},fd=()=>{const{editor:e}=ye(),t=ge.useEditorState({editor:e,selector:p=>({isTable:p.editor.isActive("table"),tableAttrs:p.editor.getAttributes("table")})}),[a,s]=f.useState(t.tableAttrs.rows||2),[o,n]=f.useState(t.tableAttrs.cols||2),[u,l]=f.useState(!1),i=f.useRef(null),d=f.useCallback(()=>{i.current=setTimeout(()=>{e.chain().focus().insertTable({rows:a,cols:o,withHeaderRow:u}).run()},100)},[e,a,o,u]),w=f.useCallback(()=>{i.current=setTimeout(()=>{e.chain().focus().deleteTable().run()},100)},[e]);return r.jsx(Ut,{Trigger:r.jsx("button",{className:`${se.EditorAction} ${t.isTable&&se.EditorActionActive}`,children:r.jsx(ue,{icon:"wm-table"})}),hideCloseButton:!0,maxWidth:"360px",children:r.jsxs(jt,{children:[r.jsx(at,{className:"wu-hidden"}),t.isTable?r.jsxs("div",{className:"wu-space-y-4 wu-mt-2",children:[r.jsxs("div",{className:"wu-grid wu-grid-cols-2 wu-gap-4",children:[r.jsx(le,{onClick:()=>e.chain().focus().addColumnBefore().run(),variant:"outline",size:"sm",className:"wu-w-full wu-text-xs",children:"Column +Left"}),r.jsx(le,{onClick:()=>e.chain().focus().addRowBefore().run(),variant:"outline",size:"sm",className:"wu-w-full wu-text-xs",children:"Row +Top"}),r.jsx(le,{onClick:()=>e.chain().focus().addColumnAfter().run(),variant:"outline",size:"sm",className:"wu-w-full wu-text-xs",children:"Column +Right"}),r.jsx(le,{onClick:()=>e.chain().focus().addRowAfter().run(),variant:"outline",size:"sm",className:"wu-w-full wu-text-xs",children:"Row +Bottom"}),r.jsx(le,{onClick:()=>e.chain().focus().deleteColumn().run(),variant:"outline",color:"error",size:"sm",className:"wu-w-full wu-text-xs",children:"Delete Column"}),r.jsx(le,{onClick:()=>e.chain().focus().deleteRow().run(),variant:"outline",color:"error",size:"sm",className:"wu-w-full wu-text-xs",children:"Delete Row"})]}),r.jsx(le,{onClick:()=>e.chain().focus().toggleHeaderRow().run(),variant:"outline",size:"sm",className:"wu-w-full wu-text-xs",children:"Toggle Header Row"})]}):r.jsxs("div",{className:"wu-space-y-3",children:[r.jsxs("div",{className:"wu-grid wu-grid-cols-2 wu-gap-3",children:[r.jsx(ve,{Label:"Rows",type:"number",min:1,value:a,onChange:p=>s(Number(p.target.value))}),r.jsx(ve,{Label:"Columns",type:"number",min:1,value:o,onChange:p=>n(Number(p.target.value))})]}),r.jsx(Ce,{Label:"Add header row",checked:u,onChange:l})]}),r.jsxs("div",{className:"wu-flex wu-justify-end wu-gap-2 wu-mt-4",children:[r.jsx(ze,{variant:"secondary",children:"Cancel"}),!t.isTable&&r.jsx(r.Fragment,{children:r.jsx(ze,{onClick:d,children:"Insert"})}),t.isTable&&r.jsx(ze,{color:"error",onClick:w,children:"Delete Table"})]})]})})},pd=e=>{const{editor:t,customFonts:a,...s}=e;return r.jsx("div",{...s,children:r.jsx(Qc,{editor:t,customFonts:a,children:r.jsxs("div",{className:"wu-flex wu-gap-1 wu-p-2 wu-items-center wu-justify-start wu-border-b wu-border-gray-40",children:[r.jsx(ed,{}),r.jsx(td,{}),r.jsx(Oe,{orientation:"vertical",className:"wu-h-5"}),r.jsx(sd,{}),r.jsx(Oe,{orientation:"vertical",className:"wu-h-5"}),r.jsx(Rc,{}),r.jsx(Oe,{orientation:"vertical",className:"wu-h-5"}),r.jsx(od,{}),r.jsx(Oe,{orientation:"vertical",className:"wu-h-5"}),r.jsx(nd,{}),r.jsx(ld,{}),r.jsx(Oe,{orientation:"vertical",className:"wu-h-5"}),r.jsx(dd,{}),r.jsx(wd,{}),r.jsx(fd,{}),r.jsx(Oe,{orientation:"vertical",className:"wu-h-5"}),r.jsx(ud,{}),r.jsx(id,{}),r.jsx(Oe,{orientation:"vertical",className:"wu-h-5"}),r.jsx(cd,{})]})})})},hd=e=>{const{defaultValue:t,onUpdate:a,className:s,readonly:o,...n}=e,u=ge.useEditor({editable:!o,extensions:Zc,content:t,onUpdate:({editor:l})=>{a&&a(l.getHTML())}});return r.jsxs("div",{className:c(se.WuContentEditor,s),...n,children:[r.jsx(pd,{editor:u,customFonts:e.customFonts,className:"wu-sticky wu-top-0 wu-z-10 wu-bg-white"}),r.jsx(ge.EditorContent,{editor:u,className:"wu-p-4"})]})};window.wickUiVersion="1.22.0",Object.defineProperty(v,"useContext",{enumerable:!0,get:()=>f.useContext}),v.CHART_COLOR_SYSTEM=Jc,v.WuAccordion=$n,v.WuAppHeader=pu,v.WuAppHeaderAccount=Ta,v.WuAppHeaderBar=Ma,v.WuAppHeaderHelp=ka,v.WuAppHeaderMenu=Da,v.WuAppHeaderSearch=wu,v.WuButton=le,v.WuCalender=Cr,v.WuCard=qa,v.WuCardFooter=Va,v.WuCardHeader=za,v.WuCheckbox=Ce,v.WuChip=yu,v.WuCombobox=Du,v.WuContentEditor=hd,v.WuCopyToClipboard=Mu,v.WuDataTable=Ec,v.WuDatePicker=bu,v.WuDateRangePicker=xu,v.WuDisplay=eu,v.WuDrawer=Bu,v.WuDrawerClose=qu,v.WuDrilldown=pn,v.WuFooter=ts,v.WuFormGroup=du,v.WuHeading=Qn,v.WuHelpButton=rs,v.WuIcon=ue,v.WuInput=ve,v.WuInputError=lu,v.WuInputHint=iu,v.WuLabel=xe,v.WuListbox=Gu,v.WuLoader=et,v.WuMenu=ss,v.WuMenuCheckboxItem=Yu,v.WuMenuIcon=Lr,v.WuMenuItem=_r,v.WuMenuItemGroup=Ku,v.WuMenuRadioItem=Ju,v.WuMenuSeparatorItem=Xu,v.WuModal=Ut,v.WuModalClose=ze,v.WuModalContent=jt,v.WuModalFooter=nl,v.WuModalHeader=ol,v.WuMonthPicker=dl,v.WuPagination=ms,v.WuPopover=hl,v.WuPopoverClose=bl,v.WuPrimaryNavbar=fl,v.WuRadioGroup=Ns,v.WuScrollArea=gl,v.WuSecondaryNavbar=pl,v.WuSelect=hs,v.WuSidebar=Wl,v.WuSidebarContent=Pl,v.WuSidebarFooter=Ol,v.WuSidebarGroup=Bl,v.WuSidebarItem=zl,v.WuSidebarMenu=ql,v.WuSidebarTrigger=Bs,v.WuSpotlight=cs,v.WuStackedCard=$l,v.WuStackedCardOverlay=Ul,v.WuStepper=hc,v.WuSubMenu=Zu,v.WuSubtext=Rn,v.WuSwitcher=qo,v.WuTab=Nc,v.WuTable=Tc,v.WuText=Zn,v.WuTextarea=Zo,v.WuTimePicker=rn,v.WuToast=Uc,v.WuToggle=wn,v.WuTooltip=zt,v.WuTranslationContext=nr,v.WuTranslationProvider=Kc,v.WuTruncatedLabel=fu,v.WuVirtualScroll=tt,v.calculatePosition=Hl,v.useTranslation=Gc,v.useTranslationsContext=Yc,v.useWuShowToast=Bc,v.useWuSidebar=je,Object.defineProperty(v,Symbol.toStringTag,{value:"Module"})}));
10
12
  //# sourceMappingURL=index.js.map