@npm-questionpro/wick-ui-lib 1.37.2 → 1.38.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/components/table/hooks/useTableCore.d.ts +10 -1
- package/dist/src/components/table/hooks/useTableScroll.d.ts +6 -0
- package/dist/src/components/table/types/IWuTableColumnDef.d.ts +1 -0
- package/dist/src/components/table/ui/_body.d.ts +3 -1
- package/dist/src/components/table/ui/_header.d.ts +3 -1
- package/dist/src/components/table/ui/_virtualBody.d.ts +3 -1
- package/dist/src/components/table/utils/tableHelpers.d.ts +9 -1
- package/dist/src/components/table/utils/tableStyles.d.ts +2 -2
- package/dist/style.css +1 -1
- package/dist/wick-ui-lib/es/index.js +3997 -3811
- package/dist/wick-ui-lib/umd/index.js +9 -9
- package/package.json +1 -1
|
@@ -1,10 +1,10 @@
|
|
|
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
|
-
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(
|
|
1
|
+
(function(D,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):(D=typeof globalThis<"u"?globalThis:D||self,a(D["wick-ui-lib"]={},D["react/jsx-runtime"],D.RadixUIAvatar,D.React,D.clsx,D.tailwindMerge,D.RadixUIAccordion,D.RadixUISlot,D.ClassVarianceAuthority,D.ReactDayPicker,D.RadixUICheckbox,D.RadixUILabel,D.cmdk,D.RadixUIPopover,D.RadixUITooltip,D.ReactVirtuoso,D.RadixUIDropdownMenu,D.TanstackReactTable,D.dateFns,D.RadixUIDialog,D.RadixUIScrollArea,D.RadixUIRadioGroup,D.RadixUISeparator,D.ReactDOM,D.RadixUIToggleGroup,D.RadixUIToggle,D.RadixUITabs,D.RadixUIToast,D.RadixUISwitch))})(this,(function(D,a,St,f,Ed,Md,Id,Ct,We,Ga,kd,Dd,xe,jt,Pr,Ka,Ad,_e,$,Ya,_d,Pd,Vd,Od,Fd,Ld,Wd,Bd,qd){"use strict";var Wv=Object.defineProperty;var Bv=(D,a,St)=>a in D?Wv(D,a,{enumerable:!0,configurable:!0,writable:!0,value:St}):D[a]=St;var Ce=(D,a,St)=>Bv(D,typeof a!="symbol"?a+"":a,St);var Td;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(f),it=pe(Id),Vr=pe(kd),Xa=pe(Dd),Gt=pe(jt),Kt=pe(Pr),re=pe(Ad),te=pe(Ya),ut=pe(_d),Yt=pe(Pd),Za=pe(Vd),$d=pe(Od),En=pe(Fd),Ja=pe(Ld),lt=pe(Wd),Te=pe(Bd),Or=pe(qd),Hd=Md.extendTailwindMerge({prefix:"wu-"});function m(...e){return Hd(Ed.clsx(e))}const Fr=e=>{window==null||window.open(e,"_blank","toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=800,height=600")};function Lr(){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 zd=e=>e?/\S+@questionpro\.com/.test(e):!1,Qa=it.Root,Wr=S.forwardRef(({className:e,...t},n)=>a.jsx(it.Item,{ref:n,className:m("wu-border-b",e),...t}));Wr.displayName="AccordionItem";const Br=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"})]})}));Br.displayName=it.Trigger.displayName;const qr=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})}));qr.displayName=it.Content.displayName;const Ud=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(Qa,{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(Wr,{value:u,dir:r,className:m(n,c),children:[a.jsx(Br,{dir:r,className:"wu-accordion-summary",children:l}),a.jsx(qr,{dir:r,className:"wu-accordion-details",children:d})]},u))})}else{const{defaultValue:s,value:o,onValueChange:i}=e;return a.jsx(Qa,{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(Wr,{value:u,dir:r,className:m(n,c),children:[a.jsx(Br,{dir:r,className:"wu-accordion-summary",children:l}),a.jsx(qr,{dir:r,className:"wu-accordion-details",children:d})]},u))})}},$r=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}));$r.displayName=Tt.Root.displayName;const Hr=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}));Hr.displayName=Tt.Image.displayName;const zr=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}));zr.displayName=Tt.Fallback.displayName;const we={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],jd=({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:we.logItem,"data-slot":"log-item",children:[a.jsx("div",{className:we.timelineDotSmall,"data-slot":"timeline-dot-small"}),a.jsxs("div",{className:we.content,"data-slot":"content",children:[a.jsx("div",{className:we.time,"data-slot":"time",children:n}),(i==null?void 0:i.length)>0&&a.jsx("div",{className:we.tags,"data-slot":"tags",children:i.map((l,d)=>a.jsx("span",{className:m(we.tag,d===0?we.tagPrimary:we.tagSecondary),"data-slot":"tag",children:l},l))}),a.jsxs("div",{className:we.userActionRow,"data-slot":"user-action-row",children:[a.jsxs($r,{className:we.avatar,"data-slot":"avatar",children:[a.jsx(Hr,{src:o,alt:r,"data-slot":"log-user-avatar-image"}),a.jsx(zr,{className:"wu-text-[10px] wu-bg-slate-400 wu-text-white","data-slot":"log-user-avatar-fallback",children:s})]}),a.jsxs("p",{className:we.actionText,"data-slot":"action-text",children:[a.jsx("span",{className:we.userName,"data-slot":"log-username",children:r})," ",u]})]})]})]})},Gd=f.memo(jd),Kd=({logs:e,accessorKey:t,className:n,...r})=>{const s=f.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(we.timelineContainer,n),"data-slot":"timeline-container",...r,children:[a.jsx("div",{className:we.mainVerticalLine,"data-slot":"main-vertical-line"}),Object.entries(s).map(([o,i])=>a.jsxs("div",{className:we.dateGroup,"data-slot":"date-group",children:[a.jsxs("div",{className:we.dateHeader,"data-slot":"date-header",children:[a.jsx("div",{className:we.dateDot,"data-slot":"date-dot"}),a.jsx("span",{className:we.dateText,"data-slot":"date-text",children:o})]}),a.jsx("div",{className:we.logList,"data-slot":"log-list",children:i.map(u=>{const l=Xe(u,t.id);return a.jsx(Gd,{log:u,accessorKey:t},l)})})]},o))]})};function Ur(e,t){f.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 jr={dropdownContainer:"_dropdownContainer_vvlo9_1",open:"_open_vvlo9_1",dropdownMenu:"_dropdownMenu_vvlo9_1"},Ra=({dir:e,Trigger:t,triggerClassName:n,DropdownContent:r,isAllowActiveStyle:s})=>{const[o,i]=f.useState(!1),u=f.useRef(null),l=f.useRef(null);Ur([u,l],()=>i(!1));const d=()=>{i(!o)};return a.jsx(a.Fragment,{children:a.jsx("div",{className:jr.dropdownContainer,children:a.jsx("ul",{children:a.jsxs("li",{className:m("wu-flex wu-relative",o&&jr.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(jr.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})]})})})})},Gr=We.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(Gr({size:n,color:r,variant:t,className:e})),ref:i,...o})});Et.displayName="Button";const ct=f.forwardRef((e,t)=>Yd(e,t)),Yd=(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 Ee=f.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},p)=>{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:p,children:[!t&&s&&a.jsx(a.Fragment,{children:s}),t&&a.jsx(ct,{color:"#fff",size:"sm"}),!t&&i]})});Ee.displayName="WuButton";const Xd=({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(Ee,{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"})]}),Zd=({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"})]})},Jd=({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"})]}),Qd=({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})]})]})]})]})},eo=({user:e,onLogout:t,dir:n,DataCenter:r})=>{var s,o;return e?a.jsx(Ra,{Trigger:a.jsxs($r,{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(Hr,{className:"hover:wu-opacity-80",src:(s=e==null?void 0:e.profile)==null?void 0:s.profilePicture,alt:"User"}),a.jsx(zr,{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(Qd,{user:e,dir:n}),(e==null?void 0:e.settings)&&e.settings.length>0&&a.jsx(Jd,{settings:e.settings,dir:n}),a.jsx(Zd,{user:e,dir:n}),a.jsx(Xd,{onLogout:t,DataCenter:r})]})}):null},to=({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(Ra,{dir:t,Trigger:a.jsx("span",{className:"wm-question-mark wu-text-xl"}),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:()=>Fr(r.link),onKeyDown:o=>{o.key==="Enter"&&Fr(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
|
+
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(no,{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
|
-
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(`
|
|
5
|
-
`));return S.cloneElement(o,s)}if(e&&typeof e=="string")return
|
|
6
|
-
`))},[r,n,e]);const{current:d}=S.useRef(t);S.useEffect(()=>{!s&&
|
|
7
|
-
`))},[t])}const l=S.useCallback(d=>{s||i(d)},[]);return[u,l]}function Oo(e){let t=0;const n=new WeakMap;try{return JSON.stringify(e,function(o,i){if(!(o==="_owner"&&this!=null&&typeof this=="object"&&"$$typeof"in this)){if(typeof i=="bigint")return`__bigint__:${i}`;if(i!==null&&typeof i=="object"){const u=n.get(i);if(u!==void 0)return`__object__:${u}`;n.set(i,t),t+=1}return i}})??`__top__:${typeof e}`}catch{return"__unserializable__"}}function Fo(e,t){const{enabled:n=!0,getValue:r,id:s,value:o}=t,{registerFieldControl:i}=An(),u=S.useRef(null);u.current||(u.current=Symbol()),ae(()=>{const l=u.current;if(!(!l||!n))return i(l,{controlRef:e,getValue:r,id:s,value:o}),()=>{i(l,void 0)}},[e,n,r,s,i,o])}function Lo(e={}){const{id:t,implicit:n=!1,controlRef:r}=e,{controlId:s,registerControlId:o}=ns(),i=No(t),u=n?s:void 0,l=Ze(()=>Symbol("labelable-control")),d=S.useRef(!1),c=S.useRef(t!=null),w=he(()=>{!d.current||o===ke||(d.current=!1,o(l.current,void 0))});return ae(()=>{if(o===ke)return;let f;if(n){const h=r==null?void 0:r.current;Yw(h)&&h.closest("label")!=null?f=t??null:f=u??i}else if(t!=null)c.current=!0,f=t;else if(c.current)f=i;else{w();return}if(f===void 0){w();return}d.current=!0,o(l.current,f)},[t,r,u,o,n,i,l,w]),S.useEffect(()=>w,[w]),s??i}const Rt="none",cf="trigger-press",df="increment-press",wf="decrement-press",ls="input-change",en="input-clear",Hn="input-blur",cs="input-paste",tn="keyboard";function Ae(e,t,n,r){let s=!1,o=!1;const i=r??Ke;return{reason:e,event:t??new Event("base-ui"),cancel(){s=!0},allowPropagation(){o=!0},get isCanceled(){return s},get isPropagationAllowed(){return o},trigger:n,...i}}function nn(e,t,n){const r=Ke;return{reason:e,event:t??new Event("base-ui"),...r}}const Wo=S.forwardRef(function(t,n){const{render:r,className:s,id:o,name:i,value:u,disabled:l=!1,onValueChange:d,defaultValue:c,autoFocus:w=!1,style:f,...h}=t,{state:b,name:g,disabled:v,setTouched:N,setDirty:y,validityData:C,setFocused:E,setFilled:x,validationMode:D,validation:T}=An(),M=v||l,I=g??i,_={...b,disabled:M},{labelId:P}=ns(),A=Lo({id:o});ae(()=>{var Z;const q=u!=null;(Z=T.inputRef.current)!=null&&Z.value||q&&u!==""?x(!0):q&&u===""&&x(!1)},[T.inputRef,x,u]);const O=S.useRef(null);ae(()=>{w&&O.current===ko(Do(O.current))&&E(!0)},[w,E]);const[F]=us({controlled:u,default:c,name:"FieldControl",state:"value"}),V=u!==void 0,L=V?F:void 0,U=he(()=>{var q;return(q=T.inputRef.current)==null?void 0:q.value});return Fo(T.inputRef,{id:A,value:L,getValue:U}),Ye("input",t,{ref:[n,O],state:_,props:[{id:A,disabled:M,name:I,ref:T.inputRef,"aria-labelledby":P,autoFocus:w,...V?{value:L}:{defaultValue:c},onChange(q){const Z=q.currentTarget.value;d==null||d(Z,Ae(Rt,q.nativeEvent)),y(Z!==C.initialValue),x(Z!=="")},onFocus(){E(!0)},onBlur(q){N(!0),E(!1),D==="onBlur"&&T.commit(q.currentTarget.value)},onKeyDown(q){q.currentTarget.tagName==="INPUT"&&q.key==="Enter"&&(N(!0),T.commit(q.currentTarget.value))}},T.getInputValidationProps(),h],stateAttributesMapping:Jr})});process.env.NODE_ENV!=="production"&&(Wo.displayName="FieldControl");const Bo=S.forwardRef(function(t,n){return a.jsx(Wo,{ref:n,...t})});process.env.NODE_ENV!=="production"&&(Bo.displayName="Input");const zn={wuInputGroup:"_wuInputGroup_1t4ep_1",wuInputIcon:"_wuInputIcon_1t4ep_20",wuInput:"_wuInput_1t4ep_1",passwordToggle:"_passwordToggle_1t4ep_89"},qo=p.memo(({showPassword:e,onToggle:t,disabled:n,readOnly:r})=>{const s=p.useCallback(i=>{if(n||r){i.preventDefault(),i.stopPropagation();return}t()},[n,r,t]),o=n||r;return a.jsx("button",{type:"button","data-slot":"wu-input-password-toggle",className:zn.passwordToggle,onClick:s,disabled:o,"aria-disabled":o||void 0,"aria-label":e?"Hide password":"Show password",children:a.jsx(Ve,{icon:e?"wm-visibility":"wm-visibility-off"})})});qo.displayName="PasswordToggle";const Je=p.memo(p.forwardRef(({className:e,Label:t,labelPosition:n="top",Icon:r,iconPosition:s="left",variant:o="flat",type:i,readonly:u,invalid:l,id:d,...c},w)=>{const f=p.useId(),h=d||f;if(i==="submit")return a.jsx(Ie,{className:e,id:h,"aria-label":c["aria-label"],type:"submit","data-slot":"wu-input-submit",disabled:c.disabled,children:t||"Submit"});const[b,g]=p.useState(!1),v=p.useCallback(()=>{g(x=>!x)},[]),{finalIcon:N,finalIconPosition:y}=p.useMemo(()=>i==="password"?{finalIcon:a.jsx(qo,{showPassword:b,onToggle:v,readOnly:u,disabled:c.disabled}),finalIconPosition:"right"}:{finalIcon:r,finalIconPosition:s},[i,r,s,b,v]),C=p.useMemo(()=>i==="password"&&b?"text":i,[i,b]),E=p.useMemo(()=>m(zn.wuInput,"wu-peer",e),[e]);return a.jsxs("div",{"data-slot":"wu-input-group",role:"group",className:zn.wuInputGroup,"data-label-position":n,"data-icon-position":N&&y,children:[N&&a.jsx("span",{className:zn.wuInputIcon,children:N}),a.jsx(Bo,{ref:w,className:E,"data-variant":o,type:C,readOnly:u,"aria-invalid":l,id:h,...c}),t&&a.jsx(De,{htmlFor:h,children:t})]})}));Je.displayName="WuInput";const Mt="MM-dd-yyyy",ff=[{label:"Day",value:1},{label:"Week",value:7},{label:"Month",value:30},{label:"Quarter",value:90},{label:"Year",value:365}],pf=({current:e,onSelect:t,presetRanges:n=ww})=>{const[r,s]=p.useState(),[o,i]=p.useState(!1),[u,l]=p.useState(""),[d,c]=p.useState(""),[w,f]=p.useState(!1),h=p.useMemo(()=>n.map(y=>y.value),[n]),b=m("wu-flex wu-w-full wu-gap-2 wu-px-4 wu-py-2 wu-text-sm wu-text-gray-lead wu-transition-colors","wu-rounded-none hover:wu-bg-gray-10 focus:wu-outline-none focus-visible:wu-ring-2","focus-visible:wu-ring-blue-pHover focus-visible:wu-ring-offset-1 wu-text-start"),g=p.useCallback(y=>{if(y===void 0){s(void 0),i(!0);return}const C=Number(y)-1;s(C),i(!1),t({from:$.sub(new Date,{days:C}),to:new Date})},[t]),v=p.useCallback((y,C)=>{if(!y||!(e!=null&&e.to)||!(e!=null&&e.from)||!new RegExp(Xr).test(y))return!1;const x=C==="start"?$.parse(y,Mt,new Date):new Date(e.from),D=C==="end"?$.parse(y,Mt,new Date):new Date(e.to);return $.isBefore(D,x)?(f(!0),!1):(f(!1),!($.isSameDay(x,e.from)&&$.isSameDay(D,e.to)))},[e]),N=p.useCallback((y,C)=>{if((C==="start"?l:c)(y),v(y,C)){const x={from:e==null?void 0:e.from,to:e==null?void 0:e.to};C==="start"&&(x.from=$.parse(y,Mt,new Date)),C==="end"&&(x.to=$.parse(y,Mt,new Date)),t(x)}},[e,t,v]);return p.useEffect(()=>{if(e!=null&&e.to&&(e!=null&&e.from)&&$.isValid(e.to)&&$.isValid(e.from)){l($.format(e.from,Mt)),c($.format(e.to,Mt));const y=$.differenceInCalendarDays(e.to,e.from);$.isToday(e.to)&&h.includes(y+1)?(s(y),i(!1)):(s(void 0),i(!0))}},[e,h]),a.jsxs("div",{className:"wu-flex wu-flex-col wu-gap-1 wu-p-2 wu-bg-white wu-w-60 wu-date-picker-sidebar",children:[a.jsx("ul",{className:"wu-flex wu-gap-1 wu-py-2 wu-date-picker-batch-list wu-hidden",children:ff.map(({label:y,value:C})=>a.jsx(Et,{variant:"secondary",className:"wu-px-1 wu-py-1 wu-text-xs wu-h-fit wu-min-w-fit disabled:wu-bg-white",disabled:C!==1,children:y},C))}),a.jsxs("ul",{className:"wu-flex wu-flex-col wu-gap-1 wu-date-picker-ranges",children:[n.map(({label:y,value:C})=>a.jsx("li",{children:a.jsx("button",{className:m(b,r===C-1&&"wu-bg-blue-p/10"),onClick:()=>g(C),children:y})},C)),a.jsx("li",{children:a.jsx("button",{className:m(b,o&&"wu-bg-blue-p/10"),onClick:()=>g(),children:"Custom Range"})})]}),a.jsxs("div",{className:"wu-relative wu-flex wu-gap-3 wu-pt-2 wu-date-picker-range-footer",children:[a.jsx(Je,{placeholder:"Start Date",pattern:Xr,value:u,onChange:y=>N(y.target.value,"start"),"aria-label":"Start Date"}),a.jsx(Je,{placeholder:"End Date",pattern:Xr,value:d,onChange:y=>N(y.target.value,"end"),"aria-label":"End Date"}),w?a.jsx("small",{className:"wu-absolute wu-text-[10px] wu-leading-[14px] wu-text-red-deep wu-left-0 -wu-bottom-5 wu-text-start",children:"End date must be after start date"}):a.jsx("small",{className:"wu-absolute wu-right-0 wu-leading-[14px] -wu-bottom-4 wu-text-gray-subtle wu-text-end",children:"mm-dd-yyyy"})]})]})},hf=({Trigger:e,children:t,className:n,dir:r,open:s,onOpenChange:o,modal:i,...u})=>a.jsxs(Ue,{open:s,onOpenChange:o,modal:i,children:[a.jsx(dt,{asChild:!0,dir:r,children:e}),a.jsx(qe,{className:m("wu-w-80 wu-p-0 wu-border-blue-p wu-bg-white wu-dark:border-gray-switcher",n),dir:r,...u,children:t})]}),ds=e=>a.jsx(jt.PopoverClose,{asChild:!0,children:a.jsx(Ie,{...e})}),It={wuDateRangeNativeSidebar:"_wuDateRangeNativeSidebar_1oiuh_1",customInputs:"_customInputs_1oiuh_26",inputsRow:"_inputsRow_1oiuh_42",errorWrapper:"_errorWrapper_1oiuh_63",errorText:"_errorText_1oiuh_67"},mf=[{label:"Last week",value:7},{label:"Last month",value:30},{label:"Last quarter",value:90},{label:"Last year",value:365}],Se=e=>{if(!e)return"";try{const t=new Date(e);if(!$.isValid(t))return"";const n=t.getFullYear(),r=String(t.getMonth()+1).padStart(2,"0"),s=String(t.getDate()).padStart(2,"0");return`${n}-${r}-${s}`}catch{return""}},$o=e=>{if(!e)return null;try{const t=$.parseISO(e);return $.isValid(t)?$.startOfDay(t):null}catch{return null}},gf=(e,t,n)=>!(t&&e<$.startOfDay(t)||n&&e>$.startOfDay(n)),Ho=e=>$.sub(new Date,{days:e}),zo=e=>e?$.sub(new Date,{days:1}):new Date;function bf({ranges:e=mf,excludeToday:t=!0,current:n,onSelect:r,onReset:s,onApply:o,showResetButton:i=!0,maxDate:u,minDate:l,...d}){const[c,w]=p.useState(Se(n==null?void 0:n.from)||Se(l)),[f,h]=p.useState(Se(n==null?void 0:n.to)||Se(u)),[b,g]=p.useState(!1),[v,N]=p.useState(""),[y,C]=p.useState("");p.useEffect(()=>{w(Se(n==null?void 0:n.from)||Se(l)),h(Se(n==null?void 0:n.to)||Se(u)),N(""),C("")},[n==null?void 0:n.from,n==null?void 0:n.to,l,u]);const E=p.useMemo(()=>{if(!(n!=null&&n.from)||!(n!=null&&n.to))return null;const I=$.differenceInCalendarDays(n.to,n.from)+1;return e.find(_=>_.value===I)??null},[n==null?void 0:n.from,n==null?void 0:n.to,e]),x=p.useCallback(I=>{const _=Ho(I),P=zo(t);w(Se(_)),h(Se(P)),N(""),C(""),g(!1),r==null||r({from:_,to:P})},[t,r]),D=p.useCallback((I,_)=>{const P=$o(I);if(_==="start"?(w(I),N("")):(h(I),C("")),!P){if(I){const F="Please enter a valid date";_==="start"?N(F):C(F)}return}if(!gf(P,l,u)){const F=l&&P<$.startOfDay(l)?`Date must be on or after ${$.format(l,"MMM d, yyyy")}`:`Date must be on or before ${$.format(u,"MMM d, yyyy")}`;_==="start"?N(F):C(F);return}const O=$o(_==="start"?f:c);_==="start"&&O?P<=O?r==null||r({from:P,to:O}):N("Start date must be before or equal to end date"):_==="end"&&O&&(P>=O?r==null||r({from:O,to:P}):C("End date must be after or equal to start date"))},[c,f,r,l,u]),T=p.useMemo(()=>e.map(I=>{const _=Ho(I.value),P=zo(t);return{...I,displayStartDate:$.format(_,"MMM d, yyyy"),displayEndDate:$.format(P,"MMM d, yyyy")}}),[e,t]),M=b||(n==null?void 0:n.from)&&(n==null?void 0:n.to)&&!E;return a.jsxs("div",{className:It.wuDateRangeNativeSidebar,...d,children:[a.jsxs("ul",{children:[a.jsx("li",{children:a.jsx("button",{onClick:()=>g(!0),"data-selected":M,"aria-pressed":M,"aria-label":"Select custom date range",children:"Custom Range"})}),a.jsxs("li",{className:It.customInputs,"data-expanded":M,children:[a.jsxs("div",{className:It.inputsRow,children:[a.jsx(Je,{type:"date",value:c,onChange:I=>D(I.target.value,"start"),Label:"Start",min:Se(l),max:Se(u),"aria-describedby":v?"start-date-error":void 0}),a.jsx(Je,{type:"date",value:f,onChange:I=>D(I.target.value,"end"),Label:"End",min:c||Se(l),max:Se(u),"aria-describedby":y?"end-date-error":void 0})]}),(v||y)&&a.jsxs("div",{className:It.errorWrapper,role:"alert","aria-live":"polite",children:[v&&a.jsx("p",{id:"start-date-error",className:It.errorText,children:v}),y&&a.jsx("p",{id:"end-date-error",className:It.errorText,children:y})]})]}),T.map(I=>a.jsx("li",{children:a.jsxs("button",{onClick:()=>x(I.value),"data-selected":!M&&(E==null?void 0:E.value)===I.value,"aria-pressed":!M&&(E==null?void 0:E.value)===I.value,"aria-label":`Select ${I.label}`,children:[I.label," ",a.jsxs("small",{children:["(",I.displayStartDate," - ",I.displayEndDate,")"]})]})},I.value))]}),a.jsxs("footer",{children:[i&&a.jsx(ds,{variant:"secondary",Icon:a.jsx(Ve,{icon:"wm-refresh"}),onClick:s,children:"Reset"}),a.jsx(ds,{onClick:o,disabled:!!(v||y),children:"Apply"})]})]})}const yf=({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",minDateToSelect:u,maxDateToSelect:l,presetRanges:d,Label:c,labelPosition:w="top",onReset:f,showResetButton:h=!0,placeholder:b="Select Date Range",CustomTrigger:g,native:v,align:N="start",alignOffset:y,side:C,sideOffset:E=-.5,...x})=>{const[D,T]=p.useState(t),[M,I]=p.useState(t),[_,P]=p.useState(""),A=p.useCallback(()=>{if(M){const V=M.from,L=M.to;T({from:V,to:L}),P(`${$.format(V,e)} - ${$.format(L,e)}`),n&&n({from:V,to:L})}},[M,e,n]),O=p.useCallback(()=>{I(D)},[D]),F=p.useCallback(()=>{f?f():(T(void 0),I(void 0),P(""),n&&n(void 0))},[f,n]);return p.useEffect(()=>{if(t!=null&&t.from&&(t!=null&&t.to)){const V=Dn(t.from),L=Dn(t.to);T(t),I(t),P(`${$.format(V,e)} - ${$.format(L,e)}`)}else T(void 0),I({to:new Date,from:new Date})},[t,e]),a.jsxs(De,{className:m("wu-flex wu-gap-1",w==="left"?"wu-items-center":"wu-flex-col wu-items-start","wu-date-picker-label"),dir:i,children:[c,a.jsxs(Ue,{onOpenChange:V=>!V&&O(),children:[a.jsx(Yr,{formattedString:_,dir:i,placeholder:b,CustomTrigger:g,...x}),a.jsx(qe,{className:"wu-flex wu-p-0 wu-border wu-w-fit wu-border-blue-p wu-bg-white",align:N,sideOffset:E,side:C,alignOffset:y,dir:i,children:v?a.jsx(bf,{current:M,onSelect:V=>{I(V)},ranges:d,onApply:A,onReset:F,showResetButton:h,minDate:s,maxDate:o}):a.jsxs(a.Fragment,{children:[a.jsx(pf,{current:M,onSelect:I,presetRanges:d}),a.jsx(Kr,{dir:i,numberOfMonths:2,mode:"range",captionLayout:"dropdown",selected:M,onSelect:I,disabled:V=>lo(V,r,s,o),startMonth:s,endMonth:o,required:!0,autoFocus:!0,defaultMonth:D==null?void 0:D.from,className:m("wu-shadow-none wu-date-range-picker"),min:u,max:l,footer:a.jsx(uo,{handleDateChange:A,disabled:r,onReset:F,showResetButton:h})})]})})]})]})},Uo=p.forwardRef((e,t)=>{const{className:n,rounded:r,...s}=e;return a.jsx("div",{className:m("wu-card wu-p-2 wu-pt-1 hover:wu-shadow-card wu-border wu-border-black/20 hover:wu-border-black/30 wu-transition-colors wu-duration-300",r?"wu-rounded-lg":"wu-rounded-sm",n),ref:t,...s})});Uo.displayName="WuCard";const jo=p.forwardRef((e,t)=>{const{className:n,...r}=e;return a.jsx("div",{ref:t,...r,className:m("wu-p-2 wu-mb-2 wu-border-b wu-border-gray-40 min-h-12 wu-card-header",n)})});jo.displayName="WuCardHeader";const Go=p.forwardRef((e,t)=>{const{className:n,...r}=e;return a.jsx("div",{ref:t,...r,className:m("wu-p-2 wu-mt-2 wu-border-t wu-border-gray-40 min-h-12 wu-card-footer",n)})});Go.displayName="WuCardHeader";const Ko=S.forwardRef(({className:e,partial:t,...n},r)=>a.jsx(Pr.Root,{ref:r,className:m("wu-h-4 wu-w-4 wu-shrink-0 wu-rounded-[2px] wu-bg-white wu-border wu-border-gray-subtle wu-ring-offset-background focus-visible:wu-outline-none focus-visible:wu-ring-2 focus-visible:wu-ring-ring focus-visible:wu-ring-offset-[1px] data-[state=checked]:wu-bg-blue-p data-[state=checked]:wu-text-white data-[state=checked]:wu-border-none data-[state=checked]:hover:wu-bg-blue-q hover:wu-bg-gray-20 hover:wu-border-blue-p wu-transition-all data-[state=checked]:disabled:wu-bg-gray-20","disabled:wu-cursor-not-allowed disabled:wu-opacity-50 disabled:data-[state=unchecked]:wu-bg-gray-20 disabled:hover:wu-border-gray-subtle disabled:wu-border-gray-subtle",e),...n,children:a.jsxs(Pr.Indicator,{className:m("wu-flex wu-items-center wu-justify-center wu-text-current"),children:[!t&&a.jsx("span",{className:"wm-check wu-text-base wu-leading-4"}),t&&a.jsx("span",{className:"wm-check-indeterminate-small wu-text-base wu-leading-4"})]})}));Ko.displayName=Pr.Root.displayName;const $e=p.forwardRef((e,t)=>{const{disabled:n,checked:r,Label:s,labelPosition:o="right",className:i,id:u=Fr(),partial:l,onChange:d,required:c,readonly:w,...f}=e;return p.useEffect(()=>{f.defaultChecked!==void 0&&r!==void 0&&console.error("WuCheckbox: Both `checked` and `defaultChecked` cannot be used together. Use only one of them.")},[f.defaultChecked,r]),a.jsxs("div",{className:vf({labelPosition:o,className:"wu-checkbox-container"}),dir:f.dir,children:[a.jsx(Ko,{id:u,...f,partial:l,checked:r,disabled:n||w,onCheckedChange:d,className:m("wu-peer wu-checkbox",i),required:c,ref:t}),s&&a.jsx(De,{htmlFor:u,className:"wu-w-full wu-checkbox-label",children:s})]})}),vf=Be.cva("wu-flex wu-items-center wu-gap-2 wu-w-fit",{variants:{labelPosition:{left:"wu-flex-row-reverse wu-text-right",right:"wu-flex-row"}}});$e.displayName="WuCheckbox";const xf=e=>{const{className:t,children:n,...r}=e;return a.jsx("span",{...r,className:m("wu-flex wu-items-center wu-justify-center wu-truncate wu-max-w-28 wu-w-fit wu-px-2 wu-py-1 wu-text-xs wu-bg-gray-20 wu-rounded-sm hover:wu-bg-gray-40 hover:wu-text-blue-q",t),children:n})},ws=S.forwardRef(({className:e,...t},n)=>a.jsx(Ne.Command,{ref:n,className:m("wu-flex wu-h-full wu-w-full wu-flex-col wu-overflow-hidden wu-rounded-md",e),...t}));ws.displayName=Ne.Command.displayName;const Yo=S.forwardRef(({className:e,...t},n)=>a.jsx("div",{className:"wu-flex wu-items-center wu-border-b wu-px-3",children:a.jsx(Ne.Command.Input,{ref:n,className:m("wu-flex wu-h-11 wu-w-full wu-rounded-md wu-bg-transparent wu-py-3 wu-text-sm wu-outline-none wu-placeholder:wu-text-muted-foreground disabled:wu-cursor-not-allowed disabled:wu-opacity-50",e),...t})}));Yo.displayName=Ne.Command.Input.displayName;const fs=S.forwardRef(({className:e,...t},n)=>a.jsx(Ne.Command.List,{ref:n,className:m("",e),...t}));fs.displayName=Ne.Command.List.displayName;const ps=S.forwardRef((e,t)=>a.jsx(Ne.Command.Empty,{ref:t,className:"wu-text-center wu-p-2 wu-pb-2.5 wu-text-xs",...e}));ps.displayName=Ne.Command.Empty.displayName;const rn=S.forwardRef(({className:e,...t},n)=>a.jsx(Ne.Command.Group,{ref:n,className:m("",e),...t}));rn.displayName=Ne.Command.Group.displayName;const hs=S.forwardRef(({className:e,...t},n)=>a.jsx(Ne.Command.Separator,{ref:n,className:m("wu-mx-2 wu-my-1 wu-h-px wu-bg-gray-40",e),...t}));hs.displayName=Ne.Command.Separator.displayName;const sn=S.forwardRef(({className:e,...t},n)=>a.jsx(Ne.Command.Item,{ref:n,className:m("wu-relative wu-flex wu-cursor-default wu-gap-2 wu-select-none wu-items-center wu-rounded-sm wu-px-2 wu-py-3 wu-text-sm wu-outline-none data-[disabled=true]:wu-pointer-events-none data-[disabled=true]:wu-opacity-50 [&_svg]:wu-pointer-events-none [&_svg]:wu-size-4 [&_svg]:wu-shrink-0",e),...t}));sn.displayName=Ne.Command.Item.displayName;const Xo=(e,t,n,r)=>p.useMemo(()=>{if(!e||!n||t.length===0)return t;const s=Array.isArray(n)?n:[n];if(s.length===0)return t;const o=new Set(s.map(d=>String(d[r.value]))),i=[],u=[],l=[];return t.forEach(d=>{const c=d[r.value];c===void 0?i.push(d):o.has(String(c))?u.push(d):l.push(d)}),[...i,...u,...l]},[t,n,r.value,e]),Dt=p.forwardRef(({containerHeight:e=400,list:t,callback:n,dir:r,className:s,style:o},i)=>a.jsx(ja.Virtuoso,{ref:i,dir:r,className:s,style:{height:e,scrollbarWidth:"thin",scrollbarColor:"#d4d4d4 #f1f1f1",overflowX:"hidden",...o},data:t,itemContent:(u,l)=>n(u,l)}));Dt.displayName="WuVirtualScroll";const Nf=({tags:e,triggerRef:t})=>{const[n,r]=p.useState([]),[s,o]=p.useState([]),i=p.useMemo(()=>a.jsx("ul",{className:"wu-flex wu-flex-col wu-items-start wu-justify-center wu-list-none",children:s.map((l,d)=>a.jsx("li",{className:"wu-py-1 wu-text-xs wu-text-left",children:l},d))}),[s]),u=l=>{const d=document.createElement("div");Object.assign(d.style,{display:"inline-block",visibility:"hidden",position:"absolute",whiteSpace:"nowrap"}),d.textContent=l,document.body.appendChild(d);const c=d.offsetWidth;return document.body.removeChild(d),c+8};return p.useEffect(()=>{const l=()=>{if(t.current){const f=t.current.offsetWidth-20-36;let h=0;const b=[],g=[];e.forEach(v=>{const N=u(v);h+N+8<f?(b.push(v),h+=N+8):g.push(v)}),r(b),o(g)}};return l(),window.addEventListener("resize",l),()=>{window.removeEventListener("resize",l)}},[e,t]),a.jsxs("div",{className:"wu-flex wu-items-center wu-gap-2 wu-text-xs",children:[n.map((l,d)=>a.jsx("span",{className:"wu-px-1 wu-py-0.5 wu-text-xs wu-rounded-sm wu-bg-gray-10 wu-combobox-tag",children:l},d)),s.length>0&&a.jsx(In,{content:i,className:"wu-z-[51] wu-text-left",children:a.jsxs("span",{className:"wu-px-1 wu-py-0.5 wu-text-xs wu-rounded-sm wu-bg-gray-10 wu-combobox-tag",children:["+",s.length]})})]})},Sf=({placeholder:e="Select...",isEllipse:t=!1,selectedOptions:n,variant:r="flat",dir:s="ltr",accessorKey:o,multiple:i,id:u,disabled:l,selectAll:d,isCheckedAll:c,className:w,...f})=>{const[h,b]=p.useState([]),g=p.useRef(null);p.useEffect(()=>{if(!n||Array.isArray(n)&&n.length===0){b([]);return}if(i){const N=n;b(N==null?void 0:N.map(y=>y[o.label]));return}else b([n[o.label]])},[n]);const v=()=>{var N;return h.length?c&&(d!=null&&d.enable)&&(d!=null&&d.triggerText)?a.jsx("span",{className:"wu-overflow-hidden wu-text-xs wu-text-start wu-text-ellipsis wu-whitespace-nowrap",children:d.triggerText}):t?a.jsx("span",{className:"wu-overflow-hidden wu-text-xs wu-text-start wu-text-ellipsis wu-whitespace-nowrap",style:{width:`${(((N=g.current)==null?void 0:N.offsetWidth)||0)-32}px`},children:h.join(", ")}):a.jsx(Nf,{tags:h,triggerRef:g}):a.jsx("p",{className:"wu-text-xs wu-opacity-70",children:e})};return a.jsx(dt,{dir:s,asChild:!0,id:u,disabled:l,children:a.jsxs("button",{...f,ref:g,disabled:l,className:m("focus-visible:wu-ring-2 focus-visible:wu-ring-blue-pHover wu-bg-white focus-visible:wu-ring-offset-2 wu-flex wu-w-full wu-items-center wu-justify-between wu-border-b wu-border-gray-subtle wu-py-1.5 wu-px-2 placeholder:wu-text-gray-40 focus:wu-outline-none disabled:wu-cursor-not-allowed disabled:wu-opacity-50 hover:wu-bg-gray-10 hover:wu-border-blue-p wu-transition-colors focus-visible:wu-bg-gray-20 focus-visible:wu-border-blue-p wu-cursor-pointer wu-text-xs wu-rounded-t-sm wu-gap-2 wu-h-8 wu-group/wuCombobox wu-combobox-trigger",r==="outlined"&&"wu-border wu-border-gray-subtle","disabled:wu-cursor-not-allowed disabled:hover:wu-border-gray-subtle disabled:wu-bg-gray-10",w),children:[v(),a.jsx("span",{className:"wm-arrow-drop-down group-data-[state=open]/wuCombobox:wu-rotate-180 wu-transition-transform wu-duration-300 wu-text-base"})]})})},Zo=re.Root,Jo=re.Trigger,Qo=re.Group,Cf=re.Portal,Tf=re.Sub,Ef=re.RadioGroup,Ro=S.forwardRef(({className:e,inset:t,children:n,position:r,...s},o)=>a.jsxs(re.SubTrigger,{ref:o,className:m("wu-flex wu-cursor-default wu-select-none wu-text-xs wu-items-center wu-p-2 wu-outline-none focus:wu-bg-gray-20 data-[state=open]:wu-bg-gray-20",t&&"wu-pl-8",e),...s,children:[r==="left"&&a.jsx("span",{className:m("wm-chevron-right",s.dir==="rtl"&&"ml-2")}),n,r!=="left"&&a.jsx("span",{className:m("wu-text-base wu-leading-4",s.dir==="rtl"&&"wu-mr-auto wm-chevron-left",s.dir!=="rtl"&&"wu-ml-auto wm-chevron-right")})]}));Ro.displayName=re.SubTrigger.displayName;const ei=S.forwardRef(({className:e,...t},n)=>a.jsx(re.SubContent,{ref:n,className:m("wu-z-50 wu-min-w-[8rem] wu-overflow-hidden wu-border wu-text-xs wu-bg-white wu-text-gray-lead wu-shadow-lg data-[state=open]:wu-animate-in data-[state=closed]:wu-animate-out data-[state=closed]:wu-fade-out-0 data-[state=open]:wu-fade-in-0 data-[state=closed]:wu-zoom-out-95 data-[state=open]:wu-zoom-in-95 data-[side=bottom]:wu-slide-in-from-top-2 data-[side=left]:wu-slide-in-from-right-2 data-[side=right]:wu-slide-in-from-left-2 data-[side=top]:wu-slide-in-from-bottom-2",e),...t}));ei.displayName=re.SubContent.displayName;const ms=S.forwardRef(({className:e,sideOffset:t=4,...n},r)=>a.jsx(re.Portal,{children:a.jsx(re.Content,{ref:r,sideOffset:t,className:m("wu-z-50 wu-min-w-[8rem] wu-overflow-hidden wu-border wu-text-xs wu-bg-white wu-text-gray-lead wu-shadow-md data-[state=open]:wu-animate-in data-[state=closed]:wu-animate-out data-[state=closed]:wu-fade-out-0 data-[state=open]:wu-fade-in-0 data-[state=closed]:wu-zoom-out-95 data-[state=open]:wu-zoom-in-95 data-[side=bottom]:wu-slide-in-from-top-2 data-[side=left]:wu-slide-in-from-right-2 data-[side=right]:wu-slide-in-from-left-2 data-[side=top]:wu-slide-in-from-bottom-2",e),...n})}));ms.displayName=re.Content.displayName;const Un=S.forwardRef(({className:e,inset:t,...n},r)=>a.jsx(re.Item,{ref:r,className:m("wu-relative wu-flex wu-cursor-default wu-select-none wu-items-center wu-text-xs wu-p-2 wu-outline-none wu-transition-colors focus:wu-bg-gray-20 data-[disabled]:wu-cursor-not-allowed data-[disabled]:wu-opacity-50",t&&"wu-pl-8",e),...n}));Un.displayName=re.Item.displayName;const ti=S.forwardRef(({className:e,children:t,checked:n,dir:r,...s},o)=>a.jsxs(re.CheckboxItem,{ref:o,className:m("wu-group wu-relative wu-flex wu-cursor-default wu-select-none wu-items-center wu-text-xs wu-py-3 wu-outline-none wu-transition-colors focus:wu-bg-gray-20 data-[disabled]:wu-cursor-not-allowed data-[disabled]:wu-opacity-50",r==="rtl"&&"wu-pr-8 wu-pl-2",r!=="rtl"&&"wu-pl-8 wu-pr-2",e),checked:n,...s,children:[a.jsx("span",{className:m("wu-absolute wu-flex wu-items-center wu-justify-center wu-w-4 wu-h-4 wu-rounded-sm wu-ring-1 wu-ring-gray-subtle group-disabled:wu-bg-gray-20 group-data-[state=checked]:wu-bg-blue-p group-hover:wu-bg-gray-20 group-hover:wu-ring-blue-p wu-transition-all group-data-[state=checked]:wu-ring-blue-p",r==="rtl"&&"wu-right-2",r!=="rtl"&&"wu-left-2"),children:a.jsx(re.ItemIndicator,{children:a.jsx("span",{className:"wm-check wu-text-base wu-text-white"})})}),t]}));ti.displayName=re.CheckboxItem.displayName;const ni=S.forwardRef(({className:e,children:t,...n},r)=>a.jsxs(re.RadioItem,{ref:r,className:m("wu-group wu-relative wu-flex wu-cursor-default wu-select-none wu-items-center wu-text-xs wu-py-3 wu-pl-8 wu-pr-2 wu-outline-none wu-transition-colors focus:wu-bg-gray-20 focus:wu-text-accent-foreground data-[disabled]:wu-cursor-not-allowed data-[disabled]:wu-opacity-50",e),...n,children:[a.jsx("span",{className:"wu-absolute wu-rounded-full wu-left-2 wu-flex wu-h-4 wu-w-4 wu-items-center wu-justify-center wu-ring-1 wu-ring-gray-subtle group-disabled:wu-bg-gray-20 group-data-[state=checked]:wu-bg-white group-hover:wu-bg-gray-20 group-hover:wu-ring-blue-p wu-transition-all group-data-[state=checked]:wu-ring-blue-p group-hover:group-data-[state=checked]:wu-ring-blue-q",children:a.jsx(re.ItemIndicator,{className:"wu-w-4 wu-h-4 wu-flex wu-items-center wu-justify-center",children:a.jsx("span",{className:"wm-circle wu-text-blue-p group-hover:group-data-[state=checked]:wu-text-blue-q wu-text-xs"})})}),t]}));ni.displayName=re.RadioItem.displayName;const an=S.forwardRef(({className:e,inset:t,...n},r)=>a.jsx(re.Label,{ref:r,className:m("wu-p-2 wu-font-medium wu-text-xs",t&&"wu-pl-8",e),...n}));an.displayName=re.Label.displayName;const jn=S.forwardRef(({className:e,...t},n)=>a.jsx(re.Separator,{ref:n,className:m("-wu-mx-1 wu-my-1 wu-h-px wu-bg-gray-20",e),...t}));jn.displayName=re.Separator.displayName;const ri=({option:e,value:t,multiple:n=!1,onSelect:r,accessorKey:s,dir:o})=>{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=()=>{e.disabled||r(e)};return a.jsxs(sn,{onSelect:d,disabled:e.disabled,className:m("wu-cursor-pointer wu-text-xs wu-items-start wu-leading-4 wu-py-2 wu-combobox-item hover:wu-bg-gray-100",l&&"wu-bg-gray-10"),dir:o,children:[n&&a.jsx($e,{checked:l}),a.jsx(Mf,{option:e,accessorKey:s})]})},Mf=({option:e,accessorKey:t})=>{const n=e[t.label];return a.jsxs("div",{className:"wu-flex wu-items-center wu-w-full wu-gap-1",children:[e.icon&&e.icon,n,e.isAdmin&&a.jsx("span",{className:"wu-ml-auto wu-text-sm wm-lock wu-text-orange-deep"})]})},si=e=>{const{option:t,selectAll:n,handleSelectAll:r,isCheckedAll:s,isPartialSelected:o,...i}=e;switch("type"in t?t.type:"option"){case"all":return a.jsxs(sn,{onSelect:r,className:m("wu-cursor-pointer wu-text-xs wu-leading-4 wu-py-2 wu-combobox-item"),dir:i.dir,children:[a.jsx($e,{checked:s||o,partial:o,"data-partial":o,"aria-label":(n==null?void 0:n.label)||"Select All"}),a.jsx("span",{"aria-hidden":!0,children:(n==null?void 0:n.label)||"Select All"})]});case"group":return a.jsxs(rn,{children:[a.jsx(an,{children:t.label}),t.options.map((l,d)=>p.createElement(ri,{...i,option:l,key:d}))]});case"divider":return a.jsx(hs,{className:"wu-mx-4"});default:return a.jsx(ri,{...i,option:t})}},If=e=>{const t=[],n=[],r=[],s=[];return e.forEach(o=>{o.type==="group"?(t.push(o),r.push(...o.options),s.push(...o.options.filter(i=>!i.disabled))):o.type==="divider"?n.push(o):r.push(o),o!=null&&o.disabled||s.push(o)}),{groups:t,dividers:n,allOptions:r,enabledOptions:s}},Df=p.memo(Je),kf=({data:e,accessorKey:t,value:n,defaultValue:r,Header:s,virtualizedThreshold:o=100,isEllipse:i,placeholder:u,variant:l,dir:d,onSelect:c,Label:w,maxHeight:f=420,multiple:h=!1,hasGroup:b=!1,selectAll:g,id:v,disabled:N,labelPosition:y="top",className:C,onScroll:E,maxContentWidth:x,enableSearch:D=!0,noDataContent:T,selectedToTop:M=!1,...I})=>{const[_,P]=p.useState(""),[A,O]=p.useState(),[F,V]=p.useState(!1),[L,U]=p.useState(!1),[H,q]=p.useState(!1),Z=p.useRef(null),{allOptions:z,enabledOptions:J}=p.useMemo(()=>b||g&&!g.includeDisabled?If(e):{allOptions:e,groups:[],dividers:[],enabledOptions:[]},[e,b]),ie=p.useMemo(()=>{if(!_)return e;const j=_.toLowerCase();return z.filter(X=>X[t.label].toLowerCase().includes(j))},[_,z,e,t.label]),R=p.useMemo(()=>h&&g!=null&&g.enable&&!_&&ie.length>0?[{type:"all"},...ie]:ie,[ie,_,h]),ve=Xo(M,R,A,t),K=p.useCallback(j=>{const X=j[t.value];h?O(We=>{const me=We||[],xe=me.some(Pe=>Pe[t.value]===X)?me.filter(Pe=>Pe[t.value]!==X):[...me,j];return c==null||c(xe),xe}):(V(!1),O(j),c==null||c(j))},[h,t.value,c]),W=p.useCallback(j=>P(j.target.value),[]),G=p.useCallback(()=>P(""),[]);p.useEffect(()=>{if(n!==void 0&&r!==void 0){console.error("defaultValue and value cannot be used simultaneously");return}else n!==void 0?O(n):r!==void 0&&O(r)},[n,r]),p.useEffect(()=>{if(!h)return;const j=g!=null&&g.includeDisabled?(A==null?void 0:A.length)===z.length:(A==null?void 0:A.length)===J.length;U(j);const X=(A==null?void 0:A.length)>0&&!j;q(X)},[A,g]);const Y=p.useCallback(()=>{const j=L?[]:g!=null&&g.includeDisabled?z:J;O(j),c==null||c(j)},[L,h,z,J,c,g]),Q=Mn(y);return a.jsxs("div",{className:m(Q,"wu-flex wu-combobox-container"),ref:Z,children:[a.jsxs(Ue,{onOpenChange:j=>{j&&G(),V(j)},open:F,modal:!0,children:[a.jsx(Sf,{selectedOptions:A,accessorKey:t,isEllipse:i,placeholder:u,variant:l,dir:d,multiple:h,disabled:N,selectAll:g,isCheckedAll:L,className:C,id:v,...I}),a.jsx(qe,{className:"wu-min-w-[--radix-popover-trigger-width] wu-max-w-[calc(100vw-32px)] wu-p-0 wu-bg-white wu-border wu-border-blue-p wu-combobox-content",align:"start",sideOffset:-1,style:{maxWidth:x},children:a.jsxs(ws,{id:v,children:[D&&a.jsx("div",{className:"wu-m-2",children:a.jsx(Df,{placeholder:"Search...",Icon:a.jsx("span",{className:"wm-search"}),className:"wu-text-xs wu-combobox-search",onChange:W,name:"Search","aria-label":"Search",dir:d,iconPosition:d==="rtl"?"right":"left"})}),s,a.jsxs(fs,{children:[a.jsx(ps,{children:T||"No results found."}),ve.length>=o?a.jsx(Dt,{className:"wu-combobox-list",containerHeight:f,list:ve,callback:(j,X)=>a.jsx(si,{option:X,value:A,onSelect:K,multiple:h,accessorKey:t,dir:d,selectAll:g,handleSelectAll:Y,isCheckedAll:L,isPartialSelected:H},j),dir:d}):a.jsx("div",{style:{height:"fit-content",maxHeight:f,overflow:"auto"},className:"wu-combobox-list",onScroll:E,children:ve.map(j=>{const X=j,We=String(X[t.value]??X.type);return a.jsx(si,{option:X,value:A,onSelect:K,multiple:h,accessorKey:t,dir:d,selectAll:g,handleSelectAll:Y,isCheckedAll:L,isPartialSelected:H},We)})})]})]})})]}),w&&a.jsx(De,{htmlFor:v,className:"wu-combobox-label",children:w})]})},Af=e=>{const{textToCopy:t,notificationText:n,...r}=e,[s,o]=p.useState(!1),i=async()=>{if(t)try{await navigator.clipboard.writeText(t),o(!0),setTimeout(()=>o(!1),2e3)}catch(u){console.error("Failed to copy:",u)}};return a.jsxs(Ie,{...r,onClick:i,variant:"iconOnly",className:m("wu-relative",e.className),"aria-label":"Copy to clipboard",children:[n&&a.jsx("span",{className:m("wu-absolute wu-text-[6px] wu-leading-3 -wu-top-4 wu-right-0 wu-bg-gray-notification wu-text-white wu-rounded-sm wu-shadow-md wu-px-1 wu-animate-ping-once",s?"wu-block":"wu-hidden"),children:n}),a.jsx(Ve,{icon:"wm-content-copy",className:"wu-text-lg"})]})},ai=te.Root,_f=te.Trigger,Pf=te.Close,Vf=te.Portal,oi=S.forwardRef(({className:e,...t},n)=>a.jsx(te.Overlay,{className:m("wu-fixed wu-inset-0 wu-z-50 wu-bg-black/30 data-[state=open]:wu-animate-in data-[state=closed]:wu-animate-out data-[state=closed]:wu-fade-out-0 data-[state=open]:wu-fade-in-0","wu-drawer-overlay",e),...t,ref:n}));oi.displayName=te.Overlay.displayName;const Of=Be.cva("wu-fixed wu-z-50 wu-gap-4 wu-p-6 wu-shadow-lg wu-transition wu-ease-in-out data-[state=open]:wu-animate-in data-[state=closed]:wu-animate-out data-[state=closed]:wu-duration-500 data-[state=open]:wu-duration-500",{variants:{side:{top:"wu-inset-x-0 wu-top-0 wu-border-b data-[state=closed]:wu-slide-out-to-top data-[state=open]:wu-slide-in-from-top",bottom:"wu-inset-x-0 wu-bottom-0 wu-border-t data-[state=closed]:wu-slide-out-to-bottom data-[state=open]:wu-slide-in-from-bottom",left:"wu-inset-y-0 wu-left-0 wu-h-full wu-w-3/4 wu-border-r data-[state=closed]:wu-slide-out-to-left data-[state=open]:wu-slide-in-from-left sm:wu-max-w-sm",right:"wu-inset-y-0 wu-right-0 wu-h-full wu-w-3/4 wu-border-l data-[state=closed]:wu-slide-out-to-right data-[state=open]:wu-slide-in-from-right sm:wu-max-w-sm"}},defaultVariants:{side:"right"}}),gs=S.forwardRef(({side:e="right",className:t,children:n,hideCloseButton:r,overlayClassName:s,closeButtonClassName:o,...i},u)=>a.jsxs(Vf,{children:[a.jsx(oi,{className:s}),a.jsxs(te.Content,{ref:u,className:m(Of({side:e}),t),...i,children:[n,!r&&a.jsx(te.Close,{"aria-label":"close",asChild:!0,children:a.jsxs(Et,{variant:"iconOnly",className:m("wu-absolute wu-right-4 wu-top-4",o),children:[a.jsx("span",{className:"wm-close"}),a.jsx("span",{className:"wu-sr-only",children:"Close"})]})})]})]}));gs.displayName=te.Content.displayName;const ii=S.forwardRef(({className:e,...t},n)=>a.jsx(te.Title,{ref:n,className:m("wu-text-lg wu-font-semibold",e),...t}));ii.displayName=te.Title.displayName;const Ff=S.forwardRef(({className:e,...t},n)=>a.jsx(te.Description,{ref:n,className:m("wu-text-sm",e),...t}));Ff.displayName=te.Description.displayName;const Lf=e=>t=>{e&&t.preventDefault()},Wf=e=>{const{Trigger:t,children:n,hideCloseButton:r,className:s,side:o="left",open:i,onOpenChange:u,preventClickOutside:l,overlayClassName:d,closeButtonClassName:c,...w}=e;return a.jsxs(ai,{open:i,onOpenChange:u,children:[a.jsx(_f,{asChild:!0,children:t}),a.jsxs(gs,{onInteractOutside:Lf(l),side:o,className:m("wu-bg-white wu-text-gray-lead wu-px-0",s),hideCloseButton:r,overlayClassName:d,closeButtonClassName:c,...w,children:[a.jsx("div",{className:"wu-hidden",children:a.jsx(ii,{})}),n]})]})},Bf=({children:e,...t})=>a.jsx(Pf,{...t,children:e}),ui=p.createContext({});function bs(e){const t=p.useRef(null);return t.current===null&&(t.current=e()),t.current}const li=typeof window<"u"?p.useLayoutEffect:p.useEffect,Gn=p.createContext(null);function qf(e,t){e.indexOf(t)===-1&&e.push(t)}function $f(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const Qe=(e,t,n)=>n>t?t:n<e?e:n;function ys(e,t){return t?`${e}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${t}`:e}let on=()=>{},ft=()=>{};typeof process<"u"&&((Nd=process.env)==null?void 0:Nd.NODE_ENV)!=="production"&&(on=(e,t,n)=>{!e&&typeof console<"u"&&console.warn(ys(t,n))},ft=(e,t,n)=>{if(!e)throw new Error(ys(t,n))});const Re={},ci=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function Hf(e){return typeof e=="object"&&e!==null}const di=e=>/^0[^.\s]+$/u.test(e);function wi(e){let t;return()=>(t===void 0&&(t=e()),t)}const kt=e=>e,zf=(e,t)=>n=>t(e(n)),Kn=(...e)=>e.reduce(zf),fi=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r};class pi{constructor(){this.subscriptions=[]}add(t){return qf(this.subscriptions,t),()=>$f(this.subscriptions,t)}notify(t,n,r){const s=this.subscriptions.length;if(s)if(s===1)this.subscriptions[0](t,n,r);else for(let o=0;o<s;o++){const i=this.subscriptions[o];i&&i(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const Oe=e=>e*1e3,He=e=>e/1e3;function hi(e,t){return t?e*(1e3/t):0}const mi=new Set;function gi(e,t,n){e||mi.has(t)||(console.warn(ys(t,n)),mi.add(t))}const bi=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,Uf=1e-7,jf=12;function Gf(e,t,n,r,s){let o,i,u=0;do i=t+(n-t)/2,o=bi(i,r,s)-e,o>0?n=i:t=i;while(Math.abs(o)>Uf&&++u<jf);return i}function un(e,t,n,r){if(e===t&&n===r)return kt;const s=o=>Gf(o,0,1,e,n);return o=>o===0||o===1?o:bi(s(o),t,r)}const yi=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,vi=e=>t=>1-e(1-t),xi=un(.33,1.53,.69,.99),vs=vi(xi),Ni=yi(vs),Si=e=>e>=1?1:(e*=2)<1?.5*vs(e):.5*(2-Math.pow(2,-10*(e-1))),xs=e=>1-Math.sin(Math.acos(e)),Kf=vi(xs),Ci=yi(xs),Yf=un(.42,0,1,1),Xf=un(0,0,.58,1),Ti=un(.42,0,.58,1),Zf=e=>Array.isArray(e)&&typeof e[0]!="number",Ei=e=>Array.isArray(e)&&typeof e[0]=="number",Mi={linear:kt,easeIn:Yf,easeInOut:Ti,easeOut:Xf,circIn:xs,circInOut:Ci,circOut:Kf,backIn:vs,backInOut:Ni,backOut:xi,anticipate:Si},Jf=e=>typeof e=="string",Ii=e=>{if(Ei(e)){ft(e.length===4,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[t,n,r,s]=e;return un(t,n,r,s)}else if(Jf(e))return ft(Mi[e]!==void 0,`Invalid easing type '${e}'`,"invalid-easing-type"),Mi[e];return e},Yn=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function Qf(e,t){let n=new Set,r=new Set,s=!1,o=!1;const i=new WeakSet;let u={delta:0,timestamp:0,isProcessing:!1};function l(c){i.has(c)&&(d.schedule(c),e()),c(u)}const d={schedule:(c,w=!1,f=!1)=>{const b=f&&s?n:r;return w&&i.add(c),b.add(c),c},cancel:c=>{r.delete(c),i.delete(c)},process:c=>{if(u=c,s){o=!0;return}s=!0;const w=n;n=r,r=w,n.forEach(l),n.clear(),s=!1,o&&(o=!1,d.process(c))}};return d}const Rf=40;function Di(e,t){let n=!1,r=!0;const s={delta:0,timestamp:0,isProcessing:!1},o=()=>n=!0,i=Yn.reduce((C,E)=>(C[E]=Qf(o),C),{}),{setup:u,read:l,resolveKeyframes:d,preUpdate:c,update:w,preRender:f,render:h,postRender:b}=i,g=()=>{const C=Re.useManualTiming,E=C?s.timestamp:performance.now();n=!1,C||(s.delta=r?1e3/60:Math.max(Math.min(E-s.timestamp,Rf),1)),s.timestamp=E,s.isProcessing=!0,u.process(s),l.process(s),d.process(s),c.process(s),w.process(s),f.process(s),h.process(s),b.process(s),s.isProcessing=!1,n&&t&&(r=!1,e(g))},v=()=>{n=!0,r=!0,s.isProcessing||e(g)};return{schedule:Yn.reduce((C,E)=>{const x=i[E];return C[E]=(D,T=!1,M=!1)=>(n||v(),x.schedule(D,T,M)),C},{}),cancel:C=>{for(let E=0;E<Yn.length;E++)i[Yn[E]].cancel(C)},state:s,steps:i}}const{schedule:Fe,cancel:Ns,state:Xn}=Di(typeof requestAnimationFrame<"u"?requestAnimationFrame:kt,!0);let Zn;function ep(){Zn=void 0}const _e={now:()=>(Zn===void 0&&_e.set(Xn.isProcessing||Re.useManualTiming?Xn.timestamp:performance.now()),Zn),set:e=>{Zn=e,queueMicrotask(ep)}},ki=e=>t=>typeof t=="string"&&t.startsWith(e),Ai=ki("--"),tp=ki("var(--"),Ss=e=>tp(e)?np.test(e.split("/*")[0].trim()):!1,np=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function _i(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}const At={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},ln={...At,transform:e=>Qe(0,1,e)},Jn={...At,default:1},cn=e=>Math.round(e*1e5)/1e5,Cs=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function rp(e){return e==null}const sp=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Ts=(e,t)=>n=>!!(typeof n=="string"&&sp.test(n)&&n.startsWith(e)||t&&!rp(n)&&Object.prototype.hasOwnProperty.call(n,t)),Pi=(e,t,n)=>r=>{if(typeof r!="string")return r;const[s,o,i,u]=r.match(Cs);return{[e]:parseFloat(s),[t]:parseFloat(o),[n]:parseFloat(i),alpha:u!==void 0?parseFloat(u):1}},ap=e=>Qe(0,255,e),Es={...At,transform:e=>Math.round(ap(e))},pt={test:Ts("rgb","red"),parse:Pi("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+Es.transform(e)+", "+Es.transform(t)+", "+Es.transform(n)+", "+cn(ln.transform(r))+")"};function op(e){let t="",n="",r="",s="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),s=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),s=e.substring(4,5),t+=t,n+=n,r+=r,s+=s),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:s?parseInt(s,16)/255:1}}const Ms={test:Ts("#"),parse:op,transform:pt.transform},dn=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),et=dn("deg"),_t=dn("%"),B=dn("px"),ip=dn("vh"),up=dn("vw"),Vi={..._t,parse:e=>_t.parse(e)/100,transform:e=>_t.transform(e*100)},Pt={test:Ts("hsl","hue"),parse:Pi("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+_t.transform(cn(t))+", "+_t.transform(cn(n))+", "+cn(ln.transform(r))+")"},de={test:e=>pt.test(e)||Ms.test(e)||Pt.test(e),parse:e=>pt.test(e)?pt.parse(e):Pt.test(e)?Pt.parse(e):Ms.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?pt.transform(e):Pt.transform(e),getAnimatableNone:e=>{const t=de.parse(e);return t.alpha=0,de.transform(t)}},lp=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function cp(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(Cs))==null?void 0:t.length)||0)+(((n=e.match(lp))==null?void 0:n.length)||0)>0}const Oi="number",Fi="color",dp="var",wp="var(",Li="${}",fp=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Vt(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},s=[];let o=0;const u=t.replace(fp,l=>(de.test(l)?(r.color.push(o),s.push(Fi),n.push(de.parse(l))):l.startsWith(wp)?(r.var.push(o),s.push(dp),n.push(l)):(r.number.push(o),s.push(Oi),n.push(parseFloat(l))),++o,Li)).split(Li);return{values:n,split:u,indexes:r,types:s}}function pp(e){return Vt(e).values}function Wi({split:e,types:t}){const n=e.length;return r=>{let s="";for(let o=0;o<n;o++)if(s+=e[o],r[o]!==void 0){const i=t[o];i===Oi?s+=cn(r[o]):i===Fi?s+=de.transform(r[o]):s+=r[o]}return s}}function hp(e){return Wi(Vt(e))}const mp=e=>typeof e=="number"?0:de.test(e)?de.getAnimatableNone(e):e,gp=(e,t)=>typeof e=="number"?t!=null&&t.trim().endsWith("/")?e:0:mp(e);function bp(e){const t=Vt(e);return Wi(t)(t.values.map((r,s)=>gp(r,t.split[s])))}const ze={test:cp,parse:pp,createTransformer:hp,getAnimatableNone:bp};function Is(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function yp({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let s=0,o=0,i=0;if(!t)s=o=i=n;else{const u=n<.5?n*(1+t):n+t-n*t,l=2*n-u;s=Is(l,u,e+1/3),o=Is(l,u,e),i=Is(l,u,e-1/3)}return{red:Math.round(s*255),green:Math.round(o*255),blue:Math.round(i*255),alpha:r}}function Qn(e,t){return n=>n>0?t:e}const wn=(e,t,n)=>e+(t-e)*n,Ds=(e,t,n)=>{const r=e*e,s=n*(t*t-r)+r;return s<0?0:Math.sqrt(s)},vp=[Ms,pt,Pt],xp=e=>vp.find(t=>t.test(e));function Bi(e){const t=xp(e);if(on(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!t)return!1;let n=t.parse(e);return t===Pt&&(n=yp(n)),n}const qi=(e,t)=>{const n=Bi(e),r=Bi(t);if(!n||!r)return Qn(e,t);const s={...n};return o=>(s.red=Ds(n.red,r.red,o),s.green=Ds(n.green,r.green,o),s.blue=Ds(n.blue,r.blue,o),s.alpha=wn(n.alpha,r.alpha,o),pt.transform(s))},ks=new Set(["none","hidden"]);function Np(e,t){return ks.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function Sp(e,t){return n=>wn(e,t,n)}function As(e){return typeof e=="number"?Sp:typeof e=="string"?Ss(e)?Qn:de.test(e)?qi:Ep:Array.isArray(e)?$i:typeof e=="object"?de.test(e)?qi:Cp:Qn}function $i(e,t){const n=[...e],r=n.length,s=e.map((o,i)=>As(o)(o,t[i]));return o=>{for(let i=0;i<r;i++)n[i]=s[i](o);return n}}function Cp(e,t){const n={...e,...t},r={};for(const s in n)e[s]!==void 0&&t[s]!==void 0&&(r[s]=As(e[s])(e[s],t[s]));return s=>{for(const o in r)n[o]=r[o](s);return n}}function Tp(e,t){const n=[],r={color:0,var:0,number:0};for(let s=0;s<t.values.length;s++){const o=t.types[s],i=e.indexes[o][r[o]],u=e.values[i]??0;n[s]=u,r[o]++}return n}const Ep=(e,t)=>{const n=ze.createTransformer(t),r=Vt(e),s=Vt(t);return r.indexes.var.length===s.indexes.var.length&&r.indexes.color.length===s.indexes.color.length&&r.indexes.number.length>=s.indexes.number.length?ks.has(e)&&!s.values.length||ks.has(t)&&!r.values.length?Np(e,t):Kn($i(Tp(r,s),s.values),n):(on(!0,`Complex values '${e}' and '${t}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`,"complex-values-different"),Qn(e,t))};function Hi(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?wn(e,t,n):As(e)(e,t)}const Mp=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>Fe.update(t,n),stop:()=>Ns(t),now:()=>Xn.isProcessing?Xn.timestamp:_e.now()}},zi=(e,t,n=10)=>{let r="";const s=Math.max(Math.round(t/n),2);for(let o=0;o<s;o++)r+=Math.round(e(o/(s-1))*1e4)/1e4+", ";return`linear(${r.substring(0,r.length-2)})`},Rn=2e4;function _s(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<Rn;)t+=n,r=e.next(t);return t>=Rn?1/0:t}function Ip(e,t=100,n){const r=n({...e,keyframes:[0,t]}),s=Math.min(_s(r),Rn);return{type:"keyframes",ease:o=>r.next(s*o).value/t,duration:He(s)}}const oe={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function Ps(e,t){return e*Math.sqrt(1-t*t)}const Dp=12;function kp(e,t,n){let r=n;for(let s=1;s<Dp;s++)r=r-e(r)/t(r);return r}const Vs=.001;function Ap({duration:e=oe.duration,bounce:t=oe.bounce,velocity:n=oe.velocity,mass:r=oe.mass}){let s,o;on(e<=Oe(oe.maxDuration),"Spring duration must be 10 seconds or less","spring-duration-limit");let i=1-t;i=Qe(oe.minDamping,oe.maxDamping,i),e=Qe(oe.minDuration,oe.maxDuration,He(e)),i<1?(s=d=>{const c=d*i,w=c*e,f=c-n,h=Ps(d,i),b=Math.exp(-w);return Vs-f/h*b},o=d=>{const w=d*i*e,f=w*n+n,h=Math.pow(i,2)*Math.pow(d,2)*e,b=Math.exp(-w),g=Ps(Math.pow(d,2),i);return(-s(d)+Vs>0?-1:1)*((f-h)*b)/g}):(s=d=>{const c=Math.exp(-d*e),w=(d-n)*e+1;return-Vs+c*w},o=d=>{const c=Math.exp(-d*e),w=(n-d)*(e*e);return c*w});const u=5/e,l=kp(s,o,u);if(e=Oe(e),isNaN(l))return{stiffness:oe.stiffness,damping:oe.damping,duration:e};{const d=Math.pow(l,2)*r;return{stiffness:d,damping:i*2*Math.sqrt(r*d),duration:e}}}const _p=["duration","bounce"],Pp=["stiffness","damping","mass"];function Ui(e,t){return t.some(n=>e[n]!==void 0)}function Vp(e){let t={velocity:oe.velocity,stiffness:oe.stiffness,damping:oe.damping,mass:oe.mass,isResolvedFromDuration:!1,...e};if(!Ui(e,Pp)&&Ui(e,_p))if(t.velocity=0,e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),s=r*r,o=2*Qe(.05,1,1-(e.bounce||0))*Math.sqrt(s);t={...t,mass:oe.mass,stiffness:s,damping:o}}else{const n=Ap({...e,velocity:0});t={...t,...n,mass:oe.mass},t.isResolvedFromDuration=!0}return t}function er(e=oe.visualDuration,t=oe.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:s}=n;const o=n.keyframes[0],i=n.keyframes[n.keyframes.length-1],u={done:!1,value:o},{stiffness:l,damping:d,mass:c,duration:w,velocity:f,isResolvedFromDuration:h}=Vp({...n,velocity:-He(n.velocity||0)}),b=f||0,g=d/(2*Math.sqrt(l*c)),v=i-o,N=He(Math.sqrt(l/c)),y=Math.abs(v)<5;r||(r=y?oe.restSpeed.granular:oe.restSpeed.default),s||(s=y?oe.restDelta.granular:oe.restDelta.default);let C,E,x,D,T,M;if(g<1)x=Ps(N,g),D=(b+g*N*v)/x,C=_=>{const P=Math.exp(-g*N*_);return i-P*(D*Math.sin(x*_)+v*Math.cos(x*_))},T=g*N*D+v*x,M=g*N*v-D*x,E=_=>Math.exp(-g*N*_)*(T*Math.sin(x*_)+M*Math.cos(x*_));else if(g===1){C=P=>i-Math.exp(-N*P)*(v+(b+N*v)*P);const _=b+N*v;E=P=>Math.exp(-N*P)*(N*_*P-b)}else{const _=N*Math.sqrt(g*g-1);C=F=>{const V=Math.exp(-g*N*F),L=Math.min(_*F,300);return i-V*((b+g*N*v)*Math.sinh(L)+_*v*Math.cosh(L))/_};const P=(b+g*N*v)/_,A=g*N*P-v*_,O=g*N*v-P*_;E=F=>{const V=Math.exp(-g*N*F),L=Math.min(_*F,300);return V*(A*Math.sinh(L)+O*Math.cosh(L))}}const I={calculatedDuration:h&&w||null,velocity:_=>Oe(E(_)),next:_=>{if(!h&&g<1){const A=Math.exp(-g*N*_),O=Math.sin(x*_),F=Math.cos(x*_),V=i-A*(D*O+v*F),L=Oe(A*(T*O+M*F));return u.done=Math.abs(L)<=r&&Math.abs(i-V)<=s,u.value=u.done?i:V,u}const P=C(_);if(h)u.done=_>=w;else{const A=Oe(E(_));u.done=Math.abs(A)<=r&&Math.abs(i-P)<=s}return u.value=u.done?i:P,u},toString:()=>{const _=Math.min(_s(I),Rn),P=zi(A=>I.next(_*A).value,_,30);return _+"ms "+P},toTransition:()=>{}};return I}er.applyToOptions=e=>{const t=Ip(e,100,er);return e.ease=t.ease,e.duration=Oe(t.duration),e.type="keyframes",e};const Op=5;function ji(e,t,n){const r=Math.max(t-Op,0);return hi(n-e(r),t-r)}function Os({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:s=10,bounceStiffness:o=500,modifyTarget:i,min:u,max:l,restDelta:d=.5,restSpeed:c}){const w=e[0],f={done:!1,value:w},h=M=>u!==void 0&&M<u||l!==void 0&&M>l,b=M=>u===void 0?l:l===void 0||Math.abs(u-M)<Math.abs(l-M)?u:l;let g=n*t;const v=w+g,N=i===void 0?v:i(v);N!==v&&(g=N-w);const y=M=>-g*Math.exp(-M/r),C=M=>N+y(M),E=M=>{const I=y(M),_=C(M);f.done=Math.abs(I)<=d,f.value=f.done?N:_};let x,D;const T=M=>{h(f.value)&&(x=M,D=er({keyframes:[f.value,b(f.value)],velocity:ji(C,M,f.value),damping:s,stiffness:o,restDelta:d,restSpeed:c}))};return T(0),{calculatedDuration:null,next:M=>{let I=!1;return!D&&x===void 0&&(I=!0,E(M),T(M)),x!==void 0&&M>=x?D.next(M-x):(!I&&E(M),f)}}}function Fp(e,t,n){const r=[],s=n||Re.mix||Hi,o=e.length-1;for(let i=0;i<o;i++){let u=s(e[i],e[i+1]);if(t){const l=Array.isArray(t)?t[i]||kt:t;u=Kn(l,u)}r.push(u)}return r}function Lp(e,t,{clamp:n=!0,ease:r,mixer:s}={}){const o=e.length;if(ft(o===t.length,"Both input and output ranges must be the same length","range-length"),o===1)return()=>t[0];if(o===2&&t[0]===t[1])return()=>t[1];const i=e[0]===e[1];e[0]>e[o-1]&&(e=[...e].reverse(),t=[...t].reverse());const u=Fp(t,r,s),l=u.length,d=c=>{if(i&&c<e[0])return t[0];let w=0;if(l>1)for(;w<e.length-2&&!(c<e[w+1]);w++);const f=fi(e[w],e[w+1],c);return u[w](f)};return n?c=>d(Qe(e[0],e[o-1],c)):d}function Wp(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const s=fi(0,t,r);e.push(wn(n,1,s))}}function Bp(e){const t=[0];return Wp(t,e.length-1),t}function qp(e,t){return e.map(n=>n*t)}function $p(e,t){return e.map(()=>t||Ti).splice(0,e.length-1)}function Ot({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const s=Zf(r)?r.map(Ii):Ii(r),o={done:!1,value:t[0]},i=qp(n&&n.length===t.length?n:Bp(t),e),u=Lp(i,t,{ease:Array.isArray(s)?s:$p(t,s)});return{calculatedDuration:e,next:l=>(o.value=u(l),o.done=l>=e,o)}}const Hp=e=>e!==null;function tr(e,{repeat:t,repeatType:n="loop"},r,s=1){const o=e.filter(Hp),u=s<0||t&&n!=="loop"&&t%2===1?0:o.length-1;return!u||r===void 0?o[u]:r}const zp={decay:Os,inertia:Os,tween:Ot,keyframes:Ot,spring:er};function Gi(e){typeof e.type=="string"&&(e.type=zp[e.type])}class Fs{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,n){return this.finished.then(t,n)}}const Up=e=>e/100;class nr extends Fs{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{var r,s;const{motionValue:n}=this.options;n&&n.updatedAt!==_e.now()&&this.tick(_e.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(s=(r=this.options).onStop)==null||s.call(r))},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;Gi(t);const{type:n=Ot,repeat:r=0,repeatDelay:s=0,repeatType:o,velocity:i=0}=t;let{keyframes:u}=t;const l=n||Ot;process.env.NODE_ENV!=="production"&&l!==Ot&&ft(u.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${u}`,"spring-two-frames"),l!==Ot&&typeof u[0]!="number"&&(this.mixKeyframes=Kn(Up,Hi(u[0],u[1])),u=[0,100]);const d=l({...t,keyframes:u});o==="mirror"&&(this.mirroredGenerator=l({...t,keyframes:[...u].reverse(),velocity:-i})),d.calculatedDuration===null&&(d.calculatedDuration=_s(d));const{calculatedDuration:c}=d;this.calculatedDuration=c,this.resolvedDuration=c+s,this.totalDuration=this.resolvedDuration*(r+1)-s,this.generator=d}updateTime(t){const n=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(t,n=!1){const{generator:r,totalDuration:s,mixKeyframes:o,mirroredGenerator:i,resolvedDuration:u,calculatedDuration:l}=this;if(this.startTime===null)return r.next(0);const{delay:d=0,keyframes:c,repeat:w,repeatType:f,repeatDelay:h,type:b,onUpdate:g,finalKeyframe:v}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-s/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const N=this.currentTime-d*(this.playbackSpeed>=0?1:-1),y=this.playbackSpeed>=0?N<0:N>s;this.currentTime=Math.max(N,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=s);let C=this.currentTime,E=r;if(w){const M=Math.min(this.currentTime,s)/u;let I=Math.floor(M),_=M%1;!_&&M>=1&&(_=1),_===1&&I--,I=Math.min(I,w+1),!!(I%2)&&(f==="reverse"?(_=1-_,h&&(_-=h/u)):f==="mirror"&&(E=i)),C=Qe(0,1,_)*u}let x;y?(this.delayState.value=c[0],x=this.delayState):x=E.next(C),o&&!y&&(x.value=o(x.value));let{done:D}=x;!y&&l!==null&&(D=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);const T=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&D);return T&&b!==Os&&(x.value=tr(c,this.options,v,this.speed)),g&&g(x.value),T&&this.finish(),x}then(t,n){return this.finished.then(t,n)}get duration(){return He(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+He(t)}get time(){return He(this.currentTime)}set time(t){t=Oe(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=t,this.tick(t))}getGeneratorVelocity(){const t=this.currentTime;if(t<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(t);const n=this.generator.next(t).value;return ji(r=>this.generator.next(r).value,t,n)}get speed(){return this.playbackSpeed}set speed(t){const n=this.playbackSpeed!==t;n&&this.driver&&this.updateTime(_e.now()),this.playbackSpeed=t,n&&this.driver&&(this.time=He(this.currentTime))}play(){var s,o;if(this.isStopped)return;const{driver:t=Mp,startTime:n}=this.options;this.driver||(this.driver=t(i=>this.tick(i))),(o=(s=this.options).onPlay)==null||o.call(s);const r=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=r):this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime||(this.startTime=n??r),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(_e.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var t,n;this.notifyFinished(),this.teardown(),this.state="finished",(n=(t=this.options).onComplete)==null||n.call(t)}cancel(){var t,n;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(n=(t=this.options).onCancel)==null||n.call(t)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){var n;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(n=this.driver)==null||n.stop(),t.observe(this)}}function jp(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const ht=e=>e*180/Math.PI,Ls=e=>{const t=ht(Math.atan2(e[1],e[0]));return Ws(t)},Gp={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:Ls,rotateZ:Ls,skewX:e=>ht(Math.atan(e[1])),skewY:e=>ht(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},Ws=e=>(e=e%360,e<0&&(e+=360),e),Ki=Ls,Yi=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),Xi=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),Kp={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Yi,scaleY:Xi,scale:e=>(Yi(e)+Xi(e))/2,rotateX:e=>Ws(ht(Math.atan2(e[6],e[5]))),rotateY:e=>Ws(ht(Math.atan2(-e[2],e[0]))),rotateZ:Ki,rotate:Ki,skewX:e=>ht(Math.atan(e[4])),skewY:e=>ht(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function Bs(e){return e.includes("scale")?1:0}function qs(e,t){if(!e||e==="none")return Bs(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,s;if(n)r=Kp,s=n;else{const u=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=Gp,s=u}if(!s)return Bs(t);const o=r[t],i=s[1].split(",").map(Xp);return typeof o=="function"?o(i):i[o]}const Yp=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return qs(n,t)};function Xp(e){return parseFloat(e.trim())}const Ft=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Lt=new Set(Ft),Zi=e=>e===At||e===B,Zp=new Set(["x","y","z"]),Jp=Ft.filter(e=>!Zp.has(e));function Qp(e){const t=[];return Jp.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const tt={width:({x:e},{paddingLeft:t="0",paddingRight:n="0",boxSizing:r})=>{const s=e.max-e.min;return r==="border-box"?s:s-parseFloat(t)-parseFloat(n)},height:({y:e},{paddingTop:t="0",paddingBottom:n="0",boxSizing:r})=>{const s=e.max-e.min;return r==="border-box"?s:s-parseFloat(t)-parseFloat(n)},top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>qs(t,"x"),y:(e,{transform:t})=>qs(t,"y")};tt.translateX=tt.x,tt.translateY=tt.y;const mt=new Set;let $s=!1,Hs=!1,zs=!1;function Ji(){if(Hs){const e=Array.from(mt).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const s=Qp(r);s.length&&(n.set(r,s),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const s=n.get(r);s&&s.forEach(([o,i])=>{var u;(u=r.getValue(o))==null||u.set(i)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}Hs=!1,$s=!1,mt.forEach(e=>e.complete(zs)),mt.clear()}function Qi(){mt.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Hs=!0)})}function Rp(){zs=!0,Qi(),Ji(),zs=!1}class Us{constructor(t,n,r,s,o,i=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=s,this.element=o,this.isAsync=i}scheduleResolve(){this.state="scheduled",this.isAsync?(mt.add(this),$s||($s=!0,Fe.read(Qi),Fe.resolveKeyframes(Ji))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:s}=this;if(t[0]===null){const o=s==null?void 0:s.get(),i=t[t.length-1];if(o!==void 0)t[0]=o;else if(r&&n){const u=r.readValue(n,i);u!=null&&(t[0]=u)}t[0]===void 0&&(t[0]=i),s&&o===void 0&&s.set(t[0])}jp(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),mt.delete(this)}cancel(){this.state==="scheduled"&&(mt.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const eh=e=>e.startsWith("--");function Ri(e,t,n){eh(t)?e.style.setProperty(t,n):e.style[t]=n}const th={};function eu(e,t){const n=wi(e);return()=>th[t]??n()}const nh=eu(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),tu=eu(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),fn=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,nu={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:fn([0,.65,.55,1]),circOut:fn([.55,0,1,.45]),backIn:fn([.31,.01,.66,-.59]),backOut:fn([.33,1.53,.69,.99])};function ru(e,t){if(e)return typeof e=="function"?tu()?zi(e,t):"ease-out":Ei(e)?fn(e):Array.isArray(e)?e.map(n=>ru(n,t)||nu.easeOut):nu[e]}function rh(e,t,n,{delay:r=0,duration:s=300,repeat:o=0,repeatType:i="loop",ease:u="easeOut",times:l}={},d=void 0){const c={[t]:n};l&&(c.offset=l);const w=ru(u,s);Array.isArray(w)&&(c.easing=w);const f={delay:r,duration:s,easing:Array.isArray(w)?"linear":w,fill:"both",iterations:o+1,direction:i==="reverse"?"alternate":"normal"};return d&&(f.pseudoElement=d),e.animate(c,f)}function su(e){return typeof e=="function"&&"applyToOptions"in e}function sh({type:e,...t}){return su(e)&&tu()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class au extends Fs{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:n,name:r,keyframes:s,pseudoElement:o,allowFlatten:i=!1,finalKeyframe:u,onComplete:l}=t;this.isPseudoElement=!!o,this.allowFlatten=i,this.options=t,ft(typeof t.type!="string",`Mini animate() doesn't support "type" as a string.`,"mini-spring");const d=sh(t);this.animation=rh(n,r,s,d,o),d.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!o){const c=tr(s,this.options,u,this.speed);this.updateMotionValue&&this.updateMotionValue(c),Ri(n,r,c),this.animation.cancel()}l==null||l(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var t,n;(n=(t=this.animation).finish)==null||n.call(t)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var n,r,s;const t=(n=this.options)==null?void 0:n.element;!this.isPseudoElement&&(t!=null&&t.isConnected)&&((s=(r=this.animation).commitStyles)==null||s.call(r))}get duration(){var n,r;const t=((r=(n=this.animation.effect)==null?void 0:n.getComputedTiming)==null?void 0:r.call(n).duration)||0;return He(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+He(t)}get time(){return He(Number(this.animation.currentTime)||0)}set time(t){const n=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=Oe(t),n&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,rangeStart:n,rangeEnd:r,observe:s}){var o;return this.allowFlatten&&((o=this.animation.effect)==null||o.updateTiming({easing:"linear"})),this.animation.onfinish=null,t&&nh()?(this.animation.timeline=t,n&&(this.animation.rangeStart=n),r&&(this.animation.rangeEnd=r),kt):s(this)}}const ou={anticipate:Si,backInOut:Ni,circInOut:Ci};function ah(e){return e in ou}function oh(e){typeof e.ease=="string"&&ah(e.ease)&&(e.ease=ou[e.ease])}const js=10;class ih extends au{constructor(t){oh(t),Gi(t),super(t),t.startTime!==void 0&&t.autoplay!==!1&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:r,onComplete:s,element:o,...i}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const u=new nr({...i,autoplay:!1}),l=Math.max(js,_e.now()-this.startTime),d=Qe(0,js,l-js),c=u.sample(l).value,{name:w}=this.options;o&&w&&Ri(o,w,c),n.setWithVelocity(u.sample(Math.max(0,l-d)).value,c,d),u.stop()}}const iu=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(ze.test(e)||e==="0")&&!e.startsWith("url("));function uh(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function lh(e,t,n,r){const s=e[0];if(s===null)return!1;if(t==="display"||t==="visibility")return!0;const o=e[e.length-1],i=iu(s,t),u=iu(o,t);return on(i===u,`You are trying to animate ${t} from "${s}" to "${o}". "${i?o:s}" is not an animatable value.`,"value-not-animatable"),!i||!u?!1:uh(e)||(n==="spring"||su(n))&&r}function Gs(e){e.duration=0,e.type="keyframes"}const uu=new Set(["opacity","clipPath","filter","transform"]),ch=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function dh(e){for(let t=0;t<e.length;t++)if(typeof e[t]=="string"&&ch.test(e[t]))return!0;return!1}const wh=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),fh=wi(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function ph(e){var w;const{motionValue:t,name:n,repeatDelay:r,repeatType:s,damping:o,type:i,keyframes:u}=e;if(!(((w=t==null?void 0:t.owner)==null?void 0:w.current)instanceof HTMLElement))return!1;const{onUpdate:d,transformTemplate:c}=t.owner.getProps();return fh()&&n&&(uu.has(n)||wh.has(n)&&dh(u))&&(n!=="transform"||!c)&&!d&&!r&&s!=="mirror"&&o!==0&&i!=="inertia"}const hh=40;class mh extends Fs{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:s=0,repeatDelay:o=0,repeatType:i="loop",keyframes:u,name:l,motionValue:d,element:c,...w}){var b;super(),this.stop=()=>{var g,v;this._animation&&(this._animation.stop(),(g=this.stopTimeline)==null||g.call(this)),(v=this.keyframeResolver)==null||v.cancel()},this.createdAt=_e.now();const f={autoplay:t,delay:n,type:r,repeat:s,repeatDelay:o,repeatType:i,name:l,motionValue:d,element:c,...w},h=(c==null?void 0:c.KeyframeResolver)||Us;this.keyframeResolver=new h(u,(g,v,N)=>this.onKeyframesResolved(g,v,f,!N),l,d,c),(b=this.keyframeResolver)==null||b.scheduleResolve()}onKeyframesResolved(t,n,r,s){var N,y;this.keyframeResolver=void 0;const{name:o,type:i,velocity:u,delay:l,isHandoff:d,onUpdate:c}=r;this.resolvedAt=_e.now();let w=!0;lh(t,o,i,u)||(w=!1,(Re.instantAnimations||!l)&&(c==null||c(tr(t,r,n))),t[0]=t[t.length-1],Gs(r),r.repeat=0);const h={startTime:s?this.resolvedAt?this.resolvedAt-this.createdAt>hh?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:t},b=w&&!d&&ph(h),g=(y=(N=h.motionValue)==null?void 0:N.owner)==null?void 0:y.current;let v;if(b)try{v=new ih({...h,element:g})}catch{v=new nr(h)}else v=new nr(h);v.finished.then(()=>{this.notifyFinished()}).catch(kt),this.pendingTimeline&&(this.stopTimeline=v.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=v}get finished(){return this._animation?this.animation.finished:this._finished}then(t,n){return this.finished.finally(t).then(()=>{})}get animation(){var t;return this._animation||((t=this.keyframeResolver)==null||t.resume(),Rp()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var t;this._animation&&this.animation.cancel(),(t=this.keyframeResolver)==null||t.cancel()}}function lu(e,t,n,r=0,s=1){const o=Array.from(e).sort((d,c)=>d.sortNodePosition(c)).indexOf(t),i=e.size,u=(i-1)*r;return typeof n=="function"?n(o,i):s===1?o*r:u-o*r}const gh=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function bh(e){const t=gh.exec(e);if(!t)return[,];const[,n,r,s]=t;return[`--${n??r}`,s]}const yh=4;function cu(e,t,n=1){ft(n<=yh,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[r,s]=bh(e);if(!r)return;const o=window.getComputedStyle(t).getPropertyValue(r);if(o){const i=o.trim();return ci(i)?parseFloat(i):i}return Ss(s)?cu(s,t,n+1):s}const vh={type:"spring",stiffness:500,damping:25,restSpeed:10},xh=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),Nh={type:"keyframes",duration:.8},Sh={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Ch=(e,{keyframes:t})=>t.length>2?Nh:Lt.has(e)?e.startsWith("scale")?xh(t[1]):vh:Sh;function du(e,t){if(e!=null&&e.inherit&&t){const{inherit:n,...r}=e;return{...t,...r}}return e}function wu(e,t){const n=(e==null?void 0:e[t])??(e==null?void 0:e.default)??e;return n!==e?du(n,e):n}const Th=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function Eh(e){for(const t in e)if(!Th.has(t))return!0;return!1}const Mh=(e,t,n,r={},s,o)=>i=>{const u=wu(r,e)||{},l=u.delay||r.delay||0;let{elapsed:d=0}=r;d=d-Oe(l);const c={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...u,delay:-d,onUpdate:f=>{t.set(f),u.onUpdate&&u.onUpdate(f)},onComplete:()=>{i(),u.onComplete&&u.onComplete()},name:e,motionValue:t,element:o?void 0:s};Eh(u)||Object.assign(c,Ch(e,c)),c.duration&&(c.duration=Oe(c.duration)),c.repeatDelay&&(c.repeatDelay=Oe(c.repeatDelay)),c.from!==void 0&&(c.keyframes[0]=c.from);let w=!1;if((c.type===!1||c.duration===0&&!c.repeatDelay)&&(Gs(c),c.delay===0&&(w=!0)),(Re.instantAnimations||Re.skipAnimations||s!=null&&s.shouldSkipAnimations)&&(w=!0,Gs(c),c.delay=0),c.allowFlatten=!u.type&&!u.ease,w&&!o&&t.get()!==void 0){const f=tr(c.keyframes,u);if(f!==void 0){Fe.update(()=>{c.onUpdate(f),c.onComplete()});return}}return u.isSync?new nr(c):new mh(c)};function fu(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function Ks(e,t,n,r){if(typeof t=="function"){const[s,o]=fu(r);t=t(n!==void 0?n:e.custom,s,o)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[s,o]=fu(r);t=t(n!==void 0?n:e.custom,s,o)}return t}function gt(e,t,n){const r=e.getProps();return Ks(r,t,n!==void 0?n:r.custom,e)}const pu=new Set(["width","height","top","left","right","bottom",...Ft]),hu=30,Ih=e=>!isNaN(parseFloat(e));class Dh{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{var o;const s=_e.now();if(this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&((o=this.events.change)==null||o.notify(this.current),this.dependents))for(const i of this.dependents)i.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=_e.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=Ih(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return process.env.NODE_ENV!=="production"&&gi(!1,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new pi);const r=this.events[t].add(n);return t==="change"?()=>{r(),Fe.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var t;(t=this.events.change)==null||t.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=_e.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>hu)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,hu);return hi(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){var t,n;(t=this.dependents)==null||t.clear(),(n=this.events.destroy)==null||n.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function rr(e,t){return new Dh(e,t)}const Ys=e=>Array.isArray(e);function kh(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,rr(n))}function Ah(e){return Ys(e)?e[e.length-1]||0:e}function _h(e,t){const n=gt(e,t);let{transitionEnd:r={},transition:s={},...o}=n||{};o={...o,...r};for(const i in o){const u=Ah(o[i]);kh(e,i,u)}}const ge=e=>!!(e&&e.getVelocity);function Ph(e){return!!(ge(e)&&e.add)}function Vh(e,t){const n=e.getValue("willChange");if(Ph(n))return n.add(t);if(!n&&Re.WillChange){const r=new Re.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function Xs(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const mu="data-"+Xs("framerAppearId");function Oh(e){return e.props[mu]}function Fh({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function gu(e,t,{delay:n=0,transitionOverride:r,type:s}={}){let{transition:o,transitionEnd:i,...u}=t;const l=e.getDefaultTransition();o=o?du(o,l):l;const d=o==null?void 0:o.reduceMotion;r&&(o=r);const c=[],w=s&&e.animationState&&e.animationState.getState()[s];for(const f in u){const h=e.getValue(f,e.latestValues[f]??null),b=u[f];if(b===void 0||w&&Fh(w,f))continue;const g={delay:n,...wu(o||{},f)},v=h.get();if(v!==void 0&&!h.isAnimating()&&!Array.isArray(b)&&b===v&&!g.velocity){Fe.update(()=>h.set(b));continue}let N=!1;if(window.MotionHandoffAnimation){const E=Oh(e);if(E){const x=window.MotionHandoffAnimation(E,f,Fe);x!==null&&(g.startTime=x,N=!0)}}Vh(e,f);const y=d??e.shouldReduceMotion;h.start(Mh(f,h,b,y&&pu.has(f)?{type:!1}:g,e,N));const C=h.animation;C&&c.push(C)}if(i){const f=()=>Fe.update(()=>{i&&_h(e,i)});c.length?Promise.all(c).then(f):f()}return c}function Zs(e,t,n={}){var l;const r=gt(e,t,n.type==="exit"?(l=e.presenceContext)==null?void 0:l.custom:void 0);let{transition:s=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(s=n.transitionOverride);const o=r?()=>Promise.all(gu(e,r,n)):()=>Promise.resolve(),i=e.variantChildren&&e.variantChildren.size?(d=0)=>{const{delayChildren:c=0,staggerChildren:w,staggerDirection:f}=s;return Lh(e,t,d,c,w,f,n)}:()=>Promise.resolve(),{when:u}=s;if(u){const[d,c]=u==="beforeChildren"?[o,i]:[i,o];return d().then(()=>c())}else return Promise.all([o(),i(n.delay)])}function Lh(e,t,n=0,r=0,s=0,o=1,i){const u=[];for(const l of e.variantChildren)l.notify("AnimationStart",t),u.push(Zs(l,t,{...i,delay:n+(typeof r=="function"?0:r)+lu(e.variantChildren,l,r,s,o)}).then(()=>l.notify("AnimationComplete",t)));return Promise.all(u)}function Wh(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const s=t.map(o=>Zs(e,o,n));r=Promise.all(s)}else if(typeof t=="string")r=Zs(e,t,n);else{const s=typeof t=="function"?gt(e,t,n.custom):t;r=Promise.all(gu(e,s,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}const Bh={test:e=>e==="auto",parse:e=>e},bu=e=>t=>t.test(e),yu=[At,B,_t,et,up,ip,Bh],vu=e=>yu.find(bu(e));function qh(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||di(e):!0}const $h=new Set(["brightness","contrast","saturate","opacity"]);function Hh(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(Cs)||[];if(!r)return e;const s=n.replace(r,"");let o=$h.has(t)?1:0;return r!==n&&(o*=100),t+"("+o+s+")"}const zh=/\b([a-z-]*)\(.*?\)/gu,Js={...ze,getAnimatableNone:e=>{const t=e.match(zh);return t?t.map(Hh).join(" "):e}},Qs={...ze,getAnimatableNone:e=>{const t=ze.parse(e);return ze.createTransformer(e)(t.map(r=>typeof r=="number"?0:typeof r=="object"?{...r,alpha:1}:r))}},xu={...At,transform:Math.round},Rs={borderWidth:B,borderTopWidth:B,borderRightWidth:B,borderBottomWidth:B,borderLeftWidth:B,borderRadius:B,borderTopLeftRadius:B,borderTopRightRadius:B,borderBottomRightRadius:B,borderBottomLeftRadius:B,width:B,maxWidth:B,height:B,maxHeight:B,top:B,right:B,bottom:B,left:B,inset:B,insetBlock:B,insetBlockStart:B,insetBlockEnd:B,insetInline:B,insetInlineStart:B,insetInlineEnd:B,padding:B,paddingTop:B,paddingRight:B,paddingBottom:B,paddingLeft:B,paddingBlock:B,paddingBlockStart:B,paddingBlockEnd:B,paddingInline:B,paddingInlineStart:B,paddingInlineEnd:B,margin:B,marginTop:B,marginRight:B,marginBottom:B,marginLeft:B,marginBlock:B,marginBlockStart:B,marginBlockEnd:B,marginInline:B,marginInlineStart:B,marginInlineEnd:B,fontSize:B,backgroundPositionX:B,backgroundPositionY:B,...{rotate:et,rotateX:et,rotateY:et,rotateZ:et,scale:Jn,scaleX:Jn,scaleY:Jn,scaleZ:Jn,skew:et,skewX:et,skewY:et,distance:B,translateX:B,translateY:B,translateZ:B,x:B,y:B,z:B,perspective:B,transformPerspective:B,opacity:ln,originX:Vi,originY:Vi,originZ:B},zIndex:xu,fillOpacity:ln,strokeOpacity:ln,numOctaves:xu},Uh={...Rs,color:de,backgroundColor:de,outlineColor:de,fill:de,stroke:de,borderColor:de,borderTopColor:de,borderRightColor:de,borderBottomColor:de,borderLeftColor:de,filter:Js,WebkitFilter:Js,mask:Qs,WebkitMask:Qs},Nu=e=>Uh[e],jh=new Set([Js,Qs]);function Su(e,t){let n=Nu(e);return jh.has(n)||(n=ze),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const Gh=new Set(["auto","none","0"]);function Kh(e,t,n){let r=0,s;for(;r<e.length&&!s;){const o=e[r];typeof o=="string"&&!Gh.has(o)&&Vt(o).values.length&&(s=e[r]),r++}if(s&&n)for(const o of t)e[o]=Su(n,s)}class Yh extends Us{constructor(t,n,r,s,o){super(t,n,r,s,o,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let c=0;c<t.length;c++){let w=t[c];if(typeof w=="string"&&(w=w.trim(),Ss(w))){const f=cu(w,n.current);f!==void 0&&(t[c]=f),c===t.length-1&&(this.finalKeyframe=w)}}if(this.resolveNoneKeyframes(),!pu.has(r)||t.length!==2)return;const[s,o]=t,i=vu(s),u=vu(o),l=_i(s),d=_i(o);if(l!==d&&tt[r]){this.needsMeasurement=!0;return}if(i!==u)if(Zi(i)&&Zi(u))for(let c=0;c<t.length;c++){const w=t[c];typeof w=="string"&&(t[c]=parseFloat(w))}else tt[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let s=0;s<t.length;s++)(t[s]===null||qh(t[s]))&&r.push(s);r.length&&Kh(t,r,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:r}=this;if(!t||!t.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=tt[r](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const s=n[n.length-1];s!==void 0&&t.getValue(r,s).jump(s,!1)}measureEndState(){var u;const{element:t,name:n,unresolvedKeyframes:r}=this;if(!t||!t.current)return;const s=t.getValue(n);s&&s.jump(this.measuredOrigin,!1);const o=r.length-1,i=r[o];r[o]=tt[n](t.measureViewportBox(),window.getComputedStyle(t.current)),i!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=i),(u=this.removedTransforms)!=null&&u.length&&this.removedTransforms.forEach(([l,d])=>{t.getValue(l).set(d)}),this.resolveNoneKeyframes()}}function Xh(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e=="string"){let r=document;const s=(n==null?void 0:n[e])??r.querySelectorAll(e);return s?Array.from(s):[]}return Array.from(e).filter(r=>r!=null)}const Cu=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function sr(e){return Hf(e)&&"offsetHeight"in e&&!("ownerSVGElement"in e)}const{schedule:Zh}=Di(queueMicrotask,!1),Jh={y:!1};function Qh(){return Jh.y}function Tu(e,t){const n=Xh(e),r=new AbortController,s={passive:!0,...t,signal:r.signal};return[n,s,()=>r.abort()]}function Rh(e){return!(e.pointerType==="touch"||Qh())}function em(e,t,n={}){const[r,s,o]=Tu(e,n);return r.forEach(i=>{let u=!1,l=!1,d;const c=()=>{i.removeEventListener("pointerleave",b)},w=v=>{d&&(d(v),d=void 0),c()},f=v=>{u=!1,window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",f),l&&(l=!1,w(v))},h=()=>{u=!0,window.addEventListener("pointerup",f,s),window.addEventListener("pointercancel",f,s)},b=v=>{if(v.pointerType!=="touch"){if(u){l=!0;return}w(v)}},g=v=>{if(!Rh(v))return;l=!1;const N=t(i,v);typeof N=="function"&&(d=N,i.addEventListener("pointerleave",b,s))};i.addEventListener("pointerenter",g,s),i.addEventListener("pointerdown",h,s)}),o}const Eu=(e,t)=>t?e===t?!0:Eu(e,t.parentElement):!1,tm=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,nm=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function rm(e){return nm.has(e.tagName)||e.isContentEditable===!0}const ar=new WeakSet;function Mu(e){return t=>{t.key==="Enter"&&e(t)}}function ea(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const sm=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=Mu(()=>{if(ar.has(n))return;ea(n,"down");const s=Mu(()=>{ea(n,"up")}),o=()=>ea(n,"cancel");n.addEventListener("keyup",s,t),n.addEventListener("blur",o,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function Iu(e){return tm(e)&&!0}const Du=new WeakSet;function am(e,t,n={}){const[r,s,o]=Tu(e,n),i=u=>{const l=u.currentTarget;if(!Iu(u)||Du.has(u))return;ar.add(l),n.stopPropagation&&Du.add(u);const d=t(l,u),c=(h,b)=>{window.removeEventListener("pointerup",w),window.removeEventListener("pointercancel",f),ar.has(l)&&ar.delete(l),Iu(h)&&typeof d=="function"&&d(h,{success:b})},w=h=>{c(h,l===window||l===document||n.useGlobalTarget||Eu(l,h.target))},f=h=>{c(h,!1)};window.addEventListener("pointerup",w,s),window.addEventListener("pointercancel",f,s)};return r.forEach(u=>{(n.useGlobalTarget?window:u).addEventListener("pointerdown",i,s),sr(u)&&(u.addEventListener("focus",d=>sm(d,s)),!rm(u)&&!u.hasAttribute("tabindex")&&(u.tabIndex=0))}),o}const om=[...yu,de,ze],im=e=>om.find(bu(e)),ku=()=>({min:0,max:0}),Au=()=>({x:ku(),y:ku()}),um=new WeakMap;function or(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function pn(e){return typeof e=="string"||Array.isArray(e)}const ta=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],na=["initial",...ta];function ir(e){return or(e.animate)||na.some(t=>pn(e[t]))}function _u(e){return!!(ir(e)||e.variants)}function lm(e,t,n){for(const r in t){const s=t[r],o=n[r];if(ge(s))e.addValue(r,s);else if(ge(o))e.addValue(r,rr(s,{owner:e}));else if(o!==s)if(e.hasValue(r)){const i=e.getValue(r);i.liveStyle===!0?i.jump(s):i.hasAnimated||i.set(s)}else{const i=e.getStaticValue(r);e.addValue(r,rr(i!==void 0?i:s,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const ra={current:null},Pu={current:!1},cm=typeof window<"u";function dm(){if(Pu.current=!0,!!cm)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>ra.current=e.matches;e.addEventListener("change",t),t()}else ra.current=!1}const Vu=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let ur={};function Ou(e){ur=e}function wm(){return ur}class fm{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:s,skipAnimations:o,blockInitialAnimation:i,visualState:u},l={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=Us,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const h=_e.now();this.renderScheduledAt<h&&(this.renderScheduledAt=h,Fe.render(this.render,!1,!0))};const{latestValues:d,renderState:c}=u;this.latestValues=d,this.baseTarget={...d},this.initialValues=n.initial?{...d}:{},this.renderState=c,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=s,this.skipAnimationsConfig=o,this.options=l,this.blockInitialAnimation=!!i,this.isControllingVariants=ir(n),this.isVariantNode=_u(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:w,...f}=this.scrapeMotionValuesFromProps(n,{},this);for(const h in f){const b=f[h];d[h]!==void 0&&ge(b)&&b.set(d[h])}}mount(t){var n,r;if(this.hasBeenMounted)for(const s in this.initialValues)(n=this.values.get(s))==null||n.jump(this.initialValues[s]),this.latestValues[s]=this.initialValues[s];this.current=t,um.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((s,o)=>this.bindToMotionValue(o,s)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(Pu.current||dm(),this.shouldReduceMotion=ra.current),process.env.NODE_ENV!=="production"&&gi(this.shouldReduceMotion!==!0,"You have Reduced Motion enabled on your device. Animations may not appear as expected.","reduced-motion-disabled"),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,(r=this.parent)==null||r.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){var t;this.projection&&this.projection.unmount(),Ns(this.notifyUpdate),Ns(this.render),this.valueSubscriptions.forEach(n=>n()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(t=this.parent)==null||t.removeChild(this);for(const n in this.events)this.events[n].clear();for(const n in this.features){const r=this.features[n];r&&(r.unmount(),r.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,n){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),n.accelerate&&uu.has(t)&&this.current instanceof HTMLElement){const{factory:i,keyframes:u,times:l,ease:d,duration:c}=n.accelerate,w=new au({element:this.current,name:t,keyframes:u,times:l,ease:d,duration:Oe(c)}),f=i(w);this.valueSubscriptions.set(t,()=>{f(),w.cancel()});return}const r=Lt.has(t);r&&this.onBindTransform&&this.onBindTransform();const s=n.on("change",i=>{this.latestValues[t]=i,this.props.onUpdate&&Fe.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let o;typeof window<"u"&&window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{s(),o&&o(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in ur){const n=ur[t];if(!n)continue;const{isEnabled:r,Feature:s}=n;if(!this.features[t]&&s&&r(this.props)&&(this.features[t]=new s(this)),this.features[t]){const o=this.features[t];o.isMounted?o.update():(o.mount(),o.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Au()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<Vu.length;r++){const s=Vu[r];this.propEventSubscriptions[s]&&(this.propEventSubscriptions[s](),delete this.propEventSubscriptions[s]);const o="on"+s,i=t[o];i&&(this.propEventSubscriptions[s]=this.on(s,i))}this.prevMotionValues=lm(this,this.scrapeMotionValuesFromProps(t,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=rr(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){let r=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return r!=null&&(typeof r=="string"&&(ci(r)||di(r))?r=parseFloat(r):!im(r)&&ze.test(n)&&(r=Su(t,n)),this.setBaseTarget(t,ge(r)?r.get():r)),ge(r)?r.get():r}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var o;const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const i=Ks(this.props,n,(o=this.presenceContext)==null?void 0:o.custom);i&&(r=i[t])}if(n&&r!==void 0)return r;const s=this.getBaseTargetFromProps(this.props,t);return s!==void 0&&!ge(s)?s:this.initialValues[t]!==void 0&&r===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new pi),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){Zh.render(this.render)}}class Fu extends fm{constructor(){super(...arguments),this.KeyframeResolver=Yh}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){const r=t.style;return r?r[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;ge(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class Wt{constructor(t){this.isMounted=!1,this.node=t}update(){}}function pm({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function hm(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function mm(e,t){return pm(hm(e.getBoundingClientRect(),t))}const gm={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},bm=Ft.length;function ym(e,t,n){let r="",s=!0;for(let o=0;o<bm;o++){const i=Ft[o],u=e[i];if(u===void 0)continue;let l=!0;if(typeof u=="number")l=u===(i.startsWith("scale")?1:0);else{const d=parseFloat(u);l=i.startsWith("scale")?d===1:d===0}if(!l||n){const d=Cu(u,Rs[i]);if(!l){s=!1;const c=gm[i]||i;r+=`${c}(${d}) `}n&&(t[i]=d)}}return r=r.trim(),n?r=n(t,s?"":r):s&&(r="none"),r}function sa(e,t,n){const{style:r,vars:s,transformOrigin:o}=e;let i=!1,u=!1;for(const l in t){const d=t[l];if(Lt.has(l)){i=!0;continue}else if(Ai(l)){s[l]=d;continue}else{const c=Cu(d,Rs[l]);l.startsWith("origin")?(u=!0,o[l]=c):r[l]=c}}if(t.transform||(i||n?r.transform=ym(t,e.transform,n):r.transform&&(r.transform="none")),u){const{originX:l="50%",originY:d="50%",originZ:c=0}=o;r.transformOrigin=`${l} ${d} ${c}`}}function Lu(e,{style:t,vars:n},r,s){const o=e.style;let i;for(i in t)o[i]=t[i];s==null||s.applyProjectionStyles(o,r);for(i in n)o.setProperty(i,n[i])}function Wu(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const hn={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(B.test(e))e=parseFloat(e);else return e;const n=Wu(e,t.target.x),r=Wu(e,t.target.y);return`${n}% ${r}%`}},vm={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,s=ze.parse(e);if(s.length>5)return r;const o=ze.createTransformer(e),i=typeof s[0]!="number"?1:0,u=n.x.scale*t.x,l=n.y.scale*t.y;s[0+i]/=u,s[1+i]/=l;const d=wn(u,l,.5);return typeof s[2+i]=="number"&&(s[2+i]/=d),typeof s[3+i]=="number"&&(s[3+i]/=d),o(s)}},xm={borderRadius:{...hn,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:hn,borderTopRightRadius:hn,borderBottomLeftRadius:hn,borderBottomRightRadius:hn,boxShadow:vm};function Bu(e,{layout:t,layoutId:n}){return Lt.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!xm[e]||e==="opacity")}function aa(e,t,n){var i;const r=e.style,s=t==null?void 0:t.style,o={};if(!r)return o;for(const u in r)(ge(r[u])||s&&ge(s[u])||Bu(u,e)||((i=n==null?void 0:n.getValue(u))==null?void 0:i.liveStyle)!==void 0)&&(o[u]=r[u]);return o}function Nm(e){return window.getComputedStyle(e)}class Sm extends Fu{constructor(){super(...arguments),this.type="html",this.renderInstance=Lu}readValueFromInstance(t,n){var r;if(Lt.has(n))return(r=this.projection)!=null&&r.isProjecting?Bs(n):Yp(t,n);{const s=Nm(t),o=(Ai(n)?s.getPropertyValue(n):s[n])||0;return typeof o=="string"?o.trim():o}}measureInstanceViewportBox(t,{transformPagePoint:n}){return mm(t,n)}build(t,n,r){sa(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return aa(t,n,r)}}const Cm={offset:"stroke-dashoffset",array:"stroke-dasharray"},Tm={offset:"strokeDashoffset",array:"strokeDasharray"};function Em(e,t,n=1,r=0,s=!0){e.pathLength=1;const o=s?Cm:Tm;e[o.offset]=`${-r}`,e[o.array]=`${t} ${n}`}const Mm=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function qu(e,{attrX:t,attrY:n,attrScale:r,pathLength:s,pathSpacing:o=1,pathOffset:i=0,...u},l,d,c){if(sa(e,u,d),l){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:w,style:f}=e;w.transform&&(f.transform=w.transform,delete w.transform),(f.transform||w.transformOrigin)&&(f.transformOrigin=w.transformOrigin??"50% 50%",delete w.transformOrigin),f.transform&&(f.transformBox=(c==null?void 0:c.transformBox)??"fill-box",delete w.transformBox);for(const h of Mm)w[h]!==void 0&&(f[h]=w[h],delete w[h]);t!==void 0&&(w.x=t),n!==void 0&&(w.y=n),r!==void 0&&(w.scale=r),s!==void 0&&Em(w,s,o,i,!1)}const $u=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),Hu=e=>typeof e=="string"&&e.toLowerCase()==="svg";function Im(e,t,n,r){Lu(e,t,void 0,r);for(const s in t.attrs)e.setAttribute($u.has(s)?s:Xs(s),t.attrs[s])}function zu(e,t,n){const r=aa(e,t,n);for(const s in e)if(ge(e[s])||ge(t[s])){const o=Ft.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;r[o]=e[s]}return r}class Dm extends Fu{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Au}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Lt.has(n)){const r=Nu(n);return r&&r.default||0}return n=$u.has(n)?n:Xs(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return zu(t,n,r)}build(t,n,r){qu(t,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(t,n,r,s){Im(t,n,r,s)}mount(t){this.isSVGTag=Hu(t.tagName),super.mount(t)}}const km=na.length;function Uu(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?Uu(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<km;n++){const r=na[n],s=e.props[r];(pn(s)||s===!1)&&(t[r]=s)}return t}function ju(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}const Am=[...ta].reverse(),_m=ta.length;function Pm(e){return t=>Promise.all(t.map(({animation:n,options:r})=>Wh(e,n,r)))}function Vm(e){let t=Pm(e),n=Gu(),r=!0,s=!1;const o=d=>(c,w)=>{var h;const f=gt(e,w,d==="exit"?(h=e.presenceContext)==null?void 0:h.custom:void 0);if(f){const{transition:b,transitionEnd:g,...v}=f;c={...c,...v,...g}}return c};function i(d){t=d(e)}function u(d){const{props:c}=e,w=Uu(e.parent)||{},f=[],h=new Set;let b={},g=1/0;for(let N=0;N<_m;N++){const y=Am[N],C=n[y],E=c[y]!==void 0?c[y]:w[y],x=pn(E),D=y===d?C.isActive:null;D===!1&&(g=N);let T=E===w[y]&&E!==c[y]&&x;if(T&&(r||s)&&e.manuallyAnimateOnMount&&(T=!1),C.protectedKeys={...b},!C.isActive&&D===null||!E&&!C.prevProp||or(E)||typeof E=="boolean")continue;if(y==="exit"&&C.isActive&&D!==!0){C.prevResolvedValues&&(b={...b,...C.prevResolvedValues});continue}const M=Om(C.prevProp,E);let I=M||y===d&&C.isActive&&!T&&x||N>g&&x,_=!1;const P=Array.isArray(E)?E:[E];let A=P.reduce(o(y),{});D===!1&&(A={});const{prevResolvedValues:O={}}=C,F={...O,...A},V=H=>{I=!0,h.has(H)&&(_=!0,h.delete(H)),C.needsAnimating[H]=!0;const q=e.getValue(H);q&&(q.liveStyle=!1)};for(const H in F){const q=A[H],Z=O[H];if(b.hasOwnProperty(H))continue;let z=!1;Ys(q)&&Ys(Z)?z=!ju(q,Z):z=q!==Z,z?q!=null?V(H):h.add(H):q!==void 0&&h.has(H)?V(H):C.protectedKeys[H]=!0}C.prevProp=E,C.prevResolvedValues=A,C.isActive&&(b={...b,...A}),(r||s)&&e.blockInitialAnimation&&(I=!1);const L=T&&M;I&&(!L||_)&&f.push(...P.map(H=>{const q={type:y};if(typeof H=="string"&&(r||s)&&!L&&e.manuallyAnimateOnMount&&e.parent){const{parent:Z}=e,z=gt(Z,H);if(Z.enteringChildren&&z){const{delayChildren:J}=z.transition||{};q.delay=lu(Z.enteringChildren,e,J)}}return{animation:H,options:q}}))}if(h.size){const N={};if(typeof c.initial!="boolean"){const y=gt(e,Array.isArray(c.initial)?c.initial[0]:c.initial);y&&y.transition&&(N.transition=y.transition)}h.forEach(y=>{const C=e.getBaseTarget(y),E=e.getValue(y);E&&(E.liveStyle=!0),N[y]=C??null}),f.push({animation:N})}let v=!!f.length;return r&&(c.initial===!1||c.initial===c.animate)&&!e.manuallyAnimateOnMount&&(v=!1),r=!1,s=!1,v?t(f):Promise.resolve()}function l(d,c){var f;if(n[d].isActive===c)return Promise.resolve();(f=e.variantChildren)==null||f.forEach(h=>{var b;return(b=h.animationState)==null?void 0:b.setActive(d,c)}),n[d].isActive=c;const w=u(d);for(const h in n)n[h].protectedKeys={};return w}return{animateChanges:u,setActive:l,setAnimateFunction:i,getState:()=>n,reset:()=>{n=Gu(),s=!0}}}function Om(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!ju(t,e):!1}function bt(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Gu(){return{animate:bt(!0),whileInView:bt(),whileHover:bt(),whileTap:bt(),whileDrag:bt(),whileFocus:bt(),exit:bt()}}function Ku(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function Fm(e){return ge(e)?e.get():e}const oa=p.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function Yu(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Lm(...e){return t=>{let n=!1;const r=e.map(s=>{const o=Yu(s,t);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let s=0;s<r.length;s++){const o=r[s];typeof o=="function"?o():Yu(e[s],null)}}}}function Wm(...e){return S.useCallback(Lm(...e),e)}class Bm extends S.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(sr(n)&&t.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const r=n.offsetParent,s=sr(r)&&r.offsetWidth||0,o=sr(r)&&r.offsetHeight||0,i=getComputedStyle(n),u=this.props.sizeRef.current;u.height=parseFloat(i.height),u.width=parseFloat(i.width),u.top=n.offsetTop,u.left=n.offsetLeft,u.right=s-u.width-u.left,u.bottom=o-u.height-u.top}return null}componentDidUpdate(){}render(){return this.props.children}}function qm({children:e,isPresent:t,anchorX:n,anchorY:r,root:s,pop:o}){var f;const i=p.useId(),u=p.useRef(null),l=p.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0}),{nonce:d}=p.useContext(oa),c=((f=e.props)==null?void 0:f.ref)??(e==null?void 0:e.ref),w=Wm(u,c);return p.useInsertionEffect(()=>{const{width:h,height:b,top:g,left:v,right:N,bottom:y}=l.current;if(t||o===!1||!u.current||!h||!b)return;const C=n==="left"?`left: ${v}`:`right: ${N}`,E=r==="bottom"?`bottom: ${y}`:`top: ${g}`;u.current.dataset.motionPopId=i;const x=document.createElement("style");d&&(x.nonce=d);const D=s??document.head;return D.appendChild(x),x.sheet&&x.sheet.insertRule(`
|
|
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(no,{item:r,dir:t})})},s))})})},no=({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})]}),Rd=e=>{const[t,n]=f.useState(()=>window.innerWidth<=e);return f.useEffect(()=>{const r=()=>{n(window.innerWidth<=e)};return window.addEventListener("resize",r),()=>{window.removeEventListener("resize",r)}},[e]),t};function ew({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:p}=l;switch(p){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 tw=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})},nw=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})},rw=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})},sw=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})},Pe=e=>{const{icon:t,className:n,...r}=e;return a.jsx("span",{...r,className:m(t,n),role:"presentation","aria-label":t})},aw=({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-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-1.5 wu-aspect-auto focus:wu-outline-none focus-visible:wu-bg-white/10 wu-switcher-logo",tabIndex:-1,href:i,children:a.jsx(Pe,{icon:"wc-logo",className:"wu-text-[23px] 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"},ow=({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})]})},iw={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"},uw=({product:e,currentProduct:t,activeProductName:n,dir:r,focusItem:s,setFocusItem:o})=>{const[i,u]=f.useState(e.name===t),l=e.name===n,d=e.name===t,c=!e.active,w="#1b3380",p="#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:p;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 x=N.currentTarget.querySelector("a");x&&x.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,iw[e.icon||""]),"aria-hidden":!0}),a.jsx("span",{className:m(b),children:e.name})]})]},e.name)},lw=({category:e,currentProduct:t,activeProductName:n,dir:r="ltr",focusItem:s,setFocusItem:o,borderColorLocked:i="#f5a300"})=>{const{products:u=[],active:l}=e,d=f.useMemo(()=>u.filter(b=>b.active).sort((b,g)=>(b.order||100)-(g.order||100)),[u]),c=f.useMemo(()=>u.filter(b=>!b.active),[u]),[w,p]=f.useState(i),h=b=>b.map((g,v)=>a.jsx(uw,{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:()=>p("#f5a300"),onMouseOut:()=>p(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"})})]})},ro=({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]=f.useState(window.innerWidth>768);return f.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(ow,{category:g,dir:t,openCategory:s}),a.jsx("ul",{className:m(se.productList,t==="rtl"&&se.rtlProductList),dir:t,children:a.jsx(lw,{category:g,dir:t,activeProductName:l,currentProduct:g.name,focusItem:d,setFocusItem:c,borderColorLocked:w})})]},g.name))})},cw=({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")})]})}),dw=({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"}`})]})},so=({productCategories:e,activeProductName:t,activeProductColor:n={base:"#1b87e6",hover:"#54A5EC"},dir:r,homeLink:s,expandAll:o})=>{const i=f.useRef(null),u=f.useRef(null),l=f.useRef(null),d=f.useRef(null),[c,w]=f.useState(!1),[p,h]=f.useState(null),[b,g]=f.useState(n.base),[v,N]=f.useState(""),[x,C]=f.useState(!1),E=Rd(768);Ur([u,i],()=>{w(!1),h(null)}),Ur([l,d,u],()=>{C(!1),w(!1),h(null)}),f.useEffect(()=>{const T=M=>{M.key==="Escape"&&w(!1)};return document.addEventListener("keydown",T),()=>{document.removeEventListener("keydown",T)}},[c]),f.useEffect(()=>g(n.base),[n.base]);const y=T=>{T.preventDefault(),T.stopPropagation(),w(M=>{const k=!M;return k||h(null),k})},I=(T,M)=>{ew({productCategories:e,openCategory:p,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(dw,{dir:r,isProductButtonShow:x,smallScreenToggleButtonRef:d,setDropdownOpen:w,setIsProductButtonShow:C}),a.jsx(cw,{isProductButtonShow:x,isDropdownOpen:c,activeProductColor:n,activeProductBgColor:b,activeProductName:t,handleDropdownToggle:y,smallScreenButtonRef:l,handleKeyDown:I,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(ro,{activeProductName:t,focusItem:v,setFocusItem:N,handleKeyDown:I,isDropdownOpen:c,openCategory:p,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(aw,{activeProductName:t,dir:r,homeLink:s,buttonRef:i,handleDropdownToggle:y,handleKeyDown:I,isDropdownOpen:c}),a.jsx(ro,{activeProductName:t,focusItem:v,setFocusItem:N,handleKeyDown:I,isDropdownOpen:c,openCategory:p,productCategories:e,setOpenCategory:h,dropdownRef:u,expandAll:o,dir:r})]})})},ao=({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})}),ww=({className:e,placeholder:t="Search surveys, folders or tools",defaultCollapsed:n=!0,onSearch:r,...s})=>{const[o,i]=f.useState(n);return f.useEffect(()=>{i(n)},[n]),a.jsxs("div",{className:"wu-relative",children:[a.jsx(Pe,{"data-testid":"search-icon",icon:"wm-search",className:m("wu-absolute wu-top-1 wu-left-0.5","wu-text-gray-lead wu-cursor-pointer wu-text-[19px]",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})]})},oo=Kt.Provider,io=Kt.Root,uo=Kt.Trigger,Kr=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}));Kr.displayName=Kt.Content.displayName;const In=f.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(oo,{delayDuration:r||200,children:a.jsxs(io,{open:u,onOpenChange:l,children:[a.jsx(uo,{asChild:!0,children:a.jsx("span",{ref:w,...c,children:s})}),a.jsx(Pr.Portal,{children:e&&a.jsxs(Kr,{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(Pr.Arrow,{className:"wu-fill-gray-notification wu-tooltip-arrow"})]})})]})}));In.displayName="WuTooltip";const fw=({label:e,className:t})=>{const n=f.useRef(null),[r,s]=f.useState(!1);return f.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})},pw=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:[zd((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(so,{productCategories:n,activeProductName:t,activeProductColor:u,dir:l,homeLink:i,expandAll:d})}),a.jsx(ao,{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(to,{dir:l}),(r==null?void 0:r.profile)&&Object.keys(r.profile).length>0&&a.jsx(eo,{user:r,onLogout:o,dir:l,DataCenter:c})]})]})})},Ue=Gt.Root,dt=Gt.Trigger,Be=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})}));Be.displayName=Gt.Content.displayName;function lo({className:e,classNames:t,dir:n="ltr",...r}){const s=Ga.getDefaultClassNames();return a.jsx(Ga.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,Gr({variant:"iconOnly"}),"wu-h-6 wu-w-6 wu-text-gray-lead"),button_previous:m(s.button_previous,Gr({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})}lo.displayName="Calendar";const Yr=e=>a.jsx(lo,{...e}),co=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(Ee,{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(Ee,{onClick:t,disabled:n,className:"wu-date-picker-apply",children:"Apply"})})]})},Xr=({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(Ee,{...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})}),wo=(e,t,n,r)=>{const s=$.startOfDay(e).getTime();return!!(t||n&&s<$.startOfDay(n).getTime()||r&&s>$.startOfDay(r).getTime())},kn=e=>e?typeof e=="string"?new Date(e):e:new Date,Zr="(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01])-\\d{4}",hw=[{label:"Last week",value:7},{label:"Last month",value:30},{label:"Last quarter",value:90},{label:"Last year",value:365}],mw=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})},gw=e=>{var u,l;const{inputRef:t,maxLength:n=50,className:r,...s}=e,[o,i]=f.useState(!1);return f.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}`})},bw=We.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"),Dn=S.forwardRef(({className:e,...t},n)=>a.jsx(Xa.Root,{ref:n,className:m(bw(),e),...t}));Dn.displayName=Xa.Root.displayName;const Me=e=>a.jsx(Dn,{...e,className:m("wu-text-gray-lead wu-leading-6",e.className)}),yw=({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"),p=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:p,children:t})]})]})},vw=({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:p,align:h="start",sideOffset:b=-.5,side:g,alignOffset:v,...N})=>{const[x,C]=f.useState(),[E,y]=f.useState(""),I=f.useCallback(()=>{const M=kn(x);y($.format(M,e)),n&&n(x)},[x,e,n]),T=f.useCallback(()=>{d?d():(C(void 0),y(""),n&&n(void 0))},[n,d]);return f.useEffect(()=>{const M=kn(t);C(M),y($.format(M,e))},[t,e]),a.jsxs(Me,{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(Xr,{formattedString:E,dir:i,placeholder:w,CustomTrigger:p,...N}),a.jsx(Be,{className:"wu-p-0 wu-w-fit wu-date-picker-content",align:h,sideOffset:b,side:g,alignOffset:v,dir:i,children:a.jsx(Yr,{dir:i,mode:"single",captionLayout:"dropdown",selected:x,onSelect:C,disabled:M=>wo(M,r,s,o),startMonth:s,endMonth:o,required:!0,autoFocus:!0,defaultMonth:x,className:m("wu-border wu-border-blue-p wu-date-picker"),footer:a.jsx(co,{handleDateChange:I,disabled:r,onReset:T,showResetButton:c})})})]})]})},fo={};function Ze(e,t){const n=S.useRef(fo);return n.current===fo&&(n.current=e(t)),n}const Jr=S[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],xw=Jr&&Jr!==S.useLayoutEffect?Jr:e=>e();function he(e){const t=Ze(Nw).current;return t.next=e,xw(t.effect),t.trampoline}function Nw(){const e={next:void 0,callback:Sw,trampoline:(...t)=>{var n;return(n=e.callback)==null?void 0:n.call(e,...t)},effect:()=>{e.callback=e.next}};return e}function Sw(){if(process.env.NODE_ENV!=="production")throw new Error("Base UI: Cannot call an event handler while rendering.")}function Cw(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=Cw("https://base-ui.com/production-error","Base UI");function Ie(){}const Ke=Object.freeze({});let po=(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 Tw={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},Ew={disabled:!1,...Zt},Qr={valid(e){return e===null?null:e?{[po.valid]:""}:{[po.invalid]:""}}},ho=S.createContext({invalid:void 0,name:void 0,validityData:{state:Tw,errors:[],error:"",value:"",initialValue:null},setValidityData:Ie,disabled:void 0,touched:Zt.touched,setTouched:Ie,dirty:Zt.dirty,setDirty:Ie,filled:Zt.filled,setFilled:Ie,focused:Zt.focused,setFocused:Ie,validate:()=>null,validationMode:"onSubmit",validationDebounceTime:0,shouldValidateOnChange:()=>!1,state:Ew,markedDirtyRef:{current:!1},registerFieldControl:Ie,validation:{getValidationProps:(e=Ke)=>e,getInputValidationProps:(e=Ke)=>e,inputRef:{current:null},commit:async()=>{}}});process.env.NODE_ENV!=="production"&&(ho.displayName="FieldRootContext");function An(e=!0){const t=S.useContext(ho);if(t.setValidityData===Ie&&!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: FieldRootContext is missing. Field parts must be placed within <Field.Root>.":Xt(28));return t}const mo=S.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:Ie,validationMode:"onSubmit",submitAttemptedRef:{current:!1}});process.env.NODE_ENV!=="production"&&(mo.displayName="FormContext");function Mw(){return S.useContext(mo)}function Rr(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}const es={};function ts(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 Iw(e){if(e.length===0)return es;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 ns(e)?{...bo(e,es)}:kw(e)}function Pn(e,t){return ns(t)?bo(t,e):Dw(e,t)}function kw(e){const t={...e};for(const n in t){const r=t[n];go(n,r)&&(t[n]=yo(r))}return t}function Dw(e,t){if(!t)return e;for(const n in t){const r=t[n];switch(n){case"style":{e[n]=Rr(e.style,r);break}case"className":{e[n]=vo(e.className,r);break}default:go(n,r)?e[n]=Aw(e[n],r):e[n]=r}}return e}function go(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 ns(e){return typeof e=="function"}function bo(e,t){return ns(e)?e(t):e??es}function Aw(e,t){return t?e?n=>{if(xo(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}:yo(t):e}function yo(e){return e&&(t=>(xo(t)&&Vn(t),e(t)))}function Vn(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function vo(e,t){return t?e?t+" "+e:t:e}function xo(e){return e!=null&&typeof e=="object"&&"nativeEvent"in e}const wt={...S};let No=0;function _w(e,t="mui"){const[n,r]=S.useState(e),s=e||n;return S.useEffect(()=>{n==null&&(No+=1,r(`${t}-${No}`))},[n,t]),s}const So=wt.useId;function Pw(e,t){if(So!==void 0){const n=So();return e??(t?`${t}-${n}`:n)}return _w(e,t)}function Co(e){return Pw(e,"base-ui")}const To=S.createContext({controlId:void 0,registerControlId:Ie,labelId:void 0,setLabelId:Ie,messageIds:[],setMessageIds:Ie,getDescriptionProps:e=>e});process.env.NODE_ENV!=="production"&&(To.displayName="LabelableContext");function rs(){return S.useContext(To)}function On(e,t,n,r){const s=Ze(Eo).current;return Ow(s,e,t,n,r)&&Mo(s,[e,t,n,r]),s.callback}function Vw(e){const t=Ze(Eo).current;return Fw(t,e)&&Mo(t,e),t.callback}function Eo(){return{callback:null,cleanup:null,refs:[]}}function Ow(e,t,n,r,s){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==s}function Fw(e,t){return e.refs.length!==t.length||e.refs.some((n,r)=>n!==t[r])}function Mo(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 Lw=parseInt(S.version,10);function Ww(e){return Lw>=e}function Io(e){if(!S.isValidElement(e))return null;const t=e,n=t.props;return(Ww(19)?n==null?void 0:n.ref:t.ref)??null}let ss;process.env.NODE_ENV!=="production"&&(ss=new Set);function as(...e){if(process.env.NODE_ENV!=="production"){const t=e.join(" ");ss.has(t)||(ss.add(t),console.warn(`Base UI: ${t}`))}}function Bw(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 qw(e,t){return typeof e=="function"?e(t):e}function $w(e,t){return typeof e=="function"?e(t):e}function Ye(e,t,n={}){const r=t.render,s=Hw(t,n);if(n.enabled===!1)return null;const o=n.state??Ke;return Kw(e,r,s,o)}function Hw(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?qw(n,o):void 0,w=d?$w(r,o):void 0,p=d?Bw(o,l):Ke,h=d&&u?zw(u):void 0,b=d?Rr(p,h)??{}:Ke;return typeof document<"u"&&(d?Array.isArray(i)?b.ref=Vw([b.ref,Io(s),...i]):b.ref=On(b.ref,Io(s),i):On(null,null)),d?(c!==void 0&&(b.className=vo(b.className,c)),w!==void 0&&(b.style=Rr(b.style,w)),b):Ke}function zw(e){return Array.isArray(e)?Iw(e):ts(void 0,e)}const Uw=Symbol.for("react.lazy"),jw=/^[A-Z][A-Za-z0-9$]*$/,Gw=/[a-z]/;function Kw(e,t,n,r){if(t){if(typeof t=="function")return process.env.NODE_ENV!=="production"&&Yw(t),t(n,r);const s=ts(n,t.props);s.ref=n.ref;let o=t;if((o==null?void 0:o.$$typeof)===Uw&&(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(`
|
|
5
|
+
`));return S.cloneElement(o,s)}if(e&&typeof e=="string")return Xw(e,n);throw new Error(process.env.NODE_ENV!=="production"?"Base UI: Render element or function are not defined.":Xt(8))}function Yw(e){const t=e.name;t.length!==0&&jw.test(t)&&Gw.test(t)&&as(`The \`render\` prop received a function named \`${t}\` that starts with an uppercase letter.`,"This usually means a React component was passed directly as `render={Component}`.","Base UI calls `render` as a plain function, which can break the Rules of Hooks during reconciliation.","If this is an intentional render callback, rename it to start with a lowercase letter.","Use `render={<Component />}` or `render={(props) => <Component {...props} />}` instead.","https://base-ui.com/r/invalid-render-prop")}function Xw(e,t){return e==="button"?f.createElement("button",{type:"button",...t,key:t.key}):e==="img"?f.createElement("img",{alt:"",...t,key:t.key}):S.createElement(e,t)}const Zw=[];function Fn(e){S.useEffect(e,Zw)}const Jt=0;class Ln{constructor(){Ce(this,"currentId",Jt);Ce(this,"clear",()=>{this.currentId!==Jt&&(clearTimeout(this.currentId),this.currentId=Jt)});Ce(this,"disposeEffect",()=>this.clear)}static create(){return new Ln}start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=Jt,n()},t)}isStarted(){return this.currentId!==Jt}}function ko(){const e=Ze(Ln.create).current;return Fn(e.disposeEffect),e}const ae=typeof document<"u"?S.useLayoutEffect:()=>{};let os;process.env.NODE_ENV!=="production"&&(os=new Set);function Wn(...e){if(process.env.NODE_ENV!=="production"){const t=e.join(" ");os.has(t)||(os.add(t),console.error(`Base UI: ${t}`))}}function Do(){return typeof window<"u"}function is(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Jw(e){return Do()?e instanceof Element||e instanceof is(e).Element:!1}function Qw(e){return Do()?e instanceof HTMLElement||e instanceof is(e).HTMLElement:!1}function Ao(e){return(e==null?void 0:e.ownerDocument)||document}const Bn=typeof navigator<"u",us=nf(),Rw=sf(),ef=rf();typeof CSS>"u"||!CSS.supports||CSS.supports("-webkit-backdrop-filter:none");const tf=us.platform==="MacIntel"&&us.maxTouchPoints>1?!0:/iP(hone|ad|od)|iOS/.test(us.platform);Bn&&Rw.toLowerCase().startsWith("mac")&&navigator.maxTouchPoints,ef.includes("jsdom/");function nf(){if(!Bn)return{platform:"",maxTouchPoints:-1};const e=navigator.userAgentData;return e!=null&&e.platform?{platform:e.platform,maxTouchPoints:navigator.maxTouchPoints}:{platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??-1}}function rf(){if(!Bn)return"";const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:t,version:n})=>`${t}/${n}`).join(" "):navigator.userAgent}function sf(){if(!Bn)return"";const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform??""}function _o(e){var n;let t=e.activeElement;for(;((n=t==null?void 0:t.shadowRoot)==null?void 0:n.activeElement)!=null;)t=t.shadowRoot.activeElement;return t}function af(e){e.preventDefault(),e.stopPropagation()}const qn=null;let Po=globalThis.requestAnimationFrame;class of{constructor(){Ce(this,"callbacks",[]);Ce(this,"callbacksCount",0);Ce(this,"nextId",1);Ce(this,"startId",1);Ce(this,"isScheduled",!1);Ce(this,"tick",t=>{var s;this.isScheduled=!1;const n=this.callbacks,r=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,r>0)for(let o=0;o<n.length;o+=1)(s=n[o])==null||s.call(n,t)})}request(t){const n=this.nextId;this.nextId+=1,this.callbacks.push(t),this.callbacksCount+=1;const r=process.env.NODE_ENV!=="production"&&Po!==requestAnimationFrame&&(Po=requestAnimationFrame,!0);return(!this.isScheduled||r)&&(requestAnimationFrame(this.tick),this.isScheduled=!0),n}cancel(t){const n=t-this.startId;n<0||n>=this.callbacks.length||(this.callbacks[n]=null,this.callbacksCount-=1)}}const $n=new of;class le{constructor(){Ce(this,"currentId",qn);Ce(this,"cancel",()=>{this.currentId!==qn&&($n.cancel(this.currentId),this.currentId=qn)});Ce(this,"disposeEffect",()=>this.cancel)}static create(){return new le}static request(t){return $n.request(t)}static cancel(t){return $n.cancel(t)}request(t){this.cancel(),this.currentId=$n.request(()=>{this.currentId=qn,t()})}}function Vo(){const e=Ze(le.create).current;return Fn(e.disposeEffect),e}function uf(e){return e==null?e:"current"in e?e.current:e}let Qt=(function(e){return e.startingStyle="data-starting-style",e.endingStyle="data-ending-style",e})({});const lf={[Qt.startingStyle]:""},cf={[Qt.endingStyle]:""},Oo={transitionStatus(e){return e==="starting"?lf:e==="ending"?cf:null}};function Fo(e,t=!1,n=!0){const r=Vo();return he((s,o=null)=>{r.cancel();const i=uf(e);if(i==null)return;const u=i,l=()=>{$d.flushSync(s)};if(typeof u.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED){s();return}function d(){Promise.all(u.getAnimations().map(c=>c.finished)).then(()=>{o!=null&&o.aborted||l()}).catch(()=>{if(n){o!=null&&o.aborted||l();return}const c=u.getAnimations();!(o!=null&&o.aborted)&&c.length>0&&c.some(w=>w.pending||w.playState!=="finished")&&d()})}if(t){const c=Qt.startingStyle;if(!u.hasAttribute(c)){r.request(d);return}const w=new MutationObserver(()=>{u.hasAttribute(c)||(w.disconnect(),d())});w.observe(u,{attributes:!0,attributeFilter:[c]}),o==null||o.addEventListener("abort",()=>w.disconnect(),{once:!0});return}r.request(d)})}function df(e){const{enabled:t=!0,open:n,ref:r,onComplete:s}=e,o=he(s),i=Fo(r,n,!1);S.useEffect(()=>{if(!t)return;const u=new AbortController;return i(o,u.signal),()=>{u.abort()}},[t,n,o,i])}function wf(e,t=!1,n=!1){const[r,s]=S.useState(e&&t?"idle":void 0),[o,i]=S.useState(e);return e&&!o&&(i(!0),s("starting")),!e&&o&&r!=="ending"&&!n&&s("ending"),!e&&!o&&r==="ending"&&s(void 0),ae(()=>{if(!e&&o&&r!=="ending"&&n){const u=le.request(()=>{s("ending")});return()=>{le.cancel(u)}}},[e,o,r,n]),ae(()=>{if(!e||t)return;const u=le.request(()=>{s(void 0)});return()=>{le.cancel(u)}},[t,e]),ae(()=>{if(!e||!t)return;e&&o&&r!=="idle"&&s("starting");const u=le.request(()=>{s("idle")});return()=>{le.cancel(u)}},[t,e,o,r]),{mounted:o,setMounted:i,transitionStatus:r}}function ls({controlled:e,default:t,name:n,state:r="value"}){const{current:s}=S.useRef(e!==void 0),[o,i]=S.useState(t),u=s?e:o;if(process.env.NODE_ENV!=="production"){S.useEffect(()=>{s!==(e!==void 0)&&Wn([`A component is changing the ${s?"":"un"}controlled ${r} state of ${n} to be ${s?"un":""}controlled.`,"Elements should not switch from uncontrolled to controlled (or vice versa).",`Decide between using a controlled or uncontrolled ${n} element for the lifetime of the component.`,"The nature of the state is determined during the first render. It's considered controlled if the value is not `undefined`.","More info: https://fb.me/react-controlled-components"].join(`
|
|
6
|
+
`))},[r,n,e]);const{current:d}=S.useRef(t);S.useEffect(()=>{!s&&Lo(d)!==Lo(t)&&Wn([`A component is changing the default ${r} state of an uncontrolled ${n} after being initialized. To suppress this warning opt to use a controlled ${n}.`].join(`
|
|
7
|
+
`))},[t])}const l=S.useCallback(d=>{s||i(d)},[]);return[u,l]}function Lo(e){let t=0;const n=new WeakMap;try{return JSON.stringify(e,function(o,i){if(!(o==="_owner"&&this!=null&&typeof this=="object"&&"$$typeof"in this)){if(typeof i=="bigint")return`__bigint__:${i}`;if(i!==null&&typeof i=="object"){const u=n.get(i);if(u!==void 0)return`__object__:${u}`;n.set(i,t),t+=1}return i}})??`__top__:${typeof e}`}catch{return"__unserializable__"}}function Wo(e,t){const{enabled:n=!0,getValue:r,id:s,value:o}=t,{registerFieldControl:i}=An(),u=S.useRef(null);u.current||(u.current=Symbol()),ae(()=>{const l=u.current;if(!(!l||!n))return i(l,{controlRef:e,getValue:r,id:s,value:o}),()=>{i(l,void 0)}},[e,n,r,s,i,o])}function Bo(e={}){const{id:t,implicit:n=!1,controlRef:r}=e,{controlId:s,registerControlId:o}=rs(),i=Co(t),u=n?s:void 0,l=Ze(()=>Symbol("labelable-control")),d=S.useRef(!1),c=S.useRef(t!=null),w=he(()=>{!d.current||o===Ie||(d.current=!1,o(l.current,void 0))});return ae(()=>{if(o===Ie)return;let p;if(n){const h=r==null?void 0:r.current;Jw(h)&&h.closest("label")!=null?p=t??null:p=u??i}else if(t!=null)c.current=!0,p=t;else if(c.current)p=i;else{w();return}if(p===void 0){w();return}d.current=!0,o(l.current,p)},[t,r,u,o,n,i,l,w]),S.useEffect(()=>w,[w]),s??i}const Rt="none",ff="trigger-press",pf="increment-press",hf="decrement-press",cs="input-change",en="input-clear",Hn="input-blur",ds="input-paste",tn="keyboard";function ke(e,t,n,r){let s=!1,o=!1;const i=r??Ke;return{reason:e,event:t??new Event("base-ui"),cancel(){s=!0},allowPropagation(){o=!0},get isCanceled(){return s},get isPropagationAllowed(){return o},trigger:n,...i}}function nn(e,t,n){const r=Ke;return{reason:e,event:t??new Event("base-ui"),...r}}const qo=S.forwardRef(function(t,n){const{render:r,className:s,id:o,name:i,value:u,disabled:l=!1,onValueChange:d,defaultValue:c,autoFocus:w=!1,style:p,...h}=t,{state:b,name:g,disabled:v,setTouched:N,setDirty:x,validityData:C,setFocused:E,setFilled:y,validationMode:I,validation:T}=An(),M=v||l,k=g??i,_={...b,disabled:M},{labelId:P}=rs(),A=Bo({id:o});ae(()=>{var Q;const q=u!=null;(Q=T.inputRef.current)!=null&&Q.value||q&&u!==""?y(!0):q&&u===""&&y(!1)},[T.inputRef,y,u]);const O=S.useRef(null);ae(()=>{w&&O.current===_o(Ao(O.current))&&E(!0)},[w,E]);const[F]=ls({controlled:u,default:c,name:"FieldControl",state:"value"}),V=u!==void 0,W=V?F:void 0,J=he(()=>{var q;return(q=T.inputRef.current)==null?void 0:q.value});return Wo(T.inputRef,{id:A,value:W,getValue:J}),Ye("input",t,{ref:[n,O],state:_,props:[{id:A,disabled:M,name:k,ref:T.inputRef,"aria-labelledby":P,autoFocus:w,...V?{value:W}:{defaultValue:c},onChange(q){const Q=q.currentTarget.value;d==null||d(Q,ke(Rt,q.nativeEvent)),x(Q!==C.initialValue),y(Q!=="")},onFocus(){E(!0)},onBlur(q){N(!0),E(!1),I==="onBlur"&&T.commit(q.currentTarget.value)},onKeyDown(q){q.currentTarget.tagName==="INPUT"&&q.key==="Enter"&&(N(!0),T.commit(q.currentTarget.value))}},T.getInputValidationProps(),h],stateAttributesMapping:Qr})});process.env.NODE_ENV!=="production"&&(qo.displayName="FieldControl");const $o=S.forwardRef(function(t,n){return a.jsx(qo,{ref:n,...t})});process.env.NODE_ENV!=="production"&&($o.displayName="Input");const zn={wuInputGroup:"_wuInputGroup_1t4ep_1",wuInputIcon:"_wuInputIcon_1t4ep_20",wuInput:"_wuInput_1t4ep_1",passwordToggle:"_passwordToggle_1t4ep_89"},Ho=f.memo(({showPassword:e,onToggle:t,disabled:n,readOnly:r})=>{const s=f.useCallback(i=>{if(n||r){i.preventDefault(),i.stopPropagation();return}t()},[n,r,t]),o=n||r;return a.jsx("button",{type:"button","data-slot":"wu-input-password-toggle",className:zn.passwordToggle,onClick:s,disabled:o,"aria-disabled":o||void 0,"aria-label":e?"Hide password":"Show password",children:a.jsx(Pe,{icon:e?"wm-visibility":"wm-visibility-off"})})});Ho.displayName="PasswordToggle";const Je=f.memo(f.forwardRef(({className:e,Label:t,labelPosition:n="top",Icon:r,iconPosition:s="left",variant:o="flat",type:i,readonly:u,invalid:l,id:d,...c},w)=>{const p=f.useId(),h=d||p;if(i==="submit")return a.jsx(Ee,{className:e,id:h,"aria-label":c["aria-label"],type:"submit","data-slot":"wu-input-submit",disabled:c.disabled,children:t||"Submit"});const[b,g]=f.useState(!1),v=f.useCallback(()=>{g(y=>!y)},[]),{finalIcon:N,finalIconPosition:x}=f.useMemo(()=>i==="password"?{finalIcon:a.jsx(Ho,{showPassword:b,onToggle:v,readOnly:u,disabled:c.disabled}),finalIconPosition:"right"}:{finalIcon:r,finalIconPosition:s},[i,r,s,b,v]),C=f.useMemo(()=>i==="password"&&b?"text":i,[i,b]),E=f.useMemo(()=>m(zn.wuInput,"wu-peer",e),[e]);return a.jsxs("div",{"data-slot":"wu-input-group",role:"group",className:zn.wuInputGroup,"data-label-position":n,"data-icon-position":N&&x,children:[N&&a.jsx("span",{className:zn.wuInputIcon,children:N}),a.jsx($o,{ref:w,className:E,"data-variant":o,type:C,readOnly:u,"aria-invalid":l,id:h,...c}),t&&a.jsx(Me,{htmlFor:h,children:t})]})}));Je.displayName="WuInput";const Mt="MM-dd-yyyy",mf=[{label:"Day",value:1},{label:"Week",value:7},{label:"Month",value:30},{label:"Quarter",value:90},{label:"Year",value:365}],gf=({current:e,onSelect:t,presetRanges:n=hw})=>{const[r,s]=f.useState(),[o,i]=f.useState(!1),[u,l]=f.useState(""),[d,c]=f.useState(""),[w,p]=f.useState(!1),h=f.useMemo(()=>n.map(x=>x.value),[n]),b=m("wu-flex wu-w-full wu-gap-2 wu-px-4 wu-py-2 wu-text-sm wu-text-gray-lead wu-transition-colors","wu-rounded-none hover:wu-bg-gray-10 focus:wu-outline-none focus-visible:wu-ring-2","focus-visible:wu-ring-blue-pHover focus-visible:wu-ring-offset-1 wu-text-start"),g=f.useCallback(x=>{if(x===void 0){s(void 0),i(!0);return}const C=Number(x)-1;s(C),i(!1),t({from:$.sub(new Date,{days:C}),to:new Date})},[t]),v=f.useCallback((x,C)=>{if(!x||!(e!=null&&e.to)||!(e!=null&&e.from)||!new RegExp(Zr).test(x))return!1;const y=C==="start"?$.parse(x,Mt,new Date):new Date(e.from),I=C==="end"?$.parse(x,Mt,new Date):new Date(e.to);return $.isBefore(I,y)?(p(!0),!1):(p(!1),!($.isSameDay(y,e.from)&&$.isSameDay(I,e.to)))},[e]),N=f.useCallback((x,C)=>{if((C==="start"?l:c)(x),v(x,C)){const y={from:e==null?void 0:e.from,to:e==null?void 0:e.to};C==="start"&&(y.from=$.parse(x,Mt,new Date)),C==="end"&&(y.to=$.parse(x,Mt,new Date)),t(y)}},[e,t,v]);return f.useEffect(()=>{if(e!=null&&e.to&&(e!=null&&e.from)&&$.isValid(e.to)&&$.isValid(e.from)){l($.format(e.from,Mt)),c($.format(e.to,Mt));const x=$.differenceInCalendarDays(e.to,e.from);$.isToday(e.to)&&h.includes(x+1)?(s(x),i(!1)):(s(void 0),i(!0))}},[e,h]),a.jsxs("div",{className:"wu-flex wu-flex-col wu-gap-1 wu-p-2 wu-bg-white wu-w-60 wu-date-picker-sidebar",children:[a.jsx("ul",{className:"wu-flex wu-gap-1 wu-py-2 wu-date-picker-batch-list wu-hidden",children:mf.map(({label:x,value:C})=>a.jsx(Et,{variant:"secondary",className:"wu-px-1 wu-py-1 wu-text-xs wu-h-fit wu-min-w-fit disabled:wu-bg-white",disabled:C!==1,children:x},C))}),a.jsxs("ul",{className:"wu-flex wu-flex-col wu-gap-1 wu-date-picker-ranges",children:[n.map(({label:x,value:C})=>a.jsx("li",{children:a.jsx("button",{className:m(b,r===C-1&&"wu-bg-blue-p/10"),onClick:()=>g(C),children:x})},C)),a.jsx("li",{children:a.jsx("button",{className:m(b,o&&"wu-bg-blue-p/10"),onClick:()=>g(),children:"Custom Range"})})]}),a.jsxs("div",{className:"wu-relative wu-flex wu-gap-3 wu-pt-2 wu-date-picker-range-footer",children:[a.jsx(Je,{placeholder:"Start Date",pattern:Zr,value:u,onChange:x=>N(x.target.value,"start"),"aria-label":"Start Date"}),a.jsx(Je,{placeholder:"End Date",pattern:Zr,value:d,onChange:x=>N(x.target.value,"end"),"aria-label":"End Date"}),w?a.jsx("small",{className:"wu-absolute wu-text-[10px] wu-leading-[14px] wu-text-red-deep wu-left-0 -wu-bottom-5 wu-text-start",children:"End date must be after start date"}):a.jsx("small",{className:"wu-absolute wu-right-0 wu-leading-[14px] -wu-bottom-4 wu-text-gray-subtle wu-text-end",children:"mm-dd-yyyy"})]})]})},bf=({Trigger:e,children:t,className:n,dir:r,open:s,onOpenChange:o,modal:i,...u})=>a.jsxs(Ue,{open:s,onOpenChange:o,modal:i,children:[a.jsx(dt,{asChild:!0,dir:r,children:e}),a.jsx(Be,{className:m("wu-w-80 wu-p-0 wu-border-blue-p wu-bg-white wu-dark:border-gray-switcher",n),dir:r,...u,children:t})]}),ws=e=>a.jsx(jt.PopoverClose,{asChild:!0,children:a.jsx(Ee,{...e})}),It={wuDateRangeNativeSidebar:"_wuDateRangeNativeSidebar_1oiuh_1",customInputs:"_customInputs_1oiuh_26",inputsRow:"_inputsRow_1oiuh_42",errorWrapper:"_errorWrapper_1oiuh_63",errorText:"_errorText_1oiuh_67"},yf=[{label:"Last week",value:7},{label:"Last month",value:30},{label:"Last quarter",value:90},{label:"Last year",value:365}],Ne=e=>{if(!e)return"";try{const t=new Date(e);if(!$.isValid(t))return"";const n=t.getFullYear(),r=String(t.getMonth()+1).padStart(2,"0"),s=String(t.getDate()).padStart(2,"0");return`${n}-${r}-${s}`}catch{return""}},zo=e=>{if(!e)return null;try{const t=$.parseISO(e);return $.isValid(t)?$.startOfDay(t):null}catch{return null}},vf=(e,t,n)=>!(t&&e<$.startOfDay(t)||n&&e>$.startOfDay(n)),Uo=e=>$.sub(new Date,{days:e}),jo=e=>e?$.sub(new Date,{days:1}):new Date;function xf({ranges:e=yf,excludeToday:t=!0,current:n,onSelect:r,onReset:s,onApply:o,showResetButton:i=!0,maxDate:u,minDate:l,...d}){const[c,w]=f.useState(Ne(n==null?void 0:n.from)||Ne(l)),[p,h]=f.useState(Ne(n==null?void 0:n.to)||Ne(u)),[b,g]=f.useState(!1),[v,N]=f.useState(""),[x,C]=f.useState("");f.useEffect(()=>{w(Ne(n==null?void 0:n.from)||Ne(l)),h(Ne(n==null?void 0:n.to)||Ne(u)),N(""),C("")},[n==null?void 0:n.from,n==null?void 0:n.to,l,u]);const E=f.useMemo(()=>{if(!(n!=null&&n.from)||!(n!=null&&n.to))return null;const k=$.differenceInCalendarDays(n.to,n.from)+1;return e.find(_=>_.value===k)??null},[n==null?void 0:n.from,n==null?void 0:n.to,e]),y=f.useCallback(k=>{const _=Uo(k),P=jo(t);w(Ne(_)),h(Ne(P)),N(""),C(""),g(!1),r==null||r({from:_,to:P})},[t,r]),I=f.useCallback((k,_)=>{const P=zo(k);if(_==="start"?(w(k),N("")):(h(k),C("")),!P){if(k){const F="Please enter a valid date";_==="start"?N(F):C(F)}return}if(!vf(P,l,u)){const F=l&&P<$.startOfDay(l)?`Date must be on or after ${$.format(l,"MMM d, yyyy")}`:`Date must be on or before ${$.format(u,"MMM d, yyyy")}`;_==="start"?N(F):C(F);return}const O=zo(_==="start"?p:c);_==="start"&&O?P<=O?r==null||r({from:P,to:O}):N("Start date must be before or equal to end date"):_==="end"&&O&&(P>=O?r==null||r({from:O,to:P}):C("End date must be after or equal to start date"))},[c,p,r,l,u]),T=f.useMemo(()=>e.map(k=>{const _=Uo(k.value),P=jo(t);return{...k,displayStartDate:$.format(_,"MMM d, yyyy"),displayEndDate:$.format(P,"MMM d, yyyy")}}),[e,t]),M=b||(n==null?void 0:n.from)&&(n==null?void 0:n.to)&&!E;return a.jsxs("div",{className:It.wuDateRangeNativeSidebar,...d,children:[a.jsxs("ul",{children:[a.jsx("li",{children:a.jsx("button",{onClick:()=>g(!0),"data-selected":M,"aria-pressed":M,"aria-label":"Select custom date range",children:"Custom Range"})}),a.jsxs("li",{className:It.customInputs,"data-expanded":M,children:[a.jsxs("div",{className:It.inputsRow,children:[a.jsx(Je,{type:"date",value:c,onChange:k=>I(k.target.value,"start"),Label:"Start",min:Ne(l),max:Ne(u),"aria-describedby":v?"start-date-error":void 0}),a.jsx(Je,{type:"date",value:p,onChange:k=>I(k.target.value,"end"),Label:"End",min:c||Ne(l),max:Ne(u),"aria-describedby":x?"end-date-error":void 0})]}),(v||x)&&a.jsxs("div",{className:It.errorWrapper,role:"alert","aria-live":"polite",children:[v&&a.jsx("p",{id:"start-date-error",className:It.errorText,children:v}),x&&a.jsx("p",{id:"end-date-error",className:It.errorText,children:x})]})]}),T.map(k=>a.jsx("li",{children:a.jsxs("button",{onClick:()=>y(k.value),"data-selected":!M&&(E==null?void 0:E.value)===k.value,"aria-pressed":!M&&(E==null?void 0:E.value)===k.value,"aria-label":`Select ${k.label}`,children:[k.label," ",a.jsxs("small",{children:["(",k.displayStartDate," - ",k.displayEndDate,")"]})]})},k.value))]}),a.jsxs("footer",{children:[i&&a.jsx(ws,{variant:"secondary",Icon:a.jsx(Pe,{icon:"wm-refresh"}),onClick:s,children:"Reset"}),a.jsx(ws,{onClick:o,disabled:!!(v||x),children:"Apply"})]})]})}const Nf=({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",minDateToSelect:u,maxDateToSelect:l,presetRanges:d,Label:c,labelPosition:w="top",onReset:p,showResetButton:h=!0,placeholder:b="Select Date Range",CustomTrigger:g,native:v,align:N="start",alignOffset:x,side:C,sideOffset:E=-.5,...y})=>{const[I,T]=f.useState(t),[M,k]=f.useState(t),[_,P]=f.useState(""),A=f.useCallback(()=>{if(M){const V=M.from,W=M.to;T({from:V,to:W}),P(`${$.format(V,e)} - ${$.format(W,e)}`),n&&n({from:V,to:W})}},[M,e,n]),O=f.useCallback(()=>{k(I)},[I]),F=f.useCallback(()=>{p?p():(T(void 0),k(void 0),P(""),n&&n(void 0))},[p,n]);return f.useEffect(()=>{if(t!=null&&t.from&&(t!=null&&t.to)){const V=kn(t.from),W=kn(t.to);T(t),k(t),P(`${$.format(V,e)} - ${$.format(W,e)}`)}else T(void 0),k({to:new Date,from:new Date})},[t,e]),a.jsxs(Me,{className:m("wu-flex wu-gap-1",w==="left"?"wu-items-center":"wu-flex-col wu-items-start","wu-date-picker-label"),dir:i,children:[c,a.jsxs(Ue,{onOpenChange:V=>!V&&O(),children:[a.jsx(Xr,{formattedString:_,dir:i,placeholder:b,CustomTrigger:g,...y}),a.jsx(Be,{className:"wu-flex wu-p-0 wu-border wu-w-fit wu-border-blue-p wu-bg-white",align:N,sideOffset:E,side:C,alignOffset:x,dir:i,children:v?a.jsx(xf,{current:M,onSelect:V=>{k(V)},ranges:d,onApply:A,onReset:F,showResetButton:h,minDate:s,maxDate:o}):a.jsxs(a.Fragment,{children:[a.jsx(gf,{current:M,onSelect:k,presetRanges:d}),a.jsx(Yr,{dir:i,numberOfMonths:2,mode:"range",captionLayout:"dropdown",selected:M,onSelect:k,disabled:V=>wo(V,r,s,o),startMonth:s,endMonth:o,required:!0,autoFocus:!0,defaultMonth:I==null?void 0:I.from,className:m("wu-shadow-none wu-date-range-picker"),min:u,max:l,footer:a.jsx(co,{handleDateChange:A,disabled:r,onReset:F,showResetButton:h})})]})})]})]})},Go=f.forwardRef((e,t)=>{const{className:n,rounded:r,...s}=e;return a.jsx("div",{className:m("wu-card wu-p-2 wu-pt-1 hover:wu-shadow-card wu-border wu-border-black/20 hover:wu-border-black/30 wu-transition-colors wu-duration-300",r?"wu-rounded-lg":"wu-rounded-sm",n),ref:t,...s})});Go.displayName="WuCard";const Ko=f.forwardRef((e,t)=>{const{className:n,...r}=e;return a.jsx("div",{ref:t,...r,className:m("wu-p-2 wu-mb-2 wu-border-b wu-border-gray-40 min-h-12 wu-card-header",n)})});Ko.displayName="WuCardHeader";const Yo=f.forwardRef((e,t)=>{const{className:n,...r}=e;return a.jsx("div",{ref:t,...r,className:m("wu-p-2 wu-mt-2 wu-border-t wu-border-gray-40 min-h-12 wu-card-footer",n)})});Yo.displayName="WuCardHeader";const Xo=S.forwardRef(({className:e,partial:t,...n},r)=>a.jsx(Vr.Root,{ref:r,className:m("wu-h-4 wu-w-4 wu-shrink-0 wu-rounded-[2px] wu-bg-white wu-border wu-border-gray-subtle wu-ring-offset-background focus-visible:wu-outline-none focus-visible:wu-ring-2 focus-visible:wu-ring-ring focus-visible:wu-ring-offset-[1px] data-[state=checked]:wu-bg-blue-p data-[state=checked]:wu-text-white data-[state=checked]:wu-border-none data-[state=checked]:hover:wu-bg-blue-q hover:wu-bg-gray-20 hover:wu-border-blue-p wu-transition-all data-[state=checked]:disabled:wu-bg-gray-20","disabled:wu-cursor-not-allowed disabled:wu-opacity-50 disabled:data-[state=unchecked]:wu-bg-gray-20 disabled:hover:wu-border-gray-subtle disabled:wu-border-gray-subtle",e),...n,children:a.jsxs(Vr.Indicator,{className:m("wu-flex wu-items-center wu-justify-center wu-text-current"),children:[!t&&a.jsx("span",{className:"wm-check wu-text-base wu-leading-4"}),t&&a.jsx("span",{className:"wm-check-indeterminate-small wu-text-base wu-leading-4"})]})}));Xo.displayName=Vr.Root.displayName;const qe=f.forwardRef((e,t)=>{const{disabled:n,checked:r,Label:s,labelPosition:o="right",className:i,id:u=Lr(),partial:l,onChange:d,required:c,readonly:w,...p}=e;return f.useEffect(()=>{p.defaultChecked!==void 0&&r!==void 0&&console.error("WuCheckbox: Both `checked` and `defaultChecked` cannot be used together. Use only one of them.")},[p.defaultChecked,r]),a.jsxs("div",{className:Sf({labelPosition:o,className:"wu-checkbox-container"}),dir:p.dir,children:[a.jsx(Xo,{id:u,...p,partial:l,checked:r,disabled:n||w,onCheckedChange:d,className:m("wu-peer wu-checkbox",i),required:c,ref:t}),s&&a.jsx(Me,{htmlFor:u,className:"wu-w-full wu-checkbox-label",children:s})]})}),Sf=We.cva("wu-flex wu-items-center wu-gap-2 wu-w-fit",{variants:{labelPosition:{left:"wu-flex-row-reverse wu-text-right",right:"wu-flex-row"}}});qe.displayName="WuCheckbox";const Cf=e=>{const{className:t,children:n,...r}=e;return a.jsx("span",{...r,className:m("wu-flex wu-items-center wu-justify-center wu-truncate wu-max-w-28 wu-w-fit wu-px-2 wu-py-1 wu-text-xs wu-bg-gray-20 wu-rounded-sm hover:wu-bg-gray-40 hover:wu-text-blue-q",t),children:n})},fs=S.forwardRef(({className:e,...t},n)=>a.jsx(xe.Command,{ref:n,className:m("wu-flex wu-h-full wu-w-full wu-flex-col wu-overflow-hidden wu-rounded-md",e),...t}));fs.displayName=xe.Command.displayName;const Zo=S.forwardRef(({className:e,...t},n)=>a.jsx("div",{className:"wu-flex wu-items-center wu-border-b wu-px-3",children:a.jsx(xe.Command.Input,{ref:n,className:m("wu-flex wu-h-11 wu-w-full wu-rounded-md wu-bg-transparent wu-py-3 wu-text-sm wu-outline-none wu-placeholder:wu-text-muted-foreground disabled:wu-cursor-not-allowed disabled:wu-opacity-50",e),...t})}));Zo.displayName=xe.Command.Input.displayName;const ps=S.forwardRef(({className:e,...t},n)=>a.jsx(xe.Command.List,{ref:n,className:m("",e),...t}));ps.displayName=xe.Command.List.displayName;const hs=S.forwardRef((e,t)=>a.jsx(xe.Command.Empty,{ref:t,className:"wu-text-center wu-p-2 wu-pb-2.5 wu-text-xs",...e}));hs.displayName=xe.Command.Empty.displayName;const rn=S.forwardRef(({className:e,...t},n)=>a.jsx(xe.Command.Group,{ref:n,className:m("",e),...t}));rn.displayName=xe.Command.Group.displayName;const ms=S.forwardRef(({className:e,...t},n)=>a.jsx(xe.Command.Separator,{ref:n,className:m("wu-mx-2 wu-my-1 wu-h-px wu-bg-gray-40",e),...t}));ms.displayName=xe.Command.Separator.displayName;const sn=S.forwardRef(({className:e,...t},n)=>a.jsx(xe.Command.Item,{ref:n,className:m("wu-relative wu-flex wu-cursor-default wu-gap-2 wu-select-none wu-items-center wu-rounded-sm wu-px-2 wu-py-3 wu-text-sm wu-outline-none data-[disabled=true]:wu-pointer-events-none data-[disabled=true]:wu-opacity-50 [&_svg]:wu-pointer-events-none [&_svg]:wu-size-4 [&_svg]:wu-shrink-0",e),...t}));sn.displayName=xe.Command.Item.displayName;const Jo=(e,t,n,r)=>f.useMemo(()=>{if(!e||!n||t.length===0)return t;const s=Array.isArray(n)?n:[n];if(s.length===0)return t;const o=new Set(s.map(d=>String(d[r.value]))),i=[],u=[],l=[];return t.forEach(d=>{const c=d[r.value];c===void 0?i.push(d):o.has(String(c))?u.push(d):l.push(d)}),[...i,...u,...l]},[t,n,r.value,e]),kt=f.forwardRef(({containerHeight:e=400,list:t,callback:n,dir:r,className:s,style:o},i)=>a.jsx(Ka.Virtuoso,{ref:i,dir:r,className:s,style:{height:e,scrollbarWidth:"thin",scrollbarColor:"#d4d4d4 #f1f1f1",overflowX:"hidden",...o},data:t,itemContent:(u,l)=>n(u,l)}));kt.displayName="WuVirtualScroll";const Tf=({tags:e,triggerRef:t})=>{const[n,r]=f.useState([]),[s,o]=f.useState([]),i=f.useMemo(()=>a.jsx("ul",{className:"wu-flex wu-flex-col wu-items-start wu-justify-center wu-list-none",children:s.map(l=>a.jsx("li",{className:"wu-py-1 wu-text-xs wu-text-left",children:l},l))}),[s]),u=l=>{const d=document.createElement("div");Object.assign(d.style,{display:"inline-block",visibility:"hidden",position:"absolute",whiteSpace:"nowrap"}),d.textContent=l,document.body.appendChild(d);const c=d.offsetWidth;return document.body.removeChild(d),c+8};return f.useEffect(()=>{const l=()=>{if(t.current){const p=t.current.offsetWidth-20-36;let h=0;const b=[],g=[];e.forEach(v=>{const N=u(v);h+N+8<p?(b.push(v),h+=N+8):g.push(v)}),r(b),o(g)}};return l(),window.addEventListener("resize",l),()=>{window.removeEventListener("resize",l)}},[e,t]),a.jsxs("div",{className:"wu-flex wu-items-center wu-gap-2 wu-text-xs",children:[n.map(l=>a.jsx("span",{className:"wu-px-1 wu-py-0.5 wu-text-xs wu-rounded-sm wu-bg-gray-10 wu-combobox-tag",children:l},l)),s.length>0&&a.jsx(In,{content:i,className:"wu-z-[51] wu-text-left",children:a.jsxs("span",{className:"wu-px-1 wu-py-0.5 wu-text-xs wu-rounded-sm wu-bg-gray-10 wu-combobox-tag",children:["+",s.length]})})]})},Ef=({placeholder:e="Select...",isEllipse:t=!1,selectedOptions:n,variant:r="flat",dir:s="ltr",accessorKey:o,multiple:i,id:u,disabled:l,selectAll:d,isCheckedAll:c,className:w,...p})=>{const[h,b]=f.useState([]),g=f.useRef(null);f.useEffect(()=>{if(!n||Array.isArray(n)&&n.length===0){b([]);return}if(i){const N=n;b(N==null?void 0:N.map(x=>x[o.label]));return}else b([n[o.label]])},[n]);const v=()=>{var N;return h.length?c&&(d!=null&&d.enable)&&(d!=null&&d.triggerText)?a.jsx("span",{className:"wu-overflow-hidden wu-text-xs wu-text-start wu-text-ellipsis wu-whitespace-nowrap",children:d.triggerText}):t?a.jsx("span",{className:"wu-overflow-hidden wu-text-xs wu-text-start wu-text-ellipsis wu-whitespace-nowrap",style:{width:`${(((N=g.current)==null?void 0:N.offsetWidth)||0)-32}px`},children:h.join(", ")}):a.jsx(Tf,{tags:h,triggerRef:g}):a.jsx("p",{className:"wu-text-xs wu-opacity-70",children:e})};return a.jsx(dt,{dir:s,asChild:!0,id:u,disabled:l,children:a.jsxs("button",{...p,ref:g,disabled:l,className:m("focus-visible:wu-ring-2 focus-visible:wu-ring-blue-pHover wu-bg-white focus-visible:wu-ring-offset-2 wu-flex wu-w-full wu-items-center wu-justify-between wu-border-b wu-border-gray-subtle wu-py-1.5 wu-px-2 placeholder:wu-text-gray-40 focus:wu-outline-none disabled:wu-cursor-not-allowed disabled:wu-opacity-50 hover:wu-bg-gray-10 hover:wu-border-blue-p wu-transition-colors focus-visible:wu-bg-gray-20 focus-visible:wu-border-blue-p wu-cursor-pointer wu-text-xs wu-rounded-t-sm wu-gap-2 wu-h-8 wu-group/wuCombobox wu-combobox-trigger",r==="outlined"&&"wu-border wu-border-gray-subtle","disabled:wu-cursor-not-allowed disabled:hover:wu-border-gray-subtle disabled:wu-bg-gray-10",w),children:[v(),a.jsx("span",{className:"wm-arrow-drop-down group-data-[state=open]/wuCombobox:wu-rotate-180 wu-transition-transform wu-duration-300 wu-text-base"})]})})},Qo=re.Root,Ro=re.Trigger,ei=re.Group,Mf=re.Portal,If=re.Sub,kf=re.RadioGroup,ti=S.forwardRef(({className:e,inset:t,children:n,position:r,...s},o)=>a.jsxs(re.SubTrigger,{ref:o,className:m("wu-flex wu-cursor-default wu-select-none wu-text-xs wu-items-center wu-p-2 wu-outline-none focus:wu-bg-gray-20 data-[state=open]:wu-bg-gray-20",t&&"wu-pl-8",e),...s,children:[r==="left"&&a.jsx("span",{className:m("wm-chevron-right",s.dir==="rtl"&&"ml-2")}),n,r!=="left"&&a.jsx("span",{className:m("wu-text-base wu-leading-4",s.dir==="rtl"&&"wu-mr-auto wm-chevron-left",s.dir!=="rtl"&&"wu-ml-auto wm-chevron-right")})]}));ti.displayName=re.SubTrigger.displayName;const ni=S.forwardRef(({className:e,...t},n)=>a.jsx(re.SubContent,{ref:n,className:m("wu-z-50 wu-min-w-[8rem] wu-overflow-hidden wu-border wu-text-xs wu-bg-white wu-text-gray-lead wu-shadow-lg data-[state=open]:wu-animate-in data-[state=closed]:wu-animate-out data-[state=closed]:wu-fade-out-0 data-[state=open]:wu-fade-in-0 data-[state=closed]:wu-zoom-out-95 data-[state=open]:wu-zoom-in-95 data-[side=bottom]:wu-slide-in-from-top-2 data-[side=left]:wu-slide-in-from-right-2 data-[side=right]:wu-slide-in-from-left-2 data-[side=top]:wu-slide-in-from-bottom-2",e),...t}));ni.displayName=re.SubContent.displayName;const gs=S.forwardRef(({className:e,sideOffset:t=4,...n},r)=>a.jsx(re.Portal,{children:a.jsx(re.Content,{ref:r,sideOffset:t,className:m("wu-z-50 wu-min-w-[8rem] wu-overflow-hidden wu-border wu-text-xs wu-bg-white wu-text-gray-lead wu-shadow-md data-[state=open]:wu-animate-in data-[state=closed]:wu-animate-out data-[state=closed]:wu-fade-out-0 data-[state=open]:wu-fade-in-0 data-[state=closed]:wu-zoom-out-95 data-[state=open]:wu-zoom-in-95 data-[side=bottom]:wu-slide-in-from-top-2 data-[side=left]:wu-slide-in-from-right-2 data-[side=right]:wu-slide-in-from-left-2 data-[side=top]:wu-slide-in-from-bottom-2",e),...n})}));gs.displayName=re.Content.displayName;const Un=S.forwardRef(({className:e,inset:t,...n},r)=>a.jsx(re.Item,{ref:r,className:m("wu-relative wu-flex wu-cursor-default wu-select-none wu-items-center wu-text-xs wu-p-2 wu-outline-none wu-transition-colors focus:wu-bg-gray-20 data-[disabled]:wu-cursor-not-allowed data-[disabled]:wu-opacity-50",t&&"wu-pl-8",e),...n}));Un.displayName=re.Item.displayName;const ri=S.forwardRef(({className:e,children:t,checked:n,dir:r,...s},o)=>a.jsxs(re.CheckboxItem,{ref:o,className:m("wu-group wu-relative wu-flex wu-cursor-default wu-select-none wu-items-center wu-text-xs wu-py-3 wu-outline-none wu-transition-colors focus:wu-bg-gray-20 data-[disabled]:wu-cursor-not-allowed data-[disabled]:wu-opacity-50",r==="rtl"&&"wu-pr-8 wu-pl-2",r!=="rtl"&&"wu-pl-8 wu-pr-2",e),checked:n,...s,children:[a.jsx("span",{className:m("wu-absolute wu-flex wu-items-center wu-justify-center wu-w-4 wu-h-4 wu-rounded-sm wu-ring-1 wu-ring-gray-subtle group-disabled:wu-bg-gray-20 group-data-[state=checked]:wu-bg-blue-p group-hover:wu-bg-gray-20 group-hover:wu-ring-blue-p wu-transition-all group-data-[state=checked]:wu-ring-blue-p",r==="rtl"&&"wu-right-2",r!=="rtl"&&"wu-left-2"),children:a.jsx(re.ItemIndicator,{children:a.jsx("span",{className:"wm-check wu-text-base wu-text-white"})})}),t]}));ri.displayName=re.CheckboxItem.displayName;const si=S.forwardRef(({className:e,children:t,...n},r)=>a.jsxs(re.RadioItem,{ref:r,className:m("wu-group wu-relative wu-flex wu-cursor-default wu-select-none wu-items-center wu-text-xs wu-py-3 wu-pl-8 wu-pr-2 wu-outline-none wu-transition-colors focus:wu-bg-gray-20 focus:wu-text-accent-foreground data-[disabled]:wu-cursor-not-allowed data-[disabled]:wu-opacity-50",e),...n,children:[a.jsx("span",{className:"wu-absolute wu-rounded-full wu-left-2 wu-flex wu-h-4 wu-w-4 wu-items-center wu-justify-center wu-ring-1 wu-ring-gray-subtle group-disabled:wu-bg-gray-20 group-data-[state=checked]:wu-bg-white group-hover:wu-bg-gray-20 group-hover:wu-ring-blue-p wu-transition-all group-data-[state=checked]:wu-ring-blue-p group-hover:group-data-[state=checked]:wu-ring-blue-q",children:a.jsx(re.ItemIndicator,{className:"wu-w-4 wu-h-4 wu-flex wu-items-center wu-justify-center",children:a.jsx("span",{className:"wm-circle wu-text-blue-p group-hover:group-data-[state=checked]:wu-text-blue-q wu-text-xs"})})}),t]}));si.displayName=re.RadioItem.displayName;const an=S.forwardRef(({className:e,inset:t,...n},r)=>a.jsx(re.Label,{ref:r,className:m("wu-p-2 wu-font-medium wu-text-xs",t&&"wu-pl-8",e),...n}));an.displayName=re.Label.displayName;const jn=S.forwardRef(({className:e,...t},n)=>a.jsx(re.Separator,{ref:n,className:m("-wu-mx-1 wu-my-1 wu-h-px wu-bg-gray-20",e),...t}));jn.displayName=re.Separator.displayName;const ai=({option:e,value:t,multiple:n=!1,onSelect:r,accessorKey:s,dir:o})=>{const[i,u]=f.useState(n?[]:"");f.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=()=>{e.disabled||r(e)};return a.jsxs(sn,{onSelect:d,disabled:e.disabled,className:m("wu-cursor-pointer wu-text-xs wu-items-start wu-leading-4 wu-py-2 wu-combobox-item hover:wu-bg-gray-100",l&&"wu-bg-gray-10"),dir:o,children:[n&&a.jsx(qe,{checked:l}),a.jsx(Df,{option:e,accessorKey:s})]})},Df=({option:e,accessorKey:t})=>{const n=e[t.label];return a.jsxs("div",{className:"wu-flex wu-items-center wu-w-full wu-gap-1",children:[e.icon&&e.icon,n,e.isAdmin&&a.jsx("span",{className:"wu-ml-auto wu-text-sm wm-lock wu-text-orange-deep"})]})},oi=e=>{const{option:t,selectAll:n,handleSelectAll:r,isCheckedAll:s,isPartialSelected:o,...i}=e;switch("type"in t?t.type:"option"){case"all":return a.jsxs(sn,{onSelect:r,className:m("wu-cursor-pointer wu-text-xs wu-leading-4 wu-py-2 wu-combobox-item"),dir:i.dir,children:[a.jsx(qe,{checked:s||o,partial:o,"data-partial":o,"aria-label":(n==null?void 0:n.label)||"Select All"}),a.jsx("span",{"aria-hidden":!0,children:(n==null?void 0:n.label)||"Select All"})]});case"group":return a.jsxs(rn,{children:[a.jsx(an,{children:t.label}),t.options.map(l=>f.createElement(ai,{...i,option:l,key:String(l[i.accessorKey.value]??JSON.stringify(l))}))]});case"divider":return a.jsx(ms,{className:"wu-mx-4"});default:return a.jsx(ai,{...i,option:t})}},Af=e=>{const t=[],n=[],r=[],s=[];return e.forEach(o=>{o.type==="group"?(t.push(o),r.push(...o.options),s.push(...o.options.filter(i=>!i.disabled))):o.type==="divider"?n.push(o):r.push(o),o!=null&&o.disabled||s.push(o)}),{groups:t,dividers:n,allOptions:r,enabledOptions:s}},_f=f.memo(Je),Pf=({data:e,accessorKey:t,value:n,defaultValue:r,Header:s,virtualizedThreshold:o=100,isEllipse:i,placeholder:u,variant:l,dir:d,onSelect:c,Label:w,maxHeight:p=420,multiple:h=!1,hasGroup:b=!1,selectAll:g,id:v,disabled:N,labelPosition:x="top",className:C,onScroll:E,maxContentWidth:y,enableSearch:I=!0,noDataContent:T,selectedToTop:M=!1,...k})=>{const[_,P]=f.useState(""),[A,O]=f.useState(),[F,V]=f.useState(!1),[W,J]=f.useState(!1),[H,q]=f.useState(!1),Q=f.useRef(null),{allOptions:z,enabledOptions:R}=f.useMemo(()=>b||g&&!g.includeDisabled?Af(e):{allOptions:e,groups:[],dividers:[],enabledOptions:[]},[e,b]),ee=f.useMemo(()=>{if(!_)return e;const G=_.toLowerCase();return z.filter(U=>U[t.label].toLowerCase().includes(G))},[_,z,e,t.label]),fe=f.useMemo(()=>h&&g!=null&&g.enable&&!_&&ee.length>0?[{type:"all"},...ee]:ee,[ee,_,h]),ze=Jo(M,fe,A,t),K=f.useCallback(G=>{const U=G[t.value];h?O(Le=>{const me=Le||[],ve=me.some(Ae=>Ae[t.value]===U)?me.filter(Ae=>Ae[t.value]!==U):[...me,G];return c==null||c(ve),ve}):(V(!1),O(G),c==null||c(G))},[h,t.value,c]),L=f.useCallback(G=>P(G.target.value),[]),j=f.useCallback(()=>P(""),[]);f.useEffect(()=>{if(n!==void 0&&r!==void 0){console.error("defaultValue and value cannot be used simultaneously");return}else n!==void 0?O(n):r!==void 0&&O(r)},[n,r]),f.useEffect(()=>{if(!h)return;const G=g!=null&&g.includeDisabled?(A==null?void 0:A.length)===z.length:(A==null?void 0:A.length)===R.length;J(G);const U=(A==null?void 0:A.length)>0&&!G;q(U)},[A,g]);const Y=f.useCallback(()=>{const G=W?[]:g!=null&&g.includeDisabled?z:R;O(G),c==null||c(G)},[W,h,z,R,c,g]),X=Mn(x);return a.jsxs("div",{className:m(X,"wu-flex wu-combobox-container"),ref:Q,children:[a.jsxs(Ue,{onOpenChange:G=>{G&&j(),V(G)},open:F,modal:!0,children:[a.jsx(Ef,{selectedOptions:A,accessorKey:t,isEllipse:i,placeholder:u,variant:l,dir:d,multiple:h,disabled:N,selectAll:g,isCheckedAll:W,className:C,id:v,...k}),a.jsx(Be,{className:"wu-min-w-[--radix-popover-trigger-width] wu-max-w-[calc(100vw-32px)] wu-p-0 wu-bg-white wu-border wu-border-blue-p wu-combobox-content",align:"start",sideOffset:-1,style:{maxWidth:y},children:a.jsxs(fs,{id:v,children:[I&&a.jsx("div",{className:"wu-m-2",children:a.jsx(_f,{placeholder:"Search...",Icon:a.jsx("span",{className:"wm-search"}),className:"wu-text-xs wu-combobox-search",onChange:L,name:"Search","aria-label":"Search",dir:d,iconPosition:d==="rtl"?"right":"left"})}),s,a.jsxs(ps,{children:[a.jsx(hs,{children:T||"No results found."}),ze.length>=o?a.jsx(kt,{className:"wu-combobox-list",containerHeight:p,list:ze,callback:(G,U)=>a.jsx(oi,{option:U,value:A,onSelect:K,multiple:h,accessorKey:t,dir:d,selectAll:g,handleSelectAll:Y,isCheckedAll:W,isPartialSelected:H},String(U[t.value]??JSON.stringify(U))),dir:d}):a.jsx("div",{style:{height:"fit-content",maxHeight:p,overflow:"auto"},className:"wu-combobox-list",onScroll:E,children:ze.map(G=>{const U=G,Le=String(U[t.value]??JSON.stringify(U));return a.jsx(oi,{option:U,value:A,onSelect:K,multiple:h,accessorKey:t,dir:d,selectAll:g,handleSelectAll:Y,isCheckedAll:W,isPartialSelected:H},Le)})})]})]})})]}),w&&a.jsx(Me,{htmlFor:v,className:"wu-combobox-label",children:w})]})},Vf=e=>{const{textToCopy:t,notificationText:n,...r}=e,[s,o]=f.useState(!1),i=async()=>{if(t)try{await navigator.clipboard.writeText(t),o(!0),setTimeout(()=>o(!1),2e3)}catch(u){console.error("Failed to copy:",u)}};return a.jsxs(Ee,{...r,onClick:i,variant:"iconOnly",className:m("wu-relative",e.className),"aria-label":"Copy to clipboard",children:[n&&a.jsx("span",{className:m("wu-absolute wu-text-[6px] wu-leading-3 -wu-top-4 wu-right-0 wu-bg-gray-notification wu-text-white wu-rounded-sm wu-shadow-md wu-px-1 wu-animate-ping-once",s?"wu-block":"wu-hidden"),children:n}),a.jsx(Pe,{icon:"wm-content-copy",className:"wu-text-lg"})]})},ii=te.Root,Of=te.Trigger,Ff=te.Close,Lf=te.Portal,ui=S.forwardRef(({className:e,...t},n)=>a.jsx(te.Overlay,{className:m("wu-fixed wu-inset-0 wu-z-50 wu-bg-black/30 data-[state=open]:wu-animate-in data-[state=closed]:wu-animate-out data-[state=closed]:wu-fade-out-0 data-[state=open]:wu-fade-in-0","wu-drawer-overlay",e),...t,ref:n}));ui.displayName=te.Overlay.displayName;const Wf=We.cva("wu-fixed wu-z-50 wu-gap-4 wu-p-6 wu-shadow-lg wu-transition wu-ease-in-out data-[state=open]:wu-animate-in data-[state=closed]:wu-animate-out data-[state=closed]:wu-duration-500 data-[state=open]:wu-duration-500",{variants:{side:{top:"wu-inset-x-0 wu-top-0 wu-border-b data-[state=closed]:wu-slide-out-to-top data-[state=open]:wu-slide-in-from-top",bottom:"wu-inset-x-0 wu-bottom-0 wu-border-t data-[state=closed]:wu-slide-out-to-bottom data-[state=open]:wu-slide-in-from-bottom",left:"wu-inset-y-0 wu-left-0 wu-h-full wu-w-3/4 wu-border-r data-[state=closed]:wu-slide-out-to-left data-[state=open]:wu-slide-in-from-left sm:wu-max-w-sm",right:"wu-inset-y-0 wu-right-0 wu-h-full wu-w-3/4 wu-border-l data-[state=closed]:wu-slide-out-to-right data-[state=open]:wu-slide-in-from-right sm:wu-max-w-sm"}},defaultVariants:{side:"right"}}),bs=S.forwardRef(({side:e="right",className:t,children:n,hideCloseButton:r,overlayClassName:s,closeButtonClassName:o,...i},u)=>a.jsxs(Lf,{children:[a.jsx(ui,{className:s}),a.jsxs(te.Content,{ref:u,className:m(Wf({side:e}),t),...i,children:[n,!r&&a.jsx(te.Close,{"aria-label":"close",asChild:!0,children:a.jsxs(Et,{variant:"iconOnly",className:m("wu-absolute wu-right-4 wu-top-4",o),children:[a.jsx("span",{className:"wm-close"}),a.jsx("span",{className:"wu-sr-only",children:"Close"})]})})]})]}));bs.displayName=te.Content.displayName;const li=S.forwardRef(({className:e,...t},n)=>a.jsx(te.Title,{ref:n,className:m("wu-text-lg wu-font-semibold",e),...t}));li.displayName=te.Title.displayName;const Bf=S.forwardRef(({className:e,...t},n)=>a.jsx(te.Description,{ref:n,className:m("wu-text-sm",e),...t}));Bf.displayName=te.Description.displayName;const qf=e=>t=>{e&&t.preventDefault()},$f=e=>{const{Trigger:t,children:n,hideCloseButton:r,className:s,side:o="left",open:i,onOpenChange:u,preventClickOutside:l,overlayClassName:d,closeButtonClassName:c,...w}=e;return a.jsxs(ii,{open:i,onOpenChange:u,children:[a.jsx(Of,{asChild:!0,children:t}),a.jsxs(bs,{onInteractOutside:qf(l),side:o,className:m("wu-bg-white wu-text-gray-lead wu-px-0",s),hideCloseButton:r,overlayClassName:d,closeButtonClassName:c,...w,children:[a.jsx("div",{className:"wu-hidden",children:a.jsx(li,{})}),n]})]})},Hf=({children:e,...t})=>a.jsx(Ff,{...t,children:e}),ci=f.createContext({});function ys(e){const t=f.useRef(null);return t.current===null&&(t.current=e()),t.current}const di=typeof window<"u"?f.useLayoutEffect:f.useEffect,Gn=f.createContext(null);function zf(e,t){e.indexOf(t)===-1&&e.push(t)}function Uf(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const Qe=(e,t,n)=>n>t?t:n<e?e:n;function vs(e,t){return t?`${e}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${t}`:e}let on=()=>{},ft=()=>{};typeof process<"u"&&((Td=process.env)==null?void 0:Td.NODE_ENV)!=="production"&&(on=(e,t,n)=>{!e&&typeof console<"u"&&console.warn(vs(t,n))},ft=(e,t,n)=>{if(!e)throw new Error(vs(t,n))});const Re={},wi=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function jf(e){return typeof e=="object"&&e!==null}const fi=e=>/^0[^.\s]+$/u.test(e);function pi(e){let t;return()=>(t===void 0&&(t=e()),t)}const Dt=e=>e,Gf=(e,t)=>n=>t(e(n)),Kn=(...e)=>e.reduce(Gf),hi=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r};class mi{constructor(){this.subscriptions=[]}add(t){return zf(this.subscriptions,t),()=>Uf(this.subscriptions,t)}notify(t,n,r){const s=this.subscriptions.length;if(s)if(s===1)this.subscriptions[0](t,n,r);else for(let o=0;o<s;o++){const i=this.subscriptions[o];i&&i(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const Ve=e=>e*1e3,$e=e=>e/1e3;function gi(e,t){return t?e*(1e3/t):0}const bi=new Set;function yi(e,t,n){e||bi.has(t)||(console.warn(vs(t,n)),bi.add(t))}const vi=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,Kf=1e-7,Yf=12;function Xf(e,t,n,r,s){let o,i,u=0;do i=t+(n-t)/2,o=vi(i,r,s)-e,o>0?n=i:t=i;while(Math.abs(o)>Kf&&++u<Yf);return i}function un(e,t,n,r){if(e===t&&n===r)return Dt;const s=o=>Xf(o,0,1,e,n);return o=>o===0||o===1?o:vi(s(o),t,r)}const xi=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Ni=e=>t=>1-e(1-t),Si=un(.33,1.53,.69,.99),xs=Ni(Si),Ci=xi(xs),Ti=e=>e>=1?1:(e*=2)<1?.5*xs(e):.5*(2-Math.pow(2,-10*(e-1))),Ns=e=>1-Math.sin(Math.acos(e)),Zf=Ni(Ns),Ei=xi(Ns),Jf=un(.42,0,1,1),Qf=un(0,0,.58,1),Mi=un(.42,0,.58,1),Rf=e=>Array.isArray(e)&&typeof e[0]!="number",Ii=e=>Array.isArray(e)&&typeof e[0]=="number",ki={linear:Dt,easeIn:Jf,easeInOut:Mi,easeOut:Qf,circIn:Ns,circInOut:Ei,circOut:Zf,backIn:xs,backInOut:Ci,backOut:Si,anticipate:Ti},ep=e=>typeof e=="string",Di=e=>{if(Ii(e)){ft(e.length===4,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[t,n,r,s]=e;return un(t,n,r,s)}else if(ep(e))return ft(ki[e]!==void 0,`Invalid easing type '${e}'`,"invalid-easing-type"),ki[e];return e},Yn=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function tp(e,t){let n=new Set,r=new Set,s=!1,o=!1;const i=new WeakSet;let u={delta:0,timestamp:0,isProcessing:!1};function l(c){i.has(c)&&(d.schedule(c),e()),c(u)}const d={schedule:(c,w=!1,p=!1)=>{const b=p&&s?n:r;return w&&i.add(c),b.add(c),c},cancel:c=>{r.delete(c),i.delete(c)},process:c=>{if(u=c,s){o=!0;return}s=!0;const w=n;n=r,r=w,n.forEach(l),n.clear(),s=!1,o&&(o=!1,d.process(c))}};return d}const np=40;function Ai(e,t){let n=!1,r=!0;const s={delta:0,timestamp:0,isProcessing:!1},o=()=>n=!0,i=Yn.reduce((C,E)=>(C[E]=tp(o),C),{}),{setup:u,read:l,resolveKeyframes:d,preUpdate:c,update:w,preRender:p,render:h,postRender:b}=i,g=()=>{const C=Re.useManualTiming,E=C?s.timestamp:performance.now();n=!1,C||(s.delta=r?1e3/60:Math.max(Math.min(E-s.timestamp,np),1)),s.timestamp=E,s.isProcessing=!0,u.process(s),l.process(s),d.process(s),c.process(s),w.process(s),p.process(s),h.process(s),b.process(s),s.isProcessing=!1,n&&t&&(r=!1,e(g))},v=()=>{n=!0,r=!0,s.isProcessing||e(g)};return{schedule:Yn.reduce((C,E)=>{const y=i[E];return C[E]=(I,T=!1,M=!1)=>(n||v(),y.schedule(I,T,M)),C},{}),cancel:C=>{for(let E=0;E<Yn.length;E++)i[Yn[E]].cancel(C)},state:s,steps:i}}const{schedule:Oe,cancel:Ss,state:Xn}=Ai(typeof requestAnimationFrame<"u"?requestAnimationFrame:Dt,!0);let Zn;function rp(){Zn=void 0}const De={now:()=>(Zn===void 0&&De.set(Xn.isProcessing||Re.useManualTiming?Xn.timestamp:performance.now()),Zn),set:e=>{Zn=e,queueMicrotask(rp)}},_i=e=>t=>typeof t=="string"&&t.startsWith(e),Pi=_i("--"),sp=_i("var(--"),Cs=e=>sp(e)?ap.test(e.split("/*")[0].trim()):!1,ap=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Vi(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}const At={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},ln={...At,transform:e=>Qe(0,1,e)},Jn={...At,default:1},cn=e=>Math.round(e*1e5)/1e5,Ts=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function op(e){return e==null}const ip=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Es=(e,t)=>n=>!!(typeof n=="string"&&ip.test(n)&&n.startsWith(e)||t&&!op(n)&&Object.prototype.hasOwnProperty.call(n,t)),Oi=(e,t,n)=>r=>{if(typeof r!="string")return r;const[s,o,i,u]=r.match(Ts);return{[e]:parseFloat(s),[t]:parseFloat(o),[n]:parseFloat(i),alpha:u!==void 0?parseFloat(u):1}},up=e=>Qe(0,255,e),Ms={...At,transform:e=>Math.round(up(e))},pt={test:Es("rgb","red"),parse:Oi("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+Ms.transform(e)+", "+Ms.transform(t)+", "+Ms.transform(n)+", "+cn(ln.transform(r))+")"};function lp(e){let t="",n="",r="",s="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),s=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),s=e.substring(4,5),t+=t,n+=n,r+=r,s+=s),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:s?parseInt(s,16)/255:1}}const Is={test:Es("#"),parse:lp,transform:pt.transform},dn=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),et=dn("deg"),_t=dn("%"),B=dn("px"),cp=dn("vh"),dp=dn("vw"),Fi={..._t,parse:e=>_t.parse(e)/100,transform:e=>_t.transform(e*100)},Pt={test:Es("hsl","hue"),parse:Oi("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+_t.transform(cn(t))+", "+_t.transform(cn(n))+", "+cn(ln.transform(r))+")"},ce={test:e=>pt.test(e)||Is.test(e)||Pt.test(e),parse:e=>pt.test(e)?pt.parse(e):Pt.test(e)?Pt.parse(e):Is.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?pt.transform(e):Pt.transform(e),getAnimatableNone:e=>{const t=ce.parse(e);return t.alpha=0,ce.transform(t)}},wp=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function fp(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(Ts))==null?void 0:t.length)||0)+(((n=e.match(wp))==null?void 0:n.length)||0)>0}const Li="number",Wi="color",pp="var",hp="var(",Bi="${}",mp=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Vt(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},s=[];let o=0;const u=t.replace(mp,l=>(ce.test(l)?(r.color.push(o),s.push(Wi),n.push(ce.parse(l))):l.startsWith(hp)?(r.var.push(o),s.push(pp),n.push(l)):(r.number.push(o),s.push(Li),n.push(parseFloat(l))),++o,Bi)).split(Bi);return{values:n,split:u,indexes:r,types:s}}function gp(e){return Vt(e).values}function qi({split:e,types:t}){const n=e.length;return r=>{let s="";for(let o=0;o<n;o++)if(s+=e[o],r[o]!==void 0){const i=t[o];i===Li?s+=cn(r[o]):i===Wi?s+=ce.transform(r[o]):s+=r[o]}return s}}function bp(e){return qi(Vt(e))}const yp=e=>typeof e=="number"?0:ce.test(e)?ce.getAnimatableNone(e):e,vp=(e,t)=>typeof e=="number"?t!=null&&t.trim().endsWith("/")?e:0:yp(e);function xp(e){const t=Vt(e);return qi(t)(t.values.map((r,s)=>vp(r,t.split[s])))}const He={test:fp,parse:gp,createTransformer:bp,getAnimatableNone:xp};function ks(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Np({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let s=0,o=0,i=0;if(!t)s=o=i=n;else{const u=n<.5?n*(1+t):n+t-n*t,l=2*n-u;s=ks(l,u,e+1/3),o=ks(l,u,e),i=ks(l,u,e-1/3)}return{red:Math.round(s*255),green:Math.round(o*255),blue:Math.round(i*255),alpha:r}}function Qn(e,t){return n=>n>0?t:e}const wn=(e,t,n)=>e+(t-e)*n,Ds=(e,t,n)=>{const r=e*e,s=n*(t*t-r)+r;return s<0?0:Math.sqrt(s)},Sp=[Is,pt,Pt],Cp=e=>Sp.find(t=>t.test(e));function $i(e){const t=Cp(e);if(on(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!t)return!1;let n=t.parse(e);return t===Pt&&(n=Np(n)),n}const Hi=(e,t)=>{const n=$i(e),r=$i(t);if(!n||!r)return Qn(e,t);const s={...n};return o=>(s.red=Ds(n.red,r.red,o),s.green=Ds(n.green,r.green,o),s.blue=Ds(n.blue,r.blue,o),s.alpha=wn(n.alpha,r.alpha,o),pt.transform(s))},As=new Set(["none","hidden"]);function Tp(e,t){return As.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function Ep(e,t){return n=>wn(e,t,n)}function _s(e){return typeof e=="number"?Ep:typeof e=="string"?Cs(e)?Qn:ce.test(e)?Hi:kp:Array.isArray(e)?zi:typeof e=="object"?ce.test(e)?Hi:Mp:Qn}function zi(e,t){const n=[...e],r=n.length,s=e.map((o,i)=>_s(o)(o,t[i]));return o=>{for(let i=0;i<r;i++)n[i]=s[i](o);return n}}function Mp(e,t){const n={...e,...t},r={};for(const s in n)e[s]!==void 0&&t[s]!==void 0&&(r[s]=_s(e[s])(e[s],t[s]));return s=>{for(const o in r)n[o]=r[o](s);return n}}function Ip(e,t){const n=[],r={color:0,var:0,number:0};for(let s=0;s<t.values.length;s++){const o=t.types[s],i=e.indexes[o][r[o]],u=e.values[i]??0;n[s]=u,r[o]++}return n}const kp=(e,t)=>{const n=He.createTransformer(t),r=Vt(e),s=Vt(t);return r.indexes.var.length===s.indexes.var.length&&r.indexes.color.length===s.indexes.color.length&&r.indexes.number.length>=s.indexes.number.length?As.has(e)&&!s.values.length||As.has(t)&&!r.values.length?Tp(e,t):Kn(zi(Ip(r,s),s.values),n):(on(!0,`Complex values '${e}' and '${t}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`,"complex-values-different"),Qn(e,t))};function Ui(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?wn(e,t,n):_s(e)(e,t)}const Dp=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>Oe.update(t,n),stop:()=>Ss(t),now:()=>Xn.isProcessing?Xn.timestamp:De.now()}},ji=(e,t,n=10)=>{let r="";const s=Math.max(Math.round(t/n),2);for(let o=0;o<s;o++)r+=Math.round(e(o/(s-1))*1e4)/1e4+", ";return`linear(${r.substring(0,r.length-2)})`},Rn=2e4;function Ps(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<Rn;)t+=n,r=e.next(t);return t>=Rn?1/0:t}function Ap(e,t=100,n){const r=n({...e,keyframes:[0,t]}),s=Math.min(Ps(r),Rn);return{type:"keyframes",ease:o=>r.next(s*o).value/t,duration:$e(s)}}const oe={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function Vs(e,t){return e*Math.sqrt(1-t*t)}const _p=12;function Pp(e,t,n){let r=n;for(let s=1;s<_p;s++)r=r-e(r)/t(r);return r}const Os=.001;function Vp({duration:e=oe.duration,bounce:t=oe.bounce,velocity:n=oe.velocity,mass:r=oe.mass}){let s,o;on(e<=Ve(oe.maxDuration),"Spring duration must be 10 seconds or less","spring-duration-limit");let i=1-t;i=Qe(oe.minDamping,oe.maxDamping,i),e=Qe(oe.minDuration,oe.maxDuration,$e(e)),i<1?(s=d=>{const c=d*i,w=c*e,p=c-n,h=Vs(d,i),b=Math.exp(-w);return Os-p/h*b},o=d=>{const w=d*i*e,p=w*n+n,h=Math.pow(i,2)*Math.pow(d,2)*e,b=Math.exp(-w),g=Vs(Math.pow(d,2),i);return(-s(d)+Os>0?-1:1)*((p-h)*b)/g}):(s=d=>{const c=Math.exp(-d*e),w=(d-n)*e+1;return-Os+c*w},o=d=>{const c=Math.exp(-d*e),w=(n-d)*(e*e);return c*w});const u=5/e,l=Pp(s,o,u);if(e=Ve(e),isNaN(l))return{stiffness:oe.stiffness,damping:oe.damping,duration:e};{const d=Math.pow(l,2)*r;return{stiffness:d,damping:i*2*Math.sqrt(r*d),duration:e}}}const Op=["duration","bounce"],Fp=["stiffness","damping","mass"];function Gi(e,t){return t.some(n=>e[n]!==void 0)}function Lp(e){let t={velocity:oe.velocity,stiffness:oe.stiffness,damping:oe.damping,mass:oe.mass,isResolvedFromDuration:!1,...e};if(!Gi(e,Fp)&&Gi(e,Op))if(t.velocity=0,e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),s=r*r,o=2*Qe(.05,1,1-(e.bounce||0))*Math.sqrt(s);t={...t,mass:oe.mass,stiffness:s,damping:o}}else{const n=Vp({...e,velocity:0});t={...t,...n,mass:oe.mass},t.isResolvedFromDuration=!0}return t}function er(e=oe.visualDuration,t=oe.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:s}=n;const o=n.keyframes[0],i=n.keyframes[n.keyframes.length-1],u={done:!1,value:o},{stiffness:l,damping:d,mass:c,duration:w,velocity:p,isResolvedFromDuration:h}=Lp({...n,velocity:-$e(n.velocity||0)}),b=p||0,g=d/(2*Math.sqrt(l*c)),v=i-o,N=$e(Math.sqrt(l/c)),x=Math.abs(v)<5;r||(r=x?oe.restSpeed.granular:oe.restSpeed.default),s||(s=x?oe.restDelta.granular:oe.restDelta.default);let C,E,y,I,T,M;if(g<1)y=Vs(N,g),I=(b+g*N*v)/y,C=_=>{const P=Math.exp(-g*N*_);return i-P*(I*Math.sin(y*_)+v*Math.cos(y*_))},T=g*N*I+v*y,M=g*N*v-I*y,E=_=>Math.exp(-g*N*_)*(T*Math.sin(y*_)+M*Math.cos(y*_));else if(g===1){C=P=>i-Math.exp(-N*P)*(v+(b+N*v)*P);const _=b+N*v;E=P=>Math.exp(-N*P)*(N*_*P-b)}else{const _=N*Math.sqrt(g*g-1);C=F=>{const V=Math.exp(-g*N*F),W=Math.min(_*F,300);return i-V*((b+g*N*v)*Math.sinh(W)+_*v*Math.cosh(W))/_};const P=(b+g*N*v)/_,A=g*N*P-v*_,O=g*N*v-P*_;E=F=>{const V=Math.exp(-g*N*F),W=Math.min(_*F,300);return V*(A*Math.sinh(W)+O*Math.cosh(W))}}const k={calculatedDuration:h&&w||null,velocity:_=>Ve(E(_)),next:_=>{if(!h&&g<1){const A=Math.exp(-g*N*_),O=Math.sin(y*_),F=Math.cos(y*_),V=i-A*(I*O+v*F),W=Ve(A*(T*O+M*F));return u.done=Math.abs(W)<=r&&Math.abs(i-V)<=s,u.value=u.done?i:V,u}const P=C(_);if(h)u.done=_>=w;else{const A=Ve(E(_));u.done=Math.abs(A)<=r&&Math.abs(i-P)<=s}return u.value=u.done?i:P,u},toString:()=>{const _=Math.min(Ps(k),Rn),P=ji(A=>k.next(_*A).value,_,30);return _+"ms "+P},toTransition:()=>{}};return k}er.applyToOptions=e=>{const t=Ap(e,100,er);return e.ease=t.ease,e.duration=Ve(t.duration),e.type="keyframes",e};const Wp=5;function Ki(e,t,n){const r=Math.max(t-Wp,0);return gi(n-e(r),t-r)}function Fs({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:s=10,bounceStiffness:o=500,modifyTarget:i,min:u,max:l,restDelta:d=.5,restSpeed:c}){const w=e[0],p={done:!1,value:w},h=M=>u!==void 0&&M<u||l!==void 0&&M>l,b=M=>u===void 0?l:l===void 0||Math.abs(u-M)<Math.abs(l-M)?u:l;let g=n*t;const v=w+g,N=i===void 0?v:i(v);N!==v&&(g=N-w);const x=M=>-g*Math.exp(-M/r),C=M=>N+x(M),E=M=>{const k=x(M),_=C(M);p.done=Math.abs(k)<=d,p.value=p.done?N:_};let y,I;const T=M=>{h(p.value)&&(y=M,I=er({keyframes:[p.value,b(p.value)],velocity:Ki(C,M,p.value),damping:s,stiffness:o,restDelta:d,restSpeed:c}))};return T(0),{calculatedDuration:null,next:M=>{let k=!1;return!I&&y===void 0&&(k=!0,E(M),T(M)),y!==void 0&&M>=y?I.next(M-y):(!k&&E(M),p)}}}function Bp(e,t,n){const r=[],s=n||Re.mix||Ui,o=e.length-1;for(let i=0;i<o;i++){let u=s(e[i],e[i+1]);if(t){const l=Array.isArray(t)?t[i]||Dt:t;u=Kn(l,u)}r.push(u)}return r}function qp(e,t,{clamp:n=!0,ease:r,mixer:s}={}){const o=e.length;if(ft(o===t.length,"Both input and output ranges must be the same length","range-length"),o===1)return()=>t[0];if(o===2&&t[0]===t[1])return()=>t[1];const i=e[0]===e[1];e[0]>e[o-1]&&(e=[...e].reverse(),t=[...t].reverse());const u=Bp(t,r,s),l=u.length,d=c=>{if(i&&c<e[0])return t[0];let w=0;if(l>1)for(;w<e.length-2&&!(c<e[w+1]);w++);const p=hi(e[w],e[w+1],c);return u[w](p)};return n?c=>d(Qe(e[0],e[o-1],c)):d}function $p(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const s=hi(0,t,r);e.push(wn(n,1,s))}}function Hp(e){const t=[0];return $p(t,e.length-1),t}function zp(e,t){return e.map(n=>n*t)}function Up(e,t){return e.map(()=>t||Mi).splice(0,e.length-1)}function Ot({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const s=Rf(r)?r.map(Di):Di(r),o={done:!1,value:t[0]},i=zp(n&&n.length===t.length?n:Hp(t),e),u=qp(i,t,{ease:Array.isArray(s)?s:Up(t,s)});return{calculatedDuration:e,next:l=>(o.value=u(l),o.done=l>=e,o)}}const jp=e=>e!==null;function tr(e,{repeat:t,repeatType:n="loop"},r,s=1){const o=e.filter(jp),u=s<0||t&&n!=="loop"&&t%2===1?0:o.length-1;return!u||r===void 0?o[u]:r}const Gp={decay:Fs,inertia:Fs,tween:Ot,keyframes:Ot,spring:er};function Yi(e){typeof e.type=="string"&&(e.type=Gp[e.type])}class Ls{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,n){return this.finished.then(t,n)}}const Kp=e=>e/100;class nr extends Ls{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{var r,s;const{motionValue:n}=this.options;n&&n.updatedAt!==De.now()&&this.tick(De.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(s=(r=this.options).onStop)==null||s.call(r))},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;Yi(t);const{type:n=Ot,repeat:r=0,repeatDelay:s=0,repeatType:o,velocity:i=0}=t;let{keyframes:u}=t;const l=n||Ot;process.env.NODE_ENV!=="production"&&l!==Ot&&ft(u.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${u}`,"spring-two-frames"),l!==Ot&&typeof u[0]!="number"&&(this.mixKeyframes=Kn(Kp,Ui(u[0],u[1])),u=[0,100]);const d=l({...t,keyframes:u});o==="mirror"&&(this.mirroredGenerator=l({...t,keyframes:[...u].reverse(),velocity:-i})),d.calculatedDuration===null&&(d.calculatedDuration=Ps(d));const{calculatedDuration:c}=d;this.calculatedDuration=c,this.resolvedDuration=c+s,this.totalDuration=this.resolvedDuration*(r+1)-s,this.generator=d}updateTime(t){const n=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(t,n=!1){const{generator:r,totalDuration:s,mixKeyframes:o,mirroredGenerator:i,resolvedDuration:u,calculatedDuration:l}=this;if(this.startTime===null)return r.next(0);const{delay:d=0,keyframes:c,repeat:w,repeatType:p,repeatDelay:h,type:b,onUpdate:g,finalKeyframe:v}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-s/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const N=this.currentTime-d*(this.playbackSpeed>=0?1:-1),x=this.playbackSpeed>=0?N<0:N>s;this.currentTime=Math.max(N,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=s);let C=this.currentTime,E=r;if(w){const M=Math.min(this.currentTime,s)/u;let k=Math.floor(M),_=M%1;!_&&M>=1&&(_=1),_===1&&k--,k=Math.min(k,w+1),!!(k%2)&&(p==="reverse"?(_=1-_,h&&(_-=h/u)):p==="mirror"&&(E=i)),C=Qe(0,1,_)*u}let y;x?(this.delayState.value=c[0],y=this.delayState):y=E.next(C),o&&!x&&(y.value=o(y.value));let{done:I}=y;!x&&l!==null&&(I=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);const T=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&I);return T&&b!==Fs&&(y.value=tr(c,this.options,v,this.speed)),g&&g(y.value),T&&this.finish(),y}then(t,n){return this.finished.then(t,n)}get duration(){return $e(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+$e(t)}get time(){return $e(this.currentTime)}set time(t){t=Ve(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=t,this.tick(t))}getGeneratorVelocity(){const t=this.currentTime;if(t<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(t);const n=this.generator.next(t).value;return Ki(r=>this.generator.next(r).value,t,n)}get speed(){return this.playbackSpeed}set speed(t){const n=this.playbackSpeed!==t;n&&this.driver&&this.updateTime(De.now()),this.playbackSpeed=t,n&&this.driver&&(this.time=$e(this.currentTime))}play(){var s,o;if(this.isStopped)return;const{driver:t=Dp,startTime:n}=this.options;this.driver||(this.driver=t(i=>this.tick(i))),(o=(s=this.options).onPlay)==null||o.call(s);const r=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=r):this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime||(this.startTime=n??r),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(De.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var t,n;this.notifyFinished(),this.teardown(),this.state="finished",(n=(t=this.options).onComplete)==null||n.call(t)}cancel(){var t,n;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(n=(t=this.options).onCancel)==null||n.call(t)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){var n;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(n=this.driver)==null||n.stop(),t.observe(this)}}function Yp(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const ht=e=>e*180/Math.PI,Ws=e=>{const t=ht(Math.atan2(e[1],e[0]));return Bs(t)},Xp={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:Ws,rotateZ:Ws,skewX:e=>ht(Math.atan(e[1])),skewY:e=>ht(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},Bs=e=>(e=e%360,e<0&&(e+=360),e),Xi=Ws,Zi=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),Ji=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),Zp={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Zi,scaleY:Ji,scale:e=>(Zi(e)+Ji(e))/2,rotateX:e=>Bs(ht(Math.atan2(e[6],e[5]))),rotateY:e=>Bs(ht(Math.atan2(-e[2],e[0]))),rotateZ:Xi,rotate:Xi,skewX:e=>ht(Math.atan(e[4])),skewY:e=>ht(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function qs(e){return e.includes("scale")?1:0}function $s(e,t){if(!e||e==="none")return qs(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,s;if(n)r=Zp,s=n;else{const u=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=Xp,s=u}if(!s)return qs(t);const o=r[t],i=s[1].split(",").map(Qp);return typeof o=="function"?o(i):i[o]}const Jp=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return $s(n,t)};function Qp(e){return parseFloat(e.trim())}const Ft=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Lt=new Set(Ft),Qi=e=>e===At||e===B,Rp=new Set(["x","y","z"]),eh=Ft.filter(e=>!Rp.has(e));function th(e){const t=[];return eh.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const tt={width:({x:e},{paddingLeft:t="0",paddingRight:n="0",boxSizing:r})=>{const s=e.max-e.min;return r==="border-box"?s:s-parseFloat(t)-parseFloat(n)},height:({y:e},{paddingTop:t="0",paddingBottom:n="0",boxSizing:r})=>{const s=e.max-e.min;return r==="border-box"?s:s-parseFloat(t)-parseFloat(n)},top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>$s(t,"x"),y:(e,{transform:t})=>$s(t,"y")};tt.translateX=tt.x,tt.translateY=tt.y;const mt=new Set;let Hs=!1,zs=!1,Us=!1;function Ri(){if(zs){const e=Array.from(mt).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const s=th(r);s.length&&(n.set(r,s),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const s=n.get(r);s&&s.forEach(([o,i])=>{var u;(u=r.getValue(o))==null||u.set(i)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}zs=!1,Hs=!1,mt.forEach(e=>e.complete(Us)),mt.clear()}function eu(){mt.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(zs=!0)})}function nh(){Us=!0,eu(),Ri(),Us=!1}class js{constructor(t,n,r,s,o,i=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=s,this.element=o,this.isAsync=i}scheduleResolve(){this.state="scheduled",this.isAsync?(mt.add(this),Hs||(Hs=!0,Oe.read(eu),Oe.resolveKeyframes(Ri))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:s}=this;if(t[0]===null){const o=s==null?void 0:s.get(),i=t[t.length-1];if(o!==void 0)t[0]=o;else if(r&&n){const u=r.readValue(n,i);u!=null&&(t[0]=u)}t[0]===void 0&&(t[0]=i),s&&o===void 0&&s.set(t[0])}Yp(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),mt.delete(this)}cancel(){this.state==="scheduled"&&(mt.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const rh=e=>e.startsWith("--");function tu(e,t,n){rh(t)?e.style.setProperty(t,n):e.style[t]=n}const sh={};function nu(e,t){const n=pi(e);return()=>sh[t]??n()}const ah=nu(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),ru=nu(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),fn=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,su={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:fn([0,.65,.55,1]),circOut:fn([.55,0,1,.45]),backIn:fn([.31,.01,.66,-.59]),backOut:fn([.33,1.53,.69,.99])};function au(e,t){if(e)return typeof e=="function"?ru()?ji(e,t):"ease-out":Ii(e)?fn(e):Array.isArray(e)?e.map(n=>au(n,t)||su.easeOut):su[e]}function oh(e,t,n,{delay:r=0,duration:s=300,repeat:o=0,repeatType:i="loop",ease:u="easeOut",times:l}={},d=void 0){const c={[t]:n};l&&(c.offset=l);const w=au(u,s);Array.isArray(w)&&(c.easing=w);const p={delay:r,duration:s,easing:Array.isArray(w)?"linear":w,fill:"both",iterations:o+1,direction:i==="reverse"?"alternate":"normal"};return d&&(p.pseudoElement=d),e.animate(c,p)}function ou(e){return typeof e=="function"&&"applyToOptions"in e}function ih({type:e,...t}){return ou(e)&&ru()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class iu extends Ls{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:n,name:r,keyframes:s,pseudoElement:o,allowFlatten:i=!1,finalKeyframe:u,onComplete:l}=t;this.isPseudoElement=!!o,this.allowFlatten=i,this.options=t,ft(typeof t.type!="string",`Mini animate() doesn't support "type" as a string.`,"mini-spring");const d=ih(t);this.animation=oh(n,r,s,d,o),d.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!o){const c=tr(s,this.options,u,this.speed);this.updateMotionValue&&this.updateMotionValue(c),tu(n,r,c),this.animation.cancel()}l==null||l(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var t,n;(n=(t=this.animation).finish)==null||n.call(t)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var n,r,s;const t=(n=this.options)==null?void 0:n.element;!this.isPseudoElement&&(t!=null&&t.isConnected)&&((s=(r=this.animation).commitStyles)==null||s.call(r))}get duration(){var n,r;const t=((r=(n=this.animation.effect)==null?void 0:n.getComputedTiming)==null?void 0:r.call(n).duration)||0;return $e(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+$e(t)}get time(){return $e(Number(this.animation.currentTime)||0)}set time(t){const n=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=Ve(t),n&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,rangeStart:n,rangeEnd:r,observe:s}){var o;return this.allowFlatten&&((o=this.animation.effect)==null||o.updateTiming({easing:"linear"})),this.animation.onfinish=null,t&&ah()?(this.animation.timeline=t,n&&(this.animation.rangeStart=n),r&&(this.animation.rangeEnd=r),Dt):s(this)}}const uu={anticipate:Ti,backInOut:Ci,circInOut:Ei};function uh(e){return e in uu}function lh(e){typeof e.ease=="string"&&uh(e.ease)&&(e.ease=uu[e.ease])}const Gs=10;class ch extends iu{constructor(t){lh(t),Yi(t),super(t),t.startTime!==void 0&&t.autoplay!==!1&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:r,onComplete:s,element:o,...i}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const u=new nr({...i,autoplay:!1}),l=Math.max(Gs,De.now()-this.startTime),d=Qe(0,Gs,l-Gs),c=u.sample(l).value,{name:w}=this.options;o&&w&&tu(o,w,c),n.setWithVelocity(u.sample(Math.max(0,l-d)).value,c,d),u.stop()}}const lu=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(He.test(e)||e==="0")&&!e.startsWith("url("));function dh(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function wh(e,t,n,r){const s=e[0];if(s===null)return!1;if(t==="display"||t==="visibility")return!0;const o=e[e.length-1],i=lu(s,t),u=lu(o,t);return on(i===u,`You are trying to animate ${t} from "${s}" to "${o}". "${i?o:s}" is not an animatable value.`,"value-not-animatable"),!i||!u?!1:dh(e)||(n==="spring"||ou(n))&&r}function Ks(e){e.duration=0,e.type="keyframes"}const cu=new Set(["opacity","clipPath","filter","transform"]),fh=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function ph(e){for(let t=0;t<e.length;t++)if(typeof e[t]=="string"&&fh.test(e[t]))return!0;return!1}const hh=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),mh=pi(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function gh(e){var w;const{motionValue:t,name:n,repeatDelay:r,repeatType:s,damping:o,type:i,keyframes:u}=e;if(!(((w=t==null?void 0:t.owner)==null?void 0:w.current)instanceof HTMLElement))return!1;const{onUpdate:d,transformTemplate:c}=t.owner.getProps();return mh()&&n&&(cu.has(n)||hh.has(n)&&ph(u))&&(n!=="transform"||!c)&&!d&&!r&&s!=="mirror"&&o!==0&&i!=="inertia"}const bh=40;class yh extends Ls{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:s=0,repeatDelay:o=0,repeatType:i="loop",keyframes:u,name:l,motionValue:d,element:c,...w}){var b;super(),this.stop=()=>{var g,v;this._animation&&(this._animation.stop(),(g=this.stopTimeline)==null||g.call(this)),(v=this.keyframeResolver)==null||v.cancel()},this.createdAt=De.now();const p={autoplay:t,delay:n,type:r,repeat:s,repeatDelay:o,repeatType:i,name:l,motionValue:d,element:c,...w},h=(c==null?void 0:c.KeyframeResolver)||js;this.keyframeResolver=new h(u,(g,v,N)=>this.onKeyframesResolved(g,v,p,!N),l,d,c),(b=this.keyframeResolver)==null||b.scheduleResolve()}onKeyframesResolved(t,n,r,s){var N,x;this.keyframeResolver=void 0;const{name:o,type:i,velocity:u,delay:l,isHandoff:d,onUpdate:c}=r;this.resolvedAt=De.now();let w=!0;wh(t,o,i,u)||(w=!1,(Re.instantAnimations||!l)&&(c==null||c(tr(t,r,n))),t[0]=t[t.length-1],Ks(r),r.repeat=0);const h={startTime:s?this.resolvedAt?this.resolvedAt-this.createdAt>bh?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:t},b=w&&!d&&gh(h),g=(x=(N=h.motionValue)==null?void 0:N.owner)==null?void 0:x.current;let v;if(b)try{v=new ch({...h,element:g})}catch{v=new nr(h)}else v=new nr(h);v.finished.then(()=>{this.notifyFinished()}).catch(Dt),this.pendingTimeline&&(this.stopTimeline=v.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=v}get finished(){return this._animation?this.animation.finished:this._finished}then(t,n){return this.finished.finally(t).then(()=>{})}get animation(){var t;return this._animation||((t=this.keyframeResolver)==null||t.resume(),nh()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var t;this._animation&&this.animation.cancel(),(t=this.keyframeResolver)==null||t.cancel()}}function du(e,t,n,r=0,s=1){const o=Array.from(e).sort((d,c)=>d.sortNodePosition(c)).indexOf(t),i=e.size,u=(i-1)*r;return typeof n=="function"?n(o,i):s===1?o*r:u-o*r}const vh=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function xh(e){const t=vh.exec(e);if(!t)return[,];const[,n,r,s]=t;return[`--${n??r}`,s]}const Nh=4;function wu(e,t,n=1){ft(n<=Nh,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[r,s]=xh(e);if(!r)return;const o=window.getComputedStyle(t).getPropertyValue(r);if(o){const i=o.trim();return wi(i)?parseFloat(i):i}return Cs(s)?wu(s,t,n+1):s}const Sh={type:"spring",stiffness:500,damping:25,restSpeed:10},Ch=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),Th={type:"keyframes",duration:.8},Eh={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Mh=(e,{keyframes:t})=>t.length>2?Th:Lt.has(e)?e.startsWith("scale")?Ch(t[1]):Sh:Eh;function fu(e,t){if(e!=null&&e.inherit&&t){const{inherit:n,...r}=e;return{...t,...r}}return e}function pu(e,t){const n=(e==null?void 0:e[t])??(e==null?void 0:e.default)??e;return n!==e?fu(n,e):n}const Ih=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function kh(e){for(const t in e)if(!Ih.has(t))return!0;return!1}const Dh=(e,t,n,r={},s,o)=>i=>{const u=pu(r,e)||{},l=u.delay||r.delay||0;let{elapsed:d=0}=r;d=d-Ve(l);const c={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...u,delay:-d,onUpdate:p=>{t.set(p),u.onUpdate&&u.onUpdate(p)},onComplete:()=>{i(),u.onComplete&&u.onComplete()},name:e,motionValue:t,element:o?void 0:s};kh(u)||Object.assign(c,Mh(e,c)),c.duration&&(c.duration=Ve(c.duration)),c.repeatDelay&&(c.repeatDelay=Ve(c.repeatDelay)),c.from!==void 0&&(c.keyframes[0]=c.from);let w=!1;if((c.type===!1||c.duration===0&&!c.repeatDelay)&&(Ks(c),c.delay===0&&(w=!0)),(Re.instantAnimations||Re.skipAnimations||s!=null&&s.shouldSkipAnimations)&&(w=!0,Ks(c),c.delay=0),c.allowFlatten=!u.type&&!u.ease,w&&!o&&t.get()!==void 0){const p=tr(c.keyframes,u);if(p!==void 0){Oe.update(()=>{c.onUpdate(p),c.onComplete()});return}}return u.isSync?new nr(c):new yh(c)};function hu(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function Ys(e,t,n,r){if(typeof t=="function"){const[s,o]=hu(r);t=t(n!==void 0?n:e.custom,s,o)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[s,o]=hu(r);t=t(n!==void 0?n:e.custom,s,o)}return t}function gt(e,t,n){const r=e.getProps();return Ys(r,t,n!==void 0?n:r.custom,e)}const mu=new Set(["width","height","top","left","right","bottom",...Ft]),gu=30,Ah=e=>!isNaN(parseFloat(e));class _h{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{var o;const s=De.now();if(this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&((o=this.events.change)==null||o.notify(this.current),this.dependents))for(const i of this.dependents)i.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=De.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=Ah(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return process.env.NODE_ENV!=="production"&&yi(!1,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new mi);const r=this.events[t].add(n);return t==="change"?()=>{r(),Oe.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var t;(t=this.events.change)==null||t.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=De.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>gu)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,gu);return gi(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){var t,n;(t=this.dependents)==null||t.clear(),(n=this.events.destroy)==null||n.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function rr(e,t){return new _h(e,t)}const Xs=e=>Array.isArray(e);function Ph(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,rr(n))}function Vh(e){return Xs(e)?e[e.length-1]||0:e}function Oh(e,t){const n=gt(e,t);let{transitionEnd:r={},transition:s={},...o}=n||{};o={...o,...r};for(const i in o){const u=Vh(o[i]);Ph(e,i,u)}}const ge=e=>!!(e&&e.getVelocity);function Fh(e){return!!(ge(e)&&e.add)}function Lh(e,t){const n=e.getValue("willChange");if(Fh(n))return n.add(t);if(!n&&Re.WillChange){const r=new Re.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function Zs(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const bu="data-"+Zs("framerAppearId");function Wh(e){return e.props[bu]}function Bh({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function yu(e,t,{delay:n=0,transitionOverride:r,type:s}={}){let{transition:o,transitionEnd:i,...u}=t;const l=e.getDefaultTransition();o=o?fu(o,l):l;const d=o==null?void 0:o.reduceMotion;r&&(o=r);const c=[],w=s&&e.animationState&&e.animationState.getState()[s];for(const p in u){const h=e.getValue(p,e.latestValues[p]??null),b=u[p];if(b===void 0||w&&Bh(w,p))continue;const g={delay:n,...pu(o||{},p)},v=h.get();if(v!==void 0&&!h.isAnimating()&&!Array.isArray(b)&&b===v&&!g.velocity){Oe.update(()=>h.set(b));continue}let N=!1;if(window.MotionHandoffAnimation){const E=Wh(e);if(E){const y=window.MotionHandoffAnimation(E,p,Oe);y!==null&&(g.startTime=y,N=!0)}}Lh(e,p);const x=d??e.shouldReduceMotion;h.start(Dh(p,h,b,x&&mu.has(p)?{type:!1}:g,e,N));const C=h.animation;C&&c.push(C)}if(i){const p=()=>Oe.update(()=>{i&&Oh(e,i)});c.length?Promise.all(c).then(p):p()}return c}function Js(e,t,n={}){var l;const r=gt(e,t,n.type==="exit"?(l=e.presenceContext)==null?void 0:l.custom:void 0);let{transition:s=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(s=n.transitionOverride);const o=r?()=>Promise.all(yu(e,r,n)):()=>Promise.resolve(),i=e.variantChildren&&e.variantChildren.size?(d=0)=>{const{delayChildren:c=0,staggerChildren:w,staggerDirection:p}=s;return qh(e,t,d,c,w,p,n)}:()=>Promise.resolve(),{when:u}=s;if(u){const[d,c]=u==="beforeChildren"?[o,i]:[i,o];return d().then(()=>c())}else return Promise.all([o(),i(n.delay)])}function qh(e,t,n=0,r=0,s=0,o=1,i){const u=[];for(const l of e.variantChildren)l.notify("AnimationStart",t),u.push(Js(l,t,{...i,delay:n+(typeof r=="function"?0:r)+du(e.variantChildren,l,r,s,o)}).then(()=>l.notify("AnimationComplete",t)));return Promise.all(u)}function $h(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const s=t.map(o=>Js(e,o,n));r=Promise.all(s)}else if(typeof t=="string")r=Js(e,t,n);else{const s=typeof t=="function"?gt(e,t,n.custom):t;r=Promise.all(yu(e,s,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}const Hh={test:e=>e==="auto",parse:e=>e},vu=e=>t=>t.test(e),xu=[At,B,_t,et,dp,cp,Hh],Nu=e=>xu.find(vu(e));function zh(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||fi(e):!0}const Uh=new Set(["brightness","contrast","saturate","opacity"]);function jh(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(Ts)||[];if(!r)return e;const s=n.replace(r,"");let o=Uh.has(t)?1:0;return r!==n&&(o*=100),t+"("+o+s+")"}const Gh=/\b([a-z-]*)\(.*?\)/gu,Qs={...He,getAnimatableNone:e=>{const t=e.match(Gh);return t?t.map(jh).join(" "):e}},Rs={...He,getAnimatableNone:e=>{const t=He.parse(e);return He.createTransformer(e)(t.map(r=>typeof r=="number"?0:typeof r=="object"?{...r,alpha:1}:r))}},Su={...At,transform:Math.round},ea={borderWidth:B,borderTopWidth:B,borderRightWidth:B,borderBottomWidth:B,borderLeftWidth:B,borderRadius:B,borderTopLeftRadius:B,borderTopRightRadius:B,borderBottomRightRadius:B,borderBottomLeftRadius:B,width:B,maxWidth:B,height:B,maxHeight:B,top:B,right:B,bottom:B,left:B,inset:B,insetBlock:B,insetBlockStart:B,insetBlockEnd:B,insetInline:B,insetInlineStart:B,insetInlineEnd:B,padding:B,paddingTop:B,paddingRight:B,paddingBottom:B,paddingLeft:B,paddingBlock:B,paddingBlockStart:B,paddingBlockEnd:B,paddingInline:B,paddingInlineStart:B,paddingInlineEnd:B,margin:B,marginTop:B,marginRight:B,marginBottom:B,marginLeft:B,marginBlock:B,marginBlockStart:B,marginBlockEnd:B,marginInline:B,marginInlineStart:B,marginInlineEnd:B,fontSize:B,backgroundPositionX:B,backgroundPositionY:B,...{rotate:et,rotateX:et,rotateY:et,rotateZ:et,scale:Jn,scaleX:Jn,scaleY:Jn,scaleZ:Jn,skew:et,skewX:et,skewY:et,distance:B,translateX:B,translateY:B,translateZ:B,x:B,y:B,z:B,perspective:B,transformPerspective:B,opacity:ln,originX:Fi,originY:Fi,originZ:B},zIndex:Su,fillOpacity:ln,strokeOpacity:ln,numOctaves:Su},Kh={...ea,color:ce,backgroundColor:ce,outlineColor:ce,fill:ce,stroke:ce,borderColor:ce,borderTopColor:ce,borderRightColor:ce,borderBottomColor:ce,borderLeftColor:ce,filter:Qs,WebkitFilter:Qs,mask:Rs,WebkitMask:Rs},Cu=e=>Kh[e],Yh=new Set([Qs,Rs]);function Tu(e,t){let n=Cu(e);return Yh.has(n)||(n=He),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const Xh=new Set(["auto","none","0"]);function Zh(e,t,n){let r=0,s;for(;r<e.length&&!s;){const o=e[r];typeof o=="string"&&!Xh.has(o)&&Vt(o).values.length&&(s=e[r]),r++}if(s&&n)for(const o of t)e[o]=Tu(n,s)}class Jh extends js{constructor(t,n,r,s,o){super(t,n,r,s,o,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let c=0;c<t.length;c++){let w=t[c];if(typeof w=="string"&&(w=w.trim(),Cs(w))){const p=wu(w,n.current);p!==void 0&&(t[c]=p),c===t.length-1&&(this.finalKeyframe=w)}}if(this.resolveNoneKeyframes(),!mu.has(r)||t.length!==2)return;const[s,o]=t,i=Nu(s),u=Nu(o),l=Vi(s),d=Vi(o);if(l!==d&&tt[r]){this.needsMeasurement=!0;return}if(i!==u)if(Qi(i)&&Qi(u))for(let c=0;c<t.length;c++){const w=t[c];typeof w=="string"&&(t[c]=parseFloat(w))}else tt[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let s=0;s<t.length;s++)(t[s]===null||zh(t[s]))&&r.push(s);r.length&&Zh(t,r,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:r}=this;if(!t||!t.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=tt[r](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const s=n[n.length-1];s!==void 0&&t.getValue(r,s).jump(s,!1)}measureEndState(){var u;const{element:t,name:n,unresolvedKeyframes:r}=this;if(!t||!t.current)return;const s=t.getValue(n);s&&s.jump(this.measuredOrigin,!1);const o=r.length-1,i=r[o];r[o]=tt[n](t.measureViewportBox(),window.getComputedStyle(t.current)),i!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=i),(u=this.removedTransforms)!=null&&u.length&&this.removedTransforms.forEach(([l,d])=>{t.getValue(l).set(d)}),this.resolveNoneKeyframes()}}function Qh(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e=="string"){let r=document;const s=(n==null?void 0:n[e])??r.querySelectorAll(e);return s?Array.from(s):[]}return Array.from(e).filter(r=>r!=null)}const Eu=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function sr(e){return jf(e)&&"offsetHeight"in e&&!("ownerSVGElement"in e)}const{schedule:Rh}=Ai(queueMicrotask,!1),em={y:!1};function tm(){return em.y}function Mu(e,t){const n=Qh(e),r=new AbortController,s={passive:!0,...t,signal:r.signal};return[n,s,()=>r.abort()]}function nm(e){return!(e.pointerType==="touch"||tm())}function rm(e,t,n={}){const[r,s,o]=Mu(e,n);return r.forEach(i=>{let u=!1,l=!1,d;const c=()=>{i.removeEventListener("pointerleave",b)},w=v=>{d&&(d(v),d=void 0),c()},p=v=>{u=!1,window.removeEventListener("pointerup",p),window.removeEventListener("pointercancel",p),l&&(l=!1,w(v))},h=()=>{u=!0,window.addEventListener("pointerup",p,s),window.addEventListener("pointercancel",p,s)},b=v=>{if(v.pointerType!=="touch"){if(u){l=!0;return}w(v)}},g=v=>{if(!nm(v))return;l=!1;const N=t(i,v);typeof N=="function"&&(d=N,i.addEventListener("pointerleave",b,s))};i.addEventListener("pointerenter",g,s),i.addEventListener("pointerdown",h,s)}),o}const Iu=(e,t)=>t?e===t?!0:Iu(e,t.parentElement):!1,sm=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,am=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function om(e){return am.has(e.tagName)||e.isContentEditable===!0}const ar=new WeakSet;function ku(e){return t=>{t.key==="Enter"&&e(t)}}function ta(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const im=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=ku(()=>{if(ar.has(n))return;ta(n,"down");const s=ku(()=>{ta(n,"up")}),o=()=>ta(n,"cancel");n.addEventListener("keyup",s,t),n.addEventListener("blur",o,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function Du(e){return sm(e)&&!0}const Au=new WeakSet;function um(e,t,n={}){const[r,s,o]=Mu(e,n),i=u=>{const l=u.currentTarget;if(!Du(u)||Au.has(u))return;ar.add(l),n.stopPropagation&&Au.add(u);const d=t(l,u),c=(h,b)=>{window.removeEventListener("pointerup",w),window.removeEventListener("pointercancel",p),ar.has(l)&&ar.delete(l),Du(h)&&typeof d=="function"&&d(h,{success:b})},w=h=>{c(h,l===window||l===document||n.useGlobalTarget||Iu(l,h.target))},p=h=>{c(h,!1)};window.addEventListener("pointerup",w,s),window.addEventListener("pointercancel",p,s)};return r.forEach(u=>{(n.useGlobalTarget?window:u).addEventListener("pointerdown",i,s),sr(u)&&(u.addEventListener("focus",d=>im(d,s)),!om(u)&&!u.hasAttribute("tabindex")&&(u.tabIndex=0))}),o}const lm=[...xu,ce,He],cm=e=>lm.find(vu(e)),_u=()=>({min:0,max:0}),Pu=()=>({x:_u(),y:_u()}),dm=new WeakMap;function or(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function pn(e){return typeof e=="string"||Array.isArray(e)}const na=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],ra=["initial",...na];function ir(e){return or(e.animate)||ra.some(t=>pn(e[t]))}function Vu(e){return!!(ir(e)||e.variants)}function wm(e,t,n){for(const r in t){const s=t[r],o=n[r];if(ge(s))e.addValue(r,s);else if(ge(o))e.addValue(r,rr(s,{owner:e}));else if(o!==s)if(e.hasValue(r)){const i=e.getValue(r);i.liveStyle===!0?i.jump(s):i.hasAnimated||i.set(s)}else{const i=e.getStaticValue(r);e.addValue(r,rr(i!==void 0?i:s,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const sa={current:null},Ou={current:!1},fm=typeof window<"u";function pm(){if(Ou.current=!0,!!fm)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>sa.current=e.matches;e.addEventListener("change",t),t()}else sa.current=!1}const Fu=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let ur={};function Lu(e){ur=e}function hm(){return ur}class mm{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:s,skipAnimations:o,blockInitialAnimation:i,visualState:u},l={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=js,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const h=De.now();this.renderScheduledAt<h&&(this.renderScheduledAt=h,Oe.render(this.render,!1,!0))};const{latestValues:d,renderState:c}=u;this.latestValues=d,this.baseTarget={...d},this.initialValues=n.initial?{...d}:{},this.renderState=c,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=s,this.skipAnimationsConfig=o,this.options=l,this.blockInitialAnimation=!!i,this.isControllingVariants=ir(n),this.isVariantNode=Vu(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:w,...p}=this.scrapeMotionValuesFromProps(n,{},this);for(const h in p){const b=p[h];d[h]!==void 0&&ge(b)&&b.set(d[h])}}mount(t){var n,r;if(this.hasBeenMounted)for(const s in this.initialValues)(n=this.values.get(s))==null||n.jump(this.initialValues[s]),this.latestValues[s]=this.initialValues[s];this.current=t,dm.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((s,o)=>this.bindToMotionValue(o,s)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(Ou.current||pm(),this.shouldReduceMotion=sa.current),process.env.NODE_ENV!=="production"&&yi(this.shouldReduceMotion!==!0,"You have Reduced Motion enabled on your device. Animations may not appear as expected.","reduced-motion-disabled"),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,(r=this.parent)==null||r.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){var t;this.projection&&this.projection.unmount(),Ss(this.notifyUpdate),Ss(this.render),this.valueSubscriptions.forEach(n=>n()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(t=this.parent)==null||t.removeChild(this);for(const n in this.events)this.events[n].clear();for(const n in this.features){const r=this.features[n];r&&(r.unmount(),r.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,n){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),n.accelerate&&cu.has(t)&&this.current instanceof HTMLElement){const{factory:i,keyframes:u,times:l,ease:d,duration:c}=n.accelerate,w=new iu({element:this.current,name:t,keyframes:u,times:l,ease:d,duration:Ve(c)}),p=i(w);this.valueSubscriptions.set(t,()=>{p(),w.cancel()});return}const r=Lt.has(t);r&&this.onBindTransform&&this.onBindTransform();const s=n.on("change",i=>{this.latestValues[t]=i,this.props.onUpdate&&Oe.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let o;typeof window<"u"&&window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{s(),o&&o(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in ur){const n=ur[t];if(!n)continue;const{isEnabled:r,Feature:s}=n;if(!this.features[t]&&s&&r(this.props)&&(this.features[t]=new s(this)),this.features[t]){const o=this.features[t];o.isMounted?o.update():(o.mount(),o.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Pu()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<Fu.length;r++){const s=Fu[r];this.propEventSubscriptions[s]&&(this.propEventSubscriptions[s](),delete this.propEventSubscriptions[s]);const o="on"+s,i=t[o];i&&(this.propEventSubscriptions[s]=this.on(s,i))}this.prevMotionValues=wm(this,this.scrapeMotionValuesFromProps(t,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=rr(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){let r=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return r!=null&&(typeof r=="string"&&(wi(r)||fi(r))?r=parseFloat(r):!cm(r)&&He.test(n)&&(r=Tu(t,n)),this.setBaseTarget(t,ge(r)?r.get():r)),ge(r)?r.get():r}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var o;const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const i=Ys(this.props,n,(o=this.presenceContext)==null?void 0:o.custom);i&&(r=i[t])}if(n&&r!==void 0)return r;const s=this.getBaseTargetFromProps(this.props,t);return s!==void 0&&!ge(s)?s:this.initialValues[t]!==void 0&&r===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new mi),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){Rh.render(this.render)}}class Wu extends mm{constructor(){super(...arguments),this.KeyframeResolver=Jh}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){const r=t.style;return r?r[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;ge(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class Wt{constructor(t){this.isMounted=!1,this.node=t}update(){}}function gm({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function bm(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function ym(e,t){return gm(bm(e.getBoundingClientRect(),t))}const vm={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},xm=Ft.length;function Nm(e,t,n){let r="",s=!0;for(let o=0;o<xm;o++){const i=Ft[o],u=e[i];if(u===void 0)continue;let l=!0;if(typeof u=="number")l=u===(i.startsWith("scale")?1:0);else{const d=parseFloat(u);l=i.startsWith("scale")?d===1:d===0}if(!l||n){const d=Eu(u,ea[i]);if(!l){s=!1;const c=vm[i]||i;r+=`${c}(${d}) `}n&&(t[i]=d)}}return r=r.trim(),n?r=n(t,s?"":r):s&&(r="none"),r}function aa(e,t,n){const{style:r,vars:s,transformOrigin:o}=e;let i=!1,u=!1;for(const l in t){const d=t[l];if(Lt.has(l)){i=!0;continue}else if(Pi(l)){s[l]=d;continue}else{const c=Eu(d,ea[l]);l.startsWith("origin")?(u=!0,o[l]=c):r[l]=c}}if(t.transform||(i||n?r.transform=Nm(t,e.transform,n):r.transform&&(r.transform="none")),u){const{originX:l="50%",originY:d="50%",originZ:c=0}=o;r.transformOrigin=`${l} ${d} ${c}`}}function Bu(e,{style:t,vars:n},r,s){const o=e.style;let i;for(i in t)o[i]=t[i];s==null||s.applyProjectionStyles(o,r);for(i in n)o.setProperty(i,n[i])}function qu(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const hn={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(B.test(e))e=parseFloat(e);else return e;const n=qu(e,t.target.x),r=qu(e,t.target.y);return`${n}% ${r}%`}},Sm={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,s=He.parse(e);if(s.length>5)return r;const o=He.createTransformer(e),i=typeof s[0]!="number"?1:0,u=n.x.scale*t.x,l=n.y.scale*t.y;s[0+i]/=u,s[1+i]/=l;const d=wn(u,l,.5);return typeof s[2+i]=="number"&&(s[2+i]/=d),typeof s[3+i]=="number"&&(s[3+i]/=d),o(s)}},Cm={borderRadius:{...hn,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:hn,borderTopRightRadius:hn,borderBottomLeftRadius:hn,borderBottomRightRadius:hn,boxShadow:Sm};function $u(e,{layout:t,layoutId:n}){return Lt.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!Cm[e]||e==="opacity")}function oa(e,t,n){var i;const r=e.style,s=t==null?void 0:t.style,o={};if(!r)return o;for(const u in r)(ge(r[u])||s&&ge(s[u])||$u(u,e)||((i=n==null?void 0:n.getValue(u))==null?void 0:i.liveStyle)!==void 0)&&(o[u]=r[u]);return o}function Tm(e){return window.getComputedStyle(e)}class Em extends Wu{constructor(){super(...arguments),this.type="html",this.renderInstance=Bu}readValueFromInstance(t,n){var r;if(Lt.has(n))return(r=this.projection)!=null&&r.isProjecting?qs(n):Jp(t,n);{const s=Tm(t),o=(Pi(n)?s.getPropertyValue(n):s[n])||0;return typeof o=="string"?o.trim():o}}measureInstanceViewportBox(t,{transformPagePoint:n}){return ym(t,n)}build(t,n,r){aa(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return oa(t,n,r)}}const Mm={offset:"stroke-dashoffset",array:"stroke-dasharray"},Im={offset:"strokeDashoffset",array:"strokeDasharray"};function km(e,t,n=1,r=0,s=!0){e.pathLength=1;const o=s?Mm:Im;e[o.offset]=`${-r}`,e[o.array]=`${t} ${n}`}const Dm=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function Hu(e,{attrX:t,attrY:n,attrScale:r,pathLength:s,pathSpacing:o=1,pathOffset:i=0,...u},l,d,c){if(aa(e,u,d),l){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:w,style:p}=e;w.transform&&(p.transform=w.transform,delete w.transform),(p.transform||w.transformOrigin)&&(p.transformOrigin=w.transformOrigin??"50% 50%",delete w.transformOrigin),p.transform&&(p.transformBox=(c==null?void 0:c.transformBox)??"fill-box",delete w.transformBox);for(const h of Dm)w[h]!==void 0&&(p[h]=w[h],delete w[h]);t!==void 0&&(w.x=t),n!==void 0&&(w.y=n),r!==void 0&&(w.scale=r),s!==void 0&&km(w,s,o,i,!1)}const zu=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),Uu=e=>typeof e=="string"&&e.toLowerCase()==="svg";function Am(e,t,n,r){Bu(e,t,void 0,r);for(const s in t.attrs)e.setAttribute(zu.has(s)?s:Zs(s),t.attrs[s])}function ju(e,t,n){const r=oa(e,t,n);for(const s in e)if(ge(e[s])||ge(t[s])){const o=Ft.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;r[o]=e[s]}return r}class _m extends Wu{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Pu}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Lt.has(n)){const r=Cu(n);return r&&r.default||0}return n=zu.has(n)?n:Zs(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return ju(t,n,r)}build(t,n,r){Hu(t,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(t,n,r,s){Am(t,n,r,s)}mount(t){this.isSVGTag=Uu(t.tagName),super.mount(t)}}const Pm=ra.length;function Gu(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?Gu(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<Pm;n++){const r=ra[n],s=e.props[r];(pn(s)||s===!1)&&(t[r]=s)}return t}function Ku(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}const Vm=[...na].reverse(),Om=na.length;function Fm(e){return t=>Promise.all(t.map(({animation:n,options:r})=>$h(e,n,r)))}function Lm(e){let t=Fm(e),n=Yu(),r=!0,s=!1;const o=d=>(c,w)=>{var h;const p=gt(e,w,d==="exit"?(h=e.presenceContext)==null?void 0:h.custom:void 0);if(p){const{transition:b,transitionEnd:g,...v}=p;c={...c,...v,...g}}return c};function i(d){t=d(e)}function u(d){const{props:c}=e,w=Gu(e.parent)||{},p=[],h=new Set;let b={},g=1/0;for(let N=0;N<Om;N++){const x=Vm[N],C=n[x],E=c[x]!==void 0?c[x]:w[x],y=pn(E),I=x===d?C.isActive:null;I===!1&&(g=N);let T=E===w[x]&&E!==c[x]&&y;if(T&&(r||s)&&e.manuallyAnimateOnMount&&(T=!1),C.protectedKeys={...b},!C.isActive&&I===null||!E&&!C.prevProp||or(E)||typeof E=="boolean")continue;if(x==="exit"&&C.isActive&&I!==!0){C.prevResolvedValues&&(b={...b,...C.prevResolvedValues});continue}const M=Wm(C.prevProp,E);let k=M||x===d&&C.isActive&&!T&&y||N>g&&y,_=!1;const P=Array.isArray(E)?E:[E];let A=P.reduce(o(x),{});I===!1&&(A={});const{prevResolvedValues:O={}}=C,F={...O,...A},V=H=>{k=!0,h.has(H)&&(_=!0,h.delete(H)),C.needsAnimating[H]=!0;const q=e.getValue(H);q&&(q.liveStyle=!1)};for(const H in F){const q=A[H],Q=O[H];if(b.hasOwnProperty(H))continue;let z=!1;Xs(q)&&Xs(Q)?z=!Ku(q,Q):z=q!==Q,z?q!=null?V(H):h.add(H):q!==void 0&&h.has(H)?V(H):C.protectedKeys[H]=!0}C.prevProp=E,C.prevResolvedValues=A,C.isActive&&(b={...b,...A}),(r||s)&&e.blockInitialAnimation&&(k=!1);const W=T&&M;k&&(!W||_)&&p.push(...P.map(H=>{const q={type:x};if(typeof H=="string"&&(r||s)&&!W&&e.manuallyAnimateOnMount&&e.parent){const{parent:Q}=e,z=gt(Q,H);if(Q.enteringChildren&&z){const{delayChildren:R}=z.transition||{};q.delay=du(Q.enteringChildren,e,R)}}return{animation:H,options:q}}))}if(h.size){const N={};if(typeof c.initial!="boolean"){const x=gt(e,Array.isArray(c.initial)?c.initial[0]:c.initial);x&&x.transition&&(N.transition=x.transition)}h.forEach(x=>{const C=e.getBaseTarget(x),E=e.getValue(x);E&&(E.liveStyle=!0),N[x]=C??null}),p.push({animation:N})}let v=!!p.length;return r&&(c.initial===!1||c.initial===c.animate)&&!e.manuallyAnimateOnMount&&(v=!1),r=!1,s=!1,v?t(p):Promise.resolve()}function l(d,c){var p;if(n[d].isActive===c)return Promise.resolve();(p=e.variantChildren)==null||p.forEach(h=>{var b;return(b=h.animationState)==null?void 0:b.setActive(d,c)}),n[d].isActive=c;const w=u(d);for(const h in n)n[h].protectedKeys={};return w}return{animateChanges:u,setActive:l,setAnimateFunction:i,getState:()=>n,reset:()=>{n=Yu(),s=!0}}}function Wm(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!Ku(t,e):!1}function bt(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Yu(){return{animate:bt(!0),whileInView:bt(),whileHover:bt(),whileTap:bt(),whileDrag:bt(),whileFocus:bt(),exit:bt()}}function Xu(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function Bm(e){return ge(e)?e.get():e}const ia=f.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function Zu(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function qm(...e){return t=>{let n=!1;const r=e.map(s=>{const o=Zu(s,t);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let s=0;s<r.length;s++){const o=r[s];typeof o=="function"?o():Zu(e[s],null)}}}}function $m(...e){return S.useCallback(qm(...e),e)}class Hm extends S.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(sr(n)&&t.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const r=n.offsetParent,s=sr(r)&&r.offsetWidth||0,o=sr(r)&&r.offsetHeight||0,i=getComputedStyle(n),u=this.props.sizeRef.current;u.height=parseFloat(i.height),u.width=parseFloat(i.width),u.top=n.offsetTop,u.left=n.offsetLeft,u.right=s-u.width-u.left,u.bottom=o-u.height-u.top}return null}componentDidUpdate(){}render(){return this.props.children}}function zm({children:e,isPresent:t,anchorX:n,anchorY:r,root:s,pop:o}){var p;const i=f.useId(),u=f.useRef(null),l=f.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0}),{nonce:d}=f.useContext(ia),c=((p=e.props)==null?void 0:p.ref)??(e==null?void 0:e.ref),w=$m(u,c);return f.useInsertionEffect(()=>{const{width:h,height:b,top:g,left:v,right:N,bottom:x}=l.current;if(t||o===!1||!u.current||!h||!b)return;const C=n==="left"?`left: ${v}`:`right: ${N}`,E=r==="bottom"?`bottom: ${x}`:`top: ${g}`;u.current.dataset.motionPopId=i;const y=document.createElement("style");d&&(y.nonce=d);const I=s??document.head;return I.appendChild(y),y.sheet&&y.sheet.insertRule(`
|
|
8
8
|
[data-motion-pop-id="${i}"] {
|
|
9
9
|
position: absolute !important;
|
|
10
10
|
width: ${h}px !important;
|
|
@@ -12,10 +12,10 @@
|
|
|
12
12
|
${C}px !important;
|
|
13
13
|
${E}px !important;
|
|
14
14
|
}
|
|
15
|
-
`),()=>{var T;(T=u.current)==null||T.removeAttribute("data-motion-pop-id"),D.contains(x)&&D.removeChild(x)}},[t]),a.jsx(Bm,{isPresent:t,childRef:u,sizeRef:l,pop:o,children:o===!1?e:S.cloneElement(e,{ref:w})})}const $m=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:s,presenceAffectsLayout:o,mode:i,anchorX:u,anchorY:l,root:d})=>{const c=bs(Hm),w=p.useId();let f=!0,h=p.useMemo(()=>(f=!1,{id:w,initial:t,isPresent:n,custom:s,onExitComplete:b=>{c.set(b,!0);for(const g of c.values())if(!g)return;r&&r()},register:b=>(c.set(b,!1),()=>c.delete(b))}),[n,c,r]);return o&&f&&(h={...h}),p.useMemo(()=>{c.forEach((b,g)=>c.set(g,!1))},[n]),S.useEffect(()=>{!n&&!c.size&&r&&r()},[n]),e=a.jsx(qm,{pop:i==="popLayout",isPresent:n,anchorX:u,anchorY:l,root:d,children:e}),a.jsx(Gn.Provider,{value:h,children:e})};function Hm(){return new Map}function zm(e=!0){const t=p.useContext(Gn);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:s}=t,o=p.useId();p.useEffect(()=>{if(e)return s(o)},[e]);const i=p.useCallback(()=>e&&r&&r(o),[o,r,e]);return!n&&r?[!1,i]:[!0]}const lr=e=>e.key||"";function Xu(e){const t=[];return p.Children.forEach(e,n=>{p.isValidElement(n)&&t.push(n)}),t}const Zu=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:s=!0,mode:o="sync",propagate:i=!1,anchorX:u="left",anchorY:l="top",root:d})=>{const[c,w]=zm(i),f=p.useMemo(()=>Xu(e),[e]),h=i&&!c?[]:f.map(lr),b=p.useRef(!0),g=p.useRef(f),v=bs(()=>new Map),N=p.useRef(new Set),[y,C]=p.useState(f),[E,x]=p.useState(f);li(()=>{b.current=!1,g.current=f;for(let M=0;M<E.length;M++){const I=lr(E[M]);h.includes(I)?(v.delete(I),N.current.delete(I)):v.get(I)!==!0&&v.set(I,!1)}},[E,h.length,h.join("-")]);const D=[];if(f!==y){let M=[...f];for(let I=0;I<E.length;I++){const _=E[I],P=lr(_);h.includes(P)||(M.splice(I,0,_),D.push(_))}return o==="wait"&&D.length&&(M=D),x(Xu(M)),C(f),null}process.env.NODE_ENV!=="production"&&o==="wait"&&E.length>1&&console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`);const{forceRender:T}=p.useContext(ui);return a.jsx(a.Fragment,{children:E.map(M=>{const I=lr(M),_=i&&!c?!1:f===E||h.includes(I),P=()=>{if(N.current.has(I))return;if(v.has(I))N.current.add(I),v.set(I,!0);else return;let A=!0;v.forEach(O=>{O||(A=!1)}),A&&(T==null||T(),x(g.current),i&&(w==null||w()),r&&r())};return a.jsx($m,{isPresent:_,initial:!b.current||n?void 0:!1,custom:t,presenceAffectsLayout:s,mode:o,root:d,onExitComplete:_?void 0:P,anchorX:u,anchorY:l,children:M},I)})})},ia=p.createContext({strict:!1}),Ju={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let Qu=!1;function Um(){if(Qu)return;const e={};for(const t in Ju)e[t]={isEnabled:n=>Ju[t].some(r=>!!n[r])};Ou(e),Qu=!0}function Ru(){return Um(),wm()}function el(e){const t=Ru();for(const n in e)t[n]={...t[n],...e[n]};Ou(t)}function tl({children:e,features:t,strict:n=!1}){const[,r]=p.useState(!ua(t)),s=p.useRef(void 0);if(!ua(t)){const{renderer:o,...i}=t;s.current=o,el(i)}return p.useEffect(()=>{ua(t)&&t().then(({renderer:o,...i})=>{el(i),s.current=o,r(!0)})},[]),a.jsx(ia.Provider,{value:{renderer:s.current,strict:n},children:e})}function ua(e){return typeof e=="function"}const jm=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function cr(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||jm.has(e)}let nl=e=>!cr(e);function Gm(e){typeof e=="function"&&(nl=t=>t.startsWith("on")?!cr(t):e(t))}try{Gm(require("@emotion/is-prop-valid").default)}catch{}function Km(e,t,n){const r={};for(const s in e)s==="values"&&typeof e.values=="object"||ge(e[s])||(nl(s)||n===!0&&cr(s)||!t&&!cr(s)||e.draggable&&s.startsWith("onDrag"))&&(r[s]=e[s]);return r}const dr=p.createContext({});function Ym(e,t){if(ir(e)){const{initial:n,animate:r}=e;return{initial:n===!1||pn(n)?n:void 0,animate:pn(r)?r:void 0}}return e.inherit!==!1?t:{}}function Xm(e){const{initial:t,animate:n}=Ym(e,p.useContext(dr));return p.useMemo(()=>({initial:t,animate:n}),[rl(t),rl(n)])}function rl(e){return Array.isArray(e)?e.join(" "):e}const la=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function sl(e,t,n){for(const r in t)!ge(t[r])&&!Bu(r,n)&&(e[r]=t[r])}function Zm({transformTemplate:e},t){return p.useMemo(()=>{const n=la();return sa(n,t,e),Object.assign({},n.vars,n.style)},[t])}function Jm(e,t){const n=e.style||{},r={};return sl(r,n,e),Object.assign(r,Zm(e,t)),r}function Qm(e,t){const n={},r=Jm(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const al=()=>({...la(),attrs:{}});function Rm(e,t,n,r){const s=p.useMemo(()=>{const o=al();return qu(o,t,Hu(r),e.transformTemplate,e.style),{...o.attrs,style:{...o.style}}},[t]);if(e.style){const o={};sl(o,e.style,e),s.style={...o,...s.style}}return s}const eg=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function ca(e){return typeof e!="string"||e.includes("-")?!1:!!(eg.indexOf(e)>-1||/[A-Z]/u.test(e))}function tg(e,t,n,{latestValues:r},s,o=!1,i){const l=(i??ca(e)?Rm:Qm)(t,r,s,e),d=Km(t,typeof e=="string",o),c=e!==p.Fragment?{...d,...l,ref:n}:{},{children:w}=t,f=p.useMemo(()=>ge(w)?w.get():w,[w]);return p.createElement(e,{...c,children:f})}function ng({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,s){return{latestValues:rg(n,r,s,e),renderState:t()}}function rg(e,t,n,r){const s={},o=r(e,{});for(const f in o)s[f]=Fm(o[f]);let{initial:i,animate:u}=e;const l=ir(e),d=_u(e);t&&d&&!l&&e.inherit!==!1&&(i===void 0&&(i=t.initial),u===void 0&&(u=t.animate));let c=n?n.initial===!1:!1;c=c||i===!1;const w=c?u:i;if(w&&typeof w!="boolean"&&!or(w)){const f=Array.isArray(w)?w:[w];for(let h=0;h<f.length;h++){const b=Ks(e,f[h]);if(b){const{transitionEnd:g,transition:v,...N}=b;for(const y in N){let C=N[y];if(Array.isArray(C)){const E=c?C.length-1:0;C=C[E]}C!==null&&(s[y]=C)}for(const y in g)s[y]=g[y]}}}return s}const ol=e=>(t,n)=>{const r=p.useContext(dr),s=p.useContext(Gn),o=()=>ng(e,t,r,s);return n?o():bs(o)},sg=ol({scrapeMotionValuesFromProps:aa,createRenderState:la}),ag=ol({scrapeMotionValuesFromProps:zu,createRenderState:al}),og=Symbol.for("motionComponentSymbol");function ig(e,t,n){const r=p.useRef(n);p.useInsertionEffect(()=>{r.current=n});const s=p.useRef(null);return p.useCallback(o=>{var u;o&&((u=e.onMount)==null||u.call(e,o));const i=r.current;if(typeof i=="function")if(o){const l=i(o);typeof l=="function"&&(s.current=l)}else s.current?(s.current(),s.current=null):i(o);else i&&(i.current=o);t&&(o?t.mount(o):t.unmount())},[t])}const ug=p.createContext({});function lg(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function cg(e,t,n,r,s,o){var C,E;const{visualElement:i}=p.useContext(dr),u=p.useContext(ia),l=p.useContext(Gn),d=p.useContext(oa),c=d.reducedMotion,w=d.skipAnimations,f=p.useRef(null),h=p.useRef(!1);r=r||u.renderer,!f.current&&r&&(f.current=r(e,{visualState:t,parent:i,props:n,presenceContext:l,blockInitialAnimation:l?l.initial===!1:!1,reducedMotionConfig:c,skipAnimations:w,isSVG:o}),h.current&&f.current&&(f.current.manuallyAnimateOnMount=!0));const b=f.current,g=p.useContext(ug);b&&!b.projection&&s&&(b.type==="html"||b.type==="svg")&&dg(f.current,n,s,g);const v=p.useRef(!1);p.useInsertionEffect(()=>{b&&v.current&&b.update(n,l)});const N=n[mu],y=p.useRef(!!N&&typeof window<"u"&&!((C=window.MotionHandoffIsComplete)!=null&&C.call(window,N))&&((E=window.MotionHasOptimisedAnimation)==null?void 0:E.call(window,N)));return li(()=>{h.current=!0,b&&(v.current=!0,window.MotionIsMounted=!0,b.updateFeatures(),b.scheduleRenderMicrotask(),y.current&&b.animationState&&b.animationState.animateChanges())}),p.useEffect(()=>{b&&(!y.current&&b.animationState&&b.animationState.animateChanges(),y.current&&(queueMicrotask(()=>{var x;(x=window.MotionHandoffMarkAsComplete)==null||x.call(window,N)}),y.current=!1),b.enteringChildren=void 0)}),b}function dg(e,t,n,r){const{layoutId:s,layout:o,drag:i,dragConstraints:u,layoutScroll:l,layoutRoot:d,layoutAnchor:c,layoutCrossfade:w}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:il(e.parent)),e.projection.setOptions({layoutId:s,layout:o,alwaysMeasureLayout:!!i||u&&lg(u),visualElement:e,animationType:typeof o=="string"?o:"both",initialPromotionConfig:r,crossfade:w,layoutScroll:l,layoutRoot:d,layoutAnchor:c})}function il(e){if(e)return e.options.allowProjection!==!1?e.projection:il(e.parent)}function wg(e,{forwardMotionProps:t=!1,type:n}={},r,s){const o=n?n==="svg":ca(e),i=o?ag:sg;function u(d,c){let w;const f={...p.useContext(oa),...d,layoutId:fg(d)},{isStatic:h}=f,b=Xm(d),g=i(d,h);if(!h&&typeof window<"u"){pg(f,r);const v=hg(f);w=v.MeasureLayout,b.visualElement=cg(e,g,f,s,v.ProjectionNode,o)}return a.jsxs(dr.Provider,{value:b,children:[w&&b.visualElement?a.jsx(w,{visualElement:b.visualElement,...f}):null,tg(e,d,ig(g,b.visualElement,c),g,h,t,o)]})}u.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const l=p.forwardRef(u);return l[og]=e,l}function fg({layoutId:e}){const t=p.useContext(ui).id;return t&&e!==void 0?t+"-"+e:e}function pg(e,t){p.useContext(ia).strict,process.env.NODE_ENV}function hg(e){const t=Ru(),{drag:n,layout:r}=t;if(!n&&!r)return{};const s={...n,...r};return{MeasureLayout:n!=null&&n.isEnabled(e)||r!=null&&r.isEnabled(e)?s.MeasureLayout:void 0,ProjectionNode:s.ProjectionNode}}const mg=(e,t)=>t.isSVG??ca(e)?new Dm(t):new Sm(t,{allowProjection:e!==p.Fragment});class gg extends Wt{constructor(t){super(t),t.animationState||(t.animationState=Vm(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();or(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)==null||t.call(this)}}let bg=0;class yg extends Wt{constructor(){super(...arguments),this.id=bg++,this.isExitComplete=!1}update(){var o;if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;if(t&&r===!1){if(this.isExitComplete){const{initial:i,custom:u}=this.node.getProps();if(typeof i=="string"){const l=gt(this.node,i,u);if(l){const{transition:d,transitionEnd:c,...w}=l;for(const f in w)(o=this.node.getValue(f))==null||o.jump(w[f])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);this.isExitComplete=!1;return}const s=this.node.animationState.setActive("exit",!t);n&&!t&&s.then(()=>{this.isExitComplete=!0,n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const vg={animation:{Feature:gg},exit:{Feature:yg}};function ul(e){return{point:{x:e.pageX,y:e.pageY}}}function ll(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const s="onHover"+n,o=r[s];o&&Fe.postRender(()=>o(t,ul(t)))}class xg extends Wt{mount(){const{current:t}=this.node;t&&(this.unmount=em(t,(n,r)=>(ll(this.node,r,"Start"),s=>ll(this.node,s,"End"))))}unmount(){}}class Ng extends Wt{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Kn(Ku(this.node.current,"focus",()=>this.onFocus()),Ku(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function cl(e,t,n){const{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const s="onTap"+(n==="End"?"":n),o=r[s];o&&Fe.postRender(()=>o(t,ul(t)))}class Sg extends Wt{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:n,propagate:r}=this.node.props;this.unmount=am(t,(s,o)=>(cl(this.node,o,"Start"),(i,{success:u})=>cl(this.node,i,u?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:(r==null?void 0:r.tap)===!1})}unmount(){}}const da=new WeakMap,wa=new WeakMap,Cg=e=>{const t=da.get(e.target);t&&t(e)},Tg=e=>{e.forEach(Cg)};function Eg({root:e,...t}){const n=e||document;wa.has(n)||wa.set(n,{});const r=wa.get(n),s=JSON.stringify(t);return r[s]||(r[s]=new IntersectionObserver(Tg,{root:e,...t})),r[s]}function Mg(e,t,n){const r=Eg(t);return da.set(e,n),r.observe(e),()=>{da.delete(e),r.unobserve(e)}}const Ig={some:0,all:1};class Dg extends Wt{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){var l;(l=this.stopObserver)==null||l.call(this);const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:s="some",once:o}=t,i={root:n?n.current:void 0,rootMargin:r,threshold:typeof s=="number"?s:Ig[s]},u=d=>{const{isIntersecting:c}=d;if(this.isInView===c||(this.isInView=c,o&&!c&&this.hasEnteredView))return;c&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",c);const{onViewportEnter:w,onViewportLeave:f}=this.node.getProps(),h=c?w:f;h&&h(d)};this.stopObserver=Mg(this.node.current,i,u)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(kg(t,n))&&this.startObserver()}unmount(){var t;(t=this.stopObserver)==null||t.call(this),this.hasEnteredView=!1,this.isInView=!1}}function kg({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const dl={renderer:mg,...vg,...{inView:{Feature:Dg},tap:{Feature:Sg},focus:{Feature:Ng},hover:{Feature:xg}}};function Ag(e,t){return wg(e,t)}const wl=Ag("div"),_g=e=>{const{checked:t,onSelect:n,children:r,disabled:s,preventCloseOnSelect:o}=e;return a.jsx(ti,{disabled:s,checked:t,onCheckedChange:n,onSelect:i=>o&&i.preventDefault(),children:r})},wr=e=>{const{children:t,className:n,Icon:r,iconPosition:s="left",disabled:o,onSelect:i,preventCloseOnSelect:u}=e,l=m("wu-flex wu-items-center wu-gap-2",r&&(s==="left"?"":"wu-justify-between wu-flex-row-reverse"),n),d=c=>{i&&i(c),u&&c.preventDefault()};return a.jsxs(Un,{onSelect:d,disabled:o,className:l,children:[r&&a.jsx("div",{className:"wu-text-base",children:r}),t]})},Pg=e=>{const{children:t,Label:n,...r}=e;return a.jsxs(Qo,{...r,children:[a.jsx(an,{children:n||e.label}),t]})},Vg=e=>{const{options:t,value:n,onSelect:r}=e;return a.jsx(Ef,{value:n,onValueChange:r,children:t.map(s=>a.jsx(ni,{value:s.value,disabled:s.disabled,children:s.Label||s.label},s.value))})},Og=e=>{const{className:t,...n}=e,r=m("wu-w-11/12 wu-mx-auto wu-border-gray-40",t);return a.jsx(jn,{...n,className:r})},Bt=S.forwardRef(({className:e,children:t,thumbColor:n,railColor:r,...s},o)=>a.jsxs(ut.Root,{ref:o,className:m("wu-relative wu-overflow-hidden",e),children:[a.jsx(ut.Viewport,{className:"wu-h-full wu-w-full wu-rounded-[inherit]",...s,children:t}),a.jsx(fa,{thumbColor:n,railColor:r}),a.jsx(ut.Corner,{})]}));Bt.displayName=ut.Root.displayName;const fa=S.forwardRef(({className:e,orientation:t="vertical",thumbColor:n="#d4d4d4",railColor:r="#eeeeee",...s},o)=>a.jsx(ut.ScrollAreaScrollbar,{ref:o,orientation:t,className:m("wu-flex wu-touch-none wu-select-none wu-transition-colors",t==="vertical"&&"wu-h-full wu-w-2 wu-border-l wu-border-l-transparent wu-p-[1px]",t==="horizontal"&&"wu-h-2 wu-flex-col wu-border-t wu-border-t-transparent wu-p-[1px]",e),style:{background:r},...s,children:a.jsx(ut.ScrollAreaThumb,{className:"wu-relative wu-flex-1 wu-rounded-full",style:{background:n}})}));fa.displayName=ut.ScrollAreaScrollbar.displayName;const Fg=e=>{const{children:t,label:n,Label:r,open:s,onOpenChange:o,height:i,dir:u,...l}=e;return a.jsxs(Tf,{...l,open:s,onOpenChange:o,children:[a.jsx(Ro,{dir:u,children:r||n}),a.jsx(Cf,{children:a.jsx(ei,{onInteractOutside:d=>d.preventDefault(),children:a.jsx(Bt,{className:"wu-h-fit",style:{height:i},dir:u,children:t})})})]})},Lg="wu-p-1.5 wu-cursor-pointer hover:wu-bg-gray-20 wu-border-gray-40 wu-transition wu-duration-300 focus:wu-outline-2 focus:wu-outline-offset focus:wu-outline-blue-p/80 focus:wu-bg-gray-20 hover:wu-bg-gray-20 wu-rounded-t-sm",pa=e=>{const{children:t,menuTitle:n,MenuTitle:r,variant:s="flat",name:o,open:i,onOpenChange:u,height:l,preventCloseOnClickOutside:d,dir:c,Trigger:w,align:f="start",sideOffset:h=0,side:b="bottom",alignOffset:g,className:v,disabled:N,...y}=e;return a.jsxs(Zo,{...y,open:i,onOpenChange:u,dir:c,children:[a.jsx(Jo,{asChild:!0,dir:c,disabled:N,className:m("disabled:wu-text-zinc-300 disabled:wu-bg-white disabled:wu-cursor-not-allowed disabled:hover:wu-bg-transparent"),children:w??Wg(s,o,N)}),a.jsx(ms,{className:m("wu-w-56 wu-border wu-border-blue-p disabled:wu-border-gray-40",v,"wu-menu-content"),align:f,sideOffset:h,side:b,alignOffset:g,onInteractOutside:C=>d&&C.preventDefault(),children:a.jsxs(Bt,{className:"h-fit",style:{height:l},dir:c,children:[(n||r)&&a.jsxs(a.Fragment,{children:[a.jsx(an,{dir:c,className:"wu-menu-title",children:r||n}),a.jsx(jn,{className:"wu-mt-0 wu-menu-separator",dir:c})]}),t??a.jsx("p",{children:"Menu Is Empty"})]})})]})},Wg=(e,t,n)=>{const r=m(Lg,"wu-flex wu-items-center wu-justify-between wu-gap-2 wu-h-8 wu-text-xs wu-group/wuMenu",e==="outlined"?"wu-border":"wu-border-b","wu-trigger-btn");return a.jsxs("button",{className:r,"aria-label":"menu-trigger",children:[a.jsx("span",{children:t??"Menu"}),a.jsx("span",{className:m("wm-arrow-drop-down wu-text-gray-lead wu-text-base wu-rotate-180 group-data-[state=closed]/wuMenu:wu-rotate-0 wu-transition-transform wu-duration-300 group-hover:wu-text-blue-q",n&&"wu-text-zinc-300 group-hover:wu-text-zinc-300")})]})},Bg=({titles:e,dir:t="ltr",handleTitleClick:n})=>{const[r,s]=p.useState(!1);return a.jsx(pa,{className:"wu-rounded-sm",open:r,onOpenChange:s,dir:t,sideOffset:4,Trigger:a.jsx(Ie,{variant:"iconOnly",className:m("wu-w-6 wu-h-6 wu-shrink-0 wu-rounded-sm"),Icon:a.jsx("span",{className:m("wm-keyboard-arrow-down wu-text-[16px] wu-origin-center wu-transition-transform wu-duration-300",r&&(t==="rtl"?"-wu-rotate-180":"wu-rotate-180"))})}),children:e.map(o=>a.jsx(wr,{onSelect:i=>n(i,o.id),children:o.title},o.id))})},qg=({titles:e,currentLevel:t,initial:n,handleTitleClick:r,headerClasses:s,offsetHeight:o,dir:i="ltr"})=>{const u=p.useMemo(()=>i==="rtl"?{initial:{x:8,opacity:0,zIndex:0},animate:{x:0,opacity:1,zIndex:50},exit:{x:-8,opacity:0,zIndex:0}}:{initial:{x:-8,opacity:0,zIndex:0},animate:{x:0,opacity:1,zIndex:50},exit:{x:8,opacity:0,zIndex:0}},[i]);return a.jsxs("div",{className:m("wu-absolute wu-top-0 wu-left-0 wu-flex wu-gap-x-2 wu-px-4 wu-items-center wu-origin-left wu-w-full wu-transition wu-duration-200",t!==n?"wu-translate-x-0 wu-opacity-100 wu-z-50 wu-delay-200":i==="rtl"?"wu-translate-x-1 wu-opacity-0 wu-z-0 wu-delay-0":"-wu-translate-x-1 wu-opacity-0 wu-z-0 wu-delay-0",s),style:{height:t!==n?`${o}px`:"-40px"},dir:i,children:[a.jsx(Bg,{titles:e,handleTitleClick:r,dir:i}),a.jsx("div",{className:"wu-w-full wu-relative wu-h-full wu-flex wu-items-center wu-flex-nowrap wu-whitespace-nowrap wu-text-nowrap wu-gap-2 wu-overflow-x-auto wu-no-scrollbar wu-snap-x wu-snap-mandatory wu-scroll-smooth",children:a.jsx(tl,{features:dl,children:a.jsxs(Zu,{initial:!1,mode:"popLayout",children:[$g(e).map((l,d)=>a.jsx(wl,{initial:u.initial,animate:u.animate,exit:u.exit,transition:{duration:.4,ease:"easeInOut"},children:a.jsxs("h6",{"data-id":l.id,onClick:r,className:m("wu-flex wu-text-sm wu-leading-4 wu-font-normal wu-items-center wu-gap-2",d===2||d===1||l.id==="LEVEL_DOTS"?"wu-cursor-default wu-text-gray-600":"wu-cursor-pointer wu-text-[#1B87E6] wu-hover:text-[#145DBF]/70"),children:[d!==0&&a.jsx("span",{className:m("wm-keyboard-arrow-right wu-text-[16px] wu-font-light wu-max-w-4 wu-flex wu-justify-center",i==="rtl"&&"wu-rotate-180")}),l.id==="LEVEL_DOTS"?a.jsx("span",{className:"wu-flex wu-justify-center wu-w-[11px]",children:l.title}):l.title]})},l.id)),"``"]})})})]})},$g=e=>{const t=e.length;if(t>2){const n=e[0],r=e[t-1];return[n,{id:"LEVEL_DOTS",title:"..."},r]}return e},Hg=({items:e,initial:t,baseTitle:n,mode:r="popLayout",headerClasses:s="",offsetHeight:o=40,variant:i="default",dir:u="ltr"})=>{const[l,d]=p.useState(n?[n]:[]),[[c,w],f]=p.useState([t,1]),h=(N,y)=>{y&&d([...l,y]),f([N,1])},b=N=>{const y=l.findIndex(C=>C.id===N);if(y!==-1){const C=l.slice(0,y+1);d(C)}f([N,-1])},g=(N,y)=>{const C=y||N.currentTarget.getAttribute("data-id")||"";if(C&&C!==c){const E=l.findIndex(x=>x.id===C);E!==-1&&(d(l.slice(0,E+1)),b(C))}},v=()=>{const N=e[c]?e[c]:null;if(!N)return a.jsx("div",{className:"wu-absolute wu-inset-0 wu-w-full wu-h-full wu-flex wu-items-center wu-justify-center",children:a.jsx("p",{className:"wu-text-gray-500",children:"No content available."})});const y=typeof N.component=="function"?N.component({goNext:h,goBack:b}):N.component;return a.jsx(wl,{dir:u,custom:w,variants:zg(i),initial:"enter",animate:"center",exit:"exit",transition:{opacity:{duration:.325,ease:"easeInOut"},scale:{duration:.275,ease:"easeInOut"}},className:"wu-w-full wu-h-full",style:{paddingTop:c!==t?`${o}px`:"0px"},children:y},c)};return a.jsxs("div",{dir:u,className:"wu-w-full wu-h-full wu-relative wu-overflow-hidden wu-flex wu-flex-col",children:[a.jsx(qg,{titles:l,currentLevel:c,initial:t,handleTitleClick:g,headerClasses:s,offsetHeight:o,dir:u}),a.jsx(tl,{features:dl,children:a.jsx(Zu,{initial:!1,custom:w,mode:r,children:v()})})]})},zg=e=>{switch(e){case"slideRight":return jg;case"slideLeft":return Gg;case"fadeZoom":return Kg;case"default":default:return Ug}},Ug={enter:e=>({scale:e>0?.825:1.1,opacity:0,zIndex:0}),center:{scale:1,opacity:1,zIndex:1},exit:e=>({scale:e>0?1.1:.825,opacity:0,zIndex:0})},jg={enter:e=>({x:e>0?-15:15,opacity:0,zIndex:0}),center:{x:0,opacity:1,zIndex:1},exit:e=>({x:e>0?15:-15,opacity:0,zIndex:0})},Gg={enter:e=>({x:e>0?15:-15,opacity:0,zIndex:0}),center:{x:0,opacity:1,zIndex:1},exit:e=>({x:e>0?-15:15,opacity:0,zIndex:0})},Kg={enter:e=>({opacity:0,zIndex:0,scale:e>0?.925:1.1}),center:{opacity:1,zIndex:1,scale:1},exit:{opacity:0,zIndex:0,scale:1}},fl=({className:e,isLoading:t,loadingText:n,children:r,...s})=>a.jsxs("footer",{className:m("wu-flex wu-items-center wu-justify-between wu-gap-2 wu-border-t wu-border-gray-10 wu-py-3 wu-px-4 wu-bg-white/80 wu-backdrop-blur-sm wu-text-xs wu-font-normal wu-text-gray-footer wu-sticky wu-bottom-0",e),...s,children:[a.jsx("div",{className:"wu-flex-1",children:r}),t&&a.jsx(ct,{size:"16px",variant:"spinner",color:"#a3a3a3",message:n})]});fl.displayName="WuFooter";const pl=p.forwardRef((e,t)=>{const{size:n="sm",idOrSlugOrUrl:r,variant:s="primary",...o}=e,i=n==="sm"?16:18,u=r.includes("http")?r:`/help/${r}.html`,l=s==="primary"?"wu-text-blue-p":"wu-text-gray-lead";return a.jsx("button",{...o,ref:t,onClick:()=>Or(u),children:a.jsx("span",{className:m("wm-help wu-text-gray-subtle",`wu-text-[${i}px]`,l,o.disabled&&"wu-text-neutral-300","wu-help-button-icon")})})});pl.displayName="WuHelpButton";const nt=(e,t)=>`wu-listbox-${e}`;function Yg(e){const{option:t,accessorKey:n,onSelect:r,multiple:s,dir:o,GroupLabel:i,Item:u,isSelected:l,...d}=e,c=n.group&&Array.isArray(t[n.group]),w=({item:f,className:h})=>p.createElement(sn,{...d,key:JSON.stringify(f),onSelect:()=>r==null?void 0:r(f),value:t[n.value],className:m("data-[selected='true']:wu-bg-gray-100 wu-cursor-pointer wu-text-xs wu-min-h-8 wu-py-0 hover:wu-bg-gray-10",!!(l!=null&&l(f))&&!s&&"wu-bg-blue-p/10",o==="rtl"&&"wu-justify-end",h,nt("item")),disabled:f.disabled},s&&a.jsx($e,{checked:l==null?void 0:l(f)}),u?u({value:f,isSelected:l==null?void 0:l(f)}):a.jsx(a.Fragment,{children:f[n.label]}));if(c){const f=t[n.group],h=typeof i=="string"?t[i]:i==null?void 0:i(t);return a.jsx(rn,{heading:h,children:f==null?void 0:f.map(b=>a.jsx(w,{item:b,className:"wu-pl-6"},JSON.stringify(b)))})}return a.jsx(w,{item:t})}const Xg=p.memo(Yg),Zg=e=>{const{className:t,...n}=e;return a.jsxs("div",{className:"wu-relative",children:[a.jsx(Ve,{icon:"wm-search",className:"wu-absolute wu-top-[14px] wu-left-5"}),a.jsx(Yo,{...n,"aria-label":"Search",className:m("wu-bg-gray-10 wu-border-b wu-border-gray-subtle wu-rounded-none wu-rounded-t-sm wu-h-8 wu-my-2 wu-pl-8","focus:wu-border-blue-p focus-visible:wu-outline-none;",nt("input"),t)})]})},Jg=e=>{const{label:t,onSelectAll:n,data:r,value:s}=e,[o,i]=p.useState(!1),[u,l]=p.useState(!1);return p.useEffect(()=>{!s||!r||(i(s.length>0),l(s.length>0&&s.length<r.length))},[r,s]),a.jsxs(sn,{className:"data-[selected='true']:wu-bg-gray-100 wu-cursor-pointer wu-text-xs wu-min-h-8 wu-py-0 hover:wu-bg-gray-100",onSelect:()=>n==null?void 0:n(!o),children:[a.jsx($e,{checked:o,partial:u}),t||"Select All"]})},Qg=e=>{const{CustomTrigger:t,disabled:n,value:r,placeholder:s,accessorKey:o,Chip:i,handleUnselect:u,variant:l,dir:d,className:c,...w}=e,[f,h]=p.useState(),b=p.useRef(null);return p.useEffect(()=>{if(!r){h(null);return}h(Array.isArray(r)?i?r.map((v,N)=>i({value:v,unselect:u,key:N})):r.map(v=>v[o.label]).join(", "):i?i({value:r,unselect:u}):r[o.label])},[r,i,o.label,h]),a.jsx(dt,{asChild:!0,id:e.id,disabled:n,ref:b,children:(t==null?void 0:t(r))||a.jsxs("button",{...w,className:m("wu-group/wuListbox wu-relative wu-min-h-8 wu-text-xs wu-border-gray-subtle wu-bg-gray-10 wu-p-1 wu-pl-2 rtl:wu-pr-2 wu-border-b wu-w-full wu-text-left wu-pr-5 rtl:wu-pl-5","hover:wu-border-blue-p","disabled:wu-cursor-not-allowed disabled:wu-bg-gray-20 disabled:wu-border-gray-40 disabled:wu-text-gray-subtle","rtl:wu-text-right",l==="outlined"&&"wu-border wu-border-gray-subtle wu-bg-white",c,nt("trigger")),children:[a.jsx("div",{className:m("wu-truncate",i&&"wu-flex wu-items-center wu-gap-1 wu-flex-wrap",!f&&"wu-font-light"),children:f||s}),a.jsx(Ve,{icon:"wm-arrow-drop-down",className:m("wu-absolute wu-top-1 wm-arrow-drop-down group-data-[state=open]/wuListbox:wu-rotate-180 wu-transition-transform wu-duration-300 wu-text-base",d==="rtl"?"wu-left-1":"wu-right-1",nt("drop-icon"))})]})})},hl=(e,t,n)=>{const r=String(e[n.label]??"").toLowerCase(),s=String(e[n.value]??"").toLowerCase();return r.includes(t)||s.includes(t)},Rg=(e,t,n)=>{const r=t.trim();if(r==="")return e;const s=r.toLowerCase(),o=[];for(const i of e){const u=n.group,l=u?i[u]:void 0;if(Array.isArray(l)){const d=l.filter(c=>hl(c,s,n));d.length>0&&o.push({...i,[u]:d})}else hl(i,s,n)&&o.push(i)}return o},ml=e=>{const{data:t,accessorKey:n,value:r,Item:s,Label:o,GroupLabel:i,CustomHeader:u,CustomTrigger:l,NoDataContent:d,Chip:c,onSelect:w,onScroll:f,disabled:h,multiple:b,searchable:g,selectAll:v,virtualizedThreshold:N=100,showGroupSeparator:y,id:C,dir:E,className:x,listClass:D,placeholder:T="Select items...",variant:M,labelPosition:I="top",maxContentWidth:_,maxContentHeight:P,modal:A,...O}=e,[F,V]=p.useState(!1),[L,U]=p.useState(""),[H,q]=p.useState(r),Z=p.useMemo(()=>n,[n]),z=p.useMemo(()=>{if(!g||!L)return t;const K=L.toLowerCase().trim();return Rg(t,K,n)},[t,L,n.label,g]),J=K=>{b?q(W=>{const G=K[n.value],Y=Array.isArray(W)?W:[],j=Y.some(X=>X[n.value]===G)?Y.filter(X=>X[n.value]!==G):[...Y,K];return w&&w(j),j}):(q(K),w&&w(K),V(!1))},ie=p.useCallback(K=>{const W=K?t:[];q(W),v!=null&&v.onSelectAll&&v.onSelectAll(K),w&&w(W)},[t,v,w]),R=K=>Array.isArray(H)?H.some(W=>W[n.value]===K[n.value]):(H==null?void 0:H[n.value])===K[n.value];p.useEffect(()=>{q(r)},[r]);const ve=K=>{const W=(G,Y)=>{const Q=n.group&&Array.isArray(G[n.group]),j=y&&Q&&Y>0&&K.length>1;return a.jsxs(p.Fragment,{children:[j&&a.jsx(hs,{}),a.jsx(Xg,{option:G,accessorKey:Z,multiple:b,onSelect:X=>J(X),dir:E,GroupLabel:i,Item:s,isSelected:X=>R(X)})]},JSON.stringify(G))};return K.length>N?a.jsx(Dt,{list:K,callback:(G,Y)=>W(Y,G),dir:E}):K.map((G,Y)=>W(G,Y))};return a.jsxs("div",{className:m("wu-flex wu-text-sm wu-gap-2",I==="top"&&"wu-flex-col wu-gap-1",I==="left"&&"wu-flex-row",I==="right"&&"wu-flex-row-reverse",nt("container")),dir:E,children:[o&&a.jsx(De,{htmlFor:C,className:nt("label"),children:o}),a.jsxs(Ue,{open:F,onOpenChange:K=>{V(K),K||setTimeout(()=>{U("")},100)},modal:A,children:[a.jsx(Qg,{CustomTrigger:l,disabled:h,value:H,accessorKey:n,placeholder:T,Chip:c,className:x,handleUnselect:J,variant:M,id:C,dir:E,...O}),a.jsx(qe,{className:m("wu-min-w-[--radix-popover-trigger-width] wu-max-w-[calc(100vw-32px)] wu-w-auto wu-p-0 wu-bg-white wu-border wu-border-blue-p",nt("content")),align:"start",sideOffset:-1,style:{maxWidth:_},children:a.jsxs(ws,{id:e.id,shouldFilter:!1,children:[g&&a.jsx(Zg,{value:L,onValueChange:U}),u,a.jsxs(fs,{className:m("wu-overflow-y-auto",nt("list"),D),onScroll:f,style:{maxHeight:P||"420px"},children:[a.jsx(ps,{children:d||"No results found."}),a.jsx(rn,{children:b&&(v==null?void 0:v.enabled)&&!L&&a.jsx(Jg,{data:t,value:H,onSelectAll:ie,label:v.label})}),a.jsx(rn,{children:ve(z)})]})]})})]})]})},ha=p.forwardRef(({showMenu:e=!1,className:t,color:n="#1B3380",...r},s)=>{const o=m("wu-w-full wu-border wu-transition-all wu-duration-300");return a.jsxs("div",{...r,className:m("wu-flex wu-flex-col wu-w-[18px] wu-justify-between wu-aspect-[3/2] wu-transition-all wu-duration-300",t),ref:s,"aria-label":"menu-icon",children:[a.jsx("div",{className:`${o} wu-origin-center ${e?"wu-rotate-45 wu-translate-y-[5px]":""}`,style:{borderColor:n}}),a.jsx("div",{className:`${o} ${e?"wu-opacity-0":""}`,style:{borderColor:n}}),a.jsx("div",{className:`${o} wu-origin-center ${e?"-wu-rotate-45 -wu-translate-y-[5px]":""}`,style:{borderColor:n}})]})});ha.displayName="WuMenuIcon";const gl={overlay:"data-[state=open]:wu-animate-in data-[state=closed]:wu-animate-out data-[state=closed]:wu-fade-out-0 data-[state=open]:wu-fade-in-0",content:"data-[state=open]:wu-animate-in data-[state=closed]:wu-animate-out data-[state=closed]:wu-fade-out-0 data-[state=open]:wu-fade-in-0 data-[state=closed]:wu-zoom-out-95 data-[state=open]:wu-zoom-in-95 data-[state=closed]:wu-slide-out-to-left-1/2 data-[state=closed]:wu-slide-out-to-top-[48%] data-[state=open]:wu-slide-in-from-left-1/2 data-[state=open]:wu-slide-in-from-top-[48%]"},bl=te.Root,yl=te.Trigger,eb=te.Portal,tb=te.Close,vl=p.forwardRef(({className:e,...t},n)=>a.jsx(te.Overlay,{ref:n,className:m("wu-fixed wu-inset-0 wu-z-50 wu-bg-black/30",gl.overlay,e),...t}));vl.displayName=te.Overlay.displayName;const ma=p.forwardRef(({className:e,children:t,hideCloseButton:n,isStackedCard:r,...s},o)=>a.jsxs(eb,{children:[a.jsx(vl,{className:r?"wu-bg-transparent":"","data-wu-overlay":!0}),a.jsxs(te.Content,{ref:o,className:m("wu-fixed wu-left-[50%] wu-z-50 wu-top-[50%] wu-flex wu-flex-col wu-w-full wu-max-w-lg wu-translate-x-[-50%] wu-translate-y-[-50%] wu-bg-white wu-shadow-lg wu-duration-200",gl.content,e),...s,children:[t,!n&&a.jsx(te.Close,{"aria-label":"close",asChild:!0,children:a.jsxs(Et,{variant:"iconOnly",className:m("wu-absolute wu-right-2 wu-top-1 hover:wu-bg-black/[0.08] wu-w-8 wu-h-8 wu-p-0","wu-top-3 wu-right-4","group-data-[variant=action]:wu-text-blue-q","group-data-[variant=upgrade]:wu-text-yellow-deep","group-data-[variant=critical]:wu-text-red-deep"),children:[a.jsx("span",{className:"wm-close wu-leading-5"}),a.jsx("span",{className:"wu-sr-only",children:"Close"})]})})]})]}));ma.displayName=te.Content.displayName;const ga=({className:e,...t})=>a.jsx("div",{className:m("wu-text-center wu-bg-gray-20 wu-w-full",e),...t});ga.displayName="DialogHeader";const xl=({className:e,...t})=>a.jsx("div",{className:m("wu-flex wu-flex-col-reverse sm:wu-flex-row sm:wu-justify-end sm:wu-space-x-2 wu-p-4",e),...t});xl.displayName="DialogFooter";const ba=p.forwardRef(({className:e,...t},n)=>a.jsx(te.Title,{ref:n,className:m("wu-text-lg wu-font-medium wu-flex wu-items-center wu-justify-center wu-gap-1 wu-h-10 wu-leading-none wu-tracking-tight",e),...t}));ba.displayName=te.Title.displayName;const nb=p.forwardRef(({className:e,...t},n)=>a.jsx(te.Description,{ref:n,className:m("wu-text-sm wu-text-muted-foreground",e),...t}));nb.displayName=te.Description.displayName;const rb={gradientBackground:"_gradientBackground_1uc4j_1"},Nl=e=>{const{colors:t,size:n=.55,children:r,className:s,strokeWidth:o,centerOffset:i={x:0,y:0},...u}=e,l=p.useRef(null);return p.useEffect(()=>{const d=l.current;if(d){d.style.setProperty("--width",`${d.offsetWidth*n}px`),d.style.setProperty("--height",`${d.offsetHeight*n}px`),d.style.setProperty("--colors",t.join(",")),d.style.setProperty("--stroke-width",`-${o||2}px`),d.style.setProperty("--spotlight-background","radial-gradient(100% var(--height) ellipse at 25% 70%, var(--colors))");let w;const f=h=>{w&&cancelAnimationFrame(w),w=requestAnimationFrame(()=>{const b=d.getBoundingClientRect();let g=h.clientX-b.left,v=h.clientY-b.top;g=Math.max(0,Math.min(g+i.x,b.width)),v=Math.max(0,Math.min(v+i.y,b.height));const N=`radial-gradient(
|
|
15
|
+
`),()=>{var T;(T=u.current)==null||T.removeAttribute("data-motion-pop-id"),I.contains(y)&&I.removeChild(y)}},[t]),a.jsx(Hm,{isPresent:t,childRef:u,sizeRef:l,pop:o,children:o===!1?e:S.cloneElement(e,{ref:w})})}const Um=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:s,presenceAffectsLayout:o,mode:i,anchorX:u,anchorY:l,root:d})=>{const c=ys(jm),w=f.useId();let p=!0,h=f.useMemo(()=>(p=!1,{id:w,initial:t,isPresent:n,custom:s,onExitComplete:b=>{c.set(b,!0);for(const g of c.values())if(!g)return;r&&r()},register:b=>(c.set(b,!1),()=>c.delete(b))}),[n,c,r]);return o&&p&&(h={...h}),f.useMemo(()=>{c.forEach((b,g)=>c.set(g,!1))},[n]),S.useEffect(()=>{!n&&!c.size&&r&&r()},[n]),e=a.jsx(zm,{pop:i==="popLayout",isPresent:n,anchorX:u,anchorY:l,root:d,children:e}),a.jsx(Gn.Provider,{value:h,children:e})};function jm(){return new Map}function Gm(e=!0){const t=f.useContext(Gn);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:s}=t,o=f.useId();f.useEffect(()=>{if(e)return s(o)},[e]);const i=f.useCallback(()=>e&&r&&r(o),[o,r,e]);return!n&&r?[!1,i]:[!0]}const lr=e=>e.key||"";function Ju(e){const t=[];return f.Children.forEach(e,n=>{f.isValidElement(n)&&t.push(n)}),t}const Qu=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:s=!0,mode:o="sync",propagate:i=!1,anchorX:u="left",anchorY:l="top",root:d})=>{const[c,w]=Gm(i),p=f.useMemo(()=>Ju(e),[e]),h=i&&!c?[]:p.map(lr),b=f.useRef(!0),g=f.useRef(p),v=ys(()=>new Map),N=f.useRef(new Set),[x,C]=f.useState(p),[E,y]=f.useState(p);di(()=>{b.current=!1,g.current=p;for(let M=0;M<E.length;M++){const k=lr(E[M]);h.includes(k)?(v.delete(k),N.current.delete(k)):v.get(k)!==!0&&v.set(k,!1)}},[E,h.length,h.join("-")]);const I=[];if(p!==x){let M=[...p];for(let k=0;k<E.length;k++){const _=E[k],P=lr(_);h.includes(P)||(M.splice(k,0,_),I.push(_))}return o==="wait"&&I.length&&(M=I),y(Ju(M)),C(p),null}process.env.NODE_ENV!=="production"&&o==="wait"&&E.length>1&&console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`);const{forceRender:T}=f.useContext(ci);return a.jsx(a.Fragment,{children:E.map(M=>{const k=lr(M),_=i&&!c?!1:p===E||h.includes(k),P=()=>{if(N.current.has(k))return;if(v.has(k))N.current.add(k),v.set(k,!0);else return;let A=!0;v.forEach(O=>{O||(A=!1)}),A&&(T==null||T(),y(g.current),i&&(w==null||w()),r&&r())};return a.jsx(Um,{isPresent:_,initial:!b.current||n?void 0:!1,custom:t,presenceAffectsLayout:s,mode:o,root:d,onExitComplete:_?void 0:P,anchorX:u,anchorY:l,children:M},k)})})},ua=f.createContext({strict:!1}),Ru={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let el=!1;function Km(){if(el)return;const e={};for(const t in Ru)e[t]={isEnabled:n=>Ru[t].some(r=>!!n[r])};Lu(e),el=!0}function tl(){return Km(),hm()}function nl(e){const t=tl();for(const n in e)t[n]={...t[n],...e[n]};Lu(t)}function rl({children:e,features:t,strict:n=!1}){const[,r]=f.useState(!la(t)),s=f.useRef(void 0);if(!la(t)){const{renderer:o,...i}=t;s.current=o,nl(i)}return f.useEffect(()=>{la(t)&&t().then(({renderer:o,...i})=>{nl(i),s.current=o,r(!0)})},[]),a.jsx(ua.Provider,{value:{renderer:s.current,strict:n},children:e})}function la(e){return typeof e=="function"}const Ym=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function cr(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||Ym.has(e)}let sl=e=>!cr(e);function Xm(e){typeof e=="function"&&(sl=t=>t.startsWith("on")?!cr(t):e(t))}try{Xm(require("@emotion/is-prop-valid").default)}catch{}function Zm(e,t,n){const r={};for(const s in e)s==="values"&&typeof e.values=="object"||ge(e[s])||(sl(s)||n===!0&&cr(s)||!t&&!cr(s)||e.draggable&&s.startsWith("onDrag"))&&(r[s]=e[s]);return r}const dr=f.createContext({});function Jm(e,t){if(ir(e)){const{initial:n,animate:r}=e;return{initial:n===!1||pn(n)?n:void 0,animate:pn(r)?r:void 0}}return e.inherit!==!1?t:{}}function Qm(e){const{initial:t,animate:n}=Jm(e,f.useContext(dr));return f.useMemo(()=>({initial:t,animate:n}),[al(t),al(n)])}function al(e){return Array.isArray(e)?e.join(" "):e}const ca=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function ol(e,t,n){for(const r in t)!ge(t[r])&&!$u(r,n)&&(e[r]=t[r])}function Rm({transformTemplate:e},t){return f.useMemo(()=>{const n=ca();return aa(n,t,e),Object.assign({},n.vars,n.style)},[t])}function eg(e,t){const n=e.style||{},r={};return ol(r,n,e),Object.assign(r,Rm(e,t)),r}function tg(e,t){const n={},r=eg(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const il=()=>({...ca(),attrs:{}});function ng(e,t,n,r){const s=f.useMemo(()=>{const o=il();return Hu(o,t,Uu(r),e.transformTemplate,e.style),{...o.attrs,style:{...o.style}}},[t]);if(e.style){const o={};ol(o,e.style,e),s.style={...o,...s.style}}return s}const rg=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function da(e){return typeof e!="string"||e.includes("-")?!1:!!(rg.indexOf(e)>-1||/[A-Z]/u.test(e))}function sg(e,t,n,{latestValues:r},s,o=!1,i){const l=(i??da(e)?ng:tg)(t,r,s,e),d=Zm(t,typeof e=="string",o),c=e!==f.Fragment?{...d,...l,ref:n}:{},{children:w}=t,p=f.useMemo(()=>ge(w)?w.get():w,[w]);return f.createElement(e,{...c,children:p})}function ag({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,s){return{latestValues:og(n,r,s,e),renderState:t()}}function og(e,t,n,r){const s={},o=r(e,{});for(const p in o)s[p]=Bm(o[p]);let{initial:i,animate:u}=e;const l=ir(e),d=Vu(e);t&&d&&!l&&e.inherit!==!1&&(i===void 0&&(i=t.initial),u===void 0&&(u=t.animate));let c=n?n.initial===!1:!1;c=c||i===!1;const w=c?u:i;if(w&&typeof w!="boolean"&&!or(w)){const p=Array.isArray(w)?w:[w];for(let h=0;h<p.length;h++){const b=Ys(e,p[h]);if(b){const{transitionEnd:g,transition:v,...N}=b;for(const x in N){let C=N[x];if(Array.isArray(C)){const E=c?C.length-1:0;C=C[E]}C!==null&&(s[x]=C)}for(const x in g)s[x]=g[x]}}}return s}const ul=e=>(t,n)=>{const r=f.useContext(dr),s=f.useContext(Gn),o=()=>ag(e,t,r,s);return n?o():ys(o)},ig=ul({scrapeMotionValuesFromProps:oa,createRenderState:ca}),ug=ul({scrapeMotionValuesFromProps:ju,createRenderState:il}),lg=Symbol.for("motionComponentSymbol");function cg(e,t,n){const r=f.useRef(n);f.useInsertionEffect(()=>{r.current=n});const s=f.useRef(null);return f.useCallback(o=>{var u;o&&((u=e.onMount)==null||u.call(e,o));const i=r.current;if(typeof i=="function")if(o){const l=i(o);typeof l=="function"&&(s.current=l)}else s.current?(s.current(),s.current=null):i(o);else i&&(i.current=o);t&&(o?t.mount(o):t.unmount())},[t])}const dg=f.createContext({});function wg(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function fg(e,t,n,r,s,o){var C,E;const{visualElement:i}=f.useContext(dr),u=f.useContext(ua),l=f.useContext(Gn),d=f.useContext(ia),c=d.reducedMotion,w=d.skipAnimations,p=f.useRef(null),h=f.useRef(!1);r=r||u.renderer,!p.current&&r&&(p.current=r(e,{visualState:t,parent:i,props:n,presenceContext:l,blockInitialAnimation:l?l.initial===!1:!1,reducedMotionConfig:c,skipAnimations:w,isSVG:o}),h.current&&p.current&&(p.current.manuallyAnimateOnMount=!0));const b=p.current,g=f.useContext(dg);b&&!b.projection&&s&&(b.type==="html"||b.type==="svg")&&pg(p.current,n,s,g);const v=f.useRef(!1);f.useInsertionEffect(()=>{b&&v.current&&b.update(n,l)});const N=n[bu],x=f.useRef(!!N&&typeof window<"u"&&!((C=window.MotionHandoffIsComplete)!=null&&C.call(window,N))&&((E=window.MotionHasOptimisedAnimation)==null?void 0:E.call(window,N)));return di(()=>{h.current=!0,b&&(v.current=!0,window.MotionIsMounted=!0,b.updateFeatures(),b.scheduleRenderMicrotask(),x.current&&b.animationState&&b.animationState.animateChanges())}),f.useEffect(()=>{b&&(!x.current&&b.animationState&&b.animationState.animateChanges(),x.current&&(queueMicrotask(()=>{var y;(y=window.MotionHandoffMarkAsComplete)==null||y.call(window,N)}),x.current=!1),b.enteringChildren=void 0)}),b}function pg(e,t,n,r){const{layoutId:s,layout:o,drag:i,dragConstraints:u,layoutScroll:l,layoutRoot:d,layoutAnchor:c,layoutCrossfade:w}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:ll(e.parent)),e.projection.setOptions({layoutId:s,layout:o,alwaysMeasureLayout:!!i||u&&wg(u),visualElement:e,animationType:typeof o=="string"?o:"both",initialPromotionConfig:r,crossfade:w,layoutScroll:l,layoutRoot:d,layoutAnchor:c})}function ll(e){if(e)return e.options.allowProjection!==!1?e.projection:ll(e.parent)}function hg(e,{forwardMotionProps:t=!1,type:n}={},r,s){const o=n?n==="svg":da(e),i=o?ug:ig;function u(d,c){let w;const p={...f.useContext(ia),...d,layoutId:mg(d)},{isStatic:h}=p,b=Qm(d),g=i(d,h);if(!h&&typeof window<"u"){gg(p,r);const v=bg(p);w=v.MeasureLayout,b.visualElement=fg(e,g,p,s,v.ProjectionNode,o)}return a.jsxs(dr.Provider,{value:b,children:[w&&b.visualElement?a.jsx(w,{visualElement:b.visualElement,...p}):null,sg(e,d,cg(g,b.visualElement,c),g,h,t,o)]})}u.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const l=f.forwardRef(u);return l[lg]=e,l}function mg({layoutId:e}){const t=f.useContext(ci).id;return t&&e!==void 0?t+"-"+e:e}function gg(e,t){f.useContext(ua).strict,process.env.NODE_ENV}function bg(e){const t=tl(),{drag:n,layout:r}=t;if(!n&&!r)return{};const s={...n,...r};return{MeasureLayout:n!=null&&n.isEnabled(e)||r!=null&&r.isEnabled(e)?s.MeasureLayout:void 0,ProjectionNode:s.ProjectionNode}}const yg=(e,t)=>t.isSVG??da(e)?new _m(t):new Em(t,{allowProjection:e!==f.Fragment});class vg extends Wt{constructor(t){super(t),t.animationState||(t.animationState=Lm(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();or(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)==null||t.call(this)}}let xg=0;class Ng extends Wt{constructor(){super(...arguments),this.id=xg++,this.isExitComplete=!1}update(){var o;if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;if(t&&r===!1){if(this.isExitComplete){const{initial:i,custom:u}=this.node.getProps();if(typeof i=="string"){const l=gt(this.node,i,u);if(l){const{transition:d,transitionEnd:c,...w}=l;for(const p in w)(o=this.node.getValue(p))==null||o.jump(w[p])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);this.isExitComplete=!1;return}const s=this.node.animationState.setActive("exit",!t);n&&!t&&s.then(()=>{this.isExitComplete=!0,n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const Sg={animation:{Feature:vg},exit:{Feature:Ng}};function cl(e){return{point:{x:e.pageX,y:e.pageY}}}function dl(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const s="onHover"+n,o=r[s];o&&Oe.postRender(()=>o(t,cl(t)))}class Cg extends Wt{mount(){const{current:t}=this.node;t&&(this.unmount=rm(t,(n,r)=>(dl(this.node,r,"Start"),s=>dl(this.node,s,"End"))))}unmount(){}}class Tg extends Wt{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Kn(Xu(this.node.current,"focus",()=>this.onFocus()),Xu(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function wl(e,t,n){const{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const s="onTap"+(n==="End"?"":n),o=r[s];o&&Oe.postRender(()=>o(t,cl(t)))}class Eg extends Wt{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:n,propagate:r}=this.node.props;this.unmount=um(t,(s,o)=>(wl(this.node,o,"Start"),(i,{success:u})=>wl(this.node,i,u?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:(r==null?void 0:r.tap)===!1})}unmount(){}}const wa=new WeakMap,fa=new WeakMap,Mg=e=>{const t=wa.get(e.target);t&&t(e)},Ig=e=>{e.forEach(Mg)};function kg({root:e,...t}){const n=e||document;fa.has(n)||fa.set(n,{});const r=fa.get(n),s=JSON.stringify(t);return r[s]||(r[s]=new IntersectionObserver(Ig,{root:e,...t})),r[s]}function Dg(e,t,n){const r=kg(t);return wa.set(e,n),r.observe(e),()=>{wa.delete(e),r.unobserve(e)}}const Ag={some:0,all:1};class _g extends Wt{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){var l;(l=this.stopObserver)==null||l.call(this);const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:s="some",once:o}=t,i={root:n?n.current:void 0,rootMargin:r,threshold:typeof s=="number"?s:Ag[s]},u=d=>{const{isIntersecting:c}=d;if(this.isInView===c||(this.isInView=c,o&&!c&&this.hasEnteredView))return;c&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",c);const{onViewportEnter:w,onViewportLeave:p}=this.node.getProps(),h=c?w:p;h&&h(d)};this.stopObserver=Dg(this.node.current,i,u)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(Pg(t,n))&&this.startObserver()}unmount(){var t;(t=this.stopObserver)==null||t.call(this),this.hasEnteredView=!1,this.isInView=!1}}function Pg({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const fl={renderer:yg,...Sg,...{inView:{Feature:_g},tap:{Feature:Eg},focus:{Feature:Tg},hover:{Feature:Cg}}};function Vg(e,t){return hg(e,t)}const pl=Vg("div"),Og=e=>{const{checked:t,onSelect:n,children:r,disabled:s,preventCloseOnSelect:o}=e;return a.jsx(ri,{disabled:s,checked:t,onCheckedChange:n,onSelect:i=>o&&i.preventDefault(),children:r})},wr=e=>{const{children:t,className:n,Icon:r,iconPosition:s="left",disabled:o,onSelect:i,preventCloseOnSelect:u}=e,l=m("wu-flex wu-items-center wu-gap-2",r&&(s==="left"?"":"wu-justify-between wu-flex-row-reverse"),n),d=c=>{i&&i(c),u&&c.preventDefault()};return a.jsxs(Un,{onSelect:d,disabled:o,className:l,children:[r&&a.jsx("div",{className:"wu-text-base",children:r}),t]})},Fg=e=>{const{children:t,Label:n,...r}=e;return a.jsxs(ei,{...r,children:[a.jsx(an,{children:n||e.label}),t]})},Lg=e=>{const{options:t,value:n,onSelect:r}=e;return a.jsx(kf,{value:n,onValueChange:r,children:t.map(s=>a.jsx(si,{value:s.value,disabled:s.disabled,children:s.Label||s.label},s.value))})},Wg=e=>{const{className:t,...n}=e,r=m("wu-w-11/12 wu-mx-auto wu-border-gray-40",t);return a.jsx(jn,{...n,className:r})},Bt=S.forwardRef(({className:e,children:t,thumbColor:n,railColor:r,...s},o)=>a.jsxs(ut.Root,{ref:o,className:m("wu-relative wu-overflow-hidden",e),children:[a.jsx(ut.Viewport,{className:"wu-h-full wu-w-full wu-rounded-[inherit]",...s,children:t}),a.jsx(pa,{thumbColor:n,railColor:r}),a.jsx(ut.Corner,{})]}));Bt.displayName=ut.Root.displayName;const pa=S.forwardRef(({className:e,orientation:t="vertical",thumbColor:n="#d4d4d4",railColor:r="#eeeeee",...s},o)=>a.jsx(ut.ScrollAreaScrollbar,{ref:o,orientation:t,className:m("wu-flex wu-touch-none wu-select-none wu-transition-colors",t==="vertical"&&"wu-h-full wu-w-2 wu-border-l wu-border-l-transparent wu-p-[1px]",t==="horizontal"&&"wu-h-2 wu-flex-col wu-border-t wu-border-t-transparent wu-p-[1px]",e),style:{background:r},...s,children:a.jsx(ut.ScrollAreaThumb,{className:"wu-relative wu-flex-1 wu-rounded-full",style:{background:n}})}));pa.displayName=ut.ScrollAreaScrollbar.displayName;const Bg=e=>{const{children:t,label:n,Label:r,open:s,onOpenChange:o,height:i,dir:u,...l}=e;return a.jsxs(If,{...l,open:s,onOpenChange:o,children:[a.jsx(ti,{dir:u,children:r||n}),a.jsx(Mf,{children:a.jsx(ni,{onInteractOutside:d=>d.preventDefault(),children:a.jsx(Bt,{className:"wu-h-fit",style:{height:i},dir:u,children:t})})})]})},qg="wu-p-1.5 wu-cursor-pointer hover:wu-bg-gray-20 wu-border-gray-40 wu-transition wu-duration-300 focus:wu-outline-2 focus:wu-outline-offset focus:wu-outline-blue-p/80 focus:wu-bg-gray-20 hover:wu-bg-gray-20 wu-rounded-t-sm",ha=e=>{const{children:t,menuTitle:n,MenuTitle:r,variant:s="flat",name:o,open:i,onOpenChange:u,height:l,preventCloseOnClickOutside:d,dir:c,Trigger:w,align:p="start",sideOffset:h=0,side:b="bottom",alignOffset:g,className:v,disabled:N,...x}=e;return a.jsxs(Qo,{...x,open:i,onOpenChange:u,dir:c,children:[a.jsx(Ro,{asChild:!0,dir:c,disabled:N,className:m("disabled:wu-text-zinc-300 disabled:wu-bg-white disabled:wu-cursor-not-allowed disabled:hover:wu-bg-transparent"),children:w??$g(s,o,N)}),a.jsx(gs,{className:m("wu-w-56 wu-border wu-border-blue-p disabled:wu-border-gray-40",v,"wu-menu-content"),align:p,sideOffset:h,side:b,alignOffset:g,onInteractOutside:C=>d&&C.preventDefault(),children:a.jsxs(Bt,{className:"h-fit",style:{height:l},dir:c,children:[(n||r)&&a.jsxs(a.Fragment,{children:[a.jsx(an,{dir:c,className:"wu-menu-title",children:r||n}),a.jsx(jn,{className:"wu-mt-0 wu-menu-separator",dir:c})]}),t??a.jsx("p",{children:"Menu Is Empty"})]})})]})},$g=(e,t,n)=>{const r=m(qg,"wu-flex wu-items-center wu-justify-between wu-gap-2 wu-h-8 wu-text-xs wu-group/wuMenu",e==="outlined"?"wu-border":"wu-border-b","wu-trigger-btn");return a.jsxs("button",{className:r,"aria-label":"menu-trigger",children:[a.jsx("span",{children:t??"Menu"}),a.jsx("span",{className:m("wm-arrow-drop-down wu-text-gray-lead wu-text-base wu-rotate-180 group-data-[state=closed]/wuMenu:wu-rotate-0 wu-transition-transform wu-duration-300 group-hover:wu-text-blue-q",n&&"wu-text-zinc-300 group-hover:wu-text-zinc-300")})]})},Hg=({titles:e,dir:t="ltr",handleTitleClick:n})=>{const[r,s]=f.useState(!1);return a.jsx(ha,{className:"wu-rounded-sm",open:r,onOpenChange:s,dir:t,sideOffset:4,Trigger:a.jsx(Ee,{variant:"iconOnly",className:m("wu-w-6 wu-h-6 wu-shrink-0 wu-rounded-sm"),Icon:a.jsx("span",{className:m("wm-keyboard-arrow-down wu-text-[16px] wu-origin-center wu-transition-transform wu-duration-300",r&&(t==="rtl"?"-wu-rotate-180":"wu-rotate-180"))})}),children:e.map(o=>a.jsx(wr,{onSelect:i=>n(i,o.id),children:o.title},o.id))})},zg=({titles:e,currentLevel:t,initial:n,handleTitleClick:r,headerClasses:s,offsetHeight:o,dir:i="ltr"})=>{const u=f.useMemo(()=>i==="rtl"?{initial:{x:8,opacity:0,zIndex:0},animate:{x:0,opacity:1,zIndex:50},exit:{x:-8,opacity:0,zIndex:0}}:{initial:{x:-8,opacity:0,zIndex:0},animate:{x:0,opacity:1,zIndex:50},exit:{x:8,opacity:0,zIndex:0}},[i]);return a.jsxs("div",{className:m("wu-absolute wu-top-0 wu-left-0 wu-flex wu-gap-x-2 wu-px-4 wu-items-center wu-origin-left wu-w-full wu-transition wu-duration-200",t!==n?"wu-translate-x-0 wu-opacity-100 wu-z-50 wu-delay-200":i==="rtl"?"wu-translate-x-1 wu-opacity-0 wu-z-0 wu-delay-0":"-wu-translate-x-1 wu-opacity-0 wu-z-0 wu-delay-0",s),style:{height:t!==n?`${o}px`:"-40px"},dir:i,children:[a.jsx(Hg,{titles:e,handleTitleClick:r,dir:i}),a.jsx("div",{className:"wu-w-full wu-relative wu-h-full wu-flex wu-items-center wu-flex-nowrap wu-whitespace-nowrap wu-text-nowrap wu-gap-2 wu-overflow-x-auto wu-no-scrollbar wu-snap-x wu-snap-mandatory wu-scroll-smooth",children:a.jsx(rl,{features:fl,children:a.jsxs(Qu,{initial:!1,mode:"popLayout",children:[Ug(e).map((l,d)=>a.jsx(pl,{initial:u.initial,animate:u.animate,exit:u.exit,transition:{duration:.4,ease:"easeInOut"},children:a.jsxs("h6",{"data-id":l.id,onClick:r,className:m("wu-flex wu-text-sm wu-leading-4 wu-font-normal wu-items-center wu-gap-2",d===2||d===1||l.id==="LEVEL_DOTS"?"wu-cursor-default wu-text-gray-600":"wu-cursor-pointer wu-text-[#1B87E6] wu-hover:text-[#145DBF]/70"),children:[d!==0&&a.jsx("span",{className:m("wm-keyboard-arrow-right wu-text-[16px] wu-font-light wu-max-w-4 wu-flex wu-justify-center",i==="rtl"&&"wu-rotate-180")}),l.id==="LEVEL_DOTS"?a.jsx("span",{className:"wu-flex wu-justify-center wu-w-[11px]",children:l.title}):l.title]})},l.id)),"``"]})})})]})},Ug=e=>{const t=e.length;if(t>2){const n=e[0],r=e[t-1];return[n,{id:"LEVEL_DOTS",title:"..."},r]}return e},jg=({items:e,initial:t,baseTitle:n,mode:r="popLayout",headerClasses:s="",offsetHeight:o=40,variant:i="default",dir:u="ltr"})=>{const[l,d]=f.useState(n?[n]:[]),[[c,w],p]=f.useState([t,1]),h=(N,x)=>{x&&d([...l,x]),p([N,1])},b=N=>{const x=l.findIndex(C=>C.id===N);if(x!==-1){const C=l.slice(0,x+1);d(C)}p([N,-1])},g=(N,x)=>{const C=x||N.currentTarget.getAttribute("data-id")||"";if(C&&C!==c){const E=l.findIndex(y=>y.id===C);E!==-1&&(d(l.slice(0,E+1)),b(C))}},v=()=>{const N=e[c]?e[c]:null;if(!N)return a.jsx("div",{className:"wu-absolute wu-inset-0 wu-w-full wu-h-full wu-flex wu-items-center wu-justify-center",children:a.jsx("p",{className:"wu-text-gray-500",children:"No content available."})});const x=typeof N.component=="function"?N.component({goNext:h,goBack:b}):N.component;return a.jsx(pl,{dir:u,custom:w,variants:Gg(i),initial:"enter",animate:"center",exit:"exit",transition:{opacity:{duration:.325,ease:"easeInOut"},scale:{duration:.275,ease:"easeInOut"}},className:"wu-w-full wu-h-full",style:{paddingTop:c!==t?`${o}px`:"0px"},children:x},c)};return a.jsxs("div",{dir:u,className:"wu-w-full wu-h-full wu-relative wu-overflow-hidden wu-flex wu-flex-col",children:[a.jsx(zg,{titles:l,currentLevel:c,initial:t,handleTitleClick:g,headerClasses:s,offsetHeight:o,dir:u}),a.jsx(rl,{features:fl,children:a.jsx(Qu,{initial:!1,custom:w,mode:r,children:v()})})]})},Gg=e=>{switch(e){case"slideRight":return Yg;case"slideLeft":return Xg;case"fadeZoom":return Zg;case"default":default:return Kg}},Kg={enter:e=>({scale:e>0?.825:1.1,opacity:0,zIndex:0}),center:{scale:1,opacity:1,zIndex:1},exit:e=>({scale:e>0?1.1:.825,opacity:0,zIndex:0})},Yg={enter:e=>({x:e>0?-15:15,opacity:0,zIndex:0}),center:{x:0,opacity:1,zIndex:1},exit:e=>({x:e>0?15:-15,opacity:0,zIndex:0})},Xg={enter:e=>({x:e>0?15:-15,opacity:0,zIndex:0}),center:{x:0,opacity:1,zIndex:1},exit:e=>({x:e>0?-15:15,opacity:0,zIndex:0})},Zg={enter:e=>({opacity:0,zIndex:0,scale:e>0?.925:1.1}),center:{opacity:1,zIndex:1,scale:1},exit:{opacity:0,zIndex:0,scale:1}},hl=({className:e,isLoading:t,loadingText:n,children:r,...s})=>a.jsxs("footer",{className:m("wu-flex wu-items-center wu-justify-between wu-gap-2 wu-border-t wu-border-gray-10 wu-py-3 wu-px-4 wu-bg-white/80 wu-backdrop-blur-sm wu-text-xs wu-font-normal wu-text-gray-footer wu-sticky wu-bottom-0",e),...s,children:[a.jsx("div",{className:"wu-flex-1",children:r}),t&&a.jsx(ct,{size:"16px",variant:"spinner",color:"#a3a3a3",message:n})]});hl.displayName="WuFooter";const ml=f.forwardRef((e,t)=>{const{size:n="sm",idOrSlugOrUrl:r,variant:s="primary",...o}=e,i=n==="sm"?16:18,u=r.includes("http")?r:`/help/${r}.html`,l=s==="primary"?"wu-text-blue-p":"wu-text-gray-lead";return a.jsx("button",{...o,ref:t,onClick:()=>Fr(u),children:a.jsx("span",{className:m("wm-help wu-text-gray-subtle",`wu-text-[${i}px]`,l,o.disabled&&"wu-text-neutral-300","wu-help-button-icon")})})});ml.displayName="WuHelpButton";const nt=(e,t)=>`wu-listbox-${e}`;function Jg(e){const{option:t,accessorKey:n,onSelect:r,multiple:s,dir:o,GroupLabel:i,Item:u,isSelected:l,...d}=e,c=n.group&&Array.isArray(t[n.group]),w=({item:p,className:h})=>f.createElement(sn,{...d,key:JSON.stringify(p),onSelect:()=>r==null?void 0:r(p),value:t[n.value],className:m("data-[selected='true']:wu-bg-gray-100 wu-cursor-pointer wu-text-xs wu-min-h-8 wu-py-0 hover:wu-bg-gray-10",!!(l!=null&&l(p))&&!s&&"wu-bg-blue-p/10",o==="rtl"&&"wu-justify-end",h,nt("item")),disabled:p.disabled},s&&a.jsx(qe,{checked:l==null?void 0:l(p)}),u?u({value:p,isSelected:l==null?void 0:l(p)}):a.jsx(a.Fragment,{children:p[n.label]}));if(c){const p=t[n.group],h=typeof i=="string"?t[i]:i==null?void 0:i(t);return a.jsx(rn,{heading:h,children:p==null?void 0:p.map(b=>a.jsx(w,{item:b,className:"wu-pl-6"},JSON.stringify(b)))})}return a.jsx(w,{item:t})}const Qg=f.memo(Jg),Rg=e=>{const{className:t,...n}=e;return a.jsxs("div",{className:"wu-relative",children:[a.jsx(Pe,{icon:"wm-search",className:"wu-absolute wu-top-[14px] wu-left-5"}),a.jsx(Zo,{...n,"aria-label":"Search",className:m("wu-bg-gray-10 wu-border-b wu-border-gray-subtle wu-rounded-none wu-rounded-t-sm wu-h-8 wu-my-2 wu-pl-8","focus:wu-border-blue-p focus-visible:wu-outline-none;",nt("input"),t)})]})},eb=e=>{const{label:t,onSelectAll:n,data:r,value:s}=e,[o,i]=f.useState(!1),[u,l]=f.useState(!1);return f.useEffect(()=>{!s||!r||(i(s.length>0),l(s.length>0&&s.length<r.length))},[r,s]),a.jsxs(sn,{className:"data-[selected='true']:wu-bg-gray-100 wu-cursor-pointer wu-text-xs wu-min-h-8 wu-py-0 hover:wu-bg-gray-100",onSelect:()=>n==null?void 0:n(!o),children:[a.jsx(qe,{checked:o,partial:u}),t||"Select All"]})},tb=e=>{const{CustomTrigger:t,disabled:n,value:r,placeholder:s,accessorKey:o,Chip:i,handleUnselect:u,variant:l,dir:d,className:c,...w}=e,[p,h]=f.useState(),b=f.useRef(null);return f.useEffect(()=>{if(!r){h(null);return}h(Array.isArray(r)?i?r.map((v,N)=>i({value:v,unselect:u,key:N})):r.map(v=>v[o.label]).join(", "):i?i({value:r,unselect:u}):r[o.label])},[r,i,o.label,h]),a.jsx(dt,{asChild:!0,id:e.id,disabled:n,ref:b,children:(t==null?void 0:t(r))||a.jsxs("button",{...w,className:m("wu-group/wuListbox wu-relative wu-min-h-8 wu-text-xs wu-border-gray-subtle wu-bg-gray-10 wu-p-1 wu-pl-2 rtl:wu-pr-2 wu-border-b wu-w-full wu-text-left wu-pr-5 rtl:wu-pl-5","hover:wu-border-blue-p","disabled:wu-cursor-not-allowed disabled:wu-bg-gray-20 disabled:wu-border-gray-40 disabled:wu-text-gray-subtle","rtl:wu-text-right",l==="outlined"&&"wu-border wu-border-gray-subtle wu-bg-white",c,nt("trigger")),children:[a.jsx("div",{className:m("wu-truncate",i&&"wu-flex wu-items-center wu-gap-1 wu-flex-wrap",!p&&"wu-font-light"),children:p||s}),a.jsx(Pe,{icon:"wm-arrow-drop-down",className:m("wu-absolute wu-top-1 wm-arrow-drop-down group-data-[state=open]/wuListbox:wu-rotate-180 wu-transition-transform wu-duration-300 wu-text-base",d==="rtl"?"wu-left-1":"wu-right-1",nt("drop-icon"))})]})})},gl=(e,t,n)=>{const r=String(e[n.label]??"").toLowerCase(),s=String(e[n.value]??"").toLowerCase();return r.includes(t)||s.includes(t)},nb=(e,t,n)=>{const r=t.trim();if(r==="")return e;const s=r.toLowerCase(),o=[];for(const i of e){const u=n.group,l=u?i[u]:void 0;if(Array.isArray(l)){const d=l.filter(c=>gl(c,s,n));d.length>0&&o.push({...i,[u]:d})}else gl(i,s,n)&&o.push(i)}return o},bl=e=>{const{data:t,accessorKey:n,value:r,Item:s,Label:o,GroupLabel:i,CustomHeader:u,CustomTrigger:l,NoDataContent:d,Chip:c,onSelect:w,onScroll:p,disabled:h,multiple:b,searchable:g,selectAll:v,virtualizedThreshold:N=100,showGroupSeparator:x,id:C,dir:E,className:y,listClass:I,placeholder:T="Select items...",variant:M,labelPosition:k="top",maxContentWidth:_,maxContentHeight:P,modal:A,...O}=e,[F,V]=f.useState(!1),[W,J]=f.useState(""),[H,q]=f.useState(r),Q=f.useMemo(()=>n,[n]),z=f.useMemo(()=>{if(!g||!W)return t;const K=W.toLowerCase().trim();return nb(t,K,n)},[t,W,n.label,g]),R=K=>{b?q(L=>{const j=K[n.value],Y=Array.isArray(L)?L:[],G=Y.some(U=>U[n.value]===j)?Y.filter(U=>U[n.value]!==j):[...Y,K];return w&&w(G),G}):(q(K),w&&w(K),V(!1))},ee=f.useCallback(K=>{const L=K?t:[];q(L),v!=null&&v.onSelectAll&&v.onSelectAll(K),w&&w(L)},[t,v,w]),fe=K=>Array.isArray(H)?H.some(L=>L[n.value]===K[n.value]):(H==null?void 0:H[n.value])===K[n.value];f.useEffect(()=>{q(r)},[r]);const ze=K=>{const L=(j,Y)=>{const X=n.group&&Array.isArray(j[n.group]),G=x&&X&&Y>0&&K.length>1;return a.jsxs(f.Fragment,{children:[G&&a.jsx(ms,{}),a.jsx(Qg,{option:j,accessorKey:Q,multiple:b,onSelect:U=>R(U),dir:E,GroupLabel:i,Item:s,isSelected:U=>fe(U)})]},JSON.stringify(j))};return K.length>N?a.jsx(kt,{list:K,callback:(j,Y)=>L(Y,j),dir:E}):K.map((j,Y)=>L(j,Y))};return a.jsxs("div",{className:m("wu-flex wu-text-sm wu-gap-2",k==="top"&&"wu-flex-col wu-gap-1",k==="left"&&"wu-flex-row",k==="right"&&"wu-flex-row-reverse",nt("container")),dir:E,children:[o&&a.jsx(Me,{htmlFor:C,className:nt("label"),children:o}),a.jsxs(Ue,{open:F,onOpenChange:K=>{V(K),K||setTimeout(()=>{J("")},100)},modal:A,children:[a.jsx(tb,{CustomTrigger:l,disabled:h,value:H,accessorKey:n,placeholder:T,Chip:c,className:y,handleUnselect:R,variant:M,id:C,dir:E,...O}),a.jsx(Be,{className:m("wu-min-w-[--radix-popover-trigger-width] wu-max-w-[calc(100vw-32px)] wu-w-auto wu-p-0 wu-bg-white wu-border wu-border-blue-p",nt("content")),align:"start",sideOffset:-1,style:{maxWidth:_},children:a.jsxs(fs,{id:e.id,shouldFilter:!1,children:[g&&a.jsx(Rg,{value:W,onValueChange:J}),u,a.jsxs(ps,{className:m("wu-overflow-y-auto",nt("list"),I),onScroll:p,style:{maxHeight:P||"420px"},children:[a.jsx(hs,{children:d||"No results found."}),a.jsx(rn,{children:b&&(v==null?void 0:v.enabled)&&!W&&a.jsx(eb,{data:t,value:H,onSelectAll:ee,label:v.label})}),a.jsx(rn,{children:ze(z)})]})]})})]})]})},ma=f.forwardRef(({showMenu:e=!1,className:t,color:n="#1B3380",...r},s)=>{const o=m("wu-w-full wu-border wu-transition-all wu-duration-300");return a.jsxs("div",{...r,className:m("wu-flex wu-flex-col wu-w-[18px] wu-justify-between wu-aspect-[3/2] wu-transition-all wu-duration-300",t),ref:s,"aria-label":"menu-icon",children:[a.jsx("div",{className:`${o} wu-origin-center ${e?"wu-rotate-45 wu-translate-y-[5px]":""}`,style:{borderColor:n}}),a.jsx("div",{className:`${o} ${e?"wu-opacity-0":""}`,style:{borderColor:n}}),a.jsx("div",{className:`${o} wu-origin-center ${e?"-wu-rotate-45 -wu-translate-y-[5px]":""}`,style:{borderColor:n}})]})});ma.displayName="WuMenuIcon";const yl={overlay:"data-[state=open]:wu-animate-in data-[state=closed]:wu-animate-out data-[state=closed]:wu-fade-out-0 data-[state=open]:wu-fade-in-0",content:"data-[state=open]:wu-animate-in data-[state=closed]:wu-animate-out data-[state=closed]:wu-fade-out-0 data-[state=open]:wu-fade-in-0 data-[state=closed]:wu-zoom-out-95 data-[state=open]:wu-zoom-in-95 data-[state=closed]:wu-slide-out-to-left-1/2 data-[state=closed]:wu-slide-out-to-top-[48%] data-[state=open]:wu-slide-in-from-left-1/2 data-[state=open]:wu-slide-in-from-top-[48%]"},vl=te.Root,xl=te.Trigger,rb=te.Portal,sb=te.Close,Nl=f.forwardRef(({className:e,...t},n)=>a.jsx(te.Overlay,{ref:n,className:m("wu-fixed wu-inset-0 wu-z-50 wu-bg-black/30",yl.overlay,e),...t}));Nl.displayName=te.Overlay.displayName;const ga=f.forwardRef(({className:e,children:t,hideCloseButton:n,isStackedCard:r,...s},o)=>a.jsxs(rb,{children:[a.jsx(Nl,{className:r?"wu-bg-transparent":"","data-wu-overlay":!0}),a.jsxs(te.Content,{ref:o,className:m("wu-fixed wu-left-[50%] wu-z-50 wu-top-[50%] wu-flex wu-flex-col wu-w-full wu-max-w-lg wu-translate-x-[-50%] wu-translate-y-[-50%] wu-bg-white wu-shadow-lg wu-duration-200",yl.content,e),...s,children:[t,!n&&a.jsx(te.Close,{"aria-label":"close",asChild:!0,children:a.jsxs(Et,{variant:"iconOnly",className:m("wu-absolute wu-right-2 wu-top-1 hover:wu-bg-black/[0.08] wu-w-8 wu-h-8 wu-p-0","wu-top-3 wu-right-4","group-data-[variant=action]:wu-text-blue-q","group-data-[variant=upgrade]:wu-text-yellow-deep","group-data-[variant=critical]:wu-text-red-deep"),children:[a.jsx("span",{className:"wm-close wu-leading-5"}),a.jsx("span",{className:"wu-sr-only",children:"Close"})]})})]})]}));ga.displayName=te.Content.displayName;const ba=({className:e,...t})=>a.jsx("div",{className:m("wu-text-center wu-bg-gray-20 wu-w-full",e),...t});ba.displayName="DialogHeader";const Sl=({className:e,...t})=>a.jsx("div",{className:m("wu-flex wu-flex-col-reverse sm:wu-flex-row sm:wu-justify-end sm:wu-space-x-2 wu-p-4",e),...t});Sl.displayName="DialogFooter";const ya=f.forwardRef(({className:e,...t},n)=>a.jsx(te.Title,{ref:n,className:m("wu-text-lg wu-font-medium wu-flex wu-items-center wu-justify-center wu-gap-1 wu-h-10 wu-leading-none wu-tracking-tight",e),...t}));ya.displayName=te.Title.displayName;const ab=f.forwardRef(({className:e,...t},n)=>a.jsx(te.Description,{ref:n,className:m("wu-text-sm wu-text-muted-foreground",e),...t}));ab.displayName=te.Description.displayName;const ob={gradientBackground:"_gradientBackground_1uc4j_1"},Cl=e=>{const{colors:t,size:n=.55,children:r,className:s,strokeWidth:o,centerOffset:i={x:0,y:0},...u}=e,l=f.useRef(null);return f.useEffect(()=>{const d=l.current;if(d){d.style.setProperty("--width",`${d.offsetWidth*n}px`),d.style.setProperty("--height",`${d.offsetHeight*n}px`),d.style.setProperty("--colors",t.join(",")),d.style.setProperty("--stroke-width",`-${o||2}px`),d.style.setProperty("--spotlight-background","radial-gradient(100% var(--height) ellipse at 25% 70%, var(--colors))");let w;const p=h=>{w&&cancelAnimationFrame(w),w=requestAnimationFrame(()=>{const b=d.getBoundingClientRect();let g=h.clientX-b.left,v=h.clientY-b.top;g=Math.max(0,Math.min(g+i.x,b.width)),v=Math.max(0,Math.min(v+i.y,b.height));const N=`radial-gradient(
|
|
16
16
|
var(--width) var(--height) ellipse at ${g}px ${v}px,
|
|
17
17
|
var(--colors)
|
|
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:`
|
|
18
|
+
)`;d.style.setProperty("--spotlight-background",N)})};return window.addEventListener("mousemove",p),()=>{window.removeEventListener("mousemove",p),w&&cancelAnimationFrame(w)}}},[t,n,o,i]),a.jsx("div",{ref:l,className:m(ob.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"},Tl="calc(100vh - 64px)",ib={sm:"400px",md:"600px",lg:"1200px"},ub=({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:p="action",allowExternalPortals:h,onOpenAutoFocus:b,onCloseAutoFocus:g,...v})=>{const N={action:["#EEF3FBcc 32%","#1D50F4cc"],upgrade:["#FDEDCCcc 32%","#FF9F00cc"],critical:["#FFB6B6cc 32%","#CC0000cc"]},x=f.useRef(null),C=f.useRef(null);return f.useEffect(()=>()=>{x.current&&(document.removeEventListener("focusin",x.current.focusin,!0),document.removeEventListener("focusout",x.current.focusout,!0),document.body.style.pointerEvents="",x.current=null)},[]),a.jsxs(vl,{modal:!0,onOpenChange:o,open:i,children:[e&&a.jsx(xl,{asChild:!0,children:e}),a.jsx(ga,{ref:C,style:{width:"calc(100% - 64px)",maxWidth:l||ib[n],maxHeight:d||Tl,...w},hideCloseButton:r,onInteractOutside:E=>{var y,I;if(s){E.preventDefault();return}if(h){const T=(I=(y=E.detail)==null?void 0:y.originalEvent)==null?void 0:I.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 y=M=>!!C.current&&!C.current.contains(M),I=M=>{y(M.target)&&M.stopImmediatePropagation()},T=M=>{y(M.relatedTarget)&&M.stopImmediatePropagation()};x.current={focusin:I,focusout:T},document.addEventListener("focusin",I,!0),document.addEventListener("focusout",T,!0)}b==null||b(E)},onCloseAutoFocus:E=>{h&&(document.body.style.pointerEvents="",x.current&&(document.removeEventListener("focusin",x.current.focusin,!0),document.removeEventListener("focusout",x.current.focusout,!0),x.current=null)),g==null||g(E)},dir:u,"aria-describedby":void 0,"data-variant":p,className:m("wu-group wu-rounded-[.88rem]",fr.wuModalBodyWrapper,c),...v,children:a.jsx(Cl,{colors:N[p],strokeWidth:4,className:m("wu-rounded-[1.1rem] wu-transform-gpu wu-flex wu-flex-col",c),style:{maxHeight:d||Tl},children:t})})]})},lb=({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}),cb=({children:e,className:t,...n})=>a.jsx(ba,{...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(ya,{className:"wu-font-normal wu-justify-start wu-text-2xl wu-h-14",children:e})}),db=({children:e,className:t,...n})=>a.jsx(Sl,{...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}),wb=({children:e,className:t,...n})=>{const r=f.useRef(null);return a.jsx(sb,{asChild:!0,children:a.jsx(Ee,{className:t,ref:r,...n,children:e})})},fb=({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,...p})=>{const[h,b]=f.useState(""),[g,v]=f.useState(e);f.useEffect(()=>{if(!t||Array.isArray(t)&&t.length===0){v(e),b("");return}const x=r.label;if(n&&Array.isArray(t)){const C=t.map(E=>E[x]).join(", ");b(C)}else!n&&!Array.isArray(t)&&b(t[x])},[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(Ro,{asChild:!0,dir:o,id:u,disabled:l,children:a.jsxs("button",{...p,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",p.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"})]})})},El=({option:e,value:t,multiple:n=!1,onSelect:r,accessorKey:s,dir:o="ltr"})=>{const[i,u]=f.useState(n?[]:"");f.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(qe,{checked:l}),a.jsx(Ml,{option:e,accessorKey:s})]})},Ml=({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"})]})},Il=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(qe,{"data-partial":s,checked:r||s,partial:s}),a.jsx(Ml,{option:t,accessorKey:o.accessorKey})]});case"group":return a.jsxs(ei,{dir:o.dir,children:[a.jsx(an,{className:"wu-text-xs",children:t.label}),t.options.map(u=>f.createElement(El,{...o,option:u,key:String(u[o.accessorKey.value]??JSON.stringify(u))}))]});case"divider":return a.jsx(jn,{className:"wu-mx-4"});default:return a.jsx(El,{...o,option:t})}},pb=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}},hb=100,mb=400,kl=({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=hb,maxHeight:w=mb,hasGroup:p=!1,Header:h,CustomTrigger:b,selectAll:g,disabled:v,labelPosition:N="top",onScroll:x,maxContentWidth:C,selectedToTop:E=!1,...y})=>{const[I,T]=f.useState(),M=f.useRef(null),[k,_]=f.useState(!1),[P,A]=f.useState(!1),{cleanData:O,enabledOptions:F}=pb(e),V=f.useMemo(()=>n&&g!=null&&g.enable&&e.length>0?[{type:"all",[o.label]:g.label||"Select All"},...e]:e,[e,g,n]),W=f.useCallback(z=>{const R=z[o.value];if(n)T((ee=[])=>{const fe=ee,K=fe.some(L=>L[o.value]===R)?fe.filter(L=>L[o.value]!==R):[...fe,z];return t==null||t(K),K});else{const ee=z;T(ee),t==null||t(ee)}},[n,o.value,t]);f.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 J=Jo(E,V,I,o),H=J.length>c;f.useEffect(()=>{if(!n)return;const z=g!=null&&g.includeDisabled?(I==null?void 0:I.length)===e.length:(I==null?void 0:I.length)===F.length;_(z);const R=(I==null?void 0:I.length)>0&&!z;A(R)},[I,g]);const q=f.useCallback(()=>{const z=k?[]:g!=null&&g.includeDisabled?p?O:e:F;T(z),t==null||t(z)},[k,n,e,F,t,g]),Q=Mn(N);return a.jsxs("div",{className:m(Q,"wu-flex wu-select-container"),ref:M,dir:u,children:[a.jsxs(Qo,{children:[a.jsx(fb,{...y,value:I,multiple:n,variant:i,dir:u,placeholder:l,accessorKey:o,customTriggerChildren:b,id:y.id,disabled:v,selectAll:g,isCheckedAll:k}),a.jsxs(gs,{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:y.id,style:{maxWidth:C},children:[h,H?a.jsx(kt,{list:J,containerHeight:w,callback:(z,R)=>a.jsx(Il,{option:R,accessorKey:o,multiple:n,onSelect:W,value:I,dir:u,handleSelectAll:q,isCheckedAll:k,isPartialSelected:P}),dir:u}):a.jsx("div",{onScroll:x,style:{maxHeight:w,height:"fit-content",overflow:"auto"},className:"wu-select-list",children:J.map(z=>{const R=z,ee=String(R[o.value]??JSON.stringify(R));return a.jsx(Il,{option:R,accessorKey:o,multiple:n,onSelect:W,value:I,handleSelectAll:q,isCheckedAll:k,dir:u,isPartialSelected:P},ee)})})]})]}),d&&a.jsx(Me,{htmlFor:y.id,className:"wu-select-label",children:d})]})},pr=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],gb=({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[p,h]=f.useState(null),[b,g]=f.useState(""),[v,N]=f.useState({value:Math.min(new Date().getFullYear(),new Date(r).getFullYear()),label:Math.min(new Date().getFullYear(),new Date(r).getFullYear())}),x=f.useMemo(()=>{const E=new Date(n).getFullYear(),y=new Date(r).getFullYear();return Array.from({length:y-E+1},(I,T)=>({value:y-T,label:y-T}))},[n,r]);f.useEffect(()=>{if(e){const E=new Date(e),y=E.getFullYear(),I=E.getMonth();h({year:y,month:I}),g(`${pr[I]} ${y}`),N({value:y,label:y})}},[e]);const C=()=>{p&&t&&(t(new Date(p.year,p.month,15)),g(`${pr[p.month]} ${p.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(Xr,{...w,disabled:u||d,id:l,dir:"ltr",placeholder:s,formattedString:b}),a.jsxs(Be,{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(kl,{data:x,accessorKey:{value:"value",label:"label"},value:v,onSelect:E=>N(E),multiple:!1,maxHeight:224})}),a.jsx(bb,{year:v==null?void 0:v.value,selectedMonth:p==null?void 0:p.month,selectedYear:p==null?void 0:p.year,onClick:(E,y)=>h({year:y,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(Ee,{onClick:C,children:"Apply"})})})]})]}),o&&a.jsx(Me,{className:"wu-truncate wu-max-w-[120px] wu-min-w-fit wu-select-label",children:o})]})},bb=({year:e,selectedMonth:t,selectedYear:n,onClick:r,disabledMonths:s=[]})=>{const o=new Date,i=o.getFullYear(),u=o.getMonth(),l=f.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,p=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",p&&"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)})})},Dl=(e,t,n,r=96)=>{if(e.length===0||r<=0)return[[],[]];const[o,i]=f.useState([]),[u,l]=f.useState([]);return f.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,p=c-w,h=Math.floor(p/r);i(e.slice(0,h)),l(e.slice(h))};return d(),window.addEventListener("resize",d),()=>{window.removeEventListener("resize",d)}},[e,r]),[o,u]},Al={wuPrimaryLink:"_wuPrimaryLink_1sy3v_1",wuPrimaryPopoverContent:"_wuPrimaryPopoverContent_1sy3v_8"},yb=e=>{const{Links:t,children:n,className:r,...s}=e,o=f.useMemo(()=>t.map((c,w)=>f.cloneElement(c,{className:m(Al.wuPrimaryLink,c.props.className,"wu-primary-nav-link"),key:w})),[t]),i=f.useRef(null),u=f.useRef(null),[l,d]=Dl(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(Be,{className:m(Al.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(Be,{className:"wu-bg-white wu-border wu-border-blue-p wu-w-fit wu-primary-nav-popover-right",align:"end",sideOffset:4,children:n})]})]})]})})},va={wuSecondaryLink:"_wuSecondaryLink_1edl1_1",wuSecondaryNav:"_wuSecondaryNav_1edl1_6"},vb=e=>{const{Links:t,children:n,className:r,...s}=e,o=f.useMemo(()=>t.map((w,p)=>f.cloneElement(w.link,{key:p,className:m(va.wuSecondaryLink,w.link.props.className,"wu-secondary-nav-link-container"),children:a.jsxs(a.Fragment,{children:[f.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=f.useRef(null),u=f.useRef(null),l=f.useRef(null),[d,c]=Dl(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(va.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(Be,{className:m(va.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(Be,{className:"wu-bg-white wu-border wu-border-blue-p wu-w-fit wu-secondary-nav-popover-right",align:"end",sideOffset:12,children:n})]})]})]})})},_l=f.forwardRef(({totalRows:e,initialPage:t=0,initialPageSize:n=100,onPageChange:r,className:s,disabled:o=!1,...i},u)=>{const[l,d]=f.useState(t),[c,w]=f.useState(n);f.useEffect(()=>{d(t),w(n)},[t,n]);const p=Math.ceil(e/c),h=l*c+1,b=Math.min((l+1)*c,e),g=Array.from({length:p},(x,C)=>C),v=f.useCallback(x=>{x>=0&&x<p&&(d(x),r==null||r(x))},[p,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(Pl,{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(ha,{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(kt,{className:"wu-pagination-list",containerHeight:N,list:g,callback:(x,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)]},x)}):g.map(x=>a.jsxs(wr,{onSelect:()=>v(x),className:m(x===l&&"wu-bg-gray-20","wu-py-2 hover:wu-bg-gray-20","wu-pagination-item"),children:[x*c+1," -"," ",Math.min((x+1)*c,e)]},x))})}),a.jsx(Pl,{label:"Next page",onClick:()=>v(l+1),disabled:l===p-1||o,icon:"wm-arrow-forward-ios",className:"hover:wu-bg-gray-20 rtl:wu-rotate-180 wu-next-btn"})]})});_l.displayName="WuPagination";const Pl=({label:e,onClick:t,disabled:n,icon:r,className:s})=>a.jsx(Ee,{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)})}),Vl=S.forwardRef(({className:e,...t},n)=>a.jsx(Yt.Root,{className:m("wu-grid wu-gap-2",e),...t,ref:n}));Vl.displayName=Yt.Root.displayName;const Ol=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"})})}));Ol.displayName=Yt.Item.displayName;const Fl=f.forwardRef((e,t)=>{const{options:n,defaultValue:r,onChange:s,label:o,dir:i,...u}=e;return a.jsxs(Vl,{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(Dn,{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(Ol,{value:l.value,id:l.value,disabled:l.disabled,required:l.required,"aria-label":l.value,className:"wu-peer wu-radio-item"}),a.jsx(Dn,{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))]})});Fl.displayName="WuRadioGroup";const xb=e=>{const{children:t,...n}=e;return a.jsxs(Bt,{...n,role:"complementary","aria-label":"ScrollArea",children:[t,a.jsx(pa,{orientation:"horizontal"})]})},Ll=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}));Ll.displayName="Input";const Wl=S.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...r},s)=>a.jsx(Za.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}));Wl.displayName=Za.Root.displayName;function Bl({className:e,...t}){return a.jsx("div",{className:m("animate-pulse rounded-md bg-muted",e),...t})}const xa=768;function Na(){const[e,t]=S.useState(void 0);return S.useEffect(()=>{const n=window.matchMedia(`(max-width: ${xa-1}px)`),r=()=>{t(window.innerWidth<xa)};return n.addEventListener("change",r),t(window.innerWidth<xa),()=>n.removeEventListener("change",r)},[]),!!e}const Nb="sidebar_state",Sb=3600*24*7,Cb="256px",Tb="256px",Eb="3rem",Mb="b",ql=S.createContext(null);function rt(){const e=S.useContext(ql);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}const $l=S.forwardRef(({defaultOpen:e=!0,open:t,onOpenChange:n,className:r,style:s,children:o,...i},u)=>{const l=Na(),[d,c]=S.useState(!1),[w,p]=S.useState(l?!0:e),h=t??w,b=S.useCallback(x=>{const C=typeof x=="function"?x(h):x;n?n(C):p(C),document.cookie=`${Nb}=${C}; path=/; max-age=${Sb}`},[n,h]),g=S.useCallback(()=>l?c(x=>!x):b(x=>!x),[l,b,c]);S.useEffect(()=>{const x=C=>{C.key===Mb&&(C.metaKey||C.ctrlKey)&&(C.preventDefault(),g())};return window.addEventListener("keydown",x),()=>window.removeEventListener("keydown",x)},[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(ql.Provider,{value:N,children:a.jsx(oo,{delayDuration:0,children:a.jsx("div",{style:{"--sidebar-width":Cb,"--sidebar-width-icon":Eb,...s},className:m("wu-group/sidebar-wrapper wu-flex wu-min-h-[calc(100svh-48px)] wu-w-full",r),ref:u,...i,children:o})})})});$l.displayName="SidebarProvider";const Hl=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(ii,{open:d,onOpenChange:c,...o,children:a.jsx(bs,{"data-sidebar":"sidebar","data-mobile":"true",className:"wu-w-[--sidebar-width] wu-bg-blue-sidebar wu-p-0 [&>button]:wu-hidden",style:{"--sidebar-width":Tb},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})})]})});Hl.displayName="Sidebar";const zl=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"})]})});zl.displayName="SidebarTrigger";const Ib=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})});Ib.displayName="SidebarRail";const Ul=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}));Ul.displayName="SidebarInset";const kb=S.forwardRef(({className:e,...t},n)=>a.jsx(Ll,{ref:n,"data-sidebar":"input",className:m("wu-h-8 wu-w-full wu-shadow-none focus-visible:wu-ring-2",e),...t}));kb.displayName="SidebarInput";const jl=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}));jl.displayName="SidebarHeader";const Gl=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}));Gl.displayName="SidebarFooter";const Db=S.forwardRef(({className:e,...t},n)=>a.jsx(Wl,{ref:n,"data-sidebar":"separator",className:m("wu-mx-2 wu-w-auto",e),...t}));Db.displayName="SidebarSeparator";const Kl=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}));Kl.displayName="SidebarContent";const Yl=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}));Yl.displayName="SidebarGroup";const Xl=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})});Xl.displayName="SidebarGroupLabel";const Ab=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})});Ab.displayName="SidebarGroupAction";const Zl=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}));Zl.displayName="SidebarGroupContent";const Sa=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}));Sa.displayName="SidebarMenu";const Jl=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}));Jl.displayName="SidebarMenuItem";const _b=We.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"}}),Ql=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(_b({variant:n,size:r}),o),...i});return s?(typeof s=="string"&&(s={children:s}),a.jsxs(io,{children:[a.jsx(uo,{asChild:!0,children:w}),a.jsx(Kr,{side:"right",align:"center",hidden:c!=="collapsed"||d,...s})]})):w});Ql.displayName="SidebarMenuButton";const Pb=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})});Pb.displayName="SidebarMenuAction";const Vb=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}));Vb.displayName="SidebarMenuBadge";const Ob=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(Bl,{className:"wu-rounded-md wu-size-4","data-sidebar":"menu-skeleton-icon"}),a.jsx(Bl,{className:"wu-h-4 wu-max-w-[--skeleton-width] wu-flex-1","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":s}})]})});Ob.displayName="SidebarMenuSkeleton";const Fb=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}));Fb.displayName="SidebarMenuSub";const Lb=S.forwardRef(({...e},t)=>a.jsx("li",{ref:t,...e}));Lb.displayName="SidebarMenuSubItem";const Wb=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})});Wb.displayName="SidebarMenuSubButton";function Bb(e){const{open:t,defaultOpen:n,onOpenChange:r,disabled:s}=e,o=t!==void 0,[i,u]=ls({controlled:t,default:n,name:"Collapsible",state:"open"}),{mounted:l,setMounted:d,transitionStatus:c}=wf(i,!0,!0),[w,p]=S.useState(i),[{height:h,width:b},g]=S.useState({height:void 0,width:void 0}),v=Co(),[N,x]=S.useState(),C=N??v,[E,y]=S.useState(!1),[I,T]=S.useState(!1),M=S.useRef(null),k=S.useRef(null),_=S.useRef(null),P=S.useRef(null),A=Fo(P,!1),O=he(F=>{const V=!i,W=ke(ff,F.nativeEvent);if(r(V,W),W.isCanceled)return;const J=P.current;k.current==="css-animation"&&J!=null&&J.style.removeProperty("animation-name"),!E&&!I&&(k.current!=null&&k.current!=="css-animation"&&!l&&V&&d(!0),k.current==="css-animation"&&(!w&&V&&p(!0),!l&&V&&d(!0))),u(V),k.current==="none"&&l&&!V&&d(!1)});return ae(()=>{o&&k.current==="none"&&!i&&d(!1)},[o,i,t,d]),S.useMemo(()=>({abortControllerRef:M,animationTypeRef:k,disabled:s,handleTrigger:O,height:h,mounted:l,open:i,panelId:C,panelRef:P,runOnceAnimationsFinish:A,setDimensions:g,setHiddenUntilFound:y,setKeepMounted:T,setMounted:d,setOpen:u,setPanelIdState:x,setVisible:p,transitionDimensionRef:_,transitionStatus:c,visible:w,width:b}),[M,k,s,O,h,l,i,C,P,A,g,y,T,d,u,p,_,c,w,b])}const Ca=S.createContext(void 0);process.env.NODE_ENV!=="production"&&(Ca.displayName="CollapsibleRootContext");function Rl(){const e=S.useContext(Ca);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})({}),qb=(function(e){return e.panelOpen="data-panel-open",e})({});const $b={[mn.open]:""},Hb={[mn.closed]:""},zb={open(e){return e?{[qb.panelOpen]:""}:null}},ec={...{open(e){return e?$b:Hb}},...Oo},tc=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),p=Bb({open:l,defaultOpen:o,onOpenChange:w,disabled:i}),h=S.useMemo(()=>({open:p.open,disabled:p.disabled,transitionStatus:p.transitionStatus}),[p.open,p.disabled,p.transitionStatus]),b=S.useMemo(()=>({...p,onOpenChange:w,state:h}),[p,w,h]),g=Ye("div",t,{state:h,ref:n,props:c,stateAttributesMapping:ec});return a.jsx(Ca.Provider,{value:b,children:g})});process.env.NODE_ENV!=="production"&&(tc.displayName="CollapsibleRoot");const nc=S.createContext(void 0);process.env.NODE_ENV!=="production"&&(nc.displayName="CompositeRootContext");function Ub(e=!1){const t=S.useContext(nc);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 jb(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 Ta(e={}){const{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:s=!0,composite:o}=e,i=S.useRef(null),u=Ub(!0),l=o??u!==void 0,{props:d}=jb({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:x,...C}=h;return ts({type:s?"button":void 0,onClick(y){if(t){y.preventDefault();return}b==null||b(y)},onMouseDown(y){t||g==null||g(y)},onKeyDown(y){if(t||(Vn(y),N==null||N(y),y.baseUIHandlerPrevented))return;const I=y.target===y.currentTarget,T=y.currentTarget,M=hr(T),k=!s&&Gb(T),_=I&&(s?M:!k),P=y.key==="Enter",A=y.key===" ",O=T.getAttribute("role"),F=(O==null?void 0:O.startsWith("menuitem"))||O==="option"||O==="gridcell";if(I&&l&&A){if(y.defaultPrevented&&F)return;y.preventDefault(),k||s&&M?(T.click(),y.preventBaseUIHandler()):_&&(b==null||b(y),y.preventBaseUIHandler());return}_&&(!s&&(A||P)&&y.preventDefault(),!s&&P&&(b==null||b(y)))},onKeyUp(y){if(!t){if(Vn(y),v==null||v(y),y.target===y.currentTarget&&s&&l&&hr(y.currentTarget)&&y.key===" "){y.preventDefault();return}y.baseUIHandlerPrevented||y.target===y.currentTarget&&!s&&!l&&y.key===" "&&(b==null||b(y))}},onPointerDown(y){if(t){y.preventDefault();return}x==null||x(y)}},s?void 0:{role:"button"},d,C)},[t,d,l,s]),p=he(h=>{i.current=h,c()});return{getButtonProps:w,buttonRef:p}}function hr(e){return Qw(e)&&e.tagName==="BUTTON"}function Gb(e){return!!((e==null?void 0:e.tagName)==="A"&&(e!=null&&e.href))}const Kb={...zb,...Oo},rc=S.forwardRef(function(t,n){const{panelId:r,open:s,handleTrigger:o,state:i,disabled:u}=Rl(),{className:l,disabled:d=u,id:c,render:w,nativeButton:p=!0,style:h,...b}=t,{getButtonProps:g,buttonRef:v}=Ta({disabled:d,focusableWhenDisabled:!0,native:p}),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:Kb})});process.env.NODE_ENV!=="production"&&(rc.displayName="CollapsibleTrigger");function mr(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}let Yb=(function(e){return e.disabled="data-disabled",e.orientation="data-orientation",e})({});function Xb(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:p,setDimensions:h,setMounted:b,setOpen:g,setVisible:v,transitionDimensionRef:N,visible:x,width:C}=e,E=S.useRef(!1),y=S.useRef(null),I=S.useRef(c),T=S.useRef(c),M=Vo(),k=S.useMemo(()=>n.current==="css-animation"?!x:!c&&!l,[c,l,x,n]),_=he(A=>{if(!A)return;if(n.current==null||N.current==null){const V=getComputedStyle(A),W=V.animationName!=="none"&&V.animationName!=="",J=V.transitionDuration!=="0s"&&V.transitionDuration!=="";W&&J?process.env.NODE_ENV!=="production"&&as("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(Yb.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=le.request(()=>{T.current=!1,F=le.request(()=>{setTimeout(()=>{A.style.removeProperty("transition-duration")})})}),()=>{le.cancel(O),le.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=le.request(()=>{Object.entries(F).forEach(([V,W])=>{W===""?A.style.removeProperty(V):A.style.setProperty(V,W)})})}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 W=null;const J=mn.endingStyle;return W=new MutationObserver(H=>{H.some(Q=>Q.type==="attributes"&&Q.attributeName===J)&&(W==null||W.disconnect(),W=null,p(()=>{h({height:0,width:0}),A.style.removeProperty("content-visibility"),b(!1),t.current===F&&(t.current=null)},V))}),W.observe(A,{attributes:!0,attributeFilter:[J]}),()=>{W==null||W.disconnect(),M.cancel(),t.current===F&&(F.abort(),t.current=null)}}return()=>{le.cancel(O)}},[t,n,M,o,i,l,c,w,p,h,b]),ae(()=>{if(n.current!=="css-animation")return;const A=w.current;A&&(y.current=A.style.animationName||y.current,A.style.setProperty("animation-name","none"),h({height:A.scrollHeight,width:A.scrollWidth}),!I.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,p(()=>{b(!1),v(!1),t.current=null},t.current.signal)))},[t,n,c,w,p,h,b,v,x]),Fn(()=>{const A=le.request(()=>{I.current=!1});return()=>le.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=le.request(()=>{E.current=!1,F=le.request(()=>{setTimeout(()=>{A.style.removeProperty("transition-duration")})})})),()=>{le.cancel(O),le.cancel(F)}},[o,c,w,h]),ae(()=>{const A=w.current;A&&o&&k&&(A.setAttribute("hidden","until-found"),n.current==="css-transition"&&A.setAttribute(mn.startingStyle,""))},[o,k,n,w]),S.useEffect(function(){const O=w.current;if(!O)return;function F(V){E.current=!0,g(!0),d(!0,ke(Rt,V))}return mr(O,"beforematch",F)},[d,w,g]),S.useMemo(()=>({props:{hidden:k,id:u,ref:P}}),[k,u,P])}let sc=(function(e){return e.collapsiblePanelHeight="--collapsible-panel-height",e.collapsiblePanelWidth="--collapsible-panel-width",e})({});const ac=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&&as("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:p,mounted:h,onOpenChange:b,open:g,panelId:v,panelRef:N,runOnceAnimationsFinish:x,setDimensions:C,setHiddenUntilFound:E,setKeepMounted:y,setMounted:I,setPanelIdState:T,setOpen:M,setVisible:k,state:_,transitionDimensionRef:P,visible:A,width:O,transitionStatus:F}=Rl(),V=s??!1,W=o??!1;ae(()=>{if(u)return T(u),()=>{T(void 0)}},[u,T]),ae(()=>{E(V)},[E,V]),ae(()=>{y(W)},[y,W]);const{props:J}=Xb({abortControllerRef:c,animationTypeRef:w,externalRef:n,height:p,hiddenUntilFound:V,id:v,keepMounted:W,mounted:h,onOpenChange:b,open:g,panelRef:N,runOnceAnimationsFinish:x,setDimensions:C,setMounted:I,setOpen:M,setVisible:k,transitionDimensionRef:P,visible:A,width:O});df({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:[J,{style:{[sc.collapsiblePanelHeight]:p===void 0?"auto":`${p}px`,[sc.collapsiblePanelWidth]:O===void 0?"auto":`${O}px`}},d],stateAttributesMapping:ec});return W||V||h?q:null});process.env.NODE_ENV!=="production"&&(ac.displayName="CollapsiblePanel");const Zb=({children:e,Sidebar:t,className:n,defaultOpen:r=!0,open:s,onOpenChange:o,style:i})=>a.jsxs($l,{defaultOpen:r,open:s,onOpenChange:o,children:[a.jsxs(Hl,{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(jl,{className:"wu-py-2",children:a.jsx(oc,{})}),t]}),a.jsx(Ul,{className:"wu-contain-inline-size",children:e})]}),oc=e=>{const{state:t,isMobile:n,openMobile:r}=rt();return a.jsx(zl,{...e,children:a.jsx(ma,{showMenu:n?r:t==="expanded"})})},Jb=({className:e,children:t,...n})=>{const r=f.useRef(null),s=f.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(Kl,{...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})]})},Qb=e=>a.jsx(Gl,{...e,children:e.children}),Rb=({label:e,children:t,...n})=>a.jsxs(Yl,{...n,className:"wu-p-0",children:[a.jsx("div",{className:"wu-h-8",children:a.jsx(Xl,{className:"wu-items-end wu-px-4 wu-text-xs wu-font-normal wu-leading-4 wu-text-blue-q",children:e})}),a.jsx(Zl,{children:a.jsx(Sa,{children:t})})]}),ey=e=>a.jsx(Sa,{...e}),ic=({Icon:e,children:t,className:n,isActive:r,...s})=>{var w;const{state:o}=rt(),[i,u]=f.useState(),l=Na(),d=f.isValidElement(t)?f.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=f.useRef(null);return f.useEffect(()=>{var p;u(((p=c.current)==null?void 0:p.textContent)||"")},[]),a.jsx(Jl,{...s,className:"wu-flex wu-items-center wu-gap-2 wu-px-2",children:a.jsx(Ql,{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:f.isValidElement(t),ref:c,children:d})})},ty=({Title:e,Icon:t,children:n,className:r,...s})=>{const{state:o}=rt(),i=Na();return a.jsxs(tc,{children:[a.jsx(rc,{render:u=>{const l="data-panel-open"in u;return a.jsxs(ic,{Icon:t,...u,children:[e,(o==="expanded"||i)&&a.jsx(Pe,{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(ac,{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})]})},ny=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"}]]),Ea=(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})`},ry=({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=ny.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"},sy=({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 ${Ea(r,gn.BORDER_LIGHTNESS)}`:"",...o},c={backgroundColor:Ea(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:Ea(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})]})},ay=({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(vl,{open:o,onOpenChange:i,children:[a.jsx(xl,{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(ga,{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(ya,{}),a.jsx(Ya.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(Pe,{icon:"wm-close",className:"wu-text-lg wu-m-4 wu-cursor-pointer"})}),n&&a.jsx(ba,{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 uc(e){const t=Ze(oy,e).current;return t.next=e,ae(t.effect),t}function oy(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}function iy(){const[,e]=S.useState({});return S.useCallback(()=>{e({})},[])}const lc={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},uy={...lc,position:"fixed",top:0,left:0},ly={...lc,position:"absolute"},Ma=S.createContext(void 0);process.env.NODE_ENV!=="production"&&(Ma.displayName="NumberFieldRootContext");function gr(){const e=S.useContext(Ma);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,...Qr},cc=new Map;function yn(e,t){const n=JSON.stringify({locale:e,options:t}),r=cc.get(n);if(r)return r;const s=new Intl.NumberFormat(e,t);return cc.set(n,s),s}function qt(e,t,n){return e==null?"":yn(t,n).format(e)}function dc(e,t,n){return qt(e,t,{...n,maximumFractionDigits:20})}const cy=["零","〇","一","二","三","四","五","六","七","八","九"],dy={零:"0","〇":"0",一:"1",二:"2",三:"3",四:"4",五:"5",六:"6",七:"7",八:"8",九:"9"},wc=["٠","١","٢","٣","٤","٥","٦","٧","٨","٩"],fc=["۰","۱","۲","۳","۴","۵","۶","۷","۸","۹"],Ia=["0","1","2","3","4","5","6","7","8","9"],pc=["%","٪","%","﹪"],hc=["‰","؉"],mc=["−","-","‒","–","—","﹣"],gc=["+","﹢"],wy=".",fy=",",py=new RegExp(`[${wc.join("")}]`,"g"),hy=new RegExp(`[${fc.join("")}]`,"g"),my=new RegExp(`[${Ia.join("")}]`,"g"),gy=new RegExp(`[${cy.join("")}]`,"g"),by=new RegExp(`[${pc.join("")}]`),yy=new RegExp(`[${hc.join("")}]`),ka=/[٠١٢٣٤٥٦٧٨٩]/,bc=/[۰۱۲۳۴۵۶۷۸۹]/,Da=/[零〇一二三四五六七八九]/,yc=new RegExp(`[${Ia.join("")}]`),vy=[".",",",wy,fy,"٫","٬"],vc=new RegExp("\\p{Zs}","u"),xy=["+",...gc],Ny=["-",...mc],br=e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),Sy=e=>e.replace(/[-\\\]^]/g,t=>`\\${t}`),xc=e=>`[${e.map(Sy).join("")}]`,Nc=xc(["-"].concat(mc)),Sc=xc(["+"].concat(gc)),Cc=new RegExp(Nc,"gu"),Tc=new RegExp(Sc,"gu"),vn=new RegExp(Nc),yr=new RegExp(Sc);function Aa(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(Cc,"-").replace(Tc,"+");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&&(ka.test(r)||bc.test(r)?u="ar":Da.test(r)&&(u="zh"));const{group:l,decimal:d,currency:c}=Aa(u,n),w=yn(u,n).formatToParts(1).filter(T=>T.type==="unit").map(T=>br(T.value)),p=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:p,replacement:""},{regex:py,replacement:T=>String(wc.indexOf(T))},{regex:hy,replacement:T=>String(fc.indexOf(T))},{regex:my,replacement:T=>String(Ia.indexOf(T))},{regex:gy,replacement:T=>dy[T]}].reduce((T,{regex:M,replacement:k})=>M?T.replace(M,k):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 x=parseFloat(N);const C=n==null?void 0:n.style,E=C==="unit"&&(n==null?void 0:n.unit)==="percent",y=by.test(e)||C==="percent";return yy.test(e)?x/=1e3:!E&&y&&(x/=100),Number.isNaN(x)?null:x}const Cy=60,Ty=400,Ey=8,vr=1;function My(e,t=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,n))}const Iy=1e-10;function ky(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 Dy(e,t){if(!Number.isFinite(e))return e;const n=Math.min(Math.max(t,0),20);return Number(e.toFixed(n))}function _a(e,t){const{maximumFractionDigits:n}=ky(t);return Dy(e,n)}function Ay(e,t,n,r="directional"){if(n===0)return e;const s=Math.abs(n),o=Math.sign(n),i=s*Iy*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 _y(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?My(e,n,r):e;if(t!=null&&i){if(t===0)return _a(d,o);let c=s;!u&&n!==Number.MIN_SAFE_INTEGER&&(c=n);const w=Ay(d,c,t,u?"nearest":"directional");return _a(w,o)}return _a(d,o)}const Ec=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:p,name:h,defaultValue:b,value:g,onValueChange:v,onValueCommitted:N,allowWheelScrub:x=!1,snapOnStep:C=!1,allowOutOfRange:E=!1,format:y,locale:I,render:T,className:M,inputRef:k,style:_,...P}=t,{setDirty:A,validityData:O,disabled:F,setFilled:V,invalid:W,name:J,state:H,validation:q,shouldValidateOnChange:Q}=An(),z=F||c,R=J??h,ee=u==="any"?1:u,[fe,ze]=S.useState(!1),K=s??Number.MIN_SAFE_INTEGER,L=o??Number.MAX_SAFE_INTEGER,j=s??0,Y=y==null?void 0:y.style,X=S.useRef(null),G=On(k,q.inputRef),U=Bo({id:r}),[Le,me]=ls({controlled:g,default:b,name:"NumberField",state:"value"}),ie=Le??null,ve=uc(ie);ae(()=>{V(ie!==null)},[V,ie]);const Ae=iy(),je=uc(y),Ht=S.useRef(!1),kr=he((ne,Z)=>{Ht.current=!1,N==null||N(ne,Z)}),zt=S.useRef(!0),Dr=S.useRef(null),[at,vt]=S.useState(()=>g!==void 0?Mc(ie,I,y):qt(ie,I,y)),[xt,de]=S.useState("numeric"),ot=he(()=>{const{decimal:ne,group:Z,currency:be,literal:ye}=Aa(I,y),ue=new Set;vy.forEach(Se=>ue.add(Se)),ne&&ue.add(ne),Z&&(ue.add(Z),vc.test(Z)&&ue.add(" "));const Ut=Y==="percent"||Y==="unit"&&(y==null?void 0:y.unit)==="percent",Ge=Y==="percent"||Y==="unit"&&(y==null?void 0:y.unit)==="permille";return Ut&&pc.forEach(Se=>ue.add(Se)),Ge&&hc.forEach(Se=>ue.add(Se)),Y==="currency"&&be&&ue.add(be),ye&&(Array.from(ye).forEach(Se=>ue.add(Se)),vc.test(ye)&&ue.add(" ")),xy.forEach(Se=>ue.add(Se)),K<0&&Ny.forEach(Se=>ue.add(Se)),ue}),Nt=he(ne=>ne!=null&&ne.altKey?i:ne!=null&&ne.shiftKey?l:ee),Ar=he((ne,Z)=>{const be=Z.event,ye=Z.direction,ue=Z.reason,Ut=!E||!(ue===cs||ue===Hn||ue===ds||ue===en||ue===Rt),Ge=_y(ne,{step:ye?Nt(be)*ye:void 0,format:je.current,minWithDefault:K,maxWithDefault:L,minWithZeroDefault:j,snapOnStep:C,small:(be==null?void 0:be.altKey)??!1,clamp:Ut}),Se=Z.reason===cs||Z.reason===en||Z.reason===Hn||Z.reason===ds||Z.reason===Rt,ja=Ge!==ie||Se&&(ne!==ie||zt.current===!1);if(ja){if(Dr.current=Ge,v==null||v(Ge,Z),Z.isCanceled)return ja;me(Ge),A(Ge!==O.initialValue),Ht.current=!0}return zt.current&&vt(qt(Ge,I,y)),Ae(),ja}),_r=he((ne,{direction:Z,currentValue:be,event:ye,reason:ue})=>{const Ut=be??ve.current,Ge=typeof Ut=="number"?Ut+ne*Z:Math.max(0,s??0);return Ar(Ge,ke(ue,ye,void 0,{direction:Z}))});ae(function(){if(!zt.current)return;const Z=g!==void 0?Mc(ie,I,y):qt(ie,I,y);Z!==at&&vt(Z)}),ae(function(){if(!tf)return;let Z="text";K>=0&&(Z="decimal"),de(Z)},[K,Y]),S.useEffect(function(){const Z=X.current;if(z||w||!x||!Z)return;function be(ye){if(ye.ctrlKey||_o(Ao(X.current))!==X.current)return;ye.preventDefault();const ue=Nt(ye)??vr;_r(ue,{direction:ye.deltaY>0?-1:1,event:ye,reason:"wheel"})}return mr(Z,"wheel",be)},[x,_r,z,w,l,ee,Nt]);const Ua=S.useMemo(()=>({...H,disabled:z,readOnly:w,required:d,value:ie,inputValue:at,scrubbing:fe}),[H,z,w,d,ie,at,fe]),Fv=S.useMemo(()=>({inputRef:X,inputValue:at,value:ie,minWithDefault:K,maxWithDefault:L,disabled:z,readOnly:w,id:U,setValue:Ar,incrementValue:_r,getStepAmount:Nt,allowInputSyncRef:zt,formatOptionsRef:je,valueRef:ve,lastChangedValueRef:Dr,hasPendingCommitRef:Ht,name:R,required:d,invalid:W,inputMode:xt,getAllowedNonNumericKeys:ot,min:s,max:o,setInputValue:vt,locale:I,isScrubbing:fe,setIsScrubbing:ze,state:Ua,onValueCommitted:kr}),[X,at,ie,K,L,z,w,U,Ar,_r,Nt,je,ve,R,d,W,xt,ot,s,o,vt,I,fe,Ua,kr]),Lv=Ye("div",t,{ref:n,state:Ua,props:P,stateAttributesMapping:bn});return a.jsxs(Ma.Provider,{value:Fv,children:[Lv,a.jsx("input",{...q.getInputValidationProps({onFocus(){var ne;(ne=X.current)==null||ne.focus()},onChange(ne){if(ne.nativeEvent.defaultPrevented)return;const Z=ne.currentTarget.valueAsNumber,be=Number.isNaN(Z)?null:Z,ye=ke(Rt,ne.nativeEvent);A(be!==O.initialValue),Ar(be,ye),Q()&&q.commit(be)}}),ref:G,type:"number",form:p,name:R,value:ie??"",min:s,max:o,step:u,disabled:z,required:d,"aria-hidden":!0,tabIndex:-1,style:R?ly:uy,suppressHydrationWarning:!0})]})});process.env.NODE_ENV!=="production"&&(Ec.displayName="NumberFieldRoot");function Mc(e,t,n){return(n==null?void 0:n.maximumFractionDigits)!=null||(n==null?void 0:n.minimumFractionDigits)!=null?qt(e,t,n):dc(e,t,n)}const Ic=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"&&(Ic.displayName="NumberFieldGroup");const kc=0;class Pa extends Ln{constructor(){super(...arguments);Ce(this,"clear",()=>{this.currentId!==kc&&(clearInterval(this.currentId),this.currentId=kc)})}static create(){return new Pa}start(n,r){this.clear(),this.currentId=setInterval(()=>{r()},n)}}function Py(){const e=Ze(Pa.create).current;return Fn(e.disposeEffect),e}const Vy=60,Oy=400,Fy=8,Ly=50,Wy=3;function Nn(e){return e==="touch"||e==="pen"}function By(e){const{disabled:t,readOnly:n=!1,tick:r,onStop:s,tickDelay:o=Vy,startDelay:i=Oy,scrollDistance:u=Fy,elementRef:l}=e,d=ko(),c=Py(),w=ko(),p=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(""),x=S.useRef(()=>{}),C=he(()=>{w.clear(),d.clear(),c.clear(),x.current(),h.current=0}),E=he(T=>{C();const M=l.current;if(!M)return;const k=is(M);function _(P){P.preventDefault()}if(x.current=mr(k,"contextmenu",_),mr(k,"pointerup",P=>{p.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 y={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,p.current=!0,b.current={x:T.clientX,y:T.clientY},Nn(T.pointerType)?w.start(Ly,()=>{const _=h.current;h.current=0,p.current&&_<Wy?(E(T.nativeEvent),v.current=!0):(v.current=!1,C())}):(T.preventDefault(),E(T.nativeEvent))},onPointerUp(T){Nn(T.pointerType)&&(p.current=!1)},onPointerMove(T){if(t||n||!Nn(T.pointerType)||!p.current)return;h.current!=null&&(h.current+=1);const{x:M,y:k}=b.current,_=M-T.clientX,P=k-T.clientY;_**2+P**2>u**2&&C()},onMouseEnter(T){T.defaultPrevented||t||n||!p.current||g.current||Nn(N.current)||E(T.nativeEvent)},onMouseLeave(){g.current||C()},onMouseUp(){g.current||C()}},I=he(T=>T.defaultPrevented?!0:Nn(N.current)?v.current:T.detail!==0);return{pointerHandlers:y,shouldSkipClick:I}}function qy(e){return e==="touch"||e==="pen"}function Dc(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:p,valueRef:h,lastChangedValueRef:b,onValueCommitted:g}=e,v=d?pf:hf;function N(y){t.current=!0;const I=xn(l,c,r.current);I!==null&&(h.current=I,p(I,ke(v,y,void 0,{direction:d?1:-1})))}const{pointerHandlers:x,shouldSkipClick:C}=By({disabled:n||w,elementRef:u,tickDelay:Cy,startDelay:Ty,scrollDistance:Ey,tick(y){const I=s(y)??vr;return i(I,{direction:d?1:-1,event:y,reason:v})},onStop(y){const I=b.current??h.current;g(I,nn(v,y))}});return{disabled:n,"aria-readonly":w||void 0,"aria-label":d?"Increase":"Decrease","aria-controls":o,tabIndex:-1,style:{WebkitUserSelect:"none",userSelect:"none"},...x,onClick(y){const I=n||w;if(y.defaultPrevented||I||C(y))return;N(y.nativeEvent);const T=s(y)??vr,M=h.current;i(T,{direction:d?1:-1,event:y.nativeEvent,reason:v});const k=b.current??h.current;k!==M&&g(k,nn(v,y.nativeEvent))},onPointerDown(y){var T;const I=!y.button||y.button===0;y.defaultPrevented||w||!I||n||(N(y.nativeEvent),qy(y.pointerType)||(T=u.current)==null||T.focus(),x.onPointerDown(y))}}}const Ac=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:p,id:h,incrementValue:b,inputRef:g,inputValue:v,locale:N,maxWithDefault:x,readOnly:C,setValue:E,state:y,value:I,valueRef:T,lastChangedValueRef:M,onValueCommitted:k}=gr(),_=I!=null&&I>=x,P=o||c||_,A=Dc({isIncrement:!0,inputRef:g,inputValue:v,disabled:P,readOnly:C,id:h,setValue:E,getStepAmount:p,incrementValue:b,allowInputSyncRef:d,formatOptionsRef:w,valueRef:T,locale:N,lastChangedValueRef:M,onValueCommitted:k}),{getButtonProps:O,buttonRef:F}=Ta({disabled:P,native:i,focusableWhenDisabled:!0}),V=S.useMemo(()=>({...y,disabled:P}),[y,P]);return Ye("button",t,{ref:[n,F],state:V,props:[A,l,O],stateAttributesMapping:bn})});process.env.NODE_ENV!=="production"&&(Ac.displayName="NumberFieldIncrement");const _c=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:p,id:h,incrementValue:b,inputRef:g,inputValue:v,minWithDefault:N,readOnly:x,setValue:C,state:E,value:y,valueRef:I,locale:T,lastChangedValueRef:M,onValueCommitted:k}=gr(),_=y!=null&&y<=N,P=o||c||_,A=Dc({isIncrement:!1,inputRef:g,inputValue:v,disabled:P,readOnly:x,id:h,setValue:C,getStepAmount:p,incrementValue:b,allowInputSyncRef:d,formatOptionsRef:w,valueRef:I,locale:T,lastChangedValueRef:M,onValueCommitted:k}),{getButtonProps:O,buttonRef:F}=Ta({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"&&(_c.displayName="NumberFieldDecrement");function $y(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 Hy={...Qr,...bn},zy=new Set(["Backspace","Delete","ArrowLeft","ArrowRight","Tab","Enter","Escape"]),Pc=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:p,incrementValue:h,inputMode:b,inputValue:g,max:v,min:N,name:x,readOnly:C,required:E,setValue:y,state:I,setInputValue:T,locale:M,inputRef:k,value:_,onValueCommitted:P,lastChangedValueRef:A,hasPendingCommitRef:O,valueRef:F}=gr(),{clearErrors:V}=Mw(),{validationMode:W,setTouched:J,setFocused:H,invalid:q,shouldValidateOnChange:Q,validation:z}=An(),{labelId:R}=rs(),ee=S.useRef(!1),fe=S.useRef(!1);return Wo(k,{id:p,value:_}),$y(_,L=>{const j=Q();if(V(x),j&&z.commit(_),!(L===_||j)){if(fe.current){fe.current=!1;return}z.commit(_,!0)}}),Ye("input",t,{ref:[n,k],state:I,props:[{id:p,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":R,suppressHydrationWarning:!0,onFocus(L){if(L.defaultPrevented||C||l||(H(!0),ee.current))return;ee.current=!0;const j=L.currentTarget,Y=j.value.length;j.setSelectionRange(Y,Y)},onBlur(L){if(L.defaultPrevented||C||l)return;J(!0),H(!1);const j=!u.current,Y=O.current;if(u.current=!0,g.trim()===""){y(null,ke(en,L.nativeEvent)),W==="onBlur"&&z.commit(null),P(null,nn(en,L.nativeEvent));return}const X=d.current,G=xn(g,M,X);if(G===null)return;const U=(X==null?void 0:X.maximumFractionDigits)!=null||(X==null?void 0:X.minimumFractionDigits)!=null,Le=X==null?void 0:X.maximumFractionDigits,me=U&&typeof Le=="number"?Number(G.toFixed(Le)):G,ie=nn(Hn,L.nativeEvent),ve=_!==me,Ae=j||ve||Y;W==="onBlur"&&z.commit(me),ve&&(fe.current=!0,y(me,ke(Hn,L.nativeEvent))),Ae&&P(me,ie);const je=qt(me,M,X);!(!U&&G===_&&g===dc(G,M,X))&&g!==je&&T(je)},onChange(L){if(L.nativeEvent.defaultPrevented)return;u.current=!1;const j=L.currentTarget.value;if(j.trim()===""){T(j),y(null,ke(en,L.nativeEvent));return}const Y=c();if(!Array.from(j).every(U=>{const Le=U>="0"&&U<="9",me=ka.test(U),ie=Da.test(U),ve=bc.test(U),Ae=yc.test(U),je=vn.test(U);return Le||me||ie||ve||Ae||je||Y.has(U)}))return;const G=xn(j,M,d.current);T(j),G!==null&&y(G,ke(cs,L.nativeEvent))},onKeyDown(L){if(L.defaultPrevented||C||l)return;const j=L.nativeEvent;u.current=!0;const Y=c();let X=Y.has(L.key);const{decimal:G,currency:U,percentSign:Le}=Aa(M,d.current),me=L.currentTarget.selectionStart,ie=L.currentTarget.selectionEnd,ve=me===0&&ie===g.length,Ae=de=>me!=null&&ie!=null&&de>=me&&de<ie;if(vn.test(L.key)&&Array.from(Y).some(de=>vn.test(de||""))){const de=g.search(Cc),ot=de!=null&&de!==-1&&Ae(de);X=!(vn.test(g)||yr.test(g))||ve||ot}if(yr.test(L.key)&&Array.from(Y).some(de=>yr.test(de||""))){const de=g.search(Tc),ot=de!=null&&de!==-1&&Ae(de);X=!(vn.test(g)||yr.test(g))||ve||ot}[G,U,Le].forEach(de=>{if(L.key===de){const ot=g.indexOf(de),Nt=Ae(ot);X=!g.includes(de)||ve||Nt}});const je=L.key>="0"&&L.key<="9",Ht=ka.test(L.key),kr=Da.test(L.key),zt=yc.test(L.key),Dr=zy.has(L.key);if(L.which===229||L.altKey||L.ctrlKey||L.metaKey||X||je||Ht||zt||kr||Dr)return;const at=xn(g,M,d.current),vt=w(L)??vr;af(L);const xt=nn(tn,j);L.key==="ArrowUp"?(h(vt,{direction:1,currentValue:at,event:j,reason:tn}),P(A.current??F.current,xt)):L.key==="ArrowDown"?(h(vt,{direction:-1,currentValue:at,event:j,reason:tn}),P(A.current??F.current,xt)):L.key==="Home"&&N!=null?(y(N,ke(tn,j)),P(A.current??F.current,xt)):L.key==="End"&&v!=null&&(y(v,ke(tn,j)),P(A.current??F.current,xt))},onPaste(L){if(L.defaultPrevented||C||l)return;L.preventDefault();const Y=(L.clipboardData||window.Clipboard).getData("text/plain"),X=xn(Y,M,d.current);X!==null&&(u.current=!1,y(X,ke(ds,L.nativeEvent)),T(Y))}},z.getValidationProps(),i],stateAttributesMapping:Hy})});process.env.NODE_ENV!=="production"&&(Pc.displayName="NumberFieldInput");const Uy={wuStepper:"_wuStepper_apbnq_1"},jy=({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:p=!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)},x=T=>{const M=Number(T.target.value);Number.isNaN(M)||v(M)},C=()=>{p&&(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},y=i!==void 0&&g<i||u!==void 0&&g>u,I=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(Ec,{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",Uy.wuStepper,Gy({labelPosition:c}),d),children:[t&&a.jsx(Me,{htmlFor:b,className:"wu-input-label",children:t}),a.jsxs(Ic,{className:"wu-flex wu-max-w-[97px] wu-relative",children:[a.jsx(_c,{"aria-label":"decrement",className:m(I,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(Pc,{"aria-label":"stepper",role:"spinbutton",type:"text","aria-invalid":y||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",y&&"wu-border-red-deep focus:wu-border-red-deep","wu-stepper-input"),readOnly:r,onChange:x,onBlur:C,disabled:w,min:i,max:u,step:o,value:g,...h}),a.jsx(Ac,{"aria-label":"increment",className:m(I,s==="rtl"?"wu-left-0":"wu-right-0","wu-stepper-button"),disabled:E.inc,children:a.jsx("span",{className:"wu-text-base wm-add"})})]})]})},Gy=We.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"}}}),Fe={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"},Vc=f.memo(({className:e,label:t="Shared surveys",...n})=>a.jsxs("button",{className:m(Fe.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})]}));Vc.displayName="WuSharedSurvey";const Ky=(e,t=!1)=>{if(e)return a.jsx("span",{className:Fe.icon,"aria-hidden":"true",children:e});const n=t?"wm-folder-supervised":"wm-folder";return a.jsx("span",{className:m(Fe.icon,n),"aria-hidden":"true"})},Oc=f.memo(({children:e,icon:t,isActive:n,isShared:r,className:s,...o})=>a.jsxs("button",{className:m(Fe.listItem,n&&Fe.listItemActive,s),"aria-selected":n,"data-slot":"survey-select-item",type:"button",...o,children:[Ky(t,r),a.jsx("span",{className:Fe.label,children:e})]}));Oc.displayName="WuSurveyItem";const Fc=f.memo(({children:e,className:t,...n})=>a.jsx("div",{className:m(Fe.list,t),...n,children:e}));Fc.displayName="WuSurveyList";const Lc=e=>{const{className:t,variant:n="outlined",...r}=e;return a.jsx("div",{className:Fe.sourceWrapper,"data-slot":"survey-select-source",children:a.jsx(bl,{variant:n,showGroupSeparator:!0,className:m(Fe.source,t),...r})})};Lc.displayName="WuSurveySource";const Yy=f.memo(Lc),Wc=f.memo(({Sidebar:e,children:t,className:n,...r})=>a.jsxs("div",{className:m(Fe.container,n),role:"region","aria-label":"Survey selection interface","data-slot":"survey-select",...r,children:[e&&a.jsx("div",{className:Fe.sidebar,role:"complementary","aria-label":"Survey sidebar","data-slot":"survey-select-sidebar",children:e}),a.jsx("div",{className:Fe.content,"aria-label":"Survey content","data-slot":"survey-select-content",children:t})]}));Wc.displayName="WuSurveySelect";const Bc=We.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"}}),Xy=S.forwardRef(({className:e,variant:t,size:n,...r},s)=>a.jsx(Ja.Root,{ref:s,className:m(Bc({variant:t,size:n,className:e})),...r}));Xy.displayName=Ja.Root.displayName;const qc=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(qc.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(qc);return a.jsx(En.Item,{ref:o,className:m(Bc({variant:i.variant||n,size:i.size||r}),e),...s,children:t})});yt.displayName=En.Item.displayName;const $c=f.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})]})})});$c.displayName="_IconTab";const Hc=f.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})})]})})});Hc.displayName="_Tab";const zc=f.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})})]})})});zc.displayName="_Toggle";const Uc=f.forwardRef((e,t)=>{const{type:n,options:r,value:s,disabled:o,dir:i,size:u,onChange:l,toggle:d=!0,...c}=e,[w,p]=f.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),p(g)};if(f.useEffect(()=>{if(!Array.isArray(r)||r.length<2)throw new Error("Options are not sufficient");p(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(zc,{...c,ref:t,options:r,value:w||"opt1",onChange:h,disabled:o,dir:i});case"iconTab":return a.jsx($c,{ref:t,options:r,value:w||"opt1",onChange:h,disabled:o,dir:i});default:return a.jsx(Hc,{ref:t,options:r,value:w||"opt1",onChange:h,disabled:o,dir:i,size:u})}});Uc.displayName="WuSwitcher";const jc=lt.Root,Va=S.forwardRef(({className:e,children:t,...n},r)=>a.jsx(lt.List,{className:m("wu-relative wu-flex",e),...n,ref:r,children:t}));Va.displayName=lt.List.displayName;const Oa=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}));Oa.displayName=lt.Trigger.displayName;const Gc=S.forwardRef(({className:e,...t},n)=>a.jsx(lt.Content,{ref:n,className:e,...t}));Gc.displayName=lt.Content.displayName;const Kc=({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(Gc,{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))})},Zy=e=>{const[t,n]=f.useState(!1),[r,s]=f.useState(!1),o=()=>{const u=e.current;u&&(n(u.scrollLeft>0),s(u.scrollLeft+u.clientWidth<u.scrollWidth))};return f.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"})}}}},Yc=(e,t)=>{const[n,r]=f.useState({width:0,left:0,height:0,top:0}),s=t==="vertical";return f.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},Jy=({items:e,value:t,defaultValue:n,onValueChange:r,enableAnimation:s=!1,className:o,dir:i="ltr",position:u="top"})=>{var C;const l=f.useRef(null),d=Yc(l,"horizontal"),{showLeftArrow:c,showRightArrow:w,scrollByTab:p}=Zy(l),[h,b]=f.useState(!1),g=()=>p("left"),v=()=>p("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")}),x=(E,y,I)=>{const T=y==="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",I&&"wu-translate-x-0 wu-opacity-100",!I&&[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(jc,{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"),x(g,"left",c&&h),a.jsxs(Va,{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(Oa,{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"),x(v,"right",w&&h)]}),a.jsx(Kc,{items:e,enableAnimation:s})]})},Qy=e=>{const[t,n]=f.useState(!1),[r,s]=f.useState(!1),o=()=>{const u=e.current;u&&(n(u.scrollTop>0),s(u.scrollTop+u.clientHeight<u.scrollHeight))};return f.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"})}}}},Ry=({items:e,value:t,defaultValue:n,onValueChange:r,enableAnimation:s=!1,className:o,dir:i="ltr",position:u="left"})=>{var C;const l=f.useRef(null),d=Yc(l,"vertical"),{showTopArrow:c,showBottomArrow:w,scrollByTab:p}=Qy(l),[h,b]=f.useState(!1),g=()=>p("up"),v=()=>p("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")}),x=(E,y,I)=>{const T=y==="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",I&&"wu-translate-y-0 wu-opacity-100",!I&&[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(jc,{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"),x(g,"up",c&&h),a.jsxs(Va,{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(Oa,{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"),x(v,"down",w&&h)]}),a.jsx(Kc,{items:e,enableAnimation:s})]})},ev=({...e})=>e.orientation==="vertical"?a.jsx(Ry,{...e}):a.jsx(Jy,{...e}),Fa=S.forwardRef(({className:e,...t},n)=>a.jsx("table",{ref:n,className:m("wu-w-full wu-caption-bottom wu-text-sm",e),...t}));Fa.displayName="Table";const La=S.forwardRef(({className:e,...t},n)=>a.jsx("thead",{ref:n,className:m("[&_tr]:wu-border-b",e),...t}));La.displayName="TableHeader";const Sn=S.forwardRef(({className:e,...t},n)=>a.jsx("tbody",{ref:n,className:m("",e),...t}));Sn.displayName="TableBody";const tv=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}));tv.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";function Xc(){const e=f.useRef(null),[t,n]=f.useState(!1),[r,s]=f.useState(!1),o=f.useCallback(()=>{const i=e.current;i&&(n(i.scrollLeft>12),s(i.scrollLeft<i.scrollWidth-i.clientWidth-1))},[]);return f.useEffect(()=>{o()},[o]),{scrollContainerRef:e,isScrolledLeft:t,isScrolledRight:r,handleScroll:o}}const Zc=48,Jc="expander";function nv(e,t){return e?[{id:Jc,accessorKey:Jc,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:Zc},...t]:t}function rv(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 Wa(e){const t=new Map;let n=0;for(let s=0;s<e.length;s++){const o=e[s];if(o.columnDef.sticky!=="left")continue;const i=e[s+1];t.set(o.id,{sticky:"left",offset:n,isStickyEdge:!i||i.columnDef.sticky!=="left"}),n+=o.getSize()}let r=0;for(let s=e.length-1;s>=0;s--){const o=e[s];if(o.columnDef.sticky!=="right")continue;const i=e[s-1];t.set(o.id,{sticky:"right",offset:r,isStickyEdge:!i||i.columnDef.sticky!=="right"}),r+=o.getSize()}return t}function Sr(e,t,n,r){return t?e==="left"&&n?a.jsx("div",{style:{position:"absolute",top:0,right:-12,bottom:0,width:12,background:"linear-gradient(to right, rgba(115,115,115,0.12), transparent)",pointerEvents:"none"}}):e==="right"&&r?a.jsx("div",{style:{position:"absolute",top:0,left:-12,bottom:0,width:12,background:"linear-gradient(to left, rgba(115,115,115,0.12), transparent)",pointerEvents:"none"}}):null:null}function Qc(e,t,n){return e===!0&&(!t||n>t)}function Rc(e,t){const n=_e.flexRender(t.cell,e.getContext());return e.column.id!=="actions"?n:a.jsx("div",{className:"wu-opacity-0 wu-transition-opacity wu-duration-150 wu-ease-in-out group-hover:wu-opacity-100",children:n})}const sv=({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=f.useCallback(c=>w=>{s==null||s(w?c:[])},[s]);return{finalColumns:f.useMemo(()=>n?[{id:"select",header:({table:c})=>{const w=c.getRowModel().rows.map(h=>h.original).filter(h=>!(i!=null&&i(h))),p=l(w);return u?a.jsx("div",{}):a.jsx(qe,{checked:c.getIsSomeRowsSelected()||c.getIsAllRowsSelected(),partial:c.getIsSomeRowsSelected()&&!c.getIsAllRowsSelected(),onChange:h=>{c.toggleAllRowsSelected(!!h),p(!!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(qe,{checked:c.getIsSelected(),disabled:w,onChange:p=>{w||c.toggleSelected(!!p)},"aria-label":String(c.original[o])})},filterable:!1,accessorKey:"select",size:r},...e]:e,[e,n,l,i,u])}};function ed({data:e,columns:t,rowSelection:n,isRowExpandable:r}){var p;const[s,o]=f.useState({}),{finalColumns:i}=sv({columns:t,rowSelection:n}),u=f.useMemo(()=>{if(!(n!=null&&n.isEnabled))return{};const h={};for(const b of n.selectedRows){const g=e.findIndex(v=>v[n.rowUniqueKey]===b[n.rowUniqueKey]);g!==-1&&(h[g]=!0)}return h},[e,n]),l=f.useMemo(()=>i.filter(h=>h.enableSorting).map(h=>h.accessorKey),[i]),d=((p=n==null?void 0:n.selectedRows)==null?void 0:p.length)??0,c=f.useMemo(()=>nv(r,i),[i,r]);return{finalColumns:i,rowSelectionState:u,sortableColumns:l,selectedRowCount:d,columnsWithExpand:c,expanded:s,setExpanded:o,handleRowSelectionChange:h=>{const b=typeof h=="function"?h(u):h,g=[],v=n==null?void 0:n.isRowDisabled;for(const N in b){if(!b[N])continue;const x=e[Number(N)];x&&(v!=null&&v(x)||g.push(x))}n==null||n.onRowSelect(g)}}}const td=e=>m("wu-group wu-border-b wu-border-black/[12%] [--wu-row-overlay:transparent]","data-[state=selected]:[--wu-row-overlay:rgb(var(--wu-blue-p)/0.08)]",!e&&["hover:[--wu-row-overlay:rgba(0,0,0,0.02)]","data-[state=selected]:hover:[--wu-row-overlay:rgb(var(--wu-blue-p)/0.16)]"]),nd=(e="default",t)=>m("wu-py-0 wu-font-light wu-text-xs wu-bg-white","[background-image:linear-gradient(var(--wu-row-overlay),var(--wu-row-overlay))]",e==="compact"?"wu-h-8":"wu-h-10",t==="right"&&"wu-text-right",t==="center"&&"wu-text-center",t==="left"&&"wu-text-left"),av=(e="default")=>e==="compact"?"wu-h-8":"wu-h-10",ov=e=>m({"wu-text-right":e==="right","wu-text-center":e==="center","wu-text-left":e==="left"}),iv=e=>m({"wu-justify-end":e==="right","wu-justify-center":e==="center"}),uv=(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]"),lv=(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]"),rd=({table:e,size:t,NoDataContent:n,isLoading:r,CustomLoader:s,isRowDisabled:o,isRowExpandable:i,isScrolledLeft:u,isScrolledRight:l})=>{const d=e.getVisibleLeafColumns(),c=d.length,w=e.getRowModel().rows,p=Wa(d);return r?a.jsx(Sn,{children:a.jsx(st,{children:a.jsx($t,{colSpan:c,className:"wu-text-center wu-h-[35vh] wu-loader-container",children:s??a.jsx(ct,{className:"wu-w-full"})})})}):w.length?a.jsx(Sn,{children:w.flatMap((h,b)=>{const g=(o==null?void 0:o(h.original))??!1,v=h.getIsSelected(),N=h.getIsExpanded(),x=a.jsx(st,{"data-disabled":g,"data-state":v&&"selected",className:td(g),"data-expanded":N,children:h.getVisibleCells().map((E,y)=>{const I=E.column.columnDef,T=p.get(E.column.id);return a.jsxs($t,{className:m(nd(t,I.cellAlign),T&&"wu-sticky wu-z-[1]"),style:{width:`${E.column.getSize()}px`,...T&&{[T.sticky]:T.offset}},children:[Rc(E,I),Sr(T==null?void 0:T.sticky,(T==null?void 0:T.isStickyEdge)??!1,u,l)]},`${E.id}-${y}`)})},`${h.id}-${b}`),C=i&&N?rv(h,e.getVisibleLeafColumns()):null;return C?[x,a.jsx(st,{"data-expanded":"true","data-state":v&&"selected",children:a.jsx($t,{colSpan:c,children:C})},`${h.id}-expanded-${b}`)]:[x]})}):a.jsx(Sn,{children:a.jsx(st,{children:a.jsx($t,{colSpan:c,children:n})})})},Ba=({table:e,sortableColumns:t,manual:n=!1,onSort:r,size:s,isRowSelected:o,HeaderAction:i,isStickyHeader:u,asVirtualContent:l=!1,isRowExpandable:d,isScrolledLeft:c,isScrolledRight:w})=>{var E;const p=s==="compact"?"wu-h-8":"wu-h-10",h=e.getVisibleLeafColumns(),b=Wa(h),g=y=>{const{id:I,columnDef:T,getIsSorted:M,toggleSorting:k}=y,_=T.header,P=T.headerAlign;if(!t.includes(I))return _;const A=M(),O=A==="asc",F=A==="desc",V=()=>{n?r==null||r({id:I,desc:y.getIsSorted()==="asc"}):k(y.getIsSorted()==="asc")};return a.jsxs("button",{onClick:V,"aria-label":`Sort by ${_}`,className:m("wu-flex wu-items-center wu-gap-1 wu-w-full",iv(P)),children:[_,a.jsxs("div",{className:"wu-relative wu-flex-shrink-0 wu-w-4",children:[a.jsx("span",{className:lv(O,!!A)}),a.jsx("span",{className:uv(F,!!A)})]})]})},v=y=>{const I=y.column.id==="actions",T=b.get(y.column.id),M=T?{[T.sticky]:T.offset}:{};return I?a.jsx(Nr,{colSpan:y.colSpan,className:m("wu-text-xs wu-font-medium",T&&"wu-sticky wu-z-[2] wu-bg-[#EEEEEE]"),style:{width:`${y.getSize()}px`,...M},children:Sr(T==null?void 0:T.sticky,(T==null?void 0:T.isStickyEdge)??!1,c,w)},y.id):a.jsxs(Nr,{colSpan:y.colSpan,className:m("wu-text-xs wu-font-medium wu-bg-[#EEEEEE]",T?"wu-sticky wu-z-[2]":"wu-relative wu-z-0",ov(y.column.columnDef.headerAlign)),style:{width:`${y.getSize()}px`,...M},children:[_e.flexRender(g(y.column),y.getContext()),Sr(T==null?void 0:T.sticky,(T==null?void 0:T.isStickyEdge)??!1,c,w)]},y.id)},N=()=>e.getHeaderGroups().map(y=>a.jsx(st,{className:"wu-relative",children:y.headers.map(v)},y.id)),x=()=>{var y;return a.jsxs("div",{className:m("wu-flex wu-items-center wu-border-b wu-border-t wu-bg-gray-20",p),children:[a.jsx("div",{className:m("wu-flex wu-items-center wu-px-4"),style:{width:(y=h[0])==null?void 0:y.getSize(),marginLeft:d?Zc:void 0},children:a.jsx(qe,{checked:e.getIsSomeRowsSelected()||e.getIsAllRowsSelected(),partial:e.getIsSomeRowsSelected()&&!e.getIsAllRowsSelected(),onChange:I=>e.toggleAllRowsSelected(!!I),"aria-label":"Select all","data-testid":"select-all-header-checkbox"})}),a.jsx("div",{className:"wu-flex-1 wu-flex wu-pr-4",children:i})]})},C=o&&i;if(l){const y=((E=e.getHeaderGroups()[0])==null?void 0:E.headers)??[];return a.jsxs(st,{className:"wu-relative",children:[y.map(v),C&&a.jsx(Nr,{colSpan:h.length,className:"wu-p-0 wu-absolute wu-top-0 wu-left-0 wu-right-0 wu-z-10",children:x()})]})}return a.jsxs(La,{className:m("wu-border-t wu-border-black/[12%] wu-bg-gray-20 wu-relative",u&&"wu-sticky wu-top-[-.5px] wu-z-10",p),children:[N(),C&&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",p),children:x()})]})},sd=f.forwardRef((e,t)=>a.jsx(Sn,{...e,ref:t}));sd.displayName="TableBodyComponent";const ad=({table:e,size:t,isRowDisabled:n,containerHeight:r=600,sortableColumns:s,HeaderAction:o,isRowSelected:i,manual:u=!1,onSort:l,tableLayout:d="auto",isScrolledLeft:c,isScrolledRight:w})=>{const p=e.getRowModel().rows,h=e.getVisibleLeafColumns(),b=Wa(h);return a.jsx("div",{className:"wu-w-full",children:a.jsx(Ka.TableVirtuoso,{style:{height:r},totalCount:p.length,fixedHeaderContent:()=>a.jsx(Ba,{table:e,sortableColumns:s,manual:u,onSort:l,size:t,isRowSelected:i,HeaderAction:o,asVirtualContent:!0,isScrolledLeft:c,isScrolledRight:w}),itemContent:g=>{const v=p[g];return v?a.jsx(a.Fragment,{children:v.getVisibleCells().map((N,x)=>{const C=N.column.columnDef,E=b.get(N.column.id);return a.jsxs($t,{className:m(nd(t,C.cellAlign),E&&"wu-sticky wu-z-[1]"),style:E?{[E.sticky]:E.offset}:void 0,children:[Rc(N,C),Sr(E==null?void 0:E.sticky,(E==null?void 0:E.isStickyEdge)??!1,c,w)]},`${N.id}-${x}`)})}):null},components:{Table:({style:g,...v})=>a.jsxs("table",{...v,style:{...g,width:"100%",borderCollapse:"collapse",tableLayout:d},children:[a.jsx("colgroup",{children:h.map(N=>a.jsx("col",{style:{width:`${N.getSize()}px`}},N.id))}),v.children]}),TableBody:sd,TableHead:g=>a.jsx(La,{...g,className:m("wu-border-t wu-border-black/[12%] wu-bg-gray-20",av(t),g.className)}),TableRow:({...g})=>{const v=g["data-index"],N=p[v],x=N?(n==null?void 0:n(N.original))??!1:!1,C=(N==null?void 0:N.getIsSelected())??!1;return a.jsx(st,{...g,"data-disabled":x,"data-state":C&&"selected",className:td(x)})}}})})},Cr=We.cva("",{variants:{variant:{striped:'[&_tr:nth-child(even):not([data-expanded])_td]:wu-bg-zinc-50 [&_tr:nth-child(odd)[data-expanded]:not([data-state="selected"])_td]:wu-bg-zinc-50',unstyled:"",bordered:"wu-border-collapse wu-border wu-border-black/[12%] [&_th]:wu-border [&_td]:wu-border"}}}),cv=({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:p,isRowExpandable:h,tableLayout:b="fixed",style:g,className:v,...N})=>{var H;const[x,C]=f.useState(()=>(s==null?void 0:s.defaultSort)??null),{scrollContainerRef:E,isScrolledLeft:y,isScrolledRight:I,handleScroll:T}=Xc(),{rowSelectionState:M,sortableColumns:k,selectedRowCount:_,columnsWithExpand:P,expanded:A,setExpanded:O,handleRowSelectionChange:F}=ed({data:e,columns:t,rowSelection:i,isRowExpandable:h}),V=_e.useReactTable({data:e,columns:P,getCoreRowModel:_e.getCoreRowModel(),getPaginationRowModel:_e.getPaginationRowModel(),getExpandedRowModel:h?_e.getExpandedRowModel():void 0,manualPagination:!0,manualSorting:!0,manualFiltering:!0,enableRowSelection:i!=null&&i.isRowDisabled?q=>!i.isRowDisabled(q.original):!0,enableExpanding:!!h,state:{sorting:x?[{id:x.id,desc:x.desc}]:[],...i!=null&&i.isEnabled?{rowSelection:M}:{},...h?{expanded:A}:{}},onRowSelectionChange:F,...h?{onExpandedChange:O}:{}}),W=Qc(p==null?void 0:p.enabled,p==null?void 0:p.threshold,e.length),J=(p==null?void 0:p.maxHeight)??600;return a.jsx("div",{className:m("wu-text-gray-lead wu-table-container wu-relative",!W&&d&&"wu-h-full"),children:W?a.jsxs("div",{ref:E,onScroll:T,className:m("wu-overflow-x-auto wu-w-full",Cr({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"})}):(H=V.getRowModel().rows)!=null&&H.length?a.jsx(ad,{table:V,size:o,isRowDisabled:i==null?void 0:i.isRowDisabled,containerHeight:J,sortableColumns:k,HeaderAction:u,isRowSelected:_>0,manual:!0,onSort:q=>{C(q),s==null||s.onSort(q)},tableLayout:b,isScrolledLeft:y,isScrolledRight:I}):a.jsx("div",{className:"wu-p-4 wu-text-center",children:l})]}):a.jsx("div",{ref:E,onScroll:T,className:m("wu-overflow-x-auto wu-w-full",d&&"wu-overflow-y-auto wu-h-full"),children:a.jsxs(Fa,{...N,className:m("wu-w-full",Cr({variant:r}),v),style:{tableLayout:b,...g},children:[w&&a.jsx(Cn,{className:"wu-font-light",children:w}),a.jsx(Ba,{table:V,sortableColumns:k,manual:!0,onSort:q=>{C(q),s==null||s.onSort(q)},size:o,HeaderAction:u,isRowSelected:_>0,isStickyHeader:d,isRowExpandable:h,isScrolledLeft:y,isScrolledRight:I}),a.jsx(rd,{table:V,size:o,NoDataContent:l,CustomLoader:c,isLoading:n,isRowDisabled:i==null?void 0:i.isRowDisabled,isRowExpandable:h,isScrolledLeft:y,isScrolledRight:I})]})})})},dv=({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:p,rowSelection:h,isRowExpandable:b,virtualization:g,tableLayout:v="fixed",style:N,className:x,...C})=>{var K;const[E,y]=f.useState(()=>s!=null&&s.defaultSort?[{id:s.defaultSort.id,desc:s.defaultSort.desc}]:[]),[I,T]=f.useState([]),[M,k]=f.useState((i==null?void 0:i.pageIndex)??0),{scrollContainerRef:_,isScrolledLeft:P,isScrolledRight:A,handleScroll:O}=Xc(),{finalColumns:F,rowSelectionState:V,sortableColumns:W,selectedRowCount:J,columnsWithExpand:H,expanded:q,setExpanded:Q,handleRowSelectionChange:z}=ed({data:e,columns:t,rowSelection:h,isRowExpandable:b}),R=f.useMemo(()=>F.filter(L=>L.filterable).map(L=>L.accessorKey),[F]),ee=_e.useReactTable({data:e,columns:H,getCoreRowModel:_e.getCoreRowModel(),getFilteredRowModel:_e.getFilteredRowModel(),getSortedRowModel:_e.getSortedRowModel(),getPaginationRowModel:i?_e.getPaginationRowModel():void 0,getExpandedRowModel:b?_e.getExpandedRowModel():void 0,enableRowSelection:h!=null&&h.isRowDisabled?L=>!h.isRowDisabled(L.original):!0,enableExpanding:!!b,state:{sorting:E,columnFilters:I,...i?{pagination:i}:{},...h!=null&&h.isEnabled?{rowSelection:V}:{},...b?{expanded:q}:{}},onSortingChange:y,onColumnFiltersChange:T,onRowSelectionChange:z,...b?{onExpandedChange:Q}:{}});f.useEffect(()=>{R.forEach(L=>{var j;(j=ee.getColumn(L))==null||j.setFilterValue(o)})},[o,R,ee]),f.useEffect(()=>{i&&(i==null?void 0:i.pageIndex)!==M&&(h==null||h.onRowSelect(()=>[]),ee.resetRowSelection(),k(i.pageIndex))},[i==null?void 0:i.pageIndex]);const fe=Qc(g==null?void 0:g.enabled,g==null?void 0:g.threshold,e.length),ze=(g==null?void 0:g.maxHeight)??600;return a.jsx("div",{className:m("wu-text-gray-lead wu-table-container wu-relative",!fe&&u&&"wu-h-full"),children:fe?a.jsxs("div",{ref:_,onScroll:O,className:m("wu-overflow-x-auto wu-w-full",Cr({variant:n})),children:[p&&a.jsx(Cn,{children:p}),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"})}):(K=ee.getRowModel().rows)!=null&&K.length?a.jsx(ad,{table:ee,size:r,isRowDisabled:h==null?void 0:h.isRowDisabled,containerHeight:ze,sortableColumns:W,HeaderAction:l,isRowSelected:J>0,tableLayout:v,isScrolledLeft:P,isScrolledRight:A}):a.jsx("div",{className:"wu-p-4 wu-text-center",children:c})]}):a.jsx("div",{ref:_,onScroll:O,className:m("wu-overflow-x-auto wu-w-full",u&&"wu-overflow-y-auto wu-h-full"),children:a.jsxs(Fa,{...C,className:m(`wu-table-${v}`,"wu-w-full",Cr({variant:n}),x),style:{tableLayout:v,...N},children:[p&&a.jsx(Cn,{children:p}),a.jsx(Ba,{table:ee,sortableColumns:W,size:r,HeaderAction:l,isRowSelected:J>0,isStickyHeader:u,isRowExpandable:b,isScrolledLeft:P,isScrolledRight:A}),a.jsx(rd,{table:ee,size:r,NoDataContent:c,CustomLoader:d,isLoading:w,isRowDisabled:h==null?void 0:h.isRowDisabled,isRowExpandable:b,isScrolledLeft:P,isScrolledRight:A})]})})})},od=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}));od.displayName="Textarea";const id=f.forwardRef((e,t)=>{const{Label:n,id:r=Lr(),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(od,{...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(Me,{htmlFor:r,className:"wu-textarea-label",children:n})]})});id.displayName="WuTextarea";function wv(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 ud=["12",...Array.from({length:11},(e,t)=>String(t+1).padStart(2,"0"))],ld=Array.from({length:60},(e,t)=>String(t).padStart(2,"0")),cd=["am","pm"],Tr=50;function fv(e){return Array(Tr).fill(e).flat()}function qa(e,t){const n=e.indexOf(t);return[...e.slice(n),...e.slice(0,n)]}function pv(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 dd(e){const t=Number(e),n=t>=12?"pm":"am",r=t%12===0?12:t%12;return{hour:String(r),meridiem:n}}const hv=({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}),$a=({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?fv(e):e).map((i,u)=>a.jsx(hv,{value:i,isSelected:i===t,onClick:()=>r(i)},`${i}-${u}`))});function mv(e,t,n,r){const s=f.useMemo(()=>e?qa(ud,t.padStart(2,"0")):ud,[e]),o=f.useMemo(()=>e?qa(ld,n.padStart(2,"0")):ld,[e]),i=f.useMemo(()=>e?qa(cd,r):cd,[e]);return{rotatedHours:s,rotatedMinutes:o,rotatedMeridiem:i}}function gv(e,t,n){f.useEffect(()=>{function r(i){if(i){const u=i.scrollHeight/Tr,l=Math.floor(Tr/2);i.scrollTop=l*u;const d=()=>{const{scrollTop:c}=i,w=Math.round(c/u);(w<=1||w>=Tr-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 wd=({className:e,time:t,Label:n,labelPosition:r,dir:s,...o})=>{const[i,u]=f.useState(!1),[l,d]=f.useState(""),c=f.useRef(null),w=f.useRef(null),p=f.useRef(null),h=f.useRef(null),[b,g]=f.useState("12"),[v,N]=f.useState("00"),[x,C]=f.useState("am");f.useEffect(()=>{if(!t){d(""),g("12"),N("00"),C("am"),c.current&&(c.current.value="");return}const M=wv(t);d(M);const[k,_]=M.split(":"),{hour:P,meridiem:A}=dd(k);g(P),N(_),C(A),c.current&&(c.current.value=M)},[t]),f.useEffect(()=>{const M=k=>{w.current&&!w.current.contains(k.target)&&u(!1)};return document.addEventListener("mousedown",M),()=>{document.removeEventListener("mousedown",M)}},[]),gv(i,p,h);const{rotatedHours:E,rotatedMinutes:y,rotatedMeridiem:I}=mv(i,b,v,x),T=f.useCallback((M,k,_)=>{const P=M??b,A=k??v,O=_??x;g(P),N(A),C(O);const F=`${pv(P,O)}:${A}`;d(F)},[b,v,x]);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(Me,{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[k,_]=M.target.value.split(":"),{hour:P,meridiem:A}=dd(k);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(Pe,{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.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"})}));
|
|
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($a,{values:E,selectedValue:b.padStart(2,"0"),scrollRef:p,onSelect:M=>T(M,v),className:"wu-time-hour-picker"}),a.jsx($a,{values:y,selectedValue:v.padStart(2,"0"),scrollRef:h,onSelect:M=>T(b,M),className:"wu-time-minute-picker"}),a.jsx($a,{values:I,selectedValue:x,onSelect:M=>T(void 0,void 0,M),className:"wu-time-meridiem-picker",repeatItems:!1})]})]})]})};wd.displayName="WuTimePicker";const bv=1,yv=1e6;let Ha=0;function vv(){return Ha=(Ha+1)%Number.MAX_SAFE_INTEGER,Ha.toString()}const za=new Map,fd=e=>{if(za.has(e))return;const t=setTimeout(()=>{za.delete(e),Tn({type:"REMOVE_TOAST",toastId:e})},yv);za.set(e,t)},xv=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,bv)};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?fd(n):e.toasts.forEach(r=>{fd(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)}}},Er=[];let Mr={toasts:[]};function Tn(e){Mr=xv(Mr,e),Er.forEach(t=>{t(Mr)})}function pd({...e}){const t=vv(),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 Nv(){const[e,t]=f.useState(Mr);return f.useEffect(()=>(Er.push(t),()=>{const n=Er.indexOf(t);n>-1&&Er.splice(n,1)}),[e]),{...e,toast:pd,dismiss:n=>Tn({type:"DISMISS_TOAST",toastId:n})}}const Sv=()=>({showToast:({message:t,variant:n,duration:r,position:s})=>pd({description:t,variant:n,duration:r,position:s})}),Cv=Te.Provider,Tv=We.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"}}),hd=S.forwardRef(({className:e,position:t,...n},r)=>a.jsx(Te.Viewport,{ref:r,className:m(Tv({position:t}),e),...n}));hd.displayName=Te.Viewport.displayName;const Ev=We.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"}}),md=S.forwardRef(({className:e,variant:t,position:n,...r},s)=>a.jsx(Te.Root,{ref:s,className:m(Ev({variant:t,position:n}),e),...r}));md.displayName=Te.Root.displayName;const Mv=S.forwardRef(({className:e,...t},n)=>a.jsx(Te.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}));Mv.displayName=Te.Action.displayName;const gd=S.forwardRef(({className:e,...t},n)=>a.jsx(Te.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"})}));gd.displayName=Te.Close.displayName;const bd=S.forwardRef(({className:e,...t},n)=>a.jsx(Te.Title,{ref:n,className:m("wu-text-sm wu-font-semibold",e),...t}));bd.displayName=Te.Title.displayName;const yd=S.forwardRef(({className:e,...t},n)=>a.jsx(Te.Description,{ref:n,className:m("wu-text-sm wu-opacity-90",e),...t}));yd.displayName=Te.Description.displayName;function Iv(){const{toasts:e}=Nv(),t=e.reduce((n,r)=>{const s=r.position||"top";return n[s]||(n[s]=[]),n[s].push(r),n},{});return a.jsx(Cv,{children:Object.entries(t).map(([n,r])=>a.jsx(hd,{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(md,{variant:l||"success",position:d,...c,children:[a.jsxs("div",{className:"wu-grid wu-gap-1",children:[o&&a.jsx(bd,{children:o}),i&&a.jsxs(yd,{className:"wu-flex wu-items-center wu-gap-3 wu-pr-6",children:[a.jsx(Pe,{icon:w[l||"success"],className:"wu-text-xl"}),i]})]}),u,a.jsx(gd,{})]},s)})},n))})}const kv=()=>a.jsx(Iv,{}),vd=S.forwardRef(({className:e,dir:t,...n},r)=>a.jsx(Or.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(Or.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")})}));vd.displayName=Or.Root.displayName;const xd=f.forwardRef((e,t)=>{const{Label:n,labelPosition:r="right",onChange:s,className:o,dir:i,disabled:u,id:l=Lr(),...d}=e;return f.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(Dv({labelPosition:r}),"wu-toggle-container"),dir:i,children:[a.jsx(vd,{...d,id:l,disabled:u,ref:t,onCheckedChange:s,className:m("wu-peer",o),dir:i}),a.jsx(Me,{htmlFor:l,className:"wu-toggle-label",children:n})]})});xd.displayName="WuToggle";const Dv=We.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"}}}),Ir=f.createContext(null),Av=()=>{const e=f.useContext(Ir);if(!e)throw new Error("useTranslation must be used within a WuTranslationProvider");return e.useTranslation()},_v=()=>{const e=f.useContext(Ir);if(!e)throw new Error("useLoadTranslationsFunction must be used within a WuTranslationProvider");return e},Pv=({children:e})=>{const[t,n]=f.useState({}),[r,s]=f.useState({}),o=f.useCallback(async(d,c)=>{try{const p=await(await fetch(d)).json();n(p)}catch(w){console.error("Failed to load translations:",w),c&&n(c)}c&&s(c)},[]),i=f.useCallback(d=>{s(d)},[]),u=f.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(Ir.Provider,{value:l,children:e})},Vv={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"}},Nd=f.createContext(null),Sd=()=>{const e=f.useContext(Nd);if(!e)throw new Error("[WuTranslateProvider] Must be used within a provider.");return e},Ov=({children:e,defaultLocale:t="en",baseApi:n="https://admin2.questionpro.com/cs/api/gad/translate",keys:r="./wick-ui-i18n.json"})=>{const[s,o]=f.useState(t),[i,u]=f.useState({}),[l,d]=f.useState(!0);f.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=f.useMemo(()=>({dictionary:i,locale:s,setLocale:o,isLoading:l}),[i,s,l]);return a.jsx(Nd.Provider,{value:c,children:e})},Cd=f.memo(({__i18nKey:e})=>{const{dictionary:t}=Sd();return a.jsx(a.Fragment,{children:t[e]??e})});Cd.displayName="WuTranslate",typeof window<"u"&&(window.wickUiVersion="1.38.0",window.wickUiIcon="9.0.0",window.wickUiEditor="0.14.0"),Object.defineProperty(D,"useContext",{enumerable:!0,get:()=>f.useContext}),D.CHART_COLOR_SYSTEM=Vv,D.WuAccordion=Ud,D.WuActivityLog=Kd,D.WuAppHeader=pw,D.WuAppHeaderAccount=eo,D.WuAppHeaderBar=ao,D.WuAppHeaderHelp=to,D.WuAppHeaderMenu=so,D.WuAppHeaderSearch=ww,D.WuButton=Ee,D.WuCalender=Yr,D.WuCard=Go,D.WuCardFooter=Yo,D.WuCardHeader=Ko,D.WuCheckbox=qe,D.WuChip=Cf,D.WuCombobox=Pf,D.WuCopyToClipboard=Vf,D.WuDataTable=cv,D.WuDatePicker=vw,D.WuDateRangePicker=Nf,D.WuDisplay=sw,D.WuDrawer=$f,D.WuDrawerClose=Hf,D.WuDrilldown=jg,D.WuFooter=hl,D.WuFormGroup=yw,D.WuHeading=nw,D.WuHelpButton=ml,D.WuIcon=Pe,D.WuInput=Je,D.WuInputError=mw,D.WuInputHint=gw,D.WuLabel=Me,D.WuListbox=bl,D.WuLoader=ct,D.WuMenu=ha,D.WuMenuCheckboxItem=Og,D.WuMenuIcon=ma,D.WuMenuItem=wr,D.WuMenuItemGroup=Fg,D.WuMenuRadioItem=Lg,D.WuMenuSeparatorItem=Wg,D.WuModal=ub,D.WuModalClose=wb,D.WuModalContent=lb,D.WuModalFooter=db,D.WuModalHeader=cb,D.WuMonthPicker=gb,D.WuPagination=_l,D.WuPopover=bf,D.WuPopoverClose=ws,D.WuPrimaryNavbar=yb,D.WuRadioGroup=Fl,D.WuScrollArea=xb,D.WuSecondaryNavbar=vb,D.WuSelect=kl,D.WuSharedSurvey=Vc,D.WuSidebar=Zb,D.WuSidebarCollapsibleMenu=ty,D.WuSidebarContent=Jb,D.WuSidebarFooter=Qb,D.WuSidebarGroup=Rb,D.WuSidebarItem=ic,D.WuSidebarMenu=ey,D.WuSidebarTrigger=oc,D.WuSpotlight=Cl,D.WuStackedCard=sy,D.WuStackedCardOverlay=ay,D.WuStepper=jy,D.WuSubMenu=Bg,D.WuSubtext=rw,D.WuSurveyItem=Oc,D.WuSurveyList=Fc,D.WuSurveySelect=Wc,D.WuSurveySource=Yy,D.WuSwitcher=Uc,D.WuTab=ev,D.WuTable=dv,D.WuText=tw,D.WuTextarea=id,D.WuTimePicker=wd,D.WuToast=kv,D.WuToggle=xd,D.WuTooltip=In,D.WuTranslate=Cd,D.WuTranslateProvider=Ov,D.WuTranslationContext=Ir,D.WuTranslationProvider=Pv,D.WuTruncatedLabel=fw,D.WuVirtualScroll=kt,D.calculatePosition=ry,D.useTranslation=Av,D.useTranslationsContext=_v,D.useWickuiTranslate=Sd,D.useWuShowToast=Sv,D.useWuSidebar=rt,Object.defineProperty(D,Symbol.toStringTag,{value:"Module"})}));
|
|
21
21
|
//# sourceMappingURL=index.js.map
|