@npm-questionpro/wick-ui-lib 1.37.0 → 1.37.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- (function(k,a){typeof exports=="object"&&typeof module<"u"?a(exports,require("react/jsx-runtime"),require("@radix-ui/react-avatar"),require("react"),require("clsx"),require("tailwind-merge"),require("@radix-ui/react-accordion"),require("@radix-ui/react-slot"),require("class-variance-authority"),require("react-day-picker"),require("@radix-ui/react-checkbox"),require("@radix-ui/react-label"),require("cmdk"),require("@radix-ui/react-popover"),require("@radix-ui/react-tooltip"),require("react-virtuoso"),require("@radix-ui/react-dropdown-menu"),require("@tanstack/react-table"),require("date-fns"),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("@radix-ui/react-toast"),require("@radix-ui/react-switch")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","@radix-ui/react-avatar","react","clsx","tailwind-merge","@radix-ui/react-accordion","@radix-ui/react-slot","class-variance-authority","react-day-picker","@radix-ui/react-checkbox","@radix-ui/react-label","cmdk","@radix-ui/react-popover","@radix-ui/react-tooltip","react-virtuoso","@radix-ui/react-dropdown-menu","@tanstack/react-table","date-fns","@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","@radix-ui/react-toast","@radix-ui/react-switch"],a):(k=typeof globalThis<"u"?globalThis:k||self,a(k["wick-ui-lib"]={},k["react/jsx-runtime"],k.RadixUIAvatar,k.React,k.clsx,k.tailwindMerge,k.RadixUIAccordion,k.RadixUISlot,k.ClassVarianceAuthority,k.ReactDayPicker,k.RadixUICheckbox,k.RadixUILabel,k.cmdk,k.RadixUIPopover,k.RadixUITooltip,k.ReactVirtuoso,k.RadixUIDropdownMenu,k.TanstackReactTable,k.dateFns,k.RadixUIDialog,k.RadixUIScrollArea,k.RadixUIRadioGroup,k.RadixUISeparator,k.ReactDOM,k.RadixUIToggleGroup,k.RadixUIToggle,k.RadixUITabs,k.RadixUIToast,k.RadixUISwitch))})(this,(function(k,a,St,p,Sd,Cd,Td,Ct,Be,Ua,Ed,Md,Ne,jt,_r,ja,Id,Ee,$,Ga,Dd,kd,Ad,_d,Pd,Vd,Od,Fd,Ld){"use strict";var Vv=Object.defineProperty;var Ov=(k,a,St)=>a in k?Vv(k,a,{enumerable:!0,configurable:!0,writable:!0,value:St}):k[a]=St;var Te=(k,a,St)=>Ov(k,typeof a!="symbol"?a+"":a,St);var Nd;function pe(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const Tt=pe(St),S=pe(p),it=pe(Td),Pr=pe(Ed),Ka=pe(Md),Gt=pe(jt),Kt=pe(_r),re=pe(Id),te=pe(Ga),ut=pe(Dd),Yt=pe(kd),Ya=pe(Ad),Wd=pe(_d),En=pe(Pd),Xa=pe(Vd),lt=pe(Od),Me=pe(Fd),Vr=pe(Ld),Bd=Cd.extendTailwindMerge({prefix:"wu-"});function m(...e){return Bd(Sd.clsx(e))}const Or=e=>{window==null||window.open(e,"_blank","toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=800,height=600")};function Fr(){return Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15)}function Mn(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 qd=e=>e?/\S+@questionpro\.com/.test(e):!1,Za=it.Root,Lr=S.forwardRef(({className:e,...t},n)=>a.jsx(it.Item,{ref:n,className:m("wu-border-b",e),...t}));Lr.displayName="AccordionItem";const Wr=S.forwardRef(({className:e,children:t,...n},r)=>a.jsx(it.Header,{className:"wu-flex",children:a.jsxs(it.Trigger,{ref:r,className:m("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),...n,children:[t,a.jsx("span",{className:"wu-arrow-icon wm-keyboard-arrow-down wu-transition-transform wu-duration-200"})]})}));Wr.displayName=it.Trigger.displayName;const Br=S.forwardRef(({className:e,children:t,...n},r)=>a.jsx(it.Content,{ref:r,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",...n,children:a.jsx("div",{className:m("wu-pb-4 wu-pt-0",e),children:t})}));Br.displayName=it.Content.displayName;const $d=e=>{const{items:t,className:n,dir:r="ltr"}=e;if(e.type==="multiple"){const{defaultValue:s=[],value:o,onValueChange:i}=e;return a.jsx(Za,{type:"multiple",className:"wu-w-full wu-accordion-container",defaultValue:s,value:o,onValueChange:i,dir:r,children:t.map(({value:u,Summary:l,Details:d,className:c})=>a.jsxs(Lr,{value:u,dir:r,className:m(n,c),children:[a.jsx(Wr,{dir:r,className:"wu-accordion-summary",children:l}),a.jsx(Br,{dir:r,className:"wu-accordion-details",children:d})]},u))})}else{const{defaultValue:s,value:o,onValueChange:i}=e;return a.jsx(Za,{type:"single",className:"wu-w-full wu-accordion-container",defaultValue:s,value:o,onValueChange:i,dir:r,collapsible:!0,children:t.map(({value:u,Summary:l,Details:d,className:c})=>a.jsxs(Lr,{value:u,dir:r,className:m(n,c),children:[a.jsx(Wr,{dir:r,className:"wu-accordion-summary",children:l}),a.jsx(Br,{dir:r,className:"wu-accordion-details",children:d})]},u))})}},qr=S.forwardRef(({className:e,...t},n)=>a.jsx(Tt.Root,{ref:n,className:m("wu-relative wu-flex wu-h-10 wu-w-10 wu-shrink-0 wu-overflow-hidden wu-rounded-full",e),...t}));qr.displayName=Tt.Root.displayName;const $r=S.forwardRef(({className:e,...t},n)=>a.jsx(Tt.Image,{ref:n,className:m("wu-aspect-square wu-h-full wu-w-full",e),...t}));$r.displayName=Tt.Image.displayName;const Hr=S.forwardRef(({className:e,...t},n)=>a.jsx(Tt.Fallback,{ref:n,className:m("wu-flex wu-h-full wu-w-full wu-items-center wu-justify-center wu-rounded-full wu-bg-muted",e),...t}));Hr.displayName=Tt.Fallback.displayName;const fe={timelineContainer:"_timelineContainer_1rtax_1",mainVerticalLine:"_mainVerticalLine_1rtax_5",dateGroup:"_dateGroup_1rtax_9",dateHeader:"_dateHeader_1rtax_13",dateDot:"_dateDot_1rtax_17",dateText:"_dateText_1rtax_21",logList:"_logList_1rtax_25",logItem:"_logItem_1rtax_29",timelineDotSmall:"_timelineDotSmall_1rtax_33",content:"_content_1rtax_37",time:"_time_1rtax_1",tags:"_tags_1rtax_45",tag:"_tag_1rtax_45",tagPrimary:"_tagPrimary_1rtax_53",tagSecondary:"_tagSecondary_1rtax_57",userActionRow:"_userActionRow_1rtax_61",avatar:"_avatar_1rtax_65",actionText:"_actionText_1rtax_69",userName:"_userName_1rtax_73"},Xe=(e,t)=>t.includes(".")?t.split(".").reduce((n,r)=>n==null?void 0:n[r],e):e==null?void 0:e[t],Hd=({log:e,accessorKey:t})=>{const n=Xe(e,t.time),r=Xe(e,t.userName),s=Xe(e,t.userInitials),o=Xe(e,t.userImage??""),i=Xe(e,t.tags??""),u=Xe(e,t.description);return a.jsxs("div",{className:fe.logItem,"data-slot":"log-item",children:[a.jsx("div",{className:fe.timelineDotSmall,"data-slot":"timeline-dot-small"}),a.jsxs("div",{className:fe.content,"data-slot":"content",children:[a.jsx("div",{className:fe.time,"data-slot":"time",children:n}),(i==null?void 0:i.length)>0&&a.jsx("div",{className:fe.tags,"data-slot":"tags",children:i.map((l,d)=>a.jsx("span",{className:m(fe.tag,d===0?fe.tagPrimary:fe.tagSecondary),"data-slot":"tag",children:l},l))}),a.jsxs("div",{className:fe.userActionRow,"data-slot":"user-action-row",children:[a.jsxs(qr,{className:fe.avatar,"data-slot":"avatar",children:[a.jsx($r,{src:o,alt:r,"data-slot":"log-user-avatar-image"}),a.jsx(Hr,{className:"wu-text-[10px] wu-bg-slate-400 wu-text-white","data-slot":"log-user-avatar-fallback",children:s})]}),a.jsxs("p",{className:fe.actionText,"data-slot":"action-text",children:[a.jsx("span",{className:fe.userName,"data-slot":"log-username",children:r})," ",u]})]})]})]})},zd=p.memo(Hd),Ud=({logs:e,accessorKey:t,className:n,...r})=>{const s=p.useMemo(()=>e.reduce((o,i)=>{const u=Xe(i,t.date);return u&&(o[u]=o[u]||[],o[u].push(i)),o},{}),[e,t.date]);return a.jsxs("div",{className:m(fe.timelineContainer,n),"data-slot":"timeline-container",...r,children:[a.jsx("div",{className:fe.mainVerticalLine,"data-slot":"main-vertical-line"}),Object.entries(s).map(([o,i])=>a.jsxs("div",{className:fe.dateGroup,"data-slot":"date-group",children:[a.jsxs("div",{className:fe.dateHeader,"data-slot":"date-header",children:[a.jsx("div",{className:fe.dateDot,"data-slot":"date-dot"}),a.jsx("span",{className:fe.dateText,"data-slot":"date-text",children:o})]}),a.jsx("div",{className:fe.logList,"data-slot":"log-list",children:i.map(u=>{const l=Xe(u,t.id);return a.jsx(zd,{log:u,accessorKey:t},l)})})]},o))]})};function zr(e,t){p.useEffect(()=>{const n=r=>{Array.isArray(e)&&e.some(s=>!s.current||s.current.contains(r.target))||!Array.isArray(e)&&(!e.current||e.current.contains(r.target))||t(r)};return document.addEventListener("mousedown",n),document.addEventListener("touchstart",n),()=>{document.removeEventListener("mousedown",n),document.removeEventListener("touchstart",n)}},[e,t])}const Ur={dropdownContainer:"_dropdownContainer_vvlo9_1",open:"_open_vvlo9_1",dropdownMenu:"_dropdownMenu_vvlo9_1"},Ja=({dir:e,Trigger:t,triggerClassName:n,DropdownContent:r,isAllowActiveStyle:s})=>{const[o,i]=p.useState(!1),u=p.useRef(null),l=p.useRef(null);zr([u,l],()=>i(!1));const d=()=>{i(!o)};return a.jsx(a.Fragment,{children:a.jsx("div",{className:Ur.dropdownContainer,children:a.jsx("ul",{children:a.jsxs("li",{className:m("wu-flex wu-relative",o&&Ur.open),children:[a.jsx("button",{className:m("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",n,s&&o&&"wu-bg-white wu-text-blue-switcher"),onClick:c=>{c.preventDefault(),d()},ref:l,"aria-label":"dropdown-trigger",children:t}),a.jsx("div",{className:m(Ur.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:r})]})})})})},jr=Be.cva(["wu-inline-flex wu-items-center wu-justify-center wu-rounded","wu-whitespace-nowrap wu-text-sm wu-leading-normal 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 wu-leading-normal"],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-rounded-lg","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 disabled:wu-ring-gray-subtle"],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:[]}),Et=S.forwardRef(({className:e,variant:t,size:n,color:r,asChild:s=!1,...o},i)=>{const u=s?Ct.Slot:"button";return a.jsx(u,{className:m(jr({size:n,color:r,variant:t,className:e})),ref:i,...o})});Et.displayName="Button";const ct=p.forwardRef((e,t)=>jd(e,t)),jd=(e,t)=>{const{size:n="md",color:r="#1B87E6",variant:s="dots",...o}=e,i=m("wu-w-[4em] wu-h-[1em] wu-inline-block wu-text-xs wu-relative wu-loader-dot-container");let u="7px";n==="sm"?u="7px":n==="md"?u="12px":n==="lg"?u="18px":typeof n=="string"&&(u=n);const l={backgroundColor:r,width:u,height:u},d=a.jsxs("div",{...o,ref:t,className:m("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:u,height:u,borderTopColor:r}}),e.message&&a.jsx("p",{className:"wu-inline-block wu-loader-message",children:e.message})]}),c=a.jsxs("div",{...o,ref:t,className:m("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:i,style:{fontSize:u},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:s==="spinner"?d:c})};ct.displayName="WuLoader";const Ie=p.forwardRef(({disabled:e,loading:t,variant:n="primary",size:r="md",Icon:s,iconPosition:o="left",children:i,floating:u,className:l,color:d="primary",selected:c,...w},f)=>{const h={primary:"#1986e688",upgrade:"#F5A300",error:"#ef444488"};return a.jsxs(Et,{...w,disabled:e||t,variant:n,size:r,className:m(u&&"wu-shadow-qp","wu-flex wu-items-center wu-justify-center wu-gap-2",o==="right"&&"wu-flex-row-reverse",t?"wu-cursor-not-allowed wu-ring-0":"",c&&"wu-bg-blue-p wu-bg-opacity-15 wu-text-blue-pHoverDeep wu-ring-0",d==="error"&&"hover:wu-text-maroon",l),color:d,style:{backgroundColor:t?h[d]:"",...w.style},ref:f,children:[!t&&s&&a.jsx(a.Fragment,{children:s}),t&&a.jsx(ct,{color:"#fff",size:"sm"}),!t&&i]})});Ie.displayName="WuButton";const Gd=({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(Ie,{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"})]}),Kd=({user:e,dir:t})=>{const n=[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:n.map(({title:r,url:s,icon:o,node:i},u)=>a.jsx("li",{className:u<n.length-1?"wu-border-b wu-border-gray-subtle":"",children:a.jsxs("a",{href:s,className:m("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:m(o,"wu-w-12 wu-text-center")}),a.jsx("span",{children:r})]}),i]})},u))}),a.jsx("hr",{className:"wu-border-gray-subtle"})]})},Yd=({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:m("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(n=>a.jsx("li",{tabIndex:-1,dir:t,children:a.jsx("a",{href:n.url,className:m("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:n.title})},n.title))})]}),a.jsx("hr",{className:"wu-border-gray-subtle"})]}),Xd=({user:e,dir:t})=>{var n,r,s,o,i,u,l,d,c;return a.jsxs("section",{className:m("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:m("wu-flex wu-flex-col wu-gap-1",t==="rtl"&&"wu-text-right"),children:[a.jsx("p",{children:(n=e==null?void 0:e.profile)==null?void 0:n.title}),a.jsxs("a",{href:(r=e==null?void 0:e.license)==null?void 0:r.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:(s=e==null?void 0:e.profile)==null?void 0:s.subtitle}),a.jsx("p",{className:"wu-font-light",children:(o=e==null?void 0:e.profile)==null?void 0:o.companyName})]}),(e==null?void 0:e.license)&&Object.keys(e.license).length>0&&a.jsxs("div",{className:"wu-flex wu-items-center wu-justify-between wu-gap-6 wu-mt-3",dir:t,children:[a.jsx("a",{href:(i=e==null?void 0:e.license)==null?void 0:i.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:(u=e==null?void 0:e.license)==null?void 0:u.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:(d=e==null?void 0:e.license)==null?void 0:d.expiryDatePostFixString}),a.jsx("p",{children:(c=e==null?void 0:e.license)==null?void 0:c.expiryDate})]})]})]})]})},Qa=({user:e,onLogout:t,dir:n,DataCenter:r})=>{var s,o;return e?a.jsx(Ja,{Trigger:a.jsxs(qr,{className:m("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($r,{className:"hover:wu-opacity-80",src:(s=e==null?void 0:e.profile)==null?void 0:s.profilePicture,alt:"User"}),a.jsx(Hr,{children:(o=e==null?void 0:e.profile)==null?void 0:o.initials})]}),dir:n,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:m("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:n,children:[a.jsx(Xd,{user:e,dir:n}),(e==null?void 0:e.settings)&&e.settings.length>0&&a.jsx(Yd,{settings:e.settings,dir:n}),a.jsx(Kd,{user:e,dir:n}),a.jsx(Gd,{onLogout:t,DataCenter:r})]})}):null},Ra=({menuList:e,dir:t})=>{const n=[{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 a.jsx(Ja,{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-blue-switcher wu-app-header-help",isAllowActiveStyle:!0,DropdownContent:a.jsx("ul",{children:(e||n).map((r,s)=>a.jsx("li",{className:"wu-p-0 wu-w-[136px]",dir:t,children:r.target==="window"?a.jsx("a",{tabIndex:0,rel:"noopener noreferrer",onClick:()=>Or(r.link),onKeyDown:o=>{o.key==="Enter"&&Or(r.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
1
+ (function(k,a){typeof exports=="object"&&typeof module<"u"?a(exports,require("react/jsx-runtime"),require("@radix-ui/react-avatar"),require("react"),require("clsx"),require("tailwind-merge"),require("@radix-ui/react-accordion"),require("@radix-ui/react-slot"),require("class-variance-authority"),require("react-day-picker"),require("@radix-ui/react-checkbox"),require("@radix-ui/react-label"),require("cmdk"),require("@radix-ui/react-popover"),require("@radix-ui/react-tooltip"),require("react-virtuoso"),require("@radix-ui/react-dropdown-menu"),require("@tanstack/react-table"),require("date-fns"),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("@radix-ui/react-toast"),require("@radix-ui/react-switch")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","@radix-ui/react-avatar","react","clsx","tailwind-merge","@radix-ui/react-accordion","@radix-ui/react-slot","class-variance-authority","react-day-picker","@radix-ui/react-checkbox","@radix-ui/react-label","cmdk","@radix-ui/react-popover","@radix-ui/react-tooltip","react-virtuoso","@radix-ui/react-dropdown-menu","@tanstack/react-table","date-fns","@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","@radix-ui/react-toast","@radix-ui/react-switch"],a):(k=typeof globalThis<"u"?globalThis:k||self,a(k["wick-ui-lib"]={},k["react/jsx-runtime"],k.RadixUIAvatar,k.React,k.clsx,k.tailwindMerge,k.RadixUIAccordion,k.RadixUISlot,k.ClassVarianceAuthority,k.ReactDayPicker,k.RadixUICheckbox,k.RadixUILabel,k.cmdk,k.RadixUIPopover,k.RadixUITooltip,k.ReactVirtuoso,k.RadixUIDropdownMenu,k.TanstackReactTable,k.dateFns,k.RadixUIDialog,k.RadixUIScrollArea,k.RadixUIRadioGroup,k.RadixUISeparator,k.ReactDOM,k.RadixUIToggleGroup,k.RadixUIToggle,k.RadixUITabs,k.RadixUIToast,k.RadixUISwitch))})(this,(function(k,a,St,p,Sd,Cd,Td,Ct,Be,Ua,Ed,Md,Ne,jt,_r,ja,Id,Ee,$,Ga,Dd,kd,Ad,_d,Pd,Vd,Od,Fd,Ld){"use strict";var Vv=Object.defineProperty;var Ov=(k,a,St)=>a in k?Vv(k,a,{enumerable:!0,configurable:!0,writable:!0,value:St}):k[a]=St;var Te=(k,a,St)=>Ov(k,typeof a!="symbol"?a+"":a,St);var Nd;function pe(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const Tt=pe(St),S=pe(p),it=pe(Td),Pr=pe(Ed),Ka=pe(Md),Gt=pe(jt),Kt=pe(_r),re=pe(Id),te=pe(Ga),ut=pe(Dd),Yt=pe(kd),Ya=pe(Ad),Wd=pe(_d),En=pe(Pd),Xa=pe(Vd),lt=pe(Od),Me=pe(Fd),Vr=pe(Ld),Bd=Cd.extendTailwindMerge({prefix:"wu-"});function m(...e){return Bd(Sd.clsx(e))}const Or=e=>{window==null||window.open(e,"_blank","toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=800,height=600")};function Fr(){return Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15)}function Mn(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 qd=e=>e?/\S+@questionpro\.com/.test(e):!1,Za=it.Root,Lr=S.forwardRef(({className:e,...t},n)=>a.jsx(it.Item,{ref:n,className:m("wu-border-b",e),...t}));Lr.displayName="AccordionItem";const Wr=S.forwardRef(({className:e,children:t,...n},r)=>a.jsx(it.Header,{className:"wu-flex",children:a.jsxs(it.Trigger,{ref:r,className:m("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),...n,children:[t,a.jsx("span",{className:"wu-arrow-icon wm-keyboard-arrow-down wu-transition-transform wu-duration-200"})]})}));Wr.displayName=it.Trigger.displayName;const Br=S.forwardRef(({className:e,children:t,...n},r)=>a.jsx(it.Content,{ref:r,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",...n,children:a.jsx("div",{className:m("wu-pb-4 wu-pt-0",e),children:t})}));Br.displayName=it.Content.displayName;const $d=e=>{const{items:t,className:n,dir:r="ltr"}=e;if(e.type==="multiple"){const{defaultValue:s=[],value:o,onValueChange:i}=e;return a.jsx(Za,{type:"multiple",className:"wu-w-full wu-accordion-container",defaultValue:s,value:o,onValueChange:i,dir:r,children:t.map(({value:u,Summary:l,Details:d,className:c})=>a.jsxs(Lr,{value:u,dir:r,className:m(n,c),children:[a.jsx(Wr,{dir:r,className:"wu-accordion-summary",children:l}),a.jsx(Br,{dir:r,className:"wu-accordion-details",children:d})]},u))})}else{const{defaultValue:s,value:o,onValueChange:i}=e;return a.jsx(Za,{type:"single",className:"wu-w-full wu-accordion-container",defaultValue:s,value:o,onValueChange:i,dir:r,collapsible:!0,children:t.map(({value:u,Summary:l,Details:d,className:c})=>a.jsxs(Lr,{value:u,dir:r,className:m(n,c),children:[a.jsx(Wr,{dir:r,className:"wu-accordion-summary",children:l}),a.jsx(Br,{dir:r,className:"wu-accordion-details",children:d})]},u))})}},qr=S.forwardRef(({className:e,...t},n)=>a.jsx(Tt.Root,{ref:n,className:m("wu-relative wu-flex wu-h-10 wu-w-10 wu-shrink-0 wu-overflow-hidden wu-rounded-full",e),...t}));qr.displayName=Tt.Root.displayName;const $r=S.forwardRef(({className:e,...t},n)=>a.jsx(Tt.Image,{ref:n,className:m("wu-aspect-square wu-h-full wu-w-full",e),...t}));$r.displayName=Tt.Image.displayName;const Hr=S.forwardRef(({className:e,...t},n)=>a.jsx(Tt.Fallback,{ref:n,className:m("wu-flex wu-h-full wu-w-full wu-items-center wu-justify-center wu-rounded-full wu-bg-muted",e),...t}));Hr.displayName=Tt.Fallback.displayName;const fe={timelineContainer:"_timelineContainer_1rtax_1",mainVerticalLine:"_mainVerticalLine_1rtax_5",dateGroup:"_dateGroup_1rtax_9",dateHeader:"_dateHeader_1rtax_13",dateDot:"_dateDot_1rtax_17",dateText:"_dateText_1rtax_21",logList:"_logList_1rtax_25",logItem:"_logItem_1rtax_29",timelineDotSmall:"_timelineDotSmall_1rtax_33",content:"_content_1rtax_37",time:"_time_1rtax_1",tags:"_tags_1rtax_45",tag:"_tag_1rtax_45",tagPrimary:"_tagPrimary_1rtax_53",tagSecondary:"_tagSecondary_1rtax_57",userActionRow:"_userActionRow_1rtax_61",avatar:"_avatar_1rtax_65",actionText:"_actionText_1rtax_69",userName:"_userName_1rtax_73"},Xe=(e,t)=>t.includes(".")?t.split(".").reduce((n,r)=>n==null?void 0:n[r],e):e==null?void 0:e[t],Hd=({log:e,accessorKey:t})=>{const n=Xe(e,t.time),r=Xe(e,t.userName),s=Xe(e,t.userInitials),o=Xe(e,t.userImage??""),i=Xe(e,t.tags??""),u=Xe(e,t.description);return a.jsxs("div",{className:fe.logItem,"data-slot":"log-item",children:[a.jsx("div",{className:fe.timelineDotSmall,"data-slot":"timeline-dot-small"}),a.jsxs("div",{className:fe.content,"data-slot":"content",children:[a.jsx("div",{className:fe.time,"data-slot":"time",children:n}),(i==null?void 0:i.length)>0&&a.jsx("div",{className:fe.tags,"data-slot":"tags",children:i.map((l,d)=>a.jsx("span",{className:m(fe.tag,d===0?fe.tagPrimary:fe.tagSecondary),"data-slot":"tag",children:l},l))}),a.jsxs("div",{className:fe.userActionRow,"data-slot":"user-action-row",children:[a.jsxs(qr,{className:fe.avatar,"data-slot":"avatar",children:[a.jsx($r,{src:o,alt:r,"data-slot":"log-user-avatar-image"}),a.jsx(Hr,{className:"wu-text-[10px] wu-bg-slate-400 wu-text-white","data-slot":"log-user-avatar-fallback",children:s})]}),a.jsxs("p",{className:fe.actionText,"data-slot":"action-text",children:[a.jsx("span",{className:fe.userName,"data-slot":"log-username",children:r})," ",u]})]})]})]})},zd=p.memo(Hd),Ud=({logs:e,accessorKey:t,className:n,...r})=>{const s=p.useMemo(()=>e.reduce((o,i)=>{const u=Xe(i,t.date);return u&&(o[u]=o[u]||[],o[u].push(i)),o},{}),[e,t.date]);return a.jsxs("div",{className:m(fe.timelineContainer,n),"data-slot":"timeline-container",...r,children:[a.jsx("div",{className:fe.mainVerticalLine,"data-slot":"main-vertical-line"}),Object.entries(s).map(([o,i])=>a.jsxs("div",{className:fe.dateGroup,"data-slot":"date-group",children:[a.jsxs("div",{className:fe.dateHeader,"data-slot":"date-header",children:[a.jsx("div",{className:fe.dateDot,"data-slot":"date-dot"}),a.jsx("span",{className:fe.dateText,"data-slot":"date-text",children:o})]}),a.jsx("div",{className:fe.logList,"data-slot":"log-list",children:i.map(u=>{const l=Xe(u,t.id);return a.jsx(zd,{log:u,accessorKey:t},l)})})]},o))]})};function zr(e,t){p.useEffect(()=>{const n=r=>{Array.isArray(e)&&e.some(s=>!s.current||s.current.contains(r.target))||!Array.isArray(e)&&(!e.current||e.current.contains(r.target))||t(r)};return document.addEventListener("mousedown",n),document.addEventListener("touchstart",n),()=>{document.removeEventListener("mousedown",n),document.removeEventListener("touchstart",n)}},[e,t])}const Ur={dropdownContainer:"_dropdownContainer_vvlo9_1",open:"_open_vvlo9_1",dropdownMenu:"_dropdownMenu_vvlo9_1"},Ja=({dir:e,Trigger:t,triggerClassName:n,DropdownContent:r,isAllowActiveStyle:s})=>{const[o,i]=p.useState(!1),u=p.useRef(null),l=p.useRef(null);zr([u,l],()=>i(!1));const d=()=>{i(!o)};return a.jsx(a.Fragment,{children:a.jsx("div",{className:Ur.dropdownContainer,children:a.jsx("ul",{children:a.jsxs("li",{className:m("wu-flex wu-relative",o&&Ur.open),children:[a.jsx("button",{className:m("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",n,s&&o&&"wu-bg-white wu-text-blue-switcher"),onClick:c=>{c.preventDefault(),d()},ref:l,"aria-label":"dropdown-trigger",children:t}),a.jsx("div",{className:m(Ur.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:r})]})})})})},jr=Be.cva(["wu-inline-flex wu-items-center wu-justify-center wu-rounded","wu-whitespace-nowrap wu-text-sm wu-leading-normal 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 wu-leading-normal"],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-rounded-lg","wu-text-base"]},color:{primary:["wu-bg-blue-p hover:wu-bg-blue-pHoverDeep","wu-text-blue-p hover:wu-text-blue-q","wu-border wu-border-blue-p hover:wu-border-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-border-1 wu-border-orange-soft hover:wu-border-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-border-1 wu-border-red-deep hover:wu-border-red-soft","focus-visible:wu-outline-red-deep/50"]},variant:{primary:["wu-text-white hover:wu-text-white","wu-border-0"],secondary:["wu-bg-transparent hover:wu-bg-black hover:wu-bg-opacity-[0.04]","wu-border-0"],outline:["wu-bg-white hover:wu-text-white","disabled:wu-bg-transparent disabled:wu-border-gray-subtle"],rounded:["wu-text-white hover:wu-text-white","wu-border-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-border-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-border-0","disabled:wu-grayscale disabled:wu-opacity-80"]}},defaultVariants:{variant:"primary",size:"md",color:"primary"},compoundVariants:[]}),Et=S.forwardRef(({className:e,variant:t,size:n,color:r,asChild:s=!1,...o},i)=>{const u=s?Ct.Slot:"button";return a.jsx(u,{className:m(jr({size:n,color:r,variant:t,className:e})),ref:i,...o})});Et.displayName="Button";const ct=p.forwardRef((e,t)=>jd(e,t)),jd=(e,t)=>{const{size:n="md",color:r="#1B87E6",variant:s="dots",...o}=e,i=m("wu-w-[4em] wu-h-[1em] wu-inline-block wu-text-xs wu-relative wu-loader-dot-container");let u="7px";n==="sm"?u="7px":n==="md"?u="12px":n==="lg"?u="18px":typeof n=="string"&&(u=n);const l={backgroundColor:r,width:u,height:u},d=a.jsxs("div",{...o,ref:t,className:m("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:u,height:u,borderTopColor:r}}),e.message&&a.jsx("p",{className:"wu-inline-block wu-loader-message",children:e.message})]}),c=a.jsxs("div",{...o,ref:t,className:m("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:i,style:{fontSize:u},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:s==="spinner"?d:c})};ct.displayName="WuLoader";const Ie=p.forwardRef(({disabled:e,loading:t,variant:n="primary",size:r="md",Icon:s,iconPosition:o="left",children:i,floating:u,className:l,color:d="primary",selected:c,...w},f)=>{const h={primary:"#1986e688",upgrade:"#F5A300",error:"#ef444488"};return a.jsxs(Et,{...w,disabled:e||t,variant:n,size:r,className:m(u&&"wu-shadow-qp","wu-flex wu-items-center wu-justify-center wu-gap-2",o==="right"&&"wu-flex-row-reverse",t?"wu-cursor-not-allowed wu-ring-0":"",c&&"wu-bg-blue-p wu-bg-opacity-15 wu-text-blue-pHoverDeep wu-ring-0",d==="error"&&"hover:wu-text-maroon",l),color:d,style:{backgroundColor:t?h[d]:"",...w.style},ref:f,children:[!t&&s&&a.jsx(a.Fragment,{children:s}),t&&a.jsx(ct,{color:"#fff",size:"sm"}),!t&&i]})});Ie.displayName="WuButton";const Gd=({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(Ie,{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"})]}),Kd=({user:e,dir:t})=>{const n=[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:n.map(({title:r,url:s,icon:o,node:i},u)=>a.jsx("li",{className:u<n.length-1?"wu-border-b wu-border-gray-subtle":"",children:a.jsxs("a",{href:s,className:m("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:m(o,"wu-w-12 wu-text-center")}),a.jsx("span",{children:r})]}),i]})},u))}),a.jsx("hr",{className:"wu-border-gray-subtle"})]})},Yd=({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:m("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(n=>a.jsx("li",{tabIndex:-1,dir:t,children:a.jsx("a",{href:n.url,className:m("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:n.title})},n.title))})]}),a.jsx("hr",{className:"wu-border-gray-subtle"})]}),Xd=({user:e,dir:t})=>{var n,r,s,o,i,u,l,d,c;return a.jsxs("section",{className:m("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:m("wu-flex wu-flex-col wu-gap-1",t==="rtl"&&"wu-text-right"),children:[a.jsx("p",{children:(n=e==null?void 0:e.profile)==null?void 0:n.title}),a.jsxs("a",{href:(r=e==null?void 0:e.license)==null?void 0:r.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:(s=e==null?void 0:e.profile)==null?void 0:s.subtitle}),a.jsx("p",{className:"wu-font-light",children:(o=e==null?void 0:e.profile)==null?void 0:o.companyName})]}),(e==null?void 0:e.license)&&Object.keys(e.license).length>0&&a.jsxs("div",{className:"wu-flex wu-items-center wu-justify-between wu-gap-6 wu-mt-3",dir:t,children:[a.jsx("a",{href:(i=e==null?void 0:e.license)==null?void 0:i.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:(u=e==null?void 0:e.license)==null?void 0:u.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:(d=e==null?void 0:e.license)==null?void 0:d.expiryDatePostFixString}),a.jsx("p",{children:(c=e==null?void 0:e.license)==null?void 0:c.expiryDate})]})]})]})]})},Qa=({user:e,onLogout:t,dir:n,DataCenter:r})=>{var s,o;return e?a.jsx(Ja,{Trigger:a.jsxs(qr,{className:m("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($r,{className:"hover:wu-opacity-80",src:(s=e==null?void 0:e.profile)==null?void 0:s.profilePicture,alt:"User"}),a.jsx(Hr,{children:(o=e==null?void 0:e.profile)==null?void 0:o.initials})]}),dir:n,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:m("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:n,children:[a.jsx(Xd,{user:e,dir:n}),(e==null?void 0:e.settings)&&e.settings.length>0&&a.jsx(Yd,{settings:e.settings,dir:n}),a.jsx(Kd,{user:e,dir:n}),a.jsx(Gd,{onLogout:t,DataCenter:r})]})}):null},Ra=({menuList:e,dir:t})=>{const n=[{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 a.jsx(Ja,{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-blue-switcher wu-app-header-help",isAllowActiveStyle:!0,DropdownContent:a.jsx("ul",{children:(e||n).map((r,s)=>a.jsx("li",{className:"wu-p-0 wu-w-[136px]",dir:t,children:r.target==="window"?a.jsx("a",{tabIndex:0,rel:"noopener noreferrer",onClick:()=>Or(r.link),onKeyDown:o=>{o.key==="Enter"&&Or(r.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
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:a.jsx(eo,{item:r,dir:t})}):a.jsx("a",{href:r.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
3
  focus-visible:wu-bg-black
4
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:a.jsx(eo,{item:r,dir:t})})},s))})})},eo=({item:e,dir:t})=>a.jsxs("div",{className:"wu-flex wu-items-center wu-gap-[5px]",dir:t,children:[a.jsx("div",{className:"wu-flex wu-items-center wu-justify-center wu-w-6 wu-h-6",children:a.jsx("span",{className:m("wu-text-xl wu-text-gray-lead",e.icon)})}),a.jsx("p",{className:"wu-text-sm wu-text-gray-lead",children:e.title})]}),Zd=e=>{const[t,n]=p.useState(()=>window.innerWidth<=e);return p.useEffect(()=>{const r=()=>{n(window.innerWidth<=e)};return window.addEventListener("resize",r),()=>{window.removeEventListener("resize",r)}},[e]),t};function Jd({productCategories:e,openCategory:t,setOpenCategory:n}){const r=(u,l)=>{const d=l[u];if(d){d.focus();const c=e[u]||null;n(c)}},s=(u,l,d,c)=>{u.preventDefault();const w=d==="down"?l+1:l-1;r(w,c)},o=(u,l,d,c)=>{t!=null&&t.products&&t.products[t.products.length-1].name===c&&(u.preventDefault(),r(l+1,d))},i=(u,l)=>{u.preventDefault();const d=e[l]===t?null:e[l];n(d)};return function(l,d,c){const w=document.querySelectorAll("[data-product-category]"),{key:f}=l;switch(f){case"ArrowDown":s(l,d,"down",w);break;case"ArrowUp":s(l,d,"up",w);break;case"Tab":o(l,d,w,c);break;case"Enter":case" ":i(l,d);break}}}const Qd=e=>{const{size:t="lg",className:n,children:r,...s}=e,o={sm:"wu-text-body-3",md:"wu-text-body-2",lg:"wu-text-body-1"},i=e.as||"div";return a.jsx(i,{...s,className:m(o[t],n),children:r})},Rd=e=>{const{size:t="xl",className:n,children:r,...s}=e,o={sm:"h4",md:"h3",lg:"h2",xl:"h1"},i={sm:"wu-text-heading-4",md:"wu-text-heading-3",lg:"wu-text-heading-2",xl:"wu-text-heading-1"},u=o[t];return a.jsx(u,{...s,className:m(i[t],n),children:r})},ew=e=>{const{size:t="lg",className:n,children:r,...s}=e,o={sm:"wu-text-sub-3",md:"wu-text-sub-2",lg:"wu-text-sub-1"},i=e.as||"div";return a.jsx(i,{...s,className:m(o[t],n),children:r})},tw=e=>{const{size:t="lg",className:n,children:r,...s}=e,o={md:"wu-text-display-2",lg:"wu-text-display-1"},i=e.as||"h1";return a.jsx(i,{...s,className:m(o[t],n),children:r})},Ve=e=>{const{icon:t,className:n,...r}=e;return a.jsx("span",{...r,className:m(t,n),role:"presentation","aria-label":t})},nw=({buttonRef:e,handleDropdownToggle:t,handleKeyDown:n,isDropdownOpen:r,activeProductName:s,dir:o="ltr",homeLink:i="/"})=>a.jsxs("button",{ref:e,type:"button",className:m("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:u=>{r&&u.key==="ArrowDown"&&n(u,-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:i,children:a.jsx(Ve,{icon:"wc-logo",className:"wu-text-xl wu-leading-4 wu-relative wu-top-1"})}),s,a.jsx("span",{className:m("wm-arrow-drop-down wu-text-2xl wu-transition-transform wu-duration-300",r&&"wu-rotate-180",o==="rtl"?"wu-mr-auto":"wu-ml-auto")})]}),se={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"},rw=({category:e,dir:t="ltr",openCategory:n})=>{const r=e.active?"#c5cce0":"#f0c36a",s=(n==null?void 0:n.name)===e.name,o=m("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",s&&"wu-hidden","wu-relative wu-top-[5px]"),i=m("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",s&&"wu-hidden","wu-relative wu-top-1");return a.jsxs("div",{className:m("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:se.productCategoryBorderTop,style:{backgroundColor:r}}),a.jsxs("div",{className:"wu-flex wu-items-center wu-px-1 wu-relative wu-top-1",children:[a.jsx("div",{className:"wu-w-[56px] wu-h-[56px] wu-flex wu-items-center wu-justify-center",children:a.jsx("img",{src:e.logo,alt:e.name,width:"32px",height:"32px"})}),a.jsx("span",{className:"wu-text-sm wu-leading-5 wu-text-blue-q wu-relative wu-top-[1px]",children:e.name})]}),e.active?a.jsx("span",{className:o}):a.jsx("span",{className:i})]})},sw={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"},aw=({product:e,currentProduct:t,activeProductName:n,dir:r,focusItem:s,setFocusItem:o})=>{const[i,u]=p.useState(e.name===t),l=e.name===n,d=e.name===t,c=!e.active,w="#1b3380",f="#c5cce0",h="#ffcf70",b=m("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",i&&"wu-font-normal",e.active&&i&&"wu-text-blue-q"),g=m("wu-text-blue-p wu-text-base",d&&"wu-text-blue-q",!e.active&&"wu-text-gray-subtle",e.active&&i&&"wu-text-blue-q"),v=i||s===e.name||l?w:f;return a.jsxs("li",{className:m(se.productListItem,"focus-visible:wu-outline-none focus:wu-outline-none wu-sub-product-list-item",(l||i)&&se.activeProduct,e.name.length>15&&window.innerWidth>768&&"wu-w-[130px] wu-min-w-[130px]",s===e.name&&se.activeProduct,"wu-product-item"),onMouseOver:()=>u(!0),onMouseOut:()=>u(!1),"aria-label":e.name,"aria-disabled":c,dir:r,onKeyDown:N=>{if(N.key==="Enter"){N.preventDefault();const y=N.currentTarget.querySelector("a");y&&y.click()}},onFocus:()=>{o(e.name)},onBlur:()=>o(""),children:[a.jsx("div",{className:m(se.topBorder,r==="rtl"&&se.topBorderRtl),style:{backgroundColor:c?h:v}}),a.jsxs("a",{className:m(se.productLink,"focus:wu-outline-none focus-visible:wu-outline-none"),href:e.link||"#",tabIndex:0,children:[a.jsx("span",{className:m(g,sw[e.icon||""]),"aria-hidden":!0}),a.jsx("span",{className:m(b),children:e.name})]})]},e.name)},ow=({category:e,currentProduct:t,activeProductName:n,dir:r="ltr",focusItem:s,setFocusItem:o,borderColorLocked:i="#f5a300"})=>{const{products:u=[],active:l}=e,d=p.useMemo(()=>u.filter(b=>b.active).sort((b,g)=>(b.order||100)-(g.order||100)),[u]),c=p.useMemo(()=>u.filter(b=>!b.active),[u]),[w,f]=p.useState(i),h=b=>b.map((g,v)=>a.jsx(aw,{product:g,currentProduct:t,activeProductName:n,dir:r,focusItem:s,setFocusItem:o},v));return l?a.jsxs(a.Fragment,{children:[h(d),c.length>0&&a.jsxs("li",{className:m(se.productListItem,"focus:wu-outline-none focus-visible:wu-outline-none !wu-bg-[#f5f5f5] hover:!wu-bg-[#eeeeee] wu-group"),onMouseOver:()=>f("#f5a300"),onMouseOut:()=>f(i),"aria-label":"Upgrade to unlock",children:[a.jsx("div",{className:m(se.topBorder,r==="rtl"&&se.topBorderRtl),style:{backgroundColor:w},"aria-label":"top-border"}),a.jsxs("a",{href:"https://www.questionpro.com/a/showUpgradeUser.do",className:m(se.productLink,"wu-flex wu-flex-col wu-items-center wu-justify-center wu-py-2 wu-min-w-[88px]"),children:[a.jsx("span",{className:"wu-text-base wu-transition-colors wm-lock !wu-text-orange-soft group-hover:wu-text-orange-deep"}),a.jsxs("span",{className:"wu-text-[10px] wu-leading-[10px] wu-text-center wu-pt-1 !wu-text-orange-deep",children:["Upgrade to ",a.jsx("br",{})," unlock"]})]})]}),h(c)]}):a.jsxs("li",{className:m(se.productListItem,se.learnMore,"focus:wu-outline-none focus-visible:wu-outline-none wu-product-item-inactive !wu-bg-[#f5f5f5] hover:!wu-bg-[#eeeeee]",s==="learn"&&"activeProduct"),tabIndex:0,onFocus:()=>o("learn"),onBlur:()=>o(""),"aria-label":"Learn More",children:[a.jsx("div",{className:m(se.topBorder,r==="rtl"&&se.topBorderRtl),style:{backgroundColor:i}}),a.jsx("a",{className:se.productLink,href:"https://www.questionpro.com/a/showUpgradeUser.do",tabIndex:-1,children:a.jsx("span",{className:"wu-text-[#f99e03]",children:"Learn More"})})]})},to=({dropdownRef:e,dir:t,isDropdownOpen:n,productCategories:r,openCategory:s,setOpenCategory:o,handleKeyDown:i,expandAll:u,activeProductName:l,focusItem:d,setFocusItem:c})=>{const w="#ffcf70",[h,b]=p.useState(window.innerWidth>768);return p.useEffect(()=>{const g=()=>{b(window.innerWidth>768)};return window.addEventListener("resize",g),()=>window.removeEventListener("resize",g)},[]),a.jsx("ul",{className:m(se.productDropdownMenu,n&&se.productDropdownMenuOpen,t==="rtl"&&se.rtlDropdownMenu,"wu-switcher-container"),ref:e,dir:t,"aria-label":"product-dropdown-menu","data-state":n?"open":"closed",children:r.map((g,v)=>a.jsxs("li",{className:m(se.productCategory,"focus:wu-outline-none focus-visible:wu-outline-none wu-h-16 wu-category-item",s===g&&se.open,u&&se.open),onMouseEnter:()=>h&&o(g),onMouseLeave:()=>h&&o(null),onClick:()=>{h||o(N=>N===g?null:g)},"aria-label":g.name,dir:t,onKeyDown:N=>i(N,v),tabIndex:0,"data-product-category":!0,children:[a.jsx(rw,{category:g,dir:t,openCategory:s}),a.jsx("ul",{className:m(se.productList,t==="rtl"&&se.rtlProductList),dir:t,children:a.jsx(ow,{category:g,dir:t,activeProductName:l,currentProduct:g.name,focusItem:d,setFocusItem:c,borderColorLocked:w})})]},g.name))})},iw=({isProductButtonShow:e,isDropdownOpen:t,activeProductColor:n,activeProductBgColor:r,activeProductName:s,dir:o,smallScreenButtonRef:i,handleDropdownToggle:u,handleKeyDown:l})=>a.jsx("div",{className:m("wu-absolute wu-top-11 wu-transition-all wu-duration-300 wu-ease-in-out wu-transform wu-opacity-100 wu-w-[256px] wu-z-10",e?o==="rtl"?"wu-right-0 wu-overflow-hidden":"wu-translate-x-0 wu-left-0":o==="rtl"?"wu-right-0 wu-w-0":"wu--translate-x-full"),style:{backgroundColor:t?n.hover:r},children:a.jsxs("button",{ref:i,type:"button",className:m("wu-text-base wu-leading-[48px] wu-flex wu-items-center wu-justify-center wu-px-2 wu-gap-2 wu-w-full focus:wu-outline-none focus-visible:wu-bg-white/10 wu-switcher-trigger",e?"wu-flex":o==="rtl"?"wu-hidden":"wu-flex"),onClick:u,onKeyDown:d=>{t&&d.key==="ArrowDown"&&l(d,-1)},"aria-label":"small-screen-product-btn",children:[s,a.jsx("span",{className:m("wm-arrow-drop-down wu-text-2xl wu-transition-transform wu-duration-300",t&&"wu-rotate-180")})]})}),uw=({dir:e,isProductButtonShow:t,smallScreenToggleButtonRef:n,setIsProductButtonShow:r,setDropdownOpen:s})=>{const o=()=>{r(i=>!i),t&&s(!1)};return a.jsxs("button",{className:m("wu-relative wu-w-10 wu-h-10 wu-flex wu-flex-col wu-justify-center wu-items-center",e==="rtl"?"wu-mr-4":"wu-ml-4"),onClick:o,ref:n,"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"}`})]})},no=({productCategories:e,activeProductName:t,activeProductColor:n={base:"#1b87e6",hover:"#54A5EC"},dir:r,homeLink:s,expandAll:o})=>{const i=p.useRef(null),u=p.useRef(null),l=p.useRef(null),d=p.useRef(null),[c,w]=p.useState(!1),[f,h]=p.useState(null),[b,g]=p.useState(n.base),[v,N]=p.useState(""),[y,C]=p.useState(!1),E=Zd(768);zr([u,i],()=>{w(!1),h(null)}),zr([l,d,u],()=>{C(!1),w(!1),h(null)}),p.useEffect(()=>{const T=M=>{M.key==="Escape"&&w(!1)};return document.addEventListener("keydown",T),()=>{document.removeEventListener("keydown",T)}},[c]),p.useEffect(()=>g(n.base),[n.base]);const x=T=>{T.preventDefault(),T.stopPropagation(),w(M=>{const I=!M;return I||h(null),I})},D=(T,M)=>{Jd({productCategories:e,openCategory:f,setOpenCategory:h})(T,M,v)};return a.jsx("div",{className:m("wu-inline-flex wu-items-center wu-justify-between wu-relative wu-z-auto wu-h-12 wu-text-white"),children:E?a.jsxs("div",{className:"wu-relative wu-flex",children:[a.jsx(uw,{dir:r,isProductButtonShow:y,smallScreenToggleButtonRef:d,setDropdownOpen:w,setIsProductButtonShow:C}),a.jsx(iw,{isProductButtonShow:y,isDropdownOpen:c,activeProductColor:n,activeProductBgColor:b,activeProductName:t,handleDropdownToggle:x,smallScreenButtonRef:l,handleKeyDown:D,dir:r}),a.jsx("div",{className:m("wu-absolute wu-top-[92px] wu-left-0 wu-text-[18px]",r==="rtl"&&"wu-right-[256px] wu-left-auto"),children:a.jsx(to,{activeProductName:t,focusItem:v,setFocusItem:N,handleKeyDown:D,isDropdownOpen:c,openCategory:f,productCategories:e,setOpenCategory:h,dropdownRef:u,expandAll:o,dir:r})})]}):a.jsxs("div",{className:"wu-relative wu-flex wu-items-center wu-justify-start wu-h-full wu-w-[256px]",dir:r,style:{backgroundColor:c?n.hover:b},onMouseOver:()=>g(n.hover),onMouseOut:()=>g(n.base),children:[a.jsx(nw,{activeProductName:t,dir:r,homeLink:s,buttonRef:i,handleDropdownToggle:x,handleKeyDown:D,isDropdownOpen:c}),a.jsx(to,{activeProductName:t,focusItem:v,setFocusItem:N,handleKeyDown:D,isDropdownOpen:c,openCategory:f,productCategories:e,setOpenCategory:h,dropdownRef:u,expandAll:o,dir:r})]})})},ro=({children:e,dir:t,className:n})=>a.jsx("section",{className:m("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",n),children:a.jsx("div",{className:"wu-grow",children:e})}),lw=({className:e,placeholder:t="Search surveys, folders or tools",defaultCollapsed:n=!0,onSearch:r,...s})=>{const[o,i]=p.useState(n);return p.useEffect(()=>{i(n)},[n]),a.jsxs("div",{className:"wu-relative",children:[a.jsx(Ve,{"data-testid":"search-icon",icon:"wm-search",className:m("wu-absolute wu-top-1 wu-left-1.5","wu-text-gray-lead wu-cursor-pointer",o&&"wu-text-white"),onClick:()=>i(u=>!u)}),a.jsx("input",{placeholder:t,onChange:u=>r(u.target.value),className:m("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","wu-h-8 wu-pl-8 wu-pr-4 wu-text-xs wu-text-gray-lead",o?"wu-w-8 wu-px-2 wu-text-lg wu-rounded-full wu-h-8 wu-border wu-border-white wu-bg-transparent":"wu-w-40 sm:wu-w-60",e),type:"search",...s})]})},so=Kt.Provider,ao=Kt.Root,oo=Kt.Trigger,Gr=S.forwardRef(({className:e,sideOffset:t=4,...n},r)=>a.jsx(Kt.Content,{ref:r,sideOffset:t,className:m("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),...n}));Gr.displayName=Kt.Content.displayName;const In=p.forwardRef(({content:e,position:t,positionOffset:n,duration:r,children:s,className:o,showArrow:i=!1,open:u,onOpenChange:l,style:d,...c},w)=>a.jsx(so,{delayDuration:r||200,children:a.jsxs(ao,{open:u,onOpenChange:l,children:[a.jsx(oo,{asChild:!0,children:a.jsx("span",{ref:w,...c,children:s})}),a.jsx(_r.Portal,{children:e&&a.jsxs(Gr,{side:t||"top",sideOffset:n||0,className:m("wu-max-w-sm wu-max-h-96 wu-overflow-y-auto",o),style:d,children:[e,i&&a.jsx(_r.Arrow,{className:"wu-fill-gray-notification wu-tooltip-arrow"})]})})]})}));In.displayName="WuTooltip";const cw=({label:e,className:t})=>{const n=p.useRef(null),[r,s]=p.useState(!1);return p.useEffect(()=>{const o=n.current;if(o){const i=o.clientWidth,u=o.scrollWidth,l=u/e.length,d=e.length*l;s(d>i||u>i)}},[e]),a.jsx("p",{ref:n,className:m("wu-w-full wu-truncate",t),children:r?a.jsx(In,{content:e,positionOffset:8,children:e}):e})},dw=e=>{var w;const{productName:t,categories:n=[],user:r,children:s,onLogout:o,homeLink:i=window.location.origin,brandColor:u,dir:l="ltr",expandAll:d,DataCenter:c}=e;return a.jsx("div",{className:"wu-sticky wu-top-0 wu-z-50 wu-w-full",children:a.jsxs("header",{className:m("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:[qd((w=r==null?void 0:r.profile)==null?void 0:w.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(no,{productCategories:n,activeProductName:t,activeProductColor:u,dir:l,homeLink:i,expandAll:d})}),a.jsx(ro,{dir:l,children:s}),a.jsxs("section",{className:m("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(Ra,{dir:l}),(r==null?void 0:r.profile)&&Object.keys(r.profile).length>0&&a.jsx(Qa,{user:r,onLogout:o,dir:l,DataCenter:c})]})]})})},Ue=Gt.Root,dt=Gt.Trigger,qe=S.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},s)=>a.jsx(Gt.Portal,{children:a.jsx(Gt.Content,{ref:s,align:t,sideOffset:n,className:m("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),...r})}));qe.displayName=Gt.Content.displayName;function io({className:e,classNames:t,dir:n="ltr",...r}){const s=Ua.getDefaultClassNames();return a.jsx(Ua.DayPicker,{showOutsideDays:r.showOutsideDays||!1,className:m("wu-p-3",e),classNames:{root:m(s.root,"wu-relative wu-rounded-none wu-bg-white dark:wu-bg-gray-switcher"),caption_label:m("wu-text-xs",r.captionLayout==="dropdown"?"wu-hidden":""),month_caption:m(s.month_caption,"wu-mb-5"),months:m(s.months,"wu-flex wu-flex-col sm:wu-flex-row wu-gap-4"),dropdowns:m(s.dropdowns,"wu-flex wu-items-center wu-justify-start wu-gap-2",(r.mode==="range","")),dropdown:m(s.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:m(s.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:m(s.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:m(s.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:m(s.selected,"wu-bg-blue-p [&:not(.rm)]:wu-text-white hover:wu-bg-blue-pHover"),range_middle:m("rm",s.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:m(s.range_end,"wu-rounded-none"),range_start:m(s.range_start,"wu-rounded-none wu-bg-blue-p hover:wu-bg-blue-pHover"),month_grid:m(s.month_grid,"[&>thead>tr>th]:wu-pb-2 wu-border-collapse wu-space-y-1"),button_next:m(s.button_next,jr({variant:"iconOnly"}),"wu-h-6 wu-w-6 wu-text-gray-lead"),button_previous:m(s.button_previous,jr({variant:"iconOnly"}),"wu-h-6 wu-w-6 wu-rotate-180 wu-text-gray-lead"),nav:m(s.nav,"wu-absolute wu-top-4 wu-right-3 wu-flex",n==="rtl"&&"wu-right-auto wu-left-3 wu-flex-row-reverse"),chevron:m(s.chevron,"!wu-text-red-500"),outside:m(s.outside,"wu-invisible"),disabled:m(s.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"})},...r})}io.displayName="Calendar";const Kr=e=>a.jsx(io,{...e}),uo=e=>{const{handleDateChange:t,disabled:n,onReset:r,showResetButton:s}=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:[s&&a.jsx(Ie,{variant:"secondary",onClick:r,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(jt.PopoverClose,{asChild:!0,children:a.jsx(Ie,{onClick:t,disabled:n,className:"wu-date-picker-apply",children:"Apply"})})]})},Yr=({formattedString:e,dir:t,placeholder:n="Select Date",className:r,variant:s="primary",color:o,CustomTrigger:i,...u})=>a.jsx(jt.PopoverTrigger,{asChild:!i,dir:t,children:i?a.jsx(a.Fragment,{children:i(e)}):a.jsx(Ie,{...u,className:m("wu-justify-between wu-w-full wu-gap-2 wu-text-xs wu-border-b wu-rounded-none wu-rounded-t-sm wu-min-w-48 wu-border-gray-subtle wu-text-gray-lead wu-placeholder:wu-text-gray-subtle wu-placeholder:wu-font-light wu-bg-gray-10 hover disabled:wu-cursor-not-allowed disabled:wu-bg-gray-20 disabled:wu-border-gray-40 disabled:wu-text-subtle hover:wu-text-gray-lead hover:wu-bg-gray-10 hover:wu-border-gray-40 wu-datepicker-trigger",s==="outlined"&&"wu-border wu-border-subtle wu-bg-transparent",r),Icon:a.jsx("span",{className:"wm-calendar-month wu-text-sm"}),iconPosition:"right",children:e||n})}),lo=(e,t,n,r)=>{const s=$.startOfDay(e).getTime();return!!(t||n&&s<$.startOfDay(n).getTime()||r&&s>$.startOfDay(r).getTime())},Dn=e=>e?typeof e=="string"?new Date(e):e:new Date,Xr="(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01])-\\d{4}",ww=[{label:"Last week",value:7},{label:"Last month",value:30},{label:"Last quarter",value:90},{label:"Last year",value:365}],fw=e=>{const{message:t,className:n,...r}=e;return a.jsx("p",{...r,className:m("wu-text-sub-3 wu-break-words wu-font-light",n),style:{color:"rgb(var(--wu-red-deep))",...r.style},children:t})},pw=e=>{var u,l;const{inputRef:t,maxLength:n=50,className:r,...s}=e,[o,i]=p.useState(!1);return p.useEffect(()=>{var d;(((d=t==null?void 0:t.current)==null?void 0:d.value.length)||0)>.75*n?i(!0):i(!1)},[(u=t==null?void 0:t.current)==null?void 0:u.value,n]),a.jsx("p",{...s,className:m("wu-text-sub-3 wu-font-light",r),style:{color:"rgb(var(--wu-gray-subtle))",...s.style},children:o&&`${(l=t==null?void 0:t.current)==null?void 0:l.value.length}/${n}`})},hw=Be.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"),kn=S.forwardRef(({className:e,...t},n)=>a.jsx(Ka.Root,{ref:n,className:m(hw(),e),...t}));kn.displayName=Ka.Root.displayName;const De=e=>a.jsx(kn,{...e,className:m("wu-text-gray-lead wu-leading-6",e.className)}),mw=({Label:e,Error:t,Hint:n,Input:r,labelPosition:s="top",dir:o="ltr",className:i,...u})=>{const d=m("wu-flex",s==="top"?"wu-flex-col wu-gap-1":"wu-flex-row wu-items-center wu-gap-2",i),c=m("wu-flex wu-flex-col wu-gap-1 wu-relative wu-flex-1 wu-form-group-wrapper"),w=m("wu-absolute -wu-bottom-5",o==="ltr"?"wu-right-0":"wu-left-0","wu-form-group-hint"),f=m("wu-absolute -wu-bottom-5",o==="ltr"?"wu-left-0":"wu-right-0","wu-form-group-error");return a.jsxs("div",{className:d,dir:o,...u,children:[e,a.jsxs("div",{className:c,children:[r,n&&a.jsx("div",{className:w,children:n}),t&&a.jsx("div",{className:f,children:t})]})]})},gw=({formatString:e="MMM dd, yyyy",value:t,onChange:n,disabled:r,minDate:s=$.sub(new Date,{years:5}),maxDate:o=$.add(new Date,{years:1}),dir:i="ltr",Label:u,labelPosition:l="top",onReset:d,showResetButton:c=!1,placeholder:w="Select Date",CustomTrigger:f,align:h="start",sideOffset:b=-.5,side:g,alignOffset:v,...N})=>{const[y,C]=p.useState(),[E,x]=p.useState(""),D=p.useCallback(()=>{const M=Dn(y);x($.format(M,e)),n&&n(y)},[y,e,n]),T=p.useCallback(()=>{d?d():(C(void 0),x(""),n&&n(void 0))},[n,d]);return p.useEffect(()=>{const M=Dn(t);C(M),x($.format(M,e))},[t,e]),a.jsxs(De,{className:m("wu-flex wu-gap-1",l==="left"?"wu-items-center":"wu-flex-col wu-items-start","wu-date-picker-label"),dir:i,children:[u,a.jsxs(Ue,{children:[a.jsx(Yr,{formattedString:E,dir:i,placeholder:w,CustomTrigger:f,...N}),a.jsx(qe,{className:"wu-p-0 wu-w-fit wu-date-picker-content",align:h,sideOffset:b,side:g,alignOffset:v,dir:i,children:a.jsx(Kr,{dir:i,mode:"single",captionLayout:"dropdown",selected:y,onSelect:C,disabled:M=>lo(M,r,s,o),startMonth:s,endMonth:o,required:!0,autoFocus:!0,defaultMonth:y,className:m("wu-border wu-border-blue-p wu-date-picker"),footer:a.jsx(uo,{handleDateChange:D,disabled:r,onReset:T,showResetButton:c})})})]})]})},co={};function Ze(e,t){const n=S.useRef(co);return n.current===co&&(n.current=e(t)),n}const Zr=S[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],bw=Zr&&Zr!==S.useLayoutEffect?Zr:e=>e();function he(e){const t=Ze(yw).current;return t.next=e,bw(t.effect),t.trampoline}function yw(){const e={next:void 0,callback:vw,trampoline:(...t)=>{var n;return(n=e.callback)==null?void 0:n.call(e,...t)},effect:()=>{e.callback=e.next}};return e}function vw(){if(process.env.NODE_ENV!=="production")throw new Error("Base UI: Cannot call an event handler while rendering.")}function xw(e,t){return function(r,...s){const o=new URL(e);return o.searchParams.set("code",r.toString()),s.forEach(i=>o.searchParams.append("args[]",i)),`${t} error #${r}; visit ${o} for the full message.`}}const Xt=xw("https://base-ui.com/production-error","Base UI");function ke(){}const Ke=Object.freeze({});let wo=(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 Nw={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},Zt={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},Sw={disabled:!1,...Zt},Jr={valid(e){return e===null?null:e?{[wo.valid]:""}:{[wo.invalid]:""}}},fo=S.createContext({invalid:void 0,name:void 0,validityData:{state:Nw,errors:[],error:"",value:"",initialValue:null},setValidityData:ke,disabled:void 0,touched:Zt.touched,setTouched:ke,dirty:Zt.dirty,setDirty:ke,filled:Zt.filled,setFilled:ke,focused:Zt.focused,setFocused:ke,validate:()=>null,validationMode:"onSubmit",validationDebounceTime:0,shouldValidateOnChange:()=>!1,state:Sw,markedDirtyRef:{current:!1},registerFieldControl:ke,validation:{getValidationProps:(e=Ke)=>e,getInputValidationProps:(e=Ke)=>e,inputRef:{current:null},commit:async()=>{}}});process.env.NODE_ENV!=="production"&&(fo.displayName="FieldRootContext");function An(e=!0){const t=S.useContext(fo);if(t.setValidityData===ke&&!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: FieldRootContext is missing. Field parts must be placed within <Field.Root>.":Xt(28));return t}const po=S.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:ke,validationMode:"onSubmit",submitAttemptedRef:{current:!1}});process.env.NODE_ENV!=="production"&&(po.displayName="FormContext");function Cw(){return S.useContext(po)}function Qr(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}const Rr={};function es(e,t,n,r,s){if(!n&&!r&&!e)return _n(t);let o=_n(e);return t&&(o=Pn(o,t)),n&&(o=Pn(o,n)),r&&(o=Pn(o,r)),o}function Tw(e){if(e.length===0)return Rr;if(e.length===1)return _n(e[0]);let t=_n(e[0]);for(let n=1;n<e.length;n+=1)t=Pn(t,e[n]);return t}function _n(e){return ts(e)?{...mo(e,Rr)}:Ew(e)}function Pn(e,t){return ts(t)?mo(t,e):Mw(e,t)}function Ew(e){const t={...e};for(const n in t){const r=t[n];ho(n,r)&&(t[n]=go(r))}return t}function Mw(e,t){if(!t)return e;for(const n in t){const r=t[n];switch(n){case"style":{e[n]=Qr(e.style,r);break}case"className":{e[n]=bo(e.className,r);break}default:ho(n,r)?e[n]=Iw(e[n],r):e[n]=r}}return e}function ho(e,t){const n=e.charCodeAt(0),r=e.charCodeAt(1),s=e.charCodeAt(2);return n===111&&r===110&&s>=65&&s<=90&&(typeof t=="function"||typeof t>"u")}function ts(e){return typeof e=="function"}function mo(e,t){return ts(e)?e(t):e??Rr}function Iw(e,t){return t?e?n=>{if(yo(n)){const s=n;Vn(s);const o=t(s);return s.baseUIHandlerPrevented||e==null||e(s),o}const r=t(n);return e==null||e(n),r}:go(t):e}function go(e){return e&&(t=>(yo(t)&&Vn(t),e(t)))}function Vn(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function bo(e,t){return t?e?t+" "+e:t:e}function yo(e){return e!=null&&typeof e=="object"&&"nativeEvent"in e}const wt={...S};let vo=0;function Dw(e,t="mui"){const[n,r]=S.useState(e),s=e||n;return S.useEffect(()=>{n==null&&(vo+=1,r(`${t}-${vo}`))},[n,t]),s}const xo=wt.useId;function kw(e,t){if(xo!==void 0){const n=xo();return e??(t?`${t}-${n}`:n)}return Dw(e,t)}function No(e){return kw(e,"base-ui")}const So=S.createContext({controlId:void 0,registerControlId:ke,labelId:void 0,setLabelId:ke,messageIds:[],setMessageIds:ke,getDescriptionProps:e=>e});process.env.NODE_ENV!=="production"&&(So.displayName="LabelableContext");function ns(){return S.useContext(So)}function On(e,t,n,r){const s=Ze(Co).current;return _w(s,e,t,n,r)&&To(s,[e,t,n,r]),s.callback}function Aw(e){const t=Ze(Co).current;return Pw(t,e)&&To(t,e),t.callback}function Co(){return{callback:null,cleanup:null,refs:[]}}function _w(e,t,n,r,s){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==s}function Pw(e,t){return e.refs.length!==t.length||e.refs.some((n,r)=>n!==t[r])}function To(e,t){if(e.refs=t,t.every(n=>n==null)){e.callback=null;return}e.callback=n=>{if(e.cleanup&&(e.cleanup(),e.cleanup=null),n!=null){const r=Array(t.length).fill(null);for(let s=0;s<t.length;s+=1){const o=t[s];if(o!=null)switch(typeof o){case"function":{const i=o(n);typeof i=="function"&&(r[s]=i);break}case"object":{o.current=n;break}}}e.cleanup=()=>{for(let s=0;s<t.length;s+=1){const o=t[s];if(o!=null)switch(typeof o){case"function":{const i=r[s];typeof i=="function"?i():o(null);break}case"object":{o.current=null;break}}}}}}}const Vw=parseInt(S.version,10);function Ow(e){return Vw>=e}function Eo(e){if(!S.isValidElement(e))return null;const t=e,n=t.props;return(Ow(19)?n==null?void 0:n.ref:t.ref)??null}let rs;process.env.NODE_ENV!=="production"&&(rs=new Set);function ss(...e){if(process.env.NODE_ENV!=="production"){const t=e.join(" ");rs.has(t)||(rs.add(t),console.warn(`Base UI: ${t}`))}}function Fw(e,t){const n={};for(const r in e){const s=e[r];if(t!=null&&t.hasOwnProperty(r)){const o=t[r](s);o!=null&&Object.assign(n,o);continue}s===!0?n[`data-${r.toLowerCase()}`]="":s&&(n[`data-${r.toLowerCase()}`]=s.toString())}return n}function Lw(e,t){return typeof e=="function"?e(t):e}function Ww(e,t){return typeof e=="function"?e(t):e}function Ye(e,t,n={}){const r=t.render,s=Bw(t,n);if(n.enabled===!1)return null;const o=n.state??Ke;return Uw(e,r,s,o)}function Bw(e,t={}){const{className:n,style:r,render:s}=e,{state:o=Ke,ref:i,props:u,stateAttributesMapping:l,enabled:d=!0}=t,c=d?Lw(n,o):void 0,w=d?Ww(r,o):void 0,f=d?Fw(o,l):Ke,h=d&&u?qw(u):void 0,b=d?Qr(f,h)??{}:Ke;return typeof document<"u"&&(d?Array.isArray(i)?b.ref=Aw([b.ref,Eo(s),...i]):b.ref=On(b.ref,Eo(s),i):On(null,null)),d?(c!==void 0&&(b.className=bo(b.className,c)),w!==void 0&&(b.style=Qr(b.style,w)),b):Ke}function qw(e){return Array.isArray(e)?Tw(e):es(void 0,e)}const $w=Symbol.for("react.lazy"),Hw=/^[A-Z][A-Za-z0-9$]*$/,zw=/[a-z]/;function Uw(e,t,n,r){if(t){if(typeof t=="function")return process.env.NODE_ENV!=="production"&&jw(t),t(n,r);const s=es(n,t.props);s.ref=n.ref;let o=t;if((o==null?void 0:o.$$typeof)===$w&&(o=S.Children.toArray(t)[0]),process.env.NODE_ENV!=="production"&&!S.isValidElement(o))throw new Error(["Base UI: The `render` prop was provided an invalid React element as `React.isValidElement(render)` is `false`.","A valid React element must be provided to the `render` prop because it is cloned with props to replace the default element.","https://base-ui.com/r/invalid-render-prop"].join(`
@@ -17,5 +17,5 @@
17
17
  var(--colors)
18
18
  )`;d.style.setProperty("--spotlight-background",N)})};return window.addEventListener("mousemove",f),()=>{window.removeEventListener("mousemove",f),w&&cancelAnimationFrame(w)}}},[t,n,o,i]),a.jsx("div",{ref:l,className:m(rb.gradientBackground,"wu-transform-gpu",s),...u,children:r})},fr={wuModalBodyWrapper:"_wuModalBodyWrapper_uaelx_1","wu-modal-footer":"_wu-modal-footer_uaelx_5","wu-modal-content":"_wu-modal-content_uaelx_5","wu-modal-header":"_wu-modal-header_uaelx_9"},Sl="calc(100vh - 64px)",sb={sm:"400px",md:"600px",lg:"1200px"},ab=({Trigger:e,children:t,size:n="md",hideCloseButton:r,preventClickOutside:s,onOpenChange:o,open:i,dir:u,maxWidth:l,maxHeight:d,className:c,style:w,variant:f="action",allowExternalPortals:h,onOpenAutoFocus:b,onCloseAutoFocus:g,...v})=>{const N={action:["#EEF3FBcc 32%","#1D50F4cc"],upgrade:["#FDEDCCcc 32%","#FF9F00cc"],critical:["#FFB6B6cc 32%","#CC0000cc"]},y=p.useRef(null),C=p.useRef(null);return p.useEffect(()=>()=>{y.current&&(document.removeEventListener("focusin",y.current.focusin,!0),document.removeEventListener("focusout",y.current.focusout,!0),document.body.style.pointerEvents="",y.current=null)},[]),a.jsxs(bl,{modal:!0,onOpenChange:o,open:i,children:[e&&a.jsx(yl,{asChild:!0,children:e}),a.jsx(ma,{ref:C,style:{width:"calc(100% - 64px)",maxWidth:l||sb[n],maxHeight:d||Sl,...w},hideCloseButton:r,onInteractOutside:E=>{var x,D;if(s){E.preventDefault();return}if(h){const T=(D=(x=E.detail)==null?void 0:x.originalEvent)==null?void 0:D.target;T!=null&&T.closest("[data-wu-overlay]")||E.preventDefault()}},onFocusOutside:E=>h&&E.preventDefault(),onOpenAutoFocus:E=>{if(h){document.body.style.pointerEvents="all";const x=M=>!!C.current&&!C.current.contains(M),D=M=>{x(M.target)&&M.stopImmediatePropagation()},T=M=>{x(M.relatedTarget)&&M.stopImmediatePropagation()};y.current={focusin:D,focusout:T},document.addEventListener("focusin",D,!0),document.addEventListener("focusout",T,!0)}b==null||b(E)},onCloseAutoFocus:E=>{h&&(document.body.style.pointerEvents="",y.current&&(document.removeEventListener("focusin",y.current.focusin,!0),document.removeEventListener("focusout",y.current.focusout,!0),y.current=null)),g==null||g(E)},dir:u,"aria-describedby":void 0,"data-variant":f,className:m("wu-group wu-rounded-[.88rem]",fr.wuModalBodyWrapper,c),...v,children:a.jsx(Nl,{colors:N[f],strokeWidth:4,className:m("wu-rounded-[1.1rem] wu-transform-gpu wu-flex wu-flex-col",c),style:{maxHeight:d||Sl},children:t})})]})},ob=({children:e,className:t,...n})=>a.jsx("div",{className:m("wu-flex wu-flex-col wu-gap-4 wu-p-4 rtl:wu-text-right wu-overflow-auto wu-bg-white","wu-p-8 wu-text-gray-lead",fr["wu-modal-content"],t),...n,children:e}),ib=({children:e,className:t,...n})=>a.jsx(ga,{...n,"data-variant":"action",className:m("wu-text-lg wu-text-gray-lead wu-font-medium","wu-rounded-t-[.88rem] wu-px-4","group-data-[variant=action]:wu-bg-blue-sidebar group-data-[variant=action]:wu-text-blue-q","group-data-[variant=critical]:wu-bg-[#F9E0E0] group-data-[variant=critical]:wu-text-red-deep","group-data-[variant=upgrade]:wu-bg-[#FEF1D9] group-data-[variant=upgrade]:wu-text-yellow-deep",fr["wu-modal-header"],t),children:a.jsx(ba,{className:"wu-font-normal wu-justify-start wu-text-2xl wu-h-14",children:e})}),ub=({children:e,className:t,...n})=>a.jsx(xl,{...n,className:m("wu-border-t wu-border-gray-40 wu-bg-white wu-min-h-16 wu-mx-4 wu-px-0","wu-mx-0 wu-rounded-b-[.88rem] wu-min-h-16 wu-p-4","group-data-[variant=upgrade]:wu-border-[#EED6A8]","group-data-[variant=action]:wu-border-[#BAC9F8]","group-data-[variant=critical]:wu-border-[#F0B3B3]",fr["wu-modal-footer"],t),children:e}),lb=({children:e,className:t,...n})=>{const r=p.useRef(null);return a.jsx(tb,{asChild:!0,children:a.jsx(Ie,{className:t,ref:r,...n,children:e})})},cb=({placeholder:e="Select...",value:t,multiple:n=!1,accessorKey:r,variant:s="flat",dir:o="ltr",customTriggerChildren:i,id:u,disabled:l,selectAll:d,isCheckedAll:c,width:w,...f})=>{const[h,b]=p.useState(""),[g,v]=p.useState(e);p.useEffect(()=>{if(!t||Array.isArray(t)&&t.length===0){v(e),b("");return}const y=r.label;if(n&&Array.isArray(t)){const C=t.map(E=>E[y]).join(", ");b(C)}else!n&&!Array.isArray(t)&&b(t[y])},[t,r.label,n,e]);const N=()=>e&&!h?a.jsx("p",{className:"wu-text-xs wu-opacity-70",children:g}):a.jsx("span",{className:m("wu-overflow-hidden wu-text-xs wu-text-start wu-text-ellipsis wu-whitespace-nowrap"),style:{width:`${(w||0)-32}px`},children:c?(d==null?void 0:d.triggerText)??h:h});return a.jsx(Jo,{asChild:!0,dir:o,id:u,disabled:l,children:a.jsxs("button",{...f,disabled:l,className:m("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",s==="outlined"&&"wu-border wu-border-gray-subtle","wu-group/wuSelect wu-select-trigger",f.className),children:[i??N(),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"})]})})},Cl=({option:e,value:t,multiple:n=!1,onSelect:r,accessorKey:s,dir:o="ltr"})=>{const[i,u]=p.useState(n?[]:"");p.useEffect(()=>{t&&u(n?t.map(w=>JSON.stringify(w[s.value])):JSON.stringify(t[s.value]))},[t,s.value,n]);const l=n?i.includes(JSON.stringify(e[s.value])):i===JSON.stringify(e[s.value]),d=c=>{e.disabled||(r(e),n&&c.preventDefault())};return a.jsxs(Un,{onClick:d,disabled:e.disabled,className:m("wu-cursor-pointer wu-text-xs wu-py-2 wu-leading-4 wu-select-item wu-items-start",l&&"wu-bg-gray-10"),dir:o,children:[n&&a.jsx($e,{checked:l}),a.jsx(Tl,{option:e,accessorKey:s})]})},Tl=({option:e,accessorKey:t})=>{const n=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,n,e.isAdmin&&a.jsx("span",{className:"wu-ml-auto wm-lock wu-text-sm wu-text-orange-deep"})]})},El=e=>{const{option:t,handleSelectAll:n,isCheckedAll:r,isPartialSelected:s,...o}=e;switch("type"in t?t.type:"option"){case"all":return a.jsxs(Un,{onSelect:u=>{u.stopPropagation(),u.preventDefault(),n==null||n()},className:m("wu-cursor-pointer wu-text-xs wu-py-2 wu-leading-4 wu-select-item"),dir:o.dir,children:[a.jsx($e,{"data-partial":s,checked:r||s,partial:s}),a.jsx(Tl,{option:t,accessorKey:o.accessorKey})]});case"group":return a.jsxs(Qo,{dir:o.dir,children:[a.jsx(an,{className:"wu-text-xs",children:t.label}),t.options.map((u,l)=>p.createElement(Cl,{...o,option:u,key:l}))]});case"divider":return a.jsx(jn,{className:"wu-mx-4"});default:return a.jsx(Cl,{...o,option:t})}},db=e=>{let t=0,n=0;const r=[],s=[],o=i=>{i.type==="divider"?t++:i.type==="group"?(n++,i.options.forEach(u=>{o(u)})):(r.push(i),i.disabled||s.push(i))};return e.forEach(i=>{o(i)}),{separators:t,groups:n,enabledOptions:s,totalData:r.length,cleanData:r}},wb=100,fb=400,Ml=({data:e,onSelect:t,multiple:n=!1,defaultValue:r,value:s,accessorKey:o,variant:i="flat",dir:u="ltr",placeholder:l,Label:d,virtualizedThreshold:c=wb,maxHeight:w=fb,hasGroup:f=!1,Header:h,CustomTrigger:b,selectAll:g,disabled:v,labelPosition:N="top",onScroll:y,maxContentWidth:C,selectedToTop:E=!1,...x})=>{const[D,T]=p.useState(),M=p.useRef(null),[I,_]=p.useState(!1),[P,A]=p.useState(!1),{cleanData:O,enabledOptions:F}=db(e),V=p.useMemo(()=>n&&g!=null&&g.enable&&e.length>0?[{type:"all",[o.label]:g.label||"Select All"},...e]:e,[e,g,n]),L=p.useCallback(z=>{const J=z[o.value];if(n)T((ie=[])=>{const R=ie,K=R.some(W=>W[o.value]===J)?R.filter(W=>W[o.value]!==J):[...R,z];return t==null||t(K),K});else{const ie=z;T(ie),t==null||t(ie)}},[n,o.value,t]);p.useEffect(()=>{if(r&&s){console.error("defaultValue and value cannot be used simultaneously");return}!r&&!s&&T(void 0),r!==void 0&&T(r),s!==void 0&&T(s)},[r,s]);const U=Xo(E,V,D,o),H=U.length>c;p.useEffect(()=>{if(!n)return;const z=g!=null&&g.includeDisabled?(D==null?void 0:D.length)===e.length:(D==null?void 0:D.length)===F.length;_(z);const J=(D==null?void 0:D.length)>0&&!z;A(J)},[D,g]);const q=p.useCallback(()=>{const z=I?[]:g!=null&&g.includeDisabled?f?O:e:F;T(z),t==null||t(z)},[I,n,e,F,t,g]),Z=Mn(N);return a.jsxs("div",{className:m(Z,"wu-flex wu-select-container"),ref:M,dir:u,children:[a.jsxs(Zo,{children:[a.jsx(cb,{...x,value:D,multiple:n,variant:i,dir:u,placeholder:l,accessorKey:o,customTriggerChildren:b,id:x.id,disabled:v,selectAll:g,isCheckedAll:I}),a.jsxs(ms,{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:x.id,style:{maxWidth:C},children:[h,H?a.jsx(Dt,{list:U,containerHeight:w,callback:(z,J)=>a.jsx(El,{option:J,accessorKey:o,multiple:n,onSelect:L,value:D,dir:u,handleSelectAll:q,isCheckedAll:I,isPartialSelected:P}),dir:u}):a.jsx("div",{onScroll:y,style:{maxHeight:w,height:"fit-content",overflow:"auto"},className:"wu-select-list",children:U.map(z=>{const J=z,ie=String(J[o.value]??J.type);return a.jsx(El,{option:J,accessorKey:o,multiple:n,onSelect:L,value:D,handleSelectAll:q,isCheckedAll:I,dir:u,isPartialSelected:P},ie)})})]})]}),d&&a.jsx(De,{htmlFor:x.id,className:"wu-select-label",children:d})]})},pr=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],pb=({value:e,onChange:t,min:n=$.sub(new Date,{years:5}),max:r=$.add(new Date,{years:1}),placeholder:s="Select a month",Label:o,labelPosition:i="top",disabled:u,id:l,readonly:d,disabledMonths:c=[],...w})=>{const[f,h]=p.useState(null),[b,g]=p.useState(""),[v,N]=p.useState({value:Math.min(new Date().getFullYear(),new Date(r).getFullYear()),label:Math.min(new Date().getFullYear(),new Date(r).getFullYear())}),y=p.useMemo(()=>{const E=new Date(n).getFullYear(),x=new Date(r).getFullYear();return Array.from({length:x-E+1},(D,T)=>({value:x-T,label:x-T}))},[n,r]);p.useEffect(()=>{if(e){const E=new Date(e),x=E.getFullYear(),D=E.getMonth();h({year:x,month:D}),g(`${pr[D]} ${x}`),N({value:x,label:x})}},[e]);const C=()=>{f&&t&&(t(new Date(f.year,f.month,15)),g(`${pr[f.month]} ${f.year}`))};return a.jsxs("div",{className:m("wu-flex wu-flex-col wu-items-center",Mn(i),i==="top"&&"wu-items-start"),children:[a.jsxs(Ue,{children:[a.jsx(Yr,{...w,disabled:u||d,id:l,dir:"ltr",placeholder:s,formattedString:b}),a.jsxs(qe,{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(Ml,{data:y,accessorKey:{value:"value",label:"label"},value:v,onSelect:E=>N(E),multiple:!1,maxHeight:224})}),a.jsx(hb,{year:v==null?void 0:v.value,selectedMonth:f==null?void 0:f.month,selectedYear:f==null?void 0:f.year,onClick:(E,x)=>h({year:x,month:E}),disabledMonths:c}),a.jsx("div",{className:"wu-flex wu-justify-end wu-px-0.5",children:a.jsx(jt.PopoverClose,{asChild:!0,children:a.jsx(Ie,{onClick:C,children:"Apply"})})})]})]}),o&&a.jsx(De,{className:"wu-truncate wu-max-w-[120px] wu-min-w-fit wu-select-label",children:o})]})},hb=({year:e,selectedMonth:t,selectedYear:n,onClick:r,disabledMonths:s=[]})=>{const o=new Date,i=o.getFullYear(),u=o.getMonth(),l=p.useMemo(()=>{const d=new Set;return s.forEach(c=>{const w=typeof c=="string"?new Date(c):c;d.add(`${w.getFullYear()}-${w.getMonth()}`)}),d},[s]);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:pr.map((d,c)=>{const w=e===i&&c===u,f=t===c&&n===e;return a.jsx("button",{disabled:l.has(`${e}-${c}`),onClick:()=>r(c,e),className:m("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",w&&"wu-border wu-border-blue-p",f&&"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":`${pr[c]} ${e}`,"data-month":c,"data-year":e,children:d},d)})})},Il=(e,t,n,r=96)=>{if(e.length===0||r<=0)return[[],[]];const[o,i]=p.useState([]),[u,l]=p.useState([]);return p.useEffect(()=>{const d=()=>{var b,g;const c=((b=t.current)==null?void 0:b.clientWidth)||0,w=((g=n.current)==null?void 0:g.clientWidth)||0,f=c-w,h=Math.floor(f/r);i(e.slice(0,h)),l(e.slice(h))};return d(),window.addEventListener("resize",d),()=>{window.removeEventListener("resize",d)}},[e,r]),[o,u]},Dl={wuPrimaryLink:"_wuPrimaryLink_1sy3v_1",wuPrimaryPopoverContent:"_wuPrimaryPopoverContent_1sy3v_8"},mb=e=>{const{Links:t,children:n,className:r,...s}=e,o=p.useMemo(()=>t.map((c,w)=>p.cloneElement(c,{className:m(Dl.wuPrimaryLink,c.props.className,"wu-primary-nav-link"),key:w})),[t]),i=p.useRef(null),u=p.useRef(null),[l,d]=Il(o,i,u);return a.jsx(a.Fragment,{children:a.jsxs("header",{className:m("wu-flex wu-items-center wu-justify-between wu-gap-4 wu-px-2 wu-py-1 wu-bg-white wu-border-b",r),...s,ref:i,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}),d.length>0&&a.jsxs(Ue,{children:[a.jsx(dt,{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(qe,{className:m(Dl.wuPrimaryPopoverContent,"wu-primary-nav-popover-left"),align:"start",sideOffset:12,children:d})]})]}),n&&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:u,children:n}),a.jsxs(Ue,{children:[a.jsx(dt,{className:"sm:wu-hidden",children:a.jsx("span",{className:"wu-text-lg wm-menu"})}),a.jsx(qe,{className:"wu-bg-white wu-border wu-border-blue-p wu-w-fit wu-primary-nav-popover-right",align:"end",sideOffset:4,children:n})]})]})]})})},ya={wuSecondaryLink:"_wuSecondaryLink_1edl1_1",wuSecondaryNav:"_wuSecondaryNav_1edl1_6"},gb=e=>{const{Links:t,children:n,className:r,...s}=e,o=p.useMemo(()=>t.map((w,f)=>p.cloneElement(w.link,{key:f,className:m(ya.wuSecondaryLink,w.link.props.className,"wu-secondary-nav-link-container"),children:a.jsxs(a.Fragment,{children:[p.cloneElement(w.imgOrIcon,{className:m("wu-w-5 wu-h-5 wu-flex wu-items-center wu-justify-center wu-text-lg wu-leading-5",w.imgOrIcon.props.className)}),a.jsx("div",{className:"wu-secondary-nav-link",children:w.link.props.children})]})})),[t]),i=p.useRef(null),u=p.useRef(null),l=p.useRef(null),[d,c]=Il(o,i,l);return a.jsx(a.Fragment,{children:a.jsxs("header",{className:m("wu-flex wu-items-center wu-justify-between wu-gap-4 wu-border-y wu-border-gray-25 wu-h-[50px]",r),...s,ref:i,children:[a.jsxs("div",{className:"wu-flex wu-items-center wu-justify-start wu-gap-2",children:[a.jsx("nav",{className:m(ya.wuSecondaryNav,"wu-flex wu-items-center wu-justify-start wu-w-full wu-h-full wu-secondary-nav-left"),ref:u,children:d}),c.length>0&&a.jsxs(Ue,{children:[a.jsx(dt,{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(qe,{className:m(ya.wuSecondaryNavPopover,"wu-secondary-nav-popover-left"),align:"start",sideOffset:12,children:c})]})]}),n&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"wu-items-center wu-justify-end wu-hidden sm:wu-flex",ref:l,children:n}),a.jsxs(Ue,{children:[a.jsx(dt,{className:"sm:wu-hidden",children:a.jsx("span",{className:"wu-text-lg wm-menu"})}),a.jsx(qe,{className:"wu-bg-white wu-border wu-border-blue-p wu-w-fit wu-secondary-nav-popover-right",align:"end",sideOffset:12,children:n})]})]})]})})},kl=p.forwardRef(({totalRows:e,initialPage:t=0,initialPageSize:n=100,onPageChange:r,className:s,disabled:o=!1,...i},u)=>{const[l,d]=p.useState(t),[c,w]=p.useState(n);p.useEffect(()=>{d(t),w(n)},[t,n]);const f=Math.ceil(e/c),h=l*c+1,b=Math.min((l+1)*c,e),g=Array.from({length:f},(y,C)=>C),v=p.useCallback(y=>{y>=0&&y<f&&(d(y),r==null||r(y))},[f,r]),N=224;return a.jsxs("div",{className:m("wu-flex wu-items-center wu-gap-[2px]",s,"wu-pagination"),...i,role:"navigation",children:[a.jsx(Al,{label:"Previous page",onClick:()=>v(l-1),disabled:l===0||o,icon:"wm-arrow-back-ios-new",className:"hover:wu-bg-gray-20 rtl:wu-rotate-180 wu-prev-btn"}),a.jsx(pa,{name:`${h} - ${b}`,className:"wu-w-[96px] wu-min-w-[96px] wu-pagination-menu",align:"end",disabled:o,children:a.jsx(Bt,{style:{maxHeight:N+"px"},dir:i.dir,children:g.length>100?a.jsx(Dt,{className:"wu-pagination-list",containerHeight:N,list:g,callback:(y,C)=>a.jsxs(wr,{onSelect:()=>v(C),className:m("wu-py-2",C===l&&"wu-bg-gray-20","wu-pagination-item"),children:[C*c+1," -"," ",Math.min((C+1)*c,e)]},y)}):g.map(y=>a.jsxs(wr,{onSelect:()=>v(y),className:m(y===l&&"wu-bg-gray-20","wu-py-2 hover:wu-bg-gray-20","wu-pagination-item"),children:[y*c+1," -"," ",Math.min((y+1)*c,e)]},y))})}),a.jsx(Al,{label:"Next page",onClick:()=>v(l+1),disabled:l===f-1||o,icon:"wm-arrow-forward-ios",className:"hover:wu-bg-gray-20 rtl:wu-rotate-180 wu-next-btn"})]})});kl.displayName="WuPagination";const Al=({label:e,onClick:t,disabled:n,icon:r,className:s})=>a.jsx(Ie,{variant:"iconOnly",onClick:t,disabled:n,className:m("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",s),"aria-label":e,children:a.jsx("span",{className:m("wu-text-sm",r)})}),_l=S.forwardRef(({className:e,...t},n)=>a.jsx(Yt.Root,{className:m("wu-grid wu-gap-2",e),...t,ref:n}));_l.displayName=Yt.Root.displayName;const Pl=S.forwardRef(({className:e,...t},n)=>a.jsx(Yt.Item,{ref:n,className:m("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(Yt.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"})})}));Pl.displayName=Yt.Item.displayName;const Vl=p.forwardRef((e,t)=>{const{options:n,defaultValue:r,onChange:s,label:o,dir:i,...u}=e;return a.jsxs(_l,{defaultValue:r,required:u.required,disabled:u.disabled,onValueChange:s,id:u.id,dir:i,name:u.name,className:m("w-fit",u.className),ref:t,style:u.style,children:[a.jsx(kn,{htmlFor:u.id,className:"wu-text-sm wu-font-normal wu-text-gray-lead wu-leading-6 wu-radio-group-label",children:o}),n.map(l=>a.jsxs("div",{className:"wu-flex wu-items-center wu-gap-2 wu-radio-item-container",children:[a.jsx(Pl,{value:l.value,id:l.value,disabled:l.disabled,required:l.required,"aria-label":l.value,className:"wu-peer wu-radio-item"}),a.jsx(kn,{htmlFor:l.value,className:m(l.required&&"after:wu-content-['*'] after:wu-mx-[2px] after:wu-text-rose-500","wu-radio-item-label"),children:l.label})]},l.value))]})});Vl.displayName="WuRadioGroup";const bb=e=>{const{children:t,...n}=e;return a.jsxs(Bt,{...n,role:"complementary","aria-label":"ScrollArea",children:[t,a.jsx(fa,{orientation:"horizontal"})]})},Ol=S.forwardRef(({className:e,type:t,...n},r)=>a.jsx("input",{type:t,className:m("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:r,...n}));Ol.displayName="Input";const Fl=S.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...r},s)=>a.jsx(Ya.Root,{ref:s,decorative:n,orientation:t,className:m("wu-shrink-0 wu-bg-gray-40",t==="horizontal"?"wu-h-[1px] wu-w-full":"wu-h-full wu-w-[1px]",e),...r}));Fl.displayName=Ya.Root.displayName;function Ll({className:e,...t}){return a.jsx("div",{className:m("animate-pulse rounded-md bg-muted",e),...t})}const va=768;function xa(){const[e,t]=S.useState(void 0);return S.useEffect(()=>{const n=window.matchMedia(`(max-width: ${va-1}px)`),r=()=>{t(window.innerWidth<va)};return n.addEventListener("change",r),t(window.innerWidth<va),()=>n.removeEventListener("change",r)},[]),!!e}const yb="sidebar_state",vb=3600*24*7,xb="256px",Nb="256px",Sb="3rem",Cb="b",Wl=S.createContext(null);function rt(){const e=S.useContext(Wl);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}const Bl=S.forwardRef(({defaultOpen:e=!0,open:t,onOpenChange:n,className:r,style:s,children:o,...i},u)=>{const l=xa(),[d,c]=S.useState(!1),[w,f]=S.useState(l?!0:e),h=t??w,b=S.useCallback(y=>{const C=typeof y=="function"?y(h):y;n?n(C):f(C),document.cookie=`${yb}=${C}; path=/; max-age=${vb}`},[n,h]),g=S.useCallback(()=>l?c(y=>!y):b(y=>!y),[l,b,c]);S.useEffect(()=>{const y=C=>{C.key===Cb&&(C.metaKey||C.ctrlKey)&&(C.preventDefault(),g())};return window.addEventListener("keydown",y),()=>window.removeEventListener("keydown",y)},[g]);const v=h?"expanded":"collapsed",N=S.useMemo(()=>({state:v,open:h,setOpen:b,isMobile:l,openMobile:d,setOpenMobile:c,toggleSidebar:g}),[v,h,b,l,d,c,g]);return a.jsx(Wl.Provider,{value:N,children:a.jsx(so,{delayDuration:0,children:a.jsx("div",{style:{"--sidebar-width":xb,"--sidebar-width-icon":Sb,...s},className:m("wu-group/sidebar-wrapper wu-flex wu-min-h-[calc(100svh-48px)] wu-w-full",r),ref:u,...i,children:o})})})});Bl.displayName="SidebarProvider";const ql=S.forwardRef(({side:e="left",variant:t="sidebar",collapsible:n="offcanvas",className:r,children:s,...o},i)=>{const{isMobile:u,state:l,openMobile:d,setOpenMobile:c}=rt();return n==="none"?a.jsx("div",{className:m("wu-flex wu-h-full wu-w-[--sidebar-width] wu-flex-col",r),ref:i,...o,children:s}):u?a.jsx(ai,{open:d,onOpenChange:c,...o,children:a.jsx(gs,{"data-sidebar":"sidebar","data-mobile":"true",className:"wu-w-[--sidebar-width] wu-bg-blue-sidebar wu-p-0 [&>button]:wu-hidden",style:{"--sidebar-width":Nb},side:e,children:a.jsx("div",{className:"wu-flex wu-flex-col wu-w-full wu-h-full",children:s})})}):a.jsxs("div",{ref:i,className:"wu-hidden wu-group wu-peer md:wu-block","data-state":l,"data-collapsible":l==="collapsed"?n:"","data-variant":t,"data-side":e,children:[a.jsx("div",{className:m("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:m("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",r),...o,children:a.jsx("div",{"data-sidebar":"sidebar",className:"wu-flex wu-h-full wu-w-full wu-flex-col wu-bg-[#eef3fb] group-data-[variant=floating]:wu-rounded-lg group-data-[variant=floating]:wu-border group-data-[variant=floating]:wu-border-sidebar-border group-data-[variant=floating]:wu-shadow",children:s})})]})});ql.displayName="Sidebar";const $l=S.forwardRef(({className:e,onClick:t,children:n,...r},s)=>{const{toggleSidebar:o}=rt();return a.jsxs(Et,{ref:s,"data-sidebar":"trigger",variant:"secondary",className:m("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:i=>{t==null||t(i),o()},...r,children:[n,a.jsx("span",{className:"wu-sr-only",children:"Toggle Sidebar"})]})});$l.displayName="SidebarTrigger";const Tb=S.forwardRef(({className:e,...t},n)=>{const{toggleSidebar:r}=rt();return a.jsx("button",{ref:n,"data-sidebar":"rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:r,title:"Toggle Sidebar",className:m("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})});Tb.displayName="SidebarRail";const Hl=S.forwardRef(({className:e,...t},n)=>a.jsx("main",{ref:n,className:m("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}));Hl.displayName="SidebarInset";const Eb=S.forwardRef(({className:e,...t},n)=>a.jsx(Ol,{ref:n,"data-sidebar":"input",className:m("wu-h-8 wu-w-full wu-shadow-none focus-visible:wu-ring-2",e),...t}));Eb.displayName="SidebarInput";const zl=S.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,"data-sidebar":"header",className:m("wu-flex wu-flex-col wu-gap-2 wu-p-2",e),...t}));zl.displayName="SidebarHeader";const Ul=S.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,"data-sidebar":"footer",className:m("wu-flex wu-flex-col wu-gap-2 wu-pb-2",e),...t}));Ul.displayName="SidebarFooter";const Mb=S.forwardRef(({className:e,...t},n)=>a.jsx(Fl,{ref:n,"data-sidebar":"separator",className:m("wu-mx-2 wu-w-auto",e),...t}));Mb.displayName="SidebarSeparator";const jl=S.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,"data-sidebar":"content",className:m("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}));jl.displayName="SidebarContent";const Gl=S.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,"data-sidebar":"group",className:m("wu-relative wu-flex wu-w-full wu-min-w-0 wu-flex-col wu-p-2",e),...t}));Gl.displayName="SidebarGroup";const Kl=S.forwardRef(({className:e,asChild:t=!1,...n},r)=>{const s=t?Ct.Slot:"div";return a.jsx(s,{ref:r,"data-sidebar":"group-label",className:m("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),...n})});Kl.displayName="SidebarGroupLabel";const Ib=S.forwardRef(({className:e,asChild:t=!1,...n},r)=>{const s=t?Ct.Slot:"button";return a.jsx(s,{ref:r,"data-sidebar":"group-action",className:m("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),...n})});Ib.displayName="SidebarGroupAction";const Yl=S.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,"data-sidebar":"group-content",className:m("wu-w-full wu-text-sm",e),...t}));Yl.displayName="SidebarGroupContent";const Na=S.forwardRef(({className:e,...t},n)=>a.jsx("ul",{ref:n,"data-sidebar":"menu",className:m("wu-flex wu-w-full wu-min-w-0 wu-flex-col wu-gap-1",e),...t}));Na.displayName="SidebarMenu";const Xl=S.forwardRef(({className:e,...t},n)=>a.jsx("li",{ref:n,"data-sidebar":"menu-item",className:m("wu-group/menu-item wu-relative",e),...t}));Xl.displayName="SidebarMenuItem";const Db=Be.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"}}),Zl=S.forwardRef(({asChild:e=!1,isActive:t=!1,variant:n="default",size:r="default",tooltip:s,className:o,...i},u)=>{const l=e?Ct.Slot:"button",{isMobile:d,state:c}=rt(),w=a.jsx(l,{ref:u,"data-sidebar":"menu-button","data-size":r,"data-active":t,className:m(Db({variant:n,size:r}),o),...i});return s?(typeof s=="string"&&(s={children:s}),a.jsxs(ao,{children:[a.jsx(oo,{asChild:!0,children:w}),a.jsx(Gr,{side:"right",align:"center",hidden:c!=="collapsed"||d,...s})]})):w});Zl.displayName="SidebarMenuButton";const kb=S.forwardRef(({className:e,asChild:t=!1,showOnHover:n=!1,...r},s)=>{const o=t?Ct.Slot:"button";return a.jsx(o,{ref:s,"data-sidebar":"menu-action",className:m("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",n&&"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),...r})});kb.displayName="SidebarMenuAction";const Ab=S.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,"data-sidebar":"menu-badge",className:m("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}));Ab.displayName="SidebarMenuBadge";const _b=S.forwardRef(({className:e,showIcon:t=!1,...n},r)=>{const s=S.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return a.jsxs("div",{ref:r,"data-sidebar":"menu-skeleton",className:m("wu-flex wu-h-8 wu-items-center wu-gap-2 wu-rounded-md wu-px-2",e),...n,children:[t&&a.jsx(Ll,{className:"wu-rounded-md wu-size-4","data-sidebar":"menu-skeleton-icon"}),a.jsx(Ll,{className:"wu-h-4 wu-max-w-[--skeleton-width] wu-flex-1","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":s}})]})});_b.displayName="SidebarMenuSkeleton";const Pb=S.forwardRef(({className:e,...t},n)=>a.jsx("ul",{ref:n,"data-sidebar":"menu-sub",className:m("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}));Pb.displayName="SidebarMenuSub";const Vb=S.forwardRef(({...e},t)=>a.jsx("li",{ref:t,...e}));Vb.displayName="SidebarMenuSubItem";const Ob=S.forwardRef(({asChild:e=!1,size:t="md",isActive:n,className:r,...s},o)=>{const i=e?Ct.Slot:"a";return a.jsx(i,{ref:o,"data-sidebar":"menu-sub-button","data-size":t,"data-active":n,className:m("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",r),...s})});Ob.displayName="SidebarMenuSubButton";function Fb(e){const{open:t,defaultOpen:n,onOpenChange:r,disabled:s}=e,o=t!==void 0,[i,u]=us({controlled:t,default:n,name:"Collapsible",state:"open"}),{mounted:l,setMounted:d,transitionStatus:c}=lf(i,!0,!0),[w,f]=S.useState(i),[{height:h,width:b},g]=S.useState({height:void 0,width:void 0}),v=No(),[N,y]=S.useState(),C=N??v,[E,x]=S.useState(!1),[D,T]=S.useState(!1),M=S.useRef(null),I=S.useRef(null),_=S.useRef(null),P=S.useRef(null),A=Vo(P,!1),O=he(F=>{const V=!i,L=Ae(cf,F.nativeEvent);if(r(V,L),L.isCanceled)return;const U=P.current;I.current==="css-animation"&&U!=null&&U.style.removeProperty("animation-name"),!E&&!D&&(I.current!=null&&I.current!=="css-animation"&&!l&&V&&d(!0),I.current==="css-animation"&&(!w&&V&&f(!0),!l&&V&&d(!0))),u(V),I.current==="none"&&l&&!V&&d(!1)});return ae(()=>{o&&I.current==="none"&&!i&&d(!1)},[o,i,t,d]),S.useMemo(()=>({abortControllerRef:M,animationTypeRef:I,disabled:s,handleTrigger:O,height:h,mounted:l,open:i,panelId:C,panelRef:P,runOnceAnimationsFinish:A,setDimensions:g,setHiddenUntilFound:x,setKeepMounted:T,setMounted:d,setOpen:u,setPanelIdState:y,setVisible:f,transitionDimensionRef:_,transitionStatus:c,visible:w,width:b}),[M,I,s,O,h,l,i,C,P,A,g,x,T,d,u,f,_,c,w,b])}const Sa=S.createContext(void 0);process.env.NODE_ENV!=="production"&&(Sa.displayName="CollapsibleRootContext");function Jl(){const e=S.useContext(Sa);if(e===void 0)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: CollapsibleRootContext is missing. Collapsible parts must be placed within <Collapsible.Root>.":Xt(15));return e}let mn=(function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=Qt.startingStyle]="startingStyle",e[e.endingStyle=Qt.endingStyle]="endingStyle",e})({}),Lb=(function(e){return e.panelOpen="data-panel-open",e})({});const Wb={[mn.open]:""},Bb={[mn.closed]:""},qb={open(e){return e?{[Lb.panelOpen]:""}:null}},Ql={...{open(e){return e?Wb:Bb}},...Po},Rl=S.forwardRef(function(t,n){const{render:r,className:s,defaultOpen:o=!1,disabled:i=!1,onOpenChange:u,open:l,style:d,...c}=t,w=he(u),f=Fb({open:l,defaultOpen:o,onOpenChange:w,disabled:i}),h=S.useMemo(()=>({open:f.open,disabled:f.disabled,transitionStatus:f.transitionStatus}),[f.open,f.disabled,f.transitionStatus]),b=S.useMemo(()=>({...f,onOpenChange:w,state:h}),[f,w,h]),g=Ye("div",t,{state:h,ref:n,props:c,stateAttributesMapping:Ql});return a.jsx(Sa.Provider,{value:b,children:g})});process.env.NODE_ENV!=="production"&&(Rl.displayName="CollapsibleRoot");const ec=S.createContext(void 0);process.env.NODE_ENV!=="production"&&(ec.displayName="CompositeRootContext");function $b(e=!1){const t=S.useContext(ec);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>.":Xt(16));return t}function Hb(e){const{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:s=0,isNativeButton:o}=e,i=r&&t!==!1,u=r&&t===!1;return{props:S.useMemo(()=>{const d={onKeyDown(c){n&&t&&c.key!=="Tab"&&c.preventDefault()}};return r||(d.tabIndex=s,!o&&n&&(d.tabIndex=t?s:-1)),(o&&(t||i)||!o&&n)&&(d["aria-disabled"]=n),o&&(!t||u)&&(d.disabled=n),d},[r,n,t,i,u,o,s])}}function Ca(e={}){const{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:s=!0,composite:o}=e,i=S.useRef(null),u=$b(!0),l=o??u!==void 0,{props:d}=Hb({focusableWhenDisabled:n,disabled:t,composite:l,tabIndex:r,isNativeButton:s});process.env.NODE_ENV!=="production"&&S.useEffect(()=>{var b,g;if(!i.current)return;const h=hr(i.current);if(s){if(!h){const v=((b=wt.captureOwnerStack)==null?void 0:b.call(wt))||"";Wn(`A component that acts as a button expected a native <button> because the \`nativeButton\` prop is true. Rendering a non-<button> removes native button semantics, which can impact forms and accessibility. Use a real <button> in the \`render\` prop, or set \`nativeButton\` to \`false\`.${v}`)}}else if(h){const v=((g=wt.captureOwnerStack)==null?void 0:g.call(wt))||"";Wn(`A component that acts as a button expected a non-<button> because the \`nativeButton\` prop is false. Rendering a <button> keeps native behavior while Base UI applies non-native attributes and handlers, which can add unintended extra attributes (such as \`role\` or \`aria-disabled\`). Use a non-<button> in the \`render\` prop, or set \`nativeButton\` to \`true\`.${v}`)}},[s]);const c=S.useCallback(()=>{const h=i.current;hr(h)&&l&&t&&d.disabled===void 0&&h.disabled&&(h.disabled=!1)},[t,d.disabled,l]);ae(c,[c]);const w=S.useCallback((h={})=>{const{onClick:b,onMouseDown:g,onKeyUp:v,onKeyDown:N,onPointerDown:y,...C}=h;return es({type:s?"button":void 0,onClick(x){if(t){x.preventDefault();return}b==null||b(x)},onMouseDown(x){t||g==null||g(x)},onKeyDown(x){if(t||(Vn(x),N==null||N(x),x.baseUIHandlerPrevented))return;const D=x.target===x.currentTarget,T=x.currentTarget,M=hr(T),I=!s&&zb(T),_=D&&(s?M:!I),P=x.key==="Enter",A=x.key===" ",O=T.getAttribute("role"),F=(O==null?void 0:O.startsWith("menuitem"))||O==="option"||O==="gridcell";if(D&&l&&A){if(x.defaultPrevented&&F)return;x.preventDefault(),I||s&&M?(T.click(),x.preventBaseUIHandler()):_&&(b==null||b(x),x.preventBaseUIHandler());return}_&&(!s&&(A||P)&&x.preventDefault(),!s&&P&&(b==null||b(x)))},onKeyUp(x){if(!t){if(Vn(x),v==null||v(x),x.target===x.currentTarget&&s&&l&&hr(x.currentTarget)&&x.key===" "){x.preventDefault();return}x.baseUIHandlerPrevented||x.target===x.currentTarget&&!s&&!l&&x.key===" "&&(b==null||b(x))}},onPointerDown(x){if(t){x.preventDefault();return}y==null||y(x)}},s?void 0:{role:"button"},d,C)},[t,d,l,s]),f=he(h=>{i.current=h,c()});return{getButtonProps:w,buttonRef:f}}function hr(e){return Xw(e)&&e.tagName==="BUTTON"}function zb(e){return!!((e==null?void 0:e.tagName)==="A"&&(e!=null&&e.href))}const Ub={...qb,...Po},tc=S.forwardRef(function(t,n){const{panelId:r,open:s,handleTrigger:o,state:i,disabled:u}=Jl(),{className:l,disabled:d=u,id:c,render:w,nativeButton:f=!0,style:h,...b}=t,{getButtonProps:g,buttonRef:v}=Ca({disabled:d,focusableWhenDisabled:!0,native:f}),N=S.useMemo(()=>({"aria-controls":s?r:void 0,"aria-expanded":s,onClick:o}),[r,s,o]);return Ye("button",t,{state:i,ref:[n,v],props:[N,b,g],stateAttributesMapping:Ub})});process.env.NODE_ENV!=="production"&&(tc.displayName="CollapsibleTrigger");function mr(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}let jb=(function(e){return e.disabled="data-disabled",e.orientation="data-orientation",e})({});function Gb(e){const{abortControllerRef:t,animationTypeRef:n,externalRef:r,height:s,hiddenUntilFound:o,keepMounted:i,id:u,mounted:l,onOpenChange:d,open:c,panelRef:w,runOnceAnimationsFinish:f,setDimensions:h,setMounted:b,setOpen:g,setVisible:v,transitionDimensionRef:N,visible:y,width:C}=e,E=S.useRef(!1),x=S.useRef(null),D=S.useRef(c),T=S.useRef(c),M=_o(),I=S.useMemo(()=>n.current==="css-animation"?!y:!c&&!l,[c,l,y,n]),_=he(A=>{if(!A)return;if(n.current==null||N.current==null){const V=getComputedStyle(A),L=V.animationName!=="none"&&V.animationName!=="",U=V.transitionDuration!=="0s"&&V.transitionDuration!=="";L&&U?process.env.NODE_ENV!=="production"&&ss("CSS transitions and CSS animations both detected on Collapsible or Accordion panel.","Only one of either animation type should be used."):V.animationName==="none"&&V.transitionDuration!=="0s"?n.current="css-transition":V.animationName!=="none"&&V.transitionDuration==="0s"?n.current="css-animation":n.current="none",A.getAttribute(jb.orientation)==="horizontal"||V.transitionProperty.indexOf("width")>-1?N.current="width":N.current="height"}if(n.current!=="css-transition")return;(s===void 0||C===void 0)&&(h({height:A.scrollHeight,width:A.scrollWidth}),T.current&&A.style.setProperty("transition-duration","0s"));let O=-1,F=-1;return O=ce.request(()=>{T.current=!1,F=ce.request(()=>{setTimeout(()=>{A.style.removeProperty("transition-duration")})})}),()=>{ce.cancel(O),ce.cancel(F)}}),P=On(r,w,_);return ae(()=>{if(n.current!=="css-transition")return;const A=w.current;if(!A)return;let O=-1;if(t.current!=null&&(t.current.abort(),t.current=null),c){const F={"justify-content":A.style.justifyContent,"align-items":A.style.alignItems,"align-content":A.style.alignContent,"justify-items":A.style.justifyItems};Object.keys(F).forEach(V=>{A.style.setProperty(V,"initial","important")}),!T.current&&!i&&A.setAttribute(mn.startingStyle,""),h({height:A.scrollHeight,width:A.scrollWidth}),O=ce.request(()=>{Object.entries(F).forEach(([V,L])=>{L===""?A.style.removeProperty(V):A.style.setProperty(V,L)})})}else{if(A.scrollHeight===0&&A.scrollWidth===0)return;h({height:A.scrollHeight,width:A.scrollWidth});const F=new AbortController;t.current=F;const V=F.signal;let L=null;const U=mn.endingStyle;return L=new MutationObserver(H=>{H.some(Z=>Z.type==="attributes"&&Z.attributeName===U)&&(L==null||L.disconnect(),L=null,f(()=>{h({height:0,width:0}),A.style.removeProperty("content-visibility"),b(!1),t.current===F&&(t.current=null)},V))}),L.observe(A,{attributes:!0,attributeFilter:[U]}),()=>{L==null||L.disconnect(),M.cancel(),t.current===F&&(F.abort(),t.current=null)}}return()=>{ce.cancel(O)}},[t,n,M,o,i,l,c,w,f,h,b]),ae(()=>{if(n.current!=="css-animation")return;const A=w.current;A&&(x.current=A.style.animationName||x.current,A.style.setProperty("animation-name","none"),h({height:A.scrollHeight,width:A.scrollWidth}),!D.current&&!E.current&&A.style.removeProperty("animation-name"),c?(t.current!=null&&(t.current.abort(),t.current=null),b(!0),v(!0)):(t.current=new AbortController,f(()=>{b(!1),v(!1),t.current=null},t.current.signal)))},[t,n,c,w,f,h,b,v,y]),Fn(()=>{const A=ce.request(()=>{D.current=!1});return()=>ce.cancel(A)}),ae(()=>{if(!o)return;const A=w.current;if(!A)return;let O=-1,F=-1;return c&&E.current&&(A.style.transitionDuration="0s",h({height:A.scrollHeight,width:A.scrollWidth}),O=ce.request(()=>{E.current=!1,F=ce.request(()=>{setTimeout(()=>{A.style.removeProperty("transition-duration")})})})),()=>{ce.cancel(O),ce.cancel(F)}},[o,c,w,h]),ae(()=>{const A=w.current;A&&o&&I&&(A.setAttribute("hidden","until-found"),n.current==="css-transition"&&A.setAttribute(mn.startingStyle,""))},[o,I,n,w]),S.useEffect(function(){const O=w.current;if(!O)return;function F(V){E.current=!0,g(!0),d(!0,Ae(Rt,V))}return mr(O,"beforematch",F)},[d,w,g]),S.useMemo(()=>({props:{hidden:I,id:u,ref:P}}),[I,u,P])}let nc=(function(e){return e.collapsiblePanelHeight="--collapsible-panel-height",e.collapsiblePanelWidth="--collapsible-panel-width",e})({});const rc=S.forwardRef(function(t,n){const{className:r,hiddenUntilFound:s,keepMounted:o,render:i,id:u,style:l,...d}=t;process.env.NODE_ENV!=="production"&&ae(()=>{s&&o===!1&&ss("The `keepMounted={false}` prop on a Collapsible will be ignored when using `hiddenUntilFound` since it requires the Panel to remain mounted even when closed.")},[s,o]);const{abortControllerRef:c,animationTypeRef:w,height:f,mounted:h,onOpenChange:b,open:g,panelId:v,panelRef:N,runOnceAnimationsFinish:y,setDimensions:C,setHiddenUntilFound:E,setKeepMounted:x,setMounted:D,setPanelIdState:T,setOpen:M,setVisible:I,state:_,transitionDimensionRef:P,visible:A,width:O,transitionStatus:F}=Jl(),V=s??!1,L=o??!1;ae(()=>{if(u)return T(u),()=>{T(void 0)}},[u,T]),ae(()=>{E(V)},[E,V]),ae(()=>{x(L)},[x,L]);const{props:U}=Gb({abortControllerRef:c,animationTypeRef:w,externalRef:n,height:f,hiddenUntilFound:V,id:v,keepMounted:L,mounted:h,onOpenChange:b,open:g,panelRef:N,runOnceAnimationsFinish:y,setDimensions:C,setMounted:D,setOpen:M,setVisible:I,transitionDimensionRef:P,visible:A,width:O});uf({open:g&&F==="idle",ref:N,onComplete(){g&&C({height:void 0,width:void 0})}});const H=S.useMemo(()=>({..._,transitionStatus:F}),[_,F]),q=Ye("div",t,{state:H,ref:[n,N],props:[U,{style:{[nc.collapsiblePanelHeight]:f===void 0?"auto":`${f}px`,[nc.collapsiblePanelWidth]:O===void 0?"auto":`${O}px`}},d],stateAttributesMapping:Ql});return L||V||h?q:null});process.env.NODE_ENV!=="production"&&(rc.displayName="CollapsiblePanel");const Kb=({children:e,Sidebar:t,className:n,defaultOpen:r=!0,open:s,onOpenChange:o,style:i})=>a.jsxs(Bl,{defaultOpen:r,open:s,onOpenChange:o,children:[a.jsxs(ql,{variant:"sidebar",collapsible:"icon",className:m("wu-top-12 wu-h-[calc(100%-48px)] wu-shadow-sidebar wu-border-none",n),style:i,role:"complementary",children:[a.jsx(zl,{className:"wu-py-2",children:a.jsx(sc,{})}),t]}),a.jsx(Hl,{className:"wu-contain-inline-size",children:e})]}),sc=e=>{const{state:t,isMobile:n,openMobile:r}=rt();return a.jsx($l,{...e,children:a.jsx(ha,{showMenu:n?r:t==="expanded"})})},Yb=({className:e,children:t,...n})=>{const r=p.useRef(null),s=p.useRef(null),o=({currentTarget:u})=>{const{scrollTop:l,clientHeight:d,scrollHeight:c}=u;r.current&&r.current.classList.toggle("wu-border-[#1b338014]",l!==0),s.current&&s.current.classList.toggle("wu-border-[#1b338014]",l+d!==c)},i="wu-w-[calc(100%-16px)] wu-mx-auto wu-border-transparent";return a.jsxs(jl,{...n,className:m("wu-overflow-hidden wu-gap-0",e),children:[a.jsx("hr",{className:i,ref:r}),a.jsx(Bt,{onScroll:o,className:"wu-gap-2",thumbColor:"#b9c3dc",railColor:"#00000000","data-testid":"scroll-area",children:t}),a.jsx("hr",{className:i,ref:s})]})},Xb=e=>a.jsx(Ul,{...e,children:e.children}),Zb=({label:e,children:t,...n})=>a.jsxs(Gl,{...n,className:"wu-p-0",children:[a.jsx("div",{className:"wu-h-8",children:a.jsx(Kl,{className:"wu-items-end wu-px-4 wu-text-xs wu-font-normal wu-leading-4 wu-text-blue-q",children:e})}),a.jsx(Yl,{children:a.jsx(Na,{children:t})})]}),Jb=e=>a.jsx(Na,{...e}),ac=({Icon:e,children:t,className:n,isActive:r,...s})=>{var w;const{state:o}=rt(),[i,u]=p.useState(),l=xa(),d=p.isValidElement(t)?p.cloneElement(t,{children:a.jsxs("div",{className:"wu-flex wu-items-center wu-overflow-hidden wu-text-base wu-truncate wu-text-ellipsis",children:[a.jsx("div",{className:"wu-relative wu-right-1",children:e}),a.jsx("span",{className:m("wu-text-sm wu-leading-4 wu-transition-opacity wu-duration-150",o==="collapsed"&&!l&&"wu-opacity-0"),children:(w=t.props)==null?void 0:w.children})]})}):t&&a.jsxs("div",{className:"wu-flex wu-items-center wu-overflow-hidden wu-text-base wu-truncate wu-text-ellipsis",children:[a.jsx("div",{className:"wu-relative wu-right-1",children:e}),a.jsx("span",{className:m("wu-text-sm wu-leading-4 wu-transition-opacity wu-duration-150",o==="collapsed"&&!l&&"wu-opacity-0"),children:t})]}),c=p.useRef(null);return p.useEffect(()=>{var f;u(((f=c.current)==null?void 0:f.textContent)||"")},[]),a.jsx(Xl,{...s,className:"wu-flex wu-items-center wu-gap-2 wu-px-2",children:a.jsx(Zl,{className:m("wu-flex wu-items-center wu-text-blue-q hover:wu-bg-blue-sidebarHover wu-cursor-pointer wu-h-8 wu-rounded-sm",n,r&&"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:r,tooltip:i,asChild:p.isValidElement(t),ref:c,children:d})})},Qb=({Title:e,Icon:t,children:n,className:r,...s})=>{const{state:o}=rt(),i=xa();return a.jsxs(Rl,{children:[a.jsx(tc,{render:u=>{const l="data-panel-open"in u;return a.jsxs(ac,{Icon:t,...u,children:[e,(o==="expanded"||i)&&a.jsx(Ve,{icon:"wm-arrow-forward-ios",className:m("wu-absolute wu-right-4 wu-transition-transform wu-duration-300",l&&"wu-rotate-90","wu-scale-75")})]})}}),a.jsx(rc,{className:m(o==="collapsed"?"":"wu-pl-2","wu-h-[var(--collapsible-panel-height)] wu-overflow-hidden","wu-transition-all wu-duration-300 wu-ease-in-out","data-[starting-style]:wu-h-0 data-[ending-style]:wu-h-0",'[&[hidden]:not([hidden="until-found"])]:wu-hidden',r),...s,children:n})]})},Rb=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"}]]),Ta=(e,t,n=1)=>{const r=e.match(/hsla?\(\s*([\d.]+)\s*,\s*([\d.]+)%\s*,\s*([\d.]+)%\s*(?:,\s*([\d.]+)\s*)?\)/);if(!r)throw new Error("Invalid HSL color format");const s=parseFloat(r[1]),o=parseFloat(r[2]),i=Math.max(0,parseFloat(r[3])+t);return`hsl(${s} ${o}% ${i}% / ${n})`},ey=({index:e,viewIndex:t,length:n,itemHeight:r})=>{const s=(e-t+n)%n;let o;s===0?o=0:s===n-1&&n>=2?o=-1:s===n-2&&n>=3?o=-2:s===1?o=1:s===2?o=2:s===n-3&&n>=4?o=-3:o=3;const i=Rb.get(o)||{},u=o>0?r+28+(o-1)*20:i.top;return{position:o,styles:{...i,...o>0&&{top:`${u}px`},height:o>0?"32px":r}}},gn={LIGHTNESS_STEP:8,BORDER_LIGHTNESS:10,CONTENT_HEIGHT:"calc(100% - 2rem)",FONT_SIZE_ACTIVE:"14px",FONT_SIZE_INACTIVE:"12px"},ty=({children:e,className:t,header:n,baseColor:r,position:s=0,style:o,...i})=>{const u=s<=0,l=s===0,d={border:l?`4px solid ${Ta(r,gn.BORDER_LIGHTNESS)}`:"",...o},c={backgroundColor:Ta(r,s*gn.LIGHTNESS_STEP),fontSize:l?gn.FONT_SIZE_ACTIVE:gn.FONT_SIZE_INACTIVE,transition:"all 0.3s ease",position:"relative",bottom:s<0?"4px":"0px",height:"32px",padding:"4px 8px"},w={backgroundColor:Ta(r,45+s*6),height:gn.CONTENT_HEIGHT,position:"relative",bottom:s<0?"4px":"0px"};return a.jsxs("div",{className:m("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,...i,children:[a.jsx("div",{style:c,className:"wu-text-white",children:n}),u&&a.jsx("div",{className:"wu-p-2 wu-overflow-y-auto wu-text-sm",style:w,children:e})]})},ny=({children:e,Trigger:t,Header:n,styles:r={},classNames:s={},open:o,onOpenChange:i,itemHeight:u})=>{const l={height:u,...r.Trigger};return a.jsxs(bl,{open:o,onOpenChange:i,children:[a.jsx(yl,{className:m("wu-bg-gray-25 wu-z-0 wu-w-full wu-rounded-lg wu-rounded-tl-none wu-relative",s.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:m("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",s.Content),hideCloseButton:!0,isStackedCard:!0,style:r.Content,children:[a.jsx(ba,{}),a.jsx(Ga.DialogClose,{className:m("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",s.CloseButton),style:r.CloseButton,"aria-label":"Close dialog",children:a.jsx(Ve,{icon:"wm-close",className:"wu-text-lg wu-m-4 wu-cursor-pointer"})}),n&&a.jsx(ga,{className:m("wu-h-12 wu-p-2 wu-pl-4 wu-bg-white/25 wu-backdrop-blur-[24px]",s.Header),style:r.Header,children:n}),e]})]})};function oc(e){const t=Ze(ry,e).current;return t.next=e,ae(t.effect),t}function ry(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}function sy(){const[,e]=S.useState({});return S.useCallback(()=>{e({})},[])}const ic={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},ay={...ic,position:"fixed",top:0,left:0},oy={...ic,position:"absolute"},Ea=S.createContext(void 0);process.env.NODE_ENV!=="production"&&(Ea.displayName="NumberFieldRootContext");function gr(){const e=S.useContext(Ea);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>.":Xt(43));return e}const bn={inputValue:()=>null,value:()=>null,...Jr},uc=new Map;function yn(e,t){const n=JSON.stringify({locale:e,options:t}),r=uc.get(n);if(r)return r;const s=new Intl.NumberFormat(e,t);return uc.set(n,s),s}function qt(e,t,n){return e==null?"":yn(t,n).format(e)}function lc(e,t,n){return qt(e,t,{...n,maximumFractionDigits:20})}const iy=["零","〇","一","二","三","四","五","六","七","八","九"],uy={零:"0","〇":"0",一:"1",二:"2",三:"3",四:"4",五:"5",六:"6",七:"7",八:"8",九:"9"},cc=["٠","١","٢","٣","٤","٥","٦","٧","٨","٩"],dc=["۰","۱","۲","۳","۴","۵","۶","۷","۸","۹"],Ma=["0","1","2","3","4","5","6","7","8","9"],wc=["%","٪","%","﹪"],fc=["‰","؉"],pc=["−","-","‒","–","—","﹣"],hc=["+","﹢"],ly=".",cy=",",dy=new RegExp(`[${cc.join("")}]`,"g"),wy=new RegExp(`[${dc.join("")}]`,"g"),fy=new RegExp(`[${Ma.join("")}]`,"g"),py=new RegExp(`[${iy.join("")}]`,"g"),hy=new RegExp(`[${wc.join("")}]`),my=new RegExp(`[${fc.join("")}]`),Ia=/[٠١٢٣٤٥٦٧٨٩]/,mc=/[۰۱۲۳۴۵۶۷۸۹]/,Da=/[零〇一二三四五六七八九]/,gc=new RegExp(`[${Ma.join("")}]`),gy=[".",",",ly,cy,"٫","٬"],bc=new RegExp("\\p{Zs}","u"),by=["+",...hc],yy=["-",...pc],br=e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),vy=e=>e.replace(/[-\\\]^]/g,t=>`\\${t}`),yc=e=>`[${e.map(vy).join("")}]`,vc=yc(["-"].concat(pc)),xc=yc(["+"].concat(hc)),Nc=new RegExp(vc,"gu"),Sc=new RegExp(xc,"gu"),vn=new RegExp(vc),yr=new RegExp(xc);function ka(e,t){const n=yn(e,t).formatToParts(11111.1),r={};return n.forEach(s=>{r[s.type]=s.value}),yn(e).formatToParts(.1).forEach(s=>{s.type==="decimal"&&(r[s.type]=s.value)}),r}function xn(e,t,n){if(e==null)return null;let r=String(e).replace(new RegExp("\\p{Cf}","gu"),"").trim();r=r.replace(Nc,"-").replace(Sc,"+");let s=!1;const o=r.match(/([+-])\s*$/);o&&(o[1]==="-"&&(s=!0),r=r.replace(/([+-])\s*$/,""));const i=r.match(/^\s*([+-])/);i&&(i[1]==="-"&&(s=!0),r=r.replace(/^\s*[+-]/,""));let u=t;u===void 0&&(Ia.test(r)||mc.test(r)?u="ar":Da.test(r)&&(u="zh"));const{group:l,decimal:d,currency:c}=ka(u,n),w=yn(u,n).formatToParts(1).filter(T=>T.type==="unit").map(T=>br(T.value)),f=w.length?new RegExp(w.join("|"),"g"):null;let h=null;l&&(new RegExp("\\p{Zs}","u").test(l)?h=new RegExp("\\p{Zs}","gu"):l==="'"||l==="’"?h=/['’]/g:h=new RegExp(br(l),"g"));let g=[{regex:l?h:null,replacement:""},{regex:d?new RegExp(br(d),"g"):null,replacement:"."},{regex:/./g,replacement:"."},{regex:/,/g,replacement:""},{regex:/٫/g,replacement:"."},{regex:/٬/g,replacement:""},{regex:c?new RegExp(br(c),"g"):null,replacement:""},{regex:f,replacement:""},{regex:dy,replacement:T=>String(cc.indexOf(T))},{regex:wy,replacement:T=>String(dc.indexOf(T))},{regex:fy,replacement:T=>String(Ma.indexOf(T))},{regex:py,replacement:T=>uy[T]}].reduce((T,{regex:M,replacement:I})=>M?T.replace(M,I):T,r);const v=g.lastIndexOf(".");if(v!==-1&&(g=`${g.slice(0,v).replace(/\./g,"")}.${g.slice(v+1).replace(/\./g,"")}`),/^[-+]?Infinity$/i.test(r)||/[∞]/.test(r))return null;const N=(s?"-":"")+g;let y=parseFloat(N);const C=n==null?void 0:n.style,E=C==="unit"&&(n==null?void 0:n.unit)==="percent",x=hy.test(e)||C==="percent";return my.test(e)?y/=1e3:!E&&x&&(y/=100),Number.isNaN(y)?null:y}const xy=60,Ny=400,Sy=8,vr=1;function Cy(e,t=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,n))}const Ty=1e-10;function Ey(e){const t=yn("en-US").resolvedOptions(),n=(e==null?void 0:e.minimumFractionDigits)??t.minimumFractionDigits??0;return{maximumFractionDigits:Math.max((e==null?void 0:e.maximumFractionDigits)??t.maximumFractionDigits??20,n),minimumFractionDigits:n}}function My(e,t){if(!Number.isFinite(e))return e;const n=Math.min(Math.max(t,0),20);return Number(e.toFixed(n))}function Aa(e,t){const{maximumFractionDigits:n}=Ey(t);return My(e,n)}function Iy(e,t,n,r="directional"){if(n===0)return e;const s=Math.abs(n),o=Math.sign(n),i=s*Ty*o,u=r==="nearest"?n:s,l=(e-t+i)/u;let d;return r==="nearest"?d=Math.round(l):o>0?d=Math.floor(l):d=Math.ceil(l),t+d*(r==="nearest"?n:s)}function Dy(e,{step:t,minWithDefault:n,maxWithDefault:r,minWithZeroDefault:s,format:o,snapOnStep:i,small:u,clamp:l}){if(e===null)return e;const d=l?Cy(e,n,r):e;if(t!=null&&i){if(t===0)return Aa(d,o);let c=s;!u&&n!==Number.MIN_SAFE_INTEGER&&(c=n);const w=Iy(d,c,t,u?"nearest":"directional");return Aa(w,o)}return Aa(d,o)}const Cc=S.forwardRef(function(t,n){const{id:r,min:s,max:o,smallStep:i=.1,step:u=1,largeStep:l=10,required:d=!1,disabled:c=!1,readOnly:w=!1,form:f,name:h,defaultValue:b,value:g,onValueChange:v,onValueCommitted:N,allowWheelScrub:y=!1,snapOnStep:C=!1,allowOutOfRange:E=!1,format:x,locale:D,render:T,className:M,inputRef:I,style:_,...P}=t,{setDirty:A,validityData:O,disabled:F,setFilled:V,invalid:L,name:U,state:H,validation:q,shouldValidateOnChange:Z}=An(),z=F||c,J=U??h,ie=u==="any"?1:u,[R,ve]=S.useState(!1),K=s??Number.MIN_SAFE_INTEGER,W=o??Number.MAX_SAFE_INTEGER,G=s??0,Y=x==null?void 0:x.style,Q=S.useRef(null),j=On(I,q.inputRef),X=Lo({id:r}),[We,me]=us({controlled:g,default:b,name:"NumberField",state:"value"}),ue=We??null,xe=oc(ue);ae(()=>{V(ue!==null)},[V,ue]);const Pe=sy(),je=oc(x),Ht=S.useRef(!1),Ir=he((ne,ee)=>{Ht.current=!1,N==null||N(ne,ee)}),zt=S.useRef(!0),Dr=S.useRef(null),[at,vt]=S.useState(()=>g!==void 0?Tc(ue,D,x):qt(ue,D,x)),[xt,we]=S.useState("numeric"),ot=he(()=>{const{decimal:ne,group:ee,currency:be,literal:ye}=ka(D,x),le=new Set;gy.forEach(Ce=>le.add(Ce)),ne&&le.add(ne),ee&&(le.add(ee),bc.test(ee)&&le.add(" "));const Ut=Y==="percent"||Y==="unit"&&(x==null?void 0:x.unit)==="percent",Ge=Y==="percent"||Y==="unit"&&(x==null?void 0:x.unit)==="permille";return Ut&&wc.forEach(Ce=>le.add(Ce)),Ge&&fc.forEach(Ce=>le.add(Ce)),Y==="currency"&&be&&le.add(be),ye&&(Array.from(ye).forEach(Ce=>le.add(Ce)),bc.test(ye)&&le.add(" ")),by.forEach(Ce=>le.add(Ce)),K<0&&yy.forEach(Ce=>le.add(Ce)),le}),Nt=he(ne=>ne!=null&&ne.altKey?i:ne!=null&&ne.shiftKey?l:ie),kr=he((ne,ee)=>{const be=ee.event,ye=ee.direction,le=ee.reason,Ut=!E||!(le===ls||le===Hn||le===cs||le===en||le===Rt),Ge=Dy(ne,{step:ye?Nt(be)*ye:void 0,format:je.current,minWithDefault:K,maxWithDefault:W,minWithZeroDefault:G,snapOnStep:C,small:(be==null?void 0:be.altKey)??!1,clamp:Ut}),Ce=ee.reason===ls||ee.reason===en||ee.reason===Hn||ee.reason===cs||ee.reason===Rt,za=Ge!==ue||Ce&&(ne!==ue||zt.current===!1);if(za){if(Dr.current=Ge,v==null||v(Ge,ee),ee.isCanceled)return za;me(Ge),A(Ge!==O.initialValue),Ht.current=!0}return zt.current&&vt(qt(Ge,D,x)),Pe(),za}),Ar=he((ne,{direction:ee,currentValue:be,event:ye,reason:le})=>{const Ut=be??xe.current,Ge=typeof Ut=="number"?Ut+ne*ee:Math.max(0,s??0);return kr(Ge,Ae(le,ye,void 0,{direction:ee}))});ae(function(){if(!zt.current)return;const ee=g!==void 0?Tc(ue,D,x):qt(ue,D,x);ee!==at&&vt(ee)}),ae(function(){if(!Qw)return;let ee="text";K>=0&&(ee="decimal"),we(ee)},[K,Y]),S.useEffect(function(){const ee=Q.current;if(z||w||!y||!ee)return;function be(ye){if(ye.ctrlKey||ko(Do(Q.current))!==Q.current)return;ye.preventDefault();const le=Nt(ye)??vr;Ar(le,{direction:ye.deltaY>0?-1:1,event:ye,reason:"wheel"})}return mr(ee,"wheel",be)},[y,Ar,z,w,l,ie,Nt]);const Ha=S.useMemo(()=>({...H,disabled:z,readOnly:w,required:d,value:ue,inputValue:at,scrubbing:R}),[H,z,w,d,ue,at,R]),_v=S.useMemo(()=>({inputRef:Q,inputValue:at,value:ue,minWithDefault:K,maxWithDefault:W,disabled:z,readOnly:w,id:X,setValue:kr,incrementValue:Ar,getStepAmount:Nt,allowInputSyncRef:zt,formatOptionsRef:je,valueRef:xe,lastChangedValueRef:Dr,hasPendingCommitRef:Ht,name:J,required:d,invalid:L,inputMode:xt,getAllowedNonNumericKeys:ot,min:s,max:o,setInputValue:vt,locale:D,isScrubbing:R,setIsScrubbing:ve,state:Ha,onValueCommitted:Ir}),[Q,at,ue,K,W,z,w,X,kr,Ar,Nt,je,xe,J,d,L,xt,ot,s,o,vt,D,R,Ha,Ir]),Pv=Ye("div",t,{ref:n,state:Ha,props:P,stateAttributesMapping:bn});return a.jsxs(Ea.Provider,{value:_v,children:[Pv,a.jsx("input",{...q.getInputValidationProps({onFocus(){var ne;(ne=Q.current)==null||ne.focus()},onChange(ne){if(ne.nativeEvent.defaultPrevented)return;const ee=ne.currentTarget.valueAsNumber,be=Number.isNaN(ee)?null:ee,ye=Ae(Rt,ne.nativeEvent);A(be!==O.initialValue),kr(be,ye),Z()&&q.commit(be)}}),ref:j,type:"number",form:f,name:J,value:ue??"",min:s,max:o,step:u,disabled:z,required:d,"aria-hidden":!0,tabIndex:-1,style:J?oy:ay,suppressHydrationWarning:!0})]})});process.env.NODE_ENV!=="production"&&(Cc.displayName="NumberFieldRoot");function Tc(e,t,n){return(n==null?void 0:n.maximumFractionDigits)!=null||(n==null?void 0:n.minimumFractionDigits)!=null?qt(e,t,n):lc(e,t,n)}const Ec=S.forwardRef(function(t,n){const{render:r,className:s,style:o,...i}=t,{state:u}=gr();return Ye("div",t,{ref:n,state:u,props:[{role:"group"},i],stateAttributesMapping:bn})});process.env.NODE_ENV!=="production"&&(Ec.displayName="NumberFieldGroup");const Mc=0;class _a extends Ln{constructor(){super(...arguments);Te(this,"clear",()=>{this.currentId!==Mc&&(clearInterval(this.currentId),this.currentId=Mc)})}static create(){return new _a}start(n,r){this.clear(),this.currentId=setInterval(()=>{r()},n)}}function ky(){const e=Ze(_a.create).current;return Fn(e.disposeEffect),e}const Ay=60,_y=400,Py=8,Vy=50,Oy=3;function Nn(e){return e==="touch"||e==="pen"}function Fy(e){const{disabled:t,readOnly:n=!1,tick:r,onStop:s,tickDelay:o=Ay,startDelay:i=_y,scrollDistance:u=Py,elementRef:l}=e,d=Mo(),c=ky(),w=Mo(),f=S.useRef(!1),h=S.useRef(0),b=S.useRef({x:0,y:0}),g=S.useRef(!1),v=S.useRef(!1),N=S.useRef(""),y=S.useRef(()=>{}),C=he(()=>{w.clear(),d.clear(),c.clear(),y.current(),h.current=0}),E=he(T=>{C();const M=l.current;if(!M)return;const I=os(M);function _(P){P.preventDefault()}if(y.current=mr(I,"contextmenu",_),mr(I,"pointerup",P=>{f.current=!1,C(),s==null||s(P)},{once:!0}),!r(T)){C();return}d.start(i,()=>{c.start(o,()=>{r(T)||C()})})});S.useEffect(()=>()=>C(),[C]);const x={onTouchStart(){g.current=!0},onTouchEnd(){g.current=!1},onPointerDown(T){const M=!T.button||T.button===0;if(T.defaultPrevented||!M||t||n)return;N.current=T.pointerType,v.current=!1,f.current=!0,b.current={x:T.clientX,y:T.clientY},Nn(T.pointerType)?w.start(Vy,()=>{const _=h.current;h.current=0,f.current&&_<Oy?(E(T.nativeEvent),v.current=!0):(v.current=!1,C())}):(T.preventDefault(),E(T.nativeEvent))},onPointerUp(T){Nn(T.pointerType)&&(f.current=!1)},onPointerMove(T){if(t||n||!Nn(T.pointerType)||!f.current)return;h.current!=null&&(h.current+=1);const{x:M,y:I}=b.current,_=M-T.clientX,P=I-T.clientY;_**2+P**2>u**2&&C()},onMouseEnter(T){T.defaultPrevented||t||n||!f.current||g.current||Nn(N.current)||E(T.nativeEvent)},onMouseLeave(){g.current||C()},onMouseUp(){g.current||C()}},D=he(T=>T.defaultPrevented?!0:Nn(N.current)?v.current:T.detail!==0);return{pointerHandlers:x,shouldSkipClick:D}}function Ly(e){return e==="touch"||e==="pen"}function Ic(e){const{allowInputSyncRef:t,disabled:n,formatOptionsRef:r,getStepAmount:s,id:o,incrementValue:i,inputRef:u,inputValue:l,isIncrement:d,locale:c,readOnly:w,setValue:f,valueRef:h,lastChangedValueRef:b,onValueCommitted:g}=e,v=d?df:wf;function N(x){t.current=!0;const D=xn(l,c,r.current);D!==null&&(h.current=D,f(D,Ae(v,x,void 0,{direction:d?1:-1})))}const{pointerHandlers:y,shouldSkipClick:C}=Fy({disabled:n||w,elementRef:u,tickDelay:xy,startDelay:Ny,scrollDistance:Sy,tick(x){const D=s(x)??vr;return i(D,{direction:d?1:-1,event:x,reason:v})},onStop(x){const D=b.current??h.current;g(D,nn(v,x))}});return{disabled:n,"aria-readonly":w||void 0,"aria-label":d?"Increase":"Decrease","aria-controls":o,tabIndex:-1,style:{WebkitUserSelect:"none",userSelect:"none"},...y,onClick(x){const D=n||w;if(x.defaultPrevented||D||C(x))return;N(x.nativeEvent);const T=s(x)??vr,M=h.current;i(T,{direction:d?1:-1,event:x.nativeEvent,reason:v});const I=b.current??h.current;I!==M&&g(I,nn(v,x.nativeEvent))},onPointerDown(x){var T;const D=!x.button||x.button===0;x.defaultPrevented||w||!D||n||(N(x.nativeEvent),Ly(x.pointerType)||(T=u.current)==null||T.focus(),y.onPointerDown(x))}}}const Dc=S.forwardRef(function(t,n){const{render:r,className:s,disabled:o=!1,nativeButton:i=!0,style:u,...l}=t,{allowInputSyncRef:d,disabled:c,formatOptionsRef:w,getStepAmount:f,id:h,incrementValue:b,inputRef:g,inputValue:v,locale:N,maxWithDefault:y,readOnly:C,setValue:E,state:x,value:D,valueRef:T,lastChangedValueRef:M,onValueCommitted:I}=gr(),_=D!=null&&D>=y,P=o||c||_,A=Ic({isIncrement:!0,inputRef:g,inputValue:v,disabled:P,readOnly:C,id:h,setValue:E,getStepAmount:f,incrementValue:b,allowInputSyncRef:d,formatOptionsRef:w,valueRef:T,locale:N,lastChangedValueRef:M,onValueCommitted:I}),{getButtonProps:O,buttonRef:F}=Ca({disabled:P,native:i,focusableWhenDisabled:!0}),V=S.useMemo(()=>({...x,disabled:P}),[x,P]);return Ye("button",t,{ref:[n,F],state:V,props:[A,l,O],stateAttributesMapping:bn})});process.env.NODE_ENV!=="production"&&(Dc.displayName="NumberFieldIncrement");const kc=S.forwardRef(function(t,n){const{render:r,className:s,disabled:o=!1,nativeButton:i=!0,style:u,...l}=t,{allowInputSyncRef:d,disabled:c,formatOptionsRef:w,getStepAmount:f,id:h,incrementValue:b,inputRef:g,inputValue:v,minWithDefault:N,readOnly:y,setValue:C,state:E,value:x,valueRef:D,locale:T,lastChangedValueRef:M,onValueCommitted:I}=gr(),_=x!=null&&x<=N,P=o||c||_,A=Ic({isIncrement:!1,inputRef:g,inputValue:v,disabled:P,readOnly:y,id:h,setValue:C,getStepAmount:f,incrementValue:b,allowInputSyncRef:d,formatOptionsRef:w,valueRef:D,locale:T,lastChangedValueRef:M,onValueCommitted:I}),{getButtonProps:O,buttonRef:F}=Ca({disabled:P,native:i,focusableWhenDisabled:!0}),V=S.useMemo(()=>({...E,disabled:P}),[E,P]);return Ye("button",t,{ref:[n,F],state:V,props:[A,l,O],stateAttributesMapping:bn})});process.env.NODE_ENV!=="production"&&(kc.displayName="NumberFieldDecrement");function Wy(e,t){const n=S.useRef(e),r=he(t);ae(()=>{n.current!==e&&r(n.current)},[e,r]),ae(()=>{n.current=e},[e])}const By={...Jr,...bn},qy=new Set(["Backspace","Delete","ArrowLeft","ArrowRight","Tab","Enter","Escape"]),Ac=S.forwardRef(function(t,n){const{render:r,className:s,style:o,...i}=t,{allowInputSyncRef:u,disabled:l,formatOptionsRef:d,getAllowedNonNumericKeys:c,getStepAmount:w,id:f,incrementValue:h,inputMode:b,inputValue:g,max:v,min:N,name:y,readOnly:C,required:E,setValue:x,state:D,setInputValue:T,locale:M,inputRef:I,value:_,onValueCommitted:P,lastChangedValueRef:A,hasPendingCommitRef:O,valueRef:F}=gr(),{clearErrors:V}=Cw(),{validationMode:L,setTouched:U,setFocused:H,invalid:q,shouldValidateOnChange:Z,validation:z}=An(),{labelId:J}=ns(),ie=S.useRef(!1),R=S.useRef(!1);return Fo(I,{id:f,value:_}),Wy(_,W=>{const G=Z();if(V(y),G&&z.commit(_),!(W===_||G)){if(R.current){R.current=!1;return}z.commit(_,!0)}}),Ye("input",t,{ref:[n,I],state:D,props:[{id:f,required:E,disabled:l,readOnly:C,inputMode:b,value:g,type:"text",autoComplete:"off",autoCorrect:"off",spellCheck:"false","aria-roledescription":"Number field","aria-invalid":q||void 0,"aria-labelledby":J,suppressHydrationWarning:!0,onFocus(W){if(W.defaultPrevented||C||l||(H(!0),ie.current))return;ie.current=!0;const G=W.currentTarget,Y=G.value.length;G.setSelectionRange(Y,Y)},onBlur(W){if(W.defaultPrevented||C||l)return;U(!0),H(!1);const G=!u.current,Y=O.current;if(u.current=!0,g.trim()===""){x(null,Ae(en,W.nativeEvent)),L==="onBlur"&&z.commit(null),P(null,nn(en,W.nativeEvent));return}const Q=d.current,j=xn(g,M,Q);if(j===null)return;const X=(Q==null?void 0:Q.maximumFractionDigits)!=null||(Q==null?void 0:Q.minimumFractionDigits)!=null,We=Q==null?void 0:Q.maximumFractionDigits,me=X&&typeof We=="number"?Number(j.toFixed(We)):j,ue=nn(Hn,W.nativeEvent),xe=_!==me,Pe=G||xe||Y;L==="onBlur"&&z.commit(me),xe&&(R.current=!0,x(me,Ae(Hn,W.nativeEvent))),Pe&&P(me,ue);const je=qt(me,M,Q);!(!X&&j===_&&g===lc(j,M,Q))&&g!==je&&T(je)},onChange(W){if(W.nativeEvent.defaultPrevented)return;u.current=!1;const G=W.currentTarget.value;if(G.trim()===""){T(G),x(null,Ae(en,W.nativeEvent));return}const Y=c();if(!Array.from(G).every(X=>{const We=X>="0"&&X<="9",me=Ia.test(X),ue=Da.test(X),xe=mc.test(X),Pe=gc.test(X),je=vn.test(X);return We||me||ue||xe||Pe||je||Y.has(X)}))return;const j=xn(G,M,d.current);T(G),j!==null&&x(j,Ae(ls,W.nativeEvent))},onKeyDown(W){if(W.defaultPrevented||C||l)return;const G=W.nativeEvent;u.current=!0;const Y=c();let Q=Y.has(W.key);const{decimal:j,currency:X,percentSign:We}=ka(M,d.current),me=W.currentTarget.selectionStart,ue=W.currentTarget.selectionEnd,xe=me===0&&ue===g.length,Pe=we=>me!=null&&ue!=null&&we>=me&&we<ue;if(vn.test(W.key)&&Array.from(Y).some(we=>vn.test(we||""))){const we=g.search(Nc),ot=we!=null&&we!==-1&&Pe(we);Q=!(vn.test(g)||yr.test(g))||xe||ot}if(yr.test(W.key)&&Array.from(Y).some(we=>yr.test(we||""))){const we=g.search(Sc),ot=we!=null&&we!==-1&&Pe(we);Q=!(vn.test(g)||yr.test(g))||xe||ot}[j,X,We].forEach(we=>{if(W.key===we){const ot=g.indexOf(we),Nt=Pe(ot);Q=!g.includes(we)||xe||Nt}});const je=W.key>="0"&&W.key<="9",Ht=Ia.test(W.key),Ir=Da.test(W.key),zt=gc.test(W.key),Dr=qy.has(W.key);if(W.which===229||W.altKey||W.ctrlKey||W.metaKey||Q||je||Ht||zt||Ir||Dr)return;const at=xn(g,M,d.current),vt=w(W)??vr;nf(W);const xt=nn(tn,G);W.key==="ArrowUp"?(h(vt,{direction:1,currentValue:at,event:G,reason:tn}),P(A.current??F.current,xt)):W.key==="ArrowDown"?(h(vt,{direction:-1,currentValue:at,event:G,reason:tn}),P(A.current??F.current,xt)):W.key==="Home"&&N!=null?(x(N,Ae(tn,G)),P(A.current??F.current,xt)):W.key==="End"&&v!=null&&(x(v,Ae(tn,G)),P(A.current??F.current,xt))},onPaste(W){if(W.defaultPrevented||C||l)return;W.preventDefault();const Y=(W.clipboardData||window.Clipboard).getData("text/plain"),Q=xn(Y,M,d.current);Q!==null&&(u.current=!1,x(Q,Ae(cs,W.nativeEvent)),T(Y))}},z.getValidationProps(),i],stateAttributesMapping:By})});process.env.NODE_ENV!=="production"&&(Ac.displayName="NumberFieldInput");const $y={wuStepper:"_wuStepper_apbnq_1"},Hy=({onChange:e,Label:t,defaultValue:n=0,readonly:r,dir:s,step:o=1,min:i,max:u,value:l,className:d,labelPosition:c="left",disabled:w,resetInvalidValueOnBlur:f=!0,...h})=>{const b=S.useId(),[g,v]=S.useState(l!==void 0?Number(l):n||0);S.useEffect(()=>{l!==void 0&&v(Number(l))},[l]);const N=T=>{v(T),e==null||e(T)},y=T=>{const M=Number(T.target.value);Number.isNaN(M)||v(M)},C=()=>{f&&(i!==void 0&&g<i?(v(i),e==null||e(i)):u!==void 0&&g>u&&(v(u),e==null||e(u)))};S.useEffect(()=>{l&&n&&console.warn("As both value and defaultValue are passed, value will be used")},[l,n]);const E={inc:r||u!==void 0&&g>=u||w,dec:r||i!==void 0&&g<=i||w},x=i!==void 0&&g<i||u!==void 0&&g>u,D=m("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(Cc,{id:b,value:g,step:o,readOnly:r,onValueChange:T=>typeof T=="number"&&N(T),dir:s,className:m("wu-flex wu-stepper",s==="rtl"&&c!=="top"&&"wu-gap-2",$y.wuStepper,zy({labelPosition:c}),d),children:[t&&a.jsx(De,{htmlFor:b,className:"wu-input-label",children:t}),a.jsxs(Ec,{className:"wu-flex wu-max-w-[97px] wu-relative",children:[a.jsx(kc,{"aria-label":"decrement",className:m(D,s==="rtl"?"wu-right-0":"wu-left-0","wu-stepper-button"),disabled:E.dec,children:a.jsx("span",{className:"wu-text-base wm-minimize"})}),a.jsx(Ac,{"aria-label":"stepper",role:"spinbutton",type:"text","aria-invalid":x||void 0,dir:s,className:m("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",x&&"wu-border-red-deep focus:wu-border-red-deep","wu-stepper-input"),readOnly:r,onChange:y,onBlur:C,disabled:w,min:i,max:u,step:o,value:g,...h}),a.jsx(Dc,{"aria-label":"increment",className:m(D,s==="rtl"?"wu-left-0":"wu-right-0","wu-stepper-button"),disabled:E.inc,children:a.jsx("span",{className:"wu-text-base wm-add"})})]})]})},zy=Be.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"}}}),Le={container:"_container_1cpdq_1",sidebar:"_sidebar_1cpdq_5",content:"_content_1cpdq_13",sourceWrapper:"_sourceWrapper_1cpdq_17",list:"_list_1cpdq_25",listItem:"_listItem_1cpdq_29",listItemActive:"_listItemActive_1cpdq_42",label:"_label_1cpdq_46",icon:"_icon_1cpdq_50",sharedWrapper:"_sharedWrapper_1cpdq_54"},_c=p.memo(({className:e,label:t="Shared surveys",...n})=>a.jsxs("button",{className:m(Le.sharedWrapper,e),"data-slot":"survey-select-shared","aria-label":t,...n,children:[a.jsx("span",{className:"wm-share","aria-hidden":"true"}),a.jsx("span",{children:t})]}));_c.displayName="WuSharedSurvey";const Uy=(e,t=!1)=>{if(e)return a.jsx("span",{className:Le.icon,"aria-hidden":"true",children:e});const n=t?"wm-folder-supervised":"wm-folder";return a.jsx("span",{className:m(Le.icon,n),"aria-hidden":"true"})},Pc=p.memo(({children:e,icon:t,isActive:n,isShared:r,className:s,...o})=>a.jsxs("button",{className:m(Le.listItem,n&&Le.listItemActive,s),"aria-selected":n,"data-slot":"survey-select-item",type:"button",...o,children:[Uy(t,r),a.jsx("span",{className:Le.label,children:e})]}));Pc.displayName="WuSurveyItem";const Vc=p.memo(({children:e,className:t,...n})=>a.jsx("div",{className:m(Le.list,t),...n,children:e}));Vc.displayName="WuSurveyList";const Oc=e=>{const{className:t,variant:n="outlined",...r}=e;return a.jsx("div",{className:Le.sourceWrapper,"data-slot":"survey-select-source",children:a.jsx(ml,{variant:n,showGroupSeparator:!0,className:m(Le.source,t),...r})})};Oc.displayName="WuSurveySource";const jy=p.memo(Oc),Fc=p.memo(({Sidebar:e,children:t,className:n,...r})=>a.jsxs("div",{className:m(Le.container,n),role:"region","aria-label":"Survey selection interface","data-slot":"survey-select",...r,children:[e&&a.jsx("div",{className:Le.sidebar,role:"complementary","aria-label":"Survey sidebar","data-slot":"survey-select-sidebar",children:e}),a.jsx("div",{className:Le.content,"aria-label":"Survey content","data-slot":"survey-select-content",children:t})]}));Fc.displayName="WuSurveySelect";const Lc=Be.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"}}),Gy=S.forwardRef(({className:e,variant:t,size:n,...r},s)=>a.jsx(Xa.Root,{ref:s,className:m(Lc({variant:t,size:n,className:e})),...r}));Gy.displayName=Xa.Root.displayName;const Wc=S.createContext({size:"default",variant:"default"}),xr=S.forwardRef(({className:e,variant:t,size:n,children:r,...s},o)=>a.jsx(En.Root,{ref:o,className:m("wu-flex wu-items-center wu-justify-center wu-gap-1",e),...s,children:a.jsx(Wc.Provider,{value:{variant:t,size:n},children:r})}));xr.displayName=En.Root.displayName;const yt=S.forwardRef(({className:e,children:t,variant:n,size:r,...s},o)=>{const i=S.useContext(Wc);return a.jsx(En.Item,{ref:o,className:m(Lc({variant:i.variant||n,size:i.size||r}),e),...s,children:t})});yt.displayName=En.Item.displayName;const Bc=p.forwardRef((e,t)=>{const{options:n,value:r,disabled:s,dir:o,onChange:i}=e,u=l=>m("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",s&&"wu-cursor-not-allowed data-[state=on]:wu-text-gray-lead",l===r&&"wu-text-white",s&&r===l&&"wu-text-gray-lead","wu-switcher-icon-tab-item");return a.jsx(a.Fragment,{children:a.jsxs(xr,{ref:t,type:"single",value:r,onValueChange:i,disabled:s,dir:o,className:m("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",s&&"wu-cursor-not-allowed","wu-switcher-icon-tab-group"),children:[a.jsx("div",{role:"slider",className:m("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",r==="opt1"&&"",r==="opt2"&&o!=="rtl"&&"wu-translate-x-full",r==="opt2"&&o==="rtl"&&"-wu-translate-x-full",s&&"wu-bg-gray-40","wu-switcher-icon-tab-slider")}),a.jsx(yt,{value:"opt1",className:u("opt1"),children:n[0].label}),a.jsx(yt,{value:"opt2",className:u("opt2"),children:n[1].label})]})})});Bc.displayName="_IconTab";const qc=p.forwardRef((e,t)=>{const{options:n,value:r,disabled:s,dir:o,size:i="md",onChange:u}=e,l=d=>m("wu-w-1/2 wu-text-xs wu-rounded-full wu-text-gray-lead wu-relative wu-z-10 wu-font-normal",s&&"wu-cursor-not-allowed data-[state=on]:wu-text-gray-lead",i==="sm"&&"wu-h-6 wu-min-w-20",i==="md"&&"wu-h-8 wu-min-w-28",i==="lg"&&"wu-h-10 wu-min-w-36",d===r&&"wu-text-white wu-font-medium",s&&r===d&&"wu-text-gray-lead","wu-switcher-tab-item");return a.jsx(a.Fragment,{children:a.jsxs(xr,{ref:t,type:"single",value:r,onValueChange:u,disabled:s,dir:o,className:m("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",s&&"wu-cursor-not-allowed","wu-switcher-tab-group"),children:[a.jsx("div",{role:"slider",className:m("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 ",i==="sm"&&"wu-h-6 wu-min-w-20",i==="md"&&"wu-h-8 wu-min-w-28",i==="lg"&&"wu-h-10 wu-min-w-36",r==="opt1"&&"",r==="opt2"&&o!=="rtl"&&"wu-translate-x-full",r==="opt2"&&o==="rtl"&&"-wu-translate-x-full",s&&"wu-bg-gray-40","wu-switcher-tab-slider")}),a.jsx(yt,{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:n[0].label})}),a.jsx(yt,{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:n[1].label})})]})})});qc.displayName="_Tab";const $c=p.forwardRef((e,t)=>{const{options:n,value:r,disabled:s,dir:o,onChange:i}=e,u=w=>m("wu-p-0 wu-w-fit wu-text-xs wu-text-gray-lead wu-h-fit wu-font-normal",s&&"wu-cursor-not-allowed data-[state=on]:wu-text-gray-subtle wu-text-gray-subtle",w===r&&"wu-text-primary wu-font-medium",s&&r===w&&"wu-text-gray-lead","wu-switcher-toggle-item"),l=m("wu-w-fit wu-gap-2",s&&"wu-cursor-not-allowed","wu-switcher-toggle-group"),d=m("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",s&&"wu-border-gray-subtle wu-cursor-not-allowed","wu-switcher-toggle-button"),c=m("wu-w-2 wu-h-2 wu-bg-blue-p wu-rounded-full wu-transition-transform wu-duration-300 wu-ease-in-out",r==="opt1"&&o!=="rtl"&&"-wu-translate-x-[10px]",r==="opt1"&&o==="rtl"&&"wu-translate-x-[10px]",r==="opt2"&&o!=="rtl"&&"wu-translate-x-[10px]",r==="opt2"&&o==="rtl"&&"-wu-translate-x-[10px]",s&&"wu-hidden","wu-switcher-toggle-knob");return a.jsx(a.Fragment,{children:a.jsxs(xr,{ref:t,type:"single",value:r,disabled:s,dir:o,className:l,onValueChange:i,children:[a.jsx(yt,{value:"opt1",className:u("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:n[0].label})}),a.jsx("button",{onClick:()=>i(r==="opt1"?"opt2":"opt1"),className:d,disabled:s,"aria-label":"knob",dir:o,children:a.jsx("div",{className:c,role:"knob",dir:o})}),a.jsx(yt,{value:"opt2",className:u("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:n[1].label})})]})})});$c.displayName="_Toggle";const Hc=p.forwardRef((e,t)=>{const{type:n,options:r,value:s,disabled:o,dir:i,size:u,onChange:l,toggle:d=!0,...c}=e,[w,f]=p.useState(),h=b=>{let g=w;b!==""?g=b:d&&(g=w==="opt1"?"opt2":"opt1");const v=g==="opt1"?r[0].value:r[1].value;l&&l(v),f(g)};if(p.useEffect(()=>{if(!Array.isArray(r)||r.length<2)throw new Error("Options are not sufficient");f(s===r[0].value?"opt1":"opt2")},[r,s]),!Array.isArray(r)||r.length<2)return a.jsx(a.Fragment,{});switch(n){case"toggle":return a.jsx($c,{...c,ref:t,options:r,value:w||"opt1",onChange:h,disabled:o,dir:i});case"iconTab":return a.jsx(Bc,{ref:t,options:r,value:w||"opt1",onChange:h,disabled:o,dir:i});default:return a.jsx(qc,{ref:t,options:r,value:w||"opt1",onChange:h,disabled:o,dir:i,size:u})}});Hc.displayName="WuSwitcher";const zc=lt.Root,Pa=S.forwardRef(({className:e,children:t,...n},r)=>a.jsx(lt.List,{className:m("wu-relative wu-flex",e),...n,ref:r,children:t}));Pa.displayName=lt.List.displayName;const Va=S.forwardRef(({className:e,...t},n)=>a.jsx(lt.Trigger,{ref:n,className:m("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}));Va.displayName=lt.Trigger.displayName;const Uc=S.forwardRef(({className:e,...t},n)=>a.jsx(lt.Content,{ref:n,className:e,...t}));Uc.displayName=lt.Content.displayName;const jc=({items:e,enableAnimation:t})=>{const n="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:m("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(r=>a.jsx(Uc,{value:r.value,forceMount:t||void 0,className:m("wu-w-full wu-h-full wu-overflow-y-auto",t&&n,"wu-tab-content"),children:r.Content},r.value))})},Ky=e=>{const[t,n]=p.useState(!1),[r,s]=p.useState(!1),o=()=>{const u=e.current;u&&(n(u.scrollLeft>0),s(u.scrollLeft+u.clientWidth<u.scrollWidth))};return p.useEffect(()=>{const u=e.current;return o(),u&&u.addEventListener("scroll",o),window.addEventListener("resize",o),()=>{u&&u.removeEventListener("scroll",o),window.removeEventListener("resize",o)}},[e]),{showLeftArrow:t,showRightArrow:r,scrollByTab:u=>{const l=e.current;if(l){const d=(u==="right"?l.clientWidth:-l.clientWidth)*.8;l.scrollBy({left:d,behavior:"smooth"})}}}},Gc=(e,t)=>{const[n,r]=p.useState({width:0,left:0,height:0,top:0}),s=t==="vertical";return p.useEffect(()=>{const o=e.current;if(o){const i=()=>{const l=o.querySelector('[data-state="active"]');if(l){const d={width:s?2:l.offsetWidth,left:s?0:l.offsetLeft,height:s?l.offsetHeight:1,top:s?l.offsetTop:0};r(d)}},u=new MutationObserver(i);return u.observe(o,{attributes:!0,subtree:!0}),i(),()=>{u.disconnect()}}},[e,s]),n},Yy=({items:e,value:t,defaultValue:n,onValueChange:r,enableAnimation:s=!1,className:o,dir:i="ltr",position:u="top"})=>{var C;const l=p.useRef(null),d=Gc(l,"horizontal"),{showLeftArrow:c,showRightArrow:w,scrollByTab:f}=Ky(l),[h,b]=p.useState(!1),g=()=>f("left"),v=()=>f("right"),N=E=>a.jsx("div",{"data-testid":`gradient-overlay-${E}`,className:m("wu-absolute wu-top-0 wu-h-full wu-w-20 wu-z-10 wu-pointer-events-none",E==="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=(E,x,D)=>{const T=x==="left";return a.jsx("button",{onClick:E,className:m("wu-absolute wu-z-20 wu-flex wu-items-center wu-justify-center wu-px-1 wu-py-1 wu-transition-all wu-duration-300 wu-h-8",T?"wu-left-0":"wu-right-0",D&&"wu-translate-x-0 wu-opacity-100",!D&&[T?"-wu-translate-x-full":"wu-translate-x-full","wu-opacity-0"]),"aria-label":T?"scroll-left":"scroll-right",children:a.jsx("span",{className:m("wu-text-blue-p wu-text-lg",T?"wm-keyboard-arrow-left":"wm-keyboard-arrow-right")})})};return a.jsxs(zc,{defaultValue:n||((C=e[0])==null?void 0:C.value),value:t,onValueChange:r,orientation:"horizontal",dir:i,className:m("wu-relative wu-flex wu-flex-col wu-w-full wu-h-full",u==="bottom"?"wu-flex-col-reverse":"wu-flex-col",o),role:"tabs",children:[a.jsxs("div",{className:"wu-relative wu-flex wu-overflow-hidden wu-shrink-0 wu-border-b wu-border-gray-200",onMouseEnter:()=>b(!0),onMouseLeave:()=>b(!1),"aria-label":"tablistWrapper",children:[c&&h&&N("left"),y(g,"left",c&&h),a.jsxs(Pa,{ref:l,className:m("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(E=>a.jsx(Va,{value:E.value,children:E.Trigger},E.value)),a.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:u==="bottom"?void 0:0,top:u==="bottom"?0:void 0}})]}),w&&h&&N("right"),y(v,"right",w&&h)]}),a.jsx(jc,{items:e,enableAnimation:s})]})},Xy=e=>{const[t,n]=p.useState(!1),[r,s]=p.useState(!1),o=()=>{const u=e.current;u&&(n(u.scrollTop>0),s(u.scrollTop+u.clientHeight<u.scrollHeight))};return p.useEffect(()=>{const u=e.current;if(u)return o(),u.addEventListener("scroll",o),window.addEventListener("resize",o),()=>{u.removeEventListener("scroll",o),window.removeEventListener("resize",o)}},[e]),{showTopArrow:t,showBottomArrow:r,scrollByTab:u=>{const l=e.current;if(l){const d=(u==="down"?l.clientHeight:-l.clientHeight)*.8;l.scrollBy({top:d,behavior:"smooth"})}}}},Zy=({items:e,value:t,defaultValue:n,onValueChange:r,enableAnimation:s=!1,className:o,dir:i="ltr",position:u="left"})=>{var C;const l=p.useRef(null),d=Gc(l,"vertical"),{showTopArrow:c,showBottomArrow:w,scrollByTab:f}=Xy(l),[h,b]=p.useState(!1),g=()=>f("up"),v=()=>f("down"),N=E=>a.jsx("div",{className:m("wu-absolute wu-left-0 wu-w-full wu-h-12 wu-z-10 wu-pointer-events-none",E==="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=(E,x,D)=>{const T=x==="up";return a.jsx("button",{onClick:E,className:m("wu-absolute wu-z-20 wu-flex wu-items-center wu-justify-center wu-px-1 wu-py-1 wu-transition-all wu-duration-300 wu-w-full",T?"-wu-top-1":"-wu-bottom-1",D&&"wu-translate-y-0 wu-opacity-100",!D&&[T?"-wu-translate-y-full":"wu-translate-y-full","wu-opacity-0"]),"aria-label":T?"scroll-up":"scroll-down",children:a.jsx("span",{className:m("wu-text-blue-p wu-text-lg",T?"wm-keyboard-arrow-up":"wm-keyboard-arrow-down")})})};return a.jsxs(zc,{defaultValue:n||((C=e[0])==null?void 0:C.value),value:t,onValueChange:r,orientation:"vertical",dir:i,className:m("wu-relative wu-h-full wu-w-full wu-flex",u==="left"?"wu-flex-row":"wu-flex-row-reverse",o),role:"tabs",children:[a.jsxs("div",{className:"wu-relative wu-flex wu-overflow-hidden wu-shrink-0",onMouseEnter:()=>b(!0),onMouseLeave:()=>b(!1),"aria-label":"tablistWrapper",children:[c&&h&&N("top"),y(g,"up",c&&h),a.jsxs(Pa,{ref:l,className:m("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(E=>a.jsx(Va,{value:E.value,children:E.Trigger},E.value)),a.jsx("span",{className:"wu-absolute wu-bg-blue-p wu-transition-all wu-duration-300 wu-indicator",style:{width:2,left:u==="left"?0:void 0,right:u==="right"?0:void 0,height:d.height,top:d.top}})]}),w&&h&&N("bottom"),y(v,"down",w&&h)]}),a.jsx(jc,{items:e,enableAnimation:s})]})},Jy=({...e})=>e.orientation==="vertical"?a.jsx(Zy,{...e}):a.jsx(Yy,{...e}),Oa=S.forwardRef(({className:e,...t},n)=>a.jsx("table",{ref:n,className:m("wu-w-full wu-caption-bottom wu-text-sm",e),...t}));Oa.displayName="Table";const Fa=S.forwardRef(({className:e,...t},n)=>a.jsx("thead",{ref:n,className:m("[&_tr]:wu-border-b",e),...t}));Fa.displayName="TableHeader";const Sn=S.forwardRef(({className:e,...t},n)=>a.jsx("tbody",{ref:n,className:m("",e),...t}));Sn.displayName="TableBody";const Qy=S.forwardRef(({className:e,...t},n)=>a.jsx("tfoot",{ref:n,className:m("wu-border-t wu-bg-muted/50 wu-font-medium [&>tr]:last:wu-border-b-0",e),...t}));Qy.displayName="TableFooter";const st=S.forwardRef(({className:e,...t},n)=>a.jsx("tr",{ref:n,className:m("wu-border-b wu-transition-colors wu-hover:wu-bg-muted/50 data-[state=selected]:wu-bg-muted",e),...t}));st.displayName="TableRow";const Nr=S.forwardRef(({className:e,...t},n)=>a.jsx("th",{ref:n,className:m("wu-px-4 wu-text-left wu-align-middle wu-font-medium wu-text-muted-foreground [&:has([role=checkbox])]:wu-pr-0",e),...t}));Nr.displayName="TableHead";const $t=S.forwardRef(({className:e,...t},n)=>a.jsx("td",{ref:n,className:m("wu-p-4 wu-align-middle [&:has([role=checkbox])]:wu-pr-0",e),...t}));$t.displayName="TableCell";const Cn=S.forwardRef(({className:e,...t},n)=>a.jsx("caption",{ref:n,className:m("wu-mt-4 wu-text-sm wu-text-gray-subtle wu-font-normal",e),...t}));Cn.displayName="TableCaption";const Ry=({columns:e,rowSelection:t})=>{const n=(t==null?void 0:t.isEnabled)??!1,r=(t==null?void 0:t.size)??48,{onRowSelect:s,rowUniqueKey:o,isRowDisabled:i,hideSelectAll:u}=t||{},l=p.useCallback(c=>w=>{s==null||s(w?c:[])},[s]);return{finalColumns:p.useMemo(()=>n?[{id:"select",header:({table:c})=>{const w=c.getRowModel().rows.map(h=>h.original).filter(h=>!(i!=null&&i(h))),f=l(w);return u?a.jsx("div",{}):a.jsx($e,{checked:c.getIsSomeRowsSelected()||c.getIsAllRowsSelected(),partial:c.getIsSomeRowsSelected()&&!c.getIsAllRowsSelected(),onChange:h=>{c.toggleAllRowsSelected(!!h),f(!!h)},"aria-label":"Select all","data-testid":c.getIsSomeRowsSelected()&&!c.getIsAllRowsSelected()?"select-partial":"select-all"})},cell:({row:c})=>{const w=(i==null?void 0:i(c.original))??!1;return a.jsx($e,{checked:c.getIsSelected(),disabled:w,onChange:f=>{w||c.toggleSelected(!!f)},"aria-label":String(c.original[o])})},filterable:!1,accessorKey:"select",size:r},...e]:e,[e,n,l,i,u])}};function Kc({data:e,columns:t,rowSelection:n}){const{finalColumns:r}=Ry({columns:t,rowSelection:n}),s=p.useMemo(()=>{if(!(n!=null&&n.isEnabled))return{};const o={};for(const i of n.selectedRows){const u=e.findIndex(l=>l[n.rowUniqueKey]===i[n.rowUniqueKey]);u!==-1&&(o[u]=!0)}return o},[e,n]);return{finalColumns:r,rowSelectionState:s}}const Yc=48,Xc="expander";function Zc(e,t){return e?[{id:Xc,accessorKey:Xc,header:"",cell:({row:n})=>{const r=n.getIsExpanded();return a.jsx("button",{type:"button",className:"wu-inline-flex wu-h-full wu-w-full wu-items-center wu-justify-center wu-text-[10px]",onClick:()=>n.toggleExpanded(),"aria-label":r?"Collapse row":"Expand row",children:a.jsx("span",{className:m("wm-arrow-forward-ios wu-transition-all",r?"wu-rotate-90":"")})})},enableSorting:!1,enableColumnFilter:!1,enableGlobalFilter:!1,enableHiding:!1,size:Yc},...t]:t}function ev(e,t){const n=t.map(r=>{var s;return(s=r.columnDef)==null?void 0:s.expandableRowContent}).find(r=>r);return n==null?void 0:n.call(null,e)}function Jc(e,t,n){return e===!0&&(!t||n>t)}const Qc=(e,t)=>m("wu-group wu-transition-colors wu-border-b wu-border-black/[12%]",e&&"wu-bg-blue-p/[8%]",!t&&(e?"hover:wu-bg-blue-p/[16%]":"hover:wu-bg-black/[2%]")),Rc=(e,t="default",n)=>m("wu-py-0 wu-font-light wu-text-xs",t==="compact"?"wu-h-8":"wu-h-10",e==="actions"&&"wu-opacity-0 wu-transition-opacity wu-duration-150 wu-ease-in-out group-hover:wu-opacity-100",n==="right"&&"wu-text-right",n==="center"&&"wu-text-center",n==="left"&&"wu-text-left"),tv=(e="default")=>e==="compact"?"wu-h-8":"wu-h-10",nv=e=>m({"wu-text-right":e==="right","wu-text-center":e==="center","wu-text-left":e==="left"}),rv=e=>m({"wu-justify-end":e==="right","wu-justify-center":e==="center"}),sv=(e,t)=>m("wu-absolute -wu-bottom-[13px] wu-left-0 wm-arrow-drop-up wu-text-xl",e&&"wu-hidden",!t&&"-wu-bottom-[10px]"),av=(e,t)=>m("wu-absolute -wu-top-[15px] wu-left-0 wm-arrow-drop-down wu-text-xl",e&&"wu-hidden",!t&&"-wu-top-[11px]"),ed=({table:e,size:t,NoDataContent:n,isLoading:r,CustomLoader:s,isRowDisabled:o,isRowExpandable:i})=>{const u=e.getVisibleLeafColumns().length,l=e.getRowModel().rows;return r?a.jsx(Sn,{children:a.jsx(st,{children:a.jsx($t,{colSpan:u,className:"wu-text-center wu-h-[35vh] wu-loader-container",children:s??a.jsx(ct,{className:"wu-w-full"})})})}):l!=null&&l.length?a.jsx(Sn,{children:l.flatMap((d,c)=>{const w=(o==null?void 0:o(d.original))??!1,f=d.getIsSelected(),h=d.getIsExpanded(),b=a.jsx(st,{"data-disabled":w,"data-state":f&&"selected",className:Qc(f,w),"data-expanded":h,children:d.getVisibleCells().map((N,y)=>{const C=N.column.columnDef;return a.jsx($t,{className:Rc(N.column.id,t,C.cellAlign),style:{width:`${N.column.getSize()}px`},children:Ee.flexRender(C.cell,N.getContext())},`${N.id}-${y}`)})},`${d.id}-${c}`),g=i&&h?ev(d,e.getVisibleLeafColumns()):null,v=g?a.jsx(st,{"data-expanded":"true","data-state":f&&"selected",children:a.jsx($t,{colSpan:u,children:g})},`${d.id}-expanded-${c}`):null;return v?[b,v]:[b]})}):a.jsx(Sn,{children:a.jsx(st,{children:a.jsx($t,{colSpan:u,children:n})})})},La=({table:e,sortableColumns:t,manual:n=!1,onSort:r,size:s,isRowSelected:o,HeaderAction:i,isStickyHeader:u,asVirtualContent:l=!1,isRowExpandable:d})=>{var N;const c=s==="compact"?"wu-h-8":"wu-h-10",w=e.getVisibleLeafColumns(),f=y=>{const{id:C,columnDef:E,getIsSorted:x,toggleSorting:D}=y,T=E.header,M=E.headerAlign;if(!t.includes(C))return T;const I=x(),_=I==="asc",P=I==="desc",A=()=>{n?r==null||r({id:C,desc:y.getIsSorted()==="asc"}):D(y.getIsSorted()==="asc")};return a.jsxs("button",{onClick:A,"aria-label":`Sort by ${T}`,className:m("wu-flex wu-items-center wu-gap-1 wu-w-full",rv(M)),children:[T,a.jsxs("div",{className:"wu-relative wu-flex-shrink-0 wu-w-4",children:[a.jsx("span",{className:av(_,!!I)}),a.jsx("span",{className:sv(P,!!I)})]})]})},h=y=>y.column.id==="actions"?a.jsx(Nr,{colSpan:y.colSpan,className:"wu-text-xs wu-font-medium",style:{width:`${y.getSize()}px`}},y.id):a.jsx(Nr,{colSpan:y.colSpan,className:m("wu-text-xs wu-font-medium wu-bg-[#EEEEEE]","wu-relative wu-z-0",nv(y.column.columnDef.headerAlign)),style:{width:`${y.getSize()}px`},children:Ee.flexRender(f(y.column),y.getContext())},y.id),b=()=>e.getHeaderGroups().map(y=>a.jsx(st,{className:"wu-relative",children:y.headers.map(h)},y.id)),g=()=>{var y;return a.jsxs("div",{className:m("wu-flex wu-items-center wu-border-b wu-border-t wu-bg-gray-20",c),children:[a.jsx("div",{className:m("wu-flex wu-items-center wu-px-4"),style:{width:(y=w[0])==null?void 0:y.getSize(),marginLeft:d?Yc:void 0},children:a.jsx($e,{checked:e.getIsSomeRowsSelected()||e.getIsAllRowsSelected(),partial:e.getIsSomeRowsSelected()&&!e.getIsAllRowsSelected(),onChange:C=>e.toggleAllRowsSelected(!!C),"aria-label":"Select all","data-testid":"select-all-header-checkbox"})}),a.jsx("div",{className:"wu-flex-1 wu-flex wu-pr-4",children:i})]})},v=o&&i;if(l){const y=((N=e.getHeaderGroups()[0])==null?void 0:N.headers)??[];return a.jsxs(st,{className:"wu-relative",children:[y.map(h),v&&a.jsx(Nr,{colSpan:w.length,className:"wu-p-0 wu-absolute wu-top-0 wu-left-0 wu-right-0 wu-z-10",children:g()})]})}return a.jsxs(Fa,{className:m("wu-border-t wu-border-black/[12%] wu-bg-gray-20 wu-relative",u&&"wu-sticky wu-top-[-.5px] wu-z-10",c),children:[b(),v&&a.jsx("div",{className:m("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",c),children:g()})]})},td=p.forwardRef((e,t)=>a.jsx(Sn,{...e,ref:t}));td.displayName="TableBodyComponent";const nd=({table:e,size:t,isRowDisabled:n,containerHeight:r=600,sortableColumns:s,HeaderAction:o,isRowSelected:i,manual:u=!1,onSort:l,tableLayout:d="auto"})=>{const c=e.getRowModel().rows,w=e.getVisibleLeafColumns();return a.jsx("div",{className:"wu-w-full",children:a.jsx(ja.TableVirtuoso,{style:{height:r},totalCount:c.length,fixedHeaderContent:()=>a.jsx(La,{table:e,sortableColumns:s,manual:u,onSort:l,size:t,isRowSelected:i,HeaderAction:o,asVirtualContent:!0}),itemContent:f=>{const h=c[f];return h?a.jsx(a.Fragment,{children:h.getVisibleCells().map((b,g)=>{const v=b.column.columnDef;return a.jsx($t,{className:Rc(b.column.id,t,v.cellAlign),children:Ee.flexRender(v.cell,b.getContext())},`${b.id}-${g}`)})}):null},components:{Table:({style:f,...h})=>a.jsxs("table",{...h,style:{...f,width:"100%",borderCollapse:"collapse",tableLayout:d},children:[a.jsx("colgroup",{children:w.map(b=>a.jsx("col",{style:{width:`${b.getSize()}px`}},b.id))}),h.children]}),TableBody:td,TableHead:f=>a.jsx(Fa,{...f,className:m("wu-border-t wu-border-black/[12%] wu-bg-gray-20",tv(t),f.className)}),TableRow:({...f})=>{const h=f["data-index"],b=c[h],g=b?(n==null?void 0:n(b.original))??!1:!1,v=(b==null?void 0:b.getIsSelected())??!1;return a.jsx(st,{...f,"data-disabled":g,"data-state":v&&"selected",className:Qc(v,g)})}}})})},Sr=Be.cva("",{variants:{variant:{striped:'[&_tr:nth-child(even):not([data-expanded])]:wu-bg-zinc-50 [&_tr:nth-child(odd)[data-expanded]:not([data-state="selected"])]:wu-bg-zinc-50',unstyled:"",bordered:"wu-border-collapse wu-border wu-border-black/[12%] [&_th]:wu-border [&_td]:wu-border"}}}),ov=({data:e,columns:t,isLoading:n=!1,variant:r="unstyled",sort:s,size:o,rowSelection:i,HeaderAction:u,NoDataContent:l,stickyHeader:d=!1,CustomLoader:c,caption:w,virtualization:f,isRowExpandable:h,tableLayout:b="fixed",style:g,className:v,...N})=>{var V,L;const[y,C]=p.useState({}),[E,x]=p.useState(()=>(s==null?void 0:s.defaultSort)??null),{finalColumns:D,rowSelectionState:T}=Kc({data:e,columns:t,rowSelection:i}),M=p.useMemo(()=>D.filter(U=>U.enableSorting).map(U=>U.accessorKey),[D]),I=p.useMemo(()=>Zc(h,D),[D,h]),_=((V=i==null?void 0:i.selectedRows)==null?void 0:V.length)??0,P=U=>{const H=typeof U=="function"?U(T):U,q=[],Z=i==null?void 0:i.isRowDisabled;for(const z in H){if(!H[z])continue;const J=e[Number(z)];J&&(Z!=null&&Z(J)||q.push(J))}i==null||i.onRowSelect(q)},A=Ee.useReactTable({data:e,columns:I,getCoreRowModel:Ee.getCoreRowModel(),getPaginationRowModel:Ee.getPaginationRowModel(),getExpandedRowModel:h?Ee.getExpandedRowModel():void 0,manualPagination:!0,manualSorting:!0,manualFiltering:!0,enableRowSelection:i!=null&&i.isRowDisabled?U=>!i.isRowDisabled(U.original):!0,enableExpanding:!!h,state:{sorting:E?[{id:E.id,desc:E.desc}]:[],...i!=null&&i.isEnabled?{rowSelection:T}:{},...h?{expanded:y}:{}},onRowSelectionChange:P,...h?{onExpandedChange:C}:{}}),O=Jc(f==null?void 0:f.enabled,f==null?void 0:f.threshold,e.length),F=(f==null?void 0:f.maxHeight)??600;return a.jsx("div",{className:m("wu-text-gray-lead wu-table-container wu-relative"),children:O?a.jsxs("div",{className:m("wu-overflow-hidden wu-w-full",Sr({variant:r})),children:[w&&a.jsx(Cn,{className:"wu-font-light",children:w}),n?a.jsx("div",{className:"wu-text-center wu-h-[35vh] wu-flex wu-items-center wu-justify-center",children:c??a.jsx(ct,{className:"wu-w-full"})}):(L=A.getRowModel().rows)!=null&&L.length?a.jsx(nd,{table:A,size:o,isRowDisabled:i==null?void 0:i.isRowDisabled,containerHeight:F,sortableColumns:M,HeaderAction:u,isRowSelected:_>0,manual:!0,onSort:U=>{x(U),s==null||s.onSort(U)},tableLayout:b}):a.jsx("div",{className:"wu-p-4 wu-text-center",children:l})]}):a.jsxs(Oa,{...N,className:m("wu-overflow-x-auto wu-w-full",Sr({variant:r}),v),style:{tableLayout:b,...g},children:[w&&a.jsx(Cn,{className:"wu-font-light",children:w}),a.jsx(La,{table:A,sortableColumns:M,manual:!0,onSort:U=>{x(U),s==null||s.onSort(U)},size:o,HeaderAction:u,isRowSelected:_>0,isStickyHeader:d,isRowExpandable:h}),a.jsx(ed,{table:A,size:o,NoDataContent:l,CustomLoader:c,isLoading:n,isRowDisabled:i==null?void 0:i.isRowDisabled,isRowExpandable:h})]})})},iv=({data:e,columns:t,variant:n="unstyled",size:r="default",sort:s,filterText:o,pagination:i,stickyHeader:u,HeaderAction:l,CustomLoader:d,NoDataContent:c,isLoading:w,caption:f,rowSelection:h,isRowExpandable:b,virtualization:g,tableLayout:v="fixed",style:N,className:y,...C})=>{var J,ie;const[E,x]=p.useState(()=>s!=null&&s.defaultSort?[{id:s.defaultSort.id,desc:s.defaultSort.desc}]:[]),[D,T]=p.useState([]),[M,I]=p.useState((i==null?void 0:i.pageIndex)??0),[_,P]=p.useState({}),{finalColumns:A,rowSelectionState:O}=Kc({data:e,columns:t,rowSelection:h}),F=p.useMemo(()=>A.filter(R=>R.enableSorting).map(R=>R.accessorKey),[A]),V=p.useMemo(()=>A.filter(R=>R.filterable).map(R=>R.accessorKey),[A]),L=((J=h==null?void 0:h.selectedRows)==null?void 0:J.length)??0,U=p.useMemo(()=>Zc(b,A),[A,b]),H=R=>{const ve=typeof R=="function"?R(O):R,K=[],W=h==null?void 0:h.isRowDisabled;for(const G in ve){if(!ve[G])continue;const Y=e[Number(G)];Y&&(W!=null&&W(Y)||K.push(Y))}h==null||h.onRowSelect(K)},q=Ee.useReactTable({data:e,columns:U,getCoreRowModel:Ee.getCoreRowModel(),getFilteredRowModel:Ee.getFilteredRowModel(),getSortedRowModel:Ee.getSortedRowModel(),getPaginationRowModel:i?Ee.getPaginationRowModel():void 0,getExpandedRowModel:b?Ee.getExpandedRowModel():void 0,enableRowSelection:h!=null&&h.isRowDisabled?R=>!h.isRowDisabled(R.original):!0,enableExpanding:!!b,state:{sorting:E,columnFilters:D,...i?{pagination:i}:{},...h!=null&&h.isEnabled?{rowSelection:O}:{},...b?{expanded:_}:{}},onSortingChange:x,onColumnFiltersChange:T,onRowSelectionChange:H,...b?{onExpandedChange:P}:{}});p.useEffect(()=>{V.forEach(R=>{var ve;(ve=q.getColumn(R))==null||ve.setFilterValue(o)})},[o,V,q]),p.useEffect(()=>{i&&(i==null?void 0:i.pageIndex)!==M&&(h==null||h.onRowSelect(()=>[]),q.resetRowSelection(),I(i.pageIndex))},[i==null?void 0:i.pageIndex]);const Z=Jc(g==null?void 0:g.enabled,g==null?void 0:g.threshold,e.length),z=(g==null?void 0:g.maxHeight)??600;return a.jsx("div",{className:"wu-text-gray-lead wu-table-container wu-relative",children:Z?a.jsxs("div",{className:m("wu-overflow-hidden wu-w-full",Sr({variant:n})),children:[f&&a.jsx(Cn,{children:f}),w?a.jsx("div",{className:"wu-text-center wu-h-[35vh] wu-flex wu-items-center wu-justify-center",children:d??a.jsx(ct,{className:"wu-w-full"})}):(ie=q.getRowModel().rows)!=null&&ie.length?a.jsx(nd,{table:q,size:r,isRowDisabled:h==null?void 0:h.isRowDisabled,containerHeight:z,sortableColumns:F,HeaderAction:l,isRowSelected:L>0,tableLayout:v}):a.jsx("div",{className:"wu-p-4 wu-text-center",children:c})]}):a.jsxs(Oa,{...C,className:m(`wu-table-${v}`,"wu-overflow-x-auto wu-w-full",Sr({variant:n}),y),style:{tableLayout:v,...N},children:[f&&a.jsx(Cn,{children:f}),a.jsx(La,{table:q,sortableColumns:F,size:r,HeaderAction:l,isRowSelected:L>0,isStickyHeader:u,isRowExpandable:b}),a.jsx(ed,{table:q,size:r,NoDataContent:c,CustomLoader:d,isLoading:w,isRowDisabled:h==null?void 0:h.isRowDisabled,isRowExpandable:b})]})})},rd=S.forwardRef(({className:e,...t},n)=>a.jsx("textarea",{className:m("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:n,...t}));rd.displayName="Textarea";const sd=p.forwardRef((e,t)=>{const{Label:n,id:r=Fr(),variant:s="flat",readonly:o,maxLength:i,labelPosition:u="top",...l}=e,d=w=>{l.onChange&&l.onChange(w)},c=Mn(u);return a.jsxs("div",{className:m(c,"wu-flex wu-textarea-container"),dir:l.dir,children:[a.jsx(rd,{...l,ref:t,id:r,className:m("wu-peer wu-rounded-t-sm",s==="outlined"?"wu-border wu-border-gray-subtle":"",l.className),onChange:d,readOnly:o,maxLength:i}),n&&a.jsx(De,{htmlFor:r,className:"wu-textarea-label",children:n})]})});sd.displayName="WuTextarea";function uv(e){if(typeof e=="string"&&e.includes("T")){const t=$.parseISO(e);return $.format(t,"HH:mm")}if(typeof e=="string"&&/^\d{2}:\d{2}:\d{2}$/.test(e)){const t=$.parse(e,"HH:mm:ss",new Date);return $.format(t,"HH:mm")}return typeof e=="string"&&/^\d{2}:\d{2}$/.test(e)?e:"00:00"}const ad=["12",...Array.from({length:11},(e,t)=>String(t+1).padStart(2,"0"))],od=Array.from({length:60},(e,t)=>String(t).padStart(2,"0")),id=["am","pm"],Cr=50;function lv(e){return Array(Cr).fill(e).flat()}function Wa(e,t){const n=e.indexOf(t);return[...e.slice(n),...e.slice(0,n)]}function cv(e,t){let n=Number(e);return t==="pm"&&n<12&&(n+=12),t==="am"&&n===12&&(n=0),String(n).padStart(2,"0")}function ud(e){const t=Number(e),n=t>=12?"pm":"am",r=t%12===0?12:t%12;return{hour:String(r),meridiem:n}}const dv=({value:e,isSelected:t,onClick:n})=>a.jsx("div",{onClick:n,className:m("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}),Ba=({values:e,selectedValue:t,scrollRef:n,onSelect:r,repeatItems:s=!0,className:o})=>a.jsx("div",{ref:n,className:m("wu-overflow-y-scroll wu-w-8 wu-snap-y wu-snap-mandatory [&::-webkit-scrollbar]:hidden [-ms-overflow-style:none] [scrollbar-width:none]",o),role:"presentation",children:(s?lv(e):e).map((i,u)=>a.jsx(dv,{value:i,isSelected:i===t,onClick:()=>r(i)},`${i}-${u}`))});function wv(e,t,n,r){const s=p.useMemo(()=>e?Wa(ad,t.padStart(2,"0")):ad,[e]),o=p.useMemo(()=>e?Wa(od,n.padStart(2,"0")):od,[e]),i=p.useMemo(()=>e?Wa(id,r):id,[e]);return{rotatedHours:s,rotatedMinutes:o,rotatedMeridiem:i}}function fv(e,t,n){p.useEffect(()=>{function r(i){if(i){const u=i.scrollHeight/Cr,l=Math.floor(Cr/2);i.scrollTop=l*u;const d=()=>{const{scrollTop:c}=i,w=Math.round(c/u);(w<=1||w>=Cr-2)&&(i.scrollTop=l*u)};return i.addEventListener("scroll",d),()=>{i.removeEventListener("scroll",d)}}}if(!e)return;const s=r(t.current),o=r(n.current);return()=>{s==null||s(),o==null||o()}},[e,t,n])}const ld=({className:e,time:t,Label:n,labelPosition:r,dir:s,...o})=>{const[i,u]=p.useState(!1),[l,d]=p.useState(""),c=p.useRef(null),w=p.useRef(null),f=p.useRef(null),h=p.useRef(null),[b,g]=p.useState("12"),[v,N]=p.useState("00"),[y,C]=p.useState("am");p.useEffect(()=>{if(!t){d(""),g("12"),N("00"),C("am"),c.current&&(c.current.value="");return}const M=uv(t);d(M);const[I,_]=M.split(":"),{hour:P,meridiem:A}=ud(I);g(P),N(_),C(A),c.current&&(c.current.value=M)},[t]),p.useEffect(()=>{const M=I=>{w.current&&!w.current.contains(I.target)&&u(!1)};return document.addEventListener("mousedown",M),()=>{document.removeEventListener("mousedown",M)}},[]),fv(i,f,h);const{rotatedHours:E,rotatedMinutes:x,rotatedMeridiem:D}=wv(i,b,v,y),T=p.useCallback((M,I,_)=>{const P=M??b,A=I??v,O=_??y;g(P),N(A),C(O);const F=`${cv(P,O)}:${A}`;d(F)},[b,v,y]);return a.jsxs("div",{className:m("wu-flex wu-gap-1 wu-relative wu-w-fit wu-flex-col",(r==="right"||r==="left")&&"wu-items-center",r==="left"&&"wu-flex-row",r==="right"&&"wu-flex-row-reverse","wu-input-wrapper"),dir:s,children:[n&&a.jsx(De,{htmlFor:"time-picker",className:"wu-timepicker-label",children:n}),a.jsxs("div",{className:m("relative inline-block"),ref:w,dir:s,children:[a.jsx(Je,{ref:c,type:"time",value:l,variant:"flat",role:"textbox",onChange:M=>{d(M.target.value);const[I,_]=M.target.value.split(":"),{hour:P,meridiem:A}=ud(I);g(P),N(_),C(A)},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(Ve,{icon:"wm-schedule",className:m("wu-text-base",o.disabled&&"wu-text-lead/50 wu-pointer-events-none wu-opacity-50"),onClick:()=>u(M=>!M),"data-testid":"wu-timepicker-icon"}),iconPosition:"right",dir:s,...o}),a.jsx("style",{children:`
19
19
  input[type="time"]::-webkit-calendar-picker-indicator { display: none; }
20
- `}),i&&a.jsxs("div",{className:m("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(Ba,{values:E,selectedValue:b.padStart(2,"0"),scrollRef:f,onSelect:M=>T(M,v),className:"wu-time-hour-picker"}),a.jsx(Ba,{values:x,selectedValue:v.padStart(2,"0"),scrollRef:h,onSelect:M=>T(b,M),className:"wu-time-minute-picker"}),a.jsx(Ba,{values:D,selectedValue:y,onSelect:M=>T(void 0,void 0,M),className:"wu-time-meridiem-picker",repeatItems:!1})]})]})]})};ld.displayName="WuTimePicker";const pv=1,hv=1e6;let qa=0;function mv(){return qa=(qa+1)%Number.MAX_SAFE_INTEGER,qa.toString()}const $a=new Map,cd=e=>{if($a.has(e))return;const t=setTimeout(()=>{$a.delete(e),Tn({type:"REMOVE_TOAST",toastId:e})},hv);$a.set(e,t)},gv=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,pv)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(n=>n.id===t.toast.id?{...n,...t.toast}:n)};case"DISMISS_TOAST":{const{toastId:n}=t;return n?cd(n):e.toasts.forEach(r=>{cd(r.id)}),{...e,toasts:e.toasts.map(r=>r.id===n||n===void 0?{...r,open:!1}:r)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(n=>n.id!==t.toastId)}}},Tr=[];let Er={toasts:[]};function Tn(e){Er=gv(Er,e),Tr.forEach(t=>{t(Er)})}function dd({...e}){const t=mv(),n=s=>Tn({type:"UPDATE_TOAST",toast:{...s,id:t}}),r=()=>Tn({type:"DISMISS_TOAST",toastId:t});return Tn({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:s=>{s||r()}}}),{id:t,dismiss:r,update:n}}function bv(){const[e,t]=p.useState(Er);return p.useEffect(()=>(Tr.push(t),()=>{const n=Tr.indexOf(t);n>-1&&Tr.splice(n,1)}),[e]),{...e,toast:dd,dismiss:n=>Tn({type:"DISMISS_TOAST",toastId:n})}}const yv=()=>({showToast:({message:t,variant:n,duration:r,position:s})=>dd({description:t,variant:n,duration:r,position:s})}),vv=Me.Provider,xv=Be.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"}}),wd=S.forwardRef(({className:e,position:t,...n},r)=>a.jsx(Me.Viewport,{ref:r,className:m(xv({position:t}),e),...n}));wd.displayName=Me.Viewport.displayName;const Nv=Be.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"}}),fd=S.forwardRef(({className:e,variant:t,position:n,...r},s)=>a.jsx(Me.Root,{ref:s,className:m(Nv({variant:t,position:n}),e),...r}));fd.displayName=Me.Root.displayName;const Sv=S.forwardRef(({className:e,...t},n)=>a.jsx(Me.Action,{ref:n,className:m("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}));Sv.displayName=Me.Action.displayName;const pd=S.forwardRef(({className:e,...t},n)=>a.jsx(Me.Close,{ref:n,className:m("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"})}));pd.displayName=Me.Close.displayName;const hd=S.forwardRef(({className:e,...t},n)=>a.jsx(Me.Title,{ref:n,className:m("wu-text-sm wu-font-semibold",e),...t}));hd.displayName=Me.Title.displayName;const md=S.forwardRef(({className:e,...t},n)=>a.jsx(Me.Description,{ref:n,className:m("wu-text-sm wu-opacity-90",e),...t}));md.displayName=Me.Description.displayName;function Cv(){const{toasts:e}=bv(),t=e.reduce((n,r)=>{const s=r.position||"top";return n[s]||(n[s]=[]),n[s].push(r),n},{});return a.jsx(vv,{children:Object.entries(t).map(([n,r])=>a.jsx(wd,{position:n,children:r.map(function({id:s,title:o,description:i,action:u,variant:l,position:d,...c}){const w={success:"wm-check-circle",info:"wm-info",warning:"wm-error",error:"wm-cancel"};return a.jsxs(fd,{variant:l||"success",position:d,...c,children:[a.jsxs("div",{className:"wu-grid wu-gap-1",children:[o&&a.jsx(hd,{children:o}),i&&a.jsxs(md,{className:"wu-flex wu-items-center wu-gap-3 wu-pr-6",children:[a.jsx(Ve,{icon:w[l||"success"],className:"wu-text-xl"}),i]})]}),u,a.jsx(pd,{})]},s)})},n))})}const Tv=()=>a.jsx(Cv,{}),gd=S.forwardRef(({className:e,dir:t,...n},r)=>a.jsx(Vr.Root,{className:m("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),...n,ref:r,children:a.jsx(Vr.Thumb,{className:m("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")})}));gd.displayName=Vr.Root.displayName;const bd=p.forwardRef((e,t)=>{const{Label:n,labelPosition:r="right",onChange:s,className:o,dir:i,disabled:u,id:l=Fr(),...d}=e;return p.useEffect(()=>{const{checked:c,defaultChecked:w}=d;c!==void 0&&w!==void 0&&console.error("WuToggle: Both `checked` and `defaultChecked` props are set. Use only one of them.")},[d.checked,d.defaultChecked]),a.jsxs("div",{className:m(Ev({labelPosition:r}),"wu-toggle-container"),dir:i,children:[a.jsx(gd,{...d,id:l,disabled:u,ref:t,onCheckedChange:s,className:m("wu-peer",o),dir:i}),a.jsx(De,{htmlFor:l,className:"wu-toggle-label",children:n})]})});bd.displayName="WuToggle";const Ev=Be.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"}}}),Mr=p.createContext(null),Mv=()=>{const e=p.useContext(Mr);if(!e)throw new Error("useTranslation must be used within a WuTranslationProvider");return e.useTranslation()},Iv=()=>{const e=p.useContext(Mr);if(!e)throw new Error("useLoadTranslationsFunction must be used within a WuTranslationProvider");return e},Dv=({children:e})=>{const[t,n]=p.useState({}),[r,s]=p.useState({}),o=p.useCallback(async(d,c)=>{try{const f=await(await fetch(d)).json();n(f)}catch(w){console.error("Failed to load translations:",w),c&&n(c)}c&&s(c)},[]),i=p.useCallback(d=>{s(d)},[]),u=p.useCallback(()=>({t:(c,w)=>t[c]?t[c]:r[c]?r[c]:w||c}),[t,r]),l={loadTranslations:o,setFallbackTranslations:i,useTranslation:u};return a.jsx(Mr.Provider,{value:l,children:e})},kv={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"}},yd=p.createContext(null),vd=()=>{const e=p.useContext(yd);if(!e)throw new Error("[WuTranslateProvider] Must be used within a provider.");return e},Av=({children:e,defaultLocale:t="en",baseApi:n="https://admin2.questionpro.com/cs/api/gad/translate",keys:r="./wick-ui-i18n.json"})=>{const[s,o]=p.useState(t),[i,u]=p.useState({}),[l,d]=p.useState(!0);p.useEffect(()=>{const w=new AbortController;return(async()=>{d(!0);try{const h=await fetch(r,{signal:w.signal});if(!h.ok)throw new Error("Failed to fetch translation keys");const b=await h.json();if(s!=="en")try{const g=await fetch(`${n}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({keys:b,code:s}),signal:w.signal});if(!g.ok)throw new Error("Failed to fetch dictionary");const v=await g.json();u(v.data)}catch(g){g.name!=="AbortError"&&(console.error("[WuTranslateProvider] Error loading translations:",g),u(b))}else u(b)}catch(h){h.name!=="AbortError"&&(console.error("[WuTranslateProvider] Error loading translations:",h),u({}))}finally{d(!1)}})(),()=>{w.abort()}},[s,n,r]);const c=p.useMemo(()=>({dictionary:i,locale:s,setLocale:o,isLoading:l}),[i,s,l]);return a.jsx(yd.Provider,{value:c,children:e})},xd=p.memo(({__i18nKey:e})=>{const{dictionary:t}=vd();return a.jsx(a.Fragment,{children:t[e]??e})});xd.displayName="WuTranslate",typeof window<"u"&&(window.wickUiVersion="1.37.0",window.wickUiIcon="9.0.0",window.wickUiEditor="0.13.0"),Object.defineProperty(k,"useContext",{enumerable:!0,get:()=>p.useContext}),k.CHART_COLOR_SYSTEM=kv,k.WuAccordion=$d,k.WuActivityLog=Ud,k.WuAppHeader=dw,k.WuAppHeaderAccount=Qa,k.WuAppHeaderBar=ro,k.WuAppHeaderHelp=Ra,k.WuAppHeaderMenu=no,k.WuAppHeaderSearch=lw,k.WuButton=Ie,k.WuCalender=Kr,k.WuCard=Uo,k.WuCardFooter=Go,k.WuCardHeader=jo,k.WuCheckbox=$e,k.WuChip=xf,k.WuCombobox=kf,k.WuCopyToClipboard=Af,k.WuDataTable=ov,k.WuDatePicker=gw,k.WuDateRangePicker=yf,k.WuDisplay=tw,k.WuDrawer=Wf,k.WuDrawerClose=Bf,k.WuDrilldown=Hg,k.WuFooter=fl,k.WuFormGroup=mw,k.WuHeading=Rd,k.WuHelpButton=pl,k.WuIcon=Ve,k.WuInput=Je,k.WuInputError=fw,k.WuInputHint=pw,k.WuLabel=De,k.WuListbox=ml,k.WuLoader=ct,k.WuMenu=pa,k.WuMenuCheckboxItem=_g,k.WuMenuIcon=ha,k.WuMenuItem=wr,k.WuMenuItemGroup=Pg,k.WuMenuRadioItem=Vg,k.WuMenuSeparatorItem=Og,k.WuModal=ab,k.WuModalClose=lb,k.WuModalContent=ob,k.WuModalFooter=ub,k.WuModalHeader=ib,k.WuMonthPicker=pb,k.WuPagination=kl,k.WuPopover=hf,k.WuPopoverClose=ds,k.WuPrimaryNavbar=mb,k.WuRadioGroup=Vl,k.WuScrollArea=bb,k.WuSecondaryNavbar=gb,k.WuSelect=Ml,k.WuSharedSurvey=_c,k.WuSidebar=Kb,k.WuSidebarCollapsibleMenu=Qb,k.WuSidebarContent=Yb,k.WuSidebarFooter=Xb,k.WuSidebarGroup=Zb,k.WuSidebarItem=ac,k.WuSidebarMenu=Jb,k.WuSidebarTrigger=sc,k.WuSpotlight=Nl,k.WuStackedCard=ty,k.WuStackedCardOverlay=ny,k.WuStepper=Hy,k.WuSubMenu=Fg,k.WuSubtext=ew,k.WuSurveyItem=Pc,k.WuSurveyList=Vc,k.WuSurveySelect=Fc,k.WuSurveySource=jy,k.WuSwitcher=Hc,k.WuTab=Jy,k.WuTable=iv,k.WuText=Qd,k.WuTextarea=sd,k.WuTimePicker=ld,k.WuToast=Tv,k.WuToggle=bd,k.WuTooltip=In,k.WuTranslate=xd,k.WuTranslateProvider=Av,k.WuTranslationContext=Mr,k.WuTranslationProvider=Dv,k.WuTruncatedLabel=cw,k.WuVirtualScroll=Dt,k.calculatePosition=ey,k.useTranslation=Mv,k.useTranslationsContext=Iv,k.useWickuiTranslate=vd,k.useWuShowToast=yv,k.useWuSidebar=rt,Object.defineProperty(k,Symbol.toStringTag,{value:"Module"})}));
20
+ `}),i&&a.jsxs("div",{className:m("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(Ba,{values:E,selectedValue:b.padStart(2,"0"),scrollRef:f,onSelect:M=>T(M,v),className:"wu-time-hour-picker"}),a.jsx(Ba,{values:x,selectedValue:v.padStart(2,"0"),scrollRef:h,onSelect:M=>T(b,M),className:"wu-time-minute-picker"}),a.jsx(Ba,{values:D,selectedValue:y,onSelect:M=>T(void 0,void 0,M),className:"wu-time-meridiem-picker",repeatItems:!1})]})]})]})};ld.displayName="WuTimePicker";const pv=1,hv=1e6;let qa=0;function mv(){return qa=(qa+1)%Number.MAX_SAFE_INTEGER,qa.toString()}const $a=new Map,cd=e=>{if($a.has(e))return;const t=setTimeout(()=>{$a.delete(e),Tn({type:"REMOVE_TOAST",toastId:e})},hv);$a.set(e,t)},gv=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,pv)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(n=>n.id===t.toast.id?{...n,...t.toast}:n)};case"DISMISS_TOAST":{const{toastId:n}=t;return n?cd(n):e.toasts.forEach(r=>{cd(r.id)}),{...e,toasts:e.toasts.map(r=>r.id===n||n===void 0?{...r,open:!1}:r)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(n=>n.id!==t.toastId)}}},Tr=[];let Er={toasts:[]};function Tn(e){Er=gv(Er,e),Tr.forEach(t=>{t(Er)})}function dd({...e}){const t=mv(),n=s=>Tn({type:"UPDATE_TOAST",toast:{...s,id:t}}),r=()=>Tn({type:"DISMISS_TOAST",toastId:t});return Tn({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:s=>{s||r()}}}),{id:t,dismiss:r,update:n}}function bv(){const[e,t]=p.useState(Er);return p.useEffect(()=>(Tr.push(t),()=>{const n=Tr.indexOf(t);n>-1&&Tr.splice(n,1)}),[e]),{...e,toast:dd,dismiss:n=>Tn({type:"DISMISS_TOAST",toastId:n})}}const yv=()=>({showToast:({message:t,variant:n,duration:r,position:s})=>dd({description:t,variant:n,duration:r,position:s})}),vv=Me.Provider,xv=Be.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"}}),wd=S.forwardRef(({className:e,position:t,...n},r)=>a.jsx(Me.Viewport,{ref:r,className:m(xv({position:t}),e),...n}));wd.displayName=Me.Viewport.displayName;const Nv=Be.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"}}),fd=S.forwardRef(({className:e,variant:t,position:n,...r},s)=>a.jsx(Me.Root,{ref:s,className:m(Nv({variant:t,position:n}),e),...r}));fd.displayName=Me.Root.displayName;const Sv=S.forwardRef(({className:e,...t},n)=>a.jsx(Me.Action,{ref:n,className:m("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}));Sv.displayName=Me.Action.displayName;const pd=S.forwardRef(({className:e,...t},n)=>a.jsx(Me.Close,{ref:n,className:m("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"})}));pd.displayName=Me.Close.displayName;const hd=S.forwardRef(({className:e,...t},n)=>a.jsx(Me.Title,{ref:n,className:m("wu-text-sm wu-font-semibold",e),...t}));hd.displayName=Me.Title.displayName;const md=S.forwardRef(({className:e,...t},n)=>a.jsx(Me.Description,{ref:n,className:m("wu-text-sm wu-opacity-90",e),...t}));md.displayName=Me.Description.displayName;function Cv(){const{toasts:e}=bv(),t=e.reduce((n,r)=>{const s=r.position||"top";return n[s]||(n[s]=[]),n[s].push(r),n},{});return a.jsx(vv,{children:Object.entries(t).map(([n,r])=>a.jsx(wd,{position:n,children:r.map(function({id:s,title:o,description:i,action:u,variant:l,position:d,...c}){const w={success:"wm-check-circle",info:"wm-info",warning:"wm-error",error:"wm-cancel"};return a.jsxs(fd,{variant:l||"success",position:d,...c,children:[a.jsxs("div",{className:"wu-grid wu-gap-1",children:[o&&a.jsx(hd,{children:o}),i&&a.jsxs(md,{className:"wu-flex wu-items-center wu-gap-3 wu-pr-6",children:[a.jsx(Ve,{icon:w[l||"success"],className:"wu-text-xl"}),i]})]}),u,a.jsx(pd,{})]},s)})},n))})}const Tv=()=>a.jsx(Cv,{}),gd=S.forwardRef(({className:e,dir:t,...n},r)=>a.jsx(Vr.Root,{className:m("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),...n,ref:r,children:a.jsx(Vr.Thumb,{className:m("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")})}));gd.displayName=Vr.Root.displayName;const bd=p.forwardRef((e,t)=>{const{Label:n,labelPosition:r="right",onChange:s,className:o,dir:i,disabled:u,id:l=Fr(),...d}=e;return p.useEffect(()=>{const{checked:c,defaultChecked:w}=d;c!==void 0&&w!==void 0&&console.error("WuToggle: Both `checked` and `defaultChecked` props are set. Use only one of them.")},[d.checked,d.defaultChecked]),a.jsxs("div",{className:m(Ev({labelPosition:r}),"wu-toggle-container"),dir:i,children:[a.jsx(gd,{...d,id:l,disabled:u,ref:t,onCheckedChange:s,className:m("wu-peer",o),dir:i}),a.jsx(De,{htmlFor:l,className:"wu-toggle-label",children:n})]})});bd.displayName="WuToggle";const Ev=Be.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"}}}),Mr=p.createContext(null),Mv=()=>{const e=p.useContext(Mr);if(!e)throw new Error("useTranslation must be used within a WuTranslationProvider");return e.useTranslation()},Iv=()=>{const e=p.useContext(Mr);if(!e)throw new Error("useLoadTranslationsFunction must be used within a WuTranslationProvider");return e},Dv=({children:e})=>{const[t,n]=p.useState({}),[r,s]=p.useState({}),o=p.useCallback(async(d,c)=>{try{const f=await(await fetch(d)).json();n(f)}catch(w){console.error("Failed to load translations:",w),c&&n(c)}c&&s(c)},[]),i=p.useCallback(d=>{s(d)},[]),u=p.useCallback(()=>({t:(c,w)=>t[c]?t[c]:r[c]?r[c]:w||c}),[t,r]),l={loadTranslations:o,setFallbackTranslations:i,useTranslation:u};return a.jsx(Mr.Provider,{value:l,children:e})},kv={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"}},yd=p.createContext(null),vd=()=>{const e=p.useContext(yd);if(!e)throw new Error("[WuTranslateProvider] Must be used within a provider.");return e},Av=({children:e,defaultLocale:t="en",baseApi:n="https://admin2.questionpro.com/cs/api/gad/translate",keys:r="./wick-ui-i18n.json"})=>{const[s,o]=p.useState(t),[i,u]=p.useState({}),[l,d]=p.useState(!0);p.useEffect(()=>{const w=new AbortController;return(async()=>{d(!0);try{const h=await fetch(r,{signal:w.signal});if(!h.ok)throw new Error("Failed to fetch translation keys");const b=await h.json();if(s!=="en")try{const g=await fetch(`${n}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({keys:b,code:s}),signal:w.signal});if(!g.ok)throw new Error("Failed to fetch dictionary");const v=await g.json();u(v.data)}catch(g){g.name!=="AbortError"&&(console.error("[WuTranslateProvider] Error loading translations:",g),u(b))}else u(b)}catch(h){h.name!=="AbortError"&&(console.error("[WuTranslateProvider] Error loading translations:",h),u({}))}finally{d(!1)}})(),()=>{w.abort()}},[s,n,r]);const c=p.useMemo(()=>({dictionary:i,locale:s,setLocale:o,isLoading:l}),[i,s,l]);return a.jsx(yd.Provider,{value:c,children:e})},xd=p.memo(({__i18nKey:e})=>{const{dictionary:t}=vd();return a.jsx(a.Fragment,{children:t[e]??e})});xd.displayName="WuTranslate",typeof window<"u"&&(window.wickUiVersion="1.37.2",window.wickUiIcon="9.0.0",window.wickUiEditor="0.14.0"),Object.defineProperty(k,"useContext",{enumerable:!0,get:()=>p.useContext}),k.CHART_COLOR_SYSTEM=kv,k.WuAccordion=$d,k.WuActivityLog=Ud,k.WuAppHeader=dw,k.WuAppHeaderAccount=Qa,k.WuAppHeaderBar=ro,k.WuAppHeaderHelp=Ra,k.WuAppHeaderMenu=no,k.WuAppHeaderSearch=lw,k.WuButton=Ie,k.WuCalender=Kr,k.WuCard=Uo,k.WuCardFooter=Go,k.WuCardHeader=jo,k.WuCheckbox=$e,k.WuChip=xf,k.WuCombobox=kf,k.WuCopyToClipboard=Af,k.WuDataTable=ov,k.WuDatePicker=gw,k.WuDateRangePicker=yf,k.WuDisplay=tw,k.WuDrawer=Wf,k.WuDrawerClose=Bf,k.WuDrilldown=Hg,k.WuFooter=fl,k.WuFormGroup=mw,k.WuHeading=Rd,k.WuHelpButton=pl,k.WuIcon=Ve,k.WuInput=Je,k.WuInputError=fw,k.WuInputHint=pw,k.WuLabel=De,k.WuListbox=ml,k.WuLoader=ct,k.WuMenu=pa,k.WuMenuCheckboxItem=_g,k.WuMenuIcon=ha,k.WuMenuItem=wr,k.WuMenuItemGroup=Pg,k.WuMenuRadioItem=Vg,k.WuMenuSeparatorItem=Og,k.WuModal=ab,k.WuModalClose=lb,k.WuModalContent=ob,k.WuModalFooter=ub,k.WuModalHeader=ib,k.WuMonthPicker=pb,k.WuPagination=kl,k.WuPopover=hf,k.WuPopoverClose=ds,k.WuPrimaryNavbar=mb,k.WuRadioGroup=Vl,k.WuScrollArea=bb,k.WuSecondaryNavbar=gb,k.WuSelect=Ml,k.WuSharedSurvey=_c,k.WuSidebar=Kb,k.WuSidebarCollapsibleMenu=Qb,k.WuSidebarContent=Yb,k.WuSidebarFooter=Xb,k.WuSidebarGroup=Zb,k.WuSidebarItem=ac,k.WuSidebarMenu=Jb,k.WuSidebarTrigger=sc,k.WuSpotlight=Nl,k.WuStackedCard=ty,k.WuStackedCardOverlay=ny,k.WuStepper=Hy,k.WuSubMenu=Fg,k.WuSubtext=ew,k.WuSurveyItem=Pc,k.WuSurveyList=Vc,k.WuSurveySelect=Fc,k.WuSurveySource=jy,k.WuSwitcher=Hc,k.WuTab=Jy,k.WuTable=iv,k.WuText=Qd,k.WuTextarea=sd,k.WuTimePicker=ld,k.WuToast=Tv,k.WuToggle=bd,k.WuTooltip=In,k.WuTranslate=xd,k.WuTranslateProvider=Av,k.WuTranslationContext=Mr,k.WuTranslationProvider=Dv,k.WuTruncatedLabel=cw,k.WuVirtualScroll=Dt,k.calculatePosition=ey,k.useTranslation=Mv,k.useTranslationsContext=Iv,k.useWickuiTranslate=vd,k.useWuShowToast=yv,k.useWuSidebar=rt,Object.defineProperty(k,Symbol.toStringTag,{value:"Module"})}));
21
21
  //# sourceMappingURL=index.js.map